From: Andrea Amorese Date: Tue, 7 Sep 2021 13:24:31 +0000 (+0200) Subject: Built motion from commit 4807958f.|2.5.345 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:;/%22?a=commitdiff_plain;h=6ac99a4077a448a97389ac69958f7bbf4cb5022a;p=motion2.git Built motion from commit 4807958f.|2.5.345 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b4e18f7..e0240ac 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-07T13:02:36.020Z", + "time": "2021-09-07T13:14:31.783Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f8c5b15..588b9bd 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-07T13:02:36.020Z", + "time": "2021-09-07T13:14:31.783Z", "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 58cdda9..667d421 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 _0xffd6=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','script'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xffd6,0x97));var _0x6ffd=function(_0x11a962,_0x3cc338){_0x11a962=_0x11a962-0x0;var _0x55d423=_0xffd6[_0x11a962];return _0x55d423;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')],'get':function(_0x4fadac){return this['getDataValue'](_0x6ffd('0x3'));}},'action':{'type':Sequelize[_0x6ffd('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6ffd('0x5'),'integration',_0x6ffd('0x6'),_0x6ffd('0x7'),_0x6ffd('0x8'),_0x6ffd('0x9'),'bot',_0x6ffd('0xa')]],'msg':_0x6ffd('0xb')}},'comment':_0x6ffd('0xb')},'data1':{'type':Sequelize[_0x6ffd('0x4')](0x1000),'comment':_0x6ffd('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x6ffd('0xd')},'data3':{'type':Sequelize[_0x6ffd('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6ffd('0x4')](0x1000),'comments':_0x6ffd('0xe')},'data5':{'type':Sequelize[_0x6ffd('0x4')](0x1000),'comments':_0x6ffd('0xf')},'data6':{'type':Sequelize[_0x6ffd('0x4')],'comments':_0x6ffd('0x10')},'data7':{'type':Sequelize[_0x6ffd('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xa23f=['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)]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x191a05,_0x5a529c){var _0x420236=function(_0x2519e1){while(--_0x2519e1){_0x191a05['push'](_0x191a05['shift']());}};_0x420236(++_0x5a529c);}(_0xa23f,0x7c));var _0xfa23=function(_0x45268f,_0x52a274){_0x45268f=_0x45268f-0x0;var _0xba5854=_0xa23f[_0x45268f];return _0xba5854;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x48fd46){return this[_0xfa23('0x2')](_0xfa23('0x3'));}},'action':{'type':Sequelize[_0xfa23('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfa23('0x5'),'integration',_0xfa23('0x6'),'jscripty',_0xfa23('0x7'),_0xfa23('0x8'),_0xfa23('0x9'),_0xfa23('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfa23('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xfa23('0xc')},'data2':{'type':Sequelize[_0xfa23('0x4')](0x1000),'comment':_0xfa23('0xd')},'data3':{'type':Sequelize[_0xfa23('0x4')](0x1000),'comment':_0xfa23('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfa23('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xfa23('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xfa23('0xf')],'comments':_0xfa23('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 992a24d..bf7b24a 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 _0xe2ee=['offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','end','error','name','update','Action','catch','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','sendStatus','status'];(function(_0x560239,_0xc329f6){var _0x344a6c=function(_0x1a4e3d){while(--_0x1a4e3d){_0x560239['push'](_0x560239['shift']());}};_0x344a6c(++_0xc329f6);}(_0xe2ee,0x126));var _0xee2e=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xe2ee[_0xa9eaa0];return _0x30897a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee2e('0x1'));var rp=require(_0xee2e('0x2'));var moment=require(_0xee2e('0x3'));var BPromise=require(_0xee2e('0x4'));var Mustache=require(_0xee2e('0x5'));var util=require(_0xee2e('0x6'));var path=require(_0xee2e('0x7'));var sox=require(_0xee2e('0x8'));var csv=require(_0xee2e('0x9'));var ejs=require(_0xee2e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee2e('0xb'));var crypto=require(_0xee2e('0xc'));var jsforce=require(_0xee2e('0xd'));var deskjs=require(_0xee2e('0xe'));var toCsv=require(_0xee2e('0x9'));var querystring=require(_0xee2e('0xf'));var Papa=require(_0xee2e('0x10'));var Redis=require(_0xee2e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xee2e('0x12'));var as=require(_0xee2e('0x13'));var hardwareService=require(_0xee2e('0x14'));var logger=require(_0xee2e('0x15'))('api');var utils=require(_0xee2e('0x16'));var config=require(_0xee2e('0x17'));var licenseUtil=require(_0xee2e('0x18'));var db=require(_0xee2e('0x19'))['db'];function respondWithStatusCode(_0x4455eb,_0x218a4c){_0x218a4c=_0x218a4c||0xcc;return function(_0x1e036b){if(_0x1e036b){return _0x4455eb[_0xee2e('0x1a')](_0x218a4c);}return _0x4455eb['status'](_0x218a4c)['end']();};}function respondWithResult(_0x3bb344,_0x35a017){_0x35a017=_0x35a017||0xc8;return function(_0x39230b){if(_0x39230b){return _0x3bb344[_0xee2e('0x1b')](_0x35a017)['json'](_0x39230b);}};}function respondWithFilteredResult(_0x2203ce,_0x3f3fd9){return function(_0x586cb7){if(_0x586cb7){var _0xda2d7=typeof _0x3f3fd9[_0xee2e('0x1c')]==='undefined'&&typeof _0x3f3fd9[_0xee2e('0x1d')]===_0xee2e('0x1e');var _0x45c862=_0x586cb7[_0xee2e('0x1f')];var _0x5ef95a=_0xda2d7?0x0:_0x3f3fd9[_0xee2e('0x1c')];var _0x1faf2e=_0xda2d7?_0x586cb7[_0xee2e('0x1f')]:_0x3f3fd9[_0xee2e('0x1c')]+_0x3f3fd9[_0xee2e('0x1d')];var _0x4147dc;if(_0x1faf2e>=_0x45c862){_0x1faf2e=_0x45c862;_0x4147dc=0xc8;}else{_0x4147dc=0xce;}_0x2203ce[_0xee2e('0x1b')](_0x4147dc);return _0x2203ce['set'](_0xee2e('0x20'),_0x5ef95a+'-'+_0x1faf2e+'/'+_0x45c862)['json'](_0x586cb7);}return null;};}function patchUpdates(_0x10658b){return function(_0x392edf){try{jsonpatch[_0xee2e('0x21')](_0x392edf,_0x10658b,!![]);}catch(_0x49236e){return BPromise[_0xee2e('0x22')](_0x49236e);}return _0x392edf[_0xee2e('0x23')]();};}function saveUpdates(_0x28cd8b,_0x613e34){return function(_0x255094){if(_0x255094){return _0x255094['update'](_0x28cd8b)[_0xee2e('0x24')](function(_0x48afef){return _0x48afef;});}return null;};}function removeEntity(_0x34b6c2,_0x3a1b9b){return function(_0x246741){if(_0x246741){return _0x246741[_0xee2e('0x25')]()[_0xee2e('0x24')](function(){_0x34b6c2[_0xee2e('0x1b')](0xcc)[_0xee2e('0x26')]();});}};}function handleEntityNotFound(_0x1106de,_0x27bc64){return function(_0x2b8c5f){if(!_0x2b8c5f){_0x1106de[_0xee2e('0x1a')](0x194);}return _0x2b8c5f;};}function handleError(_0x595810,_0x269906){_0x269906=_0x269906||0x1f4;return function(_0xc3b51a){logger[_0xee2e('0x27')](_0xc3b51a['stack']);if(_0xc3b51a[_0xee2e('0x28')]){delete _0xc3b51a['name'];}_0x595810[_0xee2e('0x1b')](_0x269906)['send'](_0xc3b51a);};}exports[_0xee2e('0x29')]=function(_0x4b4dd9,_0x5aafb2){if(_0x4b4dd9['body']['id']){delete _0x4b4dd9['body']['id'];}return db[_0xee2e('0x2a')]['find']({'where':{'id':_0x4b4dd9['params']['id']}})['then'](handleEntityNotFound(_0x5aafb2,null))[_0xee2e('0x24')](saveUpdates(_0x4b4dd9['body'],null))[_0xee2e('0x24')](respondWithResult(_0x5aafb2,null))[_0xee2e('0x2b')](handleError(_0x5aafb2,null));};exports[_0xee2e('0x25')]=function(_0x412b16,_0x9ad1f4){return db['Action'][_0xee2e('0x2c')]({'where':{'id':_0x412b16[_0xee2e('0x2d')]['id']}})[_0xee2e('0x24')](handleEntityNotFound(_0x9ad1f4,null))[_0xee2e('0x24')](removeEntity(_0x9ad1f4,null))[_0xee2e('0x2b')](handleError(_0x9ad1f4,null));}; \ No newline at end of file +var _0xf02b=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','body','Action','params','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0xf02b,0x72));var _0xbf02=function(_0x36f3df,_0x2b1621){_0x36f3df=_0x36f3df-0x0;var _0xcfb7b7=_0xf02b[_0x36f3df];return _0xcfb7b7;};'use strict';var emlformat=require(_0xbf02('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf02('0x1'));var rp=require(_0xbf02('0x2'));var moment=require(_0xbf02('0x3'));var BPromise=require(_0xbf02('0x4'));var Mustache=require(_0xbf02('0x5'));var util=require(_0xbf02('0x6'));var path=require('path');var sox=require(_0xbf02('0x7'));var csv=require(_0xbf02('0x8'));var ejs=require(_0xbf02('0x9'));var fs=require('fs');var fs_extra=require(_0xbf02('0xa'));var _=require(_0xbf02('0xb'));var squel=require('squel');var crypto=require(_0xbf02('0xc'));var jsforce=require(_0xbf02('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf02('0x8'));var querystring=require(_0xbf02('0xe'));var Papa=require(_0xbf02('0xf'));var Redis=require(_0xbf02('0x10'));var authService=require(_0xbf02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf02('0x12'));var hardwareService=require(_0xbf02('0x13'));var logger=require(_0xbf02('0x14'))(_0xbf02('0x15'));var utils=require(_0xbf02('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbf02('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x81ed3a,_0xa8b124){_0xa8b124=_0xa8b124||0xcc;return function(_0x56edd1){if(_0x56edd1){return _0x81ed3a['sendStatus'](_0xa8b124);}return _0x81ed3a['status'](_0xa8b124)['end']();};}function respondWithResult(_0x5ecfcc,_0x10aad2){_0x10aad2=_0x10aad2||0xc8;return function(_0x46c9b9){if(_0x46c9b9){return _0x5ecfcc[_0xbf02('0x18')](_0x10aad2)[_0xbf02('0x19')](_0x46c9b9);}};}function respondWithFilteredResult(_0x460469,_0x1c3bab){return function(_0x253707){if(_0x253707){var _0x4b939b=typeof _0x1c3bab[_0xbf02('0x1a')]===_0xbf02('0x1b')&&typeof _0x1c3bab[_0xbf02('0x1c')]===_0xbf02('0x1b');var _0x554035=_0x253707['count'];var _0x5e3557=_0x4b939b?0x0:_0x1c3bab['offset'];var _0x3838d8=_0x4b939b?_0x253707[_0xbf02('0x1d')]:_0x1c3bab['offset']+_0x1c3bab[_0xbf02('0x1c')];var _0x375a20;if(_0x3838d8>=_0x554035){_0x3838d8=_0x554035;_0x375a20=0xc8;}else{_0x375a20=0xce;}_0x460469[_0xbf02('0x18')](_0x375a20);return _0x460469[_0xbf02('0x1e')](_0xbf02('0x1f'),_0x5e3557+'-'+_0x3838d8+'/'+_0x554035)[_0xbf02('0x19')](_0x253707);}return null;};}function patchUpdates(_0x142351){return function(_0x3e5244){try{jsonpatch[_0xbf02('0x20')](_0x3e5244,_0x142351,!![]);}catch(_0xb36f15){return BPromise[_0xbf02('0x21')](_0xb36f15);}return _0x3e5244['save']();};}function saveUpdates(_0x4e7d15,_0xaef000){return function(_0x1c037a){if(_0x1c037a){return _0x1c037a[_0xbf02('0x22')](_0x4e7d15)[_0xbf02('0x23')](function(_0x347bb6){return _0x347bb6;});}return null;};}function removeEntity(_0x39c93c,_0x47130e){return function(_0x363fcd){if(_0x363fcd){return _0x363fcd['destroy']()[_0xbf02('0x23')](function(){_0x39c93c[_0xbf02('0x18')](0xcc)[_0xbf02('0x24')]();});}};}function handleEntityNotFound(_0x27a059,_0x29438e){return function(_0x3bc5e1){if(!_0x3bc5e1){_0x27a059[_0xbf02('0x25')](0x194);}return _0x3bc5e1;};}function handleError(_0x500882,_0x8202b8){_0x8202b8=_0x8202b8||0x1f4;return function(_0x2a4446){logger[_0xbf02('0x26')](_0x2a4446[_0xbf02('0x27')]);if(_0x2a4446[_0xbf02('0x28')]){delete _0x2a4446[_0xbf02('0x28')];}_0x500882[_0xbf02('0x18')](_0x8202b8)[_0xbf02('0x29')](_0x2a4446);};}exports['update']=function(_0x3b8a7b,_0x4009ac){if(_0x3b8a7b[_0xbf02('0x2a')]['id']){delete _0x3b8a7b[_0xbf02('0x2a')]['id'];}return db[_0xbf02('0x2b')]['find']({'where':{'id':_0x3b8a7b[_0xbf02('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4009ac,null))['then'](saveUpdates(_0x3b8a7b[_0xbf02('0x2a')],null))['then'](respondWithResult(_0x4009ac,null))['catch'](handleError(_0x4009ac,null));};exports['destroy']=function(_0x1fc5f3,_0x5a5b23){return db['Action'][_0xbf02('0x2d')]({'where':{'id':_0x1fc5f3['params']['id']}})['then'](handleEntityNotFound(_0x5a5b23,null))[_0xbf02('0x23')](removeEntity(_0x5a5b23,null))['catch'](handleError(_0x5a5b23,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e21b8f9..11d9941 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 _0xc662=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3e0376,_0x53ebd5){var _0x4de5c2=function(_0x27eadb){while(--_0x27eadb){_0x3e0376['push'](_0x3e0376['shift']());}};_0x4de5c2(++_0x53ebd5);}(_0xc662,0xc6));var _0x2c66=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xc662[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x2c66('0x0'));var util=require(_0x2c66('0x1'));var logger=require(_0x2c66('0x2'))(_0x2c66('0x3'));var moment=require(_0x2c66('0x4'));var BPromise=require(_0x2c66('0x5'));var rp=require(_0x2c66('0x6'));var fs=require('fs');var path=require(_0x2c66('0x7'));var rimraf=require(_0x2c66('0x8'));var config=require(_0x2c66('0x9'));var attributes=require('./action.attributes');module[_0x2c66('0xa')]=function(_0xa7b235,_0x52ed35){return _0xa7b235[_0x2c66('0xb')](_0x2c66('0xc'),attributes,{'tableName':_0x2c66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3166=['api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','../../config/logger'];(function(_0x5f40df,_0x5828b8){var _0x3ae8db=function(_0x3a20e7){while(--_0x3a20e7){_0x5f40df['push'](_0x5f40df['shift']());}};_0x3ae8db(++_0x5828b8);}(_0x3166,0x8f));var _0x6316=function(_0x23cf75,_0x161061){_0x23cf75=_0x23cf75-0x0;var _0x435b10=_0x3166[_0x23cf75];return _0x435b10;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6316('0x0'))(_0x6316('0x1'));var moment=require(_0x6316('0x2'));var BPromise=require(_0x6316('0x3'));var rp=require(_0x6316('0x4'));var fs=require('fs');var path=require(_0x6316('0x5'));var rimraf=require('rimraf');var config=require(_0x6316('0x6'));var attributes=require(_0x6316('0x7'));module[_0x6316('0x8')]=function(_0x454ee6,_0x591aba){return _0x454ee6[_0x6316('0x9')](_0x6316('0xa'),attributes,{'tableName':_0x6316('0xb'),'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 8b75ab2..cdb755b 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3f4220,_0x3a92f3){var _0x5cdafc=function(_0x5705b2){while(--_0x5705b2){_0x3f4220['push'](_0x3f4220['shift']());}};_0x5cdafc(++_0x3a92f3);}(_0x1261,0x144));var _0x1126=function(_0x258257,_0x32042d){_0x258257=_0x258257-0x0;var _0xafb58a=_0x1261[_0x258257];return _0xafb58a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x3498b5,_0x3fc10d){_0x3498b5=_0x3498b5-0x0;var _0x38a316=_0x7a54[_0x3498b5];return _0x38a316;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 06bd318..b81e586 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 _0x4000=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated'];(function(_0x359364,_0x43ec83){var _0x1c4a28=function(_0x2c9ebc){while(--_0x2c9ebc){_0x359364['push'](_0x359364['shift']());}};_0x1c4a28(++_0x43ec83);}(_0x4000,0x148));var _0x0400=function(_0xf92004,_0x3adf7e){_0xf92004=_0xf92004-0x0;var _0x14a2dc=_0x4000[_0xf92004];return _0x14a2dc;};'use strict';var multer=require(_0x0400('0x0'));var util=require('util');var path=require(_0x0400('0x1'));var timeout=require(_0x0400('0x2'));var express=require(_0x0400('0x3'));var router=express[_0x0400('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0400('0x5'));var config=require(_0x0400('0x6'));var controller=require('./action.controller');router[_0x0400('0x7')](_0x0400('0x8'),auth[_0x0400('0x9')](),controller[_0x0400('0xa')]);router[_0x0400('0xb')](_0x0400('0x8'),auth[_0x0400('0x9')](),controller['destroy']);module[_0x0400('0xc')]=router; \ No newline at end of file +var _0x9da7=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','exports','multer','util'];(function(_0x55e0c0,_0x3acc79){var _0x2a44f2=function(_0x55e254){while(--_0x55e254){_0x55e0c0['push'](_0x55e0c0['shift']());}};_0x2a44f2(++_0x3acc79);}(_0x9da7,0x157));var _0x79da=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x9da7[_0x5c7525];return _0x2e2ec8;};'use strict';var multer=require(_0x79da('0x0'));var util=require(_0x79da('0x1'));var path=require(_0x79da('0x2'));var timeout=require(_0x79da('0x3'));var express=require('express');var router=express[_0x79da('0x4')]();var fs_extra=require(_0x79da('0x5'));var auth=require(_0x79da('0x6'));var interaction=require(_0x79da('0x7'));var config=require(_0x79da('0x8'));var controller=require('./action.controller');router[_0x79da('0x9')]('/:id',auth[_0x79da('0xa')](),controller[_0x79da('0xb')]);router[_0x79da('0xc')](_0x79da('0xd'),auth[_0x79da('0xa')](),controller['destroy']);module[_0x79da('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 02811bb..4872630 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x5075,0x73));var _0x5507=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x5075[_0x1d426f];return _0x17f71a;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x423e98,_0x24b380){var _0x566017=function(_0x4f68a2){while(--_0x4f68a2){_0x423e98['push'](_0x423e98['shift']());}};_0x566017(++_0x24b380);}(_0x31f0,0xb7));var _0x031f=function(_0x17c548,_0x5eca76){_0x17c548=_0x17c548-0x0;var _0x489a67=_0x31f0[_0x17c548];return _0x489a67;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 971cb0c..0f283b8 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 _0xeaa0=['foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','SELECT','left_join','right_join','SUM(%s)','HOUR(%s)','operator','Sequelize','select','MetricId','groupBy','DESC','output','web','fullPath','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','keyBy','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','map','AnalyticCustomReport','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','rawAttributes','catch','create','body','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','update','join','cross_join','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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','metric','function','format','replace','orderBy','order','alias','joins','parse','parentKey','foreignTable'];(function(_0x4d0adb,_0x345313){var _0x22ad29=function(_0x4617b2){while(--_0x4617b2){_0x4d0adb['push'](_0x4d0adb['shift']());}};_0x22ad29(++_0x345313);}(_0xeaa0,0x16e));var _0x0eaa=function(_0x57e50b,_0x16e856){_0x57e50b=_0x57e50b-0x0;var _0x4a1016=_0xeaa0[_0x57e50b];return _0x4a1016;};'use strict';var emlformat=require(_0x0eaa('0x0'));var rimraf=require(_0x0eaa('0x1'));var zipdir=require(_0x0eaa('0x2'));var jsonpatch=require(_0x0eaa('0x3'));var rp=require(_0x0eaa('0x4'));var moment=require('moment');var BPromise=require(_0x0eaa('0x5'));var Mustache=require(_0x0eaa('0x6'));var util=require('util');var path=require(_0x0eaa('0x7'));var sox=require(_0x0eaa('0x8'));var csv=require(_0x0eaa('0x9'));var ejs=require(_0x0eaa('0xa'));var fs=require('fs');var fs_extra=require(_0x0eaa('0xb'));var _=require('lodash');var squel=require(_0x0eaa('0xc'));var crypto=require(_0x0eaa('0xd'));var jsforce=require(_0x0eaa('0xe'));var deskjs=require(_0x0eaa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0eaa('0x10'));var Papa=require(_0x0eaa('0x11'));var Redis=require(_0x0eaa('0x12'));var authService=require(_0x0eaa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0eaa('0x14'));var hardwareService=require(_0x0eaa('0x15'));var logger=require(_0x0eaa('0x16'))('api');var utils=require(_0x0eaa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0eaa('0x18'));var db=require(_0x0eaa('0x19'))['db'];var dbH=require('../../mysqldb')[_0x0eaa('0x1a')];function respondWithStatusCode(_0x269b16,_0x17044a){_0x17044a=_0x17044a||0xcc;return function(_0x5d58c3){if(_0x5d58c3){return _0x269b16[_0x0eaa('0x1b')](_0x17044a);}return _0x269b16[_0x0eaa('0x1c')](_0x17044a)[_0x0eaa('0x1d')]();};}function respondWithResult(_0x18a764,_0x43a610){_0x43a610=_0x43a610||0xc8;return function(_0x41db76){if(_0x41db76){return _0x18a764[_0x0eaa('0x1c')](_0x43a610)[_0x0eaa('0x1e')](_0x41db76);}};}function respondWithFilteredResult(_0x1e7a37,_0x340168){return function(_0x35b866){if(_0x35b866){var _0x46b2bb=typeof _0x340168[_0x0eaa('0x1f')]===_0x0eaa('0x20')&&typeof _0x340168[_0x0eaa('0x21')]===_0x0eaa('0x20');var _0x37d583=_0x35b866[_0x0eaa('0x22')];var _0xc72475=_0x46b2bb?0x0:_0x340168[_0x0eaa('0x1f')];var _0x5cc8ec=_0x46b2bb?_0x35b866[_0x0eaa('0x22')]:_0x340168[_0x0eaa('0x1f')]+_0x340168[_0x0eaa('0x21')];var _0x5f5655;if(_0x5cc8ec>=_0x37d583){_0x5cc8ec=_0x37d583;_0x5f5655=0xc8;}else{_0x5f5655=0xce;}_0x1e7a37[_0x0eaa('0x1c')](_0x5f5655);return _0x1e7a37[_0x0eaa('0x23')](_0x0eaa('0x24'),_0xc72475+'-'+_0x5cc8ec+'/'+_0x37d583)['json'](_0x35b866);}return null;};}function patchUpdates(_0x22712e){return function(_0x5c5eeb){try{jsonpatch[_0x0eaa('0x25')](_0x5c5eeb,_0x22712e,!![]);}catch(_0x32ae94){return BPromise[_0x0eaa('0x26')](_0x32ae94);}return _0x5c5eeb[_0x0eaa('0x27')]();};}function saveUpdates(_0x22b3e8,_0x347504){return function(_0x50bcf4){if(_0x50bcf4){return _0x50bcf4['update'](_0x22b3e8)[_0x0eaa('0x28')](function(_0x29f3a8){return _0x29f3a8;});}return null;};}function removeEntity(_0x3e654f,_0x5f171b){return function(_0x302ce2){if(_0x302ce2){return _0x302ce2[_0x0eaa('0x29')]()[_0x0eaa('0x28')](function(){var _0x466781=_0x302ce2[_0x0eaa('0x2a')]({'plain':!![]});var _0x3ceec1='CustomReports';return db[_0x0eaa('0x2b')]['destroy']({'where':{'type':_0x3ceec1,'resourceId':_0x466781['id']}})[_0x0eaa('0x28')](function(){return _0x302ce2;});})[_0x0eaa('0x28')](function(){_0x3e654f[_0x0eaa('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d7e7,_0x463fbd){return function(_0x1a1eae){if(!_0x1a1eae){_0x21d7e7[_0x0eaa('0x1b')](0x194);}return _0x1a1eae;};}function handleError(_0x22dfe1,_0x5eabe1){_0x5eabe1=_0x5eabe1||0x1f4;return function(_0xc03a90){logger[_0x0eaa('0x2c')](_0xc03a90['stack']);if(_0xc03a90['name']){delete _0xc03a90[_0x0eaa('0x2d')];}_0x22dfe1[_0x0eaa('0x1c')](_0x5eabe1)[_0x0eaa('0x2e')](_0xc03a90);};}exports['index']=function(_0x49a18b,_0x5cf6d5){var _0x2ab268={},_0x321fcf={},_0x57e8a0={'count':0x0,'rows':[]};var _0x5e733c=_[_0x0eaa('0x2f')](db[_0x0eaa('0x30')]['rawAttributes'],function(_0x591c39){return{'name':_0x591c39[_0x0eaa('0x31')],'type':_0x591c39[_0x0eaa('0x32')][_0x0eaa('0x33')]};});_0x321fcf['model']=_[_0x0eaa('0x2f')](_0x5e733c,_0x0eaa('0x2d'));_0x321fcf['query']=_[_0x0eaa('0x34')](_0x49a18b[_0x0eaa('0x35')]);_0x321fcf[_0x0eaa('0x36')]=_['intersection'](_0x321fcf[_0x0eaa('0x37')],_0x321fcf[_0x0eaa('0x35')]);_0x2ab268[_0x0eaa('0x38')]=_[_0x0eaa('0x39')](_0x321fcf[_0x0eaa('0x37')],qs[_0x0eaa('0x3a')](_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x3a')]));_0x2ab268[_0x0eaa('0x38')]=_0x2ab268[_0x0eaa('0x38')][_0x0eaa('0x3b')]?_0x2ab268[_0x0eaa('0x38')]:_0x321fcf[_0x0eaa('0x37')];if(!_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x3c')](_0x0eaa('0x3d'))){_0x2ab268['limit']=qs[_0x0eaa('0x21')](_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x21')]);_0x2ab268['offset']=qs[_0x0eaa('0x1f')](_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x1f')]);}_0x2ab268['order']=qs[_0x0eaa('0x3e')](_0x49a18b['query'][_0x0eaa('0x3e')]);_0x2ab268[_0x0eaa('0x3f')]=qs[_0x0eaa('0x36')](_[_0x0eaa('0x40')](_0x49a18b[_0x0eaa('0x35')],_0x321fcf[_0x0eaa('0x36')]),_0x5e733c);if(_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x41')]){_0x2ab268[_0x0eaa('0x3f')]=_[_0x0eaa('0x42')](_0x2ab268[_0x0eaa('0x3f')],{'$or':_[_0x0eaa('0x2f')](_0x5e733c,function(_0x3fcef8){if(_0x3fcef8[_0x0eaa('0x32')]!=='VIRTUAL'){var _0x7672bb={};_0x7672bb[_0x3fcef8[_0x0eaa('0x2d')]]={'$like':'%'+_0x49a18b[_0x0eaa('0x35')]['filter']+'%'};return _0x7672bb;}})});}_0x2ab268=_['merge']({},_0x2ab268,_0x49a18b[_0x0eaa('0x43')]);var _0x4f82cc={'where':_0x2ab268[_0x0eaa('0x3f')]};return db[_0x0eaa('0x30')][_0x0eaa('0x22')](_0x4f82cc)[_0x0eaa('0x28')](function(_0x2178cb){_0x57e8a0['count']=_0x2178cb;if(_0x49a18b[_0x0eaa('0x35')][_0x0eaa('0x44')]){_0x2ab268['include']=[{'all':!![]}];}return db[_0x0eaa('0x30')][_0x0eaa('0x45')](_0x2ab268);})[_0x0eaa('0x28')](function(_0x59863a){_0x57e8a0['rows']=_0x59863a;return _0x57e8a0;})[_0x0eaa('0x28')](respondWithFilteredResult(_0x5cf6d5,_0x2ab268))['catch'](handleError(_0x5cf6d5,null));};exports[_0x0eaa('0x46')]=function(_0x24a1ae,_0x29e16f){var _0x353a84={'raw':![],'where':{'id':_0x24a1ae[_0x0eaa('0x47')]['id']}},_0x5ec717={};_0x5ec717[_0x0eaa('0x37')]=_[_0x0eaa('0x34')](db[_0x0eaa('0x30')][_0x0eaa('0x48')]);_0x5ec717[_0x0eaa('0x35')]=_[_0x0eaa('0x34')](_0x24a1ae[_0x0eaa('0x35')]);_0x5ec717[_0x0eaa('0x36')]=_[_0x0eaa('0x39')](_0x5ec717[_0x0eaa('0x37')],_0x5ec717['query']);_0x353a84[_0x0eaa('0x38')]=_[_0x0eaa('0x39')](_0x5ec717[_0x0eaa('0x37')],qs[_0x0eaa('0x3a')](_0x24a1ae[_0x0eaa('0x35')][_0x0eaa('0x3a')]));_0x353a84[_0x0eaa('0x38')]=_0x353a84[_0x0eaa('0x38')][_0x0eaa('0x3b')]?_0x353a84['attributes']:_0x5ec717[_0x0eaa('0x37')];if(_0x24a1ae[_0x0eaa('0x35')][_0x0eaa('0x44')]){_0x353a84['include']=[{'all':!![]}];}_0x353a84=_[_0x0eaa('0x42')]({},_0x353a84,_0x24a1ae[_0x0eaa('0x43')]);return db[_0x0eaa('0x30')]['find'](_0x353a84)[_0x0eaa('0x28')](handleEntityNotFound(_0x29e16f,null))[_0x0eaa('0x28')](respondWithResult(_0x29e16f,null))[_0x0eaa('0x49')](handleError(_0x29e16f,null));};exports[_0x0eaa('0x4a')]=function(_0x3fcff4,_0x1c04b6){return db[_0x0eaa('0x30')][_0x0eaa('0x4a')](_0x3fcff4[_0x0eaa('0x4b')],{})[_0x0eaa('0x28')](function(_0x2fb05e){var _0x42f412=_0x3fcff4['user'][_0x0eaa('0x2a')]({'plain':!![]});if(!_0x42f412)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42f412[_0x0eaa('0x4c')]===_0x0eaa('0x4d')){var _0x11acd0=_0x2fb05e['get']({'plain':!![]});var _0x337779=_0x0eaa('0x4e');return db[_0x0eaa('0x4f')][_0x0eaa('0x50')]({'where':{'name':_0x337779,'userProfileId':_0x42f412[_0x0eaa('0x51')]},'raw':!![]})['then'](function(_0x5a4e02){if(_0x5a4e02&&_0x5a4e02[_0x0eaa('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x11acd0[_0x0eaa('0x2d')],'resourceId':_0x11acd0['id'],'type':_0x0eaa('0x53'),'sectionId':_0x5a4e02['id']},{})['then'](function(){return _0x2fb05e;});}else{return _0x2fb05e;}})[_0x0eaa('0x49')](function(_0x3fbcd9){logger[_0x0eaa('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fbcd9);throw _0x3fbcd9;});}return _0x2fb05e;})[_0x0eaa('0x28')](respondWithResult(_0x1c04b6,0xc9))['catch'](handleError(_0x1c04b6,null));};exports[_0x0eaa('0x54')]=function(_0xeb8510,_0x524471){if(_0xeb8510[_0x0eaa('0x4b')]['id']){delete _0xeb8510[_0x0eaa('0x4b')]['id'];}return db[_0x0eaa('0x30')][_0x0eaa('0x50')]({'where':{'id':_0xeb8510[_0x0eaa('0x47')]['id']}})[_0x0eaa('0x28')](handleEntityNotFound(_0x524471,null))['then'](saveUpdates(_0xeb8510['body'],null))['then'](respondWithResult(_0x524471,null))[_0x0eaa('0x49')](handleError(_0x524471,null));};exports[_0x0eaa('0x29')]=function(_0x61f81f,_0x3af047){return db[_0x0eaa('0x30')][_0x0eaa('0x50')]({'where':{'id':_0x61f81f[_0x0eaa('0x47')]['id']}})[_0x0eaa('0x28')](handleEntityNotFound(_0x3af047,null))[_0x0eaa('0x28')](removeEntity(_0x3af047,null))[_0x0eaa('0x49')](handleError(_0x3af047,null));};exports['preview']=function(_0x2bd953,_0x209a13){var _0x72ba49=0xa;var _0x13e4bb=[_0x0eaa('0x55'),'left_join','right_join',_0x0eaa('0x56')];var _0x445778={'SUM':'SUM(%s)','COUNT':_0x0eaa('0x57'),'COUNT DISTINCT':_0x0eaa('0x58'),'MAX':_0x0eaa('0x59'),'MIN':_0x0eaa('0x5a'),'AVG':_0x0eaa('0x5b'),'GROUP_CONCAT':_0x0eaa('0x5c'),'GROUP_CONCAT ASC':_0x0eaa('0x5d'),'GROUP_CONCAT DESC':_0x0eaa('0x5e')};var _0x54d457={'SEC_TO_TIME':_0x0eaa('0x5f'),'DATE':_0x0eaa('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x0eaa('0x61'),'UNIX_TIMESTAMP':_0x0eaa('0x62')};var _0x452055=function(_0x9281be){return!_[_0x0eaa('0x63')]([_0x0eaa('0x64'),_0x0eaa('0x65'),_0x0eaa('0x66'),_0x0eaa('0x67')],_0x9281be);};var _0x1c94ac=function(_0x57db1c){if(!_0x57db1c||!_0x57db1c[_0x0eaa('0x68')][_0x0eaa('0x3b')]){return'';}for(var _0x3fefa8='(',_0x3d6a2a=0x0;_0x3d6a2a<_0x57db1c['rules'][_0x0eaa('0x3b')];_0x3d6a2a+=0x1){_0x3d6a2a>0x0&&(_0x3fefa8+='\x20'+_0x57db1c['operator']+'\x20');_0x3fefa8+=_0x57db1c[_0x0eaa('0x68')][_0x3d6a2a][_0x0eaa('0x69')]?_0x1c94ac(_0x57db1c['rules'][_0x3d6a2a]['group']):_0x57db1c[_0x0eaa('0x68')][_0x3d6a2a][_0x0eaa('0x6a')]+'\x20'+_0x57db1c[_0x0eaa('0x68')][_0x3d6a2a][_0x0eaa('0x6b')]+(_0x452055(_0x57db1c[_0x0eaa('0x68')][_0x3d6a2a][_0x0eaa('0x6b')])?'\x20'+_0x57db1c[_0x0eaa('0x68')][_0x3d6a2a][_0x0eaa('0x6c')]:'');}return _0x3fefa8+')';};var _0x2d0f2b={'where':{'id':_0x2bd953[_0x0eaa('0x47')]['id']}},_0x4c68f4,_0x406872,_0x28d65e,_0x495167,_0x216438;_0x2d0f2b=_['merge']({},_0x2d0f2b,_0x2bd953[_0x0eaa('0x43')]);return db[_0x0eaa('0x30')][_0x0eaa('0x50')](_0x2d0f2b)[_0x0eaa('0x28')](function(_0x5328d1){if(_0x5328d1){_0x4c68f4=_0x5328d1;return _0x5328d1[_0x0eaa('0x6d')]();}return null;})[_0x0eaa('0x28')](function(_0x19cde2){if(_0x19cde2){if(!_0x19cde2['length']){throw new db['Sequelize'][(_0x0eaa('0x6e'))](_0x0eaa('0x6f'),0x193);}_0x406872=_0x19cde2;return db[_0x0eaa('0x70')]['findAll']({'raw':!![]});}return null;})[_0x0eaa('0x28')](function(_0x3058cb){if(_0x3058cb){_0x28d65e=_['keyBy'](_0x3058cb,'id');var _0x173021;var _0x397574=squel['select']();_0x397574[_0x0eaa('0x71')](_0x4c68f4[_0x0eaa('0x72')]);for(var _0xc80081=0x0;_0xc80081<_0x406872['length'];_0xc80081+=0x1){_0x173021=_0x406872[_0xc80081]['MetricId']?_0x28d65e[_0x406872[_0xc80081]['MetricId']][_0x0eaa('0x73')]:_0x406872[_0xc80081]['field'];_0x173021=_0x406872[_0xc80081][_0x0eaa('0x74')]?_['replace'](_0x445778[_0x406872[_0xc80081][_0x0eaa('0x74')]],'%s',_0x173021):_0x173021;_0x173021=_0x406872[_0xc80081][_0x0eaa('0x75')]?_[_0x0eaa('0x76')](_0x54d457[_0x406872[_0xc80081][_0x0eaa('0x75')]],'%s',_0x173021):_0x173021;if(_0x406872[_0xc80081]['groupBy']){_0x397574[_0x0eaa('0x69')](_0x173021);}_0x406872[_0xc80081][_0x0eaa('0x77')]&&_0x397574[_0x0eaa('0x78')](_0x173021,_0x406872[_0xc80081][_0x0eaa('0x77')]==='DESC'?![]:!![]);_0x397574[_0x0eaa('0x6a')](_0x173021,_0x406872[_0xc80081][_0x0eaa('0x79')]||_0x173021);}if(_0x4c68f4['joins']){_0x4c68f4[_0x0eaa('0x7a')]=JSON[_0x0eaa('0x7b')](_0x4c68f4[_0x0eaa('0x7a')]);for(var _0x3646c5=0x0;_0x3646c5<_0x4c68f4['joins']['length'];_0x3646c5+=0x1){if(_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5]['type']&&_['includes'](_0x13e4bb,_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5][_0x0eaa('0x32')])&&_0x4c68f4['joins'][_0x3646c5][_0x0eaa('0x7c')]&&_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5][_0x0eaa('0x7d')]&&_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5][_0x0eaa('0x7e')]){_0x397574[_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5][_0x0eaa('0x32')]](_0x4c68f4['joins'][_0x3646c5][_0x0eaa('0x7d')],null,util[_0x0eaa('0x75')](_0x0eaa('0x7f'),_0x4c68f4[_0x0eaa('0x72')],_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5]['parentKey'],_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5][_0x0eaa('0x7d')],_0x4c68f4[_0x0eaa('0x7a')][_0x3646c5]['foreignKey']));}}}if(_0x4c68f4[_0x0eaa('0x80')]){_0x4c68f4[_0x0eaa('0x80')]=JSON[_0x0eaa('0x7b')](_0x4c68f4[_0x0eaa('0x80')]);_0x397574['where'](_0x1c94ac(_0x4c68f4['conditions']['group']));}_0x216438=_0x397574[_0x0eaa('0x81')]();_0x397574[_0x0eaa('0x21')](_0x72ba49);_0x397574[_0x0eaa('0x1f')](0x0);logger[_0x0eaa('0x82')]('Limited\x20Query:',_0x397574[_0x0eaa('0x83')]());return dbH[_0x0eaa('0x84')]['query'](_0x397574[_0x0eaa('0x83')](),{'type':dbH[_0x0eaa('0x84')]['QueryTypes'][_0x0eaa('0x85')]});}})[_0x0eaa('0x28')](respondWithResult(_0x209a13,null))[_0x0eaa('0x49')](handleError(_0x209a13,null));};function runReport(_0x3e8083,_0x25206a,_0x1fd160){var _0x1f46f7=_0x25206a[_0x0eaa('0x2d')];var _0x195307=0xa;var _0x1571e1=['join',_0x0eaa('0x86'),_0x0eaa('0x87'),_0x0eaa('0x56')];var _0x49af52={'SUM':_0x0eaa('0x88'),'COUNT':_0x0eaa('0x57'),'COUNT DISTINCT':_0x0eaa('0x58'),'MAX':'MAX(%s)','MIN':_0x0eaa('0x5a'),'AVG':_0x0eaa('0x5b'),'GROUP_CONCAT':_0x0eaa('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c0fb6={'SEC_TO_TIME':_0x0eaa('0x5f'),'DATE':'DATE(%s)','HOUR':_0x0eaa('0x89'),'ROUND':_0x0eaa('0x61'),'UNIX_TIMESTAMP':_0x0eaa('0x62')};var _0x55816e=function(_0x21f33a){return!_['includes']([_0x0eaa('0x64'),_0x0eaa('0x65'),_0x0eaa('0x66'),'IS\x20NOT\x20EMPTY'],_0x21f33a);};var _0x481e9b=function(_0x4d1135){if(!_0x4d1135||!_0x4d1135[_0x0eaa('0x68')][_0x0eaa('0x3b')]){return'';}for(var _0xd200e9='(',_0x2f8c94=0x0;_0x2f8c94<_0x4d1135[_0x0eaa('0x68')][_0x0eaa('0x3b')];_0x2f8c94+=0x1){_0x2f8c94>0x0&&(_0xd200e9+='\x20'+_0x4d1135[_0x0eaa('0x8a')]+'\x20');_0xd200e9+=_0x4d1135[_0x0eaa('0x68')][_0x2f8c94]['group']?_0x481e9b(_0x4d1135['rules'][_0x2f8c94][_0x0eaa('0x69')]):_0x4d1135[_0x0eaa('0x68')][_0x2f8c94]['field']+'\x20'+_0x4d1135[_0x0eaa('0x68')][_0x2f8c94]['condition']+(_0x55816e(_0x4d1135['rules'][_0x2f8c94][_0x0eaa('0x6b')])?'\x20'+_0x4d1135[_0x0eaa('0x68')][_0x2f8c94][_0x0eaa('0x6c')]:'');}return _0xd200e9+')';};var _0x3ee614={'where':{'id':_0x3e8083['id']}},_0x3588da,_0x370273,_0x261b0f,_0x3d471d,_0x1453da;_0x3ee614=_['merge']({},_0x3ee614,_0x1fd160);return db['AnalyticCustomReport'][_0x0eaa('0x50')](_0x3ee614)[_0x0eaa('0x28')](function(_0x7fd57f){if(_0x7fd57f){_0x3588da=_0x7fd57f;return _0x7fd57f[_0x0eaa('0x6d')]();}return null;})[_0x0eaa('0x28')](function(_0x3880c5){if(_0x3880c5){if(!_0x3880c5[_0x0eaa('0x3b')]){throw new db[(_0x0eaa('0x8b'))][(_0x0eaa('0x6e'))](_0x0eaa('0x6f'),0x193);}_0x370273=_0x3880c5;return db[_0x0eaa('0x70')][_0x0eaa('0x45')]({'raw':!![]});}return null;})[_0x0eaa('0x28')](function(_0x7df98f){if(_0x7df98f){_0x261b0f=_['keyBy'](_0x7df98f,'id');var _0x429097;var _0x409ffc=squel[_0x0eaa('0x8c')]();_0x409ffc[_0x0eaa('0x71')](_0x3588da[_0x0eaa('0x72')]);for(var _0x1536c2=0x0;_0x1536c2<_0x370273['length'];_0x1536c2+=0x1){_0x429097=_0x370273[_0x1536c2][_0x0eaa('0x8d')]?_0x261b0f[_0x370273[_0x1536c2][_0x0eaa('0x8d')]][_0x0eaa('0x73')]:_0x370273[_0x1536c2][_0x0eaa('0x6a')];_0x429097=_0x370273[_0x1536c2][_0x0eaa('0x74')]?_['replace'](_0x49af52[_0x370273[_0x1536c2][_0x0eaa('0x74')]],'%s',_0x429097):_0x429097;_0x429097=_0x370273[_0x1536c2][_0x0eaa('0x75')]?_['replace'](_0x3c0fb6[_0x370273[_0x1536c2][_0x0eaa('0x75')]],'%s',_0x429097):_0x429097;if(_0x370273[_0x1536c2][_0x0eaa('0x8e')]){_0x409ffc['group'](_0x429097);}_0x370273[_0x1536c2][_0x0eaa('0x77')]&&_0x409ffc['order'](_0x429097,_0x370273[_0x1536c2][_0x0eaa('0x77')]===_0x0eaa('0x8f')?![]:!![]);_0x409ffc['field'](_0x429097,_0x370273[_0x1536c2]['alias']||_0x429097);}if(_0x3588da['joins']){_0x3588da['joins']=JSON[_0x0eaa('0x7b')](_0x3588da[_0x0eaa('0x7a')]);for(var _0x55024e=0x0;_0x55024e<_0x3588da[_0x0eaa('0x7a')][_0x0eaa('0x3b')];_0x55024e+=0x1){if(_0x3588da[_0x0eaa('0x7a')][_0x55024e]['type']&&_[_0x0eaa('0x63')](_0x1571e1,_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x32')])&&_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x7c')]&&_0x3588da['joins'][_0x55024e]['foreignTable']&&_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x7e')]){_0x409ffc[_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x32')]](_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x7d')],null,util[_0x0eaa('0x75')](_0x0eaa('0x7f'),_0x3588da[_0x0eaa('0x72')],_0x3588da[_0x0eaa('0x7a')][_0x55024e]['parentKey'],_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x7d')],_0x3588da[_0x0eaa('0x7a')][_0x55024e][_0x0eaa('0x7e')]));}}}if(_0x3588da[_0x0eaa('0x80')]){_0x3588da[_0x0eaa('0x80')]=JSON[_0x0eaa('0x7b')](_0x3588da['conditions']);_0x409ffc[_0x0eaa('0x3f')](_0x481e9b(_0x3588da['conditions'][_0x0eaa('0x69')]));}_0x1453da=_0x409ffc[_0x0eaa('0x81')]();_0x409ffc['limit'](_0x195307);_0x409ffc['offset'](0x0);return;}})[_0x0eaa('0x28')](function(){if(_0x25206a[_0x0eaa('0x90')]===_0x0eaa('0x91')){return null;}var _0x463c73=_[_0x0eaa('0x42')](_0x25206a,{'name':_0x25206a[_0x0eaa('0x92')]||_0x25206a[_0x0eaa('0x2d')]||_0x3588da[_0x0eaa('0x2d')],'basename':_0x1f46f7,'savename':util[_0x0eaa('0x75')]('%s-%s.%s',_0x25206a[_0x0eaa('0x2d')]||_0x3588da['name'],require('randomstring')['generate'](0x4),_0x25206a[_0x0eaa('0x90')]||_0x0eaa('0x93')),'reportId':_0x3588da['id'],'reportType':_0x0eaa('0x94')});return db[_0x0eaa('0x95')][_0x0eaa('0x4a')](_0x463c73,{'raw':!![]});})[_0x0eaa('0x28')](function(_0x36478f){if(_0x3588da[_0x0eaa('0x72')]==='cdr'){_0x1453da[_0x0eaa('0x3f')](_0x3588da[_0x0eaa('0x72')]+_0x0eaa('0x96'),_0x25206a[_0x0eaa('0x97')],_0x25206a['endDate']);}else{_0x1453da[_0x0eaa('0x3f')](_0x3588da[_0x0eaa('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x25206a['startDate'],_0x25206a['endDate']);}if(_0x36478f){logger[_0x0eaa('0x98')](_0x0eaa('0x99'),_0x1453da[_0x0eaa('0x83')]());require('child_process')[_0x0eaa('0x9a')](path[_0x0eaa('0x55')](__dirname,_0x0eaa('0x9b'),_0x36478f[_0x0eaa('0x90')]),[_0x36478f['id'],_0x1453da[_0x0eaa('0x83')](),path['join'](__dirname,_0x0eaa('0x9c'),_0x36478f[_0x0eaa('0x9d')]),_0x1f46f7]);return _0x36478f;}else{var _0x45135d=squel[_0x0eaa('0x8c')]();_0x45135d['from']('('+_0x1453da['toString']()+')',_0x0eaa('0x9e'));_0x45135d[_0x0eaa('0x6a')](_0x0eaa('0x9f'),_0x0eaa('0x22'));_0x1453da[_0x0eaa('0x21')](_0x25206a['limit']||_0x195307);_0x1453da[_0x0eaa('0x1f')](_0x25206a[_0x0eaa('0x1f')]||0x0);return dbH[_0x0eaa('0x84')][_0x0eaa('0x35')](_0x45135d[_0x0eaa('0x83')](),{'type':dbH[_0x0eaa('0x84')][_0x0eaa('0xa0')][_0x0eaa('0x85')]})[_0x0eaa('0x28')](function(_0x5e68c6){if(!_0x5e68c6[_0x0eaa('0x3b')]){_0x3d471d=0x0;}else{_0x3d471d=_0x5e68c6[0x0][_0x0eaa('0x22')]||0x0;}return dbH['sequelize'][_0x0eaa('0x35')](_0x1453da[_0x0eaa('0x83')](),{'type':dbH[_0x0eaa('0x84')]['QueryTypes'][_0x0eaa('0x85')]});})[_0x0eaa('0x28')](function(_0x2e1030){return{'rows':_0x2e1030||[],'count':_0x3d471d};});}});}exports[_0x0eaa('0xa1')]=function(_0x3b8e2c,_0x5c787f){return runReport(_0x3b8e2c[_0x0eaa('0x47')],_0x3b8e2c[_0x0eaa('0x35')],_0x3b8e2c[_0x0eaa('0x43')])[_0x0eaa('0x28')](respondWithResult(_0x5c787f,null))['catch'](handleError(_0x5c787f,null));};exports['runReport']=runReport;exports['query']=function(_0x96dc09,_0x26951e){var _0x109ad0=0xa;var _0x32e560=[_0x0eaa('0x55'),'left_join','right_join',_0x0eaa('0x56')];var _0x242e18={'SUM':_0x0eaa('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0eaa('0x58'),'MAX':_0x0eaa('0x59'),'MIN':'MIN(%s)','AVG':_0x0eaa('0x5b'),'GROUP_CONCAT':_0x0eaa('0x5c'),'GROUP_CONCAT ASC':_0x0eaa('0x5d'),'GROUP_CONCAT DESC':_0x0eaa('0x5e')};var _0x2f0978={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x0eaa('0x89'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4dee3d=function(_0x46150d){return!_['includes']([_0x0eaa('0x64'),_0x0eaa('0x65'),_0x0eaa('0x66'),'IS\x20NOT\x20EMPTY'],_0x46150d);};var _0x227051=function(_0x1c8131){if(!_0x1c8131||!_0x1c8131[_0x0eaa('0x68')][_0x0eaa('0x3b')]){return'';}for(var _0x23e3f1='(',_0x3134f4=0x0;_0x3134f4<_0x1c8131['rules'][_0x0eaa('0x3b')];_0x3134f4+=0x1){_0x3134f4>0x0&&(_0x23e3f1+='\x20'+_0x1c8131['operator']+'\x20');_0x23e3f1+=_0x1c8131[_0x0eaa('0x68')][_0x3134f4][_0x0eaa('0x69')]?_0x227051(_0x1c8131[_0x0eaa('0x68')][_0x3134f4]['group']):_0x1c8131[_0x0eaa('0x68')][_0x3134f4]['field']+'\x20'+_0x1c8131['rules'][_0x3134f4][_0x0eaa('0x6b')]+(_0x4dee3d(_0x1c8131[_0x0eaa('0x68')][_0x3134f4][_0x0eaa('0x6b')])?'\x20'+_0x1c8131['rules'][_0x3134f4][_0x0eaa('0x6c')]:'');}return _0x23e3f1+')';};var _0x52b64d={'where':{'id':_0x96dc09[_0x0eaa('0x47')]['id']}},_0x3975c1,_0x5cea1f,_0x4a7ee7,_0x398e5f,_0x49ade1;_0x52b64d=_['merge']({},_0x52b64d,_0x96dc09[_0x0eaa('0x43')]);return db[_0x0eaa('0x30')][_0x0eaa('0x50')](_0x52b64d)['then'](function(_0x14622f){if(_0x14622f){_0x3975c1=_0x14622f;return _0x14622f[_0x0eaa('0x6d')]();}return null;})[_0x0eaa('0x28')](function(_0x2d72a1){if(_0x2d72a1){if(!_0x2d72a1[_0x0eaa('0x3b')]){throw new db[(_0x0eaa('0x8b'))]['ValidationErrorItem'](_0x0eaa('0x6f'),0x193);}_0x5cea1f=_0x2d72a1;return db[_0x0eaa('0x70')][_0x0eaa('0x45')]({'raw':!![]});}return null;})['then'](function(_0x59b0f2){if(_0x59b0f2){_0x4a7ee7=_[_0x0eaa('0xa2')](_0x59b0f2,'id');var _0x5368e1;var _0x3c9bf6=squel[_0x0eaa('0x8c')]();_0x3c9bf6[_0x0eaa('0x71')](_0x3975c1['table']);for(var _0x1d4420=0x0;_0x1d4420<_0x5cea1f[_0x0eaa('0x3b')];_0x1d4420+=0x1){_0x5368e1=_0x5cea1f[_0x1d4420][_0x0eaa('0x8d')]?_0x4a7ee7[_0x5cea1f[_0x1d4420][_0x0eaa('0x8d')]]['metric']:_0x5cea1f[_0x1d4420][_0x0eaa('0x6a')];_0x5368e1=_0x5cea1f[_0x1d4420][_0x0eaa('0x74')]?_[_0x0eaa('0x76')](_0x242e18[_0x5cea1f[_0x1d4420]['function']],'%s',_0x5368e1):_0x5368e1;_0x5368e1=_0x5cea1f[_0x1d4420]['format']?_[_0x0eaa('0x76')](_0x2f0978[_0x5cea1f[_0x1d4420][_0x0eaa('0x75')]],'%s',_0x5368e1):_0x5368e1;if(_0x5cea1f[_0x1d4420][_0x0eaa('0x8e')]){_0x3c9bf6[_0x0eaa('0x69')](_0x5368e1);}_0x5cea1f[_0x1d4420][_0x0eaa('0x77')]&&_0x3c9bf6[_0x0eaa('0x78')](_0x5368e1,_0x5cea1f[_0x1d4420]['orderBy']===_0x0eaa('0x8f')?![]:!![]);_0x3c9bf6[_0x0eaa('0x6a')](_0x5368e1,_0x5cea1f[_0x1d4420][_0x0eaa('0x79')]||_0x5368e1);}if(_0x3975c1[_0x0eaa('0x7a')]){_0x3975c1[_0x0eaa('0x7a')]=JSON[_0x0eaa('0x7b')](_0x3975c1['joins']);for(var _0x171094=0x0;_0x171094<_0x3975c1[_0x0eaa('0x7a')]['length'];_0x171094+=0x1){if(_0x3975c1[_0x0eaa('0x7a')][_0x171094]['type']&&_['includes'](_0x32e560,_0x3975c1[_0x0eaa('0x7a')][_0x171094][_0x0eaa('0x32')])&&_0x3975c1['joins'][_0x171094][_0x0eaa('0x7c')]&&_0x3975c1[_0x0eaa('0x7a')][_0x171094][_0x0eaa('0x7d')]&&_0x3975c1['joins'][_0x171094]['foreignKey']){_0x3c9bf6[_0x3975c1[_0x0eaa('0x7a')][_0x171094][_0x0eaa('0x32')]](_0x3975c1[_0x0eaa('0x7a')][_0x171094]['foreignTable'],null,util['format'](_0x0eaa('0x7f'),_0x3975c1[_0x0eaa('0x72')],_0x3975c1['joins'][_0x171094][_0x0eaa('0x7c')],_0x3975c1['joins'][_0x171094][_0x0eaa('0x7d')],_0x3975c1[_0x0eaa('0x7a')][_0x171094][_0x0eaa('0x7e')]));}}}if(_0x3975c1[_0x0eaa('0x80')]){_0x3975c1[_0x0eaa('0x80')]=JSON[_0x0eaa('0x7b')](_0x3975c1[_0x0eaa('0x80')]);_0x3c9bf6['where'](_0x227051(_0x3975c1['conditions'][_0x0eaa('0x69')]));}_0x49ade1=_0x3c9bf6['clone']();_0x3c9bf6[_0x0eaa('0x21')](_0x109ad0);_0x3c9bf6['offset'](0x0);logger[_0x0eaa('0x82')](_0x0eaa('0xa3'),_0x3c9bf6['toString']());return dbH[_0x0eaa('0x84')][_0x0eaa('0x35')](_0x3c9bf6[_0x0eaa('0x83')](),{'type':dbH[_0x0eaa('0x84')][_0x0eaa('0xa0')][_0x0eaa('0x85')]});}})[_0x0eaa('0x28')](function(){return{'sql':_0x49ade1[_0x0eaa('0x83')]()};})['then'](respondWithResult(_0x26951e,null))[_0x0eaa('0x49')](handleError(_0x26951e,null));}; \ No newline at end of file +var _0x2234=['startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','right_join','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','cross_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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','from','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2234,0x152));var _0x4223=function(_0x16cf9e,_0x3d3cfd){_0x16cf9e=_0x16cf9e-0x0;var _0x56aefd=_0x2234[_0x16cf9e];return _0x56aefd;};'use strict';var emlformat=require(_0x4223('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4223('0x1'));var jsonpatch=require(_0x4223('0x2'));var rp=require(_0x4223('0x3'));var moment=require(_0x4223('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4223('0x5'));var path=require('path');var sox=require(_0x4223('0x6'));var csv=require(_0x4223('0x7'));var ejs=require(_0x4223('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4223('0x9'));var squel=require(_0x4223('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4223('0xb'));var toCsv=require(_0x4223('0x7'));var querystring=require(_0x4223('0xc'));var Papa=require(_0x4223('0xd'));var Redis=require(_0x4223('0xe'));var authService=require(_0x4223('0xf'));var qs=require(_0x4223('0x10'));var as=require(_0x4223('0x11'));var hardwareService=require(_0x4223('0x12'));var logger=require('../../config/logger')(_0x4223('0x13'));var utils=require(_0x4223('0x14'));var config=require(_0x4223('0x15'));var licenseUtil=require(_0x4223('0x16'));var db=require(_0x4223('0x17'))['db'];var dbH=require('../../mysqldb')[_0x4223('0x18')];function respondWithStatusCode(_0x296cf3,_0x48b57f){_0x48b57f=_0x48b57f||0xcc;return function(_0x42a030){if(_0x42a030){return _0x296cf3[_0x4223('0x19')](_0x48b57f);}return _0x296cf3[_0x4223('0x1a')](_0x48b57f)[_0x4223('0x1b')]();};}function respondWithResult(_0x8c6729,_0xaf441){_0xaf441=_0xaf441||0xc8;return function(_0x1b4fa4){if(_0x1b4fa4){return _0x8c6729[_0x4223('0x1a')](_0xaf441)[_0x4223('0x1c')](_0x1b4fa4);}};}function respondWithFilteredResult(_0x1b9d98,_0x1f8db9){return function(_0x58b3a3){if(_0x58b3a3){var _0x310472=typeof _0x1f8db9[_0x4223('0x1d')]===_0x4223('0x1e')&&typeof _0x1f8db9['limit']===_0x4223('0x1e');var _0x5587cd=_0x58b3a3[_0x4223('0x1f')];var _0x3fd439=_0x310472?0x0:_0x1f8db9[_0x4223('0x1d')];var _0x1f34ee=_0x310472?_0x58b3a3['count']:_0x1f8db9[_0x4223('0x1d')]+_0x1f8db9[_0x4223('0x20')];var _0x23e7c0;if(_0x1f34ee>=_0x5587cd){_0x1f34ee=_0x5587cd;_0x23e7c0=0xc8;}else{_0x23e7c0=0xce;}_0x1b9d98[_0x4223('0x1a')](_0x23e7c0);return _0x1b9d98[_0x4223('0x21')](_0x4223('0x22'),_0x3fd439+'-'+_0x1f34ee+'/'+_0x5587cd)['json'](_0x58b3a3);}return null;};}function patchUpdates(_0x5d860b){return function(_0x27c904){try{jsonpatch['apply'](_0x27c904,_0x5d860b,!![]);}catch(_0x10e533){return BPromise[_0x4223('0x23')](_0x10e533);}return _0x27c904[_0x4223('0x24')]();};}function saveUpdates(_0x32c68b,_0x4b299c){return function(_0x147cc2){if(_0x147cc2){return _0x147cc2['update'](_0x32c68b)[_0x4223('0x25')](function(_0x4c87bf){return _0x4c87bf;});}return null;};}function removeEntity(_0x1db235,_0x19bbef){return function(_0x3846a7){if(_0x3846a7){return _0x3846a7[_0x4223('0x26')]()[_0x4223('0x25')](function(){var _0x4270d3=_0x3846a7[_0x4223('0x27')]({'plain':!![]});var _0x1d1ee7=_0x4223('0x28');return db[_0x4223('0x29')][_0x4223('0x26')]({'where':{'type':_0x1d1ee7,'resourceId':_0x4270d3['id']}})['then'](function(){return _0x3846a7;});})['then'](function(){_0x1db235['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4c89,_0x3b96a2){return function(_0x1ed114){if(!_0x1ed114){_0x5a4c89['sendStatus'](0x194);}return _0x1ed114;};}function handleError(_0x4080c5,_0x1ec59a){_0x1ec59a=_0x1ec59a||0x1f4;return function(_0x1532ee){logger[_0x4223('0x2a')](_0x1532ee[_0x4223('0x2b')]);if(_0x1532ee[_0x4223('0x2c')]){delete _0x1532ee[_0x4223('0x2c')];}_0x4080c5[_0x4223('0x1a')](_0x1ec59a)[_0x4223('0x2d')](_0x1532ee);};}exports[_0x4223('0x2e')]=function(_0x33570f,_0x15ba03){var _0x5907dc={},_0x2f6464={},_0x16a142={'count':0x0,'rows':[]};var _0xc4310b=_[_0x4223('0x2f')](db[_0x4223('0x30')][_0x4223('0x31')],function(_0x5deb3b){return{'name':_0x5deb3b[_0x4223('0x32')],'type':_0x5deb3b['type'][_0x4223('0x33')]};});_0x2f6464[_0x4223('0x34')]=_[_0x4223('0x2f')](_0xc4310b,_0x4223('0x2c'));_0x2f6464[_0x4223('0x35')]=_[_0x4223('0x36')](_0x33570f[_0x4223('0x35')]);_0x2f6464[_0x4223('0x37')]=_[_0x4223('0x38')](_0x2f6464['model'],_0x2f6464['query']);_0x5907dc['attributes']=_[_0x4223('0x38')](_0x2f6464[_0x4223('0x34')],qs['fields'](_0x33570f['query'][_0x4223('0x39')]));_0x5907dc['attributes']=_0x5907dc[_0x4223('0x3a')][_0x4223('0x3b')]?_0x5907dc['attributes']:_0x2f6464[_0x4223('0x34')];if(!_0x33570f[_0x4223('0x35')]['hasOwnProperty']('nolimit')){_0x5907dc[_0x4223('0x20')]=qs[_0x4223('0x20')](_0x33570f[_0x4223('0x35')][_0x4223('0x20')]);_0x5907dc['offset']=qs['offset'](_0x33570f['query']['offset']);}_0x5907dc[_0x4223('0x3c')]=qs[_0x4223('0x3d')](_0x33570f['query'][_0x4223('0x3d')]);_0x5907dc[_0x4223('0x3e')]=qs['filters'](_['pick'](_0x33570f['query'],_0x2f6464['filters']),_0xc4310b);if(_0x33570f['query'][_0x4223('0x3f')]){_0x5907dc[_0x4223('0x3e')]=_[_0x4223('0x40')](_0x5907dc['where'],{'$or':_['map'](_0xc4310b,function(_0xf67b1c){if(_0xf67b1c[_0x4223('0x41')]!==_0x4223('0x42')){var _0x4f800e={};_0x4f800e[_0xf67b1c[_0x4223('0x2c')]]={'$like':'%'+_0x33570f['query'][_0x4223('0x3f')]+'%'};return _0x4f800e;}})});}_0x5907dc=_[_0x4223('0x40')]({},_0x5907dc,_0x33570f[_0x4223('0x43')]);var _0x361155={'where':_0x5907dc[_0x4223('0x3e')]};return db[_0x4223('0x30')]['count'](_0x361155)[_0x4223('0x25')](function(_0x3a8f7a){_0x16a142[_0x4223('0x1f')]=_0x3a8f7a;if(_0x33570f[_0x4223('0x35')][_0x4223('0x44')]){_0x5907dc['include']=[{'all':!![]}];}return db[_0x4223('0x30')][_0x4223('0x45')](_0x5907dc);})[_0x4223('0x25')](function(_0x5d7607){_0x16a142[_0x4223('0x46')]=_0x5d7607;return _0x16a142;})['then'](respondWithFilteredResult(_0x15ba03,_0x5907dc))[_0x4223('0x47')](handleError(_0x15ba03,null));};exports[_0x4223('0x48')]=function(_0x1d8a34,_0x9a2100){var _0x56cb59={'raw':![],'where':{'id':_0x1d8a34['params']['id']}},_0x21cd52={};_0x21cd52[_0x4223('0x34')]=_[_0x4223('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x21cd52[_0x4223('0x35')]=_[_0x4223('0x36')](_0x1d8a34[_0x4223('0x35')]);_0x21cd52[_0x4223('0x37')]=_['intersection'](_0x21cd52[_0x4223('0x34')],_0x21cd52[_0x4223('0x35')]);_0x56cb59[_0x4223('0x3a')]=_[_0x4223('0x38')](_0x21cd52[_0x4223('0x34')],qs[_0x4223('0x39')](_0x1d8a34[_0x4223('0x35')][_0x4223('0x39')]));_0x56cb59[_0x4223('0x3a')]=_0x56cb59[_0x4223('0x3a')][_0x4223('0x3b')]?_0x56cb59[_0x4223('0x3a')]:_0x21cd52['model'];if(_0x1d8a34[_0x4223('0x35')][_0x4223('0x44')]){_0x56cb59[_0x4223('0x49')]=[{'all':!![]}];}_0x56cb59=_[_0x4223('0x40')]({},_0x56cb59,_0x1d8a34[_0x4223('0x43')]);return db[_0x4223('0x30')][_0x4223('0x4a')](_0x56cb59)[_0x4223('0x25')](handleEntityNotFound(_0x9a2100,null))[_0x4223('0x25')](respondWithResult(_0x9a2100,null))[_0x4223('0x47')](handleError(_0x9a2100,null));};exports[_0x4223('0x4b')]=function(_0xcc6d71,_0x2e4a7e){return db[_0x4223('0x30')][_0x4223('0x4b')](_0xcc6d71[_0x4223('0x4c')],{})['then'](function(_0x577f2d){var _0x4430cf=_0xcc6d71[_0x4223('0x4d')][_0x4223('0x27')]({'plain':!![]});if(!_0x4430cf)throw new Error(_0x4223('0x4e'));if(_0x4430cf['role']==='user'){var _0x46d646=_0x577f2d[_0x4223('0x27')]({'plain':!![]});var _0xdfc7fb='Reports';return db['UserProfileSection']['find']({'where':{'name':_0xdfc7fb,'userProfileId':_0x4430cf[_0x4223('0x4f')]},'raw':!![]})['then'](function(_0x24a581){if(_0x24a581&&_0x24a581[_0x4223('0x50')]===0x0){return db['UserProfileResource'][_0x4223('0x4b')]({'name':_0x46d646['name'],'resourceId':_0x46d646['id'],'type':'CustomReports','sectionId':_0x24a581['id']},{})[_0x4223('0x25')](function(){return _0x577f2d;});}else{return _0x577f2d;}})['catch'](function(_0x4da04d){logger[_0x4223('0x2a')](_0x4223('0x51'),_0x4da04d);throw _0x4da04d;});}return _0x577f2d;})['then'](respondWithResult(_0x2e4a7e,0xc9))[_0x4223('0x47')](handleError(_0x2e4a7e,null));};exports['update']=function(_0x482f53,_0x266a13){if(_0x482f53[_0x4223('0x4c')]['id']){delete _0x482f53[_0x4223('0x4c')]['id'];}return db['AnalyticCustomReport'][_0x4223('0x4a')]({'where':{'id':_0x482f53[_0x4223('0x52')]['id']}})['then'](handleEntityNotFound(_0x266a13,null))[_0x4223('0x25')](saveUpdates(_0x482f53[_0x4223('0x4c')],null))[_0x4223('0x25')](respondWithResult(_0x266a13,null))[_0x4223('0x47')](handleError(_0x266a13,null));};exports['destroy']=function(_0x11037e,_0x1cb1cd){return db['AnalyticCustomReport']['find']({'where':{'id':_0x11037e[_0x4223('0x52')]['id']}})[_0x4223('0x25')](handleEntityNotFound(_0x1cb1cd,null))[_0x4223('0x25')](removeEntity(_0x1cb1cd,null))['catch'](handleError(_0x1cb1cd,null));};exports[_0x4223('0x53')]=function(_0x470aed,_0x26a223){var _0x5768d1=0xa;var _0x3b3106=[_0x4223('0x54'),_0x4223('0x55'),'right_join',_0x4223('0x56')];var _0x10ba03={'SUM':'SUM(%s)','COUNT':_0x4223('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4223('0x58'),'MIN':_0x4223('0x59'),'AVG':_0x4223('0x5a'),'GROUP_CONCAT':_0x4223('0x5b'),'GROUP_CONCAT ASC':_0x4223('0x5c'),'GROUP_CONCAT DESC':_0x4223('0x5d')};var _0x17af03={'SEC_TO_TIME':_0x4223('0x5e'),'DATE':_0x4223('0x5f'),'HOUR':_0x4223('0x60'),'ROUND':_0x4223('0x61'),'UNIX_TIMESTAMP':_0x4223('0x62')};var _0xab617b=function(_0x503b52){return!_[_0x4223('0x63')]([_0x4223('0x64'),_0x4223('0x65'),'IS\x20EMPTY',_0x4223('0x66')],_0x503b52);};var _0x2fba83=function(_0x214f8c){if(!_0x214f8c||!_0x214f8c[_0x4223('0x67')][_0x4223('0x3b')]){return'';}for(var _0x33602a='(',_0x20c244=0x0;_0x20c244<_0x214f8c['rules'][_0x4223('0x3b')];_0x20c244+=0x1){_0x20c244>0x0&&(_0x33602a+='\x20'+_0x214f8c[_0x4223('0x68')]+'\x20');_0x33602a+=_0x214f8c[_0x4223('0x67')][_0x20c244][_0x4223('0x69')]?_0x2fba83(_0x214f8c[_0x4223('0x67')][_0x20c244][_0x4223('0x69')]):_0x214f8c[_0x4223('0x67')][_0x20c244][_0x4223('0x6a')]+'\x20'+_0x214f8c['rules'][_0x20c244][_0x4223('0x6b')]+(_0xab617b(_0x214f8c[_0x4223('0x67')][_0x20c244][_0x4223('0x6b')])?'\x20'+_0x214f8c['rules'][_0x20c244][_0x4223('0x6c')]:'');}return _0x33602a+')';};var _0x4b5ccc={'where':{'id':_0x470aed[_0x4223('0x52')]['id']}},_0x3a8908,_0x1d161a,_0x53023a,_0x1595c0,_0x242181;_0x4b5ccc=_[_0x4223('0x40')]({},_0x4b5ccc,_0x470aed[_0x4223('0x43')]);return db['AnalyticCustomReport']['find'](_0x4b5ccc)['then'](function(_0x144ba1){if(_0x144ba1){_0x3a8908=_0x144ba1;return _0x144ba1[_0x4223('0x6d')]();}return null;})[_0x4223('0x25')](function(_0x57cdb6){if(_0x57cdb6){if(!_0x57cdb6[_0x4223('0x3b')]){throw new db[(_0x4223('0x6e'))][(_0x4223('0x6f'))](_0x4223('0x70'),0x193);}_0x1d161a=_0x57cdb6;return db[_0x4223('0x71')]['findAll']({'raw':!![]});}return null;})[_0x4223('0x25')](function(_0x38587e){if(_0x38587e){_0x53023a=_[_0x4223('0x72')](_0x38587e,'id');var _0x1ef71c;var _0x522c07=squel[_0x4223('0x73')]();_0x522c07['from'](_0x3a8908[_0x4223('0x74')]);for(var _0x5727f2=0x0;_0x5727f2<_0x1d161a[_0x4223('0x3b')];_0x5727f2+=0x1){_0x1ef71c=_0x1d161a[_0x5727f2][_0x4223('0x75')]?_0x53023a[_0x1d161a[_0x5727f2][_0x4223('0x75')]][_0x4223('0x76')]:_0x1d161a[_0x5727f2][_0x4223('0x6a')];_0x1ef71c=_0x1d161a[_0x5727f2]['function']?_[_0x4223('0x77')](_0x10ba03[_0x1d161a[_0x5727f2][_0x4223('0x78')]],'%s',_0x1ef71c):_0x1ef71c;_0x1ef71c=_0x1d161a[_0x5727f2][_0x4223('0x79')]?_[_0x4223('0x77')](_0x17af03[_0x1d161a[_0x5727f2][_0x4223('0x79')]],'%s',_0x1ef71c):_0x1ef71c;if(_0x1d161a[_0x5727f2][_0x4223('0x7a')]){_0x522c07[_0x4223('0x69')](_0x1ef71c);}_0x1d161a[_0x5727f2]['orderBy']&&_0x522c07[_0x4223('0x3c')](_0x1ef71c,_0x1d161a[_0x5727f2][_0x4223('0x7b')]===_0x4223('0x7c')?![]:!![]);_0x522c07[_0x4223('0x6a')](_0x1ef71c,_0x1d161a[_0x5727f2][_0x4223('0x7d')]||_0x1ef71c);}if(_0x3a8908[_0x4223('0x7e')]){_0x3a8908['joins']=JSON[_0x4223('0x7f')](_0x3a8908[_0x4223('0x7e')]);for(var _0x1ecc9a=0x0;_0x1ecc9a<_0x3a8908[_0x4223('0x7e')][_0x4223('0x3b')];_0x1ecc9a+=0x1){if(_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x41')]&&_[_0x4223('0x63')](_0x3b3106,_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x41')])&&_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x80')]&&_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x81')]&&_0x3a8908[_0x4223('0x7e')][_0x1ecc9a]['foreignKey']){_0x522c07[_0x3a8908['joins'][_0x1ecc9a][_0x4223('0x41')]](_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x81')],null,util[_0x4223('0x79')]('%s.%s\x20=\x20%s.%s',_0x3a8908[_0x4223('0x74')],_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x80')],_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x81')],_0x3a8908[_0x4223('0x7e')][_0x1ecc9a][_0x4223('0x82')]));}}}if(_0x3a8908[_0x4223('0x83')]){_0x3a8908[_0x4223('0x83')]=JSON[_0x4223('0x7f')](_0x3a8908[_0x4223('0x83')]);_0x522c07[_0x4223('0x3e')](_0x2fba83(_0x3a8908[_0x4223('0x83')]['group']));}_0x242181=_0x522c07['clone']();_0x522c07[_0x4223('0x20')](_0x5768d1);_0x522c07[_0x4223('0x1d')](0x0);logger[_0x4223('0x84')](_0x4223('0x85'),_0x522c07[_0x4223('0x86')]());return dbH['sequelize'][_0x4223('0x35')](_0x522c07[_0x4223('0x86')](),{'type':dbH[_0x4223('0x87')][_0x4223('0x88')][_0x4223('0x89')]});}})[_0x4223('0x25')](respondWithResult(_0x26a223,null))[_0x4223('0x47')](handleError(_0x26a223,null));};function runReport(_0x5502f6,_0x6d2646,_0x39ca65){var _0x49b81e=_0x6d2646[_0x4223('0x2c')];var _0x2eee9c=0xa;var _0x201e0e=[_0x4223('0x54'),'left_join','right_join',_0x4223('0x56')];var _0x5289d8={'SUM':_0x4223('0x8a'),'COUNT':_0x4223('0x57'),'COUNT DISTINCT':_0x4223('0x8b'),'MAX':_0x4223('0x58'),'MIN':_0x4223('0x59'),'AVG':_0x4223('0x5a'),'GROUP_CONCAT':_0x4223('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4223('0x5d')};var _0x59c74c={'SEC_TO_TIME':_0x4223('0x5e'),'DATE':_0x4223('0x5f'),'HOUR':_0x4223('0x60'),'ROUND':_0x4223('0x61'),'UNIX_TIMESTAMP':_0x4223('0x62')};var _0x2a7ca1=function(_0x552af4){return!_[_0x4223('0x63')]([_0x4223('0x64'),'IS\x20NOT\x20NULL',_0x4223('0x8c'),'IS\x20NOT\x20EMPTY'],_0x552af4);};var _0x35caa2=function(_0x2c5080){if(!_0x2c5080||!_0x2c5080[_0x4223('0x67')][_0x4223('0x3b')]){return'';}for(var _0x2c9b5d='(',_0x20f160=0x0;_0x20f160<_0x2c5080['rules']['length'];_0x20f160+=0x1){_0x20f160>0x0&&(_0x2c9b5d+='\x20'+_0x2c5080['operator']+'\x20');_0x2c9b5d+=_0x2c5080[_0x4223('0x67')][_0x20f160][_0x4223('0x69')]?_0x35caa2(_0x2c5080[_0x4223('0x67')][_0x20f160][_0x4223('0x69')]):_0x2c5080[_0x4223('0x67')][_0x20f160][_0x4223('0x6a')]+'\x20'+_0x2c5080[_0x4223('0x67')][_0x20f160][_0x4223('0x6b')]+(_0x2a7ca1(_0x2c5080[_0x4223('0x67')][_0x20f160]['condition'])?'\x20'+_0x2c5080[_0x4223('0x67')][_0x20f160][_0x4223('0x6c')]:'');}return _0x2c9b5d+')';};var _0x12999={'where':{'id':_0x5502f6['id']}},_0x5a89b2,_0x337d41,_0x22121a,_0x2f3883,_0x23077a;_0x12999=_[_0x4223('0x40')]({},_0x12999,_0x39ca65);return db['AnalyticCustomReport'][_0x4223('0x4a')](_0x12999)[_0x4223('0x25')](function(_0x183d7d){if(_0x183d7d){_0x5a89b2=_0x183d7d;return _0x183d7d[_0x4223('0x6d')]();}return null;})[_0x4223('0x25')](function(_0x559498){if(_0x559498){if(!_0x559498[_0x4223('0x3b')]){throw new db[(_0x4223('0x6e'))][(_0x4223('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x337d41=_0x559498;return db[_0x4223('0x71')][_0x4223('0x45')]({'raw':!![]});}return null;})[_0x4223('0x25')](function(_0x376d13){if(_0x376d13){_0x22121a=_['keyBy'](_0x376d13,'id');var _0x729cb2;var _0x1992cf=squel[_0x4223('0x73')]();_0x1992cf[_0x4223('0x8d')](_0x5a89b2[_0x4223('0x74')]);for(var _0x4c5d7e=0x0;_0x4c5d7e<_0x337d41['length'];_0x4c5d7e+=0x1){_0x729cb2=_0x337d41[_0x4c5d7e]['MetricId']?_0x22121a[_0x337d41[_0x4c5d7e][_0x4223('0x75')]][_0x4223('0x76')]:_0x337d41[_0x4c5d7e]['field'];_0x729cb2=_0x337d41[_0x4c5d7e][_0x4223('0x78')]?_[_0x4223('0x77')](_0x5289d8[_0x337d41[_0x4c5d7e][_0x4223('0x78')]],'%s',_0x729cb2):_0x729cb2;_0x729cb2=_0x337d41[_0x4c5d7e][_0x4223('0x79')]?_[_0x4223('0x77')](_0x59c74c[_0x337d41[_0x4c5d7e][_0x4223('0x79')]],'%s',_0x729cb2):_0x729cb2;if(_0x337d41[_0x4c5d7e][_0x4223('0x7a')]){_0x1992cf[_0x4223('0x69')](_0x729cb2);}_0x337d41[_0x4c5d7e][_0x4223('0x7b')]&&_0x1992cf['order'](_0x729cb2,_0x337d41[_0x4c5d7e][_0x4223('0x7b')]==='DESC'?![]:!![]);_0x1992cf[_0x4223('0x6a')](_0x729cb2,_0x337d41[_0x4c5d7e]['alias']||_0x729cb2);}if(_0x5a89b2[_0x4223('0x7e')]){_0x5a89b2[_0x4223('0x7e')]=JSON[_0x4223('0x7f')](_0x5a89b2[_0x4223('0x7e')]);for(var _0x1cafc6=0x0;_0x1cafc6<_0x5a89b2[_0x4223('0x7e')][_0x4223('0x3b')];_0x1cafc6+=0x1){if(_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x41')]&&_[_0x4223('0x63')](_0x201e0e,_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x41')])&&_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x80')]&&_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x81')]&&_0x5a89b2['joins'][_0x1cafc6][_0x4223('0x82')]){_0x1992cf[_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x41')]](_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x81')],null,util[_0x4223('0x79')](_0x4223('0x8e'),_0x5a89b2[_0x4223('0x74')],_0x5a89b2[_0x4223('0x7e')][_0x1cafc6]['parentKey'],_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x81')],_0x5a89b2[_0x4223('0x7e')][_0x1cafc6][_0x4223('0x82')]));}}}if(_0x5a89b2[_0x4223('0x83')]){_0x5a89b2[_0x4223('0x83')]=JSON[_0x4223('0x7f')](_0x5a89b2['conditions']);_0x1992cf[_0x4223('0x3e')](_0x35caa2(_0x5a89b2[_0x4223('0x83')][_0x4223('0x69')]));}_0x23077a=_0x1992cf[_0x4223('0x8f')]();_0x1992cf[_0x4223('0x20')](_0x2eee9c);_0x1992cf[_0x4223('0x1d')](0x0);return;}})[_0x4223('0x25')](function(){if(_0x6d2646[_0x4223('0x90')]===_0x4223('0x91')){return null;}var _0x4738cc=_[_0x4223('0x40')](_0x6d2646,{'name':_0x6d2646[_0x4223('0x92')]||_0x6d2646[_0x4223('0x2c')]||_0x5a89b2['name'],'basename':_0x49b81e,'savename':util[_0x4223('0x79')](_0x4223('0x93'),_0x6d2646['name']||_0x5a89b2[_0x4223('0x2c')],require(_0x4223('0x94'))['generate'](0x4),_0x6d2646[_0x4223('0x90')]||_0x4223('0x95')),'reportId':_0x5a89b2['id'],'reportType':_0x4223('0x96')});return db[_0x4223('0x97')][_0x4223('0x4b')](_0x4738cc,{'raw':!![]});})[_0x4223('0x25')](function(_0x8d519e){if(_0x5a89b2[_0x4223('0x74')]===_0x4223('0x98')){_0x23077a[_0x4223('0x3e')](_0x5a89b2[_0x4223('0x74')]+_0x4223('0x99'),_0x6d2646[_0x4223('0x9a')],_0x6d2646['endDate']);}else{_0x23077a[_0x4223('0x3e')](_0x5a89b2['table']+_0x4223('0x9b'),_0x6d2646[_0x4223('0x9a')],_0x6d2646['endDate']);}if(_0x8d519e){logger['info'](_0x4223('0x9c'),_0x23077a[_0x4223('0x86')]());require('child_process')['fork'](path[_0x4223('0x54')](__dirname,_0x4223('0x9d'),_0x8d519e[_0x4223('0x90')]),[_0x8d519e['id'],_0x23077a[_0x4223('0x86')](),path['join'](__dirname,_0x4223('0x9e'),_0x8d519e['savename']),_0x49b81e]);return _0x8d519e;}else{var _0x11f3d0=squel[_0x4223('0x73')]();_0x11f3d0[_0x4223('0x8d')]('('+_0x23077a[_0x4223('0x86')]()+')',_0x4223('0x9f'));_0x11f3d0[_0x4223('0x6a')](_0x4223('0xa0'),_0x4223('0x1f'));_0x23077a[_0x4223('0x20')](_0x6d2646['limit']||_0x2eee9c);_0x23077a['offset'](_0x6d2646[_0x4223('0x1d')]||0x0);return dbH['sequelize'][_0x4223('0x35')](_0x11f3d0['toString'](),{'type':dbH['sequelize'][_0x4223('0x88')][_0x4223('0x89')]})['then'](function(_0x30bd8c){if(!_0x30bd8c[_0x4223('0x3b')]){_0x2f3883=0x0;}else{_0x2f3883=_0x30bd8c[0x0]['count']||0x0;}return dbH[_0x4223('0x87')][_0x4223('0x35')](_0x23077a[_0x4223('0x86')](),{'type':dbH[_0x4223('0x87')][_0x4223('0x88')]['SELECT']});})[_0x4223('0x25')](function(_0x7cddce){return{'rows':_0x7cddce||[],'count':_0x2f3883};});}});}exports[_0x4223('0xa1')]=function(_0xe9e470,_0x5dee07){return runReport(_0xe9e470[_0x4223('0x52')],_0xe9e470[_0x4223('0x35')],_0xe9e470['options'])[_0x4223('0x25')](respondWithResult(_0x5dee07,null))[_0x4223('0x47')](handleError(_0x5dee07,null));};exports[_0x4223('0xa2')]=runReport;exports[_0x4223('0x35')]=function(_0x1bb984,_0x57052f){var _0xaddbc9=0xa;var _0x40f4ee=[_0x4223('0x54'),_0x4223('0x55'),_0x4223('0xa3'),_0x4223('0x56')];var _0x4fa553={'SUM':_0x4223('0x8a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4223('0x58'),'MIN':_0x4223('0x59'),'AVG':_0x4223('0x5a'),'GROUP_CONCAT':_0x4223('0x5b'),'GROUP_CONCAT ASC':_0x4223('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xc880f6={'SEC_TO_TIME':_0x4223('0x5e'),'DATE':_0x4223('0x5f'),'HOUR':_0x4223('0x60'),'ROUND':_0x4223('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28de4f=function(_0xad6b6e){return!_[_0x4223('0x63')]([_0x4223('0x64'),_0x4223('0x65'),_0x4223('0x8c'),_0x4223('0x66')],_0xad6b6e);};var _0x500da7=function(_0x4381e7){if(!_0x4381e7||!_0x4381e7[_0x4223('0x67')][_0x4223('0x3b')]){return'';}for(var _0x3a55f8='(',_0xa26e7d=0x0;_0xa26e7d<_0x4381e7[_0x4223('0x67')][_0x4223('0x3b')];_0xa26e7d+=0x1){_0xa26e7d>0x0&&(_0x3a55f8+='\x20'+_0x4381e7['operator']+'\x20');_0x3a55f8+=_0x4381e7[_0x4223('0x67')][_0xa26e7d][_0x4223('0x69')]?_0x500da7(_0x4381e7[_0x4223('0x67')][_0xa26e7d]['group']):_0x4381e7[_0x4223('0x67')][_0xa26e7d]['field']+'\x20'+_0x4381e7[_0x4223('0x67')][_0xa26e7d][_0x4223('0x6b')]+(_0x28de4f(_0x4381e7[_0x4223('0x67')][_0xa26e7d][_0x4223('0x6b')])?'\x20'+_0x4381e7[_0x4223('0x67')][_0xa26e7d][_0x4223('0x6c')]:'');}return _0x3a55f8+')';};var _0x30015e={'where':{'id':_0x1bb984[_0x4223('0x52')]['id']}},_0x52a736,_0x12f896,_0x31be6c,_0x11c91c,_0x355dc1;_0x30015e=_[_0x4223('0x40')]({},_0x30015e,_0x1bb984[_0x4223('0x43')]);return db[_0x4223('0x30')]['find'](_0x30015e)[_0x4223('0x25')](function(_0x422a90){if(_0x422a90){_0x52a736=_0x422a90;return _0x422a90[_0x4223('0x6d')]();}return null;})[_0x4223('0x25')](function(_0x36ec44){if(_0x36ec44){if(!_0x36ec44[_0x4223('0x3b')]){throw new db[(_0x4223('0x6e'))][(_0x4223('0x6f'))](_0x4223('0x70'),0x193);}_0x12f896=_0x36ec44;return db['AnalyticMetric'][_0x4223('0x45')]({'raw':!![]});}return null;})[_0x4223('0x25')](function(_0x5ea34c){if(_0x5ea34c){_0x31be6c=_[_0x4223('0x72')](_0x5ea34c,'id');var _0x5e164f;var _0x513d67=squel['select']();_0x513d67[_0x4223('0x8d')](_0x52a736[_0x4223('0x74')]);for(var _0x442b6a=0x0;_0x442b6a<_0x12f896[_0x4223('0x3b')];_0x442b6a+=0x1){_0x5e164f=_0x12f896[_0x442b6a]['MetricId']?_0x31be6c[_0x12f896[_0x442b6a][_0x4223('0x75')]][_0x4223('0x76')]:_0x12f896[_0x442b6a][_0x4223('0x6a')];_0x5e164f=_0x12f896[_0x442b6a][_0x4223('0x78')]?_['replace'](_0x4fa553[_0x12f896[_0x442b6a][_0x4223('0x78')]],'%s',_0x5e164f):_0x5e164f;_0x5e164f=_0x12f896[_0x442b6a][_0x4223('0x79')]?_[_0x4223('0x77')](_0xc880f6[_0x12f896[_0x442b6a]['format']],'%s',_0x5e164f):_0x5e164f;if(_0x12f896[_0x442b6a][_0x4223('0x7a')]){_0x513d67[_0x4223('0x69')](_0x5e164f);}_0x12f896[_0x442b6a][_0x4223('0x7b')]&&_0x513d67[_0x4223('0x3c')](_0x5e164f,_0x12f896[_0x442b6a][_0x4223('0x7b')]===_0x4223('0x7c')?![]:!![]);_0x513d67[_0x4223('0x6a')](_0x5e164f,_0x12f896[_0x442b6a][_0x4223('0x7d')]||_0x5e164f);}if(_0x52a736[_0x4223('0x7e')]){_0x52a736[_0x4223('0x7e')]=JSON[_0x4223('0x7f')](_0x52a736[_0x4223('0x7e')]);for(var _0x1d4971=0x0;_0x1d4971<_0x52a736[_0x4223('0x7e')][_0x4223('0x3b')];_0x1d4971+=0x1){if(_0x52a736[_0x4223('0x7e')][_0x1d4971][_0x4223('0x41')]&&_[_0x4223('0x63')](_0x40f4ee,_0x52a736[_0x4223('0x7e')][_0x1d4971][_0x4223('0x41')])&&_0x52a736[_0x4223('0x7e')][_0x1d4971]['parentKey']&&_0x52a736[_0x4223('0x7e')][_0x1d4971][_0x4223('0x81')]&&_0x52a736[_0x4223('0x7e')][_0x1d4971]['foreignKey']){_0x513d67[_0x52a736[_0x4223('0x7e')][_0x1d4971]['type']](_0x52a736[_0x4223('0x7e')][_0x1d4971][_0x4223('0x81')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x52a736[_0x4223('0x74')],_0x52a736['joins'][_0x1d4971][_0x4223('0x80')],_0x52a736['joins'][_0x1d4971]['foreignTable'],_0x52a736[_0x4223('0x7e')][_0x1d4971][_0x4223('0x82')]));}}}if(_0x52a736[_0x4223('0x83')]){_0x52a736['conditions']=JSON['parse'](_0x52a736['conditions']);_0x513d67[_0x4223('0x3e')](_0x500da7(_0x52a736[_0x4223('0x83')][_0x4223('0x69')]));}_0x355dc1=_0x513d67[_0x4223('0x8f')]();_0x513d67[_0x4223('0x20')](_0xaddbc9);_0x513d67[_0x4223('0x1d')](0x0);logger[_0x4223('0x84')](_0x4223('0x85'),_0x513d67[_0x4223('0x86')]());return dbH['sequelize'][_0x4223('0x35')](_0x513d67[_0x4223('0x86')](),{'type':dbH[_0x4223('0x87')][_0x4223('0x88')][_0x4223('0x89')]});}})[_0x4223('0x25')](function(){return{'sql':_0x355dc1[_0x4223('0x86')]()};})[_0x4223('0x25')](respondWithResult(_0x57052f,null))['catch'](handleError(_0x57052f,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 33b3ba4..07f5fd1 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 _0x47dd=['rimraf','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash','moment','bluebird','path'];(function(_0x562163,_0x264e2a){var _0x551eed=function(_0x5ecde8){while(--_0x5ecde8){_0x562163['push'](_0x562163['shift']());}};_0x551eed(++_0x264e2a);}(_0x47dd,0x19a));var _0xd47d=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x47dd[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0xd47d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd47d('0x1'));var BPromise=require(_0xd47d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd47d('0x3'));var rimraf=require(_0xd47d('0x4'));var config=require(_0xd47d('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x5df841,_0x44be07){return _0x5df841[_0xd47d('0x6')](_0xd47d('0x7'),attributes,{'tableName':_0xd47d('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bd3=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x3f01dd,_0x128e0f){var _0x4bae40=function(_0x35a022){while(--_0x35a022){_0x3f01dd['push'](_0x3f01dd['shift']());}};_0x4bae40(++_0x128e0f);}(_0x1bd3,0x1ba));var _0x31bd=function(_0x359ef4,_0x2b98c5){_0x359ef4=_0x359ef4-0x0;var _0x369f12=_0x1bd3[_0x359ef4];return _0x369f12;};'use strict';var _=require(_0x31bd('0x0'));var util=require(_0x31bd('0x1'));var logger=require('../../config/logger')(_0x31bd('0x2'));var moment=require(_0x31bd('0x3'));var BPromise=require(_0x31bd('0x4'));var rp=require(_0x31bd('0x5'));var fs=require('fs');var path=require(_0x31bd('0x6'));var rimraf=require(_0x31bd('0x7'));var config=require(_0x31bd('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x31bd('0x9')]=function(_0x1c9bba,_0x173b17){return _0x1c9bba[_0x31bd('0xa')](_0x31bd('0xb'),attributes,{'tableName':_0x31bd('0xc'),'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 c4143cf..c2af41d 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 _0xfecb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x384ec2,_0xf97ded){var _0x518ddb=function(_0x30f839){while(--_0x30f839){_0x384ec2['push'](_0x384ec2['shift']());}};_0x518ddb(++_0xf97ded);}(_0xfecb,0x1ca));var _0xbfec=function(_0x4e6908,_0x1187ab){_0x4e6908=_0x4e6908-0x0;var _0x1a2439=_0xfecb[_0x4e6908];return _0x1a2439;};'use strict';var _=require(_0xbfec('0x0'));var util=require('util');var moment=require(_0xbfec('0x1'));var BPromise=require(_0xbfec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfec('0x3'))['db'];var utils=require(_0xbfec('0x4'));var logger=require(_0xbfec('0x5'))('rpc');var config=require(_0xbfec('0x6'));var jayson=require(_0xbfec('0x7'));var client=jayson[_0xbfec('0x8')][_0xbfec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584a92,_0x428268,_0x385995){return new BPromise(function(_0x5b6260,_0x4020ed){return client[_0xbfec('0xa')](_0x584a92,_0x385995)[_0xbfec('0xb')](function(_0x386b0b){logger[_0xbfec('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x428268,'request\x20sent');logger[_0xbfec('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x428268,_0xbfec('0xe'),JSON[_0xbfec('0xf')](_0x386b0b));if(_0x386b0b[_0xbfec('0x10')]){if(_0x386b0b[_0xbfec('0x10')]['code']===0x1f4){logger[_0xbfec('0x10')](_0xbfec('0x11'),_0x428268,_0x386b0b[_0xbfec('0x10')][_0xbfec('0x12')]);return _0x4020ed(_0x386b0b[_0xbfec('0x10')]['message']);}logger[_0xbfec('0x10')](_0xbfec('0x11'),_0x428268,_0x386b0b[_0xbfec('0x10')]['message']);return _0x5b6260(_0x386b0b['error']['message']);}else{logger[_0xbfec('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x428268,_0xbfec('0xe'));_0x5b6260(_0x386b0b[_0xbfec('0x13')][_0xbfec('0x12')]);}})[_0xbfec('0x14')](function(_0x3ea306){logger['error'](_0xbfec('0x11'),_0x428268,_0x3ea306);_0x4020ed(_0x3ea306);});});} \ No newline at end of file +var _0xca37=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x35cd20,_0x3591fb){var _0xa7dbcc=function(_0x38bdcb){while(--_0x38bdcb){_0x35cd20['push'](_0x35cd20['shift']());}};_0xa7dbcc(++_0x3591fb);}(_0xca37,0x1a7));var _0x7ca3=function(_0x4ba000,_0x156fbe){_0x4ba000=_0x4ba000-0x0;var _0x4b1e3e=_0xca37[_0x4ba000];return _0x4b1e3e;};'use strict';var _=require('lodash');var util=require(_0x7ca3('0x0'));var moment=require(_0x7ca3('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ca3('0x2'));var fs=require('fs');var Redis=require(_0x7ca3('0x3'));var db=require(_0x7ca3('0x4'))['db'];var utils=require(_0x7ca3('0x5'));var logger=require(_0x7ca3('0x6'))(_0x7ca3('0x7'));var config=require(_0x7ca3('0x8'));var jayson=require(_0x7ca3('0x9'));var client=jayson[_0x7ca3('0xa')][_0x7ca3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26212f,_0x4933d2,_0x360fc5){return new BPromise(function(_0x2c2b6e,_0x47755b){return client[_0x7ca3('0xc')](_0x26212f,_0x360fc5)[_0x7ca3('0xd')](function(_0x1f153b){logger[_0x7ca3('0xe')](_0x7ca3('0xf'),_0x4933d2,_0x7ca3('0x10'));logger[_0x7ca3('0x11')](_0x7ca3('0x12'),_0x4933d2,_0x7ca3('0x10'),JSON[_0x7ca3('0x13')](_0x1f153b));if(_0x1f153b[_0x7ca3('0x14')]){if(_0x1f153b['error'][_0x7ca3('0x15')]===0x1f4){logger[_0x7ca3('0x14')](_0x7ca3('0xf'),_0x4933d2,_0x1f153b[_0x7ca3('0x14')][_0x7ca3('0x16')]);return _0x47755b(_0x1f153b[_0x7ca3('0x14')][_0x7ca3('0x16')]);}logger[_0x7ca3('0x14')](_0x7ca3('0xf'),_0x4933d2,_0x1f153b[_0x7ca3('0x14')]['message']);return _0x2c2b6e(_0x1f153b[_0x7ca3('0x14')][_0x7ca3('0x16')]);}else{logger[_0x7ca3('0xe')](_0x7ca3('0xf'),_0x4933d2,'request\x20sent');_0x2c2b6e(_0x1f153b[_0x7ca3('0x17')]['message']);}})[_0x7ca3('0x18')](function(_0x132077){logger[_0x7ca3('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4933d2,_0x132077);_0x47755b(_0x132077);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f823b7c..290f36e 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 _0x8891=['../../components/interaction/service','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x4f6d16,_0xec3008){var _0x1b1014=function(_0x4e00ba){while(--_0x4e00ba){_0x4f6d16['push'](_0x4f6d16['shift']());}};_0x1b1014(++_0xec3008);}(_0x8891,0x145));var _0x1889=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0x8891[_0x258919];return _0xfbd68b;};'use strict';var multer=require(_0x1889('0x0'));var util=require('util');var path=require(_0x1889('0x1'));var timeout=require(_0x1889('0x2'));var express=require(_0x1889('0x3'));var router=express[_0x1889('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1889('0x5'));var config=require('../../config/environment');var controller=require(_0x1889('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1889('0x7')]);router[_0x1889('0x8')](_0x1889('0x9'),auth[_0x1889('0xa')](),controller['show']);router['get'](_0x1889('0xb'),auth[_0x1889('0xa')](),controller['preview']);router[_0x1889('0x8')](_0x1889('0xc'),auth[_0x1889('0xa')](),controller[_0x1889('0xd')]);router[_0x1889('0x8')](_0x1889('0xe'),auth[_0x1889('0xa')](),controller[_0x1889('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1889('0x10')]);router[_0x1889('0x11')](_0x1889('0x9'),auth['isAuthenticated'](),controller[_0x1889('0x12')]);router[_0x1889('0x13')](_0x1889('0x9'),auth[_0x1889('0xa')](),controller[_0x1889('0x14')]);module[_0x1889('0x15')]=router; \ No newline at end of file +var _0x45c3=['preview','/:id/run','query','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x45c3,0x18a));var _0x345c=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x45c3[_0x419e17];return _0x1f2044;};'use strict';var multer=require(_0x345c('0x0'));var util=require(_0x345c('0x1'));var path=require(_0x345c('0x2'));var timeout=require('connect-timeout');var express=require(_0x345c('0x3'));var router=express[_0x345c('0x4')]();var fs_extra=require(_0x345c('0x5'));var auth=require(_0x345c('0x6'));var interaction=require(_0x345c('0x7'));var config=require(_0x345c('0x8'));var controller=require(_0x345c('0x9'));router[_0x345c('0xa')]('/',auth[_0x345c('0xb')](),controller[_0x345c('0xc')]);router[_0x345c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x345c('0xd')]);router[_0x345c('0xa')]('/:id/preview',auth[_0x345c('0xb')](),controller[_0x345c('0xe')]);router[_0x345c('0xa')](_0x345c('0xf'),auth[_0x345c('0xb')](),controller['run']);router[_0x345c('0xa')]('/:id/query',auth[_0x345c('0xb')](),controller[_0x345c('0x10')]);router[_0x345c('0x11')]('/',auth['isAuthenticated'](),controller[_0x345c('0x12')]);router['put'](_0x345c('0x13'),auth[_0x345c('0xb')](),controller[_0x345c('0x14')]);router[_0x345c('0x15')](_0x345c('0x13'),auth['isAuthenticated'](),controller[_0x345c('0x16')]);module[_0x345c('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7c74e5e..a1e867b 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x24c340,_0x1126ae){var _0x34c632=function(_0x2a4661){while(--_0x2a4661){_0x24c340['push'](_0x24c340['shift']());}};_0x34c632(++_0x1126ae);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7fbe=['STRING','TEXT'];(function(_0x411b5e,_0x4710ba){var _0xe38727=function(_0xc67dfa){while(--_0xc67dfa){_0x411b5e['push'](_0x411b5e['shift']());}};_0xe38727(++_0x4710ba);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5e5ad9,_0x18845f){_0x5e5ad9=_0x5e5ad9-0x0;var _0x396036=_0x7fbe[_0x5e5ad9];return _0x396036;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d5931e3..e5d2a12 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','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','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0xdac3b5,_0x2532c4){var _0x18242d=function(_0x1620de){while(--_0x1620de){_0xdac3b5['push'](_0xdac3b5['shift']());}};_0x18242d(++_0x2532c4);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f613c,_0x425015){_0x4f613c=_0x4f613c-0x0;var _0x50cffd=_0x5fab[_0x4f613c];return _0x50cffd;};'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'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file +var _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0xc0c73a,_0x4ced47){var _0x493630=function(_0x1e8e80){while(--_0x1e8e80){_0xc0c73a['push'](_0xc0c73a['shift']());}};_0x493630(++_0x4ced47);}(_0x2542,0x169));var _0x2254=function(_0x2c1352,_0x3cd4df){_0x2c1352=_0x2c1352-0x0;var _0x101b44=_0x2542[_0x2c1352];return _0x101b44;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d545878..c836681 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 _0xca15=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x29631f,_0x50c93d){var _0x45c65d=function(_0x34aeb3){while(--_0x34aeb3){_0x29631f['push'](_0x29631f['shift']());}};_0x45c65d(++_0x50c93d);}(_0xca15,0x7b));var _0x5ca1=function(_0x1b2bd2,_0x491f68){_0x1b2bd2=_0x1b2bd2-0x0;var _0x34a271=_0xca15[_0x1b2bd2];return _0x34a271;};'use strict';var _=require('lodash');var util=require(_0x5ca1('0x0'));var logger=require(_0x5ca1('0x1'))(_0x5ca1('0x2'));var moment=require(_0x5ca1('0x3'));var BPromise=require(_0x5ca1('0x4'));var rp=require(_0x5ca1('0x5'));var fs=require('fs');var path=require(_0x5ca1('0x6'));var rimraf=require('rimraf');var config=require(_0x5ca1('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x382915,_0x255a4b){return _0x382915[_0x5ca1('0x8')](_0x5ca1('0x9'),attributes,{'tableName':_0x5ca1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ea=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc2ea,0x1bb));var _0xac2e=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xc2ea[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xac2e('0x0'));var util=require(_0xac2e('0x1'));var logger=require(_0xac2e('0x2'))(_0xac2e('0x3'));var moment=require(_0xac2e('0x4'));var BPromise=require(_0xac2e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac2e('0x6'));var rimraf=require(_0xac2e('0x7'));var config=require(_0xac2e('0x8'));var attributes=require(_0xac2e('0x9'));module[_0xac2e('0xa')]=function(_0x4da5cd,_0x4deb64){return _0x4da5cd['define'](_0xac2e('0xb'),attributes,{'tableName':_0xac2e('0xc'),'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 114af29..03e7c74 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 _0x6d1f=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x587783,_0x6296e6){var _0x1cca44=function(_0x2c5082){while(--_0x2c5082){_0x587783['push'](_0x587783['shift']());}};_0x1cca44(++_0x6296e6);}(_0x6d1f,0x1ed));var _0xf6d1=function(_0xc6228b,_0x45ccc8){_0xc6228b=_0xc6228b-0x0;var _0x2d8e9a=_0x6d1f[_0xc6228b];return _0x2d8e9a;};'use strict';var _=require(_0xf6d1('0x0'));var util=require(_0xf6d1('0x1'));var moment=require(_0xf6d1('0x2'));var BPromise=require(_0xf6d1('0x3'));var rs=require(_0xf6d1('0x4'));var fs=require('fs');var Redis=require(_0xf6d1('0x5'));var db=require(_0xf6d1('0x6'))['db'];var utils=require(_0xf6d1('0x7'));var logger=require(_0xf6d1('0x8'))(_0xf6d1('0x9'));var config=require('../../config/environment');var jayson=require(_0xf6d1('0xa'));var client=jayson[_0xf6d1('0xb')][_0xf6d1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x554d3d,_0x479787,_0x3e3314){return new BPromise(function(_0x1babdb,_0x1b8c59){return client[_0xf6d1('0xd')](_0x554d3d,_0x3e3314)[_0xf6d1('0xe')](function(_0x483b2f){logger[_0xf6d1('0xf')](_0xf6d1('0x10'),_0x479787,_0xf6d1('0x11'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x479787,_0xf6d1('0x11'),JSON['stringify'](_0x483b2f));if(_0x483b2f[_0xf6d1('0x12')]){if(_0x483b2f[_0xf6d1('0x12')][_0xf6d1('0x13')]===0x1f4){logger['error'](_0xf6d1('0x10'),_0x479787,_0x483b2f[_0xf6d1('0x12')][_0xf6d1('0x14')]);return _0x1b8c59(_0x483b2f['error']['message']);}logger[_0xf6d1('0x12')](_0xf6d1('0x10'),_0x479787,_0x483b2f[_0xf6d1('0x12')][_0xf6d1('0x14')]);return _0x1babdb(_0x483b2f[_0xf6d1('0x12')]['message']);}else{logger['info'](_0xf6d1('0x10'),_0x479787,_0xf6d1('0x11'));_0x1babdb(_0x483b2f['result'][_0xf6d1('0x14')]);}})[_0xf6d1('0x15')](function(_0x5f33c8){logger['error'](_0xf6d1('0x10'),_0x479787,_0x5f33c8);_0x1b8c59(_0x5f33c8);});});} \ No newline at end of file +var _0xbb55=['http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x3dd0d5,_0x2ee2f6){var _0x189338=function(_0x2f2504){while(--_0x2f2504){_0x3dd0d5['push'](_0x3dd0d5['shift']());}};_0x189338(++_0x2ee2f6);}(_0xbb55,0x140));var _0x5bb5=function(_0x36ee80,_0x39a69d){_0x36ee80=_0x36ee80-0x0;var _0x5e5a65=_0xbb55[_0x36ee80];return _0x5e5a65;};'use strict';var _=require(_0x5bb5('0x0'));var util=require(_0x5bb5('0x1'));var moment=require(_0x5bb5('0x2'));var BPromise=require(_0x5bb5('0x3'));var rs=require(_0x5bb5('0x4'));var fs=require('fs');var Redis=require(_0x5bb5('0x5'));var db=require(_0x5bb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bb5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bb5('0x8'));var client=jayson[_0x5bb5('0x9')][_0x5bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd413d2,_0x1aace4,_0x82dd12){return new BPromise(function(_0x13da7e,_0x475ed1){return client[_0x5bb5('0xb')](_0xd413d2,_0x82dd12)['then'](function(_0x8084c1){logger[_0x5bb5('0xc')](_0x5bb5('0xd'),_0x1aace4,_0x5bb5('0xe'));logger[_0x5bb5('0xf')](_0x5bb5('0x10'),_0x1aace4,_0x5bb5('0xe'),JSON['stringify'](_0x8084c1));if(_0x8084c1[_0x5bb5('0x11')]){if(_0x8084c1[_0x5bb5('0x11')][_0x5bb5('0x12')]===0x1f4){logger[_0x5bb5('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1aace4,_0x8084c1[_0x5bb5('0x11')][_0x5bb5('0x13')]);return _0x475ed1(_0x8084c1[_0x5bb5('0x11')][_0x5bb5('0x13')]);}logger[_0x5bb5('0x11')](_0x5bb5('0xd'),_0x1aace4,_0x8084c1[_0x5bb5('0x11')][_0x5bb5('0x13')]);return _0x13da7e(_0x8084c1[_0x5bb5('0x11')][_0x5bb5('0x13')]);}else{logger['info'](_0x5bb5('0xd'),_0x1aace4,_0x5bb5('0xe'));_0x13da7e(_0x8084c1[_0x5bb5('0x14')]['message']);}})[_0x5bb5('0x15')](function(_0x427750){logger[_0x5bb5('0x11')](_0x5bb5('0xd'),_0x1aace4,_0x427750);_0x475ed1(_0x427750);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7793f4e..bb46ba1 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 _0xc827=['express','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x59b05b,_0x44a8a3){var _0x262312=function(_0x409fe6){while(--_0x409fe6){_0x59b05b['push'](_0x59b05b['shift']());}};_0x262312(++_0x44a8a3);}(_0xc827,0x6b));var _0x7c82=function(_0xd14204,_0x1f68f4){_0xd14204=_0xd14204-0x0;var _0x5a6da4=_0xc827[_0xd14204];return _0x5a6da4;};'use strict';var multer=require(_0x7c82('0x0'));var util=require('util');var path=require(_0x7c82('0x1'));var timeout=require(_0x7c82('0x2'));var express=require(_0x7c82('0x3'));var router=express['Router']();var fs_extra=require(_0x7c82('0x4'));var auth=require(_0x7c82('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7c82('0x6'));router[_0x7c82('0x7')]('/',auth[_0x7c82('0x8')](),controller[_0x7c82('0x9')]);router[_0x7c82('0x7')](_0x7c82('0xa'),auth[_0x7c82('0x8')](),controller[_0x7c82('0xb')]);router[_0x7c82('0x7')](_0x7c82('0xc'),auth[_0x7c82('0x8')](),controller[_0x7c82('0xd')]);router[_0x7c82('0x7')](_0x7c82('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x7c82('0x7')](_0x7c82('0xf'),auth[_0x7c82('0x8')](),controller['query']);router['post']('/',auth[_0x7c82('0x8')](),controller[_0x7c82('0x10')]);router[_0x7c82('0x11')](_0x7c82('0xa'),auth[_0x7c82('0x8')](),controller[_0x7c82('0x12')]);router[_0x7c82('0x13')](_0x7c82('0xa'),auth[_0x7c82('0x8')](),controller[_0x7c82('0x14')]);module[_0x7c82('0x15')]=router; \ No newline at end of file +var _0x292c=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','query','post','create','put','update','delete','multer','path','connect-timeout'];(function(_0x547513,_0x4c9ca2){var _0xe5bbea=function(_0x595f66){while(--_0x595f66){_0x547513['push'](_0x547513['shift']());}};_0xe5bbea(++_0x4c9ca2);}(_0x292c,0x66));var _0xc292=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x292c[_0x2212d1];return _0x15eec5;};'use strict';var multer=require(_0xc292('0x0'));var util=require('util');var path=require(_0xc292('0x1'));var timeout=require(_0xc292('0x2'));var express=require(_0xc292('0x3'));var router=express[_0xc292('0x4')]();var fs_extra=require(_0xc292('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc292('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xc292('0x7')]('/',auth[_0xc292('0x8')](),controller[_0xc292('0x9')]);router[_0xc292('0x7')](_0xc292('0xa'),auth[_0xc292('0x8')](),controller[_0xc292('0xb')]);router[_0xc292('0x7')](_0xc292('0xc'),auth[_0xc292('0x8')](),controller['preview']);router[_0xc292('0x7')](_0xc292('0xd'),auth[_0xc292('0x8')](),controller[_0xc292('0xe')]);router[_0xc292('0x7')]('/:id/query',auth[_0xc292('0x8')](),controller[_0xc292('0xf')]);router[_0xc292('0x10')]('/',auth[_0xc292('0x8')](),controller[_0xc292('0x11')]);router[_0xc292('0x12')]('/:id',auth[_0xc292('0x8')](),controller[_0xc292('0x13')]);router[_0xc292('0x14')](_0xc292('0xa'),auth[_0xc292('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e051f01..2548e31 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 _0xa6d2=['ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment','exports','STRING'];(function(_0x2480eb,_0x184fbc){var _0x4fc328=function(_0x4b74b1){while(--_0x4b74b1){_0x2480eb['push'](_0x2480eb['shift']());}};_0x4fc328(++_0x184fbc);}(_0xa6d2,0x159));var _0x2a6d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa6d2[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2a6d('0x0'));module[_0x2a6d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x2a6d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2a6d('0x3')](_0x2a6d('0x4'),_0x2a6d('0x5'),_0x2a6d('0x6')),'allowNull':![],'defaultValue':_0x2a6d('0x4')},'savename':{'type':Sequelize[_0x2a6d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x2a6d('0x7')]},'status':{'type':Sequelize[_0x2a6d('0x2')],'defaultValue':_0x2a6d('0x8')},'type':{'type':Sequelize[_0x2a6d('0x3')](_0x2a6d('0x9'),_0x2a6d('0xa')),'allowNull':![],'defaultValue':_0x2a6d('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2a6d('0xb')]},'reportType':{'type':Sequelize[_0x2a6d('0x2')]}}; \ No newline at end of file +var _0xb1d8=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','sequelize','moment'];(function(_0x4b7b52,_0x533b25){var _0x46e5e9=function(_0x2d5a9f){while(--_0x2d5a9f){_0x4b7b52['push'](_0x4b7b52['shift']());}};_0x46e5e9(++_0x533b25);}(_0xb1d8,0x1b6));var _0x8b1d=function(_0x4e55cd,_0x5c3c84){_0x4e55cd=_0x4e55cd-0x0;var _0x4964d3=_0xb1d8[_0x4e55cd];return _0x4964d3;};'use strict';var Sequelize=require(_0x8b1d('0x0'));var moment=require(_0x8b1d('0x1'));module['exports']={'name':{'type':Sequelize[_0x8b1d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8b1d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8b1d('0x3')](_0x8b1d('0x4'),_0x8b1d('0x5'),_0x8b1d('0x6')),'allowNull':![],'defaultValue':_0x8b1d('0x4')},'savename':{'type':Sequelize[_0x8b1d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8b1d('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8b1d('0x2')],'defaultValue':_0x8b1d('0x8')},'type':{'type':Sequelize[_0x8b1d('0x3')](_0x8b1d('0x9'),_0x8b1d('0xa')),'allowNull':![],'defaultValue':_0x8b1d('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8b1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 3351d15..476fc33 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 _0x9698=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','VIRTUAL','filter','merge','AnalyticExtractedReport','includeAll','findAll','catch','params','keys','intersection','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','find','autoAssociation','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','toLowerCase','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis'];(function(_0x4f6856,_0x2dbb97){var _0x36cafd=function(_0x2d782b){while(--_0x2d782b){_0x4f6856['push'](_0x4f6856['shift']());}};_0x36cafd(++_0x2dbb97);}(_0x9698,0x1aa));var _0x8969=function(_0x2cf811,_0x6c1489){_0x2cf811=_0x2cf811-0x0;var _0x3ed5d0=_0x9698[_0x2cf811];return _0x3ed5d0;};'use strict';var emlformat=require(_0x8969('0x0'));var rimraf=require(_0x8969('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8969('0x2'));var moment=require(_0x8969('0x3'));var BPromise=require(_0x8969('0x4'));var Mustache=require('mustache');var util=require(_0x8969('0x5'));var path=require(_0x8969('0x6'));var sox=require('sox');var csv=require(_0x8969('0x7'));var ejs=require(_0x8969('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8969('0x9'));var squel=require(_0x8969('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8969('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8969('0xc'));var Papa=require('papaparse');var Redis=require(_0x8969('0xd'));var authService=require(_0x8969('0xe'));var qs=require(_0x8969('0xf'));var as=require(_0x8969('0x10'));var hardwareService=require(_0x8969('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8969('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8969('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x149937,_0x584296){_0x584296=_0x584296||0xcc;return function(_0x1bd34d){if(_0x1bd34d){return _0x149937['sendStatus'](_0x584296);}return _0x149937[_0x8969('0x14')](_0x584296)['end']();};}function respondWithResult(_0x3228af,_0x293e3d){_0x293e3d=_0x293e3d||0xc8;return function(_0xc0ef31){if(_0xc0ef31){return _0x3228af['status'](_0x293e3d)[_0x8969('0x15')](_0xc0ef31);}};}function respondWithFilteredResult(_0x1af5b4,_0x1e42ba){return function(_0x431074){if(_0x431074){var _0x2ea348=typeof _0x1e42ba[_0x8969('0x16')]==='undefined'&&typeof _0x1e42ba['limit']==='undefined';var _0x4cc50a=_0x431074['count'];var _0x5bc823=_0x2ea348?0x0:_0x1e42ba[_0x8969('0x16')];var _0x10aa83=_0x2ea348?_0x431074[_0x8969('0x17')]:_0x1e42ba[_0x8969('0x16')]+_0x1e42ba[_0x8969('0x18')];var _0x611759;if(_0x10aa83>=_0x4cc50a){_0x10aa83=_0x4cc50a;_0x611759=0xc8;}else{_0x611759=0xce;}_0x1af5b4[_0x8969('0x14')](_0x611759);return _0x1af5b4[_0x8969('0x19')](_0x8969('0x1a'),_0x5bc823+'-'+_0x10aa83+'/'+_0x4cc50a)[_0x8969('0x15')](_0x431074);}return null;};}function patchUpdates(_0x22fb7b){return function(_0x5c31c1){try{jsonpatch[_0x8969('0x1b')](_0x5c31c1,_0x22fb7b,!![]);}catch(_0xfdd7fa){return BPromise[_0x8969('0x1c')](_0xfdd7fa);}return _0x5c31c1['save']();};}function saveUpdates(_0x5bb44d,_0x56373d){return function(_0x33a253){if(_0x33a253){return _0x33a253[_0x8969('0x1d')](_0x5bb44d)[_0x8969('0x1e')](function(_0x19dd73){return _0x19dd73;});}return null;};}function removeEntity(_0x4c49ae,_0x28c5f9){return function(_0x32454b){if(_0x32454b){return _0x32454b[_0x8969('0x1f')]()['then'](function(){var _0xa1d4b9=_0x32454b[_0x8969('0x20')]({'plain':!![]});var _0x47edde='ExtractedReports';return db[_0x8969('0x21')][_0x8969('0x1f')]({'where':{'type':_0x47edde,'resourceId':_0xa1d4b9['id']}})['then'](function(){return _0x32454b;});})[_0x8969('0x1e')](function(){_0x4c49ae[_0x8969('0x14')](0xcc)[_0x8969('0x22')]();});}};}function handleEntityNotFound(_0x3eacf0,_0x1c2d78){return function(_0x39ff2a){if(!_0x39ff2a){_0x3eacf0[_0x8969('0x23')](0x194);}return _0x39ff2a;};}function handleError(_0x10667c,_0x53ef17){_0x53ef17=_0x53ef17||0x1f4;return function(_0x45a3dd){logger[_0x8969('0x24')](_0x45a3dd[_0x8969('0x25')]);if(_0x45a3dd['name']){delete _0x45a3dd['name'];}_0x10667c[_0x8969('0x14')](_0x53ef17)[_0x8969('0x26')](_0x45a3dd);};}exports[_0x8969('0x27')]=function(_0x2e2333,_0x180255){var _0x2df88c={},_0x175989={},_0x1f348d={'count':0x0,'rows':[]};var _0x5982d5=_['map'](db['AnalyticExtractedReport'][_0x8969('0x28')],function(_0x2daad9){return{'name':_0x2daad9[_0x8969('0x29')],'type':_0x2daad9[_0x8969('0x2a')][_0x8969('0x2b')]};});_0x175989[_0x8969('0x2c')]=_['map'](_0x5982d5,_0x8969('0x2d'));_0x175989[_0x8969('0x2e')]=_['keys'](_0x2e2333['query']);_0x175989['filters']=_['intersection'](_0x175989[_0x8969('0x2c')],_0x175989['query']);_0x2df88c[_0x8969('0x2f')]=_['intersection'](_0x175989['model'],qs['fields'](_0x2e2333[_0x8969('0x2e')][_0x8969('0x30')]));_0x2df88c[_0x8969('0x2f')]=_0x2df88c[_0x8969('0x2f')][_0x8969('0x31')]?_0x2df88c[_0x8969('0x2f')]:_0x175989[_0x8969('0x2c')];if(!_0x2e2333[_0x8969('0x2e')][_0x8969('0x32')](_0x8969('0x33'))){_0x2df88c[_0x8969('0x18')]=qs['limit'](_0x2e2333['query']['limit']);_0x2df88c[_0x8969('0x16')]=qs[_0x8969('0x16')](_0x2e2333['query'][_0x8969('0x16')]);}_0x2df88c[_0x8969('0x34')]=qs[_0x8969('0x35')](_0x2e2333[_0x8969('0x2e')][_0x8969('0x35')]);_0x2df88c['where']=qs[_0x8969('0x36')](_[_0x8969('0x37')](_0x2e2333['query'],_0x175989[_0x8969('0x36')]),_0x5982d5);if(_0x2e2333['query']['filter']){_0x2df88c[_0x8969('0x38')]=_['merge'](_0x2df88c[_0x8969('0x38')],{'$or':_[_0x8969('0x39')](_0x5982d5,function(_0x1c5cf7){if(_0x1c5cf7[_0x8969('0x2a')]!==_0x8969('0x3a')){var _0x197ebc={};_0x197ebc[_0x1c5cf7[_0x8969('0x2d')]]={'$like':'%'+_0x2e2333['query'][_0x8969('0x3b')]+'%'};return _0x197ebc;}})});}_0x2df88c=_[_0x8969('0x3c')]({},_0x2df88c,_0x2e2333['options']);var _0x50d7e1={'where':_0x2df88c[_0x8969('0x38')]};return db[_0x8969('0x3d')]['count'](_0x50d7e1)['then'](function(_0x445826){_0x1f348d[_0x8969('0x17')]=_0x445826;if(_0x2e2333['query'][_0x8969('0x3e')]){_0x2df88c['include']=[{'all':!![]}];}return db[_0x8969('0x3d')][_0x8969('0x3f')](_0x2df88c);})[_0x8969('0x1e')](function(_0xc6368f){_0x1f348d['rows']=_0xc6368f;return _0x1f348d;})[_0x8969('0x1e')](respondWithFilteredResult(_0x180255,_0x2df88c))[_0x8969('0x40')](handleError(_0x180255,null));};exports['show']=function(_0x1e1a28,_0x1ce6a5){var _0x23c2d8={'raw':!![],'where':{'id':_0x1e1a28[_0x8969('0x41')]['id']}},_0x36ab3e={};_0x36ab3e['model']=_[_0x8969('0x42')](db[_0x8969('0x3d')][_0x8969('0x28')]);_0x36ab3e['query']=_[_0x8969('0x42')](_0x1e1a28['query']);_0x36ab3e[_0x8969('0x36')]=_['intersection'](_0x36ab3e[_0x8969('0x2c')],_0x36ab3e[_0x8969('0x2e')]);_0x23c2d8[_0x8969('0x2f')]=_[_0x8969('0x43')](_0x36ab3e[_0x8969('0x2c')],qs[_0x8969('0x30')](_0x1e1a28['query'][_0x8969('0x30')]));_0x23c2d8[_0x8969('0x2f')]=_0x23c2d8['attributes']['length']?_0x23c2d8[_0x8969('0x2f')]:_0x36ab3e[_0x8969('0x2c')];if(_0x1e1a28['query']['includeAll']){_0x23c2d8['include']=[{'all':!![]}];}_0x23c2d8=_['merge']({},_0x23c2d8,_0x1e1a28[_0x8969('0x44')]);return db[_0x8969('0x3d')]['find'](_0x23c2d8)[_0x8969('0x1e')](handleEntityNotFound(_0x1ce6a5,null))[_0x8969('0x1e')](respondWithResult(_0x1ce6a5,null))[_0x8969('0x40')](handleError(_0x1ce6a5,null));};exports[_0x8969('0x45')]=function(_0x39c449,_0x355a33){return db[_0x8969('0x3d')]['create'](_0x39c449[_0x8969('0x46')],{})['then'](function(_0x3e5029){var _0x3c468e=_0x39c449[_0x8969('0x47')][_0x8969('0x20')]({'plain':!![]});if(!_0x3c468e)throw new Error(_0x8969('0x48'));if(_0x3c468e[_0x8969('0x49')]==='user'){var _0x24d4af=_0x3e5029[_0x8969('0x20')]({'plain':!![]});var _0x2862f4=_0x8969('0x4a');return db['UserProfileSection'][_0x8969('0x4b')]({'where':{'name':_0x2862f4,'userProfileId':_0x3c468e['userProfileId']},'raw':!![]})[_0x8969('0x1e')](function(_0x19cb48){if(_0x19cb48&&_0x19cb48[_0x8969('0x4c')]===0x0){return db[_0x8969('0x21')][_0x8969('0x45')]({'name':_0x24d4af[_0x8969('0x2d')],'resourceId':_0x24d4af['id'],'type':_0x19cb48['name'],'sectionId':_0x19cb48['id']},{})['then'](function(){return _0x3e5029;});}else{return _0x3e5029;}})[_0x8969('0x40')](function(_0x5e4508){logger[_0x8969('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e4508);throw _0x5e4508;});}return _0x3e5029;})[_0x8969('0x1e')](respondWithResult(_0x355a33,0xc9))[_0x8969('0x40')](handleError(_0x355a33,null));};exports[_0x8969('0x1d')]=function(_0x1ce701,_0x8fbaa5){if(_0x1ce701[_0x8969('0x46')]['id']){delete _0x1ce701['body']['id'];}return db[_0x8969('0x3d')]['find']({'where':{'id':_0x1ce701['params']['id']}})[_0x8969('0x1e')](handleEntityNotFound(_0x8fbaa5,null))['then'](saveUpdates(_0x1ce701[_0x8969('0x46')],null))[_0x8969('0x1e')](respondWithResult(_0x8fbaa5,null))['catch'](handleError(_0x8fbaa5,null));};exports[_0x8969('0x1f')]=function(_0x31b90b,_0x1c2bee){return db[_0x8969('0x3d')][_0x8969('0x4b')]({'where':{'id':_0x31b90b['params']['id']}})[_0x8969('0x1e')](handleEntityNotFound(_0x1c2bee,null))['then'](removeEntity(_0x1c2bee,null))[_0x8969('0x40')](handleError(_0x1c2bee,null));};exports[_0x8969('0x4d')]=function(_0x2e8bab,_0x3c35ba,_0x385968){return db[_0x8969('0x3d')][_0x8969('0x4b')]({'where':{'id':_0x2e8bab['params']['id']},'attributes':[_0x8969('0x2d'),_0x8969('0x4e'),_0x8969('0x4f'),_0x8969('0x50')],'raw':!![]})[_0x8969('0x1e')](handleEntityNotFound(_0x3c35ba,null))['then'](function(_0x2539ea){if(_0x2539ea){if(!fs[_0x8969('0x51')](path[_0x8969('0x52')](config[_0x8969('0x53')],_0x8969('0x54'),_0x2539ea[_0x8969('0x4f')]))){throw new db[(_0x8969('0x55'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x2e8bab['query'][_0x8969('0x56')]){return _0x3c35ba[_0x8969('0x23')](0xc8);}return _0x3c35ba[_0x8969('0x4d')](path['join'](config['root'],_0x8969('0x54'),_0x2539ea['savename']),util['format']('%s.%s',_0x2539ea[_0x8969('0x4e')]||_0x2539ea[_0x8969('0x2d')],_0x2539ea[_0x8969('0x50')][_0x8969('0x57')]()));}})[_0x8969('0x40')](handleError(_0x3c35ba,null));}; \ No newline at end of file +var _0xad7e=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','user','role','UserProfileSection','autoAssociation','body','download','basename','savename','output','root','server/files/reports','exists','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x47e9d6,_0x28b897){var _0x2232cd=function(_0xfd7a42){while(--_0xfd7a42){_0x47e9d6['push'](_0x47e9d6['shift']());}};_0x2232cd(++_0x28b897);}(_0xad7e,0x164));var _0xead7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad7e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xead7('0x0'));var rimraf=require(_0xead7('0x1'));var zipdir=require(_0xead7('0x2'));var jsonpatch=require(_0xead7('0x3'));var rp=require(_0xead7('0x4'));var moment=require('moment');var BPromise=require(_0xead7('0x5'));var Mustache=require('mustache');var util=require(_0xead7('0x6'));var path=require(_0xead7('0x7'));var sox=require(_0xead7('0x8'));var csv=require(_0xead7('0x9'));var ejs=require(_0xead7('0xa'));var fs=require('fs');var fs_extra=require(_0xead7('0xb'));var _=require(_0xead7('0xc'));var squel=require(_0xead7('0xd'));var crypto=require(_0xead7('0xe'));var jsforce=require(_0xead7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xead7('0x9'));var querystring=require(_0xead7('0x10'));var Papa=require('papaparse');var Redis=require(_0xead7('0x11'));var authService=require(_0xead7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xead7('0x13'));var hardwareService=require(_0xead7('0x14'));var logger=require('../../config/logger')(_0xead7('0x15'));var utils=require(_0xead7('0x16'));var config=require(_0xead7('0x17'));var licenseUtil=require(_0xead7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6b59ab,_0x3a6a9f){_0x3a6a9f=_0x3a6a9f||0xcc;return function(_0x2432ba){if(_0x2432ba){return _0x6b59ab[_0xead7('0x19')](_0x3a6a9f);}return _0x6b59ab[_0xead7('0x1a')](_0x3a6a9f)['end']();};}function respondWithResult(_0xfb2f18,_0x532bc5){_0x532bc5=_0x532bc5||0xc8;return function(_0x1c2cf3){if(_0x1c2cf3){return _0xfb2f18[_0xead7('0x1a')](_0x532bc5)[_0xead7('0x1b')](_0x1c2cf3);}};}function respondWithFilteredResult(_0x903c55,_0x5a5688){return function(_0x215c42){if(_0x215c42){var _0x3757bc=typeof _0x5a5688[_0xead7('0x1c')]===_0xead7('0x1d')&&typeof _0x5a5688[_0xead7('0x1e')]===_0xead7('0x1d');var _0x495814=_0x215c42[_0xead7('0x1f')];var _0x10e6eb=_0x3757bc?0x0:_0x5a5688[_0xead7('0x1c')];var _0x56b8a6=_0x3757bc?_0x215c42[_0xead7('0x1f')]:_0x5a5688[_0xead7('0x1c')]+_0x5a5688['limit'];var _0x4abc2c;if(_0x56b8a6>=_0x495814){_0x56b8a6=_0x495814;_0x4abc2c=0xc8;}else{_0x4abc2c=0xce;}_0x903c55[_0xead7('0x1a')](_0x4abc2c);return _0x903c55[_0xead7('0x20')](_0xead7('0x21'),_0x10e6eb+'-'+_0x56b8a6+'/'+_0x495814)[_0xead7('0x1b')](_0x215c42);}return null;};}function patchUpdates(_0x34b650){return function(_0x602634){try{jsonpatch[_0xead7('0x22')](_0x602634,_0x34b650,!![]);}catch(_0x54ccb3){return BPromise[_0xead7('0x23')](_0x54ccb3);}return _0x602634[_0xead7('0x24')]();};}function saveUpdates(_0x84c078,_0x5015ff){return function(_0x4de14e){if(_0x4de14e){return _0x4de14e[_0xead7('0x25')](_0x84c078)[_0xead7('0x26')](function(_0x14dc70){return _0x14dc70;});}return null;};}function removeEntity(_0x2f4d16,_0x45eae6){return function(_0x5e42b4){if(_0x5e42b4){return _0x5e42b4[_0xead7('0x27')]()[_0xead7('0x26')](function(){var _0x5c509e=_0x5e42b4[_0xead7('0x28')]({'plain':!![]});var _0x103474=_0xead7('0x29');return db[_0xead7('0x2a')][_0xead7('0x27')]({'where':{'type':_0x103474,'resourceId':_0x5c509e['id']}})['then'](function(){return _0x5e42b4;});})[_0xead7('0x26')](function(){_0x2f4d16[_0xead7('0x1a')](0xcc)[_0xead7('0x2b')]();});}};}function handleEntityNotFound(_0x347910,_0x1cae5d){return function(_0x52ce35){if(!_0x52ce35){_0x347910['sendStatus'](0x194);}return _0x52ce35;};}function handleError(_0x1fcabe,_0x507640){_0x507640=_0x507640||0x1f4;return function(_0x143fef){logger[_0xead7('0x2c')](_0x143fef[_0xead7('0x2d')]);if(_0x143fef[_0xead7('0x2e')]){delete _0x143fef['name'];}_0x1fcabe[_0xead7('0x1a')](_0x507640)[_0xead7('0x2f')](_0x143fef);};}exports[_0xead7('0x30')]=function(_0x1e58c7,_0x5bea82){var _0x3b682c={},_0xd4db0e={},_0x54e3a8={'count':0x0,'rows':[]};var _0x558f72=_[_0xead7('0x31')](db[_0xead7('0x32')][_0xead7('0x33')],function(_0x272f95){return{'name':_0x272f95[_0xead7('0x34')],'type':_0x272f95[_0xead7('0x35')]['key']};});_0xd4db0e[_0xead7('0x36')]=_[_0xead7('0x31')](_0x558f72,'name');_0xd4db0e['query']=_[_0xead7('0x37')](_0x1e58c7[_0xead7('0x38')]);_0xd4db0e['filters']=_['intersection'](_0xd4db0e[_0xead7('0x36')],_0xd4db0e[_0xead7('0x38')]);_0x3b682c[_0xead7('0x39')]=_[_0xead7('0x3a')](_0xd4db0e[_0xead7('0x36')],qs[_0xead7('0x3b')](_0x1e58c7[_0xead7('0x38')]['fields']));_0x3b682c[_0xead7('0x39')]=_0x3b682c['attributes'][_0xead7('0x3c')]?_0x3b682c[_0xead7('0x39')]:_0xd4db0e['model'];if(!_0x1e58c7['query'][_0xead7('0x3d')](_0xead7('0x3e'))){_0x3b682c[_0xead7('0x1e')]=qs[_0xead7('0x1e')](_0x1e58c7[_0xead7('0x38')][_0xead7('0x1e')]);_0x3b682c[_0xead7('0x1c')]=qs['offset'](_0x1e58c7[_0xead7('0x38')][_0xead7('0x1c')]);}_0x3b682c[_0xead7('0x3f')]=qs[_0xead7('0x40')](_0x1e58c7[_0xead7('0x38')]['sort']);_0x3b682c[_0xead7('0x41')]=qs[_0xead7('0x42')](_[_0xead7('0x43')](_0x1e58c7[_0xead7('0x38')],_0xd4db0e[_0xead7('0x42')]),_0x558f72);if(_0x1e58c7[_0xead7('0x38')][_0xead7('0x44')]){_0x3b682c[_0xead7('0x41')]=_[_0xead7('0x45')](_0x3b682c[_0xead7('0x41')],{'$or':_[_0xead7('0x31')](_0x558f72,function(_0x197e87){if(_0x197e87[_0xead7('0x35')]!==_0xead7('0x46')){var _0x4df817={};_0x4df817[_0x197e87[_0xead7('0x2e')]]={'$like':'%'+_0x1e58c7[_0xead7('0x38')][_0xead7('0x44')]+'%'};return _0x4df817;}})});}_0x3b682c=_[_0xead7('0x45')]({},_0x3b682c,_0x1e58c7[_0xead7('0x47')]);var _0x3f7792={'where':_0x3b682c[_0xead7('0x41')]};return db[_0xead7('0x32')][_0xead7('0x1f')](_0x3f7792)[_0xead7('0x26')](function(_0xfd537e){_0x54e3a8[_0xead7('0x1f')]=_0xfd537e;if(_0x1e58c7['query'][_0xead7('0x48')]){_0x3b682c['include']=[{'all':!![]}];}return db[_0xead7('0x32')][_0xead7('0x49')](_0x3b682c);})['then'](function(_0x1bfe89){_0x54e3a8[_0xead7('0x4a')]=_0x1bfe89;return _0x54e3a8;})[_0xead7('0x26')](respondWithFilteredResult(_0x5bea82,_0x3b682c))['catch'](handleError(_0x5bea82,null));};exports['show']=function(_0x1b176a,_0x5c9e4a){var _0x237fe6={'raw':!![],'where':{'id':_0x1b176a[_0xead7('0x4b')]['id']}},_0xb7a1eb={};_0xb7a1eb[_0xead7('0x36')]=_[_0xead7('0x37')](db[_0xead7('0x32')][_0xead7('0x33')]);_0xb7a1eb['query']=_[_0xead7('0x37')](_0x1b176a[_0xead7('0x38')]);_0xb7a1eb[_0xead7('0x42')]=_[_0xead7('0x3a')](_0xb7a1eb[_0xead7('0x36')],_0xb7a1eb[_0xead7('0x38')]);_0x237fe6[_0xead7('0x39')]=_['intersection'](_0xb7a1eb[_0xead7('0x36')],qs[_0xead7('0x3b')](_0x1b176a['query'][_0xead7('0x3b')]));_0x237fe6[_0xead7('0x39')]=_0x237fe6[_0xead7('0x39')][_0xead7('0x3c')]?_0x237fe6[_0xead7('0x39')]:_0xb7a1eb['model'];if(_0x1b176a[_0xead7('0x38')][_0xead7('0x48')]){_0x237fe6[_0xead7('0x4c')]=[{'all':!![]}];}_0x237fe6=_['merge']({},_0x237fe6,_0x1b176a[_0xead7('0x47')]);return db['AnalyticExtractedReport'][_0xead7('0x4d')](_0x237fe6)[_0xead7('0x26')](handleEntityNotFound(_0x5c9e4a,null))[_0xead7('0x26')](respondWithResult(_0x5c9e4a,null))[_0xead7('0x4e')](handleError(_0x5c9e4a,null));};exports[_0xead7('0x4f')]=function(_0x1f3d0a,_0x7446c2){return db[_0xead7('0x32')]['create'](_0x1f3d0a['body'],{})[_0xead7('0x26')](function(_0x322608){var _0x23e540=_0x1f3d0a[_0xead7('0x50')][_0xead7('0x28')]({'plain':!![]});if(!_0x23e540)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23e540[_0xead7('0x51')]===_0xead7('0x50')){var _0xf34006=_0x322608[_0xead7('0x28')]({'plain':!![]});var _0x152b7c=_0xead7('0x29');return db[_0xead7('0x52')]['find']({'where':{'name':_0x152b7c,'userProfileId':_0x23e540['userProfileId']},'raw':!![]})[_0xead7('0x26')](function(_0x21f3e4){if(_0x21f3e4&&_0x21f3e4[_0xead7('0x53')]===0x0){return db[_0xead7('0x2a')][_0xead7('0x4f')]({'name':_0xf34006[_0xead7('0x2e')],'resourceId':_0xf34006['id'],'type':_0x21f3e4['name'],'sectionId':_0x21f3e4['id']},{})['then'](function(){return _0x322608;});}else{return _0x322608;}})['catch'](function(_0x385a87){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x385a87);throw _0x385a87;});}return _0x322608;})[_0xead7('0x26')](respondWithResult(_0x7446c2,0xc9))[_0xead7('0x4e')](handleError(_0x7446c2,null));};exports[_0xead7('0x25')]=function(_0x41dea2,_0x3c74a6){if(_0x41dea2[_0xead7('0x54')]['id']){delete _0x41dea2[_0xead7('0x54')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x41dea2['params']['id']}})[_0xead7('0x26')](handleEntityNotFound(_0x3c74a6,null))['then'](saveUpdates(_0x41dea2[_0xead7('0x54')],null))[_0xead7('0x26')](respondWithResult(_0x3c74a6,null))[_0xead7('0x4e')](handleError(_0x3c74a6,null));};exports[_0xead7('0x27')]=function(_0x3a737a,_0x47492f){return db[_0xead7('0x32')]['find']({'where':{'id':_0x3a737a[_0xead7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47492f,null))[_0xead7('0x26')](removeEntity(_0x47492f,null))['catch'](handleError(_0x47492f,null));};exports[_0xead7('0x55')]=function(_0x3673b3,_0x3ecdad,_0x5bb8ef){return db[_0xead7('0x32')][_0xead7('0x4d')]({'where':{'id':_0x3673b3[_0xead7('0x4b')]['id']},'attributes':['name',_0xead7('0x56'),_0xead7('0x57'),_0xead7('0x58')],'raw':!![]})[_0xead7('0x26')](handleEntityNotFound(_0x3ecdad,null))[_0xead7('0x26')](function(_0x2a6b2e){if(_0x2a6b2e){if(!fs['existsSync'](path['join'](config[_0xead7('0x59')],_0xead7('0x5a'),_0x2a6b2e[_0xead7('0x57')]))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x3673b3[_0xead7('0x38')][_0xead7('0x5b')]){return _0x3ecdad['sendStatus'](0xc8);}return _0x3ecdad[_0xead7('0x55')](path[_0xead7('0x5c')](config[_0xead7('0x59')],'server/files/reports',_0x2a6b2e[_0xead7('0x57')]),util[_0xead7('0x5d')](_0xead7('0x5e'),_0x2a6b2e[_0xead7('0x56')]||_0x2a6b2e[_0xead7('0x2e')],_0x2a6b2e['output'][_0xead7('0x5f')]()));}})['catch'](handleError(_0x3ecdad,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0c1da56..34a73a5 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 _0x1292=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x5c8b22,_0x45fbf3){var _0x4d4259=function(_0xf153fe){while(--_0xf153fe){_0x5c8b22['push'](_0x5c8b22['shift']());}};_0x4d4259(++_0x45fbf3);}(_0x1292,0x195));var _0x2129=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x1292[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x2129('0x0'));var util=require(_0x2129('0x1'));var logger=require(_0x2129('0x2'))('api');var moment=require(_0x2129('0x3'));var BPromise=require(_0x2129('0x4'));var rp=require(_0x2129('0x5'));var fs=require('fs');var path=require(_0x2129('0x6'));var rimraf=require(_0x2129('0x7'));var config=require(_0x2129('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x2129('0x9')]=function(_0x16f3c8,_0x5477b2){return _0x16f3c8[_0x2129('0xa')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1aa=['analytics_extracted_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0xf1aa,0x1c8));var _0xaf1a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf1aa[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xaf1a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaf1a('0x1'));var moment=require(_0xaf1a('0x2'));var BPromise=require(_0xaf1a('0x3'));var rp=require(_0xaf1a('0x4'));var fs=require('fs');var path=require(_0xaf1a('0x5'));var rimraf=require(_0xaf1a('0x6'));var config=require(_0xaf1a('0x7'));var attributes=require(_0xaf1a('0x8'));module[_0xaf1a('0x9')]=function(_0x54369a,_0x5339ca){return _0x54369a[_0xaf1a('0xa')](_0xaf1a('0xb'),attributes,{'tableName':_0xaf1a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 0d5ec8a..513ca8a 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 _0x5800=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3c586c,_0x37f07f){var _0x1dab88=function(_0x304aa8){while(--_0x304aa8){_0x3c586c['push'](_0x3c586c['shift']());}};_0x1dab88(++_0x37f07f);}(_0x5800,0x1b9));var _0x0580=function(_0xbba503,_0x4a5af9){_0xbba503=_0xbba503-0x0;var _0x474a7e=_0x5800[_0xbba503];return _0x474a7e;};'use strict';var _=require('lodash');var util=require(_0x0580('0x0'));var moment=require(_0x0580('0x1'));var BPromise=require(_0x0580('0x2'));var rs=require(_0x0580('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0580('0x4'))['db'];var utils=require(_0x0580('0x5'));var logger=require('../../config/logger')(_0x0580('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0580('0x7')][_0x0580('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bac94,_0x13dab9,_0x5c4ab8){return new BPromise(function(_0x1e4b42,_0x51bb48){return client[_0x0580('0x9')](_0x5bac94,_0x5c4ab8)[_0x0580('0xa')](function(_0x451bab){logger[_0x0580('0xb')](_0x0580('0xc'),_0x13dab9,_0x0580('0xd'));logger[_0x0580('0xe')](_0x0580('0xf'),_0x13dab9,'request\x20sent',JSON[_0x0580('0x10')](_0x451bab));if(_0x451bab[_0x0580('0x11')]){if(_0x451bab[_0x0580('0x11')]['code']===0x1f4){logger['error'](_0x0580('0xc'),_0x13dab9,_0x451bab[_0x0580('0x11')][_0x0580('0x12')]);return _0x51bb48(_0x451bab['error'][_0x0580('0x12')]);}logger[_0x0580('0x11')](_0x0580('0xc'),_0x13dab9,_0x451bab['error'][_0x0580('0x12')]);return _0x1e4b42(_0x451bab[_0x0580('0x11')][_0x0580('0x12')]);}else{logger[_0x0580('0xb')](_0x0580('0xc'),_0x13dab9,_0x0580('0xd'));_0x1e4b42(_0x451bab[_0x0580('0x13')]['message']);}})[_0x0580('0x14')](function(_0x30fa3e){logger[_0x0580('0x11')](_0x0580('0xc'),_0x13dab9,_0x30fa3e);_0x51bb48(_0x30fa3e);});});} \ No newline at end of file +var _0x475f=['info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','rpc','jayson/promise','client','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x475f,0x187));var _0xf475=function(_0x1b25ca,_0x1c43b3){_0x1b25ca=_0x1b25ca-0x0;var _0x118990=_0x475f[_0x1b25ca];return _0x118990;};'use strict';var _=require('lodash');var util=require(_0xf475('0x0'));var moment=require(_0xf475('0x1'));var BPromise=require('bluebird');var rs=require(_0xf475('0x2'));var fs=require('fs');var Redis=require(_0xf475('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf475('0x4'));var config=require('../../config/environment');var jayson=require(_0xf475('0x5'));var client=jayson[_0xf475('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56c96e,_0x20e5eb,_0x118803){return new BPromise(function(_0x348ab7,_0x24e6d2){return client[_0xf475('0x7')](_0x56c96e,_0x118803)[_0xf475('0x8')](function(_0x793f50){logger[_0xf475('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x20e5eb,_0xf475('0xa'));logger[_0xf475('0xb')](_0xf475('0xc'),_0x20e5eb,_0xf475('0xa'),JSON[_0xf475('0xd')](_0x793f50));if(_0x793f50[_0xf475('0xe')]){if(_0x793f50[_0xf475('0xe')][_0xf475('0xf')]===0x1f4){logger[_0xf475('0xe')](_0xf475('0x10'),_0x20e5eb,_0x793f50[_0xf475('0xe')]['message']);return _0x24e6d2(_0x793f50['error']['message']);}logger[_0xf475('0xe')](_0xf475('0x10'),_0x20e5eb,_0x793f50[_0xf475('0xe')][_0xf475('0x11')]);return _0x348ab7(_0x793f50[_0xf475('0xe')]['message']);}else{logger[_0xf475('0x9')](_0xf475('0x10'),_0x20e5eb,_0xf475('0xa'));_0x348ab7(_0x793f50[_0xf475('0x12')][_0xf475('0x11')]);}})[_0xf475('0x13')](function(_0x235fe8){logger['error'](_0xf475('0x10'),_0x20e5eb,_0x235fe8);_0x24e6d2(_0x235fe8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ef271d2..64cbc5c 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 _0x255e=['../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x255e,0xb9));var _0xe255=function(_0x52ec0b,_0x3df7de){_0x52ec0b=_0x52ec0b-0x0;var _0x411628=_0x255e[_0x52ec0b];return _0x411628;};'use strict';var multer=require(_0xe255('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe255('0x1'));var express=require(_0xe255('0x2'));var router=express[_0xe255('0x3')]();var fs_extra=require(_0xe255('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe255('0x5'));var controller=require(_0xe255('0x6'));router['get']('/',auth[_0xe255('0x7')](),controller[_0xe255('0x8')]);router['get'](_0xe255('0x9'),auth['isAuthenticated'](),controller[_0xe255('0xa')]);router[_0xe255('0xb')](_0xe255('0xc'),auth['isAuthenticated'](),controller[_0xe255('0xd')]);router['post']('/',auth[_0xe255('0x7')](),controller['create']);router[_0xe255('0xe')](_0xe255('0x9'),auth[_0xe255('0x7')](),controller[_0xe255('0xf')]);router[_0xe255('0x10')](_0xe255('0x9'),auth[_0xe255('0x7')](),controller[_0xe255('0x11')]);module[_0xe255('0x12')]=router; \ No newline at end of file +var _0xba7f=['put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','post'];(function(_0x4543f6,_0x28d116){var _0x3ea543=function(_0x8dea53){while(--_0x8dea53){_0x4543f6['push'](_0x4543f6['shift']());}};_0x3ea543(++_0x28d116);}(_0xba7f,0xee));var _0xfba7=function(_0x2f9431,_0x44c4ec){_0x2f9431=_0x2f9431-0x0;var _0x28524c=_0xba7f[_0x2f9431];return _0x28524c;};'use strict';var multer=require(_0xfba7('0x0'));var util=require('util');var path=require(_0xfba7('0x1'));var timeout=require('connect-timeout');var express=require(_0xfba7('0x2'));var router=express[_0xfba7('0x3')]();var fs_extra=require(_0xfba7('0x4'));var auth=require(_0xfba7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfba7('0x6'));var controller=require(_0xfba7('0x7'));router[_0xfba7('0x8')]('/',auth[_0xfba7('0x9')](),controller[_0xfba7('0xa')]);router[_0xfba7('0x8')](_0xfba7('0xb'),auth[_0xfba7('0x9')](),controller['show']);router[_0xfba7('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xfba7('0xc')]);router[_0xfba7('0xd')]('/',auth[_0xfba7('0x9')](),controller['create']);router[_0xfba7('0xe')](_0xfba7('0xb'),auth['isAuthenticated'](),controller[_0xfba7('0xf')]);router[_0xfba7('0x10')](_0xfba7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xfba7('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f1d30f7..10f35aa 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 _0x51c9=['exports','STRING','sequelize'];(function(_0x219c82,_0xe6f67f){var _0x2195c9=function(_0x333d71){while(--_0x333d71){_0x219c82['push'](_0x219c82['shift']());}};_0x2195c9(++_0xe6f67f);}(_0x51c9,0x6b));var _0x951c=function(_0x11236d,_0x46bf42){_0x11236d=_0x11236d-0x0;var _0x573aae=_0x51c9[_0x11236d];return _0x573aae;};'use strict';var Sequelize=require(_0x951c('0x0'));module[_0x951c('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x951c('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x951c('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x24d0=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x39439d,_0xd99786){var _0x78bfe9=function(_0x185e25){while(--_0x185e25){_0x39439d['push'](_0x39439d['shift']());}};_0x78bfe9(++_0xd99786);}(_0x24d0,0xc1));var _0x024d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x24d0[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x024d('0x0'));module[_0x024d('0x1')]={'field':{'type':Sequelize[_0x024d('0x2')]},'alias':{'type':Sequelize[_0x024d('0x3')]},'function':{'type':Sequelize[_0x024d('0x3')]},'format':{'type':Sequelize[_0x024d('0x3')]},'groupBy':{'type':Sequelize[_0x024d('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x024d('0x3')]},'custom':{'type':Sequelize[_0x024d('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 2be078e..260d4cf 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 _0xce17=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','rows','catch','show','keys','includeAll','merge','create','body','bulkCreate','find','params','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce17,0x11a));var _0x7ce1=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xce17[_0x10f6e8];return _0x35bb3c;};'use strict';var emlformat=require(_0x7ce1('0x0'));var rimraf=require(_0x7ce1('0x1'));var zipdir=require(_0x7ce1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ce1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7ce1('0x4'));var util=require(_0x7ce1('0x5'));var path=require(_0x7ce1('0x6'));var sox=require(_0x7ce1('0x7'));var csv=require(_0x7ce1('0x8'));var ejs=require(_0x7ce1('0x9'));var fs=require('fs');var fs_extra=require(_0x7ce1('0xa'));var _=require(_0x7ce1('0xb'));var squel=require(_0x7ce1('0xc'));var crypto=require(_0x7ce1('0xd'));var jsforce=require(_0x7ce1('0xe'));var deskjs=require(_0x7ce1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7ce1('0x10'));var Papa=require(_0x7ce1('0x11'));var Redis=require(_0x7ce1('0x12'));var authService=require(_0x7ce1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ce1('0x14'))(_0x7ce1('0x15'));var utils=require(_0x7ce1('0x16'));var config=require(_0x7ce1('0x17'));var licenseUtil=require(_0x7ce1('0x18'));var db=require(_0x7ce1('0x19'))['db'];function respondWithStatusCode(_0x2c52f5,_0x4cbe5f){_0x4cbe5f=_0x4cbe5f||0xcc;return function(_0x1f3768){if(_0x1f3768){return _0x2c52f5['sendStatus'](_0x4cbe5f);}return _0x2c52f5[_0x7ce1('0x1a')](_0x4cbe5f)[_0x7ce1('0x1b')]();};}function respondWithResult(_0x119941,_0x276778){_0x276778=_0x276778||0xc8;return function(_0x5dabbe){if(_0x5dabbe){return _0x119941[_0x7ce1('0x1a')](_0x276778)[_0x7ce1('0x1c')](_0x5dabbe);}};}function respondWithFilteredResult(_0x3063d1,_0x35164d){return function(_0x36a83f){if(_0x36a83f){var _0x20136c=typeof _0x35164d[_0x7ce1('0x1d')]===_0x7ce1('0x1e')&&typeof _0x35164d[_0x7ce1('0x1f')]===_0x7ce1('0x1e');var _0x5499a2=_0x36a83f[_0x7ce1('0x20')];var _0x254a42=_0x20136c?0x0:_0x35164d[_0x7ce1('0x1d')];var _0x12be22=_0x20136c?_0x36a83f[_0x7ce1('0x20')]:_0x35164d[_0x7ce1('0x1d')]+_0x35164d[_0x7ce1('0x1f')];var _0x5d709f;if(_0x12be22>=_0x5499a2){_0x12be22=_0x5499a2;_0x5d709f=0xc8;}else{_0x5d709f=0xce;}_0x3063d1[_0x7ce1('0x1a')](_0x5d709f);return _0x3063d1[_0x7ce1('0x21')](_0x7ce1('0x22'),_0x254a42+'-'+_0x12be22+'/'+_0x5499a2)[_0x7ce1('0x1c')](_0x36a83f);}return null;};}function patchUpdates(_0x49442a){return function(_0x13a2ee){try{jsonpatch['apply'](_0x13a2ee,_0x49442a,!![]);}catch(_0x2d43fa){return BPromise['reject'](_0x2d43fa);}return _0x13a2ee[_0x7ce1('0x23')]();};}function saveUpdates(_0x158ce8,_0x42eae3){return function(_0x32c8e3){if(_0x32c8e3){return _0x32c8e3[_0x7ce1('0x24')](_0x158ce8)[_0x7ce1('0x25')](function(_0x2d7ef6){return _0x2d7ef6;});}return null;};}function removeEntity(_0x5eab34,_0x5d6ad8){return function(_0xee6235){if(_0xee6235){return _0xee6235[_0x7ce1('0x26')]()[_0x7ce1('0x25')](function(){_0x5eab34['status'](0xcc)[_0x7ce1('0x1b')]();});}};}function handleEntityNotFound(_0x37f339,_0x4cf6f6){return function(_0x458479){if(!_0x458479){_0x37f339[_0x7ce1('0x27')](0x194);}return _0x458479;};}function handleError(_0x5c361b,_0x30548f){_0x30548f=_0x30548f||0x1f4;return function(_0x14a6d2){logger['error'](_0x14a6d2[_0x7ce1('0x28')]);if(_0x14a6d2[_0x7ce1('0x29')]){delete _0x14a6d2[_0x7ce1('0x29')];}_0x5c361b['status'](_0x30548f)[_0x7ce1('0x2a')](_0x14a6d2);};}exports[_0x7ce1('0x2b')]=function(_0x40f529,_0xe0faaa){var _0xbb90ea={},_0x15efde={},_0x56ca65={'count':0x0,'rows':[]};var _0x3f8acd=_[_0x7ce1('0x2c')](db[_0x7ce1('0x2d')][_0x7ce1('0x2e')],function(_0x37cd6e){return{'name':_0x37cd6e[_0x7ce1('0x2f')],'type':_0x37cd6e[_0x7ce1('0x30')][_0x7ce1('0x31')]};});_0x15efde[_0x7ce1('0x32')]=_[_0x7ce1('0x2c')](_0x3f8acd,_0x7ce1('0x29'));_0x15efde[_0x7ce1('0x33')]=_['keys'](_0x40f529['query']);_0x15efde[_0x7ce1('0x34')]=_[_0x7ce1('0x35')](_0x15efde[_0x7ce1('0x32')],_0x15efde[_0x7ce1('0x33')]);_0xbb90ea['attributes']=_[_0x7ce1('0x35')](_0x15efde[_0x7ce1('0x32')],qs['fields'](_0x40f529[_0x7ce1('0x33')][_0x7ce1('0x36')]));_0xbb90ea['attributes']=_0xbb90ea[_0x7ce1('0x37')][_0x7ce1('0x38')]?_0xbb90ea[_0x7ce1('0x37')]:_0x15efde[_0x7ce1('0x32')];if(!_0x40f529[_0x7ce1('0x33')][_0x7ce1('0x39')](_0x7ce1('0x3a'))){_0xbb90ea['limit']=qs['limit'](_0x40f529[_0x7ce1('0x33')][_0x7ce1('0x1f')]);_0xbb90ea[_0x7ce1('0x1d')]=qs['offset'](_0x40f529[_0x7ce1('0x33')]['offset']);}_0xbb90ea[_0x7ce1('0x3b')]=qs[_0x7ce1('0x3c')](_0x40f529['query'][_0x7ce1('0x3c')]);_0xbb90ea[_0x7ce1('0x3d')]=qs[_0x7ce1('0x34')](_['pick'](_0x40f529[_0x7ce1('0x33')],_0x15efde[_0x7ce1('0x34')]),_0x3f8acd);if(_0x40f529[_0x7ce1('0x33')][_0x7ce1('0x3e')]){_0xbb90ea[_0x7ce1('0x3d')]=_['merge'](_0xbb90ea[_0x7ce1('0x3d')],{'$or':_[_0x7ce1('0x2c')](_0x3f8acd,function(_0x4f885c){if(_0x4f885c[_0x7ce1('0x30')]!==_0x7ce1('0x3f')){var _0x4c3b02={};_0x4c3b02[_0x4f885c[_0x7ce1('0x29')]]={'$like':'%'+_0x40f529[_0x7ce1('0x33')][_0x7ce1('0x3e')]+'%'};return _0x4c3b02;}})});}_0xbb90ea=_['merge']({},_0xbb90ea,_0x40f529[_0x7ce1('0x40')]);var _0xccceb3={'where':_0xbb90ea[_0x7ce1('0x3d')]};return db['AnalyticFieldReport'][_0x7ce1('0x20')](_0xccceb3)['then'](function(_0x5674f8){_0x56ca65['count']=_0x5674f8;if(_0x40f529[_0x7ce1('0x33')]['includeAll']){_0xbb90ea[_0x7ce1('0x41')]=[{'all':!![]}];}return db[_0x7ce1('0x2d')]['findAll'](_0xbb90ea);})[_0x7ce1('0x25')](function(_0x597e39){_0x56ca65[_0x7ce1('0x42')]=_0x597e39;return _0x56ca65;})['then'](respondWithFilteredResult(_0xe0faaa,_0xbb90ea))[_0x7ce1('0x43')](handleError(_0xe0faaa,null));};exports[_0x7ce1('0x44')]=function(_0x5359db,_0x7c1ed4){var _0x4b648a={'raw':![],'where':{'id':_0x5359db['params']['id']}},_0x54d00b={};_0x54d00b['model']=_[_0x7ce1('0x45')](db[_0x7ce1('0x2d')][_0x7ce1('0x2e')]);_0x54d00b[_0x7ce1('0x33')]=_[_0x7ce1('0x45')](_0x5359db['query']);_0x54d00b[_0x7ce1('0x34')]=_[_0x7ce1('0x35')](_0x54d00b['model'],_0x54d00b[_0x7ce1('0x33')]);_0x4b648a['attributes']=_[_0x7ce1('0x35')](_0x54d00b[_0x7ce1('0x32')],qs[_0x7ce1('0x36')](_0x5359db[_0x7ce1('0x33')][_0x7ce1('0x36')]));_0x4b648a[_0x7ce1('0x37')]=_0x4b648a[_0x7ce1('0x37')][_0x7ce1('0x38')]?_0x4b648a['attributes']:_0x54d00b['model'];if(_0x5359db[_0x7ce1('0x33')][_0x7ce1('0x46')]){_0x4b648a['include']=[{'all':!![]}];}_0x4b648a=_[_0x7ce1('0x47')]({},_0x4b648a,_0x5359db[_0x7ce1('0x40')]);return db[_0x7ce1('0x2d')]['find'](_0x4b648a)[_0x7ce1('0x25')](handleEntityNotFound(_0x7c1ed4,null))['then'](respondWithResult(_0x7c1ed4,null))[_0x7ce1('0x43')](handleError(_0x7c1ed4,null));};exports['create']=function(_0x114f26,_0x430ca4){return db[_0x7ce1('0x2d')][_0x7ce1('0x48')](_0x114f26[_0x7ce1('0x49')],{})[_0x7ce1('0x25')](respondWithResult(_0x430ca4,0xc9))[_0x7ce1('0x43')](handleError(_0x430ca4,null));};exports[_0x7ce1('0x4a')]=function(_0x467bf1,_0xc92d82){return db[_0x7ce1('0x2d')][_0x7ce1('0x4a')](_0x467bf1[_0x7ce1('0x49')],{'raw':![],'individualHooks':!![]})[_0x7ce1('0x25')](respondWithResult(_0xc92d82,0xc9))['catch'](handleError(_0xc92d82,null));};exports[_0x7ce1('0x24')]=function(_0x3d966e,_0x168e2a){if(_0x3d966e[_0x7ce1('0x49')]['id']){delete _0x3d966e[_0x7ce1('0x49')]['id'];}return db[_0x7ce1('0x2d')][_0x7ce1('0x4b')]({'where':{'id':_0x3d966e['params']['id']}})[_0x7ce1('0x25')](handleEntityNotFound(_0x168e2a,null))['then'](saveUpdates(_0x3d966e['body'],null))[_0x7ce1('0x25')](respondWithResult(_0x168e2a,null))['catch'](handleError(_0x168e2a,null));};exports[_0x7ce1('0x26')]=function(_0x44b317,_0x327e02){return db[_0x7ce1('0x2d')][_0x7ce1('0x4b')]({'where':{'id':_0x44b317[_0x7ce1('0x4c')]['id']}})[_0x7ce1('0x25')](handleEntityNotFound(_0x327e02,null))[_0x7ce1('0x25')](removeEntity(_0x327e02,null))['catch'](handleError(_0x327e02,null));};exports[_0x7ce1('0x4d')]=function(_0x27c4b9,_0x4424f2){return db[_0x7ce1('0x2d')][_0x7ce1('0x26')]({'where':{'id':_0x27c4b9[_0x7ce1('0x33')][_0x7ce1('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x7ce1('0x25')](respondWithResult(_0x4424f2,0xcc))[_0x7ce1('0x43')](handleError(_0x4424f2,null));};exports[_0x7ce1('0x4f')]=function(_0x515234,_0x5708ff,_0x5cec57){return db['AnalyticCustomReport'][_0x7ce1('0x50')]({'where':{'id':_0x515234[_0x7ce1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5708ff,null))['then'](function(_0x221635){if(_0x221635){return db['sequelize'][_0x7ce1('0x51')](function(_0x491217){return db[_0x7ce1('0x2d')][_0x7ce1('0x26')]({'where':{'CustomReportId':_0x515234['params']['id']},'transaction':_0x491217})[_0x7ce1('0x25')](function(_0x2bcb01){var _0x48f24e=_[_0x7ce1('0x2c')](_0x515234['body'],function(_0xd1e839){delete _0xd1e839['id'];_0xd1e839[_0x7ce1('0x52')]=_0x515234['params']['id'];return _0xd1e839;});return db['AnalyticFieldReport'][_0x7ce1('0x4a')](_0x48f24e,{'transaction':_0x491217});});})['then'](function(){return db[_0x7ce1('0x2d')][_0x7ce1('0x53')]({'where':{'CustomReportId':_0x515234[_0x7ce1('0x4c')]['id']}});});}})[_0x7ce1('0x25')](respondWithResult(_0x5708ff,null))['catch'](handleError(_0x5708ff,null));}; \ No newline at end of file +var _0xff3e=['includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','create','body','bulkCreate','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xff3e,0x166));var _0xeff3=function(_0x4fd87c,_0x132def){_0x4fd87c=_0x4fd87c-0x0;var _0x49d135=_0xff3e[_0x4fd87c];return _0x49d135;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeff3('0x0'));var jsonpatch=require(_0xeff3('0x1'));var rp=require(_0xeff3('0x2'));var moment=require(_0xeff3('0x3'));var BPromise=require(_0xeff3('0x4'));var Mustache=require(_0xeff3('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeff3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeff3('0x7'));var squel=require(_0xeff3('0x8'));var crypto=require(_0xeff3('0x9'));var jsforce=require(_0xeff3('0xa'));var deskjs=require(_0xeff3('0xb'));var toCsv=require(_0xeff3('0xc'));var querystring=require('querystring');var Papa=require(_0xeff3('0xd'));var Redis=require(_0xeff3('0xe'));var authService=require(_0xeff3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeff3('0x10'));var hardwareService=require(_0xeff3('0x11'));var logger=require('../../config/logger')(_0xeff3('0x12'));var utils=require(_0xeff3('0x13'));var config=require(_0xeff3('0x14'));var licenseUtil=require(_0xeff3('0x15'));var db=require(_0xeff3('0x16'))['db'];function respondWithStatusCode(_0x319a69,_0xfa19f8){_0xfa19f8=_0xfa19f8||0xcc;return function(_0x53b9b){if(_0x53b9b){return _0x319a69[_0xeff3('0x17')](_0xfa19f8);}return _0x319a69[_0xeff3('0x18')](_0xfa19f8)[_0xeff3('0x19')]();};}function respondWithResult(_0x3e20ed,_0x3cb2b0){_0x3cb2b0=_0x3cb2b0||0xc8;return function(_0x296275){if(_0x296275){return _0x3e20ed[_0xeff3('0x18')](_0x3cb2b0)[_0xeff3('0x1a')](_0x296275);}};}function respondWithFilteredResult(_0x55cc7b,_0x243f70){return function(_0x5b2521){if(_0x5b2521){var _0x4a83de=typeof _0x243f70[_0xeff3('0x1b')]===_0xeff3('0x1c')&&typeof _0x243f70[_0xeff3('0x1d')]==='undefined';var _0x11b85e=_0x5b2521[_0xeff3('0x1e')];var _0x7f2ae=_0x4a83de?0x0:_0x243f70[_0xeff3('0x1b')];var _0x4e2d8d=_0x4a83de?_0x5b2521[_0xeff3('0x1e')]:_0x243f70[_0xeff3('0x1b')]+_0x243f70[_0xeff3('0x1d')];var _0x269051;if(_0x4e2d8d>=_0x11b85e){_0x4e2d8d=_0x11b85e;_0x269051=0xc8;}else{_0x269051=0xce;}_0x55cc7b[_0xeff3('0x18')](_0x269051);return _0x55cc7b[_0xeff3('0x1f')](_0xeff3('0x20'),_0x7f2ae+'-'+_0x4e2d8d+'/'+_0x11b85e)[_0xeff3('0x1a')](_0x5b2521);}return null;};}function patchUpdates(_0x38b5d4){return function(_0x141fcc){try{jsonpatch[_0xeff3('0x21')](_0x141fcc,_0x38b5d4,!![]);}catch(_0x3f04a0){return BPromise[_0xeff3('0x22')](_0x3f04a0);}return _0x141fcc['save']();};}function saveUpdates(_0xeec675,_0x396db5){return function(_0x44e072){if(_0x44e072){return _0x44e072[_0xeff3('0x23')](_0xeec675)[_0xeff3('0x24')](function(_0x25b518){return _0x25b518;});}return null;};}function removeEntity(_0x304f52,_0x3fc78d){return function(_0x3a4118){if(_0x3a4118){return _0x3a4118[_0xeff3('0x25')]()['then'](function(){_0x304f52[_0xeff3('0x18')](0xcc)[_0xeff3('0x19')]();});}};}function handleEntityNotFound(_0x10b311,_0x3d3817){return function(_0x3e8e0d){if(!_0x3e8e0d){_0x10b311[_0xeff3('0x17')](0x194);}return _0x3e8e0d;};}function handleError(_0x860f2,_0x262f89){_0x262f89=_0x262f89||0x1f4;return function(_0x8cfee0){logger[_0xeff3('0x26')](_0x8cfee0['stack']);if(_0x8cfee0[_0xeff3('0x27')]){delete _0x8cfee0[_0xeff3('0x27')];}_0x860f2[_0xeff3('0x18')](_0x262f89)[_0xeff3('0x28')](_0x8cfee0);};}exports[_0xeff3('0x29')]=function(_0x33145a,_0x366aee){var _0x299290={},_0x43f09f={},_0x4a75e7={'count':0x0,'rows':[]};var _0x39e145=_[_0xeff3('0x2a')](db[_0xeff3('0x2b')]['rawAttributes'],function(_0x5567e6){return{'name':_0x5567e6[_0xeff3('0x2c')],'type':_0x5567e6[_0xeff3('0x2d')][_0xeff3('0x2e')]};});_0x43f09f[_0xeff3('0x2f')]=_[_0xeff3('0x2a')](_0x39e145,_0xeff3('0x27'));_0x43f09f[_0xeff3('0x30')]=_['keys'](_0x33145a['query']);_0x43f09f[_0xeff3('0x31')]=_[_0xeff3('0x32')](_0x43f09f[_0xeff3('0x2f')],_0x43f09f[_0xeff3('0x30')]);_0x299290['attributes']=_['intersection'](_0x43f09f['model'],qs[_0xeff3('0x33')](_0x33145a[_0xeff3('0x30')][_0xeff3('0x33')]));_0x299290[_0xeff3('0x34')]=_0x299290[_0xeff3('0x34')]['length']?_0x299290['attributes']:_0x43f09f['model'];if(!_0x33145a[_0xeff3('0x30')][_0xeff3('0x35')](_0xeff3('0x36'))){_0x299290[_0xeff3('0x1d')]=qs[_0xeff3('0x1d')](_0x33145a[_0xeff3('0x30')][_0xeff3('0x1d')]);_0x299290[_0xeff3('0x1b')]=qs[_0xeff3('0x1b')](_0x33145a[_0xeff3('0x30')][_0xeff3('0x1b')]);}_0x299290[_0xeff3('0x37')]=qs[_0xeff3('0x38')](_0x33145a['query'][_0xeff3('0x38')]);_0x299290[_0xeff3('0x39')]=qs[_0xeff3('0x31')](_[_0xeff3('0x3a')](_0x33145a[_0xeff3('0x30')],_0x43f09f[_0xeff3('0x31')]),_0x39e145);if(_0x33145a['query'][_0xeff3('0x3b')]){_0x299290[_0xeff3('0x39')]=_['merge'](_0x299290[_0xeff3('0x39')],{'$or':_[_0xeff3('0x2a')](_0x39e145,function(_0x49d33b){if(_0x49d33b[_0xeff3('0x2d')]!==_0xeff3('0x3c')){var _0xf42e04={};_0xf42e04[_0x49d33b[_0xeff3('0x27')]]={'$like':'%'+_0x33145a[_0xeff3('0x30')][_0xeff3('0x3b')]+'%'};return _0xf42e04;}})});}_0x299290=_['merge']({},_0x299290,_0x33145a[_0xeff3('0x3d')]);var _0x594ffd={'where':_0x299290[_0xeff3('0x39')]};return db[_0xeff3('0x2b')][_0xeff3('0x1e')](_0x594ffd)['then'](function(_0x1cd820){_0x4a75e7['count']=_0x1cd820;if(_0x33145a[_0xeff3('0x30')][_0xeff3('0x3e')]){_0x299290[_0xeff3('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xeff3('0x40')](_0x299290);})[_0xeff3('0x24')](function(_0x4b482b){_0x4a75e7[_0xeff3('0x41')]=_0x4b482b;return _0x4a75e7;})[_0xeff3('0x24')](respondWithFilteredResult(_0x366aee,_0x299290))[_0xeff3('0x42')](handleError(_0x366aee,null));};exports[_0xeff3('0x43')]=function(_0x5be2fc,_0x28caa1){var _0x592f94={'raw':![],'where':{'id':_0x5be2fc[_0xeff3('0x44')]['id']}},_0x51827e={};_0x51827e[_0xeff3('0x2f')]=_[_0xeff3('0x45')](db[_0xeff3('0x2b')][_0xeff3('0x46')]);_0x51827e[_0xeff3('0x30')]=_['keys'](_0x5be2fc[_0xeff3('0x30')]);_0x51827e['filters']=_[_0xeff3('0x32')](_0x51827e[_0xeff3('0x2f')],_0x51827e['query']);_0x592f94[_0xeff3('0x34')]=_['intersection'](_0x51827e[_0xeff3('0x2f')],qs[_0xeff3('0x33')](_0x5be2fc['query'][_0xeff3('0x33')]));_0x592f94[_0xeff3('0x34')]=_0x592f94[_0xeff3('0x34')][_0xeff3('0x47')]?_0x592f94[_0xeff3('0x34')]:_0x51827e[_0xeff3('0x2f')];if(_0x5be2fc[_0xeff3('0x30')][_0xeff3('0x3e')]){_0x592f94[_0xeff3('0x3f')]=[{'all':!![]}];}_0x592f94=_[_0xeff3('0x48')]({},_0x592f94,_0x5be2fc[_0xeff3('0x3d')]);return db[_0xeff3('0x2b')]['find'](_0x592f94)[_0xeff3('0x24')](handleEntityNotFound(_0x28caa1,null))[_0xeff3('0x24')](respondWithResult(_0x28caa1,null))[_0xeff3('0x42')](handleError(_0x28caa1,null));};exports[_0xeff3('0x49')]=function(_0x2c232d,_0x2e487b){return db['AnalyticFieldReport'][_0xeff3('0x49')](_0x2c232d[_0xeff3('0x4a')],{})[_0xeff3('0x24')](respondWithResult(_0x2e487b,0xc9))['catch'](handleError(_0x2e487b,null));};exports[_0xeff3('0x4b')]=function(_0x5ae1e5,_0x5d4a51){return db['AnalyticFieldReport'][_0xeff3('0x4b')](_0x5ae1e5['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5d4a51,0xc9))[_0xeff3('0x42')](handleError(_0x5d4a51,null));};exports[_0xeff3('0x23')]=function(_0xa9573e,_0x364a3d){if(_0xa9573e[_0xeff3('0x4a')]['id']){delete _0xa9573e[_0xeff3('0x4a')]['id'];}return db[_0xeff3('0x2b')]['find']({'where':{'id':_0xa9573e[_0xeff3('0x44')]['id']}})[_0xeff3('0x24')](handleEntityNotFound(_0x364a3d,null))['then'](saveUpdates(_0xa9573e[_0xeff3('0x4a')],null))[_0xeff3('0x24')](respondWithResult(_0x364a3d,null))['catch'](handleError(_0x364a3d,null));};exports[_0xeff3('0x25')]=function(_0x54cb59,_0x1b7eb7){return db[_0xeff3('0x2b')][_0xeff3('0x4c')]({'where':{'id':_0x54cb59['params']['id']}})[_0xeff3('0x24')](handleEntityNotFound(_0x1b7eb7,null))[_0xeff3('0x24')](removeEntity(_0x1b7eb7,null))[_0xeff3('0x42')](handleError(_0x1b7eb7,null));};exports[_0xeff3('0x4d')]=function(_0x46bdfb,_0x173143){return db[_0xeff3('0x2b')][_0xeff3('0x25')]({'where':{'id':_0x46bdfb['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xeff3('0x24')](respondWithResult(_0x173143,0xcc))['catch'](handleError(_0x173143,null));};exports[_0xeff3('0x4e')]=function(_0x5abc82,_0x57a0be,_0x18bbb0){return db[_0xeff3('0x4f')][_0xeff3('0x50')]({'where':{'id':_0x5abc82['params']['id']}})['then'](handleEntityNotFound(_0x57a0be,null))['then'](function(_0x44e77a){if(_0x44e77a){return db[_0xeff3('0x51')][_0xeff3('0x52')](function(_0x1b7dc0){return db[_0xeff3('0x2b')][_0xeff3('0x25')]({'where':{'CustomReportId':_0x5abc82[_0xeff3('0x44')]['id']},'transaction':_0x1b7dc0})[_0xeff3('0x24')](function(_0x224078){var _0x3d304f=_[_0xeff3('0x2a')](_0x5abc82[_0xeff3('0x4a')],function(_0x3825ed){delete _0x3825ed['id'];_0x3825ed[_0xeff3('0x53')]=_0x5abc82['params']['id'];return _0x3825ed;});return db[_0xeff3('0x2b')][_0xeff3('0x4b')](_0x3d304f,{'transaction':_0x1b7dc0});});})['then'](function(){return db[_0xeff3('0x2b')][_0xeff3('0x40')]({'where':{'CustomReportId':_0x5abc82['params']['id']}});});}})[_0xeff3('0x24')](respondWithResult(_0x57a0be,null))[_0xeff3('0x42')](handleError(_0x57a0be,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5cb972a..6e8c146 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 _0xe1d4=['../../config/environment','./analyticFieldReport.attributes','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xe1d4,0x18e));var _0x4e1d=function(_0x3578d5,_0x3d3a37){_0x3578d5=_0x3578d5-0x0;var _0x3deb8f=_0xe1d4[_0x3578d5];return _0x3deb8f;};'use strict';var _=require('lodash');var util=require(_0x4e1d('0x0'));var logger=require(_0x4e1d('0x1'))(_0x4e1d('0x2'));var moment=require(_0x4e1d('0x3'));var BPromise=require(_0x4e1d('0x4'));var rp=require(_0x4e1d('0x5'));var fs=require('fs');var path=require(_0x4e1d('0x6'));var rimraf=require('rimraf');var config=require(_0x4e1d('0x7'));var attributes=require(_0x4e1d('0x8'));module['exports']=function(_0x2ec196,_0xbced6b){return _0x2ec196['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe156=['define','AnalyticFieldReport','analytics_report_fields','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xe156,0x1a5));var _0x6e15=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xe156[_0x189305];return _0xea3406;};'use strict';var _=require(_0x6e15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6e15('0x1'));var moment=require(_0x6e15('0x2'));var BPromise=require(_0x6e15('0x3'));var rp=require(_0x6e15('0x4'));var fs=require('fs');var path=require(_0x6e15('0x5'));var rimraf=require('rimraf');var config=require(_0x6e15('0x6'));var attributes=require(_0x6e15('0x7'));module['exports']=function(_0xfa841f,_0x446805){return _0xfa841f[_0x6e15('0x8')](_0x6e15('0x9'),attributes,{'tableName':_0x6e15('0xa'),'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 a9e8305..d0c9786 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 _0x2f36=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0x2f36,0xb4));var _0x62f3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x2f36[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x62f3('0x0'));var util=require(_0x62f3('0x1'));var moment=require(_0x62f3('0x2'));var BPromise=require(_0x62f3('0x3'));var rs=require(_0x62f3('0x4'));var fs=require('fs');var Redis=require(_0x62f3('0x5'));var db=require(_0x62f3('0x6'))['db'];var utils=require(_0x62f3('0x7'));var logger=require('../../config/logger')(_0x62f3('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f3('0x9'));var client=jayson[_0x62f3('0xa')][_0x62f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf65ce8,_0x1f0ac8,_0x38a0d0){return new BPromise(function(_0x36b9a6,_0x58c576){return client[_0x62f3('0xc')](_0xf65ce8,_0x38a0d0)[_0x62f3('0xd')](function(_0x3eb2ea){logger[_0x62f3('0xe')](_0x62f3('0xf'),_0x1f0ac8,_0x62f3('0x10'));logger[_0x62f3('0x11')](_0x62f3('0x12'),_0x1f0ac8,'request\x20sent',JSON[_0x62f3('0x13')](_0x3eb2ea));if(_0x3eb2ea[_0x62f3('0x14')]){if(_0x3eb2ea[_0x62f3('0x14')]['code']===0x1f4){logger[_0x62f3('0x14')](_0x62f3('0xf'),_0x1f0ac8,_0x3eb2ea[_0x62f3('0x14')][_0x62f3('0x15')]);return _0x58c576(_0x3eb2ea[_0x62f3('0x14')][_0x62f3('0x15')]);}logger[_0x62f3('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0ac8,_0x3eb2ea[_0x62f3('0x14')][_0x62f3('0x15')]);return _0x36b9a6(_0x3eb2ea[_0x62f3('0x14')][_0x62f3('0x15')]);}else{logger['info'](_0x62f3('0xf'),_0x1f0ac8,'request\x20sent');_0x36b9a6(_0x3eb2ea['result'][_0x62f3('0x15')]);}})['catch'](function(_0x26f705){logger[_0x62f3('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f0ac8,_0x26f705);_0x58c576(_0x26f705);});});} \ No newline at end of file +var _0x9b87=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c49e8,_0x19d986){var _0x50bfe6=function(_0x41ffc6){while(--_0x41ffc6){_0x3c49e8['push'](_0x3c49e8['shift']());}};_0x50bfe6(++_0x19d986);}(_0x9b87,0x13c));var _0x79b8=function(_0x2edb1e,_0x2a26d7){_0x2edb1e=_0x2edb1e-0x0;var _0x35cb24=_0x9b87[_0x2edb1e];return _0x35cb24;};'use strict';var _=require(_0x79b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x79b8('0x1'));var rs=require(_0x79b8('0x2'));var fs=require('fs');var Redis=require(_0x79b8('0x3'));var db=require(_0x79b8('0x4'))['db'];var utils=require(_0x79b8('0x5'));var logger=require('../../config/logger')(_0x79b8('0x6'));var config=require(_0x79b8('0x7'));var jayson=require(_0x79b8('0x8'));var client=jayson[_0x79b8('0x9')][_0x79b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334360,_0x28d2a7,_0x1cd6dc){return new BPromise(function(_0x534614,_0x3f4f2b){return client[_0x79b8('0xb')](_0x334360,_0x1cd6dc)[_0x79b8('0xc')](function(_0x4cff1b){logger[_0x79b8('0xd')](_0x79b8('0xe'),_0x28d2a7,_0x79b8('0xf'));logger[_0x79b8('0x10')](_0x79b8('0x11'),_0x28d2a7,_0x79b8('0xf'),JSON[_0x79b8('0x12')](_0x4cff1b));if(_0x4cff1b[_0x79b8('0x13')]){if(_0x4cff1b[_0x79b8('0x13')]['code']===0x1f4){logger[_0x79b8('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x28d2a7,_0x4cff1b[_0x79b8('0x13')][_0x79b8('0x14')]);return _0x3f4f2b(_0x4cff1b['error'][_0x79b8('0x14')]);}logger[_0x79b8('0x13')](_0x79b8('0xe'),_0x28d2a7,_0x4cff1b['error'][_0x79b8('0x14')]);return _0x534614(_0x4cff1b[_0x79b8('0x13')][_0x79b8('0x14')]);}else{logger[_0x79b8('0xd')](_0x79b8('0xe'),_0x28d2a7,_0x79b8('0xf'));_0x534614(_0x4cff1b[_0x79b8('0x15')]['message']);}})[_0x79b8('0x16')](function(_0x50a8e0){logger[_0x79b8('0x13')](_0x79b8('0xe'),_0x28d2a7,_0x50a8e0);_0x3f4f2b(_0x50a8e0);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a64b522..a0e86c3 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(_0x49715f,_0x14c21b){var _0x5c4713=function(_0x530f62){while(--_0x530f62){_0x49715f['push'](_0x49715f['shift']());}};_0x5c4713(++_0x14c21b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x1d49be,_0x20e3a3){var _0x228615=function(_0x3687e2){while(--_0x3687e2){_0x1d49be['push'](_0x1d49be['shift']());}};_0x228615(++_0x20e3a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 9d2bf2a..6f21c90 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 _0x2964=['exports','STRING','name','TEXT','sequelize'];(function(_0x5a8d68,_0x3a40e1){var _0x3e5d30=function(_0x8afe62){while(--_0x8afe62){_0x5a8d68['push'](_0x5a8d68['shift']());}};_0x3e5d30(++_0x3a40e1);}(_0x2964,0x108));var _0x4296=function(_0x344878,_0x2afe53){_0x344878=_0x344878-0x0;var _0x357a68=_0x2964[_0x344878];return _0x357a68;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'name':{'type':Sequelize[_0x4296('0x2')],'allowNull':![],'unique':_0x4296('0x3')},'table':{'type':Sequelize[_0x4296('0x2')]},'metric':{'type':Sequelize[_0x4296('0x4')]},'description':{'type':Sequelize[_0x4296('0x2')]}}; \ No newline at end of file +var _0x6a55=['sequelize','STRING','name','TEXT'];(function(_0x139a76,_0x2df68c){var _0x58088a=function(_0x3b126f){while(--_0x3b126f){_0x139a76['push'](_0x139a76['shift']());}};_0x58088a(++_0x2df68c);}(_0x6a55,0x154));var _0x56a5=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0x6a55[_0x270dba];return _0x36b83b;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![],'unique':_0x56a5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x56a5('0x3')]},'description':{'type':Sequelize[_0x56a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 163cfae..04fab04 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x3e262d,_0x9cd692){var _0x2b9b7d=function(_0x12f0db){while(--_0x12f0db){_0x3e262d['push'](_0x3e262d['shift']());}};_0x2b9b7d(++_0x9cd692);}(_0x9a19,0x114));var _0x99a1=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x9a19[_0x3b3cc6];return _0x1161e4;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3e3216,_0x10c0c3){var _0x3ec6e6=function(_0x17e971){while(--_0x17e971){_0x3e3216['push'](_0x3e3216['shift']());}};_0x3ec6e6(++_0x10c0c3);}(_0x8ef6,0xf2));var _0x68ef=function(_0x525329,_0x78fd1b){_0x525329=_0x525329-0x0;var _0x1b3381=_0x8ef6[_0x525329];return _0x1b3381;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e120097..cbf5339 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 _0x94ba=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','AnalyticMetric'];(function(_0x37843e,_0x5d2fba){var _0x1c5fc1=function(_0x572f34){while(--_0x572f34){_0x37843e['push'](_0x37843e['shift']());}};_0x1c5fc1(++_0x5d2fba);}(_0x94ba,0xbe));var _0xa94b=function(_0x54fe4e,_0x153ebc){_0x54fe4e=_0x54fe4e-0x0;var _0x21ceae=_0x94ba[_0x54fe4e];return _0x21ceae;};'use strict';var _=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var logger=require(_0xa94b('0x2'))(_0xa94b('0x3'));var moment=require(_0xa94b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa94b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa94b('0x6'));var config=require(_0xa94b('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x76f30f,_0x2daeef){return _0x76f30f[_0xa94b('0x8')](_0xa94b('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc962=['analytics_metrics','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xc962,0x6d));var _0x2c96=function(_0x5d0673,_0x4f4c94){_0x5d0673=_0x5d0673-0x0;var _0x13229a=_0xc962[_0x5d0673];return _0x13229a;};'use strict';var _=require(_0x2c96('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2c96('0x1'));var BPromise=require(_0x2c96('0x2'));var rp=require(_0x2c96('0x3'));var fs=require('fs');var path=require(_0x2c96('0x4'));var rimraf=require(_0x2c96('0x5'));var config=require(_0x2c96('0x6'));var attributes=require(_0x2c96('0x7'));module[_0x2c96('0x8')]=function(_0x599a47,_0x1b7ca9){return _0x599a47[_0x2c96('0x9')](_0x2c96('0xa'),attributes,{'tableName':_0x2c96('0xb'),'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 8a7f46e..74a7e30 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 _0x057e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xff780c,_0x3c94eb){var _0x1f0861=function(_0x390e26){while(--_0x390e26){_0xff780c['push'](_0xff780c['shift']());}};_0x1f0861(++_0x3c94eb);}(_0x057e,0x1d7));var _0xe057=function(_0x2561fe,_0x4be484){_0x2561fe=_0x2561fe-0x0;var _0x588df5=_0x057e[_0x2561fe];return _0x588df5;};'use strict';var _=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var moment=require(_0xe057('0x2'));var BPromise=require(_0xe057('0x3'));var rs=require(_0xe057('0x4'));var fs=require('fs');var Redis=require(_0xe057('0x5'));var db=require(_0xe057('0x6'))['db'];var utils=require(_0xe057('0x7'));var logger=require(_0xe057('0x8'))(_0xe057('0x9'));var config=require(_0xe057('0xa'));var jayson=require(_0xe057('0xb'));var client=jayson[_0xe057('0xc')][_0xe057('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52d7b3,_0x1f444f,_0x33fe08){return new BPromise(function(_0x1557d7,_0x240ba8){return client[_0xe057('0xe')](_0x52d7b3,_0x33fe08)[_0xe057('0xf')](function(_0x2cb2ab){logger[_0xe057('0x10')](_0xe057('0x11'),_0x1f444f,_0xe057('0x12'));logger[_0xe057('0x13')](_0xe057('0x14'),_0x1f444f,_0xe057('0x12'),JSON[_0xe057('0x15')](_0x2cb2ab));if(_0x2cb2ab[_0xe057('0x16')]){if(_0x2cb2ab[_0xe057('0x16')]['code']===0x1f4){logger['error'](_0xe057('0x11'),_0x1f444f,_0x2cb2ab['error'][_0xe057('0x17')]);return _0x240ba8(_0x2cb2ab[_0xe057('0x16')][_0xe057('0x17')]);}logger[_0xe057('0x16')](_0xe057('0x11'),_0x1f444f,_0x2cb2ab[_0xe057('0x16')][_0xe057('0x17')]);return _0x1557d7(_0x2cb2ab[_0xe057('0x16')]['message']);}else{logger[_0xe057('0x10')](_0xe057('0x11'),_0x1f444f,_0xe057('0x12'));_0x1557d7(_0x2cb2ab[_0xe057('0x18')]['message']);}})[_0xe057('0x19')](function(_0x145327){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x1f444f,_0x145327);_0x240ba8(_0x145327);});});} \ No newline at end of file +var _0x3917=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x3917,0x195));var _0x7391=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x3917[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require('lodash');var util=require(_0x7391('0x0'));var moment=require(_0x7391('0x1'));var BPromise=require(_0x7391('0x2'));var rs=require(_0x7391('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7391('0x4'));var logger=require(_0x7391('0x5'))(_0x7391('0x6'));var config=require(_0x7391('0x7'));var jayson=require(_0x7391('0x8'));var client=jayson[_0x7391('0x9')][_0x7391('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xadcdbc,_0x5ec1fe,_0x3e68ac){return new BPromise(function(_0x22ffe8,_0x110885){return client[_0x7391('0xb')](_0xadcdbc,_0x3e68ac)[_0x7391('0xc')](function(_0x5e96d0){logger[_0x7391('0xd')](_0x7391('0xe'),_0x5ec1fe,_0x7391('0xf'));logger[_0x7391('0x10')](_0x7391('0x11'),_0x5ec1fe,_0x7391('0xf'),JSON[_0x7391('0x12')](_0x5e96d0));if(_0x5e96d0[_0x7391('0x13')]){if(_0x5e96d0['error'][_0x7391('0x14')]===0x1f4){logger[_0x7391('0x13')](_0x7391('0xe'),_0x5ec1fe,_0x5e96d0['error']['message']);return _0x110885(_0x5e96d0[_0x7391('0x13')][_0x7391('0x15')]);}logger[_0x7391('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x5ec1fe,_0x5e96d0[_0x7391('0x13')][_0x7391('0x15')]);return _0x22ffe8(_0x5e96d0[_0x7391('0x13')]['message']);}else{logger['info'](_0x7391('0xe'),_0x5ec1fe,'request\x20sent');_0x22ffe8(_0x5e96d0['result']['message']);}})[_0x7391('0x16')](function(_0x38925c){logger[_0x7391('0x13')](_0x7391('0xe'),_0x5ec1fe,_0x38925c);_0x110885(_0x38925c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 34982fc..0c7891c 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 _0x9589=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x9589,0xbc));var _0x9958=function(_0x18b2ad,_0x4c59f9){_0x18b2ad=_0x18b2ad-0x0;var _0x4c93e6=_0x9589[_0x18b2ad];return _0x4c93e6;};'use strict';var multer=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var path=require(_0x9958('0x2'));var timeout=require(_0x9958('0x3'));var express=require(_0x9958('0x4'));var router=express['Router']();var fs_extra=require(_0x9958('0x5'));var auth=require(_0x9958('0x6'));var interaction=require(_0x9958('0x7'));var config=require('../../config/environment');var controller=require(_0x9958('0x8'));router[_0x9958('0x9')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0xb')]);router[_0x9958('0x9')](_0x9958('0xc'),auth['isAuthenticated'](),controller[_0x9958('0xd')]);router[_0x9958('0xe')]('/',auth[_0x9958('0xa')](),controller[_0x9958('0xf')]);router[_0x9958('0x10')](_0x9958('0xc'),auth[_0x9958('0xa')](),controller[_0x9958('0x11')]);router[_0x9958('0x12')](_0x9958('0xc'),auth[_0x9958('0xa')](),controller[_0x9958('0x13')]);module[_0x9958('0x14')]=router; \ No newline at end of file +var _0x5c1f=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','update','delete','destroy'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x5c1f[_0x6173fc];return _0x965fbe;};'use strict';var multer=require(_0xf5c1('0x0'));var util=require('util');var path=require(_0xf5c1('0x1'));var timeout=require(_0xf5c1('0x2'));var express=require('express');var router=express[_0xf5c1('0x3')]();var fs_extra=require(_0xf5c1('0x4'));var auth=require(_0xf5c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xf5c1('0x6')]('/',auth[_0xf5c1('0x7')](),controller['index']);router[_0xf5c1('0x6')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xa')]);router[_0xf5c1('0xb')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xc')]);module[_0xf5c1('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 3d74e88..37b5749 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 _0x5994=['sequelize','exports'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x5994,0x98));var _0x4599=function(_0x4d0dad,_0xd4c84b){_0x4d0dad=_0x4d0dad-0x0;var _0x1f9b31=_0x5994[_0x4d0dad];return _0x1f9b31;};'use strict';var Sequelize=require(_0x4599('0x0'));module[_0x4599('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xcd3c=['sequelize','exports','TEXT'];(function(_0xf14888,_0x3302de){var _0x212e85=function(_0x162e54){while(--_0x162e54){_0xf14888['push'](_0xf14888['shift']());}};_0x212e85(++_0x3302de);}(_0xcd3c,0xd8));var _0xccd3=function(_0x49ea95,_0x50929a){_0x49ea95=_0x49ea95-0x0;var _0x2ac39d=_0xcd3c[_0x49ea95];return _0x2ac39d;};'use strict';var Sequelize=require(_0xccd3('0x0'));module[_0xccd3('0x1')]={'tree':{'type':Sequelize[_0xccd3('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 897411c..e2e52cf 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 _0x7576=['length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','destroy','then','sendStatus','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x7576,0x191));var _0x6757=function(_0x5c6e79,_0x3db9d2){_0x5c6e79=_0x5c6e79-0x0;var _0x1d706f=_0x7576[_0x5c6e79];return _0x1d706f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6757('0x0'));var zipdir=require(_0x6757('0x1'));var jsonpatch=require(_0x6757('0x2'));var rp=require(_0x6757('0x3'));var moment=require(_0x6757('0x4'));var BPromise=require(_0x6757('0x5'));var Mustache=require(_0x6757('0x6'));var util=require('util');var path=require(_0x6757('0x7'));var sox=require(_0x6757('0x8'));var csv=require(_0x6757('0x9'));var ejs=require(_0x6757('0xa'));var fs=require('fs');var fs_extra=require(_0x6757('0xb'));var _=require('lodash');var squel=require(_0x6757('0xc'));var crypto=require(_0x6757('0xd'));var jsforce=require(_0x6757('0xe'));var deskjs=require(_0x6757('0xf'));var toCsv=require(_0x6757('0x9'));var querystring=require(_0x6757('0x10'));var Papa=require(_0x6757('0x11'));var Redis=require(_0x6757('0x12'));var authService=require(_0x6757('0x13'));var qs=require(_0x6757('0x14'));var as=require(_0x6757('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6757('0x16'))(_0x6757('0x17'));var utils=require(_0x6757('0x18'));var config=require(_0x6757('0x19'));var licenseUtil=require(_0x6757('0x1a'));var db=require(_0x6757('0x1b'))['db'];function respondWithStatusCode(_0x2a3119,_0x318f0f){_0x318f0f=_0x318f0f||0xcc;return function(_0x200c38){if(_0x200c38){return _0x2a3119['sendStatus'](_0x318f0f);}return _0x2a3119[_0x6757('0x1c')](_0x318f0f)[_0x6757('0x1d')]();};}function respondWithResult(_0xb83ad6,_0x31e687){_0x31e687=_0x31e687||0xc8;return function(_0x3ba342){if(_0x3ba342){return _0xb83ad6[_0x6757('0x1c')](_0x31e687)[_0x6757('0x1e')](_0x3ba342);}};}function respondWithFilteredResult(_0x5c1843,_0x432ddb){return function(_0x28679e){if(_0x28679e){var _0x5ee372=typeof _0x432ddb['offset']==='undefined'&&typeof _0x432ddb['limit']==='undefined';var _0x503855=_0x28679e[_0x6757('0x1f')];var _0x1c8bac=_0x5ee372?0x0:_0x432ddb[_0x6757('0x20')];var _0x30382f=_0x5ee372?_0x28679e[_0x6757('0x1f')]:_0x432ddb[_0x6757('0x20')]+_0x432ddb[_0x6757('0x21')];var _0x5c8407;if(_0x30382f>=_0x503855){_0x30382f=_0x503855;_0x5c8407=0xc8;}else{_0x5c8407=0xce;}_0x5c1843[_0x6757('0x1c')](_0x5c8407);return _0x5c1843[_0x6757('0x22')](_0x6757('0x23'),_0x1c8bac+'-'+_0x30382f+'/'+_0x503855)[_0x6757('0x1e')](_0x28679e);}return null;};}function patchUpdates(_0x6f1cc1){return function(_0x388d4e){try{jsonpatch['apply'](_0x388d4e,_0x6f1cc1,!![]);}catch(_0x522e94){return BPromise['reject'](_0x522e94);}return _0x388d4e[_0x6757('0x24')]();};}function saveUpdates(_0x33c693,_0x5a0e78){return function(_0x87078b){if(_0x87078b){return _0x87078b['update'](_0x33c693)['then'](function(_0x21343f){return _0x21343f;});}return null;};}function removeEntity(_0x1cb037,_0x5c1458){return function(_0xc92f5c){if(_0xc92f5c){return _0xc92f5c[_0x6757('0x25')]()[_0x6757('0x26')](function(){_0x1cb037[_0x6757('0x1c')](0xcc)[_0x6757('0x1d')]();});}};}function handleEntityNotFound(_0x2023d7,_0x530075){return function(_0x3db70f){if(!_0x3db70f){_0x2023d7[_0x6757('0x27')](0x194);}return _0x3db70f;};}function handleError(_0x330272,_0x2542b1){_0x2542b1=_0x2542b1||0x1f4;return function(_0x425455){logger[_0x6757('0x28')](_0x425455['stack']);if(_0x425455[_0x6757('0x29')]){delete _0x425455[_0x6757('0x29')];}_0x330272['status'](_0x2542b1)[_0x6757('0x2a')](_0x425455);};}exports[_0x6757('0x2b')]=function(_0x523e92,_0x5db54f){var _0x3eec8a={},_0xc188c6={},_0xbefdcb={'count':0x0,'rows':[]};var _0x371cd8=_[_0x6757('0x2c')](db[_0x6757('0x2d')][_0x6757('0x2e')],function(_0x2c6488){return{'name':_0x2c6488[_0x6757('0x2f')],'type':_0x2c6488[_0x6757('0x30')]['key']};});_0xc188c6[_0x6757('0x31')]=_['map'](_0x371cd8,_0x6757('0x29'));_0xc188c6['query']=_[_0x6757('0x32')](_0x523e92[_0x6757('0x33')]);_0xc188c6[_0x6757('0x34')]=_['intersection'](_0xc188c6[_0x6757('0x31')],_0xc188c6['query']);_0x3eec8a[_0x6757('0x35')]=_['intersection'](_0xc188c6[_0x6757('0x31')],qs[_0x6757('0x36')](_0x523e92[_0x6757('0x33')][_0x6757('0x36')]));_0x3eec8a[_0x6757('0x35')]=_0x3eec8a[_0x6757('0x35')][_0x6757('0x37')]?_0x3eec8a[_0x6757('0x35')]:_0xc188c6['model'];if(!_0x523e92[_0x6757('0x33')][_0x6757('0x38')](_0x6757('0x39'))){_0x3eec8a[_0x6757('0x21')]=qs[_0x6757('0x21')](_0x523e92[_0x6757('0x33')]['limit']);_0x3eec8a['offset']=qs[_0x6757('0x20')](_0x523e92['query'][_0x6757('0x20')]);}_0x3eec8a['order']=qs[_0x6757('0x3a')](_0x523e92[_0x6757('0x33')]['sort']);_0x3eec8a['where']=qs[_0x6757('0x34')](_[_0x6757('0x3b')](_0x523e92['query'],_0xc188c6[_0x6757('0x34')]),_0x371cd8);if(_0x523e92['query'][_0x6757('0x3c')]){_0x3eec8a['where']=_[_0x6757('0x3d')](_0x3eec8a[_0x6757('0x3e')],{'$or':_[_0x6757('0x2c')](_0x371cd8,function(_0x5b849c){if(_0x5b849c['type']!=='VIRTUAL'){var _0x5d96c3={};_0x5d96c3[_0x5b849c['name']]={'$like':'%'+_0x523e92[_0x6757('0x33')][_0x6757('0x3c')]+'%'};return _0x5d96c3;}})});}_0x3eec8a=_[_0x6757('0x3d')]({},_0x3eec8a,_0x523e92[_0x6757('0x3f')]);var _0x322440={'where':_0x3eec8a['where']};return db[_0x6757('0x2d')][_0x6757('0x1f')](_0x322440)[_0x6757('0x26')](function(_0x1306a6){_0xbefdcb[_0x6757('0x1f')]=_0x1306a6;if(_0x523e92[_0x6757('0x33')][_0x6757('0x40')]){_0x3eec8a['include']=[{'all':!![]}];}return db[_0x6757('0x2d')][_0x6757('0x41')](_0x3eec8a);})[_0x6757('0x26')](function(_0x3d066f){_0xbefdcb[_0x6757('0x42')]=_0x3d066f;return _0xbefdcb;})['then'](respondWithFilteredResult(_0x5db54f,_0x3eec8a))[_0x6757('0x43')](handleError(_0x5db54f,null));};exports[_0x6757('0x44')]=function(_0x382dc5,_0x191963){var _0x3d3b32={'raw':!![],'where':{'id':_0x382dc5[_0x6757('0x45')]['id']}},_0xa44805={};_0xa44805['model']=_['keys'](db[_0x6757('0x2d')]['rawAttributes']);_0xa44805[_0x6757('0x33')]=_[_0x6757('0x32')](_0x382dc5[_0x6757('0x33')]);_0xa44805[_0x6757('0x34')]=_[_0x6757('0x46')](_0xa44805[_0x6757('0x31')],_0xa44805['query']);_0x3d3b32[_0x6757('0x35')]=_[_0x6757('0x46')](_0xa44805[_0x6757('0x31')],qs['fields'](_0x382dc5['query']['fields']));_0x3d3b32[_0x6757('0x35')]=_0x3d3b32['attributes'][_0x6757('0x37')]?_0x3d3b32['attributes']:_0xa44805[_0x6757('0x31')];if(_0x382dc5[_0x6757('0x33')]['includeAll']){_0x3d3b32[_0x6757('0x47')]=[{'all':!![]}];}_0x3d3b32=_[_0x6757('0x3d')]({},_0x3d3b32,_0x382dc5[_0x6757('0x3f')]);return db[_0x6757('0x2d')][_0x6757('0x48')](_0x3d3b32)['then'](handleEntityNotFound(_0x191963,null))[_0x6757('0x26')](respondWithResult(_0x191963,null))[_0x6757('0x43')](handleError(_0x191963,null));};exports['create']=function(_0x53e320,_0x5531a7){return db[_0x6757('0x2d')][_0x6757('0x49')](_0x53e320[_0x6757('0x4a')],{})[_0x6757('0x26')](respondWithResult(_0x5531a7,0xc9))[_0x6757('0x43')](handleError(_0x5531a7,null));};exports[_0x6757('0x4b')]=function(_0x3da9c2,_0x4a72ca){if(_0x3da9c2[_0x6757('0x4a')]['id']){delete _0x3da9c2['body']['id'];}return db[_0x6757('0x2d')][_0x6757('0x48')]({'where':{'id':_0x3da9c2['params']['id']}})[_0x6757('0x26')](handleEntityNotFound(_0x4a72ca,null))[_0x6757('0x26')](saveUpdates(_0x3da9c2[_0x6757('0x4a')],null))['then'](respondWithResult(_0x4a72ca,null))[_0x6757('0x43')](handleError(_0x4a72ca,null));};exports[_0x6757('0x25')]=function(_0x1c6d95,_0x98ce0a){return db['AnalyticTreeReport']['find']({'where':{'id':_0x1c6d95['params']['id']}})[_0x6757('0x26')](handleEntityNotFound(_0x98ce0a,null))['then'](removeEntity(_0x98ce0a,null))['catch'](handleError(_0x98ce0a,null));}; \ No newline at end of file +var _0xf21f=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','keys','includeAll','find','catch','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x470469,_0x37e292){var _0x1bdbfc=function(_0x303886){while(--_0x303886){_0x470469['push'](_0x470469['shift']());}};_0x1bdbfc(++_0x37e292);}(_0xf21f,0x197));var _0xff21=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0xf21f[_0x11314c];return _0x12cb4a;};'use strict';var emlformat=require(_0xff21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff21('0x1'));var jsonpatch=require(_0xff21('0x2'));var rp=require(_0xff21('0x3'));var moment=require(_0xff21('0x4'));var BPromise=require(_0xff21('0x5'));var Mustache=require(_0xff21('0x6'));var util=require('util');var path=require(_0xff21('0x7'));var sox=require('sox');var csv=require(_0xff21('0x8'));var ejs=require(_0xff21('0x9'));var fs=require('fs');var fs_extra=require(_0xff21('0xa'));var _=require(_0xff21('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xff21('0xc'));var deskjs=require(_0xff21('0xd'));var toCsv=require(_0xff21('0x8'));var querystring=require(_0xff21('0xe'));var Papa=require(_0xff21('0xf'));var Redis=require(_0xff21('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff21('0x11'));var as=require(_0xff21('0x12'));var hardwareService=require(_0xff21('0x13'));var logger=require(_0xff21('0x14'))(_0xff21('0x15'));var utils=require('../../config/utils');var config=require(_0xff21('0x16'));var licenseUtil=require(_0xff21('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e1dc,_0x30071f){_0x30071f=_0x30071f||0xcc;return function(_0x4eec2b){if(_0x4eec2b){return _0x16e1dc['sendStatus'](_0x30071f);}return _0x16e1dc[_0xff21('0x18')](_0x30071f)[_0xff21('0x19')]();};}function respondWithResult(_0x29bd3a,_0x384d4a){_0x384d4a=_0x384d4a||0xc8;return function(_0x25c938){if(_0x25c938){return _0x29bd3a[_0xff21('0x18')](_0x384d4a)[_0xff21('0x1a')](_0x25c938);}};}function respondWithFilteredResult(_0x4eb224,_0x2fdf54){return function(_0xe3fc24){if(_0xe3fc24){var _0x1b55bb=typeof _0x2fdf54[_0xff21('0x1b')]===_0xff21('0x1c')&&typeof _0x2fdf54['limit']===_0xff21('0x1c');var _0x1154f0=_0xe3fc24['count'];var _0x3f85d6=_0x1b55bb?0x0:_0x2fdf54['offset'];var _0x467273=_0x1b55bb?_0xe3fc24[_0xff21('0x1d')]:_0x2fdf54[_0xff21('0x1b')]+_0x2fdf54[_0xff21('0x1e')];var _0x1963f3;if(_0x467273>=_0x1154f0){_0x467273=_0x1154f0;_0x1963f3=0xc8;}else{_0x1963f3=0xce;}_0x4eb224['status'](_0x1963f3);return _0x4eb224[_0xff21('0x1f')](_0xff21('0x20'),_0x3f85d6+'-'+_0x467273+'/'+_0x1154f0)['json'](_0xe3fc24);}return null;};}function patchUpdates(_0xc06558){return function(_0xdf75ed){try{jsonpatch['apply'](_0xdf75ed,_0xc06558,!![]);}catch(_0x561b16){return BPromise[_0xff21('0x21')](_0x561b16);}return _0xdf75ed['save']();};}function saveUpdates(_0x41a845,_0x3b8713){return function(_0x2bff53){if(_0x2bff53){return _0x2bff53['update'](_0x41a845)[_0xff21('0x22')](function(_0x222bf4){return _0x222bf4;});}return null;};}function removeEntity(_0x462002,_0x3d2c04){return function(_0x2739ff){if(_0x2739ff){return _0x2739ff[_0xff21('0x23')]()['then'](function(){_0x462002[_0xff21('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac5f4,_0x32bceb){return function(_0x43b558){if(!_0x43b558){_0x1ac5f4[_0xff21('0x24')](0x194);}return _0x43b558;};}function handleError(_0x1bf7cf,_0x28d2a9){_0x28d2a9=_0x28d2a9||0x1f4;return function(_0x4c844b){logger[_0xff21('0x25')](_0x4c844b[_0xff21('0x26')]);if(_0x4c844b['name']){delete _0x4c844b[_0xff21('0x27')];}_0x1bf7cf['status'](_0x28d2a9)['send'](_0x4c844b);};}exports[_0xff21('0x28')]=function(_0x4e7108,_0x1c96e2){var _0x3a63d4={},_0x124c2a={},_0x5d62e1={'count':0x0,'rows':[]};var _0x3aebb=_[_0xff21('0x29')](db[_0xff21('0x2a')][_0xff21('0x2b')],function(_0x14d5b4){return{'name':_0x14d5b4[_0xff21('0x2c')],'type':_0x14d5b4[_0xff21('0x2d')][_0xff21('0x2e')]};});_0x124c2a[_0xff21('0x2f')]=_['map'](_0x3aebb,_0xff21('0x27'));_0x124c2a[_0xff21('0x30')]=_['keys'](_0x4e7108[_0xff21('0x30')]);_0x124c2a[_0xff21('0x31')]=_['intersection'](_0x124c2a['model'],_0x124c2a[_0xff21('0x30')]);_0x3a63d4[_0xff21('0x32')]=_[_0xff21('0x33')](_0x124c2a['model'],qs['fields'](_0x4e7108['query'][_0xff21('0x34')]));_0x3a63d4['attributes']=_0x3a63d4[_0xff21('0x32')][_0xff21('0x35')]?_0x3a63d4[_0xff21('0x32')]:_0x124c2a[_0xff21('0x2f')];if(!_0x4e7108[_0xff21('0x30')]['hasOwnProperty'](_0xff21('0x36'))){_0x3a63d4[_0xff21('0x1e')]=qs[_0xff21('0x1e')](_0x4e7108['query']['limit']);_0x3a63d4['offset']=qs[_0xff21('0x1b')](_0x4e7108[_0xff21('0x30')]['offset']);}_0x3a63d4['order']=qs[_0xff21('0x37')](_0x4e7108[_0xff21('0x30')][_0xff21('0x37')]);_0x3a63d4['where']=qs['filters'](_['pick'](_0x4e7108['query'],_0x124c2a['filters']),_0x3aebb);if(_0x4e7108['query'][_0xff21('0x38')]){_0x3a63d4[_0xff21('0x39')]=_[_0xff21('0x3a')](_0x3a63d4['where'],{'$or':_[_0xff21('0x29')](_0x3aebb,function(_0x218e9b){if(_0x218e9b[_0xff21('0x2d')]!==_0xff21('0x3b')){var _0x276d34={};_0x276d34[_0x218e9b[_0xff21('0x27')]]={'$like':'%'+_0x4e7108[_0xff21('0x30')][_0xff21('0x38')]+'%'};return _0x276d34;}})});}_0x3a63d4=_[_0xff21('0x3a')]({},_0x3a63d4,_0x4e7108[_0xff21('0x3c')]);var _0x4d0eb9={'where':_0x3a63d4[_0xff21('0x39')]};return db[_0xff21('0x2a')]['count'](_0x4d0eb9)[_0xff21('0x22')](function(_0x10c3c6){_0x5d62e1[_0xff21('0x1d')]=_0x10c3c6;if(_0x4e7108[_0xff21('0x30')]['includeAll']){_0x3a63d4[_0xff21('0x3d')]=[{'all':!![]}];}return db[_0xff21('0x2a')][_0xff21('0x3e')](_0x3a63d4);})[_0xff21('0x22')](function(_0x3c7d1c){_0x5d62e1['rows']=_0x3c7d1c;return _0x5d62e1;})[_0xff21('0x22')](respondWithFilteredResult(_0x1c96e2,_0x3a63d4))['catch'](handleError(_0x1c96e2,null));};exports['show']=function(_0x28ac93,_0x2bfbf7){var _0x230d39={'raw':!![],'where':{'id':_0x28ac93['params']['id']}},_0x304715={};_0x304715[_0xff21('0x2f')]=_['keys'](db[_0xff21('0x2a')][_0xff21('0x2b')]);_0x304715['query']=_[_0xff21('0x3f')](_0x28ac93['query']);_0x304715[_0xff21('0x31')]=_[_0xff21('0x33')](_0x304715[_0xff21('0x2f')],_0x304715[_0xff21('0x30')]);_0x230d39[_0xff21('0x32')]=_[_0xff21('0x33')](_0x304715[_0xff21('0x2f')],qs['fields'](_0x28ac93[_0xff21('0x30')][_0xff21('0x34')]));_0x230d39[_0xff21('0x32')]=_0x230d39[_0xff21('0x32')][_0xff21('0x35')]?_0x230d39[_0xff21('0x32')]:_0x304715['model'];if(_0x28ac93['query'][_0xff21('0x40')]){_0x230d39[_0xff21('0x3d')]=[{'all':!![]}];}_0x230d39=_[_0xff21('0x3a')]({},_0x230d39,_0x28ac93['options']);return db['AnalyticTreeReport'][_0xff21('0x41')](_0x230d39)[_0xff21('0x22')](handleEntityNotFound(_0x2bfbf7,null))['then'](respondWithResult(_0x2bfbf7,null))[_0xff21('0x42')](handleError(_0x2bfbf7,null));};exports[_0xff21('0x43')]=function(_0xc1b652,_0xdb1975){return db[_0xff21('0x2a')][_0xff21('0x43')](_0xc1b652[_0xff21('0x44')],{})[_0xff21('0x22')](respondWithResult(_0xdb1975,0xc9))[_0xff21('0x42')](handleError(_0xdb1975,null));};exports[_0xff21('0x45')]=function(_0x511b45,_0x51a5c8){if(_0x511b45['body']['id']){delete _0x511b45[_0xff21('0x44')]['id'];}return db[_0xff21('0x2a')][_0xff21('0x41')]({'where':{'id':_0x511b45[_0xff21('0x46')]['id']}})[_0xff21('0x22')](handleEntityNotFound(_0x51a5c8,null))[_0xff21('0x22')](saveUpdates(_0x511b45[_0xff21('0x44')],null))[_0xff21('0x22')](respondWithResult(_0x51a5c8,null))[_0xff21('0x42')](handleError(_0x51a5c8,null));};exports['destroy']=function(_0x98db40,_0x11236a){return db[_0xff21('0x2a')][_0xff21('0x41')]({'where':{'id':_0x98db40['params']['id']}})['then'](handleEntityNotFound(_0x11236a,null))[_0xff21('0x22')](removeEntity(_0x11236a,null))['catch'](handleError(_0x11236a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 6e26b09..bf017cd 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 _0xbf58=['request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','api','moment'];(function(_0x11317c,_0x455735){var _0x5e1319=function(_0x3d8d1e){while(--_0x3d8d1e){_0x11317c['push'](_0x11317c['shift']());}};_0x5e1319(++_0x455735);}(_0xbf58,0x133));var _0x8bf5=function(_0x19c2f6,_0x55d9a6){_0x19c2f6=_0x19c2f6-0x0;var _0x3672d2=_0xbf58[_0x19c2f6];return _0x3672d2;};'use strict';var _=require(_0x8bf5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8bf5('0x1'));var moment=require(_0x8bf5('0x2'));var BPromise=require('bluebird');var rp=require(_0x8bf5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bf5('0x4'));var config=require(_0x8bf5('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x8bf5('0x6')]=function(_0x153778,_0x12477c){return _0x153778[_0x8bf5('0x7')](_0x8bf5('0x8'),attributes,{'tableName':_0x8bf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x612e=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x41f96e,_0x333851){var _0x48a4ac=function(_0xdad934){while(--_0xdad934){_0x41f96e['push'](_0x41f96e['shift']());}};_0x48a4ac(++_0x333851);}(_0x612e,0x1f2));var _0xe612=function(_0x451d92,_0x281437){_0x451d92=_0x451d92-0x0;var _0x3085b7=_0x612e[_0x451d92];return _0x3085b7;};'use strict';var _=require(_0xe612('0x0'));var util=require(_0xe612('0x1'));var logger=require(_0xe612('0x2'))(_0xe612('0x3'));var moment=require(_0xe612('0x4'));var BPromise=require(_0xe612('0x5'));var rp=require(_0xe612('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe612('0x7'));var config=require(_0xe612('0x8'));var attributes=require(_0xe612('0x9'));module[_0xe612('0xa')]=function(_0x89b3eb,_0x39f50f){return _0x89b3eb[_0xe612('0xb')](_0xe612('0xc'),attributes,{'tableName':_0xe612('0xd'),'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 2cb07b4..b8a722b 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x339e13,_0x33161e){var _0x4cec23=function(_0x513ba9){while(--_0x513ba9){_0x339e13['push'](_0x339e13['shift']());}};_0x4cec23(++_0x33161e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x12025e,_0x143cb2){var _0x11e659=function(_0x513cce){while(--_0x513cce){_0x12025e['push'](_0x12025e['shift']());}};_0x11e659(++_0x143cb2);}(_0x1261,0x144));var _0x1126=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0x1261[_0x114c53];return _0x4e0c14;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 454dbdb..8561731 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 _0xccd4=['get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller'];(function(_0x2616de,_0x56dab8){var _0x19f21a=function(_0x328ecc){while(--_0x328ecc){_0x2616de['push'](_0x2616de['shift']());}};_0x19f21a(++_0x56dab8);}(_0xccd4,0xd0));var _0x4ccd=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xccd4[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x4ccd('0x0'));var util=require(_0x4ccd('0x1'));var path=require('path');var timeout=require(_0x4ccd('0x2'));var express=require(_0x4ccd('0x3'));var router=express[_0x4ccd('0x4')]();var fs_extra=require(_0x4ccd('0x5'));var auth=require(_0x4ccd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ccd('0x7'));router[_0x4ccd('0x8')]('/',auth[_0x4ccd('0x9')](),controller['index']);router[_0x4ccd('0x8')](_0x4ccd('0xa'),auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xb')]);router[_0x4ccd('0xc')]('/',auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xd')]);router[_0x4ccd('0xe')]('/:id',auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xf')]);router[_0x4ccd('0x10')](_0x4ccd('0xa'),auth[_0x4ccd('0x9')](),controller['destroy']);module[_0x4ccd('0x11')]=router; \ No newline at end of file +var _0x0b3c=['../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x8f7472,_0x3049d9){var _0x119044=function(_0x5aa580){while(--_0x5aa580){_0x8f7472['push'](_0x8f7472['shift']());}};_0x119044(++_0x3049d9);}(_0x0b3c,0xdb));var _0xc0b3=function(_0x334d06,_0x35d6f5){_0x334d06=_0x334d06-0x0;var _0xce23fe=_0x0b3c[_0x334d06];return _0xce23fe;};'use strict';var multer=require(_0xc0b3('0x0'));var util=require('util');var path=require(_0xc0b3('0x1'));var timeout=require(_0xc0b3('0x2'));var express=require(_0xc0b3('0x3'));var router=express[_0xc0b3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0b3('0x5'));var config=require('../../config/environment');var controller=require(_0xc0b3('0x6'));router[_0xc0b3('0x7')]('/',auth[_0xc0b3('0x8')](),controller['index']);router[_0xc0b3('0x7')](_0xc0b3('0x9'),auth[_0xc0b3('0x8')](),controller[_0xc0b3('0xa')]);router[_0xc0b3('0xb')]('/',auth[_0xc0b3('0x8')](),controller[_0xc0b3('0xc')]);router[_0xc0b3('0xd')](_0xc0b3('0x9'),auth[_0xc0b3('0x8')](),controller['update']);router[_0xc0b3('0xe')](_0xc0b3('0x9'),auth[_0xc0b3('0x8')](),controller['destroy']);module[_0xc0b3('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 6a304a2..ad650de 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 _0xfd2f=['sequelize','exports','STRING'];(function(_0x570794,_0x1e7aca){var _0x513a97=function(_0x4cbb10){while(--_0x4cbb10){_0x570794['push'](_0x570794['shift']());}};_0x513a97(++_0x1e7aca);}(_0xfd2f,0x14a));var _0xffd2=function(_0x3852eb,_0xfe973a){_0x3852eb=_0x3852eb-0x0;var _0x391889=_0xfd2f[_0x3852eb];return _0x391889;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'name':{'type':Sequelize[_0xffd2('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffd2('0x2')]}}; \ No newline at end of file +var _0xcabc=['exports','STRING'];(function(_0x5350ec,_0x316fd1){var _0x47da97=function(_0x213cae){while(--_0x213cae){_0x5350ec['push'](_0x5350ec['shift']());}};_0x47da97(++_0x316fd1);}(_0xcabc,0x16a));var _0xccab=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcabc[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0xccab('0x0')]={'name':{'type':Sequelize[_0xccab('0x1')]},'basename':{'type':Sequelize[_0xccab('0x1')]},'type':{'type':Sequelize[_0xccab('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 22e64c5..1c0ca2d 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 _0xa120=['filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','Attachment','includeAll','include','findAll','rows','show','params','options','catch','clone','find','get','omit','updatedAt','body','createdAt','basename','filename','file','mimetype','create','download','findOne','server/files/attachments/','offline-chat/','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x29cd6a,_0x409b11){var _0x545b22=function(_0x2ef6eb){while(--_0x2ef6eb){_0x29cd6a['push'](_0x29cd6a['shift']());}};_0x545b22(++_0x409b11);}(_0xa120,0x193));var _0x0a12=function(_0x3508ad,_0x492b3a){_0x3508ad=_0x3508ad-0x0;var _0x293e54=_0xa120[_0x3508ad];return _0x293e54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a12('0x0'));var zipdir=require(_0x0a12('0x1'));var jsonpatch=require(_0x0a12('0x2'));var rp=require(_0x0a12('0x3'));var moment=require(_0x0a12('0x4'));var BPromise=require(_0x0a12('0x5'));var Mustache=require(_0x0a12('0x6'));var util=require(_0x0a12('0x7'));var path=require(_0x0a12('0x8'));var sox=require(_0x0a12('0x9'));var csv=require('to-csv');var ejs=require(_0x0a12('0xa'));var fs=require('fs');var fs_extra=require(_0x0a12('0xb'));var _=require('lodash');var squel=require(_0x0a12('0xc'));var crypto=require(_0x0a12('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a12('0xe'));var toCsv=require(_0x0a12('0xf'));var querystring=require('querystring');var Papa=require(_0x0a12('0x10'));var Redis=require(_0x0a12('0x11'));var authService=require(_0x0a12('0x12'));var qs=require(_0x0a12('0x13'));var as=require(_0x0a12('0x14'));var hardwareService=require(_0x0a12('0x15'));var logger=require(_0x0a12('0x16'))(_0x0a12('0x17'));var utils=require(_0x0a12('0x18'));var config=require(_0x0a12('0x19'));var licenseUtil=require(_0x0a12('0x1a'));var db=require(_0x0a12('0x1b'))['db'];function respondWithStatusCode(_0x5899e3,_0x299b0b){_0x299b0b=_0x299b0b||0xcc;return function(_0xa431d){if(_0xa431d){return _0x5899e3[_0x0a12('0x1c')](_0x299b0b);}return _0x5899e3['status'](_0x299b0b)['end']();};}function respondWithResult(_0x116633,_0x22224a){_0x22224a=_0x22224a||0xc8;return function(_0x360fb4){if(_0x360fb4){return _0x116633[_0x0a12('0x1d')](_0x22224a)[_0x0a12('0x1e')](_0x360fb4);}};}function respondWithFilteredResult(_0x35de58,_0x54b94b){return function(_0x2cd10e){if(_0x2cd10e){var _0x319cd6=typeof _0x54b94b[_0x0a12('0x1f')]==='undefined'&&typeof _0x54b94b['limit']==='undefined';var _0x31b9b8=_0x2cd10e[_0x0a12('0x20')];var _0x5d1067=_0x319cd6?0x0:_0x54b94b[_0x0a12('0x1f')];var _0x39199d=_0x319cd6?_0x2cd10e[_0x0a12('0x20')]:_0x54b94b[_0x0a12('0x1f')]+_0x54b94b[_0x0a12('0x21')];var _0x50b453;if(_0x39199d>=_0x31b9b8){_0x39199d=_0x31b9b8;_0x50b453=0xc8;}else{_0x50b453=0xce;}_0x35de58[_0x0a12('0x1d')](_0x50b453);return _0x35de58[_0x0a12('0x22')](_0x0a12('0x23'),_0x5d1067+'-'+_0x39199d+'/'+_0x31b9b8)[_0x0a12('0x1e')](_0x2cd10e);}return null;};}function patchUpdates(_0x1d26c6){return function(_0x5de6aa){try{jsonpatch['apply'](_0x5de6aa,_0x1d26c6,!![]);}catch(_0x5bc35c){return BPromise['reject'](_0x5bc35c);}return _0x5de6aa[_0x0a12('0x24')]();};}function saveUpdates(_0x59935d,_0xffa387){return function(_0x530e0){if(_0x530e0){return _0x530e0[_0x0a12('0x25')](_0x59935d)[_0x0a12('0x26')](function(_0x3e7cd5){return _0x3e7cd5;});}return null;};}function removeEntity(_0x55f40c,_0x23db3a){return function(_0x39f9cb){if(_0x39f9cb){return _0x39f9cb[_0x0a12('0x27')]()[_0x0a12('0x26')](function(){_0x55f40c[_0x0a12('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1cf,_0x34d88d){return function(_0x29812f){if(!_0x29812f){_0x5de1cf[_0x0a12('0x1c')](0x194);}return _0x29812f;};}function handleError(_0x2bd09d,_0x3221aa){_0x3221aa=_0x3221aa||0x1f4;return function(_0x49206b){logger[_0x0a12('0x28')](_0x49206b[_0x0a12('0x29')]);if(_0x49206b[_0x0a12('0x2a')]){delete _0x49206b[_0x0a12('0x2a')];}_0x2bd09d[_0x0a12('0x1d')](_0x3221aa)[_0x0a12('0x2b')](_0x49206b);};}exports[_0x0a12('0x2c')]=function(_0x7cd375,_0x4c10c7){var _0x5c65a0={},_0x1413b8={},_0x582f40={'count':0x0,'rows':[]};var _0xa90f17=_['map'](db['Attachment'][_0x0a12('0x2d')],function(_0x451aaf){return{'name':_0x451aaf[_0x0a12('0x2e')],'type':_0x451aaf[_0x0a12('0x2f')][_0x0a12('0x30')]};});_0x1413b8['model']=_[_0x0a12('0x31')](_0xa90f17,_0x0a12('0x2a'));_0x1413b8[_0x0a12('0x32')]=_[_0x0a12('0x33')](_0x7cd375[_0x0a12('0x32')]);_0x1413b8[_0x0a12('0x34')]=_[_0x0a12('0x35')](_0x1413b8[_0x0a12('0x36')],_0x1413b8[_0x0a12('0x32')]);_0x5c65a0[_0x0a12('0x37')]=_[_0x0a12('0x35')](_0x1413b8['model'],qs[_0x0a12('0x38')](_0x7cd375[_0x0a12('0x32')][_0x0a12('0x38')]));_0x5c65a0[_0x0a12('0x37')]=_0x5c65a0[_0x0a12('0x37')][_0x0a12('0x39')]?_0x5c65a0[_0x0a12('0x37')]:_0x1413b8['model'];if(!_0x7cd375[_0x0a12('0x32')]['hasOwnProperty'](_0x0a12('0x3a'))){_0x5c65a0[_0x0a12('0x21')]=qs[_0x0a12('0x21')](_0x7cd375[_0x0a12('0x32')]['limit']);_0x5c65a0[_0x0a12('0x1f')]=qs['offset'](_0x7cd375[_0x0a12('0x32')]['offset']);}_0x5c65a0['order']=qs[_0x0a12('0x3b')](_0x7cd375['query'][_0x0a12('0x3b')]);_0x5c65a0[_0x0a12('0x3c')]=qs[_0x0a12('0x34')](_[_0x0a12('0x3d')](_0x7cd375[_0x0a12('0x32')],_0x1413b8[_0x0a12('0x34')]),_0xa90f17);if(_0x7cd375['query'][_0x0a12('0x3e')]){_0x5c65a0['where']=_['merge'](_0x5c65a0['where'],{'$or':_[_0x0a12('0x31')](_0xa90f17,function(_0x3845b4){if(_0x3845b4['type']!==_0x0a12('0x3f')){var _0x59f4a5={};_0x59f4a5[_0x3845b4[_0x0a12('0x2a')]]={'$like':'%'+_0x7cd375[_0x0a12('0x32')][_0x0a12('0x3e')]+'%'};return _0x59f4a5;}})});}_0x5c65a0=_[_0x0a12('0x40')]({},_0x5c65a0,_0x7cd375['options']);var _0xc2a6ef={'where':_0x5c65a0[_0x0a12('0x3c')]};return db[_0x0a12('0x41')][_0x0a12('0x20')](_0xc2a6ef)['then'](function(_0x39cd69){_0x582f40['count']=_0x39cd69;if(_0x7cd375['query'][_0x0a12('0x42')]){_0x5c65a0[_0x0a12('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x0a12('0x44')](_0x5c65a0);})['then'](function(_0x28a49b){_0x582f40[_0x0a12('0x45')]=_0x28a49b;return _0x582f40;})[_0x0a12('0x26')](respondWithFilteredResult(_0x4c10c7,_0x5c65a0))['catch'](handleError(_0x4c10c7,null));};exports[_0x0a12('0x46')]=function(_0x186bec,_0x23c2ae){var _0x17c98d={'raw':!![],'where':{'id':_0x186bec[_0x0a12('0x47')]['id']}},_0x3a4cd5={};_0x3a4cd5[_0x0a12('0x36')]=_[_0x0a12('0x33')](db[_0x0a12('0x41')][_0x0a12('0x2d')]);_0x3a4cd5[_0x0a12('0x32')]=_['keys'](_0x186bec['query']);_0x3a4cd5['filters']=_[_0x0a12('0x35')](_0x3a4cd5[_0x0a12('0x36')],_0x3a4cd5[_0x0a12('0x32')]);_0x17c98d[_0x0a12('0x37')]=_[_0x0a12('0x35')](_0x3a4cd5['model'],qs[_0x0a12('0x38')](_0x186bec['query'][_0x0a12('0x38')]));_0x17c98d[_0x0a12('0x37')]=_0x17c98d[_0x0a12('0x37')][_0x0a12('0x39')]?_0x17c98d[_0x0a12('0x37')]:_0x3a4cd5[_0x0a12('0x36')];if(_0x186bec[_0x0a12('0x32')]['includeAll']){_0x17c98d['include']=[{'all':!![]}];}_0x17c98d=_['merge']({},_0x17c98d,_0x186bec[_0x0a12('0x48')]);return db['Attachment']['find'](_0x17c98d)[_0x0a12('0x26')](handleEntityNotFound(_0x23c2ae,null))[_0x0a12('0x26')](respondWithResult(_0x23c2ae,null))[_0x0a12('0x49')](handleError(_0x23c2ae,null));};exports[_0x0a12('0x4a')]=function(_0x5dca9a,_0x1c88e1){var _0x55cac9={'where':{'id':_0x5dca9a[_0x0a12('0x47')]['id']}},_0x20dce9={};_0x20dce9[_0x0a12('0x36')]=_[_0x0a12('0x33')](db[_0x0a12('0x41')][_0x0a12('0x2d')]);_0x55cac9[_0x0a12('0x37')]=_[_0x0a12('0x35')](_0x20dce9[_0x0a12('0x36')],qs[_0x0a12('0x38')](_0x5dca9a[_0x0a12('0x32')][_0x0a12('0x38')]));_0x55cac9[_0x0a12('0x37')]=_0x55cac9['attributes'][_0x0a12('0x39')]?_0x55cac9['attributes']:_0x20dce9[_0x0a12('0x36')];if(_0x5dca9a['query'][_0x0a12('0x42')]){_0x55cac9[_0x0a12('0x43')]=[{'all':!![]}];}_0x55cac9=_[_0x0a12('0x40')]({},_0x55cac9,_0x5dca9a[_0x0a12('0x48')]);return db[_0x0a12('0x41')][_0x0a12('0x4b')](_0x55cac9)[_0x0a12('0x26')](handleEntityNotFound(_0x1c88e1,null))[_0x0a12('0x26')](function(_0x1c4436){if(_0x1c4436){var _0xa5f7b3=_0x1c4436[_0x0a12('0x4c')]({'plain':!![]});_0xa5f7b3=qs[_0x0a12('0x4d')](_0xa5f7b3,['id','createdAt',_0x0a12('0x4e')]);_0x5dca9a[_0x0a12('0x4f')]=_[_0x0a12('0x4d')](_0x5dca9a['body'],['id',_0x0a12('0x50'),_0x0a12('0x4e')]);return db[_0x0a12('0x41')]['create'](_[_0x0a12('0x40')](_0xa5f7b3,_0x5dca9a[_0x0a12('0x4f')]),{'include':_0x5dca9a['query'][_0x0a12('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1c88e1,0xc9))[_0x0a12('0x49')](handleError(_0x1c88e1,null));};exports['update']=function(_0x218304,_0x20e548){if(_0x218304[_0x0a12('0x4f')]['id']){delete _0x218304[_0x0a12('0x4f')]['id'];}return db[_0x0a12('0x41')][_0x0a12('0x4b')]({'where':{'id':_0x218304['params']['id']}})[_0x0a12('0x26')](handleEntityNotFound(_0x20e548,null))[_0x0a12('0x26')](saveUpdates(_0x218304[_0x0a12('0x4f')],null))[_0x0a12('0x26')](respondWithResult(_0x20e548,null))[_0x0a12('0x49')](handleError(_0x20e548,null));};exports[_0x0a12('0x27')]=function(_0x25798c,_0x450d5b){return db[_0x0a12('0x41')][_0x0a12('0x4b')]({'where':{'id':_0x25798c[_0x0a12('0x47')]['id']}})[_0x0a12('0x26')](handleEntityNotFound(_0x450d5b,null))['then'](removeEntity(_0x450d5b,null))[_0x0a12('0x49')](handleError(_0x450d5b,null));};exports['create']=function(_0x5af499,_0x2721d5,_0x12e4e9){_0x5af499[_0x0a12('0x4f')][_0x0a12('0x2a')]=_0x5af499['file']['originalname'];_0x5af499['body'][_0x0a12('0x51')]=_0x5af499['file'][_0x0a12('0x52')];_0x5af499[_0x0a12('0x4f')][_0x0a12('0x2f')]=_0x5af499[_0x0a12('0x53')][_0x0a12('0x54')];return db[_0x0a12('0x41')][_0x0a12('0x55')](_0x5af499['body'])[_0x0a12('0x26')](respondWithResult(_0x2721d5,0xc9))['catch'](handleError(_0x2721d5,null));};exports[_0x0a12('0x56')]=function(_0x502502,_0x11cade,_0x36199e){return db[_0x0a12('0x41')][_0x0a12('0x57')]({'where':{'id':_0x502502[_0x0a12('0x47')]['id']},'raw':!![]})[_0x0a12('0x26')](handleEntityNotFound(_0x11cade,null))[_0x0a12('0x26')](function(_0x4cfaf1){if(_0x4cfaf1){var _0x436e98=_0x4cfaf1['ChatOfflineMessageId']!==null;var _0x5efd4c=path['join'](config['root'],_0x0a12('0x58'));if(_0x436e98){_0x5efd4c=path['join'](_0x5efd4c,_0x0a12('0x59'));}var _0x1f5bd7=path[_0x0a12('0x5a')](_0x5efd4c,_0x4cfaf1['basename']);return _0x11cade[_0x0a12('0x56')](_0x1f5bd7);}})[_0x0a12('0x49')](handleError(_0x11cade,null));}; \ No newline at end of file +var _0xf59e=['sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','Attachment','includeAll','findAll','rows','catch','show','params','include','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end'];(function(_0x2ca638,_0x71ac1a){var _0x4407c4=function(_0x558813){while(--_0x558813){_0x2ca638['push'](_0x2ca638['shift']());}};_0x4407c4(++_0x71ac1a);}(_0xf59e,0x1e5));var _0xef59=function(_0x2b741c,_0x23a61f){_0x2b741c=_0x2b741c-0x0;var _0x1cb1ba=_0xf59e[_0x2b741c];return _0x1cb1ba;};'use strict';var emlformat=require(_0xef59('0x0'));var rimraf=require(_0xef59('0x1'));var zipdir=require(_0xef59('0x2'));var jsonpatch=require(_0xef59('0x3'));var rp=require(_0xef59('0x4'));var moment=require('moment');var BPromise=require(_0xef59('0x5'));var Mustache=require('mustache');var util=require(_0xef59('0x6'));var path=require(_0xef59('0x7'));var sox=require('sox');var csv=require(_0xef59('0x8'));var ejs=require(_0xef59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef59('0xa'));var squel=require('squel');var crypto=require(_0xef59('0xb'));var jsforce=require(_0xef59('0xc'));var deskjs=require(_0xef59('0xd'));var toCsv=require(_0xef59('0x8'));var querystring=require(_0xef59('0xe'));var Papa=require('papaparse');var Redis=require(_0xef59('0xf'));var authService=require(_0xef59('0x10'));var qs=require(_0xef59('0x11'));var as=require(_0xef59('0x12'));var hardwareService=require(_0xef59('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xef59('0x14'));var licenseUtil=require(_0xef59('0x15'));var db=require(_0xef59('0x16'))['db'];function respondWithStatusCode(_0x479035,_0x247b56){_0x247b56=_0x247b56||0xcc;return function(_0x559cf8){if(_0x559cf8){return _0x479035['sendStatus'](_0x247b56);}return _0x479035[_0xef59('0x17')](_0x247b56)['end']();};}function respondWithResult(_0x2775c1,_0x272ec9){_0x272ec9=_0x272ec9||0xc8;return function(_0x30442d){if(_0x30442d){return _0x2775c1['status'](_0x272ec9)['json'](_0x30442d);}};}function respondWithFilteredResult(_0x3c2937,_0xca41bc){return function(_0x267632){if(_0x267632){var _0x9d6aaa=typeof _0xca41bc[_0xef59('0x18')]===_0xef59('0x19')&&typeof _0xca41bc[_0xef59('0x1a')]===_0xef59('0x19');var _0x49845a=_0x267632['count'];var _0x167a51=_0x9d6aaa?0x0:_0xca41bc[_0xef59('0x18')];var _0x10cf18=_0x9d6aaa?_0x267632[_0xef59('0x1b')]:_0xca41bc[_0xef59('0x18')]+_0xca41bc[_0xef59('0x1a')];var _0x599d27;if(_0x10cf18>=_0x49845a){_0x10cf18=_0x49845a;_0x599d27=0xc8;}else{_0x599d27=0xce;}_0x3c2937[_0xef59('0x17')](_0x599d27);return _0x3c2937[_0xef59('0x1c')](_0xef59('0x1d'),_0x167a51+'-'+_0x10cf18+'/'+_0x49845a)[_0xef59('0x1e')](_0x267632);}return null;};}function patchUpdates(_0x461b46){return function(_0x13e28a){try{jsonpatch[_0xef59('0x1f')](_0x13e28a,_0x461b46,!![]);}catch(_0x203f08){return BPromise['reject'](_0x203f08);}return _0x13e28a[_0xef59('0x20')]();};}function saveUpdates(_0x230ec3,_0xdfc747){return function(_0x59183b){if(_0x59183b){return _0x59183b[_0xef59('0x21')](_0x230ec3)[_0xef59('0x22')](function(_0x12b431){return _0x12b431;});}return null;};}function removeEntity(_0x446c02,_0x147f4a){return function(_0x165659){if(_0x165659){return _0x165659[_0xef59('0x23')]()[_0xef59('0x22')](function(){_0x446c02[_0xef59('0x17')](0xcc)[_0xef59('0x24')]();});}};}function handleEntityNotFound(_0x3b6aa0,_0xa3fcca){return function(_0x32de10){if(!_0x32de10){_0x3b6aa0[_0xef59('0x25')](0x194);}return _0x32de10;};}function handleError(_0x8cc0b,_0x499ace){_0x499ace=_0x499ace||0x1f4;return function(_0x9f6127){logger[_0xef59('0x26')](_0x9f6127['stack']);if(_0x9f6127[_0xef59('0x27')]){delete _0x9f6127['name'];}_0x8cc0b[_0xef59('0x17')](_0x499ace)[_0xef59('0x28')](_0x9f6127);};}exports[_0xef59('0x29')]=function(_0x216ee8,_0x37cb20){var _0x3d6a56={},_0x58c762={},_0x5c03be={'count':0x0,'rows':[]};var _0x3e6898=_[_0xef59('0x2a')](db['Attachment'][_0xef59('0x2b')],function(_0x28b20e){return{'name':_0x28b20e[_0xef59('0x2c')],'type':_0x28b20e[_0xef59('0x2d')]['key']};});_0x58c762[_0xef59('0x2e')]=_[_0xef59('0x2a')](_0x3e6898,_0xef59('0x27'));_0x58c762[_0xef59('0x2f')]=_[_0xef59('0x30')](_0x216ee8['query']);_0x58c762[_0xef59('0x31')]=_[_0xef59('0x32')](_0x58c762[_0xef59('0x2e')],_0x58c762[_0xef59('0x2f')]);_0x3d6a56[_0xef59('0x33')]=_[_0xef59('0x32')](_0x58c762[_0xef59('0x2e')],qs[_0xef59('0x34')](_0x216ee8[_0xef59('0x2f')][_0xef59('0x34')]));_0x3d6a56[_0xef59('0x33')]=_0x3d6a56[_0xef59('0x33')][_0xef59('0x35')]?_0x3d6a56[_0xef59('0x33')]:_0x58c762[_0xef59('0x2e')];if(!_0x216ee8[_0xef59('0x2f')][_0xef59('0x36')](_0xef59('0x37'))){_0x3d6a56[_0xef59('0x1a')]=qs[_0xef59('0x1a')](_0x216ee8[_0xef59('0x2f')][_0xef59('0x1a')]);_0x3d6a56['offset']=qs[_0xef59('0x18')](_0x216ee8['query'][_0xef59('0x18')]);}_0x3d6a56[_0xef59('0x38')]=qs[_0xef59('0x39')](_0x216ee8[_0xef59('0x2f')][_0xef59('0x39')]);_0x3d6a56[_0xef59('0x3a')]=qs[_0xef59('0x31')](_[_0xef59('0x3b')](_0x216ee8[_0xef59('0x2f')],_0x58c762[_0xef59('0x31')]),_0x3e6898);if(_0x216ee8[_0xef59('0x2f')]['filter']){_0x3d6a56[_0xef59('0x3a')]=_[_0xef59('0x3c')](_0x3d6a56[_0xef59('0x3a')],{'$or':_[_0xef59('0x2a')](_0x3e6898,function(_0x4b135e){if(_0x4b135e[_0xef59('0x2d')]!=='VIRTUAL'){var _0x5cc7d2={};_0x5cc7d2[_0x4b135e['name']]={'$like':'%'+_0x216ee8[_0xef59('0x2f')][_0xef59('0x3d')]+'%'};return _0x5cc7d2;}})});}_0x3d6a56=_['merge']({},_0x3d6a56,_0x216ee8[_0xef59('0x3e')]);var _0x1932bb={'where':_0x3d6a56[_0xef59('0x3a')]};return db[_0xef59('0x3f')][_0xef59('0x1b')](_0x1932bb)[_0xef59('0x22')](function(_0x26f5da){_0x5c03be['count']=_0x26f5da;if(_0x216ee8[_0xef59('0x2f')][_0xef59('0x40')]){_0x3d6a56['include']=[{'all':!![]}];}return db['Attachment'][_0xef59('0x41')](_0x3d6a56);})[_0xef59('0x22')](function(_0x428212){_0x5c03be[_0xef59('0x42')]=_0x428212;return _0x5c03be;})[_0xef59('0x22')](respondWithFilteredResult(_0x37cb20,_0x3d6a56))[_0xef59('0x43')](handleError(_0x37cb20,null));};exports[_0xef59('0x44')]=function(_0x13ced0,_0x42783f){var _0x292047={'raw':!![],'where':{'id':_0x13ced0[_0xef59('0x45')]['id']}},_0x4ba6ff={};_0x4ba6ff[_0xef59('0x2e')]=_[_0xef59('0x30')](db['Attachment'][_0xef59('0x2b')]);_0x4ba6ff['query']=_[_0xef59('0x30')](_0x13ced0['query']);_0x4ba6ff[_0xef59('0x31')]=_[_0xef59('0x32')](_0x4ba6ff[_0xef59('0x2e')],_0x4ba6ff[_0xef59('0x2f')]);_0x292047[_0xef59('0x33')]=_[_0xef59('0x32')](_0x4ba6ff[_0xef59('0x2e')],qs['fields'](_0x13ced0['query']['fields']));_0x292047['attributes']=_0x292047[_0xef59('0x33')][_0xef59('0x35')]?_0x292047[_0xef59('0x33')]:_0x4ba6ff[_0xef59('0x2e')];if(_0x13ced0[_0xef59('0x2f')][_0xef59('0x40')]){_0x292047[_0xef59('0x46')]=[{'all':!![]}];}_0x292047=_[_0xef59('0x3c')]({},_0x292047,_0x13ced0[_0xef59('0x3e')]);return db[_0xef59('0x3f')][_0xef59('0x47')](_0x292047)['then'](handleEntityNotFound(_0x42783f,null))['then'](respondWithResult(_0x42783f,null))[_0xef59('0x43')](handleError(_0x42783f,null));};exports[_0xef59('0x48')]=function(_0x379e9c,_0x274498){var _0x2419ca={'where':{'id':_0x379e9c[_0xef59('0x45')]['id']}},_0x1d26d5={};_0x1d26d5[_0xef59('0x2e')]=_['keys'](db[_0xef59('0x3f')]['rawAttributes']);_0x2419ca[_0xef59('0x33')]=_[_0xef59('0x32')](_0x1d26d5[_0xef59('0x2e')],qs[_0xef59('0x34')](_0x379e9c[_0xef59('0x2f')][_0xef59('0x34')]));_0x2419ca[_0xef59('0x33')]=_0x2419ca[_0xef59('0x33')]['length']?_0x2419ca['attributes']:_0x1d26d5[_0xef59('0x2e')];if(_0x379e9c[_0xef59('0x2f')][_0xef59('0x40')]){_0x2419ca[_0xef59('0x46')]=[{'all':!![]}];}_0x2419ca=_['merge']({},_0x2419ca,_0x379e9c['options']);return db[_0xef59('0x3f')][_0xef59('0x47')](_0x2419ca)[_0xef59('0x22')](handleEntityNotFound(_0x274498,null))[_0xef59('0x22')](function(_0x236db8){if(_0x236db8){var _0xac4766=_0x236db8[_0xef59('0x49')]({'plain':!![]});_0xac4766=qs[_0xef59('0x4a')](_0xac4766,['id',_0xef59('0x4b'),_0xef59('0x4c')]);_0x379e9c[_0xef59('0x4d')]=_[_0xef59('0x4a')](_0x379e9c[_0xef59('0x4d')],['id','createdAt',_0xef59('0x4c')]);return db[_0xef59('0x3f')]['create'](_[_0xef59('0x3c')](_0xac4766,_0x379e9c[_0xef59('0x4d')]),{'include':_0x379e9c['query'][_0xef59('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x274498,0xc9))['catch'](handleError(_0x274498,null));};exports[_0xef59('0x21')]=function(_0x28b69d,_0x37034a){if(_0x28b69d[_0xef59('0x4d')]['id']){delete _0x28b69d[_0xef59('0x4d')]['id'];}return db[_0xef59('0x3f')]['find']({'where':{'id':_0x28b69d[_0xef59('0x45')]['id']}})[_0xef59('0x22')](handleEntityNotFound(_0x37034a,null))['then'](saveUpdates(_0x28b69d[_0xef59('0x4d')],null))[_0xef59('0x22')](respondWithResult(_0x37034a,null))[_0xef59('0x43')](handleError(_0x37034a,null));};exports[_0xef59('0x23')]=function(_0x4685f3,_0x482e7c){return db[_0xef59('0x3f')][_0xef59('0x47')]({'where':{'id':_0x4685f3[_0xef59('0x45')]['id']}})[_0xef59('0x22')](handleEntityNotFound(_0x482e7c,null))[_0xef59('0x22')](removeEntity(_0x482e7c,null))['catch'](handleError(_0x482e7c,null));};exports[_0xef59('0x4e')]=function(_0x5c95e8,_0x381ac8,_0xdf3989){_0x5c95e8[_0xef59('0x4d')][_0xef59('0x27')]=_0x5c95e8[_0xef59('0x4f')][_0xef59('0x50')];_0x5c95e8[_0xef59('0x4d')][_0xef59('0x51')]=_0x5c95e8[_0xef59('0x4f')]['filename'];_0x5c95e8['body']['type']=_0x5c95e8['file']['mimetype'];return db[_0xef59('0x3f')][_0xef59('0x4e')](_0x5c95e8['body'])[_0xef59('0x22')](respondWithResult(_0x381ac8,0xc9))[_0xef59('0x43')](handleError(_0x381ac8,null));};exports[_0xef59('0x52')]=function(_0x67becb,_0x5071f8,_0xf8866b){return db['Attachment'][_0xef59('0x53')]({'where':{'id':_0x67becb['params']['id']},'raw':!![]})[_0xef59('0x22')](handleEntityNotFound(_0x5071f8,null))[_0xef59('0x22')](function(_0xfb2e2a){if(_0xfb2e2a){var _0x1a377d=_0xfb2e2a['ChatOfflineMessageId']!==null;var _0xc7ea33=path[_0xef59('0x54')](config[_0xef59('0x55')],_0xef59('0x56'));if(_0x1a377d){_0xc7ea33=path[_0xef59('0x54')](_0xc7ea33,'offline-chat/');}var _0x3d1815=path[_0xef59('0x54')](_0xc7ea33,_0xfb2e2a[_0xef59('0x51')]);return _0x5071f8['download'](_0x3d1815);}})['catch'](handleError(_0x5071f8,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7afa72b..452956a 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 _0xc953=['../../config/logger','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x58bfcd,_0x4b7bd3){var _0x5d1e6a=function(_0x4ca2b1){while(--_0x4ca2b1){_0x58bfcd['push'](_0x58bfcd['shift']());}};_0x5d1e6a(++_0x4b7bd3);}(_0xc953,0x167));var _0x3c95=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xc953[_0xfc406a];return _0x395473;};'use strict';var _=require(_0x3c95('0x0'));var util=require('util');var logger=require(_0x3c95('0x1'))(_0x3c95('0x2'));var moment=require('moment');var BPromise=require(_0x3c95('0x3'));var rp=require(_0x3c95('0x4'));var fs=require('fs');var path=require(_0x3c95('0x5'));var rimraf=require(_0x3c95('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c95('0x7'));module[_0x3c95('0x8')]=function(_0x5899b3,_0x4a9016){return _0x5899b3[_0x3c95('0x9')](_0x3c95('0xa'),attributes,{'tableName':_0x3c95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c35=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','attachments','lodash','util','api'];(function(_0x605b65,_0x19247e){var _0x40bc80=function(_0x5941cd){while(--_0x5941cd){_0x605b65['push'](_0x605b65['shift']());}};_0x40bc80(++_0x19247e);}(_0x5c35,0x17d));var _0x55c3=function(_0x808bc4,_0x2201bf){_0x808bc4=_0x808bc4-0x0;var _0x233c9e=_0x5c35[_0x808bc4];return _0x233c9e;};'use strict';var _=require(_0x55c3('0x0'));var util=require(_0x55c3('0x1'));var logger=require('../../config/logger')(_0x55c3('0x2'));var moment=require(_0x55c3('0x3'));var BPromise=require(_0x55c3('0x4'));var rp=require(_0x55c3('0x5'));var fs=require('fs');var path=require(_0x55c3('0x6'));var rimraf=require(_0x55c3('0x7'));var config=require(_0x55c3('0x8'));var attributes=require(_0x55c3('0x9'));module[_0x55c3('0xa')]=function(_0xf15fc8,_0x17d31a){return _0xf15fc8['define']('Attachment',attributes,{'tableName':_0x55c3('0xb'),'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 7fdf644..35953f9 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 _0x6b19=['client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateAttachment','create','options','raw','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x159eb2,_0x17f378){var _0x5232de=function(_0x5a5c22){while(--_0x5a5c22){_0x159eb2['push'](_0x159eb2['shift']());}};_0x5232de(++_0x17f378);}(_0x6b19,0xe8));var _0x96b1=function(_0x20d514,_0x441bdc){_0x20d514=_0x20d514-0x0;var _0x4dbb24=_0x6b19[_0x20d514];return _0x4dbb24;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});}exports[_0x96b1('0x13')]=function(_0x38478c){var _0x2b192a=this;return new Promise(function(_0x19972b,_0x212b31){return db['Attachment'][_0x96b1('0x14')](_0x38478c['body'],{'raw':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')][_0x96b1('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0xc5dc95){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x38478c);logger['debug'](_0x96b1('0x13'),_0x38478c,JSON[_0x96b1('0x17')](_0xc5dc95));_0x19972b(_0xc5dc95);})[_0x96b1('0x12')](function(_0x18594b){logger['error'](_0x96b1('0x13'),_0x18594b[_0x96b1('0x10')],_0x38478c);_0x212b31(_0x2b192a[_0x96b1('0xf')](0x1f4,_0x18594b['message']));});});}; \ No newline at end of file +var _0xde50=['randomstring','ioredis','../../config/utils','rpc','http','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird'];(function(_0x50dc27,_0x4fc964){var _0x545f89=function(_0x4add81){while(--_0x4add81){_0x50dc27['push'](_0x50dc27['shift']());}};_0x545f89(++_0x4fc964);}(_0xde50,0x140));var _0x0de5=function(_0x235a77,_0xa057ab){_0x235a77=_0x235a77-0x0;var _0x45ebd1=_0xde50[_0x235a77];return _0x45ebd1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de5('0x0'));var BPromise=require(_0x0de5('0x1'));var rs=require(_0x0de5('0x2'));var fs=require('fs');var Redis=require(_0x0de5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de5('0x4'));var logger=require('../../config/logger')(_0x0de5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2714e3,_0x2a5d94,_0x57410e){return new BPromise(function(_0xe3ac44,_0x4d5f0e){return client['request'](_0x2714e3,_0x57410e)['then'](function(_0x396293){logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,'request\x20sent');logger[_0x0de5('0x9')](_0x0de5('0xa'),_0x2a5d94,'request\x20sent',JSON[_0x0de5('0xb')](_0x396293));if(_0x396293[_0x0de5('0xc')]){if(_0x396293[_0x0de5('0xc')]['code']===0x1f4){logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);return _0x4d5f0e(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293['error']['message']);return _0xe3ac44(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}else{logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,_0x0de5('0xe'));_0xe3ac44(_0x396293[_0x0de5('0xf')]['message']);}})[_0x0de5('0x10')](function(_0xeb58e1){logger[_0x0de5('0xc')](_0x0de5('0x8'),_0x2a5d94,_0xeb58e1);_0x4d5f0e(_0xeb58e1);});});}exports[_0x0de5('0x11')]=function(_0x2860e8){var _0x58ce66=this;return new Promise(function(_0x21e4b6,_0x48ba4e){return db[_0x0de5('0x12')][_0x0de5('0x13')](_0x2860e8[_0x0de5('0x14')],{'raw':_0x2860e8[_0x0de5('0x15')]?_0x2860e8['options'][_0x0de5('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x2a2abc){logger[_0x0de5('0x7')](_0x0de5('0x11'),_0x2860e8);logger['debug'](_0x0de5('0x11'),_0x2860e8,JSON[_0x0de5('0xb')](_0x2a2abc));_0x21e4b6(_0x2a2abc);})[_0x0de5('0x10')](function(_0x224745){logger['error'](_0x0de5('0x11'),_0x224745['message'],_0x2860e8);_0x48ba4e(_0x58ce66[_0x0de5('0xc')](0x1f4,_0x224745[_0x0de5('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a457f93..fc22e6d 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5d8fbf,_0x54c0e4){var _0x51dd16=function(_0x4e8de6){while(--_0x4e8de6){_0x5d8fbf['push'](_0x5d8fbf['shift']());}};_0x51dd16(++_0x54c0e4);}(_0x757a,0xde));var _0xa757=function(_0x4c5a99,_0x2dcc23){_0x4c5a99=_0x4c5a99-0x0;var _0x4b3cd6=_0x757a[_0x4c5a99];return _0x4b3cd6;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x1ff762,_0x2e2d62){_0x1ff762=_0x1ff762-0x0;var _0x336e45=_0xdb28[_0x1ff762];return _0x336e45;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e05ad18..6e31e96 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 _0xac96=['catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','Setting','findOne','blockDuration','then','User','map','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','getLicense'];(function(_0x15b061,_0x4644bd){var _0xe42b0=function(_0x1e39ea){while(--_0x1e39ea){_0x15b061['push'](_0x15b061['shift']());}};_0xe42b0(++_0x4644bd);}(_0xac96,0xd3));var _0x6ac9=function(_0x339d5e,_0x4a3bcb){_0x339d5e=_0x339d5e-0x0;var _0x39b51b=_0xac96[_0x339d5e];return _0x39b51b;};'use strict';var _=require(_0x6ac9('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x6ac9('0x1'))['Strategy'];var moment=require(_0x6ac9('0x2'));var db=require(_0x6ac9('0x3'))['db'];var config=require(_0x6ac9('0x4'));var signToken=require(_0x6ac9('0x5'))['signToken'];var utils=require(_0x6ac9('0x6'));exports[_0x6ac9('0x7')]=passport[_0x6ac9('0x8')](_0x6ac9('0x9'),{'failureRedirect':_0x6ac9('0xa'),'scope':[_0x6ac9('0xb'),_0x6ac9('0xc')],'session':![]});exports[_0x6ac9('0xd')]=passport[_0x6ac9('0x8')]('google',{'failureRedirect':'/login','session':![]});passport[_0x6ac9('0xe')](new GoogleStrategy({'clientID':config[_0x6ac9('0x9')]?config[_0x6ac9('0x9')][_0x6ac9('0xf')]:'id','clientSecret':config[_0x6ac9('0x9')]?config['google'][_0x6ac9('0x10')]:_0x6ac9('0x11'),'callbackURL':config[_0x6ac9('0x9')]?config[_0x6ac9('0x9')]['callbackURL']:''},function(_0x49cebf,_0x200afd,_0x4e3f87,_0x3ba605){var _0xe8aa85,_0x2b64cd;return db[_0x6ac9('0x12')][_0x6ac9('0x13')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6ac9('0x14')],'raw':!![]})[_0x6ac9('0x15')](function(_0x6938f0){_0xe8aa85=_0x6938f0;return db[_0x6ac9('0x16')]['find']({'where':{'email':_[_0x6ac9('0x17')](_0x4e3f87[_0x6ac9('0x18')],_0x6ac9('0x19')),'role':{'$or':[_0x6ac9('0x1a'),_0x6ac9('0x1b'),'agent']}}});})[_0x6ac9('0x15')](function(_0x2c8dc2){_0x2b64cd=_0x2c8dc2;if(_0x2b64cd){if(_0x2b64cd[_0x6ac9('0x1c')]){return _0x3ba605(_0x6ac9('0x1d'));}else if(_0xe8aa85[_0x6ac9('0x14')]>0x0){if(_0x2b64cd[_0x6ac9('0x1e')]){if(moment(_0x2b64cd['blockedAt'])[_0x6ac9('0x1f')](_0xe8aa85['blockDuration'],_0x6ac9('0x20'))>moment()){return _0x3ba605(_0x6ac9('0x1d'));}else{return utils['clearBlockUser'](_0x2b64cd,0x0,![],null)[_0x6ac9('0x15')](function(){return utils[_0x6ac9('0x21')](_0x2b64cd);})['then'](function(){return _0x3ba605(null,_0x2b64cd);});}}else{return utils['getLicense'](_0x2b64cd)[_0x6ac9('0x15')](function(){return _0x3ba605(null,_0x2b64cd);});}}else{return utils['getLicense'](_0x2b64cd)[_0x6ac9('0x15')](function(){return _0x3ba605(null,_0x2b64cd);});}}return _0x3ba605(_0x6ac9('0x1d'));})[_0x6ac9('0x22')](function(_0x1d592d){_0x3ba605(_0x1d592d);});})); \ No newline at end of file +var _0x3d27=['allowedLoginAttempts','then','find','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','moment','../../components/auth/service','../../config/utils','google','/login','profile','email','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne'];(function(_0x3760f5,_0x29c342){var _0x3f3dc1=function(_0x50ec5b){while(--_0x50ec5b){_0x3760f5['push'](_0x3760f5['shift']());}};_0x3f3dc1(++_0x29c342);}(_0x3d27,0x106));var _0x73d2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x3d27[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x73d2('0x0'));var passport=require(_0x73d2('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x73d2('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x73d2('0x3'))['signToken'];var utils=require(_0x73d2('0x4'));exports['login']=passport['authenticate'](_0x73d2('0x5'),{'failureRedirect':_0x73d2('0x6'),'scope':[_0x73d2('0x7'),_0x73d2('0x8')],'session':![]});exports['callback']=passport[_0x73d2('0x9')](_0x73d2('0x5'),{'failureRedirect':_0x73d2('0x6'),'session':![]});passport[_0x73d2('0xa')](new GoogleStrategy({'clientID':config[_0x73d2('0x5')]?config[_0x73d2('0x5')][_0x73d2('0xb')]:'id','clientSecret':config[_0x73d2('0x5')]?config[_0x73d2('0x5')][_0x73d2('0xc')]:_0x73d2('0xd'),'callbackURL':config[_0x73d2('0x5')]?config[_0x73d2('0x5')][_0x73d2('0xe')]:''},function(_0x401a22,_0x4510fb,_0x41c6d6,_0x40c5de){var _0x1fbd8a,_0x55203f;return db[_0x73d2('0xf')][_0x73d2('0x10')]({'where':{'id':0x1},'attributes':[_0x73d2('0x11'),'blockDuration'],'raw':!![]})[_0x73d2('0x12')](function(_0x5b684f){_0x1fbd8a=_0x5b684f;return db['User'][_0x73d2('0x13')]({'where':{'email':_['map'](_0x41c6d6['emails'],_0x73d2('0x14')),'role':{'$or':['admin',_0x73d2('0x15'),_0x73d2('0x16')]}}});})[_0x73d2('0x12')](function(_0x5283bc){_0x55203f=_0x5283bc;if(_0x55203f){if(_0x55203f[_0x73d2('0x17')]){return _0x40c5de(_0x73d2('0x18'));}else if(_0x1fbd8a[_0x73d2('0x19')]>0x0){if(_0x55203f['blocked']){if(moment(_0x55203f[_0x73d2('0x1a')])['add'](_0x1fbd8a[_0x73d2('0x19')],_0x73d2('0x1b'))>moment()){return _0x40c5de(_0x73d2('0x18'));}else{return utils[_0x73d2('0x1c')](_0x55203f,0x0,![],null)[_0x73d2('0x12')](function(){return utils[_0x73d2('0x1d')](_0x55203f);})[_0x73d2('0x12')](function(){return _0x40c5de(null,_0x55203f);});}}else{return utils['getLicense'](_0x55203f)[_0x73d2('0x12')](function(){return _0x40c5de(null,_0x55203f);});}}else{return utils['getLicense'](_0x55203f)['then'](function(){return _0x40c5de(null,_0x55203f);});}}return _0x40c5de(_0x73d2('0x18'));})[_0x73d2('0x1e')](function(_0x3de0a0){_0x40c5de(_0x3de0a0);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ca0756b..2d46197 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 _0x1b89=['callback','isMiddleware','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback'];(function(_0x3bd7e8,_0x5bde05){var _0x2b893c=function(_0x3dc3cf){while(--_0x3dc3cf){_0x3bd7e8['push'](_0x3bd7e8['shift']());}};_0x2b893c(++_0x5bde05);}(_0x1b89,0xd4));var _0x91b8=function(_0xdfe827,_0x134436){_0xdfe827=_0xdfe827-0x0;var _0xa174b=_0x1b89[_0xdfe827];return _0xa174b;};'use strict';var express=require(_0x91b8('0x0'));var passport=require(_0x91b8('0x1'));var router=express[_0x91b8('0x2')]();var controller=require(_0x91b8('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x91b8('0x4'));router[_0x91b8('0x5')]('/',controller[_0x91b8('0x6')]);router[_0x91b8('0x5')](_0x91b8('0x7'),controller[_0x91b8('0x8')],authService[_0x91b8('0x9')],userController[_0x91b8('0x6')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x521e=['../../components/auth/service','login','get','/callback','callback','setTokenCookie','./authGoogle.controller','../user/user.controller.js'];(function(_0x3726ac,_0x53ce85){var _0x3d0f95=function(_0x41cd37){while(--_0x41cd37){_0x3726ac['push'](_0x3726ac['shift']());}};_0x3d0f95(++_0x53ce85);}(_0x521e,0x86));var _0xe521=function(_0x4919a0,_0x519bab){_0x4919a0=_0x4919a0-0x0;var _0xafc211=_0x521e[_0x4919a0];return _0xafc211;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xe521('0x0'));var userController=require(_0xe521('0x1'));var authService=require(_0xe521('0x2'));router['get']('/',controller[_0xe521('0x3')]);router[_0xe521('0x4')](_0xe521('0x5'),controller[_0xe521('0x6')],authService['isMiddleware'],userController[_0xe521('0x3')],authService[_0xe521('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 6452bbe..24aff13 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 _0x34d4=['user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','email'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x34d4,0x12e));var _0x434d=function(_0x564165,_0x1665a3){_0x564165=_0x564165-0x0;var _0x297c72=_0x34d4[_0x564165];return _0x297c72;};'use strict';var util=require(_0x434d('0x0'));var passport=require(_0x434d('0x1'));var LocalStrategy=require(_0x434d('0x2'))[_0x434d('0x3')];var jayson=require('jayson/promise');var _=require(_0x434d('0x4'));var rs=require(_0x434d('0x5'));var moment=require('moment');var db=require(_0x434d('0x6'))['db'];var authService=require(_0x434d('0x7'));var utils=require(_0x434d('0x8'));var client=jayson[_0x434d('0x9')][_0x434d('0xa')]({'port':0x232b});function localAuthenticate(_0x33bbbe,_0x3138ce,_0x4c981b,_0x5460d7){var _0x92671d,_0x189ea0;return db[_0x434d('0xb')][_0x434d('0xc')]({'where':{'id':0x1},'attributes':[_0x434d('0xd'),_0x434d('0xe')],'raw':!![]})[_0x434d('0xf')](function(_0x4c4c7e){_0x92671d=_0x4c4c7e;return _0x33bbbe[_0x434d('0xc')]({'attributes':['id','name',_0x434d('0x10'),_0x434d('0x11'),_0x434d('0x12'),_0x434d('0x13'),_0x434d('0x14'),_0x434d('0x15'),_0x434d('0x16')],'where':{'name':_0x3138ce,'role':{'$or':['admin','user',_0x434d('0x17')]}}});})[_0x434d('0xf')](function(_0x151b17){if(!_0x151b17||_0x151b17&&_0x151b17[_0x434d('0x18')]!==_0x3138ce){throw new Error(_0x434d('0x19'));}else{_0x189ea0=_0x151b17;return _0x189ea0;}})[_0x434d('0xf')](function(){_0x189ea0[_0x434d('0x1a')](_0x4c981b,function(_0x1fc9dc,_0x213d0d){var _0x150e67=_0x189ea0[_0x434d('0x16')]+0x1;if(_0x1fc9dc){return _0x5460d7(_0x1fc9dc);}else if(!_0x213d0d){if(_0x189ea0[_0x434d('0x13')]){return _0x5460d7(null,![],{'message':_0x434d('0x19')});}else if(_0x92671d['allowedLoginAttempts']>0x0){if(_0x189ea0[_0x434d('0x14')]){if(_0x92671d[_0x434d('0xe')]>0x0){if(moment(_0x189ea0[_0x434d('0x15')])[_0x434d('0x1b')](_0x92671d[_0x434d('0xe')],'minutes')>moment()){return _0x5460d7(null,![],{'message':_0x434d('0x19')});}else{return utils['clearBlockUser'](_0x189ea0,_0x150e67,![],null)[_0x434d('0xf')](function(){return _0x5460d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5460d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x150e67>=_0x92671d[_0x434d('0xd')]){return utils[_0x434d('0x1c')](_0x189ea0,0x0,!![],moment())['then'](function(){return _0x5460d7(null,![],{'message':_0x434d('0x19')});});}else{return utils[_0x434d('0x1c')](_0x189ea0,_0x150e67,![],null)['then'](function(){return _0x5460d7(null,![],{'message':_0x434d('0x19')});});}}}else{return _0x5460d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x189ea0[_0x434d('0x13')]){return _0x5460d7(null,![],{'message':_0x434d('0x19')});}else if(_0x92671d[_0x434d('0xd')]>0x0){if(_0x189ea0[_0x434d('0x14')]){if(_0x92671d[_0x434d('0xe')]>0x0){if(moment(_0x189ea0['blockedAt'])['add'](_0x92671d[_0x434d('0xe')],_0x434d('0x1d'))>moment()){return _0x5460d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x434d('0x1c')](_0x189ea0,0x0,![],null)[_0x434d('0xf')](function(){return utils['getLicense'](_0x189ea0);})[_0x434d('0xf')](function(){return _0x5460d7(null,_0x189ea0);});}}else{return _0x5460d7(null,![],{'message':_0x434d('0x19')});}}else{return utils[_0x434d('0x1c')](_0x189ea0,0x0,![],null)['then'](function(){return utils[_0x434d('0x1e')](_0x189ea0);})[_0x434d('0xf')](function(){return _0x5460d7(null,_0x189ea0);})['catch'](function(_0x25d7f8){return _0x5460d7(null,![],_0x25d7f8);});}}else{if(_0x189ea0['blocked']){return _0x5460d7(null,![],{'message':_0x434d('0x19')});}else{return utils[_0x434d('0x1e')](_0x189ea0)[_0x434d('0xf')](function(){return _0x5460d7(null,_0x189ea0);});}}}});})[_0x434d('0x1f')](function(_0x38e521){return _0x5460d7(null,![],_0x38e521);});}function sendServiceMail(_0x1722c6){return db[_0x434d('0x20')][_0x434d('0x21')]({'where':{'service':!![]},'attributes':['id',_0x434d('0x18'),'email'],'include':[{'model':db[_0x434d('0x22')],'as':'Smtp'}]})[_0x434d('0xf')](function(_0x25d9c2){if(!_0x25d9c2){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4a43e8={'tls':{'rejectUnauthorized':![]}};if(_0x25d9c2[_0x434d('0x23')][_0x434d('0x24')]){_0x4a43e8[_0x434d('0x24')]=_0x25d9c2[_0x434d('0x23')][_0x434d('0x24')];}else{_0x4a43e8['host']=_0x25d9c2[_0x434d('0x23')][_0x434d('0x25')];_0x4a43e8[_0x434d('0x26')]=_0x25d9c2[_0x434d('0x23')][_0x434d('0x26')];_0x4a43e8[_0x434d('0x27')]=_0x25d9c2[_0x434d('0x23')][_0x434d('0x27')];}if(_0x25d9c2[_0x434d('0x23')][_0x434d('0x28')]){_0x4a43e8[_0x434d('0x29')]={'user':_0x25d9c2[_0x434d('0x23')]['user'],'pass':_0x25d9c2[_0x434d('0x23')][_0x434d('0x2a')]};}var _0x1e95c8={'account':_0x4a43e8,'message':_[_0x434d('0x2b')]({'from':util['format'](_0x434d('0x2c'),_0x25d9c2[_0x434d('0x18')],_0x25d9c2[_0x434d('0x2d')]||_0x25d9c2[_0x434d('0x23')][_0x434d('0x2e')])},_0x1722c6)};return client[_0x434d('0x2f')](_0x434d('0x30'),_0x1e95c8);})[_0x434d('0xf')](function(_0x56dc83){if(_0x56dc83[_0x434d('0x31')]){throw new Error(util['format'](_0x434d('0x32'),_0x56dc83[_0x434d('0x31')]['message']||JSON[_0x434d('0x33')](_0x56dc83[_0x434d('0x31')])));}return!![];});}function handleError(_0x94dd69,_0x4b8a1c,_0x486508){return _0x94dd69[_0x434d('0x34')](_0x4b8a1c||0x1f4)[_0x434d('0x35')]({'message':_0x486508?_0x486508[_0x434d('0x36')]||_0x486508:''});}exports['login']=function(_0x5a8c84,_0x3914d0,_0xc18b5d){passport['authenticate'](_0x434d('0x37'),function(_0x4c308b,_0x4d7d24,_0x31a89a){var _0x325197=_0x4c308b||_0x31a89a;if(_0x325197){return handleError(_0x3914d0,0x191,_0x325197);}if(!_0x4d7d24){return handleError(_0x3914d0,0x194,{'message':_0x434d('0x38')});}else{var _0xc1f60b={'payload':{'id':_0x4d7d24['id'],'role':_0x4d7d24[_0x434d('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x434d('0x39')](_0xc1f60b)[_0x434d('0xf')](function(_0x3a2483){_0x3914d0[_0x434d('0x3a')]({'id':_0x4d7d24['id'],'token':_0x3a2483,'statusCall':'','isAlreadyLogged':_0x4d7d24[_0x434d('0x3b')]});});}})(_0x5a8c84,_0x3914d0,_0xc18b5d);};exports['forgot']=function(_0x1c7362,_0x1ad05a,_0x4193ff){if(!_0x1c7362['body'][_0x434d('0x2d')]){return handleError(_0x1ad05a,0x1f4,{'message':_0x434d('0x3c')});}var _0x30b47f=rs[_0x434d('0x3d')]();_0x1c7362['body'][_0x434d('0x2d')]=_0x1c7362['body'][_0x434d('0x2d')]['trim']()[_0x434d('0x3e')]();var _0x3176c4;return db[_0x434d('0xb')][_0x434d('0xc')]({'where':{'id':0x1},'attributes':[_0x434d('0xd'),_0x434d('0xe')],'raw':!![]})[_0x434d('0xf')](function(_0x2d38fc){_0x3176c4=_0x2d38fc;return db[_0x434d('0x3f')][_0x434d('0x21')]({'where':{'email':_0x1c7362[_0x434d('0x40')]['email']}});})[_0x434d('0xf')](function(_0x35e135){if(!_0x35e135){throw new Error(_0x434d('0x41'));}if(_0x35e135[_0x434d('0x13')]){throw new Error(_0x434d('0x42'));}if(_0x35e135[_0x434d('0x14')]){if(moment(_0x35e135[_0x434d('0x15')])[_0x434d('0x1b')](_0x3176c4[_0x434d('0xe')],_0x434d('0x1d'))>moment()){throw new Error(_0x434d('0x43'));}else{_0x35e135[_0x434d('0x14')]=![];_0x35e135[_0x434d('0x15')]=null;}}_0x35e135[_0x434d('0x44')]=_0x30b47f;_0x35e135[_0x434d('0x45')]=Date[_0x434d('0x46')]()+0x36ee80;return _0x35e135['save']();})[_0x434d('0xf')](function(){return sendServiceMail({'to':_0x1c7362['body'][_0x434d('0x2d')],'subject':_0x434d('0x47'),'text':_0x434d('0x48')+_0x434d('0x49')+_0x434d('0x4a')+_0x1c7362[_0x434d('0x4b')][_0x434d('0x25')]+'/reset/'+_0x30b47f+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x434d('0xf')](function(){_0x1ad05a[_0x434d('0x34')](0xc8)[_0x434d('0x35')]({'message':_0x434d('0x4c')});})[_0x434d('0x1f')](function(_0x53b35d){return handleError(_0x1ad05a,0x1f4,_0x53b35d);});};exports[_0x434d('0x4d')]=function(_0x423e86,_0x35ea37,_0x30a9b3){return db[_0x434d('0x3f')]['find']({'where':{'resetPasswordToken':_0x423e86[_0x434d('0x4e')][_0x434d('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x434d('0x46')]()}}})['then'](function(_0xde3a36){if(!_0xde3a36){throw new Error(_0x434d('0x50'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x434d('0x51'),'passwordHistoryLimit']})['then'](function(_0x2829c4){if(_0x2829c4[_0x434d('0x52')])authService['validatePasswordPattern'](_0x423e86[_0x434d('0x40')][_0x434d('0x10')]);if(!_0x2829c4[_0x434d('0x51')]||!_0xde3a36[_0x434d('0x53')])return _0xde3a36;authService['validatePasswordHistory'](_0x423e86[_0x434d('0x40')]['password'],_0xde3a36[_0x434d('0x53')],_0x2829c4[_0x434d('0x54')]);return _0xde3a36;})[_0x434d('0xf')](function(){_0xde3a36['password']=_0x423e86[_0x434d('0x40')]['password'];_0xde3a36[_0x434d('0x44')]=null;_0xde3a36[_0x434d('0x45')]=null;return _0xde3a36['save']();});})[_0x434d('0xf')](function(){_0x35ea37[_0x434d('0x34')](0xc8)[_0x434d('0x35')]({'message':_0x434d('0x55')});})['catch'](function(_0x5473aa){return handleError(_0x35ea37,0x1f4,_0x5473aa);});};passport[_0x434d('0x56')](new LocalStrategy({'usernameField':'name','passwordField':_0x434d('0x10')},function(_0x53ecfb,_0x441c0f,_0x5208ba){return localAuthenticate(db[_0x434d('0x3f')],_0x53ecfb,_0x441c0f,_0x5208ba);})); \ No newline at end of file +var _0xb477=['send','Reset\x20Email\x20sent!','reset','params','token','now','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','util','passport','passport-local','Strategy','lodash','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blockedAt','user','agent','name','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','email','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/'];(function(_0x590a95,_0x567557){var _0x166ebd=function(_0xaa8dfe){while(--_0xaa8dfe){_0x590a95['push'](_0x590a95['shift']());}};_0x166ebd(++_0x567557);}(_0xb477,0xac));var _0x7b47=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xb477[_0x18ab2a];return _0x16dcee;};'use strict';var util=require(_0x7b47('0x0'));var passport=require(_0x7b47('0x1'));var LocalStrategy=require(_0x7b47('0x2'))[_0x7b47('0x3')];var jayson=require('jayson/promise');var _=require(_0x7b47('0x4'));var rs=require('randomstring');var moment=require(_0x7b47('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x7b47('0x6'));var utils=require(_0x7b47('0x7'));var client=jayson['client'][_0x7b47('0x8')]({'port':0x232b});function localAuthenticate(_0x4f360c,_0x369933,_0x1f3f89,_0x94a1af){var _0x26d141,_0x78337d;return db[_0x7b47('0x9')][_0x7b47('0xa')]({'where':{'id':0x1},'attributes':[_0x7b47('0xb'),_0x7b47('0xc')],'raw':!![]})[_0x7b47('0xd')](function(_0x3ef4e9){_0x26d141=_0x3ef4e9;return _0x4f360c[_0x7b47('0xa')]({'attributes':['id','name',_0x7b47('0xe'),_0x7b47('0xf'),_0x7b47('0x10'),_0x7b47('0x11'),'blocked',_0x7b47('0x12'),'loginAttempts'],'where':{'name':_0x369933,'role':{'$or':['admin',_0x7b47('0x13'),_0x7b47('0x14')]}}});})[_0x7b47('0xd')](function(_0x3ada04){if(!_0x3ada04||_0x3ada04&&_0x3ada04[_0x7b47('0x15')]!==_0x369933){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x78337d=_0x3ada04;return _0x78337d;}})['then'](function(){_0x78337d[_0x7b47('0x16')](_0x1f3f89,function(_0x36aade,_0x4e604b){var _0x22f14b=_0x78337d[_0x7b47('0x17')]+0x1;if(_0x36aade){return _0x94a1af(_0x36aade);}else if(!_0x4e604b){if(_0x78337d[_0x7b47('0x11')]){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});}else if(_0x26d141['allowedLoginAttempts']>0x0){if(_0x78337d[_0x7b47('0x19')]){if(_0x26d141['blockDuration']>0x0){if(moment(_0x78337d['blockedAt'])[_0x7b47('0x1a')](_0x26d141[_0x7b47('0xc')],_0x7b47('0x1b'))>moment()){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});}else{return utils[_0x7b47('0x1c')](_0x78337d,_0x22f14b,![],null)[_0x7b47('0xd')](function(){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});});}}else{return _0x94a1af(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x22f14b>=_0x26d141['allowedLoginAttempts']){return utils[_0x7b47('0x1c')](_0x78337d,0x0,!![],moment())[_0x7b47('0xd')](function(){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});});}else{return utils['clearBlockUser'](_0x78337d,_0x22f14b,![],null)[_0x7b47('0xd')](function(){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});});}}}else{return _0x94a1af(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x78337d[_0x7b47('0x11')]){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});}else if(_0x26d141['allowedLoginAttempts']>0x0){if(_0x78337d[_0x7b47('0x19')]){if(_0x26d141['blockDuration']>0x0){if(moment(_0x78337d['blockedAt'])[_0x7b47('0x1a')](_0x26d141[_0x7b47('0xc')],_0x7b47('0x1b'))>moment()){return _0x94a1af(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7b47('0x1c')](_0x78337d,0x0,![],null)[_0x7b47('0xd')](function(){return utils[_0x7b47('0x1d')](_0x78337d);})['then'](function(){return _0x94a1af(null,_0x78337d);});}}else{return _0x94a1af(null,![],{'message':_0x7b47('0x18')});}}else{return utils[_0x7b47('0x1c')](_0x78337d,0x0,![],null)[_0x7b47('0xd')](function(){return utils[_0x7b47('0x1d')](_0x78337d);})[_0x7b47('0xd')](function(){return _0x94a1af(null,_0x78337d);})[_0x7b47('0x1e')](function(_0x26d93){return _0x94a1af(null,![],_0x26d93);});}}else{if(_0x78337d['blocked']){return _0x94a1af(null,![],{'message':_0x7b47('0x18')});}else{return utils[_0x7b47('0x1d')](_0x78337d)[_0x7b47('0xd')](function(){return _0x94a1af(null,_0x78337d);});}}}});})[_0x7b47('0x1e')](function(_0x5a9e29){return _0x94a1af(null,![],_0x5a9e29);});}function sendServiceMail(_0xdfdbb1){return db[_0x7b47('0x1f')][_0x7b47('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x7b47('0x21')],'as':'Smtp'}]})[_0x7b47('0xd')](function(_0x51516c){if(!_0x51516c){throw new Error(_0x7b47('0x22'));}var _0x4bbea2={'tls':{'rejectUnauthorized':![]}};if(_0x51516c['Smtp'][_0x7b47('0x23')]){_0x4bbea2[_0x7b47('0x23')]=_0x51516c[_0x7b47('0x24')][_0x7b47('0x23')];}else{_0x4bbea2[_0x7b47('0x25')]=_0x51516c[_0x7b47('0x24')][_0x7b47('0x25')];_0x4bbea2[_0x7b47('0x26')]=_0x51516c[_0x7b47('0x24')]['port'];_0x4bbea2[_0x7b47('0x27')]=_0x51516c[_0x7b47('0x24')][_0x7b47('0x27')];}if(_0x51516c[_0x7b47('0x24')][_0x7b47('0x28')]){_0x4bbea2['auth']={'user':_0x51516c[_0x7b47('0x24')][_0x7b47('0x13')],'pass':_0x51516c[_0x7b47('0x24')][_0x7b47('0x29')]};}var _0x336352={'account':_0x4bbea2,'message':_['merge']({'from':util['format'](_0x7b47('0x2a'),_0x51516c[_0x7b47('0x15')],_0x51516c[_0x7b47('0x2b')]||_0x51516c[_0x7b47('0x24')][_0x7b47('0x13')])},_0xdfdbb1)};return client['request'](_0x7b47('0x2c'),_0x336352);})['then'](function(_0x56868f){if(_0x56868f['error']){throw new Error(util[_0x7b47('0x2d')](_0x7b47('0x2e'),_0x56868f[_0x7b47('0x2f')][_0x7b47('0x30')]||JSON[_0x7b47('0x31')](_0x56868f['error'])));}return!![];});}function handleError(_0x4edc87,_0x4fd47a,_0x1100df){return _0x4edc87[_0x7b47('0x32')](_0x4fd47a||0x1f4)['send']({'message':_0x1100df?_0x1100df[_0x7b47('0x30')]||_0x1100df:''});}exports[_0x7b47('0x33')]=function(_0x291afa,_0x3f9b71,_0x1527b4){passport[_0x7b47('0x16')]('local',function(_0x5cb7b5,_0x4df6a1,_0x11c991){var _0x3857ff=_0x5cb7b5||_0x11c991;if(_0x3857ff){return handleError(_0x3f9b71,0x191,_0x3857ff);}if(!_0x4df6a1){return handleError(_0x3f9b71,0x194,{'message':_0x7b47('0x34')});}else{var _0x6c620f={'payload':{'id':_0x4df6a1['id'],'role':_0x4df6a1[_0x7b47('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x7b47('0x35')](_0x6c620f)['then'](function(_0x570978){_0x3f9b71['json']({'id':_0x4df6a1['id'],'token':_0x570978,'statusCall':'','isAlreadyLogged':_0x4df6a1[_0x7b47('0x36')]});});}})(_0x291afa,_0x3f9b71,_0x1527b4);};exports[_0x7b47('0x37')]=function(_0x204b13,_0x1cc17d,_0x300eda){if(!_0x204b13[_0x7b47('0x38')][_0x7b47('0x2b')]){return handleError(_0x1cc17d,0x1f4,{'message':_0x7b47('0x39')});}var _0x1ef7a=rs[_0x7b47('0x3a')]();_0x204b13[_0x7b47('0x38')][_0x7b47('0x2b')]=_0x204b13[_0x7b47('0x38')][_0x7b47('0x2b')][_0x7b47('0x3b')]()[_0x7b47('0x3c')]();var _0x4e5c84;return db[_0x7b47('0x9')][_0x7b47('0xa')]({'where':{'id':0x1},'attributes':[_0x7b47('0xb'),_0x7b47('0xc')],'raw':!![]})[_0x7b47('0xd')](function(_0x681a54){_0x4e5c84=_0x681a54;return db[_0x7b47('0x3d')][_0x7b47('0x20')]({'where':{'email':_0x204b13[_0x7b47('0x38')]['email']}});})['then'](function(_0x5b2281){if(!_0x5b2281){throw new Error(_0x7b47('0x3e'));}if(_0x5b2281[_0x7b47('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5b2281[_0x7b47('0x19')]){if(moment(_0x5b2281['blockedAt'])[_0x7b47('0x1a')](_0x4e5c84[_0x7b47('0xc')],_0x7b47('0x1b'))>moment()){throw new Error(_0x7b47('0x3f'));}else{_0x5b2281[_0x7b47('0x19')]=![];_0x5b2281[_0x7b47('0x12')]=null;}}_0x5b2281[_0x7b47('0x40')]=_0x1ef7a;_0x5b2281[_0x7b47('0x41')]=Date['now']()+0x36ee80;return _0x5b2281[_0x7b47('0x42')]();})[_0x7b47('0xd')](function(){return sendServiceMail({'to':_0x204b13[_0x7b47('0x38')][_0x7b47('0x2b')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x7b47('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x7b47('0x44')+_0x204b13[_0x7b47('0x45')][_0x7b47('0x25')]+_0x7b47('0x46')+_0x1ef7a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x7b47('0xd')](function(){_0x1cc17d[_0x7b47('0x32')](0xc8)[_0x7b47('0x47')]({'message':_0x7b47('0x48')});})['catch'](function(_0xecb6fd){return handleError(_0x1cc17d,0x1f4,_0xecb6fd);});};exports[_0x7b47('0x49')]=function(_0x5dfcf3,_0x4b53c0,_0x3f801e){return db['User']['find']({'where':{'resetPasswordToken':_0x5dfcf3[_0x7b47('0x4a')][_0x7b47('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x7b47('0x4c')]()}}})[_0x7b47('0xd')](function(_0x20d7ca){if(!_0x20d7ca){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7b47('0x9')]['findOne']({'attributes':['id','securePassword',_0x7b47('0x4d'),_0x7b47('0x4e')]})[_0x7b47('0xd')](function(_0x13099e){if(_0x13099e['securePassword'])authService[_0x7b47('0x4f')](_0x5dfcf3[_0x7b47('0x38')][_0x7b47('0xe')]);if(!_0x13099e[_0x7b47('0x4d')]||!_0x20d7ca['previousPasswords'])return _0x20d7ca;authService[_0x7b47('0x50')](_0x5dfcf3[_0x7b47('0x38')][_0x7b47('0xe')],_0x20d7ca['previousPasswords'],_0x13099e[_0x7b47('0x4e')]);return _0x20d7ca;})[_0x7b47('0xd')](function(){_0x20d7ca[_0x7b47('0xe')]=_0x5dfcf3[_0x7b47('0x38')]['password'];_0x20d7ca[_0x7b47('0x40')]=null;_0x20d7ca[_0x7b47('0x41')]=null;return _0x20d7ca[_0x7b47('0x42')]();});})['then'](function(){_0x4b53c0[_0x7b47('0x32')](0xc8)[_0x7b47('0x47')]({'message':'Password\x20reset!'});})[_0x7b47('0x1e')](function(_0x2f59a1){return handleError(_0x4b53c0,0x1f4,_0x2f59a1);});};passport['use'](new LocalStrategy({'usernameField':_0x7b47('0x15'),'passwordField':_0x7b47('0xe')},function(_0x39d8ad,_0x5e4a6b,_0x2bb793){return localAuthenticate(db[_0x7b47('0x3d')],_0x39d8ad,_0x5e4a6b,_0x2bb793);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index ff001cc..fbebc8e 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 _0x2b82=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x7ed91a,_0x504466){var _0x44cbb7=function(_0x10f4e0){while(--_0x10f4e0){_0x7ed91a['push'](_0x7ed91a['shift']());}};_0x44cbb7(++_0x504466);}(_0x2b82,0x1aa));var _0x22b8=function(_0x1c231b,_0x9203d7){_0x1c231b=_0x1c231b-0x0;var _0x338079=_0x2b82[_0x1c231b];return _0x338079;};'use strict';var express=require(_0x22b8('0x0'));var router=express[_0x22b8('0x1')]();var controller=require(_0x22b8('0x2'));router[_0x22b8('0x3')]('/',controller[_0x22b8('0x4')]);router[_0x22b8('0x3')]('/forgot',controller[_0x22b8('0x5')]);router[_0x22b8('0x3')](_0x22b8('0x6'),controller[_0x22b8('0x7')]);module[_0x22b8('0x8')]=router; \ No newline at end of file +var _0x5c00=['forgot','reset','exports','express','./authLocal.controller','post','login','/forgot'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x5c00,0x16b));var _0x05c0=function(_0x187e82,_0x5254eb){_0x187e82=_0x187e82-0x0;var _0x58625e=_0x5c00[_0x187e82];return _0x58625e;};'use strict';var express=require(_0x05c0('0x0'));var router=express['Router']();var controller=require(_0x05c0('0x1'));router[_0x05c0('0x2')]('/',controller[_0x05c0('0x3')]);router[_0x05c0('0x2')](_0x05c0('0x4'),controller[_0x05c0('0x5')]);router['post']('/reset/:token',controller[_0x05c0('0x6')]);module[_0x05c0('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index faaafb6..d2f9158 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 _0xc7ed=['INTEGER','exports','STRING'];(function(_0x3ec515,_0x112725){var _0x110911=function(_0x2b2071){while(--_0x2b2071){_0x3ec515['push'](_0x3ec515['shift']());}};_0x110911(++_0x112725);}(_0xc7ed,0x148));var _0xdc7e=function(_0x419715,_0x221336){_0x419715=_0x419715-0x0;var _0x274fbd=_0xc7ed[_0x419715];return _0x274fbd;};'use strict';var Sequelize=require('sequelize');module[_0xdc7e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xdc7e('0x1')]},'description':{'type':Sequelize[_0xdc7e('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdc7e('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc087=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x28e571,_0x257262){var _0x24cb00=function(_0xb270f1){while(--_0xb270f1){_0x28e571['push'](_0x28e571['shift']());}};_0x24cb00(++_0x257262);}(_0xc087,0x16a));var _0x7c08=function(_0x8385f3,_0x53f26b){_0x8385f3=_0x8385f3-0x0;var _0x50c271=_0xc087[_0x8385f3];return _0x50c271;};'use strict';var Sequelize=require(_0x7c08('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c08('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7c08('0x1')]},'description':{'type':Sequelize[_0x7c08('0x1')]},'status':{'type':Sequelize[_0x7c08('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7c08('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 8111a49..278c336 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 _0x962f=['count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Automation','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','find','addConditions','Condition','ids','omit','findOne','length','order','getConditions','addActions','getActions','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined'];(function(_0xcc2106,_0x4e3e77){var _0x1e9e6b=function(_0x5ab3bb){while(--_0x5ab3bb){_0xcc2106['push'](_0xcc2106['shift']());}};_0x1e9e6b(++_0x4e3e77);}(_0x962f,0xe1));var _0xf962=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x962f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf962('0x0'));var rimraf=require(_0xf962('0x1'));var zipdir=require(_0xf962('0x2'));var jsonpatch=require(_0xf962('0x3'));var rp=require('request-promise');var moment=require(_0xf962('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf962('0x5'));var util=require(_0xf962('0x6'));var path=require(_0xf962('0x7'));var sox=require(_0xf962('0x8'));var csv=require(_0xf962('0x9'));var ejs=require(_0xf962('0xa'));var fs=require('fs');var fs_extra=require(_0xf962('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf962('0xc'));var jsforce=require(_0xf962('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf962('0x9'));var querystring=require(_0xf962('0xe'));var Papa=require(_0xf962('0xf'));var Redis=require(_0xf962('0x10'));var authService=require(_0xf962('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf962('0x12'));var logger=require(_0xf962('0x13'))(_0xf962('0x14'));var utils=require(_0xf962('0x15'));var config=require(_0xf962('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf962('0x17'))['db'];function respondWithStatusCode(_0x33e64a,_0x22fb84){_0x22fb84=_0x22fb84||0xcc;return function(_0x5b8686){if(_0x5b8686){return _0x33e64a['sendStatus'](_0x22fb84);}return _0x33e64a[_0xf962('0x18')](_0x22fb84)[_0xf962('0x19')]();};}function respondWithResult(_0x2fe2f1,_0x10e315){_0x10e315=_0x10e315||0xc8;return function(_0x2139eb){if(_0x2139eb){return _0x2fe2f1['status'](_0x10e315)[_0xf962('0x1a')](_0x2139eb);}};}function respondWithFilteredResult(_0x441ac2,_0x2eaaa1){return function(_0x3009bd){if(_0x3009bd){var _0x47f612=typeof _0x2eaaa1[_0xf962('0x1b')]==='undefined'&&typeof _0x2eaaa1[_0xf962('0x1c')]===_0xf962('0x1d');var _0x517414=_0x3009bd[_0xf962('0x1e')];var _0x5d11e9=_0x47f612?0x0:_0x2eaaa1[_0xf962('0x1b')];var _0x2ba028=_0x47f612?_0x3009bd[_0xf962('0x1e')]:_0x2eaaa1[_0xf962('0x1b')]+_0x2eaaa1[_0xf962('0x1c')];var _0x4b1930;if(_0x2ba028>=_0x517414){_0x2ba028=_0x517414;_0x4b1930=0xc8;}else{_0x4b1930=0xce;}_0x441ac2[_0xf962('0x18')](_0x4b1930);return _0x441ac2[_0xf962('0x1f')](_0xf962('0x20'),_0x5d11e9+'-'+_0x2ba028+'/'+_0x517414)['json'](_0x3009bd);}return null;};}function patchUpdates(_0x9c1003){return function(_0x2f8172){try{jsonpatch[_0xf962('0x21')](_0x2f8172,_0x9c1003,!![]);}catch(_0x317687){return BPromise[_0xf962('0x22')](_0x317687);}return _0x2f8172['save']();};}function saveUpdates(_0x1e7fe8,_0x24ad06){return function(_0x290e7c){if(_0x290e7c){return _0x290e7c[_0xf962('0x23')](_0x1e7fe8)[_0xf962('0x24')](function(_0x47e20b){return _0x47e20b;});}return null;};}function removeEntity(_0x4e3b9a,_0x583184){return function(_0x41a7d9){if(_0x41a7d9){return _0x41a7d9[_0xf962('0x25')]()[_0xf962('0x24')](function(){_0x4e3b9a[_0xf962('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fccb8,_0x44a31e){return function(_0x213661){if(!_0x213661){_0x1fccb8[_0xf962('0x26')](0x194);}return _0x213661;};}function handleError(_0x406d08,_0x263a09){_0x263a09=_0x263a09||0x1f4;return function(_0xb3d669){logger[_0xf962('0x27')](_0xb3d669[_0xf962('0x28')]);if(_0xb3d669[_0xf962('0x29')]){delete _0xb3d669[_0xf962('0x29')];}_0x406d08[_0xf962('0x18')](_0x263a09)[_0xf962('0x2a')](_0xb3d669);};}exports[_0xf962('0x2b')]=function(_0x116777,_0x48c33a){var _0x110a99={},_0x72d180={},_0x47e82e={'count':0x0,'rows':[]};var _0x50ab4a=_[_0xf962('0x2c')](db[_0xf962('0x2d')]['rawAttributes'],function(_0x3de930){return{'name':_0x3de930[_0xf962('0x2e')],'type':_0x3de930[_0xf962('0x2f')][_0xf962('0x30')]};});_0x72d180['model']=_[_0xf962('0x2c')](_0x50ab4a,_0xf962('0x29'));_0x72d180[_0xf962('0x31')]=_[_0xf962('0x32')](_0x116777[_0xf962('0x31')]);_0x72d180['filters']=_['intersection'](_0x72d180[_0xf962('0x33')],_0x72d180[_0xf962('0x31')]);_0x110a99[_0xf962('0x34')]=_[_0xf962('0x35')](_0x72d180[_0xf962('0x33')],qs[_0xf962('0x36')](_0x116777[_0xf962('0x31')]['fields']));_0x110a99[_0xf962('0x34')]=_0x110a99[_0xf962('0x34')]['length']?_0x110a99['attributes']:_0x72d180[_0xf962('0x33')];if(!_0x116777[_0xf962('0x31')][_0xf962('0x37')](_0xf962('0x38'))){_0x110a99['limit']=qs[_0xf962('0x1c')](_0x116777[_0xf962('0x31')][_0xf962('0x1c')]);_0x110a99['offset']=qs[_0xf962('0x1b')](_0x116777[_0xf962('0x31')]['offset']);}_0x110a99['order']=qs[_0xf962('0x39')](_0x116777[_0xf962('0x31')]['sort']);_0x110a99['where']=qs[_0xf962('0x3a')](_['pick'](_0x116777[_0xf962('0x31')],_0x72d180[_0xf962('0x3a')]),_0x50ab4a);if(_0x116777[_0xf962('0x31')][_0xf962('0x3b')]){_0x110a99[_0xf962('0x3c')]=_[_0xf962('0x3d')](_0x110a99[_0xf962('0x3c')],{'$or':_[_0xf962('0x2c')](_0x50ab4a,function(_0x20b62c){if(_0x20b62c[_0xf962('0x2f')]!=='VIRTUAL'){var _0x587085={};_0x587085[_0x20b62c[_0xf962('0x29')]]={'$like':'%'+_0x116777[_0xf962('0x31')]['filter']+'%'};return _0x587085;}})});}_0x110a99=_['merge']({},_0x110a99,_0x116777[_0xf962('0x3e')]);var _0x458555={'where':_0x110a99[_0xf962('0x3c')]};return db['Automation']['count'](_0x458555)[_0xf962('0x24')](function(_0x43f14e){_0x47e82e[_0xf962('0x1e')]=_0x43f14e;if(_0x116777[_0xf962('0x31')][_0xf962('0x3f')]){_0x110a99['include']=[{'all':!![]}];}return db['Automation'][_0xf962('0x40')](_0x110a99);})[_0xf962('0x24')](function(_0x353322){_0x47e82e[_0xf962('0x41')]=_0x353322;return _0x47e82e;})[_0xf962('0x24')](respondWithFilteredResult(_0x48c33a,_0x110a99))[_0xf962('0x42')](handleError(_0x48c33a,null));};exports['show']=function(_0x87dc65,_0x53ceb7){var _0x4eeb9d={'raw':![],'where':{'id':_0x87dc65[_0xf962('0x43')]['id']}},_0x251837={};_0x251837[_0xf962('0x33')]=_[_0xf962('0x32')](db[_0xf962('0x2d')][_0xf962('0x44')]);_0x251837[_0xf962('0x31')]=_[_0xf962('0x32')](_0x87dc65[_0xf962('0x31')]);_0x251837[_0xf962('0x3a')]=_['intersection'](_0x251837[_0xf962('0x33')],_0x251837['query']);_0x4eeb9d[_0xf962('0x34')]=_['intersection'](_0x251837[_0xf962('0x33')],qs[_0xf962('0x36')](_0x87dc65['query'][_0xf962('0x36')]));_0x4eeb9d['attributes']=_0x4eeb9d[_0xf962('0x34')]['length']?_0x4eeb9d['attributes']:_0x251837['model'];if(_0x87dc65[_0xf962('0x31')][_0xf962('0x3f')]){_0x4eeb9d[_0xf962('0x45')]=[{'all':!![]}];}_0x4eeb9d=_[_0xf962('0x3d')]({},_0x4eeb9d,_0x87dc65['options']);return db['Automation']['find'](_0x4eeb9d)[_0xf962('0x24')](handleEntityNotFound(_0x53ceb7,null))['then'](respondWithResult(_0x53ceb7,null))[_0xf962('0x42')](handleError(_0x53ceb7,null));};exports[_0xf962('0x46')]=function(_0x5af4f3,_0x4b7517){return db[_0xf962('0x2d')][_0xf962('0x46')](_0x5af4f3[_0xf962('0x47')],{})[_0xf962('0x24')](respondWithResult(_0x4b7517,0xc9))[_0xf962('0x42')](handleError(_0x4b7517,null));};exports[_0xf962('0x23')]=function(_0x43bc8b,_0x441898){if(_0x43bc8b[_0xf962('0x47')]['id']){delete _0x43bc8b[_0xf962('0x47')]['id'];}return db['Automation'][_0xf962('0x48')]({'where':{'id':_0x43bc8b[_0xf962('0x43')]['id']}})[_0xf962('0x24')](handleEntityNotFound(_0x441898,null))['then'](saveUpdates(_0x43bc8b[_0xf962('0x47')],null))[_0xf962('0x24')](respondWithResult(_0x441898,null))[_0xf962('0x42')](handleError(_0x441898,null));};exports['destroy']=function(_0x31b150,_0x4c0ff2){return db[_0xf962('0x2d')]['find']({'where':{'id':_0x31b150[_0xf962('0x43')]['id']}})[_0xf962('0x24')](handleEntityNotFound(_0x4c0ff2,null))[_0xf962('0x24')](removeEntity(_0x4c0ff2,null))['catch'](handleError(_0x4c0ff2,null));};exports[_0xf962('0x49')]=function(_0x3d442c,_0x4be170,_0x5c5db6){return db[_0xf962('0x4a')][_0xf962('0x48')]({'where':{'id':_0x3d442c[_0xf962('0x43')]['id']}})[_0xf962('0x24')](handleEntityNotFound(_0x4be170,null))[_0xf962('0x24')](function(_0x6904a4){if(_0x6904a4){return _0x6904a4['addConditions'](_0x3d442c[_0xf962('0x47')][_0xf962('0x4b')],_[_0xf962('0x4c')](_0x3d442c['body'],[_0xf962('0x4b'),'id'])||{});}})[_0xf962('0x24')](respondWithResult(_0x4be170,null))[_0xf962('0x42')](handleError(_0x4be170,null));};exports['getConditions']=function(_0x4dfff2,_0x221969,_0x136ae1){var _0x12765d={};var _0x1bc136={};var _0x1d9425;var _0x50f121;return db[_0xf962('0x2d')][_0xf962('0x4d')]({'where':{'id':_0x4dfff2[_0xf962('0x43')]['id']}})['then'](handleEntityNotFound(_0x221969,null))[_0xf962('0x24')](function(_0x267657){if(_0x267657){_0x1d9425=_0x267657;_0x1bc136['model']=_[_0xf962('0x32')](db['Condition'][_0xf962('0x44')]);_0x1bc136['query']=_['keys'](_0x4dfff2[_0xf962('0x31')]);_0x1bc136[_0xf962('0x3a')]=_['intersection'](_0x1bc136[_0xf962('0x33')],_0x1bc136[_0xf962('0x31')]);_0x12765d[_0xf962('0x34')]=_[_0xf962('0x35')](_0x1bc136[_0xf962('0x33')],qs['fields'](_0x4dfff2[_0xf962('0x31')][_0xf962('0x36')]));_0x12765d['attributes']=_0x12765d[_0xf962('0x34')][_0xf962('0x4e')]?_0x12765d[_0xf962('0x34')]:_0x1bc136[_0xf962('0x33')];_0x12765d[_0xf962('0x4f')]=qs[_0xf962('0x39')](_0x4dfff2['query']['sort']);_0x12765d[_0xf962('0x3c')]=qs[_0xf962('0x3a')](_['pick'](_0x4dfff2['query'],_0x1bc136[_0xf962('0x3a')]));if(_0x4dfff2[_0xf962('0x31')][_0xf962('0x3b')]){_0x12765d[_0xf962('0x3c')]=_[_0xf962('0x3d')](_0x12765d[_0xf962('0x3c')],{'$or':_[_0xf962('0x2c')](_0x12765d[_0xf962('0x34')],function(_0x2f5007){var _0x5899f9={};_0x5899f9[_0x2f5007]={'$like':'%'+_0x4dfff2[_0xf962('0x31')][_0xf962('0x3b')]+'%'};return _0x5899f9;})});}_0x12765d=_['merge']({},_0x12765d,_0x4dfff2[_0xf962('0x3e')]);return _0x1d9425[_0xf962('0x50')](_0x12765d);}})['then'](function(_0x2d1d09){if(_0x2d1d09){_0x50f121=_0x2d1d09[_0xf962('0x4e')];if(!_0x4dfff2[_0xf962('0x31')][_0xf962('0x37')]('nolimit')){_0x12765d[_0xf962('0x1c')]=qs[_0xf962('0x1c')](_0x4dfff2[_0xf962('0x31')][_0xf962('0x1c')]);_0x12765d[_0xf962('0x1b')]=qs['offset'](_0x4dfff2['query']['offset']);}return _0x1d9425[_0xf962('0x50')](_0x12765d);}})[_0xf962('0x24')](function(_0x42f419){if(_0x42f419){return _0x42f419?{'count':_0x50f121,'rows':_0x42f419}:null;}})[_0xf962('0x24')](respondWithResult(_0x221969,null))['catch'](handleError(_0x221969,null));};exports[_0xf962('0x51')]=function(_0x29bb7f,_0x4f91e0,_0x4bc129){return db['Action'][_0xf962('0x48')]({'where':{'id':_0x29bb7f[_0xf962('0x43')]['id']}})[_0xf962('0x24')](handleEntityNotFound(_0x4f91e0,null))[_0xf962('0x24')](function(_0x3c0069){if(_0x3c0069){return _0x3c0069['addActions'](_0x29bb7f[_0xf962('0x47')][_0xf962('0x4b')],_[_0xf962('0x4c')](_0x29bb7f[_0xf962('0x47')],['ids','id'])||{});}})[_0xf962('0x24')](respondWithResult(_0x4f91e0,null))['catch'](handleError(_0x4f91e0,null));};exports[_0xf962('0x52')]=function(_0x58cc27,_0x524854,_0x1476f3){var _0x1ac333={};var _0x285d63={};var _0x3044f9;var _0x3e8856;return db['Automation'][_0xf962('0x4d')]({'where':{'id':_0x58cc27['params']['id']}})[_0xf962('0x24')](handleEntityNotFound(_0x524854,null))['then'](function(_0x3fad81){if(_0x3fad81){_0x3044f9=_0x3fad81;_0x285d63[_0xf962('0x33')]=_['keys'](db[_0xf962('0x53')][_0xf962('0x44')]);_0x285d63[_0xf962('0x31')]=_[_0xf962('0x32')](_0x58cc27[_0xf962('0x31')]);_0x285d63['filters']=_[_0xf962('0x35')](_0x285d63[_0xf962('0x33')],_0x285d63['query']);_0x1ac333[_0xf962('0x34')]=_[_0xf962('0x35')](_0x285d63['model'],qs['fields'](_0x58cc27[_0xf962('0x31')][_0xf962('0x36')]));_0x1ac333[_0xf962('0x34')]=_0x1ac333[_0xf962('0x34')]['length']?_0x1ac333[_0xf962('0x34')]:_0x285d63[_0xf962('0x33')];_0x1ac333[_0xf962('0x4f')]=qs[_0xf962('0x39')](_0x58cc27['query'][_0xf962('0x39')]);_0x1ac333[_0xf962('0x3c')]=qs['filters'](_[_0xf962('0x54')](_0x58cc27['query'],_0x285d63[_0xf962('0x3a')]));if(_0x58cc27[_0xf962('0x31')][_0xf962('0x3b')]){_0x1ac333[_0xf962('0x3c')]=_[_0xf962('0x3d')](_0x1ac333[_0xf962('0x3c')],{'$or':_[_0xf962('0x2c')](_0x1ac333['attributes'],function(_0x3e9936){var _0x2c0679={};_0x2c0679[_0x3e9936]={'$like':'%'+_0x58cc27[_0xf962('0x31')][_0xf962('0x3b')]+'%'};return _0x2c0679;})});}_0x1ac333=_[_0xf962('0x3d')]({},_0x1ac333,_0x58cc27[_0xf962('0x3e')]);return _0x3044f9['getActions'](_0x1ac333);}})[_0xf962('0x24')](function(_0x213c0d){if(_0x213c0d){_0x3e8856=_0x213c0d['length'];if(!_0x58cc27['query'][_0xf962('0x37')]('nolimit')){_0x1ac333['limit']=qs['limit'](_0x58cc27[_0xf962('0x31')]['limit']);_0x1ac333['offset']=qs['offset'](_0x58cc27['query'][_0xf962('0x1b')]);}return _0x3044f9['getActions'](_0x1ac333);}})[_0xf962('0x24')](function(_0x1c7968){if(_0x1c7968){return _0x1c7968?{'count':_0x3e8856,'rows':_0x1c7968}:null;}})[_0xf962('0x24')](respondWithResult(_0x524854,null))['catch'](handleError(_0x524854,null));}; \ No newline at end of file +var _0x143d=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','Automation','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','sort','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x143d,0x9b));var _0xd143=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x143d[_0x2ae8ce];return _0x4bf686;};'use strict';var emlformat=require(_0xd143('0x0'));var rimraf=require(_0xd143('0x1'));var zipdir=require(_0xd143('0x2'));var jsonpatch=require(_0xd143('0x3'));var rp=require(_0xd143('0x4'));var moment=require(_0xd143('0x5'));var BPromise=require(_0xd143('0x6'));var Mustache=require(_0xd143('0x7'));var util=require(_0xd143('0x8'));var path=require(_0xd143('0x9'));var sox=require(_0xd143('0xa'));var csv=require('to-csv');var ejs=require(_0xd143('0xb'));var fs=require('fs');var fs_extra=require(_0xd143('0xc'));var _=require(_0xd143('0xd'));var squel=require('squel');var crypto=require(_0xd143('0xe'));var jsforce=require(_0xd143('0xf'));var deskjs=require(_0xd143('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd143('0x11'));var Papa=require(_0xd143('0x12'));var Redis=require(_0xd143('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd143('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd143('0x15'));var logger=require(_0xd143('0x16'))(_0xd143('0x17'));var utils=require(_0xd143('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd143('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9df6b7,_0x158f07){_0x158f07=_0x158f07||0xcc;return function(_0x579e81){if(_0x579e81){return _0x9df6b7[_0xd143('0x1a')](_0x158f07);}return _0x9df6b7[_0xd143('0x1b')](_0x158f07)['end']();};}function respondWithResult(_0x3bd70d,_0x4d9802){_0x4d9802=_0x4d9802||0xc8;return function(_0x2493eb){if(_0x2493eb){return _0x3bd70d[_0xd143('0x1b')](_0x4d9802)[_0xd143('0x1c')](_0x2493eb);}};}function respondWithFilteredResult(_0x126440,_0x3b07a0){return function(_0x5b54d0){if(_0x5b54d0){var _0x174b8b=typeof _0x3b07a0[_0xd143('0x1d')]===_0xd143('0x1e')&&typeof _0x3b07a0['limit']==='undefined';var _0x18485d=_0x5b54d0[_0xd143('0x1f')];var _0x2bc4d8=_0x174b8b?0x0:_0x3b07a0[_0xd143('0x1d')];var _0xc00b25=_0x174b8b?_0x5b54d0[_0xd143('0x1f')]:_0x3b07a0[_0xd143('0x1d')]+_0x3b07a0['limit'];var _0x3a0ca3;if(_0xc00b25>=_0x18485d){_0xc00b25=_0x18485d;_0x3a0ca3=0xc8;}else{_0x3a0ca3=0xce;}_0x126440[_0xd143('0x1b')](_0x3a0ca3);return _0x126440[_0xd143('0x20')](_0xd143('0x21'),_0x2bc4d8+'-'+_0xc00b25+'/'+_0x18485d)['json'](_0x5b54d0);}return null;};}function patchUpdates(_0x2a1728){return function(_0x17620a){try{jsonpatch[_0xd143('0x22')](_0x17620a,_0x2a1728,!![]);}catch(_0x23957b){return BPromise[_0xd143('0x23')](_0x23957b);}return _0x17620a['save']();};}function saveUpdates(_0x3c48a9,_0x1ebd7e){return function(_0x51c4d9){if(_0x51c4d9){return _0x51c4d9[_0xd143('0x24')](_0x3c48a9)[_0xd143('0x25')](function(_0x1472b8){return _0x1472b8;});}return null;};}function removeEntity(_0x59f80b,_0x50d48e){return function(_0x27fddc){if(_0x27fddc){return _0x27fddc[_0xd143('0x26')]()[_0xd143('0x25')](function(){_0x59f80b[_0xd143('0x1b')](0xcc)[_0xd143('0x27')]();});}};}function handleEntityNotFound(_0x1bab81,_0x100c5e){return function(_0x72e0e9){if(!_0x72e0e9){_0x1bab81['sendStatus'](0x194);}return _0x72e0e9;};}function handleError(_0x12ce00,_0x475a8d){_0x475a8d=_0x475a8d||0x1f4;return function(_0x32018d){logger[_0xd143('0x28')](_0x32018d[_0xd143('0x29')]);if(_0x32018d[_0xd143('0x2a')]){delete _0x32018d['name'];}_0x12ce00[_0xd143('0x1b')](_0x475a8d)[_0xd143('0x2b')](_0x32018d);};}exports['index']=function(_0x484d3c,_0x5ac3e1){var _0x29cecd={},_0x4bfdd2={},_0xbaec09={'count':0x0,'rows':[]};var _0x445cbe=_['map'](db[_0xd143('0x2c')][_0xd143('0x2d')],function(_0xaa7dd3){return{'name':_0xaa7dd3[_0xd143('0x2e')],'type':_0xaa7dd3['type']['key']};});_0x4bfdd2[_0xd143('0x2f')]=_['map'](_0x445cbe,_0xd143('0x2a'));_0x4bfdd2[_0xd143('0x30')]=_['keys'](_0x484d3c[_0xd143('0x30')]);_0x4bfdd2['filters']=_[_0xd143('0x31')](_0x4bfdd2['model'],_0x4bfdd2[_0xd143('0x30')]);_0x29cecd[_0xd143('0x32')]=_[_0xd143('0x31')](_0x4bfdd2[_0xd143('0x2f')],qs[_0xd143('0x33')](_0x484d3c[_0xd143('0x30')][_0xd143('0x33')]));_0x29cecd['attributes']=_0x29cecd[_0xd143('0x32')][_0xd143('0x34')]?_0x29cecd['attributes']:_0x4bfdd2['model'];if(!_0x484d3c[_0xd143('0x30')][_0xd143('0x35')](_0xd143('0x36'))){_0x29cecd['limit']=qs[_0xd143('0x37')](_0x484d3c[_0xd143('0x30')][_0xd143('0x37')]);_0x29cecd[_0xd143('0x1d')]=qs['offset'](_0x484d3c['query'][_0xd143('0x1d')]);}_0x29cecd[_0xd143('0x38')]=qs['sort'](_0x484d3c[_0xd143('0x30')]['sort']);_0x29cecd[_0xd143('0x39')]=qs['filters'](_[_0xd143('0x3a')](_0x484d3c[_0xd143('0x30')],_0x4bfdd2[_0xd143('0x3b')]),_0x445cbe);if(_0x484d3c['query'][_0xd143('0x3c')]){_0x29cecd[_0xd143('0x39')]=_[_0xd143('0x3d')](_0x29cecd[_0xd143('0x39')],{'$or':_[_0xd143('0x3e')](_0x445cbe,function(_0x12f6f6){if(_0x12f6f6['type']!==_0xd143('0x3f')){var _0x1a29e6={};_0x1a29e6[_0x12f6f6[_0xd143('0x2a')]]={'$like':'%'+_0x484d3c[_0xd143('0x30')][_0xd143('0x3c')]+'%'};return _0x1a29e6;}})});}_0x29cecd=_[_0xd143('0x3d')]({},_0x29cecd,_0x484d3c[_0xd143('0x40')]);var _0x19d74a={'where':_0x29cecd[_0xd143('0x39')]};return db[_0xd143('0x2c')][_0xd143('0x1f')](_0x19d74a)['then'](function(_0x53256b){_0xbaec09[_0xd143('0x1f')]=_0x53256b;if(_0x484d3c[_0xd143('0x30')][_0xd143('0x41')]){_0x29cecd[_0xd143('0x42')]=[{'all':!![]}];}return db['Automation'][_0xd143('0x43')](_0x29cecd);})[_0xd143('0x25')](function(_0x49ae20){_0xbaec09['rows']=_0x49ae20;return _0xbaec09;})['then'](respondWithFilteredResult(_0x5ac3e1,_0x29cecd))[_0xd143('0x44')](handleError(_0x5ac3e1,null));};exports['show']=function(_0x6adafa,_0x18631c){var _0x3cfcdd={'raw':![],'where':{'id':_0x6adafa[_0xd143('0x45')]['id']}},_0xd968bf={};_0xd968bf[_0xd143('0x2f')]=_[_0xd143('0x46')](db[_0xd143('0x2c')]['rawAttributes']);_0xd968bf[_0xd143('0x30')]=_['keys'](_0x6adafa['query']);_0xd968bf[_0xd143('0x3b')]=_['intersection'](_0xd968bf[_0xd143('0x2f')],_0xd968bf['query']);_0x3cfcdd[_0xd143('0x32')]=_[_0xd143('0x31')](_0xd968bf[_0xd143('0x2f')],qs['fields'](_0x6adafa['query'][_0xd143('0x33')]));_0x3cfcdd[_0xd143('0x32')]=_0x3cfcdd[_0xd143('0x32')][_0xd143('0x34')]?_0x3cfcdd[_0xd143('0x32')]:_0xd968bf[_0xd143('0x2f')];if(_0x6adafa[_0xd143('0x30')]['includeAll']){_0x3cfcdd[_0xd143('0x42')]=[{'all':!![]}];}_0x3cfcdd=_[_0xd143('0x3d')]({},_0x3cfcdd,_0x6adafa[_0xd143('0x40')]);return db[_0xd143('0x2c')][_0xd143('0x47')](_0x3cfcdd)['then'](handleEntityNotFound(_0x18631c,null))[_0xd143('0x25')](respondWithResult(_0x18631c,null))[_0xd143('0x44')](handleError(_0x18631c,null));};exports[_0xd143('0x48')]=function(_0x19a283,_0x1c6192){return db[_0xd143('0x2c')][_0xd143('0x48')](_0x19a283['body'],{})[_0xd143('0x25')](respondWithResult(_0x1c6192,0xc9))[_0xd143('0x44')](handleError(_0x1c6192,null));};exports[_0xd143('0x24')]=function(_0x18ccf4,_0x8e3e9f){if(_0x18ccf4['body']['id']){delete _0x18ccf4[_0xd143('0x49')]['id'];}return db[_0xd143('0x2c')][_0xd143('0x47')]({'where':{'id':_0x18ccf4['params']['id']}})['then'](handleEntityNotFound(_0x8e3e9f,null))[_0xd143('0x25')](saveUpdates(_0x18ccf4['body'],null))[_0xd143('0x25')](respondWithResult(_0x8e3e9f,null))[_0xd143('0x44')](handleError(_0x8e3e9f,null));};exports['destroy']=function(_0x42876f,_0x4b8b4b){return db[_0xd143('0x2c')][_0xd143('0x47')]({'where':{'id':_0x42876f[_0xd143('0x45')]['id']}})[_0xd143('0x25')](handleEntityNotFound(_0x4b8b4b,null))[_0xd143('0x25')](removeEntity(_0x4b8b4b,null))['catch'](handleError(_0x4b8b4b,null));};exports[_0xd143('0x4a')]=function(_0x23c5e2,_0x4473f6,_0x46f0c9){return db[_0xd143('0x4b')][_0xd143('0x47')]({'where':{'id':_0x23c5e2[_0xd143('0x45')]['id']}})['then'](handleEntityNotFound(_0x4473f6,null))[_0xd143('0x25')](function(_0x25691a){if(_0x25691a){return _0x25691a['addConditions'](_0x23c5e2[_0xd143('0x49')][_0xd143('0x4c')],_[_0xd143('0x4d')](_0x23c5e2[_0xd143('0x49')],[_0xd143('0x4c'),'id'])||{});}})[_0xd143('0x25')](respondWithResult(_0x4473f6,null))[_0xd143('0x44')](handleError(_0x4473f6,null));};exports[_0xd143('0x4e')]=function(_0xa3b757,_0x3570ea,_0x2dc7b7){var _0x5ea2c6={};var _0x541b29={};var _0x52d1c6;var _0x1ac3a9;return db[_0xd143('0x2c')][_0xd143('0x4f')]({'where':{'id':_0xa3b757['params']['id']}})[_0xd143('0x25')](handleEntityNotFound(_0x3570ea,null))[_0xd143('0x25')](function(_0x9a3e98){if(_0x9a3e98){_0x52d1c6=_0x9a3e98;_0x541b29[_0xd143('0x2f')]=_[_0xd143('0x46')](db[_0xd143('0x4b')][_0xd143('0x2d')]);_0x541b29[_0xd143('0x30')]=_[_0xd143('0x46')](_0xa3b757[_0xd143('0x30')]);_0x541b29['filters']=_['intersection'](_0x541b29[_0xd143('0x2f')],_0x541b29[_0xd143('0x30')]);_0x5ea2c6[_0xd143('0x32')]=_[_0xd143('0x31')](_0x541b29['model'],qs['fields'](_0xa3b757[_0xd143('0x30')]['fields']));_0x5ea2c6[_0xd143('0x32')]=_0x5ea2c6[_0xd143('0x32')][_0xd143('0x34')]?_0x5ea2c6[_0xd143('0x32')]:_0x541b29['model'];_0x5ea2c6[_0xd143('0x38')]=qs[_0xd143('0x50')](_0xa3b757[_0xd143('0x30')][_0xd143('0x50')]);_0x5ea2c6[_0xd143('0x39')]=qs[_0xd143('0x3b')](_[_0xd143('0x3a')](_0xa3b757[_0xd143('0x30')],_0x541b29[_0xd143('0x3b')]));if(_0xa3b757['query'][_0xd143('0x3c')]){_0x5ea2c6[_0xd143('0x39')]=_[_0xd143('0x3d')](_0x5ea2c6[_0xd143('0x39')],{'$or':_[_0xd143('0x3e')](_0x5ea2c6[_0xd143('0x32')],function(_0x5e1fe2){var _0x23fe07={};_0x23fe07[_0x5e1fe2]={'$like':'%'+_0xa3b757[_0xd143('0x30')][_0xd143('0x3c')]+'%'};return _0x23fe07;})});}_0x5ea2c6=_[_0xd143('0x3d')]({},_0x5ea2c6,_0xa3b757[_0xd143('0x40')]);return _0x52d1c6[_0xd143('0x4e')](_0x5ea2c6);}})['then'](function(_0x6a447c){if(_0x6a447c){_0x1ac3a9=_0x6a447c[_0xd143('0x34')];if(!_0xa3b757[_0xd143('0x30')]['hasOwnProperty'](_0xd143('0x36'))){_0x5ea2c6[_0xd143('0x37')]=qs[_0xd143('0x37')](_0xa3b757['query'][_0xd143('0x37')]);_0x5ea2c6['offset']=qs['offset'](_0xa3b757[_0xd143('0x30')]['offset']);}return _0x52d1c6[_0xd143('0x4e')](_0x5ea2c6);}})['then'](function(_0x365c84){if(_0x365c84){return _0x365c84?{'count':_0x1ac3a9,'rows':_0x365c84}:null;}})[_0xd143('0x25')](respondWithResult(_0x3570ea,null))[_0xd143('0x44')](handleError(_0x3570ea,null));};exports[_0xd143('0x51')]=function(_0x2a7526,_0x290ddd,_0x2cf66b){return db[_0xd143('0x52')][_0xd143('0x47')]({'where':{'id':_0x2a7526[_0xd143('0x45')]['id']}})[_0xd143('0x25')](handleEntityNotFound(_0x290ddd,null))['then'](function(_0x3aa96c){if(_0x3aa96c){return _0x3aa96c[_0xd143('0x51')](_0x2a7526[_0xd143('0x49')][_0xd143('0x4c')],_[_0xd143('0x4d')](_0x2a7526[_0xd143('0x49')],[_0xd143('0x4c'),'id'])||{});}})[_0xd143('0x25')](respondWithResult(_0x290ddd,null))[_0xd143('0x44')](handleError(_0x290ddd,null));};exports[_0xd143('0x53')]=function(_0x2c5632,_0x5275fa,_0x15f3f9){var _0x81c765={};var _0x5b3e6b={};var _0x26189d;var _0x58a510;return db[_0xd143('0x2c')][_0xd143('0x4f')]({'where':{'id':_0x2c5632[_0xd143('0x45')]['id']}})[_0xd143('0x25')](handleEntityNotFound(_0x5275fa,null))[_0xd143('0x25')](function(_0x35e827){if(_0x35e827){_0x26189d=_0x35e827;_0x5b3e6b[_0xd143('0x2f')]=_[_0xd143('0x46')](db[_0xd143('0x52')]['rawAttributes']);_0x5b3e6b[_0xd143('0x30')]=_[_0xd143('0x46')](_0x2c5632['query']);_0x5b3e6b[_0xd143('0x3b')]=_[_0xd143('0x31')](_0x5b3e6b[_0xd143('0x2f')],_0x5b3e6b[_0xd143('0x30')]);_0x81c765[_0xd143('0x32')]=_[_0xd143('0x31')](_0x5b3e6b[_0xd143('0x2f')],qs[_0xd143('0x33')](_0x2c5632[_0xd143('0x30')][_0xd143('0x33')]));_0x81c765[_0xd143('0x32')]=_0x81c765[_0xd143('0x32')][_0xd143('0x34')]?_0x81c765[_0xd143('0x32')]:_0x5b3e6b[_0xd143('0x2f')];_0x81c765[_0xd143('0x38')]=qs[_0xd143('0x50')](_0x2c5632[_0xd143('0x30')][_0xd143('0x50')]);_0x81c765[_0xd143('0x39')]=qs[_0xd143('0x3b')](_[_0xd143('0x3a')](_0x2c5632[_0xd143('0x30')],_0x5b3e6b[_0xd143('0x3b')]));if(_0x2c5632[_0xd143('0x30')][_0xd143('0x3c')]){_0x81c765[_0xd143('0x39')]=_[_0xd143('0x3d')](_0x81c765[_0xd143('0x39')],{'$or':_['map'](_0x81c765[_0xd143('0x32')],function(_0x419c40){var _0x464482={};_0x464482[_0x419c40]={'$like':'%'+_0x2c5632[_0xd143('0x30')][_0xd143('0x3c')]+'%'};return _0x464482;})});}_0x81c765=_['merge']({},_0x81c765,_0x2c5632[_0xd143('0x40')]);return _0x26189d[_0xd143('0x53')](_0x81c765);}})[_0xd143('0x25')](function(_0x468e8d){if(_0x468e8d){_0x58a510=_0x468e8d[_0xd143('0x34')];if(!_0x2c5632[_0xd143('0x30')][_0xd143('0x35')](_0xd143('0x36'))){_0x81c765['limit']=qs['limit'](_0x2c5632[_0xd143('0x30')][_0xd143('0x37')]);_0x81c765[_0xd143('0x1d')]=qs[_0xd143('0x1d')](_0x2c5632['query'][_0xd143('0x1d')]);}return _0x26189d['getActions'](_0x81c765);}})[_0xd143('0x25')](function(_0x28e71b){if(_0x28e71b){return _0x28e71b?{'count':_0x58a510,'rows':_0x28e71b}:null;}})[_0xd143('0x25')](respondWithResult(_0x5275fa,null))[_0xd143('0x44')](handleError(_0x5275fa,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f4f83fb..0d6dcd5 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 _0x8ed0=['request-promise','path','rimraf','./automation.attributes','define','Automation','lodash','util','../../config/logger'];(function(_0x3d3531,_0x1e4748){var _0x299781=function(_0x3b90e8){while(--_0x3b90e8){_0x3d3531['push'](_0x3d3531['shift']());}};_0x299781(++_0x1e4748);}(_0x8ed0,0x9f));var _0x08ed=function(_0x348592,_0x120103){_0x348592=_0x348592-0x0;var _0x1bd9a9=_0x8ed0[_0x348592];return _0x1bd9a9;};'use strict';var _=require(_0x08ed('0x0'));var util=require(_0x08ed('0x1'));var logger=require(_0x08ed('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x08ed('0x3'));var fs=require('fs');var path=require(_0x08ed('0x4'));var rimraf=require(_0x08ed('0x5'));var config=require('../../config/environment');var attributes=require(_0x08ed('0x6'));module['exports']=function(_0x23466f,_0x56d97c){return _0x23466f[_0x08ed('0x7')](_0x08ed('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbe5=['./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40c659,_0x45d967){var _0x1726fb=function(_0x47b3cc){while(--_0x47b3cc){_0x40c659['push'](_0x40c659['shift']());}};_0x1726fb(++_0x45d967);}(_0xbbe5,0xf3));var _0x5bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5bbe('0x0'));var logger=require(_0x5bbe('0x1'))(_0x5bbe('0x2'));var moment=require(_0x5bbe('0x3'));var BPromise=require(_0x5bbe('0x4'));var rp=require(_0x5bbe('0x5'));var fs=require('fs');var path=require(_0x5bbe('0x6'));var rimraf=require(_0x5bbe('0x7'));var config=require(_0x5bbe('0x8'));var attributes=require(_0x5bbe('0x9'));module[_0x5bbe('0xa')]=function(_0xc80d29,_0x2d72da){return _0xc80d29[_0x5bbe('0xb')](_0x5bbe('0xc'),attributes,{'tableName':_0x5bbe('0xd'),'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 74979d5..a604052 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 _0xfece=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','ioredis','../../config/logger','client','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfece,0x19e));var _0xefec=function(_0x121ebe,_0x2f75b4){_0x121ebe=_0x121ebe-0x0;var _0x22a3a4=_0xfece[_0x121ebe];return _0x22a3a4;};'use strict';var _=require(_0xefec('0x0'));var util=require(_0xefec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefec('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefec('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefec('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33c52b,_0x26d699,_0x261465){return new BPromise(function(_0x3d6496,_0x212838){return client[_0xefec('0x5')](_0x33c52b,_0x261465)['then'](function(_0xd5755c){logger[_0xefec('0x6')](_0xefec('0x7'),_0x26d699,_0xefec('0x8'));logger[_0xefec('0x9')](_0xefec('0xa'),_0x26d699,'request\x20sent',JSON['stringify'](_0xd5755c));if(_0xd5755c[_0xefec('0xb')]){if(_0xd5755c[_0xefec('0xb')]['code']===0x1f4){logger[_0xefec('0xb')]('Automation,\x20%s,\x20%s',_0x26d699,_0xd5755c[_0xefec('0xb')][_0xefec('0xc')]);return _0x212838(_0xd5755c[_0xefec('0xb')][_0xefec('0xc')]);}logger[_0xefec('0xb')]('Automation,\x20%s,\x20%s',_0x26d699,_0xd5755c[_0xefec('0xb')][_0xefec('0xc')]);return _0x3d6496(_0xd5755c[_0xefec('0xb')][_0xefec('0xc')]);}else{logger[_0xefec('0x6')]('Automation,\x20%s,\x20%s',_0x26d699,_0xefec('0x8'));_0x3d6496(_0xd5755c[_0xefec('0xd')][_0xefec('0xc')]);}})[_0xefec('0xe')](function(_0x214f7d){logger[_0xefec('0xb')](_0xefec('0x7'),_0x26d699,_0x214f7d);_0x212838(_0x214f7d);});});} \ No newline at end of file +var _0xb4f8=['client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x43d6c8,_0xf35105){var _0x180716=function(_0xf6cf49){while(--_0xf6cf49){_0x43d6c8['push'](_0x43d6c8['shift']());}};_0x180716(++_0xf35105);}(_0xb4f8,0x83));var _0x8b4f=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb4f8[_0x710815];return _0x5b3b89;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var moment=require(_0x8b4f('0x1'));var BPromise=require(_0x8b4f('0x2'));var rs=require(_0x8b4f('0x3'));var fs=require('fs');var Redis=require(_0x8b4f('0x4'));var db=require(_0x8b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4f('0x6'))('rpc');var config=require(_0x8b4f('0x7'));var jayson=require(_0x8b4f('0x8'));var client=jayson[_0x8b4f('0x9')][_0x8b4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eefde,_0x557bc0,_0x2dfe1c){return new BPromise(function(_0xa91c09,_0x40042b){return client['request'](_0x2eefde,_0x2dfe1c)[_0x8b4f('0xb')](function(_0x13d37a){logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,_0x8b4f('0xe'));logger['debug'](_0x8b4f('0xf'),_0x557bc0,_0x8b4f('0xe'),JSON['stringify'](_0x13d37a));if(_0x13d37a[_0x8b4f('0x10')]){if(_0x13d37a[_0x8b4f('0x10')]['code']===0x1f4){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x13d37a['error'][_0x8b4f('0x11')]);return _0x40042b(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}logger[_0x8b4f('0x10')]('Automation,\x20%s,\x20%s',_0x557bc0,_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);return _0xa91c09(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}else{logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,'request\x20sent');_0xa91c09(_0x13d37a[_0x8b4f('0x12')][_0x8b4f('0x11')]);}})[_0x8b4f('0x13')](function(_0x1b4b9f){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x1b4b9f);_0x40042b(_0x1b4b9f);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ea9cabc..b69830a 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 _0xc1c3=['get','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','/:id','show'];(function(_0x3e36b6,_0x43de3b){var _0x4a3a36=function(_0x13f6a0){while(--_0x13f6a0){_0x3e36b6['push'](_0x3e36b6['shift']());}};_0x4a3a36(++_0x43de3b);}(_0xc1c3,0x1b5));var _0x3c1c=function(_0x3dc1bb,_0x312fce){_0x3dc1bb=_0x3dc1bb-0x0;var _0x699f8=_0xc1c3[_0x3dc1bb];return _0x699f8;};'use strict';var multer=require(_0x3c1c('0x0'));var util=require(_0x3c1c('0x1'));var path=require(_0x3c1c('0x2'));var timeout=require(_0x3c1c('0x3'));var express=require(_0x3c1c('0x4'));var router=express[_0x3c1c('0x5')]();var fs_extra=require(_0x3c1c('0x6'));var auth=require(_0x3c1c('0x7'));var interaction=require(_0x3c1c('0x8'));var config=require('../../config/environment');var controller=require(_0x3c1c('0x9'));router['get']('/',auth[_0x3c1c('0xa')](),controller['index']);router['get'](_0x3c1c('0xb'),auth['isAuthenticated'](),controller[_0x3c1c('0xc')]);router[_0x3c1c('0xd')](_0x3c1c('0xe'),auth[_0x3c1c('0xa')](),controller[_0x3c1c('0xf')]);router[_0x3c1c('0xd')](_0x3c1c('0x10'),auth[_0x3c1c('0xa')](),controller[_0x3c1c('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c1c('0x12')]);router[_0x3c1c('0x13')](_0x3c1c('0xe'),auth[_0x3c1c('0xa')](),controller['addConditions']);router['post'](_0x3c1c('0x10'),auth['isAuthenticated'](),controller[_0x3c1c('0x14')]);router[_0x3c1c('0x15')](_0x3c1c('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3c1c('0x16')]('/:id',auth[_0x3c1c('0xa')](),controller[_0x3c1c('0x17')]);module[_0x3c1c('0x18')]=router; \ No newline at end of file +var _0x057a=['/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','index','get'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x057a,0x1a6));var _0xa057=function(_0x4db468,_0x1bc74b){_0x4db468=_0x4db468-0x0;var _0x505c1f=_0x057a[_0x4db468];return _0x505c1f;};'use strict';var multer=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var path=require(_0xa057('0x2'));var timeout=require('connect-timeout');var express=require(_0xa057('0x3'));var router=express['Router']();var fs_extra=require(_0xa057('0x4'));var auth=require(_0xa057('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa057('0x6'));var controller=require(_0xa057('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa057('0x8')]);router[_0xa057('0x9')](_0xa057('0xa'),auth[_0xa057('0xb')](),controller[_0xa057('0xc')]);router[_0xa057('0x9')](_0xa057('0xd'),auth[_0xa057('0xb')](),controller[_0xa057('0xe')]);router[_0xa057('0x9')](_0xa057('0xf'),auth[_0xa057('0xb')](),controller[_0xa057('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa057('0x11')]);router[_0xa057('0x12')](_0xa057('0xd'),auth['isAuthenticated'](),controller[_0xa057('0x13')]);router[_0xa057('0x12')](_0xa057('0xf'),auth[_0xa057('0xb')](),controller[_0xa057('0x14')]);router['put']('/:id',auth[_0xa057('0xb')](),controller['update']);router[_0xa057('0x15')](_0xa057('0xa'),auth['isAuthenticated'](),controller[_0xa057('0x16')]);module[_0xa057('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cb83ce5..4aa58a7 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 _0x2fbd=['#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)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xe0f53,_0x59a578){var _0x2a27f3=function(_0x13d3e3){while(--_0x13d3e3){_0xe0f53['push'](_0xe0f53['shift']());}};_0x2a27f3(++_0x59a578);}(_0x2fbd,0x12c));var _0xd2fb=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x2fbd[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0xd2fb('0x0')]={'name':{'type':Sequelize[_0xd2fb('0x1')],'unique':_0xd2fb('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd2fb('0x3')](_0xd2fb('0x4')),'allowNull':![],'defaultValue':_0xd2fb('0x4')},'description':{'type':Sequelize[_0xd2fb('0x1')]},'active':{'type':Sequelize[_0xd2fb('0x5')],'defaultValue':0x0,'comment':_0xd2fb('0x6')},'limitCalls':{'type':Sequelize[_0xd2fb('0x7')](0x4)[_0xd2fb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xd2fb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd2fb('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2fb('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd2fb('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'comment':_0xd2fb('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd2fb('0x7')](0x5)[_0xd2fb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd2fb('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd2fb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd2fb('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xd2fb('0x3')]('always',_0xd2fb('0xe'),_0xd2fb('0xf')),'defaultValue':_0xd2fb('0x10')},'dialAMDActive':{'type':Sequelize[_0xd2fb('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd2fb('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd2fb('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd2fb('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xd2fb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd2fb('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd2fb('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd2fb('0x7')](0x5)[_0xd2fb('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd2fb('0x7')](0x9)[_0xd2fb('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd2fb('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd2fb('0x17'),_0xd2fb('0x18')),'defaultValue':_0xd2fb('0x17')},'dialPrefix':{'type':Sequelize[_0xd2fb('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd2fb('0x7')](0x3)[_0xd2fb('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2fb('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd2fb('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd2fb('0x7')](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2fb('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0xd2fb('0x7')](0x5)[_0xd2fb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2fb('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0x1d')},'dialMachineMaxRetry':{'type':Sequelize[_0xd2fb('0x7')](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2fb('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2fb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd2fb('0x7')](0x3)[_0xd2fb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2fb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2fb('0x20')}}; \ No newline at end of file +var _0x6b09=['DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x41273a,_0x578908){var _0x576125=function(_0x224555){while(--_0x224555){_0x41273a['push'](_0x41273a['shift']());}};_0x576125(++_0x578908);}(_0x6b09,0x17d));var _0x96b0=function(_0x17ac5b,_0x1a2d16){_0x17ac5b=_0x17ac5b-0x0;var _0x2dcec9=_0x6b09[_0x17ac5b];return _0x2dcec9;};'use strict';var Sequelize=require(_0x96b0('0x0'));module[_0x96b0('0x1')]={'name':{'type':Sequelize[_0x96b0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x96b0('0x3')](_0x96b0('0x4')),'allowNull':![],'defaultValue':_0x96b0('0x4')},'description':{'type':Sequelize[_0x96b0('0x2')]},'active':{'type':Sequelize[_0x96b0('0x5')],'defaultValue':0x0,'comment':_0x96b0('0x6')},'limitCalls':{'type':Sequelize[_0x96b0('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x96b0('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x96b0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x96b0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x96b0('0x7')](0x3)[_0x96b0('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x96b0('0x7')](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x96b0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x96b0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x96b0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x96b0('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x96b0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x96b0('0x7')](0x3)[_0x96b0('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x96b0('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x96b0('0x2')],'defaultValue':_0x96b0('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x96b0('0x3')](_0x96b0('0x11'),'never',_0x96b0('0x12')),'defaultValue':_0x96b0('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x96b0('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x96b0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x96b0('0x7')](0x9)[_0x96b0('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x96b0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x96b0('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x96b0('0x7')](0x9)[_0x96b0('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x96b0('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x96b0('0x7')](0x9)[_0x96b0('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x96b0('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x96b0('0x7')](0x9)[_0x96b0('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x96b0('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x96b0('0x7')](0x9)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x96b0('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x96b0('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x96b0('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x96b0('0x3')](_0x96b0('0x1a'),'ASC'),'defaultValue':_0x96b0('0x1a')},'dialPrefix':{'type':Sequelize[_0x96b0('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x96b0('0x7')](0x3)[_0x96b0('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x96b0('0x1b')},'dialCutDigit':{'type':Sequelize[_0x96b0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x96b0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x96b0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x96b0('0x7')](0x5)[_0x96b0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x96b0('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x96b0('0x7')](0x5)[_0x96b0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x96b0('0x7')](0x3)[_0x96b0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x96b0('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index dece392..f91c14d 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 _0x6665=['status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','name','send','index','map','rawAttributes','fieldName','type','query','keys','attributes','intersection','model','fields','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','getHoppers','CmHopper','nolimit','order','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','findOne','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5b4e57,_0x106758){var _0x295bfe=function(_0x2e3519){while(--_0x2e3519){_0x5b4e57['push'](_0x5b4e57['shift']());}};_0x295bfe(++_0x106758);}(_0x6665,0x178));var _0x5666=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x6665[_0x102ff9];return _0x24fa97;};'use strict';var emlformat=require(_0x5666('0x0'));var rimraf=require(_0x5666('0x1'));var zipdir=require(_0x5666('0x2'));var jsonpatch=require(_0x5666('0x3'));var rp=require(_0x5666('0x4'));var moment=require(_0x5666('0x5'));var BPromise=require(_0x5666('0x6'));var Mustache=require(_0x5666('0x7'));var util=require(_0x5666('0x8'));var path=require(_0x5666('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5666('0xa'));var fs=require('fs');var fs_extra=require(_0x5666('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5666('0xc'));var jsforce=require(_0x5666('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5666('0xe'));var querystring=require(_0x5666('0xf'));var Papa=require(_0x5666('0x10'));var Redis=require(_0x5666('0x11'));var authService=require(_0x5666('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5666('0x13'));var hardwareService=require(_0x5666('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5666('0x15'));var config=require(_0x5666('0x16'));var licenseUtil=require(_0x5666('0x17'));var db=require(_0x5666('0x18'))['db'];function respondWithStatusCode(_0x5c62e2,_0x3591b1){_0x3591b1=_0x3591b1||0xcc;return function(_0x5bb700){if(_0x5bb700){return _0x5c62e2[_0x5666('0x19')](_0x3591b1);}return _0x5c62e2[_0x5666('0x1a')](_0x3591b1)[_0x5666('0x1b')]();};}function respondWithResult(_0x699ae8,_0x3d4fc6){_0x3d4fc6=_0x3d4fc6||0xc8;return function(_0x55eb2e){if(_0x55eb2e){return _0x699ae8[_0x5666('0x1a')](_0x3d4fc6)['json'](_0x55eb2e);}};}function respondWithFilteredResult(_0x160163,_0xf76548){return function(_0x56cb79){if(_0x56cb79){var _0x53fc77=typeof _0xf76548[_0x5666('0x1c')]==='undefined'&&typeof _0xf76548[_0x5666('0x1d')]===_0x5666('0x1e');var _0x19409e=_0x56cb79[_0x5666('0x1f')];var _0x2409e6=_0x53fc77?0x0:_0xf76548[_0x5666('0x1c')];var _0xb5abcb=_0x53fc77?_0x56cb79['count']:_0xf76548[_0x5666('0x1c')]+_0xf76548[_0x5666('0x1d')];var _0x29557c;if(_0xb5abcb>=_0x19409e){_0xb5abcb=_0x19409e;_0x29557c=0xc8;}else{_0x29557c=0xce;}_0x160163[_0x5666('0x1a')](_0x29557c);return _0x160163[_0x5666('0x20')](_0x5666('0x21'),_0x2409e6+'-'+_0xb5abcb+'/'+_0x19409e)[_0x5666('0x22')](_0x56cb79);}return null;};}function patchUpdates(_0xc2370d){return function(_0x2a2bd3){try{jsonpatch[_0x5666('0x23')](_0x2a2bd3,_0xc2370d,!![]);}catch(_0xd66bf4){return BPromise[_0x5666('0x24')](_0xd66bf4);}return _0x2a2bd3[_0x5666('0x25')]();};}function saveUpdates(_0x2f772c,_0x13a624){return function(_0x46fdf7){if(_0x46fdf7){return _0x46fdf7[_0x5666('0x26')](_0x2f772c)[_0x5666('0x27')](function(_0x1d1940){return _0x1d1940;});}return null;};}function removeEntity(_0x13e8b3,_0x5be2e6){return function(_0x12b824){if(_0x12b824){return _0x12b824[_0x5666('0x28')]()['then'](function(){var _0x4414bc=_0x12b824[_0x5666('0x29')]({'plain':!![]});var _0x232fce=_0x5666('0x2a');return db['UserProfileResource'][_0x5666('0x28')]({'where':{'type':_0x232fce,'resourceId':_0x4414bc['id']}})[_0x5666('0x27')](function(){return _0x12b824;});})[_0x5666('0x27')](function(){_0x13e8b3[_0x5666('0x1a')](0xcc)[_0x5666('0x1b')]();});}};}function handleEntityNotFound(_0x2d14bb,_0x3b8a23){return function(_0x2735e8){if(!_0x2735e8){_0x2d14bb[_0x5666('0x19')](0x194);}return _0x2735e8;};}function handleError(_0x4bab4a,_0x2e47ca){_0x2e47ca=_0x2e47ca||0x1f4;return function(_0x21fe0f){logger['error'](_0x21fe0f['stack']);if(_0x21fe0f['name']){delete _0x21fe0f[_0x5666('0x2b')];}_0x4bab4a[_0x5666('0x1a')](_0x2e47ca)[_0x5666('0x2c')](_0x21fe0f);};}exports[_0x5666('0x2d')]=function(_0x2865d7,_0x4e1d88){var _0x4fd977={},_0x5d6d8e={},_0x42c9b3={'count':0x0,'rows':[]};var _0x2f9416=_[_0x5666('0x2e')](db['Campaign'][_0x5666('0x2f')],function(_0x5c2a61){return{'name':_0x5c2a61[_0x5666('0x30')],'type':_0x5c2a61[_0x5666('0x31')]['key']};});_0x5d6d8e['model']=_[_0x5666('0x2e')](_0x2f9416,_0x5666('0x2b'));_0x5d6d8e[_0x5666('0x32')]=_[_0x5666('0x33')](_0x2865d7['query']);_0x5d6d8e['filters']=_['intersection'](_0x5d6d8e['model'],_0x5d6d8e[_0x5666('0x32')]);_0x4fd977[_0x5666('0x34')]=_[_0x5666('0x35')](_0x5d6d8e[_0x5666('0x36')],qs[_0x5666('0x37')](_0x2865d7[_0x5666('0x32')][_0x5666('0x37')]));_0x4fd977[_0x5666('0x34')]=_0x4fd977[_0x5666('0x34')]['length']?_0x4fd977[_0x5666('0x34')]:_0x5d6d8e[_0x5666('0x36')];if(!_0x2865d7['query'][_0x5666('0x38')]('nolimit')){_0x4fd977['limit']=qs[_0x5666('0x1d')](_0x2865d7[_0x5666('0x32')][_0x5666('0x1d')]);_0x4fd977[_0x5666('0x1c')]=qs[_0x5666('0x1c')](_0x2865d7[_0x5666('0x32')][_0x5666('0x1c')]);}_0x4fd977['order']=qs[_0x5666('0x39')](_0x2865d7['query'][_0x5666('0x39')]);_0x4fd977[_0x5666('0x3a')]=qs[_0x5666('0x3b')](_[_0x5666('0x3c')](_0x2865d7[_0x5666('0x32')],_0x5d6d8e['filters']),_0x2f9416);if(_0x2865d7[_0x5666('0x32')][_0x5666('0x3d')]){_0x4fd977[_0x5666('0x3a')]=_['merge'](_0x4fd977[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x2f9416,function(_0x2b870f){if(_0x2b870f['type']!==_0x5666('0x3e')){var _0x23a556={};_0x23a556[_0x2b870f[_0x5666('0x2b')]]={'$like':'%'+_0x2865d7[_0x5666('0x32')]['filter']+'%'};return _0x23a556;}})});}_0x4fd977=_[_0x5666('0x3f')]({},_0x4fd977,_0x2865d7[_0x5666('0x40')]);var _0x462e0f={'where':_0x4fd977[_0x5666('0x3a')]};return db[_0x5666('0x41')][_0x5666('0x1f')](_0x462e0f)[_0x5666('0x27')](function(_0xb62fd9){_0x42c9b3[_0x5666('0x1f')]=_0xb62fd9;if(_0x2865d7[_0x5666('0x32')][_0x5666('0x42')]){_0x4fd977['include']=[{'all':!![]}];}return db[_0x5666('0x41')][_0x5666('0x43')](_0x4fd977);})['then'](function(_0x4ab8ad){_0x42c9b3[_0x5666('0x44')]=_0x4ab8ad;return _0x42c9b3;})['then'](respondWithFilteredResult(_0x4e1d88,_0x4fd977))[_0x5666('0x45')](handleError(_0x4e1d88,null));};exports['show']=function(_0x26981c,_0x330407){var _0x4a6e0c={'raw':![],'where':{'id':_0x26981c[_0x5666('0x46')]['id']}},_0x4c616e={};_0x4c616e[_0x5666('0x36')]=_['keys'](db['Campaign'][_0x5666('0x2f')]);_0x4c616e['query']=_[_0x5666('0x33')](_0x26981c['query']);_0x4c616e[_0x5666('0x3b')]=_[_0x5666('0x35')](_0x4c616e[_0x5666('0x36')],_0x4c616e['query']);_0x4a6e0c[_0x5666('0x34')]=_[_0x5666('0x35')](_0x4c616e['model'],qs['fields'](_0x26981c[_0x5666('0x32')][_0x5666('0x37')]));_0x4a6e0c['attributes']=_0x4a6e0c['attributes']['length']?_0x4a6e0c['attributes']:_0x4c616e[_0x5666('0x36')];if(_0x26981c[_0x5666('0x32')][_0x5666('0x42')]){_0x4a6e0c[_0x5666('0x47')]=[{'all':!![]}];}_0x4a6e0c=_[_0x5666('0x3f')]({},_0x4a6e0c,_0x26981c[_0x5666('0x40')]);return db[_0x5666('0x41')][_0x5666('0x48')](_0x4a6e0c)[_0x5666('0x27')](handleEntityNotFound(_0x330407,null))['then'](respondWithResult(_0x330407,null))[_0x5666('0x45')](handleError(_0x330407,null));};exports[_0x5666('0x49')]=function(_0x354351,_0x1f039f){return db[_0x5666('0x41')][_0x5666('0x49')](_0x354351[_0x5666('0x4a')],{})[_0x5666('0x27')](function(_0x4a5a63){var _0x41af59=_0x354351['user'][_0x5666('0x29')]({'plain':!![]});if(!_0x41af59)throw new Error(_0x5666('0x4b'));if(_0x41af59[_0x5666('0x4c')]===_0x5666('0x4d')){var _0x4e0ea5=_0x4a5a63[_0x5666('0x29')]({'plain':!![]});var _0x1b4479=_0x5666('0x2a');return db[_0x5666('0x4e')][_0x5666('0x48')]({'where':{'name':_0x1b4479,'userProfileId':_0x41af59[_0x5666('0x4f')]},'raw':!![]})['then'](function(_0x288b68){if(_0x288b68&&_0x288b68[_0x5666('0x50')]===0x0){return db['UserProfileResource'][_0x5666('0x49')]({'name':_0x4e0ea5[_0x5666('0x2b')],'resourceId':_0x4e0ea5['id'],'type':_0x288b68[_0x5666('0x2b')],'sectionId':_0x288b68['id']},{})[_0x5666('0x27')](function(){return _0x4a5a63;});}else{return _0x4a5a63;}})[_0x5666('0x45')](function(_0x4b78f3){logger[_0x5666('0x51')](_0x5666('0x52'),_0x4b78f3);throw _0x4b78f3;});}return _0x4a5a63;})[_0x5666('0x27')](respondWithResult(_0x1f039f,0xc9))['catch'](handleError(_0x1f039f,null));};exports['clone']=function(_0xa0dd66,_0x582d7d){var _0x423652={'where':{'id':_0xa0dd66[_0x5666('0x46')]['id']}},_0x3396d9={};_0x3396d9[_0x5666('0x36')]=_['keys'](db[_0x5666('0x41')][_0x5666('0x2f')]);_0x423652[_0x5666('0x34')]=_[_0x5666('0x35')](_0x3396d9[_0x5666('0x36')],qs[_0x5666('0x37')](_0xa0dd66[_0x5666('0x32')][_0x5666('0x37')]));_0x423652['attributes']=_0x423652['attributes'][_0x5666('0x53')]?_0x423652[_0x5666('0x34')]:_0x3396d9['model'];if(_0xa0dd66[_0x5666('0x32')][_0x5666('0x42')]){_0x423652[_0x5666('0x47')]=[{'all':!![]}];}_0x423652=_[_0x5666('0x3f')]({},_0x423652,_0xa0dd66[_0x5666('0x40')]);return db['Campaign'][_0x5666('0x48')](_0x423652)[_0x5666('0x27')](handleEntityNotFound(_0x582d7d,null))['then'](function(_0x37cb5c){if(_0x37cb5c){var _0x1b8cc2=_0x37cb5c[_0x5666('0x29')]({'plain':!![]});_0x1b8cc2=qs[_0x5666('0x54')](_0x1b8cc2,['id',_0x5666('0x55'),_0x5666('0x56')]);_0xa0dd66[_0x5666('0x4a')]=_[_0x5666('0x54')](_0xa0dd66[_0x5666('0x4a')],['id','createdAt',_0x5666('0x56')]);return db[_0x5666('0x41')][_0x5666('0x49')](_[_0x5666('0x3f')](_0x1b8cc2,_0xa0dd66[_0x5666('0x4a')]),{'include':_0xa0dd66[_0x5666('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1a6861){var _0xdcd985=_0xa0dd66[_0x5666('0x4d')]['get']({'plain':!![]});if(!_0xdcd985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdcd985[_0x5666('0x4c')]===_0x5666('0x4d')){var _0x1ffbcb=_0x1a6861['get']({'plain':!![]});var _0x2bc70='IvrCampaigns';return db[_0x5666('0x4e')][_0x5666('0x48')]({'where':{'name':_0x2bc70,'userProfileId':_0xdcd985[_0x5666('0x4f')]},'raw':!![]})[_0x5666('0x27')](function(_0x1d2029){if(_0x1d2029&&_0x1d2029[_0x5666('0x50')]===0x0){return db['UserProfileResource'][_0x5666('0x49')]({'name':_0x1ffbcb[_0x5666('0x2b')],'resourceId':_0x1ffbcb['id'],'type':_0x1d2029[_0x5666('0x2b')],'sectionId':_0x1d2029['id']},{})[_0x5666('0x27')](function(){return _0x1a6861;});}else{return _0x1a6861;}})[_0x5666('0x45')](function(_0x4638ee){logger['error'](_0x5666('0x52'),_0x4638ee);throw _0x4638ee;});}return _0x1a6861;});}})[_0x5666('0x27')](respondWithResult(_0x582d7d,0xc9))[_0x5666('0x45')](handleError(_0x582d7d,null));};exports['update']=function(_0x235882,_0x179d80){if(_0x235882[_0x5666('0x4a')]['id']){delete _0x235882[_0x5666('0x4a')]['id'];}return db[_0x5666('0x41')]['find']({'where':{'id':_0x235882[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x179d80,null))['then'](saveUpdates(_0x235882[_0x5666('0x4a')],null))['then'](respondWithResult(_0x179d80,null))[_0x5666('0x45')](handleError(_0x179d80,null));};exports[_0x5666('0x28')]=function(_0x1776c5,_0x587515){return db['Campaign'][_0x5666('0x48')]({'where':{'id':_0x1776c5['params']['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x587515,null))[_0x5666('0x27')](removeEntity(_0x587515,null))['catch'](handleError(_0x587515,null));};exports[_0x5666('0x57')]=function(_0x4ff3b6,_0x1708bc,_0x7b4621){var _0x4d681a={'raw':!![],'where':{}};var _0x1e047b={};var _0x56ab98={'count':0x0,'rows':[]};return db[_0x5666('0x41')]['findOne']({'where':{'id':_0x4ff3b6[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x1708bc,null))[_0x5666('0x27')](function(_0x2dbfd3){if(_0x2dbfd3){_0x1e047b[_0x5666('0x36')]=_[_0x5666('0x33')](db[_0x5666('0x58')][_0x5666('0x2f')]);_0x1e047b['query']=_[_0x5666('0x33')](_0x4ff3b6[_0x5666('0x32')]);_0x1e047b[_0x5666('0x3b')]=_[_0x5666('0x35')](_0x1e047b[_0x5666('0x36')],_0x1e047b[_0x5666('0x32')]);_0x4d681a['attributes']=_[_0x5666('0x35')](_0x1e047b[_0x5666('0x36')],qs['fields'](_0x4ff3b6[_0x5666('0x32')][_0x5666('0x37')]));_0x4d681a[_0x5666('0x34')]=_0x4d681a['attributes'][_0x5666('0x53')]?_0x4d681a[_0x5666('0x34')]:_0x1e047b[_0x5666('0x36')];if(!_0x4ff3b6[_0x5666('0x32')][_0x5666('0x38')](_0x5666('0x59'))){_0x4d681a[_0x5666('0x1d')]=qs['limit'](_0x4ff3b6[_0x5666('0x32')][_0x5666('0x1d')]);_0x4d681a[_0x5666('0x1c')]=qs['offset'](_0x4ff3b6[_0x5666('0x32')]['offset']);}_0x4d681a[_0x5666('0x5a')]=qs[_0x5666('0x39')](_0x4ff3b6[_0x5666('0x32')][_0x5666('0x39')]);_0x4d681a['where']=qs[_0x5666('0x3b')](_[_0x5666('0x3c')](_0x4ff3b6[_0x5666('0x32')],_0x1e047b[_0x5666('0x3b')]));_0x4d681a[_0x5666('0x3a')][_0x5666('0x5b')]=_0x2dbfd3['id'];if(_0x4ff3b6[_0x5666('0x32')]['filter']){_0x4d681a[_0x5666('0x3a')]=_[_0x5666('0x3f')](_0x4d681a['where'],{'$or':_[_0x5666('0x2e')](_0x4d681a[_0x5666('0x34')],function(_0x198dfc){var _0x7b1cf={};_0x7b1cf[_0x198dfc]={'$like':'%'+_0x4ff3b6['query']['filter']+'%'};return _0x7b1cf;})});}_0x4d681a=_[_0x5666('0x3f')]({},_0x4d681a,_0x4ff3b6[_0x5666('0x40')]);return db[_0x5666('0x58')][_0x5666('0x1f')]({'where':_0x4d681a[_0x5666('0x3a')]})[_0x5666('0x27')](function(_0x199149){_0x56ab98['count']=_0x199149;if(_0x4ff3b6[_0x5666('0x32')][_0x5666('0x42')]){_0x4d681a[_0x5666('0x47')]=[{'all':!![]}];}return db[_0x5666('0x58')][_0x5666('0x43')](_0x4d681a);})['then'](function(_0x511d40){_0x56ab98['rows']=_0x511d40;return _0x56ab98;});}})[_0x5666('0x27')](respondWithFilteredResult(_0x1708bc,_0x4d681a))[_0x5666('0x45')](handleError(_0x1708bc,null));};exports[_0x5666('0x5c')]=function(_0x225d5c,_0x38b7d2,_0x46b641){var _0x5e3dc={'raw':!![],'where':{}};var _0x30344b={};var _0x3c8e24={'count':0x0,'rows':[]};return db[_0x5666('0x41')]['findOne']({'where':{'id':_0x225d5c[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x38b7d2,null))[_0x5666('0x27')](function(_0x186e4e){if(_0x186e4e){_0x30344b[_0x5666('0x36')]=_[_0x5666('0x33')](db['CmHopperHistory']['rawAttributes']);_0x30344b[_0x5666('0x32')]=_[_0x5666('0x33')](_0x225d5c['query']);_0x30344b[_0x5666('0x3b')]=_['intersection'](_0x30344b['model'],_0x30344b['query']);_0x5e3dc[_0x5666('0x34')]=_[_0x5666('0x35')](_0x30344b['model'],qs[_0x5666('0x37')](_0x225d5c[_0x5666('0x32')][_0x5666('0x37')]));_0x5e3dc['attributes']=_0x5e3dc[_0x5666('0x34')][_0x5666('0x53')]?_0x5e3dc['attributes']:_0x30344b[_0x5666('0x36')];if(!_0x225d5c['query'][_0x5666('0x38')](_0x5666('0x59'))){_0x5e3dc['limit']=qs[_0x5666('0x1d')](_0x225d5c[_0x5666('0x32')]['limit']);_0x5e3dc['offset']=qs['offset'](_0x225d5c['query']['offset']);}_0x5e3dc['order']=qs[_0x5666('0x39')](_0x225d5c[_0x5666('0x32')][_0x5666('0x39')]);_0x5e3dc['where']=qs[_0x5666('0x3b')](_[_0x5666('0x3c')](_0x225d5c[_0x5666('0x32')],_0x30344b[_0x5666('0x3b')]));_0x5e3dc[_0x5666('0x3a')][_0x5666('0x5b')]=_0x186e4e['id'];if(_0x225d5c[_0x5666('0x32')][_0x5666('0x3d')]){_0x5e3dc['where']=_[_0x5666('0x3f')](_0x5e3dc[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x5e3dc[_0x5666('0x34')],function(_0x4a71a4){var _0x27fe76={};_0x27fe76[_0x4a71a4]={'$like':'%'+_0x225d5c[_0x5666('0x32')][_0x5666('0x3d')]+'%'};return _0x27fe76;})});}_0x5e3dc=_[_0x5666('0x3f')]({},_0x5e3dc,_0x225d5c['options']);return db[_0x5666('0x5d')][_0x5666('0x1f')]({'where':_0x5e3dc['where']})[_0x5666('0x27')](function(_0xbf4ab7){_0x3c8e24['count']=_0xbf4ab7;if(_0x225d5c[_0x5666('0x32')][_0x5666('0x42')]){_0x5e3dc['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x5666('0x43')](_0x5e3dc);})['then'](function(_0xba9c8b){_0x3c8e24[_0x5666('0x44')]=_0xba9c8b;return _0x3c8e24;});}})['then'](respondWithFilteredResult(_0x38b7d2,_0x5e3dc))['catch'](handleError(_0x38b7d2,null));};exports['getHopperFinals']=function(_0x247f8a,_0x19a7be,_0x2d7913){var _0x34cd4e={'raw':!![],'where':{}};var _0xb4e02={};var _0x49c0f7={'count':0x0,'rows':[]};return db[_0x5666('0x41')]['findOne']({'where':{'id':_0x247f8a[_0x5666('0x46')]['id']}})['then'](handleEntityNotFound(_0x19a7be,null))['then'](function(_0x59f96d){if(_0x59f96d){_0xb4e02[_0x5666('0x36')]=_['keys'](db['CmHopperFinal'][_0x5666('0x2f')]);_0xb4e02[_0x5666('0x32')]=_['keys'](_0x247f8a['query']);_0xb4e02[_0x5666('0x3b')]=_['intersection'](_0xb4e02['model'],_0xb4e02[_0x5666('0x32')]);_0x34cd4e[_0x5666('0x34')]=_[_0x5666('0x35')](_0xb4e02[_0x5666('0x36')],qs[_0x5666('0x37')](_0x247f8a['query'][_0x5666('0x37')]));_0x34cd4e[_0x5666('0x34')]=_0x34cd4e[_0x5666('0x34')][_0x5666('0x53')]?_0x34cd4e['attributes']:_0xb4e02[_0x5666('0x36')];if(!_0x247f8a[_0x5666('0x32')][_0x5666('0x38')](_0x5666('0x59'))){_0x34cd4e['limit']=qs[_0x5666('0x1d')](_0x247f8a[_0x5666('0x32')]['limit']);_0x34cd4e['offset']=qs['offset'](_0x247f8a[_0x5666('0x32')][_0x5666('0x1c')]);}_0x34cd4e[_0x5666('0x5a')]=qs[_0x5666('0x39')](_0x247f8a['query']['sort']);_0x34cd4e[_0x5666('0x3a')]=qs[_0x5666('0x3b')](_[_0x5666('0x3c')](_0x247f8a[_0x5666('0x32')],_0xb4e02[_0x5666('0x3b')]));_0x34cd4e[_0x5666('0x3a')][_0x5666('0x5b')]=_0x59f96d['id'];if(_0x247f8a[_0x5666('0x32')][_0x5666('0x3d')]){_0x34cd4e['where']=_[_0x5666('0x3f')](_0x34cd4e[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x34cd4e['attributes'],function(_0x3a4114){var _0x418d7a={};_0x418d7a[_0x3a4114]={'$like':'%'+_0x247f8a[_0x5666('0x32')]['filter']+'%'};return _0x418d7a;})});}_0x34cd4e=_['merge']({},_0x34cd4e,_0x247f8a[_0x5666('0x40')]);return db['CmHopperFinal']['count']({'where':_0x34cd4e['where']})[_0x5666('0x27')](function(_0x5abac7){_0x49c0f7['count']=_0x5abac7;if(_0x247f8a[_0x5666('0x32')]['includeAll']){_0x34cd4e[_0x5666('0x47')]=[{'all':!![]}];}return db[_0x5666('0x5e')]['findAll'](_0x34cd4e);})[_0x5666('0x27')](function(_0x3a569c){_0x49c0f7['rows']=_0x3a569c;return _0x49c0f7;});}})[_0x5666('0x27')](respondWithFilteredResult(_0x19a7be,_0x34cd4e))[_0x5666('0x45')](handleError(_0x19a7be,null));};exports['getHopperBlacks']=function(_0x2ff0b2,_0x17346e,_0x32d583){var _0x547c2e={'raw':!![],'where':{}};var _0x28dea4={};var _0x5a6c33={'count':0x0,'rows':[]};return db[_0x5666('0x41')][_0x5666('0x5f')]({'where':{'id':_0x2ff0b2[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x17346e,null))[_0x5666('0x27')](function(_0x560f19){if(_0x560f19){_0x28dea4['model']=_[_0x5666('0x33')](db[_0x5666('0x60')][_0x5666('0x2f')]);_0x28dea4[_0x5666('0x32')]=_[_0x5666('0x33')](_0x2ff0b2[_0x5666('0x32')]);_0x28dea4[_0x5666('0x3b')]=_[_0x5666('0x35')](_0x28dea4[_0x5666('0x36')],_0x28dea4[_0x5666('0x32')]);_0x547c2e[_0x5666('0x34')]=_['intersection'](_0x28dea4[_0x5666('0x36')],qs['fields'](_0x2ff0b2[_0x5666('0x32')][_0x5666('0x37')]));_0x547c2e[_0x5666('0x34')]=_0x547c2e[_0x5666('0x34')]['length']?_0x547c2e['attributes']:_0x28dea4[_0x5666('0x36')];if(!_0x2ff0b2[_0x5666('0x32')]['hasOwnProperty']('nolimit')){_0x547c2e[_0x5666('0x1d')]=qs['limit'](_0x2ff0b2[_0x5666('0x32')]['limit']);_0x547c2e[_0x5666('0x1c')]=qs['offset'](_0x2ff0b2[_0x5666('0x32')][_0x5666('0x1c')]);}_0x547c2e['order']=qs[_0x5666('0x39')](_0x2ff0b2[_0x5666('0x32')][_0x5666('0x39')]);_0x547c2e['where']=qs[_0x5666('0x3b')](_['pick'](_0x2ff0b2[_0x5666('0x32')],_0x28dea4[_0x5666('0x3b')]));_0x547c2e['where']['CampaignId']=_0x560f19['id'];if(_0x2ff0b2[_0x5666('0x32')][_0x5666('0x3d')]){_0x547c2e[_0x5666('0x3a')]=_[_0x5666('0x3f')](_0x547c2e[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x547c2e['attributes'],function(_0x92472a){var _0x129d6d={};_0x129d6d[_0x92472a]={'$like':'%'+_0x2ff0b2[_0x5666('0x32')]['filter']+'%'};return _0x129d6d;})});}_0x547c2e=_[_0x5666('0x3f')]({},_0x547c2e,_0x2ff0b2[_0x5666('0x40')]);return db[_0x5666('0x60')][_0x5666('0x1f')]({'where':_0x547c2e[_0x5666('0x3a')]})[_0x5666('0x27')](function(_0x306f57){_0x5a6c33[_0x5666('0x1f')]=_0x306f57;if(_0x2ff0b2[_0x5666('0x32')][_0x5666('0x42')]){_0x547c2e[_0x5666('0x47')]=[{'all':!![]}];}return db[_0x5666('0x60')][_0x5666('0x43')](_0x547c2e);})[_0x5666('0x27')](function(_0x1902ba){_0x5a6c33[_0x5666('0x44')]=_0x1902ba;return _0x5a6c33;});}})['then'](respondWithFilteredResult(_0x17346e,_0x547c2e))['catch'](handleError(_0x17346e,null));};exports[_0x5666('0x61')]=function(_0xdcc47,_0x2cf633,_0x10a4af){var _0x25042d={};var _0x3e2013={};var _0x366789;var _0x599042;return db['Campaign'][_0x5666('0x5f')]({'where':{'id':_0xdcc47[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x2cf633,null))[_0x5666('0x27')](function(_0x47919a){if(_0x47919a){_0x366789=_0x47919a;_0x3e2013[_0x5666('0x36')]=_[_0x5666('0x33')](db[_0x5666('0x62')][_0x5666('0x2f')]);_0x3e2013['query']=_[_0x5666('0x33')](_0xdcc47[_0x5666('0x32')]);_0x3e2013[_0x5666('0x3b')]=_[_0x5666('0x35')](_0x3e2013[_0x5666('0x36')],_0x3e2013[_0x5666('0x32')]);_0x25042d[_0x5666('0x34')]=_[_0x5666('0x35')](_0x3e2013['model'],qs[_0x5666('0x37')](_0xdcc47[_0x5666('0x32')][_0x5666('0x37')]));_0x25042d['attributes']=_0x25042d['attributes'][_0x5666('0x53')]?_0x25042d[_0x5666('0x34')]:_0x3e2013[_0x5666('0x36')];_0x25042d[_0x5666('0x5a')]=qs[_0x5666('0x39')](_0xdcc47['query'][_0x5666('0x39')]);_0x25042d['where']=qs[_0x5666('0x3b')](_[_0x5666('0x3c')](_0xdcc47[_0x5666('0x32')],_0x3e2013[_0x5666('0x3b')]));if(_0xdcc47[_0x5666('0x32')]['filter']){_0x25042d[_0x5666('0x3a')]=_[_0x5666('0x3f')](_0x25042d[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x25042d['attributes'],function(_0xb3c492){var _0x56faf7={};_0x56faf7[_0xb3c492]={'$like':'%'+_0xdcc47[_0x5666('0x32')][_0x5666('0x3d')]+'%'};return _0x56faf7;})});}_0x25042d=_[_0x5666('0x3f')]({},_0x25042d,_0xdcc47[_0x5666('0x40')]);return _0x366789[_0x5666('0x61')](_0x25042d);}})['then'](function(_0x332f20){if(_0x332f20){_0x599042=_0x332f20['length'];if(!_0xdcc47[_0x5666('0x32')][_0x5666('0x38')]('nolimit')){_0x25042d[_0x5666('0x1d')]=qs['limit'](_0xdcc47[_0x5666('0x32')][_0x5666('0x1d')]);_0x25042d['offset']=qs[_0x5666('0x1c')](_0xdcc47[_0x5666('0x32')][_0x5666('0x1c')]);}return _0x366789['getLists'](_0x25042d);}})[_0x5666('0x27')](function(_0x43de53){if(_0x43de53){return _0x43de53?{'count':_0x599042,'rows':_0x43de53}:null;}})[_0x5666('0x27')](respondWithResult(_0x2cf633,null))[_0x5666('0x45')](handleError(_0x2cf633,null));};exports['addLists']=function(_0x6fcfac,_0x20b865,_0x268c1e){var _0x5e9c3f,_0x1a66ab;return db[_0x5666('0x41')][_0x5666('0x48')]({'where':{'id':_0x6fcfac['params']['id']}})['then'](handleEntityNotFound(_0x20b865,null))[_0x5666('0x27')](function(_0x30b397){if(_0x30b397){_0x1a66ab=_0x30b397;return _0x30b397[_0x5666('0x63')](_0x6fcfac[_0x5666('0x4a')][_0x5666('0x64')],_['omit'](_0x6fcfac['body'],['ids','id'])||{});}return null;})['spread'](function(_0x446f30){var _0x1d3d52;_0x5e9c3f=_0x446f30||[];var _0x591e5f=[];if(_0x446f30){for(var _0x529f76=0x0;_0x529f76<_0x446f30[_0x5666('0x53')];_0x529f76+=0x1){var _0x4dd2b1=_0x446f30[_0x529f76][_0x5666('0x29')]({'plain':!![]});_0x1a66ab[_0x5666('0x65')]=_0x6fcfac[_0x5666('0x4a')][_0x5666('0x65')]?_0x6fcfac['body'][_0x5666('0x65')]:_0x1a66ab[_0x5666('0x65')];switch(_0x1a66ab[_0x5666('0x65')]){case _0x5666('0x66'):_0x1d3d52=squel[_0x5666('0x67')]()[_0x5666('0x68')]('cm_hopper')[_0x5666('0x69')]([_0x5666('0x6a'),_0x5666('0x6b'),_0x5666('0x6c'),'ListId',_0x5666('0x5b'),'createdAt',_0x5666('0x56')],squel[_0x5666('0x6d')]()['field']('phone','phone')[_0x5666('0x6e')](_0x5666('0x6f'),_0x5666('0x6b'))[_0x5666('0x6e')]('id',_0x5666('0x6c'))[_0x5666('0x6e')](_0x4dd2b1[_0x5666('0x70')][_0x5666('0x71')](),_0x5666('0x72'))[_0x5666('0x6e')](_0x6fcfac[_0x5666('0x46')]['id'][_0x5666('0x71')](),_0x5666('0x5b'))['field'](_0x5666('0x6f'),_0x5666('0x55'))['field']('NOW()',_0x5666('0x56'))[_0x5666('0x73')](_0x5666('0x74'))[_0x5666('0x3a')](_0x5666('0x75'))['where'](_0x5666('0x76'),_0x4dd2b1[_0x5666('0x70')][_0x5666('0x71')]())['where'](_0x5666('0x77'))['where'](_0x5666('0x78'),squel[_0x5666('0x6d')]()['field'](_0x5666('0x79'))['from']('cm_hopper_final')['where'](_0x5666('0x7a'),_0x6fcfac['params']['id'][_0x5666('0x71')]()))[_0x5666('0x3a')](_0x5666('0x78'),squel['select']()[_0x5666('0x6e')](_0x5666('0x7b'))[_0x5666('0x73')](_0x5666('0x7c'))[_0x5666('0x3a')](_0x5666('0x7a'),_0x6fcfac[_0x5666('0x46')]['id'][_0x5666('0x71')]())))['toString']();break;case _0x5666('0x7d'):_0x1d3d52=squel[_0x5666('0x67')]()[_0x5666('0x68')](_0x5666('0x7c'))[_0x5666('0x69')]([_0x5666('0x6a'),'scheduledAt',_0x5666('0x6c'),_0x5666('0x72'),'CampaignId','createdAt',_0x5666('0x56')],squel['select']()[_0x5666('0x6e')]('phone',_0x5666('0x6a'))[_0x5666('0x6e')](_0x5666('0x6f'),_0x5666('0x6b'))[_0x5666('0x6e')]('id',_0x5666('0x6c'))['field'](_0x4dd2b1[_0x5666('0x70')]['toString'](),_0x5666('0x72'))[_0x5666('0x6e')](_0x6fcfac['params']['id'][_0x5666('0x71')](),_0x5666('0x5b'))[_0x5666('0x6e')](_0x5666('0x6f'),'createdAt')[_0x5666('0x6e')](_0x5666('0x6f'),_0x5666('0x56'))[_0x5666('0x73')](_0x5666('0x74'))[_0x5666('0x3a')](_0x5666('0x75'))[_0x5666('0x3a')](_0x5666('0x76'),_0x4dd2b1['CmListId'][_0x5666('0x71')]())[_0x5666('0x3a')](_0x5666('0x77'))[_0x5666('0x3a')](_0x5666('0x78'),squel['select']()[_0x5666('0x6e')](_0x5666('0x7b'))[_0x5666('0x73')](_0x5666('0x7c'))[_0x5666('0x3a')]('CampaignId\x20=\x20?',_0x6fcfac['params']['id'][_0x5666('0x71')]())))[_0x5666('0x71')]();break;default:_0x1d3d52=squel['insert']()[_0x5666('0x68')]('cm_hopper')[_0x5666('0x69')]([_0x5666('0x6a'),_0x5666('0x6b'),'ContactId',_0x5666('0x72'),_0x5666('0x5b'),_0x5666('0x55'),_0x5666('0x56')],squel[_0x5666('0x6d')]()['field'](_0x5666('0x6a'),_0x5666('0x6a'))['field'](_0x5666('0x6f'),_0x5666('0x6b'))['field']('id',_0x5666('0x6c'))[_0x5666('0x6e')](_0x4dd2b1[_0x5666('0x70')][_0x5666('0x71')](),_0x5666('0x72'))[_0x5666('0x6e')](_0x6fcfac[_0x5666('0x46')]['id'][_0x5666('0x71')](),_0x5666('0x5b'))['field'](_0x5666('0x6f'),_0x5666('0x55'))[_0x5666('0x6e')](_0x5666('0x6f'),_0x5666('0x56'))[_0x5666('0x73')](_0x5666('0x74'))[_0x5666('0x3a')](_0x5666('0x75'))['where']('ListId\x20=\x20?',_0x4dd2b1[_0x5666('0x70')]['toString']())[_0x5666('0x3a')](_0x5666('0x77')))[_0x5666('0x71')]();}_0x591e5f[_0x5666('0x7e')](db[_0x5666('0x7f')][_0x5666('0x32')](_0x1d3d52));}return BPromise[_0x5666('0x80')](_0x591e5f);}})[_0x5666('0x27')](function(){return _0x5e9c3f;})[_0x5666('0x27')](respondWithResult(_0x20b865,null))[_0x5666('0x45')](handleError(_0x20b865,null));};exports[_0x5666('0x81')]=function(_0x51c882,_0x2de1c7,_0x98809){return db[_0x5666('0x41')][_0x5666('0x48')]({'where':{'id':_0x51c882[_0x5666('0x46')]['id']}})['then'](handleEntityNotFound(_0x2de1c7,null))[_0x5666('0x27')](function(_0x4e0237){if(_0x4e0237){return _0x4e0237['removeLists'](_0x51c882['query'][_0x5666('0x64')]);}})[_0x5666('0x27')](function(_0x4643aa){if(_0x4643aa){return db[_0x5666('0x58')][_0x5666('0x28')]({'where':{'ListId':_0x51c882[_0x5666('0x32')]['ids'],'CampaignId':_0x51c882['params']['id']}})[_0x5666('0x27')](function(){return _0x4643aa;});}})['then'](respondWithStatusCode(_0x2de1c7,null))[_0x5666('0x45')](handleError(_0x2de1c7,null));};exports[_0x5666('0x82')]=function(_0x39a191,_0x31fe46,_0x1ee599){var _0x443404={};var _0x3a07c9={};var _0x4fff77;var _0x4be772;return db[_0x5666('0x41')][_0x5666('0x5f')]({'where':{'id':_0x39a191['params']['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x31fe46,null))['then'](function(_0x10d386){if(_0x10d386){_0x4fff77=_0x10d386;_0x3a07c9[_0x5666('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x3a07c9['query']=_[_0x5666('0x33')](_0x39a191['query']);_0x3a07c9[_0x5666('0x3b')]=_[_0x5666('0x35')](_0x3a07c9['model'],_0x3a07c9[_0x5666('0x32')]);_0x443404[_0x5666('0x34')]=_[_0x5666('0x35')](_0x3a07c9['model'],qs[_0x5666('0x37')](_0x39a191['query'][_0x5666('0x37')]));_0x443404['attributes']=_0x443404['attributes']['length']?_0x443404[_0x5666('0x34')]:_0x3a07c9[_0x5666('0x36')];_0x443404[_0x5666('0x5a')]=qs[_0x5666('0x39')](_0x39a191[_0x5666('0x32')]['sort']);_0x443404[_0x5666('0x3a')]=qs[_0x5666('0x3b')](_['pick'](_0x39a191[_0x5666('0x32')],_0x3a07c9[_0x5666('0x3b')]));if(_0x39a191[_0x5666('0x32')]['filter']){_0x443404[_0x5666('0x3a')]=_['merge'](_0x443404[_0x5666('0x3a')],{'$or':_[_0x5666('0x2e')](_0x443404[_0x5666('0x34')],function(_0x3954ba){var _0x10de1e={};_0x10de1e[_0x3954ba]={'$like':'%'+_0x39a191[_0x5666('0x32')][_0x5666('0x3d')]+'%'};return _0x10de1e;})});}_0x443404=_[_0x5666('0x3f')]({},_0x443404,_0x39a191[_0x5666('0x40')]);return _0x4fff77[_0x5666('0x82')](_0x443404);}})[_0x5666('0x27')](function(_0x3fac2a){if(_0x3fac2a){_0x4be772=_0x3fac2a[_0x5666('0x53')];if(!_0x39a191[_0x5666('0x32')][_0x5666('0x38')](_0x5666('0x59'))){_0x443404[_0x5666('0x1d')]=qs[_0x5666('0x1d')](_0x39a191[_0x5666('0x32')][_0x5666('0x1d')]);_0x443404['offset']=qs[_0x5666('0x1c')](_0x39a191['query'][_0x5666('0x1c')]);}return _0x4fff77[_0x5666('0x82')](_0x443404);}})[_0x5666('0x27')](function(_0xa0a59f){if(_0xa0a59f){return _0xa0a59f?{'count':_0x4be772,'rows':_0xa0a59f}:null;}})[_0x5666('0x27')](respondWithResult(_0x31fe46,null))[_0x5666('0x45')](handleError(_0x31fe46,null));};exports['addBlackLists']=function(_0x43b835,_0x4b9bfe,_0x55dfd5){var _0x57c933,_0x135ea6;return db['Campaign'][_0x5666('0x48')]({'where':{'id':_0x43b835[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x4b9bfe,null))[_0x5666('0x27')](function(_0x46865f){if(_0x46865f){_0x135ea6=_0x46865f;return _0x46865f['addBlackLists'](_0x43b835[_0x5666('0x4a')][_0x5666('0x64')],_[_0x5666('0x54')](_0x43b835['body'],[_0x5666('0x64'),'id'])||{});}return null;})[_0x5666('0x83')](function(_0x212a25){var _0xdb9568;_0x57c933=_0x212a25||[];var _0x3924b3=[];if(_0x212a25){for(var _0x4c528a=0x0;_0x4c528a<_0x212a25[_0x5666('0x53')];_0x4c528a+=0x1){var _0x3a27be=_0x212a25[_0x4c528a]['get']({'plain':!![]});_0xdb9568=squel[_0x5666('0x67')]()['into'](_0x5666('0x84'))['fromQuery'](['phone',_0x5666('0x6c'),_0x5666('0x72'),_0x5666('0x5b'),_0x5666('0x55'),_0x5666('0x56')],squel[_0x5666('0x6d')]()[_0x5666('0x6e')](_0x5666('0x6a'),_0x5666('0x6a'))['field']('id',_0x5666('0x6c'))[_0x5666('0x6e')](_0x3a27be[_0x5666('0x70')][_0x5666('0x71')](),_0x5666('0x72'))['field'](_0x43b835[_0x5666('0x46')]['id'][_0x5666('0x71')](),_0x5666('0x5b'))[_0x5666('0x6e')](_0x5666('0x6f'),'createdAt')[_0x5666('0x6e')](_0x5666('0x6f'),_0x5666('0x56'))[_0x5666('0x73')]('cm_contacts')[_0x5666('0x3a')]('deletedAt\x20IS\x20NULL')[_0x5666('0x3a')](_0x5666('0x76'),_0x3a27be[_0x5666('0x70')][_0x5666('0x71')]())[_0x5666('0x3a')](_0x5666('0x77')))[_0x5666('0x71')]();_0x3924b3['push'](db[_0x5666('0x7f')][_0x5666('0x32')](_0xdb9568));}return BPromise[_0x5666('0x80')](_0x3924b3);}})['then'](function(){return _0x57c933;})[_0x5666('0x27')](respondWithResult(_0x4b9bfe,null))['catch'](handleError(_0x4b9bfe,null));};exports[_0x5666('0x85')]=function(_0x142781,_0x3207b2,_0x306b5d){return db[_0x5666('0x41')][_0x5666('0x48')]({'where':{'id':_0x142781[_0x5666('0x46')]['id']}})[_0x5666('0x27')](handleEntityNotFound(_0x3207b2,null))[_0x5666('0x27')](function(_0x295d23){if(_0x295d23){return _0x295d23['removeBlackLists'](_0x142781[_0x5666('0x32')]['ids']);}})['then'](function(_0x4a790c){if(_0x4a790c){return db['CmHopperBlack'][_0x5666('0x28')]({'where':{'ListId':_0x142781[_0x5666('0x32')][_0x5666('0x64')],'CampaignId':_0x142781['params']['id']}})[_0x5666('0x27')](function(){return _0x4a790c;});}})[_0x5666('0x27')](respondWithStatusCode(_0x3207b2,null))[_0x5666('0x45')](handleError(_0x3207b2,null));}; \ No newline at end of file +var _0xb9ca=['../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','index','map','Campaign','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','options','createdAt','updatedAt','body','user','autoAssociation','getHoppers','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','toString','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','omit','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4be138,_0x27b964){var _0x47f3f8=function(_0x494fa3){while(--_0x494fa3){_0x4be138['push'](_0x4be138['shift']());}};_0x47f3f8(++_0x27b964);}(_0xb9ca,0xfe));var _0xab9c=function(_0x450da3,_0xa434ff){_0x450da3=_0x450da3-0x0;var _0x27df6b=_0xb9ca[_0x450da3];return _0x27df6b;};'use strict';var emlformat=require(_0xab9c('0x0'));var rimraf=require(_0xab9c('0x1'));var zipdir=require(_0xab9c('0x2'));var jsonpatch=require(_0xab9c('0x3'));var rp=require(_0xab9c('0x4'));var moment=require(_0xab9c('0x5'));var BPromise=require(_0xab9c('0x6'));var Mustache=require(_0xab9c('0x7'));var util=require(_0xab9c('0x8'));var path=require(_0xab9c('0x9'));var sox=require(_0xab9c('0xa'));var csv=require(_0xab9c('0xb'));var ejs=require(_0xab9c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab9c('0xd'));var squel=require(_0xab9c('0xe'));var crypto=require('crypto');var jsforce=require(_0xab9c('0xf'));var deskjs=require(_0xab9c('0x10'));var toCsv=require(_0xab9c('0xb'));var querystring=require('querystring');var Papa=require(_0xab9c('0x11'));var Redis=require(_0xab9c('0x12'));var authService=require(_0xab9c('0x13'));var qs=require(_0xab9c('0x14'));var as=require(_0xab9c('0x15'));var hardwareService=require(_0xab9c('0x16'));var logger=require('../../config/logger')(_0xab9c('0x17'));var utils=require(_0xab9c('0x18'));var config=require(_0xab9c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xab9c('0x1a'))['db'];function respondWithStatusCode(_0x2015d7,_0x5b34d1){_0x5b34d1=_0x5b34d1||0xcc;return function(_0x4ee6ec){if(_0x4ee6ec){return _0x2015d7['sendStatus'](_0x5b34d1);}return _0x2015d7[_0xab9c('0x1b')](_0x5b34d1)[_0xab9c('0x1c')]();};}function respondWithResult(_0x4f02c1,_0x42057e){_0x42057e=_0x42057e||0xc8;return function(_0x4c101a){if(_0x4c101a){return _0x4f02c1[_0xab9c('0x1b')](_0x42057e)[_0xab9c('0x1d')](_0x4c101a);}};}function respondWithFilteredResult(_0xdb91bd,_0x29f22a){return function(_0x2d142e){if(_0x2d142e){var _0x558b04=typeof _0x29f22a[_0xab9c('0x1e')]==='undefined'&&typeof _0x29f22a[_0xab9c('0x1f')]==='undefined';var _0x56c1ac=_0x2d142e[_0xab9c('0x20')];var _0x4719a6=_0x558b04?0x0:_0x29f22a[_0xab9c('0x1e')];var _0x5a4f61=_0x558b04?_0x2d142e[_0xab9c('0x20')]:_0x29f22a[_0xab9c('0x1e')]+_0x29f22a[_0xab9c('0x1f')];var _0x48e8c4;if(_0x5a4f61>=_0x56c1ac){_0x5a4f61=_0x56c1ac;_0x48e8c4=0xc8;}else{_0x48e8c4=0xce;}_0xdb91bd[_0xab9c('0x1b')](_0x48e8c4);return _0xdb91bd[_0xab9c('0x21')]('Content-Range',_0x4719a6+'-'+_0x5a4f61+'/'+_0x56c1ac)[_0xab9c('0x1d')](_0x2d142e);}return null;};}function patchUpdates(_0x3aa9dd){return function(_0x18e745){try{jsonpatch['apply'](_0x18e745,_0x3aa9dd,!![]);}catch(_0x2efa77){return BPromise[_0xab9c('0x22')](_0x2efa77);}return _0x18e745[_0xab9c('0x23')]();};}function saveUpdates(_0x397a5f,_0x5dcbc9){return function(_0x21c24f){if(_0x21c24f){return _0x21c24f[_0xab9c('0x24')](_0x397a5f)['then'](function(_0x4fe621){return _0x4fe621;});}return null;};}function removeEntity(_0x375e85,_0x2c7fc0){return function(_0x54db05){if(_0x54db05){return _0x54db05['destroy']()[_0xab9c('0x25')](function(){var _0xdbe615=_0x54db05[_0xab9c('0x26')]({'plain':!![]});var _0x26df37=_0xab9c('0x27');return db[_0xab9c('0x28')][_0xab9c('0x29')]({'where':{'type':_0x26df37,'resourceId':_0xdbe615['id']}})[_0xab9c('0x25')](function(){return _0x54db05;});})['then'](function(){_0x375e85[_0xab9c('0x1b')](0xcc)[_0xab9c('0x1c')]();});}};}function handleEntityNotFound(_0x2578aa,_0x52d940){return function(_0x5ee700){if(!_0x5ee700){_0x2578aa[_0xab9c('0x2a')](0x194);}return _0x5ee700;};}function handleError(_0x195315,_0x5b1dcb){_0x5b1dcb=_0x5b1dcb||0x1f4;return function(_0x554bb3){logger['error'](_0x554bb3[_0xab9c('0x2b')]);if(_0x554bb3['name']){delete _0x554bb3['name'];}_0x195315[_0xab9c('0x1b')](_0x5b1dcb)['send'](_0x554bb3);};}exports[_0xab9c('0x2c')]=function(_0x4a7a28,_0x54961b){var _0x1c4f5b={},_0x190258={},_0x5a1a1d={'count':0x0,'rows':[]};var _0x5cf50e=_[_0xab9c('0x2d')](db[_0xab9c('0x2e')][_0xab9c('0x2f')],function(_0x5c9875){return{'name':_0x5c9875[_0xab9c('0x30')],'type':_0x5c9875['type'][_0xab9c('0x31')]};});_0x190258[_0xab9c('0x32')]=_[_0xab9c('0x2d')](_0x5cf50e,_0xab9c('0x33'));_0x190258[_0xab9c('0x34')]=_['keys'](_0x4a7a28[_0xab9c('0x34')]);_0x190258[_0xab9c('0x35')]=_[_0xab9c('0x36')](_0x190258[_0xab9c('0x32')],_0x190258[_0xab9c('0x34')]);_0x1c4f5b[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x190258[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x4a7a28[_0xab9c('0x34')][_0xab9c('0x38')]));_0x1c4f5b[_0xab9c('0x37')]=_0x1c4f5b[_0xab9c('0x37')][_0xab9c('0x39')]?_0x1c4f5b[_0xab9c('0x37')]:_0x190258['model'];if(!_0x4a7a28[_0xab9c('0x34')][_0xab9c('0x3a')]('nolimit')){_0x1c4f5b['limit']=qs[_0xab9c('0x1f')](_0x4a7a28[_0xab9c('0x34')]['limit']);_0x1c4f5b[_0xab9c('0x1e')]=qs[_0xab9c('0x1e')](_0x4a7a28[_0xab9c('0x34')][_0xab9c('0x1e')]);}_0x1c4f5b[_0xab9c('0x3b')]=qs[_0xab9c('0x3c')](_0x4a7a28[_0xab9c('0x34')]['sort']);_0x1c4f5b[_0xab9c('0x3d')]=qs[_0xab9c('0x35')](_[_0xab9c('0x3e')](_0x4a7a28['query'],_0x190258[_0xab9c('0x35')]),_0x5cf50e);if(_0x4a7a28['query'][_0xab9c('0x3f')]){_0x1c4f5b[_0xab9c('0x3d')]=_[_0xab9c('0x40')](_0x1c4f5b[_0xab9c('0x3d')],{'$or':_[_0xab9c('0x2d')](_0x5cf50e,function(_0xa5f9b1){if(_0xa5f9b1['type']!==_0xab9c('0x41')){var _0x19482e={};_0x19482e[_0xa5f9b1[_0xab9c('0x33')]]={'$like':'%'+_0x4a7a28[_0xab9c('0x34')][_0xab9c('0x3f')]+'%'};return _0x19482e;}})});}_0x1c4f5b=_[_0xab9c('0x40')]({},_0x1c4f5b,_0x4a7a28['options']);var _0x3da262={'where':_0x1c4f5b['where']};return db[_0xab9c('0x2e')][_0xab9c('0x20')](_0x3da262)[_0xab9c('0x25')](function(_0x2e5e17){_0x5a1a1d[_0xab9c('0x20')]=_0x2e5e17;if(_0x4a7a28[_0xab9c('0x34')]['includeAll']){_0x1c4f5b['include']=[{'all':!![]}];}return db[_0xab9c('0x2e')][_0xab9c('0x42')](_0x1c4f5b);})[_0xab9c('0x25')](function(_0x393d0e){_0x5a1a1d[_0xab9c('0x43')]=_0x393d0e;return _0x5a1a1d;})[_0xab9c('0x25')](respondWithFilteredResult(_0x54961b,_0x1c4f5b))[_0xab9c('0x44')](handleError(_0x54961b,null));};exports[_0xab9c('0x45')]=function(_0x1ba94c,_0x345ada){var _0x4744df={'raw':![],'where':{'id':_0x1ba94c[_0xab9c('0x46')]['id']}},_0x431ba5={};_0x431ba5[_0xab9c('0x32')]=_[_0xab9c('0x47')](db[_0xab9c('0x2e')][_0xab9c('0x2f')]);_0x431ba5[_0xab9c('0x34')]=_[_0xab9c('0x47')](_0x1ba94c[_0xab9c('0x34')]);_0x431ba5[_0xab9c('0x35')]=_[_0xab9c('0x36')](_0x431ba5[_0xab9c('0x32')],_0x431ba5[_0xab9c('0x34')]);_0x4744df[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x431ba5[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x1ba94c['query'][_0xab9c('0x38')]));_0x4744df[_0xab9c('0x37')]=_0x4744df['attributes']['length']?_0x4744df[_0xab9c('0x37')]:_0x431ba5[_0xab9c('0x32')];if(_0x1ba94c[_0xab9c('0x34')]['includeAll']){_0x4744df[_0xab9c('0x48')]=[{'all':!![]}];}_0x4744df=_[_0xab9c('0x40')]({},_0x4744df,_0x1ba94c['options']);return db[_0xab9c('0x2e')][_0xab9c('0x49')](_0x4744df)[_0xab9c('0x25')](handleEntityNotFound(_0x345ada,null))[_0xab9c('0x25')](respondWithResult(_0x345ada,null))['catch'](handleError(_0x345ada,null));};exports['create']=function(_0x2a671c,_0x2e33c2){return db[_0xab9c('0x2e')][_0xab9c('0x4a')](_0x2a671c['body'],{})[_0xab9c('0x25')](function(_0x1ccddd){var _0x309a7c=_0x2a671c['user'][_0xab9c('0x26')]({'plain':!![]});if(!_0x309a7c)throw new Error(_0xab9c('0x4b'));if(_0x309a7c[_0xab9c('0x4c')]==='user'){var _0x25fc6a=_0x1ccddd[_0xab9c('0x26')]({'plain':!![]});var _0x2939f5=_0xab9c('0x27');return db[_0xab9c('0x4d')][_0xab9c('0x49')]({'where':{'name':_0x2939f5,'userProfileId':_0x309a7c[_0xab9c('0x4e')]},'raw':!![]})['then'](function(_0x21759e){if(_0x21759e&&_0x21759e['autoAssociation']===0x0){return db[_0xab9c('0x28')]['create']({'name':_0x25fc6a[_0xab9c('0x33')],'resourceId':_0x25fc6a['id'],'type':_0x21759e[_0xab9c('0x33')],'sectionId':_0x21759e['id']},{})[_0xab9c('0x25')](function(){return _0x1ccddd;});}else{return _0x1ccddd;}})[_0xab9c('0x44')](function(_0x1eb67a){logger[_0xab9c('0x4f')](_0xab9c('0x50'),_0x1eb67a);throw _0x1eb67a;});}return _0x1ccddd;})['then'](respondWithResult(_0x2e33c2,0xc9))[_0xab9c('0x44')](handleError(_0x2e33c2,null));};exports[_0xab9c('0x51')]=function(_0x41d840,_0x49123d){var _0x3df225={'where':{'id':_0x41d840[_0xab9c('0x46')]['id']}},_0x3a71e0={};_0x3a71e0[_0xab9c('0x32')]=_['keys'](db[_0xab9c('0x2e')][_0xab9c('0x2f')]);_0x3df225[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x3a71e0[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x41d840[_0xab9c('0x34')][_0xab9c('0x38')]));_0x3df225[_0xab9c('0x37')]=_0x3df225[_0xab9c('0x37')][_0xab9c('0x39')]?_0x3df225['attributes']:_0x3a71e0[_0xab9c('0x32')];if(_0x41d840['query'][_0xab9c('0x52')]){_0x3df225[_0xab9c('0x48')]=[{'all':!![]}];}_0x3df225=_[_0xab9c('0x40')]({},_0x3df225,_0x41d840[_0xab9c('0x53')]);return db[_0xab9c('0x2e')][_0xab9c('0x49')](_0x3df225)['then'](handleEntityNotFound(_0x49123d,null))[_0xab9c('0x25')](function(_0x555f57){if(_0x555f57){var _0x12a782=_0x555f57[_0xab9c('0x26')]({'plain':!![]});_0x12a782=qs['omit'](_0x12a782,['id',_0xab9c('0x54'),_0xab9c('0x55')]);_0x41d840['body']=_['omit'](_0x41d840[_0xab9c('0x56')],['id',_0xab9c('0x54'),_0xab9c('0x55')]);return db[_0xab9c('0x2e')][_0xab9c('0x4a')](_[_0xab9c('0x40')](_0x12a782,_0x41d840[_0xab9c('0x56')]),{'include':_0x41d840[_0xab9c('0x34')][_0xab9c('0x52')]?[{'all':!![]}]:undefined})['then'](function(_0x36ab3e){var _0x39e21e=_0x41d840[_0xab9c('0x57')]['get']({'plain':!![]});if(!_0x39e21e)throw new Error(_0xab9c('0x4b'));if(_0x39e21e[_0xab9c('0x4c')]==='user'){var _0x199a2c=_0x36ab3e[_0xab9c('0x26')]({'plain':!![]});var _0x3d4eec=_0xab9c('0x27');return db[_0xab9c('0x4d')][_0xab9c('0x49')]({'where':{'name':_0x3d4eec,'userProfileId':_0x39e21e[_0xab9c('0x4e')]},'raw':!![]})[_0xab9c('0x25')](function(_0x39f6ad){if(_0x39f6ad&&_0x39f6ad[_0xab9c('0x58')]===0x0){return db[_0xab9c('0x28')][_0xab9c('0x4a')]({'name':_0x199a2c[_0xab9c('0x33')],'resourceId':_0x199a2c['id'],'type':_0x39f6ad[_0xab9c('0x33')],'sectionId':_0x39f6ad['id']},{})[_0xab9c('0x25')](function(){return _0x36ab3e;});}else{return _0x36ab3e;}})[_0xab9c('0x44')](function(_0x3266df){logger[_0xab9c('0x4f')](_0xab9c('0x50'),_0x3266df);throw _0x3266df;});}return _0x36ab3e;});}})[_0xab9c('0x25')](respondWithResult(_0x49123d,0xc9))[_0xab9c('0x44')](handleError(_0x49123d,null));};exports[_0xab9c('0x24')]=function(_0x57eb9c,_0x228d15){if(_0x57eb9c[_0xab9c('0x56')]['id']){delete _0x57eb9c['body']['id'];}return db[_0xab9c('0x2e')][_0xab9c('0x49')]({'where':{'id':_0x57eb9c[_0xab9c('0x46')]['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x228d15,null))[_0xab9c('0x25')](saveUpdates(_0x57eb9c[_0xab9c('0x56')],null))[_0xab9c('0x25')](respondWithResult(_0x228d15,null))[_0xab9c('0x44')](handleError(_0x228d15,null));};exports[_0xab9c('0x29')]=function(_0x4a33fc,_0x2ac156){return db[_0xab9c('0x2e')][_0xab9c('0x49')]({'where':{'id':_0x4a33fc[_0xab9c('0x46')]['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x2ac156,null))['then'](removeEntity(_0x2ac156,null))['catch'](handleError(_0x2ac156,null));};exports[_0xab9c('0x59')]=function(_0x16337e,_0x13cc0c,_0x40f1b6){var _0xed35f9={'raw':!![],'where':{}};var _0x2c7662={};var _0x2cf029={'count':0x0,'rows':[]};return db[_0xab9c('0x2e')][_0xab9c('0x5a')]({'where':{'id':_0x16337e[_0xab9c('0x46')]['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x13cc0c,null))[_0xab9c('0x25')](function(_0x44f656){if(_0x44f656){_0x2c7662[_0xab9c('0x32')]=_['keys'](db['CmHopper'][_0xab9c('0x2f')]);_0x2c7662[_0xab9c('0x34')]=_[_0xab9c('0x47')](_0x16337e[_0xab9c('0x34')]);_0x2c7662[_0xab9c('0x35')]=_[_0xab9c('0x36')](_0x2c7662[_0xab9c('0x32')],_0x2c7662[_0xab9c('0x34')]);_0xed35f9['attributes']=_[_0xab9c('0x36')](_0x2c7662[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x16337e[_0xab9c('0x34')][_0xab9c('0x38')]));_0xed35f9[_0xab9c('0x37')]=_0xed35f9[_0xab9c('0x37')][_0xab9c('0x39')]?_0xed35f9['attributes']:_0x2c7662[_0xab9c('0x32')];if(!_0x16337e['query']['hasOwnProperty'](_0xab9c('0x5b'))){_0xed35f9[_0xab9c('0x1f')]=qs[_0xab9c('0x1f')](_0x16337e[_0xab9c('0x34')]['limit']);_0xed35f9[_0xab9c('0x1e')]=qs[_0xab9c('0x1e')](_0x16337e[_0xab9c('0x34')][_0xab9c('0x1e')]);}_0xed35f9['order']=qs['sort'](_0x16337e['query'][_0xab9c('0x3c')]);_0xed35f9[_0xab9c('0x3d')]=qs[_0xab9c('0x35')](_['pick'](_0x16337e[_0xab9c('0x34')],_0x2c7662[_0xab9c('0x35')]));_0xed35f9['where'][_0xab9c('0x5c')]=_0x44f656['id'];if(_0x16337e[_0xab9c('0x34')]['filter']){_0xed35f9[_0xab9c('0x3d')]=_['merge'](_0xed35f9['where'],{'$or':_[_0xab9c('0x2d')](_0xed35f9[_0xab9c('0x37')],function(_0x5b2462){var _0x424493={};_0x424493[_0x5b2462]={'$like':'%'+_0x16337e[_0xab9c('0x34')][_0xab9c('0x3f')]+'%'};return _0x424493;})});}_0xed35f9=_[_0xab9c('0x40')]({},_0xed35f9,_0x16337e[_0xab9c('0x53')]);return db[_0xab9c('0x5d')]['count']({'where':_0xed35f9[_0xab9c('0x3d')]})['then'](function(_0x8f3cca){_0x2cf029[_0xab9c('0x20')]=_0x8f3cca;if(_0x16337e['query'][_0xab9c('0x52')]){_0xed35f9['include']=[{'all':!![]}];}return db[_0xab9c('0x5d')][_0xab9c('0x42')](_0xed35f9);})[_0xab9c('0x25')](function(_0x43aff2){_0x2cf029[_0xab9c('0x43')]=_0x43aff2;return _0x2cf029;});}})[_0xab9c('0x25')](respondWithFilteredResult(_0x13cc0c,_0xed35f9))[_0xab9c('0x44')](handleError(_0x13cc0c,null));};exports[_0xab9c('0x5e')]=function(_0x4a0a18,_0x53107f,_0x2fc6d7){var _0x3b066d={'raw':!![],'where':{}};var _0x2980ae={};var _0x1865ee={'count':0x0,'rows':[]};return db[_0xab9c('0x2e')]['findOne']({'where':{'id':_0x4a0a18['params']['id']}})['then'](handleEntityNotFound(_0x53107f,null))['then'](function(_0x4af0d3){if(_0x4af0d3){_0x2980ae[_0xab9c('0x32')]=_['keys'](db[_0xab9c('0x5f')][_0xab9c('0x2f')]);_0x2980ae['query']=_[_0xab9c('0x47')](_0x4a0a18[_0xab9c('0x34')]);_0x2980ae[_0xab9c('0x35')]=_[_0xab9c('0x36')](_0x2980ae[_0xab9c('0x32')],_0x2980ae['query']);_0x3b066d[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x2980ae[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x4a0a18[_0xab9c('0x34')][_0xab9c('0x38')]));_0x3b066d[_0xab9c('0x37')]=_0x3b066d[_0xab9c('0x37')][_0xab9c('0x39')]?_0x3b066d[_0xab9c('0x37')]:_0x2980ae[_0xab9c('0x32')];if(!_0x4a0a18[_0xab9c('0x34')][_0xab9c('0x3a')](_0xab9c('0x5b'))){_0x3b066d['limit']=qs['limit'](_0x4a0a18['query'][_0xab9c('0x1f')]);_0x3b066d[_0xab9c('0x1e')]=qs[_0xab9c('0x1e')](_0x4a0a18[_0xab9c('0x34')]['offset']);}_0x3b066d[_0xab9c('0x3b')]=qs[_0xab9c('0x3c')](_0x4a0a18[_0xab9c('0x34')][_0xab9c('0x3c')]);_0x3b066d[_0xab9c('0x3d')]=qs['filters'](_['pick'](_0x4a0a18[_0xab9c('0x34')],_0x2980ae[_0xab9c('0x35')]));_0x3b066d[_0xab9c('0x3d')][_0xab9c('0x5c')]=_0x4af0d3['id'];if(_0x4a0a18['query'][_0xab9c('0x3f')]){_0x3b066d[_0xab9c('0x3d')]=_['merge'](_0x3b066d[_0xab9c('0x3d')],{'$or':_[_0xab9c('0x2d')](_0x3b066d[_0xab9c('0x37')],function(_0x59b8e1){var _0x5db731={};_0x5db731[_0x59b8e1]={'$like':'%'+_0x4a0a18['query'][_0xab9c('0x3f')]+'%'};return _0x5db731;})});}_0x3b066d=_[_0xab9c('0x40')]({},_0x3b066d,_0x4a0a18[_0xab9c('0x53')]);return db[_0xab9c('0x5f')][_0xab9c('0x20')]({'where':_0x3b066d[_0xab9c('0x3d')]})[_0xab9c('0x25')](function(_0x89636d){_0x1865ee['count']=_0x89636d;if(_0x4a0a18['query']['includeAll']){_0x3b066d[_0xab9c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3b066d);})['then'](function(_0x5a2af0){_0x1865ee[_0xab9c('0x43')]=_0x5a2af0;return _0x1865ee;});}})[_0xab9c('0x25')](respondWithFilteredResult(_0x53107f,_0x3b066d))['catch'](handleError(_0x53107f,null));};exports[_0xab9c('0x60')]=function(_0x124cbe,_0x19c387,_0x1631a1){var _0x23cdec={'raw':!![],'where':{}};var _0x4b57a8={};var _0x3a81d9={'count':0x0,'rows':[]};return db['Campaign'][_0xab9c('0x5a')]({'where':{'id':_0x124cbe['params']['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x19c387,null))[_0xab9c('0x25')](function(_0xb74330){if(_0xb74330){_0x4b57a8[_0xab9c('0x32')]=_[_0xab9c('0x47')](db[_0xab9c('0x61')][_0xab9c('0x2f')]);_0x4b57a8[_0xab9c('0x34')]=_['keys'](_0x124cbe['query']);_0x4b57a8[_0xab9c('0x35')]=_['intersection'](_0x4b57a8[_0xab9c('0x32')],_0x4b57a8[_0xab9c('0x34')]);_0x23cdec[_0xab9c('0x37')]=_['intersection'](_0x4b57a8[_0xab9c('0x32')],qs['fields'](_0x124cbe[_0xab9c('0x34')][_0xab9c('0x38')]));_0x23cdec[_0xab9c('0x37')]=_0x23cdec[_0xab9c('0x37')][_0xab9c('0x39')]?_0x23cdec[_0xab9c('0x37')]:_0x4b57a8[_0xab9c('0x32')];if(!_0x124cbe[_0xab9c('0x34')][_0xab9c('0x3a')]('nolimit')){_0x23cdec[_0xab9c('0x1f')]=qs[_0xab9c('0x1f')](_0x124cbe['query'][_0xab9c('0x1f')]);_0x23cdec[_0xab9c('0x1e')]=qs[_0xab9c('0x1e')](_0x124cbe[_0xab9c('0x34')][_0xab9c('0x1e')]);}_0x23cdec[_0xab9c('0x3b')]=qs[_0xab9c('0x3c')](_0x124cbe['query'][_0xab9c('0x3c')]);_0x23cdec[_0xab9c('0x3d')]=qs['filters'](_[_0xab9c('0x3e')](_0x124cbe['query'],_0x4b57a8['filters']));_0x23cdec[_0xab9c('0x3d')][_0xab9c('0x5c')]=_0xb74330['id'];if(_0x124cbe[_0xab9c('0x34')][_0xab9c('0x3f')]){_0x23cdec['where']=_[_0xab9c('0x40')](_0x23cdec[_0xab9c('0x3d')],{'$or':_['map'](_0x23cdec[_0xab9c('0x37')],function(_0x36bf43){var _0x592655={};_0x592655[_0x36bf43]={'$like':'%'+_0x124cbe[_0xab9c('0x34')]['filter']+'%'};return _0x592655;})});}_0x23cdec=_[_0xab9c('0x40')]({},_0x23cdec,_0x124cbe[_0xab9c('0x53')]);return db['CmHopperFinal'][_0xab9c('0x20')]({'where':_0x23cdec[_0xab9c('0x3d')]})[_0xab9c('0x25')](function(_0x40fbc1){_0x3a81d9[_0xab9c('0x20')]=_0x40fbc1;if(_0x124cbe[_0xab9c('0x34')][_0xab9c('0x52')]){_0x23cdec[_0xab9c('0x48')]=[{'all':!![]}];}return db[_0xab9c('0x61')]['findAll'](_0x23cdec);})[_0xab9c('0x25')](function(_0x3cbce3){_0x3a81d9['rows']=_0x3cbce3;return _0x3a81d9;});}})[_0xab9c('0x25')](respondWithFilteredResult(_0x19c387,_0x23cdec))[_0xab9c('0x44')](handleError(_0x19c387,null));};exports[_0xab9c('0x62')]=function(_0xa8aefb,_0x49d7dd,_0x437f66){var _0x24e3bd={'raw':!![],'where':{}};var _0x56a8e2={};var _0x334216={'count':0x0,'rows':[]};return db[_0xab9c('0x2e')]['findOne']({'where':{'id':_0xa8aefb['params']['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x49d7dd,null))['then'](function(_0x3c616e){if(_0x3c616e){_0x56a8e2[_0xab9c('0x32')]=_[_0xab9c('0x47')](db[_0xab9c('0x63')]['rawAttributes']);_0x56a8e2['query']=_[_0xab9c('0x47')](_0xa8aefb[_0xab9c('0x34')]);_0x56a8e2['filters']=_['intersection'](_0x56a8e2['model'],_0x56a8e2['query']);_0x24e3bd[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x56a8e2[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0xa8aefb['query'][_0xab9c('0x38')]));_0x24e3bd[_0xab9c('0x37')]=_0x24e3bd[_0xab9c('0x37')]['length']?_0x24e3bd['attributes']:_0x56a8e2['model'];if(!_0xa8aefb[_0xab9c('0x34')]['hasOwnProperty'](_0xab9c('0x5b'))){_0x24e3bd['limit']=qs[_0xab9c('0x1f')](_0xa8aefb[_0xab9c('0x34')]['limit']);_0x24e3bd['offset']=qs[_0xab9c('0x1e')](_0xa8aefb['query'][_0xab9c('0x1e')]);}_0x24e3bd[_0xab9c('0x3b')]=qs['sort'](_0xa8aefb[_0xab9c('0x34')]['sort']);_0x24e3bd[_0xab9c('0x3d')]=qs['filters'](_[_0xab9c('0x3e')](_0xa8aefb[_0xab9c('0x34')],_0x56a8e2[_0xab9c('0x35')]));_0x24e3bd[_0xab9c('0x3d')][_0xab9c('0x5c')]=_0x3c616e['id'];if(_0xa8aefb[_0xab9c('0x34')]['filter']){_0x24e3bd[_0xab9c('0x3d')]=_[_0xab9c('0x40')](_0x24e3bd[_0xab9c('0x3d')],{'$or':_[_0xab9c('0x2d')](_0x24e3bd[_0xab9c('0x37')],function(_0xad2a1d){var _0x168273={};_0x168273[_0xad2a1d]={'$like':'%'+_0xa8aefb[_0xab9c('0x34')]['filter']+'%'};return _0x168273;})});}_0x24e3bd=_[_0xab9c('0x40')]({},_0x24e3bd,_0xa8aefb[_0xab9c('0x53')]);return db[_0xab9c('0x63')][_0xab9c('0x20')]({'where':_0x24e3bd[_0xab9c('0x3d')]})['then'](function(_0x4f880a){_0x334216[_0xab9c('0x20')]=_0x4f880a;if(_0xa8aefb[_0xab9c('0x34')][_0xab9c('0x52')]){_0x24e3bd['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x24e3bd);})[_0xab9c('0x25')](function(_0x5c64d0){_0x334216[_0xab9c('0x43')]=_0x5c64d0;return _0x334216;});}})['then'](respondWithFilteredResult(_0x49d7dd,_0x24e3bd))['catch'](handleError(_0x49d7dd,null));};exports[_0xab9c('0x64')]=function(_0x4d9848,_0x262313,_0x4dd43b){var _0x2b79cf={};var _0x3a24c3={};var _0x551090;var _0x1182f4;return db[_0xab9c('0x2e')][_0xab9c('0x5a')]({'where':{'id':_0x4d9848['params']['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x262313,null))[_0xab9c('0x25')](function(_0x2c0290){if(_0x2c0290){_0x551090=_0x2c0290;_0x3a24c3['model']=_[_0xab9c('0x47')](db[_0xab9c('0x65')]['rawAttributes']);_0x3a24c3[_0xab9c('0x34')]=_[_0xab9c('0x47')](_0x4d9848[_0xab9c('0x34')]);_0x3a24c3[_0xab9c('0x35')]=_[_0xab9c('0x36')](_0x3a24c3[_0xab9c('0x32')],_0x3a24c3['query']);_0x2b79cf[_0xab9c('0x37')]=_[_0xab9c('0x36')](_0x3a24c3[_0xab9c('0x32')],qs['fields'](_0x4d9848[_0xab9c('0x34')]['fields']));_0x2b79cf[_0xab9c('0x37')]=_0x2b79cf['attributes'][_0xab9c('0x39')]?_0x2b79cf[_0xab9c('0x37')]:_0x3a24c3[_0xab9c('0x32')];_0x2b79cf[_0xab9c('0x3b')]=qs[_0xab9c('0x3c')](_0x4d9848[_0xab9c('0x34')][_0xab9c('0x3c')]);_0x2b79cf[_0xab9c('0x3d')]=qs[_0xab9c('0x35')](_[_0xab9c('0x3e')](_0x4d9848[_0xab9c('0x34')],_0x3a24c3['filters']));if(_0x4d9848[_0xab9c('0x34')][_0xab9c('0x3f')]){_0x2b79cf['where']=_[_0xab9c('0x40')](_0x2b79cf[_0xab9c('0x3d')],{'$or':_[_0xab9c('0x2d')](_0x2b79cf[_0xab9c('0x37')],function(_0x3db549){var _0x1127e9={};_0x1127e9[_0x3db549]={'$like':'%'+_0x4d9848['query']['filter']+'%'};return _0x1127e9;})});}_0x2b79cf=_[_0xab9c('0x40')]({},_0x2b79cf,_0x4d9848[_0xab9c('0x53')]);return _0x551090[_0xab9c('0x64')](_0x2b79cf);}})[_0xab9c('0x25')](function(_0x402d54){if(_0x402d54){_0x1182f4=_0x402d54[_0xab9c('0x39')];if(!_0x4d9848['query']['hasOwnProperty'](_0xab9c('0x5b'))){_0x2b79cf[_0xab9c('0x1f')]=qs[_0xab9c('0x1f')](_0x4d9848[_0xab9c('0x34')][_0xab9c('0x1f')]);_0x2b79cf[_0xab9c('0x1e')]=qs['offset'](_0x4d9848[_0xab9c('0x34')][_0xab9c('0x1e')]);}return _0x551090[_0xab9c('0x64')](_0x2b79cf);}})['then'](function(_0x396230){if(_0x396230){return _0x396230?{'count':_0x1182f4,'rows':_0x396230}:null;}})[_0xab9c('0x25')](respondWithResult(_0x262313,null))[_0xab9c('0x44')](handleError(_0x262313,null));};exports[_0xab9c('0x66')]=function(_0xe413aa,_0x54a213,_0x17256d){var _0x737df,_0x1490b8;return db[_0xab9c('0x2e')]['find']({'where':{'id':_0xe413aa[_0xab9c('0x46')]['id']}})['then'](handleEntityNotFound(_0x54a213,null))[_0xab9c('0x25')](function(_0x153228){if(_0x153228){_0x1490b8=_0x153228;return _0x153228[_0xab9c('0x66')](_0xe413aa[_0xab9c('0x56')][_0xab9c('0x67')],_['omit'](_0xe413aa[_0xab9c('0x56')],[_0xab9c('0x67'),'id'])||{});}return null;})[_0xab9c('0x68')](function(_0x17b3d9){var _0x42afe0;_0x737df=_0x17b3d9||[];var _0x375784=[];if(_0x17b3d9){for(var _0x210bc0=0x0;_0x210bc0<_0x17b3d9[_0xab9c('0x39')];_0x210bc0+=0x1){var _0x52d2cf=_0x17b3d9[_0x210bc0][_0xab9c('0x26')]({'plain':!![]});_0x1490b8[_0xab9c('0x69')]=_0xe413aa[_0xab9c('0x56')][_0xab9c('0x69')]?_0xe413aa[_0xab9c('0x56')][_0xab9c('0x69')]:_0x1490b8[_0xab9c('0x69')];switch(_0x1490b8[_0xab9c('0x69')]){case _0xab9c('0x6a'):_0x42afe0=squel[_0xab9c('0x6b')]()[_0xab9c('0x6c')](_0xab9c('0x6d'))[_0xab9c('0x6e')]([_0xab9c('0x6f'),'scheduledAt',_0xab9c('0x70'),_0xab9c('0x71'),'CampaignId','createdAt',_0xab9c('0x55')],squel[_0xab9c('0x72')]()[_0xab9c('0x73')]('phone','phone')['field'](_0xab9c('0x74'),_0xab9c('0x75'))['field']('id',_0xab9c('0x70'))[_0xab9c('0x73')](_0x52d2cf[_0xab9c('0x76')]['toString'](),_0xab9c('0x71'))[_0xab9c('0x73')](_0xe413aa['params']['id']['toString'](),_0xab9c('0x5c'))['field'](_0xab9c('0x74'),_0xab9c('0x54'))[_0xab9c('0x73')]('NOW()',_0xab9c('0x55'))[_0xab9c('0x77')]('cm_contacts')[_0xab9c('0x3d')](_0xab9c('0x78'))[_0xab9c('0x3d')]('ListId\x20=\x20?',_0x52d2cf[_0xab9c('0x76')]['toString']())[_0xab9c('0x3d')](_0xab9c('0x79'))[_0xab9c('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xab9c('0x72')]()[_0xab9c('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0xab9c('0x77')](_0xab9c('0x7a'))[_0xab9c('0x3d')]('CampaignId\x20=\x20?',_0xe413aa['params']['id'][_0xab9c('0x7b')]()))[_0xab9c('0x3d')](_0xab9c('0x7c'),squel[_0xab9c('0x72')]()[_0xab9c('0x73')](_0xab9c('0x7d'))['from']('cm_hopper')[_0xab9c('0x3d')](_0xab9c('0x7e'),_0xe413aa[_0xab9c('0x46')]['id'][_0xab9c('0x7b')]())))[_0xab9c('0x7b')]();break;case _0xab9c('0x7f'):_0x42afe0=squel[_0xab9c('0x6b')]()[_0xab9c('0x6c')](_0xab9c('0x6d'))[_0xab9c('0x6e')](['phone',_0xab9c('0x75'),'ContactId',_0xab9c('0x71'),_0xab9c('0x5c'),_0xab9c('0x54'),'updatedAt'],squel[_0xab9c('0x72')]()[_0xab9c('0x73')](_0xab9c('0x6f'),'phone')[_0xab9c('0x73')](_0xab9c('0x74'),_0xab9c('0x75'))['field']('id','ContactId')['field'](_0x52d2cf[_0xab9c('0x76')][_0xab9c('0x7b')](),_0xab9c('0x71'))[_0xab9c('0x73')](_0xe413aa['params']['id'][_0xab9c('0x7b')](),_0xab9c('0x5c'))[_0xab9c('0x73')](_0xab9c('0x74'),_0xab9c('0x54'))['field'](_0xab9c('0x74'),_0xab9c('0x55'))[_0xab9c('0x77')]('cm_contacts')[_0xab9c('0x3d')](_0xab9c('0x78'))[_0xab9c('0x3d')]('ListId\x20=\x20?',_0x52d2cf[_0xab9c('0x76')][_0xab9c('0x7b')]())[_0xab9c('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xab9c('0x3d')](_0xab9c('0x7c'),squel[_0xab9c('0x72')]()[_0xab9c('0x73')](_0xab9c('0x7d'))[_0xab9c('0x77')](_0xab9c('0x6d'))['where']('CampaignId\x20=\x20?',_0xe413aa[_0xab9c('0x46')]['id']['toString']())))[_0xab9c('0x7b')]();break;default:_0x42afe0=squel[_0xab9c('0x6b')]()[_0xab9c('0x6c')]('cm_hopper')[_0xab9c('0x6e')]([_0xab9c('0x6f'),'scheduledAt',_0xab9c('0x70'),'ListId',_0xab9c('0x5c'),_0xab9c('0x54'),_0xab9c('0x55')],squel['select']()[_0xab9c('0x73')](_0xab9c('0x6f'),_0xab9c('0x6f'))[_0xab9c('0x73')]('NOW()',_0xab9c('0x75'))[_0xab9c('0x73')]('id',_0xab9c('0x70'))['field'](_0x52d2cf['CmListId']['toString'](),_0xab9c('0x71'))[_0xab9c('0x73')](_0xe413aa['params']['id'][_0xab9c('0x7b')](),'CampaignId')[_0xab9c('0x73')](_0xab9c('0x74'),_0xab9c('0x54'))[_0xab9c('0x73')](_0xab9c('0x74'),'updatedAt')[_0xab9c('0x77')](_0xab9c('0x80'))['where'](_0xab9c('0x78'))[_0xab9c('0x3d')]('ListId\x20=\x20?',_0x52d2cf[_0xab9c('0x76')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xab9c('0x7b')]();}_0x375784[_0xab9c('0x81')](db[_0xab9c('0x82')][_0xab9c('0x34')](_0x42afe0));}return BPromise[_0xab9c('0x83')](_0x375784);}})[_0xab9c('0x25')](function(){return _0x737df;})['then'](respondWithResult(_0x54a213,null))[_0xab9c('0x44')](handleError(_0x54a213,null));};exports['removeLists']=function(_0x460e5b,_0x393c7c,_0x22ac57){return db[_0xab9c('0x2e')][_0xab9c('0x49')]({'where':{'id':_0x460e5b[_0xab9c('0x46')]['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x393c7c,null))[_0xab9c('0x25')](function(_0x2ef8b1){if(_0x2ef8b1){return _0x2ef8b1[_0xab9c('0x84')](_0x460e5b[_0xab9c('0x34')][_0xab9c('0x67')]);}})[_0xab9c('0x25')](function(_0x1633be){if(_0x1633be){return db[_0xab9c('0x5d')][_0xab9c('0x29')]({'where':{'ListId':_0x460e5b[_0xab9c('0x34')][_0xab9c('0x67')],'CampaignId':_0x460e5b['params']['id']}})['then'](function(){return _0x1633be;});}})[_0xab9c('0x25')](respondWithStatusCode(_0x393c7c,null))['catch'](handleError(_0x393c7c,null));};exports[_0xab9c('0x85')]=function(_0x562154,_0xb99821,_0x248e02){var _0x518d73={};var _0x340ed6={};var _0x9a72aa;var _0x2a5ece;return db['Campaign'][_0xab9c('0x5a')]({'where':{'id':_0x562154['params']['id']}})['then'](handleEntityNotFound(_0xb99821,null))[_0xab9c('0x25')](function(_0x37633b){if(_0x37633b){_0x9a72aa=_0x37633b;_0x340ed6[_0xab9c('0x32')]=_['keys'](db[_0xab9c('0x65')][_0xab9c('0x2f')]);_0x340ed6[_0xab9c('0x34')]=_[_0xab9c('0x47')](_0x562154[_0xab9c('0x34')]);_0x340ed6['filters']=_[_0xab9c('0x36')](_0x340ed6[_0xab9c('0x32')],_0x340ed6[_0xab9c('0x34')]);_0x518d73[_0xab9c('0x37')]=_['intersection'](_0x340ed6[_0xab9c('0x32')],qs[_0xab9c('0x38')](_0x562154['query']['fields']));_0x518d73['attributes']=_0x518d73[_0xab9c('0x37')][_0xab9c('0x39')]?_0x518d73[_0xab9c('0x37')]:_0x340ed6['model'];_0x518d73['order']=qs[_0xab9c('0x3c')](_0x562154[_0xab9c('0x34')]['sort']);_0x518d73[_0xab9c('0x3d')]=qs[_0xab9c('0x35')](_[_0xab9c('0x3e')](_0x562154[_0xab9c('0x34')],_0x340ed6['filters']));if(_0x562154[_0xab9c('0x34')][_0xab9c('0x3f')]){_0x518d73[_0xab9c('0x3d')]=_[_0xab9c('0x40')](_0x518d73[_0xab9c('0x3d')],{'$or':_[_0xab9c('0x2d')](_0x518d73[_0xab9c('0x37')],function(_0x237e2c){var _0x44b76a={};_0x44b76a[_0x237e2c]={'$like':'%'+_0x562154[_0xab9c('0x34')][_0xab9c('0x3f')]+'%'};return _0x44b76a;})});}_0x518d73=_[_0xab9c('0x40')]({},_0x518d73,_0x562154[_0xab9c('0x53')]);return _0x9a72aa[_0xab9c('0x85')](_0x518d73);}})[_0xab9c('0x25')](function(_0x5aa6dd){if(_0x5aa6dd){_0x2a5ece=_0x5aa6dd[_0xab9c('0x39')];if(!_0x562154[_0xab9c('0x34')]['hasOwnProperty'](_0xab9c('0x5b'))){_0x518d73[_0xab9c('0x1f')]=qs[_0xab9c('0x1f')](_0x562154['query']['limit']);_0x518d73[_0xab9c('0x1e')]=qs[_0xab9c('0x1e')](_0x562154[_0xab9c('0x34')]['offset']);}return _0x9a72aa[_0xab9c('0x85')](_0x518d73);}})[_0xab9c('0x25')](function(_0x4d744b){if(_0x4d744b){return _0x4d744b?{'count':_0x2a5ece,'rows':_0x4d744b}:null;}})[_0xab9c('0x25')](respondWithResult(_0xb99821,null))[_0xab9c('0x44')](handleError(_0xb99821,null));};exports[_0xab9c('0x86')]=function(_0x270939,_0x380fe9,_0x5a4e43){var _0x5ba2cf,_0x186fce;return db[_0xab9c('0x2e')]['find']({'where':{'id':_0x270939[_0xab9c('0x46')]['id']}})[_0xab9c('0x25')](handleEntityNotFound(_0x380fe9,null))['then'](function(_0x1d8a0a){if(_0x1d8a0a){_0x186fce=_0x1d8a0a;return _0x1d8a0a[_0xab9c('0x86')](_0x270939[_0xab9c('0x56')][_0xab9c('0x67')],_[_0xab9c('0x87')](_0x270939[_0xab9c('0x56')],[_0xab9c('0x67'),'id'])||{});}return null;})['spread'](function(_0x480371){var _0x280534;_0x5ba2cf=_0x480371||[];var _0x2ab1b8=[];if(_0x480371){for(var _0x1251be=0x0;_0x1251be<_0x480371[_0xab9c('0x39')];_0x1251be+=0x1){var _0x1ddac7=_0x480371[_0x1251be][_0xab9c('0x26')]({'plain':!![]});_0x280534=squel['insert']()[_0xab9c('0x6c')](_0xab9c('0x88'))[_0xab9c('0x6e')]([_0xab9c('0x6f'),_0xab9c('0x70'),_0xab9c('0x71'),_0xab9c('0x5c'),'createdAt',_0xab9c('0x55')],squel[_0xab9c('0x72')]()[_0xab9c('0x73')](_0xab9c('0x6f'),_0xab9c('0x6f'))[_0xab9c('0x73')]('id',_0xab9c('0x70'))['field'](_0x1ddac7['CmListId']['toString'](),'ListId')['field'](_0x270939[_0xab9c('0x46')]['id'][_0xab9c('0x7b')](),'CampaignId')['field'](_0xab9c('0x74'),_0xab9c('0x54'))[_0xab9c('0x73')](_0xab9c('0x74'),_0xab9c('0x55'))['from'](_0xab9c('0x80'))[_0xab9c('0x3d')](_0xab9c('0x78'))['where'](_0xab9c('0x89'),_0x1ddac7['CmListId']['toString']())['where'](_0xab9c('0x79')))[_0xab9c('0x7b')]();_0x2ab1b8[_0xab9c('0x81')](db[_0xab9c('0x82')][_0xab9c('0x34')](_0x280534));}return BPromise['all'](_0x2ab1b8);}})[_0xab9c('0x25')](function(){return _0x5ba2cf;})[_0xab9c('0x25')](respondWithResult(_0x380fe9,null))[_0xab9c('0x44')](handleError(_0x380fe9,null));};exports['removeBlackLists']=function(_0x327598,_0x56569d,_0x30267f){return db['Campaign'][_0xab9c('0x49')]({'where':{'id':_0x327598[_0xab9c('0x46')]['id']}})['then'](handleEntityNotFound(_0x56569d,null))['then'](function(_0x8a5bbc){if(_0x8a5bbc){return _0x8a5bbc[_0xab9c('0x8a')](_0x327598['query'][_0xab9c('0x67')]);}})['then'](function(_0x23b574){if(_0x23b574){return db['CmHopperBlack'][_0xab9c('0x29')]({'where':{'ListId':_0x327598[_0xab9c('0x34')][_0xab9c('0x67')],'CampaignId':_0x327598[_0xab9c('0x46')]['id']}})['then'](function(){return _0x23b574;});}})[_0xab9c('0x25')](respondWithStatusCode(_0x56569d,null))[_0xab9c('0x44')](handleError(_0x56569d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index c2a8c11..8b3d171 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1ba3f0,_0x3b220d){var _0x53064d=function(_0x4ac6e3){while(--_0x4ac6e3){_0x1ba3f0['push'](_0x1ba3f0['shift']());}};_0x53064d(++_0x3b220d);}(_0x7a54,0x106));var _0x47a5=function(_0x4529bc,_0x3b2682){_0x4529bc=_0x4529bc-0x0;var _0x2f805a=_0x7a54[_0x4529bc];return _0x2f805a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x21235e,_0x3b40e3){var _0x479e51=function(_0xd5a016){while(--_0xd5a016){_0x21235e['push'](_0x21235e['shift']());}};_0x479e51(++_0x3b40e3);}(_0x7a54,0x106));var _0x47a5=function(_0x2aa022,_0x272249){_0x2aa022=_0x2aa022-0x0;var _0x5dd292=_0x7a54[_0x2aa022];return _0x5dd292;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 55d784d..2dce8f7 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 _0x984b=['ioredis','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','bluebird','randomstring'];(function(_0x351795,_0x3936b1){var _0x2cbe0f=function(_0x54059b){while(--_0x54059b){_0x351795['push'](_0x351795['shift']());}};_0x2cbe0f(++_0x3936b1);}(_0x984b,0xee));var _0xb984=function(_0x2a3eca,_0x2320d2){_0x2a3eca=_0x2a3eca-0x0;var _0x530f11=_0x984b[_0x2a3eca];return _0x530f11;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});}exports['GetCampaign']=function(_0x396c36){var _0x35bd75=this;return new Promise(function(_0x3a5c96,_0x9afbee){return db[_0xb984('0x13')][_0xb984('0x14')]({'raw':_0x396c36['options']?_0x396c36[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![],'where':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x17')]||null:null,'attributes':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x18')]||null:null,'limit':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x19')]||null:null,'include':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x396c36[_0xb984('0x15')][_0xb984('0x1a')],function(_0x52c581){return{'model':db[_0x52c581[_0xb984('0x1c')]],'as':_0x52c581['as'],'attributes':_0x52c581[_0xb984('0x18')],'include':_0x52c581[_0xb984('0x1a')]?_['map'](_0x52c581[_0xb984('0x1a')],function(_0x2e806e){return{'model':db[_0x2e806e[_0xb984('0x1c')]],'as':_0x2e806e['as'],'attributes':_0x2e806e[_0xb984('0x18')],'include':_0x2e806e[_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x2e806e[_0xb984('0x1a')],function(_0x4b3da0){return{'model':db[_0x4b3da0['model']],'as':_0x4b3da0['as'],'attributes':_0x4b3da0[_0xb984('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb984('0x7')](function(_0x3e254b){logger[_0xb984('0x8')]('GetCampaign',_0x396c36);logger[_0xb984('0xb')](_0xb984('0x1d'),_0x396c36,JSON[_0xb984('0xd')](_0x3e254b));_0x3a5c96(_0x3e254b);})['catch'](function(_0x363e33){logger[_0xb984('0xe')](_0xb984('0x1d'),_0x363e33[_0xb984('0x10')],_0x396c36);_0x9afbee(_0x35bd75['error'](0x1f4,_0x363e33['message']));});});}; \ No newline at end of file +var _0x5712=['findAll','options','raw','limit','map','include','attributes','model','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','GetCampaign'];(function(_0x168422,_0x6a9ee8){var _0x1866cd=function(_0xefb79){while(--_0xefb79){_0x168422['push'](_0x168422['shift']());}};_0x1866cd(++_0x6a9ee8);}(_0x5712,0x140));var _0x2571=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5712[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('Campaign,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});}exports[_0x2571('0x14')]=function(_0x75af2a){var _0x576222=this;return new Promise(function(_0x7707,_0x3f2e5f){return db['Campaign'][_0x2571('0x15')]({'raw':_0x75af2a[_0x2571('0x16')]?_0x75af2a[_0x2571('0x16')][_0x2571('0x17')]===undefined?!![]:![]:!![],'where':_0x75af2a[_0x2571('0x16')]?_0x75af2a['options']['where']||null:null,'attributes':_0x75af2a[_0x2571('0x16')]?_0x75af2a[_0x2571('0x16')]['attributes']||null:null,'limit':_0x75af2a['options']?_0x75af2a[_0x2571('0x16')][_0x2571('0x18')]||null:null,'include':_0x75af2a[_0x2571('0x16')]?_0x75af2a[_0x2571('0x16')]['include']?_[_0x2571('0x19')](_0x75af2a['options'][_0x2571('0x1a')],function(_0x4316b1){return{'model':db[_0x4316b1['model']],'as':_0x4316b1['as'],'attributes':_0x4316b1[_0x2571('0x1b')],'include':_0x4316b1[_0x2571('0x1a')]?_[_0x2571('0x19')](_0x4316b1['include'],function(_0x5d455d){return{'model':db[_0x5d455d[_0x2571('0x1c')]],'as':_0x5d455d['as'],'attributes':_0x5d455d[_0x2571('0x1b')],'include':_0x5d455d[_0x2571('0x1a')]?_[_0x2571('0x19')](_0x5d455d[_0x2571('0x1a')],function(_0x246bbd){return{'model':db[_0x246bbd['model']],'as':_0x246bbd['as'],'attributes':_0x246bbd['attributes']};}):[]};}):[]};}):[]:[]})[_0x2571('0x1d')](function(_0x426615){logger[_0x2571('0x13')](_0x2571('0x14'),_0x75af2a);logger[_0x2571('0xe')](_0x2571('0x14'),_0x75af2a,JSON[_0x2571('0x10')](_0x426615));_0x7707(_0x426615);})[_0x2571('0x1e')](function(_0x1f7562){logger[_0x2571('0x11')]('GetCampaign',_0x1f7562[_0x2571('0x12')],_0x75af2a);_0x3f2e5f(_0x576222[_0x2571('0x11')](0x1f4,_0x1f7562[_0x2571('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7b952fc..b9ae485 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 _0xea63=['put','update','delete','removeLists','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists'];(function(_0x5ace25,_0x536239){var _0x4ba17a=function(_0x1ee54e){while(--_0x1ee54e){_0x5ace25['push'](_0x5ace25['shift']());}};_0x4ba17a(++_0x536239);}(_0xea63,0x1d6));var _0x3ea6=function(_0x3f7b80,_0x373c79){_0x3f7b80=_0x3f7b80-0x0;var _0x178090=_0xea63[_0x3f7b80];return _0x178090;};'use strict';var multer=require('multer');var util=require(_0x3ea6('0x0'));var path=require(_0x3ea6('0x1'));var timeout=require(_0x3ea6('0x2'));var express=require(_0x3ea6('0x3'));var router=express[_0x3ea6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3ea6('0x5'));var config=require(_0x3ea6('0x6'));var controller=require(_0x3ea6('0x7'));router['get']('/',auth[_0x3ea6('0x8')](),controller['index']);router[_0x3ea6('0x9')](_0x3ea6('0xa'),auth[_0x3ea6('0x8')](),controller[_0x3ea6('0xb')]);router[_0x3ea6('0x9')]('/:id/hoppers',auth[_0x3ea6('0x8')](),controller[_0x3ea6('0xc')]);router['get'](_0x3ea6('0xd'),auth[_0x3ea6('0x8')](),controller[_0x3ea6('0xe')]);router[_0x3ea6('0x9')]('/:id/hopper_finals',auth[_0x3ea6('0x8')](),controller['getHopperFinals']);router[_0x3ea6('0x9')](_0x3ea6('0xf'),auth['isAuthenticated'](),controller[_0x3ea6('0x10')]);router[_0x3ea6('0x9')]('/:id/lists',auth[_0x3ea6('0x8')](),controller[_0x3ea6('0x11')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x3ea6('0x12')]);router[_0x3ea6('0x13')]('/',auth[_0x3ea6('0x8')](),controller['create']);router[_0x3ea6('0x13')](_0x3ea6('0x14'),auth['isAuthenticated'](),controller[_0x3ea6('0x15')]);router['post'](_0x3ea6('0x16'),auth['isAuthenticated'](),controller[_0x3ea6('0x17')]);router[_0x3ea6('0x13')](_0x3ea6('0x18'),auth[_0x3ea6('0x8')](),controller[_0x3ea6('0x19')]);router[_0x3ea6('0x1a')](_0x3ea6('0xa'),auth[_0x3ea6('0x8')](),controller[_0x3ea6('0x1b')]);router['delete'](_0x3ea6('0xa'),auth[_0x3ea6('0x8')](),controller['destroy']);router[_0x3ea6('0x1c')]('/:id/lists',auth[_0x3ea6('0x8')](),controller[_0x3ea6('0x1d')]);router[_0x3ea6('0x1c')](_0x3ea6('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x3ea6('0x1e')]=router; \ No newline at end of file +var _0x0679=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','path','connect-timeout','express'];(function(_0x473c07,_0x28111e){var _0x3f51d7=function(_0x1ba3ce){while(--_0x1ba3ce){_0x473c07['push'](_0x473c07['shift']());}};_0x3f51d7(++_0x28111e);}(_0x0679,0x190));var _0x9067=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x0679[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9067('0x0'));var timeout=require(_0x9067('0x1'));var express=require(_0x9067('0x2'));var router=express[_0x9067('0x3')]();var fs_extra=require(_0x9067('0x4'));var auth=require(_0x9067('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9067('0x6'));var controller=require('./campaign.controller');router[_0x9067('0x7')]('/',auth[_0x9067('0x8')](),controller[_0x9067('0x9')]);router[_0x9067('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9067('0xa')]);router[_0x9067('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9067('0xb')]);router[_0x9067('0x7')](_0x9067('0xc'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x9067('0xd'),auth[_0x9067('0x8')](),controller[_0x9067('0xe')]);router['get']('/:id/hopper_black',auth[_0x9067('0x8')](),controller[_0x9067('0xf')]);router[_0x9067('0x7')]('/:id/lists',auth[_0x9067('0x8')](),controller[_0x9067('0x10')]);router[_0x9067('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x9067('0x11')]);router[_0x9067('0x12')]('/',auth[_0x9067('0x8')](),controller['create']);router['post'](_0x9067('0x13'),auth['isAuthenticated'](),controller[_0x9067('0x14')]);router['post'](_0x9067('0x15'),auth['isAuthenticated'](),controller[_0x9067('0x16')]);router[_0x9067('0x12')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x9067('0x17')]);router['put'](_0x9067('0x18'),auth[_0x9067('0x8')](),controller[_0x9067('0x19')]);router[_0x9067('0x1a')]('/:id',auth[_0x9067('0x8')](),controller[_0x9067('0x1b')]);router[_0x9067('0x1a')](_0x9067('0x15'),auth['isAuthenticated'](),controller[_0x9067('0x1c')]);router[_0x9067('0x1a')](_0x9067('0x1d'),auth['isAuthenticated'](),controller[_0x9067('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cc1442c..e98ee4b 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 _0x66a8=['VIRTUAL','getDataValue','key','sequelize','TEXT','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x66a8,0xb7));var _0x866a=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x66a8[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require(_0x866a('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x866a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x866a('0x2')]},'name':{'type':Sequelize[_0x866a('0x3')],'get':function(){return this[_0x866a('0x4')](_0x866a('0x5'));}}}; \ No newline at end of file +var _0xd638=['sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd638,0x145));var _0x8d63=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0xd638[_0x2bd1ec];return _0x2f7577;};'use strict';var Sequelize=require(_0x8d63('0x0'));module[_0x8d63('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8d63('0x2')]},'name':{'type':Sequelize[_0x8d63('0x3')],'get':function(){return this[_0x8d63('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 6529680..499ff3d 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 _0xcc65=['update','then','destroy','UserProfileResource','end','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save'];(function(_0xf96b2e,_0x46b798){var _0x1a2147=function(_0x2116bd){while(--_0x2116bd){_0xf96b2e['push'](_0xf96b2e['shift']());}};_0x1a2147(++_0x46b798);}(_0xcc65,0x8c));var _0x5cc6=function(_0x5c9b55,_0x5befc4){_0x5c9b55=_0x5c9b55-0x0;var _0x113969=_0xcc65[_0x5c9b55];return _0x113969;};'use strict';var emlformat=require(_0x5cc6('0x0'));var rimraf=require(_0x5cc6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cc6('0x2'));var BPromise=require(_0x5cc6('0x3'));var Mustache=require(_0x5cc6('0x4'));var util=require(_0x5cc6('0x5'));var path=require(_0x5cc6('0x6'));var sox=require('sox');var csv=require(_0x5cc6('0x7'));var ejs=require(_0x5cc6('0x8'));var fs=require('fs');var fs_extra=require(_0x5cc6('0x9'));var _=require(_0x5cc6('0xa'));var squel=require('squel');var crypto=require(_0x5cc6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5cc6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cc6('0xd'));var Papa=require(_0x5cc6('0xe'));var Redis=require('ioredis');var authService=require(_0x5cc6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5cc6('0x10'));var hardwareService=require(_0x5cc6('0x11'));var logger=require(_0x5cc6('0x12'))(_0x5cc6('0x13'));var utils=require(_0x5cc6('0x14'));var config=require(_0x5cc6('0x15'));var licenseUtil=require(_0x5cc6('0x16'));var db=require(_0x5cc6('0x17'))['db'];function respondWithStatusCode(_0x556be8,_0x5b4078){_0x5b4078=_0x5b4078||0xcc;return function(_0x592b42){if(_0x592b42){return _0x556be8['sendStatus'](_0x5b4078);}return _0x556be8[_0x5cc6('0x18')](_0x5b4078)['end']();};}function respondWithResult(_0x3b159a,_0x1f33f6){_0x1f33f6=_0x1f33f6||0xc8;return function(_0x3b08a7){if(_0x3b08a7){return _0x3b159a[_0x5cc6('0x18')](_0x1f33f6)[_0x5cc6('0x19')](_0x3b08a7);}};}function respondWithFilteredResult(_0xf240e2,_0x4601a8){return function(_0x38159b){if(_0x38159b){var _0x21da9b=typeof _0x4601a8['offset']===_0x5cc6('0x1a')&&typeof _0x4601a8[_0x5cc6('0x1b')]===_0x5cc6('0x1a');var _0x58e457=_0x38159b[_0x5cc6('0x1c')];var _0x541c5c=_0x21da9b?0x0:_0x4601a8[_0x5cc6('0x1d')];var _0x2409fc=_0x21da9b?_0x38159b[_0x5cc6('0x1c')]:_0x4601a8['offset']+_0x4601a8[_0x5cc6('0x1b')];var _0x39275c;if(_0x2409fc>=_0x58e457){_0x2409fc=_0x58e457;_0x39275c=0xc8;}else{_0x39275c=0xce;}_0xf240e2[_0x5cc6('0x18')](_0x39275c);return _0xf240e2[_0x5cc6('0x1e')](_0x5cc6('0x1f'),_0x541c5c+'-'+_0x2409fc+'/'+_0x58e457)['json'](_0x38159b);}return null;};}function patchUpdates(_0x6de106){return function(_0x1d8aba){try{jsonpatch['apply'](_0x1d8aba,_0x6de106,!![]);}catch(_0x2d72b1){return BPromise[_0x5cc6('0x20')](_0x2d72b1);}return _0x1d8aba[_0x5cc6('0x21')]();};}function saveUpdates(_0x313067,_0x1c1f94){return function(_0x38b265){if(_0x38b265){return _0x38b265[_0x5cc6('0x22')](_0x313067)[_0x5cc6('0x23')](function(_0x57ae6a){return _0x57ae6a;});}return null;};}function removeEntity(_0x3f1020,_0x82dbb){return function(_0xf4ebe8){if(_0xf4ebe8){return _0xf4ebe8[_0x5cc6('0x24')]()[_0x5cc6('0x23')](function(){var _0x354ff1=_0xf4ebe8['get']({'plain':!![]});var _0x4c2299='CannedAnswers';return db[_0x5cc6('0x25')]['destroy']({'where':{'type':_0x4c2299,'resourceId':_0x354ff1['id']}})[_0x5cc6('0x23')](function(){return _0xf4ebe8;});})[_0x5cc6('0x23')](function(){_0x3f1020['status'](0xcc)[_0x5cc6('0x26')]();});}};}function handleEntityNotFound(_0x2555a0,_0x4cadd7){return function(_0x3f9bc5){if(!_0x3f9bc5){_0x2555a0[_0x5cc6('0x27')](0x194);}return _0x3f9bc5;};}function handleError(_0x255e81,_0x350bdc){_0x350bdc=_0x350bdc||0x1f4;return function(_0x128c35){logger[_0x5cc6('0x28')](_0x128c35['stack']);if(_0x128c35['name']){delete _0x128c35[_0x5cc6('0x29')];}_0x255e81[_0x5cc6('0x18')](_0x350bdc)[_0x5cc6('0x2a')](_0x128c35);};}exports[_0x5cc6('0x2b')]=function(_0x5e1ea6,_0xd98eef){var _0x4cfc04={},_0x4efc83={},_0x333236={'count':0x0,'rows':[]};var _0x3a0fa7=_[_0x5cc6('0x2c')](db[_0x5cc6('0x2d')][_0x5cc6('0x2e')],function(_0x387fd8){return{'name':_0x387fd8[_0x5cc6('0x2f')],'type':_0x387fd8[_0x5cc6('0x30')]['key']};});_0x4efc83[_0x5cc6('0x31')]=_[_0x5cc6('0x2c')](_0x3a0fa7,'name');_0x4efc83[_0x5cc6('0x32')]=_[_0x5cc6('0x33')](_0x5e1ea6[_0x5cc6('0x32')]);_0x4efc83[_0x5cc6('0x34')]=_[_0x5cc6('0x35')](_0x4efc83['model'],_0x4efc83['query']);_0x4cfc04[_0x5cc6('0x36')]=_[_0x5cc6('0x35')](_0x4efc83[_0x5cc6('0x31')],qs[_0x5cc6('0x37')](_0x5e1ea6[_0x5cc6('0x32')][_0x5cc6('0x37')]));_0x4cfc04[_0x5cc6('0x36')]=_0x4cfc04[_0x5cc6('0x36')][_0x5cc6('0x38')]?_0x4cfc04[_0x5cc6('0x36')]:_0x4efc83[_0x5cc6('0x31')];if(!_0x5e1ea6[_0x5cc6('0x32')][_0x5cc6('0x39')](_0x5cc6('0x3a'))){_0x4cfc04[_0x5cc6('0x1b')]=qs[_0x5cc6('0x1b')](_0x5e1ea6['query'][_0x5cc6('0x1b')]);_0x4cfc04[_0x5cc6('0x1d')]=qs[_0x5cc6('0x1d')](_0x5e1ea6[_0x5cc6('0x32')]['offset']);}_0x4cfc04[_0x5cc6('0x3b')]=qs[_0x5cc6('0x3c')](_0x5e1ea6[_0x5cc6('0x32')]['sort']);_0x4cfc04[_0x5cc6('0x3d')]=qs['filters'](_[_0x5cc6('0x3e')](_0x5e1ea6[_0x5cc6('0x32')],_0x4efc83[_0x5cc6('0x34')]),_0x3a0fa7);if(_0x5e1ea6[_0x5cc6('0x32')][_0x5cc6('0x3f')]){_0x4cfc04['where']=_[_0x5cc6('0x40')](_0x4cfc04[_0x5cc6('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5e1ea6[_0x5cc6('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x5e1ea6[_0x5cc6('0x32')][_0x5cc6('0x3f')]+'%'}}]});}_0x4cfc04=_[_0x5cc6('0x40')]({},_0x4cfc04,_0x5e1ea6[_0x5cc6('0x41')]);var _0x4b9952={'where':_0x4cfc04[_0x5cc6('0x3d')]};return db[_0x5cc6('0x2d')][_0x5cc6('0x1c')](_0x4b9952)['then'](function(_0x430954){_0x333236[_0x5cc6('0x1c')]=_0x430954;if(_0x5e1ea6[_0x5cc6('0x32')][_0x5cc6('0x42')]){_0x4cfc04['include']=[{'all':!![]}];}return db[_0x5cc6('0x2d')][_0x5cc6('0x43')](_0x4cfc04);})['then'](function(_0x3990f7){_0x333236[_0x5cc6('0x44')]=_0x3990f7;return _0x333236;})[_0x5cc6('0x23')](respondWithFilteredResult(_0xd98eef,_0x4cfc04))[_0x5cc6('0x45')](handleError(_0xd98eef,null));};exports[_0x5cc6('0x46')]=function(_0x5e73d3,_0x849880){var _0x3f994b={'raw':!![],'where':{'id':_0x5e73d3[_0x5cc6('0x47')]['id']}},_0x4b5f83={};_0x4b5f83['model']=_[_0x5cc6('0x33')](db['CannedAnswer'][_0x5cc6('0x2e')]);_0x4b5f83[_0x5cc6('0x32')]=_[_0x5cc6('0x33')](_0x5e73d3['query']);_0x4b5f83[_0x5cc6('0x34')]=_[_0x5cc6('0x35')](_0x4b5f83['model'],_0x4b5f83[_0x5cc6('0x32')]);_0x3f994b[_0x5cc6('0x36')]=_[_0x5cc6('0x35')](_0x4b5f83['model'],qs[_0x5cc6('0x37')](_0x5e73d3[_0x5cc6('0x32')][_0x5cc6('0x37')]));_0x3f994b[_0x5cc6('0x36')]=_0x3f994b[_0x5cc6('0x36')][_0x5cc6('0x38')]?_0x3f994b[_0x5cc6('0x36')]:_0x4b5f83['model'];if(_0x5e73d3[_0x5cc6('0x32')][_0x5cc6('0x42')]){_0x3f994b['include']=[{'all':!![]}];}_0x3f994b=_[_0x5cc6('0x40')]({},_0x3f994b,_0x5e73d3[_0x5cc6('0x41')]);return db[_0x5cc6('0x2d')]['find'](_0x3f994b)[_0x5cc6('0x23')](handleEntityNotFound(_0x849880,null))['then'](respondWithResult(_0x849880,null))['catch'](handleError(_0x849880,null));};exports['update']=function(_0x515a27,_0x33745a){if(_0x515a27[_0x5cc6('0x48')]['id']){delete _0x515a27[_0x5cc6('0x48')]['id'];}return db['CannedAnswer'][_0x5cc6('0x49')]({'where':{'id':_0x515a27[_0x5cc6('0x47')]['id']}})[_0x5cc6('0x23')](handleEntityNotFound(_0x33745a,null))['then'](saveUpdates(_0x515a27[_0x5cc6('0x48')],null))[_0x5cc6('0x23')](respondWithResult(_0x33745a,null))['catch'](handleError(_0x33745a,null));};exports[_0x5cc6('0x24')]=function(_0x3218e1,_0x29ce51){return db[_0x5cc6('0x2d')][_0x5cc6('0x49')]({'where':{'id':_0x3218e1[_0x5cc6('0x47')]['id']}})['then'](handleEntityNotFound(_0x29ce51,null))[_0x5cc6('0x23')](removeEntity(_0x29ce51,null))['catch'](handleError(_0x29ce51,null));};exports['create']=function(_0x39e923,_0x2ad40e){var _0x1d293c={'key':_0x39e923['body']['key']};if(_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4a')]){_0x1d293c[_0x5cc6('0x4a')]=_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4a')];}else if(_0x39e923[_0x5cc6('0x48')]['SmsAccountId']){_0x1d293c[_0x5cc6('0x4b')]=_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4b')];}else if(_0x39e923[_0x5cc6('0x48')]['OpenchannelAccountId']){_0x1d293c[_0x5cc6('0x4c')]=_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4c')];}else if(_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4d')]){_0x1d293c['ChatWebsiteId']=_0x39e923[_0x5cc6('0x48')][_0x5cc6('0x4d')];}return db['CannedAnswer'][_0x5cc6('0x49')]({'where':_0x1d293c})['then'](function(_0x2061c3){if(_0x2061c3){throw new db[(_0x5cc6('0x4e'))][(_0x5cc6('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x5cc6('0x50')](_0x39e923[_0x5cc6('0x48')]);})[_0x5cc6('0x23')](function(_0x2ed71e){var _0x39315b=_0x39e923[_0x5cc6('0x51')][_0x5cc6('0x52')]({'plain':!![]});if(!_0x39315b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39315b[_0x5cc6('0x53')]===_0x5cc6('0x51')){var _0x3edcb5=_0x2ed71e[_0x5cc6('0x52')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x39315b[_0x5cc6('0x54')]},'raw':!![]})[_0x5cc6('0x23')](function(_0xcecdca){if(_0xcecdca&&_0xcecdca[_0x5cc6('0x55')]===0x0){return db[_0x5cc6('0x25')][_0x5cc6('0x50')]({'name':_0x3edcb5[_0x5cc6('0x29')],'resourceId':_0x3edcb5['id'],'type':_0xcecdca['name'],'sectionId':_0xcecdca['id']},{})['then'](function(){return _0x2ed71e;});}else{return _0x2ed71e;}})[_0x5cc6('0x45')](function(_0x4ad798){logger[_0x5cc6('0x28')](_0x5cc6('0x56'),_0x4ad798);throw _0x4ad798;});}return _0x2ed71e;})[_0x5cc6('0x23')](respondWithResult(_0x2ad40e,0xc9))[_0x5cc6('0x45')](handleError(_0x2ad40e,null));}; \ No newline at end of file +var _0xadc8=['sendStatus','error','stack','name','send','index','map','CannedAnswer','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xadc8,0x187));var _0x8adc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadc8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8adc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8adc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8adc('0x2'));var moment=require(_0x8adc('0x3'));var BPromise=require(_0x8adc('0x4'));var Mustache=require(_0x8adc('0x5'));var util=require(_0x8adc('0x6'));var path=require(_0x8adc('0x7'));var sox=require(_0x8adc('0x8'));var csv=require(_0x8adc('0x9'));var ejs=require(_0x8adc('0xa'));var fs=require('fs');var fs_extra=require(_0x8adc('0xb'));var _=require(_0x8adc('0xc'));var squel=require('squel');var crypto=require(_0x8adc('0xd'));var jsforce=require(_0x8adc('0xe'));var deskjs=require(_0x8adc('0xf'));var toCsv=require(_0x8adc('0x9'));var querystring=require('querystring');var Papa=require(_0x8adc('0x10'));var Redis=require(_0x8adc('0x11'));var authService=require(_0x8adc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8adc('0x13'));var logger=require('../../config/logger')(_0x8adc('0x14'));var utils=require('../../config/utils');var config=require(_0x8adc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8adc('0x16'))['db'];function respondWithStatusCode(_0x2d9d82,_0x43c9dd){_0x43c9dd=_0x43c9dd||0xcc;return function(_0x24d8bf){if(_0x24d8bf){return _0x2d9d82['sendStatus'](_0x43c9dd);}return _0x2d9d82[_0x8adc('0x17')](_0x43c9dd)['end']();};}function respondWithResult(_0x186faa,_0x2ffa69){_0x2ffa69=_0x2ffa69||0xc8;return function(_0x5411cb){if(_0x5411cb){return _0x186faa[_0x8adc('0x17')](_0x2ffa69)[_0x8adc('0x18')](_0x5411cb);}};}function respondWithFilteredResult(_0x3cd10a,_0x3a5d34){return function(_0x5ea273){if(_0x5ea273){var _0x3081a0=typeof _0x3a5d34[_0x8adc('0x19')]===_0x8adc('0x1a')&&typeof _0x3a5d34[_0x8adc('0x1b')]===_0x8adc('0x1a');var _0x58dfa0=_0x5ea273[_0x8adc('0x1c')];var _0x2bec42=_0x3081a0?0x0:_0x3a5d34[_0x8adc('0x19')];var _0x2e3509=_0x3081a0?_0x5ea273[_0x8adc('0x1c')]:_0x3a5d34[_0x8adc('0x19')]+_0x3a5d34[_0x8adc('0x1b')];var _0x5d5a3a;if(_0x2e3509>=_0x58dfa0){_0x2e3509=_0x58dfa0;_0x5d5a3a=0xc8;}else{_0x5d5a3a=0xce;}_0x3cd10a['status'](_0x5d5a3a);return _0x3cd10a[_0x8adc('0x1d')]('Content-Range',_0x2bec42+'-'+_0x2e3509+'/'+_0x58dfa0)['json'](_0x5ea273);}return null;};}function patchUpdates(_0x53dae8){return function(_0x31cb7c){try{jsonpatch[_0x8adc('0x1e')](_0x31cb7c,_0x53dae8,!![]);}catch(_0x2354c8){return BPromise[_0x8adc('0x1f')](_0x2354c8);}return _0x31cb7c[_0x8adc('0x20')]();};}function saveUpdates(_0x32a690,_0x3600f1){return function(_0x5828e0){if(_0x5828e0){return _0x5828e0[_0x8adc('0x21')](_0x32a690)[_0x8adc('0x22')](function(_0x4598e9){return _0x4598e9;});}return null;};}function removeEntity(_0x219984,_0x2811a7){return function(_0x3de783){if(_0x3de783){return _0x3de783[_0x8adc('0x23')]()['then'](function(){var _0x3e8c39=_0x3de783[_0x8adc('0x24')]({'plain':!![]});var _0x24d8b6=_0x8adc('0x25');return db[_0x8adc('0x26')][_0x8adc('0x23')]({'where':{'type':_0x24d8b6,'resourceId':_0x3e8c39['id']}})[_0x8adc('0x22')](function(){return _0x3de783;});})[_0x8adc('0x22')](function(){_0x219984['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6267,_0x5df0b2){return function(_0x597c9a){if(!_0x597c9a){_0x2f6267[_0x8adc('0x27')](0x194);}return _0x597c9a;};}function handleError(_0x466819,_0xb002a0){_0xb002a0=_0xb002a0||0x1f4;return function(_0x488792){logger[_0x8adc('0x28')](_0x488792[_0x8adc('0x29')]);if(_0x488792['name']){delete _0x488792[_0x8adc('0x2a')];}_0x466819[_0x8adc('0x17')](_0xb002a0)[_0x8adc('0x2b')](_0x488792);};}exports[_0x8adc('0x2c')]=function(_0x320cde,_0x572492){var _0x57b490={},_0x4c9339={},_0x1d595c={'count':0x0,'rows':[]};var _0x3674c5=_[_0x8adc('0x2d')](db[_0x8adc('0x2e')]['rawAttributes'],function(_0x4e62e7){return{'name':_0x4e62e7['fieldName'],'type':_0x4e62e7['type'][_0x8adc('0x2f')]};});_0x4c9339['model']=_[_0x8adc('0x2d')](_0x3674c5,_0x8adc('0x2a'));_0x4c9339[_0x8adc('0x30')]=_['keys'](_0x320cde['query']);_0x4c9339[_0x8adc('0x31')]=_[_0x8adc('0x32')](_0x4c9339[_0x8adc('0x33')],_0x4c9339[_0x8adc('0x30')]);_0x57b490[_0x8adc('0x34')]=_['intersection'](_0x4c9339[_0x8adc('0x33')],qs[_0x8adc('0x35')](_0x320cde[_0x8adc('0x30')][_0x8adc('0x35')]));_0x57b490[_0x8adc('0x34')]=_0x57b490['attributes'][_0x8adc('0x36')]?_0x57b490['attributes']:_0x4c9339['model'];if(!_0x320cde['query'][_0x8adc('0x37')](_0x8adc('0x38'))){_0x57b490['limit']=qs[_0x8adc('0x1b')](_0x320cde[_0x8adc('0x30')]['limit']);_0x57b490[_0x8adc('0x19')]=qs[_0x8adc('0x19')](_0x320cde[_0x8adc('0x30')][_0x8adc('0x19')]);}_0x57b490['order']=qs[_0x8adc('0x39')](_0x320cde[_0x8adc('0x30')]['sort']);_0x57b490[_0x8adc('0x3a')]=qs[_0x8adc('0x31')](_['pick'](_0x320cde[_0x8adc('0x30')],_0x4c9339[_0x8adc('0x31')]),_0x3674c5);if(_0x320cde[_0x8adc('0x30')][_0x8adc('0x3b')]){_0x57b490['where']=_[_0x8adc('0x3c')](_0x57b490[_0x8adc('0x3a')],{'$or':[{'key':{'$like':'%'+_0x320cde[_0x8adc('0x30')][_0x8adc('0x3b')]+'%'}},{'value':{'$like':'%'+_0x320cde[_0x8adc('0x30')][_0x8adc('0x3b')]+'%'}}]});}_0x57b490=_[_0x8adc('0x3c')]({},_0x57b490,_0x320cde[_0x8adc('0x3d')]);var _0x275bfb={'where':_0x57b490[_0x8adc('0x3a')]};return db['CannedAnswer'][_0x8adc('0x1c')](_0x275bfb)[_0x8adc('0x22')](function(_0xfa1f20){_0x1d595c['count']=_0xfa1f20;if(_0x320cde[_0x8adc('0x30')][_0x8adc('0x3e')]){_0x57b490[_0x8adc('0x3f')]=[{'all':!![]}];}return db[_0x8adc('0x2e')][_0x8adc('0x40')](_0x57b490);})[_0x8adc('0x22')](function(_0x2bbc65){_0x1d595c[_0x8adc('0x41')]=_0x2bbc65;return _0x1d595c;})[_0x8adc('0x22')](respondWithFilteredResult(_0x572492,_0x57b490))[_0x8adc('0x42')](handleError(_0x572492,null));};exports[_0x8adc('0x43')]=function(_0x12a1f5,_0x208cb3){var _0x24a315={'raw':!![],'where':{'id':_0x12a1f5[_0x8adc('0x44')]['id']}},_0x4440a={};_0x4440a[_0x8adc('0x33')]=_[_0x8adc('0x45')](db[_0x8adc('0x2e')][_0x8adc('0x46')]);_0x4440a['query']=_[_0x8adc('0x45')](_0x12a1f5['query']);_0x4440a[_0x8adc('0x31')]=_['intersection'](_0x4440a[_0x8adc('0x33')],_0x4440a[_0x8adc('0x30')]);_0x24a315['attributes']=_[_0x8adc('0x32')](_0x4440a['model'],qs[_0x8adc('0x35')](_0x12a1f5[_0x8adc('0x30')][_0x8adc('0x35')]));_0x24a315['attributes']=_0x24a315[_0x8adc('0x34')][_0x8adc('0x36')]?_0x24a315['attributes']:_0x4440a[_0x8adc('0x33')];if(_0x12a1f5[_0x8adc('0x30')]['includeAll']){_0x24a315[_0x8adc('0x3f')]=[{'all':!![]}];}_0x24a315=_[_0x8adc('0x3c')]({},_0x24a315,_0x12a1f5[_0x8adc('0x3d')]);return db[_0x8adc('0x2e')][_0x8adc('0x47')](_0x24a315)[_0x8adc('0x22')](handleEntityNotFound(_0x208cb3,null))[_0x8adc('0x22')](respondWithResult(_0x208cb3,null))[_0x8adc('0x42')](handleError(_0x208cb3,null));};exports[_0x8adc('0x21')]=function(_0x5d9fa5,_0x308af9){if(_0x5d9fa5[_0x8adc('0x48')]['id']){delete _0x5d9fa5[_0x8adc('0x48')]['id'];}return db[_0x8adc('0x2e')][_0x8adc('0x47')]({'where':{'id':_0x5d9fa5[_0x8adc('0x44')]['id']}})[_0x8adc('0x22')](handleEntityNotFound(_0x308af9,null))[_0x8adc('0x22')](saveUpdates(_0x5d9fa5['body'],null))[_0x8adc('0x22')](respondWithResult(_0x308af9,null))[_0x8adc('0x42')](handleError(_0x308af9,null));};exports['destroy']=function(_0x41cb9e,_0x3341b5){return db['CannedAnswer'][_0x8adc('0x47')]({'where':{'id':_0x41cb9e[_0x8adc('0x44')]['id']}})[_0x8adc('0x22')](handleEntityNotFound(_0x3341b5,null))[_0x8adc('0x22')](removeEntity(_0x3341b5,null))['catch'](handleError(_0x3341b5,null));};exports[_0x8adc('0x49')]=function(_0x3d8f78,_0x27e04d){var _0x430753={'key':_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x2f')]};if(_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x4a')]){_0x430753[_0x8adc('0x4a')]=_0x3d8f78[_0x8adc('0x48')]['MailAccountId'];}else if(_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x4b')]){_0x430753['SmsAccountId']=_0x3d8f78['body'][_0x8adc('0x4b')];}else if(_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x4c')]){_0x430753['OpenchannelAccountId']=_0x3d8f78['body'][_0x8adc('0x4c')];}else if(_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x4d')]){_0x430753[_0x8adc('0x4d')]=_0x3d8f78[_0x8adc('0x48')][_0x8adc('0x4d')];}return db[_0x8adc('0x2e')][_0x8adc('0x47')]({'where':_0x430753})[_0x8adc('0x22')](function(_0x543189){if(_0x543189){throw new db[(_0x8adc('0x4e'))][(_0x8adc('0x4f'))](_0x8adc('0x50'));}return db[_0x8adc('0x2e')][_0x8adc('0x49')](_0x3d8f78[_0x8adc('0x48')]);})['then'](function(_0x5059d8){var _0x27c422=_0x3d8f78[_0x8adc('0x51')][_0x8adc('0x24')]({'plain':!![]});if(!_0x27c422)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c422[_0x8adc('0x52')]===_0x8adc('0x51')){var _0x20bd18=_0x5059d8[_0x8adc('0x24')]({'plain':!![]});return db[_0x8adc('0x53')]['find']({'where':{'name':_0x8adc('0x25'),'userProfileId':_0x27c422[_0x8adc('0x54')]},'raw':!![]})[_0x8adc('0x22')](function(_0x5e5f8c){if(_0x5e5f8c&&_0x5e5f8c[_0x8adc('0x55')]===0x0){return db['UserProfileResource'][_0x8adc('0x49')]({'name':_0x20bd18[_0x8adc('0x2a')],'resourceId':_0x20bd18['id'],'type':_0x5e5f8c['name'],'sectionId':_0x5e5f8c['id']},{})[_0x8adc('0x22')](function(){return _0x5059d8;});}else{return _0x5059d8;}})['catch'](function(_0x598323){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x598323);throw _0x598323;});}return _0x5059d8;})[_0x8adc('0x22')](respondWithResult(_0x27e04d,0xc9))[_0x8adc('0x42')](handleError(_0x27e04d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 2d33f64..42ace8e 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 _0x55bf=['exports','CannedAnswer','tools_canned_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x55bf,0xc9));var _0xf55b=function(_0x4f14fd,_0x176844){_0x4f14fd=_0x4f14fd-0x0;var _0x344461=_0x55bf[_0x4f14fd];return _0x344461;};'use strict';var _=require(_0xf55b('0x0'));var util=require(_0xf55b('0x1'));var logger=require(_0xf55b('0x2'))('api');var moment=require(_0xf55b('0x3'));var BPromise=require(_0xf55b('0x4'));var rp=require(_0xf55b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf55b('0x6'));var attributes=require(_0xf55b('0x7'));module[_0xf55b('0x8')]=function(_0x17a11c,_0xf739de){return _0x17a11c['define'](_0xf55b('0x9'),attributes,{'tableName':_0xf55b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5098=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x426384,_0x1901ab){var _0x3aa40a=function(_0x2db297){while(--_0x2db297){_0x426384['push'](_0x426384['shift']());}};_0x3aa40a(++_0x1901ab);}(_0x5098,0x170));var _0x8509=function(_0x32edd5,_0x46ceab){_0x32edd5=_0x32edd5-0x0;var _0x479a5b=_0x5098[_0x32edd5];return _0x479a5b;};'use strict';var _=require(_0x8509('0x0'));var util=require(_0x8509('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8509('0x2'));var BPromise=require(_0x8509('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8509('0x4'));var rimraf=require(_0x8509('0x5'));var config=require(_0x8509('0x6'));var attributes=require(_0x8509('0x7'));module[_0x8509('0x8')]=function(_0x37bff4,_0x1b7ca2){return _0x37bff4[_0x8509('0x9')](_0x8509('0xa'),attributes,{'tableName':_0x8509('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8509('0xc'),'collate':_0x8509('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index e247569..21fe20d 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(_0x45ea3c,_0x68593d){var _0x5c2cc4=function(_0x2cd55a){while(--_0x2cd55a){_0x45ea3c['push'](_0x45ea3c['shift']());}};_0x5c2cc4(++_0x68593d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x4c8155,_0x29d96b){var _0x23c24b=function(_0x1f8289){while(--_0x1f8289){_0x4c8155['push'](_0x4c8155['shift']());}};_0x23c24b(++_0x29d96b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 0aa51d8..079e231 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 _0x0b54=['isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x1b593c,_0x18541c){var _0x28a618=function(_0x5ae858){while(--_0x5ae858){_0x1b593c['push'](_0x1b593c['shift']());}};_0x28a618(++_0x18541c);}(_0x0b54,0x88));var _0x40b5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0b54[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x40b5('0x0'));var util=require(_0x40b5('0x1'));var path=require(_0x40b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x40b5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x40b5('0x4'));var config=require(_0x40b5('0x5'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x40b5('0x6')](_0x40b5('0x7'),auth[_0x40b5('0x8')](),controller[_0x40b5('0x9')]);router['post']('/',auth[_0x40b5('0x8')](),controller[_0x40b5('0xa')]);router[_0x40b5('0xb')](_0x40b5('0x7'),auth['isAuthenticated'](),controller[_0x40b5('0xc')]);router[_0x40b5('0xd')](_0x40b5('0x7'),auth[_0x40b5('0x8')](),controller[_0x40b5('0xe')]);module[_0x40b5('0xf')]=router; \ No newline at end of file +var _0x3a99=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','update','delete'];(function(_0x545a63,_0x5e103b){var _0x1b5c6d=function(_0x55912c){while(--_0x55912c){_0x545a63['push'](_0x545a63['shift']());}};_0x1b5c6d(++_0x5e103b);}(_0x3a99,0x1b3));var _0x93a9=function(_0x2877f4,_0x431490){_0x2877f4=_0x2877f4-0x0;var _0x537736=_0x3a99[_0x2877f4];return _0x537736;};'use strict';var multer=require(_0x93a9('0x0'));var util=require('util');var path=require(_0x93a9('0x1'));var timeout=require(_0x93a9('0x2'));var express=require(_0x93a9('0x3'));var router=express['Router']();var fs_extra=require(_0x93a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x93a9('0x5'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x93a9('0x6')]('/',auth[_0x93a9('0x7')](),controller[_0x93a9('0x8')]);router[_0x93a9('0x6')](_0x93a9('0x9'),auth[_0x93a9('0x7')](),controller[_0x93a9('0xa')]);router['post']('/',auth[_0x93a9('0x7')](),controller['create']);router['put']('/:id',auth[_0x93a9('0x7')](),controller[_0x93a9('0xb')]);router[_0x93a9('0xc')](_0x93a9('0x9'),auth[_0x93a9('0x7')](),controller[_0x93a9('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ff745b7..2427b84 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 _0x3e0f=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x3e0f,0xfc));var _0xf3e0=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x3e0f[_0x470b0a];return _0x4463f6;};'use strict';var Sequelize=require(_0xf3e0('0x0'));module[_0xf3e0('0x1')]={'calldate':{'type':Sequelize[_0xf3e0('0x2')],'allowNull':![],'defaultValue':_0xf3e0('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xf3e0('0x4')]},'dst':{'type':Sequelize[_0xf3e0('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf3e0('0x4')]},'dstchannel':{'type':Sequelize[_0xf3e0('0x4')]},'lastapp':{'type':Sequelize[_0xf3e0('0x4')]},'lastdata':{'type':Sequelize[_0xf3e0('0x4')]},'duration':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf3e0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf3e0('0x4')]},'userfield':{'type':Sequelize[_0xf3e0('0x4')]},'uniqueid':{'type':Sequelize[_0xf3e0('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf3e0('0x4')]},'peeraccount':{'type':Sequelize[_0xf3e0('0x4')]},'type':{'type':Sequelize[_0xf3e0('0x4')]},'tag':{'type':Sequelize[_0xf3e0('0x4')]}}; \ No newline at end of file +var _0x25b5=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x38ae35,_0x16c078){var _0x4b3e8f=function(_0x1d182a){while(--_0x1d182a){_0x38ae35['push'](_0x38ae35['shift']());}};_0x4b3e8f(++_0x16c078);}(_0x25b5,0x198));var _0x525b=function(_0x3bd1f8,_0xb09174){_0x3bd1f8=_0x3bd1f8-0x0;var _0x51ea41=_0x25b5[_0x3bd1f8];return _0x51ea41;};'use strict';var Sequelize=require(_0x525b('0x0'));module[_0x525b('0x1')]={'calldate':{'type':Sequelize[_0x525b('0x2')],'allowNull':![],'defaultValue':_0x525b('0x3')},'clid':{'type':Sequelize[_0x525b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x525b('0x4')]},'dcontext':{'type':Sequelize[_0x525b('0x4')]},'channel':{'type':Sequelize[_0x525b('0x4')]},'dstchannel':{'type':Sequelize[_0x525b('0x4')]},'lastapp':{'type':Sequelize[_0x525b('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x525b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x525b('0x4')]},'userfield':{'type':Sequelize[_0x525b('0x4')]},'uniqueid':{'type':Sequelize[_0x525b('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x525b('0x4')]},'peeraccount':{'type':Sequelize[_0x525b('0x4')]},'type':{'type':Sequelize[_0x525b('0x4')]},'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 631cfc5..74936bb 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 _0x8085=['name','send','index','map','Cdr','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x465391,_0x57afd5){var _0x4d9970=function(_0x1156c4){while(--_0x1156c4){_0x465391['push'](_0x465391['shift']());}};_0x4d9970(++_0x57afd5);}(_0x8085,0x71));var _0x5808=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x8085[_0x11a220];return _0x20d8fe;};'use strict';var emlformat=require(_0x5808('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5808('0x1'));var rp=require(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5808('0x5'));var sox=require(_0x5808('0x6'));var csv=require('to-csv');var ejs=require(_0x5808('0x7'));var fs=require('fs');var fs_extra=require(_0x5808('0x8'));var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0xe'));var querystring=require(_0x5808('0xf'));var Papa=require(_0x5808('0x10'));var Redis=require(_0x5808('0x11'));var authService=require(_0x5808('0x12'));var qs=require(_0x5808('0x13'));var as=require(_0x5808('0x14'));var hardwareService=require(_0x5808('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x16'));var config=require(_0x5808('0x17'));var licenseUtil=require(_0x5808('0x18'));var db=require(_0x5808('0x19'))['db'];function respondWithStatusCode(_0xab4f46,_0x19be03){_0x19be03=_0x19be03||0xcc;return function(_0x10572d){if(_0x10572d){return _0xab4f46['sendStatus'](_0x19be03);}return _0xab4f46['status'](_0x19be03)[_0x5808('0x1a')]();};}function respondWithResult(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xc8;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1b')](_0x3582d6)[_0x5808('0x1c')](_0x3e7c09);}};}function respondWithFilteredResult(_0x299b22,_0x2af9da){return function(_0x1dda8d){if(_0x1dda8d){var _0x46dd8a=typeof _0x2af9da[_0x5808('0x1d')]==='undefined'&&typeof _0x2af9da[_0x5808('0x1e')]==='undefined';var _0x406e65=_0x1dda8d[_0x5808('0x1f')];var _0x3bf0ee=_0x46dd8a?0x0:_0x2af9da['offset'];var _0x9e58d4=_0x46dd8a?_0x1dda8d[_0x5808('0x1f')]:_0x2af9da['offset']+_0x2af9da['limit'];var _0x3c7c02;if(_0x9e58d4>=_0x406e65){_0x9e58d4=_0x406e65;_0x3c7c02=0xc8;}else{_0x3c7c02=0xce;}_0x299b22['status'](_0x3c7c02);return _0x299b22[_0x5808('0x20')](_0x5808('0x21'),_0x3bf0ee+'-'+_0x9e58d4+'/'+_0x406e65)[_0x5808('0x1c')](_0x1dda8d);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x22')](_0xe82ad0);}return _0x578d70[_0x5808('0x23')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x24')](_0x39bca3)[_0x5808('0x25')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x26')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1a')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x27')](_0x27c991[_0x5808('0x28')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x29')];}_0x24ee0f[_0x5808('0x1b')](_0x2c2cb5)[_0x5808('0x2a')](_0x27c991);};}exports[_0x5808('0x2b')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=_[_0x5808('0x2c')](db[_0x5808('0x2d')]['rawAttributes'],function(_0x3faa07){return{'name':_0x3faa07[_0x5808('0x2e')],'type':_0x3faa07[_0x5808('0x2f')][_0x5808('0x30')]};});_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x2c')](_0x4f6342,'name');_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x28c1eb[_0x5808('0x32')]);_0x4ad6d8['filters']=_['intersection'](_0x4ad6d8[_0x5808('0x31')],_0x4ad6d8['query']);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x35')](_0x4ad6d8['model'],qs[_0x5808('0x36')](_0x28c1eb[_0x5808('0x32')]['fields']));_0x1117ac['attributes']=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8['model'];if(!_0x28c1eb[_0x5808('0x32')][_0x5808('0x37')](_0x5808('0x38'))){_0x1117ac['limit']=qs[_0x5808('0x1e')](_0x28c1eb['query'][_0x5808('0x1e')]);_0x1117ac['offset']=qs['offset'](_0x28c1eb[_0x5808('0x32')][_0x5808('0x1d')]);}_0x1117ac[_0x5808('0x39')]=qs['sort'](_0x28c1eb['query'][_0x5808('0x3a')]);_0x1117ac[_0x5808('0x3b')]=qs['filters'](_[_0x5808('0x3c')](_0x28c1eb[_0x5808('0x32')],_0x4ad6d8[_0x5808('0x3d')]),_0x4f6342);if(_0x28c1eb['query'][_0x5808('0x3e')]){_0x1117ac[_0x5808('0x3b')]=_[_0x5808('0x3f')](_0x1117ac['where'],{'$or':_[_0x5808('0x2c')](_0x4f6342,function(_0x12a045){if(_0x12a045['type']!=='VIRTUAL'){var _0x477278={};_0x477278[_0x12a045['name']]={'$like':'%'+_0x28c1eb[_0x5808('0x32')][_0x5808('0x3e')]+'%'};return _0x477278;}})});}_0x1117ac=_[_0x5808('0x3f')]({},_0x1117ac,_0x28c1eb[_0x5808('0x40')]);var _0x21fc36={'where':_0x1117ac['where']};return db['Cdr'][_0x5808('0x1f')](_0x21fc36)[_0x5808('0x25')](function(_0x402b4e){_0x560e83['count']=_0x402b4e;if(_0x28c1eb[_0x5808('0x32')][_0x5808('0x41')]){_0x1117ac[_0x5808('0x42')]=[{'all':!![]}];}return db[_0x5808('0x2d')][_0x5808('0x43')](_0x1117ac);})['then'](function(_0x1130c8){_0x560e83[_0x5808('0x44')]=_0x1130c8;return _0x560e83;})[_0x5808('0x25')](respondWithFilteredResult(_0x19ac63,_0x1117ac))['catch'](handleError(_0x19ac63,null));};exports[_0x5808('0x45')]=function(_0x287e07,_0xc62608){var _0x5e1230={'raw':!![],'where':{'id':_0x287e07[_0x5808('0x46')]['id']}},_0x5dcb50={};_0x5dcb50[_0x5808('0x31')]=_[_0x5808('0x33')](db[_0x5808('0x2d')][_0x5808('0x47')]);_0x5dcb50[_0x5808('0x32')]=_[_0x5808('0x33')](_0x287e07[_0x5808('0x32')]);_0x5dcb50[_0x5808('0x3d')]=_[_0x5808('0x35')](_0x5dcb50[_0x5808('0x31')],_0x5dcb50[_0x5808('0x32')]);_0x5e1230[_0x5808('0x34')]=_['intersection'](_0x5dcb50['model'],qs[_0x5808('0x36')](_0x287e07[_0x5808('0x32')][_0x5808('0x36')]));_0x5e1230[_0x5808('0x34')]=_0x5e1230[_0x5808('0x34')][_0x5808('0x48')]?_0x5e1230[_0x5808('0x34')]:_0x5dcb50['model'];if(_0x287e07[_0x5808('0x32')]['includeAll']){_0x5e1230[_0x5808('0x42')]=[{'all':!![]}];}_0x5e1230=_['merge']({},_0x5e1230,_0x287e07[_0x5808('0x40')]);return db['Cdr']['find'](_0x5e1230)['then'](handleEntityNotFound(_0xc62608,null))[_0x5808('0x25')](respondWithResult(_0xc62608,null))[_0x5808('0x49')](handleError(_0xc62608,null));};exports['create']=function(_0x46c8ed,_0x4568d0){return db[_0x5808('0x2d')]['create'](_0x46c8ed[_0x5808('0x4a')],{})['then'](respondWithResult(_0x4568d0,0xc9))[_0x5808('0x49')](handleError(_0x4568d0,null));};exports[_0x5808('0x24')]=function(_0x13fe11,_0x5cc977){if(_0x13fe11[_0x5808('0x4a')]['id']){delete _0x13fe11[_0x5808('0x4a')]['id'];}return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x13fe11['params']['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x5cc977,null))[_0x5808('0x25')](saveUpdates(_0x13fe11[_0x5808('0x4a')],null))[_0x5808('0x25')](respondWithResult(_0x5cc977,null))[_0x5808('0x49')](handleError(_0x5cc977,null));};exports[_0x5808('0x26')]=function(_0x5572f3,_0x23d2fe){return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x5572f3[_0x5808('0x46')]['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x23d2fe,null))['then'](removeEntity(_0x23d2fe,null))[_0x5808('0x49')](handleError(_0x23d2fe,null));};exports[_0x5808('0x4c')]=function(_0xc2c5d7,_0x44ff0a){return db[_0x5808('0x2d')][_0x5808('0x4c')]()['then'](respondWithResult(_0x44ff0a,null))[_0x5808('0x49')](handleError(_0x44ff0a,null));}; \ No newline at end of file +var _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ed70058..da30c64 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5540b8,_0x46b124){var _0x3f0431=function(_0x4cd137){while(--_0x4cd137){_0x5540b8['push'](_0x5540b8['shift']());}};_0x3f0431(++_0x46b124);}(_0x7a54,0x106));var _0x47a5=function(_0x96feab,_0x2dec49){_0x96feab=_0x96feab-0x0;var _0x1ecb6c=_0x7a54[_0x96feab];return _0x1ecb6c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x206c6f,_0x1043a8){var _0x1f9f8a=function(_0xf0cb30){while(--_0xf0cb30){_0x206c6f['push'](_0x206c6f['shift']());}};_0x1f9f8a(++_0x1043a8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 19ced42..9fe9caa 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 _0x7918=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','debug'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x7918,0x13f));var _0x8791=function(_0x14b287,_0x2e324e){_0x14b287=_0x14b287-0x0;var _0x6b3e9b=_0x7918[_0x14b287];return _0x6b3e9b;};'use strict';var _=require(_0x8791('0x0'));var util=require(_0x8791('0x1'));var moment=require(_0x8791('0x2'));var BPromise=require(_0x8791('0x3'));var rs=require(_0x8791('0x4'));var fs=require('fs');var Redis=require(_0x8791('0x5'));var db=require(_0x8791('0x6'))['db'];var utils=require(_0x8791('0x7'));var logger=require(_0x8791('0x8'))(_0x8791('0x9'));var config=require(_0x8791('0xa'));var jayson=require(_0x8791('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53c4ed,_0x4c610c,_0x449059){return new BPromise(function(_0x12a75d,_0x128f13){return client[_0x8791('0xc')](_0x53c4ed,_0x449059)[_0x8791('0xd')](function(_0x533e81){logger[_0x8791('0xe')](_0x8791('0xf'),_0x4c610c,'request\x20sent');logger[_0x8791('0x10')](_0x8791('0x11'),_0x4c610c,_0x8791('0x12'),JSON[_0x8791('0x13')](_0x533e81));if(_0x533e81[_0x8791('0x14')]){if(_0x533e81['error'][_0x8791('0x15')]===0x1f4){logger[_0x8791('0x14')](_0x8791('0xf'),_0x4c610c,_0x533e81[_0x8791('0x14')][_0x8791('0x16')]);return _0x128f13(_0x533e81[_0x8791('0x14')][_0x8791('0x16')]);}logger[_0x8791('0x14')](_0x8791('0xf'),_0x4c610c,_0x533e81[_0x8791('0x14')][_0x8791('0x16')]);return _0x12a75d(_0x533e81[_0x8791('0x14')][_0x8791('0x16')]);}else{logger[_0x8791('0xe')](_0x8791('0xf'),_0x4c610c,_0x8791('0x12'));_0x12a75d(_0x533e81['result']['message']);}})[_0x8791('0x17')](function(_0x4b0ee0){logger[_0x8791('0x14')](_0x8791('0xf'),_0x4c610c,_0x4b0ee0);_0x128f13(_0x4b0ee0);});});} \ No newline at end of file +var _0x90b9=['rpc','../../config/environment','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x550500,_0x8dd443){var _0x113660=function(_0x4d97d3){while(--_0x4d97d3){_0x550500['push'](_0x550500['shift']());}};_0x113660(++_0x8dd443);}(_0x90b9,0x123));var _0x990b=function(_0x5c766a,_0x980e19){_0x5c766a=_0x5c766a-0x0;var _0x11491b=_0x90b9[_0x5c766a];return _0x11491b;};'use strict';var _=require(_0x990b('0x0'));var util=require(_0x990b('0x1'));var moment=require(_0x990b('0x2'));var BPromise=require(_0x990b('0x3'));var rs=require(_0x990b('0x4'));var fs=require('fs');var Redis=require(_0x990b('0x5'));var db=require(_0x990b('0x6'))['db'];var utils=require(_0x990b('0x7'));var logger=require('../../config/logger')(_0x990b('0x8'));var config=require(_0x990b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x990b('0xa')][_0x990b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3db4bf,_0x131e9a,_0x102cd0){return new BPromise(function(_0x49886b,_0x1b505a){return client['request'](_0x3db4bf,_0x102cd0)[_0x990b('0xc')](function(_0x3a22da){logger['info'](_0x990b('0xd'),_0x131e9a,_0x990b('0xe'));logger[_0x990b('0xf')](_0x990b('0x10'),_0x131e9a,'request\x20sent',JSON[_0x990b('0x11')](_0x3a22da));if(_0x3a22da[_0x990b('0x12')]){if(_0x3a22da[_0x990b('0x12')][_0x990b('0x13')]===0x1f4){logger['error'](_0x990b('0xd'),_0x131e9a,_0x3a22da['error'][_0x990b('0x14')]);return _0x1b505a(_0x3a22da[_0x990b('0x12')][_0x990b('0x14')]);}logger['error'](_0x990b('0xd'),_0x131e9a,_0x3a22da[_0x990b('0x12')][_0x990b('0x14')]);return _0x49886b(_0x3a22da[_0x990b('0x12')][_0x990b('0x14')]);}else{logger[_0x990b('0x15')](_0x990b('0xd'),_0x131e9a,_0x990b('0xe'));_0x49886b(_0x3a22da['result'][_0x990b('0x14')]);}})[_0x990b('0x16')](function(_0x5c7a70){logger[_0x990b('0x12')]('Cdr,\x20%s,\x20%s',_0x131e9a,_0x5c7a70);_0x1b505a(_0x5c7a70);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5ab456b..f323518 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_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('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 547434f..11ac862 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 _0x56d3=['exports','STRING','noop','TEXT'];(function(_0x395a03,_0x362943){var _0x8de6f=function(_0x56ae29){while(--_0x56ae29){_0x395a03['push'](_0x395a03['shift']());}};_0x8de6f(++_0x362943);}(_0x56d3,0x134));var _0x356d=function(_0x542154,_0x5d3023){_0x542154=_0x542154-0x0;var _0x40b45b=_0x56d3[_0x542154];return _0x40b45b;};'use strict';var Sequelize=require('sequelize');module[_0x356d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x356d('0x1')],'allowNull':![],'defaultValue':_0x356d('0x2')},'appdata':{'type':Sequelize[_0x356d('0x3')]()},'description':{'type':Sequelize[_0x356d('0x1')]},'interval':{'type':Sequelize[_0x356d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc127=['exports','INTEGER','TEXT','STRING','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc127,0x176));var _0x7c12=function(_0x3d9268,_0x12d933){_0x3d9268=_0x3d9268-0x0;var _0xc25ae1=_0xc127[_0x3d9268];return _0xc25ae1;};'use strict';var Sequelize=require(_0x7c12('0x0'));module[_0x7c12('0x1')]={'priority':{'type':Sequelize[_0x7c12('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7c12('0x3')]()},'description':{'type':Sequelize[_0x7c12('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index f033638..e725013 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 _0x115a=['undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ChatApplication','rawAttributes','query','intersection','model','attributes','fields','include','merge','options','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x12a7c2,_0x36cebc){var _0x18b2ca=function(_0x5f5d5b){while(--_0x5f5d5b){_0x12a7c2['push'](_0x12a7c2['shift']());}};_0x18b2ca(++_0x36cebc);}(_0x115a,0x91));var _0xa115=function(_0x218212,_0x39f43f){_0x218212=_0x218212-0x0;var _0xdb2d49=_0x115a[_0x218212];return _0xdb2d49;};'use strict';var emlformat=require(_0xa115('0x0'));var rimraf=require(_0xa115('0x1'));var zipdir=require(_0xa115('0x2'));var jsonpatch=require(_0xa115('0x3'));var rp=require(_0xa115('0x4'));var moment=require('moment');var BPromise=require(_0xa115('0x5'));var Mustache=require('mustache');var util=require(_0xa115('0x6'));var path=require(_0xa115('0x7'));var sox=require(_0xa115('0x8'));var csv=require(_0xa115('0x9'));var ejs=require(_0xa115('0xa'));var fs=require('fs');var fs_extra=require(_0xa115('0xb'));var _=require('lodash');var squel=require(_0xa115('0xc'));var crypto=require(_0xa115('0xd'));var jsforce=require(_0xa115('0xe'));var deskjs=require(_0xa115('0xf'));var toCsv=require(_0xa115('0x9'));var querystring=require(_0xa115('0x10'));var Papa=require(_0xa115('0x11'));var Redis=require(_0xa115('0x12'));var authService=require(_0xa115('0x13'));var qs=require(_0xa115('0x14'));var as=require(_0xa115('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa115('0x16'))(_0xa115('0x17'));var utils=require(_0xa115('0x18'));var config=require(_0xa115('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa115('0x1a'))['db'];function respondWithStatusCode(_0x3f1796,_0x207857){_0x207857=_0x207857||0xcc;return function(_0x279a25){if(_0x279a25){return _0x3f1796[_0xa115('0x1b')](_0x207857);}return _0x3f1796[_0xa115('0x1c')](_0x207857)[_0xa115('0x1d')]();};}function respondWithResult(_0x5c97ca,_0x6c7c05){_0x6c7c05=_0x6c7c05||0xc8;return function(_0x427cd9){if(_0x427cd9){return _0x5c97ca[_0xa115('0x1c')](_0x6c7c05)[_0xa115('0x1e')](_0x427cd9);}};}function respondWithFilteredResult(_0x2937ed,_0x2c74bf){return function(_0x54b14f){if(_0x54b14f){var _0x325427=typeof _0x2c74bf[_0xa115('0x1f')]===_0xa115('0x20')&&typeof _0x2c74bf[_0xa115('0x21')]===_0xa115('0x20');var _0x10d951=_0x54b14f['count'];var _0x356489=_0x325427?0x0:_0x2c74bf[_0xa115('0x1f')];var _0x2befe4=_0x325427?_0x54b14f['count']:_0x2c74bf['offset']+_0x2c74bf[_0xa115('0x21')];var _0x423895;if(_0x2befe4>=_0x10d951){_0x2befe4=_0x10d951;_0x423895=0xc8;}else{_0x423895=0xce;}_0x2937ed['status'](_0x423895);return _0x2937ed[_0xa115('0x22')](_0xa115('0x23'),_0x356489+'-'+_0x2befe4+'/'+_0x10d951)[_0xa115('0x1e')](_0x54b14f);}return null;};}function patchUpdates(_0x39a598){return function(_0x271ddc){try{jsonpatch[_0xa115('0x24')](_0x271ddc,_0x39a598,!![]);}catch(_0x2f6938){return BPromise[_0xa115('0x25')](_0x2f6938);}return _0x271ddc[_0xa115('0x26')]();};}function saveUpdates(_0x85deca,_0x5eaa89){return function(_0x910813){if(_0x910813){return _0x910813[_0xa115('0x27')](_0x85deca)[_0xa115('0x28')](function(_0x2e7798){return _0x2e7798;});}return null;};}function removeEntity(_0x21db37,_0x102daf){return function(_0x31950a){if(_0x31950a){return _0x31950a[_0xa115('0x29')]()[_0xa115('0x28')](function(){_0x21db37['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb0ab62,_0x5a3c5b){return function(_0x1b1aba){if(!_0x1b1aba){_0xb0ab62[_0xa115('0x1b')](0x194);}return _0x1b1aba;};}function handleError(_0x39b601,_0x43f164){_0x43f164=_0x43f164||0x1f4;return function(_0x2667b3){logger['error'](_0x2667b3[_0xa115('0x2a')]);if(_0x2667b3[_0xa115('0x2b')]){delete _0x2667b3[_0xa115('0x2b')];}_0x39b601['status'](_0x43f164)[_0xa115('0x2c')](_0x2667b3);};}exports['show']=function(_0x55ca62,_0x2fe6d6){var _0x37952c={'raw':!![],'where':{'id':_0x55ca62['params']['id']}},_0x3ea09e={};_0x3ea09e['model']=_['keys'](db[_0xa115('0x2d')][_0xa115('0x2e')]);_0x3ea09e['query']=_['keys'](_0x55ca62[_0xa115('0x2f')]);_0x3ea09e['filters']=_[_0xa115('0x30')](_0x3ea09e[_0xa115('0x31')],_0x3ea09e[_0xa115('0x2f')]);_0x37952c[_0xa115('0x32')]=_[_0xa115('0x30')](_0x3ea09e['model'],qs[_0xa115('0x33')](_0x55ca62[_0xa115('0x2f')][_0xa115('0x33')]));_0x37952c[_0xa115('0x32')]=_0x37952c['attributes']['length']?_0x37952c[_0xa115('0x32')]:_0x3ea09e[_0xa115('0x31')];if(_0x55ca62[_0xa115('0x2f')]['includeAll']){_0x37952c[_0xa115('0x34')]=[{'all':!![]}];}_0x37952c=_[_0xa115('0x35')]({},_0x37952c,_0x55ca62[_0xa115('0x36')]);return db[_0xa115('0x2d')][_0xa115('0x37')](_0x37952c)[_0xa115('0x28')](handleEntityNotFound(_0x2fe6d6,null))['then'](respondWithResult(_0x2fe6d6,null))['catch'](handleError(_0x2fe6d6,null));};exports[_0xa115('0x27')]=function(_0x1306d1,_0x308330){if(_0x1306d1[_0xa115('0x38')]['id']){delete _0x1306d1[_0xa115('0x38')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x1306d1['params']['id']}})[_0xa115('0x28')](handleEntityNotFound(_0x308330,null))[_0xa115('0x28')](saveUpdates(_0x1306d1[_0xa115('0x38')],null))[_0xa115('0x28')](respondWithResult(_0x308330,null))[_0xa115('0x39')](handleError(_0x308330,null));};exports['destroy']=function(_0x21981a,_0x368592){return db['ChatApplication'][_0xa115('0x37')]({'where':{'id':_0x21981a[_0xa115('0x3a')]['id']}})[_0xa115('0x28')](handleEntityNotFound(_0x368592,null))[_0xa115('0x28')](removeEntity(_0x368592,null))[_0xa115('0x39')](handleError(_0x368592,null));}; \ No newline at end of file +var _0x4d6e=['fields','length','include','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','send','keys','ChatApplication','query','intersection','model','attributes'];(function(_0x53aa99,_0x3120ca){var _0x104667=function(_0x5961c7){while(--_0x5961c7){_0x53aa99['push'](_0x53aa99['shift']());}};_0x104667(++_0x3120ca);}(_0x4d6e,0x77));var _0xe4d6=function(_0x179b7b,_0x57b44d){_0x179b7b=_0x179b7b-0x0;var _0x5eea20=_0x4d6e[_0x179b7b];return _0x5eea20;};'use strict';var emlformat=require(_0xe4d6('0x0'));var rimraf=require(_0xe4d6('0x1'));var zipdir=require(_0xe4d6('0x2'));var jsonpatch=require(_0xe4d6('0x3'));var rp=require(_0xe4d6('0x4'));var moment=require('moment');var BPromise=require(_0xe4d6('0x5'));var Mustache=require(_0xe4d6('0x6'));var util=require(_0xe4d6('0x7'));var path=require(_0xe4d6('0x8'));var sox=require(_0xe4d6('0x9'));var csv=require(_0xe4d6('0xa'));var ejs=require(_0xe4d6('0xb'));var fs=require('fs');var fs_extra=require(_0xe4d6('0xc'));var _=require(_0xe4d6('0xd'));var squel=require(_0xe4d6('0xe'));var crypto=require(_0xe4d6('0xf'));var jsforce=require(_0xe4d6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe4d6('0xa'));var querystring=require(_0xe4d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xe4d6('0x12'));var authService=require(_0xe4d6('0x13'));var qs=require(_0xe4d6('0x14'));var as=require(_0xe4d6('0x15'));var hardwareService=require(_0xe4d6('0x16'));var logger=require(_0xe4d6('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe4d6('0x18'));var licenseUtil=require(_0xe4d6('0x19'));var db=require(_0xe4d6('0x1a'))['db'];function respondWithStatusCode(_0x5a14e5,_0x1a80eb){_0x1a80eb=_0x1a80eb||0xcc;return function(_0x3f7441){if(_0x3f7441){return _0x5a14e5['sendStatus'](_0x1a80eb);}return _0x5a14e5[_0xe4d6('0x1b')](_0x1a80eb)[_0xe4d6('0x1c')]();};}function respondWithResult(_0x5dbcc5,_0xdc7f40){_0xdc7f40=_0xdc7f40||0xc8;return function(_0x780caa){if(_0x780caa){return _0x5dbcc5[_0xe4d6('0x1b')](_0xdc7f40)[_0xe4d6('0x1d')](_0x780caa);}};}function respondWithFilteredResult(_0x53ca26,_0x2e04a9){return function(_0x28e001){if(_0x28e001){var _0x3dbe31=typeof _0x2e04a9[_0xe4d6('0x1e')]==='undefined'&&typeof _0x2e04a9[_0xe4d6('0x1f')]==='undefined';var _0x526dd6=_0x28e001[_0xe4d6('0x20')];var _0x351a17=_0x3dbe31?0x0:_0x2e04a9[_0xe4d6('0x1e')];var _0x1928f9=_0x3dbe31?_0x28e001[_0xe4d6('0x20')]:_0x2e04a9['offset']+_0x2e04a9[_0xe4d6('0x1f')];var _0x42b261;if(_0x1928f9>=_0x526dd6){_0x1928f9=_0x526dd6;_0x42b261=0xc8;}else{_0x42b261=0xce;}_0x53ca26[_0xe4d6('0x1b')](_0x42b261);return _0x53ca26[_0xe4d6('0x21')](_0xe4d6('0x22'),_0x351a17+'-'+_0x1928f9+'/'+_0x526dd6)[_0xe4d6('0x1d')](_0x28e001);}return null;};}function patchUpdates(_0x26b9b6){return function(_0x27e824){try{jsonpatch['apply'](_0x27e824,_0x26b9b6,!![]);}catch(_0x1afb27){return BPromise['reject'](_0x1afb27);}return _0x27e824[_0xe4d6('0x23')]();};}function saveUpdates(_0x34e7ca,_0x31f569){return function(_0x162b57){if(_0x162b57){return _0x162b57[_0xe4d6('0x24')](_0x34e7ca)[_0xe4d6('0x25')](function(_0x455011){return _0x455011;});}return null;};}function removeEntity(_0x202f67,_0x59233f){return function(_0x404fe1){if(_0x404fe1){return _0x404fe1[_0xe4d6('0x26')]()['then'](function(){_0x202f67[_0xe4d6('0x1b')](0xcc)[_0xe4d6('0x1c')]();});}};}function handleEntityNotFound(_0x2807e7,_0x3e8f41){return function(_0x13aeec){if(!_0x13aeec){_0x2807e7[_0xe4d6('0x27')](0x194);}return _0x13aeec;};}function handleError(_0x1913ba,_0xb4fe6a){_0xb4fe6a=_0xb4fe6a||0x1f4;return function(_0x53110a){logger[_0xe4d6('0x28')](_0x53110a[_0xe4d6('0x29')]);if(_0x53110a['name']){delete _0x53110a['name'];}_0x1913ba['status'](_0xb4fe6a)[_0xe4d6('0x2a')](_0x53110a);};}exports['show']=function(_0x3d2efe,_0x4b83fa){var _0x4f0485={'raw':!![],'where':{'id':_0x3d2efe['params']['id']}},_0x39f7d5={};_0x39f7d5['model']=_[_0xe4d6('0x2b')](db[_0xe4d6('0x2c')]['rawAttributes']);_0x39f7d5['query']=_[_0xe4d6('0x2b')](_0x3d2efe[_0xe4d6('0x2d')]);_0x39f7d5['filters']=_[_0xe4d6('0x2e')](_0x39f7d5[_0xe4d6('0x2f')],_0x39f7d5[_0xe4d6('0x2d')]);_0x4f0485[_0xe4d6('0x30')]=_[_0xe4d6('0x2e')](_0x39f7d5[_0xe4d6('0x2f')],qs['fields'](_0x3d2efe['query'][_0xe4d6('0x31')]));_0x4f0485[_0xe4d6('0x30')]=_0x4f0485['attributes'][_0xe4d6('0x32')]?_0x4f0485['attributes']:_0x39f7d5[_0xe4d6('0x2f')];if(_0x3d2efe['query']['includeAll']){_0x4f0485[_0xe4d6('0x33')]=[{'all':!![]}];}_0x4f0485=_['merge']({},_0x4f0485,_0x3d2efe['options']);return db[_0xe4d6('0x2c')][_0xe4d6('0x34')](_0x4f0485)[_0xe4d6('0x25')](handleEntityNotFound(_0x4b83fa,null))[_0xe4d6('0x25')](respondWithResult(_0x4b83fa,null))['catch'](handleError(_0x4b83fa,null));};exports[_0xe4d6('0x24')]=function(_0x1ec931,_0x822a27){if(_0x1ec931[_0xe4d6('0x35')]['id']){delete _0x1ec931[_0xe4d6('0x35')]['id'];}return db[_0xe4d6('0x2c')][_0xe4d6('0x34')]({'where':{'id':_0x1ec931[_0xe4d6('0x36')]['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x822a27,null))[_0xe4d6('0x25')](saveUpdates(_0x1ec931['body'],null))[_0xe4d6('0x25')](respondWithResult(_0x822a27,null))['catch'](handleError(_0x822a27,null));};exports[_0xe4d6('0x26')]=function(_0x36c147,_0x27c76f){return db[_0xe4d6('0x2c')]['find']({'where':{'id':_0x36c147['params']['id']}})[_0xe4d6('0x25')](handleEntityNotFound(_0x27c76f,null))[_0xe4d6('0x25')](removeEntity(_0x27c76f,null))[_0xe4d6('0x37')](handleError(_0x27c76f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 778b2f7..a58e9ed 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 _0xc03d=['path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x550564,_0x5c649e){var _0x38e1f8=function(_0x4fed0e){while(--_0x4fed0e){_0x550564['push'](_0x550564['shift']());}};_0x38e1f8(++_0x5c649e);}(_0xc03d,0x127));var _0xdc03=function(_0x4239a2,_0x43a0f7){_0x4239a2=_0x4239a2-0x0;var _0x36ebee=_0xc03d[_0x4239a2];return _0x36ebee;};'use strict';var _=require(_0xdc03('0x0'));var util=require(_0xdc03('0x1'));var logger=require(_0xdc03('0x2'))('api');var moment=require(_0xdc03('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc03('0x4'));var rimraf=require(_0xdc03('0x5'));var config=require(_0xdc03('0x6'));var attributes=require(_0xdc03('0x7'));module['exports']=function(_0x2fc71d,_0x36ec86){return _0x2fc71d[_0xdc03('0x8')](_0xdc03('0x9'),attributes,{'tableName':_0xdc03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc03('0xb'),'collate':_0xdc03('0xc')});}; \ No newline at end of file +var _0x91f6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4a636e,_0x464b51){var _0x27ab69=function(_0x5349a6){while(--_0x5349a6){_0x4a636e['push'](_0x4a636e['shift']());}};_0x27ab69(++_0x464b51);}(_0x91f6,0x168));var _0x691f=function(_0x3fd62f,_0x1ac386){_0x3fd62f=_0x3fd62f-0x0;var _0x38dbfd=_0x91f6[_0x3fd62f];return _0x38dbfd;};'use strict';var _=require('lodash');var util=require(_0x691f('0x0'));var logger=require(_0x691f('0x1'))(_0x691f('0x2'));var moment=require(_0x691f('0x3'));var BPromise=require(_0x691f('0x4'));var rp=require(_0x691f('0x5'));var fs=require('fs');var path=require(_0x691f('0x6'));var rimraf=require(_0x691f('0x7'));var config=require('../../config/environment');var attributes=require(_0x691f('0x8'));module[_0x691f('0x9')]=function(_0x34049f,_0x451fe8){return _0x34049f[_0x691f('0xa')](_0x691f('0xb'),attributes,{'tableName':_0x691f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x691f('0xd'),'collate':_0x691f('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index deec7ed..182a8b3 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 _0x212e=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent'];(function(_0x5d1c0c,_0x4706fc){var _0x28034f=function(_0xf82523){while(--_0xf82523){_0x5d1c0c['push'](_0x5d1c0c['shift']());}};_0x28034f(++_0x4706fc);}(_0x212e,0x81));var _0xe212=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0x212e[_0x18d710];return _0x54f4eb;};'use strict';var _=require(_0xe212('0x0'));var util=require('util');var moment=require(_0xe212('0x1'));var BPromise=require(_0xe212('0x2'));var rs=require(_0xe212('0x3'));var fs=require('fs');var Redis=require(_0xe212('0x4'));var db=require(_0xe212('0x5'))['db'];var utils=require(_0xe212('0x6'));var logger=require(_0xe212('0x7'))(_0xe212('0x8'));var config=require(_0xe212('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe212('0xa')][_0xe212('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3adb97,_0x16caf9,_0x35b3fe){return new BPromise(function(_0x4c9299,_0x74def1){return client['request'](_0x3adb97,_0x35b3fe)[_0xe212('0xc')](function(_0xa28cba){logger[_0xe212('0xd')]('ChatApplication,\x20%s,\x20%s',_0x16caf9,_0xe212('0xe'));logger[_0xe212('0xf')](_0xe212('0x10'),_0x16caf9,_0xe212('0xe'),JSON[_0xe212('0x11')](_0xa28cba));if(_0xa28cba[_0xe212('0x12')]){if(_0xa28cba[_0xe212('0x12')][_0xe212('0x13')]===0x1f4){logger[_0xe212('0x12')](_0xe212('0x14'),_0x16caf9,_0xa28cba[_0xe212('0x12')][_0xe212('0x15')]);return _0x74def1(_0xa28cba[_0xe212('0x12')][_0xe212('0x15')]);}logger[_0xe212('0x12')]('ChatApplication,\x20%s,\x20%s',_0x16caf9,_0xa28cba['error'][_0xe212('0x15')]);return _0x4c9299(_0xa28cba['error'][_0xe212('0x15')]);}else{logger['info'](_0xe212('0x14'),_0x16caf9,_0xe212('0xe'));_0x4c9299(_0xa28cba[_0xe212('0x16')][_0xe212('0x15')]);}})[_0xe212('0x17')](function(_0x161f0d){logger[_0xe212('0x12')]('ChatApplication,\x20%s,\x20%s',_0x16caf9,_0x161f0d);_0x74def1(_0x161f0d);});});} \ No newline at end of file +var _0xbd44=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x3884df,_0x12bbef){var _0x3b5d01=function(_0x8d77f){while(--_0x8d77f){_0x3884df['push'](_0x3884df['shift']());}};_0x3b5d01(++_0x12bbef);}(_0xbd44,0x185));var _0x4bd4=function(_0x4858e7,_0x2c9ba9){_0x4858e7=_0x4858e7-0x0;var _0x1c3337=_0xbd44[_0x4858e7];return _0x1c3337;};'use strict';var _=require(_0x4bd4('0x0'));var util=require(_0x4bd4('0x1'));var moment=require('moment');var BPromise=require(_0x4bd4('0x2'));var rs=require(_0x4bd4('0x3'));var fs=require('fs');var Redis=require(_0x4bd4('0x4'));var db=require(_0x4bd4('0x5'))['db'];var utils=require(_0x4bd4('0x6'));var logger=require(_0x4bd4('0x7'))(_0x4bd4('0x8'));var config=require(_0x4bd4('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bd4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x289281,_0x340937,_0x3edf5c){return new BPromise(function(_0x1e1166,_0x59512a){return client[_0x4bd4('0xb')](_0x289281,_0x3edf5c)[_0x4bd4('0xc')](function(_0x3d2836){logger[_0x4bd4('0xd')](_0x4bd4('0xe'),_0x340937,'request\x20sent');logger[_0x4bd4('0xf')](_0x4bd4('0x10'),_0x340937,_0x4bd4('0x11'),JSON[_0x4bd4('0x12')](_0x3d2836));if(_0x3d2836['error']){if(_0x3d2836[_0x4bd4('0x13')]['code']===0x1f4){logger[_0x4bd4('0x13')](_0x4bd4('0xe'),_0x340937,_0x3d2836[_0x4bd4('0x13')][_0x4bd4('0x14')]);return _0x59512a(_0x3d2836[_0x4bd4('0x13')][_0x4bd4('0x14')]);}logger[_0x4bd4('0x13')](_0x4bd4('0xe'),_0x340937,_0x3d2836['error'][_0x4bd4('0x14')]);return _0x1e1166(_0x3d2836[_0x4bd4('0x13')]['message']);}else{logger['info'](_0x4bd4('0xe'),_0x340937,_0x4bd4('0x11'));_0x1e1166(_0x3d2836[_0x4bd4('0x15')]['message']);}})[_0x4bd4('0x16')](function(_0x4cb686){logger[_0x4bd4('0x13')](_0x4bd4('0xe'),_0x340937,_0x4cb686);_0x59512a(_0x4cb686);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index cc20102..cf58cab 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 _0x02f6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x5c8d97,_0x2f3c1c){var _0xd6f246=function(_0x302c42){while(--_0x302c42){_0x5c8d97['push'](_0x5c8d97['shift']());}};_0xd6f246(++_0x2f3c1c);}(_0x02f6,0x1ed));var _0x602f=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x02f6[_0xa30766];return _0x24e780;};'use strict';var multer=require(_0x602f('0x0'));var util=require(_0x602f('0x1'));var path=require('path');var timeout=require(_0x602f('0x2'));var express=require('express');var router=express[_0x602f('0x3')]();var fs_extra=require(_0x602f('0x4'));var auth=require(_0x602f('0x5'));var interaction=require(_0x602f('0x6'));var config=require(_0x602f('0x7'));var controller=require(_0x602f('0x8'));router[_0x602f('0x9')](_0x602f('0xa'),auth[_0x602f('0xb')](),controller['show']);router[_0x602f('0xc')](_0x602f('0xa'),auth['isAuthenticated'](),controller[_0x602f('0xd')]);router[_0x602f('0xe')](_0x602f('0xa'),auth[_0x602f('0xb')](),controller[_0x602f('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc4a7=['../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25625e,_0x5cd907){var _0x44751c=function(_0x3f6e1e){while(--_0x3f6e1e){_0x25625e['push'](_0x25625e['shift']());}};_0x44751c(++_0x5cd907);}(_0xc4a7,0x1ca));var _0x7c4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4a7[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var path=require(_0x7c4a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7c4a('0x3'));var auth=require(_0x7c4a('0x4'));var interaction=require(_0x7c4a('0x5'));var config=require(_0x7c4a('0x6'));var controller=require(_0x7c4a('0x7'));router['get'](_0x7c4a('0x8'),auth[_0x7c4a('0x9')](),controller[_0x7c4a('0xa')]);router[_0x7c4a('0xb')](_0x7c4a('0x8'),auth[_0x7c4a('0x9')](),controller[_0x7c4a('0xc')]);router[_0x7c4a('0xd')](_0x7c4a('0x8'),auth[_0x7c4a('0x9')](),controller[_0x7c4a('0xe')]);module[_0x7c4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index ab6a80c..343150e 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 _0xf188=['exports','BOOLEAN','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf188,0x1f1));var _0x8f18=function(_0x5644f1,_0x29d984){_0x5644f1=_0x5644f1-0x0;var _0x317055=_0xf188[_0x5644f1];return _0x317055;};'use strict';var Sequelize=require(_0x8f18('0x0'));module[_0x8f18('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x8f18('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0424=['BOOLEAN','STRING'];(function(_0x1546ed,_0x5bb0ec){var _0x632739=function(_0x4dd675){while(--_0x4dd675){_0x1546ed['push'](_0x1546ed['shift']());}};_0x632739(++_0x5bb0ec);}(_0x0424,0x159));var _0x4042=function(_0x48051b,_0x339115){_0x48051b=_0x48051b-0x0;var _0x2a4f6e=_0x0424[_0x48051b];return _0x2a4f6e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4042('0x0')]},'write':{'type':Sequelize[_0x4042('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index c319ef0..b3663df 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 _0x89be=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','user','addMembers','ids','omit','getMembers','findOne','order','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x89be,0x1f4));var _0xe89b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89be[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe89b('0x0'));var rimraf=require(_0xe89b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe89b('0x2'));var rp=require(_0xe89b('0x3'));var moment=require(_0xe89b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe89b('0x5'));var path=require(_0xe89b('0x6'));var sox=require('sox');var csv=require(_0xe89b('0x7'));var ejs=require(_0xe89b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe89b('0x9'));var squel=require('squel');var crypto=require(_0xe89b('0xa'));var jsforce=require(_0xe89b('0xb'));var deskjs=require(_0xe89b('0xc'));var toCsv=require(_0xe89b('0x7'));var querystring=require(_0xe89b('0xd'));var Papa=require(_0xe89b('0xe'));var Redis=require('ioredis');var authService=require(_0xe89b('0xf'));var qs=require(_0xe89b('0x10'));var as=require(_0xe89b('0x11'));var hardwareService=require(_0xe89b('0x12'));var logger=require(_0xe89b('0x13'))(_0xe89b('0x14'));var utils=require(_0xe89b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe89b('0x16'))['db'];config[_0xe89b('0x17')]=_[_0xe89b('0x18')](config[_0xe89b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe89b('0x19'))(new Redis(config[_0xe89b('0x17')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3536e0,_0x337488){_0x337488=_0x337488||0xcc;return function(_0x151e78){if(_0x151e78){return _0x3536e0['sendStatus'](_0x337488);}return _0x3536e0[_0xe89b('0x1a')](_0x337488)[_0xe89b('0x1b')]();};}function respondWithResult(_0x1c0944,_0x2a1dfb){_0x2a1dfb=_0x2a1dfb||0xc8;return function(_0x130d41){if(_0x130d41){return _0x1c0944['status'](_0x2a1dfb)[_0xe89b('0x1c')](_0x130d41);}};}function respondWithFilteredResult(_0x2eab1a,_0x5cb762){return function(_0x392d92){if(_0x392d92){var _0x215658=typeof _0x5cb762['offset']===_0xe89b('0x1d')&&typeof _0x5cb762[_0xe89b('0x1e')]==='undefined';var _0x2b59bc=_0x392d92[_0xe89b('0x1f')];var _0x3175bb=_0x215658?0x0:_0x5cb762[_0xe89b('0x20')];var _0x737ab8=_0x215658?_0x392d92[_0xe89b('0x1f')]:_0x5cb762[_0xe89b('0x20')]+_0x5cb762[_0xe89b('0x1e')];var _0x4d0852;if(_0x737ab8>=_0x2b59bc){_0x737ab8=_0x2b59bc;_0x4d0852=0xc8;}else{_0x4d0852=0xce;}_0x2eab1a['status'](_0x4d0852);return _0x2eab1a[_0xe89b('0x21')]('Content-Range',_0x3175bb+'-'+_0x737ab8+'/'+_0x2b59bc)[_0xe89b('0x1c')](_0x392d92);}return null;};}function patchUpdates(_0x1c2838){return function(_0x14b561){try{jsonpatch[_0xe89b('0x22')](_0x14b561,_0x1c2838,!![]);}catch(_0x14fd92){return BPromise[_0xe89b('0x23')](_0x14fd92);}return _0x14b561[_0xe89b('0x24')]();};}function saveUpdates(_0x679c48,_0x12479b){return function(_0x32f584){if(_0x32f584){return _0x32f584[_0xe89b('0x25')](_0x679c48)[_0xe89b('0x26')](function(_0x51b6cd){return _0x51b6cd;});}return null;};}function removeEntity(_0x1e4706,_0x2e45e1){return function(_0x4a9b74){if(_0x4a9b74){return _0x4a9b74[_0xe89b('0x27')]()['then'](function(){_0x1e4706[_0xe89b('0x1a')](0xcc)[_0xe89b('0x1b')]();});}};}function handleEntityNotFound(_0x431b3c,_0x879131){return function(_0x1c8547){if(!_0x1c8547){_0x431b3c[_0xe89b('0x28')](0x194);}return _0x1c8547;};}function handleError(_0x3526b2,_0x19fbb9){_0x19fbb9=_0x19fbb9||0x1f4;return function(_0x59e631){logger[_0xe89b('0x29')](_0x59e631[_0xe89b('0x2a')]);if(_0x59e631[_0xe89b('0x2b')]){delete _0x59e631['name'];}_0x3526b2[_0xe89b('0x1a')](_0x19fbb9)[_0xe89b('0x2c')](_0x59e631);};}exports[_0xe89b('0x2d')]=function(_0x22d9df,_0x235a71){var _0x2f6840={},_0x2e991d={},_0x25a8fd={'count':0x0,'rows':[]};var _0x4cbfcb=_[_0xe89b('0x2e')](db[_0xe89b('0x2f')][_0xe89b('0x30')],function(_0x3eea2b){return{'name':_0x3eea2b[_0xe89b('0x31')],'type':_0x3eea2b[_0xe89b('0x32')]['key']};});_0x2e991d[_0xe89b('0x33')]=_['map'](_0x4cbfcb,_0xe89b('0x2b'));_0x2e991d[_0xe89b('0x34')]=_['keys'](_0x22d9df[_0xe89b('0x34')]);_0x2e991d[_0xe89b('0x35')]=_[_0xe89b('0x36')](_0x2e991d[_0xe89b('0x33')],_0x2e991d[_0xe89b('0x34')]);_0x2f6840[_0xe89b('0x37')]=_[_0xe89b('0x36')](_0x2e991d['model'],qs[_0xe89b('0x38')](_0x22d9df[_0xe89b('0x34')][_0xe89b('0x38')]));_0x2f6840[_0xe89b('0x37')]=_0x2f6840['attributes'][_0xe89b('0x39')]?_0x2f6840[_0xe89b('0x37')]:_0x2e991d['model'];if(!_0x22d9df[_0xe89b('0x34')][_0xe89b('0x3a')](_0xe89b('0x3b'))){_0x2f6840['limit']=qs[_0xe89b('0x1e')](_0x22d9df[_0xe89b('0x34')][_0xe89b('0x1e')]);_0x2f6840[_0xe89b('0x20')]=qs[_0xe89b('0x20')](_0x22d9df[_0xe89b('0x34')]['offset']);}_0x2f6840['order']=qs['sort'](_0x22d9df[_0xe89b('0x34')][_0xe89b('0x3c')]);_0x2f6840['where']=qs[_0xe89b('0x35')](_[_0xe89b('0x3d')](_0x22d9df[_0xe89b('0x34')],_0x2e991d[_0xe89b('0x35')]),_0x4cbfcb);if(_0x22d9df['query']['filter']){_0x2f6840[_0xe89b('0x3e')]=_[_0xe89b('0x3f')](_0x2f6840[_0xe89b('0x3e')],{'$or':_[_0xe89b('0x2e')](_0x4cbfcb,function(_0x1530a0){if(_0x1530a0[_0xe89b('0x32')]!==_0xe89b('0x40')){var _0x270c9d={};_0x270c9d[_0x1530a0[_0xe89b('0x2b')]]={'$like':'%'+_0x22d9df[_0xe89b('0x34')][_0xe89b('0x41')]+'%'};return _0x270c9d;}})});}_0x2f6840=_[_0xe89b('0x3f')]({},_0x2f6840,_0x22d9df[_0xe89b('0x42')]);var _0x31b4e3={'where':_0x2f6840['where']};return db[_0xe89b('0x2f')]['count'](_0x31b4e3)[_0xe89b('0x26')](function(_0x1a99c1){_0x25a8fd[_0xe89b('0x1f')]=_0x1a99c1;if(_0x22d9df[_0xe89b('0x34')][_0xe89b('0x43')]){_0x2f6840[_0xe89b('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0xe89b('0x45')](_0x2f6840);})[_0xe89b('0x26')](function(_0x12ab6f){_0x25a8fd[_0xe89b('0x46')]=_0x12ab6f;return _0x25a8fd;})[_0xe89b('0x26')](respondWithFilteredResult(_0x235a71,_0x2f6840))[_0xe89b('0x47')](handleError(_0x235a71,null));};exports[_0xe89b('0x48')]=function(_0x4ad136,_0x12ce27){var _0x6eb9a8={'raw':!![],'where':{'id':_0x4ad136[_0xe89b('0x49')]['id']}},_0x48df4c={};_0x48df4c[_0xe89b('0x33')]=_['keys'](db[_0xe89b('0x2f')][_0xe89b('0x30')]);_0x48df4c['query']=_[_0xe89b('0x4a')](_0x4ad136[_0xe89b('0x34')]);_0x48df4c[_0xe89b('0x35')]=_[_0xe89b('0x36')](_0x48df4c[_0xe89b('0x33')],_0x48df4c[_0xe89b('0x34')]);_0x6eb9a8[_0xe89b('0x37')]=_[_0xe89b('0x36')](_0x48df4c[_0xe89b('0x33')],qs['fields'](_0x4ad136['query'][_0xe89b('0x38')]));_0x6eb9a8[_0xe89b('0x37')]=_0x6eb9a8['attributes']['length']?_0x6eb9a8[_0xe89b('0x37')]:_0x48df4c[_0xe89b('0x33')];if(_0x4ad136[_0xe89b('0x34')][_0xe89b('0x43')]){_0x6eb9a8['include']=[{'all':!![]}];}_0x6eb9a8=_[_0xe89b('0x3f')]({},_0x6eb9a8,_0x4ad136[_0xe89b('0x42')]);return db['ChatGroup'][_0xe89b('0x4b')](_0x6eb9a8)['then'](handleEntityNotFound(_0x12ce27,null))[_0xe89b('0x26')](respondWithResult(_0x12ce27,null))[_0xe89b('0x47')](handleError(_0x12ce27,null));};exports[_0xe89b('0x4c')]=function(_0xfe260b,_0x32019a){return db['ChatGroup'][_0xe89b('0x4c')](_0xfe260b[_0xe89b('0x4d')],{})[_0xe89b('0x26')](respondWithResult(_0x32019a,0xc9))[_0xe89b('0x47')](handleError(_0x32019a,null));};exports[_0xe89b('0x25')]=function(_0x5f9fc,_0x4c01c5){if(_0x5f9fc[_0xe89b('0x4d')]['id']){delete _0x5f9fc['body']['id'];}return db[_0xe89b('0x2f')][_0xe89b('0x4b')]({'where':{'id':_0x5f9fc['params']['id']}})[_0xe89b('0x26')](handleEntityNotFound(_0x4c01c5,null))['then'](saveUpdates(_0x5f9fc[_0xe89b('0x4d')],null))[_0xe89b('0x26')](respondWithResult(_0x4c01c5,null))[_0xe89b('0x47')](handleError(_0x4c01c5,null));};exports[_0xe89b('0x27')]=function(_0x388dd8,_0x269dda){return db[_0xe89b('0x2f')][_0xe89b('0x4b')]({'where':{'id':_0x388dd8[_0xe89b('0x49')]['id']}})[_0xe89b('0x26')](handleEntityNotFound(_0x269dda,null))[_0xe89b('0x26')](removeEntity(_0x269dda,null))[_0xe89b('0x47')](handleError(_0x269dda,null));};exports[_0xe89b('0x4e')]=function(_0x5022ee,_0x1320a0){return db[_0xe89b('0x2f')][_0xe89b('0x4e')]()[_0xe89b('0x26')](respondWithResult(_0x1320a0,null))[_0xe89b('0x47')](handleError(_0x1320a0,null));};exports['getUnread']=function(_0x54d022,_0x42676f,_0x560376){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x54d022[_0xe89b('0x49')]['id'],'ToId':_0x54d022[_0xe89b('0x4f')]['id'],'read':![]}})[_0xe89b('0x26')](function(_0x5d4703){return{'id':_['toInteger'](_0x54d022[_0xe89b('0x49')]['id']),'count':_0x5d4703};})['then'](respondWithResult(_0x42676f,null))['catch'](handleError(_0x42676f,null));};exports['addMembers']=function(_0x5f550d,_0x1a35e9,_0x5bc077){return db[_0xe89b('0x2f')]['find']({'where':{'id':_0x5f550d[_0xe89b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a35e9,null))['then'](function(_0x31cace){if(_0x31cace){return _0x31cace[_0xe89b('0x50')](_0x5f550d[_0xe89b('0x4d')][_0xe89b('0x51')],_[_0xe89b('0x52')](_0x5f550d[_0xe89b('0x4d')],[_0xe89b('0x51'),'id'])||{});}})[_0xe89b('0x26')](respondWithResult(_0x1a35e9,null))[_0xe89b('0x47')](handleError(_0x1a35e9,null));};exports[_0xe89b('0x53')]=function(_0x8d865e,_0x505a7f,_0x488b70){var _0x13b780={};var _0x41f885={};var _0x18ce2e;var _0xe33675;return db[_0xe89b('0x2f')][_0xe89b('0x54')]({'where':{'id':_0x8d865e[_0xe89b('0x49')]['id']}})[_0xe89b('0x26')](handleEntityNotFound(_0x505a7f,null))[_0xe89b('0x26')](function(_0x98e2a1){if(_0x98e2a1){_0x18ce2e=_0x98e2a1;_0x41f885['model']=_[_0xe89b('0x4a')](db['User'][_0xe89b('0x30')]);_0x41f885[_0xe89b('0x34')]=_[_0xe89b('0x4a')](_0x8d865e[_0xe89b('0x34')]);_0x41f885[_0xe89b('0x35')]=_[_0xe89b('0x36')](_0x41f885[_0xe89b('0x33')],_0x41f885['query']);_0x13b780[_0xe89b('0x37')]=_[_0xe89b('0x36')](_0x41f885['model'],qs[_0xe89b('0x38')](_0x8d865e['query'][_0xe89b('0x38')]));_0x13b780[_0xe89b('0x37')]=_0x13b780[_0xe89b('0x37')][_0xe89b('0x39')]?_0x13b780[_0xe89b('0x37')]:_0x41f885[_0xe89b('0x33')];_0x13b780[_0xe89b('0x55')]=qs[_0xe89b('0x3c')](_0x8d865e['query']['sort']);_0x13b780[_0xe89b('0x3e')]=qs[_0xe89b('0x35')](_[_0xe89b('0x3d')](_0x8d865e['query'],_0x41f885[_0xe89b('0x35')]));if(_0x8d865e[_0xe89b('0x34')]['filter']){_0x13b780[_0xe89b('0x3e')]=_['merge'](_0x13b780[_0xe89b('0x3e')],{'$or':_[_0xe89b('0x2e')](_0x13b780[_0xe89b('0x37')],function(_0x52065d){var _0xe1192={};_0xe1192[_0x52065d]={'$like':'%'+_0x8d865e[_0xe89b('0x34')]['filter']+'%'};return _0xe1192;})});}_0x13b780=_[_0xe89b('0x3f')]({},_0x13b780,_0x8d865e[_0xe89b('0x42')]);return _0x18ce2e[_0xe89b('0x53')](_0x13b780);}})[_0xe89b('0x26')](function(_0x25bb99){if(_0x25bb99){_0xe33675=_0x25bb99['length'];if(!_0x8d865e[_0xe89b('0x34')][_0xe89b('0x3a')]('nolimit')){_0x13b780[_0xe89b('0x1e')]=qs[_0xe89b('0x1e')](_0x8d865e['query']['limit']);_0x13b780['offset']=qs[_0xe89b('0x20')](_0x8d865e['query'][_0xe89b('0x20')]);}return _0x18ce2e['getMembers'](_0x13b780);}})[_0xe89b('0x26')](function(_0x2a12c3){if(_0x2a12c3){return _0x2a12c3?{'count':_0xe33675,'rows':_0x2a12c3}:null;}})[_0xe89b('0x26')](respondWithResult(_0x505a7f,null))['catch'](handleError(_0x505a7f,null));};exports[_0xe89b('0x56')]=function(_0x13c403,_0x260dd2,_0x5bdba1){return db['ChatGroup']['find']({'where':{'id':_0x13c403['params']['id']}})['then'](handleEntityNotFound(_0x260dd2,null))['then'](function(_0x5cd17c){if(_0x5cd17c){return _0x5cd17c[_0xe89b('0x56')](_0x13c403[_0xe89b('0x34')][_0xe89b('0x51')]);}})[_0xe89b('0x26')](respondWithStatusCode(_0x260dd2,null))[_0xe89b('0x47')](handleError(_0x260dd2,null));};exports[_0xe89b('0x57')]=function(_0x5d931f,_0xd5a300,_0x2b07ad){if(_0x5d931f[_0xe89b('0x4d')]['id']){delete _0x5d931f[_0xe89b('0x4d')]['id'];}return db['ChatGroup'][_0xe89b('0x4b')]({'where':{'id':_0x5d931f[_0xe89b('0x49')]['id']}})[_0xe89b('0x26')](handleEntityNotFound(_0xd5a300,null))[_0xe89b('0x26')](function(_0x117f77){if(_0x117f77){_0x5d931f[_0xe89b('0x4d')][_0xe89b('0x58')]=_0x117f77['id'];return db[_0xe89b('0x59')][_0xe89b('0x4c')](_0x5d931f[_0xe89b('0x4d')]);}})['then'](respondWithResult(_0xd5a300,null))['catch'](handleError(_0xd5a300,null));};exports[_0xe89b('0x5a')]=function(_0x5aba47,_0x5e1228,_0x17a505){var _0x54a104={};var _0x474428={};var _0x2c69ac;var _0x2f33f5;return db[_0xe89b('0x2f')][_0xe89b('0x54')]({'where':{'id':_0x5aba47[_0xe89b('0x49')]['id']}})[_0xe89b('0x26')](handleEntityNotFound(_0x5e1228,null))[_0xe89b('0x26')](function(_0x58b76e){if(_0x58b76e){_0x2c69ac=_0x58b76e;_0x474428['model']=_['keys'](db[_0xe89b('0x59')][_0xe89b('0x30')]);_0x474428[_0xe89b('0x34')]=_['keys'](_0x5aba47[_0xe89b('0x34')]);_0x474428[_0xe89b('0x35')]=_['intersection'](_0x474428[_0xe89b('0x33')],_0x474428['query']);_0x54a104[_0xe89b('0x37')]=_[_0xe89b('0x36')](_0x474428[_0xe89b('0x33')],qs[_0xe89b('0x38')](_0x5aba47[_0xe89b('0x34')][_0xe89b('0x38')]));_0x54a104[_0xe89b('0x37')]=_0x54a104[_0xe89b('0x37')]['length']?_0x54a104[_0xe89b('0x37')]:_0x474428[_0xe89b('0x33')];_0x54a104[_0xe89b('0x55')]=qs[_0xe89b('0x3c')](_0x5aba47[_0xe89b('0x34')]['sort']);_0x54a104[_0xe89b('0x3e')]=qs['filters'](_['pick'](_0x5aba47[_0xe89b('0x34')],_0x474428[_0xe89b('0x35')]));if(_0x5aba47[_0xe89b('0x34')][_0xe89b('0x41')]){_0x54a104[_0xe89b('0x3e')]=_['merge'](_0x54a104[_0xe89b('0x3e')],{'$or':_[_0xe89b('0x2e')](_0x54a104[_0xe89b('0x37')],function(_0x3c1a1e){var _0x169ae4={};_0x169ae4[_0x3c1a1e]={'$like':'%'+_0x5aba47[_0xe89b('0x34')][_0xe89b('0x41')]+'%'};return _0x169ae4;})});}if(_0x5aba47[_0xe89b('0x34')]['$gte']){var _0x36ebdc=_0x5aba47[_0xe89b('0x34')][_0xe89b('0x5b')]['split'](',');var _0x299a55={};_0x299a55[_0x36ebdc[0x0]]={'$gte':moment(_0x36ebdc[0x1])[_0xe89b('0x5c')](_0xe89b('0x5d'))};_0x54a104[_0xe89b('0x3e')]=_[_0xe89b('0x3f')](_0x54a104[_0xe89b('0x3e')],_0x299a55);}_0x54a104=_[_0xe89b('0x3f')]({},_0x54a104,_0x5aba47[_0xe89b('0x42')]);return _0x2c69ac[_0xe89b('0x5a')](_0x54a104);}})[_0xe89b('0x26')](function(_0x22e517){if(_0x22e517){_0x2f33f5=_0x22e517['length'];if(!_0x5aba47[_0xe89b('0x34')][_0xe89b('0x3a')](_0xe89b('0x3b'))){_0x54a104[_0xe89b('0x1e')]=qs[_0xe89b('0x1e')](_0x5aba47[_0xe89b('0x34')][_0xe89b('0x1e')]);_0x54a104[_0xe89b('0x20')]=qs[_0xe89b('0x20')](_0x5aba47[_0xe89b('0x34')][_0xe89b('0x20')]);}return _0x2c69ac['getMessages'](_0x54a104);}})[_0xe89b('0x26')](function(_0x586682){if(_0x586682){return _0x586682?{'count':_0x2f33f5,'rows':_0x586682}:null;}})[_0xe89b('0x26')](respondWithResult(_0x5e1228,null))[_0xe89b('0x47')](handleError(_0x5e1228,null));}; \ No newline at end of file +var _0xc840=['sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','order','sort','pick','filter','where','type','merge','options','include','findAll','catch','show','params','includeAll','create','body','update','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','getMembers','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','eml-format','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x4cd644,_0x174273){var _0x36f9cc=function(_0x40fd31){while(--_0x40fd31){_0x4cd644['push'](_0x4cd644['shift']());}};_0x36f9cc(++_0x174273);}(_0xc840,0xf7));var _0x0c84=function(_0x8a3fb7,_0x1c1632){_0x8a3fb7=_0x8a3fb7-0x0;var _0x1d4606=_0xc840[_0x8a3fb7];return _0x1d4606;};'use strict';var emlformat=require(_0x0c84('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c84('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c84('0x2'));var Mustache=require(_0x0c84('0x3'));var util=require('util');var path=require(_0x0c84('0x4'));var sox=require(_0x0c84('0x5'));var csv=require('to-csv');var ejs=require(_0x0c84('0x6'));var fs=require('fs');var fs_extra=require(_0x0c84('0x7'));var _=require(_0x0c84('0x8'));var squel=require(_0x0c84('0x9'));var crypto=require(_0x0c84('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c84('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0c84('0xc'));var authService=require(_0x0c84('0xd'));var qs=require(_0x0c84('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c84('0xf'));var logger=require(_0x0c84('0x10'))(_0x0c84('0x11'));var utils=require(_0x0c84('0x12'));var config=require(_0x0c84('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c84('0x14'))['db'];config[_0x0c84('0x15')]=_['defaults'](config[_0x0c84('0x15')],{'host':_0x0c84('0x16'),'port':0x18eb});var socket=require(_0x0c84('0x17'))(new Redis(config[_0x0c84('0x15')]));require(_0x0c84('0x18'))[_0x0c84('0x19')](socket);function respondWithStatusCode(_0x3b5b2b,_0x8e3e67){_0x8e3e67=_0x8e3e67||0xcc;return function(_0xd411f6){if(_0xd411f6){return _0x3b5b2b[_0x0c84('0x1a')](_0x8e3e67);}return _0x3b5b2b[_0x0c84('0x1b')](_0x8e3e67)[_0x0c84('0x1c')]();};}function respondWithResult(_0x18e50c,_0x1c5af0){_0x1c5af0=_0x1c5af0||0xc8;return function(_0x420d4d){if(_0x420d4d){return _0x18e50c['status'](_0x1c5af0)[_0x0c84('0x1d')](_0x420d4d);}};}function respondWithFilteredResult(_0x25d67e,_0x27a696){return function(_0x15ee7f){if(_0x15ee7f){var _0x12cdbd=typeof _0x27a696[_0x0c84('0x1e')]==='undefined'&&typeof _0x27a696['limit']==='undefined';var _0x514f55=_0x15ee7f[_0x0c84('0x1f')];var _0x43ae20=_0x12cdbd?0x0:_0x27a696['offset'];var _0x4b5bbf=_0x12cdbd?_0x15ee7f['count']:_0x27a696['offset']+_0x27a696[_0x0c84('0x20')];var _0x57dbdd;if(_0x4b5bbf>=_0x514f55){_0x4b5bbf=_0x514f55;_0x57dbdd=0xc8;}else{_0x57dbdd=0xce;}_0x25d67e['status'](_0x57dbdd);return _0x25d67e[_0x0c84('0x21')](_0x0c84('0x22'),_0x43ae20+'-'+_0x4b5bbf+'/'+_0x514f55)[_0x0c84('0x1d')](_0x15ee7f);}return null;};}function patchUpdates(_0x266ec1){return function(_0xe70419){try{jsonpatch['apply'](_0xe70419,_0x266ec1,!![]);}catch(_0x440251){return BPromise[_0x0c84('0x23')](_0x440251);}return _0xe70419[_0x0c84('0x24')]();};}function saveUpdates(_0x26a15d,_0x303097){return function(_0x49c7ab){if(_0x49c7ab){return _0x49c7ab['update'](_0x26a15d)[_0x0c84('0x25')](function(_0x478a44){return _0x478a44;});}return null;};}function removeEntity(_0x1fd4fa,_0x44aa0c){return function(_0x10daa6){if(_0x10daa6){return _0x10daa6['destroy']()[_0x0c84('0x25')](function(){_0x1fd4fa[_0x0c84('0x1b')](0xcc)[_0x0c84('0x1c')]();});}};}function handleEntityNotFound(_0x13e648,_0xda7ea2){return function(_0x38e5ef){if(!_0x38e5ef){_0x13e648['sendStatus'](0x194);}return _0x38e5ef;};}function handleError(_0x12bc7f,_0x501693){_0x501693=_0x501693||0x1f4;return function(_0x2d99c5){logger[_0x0c84('0x26')](_0x2d99c5[_0x0c84('0x27')]);if(_0x2d99c5[_0x0c84('0x28')]){delete _0x2d99c5[_0x0c84('0x28')];}_0x12bc7f['status'](_0x501693)[_0x0c84('0x29')](_0x2d99c5);};}exports['index']=function(_0x24bca3,_0x11c400){var _0x4f0d50={},_0x455935={},_0x51d80a={'count':0x0,'rows':[]};var _0x2005df=_[_0x0c84('0x2a')](db[_0x0c84('0x2b')][_0x0c84('0x2c')],function(_0x5c37c5){return{'name':_0x5c37c5[_0x0c84('0x2d')],'type':_0x5c37c5['type']['key']};});_0x455935['model']=_[_0x0c84('0x2a')](_0x2005df,_0x0c84('0x28'));_0x455935[_0x0c84('0x2e')]=_[_0x0c84('0x2f')](_0x24bca3[_0x0c84('0x2e')]);_0x455935[_0x0c84('0x30')]=_['intersection'](_0x455935[_0x0c84('0x31')],_0x455935[_0x0c84('0x2e')]);_0x4f0d50[_0x0c84('0x32')]=_[_0x0c84('0x33')](_0x455935[_0x0c84('0x31')],qs[_0x0c84('0x34')](_0x24bca3[_0x0c84('0x2e')][_0x0c84('0x34')]));_0x4f0d50[_0x0c84('0x32')]=_0x4f0d50[_0x0c84('0x32')][_0x0c84('0x35')]?_0x4f0d50[_0x0c84('0x32')]:_0x455935[_0x0c84('0x31')];if(!_0x24bca3[_0x0c84('0x2e')]['hasOwnProperty']('nolimit')){_0x4f0d50['limit']=qs[_0x0c84('0x20')](_0x24bca3[_0x0c84('0x2e')][_0x0c84('0x20')]);_0x4f0d50[_0x0c84('0x1e')]=qs[_0x0c84('0x1e')](_0x24bca3[_0x0c84('0x2e')][_0x0c84('0x1e')]);}_0x4f0d50[_0x0c84('0x36')]=qs[_0x0c84('0x37')](_0x24bca3[_0x0c84('0x2e')][_0x0c84('0x37')]);_0x4f0d50['where']=qs[_0x0c84('0x30')](_[_0x0c84('0x38')](_0x24bca3['query'],_0x455935['filters']),_0x2005df);if(_0x24bca3[_0x0c84('0x2e')][_0x0c84('0x39')]){_0x4f0d50[_0x0c84('0x3a')]=_['merge'](_0x4f0d50[_0x0c84('0x3a')],{'$or':_[_0x0c84('0x2a')](_0x2005df,function(_0x45b91b){if(_0x45b91b[_0x0c84('0x3b')]!=='VIRTUAL'){var _0x377062={};_0x377062[_0x45b91b['name']]={'$like':'%'+_0x24bca3['query'][_0x0c84('0x39')]+'%'};return _0x377062;}})});}_0x4f0d50=_[_0x0c84('0x3c')]({},_0x4f0d50,_0x24bca3[_0x0c84('0x3d')]);var _0x1f9937={'where':_0x4f0d50[_0x0c84('0x3a')]};return db[_0x0c84('0x2b')]['count'](_0x1f9937)[_0x0c84('0x25')](function(_0x1b3cdb){_0x51d80a['count']=_0x1b3cdb;if(_0x24bca3[_0x0c84('0x2e')]['includeAll']){_0x4f0d50[_0x0c84('0x3e')]=[{'all':!![]}];}return db['ChatGroup'][_0x0c84('0x3f')](_0x4f0d50);})['then'](function(_0x5f17f3){_0x51d80a['rows']=_0x5f17f3;return _0x51d80a;})[_0x0c84('0x25')](respondWithFilteredResult(_0x11c400,_0x4f0d50))[_0x0c84('0x40')](handleError(_0x11c400,null));};exports[_0x0c84('0x41')]=function(_0x53517e,_0xb401e3){var _0x24b4be={'raw':!![],'where':{'id':_0x53517e[_0x0c84('0x42')]['id']}},_0x2f40be={};_0x2f40be[_0x0c84('0x31')]=_[_0x0c84('0x2f')](db[_0x0c84('0x2b')][_0x0c84('0x2c')]);_0x2f40be[_0x0c84('0x2e')]=_[_0x0c84('0x2f')](_0x53517e['query']);_0x2f40be[_0x0c84('0x30')]=_['intersection'](_0x2f40be['model'],_0x2f40be[_0x0c84('0x2e')]);_0x24b4be['attributes']=_[_0x0c84('0x33')](_0x2f40be[_0x0c84('0x31')],qs[_0x0c84('0x34')](_0x53517e['query'][_0x0c84('0x34')]));_0x24b4be['attributes']=_0x24b4be[_0x0c84('0x32')][_0x0c84('0x35')]?_0x24b4be[_0x0c84('0x32')]:_0x2f40be[_0x0c84('0x31')];if(_0x53517e[_0x0c84('0x2e')][_0x0c84('0x43')]){_0x24b4be[_0x0c84('0x3e')]=[{'all':!![]}];}_0x24b4be=_[_0x0c84('0x3c')]({},_0x24b4be,_0x53517e[_0x0c84('0x3d')]);return db[_0x0c84('0x2b')]['find'](_0x24b4be)['then'](handleEntityNotFound(_0xb401e3,null))[_0x0c84('0x25')](respondWithResult(_0xb401e3,null))[_0x0c84('0x40')](handleError(_0xb401e3,null));};exports[_0x0c84('0x44')]=function(_0x3b9823,_0x488740){return db[_0x0c84('0x2b')]['create'](_0x3b9823[_0x0c84('0x45')],{})[_0x0c84('0x25')](respondWithResult(_0x488740,0xc9))[_0x0c84('0x40')](handleError(_0x488740,null));};exports[_0x0c84('0x46')]=function(_0x16bee2,_0x5d1cf7){if(_0x16bee2[_0x0c84('0x45')]['id']){delete _0x16bee2[_0x0c84('0x45')]['id'];}return db[_0x0c84('0x2b')][_0x0c84('0x47')]({'where':{'id':_0x16bee2[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x5d1cf7,null))['then'](saveUpdates(_0x16bee2['body'],null))['then'](respondWithResult(_0x5d1cf7,null))[_0x0c84('0x40')](handleError(_0x5d1cf7,null));};exports[_0x0c84('0x48')]=function(_0x128798,_0x26197e){return db['ChatGroup'][_0x0c84('0x47')]({'where':{'id':_0x128798[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x26197e,null))[_0x0c84('0x25')](removeEntity(_0x26197e,null))[_0x0c84('0x40')](handleError(_0x26197e,null));};exports[_0x0c84('0x49')]=function(_0x5d7ce1,_0x1280f2){return db[_0x0c84('0x2b')][_0x0c84('0x49')]()[_0x0c84('0x25')](respondWithResult(_0x1280f2,null))[_0x0c84('0x40')](handleError(_0x1280f2,null));};exports[_0x0c84('0x4a')]=function(_0x2f14dd,_0x3a338f,_0x3f2675){return db[_0x0c84('0x4b')][_0x0c84('0x1f')]({'where':{'ChatGroupId':_0x2f14dd[_0x0c84('0x42')]['id'],'ToId':_0x2f14dd[_0x0c84('0x4c')]['id'],'read':![]}})['then'](function(_0x4d8011){return{'id':_[_0x0c84('0x4d')](_0x2f14dd[_0x0c84('0x42')]['id']),'count':_0x4d8011};})['then'](respondWithResult(_0x3a338f,null))['catch'](handleError(_0x3a338f,null));};exports[_0x0c84('0x4e')]=function(_0x2ea364,_0x2986a7,_0x37346c){return db[_0x0c84('0x2b')][_0x0c84('0x47')]({'where':{'id':_0x2ea364[_0x0c84('0x42')]['id']}})['then'](handleEntityNotFound(_0x2986a7,null))[_0x0c84('0x25')](function(_0x1d6c12){if(_0x1d6c12){return _0x1d6c12[_0x0c84('0x4e')](_0x2ea364[_0x0c84('0x45')][_0x0c84('0x4f')],_[_0x0c84('0x50')](_0x2ea364[_0x0c84('0x45')],['ids','id'])||{});}})[_0x0c84('0x25')](respondWithResult(_0x2986a7,null))['catch'](handleError(_0x2986a7,null));};exports['getMembers']=function(_0x2ea2aa,_0x468a21,_0x273015){var _0x52b14d={};var _0x5ac6da={};var _0x3c5bc6;var _0x67d5dc;return db['ChatGroup'][_0x0c84('0x51')]({'where':{'id':_0x2ea2aa[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x468a21,null))[_0x0c84('0x25')](function(_0x3f17c5){if(_0x3f17c5){_0x3c5bc6=_0x3f17c5;_0x5ac6da[_0x0c84('0x31')]=_[_0x0c84('0x2f')](db['User'][_0x0c84('0x2c')]);_0x5ac6da[_0x0c84('0x2e')]=_[_0x0c84('0x2f')](_0x2ea2aa[_0x0c84('0x2e')]);_0x5ac6da[_0x0c84('0x30')]=_[_0x0c84('0x33')](_0x5ac6da[_0x0c84('0x31')],_0x5ac6da[_0x0c84('0x2e')]);_0x52b14d[_0x0c84('0x32')]=_['intersection'](_0x5ac6da['model'],qs[_0x0c84('0x34')](_0x2ea2aa[_0x0c84('0x2e')][_0x0c84('0x34')]));_0x52b14d[_0x0c84('0x32')]=_0x52b14d[_0x0c84('0x32')][_0x0c84('0x35')]?_0x52b14d[_0x0c84('0x32')]:_0x5ac6da[_0x0c84('0x31')];_0x52b14d[_0x0c84('0x36')]=qs[_0x0c84('0x37')](_0x2ea2aa[_0x0c84('0x2e')][_0x0c84('0x37')]);_0x52b14d[_0x0c84('0x3a')]=qs[_0x0c84('0x30')](_[_0x0c84('0x38')](_0x2ea2aa['query'],_0x5ac6da[_0x0c84('0x30')]));if(_0x2ea2aa[_0x0c84('0x2e')]['filter']){_0x52b14d['where']=_['merge'](_0x52b14d[_0x0c84('0x3a')],{'$or':_['map'](_0x52b14d[_0x0c84('0x32')],function(_0x583e31){var _0x2037dc={};_0x2037dc[_0x583e31]={'$like':'%'+_0x2ea2aa['query'][_0x0c84('0x39')]+'%'};return _0x2037dc;})});}_0x52b14d=_[_0x0c84('0x3c')]({},_0x52b14d,_0x2ea2aa[_0x0c84('0x3d')]);return _0x3c5bc6[_0x0c84('0x52')](_0x52b14d);}})['then'](function(_0xd33641){if(_0xd33641){_0x67d5dc=_0xd33641['length'];if(!_0x2ea2aa[_0x0c84('0x2e')][_0x0c84('0x53')](_0x0c84('0x54'))){_0x52b14d[_0x0c84('0x20')]=qs[_0x0c84('0x20')](_0x2ea2aa[_0x0c84('0x2e')]['limit']);_0x52b14d[_0x0c84('0x1e')]=qs[_0x0c84('0x1e')](_0x2ea2aa['query'][_0x0c84('0x1e')]);}return _0x3c5bc6['getMembers'](_0x52b14d);}})[_0x0c84('0x25')](function(_0x183508){if(_0x183508){return _0x183508?{'count':_0x67d5dc,'rows':_0x183508}:null;}})[_0x0c84('0x25')](respondWithResult(_0x468a21,null))[_0x0c84('0x40')](handleError(_0x468a21,null));};exports[_0x0c84('0x55')]=function(_0x1ee097,_0x33a8b0,_0x717e81){return db[_0x0c84('0x2b')][_0x0c84('0x47')]({'where':{'id':_0x1ee097[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x33a8b0,null))[_0x0c84('0x25')](function(_0x4160cd){if(_0x4160cd){return _0x4160cd[_0x0c84('0x55')](_0x1ee097[_0x0c84('0x2e')][_0x0c84('0x4f')]);}})[_0x0c84('0x25')](respondWithStatusCode(_0x33a8b0,null))[_0x0c84('0x40')](handleError(_0x33a8b0,null));};exports[_0x0c84('0x56')]=function(_0x40ab3d,_0x1e9b51,_0x557679){if(_0x40ab3d[_0x0c84('0x45')]['id']){delete _0x40ab3d[_0x0c84('0x45')]['id'];}return db['ChatGroup'][_0x0c84('0x47')]({'where':{'id':_0x40ab3d[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x1e9b51,null))[_0x0c84('0x25')](function(_0x56d839){if(_0x56d839){_0x40ab3d[_0x0c84('0x45')][_0x0c84('0x57')]=_0x56d839['id'];return db[_0x0c84('0x4b')][_0x0c84('0x44')](_0x40ab3d['body']);}})['then'](respondWithResult(_0x1e9b51,null))['catch'](handleError(_0x1e9b51,null));};exports[_0x0c84('0x58')]=function(_0x58ffb7,_0x448759,_0x3f3d74){var _0x2ccbd9={};var _0x314296={};var _0xfe1e33;var _0x22342e;return db['ChatGroup'][_0x0c84('0x51')]({'where':{'id':_0x58ffb7[_0x0c84('0x42')]['id']}})[_0x0c84('0x25')](handleEntityNotFound(_0x448759,null))[_0x0c84('0x25')](function(_0x5a1653){if(_0x5a1653){_0xfe1e33=_0x5a1653;_0x314296[_0x0c84('0x31')]=_[_0x0c84('0x2f')](db['ChatInternalMessage'][_0x0c84('0x2c')]);_0x314296[_0x0c84('0x2e')]=_[_0x0c84('0x2f')](_0x58ffb7['query']);_0x314296[_0x0c84('0x30')]=_['intersection'](_0x314296[_0x0c84('0x31')],_0x314296[_0x0c84('0x2e')]);_0x2ccbd9[_0x0c84('0x32')]=_[_0x0c84('0x33')](_0x314296[_0x0c84('0x31')],qs[_0x0c84('0x34')](_0x58ffb7['query'][_0x0c84('0x34')]));_0x2ccbd9[_0x0c84('0x32')]=_0x2ccbd9[_0x0c84('0x32')][_0x0c84('0x35')]?_0x2ccbd9[_0x0c84('0x32')]:_0x314296[_0x0c84('0x31')];_0x2ccbd9['order']=qs[_0x0c84('0x37')](_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x37')]);_0x2ccbd9[_0x0c84('0x3a')]=qs[_0x0c84('0x30')](_[_0x0c84('0x38')](_0x58ffb7[_0x0c84('0x2e')],_0x314296[_0x0c84('0x30')]));if(_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x39')]){_0x2ccbd9[_0x0c84('0x3a')]=_[_0x0c84('0x3c')](_0x2ccbd9[_0x0c84('0x3a')],{'$or':_[_0x0c84('0x2a')](_0x2ccbd9[_0x0c84('0x32')],function(_0x56caf3){var _0x4f88be={};_0x4f88be[_0x56caf3]={'$like':'%'+_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x39')]+'%'};return _0x4f88be;})});}if(_0x58ffb7['query']['$gte']){var _0x2cbbbf=_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x59')]['split'](',');var _0x401474={};_0x401474[_0x2cbbbf[0x0]]={'$gte':moment(_0x2cbbbf[0x1])[_0x0c84('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2ccbd9[_0x0c84('0x3a')]=_['merge'](_0x2ccbd9[_0x0c84('0x3a')],_0x401474);}_0x2ccbd9=_[_0x0c84('0x3c')]({},_0x2ccbd9,_0x58ffb7['options']);return _0xfe1e33[_0x0c84('0x58')](_0x2ccbd9);}})[_0x0c84('0x25')](function(_0x5d5703){if(_0x5d5703){_0x22342e=_0x5d5703[_0x0c84('0x35')];if(!_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x53')](_0x0c84('0x54'))){_0x2ccbd9[_0x0c84('0x20')]=qs[_0x0c84('0x20')](_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x20')]);_0x2ccbd9[_0x0c84('0x1e')]=qs[_0x0c84('0x1e')](_0x58ffb7[_0x0c84('0x2e')][_0x0c84('0x1e')]);}return _0xfe1e33[_0x0c84('0x58')](_0x2ccbd9);}})[_0x0c84('0x25')](function(_0x2f4868){if(_0x2f4868){return _0x2f4868?{'count':_0x22342e,'rows':_0x2f4868}:null;}})['then'](respondWithResult(_0x448759,null))[_0x0c84('0x40')](handleError(_0x448759,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 69c12e1..665f1e6 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 _0xf9e4=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x1aab48,_0x2ce287){var _0x48789e=function(_0x46ee62){while(--_0x46ee62){_0x1aab48['push'](_0x1aab48['shift']());}};_0x48789e(++_0x2ce287);}(_0xf9e4,0xd3));var _0x4f9e=function(_0x46b995,_0x28559a){_0x46b995=_0x46b995-0x0;var _0x427ee2=_0xf9e4[_0x46b995];return _0x427ee2;};'use strict';var EventEmitter=require(_0x4f9e('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4f9e('0x1')](0x0);var events={'afterCreate':_0x4f9e('0x2'),'afterUpdate':_0x4f9e('0x3'),'afterDestroy':_0x4f9e('0x4')};function emitEvent(_0x58c445){return function(_0x20098f,_0x19bb8e,_0x18ff12){ChatGroupEvents['emit'](_0x58c445+':'+_0x20098f['id'],_0x20098f);ChatGroupEvents[_0x4f9e('0x5')](_0x58c445,_0x20098f);_0x18ff12(null);};}for(var e in events){if(events[_0x4f9e('0x6')](e)){var event=events[e];ChatGroup[_0x4f9e('0x7')](e,emitEvent(event));}}module[_0x4f9e('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x783c=['emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x783c,0x1bb));var _0xc783=function(_0x360fbf,_0x218edb){_0x360fbf=_0x360fbf-0x0;var _0x289d7b=_0x783c[_0x360fbf];return _0x289d7b;};'use strict';var EventEmitter=require(_0xc783('0x0'));var ChatGroup=require(_0xc783('0x1'))['db'][_0xc783('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc783('0x3')](0x0);var events={'afterCreate':_0xc783('0x4'),'afterUpdate':_0xc783('0x5'),'afterDestroy':_0xc783('0x6')};function emitEvent(_0x536543){return function(_0x16be5b,_0x3be1df,_0x103ed7){ChatGroupEvents[_0xc783('0x7')](_0x536543+':'+_0x16be5b['id'],_0x16be5b);ChatGroupEvents[_0xc783('0x7')](_0x536543,_0x16be5b);_0x103ed7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xc783('0x8')](e,emitEvent(event));}}module[_0xc783('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1a67b2c..51e5aff 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 _0xc211=['request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird'];(function(_0x2250a4,_0x30b221){var _0x85ab02=function(_0x199aa6){while(--_0x199aa6){_0x2250a4['push'](_0x2250a4['shift']());}};_0x85ab02(++_0x30b221);}(_0xc211,0x140));var _0x1c21=function(_0x5d3219,_0x32f848){_0x5d3219=_0x5d3219-0x0;var _0x354ed3=_0xc211[_0x5d3219];return _0x354ed3;};'use strict';var _=require('lodash');var util=require(_0x1c21('0x0'));var logger=require(_0x1c21('0x1'))('api');var moment=require(_0x1c21('0x2'));var BPromise=require(_0x1c21('0x3'));var rp=require(_0x1c21('0x4'));var fs=require('fs');var path=require(_0x1c21('0x5'));var rimraf=require(_0x1c21('0x6'));var config=require(_0x1c21('0x7'));var attributes=require('./chatGroup.attributes');module[_0x1c21('0x8')]=function(_0x3027a2,_0x292dca){return _0x3027a2[_0x1c21('0x9')](_0x1c21('0xa'),attributes,{'tableName':_0x1c21('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0fd=['rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','util','api','moment','bluebird','path'];(function(_0x517958,_0x1749af){var _0x5d2bcb=function(_0x4121e5){while(--_0x4121e5){_0x517958['push'](_0x517958['shift']());}};_0x5d2bcb(++_0x1749af);}(_0xb0fd,0xa5));var _0xdb0f=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xb0fd[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require('lodash');var util=require(_0xdb0f('0x0'));var logger=require('../../config/logger')(_0xdb0f('0x1'));var moment=require(_0xdb0f('0x2'));var BPromise=require(_0xdb0f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb0f('0x4'));var rimraf=require(_0xdb0f('0x5'));var config=require(_0xdb0f('0x6'));var attributes=require(_0xdb0f('0x7'));module['exports']=function(_0x1c0787,_0x4826e6){return _0x1c0787[_0xdb0f('0x8')](_0xdb0f('0x9'),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 e5f38af..5e43e57 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 _0x093a=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment'];(function(_0x3c8183,_0x53bb2f){var _0x5a1036=function(_0x322e39){while(--_0x322e39){_0x3c8183['push'](_0x3c8183['shift']());}};_0x5a1036(++_0x53bb2f);}(_0x093a,0x16a));var _0xa093=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x093a[_0x271060];return _0x40540b;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var moment=require(_0xa093('0x1'));var BPromise=require(_0xa093('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa093('0x3'))['db'];var utils=require(_0xa093('0x4'));var logger=require(_0xa093('0x5'))(_0xa093('0x6'));var config=require(_0xa093('0x7'));var jayson=require(_0xa093('0x8'));var client=jayson[_0xa093('0x9')][_0xa093('0xa')]({'port':0x232a});config[_0xa093('0xb')]=_[_0xa093('0xc')](config[_0xa093('0xb')],{'host':_0xa093('0xd'),'port':0x18eb});var socket=require(_0xa093('0xe'))(new Redis(config[_0xa093('0xb')]));require(_0xa093('0xf'))[_0xa093('0x10')](socket);function respondWithRpcPromise(_0x13da42,_0x28892a,_0x86da1a){return new BPromise(function(_0x9064f1,_0x5cb78){return client['request'](_0x13da42,_0x86da1a)[_0xa093('0x11')](function(_0x3e8ba0){logger[_0xa093('0x12')]('ChatGroup,\x20%s,\x20%s',_0x28892a,_0xa093('0x13'));logger[_0xa093('0x14')](_0xa093('0x15'),_0x28892a,_0xa093('0x13'),JSON[_0xa093('0x16')](_0x3e8ba0));if(_0x3e8ba0[_0xa093('0x17')]){if(_0x3e8ba0[_0xa093('0x17')]['code']===0x1f4){logger[_0xa093('0x17')]('ChatGroup,\x20%s,\x20%s',_0x28892a,_0x3e8ba0[_0xa093('0x17')][_0xa093('0x18')]);return _0x5cb78(_0x3e8ba0[_0xa093('0x17')][_0xa093('0x18')]);}logger[_0xa093('0x17')](_0xa093('0x19'),_0x28892a,_0x3e8ba0[_0xa093('0x17')][_0xa093('0x18')]);return _0x9064f1(_0x3e8ba0['error'][_0xa093('0x18')]);}else{logger[_0xa093('0x12')](_0xa093('0x19'),_0x28892a,_0xa093('0x13'));_0x9064f1(_0x3e8ba0[_0xa093('0x1a')][_0xa093('0x18')]);}})[_0xa093('0x1b')](function(_0x487ed7){logger[_0xa093('0x17')]('ChatGroup,\x20%s,\x20%s',_0x28892a,_0x487ed7);_0x5cb78(_0x487ed7);});});} \ No newline at end of file +var _0xdab2=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0xc7de08,_0x32245a){var _0x20275b=function(_0x33b101){while(--_0x33b101){_0xc7de08['push'](_0xc7de08['shift']());}};_0x20275b(++_0x32245a);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var moment=require('moment');var BPromise=require(_0x2dab('0x2'));var rs=require(_0x2dab('0x3'));var fs=require('fs');var Redis=require(_0x2dab('0x4'));var db=require(_0x2dab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dab('0x6'))(_0x2dab('0x7'));var config=require(_0x2dab('0x8'));var jayson=require(_0x2dab('0x9'));var client=jayson[_0x2dab('0xa')][_0x2dab('0xb')]({'port':0x232a});config[_0x2dab('0xc')]=_[_0x2dab('0xd')](config[_0x2dab('0xc')],{'host':_0x2dab('0xe'),'port':0x18eb});var socket=require(_0x2dab('0xf'))(new Redis(config[_0x2dab('0xc')]));require(_0x2dab('0x10'))['register'](socket);function respondWithRpcPromise(_0x596950,_0x26852f,_0x18db7b){return new BPromise(function(_0x1e258e,_0x4bc28b){return client['request'](_0x596950,_0x18db7b)[_0x2dab('0x11')](function(_0x3e7252){logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));logger['debug'](_0x2dab('0x15'),_0x26852f,_0x2dab('0x14'),JSON['stringify'](_0x3e7252));if(_0x3e7252[_0x2dab('0x16')]){if(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x17')]===0x1f4){logger['error'](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x4bc28b(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}logger[_0x2dab('0x16')](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x1e258e(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}else{logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));_0x1e258e(_0x3e7252[_0x2dab('0x19')]['message']);}})[_0x2dab('0x1a')](function(_0x366e7c){logger[_0x2dab('0x16')]('ChatGroup,\x20%s,\x20%s',_0x26852f,_0x366e7c);_0x4bc28b(_0x366e7c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2bb6d36..5378ac3 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 _0x242a=['register','length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x15b298,_0x5bd763){var _0x301ee4=function(_0x46910e){while(--_0x46910e){_0x15b298['push'](_0x15b298['shift']());}};_0x301ee4(++_0x5bd763);}(_0x242a,0xae));var _0xa242=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x242a[_0xa8883];return _0x479426;};'use strict';var ChatGroupEvents=require(_0xa242('0x0'));var events=[_0xa242('0x1'),_0xa242('0x2'),_0xa242('0x3')];function createListener(_0x18d2fe,_0xa859d4){return function(_0x3b4e3a){_0xa859d4[_0xa242('0x4')](_0x18d2fe,_0x3b4e3a);};}function removeListener(_0x24b105,_0x57641c){return function(){ChatGroupEvents[_0xa242('0x5')](_0x24b105,_0x57641c);};}exports[_0xa242('0x6')]=function(_0x1e7b8c){for(var _0x354504=0x0,_0x46b8af=events[_0xa242('0x7')];_0x354504<_0x46b8af;_0x354504++){var _0x4aa3ca=events[_0x354504];var _0x10de1c=createListener(_0xa242('0x8')+_0x4aa3ca,_0x1e7b8c);ChatGroupEvents['on'](_0x4aa3ca,_0x10de1c);}}; \ No newline at end of file +var _0x34b7=['save','remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x34b7,0x194));var _0x734b=function(_0x44365d,_0x44e0cb){_0x44365d=_0x44365d-0x0;var _0x1a4a9e=_0x34b7[_0x44365d];return _0x1a4a9e;};'use strict';var ChatGroupEvents=require(_0x734b('0x0'));var events=[_0x734b('0x1'),_0x734b('0x2'),_0x734b('0x3')];function createListener(_0x1afa9e,_0x4071ac){return function(_0x126c99){_0x4071ac[_0x734b('0x4')](_0x1afa9e,_0x126c99);};}function removeListener(_0x3f0178,_0x12d4f4){return function(){ChatGroupEvents[_0x734b('0x5')](_0x3f0178,_0x12d4f4);};}exports[_0x734b('0x6')]=function(_0x413a44){for(var _0x15f7d1=0x0,_0x24767e=events[_0x734b('0x7')];_0x15f7d1<_0x24767e;_0x15f7d1++){var _0x11f78d=events[_0x15f7d1];var _0x34f200=createListener(_0x734b('0x8')+_0x11f78d,_0x413a44);ChatGroupEvents['on'](_0x11f78d,_0x34f200);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c62bae5..ced58ef 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 _0xf8b4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','get','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','path'];(function(_0x18fa32,_0x1d6a88){var _0xd64cca=function(_0x4e8a52){while(--_0x4e8a52){_0x18fa32['push'](_0x18fa32['shift']());}};_0xd64cca(++_0x1d6a88);}(_0xf8b4,0xac));var _0x4f8b=function(_0xcd0043,_0x2e5019){_0xcd0043=_0xcd0043-0x0;var _0x22d396=_0xf8b4[_0xcd0043];return _0x22d396;};'use strict';var multer=require(_0x4f8b('0x0'));var util=require('util');var path=require(_0x4f8b('0x1'));var timeout=require(_0x4f8b('0x2'));var express=require(_0x4f8b('0x3'));var router=express[_0x4f8b('0x4')]();var fs_extra=require(_0x4f8b('0x5'));var auth=require(_0x4f8b('0x6'));var interaction=require(_0x4f8b('0x7'));var config=require(_0x4f8b('0x8'));var controller=require(_0x4f8b('0x9'));router['get']('/',auth[_0x4f8b('0xa')](),controller[_0x4f8b('0xb')]);router['get']('/describe',auth[_0x4f8b('0xa')](),controller[_0x4f8b('0xc')]);router['get'](_0x4f8b('0xd'),auth[_0x4f8b('0xa')](),controller[_0x4f8b('0xe')]);router['get'](_0x4f8b('0xf'),auth['isAuthenticated'](),controller[_0x4f8b('0x10')]);router[_0x4f8b('0x11')](_0x4f8b('0x12'),auth[_0x4f8b('0xa')](),controller['getMembers']);router[_0x4f8b('0x11')](_0x4f8b('0x13'),auth[_0x4f8b('0xa')](),controller['getMessages']);router[_0x4f8b('0x14')]('/',auth[_0x4f8b('0xa')](),controller[_0x4f8b('0x15')]);router[_0x4f8b('0x14')](_0x4f8b('0x12'),auth[_0x4f8b('0xa')](),controller[_0x4f8b('0x16')]);router[_0x4f8b('0x14')](_0x4f8b('0x13'),auth[_0x4f8b('0xa')](),controller[_0x4f8b('0x17')]);router[_0x4f8b('0x18')](_0x4f8b('0xd'),auth[_0x4f8b('0xa')](),controller[_0x4f8b('0x19')]);router['delete'](_0x4f8b('0xd'),auth[_0x4f8b('0xa')](),controller['destroy']);router[_0x4f8b('0x1a')](_0x4f8b('0x12'),auth[_0x4f8b('0xa')](),controller[_0x4f8b('0x1b')]);module[_0x4f8b('0x1c')]=router; \ No newline at end of file +var _0x1771=['getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','/:id','/:id/unread'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x1771,0x1be));var _0x1177=function(_0x14538e,_0xd749b9){_0x14538e=_0x14538e-0x0;var _0x3e100b=_0x1771[_0x14538e];return _0x3e100b;};'use strict';var multer=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var path=require(_0x1177('0x2'));var timeout=require('connect-timeout');var express=require(_0x1177('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1177('0x4'));var interaction=require(_0x1177('0x5'));var config=require(_0x1177('0x6'));var controller=require(_0x1177('0x7'));router[_0x1177('0x8')]('/',auth['isAuthenticated'](),controller[_0x1177('0x9')]);router[_0x1177('0x8')]('/describe',auth[_0x1177('0xa')](),controller['describe']);router[_0x1177('0x8')](_0x1177('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1177('0x8')](_0x1177('0xc'),auth[_0x1177('0xa')](),controller[_0x1177('0xd')]);router[_0x1177('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x1177('0xe')]);router[_0x1177('0x8')](_0x1177('0xf'),auth[_0x1177('0xa')](),controller[_0x1177('0x10')]);router['post']('/',auth[_0x1177('0xa')](),controller[_0x1177('0x11')]);router[_0x1177('0x12')](_0x1177('0x13'),auth[_0x1177('0xa')](),controller[_0x1177('0x14')]);router[_0x1177('0x12')]('/:id/messages',auth[_0x1177('0xa')](),controller[_0x1177('0x15')]);router[_0x1177('0x16')](_0x1177('0xb'),auth[_0x1177('0xa')](),controller['update']);router[_0x1177('0x17')](_0x1177('0xb'),auth[_0x1177('0xa')](),controller[_0x1177('0x18')]);router[_0x1177('0x17')]('/:id/members',auth[_0x1177('0xa')](),controller[_0x1177('0x19')]);module[_0x1177('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 e071409..bcb1e5f 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 _0xcae2=['TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x1c557a,_0x554e3b){var _0x30fc54=function(_0x17e964){while(--_0x17e964){_0x1c557a['push'](_0x1c557a['shift']());}};_0x30fc54(++_0x554e3b);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2cae('0x0'));module[_0x2cae('0x1')]={'closed':{'type':Sequelize[_0x2cae('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2cae('0x3')]},'ratingType':{'type':Sequelize[_0x2cae('0x4')](_0x2cae('0x5'),_0x2cae('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2cae('0x7')]},'pathTranscript':{'type':Sequelize[_0x2cae('0x7')]},'mailTranscript':{'type':Sequelize[_0x2cae('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2cae('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2cae('0x8')]},'thirdDisposition':{'type':Sequelize[_0x2cae('0x8')]},'note':{'type':Sequelize[_0x2cae('0x8')]},'browserName':{'type':Sequelize[_0x2cae('0x8')]},'browserVersion':{'type':Sequelize[_0x2cae('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2cae('0x8')]},'referer':{'type':Sequelize[_0x2cae('0x7')]},'customerIp':{'type':Sequelize[_0x2cae('0x8')]},'formData':{'type':Sequelize[_0x2cae('0x7')](_0x2cae('0xa'))},'read1stAt':{'type':Sequelize[_0x2cae('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2cae('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2cae('0x8')]},'customerPort':{'type':Sequelize[_0x2cae('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x2cae('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x2cae('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x80ed=['INTEGER','ENUM','thumb','star','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80ed,0x11c));var _0xd80e=function(_0x58ec94,_0x1d47ad){_0x58ec94=_0x58ec94-0x0;var _0xa6f4d1=_0x80ed[_0x58ec94];return _0xa6f4d1;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd80e('0x2')]},'ratingType':{'type':Sequelize[_0xd80e('0x3')]('star',_0xd80e('0x4')),'defaultValue':_0xd80e('0x5')},'ratingMessage':{'type':Sequelize[_0xd80e('0x6')]},'pathTranscript':{'type':Sequelize[_0xd80e('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd80e('0x7')]},'disposition':{'type':Sequelize[_0xd80e('0x8')]},'secondDisposition':{'type':Sequelize[_0xd80e('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd80e('0x8')]},'browserName':{'type':Sequelize[_0xd80e('0x8')]},'browserVersion':{'type':Sequelize[_0xd80e('0x8')]},'osName':{'type':Sequelize[_0xd80e('0x8')]},'osVersion':{'type':Sequelize[_0xd80e('0x8')]},'deviceModel':{'type':Sequelize[_0xd80e('0x8')]},'deviceVendor':{'type':Sequelize[_0xd80e('0x8')]},'deviceType':{'type':Sequelize[_0xd80e('0x8')]},'referer':{'type':Sequelize[_0xd80e('0x6')]},'customerIp':{'type':Sequelize[_0xd80e('0x8')]},'formData':{'type':Sequelize['TEXT'](_0xd80e('0x9'))},'read1stAt':{'type':Sequelize[_0xd80e('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd80e('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd80e('0x3')]('in',_0xd80e('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd80e('0x8')]},'customerPort':{'type':Sequelize[_0xd80e('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xd80e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 9afbca3..5c3dedd 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 _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x3ea8c6,_0x28b9a5){var _0x273e9f=function(_0x2d8aab){while(--_0x2d8aab){_0x3ea8c6['push'](_0x3ea8c6['shift']());}};_0x273e9f(++_0x28b9a5);}(_0xd943,0x15d));var _0x3d94=function(_0x3b2c2d,_0x566a5c){_0x3b2c2d=_0x3b2c2d-0x0;var _0x25308b=_0xd943[_0x3b2c2d];return _0x25308b;};'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 pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('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');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));}; \ No newline at end of file +var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','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','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','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','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4ef42f,_0x413fd0){_0x4ef42f=_0x4ef42f-0x0;var _0x5768c8=_0x9ffd[_0x4ef42f];return _0x5768c8;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 13439bc..1d1676c 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 _0x6d99=['Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6d99,0xb6));var _0x96d9=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x6d99[_0x31b9cf];return _0x357b8a;};'use strict';var EventEmitter=require(_0x96d9('0x0'));var ChatInteraction=require(_0x96d9('0x1'))['db'][_0x96d9('0x2')];var ChatMessage=require(_0x96d9('0x1'))['db'][_0x96d9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x96d9('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x96d9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50ca07){return function(_0x9fbe57,_0x5dfedb,_0xa3ef23){_0x9fbe57[_0x96d9('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x53b36e){_0x9fbe57[_0x96d9('0x7')](_0x96d9('0x8'),_0x53b36e[_0x96d9('0x9')](function(_0x120592){return{'id':_0x120592['id']};}));return ChatMessage[_0x96d9('0xa')]({'where':{'ChatInteractionId':_0x9fbe57['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96d9('0xb')](function(_0x456610){_0x9fbe57[_0x96d9('0x7')](_0x96d9('0xc'),_0x456610[_0x96d9('0xd')]);ChatInteractionEvents['emit'](_0x50ca07+':'+_0x9fbe57['id'],_0x9fbe57);ChatInteractionEvents[_0x96d9('0xe')](_0x50ca07,_0x9fbe57);_0xa3ef23(null);})[_0x96d9('0xf')](_0xa3ef23(null));};}for(var e in events){if(events[_0x96d9('0x10')](e)){var event=events[e];ChatInteraction[_0x96d9('0x11')](e,emitEvent(event));}}module[_0x96d9('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x1450=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','Users','map','findAll','setDataValue','length','emit','hasOwnProperty','exports'];(function(_0x2f6bac,_0x1435b8){var _0x22c741=function(_0x52439f){while(--_0x52439f){_0x2f6bac['push'](_0x2f6bac['shift']());}};_0x22c741(++_0x1435b8);}(_0x1450,0x140));var _0x0145=function(_0x2ed99d,_0x416642){_0x2ed99d=_0x2ed99d-0x0;var _0xa88904=_0x1450[_0x2ed99d];return _0xa88904;};'use strict';var EventEmitter=require(_0x0145('0x0'));var ChatInteraction=require(_0x0145('0x1'))['db'][_0x0145('0x2')];var ChatMessage=require(_0x0145('0x1'))['db'][_0x0145('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0145('0x4')](0x0);var events={'afterCreate':_0x0145('0x5'),'afterUpdate':_0x0145('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1f0f60){return function(_0x27d238,_0x3a6351,_0x25d92a){_0x27d238[_0x0145('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18d6ce){_0x27d238['setDataValue'](_0x0145('0x8'),_0x18d6ce[_0x0145('0x9')](function(_0x4def58){return{'id':_0x4def58['id']};}));return ChatMessage[_0x0145('0xa')]({'where':{'ChatInteractionId':_0x27d238['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x15629e){_0x27d238[_0x0145('0xb')]('unreadMessages',_0x15629e[_0x0145('0xc')]);ChatInteractionEvents[_0x0145('0xd')](_0x1f0f60+':'+_0x27d238['id'],_0x27d238);ChatInteractionEvents[_0x0145('0xd')](_0x1f0f60,_0x27d238);_0x25d92a(null);})['catch'](_0x25d92a(null));};}for(var e in events){if(events[_0x0145('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x0145('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index db74daa..e555f19 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 _0xe1a0=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe1a0,0x1c9));var _0x0e1a=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xe1a0[_0x59342a];return _0x17abc9;};'use strict';var _=require(_0x0e1a('0x0'));var util=require(_0x0e1a('0x1'));var logger=require(_0x0e1a('0x2'))(_0x0e1a('0x3'));var moment=require(_0x0e1a('0x4'));var BPromise=require(_0x0e1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e1a('0x6'));var rimraf=require(_0x0e1a('0x7'));var config=require(_0x0e1a('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x0e1a('0x9')]=function(_0x8ff69c,_0x4f6f63){return _0x8ff69c['define'](_0x0e1a('0xa'),attributes,{'tableName':_0x0e1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x171901,_0x4c0713,_0x513bb8){if(_0x171901['changed'](_0x0e1a('0xc'))){_0x171901['closedAt']=moment()[_0x0e1a('0xd')](_0x0e1a('0xe'));}_0x513bb8(null,_0x171901);}},'charset':_0x0e1a('0xf'),'collate':_0x0e1a('0x10')});}; \ No newline at end of file +var _0x1ebf=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed'];(function(_0xe92327,_0x1688a5){var _0x3a1773=function(_0x88922e){while(--_0x88922e){_0xe92327['push'](_0xe92327['shift']());}};_0x3a1773(++_0x1688a5);}(_0x1ebf,0x1e9));var _0xf1eb=function(_0x54f809,_0x48e290){_0x54f809=_0x54f809-0x0;var _0x21c936=_0x1ebf[_0x54f809];return _0x21c936;};'use strict';var _=require(_0xf1eb('0x0'));var util=require(_0xf1eb('0x1'));var logger=require(_0xf1eb('0x2'))(_0xf1eb('0x3'));var moment=require(_0xf1eb('0x4'));var BPromise=require(_0xf1eb('0x5'));var rp=require(_0xf1eb('0x6'));var fs=require('fs');var path=require(_0xf1eb('0x7'));var rimraf=require(_0xf1eb('0x8'));var config=require(_0xf1eb('0x9'));var attributes=require(_0xf1eb('0xa'));module['exports']=function(_0x4340b7,_0x19883f){return _0x4340b7[_0xf1eb('0xb')](_0xf1eb('0xc'),attributes,{'tableName':_0xf1eb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b813f,_0x3329df,_0x139317){if(_0x3b813f[_0xf1eb('0xe')](_0xf1eb('0xf'))){_0x3b813f[_0xf1eb('0x10')]=moment()[_0xf1eb('0x11')](_0xf1eb('0x12'));}_0x139317(null,_0x3b813f);}},'charset':_0xf1eb('0x13'),'collate':_0xf1eb('0x14')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index efa3af0..0120925 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 _0x3241=['options','raw','limit','stringify','AddTagsToChatInteraction','ChatInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','update','body'];(function(_0x1edd41,_0x385286){var _0x3e9105=function(_0x1ca5ac){while(--_0x1ca5ac){_0x1edd41['push'](_0x1edd41['shift']());}};_0x3e9105(++_0x385286);}(_0x3241,0x199));var _0x1324=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1324('0x0'));var util=require(_0x1324('0x1'));var moment=require(_0x1324('0x2'));var BPromise=require(_0x1324('0x3'));var rs=require(_0x1324('0x4'));var fs=require('fs');var Redis=require(_0x1324('0x5'));var db=require(_0x1324('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1324('0x7'))(_0x1324('0x8'));var config=require(_0x1324('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1324('0xa')][_0x1324('0xb')]({'port':0x232a});config[_0x1324('0xc')]=_['defaults'](config[_0x1324('0xc')],{'host':_0x1324('0xd'),'port':0x18eb});var socket=require(_0x1324('0xe'))(new Redis(config['redis']));require(_0x1324('0xf'))[_0x1324('0x10')](socket);function respondWithRpcPromise(_0x4a4f9b,_0x56a3c4,_0x1e98dd){return new BPromise(function(_0x54a43f,_0x338890){return client[_0x1324('0x11')](_0x4a4f9b,_0x1e98dd)[_0x1324('0x12')](function(_0x119958){logger[_0x1324('0x13')](_0x1324('0x14'),_0x56a3c4,_0x1324('0x15'));logger[_0x1324('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x56a3c4,_0x1324('0x15'),JSON['stringify'](_0x119958));if(_0x119958[_0x1324('0x17')]){if(_0x119958[_0x1324('0x17')][_0x1324('0x18')]===0x1f4){logger[_0x1324('0x17')](_0x1324('0x14'),_0x56a3c4,_0x119958['error'][_0x1324('0x19')]);return _0x338890(_0x119958[_0x1324('0x17')][_0x1324('0x19')]);}logger[_0x1324('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x56a3c4,_0x119958['error'][_0x1324('0x19')]);return _0x54a43f(_0x119958['error'][_0x1324('0x19')]);}else{logger[_0x1324('0x13')](_0x1324('0x14'),_0x56a3c4,_0x1324('0x15'));_0x54a43f(_0x119958[_0x1324('0x1a')][_0x1324('0x19')]);}})[_0x1324('0x1b')](function(_0xa66054){logger[_0x1324('0x17')](_0x1324('0x14'),_0x56a3c4,_0xa66054);_0x338890(_0xa66054);});});}exports[_0x1324('0x1c')]=function(_0x3ae339){var _0x4f53e=this;return new Promise(function(_0x3a2849,_0x384339){return db['ChatInteraction'][_0x1324('0x1d')](_0x3ae339[_0x1324('0x1e')],{'raw':_0x3ae339[_0x1324('0x1f')]?_0x3ae339['options'][_0x1324('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ae339[_0x1324('0x1f')]?_0x3ae339['options']['where']||null:null,'attributes':_0x3ae339[_0x1324('0x1f')]?_0x3ae339[_0x1324('0x1f')]['attributes']||null:null,'limit':_0x3ae339[_0x1324('0x1f')]?_0x3ae339[_0x1324('0x1f')][_0x1324('0x21')]||null:null})['then'](function(_0x34f2fc){logger[_0x1324('0x13')](_0x1324('0x1c'),_0x3ae339);logger['debug']('UpdateChatInteraction',_0x3ae339,JSON[_0x1324('0x22')](_0x34f2fc));_0x3a2849(_0x34f2fc);})['catch'](function(_0xb265d4){logger['error'](_0x1324('0x1c'),_0xb265d4['message'],_0x3ae339);_0x384339(_0x4f53e[_0x1324('0x17')](0x1f4,_0xb265d4[_0x1324('0x19')]));});});};exports[_0x1324('0x23')]=function(_0x4d152c){return new Promise(function(_0x11caf1,_0x1a23ac){return db[_0x1324('0x24')][_0x1324('0x25')]({'where':_0x4d152c[_0x1324('0x1f')]?_0x4d152c[_0x1324('0x1f')][_0x1324('0x26')]||null:null})[_0x1324('0x12')](function(_0x32cad6){if(_0x32cad6){return _0x32cad6[_0x1324('0x27')](_0x4d152c[_0x1324('0x1e')]['ids'],_[_0x1324('0x28')](_0x4d152c['body'],[_0x1324('0x29'),'id'])||{});}})[_0x1324('0x2a')](function(_0x26eadb){logger[_0x1324('0x13')](_0x1324('0x2b'),_0x4d152c);logger[_0x1324('0x16')](_0x1324('0x2b'),_0x4d152c,JSON['stringify'](_0x26eadb));_0x11caf1(_0x26eadb);})['catch'](function(_0x18fa29){logger[_0x1324('0x17')](_0x1324('0x2b'),_0x18fa29['message'],_0x4d152c);_0x1a23ac(_this['error'](0x1f4,_0x18fa29[_0x1324('0x19')]));});});}; \ No newline at end of file +var _0x6209=['../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','update','body','options','raw','attributes','limit','find','where','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6209,0x137));var _0x9620=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x6209[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x9620('0x0'));var util=require(_0x9620('0x1'));var moment=require(_0x9620('0x2'));var BPromise=require(_0x9620('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9620('0x4'));var db=require(_0x9620('0x5'))['db'];var utils=require(_0x9620('0x6'));var logger=require(_0x9620('0x7'))(_0x9620('0x8'));var config=require(_0x9620('0x9'));var jayson=require(_0x9620('0xa'));var client=jayson[_0x9620('0xb')][_0x9620('0xc')]({'port':0x232a});config[_0x9620('0xd')]=_['defaults'](config[_0x9620('0xd')],{'host':_0x9620('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9620('0xd')]));require(_0x9620('0xf'))[_0x9620('0x10')](socket);function respondWithRpcPromise(_0x103e41,_0x3ec3b7,_0x279df1){return new BPromise(function(_0x232fdd,_0x2da94e){return client['request'](_0x103e41,_0x279df1)[_0x9620('0x11')](function(_0x5cd0d2){logger[_0x9620('0x12')](_0x9620('0x13'),_0x3ec3b7,_0x9620('0x14'));logger[_0x9620('0x15')](_0x9620('0x16'),_0x3ec3b7,_0x9620('0x14'),JSON[_0x9620('0x17')](_0x5cd0d2));if(_0x5cd0d2[_0x9620('0x18')]){if(_0x5cd0d2['error']['code']===0x1f4){logger[_0x9620('0x18')](_0x9620('0x13'),_0x3ec3b7,_0x5cd0d2[_0x9620('0x18')]['message']);return _0x2da94e(_0x5cd0d2[_0x9620('0x18')][_0x9620('0x19')]);}logger[_0x9620('0x18')](_0x9620('0x13'),_0x3ec3b7,_0x5cd0d2[_0x9620('0x18')]['message']);return _0x232fdd(_0x5cd0d2[_0x9620('0x18')]['message']);}else{logger[_0x9620('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3ec3b7,_0x9620('0x14'));_0x232fdd(_0x5cd0d2[_0x9620('0x1a')][_0x9620('0x19')]);}})[_0x9620('0x1b')](function(_0x59180b){logger[_0x9620('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3ec3b7,_0x59180b);_0x2da94e(_0x59180b);});});}exports[_0x9620('0x1c')]=function(_0x4ddf58){var _0x13d4da=this;return new Promise(function(_0x40f0f1,_0x52fe42){return db['ChatInteraction'][_0x9620('0x1d')](_0x4ddf58[_0x9620('0x1e')],{'raw':_0x4ddf58[_0x9620('0x1f')]?_0x4ddf58[_0x9620('0x1f')][_0x9620('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ddf58['options']?_0x4ddf58['options']['where']||null:null,'attributes':_0x4ddf58['options']?_0x4ddf58['options'][_0x9620('0x21')]||null:null,'limit':_0x4ddf58['options']?_0x4ddf58['options'][_0x9620('0x22')]||null:null})[_0x9620('0x11')](function(_0x154660){logger['info'](_0x9620('0x1c'),_0x4ddf58);logger[_0x9620('0x15')]('UpdateChatInteraction',_0x4ddf58,JSON[_0x9620('0x17')](_0x154660));_0x40f0f1(_0x154660);})[_0x9620('0x1b')](function(_0x17194b){logger[_0x9620('0x18')](_0x9620('0x1c'),_0x17194b[_0x9620('0x19')],_0x4ddf58);_0x52fe42(_0x13d4da[_0x9620('0x18')](0x1f4,_0x17194b[_0x9620('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x106660){return new Promise(function(_0x107dc8,_0x7e7dd0){return db['ChatInteraction'][_0x9620('0x23')]({'where':_0x106660[_0x9620('0x1f')]?_0x106660[_0x9620('0x1f')][_0x9620('0x24')]||null:null})[_0x9620('0x11')](function(_0x4f0a94){if(_0x4f0a94){return _0x4f0a94['addTags'](_0x106660['body']['ids'],_[_0x9620('0x25')](_0x106660[_0x9620('0x1e')],['ids','id'])||{});}})[_0x9620('0x26')](function(_0x17691d){logger[_0x9620('0x12')](_0x9620('0x27'),_0x106660);logger['debug']('AddTags',_0x106660,JSON['stringify'](_0x17691d));_0x107dc8(_0x17691d);})[_0x9620('0x1b')](function(_0x372d5a){logger[_0x9620('0x18')](_0x9620('0x27'),_0x372d5a[_0x9620('0x19')],_0x106660);_0x7e7dd0(_this['error'](0x1f4,_0x372d5a[_0x9620('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e643891..9c509ed 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 _0x50ec=['length','./chatInteraction.events','save','update','emit','removeListener','register'];(function(_0x12e73c,_0x2cbe1d){var _0x4c41cb=function(_0x10283b){while(--_0x10283b){_0x12e73c['push'](_0x12e73c['shift']());}};_0x4c41cb(++_0x2cbe1d);}(_0x50ec,0xc5));var _0xc50e=function(_0x35fae9,_0x27ad94){_0x35fae9=_0x35fae9-0x0;var _0x2a0ddf=_0x50ec[_0x35fae9];return _0x2a0ddf;};'use strict';var ChatInteractionEvents=require(_0xc50e('0x0'));var events=[_0xc50e('0x1'),'remove',_0xc50e('0x2')];function createListener(_0x1ebe23,_0x293f21){return function(_0x5b6dd0){_0x293f21[_0xc50e('0x3')](_0x1ebe23,_0x5b6dd0);};}function removeListener(_0x42b919,_0x2a9768){return function(){ChatInteractionEvents[_0xc50e('0x4')](_0x42b919,_0x2a9768);};}exports[_0xc50e('0x5')]=function(_0x44609c){for(var _0x197a81=0x0,_0x1f684a=events[_0xc50e('0x6')];_0x197a81<_0x1f684a;_0x197a81++){var _0x17237e=events[_0x197a81];var _0x1c0acf=createListener('chatInteraction:'+_0x17237e,_0x44609c);ChatInteractionEvents['on'](_0x17237e,_0x1c0acf);}}; \ No newline at end of file +var _0x7548=['chatInteraction:','update','length'];(function(_0x26f192,_0x1659d5){var _0x222f38=function(_0x3925c2){while(--_0x3925c2){_0x26f192['push'](_0x26f192['shift']());}};_0x222f38(++_0x1659d5);}(_0x7548,0x1d8));var _0x8754=function(_0x55bc7a,_0x5bae17){_0x55bc7a=_0x55bc7a-0x0;var _0x448e9e=_0x7548[_0x55bc7a];return _0x448e9e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0x8754('0x0')];function createListener(_0x447a33,_0xdb2d33){return function(_0x534c23){_0xdb2d33['emit'](_0x447a33,_0x534c23);};}function removeListener(_0x75154c,_0x2507c4){return function(){ChatInteractionEvents['removeListener'](_0x75154c,_0x2507c4);};}exports['register']=function(_0x1d99cf){for(var _0x3dd299=0x0,_0x585b5c=events[_0x8754('0x1')];_0x3dd299<_0x585b5c;_0x3dd299++){var _0x379e2a=events[_0x3dd299];var _0x46b4e1=createListener(_0x8754('0x2')+_0x379e2a,_0x1d99cf);ChatInteractionEvents['on'](_0x379e2a,_0x46b4e1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 047a735..c1d6df0 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 _0x7456=['root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','connect-timeout','express','Router','fs-extra','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage'];(function(_0x57d125,_0x2d386a){var _0x3641a4=function(_0x37d87){while(--_0x37d87){_0x57d125['push'](_0x57d125['shift']());}};_0x3641a4(++_0x2d386a);}(_0x7456,0x149));var _0x6745=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x7456[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6745('0x0'));var express=require(_0x6745('0x1'));var router=express[_0x6745('0x2')]();var fs_extra=require(_0x6745('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6745('0x4'));router[_0x6745('0x5')]('/',auth[_0x6745('0x6')](),controller['index']);router[_0x6745('0x5')]('/describe',auth[_0x6745('0x6')](),controller['describe']);router[_0x6745('0x5')](_0x6745('0x7'),auth[_0x6745('0x8')](),controller[_0x6745('0x9')]);router[_0x6745('0x5')](_0x6745('0xa'),auth[_0x6745('0x8')](),controller[_0x6745('0xb')]);router['get']('/:id/messages',auth[_0x6745('0x6')](),controller[_0x6745('0xc')]);router[_0x6745('0x5')](_0x6745('0xd'),auth[_0x6745('0x8')](),controller[_0x6745('0xe')]);router[_0x6745('0x5')](_0x6745('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x6745('0x10')]('/',auth['isAuthenticated'](),controller[_0x6745('0x11')]);router[_0x6745('0x10')](_0x6745('0x12'),auth[_0x6745('0x6')](),controller[_0x6745('0x13')]);var upload=multer({'storage':multer[_0x6745('0x14')]({'destination':function(_0x53a360,_0xe15d81,_0x180a9a){_0x180a9a(null,path['join'](config[_0x6745('0x15')],_0x6745('0x16')));},'filename':function(_0x2ab1f1,_0x1e4e05,_0x3dddb7){_0x3dddb7(null,util['format'](_0x6745('0x17'),Date[_0x6745('0x18')](),_0x1e4e05['originalname'][_0x6745('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6745('0x10')](_0x6745('0x1a'),upload[_0x6745('0x1b')](_0x6745('0x1c')),controller['attachmentUpload']);router['post'](_0x6745('0x1d'),auth[_0x6745('0x8')](),controller[_0x6745('0x1e')]);router[_0x6745('0x10')]('/:id/tags',auth[_0x6745('0x6')](),interaction['tracked']('chat',_0x6745('0x1f')),controller[_0x6745('0x20')]);router[_0x6745('0x21')](_0x6745('0x7'),auth[_0x6745('0x6')](),interaction[_0x6745('0x22')]('chat',_0x6745('0x23')),controller[_0x6745('0x24')]);router[_0x6745('0x21')](_0x6745('0x25'),controller[_0x6745('0x26')]);router[_0x6745('0x21')](_0x6745('0x27'),auth[_0x6745('0x8')](),controller[_0x6745('0x28')]);router[_0x6745('0x21')](_0x6745('0x29'),controller[_0x6745('0x2a')]);router[_0x6745('0x2b')]('/:id',auth['isAuthenticated'](),interaction[_0x6745('0x22')](_0x6745('0x2c'),_0x6745('0x2d')),controller[_0x6745('0x2e')]);router[_0x6745('0x2b')](_0x6745('0x2f'),auth['isAuthenticated'](),controller[_0x6745('0x30')]);module[_0x6745('0x31')]=router; \ No newline at end of file +var _0x18bb=['addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','/:id','chatinteraction:update','update','put','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','root','server/files/attachments/','format','originalname','replace','single','attachmentUpload','/:id/messages'];(function(_0x522210,_0x297710){var _0x3f7bf8=function(_0x269ccb){while(--_0x269ccb){_0x522210['push'](_0x522210['shift']());}};_0x3f7bf8(++_0x297710);}(_0x18bb,0x1e8));var _0xb18b=function(_0x4b5409,_0x472b71){_0x4b5409=_0x4b5409-0x0;var _0x90b623=_0x18bb[_0x4b5409];return _0x90b623;};'use strict';var multer=require(_0xb18b('0x0'));var util=require(_0xb18b('0x1'));var path=require(_0xb18b('0x2'));var timeout=require(_0xb18b('0x3'));var express=require(_0xb18b('0x4'));var router=express[_0xb18b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb18b('0x6'));var interaction=require(_0xb18b('0x7'));var config=require(_0xb18b('0x8'));var controller=require('./chatInteraction.controller');router[_0xb18b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb18b('0x9')]('/describe',auth[_0xb18b('0xa')](),controller[_0xb18b('0xb')]);router[_0xb18b('0x9')]('/:id',auth[_0xb18b('0xc')](),controller[_0xb18b('0xd')]);router['get']('/:id/attachment_download',auth[_0xb18b('0xc')](),controller[_0xb18b('0xe')]);router[_0xb18b('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb18b('0xf')]);router['get'](_0xb18b('0x10'),auth[_0xb18b('0xc')](),controller['getMyMessages']);router['get'](_0xb18b('0x11'),auth[_0xb18b('0xa')](),controller[_0xb18b('0x12')]);router['post']('/',auth[_0xb18b('0xa')](),controller['create']);router[_0xb18b('0x13')](_0xb18b('0x14'),auth[_0xb18b('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d0528,_0x363016,_0x2f6d1a){_0x2f6d1a(null,path['join'](config[_0xb18b('0x15')],_0xb18b('0x16')));},'filename':function(_0x28f350,_0xb3a95a,_0xb7910c){_0xb7910c(null,util[_0xb18b('0x17')]('%s-%s',Date['now'](),_0xb3a95a[_0xb18b('0x18')][_0xb18b('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb18b('0x13')]('/:id/attachment_upload',upload[_0xb18b('0x1a')]('file'),controller[_0xb18b('0x1b')]);router[_0xb18b('0x13')](_0xb18b('0x1c'),auth['isChatInteractionAuthorized'](),controller[_0xb18b('0x1d')]);router[_0xb18b('0x13')](_0xb18b('0x1e'),auth['isAuthenticated'](),interaction[_0xb18b('0x1f')](_0xb18b('0x20'),_0xb18b('0x21')),controller['addTags']);router['put'](_0xb18b('0x22'),auth[_0xb18b('0xa')](),interaction['tracked']('chat',_0xb18b('0x23')),controller[_0xb18b('0x24')]);router[_0xb18b('0x25')](_0xb18b('0x26'),controller[_0xb18b('0x27')]);router[_0xb18b('0x25')]('/:id/abandon',auth[_0xb18b('0xc')](),controller[_0xb18b('0x28')]);router[_0xb18b('0x25')](_0xb18b('0x29'),controller[_0xb18b('0x2a')]);router[_0xb18b('0x2b')](_0xb18b('0x22'),auth[_0xb18b('0xa')](),interaction[_0xb18b('0x1f')](_0xb18b('0x20'),_0xb18b('0x2c')),controller[_0xb18b('0x2d')]);router[_0xb18b('0x2b')](_0xb18b('0x1e'),auth[_0xb18b('0xa')](),controller['removeTags']);module[_0xb18b('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 88366c0..897d8b1 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 _0x6649=['INTEGER','sequelize','exports','TEXT','medium'];(function(_0x2c4b61,_0x4ddcc2){var _0x136e4b=function(_0x420193){while(--_0x420193){_0x2c4b61['push'](_0x2c4b61['shift']());}};_0x136e4b(++_0x4ddcc2);}(_0x6649,0x1e6));var _0x9664=function(_0x846e1c,_0x2661cb){_0x846e1c=_0x846e1c-0x0;var _0x27a6ef=_0x6649[_0x846e1c];return _0x27a6ef;};'use strict';var Sequelize=require(_0x9664('0x0'));module[_0x9664('0x1')]={'body':{'type':Sequelize[_0x9664('0x2')](_0x9664('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9664('0x4')]}}; \ No newline at end of file +var _0xf9ed=['exports','medium','BOOLEAN','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf9ed,0x10f));var _0xdf9e=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf9ed[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xdf9e('0x0'));module[_0xdf9e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdf9e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdf9e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 18b8080..514ebf4 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 _0xe627=['error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','params','find','create','body','describe','get','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','filter','resourceId','push','messages','FromId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x52dad3,_0x42282c){var _0x248c57=function(_0x2a6a30){while(--_0x2a6a30){_0x52dad3['push'](_0x52dad3['shift']());}};_0x248c57(++_0x42282c);}(_0xe627,0x1f4));var _0x7e62=function(_0x5d2dd1,_0x2e3ddc){_0x5d2dd1=_0x5d2dd1-0x0;var _0x5c30dd=_0xe627[_0x5d2dd1];return _0x5c30dd;};'use strict';var emlformat=require(_0x7e62('0x0'));var rimraf=require(_0x7e62('0x1'));var zipdir=require(_0x7e62('0x2'));var jsonpatch=require(_0x7e62('0x3'));var rp=require(_0x7e62('0x4'));var moment=require(_0x7e62('0x5'));var BPromise=require(_0x7e62('0x6'));var Mustache=require(_0x7e62('0x7'));var util=require('util');var path=require(_0x7e62('0x8'));var sox=require(_0x7e62('0x9'));var csv=require(_0x7e62('0xa'));var ejs=require(_0x7e62('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e62('0xc'));var squel=require(_0x7e62('0xd'));var crypto=require(_0x7e62('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7e62('0xf'));var toCsv=require(_0x7e62('0xa'));var querystring=require(_0x7e62('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e62('0x11'));var qs=require(_0x7e62('0x12'));var as=require(_0x7e62('0x13'));var hardwareService=require(_0x7e62('0x14'));var logger=require(_0x7e62('0x15'))(_0x7e62('0x16'));var utils=require(_0x7e62('0x17'));var config=require(_0x7e62('0x18'));var licenseUtil=require(_0x7e62('0x19'));var db=require('../../mysqldb')['db'];config[_0x7e62('0x1a')]=_[_0x7e62('0x1b')](config[_0x7e62('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e62('0x1c'))(new Redis(config[_0x7e62('0x1a')]));require('./chatInternalMessage.socket')[_0x7e62('0x1d')](socket);function respondWithStatusCode(_0x671f45,_0x616b8c){_0x616b8c=_0x616b8c||0xcc;return function(_0x1a5d94){if(_0x1a5d94){return _0x671f45[_0x7e62('0x1e')](_0x616b8c);}return _0x671f45[_0x7e62('0x1f')](_0x616b8c)[_0x7e62('0x20')]();};}function respondWithResult(_0x2fff29,_0x1219d5){_0x1219d5=_0x1219d5||0xc8;return function(_0x1d5fbf){if(_0x1d5fbf){return _0x2fff29[_0x7e62('0x1f')](_0x1219d5)[_0x7e62('0x21')](_0x1d5fbf);}};}function respondWithFilteredResult(_0x5d0b55,_0xf7eb1e){return function(_0x511b8c){if(_0x511b8c){var _0xd8c082=typeof _0xf7eb1e[_0x7e62('0x22')]===_0x7e62('0x23')&&typeof _0xf7eb1e[_0x7e62('0x24')]===_0x7e62('0x23');var _0x4e46ab=_0x511b8c[_0x7e62('0x25')];var _0x20f23a=_0xd8c082?0x0:_0xf7eb1e[_0x7e62('0x22')];var _0x29e0d1=_0xd8c082?_0x511b8c[_0x7e62('0x25')]:_0xf7eb1e[_0x7e62('0x22')]+_0xf7eb1e[_0x7e62('0x24')];var _0x4d401d;if(_0x29e0d1>=_0x4e46ab){_0x29e0d1=_0x4e46ab;_0x4d401d=0xc8;}else{_0x4d401d=0xce;}_0x5d0b55[_0x7e62('0x1f')](_0x4d401d);return _0x5d0b55[_0x7e62('0x26')](_0x7e62('0x27'),_0x20f23a+'-'+_0x29e0d1+'/'+_0x4e46ab)[_0x7e62('0x21')](_0x511b8c);}return null;};}function patchUpdates(_0x25a469){return function(_0x11361f){try{jsonpatch[_0x7e62('0x28')](_0x11361f,_0x25a469,!![]);}catch(_0xc934d2){return BPromise[_0x7e62('0x29')](_0xc934d2);}return _0x11361f[_0x7e62('0x2a')]();};}function saveUpdates(_0x2f79b1,_0x4a4979){return function(_0x1e7939){if(_0x1e7939){return _0x1e7939['update'](_0x2f79b1)['then'](function(_0x567bd1){return _0x567bd1;});}return null;};}function removeEntity(_0x124fa9,_0x3ca6db){return function(_0xd1beb0){if(_0xd1beb0){return _0xd1beb0[_0x7e62('0x2b')]()[_0x7e62('0x2c')](function(){_0x124fa9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x478602,_0x357686){return function(_0x23d88c){if(!_0x23d88c){_0x478602['sendStatus'](0x194);}return _0x23d88c;};}function handleError(_0x18ea23,_0x2cb916){_0x2cb916=_0x2cb916||0x1f4;return function(_0x4a2bf4){logger[_0x7e62('0x2d')](_0x4a2bf4[_0x7e62('0x2e')]);if(_0x4a2bf4[_0x7e62('0x2f')]){delete _0x4a2bf4[_0x7e62('0x2f')];}_0x18ea23[_0x7e62('0x1f')](_0x2cb916)[_0x7e62('0x30')](_0x4a2bf4);};}exports['index']=function(_0x27b727,_0x4a8ffe){var _0x3bcc97={},_0x2bef2a={},_0x4c30ec={'count':0x0,'rows':[]};var _0x1f30d5=_[_0x7e62('0x31')](db[_0x7e62('0x32')][_0x7e62('0x33')],function(_0x5180de){return{'name':_0x5180de[_0x7e62('0x34')],'type':_0x5180de[_0x7e62('0x35')]['key']};});_0x2bef2a[_0x7e62('0x36')]=_[_0x7e62('0x31')](_0x1f30d5,_0x7e62('0x2f'));_0x2bef2a[_0x7e62('0x37')]=_[_0x7e62('0x38')](_0x27b727[_0x7e62('0x37')]);_0x2bef2a[_0x7e62('0x39')]=_[_0x7e62('0x3a')](_0x2bef2a[_0x7e62('0x36')],_0x2bef2a[_0x7e62('0x37')]);_0x3bcc97[_0x7e62('0x3b')]=_[_0x7e62('0x3a')](_0x2bef2a['model'],qs[_0x7e62('0x3c')](_0x27b727['query'][_0x7e62('0x3c')]));_0x3bcc97[_0x7e62('0x3b')]=_0x3bcc97[_0x7e62('0x3b')][_0x7e62('0x3d')]?_0x3bcc97['attributes']:_0x2bef2a[_0x7e62('0x36')];if(!_0x27b727[_0x7e62('0x37')][_0x7e62('0x3e')](_0x7e62('0x3f'))){_0x3bcc97['limit']=qs[_0x7e62('0x24')](_0x27b727[_0x7e62('0x37')][_0x7e62('0x24')]);_0x3bcc97[_0x7e62('0x22')]=qs[_0x7e62('0x22')](_0x27b727[_0x7e62('0x37')]['offset']);}_0x3bcc97['order']=qs[_0x7e62('0x40')](_0x27b727['query']['sort']);_0x3bcc97[_0x7e62('0x41')]=qs[_0x7e62('0x39')](_[_0x7e62('0x42')](_0x27b727[_0x7e62('0x37')],_0x2bef2a[_0x7e62('0x39')]),_0x1f30d5);if(_0x27b727[_0x7e62('0x37')]['filter']){_0x3bcc97[_0x7e62('0x41')]=_[_0x7e62('0x43')](_0x3bcc97['where'],{'$or':_[_0x7e62('0x31')](_0x1f30d5,function(_0x1b9d3e){if(_0x1b9d3e[_0x7e62('0x35')]!==_0x7e62('0x44')){var _0x4a0e0f={};_0x4a0e0f[_0x1b9d3e['name']]={'$like':'%'+_0x27b727[_0x7e62('0x37')]['filter']+'%'};return _0x4a0e0f;}})});}_0x3bcc97=_[_0x7e62('0x43')]({},_0x3bcc97,_0x27b727[_0x7e62('0x45')]);var _0x38949d={'where':_0x3bcc97[_0x7e62('0x41')]};return db[_0x7e62('0x32')]['count'](_0x38949d)['then'](function(_0x4ef77d){_0x4c30ec[_0x7e62('0x25')]=_0x4ef77d;if(_0x27b727['query']['includeAll']){_0x3bcc97['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7e62('0x46')](_0x3bcc97);})['then'](function(_0x42cd65){_0x4c30ec[_0x7e62('0x47')]=_0x42cd65;return _0x4c30ec;})['then'](respondWithFilteredResult(_0x4a8ffe,_0x3bcc97))[_0x7e62('0x48')](handleError(_0x4a8ffe,null));};exports[_0x7e62('0x49')]=function(_0x124fe3,_0x2c8258){var _0x50d30e={'raw':!![],'where':{'id':_0x124fe3[_0x7e62('0x4a')]['id']}},_0x440602={};_0x440602['model']=_[_0x7e62('0x38')](db[_0x7e62('0x32')]['rawAttributes']);_0x440602['query']=_[_0x7e62('0x38')](_0x124fe3['query']);_0x440602['filters']=_[_0x7e62('0x3a')](_0x440602[_0x7e62('0x36')],_0x440602[_0x7e62('0x37')]);_0x50d30e[_0x7e62('0x3b')]=_['intersection'](_0x440602['model'],qs[_0x7e62('0x3c')](_0x124fe3['query'][_0x7e62('0x3c')]));_0x50d30e['attributes']=_0x50d30e[_0x7e62('0x3b')][_0x7e62('0x3d')]?_0x50d30e[_0x7e62('0x3b')]:_0x440602[_0x7e62('0x36')];if(_0x124fe3[_0x7e62('0x37')]['includeAll']){_0x50d30e['include']=[{'all':!![]}];}_0x50d30e=_['merge']({},_0x50d30e,_0x124fe3[_0x7e62('0x45')]);return db['ChatInternalMessage'][_0x7e62('0x4b')](_0x50d30e)[_0x7e62('0x2c')](handleEntityNotFound(_0x2c8258,null))[_0x7e62('0x2c')](respondWithResult(_0x2c8258,null))[_0x7e62('0x48')](handleError(_0x2c8258,null));};exports[_0x7e62('0x4c')]=function(_0x1f8990,_0x5f1049){return db[_0x7e62('0x32')]['create'](_0x1f8990[_0x7e62('0x4d')],{})['then'](respondWithResult(_0x5f1049,0xc9))[_0x7e62('0x48')](handleError(_0x5f1049,null));};exports['update']=function(_0x1e7fa7,_0x43a326){if(_0x1e7fa7['body']['id']){delete _0x1e7fa7['body']['id'];}return db[_0x7e62('0x32')][_0x7e62('0x4b')]({'where':{'id':_0x1e7fa7[_0x7e62('0x4a')]['id']}})[_0x7e62('0x2c')](handleEntityNotFound(_0x43a326,null))[_0x7e62('0x2c')](saveUpdates(_0x1e7fa7['body'],null))[_0x7e62('0x2c')](respondWithResult(_0x43a326,null))[_0x7e62('0x48')](handleError(_0x43a326,null));};exports[_0x7e62('0x2b')]=function(_0x42f8b4,_0x46d52e){return db['ChatInternalMessage'][_0x7e62('0x4b')]({'where':{'id':_0x42f8b4[_0x7e62('0x4a')]['id']}})[_0x7e62('0x2c')](handleEntityNotFound(_0x46d52e,null))['then'](removeEntity(_0x46d52e,null))[_0x7e62('0x48')](handleError(_0x46d52e,null));};exports['describe']=function(_0x2724c1,_0x54cc65){return db[_0x7e62('0x32')][_0x7e62('0x4e')]()[_0x7e62('0x2c')](respondWithResult(_0x54cc65,null))[_0x7e62('0x48')](handleError(_0x54cc65,null));};function wrapUser(_0x1e7b6f){return function(_0x52cb5e){var _0x34cdc0=_0x1e7b6f[_0x7e62('0x4f')]({'plain':!![]});_0x34cdc0['messages']=[];if(_0x52cb5e){_0x34cdc0['lastMessageAt']=_0x52cb5e[_0x7e62('0x50')];_0x34cdc0[_0x7e62('0x51')]=_0x52cb5e;}else{_0x34cdc0['lastMessageAt']=moment(0x0)[_0x7e62('0x52')](_0x7e62('0x53'));_0x34cdc0[_0x7e62('0x51')]={};}return _0x34cdc0;};}exports['getUsers']=function(_0x3c4e1d,_0x264be8,_0x230c1a){var _0x495430=[];return db['User']['findAll']({'where':{'role':[_0x7e62('0x54'),_0x7e62('0x55'),_0x7e62('0x56')]},'attributes':['id',_0x7e62('0x57'),_0x7e62('0x2f'),_0x7e62('0x58'),_0x7e62('0x59'),'internal',_0x7e62('0x5a'),_0x7e62('0x5b'),_0x7e62('0x5c'),_0x7e62('0x5d')],'order':qs[_0x7e62('0x40')](_0x7e62('0x5e')),'include':[{'model':db[_0x7e62('0x5f')],'as':_0x7e62('0x60'),'attributes':['id',_0x7e62('0x2f'),_0x7e62('0x35')],'through':{'attributes':[]}}]})[_0x7e62('0x2c')](function(_0x673ab1){if(_0x673ab1){var _0x563a3b=_0x3c4e1d[_0x7e62('0x56')][_0x7e62('0x4f')]({'plain':!![]});if(!_0x563a3b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x563a3b[_0x7e62('0x58')]===_0x7e62('0x56')){return db[_0x7e62('0x61')][_0x7e62('0x4b')]({'where':{'name':_0x7e62('0x62'),'userProfileId':_0x563a3b[_0x7e62('0x63')]},'raw':!![]})[_0x7e62('0x2c')](function(_0x58d8b9){if(_0x58d8b9){if(_0x58d8b9[_0x7e62('0x64')]===0x0){return db[_0x7e62('0x65')]['findAll']({'where':{'sectionId':_0x58d8b9['id']},'raw':!![]})[_0x7e62('0x2c')](function(_0x27f32a){var _0x4fc9b2=[];if(_['isEmpty'](_0x27f32a)){_0x4fc9b2=_[_0x7e62('0x66')](_0x673ab1,function(_0x4c79fb){if(_0x4c79fb[_0x7e62('0x58')]!==_0x7e62('0x54')){return _0x4c79fb;}});return _0x4fc9b2;}else{for(var _0xb3c02f=0x0;_0xb3c02f<_0x673ab1[_0x7e62('0x3d')];_0xb3c02f++){var _0x46ee5f=_0x673ab1[_0xb3c02f];if(_0x46ee5f[_0x7e62('0x58')]===_0x7e62('0x54')){var _0x12b809=_[_0x7e62('0x4b')](_0x27f32a,function(_0x3c4bb8){return _0x3c4bb8[_0x7e62('0x67')]===_0x46ee5f['id'];});if(_0x12b809)_0x4fc9b2[_0x7e62('0x68')](_0x46ee5f);}else{_0x4fc9b2[_0x7e62('0x68')](_0x46ee5f);}}return _0x4fc9b2;}});}else{return _0x673ab1;}}else{var _0x55f7d4=_[_0x7e62('0x66')](_0x673ab1,function(_0xf77527){if(_0xf77527[_0x7e62('0x58')]!==_0x7e62('0x54')){return _0xf77527;}});return _0x55f7d4;}});}else{return _0x673ab1;}}})[_0x7e62('0x2c')](function(_0xa3c591){var _0x4256b0=[];if(_0xa3c591){_0x495430=_0xa3c591;for(var _0x1b410e=0x0;_0x1b410e<_0xa3c591['length'];_0x1b410e+=0x1){_0x495430[_0x1b410e][_0x7e62('0x69')]=[];_0x4256b0['push'](db[_0x7e62('0x32')][_0x7e62('0x4b')]({'where':{'FromId':[_0x3c4e1d['user']['id'],_0xa3c591[_0x1b410e]['id']],'ToId':[_0x3c4e1d[_0x7e62('0x56')]['id'],_0xa3c591[_0x1b410e]['id']],'ChatGroupId':null},'attributes':['id',_0x7e62('0x50'),_0x7e62('0x6a'),'ToId','read',_0x7e62('0x4d')],'order':qs[_0x7e62('0x40')](_0x7e62('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7e62('0x2c')](wrapUser(_0xa3c591[_0x1b410e])));}return BPromise[_0x7e62('0x6c')](_0x4256b0);}return[];})[_0x7e62('0x2c')](function(_0x312984){return{'rows':_0x312984,'count':_0x312984[_0x7e62('0x3d')]};})[_0x7e62('0x2c')](respondWithResult(_0x264be8,null))[_0x7e62('0x48')](handleError(_0x264be8,null));}; \ No newline at end of file +var _0x27be=['find','catch','body','update','params','destroy','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','push','createdAt','FromId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','save','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','length'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x27be,0xff));var _0xe27b=function(_0x9ebaa3,_0x4c6efd){_0x9ebaa3=_0x9ebaa3-0x0;var _0x543241=_0x27be[_0x9ebaa3];return _0x543241;};'use strict';var emlformat=require(_0xe27b('0x0'));var rimraf=require(_0xe27b('0x1'));var zipdir=require(_0xe27b('0x2'));var jsonpatch=require(_0xe27b('0x3'));var rp=require(_0xe27b('0x4'));var moment=require(_0xe27b('0x5'));var BPromise=require(_0xe27b('0x6'));var Mustache=require(_0xe27b('0x7'));var util=require(_0xe27b('0x8'));var path=require(_0xe27b('0x9'));var sox=require(_0xe27b('0xa'));var csv=require('to-csv');var ejs=require(_0xe27b('0xb'));var fs=require('fs');var fs_extra=require(_0xe27b('0xc'));var _=require(_0xe27b('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe27b('0xe'));var deskjs=require(_0xe27b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe27b('0x10'));var Redis=require(_0xe27b('0x11'));var authService=require(_0xe27b('0x12'));var qs=require(_0xe27b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe27b('0x14'))(_0xe27b('0x15'));var utils=require(_0xe27b('0x16'));var config=require(_0xe27b('0x17'));var licenseUtil=require(_0xe27b('0x18'));var db=require(_0xe27b('0x19'))['db'];config['redis']=_[_0xe27b('0x1a')](config[_0xe27b('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xe27b('0x1c'))(new Redis(config['redis']));require(_0xe27b('0x1d'))[_0xe27b('0x1e')](socket);function respondWithStatusCode(_0xebd094,_0x3080bd){_0x3080bd=_0x3080bd||0xcc;return function(_0x3768e2){if(_0x3768e2){return _0xebd094[_0xe27b('0x1f')](_0x3080bd);}return _0xebd094[_0xe27b('0x20')](_0x3080bd)[_0xe27b('0x21')]();};}function respondWithResult(_0x449404,_0x3efbff){_0x3efbff=_0x3efbff||0xc8;return function(_0xdd5bab){if(_0xdd5bab){return _0x449404[_0xe27b('0x20')](_0x3efbff)[_0xe27b('0x22')](_0xdd5bab);}};}function respondWithFilteredResult(_0xe71912,_0x2b489e){return function(_0x416868){if(_0x416868){var _0x5633ad=typeof _0x2b489e['offset']==='undefined'&&typeof _0x2b489e['limit']==='undefined';var _0x561389=_0x416868['count'];var _0x26a047=_0x5633ad?0x0:_0x2b489e[_0xe27b('0x23')];var _0x563af9=_0x5633ad?_0x416868[_0xe27b('0x24')]:_0x2b489e[_0xe27b('0x23')]+_0x2b489e[_0xe27b('0x25')];var _0x8d88af;if(_0x563af9>=_0x561389){_0x563af9=_0x561389;_0x8d88af=0xc8;}else{_0x8d88af=0xce;}_0xe71912[_0xe27b('0x20')](_0x8d88af);return _0xe71912[_0xe27b('0x26')](_0xe27b('0x27'),_0x26a047+'-'+_0x563af9+'/'+_0x561389)[_0xe27b('0x22')](_0x416868);}return null;};}function patchUpdates(_0x3eba81){return function(_0x31c76c){try{jsonpatch['apply'](_0x31c76c,_0x3eba81,!![]);}catch(_0x1b055c){return BPromise['reject'](_0x1b055c);}return _0x31c76c[_0xe27b('0x28')]();};}function saveUpdates(_0x119521,_0xca7e8){return function(_0x451f59){if(_0x451f59){return _0x451f59['update'](_0x119521)[_0xe27b('0x29')](function(_0x302d83){return _0x302d83;});}return null;};}function removeEntity(_0xdc1612,_0x5b8fa2){return function(_0x2a161f){if(_0x2a161f){return _0x2a161f['destroy']()['then'](function(){_0xdc1612[_0xe27b('0x20')](0xcc)[_0xe27b('0x21')]();});}};}function handleEntityNotFound(_0x3b1c5c,_0x1339f3){return function(_0x2133aa){if(!_0x2133aa){_0x3b1c5c['sendStatus'](0x194);}return _0x2133aa;};}function handleError(_0x55c036,_0x5e5cc9){_0x5e5cc9=_0x5e5cc9||0x1f4;return function(_0x3ad5d3){logger[_0xe27b('0x2a')](_0x3ad5d3[_0xe27b('0x2b')]);if(_0x3ad5d3[_0xe27b('0x2c')]){delete _0x3ad5d3['name'];}_0x55c036[_0xe27b('0x20')](_0x5e5cc9)[_0xe27b('0x2d')](_0x3ad5d3);};}exports['index']=function(_0x1a17f9,_0x14967f){var _0x4e9a91={},_0x4955b0={},_0xd50159={'count':0x0,'rows':[]};var _0x1a1afb=_[_0xe27b('0x2e')](db[_0xe27b('0x2f')][_0xe27b('0x30')],function(_0x24a77e){return{'name':_0x24a77e[_0xe27b('0x31')],'type':_0x24a77e['type']['key']};});_0x4955b0[_0xe27b('0x32')]=_[_0xe27b('0x2e')](_0x1a1afb,'name');_0x4955b0[_0xe27b('0x33')]=_[_0xe27b('0x34')](_0x1a17f9[_0xe27b('0x33')]);_0x4955b0[_0xe27b('0x35')]=_[_0xe27b('0x36')](_0x4955b0[_0xe27b('0x32')],_0x4955b0[_0xe27b('0x33')]);_0x4e9a91[_0xe27b('0x37')]=_[_0xe27b('0x36')](_0x4955b0[_0xe27b('0x32')],qs['fields'](_0x1a17f9['query'][_0xe27b('0x38')]));_0x4e9a91[_0xe27b('0x37')]=_0x4e9a91[_0xe27b('0x37')]['length']?_0x4e9a91[_0xe27b('0x37')]:_0x4955b0['model'];if(!_0x1a17f9[_0xe27b('0x33')][_0xe27b('0x39')](_0xe27b('0x3a'))){_0x4e9a91[_0xe27b('0x25')]=qs[_0xe27b('0x25')](_0x1a17f9[_0xe27b('0x33')]['limit']);_0x4e9a91[_0xe27b('0x23')]=qs['offset'](_0x1a17f9['query'][_0xe27b('0x23')]);}_0x4e9a91['order']=qs[_0xe27b('0x3b')](_0x1a17f9['query']['sort']);_0x4e9a91[_0xe27b('0x3c')]=qs[_0xe27b('0x35')](_[_0xe27b('0x3d')](_0x1a17f9[_0xe27b('0x33')],_0x4955b0[_0xe27b('0x35')]),_0x1a1afb);if(_0x1a17f9[_0xe27b('0x33')][_0xe27b('0x3e')]){_0x4e9a91['where']=_[_0xe27b('0x3f')](_0x4e9a91[_0xe27b('0x3c')],{'$or':_[_0xe27b('0x2e')](_0x1a1afb,function(_0x4f7b5d){if(_0x4f7b5d[_0xe27b('0x40')]!=='VIRTUAL'){var _0x1bf6f9={};_0x1bf6f9[_0x4f7b5d[_0xe27b('0x2c')]]={'$like':'%'+_0x1a17f9[_0xe27b('0x33')]['filter']+'%'};return _0x1bf6f9;}})});}_0x4e9a91=_[_0xe27b('0x3f')]({},_0x4e9a91,_0x1a17f9[_0xe27b('0x41')]);var _0x5e2d7e={'where':_0x4e9a91['where']};return db[_0xe27b('0x2f')]['count'](_0x5e2d7e)['then'](function(_0x22f7e9){_0xd50159['count']=_0x22f7e9;if(_0x1a17f9[_0xe27b('0x33')][_0xe27b('0x42')]){_0x4e9a91[_0xe27b('0x43')]=[{'all':!![]}];}return db[_0xe27b('0x2f')][_0xe27b('0x44')](_0x4e9a91);})[_0xe27b('0x29')](function(_0x195f2b){_0xd50159[_0xe27b('0x45')]=_0x195f2b;return _0xd50159;})['then'](respondWithFilteredResult(_0x14967f,_0x4e9a91))['catch'](handleError(_0x14967f,null));};exports[_0xe27b('0x46')]=function(_0x4774a0,_0x174c26){var _0x47b5a2={'raw':!![],'where':{'id':_0x4774a0['params']['id']}},_0x49262c={};_0x49262c[_0xe27b('0x32')]=_[_0xe27b('0x34')](db[_0xe27b('0x2f')][_0xe27b('0x30')]);_0x49262c['query']=_[_0xe27b('0x34')](_0x4774a0[_0xe27b('0x33')]);_0x49262c[_0xe27b('0x35')]=_[_0xe27b('0x36')](_0x49262c['model'],_0x49262c[_0xe27b('0x33')]);_0x47b5a2[_0xe27b('0x37')]=_['intersection'](_0x49262c[_0xe27b('0x32')],qs[_0xe27b('0x38')](_0x4774a0['query'][_0xe27b('0x38')]));_0x47b5a2[_0xe27b('0x37')]=_0x47b5a2[_0xe27b('0x37')][_0xe27b('0x47')]?_0x47b5a2[_0xe27b('0x37')]:_0x49262c[_0xe27b('0x32')];if(_0x4774a0[_0xe27b('0x33')]['includeAll']){_0x47b5a2[_0xe27b('0x43')]=[{'all':!![]}];}_0x47b5a2=_['merge']({},_0x47b5a2,_0x4774a0[_0xe27b('0x41')]);return db[_0xe27b('0x2f')][_0xe27b('0x48')](_0x47b5a2)[_0xe27b('0x29')](handleEntityNotFound(_0x174c26,null))[_0xe27b('0x29')](respondWithResult(_0x174c26,null))[_0xe27b('0x49')](handleError(_0x174c26,null));};exports['create']=function(_0x15bc40,_0x32eb47){return db[_0xe27b('0x2f')]['create'](_0x15bc40[_0xe27b('0x4a')],{})[_0xe27b('0x29')](respondWithResult(_0x32eb47,0xc9))[_0xe27b('0x49')](handleError(_0x32eb47,null));};exports[_0xe27b('0x4b')]=function(_0x42379b,_0x581d04){if(_0x42379b['body']['id']){delete _0x42379b[_0xe27b('0x4a')]['id'];}return db[_0xe27b('0x2f')][_0xe27b('0x48')]({'where':{'id':_0x42379b[_0xe27b('0x4c')]['id']}})[_0xe27b('0x29')](handleEntityNotFound(_0x581d04,null))[_0xe27b('0x29')](saveUpdates(_0x42379b['body'],null))[_0xe27b('0x29')](respondWithResult(_0x581d04,null))['catch'](handleError(_0x581d04,null));};exports[_0xe27b('0x4d')]=function(_0x5213fa,_0x59694e){return db[_0xe27b('0x2f')][_0xe27b('0x48')]({'where':{'id':_0x5213fa[_0xe27b('0x4c')]['id']}})[_0xe27b('0x29')](handleEntityNotFound(_0x59694e,null))[_0xe27b('0x29')](removeEntity(_0x59694e,null))[_0xe27b('0x49')](handleError(_0x59694e,null));};exports[_0xe27b('0x4e')]=function(_0x3cfbc5,_0x3b8071){return db['ChatInternalMessage'][_0xe27b('0x4e')]()[_0xe27b('0x29')](respondWithResult(_0x3b8071,null))[_0xe27b('0x49')](handleError(_0x3b8071,null));};function wrapUser(_0x11ebde){return function(_0x36470f){var _0x5b925d=_0x11ebde['get']({'plain':!![]});_0x5b925d[_0xe27b('0x4f')]=[];if(_0x36470f){_0x5b925d[_0xe27b('0x50')]=_0x36470f['createdAt'];_0x5b925d['lastMessage']=_0x36470f;}else{_0x5b925d[_0xe27b('0x50')]=moment(0x0)[_0xe27b('0x51')](_0xe27b('0x52'));_0x5b925d[_0xe27b('0x53')]={};}return _0x5b925d;};}exports[_0xe27b('0x54')]=function(_0x13dd94,_0x544d78,_0x32edec){var _0xe27fcc=[];return db[_0xe27b('0x55')][_0xe27b('0x44')]({'where':{'role':['agent',_0xe27b('0x56'),_0xe27b('0x57')]},'attributes':['id',_0xe27b('0x58'),_0xe27b('0x2c'),_0xe27b('0x59'),_0xe27b('0x5a'),_0xe27b('0x5b'),_0xe27b('0x5c'),_0xe27b('0x5d'),_0xe27b('0x5e'),_0xe27b('0x5f')],'order':qs[_0xe27b('0x3b')]('-online'),'include':[{'model':db[_0xe27b('0x60')],'as':_0xe27b('0x61'),'attributes':['id',_0xe27b('0x2c'),'type'],'through':{'attributes':[]}}]})[_0xe27b('0x29')](function(_0x279f44){if(_0x279f44){var _0x567ce3=_0x13dd94['user'][_0xe27b('0x62')]({'plain':!![]});if(!_0x567ce3)throw new Error(_0xe27b('0x63'));if(_0x567ce3[_0xe27b('0x59')]===_0xe27b('0x57')){return db[_0xe27b('0x64')][_0xe27b('0x48')]({'where':{'name':_0xe27b('0x65'),'userProfileId':_0x567ce3['userProfileId']},'raw':!![]})[_0xe27b('0x29')](function(_0x550075){if(_0x550075){if(_0x550075[_0xe27b('0x66')]===0x0){return db[_0xe27b('0x67')][_0xe27b('0x44')]({'where':{'sectionId':_0x550075['id']},'raw':!![]})['then'](function(_0x255eef){var _0x3e8075=[];if(_[_0xe27b('0x68')](_0x255eef)){_0x3e8075=_[_0xe27b('0x3e')](_0x279f44,function(_0x2332e1){if(_0x2332e1[_0xe27b('0x59')]!=='agent'){return _0x2332e1;}});return _0x3e8075;}else{for(var _0x2ae6eb=0x0;_0x2ae6eb<_0x279f44[_0xe27b('0x47')];_0x2ae6eb++){var _0x4b8d88=_0x279f44[_0x2ae6eb];if(_0x4b8d88[_0xe27b('0x59')]===_0xe27b('0x69')){var _0x484985=_[_0xe27b('0x48')](_0x255eef,function(_0x22a815){return _0x22a815['resourceId']===_0x4b8d88['id'];});if(_0x484985)_0x3e8075[_0xe27b('0x6a')](_0x4b8d88);}else{_0x3e8075[_0xe27b('0x6a')](_0x4b8d88);}}return _0x3e8075;}});}else{return _0x279f44;}}else{var _0x176a40=_[_0xe27b('0x3e')](_0x279f44,function(_0x5c33d9){if(_0x5c33d9[_0xe27b('0x59')]!=='agent'){return _0x5c33d9;}});return _0x176a40;}});}else{return _0x279f44;}}})[_0xe27b('0x29')](function(_0x1d2a1b){var _0x407f27=[];if(_0x1d2a1b){_0xe27fcc=_0x1d2a1b;for(var _0x488d1f=0x0;_0x488d1f<_0x1d2a1b[_0xe27b('0x47')];_0x488d1f+=0x1){_0xe27fcc[_0x488d1f][_0xe27b('0x4f')]=[];_0x407f27[_0xe27b('0x6a')](db[_0xe27b('0x2f')][_0xe27b('0x48')]({'where':{'FromId':[_0x13dd94[_0xe27b('0x57')]['id'],_0x1d2a1b[_0x488d1f]['id']],'ToId':[_0x13dd94['user']['id'],_0x1d2a1b[_0x488d1f]['id']],'ChatGroupId':null},'attributes':['id',_0xe27b('0x6b'),_0xe27b('0x6c'),'ToId','read',_0xe27b('0x4a')],'order':qs[_0xe27b('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe27b('0x29')](wrapUser(_0x1d2a1b[_0x488d1f])));}return BPromise['all'](_0x407f27);}return[];})[_0xe27b('0x29')](function(_0x39de00){return{'rows':_0x39de00,'count':_0x39de00[_0xe27b('0x47')]};})[_0xe27b('0x29')](respondWithResult(_0x544d78,null))[_0xe27b('0x49')](handleError(_0x544d78,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5c89f13..a8d4fb8 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 _0x0762=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x226a5c,_0x1442ed){var _0x4fb983=function(_0x43730b){while(--_0x43730b){_0x226a5c['push'](_0x226a5c['shift']());}};_0x4fb983(++_0x1442ed);}(_0x0762,0x1e5));var _0x2076=function(_0x34f610,_0x4158fb){_0x34f610=_0x34f610-0x0;var _0x1467ed=_0x0762[_0x34f610];return _0x1467ed;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2076('0x0'))['db'][_0x2076('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2076('0x2')](0x0);var events={'afterCreate':_0x2076('0x3'),'afterUpdate':'update','afterDestroy':_0x2076('0x4')};function emitEvent(_0x2c010c){return function(_0x5c0499,_0x4dc543,_0x734461){ChatInternalMessageEvents[_0x2076('0x5')](_0x2c010c+':'+_0x5c0499['id'],_0x5c0499);ChatInternalMessageEvents[_0x2076('0x5')](_0x2c010c,_0x5c0499);_0x734461(null);};}for(var e in events){if(events[_0x2076('0x6')](e)){var event=events[e];ChatInternalMessage[_0x2076('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xc4b0=['ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4b0,0xfb));var _0x0c4b=function(_0x3f40d5,_0x20822a){_0x3f40d5=_0x3f40d5-0x0;var _0x708c5b=_0xc4b0[_0x3f40d5];return _0x708c5b;};'use strict';var EventEmitter=require(_0x0c4b('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x0c4b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0c4b('0x2')](0x0);var events={'afterCreate':_0x0c4b('0x3'),'afterUpdate':_0x0c4b('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa04c22){return function(_0xc8918e,_0x2d9242,_0x8809a8){ChatInternalMessageEvents[_0x0c4b('0x5')](_0xa04c22+':'+_0xc8918e['id'],_0xc8918e);ChatInternalMessageEvents[_0x0c4b('0x5')](_0xa04c22,_0xc8918e);_0x8809a8(null);};}for(var e in events){if(events[_0x0c4b('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2408052..5c6ff12 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 _0x27ee=['utf8mb4_unicode_ci','lodash','api','moment','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4'];(function(_0x122950,_0x54fa30){var _0x327d22=function(_0xc23a54){while(--_0xc23a54){_0x122950['push'](_0x122950['shift']());}};_0x327d22(++_0x54fa30);}(_0x27ee,0x16c));var _0xe27e=function(_0x11b266,_0x5e66e7){_0x11b266=_0x11b266-0x0;var _0x2b5fc9=_0x27ee[_0x11b266];return _0x2b5fc9;};'use strict';var _=require(_0xe27e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe27e('0x1'));var moment=require(_0xe27e('0x2'));var BPromise=require('bluebird');var rp=require(_0xe27e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe27e('0x4'));var attributes=require(_0xe27e('0x5'));module[_0xe27e('0x6')]=function(_0x46560d,_0x4f7c10){return _0x46560d[_0xe27e('0x7')]('ChatInternalMessage',attributes,{'tableName':_0xe27e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe27e('0x9'),'collate':_0xe27e('0xa')});}; \ No newline at end of file +var _0xd252=['./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd252,0x1a9));var _0x2d25=function(_0x16a326,_0x3d0456){_0x16a326=_0x16a326-0x0;var _0x120392=_0xd252[_0x16a326];return _0x120392;};'use strict';var _=require('lodash');var util=require(_0x2d25('0x0'));var logger=require(_0x2d25('0x1'))(_0x2d25('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2d25('0x3'));var config=require(_0x2d25('0x4'));var attributes=require(_0x2d25('0x5'));module[_0x2d25('0x6')]=function(_0xe21a5,_0x737b66){return _0xe21a5['define'](_0x2d25('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d25('0x8'),'collate':_0x2d25('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a6d166d..ca80962 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 _0xdd19=['localhost','socket.io-emitter','redis','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults'];(function(_0x21c9a4,_0x47d341){var _0x1e9ff4=function(_0x127439){while(--_0x127439){_0x21c9a4['push'](_0x21c9a4['shift']());}};_0x1e9ff4(++_0x47d341);}(_0xdd19,0xc5));var _0x9dd1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdd19[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x9dd1('0x0'));var util=require('util');var moment=require(_0x9dd1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9dd1('0x2'));var fs=require('fs');var Redis=require(_0x9dd1('0x3'));var db=require(_0x9dd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dd1('0x5'))(_0x9dd1('0x6'));var config=require(_0x9dd1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9dd1('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9dd1('0x9')](config['redis'],{'host':_0x9dd1('0xa'),'port':0x18eb});var socket=require(_0x9dd1('0xb'))(new Redis(config[_0x9dd1('0xc')]));require(_0x9dd1('0xd'))['register'](socket);function respondWithRpcPromise(_0x2aec29,_0x58c770,_0x41d928){return new BPromise(function(_0x2fa0b4,_0x533afc){return client['request'](_0x2aec29,_0x41d928)[_0x9dd1('0xe')](function(_0x285ebd){logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x58c770,'request\x20sent');logger['debug'](_0x9dd1('0x11'),_0x58c770,_0x9dd1('0x12'),JSON[_0x9dd1('0x13')](_0x285ebd));if(_0x285ebd[_0x9dd1('0x14')]){if(_0x285ebd[_0x9dd1('0x14')]['code']===0x1f4){logger[_0x9dd1('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x58c770,_0x285ebd[_0x9dd1('0x14')]['message']);return _0x533afc(_0x285ebd[_0x9dd1('0x14')][_0x9dd1('0x15')]);}logger[_0x9dd1('0x14')](_0x9dd1('0x10'),_0x58c770,_0x285ebd[_0x9dd1('0x14')][_0x9dd1('0x15')]);return _0x2fa0b4(_0x285ebd['error']['message']);}else{logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x58c770,_0x9dd1('0x12'));_0x2fa0b4(_0x285ebd['result'][_0x9dd1('0x15')]);}})[_0x9dd1('0x16')](function(_0x3892d3){logger[_0x9dd1('0x14')](_0x9dd1('0x10'),_0x58c770,_0x3892d3);_0x533afc(_0x3892d3);});});} \ No newline at end of file +var _0xa162=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring'];(function(_0x44594e,_0x39a21d){var _0x24df0c=function(_0x581c3b){while(--_0x581c3b){_0x44594e['push'](_0x44594e['shift']());}};_0x24df0c(++_0x39a21d);}(_0xa162,0x169));var _0x2a16=function(_0x5e30f1,_0x366d84){_0x5e30f1=_0x5e30f1-0x0;var _0x8ce52e=_0xa162[_0x5e30f1];return _0x8ce52e;};'use strict';var _=require(_0x2a16('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2a16('0x1'));var rs=require(_0x2a16('0x2'));var fs=require('fs');var Redis=require(_0x2a16('0x3'));var db=require(_0x2a16('0x4'))['db'];var utils=require(_0x2a16('0x5'));var logger=require(_0x2a16('0x6'))(_0x2a16('0x7'));var config=require(_0x2a16('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2a16('0x9')][_0x2a16('0xa')]({'port':0x232a});config[_0x2a16('0xb')]=_[_0x2a16('0xc')](config[_0x2a16('0xb')],{'host':_0x2a16('0xd'),'port':0x18eb});var socket=require(_0x2a16('0xe'))(new Redis(config[_0x2a16('0xb')]));require(_0x2a16('0xf'))['register'](socket);function respondWithRpcPromise(_0x27764f,_0x19a518,_0x2f8381){return new BPromise(function(_0x42e2c0,_0x36634f){return client[_0x2a16('0x10')](_0x27764f,_0x2f8381)[_0x2a16('0x11')](function(_0x4547ea){logger[_0x2a16('0x12')](_0x2a16('0x13'),_0x19a518,'request\x20sent');logger[_0x2a16('0x14')](_0x2a16('0x15'),_0x19a518,_0x2a16('0x16'),JSON[_0x2a16('0x17')](_0x4547ea));if(_0x4547ea[_0x2a16('0x18')]){if(_0x4547ea['error']['code']===0x1f4){logger[_0x2a16('0x18')](_0x2a16('0x13'),_0x19a518,_0x4547ea[_0x2a16('0x18')][_0x2a16('0x19')]);return _0x36634f(_0x4547ea[_0x2a16('0x18')][_0x2a16('0x19')]);}logger['error'](_0x2a16('0x13'),_0x19a518,_0x4547ea['error']['message']);return _0x42e2c0(_0x4547ea[_0x2a16('0x18')][_0x2a16('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x19a518,'request\x20sent');_0x42e2c0(_0x4547ea[_0x2a16('0x1a')][_0x2a16('0x19')]);}})[_0x2a16('0x1b')](function(_0x5a8c21){logger[_0x2a16('0x18')](_0x2a16('0x13'),_0x19a518,_0x5a8c21);_0x36634f(_0x5a8c21);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4c4bced..0a1f73c 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 _0x9709=['register','length','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x50dbe8,_0x4f1278){var _0x246ef7=function(_0x5b29ed){while(--_0x5b29ed){_0x50dbe8['push'](_0x50dbe8['shift']());}};_0x246ef7(++_0x4f1278);}(_0x9709,0x162));var _0x9970=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x9709[_0x58999b];return _0x5efc3a;};'use strict';var ChatInternalMessageEvents=require(_0x9970('0x0'));var events=[_0x9970('0x1'),_0x9970('0x2'),_0x9970('0x3')];function createListener(_0x5e4457,_0x202389){return function(_0xc57dd){_0x202389[_0x9970('0x4')](_0x5e4457,_0xc57dd);};}function removeListener(_0x55f2b7,_0x575323){return function(){ChatInternalMessageEvents[_0x9970('0x5')](_0x55f2b7,_0x575323);};}exports[_0x9970('0x6')]=function(_0x212875){for(var _0x9d091c=0x0,_0x19463e=events[_0x9970('0x7')];_0x9d091c<_0x19463e;_0x9d091c++){var _0x3c3264=events[_0x9d091c];var _0x51135c=createListener('chatInternalMessage:'+_0x3c3264,_0x212875);ChatInternalMessageEvents['on'](_0x3c3264,_0x51135c);}}; \ No newline at end of file +var _0x7dd4=['register','update','emit','removeListener'];(function(_0x2967fe,_0x435939){var _0xf29500=function(_0x5a5901){while(--_0x5a5901){_0x2967fe['push'](_0x2967fe['shift']());}};_0xf29500(++_0x435939);}(_0x7dd4,0x141));var _0x47dd=function(_0x73c6aa,_0x339a3a){_0x73c6aa=_0x73c6aa-0x0;var _0x14e37f=_0x7dd4[_0x73c6aa];return _0x14e37f;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x47dd('0x0')];function createListener(_0x4d177d,_0x51363b){return function(_0x21bee5){_0x51363b[_0x47dd('0x1')](_0x4d177d,_0x21bee5);};}function removeListener(_0x4cd906,_0x5f5b98){return function(){ChatInternalMessageEvents[_0x47dd('0x2')](_0x4cd906,_0x5f5b98);};}exports[_0x47dd('0x3')]=function(_0x51b8ee){for(var _0x20ef6d=0x0,_0x15b729=events['length'];_0x20ef6d<_0x15b729;_0x20ef6d++){var _0x4e55ec=events[_0x20ef6d];var _0x447ef1=createListener('chatInternalMessage:'+_0x4e55ec,_0x51b8ee);ChatInternalMessageEvents['on'](_0x4e55ec,_0x447ef1);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 0b7e789..c800531 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 _0xd364=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xd364,0x8a));var _0x4d36=function(_0x948029,_0x3f9834){_0x948029=_0x948029-0x0;var _0x50da11=_0xd364[_0x948029];return _0x50da11;};'use strict';var multer=require(_0x4d36('0x0'));var util=require('util');var path=require(_0x4d36('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d36('0x2'));var router=express[_0x4d36('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4d36('0x4'));var interaction=require(_0x4d36('0x5'));var config=require('../../config/environment');var controller=require(_0x4d36('0x6'));router[_0x4d36('0x7')]('/',auth[_0x4d36('0x8')](),controller[_0x4d36('0x9')]);router[_0x4d36('0x7')](_0x4d36('0xa'),auth[_0x4d36('0x8')](),controller[_0x4d36('0xb')]);router[_0x4d36('0x7')]('/users',auth[_0x4d36('0x8')](),controller['getUsers']);router[_0x4d36('0x7')](_0x4d36('0xc'),auth['isAuthenticated'](),controller[_0x4d36('0xd')]);router[_0x4d36('0xe')]('/',auth[_0x4d36('0x8')](),controller['create']);router['put'](_0x4d36('0xc'),controller[_0x4d36('0xf')]);router[_0x4d36('0x10')](_0x4d36('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d36('0x11')]=router; \ No newline at end of file +var _0x581b=['getUsers','/:id','post','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','/users'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x581b,0x156));var _0xb581=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x581b[_0x30faec];return _0x29484f;};'use strict';var multer=require(_0xb581('0x0'));var util=require(_0xb581('0x1'));var path=require(_0xb581('0x2'));var timeout=require('connect-timeout');var express=require(_0xb581('0x3'));var router=express[_0xb581('0x4')]();var fs_extra=require(_0xb581('0x5'));var auth=require(_0xb581('0x6'));var interaction=require(_0xb581('0x7'));var config=require(_0xb581('0x8'));var controller=require(_0xb581('0x9'));router['get']('/',auth[_0xb581('0xa')](),controller[_0xb581('0xb')]);router[_0xb581('0xc')](_0xb581('0xd'),auth[_0xb581('0xa')](),controller['describe']);router[_0xb581('0xc')](_0xb581('0xe'),auth[_0xb581('0xa')](),controller[_0xb581('0xf')]);router[_0xb581('0xc')](_0xb581('0x10'),auth[_0xb581('0xa')](),controller['show']);router[_0xb581('0x11')]('/',auth[_0xb581('0xa')](),controller['create']);router[_0xb581('0x12')](_0xb581('0x10'),controller['update']);router['delete'](_0xb581('0x10'),auth[_0xb581('0xa')](),controller[_0xb581('0x13')]);module[_0xb581('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index dc9d4a4..3faff50 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 _0x7633=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x46362e,_0x515f96){var _0x3480d0=function(_0x4f9502){while(--_0x4f9502){_0x46362e['push'](_0x46362e['shift']());}};_0x3480d0(++_0x515f96);}(_0x7633,0x1c4));var _0x3763=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7633[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x3763('0x0'));module[_0x3763('0x1')]={'body':{'type':Sequelize[_0x3763('0x2')](_0x3763('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3763('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3763('0x5')]('in',_0x3763('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3763('0x7')]},'providerName':{'type':Sequelize[_0x3763('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeffd=['out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0xeffd,0x6b));var _0xdeff=function(_0x47268e,_0x188a69){_0x47268e=_0x47268e-0x0;var _0x28c7a8=_0xeffd[_0x47268e];return _0x28c7a8;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'body':{'type':Sequelize[_0xdeff('0x1')](_0xdeff('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdeff('0x4')]('in',_0xdeff('0x5')),'defaultValue':_0xdeff('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdeff('0x6')]},'providerName':{'type':Sequelize[_0xdeff('0x7')]},'providerResponse':{'type':Sequelize[_0xdeff('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7005ec2..66b4b03 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 _0x9390=['ChatMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','rawAttributes','include','find','create','body','params','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','rejectmessage','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','limit','count','offset','set','Content-Range','json','reject','update','destroy','stack','name','map'];(function(_0x193a6e,_0x1114da){var _0x3f7753=function(_0x3db439){while(--_0x3db439){_0x193a6e['push'](_0x193a6e['shift']());}};_0x3f7753(++_0x1114da);}(_0x9390,0xc7));var _0x0939=function(_0x37e2ff,_0xf98e44){_0x37e2ff=_0x37e2ff-0x0;var _0x47f4a1=_0x9390[_0x37e2ff];return _0x47f4a1;};'use strict';var emlformat=require(_0x0939('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0939('0x1'));var jsonpatch=require(_0x0939('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0939('0x3'));var Mustache=require('mustache');var util=require(_0x0939('0x4'));var path=require(_0x0939('0x5'));var sox=require(_0x0939('0x6'));var csv=require('to-csv');var ejs=require(_0x0939('0x7'));var fs=require('fs');var fs_extra=require(_0x0939('0x8'));var _=require(_0x0939('0x9'));var squel=require(_0x0939('0xa'));var crypto=require(_0x0939('0xb'));var jsforce=require(_0x0939('0xc'));var deskjs=require(_0x0939('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0939('0xe'));var Papa=require('papaparse');var Redis=require(_0x0939('0xf'));var authService=require(_0x0939('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0939('0x11'));var hardwareService=require(_0x0939('0x12'));var logger=require('../../config/logger')(_0x0939('0x13'));var utils=require(_0x0939('0x14'));var config=require(_0x0939('0x15'));var licenseUtil=require(_0x0939('0x16'));var db=require('../../mysqldb')['db'];config[_0x0939('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x0939('0x18'));var client=jayson[_0x0939('0x19')][_0x0939('0x1a')]({'port':0x232c});var client9002=jayson[_0x0939('0x19')][_0x0939('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3f4b43,_0xd2ca36,_0x403547,_0x8bb127){return new BPromise(function(_0x59fd99,_0x5a2320){var _0x4655e9=_0x8bb127||client;return _0x4655e9[_0x0939('0x1b')](_0x3f4b43,_0x403547)[_0x0939('0x1c')](function(_0x2ad33b){logger[_0x0939('0x1d')](_0x0939('0x1e'),_0xd2ca36,_0x0939('0x1f'));logger[_0x0939('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd2ca36,_0x0939('0x1f'),JSON[_0x0939('0x21')](_0x2ad33b));if(_0x2ad33b['error']){if(_0x2ad33b['error']['code']===0x1f4){logger['error'](_0x0939('0x1e'),_0xd2ca36,_0x2ad33b[_0x0939('0x22')]['message']);return _0x5a2320(_0x2ad33b[_0x0939('0x22')][_0x0939('0x23')]);}logger[_0x0939('0x22')](_0x0939('0x1e'),_0xd2ca36,_0x2ad33b[_0x0939('0x22')]['message']);return _0x59fd99(_0x2ad33b[_0x0939('0x22')][_0x0939('0x23')]);}else{logger[_0x0939('0x1d')](_0x0939('0x1e'),_0xd2ca36,_0x0939('0x1f'));_0x59fd99(_0x2ad33b[_0x0939('0x24')][_0x0939('0x23')]);}})[_0x0939('0x25')](function(_0x520376){logger[_0x0939('0x22')](_0x0939('0x1e'),_0xd2ca36,_0x520376);_0x5a2320(_0x520376);});});}function respondWithStatusCode(_0x16c2a9,_0x23e5ee){_0x23e5ee=_0x23e5ee||0xcc;return function(_0x4dbc18){if(_0x4dbc18){return _0x16c2a9[_0x0939('0x26')](_0x23e5ee);}return _0x16c2a9[_0x0939('0x27')](_0x23e5ee)[_0x0939('0x28')]();};}function respondWithResult(_0x1a7be8,_0x34d04c){_0x34d04c=_0x34d04c||0xc8;return function(_0x36e75a){if(_0x36e75a){return _0x1a7be8[_0x0939('0x27')](_0x34d04c)['json'](_0x36e75a);}};}function respondWithFilteredResult(_0x136dad,_0x3cf5a7){return function(_0x5c2a34){if(_0x5c2a34){var _0x35fb40=typeof _0x3cf5a7['offset']==='undefined'&&typeof _0x3cf5a7[_0x0939('0x29')]==='undefined';var _0x108c0c=_0x5c2a34[_0x0939('0x2a')];var _0xb3ee9e=_0x35fb40?0x0:_0x3cf5a7[_0x0939('0x2b')];var _0x16eb26=_0x35fb40?_0x5c2a34[_0x0939('0x2a')]:_0x3cf5a7['offset']+_0x3cf5a7[_0x0939('0x29')];var _0x5acfb0;if(_0x16eb26>=_0x108c0c){_0x16eb26=_0x108c0c;_0x5acfb0=0xc8;}else{_0x5acfb0=0xce;}_0x136dad[_0x0939('0x27')](_0x5acfb0);return _0x136dad[_0x0939('0x2c')](_0x0939('0x2d'),_0xb3ee9e+'-'+_0x16eb26+'/'+_0x108c0c)[_0x0939('0x2e')](_0x5c2a34);}return null;};}function patchUpdates(_0x3641b6){return function(_0x6ac200){try{jsonpatch['apply'](_0x6ac200,_0x3641b6,!![]);}catch(_0x39c5c9){return BPromise[_0x0939('0x2f')](_0x39c5c9);}return _0x6ac200['save']();};}function saveUpdates(_0x3c4b1e,_0x3b708f){return function(_0x10fe36){if(_0x10fe36){return _0x10fe36[_0x0939('0x30')](_0x3c4b1e)[_0x0939('0x1c')](function(_0xbb452c){return _0xbb452c;});}return null;};}function removeEntity(_0x14e65a,_0x32593f){return function(_0x4c402a){if(_0x4c402a){return _0x4c402a[_0x0939('0x31')]()[_0x0939('0x1c')](function(){_0x14e65a[_0x0939('0x27')](0xcc)[_0x0939('0x28')]();});}};}function handleEntityNotFound(_0x4e7cd7,_0x4a4604){return function(_0x246e87){if(!_0x246e87){_0x4e7cd7[_0x0939('0x26')](0x194);}return _0x246e87;};}function handleError(_0xa3b196,_0x53faec){_0x53faec=_0x53faec||0x1f4;return function(_0x2576a4){logger[_0x0939('0x22')](_0x2576a4[_0x0939('0x32')]);if(_0x2576a4[_0x0939('0x33')]){delete _0x2576a4['name'];}_0xa3b196['status'](_0x53faec)['send'](_0x2576a4);};}exports['index']=function(_0x13a4b8,_0x1a593b){var _0x39f3cb={},_0x3257b5={},_0x30f878={'count':0x0,'rows':[]};var _0xb164ae=_[_0x0939('0x34')](db[_0x0939('0x35')]['rawAttributes'],function(_0x3671c0){return{'name':_0x3671c0['fieldName'],'type':_0x3671c0[_0x0939('0x36')][_0x0939('0x37')]};});_0x3257b5[_0x0939('0x38')]=_[_0x0939('0x34')](_0xb164ae,_0x0939('0x33'));_0x3257b5[_0x0939('0x39')]=_[_0x0939('0x3a')](_0x13a4b8[_0x0939('0x39')]);_0x3257b5[_0x0939('0x3b')]=_[_0x0939('0x3c')](_0x3257b5[_0x0939('0x38')],_0x3257b5[_0x0939('0x39')]);_0x39f3cb[_0x0939('0x3d')]=_[_0x0939('0x3c')](_0x3257b5['model'],qs['fields'](_0x13a4b8[_0x0939('0x39')][_0x0939('0x3e')]));_0x39f3cb[_0x0939('0x3d')]=_0x39f3cb[_0x0939('0x3d')][_0x0939('0x3f')]?_0x39f3cb[_0x0939('0x3d')]:_0x3257b5[_0x0939('0x38')];if(!_0x13a4b8[_0x0939('0x39')]['hasOwnProperty'](_0x0939('0x40'))){_0x39f3cb[_0x0939('0x29')]=qs[_0x0939('0x29')](_0x13a4b8[_0x0939('0x39')]['limit']);_0x39f3cb[_0x0939('0x2b')]=qs[_0x0939('0x2b')](_0x13a4b8[_0x0939('0x39')][_0x0939('0x2b')]);}_0x39f3cb['order']=qs['sort'](_0x13a4b8[_0x0939('0x39')][_0x0939('0x41')]);_0x39f3cb[_0x0939('0x42')]=qs[_0x0939('0x3b')](_[_0x0939('0x43')](_0x13a4b8[_0x0939('0x39')],_0x3257b5[_0x0939('0x3b')]),_0xb164ae);if(_0x13a4b8[_0x0939('0x39')][_0x0939('0x44')]){_0x39f3cb[_0x0939('0x42')]=_[_0x0939('0x45')](_0x39f3cb[_0x0939('0x42')],{'$or':_[_0x0939('0x34')](_0xb164ae,function(_0x303856){if(_0x303856[_0x0939('0x36')]!==_0x0939('0x46')){var _0xfac7df={};_0xfac7df[_0x303856[_0x0939('0x33')]]={'$like':'%'+_0x13a4b8[_0x0939('0x39')][_0x0939('0x44')]+'%'};return _0xfac7df;}})});}_0x39f3cb=_[_0x0939('0x45')]({},_0x39f3cb,_0x13a4b8['options']);var _0x2d4b62={'where':_0x39f3cb[_0x0939('0x42')]};return db[_0x0939('0x35')][_0x0939('0x2a')](_0x2d4b62)['then'](function(_0x3cfe95){_0x30f878[_0x0939('0x2a')]=_0x3cfe95;if(_0x13a4b8[_0x0939('0x39')]['includeAll']){_0x39f3cb['include']=[{'all':!![]}];}return db[_0x0939('0x35')][_0x0939('0x47')](_0x39f3cb);})[_0x0939('0x1c')](function(_0x313385){_0x30f878[_0x0939('0x48')]=_0x313385;return _0x30f878;})['then'](respondWithFilteredResult(_0x1a593b,_0x39f3cb))['catch'](handleError(_0x1a593b,null));};exports[_0x0939('0x49')]=function(_0x5b80ce,_0x53e226){var _0x426c17={'raw':!![],'where':{'id':_0x5b80ce['params']['id']}},_0x304de7={};_0x304de7['model']=_[_0x0939('0x3a')](db[_0x0939('0x35')][_0x0939('0x4a')]);_0x304de7[_0x0939('0x39')]=_[_0x0939('0x3a')](_0x5b80ce[_0x0939('0x39')]);_0x304de7[_0x0939('0x3b')]=_[_0x0939('0x3c')](_0x304de7[_0x0939('0x38')],_0x304de7['query']);_0x426c17[_0x0939('0x3d')]=_[_0x0939('0x3c')](_0x304de7[_0x0939('0x38')],qs[_0x0939('0x3e')](_0x5b80ce[_0x0939('0x39')][_0x0939('0x3e')]));_0x426c17[_0x0939('0x3d')]=_0x426c17[_0x0939('0x3d')][_0x0939('0x3f')]?_0x426c17['attributes']:_0x304de7[_0x0939('0x38')];if(_0x5b80ce['query']['includeAll']){_0x426c17[_0x0939('0x4b')]=[{'all':!![]}];}_0x426c17=_[_0x0939('0x45')]({},_0x426c17,_0x5b80ce['options']);return db[_0x0939('0x35')][_0x0939('0x4c')](_0x426c17)[_0x0939('0x1c')](handleEntityNotFound(_0x53e226,null))[_0x0939('0x1c')](respondWithResult(_0x53e226,null))['catch'](handleError(_0x53e226,null));};exports['create']=function(_0xc039dd,_0x20d67e){return db['ChatMessage'][_0x0939('0x4d')](_0xc039dd[_0x0939('0x4e')],{})[_0x0939('0x1c')](respondWithResult(_0x20d67e,0xc9))['catch'](handleError(_0x20d67e,null));};exports[_0x0939('0x30')]=function(_0xbf9860,_0x579c46){if(_0xbf9860[_0x0939('0x4e')]['id']){delete _0xbf9860[_0x0939('0x4e')]['id'];}return db[_0x0939('0x35')][_0x0939('0x4c')]({'where':{'id':_0xbf9860[_0x0939('0x4f')]['id']}})['then'](handleEntityNotFound(_0x579c46,null))['then'](saveUpdates(_0xbf9860[_0x0939('0x4e')],null))['then'](respondWithResult(_0x579c46,null))[_0x0939('0x25')](handleError(_0x579c46,null));};exports[_0x0939('0x31')]=function(_0x4e8684,_0x55a2f2){return db['ChatMessage']['find']({'where':{'id':_0x4e8684[_0x0939('0x4f')]['id']}})['then'](handleEntityNotFound(_0x55a2f2,null))[_0x0939('0x1c')](removeEntity(_0x55a2f2,null))[_0x0939('0x25')](handleError(_0x55a2f2,null));};exports[_0x0939('0x50')]=function(_0x5b3e88,_0x470b1c){return db[_0x0939('0x35')][_0x0939('0x50')]()[_0x0939('0x1c')](respondWithResult(_0x470b1c,null))[_0x0939('0x25')](handleError(_0x470b1c,null));};var interaction_log=require(_0x0939('0x51'))(_0x0939('0x52'));exports[_0x0939('0x53')]=function(_0x403d97,_0x498df4,_0x3597cb){var _0x3a4250={'agent':{},'channel':_0x0939('0x54')};if(_0x403d97[_0x0939('0x4e')]['id']){delete _0x403d97[_0x0939('0x4e')]['id'];}_0x403d97[_0x0939('0x4e')][_0x0939('0x55')]=!![];_0x403d97[_0x0939('0x4e')]['readAt']=moment()[_0x0939('0x56')](_0x0939('0x57'));_0x403d97[_0x0939('0x4e')][_0x0939('0x58')]=_0x403d97[_0x0939('0x4e')][_0x0939('0x58')]||_0x403d97[_0x0939('0x59')]['id'];_0x3a4250[_0x0939('0x5a')]['id']=_0x403d97[_0x0939('0x4e')]['UserId'];return db[_0x0939('0x35')][_0x0939('0x4c')]({'where':{'id':_0x403d97[_0x0939('0x4f')]['id'],'UserId':null}})[_0x0939('0x1c')](handleEntityNotFound(_0x498df4,null))[_0x0939('0x1c')](saveUpdates(_0x403d97[_0x0939('0x4e')],null))[_0x0939('0x1c')](function(_0x20b9ec){if(_0x20b9ec){_0x3a4250[_0x0939('0x23')]=_0x20b9ec[_0x0939('0x5b')]({'plain':!![]});return db[_0x0939('0x5c')]['find']({'where':{'id':_0x20b9ec[_0x0939('0x5d')]}});}return null;})[_0x0939('0x1c')](handleEntityNotFound(_0x498df4,null))[_0x0939('0x1c')](function(_0xb44c61){if(_0xb44c61){return _0xb44c61[_0x0939('0x30')]({'UserId':_0x403d97[_0x0939('0x4e')][_0x0939('0x58')],'read1stAt':_[_0x0939('0x5e')](_0xb44c61[_0x0939('0x5f')])?moment()[_0x0939('0x56')](_0x0939('0x57')):undefined});}return null;})[_0x0939('0x1c')](function(_0x193f61){if(_0x193f61){_0x3a4250[_0x0939('0x60')]=_0x193f61['get']({'plain':!![]});interaction_log[_0x0939('0x1d')](_0x0939('0x61'),_0x403d97['user']['id'],_0x403d97['user'][_0x0939('0x33')],_0x403d97['user']['role'],_0x3a4250[_0x0939('0x60')]['id'],_0x403d97[_0x0939('0x4e')]?JSON[_0x0939('0x21')](_0x403d97['body']):_0x0939('0x62'));return respondWithRpcPromise('AcceptMessage',_0x0939('0x63'),_0x3a4250);}return null;})[_0x0939('0x1c')](function(_0x10e379){var _0x2055b4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x10e379[_0x0939('0x23')][_0x0939('0x64')];return db['sequelize']['query'](_0x2055b4,{'type':db['Sequelize'][_0x0939('0x65')][_0x0939('0x66')],'raw':!![]})[_0x0939('0x1c')](function(_0x124bfe){return _0x124bfe;});})[_0x0939('0x1c')](function(_0x4fbb80){if(_0x4fbb80){_0x3a4250[_0x0939('0x23')][_0x0939('0x67')]=_0x4fbb80[0x0];if(!_0x403d97[_0x0939('0x4e')][_0x0939('0x58')])return;return db[_0x0939('0x68')][_0x0939('0x4c')]({'where':{'id':_0x403d97[_0x0939('0x4e')][_0x0939('0x58')],'role':_0x0939('0x5a')},'attributes':['id',_0x0939('0x33'),_0x0939('0x69'),_0x0939('0x6a'),_0x0939('0x6b')],'raw':!![]});}return null;})['then'](function(_0x8e73c3){if(!_0x8e73c3)return null;_0x3a4250[_0x0939('0x23')][_0x0939('0x5a')]=_0x8e73c3;return _0x3a4250;})[_0x0939('0x1c')](function(_0x38131d){if(_0x38131d){if(_0x403d97['body'][_0x0939('0x6c')]){_0x3a4250['message'][_0x0939('0x6d')]=util['format'](_0x0939('0x6e'),_0x403d97[_0x0939('0x59')][_0x0939('0x33')]);_0x3a4250['message'][_0x0939('0x6f')]=_0x3a4250[_0x0939('0x6f')];_0x3a4250[_0x0939('0x23')][_0x0939('0x70')]=_0x3a4250[_0x0939('0x6f')];_0x3a4250[_0x0939('0x23')][_0x0939('0x71')]='accept';return respondWithRpcPromise(_0x0939('0x72'),_0x0939('0x72'),{'event':_0x0939('0x73'),'message':_['merge'](_0x3a4250[_0x0939('0x23')],JSON[_0x0939('0x74')](_0x3a4250['interaction'][_0x0939('0x75')]))},client9002)['then'](function(){return _0x3a4250;});}return _0x3a4250;}return null;})['then'](respondWithResult(_0x498df4,null))['catch'](handleError(_0x498df4,null));};var interaction_log=require(_0x0939('0x51'))('chat-interactions');exports[_0x0939('0x2f')]=function(_0x4d6ca2,_0x162d4f,_0x452157){var _0x254ed8={'agent':{},'channel':'chat'};if(_0x4d6ca2[_0x0939('0x4e')]['id']){delete _0x4d6ca2[_0x0939('0x4e')]['id'];}_0x4d6ca2[_0x0939('0x4e')]['UserId']=_0x4d6ca2[_0x0939('0x4e')][_0x0939('0x58')]||_0x4d6ca2[_0x0939('0x59')]['id'];_0x254ed8[_0x0939('0x5a')]['id']=_0x4d6ca2[_0x0939('0x4e')][_0x0939('0x58')];return db['ChatMessage'][_0x0939('0x4c')]({'where':{'id':_0x4d6ca2['params']['id'],'UserId':null}})[_0x0939('0x1c')](handleEntityNotFound(_0x162d4f,null))[_0x0939('0x1c')](function(_0x2b2d36){if(_0x2b2d36){_0x254ed8[_0x0939('0x23')]=_0x2b2d36[_0x0939('0x5b')]({'plain':!![]});return db[_0x0939('0x5c')][_0x0939('0x4c')]({'where':{'id':_0x2b2d36[_0x0939('0x5d')]}});}return null;})[_0x0939('0x1c')](handleEntityNotFound(_0x162d4f,null))['then'](function(_0x5d8b6){if(_0x5d8b6){_0x254ed8[_0x0939('0x60')]=_0x5d8b6[_0x0939('0x5b')]({'plain':!![]});interaction_log[_0x0939('0x1d')](_0x0939('0x76'),_0x4d6ca2[_0x0939('0x59')]['id'],_0x4d6ca2[_0x0939('0x59')][_0x0939('0x33')],_0x4d6ca2[_0x0939('0x59')][_0x0939('0x77')],_0x254ed8[_0x0939('0x60')]['id'],_0x4d6ca2[_0x0939('0x4e')]?JSON[_0x0939('0x21')](_0x4d6ca2[_0x0939('0x4e')]):_0x0939('0x62'));return respondWithRpcPromise(_0x0939('0x78'),_0x0939('0x79'),_0x254ed8);}return null;})[_0x0939('0x1c')](function(_0x41be78){var _0x3e1cf2=_0x0939('0x7a')+_0x41be78[_0x0939('0x23')][_0x0939('0x64')];return db[_0x0939('0x7b')]['query'](_0x3e1cf2,{'type':db[_0x0939('0x7c')]['QueryTypes'][_0x0939('0x66')],'raw':!![]})[_0x0939('0x1c')](function(_0x6456aa){return _0x6456aa;});})[_0x0939('0x1c')](function(_0x5b89c5){if(_0x5b89c5){_0x254ed8['message'][_0x0939('0x67')]=_0x5b89c5[0x0];if(!_0x4d6ca2['body'][_0x0939('0x58')])return;return db['User'][_0x0939('0x4c')]({'where':{'id':_0x4d6ca2[_0x0939('0x4e')]['UserId'],'role':'agent'},'attributes':['id',_0x0939('0x33'),_0x0939('0x69'),_0x0939('0x6a'),_0x0939('0x6b')],'raw':!![]});}return null;})['then'](function(_0x16b680){if(!_0x16b680)return null;_0x254ed8[_0x0939('0x23')]['agent']=_0x16b680;return _0x254ed8;})[_0x0939('0x1c')](function(_0x844453){if(_0x844453){_0x844453[_0x0939('0x23')]['interface']=util[_0x0939('0x56')]('SIP/%s',_0x4d6ca2[_0x0939('0x59')][_0x0939('0x33')]);_0x844453[_0x0939('0x23')][_0x0939('0x6f')]=_0x254ed8['channel'];_0x844453[_0x0939('0x23')]['motionChannel']=_0x254ed8[_0x0939('0x6f')];_0x844453[_0x0939('0x23')]['event']=_0x0939('0x2f');respondWithRpcPromise('EventManager',_0x0939('0x72'),{'event':_0x0939('0x7d'),'message':_[_0x0939('0x45')](_0x254ed8['message'],JSON['parse'](_0x254ed8['interaction'][_0x0939('0x75')]))},client9002);return _0x254ed8;}return null;})['then'](respondWithResult(_0x162d4f,null))[_0x0939('0x25')](handleError(_0x162d4f,null));}; \ No newline at end of file +var _0x6df2=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','QueryTypes','SELECT','User','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','fullname','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','find','create','body','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','ChatInteractionId','interaction'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6df2,0x126));var _0x26df=function(_0x30491b,_0x5e435a){_0x30491b=_0x30491b-0x0;var _0x3fbc40=_0x6df2[_0x30491b];return _0x3fbc40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26df('0x0'));var zipdir=require(_0x26df('0x1'));var jsonpatch=require(_0x26df('0x2'));var rp=require('request-promise');var moment=require(_0x26df('0x3'));var BPromise=require(_0x26df('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26df('0x5'));var sox=require(_0x26df('0x6'));var csv=require(_0x26df('0x7'));var ejs=require(_0x26df('0x8'));var fs=require('fs');var fs_extra=require(_0x26df('0x9'));var _=require(_0x26df('0xa'));var squel=require(_0x26df('0xb'));var crypto=require('crypto');var jsforce=require(_0x26df('0xc'));var deskjs=require(_0x26df('0xd'));var toCsv=require(_0x26df('0x7'));var querystring=require('querystring');var Papa=require(_0x26df('0xe'));var Redis=require(_0x26df('0xf'));var authService=require(_0x26df('0x10'));var qs=require(_0x26df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26df('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x26df('0x13'));var config=require(_0x26df('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x26df('0x15'))['db'];config[_0x26df('0x16')]=_['defaults'](config[_0x26df('0x16')],{'host':_0x26df('0x17'),'port':0x18eb});var socket=require(_0x26df('0x18'))(new Redis(config[_0x26df('0x16')]));require(_0x26df('0x19'))['register'](socket);var jayson=require(_0x26df('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x26df('0x1b')][_0x26df('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x71ed4d,_0x13313f,_0x44a4bf,_0x411d0c){return new BPromise(function(_0x2b8e4a,_0x20acd7){var _0x2ae68d=_0x411d0c||client;return _0x2ae68d[_0x26df('0x1d')](_0x71ed4d,_0x44a4bf)['then'](function(_0x576a28){logger[_0x26df('0x1e')](_0x26df('0x1f'),_0x13313f,_0x26df('0x20'));logger[_0x26df('0x21')](_0x26df('0x22'),_0x13313f,_0x26df('0x20'),JSON[_0x26df('0x23')](_0x576a28));if(_0x576a28[_0x26df('0x24')]){if(_0x576a28['error']['code']===0x1f4){logger[_0x26df('0x24')](_0x26df('0x1f'),_0x13313f,_0x576a28[_0x26df('0x24')][_0x26df('0x25')]);return _0x20acd7(_0x576a28['error'][_0x26df('0x25')]);}logger[_0x26df('0x24')](_0x26df('0x1f'),_0x13313f,_0x576a28['error'][_0x26df('0x25')]);return _0x2b8e4a(_0x576a28[_0x26df('0x24')][_0x26df('0x25')]);}else{logger[_0x26df('0x1e')](_0x26df('0x1f'),_0x13313f,_0x26df('0x20'));_0x2b8e4a(_0x576a28[_0x26df('0x26')][_0x26df('0x25')]);}})[_0x26df('0x27')](function(_0x21a831){logger[_0x26df('0x24')](_0x26df('0x1f'),_0x13313f,_0x21a831);_0x20acd7(_0x21a831);});});}function respondWithStatusCode(_0x18853a,_0x4c54b6){_0x4c54b6=_0x4c54b6||0xcc;return function(_0x2bd602){if(_0x2bd602){return _0x18853a[_0x26df('0x28')](_0x4c54b6);}return _0x18853a[_0x26df('0x29')](_0x4c54b6)[_0x26df('0x2a')]();};}function respondWithResult(_0x18651c,_0x413313){_0x413313=_0x413313||0xc8;return function(_0x4b1aec){if(_0x4b1aec){return _0x18651c['status'](_0x413313)[_0x26df('0x2b')](_0x4b1aec);}};}function respondWithFilteredResult(_0x2346fc,_0x237091){return function(_0x14873b){if(_0x14873b){var _0x3a7f5c=typeof _0x237091[_0x26df('0x2c')]===_0x26df('0x2d')&&typeof _0x237091['limit']===_0x26df('0x2d');var _0x59efdd=_0x14873b['count'];var _0x14678a=_0x3a7f5c?0x0:_0x237091[_0x26df('0x2c')];var _0x16bc3c=_0x3a7f5c?_0x14873b[_0x26df('0x2e')]:_0x237091[_0x26df('0x2c')]+_0x237091[_0x26df('0x2f')];var _0x4e0cbb;if(_0x16bc3c>=_0x59efdd){_0x16bc3c=_0x59efdd;_0x4e0cbb=0xc8;}else{_0x4e0cbb=0xce;}_0x2346fc[_0x26df('0x29')](_0x4e0cbb);return _0x2346fc[_0x26df('0x30')](_0x26df('0x31'),_0x14678a+'-'+_0x16bc3c+'/'+_0x59efdd)['json'](_0x14873b);}return null;};}function patchUpdates(_0x3069f1){return function(_0x4a4958){try{jsonpatch[_0x26df('0x32')](_0x4a4958,_0x3069f1,!![]);}catch(_0x59a414){return BPromise[_0x26df('0x33')](_0x59a414);}return _0x4a4958['save']();};}function saveUpdates(_0x2a5e82,_0x38adbf){return function(_0x1ce861){if(_0x1ce861){return _0x1ce861[_0x26df('0x34')](_0x2a5e82)['then'](function(_0x4cd790){return _0x4cd790;});}return null;};}function removeEntity(_0x2b2a74,_0x39a875){return function(_0x1ed3fd){if(_0x1ed3fd){return _0x1ed3fd[_0x26df('0x35')]()[_0x26df('0x36')](function(){_0x2b2a74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30b5c3,_0xbfb079){return function(_0xafe8b){if(!_0xafe8b){_0x30b5c3['sendStatus'](0x194);}return _0xafe8b;};}function handleError(_0x30b3bb,_0x152afb){_0x152afb=_0x152afb||0x1f4;return function(_0xcd1cbb){logger[_0x26df('0x24')](_0xcd1cbb[_0x26df('0x37')]);if(_0xcd1cbb[_0x26df('0x38')]){delete _0xcd1cbb[_0x26df('0x38')];}_0x30b3bb['status'](_0x152afb)['send'](_0xcd1cbb);};}exports[_0x26df('0x39')]=function(_0xcbd883,_0x41090e){var _0x493bbd={},_0x52feca={},_0x126840={'count':0x0,'rows':[]};var _0x4af59d=_[_0x26df('0x3a')](db['ChatMessage'][_0x26df('0x3b')],function(_0x375b2e){return{'name':_0x375b2e[_0x26df('0x3c')],'type':_0x375b2e[_0x26df('0x3d')][_0x26df('0x3e')]};});_0x52feca['model']=_[_0x26df('0x3a')](_0x4af59d,_0x26df('0x38'));_0x52feca[_0x26df('0x3f')]=_[_0x26df('0x40')](_0xcbd883[_0x26df('0x3f')]);_0x52feca[_0x26df('0x41')]=_[_0x26df('0x42')](_0x52feca[_0x26df('0x43')],_0x52feca[_0x26df('0x3f')]);_0x493bbd['attributes']=_[_0x26df('0x42')](_0x52feca[_0x26df('0x43')],qs[_0x26df('0x44')](_0xcbd883[_0x26df('0x3f')][_0x26df('0x44')]));_0x493bbd['attributes']=_0x493bbd[_0x26df('0x45')][_0x26df('0x46')]?_0x493bbd[_0x26df('0x45')]:_0x52feca['model'];if(!_0xcbd883[_0x26df('0x3f')][_0x26df('0x47')]('nolimit')){_0x493bbd[_0x26df('0x2f')]=qs['limit'](_0xcbd883[_0x26df('0x3f')][_0x26df('0x2f')]);_0x493bbd[_0x26df('0x2c')]=qs[_0x26df('0x2c')](_0xcbd883[_0x26df('0x3f')][_0x26df('0x2c')]);}_0x493bbd[_0x26df('0x48')]=qs['sort'](_0xcbd883[_0x26df('0x3f')]['sort']);_0x493bbd[_0x26df('0x49')]=qs[_0x26df('0x41')](_[_0x26df('0x4a')](_0xcbd883[_0x26df('0x3f')],_0x52feca[_0x26df('0x41')]),_0x4af59d);if(_0xcbd883[_0x26df('0x3f')][_0x26df('0x4b')]){_0x493bbd[_0x26df('0x49')]=_[_0x26df('0x4c')](_0x493bbd[_0x26df('0x49')],{'$or':_['map'](_0x4af59d,function(_0x57d17e){if(_0x57d17e['type']!==_0x26df('0x4d')){var _0x3d97b6={};_0x3d97b6[_0x57d17e[_0x26df('0x38')]]={'$like':'%'+_0xcbd883['query'][_0x26df('0x4b')]+'%'};return _0x3d97b6;}})});}_0x493bbd=_[_0x26df('0x4c')]({},_0x493bbd,_0xcbd883[_0x26df('0x4e')]);var _0x7bab19={'where':_0x493bbd[_0x26df('0x49')]};return db[_0x26df('0x4f')]['count'](_0x7bab19)[_0x26df('0x36')](function(_0x1c8c6c){_0x126840[_0x26df('0x2e')]=_0x1c8c6c;if(_0xcbd883[_0x26df('0x3f')][_0x26df('0x50')]){_0x493bbd[_0x26df('0x51')]=[{'all':!![]}];}return db[_0x26df('0x4f')][_0x26df('0x52')](_0x493bbd);})[_0x26df('0x36')](function(_0x324ed9){_0x126840[_0x26df('0x53')]=_0x324ed9;return _0x126840;})[_0x26df('0x36')](respondWithFilteredResult(_0x41090e,_0x493bbd))[_0x26df('0x27')](handleError(_0x41090e,null));};exports[_0x26df('0x54')]=function(_0x21c1d6,_0x560f1b){var _0x168092={'raw':!![],'where':{'id':_0x21c1d6[_0x26df('0x55')]['id']}},_0x3375b4={};_0x3375b4[_0x26df('0x43')]=_['keys'](db[_0x26df('0x4f')][_0x26df('0x3b')]);_0x3375b4['query']=_[_0x26df('0x40')](_0x21c1d6[_0x26df('0x3f')]);_0x3375b4['filters']=_['intersection'](_0x3375b4[_0x26df('0x43')],_0x3375b4[_0x26df('0x3f')]);_0x168092['attributes']=_[_0x26df('0x42')](_0x3375b4[_0x26df('0x43')],qs['fields'](_0x21c1d6[_0x26df('0x3f')][_0x26df('0x44')]));_0x168092['attributes']=_0x168092[_0x26df('0x45')][_0x26df('0x46')]?_0x168092[_0x26df('0x45')]:_0x3375b4[_0x26df('0x43')];if(_0x21c1d6[_0x26df('0x3f')][_0x26df('0x50')]){_0x168092[_0x26df('0x51')]=[{'all':!![]}];}_0x168092=_[_0x26df('0x4c')]({},_0x168092,_0x21c1d6[_0x26df('0x4e')]);return db['ChatMessage'][_0x26df('0x56')](_0x168092)[_0x26df('0x36')](handleEntityNotFound(_0x560f1b,null))[_0x26df('0x36')](respondWithResult(_0x560f1b,null))[_0x26df('0x27')](handleError(_0x560f1b,null));};exports[_0x26df('0x57')]=function(_0x8d3ec0,_0x432d11){return db[_0x26df('0x4f')][_0x26df('0x57')](_0x8d3ec0[_0x26df('0x58')],{})[_0x26df('0x36')](respondWithResult(_0x432d11,0xc9))[_0x26df('0x27')](handleError(_0x432d11,null));};exports[_0x26df('0x34')]=function(_0x4a6d4c,_0x3b4053){if(_0x4a6d4c[_0x26df('0x58')]['id']){delete _0x4a6d4c[_0x26df('0x58')]['id'];}return db['ChatMessage'][_0x26df('0x56')]({'where':{'id':_0x4a6d4c[_0x26df('0x55')]['id']}})[_0x26df('0x36')](handleEntityNotFound(_0x3b4053,null))[_0x26df('0x36')](saveUpdates(_0x4a6d4c[_0x26df('0x58')],null))[_0x26df('0x36')](respondWithResult(_0x3b4053,null))[_0x26df('0x27')](handleError(_0x3b4053,null));};exports['destroy']=function(_0x541488,_0xd02fd7){return db['ChatMessage']['find']({'where':{'id':_0x541488[_0x26df('0x55')]['id']}})[_0x26df('0x36')](handleEntityNotFound(_0xd02fd7,null))[_0x26df('0x36')](removeEntity(_0xd02fd7,null))[_0x26df('0x27')](handleError(_0xd02fd7,null));};exports['describe']=function(_0x2fb121,_0x16d390){return db['ChatMessage']['describe']()[_0x26df('0x36')](respondWithResult(_0x16d390,null))[_0x26df('0x27')](handleError(_0x16d390,null));};var interaction_log=require(_0x26df('0x59'))(_0x26df('0x5a'));exports[_0x26df('0x5b')]=function(_0x55ee00,_0x5408d2,_0x4d1c8a){var _0xa656ec={'agent':{},'channel':_0x26df('0x5c')};if(_0x55ee00[_0x26df('0x58')]['id']){delete _0x55ee00[_0x26df('0x58')]['id'];}_0x55ee00[_0x26df('0x58')][_0x26df('0x5d')]=!![];_0x55ee00[_0x26df('0x58')][_0x26df('0x5e')]=moment()[_0x26df('0x5f')](_0x26df('0x60'));_0x55ee00['body']['UserId']=_0x55ee00['body']['UserId']||_0x55ee00[_0x26df('0x61')]['id'];_0xa656ec['agent']['id']=_0x55ee00[_0x26df('0x58')][_0x26df('0x62')];return db[_0x26df('0x4f')]['find']({'where':{'id':_0x55ee00['params']['id'],'UserId':null}})[_0x26df('0x36')](handleEntityNotFound(_0x5408d2,null))[_0x26df('0x36')](saveUpdates(_0x55ee00[_0x26df('0x58')],null))[_0x26df('0x36')](function(_0x63f104){if(_0x63f104){_0xa656ec[_0x26df('0x25')]=_0x63f104[_0x26df('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x26df('0x56')]({'where':{'id':_0x63f104[_0x26df('0x64')]}});}return null;})[_0x26df('0x36')](handleEntityNotFound(_0x5408d2,null))[_0x26df('0x36')](function(_0x52eae5){if(_0x52eae5){return _0x52eae5[_0x26df('0x34')]({'UserId':_0x55ee00['body'][_0x26df('0x62')],'read1stAt':_['isNil'](_0x52eae5['read1stAt'])?moment()['format'](_0x26df('0x60')):undefined});}return null;})[_0x26df('0x36')](function(_0x25a9ee){if(_0x25a9ee){_0xa656ec[_0x26df('0x65')]=_0x25a9ee[_0x26df('0x63')]({'plain':!![]});interaction_log['info'](_0x26df('0x66'),_0x55ee00['user']['id'],_0x55ee00[_0x26df('0x61')][_0x26df('0x38')],_0x55ee00[_0x26df('0x61')][_0x26df('0x67')],_0xa656ec[_0x26df('0x65')]['id'],_0x55ee00[_0x26df('0x58')]?JSON[_0x26df('0x23')](_0x55ee00[_0x26df('0x58')]):_0x26df('0x68'));return respondWithRpcPromise('AcceptMessage',_0x26df('0x69'),_0xa656ec);}return null;})[_0x26df('0x36')](function(_0x2cd94f){var _0x30c97e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cd94f[_0x26df('0x25')][_0x26df('0x6a')];return db['sequelize'][_0x26df('0x3f')](_0x30c97e,{'type':db['Sequelize'][_0x26df('0x6b')][_0x26df('0x6c')],'raw':!![]})[_0x26df('0x36')](function(_0x3d7c94){return _0x3d7c94;});})[_0x26df('0x36')](function(_0x39dd28){if(_0x39dd28){_0xa656ec['message']['contact']=_0x39dd28[0x0];if(!_0x55ee00[_0x26df('0x58')][_0x26df('0x62')])return;return db[_0x26df('0x6d')][_0x26df('0x56')]({'where':{'id':_0x55ee00['body'][_0x26df('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0x26df('0x6e'),_0x26df('0x6f')],'raw':!![]});}return null;})[_0x26df('0x36')](function(_0x3fc9c0){if(!_0x3fc9c0)return null;_0xa656ec['message'][_0x26df('0x70')]=_0x3fc9c0;return _0xa656ec;})[_0x26df('0x36')](function(_0xb9e269){if(_0xb9e269){if(_0x55ee00['body'][_0x26df('0x71')]){_0xa656ec['message'][_0x26df('0x72')]=util['format'](_0x26df('0x73'),_0x55ee00[_0x26df('0x61')][_0x26df('0x38')]);_0xa656ec[_0x26df('0x25')]['channel']=_0xa656ec[_0x26df('0x74')];_0xa656ec[_0x26df('0x25')][_0x26df('0x75')]=_0xa656ec['channel'];_0xa656ec[_0x26df('0x25')][_0x26df('0x76')]=_0x26df('0x5b');return respondWithRpcPromise(_0x26df('0x77'),'EventManager',{'event':_0x26df('0x78'),'message':_[_0x26df('0x4c')](_0xa656ec[_0x26df('0x25')],JSON[_0x26df('0x79')](_0xa656ec[_0x26df('0x65')][_0x26df('0x7a')]))},client9002)[_0x26df('0x36')](function(){return _0xa656ec;});}return _0xa656ec;}return null;})[_0x26df('0x36')](respondWithResult(_0x5408d2,null))['catch'](handleError(_0x5408d2,null));};var interaction_log=require('../../config/logger')(_0x26df('0x5a'));exports[_0x26df('0x33')]=function(_0x3920a2,_0x385cde,_0x21d25a){var _0x1c6c79={'agent':{},'channel':'chat'};if(_0x3920a2[_0x26df('0x58')]['id']){delete _0x3920a2[_0x26df('0x58')]['id'];}_0x3920a2['body'][_0x26df('0x62')]=_0x3920a2[_0x26df('0x58')][_0x26df('0x62')]||_0x3920a2[_0x26df('0x61')]['id'];_0x1c6c79[_0x26df('0x70')]['id']=_0x3920a2[_0x26df('0x58')][_0x26df('0x62')];return db[_0x26df('0x4f')]['find']({'where':{'id':_0x3920a2[_0x26df('0x55')]['id'],'UserId':null}})[_0x26df('0x36')](handleEntityNotFound(_0x385cde,null))['then'](function(_0x499080){if(_0x499080){_0x1c6c79['message']=_0x499080[_0x26df('0x63')]({'plain':!![]});return db[_0x26df('0x7b')]['find']({'where':{'id':_0x499080[_0x26df('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x385cde,null))[_0x26df('0x36')](function(_0x19588c){if(_0x19588c){_0x1c6c79[_0x26df('0x65')]=_0x19588c['get']({'plain':!![]});interaction_log[_0x26df('0x1e')](_0x26df('0x7c'),_0x3920a2[_0x26df('0x61')]['id'],_0x3920a2[_0x26df('0x61')][_0x26df('0x38')],_0x3920a2[_0x26df('0x61')][_0x26df('0x67')],_0x1c6c79[_0x26df('0x65')]['id'],_0x3920a2[_0x26df('0x58')]?JSON[_0x26df('0x23')](_0x3920a2[_0x26df('0x58')]):_0x26df('0x68'));return respondWithRpcPromise(_0x26df('0x7d'),'rejectMessage',_0x1c6c79);}return null;})['then'](function(_0x1f977c){var _0x2adec7=_0x26df('0x7e')+_0x1f977c[_0x26df('0x25')][_0x26df('0x6a')];return db[_0x26df('0x7f')][_0x26df('0x3f')](_0x2adec7,{'type':db[_0x26df('0x80')][_0x26df('0x6b')][_0x26df('0x6c')],'raw':!![]})[_0x26df('0x36')](function(_0x48c6b8){return _0x48c6b8;});})['then'](function(_0x55f7ec){if(_0x55f7ec){_0x1c6c79[_0x26df('0x25')][_0x26df('0x81')]=_0x55f7ec[0x0];if(!_0x3920a2[_0x26df('0x58')][_0x26df('0x62')])return;return db[_0x26df('0x6d')][_0x26df('0x56')]({'where':{'id':_0x3920a2['body'][_0x26df('0x62')],'role':'agent'},'attributes':['id',_0x26df('0x38'),_0x26df('0x82'),_0x26df('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4972f1){if(!_0x4972f1)return null;_0x1c6c79['message']['agent']=_0x4972f1;return _0x1c6c79;})[_0x26df('0x36')](function(_0xcb9e1d){if(_0xcb9e1d){_0xcb9e1d[_0x26df('0x25')]['interface']=util['format'](_0x26df('0x73'),_0x3920a2[_0x26df('0x61')]['name']);_0xcb9e1d[_0x26df('0x25')][_0x26df('0x74')]=_0x1c6c79[_0x26df('0x74')];_0xcb9e1d[_0x26df('0x25')][_0x26df('0x75')]=_0x1c6c79[_0x26df('0x74')];_0xcb9e1d[_0x26df('0x25')]['event']=_0x26df('0x33');respondWithRpcPromise(_0x26df('0x77'),_0x26df('0x77'),{'event':_0x26df('0x83'),'message':_[_0x26df('0x4c')](_0x1c6c79[_0x26df('0x25')],JSON[_0x26df('0x79')](_0x1c6c79[_0x26df('0x65')][_0x26df('0x7a')]))},client9002);return _0x1c6c79;}return null;})[_0x26df('0x36')](respondWithResult(_0x385cde,null))[_0x26df('0x27')](handleError(_0x385cde,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 6f4c712..a62583f 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 _0x3a8b=['ChatMessage','setMaxListeners','save','update','remove','../../mysqldb'];(function(_0x216878,_0x21e175){var _0x29a7fd=function(_0x1a6296){while(--_0x1a6296){_0x216878['push'](_0x216878['shift']());}};_0x29a7fd(++_0x21e175);}(_0x3a8b,0xd7));var _0xb3a8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3a8b[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb3a8('0x0'))['db'][_0xb3a8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb3a8('0x2')](0x0);var events={'afterCreate':_0xb3a8('0x3'),'afterUpdate':_0xb3a8('0x4'),'afterDestroy':_0xb3a8('0x5')};function emitEvent(_0x2f80bb){return function(_0x1189ec,_0x223913,_0x4536ae){ChatMessageEvents['emit'](_0x2f80bb+':'+_0x1189ec['id'],_0x1189ec);ChatMessageEvents['emit'](_0x2f80bb,_0x1189ec);_0x4536ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xe3de=['remove','emit','hook','exports','events','setMaxListeners','save','update'];(function(_0x133d40,_0x4a4f34){var _0x20ef72=function(_0x251757){while(--_0x251757){_0x133d40['push'](_0x133d40['shift']());}};_0x20ef72(++_0x4a4f34);}(_0xe3de,0x12c));var _0xee3d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe3de[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0xee3d('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xee3d('0x1')](0x0);var events={'afterCreate':_0xee3d('0x2'),'afterUpdate':_0xee3d('0x3'),'afterDestroy':_0xee3d('0x4')};function emitEvent(_0x4ddf5f){return function(_0x7684c5,_0x327eff,_0xb8a1d2){ChatMessageEvents[_0xee3d('0x5')](_0x4ddf5f+':'+_0x7684c5['id'],_0x7684c5);ChatMessageEvents[_0xee3d('0x5')](_0x4ddf5f,_0x7684c5);_0xb8a1d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xee3d('0x6')](e,emitEvent(event));}}module[_0xee3d('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 16540e5..7799c5d 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 _0xecfc=['./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','createdAt','error','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x129b15,_0x1287f4){var _0x9e5334=function(_0x162b05){while(--_0x162b05){_0x129b15['push'](_0x129b15['shift']());}};_0x9e5334(++_0x1287f4);}(_0xecfc,0x88));var _0xcecf=function(_0x4b126f,_0x3f6198){_0x4b126f=_0x4b126f-0x0;var _0xa319d5=_0xecfc[_0x4b126f];return _0xa319d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcecf('0x0'))(_0xcecf('0x1'));var moment=require(_0xcecf('0x2'));var BPromise=require(_0xcecf('0x3'));var rp=require(_0xcecf('0x4'));var fs=require('fs');var path=require(_0xcecf('0x5'));var rimraf=require(_0xcecf('0x6'));var config=require(_0xcecf('0x7'));var attributes=require(_0xcecf('0x8'));module['exports']=function(_0x41bd37,_0x2e712f){return _0x41bd37[_0xcecf('0x9')](_0xcecf('0xa'),attributes,{'tableName':_0xcecf('0xb'),'paranoid':![],'indexes':[{'name':_0xcecf('0xc'),'fields':[_0xcecf('0xd')],'type':_0xcecf('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27e3a5,_0x56effa,_0x32291d){var _0x3c84d3=_0x41bd37['models'];var _0x38a773=_0x27e3a5['get']({'plain':!![]});if(_0x38a773[_0xcecf('0xf')]['toLowerCase']()==='in'||_0x38a773[_0xcecf('0xf')][_0xcecf('0x10')]()===_0xcecf('0x11')&&!_0x38a773[_0xcecf('0x12')]&&!_['isNil'](_0x38a773[_0xcecf('0x13')])){_0x3c84d3[_0xcecf('0x14')]['findOne']({'where':{'id':_0x38a773[_0xcecf('0x15')]}})['then'](function(_0x372eb5){if(_0x372eb5){_0x372eb5['update']({'lastMsgAt':_0x38a773[_0xcecf('0x16')],'lastMsgDirection':_0x38a773['direction']['toLowerCase']()});}})['catch'](function(_0x4e3999){console[_0xcecf('0x17')](_0x4e3999);});}_0x32291d();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7aaa=['update','createdAt','toLowerCase','error','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','out','UserId','ChatInteraction','findOne','then'];(function(_0x1e6aa8,_0x5daf61){var _0x285ece=function(_0x3e3429){while(--_0x3e3429){_0x1e6aa8['push'](_0x1e6aa8['shift']());}};_0x285ece(++_0x5daf61);}(_0x7aaa,0x164));var _0xa7aa=function(_0x279c9a,_0x2095ce){_0x279c9a=_0x279c9a-0x0;var _0x4b712b=_0x7aaa[_0x279c9a];return _0x4b712b;};'use strict';var _=require(_0xa7aa('0x0'));var util=require('util');var logger=require(_0xa7aa('0x1'))(_0xa7aa('0x2'));var moment=require(_0xa7aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7aa('0x4'));var fs=require('fs');var path=require(_0xa7aa('0x5'));var rimraf=require(_0xa7aa('0x6'));var config=require('../../config/environment');var attributes=require(_0xa7aa('0x7'));module[_0xa7aa('0x8')]=function(_0x3eaa6a,_0x166a17){return _0x3eaa6a[_0xa7aa('0x9')](_0xa7aa('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa7aa('0xb'),'fields':[_0xa7aa('0xc')],'type':_0xa7aa('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40c617,_0x57d7a5,_0x52c9f1){var _0x4b6015=_0x3eaa6a[_0xa7aa('0xe')];var _0x370305=_0x40c617[_0xa7aa('0xf')]({'plain':!![]});if(_0x370305[_0xa7aa('0x10')]['toLowerCase']()==='in'||_0x370305['direction']['toLowerCase']()===_0xa7aa('0x11')&&!_0x370305['secret']&&!_['isNil'](_0x370305[_0xa7aa('0x12')])){_0x4b6015[_0xa7aa('0x13')][_0xa7aa('0x14')]({'where':{'id':_0x370305['ChatInteractionId']}})[_0xa7aa('0x15')](function(_0x5f4711){if(_0x5f4711){_0x5f4711[_0xa7aa('0x16')]({'lastMsgAt':_0x370305[_0xa7aa('0x17')],'lastMsgDirection':_0x370305[_0xa7aa('0x10')][_0xa7aa('0x18')]()});}})['catch'](function(_0x4b32c7){console[_0xa7aa('0x19')](_0x4b32c7);});}_0x52c9f1();}},'charset':_0xa7aa('0x1a'),'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 96168e5..cce5680 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 _0xdb8d=['body','options','raw','CreateChatMessage','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create'];(function(_0x3daa66,_0x1c3fda){var _0x3f3710=function(_0x590623){while(--_0x590623){_0x3daa66['push'](_0x3daa66['shift']());}};_0x3f3710(++_0x1c3fda);}(_0xdb8d,0xe5));var _0xddb8=function(_0x1edf37,_0xd7c2fd){_0x1edf37=_0x1edf37-0x0;var _0x4d6ac9=_0xdb8d[_0x1edf37];return _0x4d6ac9;};'use strict';var _=require(_0xddb8('0x0'));var util=require(_0xddb8('0x1'));var moment=require(_0xddb8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddb8('0x3'));var db=require(_0xddb8('0x4'))['db'];var utils=require(_0xddb8('0x5'));var logger=require('../../config/logger')(_0xddb8('0x6'));var config=require(_0xddb8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xddb8('0x8')][_0xddb8('0x9')]({'port':0x232a});config[_0xddb8('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddb8('0xa')]));require(_0xddb8('0xb'))[_0xddb8('0xc')](socket);function respondWithRpcPromise(_0x441ce2,_0x2724e7,_0x525e11){return new BPromise(function(_0xd370ea,_0x1a668b){return client[_0xddb8('0xd')](_0x441ce2,_0x525e11)[_0xddb8('0xe')](function(_0x7994ef){logger[_0xddb8('0xf')]('ChatMessage,\x20%s,\x20%s',_0x2724e7,_0xddb8('0x10'));logger[_0xddb8('0x11')](_0xddb8('0x12'),_0x2724e7,_0xddb8('0x10'),JSON['stringify'](_0x7994ef));if(_0x7994ef[_0xddb8('0x13')]){if(_0x7994ef[_0xddb8('0x13')][_0xddb8('0x14')]===0x1f4){logger['error'](_0xddb8('0x15'),_0x2724e7,_0x7994ef[_0xddb8('0x13')][_0xddb8('0x16')]);return _0x1a668b(_0x7994ef[_0xddb8('0x13')][_0xddb8('0x16')]);}logger[_0xddb8('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2724e7,_0x7994ef[_0xddb8('0x13')][_0xddb8('0x16')]);return _0xd370ea(_0x7994ef['error'][_0xddb8('0x16')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2724e7,_0xddb8('0x10'));_0xd370ea(_0x7994ef[_0xddb8('0x17')]['message']);}})[_0xddb8('0x18')](function(_0x72408){logger[_0xddb8('0x13')](_0xddb8('0x15'),_0x2724e7,_0x72408);_0x1a668b(_0x72408);});});}exports['CreateChatMessage']=function(_0x30b031){var _0x40d78b=this;return new Promise(function(_0x499608,_0x1d8ac1){return db[_0xddb8('0x19')][_0xddb8('0x1a')](_0x30b031[_0xddb8('0x1b')],{'raw':_0x30b031[_0xddb8('0x1c')]?_0x30b031[_0xddb8('0x1c')][_0xddb8('0x1d')]===undefined?!![]:![]:!![]})[_0xddb8('0xe')](function(_0x144428){logger['info'](_0xddb8('0x1e'),_0x30b031);logger[_0xddb8('0x11')](_0xddb8('0x1e'),_0x30b031,JSON[_0xddb8('0x1f')](_0x144428));_0x499608(_0x144428);})[_0xddb8('0x18')](function(_0x34ad06){logger[_0xddb8('0x13')](_0xddb8('0x1e'),_0x34ad06[_0xddb8('0x16')],_0x30b031);_0x1d8ac1(_0x40d78b[_0xddb8('0x13')](0x1f4,_0x34ad06[_0xddb8('0x16')]));});});}; \ No newline at end of file +var _0x435d=['client','http','redis','localhost','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','create','body','options','raw','debug','catch','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x495c1d,_0x572c1b){var _0x537a6c=function(_0x321a67){while(--_0x321a67){_0x495c1d['push'](_0x495c1d['shift']());}};_0x537a6c(++_0x572c1b);}(_0x435d,0x96));var _0xd435=function(_0x3f63ce,_0x22dfc5){_0x3f63ce=_0x3f63ce-0x0;var _0x147eb8=_0x435d[_0x3f63ce];return _0x147eb8;};'use strict';var _=require(_0xd435('0x0'));var util=require(_0xd435('0x1'));var moment=require(_0xd435('0x2'));var BPromise=require(_0xd435('0x3'));var rs=require(_0xd435('0x4'));var fs=require('fs');var Redis=require(_0xd435('0x5'));var db=require(_0xd435('0x6'))['db'];var utils=require(_0xd435('0x7'));var logger=require('../../config/logger')(_0xd435('0x8'));var config=require('../../config/environment');var jayson=require(_0xd435('0x9'));var client=jayson[_0xd435('0xa')][_0xd435('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd435('0xc')],{'host':_0xd435('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd435('0xc')]));require(_0xd435('0xe'))[_0xd435('0xf')](socket);function respondWithRpcPromise(_0x281293,_0x4d6cb9,_0x15efc6){return new BPromise(function(_0x4f0792,_0x45a089){return client['request'](_0x281293,_0x15efc6)['then'](function(_0x15c8f2){logger[_0xd435('0x10')](_0xd435('0x11'),_0x4d6cb9,'request\x20sent');logger['debug'](_0xd435('0x12'),_0x4d6cb9,'request\x20sent',JSON[_0xd435('0x13')](_0x15c8f2));if(_0x15c8f2[_0xd435('0x14')]){if(_0x15c8f2[_0xd435('0x14')][_0xd435('0x15')]===0x1f4){logger[_0xd435('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4d6cb9,_0x15c8f2[_0xd435('0x14')]['message']);return _0x45a089(_0x15c8f2['error'][_0xd435('0x16')]);}logger[_0xd435('0x14')](_0xd435('0x11'),_0x4d6cb9,_0x15c8f2['error']['message']);return _0x4f0792(_0x15c8f2[_0xd435('0x14')]['message']);}else{logger[_0xd435('0x10')](_0xd435('0x11'),_0x4d6cb9,_0xd435('0x17'));_0x4f0792(_0x15c8f2[_0xd435('0x18')][_0xd435('0x16')]);}})['catch'](function(_0x658ac6){logger['error'](_0xd435('0x11'),_0x4d6cb9,_0x658ac6);_0x45a089(_0x658ac6);});});}exports['CreateChatMessage']=function(_0x2ccefc){var _0x2c5cd3=this;return new Promise(function(_0x5defa0,_0xec1aba){return db['ChatMessage'][_0xd435('0x19')](_0x2ccefc[_0xd435('0x1a')],{'raw':_0x2ccefc[_0xd435('0x1b')]?_0x2ccefc[_0xd435('0x1b')][_0xd435('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1ac12a){logger[_0xd435('0x10')]('CreateChatMessage',_0x2ccefc);logger[_0xd435('0x1d')]('CreateChatMessage',_0x2ccefc,JSON[_0xd435('0x13')](_0x1ac12a));_0x5defa0(_0x1ac12a);})[_0xd435('0x1e')](function(_0x10f6c3){logger[_0xd435('0x14')](_0xd435('0x1f'),_0x10f6c3[_0xd435('0x16')],_0x2ccefc);_0xec1aba(_0x2c5cd3[_0xd435('0x14')](0x1f4,_0x10f6c3[_0xd435('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 24f84c7..63d474e 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 _0x90b5=['chatMessage:','./chatMessage.events','remove','update','register','length'];(function(_0x4c1f32,_0x124738){var _0x5b0e7f=function(_0x17d565){while(--_0x17d565){_0x4c1f32['push'](_0x4c1f32['shift']());}};_0x5b0e7f(++_0x124738);}(_0x90b5,0x139));var _0x590b=function(_0x5cfb1d,_0x356e6c){_0x5cfb1d=_0x5cfb1d-0x0;var _0x4e2810=_0x90b5[_0x5cfb1d];return _0x4e2810;};'use strict';var ChatMessageEvents=require(_0x590b('0x0'));var events=['save',_0x590b('0x1'),_0x590b('0x2')];function createListener(_0xf402e8,_0xa7594d){return function(_0x5dd1b2){_0xa7594d['emit'](_0xf402e8,_0x5dd1b2);};}function removeListener(_0x2318b8,_0x27e96f){return function(){ChatMessageEvents['removeListener'](_0x2318b8,_0x27e96f);};}exports[_0x590b('0x3')]=function(_0x2059e4){for(var _0x88a5f9=0x0,_0x5e54fe=events[_0x590b('0x4')];_0x88a5f9<_0x5e54fe;_0x88a5f9++){var _0x3663a0=events[_0x88a5f9];var _0x3ec156=createListener(_0x590b('0x5')+_0x3663a0,_0x2059e4);ChatMessageEvents['on'](_0x3663a0,_0x3ec156);}}; \ No newline at end of file +var _0x950a=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950a,0x111));var _0xa950=function(_0x2ab123,_0x547adf){_0x2ab123=_0x2ab123-0x0;var _0x37d801=_0x950a[_0x2ab123];return _0x37d801;};'use strict';var ChatMessageEvents=require(_0xa950('0x0'));var events=[_0xa950('0x1'),_0xa950('0x2'),_0xa950('0x3')];function createListener(_0x5569f7,_0x305b26){return function(_0xa583df){_0x305b26[_0xa950('0x4')](_0x5569f7,_0xa583df);};}function removeListener(_0x2c80ed,_0x5cd4aa){return function(){ChatMessageEvents[_0xa950('0x5')](_0x2c80ed,_0x5cd4aa);};}exports[_0xa950('0x6')]=function(_0x512c0e){for(var _0x14b4ac=0x0,_0x3645b6=events['length'];_0x14b4ac<_0x3645b6;_0x14b4ac++){var _0x5675f8=events[_0x14b4ac];var _0x26e05c=createListener(_0xa950('0x7')+_0x5675f8,_0x512c0e);ChatMessageEvents['on'](_0x5675f8,_0x26e05c);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 05ae22e..75e1cb3 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 _0xf4e1=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject'];(function(_0x2c0a23,_0x5e7678){var _0x415df4=function(_0x2bc31b){while(--_0x2bc31b){_0x2c0a23['push'](_0x2c0a23['shift']());}};_0x415df4(++_0x5e7678);}(_0xf4e1,0x1e2));var _0x1f4e=function(_0x3db7f3,_0x3c7852){_0x3db7f3=_0x3db7f3-0x0;var _0x3d866a=_0xf4e1[_0x3db7f3];return _0x3d866a;};'use strict';var multer=require(_0x1f4e('0x0'));var util=require(_0x1f4e('0x1'));var path=require(_0x1f4e('0x2'));var timeout=require(_0x1f4e('0x3'));var express=require(_0x1f4e('0x4'));var router=express['Router']();var fs_extra=require(_0x1f4e('0x5'));var auth=require(_0x1f4e('0x6'));var interaction=require(_0x1f4e('0x7'));var config=require(_0x1f4e('0x8'));var controller=require(_0x1f4e('0x9'));router['get']('/',auth[_0x1f4e('0xa')](),controller['index']);router[_0x1f4e('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1f4e('0xc'),auth[_0x1f4e('0xa')](),controller[_0x1f4e('0xd')]);router[_0x1f4e('0xe')]('/',auth[_0x1f4e('0xa')](),interaction[_0x1f4e('0xf')](_0x1f4e('0x10'),_0x1f4e('0x11')),controller[_0x1f4e('0x12')]);router[_0x1f4e('0x13')](_0x1f4e('0xc'),controller[_0x1f4e('0x14')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1f4e('0x13')](_0x1f4e('0x15'),auth[_0x1f4e('0xa')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1f4e('0x16')]);module[_0x1f4e('0x17')]=router; \ No newline at end of file +var _0xacbc=['index','get','describe','show','chat','chatmessage:create','create','/:id','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xacbc,0x16f));var _0xcacb=function(_0x2e2c90,_0x5cbedc){_0x2e2c90=_0x2e2c90-0x0;var _0x28b1de=_0xacbc[_0x2e2c90];return _0x28b1de;};'use strict';var multer=require(_0xcacb('0x0'));var util=require(_0xcacb('0x1'));var path=require(_0xcacb('0x2'));var timeout=require('connect-timeout');var express=require(_0xcacb('0x3'));var router=express[_0xcacb('0x4')]();var fs_extra=require(_0xcacb('0x5'));var auth=require(_0xcacb('0x6'));var interaction=require(_0xcacb('0x7'));var config=require(_0xcacb('0x8'));var controller=require(_0xcacb('0x9'));router['get']('/',auth[_0xcacb('0xa')](),controller[_0xcacb('0xb')]);router[_0xcacb('0xc')]('/describe',auth[_0xcacb('0xa')](),controller[_0xcacb('0xd')]);router[_0xcacb('0xc')]('/:id',auth[_0xcacb('0xa')](),controller[_0xcacb('0xe')]);router['post']('/',auth[_0xcacb('0xa')](),interaction['tracked'](_0xcacb('0xf'),_0xcacb('0x10')),controller[_0xcacb('0x11')]);router['put'](_0xcacb('0x12'),controller[_0xcacb('0x13')]);router[_0xcacb('0x14')](_0xcacb('0x15'),auth[_0xcacb('0xa')](),controller[_0xcacb('0x16')]);router[_0xcacb('0x14')]('/:id/reject',auth[_0xcacb('0xa')](),controller[_0xcacb('0x17')]);router[_0xcacb('0x18')](_0xcacb('0x12'),auth[_0xcacb('0xa')](),controller[_0xcacb('0x19')]);module[_0xcacb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 877b94e..03a14c7 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 _0xeaec=['medium','sequelize'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0xeaec,0x191));var _0xceae=function(_0x23f797,_0x1e5cca){_0x23f797=_0x23f797-0x0;var _0x44cd3f=_0xeaec[_0x23f797];return _0x44cd3f;};'use strict';var Sequelize=require(_0xceae('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xceae('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xa816=['TEXT','medium','sequelize','exports'];(function(_0x3d21b0,_0x4af3db){var _0x53ef89=function(_0x3654ac){while(--_0x3654ac){_0x3d21b0['push'](_0x3d21b0['shift']());}};_0x53ef89(++_0x4af3db);}(_0xa816,0xda));var _0x6a81=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xa816[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0x6a81('0x0'));module[_0x6a81('0x1')]={'body':{'type':Sequelize[_0x6a81('0x2')](_0x6a81('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 5ace26a..a4f8d87 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x5e608c,_0x16876b){_0x5e608c=_0x5e608c-0x0;var _0x80819d=_0x7a54[_0x5e608c];return _0x80819d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7a54,0x106));var _0x47a5=function(_0x8841fa,_0x292bac){_0x8841fa=_0x8841fa-0x0;var _0x21bf32=_0x7a54[_0x8841fa];return _0x21bf32;};'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 43adad1..ba1f4e8 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 _0x9c70=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','util'];(function(_0x2d38e3,_0x3ac20e){var _0x1306a7=function(_0x5765d7){while(--_0x5765d7){_0x2d38e3['push'](_0x2d38e3['shift']());}};_0x1306a7(++_0x3ac20e);}(_0x9c70,0xe6));var _0x09c7=function(_0x17c9d6,_0xb95b04){_0x17c9d6=_0x17c9d6-0x0;var _0x68b7a2=_0x9c70[_0x17c9d6];return _0x68b7a2;};'use strict';var _=require('lodash');var util=require(_0x09c7('0x0'));var logger=require(_0x09c7('0x1'))(_0x09c7('0x2'));var moment=require(_0x09c7('0x3'));var BPromise=require('bluebird');var rp=require(_0x09c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09c7('0x5'));var config=require(_0x09c7('0x6'));var attributes=require(_0x09c7('0x7'));module[_0x09c7('0x8')]=function(_0x2eee14,_0x52512a){return _0x2eee14['define'](_0x09c7('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09c7('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbbb2=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbbb2,0x1b9));var _0x2bbb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xbbb2[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0x2bbb('0x0'));var logger=require(_0x2bbb('0x1'))(_0x2bbb('0x2'));var moment=require(_0x2bbb('0x3'));var BPromise=require(_0x2bbb('0x4'));var rp=require(_0x2bbb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2bbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bbb('0x7'));module[_0x2bbb('0x8')]=function(_0x341f79,_0x7c79fd){return _0x341f79[_0x2bbb('0x9')](_0x2bbb('0xa'),attributes,{'tableName':_0x2bbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2bbb('0xc'),'collate':_0x2bbb('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a57cd45..3c17996 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 _0xc7fb=['../../config/logger','rpc','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x472cd8,_0x1b9dd0){var _0x43e6af=function(_0x2c2147){while(--_0x2c2147){_0x472cd8['push'](_0x472cd8['shift']());}};_0x43e6af(++_0x1b9dd0);}(_0xc7fb,0x68));var _0xbc7f=function(_0xc20958,_0x3f1ee8){_0xc20958=_0xc20958-0x0;var _0x318735=_0xc7fb[_0xc20958];return _0x318735;};'use strict';var _=require(_0xbc7f('0x0'));var util=require(_0xbc7f('0x1'));var moment=require(_0xbc7f('0x2'));var BPromise=require(_0xbc7f('0x3'));var rs=require(_0xbc7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc7f('0x6'))(_0xbc7f('0x7'));var config=require('../../config/environment');var jayson=require(_0xbc7f('0x8'));var client=jayson[_0xbc7f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183aa2,_0x3f6e55,_0x576265){return new BPromise(function(_0x1d6825,_0x38db2a){return client[_0xbc7f('0xa')](_0x183aa2,_0x576265)[_0xbc7f('0xb')](function(_0x1dd9e3){logger[_0xbc7f('0xc')](_0xbc7f('0xd'),_0x3f6e55,'request\x20sent');logger[_0xbc7f('0xe')](_0xbc7f('0xf'),_0x3f6e55,_0xbc7f('0x10'),JSON['stringify'](_0x1dd9e3));if(_0x1dd9e3[_0xbc7f('0x11')]){if(_0x1dd9e3[_0xbc7f('0x11')][_0xbc7f('0x12')]===0x1f4){logger[_0xbc7f('0x11')](_0xbc7f('0xd'),_0x3f6e55,_0x1dd9e3[_0xbc7f('0x11')][_0xbc7f('0x13')]);return _0x38db2a(_0x1dd9e3['error'][_0xbc7f('0x13')]);}logger['error'](_0xbc7f('0xd'),_0x3f6e55,_0x1dd9e3[_0xbc7f('0x11')][_0xbc7f('0x13')]);return _0x1d6825(_0x1dd9e3[_0xbc7f('0x11')][_0xbc7f('0x13')]);}else{logger['info'](_0xbc7f('0xd'),_0x3f6e55,_0xbc7f('0x10'));_0x1d6825(_0x1dd9e3[_0xbc7f('0x14')][_0xbc7f('0x13')]);}})[_0xbc7f('0x15')](function(_0x22975a){logger['error'](_0xbc7f('0xd'),_0x3f6e55,_0x22975a);_0x38db2a(_0x22975a);});});} \ No newline at end of file +var _0x44fd=['stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5926a8,_0x106eb9){var _0x265a1e=function(_0x7e62a3){while(--_0x7e62a3){_0x5926a8['push'](_0x5926a8['shift']());}};_0x265a1e(++_0x106eb9);}(_0x44fd,0x123));var _0xd44f=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x44fd[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd44f('0x0'));var BPromise=require(_0xd44f('0x1'));var rs=require(_0xd44f('0x2'));var fs=require('fs');var Redis=require(_0xd44f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd44f('0x4'));var logger=require('../../config/logger')(_0xd44f('0x5'));var config=require(_0xd44f('0x6'));var jayson=require(_0xd44f('0x7'));var client=jayson[_0xd44f('0x8')][_0xd44f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44dd02,_0x6e1926,_0x107d77){return new BPromise(function(_0x4e5e68,_0x17fb72){return client[_0xd44f('0xa')](_0x44dd02,_0x107d77)[_0xd44f('0xb')](function(_0x4ba038){logger[_0xd44f('0xc')](_0xd44f('0xd'),_0x6e1926,'request\x20sent');logger[_0xd44f('0xe')](_0xd44f('0xf'),_0x6e1926,_0xd44f('0x10'),JSON[_0xd44f('0x11')](_0x4ba038));if(_0x4ba038[_0xd44f('0x12')]){if(_0x4ba038['error'][_0xd44f('0x13')]===0x1f4){logger[_0xd44f('0x12')](_0xd44f('0xd'),_0x6e1926,_0x4ba038['error'][_0xd44f('0x14')]);return _0x17fb72(_0x4ba038[_0xd44f('0x12')][_0xd44f('0x14')]);}logger[_0xd44f('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x6e1926,_0x4ba038[_0xd44f('0x12')][_0xd44f('0x14')]);return _0x4e5e68(_0x4ba038[_0xd44f('0x12')]['message']);}else{logger['info'](_0xd44f('0xd'),_0x6e1926,_0xd44f('0x10'));_0x4e5e68(_0x4ba038[_0xd44f('0x15')][_0xd44f('0x14')]);}})['catch'](function(_0x40a12d){logger[_0xd44f('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x6e1926,_0x40a12d);_0x17fb72(_0x40a12d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 7cd127b..679e756 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 _0xbb5d=['/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbb5d,0xe7));var _0xdbb5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbb5d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdbb5('0x0'));var util=require('util');var path=require(_0xdbb5('0x1'));var timeout=require('connect-timeout');var express=require(_0xdbb5('0x2'));var router=express['Router']();var fs_extra=require(_0xdbb5('0x3'));var auth=require(_0xdbb5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdbb5('0x5'));var controller=require(_0xdbb5('0x6'));router[_0xdbb5('0x7')]('/',auth['isAuthenticated'](),controller[_0xdbb5('0x8')]);router[_0xdbb5('0x7')](_0xdbb5('0x9'),auth[_0xdbb5('0xa')](),controller[_0xdbb5('0xb')]);router[_0xdbb5('0x7')](_0xdbb5('0xc'),auth[_0xdbb5('0xa')](),controller[_0xdbb5('0xd')]);router['post']('/',auth[_0xdbb5('0xa')](),controller[_0xdbb5('0xe')]);router[_0xdbb5('0xf')](_0xdbb5('0xc'),auth[_0xdbb5('0xa')](),controller[_0xdbb5('0x10')]);router[_0xdbb5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xdbb5('0x12')]);module[_0xdbb5('0x13')]=router; \ No newline at end of file +var _0x646b=['put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','create'];(function(_0x1807df,_0x2f1195){var _0x458500=function(_0x2e051a){while(--_0x2e051a){_0x1807df['push'](_0x1807df['shift']());}};_0x458500(++_0x2f1195);}(_0x646b,0x1a5));var _0xb646=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x646b[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require(_0xb646('0x0'));var util=require('util');var path=require(_0xb646('0x1'));var timeout=require('connect-timeout');var express=require(_0xb646('0x2'));var router=express[_0xb646('0x3')]();var fs_extra=require(_0xb646('0x4'));var auth=require(_0xb646('0x5'));var interaction=require(_0xb646('0x6'));var config=require('../../config/environment');var controller=require(_0xb646('0x7'));router['get']('/',auth[_0xb646('0x8')](),controller[_0xb646('0x9')]);router[_0xb646('0xa')](_0xb646('0xb'),auth[_0xb646('0x8')](),controller['describe']);router[_0xb646('0xa')](_0xb646('0xc'),auth[_0xb646('0x8')](),controller[_0xb646('0xd')]);router[_0xb646('0xe')]('/',auth[_0xb646('0x8')](),controller[_0xb646('0xf')]);router[_0xb646('0x10')](_0xb646('0xc'),auth[_0xb646('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb646('0x8')](),controller[_0xb646('0x11')]);module[_0xb646('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 0ca5698..b673736 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 _0x90ac=['INTEGER','sequelize','exports','STRING','ENUM','timeout'];(function(_0x129852,_0x3de1aa){var _0x143f29=function(_0xb60c61){while(--_0xb60c61){_0x129852['push'](_0x129852['shift']());}};_0x143f29(++_0x3de1aa);}(_0x90ac,0x1ab));var _0xc90a=function(_0x157e31,_0x12e251){_0x157e31=_0x157e31-0x0;var _0x3c09b6=_0x90ac[_0x157e31];return _0x3c09b6;};'use strict';var Sequelize=require(_0xc90a('0x0'));module[_0xc90a('0x1')]={'name':{'type':Sequelize[_0xc90a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc90a('0x3')]('mouseOver',_0xc90a('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xc90a('0x2')]},'timeout':{'type':Sequelize[_0xc90a('0x5')]}}; \ No newline at end of file +var _0x4458=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0xe42661,_0x2975f5){var _0x539d04=function(_0x143e6f){while(--_0x143e6f){_0xe42661['push'](_0xe42661['shift']());}};_0x539d04(++_0x2975f5);}(_0x4458,0xb8));var _0x8445=function(_0xb903cb,_0x4e55aa){_0xb903cb=_0xb903cb-0x0;var _0x15f21b=_0x4458[_0xb903cb];return _0x15f21b;};'use strict';var Sequelize=require(_0x8445('0x0'));module['exports']={'name':{'type':Sequelize[_0x8445('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8445('0x2')](_0x8445('0x3'),_0x8445('0x4')),'defaultValue':_0x8445('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8445('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 360d215..1bc8f56 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 _0x8403=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','length','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x8f891b,_0x431488){var _0x3cbdbe=function(_0x1edabc){while(--_0x1edabc){_0x8f891b['push'](_0x8f891b['shift']());}};_0x3cbdbe(++_0x431488);}(_0x8403,0x1a5));var _0x3840=function(_0x18d04b,_0x392da8){_0x18d04b=_0x18d04b-0x0;var _0x4d4230=_0x8403[_0x18d04b];return _0x4d4230;};'use strict';var emlformat=require(_0x3840('0x0'));var rimraf=require(_0x3840('0x1'));var zipdir=require(_0x3840('0x2'));var jsonpatch=require(_0x3840('0x3'));var rp=require(_0x3840('0x4'));var moment=require(_0x3840('0x5'));var BPromise=require(_0x3840('0x6'));var Mustache=require(_0x3840('0x7'));var util=require(_0x3840('0x8'));var path=require('path');var sox=require(_0x3840('0x9'));var csv=require(_0x3840('0xa'));var ejs=require(_0x3840('0xb'));var fs=require('fs');var fs_extra=require(_0x3840('0xc'));var _=require(_0x3840('0xd'));var squel=require(_0x3840('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3840('0xf'));var toCsv=require(_0x3840('0xa'));var querystring=require(_0x3840('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3840('0x11'));var qs=require(_0x3840('0x12'));var as=require(_0x3840('0x13'));var hardwareService=require(_0x3840('0x14'));var logger=require(_0x3840('0x15'))(_0x3840('0x16'));var utils=require(_0x3840('0x17'));var config=require(_0x3840('0x18'));var licenseUtil=require(_0x3840('0x19'));var db=require(_0x3840('0x1a'))['db'];function respondWithStatusCode(_0x4afef9,_0x1204a6){_0x1204a6=_0x1204a6||0xcc;return function(_0x469bf3){if(_0x469bf3){return _0x4afef9[_0x3840('0x1b')](_0x1204a6);}return _0x4afef9['status'](_0x1204a6)[_0x3840('0x1c')]();};}function respondWithResult(_0x251fce,_0x570c98){_0x570c98=_0x570c98||0xc8;return function(_0x178a30){if(_0x178a30){return _0x251fce[_0x3840('0x1d')](_0x570c98)[_0x3840('0x1e')](_0x178a30);}};}function respondWithFilteredResult(_0x1f3b02,_0x2cf194){return function(_0x443380){if(_0x443380){var _0x1d74b2=typeof _0x2cf194[_0x3840('0x1f')]===_0x3840('0x20')&&typeof _0x2cf194[_0x3840('0x21')]===_0x3840('0x20');var _0x58d2d8=_0x443380['count'];var _0x3bc1be=_0x1d74b2?0x0:_0x2cf194['offset'];var _0x1f1df5=_0x1d74b2?_0x443380[_0x3840('0x22')]:_0x2cf194['offset']+_0x2cf194['limit'];var _0x439455;if(_0x1f1df5>=_0x58d2d8){_0x1f1df5=_0x58d2d8;_0x439455=0xc8;}else{_0x439455=0xce;}_0x1f3b02[_0x3840('0x1d')](_0x439455);return _0x1f3b02[_0x3840('0x23')]('Content-Range',_0x3bc1be+'-'+_0x1f1df5+'/'+_0x58d2d8)[_0x3840('0x1e')](_0x443380);}return null;};}function patchUpdates(_0xd03d51){return function(_0x49c2d9){try{jsonpatch[_0x3840('0x24')](_0x49c2d9,_0xd03d51,!![]);}catch(_0x178037){return BPromise['reject'](_0x178037);}return _0x49c2d9[_0x3840('0x25')]();};}function saveUpdates(_0x20f021,_0x47eb14){return function(_0x35f548){if(_0x35f548){return _0x35f548[_0x3840('0x26')](_0x20f021)[_0x3840('0x27')](function(_0x36e089){return _0x36e089;});}return null;};}function removeEntity(_0x1e771a,_0x3bf539){return function(_0x3ce779){if(_0x3ce779){return _0x3ce779['destroy']()[_0x3840('0x27')](function(){_0x1e771a[_0x3840('0x1d')](0xcc)[_0x3840('0x1c')]();});}};}function handleEntityNotFound(_0x29abcb,_0x5ef056){return function(_0x54d1be){if(!_0x54d1be){_0x29abcb['sendStatus'](0x194);}return _0x54d1be;};}function handleError(_0x14f955,_0x5f21de){_0x5f21de=_0x5f21de||0x1f4;return function(_0x5eb7b1){logger[_0x3840('0x28')](_0x5eb7b1[_0x3840('0x29')]);if(_0x5eb7b1[_0x3840('0x2a')]){delete _0x5eb7b1['name'];}_0x14f955[_0x3840('0x1d')](_0x5f21de)[_0x3840('0x2b')](_0x5eb7b1);};}exports[_0x3840('0x2c')]=function(_0x344749,_0x3fffae){var _0x9da640={'raw':!![],'where':{'id':_0x344749[_0x3840('0x2d')]['id']}},_0x250a95={};_0x250a95[_0x3840('0x2e')]=_['keys'](db[_0x3840('0x2f')][_0x3840('0x30')]);_0x250a95[_0x3840('0x31')]=_[_0x3840('0x32')](_0x344749['query']);_0x250a95['filters']=_[_0x3840('0x33')](_0x250a95[_0x3840('0x2e')],_0x250a95[_0x3840('0x31')]);_0x9da640[_0x3840('0x34')]=_['intersection'](_0x250a95[_0x3840('0x2e')],qs['fields'](_0x344749[_0x3840('0x31')]['fields']));_0x9da640[_0x3840('0x34')]=_0x9da640[_0x3840('0x34')][_0x3840('0x35')]?_0x9da640[_0x3840('0x34')]:_0x250a95['model'];if(_0x344749[_0x3840('0x31')][_0x3840('0x36')]){_0x9da640[_0x3840('0x37')]=[{'all':!![]}];}_0x9da640=_['merge']({},_0x9da640,_0x344749[_0x3840('0x38')]);return db[_0x3840('0x2f')]['find'](_0x9da640)['then'](handleEntityNotFound(_0x3fffae,null))[_0x3840('0x27')](respondWithResult(_0x3fffae,null))[_0x3840('0x39')](handleError(_0x3fffae,null));};exports[_0x3840('0x3a')]=function(_0x4ceb68,_0x5de6a3){return db[_0x3840('0x2f')][_0x3840('0x3a')](_0x4ceb68[_0x3840('0x3b')],{})['then'](respondWithResult(_0x5de6a3,0xc9))['catch'](handleError(_0x5de6a3,null));};exports[_0x3840('0x26')]=function(_0x8e705b,_0xff6fa7){if(_0x8e705b['body']['id']){delete _0x8e705b[_0x3840('0x3b')]['id'];}return db[_0x3840('0x2f')][_0x3840('0x3c')]({'where':{'id':_0x8e705b[_0x3840('0x2d')]['id']}})[_0x3840('0x27')](handleEntityNotFound(_0xff6fa7,null))[_0x3840('0x27')](saveUpdates(_0x8e705b[_0x3840('0x3b')],null))[_0x3840('0x27')](respondWithResult(_0xff6fa7,null))[_0x3840('0x39')](handleError(_0xff6fa7,null));};exports['destroy']=function(_0x59a04f,_0x24694a){return db[_0x3840('0x2f')]['find']({'where':{'id':_0x59a04f[_0x3840('0x2d')]['id']}})[_0x3840('0x27')](handleEntityNotFound(_0x24694a,null))[_0x3840('0x27')](removeEntity(_0x24694a,null))[_0x3840('0x39')](handleError(_0x24694a,null));}; \ No newline at end of file +var _0xed5f=['sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xc8b6f8,_0x5dee27){var _0x265e99=function(_0x523b55){while(--_0x523b55){_0xc8b6f8['push'](_0xc8b6f8['shift']());}};_0x265e99(++_0x5dee27);}(_0xed5f,0x1e6));var _0xfed5=function(_0x40dc8c,_0x6fafa8){_0x40dc8c=_0x40dc8c-0x0;var _0x5a9d67=_0xed5f[_0x40dc8c];return _0x5a9d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfed5('0x0'));var zipdir=require(_0xfed5('0x1'));var jsonpatch=require(_0xfed5('0x2'));var rp=require('request-promise');var moment=require(_0xfed5('0x3'));var BPromise=require(_0xfed5('0x4'));var Mustache=require(_0xfed5('0x5'));var util=require(_0xfed5('0x6'));var path=require('path');var sox=require(_0xfed5('0x7'));var csv=require(_0xfed5('0x8'));var ejs=require(_0xfed5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfed5('0xa'));var squel=require(_0xfed5('0xb'));var crypto=require('crypto');var jsforce=require(_0xfed5('0xc'));var deskjs=require(_0xfed5('0xd'));var toCsv=require(_0xfed5('0x8'));var querystring=require(_0xfed5('0xe'));var Papa=require(_0xfed5('0xf'));var Redis=require(_0xfed5('0x10'));var authService=require(_0xfed5('0x11'));var qs=require(_0xfed5('0x12'));var as=require(_0xfed5('0x13'));var hardwareService=require(_0xfed5('0x14'));var logger=require(_0xfed5('0x15'))(_0xfed5('0x16'));var utils=require('../../config/utils');var config=require(_0xfed5('0x17'));var licenseUtil=require(_0xfed5('0x18'));var db=require(_0xfed5('0x19'))['db'];function respondWithStatusCode(_0x6a7e2f,_0x4c6029){_0x4c6029=_0x4c6029||0xcc;return function(_0x35d97e){if(_0x35d97e){return _0x6a7e2f[_0xfed5('0x1a')](_0x4c6029);}return _0x6a7e2f['status'](_0x4c6029)[_0xfed5('0x1b')]();};}function respondWithResult(_0x42063f,_0x1b0de2){_0x1b0de2=_0x1b0de2||0xc8;return function(_0x17de09){if(_0x17de09){return _0x42063f[_0xfed5('0x1c')](_0x1b0de2)['json'](_0x17de09);}};}function respondWithFilteredResult(_0x152cfa,_0x53a3ed){return function(_0x139426){if(_0x139426){var _0x5e3fcc=typeof _0x53a3ed[_0xfed5('0x1d')]===_0xfed5('0x1e')&&typeof _0x53a3ed[_0xfed5('0x1f')]===_0xfed5('0x1e');var _0x3a0656=_0x139426[_0xfed5('0x20')];var _0x35004e=_0x5e3fcc?0x0:_0x53a3ed[_0xfed5('0x1d')];var _0x46af07=_0x5e3fcc?_0x139426[_0xfed5('0x20')]:_0x53a3ed[_0xfed5('0x1d')]+_0x53a3ed[_0xfed5('0x1f')];var _0x38b535;if(_0x46af07>=_0x3a0656){_0x46af07=_0x3a0656;_0x38b535=0xc8;}else{_0x38b535=0xce;}_0x152cfa[_0xfed5('0x1c')](_0x38b535);return _0x152cfa['set'](_0xfed5('0x21'),_0x35004e+'-'+_0x46af07+'/'+_0x3a0656)['json'](_0x139426);}return null;};}function patchUpdates(_0x3eff4b){return function(_0x201f79){try{jsonpatch[_0xfed5('0x22')](_0x201f79,_0x3eff4b,!![]);}catch(_0x185b5f){return BPromise[_0xfed5('0x23')](_0x185b5f);}return _0x201f79[_0xfed5('0x24')]();};}function saveUpdates(_0x4e6075,_0x37b6c7){return function(_0x5ef2a7){if(_0x5ef2a7){return _0x5ef2a7['update'](_0x4e6075)[_0xfed5('0x25')](function(_0x5196e4){return _0x5196e4;});}return null;};}function removeEntity(_0x4d23cd,_0x2d2db5){return function(_0x2afcf9){if(_0x2afcf9){return _0x2afcf9[_0xfed5('0x26')]()['then'](function(){_0x4d23cd[_0xfed5('0x1c')](0xcc)[_0xfed5('0x1b')]();});}};}function handleEntityNotFound(_0x452160,_0x5c4fef){return function(_0x143de5){if(!_0x143de5){_0x452160[_0xfed5('0x1a')](0x194);}return _0x143de5;};}function handleError(_0x4e5919,_0x298d40){_0x298d40=_0x298d40||0x1f4;return function(_0x5d710b){logger[_0xfed5('0x27')](_0x5d710b[_0xfed5('0x28')]);if(_0x5d710b[_0xfed5('0x29')]){delete _0x5d710b[_0xfed5('0x29')];}_0x4e5919['status'](_0x298d40)[_0xfed5('0x2a')](_0x5d710b);};}exports[_0xfed5('0x2b')]=function(_0x50dae4,_0x2cde84){var _0xf20f21={'raw':!![],'where':{'id':_0x50dae4[_0xfed5('0x2c')]['id']}},_0x191426={};_0x191426[_0xfed5('0x2d')]=_[_0xfed5('0x2e')](db[_0xfed5('0x2f')][_0xfed5('0x30')]);_0x191426['query']=_['keys'](_0x50dae4[_0xfed5('0x31')]);_0x191426[_0xfed5('0x32')]=_['intersection'](_0x191426[_0xfed5('0x2d')],_0x191426[_0xfed5('0x31')]);_0xf20f21[_0xfed5('0x33')]=_[_0xfed5('0x34')](_0x191426['model'],qs[_0xfed5('0x35')](_0x50dae4[_0xfed5('0x31')]['fields']));_0xf20f21[_0xfed5('0x33')]=_0xf20f21['attributes'][_0xfed5('0x36')]?_0xf20f21[_0xfed5('0x33')]:_0x191426[_0xfed5('0x2d')];if(_0x50dae4[_0xfed5('0x31')][_0xfed5('0x37')]){_0xf20f21[_0xfed5('0x38')]=[{'all':!![]}];}_0xf20f21=_[_0xfed5('0x39')]({},_0xf20f21,_0x50dae4[_0xfed5('0x3a')]);return db[_0xfed5('0x2f')][_0xfed5('0x3b')](_0xf20f21)['then'](handleEntityNotFound(_0x2cde84,null))[_0xfed5('0x25')](respondWithResult(_0x2cde84,null))[_0xfed5('0x3c')](handleError(_0x2cde84,null));};exports[_0xfed5('0x3d')]=function(_0x1a7782,_0x5a15ec){return db[_0xfed5('0x2f')][_0xfed5('0x3d')](_0x1a7782[_0xfed5('0x3e')],{})[_0xfed5('0x25')](respondWithResult(_0x5a15ec,0xc9))[_0xfed5('0x3c')](handleError(_0x5a15ec,null));};exports[_0xfed5('0x3f')]=function(_0x1f870d,_0x3a9418){if(_0x1f870d[_0xfed5('0x3e')]['id']){delete _0x1f870d[_0xfed5('0x3e')]['id'];}return db[_0xfed5('0x2f')][_0xfed5('0x3b')]({'where':{'id':_0x1f870d[_0xfed5('0x2c')]['id']}})[_0xfed5('0x25')](handleEntityNotFound(_0x3a9418,null))['then'](saveUpdates(_0x1f870d[_0xfed5('0x3e')],null))[_0xfed5('0x25')](respondWithResult(_0x3a9418,null))['catch'](handleError(_0x3a9418,null));};exports[_0xfed5('0x26')]=function(_0x43659a,_0x3dffae){return db[_0xfed5('0x2f')][_0xfed5('0x3b')]({'where':{'id':_0x43659a['params']['id']}})[_0xfed5('0x25')](handleEntityNotFound(_0x3dffae,null))[_0xfed5('0x25')](removeEntity(_0x3dffae,null))[_0xfed5('0x3c')](handleError(_0x3dffae,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 4e34bbd..a559355 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 _0x357b=['api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x4d5a38,_0x4bf584){var _0x35ebf2=function(_0x4d6a9d){while(--_0x4d6a9d){_0x4d5a38['push'](_0x4d5a38['shift']());}};_0x35ebf2(++_0x4bf584);}(_0x357b,0x75));var _0xb357=function(_0x3192e0,_0x5a1bcc){_0x3192e0=_0x3192e0-0x0;var _0x44fc80=_0x357b[_0x3192e0];return _0x44fc80;};'use strict';var _=require(_0xb357('0x0'));var util=require(_0xb357('0x1'));var logger=require(_0xb357('0x2'))(_0xb357('0x3'));var moment=require(_0xb357('0x4'));var BPromise=require(_0xb357('0x5'));var rp=require(_0xb357('0x6'));var fs=require('fs');var path=require(_0xb357('0x7'));var rimraf=require(_0xb357('0x8'));var config=require('../../config/environment');var attributes=require(_0xb357('0x9'));module['exports']=function(_0x6aaaca,_0x4f6536){return _0x6aaaca['define'](_0xb357('0xa'),attributes,{'tableName':_0xb357('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb706=['../../config/environment','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x3d2a3c,_0x34aadf){var _0x47cd86=function(_0x5daa41){while(--_0x5daa41){_0x3d2a3c['push'](_0x3d2a3c['shift']());}};_0x47cd86(++_0x34aadf);}(_0xb706,0xbf));var _0x6b70=function(_0x24c96f,_0x18f322){_0x24c96f=_0x24c96f-0x0;var _0x53f104=_0xb706[_0x24c96f];return _0x53f104;};'use strict';var _=require(_0x6b70('0x0'));var util=require(_0x6b70('0x1'));var logger=require(_0x6b70('0x2'))(_0x6b70('0x3'));var moment=require('moment');var BPromise=require(_0x6b70('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b70('0x5'));var rimraf=require(_0x6b70('0x6'));var config=require(_0x6b70('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x6b70('0x8')]=function(_0x5a3ca2,_0x3d10e5){return _0x5a3ca2[_0x6b70('0x9')](_0x6b70('0xa'),attributes,{'tableName':'chat_proactive_actions','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 247aa13..a28f2f6 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 _0x24ef=['stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1a1b97,_0x335aeb){var _0x5971bd=function(_0x269afe){while(--_0x269afe){_0x1a1b97['push'](_0x1a1b97['shift']());}};_0x5971bd(++_0x335aeb);}(_0x24ef,0xdf));var _0xf24e=function(_0x3776dc,_0x55997c){_0x3776dc=_0x3776dc-0x0;var _0x1d3796=_0x24ef[_0x3776dc];return _0x1d3796;};'use strict';var _=require(_0xf24e('0x0'));var util=require('util');var moment=require(_0xf24e('0x1'));var BPromise=require(_0xf24e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf24e('0x3'));var db=require(_0xf24e('0x4'))['db'];var utils=require(_0xf24e('0x5'));var logger=require(_0xf24e('0x6'))(_0xf24e('0x7'));var config=require(_0xf24e('0x8'));var jayson=require(_0xf24e('0x9'));var client=jayson[_0xf24e('0xa')][_0xf24e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x335179,_0x45eb1b,_0x53a9ed){return new BPromise(function(_0x242f9a,_0x393fe4){return client[_0xf24e('0xc')](_0x335179,_0x53a9ed)[_0xf24e('0xd')](function(_0x38efcc){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x45eb1b,'request\x20sent');logger[_0xf24e('0xe')](_0xf24e('0xf'),_0x45eb1b,_0xf24e('0x10'),JSON[_0xf24e('0x11')](_0x38efcc));if(_0x38efcc[_0xf24e('0x12')]){if(_0x38efcc[_0xf24e('0x12')][_0xf24e('0x13')]===0x1f4){logger[_0xf24e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x45eb1b,_0x38efcc['error'][_0xf24e('0x14')]);return _0x393fe4(_0x38efcc[_0xf24e('0x12')][_0xf24e('0x14')]);}logger['error'](_0xf24e('0x15'),_0x45eb1b,_0x38efcc['error'][_0xf24e('0x14')]);return _0x242f9a(_0x38efcc['error'][_0xf24e('0x14')]);}else{logger['info'](_0xf24e('0x15'),_0x45eb1b,_0xf24e('0x10'));_0x242f9a(_0x38efcc[_0xf24e('0x16')]['message']);}})[_0xf24e('0x17')](function(_0x2c68e2){logger[_0xf24e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x45eb1b,_0x2c68e2);_0x393fe4(_0x2c68e2);});});} \ No newline at end of file +var _0x0ec8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1683d2,_0x267182){var _0x11e8ab=function(_0x2c956f){while(--_0x2c956f){_0x1683d2['push'](_0x1683d2['shift']());}};_0x11e8ab(++_0x267182);}(_0x0ec8,0xc3));var _0x80ec=function(_0x5d0f1f,_0x4bd35b){_0x5d0f1f=_0x5d0f1f-0x0;var _0x4320b9=_0x0ec8[_0x5d0f1f];return _0x4320b9;};'use strict';var _=require(_0x80ec('0x0'));var util=require('util');var moment=require(_0x80ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x80ec('0x2'));var fs=require('fs');var Redis=require(_0x80ec('0x3'));var db=require(_0x80ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ec('0x5'))(_0x80ec('0x6'));var config=require(_0x80ec('0x7'));var jayson=require(_0x80ec('0x8'));var client=jayson[_0x80ec('0x9')][_0x80ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214715,_0x4f9020,_0xbffca2){return new BPromise(function(_0x255ea5,_0x47bc45){return client[_0x80ec('0xb')](_0x214715,_0xbffca2)[_0x80ec('0xc')](function(_0x8188e8){logger[_0x80ec('0xd')](_0x80ec('0xe'),_0x4f9020,_0x80ec('0xf'));logger['debug'](_0x80ec('0x10'),_0x4f9020,_0x80ec('0xf'),JSON['stringify'](_0x8188e8));if(_0x8188e8[_0x80ec('0x11')]){if(_0x8188e8[_0x80ec('0x11')]['code']===0x1f4){logger[_0x80ec('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f9020,_0x8188e8[_0x80ec('0x11')][_0x80ec('0x12')]);return _0x47bc45(_0x8188e8[_0x80ec('0x11')][_0x80ec('0x12')]);}logger['error'](_0x80ec('0xe'),_0x4f9020,_0x8188e8[_0x80ec('0x11')]['message']);return _0x255ea5(_0x8188e8[_0x80ec('0x11')]['message']);}else{logger[_0x80ec('0xd')](_0x80ec('0xe'),_0x4f9020,_0x80ec('0xf'));_0x255ea5(_0x8188e8['result']['message']);}})[_0x80ec('0x13')](function(_0xd9efae){logger['error'](_0x80ec('0xe'),_0x4f9020,_0xd9efae);_0x47bc45(_0xd9efae);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 3511d54..179e8d2 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x17bb54,_0x2aa6fa){var _0x443d6e=function(_0x4acb61){while(--_0x4acb61){_0x17bb54['push'](_0x17bb54['shift']());}};_0x443d6e(++_0x2aa6fa);}(_0xd8fb,0x99));var _0xbd8f=function(_0x31db39,_0x486d0a){_0x31db39=_0x31db39-0x0;var _0x48aedf=_0xd8fb[_0x31db39];return _0x48aedf;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file +var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c8f89,_0x318d19){var _0x5c5685=function(_0x28ea15){while(--_0x28ea15){_0x4c8f89['push'](_0x4c8f89['shift']());}};_0x5c5685(++_0x318d19);}(_0xed1f,0x6a));var _0xfed1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xed1f[_0x12f688];return _0x59c3de;};'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')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);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 dfd0349..53cc9ff 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 _0x7dcc=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3c8e52,_0x3f5c2c){var _0x50bd04=function(_0x27bd4c){while(--_0x27bd4c){_0x3c8e52['push'](_0x3c8e52['shift']());}};_0x50bd04(++_0x3f5c2c);}(_0x7dcc,0x179));var _0xc7dc=function(_0x1121b1,_0x4e40f2){_0x1121b1=_0x1121b1-0x0;var _0x5bf648=_0x7dcc[_0x1121b1];return _0x5bf648;};'use strict';var Sequelize=require(_0xc7dc('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7dc('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc7dc('0x1')]},'timeout':{'type':Sequelize[_0xc7dc('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc7dc('0x3'),_0xc7dc('0x4'),_0xc7dc('0x5'))}}; \ No newline at end of file +var _0x5c74=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5c74,0x185));var _0x45c7=function(_0x502f46,_0x150d69){_0x502f46=_0x502f46-0x0;var _0x250370=_0x5c74[_0x502f46];return _0x250370;};'use strict';var Sequelize=require(_0x45c7('0x0'));module[_0x45c7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x45c7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x45c7('0x3')]},'timeout':{'type':Sequelize[_0x45c7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x45c7('0x5')](_0x45c7('0x6'),_0x45c7('0x7'),_0x45c7('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5697b3c..b29a3e8 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 _0x1b0a=['sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','omit','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','apply','reject','update','get','UserProfileResource','destroy','then','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','User','UserId','agent','chatPause','format','%s/%s','SIP','createdAt','updatedAt','findOne','getTeams','ids','Team','Agents','voicePause','interface','findOrCreate','forEach','userChatQueue:save','removeTeams','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push'];(function(_0x1b036b,_0x35e11e){var _0x21ce6=function(_0x20e92b){while(--_0x20e92b){_0x1b036b['push'](_0x1b036b['shift']());}};_0x21ce6(++_0x35e11e);}(_0x1b0a,0x1ca));var _0xa1b0=function(_0x5818fe,_0x22e8a5){_0x5818fe=_0x5818fe-0x0;var _0x42e419=_0x1b0a[_0x5818fe];return _0x42e419;};'use strict';var emlformat=require(_0xa1b0('0x0'));var rimraf=require(_0xa1b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1b0('0x2'));var rp=require(_0xa1b0('0x3'));var moment=require(_0xa1b0('0x4'));var BPromise=require(_0xa1b0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa1b0('0x6'));var csv=require(_0xa1b0('0x7'));var ejs=require(_0xa1b0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1b0('0x9'));var squel=require(_0xa1b0('0xa'));var crypto=require('crypto');var jsforce=require(_0xa1b0('0xb'));var deskjs=require(_0xa1b0('0xc'));var toCsv=require(_0xa1b0('0x7'));var querystring=require('querystring');var Papa=require(_0xa1b0('0xd'));var Redis=require(_0xa1b0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa1b0('0xf'));var as=require(_0xa1b0('0x10'));var hardwareService=require(_0xa1b0('0x11'));var logger=require(_0xa1b0('0x12'))('api');var utils=require(_0xa1b0('0x13'));var config=require(_0xa1b0('0x14'));var licenseUtil=require(_0xa1b0('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa1b0('0x16')],{'host':_0xa1b0('0x17'),'port':0x18eb});var socket=require(_0xa1b0('0x18'))(new Redis(config[_0xa1b0('0x16')]));require(_0xa1b0('0x19'))[_0xa1b0('0x1a')](socket);var jayson=require(_0xa1b0('0x1b'));var client=jayson[_0xa1b0('0x1c')][_0xa1b0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x40b170,_0x523c56,_0x4b064c,_0x217a19){return new BPromise(function(_0x403883,_0x592fc9){var _0x1a8112=_0x217a19||client;return _0x1a8112[_0xa1b0('0x1e')](_0x40b170,_0x4b064c)['then'](function(_0x421085){logger[_0xa1b0('0x1f')](_0xa1b0('0x20'),_0x523c56,_0xa1b0('0x21'));logger[_0xa1b0('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x523c56,_0xa1b0('0x21'),JSON[_0xa1b0('0x23')](_0x421085));if(_0x421085[_0xa1b0('0x24')]){if(_0x421085[_0xa1b0('0x24')][_0xa1b0('0x25')]===0x1f4){logger['error'](_0xa1b0('0x20'),_0x523c56,_0x421085['error'][_0xa1b0('0x26')]);return _0x592fc9(_0x421085[_0xa1b0('0x24')][_0xa1b0('0x26')]);}logger[_0xa1b0('0x24')](_0xa1b0('0x20'),_0x523c56,_0x421085[_0xa1b0('0x24')][_0xa1b0('0x26')]);return _0x403883(_0x421085[_0xa1b0('0x24')]['message']);}else{logger[_0xa1b0('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x523c56,_0xa1b0('0x21'));_0x403883(_0x421085[_0xa1b0('0x27')][_0xa1b0('0x26')]);}})[_0xa1b0('0x28')](function(_0x1fd0c5){logger[_0xa1b0('0x24')]('ChatQueue,\x20%s,\x20%s',_0x523c56,_0x1fd0c5);_0x592fc9(_0x1fd0c5);});});}function respondWithStatusCode(_0x1fdbe8,_0x325a61){_0x325a61=_0x325a61||0xcc;return function(_0x328df3){if(_0x328df3){return _0x1fdbe8[_0xa1b0('0x29')](_0x325a61);}return _0x1fdbe8['status'](_0x325a61)[_0xa1b0('0x2a')]();};}function respondWithResult(_0x5b78e8,_0x5a43b5){_0x5a43b5=_0x5a43b5||0xc8;return function(_0x3b07b4){if(_0x3b07b4){return _0x5b78e8[_0xa1b0('0x2b')](_0x5a43b5)[_0xa1b0('0x2c')](_0x3b07b4);}};}function respondWithFilteredResult(_0x3e4925,_0x3ccfd8){return function(_0x4f330b){if(_0x4f330b){var _0x59842d=typeof _0x3ccfd8['offset']===_0xa1b0('0x2d')&&typeof _0x3ccfd8[_0xa1b0('0x2e')]==='undefined';var _0x2a233c=_0x4f330b[_0xa1b0('0x2f')];var _0x162c9a=_0x59842d?0x0:_0x3ccfd8['offset'];var _0x531a9c=_0x59842d?_0x4f330b[_0xa1b0('0x2f')]:_0x3ccfd8[_0xa1b0('0x30')]+_0x3ccfd8['limit'];var _0x4210c5;if(_0x531a9c>=_0x2a233c){_0x531a9c=_0x2a233c;_0x4210c5=0xc8;}else{_0x4210c5=0xce;}_0x3e4925[_0xa1b0('0x2b')](_0x4210c5);return _0x3e4925['set']('Content-Range',_0x162c9a+'-'+_0x531a9c+'/'+_0x2a233c)[_0xa1b0('0x2c')](_0x4f330b);}return null;};}function patchUpdates(_0x1a065b){return function(_0x4131b6){try{jsonpatch[_0xa1b0('0x31')](_0x4131b6,_0x1a065b,!![]);}catch(_0x40be92){return BPromise[_0xa1b0('0x32')](_0x40be92);}return _0x4131b6['save']();};}function saveUpdates(_0xd5a543,_0x598058){return function(_0x1f467c){if(_0x1f467c){return _0x1f467c[_0xa1b0('0x33')](_0xd5a543)['then'](function(_0x5ed149){return _0x5ed149;});}return null;};}function removeEntity(_0x3fe002,_0x4512b5){return function(_0x21f504){if(_0x21f504){return _0x21f504['destroy']()['then'](function(){var _0x1b1d0e=_0x21f504[_0xa1b0('0x34')]({'plain':!![]});var _0x26b37e='ChatQueues';return db[_0xa1b0('0x35')][_0xa1b0('0x36')]({'where':{'type':_0x26b37e,'resourceId':_0x1b1d0e['id']}})[_0xa1b0('0x37')](function(){return _0x21f504;});})['then'](function(){_0x3fe002['status'](0xcc)[_0xa1b0('0x2a')]();});}};}function handleEntityNotFound(_0x2f6880,_0x2e2185){return function(_0xcffd9e){if(!_0xcffd9e){_0x2f6880[_0xa1b0('0x29')](0x194);}return _0xcffd9e;};}function handleError(_0x26e05a,_0x410ea7){_0x410ea7=_0x410ea7||0x1f4;return function(_0x4bb492){logger[_0xa1b0('0x24')](_0x4bb492['stack']);if(_0x4bb492['name']){delete _0x4bb492['name'];}_0x26e05a[_0xa1b0('0x2b')](_0x410ea7)[_0xa1b0('0x38')](_0x4bb492);};}exports[_0xa1b0('0x39')]=function(_0x3f4eea,_0x22e243){var _0x49355b={},_0x476c8c={},_0xfbac88={'count':0x0,'rows':[]};var _0x3148bb=_['map'](db[_0xa1b0('0x3a')][_0xa1b0('0x3b')],function(_0x35026c){return{'name':_0x35026c[_0xa1b0('0x3c')],'type':_0x35026c[_0xa1b0('0x3d')][_0xa1b0('0x3e')]};});_0x476c8c[_0xa1b0('0x3f')]=_[_0xa1b0('0x40')](_0x3148bb,_0xa1b0('0x41'));_0x476c8c[_0xa1b0('0x42')]=_['keys'](_0x3f4eea[_0xa1b0('0x42')]);_0x476c8c[_0xa1b0('0x43')]=_[_0xa1b0('0x44')](_0x476c8c['model'],_0x476c8c[_0xa1b0('0x42')]);_0x49355b[_0xa1b0('0x45')]=_['intersection'](_0x476c8c[_0xa1b0('0x3f')],qs[_0xa1b0('0x46')](_0x3f4eea[_0xa1b0('0x42')][_0xa1b0('0x46')]));_0x49355b[_0xa1b0('0x45')]=_0x49355b[_0xa1b0('0x45')][_0xa1b0('0x47')]?_0x49355b[_0xa1b0('0x45')]:_0x476c8c[_0xa1b0('0x3f')];if(!_0x3f4eea['query'][_0xa1b0('0x48')](_0xa1b0('0x49'))){_0x49355b[_0xa1b0('0x2e')]=qs[_0xa1b0('0x2e')](_0x3f4eea[_0xa1b0('0x42')]['limit']);_0x49355b[_0xa1b0('0x30')]=qs[_0xa1b0('0x30')](_0x3f4eea['query'][_0xa1b0('0x30')]);}_0x49355b[_0xa1b0('0x4a')]=qs[_0xa1b0('0x4b')](_0x3f4eea[_0xa1b0('0x42')][_0xa1b0('0x4b')]);_0x49355b['where']=qs['filters'](_[_0xa1b0('0x4c')](_0x3f4eea[_0xa1b0('0x42')],_0x476c8c[_0xa1b0('0x43')]),_0x3148bb);if(_0x3f4eea[_0xa1b0('0x42')][_0xa1b0('0x4d')]){_0x49355b[_0xa1b0('0x4e')]=_[_0xa1b0('0x4f')](_0x49355b['where'],{'$or':_[_0xa1b0('0x40')](_0x3148bb,function(_0x4d7a91){if(_0x4d7a91[_0xa1b0('0x3d')]!==_0xa1b0('0x50')){var _0x23a54d={};_0x23a54d[_0x4d7a91[_0xa1b0('0x41')]]={'$like':'%'+_0x3f4eea[_0xa1b0('0x42')]['filter']+'%'};return _0x23a54d;}})});}_0x49355b=_[_0xa1b0('0x4f')]({},_0x49355b,_0x3f4eea[_0xa1b0('0x51')]);var _0x48d1b8={'where':_0x49355b[_0xa1b0('0x4e')]};return db[_0xa1b0('0x3a')]['count'](_0x48d1b8)[_0xa1b0('0x37')](function(_0x4fe005){_0xfbac88[_0xa1b0('0x2f')]=_0x4fe005;if(_0x3f4eea[_0xa1b0('0x42')][_0xa1b0('0x52')]){_0x49355b[_0xa1b0('0x53')]=[{'all':!![]}];}return db[_0xa1b0('0x3a')][_0xa1b0('0x54')](_0x49355b);})[_0xa1b0('0x37')](function(_0x58bb22){_0xfbac88[_0xa1b0('0x55')]=_0x58bb22;return _0xfbac88;})[_0xa1b0('0x37')](respondWithFilteredResult(_0x22e243,_0x49355b))[_0xa1b0('0x28')](handleError(_0x22e243,null));};exports[_0xa1b0('0x56')]=function(_0x415d5b,_0x58ba50){var _0x4e2d22={'raw':!![],'where':{'id':_0x415d5b[_0xa1b0('0x57')]['id']}},_0x539ba9={};_0x539ba9['model']=_['keys'](db[_0xa1b0('0x3a')][_0xa1b0('0x3b')]);_0x539ba9[_0xa1b0('0x42')]=_[_0xa1b0('0x58')](_0x415d5b[_0xa1b0('0x42')]);_0x539ba9[_0xa1b0('0x43')]=_[_0xa1b0('0x44')](_0x539ba9['model'],_0x539ba9[_0xa1b0('0x42')]);_0x4e2d22[_0xa1b0('0x45')]=_[_0xa1b0('0x44')](_0x539ba9[_0xa1b0('0x3f')],qs['fields'](_0x415d5b[_0xa1b0('0x42')]['fields']));_0x4e2d22[_0xa1b0('0x45')]=_0x4e2d22[_0xa1b0('0x45')]['length']?_0x4e2d22[_0xa1b0('0x45')]:_0x539ba9[_0xa1b0('0x3f')];if(_0x415d5b[_0xa1b0('0x42')][_0xa1b0('0x52')]){_0x4e2d22['include']=[{'all':!![]}];}_0x4e2d22=_[_0xa1b0('0x4f')]({},_0x4e2d22,_0x415d5b['options']);return db['ChatQueue'][_0xa1b0('0x59')](_0x4e2d22)[_0xa1b0('0x37')](handleEntityNotFound(_0x58ba50,null))['then'](respondWithResult(_0x58ba50,null))[_0xa1b0('0x28')](handleError(_0x58ba50,null));};exports[_0xa1b0('0x5a')]=function(_0x285f84,_0x58e49d){return db['ChatQueue']['create'](_0x285f84[_0xa1b0('0x5b')],{})['then'](function(_0x3fc4c2){var _0x106759=_0x285f84['user'][_0xa1b0('0x34')]({'plain':!![]});if(!_0x106759)throw new Error(_0xa1b0('0x5c'));if(_0x106759[_0xa1b0('0x5d')]===_0xa1b0('0x5e')){var _0xbda4f9=_0x3fc4c2[_0xa1b0('0x34')]({'plain':!![]});var _0x33978c=_0xa1b0('0x5f');return db[_0xa1b0('0x60')][_0xa1b0('0x59')]({'where':{'name':_0x33978c,'userProfileId':_0x106759[_0xa1b0('0x61')]},'raw':!![]})[_0xa1b0('0x37')](function(_0x4bf082){if(_0x4bf082&&_0x4bf082[_0xa1b0('0x62')]===0x0){return db[_0xa1b0('0x35')][_0xa1b0('0x5a')]({'name':_0xbda4f9[_0xa1b0('0x41')],'resourceId':_0xbda4f9['id'],'type':_0x4bf082[_0xa1b0('0x41')],'sectionId':_0x4bf082['id']},{})['then'](function(){return _0x3fc4c2;});}else{return _0x3fc4c2;}})[_0xa1b0('0x28')](function(_0x16f504){logger[_0xa1b0('0x24')](_0xa1b0('0x63'),_0x16f504);throw _0x16f504;});}return _0x3fc4c2;})[_0xa1b0('0x37')](respondWithResult(_0x58e49d,0xc9))[_0xa1b0('0x28')](handleError(_0x58e49d,null));};exports[_0xa1b0('0x33')]=function(_0x47a801,_0x22e686){if(_0x47a801['body']['id']){delete _0x47a801[_0xa1b0('0x5b')]['id'];}return db[_0xa1b0('0x3a')][_0xa1b0('0x59')]({'where':{'id':_0x47a801[_0xa1b0('0x57')]['id']}})[_0xa1b0('0x37')](handleEntityNotFound(_0x22e686,null))[_0xa1b0('0x37')](saveUpdates(_0x47a801[_0xa1b0('0x5b')],null))[_0xa1b0('0x37')](respondWithResult(_0x22e686,null))['catch'](handleError(_0x22e686,null));};exports[_0xa1b0('0x36')]=function(_0x48facd,_0x2a386a){return db['ChatQueue'][_0xa1b0('0x59')]({'where':{'id':_0x48facd[_0xa1b0('0x57')]['id']}})[_0xa1b0('0x37')](handleEntityNotFound(_0x2a386a,null))[_0xa1b0('0x37')](removeEntity(_0x2a386a,null))[_0xa1b0('0x28')](handleError(_0x2a386a,null));};exports[_0xa1b0('0x64')]=function(_0x1031fb,_0x32357f){return db['ChatQueue'][_0xa1b0('0x64')]()[_0xa1b0('0x37')](respondWithResult(_0x32357f,null))[_0xa1b0('0x28')](handleError(_0x32357f,null));};exports[_0xa1b0('0x65')]=function(_0x38ca83,_0x58d1e3,_0x68a44a){var _0x1155eb={'raw':!![],'where':{}},_0x541460={},_0xaee7f5;return db[_0xa1b0('0x3a')]['findOne']({'where':{'id':_0x38ca83[_0xa1b0('0x57')]['id']}})[_0xa1b0('0x37')](handleEntityNotFound(_0x58d1e3,null))[_0xa1b0('0x37')](function(_0x1cd900){if(_0x1cd900){_0xaee7f5=_0x1cd900['get']({'plain':!![]});_0x541460[_0xa1b0('0x3f')]=_['keys'](db[_0xa1b0('0x66')]['rawAttributes']);_0x541460[_0xa1b0('0x42')]=_['keys'](_0x38ca83[_0xa1b0('0x42')]);_0x541460['filters']=_['intersection'](_0x541460[_0xa1b0('0x3f')],_0x541460[_0xa1b0('0x42')]);_0x1155eb[_0xa1b0('0x45')]=_['intersection'](_0x541460[_0xa1b0('0x3f')],qs[_0xa1b0('0x46')](_0x38ca83[_0xa1b0('0x42')]['fields']));_0x1155eb['attributes']=_0x1155eb[_0xa1b0('0x45')]['length']?_0x1155eb[_0xa1b0('0x45')]:_0x541460[_0xa1b0('0x3f')];if(!_0x38ca83['query'][_0xa1b0('0x48')](_0xa1b0('0x49'))){_0x1155eb[_0xa1b0('0x2e')]=qs[_0xa1b0('0x2e')](_0x38ca83['query']['limit']);_0x1155eb[_0xa1b0('0x30')]=qs[_0xa1b0('0x30')](_0x38ca83[_0xa1b0('0x42')][_0xa1b0('0x30')]);}_0x1155eb[_0xa1b0('0x4a')]=qs[_0xa1b0('0x4b')](_0x38ca83[_0xa1b0('0x42')][_0xa1b0('0x4b')]);_0x1155eb['where']=qs[_0xa1b0('0x43')](_[_0xa1b0('0x4c')](_0x38ca83['query'],_0x541460[_0xa1b0('0x43')]));_0x1155eb['where'][_0xa1b0('0x67')]=_0x1cd900['id'];if(_0x38ca83[_0xa1b0('0x42')][_0xa1b0('0x4d')]){_0x1155eb[_0xa1b0('0x4e')]=_['merge'](_0x1155eb[_0xa1b0('0x4e')],{'$or':_[_0xa1b0('0x40')](_0x1155eb[_0xa1b0('0x45')],function(_0x57d8e1){var _0x2f9483={};_0x2f9483[_0x57d8e1]={'$like':'%'+_0x38ca83['query'][_0xa1b0('0x4d')]+'%'};return _0x2f9483;})});}_0x1155eb=_[_0xa1b0('0x4f')]({},_0x1155eb,_0x38ca83['options']);return db[_0xa1b0('0x66')][_0xa1b0('0x54')](_0x1155eb);}})['then'](function(_0x3ad24c){if(_0x3ad24c){return db[_0xa1b0('0x68')]['findAndCountAll']({'where':{'id':_[_0xa1b0('0x40')](_0x3ad24c,_0xa1b0('0x69')),'role':_0xa1b0('0x6a')},'attributes':['id',_0xa1b0('0x41'),_0xa1b0('0x6b'),'updatedAt','createdAt']});}})['then'](function(_0x2f1ef7){if(_0x2f1ef7){return{'count':_0x2f1ef7[_0xa1b0('0x2f')],'rows':_[_0xa1b0('0x40')](_0x2f1ef7[_0xa1b0('0x55')],function(_0x5bb5bc){return{'membername':_0x5bb5bc[_0xa1b0('0x41')],'UserId':_0x5bb5bc['id'],'queue_name':_0xaee7f5[_0xa1b0('0x41')],'ChatQueueId':_0xaee7f5['id'],'interface':util[_0xa1b0('0x6c')](_0xa1b0('0x6d'),_0xa1b0('0x6e'),_0x5bb5bc[_0xa1b0('0x41')]),'penalty':0x0,'paused':_0x5bb5bc[_0xa1b0('0x6b')],'createdAt':_0x5bb5bc[_0xa1b0('0x6f')],'updatedAt':_0x5bb5bc[_0xa1b0('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa1b0('0x37')](respondWithFilteredResult(_0x58d1e3,_0x1155eb))[_0xa1b0('0x28')](handleError(_0x58d1e3,null));};exports['getTeams']=function(_0xafcb3e,_0x11fa59,_0x124d17){var _0x1da09c={};var _0x1dee0f={};var _0x16ce43;var _0x588f7f;return db[_0xa1b0('0x3a')][_0xa1b0('0x71')]({'where':{'id':_0xafcb3e[_0xa1b0('0x57')]['id']}})['then'](handleEntityNotFound(_0x11fa59,null))['then'](function(_0x678630){if(_0x678630){_0x16ce43=_0x678630;_0x1dee0f[_0xa1b0('0x3f')]=_[_0xa1b0('0x58')](db['Team'][_0xa1b0('0x3b')]);_0x1dee0f[_0xa1b0('0x42')]=_[_0xa1b0('0x58')](_0xafcb3e['query']);_0x1dee0f[_0xa1b0('0x43')]=_['intersection'](_0x1dee0f['model'],_0x1dee0f['query']);_0x1da09c[_0xa1b0('0x45')]=_[_0xa1b0('0x44')](_0x1dee0f[_0xa1b0('0x3f')],qs[_0xa1b0('0x46')](_0xafcb3e['query']['fields']));_0x1da09c['attributes']=_0x1da09c[_0xa1b0('0x45')]['length']?_0x1da09c[_0xa1b0('0x45')]:_0x1dee0f[_0xa1b0('0x3f')];_0x1da09c[_0xa1b0('0x4a')]=qs['sort'](_0xafcb3e[_0xa1b0('0x42')][_0xa1b0('0x4b')]);_0x1da09c[_0xa1b0('0x4e')]=qs[_0xa1b0('0x43')](_[_0xa1b0('0x4c')](_0xafcb3e[_0xa1b0('0x42')],_0x1dee0f[_0xa1b0('0x43')]));if(_0xafcb3e[_0xa1b0('0x42')]['filter']){_0x1da09c[_0xa1b0('0x4e')]=_[_0xa1b0('0x4f')](_0x1da09c['where'],{'$or':_['map'](_0x1da09c[_0xa1b0('0x45')],function(_0x467795){var _0x203ec7={};_0x203ec7[_0x467795]={'$like':'%'+_0xafcb3e['query'][_0xa1b0('0x4d')]+'%'};return _0x203ec7;})});}_0x1da09c=_['merge']({},_0x1da09c,_0xafcb3e[_0xa1b0('0x51')]);return _0x16ce43[_0xa1b0('0x72')](_0x1da09c);}})[_0xa1b0('0x37')](function(_0x57be2a){if(_0x57be2a){_0x588f7f=_0x57be2a['length'];if(!_0xafcb3e[_0xa1b0('0x42')][_0xa1b0('0x48')]('nolimit')){_0x1da09c[_0xa1b0('0x2e')]=qs['limit'](_0xafcb3e['query'][_0xa1b0('0x2e')]);_0x1da09c['offset']=qs[_0xa1b0('0x30')](_0xafcb3e[_0xa1b0('0x42')][_0xa1b0('0x30')]);}return _0x16ce43['getTeams'](_0x1da09c);}})[_0xa1b0('0x37')](function(_0x1f7879){if(_0x1f7879){return _0x1f7879?{'count':_0x588f7f,'rows':_0x1f7879}:null;}})[_0xa1b0('0x37')](respondWithResult(_0x11fa59,null))['catch'](handleError(_0x11fa59,null));};exports['addTeams']=function(_0x1b7361,_0x4a5188,_0x25344e){var _0x5148d4=_0x1b7361[_0xa1b0('0x5b')][_0xa1b0('0x73')];return db[_0xa1b0('0x74')][_0xa1b0('0x54')]({'where':{'id':_0x5148d4},'attributes':['id'],'include':[{'model':db[_0xa1b0('0x68')],'as':_0xa1b0('0x75'),'attributes':['id',_0xa1b0('0x41'),'online',_0xa1b0('0x76'),_0xa1b0('0x77')],'raw':!![]}]})['then'](function(_0x15fc51){if(_0x15fc51){var _0x48f554=_['flatMap'](_0x15fc51,function(_0x31c369){var _0x24d9e0=_0x31c369[_0xa1b0('0x34')]({'plain':!![]});return _0x24d9e0[_0xa1b0('0x75')];});return db[_0xa1b0('0x3a')]['find']({'where':{'id':_0x1b7361['params']['id']}})[_0xa1b0('0x37')](function(_0x1c49a7){return db['sequelize']['transaction'](function(_0x513f29){return _0x1c49a7['addTeams'](_0x5148d4,{'transaction':_0x513f29})[_0xa1b0('0x37')](function(){return BPromise['each'](_0x48f554,function(_0xe084dc){return db[_0xa1b0('0x66')][_0xa1b0('0x78')]({'where':{'UserId':_0xe084dc['id'],'ChatQueueId':_0x1b7361[_0xa1b0('0x57')]['id']},'transaction':_0x513f29});});})[_0xa1b0('0x37')](function(){_0x48f554[_0xa1b0('0x79')](function(_0x8768c5){socket['emit'](_0xa1b0('0x7a'),{'UserId':_0x8768c5['id'],'ChatQueueId':_0x1c49a7['id']});});});});});}})[_0xa1b0('0x37')](respondWithStatusCode(_0x4a5188,null))['catch'](handleError(_0x4a5188,null));};exports[_0xa1b0('0x7b')]=function(_0x3c5231,_0x584b61,_0x353423){return db[_0xa1b0('0x74')][_0xa1b0('0x54')]({'where':{'id':_0x3c5231[_0xa1b0('0x42')][_0xa1b0('0x73')]},'attributes':['id'],'include':[{'model':db[_0xa1b0('0x68')],'as':_0xa1b0('0x75'),'attributes':['id'],'raw':!![]}]})[_0xa1b0('0x37')](handleEntityNotFound(_0x584b61,null))['then'](function(_0x532776){var _0x23fad8=_[_0xa1b0('0x40')](_0x532776,'id');var _0x261aa7=[];var _0xf948db=[];var _0x79d305=squel['select']();_0x79d305['field']('tq.TeamId')['from']('team_has_chat_queues','tq')[_0xa1b0('0x7c')](_0xa1b0('0x7d'),'ut',_0xa1b0('0x7e'))['where']('ChatQueueId\x20=\x20?',_0x3c5231[_0xa1b0('0x57')]['id']);for(var _0x432ee3=0x0;_0x432ee3<_0x532776[_0xa1b0('0x47')];_0x432ee3+=0x1){let _0xbed4be=_0x532776[_0x432ee3];for(var _0x5bb19b=0x0;_0x5bb19b<_0xbed4be['Agents'][_0xa1b0('0x47')];_0x5bb19b+=0x1){let _0x139234=_0xbed4be[_0xa1b0('0x75')][_0x5bb19b];var _0x1fa21f=_0x79d305[_0xa1b0('0x7f')]();_0x1fa21f[_0xa1b0('0x4e')](_0xa1b0('0x80'),_0x139234['id']);_0xf948db[_0xa1b0('0x81')](db[_0xa1b0('0x82')]['query'](_0x1fa21f[_0xa1b0('0x83')](),{'type':db[_0xa1b0('0x82')][_0xa1b0('0x84')][_0xa1b0('0x85')]})[_0xa1b0('0x37')](function(_0x4b3ccf){if(_0x4b3ccf[_0xa1b0('0x47')]===0x1){return _0x139234['id'];}else{var _0x29889c=_[_0xa1b0('0x86')](_[_0xa1b0('0x40')](_0x4b3ccf,'TeamId'),function(_0x24d41b){return _[_0xa1b0('0x87')](_0x23fad8,_0x24d41b);});if(_0x29889c){return _0x139234['id'];}}}));}}return BPromise[_0xa1b0('0x88')](_0xf948db)['then'](function(_0x63f661){_0x261aa7=_(_0x261aa7)[_0xa1b0('0x89')](_0x63f661)[_0xa1b0('0x8a')]()[_0xa1b0('0x8b')]();return db[_0xa1b0('0x3a')][_0xa1b0('0x59')]({'where':{'id':_0x3c5231['params']['id']}})[_0xa1b0('0x37')](function(_0x147ac5){return db[_0xa1b0('0x82')][_0xa1b0('0x8c')](function(_0x1cdf3d){return _0x147ac5['removeTeams'](_0x3c5231[_0xa1b0('0x42')][_0xa1b0('0x73')],{'transaction':_0x1cdf3d})['then'](function(){if(!_[_0xa1b0('0x8d')](_0x261aa7)){return _0x147ac5[_0xa1b0('0x8e')](_0x261aa7,{'transaction':_0x1cdf3d});}})[_0xa1b0('0x37')](function(){_0x261aa7[_0xa1b0('0x79')](function(_0x5902fc){socket[_0xa1b0('0x8f')]('userChatQueue:remove',{'UserId':_0x5902fc,'ChatQueueId':_0x147ac5['id']});});});});});});})[_0xa1b0('0x37')](respondWithStatusCode(_0x584b61,null))['catch'](handleError(_0x584b61,null));};exports['addAgents']=function(_0x5014e9,_0x4bf412,_0x3ab3c4){return db[_0xa1b0('0x3a')][_0xa1b0('0x59')]({'where':{'id':_0x5014e9[_0xa1b0('0x57')]['id']}})[_0xa1b0('0x37')](handleEntityNotFound(_0x4bf412,null))[_0xa1b0('0x37')](function(_0x3f29c3){if(_0x3f29c3){return _0x3f29c3['addAgents'](_0x5014e9[_0xa1b0('0x5b')][_0xa1b0('0x73')],_[_0xa1b0('0x90')](_0x5014e9['body'],[_0xa1b0('0x73'),'id'])||{})['spread'](function(_0x21d459){for(var _0xcd0638=0x0;_0xcd0638<_0x5014e9[_0xa1b0('0x5b')]['ids']['length'];_0xcd0638+=0x1){socket[_0xa1b0('0x8f')](_0xa1b0('0x7a'),{'UserId':Number(_0x5014e9[_0xa1b0('0x5b')][_0xa1b0('0x73')][_0xcd0638]),'ChatQueueId':Number(_0x5014e9[_0xa1b0('0x57')]['id'])});}return _0x21d459;});}})[_0xa1b0('0x37')](respondWithResult(_0x4bf412,null))[_0xa1b0('0x28')](handleError(_0x4bf412,null));};exports[_0xa1b0('0x8e')]=function(_0x50ed07,_0x1e6bee,_0xdc4ef1){return db[_0xa1b0('0x3a')][_0xa1b0('0x59')]({'where':{'id':_0x50ed07['params']['id']}})['then'](handleEntityNotFound(_0x1e6bee,null))[_0xa1b0('0x37')](function(_0x5ed9bb){if(_0x5ed9bb){return _0x5ed9bb[_0xa1b0('0x8e')](_0x50ed07[_0xa1b0('0x42')][_0xa1b0('0x73')])[_0xa1b0('0x37')](function(){if(_['isArray'](_0x50ed07[_0xa1b0('0x42')][_0xa1b0('0x73')])){for(var _0x10bf6d=0x0;_0x10bf6d<_0x50ed07['query'][_0xa1b0('0x73')][_0xa1b0('0x47')];_0x10bf6d+=0x1){socket[_0xa1b0('0x8f')](_0xa1b0('0x91'),{'UserId':Number(_0x50ed07[_0xa1b0('0x42')][_0xa1b0('0x73')][_0x10bf6d]),'ChatQueueId':Number(_0x50ed07[_0xa1b0('0x57')]['id'])});}}else{socket[_0xa1b0('0x8f')](_0xa1b0('0x91'),{'UserId':Number(_0x50ed07[_0xa1b0('0x42')][_0xa1b0('0x73')]),'ChatQueueId':Number(_0x50ed07[_0xa1b0('0x57')]['id'])});}});}})[_0xa1b0('0x37')](respondWithStatusCode(_0x1e6bee,null))[_0xa1b0('0x28')](handleError(_0x1e6bee,null));};exports[_0xa1b0('0x92')]=function(_0x120f07,_0xa0e7d3,_0x3f87a8){var _0x36e8fe={};var _0x299db6={};var _0x3df134;var _0x3c20fc;return db[_0xa1b0('0x3a')][_0xa1b0('0x71')]({'where':{'id':_0x120f07[_0xa1b0('0x57')]['id']}})['then'](handleEntityNotFound(_0xa0e7d3,null))[_0xa1b0('0x37')](function(_0x9b2896){if(_0x9b2896){_0x3df134=_0x9b2896;_0x299db6['model']=_[_0xa1b0('0x58')](db[_0xa1b0('0x68')][_0xa1b0('0x3b')]);_0x299db6['query']=_['keys'](_0x120f07[_0xa1b0('0x42')]);_0x299db6[_0xa1b0('0x43')]=_[_0xa1b0('0x44')](_0x299db6[_0xa1b0('0x3f')],_0x299db6['query']);_0x36e8fe[_0xa1b0('0x45')]=_[_0xa1b0('0x44')](_0x299db6[_0xa1b0('0x3f')],qs[_0xa1b0('0x46')](_0x120f07['query'][_0xa1b0('0x46')]));_0x36e8fe[_0xa1b0('0x45')]=_0x36e8fe[_0xa1b0('0x45')][_0xa1b0('0x47')]?_0x36e8fe['attributes']:_0x299db6[_0xa1b0('0x3f')];_0x36e8fe[_0xa1b0('0x4a')]=qs[_0xa1b0('0x4b')](_0x120f07[_0xa1b0('0x42')][_0xa1b0('0x4b')]);_0x36e8fe[_0xa1b0('0x4e')]=qs['filters'](_[_0xa1b0('0x4c')](_0x120f07['query'],_0x299db6[_0xa1b0('0x43')]));if(_0x120f07['query']['filter']){_0x36e8fe[_0xa1b0('0x4e')]=_[_0xa1b0('0x4f')](_0x36e8fe[_0xa1b0('0x4e')],{'$or':_['map'](_0x36e8fe['attributes'],function(_0x5bdaf7){var _0x52e0d0={};_0x52e0d0[_0x5bdaf7]={'$like':'%'+_0x120f07[_0xa1b0('0x42')][_0xa1b0('0x4d')]+'%'};return _0x52e0d0;})});}_0x36e8fe=_[_0xa1b0('0x4f')]({},_0x36e8fe,_0x120f07[_0xa1b0('0x51')]);return _0x3df134[_0xa1b0('0x92')](_0x36e8fe);}})[_0xa1b0('0x37')](function(_0x2dac3b){if(_0x2dac3b){_0x3c20fc=_0x2dac3b[_0xa1b0('0x47')];if(!_0x120f07['query'][_0xa1b0('0x48')](_0xa1b0('0x49'))){_0x36e8fe[_0xa1b0('0x2e')]=qs[_0xa1b0('0x2e')](_0x120f07['query']['limit']);_0x36e8fe['offset']=qs[_0xa1b0('0x30')](_0x120f07[_0xa1b0('0x42')][_0xa1b0('0x30')]);}return _0x3df134['getAgents'](_0x36e8fe);}})['then'](function(_0x2e517b){if(_0x2e517b){return _0x2e517b?{'count':_0x3c20fc,'rows':_0x2e517b}:null;}})[_0xa1b0('0x37')](respondWithResult(_0xa0e7d3,null))['catch'](handleError(_0xa0e7d3,null));}; \ No newline at end of file +var _0xfae4=['Team','ids','findAll','Agents','voicePause','interface','flatMap','transaction','addTeams','each','forEach','emit','removeTeams','field','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','includes','all','union','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','end','stack','name','map','ChatQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','length','find','create','body','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','createdAt','format','%s/%s','updatedAt','getTeams'];(function(_0x333afd,_0xce55b){var _0x39a197=function(_0x1e3893){while(--_0x1e3893){_0x333afd['push'](_0x333afd['shift']());}};_0x39a197(++_0xce55b);}(_0xfae4,0x1d3));var _0x4fae=function(_0x226c77,_0x341489){_0x226c77=_0x226c77-0x0;var _0xcf327d=_0xfae4[_0x226c77];return _0xcf327d;};'use strict';var emlformat=require(_0x4fae('0x0'));var rimraf=require(_0x4fae('0x1'));var zipdir=require(_0x4fae('0x2'));var jsonpatch=require(_0x4fae('0x3'));var rp=require(_0x4fae('0x4'));var moment=require(_0x4fae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4fae('0x6'));var util=require(_0x4fae('0x7'));var path=require(_0x4fae('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4fae('0x9'));var fs=require('fs');var fs_extra=require(_0x4fae('0xa'));var _=require(_0x4fae('0xb'));var squel=require(_0x4fae('0xc'));var crypto=require('crypto');var jsforce=require(_0x4fae('0xd'));var deskjs=require(_0x4fae('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4fae('0xf'));var Redis=require(_0x4fae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4fae('0x11'));var as=require(_0x4fae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fae('0x13'))(_0x4fae('0x14'));var utils=require(_0x4fae('0x15'));var config=require(_0x4fae('0x16'));var licenseUtil=require(_0x4fae('0x17'));var db=require(_0x4fae('0x18'))['db'];config[_0x4fae('0x19')]=_[_0x4fae('0x1a')](config[_0x4fae('0x19')],{'host':_0x4fae('0x1b'),'port':0x18eb});var socket=require(_0x4fae('0x1c'))(new Redis(config['redis']));require(_0x4fae('0x1d'))[_0x4fae('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4fae('0x1f')][_0x4fae('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1bc9f3,_0x4f86f7,_0x16ba1c,_0x2ad62f){return new BPromise(function(_0x639d22,_0x2982c8){var _0x3b7d62=_0x2ad62f||client;return _0x3b7d62[_0x4fae('0x21')](_0x1bc9f3,_0x16ba1c)[_0x4fae('0x22')](function(_0x32d153){logger[_0x4fae('0x23')](_0x4fae('0x24'),_0x4f86f7,_0x4fae('0x25'));logger[_0x4fae('0x26')](_0x4fae('0x27'),_0x4f86f7,_0x4fae('0x25'),JSON['stringify'](_0x32d153));if(_0x32d153[_0x4fae('0x28')]){if(_0x32d153['error']['code']===0x1f4){logger[_0x4fae('0x28')](_0x4fae('0x24'),_0x4f86f7,_0x32d153[_0x4fae('0x28')]['message']);return _0x2982c8(_0x32d153[_0x4fae('0x28')][_0x4fae('0x29')]);}logger[_0x4fae('0x28')](_0x4fae('0x24'),_0x4f86f7,_0x32d153[_0x4fae('0x28')][_0x4fae('0x29')]);return _0x639d22(_0x32d153[_0x4fae('0x28')][_0x4fae('0x29')]);}else{logger[_0x4fae('0x23')](_0x4fae('0x24'),_0x4f86f7,_0x4fae('0x25'));_0x639d22(_0x32d153[_0x4fae('0x2a')][_0x4fae('0x29')]);}})[_0x4fae('0x2b')](function(_0x5e5ed8){logger[_0x4fae('0x28')](_0x4fae('0x24'),_0x4f86f7,_0x5e5ed8);_0x2982c8(_0x5e5ed8);});});}function respondWithStatusCode(_0x494b2c,_0x21acb0){_0x21acb0=_0x21acb0||0xcc;return function(_0x3a6072){if(_0x3a6072){return _0x494b2c[_0x4fae('0x2c')](_0x21acb0);}return _0x494b2c[_0x4fae('0x2d')](_0x21acb0)['end']();};}function respondWithResult(_0x278a22,_0x506ce7){_0x506ce7=_0x506ce7||0xc8;return function(_0x354885){if(_0x354885){return _0x278a22['status'](_0x506ce7)[_0x4fae('0x2e')](_0x354885);}};}function respondWithFilteredResult(_0x19221f,_0xa3df75){return function(_0x15b375){if(_0x15b375){var _0x4762d1=typeof _0xa3df75[_0x4fae('0x2f')]===_0x4fae('0x30')&&typeof _0xa3df75[_0x4fae('0x31')]===_0x4fae('0x30');var _0x20e350=_0x15b375[_0x4fae('0x32')];var _0x1d5df4=_0x4762d1?0x0:_0xa3df75[_0x4fae('0x2f')];var _0x4b5dd0=_0x4762d1?_0x15b375[_0x4fae('0x32')]:_0xa3df75['offset']+_0xa3df75[_0x4fae('0x31')];var _0x114546;if(_0x4b5dd0>=_0x20e350){_0x4b5dd0=_0x20e350;_0x114546=0xc8;}else{_0x114546=0xce;}_0x19221f[_0x4fae('0x2d')](_0x114546);return _0x19221f['set']('Content-Range',_0x1d5df4+'-'+_0x4b5dd0+'/'+_0x20e350)[_0x4fae('0x2e')](_0x15b375);}return null;};}function patchUpdates(_0x1ca7e5){return function(_0x50e09b){try{jsonpatch[_0x4fae('0x33')](_0x50e09b,_0x1ca7e5,!![]);}catch(_0xba9b49){return BPromise[_0x4fae('0x34')](_0xba9b49);}return _0x50e09b[_0x4fae('0x35')]();};}function saveUpdates(_0x59ad89,_0xe5bb15){return function(_0x3e78eb){if(_0x3e78eb){return _0x3e78eb['update'](_0x59ad89)[_0x4fae('0x22')](function(_0x5e9305){return _0x5e9305;});}return null;};}function removeEntity(_0x139cb1,_0xf67d6f){return function(_0x52227d){if(_0x52227d){return _0x52227d[_0x4fae('0x36')]()[_0x4fae('0x22')](function(){var _0x352ecd=_0x52227d[_0x4fae('0x37')]({'plain':!![]});var _0x77eb5=_0x4fae('0x38');return db[_0x4fae('0x39')][_0x4fae('0x36')]({'where':{'type':_0x77eb5,'resourceId':_0x352ecd['id']}})['then'](function(){return _0x52227d;});})['then'](function(){_0x139cb1['status'](0xcc)[_0x4fae('0x3a')]();});}};}function handleEntityNotFound(_0x424986,_0x4a744a){return function(_0x186db1){if(!_0x186db1){_0x424986['sendStatus'](0x194);}return _0x186db1;};}function handleError(_0x13fb1b,_0x5440bf){_0x5440bf=_0x5440bf||0x1f4;return function(_0x564cc8){logger[_0x4fae('0x28')](_0x564cc8[_0x4fae('0x3b')]);if(_0x564cc8[_0x4fae('0x3c')]){delete _0x564cc8['name'];}_0x13fb1b[_0x4fae('0x2d')](_0x5440bf)['send'](_0x564cc8);};}exports['index']=function(_0x4b3011,_0x5f38ee){var _0x7f2180={},_0x367a40={},_0x4f050b={'count':0x0,'rows':[]};var _0x1972ea=_[_0x4fae('0x3d')](db[_0x4fae('0x3e')][_0x4fae('0x3f')],function(_0x1ce0df){return{'name':_0x1ce0df['fieldName'],'type':_0x1ce0df[_0x4fae('0x40')][_0x4fae('0x41')]};});_0x367a40[_0x4fae('0x42')]=_[_0x4fae('0x3d')](_0x1972ea,_0x4fae('0x3c'));_0x367a40[_0x4fae('0x43')]=_[_0x4fae('0x44')](_0x4b3011[_0x4fae('0x43')]);_0x367a40['filters']=_[_0x4fae('0x45')](_0x367a40[_0x4fae('0x42')],_0x367a40[_0x4fae('0x43')]);_0x7f2180[_0x4fae('0x46')]=_[_0x4fae('0x45')](_0x367a40[_0x4fae('0x42')],qs[_0x4fae('0x47')](_0x4b3011['query'][_0x4fae('0x47')]));_0x7f2180[_0x4fae('0x46')]=_0x7f2180[_0x4fae('0x46')]['length']?_0x7f2180['attributes']:_0x367a40['model'];if(!_0x4b3011[_0x4fae('0x43')][_0x4fae('0x48')](_0x4fae('0x49'))){_0x7f2180['limit']=qs[_0x4fae('0x31')](_0x4b3011['query'][_0x4fae('0x31')]);_0x7f2180['offset']=qs[_0x4fae('0x2f')](_0x4b3011[_0x4fae('0x43')]['offset']);}_0x7f2180[_0x4fae('0x4a')]=qs[_0x4fae('0x4b')](_0x4b3011[_0x4fae('0x43')][_0x4fae('0x4b')]);_0x7f2180[_0x4fae('0x4c')]=qs[_0x4fae('0x4d')](_[_0x4fae('0x4e')](_0x4b3011[_0x4fae('0x43')],_0x367a40['filters']),_0x1972ea);if(_0x4b3011[_0x4fae('0x43')][_0x4fae('0x4f')]){_0x7f2180[_0x4fae('0x4c')]=_[_0x4fae('0x50')](_0x7f2180[_0x4fae('0x4c')],{'$or':_['map'](_0x1972ea,function(_0x1e27ef){if(_0x1e27ef[_0x4fae('0x40')]!==_0x4fae('0x51')){var _0x54b5cd={};_0x54b5cd[_0x1e27ef[_0x4fae('0x3c')]]={'$like':'%'+_0x4b3011[_0x4fae('0x43')][_0x4fae('0x4f')]+'%'};return _0x54b5cd;}})});}_0x7f2180=_[_0x4fae('0x50')]({},_0x7f2180,_0x4b3011[_0x4fae('0x52')]);var _0x6f38ce={'where':_0x7f2180[_0x4fae('0x4c')]};return db[_0x4fae('0x3e')][_0x4fae('0x32')](_0x6f38ce)[_0x4fae('0x22')](function(_0x6673a){_0x4f050b[_0x4fae('0x32')]=_0x6673a;if(_0x4b3011[_0x4fae('0x43')][_0x4fae('0x53')]){_0x7f2180[_0x4fae('0x54')]=[{'all':!![]}];}return db[_0x4fae('0x3e')]['findAll'](_0x7f2180);})['then'](function(_0x1eac50){_0x4f050b[_0x4fae('0x55')]=_0x1eac50;return _0x4f050b;})[_0x4fae('0x22')](respondWithFilteredResult(_0x5f38ee,_0x7f2180))[_0x4fae('0x2b')](handleError(_0x5f38ee,null));};exports['show']=function(_0x2ac33d,_0x1912d2){var _0x57d4ab={'raw':!![],'where':{'id':_0x2ac33d[_0x4fae('0x56')]['id']}},_0x3f2aa1={};_0x3f2aa1[_0x4fae('0x42')]=_[_0x4fae('0x44')](db[_0x4fae('0x3e')][_0x4fae('0x3f')]);_0x3f2aa1[_0x4fae('0x43')]=_[_0x4fae('0x44')](_0x2ac33d[_0x4fae('0x43')]);_0x3f2aa1[_0x4fae('0x4d')]=_[_0x4fae('0x45')](_0x3f2aa1['model'],_0x3f2aa1[_0x4fae('0x43')]);_0x57d4ab[_0x4fae('0x46')]=_[_0x4fae('0x45')](_0x3f2aa1[_0x4fae('0x42')],qs['fields'](_0x2ac33d['query'][_0x4fae('0x47')]));_0x57d4ab[_0x4fae('0x46')]=_0x57d4ab[_0x4fae('0x46')][_0x4fae('0x57')]?_0x57d4ab[_0x4fae('0x46')]:_0x3f2aa1[_0x4fae('0x42')];if(_0x2ac33d[_0x4fae('0x43')][_0x4fae('0x53')]){_0x57d4ab[_0x4fae('0x54')]=[{'all':!![]}];}_0x57d4ab=_[_0x4fae('0x50')]({},_0x57d4ab,_0x2ac33d[_0x4fae('0x52')]);return db['ChatQueue'][_0x4fae('0x58')](_0x57d4ab)[_0x4fae('0x22')](handleEntityNotFound(_0x1912d2,null))[_0x4fae('0x22')](respondWithResult(_0x1912d2,null))['catch'](handleError(_0x1912d2,null));};exports[_0x4fae('0x59')]=function(_0x16b465,_0x5978ca){return db[_0x4fae('0x3e')]['create'](_0x16b465[_0x4fae('0x5a')],{})[_0x4fae('0x22')](function(_0x3ad79e){var _0xfdaada=_0x16b465['user'][_0x4fae('0x37')]({'plain':!![]});if(!_0xfdaada)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfdaada['role']==='user'){var _0x168bac=_0x3ad79e[_0x4fae('0x37')]({'plain':!![]});var _0x2843a7=_0x4fae('0x38');return db[_0x4fae('0x5b')][_0x4fae('0x58')]({'where':{'name':_0x2843a7,'userProfileId':_0xfdaada[_0x4fae('0x5c')]},'raw':!![]})['then'](function(_0x2d7cf2){if(_0x2d7cf2&&_0x2d7cf2[_0x4fae('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x168bac[_0x4fae('0x3c')],'resourceId':_0x168bac['id'],'type':_0x2d7cf2['name'],'sectionId':_0x2d7cf2['id']},{})['then'](function(){return _0x3ad79e;});}else{return _0x3ad79e;}})[_0x4fae('0x2b')](function(_0x26c062){logger[_0x4fae('0x28')](_0x4fae('0x5e'),_0x26c062);throw _0x26c062;});}return _0x3ad79e;})[_0x4fae('0x22')](respondWithResult(_0x5978ca,0xc9))[_0x4fae('0x2b')](handleError(_0x5978ca,null));};exports[_0x4fae('0x5f')]=function(_0x1302ba,_0x4ada3d){if(_0x1302ba['body']['id']){delete _0x1302ba[_0x4fae('0x5a')]['id'];}return db[_0x4fae('0x3e')]['find']({'where':{'id':_0x1302ba['params']['id']}})[_0x4fae('0x22')](handleEntityNotFound(_0x4ada3d,null))['then'](saveUpdates(_0x1302ba[_0x4fae('0x5a')],null))['then'](respondWithResult(_0x4ada3d,null))[_0x4fae('0x2b')](handleError(_0x4ada3d,null));};exports[_0x4fae('0x36')]=function(_0x3936c2,_0x3833d8){return db[_0x4fae('0x3e')][_0x4fae('0x58')]({'where':{'id':_0x3936c2['params']['id']}})[_0x4fae('0x22')](handleEntityNotFound(_0x3833d8,null))[_0x4fae('0x22')](removeEntity(_0x3833d8,null))['catch'](handleError(_0x3833d8,null));};exports[_0x4fae('0x60')]=function(_0x545b0b,_0x57aa98){return db[_0x4fae('0x3e')][_0x4fae('0x60')]()['then'](respondWithResult(_0x57aa98,null))[_0x4fae('0x2b')](handleError(_0x57aa98,null));};exports['getMembers']=function(_0x5a1990,_0x40f534,_0x2a817e){var _0x3be501={'raw':!![],'where':{}},_0x183845={},_0x116818;return db['ChatQueue'][_0x4fae('0x61')]({'where':{'id':_0x5a1990[_0x4fae('0x56')]['id']}})['then'](handleEntityNotFound(_0x40f534,null))[_0x4fae('0x22')](function(_0x186460){if(_0x186460){_0x116818=_0x186460[_0x4fae('0x37')]({'plain':!![]});_0x183845[_0x4fae('0x42')]=_[_0x4fae('0x44')](db[_0x4fae('0x62')]['rawAttributes']);_0x183845[_0x4fae('0x43')]=_[_0x4fae('0x44')](_0x5a1990['query']);_0x183845[_0x4fae('0x4d')]=_[_0x4fae('0x45')](_0x183845[_0x4fae('0x42')],_0x183845[_0x4fae('0x43')]);_0x3be501[_0x4fae('0x46')]=_[_0x4fae('0x45')](_0x183845[_0x4fae('0x42')],qs['fields'](_0x5a1990[_0x4fae('0x43')][_0x4fae('0x47')]));_0x3be501['attributes']=_0x3be501[_0x4fae('0x46')][_0x4fae('0x57')]?_0x3be501[_0x4fae('0x46')]:_0x183845[_0x4fae('0x42')];if(!_0x5a1990[_0x4fae('0x43')][_0x4fae('0x48')](_0x4fae('0x49'))){_0x3be501[_0x4fae('0x31')]=qs[_0x4fae('0x31')](_0x5a1990['query']['limit']);_0x3be501[_0x4fae('0x2f')]=qs[_0x4fae('0x2f')](_0x5a1990['query']['offset']);}_0x3be501[_0x4fae('0x4a')]=qs[_0x4fae('0x4b')](_0x5a1990[_0x4fae('0x43')][_0x4fae('0x4b')]);_0x3be501[_0x4fae('0x4c')]=qs[_0x4fae('0x4d')](_[_0x4fae('0x4e')](_0x5a1990[_0x4fae('0x43')],_0x183845['filters']));_0x3be501[_0x4fae('0x4c')][_0x4fae('0x63')]=_0x186460['id'];if(_0x5a1990[_0x4fae('0x43')]['filter']){_0x3be501['where']=_[_0x4fae('0x50')](_0x3be501[_0x4fae('0x4c')],{'$or':_['map'](_0x3be501['attributes'],function(_0x1199a7){var _0x3da272={};_0x3da272[_0x1199a7]={'$like':'%'+_0x5a1990[_0x4fae('0x43')]['filter']+'%'};return _0x3da272;})});}_0x3be501=_['merge']({},_0x3be501,_0x5a1990[_0x4fae('0x52')]);return db[_0x4fae('0x62')]['findAll'](_0x3be501);}})[_0x4fae('0x22')](function(_0x39e9ad){if(_0x39e9ad){return db[_0x4fae('0x64')][_0x4fae('0x65')]({'where':{'id':_[_0x4fae('0x3d')](_0x39e9ad,_0x4fae('0x66')),'role':'agent'},'attributes':['id',_0x4fae('0x3c'),_0x4fae('0x67'),'updatedAt',_0x4fae('0x68')]});}})[_0x4fae('0x22')](function(_0x262efa){if(_0x262efa){return{'count':_0x262efa[_0x4fae('0x32')],'rows':_[_0x4fae('0x3d')](_0x262efa[_0x4fae('0x55')],function(_0x1f010f){return{'membername':_0x1f010f[_0x4fae('0x3c')],'UserId':_0x1f010f['id'],'queue_name':_0x116818[_0x4fae('0x3c')],'ChatQueueId':_0x116818['id'],'interface':util[_0x4fae('0x69')](_0x4fae('0x6a'),'SIP',_0x1f010f[_0x4fae('0x3c')]),'penalty':0x0,'paused':_0x1f010f['chatPause'],'createdAt':_0x1f010f['createdAt'],'updatedAt':_0x1f010f[_0x4fae('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4fae('0x22')](respondWithFilteredResult(_0x40f534,_0x3be501))[_0x4fae('0x2b')](handleError(_0x40f534,null));};exports[_0x4fae('0x6c')]=function(_0x497e16,_0x3eb7ac,_0x2da8dc){var _0x471bb8={};var _0x4f5935={};var _0x2f2efa;var _0x2c4620;return db[_0x4fae('0x3e')]['findOne']({'where':{'id':_0x497e16[_0x4fae('0x56')]['id']}})[_0x4fae('0x22')](handleEntityNotFound(_0x3eb7ac,null))[_0x4fae('0x22')](function(_0x125646){if(_0x125646){_0x2f2efa=_0x125646;_0x4f5935[_0x4fae('0x42')]=_[_0x4fae('0x44')](db[_0x4fae('0x6d')]['rawAttributes']);_0x4f5935['query']=_[_0x4fae('0x44')](_0x497e16[_0x4fae('0x43')]);_0x4f5935['filters']=_['intersection'](_0x4f5935[_0x4fae('0x42')],_0x4f5935[_0x4fae('0x43')]);_0x471bb8[_0x4fae('0x46')]=_[_0x4fae('0x45')](_0x4f5935[_0x4fae('0x42')],qs[_0x4fae('0x47')](_0x497e16[_0x4fae('0x43')][_0x4fae('0x47')]));_0x471bb8[_0x4fae('0x46')]=_0x471bb8['attributes'][_0x4fae('0x57')]?_0x471bb8[_0x4fae('0x46')]:_0x4f5935['model'];_0x471bb8[_0x4fae('0x4a')]=qs['sort'](_0x497e16[_0x4fae('0x43')][_0x4fae('0x4b')]);_0x471bb8[_0x4fae('0x4c')]=qs[_0x4fae('0x4d')](_[_0x4fae('0x4e')](_0x497e16[_0x4fae('0x43')],_0x4f5935['filters']));if(_0x497e16[_0x4fae('0x43')][_0x4fae('0x4f')]){_0x471bb8[_0x4fae('0x4c')]=_['merge'](_0x471bb8[_0x4fae('0x4c')],{'$or':_['map'](_0x471bb8[_0x4fae('0x46')],function(_0x2cb441){var _0x5aa157={};_0x5aa157[_0x2cb441]={'$like':'%'+_0x497e16[_0x4fae('0x43')]['filter']+'%'};return _0x5aa157;})});}_0x471bb8=_[_0x4fae('0x50')]({},_0x471bb8,_0x497e16[_0x4fae('0x52')]);return _0x2f2efa[_0x4fae('0x6c')](_0x471bb8);}})['then'](function(_0x2c419b){if(_0x2c419b){_0x2c4620=_0x2c419b[_0x4fae('0x57')];if(!_0x497e16[_0x4fae('0x43')][_0x4fae('0x48')](_0x4fae('0x49'))){_0x471bb8['limit']=qs[_0x4fae('0x31')](_0x497e16[_0x4fae('0x43')]['limit']);_0x471bb8[_0x4fae('0x2f')]=qs[_0x4fae('0x2f')](_0x497e16[_0x4fae('0x43')][_0x4fae('0x2f')]);}return _0x2f2efa[_0x4fae('0x6c')](_0x471bb8);}})[_0x4fae('0x22')](function(_0x13ec98){if(_0x13ec98){return _0x13ec98?{'count':_0x2c4620,'rows':_0x13ec98}:null;}})[_0x4fae('0x22')](respondWithResult(_0x3eb7ac,null))['catch'](handleError(_0x3eb7ac,null));};exports['addTeams']=function(_0x586fa8,_0x16a576,_0x21aca9){var _0x570d6d=_0x586fa8[_0x4fae('0x5a')][_0x4fae('0x6e')];return db[_0x4fae('0x6d')][_0x4fae('0x6f')]({'where':{'id':_0x570d6d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4fae('0x70'),'attributes':['id','name','online',_0x4fae('0x71'),_0x4fae('0x72')],'raw':!![]}]})[_0x4fae('0x22')](function(_0x1f14dd){if(_0x1f14dd){var _0x1aff74=_[_0x4fae('0x73')](_0x1f14dd,function(_0x3be40c){var _0x3810ad=_0x3be40c[_0x4fae('0x37')]({'plain':!![]});return _0x3810ad[_0x4fae('0x70')];});return db[_0x4fae('0x3e')]['find']({'where':{'id':_0x586fa8['params']['id']}})[_0x4fae('0x22')](function(_0x25252a){return db['sequelize'][_0x4fae('0x74')](function(_0x552f4e){return _0x25252a[_0x4fae('0x75')](_0x570d6d,{'transaction':_0x552f4e})[_0x4fae('0x22')](function(){return BPromise[_0x4fae('0x76')](_0x1aff74,function(_0x686235){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x686235['id'],'ChatQueueId':_0x586fa8[_0x4fae('0x56')]['id']},'transaction':_0x552f4e});});})[_0x4fae('0x22')](function(){_0x1aff74[_0x4fae('0x77')](function(_0x566de2){socket[_0x4fae('0x78')]('userChatQueue:save',{'UserId':_0x566de2['id'],'ChatQueueId':_0x25252a['id']});});});});});}})[_0x4fae('0x22')](respondWithStatusCode(_0x16a576,null))[_0x4fae('0x2b')](handleError(_0x16a576,null));};exports[_0x4fae('0x79')]=function(_0x3ddfd4,_0x2538f6,_0x50e109){return db['Team'][_0x4fae('0x6f')]({'where':{'id':_0x3ddfd4[_0x4fae('0x43')][_0x4fae('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4fae('0x70'),'attributes':['id'],'raw':!![]}]})[_0x4fae('0x22')](handleEntityNotFound(_0x2538f6,null))[_0x4fae('0x22')](function(_0x42e77c){var _0x628586=_[_0x4fae('0x3d')](_0x42e77c,'id');var _0x2964d4=[];var _0x1c990a=[];var _0x34f135=squel['select']();_0x34f135[_0x4fae('0x7a')]('tq.TeamId')[_0x4fae('0x7b')](_0x4fae('0x7c'),'tq')[_0x4fae('0x7d')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4fae('0x4c')](_0x4fae('0x7e'),_0x3ddfd4['params']['id']);for(var _0x31e4e0=0x0;_0x31e4e0<_0x42e77c['length'];_0x31e4e0+=0x1){let _0x26fa11=_0x42e77c[_0x31e4e0];for(var _0x1b9217=0x0;_0x1b9217<_0x26fa11['Agents']['length'];_0x1b9217+=0x1){let _0x586b5f=_0x26fa11['Agents'][_0x1b9217];var _0x4e2410=_0x34f135['clone']();_0x4e2410[_0x4fae('0x4c')](_0x4fae('0x7f'),_0x586b5f['id']);_0x1c990a[_0x4fae('0x80')](db[_0x4fae('0x81')][_0x4fae('0x43')](_0x4e2410[_0x4fae('0x82')](),{'type':db['sequelize']['QueryTypes'][_0x4fae('0x83')]})[_0x4fae('0x22')](function(_0x475e64){if(_0x475e64[_0x4fae('0x57')]===0x1){return _0x586b5f['id'];}else{var _0x5d3f76=_['every'](_['map'](_0x475e64,_0x4fae('0x84')),function(_0x532559){return _[_0x4fae('0x85')](_0x628586,_0x532559);});if(_0x5d3f76){return _0x586b5f['id'];}}}));}}return BPromise[_0x4fae('0x86')](_0x1c990a)['then'](function(_0x44b1c7){_0x2964d4=_(_0x2964d4)[_0x4fae('0x87')](_0x44b1c7)['compact']()[_0x4fae('0x88')]();return db[_0x4fae('0x3e')][_0x4fae('0x58')]({'where':{'id':_0x3ddfd4[_0x4fae('0x56')]['id']}})[_0x4fae('0x22')](function(_0x15e762){return db['sequelize'][_0x4fae('0x74')](function(_0xc71c00){return _0x15e762['removeTeams'](_0x3ddfd4['query'][_0x4fae('0x6e')],{'transaction':_0xc71c00})[_0x4fae('0x22')](function(){if(!_['isEmpty'](_0x2964d4)){return _0x15e762[_0x4fae('0x89')](_0x2964d4,{'transaction':_0xc71c00});}})[_0x4fae('0x22')](function(){_0x2964d4[_0x4fae('0x77')](function(_0x56939e){socket[_0x4fae('0x78')](_0x4fae('0x8a'),{'UserId':_0x56939e,'ChatQueueId':_0x15e762['id']});});});});});});})[_0x4fae('0x22')](respondWithStatusCode(_0x2538f6,null))[_0x4fae('0x2b')](handleError(_0x2538f6,null));};exports[_0x4fae('0x8b')]=function(_0x579508,_0x439a93,_0x3a55a3){return db[_0x4fae('0x3e')][_0x4fae('0x58')]({'where':{'id':_0x579508['params']['id']}})[_0x4fae('0x22')](handleEntityNotFound(_0x439a93,null))[_0x4fae('0x22')](function(_0x45d03e){if(_0x45d03e){return _0x45d03e['addAgents'](_0x579508[_0x4fae('0x5a')][_0x4fae('0x6e')],_[_0x4fae('0x8c')](_0x579508['body'],[_0x4fae('0x6e'),'id'])||{})[_0x4fae('0x8d')](function(_0x716cf9){for(var _0x344b59=0x0;_0x344b59<_0x579508[_0x4fae('0x5a')][_0x4fae('0x6e')][_0x4fae('0x57')];_0x344b59+=0x1){socket[_0x4fae('0x78')](_0x4fae('0x8e'),{'UserId':Number(_0x579508[_0x4fae('0x5a')][_0x4fae('0x6e')][_0x344b59]),'ChatQueueId':Number(_0x579508[_0x4fae('0x56')]['id'])});}return _0x716cf9;});}})[_0x4fae('0x22')](respondWithResult(_0x439a93,null))['catch'](handleError(_0x439a93,null));};exports[_0x4fae('0x89')]=function(_0xfedf4,_0x388111,_0x42f44f){return db[_0x4fae('0x3e')][_0x4fae('0x58')]({'where':{'id':_0xfedf4[_0x4fae('0x56')]['id']}})[_0x4fae('0x22')](handleEntityNotFound(_0x388111,null))[_0x4fae('0x22')](function(_0x5a9229){if(_0x5a9229){return _0x5a9229[_0x4fae('0x89')](_0xfedf4['query'][_0x4fae('0x6e')])[_0x4fae('0x22')](function(){if(_['isArray'](_0xfedf4[_0x4fae('0x43')][_0x4fae('0x6e')])){for(var _0x76bbb7=0x0;_0x76bbb7<_0xfedf4[_0x4fae('0x43')][_0x4fae('0x6e')][_0x4fae('0x57')];_0x76bbb7+=0x1){socket[_0x4fae('0x78')](_0x4fae('0x8a'),{'UserId':Number(_0xfedf4[_0x4fae('0x43')][_0x4fae('0x6e')][_0x76bbb7]),'ChatQueueId':Number(_0xfedf4[_0x4fae('0x56')]['id'])});}}else{socket[_0x4fae('0x78')](_0x4fae('0x8a'),{'UserId':Number(_0xfedf4[_0x4fae('0x43')]['ids']),'ChatQueueId':Number(_0xfedf4[_0x4fae('0x56')]['id'])});}});}})[_0x4fae('0x22')](respondWithStatusCode(_0x388111,null))['catch'](handleError(_0x388111,null));};exports[_0x4fae('0x8f')]=function(_0xf30337,_0x5785b3,_0x29ce63){var _0x3e9e1a={};var _0x3d1568={};var _0x5e73ac;var _0xba342c;return db[_0x4fae('0x3e')][_0x4fae('0x61')]({'where':{'id':_0xf30337['params']['id']}})['then'](handleEntityNotFound(_0x5785b3,null))[_0x4fae('0x22')](function(_0x4729b4){if(_0x4729b4){_0x5e73ac=_0x4729b4;_0x3d1568[_0x4fae('0x42')]=_[_0x4fae('0x44')](db[_0x4fae('0x64')][_0x4fae('0x3f')]);_0x3d1568[_0x4fae('0x43')]=_[_0x4fae('0x44')](_0xf30337['query']);_0x3d1568[_0x4fae('0x4d')]=_[_0x4fae('0x45')](_0x3d1568[_0x4fae('0x42')],_0x3d1568[_0x4fae('0x43')]);_0x3e9e1a[_0x4fae('0x46')]=_[_0x4fae('0x45')](_0x3d1568['model'],qs[_0x4fae('0x47')](_0xf30337[_0x4fae('0x43')]['fields']));_0x3e9e1a[_0x4fae('0x46')]=_0x3e9e1a[_0x4fae('0x46')][_0x4fae('0x57')]?_0x3e9e1a['attributes']:_0x3d1568[_0x4fae('0x42')];_0x3e9e1a['order']=qs[_0x4fae('0x4b')](_0xf30337[_0x4fae('0x43')][_0x4fae('0x4b')]);_0x3e9e1a[_0x4fae('0x4c')]=qs[_0x4fae('0x4d')](_[_0x4fae('0x4e')](_0xf30337['query'],_0x3d1568[_0x4fae('0x4d')]));if(_0xf30337[_0x4fae('0x43')][_0x4fae('0x4f')]){_0x3e9e1a[_0x4fae('0x4c')]=_[_0x4fae('0x50')](_0x3e9e1a[_0x4fae('0x4c')],{'$or':_[_0x4fae('0x3d')](_0x3e9e1a['attributes'],function(_0x48ea6f){var _0x21d07e={};_0x21d07e[_0x48ea6f]={'$like':'%'+_0xf30337[_0x4fae('0x43')][_0x4fae('0x4f')]+'%'};return _0x21d07e;})});}_0x3e9e1a=_['merge']({},_0x3e9e1a,_0xf30337[_0x4fae('0x52')]);return _0x5e73ac[_0x4fae('0x8f')](_0x3e9e1a);}})[_0x4fae('0x22')](function(_0x45871a){if(_0x45871a){_0xba342c=_0x45871a[_0x4fae('0x57')];if(!_0xf30337[_0x4fae('0x43')][_0x4fae('0x48')](_0x4fae('0x49'))){_0x3e9e1a['limit']=qs[_0x4fae('0x31')](_0xf30337[_0x4fae('0x43')][_0x4fae('0x31')]);_0x3e9e1a['offset']=qs['offset'](_0xf30337[_0x4fae('0x43')][_0x4fae('0x2f')]);}return _0x5e73ac[_0x4fae('0x8f')](_0x3e9e1a);}})[_0x4fae('0x22')](function(_0x44db78){if(_0x44db78){return _0x44db78?{'count':_0xba342c,'rows':_0x44db78}:null;}})[_0x4fae('0x22')](respondWithResult(_0x5785b3,null))['catch'](handleError(_0x5785b3,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 50ba46a..58c75e3 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 _0x09c9=['exports','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0x09c9,0x1d7));var _0x909c=function(_0x3bfb76,_0x3f3a37){_0x3bfb76=_0x3bfb76-0x0;var _0x4d8afe=_0x09c9[_0x3bfb76];return _0x4d8afe;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x909c('0x0'))['db'][_0x909c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x909c('0x2')](0x0);var events={'afterCreate':_0x909c('0x3'),'afterUpdate':_0x909c('0x4'),'afterDestroy':_0x909c('0x5')};function emitEvent(_0x39340a){return function(_0x16ff5d,_0x4c7069,_0x1093a4){ChatQueueEvents[_0x909c('0x6')](_0x39340a+':'+_0x16ff5d['id'],_0x16ff5d);ChatQueueEvents[_0x909c('0x6')](_0x39340a,_0x16ff5d);_0x1093a4(null);};}for(var e in events){if(events[_0x909c('0x7')](e)){var event=events[e];ChatQueue[_0x909c('0x8')](e,emitEvent(event));}}module[_0x909c('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xa96f=['../../mysqldb','ChatQueue','save','update','remove','emit','hook','exports','events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa96f,0x13a));var _0xfa96=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0xa96f[_0x34bc94];return _0xee41e7;};'use strict';var EventEmitter=require(_0xfa96('0x0'));var ChatQueue=require(_0xfa96('0x1'))['db'][_0xfa96('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfa96('0x3'),'afterUpdate':_0xfa96('0x4'),'afterDestroy':_0xfa96('0x5')};function emitEvent(_0x4c39c9){return function(_0x386b9b,_0x199a39,_0x3ce174){ChatQueueEvents[_0xfa96('0x6')](_0x4c39c9+':'+_0x386b9b['id'],_0x386b9b);ChatQueueEvents['emit'](_0x4c39c9,_0x386b9b);_0x3ce174(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xfa96('0x7')](e,emitEvent(event));}}module[_0xfa96('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cd39e7a..a1fe78d 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 _0x268a=['define','ChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x268a,0x1e6));var _0xa268=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x268a[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0xa268('0x0'));var util=require(_0xa268('0x1'));var logger=require(_0xa268('0x2'))('api');var moment=require(_0xa268('0x3'));var BPromise=require(_0xa268('0x4'));var rp=require(_0xa268('0x5'));var fs=require('fs');var path=require(_0xa268('0x6'));var rimraf=require(_0xa268('0x7'));var config=require('../../config/environment');var attributes=require(_0xa268('0x8'));module['exports']=function(_0x8c8a5b,_0x5d8a77){return _0x8c8a5b[_0xa268('0x9')](_0xa268('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f4=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','./chatQueue.attributes','exports'];(function(_0x579b86,_0x4cba47){var _0x3434a5=function(_0x30443d){while(--_0x30443d){_0x579b86['push'](_0x579b86['shift']());}};_0x3434a5(++_0x4cba47);}(_0xb3f4,0x197));var _0x4b3f=function(_0x8c1f1f,_0x179818){_0x8c1f1f=_0x8c1f1f-0x0;var _0x54a1e6=_0xb3f4[_0x8c1f1f];return _0x54a1e6;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var logger=require(_0x4b3f('0x2'))(_0x4b3f('0x3'));var moment=require(_0x4b3f('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('../../config/environment');var attributes=require(_0x4b3f('0x5'));module[_0x4b3f('0x6')]=function(_0xb1c149,_0x2c6901){return _0xb1c149['define'](_0x4b3f('0x7'),attributes,{'tableName':_0x4b3f('0x8'),'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 dbcd13b..395bcf7 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 _0xcdb9=['error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','include','model','attributes','map','then','stringify','catch','ShowChatQueue','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./chatQueue.socket','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5e92fe,_0x3d21df){var _0x3e7bbc=function(_0x37efce){while(--_0x37efce){_0x5e92fe['push'](_0x5e92fe['shift']());}};_0x3e7bbc(++_0x3d21df);}(_0xcdb9,0x82));var _0x9cdb=function(_0x59ffd4,_0x409a3f){_0x59ffd4=_0x59ffd4-0x0;var _0x5dbf44=_0xcdb9[_0x59ffd4];return _0x5dbf44;};'use strict';var _=require('lodash');var util=require(_0x9cdb('0x0'));var moment=require(_0x9cdb('0x1'));var BPromise=require(_0x9cdb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cdb('0x3'));var db=require(_0x9cdb('0x4'))['db'];var utils=require(_0x9cdb('0x5'));var logger=require(_0x9cdb('0x6'))(_0x9cdb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9cdb('0x8')]['http']({'port':0x232a});config[_0x9cdb('0x9')]=_['defaults'](config[_0x9cdb('0x9')],{'host':_0x9cdb('0xa'),'port':0x18eb});var socket=require(_0x9cdb('0xb'))(new Redis(config[_0x9cdb('0x9')]));require(_0x9cdb('0xc'))['register'](socket);function respondWithRpcPromise(_0x1ad612,_0x4aed88,_0x459030){return new BPromise(function(_0x31a3ad,_0x45d824){return client['request'](_0x1ad612,_0x459030)['then'](function(_0x308896){logger[_0x9cdb('0xd')](_0x9cdb('0xe'),_0x4aed88,_0x9cdb('0xf'));logger[_0x9cdb('0x10')](_0x9cdb('0x11'),_0x4aed88,_0x9cdb('0xf'),JSON['stringify'](_0x308896));if(_0x308896[_0x9cdb('0x12')]){if(_0x308896['error'][_0x9cdb('0x13')]===0x1f4){logger[_0x9cdb('0x12')](_0x9cdb('0xe'),_0x4aed88,_0x308896['error'][_0x9cdb('0x14')]);return _0x45d824(_0x308896[_0x9cdb('0x12')][_0x9cdb('0x14')]);}logger[_0x9cdb('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4aed88,_0x308896[_0x9cdb('0x12')]['message']);return _0x31a3ad(_0x308896[_0x9cdb('0x12')]['message']);}else{logger[_0x9cdb('0xd')](_0x9cdb('0xe'),_0x4aed88,_0x9cdb('0xf'));_0x31a3ad(_0x308896[_0x9cdb('0x15')][_0x9cdb('0x14')]);}})['catch'](function(_0x1d5ec2){logger[_0x9cdb('0x12')](_0x9cdb('0xe'),_0x4aed88,_0x1d5ec2);_0x45d824(_0x1d5ec2);});});}exports[_0x9cdb('0x16')]=function(_0x3fa638){var _0x323dca=this;return new Promise(function(_0x441c31,_0x50ddad){return db[_0x9cdb('0x17')][_0x9cdb('0x18')]({'raw':_0x3fa638[_0x9cdb('0x19')]?_0x3fa638[_0x9cdb('0x19')][_0x9cdb('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fa638[_0x9cdb('0x19')]?_0x3fa638['options']['where']||null:null,'attributes':_0x3fa638[_0x9cdb('0x19')]?_0x3fa638[_0x9cdb('0x19')]['attributes']||null:null,'limit':_0x3fa638[_0x9cdb('0x19')]?_0x3fa638[_0x9cdb('0x19')]['limit']||null:null,'include':_0x3fa638['options']?_0x3fa638[_0x9cdb('0x19')][_0x9cdb('0x1b')]?_['map'](_0x3fa638[_0x9cdb('0x19')][_0x9cdb('0x1b')],function(_0x31ec0c){return{'model':db[_0x31ec0c['model']],'as':_0x31ec0c['as'],'attributes':_0x31ec0c['attributes'],'include':_0x31ec0c['include']?_['map'](_0x31ec0c[_0x9cdb('0x1b')],function(_0x443da8){return{'model':db[_0x443da8[_0x9cdb('0x1c')]],'as':_0x443da8['as'],'attributes':_0x443da8[_0x9cdb('0x1d')],'include':_0x443da8['include']?_[_0x9cdb('0x1e')](_0x443da8[_0x9cdb('0x1b')],function(_0x47a21d){return{'model':db[_0x47a21d[_0x9cdb('0x1c')]],'as':_0x47a21d['as'],'attributes':_0x47a21d[_0x9cdb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cdb('0x1f')](function(_0x2b96eb){logger[_0x9cdb('0xd')](_0x9cdb('0x16'),_0x3fa638);logger[_0x9cdb('0x10')](_0x9cdb('0x16'),_0x3fa638,JSON[_0x9cdb('0x20')](_0x2b96eb));_0x441c31(_0x2b96eb);})[_0x9cdb('0x21')](function(_0x44f720){logger[_0x9cdb('0x12')](_0x9cdb('0x16'),_0x44f720['message'],_0x3fa638);_0x50ddad(_0x323dca[_0x9cdb('0x12')](0x1f4,_0x44f720[_0x9cdb('0x14')]));});});};exports[_0x9cdb('0x22')]=function(_0x3b08d7){var _0x1387bb=this;return new Promise(function(_0x1523fd,_0x3a1612){return db[_0x9cdb('0x17')][_0x9cdb('0x23')]({'raw':_0x3b08d7[_0x9cdb('0x19')]?_0x3b08d7[_0x9cdb('0x19')][_0x9cdb('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b08d7[_0x9cdb('0x19')]?_0x3b08d7[_0x9cdb('0x19')][_0x9cdb('0x24')]||null:null,'attributes':_0x3b08d7['options']?_0x3b08d7[_0x9cdb('0x19')][_0x9cdb('0x1d')]||null:null,'include':_0x3b08d7[_0x9cdb('0x19')]?_0x3b08d7[_0x9cdb('0x19')]['include']?_[_0x9cdb('0x1e')](_0x3b08d7[_0x9cdb('0x19')][_0x9cdb('0x1b')],function(_0x2f8014){return{'model':db[_0x2f8014[_0x9cdb('0x1c')]],'as':_0x2f8014['as'],'attributes':_0x2f8014['attributes'],'include':_0x2f8014['include']?_[_0x9cdb('0x1e')](_0x2f8014['include'],function(_0x4ca545){return{'model':db[_0x4ca545[_0x9cdb('0x1c')]],'as':_0x4ca545['as'],'attributes':_0x4ca545['attributes'],'include':_0x4ca545['include']?_['map'](_0x4ca545[_0x9cdb('0x1b')],function(_0x243373){return{'model':db[_0x243373[_0x9cdb('0x1c')]],'as':_0x243373['as'],'attributes':_0x243373['attributes']};}):[]};}):[]};}):[]:[]})[_0x9cdb('0x1f')](function(_0x1fbf7f){logger['info'](_0x9cdb('0x22'),_0x3b08d7);logger['debug'](_0x9cdb('0x22'),_0x3b08d7,JSON[_0x9cdb('0x20')](_0x1fbf7f));_0x1523fd(_0x1fbf7f);})['catch'](function(_0x48fcc8){logger[_0x9cdb('0x12')](_0x9cdb('0x22'),_0x48fcc8[_0x9cdb('0x14')],_0x3b08d7);_0x3a1612(_0x1387bb[_0x9cdb('0x12')](0x1f4,_0x48fcc8[_0x9cdb('0x14')]));});});}; \ No newline at end of file +var _0x94c9=['map','include','model','then','stringify','find','raw','ShowChatQueue','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit'];(function(_0x1adc24,_0x332b2c){var _0x1ac647=function(_0x4045a7){while(--_0x4045a7){_0x1adc24['push'](_0x1adc24['shift']());}};_0x1ac647(++_0x332b2c);}(_0x94c9,0x1b5));var _0x994c=function(_0x58e87d,_0x2206d7){_0x58e87d=_0x58e87d-0x0;var _0x2d9bdc=_0x94c9[_0x58e87d];return _0x2d9bdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x994c('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x994c('0x1'))['db'];var utils=require(_0x994c('0x2'));var logger=require(_0x994c('0x3'))(_0x994c('0x4'));var config=require(_0x994c('0x5'));var jayson=require(_0x994c('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x994c('0x7')]=_[_0x994c('0x8')](config['redis'],{'host':_0x994c('0x9'),'port':0x18eb});var socket=require(_0x994c('0xa'))(new Redis(config['redis']));require(_0x994c('0xb'))[_0x994c('0xc')](socket);function respondWithRpcPromise(_0x1b4b26,_0x1f7ff0,_0x4ff921){return new BPromise(function(_0x3a57be,_0x26fddf){return client[_0x994c('0xd')](_0x1b4b26,_0x4ff921)['then'](function(_0x484e01){logger[_0x994c('0xe')](_0x994c('0xf'),_0x1f7ff0,_0x994c('0x10'));logger[_0x994c('0x11')](_0x994c('0x12'),_0x1f7ff0,_0x994c('0x10'),JSON['stringify'](_0x484e01));if(_0x484e01[_0x994c('0x13')]){if(_0x484e01['error'][_0x994c('0x14')]===0x1f4){logger[_0x994c('0x13')](_0x994c('0xf'),_0x1f7ff0,_0x484e01['error']['message']);return _0x26fddf(_0x484e01[_0x994c('0x13')][_0x994c('0x15')]);}logger[_0x994c('0x13')](_0x994c('0xf'),_0x1f7ff0,_0x484e01[_0x994c('0x13')]['message']);return _0x3a57be(_0x484e01[_0x994c('0x13')][_0x994c('0x15')]);}else{logger[_0x994c('0xe')](_0x994c('0xf'),_0x1f7ff0,_0x994c('0x10'));_0x3a57be(_0x484e01[_0x994c('0x16')]['message']);}})[_0x994c('0x17')](function(_0x138394){logger[_0x994c('0x13')]('ChatQueue,\x20%s,\x20%s',_0x1f7ff0,_0x138394);_0x26fddf(_0x138394);});});}exports[_0x994c('0x18')]=function(_0x126018){var _0x59b26b=this;return new Promise(function(_0x49fa50,_0x508886){return db[_0x994c('0x19')][_0x994c('0x1a')]({'raw':_0x126018[_0x994c('0x1b')]?_0x126018['options']['raw']===undefined?!![]:![]:!![],'where':_0x126018[_0x994c('0x1b')]?_0x126018[_0x994c('0x1b')][_0x994c('0x1c')]||null:null,'attributes':_0x126018['options']?_0x126018[_0x994c('0x1b')][_0x994c('0x1d')]||null:null,'limit':_0x126018['options']?_0x126018['options'][_0x994c('0x1e')]||null:null,'include':_0x126018[_0x994c('0x1b')]?_0x126018[_0x994c('0x1b')]['include']?_[_0x994c('0x1f')](_0x126018['options'][_0x994c('0x20')],function(_0x311f81){return{'model':db[_0x311f81['model']],'as':_0x311f81['as'],'attributes':_0x311f81[_0x994c('0x1d')],'include':_0x311f81[_0x994c('0x20')]?_[_0x994c('0x1f')](_0x311f81[_0x994c('0x20')],function(_0x8ff02e){return{'model':db[_0x8ff02e[_0x994c('0x21')]],'as':_0x8ff02e['as'],'attributes':_0x8ff02e[_0x994c('0x1d')],'include':_0x8ff02e[_0x994c('0x20')]?_[_0x994c('0x1f')](_0x8ff02e[_0x994c('0x20')],function(_0x10de08){return{'model':db[_0x10de08[_0x994c('0x21')]],'as':_0x10de08['as'],'attributes':_0x10de08['attributes']};}):[]};}):[]};}):[]:[]})[_0x994c('0x22')](function(_0x3cffb9){logger[_0x994c('0xe')](_0x994c('0x18'),_0x126018);logger[_0x994c('0x11')](_0x994c('0x18'),_0x126018,JSON[_0x994c('0x23')](_0x3cffb9));_0x49fa50(_0x3cffb9);})[_0x994c('0x17')](function(_0x26a27e){logger[_0x994c('0x13')](_0x994c('0x18'),_0x26a27e[_0x994c('0x15')],_0x126018);_0x508886(_0x59b26b[_0x994c('0x13')](0x1f4,_0x26a27e['message']));});});};exports['ShowChatQueue']=function(_0x3ff1a5){var _0xffbbd7=this;return new Promise(function(_0x317753,_0xebfd68){return db['ChatQueue'][_0x994c('0x24')]({'raw':_0x3ff1a5[_0x994c('0x1b')]?_0x3ff1a5[_0x994c('0x1b')][_0x994c('0x25')]===undefined?!![]:![]:!![],'where':_0x3ff1a5[_0x994c('0x1b')]?_0x3ff1a5[_0x994c('0x1b')]['where']||null:null,'attributes':_0x3ff1a5[_0x994c('0x1b')]?_0x3ff1a5[_0x994c('0x1b')][_0x994c('0x1d')]||null:null,'include':_0x3ff1a5[_0x994c('0x1b')]?_0x3ff1a5[_0x994c('0x1b')][_0x994c('0x20')]?_[_0x994c('0x1f')](_0x3ff1a5[_0x994c('0x1b')][_0x994c('0x20')],function(_0x3c7229){return{'model':db[_0x3c7229[_0x994c('0x21')]],'as':_0x3c7229['as'],'attributes':_0x3c7229['attributes'],'include':_0x3c7229[_0x994c('0x20')]?_[_0x994c('0x1f')](_0x3c7229['include'],function(_0x440cd4){return{'model':db[_0x440cd4[_0x994c('0x21')]],'as':_0x440cd4['as'],'attributes':_0x440cd4[_0x994c('0x1d')],'include':_0x440cd4['include']?_[_0x994c('0x1f')](_0x440cd4[_0x994c('0x20')],function(_0x2c85b1){return{'model':db[_0x2c85b1[_0x994c('0x21')]],'as':_0x2c85b1['as'],'attributes':_0x2c85b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x994c('0x22')](function(_0x3b18a9){logger[_0x994c('0xe')](_0x994c('0x26'),_0x3ff1a5);logger[_0x994c('0x11')]('ShowChatQueue',_0x3ff1a5,JSON[_0x994c('0x23')](_0x3b18a9));_0x317753(_0x3b18a9);})[_0x994c('0x17')](function(_0x451eb1){logger[_0x994c('0x13')](_0x994c('0x26'),_0x451eb1[_0x994c('0x15')],_0x3ff1a5);_0xebfd68(_0xffbbd7[_0x994c('0x13')](0x1f4,_0x451eb1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 0152819..4769d57 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 _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x345727,_0x207ab9){var _0x45d589=function(_0x145465){while(--_0x145465){_0x345727['push'](_0x345727['shift']());}};_0x45d589(++_0x207ab9);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x5c6efe,_0x34d91f){_0x5c6efe=_0x5c6efe-0x0;var _0x12654b=_0x7a2c[_0x5c6efe];return _0x12654b;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}}; \ No newline at end of file +var _0x7bae=['remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x582f4b,_0x23695c){var _0x37fdc7=function(_0x2cfe17){while(--_0x2cfe17){_0x582f4b['push'](_0x582f4b['shift']());}};_0x37fdc7(++_0x23695c);}(_0x7bae,0x13b));var _0xe7ba=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7bae[_0x411add];return _0x238242;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xe7ba('0x0'),_0xe7ba('0x1')];function createListener(_0x503803,_0x3963c7){return function(_0x4f2e91){_0x3963c7[_0xe7ba('0x2')](_0x503803,_0x4f2e91);};}function removeListener(_0x10908b,_0x166acb){return function(){ChatQueueEvents[_0xe7ba('0x3')](_0x10908b,_0x166acb);};}exports[_0xe7ba('0x4')]=function(_0xfd3a22){for(var _0x2d31df=0x0,_0x3c5e59=events[_0xe7ba('0x5')];_0x2d31df<_0x3c5e59;_0x2d31df++){var _0x34fb18=events[_0x2d31df];var _0x160565=createListener(_0xe7ba('0x6')+_0x34fb18,_0xfd3a22);ChatQueueEvents['on'](_0x34fb18,_0x160565);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 65f6540..5af19e9 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x2189a6,_0x30f1b1){var _0x16423c=function(_0x585e41){while(--_0x585e41){_0x2189a6['push'](_0x2189a6['shift']());}};_0x16423c(++_0x30f1b1);}(_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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x17eeae,_0x30d8e6){var _0xb8e2ff=function(_0x2ef24d){while(--_0x2ef24d){_0x17eeae['push'](_0x17eeae['shift']());}};_0xb8e2ff(++_0x30d8e6);}(_0x7217,0x19e));var _0x7721=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7217[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b31e24c..77ffcb5 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 _0xdded=['sequelize','exports','STRING','DATE'];(function(_0x2fd202,_0x564710){var _0x1ee6ca=function(_0x1dd659){while(--_0x1dd659){_0x2fd202['push'](_0x2fd202['shift']());}};_0x1ee6ca(++_0x564710);}(_0xdded,0x1a0));var _0xddde=function(_0x234d19,_0x5ab4fd){_0x234d19=_0x234d19-0x0;var _0x5d3602=_0xdded[_0x234d19];return _0x5d3602;};'use strict';var moment=require('moment');var Sequelize=require(_0xddde('0x0'));module[_0xddde('0x1')]={'uniqueid':{'type':Sequelize[_0xddde('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xddde('0x3')]},'leaveAt':{'type':Sequelize[_0xddde('0x3')]},'acceptAt':{'type':Sequelize[_0xddde('0x3')]},'exitAt':{'type':Sequelize[_0xddde('0x3')]},'reason':{'type':Sequelize[_0xddde('0x2')]}}; \ No newline at end of file +var _0xdc00=['DATE','sequelize','exports','STRING'];(function(_0x1249de,_0xf8a3b){var _0xe119f8=function(_0x3607e9){while(--_0x3607e9){_0x1249de['push'](_0x1249de['shift']());}};_0xe119f8(++_0xf8a3b);}(_0xdc00,0x1e1));var _0x0dc0=function(_0x1737c4,_0x118434){_0x1737c4=_0x1737c4-0x0;var _0x483481=_0xdc00[_0x1737c4];return _0x483481;};'use strict';var moment=require('moment');var Sequelize=require(_0x0dc0('0x0'));module[_0x0dc0('0x1')]={'uniqueid':{'type':Sequelize[_0x0dc0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0dc0('0x2')]},'joinAt':{'type':Sequelize[_0x0dc0('0x3')]},'leaveAt':{'type':Sequelize[_0x0dc0('0x3')]},'acceptAt':{'type':Sequelize[_0x0dc0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5b427ef..cb8d210 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 _0x4bd3=['reject','save','destroy','then','error','name','send','index','map','ChatQueueReport','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','order','sort','filters','where','VIRTUAL','filter','options','includeAll','show','params','include','catch','create','update','body','find','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x224f06,_0x56ed03){var _0x2ea51c=function(_0x429b75){while(--_0x429b75){_0x224f06['push'](_0x224f06['shift']());}};_0x2ea51c(++_0x56ed03);}(_0x4bd3,0x174));var _0x34bd=function(_0x32c4c6,_0x29980f){_0x32c4c6=_0x32c4c6-0x0;var _0x352be0=_0x4bd3[_0x32c4c6];return _0x352be0;};'use strict';var emlformat=require(_0x34bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34bd('0x1'));var jsonpatch=require(_0x34bd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34bd('0x3'));var util=require(_0x34bd('0x4'));var path=require(_0x34bd('0x5'));var sox=require('sox');var csv=require(_0x34bd('0x6'));var ejs=require(_0x34bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x6'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275d80,_0x1f19b9){_0x1f19b9=_0x1f19b9||0xcc;return function(_0x282af4){if(_0x282af4){return _0x275d80[_0x34bd('0x14')](_0x1f19b9);}return _0x275d80[_0x34bd('0x15')](_0x1f19b9)[_0x34bd('0x16')]();};}function respondWithResult(_0x4134ee,_0x236f6b){_0x236f6b=_0x236f6b||0xc8;return function(_0xf6d2f2){if(_0xf6d2f2){return _0x4134ee['status'](_0x236f6b)[_0x34bd('0x17')](_0xf6d2f2);}};}function respondWithFilteredResult(_0x4d4955,_0x4e3886){return function(_0x6638ed){if(_0x6638ed){var _0x30b3f2=typeof _0x4e3886[_0x34bd('0x18')]===_0x34bd('0x19')&&typeof _0x4e3886[_0x34bd('0x1a')]===_0x34bd('0x19');var _0xd39d72=_0x6638ed[_0x34bd('0x1b')];var _0x3b4bf8=_0x30b3f2?0x0:_0x4e3886[_0x34bd('0x18')];var _0x4b5ebb=_0x30b3f2?_0x6638ed['count']:_0x4e3886[_0x34bd('0x18')]+_0x4e3886[_0x34bd('0x1a')];var _0x265e70;if(_0x4b5ebb>=_0xd39d72){_0x4b5ebb=_0xd39d72;_0x265e70=0xc8;}else{_0x265e70=0xce;}_0x4d4955[_0x34bd('0x15')](_0x265e70);return _0x4d4955[_0x34bd('0x1c')](_0x34bd('0x1d'),_0x3b4bf8+'-'+_0x4b5ebb+'/'+_0xd39d72)[_0x34bd('0x17')](_0x6638ed);}return null;};}function patchUpdates(_0x3d5f76){return function(_0x130bd0){try{jsonpatch['apply'](_0x130bd0,_0x3d5f76,!![]);}catch(_0x15c0d1){return BPromise[_0x34bd('0x1e')](_0x15c0d1);}return _0x130bd0[_0x34bd('0x1f')]();};}function saveUpdates(_0x14254b,_0x463224){return function(_0x5e0c06){if(_0x5e0c06){return _0x5e0c06['update'](_0x14254b)['then'](function(_0x4edf84){return _0x4edf84;});}return null;};}function removeEntity(_0x3dafe8,_0x503a60){return function(_0x10fc4b){if(_0x10fc4b){return _0x10fc4b[_0x34bd('0x20')]()[_0x34bd('0x21')](function(){_0x3dafe8['status'](0xcc)[_0x34bd('0x16')]();});}};}function handleEntityNotFound(_0x14479a,_0x4f0dff){return function(_0x457006){if(!_0x457006){_0x14479a['sendStatus'](0x194);}return _0x457006;};}function handleError(_0x29bda8,_0xb256e8){_0xb256e8=_0xb256e8||0x1f4;return function(_0x264c94){logger[_0x34bd('0x22')](_0x264c94['stack']);if(_0x264c94[_0x34bd('0x23')]){delete _0x264c94[_0x34bd('0x23')];}_0x29bda8['status'](_0xb256e8)[_0x34bd('0x24')](_0x264c94);};}exports[_0x34bd('0x25')]=function(_0x16581f,_0x3f675c){var _0x26b8e7={},_0x4500c8={},_0x177d43={'count':0x0,'rows':[]};var _0x58b431=_[_0x34bd('0x26')](db[_0x34bd('0x27')]['rawAttributes'],function(_0x5d1662){return{'name':_0x5d1662[_0x34bd('0x28')],'type':_0x5d1662[_0x34bd('0x29')][_0x34bd('0x2a')]};});_0x4500c8['model']=_['map'](_0x58b431,_0x34bd('0x23'));_0x4500c8[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x16581f[_0x34bd('0x2b')]);_0x4500c8['filters']=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],_0x4500c8[_0x34bd('0x2b')]);_0x26b8e7[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],qs['fields'](_0x16581f[_0x34bd('0x2b')]['fields']));_0x26b8e7[_0x34bd('0x2f')]=_0x26b8e7[_0x34bd('0x2f')][_0x34bd('0x30')]?_0x26b8e7['attributes']:_0x4500c8[_0x34bd('0x2e')];if(!_0x16581f[_0x34bd('0x2b')]['hasOwnProperty'](_0x34bd('0x31'))){_0x26b8e7[_0x34bd('0x1a')]=qs[_0x34bd('0x1a')](_0x16581f['query'][_0x34bd('0x1a')]);_0x26b8e7[_0x34bd('0x18')]=qs['offset'](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x18')]);}_0x26b8e7[_0x34bd('0x32')]=qs[_0x34bd('0x33')](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x33')]);_0x26b8e7['where']=qs['filters'](_['pick'](_0x16581f[_0x34bd('0x2b')],_0x4500c8[_0x34bd('0x34')]),_0x58b431);if(_0x16581f['query']['filter']){_0x26b8e7[_0x34bd('0x35')]=_['merge'](_0x26b8e7['where'],{'$or':_[_0x34bd('0x26')](_0x58b431,function(_0xb5a456){if(_0xb5a456[_0x34bd('0x29')]!==_0x34bd('0x36')){var _0x2af1af={};_0x2af1af[_0xb5a456['name']]={'$like':'%'+_0x16581f['query'][_0x34bd('0x37')]+'%'};return _0x2af1af;}})});}_0x26b8e7=_['merge']({},_0x26b8e7,_0x16581f[_0x34bd('0x38')]);var _0x2c9b7a={'where':_0x26b8e7[_0x34bd('0x35')]};return db[_0x34bd('0x27')][_0x34bd('0x1b')](_0x2c9b7a)['then'](function(_0x282297){_0x177d43[_0x34bd('0x1b')]=_0x282297;if(_0x16581f[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x26b8e7['include']=[{'all':!![]}];}return db[_0x34bd('0x27')]['findAll'](_0x26b8e7);})[_0x34bd('0x21')](function(_0x560282){_0x177d43['rows']=_0x560282;return _0x177d43;})[_0x34bd('0x21')](respondWithFilteredResult(_0x3f675c,_0x26b8e7))['catch'](handleError(_0x3f675c,null));};exports[_0x34bd('0x3a')]=function(_0x3d3b96,_0x18e9f6){var _0x42a424={'raw':!![],'where':{'id':_0x3d3b96[_0x34bd('0x3b')]['id']}},_0x26d73e={};_0x26d73e[_0x34bd('0x2e')]=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x26d73e[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x3d3b96[_0x34bd('0x2b')]);_0x26d73e[_0x34bd('0x34')]=_['intersection'](_0x26d73e[_0x34bd('0x2e')],_0x26d73e[_0x34bd('0x2b')]);_0x42a424[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x26d73e[_0x34bd('0x2e')],qs['fields'](_0x3d3b96[_0x34bd('0x2b')]['fields']));_0x42a424['attributes']=_0x42a424[_0x34bd('0x2f')]['length']?_0x42a424[_0x34bd('0x2f')]:_0x26d73e[_0x34bd('0x2e')];if(_0x3d3b96[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x42a424[_0x34bd('0x3c')]=[{'all':!![]}];}_0x42a424=_['merge']({},_0x42a424,_0x3d3b96['options']);return db[_0x34bd('0x27')]['find'](_0x42a424)[_0x34bd('0x21')](handleEntityNotFound(_0x18e9f6,null))[_0x34bd('0x21')](respondWithResult(_0x18e9f6,null))[_0x34bd('0x3d')](handleError(_0x18e9f6,null));};exports['create']=function(_0x4ad00c,_0x4f96dd){return db['ChatQueueReport'][_0x34bd('0x3e')](_0x4ad00c['body'],{})[_0x34bd('0x21')](respondWithResult(_0x4f96dd,0xc9))['catch'](handleError(_0x4f96dd,null));};exports[_0x34bd('0x3f')]=function(_0x1d01d7,_0x1fa341){if(_0x1d01d7[_0x34bd('0x40')]['id']){delete _0x1d01d7[_0x34bd('0x40')]['id'];}return db['ChatQueueReport'][_0x34bd('0x41')]({'where':{'id':_0x1d01d7[_0x34bd('0x3b')]['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fa341,null))[_0x34bd('0x21')](saveUpdates(_0x1d01d7[_0x34bd('0x40')],null))['then'](respondWithResult(_0x1fa341,null))[_0x34bd('0x3d')](handleError(_0x1fa341,null));};exports[_0x34bd('0x20')]=function(_0x5bcce5,_0x1fc735){return db[_0x34bd('0x27')]['find']({'where':{'id':_0x5bcce5['params']['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fc735,null))['then'](removeEntity(_0x1fc735,null))['catch'](handleError(_0x1fc735,null));};exports[_0x34bd('0x42')]=function(_0x5df6a5,_0x556ce8){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x556ce8,null))[_0x34bd('0x3d')](handleError(_0x556ce8,null));}; \ No newline at end of file +var _0x5581=['offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0xf89cf0,_0x30d712){var _0x4b98df=function(_0x51f872){while(--_0x51f872){_0xf89cf0['push'](_0xf89cf0['shift']());}};_0x4b98df(++_0x30d712);}(_0x5581,0x115));var _0x1558=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5581[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x1558('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1558('0x1'));var jsonpatch=require(_0x1558('0x2'));var rp=require(_0x1558('0x3'));var moment=require(_0x1558('0x4'));var BPromise=require(_0x1558('0x5'));var Mustache=require(_0x1558('0x6'));var util=require('util');var path=require(_0x1558('0x7'));var sox=require(_0x1558('0x8'));var csv=require('to-csv');var ejs=require(_0x1558('0x9'));var fs=require('fs');var fs_extra=require(_0x1558('0xa'));var _=require('lodash');var squel=require(_0x1558('0xb'));var crypto=require(_0x1558('0xc'));var jsforce=require(_0x1558('0xd'));var deskjs=require(_0x1558('0xe'));var toCsv=require(_0x1558('0xf'));var querystring=require('querystring');var Papa=require(_0x1558('0x10'));var Redis=require(_0x1558('0x11'));var authService=require(_0x1558('0x12'));var qs=require(_0x1558('0x13'));var as=require(_0x1558('0x14'));var hardwareService=require(_0x1558('0x15'));var logger=require(_0x1558('0x16'))(_0x1558('0x17'));var utils=require(_0x1558('0x18'));var config=require(_0x1558('0x19'));var licenseUtil=require(_0x1558('0x1a'));var db=require(_0x1558('0x1b'))['db'];function respondWithStatusCode(_0x2044d1,_0x5ba878){_0x5ba878=_0x5ba878||0xcc;return function(_0x22ab0){if(_0x22ab0){return _0x2044d1[_0x1558('0x1c')](_0x5ba878);}return _0x2044d1[_0x1558('0x1d')](_0x5ba878)[_0x1558('0x1e')]();};}function respondWithResult(_0x27e978,_0x284608){_0x284608=_0x284608||0xc8;return function(_0x2a376c){if(_0x2a376c){return _0x27e978[_0x1558('0x1d')](_0x284608)[_0x1558('0x1f')](_0x2a376c);}};}function respondWithFilteredResult(_0x5ae8ce,_0x47347c){return function(_0xba47ba){if(_0xba47ba){var _0x1b781=typeof _0x47347c['offset']===_0x1558('0x20')&&typeof _0x47347c[_0x1558('0x21')]===_0x1558('0x20');var _0x2e3e05=_0xba47ba[_0x1558('0x22')];var _0x54cbb3=_0x1b781?0x0:_0x47347c['offset'];var _0x451547=_0x1b781?_0xba47ba[_0x1558('0x22')]:_0x47347c[_0x1558('0x23')]+_0x47347c[_0x1558('0x21')];var _0x1a46ae;if(_0x451547>=_0x2e3e05){_0x451547=_0x2e3e05;_0x1a46ae=0xc8;}else{_0x1a46ae=0xce;}_0x5ae8ce[_0x1558('0x1d')](_0x1a46ae);return _0x5ae8ce[_0x1558('0x24')](_0x1558('0x25'),_0x54cbb3+'-'+_0x451547+'/'+_0x2e3e05)['json'](_0xba47ba);}return null;};}function patchUpdates(_0x5bb8b3){return function(_0x56118b){try{jsonpatch[_0x1558('0x26')](_0x56118b,_0x5bb8b3,!![]);}catch(_0xc00fd0){return BPromise[_0x1558('0x27')](_0xc00fd0);}return _0x56118b[_0x1558('0x28')]();};}function saveUpdates(_0x37f448,_0x1646b7){return function(_0x251aa9){if(_0x251aa9){return _0x251aa9[_0x1558('0x29')](_0x37f448)['then'](function(_0x4107a5){return _0x4107a5;});}return null;};}function removeEntity(_0x487c0c,_0x2d64aa){return function(_0x10928c){if(_0x10928c){return _0x10928c[_0x1558('0x2a')]()[_0x1558('0x2b')](function(){_0x487c0c[_0x1558('0x1d')](0xcc)[_0x1558('0x1e')]();});}};}function handleEntityNotFound(_0x2ba561,_0x4dff68){return function(_0x46cbd5){if(!_0x46cbd5){_0x2ba561[_0x1558('0x1c')](0x194);}return _0x46cbd5;};}function handleError(_0x460156,_0x1ae7c4){_0x1ae7c4=_0x1ae7c4||0x1f4;return function(_0xca0eac){logger['error'](_0xca0eac[_0x1558('0x2c')]);if(_0xca0eac[_0x1558('0x2d')]){delete _0xca0eac[_0x1558('0x2d')];}_0x460156['status'](_0x1ae7c4)[_0x1558('0x2e')](_0xca0eac);};}exports[_0x1558('0x2f')]=function(_0x417678,_0x56edc3){var _0x2d0f08={},_0x53b11a={},_0x2bf88d={'count':0x0,'rows':[]};var _0x2a7637=_['map'](db[_0x1558('0x30')]['rawAttributes'],function(_0x516a89){return{'name':_0x516a89[_0x1558('0x31')],'type':_0x516a89[_0x1558('0x32')][_0x1558('0x33')]};});_0x53b11a[_0x1558('0x34')]=_[_0x1558('0x35')](_0x2a7637,'name');_0x53b11a['query']=_[_0x1558('0x36')](_0x417678[_0x1558('0x37')]);_0x53b11a[_0x1558('0x38')]=_[_0x1558('0x39')](_0x53b11a[_0x1558('0x34')],_0x53b11a[_0x1558('0x37')]);_0x2d0f08['attributes']=_[_0x1558('0x39')](_0x53b11a['model'],qs[_0x1558('0x3a')](_0x417678[_0x1558('0x37')][_0x1558('0x3a')]));_0x2d0f08[_0x1558('0x3b')]=_0x2d0f08[_0x1558('0x3b')][_0x1558('0x3c')]?_0x2d0f08[_0x1558('0x3b')]:_0x53b11a[_0x1558('0x34')];if(!_0x417678['query']['hasOwnProperty'](_0x1558('0x3d'))){_0x2d0f08[_0x1558('0x21')]=qs['limit'](_0x417678['query']['limit']);_0x2d0f08[_0x1558('0x23')]=qs['offset'](_0x417678[_0x1558('0x37')][_0x1558('0x23')]);}_0x2d0f08['order']=qs[_0x1558('0x3e')](_0x417678['query'][_0x1558('0x3e')]);_0x2d0f08['where']=qs[_0x1558('0x38')](_['pick'](_0x417678[_0x1558('0x37')],_0x53b11a[_0x1558('0x38')]),_0x2a7637);if(_0x417678[_0x1558('0x37')][_0x1558('0x3f')]){_0x2d0f08[_0x1558('0x40')]=_[_0x1558('0x41')](_0x2d0f08[_0x1558('0x40')],{'$or':_[_0x1558('0x35')](_0x2a7637,function(_0x32158b){if(_0x32158b['type']!=='VIRTUAL'){var _0x31d0ef={};_0x31d0ef[_0x32158b[_0x1558('0x2d')]]={'$like':'%'+_0x417678[_0x1558('0x37')][_0x1558('0x3f')]+'%'};return _0x31d0ef;}})});}_0x2d0f08=_[_0x1558('0x41')]({},_0x2d0f08,_0x417678[_0x1558('0x42')]);var _0x422e58={'where':_0x2d0f08['where']};return db[_0x1558('0x30')]['count'](_0x422e58)[_0x1558('0x2b')](function(_0x598371){_0x2bf88d[_0x1558('0x22')]=_0x598371;if(_0x417678[_0x1558('0x37')][_0x1558('0x43')]){_0x2d0f08[_0x1558('0x44')]=[{'all':!![]}];}return db[_0x1558('0x30')]['findAll'](_0x2d0f08);})[_0x1558('0x2b')](function(_0x48bd37){_0x2bf88d[_0x1558('0x45')]=_0x48bd37;return _0x2bf88d;})[_0x1558('0x2b')](respondWithFilteredResult(_0x56edc3,_0x2d0f08))[_0x1558('0x46')](handleError(_0x56edc3,null));};exports[_0x1558('0x47')]=function(_0x3e060f,_0xdf63cb){var _0x70e2d7={'raw':!![],'where':{'id':_0x3e060f[_0x1558('0x48')]['id']}},_0x5da544={};_0x5da544['model']=_['keys'](db[_0x1558('0x30')][_0x1558('0x49')]);_0x5da544['query']=_[_0x1558('0x36')](_0x3e060f[_0x1558('0x37')]);_0x5da544[_0x1558('0x38')]=_['intersection'](_0x5da544[_0x1558('0x34')],_0x5da544[_0x1558('0x37')]);_0x70e2d7['attributes']=_[_0x1558('0x39')](_0x5da544[_0x1558('0x34')],qs[_0x1558('0x3a')](_0x3e060f['query'][_0x1558('0x3a')]));_0x70e2d7['attributes']=_0x70e2d7[_0x1558('0x3b')][_0x1558('0x3c')]?_0x70e2d7[_0x1558('0x3b')]:_0x5da544[_0x1558('0x34')];if(_0x3e060f[_0x1558('0x37')][_0x1558('0x43')]){_0x70e2d7[_0x1558('0x44')]=[{'all':!![]}];}_0x70e2d7=_['merge']({},_0x70e2d7,_0x3e060f[_0x1558('0x42')]);return db['ChatQueueReport'][_0x1558('0x4a')](_0x70e2d7)['then'](handleEntityNotFound(_0xdf63cb,null))['then'](respondWithResult(_0xdf63cb,null))[_0x1558('0x46')](handleError(_0xdf63cb,null));};exports['create']=function(_0x4a2869,_0x2c34bd){return db[_0x1558('0x30')][_0x1558('0x4b')](_0x4a2869['body'],{})[_0x1558('0x2b')](respondWithResult(_0x2c34bd,0xc9))[_0x1558('0x46')](handleError(_0x2c34bd,null));};exports[_0x1558('0x29')]=function(_0x7e2bd7,_0x22ff42){if(_0x7e2bd7[_0x1558('0x4c')]['id']){delete _0x7e2bd7['body']['id'];}return db[_0x1558('0x30')][_0x1558('0x4a')]({'where':{'id':_0x7e2bd7[_0x1558('0x48')]['id']}})[_0x1558('0x2b')](handleEntityNotFound(_0x22ff42,null))[_0x1558('0x2b')](saveUpdates(_0x7e2bd7['body'],null))[_0x1558('0x2b')](respondWithResult(_0x22ff42,null))[_0x1558('0x46')](handleError(_0x22ff42,null));};exports['destroy']=function(_0x58b1cf,_0x21fbc8){return db['ChatQueueReport'][_0x1558('0x4a')]({'where':{'id':_0x58b1cf['params']['id']}})[_0x1558('0x2b')](handleEntityNotFound(_0x21fbc8,null))[_0x1558('0x2b')](removeEntity(_0x21fbc8,null))[_0x1558('0x46')](handleError(_0x21fbc8,null));};exports[_0x1558('0x4d')]=function(_0x54e33e,_0x2429bd){return db[_0x1558('0x30')][_0x1558('0x4d')]()['then'](respondWithResult(_0x2429bd,null))[_0x1558('0x46')](handleError(_0x2429bd,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 13d0883..e634f47 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x393d47,_0x2dba3f){var _0x14cbba=function(_0x1343b2){while(--_0x1343b2){_0x393d47['push'](_0x393d47['shift']());}};_0x14cbba(++_0x2dba3f);}(_0x757a,0xde));var _0xa757=function(_0x593cbc,_0x3c321d){_0x593cbc=_0x593cbc-0x0;var _0x2ea604=_0x757a[_0x593cbc];return _0x2ea604;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x5107bb,_0x345e60){var _0x239bf0=function(_0x46f3f4){while(--_0x46f3f4){_0x5107bb['push'](_0x5107bb['shift']());}};_0x239bf0(++_0x345e60);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 62808d1..6afd15f 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 _0x1943=['update','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','body','options','debug','catch','UpdateChatQueueReport'];(function(_0x283eca,_0x10e4e0){var _0x1c56a6=function(_0x42bf2d){while(--_0x42bf2d){_0x283eca['push'](_0x283eca['shift']());}};_0x1c56a6(++_0x10e4e0);}(_0x1943,0x124));var _0x3194=function(_0x34e337,_0x1e5979){_0x34e337=_0x34e337-0x0;var _0x8eaab4=_0x1943[_0x34e337];return _0x8eaab4;};'use strict';var _=require(_0x3194('0x0'));var util=require(_0x3194('0x1'));var moment=require(_0x3194('0x2'));var BPromise=require(_0x3194('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3194('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3194('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3194('0x6'));var jayson=require(_0x3194('0x7'));var client=jayson[_0x3194('0x8')][_0x3194('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x431c9d,_0x2fe700,_0xfa5116){return new BPromise(function(_0x30ee64,_0x11729b){return client[_0x3194('0xa')](_0x431c9d,_0xfa5116)[_0x3194('0xb')](function(_0x5b99bb){logger[_0x3194('0xc')](_0x3194('0xd'),_0x2fe700,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2fe700,_0x3194('0xe'),JSON[_0x3194('0xf')](_0x5b99bb));if(_0x5b99bb[_0x3194('0x10')]){if(_0x5b99bb[_0x3194('0x10')][_0x3194('0x11')]===0x1f4){logger[_0x3194('0x10')](_0x3194('0xd'),_0x2fe700,_0x5b99bb[_0x3194('0x10')][_0x3194('0x12')]);return _0x11729b(_0x5b99bb[_0x3194('0x10')][_0x3194('0x12')]);}logger['error'](_0x3194('0xd'),_0x2fe700,_0x5b99bb[_0x3194('0x10')]['message']);return _0x30ee64(_0x5b99bb['error']['message']);}else{logger[_0x3194('0xc')](_0x3194('0xd'),_0x2fe700,_0x3194('0xe'));_0x30ee64(_0x5b99bb[_0x3194('0x13')][_0x3194('0x12')]);}})['catch'](function(_0x38ffd0){logger[_0x3194('0x10')](_0x3194('0xd'),_0x2fe700,_0x38ffd0);_0x11729b(_0x38ffd0);});});}exports[_0x3194('0x14')]=function(_0x305b2a){var _0x264598=this;return new Promise(function(_0x4646b0,_0x6806aa){return db[_0x3194('0x15')]['create'](_0x305b2a[_0x3194('0x16')],{'raw':_0x305b2a[_0x3194('0x17')]?_0x305b2a[_0x3194('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x51c388){logger[_0x3194('0xc')](_0x3194('0x14'),_0x305b2a);logger[_0x3194('0x18')]('CreateChatQueueReport',_0x305b2a,JSON[_0x3194('0xf')](_0x51c388));_0x4646b0(_0x51c388);})[_0x3194('0x19')](function(_0x7322ea){logger[_0x3194('0x10')](_0x3194('0x14'),_0x7322ea['message'],_0x305b2a);_0x6806aa(_0x264598[_0x3194('0x10')](0x1f4,_0x7322ea['message']));});});};exports[_0x3194('0x1a')]=function(_0x8f2683){var _0x29f936=this;return new Promise(function(_0x2691ca,_0x3e99a5){return db['ChatQueueReport'][_0x3194('0x1b')](_0x8f2683[_0x3194('0x16')],{'raw':_0x8f2683[_0x3194('0x17')]?_0x8f2683[_0x3194('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8f2683['options']?_0x8f2683[_0x3194('0x17')][_0x3194('0x1c')]||null:null,'attributes':_0x8f2683[_0x3194('0x17')]?_0x8f2683[_0x3194('0x17')]['attributes']||null:null,'limit':_0x8f2683['options']?_0x8f2683[_0x3194('0x17')]['limit']||null:null})[_0x3194('0xb')](function(_0x2233ef){logger[_0x3194('0xc')](_0x3194('0x1a'),_0x8f2683);logger['debug']('UpdateChatQueueReport',_0x8f2683,JSON[_0x3194('0xf')](_0x2233ef));_0x2691ca(_0x2233ef);})[_0x3194('0x19')](function(_0x592b48){logger[_0x3194('0x10')](_0x3194('0x1a'),_0x592b48['message'],_0x8f2683);_0x3e99a5(_0x29f936[_0x3194('0x10')](0x1f4,_0x592b48[_0x3194('0x12')]));});});}; \ No newline at end of file +var _0xacae=['stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xacae,0x72));var _0xeaca=function(_0x3a3cd6,_0x8e111e){_0x3a3cd6=_0x3a3cd6-0x0;var _0x120930=_0xacae[_0x3a3cd6];return _0x120930;};'use strict';var _=require(_0xeaca('0x0'));var util=require(_0xeaca('0x1'));var moment=require(_0xeaca('0x2'));var BPromise=require(_0xeaca('0x3'));var rs=require(_0xeaca('0x4'));var fs=require('fs');var Redis=require(_0xeaca('0x5'));var db=require(_0xeaca('0x6'))['db'];var utils=require(_0xeaca('0x7'));var logger=require(_0xeaca('0x8'))(_0xeaca('0x9'));var config=require(_0xeaca('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xeaca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57924a,_0x403243,_0x2ff070){return new BPromise(function(_0x51de6f,_0x2cb843){return client['request'](_0x57924a,_0x2ff070)[_0xeaca('0xc')](function(_0x4cb419){logger[_0xeaca('0xd')](_0xeaca('0xe'),_0x403243,_0xeaca('0xf'));logger[_0xeaca('0x10')](_0xeaca('0x11'),_0x403243,_0xeaca('0xf'),JSON[_0xeaca('0x12')](_0x4cb419));if(_0x4cb419[_0xeaca('0x13')]){if(_0x4cb419[_0xeaca('0x13')][_0xeaca('0x14')]===0x1f4){logger[_0xeaca('0x13')](_0xeaca('0xe'),_0x403243,_0x4cb419[_0xeaca('0x13')]['message']);return _0x2cb843(_0x4cb419[_0xeaca('0x13')][_0xeaca('0x15')]);}logger['error'](_0xeaca('0xe'),_0x403243,_0x4cb419[_0xeaca('0x13')][_0xeaca('0x15')]);return _0x51de6f(_0x4cb419[_0xeaca('0x13')]['message']);}else{logger[_0xeaca('0xd')](_0xeaca('0xe'),_0x403243,_0xeaca('0xf'));_0x51de6f(_0x4cb419[_0xeaca('0x16')][_0xeaca('0x15')]);}})[_0xeaca('0x17')](function(_0x2b01fe){logger[_0xeaca('0x13')](_0xeaca('0xe'),_0x403243,_0x2b01fe);_0x2cb843(_0x2b01fe);});});}exports[_0xeaca('0x18')]=function(_0x2d223b){var _0x428599=this;return new Promise(function(_0x265538,_0x14a97c){return db['ChatQueueReport'][_0xeaca('0x19')](_0x2d223b[_0xeaca('0x1a')],{'raw':_0x2d223b[_0xeaca('0x1b')]?_0x2d223b['options'][_0xeaca('0x1c')]===undefined?!![]:![]:!![]})[_0xeaca('0xc')](function(_0x35e12f){logger[_0xeaca('0xd')]('CreateChatQueueReport',_0x2d223b);logger[_0xeaca('0x10')]('CreateChatQueueReport',_0x2d223b,JSON[_0xeaca('0x12')](_0x35e12f));_0x265538(_0x35e12f);})[_0xeaca('0x17')](function(_0x4df5fb){logger[_0xeaca('0x13')](_0xeaca('0x18'),_0x4df5fb[_0xeaca('0x15')],_0x2d223b);_0x14a97c(_0x428599[_0xeaca('0x13')](0x1f4,_0x4df5fb['message']));});});};exports['UpdateChatQueueReport']=function(_0xe2b7d){var _0x373681=this;return new Promise(function(_0x187e2f,_0x5f0454){return db['ChatQueueReport']['update'](_0xe2b7d['body'],{'raw':_0xe2b7d[_0xeaca('0x1b')]?_0xe2b7d[_0xeaca('0x1b')][_0xeaca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe2b7d[_0xeaca('0x1b')]?_0xe2b7d['options'][_0xeaca('0x1d')]||null:null,'attributes':_0xe2b7d[_0xeaca('0x1b')]?_0xe2b7d[_0xeaca('0x1b')][_0xeaca('0x1e')]||null:null,'limit':_0xe2b7d[_0xeaca('0x1b')]?_0xe2b7d[_0xeaca('0x1b')][_0xeaca('0x1f')]||null:null})[_0xeaca('0xc')](function(_0x10522b){logger[_0xeaca('0xd')](_0xeaca('0x20'),_0xe2b7d);logger[_0xeaca('0x10')](_0xeaca('0x20'),_0xe2b7d,JSON['stringify'](_0x10522b));_0x187e2f(_0x10522b);})[_0xeaca('0x17')](function(_0x55d507){logger[_0xeaca('0x13')]('UpdateChatQueueReport',_0x55d507[_0xeaca('0x15')],_0xe2b7d);_0x5f0454(_0x373681[_0xeaca('0x13')](0x1f4,_0x55d507[_0xeaca('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 56bf2a4..dbfe8b2 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 _0x4dd5=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','delete','destroy','exports','multer','path'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x4dd5,0x10c));var _0x54dd=function(_0x4756c2,_0x3c5da3){_0x4756c2=_0x4756c2-0x0;var _0x4a5022=_0x4dd5[_0x4756c2];return _0x4a5022;};'use strict';var multer=require(_0x54dd('0x0'));var util=require('util');var path=require(_0x54dd('0x1'));var timeout=require(_0x54dd('0x2'));var express=require('express');var router=express[_0x54dd('0x3')]();var fs_extra=require(_0x54dd('0x4'));var auth=require(_0x54dd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x54dd('0x6'));var controller=require(_0x54dd('0x7'));router[_0x54dd('0x8')]('/',auth[_0x54dd('0x9')](),controller['index']);router[_0x54dd('0x8')](_0x54dd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x54dd('0x8')](_0x54dd('0xb'),auth[_0x54dd('0x9')](),controller['show']);router[_0x54dd('0xc')]('/',auth[_0x54dd('0x9')](),controller[_0x54dd('0xd')]);router[_0x54dd('0xe')](_0x54dd('0xb'),auth[_0x54dd('0x9')](),controller['update']);router[_0x54dd('0xf')](_0x54dd('0xb'),auth[_0x54dd('0x9')](),controller[_0x54dd('0x10')]);module[_0x54dd('0x11')]=router; \ No newline at end of file +var _0xb037=['index','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x476f24,_0x4f72b3){var _0x1aca7f=function(_0x4e5066){while(--_0x4e5066){_0x476f24['push'](_0x476f24['shift']());}};_0x1aca7f(++_0x4f72b3);}(_0xb037,0x1ea));var _0x7b03=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xb037[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x7b03('0x0'));var util=require(_0x7b03('0x1'));var path=require(_0x7b03('0x2'));var timeout=require(_0x7b03('0x3'));var express=require(_0x7b03('0x4'));var router=express[_0x7b03('0x5')]();var fs_extra=require(_0x7b03('0x6'));var auth=require(_0x7b03('0x7'));var interaction=require(_0x7b03('0x8'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x7b03('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b03('0xa')]);router[_0x7b03('0x9')]('/describe',auth[_0x7b03('0xb')](),controller['describe']);router[_0x7b03('0x9')](_0x7b03('0xc'),auth[_0x7b03('0xb')](),controller[_0x7b03('0xd')]);router[_0x7b03('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7b03('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7b03('0x10')]);router[_0x7b03('0x11')](_0x7b03('0xc'),auth['isAuthenticated'](),controller[_0x7b03('0x12')]);module[_0x7b03('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 9f396f7..5fd17dd 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x5bef0a,_0x1fb747){var _0x1a02ea=function(_0x51cc55){while(--_0x51cc55){_0x5bef0a['push'](_0x5bef0a['shift']());}};_0x1a02ea(++_0x1fb747);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x4b84[_0x1a8bbc];return _0x212fc2;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1493cb,_0x5711f1){var _0x3a6357=function(_0x263875){while(--_0x263875){_0x1493cb['push'](_0x1493cb['shift']());}};_0x3a6357(++_0x5711f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1e682b5..e36b86c 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 _0x530d=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','then','includeAll','findAll','rows','catch','show','keys','include','find','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x295e4f,_0x574f72){var _0x2005f7=function(_0xa446f1){while(--_0xa446f1){_0x295e4f['push'](_0x295e4f['shift']());}};_0x2005f7(++_0x574f72);}(_0x530d,0x167));var _0xd530=function(_0x7d87fd,_0x533931){_0x7d87fd=_0x7d87fd-0x0;var _0x1b620d=_0x530d[_0x7d87fd];return _0x1b620d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd530('0x0'));var zipdir=require(_0xd530('0x1'));var jsonpatch=require(_0xd530('0x2'));var rp=require('request-promise');var moment=require(_0xd530('0x3'));var BPromise=require(_0xd530('0x4'));var Mustache=require(_0xd530('0x5'));var util=require(_0xd530('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd530('0x7'));var ejs=require(_0xd530('0x8'));var fs=require('fs');var fs_extra=require(_0xd530('0x9'));var _=require(_0xd530('0xa'));var squel=require(_0xd530('0xb'));var crypto=require(_0xd530('0xc'));var jsforce=require(_0xd530('0xd'));var deskjs=require(_0xd530('0xe'));var toCsv=require(_0xd530('0x7'));var querystring=require(_0xd530('0xf'));var Papa=require(_0xd530('0x10'));var Redis=require(_0xd530('0x11'));var authService=require(_0xd530('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd530('0x13'));var logger=require('../../config/logger')(_0xd530('0x14'));var utils=require(_0xd530('0x15'));var config=require(_0xd530('0x16'));var licenseUtil=require(_0xd530('0x17'));var db=require(_0xd530('0x18'))['db'];function respondWithStatusCode(_0x4671fc,_0x41ada7){_0x41ada7=_0x41ada7||0xcc;return function(_0x3210ad){if(_0x3210ad){return _0x4671fc[_0xd530('0x19')](_0x41ada7);}return _0x4671fc[_0xd530('0x1a')](_0x41ada7)[_0xd530('0x1b')]();};}function respondWithResult(_0x3ca858,_0x5dd64a){_0x5dd64a=_0x5dd64a||0xc8;return function(_0x492ef1){if(_0x492ef1){return _0x3ca858['status'](_0x5dd64a)[_0xd530('0x1c')](_0x492ef1);}};}function respondWithFilteredResult(_0x1eda28,_0x281afb){return function(_0x19081c){if(_0x19081c){var _0x1a91dd=typeof _0x281afb[_0xd530('0x1d')]===_0xd530('0x1e')&&typeof _0x281afb[_0xd530('0x1f')]==='undefined';var _0x7f1b7=_0x19081c['count'];var _0x2fda54=_0x1a91dd?0x0:_0x281afb[_0xd530('0x1d')];var _0x2a88a1=_0x1a91dd?_0x19081c[_0xd530('0x20')]:_0x281afb['offset']+_0x281afb['limit'];var _0x256ae6;if(_0x2a88a1>=_0x7f1b7){_0x2a88a1=_0x7f1b7;_0x256ae6=0xc8;}else{_0x256ae6=0xce;}_0x1eda28['status'](_0x256ae6);return _0x1eda28[_0xd530('0x21')](_0xd530('0x22'),_0x2fda54+'-'+_0x2a88a1+'/'+_0x7f1b7)[_0xd530('0x1c')](_0x19081c);}return null;};}function patchUpdates(_0x3945dd){return function(_0x12d556){try{jsonpatch['apply'](_0x12d556,_0x3945dd,!![]);}catch(_0x33a72e){return BPromise[_0xd530('0x23')](_0x33a72e);}return _0x12d556[_0xd530('0x24')]();};}function saveUpdates(_0x3810af,_0x4c3626){return function(_0x59f194){if(_0x59f194){return _0x59f194[_0xd530('0x25')](_0x3810af)['then'](function(_0x1f8642){return _0x1f8642;});}return null;};}function removeEntity(_0x556e0b,_0x1b1ed5){return function(_0x469d1e){if(_0x469d1e){return _0x469d1e[_0xd530('0x26')]()['then'](function(){_0x556e0b[_0xd530('0x1a')](0xcc)[_0xd530('0x1b')]();});}};}function handleEntityNotFound(_0x38cb43,_0x302a62){return function(_0x2e254d){if(!_0x2e254d){_0x38cb43[_0xd530('0x19')](0x194);}return _0x2e254d;};}function handleError(_0x7e2871,_0x22a0cf){_0x22a0cf=_0x22a0cf||0x1f4;return function(_0x480db4){logger['error'](_0x480db4[_0xd530('0x27')]);if(_0x480db4[_0xd530('0x28')]){delete _0x480db4[_0xd530('0x28')];}_0x7e2871['status'](_0x22a0cf)[_0xd530('0x29')](_0x480db4);};}exports[_0xd530('0x2a')]=function(_0xff53aa,_0x4bed27){var _0x429d22={},_0x3bda8f={},_0x465722={'count':0x0,'rows':[]};var _0x3ab351=_[_0xd530('0x2b')](db[_0xd530('0x2c')][_0xd530('0x2d')],function(_0x14d47){return{'name':_0x14d47[_0xd530('0x2e')],'type':_0x14d47['type'][_0xd530('0x2f')]};});_0x3bda8f[_0xd530('0x30')]=_[_0xd530('0x2b')](_0x3ab351,'name');_0x3bda8f['query']=_['keys'](_0xff53aa[_0xd530('0x31')]);_0x3bda8f[_0xd530('0x32')]=_['intersection'](_0x3bda8f[_0xd530('0x30')],_0x3bda8f['query']);_0x429d22[_0xd530('0x33')]=_[_0xd530('0x34')](_0x3bda8f[_0xd530('0x30')],qs[_0xd530('0x35')](_0xff53aa[_0xd530('0x31')][_0xd530('0x35')]));_0x429d22[_0xd530('0x33')]=_0x429d22[_0xd530('0x33')][_0xd530('0x36')]?_0x429d22[_0xd530('0x33')]:_0x3bda8f[_0xd530('0x30')];if(!_0xff53aa[_0xd530('0x31')][_0xd530('0x37')](_0xd530('0x38'))){_0x429d22[_0xd530('0x1f')]=qs[_0xd530('0x1f')](_0xff53aa['query'][_0xd530('0x1f')]);_0x429d22[_0xd530('0x1d')]=qs[_0xd530('0x1d')](_0xff53aa['query']['offset']);}_0x429d22[_0xd530('0x39')]=qs[_0xd530('0x3a')](_0xff53aa[_0xd530('0x31')][_0xd530('0x3a')]);_0x429d22[_0xd530('0x3b')]=qs[_0xd530('0x32')](_[_0xd530('0x3c')](_0xff53aa[_0xd530('0x31')],_0x3bda8f[_0xd530('0x32')]),_0x3ab351);if(_0xff53aa[_0xd530('0x31')][_0xd530('0x3d')]){_0x429d22[_0xd530('0x3b')]=_['merge'](_0x429d22['where'],{'$or':_['map'](_0x3ab351,function(_0x37f73b){if(_0x37f73b[_0xd530('0x3e')]!=='VIRTUAL'){var _0x3a6072={};_0x3a6072[_0x37f73b[_0xd530('0x28')]]={'$like':'%'+_0xff53aa[_0xd530('0x31')][_0xd530('0x3d')]+'%'};return _0x3a6072;}})});}_0x429d22=_[_0xd530('0x3f')]({},_0x429d22,_0xff53aa[_0xd530('0x40')]);var _0x55905f={'where':_0x429d22[_0xd530('0x3b')]};return db[_0xd530('0x2c')][_0xd530('0x20')](_0x55905f)[_0xd530('0x41')](function(_0x540d9a){_0x465722['count']=_0x540d9a;if(_0xff53aa[_0xd530('0x31')][_0xd530('0x42')]){_0x429d22['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xd530('0x43')](_0x429d22);})[_0xd530('0x41')](function(_0x2a2725){_0x465722[_0xd530('0x44')]=_0x2a2725;return _0x465722;})['then'](respondWithFilteredResult(_0x4bed27,_0x429d22))[_0xd530('0x45')](handleError(_0x4bed27,null));};exports[_0xd530('0x46')]=function(_0x4da253,_0x40ff31){var _0x5127c1={'raw':!![],'where':{'id':_0x4da253['params']['id']}},_0x213e9d={};_0x213e9d['model']=_['keys'](db[_0xd530('0x2c')][_0xd530('0x2d')]);_0x213e9d[_0xd530('0x31')]=_[_0xd530('0x47')](_0x4da253[_0xd530('0x31')]);_0x213e9d[_0xd530('0x32')]=_[_0xd530('0x34')](_0x213e9d[_0xd530('0x30')],_0x213e9d[_0xd530('0x31')]);_0x5127c1[_0xd530('0x33')]=_['intersection'](_0x213e9d[_0xd530('0x30')],qs[_0xd530('0x35')](_0x4da253[_0xd530('0x31')]['fields']));_0x5127c1['attributes']=_0x5127c1['attributes'][_0xd530('0x36')]?_0x5127c1[_0xd530('0x33')]:_0x213e9d[_0xd530('0x30')];if(_0x4da253['query']['includeAll']){_0x5127c1[_0xd530('0x48')]=[{'all':!![]}];}_0x5127c1=_[_0xd530('0x3f')]({},_0x5127c1,_0x4da253[_0xd530('0x40')]);return db[_0xd530('0x2c')][_0xd530('0x49')](_0x5127c1)[_0xd530('0x41')](handleEntityNotFound(_0x40ff31,null))[_0xd530('0x41')](respondWithResult(_0x40ff31,null))[_0xd530('0x45')](handleError(_0x40ff31,null));};exports['create']=function(_0x2c9d5e,_0x4026be){return db[_0xd530('0x2c')]['create'](_0x2c9d5e[_0xd530('0x4a')],{})[_0xd530('0x41')](respondWithResult(_0x4026be,0xc9))['catch'](handleError(_0x4026be,null));};exports[_0xd530('0x25')]=function(_0x21af0e,_0x25cf80){if(_0x21af0e[_0xd530('0x4a')]['id']){delete _0x21af0e[_0xd530('0x4a')]['id'];}return db['ChatTransferReport'][_0xd530('0x49')]({'where':{'id':_0x21af0e[_0xd530('0x4b')]['id']}})[_0xd530('0x41')](handleEntityNotFound(_0x25cf80,null))[_0xd530('0x41')](saveUpdates(_0x21af0e[_0xd530('0x4a')],null))[_0xd530('0x41')](respondWithResult(_0x25cf80,null))[_0xd530('0x45')](handleError(_0x25cf80,null));};exports[_0xd530('0x26')]=function(_0x58f2c5,_0x235d9c){return db[_0xd530('0x2c')][_0xd530('0x49')]({'where':{'id':_0x58f2c5[_0xd530('0x4b')]['id']}})[_0xd530('0x41')](handleEntityNotFound(_0x235d9c,null))['then'](removeEntity(_0x235d9c,null))['catch'](handleError(_0x235d9c,null));};exports[_0xd530('0x4c')]=function(_0xeb4b8d,_0x4393a9){return db['ChatTransferReport'][_0xd530('0x4c')]()[_0xd530('0x41')](respondWithResult(_0x4393a9,null))[_0xd530('0x45')](handleError(_0x4393a9,null));}; \ No newline at end of file +var _0x1661=['rows','show','params','keys','create','body','catch','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','intersection','attributes','fields','query','length','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','ChatTransferReport','findAll'];(function(_0x46d441,_0xbdfd45){var _0x54b5d2=function(_0x36689){while(--_0x36689){_0x46d441['push'](_0x46d441['shift']());}};_0x54b5d2(++_0xbdfd45);}(_0x1661,0x18b));var _0x1166=function(_0x3a82a4,_0x184279){_0x3a82a4=_0x3a82a4-0x0;var _0x2c656b=_0x1661[_0x3a82a4];return _0x2c656b;};'use strict';var emlformat=require(_0x1166('0x0'));var rimraf=require(_0x1166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1166('0x2'));var rp=require(_0x1166('0x3'));var moment=require('moment');var BPromise=require(_0x1166('0x4'));var Mustache=require(_0x1166('0x5'));var util=require(_0x1166('0x6'));var path=require(_0x1166('0x7'));var sox=require(_0x1166('0x8'));var csv=require(_0x1166('0x9'));var ejs=require(_0x1166('0xa'));var fs=require('fs');var fs_extra=require(_0x1166('0xb'));var _=require(_0x1166('0xc'));var squel=require(_0x1166('0xd'));var crypto=require('crypto');var jsforce=require(_0x1166('0xe'));var deskjs=require(_0x1166('0xf'));var toCsv=require(_0x1166('0x9'));var querystring=require(_0x1166('0x10'));var Papa=require(_0x1166('0x11'));var Redis=require(_0x1166('0x12'));var authService=require(_0x1166('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1166('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1166('0x15'))(_0x1166('0x16'));var utils=require(_0x1166('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1166('0x18'));var db=require(_0x1166('0x19'))['db'];function respondWithStatusCode(_0x3404bf,_0x2fc61c){_0x2fc61c=_0x2fc61c||0xcc;return function(_0x5bcd79){if(_0x5bcd79){return _0x3404bf[_0x1166('0x1a')](_0x2fc61c);}return _0x3404bf[_0x1166('0x1b')](_0x2fc61c)['end']();};}function respondWithResult(_0x546a35,_0xadb3b8){_0xadb3b8=_0xadb3b8||0xc8;return function(_0x141813){if(_0x141813){return _0x546a35[_0x1166('0x1b')](_0xadb3b8)['json'](_0x141813);}};}function respondWithFilteredResult(_0x2b4dc8,_0x2fa9f7){return function(_0x2d8a0c){if(_0x2d8a0c){var _0x3bf895=typeof _0x2fa9f7[_0x1166('0x1c')]==='undefined'&&typeof _0x2fa9f7[_0x1166('0x1d')]==='undefined';var _0x1364a1=_0x2d8a0c['count'];var _0x53cf6d=_0x3bf895?0x0:_0x2fa9f7[_0x1166('0x1c')];var _0x4fdfc0=_0x3bf895?_0x2d8a0c[_0x1166('0x1e')]:_0x2fa9f7[_0x1166('0x1c')]+_0x2fa9f7['limit'];var _0x511828;if(_0x4fdfc0>=_0x1364a1){_0x4fdfc0=_0x1364a1;_0x511828=0xc8;}else{_0x511828=0xce;}_0x2b4dc8[_0x1166('0x1b')](_0x511828);return _0x2b4dc8[_0x1166('0x1f')](_0x1166('0x20'),_0x53cf6d+'-'+_0x4fdfc0+'/'+_0x1364a1)[_0x1166('0x21')](_0x2d8a0c);}return null;};}function patchUpdates(_0x275b66){return function(_0x5d0e9d){try{jsonpatch[_0x1166('0x22')](_0x5d0e9d,_0x275b66,!![]);}catch(_0x43df22){return BPromise[_0x1166('0x23')](_0x43df22);}return _0x5d0e9d['save']();};}function saveUpdates(_0x7ea09d,_0x1b0a4a){return function(_0x2cb2ea){if(_0x2cb2ea){return _0x2cb2ea['update'](_0x7ea09d)['then'](function(_0x4b2463){return _0x4b2463;});}return null;};}function removeEntity(_0x468aa5,_0x56b81c){return function(_0x498734){if(_0x498734){return _0x498734[_0x1166('0x24')]()[_0x1166('0x25')](function(){_0x468aa5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1156a4,_0x40b3d1){return function(_0x4ee036){if(!_0x4ee036){_0x1156a4['sendStatus'](0x194);}return _0x4ee036;};}function handleError(_0x189c8d,_0x33c7ed){_0x33c7ed=_0x33c7ed||0x1f4;return function(_0x2ee07b){logger[_0x1166('0x26')](_0x2ee07b[_0x1166('0x27')]);if(_0x2ee07b[_0x1166('0x28')]){delete _0x2ee07b[_0x1166('0x28')];}_0x189c8d[_0x1166('0x1b')](_0x33c7ed)[_0x1166('0x29')](_0x2ee07b);};}exports[_0x1166('0x2a')]=function(_0x4eb194,_0x22c153){var _0x2526b3={},_0x542a02={},_0xf2e5b2={'count':0x0,'rows':[]};var _0x138a0f=_[_0x1166('0x2b')](db['ChatTransferReport'][_0x1166('0x2c')],function(_0x14f453){return{'name':_0x14f453[_0x1166('0x2d')],'type':_0x14f453[_0x1166('0x2e')][_0x1166('0x2f')]};});_0x542a02[_0x1166('0x30')]=_[_0x1166('0x2b')](_0x138a0f,_0x1166('0x28'));_0x542a02['query']=_['keys'](_0x4eb194['query']);_0x542a02['filters']=_[_0x1166('0x31')](_0x542a02[_0x1166('0x30')],_0x542a02['query']);_0x2526b3[_0x1166('0x32')]=_[_0x1166('0x31')](_0x542a02[_0x1166('0x30')],qs[_0x1166('0x33')](_0x4eb194[_0x1166('0x34')][_0x1166('0x33')]));_0x2526b3[_0x1166('0x32')]=_0x2526b3['attributes'][_0x1166('0x35')]?_0x2526b3[_0x1166('0x32')]:_0x542a02['model'];if(!_0x4eb194[_0x1166('0x34')]['hasOwnProperty'](_0x1166('0x36'))){_0x2526b3[_0x1166('0x1d')]=qs['limit'](_0x4eb194[_0x1166('0x34')][_0x1166('0x1d')]);_0x2526b3['offset']=qs['offset'](_0x4eb194['query'][_0x1166('0x1c')]);}_0x2526b3['order']=qs['sort'](_0x4eb194['query'][_0x1166('0x37')]);_0x2526b3[_0x1166('0x38')]=qs['filters'](_[_0x1166('0x39')](_0x4eb194[_0x1166('0x34')],_0x542a02[_0x1166('0x3a')]),_0x138a0f);if(_0x4eb194[_0x1166('0x34')][_0x1166('0x3b')]){_0x2526b3[_0x1166('0x38')]=_['merge'](_0x2526b3[_0x1166('0x38')],{'$or':_[_0x1166('0x2b')](_0x138a0f,function(_0x25974f){if(_0x25974f['type']!==_0x1166('0x3c')){var _0x49ab08={};_0x49ab08[_0x25974f[_0x1166('0x28')]]={'$like':'%'+_0x4eb194[_0x1166('0x34')][_0x1166('0x3b')]+'%'};return _0x49ab08;}})});}_0x2526b3=_[_0x1166('0x3d')]({},_0x2526b3,_0x4eb194[_0x1166('0x3e')]);var _0x579b0b={'where':_0x2526b3[_0x1166('0x38')]};return db['ChatTransferReport'][_0x1166('0x1e')](_0x579b0b)[_0x1166('0x25')](function(_0x5635ed){_0xf2e5b2['count']=_0x5635ed;if(_0x4eb194[_0x1166('0x34')][_0x1166('0x3f')]){_0x2526b3[_0x1166('0x40')]=[{'all':!![]}];}return db[_0x1166('0x41')][_0x1166('0x42')](_0x2526b3);})[_0x1166('0x25')](function(_0x744bc2){_0xf2e5b2[_0x1166('0x43')]=_0x744bc2;return _0xf2e5b2;})[_0x1166('0x25')](respondWithFilteredResult(_0x22c153,_0x2526b3))['catch'](handleError(_0x22c153,null));};exports[_0x1166('0x44')]=function(_0x496c36,_0x5e0cf1){var _0x47c0c2={'raw':!![],'where':{'id':_0x496c36[_0x1166('0x45')]['id']}},_0x40e76d={};_0x40e76d[_0x1166('0x30')]=_[_0x1166('0x46')](db[_0x1166('0x41')][_0x1166('0x2c')]);_0x40e76d[_0x1166('0x34')]=_[_0x1166('0x46')](_0x496c36[_0x1166('0x34')]);_0x40e76d[_0x1166('0x3a')]=_[_0x1166('0x31')](_0x40e76d['model'],_0x40e76d['query']);_0x47c0c2[_0x1166('0x32')]=_[_0x1166('0x31')](_0x40e76d[_0x1166('0x30')],qs[_0x1166('0x33')](_0x496c36[_0x1166('0x34')][_0x1166('0x33')]));_0x47c0c2[_0x1166('0x32')]=_0x47c0c2[_0x1166('0x32')][_0x1166('0x35')]?_0x47c0c2['attributes']:_0x40e76d[_0x1166('0x30')];if(_0x496c36[_0x1166('0x34')][_0x1166('0x3f')]){_0x47c0c2['include']=[{'all':!![]}];}_0x47c0c2=_['merge']({},_0x47c0c2,_0x496c36[_0x1166('0x3e')]);return db[_0x1166('0x41')]['find'](_0x47c0c2)[_0x1166('0x25')](handleEntityNotFound(_0x5e0cf1,null))['then'](respondWithResult(_0x5e0cf1,null))['catch'](handleError(_0x5e0cf1,null));};exports[_0x1166('0x47')]=function(_0x2a49a5,_0x3f71b4){return db[_0x1166('0x41')]['create'](_0x2a49a5[_0x1166('0x48')],{})['then'](respondWithResult(_0x3f71b4,0xc9))[_0x1166('0x49')](handleError(_0x3f71b4,null));};exports[_0x1166('0x4a')]=function(_0x4f061e,_0xbc02f6){if(_0x4f061e[_0x1166('0x48')]['id']){delete _0x4f061e[_0x1166('0x48')]['id'];}return db[_0x1166('0x41')]['find']({'where':{'id':_0x4f061e[_0x1166('0x45')]['id']}})[_0x1166('0x25')](handleEntityNotFound(_0xbc02f6,null))[_0x1166('0x25')](saveUpdates(_0x4f061e[_0x1166('0x48')],null))[_0x1166('0x25')](respondWithResult(_0xbc02f6,null))[_0x1166('0x49')](handleError(_0xbc02f6,null));};exports[_0x1166('0x24')]=function(_0x568474,_0x77c289){return db[_0x1166('0x41')][_0x1166('0x4b')]({'where':{'id':_0x568474[_0x1166('0x45')]['id']}})[_0x1166('0x25')](handleEntityNotFound(_0x77c289,null))[_0x1166('0x25')](removeEntity(_0x77c289,null))[_0x1166('0x49')](handleError(_0x77c289,null));};exports['describe']=function(_0x47a892,_0x43fc15){return db['ChatTransferReport'][_0x1166('0x4c')]()[_0x1166('0x25')](respondWithResult(_0x43fc15,null))[_0x1166('0x49')](handleError(_0x43fc15,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2b65162..8e0706d 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 _0x90e2=['define','ChatTransferReport','uniqueid','util','../../config/logger','bluebird','request-promise','path','./chatTransferReport.attributes','exports'];(function(_0x47f762,_0x106ece){var _0x4d2585=function(_0x4de06b){while(--_0x4de06b){_0x47f762['push'](_0x47f762['shift']());}};_0x4d2585(++_0x106ece);}(_0x90e2,0x12f));var _0x290e=function(_0x1c712b,_0x466e24){_0x1c712b=_0x1c712b-0x0;var _0x19609f=_0x90e2[_0x1c712b];return _0x19609f;};'use strict';var _=require('lodash');var util=require(_0x290e('0x0'));var logger=require(_0x290e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x290e('0x2'));var rp=require(_0x290e('0x3'));var fs=require('fs');var path=require(_0x290e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x290e('0x5'));module[_0x290e('0x6')]=function(_0x508c8c,_0x5b85ab){return _0x508c8c[_0x290e('0x7')](_0x290e('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x290e('0x9'),'fields':[_0x290e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dae=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x1bfc2d,_0x181462){var _0x501195=function(_0x184937){while(--_0x184937){_0x1bfc2d['push'](_0x1bfc2d['shift']());}};_0x501195(++_0x181462);}(_0x6dae,0x1af));var _0xe6da=function(_0x1616de,_0x2d075b){_0x1616de=_0x1616de-0x0;var _0x4716af=_0x6dae[_0x1616de];return _0x4716af;};'use strict';var _=require(_0xe6da('0x0'));var util=require(_0xe6da('0x1'));var logger=require('../../config/logger')(_0xe6da('0x2'));var moment=require(_0xe6da('0x3'));var BPromise=require(_0xe6da('0x4'));var rp=require(_0xe6da('0x5'));var fs=require('fs');var path=require(_0xe6da('0x6'));var rimraf=require('rimraf');var config=require(_0xe6da('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xe6da('0x8')]=function(_0x23dc7f,_0x50604c){return _0x23dc7f[_0xe6da('0x9')](_0xe6da('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe6da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f2f426e..ef596ad 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 _0x89de=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x4efb1f,_0x542a75){var _0x4ddbc5=function(_0x358a8d){while(--_0x358a8d){_0x4efb1f['push'](_0x4efb1f['shift']());}};_0x4ddbc5(++_0x542a75);}(_0x89de,0xe1));var _0xe89d=function(_0x145c6b,_0x3ad08e){_0x145c6b=_0x145c6b-0x0;var _0x790b6b=_0x89de[_0x145c6b];return _0x790b6b;};'use strict';var _=require(_0xe89d('0x0'));var util=require(_0xe89d('0x1'));var moment=require('moment');var BPromise=require(_0xe89d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe89d('0x3'));var logger=require(_0xe89d('0x4'))('rpc');var config=require(_0xe89d('0x5'));var jayson=require(_0xe89d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x296cbc,_0x8379d8,_0x539a8c){return new BPromise(function(_0x345ee1,_0x2c434c){return client[_0xe89d('0x7')](_0x296cbc,_0x539a8c)[_0xe89d('0x8')](function(_0x4cfb31){logger[_0xe89d('0x9')](_0xe89d('0xa'),_0x8379d8,_0xe89d('0xb'));logger[_0xe89d('0xc')](_0xe89d('0xd'),_0x8379d8,_0xe89d('0xb'),JSON['stringify'](_0x4cfb31));if(_0x4cfb31['error']){if(_0x4cfb31[_0xe89d('0xe')][_0xe89d('0xf')]===0x1f4){logger['error'](_0xe89d('0xa'),_0x8379d8,_0x4cfb31[_0xe89d('0xe')][_0xe89d('0x10')]);return _0x2c434c(_0x4cfb31['error']['message']);}logger[_0xe89d('0xe')](_0xe89d('0xa'),_0x8379d8,_0x4cfb31['error'][_0xe89d('0x10')]);return _0x345ee1(_0x4cfb31[_0xe89d('0xe')][_0xe89d('0x10')]);}else{logger[_0xe89d('0x9')](_0xe89d('0xa'),_0x8379d8,_0xe89d('0xb'));_0x345ee1(_0x4cfb31[_0xe89d('0x11')][_0xe89d('0x10')]);}})[_0xe89d('0x12')](function(_0x315fa0){logger[_0xe89d('0xe')](_0xe89d('0xa'),_0x8379d8,_0x315fa0);_0x2c434c(_0x315fa0);});});} \ No newline at end of file +var _0x8828=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x4cb7b8,_0x30715f){var _0x464585=function(_0x3a5160){while(--_0x3a5160){_0x4cb7b8['push'](_0x4cb7b8['shift']());}};_0x464585(++_0x30715f);}(_0x8828,0x1f1));var _0x8882=function(_0x31b91a,_0xd85e4b){_0x31b91a=_0x31b91a-0x0;var _0x57e864=_0x8828[_0x31b91a];return _0x57e864;};'use strict';var _=require(_0x8882('0x0'));var util=require(_0x8882('0x1'));var moment=require(_0x8882('0x2'));var BPromise=require(_0x8882('0x3'));var rs=require(_0x8882('0x4'));var fs=require('fs');var Redis=require(_0x8882('0x5'));var db=require(_0x8882('0x6'))['db'];var utils=require(_0x8882('0x7'));var logger=require(_0x8882('0x8'))(_0x8882('0x9'));var config=require(_0x8882('0xa'));var jayson=require(_0x8882('0xb'));var client=jayson[_0x8882('0xc')][_0x8882('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x297787,_0xe3b94a,_0x5e83b0){return new BPromise(function(_0x52ba95,_0x512ffb){return client[_0x8882('0xe')](_0x297787,_0x5e83b0)[_0x8882('0xf')](function(_0x561f2c){logger[_0x8882('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xe3b94a,_0x8882('0x11'));logger[_0x8882('0x12')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xe3b94a,_0x8882('0x11'),JSON['stringify'](_0x561f2c));if(_0x561f2c[_0x8882('0x13')]){if(_0x561f2c[_0x8882('0x13')][_0x8882('0x14')]===0x1f4){logger[_0x8882('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0xe3b94a,_0x561f2c['error']['message']);return _0x512ffb(_0x561f2c[_0x8882('0x13')][_0x8882('0x15')]);}logger['error'](_0x8882('0x16'),_0xe3b94a,_0x561f2c[_0x8882('0x13')]['message']);return _0x52ba95(_0x561f2c['error'][_0x8882('0x15')]);}else{logger[_0x8882('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xe3b94a,'request\x20sent');_0x52ba95(_0x561f2c[_0x8882('0x17')][_0x8882('0x15')]);}})[_0x8882('0x18')](function(_0x27c6a9){logger[_0x8882('0x13')](_0x8882('0x16'),_0xe3b94a,_0x27c6a9);_0x512ffb(_0x27c6a9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 12fb950..c8f7143 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 _0x3b22=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x27afd6,_0x249f31){var _0xdf8b43=function(_0x1eff53){while(--_0x1eff53){_0x27afd6['push'](_0x27afd6['shift']());}};_0xdf8b43(++_0x249f31);}(_0x3b22,0x1b4));var _0x23b2=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x3b22[_0x8fa4bc];return _0x35b6a7;};'use strict';var multer=require(_0x23b2('0x0'));var util=require(_0x23b2('0x1'));var path=require(_0x23b2('0x2'));var timeout=require(_0x23b2('0x3'));var express=require(_0x23b2('0x4'));var router=express[_0x23b2('0x5')]();var fs_extra=require(_0x23b2('0x6'));var auth=require(_0x23b2('0x7'));var interaction=require(_0x23b2('0x8'));var config=require('../../config/environment');var controller=require(_0x23b2('0x9'));router[_0x23b2('0xa')]('/',auth[_0x23b2('0xb')](),controller[_0x23b2('0xc')]);router[_0x23b2('0xa')]('/describe',auth[_0x23b2('0xb')](),controller['describe']);router[_0x23b2('0xa')](_0x23b2('0xd'),auth[_0x23b2('0xb')](),controller[_0x23b2('0xe')]);router[_0x23b2('0xf')]('/',auth[_0x23b2('0xb')](),controller[_0x23b2('0x10')]);router[_0x23b2('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x23b2('0x12')]);module[_0x23b2('0x13')]=router; \ No newline at end of file +var _0x8a44=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x2b0248,_0x50dc05){var _0x2edca3=function(_0x5c579a){while(--_0x5c579a){_0x2b0248['push'](_0x2b0248['shift']());}};_0x2edca3(++_0x50dc05);}(_0x8a44,0x126));var _0x48a4=function(_0xf174bc,_0x5a30be){_0xf174bc=_0xf174bc-0x0;var _0xde24dd=_0x8a44[_0xf174bc];return _0xde24dd;};'use strict';var multer=require(_0x48a4('0x0'));var util=require(_0x48a4('0x1'));var path=require(_0x48a4('0x2'));var timeout=require(_0x48a4('0x3'));var express=require(_0x48a4('0x4'));var router=express[_0x48a4('0x5')]();var fs_extra=require(_0x48a4('0x6'));var auth=require(_0x48a4('0x7'));var interaction=require(_0x48a4('0x8'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x48a4('0x9')]('/',auth[_0x48a4('0xa')](),controller['index']);router['get'](_0x48a4('0xb'),auth['isAuthenticated'](),controller[_0x48a4('0xc')]);router[_0x48a4('0x9')](_0x48a4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x48a4('0xe')]('/',auth[_0x48a4('0xa')](),controller[_0x48a4('0xf')]);router[_0x48a4('0x10')]('/:id',auth[_0x48a4('0xa')](),controller[_0x48a4('0x11')]);router[_0x48a4('0x12')](_0x48a4('0xd'),auth[_0x48a4('0xa')](),controller[_0x48a4('0x13')]);module[_0x48a4('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index fb57390..e6184e5 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 _0x352e=['We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','ENUM','star','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared'];(function(_0x5ad057,_0x4337fc){var _0x1188c6=function(_0x20643b){while(--_0x20643b){_0x5ad057['push'](_0x5ad057['shift']());}};_0x1188c6(++_0x4337fc);}(_0x352e,0xf8));var _0xe352=function(_0x26330f,_0x2a317d){_0x26330f=_0x26330f-0x0;var _0x3bfdbb=_0x352e[_0x26330f];return _0x3bfdbb;};'use strict';var Sequelize=require(_0xe352('0x0'));var rs=require(_0xe352('0x1'));module[_0xe352('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xe352('0x3')],'allowNull':![],'unique':_0xe352('0x4')},'description':{'type':Sequelize[_0xe352('0x3')]},'mapKey':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x5')},'mapKeyOffline':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x6')},'customerAlias':{'type':Sequelize[_0xe352('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe352('0x3')],'allowNull':![],'defaultValue':_0xe352('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe352('0x3')],'allowNull':![],'defaultValue':_0xe352('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe352('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe352('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe352('0x3')]},'animation':{'type':Sequelize[_0xe352('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xe352('0xa'),_0xe352('0xb')),'defaultValue':_0xe352('0xa')},'header_online':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0xc')},'start_chat_button':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0xe')},'download_transcript':{'type':Sequelize[_0xe352('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe352('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xe352('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe352('0xf')]},'closingQuestion':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x12')},'noteTitle':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x13')},'placeholderMessage':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x14')},'closingMessage':{'type':Sequelize[_0xe352('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xe352('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x15')},'ratingType':{'type':Sequelize[_0xe352('0x16')](_0xe352('0x17'),'thumb'),'defaultValue':_0xe352('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xe352('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe352('0x18')]({'items':[{'type':_0xe352('0x19'),'variable':null,'config':{'placeholder':_0xe352('0x1a'),'type':_0xe352('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xe352('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe352('0x5'),'type':_0xe352('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xe352('0x1c'))?JSON[_0xe352('0x1d')](this[_0xe352('0x1e')](_0xe352('0x1c'))):{};},'set':function(_0x245dac){return this[_0xe352('0x1f')]('onlineForm',JSON[_0xe352('0x18')](_0x245dac));}},'offlineForm':{'type':Sequelize[_0xe352('0xf')],'defaultValue':function(){return JSON[_0xe352('0x18')]({'items':[{'type':_0xe352('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe352('0x5'),'type':_0xe352('0x5')},'variable':null},{'type':_0xe352('0x20'),'config':{'placeholder':_0xe352('0x21')},'props':{'title':'Comments','helpText':_0xe352('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xe352('0x1e')](_0xe352('0x23'))?JSON[_0xe352('0x1d')](this['getDataValue'](_0xe352('0x23'))):{};},'set':function(_0x3a5c92){return this['setDataValue'](_0xe352('0x23'),JSON[_0xe352('0x18')](_0x3a5c92));}},'token':{'type':Sequelize[_0xe352('0x3')],'defaultValue':function(){return rs[_0xe352('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe352('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x25')},'waitingMessage':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xe352('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x29')},'skipUnmanaged':{'type':Sequelize[_0xe352('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x2a')},'enableCustomerAttachment':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe352('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe352('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe352('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe352('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xe352('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x2c')},'verticalAlignment':{'type':Sequelize[_0xe352('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xe352('0x2d')},'defaultTitle':{'type':Sequelize[_0xe352('0x3')]},'customerAvatar':{'type':Sequelize[_0xe352('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe352('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe352('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe352('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe352('0x3')],'defaultValue':_0xe352('0x2f')},'systemAvatar':{'type':Sequelize[_0xe352('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe352('0x8')],'comment':_0xe352('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![],'comment':_0xe352('0x31'),'set':function(_0x3cb0f7){if(!_0x3cb0f7)this[_0xe352('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe352('0x32'),_0x3cb0f7);}},'vidaooEscalation':{'type':Sequelize[_0xe352('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe352('0x3')]},'vidaooTopic':{'type':Sequelize[_0xe352('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xe352('0x3')],'defaultValue':function(){return _0xe352('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xe352('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d0b=['name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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.','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','stringify','input'];(function(_0x2b9ade,_0x206f0a){var _0x51e015=function(_0x505493){while(--_0x505493){_0x2b9ade['push'](_0x2b9ade['shift']());}};_0x51e015(++_0x206f0a);}(_0x5d0b,0x99));var _0xb5d0=function(_0x9ec221,_0x2594a6){_0x9ec221=_0x9ec221-0x0;var _0xdbe55e=_0x5d0b[_0x9ec221];return _0xdbe55e;};'use strict';var Sequelize=require(_0xb5d0('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xb5d0('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xb5d0('0x1')],'allowNull':![],'unique':_0xb5d0('0x2')},'description':{'type':Sequelize[_0xb5d0('0x1')]},'mapKey':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x3')},'mapKeyOffline':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb5d0('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb5d0('0x1')],'allowNull':![],'defaultValue':_0xb5d0('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb5d0('0x1')],'allowNull':![],'defaultValue':_0xb5d0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb5d0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb5d0('0x1')]},'animation':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0xb5d0('0x8')},'header_online':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x9')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb5d0('0xa')},'offline_chat_button':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb5d0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb5d0('0xc')]},'closingQuestion':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0xd')},'formSubmitFailureMessage':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0xe')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb5d0('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb5d0('0x10')},'closingMessage':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x11')},'closingMessageButton':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x12')},'conditionAgreement':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb5d0('0x13')](_0xb5d0('0x14'),'thumb'),'defaultValue':_0xb5d0('0x14')},'ratingStarsNumber':{'type':Sequelize[_0xb5d0('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb5d0('0xc')],'defaultValue':function(){return JSON[_0xb5d0('0x15')]({'items':[{'type':_0xb5d0('0x16'),'variable':null,'config':{'placeholder':_0xb5d0('0x17'),'type':'text','required':!![]},'props':{'title':_0xb5d0('0x17'),'helpText':''}},{'type':_0xb5d0('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb5d0('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb5d0('0x18')](_0xb5d0('0x19'))?JSON[_0xb5d0('0x1a')](this[_0xb5d0('0x18')](_0xb5d0('0x19'))):{};},'set':function(_0x34e40c){return this['setDataValue'](_0xb5d0('0x19'),JSON['stringify'](_0x34e40c));}},'offlineForm':{'type':Sequelize[_0xb5d0('0xc')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb5d0('0x16'),'props':{'title':_0xb5d0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb5d0('0x3')},'variable':null},{'type':_0xb5d0('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0xb5d0('0x1c'),'helpText':_0xb5d0('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0xb5d0('0x18')](_0xb5d0('0x1e'))?JSON[_0xb5d0('0x1a')](this['getDataValue'](_0xb5d0('0x1e'))):{};},'set':function(_0x348866){return this[_0xb5d0('0x1f')](_0xb5d0('0x1e'),JSON[_0xb5d0('0x15')](_0x348866));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb5d0('0x1')]},'forwardOffline':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb5d0('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x22')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb5d0('0x12')},'sendUnmanaged':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb5d0('0xc')]},'showAgentAvatar':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb5d0('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5d0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x23')},'verticalAlignment':{'type':Sequelize[_0xb5d0('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x24')},'defaultTitle':{'type':Sequelize[_0xb5d0('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb5d0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb5d0('0x1')],'allowNull':![],'defaultValue':_0xb5d0('0x25'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5d0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb5d0('0x1')],'defaultValue':_0xb5d0('0x26')},'systemAvatar':{'type':Sequelize[_0xb5d0('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5d0('0x6')],'comment':_0xb5d0('0x27')},'mandatoryDisposition':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![],'comment':_0xb5d0('0x28'),'set':function(_0x20f3a9){if(!_0x20f3a9)this[_0xb5d0('0x1f')](_0xb5d0('0x29'),null);this['setDataValue']('mandatoryDisposition',_0x20f3a9);}},'vidaooEscalation':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb5d0('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb5d0('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0xb5d0('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb5d0('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb5d0('0xc')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0760126..5d35e96 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 _0xf298=['then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','json','undefined','offset','count','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','Pause','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','describe','ChatWebsiteId','Disposition','getDispositions','findOne','includeAll','findAll','removeDispositions','ids','addAnswer','CannedAnswer','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','Contacts','ListId','contact','cf-connecting-ip','first','split','firstName','lastName','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','email','offlineMessageSubject','MailAccountId','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','addInteraction','getInteractions','Owner','internal','Tags','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','push','all','some','readFileSync','remote','stringify','x-forwarded-for','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','textColor','addApplications','getApplications','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','spread','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request'];(function(_0x3711e2,_0x1468e1){var _0x18a556=function(_0x5e0923){while(--_0x5e0923){_0x3711e2['push'](_0x3711e2['shift']());}};_0x18a556(++_0x1468e1);}(_0xf298,0x10a));var _0x8f29=function(_0x103004,_0x4347a5){_0x103004=_0x103004-0x0;var _0x1d1e41=_0xf298[_0x103004];return _0x1d1e41;};'use strict';var emlformat=require(_0x8f29('0x0'));var rimraf=require(_0x8f29('0x1'));var zipdir=require(_0x8f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f29('0x3'));var moment=require(_0x8f29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f29('0x5'));var util=require(_0x8f29('0x6'));var path=require(_0x8f29('0x7'));var sox=require(_0x8f29('0x8'));var csv=require(_0x8f29('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f29('0xa'));var squel=require(_0x8f29('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f29('0xc'));var toCsv=require(_0x8f29('0x9'));var querystring=require(_0x8f29('0xd'));var Papa=require('papaparse');var Redis=require(_0x8f29('0xe'));var authService=require(_0x8f29('0xf'));var qs=require(_0x8f29('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f29('0x11'));var logger=require(_0x8f29('0x12'))(_0x8f29('0x13'));var utils=require(_0x8f29('0x14'));var config=require(_0x8f29('0x15'));var licenseUtil=require(_0x8f29('0x16'));var db=require(_0x8f29('0x17'))['db'];config[_0x8f29('0x18')]=_[_0x8f29('0x19')](config['redis'],{'host':_0x8f29('0x1a'),'port':0x18eb});var socket=require(_0x8f29('0x1b'))(new Redis(config[_0x8f29('0x18')]));require(_0x8f29('0x1c'))[_0x8f29('0x1d')](socket);var jayson=require(_0x8f29('0x1e'));var client=jayson[_0x8f29('0x1f')][_0x8f29('0x20')]({'port':0x232c});var client9002=jayson[_0x8f29('0x1f')][_0x8f29('0x20')]({'port':0x232a});var client9003=jayson[_0x8f29('0x1f')][_0x8f29('0x20')]({'port':0x232b});var client9001=jayson[_0x8f29('0x1f')][_0x8f29('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x400f58,_0x5dbd25,_0x3c4ac5,_0x40cf2d){return new BPromise(function(_0x23c098,_0x5e0129){var _0xd1eaa6=_0x40cf2d||client;return _0xd1eaa6[_0x8f29('0x21')](_0x400f58,_0x3c4ac5)[_0x8f29('0x22')](function(_0x5d889d){logger[_0x8f29('0x23')](_0x8f29('0x24'),_0x5dbd25,'request\x20sent');logger[_0x8f29('0x25')](_0x8f29('0x26'),_0x5dbd25,'request\x20sent',JSON['stringify'](_0x5d889d));if(_0x5d889d[_0x8f29('0x27')]){if(_0x5d889d[_0x8f29('0x27')][_0x8f29('0x28')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5dbd25,_0x5d889d[_0x8f29('0x27')][_0x8f29('0x29')]);return _0x5e0129(_0x5d889d[_0x8f29('0x27')][_0x8f29('0x29')]);}logger[_0x8f29('0x27')](_0x8f29('0x24'),_0x5dbd25,_0x5d889d[_0x8f29('0x27')][_0x8f29('0x29')]);return _0x23c098(_0x5d889d['error'][_0x8f29('0x29')]);}else{logger[_0x8f29('0x23')](_0x8f29('0x24'),_0x5dbd25,'request\x20sent');_0x23c098(_0x5d889d['result'][_0x8f29('0x29')]);}})['catch'](function(_0x38b663){logger[_0x8f29('0x27')](_0x8f29('0x24'),_0x5dbd25,_0x38b663);_0x5e0129(_0x38b663);});});}function respondWithStatusCode(_0x47e593,_0x4c540c){_0x4c540c=_0x4c540c||0xcc;return function(_0x15fd73){if(_0x15fd73){return _0x47e593[_0x8f29('0x2a')](_0x4c540c);}return _0x47e593[_0x8f29('0x2b')](_0x4c540c)['end']();};}function respondWithResult(_0x48b049,_0x184d2e){_0x184d2e=_0x184d2e||0xc8;return function(_0x5a49a4){if(_0x5a49a4){return _0x48b049[_0x8f29('0x2b')](_0x184d2e)[_0x8f29('0x2c')](_0x5a49a4);}};}function respondWithFilteredResult(_0x396ec7,_0x2e9c3d){return function(_0x250c77){if(_0x250c77){var _0x1661ba=typeof _0x2e9c3d['offset']===_0x8f29('0x2d')&&typeof _0x2e9c3d['limit']===_0x8f29('0x2d');var _0x42f32f=_0x250c77['count'];var _0x47b184=_0x1661ba?0x0:_0x2e9c3d[_0x8f29('0x2e')];var _0x25cd7c=_0x1661ba?_0x250c77[_0x8f29('0x2f')]:_0x2e9c3d['offset']+_0x2e9c3d[_0x8f29('0x30')];var _0x5ca38c;if(_0x25cd7c>=_0x42f32f){_0x25cd7c=_0x42f32f;_0x5ca38c=0xc8;}else{_0x5ca38c=0xce;}_0x396ec7['status'](_0x5ca38c);return _0x396ec7[_0x8f29('0x31')]('Content-Range',_0x47b184+'-'+_0x25cd7c+'/'+_0x42f32f)[_0x8f29('0x2c')](_0x250c77);}return null;};}function patchUpdates(_0x31d3ad){return function(_0x80b704){try{jsonpatch['apply'](_0x80b704,_0x31d3ad,!![]);}catch(_0x34dd10){return BPromise['reject'](_0x34dd10);}return _0x80b704['save']();};}function saveUpdates(_0x1fa66b,_0x2b0a10){return function(_0xe02ef3){if(_0xe02ef3){return _0xe02ef3[_0x8f29('0x32')](_0x1fa66b)['then'](function(_0x56dc0f){return _0x56dc0f;});}return null;};}function removeEntity(_0x3aefa8,_0x192c71){return function(_0x53d914){if(_0x53d914){return _0x53d914[_0x8f29('0x33')]()[_0x8f29('0x22')](function(){var _0x474b47=_0x53d914[_0x8f29('0x34')]({'plain':!![]});var _0x2adaa8=_0x8f29('0x35');return db[_0x8f29('0x36')][_0x8f29('0x33')]({'where':{'type':_0x2adaa8,'resourceId':_0x474b47['id']}})[_0x8f29('0x22')](function(){return _0x53d914;});})[_0x8f29('0x22')](function(){_0x3aefa8[_0x8f29('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1275f4,_0x12e9b6){return function(_0x3026a7){if(!_0x3026a7){_0x1275f4['sendStatus'](0x194);}return _0x3026a7;};}function handleError(_0x4ca429,_0x34dc32){_0x34dc32=_0x34dc32||0x1f4;return function(_0x24932f){logger[_0x8f29('0x27')](_0x24932f['stack']);if(_0x24932f[_0x8f29('0x37')]){delete _0x24932f['name'];}_0x4ca429[_0x8f29('0x2b')](_0x34dc32)[_0x8f29('0x38')](_0x24932f);};}exports[_0x8f29('0x39')]=function(_0x6eabd8,_0x45f34d){var _0x165b1f={'include':[{'model':db['Pause'],'as':_0x8f29('0x3a')}]},_0x4dad2b={},_0x16ada3={'count':0x0,'rows':[]};var _0x286a9b=_[_0x8f29('0x3b')](db[_0x8f29('0x3c')][_0x8f29('0x3d')],function(_0x38ec15){return{'name':_0x38ec15[_0x8f29('0x3e')],'type':_0x38ec15[_0x8f29('0x3f')]['key']};});_0x4dad2b['model']=_['map'](_0x286a9b,'name');_0x4dad2b[_0x8f29('0x40')]=_[_0x8f29('0x41')](_0x6eabd8[_0x8f29('0x40')]);_0x4dad2b['filters']=_[_0x8f29('0x42')](_0x4dad2b[_0x8f29('0x43')],_0x4dad2b['query']);_0x165b1f[_0x8f29('0x44')]=_[_0x8f29('0x42')](_0x4dad2b[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x6eabd8[_0x8f29('0x40')][_0x8f29('0x45')]));_0x165b1f[_0x8f29('0x44')]=_0x165b1f[_0x8f29('0x44')][_0x8f29('0x46')]?_0x165b1f['attributes']:_0x4dad2b[_0x8f29('0x43')];if(!_0x6eabd8['query'][_0x8f29('0x47')](_0x8f29('0x48'))){_0x165b1f['limit']=qs[_0x8f29('0x30')](_0x6eabd8[_0x8f29('0x40')][_0x8f29('0x30')]);_0x165b1f[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x6eabd8[_0x8f29('0x40')][_0x8f29('0x2e')]);}_0x165b1f[_0x8f29('0x49')]=qs[_0x8f29('0x4a')](_0x6eabd8[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x165b1f[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x6eabd8[_0x8f29('0x40')],_0x4dad2b['filters']),_0x286a9b);if(_0x6eabd8['query'][_0x8f29('0x4e')]){_0x165b1f[_0x8f29('0x4b')]=_[_0x8f29('0x4f')](_0x165b1f[_0x8f29('0x4b')],{'$or':_[_0x8f29('0x3b')](_0x286a9b,function(_0x2762a3){if(_0x2762a3[_0x8f29('0x3f')]!==_0x8f29('0x50')){var _0x22a260={};_0x22a260[_0x2762a3['name']]={'$like':'%'+_0x6eabd8['query'][_0x8f29('0x4e')]+'%'};return _0x22a260;}})});}_0x165b1f=_['merge']({},_0x165b1f,_0x6eabd8[_0x8f29('0x51')]);var _0x1c7b11={'where':_0x165b1f['where']};return db[_0x8f29('0x3c')][_0x8f29('0x2f')](_0x1c7b11)[_0x8f29('0x22')](function(_0x557d40){_0x16ada3[_0x8f29('0x2f')]=_0x557d40;if(_0x6eabd8['query']['includeAll']){_0x165b1f['include']=[{'all':!![]}];}return db[_0x8f29('0x3c')]['findAll'](_0x165b1f);})[_0x8f29('0x22')](function(_0x245d1c){_0x16ada3[_0x8f29('0x52')]=_0x245d1c;return _0x16ada3;})[_0x8f29('0x22')](respondWithFilteredResult(_0x45f34d,_0x165b1f))[_0x8f29('0x53')](handleError(_0x45f34d,null));};exports[_0x8f29('0x54')]=function(_0x27c719,_0x1fa016){var _0x3b15f9={'raw':![],'where':{'id':_0x27c719[_0x8f29('0x55')]['id']},'include':[{'model':db[_0x8f29('0x56')],'as':'mandatoryDispositionPause'}]},_0x515087={};_0x515087[_0x8f29('0x43')]=_[_0x8f29('0x41')](db['ChatWebsite'][_0x8f29('0x3d')]);_0x515087[_0x8f29('0x40')]=_['keys'](_0x27c719[_0x8f29('0x40')]);_0x515087[_0x8f29('0x4c')]=_[_0x8f29('0x42')](_0x515087[_0x8f29('0x43')],_0x515087[_0x8f29('0x40')]);_0x3b15f9[_0x8f29('0x44')]=_[_0x8f29('0x42')](_0x515087[_0x8f29('0x43')],qs['fields'](_0x27c719[_0x8f29('0x40')]['fields']));_0x3b15f9[_0x8f29('0x44')]=_0x3b15f9['attributes'][_0x8f29('0x46')]?_0x3b15f9[_0x8f29('0x44')]:_0x515087[_0x8f29('0x43')];if(_0x27c719[_0x8f29('0x40')]['includeAll']){_0x3b15f9[_0x8f29('0x57')]=[{'all':!![]}];}_0x3b15f9=_[_0x8f29('0x4f')]({},_0x3b15f9,_0x27c719['options']);return db[_0x8f29('0x3c')][_0x8f29('0x58')](_0x3b15f9)[_0x8f29('0x22')](handleEntityNotFound(_0x1fa016,null))[_0x8f29('0x22')](respondWithResult(_0x1fa016,null))[_0x8f29('0x53')](handleError(_0x1fa016,null));};exports['create']=function(_0x1ed527,_0x285c39){return db[_0x8f29('0x3c')]['create'](_0x1ed527[_0x8f29('0x59')],{})[_0x8f29('0x22')](function(_0x153c3c){var _0x135d86=_0x1ed527[_0x8f29('0x5a')]['get']({'plain':!![]});if(!_0x135d86)throw new Error(_0x8f29('0x5b'));if(_0x135d86[_0x8f29('0x5c')]===_0x8f29('0x5a')){var _0x3d7766=_0x153c3c[_0x8f29('0x34')]({'plain':!![]});var _0x276dfa='ChatWebsites';return db[_0x8f29('0x5d')]['find']({'where':{'name':_0x276dfa,'userProfileId':_0x135d86['userProfileId']},'raw':!![]})['then'](function(_0x33695b){if(_0x33695b&&_0x33695b[_0x8f29('0x5e')]===0x0){return db['UserProfileResource'][_0x8f29('0x5f')]({'name':_0x3d7766[_0x8f29('0x37')],'resourceId':_0x3d7766['id'],'type':_0x33695b[_0x8f29('0x37')],'sectionId':_0x33695b['id']},{})[_0x8f29('0x22')](function(){return _0x153c3c;});}else{return _0x153c3c;}})['catch'](function(_0x1c045f){logger[_0x8f29('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c045f);throw _0x1c045f;});}return _0x153c3c;})['then'](respondWithResult(_0x285c39,0xc9))[_0x8f29('0x53')](handleError(_0x285c39,null));};exports['update']=function(_0x217eac,_0x5f1b14){if(_0x217eac['body']['id']){delete _0x217eac['body']['id'];}return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x217eac['params']['id']},'include':[{'model':db['Pause'],'as':_0x8f29('0x3a')}]})[_0x8f29('0x22')](handleEntityNotFound(_0x5f1b14,null))['then'](saveUpdates(_0x217eac[_0x8f29('0x59')],null))[_0x8f29('0x22')](respondWithResult(_0x5f1b14,null))[_0x8f29('0x53')](handleError(_0x5f1b14,null));};exports[_0x8f29('0x33')]=function(_0xaad250,_0x126f89){return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0xaad250[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x126f89,null))[_0x8f29('0x22')](removeEntity(_0x126f89,null))['catch'](handleError(_0x126f89,null));};exports[_0x8f29('0x60')]=function(_0x31698f,_0x3d007e){return db[_0x8f29('0x3c')]['describe']()[_0x8f29('0x22')](respondWithResult(_0x3d007e,null))[_0x8f29('0x53')](handleError(_0x3d007e,null));};exports['addDisposition']=function(_0x250229,_0x30190b,_0x1c9fd5){if(_0x250229[_0x8f29('0x59')]['id']){delete _0x250229[_0x8f29('0x59')]['id'];}return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x250229['params']['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x30190b,null))[_0x8f29('0x22')](function(_0x2aed77){if(_0x2aed77){_0x250229[_0x8f29('0x59')][_0x8f29('0x61')]=_0x2aed77['id'];return db[_0x8f29('0x62')]['create'](_0x250229['body']);}})['then'](respondWithResult(_0x30190b,null))[_0x8f29('0x53')](handleError(_0x30190b,null));};exports[_0x8f29('0x63')]=function(_0x367156,_0x352dec,_0x506511){var _0x14833a={'raw':![],'where':{}};var _0x387748={};var _0x246ee2={'count':0x0,'rows':[]};return db[_0x8f29('0x3c')][_0x8f29('0x64')]({'where':{'id':_0x367156['params']['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x352dec,null))[_0x8f29('0x22')](function(_0x1c0e6b){if(_0x1c0e6b){_0x387748[_0x8f29('0x43')]=_['keys'](db[_0x8f29('0x62')][_0x8f29('0x3d')]);_0x387748['query']=_[_0x8f29('0x41')](_0x367156['query']);_0x387748['filters']=_[_0x8f29('0x42')](_0x387748[_0x8f29('0x43')],_0x387748[_0x8f29('0x40')]);_0x14833a['attributes']=_[_0x8f29('0x42')](_0x387748[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x367156[_0x8f29('0x40')]['fields']));_0x14833a[_0x8f29('0x44')]=_0x14833a[_0x8f29('0x44')][_0x8f29('0x46')]?_0x14833a[_0x8f29('0x44')]:_0x387748['model'];if(!_0x367156[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x14833a[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x367156[_0x8f29('0x40')]['limit']);_0x14833a['offset']=qs[_0x8f29('0x2e')](_0x367156[_0x8f29('0x40')][_0x8f29('0x2e')]);}_0x14833a[_0x8f29('0x49')]=qs[_0x8f29('0x4a')](_0x367156[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x14833a[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x367156[_0x8f29('0x40')],_0x387748[_0x8f29('0x4c')]));_0x14833a[_0x8f29('0x4b')][_0x8f29('0x61')]=_0x1c0e6b['id'];if(_0x367156['query'][_0x8f29('0x4e')]){_0x14833a[_0x8f29('0x4b')]=_[_0x8f29('0x4f')](_0x14833a[_0x8f29('0x4b')],{'$or':_['map'](_0x14833a[_0x8f29('0x44')],function(_0x3783c7){var _0x2f6c74={};_0x2f6c74[_0x3783c7]={'$like':'%'+_0x367156[_0x8f29('0x40')][_0x8f29('0x4e')]+'%'};return _0x2f6c74;})});}_0x14833a=_[_0x8f29('0x4f')]({},_0x14833a,_0x367156[_0x8f29('0x51')]);return db[_0x8f29('0x62')]['count']({'where':_0x14833a['where']})[_0x8f29('0x22')](function(_0x7acf9c){_0x246ee2[_0x8f29('0x2f')]=_0x7acf9c;if(_0x367156[_0x8f29('0x40')][_0x8f29('0x65')]){_0x14833a[_0x8f29('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x8f29('0x66')](_0x14833a);})[_0x8f29('0x22')](function(_0x23aad9){_0x246ee2[_0x8f29('0x52')]=_0x23aad9;return _0x246ee2;});}})[_0x8f29('0x22')](respondWithFilteredResult(_0x352dec,_0x14833a))[_0x8f29('0x53')](handleError(_0x352dec,null));};exports[_0x8f29('0x67')]=function(_0x3e8919,_0x24b690,_0x4bd312){return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x3e8919[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x24b690,null))[_0x8f29('0x22')](function(_0x275984){if(_0x275984){return _0x275984['removeDispositions'](_0x3e8919[_0x8f29('0x40')][_0x8f29('0x68')]);}})['then'](respondWithStatusCode(_0x24b690,null))[_0x8f29('0x53')](handleError(_0x24b690,null));};exports[_0x8f29('0x69')]=function(_0xb7c42a,_0xace0c2,_0x290299){if(_0xb7c42a['body']['id']){delete _0xb7c42a[_0x8f29('0x59')]['id'];}return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0xb7c42a[_0x8f29('0x55')]['id']}})['then'](handleEntityNotFound(_0xace0c2,null))[_0x8f29('0x22')](function(_0x73bd37){if(_0x73bd37){_0xb7c42a[_0x8f29('0x59')][_0x8f29('0x61')]=_0x73bd37['id'];return db['CannedAnswer']['create'](_0xb7c42a[_0x8f29('0x59')]);}})[_0x8f29('0x22')](respondWithResult(_0xace0c2,null))['catch'](handleError(_0xace0c2,null));};exports['getAnswers']=function(_0x12c467,_0x5d6f48,_0x28038a){var _0x59554f={'raw':![],'where':{}};var _0x3f68ea={};var _0x38198e={'count':0x0,'rows':[]};return db[_0x8f29('0x3c')][_0x8f29('0x64')]({'where':{'id':_0x12c467[_0x8f29('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d6f48,null))[_0x8f29('0x22')](function(_0x28c2b7){if(_0x28c2b7){_0x3f68ea[_0x8f29('0x43')]=_[_0x8f29('0x41')](db[_0x8f29('0x6a')][_0x8f29('0x3d')]);_0x3f68ea[_0x8f29('0x40')]=_['keys'](_0x12c467[_0x8f29('0x40')]);_0x3f68ea[_0x8f29('0x4c')]=_['intersection'](_0x3f68ea[_0x8f29('0x43')],_0x3f68ea[_0x8f29('0x40')]);_0x59554f[_0x8f29('0x44')]=_['intersection'](_0x3f68ea[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x12c467[_0x8f29('0x40')]['fields']));_0x59554f[_0x8f29('0x44')]=_0x59554f[_0x8f29('0x44')]['length']?_0x59554f[_0x8f29('0x44')]:_0x3f68ea['model'];if(!_0x12c467[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x59554f[_0x8f29('0x30')]=qs['limit'](_0x12c467[_0x8f29('0x40')][_0x8f29('0x30')]);_0x59554f[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x12c467[_0x8f29('0x40')]['offset']);}_0x59554f['order']=qs[_0x8f29('0x4a')](_0x12c467[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x59554f[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x12c467['query'],_0x3f68ea[_0x8f29('0x4c')]));_0x59554f['where'][_0x8f29('0x61')]=_0x28c2b7['id'];if(_0x12c467['query'][_0x8f29('0x4e')]){_0x59554f['where']=_['merge'](_0x59554f[_0x8f29('0x4b')],{'$or':_[_0x8f29('0x3b')](_0x59554f[_0x8f29('0x44')],function(_0x16b50f){var _0x1d39ca={};_0x1d39ca[_0x16b50f]={'$like':'%'+_0x12c467[_0x8f29('0x40')]['filter']+'%'};return _0x1d39ca;})});}_0x59554f=_['merge']({},_0x59554f,_0x12c467[_0x8f29('0x51')]);return db[_0x8f29('0x6a')][_0x8f29('0x2f')]({'where':_0x59554f[_0x8f29('0x4b')]})[_0x8f29('0x22')](function(_0x436ef0){_0x38198e[_0x8f29('0x2f')]=_0x436ef0;if(_0x12c467['query'][_0x8f29('0x65')]){_0x59554f['include']=[{'all':!![]}];}return db[_0x8f29('0x6a')]['findAll'](_0x59554f);})[_0x8f29('0x22')](function(_0x223d6e){_0x38198e['rows']=_0x223d6e;return _0x38198e;});}})[_0x8f29('0x22')](respondWithFilteredResult(_0x5d6f48,_0x59554f))['catch'](handleError(_0x5d6f48,null));};exports['removeAnswers']=function(_0x320a79,_0x4bb228,_0x4098ce){return db[_0x8f29('0x3c')]['find']({'where':{'id':_0x320a79[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x4bb228,null))[_0x8f29('0x22')](function(_0x1bcbb5){if(_0x1bcbb5){return _0x1bcbb5['removeAnswers'](_0x320a79['query'][_0x8f29('0x68')]);}})['then'](respondWithStatusCode(_0x4bb228,null))[_0x8f29('0x53')](handleError(_0x4bb228,null));};exports[_0x8f29('0x6b')]=function(_0x41bdc1,_0xdb20c4,_0xbeb352){_0x41bdc1['body'][_0x8f29('0x6c')]=_0x41bdc1['file'][_0x8f29('0x6d')];return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x41bdc1[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0xdb20c4,null))[_0x8f29('0x22')](saveUpdates(_0x41bdc1['body'],null))[_0x8f29('0x22')](respondWithResult(_0xdb20c4,null))[_0x8f29('0x53')](handleError(_0xdb20c4,null));};exports[_0x8f29('0x6e')]=function(_0x26afbb,_0x4dd764,_0x265f8c){_0x26afbb[_0x8f29('0x59')][_0x8f29('0x6f')]=_0x26afbb['file'][_0x8f29('0x6d')];return db[_0x8f29('0x3c')]['find']({'where':{'id':_0x26afbb['params']['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x4dd764,null))[_0x8f29('0x22')](saveUpdates(_0x26afbb[_0x8f29('0x59')],null))[_0x8f29('0x22')](respondWithResult(_0x4dd764,null))[_0x8f29('0x53')](handleError(_0x4dd764,null));};exports[_0x8f29('0x70')]=function(_0x2cec7a,_0x298158,_0x3ac1aa){_0x2cec7a['body']['customerAvatar']=_0x2cec7a[_0x8f29('0x71')][_0x8f29('0x6d')];return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x2cec7a[_0x8f29('0x55')]['id']}})['then'](handleEntityNotFound(_0x298158,null))['then'](saveUpdates(_0x2cec7a[_0x8f29('0x59')],null))[_0x8f29('0x22')](respondWithResult(_0x298158,null))['catch'](handleError(_0x298158,null));};exports[_0x8f29('0x72')]=function(_0x354eef,_0x26004a,_0x128529){_0x354eef[_0x8f29('0x59')][_0x8f29('0x73')]=_0x354eef['file'][_0x8f29('0x6d')];return db[_0x8f29('0x3c')]['find']({'where':{'id':_0x354eef[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x26004a,null))['then'](saveUpdates(_0x354eef['body'],null))[_0x8f29('0x22')](respondWithResult(_0x26004a,null))[_0x8f29('0x53')](handleError(_0x26004a,null));};exports[_0x8f29('0x74')]=function(_0x3e03ca,_0x512193,_0xb442d6){var _0x1d4048=path[_0x8f29('0x75')](config[_0x8f29('0x76')],'server/files/images/logos/default_logo.svg');var _0x20f092={'where':{'id':_0x3e03ca[_0x8f29('0x55')]['id']},'attributes':['id',_0x8f29('0x6c')],'raw':!![]};var _0x235497=![];return require(_0x8f29('0x16'))[_0x8f29('0x77')]()[_0x8f29('0x22')](function(_0x3d5afa){if(_0x3d5afa){_0x235497=_0x3d5afa[_0x8f29('0x78')];}})[_0x8f29('0x22')](function(){return db['ChatWebsite']['find'](_0x20f092);})[_0x8f29('0x22')](handleEntityNotFound(_0x512193,null))[_0x8f29('0x22')](function(_0x1a79f2){if(_0x1a79f2){if(!_[_0x8f29('0x79')](_0x1a79f2[_0x8f29('0x6c')])){if(fs['existsSync'](path[_0x8f29('0x75')](config[_0x8f29('0x76')],'server/files/images/logos/',_0x1a79f2[_0x8f29('0x6c')]))&&_0x235497){_0x1d4048=path[_0x8f29('0x75')](config['root'],_0x8f29('0x7a'),_0x1a79f2[_0x8f29('0x6c')]);}}return _0x512193[_0x8f29('0x7b')](_0x1d4048);}})[_0x8f29('0x53')](handleError(_0x512193,null));};exports[_0x8f29('0x7c')]=function(_0x168a98,_0xdc2372,_0x6d05c){var _0x15e009=path['join'](config[_0x8f29('0x76')],_0x8f29('0x7d'));var _0x3425e0={'where':{'id':_0x168a98[_0x8f29('0x55')]['id']},'attributes':['id',_0x8f29('0x6f')],'raw':!![]};return db[_0x8f29('0x3c')][_0x8f29('0x58')](_0x3425e0)[_0x8f29('0x22')](handleEntityNotFound(_0xdc2372,null))[_0x8f29('0x22')](function(_0x55f57b){if(_0x55f57b){if(!_[_0x8f29('0x79')](_0x55f57b[_0x8f29('0x6f')])){if(fs[_0x8f29('0x7e')](path['join'](config[_0x8f29('0x76')],_0x8f29('0x7f'),_0x55f57b[_0x8f29('0x6f')]))){_0x15e009=path['join'](config[_0x8f29('0x76')],_0x8f29('0x7f'),_0x55f57b[_0x8f29('0x6f')]);}}return _0xdc2372[_0x8f29('0x7b')](_0x15e009);}})[_0x8f29('0x53')](handleError(_0xdc2372,null));};exports[_0x8f29('0x80')]=function(_0x28a1b5,_0x3049da,_0x3f4bde){var _0x5c206f=path[_0x8f29('0x75')](config[_0x8f29('0x76')],'server/files/images/avatars/customer_avatar.png');var _0x4ccb41={'where':{'id':_0x28a1b5[_0x8f29('0x55')]['id']},'attributes':['id',_0x8f29('0x81'),_0x8f29('0x82')],'raw':!![]};return db[_0x8f29('0x3c')][_0x8f29('0x58')](_0x4ccb41)['then'](handleEntityNotFound(_0x3049da,null))[_0x8f29('0x22')](function(_0x55462c){if(_0x55462c){if(!_[_0x8f29('0x79')](_0x55462c[_0x8f29('0x81')])){if(fs[_0x8f29('0x7e')](path[_0x8f29('0x75')](config[_0x8f29('0x76')],_0x8f29('0x7f'),_0x55462c[_0x8f29('0x81')]))&&_0x55462c[_0x8f29('0x82')]){_0x5c206f=path[_0x8f29('0x75')](config[_0x8f29('0x76')],'server/files/images/avatars/',_0x55462c['customerAvatar']);}}return _0x3049da[_0x8f29('0x7b')](_0x5c206f);}})['catch'](handleError(_0x3049da,null));};exports[_0x8f29('0x83')]=function(_0x1892e4,_0xe9b0a,_0x4f8424){var _0x42e4fd=path['join'](config[_0x8f29('0x76')],_0x8f29('0x84'));var _0x52e94a={'where':{'id':_0x1892e4['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8f29('0x3c')][_0x8f29('0x58')](_0x52e94a)[_0x8f29('0x22')](handleEntityNotFound(_0xe9b0a,null))[_0x8f29('0x22')](function(_0x22511e){if(_0x22511e){if(!_['isNil'](_0x22511e[_0x8f29('0x73')])){if(fs[_0x8f29('0x7e')](path[_0x8f29('0x75')](config[_0x8f29('0x76')],'server/files/images/avatars/',_0x22511e[_0x8f29('0x73')]))){_0x42e4fd=path[_0x8f29('0x75')](config[_0x8f29('0x76')],_0x8f29('0x7f'),_0x22511e[_0x8f29('0x73')]);}}return _0xe9b0a[_0x8f29('0x7b')](_0x42e4fd);}})[_0x8f29('0x53')](handleError(_0xe9b0a,null));};exports['notify']=function(_0x17f154,_0x3276be,_0x6722fc){var _0x58ca52=require(_0x8f29('0x85'));var _0x439832=new _0x58ca52();var _0x2f15c0=_0x439832[_0x8f29('0x86')](_0x17f154[_0x8f29('0x87')][_0x8f29('0x88')])[_0x8f29('0x89')]();var _0x389ba9={'body':_0x17f154[_0x8f29('0x59')],'channel':_0x8f29('0x8a')};var _0x2e9639=[];var _0x22289a=[];var _0xf79c49={};var _0x4883e6=![];return db[_0x8f29('0x8b')][_0x8f29('0x60')]()[_0x8f29('0x22')](function(_0x2f3ad5){if(!_0x2f3ad5){throw new db[(_0x8f29('0x8c'))]['ValidationError'](_0x8f29('0x8d'));}_0x2e9639=_[_0x8f29('0x8e')](_[_0x8f29('0x41')](_0x2f3ad5),['createdAt',_0x8f29('0x8f')]);_0x22289a=_[_0x8f29('0x8e')](_[_0x8f29('0x41')](_0x2f3ad5),[_0x8f29('0x90'),_0x8f29('0x8f'),'CompanyId','ListId']);if(_0x17f154[_0x8f29('0x59')]['id']){delete _0x17f154[_0x8f29('0x59')]['id'];}if(_[_0x8f29('0x79')](_0x17f154[_0x8f29('0x59')][_0x8f29('0x91')])){throw new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0x93'));}if(_[_0x8f29('0x79')](_0x17f154[_0x8f29('0x59')][_0x8f29('0x59')])||_0x17f154['body']['body']===''){throw new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0x94'));}if(_[_0x8f29('0x79')](_0x17f154['body'][_0x8f29('0x95')])){throw new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22289a);}if(!_[_0x8f29('0x96')](_0x22289a,_0x17f154[_0x8f29('0x59')]['mapKey'])){throw new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0x97')+_0x22289a);}_0xf79c49[_0x17f154[_0x8f29('0x59')][_0x8f29('0x95')]]=_0x17f154['body']['from'];})[_0x8f29('0x22')](function(){return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x17f154[_0x8f29('0x55')]['id']},'include':[{'model':db[_0x8f29('0x98')],'as':_0x8f29('0x99'),'include':[{'model':db[_0x8f29('0x8b')],'as':'Contacts','where':_0xf79c49,'limit':0x1,'order':[[_0x8f29('0x8f'),_0x8f29('0x9a')]]}]},{'model':db[_0x8f29('0x9b')],'as':_0x8f29('0x9c')}]});})[_0x8f29('0x22')](handleEntityNotFound(_0x3276be,null))[_0x8f29('0x22')](function(_0x4fbeb9){if(_0x4fbeb9&&_0x4fbeb9[_0x8f29('0x99')]){_0x389ba9['account']=_0x4fbeb9;_0x389ba9['applications']=_0x4fbeb9[_0x8f29('0x9c')];_0x389ba9['list']=_0x4fbeb9[_0x8f29('0x99')];_0x389ba9[_0x8f29('0x9d')]=_[_0x8f29('0x9e')](_0x389ba9[_0x8f29('0x9d')],[_0x8f29('0x9f')],[_0x8f29('0xa0')]);if(_0x389ba9[_0x8f29('0xa1')][_0x8f29('0x9c')]){delete _0x389ba9['account'][_0x8f29('0x9c')];}if(_0x389ba9[_0x8f29('0xa1')][_0x8f29('0x99')]&&_0x389ba9[_0x8f29('0xa1')][_0x8f29('0x99')][_0x8f29('0xa2')][_0x8f29('0x46')]){return _0x389ba9['account']['List'][_0x8f29('0xa2')][0x0];}var _0x3df4d=_['defaults'](_0x17f154[_0x8f29('0x59')],{'firstName':_0x17f154['body']['from'],'ListId':_0x4fbeb9[_0x8f29('0xa3')]});_0x3df4d[_0x17f154['body']['mapKey']]=_0x17f154[_0x8f29('0x59')][_0x8f29('0x91')];return db[_0x8f29('0x8b')][_0x8f29('0x5f')](_0x3df4d,{'fields':_0x2e9639,'raw':!![]});}})[_0x8f29('0x22')](handleEntityNotFound(_0x3276be,null))[_0x8f29('0x22')](function(_0x508efb){_0x389ba9[_0x8f29('0xa4')]=_0x508efb;var _0x242159=_0x17f154[_0x8f29('0x59')]['customerIp'];if(_0x17f154['headers'][_0x8f29('0xa5')]){_0x242159=_0x17f154[_0x8f29('0x87')]['cf-connecting-ip'];}else if(_0x17f154[_0x8f29('0x87')]['x-forwarded-for']){_0x242159=_[_0x8f29('0xa6')](_0x17f154[_0x8f29('0x87')]['x-forwarded-for'][_0x8f29('0xa7')](','));}if(_0x508efb){var _0x1b6bbd={'ContactId':_0x508efb['id'],'ChatWebsiteId':_0x17f154[_0x8f29('0x55')]['id'],'from':(_0x508efb[_0x8f29('0xa8')]||'')+'\x20'+(_0x508efb[_0x8f29('0xa9')]||''),'customerIp':_0x242159,'customerPort':_0x17f154[_0x8f29('0x87')]['x-real-port']?_0x17f154[_0x8f29('0x87')]['x-real-port']:null,'referer':_0x17f154[_0x8f29('0x59')][_0x8f29('0xaa')],'browserName':_0x2f15c0[_0x8f29('0xab')][_0x8f29('0x37')]&&_0x2f15c0['browser']['version']?util[_0x8f29('0xac')]('%s\x20%s',_0x2f15c0[_0x8f29('0xab')][_0x8f29('0x37')],_0x2f15c0['browser']['version']):'unknown','browserVersion':_0x2f15c0[_0x8f29('0xab')][_0x8f29('0xad')]||_0x8f29('0xae'),'osName':util[_0x8f29('0xac')](_0x8f29('0xaf'),_0x2f15c0['os'][_0x8f29('0x37')],_0x2f15c0['os'][_0x8f29('0xad')]),'osVersion':_0x2f15c0['os'][_0x8f29('0xad')],'deviceModel':_0x2f15c0[_0x8f29('0xb0')]['model']&&_0x2f15c0['device'][_0x8f29('0xb1')]?util[_0x8f29('0xac')]('%s\x20%s\x20%s',_0x2f15c0['device'][_0x8f29('0x43')],_0x2f15c0[_0x8f29('0xb0')][_0x8f29('0xb1')],_0x2f15c0['device']['type']):null,'deviceVendor':_0x2f15c0['device']['vendor'],'deviceType':_0x2f15c0[_0x8f29('0xb0')][_0x8f29('0x3f')],'formData':JSON['stringify'](_0x17f154[_0x8f29('0x59')])};var _0x3c621b={'ChatWebsiteId':_0x17f154[_0x8f29('0x55')]['id'],'closed':![]};if(_0x17f154[_0x8f29('0x59')][_0x8f29('0xb2')]){_0x3c621b['threadId']=_0x17f154['body'][_0x8f29('0xb2')];return db[_0x8f29('0xb3')][_0x8f29('0x58')]({'where':_0x3c621b})[_0x8f29('0x22')](function(_0x403971){if(_0x403971){return[_0x403971,![]];}_0x1b6bbd[_0x8f29('0xb2')]=_0x17f154[_0x8f29('0x59')][_0x8f29('0xb2')];_0x1b6bbd[_0x8f29('0xb4')]=_0x17f154[_0x8f29('0x59')][_0x8f29('0xb4')];return db[_0x8f29('0xb3')][_0x8f29('0x5f')](_0x1b6bbd)['then'](function(_0x135915){return[_0x135915,!![]];});});}_0x3c621b[_0x8f29('0xb5')]=_0x508efb['id'];if(_0x17f154[_0x8f29('0x59')][_0x8f29('0xb6')]&&_0x17f154[_0x8f29('0x59')][_0x8f29('0xb6')]['id']){_0x3c621b['id']=_0x17f154['body'][_0x8f29('0xb6')]['id'];return db['ChatInteraction'][_0x8f29('0x58')]({'where':_0x3c621b})[_0x8f29('0x22')](function(_0x5bf951){if(_0x5bf951){return[_0x5bf951,![]];}return db[_0x8f29('0xb3')][_0x8f29('0x5f')](_0x1b6bbd)[_0x8f29('0x22')](function(_0x153a47){return[_0x153a47,!![]];});});}return db[_0x8f29('0xb3')][_0x8f29('0x5f')](_0x1b6bbd)[_0x8f29('0x22')](function(_0x3503ec){return[_0x3503ec,!![]];});}})['spread'](function(_0x5418ef,_0x2d11d7){if(_0x5418ef){_0x4883e6=_0x2d11d7;if(!_0x2d11d7){var _0x3b62c7={'from':(_0x389ba9[_0x8f29('0xa4')][_0x8f29('0xa8')]||'')+'\x20'+(_0x389ba9['contact']['lastName']||'')};if(_0x17f154[_0x8f29('0x59')][_0x8f29('0xb2')]&&_0x17f154['body'][_0x8f29('0xb7')]&&_0x17f154[_0x8f29('0x59')][_0x8f29('0xb2')]!=_0x17f154[_0x8f29('0x59')][_0x8f29('0xb7')]){_0x3b62c7[_0x8f29('0xb2')]=_0x17f154[_0x8f29('0x59')][_0x8f29('0xb7')];}return _0x5418ef[_0x8f29('0x32')](_0x3b62c7);}else{return _0x5418ef;}}})[_0x8f29('0x22')](function(_0x5a1a1f){_0x389ba9['interaction']=_0x5a1a1f['get']({'plain':!![]});_0x389ba9[_0x8f29('0xb6')][_0x8f29('0xb8')]=_0x4883e6;if(_0x389ba9[_0x8f29('0xb6')][_0x8f29('0xb8')]){if(_0x389ba9['account'][_0x8f29('0xb9')]){_0x389ba9[_0x8f29('0x9d')]['push']({'id':0x0,'priority':_0x389ba9[_0x8f29('0x9d')][_0x8f29('0x46')]+0x1,'app':_0x8f29('0xba'),'appdata':'unmanaged','interval':_0x8f29('0xbb')});}}return db[_0x8f29('0xbc')][_0x8f29('0x5f')]({'body':_0x17f154[_0x8f29('0x59')][_0x8f29('0x59')],'ChatWebsiteId':_0x17f154['params']['id'],'ChatInteractionId':_0x5a1a1f['id'],'direction':'in','ContactId':_0x389ba9[_0x8f29('0xa4')]['id'],'AttachmentId':_0x17f154['body'][_0x8f29('0xbd')]});})['then'](function(_0x14bb58){_0x389ba9[_0x8f29('0x29')]=_0x14bb58;if(_0x389ba9['interaction'][_0x8f29('0xbe')]){return db[_0x8f29('0xbf')][_0x8f29('0x58')]({'attributes':['id','name'],'where':{'id':_0x389ba9['interaction'][_0x8f29('0xbe')]}})['then'](function(_0xda500f){if(_0xda500f){_0x389ba9[_0x8f29('0x9d')][_0x8f29('0xc0')]({'id':0x0,'priority':0x0,'app':_0x8f29('0xc1'),'appdata':_0xda500f[_0x8f29('0x37')]+','+(_0x389ba9[_0x8f29('0xa1')][_0x8f29('0xc2')]||0xa),'interval':_0x8f29('0xbb')});_0x389ba9[_0x8f29('0xc3')]=!![];}return respondWithRpcPromise('Start',_0x8f29('0xc4'),_0x389ba9);});}return respondWithRpcPromise('Start',_0x8f29('0xc4'),_0x389ba9);})[_0x8f29('0x22')](function(_0x4671b2){respondWithRpcPromise(_0x8f29('0xc5'),_0x8f29('0xc5'),{'event':'notify','message':_0x4671b2},client9002);return _0x4671b2;})['then'](respondWithResult(_0x3276be,null))[_0x8f29('0x53')](handleError(_0x3276be,null));};exports[_0x8f29('0xc6')]=function(_0xce8e42,_0xe14d93,_0x365475){var _0x598202,_0x5c9710,_0x3b9a31;var _0x46a1f6=[];var _0x523ffd=[];var _0x59e34b={};var _0x28eac5=_0xce8e42['files']||[];var _0x57d3fa=[];var _0x36a7f2;return db['CmContact'][_0x8f29('0x60')]()[_0x8f29('0x22')](function(_0x4faef5){if(!_0x4faef5){throw new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0x8d'));}_0x523ffd=_[_0x8f29('0x8e')](_[_0x8f29('0x41')](_0x4faef5),['createdAt',_0x8f29('0x8f')]);_0x46a1f6=_[_0x8f29('0x8e')](_[_0x8f29('0x41')](_0x4faef5),[_0x8f29('0x90'),_0x8f29('0x8f'),_0x8f29('0xc7'),'ListId']);if(_0xce8e42['body']['id']){delete _0xce8e42[_0x8f29('0x59')]['id'];}if(_[_0x8f29('0x79')](_0xce8e42['body'][_0x8f29('0x91')])){throw _0xe14d93[_0x8f29('0x2b')](0x1f4)[_0x8f29('0x38')](new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0x93')));}if(_[_0x8f29('0x79')](_0xce8e42['body']['body'])||_0xce8e42[_0x8f29('0x59')][_0x8f29('0x59')]===''){throw _0xe14d93[_0x8f29('0x2b')](0x1f4)[_0x8f29('0x38')](new db[(_0x8f29('0x8c'))]['ValidationError'](_0x8f29('0x94')));}if(_[_0x8f29('0x79')](_0xce8e42[_0x8f29('0x59')][_0x8f29('0xc8')])){throw _0xe14d93[_0x8f29('0x2b')](0x1f4)[_0x8f29('0x38')](new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0xc9')+_0x46a1f6));}if(!_['includes'](_0x46a1f6,_0xce8e42['body'][_0x8f29('0xc8')])){throw _0xe14d93['status'](0x1f4)[_0x8f29('0x38')](new db[(_0x8f29('0x8c'))][(_0x8f29('0x92'))](_0x8f29('0xca')+_0x46a1f6));}_0x59e34b[_0xce8e42[_0x8f29('0x59')]['mapKeyOffline']]=_0xce8e42['body'][_0x8f29('0x91')];})[_0x8f29('0x22')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xce8e42[_0x8f29('0x55')]['id']},'include':[{'model':db[_0x8f29('0x98')],'as':_0x8f29('0x99')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0xe14d93,null))[_0x8f29('0x22')](function(_0x5787e9){if(_0x5787e9&&_0x5787e9[_0x8f29('0x99')]){_0x5c9710=_0x5787e9;var _0x232e68=_[_0x8f29('0x19')](_0xce8e42[_0x8f29('0x59')],{'firstName':_0xce8e42[_0x8f29('0x59')][_0x8f29('0x91')],'phone':_0xce8e42[_0x8f29('0x59')][_0x8f29('0x91')],'ListId':_0x5787e9['ListId']});_0x232e68[_0xce8e42['body']['mapKeyOffline']]=_0xce8e42['body'][_0x8f29('0x91')];return db['CmContact'][_0x8f29('0xcb')]({'where':_0x59e34b,'defaults':_0x232e68});}})['spread'](function(_0x2e6e87){if(_0x2e6e87){_0x3b9a31=_0x2e6e87;var _0x4987e1=fs['readFileSync'](path[_0x8f29('0x75')](config[_0x8f29('0x76')],_0x8f29('0xcc')),_0x8f29('0xcd'));var _0xc28e85=ejs[_0x8f29('0xce')](_0x4987e1,{'body':_[_0x8f29('0xcf')](_0xce8e42[_0x8f29('0x59')][_0x8f29('0x59')]),'bodyTitle':_0x5c9710['offlineMessageBody']});return db[_0x8f29('0xd0')][_0x8f29('0x5f')]({'body':_0xc28e85,'ContactId':_0x2e6e87['id'],'ChatWebsiteId':_0x5c9710['id']});}})[_0x8f29('0x22')](function(_0x3494be){_0x36a7f2=_0x3494be;if(_0x28eac5[_0x8f29('0x46')]){var _0x568afb=_0x28eac5[_0x8f29('0x3b')](function(_0x26c7fe){return{'name':_0x26c7fe[_0x8f29('0xd1')],'basename':_0x26c7fe[_0x8f29('0x6d')],'type':_0x26c7fe[_0x8f29('0xd2')],'ChatOfflineMessageId':_0x3494be['id']};});_0x57d3fa=_0x568afb[_0x8f29('0x3b')](_0x2dd110=>{var _0x87d0f6={'filename':_0x2dd110[_0x8f29('0x37')],'path':path['join'](config['root'],_0x8f29('0xd3'),_0x8f29('0xd4'),_0x8f29('0xd5'),'offline-chat',_0x2dd110[_0x8f29('0xd6')])};return _0x87d0f6;});if(!_0x5c9710[_0x8f29('0xd7')]){return db[_0x8f29('0xd8')][_0x8f29('0xd9')](function(_0x58df14){return db[_0x8f29('0xda')][_0x8f29('0xdb')](_0x568afb,{'transaction':_0x58df14});});}}})['then'](function(){if(_0x36a7f2){_0x598202=_0x36a7f2;return db[_0x8f29('0xdc')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8f29('0xdd'),'raw':!![]}]});}})[_0x8f29('0x22')](function(_0x4b0acd){if(_0x4b0acd&&_0x4b0acd['Smtp']&&_0x5c9710[_0x8f29('0xde')]&&_0x5c9710[_0x8f29('0xdf')]){var _0x418545={'tls':{'rejectUnauthorized':![]}};if(_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe0')]){_0x418545[_0x8f29('0xe0')]=_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe0')];}else{_0x418545[_0x8f29('0xe1')]=_0x4b0acd['Smtp'][_0x8f29('0xe1')];_0x418545[_0x8f29('0xe2')]=_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe2')];_0x418545[_0x8f29('0xe3')]=_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe3')];}if(_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe4')]){_0x418545[_0x8f29('0xe5')]={'user':_0x4b0acd[_0x8f29('0xdd')]['user'],'pass':_0x4b0acd[_0x8f29('0xdd')][_0x8f29('0xe6')]};}return respondWithRpcPromise(_0x8f29('0xe7'),'sendMail',{'account':_0x418545,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4b0acd[_0x8f29('0x37')],_0x4b0acd[_0x8f29('0xe8')]||_0x4b0acd['Smtp'][_0x8f29('0x5a')]),'to':_0x5c9710[_0x8f29('0xdf')],'subject':_0x5c9710[_0x8f29('0xe9')],'html':_0x598202[_0x8f29('0x59')],'attachments':_0x57d3fa}},client9003)['then'](function(){return _0x598202;})[_0x8f29('0x53')](function(_0xeed99d){console[_0x8f29('0x27')](_0xeed99d);});}})[_0x8f29('0x22')](function(){if(_0x5c9710&&_0x5c9710['openNewInteraction']&&_0x5c9710[_0x8f29('0xea')]){var _0x311a7b=[];if(_0x28eac5[_0x8f29('0x46')]){_0x311a7b=_0x28eac5[_0x8f29('0x3b')](function(_0x26b441){return{'name':_0x26b441[_0x8f29('0xd1')],'basename':_0x26b441[_0x8f29('0x6d')],'type':_0x26b441['mimetype'],'ChatOfflineMessageId':_0x36a7f2['id']};});}var _0x58226c;if(!_['isNil'](_0x5c9710['subjectOffline'])){var _0x1e8b8a=_[_0x8f29('0x3b')](_0xce8e42[_0x8f29('0x59')],function(_0x3b7959){return _0x3b7959;});var _0x3eb928=_[_0x8f29('0xeb')](_0x1e8b8a)[0x0];var _0x530875=_['mapValues'](_0x3eb928,function(_0x35c31a){return _0x35c31a;});_0x58226c=_0x530875[0x1][_0x5c9710[_0x8f29('0xec')]];}var _0x49edc4={'from':_0x3b9a31[_0x8f29('0xe8')],'firstName':_0x3b9a31[_0x8f29('0xa8')],'lastName':_0x3b9a31['lastName'],'mapKey':'email','message':{'from':_0x3b9a31[_0x8f29('0xe8')],'to':_0x5c9710[_0x8f29('0xdc')][_0x8f29('0xe8')],'cc':'','subject':_[_0x8f29('0x79')](_0x58226c)?_0x5c9710[_0x8f29('0xe9')]:_0x58226c,'messageId':'','sentAt':new Date(),'attach':_0x311a7b[_0x8f29('0x46')],'attachments':_0x311a7b,'originChannel':_0x8f29('0xed'),'ChatWebsiteId':_0x5c9710['id'],'ChatOfflineMessageId':_0x598202['id'],'originTo':_0x5c9710[_0x8f29('0xdc')]['email']},'body':_0x598202['body']};var _0x1dc4ff={'account':{'id':_0x5c9710['MailAccountId']},'body':_0x49edc4,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8f29('0xee'),_0x8f29('0xef'),_0x1dc4ff,client9001)[_0x8f29('0x22')](function(){return _0x598202;})[_0x8f29('0x53')](function(_0x2730ff){console[_0x8f29('0x27')](_0x2730ff);});}return;})[_0x8f29('0x22')](function(){if(_0x598202){return _0x598202;}})[_0x8f29('0x22')](respondWithResult(_0xe14d93,null))['catch'](function(_0x5de201){console[_0x8f29('0x27')](_0x8f29('0x53'),_0x5de201);for(var _0x5d0c15 of _0x28eac5){var _0x1851c8=path[_0x8f29('0x75')](config['root'],'server',_0x8f29('0xd4'),_0x8f29('0xd5'),_0x8f29('0xf0'),_0x5d0c15['filename']);fs_extra[_0x8f29('0xf1')](_0x1851c8)[_0x8f29('0x53')](function(_0x2e7853){console[_0x8f29('0x27')]('Could\x20not\x20remove\x20attachment\x20file',_0x1851c8,_0x2e7853);});}});};exports[_0x8f29('0xf2')]=function(_0x57667d,_0x656a91,_0x1f474c){return db[_0x8f29('0xb3')][_0x8f29('0x58')]({'where':{'id':_0x57667d[_0x8f29('0x55')]['id']}})['then'](handleEntityNotFound(_0x656a91,null))[_0x8f29('0x22')](function(_0x490b6d){if(_0x490b6d){return _0x490b6d[_0x8f29('0xf2')](_0x57667d[_0x8f29('0x59')][_0x8f29('0x68')],_['omit'](_0x57667d['body'],['ids','id'])||{});}})[_0x8f29('0x22')](respondWithResult(_0x656a91,null))[_0x8f29('0x53')](handleError(_0x656a91,null));};exports[_0x8f29('0xf3')]=function(_0x4ebce4,_0x292d5a,_0x60cd65){var _0x426eea={'raw':![],'where':{}};var _0xa6ff0b={};var _0x4b0bc9={'count':0x0,'rows':[]};return db[_0x8f29('0x3c')][_0x8f29('0x64')]({'where':{'id':_0x4ebce4[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x292d5a,null))[_0x8f29('0x22')](function(_0x1132a3){if(_0x1132a3){_0xa6ff0b[_0x8f29('0x43')]=_[_0x8f29('0x41')](db[_0x8f29('0xb3')]['rawAttributes']);_0xa6ff0b[_0x8f29('0x40')]=_['keys'](_0x4ebce4['query']);_0xa6ff0b['filters']=_[_0x8f29('0x42')](_0xa6ff0b['model'],_0xa6ff0b['query']);_0x426eea['attributes']=_['intersection'](_0xa6ff0b[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x4ebce4['query']['fields']));_0x426eea[_0x8f29('0x44')]=_0x426eea['attributes'][_0x8f29('0x46')]?_0x426eea[_0x8f29('0x44')]:_0xa6ff0b[_0x8f29('0x43')];if(!_0x4ebce4['query'][_0x8f29('0x47')](_0x8f29('0x48'))){_0x426eea[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x4ebce4['query'][_0x8f29('0x30')]);_0x426eea['offset']=qs[_0x8f29('0x2e')](_0x4ebce4[_0x8f29('0x40')]['offset']);}_0x426eea[_0x8f29('0x49')]=qs[_0x8f29('0x4a')](_0x4ebce4[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x426eea[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x4ebce4['query'],_0xa6ff0b[_0x8f29('0x4c')]));_0x426eea['where'][_0x8f29('0x61')]=_0x1132a3['id'];if(_0x4ebce4[_0x8f29('0x40')][_0x8f29('0x4e')]){_0x426eea[_0x8f29('0x4b')]=_['merge'](_0x426eea['where'],{'$or':_[_0x8f29('0x3b')](_0x426eea['attributes'],function(_0x11a8f3){var _0x803e08={};_0x803e08[_0x11a8f3]={'$like':'%'+_0x4ebce4[_0x8f29('0x40')][_0x8f29('0x4e')]+'%'};return _0x803e08;})});}_0x426eea=_[_0x8f29('0x4f')]({},_0x426eea,_0x4ebce4[_0x8f29('0x51')]);return db[_0x8f29('0xb3')][_0x8f29('0x2f')]({'where':_0x426eea[_0x8f29('0x4b')]})[_0x8f29('0x22')](function(_0xbc4067){_0x4b0bc9[_0x8f29('0x2f')]=_0xbc4067;if(_0x4ebce4['query'][_0x8f29('0x65')]){_0x426eea[_0x8f29('0x57')]=[{'model':db[_0x8f29('0x8b')],'as':'Contact','required':![]},{'model':db[_0x8f29('0xbf')],'as':_0x8f29('0xf4'),'attributes':[_0x8f29('0x37'),'fullname',_0x8f29('0xf5')],'required':![]},{'model':db['Tag'],'as':_0x8f29('0xf6'),'attributes':['id',_0x8f29('0x37'),'color'],'where':_0x4ebce4[_0x8f29('0x40')][_0x8f29('0xf7')]?{'id':_0x4ebce4[_0x8f29('0x40')][_0x8f29('0xf7')]}:undefined,'required':_0x4ebce4[_0x8f29('0x40')]['tag']?!![]:![]}];}return db[_0x8f29('0xb3')][_0x8f29('0x66')](_0x426eea);})[_0x8f29('0x22')](function(_0x3fc8df){_0x4b0bc9[_0x8f29('0x52')]=_0x3fc8df;return _0x4b0bc9;});}})[_0x8f29('0x22')](respondWithFilteredResult(_0x292d5a,_0x426eea))[_0x8f29('0x53')](handleError(_0x292d5a,null));};function iftimePromise(_0x20a3d9,_0x1c1bc7){return respondWithRpcPromise(_0x8f29('0xf8'),'getSnippet',{'command':_0x1c1bc7[_0x8f29('0xf9')]?util[_0x8f29('0xac')]('iftime\x20%s,%s',_0x20a3d9[_0x8f29('0xfa')],_0x1c1bc7[_0x8f29('0xf9')]):util['format'](_0x8f29('0xfb'),_0x20a3d9['interval'])},client9002)[_0x8f29('0x22')](function(_0x3e2c26){var _0x548ab6=_0x3e2c26&&_0x3e2c26[_0x8f29('0xfc')](_0x8f29('0xfd'))>=0x0?!![]:![];logger[_0x8f29('0x23')](_0x8f29('0xfe'),_0x1c1bc7['id'],_0x20a3d9['id'],_0x20a3d9[_0x8f29('0xfa')],_0x548ab6?'ONLINE':_0x8f29('0xff'),_0x1c1bc7[_0x8f29('0xf9')]?_0x1c1bc7[_0x8f29('0xf9')]:_0x8f29('0x100'));return _0x548ab6;})[_0x8f29('0x53')](function(_0x113fc9){logger[_0x8f29('0x27')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1c1bc7['id'],_0x20a3d9['id'],_0x20a3d9['interval'],util[_0x8f29('0x101')](_0x113fc9,{'showHidden':![],'depth':null}),_0x1c1bc7[_0x8f29('0xf9')]?_0x1c1bc7[_0x8f29('0xf9')]:'No\x20timezone');return![];});}exports[_0x8f29('0x102')]=function(_0x9d37f4,_0x203ebb,_0x5e85b8){var _0x395b7f=0x0;var _0x52d896=0x0;var _0x933556=![];var _0x2b65de;var _0x2f1a63;return db[_0x8f29('0x3c')]['find']({'where':{'id':_0x9d37f4[_0x8f29('0x55')]['id']},'include':[{'model':db[_0x8f29('0x103')],'as':_0x8f29('0x103'),'include':[{'model':db[_0x8f29('0x103')],'as':'Intervals','attributes':['id',_0x8f29('0xfa')],'raw':!![]}]}]})[_0x8f29('0x22')](handleEntityNotFound(_0x203ebb,null))[_0x8f29('0x22')](function(_0x486d7b){if(_0x486d7b){_0x2b65de=_0x486d7b;return _0x486d7b[_0x8f29('0x104')]({'raw':!![]});}})[_0x8f29('0x22')](function(_0x12210f){if(_0x2b65de){if(_0x12210f){_0x2f1a63=_0x12210f;}}return require(_0x8f29('0x16'))[_0x8f29('0x77')]();})[_0x8f29('0x22')](function(_0x50ca0a){if(_0x50ca0a){_0x52d896=_0x50ca0a['virtual'];_0x933556=_0x50ca0a[_0x8f29('0x78')];}})[_0x8f29('0x22')](function(){return db[_0x8f29('0xb3')][_0x8f29('0x2f')]({'where':{'closed':![]}});})[_0x8f29('0x22')](function(_0x2da7ad){_0x395b7f=_0x2da7ad;if(_0x52d896&&_0x2da7ad>_0x52d896){return db[_0x8f29('0x105')]['findOne']({'where':{'id':0x1}})[_0x8f29('0x22')](function(_0x4cb0a0){if(_0x4cb0a0){_0x4cb0a0[_0x8f29('0x106')](_0x8f29('0x107'));}});}})[_0x8f29('0x22')](function(){if(_0x2b65de[_0x8f29('0x103')]&&_0x2b65de['Interval'][_0x8f29('0x108')]){var _0x25347b=[];for(var _0x288c11=0x0;_0x288c11<_0x2b65de[_0x8f29('0x103')][_0x8f29('0x108')][_0x8f29('0x46')];_0x288c11++){var _0x2712a4=_0x2b65de[_0x8f29('0x103')][_0x8f29('0x108')][_0x288c11][_0x8f29('0x34')]({'plain':!![]});_0x25347b[_0x8f29('0x109')](iftimePromise(_0x2712a4,_0x2b65de));}return BPromise[_0x8f29('0x10a')](_0x25347b)[_0x8f29('0x22')](function(_0x1b3c80){return _[_0x8f29('0x10b')](_0x1b3c80);});}else{return!![];}})[_0x8f29('0x22')](function(_0x20f6e1){var _0x2dad1c=fs[_0x8f29('0x10c')](path['join'](config['root'],'server/files/chat/iframe.ejs'),_0x8f29('0xcd'));var _0x564f03={'remote':_0x2b65de[_0x8f29('0x10d')],'query':querystring[_0x8f29('0x10e')](_[_0x8f29('0x4f')](_0x2b65de['get']({'plain':!![]}),{'customerIp':_0x9d37f4[_0x8f29('0x87')][_0x8f29('0x10f')]||_0x9d37f4[_0x8f29('0x87')][_0x8f29('0x110')]||_0x9d37f4[_0x8f29('0x111')][_0x8f29('0x112')]||_0x9d37f4['ip'],'referer':_0x9d37f4['headers'][_0x8f29('0xaa')],'openedInteractions':_0x395b7f,'maxInteractions':_0x52d896,'virtual':_0x933556[_0x8f29('0x113')],'online':_0x20f6e1,'custom':_0x933556}))[_0x8f29('0x114')](/'/g,'\x5c\x27')};_0x203ebb[_0x8f29('0x38')](ejs[_0x8f29('0xce')](Mustache[_0x8f29('0xce')](_0x2dad1c,_0x564f03),{'proactiveActions':_0x2f1a63,'alignment':_0x2b65de[_0x8f29('0x115')],'verticalAlignment':_0x2b65de[_0x8f29('0x116')],'div_color':_0x2b65de['color'],'text_color':_0x2b65de[_0x8f29('0x117')],'button_color':_0x2b65de['color_button'],'background_color':_0x2b65de['backgroundColor']}));})[_0x8f29('0x53')](handleError(_0x203ebb,null));};exports[_0x8f29('0x118')]=function(_0x163ec7,_0x1f0993,_0xc86bee){return db[_0x8f29('0x3c')][_0x8f29('0x64')]({'where':{'id':_0x163ec7[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x1f0993,null))[_0x8f29('0x22')](function(_0x2db615){if(_0x2db615){return db['sequelize'][_0x8f29('0xd9')](function(_0x9ae50d){return db[_0x8f29('0x9b')][_0x8f29('0x33')]({'where':{'ChatWebsiteId':_0x163ec7[_0x8f29('0x55')]['id']},'transaction':_0x9ae50d})[_0x8f29('0x22')](function(_0x4c261f){var _0xb202e9=_[_0x8f29('0x3b')](_0x163ec7[_0x8f29('0x59')],function(_0x15b335){_0x15b335[_0x8f29('0x61')]=_0x163ec7[_0x8f29('0x55')]['id'];return _0x15b335;});return db['ChatApplication'][_0x8f29('0xdb')](_0xb202e9,{'transaction':_0x9ae50d});});})[_0x8f29('0x22')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x163ec7[_0x8f29('0x55')]['id']},'order':'priority'});});}})[_0x8f29('0x22')](respondWithResult(_0x1f0993,null))[_0x8f29('0x53')](handleError(_0x1f0993,null));};exports['getApplications']=function(_0x3d9c70,_0x1984c4,_0x836550){var _0x4ce6ff={};var _0x645f48={};var _0xda745e;var _0x5546a7;return db[_0x8f29('0x3c')]['findOne']({'where':{'id':_0x3d9c70[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x1984c4,null))['then'](function(_0x2dc5fc){if(_0x2dc5fc){_0xda745e=_0x2dc5fc;_0x645f48['model']=_[_0x8f29('0x41')](db[_0x8f29('0x9b')]['rawAttributes']);_0x645f48['query']=_[_0x8f29('0x41')](_0x3d9c70['query']);_0x645f48[_0x8f29('0x4c')]=_[_0x8f29('0x42')](_0x645f48['model'],_0x645f48['query']);_0x4ce6ff['attributes']=_[_0x8f29('0x42')](_0x645f48[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x3d9c70[_0x8f29('0x40')][_0x8f29('0x45')]));_0x4ce6ff[_0x8f29('0x44')]=_0x4ce6ff[_0x8f29('0x44')][_0x8f29('0x46')]?_0x4ce6ff[_0x8f29('0x44')]:_0x645f48['model'];_0x4ce6ff[_0x8f29('0x49')]=qs[_0x8f29('0x4a')](_0x3d9c70[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x4ce6ff[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x3d9c70[_0x8f29('0x40')],_0x645f48[_0x8f29('0x4c')]));if(_0x3d9c70[_0x8f29('0x40')]['filter']){_0x4ce6ff['where']=_['merge'](_0x4ce6ff[_0x8f29('0x4b')],{'$or':_['map'](_0x4ce6ff[_0x8f29('0x44')],function(_0x3036d3){var _0x24988a={};_0x24988a[_0x3036d3]={'$like':'%'+_0x3d9c70[_0x8f29('0x40')][_0x8f29('0x4e')]+'%'};return _0x24988a;})});}_0x4ce6ff=_[_0x8f29('0x4f')]({},_0x4ce6ff,_0x3d9c70[_0x8f29('0x51')]);return _0xda745e[_0x8f29('0x119')](_0x4ce6ff);}})[_0x8f29('0x22')](function(_0x118853){if(_0x118853){_0x5546a7=_0x118853[_0x8f29('0x46')];if(!_0x3d9c70[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x4ce6ff[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x3d9c70[_0x8f29('0x40')]['limit']);_0x4ce6ff[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x3d9c70[_0x8f29('0x40')][_0x8f29('0x2e')]);}return _0xda745e[_0x8f29('0x119')](_0x4ce6ff);}})[_0x8f29('0x22')](function(_0x1e3e1d){if(_0x1e3e1d){return _0x1e3e1d?{'count':_0x5546a7,'rows':_0x1e3e1d}:null;}})['then'](respondWithResult(_0x1984c4,null))['catch'](handleError(_0x1984c4,null));};exports[_0x8f29('0x11a')]=function(_0x542207,_0x55f2ca,_0x474bdb){return db['chatProactiveAction'][_0x8f29('0x58')]({'where':{'id':_0x542207[_0x8f29('0x55')]['id']}})['then'](handleEntityNotFound(_0x55f2ca,null))[_0x8f29('0x22')](function(_0x297fd6){if(_0x297fd6){return _0x297fd6[_0x8f29('0x11a')](_0x542207[_0x8f29('0x59')][_0x8f29('0x68')],_[_0x8f29('0x11b')](_0x542207[_0x8f29('0x59')],[_0x8f29('0x68'),'id'])||{});}})['then'](respondWithResult(_0x55f2ca,null))[_0x8f29('0x53')](handleError(_0x55f2ca,null));};exports[_0x8f29('0x104')]=function(_0x4d5be1,_0x3c5d2c,_0x90d901){var _0x599769={};var _0x151905={};var _0x18aaf3;var _0xc5cf80;return db[_0x8f29('0x3c')][_0x8f29('0x64')]({'where':{'id':_0x4d5be1[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x3c5d2c,null))[_0x8f29('0x22')](function(_0x2ec580){if(_0x2ec580){_0x18aaf3=_0x2ec580;_0x151905['model']=_[_0x8f29('0x41')](db[_0x8f29('0x11c')][_0x8f29('0x3d')]);_0x151905['query']=_[_0x8f29('0x41')](_0x4d5be1[_0x8f29('0x40')]);_0x151905[_0x8f29('0x4c')]=_['intersection'](_0x151905[_0x8f29('0x43')],_0x151905[_0x8f29('0x40')]);_0x599769[_0x8f29('0x44')]=_[_0x8f29('0x42')](_0x151905[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x4d5be1['query']['fields']));_0x599769[_0x8f29('0x44')]=_0x599769[_0x8f29('0x44')]['length']?_0x599769[_0x8f29('0x44')]:_0x151905['model'];_0x599769[_0x8f29('0x49')]=qs[_0x8f29('0x4a')](_0x4d5be1[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x599769['where']=qs[_0x8f29('0x4c')](_['pick'](_0x4d5be1[_0x8f29('0x40')],_0x151905[_0x8f29('0x4c')]));if(_0x4d5be1['query'][_0x8f29('0x4e')]){_0x599769[_0x8f29('0x4b')]=_[_0x8f29('0x4f')](_0x599769[_0x8f29('0x4b')],{'$or':_[_0x8f29('0x3b')](_0x599769[_0x8f29('0x44')],function(_0x366b2c){var _0x87df7e={};_0x87df7e[_0x366b2c]={'$like':'%'+_0x4d5be1['query'][_0x8f29('0x4e')]+'%'};return _0x87df7e;})});}_0x599769=_[_0x8f29('0x4f')]({},_0x599769,_0x4d5be1[_0x8f29('0x51')]);return _0x18aaf3[_0x8f29('0x104')](_0x599769);}})[_0x8f29('0x22')](function(_0x19566c){if(_0x19566c){_0xc5cf80=_0x19566c[_0x8f29('0x46')];if(!_0x4d5be1[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x599769[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x4d5be1[_0x8f29('0x40')]['limit']);_0x599769[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x4d5be1['query'][_0x8f29('0x2e')]);}return _0x18aaf3[_0x8f29('0x104')](_0x599769);}})[_0x8f29('0x22')](function(_0x3952a2){if(_0x3952a2){return _0x3952a2?{'count':_0xc5cf80,'rows':_0x3952a2}:null;}})[_0x8f29('0x22')](respondWithResult(_0x3c5d2c,null))[_0x8f29('0x53')](handleError(_0x3c5d2c,null));};exports['getFields']=function(_0x38c14c,_0x822b20,_0x49af42){var _0x69688a=_0x38c14c[_0x8f29('0x40')][_0x8f29('0x11d')]===_0x8f29('0x11e')?_0x8f29('0x11f'):_0x8f29('0x120');return db['ChatWebsite'][_0x8f29('0x58')]({'attributes':['id',_0x69688a],'where':{'id':_0x38c14c[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x822b20,null))[_0x8f29('0x22')](function(_0x48835d){if(_0x48835d){var _0x381731=_0x48835d[_0x69688a];var _0xdb2f81=_0x381731&&_0x381731[_0x8f29('0x121')]?_0x381731['items']:[];_0x822b20[_0x8f29('0x38')]({'fromKey':_[_0x8f29('0x79')](_0x381731[_0x8f29('0x122')])?undefined:_0x381731[_0x8f29('0x122')],'count':_0xdb2f81['length'],'rows':_0xdb2f81});}})[_0x8f29('0x53')](handleError(_0x822b20,null));};exports[_0x8f29('0x123')]=function(_0x27f0d7,_0x39dad6,_0x2c1171){var _0x2db7cd={'raw':![],'where':{}};var _0x4cf430={};var _0x48fd98={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8f29('0x64')]({'where':{'id':_0x27f0d7[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x39dad6,null))[_0x8f29('0x22')](function(_0x41f8b5){if(_0x41f8b5){_0x4cf430[_0x8f29('0x43')]=_[_0x8f29('0x41')](db[_0x8f29('0xd0')][_0x8f29('0x3d')]);_0x4cf430[_0x8f29('0x40')]=_['keys'](_0x27f0d7[_0x8f29('0x40')]);_0x4cf430[_0x8f29('0x4c')]=_[_0x8f29('0x42')](_0x4cf430[_0x8f29('0x43')],_0x4cf430[_0x8f29('0x40')]);_0x2db7cd[_0x8f29('0x44')]=_[_0x8f29('0x42')](_0x4cf430[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x27f0d7[_0x8f29('0x40')][_0x8f29('0x45')]));_0x2db7cd[_0x8f29('0x44')]=_0x2db7cd[_0x8f29('0x44')][_0x8f29('0x46')]?_0x2db7cd[_0x8f29('0x44')]:_0x4cf430['model'];if(!_0x27f0d7[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x2db7cd[_0x8f29('0x30')]=qs['limit'](_0x27f0d7[_0x8f29('0x40')][_0x8f29('0x30')]);_0x2db7cd[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x27f0d7[_0x8f29('0x40')]['offset']);}_0x2db7cd[_0x8f29('0x49')]=qs['sort'](_0x27f0d7[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x2db7cd[_0x8f29('0x4b')]=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x27f0d7['query'],_0x4cf430[_0x8f29('0x4c')]));_0x2db7cd[_0x8f29('0x4b')][_0x8f29('0x61')]=_0x41f8b5['id'];if(_0x27f0d7[_0x8f29('0x40')][_0x8f29('0x4e')]){_0x2db7cd[_0x8f29('0x4b')]=_[_0x8f29('0x4f')](_0x2db7cd[_0x8f29('0x4b')],{'$or':_[_0x8f29('0x3b')](_0x2db7cd['attributes'],function(_0x1172a0){var _0x359719={};_0x359719[_0x1172a0]={'$like':'%'+_0x27f0d7[_0x8f29('0x40')]['filter']+'%'};return _0x359719;})});}_0x2db7cd=_[_0x8f29('0x4f')]({},_0x2db7cd,_0x27f0d7[_0x8f29('0x51')]);return db[_0x8f29('0xd0')][_0x8f29('0x2f')]({'where':_0x2db7cd[_0x8f29('0x4b')]})[_0x8f29('0x22')](function(_0x350f6e){_0x48fd98[_0x8f29('0x2f')]=_0x350f6e;if(_0x27f0d7['query'][_0x8f29('0x65')]){_0x2db7cd['include']=[{'all':!![]}];}else{_0x2db7cd[_0x8f29('0x57')]=[{'model':db['CmContact'],'as':_0x8f29('0x124'),'required':![]},{'model':db['Attachment'],'as':_0x8f29('0x125'),'required':![]}];}return db[_0x8f29('0xd0')][_0x8f29('0x66')](_0x2db7cd);})[_0x8f29('0x22')](function(_0x31fceb){_0x48fd98['rows']=_0x31fceb;return _0x48fd98;});}})[_0x8f29('0x22')](respondWithFilteredResult(_0x39dad6,_0x2db7cd))[_0x8f29('0x53')](handleError(_0x39dad6,null));};exports['addAgents']=function(_0x168738,_0x394808,_0x45c751){return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x168738[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x394808,null))['then'](function(_0x3f7e9c){if(_0x3f7e9c){return _0x3f7e9c['addAgents'](_0x168738['body'][_0x8f29('0x68')],_['omit'](_0x168738[_0x8f29('0x59')],[_0x8f29('0x68'),'id'])||{})[_0x8f29('0x126')](function(_0x1676dc){for(var _0x53b74a=0x0;_0x53b74a<_0x168738[_0x8f29('0x59')][_0x8f29('0x68')]['length'];_0x53b74a+=0x1){socket['emit'](_0x8f29('0x127'),{'UserId':Number(_0x168738[_0x8f29('0x59')][_0x8f29('0x68')][_0x53b74a]),'ChatWebsiteId':Number(_0x168738['params']['id'])});}return _0x1676dc;});}})['then'](respondWithResult(_0x394808,null))[_0x8f29('0x53')](handleError(_0x394808,null));};exports[_0x8f29('0x128')]=function(_0x5ee6e3,_0x211a75,_0x38dfd0){return db[_0x8f29('0x3c')][_0x8f29('0x58')]({'where':{'id':_0x5ee6e3[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x211a75,null))[_0x8f29('0x22')](function(_0x512b15){if(_0x512b15){return _0x512b15[_0x8f29('0x128')](_0x5ee6e3[_0x8f29('0x40')]['ids'])[_0x8f29('0x22')](function(){if(_[_0x8f29('0x129')](_0x5ee6e3[_0x8f29('0x40')]['ids'])){for(var _0x2d4972=0x0;_0x2d4972<_0x5ee6e3[_0x8f29('0x40')][_0x8f29('0x68')]['length'];_0x2d4972+=0x1){socket['emit'](_0x8f29('0x12a'),{'UserId':Number(_0x5ee6e3['query']['ids'][_0x2d4972]),'ChatWebsiteId':Number(_0x5ee6e3[_0x8f29('0x55')]['id'])});}}else{socket['emit'](_0x8f29('0x12a'),{'UserId':Number(_0x5ee6e3[_0x8f29('0x40')][_0x8f29('0x68')]),'ChatWebsiteId':Number(_0x5ee6e3[_0x8f29('0x55')]['id'])});}});}})[_0x8f29('0x22')](respondWithStatusCode(_0x211a75,null))[_0x8f29('0x53')](handleError(_0x211a75,null));};exports['getAgents']=function(_0x599cad,_0x6f9804,_0x5f4844){var _0x2b2234={};var _0x50cb86={};var _0x28f9e9;var _0x57b069;return db[_0x8f29('0x3c')]['findOne']({'where':{'id':_0x599cad[_0x8f29('0x55')]['id']}})[_0x8f29('0x22')](handleEntityNotFound(_0x6f9804,null))[_0x8f29('0x22')](function(_0x35b94a){if(_0x35b94a){_0x28f9e9=_0x35b94a;_0x50cb86['model']=_[_0x8f29('0x41')](db[_0x8f29('0xbf')]['rawAttributes']);_0x50cb86[_0x8f29('0x40')]=_[_0x8f29('0x41')](_0x599cad[_0x8f29('0x40')]);_0x50cb86[_0x8f29('0x4c')]=_['intersection'](_0x50cb86[_0x8f29('0x43')],_0x50cb86[_0x8f29('0x40')]);_0x2b2234[_0x8f29('0x44')]=_['intersection'](_0x50cb86[_0x8f29('0x43')],qs[_0x8f29('0x45')](_0x599cad[_0x8f29('0x40')][_0x8f29('0x45')]));_0x2b2234['attributes']=_0x2b2234[_0x8f29('0x44')][_0x8f29('0x46')]?_0x2b2234['attributes']:_0x50cb86[_0x8f29('0x43')];_0x2b2234[_0x8f29('0x49')]=qs['sort'](_0x599cad[_0x8f29('0x40')][_0x8f29('0x4a')]);_0x2b2234['where']=qs[_0x8f29('0x4c')](_[_0x8f29('0x4d')](_0x599cad['query'],_0x50cb86[_0x8f29('0x4c')]));if(_0x599cad[_0x8f29('0x40')]['filter']){_0x2b2234[_0x8f29('0x4b')]=_[_0x8f29('0x4f')](_0x2b2234[_0x8f29('0x4b')],{'$or':_[_0x8f29('0x3b')](_0x2b2234[_0x8f29('0x44')],function(_0x505f33){var _0x4b66e1={};_0x4b66e1[_0x505f33]={'$like':'%'+_0x599cad[_0x8f29('0x40')][_0x8f29('0x4e')]+'%'};return _0x4b66e1;})});}_0x2b2234=_[_0x8f29('0x4f')]({},_0x2b2234,_0x599cad[_0x8f29('0x51')]);return _0x28f9e9[_0x8f29('0x12b')](_0x2b2234);}})['then'](function(_0x31043e){if(_0x31043e){_0x57b069=_0x31043e[_0x8f29('0x46')];if(!_0x599cad[_0x8f29('0x40')][_0x8f29('0x47')](_0x8f29('0x48'))){_0x2b2234[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x599cad[_0x8f29('0x40')][_0x8f29('0x30')]);_0x2b2234[_0x8f29('0x2e')]=qs[_0x8f29('0x2e')](_0x599cad[_0x8f29('0x40')][_0x8f29('0x2e')]);}return _0x28f9e9[_0x8f29('0x12b')](_0x2b2234);}})[_0x8f29('0x22')](function(_0x3966d6){if(_0x3966d6){return _0x3966d6?{'count':_0x57b069,'rows':_0x3966d6}:null;}})[_0x8f29('0x22')](respondWithResult(_0x6f9804,null))[_0x8f29('0x53')](handleError(_0x6f9804,null));}; \ No newline at end of file +var _0xc25a=['download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','from','ValidationError','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','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','browser','format','version','unknown','%s\x20%s','device','vendor','stringify','threadId','externalUrl','interaction','ChatInteraction','spread','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','CompanyId','mapKeyOffline','includes','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','mimetype','server','files','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','SendMail','forwardOfflineAddress','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getLicense','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','x-real-ip','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','include','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','end','status','offset','undefined','limit','count','set','reject','save','update','destroy','UserProfileResource','sendStatus','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','show','params','keys','fields','length','includeAll','find','create','body','user','get','role','ChatWebsites','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','root'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0xc25a,0x1dc));var _0xac25=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xc25a[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xac25('0x0'));var rimraf=require(_0xac25('0x1'));var zipdir=require(_0xac25('0x2'));var jsonpatch=require(_0xac25('0x3'));var rp=require('request-promise');var moment=require(_0xac25('0x4'));var BPromise=require(_0xac25('0x5'));var Mustache=require('mustache');var util=require(_0xac25('0x6'));var path=require(_0xac25('0x7'));var sox=require(_0xac25('0x8'));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(_0xac25('0x9'));var crypto=require(_0xac25('0xa'));var jsforce=require(_0xac25('0xb'));var deskjs=require(_0xac25('0xc'));var toCsv=require('to-csv');var querystring=require(_0xac25('0xd'));var Papa=require(_0xac25('0xe'));var Redis=require(_0xac25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xac25('0x10'));var as=require(_0xac25('0x11'));var hardwareService=require(_0xac25('0x12'));var logger=require(_0xac25('0x13'))('api');var utils=require(_0xac25('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac25('0x15'));var db=require(_0xac25('0x16'))['db'];config[_0xac25('0x17')]=_['defaults'](config[_0xac25('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xac25('0x18'))(new Redis(config[_0xac25('0x17')]));require(_0xac25('0x19'))[_0xac25('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xac25('0x1b')][_0xac25('0x1c')]({'port':0x232c});var client9002=jayson[_0xac25('0x1b')][_0xac25('0x1c')]({'port':0x232a});var client9003=jayson[_0xac25('0x1b')]['http']({'port':0x232b});var client9001=jayson[_0xac25('0x1b')][_0xac25('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x2acea9,_0x4fbd8f,_0x513064,_0x597533){return new BPromise(function(_0x5627be,_0x4e83f3){var _0x534401=_0x597533||client;return _0x534401[_0xac25('0x1d')](_0x2acea9,_0x513064)[_0xac25('0x1e')](function(_0x26284f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4fbd8f,_0xac25('0x1f'));logger[_0xac25('0x20')](_0xac25('0x21'),_0x4fbd8f,'request\x20sent',JSON['stringify'](_0x26284f));if(_0x26284f[_0xac25('0x22')]){if(_0x26284f['error'][_0xac25('0x23')]===0x1f4){logger['error'](_0xac25('0x24'),_0x4fbd8f,_0x26284f[_0xac25('0x22')][_0xac25('0x25')]);return _0x4e83f3(_0x26284f[_0xac25('0x22')][_0xac25('0x25')]);}logger[_0xac25('0x22')](_0xac25('0x24'),_0x4fbd8f,_0x26284f['error'][_0xac25('0x25')]);return _0x5627be(_0x26284f['error'][_0xac25('0x25')]);}else{logger[_0xac25('0x26')](_0xac25('0x24'),_0x4fbd8f,'request\x20sent');_0x5627be(_0x26284f[_0xac25('0x27')][_0xac25('0x25')]);}})['catch'](function(_0x266f91){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4fbd8f,_0x266f91);_0x4e83f3(_0x266f91);});});}function respondWithStatusCode(_0x1516d6,_0x2cbe56){_0x2cbe56=_0x2cbe56||0xcc;return function(_0x3155e9){if(_0x3155e9){return _0x1516d6['sendStatus'](_0x2cbe56);}return _0x1516d6['status'](_0x2cbe56)[_0xac25('0x28')]();};}function respondWithResult(_0x5aa842,_0x3b496a){_0x3b496a=_0x3b496a||0xc8;return function(_0x48b37c){if(_0x48b37c){return _0x5aa842[_0xac25('0x29')](_0x3b496a)['json'](_0x48b37c);}};}function respondWithFilteredResult(_0xb3e760,_0x54585d){return function(_0x46e301){if(_0x46e301){var _0x79d67=typeof _0x54585d[_0xac25('0x2a')]===_0xac25('0x2b')&&typeof _0x54585d[_0xac25('0x2c')]===_0xac25('0x2b');var _0x145c64=_0x46e301[_0xac25('0x2d')];var _0x130278=_0x79d67?0x0:_0x54585d['offset'];var _0x315c58=_0x79d67?_0x46e301[_0xac25('0x2d')]:_0x54585d[_0xac25('0x2a')]+_0x54585d[_0xac25('0x2c')];var _0x312bd6;if(_0x315c58>=_0x145c64){_0x315c58=_0x145c64;_0x312bd6=0xc8;}else{_0x312bd6=0xce;}_0xb3e760[_0xac25('0x29')](_0x312bd6);return _0xb3e760[_0xac25('0x2e')]('Content-Range',_0x130278+'-'+_0x315c58+'/'+_0x145c64)['json'](_0x46e301);}return null;};}function patchUpdates(_0x428ce5){return function(_0x4e628f){try{jsonpatch['apply'](_0x4e628f,_0x428ce5,!![]);}catch(_0x383702){return BPromise[_0xac25('0x2f')](_0x383702);}return _0x4e628f[_0xac25('0x30')]();};}function saveUpdates(_0x4ced67,_0xd98451){return function(_0x26f616){if(_0x26f616){return _0x26f616[_0xac25('0x31')](_0x4ced67)[_0xac25('0x1e')](function(_0x2ad89d){return _0x2ad89d;});}return null;};}function removeEntity(_0x53e22a,_0xd426b8){return function(_0x4eb05a){if(_0x4eb05a){return _0x4eb05a[_0xac25('0x32')]()[_0xac25('0x1e')](function(){var _0x1dd46e=_0x4eb05a['get']({'plain':!![]});var _0x15f8c6='ChatWebsites';return db[_0xac25('0x33')][_0xac25('0x32')]({'where':{'type':_0x15f8c6,'resourceId':_0x1dd46e['id']}})[_0xac25('0x1e')](function(){return _0x4eb05a;});})['then'](function(){_0x53e22a['status'](0xcc)[_0xac25('0x28')]();});}};}function handleEntityNotFound(_0x55e25b,_0x20dfc1){return function(_0x320c2c){if(!_0x320c2c){_0x55e25b[_0xac25('0x34')](0x194);}return _0x320c2c;};}function handleError(_0x3e68f3,_0x1612e6){_0x1612e6=_0x1612e6||0x1f4;return function(_0x4ce42c){logger[_0xac25('0x22')](_0x4ce42c['stack']);if(_0x4ce42c['name']){delete _0x4ce42c[_0xac25('0x35')];}_0x3e68f3['status'](_0x1612e6)[_0xac25('0x36')](_0x4ce42c);};}exports['index']=function(_0x4fde2,_0x417733){var _0x2bc240={'include':[{'model':db[_0xac25('0x37')],'as':_0xac25('0x38')}]},_0x6a3492={},_0x51d015={'count':0x0,'rows':[]};var _0x572e04=_[_0xac25('0x39')](db[_0xac25('0x3a')][_0xac25('0x3b')],function(_0x4a0b13){return{'name':_0x4a0b13[_0xac25('0x3c')],'type':_0x4a0b13[_0xac25('0x3d')]['key']};});_0x6a3492[_0xac25('0x3e')]=_[_0xac25('0x39')](_0x572e04,_0xac25('0x35'));_0x6a3492[_0xac25('0x3f')]=_['keys'](_0x4fde2[_0xac25('0x3f')]);_0x6a3492['filters']=_[_0xac25('0x40')](_0x6a3492['model'],_0x6a3492[_0xac25('0x3f')]);_0x2bc240[_0xac25('0x41')]=_['intersection'](_0x6a3492[_0xac25('0x3e')],qs['fields'](_0x4fde2[_0xac25('0x3f')]['fields']));_0x2bc240[_0xac25('0x41')]=_0x2bc240[_0xac25('0x41')]['length']?_0x2bc240[_0xac25('0x41')]:_0x6a3492[_0xac25('0x3e')];if(!_0x4fde2[_0xac25('0x3f')][_0xac25('0x42')](_0xac25('0x43'))){_0x2bc240[_0xac25('0x2c')]=qs['limit'](_0x4fde2[_0xac25('0x3f')][_0xac25('0x2c')]);_0x2bc240[_0xac25('0x2a')]=qs[_0xac25('0x2a')](_0x4fde2['query'][_0xac25('0x2a')]);}_0x2bc240[_0xac25('0x44')]=qs[_0xac25('0x45')](_0x4fde2[_0xac25('0x3f')][_0xac25('0x45')]);_0x2bc240[_0xac25('0x46')]=qs[_0xac25('0x47')](_[_0xac25('0x48')](_0x4fde2[_0xac25('0x3f')],_0x6a3492['filters']),_0x572e04);if(_0x4fde2['query'][_0xac25('0x49')]){_0x2bc240[_0xac25('0x46')]=_[_0xac25('0x4a')](_0x2bc240[_0xac25('0x46')],{'$or':_[_0xac25('0x39')](_0x572e04,function(_0x4478bb){if(_0x4478bb[_0xac25('0x3d')]!==_0xac25('0x4b')){var _0x4720b0={};_0x4720b0[_0x4478bb[_0xac25('0x35')]]={'$like':'%'+_0x4fde2[_0xac25('0x3f')][_0xac25('0x49')]+'%'};return _0x4720b0;}})});}_0x2bc240=_[_0xac25('0x4a')]({},_0x2bc240,_0x4fde2[_0xac25('0x4c')]);var _0x2c2f77={'where':_0x2bc240['where']};return db[_0xac25('0x3a')]['count'](_0x2c2f77)[_0xac25('0x1e')](function(_0x48a575){_0x51d015[_0xac25('0x2d')]=_0x48a575;if(_0x4fde2['query']['includeAll']){_0x2bc240['include']=[{'all':!![]}];}return db[_0xac25('0x3a')][_0xac25('0x4d')](_0x2bc240);})[_0xac25('0x1e')](function(_0x363611){_0x51d015['rows']=_0x363611;return _0x51d015;})[_0xac25('0x1e')](respondWithFilteredResult(_0x417733,_0x2bc240))['catch'](handleError(_0x417733,null));};exports[_0xac25('0x4e')]=function(_0x4052e1,_0x5c79ab){var _0x21699d={'raw':![],'where':{'id':_0x4052e1[_0xac25('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0xac25('0x38')}]},_0x27ff9e={};_0x27ff9e[_0xac25('0x3e')]=_[_0xac25('0x50')](db['ChatWebsite'][_0xac25('0x3b')]);_0x27ff9e[_0xac25('0x3f')]=_['keys'](_0x4052e1[_0xac25('0x3f')]);_0x27ff9e['filters']=_[_0xac25('0x40')](_0x27ff9e['model'],_0x27ff9e[_0xac25('0x3f')]);_0x21699d['attributes']=_[_0xac25('0x40')](_0x27ff9e[_0xac25('0x3e')],qs[_0xac25('0x51')](_0x4052e1[_0xac25('0x3f')]['fields']));_0x21699d[_0xac25('0x41')]=_0x21699d[_0xac25('0x41')][_0xac25('0x52')]?_0x21699d['attributes']:_0x27ff9e['model'];if(_0x4052e1['query'][_0xac25('0x53')]){_0x21699d['include']=[{'all':!![]}];}_0x21699d=_['merge']({},_0x21699d,_0x4052e1[_0xac25('0x4c')]);return db['ChatWebsite'][_0xac25('0x54')](_0x21699d)['then'](handleEntityNotFound(_0x5c79ab,null))[_0xac25('0x1e')](respondWithResult(_0x5c79ab,null))['catch'](handleError(_0x5c79ab,null));};exports[_0xac25('0x55')]=function(_0x1c9336,_0x529b9e){return db[_0xac25('0x3a')][_0xac25('0x55')](_0x1c9336[_0xac25('0x56')],{})[_0xac25('0x1e')](function(_0x4a7a3c){var _0x2b8670=_0x1c9336[_0xac25('0x57')][_0xac25('0x58')]({'plain':!![]});if(!_0x2b8670)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b8670[_0xac25('0x59')]===_0xac25('0x57')){var _0x5d3587=_0x4a7a3c[_0xac25('0x58')]({'plain':!![]});var _0x3cc11f=_0xac25('0x5a');return db['UserProfileSection']['find']({'where':{'name':_0x3cc11f,'userProfileId':_0x2b8670[_0xac25('0x5b')]},'raw':!![]})[_0xac25('0x1e')](function(_0xe27e13){if(_0xe27e13&&_0xe27e13['autoAssociation']===0x0){return db[_0xac25('0x33')][_0xac25('0x55')]({'name':_0x5d3587[_0xac25('0x35')],'resourceId':_0x5d3587['id'],'type':_0xe27e13[_0xac25('0x35')],'sectionId':_0xe27e13['id']},{})[_0xac25('0x1e')](function(){return _0x4a7a3c;});}else{return _0x4a7a3c;}})['catch'](function(_0x364c04){logger['error'](_0xac25('0x5c'),_0x364c04);throw _0x364c04;});}return _0x4a7a3c;})['then'](respondWithResult(_0x529b9e,0xc9))[_0xac25('0x5d')](handleError(_0x529b9e,null));};exports[_0xac25('0x31')]=function(_0x426b51,_0x2f2bfc){if(_0x426b51['body']['id']){delete _0x426b51[_0xac25('0x56')]['id'];}return db['ChatWebsite'][_0xac25('0x54')]({'where':{'id':_0x426b51['params']['id']},'include':[{'model':db[_0xac25('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2f2bfc,null))['then'](saveUpdates(_0x426b51[_0xac25('0x56')],null))[_0xac25('0x1e')](respondWithResult(_0x2f2bfc,null))[_0xac25('0x5d')](handleError(_0x2f2bfc,null));};exports['destroy']=function(_0x251d6f,_0x241b63){return db['ChatWebsite']['find']({'where':{'id':_0x251d6f[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x241b63,null))[_0xac25('0x1e')](removeEntity(_0x241b63,null))['catch'](handleError(_0x241b63,null));};exports[_0xac25('0x5e')]=function(_0x18602d,_0x368b7){return db[_0xac25('0x3a')][_0xac25('0x5e')]()[_0xac25('0x1e')](respondWithResult(_0x368b7,null))[_0xac25('0x5d')](handleError(_0x368b7,null));};exports[_0xac25('0x5f')]=function(_0x107b8b,_0x4459f3,_0x286ccd){if(_0x107b8b[_0xac25('0x56')]['id']){delete _0x107b8b[_0xac25('0x56')]['id'];}return db['ChatWebsite'][_0xac25('0x54')]({'where':{'id':_0x107b8b[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x4459f3,null))[_0xac25('0x1e')](function(_0x12d37e){if(_0x12d37e){_0x107b8b['body'][_0xac25('0x60')]=_0x12d37e['id'];return db[_0xac25('0x61')]['create'](_0x107b8b[_0xac25('0x56')]);}})['then'](respondWithResult(_0x4459f3,null))[_0xac25('0x5d')](handleError(_0x4459f3,null));};exports[_0xac25('0x62')]=function(_0x32c03c,_0x167a0e,_0x2b5b59){var _0x574f4e={'raw':![],'where':{}};var _0x4e29a3={};var _0x16339a={'count':0x0,'rows':[]};return db[_0xac25('0x3a')][_0xac25('0x63')]({'where':{'id':_0x32c03c[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x167a0e,null))[_0xac25('0x1e')](function(_0x328f0a){if(_0x328f0a){_0x4e29a3[_0xac25('0x3e')]=_['keys'](db['Disposition']['rawAttributes']);_0x4e29a3['query']=_[_0xac25('0x50')](_0x32c03c['query']);_0x4e29a3[_0xac25('0x47')]=_[_0xac25('0x40')](_0x4e29a3[_0xac25('0x3e')],_0x4e29a3[_0xac25('0x3f')]);_0x574f4e['attributes']=_[_0xac25('0x40')](_0x4e29a3['model'],qs[_0xac25('0x51')](_0x32c03c[_0xac25('0x3f')][_0xac25('0x51')]));_0x574f4e[_0xac25('0x41')]=_0x574f4e['attributes'][_0xac25('0x52')]?_0x574f4e['attributes']:_0x4e29a3[_0xac25('0x3e')];if(!_0x32c03c[_0xac25('0x3f')][_0xac25('0x42')](_0xac25('0x43'))){_0x574f4e[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x32c03c[_0xac25('0x3f')][_0xac25('0x2c')]);_0x574f4e[_0xac25('0x2a')]=qs[_0xac25('0x2a')](_0x32c03c[_0xac25('0x3f')][_0xac25('0x2a')]);}_0x574f4e['order']=qs['sort'](_0x32c03c[_0xac25('0x3f')][_0xac25('0x45')]);_0x574f4e[_0xac25('0x46')]=qs[_0xac25('0x47')](_[_0xac25('0x48')](_0x32c03c[_0xac25('0x3f')],_0x4e29a3[_0xac25('0x47')]));_0x574f4e['where'][_0xac25('0x60')]=_0x328f0a['id'];if(_0x32c03c[_0xac25('0x3f')][_0xac25('0x49')]){_0x574f4e[_0xac25('0x46')]=_[_0xac25('0x4a')](_0x574f4e[_0xac25('0x46')],{'$or':_['map'](_0x574f4e[_0xac25('0x41')],function(_0x4fb443){var _0x2216d={};_0x2216d[_0x4fb443]={'$like':'%'+_0x32c03c[_0xac25('0x3f')][_0xac25('0x49')]+'%'};return _0x2216d;})});}_0x574f4e=_['merge']({},_0x574f4e,_0x32c03c['options']);return db['Disposition'][_0xac25('0x2d')]({'where':_0x574f4e[_0xac25('0x46')]})[_0xac25('0x1e')](function(_0x487ea6){_0x16339a[_0xac25('0x2d')]=_0x487ea6;if(_0x32c03c[_0xac25('0x3f')][_0xac25('0x53')]){_0x574f4e['include']=[{'all':!![]}];}return db[_0xac25('0x61')][_0xac25('0x4d')](_0x574f4e);})['then'](function(_0xee010e){_0x16339a[_0xac25('0x64')]=_0xee010e;return _0x16339a;});}})[_0xac25('0x1e')](respondWithFilteredResult(_0x167a0e,_0x574f4e))[_0xac25('0x5d')](handleError(_0x167a0e,null));};exports[_0xac25('0x65')]=function(_0x80e045,_0x264e74,_0x3dadb4){return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x80e045['params']['id']}})['then'](handleEntityNotFound(_0x264e74,null))['then'](function(_0x17e197){if(_0x17e197){return _0x17e197[_0xac25('0x65')](_0x80e045[_0xac25('0x3f')][_0xac25('0x66')]);}})[_0xac25('0x1e')](respondWithStatusCode(_0x264e74,null))[_0xac25('0x5d')](handleError(_0x264e74,null));};exports[_0xac25('0x67')]=function(_0x3db6f5,_0xff4970,_0x2af722){if(_0x3db6f5[_0xac25('0x56')]['id']){delete _0x3db6f5['body']['id'];}return db['ChatWebsite'][_0xac25('0x54')]({'where':{'id':_0x3db6f5[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0xff4970,null))[_0xac25('0x1e')](function(_0x3b3660){if(_0x3b3660){_0x3db6f5['body']['ChatWebsiteId']=_0x3b3660['id'];return db[_0xac25('0x68')][_0xac25('0x55')](_0x3db6f5[_0xac25('0x56')]);}})[_0xac25('0x1e')](respondWithResult(_0xff4970,null))['catch'](handleError(_0xff4970,null));};exports[_0xac25('0x69')]=function(_0x225d3b,_0x4c2450,_0xff7cb0){var _0x47bb19={'raw':![],'where':{}};var _0x2dc550={};var _0x388584={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xac25('0x63')]({'where':{'id':_0x225d3b[_0xac25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4c2450,null))[_0xac25('0x1e')](function(_0x4f6eaa){if(_0x4f6eaa){_0x2dc550['model']=_[_0xac25('0x50')](db['CannedAnswer'][_0xac25('0x3b')]);_0x2dc550[_0xac25('0x3f')]=_[_0xac25('0x50')](_0x225d3b['query']);_0x2dc550['filters']=_[_0xac25('0x40')](_0x2dc550['model'],_0x2dc550[_0xac25('0x3f')]);_0x47bb19[_0xac25('0x41')]=_['intersection'](_0x2dc550['model'],qs['fields'](_0x225d3b[_0xac25('0x3f')][_0xac25('0x51')]));_0x47bb19['attributes']=_0x47bb19['attributes']['length']?_0x47bb19['attributes']:_0x2dc550[_0xac25('0x3e')];if(!_0x225d3b[_0xac25('0x3f')][_0xac25('0x42')]('nolimit')){_0x47bb19[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x225d3b[_0xac25('0x3f')][_0xac25('0x2c')]);_0x47bb19[_0xac25('0x2a')]=qs[_0xac25('0x2a')](_0x225d3b[_0xac25('0x3f')]['offset']);}_0x47bb19['order']=qs['sort'](_0x225d3b['query'][_0xac25('0x45')]);_0x47bb19[_0xac25('0x46')]=qs['filters'](_[_0xac25('0x48')](_0x225d3b[_0xac25('0x3f')],_0x2dc550[_0xac25('0x47')]));_0x47bb19[_0xac25('0x46')][_0xac25('0x60')]=_0x4f6eaa['id'];if(_0x225d3b[_0xac25('0x3f')][_0xac25('0x49')]){_0x47bb19[_0xac25('0x46')]=_[_0xac25('0x4a')](_0x47bb19[_0xac25('0x46')],{'$or':_[_0xac25('0x39')](_0x47bb19[_0xac25('0x41')],function(_0x1c2d2c){var _0x2f5a5b={};_0x2f5a5b[_0x1c2d2c]={'$like':'%'+_0x225d3b[_0xac25('0x3f')]['filter']+'%'};return _0x2f5a5b;})});}_0x47bb19=_[_0xac25('0x4a')]({},_0x47bb19,_0x225d3b[_0xac25('0x4c')]);return db['CannedAnswer'][_0xac25('0x2d')]({'where':_0x47bb19[_0xac25('0x46')]})[_0xac25('0x1e')](function(_0x1901f9){_0x388584[_0xac25('0x2d')]=_0x1901f9;if(_0x225d3b[_0xac25('0x3f')][_0xac25('0x53')]){_0x47bb19['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xac25('0x4d')](_0x47bb19);})['then'](function(_0x160f76){_0x388584[_0xac25('0x64')]=_0x160f76;return _0x388584;});}})[_0xac25('0x1e')](respondWithFilteredResult(_0x4c2450,_0x47bb19))[_0xac25('0x5d')](handleError(_0x4c2450,null));};exports['removeAnswers']=function(_0x5ef18a,_0x35836e,_0x3bc353){return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x5ef18a['params']['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x35836e,null))[_0xac25('0x1e')](function(_0x22ece3){if(_0x22ece3){return _0x22ece3[_0xac25('0x6a')](_0x5ef18a['query'][_0xac25('0x66')]);}})[_0xac25('0x1e')](respondWithStatusCode(_0x35836e,null))[_0xac25('0x5d')](handleError(_0x35836e,null));};exports['addLogo']=function(_0x18c191,_0x5785ed,_0x210f7d){_0x18c191[_0xac25('0x56')][_0xac25('0x6b')]=_0x18c191['file'][_0xac25('0x6c')];return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x18c191[_0xac25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5785ed,null))[_0xac25('0x1e')](saveUpdates(_0x18c191[_0xac25('0x56')],null))[_0xac25('0x1e')](respondWithResult(_0x5785ed,null))[_0xac25('0x5d')](handleError(_0x5785ed,null));};exports[_0xac25('0x6d')]=function(_0x53954b,_0xdb4d13,_0x119fe0){_0x53954b[_0xac25('0x56')][_0xac25('0x6e')]=_0x53954b[_0xac25('0x6f')]['filename'];return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x53954b[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0xdb4d13,null))[_0xac25('0x1e')](saveUpdates(_0x53954b[_0xac25('0x56')],null))[_0xac25('0x1e')](respondWithResult(_0xdb4d13,null))[_0xac25('0x5d')](handleError(_0xdb4d13,null));};exports['addCustomerAvatar']=function(_0x22783f,_0x1d85a7,_0x3584f7){_0x22783f[_0xac25('0x56')][_0xac25('0x70')]=_0x22783f[_0xac25('0x6f')][_0xac25('0x6c')];return db[_0xac25('0x3a')]['find']({'where':{'id':_0x22783f[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x1d85a7,null))['then'](saveUpdates(_0x22783f[_0xac25('0x56')],null))[_0xac25('0x1e')](respondWithResult(_0x1d85a7,null))['catch'](handleError(_0x1d85a7,null));};exports[_0xac25('0x71')]=function(_0x1505ac,_0x439c61,_0x1b2fbc){_0x1505ac['body'][_0xac25('0x72')]=_0x1505ac[_0xac25('0x6f')][_0xac25('0x6c')];return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x1505ac[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x439c61,null))[_0xac25('0x1e')](saveUpdates(_0x1505ac[_0xac25('0x56')],null))[_0xac25('0x1e')](respondWithResult(_0x439c61,null))[_0xac25('0x5d')](handleError(_0x439c61,null));};exports[_0xac25('0x73')]=function(_0x2755c2,_0x212071,_0x4001e8){var _0x1464b9=path[_0xac25('0x74')](config['root'],_0xac25('0x75'));var _0x48fd99={'where':{'id':_0x2755c2['params']['id']},'attributes':['id',_0xac25('0x6b')],'raw':!![]};var _0xb5a227=![];return require(_0xac25('0x15'))['getLicense']()['then'](function(_0xf0bb05){if(_0xf0bb05){_0xb5a227=_0xf0bb05[_0xac25('0x76')];}})[_0xac25('0x1e')](function(){return db['ChatWebsite']['find'](_0x48fd99);})['then'](handleEntityNotFound(_0x212071,null))[_0xac25('0x1e')](function(_0x4dfa71){if(_0x4dfa71){if(!_[_0xac25('0x77')](_0x4dfa71['sitepic'])){if(fs[_0xac25('0x78')](path[_0xac25('0x74')](config[_0xac25('0x79')],'server/files/images/logos/',_0x4dfa71[_0xac25('0x6b')]))&&_0xb5a227){_0x1464b9=path[_0xac25('0x74')](config[_0xac25('0x79')],'server/files/images/logos/',_0x4dfa71[_0xac25('0x6b')]);}}return _0x212071[_0xac25('0x7a')](_0x1464b9);}})[_0xac25('0x5d')](handleError(_0x212071,null));};exports[_0xac25('0x7b')]=function(_0x46652c,_0x55863f,_0x5b9df3){var _0x5a3101=path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0x7c'));var _0x2373af={'where':{'id':_0x46652c['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xac25('0x3a')][_0xac25('0x54')](_0x2373af)[_0xac25('0x1e')](handleEntityNotFound(_0x55863f,null))[_0xac25('0x1e')](function(_0x3cc65f){if(_0x3cc65f){if(!_[_0xac25('0x77')](_0x3cc65f[_0xac25('0x6e')])){if(fs['existsSync'](path[_0xac25('0x74')](config['root'],'server/files/images/avatars/',_0x3cc65f[_0xac25('0x6e')]))){_0x5a3101=path['join'](config[_0xac25('0x79')],_0xac25('0x7d'),_0x3cc65f['agentAvatar']);}}return _0x55863f[_0xac25('0x7a')](_0x5a3101);}})[_0xac25('0x5d')](handleError(_0x55863f,null));};exports[_0xac25('0x7e')]=function(_0x3036c6,_0x52b23c,_0x5e02e2){var _0x40432c=path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0x7f'));var _0x2f8021={'where':{'id':_0x3036c6['params']['id']},'attributes':['id',_0xac25('0x70'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x2f8021)['then'](handleEntityNotFound(_0x52b23c,null))[_0xac25('0x1e')](function(_0x1d0c24){if(_0x1d0c24){if(!_[_0xac25('0x77')](_0x1d0c24[_0xac25('0x70')])){if(fs[_0xac25('0x78')](path['join'](config[_0xac25('0x79')],_0xac25('0x7d'),_0x1d0c24[_0xac25('0x70')]))&&_0x1d0c24[_0xac25('0x80')]){_0x40432c=path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0x7d'),_0x1d0c24[_0xac25('0x70')]);}}return _0x52b23c[_0xac25('0x7a')](_0x40432c);}})[_0xac25('0x5d')](handleError(_0x52b23c,null));};exports['getSystemAvatar']=function(_0xb354cd,_0x139dfe,_0x3155fb){var _0x496017=path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0x81'));var _0x10346b={'where':{'id':_0xb354cd[_0xac25('0x4f')]['id']},'attributes':['id',_0xac25('0x72')],'raw':!![]};return db['ChatWebsite']['find'](_0x10346b)[_0xac25('0x1e')](handleEntityNotFound(_0x139dfe,null))[_0xac25('0x1e')](function(_0x2a4519){if(_0x2a4519){if(!_[_0xac25('0x77')](_0x2a4519[_0xac25('0x72')])){if(fs[_0xac25('0x78')](path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0x7d'),_0x2a4519[_0xac25('0x72')]))){_0x496017=path[_0xac25('0x74')](config[_0xac25('0x79')],'server/files/images/avatars/',_0x2a4519[_0xac25('0x72')]);}}return _0x139dfe[_0xac25('0x7a')](_0x496017);}})[_0xac25('0x5d')](handleError(_0x139dfe,null));};exports[_0xac25('0x82')]=function(_0x37d187,_0x2126db,_0x24cf3b){var _0x5d6e6=require(_0xac25('0x83'));var _0xb690=new _0x5d6e6();var _0x23cacd=_0xb690[_0xac25('0x84')](_0x37d187[_0xac25('0x85')][_0xac25('0x86')])[_0xac25('0x87')]();var _0x14dd2b={'body':_0x37d187[_0xac25('0x56')],'channel':'chat'};var _0x452408=[];var _0x598e98=[];var _0x26906f={};var _0x3840fd=![];return db['CmContact'][_0xac25('0x5e')]()['then'](function(_0x34e9ad){if(!_0x34e9ad){throw new db[(_0xac25('0x88'))]['ValidationError'](_0xac25('0x89'));}_0x452408=_[_0xac25('0x8a')](_[_0xac25('0x50')](_0x34e9ad),['createdAt',_0xac25('0x8b')]);_0x598e98=_[_0xac25('0x8a')](_[_0xac25('0x50')](_0x34e9ad),[_0xac25('0x8c'),_0xac25('0x8b'),'CompanyId','ListId']);if(_0x37d187[_0xac25('0x56')]['id']){delete _0x37d187['body']['id'];}if(_[_0xac25('0x77')](_0x37d187[_0xac25('0x56')][_0xac25('0x8d')])){throw new db[(_0xac25('0x88'))][(_0xac25('0x8e'))](_0xac25('0x8f'));}if(_[_0xac25('0x77')](_0x37d187[_0xac25('0x56')][_0xac25('0x56')])||_0x37d187[_0xac25('0x56')]['body']===''){throw new db[(_0xac25('0x88'))][(_0xac25('0x8e'))](_0xac25('0x90'));}if(_[_0xac25('0x77')](_0x37d187[_0xac25('0x56')][_0xac25('0x91')])){throw new db['Sequelize'][(_0xac25('0x8e'))](_0xac25('0x92')+_0x598e98);}if(!_['includes'](_0x598e98,_0x37d187[_0xac25('0x56')]['mapKey'])){throw new db[(_0xac25('0x88'))]['ValidationError'](_0xac25('0x93')+_0x598e98);}_0x26906f[_0x37d187[_0xac25('0x56')]['mapKey']]=_0x37d187['body'][_0xac25('0x8d')];})['then'](function(){return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x37d187[_0xac25('0x4f')]['id']},'include':[{'model':db[_0xac25('0x94')],'as':'List','include':[{'model':db[_0xac25('0x95')],'as':_0xac25('0x96'),'where':_0x26906f,'limit':0x1,'order':[[_0xac25('0x8b'),_0xac25('0x97')]]}]},{'model':db[_0xac25('0x98')],'as':_0xac25('0x99')}]});})[_0xac25('0x1e')](handleEntityNotFound(_0x2126db,null))[_0xac25('0x1e')](function(_0x108478){if(_0x108478&&_0x108478['List']){_0x14dd2b[_0xac25('0x9a')]=_0x108478;_0x14dd2b[_0xac25('0x9b')]=_0x108478['Applications'];_0x14dd2b[_0xac25('0x9c')]=_0x108478[_0xac25('0x9d')];_0x14dd2b['applications']=_[_0xac25('0x9e')](_0x14dd2b[_0xac25('0x9b')],['priority'],['asc']);if(_0x14dd2b[_0xac25('0x9a')][_0xac25('0x99')]){delete _0x14dd2b[_0xac25('0x9a')][_0xac25('0x99')];}if(_0x14dd2b[_0xac25('0x9a')]['List']&&_0x14dd2b['account'][_0xac25('0x9d')][_0xac25('0x96')][_0xac25('0x52')]){return _0x14dd2b['account'][_0xac25('0x9d')][_0xac25('0x96')][0x0];}var _0x10c926=_[_0xac25('0x9f')](_0x37d187[_0xac25('0x56')],{'firstName':_0x37d187[_0xac25('0x56')][_0xac25('0x8d')],'ListId':_0x108478['ListId']});_0x10c926[_0x37d187['body'][_0xac25('0x91')]]=_0x37d187[_0xac25('0x56')]['from'];return db['CmContact'][_0xac25('0x55')](_0x10c926,{'fields':_0x452408,'raw':!![]});}})['then'](handleEntityNotFound(_0x2126db,null))[_0xac25('0x1e')](function(_0x4aef48){_0x14dd2b[_0xac25('0xa0')]=_0x4aef48;var _0x2a955c=_0x37d187[_0xac25('0x56')][_0xac25('0xa1')];if(_0x37d187['headers'][_0xac25('0xa2')]){_0x2a955c=_0x37d187[_0xac25('0x85')][_0xac25('0xa2')];}else if(_0x37d187[_0xac25('0x85')][_0xac25('0xa3')]){_0x2a955c=_[_0xac25('0xa4')](_0x37d187[_0xac25('0x85')][_0xac25('0xa3')]['split'](','));}if(_0x4aef48){var _0x7cc5b4={'ContactId':_0x4aef48['id'],'ChatWebsiteId':_0x37d187[_0xac25('0x4f')]['id'],'from':(_0x4aef48[_0xac25('0xa5')]||'')+'\x20'+(_0x4aef48['lastName']||''),'customerIp':_0x2a955c,'customerPort':_0x37d187[_0xac25('0x85')][_0xac25('0xa6')]?_0x37d187[_0xac25('0x85')][_0xac25('0xa6')]:null,'referer':_0x37d187[_0xac25('0x56')]['referer'],'browserName':_0x23cacd[_0xac25('0xa7')][_0xac25('0x35')]&&_0x23cacd[_0xac25('0xa7')]['version']?util[_0xac25('0xa8')]('%s\x20%s',_0x23cacd[_0xac25('0xa7')]['name'],_0x23cacd[_0xac25('0xa7')][_0xac25('0xa9')]):_0xac25('0xaa'),'browserVersion':_0x23cacd[_0xac25('0xa7')][_0xac25('0xa9')]||_0xac25('0xaa'),'osName':util[_0xac25('0xa8')](_0xac25('0xab'),_0x23cacd['os'][_0xac25('0x35')],_0x23cacd['os'][_0xac25('0xa9')]),'osVersion':_0x23cacd['os'][_0xac25('0xa9')],'deviceModel':_0x23cacd[_0xac25('0xac')][_0xac25('0x3e')]&&_0x23cacd[_0xac25('0xac')][_0xac25('0xad')]?util['format']('%s\x20%s\x20%s',_0x23cacd[_0xac25('0xac')]['model'],_0x23cacd[_0xac25('0xac')][_0xac25('0xad')],_0x23cacd[_0xac25('0xac')][_0xac25('0x3d')]):null,'deviceVendor':_0x23cacd['device']['vendor'],'deviceType':_0x23cacd[_0xac25('0xac')][_0xac25('0x3d')],'formData':JSON[_0xac25('0xae')](_0x37d187[_0xac25('0x56')])};var _0x51aae9={'ChatWebsiteId':_0x37d187[_0xac25('0x4f')]['id'],'closed':![]};if(_0x37d187[_0xac25('0x56')][_0xac25('0xaf')]){_0x51aae9[_0xac25('0xaf')]=_0x37d187['body'][_0xac25('0xaf')];return db['ChatInteraction']['find']({'where':_0x51aae9})[_0xac25('0x1e')](function(_0x5f7e2a){if(_0x5f7e2a){return[_0x5f7e2a,![]];}_0x7cc5b4['threadId']=_0x37d187[_0xac25('0x56')]['threadId'];_0x7cc5b4['externalUrl']=_0x37d187['body'][_0xac25('0xb0')];return db['ChatInteraction'][_0xac25('0x55')](_0x7cc5b4)[_0xac25('0x1e')](function(_0x31a9b9){return[_0x31a9b9,!![]];});});}_0x51aae9['ContactId']=_0x4aef48['id'];if(_0x37d187[_0xac25('0x56')][_0xac25('0xb1')]&&_0x37d187[_0xac25('0x56')][_0xac25('0xb1')]['id']){_0x51aae9['id']=_0x37d187[_0xac25('0x56')][_0xac25('0xb1')]['id'];return db[_0xac25('0xb2')][_0xac25('0x54')]({'where':_0x51aae9})[_0xac25('0x1e')](function(_0x492e1f){if(_0x492e1f){return[_0x492e1f,![]];}return db[_0xac25('0xb2')]['create'](_0x7cc5b4)[_0xac25('0x1e')](function(_0x1f2fec){return[_0x1f2fec,!![]];});});}return db[_0xac25('0xb2')][_0xac25('0x55')](_0x7cc5b4)[_0xac25('0x1e')](function(_0x85f799){return[_0x85f799,!![]];});}})[_0xac25('0xb3')](function(_0x4084e8,_0x5eb104){if(_0x4084e8){_0x3840fd=_0x5eb104;if(!_0x5eb104){var _0x265ce9={'from':(_0x14dd2b[_0xac25('0xa0')]['firstName']||'')+'\x20'+(_0x14dd2b['contact'][_0xac25('0xb4')]||'')};if(_0x37d187[_0xac25('0x56')][_0xac25('0xaf')]&&_0x37d187['body'][_0xac25('0xb5')]&&_0x37d187[_0xac25('0x56')][_0xac25('0xaf')]!=_0x37d187[_0xac25('0x56')][_0xac25('0xb5')]){_0x265ce9[_0xac25('0xaf')]=_0x37d187[_0xac25('0x56')][_0xac25('0xb5')];}return _0x4084e8[_0xac25('0x31')](_0x265ce9);}else{return _0x4084e8;}}})['then'](function(_0x47b31a){_0x14dd2b[_0xac25('0xb1')]=_0x47b31a[_0xac25('0x58')]({'plain':!![]});_0x14dd2b[_0xac25('0xb1')][_0xac25('0xb6')]=_0x3840fd;if(_0x14dd2b[_0xac25('0xb1')][_0xac25('0xb6')]){if(_0x14dd2b['account'][_0xac25('0xb7')]){_0x14dd2b[_0xac25('0x9b')]['push']({'id':0x0,'priority':_0x14dd2b[_0xac25('0x9b')][_0xac25('0x52')]+0x1,'app':_0xac25('0xb8'),'appdata':_0xac25('0xb9'),'interval':_0xac25('0xba')});}}return db[_0xac25('0xbb')]['create']({'body':_0x37d187['body'][_0xac25('0x56')],'ChatWebsiteId':_0x37d187['params']['id'],'ChatInteractionId':_0x47b31a['id'],'direction':'in','ContactId':_0x14dd2b[_0xac25('0xa0')]['id'],'AttachmentId':_0x37d187[_0xac25('0x56')][_0xac25('0xbc')]});})[_0xac25('0x1e')](function(_0x4822b2){_0x14dd2b[_0xac25('0x25')]=_0x4822b2;if(_0x14dd2b['interaction'][_0xac25('0xbd')]){return db['User'][_0xac25('0x54')]({'attributes':['id',_0xac25('0x35')],'where':{'id':_0x14dd2b[_0xac25('0xb1')][_0xac25('0xbd')]}})[_0xac25('0x1e')](function(_0x4f3620){if(_0x4f3620){_0x14dd2b['applications'][_0xac25('0xbe')]({'id':0x0,'priority':0x0,'app':_0xac25('0xbf'),'appdata':_0x4f3620['name']+','+(_0x14dd2b[_0xac25('0x9a')][_0xac25('0xc0')]||0xa),'interval':'*,*,*,*'});_0x14dd2b[_0xac25('0xc1')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x14dd2b);});}return respondWithRpcPromise('Start',_0xac25('0xc2'),_0x14dd2b);})[_0xac25('0x1e')](function(_0x59896d){respondWithRpcPromise(_0xac25('0xc3'),_0xac25('0xc3'),{'event':_0xac25('0x82'),'message':_0x59896d},client9002);return _0x59896d;})[_0xac25('0x1e')](respondWithResult(_0x2126db,null))[_0xac25('0x5d')](handleError(_0x2126db,null));};exports['offline']=function(_0x3d9dae,_0x5696a8,_0x1315fb){var _0x1e315d,_0x41580f,_0x52603d;var _0xaccd5e=[];var _0x72b63b=[];var _0x2ef9f6={};var _0x12574e=_0x3d9dae['files']||[];var _0x44cbc6=[];var _0x5b9af0;return db[_0xac25('0x95')][_0xac25('0x5e')]()['then'](function(_0x103711){if(!_0x103711){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x72b63b=_[_0xac25('0x8a')](_[_0xac25('0x50')](_0x103711),[_0xac25('0x8c'),_0xac25('0x8b')]);_0xaccd5e=_[_0xac25('0x8a')](_[_0xac25('0x50')](_0x103711),['createdAt','updatedAt',_0xac25('0xc4'),'ListId']);if(_0x3d9dae['body']['id']){delete _0x3d9dae['body']['id'];}if(_[_0xac25('0x77')](_0x3d9dae[_0xac25('0x56')][_0xac25('0x8d')])){throw _0x5696a8[_0xac25('0x29')](0x1f4)[_0xac25('0x36')](new db[(_0xac25('0x88'))][(_0xac25('0x8e'))](_0xac25('0x8f')));}if(_['isNil'](_0x3d9dae[_0xac25('0x56')]['body'])||_0x3d9dae['body'][_0xac25('0x56')]===''){throw _0x5696a8[_0xac25('0x29')](0x1f4)[_0xac25('0x36')](new db['Sequelize'][(_0xac25('0x8e'))](_0xac25('0x90')));}if(_[_0xac25('0x77')](_0x3d9dae[_0xac25('0x56')][_0xac25('0xc5')])){throw _0x5696a8[_0xac25('0x29')](0x1f4)[_0xac25('0x36')](new db[(_0xac25('0x88'))][(_0xac25('0x8e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xaccd5e));}if(!_[_0xac25('0xc6')](_0xaccd5e,_0x3d9dae[_0xac25('0x56')][_0xac25('0xc5')])){throw _0x5696a8[_0xac25('0x29')](0x1f4)[_0xac25('0x36')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xaccd5e));}_0x2ef9f6[_0x3d9dae['body'][_0xac25('0xc5')]]=_0x3d9dae[_0xac25('0x56')]['from'];})[_0xac25('0x1e')](function(){return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x3d9dae[_0xac25('0x4f')]['id']},'include':[{'model':db[_0xac25('0x94')],'as':_0xac25('0x9d')},{'model':db[_0xac25('0xc7')],'as':_0xac25('0xc7')}]});})['then'](handleEntityNotFound(_0x5696a8,null))['then'](function(_0x1e7c6b){if(_0x1e7c6b&&_0x1e7c6b[_0xac25('0x9d')]){_0x41580f=_0x1e7c6b;var _0x541186=_[_0xac25('0x9f')](_0x3d9dae[_0xac25('0x56')],{'firstName':_0x3d9dae[_0xac25('0x56')]['from'],'phone':_0x3d9dae[_0xac25('0x56')][_0xac25('0x8d')],'ListId':_0x1e7c6b[_0xac25('0xc8')]});_0x541186[_0x3d9dae[_0xac25('0x56')][_0xac25('0xc5')]]=_0x3d9dae[_0xac25('0x56')]['from'];return db[_0xac25('0x95')][_0xac25('0xc9')]({'where':_0x2ef9f6,'defaults':_0x541186});}})[_0xac25('0xb3')](function(_0x396cc5){if(_0x396cc5){_0x52603d=_0x396cc5;var _0x58cb53=fs[_0xac25('0xca')](path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0xcb')),'utf8');var _0x388665=ejs[_0xac25('0xcc')](_0x58cb53,{'body':_[_0xac25('0xcd')](_0x3d9dae[_0xac25('0x56')][_0xac25('0x56')]),'bodyTitle':_0x41580f['offlineMessageBody']});return db[_0xac25('0xce')][_0xac25('0x55')]({'body':_0x388665,'ContactId':_0x396cc5['id'],'ChatWebsiteId':_0x41580f['id']});}})[_0xac25('0x1e')](function(_0x3c3421){_0x5b9af0=_0x3c3421;if(_0x12574e[_0xac25('0x52')]){var _0x789ce4=_0x12574e[_0xac25('0x39')](function(_0x15f58f){return{'name':_0x15f58f['originalname'],'basename':_0x15f58f[_0xac25('0x6c')],'type':_0x15f58f[_0xac25('0xcf')],'ChatOfflineMessageId':_0x3c3421['id']};});_0x44cbc6=_0x789ce4[_0xac25('0x39')](_0x40d44f=>{var _0x298e75={'filename':_0x40d44f[_0xac25('0x35')],'path':path[_0xac25('0x74')](config[_0xac25('0x79')],_0xac25('0xd0'),_0xac25('0xd1'),'attachments',_0xac25('0xd2'),_0x40d44f['basename'])};return _0x298e75;});if(!_0x41580f[_0xac25('0xd3')]){return db[_0xac25('0xd4')][_0xac25('0xd5')](function(_0x6521a1){return db[_0xac25('0xd6')][_0xac25('0xd7')](_0x789ce4,{'transaction':_0x6521a1});});}}})['then'](function(){if(_0x5b9af0){_0x1e315d=_0x5b9af0;return db['MailAccount'][_0xac25('0x63')]({'where':{'active':!![]},'include':[{'model':db[_0xac25('0xd8')],'as':_0xac25('0xd9'),'raw':!![]}]});}})[_0xac25('0x1e')](function(_0x2549ed){if(_0x2549ed&&_0x2549ed[_0xac25('0xd9')]&&_0x41580f[_0xac25('0xda')]&&_0x41580f['forwardOfflineAddress']){var _0x16ad4b={'tls':{'rejectUnauthorized':![]}};if(_0x2549ed['Smtp'][_0xac25('0xdb')]){_0x16ad4b[_0xac25('0xdb')]=_0x2549ed[_0xac25('0xd9')]['service'];}else{_0x16ad4b['host']=_0x2549ed[_0xac25('0xd9')][_0xac25('0xdc')];_0x16ad4b[_0xac25('0xdd')]=_0x2549ed[_0xac25('0xd9')][_0xac25('0xdd')];_0x16ad4b[_0xac25('0xde')]=_0x2549ed[_0xac25('0xd9')]['secure'];}if(_0x2549ed[_0xac25('0xd9')]['authentication']){_0x16ad4b['auth']={'user':_0x2549ed[_0xac25('0xd9')][_0xac25('0x57')],'pass':_0x2549ed[_0xac25('0xd9')]['pass']};}return respondWithRpcPromise(_0xac25('0xdf'),'sendMail',{'account':_0x16ad4b,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2549ed['name'],_0x2549ed['email']||_0x2549ed[_0xac25('0xd9')][_0xac25('0x57')]),'to':_0x41580f[_0xac25('0xe0')],'subject':_0x41580f['offlineMessageSubject'],'html':_0x1e315d[_0xac25('0x56')],'attachments':_0x44cbc6}},client9003)['then'](function(){return _0x1e315d;})['catch'](function(_0x5f1611){console['error'](_0x5f1611);});}})[_0xac25('0x1e')](function(){if(_0x41580f&&_0x41580f['openNewInteraction']&&_0x41580f[_0xac25('0xe1')]){var _0x3197ab=[];if(_0x12574e['length']){_0x3197ab=_0x12574e[_0xac25('0x39')](function(_0x510e8e){return{'name':_0x510e8e[_0xac25('0xe2')],'basename':_0x510e8e['filename'],'type':_0x510e8e[_0xac25('0xcf')],'ChatOfflineMessageId':_0x5b9af0['id']};});}var _0x317a19;if(!_[_0xac25('0x77')](_0x41580f[_0xac25('0xe3')])){var _0x34e27e=_[_0xac25('0x39')](_0x3d9dae[_0xac25('0x56')],function(_0x105257){return _0x105257;});var _0x1cd9a7=_[_0xac25('0xe4')](_0x34e27e)[0x0];var _0x37795f=_[_0xac25('0xe5')](_0x1cd9a7,function(_0x3c59e9){return _0x3c59e9;});_0x317a19=_0x37795f[0x1][_0x41580f[_0xac25('0xe3')]];}var _0x566209={'from':_0x52603d[_0xac25('0xe6')],'firstName':_0x52603d[_0xac25('0xa5')],'lastName':_0x52603d['lastName'],'mapKey':_0xac25('0xe6'),'message':{'from':_0x52603d['email'],'to':_0x41580f[_0xac25('0xc7')][_0xac25('0xe6')],'cc':'','subject':_[_0xac25('0x77')](_0x317a19)?_0x41580f[_0xac25('0xe7')]:_0x317a19,'messageId':'','sentAt':new Date(),'attach':_0x3197ab[_0xac25('0x52')],'attachments':_0x3197ab,'originChannel':_0xac25('0xe8'),'ChatWebsiteId':_0x41580f['id'],'ChatOfflineMessageId':_0x1e315d['id'],'originTo':_0x41580f[_0xac25('0xc7')][_0xac25('0xe6')]},'body':_0x1e315d[_0xac25('0x56')]};var _0x1a4ef8={'account':{'id':_0x41580f[_0xac25('0xe1')]},'body':_0x566209,'log':_0xac25('0xe9')};return respondWithRpcPromise(_0xac25('0xe9'),_0xac25('0xea'),_0x1a4ef8,client9001)[_0xac25('0x1e')](function(){return _0x1e315d;})[_0xac25('0x5d')](function(_0x4fc8b0){console[_0xac25('0x22')](_0x4fc8b0);});}return;})[_0xac25('0x1e')](function(){if(_0x1e315d){return _0x1e315d;}})[_0xac25('0x1e')](respondWithResult(_0x5696a8,null))[_0xac25('0x5d')](function(_0x4d6aed){console[_0xac25('0x22')](_0xac25('0x5d'),_0x4d6aed);for(var _0xd48450 of _0x12574e){var _0x2f1d78=path[_0xac25('0x74')](config[_0xac25('0x79')],'server',_0xac25('0xd1'),_0xac25('0xeb'),_0xac25('0xd2'),_0xd48450[_0xac25('0x6c')]);fs_extra['remove'](_0x2f1d78)[_0xac25('0x5d')](function(_0x2f4479){console['error'](_0xac25('0xec'),_0x2f1d78,_0x2f4479);});}});};exports['addInteraction']=function(_0x2a965b,_0x2b28fc,_0x5830fd){return db[_0xac25('0xb2')][_0xac25('0x54')]({'where':{'id':_0x2a965b[_0xac25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b28fc,null))[_0xac25('0x1e')](function(_0x3a37ce){if(_0x3a37ce){return _0x3a37ce['addInteraction'](_0x2a965b[_0xac25('0x56')][_0xac25('0x66')],_[_0xac25('0xed')](_0x2a965b['body'],[_0xac25('0x66'),'id'])||{});}})[_0xac25('0x1e')](respondWithResult(_0x2b28fc,null))['catch'](handleError(_0x2b28fc,null));};exports[_0xac25('0xee')]=function(_0x21416f,_0x10ae4b,_0x28f533){var _0x584f08={'raw':![],'where':{}};var _0x28175b={};var _0x577d27={'count':0x0,'rows':[]};return db[_0xac25('0x3a')][_0xac25('0x63')]({'where':{'id':_0x21416f[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x10ae4b,null))[_0xac25('0x1e')](function(_0x3f5905){if(_0x3f5905){_0x28175b[_0xac25('0x3e')]=_['keys'](db[_0xac25('0xb2')][_0xac25('0x3b')]);_0x28175b['query']=_['keys'](_0x21416f[_0xac25('0x3f')]);_0x28175b[_0xac25('0x47')]=_[_0xac25('0x40')](_0x28175b[_0xac25('0x3e')],_0x28175b[_0xac25('0x3f')]);_0x584f08[_0xac25('0x41')]=_[_0xac25('0x40')](_0x28175b[_0xac25('0x3e')],qs[_0xac25('0x51')](_0x21416f[_0xac25('0x3f')][_0xac25('0x51')]));_0x584f08[_0xac25('0x41')]=_0x584f08[_0xac25('0x41')][_0xac25('0x52')]?_0x584f08[_0xac25('0x41')]:_0x28175b[_0xac25('0x3e')];if(!_0x21416f[_0xac25('0x3f')][_0xac25('0x42')]('nolimit')){_0x584f08[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x21416f[_0xac25('0x3f')][_0xac25('0x2c')]);_0x584f08['offset']=qs['offset'](_0x21416f[_0xac25('0x3f')][_0xac25('0x2a')]);}_0x584f08['order']=qs[_0xac25('0x45')](_0x21416f[_0xac25('0x3f')][_0xac25('0x45')]);_0x584f08['where']=qs[_0xac25('0x47')](_[_0xac25('0x48')](_0x21416f[_0xac25('0x3f')],_0x28175b[_0xac25('0x47')]));_0x584f08[_0xac25('0x46')][_0xac25('0x60')]=_0x3f5905['id'];if(_0x21416f['query'][_0xac25('0x49')]){_0x584f08[_0xac25('0x46')]=_[_0xac25('0x4a')](_0x584f08[_0xac25('0x46')],{'$or':_[_0xac25('0x39')](_0x584f08[_0xac25('0x41')],function(_0x144541){var _0x552d49={};_0x552d49[_0x144541]={'$like':'%'+_0x21416f[_0xac25('0x3f')][_0xac25('0x49')]+'%'};return _0x552d49;})});}_0x584f08=_[_0xac25('0x4a')]({},_0x584f08,_0x21416f['options']);return db[_0xac25('0xb2')][_0xac25('0x2d')]({'where':_0x584f08[_0xac25('0x46')]})['then'](function(_0x3ae15e){_0x577d27[_0xac25('0x2d')]=_0x3ae15e;if(_0x21416f[_0xac25('0x3f')]['includeAll']){_0x584f08['include']=[{'model':db[_0xac25('0x95')],'as':_0xac25('0xef'),'required':![]},{'model':db[_0xac25('0xf0')],'as':_0xac25('0xf1'),'attributes':[_0xac25('0x35'),'fullname',_0xac25('0xf2')],'required':![]},{'model':db[_0xac25('0xf3')],'as':_0xac25('0xf4'),'attributes':['id',_0xac25('0x35'),_0xac25('0xf5')],'where':_0x21416f[_0xac25('0x3f')][_0xac25('0xf6')]?{'id':_0x21416f[_0xac25('0x3f')][_0xac25('0xf6')]}:undefined,'required':_0x21416f[_0xac25('0x3f')]['tag']?!![]:![]}];}return db[_0xac25('0xb2')][_0xac25('0x4d')](_0x584f08);})[_0xac25('0x1e')](function(_0xd33707){_0x577d27['rows']=_0xd33707;return _0x577d27;});}})[_0xac25('0x1e')](respondWithFilteredResult(_0x10ae4b,_0x584f08))[_0xac25('0x5d')](handleError(_0x10ae4b,null));};function iftimePromise(_0x5c4f90,_0x98c3f){return respondWithRpcPromise(_0xac25('0xf7'),_0xac25('0xf8'),{'command':_0x98c3f[_0xac25('0xf9')]?util[_0xac25('0xa8')]('iftime\x20%s,%s',_0x5c4f90['interval'],_0x98c3f[_0xac25('0xf9')]):util['format'](_0xac25('0xfa'),_0x5c4f90[_0xac25('0xfb')])},client9002)[_0xac25('0x1e')](function(_0x205d53){var _0x4ce2ea=_0x205d53&&_0x205d53[_0xac25('0xfc')](_0xac25('0xfd'))>=0x0?!![]:![];logger[_0xac25('0x26')](_0xac25('0xfe'),_0x98c3f['id'],_0x5c4f90['id'],_0x5c4f90[_0xac25('0xfb')],_0x4ce2ea?'ONLINE':_0xac25('0xff'),_0x98c3f['timezone']?_0x98c3f[_0xac25('0xf9')]:'No\x20timezone');return _0x4ce2ea;})[_0xac25('0x5d')](function(_0x4ad8b0){logger[_0xac25('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x98c3f['id'],_0x5c4f90['id'],_0x5c4f90[_0xac25('0xfb')],util[_0xac25('0x100')](_0x4ad8b0,{'showHidden':![],'depth':null}),_0x98c3f[_0xac25('0xf9')]?_0x98c3f[_0xac25('0xf9')]:_0xac25('0x101'));return![];});}exports[_0xac25('0xf8')]=function(_0x59438c,_0x5c9550,_0x1819a8){var _0x4108bd=0x0;var _0x5d008d=0x0;var _0x23c968=![];var _0x29b1ef;var _0x15b743;return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x59438c[_0xac25('0x4f')]['id']},'include':[{'model':db[_0xac25('0x102')],'as':'Interval','include':[{'model':db[_0xac25('0x102')],'as':_0xac25('0x103'),'attributes':['id',_0xac25('0xfb')],'raw':!![]}]}]})[_0xac25('0x1e')](handleEntityNotFound(_0x5c9550,null))[_0xac25('0x1e')](function(_0x4c967f){if(_0x4c967f){_0x29b1ef=_0x4c967f;return _0x4c967f['getProactiveActions']({'raw':!![]});}})['then'](function(_0x4d26dd){if(_0x29b1ef){if(_0x4d26dd){_0x15b743=_0x4d26dd;}}return require(_0xac25('0x15'))[_0xac25('0x104')]();})['then'](function(_0x2fcde8){if(_0x2fcde8){_0x5d008d=_0x2fcde8['virtual'];_0x23c968=_0x2fcde8[_0xac25('0x76')];}})[_0xac25('0x1e')](function(){return db[_0xac25('0xb2')]['count']({'where':{'closed':![]}});})['then'](function(_0x11440e){_0x4108bd=_0x11440e;if(_0x5d008d&&_0x11440e>_0x5d008d){return db[_0xac25('0x105')][_0xac25('0x63')]({'where':{'id':0x1}})['then'](function(_0xb8134b){if(_0xb8134b){_0xb8134b['increment'](_0xac25('0x106'));}});}})[_0xac25('0x1e')](function(){if(_0x29b1ef[_0xac25('0x102')]&&_0x29b1ef['Interval'][_0xac25('0x103')]){var _0x361335=[];for(var _0x33a5a3=0x0;_0x33a5a3<_0x29b1ef[_0xac25('0x102')]['Intervals'][_0xac25('0x52')];_0x33a5a3++){var _0x34fa02=_0x29b1ef[_0xac25('0x102')][_0xac25('0x103')][_0x33a5a3][_0xac25('0x58')]({'plain':!![]});_0x361335[_0xac25('0x107')](iftimePromise(_0x34fa02,_0x29b1ef));}return BPromise[_0xac25('0x108')](_0x361335)[_0xac25('0x1e')](function(_0x2a9bce){return _[_0xac25('0x109')](_0x2a9bce);});}else{return!![];}})['then'](function(_0x714c86){var _0x5ebd77=fs[_0xac25('0xca')](path['join'](config['root'],_0xac25('0x10a')),'utf8');var _0x6e2abe={'remote':_0x29b1ef['remote'],'query':querystring['stringify'](_[_0xac25('0x4a')](_0x29b1ef[_0xac25('0x58')]({'plain':!![]}),{'customerIp':_0x59438c[_0xac25('0x85')][_0xac25('0xa3')]||_0x59438c[_0xac25('0x85')][_0xac25('0x10b')]||_0x59438c['connection']['remoteAddress']||_0x59438c['ip'],'referer':_0x59438c['headers']['referer'],'openedInteractions':_0x4108bd,'maxInteractions':_0x5d008d,'virtual':_0x23c968['virtual'],'online':_0x714c86,'custom':_0x23c968}))[_0xac25('0x10c')](/'/g,'\x5c\x27')};_0x5c9550['send'](ejs[_0xac25('0xcc')](Mustache[_0xac25('0xcc')](_0x5ebd77,_0x6e2abe),{'proactiveActions':_0x15b743,'alignment':_0x29b1ef[_0xac25('0x10d')],'verticalAlignment':_0x29b1ef[_0xac25('0x10e')],'div_color':_0x29b1ef['color'],'text_color':_0x29b1ef[_0xac25('0x10f')],'button_color':_0x29b1ef[_0xac25('0x110')],'background_color':_0x29b1ef[_0xac25('0x111')]}));})[_0xac25('0x5d')](handleError(_0x5c9550,null));};exports[_0xac25('0x112')]=function(_0x5ecb5e,_0xbdb451,_0xf753b8){return db['ChatWebsite'][_0xac25('0x63')]({'where':{'id':_0x5ecb5e[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0xbdb451,null))['then'](function(_0x1a9ab0){if(_0x1a9ab0){return db[_0xac25('0xd4')][_0xac25('0xd5')](function(_0x3f29d7){return db[_0xac25('0x98')][_0xac25('0x32')]({'where':{'ChatWebsiteId':_0x5ecb5e[_0xac25('0x4f')]['id']},'transaction':_0x3f29d7})[_0xac25('0x1e')](function(_0x57a7ea){var _0x128280=_['map'](_0x5ecb5e[_0xac25('0x56')],function(_0x453413){_0x453413[_0xac25('0x60')]=_0x5ecb5e['params']['id'];return _0x453413;});return db[_0xac25('0x98')][_0xac25('0xd7')](_0x128280,{'transaction':_0x3f29d7});});})[_0xac25('0x1e')](function(){return db[_0xac25('0x98')][_0xac25('0x113')]({'where':{'ChatWebsiteId':_0x5ecb5e[_0xac25('0x4f')]['id']},'order':_0xac25('0x114')});});}})[_0xac25('0x1e')](respondWithResult(_0xbdb451,null))[_0xac25('0x5d')](handleError(_0xbdb451,null));};exports[_0xac25('0x115')]=function(_0x41002e,_0x151d48,_0x40266a){var _0x1c79d7={};var _0x9d5290={};var _0x43f45a;var _0x27511d;return db['ChatWebsite'][_0xac25('0x63')]({'where':{'id':_0x41002e[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x151d48,null))[_0xac25('0x1e')](function(_0x27cecb){if(_0x27cecb){_0x43f45a=_0x27cecb;_0x9d5290[_0xac25('0x3e')]=_[_0xac25('0x50')](db['ChatApplication'][_0xac25('0x3b')]);_0x9d5290[_0xac25('0x3f')]=_[_0xac25('0x50')](_0x41002e[_0xac25('0x3f')]);_0x9d5290[_0xac25('0x47')]=_[_0xac25('0x40')](_0x9d5290['model'],_0x9d5290['query']);_0x1c79d7[_0xac25('0x41')]=_[_0xac25('0x40')](_0x9d5290['model'],qs[_0xac25('0x51')](_0x41002e[_0xac25('0x3f')][_0xac25('0x51')]));_0x1c79d7[_0xac25('0x41')]=_0x1c79d7[_0xac25('0x41')]['length']?_0x1c79d7['attributes']:_0x9d5290['model'];_0x1c79d7[_0xac25('0x44')]=qs[_0xac25('0x45')](_0x41002e[_0xac25('0x3f')][_0xac25('0x45')]);_0x1c79d7['where']=qs[_0xac25('0x47')](_[_0xac25('0x48')](_0x41002e[_0xac25('0x3f')],_0x9d5290[_0xac25('0x47')]));if(_0x41002e[_0xac25('0x3f')][_0xac25('0x49')]){_0x1c79d7[_0xac25('0x46')]=_[_0xac25('0x4a')](_0x1c79d7['where'],{'$or':_[_0xac25('0x39')](_0x1c79d7[_0xac25('0x41')],function(_0x2ecf67){var _0x5bbf0e={};_0x5bbf0e[_0x2ecf67]={'$like':'%'+_0x41002e['query'][_0xac25('0x49')]+'%'};return _0x5bbf0e;})});}_0x1c79d7=_[_0xac25('0x4a')]({},_0x1c79d7,_0x41002e[_0xac25('0x4c')]);return _0x43f45a[_0xac25('0x115')](_0x1c79d7);}})['then'](function(_0x2209fd){if(_0x2209fd){_0x27511d=_0x2209fd[_0xac25('0x52')];if(!_0x41002e[_0xac25('0x3f')][_0xac25('0x42')]('nolimit')){_0x1c79d7[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x41002e[_0xac25('0x3f')][_0xac25('0x2c')]);_0x1c79d7[_0xac25('0x2a')]=qs[_0xac25('0x2a')](_0x41002e[_0xac25('0x3f')][_0xac25('0x2a')]);}return _0x43f45a['getApplications'](_0x1c79d7);}})[_0xac25('0x1e')](function(_0x180335){if(_0x180335){return _0x180335?{'count':_0x27511d,'rows':_0x180335}:null;}})[_0xac25('0x1e')](respondWithResult(_0x151d48,null))[_0xac25('0x5d')](handleError(_0x151d48,null));};exports[_0xac25('0x116')]=function(_0x56b5c3,_0x2d6b6a,_0x590f02){return db[_0xac25('0x117')][_0xac25('0x54')]({'where':{'id':_0x56b5c3[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x2d6b6a,null))[_0xac25('0x1e')](function(_0xfdca7e){if(_0xfdca7e){return _0xfdca7e[_0xac25('0x116')](_0x56b5c3[_0xac25('0x56')]['ids'],_[_0xac25('0xed')](_0x56b5c3[_0xac25('0x56')],['ids','id'])||{});}})[_0xac25('0x1e')](respondWithResult(_0x2d6b6a,null))[_0xac25('0x5d')](handleError(_0x2d6b6a,null));};exports[_0xac25('0x118')]=function(_0x44d858,_0x217695,_0x2e959e){var _0x23cff6={};var _0x215436={};var _0xa157d8;var _0x284082;return db[_0xac25('0x3a')][_0xac25('0x63')]({'where':{'id':_0x44d858[_0xac25('0x4f')]['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x217695,null))[_0xac25('0x1e')](function(_0x41892e){if(_0x41892e){_0xa157d8=_0x41892e;_0x215436[_0xac25('0x3e')]=_[_0xac25('0x50')](db[_0xac25('0x119')]['rawAttributes']);_0x215436[_0xac25('0x3f')]=_[_0xac25('0x50')](_0x44d858['query']);_0x215436[_0xac25('0x47')]=_[_0xac25('0x40')](_0x215436[_0xac25('0x3e')],_0x215436[_0xac25('0x3f')]);_0x23cff6[_0xac25('0x41')]=_['intersection'](_0x215436[_0xac25('0x3e')],qs[_0xac25('0x51')](_0x44d858[_0xac25('0x3f')][_0xac25('0x51')]));_0x23cff6[_0xac25('0x41')]=_0x23cff6[_0xac25('0x41')]['length']?_0x23cff6[_0xac25('0x41')]:_0x215436['model'];_0x23cff6['order']=qs['sort'](_0x44d858[_0xac25('0x3f')][_0xac25('0x45')]);_0x23cff6['where']=qs['filters'](_[_0xac25('0x48')](_0x44d858[_0xac25('0x3f')],_0x215436[_0xac25('0x47')]));if(_0x44d858[_0xac25('0x3f')][_0xac25('0x49')]){_0x23cff6['where']=_[_0xac25('0x4a')](_0x23cff6[_0xac25('0x46')],{'$or':_[_0xac25('0x39')](_0x23cff6[_0xac25('0x41')],function(_0x1255ea){var _0x4462d3={};_0x4462d3[_0x1255ea]={'$like':'%'+_0x44d858[_0xac25('0x3f')][_0xac25('0x49')]+'%'};return _0x4462d3;})});}_0x23cff6=_['merge']({},_0x23cff6,_0x44d858['options']);return _0xa157d8[_0xac25('0x118')](_0x23cff6);}})[_0xac25('0x1e')](function(_0x1e1233){if(_0x1e1233){_0x284082=_0x1e1233[_0xac25('0x52')];if(!_0x44d858[_0xac25('0x3f')]['hasOwnProperty'](_0xac25('0x43'))){_0x23cff6[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x44d858[_0xac25('0x3f')][_0xac25('0x2c')]);_0x23cff6['offset']=qs[_0xac25('0x2a')](_0x44d858[_0xac25('0x3f')]['offset']);}return _0xa157d8['getProactiveActions'](_0x23cff6);}})[_0xac25('0x1e')](function(_0x4e7c34){if(_0x4e7c34){return _0x4e7c34?{'count':_0x284082,'rows':_0x4e7c34}:null;}})[_0xac25('0x1e')](respondWithResult(_0x217695,null))[_0xac25('0x5d')](handleError(_0x217695,null));};exports[_0xac25('0x11a')]=function(_0x299ab8,_0x910558,_0x46227e){var _0x484035=_0x299ab8['query'][_0xac25('0x11b')]===_0xac25('0x11c')?_0xac25('0x11d'):_0xac25('0x11e');return db['ChatWebsite'][_0xac25('0x54')]({'attributes':['id',_0x484035],'where':{'id':_0x299ab8[_0xac25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x910558,null))['then'](function(_0x56b492){if(_0x56b492){var _0x5112e9=_0x56b492[_0x484035];var _0x5dfd68=_0x5112e9&&_0x5112e9['items']?_0x5112e9[_0xac25('0x11f')]:[];_0x910558[_0xac25('0x36')]({'fromKey':_[_0xac25('0x77')](_0x5112e9['fromKey'])?undefined:_0x5112e9[_0xac25('0x120')],'count':_0x5dfd68[_0xac25('0x52')],'rows':_0x5dfd68});}})['catch'](handleError(_0x910558,null));};exports[_0xac25('0x121')]=function(_0x1538f3,_0x27f305,_0xa63a68){var _0x55ac85={'raw':![],'where':{}};var _0x3d7e3e={};var _0x148dcb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xac25('0x63')]({'where':{'id':_0x1538f3['params']['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x27f305,null))[_0xac25('0x1e')](function(_0x552d6e){if(_0x552d6e){_0x3d7e3e[_0xac25('0x3e')]=_[_0xac25('0x50')](db[_0xac25('0xce')][_0xac25('0x3b')]);_0x3d7e3e[_0xac25('0x3f')]=_['keys'](_0x1538f3['query']);_0x3d7e3e[_0xac25('0x47')]=_[_0xac25('0x40')](_0x3d7e3e[_0xac25('0x3e')],_0x3d7e3e[_0xac25('0x3f')]);_0x55ac85[_0xac25('0x41')]=_[_0xac25('0x40')](_0x3d7e3e['model'],qs[_0xac25('0x51')](_0x1538f3[_0xac25('0x3f')]['fields']));_0x55ac85['attributes']=_0x55ac85['attributes']['length']?_0x55ac85[_0xac25('0x41')]:_0x3d7e3e['model'];if(!_0x1538f3[_0xac25('0x3f')]['hasOwnProperty'](_0xac25('0x43'))){_0x55ac85[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x1538f3[_0xac25('0x3f')][_0xac25('0x2c')]);_0x55ac85[_0xac25('0x2a')]=qs['offset'](_0x1538f3[_0xac25('0x3f')][_0xac25('0x2a')]);}_0x55ac85['order']=qs[_0xac25('0x45')](_0x1538f3[_0xac25('0x3f')][_0xac25('0x45')]);_0x55ac85[_0xac25('0x46')]=qs[_0xac25('0x47')](_['pick'](_0x1538f3[_0xac25('0x3f')],_0x3d7e3e[_0xac25('0x47')]));_0x55ac85[_0xac25('0x46')][_0xac25('0x60')]=_0x552d6e['id'];if(_0x1538f3[_0xac25('0x3f')][_0xac25('0x49')]){_0x55ac85[_0xac25('0x46')]=_['merge'](_0x55ac85[_0xac25('0x46')],{'$or':_['map'](_0x55ac85['attributes'],function(_0x31f610){var _0x275d13={};_0x275d13[_0x31f610]={'$like':'%'+_0x1538f3['query'][_0xac25('0x49')]+'%'};return _0x275d13;})});}_0x55ac85=_[_0xac25('0x4a')]({},_0x55ac85,_0x1538f3['options']);return db[_0xac25('0xce')][_0xac25('0x2d')]({'where':_0x55ac85[_0xac25('0x46')]})[_0xac25('0x1e')](function(_0x557c68){_0x148dcb['count']=_0x557c68;if(_0x1538f3[_0xac25('0x3f')][_0xac25('0x53')]){_0x55ac85[_0xac25('0x122')]=[{'all':!![]}];}else{_0x55ac85[_0xac25('0x122')]=[{'model':db[_0xac25('0x95')],'as':_0xac25('0xef'),'required':![]},{'model':db[_0xac25('0xd6')],'as':_0xac25('0x123'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x55ac85);})[_0xac25('0x1e')](function(_0x3e2515){_0x148dcb[_0xac25('0x64')]=_0x3e2515;return _0x148dcb;});}})[_0xac25('0x1e')](respondWithFilteredResult(_0x27f305,_0x55ac85))['catch'](handleError(_0x27f305,null));};exports[_0xac25('0x124')]=function(_0x1dd164,_0x117052,_0x5827b8){return db[_0xac25('0x3a')][_0xac25('0x54')]({'where':{'id':_0x1dd164['params']['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x117052,null))['then'](function(_0x37adc3){if(_0x37adc3){return _0x37adc3[_0xac25('0x124')](_0x1dd164[_0xac25('0x56')][_0xac25('0x66')],_[_0xac25('0xed')](_0x1dd164[_0xac25('0x56')],[_0xac25('0x66'),'id'])||{})[_0xac25('0xb3')](function(_0x5dd035){for(var _0x466109=0x0;_0x466109<_0x1dd164['body']['ids']['length'];_0x466109+=0x1){socket[_0xac25('0x125')](_0xac25('0x126'),{'UserId':Number(_0x1dd164[_0xac25('0x56')][_0xac25('0x66')][_0x466109]),'ChatWebsiteId':Number(_0x1dd164['params']['id'])});}return _0x5dd035;});}})[_0xac25('0x1e')](respondWithResult(_0x117052,null))[_0xac25('0x5d')](handleError(_0x117052,null));};exports[_0xac25('0x127')]=function(_0x45c5d3,_0x6d6469,_0x11e451){return db['ChatWebsite']['find']({'where':{'id':_0x45c5d3['params']['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x6d6469,null))[_0xac25('0x1e')](function(_0x37c895){if(_0x37c895){return _0x37c895['removeAgents'](_0x45c5d3['query'][_0xac25('0x66')])[_0xac25('0x1e')](function(){if(_[_0xac25('0x128')](_0x45c5d3[_0xac25('0x3f')][_0xac25('0x66')])){for(var _0x1498b4=0x0;_0x1498b4<_0x45c5d3[_0xac25('0x3f')][_0xac25('0x66')][_0xac25('0x52')];_0x1498b4+=0x1){socket[_0xac25('0x125')](_0xac25('0x129'),{'UserId':Number(_0x45c5d3[_0xac25('0x3f')][_0xac25('0x66')][_0x1498b4]),'ChatWebsiteId':Number(_0x45c5d3[_0xac25('0x4f')]['id'])});}}else{socket['emit'](_0xac25('0x129'),{'UserId':Number(_0x45c5d3[_0xac25('0x3f')]['ids']),'ChatWebsiteId':Number(_0x45c5d3['params']['id'])});}});}})[_0xac25('0x1e')](respondWithStatusCode(_0x6d6469,null))[_0xac25('0x5d')](handleError(_0x6d6469,null));};exports[_0xac25('0x12a')]=function(_0x3901b4,_0x2b547e,_0x140c78){var _0x465546={};var _0x132428={};var _0x375fb7;var _0x22b81b;return db[_0xac25('0x3a')]['findOne']({'where':{'id':_0x3901b4['params']['id']}})[_0xac25('0x1e')](handleEntityNotFound(_0x2b547e,null))[_0xac25('0x1e')](function(_0x33ed7a){if(_0x33ed7a){_0x375fb7=_0x33ed7a;_0x132428['model']=_[_0xac25('0x50')](db[_0xac25('0xf0')][_0xac25('0x3b')]);_0x132428['query']=_[_0xac25('0x50')](_0x3901b4[_0xac25('0x3f')]);_0x132428['filters']=_['intersection'](_0x132428[_0xac25('0x3e')],_0x132428['query']);_0x465546[_0xac25('0x41')]=_['intersection'](_0x132428[_0xac25('0x3e')],qs['fields'](_0x3901b4[_0xac25('0x3f')]['fields']));_0x465546[_0xac25('0x41')]=_0x465546['attributes'][_0xac25('0x52')]?_0x465546[_0xac25('0x41')]:_0x132428[_0xac25('0x3e')];_0x465546[_0xac25('0x44')]=qs[_0xac25('0x45')](_0x3901b4['query'][_0xac25('0x45')]);_0x465546[_0xac25('0x46')]=qs[_0xac25('0x47')](_['pick'](_0x3901b4['query'],_0x132428[_0xac25('0x47')]));if(_0x3901b4['query'][_0xac25('0x49')]){_0x465546[_0xac25('0x46')]=_['merge'](_0x465546[_0xac25('0x46')],{'$or':_['map'](_0x465546['attributes'],function(_0x42cbc2){var _0x1ef664={};_0x1ef664[_0x42cbc2]={'$like':'%'+_0x3901b4[_0xac25('0x3f')]['filter']+'%'};return _0x1ef664;})});}_0x465546=_[_0xac25('0x4a')]({},_0x465546,_0x3901b4[_0xac25('0x4c')]);return _0x375fb7[_0xac25('0x12a')](_0x465546);}})['then'](function(_0x205be1){if(_0x205be1){_0x22b81b=_0x205be1[_0xac25('0x52')];if(!_0x3901b4['query'][_0xac25('0x42')]('nolimit')){_0x465546[_0xac25('0x2c')]=qs[_0xac25('0x2c')](_0x3901b4['query']['limit']);_0x465546[_0xac25('0x2a')]=qs[_0xac25('0x2a')](_0x3901b4[_0xac25('0x3f')]['offset']);}return _0x375fb7[_0xac25('0x12a')](_0x465546);}})['then'](function(_0x29a0ed){if(_0x29a0ed){return _0x29a0ed?{'count':_0x22b81b,'rows':_0x29a0ed}:null;}})[_0xac25('0x1e')](respondWithResult(_0x2b547e,null))['catch'](handleError(_0x2b547e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index c4e5af2..0735f4d 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 _0xc7e9=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xc7e9[_0x26462c];return _0x509a42;};'use strict';var EventEmitter=require(_0x9c7e('0x0'));var ChatWebsite=require(_0x9c7e('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9c7e('0x2')](0x0);var events={'afterCreate':_0x9c7e('0x3'),'afterUpdate':_0x9c7e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x340997){return function(_0x34cef0,_0x5010c0,_0x571d29){ChatWebsiteEvents[_0x9c7e('0x5')](_0x340997+':'+_0x34cef0['id'],_0x34cef0);ChatWebsiteEvents['emit'](_0x340997,_0x34cef0);_0x571d29(null);};}for(var e in events){if(events[_0x9c7e('0x6')](e)){var event=events[e];ChatWebsite[_0x9c7e('0x7')](e,emitEvent(event));}}module[_0x9c7e('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x28e3=['update','remove','emit','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x5a11f3,_0x447ba8){var _0x208085=function(_0x3a3217){while(--_0x3a3217){_0x5a11f3['push'](_0x5a11f3['shift']());}};_0x208085(++_0x447ba8);}(_0x28e3,0x106));var _0x328e=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x28e3[_0x55ff3e];return _0x2709eb;};'use strict';var EventEmitter=require(_0x328e('0x0'));var ChatWebsite=require(_0x328e('0x1'))['db'][_0x328e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x328e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x328e('0x4'),'afterDestroy':_0x328e('0x5')};function emitEvent(_0x106c30){return function(_0x168893,_0x8cdc14,_0x15aade){ChatWebsiteEvents[_0x328e('0x6')](_0x106c30+':'+_0x168893['id'],_0x168893);ChatWebsiteEvents[_0x328e('0x6')](_0x106c30,_0x168893);_0x15aade(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index e60fc4d..acaf2dc 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 _0x5941=['request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33ad1f,_0xfc2fc8){var _0x26ef22=function(_0x58f97c){while(--_0x58f97c){_0x33ad1f['push'](_0x33ad1f['shift']());}};_0x26ef22(++_0xfc2fc8);}(_0x5941,0x1ba));var _0x1594=function(_0x3e9c45,_0x166dde){_0x3e9c45=_0x3e9c45-0x0;var _0x95b1ad=_0x5941[_0x3e9c45];return _0x95b1ad;};'use strict';var _=require(_0x1594('0x0'));var util=require(_0x1594('0x1'));var logger=require(_0x1594('0x2'))(_0x1594('0x3'));var moment=require(_0x1594('0x4'));var BPromise=require(_0x1594('0x5'));var rp=require(_0x1594('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1594('0x7'));var config=require(_0x1594('0x8'));var attributes=require(_0x1594('0x9'));module[_0x1594('0xa')]=function(_0x3f877b,_0x1e888b){return _0x3f877b[_0x1594('0xb')](_0x1594('0xc'),attributes,{'tableName':_0x1594('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c50=['request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','api','moment','bluebird'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0x8c50,0xf8));var _0x08c5=function(_0x1a69f8,_0x46c29c){_0x1a69f8=_0x1a69f8-0x0;var _0x217f67=_0x8c50[_0x1a69f8];return _0x217f67;};'use strict';var _=require(_0x08c5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x08c5('0x1'));var moment=require(_0x08c5('0x2'));var BPromise=require(_0x08c5('0x3'));var rp=require(_0x08c5('0x4'));var fs=require('fs');var path=require(_0x08c5('0x5'));var rimraf=require(_0x08c5('0x6'));var config=require('../../config/environment');var attributes=require(_0x08c5('0x7'));module[_0x08c5('0x8')]=function(_0x5144d6,_0x30bf5a){return _0x5144d6[_0x08c5('0x9')](_0x08c5('0xa'),attributes,{'tableName':_0x08c5('0xb'),'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 5b17549..e928b19 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 _0xbb7b=['error','code','ChatWebsite,\x20%s,\x20%s','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','debug','request\x20sent','stringify'];(function(_0x4b8f96,_0x424a2c){var _0x5dcce4=function(_0x415120){while(--_0x415120){_0x4b8f96['push'](_0x4b8f96['shift']());}};_0x5dcce4(++_0x424a2c);}(_0xbb7b,0x118));var _0xbbb7=function(_0x250d81,_0x5a3538){_0x250d81=_0x250d81-0x0;var _0x18c7a4=_0xbb7b[_0x250d81];return _0x18c7a4;};'use strict';var _=require('lodash');var util=require(_0xbbb7('0x0'));var moment=require(_0xbbb7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbb7('0x2'));var db=require(_0xbbb7('0x3'))['db'];var utils=require(_0xbbb7('0x4'));var logger=require(_0xbbb7('0x5'))(_0xbbb7('0x6'));var config=require(_0xbbb7('0x7'));var jayson=require(_0xbbb7('0x8'));var client=jayson[_0xbbb7('0x9')][_0xbbb7('0xa')]({'port':0x232a});config[_0xbbb7('0xb')]=_[_0xbbb7('0xc')](config[_0xbbb7('0xb')],{'host':_0xbbb7('0xd'),'port':0x18eb});var socket=require(_0xbbb7('0xe'))(new Redis(config[_0xbbb7('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x755a4,_0x55cdee,_0xf93ef){return new BPromise(function(_0x3de993,_0xf7a3){return client['request'](_0x755a4,_0xf93ef)[_0xbbb7('0xf')](function(_0x5d9409){logger[_0xbbb7('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x55cdee,'request\x20sent');logger[_0xbbb7('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x55cdee,_0xbbb7('0x12'),JSON[_0xbbb7('0x13')](_0x5d9409));if(_0x5d9409['error']){if(_0x5d9409[_0xbbb7('0x14')][_0xbbb7('0x15')]===0x1f4){logger[_0xbbb7('0x14')](_0xbbb7('0x16'),_0x55cdee,_0x5d9409[_0xbbb7('0x14')][_0xbbb7('0x17')]);return _0xf7a3(_0x5d9409['error'][_0xbbb7('0x17')]);}logger[_0xbbb7('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x55cdee,_0x5d9409[_0xbbb7('0x14')][_0xbbb7('0x17')]);return _0x3de993(_0x5d9409[_0xbbb7('0x14')][_0xbbb7('0x17')]);}else{logger['info'](_0xbbb7('0x16'),_0x55cdee,'request\x20sent');_0x3de993(_0x5d9409['result'][_0xbbb7('0x17')]);}})[_0xbbb7('0x18')](function(_0x5970a9){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x55cdee,_0x5970a9);_0xf7a3(_0x5970a9);});});} \ No newline at end of file +var _0xac2c=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x3c78c0,_0x24b4d4){var _0x4b0f0c=function(_0x3e8915){while(--_0x3e8915){_0x3c78c0['push'](_0x3c78c0['shift']());}};_0x4b0f0c(++_0x24b4d4);}(_0xac2c,0x167));var _0xcac2=function(_0x440ba5,_0x573515){_0x440ba5=_0x440ba5-0x0;var _0x218106=_0xac2c[_0x440ba5];return _0x218106;};'use strict';var _=require(_0xcac2('0x0'));var util=require(_0xcac2('0x1'));var moment=require(_0xcac2('0x2'));var BPromise=require(_0xcac2('0x3'));var rs=require(_0xcac2('0x4'));var fs=require('fs');var Redis=require(_0xcac2('0x5'));var db=require(_0xcac2('0x6'))['db'];var utils=require(_0xcac2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcac2('0x8'));var client=jayson['client'][_0xcac2('0x9')]({'port':0x232a});config[_0xcac2('0xa')]=_[_0xcac2('0xb')](config['redis'],{'host':_0xcac2('0xc'),'port':0x18eb});var socket=require(_0xcac2('0xd'))(new Redis(config[_0xcac2('0xa')]));require(_0xcac2('0xe'))[_0xcac2('0xf')](socket);function respondWithRpcPromise(_0x2a0d01,_0x384d6b,_0x1b1f8d){return new BPromise(function(_0x4fa9bd,_0x54e906){return client['request'](_0x2a0d01,_0x1b1f8d)[_0xcac2('0x10')](function(_0x39c121){logger[_0xcac2('0x11')](_0xcac2('0x12'),_0x384d6b,_0xcac2('0x13'));logger[_0xcac2('0x14')](_0xcac2('0x15'),_0x384d6b,_0xcac2('0x13'),JSON[_0xcac2('0x16')](_0x39c121));if(_0x39c121[_0xcac2('0x17')]){if(_0x39c121[_0xcac2('0x17')][_0xcac2('0x18')]===0x1f4){logger[_0xcac2('0x17')](_0xcac2('0x12'),_0x384d6b,_0x39c121[_0xcac2('0x17')]['message']);return _0x54e906(_0x39c121[_0xcac2('0x17')][_0xcac2('0x19')]);}logger['error'](_0xcac2('0x12'),_0x384d6b,_0x39c121[_0xcac2('0x17')][_0xcac2('0x19')]);return _0x4fa9bd(_0x39c121[_0xcac2('0x17')][_0xcac2('0x19')]);}else{logger[_0xcac2('0x11')](_0xcac2('0x12'),_0x384d6b,'request\x20sent');_0x4fa9bd(_0x39c121[_0xcac2('0x1a')][_0xcac2('0x19')]);}})['catch'](function(_0x4e754f){logger['error'](_0xcac2('0x12'),_0x384d6b,_0x4e754f);_0x54e906(_0x4e754f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 44dd40e..7b42701 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 _0xb913=['removeListener','length','chatWebsite:','save','update','emit'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xb913,0x1a7));var _0x3b91=function(_0x425dc6,_0x52e3d6){_0x425dc6=_0x425dc6-0x0;var _0xc24646=_0xb913[_0x425dc6];return _0xc24646;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x3b91('0x0'),'remove',_0x3b91('0x1')];function createListener(_0x3017ad,_0x4481ce){return function(_0x2dfff4){_0x4481ce[_0x3b91('0x2')](_0x3017ad,_0x2dfff4);};}function removeListener(_0x130fae,_0x3a5dfb){return function(){ChatWebsiteEvents[_0x3b91('0x3')](_0x130fae,_0x3a5dfb);};}exports['register']=function(_0x34a275){for(var _0x4008b9=0x0,_0x2b7f8e=events[_0x3b91('0x4')];_0x4008b9<_0x2b7f8e;_0x4008b9++){var _0x279661=events[_0x4008b9];var _0x5e3fa7=createListener(_0x3b91('0x5')+_0x279661,_0x34a275);ChatWebsiteEvents['on'](_0x279661,_0x5e3fa7);}}; \ No newline at end of file +var _0xa0cc=['remove','update','emit','register','length','chatWebsite:'];(function(_0x57f65e,_0x608de9){var _0x59155c=function(_0xff18bc){while(--_0xff18bc){_0x57f65e['push'](_0x57f65e['shift']());}};_0x59155c(++_0x608de9);}(_0xa0cc,0x192));var _0xca0c=function(_0x4d1a97,_0xaf6e6e){_0x4d1a97=_0x4d1a97-0x0;var _0x3f17a4=_0xa0cc[_0x4d1a97];return _0x3f17a4;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xca0c('0x0'),_0xca0c('0x1')];function createListener(_0x33e9be,_0x5d9a48){return function(_0x14bc3e){_0x5d9a48[_0xca0c('0x2')](_0x33e9be,_0x14bc3e);};}function removeListener(_0x2fec19,_0x1d9a62){return function(){ChatWebsiteEvents['removeListener'](_0x2fec19,_0x1d9a62);};}exports[_0xca0c('0x3')]=function(_0x2b15c2){for(var _0x5b6b0b=0x0,_0x1a8522=events[_0xca0c('0x4')];_0x5b6b0b<_0x1a8522;_0x5b6b0b++){var _0xa09a3f=events[_0x5b6b0b];var _0xe44666=createListener(_0xca0c('0x5')+_0xa09a3f,_0x2b15c2);ChatWebsiteEvents['on'](_0xa09a3f,_0xe44666);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index dcfc678..6dbd774 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 _0x549f=['diskStorage','addCustomerAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','join','root','server/files/images/logos/','file','addLogo','server/files/images/avatars/','format','%s-%s','now','originalname','single','addAvatar'];(function(_0xba650,_0x37fce1){var _0x103e47=function(_0x471c8e){while(--_0x471c8e){_0xba650['push'](_0xba650['shift']());}};_0x103e47(++_0x37fce1);}(_0x549f,0x1c6));var _0xf549=function(_0x2e11d4,_0xfed9fc){_0x2e11d4=_0x2e11d4-0x0;var _0x109d74=_0x549f[_0x2e11d4];return _0x109d74;};'use strict';var multer=require(_0xf549('0x0'));var util=require(_0xf549('0x1'));var path=require(_0xf549('0x2'));var timeout=require(_0xf549('0x3'));var express=require(_0xf549('0x4'));var router=express[_0xf549('0x5')]();var fs_extra=require(_0xf549('0x6'));var auth=require(_0xf549('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf549('0x8'));var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf549('0x9')](_0xf549('0xa'),auth[_0xf549('0xb')](),controller[_0xf549('0xc')]);router['get'](_0xf549('0xd'),auth['isAuthenticated'](),controller[_0xf549('0xe')]);router[_0xf549('0x9')]('/:id/dispositions',auth[_0xf549('0xb')](),controller[_0xf549('0xf')]);router[_0xf549('0x9')]('/:id/canned_answers',auth[_0xf549('0xb')](),controller[_0xf549('0x10')]);router['get'](_0xf549('0x11'),controller[_0xf549('0x12')]);router[_0xf549('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xf549('0x9')](_0xf549('0x13'),controller[_0xf549('0x14')]);router[_0xf549('0x9')](_0xf549('0x15'),controller[_0xf549('0x16')]);router[_0xf549('0x9')](_0xf549('0x17'),auth[_0xf549('0xb')](),controller[_0xf549('0x18')]);router[_0xf549('0x9')](_0xf549('0x19'),controller[_0xf549('0x1a')]);router[_0xf549('0x9')](_0xf549('0x1b'),auth[_0xf549('0xb')](),controller[_0xf549('0x1c')]);router[_0xf549('0x9')](_0xf549('0x1d'),auth[_0xf549('0xb')](),controller[_0xf549('0x1e')]);router['get']('/:id/fields',controller['getFields']);router['get'](_0xf549('0x1f'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xf549('0x9')](_0xf549('0x20'),auth[_0xf549('0xb')](),controller[_0xf549('0x21')]);router[_0xf549('0x22')]('/',auth['isAuthenticated'](),controller[_0xf549('0x23')]);router[_0xf549('0x22')](_0xf549('0x24'),auth[_0xf549('0xb')](),controller['addDisposition']);router[_0xf549('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf549('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12ac34,_0x25a9bb,_0x3639e0){_0x3639e0(null,path[_0xf549('0x26')](config[_0xf549('0x27')],_0xf549('0x28')));},'filename':function(_0x4118c4,_0x2b5279,_0x570175){_0x570175(null,util['format']('%s-%s',Date['now'](),_0x2b5279['originalname']));}})});router[_0xf549('0x22')](_0xf549('0x11'),upload['single'](_0xf549('0x29')),controller[_0xf549('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11193a,_0x13d8e5,_0x3a3601){_0x3a3601(null,path[_0xf549('0x26')](config[_0xf549('0x27')],_0xf549('0x2b')));},'filename':function(_0x514324,_0x427f97,_0x42dbef){_0x42dbef(null,util[_0xf549('0x2c')](_0xf549('0x2d'),Date[_0xf549('0x2e')](),_0x427f97[_0xf549('0x2f')]));}})});router['post']('/:id/avatar',upload[_0xf549('0x30')](_0xf549('0x29')),controller[_0xf549('0x31')]);var upload=multer({'storage':multer[_0xf549('0x32')]({'destination':function(_0x3db9dd,_0x21c48b,_0x315783){_0x315783(null,path[_0xf549('0x26')](config[_0xf549('0x27')],_0xf549('0x2b')));},'filename':function(_0x4fefd7,_0x59b4f9,_0x186b39){_0x186b39(null,util[_0xf549('0x2c')](_0xf549('0x2d'),Date[_0xf549('0x2e')](),_0x59b4f9[_0xf549('0x2f')]));}})});router['post'](_0xf549('0x13'),upload[_0xf549('0x30')](_0xf549('0x29')),controller[_0xf549('0x33')]);var upload=multer({'storage':multer[_0xf549('0x32')]({'destination':function(_0xa5d9ef,_0x4fb971,_0x32bcaf){_0x32bcaf(null,path['join'](config[_0xf549('0x27')],_0xf549('0x2b')));},'filename':function(_0x4d07a2,_0x4497c8,_0x381f54){_0x381f54(null,util[_0xf549('0x2c')](_0xf549('0x2d'),Date[_0xf549('0x2e')](),_0x4497c8[_0xf549('0x2f')]));}})});router[_0xf549('0x22')](_0xf549('0x15'),upload['single'](_0xf549('0x29')),controller['addSystemAvatar']);router[_0xf549('0x22')]('/:id/notify',controller[_0xf549('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xf549('0x32')]({'destination':function(_0x53d6d6,_0x4c1d74,_0x8be718){const _0x2105ce=path[_0xf549('0x26')](config[_0xf549('0x27')],_0xf549('0x35'),'attachments',_0xf549('0x36'));fs_extra[_0xf549('0x37')](_0x2105ce,function(){_0x8be718(null,_0x2105ce);});},'filename':function(_0x1b4b77,_0x77345b,_0x37a4e8){const _0x386182=_0x77345b[_0xf549('0x2f')][_0xf549('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x235cac=path[_0xf549('0x39')](_0x386182);const _0x42b3e0=Date[_0xf549('0x2e')]()+'-'+_0x386182[_0xf549('0x38')](_0x235cac,'')+_0x235cac;_0x37a4e8(null,_0x42b3e0);}})});router['post'](_0xf549('0x3a'),offlineUploadMulter[_0xf549('0x3b')](),controller[_0xf549('0x3c')]);router['post'](_0xf549('0x17'),auth[_0xf549('0xb')](),controller[_0xf549('0x3d')]);router[_0xf549('0x22')](_0xf549('0x1b'),auth['isAuthenticated'](),controller[_0xf549('0x3e')]);router[_0xf549('0x22')](_0xf549('0x1d'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xf549('0x22')](_0xf549('0x20'),auth[_0xf549('0xb')](),controller[_0xf549('0x3f')]);router[_0xf549('0x40')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf549('0x41')]('/:id',auth[_0xf549('0xb')](),controller[_0xf549('0x42')]);router[_0xf549('0x41')](_0xf549('0x24'),auth[_0xf549('0xb')](),controller[_0xf549('0x43')]);router['delete'](_0xf549('0x44'),auth[_0xf549('0xb')](),controller[_0xf549('0x45')]);router[_0xf549('0x41')](_0xf549('0x20'),auth[_0xf549('0xb')](),controller[_0xf549('0x46')]);module[_0xf549('0x47')]=router; \ No newline at end of file +var _0x7f11=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','now','/:id/avatar','addCustomerAvatar','/:id/notify','server/files','extname','replace','/:id/offline','any','addAgents','/:id','update','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7f11,0x10c));var _0x17f1=function(_0x1c7837,_0x59c98c){_0x1c7837=_0x1c7837-0x0;var _0x442df6=_0x7f11[_0x1c7837];return _0x442df6;};'use strict';var multer=require(_0x17f1('0x0'));var util=require(_0x17f1('0x1'));var path=require(_0x17f1('0x2'));var timeout=require(_0x17f1('0x3'));var express=require(_0x17f1('0x4'));var router=express[_0x17f1('0x5')]();var fs_extra=require(_0x17f1('0x6'));var auth=require(_0x17f1('0x7'));var interaction=require(_0x17f1('0x8'));var config=require('../../config/environment');var controller=require(_0x17f1('0x9'));router[_0x17f1('0xa')]('/',auth[_0x17f1('0xb')](),controller[_0x17f1('0xc')]);router[_0x17f1('0xa')]('/describe',auth[_0x17f1('0xb')](),controller[_0x17f1('0xd')]);router[_0x17f1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x17f1('0xe')]);router['get'](_0x17f1('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x17f1('0xa')](_0x17f1('0x10'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x11')]);router['get'](_0x17f1('0x12'),controller[_0x17f1('0x13')]);router[_0x17f1('0xa')]('/:id/avatar',controller[_0x17f1('0x14')]);router[_0x17f1('0xa')](_0x17f1('0x15'),controller[_0x17f1('0x16')]);router['get'](_0x17f1('0x17'),controller[_0x17f1('0x18')]);router['get'](_0x17f1('0x19'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x1a')]);router[_0x17f1('0xa')](_0x17f1('0x1b'),controller[_0x17f1('0x1c')]);router[_0x17f1('0xa')](_0x17f1('0x1d'),auth['isAuthenticated'](),controller[_0x17f1('0x1e')]);router['get'](_0x17f1('0x1f'),auth['isAuthenticated'](),controller[_0x17f1('0x20')]);router[_0x17f1('0xa')](_0x17f1('0x21'),controller[_0x17f1('0x22')]);router[_0x17f1('0xa')]('/:id/offline_messages',auth[_0x17f1('0xb')](),controller['getOfflineMessages']);router[_0x17f1('0xa')](_0x17f1('0x23'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x24')]);router[_0x17f1('0x25')]('/',auth[_0x17f1('0xb')](),controller[_0x17f1('0x26')]);router[_0x17f1('0x25')](_0x17f1('0xf'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x27')]);router[_0x17f1('0x25')]('/:id/canned_answers',auth[_0x17f1('0xb')](),controller[_0x17f1('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a86dd,_0x24390b,_0xcbea72){_0xcbea72(null,path[_0x17f1('0x29')](config[_0x17f1('0x2a')],_0x17f1('0x2b')));},'filename':function(_0x2d9f98,_0x55a9d2,_0x595153){_0x595153(null,util[_0x17f1('0x2c')](_0x17f1('0x2d'),Date['now'](),_0x55a9d2[_0x17f1('0x2e')]));}})});router[_0x17f1('0x25')](_0x17f1('0x12'),upload[_0x17f1('0x2f')](_0x17f1('0x30')),controller[_0x17f1('0x31')]);var upload=multer({'storage':multer[_0x17f1('0x32')]({'destination':function(_0x4a4b3d,_0x5441a9,_0x1bfc8b){_0x1bfc8b(null,path[_0x17f1('0x29')](config[_0x17f1('0x2a')],_0x17f1('0x33')));},'filename':function(_0x42ec2c,_0xaecce2,_0x10cee1){_0x10cee1(null,util[_0x17f1('0x2c')](_0x17f1('0x2d'),Date[_0x17f1('0x34')](),_0xaecce2[_0x17f1('0x2e')]));}})});router[_0x17f1('0x25')](_0x17f1('0x35'),upload['single'](_0x17f1('0x30')),controller['addAvatar']);var upload=multer({'storage':multer[_0x17f1('0x32')]({'destination':function(_0x38562a,_0x3f4e50,_0x2638dc){_0x2638dc(null,path['join'](config[_0x17f1('0x2a')],_0x17f1('0x33')));},'filename':function(_0x48dfb6,_0x1e9d10,_0x272896){_0x272896(null,util[_0x17f1('0x2c')](_0x17f1('0x2d'),Date[_0x17f1('0x34')](),_0x1e9d10[_0x17f1('0x2e')]));}})});router[_0x17f1('0x25')](_0x17f1('0x15'),upload[_0x17f1('0x2f')](_0x17f1('0x30')),controller[_0x17f1('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x467413,_0x1df855,_0x2bb911){_0x2bb911(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x23091c,_0x52c6b4,_0x15d986){_0x15d986(null,util[_0x17f1('0x2c')](_0x17f1('0x2d'),Date[_0x17f1('0x34')](),_0x52c6b4['originalname']));}})});router[_0x17f1('0x25')](_0x17f1('0x17'),upload[_0x17f1('0x2f')]('file'),controller['addSystemAvatar']);router[_0x17f1('0x25')](_0x17f1('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x17f1('0x32')]({'destination':function(_0x3e85fd,_0x6b38bb,_0x30d357){const _0x42cf14=path[_0x17f1('0x29')](config[_0x17f1('0x2a')],_0x17f1('0x38'),'attachments','offline-chat');fs_extra['ensureDir'](_0x42cf14,function(){_0x30d357(null,_0x42cf14);});},'filename':function(_0xa6f9d4,_0x405e7f,_0x59830d){const _0x1a5067=_0x405e7f[_0x17f1('0x2e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e50f7=path[_0x17f1('0x39')](_0x1a5067);const _0x38de3b=Date['now']()+'-'+_0x1a5067[_0x17f1('0x3a')](_0x2e50f7,'')+_0x2e50f7;_0x59830d(null,_0x38de3b);}})});router[_0x17f1('0x25')](_0x17f1('0x3b'),offlineUploadMulter[_0x17f1('0x3c')](),controller['offline']);router['post']('/:id/interactions',auth[_0x17f1('0xb')](),controller['addInteraction']);router[_0x17f1('0x25')](_0x17f1('0x1d'),auth[_0x17f1('0xb')](),controller['addApplications']);router[_0x17f1('0x25')](_0x17f1('0x1f'),auth[_0x17f1('0xb')](),controller['addProactiveActions']);router[_0x17f1('0x25')]('/:id/users',auth[_0x17f1('0xb')](),controller[_0x17f1('0x3d')]);router['put'](_0x17f1('0x3e'),auth['isAuthenticated'](),controller[_0x17f1('0x3f')]);router[_0x17f1('0x40')](_0x17f1('0x3e'),auth[_0x17f1('0xb')](),controller['destroy']);router[_0x17f1('0x40')](_0x17f1('0xf'),auth[_0x17f1('0xb')](),controller['removeDispositions']);router[_0x17f1('0x40')](_0x17f1('0x10'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x41')]);router['delete'](_0x17f1('0x23'),auth[_0x17f1('0xb')](),controller[_0x17f1('0x42')]);module[_0x17f1('0x43')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index da215c5..7040a42 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 _0x4e83=['sequelize','STRING','ENUM','AmazonAWS','Google'];(function(_0x6537c2,_0x2ed0e6){var _0xe7c0cd=function(_0x8b8c98){while(--_0x8b8c98){_0x6537c2['push'](_0x6537c2['shift']());}};_0xe7c0cd(++_0x2ed0e6);}(_0x4e83,0x1ae));var _0x34e8=function(_0x315316,_0x362653){_0x315316=_0x315316-0x0;var _0x2abab1=_0x4e83[_0x315316];return _0x2abab1;};'use strict';var Sequelize=require(_0x34e8('0x0'));module['exports']={'name':{'type':Sequelize[_0x34e8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x34e8('0x2')](_0x34e8('0x3'),_0x34e8('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x34e8('0x1')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb89c=['STRING','ENUM','Google','sequelize','exports'];(function(_0x386658,_0x49f7c5){var _0x146125=function(_0x546f71){while(--_0x546f71){_0x386658['push'](_0x386658['shift']());}};_0x146125(++_0x49f7c5);}(_0xb89c,0x198));var _0xcb89=function(_0x13858c,_0x1fcbf5){_0x13858c=_0x13858c-0x0;var _0x261efe=_0xb89c[_0x13858c];return _0x261efe;};'use strict';var Sequelize=require(_0xcb89('0x0'));module[_0xcb89('0x1')]={'name':{'type':Sequelize[_0xcb89('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xcb89('0x3')]('AmazonAWS',_0xcb89('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xcb89('0x2')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a4b2ed1..0a1adac 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','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'];(function(_0x8ffa00,_0x48d500){var _0x409728=function(_0x469cd5){while(--_0x469cd5){_0x8ffa00['push'](_0x8ffa00['shift']());}};_0x409728(++_0x48d500);}(_0x2ef3,0xba));var _0x32ef=function(_0x42d824,_0x4a1eaa){_0x42d824=_0x42d824-0x0;var _0x424391=_0x2ef3[_0x42d824];return _0x424391;};'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['CloudProvider'][_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')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7946ae,_0x14cb7d){_0x7946ae=_0x7946ae-0x0;var _0x4e5e76=_0x5f2f[_0x7946ae];return _0x4e5e76;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 12b25f7..8e18c14 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 _0x308e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x42e6df,_0x50380a){var _0x44d525=function(_0x168e5b){while(--_0x168e5b){_0x42e6df['push'](_0x42e6df['shift']());}};_0x44d525(++_0x50380a);}(_0x308e,0x6f));var _0xe308=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x308e[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xe308('0x0'));var util=require(_0xe308('0x1'));var logger=require(_0xe308('0x2'))(_0xe308('0x3'));var moment=require(_0xe308('0x4'));var BPromise=require(_0xe308('0x5'));var rp=require(_0xe308('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe308('0x7'));var config=require(_0xe308('0x8'));var attributes=require(_0xe308('0x9'));module[_0xe308('0xa')]=function(_0x1d06c5,_0x2959c4){return _0x1d06c5[_0xe308('0xb')](_0xe308('0xc'),attributes,{'tableName':_0xe308('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1804=['util','api','moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1804,0xc5));var _0x4180=function(_0x15c2b5,_0x4b902b){_0x15c2b5=_0x15c2b5-0x0;var _0x42e2c9=_0x1804[_0x15c2b5];return _0x42e2c9;};'use strict';var _=require(_0x4180('0x0'));var util=require(_0x4180('0x1'));var logger=require('../../config/logger')(_0x4180('0x2'));var moment=require(_0x4180('0x3'));var BPromise=require('bluebird');var rp=require(_0x4180('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4180('0x5'));var config=require(_0x4180('0x6'));var attributes=require(_0x4180('0x7'));module[_0x4180('0x8')]=function(_0x155e1a,_0xee7eaa){return _0x155e1a['define'](_0x4180('0x9'),attributes,{'tableName':_0x4180('0xa'),'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 501074e..139b3fe 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 _0x4888=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x443783,_0x5c3c47){var _0x23c272=function(_0x4145d0){while(--_0x4145d0){_0x443783['push'](_0x443783['shift']());}};_0x23c272(++_0x5c3c47);}(_0x4888,0x198));var _0x8488=function(_0x58f29c,_0x551df2){_0x58f29c=_0x58f29c-0x0;var _0x5266ed=_0x4888[_0x58f29c];return _0x5266ed;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});} \ No newline at end of file +var _0x72a1=['jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x72a1,0x1ce));var _0x172a=function(_0xfd8718,_0x52c603){_0xfd8718=_0xfd8718-0x0;var _0x33393f=_0x72a1[_0xfd8718];return _0x33393f;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('CloudProvider,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7d0955f..f6c6b0a 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 _0x39c3=['util','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','create','update','destroy','exports'];(function(_0x2bd9c8,_0x500289){var _0x80de1e=function(_0x564e1d){while(--_0x564e1d){_0x2bd9c8['push'](_0x2bd9c8['shift']());}};_0x80de1e(++_0x500289);}(_0x39c3,0x179));var _0x339c=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x39c3[_0x1778e1];return _0x2bc4c6;};'use strict';var multer=require('multer');var util=require(_0x339c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x339c('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x339c('0x2'));var controller=require(_0x339c('0x3'));router[_0x339c('0x4')]('/',auth['isAuthenticated'](),controller[_0x339c('0x5')]);router[_0x339c('0x4')](_0x339c('0x6'),auth[_0x339c('0x7')](),controller[_0x339c('0x8')]);router['post']('/',auth[_0x339c('0x7')](),controller[_0x339c('0x9')]);router['put']('/:id',auth[_0x339c('0x7')](),controller[_0x339c('0xa')]);router['delete'](_0x339c('0x6'),auth[_0x339c('0x7')](),controller[_0x339c('0xb')]);module[_0x339c('0xc')]=router; \ No newline at end of file +var _0x86f0=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util'];(function(_0x456904,_0x4cb25c){var _0x4b0063=function(_0x2cb59f){while(--_0x2cb59f){_0x456904['push'](_0x456904['shift']());}};_0x4b0063(++_0x4cb25c);}(_0x86f0,0x1e4));var _0x086f=function(_0x4563af,_0x1e4a29){_0x4563af=_0x4563af-0x0;var _0x483037=_0x86f0[_0x4563af];return _0x483037;};'use strict';var multer=require(_0x086f('0x0'));var util=require(_0x086f('0x1'));var path=require(_0x086f('0x2'));var timeout=require('connect-timeout');var express=require(_0x086f('0x3'));var router=express['Router']();var fs_extra=require(_0x086f('0x4'));var auth=require(_0x086f('0x5'));var interaction=require(_0x086f('0x6'));var config=require(_0x086f('0x7'));var controller=require(_0x086f('0x8'));router[_0x086f('0x9')]('/',auth[_0x086f('0xa')](),controller['index']);router[_0x086f('0x9')](_0x086f('0xb'),auth['isAuthenticated'](),controller[_0x086f('0xc')]);router[_0x086f('0xd')]('/',auth[_0x086f('0xa')](),controller[_0x086f('0xe')]);router['put'](_0x086f('0xb'),auth['isAuthenticated'](),controller[_0x086f('0xf')]);router['delete']('/:id',auth[_0x086f('0xa')](),controller[_0x086f('0x10')]);module[_0x086f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 06d0b55..17eb4e7 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 _0x91d9=['STRING','name','exports'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x91d9,0xe0));var _0x991d=function(_0x28c6d4,_0x2d8a5a){_0x28c6d4=_0x28c6d4-0x0;var _0x222f5d=_0x91d9[_0x28c6d4];return _0x222f5d;};'use strict';var Sequelize=require('sequelize');module[_0x991d('0x0')]={'name':{'type':Sequelize[_0x991d('0x1')],'unique':_0x991d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x991d('0x1')]},'companyId':{'type':Sequelize[_0x991d('0x1')]},'website':{'type':Sequelize[_0x991d('0x1')]},'phone':{'type':Sequelize[_0x991d('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x991d('0x1')]},'street':{'type':Sequelize[_0x991d('0x1')]},'postalCode':{'type':Sequelize[_0x991d('0x1')]},'city':{'type':Sequelize[_0x991d('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x991d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x991d('0x1')]},'sStreet':{'type':Sequelize[_0x991d('0x1')]},'sPostalCode':{'type':Sequelize[_0x991d('0x1')]},'sCity':{'type':Sequelize[_0x991d('0x1')]},'sCountry':{'type':Sequelize[_0x991d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc7b4=['STRING','name','sequelize'];(function(_0x1f5a74,_0x443c62){var _0x16b0d0=function(_0x4a6428){while(--_0x4a6428){_0x1f5a74['push'](_0x1f5a74['shift']());}};_0x16b0d0(++_0x443c62);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c7b('0x1')],'unique':_0x4c7b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4c7b('0x1')]},'website':{'type':Sequelize[_0x4c7b('0x1')]},'phone':{'type':Sequelize[_0x4c7b('0x1')]},'fax':{'type':Sequelize[_0x4c7b('0x1')]},'type':{'type':Sequelize[_0x4c7b('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4c7b('0x1')]},'city':{'type':Sequelize[_0x4c7b('0x1')]},'country':{'type':Sequelize[_0x4c7b('0x1')]},'email':{'type':Sequelize[_0x4c7b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4c7b('0x1')]},'sStreet':{'type':Sequelize[_0x4c7b('0x1')]},'sPostalCode':{'type':Sequelize[_0x4c7b('0x1')]},'sCity':{'type':Sequelize['STRING']},'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 ccb5dfe..5844b5b 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 _0xf1dd=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','map','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','update','addContacts','CmContact','ids','omit','findOne','filter','options','getContacts','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel'];(function(_0x9621ca,_0x4fb1b9){var _0x1d8a3d=function(_0x1bd1f5){while(--_0x1bd1f5){_0x9621ca['push'](_0x9621ca['shift']());}};_0x1d8a3d(++_0x4fb1b9);}(_0xf1dd,0xf3));var _0xdf1d=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0xf1dd[_0xbc1a4b];return _0x108b87;};'use strict';var emlformat=require(_0xdf1d('0x0'));var rimraf=require(_0xdf1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf1d('0x2'));var rp=require(_0xdf1d('0x3'));var moment=require(_0xdf1d('0x4'));var BPromise=require(_0xdf1d('0x5'));var Mustache=require(_0xdf1d('0x6'));var util=require('util');var path=require(_0xdf1d('0x7'));var sox=require(_0xdf1d('0x8'));var csv=require(_0xdf1d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf1d('0xa'));var _=require('lodash');var squel=require(_0xdf1d('0xb'));var crypto=require('crypto');var jsforce=require(_0xdf1d('0xc'));var deskjs=require(_0xdf1d('0xd'));var toCsv=require(_0xdf1d('0x9'));var querystring=require('querystring');var Papa=require(_0xdf1d('0xe'));var Redis=require('ioredis');var authService=require(_0xdf1d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdf1d('0x10'));var hardwareService=require(_0xdf1d('0x11'));var logger=require('../../config/logger')(_0xdf1d('0x12'));var utils=require('../../config/utils');var config=require(_0xdf1d('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5a25,_0x31d599){_0x31d599=_0x31d599||0xcc;return function(_0x1f6e65){if(_0x1f6e65){return _0x5e5a25[_0xdf1d('0x14')](_0x31d599);}return _0x5e5a25['status'](_0x31d599)['end']();};}function respondWithResult(_0x96a26,_0x33a171){_0x33a171=_0x33a171||0xc8;return function(_0x29d117){if(_0x29d117){return _0x96a26[_0xdf1d('0x15')](_0x33a171)[_0xdf1d('0x16')](_0x29d117);}};}function respondWithFilteredResult(_0x2690b0,_0x430383){return function(_0x2ac06d){if(_0x2ac06d){var _0x7b13ba=typeof _0x430383['offset']===_0xdf1d('0x17')&&typeof _0x430383[_0xdf1d('0x18')]===_0xdf1d('0x17');var _0xdd1bf=_0x2ac06d[_0xdf1d('0x19')];var _0x40a46e=_0x7b13ba?0x0:_0x430383[_0xdf1d('0x1a')];var _0x4ec07f=_0x7b13ba?_0x2ac06d[_0xdf1d('0x19')]:_0x430383[_0xdf1d('0x1a')]+_0x430383[_0xdf1d('0x18')];var _0x3a99a7;if(_0x4ec07f>=_0xdd1bf){_0x4ec07f=_0xdd1bf;_0x3a99a7=0xc8;}else{_0x3a99a7=0xce;}_0x2690b0[_0xdf1d('0x15')](_0x3a99a7);return _0x2690b0[_0xdf1d('0x1b')](_0xdf1d('0x1c'),_0x40a46e+'-'+_0x4ec07f+'/'+_0xdd1bf)['json'](_0x2ac06d);}return null;};}function patchUpdates(_0x1c73a3){return function(_0x98b295){try{jsonpatch[_0xdf1d('0x1d')](_0x98b295,_0x1c73a3,!![]);}catch(_0x2a376a){return BPromise[_0xdf1d('0x1e')](_0x2a376a);}return _0x98b295[_0xdf1d('0x1f')]();};}function saveUpdates(_0x2ee661,_0x3036ab){return function(_0x4abab5){if(_0x4abab5){return _0x4abab5['update'](_0x2ee661)['then'](function(_0x540160){return _0x540160;});}return null;};}function removeEntity(_0x324aed,_0x4655b7){return function(_0x50ce72){if(_0x50ce72){return _0x50ce72[_0xdf1d('0x20')]()[_0xdf1d('0x21')](function(){var _0x1cb632=_0x50ce72[_0xdf1d('0x22')]({'plain':!![]});var _0x47a28d=_0xdf1d('0x23');return db[_0xdf1d('0x24')][_0xdf1d('0x20')]({'where':{'type':_0x47a28d,'resourceId':_0x1cb632['id']}})[_0xdf1d('0x21')](function(){return _0x50ce72;});})['then'](function(){_0x324aed[_0xdf1d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27cf84,_0x3911ad){return function(_0x2d69a0){if(!_0x2d69a0){_0x27cf84[_0xdf1d('0x14')](0x194);}return _0x2d69a0;};}function handleError(_0x2b1568,_0x6b028a){_0x6b028a=_0x6b028a||0x1f4;return function(_0x51921b){logger[_0xdf1d('0x25')](_0x51921b[_0xdf1d('0x26')]);if(_0x51921b[_0xdf1d('0x27')]){delete _0x51921b[_0xdf1d('0x27')];}_0x2b1568['status'](_0x6b028a)[_0xdf1d('0x28')](_0x51921b);};}exports[_0xdf1d('0x29')]=function(_0x15ad6e,_0x242243){var _0x13a5d4={},_0x18d9da={},_0xd87202={'count':0x0,'rows':[]};return db[_0xdf1d('0x2a')][_0xdf1d('0x2b')]()['then'](function(_0x9f8306){_0x18d9da[_0xdf1d('0x2c')]=_[_0xdf1d('0x2d')](_0x9f8306);_0x18d9da[_0xdf1d('0x2e')]=_[_0xdf1d('0x2d')](_0x15ad6e[_0xdf1d('0x2e')]);_0x18d9da[_0xdf1d('0x2f')]=_[_0xdf1d('0x30')](_0x18d9da[_0xdf1d('0x2c')],_0x18d9da[_0xdf1d('0x2e')]);_0x13a5d4['attributes']=_[_0xdf1d('0x30')](_0x18d9da[_0xdf1d('0x2c')],qs[_0xdf1d('0x31')](_0x15ad6e[_0xdf1d('0x2e')][_0xdf1d('0x31')]));_0x13a5d4[_0xdf1d('0x32')]=_0x13a5d4[_0xdf1d('0x32')][_0xdf1d('0x33')]?_0x13a5d4[_0xdf1d('0x32')]:_0x18d9da[_0xdf1d('0x2c')];if(!_0x15ad6e[_0xdf1d('0x2e')][_0xdf1d('0x34')](_0xdf1d('0x35'))){_0x13a5d4[_0xdf1d('0x18')]=qs[_0xdf1d('0x18')](_0x15ad6e[_0xdf1d('0x2e')][_0xdf1d('0x18')]);_0x13a5d4[_0xdf1d('0x1a')]=qs['offset'](_0x15ad6e['query']['offset']);}_0x13a5d4[_0xdf1d('0x36')]=qs[_0xdf1d('0x37')](_0x15ad6e[_0xdf1d('0x2e')][_0xdf1d('0x37')]);_0x13a5d4[_0xdf1d('0x38')]=qs[_0xdf1d('0x2f')](_[_0xdf1d('0x39')](_0x15ad6e[_0xdf1d('0x2e')],_0x18d9da[_0xdf1d('0x2f')]),_0x9f8306);if(_0x15ad6e[_0xdf1d('0x2e')]['filter']){_0x13a5d4[_0xdf1d('0x38')]=_['merge'](_0x13a5d4['where'],{'$or':_[_0xdf1d('0x3a')](_0x13a5d4[_0xdf1d('0x32')],function(_0x413423){var _0x10d206={};_0x10d206[_0x413423]={'$like':'%'+_0x15ad6e[_0xdf1d('0x2e')]['filter']+'%'};return _0x10d206;})});}_0x13a5d4=_[_0xdf1d('0x3b')]({},_0x13a5d4,_0x15ad6e['options']);var _0x2989e9={'where':_0x13a5d4[_0xdf1d('0x38')]};return db[_0xdf1d('0x2a')][_0xdf1d('0x19')](_0x2989e9)[_0xdf1d('0x21')](function(_0x5c977a){_0xd87202[_0xdf1d('0x19')]=_0x5c977a;if(_0x15ad6e[_0xdf1d('0x2e')][_0xdf1d('0x3c')]){_0x13a5d4[_0xdf1d('0x3d')]=[{'all':!![]}];}return db[_0xdf1d('0x2a')][_0xdf1d('0x3e')](_0x13a5d4);})[_0xdf1d('0x21')](function(_0x5bae01){_0xd87202[_0xdf1d('0x3f')]=_0x5bae01;return _0xd87202;})[_0xdf1d('0x21')](respondWithFilteredResult(_0x242243,_0x13a5d4))[_0xdf1d('0x40')](handleError(_0x242243,null));})[_0xdf1d('0x40')](handleError(_0x242243,null));};exports[_0xdf1d('0x41')]=function(_0x54588d,_0x34f42e){var _0x17f4ba={'raw':![],'where':{'id':_0x54588d[_0xdf1d('0x42')]['id']}},_0x56ce12={};_0x56ce12[_0xdf1d('0x2c')]=_[_0xdf1d('0x2d')](db[_0xdf1d('0x2a')][_0xdf1d('0x43')]);_0x56ce12[_0xdf1d('0x2e')]=_['keys'](_0x54588d[_0xdf1d('0x2e')]);_0x56ce12[_0xdf1d('0x2f')]=_['intersection'](_0x56ce12[_0xdf1d('0x2c')],_0x56ce12['query']);_0x17f4ba[_0xdf1d('0x32')]=_[_0xdf1d('0x30')](_0x56ce12[_0xdf1d('0x2c')],qs[_0xdf1d('0x31')](_0x54588d['query'][_0xdf1d('0x31')]));_0x17f4ba[_0xdf1d('0x32')]=_0x17f4ba['attributes'][_0xdf1d('0x33')]?_0x17f4ba[_0xdf1d('0x32')]:_0x56ce12[_0xdf1d('0x2c')];if(_0x54588d[_0xdf1d('0x2e')][_0xdf1d('0x3c')]){_0x17f4ba[_0xdf1d('0x3d')]=[{'all':!![]}];}_0x17f4ba=_[_0xdf1d('0x3b')]({},_0x17f4ba,_0x54588d['options']);return db[_0xdf1d('0x2a')]['find'](_0x17f4ba)[_0xdf1d('0x21')](handleEntityNotFound(_0x34f42e,null))[_0xdf1d('0x21')](respondWithResult(_0x34f42e,null))['catch'](handleError(_0x34f42e,null));};exports[_0xdf1d('0x44')]=function(_0x5af540,_0x4f7037){return db[_0xdf1d('0x2a')][_0xdf1d('0x44')](_0x5af540[_0xdf1d('0x45')],{})[_0xdf1d('0x21')](function(_0x576c2d){var _0x3fd32d=_0x5af540[_0xdf1d('0x46')][_0xdf1d('0x22')]({'plain':!![]});if(!_0x3fd32d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fd32d[_0xdf1d('0x47')]==='user'){var _0x5a2597=_0x576c2d[_0xdf1d('0x22')]({'plain':!![]});var _0x365561='Companies';return db[_0xdf1d('0x48')][_0xdf1d('0x49')]({'where':{'name':_0x365561,'userProfileId':_0x3fd32d[_0xdf1d('0x4a')]},'raw':!![]})[_0xdf1d('0x21')](function(_0x513dbd){if(_0x513dbd&&_0x513dbd[_0xdf1d('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a2597[_0xdf1d('0x27')],'resourceId':_0x5a2597['id'],'type':_0x513dbd[_0xdf1d('0x27')],'sectionId':_0x513dbd['id']},{})[_0xdf1d('0x21')](function(){return _0x576c2d;});}else{return _0x576c2d;}})[_0xdf1d('0x40')](function(_0xb4f8ed){logger[_0xdf1d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb4f8ed);throw _0xb4f8ed;});}return _0x576c2d;})[_0xdf1d('0x21')](respondWithResult(_0x4f7037,0xc9))[_0xdf1d('0x40')](handleError(_0x4f7037,null));};exports[_0xdf1d('0x4c')]=function(_0x3fccce,_0x3aaf4a){if(_0x3fccce['body']['id']){delete _0x3fccce['body']['id'];}return db[_0xdf1d('0x2a')][_0xdf1d('0x49')]({'where':{'id':_0x3fccce[_0xdf1d('0x42')]['id']}})[_0xdf1d('0x21')](handleEntityNotFound(_0x3aaf4a,null))[_0xdf1d('0x21')](saveUpdates(_0x3fccce[_0xdf1d('0x45')],null))[_0xdf1d('0x21')](respondWithResult(_0x3aaf4a,null))[_0xdf1d('0x40')](handleError(_0x3aaf4a,null));};exports[_0xdf1d('0x20')]=function(_0x566cc9,_0x369ebc){return db[_0xdf1d('0x2a')][_0xdf1d('0x49')]({'where':{'id':_0x566cc9[_0xdf1d('0x42')]['id']}})[_0xdf1d('0x21')](handleEntityNotFound(_0x369ebc,null))[_0xdf1d('0x21')](removeEntity(_0x369ebc,null))[_0xdf1d('0x40')](handleError(_0x369ebc,null));};exports[_0xdf1d('0x2b')]=function(_0x125533,_0x404cd1){return db[_0xdf1d('0x2a')][_0xdf1d('0x2b')]()[_0xdf1d('0x21')](respondWithResult(_0x404cd1,null))[_0xdf1d('0x40')](handleError(_0x404cd1,null));};exports[_0xdf1d('0x4d')]=function(_0x366428,_0x29d0e3,_0x5a4590){return db[_0xdf1d('0x4e')][_0xdf1d('0x49')]({'where':{'id':_0x366428['params']['id']}})[_0xdf1d('0x21')](handleEntityNotFound(_0x29d0e3,null))['then'](function(_0x3eccd9){if(_0x3eccd9){return _0x3eccd9[_0xdf1d('0x4d')](_0x366428[_0xdf1d('0x45')][_0xdf1d('0x4f')],_[_0xdf1d('0x50')](_0x366428[_0xdf1d('0x45')],['ids','id'])||{});}})[_0xdf1d('0x21')](respondWithResult(_0x29d0e3,null))[_0xdf1d('0x40')](handleError(_0x29d0e3,null));};exports['getContacts']=function(_0x1b88aa,_0x1853e5,_0x57e0b3){var _0x1b7b92={};var _0x1f975d={};var _0x3684f7;var _0x5d6727;return db[_0xdf1d('0x2a')][_0xdf1d('0x51')]({'where':{'id':_0x1b88aa[_0xdf1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x1853e5,null))[_0xdf1d('0x21')](function(_0x2e0d3e){if(_0x2e0d3e){_0x3684f7=_0x2e0d3e;_0x1f975d[_0xdf1d('0x2c')]=_[_0xdf1d('0x2d')](db[_0xdf1d('0x4e')][_0xdf1d('0x43')]);_0x1f975d['query']=_['keys'](_0x1b88aa[_0xdf1d('0x2e')]);_0x1f975d[_0xdf1d('0x2f')]=_['intersection'](_0x1f975d[_0xdf1d('0x2c')],_0x1f975d[_0xdf1d('0x2e')]);_0x1b7b92[_0xdf1d('0x32')]=_[_0xdf1d('0x30')](_0x1f975d[_0xdf1d('0x2c')],qs[_0xdf1d('0x31')](_0x1b88aa['query'][_0xdf1d('0x31')]));_0x1b7b92[_0xdf1d('0x32')]=_0x1b7b92[_0xdf1d('0x32')]['length']?_0x1b7b92['attributes']:_0x1f975d['model'];_0x1b7b92[_0xdf1d('0x36')]=qs[_0xdf1d('0x37')](_0x1b88aa[_0xdf1d('0x2e')][_0xdf1d('0x37')]);_0x1b7b92[_0xdf1d('0x38')]=qs[_0xdf1d('0x2f')](_[_0xdf1d('0x39')](_0x1b88aa['query'],_0x1f975d[_0xdf1d('0x2f')]));if(_0x1b88aa['query'][_0xdf1d('0x52')]){_0x1b7b92[_0xdf1d('0x38')]=_['merge'](_0x1b7b92['where'],{'$or':_[_0xdf1d('0x3a')](_0x1b7b92['attributes'],function(_0x2612c3){var _0x452a4f={};_0x452a4f[_0x2612c3]={'$like':'%'+_0x1b88aa[_0xdf1d('0x2e')][_0xdf1d('0x52')]+'%'};return _0x452a4f;})});}_0x1b7b92=_[_0xdf1d('0x3b')]({},_0x1b7b92,_0x1b88aa[_0xdf1d('0x53')]);return _0x3684f7[_0xdf1d('0x54')](_0x1b7b92);}})[_0xdf1d('0x21')](function(_0x3029d3){if(_0x3029d3){_0x5d6727=_0x3029d3[_0xdf1d('0x33')];if(!_0x1b88aa[_0xdf1d('0x2e')][_0xdf1d('0x34')](_0xdf1d('0x35'))){_0x1b7b92[_0xdf1d('0x18')]=qs[_0xdf1d('0x18')](_0x1b88aa['query'][_0xdf1d('0x18')]);_0x1b7b92['offset']=qs[_0xdf1d('0x1a')](_0x1b88aa[_0xdf1d('0x2e')]['offset']);}return _0x3684f7[_0xdf1d('0x54')](_0x1b7b92);}})[_0xdf1d('0x21')](function(_0x454c6c){if(_0x454c6c){return _0x454c6c?{'count':_0x5d6727,'rows':_0x454c6c}:null;}})[_0xdf1d('0x21')](respondWithResult(_0x1853e5,null))[_0xdf1d('0x40')](handleError(_0x1853e5,null));}; \ No newline at end of file +var _0x42fa=['rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','omit','getContacts','rawAttributes','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','save','then','get','Companies','destroy','stack','name','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','map','merge','options','includeAll','include','findAll'];(function(_0x3f8556,_0x35c394){var _0x391def=function(_0x3f5cd7){while(--_0x3f5cd7){_0x3f8556['push'](_0x3f8556['shift']());}};_0x391def(++_0x35c394);}(_0x42fa,0x17c));var _0xa42f=function(_0x4060da,_0x3a9736){_0x4060da=_0x4060da-0x0;var _0x5c553d=_0x42fa[_0x4060da];return _0x5c553d;};'use strict';var emlformat=require(_0xa42f('0x0'));var rimraf=require(_0xa42f('0x1'));var zipdir=require(_0xa42f('0x2'));var jsonpatch=require(_0xa42f('0x3'));var rp=require(_0xa42f('0x4'));var moment=require(_0xa42f('0x5'));var BPromise=require(_0xa42f('0x6'));var Mustache=require('mustache');var util=require(_0xa42f('0x7'));var path=require(_0xa42f('0x8'));var sox=require('sox');var csv=require(_0xa42f('0x9'));var ejs=require(_0xa42f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa42f('0xb'));var jsforce=require(_0xa42f('0xc'));var deskjs=require(_0xa42f('0xd'));var toCsv=require(_0xa42f('0x9'));var querystring=require(_0xa42f('0xe'));var Papa=require(_0xa42f('0xf'));var Redis=require(_0xa42f('0x10'));var authService=require(_0xa42f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa42f('0x12'));var hardwareService=require(_0xa42f('0x13'));var logger=require(_0xa42f('0x14'))(_0xa42f('0x15'));var utils=require(_0xa42f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa42f('0x17'));var db=require(_0xa42f('0x18'))['db'];function respondWithStatusCode(_0x402048,_0x17ab3c){_0x17ab3c=_0x17ab3c||0xcc;return function(_0x5cefa6){if(_0x5cefa6){return _0x402048[_0xa42f('0x19')](_0x17ab3c);}return _0x402048[_0xa42f('0x1a')](_0x17ab3c)[_0xa42f('0x1b')]();};}function respondWithResult(_0x29f599,_0x33fb15){_0x33fb15=_0x33fb15||0xc8;return function(_0x5399d9){if(_0x5399d9){return _0x29f599[_0xa42f('0x1a')](_0x33fb15)['json'](_0x5399d9);}};}function respondWithFilteredResult(_0x595ea0,_0x1a6d88){return function(_0x1dc409){if(_0x1dc409){var _0x401da4=typeof _0x1a6d88['offset']==='undefined'&&typeof _0x1a6d88[_0xa42f('0x1c')]===_0xa42f('0x1d');var _0x533a8d=_0x1dc409[_0xa42f('0x1e')];var _0x2cc107=_0x401da4?0x0:_0x1a6d88[_0xa42f('0x1f')];var _0x5d9291=_0x401da4?_0x1dc409[_0xa42f('0x1e')]:_0x1a6d88['offset']+_0x1a6d88[_0xa42f('0x1c')];var _0x4a08dc;if(_0x5d9291>=_0x533a8d){_0x5d9291=_0x533a8d;_0x4a08dc=0xc8;}else{_0x4a08dc=0xce;}_0x595ea0['status'](_0x4a08dc);return _0x595ea0[_0xa42f('0x20')](_0xa42f('0x21'),_0x2cc107+'-'+_0x5d9291+'/'+_0x533a8d)[_0xa42f('0x22')](_0x1dc409);}return null;};}function patchUpdates(_0x2c0689){return function(_0x37a392){try{jsonpatch['apply'](_0x37a392,_0x2c0689,!![]);}catch(_0x4bcfb8){return BPromise['reject'](_0x4bcfb8);}return _0x37a392[_0xa42f('0x23')]();};}function saveUpdates(_0xd3bcb7,_0x2e8ac0){return function(_0x93f4d1){if(_0x93f4d1){return _0x93f4d1['update'](_0xd3bcb7)[_0xa42f('0x24')](function(_0x3a6ab8){return _0x3a6ab8;});}return null;};}function removeEntity(_0x100706,_0x26264c){return function(_0x7e475b){if(_0x7e475b){return _0x7e475b['destroy']()[_0xa42f('0x24')](function(){var _0x164d80=_0x7e475b[_0xa42f('0x25')]({'plain':!![]});var _0x135c6d=_0xa42f('0x26');return db['UserProfileResource'][_0xa42f('0x27')]({'where':{'type':_0x135c6d,'resourceId':_0x164d80['id']}})['then'](function(){return _0x7e475b;});})[_0xa42f('0x24')](function(){_0x100706[_0xa42f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dcd8b,_0x4a1b1c){return function(_0x313a98){if(!_0x313a98){_0x1dcd8b[_0xa42f('0x19')](0x194);}return _0x313a98;};}function handleError(_0xcd913a,_0x389b8e){_0x389b8e=_0x389b8e||0x1f4;return function(_0x4e1412){logger['error'](_0x4e1412[_0xa42f('0x28')]);if(_0x4e1412[_0xa42f('0x29')]){delete _0x4e1412[_0xa42f('0x29')];}_0xcd913a[_0xa42f('0x1a')](_0x389b8e)['send'](_0x4e1412);};}exports[_0xa42f('0x2a')]=function(_0x26df5e,_0xc808f8){var _0x12d6df={},_0x2eee65={},_0x43dc00={'count':0x0,'rows':[]};return db[_0xa42f('0x2b')][_0xa42f('0x2c')]()[_0xa42f('0x24')](function(_0x21027f){_0x2eee65[_0xa42f('0x2d')]=_[_0xa42f('0x2e')](_0x21027f);_0x2eee65[_0xa42f('0x2f')]=_['keys'](_0x26df5e['query']);_0x2eee65[_0xa42f('0x30')]=_['intersection'](_0x2eee65['model'],_0x2eee65[_0xa42f('0x2f')]);_0x12d6df[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x2eee65['model'],qs[_0xa42f('0x33')](_0x26df5e[_0xa42f('0x2f')]['fields']));_0x12d6df['attributes']=_0x12d6df[_0xa42f('0x31')][_0xa42f('0x34')]?_0x12d6df['attributes']:_0x2eee65['model'];if(!_0x26df5e['query']['hasOwnProperty'](_0xa42f('0x35'))){_0x12d6df[_0xa42f('0x1c')]=qs[_0xa42f('0x1c')](_0x26df5e['query'][_0xa42f('0x1c')]);_0x12d6df[_0xa42f('0x1f')]=qs[_0xa42f('0x1f')](_0x26df5e[_0xa42f('0x2f')][_0xa42f('0x1f')]);}_0x12d6df[_0xa42f('0x36')]=qs[_0xa42f('0x37')](_0x26df5e[_0xa42f('0x2f')][_0xa42f('0x37')]);_0x12d6df['where']=qs['filters'](_[_0xa42f('0x38')](_0x26df5e[_0xa42f('0x2f')],_0x2eee65[_0xa42f('0x30')]),_0x21027f);if(_0x26df5e[_0xa42f('0x2f')][_0xa42f('0x39')]){_0x12d6df['where']=_['merge'](_0x12d6df[_0xa42f('0x3a')],{'$or':_[_0xa42f('0x3b')](_0x12d6df[_0xa42f('0x31')],function(_0x1ec3c3){var _0x207bf4={};_0x207bf4[_0x1ec3c3]={'$like':'%'+_0x26df5e[_0xa42f('0x2f')]['filter']+'%'};return _0x207bf4;})});}_0x12d6df=_[_0xa42f('0x3c')]({},_0x12d6df,_0x26df5e[_0xa42f('0x3d')]);var _0x5e869a={'where':_0x12d6df[_0xa42f('0x3a')]};return db[_0xa42f('0x2b')]['count'](_0x5e869a)[_0xa42f('0x24')](function(_0x454ba1){_0x43dc00[_0xa42f('0x1e')]=_0x454ba1;if(_0x26df5e[_0xa42f('0x2f')][_0xa42f('0x3e')]){_0x12d6df[_0xa42f('0x3f')]=[{'all':!![]}];}return db[_0xa42f('0x2b')][_0xa42f('0x40')](_0x12d6df);})[_0xa42f('0x24')](function(_0x1d671b){_0x43dc00[_0xa42f('0x41')]=_0x1d671b;return _0x43dc00;})[_0xa42f('0x24')](respondWithFilteredResult(_0xc808f8,_0x12d6df))[_0xa42f('0x42')](handleError(_0xc808f8,null));})[_0xa42f('0x42')](handleError(_0xc808f8,null));};exports[_0xa42f('0x43')]=function(_0x3238f1,_0x4e7d05){var _0x47101f={'raw':![],'where':{'id':_0x3238f1[_0xa42f('0x44')]['id']}},_0x4d2665={};_0x4d2665[_0xa42f('0x2d')]=_[_0xa42f('0x2e')](db[_0xa42f('0x2b')]['rawAttributes']);_0x4d2665[_0xa42f('0x2f')]=_[_0xa42f('0x2e')](_0x3238f1['query']);_0x4d2665[_0xa42f('0x30')]=_[_0xa42f('0x32')](_0x4d2665[_0xa42f('0x2d')],_0x4d2665[_0xa42f('0x2f')]);_0x47101f[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x4d2665[_0xa42f('0x2d')],qs[_0xa42f('0x33')](_0x3238f1['query'][_0xa42f('0x33')]));_0x47101f[_0xa42f('0x31')]=_0x47101f['attributes'][_0xa42f('0x34')]?_0x47101f[_0xa42f('0x31')]:_0x4d2665[_0xa42f('0x2d')];if(_0x3238f1[_0xa42f('0x2f')]['includeAll']){_0x47101f[_0xa42f('0x3f')]=[{'all':!![]}];}_0x47101f=_[_0xa42f('0x3c')]({},_0x47101f,_0x3238f1['options']);return db[_0xa42f('0x2b')][_0xa42f('0x45')](_0x47101f)['then'](handleEntityNotFound(_0x4e7d05,null))['then'](respondWithResult(_0x4e7d05,null))[_0xa42f('0x42')](handleError(_0x4e7d05,null));};exports[_0xa42f('0x46')]=function(_0xbedf20,_0x4bbc17){return db[_0xa42f('0x2b')][_0xa42f('0x46')](_0xbedf20['body'],{})[_0xa42f('0x24')](function(_0x27e6b9){var _0x4e862b=_0xbedf20[_0xa42f('0x47')][_0xa42f('0x25')]({'plain':!![]});if(!_0x4e862b)throw new Error(_0xa42f('0x48'));if(_0x4e862b[_0xa42f('0x49')]===_0xa42f('0x47')){var _0x278484=_0x27e6b9[_0xa42f('0x25')]({'plain':!![]});var _0x32d583=_0xa42f('0x26');return db[_0xa42f('0x4a')][_0xa42f('0x45')]({'where':{'name':_0x32d583,'userProfileId':_0x4e862b[_0xa42f('0x4b')]},'raw':!![]})[_0xa42f('0x24')](function(_0x4afdf8){if(_0x4afdf8&&_0x4afdf8[_0xa42f('0x4c')]===0x0){return db[_0xa42f('0x4d')][_0xa42f('0x46')]({'name':_0x278484['name'],'resourceId':_0x278484['id'],'type':_0x4afdf8[_0xa42f('0x29')],'sectionId':_0x4afdf8['id']},{})[_0xa42f('0x24')](function(){return _0x27e6b9;});}else{return _0x27e6b9;}})[_0xa42f('0x42')](function(_0x513581){logger[_0xa42f('0x4e')](_0xa42f('0x4f'),_0x513581);throw _0x513581;});}return _0x27e6b9;})[_0xa42f('0x24')](respondWithResult(_0x4bbc17,0xc9))[_0xa42f('0x42')](handleError(_0x4bbc17,null));};exports[_0xa42f('0x50')]=function(_0x4f95b5,_0x5c05c9){if(_0x4f95b5['body']['id']){delete _0x4f95b5[_0xa42f('0x51')]['id'];}return db[_0xa42f('0x2b')]['find']({'where':{'id':_0x4f95b5['params']['id']}})[_0xa42f('0x24')](handleEntityNotFound(_0x5c05c9,null))['then'](saveUpdates(_0x4f95b5[_0xa42f('0x51')],null))[_0xa42f('0x24')](respondWithResult(_0x5c05c9,null))[_0xa42f('0x42')](handleError(_0x5c05c9,null));};exports[_0xa42f('0x27')]=function(_0x5706c0,_0x9de912){return db['CmCompany'][_0xa42f('0x45')]({'where':{'id':_0x5706c0['params']['id']}})[_0xa42f('0x24')](handleEntityNotFound(_0x9de912,null))[_0xa42f('0x24')](removeEntity(_0x9de912,null))[_0xa42f('0x42')](handleError(_0x9de912,null));};exports[_0xa42f('0x2c')]=function(_0x80545e,_0x3e0017){return db[_0xa42f('0x2b')]['describe']()[_0xa42f('0x24')](respondWithResult(_0x3e0017,null))[_0xa42f('0x42')](handleError(_0x3e0017,null));};exports[_0xa42f('0x52')]=function(_0xf2b407,_0x3aa3ec,_0x843861){return db[_0xa42f('0x53')]['find']({'where':{'id':_0xf2b407[_0xa42f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aa3ec,null))['then'](function(_0x29acb4){if(_0x29acb4){return _0x29acb4[_0xa42f('0x52')](_0xf2b407[_0xa42f('0x51')][_0xa42f('0x54')],_[_0xa42f('0x55')](_0xf2b407[_0xa42f('0x51')],['ids','id'])||{});}})[_0xa42f('0x24')](respondWithResult(_0x3aa3ec,null))[_0xa42f('0x42')](handleError(_0x3aa3ec,null));};exports[_0xa42f('0x56')]=function(_0x59effa,_0x3a802a,_0x4dfb){var _0x3d7529={};var _0x5d97b2={};var _0x3eac50;var _0x1fa22b;return db[_0xa42f('0x2b')]['findOne']({'where':{'id':_0x59effa['params']['id']}})[_0xa42f('0x24')](handleEntityNotFound(_0x3a802a,null))['then'](function(_0x29a7fa){if(_0x29a7fa){_0x3eac50=_0x29a7fa;_0x5d97b2[_0xa42f('0x2d')]=_[_0xa42f('0x2e')](db['CmContact'][_0xa42f('0x57')]);_0x5d97b2['query']=_[_0xa42f('0x2e')](_0x59effa[_0xa42f('0x2f')]);_0x5d97b2[_0xa42f('0x30')]=_[_0xa42f('0x32')](_0x5d97b2[_0xa42f('0x2d')],_0x5d97b2['query']);_0x3d7529[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x5d97b2['model'],qs[_0xa42f('0x33')](_0x59effa[_0xa42f('0x2f')]['fields']));_0x3d7529[_0xa42f('0x31')]=_0x3d7529[_0xa42f('0x31')][_0xa42f('0x34')]?_0x3d7529[_0xa42f('0x31')]:_0x5d97b2['model'];_0x3d7529['order']=qs[_0xa42f('0x37')](_0x59effa[_0xa42f('0x2f')][_0xa42f('0x37')]);_0x3d7529[_0xa42f('0x3a')]=qs[_0xa42f('0x30')](_[_0xa42f('0x38')](_0x59effa['query'],_0x5d97b2[_0xa42f('0x30')]));if(_0x59effa['query'][_0xa42f('0x39')]){_0x3d7529[_0xa42f('0x3a')]=_[_0xa42f('0x3c')](_0x3d7529[_0xa42f('0x3a')],{'$or':_[_0xa42f('0x3b')](_0x3d7529[_0xa42f('0x31')],function(_0x410d0b){var _0x1d769f={};_0x1d769f[_0x410d0b]={'$like':'%'+_0x59effa[_0xa42f('0x2f')][_0xa42f('0x39')]+'%'};return _0x1d769f;})});}_0x3d7529=_['merge']({},_0x3d7529,_0x59effa[_0xa42f('0x3d')]);return _0x3eac50[_0xa42f('0x56')](_0x3d7529);}})['then'](function(_0x53b230){if(_0x53b230){_0x1fa22b=_0x53b230[_0xa42f('0x34')];if(!_0x59effa[_0xa42f('0x2f')][_0xa42f('0x58')](_0xa42f('0x35'))){_0x3d7529[_0xa42f('0x1c')]=qs[_0xa42f('0x1c')](_0x59effa[_0xa42f('0x2f')][_0xa42f('0x1c')]);_0x3d7529['offset']=qs[_0xa42f('0x1f')](_0x59effa[_0xa42f('0x2f')][_0xa42f('0x1f')]);}return _0x3eac50[_0xa42f('0x56')](_0x3d7529);}})['then'](function(_0x1700ff){if(_0x1700ff){return _0x1700ff?{'count':_0x1fa22b,'rows':_0x1700ff}:null;}})[_0xa42f('0x24')](respondWithResult(_0x3a802a,null))[_0xa42f('0x42')](handleError(_0x3a802a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 20a7e6f..0cc8d36 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 _0xae3d=['exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xae3d,0x1c6));var _0xdae3=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xae3d[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0xdae3('0x0'));var util=require(_0xdae3('0x1'));var logger=require(_0xdae3('0x2'))(_0xdae3('0x3'));var moment=require(_0xdae3('0x4'));var BPromise=require(_0xdae3('0x5'));var rp=require(_0xdae3('0x6'));var fs=require('fs');var path=require(_0xdae3('0x7'));var rimraf=require(_0xdae3('0x8'));var config=require(_0xdae3('0x9'));var attributes=require(_0xdae3('0xa'));module[_0xdae3('0xb')]=function(_0x29a06d,_0xadf273){return _0x29a06d[_0xdae3('0xc')](_0xdae3('0xd'),attributes,{'tableName':_0xdae3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee9=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ee9,0x1e8));var _0x91ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1ee9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x91ee('0x0'));var util=require(_0x91ee('0x1'));var logger=require('../../config/logger')(_0x91ee('0x2'));var moment=require(_0x91ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x91ee('0x4'));var fs=require('fs');var path=require(_0x91ee('0x5'));var rimraf=require(_0x91ee('0x6'));var config=require(_0x91ee('0x7'));var attributes=require(_0x91ee('0x8'));module[_0x91ee('0x9')]=function(_0x3fb162,_0x12e31b){return _0x3fb162['define'](_0x91ee('0xa'),attributes,{'tableName':_0x91ee('0xb'),'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 9c212bd..f1c149c 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 _0x89f6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x18e0bf,_0x2b3088){var _0x13c438=function(_0x377a84){while(--_0x377a84){_0x18e0bf['push'](_0x18e0bf['shift']());}};_0x13c438(++_0x2b3088);}(_0x89f6,0x1e3));var _0x689f=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x89f6[_0x454165];return _0x56db53;};'use strict';var _=require(_0x689f('0x0'));var util=require(_0x689f('0x1'));var moment=require(_0x689f('0x2'));var BPromise=require(_0x689f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x689f('0x4'));var db=require(_0x689f('0x5'))['db'];var utils=require(_0x689f('0x6'));var logger=require('../../config/logger')(_0x689f('0x7'));var config=require(_0x689f('0x8'));var jayson=require(_0x689f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3da237,_0x3748c7,_0x3f78cc){return new BPromise(function(_0x1c0912,_0x1b6321){return client[_0x689f('0xa')](_0x3da237,_0x3f78cc)[_0x689f('0xb')](function(_0x309645){logger[_0x689f('0xc')](_0x689f('0xd'),_0x3748c7,'request\x20sent');logger[_0x689f('0xe')](_0x689f('0xf'),_0x3748c7,_0x689f('0x10'),JSON['stringify'](_0x309645));if(_0x309645[_0x689f('0x11')]){if(_0x309645[_0x689f('0x11')][_0x689f('0x12')]===0x1f4){logger['error'](_0x689f('0xd'),_0x3748c7,_0x309645[_0x689f('0x11')][_0x689f('0x13')]);return _0x1b6321(_0x309645[_0x689f('0x11')]['message']);}logger[_0x689f('0x11')](_0x689f('0xd'),_0x3748c7,_0x309645[_0x689f('0x11')][_0x689f('0x13')]);return _0x1c0912(_0x309645['error'][_0x689f('0x13')]);}else{logger[_0x689f('0xc')](_0x689f('0xd'),_0x3748c7,'request\x20sent');_0x1c0912(_0x309645['result'][_0x689f('0x13')]);}})[_0x689f('0x14')](function(_0x292bd1){logger['error'](_0x689f('0xd'),_0x3748c7,_0x292bd1);_0x1b6321(_0x292bd1);});});} \ No newline at end of file +var _0x5e0e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message'];(function(_0x1a7c1c,_0x492841){var _0xac2979=function(_0x3fa328){while(--_0x3fa328){_0x1a7c1c['push'](_0x1a7c1c['shift']());}};_0xac2979(++_0x492841);}(_0x5e0e,0xca));var _0xe5e0=function(_0x4a6992,_0x15fed3){_0x4a6992=_0x4a6992-0x0;var _0x5cbaee=_0x5e0e[_0x4a6992];return _0x5cbaee;};'use strict';var _=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var moment=require(_0xe5e0('0x2'));var BPromise=require(_0xe5e0('0x3'));var rs=require(_0xe5e0('0x4'));var fs=require('fs');var Redis=require(_0xe5e0('0x5'));var db=require(_0xe5e0('0x6'))['db'];var utils=require(_0xe5e0('0x7'));var logger=require(_0xe5e0('0x8'))('rpc');var config=require(_0xe5e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe5e0('0xa')][_0xe5e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cf7f4,_0x172b61,_0x380e58){return new BPromise(function(_0x2e6200,_0x328f92){return client[_0xe5e0('0xc')](_0x2cf7f4,_0x380e58)[_0xe5e0('0xd')](function(_0x4e6395){logger[_0xe5e0('0xe')]('CmCompany,\x20%s,\x20%s',_0x172b61,_0xe5e0('0xf'));logger[_0xe5e0('0x10')](_0xe5e0('0x11'),_0x172b61,_0xe5e0('0xf'),JSON[_0xe5e0('0x12')](_0x4e6395));if(_0x4e6395[_0xe5e0('0x13')]){if(_0x4e6395[_0xe5e0('0x13')][_0xe5e0('0x14')]===0x1f4){logger[_0xe5e0('0x13')](_0xe5e0('0x15'),_0x172b61,_0x4e6395[_0xe5e0('0x13')][_0xe5e0('0x16')]);return _0x328f92(_0x4e6395[_0xe5e0('0x13')]['message']);}logger[_0xe5e0('0x13')](_0xe5e0('0x15'),_0x172b61,_0x4e6395[_0xe5e0('0x13')][_0xe5e0('0x16')]);return _0x2e6200(_0x4e6395[_0xe5e0('0x13')][_0xe5e0('0x16')]);}else{logger[_0xe5e0('0xe')](_0xe5e0('0x15'),_0x172b61,_0xe5e0('0xf'));_0x2e6200(_0x4e6395[_0xe5e0('0x17')][_0xe5e0('0x16')]);}})[_0xe5e0('0x18')](function(_0x4c2b37){logger[_0xe5e0('0x13')](_0xe5e0('0x15'),_0x172b61,_0x4c2b37);_0x328f92(_0x4c2b37);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 650f81d..3ee4794 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 _0x9820=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x496d54,_0x4fe687){var _0x239ad7=function(_0x508119){while(--_0x508119){_0x496d54['push'](_0x496d54['shift']());}};_0x239ad7(++_0x4fe687);}(_0x9820,0x93));var _0x0982=function(_0x3f61ad,_0x2b6fb4){_0x3f61ad=_0x3f61ad-0x0;var _0x338321=_0x9820[_0x3f61ad];return _0x338321;};'use strict';var multer=require(_0x0982('0x0'));var util=require(_0x0982('0x1'));var path=require(_0x0982('0x2'));var timeout=require(_0x0982('0x3'));var express=require(_0x0982('0x4'));var router=express[_0x0982('0x5')]();var fs_extra=require(_0x0982('0x6'));var auth=require(_0x0982('0x7'));var interaction=require(_0x0982('0x8'));var config=require(_0x0982('0x9'));var controller=require(_0x0982('0xa'));router[_0x0982('0xb')]('/',auth[_0x0982('0xc')](),controller[_0x0982('0xd')]);router[_0x0982('0xb')](_0x0982('0xe'),auth[_0x0982('0xc')](),controller[_0x0982('0xf')]);router[_0x0982('0xb')]('/:id',auth[_0x0982('0xc')](),controller[_0x0982('0x10')]);router['get'](_0x0982('0x11'),auth[_0x0982('0xc')](),controller['getContacts']);router[_0x0982('0x12')]('/',auth[_0x0982('0xc')](),controller[_0x0982('0x13')]);router['post'](_0x0982('0x11'),auth[_0x0982('0xc')](),controller['addContacts']);router[_0x0982('0x14')](_0x0982('0x15'),auth[_0x0982('0xc')](),controller[_0x0982('0x16')]);router[_0x0982('0x17')](_0x0982('0x15'),auth['isAuthenticated'](),controller[_0x0982('0x18')]);module['exports']=router; \ No newline at end of file +var _0x91cf=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','create','addContacts','put','delete','destroy','exports','multer','util','path'];(function(_0x816b3d,_0x250840){var _0x4f6b75=function(_0x5992ab){while(--_0x5992ab){_0x816b3d['push'](_0x816b3d['shift']());}};_0x4f6b75(++_0x250840);}(_0x91cf,0x17d));var _0xf91c=function(_0x5a56cc,_0x29650c){_0x5a56cc=_0x5a56cc-0x0;var _0x589caa=_0x91cf[_0x5a56cc];return _0x589caa;};'use strict';var multer=require(_0xf91c('0x0'));var util=require(_0xf91c('0x1'));var path=require(_0xf91c('0x2'));var timeout=require(_0xf91c('0x3'));var express=require(_0xf91c('0x4'));var router=express['Router']();var fs_extra=require(_0xf91c('0x5'));var auth=require(_0xf91c('0x6'));var interaction=require(_0xf91c('0x7'));var config=require(_0xf91c('0x8'));var controller=require(_0xf91c('0x9'));router[_0xf91c('0xa')]('/',auth[_0xf91c('0xb')](),controller[_0xf91c('0xc')]);router[_0xf91c('0xa')](_0xf91c('0xd'),auth[_0xf91c('0xb')](),controller['describe']);router[_0xf91c('0xa')](_0xf91c('0xe'),auth['isAuthenticated'](),controller[_0xf91c('0xf')]);router[_0xf91c('0xa')](_0xf91c('0x10'),auth[_0xf91c('0xb')](),controller[_0xf91c('0x11')]);router['post']('/',auth[_0xf91c('0xb')](),controller[_0xf91c('0x12')]);router['post'](_0xf91c('0x10'),auth['isAuthenticated'](),controller[_0xf91c('0x13')]);router[_0xf91c('0x14')](_0xf91c('0xe'),auth[_0xf91c('0xb')](),controller['update']);router[_0xf91c('0x15')](_0xf91c('0xe'),auth[_0xf91c('0xb')](),controller[_0xf91c('0x16')]);module[_0xf91c('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 3c15709..4466878 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 _0xed08=['TEXT','INTEGER','UNSIGNED','NOW','STRING'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xed08,0x162));var _0x8ed0=function(_0x50ecb7,_0x567811){_0x50ecb7=_0x50ecb7-0x0;var _0x4fa2fc=_0xed08[_0x50ecb7];return _0x4fa2fc;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x8ed0('0x0')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8ed0('0x0')]},'street':{'type':Sequelize[_0x8ed0('0x0')]},'postalCode':{'type':Sequelize[_0x8ed0('0x0')]},'city':{'type':Sequelize[_0x8ed0('0x0')]},'country':{'type':Sequelize[_0x8ed0('0x0')]},'dateOfBirth':{'type':Sequelize[_0x8ed0('0x0')]},'description':{'type':Sequelize[_0x8ed0('0x1')]},'phone':{'type':Sequelize[_0x8ed0('0x0')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8ed0('0x0')]},'email':{'type':Sequelize[_0x8ed0('0x0')]},'url':{'type':Sequelize[_0x8ed0('0x0')]},'facebook':{'type':Sequelize[_0x8ed0('0x0')]},'fb_data':{'type':Sequelize[_0x8ed0('0x0')]},'twitter':{'type':Sequelize[_0x8ed0('0x0')]},'skype':{'type':Sequelize[_0x8ed0('0x0')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x8ed0('0x0')]},'line':{'type':Sequelize[_0x8ed0('0x0')]},'wechat':{'type':Sequelize[_0x8ed0('0x0')]},'telegram':{'type':Sequelize[_0x8ed0('0x0')]},'UserId':{'type':Sequelize[_0x8ed0('0x2')]},'priority':{'type':Sequelize[_0x8ed0('0x2')](0x2)[_0x8ed0('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8ed0('0x4')]}}; \ No newline at end of file +var _0x57e7=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x150cc4,_0x15e9f1){var _0x22a995=function(_0x114834){while(--_0x114834){_0x150cc4['push'](_0x150cc4['shift']());}};_0x22a995(++_0x15e9f1);}(_0x57e7,0x118));var _0x757e=function(_0x4deb33,_0x5ae407){_0x4deb33=_0x4deb33-0x0;var _0xaa034=_0x57e7[_0x4deb33];return _0xaa034;};'use strict';var _=require('lodash');var Sequelize=require(_0x757e('0x0'));module[_0x757e('0x1')]={'firstName':{'type':Sequelize[_0x757e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x757e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x757e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x757e('0x2')]},'description':{'type':Sequelize[_0x757e('0x3')]},'phone':{'type':Sequelize[_0x757e('0x2')]},'mobile':{'type':Sequelize[_0x757e('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x757e('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x757e('0x2')]},'twitter':{'type':Sequelize[_0x757e('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x757e('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x757e('0x4')]},'priority':{'type':Sequelize[_0x757e('0x4')](0x2)[_0x757e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x757e('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2574fd4..70fcb66 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 _0xd739=['secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','subject','externalUrl','threadId','startCase','Interaction','flatten','sortBy','reverse','slice','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','destroy','then','error','stack','name','send','keys','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','select','field','color','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','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','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','c.firstName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','describe','columnName','displayName','CmCustomField','findAll','alias','custom','values','merge','body','from','get','mergeWith','tags','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','duplicates','$or','findOrCreate','spread','show','$and','omit','format','pickBy','table','setFields','id\x20=\x20?','params','toParam','phone','getTags','rawAttributes','filters','sort','pick','options','setTags','ids','getHoppers','ContactId','includeAll','include','CmHopperHistory','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','starttime','endtime','duration','note','UserId','fullname','createdAt','findAndCountAll','chat','Website','Account','disposition'];(function(_0x2b9148,_0x2b7b9c){var _0x295e46=function(_0x1dedee){while(--_0x1dedee){_0x2b9148['push'](_0x2b9148['shift']());}};_0x295e46(++_0x2b7b9c);}(_0xd739,0x13f));var _0x9d73=function(_0x4aa4ff,_0x29f749){_0x4aa4ff=_0x4aa4ff-0x0;var _0x2e60f3=_0xd739[_0x4aa4ff];return _0x2e60f3;};'use strict';var emlformat=require(_0x9d73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d73('0x1'));var jsonpatch=require(_0x9d73('0x2'));var rp=require(_0x9d73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d73('0x4'));var util=require(_0x9d73('0x5'));var path=require(_0x9d73('0x6'));var sox=require(_0x9d73('0x7'));var csv=require(_0x9d73('0x8'));var ejs=require(_0x9d73('0x9'));var fs=require('fs');var fs_extra=require(_0x9d73('0xa'));var _=require(_0x9d73('0xb'));var squel=require(_0x9d73('0xc'));var crypto=require(_0x9d73('0xd'));var jsforce=require(_0x9d73('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9d73('0x8'));var querystring=require(_0x9d73('0xf'));var Papa=require(_0x9d73('0x10'));var Redis=require('ioredis');var authService=require(_0x9d73('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d73('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d73('0x13'))('api');var utils=require(_0x9d73('0x14'));var config=require(_0x9d73('0x15'));var licenseUtil=require(_0x9d73('0x16'));var db=require(_0x9d73('0x17'))['db'];config[_0x9d73('0x18')]=_['defaults'](config['redis'],{'host':_0x9d73('0x19'),'port':0x18eb});var socket=require(_0x9d73('0x1a'))(new Redis(config[_0x9d73('0x18')]));require(_0x9d73('0x1b'))[_0x9d73('0x1c')](socket);function respondWithStatusCode(_0xf6574e,_0x58d903){_0x58d903=_0x58d903||0xcc;return function(_0x3b5ece){if(_0x3b5ece){return _0xf6574e[_0x9d73('0x1d')](_0x58d903);}return _0xf6574e['status'](_0x58d903)[_0x9d73('0x1e')]();};}function respondWithResult(_0x2217c6,_0x5e1550){_0x5e1550=_0x5e1550||0xc8;return function(_0x5b6fb0){if(_0x5b6fb0){return _0x2217c6['status'](_0x5e1550)[_0x9d73('0x1f')](_0x5b6fb0);}};}function respondWithFilteredResult(_0x18466e,_0x31263a){return function(_0x107f0e){if(_0x107f0e){var _0x42fe67=typeof _0x31263a[_0x9d73('0x20')]===_0x9d73('0x21')&&typeof _0x31263a[_0x9d73('0x22')]===_0x9d73('0x21');var _0x458cda=_0x107f0e[_0x9d73('0x23')];var _0x4129b7=_0x42fe67?0x0:_0x31263a[_0x9d73('0x20')];var _0x1e70e7=_0x42fe67?_0x107f0e['count']:_0x31263a[_0x9d73('0x20')]+_0x31263a[_0x9d73('0x22')];var _0x1ea3b8;if(_0x1e70e7>=_0x458cda){_0x1e70e7=_0x458cda;_0x1ea3b8=0xc8;}else{_0x1ea3b8=0xce;}_0x18466e[_0x9d73('0x24')](_0x1ea3b8);return _0x18466e[_0x9d73('0x25')]('Content-Range',_0x4129b7+'-'+_0x1e70e7+'/'+_0x458cda)[_0x9d73('0x1f')](_0x107f0e);}return null;};}function patchUpdates(_0x1ed0d1){return function(_0x134a38){try{jsonpatch[_0x9d73('0x26')](_0x134a38,_0x1ed0d1,!![]);}catch(_0x3fbe38){return BPromise[_0x9d73('0x27')](_0x3fbe38);}return _0x134a38['save']();};}function saveUpdates(_0x4edee6,_0x15cf59){return function(_0x588c17){if(_0x588c17){return _0x588c17[_0x9d73('0x28')](_0x4edee6)['then'](function(_0x5d08b5){return _0x5d08b5;});}return null;};}function removeEntity(_0x2fd3ce,_0x1908ae){return function(_0x2da7be){if(_0x2da7be){return _0x2da7be[_0x9d73('0x29')]()[_0x9d73('0x2a')](function(){_0x2fd3ce['status'](0xcc)[_0x9d73('0x1e')]();});}};}function handleEntityNotFound(_0x2517f3,_0x5e753c){return function(_0x440583){if(!_0x440583){_0x2517f3['sendStatus'](0x194);}return _0x440583;};}function handleError(_0x366036,_0x1d8ac3){_0x1d8ac3=_0x1d8ac3||0x1f4;return function(_0x127fd7){logger[_0x9d73('0x2b')](_0x127fd7[_0x9d73('0x2c')]);if(_0x127fd7[_0x9d73('0x2d')]){delete _0x127fd7[_0x9d73('0x2d')];}_0x366036[_0x9d73('0x24')](_0x1d8ac3)[_0x9d73('0x2e')](_0x127fd7);};}exports['index']=function(_0x59eaf0,_0x696eb6){var _0x1e470b={},_0x3efc06={},_0x5c8b54={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x183a87){var _0x37faca=[];for(var _0x4a49e0=0x0;_0x4a49e00x1){_0x27be0e['or'](_0x9d73('0x6b'),qs[_0x9d73('0x6c')](_0x123d71),null);}else{if(qs[_0x9d73('0x6d')](_0x123d71)){_0x27be0e['or']('c.id\x20LIKE\x20?',_0x123d71+'%');_0x27be0e['or']('c.phone\x20LIKE\x20?',_0x123d71+'%');_0x27be0e['or'](_0x9d73('0x6e'),_0x123d71+'%');_0x27be0e['or'](_0x9d73('0x6f'),_0x123d71+'%');}else if(qs[_0x9d73('0x70')](_0x123d71)){_0x27be0e['or'](_0x9d73('0x71'),_0x123d71+'%');}else{_0x27be0e['or'](_0x9d73('0x72'),'%'+_0x123d71+'%');_0x27be0e['or']('c.lastName\x20LIKE\x20?','%'+_0x123d71+'%');_0x27be0e['or']('c.email\x20LIKE\x20?','%'+_0x123d71+'%');}}}}_0x59e940['where'](_0x27be0e);_0x59e940[_0x9d73('0x73')](_0x9d73('0x74'));var _0x257030={'type':db[_0x9d73('0x75')][_0x9d73('0x76')][_0x9d73('0x77')],'raw':!![]};var _0x2fcb70=_0x59e940['clone']()['field']('c.id');if(_0x1e470b['order']){_0x1e470b[_0x9d73('0x40')][_0x9d73('0x55')](function(_0x32a9a3){_0x59e940['order']('c.'+_0x32a9a3[0x0],_0x32a9a3[0x1]===_0x9d73('0x78')?![]:!![]);});}if(!_[_0x9d73('0x63')](_0x16d4e5)){_0x59e940[_0x9d73('0x79')](_0x4cb317);_0x2fcb70[_0x9d73('0x41')](_0x9d73('0x7a'),_0x16d4e5);}BPromise[_0x9d73('0x7b')]()[_0x9d73('0x2a')](function(){if(!_0x19f556)return;if(_0x59eaf0[_0x9d73('0x7c')][_0x9d73('0x7d')]!==_0x9d73('0x7e'))return;if(!_[_0x9d73('0x7f')](_0x19f556[_0x9d73('0x50')],[_0x9d73('0x43'),'User'])){return _0x59eaf0[_0x9d73('0x7c')][_0x9d73('0x80')]({'attributes':['id'],'raw':!![]})['then'](function(_0x55e2da){if(_[_0x9d73('0x63')](_0x55e2da)){_0x2fcb70[_0x9d73('0x41')](_0x9d73('0x81'));_0x59e940['where'](_0x9d73('0x81'));}else{_0x2fcb70['where']('c.ListId\x20IN\x20?',_['map'](_0x55e2da,'id'));_0x59e940[_0x9d73('0x41')]('c.ListId\x20IN\x20?',_[_0x9d73('0x54')](_0x55e2da,'id'));}});}})[_0x9d73('0x2a')](function(){if(_0x59eaf0[_0x9d73('0x7c')][_0x9d73('0x7d')]===_0x9d73('0x7e')&&!_0x19f556&&!_0x59eaf0[_0x9d73('0x39')][_0x9d73('0x64')])return[];return db[_0x9d73('0x82')][_0x9d73('0x39')](_0x2fcb70[_0x9d73('0x83')](),_0x257030);})['then'](function(_0x1c2025){_0x5c8b54['count']=_0x1c2025['length'];if(_0x5c8b54[_0x9d73('0x23')]===0x0)return[];return db['sequelize'][_0x9d73('0x39')](_0x29f630[_0x9d73('0x83')](),_0x257030)[_0x9d73('0x2a')](function(_0x4c1bed){_0x262036=_[_0x9d73('0x84')](_0x4c1bed,'id');_0x257030=_['merge'](_0x257030,{'model':db[_0x9d73('0x85')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x59eaf0[_0x9d73('0x39')]['fields']){_0x1e470b['attributes'][_0x9d73('0x55')](function(_0x105b75){_0x59e940['field']('c.'+_0x105b75);});}else{_0x59e940['field'](_0x9d73('0x74'));_0x59e940['field'](_0x9d73('0x86'));_0x59e940[_0x9d73('0x43')]('c.lastName');_0x59e940['field'](_0x9d73('0x87'));_0x59e940['field']('c.mobile');_0x59e940[_0x9d73('0x43')](_0x9d73('0x88'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x89'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x8a'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x8b'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x8c'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x8d'));_0x59e940[_0x9d73('0x43')](_0x9d73('0x8e'),_0x9d73('0x8f'));}if(_0x1e470b[_0x9d73('0x22')])_0x59e940[_0x9d73('0x22')](_0x1e470b['limit']);if(_0x1e470b[_0x9d73('0x20')])_0x59e940[_0x9d73('0x20')](_0x1e470b[_0x9d73('0x20')]);return db[_0x9d73('0x82')][_0x9d73('0x39')](_0x59e940[_0x9d73('0x83')](),_0x257030);});})['then'](function(_0x4da0ef){_0x4da0ef[_0x9d73('0x55')](function(_0x509bfd){if(_0x509bfd['TagIds']){_0x509bfd[_0x9d73('0x90')]=[];_0x509bfd['TagIds'][_0x9d73('0x53')](',')[_0x9d73('0x55')](function(_0x4f3673){_0x509bfd[_0x9d73('0x90')][_0x9d73('0x33')](_0x262036[_0x4f3673]);});}delete _0x509bfd[_0x9d73('0x8f')];});_0x5c8b54[_0x9d73('0x91')]=_0x4da0ef;return _0x5c8b54;})['then'](respondWithFilteredResult(_0x696eb6,_0x1e470b));})[_0x9d73('0x92')](handleError(_0x696eb6,null));};exports[_0x9d73('0x29')]=function(_0x52800b,_0x3e6f4e){return db[_0x9d73('0x85')][_0x9d73('0x93')]({'where':{'id':_0x52800b['params']['id']}})['then'](handleEntityNotFound(_0x3e6f4e,null))[_0x9d73('0x2a')](removeEntity(_0x3e6f4e,null))[_0x9d73('0x92')](handleError(_0x3e6f4e,null));};exports[_0x9d73('0x94')]=function(_0x92086f,_0x5053c4){return db['CmContact'][_0x9d73('0x94')]()['then'](function(_0x594884){delete _0x594884['tags'];for(var _0x2cd8d6=0x0;_0x2cd8d6=_0x447555){_0x64161e=_0x447555;_0x15cba5=0xc8;}else{_0x15cba5=0xce;}_0x1da7e0[_0x473e('0x1d')](_0x15cba5);return _0x1da7e0['set'](_0x473e('0x24'),_0x8cec2b+'-'+_0x64161e+'/'+_0x447555)[_0x473e('0x1f')](_0x71a053);}return null;};}function patchUpdates(_0x126c7d){return function(_0x3edf69){try{jsonpatch['apply'](_0x3edf69,_0x126c7d,!![]);}catch(_0x3af72f){return BPromise[_0x473e('0x25')](_0x3af72f);}return _0x3edf69[_0x473e('0x26')]();};}function saveUpdates(_0x2f7450,_0x157893){return function(_0x4d4419){if(_0x4d4419){return _0x4d4419[_0x473e('0x27')](_0x2f7450)['then'](function(_0x4dacdc){return _0x4dacdc;});}return null;};}function removeEntity(_0x2987e1,_0x561607){return function(_0x2e5d88){if(_0x2e5d88){return _0x2e5d88[_0x473e('0x28')]()[_0x473e('0x29')](function(){_0x2987e1['status'](0xcc)[_0x473e('0x1e')]();});}};}function handleEntityNotFound(_0x340507,_0x170e6d){return function(_0x2d95b4){if(!_0x2d95b4){_0x340507[_0x473e('0x1c')](0x194);}return _0x2d95b4;};}function handleError(_0x399cbb,_0x209592){_0x209592=_0x209592||0x1f4;return function(_0x5eb60b){logger[_0x473e('0x2a')](_0x5eb60b[_0x473e('0x2b')]);if(_0x5eb60b[_0x473e('0x2c')]){delete _0x5eb60b['name'];}_0x399cbb[_0x473e('0x1d')](_0x209592)[_0x473e('0x2d')](_0x5eb60b);};}exports['index']=function(_0x3c7d61,_0x5113f5){var _0x2e03ef={},_0x58d9c2={},_0x503303={'count':0x0,'rows':[]};return db[_0x473e('0x2e')][_0x473e('0x2f')]()['then'](function(_0xeb5a58){var _0x5de2ae=[];for(var _0x5ee6b2=0x0;_0x5ee6b20x1){_0x4ee567['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x473e('0x70')](_0x3856a9),null);}else{if(qs['isNumeric'](_0x3856a9)){_0x4ee567['or'](_0x473e('0x71'),_0x3856a9+'%');_0x4ee567['or'](_0x473e('0x72'),_0x3856a9+'%');_0x4ee567['or'](_0x473e('0x73'),_0x3856a9+'%');_0x4ee567['or'](_0x473e('0x74'),_0x3856a9+'%');}else if(qs[_0x473e('0x75')](_0x3856a9)){_0x4ee567['or'](_0x473e('0x76'),_0x3856a9+'%');}else{_0x4ee567['or'](_0x473e('0x77'),'%'+_0x3856a9+'%');_0x4ee567['or'](_0x473e('0x78'),'%'+_0x3856a9+'%');_0x4ee567['or'](_0x473e('0x76'),'%'+_0x3856a9+'%');}}}}_0x3f62fd['where'](_0x4ee567);_0x3f62fd[_0x473e('0x79')](_0x473e('0x7a'));var _0x20b881={'type':db[_0x473e('0x7b')][_0x473e('0x7c')][_0x473e('0x7d')],'raw':!![]};var _0x340b3a=_0x3f62fd['clone']()['field'](_0x473e('0x7a'));if(_0x2e03ef[_0x473e('0x40')]){_0x2e03ef[_0x473e('0x40')][_0x473e('0x65')](function(_0x51b004){_0x3f62fd[_0x473e('0x40')]('c.'+_0x51b004[0x0],_0x51b004[0x1]===_0x473e('0x7e')?![]:!![]);});}if(!_[_0x473e('0x64')](_0x5d617c)){_0x3f62fd[_0x473e('0x7f')](_0x25070e);_0x340b3a[_0x473e('0x67')](_0x473e('0x80'),_0x5d617c);}BPromise['resolve']()[_0x473e('0x29')](function(){if(!_0x551315)return;if(_0x3c7d61['user'][_0x473e('0x81')]!==_0x473e('0x82'))return;if(!_[_0x473e('0x83')](_0x551315[_0x473e('0x51')],[_0x473e('0x44'),'User'])){return _0x3c7d61[_0x473e('0x84')][_0x473e('0x85')]({'attributes':['id'],'raw':!![]})[_0x473e('0x29')](function(_0x2eb923){if(_['isEmpty'](_0x2eb923)){_0x340b3a['where'](_0x473e('0x86'));_0x3f62fd[_0x473e('0x67')]('c.ListId\x20IS\x20NULL');}else{_0x340b3a['where'](_0x473e('0x68'),_[_0x473e('0x56')](_0x2eb923,'id'));_0x3f62fd['where']('c.ListId\x20IN\x20?',_[_0x473e('0x56')](_0x2eb923,'id'));}});}})[_0x473e('0x29')](function(){if(_0x3c7d61['user'][_0x473e('0x81')]===_0x473e('0x82')&&!_0x551315&&!_0x3c7d61[_0x473e('0x39')]['ListId'])return[];return db[_0x473e('0x87')][_0x473e('0x39')](_0x340b3a[_0x473e('0x88')](),_0x20b881);})[_0x473e('0x29')](function(_0x2c59e9){_0x503303[_0x473e('0x23')]=_0x2c59e9[_0x473e('0x31')];if(_0x503303[_0x473e('0x23')]===0x0)return[];return db[_0x473e('0x87')]['query'](_0x5d6345[_0x473e('0x88')](),_0x20b881)['then'](function(_0x20cc9b){_0x448b2a=_[_0x473e('0x89')](_0x20cc9b,'id');_0x20b881=_['merge'](_0x20b881,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c7d61[_0x473e('0x39')][_0x473e('0x3c')]){_0x2e03ef['attributes'][_0x473e('0x65')](function(_0x1e1286){_0x3f62fd[_0x473e('0x44')]('c.'+_0x1e1286);});}else{_0x3f62fd['field'](_0x473e('0x7a'));_0x3f62fd[_0x473e('0x44')]('c.firstName');_0x3f62fd[_0x473e('0x44')]('c.lastName');_0x3f62fd[_0x473e('0x44')](_0x473e('0x8a'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x8b'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x8c'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x8d'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x8e'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x8f'));_0x3f62fd[_0x473e('0x44')](_0x473e('0x90'));_0x3f62fd[_0x473e('0x44')]('c.CompanyId');_0x3f62fd[_0x473e('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x473e('0x91'));}if(_0x2e03ef['limit'])_0x3f62fd[_0x473e('0x22')](_0x2e03ef[_0x473e('0x22')]);if(_0x2e03ef[_0x473e('0x20')])_0x3f62fd[_0x473e('0x20')](_0x2e03ef[_0x473e('0x20')]);return db['sequelize']['query'](_0x3f62fd['toString'](),_0x20b881);});})['then'](function(_0x224422){_0x224422[_0x473e('0x65')](function(_0x608c03){if(_0x608c03[_0x473e('0x91')]){_0x608c03[_0x473e('0x92')]=[];_0x608c03[_0x473e('0x91')][_0x473e('0x55')](',')[_0x473e('0x65')](function(_0x4c1bfe){_0x608c03[_0x473e('0x92')]['push'](_0x448b2a[_0x4c1bfe]);});}delete _0x608c03['TagIds'];});_0x503303['rows']=_0x224422;return _0x503303;})[_0x473e('0x29')](respondWithFilteredResult(_0x5113f5,_0x2e03ef));})[_0x473e('0x93')](handleError(_0x5113f5,null));};exports[_0x473e('0x28')]=function(_0xa67390,_0x31f629){return db[_0x473e('0x2e')]['find']({'where':{'id':_0xa67390[_0x473e('0x94')]['id']}})[_0x473e('0x29')](handleEntityNotFound(_0x31f629,null))[_0x473e('0x29')](removeEntity(_0x31f629,null))[_0x473e('0x93')](handleError(_0x31f629,null));};exports[_0x473e('0x2f')]=function(_0x2f009d,_0x540ef8){return db[_0x473e('0x2e')][_0x473e('0x2f')]()[_0x473e('0x29')](function(_0x4e34c5){delete _0x4e34c5[_0x473e('0x95')];for(var _0x24bb44=0x0;_0x24bb44{}\s\\|]/g,'-');_0x3fb886(null,util['format'](_0x720f('0x1f'),path['basename'](_0x539a08[_0x720f('0x1d')],path[_0x720f('0x20')](_0x539a08['originalname'])),Date[_0x720f('0x21')](),path[_0x720f('0x20')](_0x539a08[_0x720f('0x1d')])));}})});router[_0x720f('0x15')](_0x720f('0x22'),upload[_0x720f('0x23')]('file'),controller[_0x720f('0x24')]);var upload=multer({'storage':multer[_0x720f('0x25')]({'destination':function(_0x4bcf51,_0x51f0f5,_0x5709e3){_0x5709e3(null,path[_0x720f('0x26')](config[_0x720f('0x1b')],_0x720f('0x1c')));},'filename':function(_0x4b5412,_0x5a4f0d,_0x4ec3d1){_0x5a4f0d[_0x720f('0x1d')]=_0x5a4f0d[_0x720f('0x1d')][_0x720f('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ec3d1(null,util[_0x720f('0x27')]('%s-%s%s',path['basename'](_0x5a4f0d[_0x720f('0x1d')],path[_0x720f('0x20')](_0x5a4f0d['originalname'])),Date[_0x720f('0x21')](),path[_0x720f('0x20')](_0x5a4f0d[_0x720f('0x1d')])));}})});router[_0x720f('0x15')](_0x720f('0x28'),upload[_0x720f('0x23')](_0x720f('0x29')),controller['upload']);router['post'](_0x720f('0x2a'),auth[_0x720f('0x6')](),controller[_0x720f('0x2b')]);router[_0x720f('0x2c')](_0x720f('0x2d'),auth[_0x720f('0x6')](),controller['update']);router['delete'](_0x720f('0x2d'),auth[_0x720f('0x6')](),controller[_0x720f('0x2e')]);module[_0x720f('0x2f')]=router; \ No newline at end of file +var _0xc332=['format','basename','now','extname','single','file','/upload','upload','/upload/:id','import','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc332,0x1ec));var _0x2c33=function(_0x2ff35d,_0x5ba6fb){_0x2ff35d=_0x2ff35d-0x0;var _0x6686a3=_0xc332[_0x2ff35d];return _0x6686a3;};'use strict';var multer=require(_0x2c33('0x0'));var util=require(_0x2c33('0x1'));var path=require(_0x2c33('0x2'));var timeout=require(_0x2c33('0x3'));var express=require(_0x2c33('0x4'));var router=express['Router']();var fs_extra=require(_0x2c33('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2c33('0x6'));var config=require(_0x2c33('0x7'));var controller=require(_0x2c33('0x8'));router[_0x2c33('0x9')]('/',auth['isAuthenticated'](),controller[_0x2c33('0xa')]);router[_0x2c33('0x9')]('/describe',auth[_0x2c33('0xb')](),controller['describe']);router['get'](_0x2c33('0xc'),auth['isAuthenticated'](),controller[_0x2c33('0xd')]);router[_0x2c33('0x9')](_0x2c33('0xe'),auth['isAuthenticated'](),controller[_0x2c33('0xf')]);router[_0x2c33('0x9')](_0x2c33('0x10'),auth['isAuthenticated'](),controller[_0x2c33('0x11')]);router[_0x2c33('0x9')]('/:id/hopper_histories',auth[_0x2c33('0xb')](),controller[_0x2c33('0x12')]);router[_0x2c33('0x9')](_0x2c33('0x13'),auth[_0x2c33('0xb')](),controller[_0x2c33('0x14')]);router[_0x2c33('0x9')]('/:id/jscripty_sessions',auth[_0x2c33('0xb')](),controller[_0x2c33('0x15')]);router[_0x2c33('0x9')]('/:id/journey',auth[_0x2c33('0xb')](),controller[_0x2c33('0x16')]);router[_0x2c33('0x17')](_0x2c33('0x18'),auth['isAuthenticated'](),controller[_0x2c33('0x19')]);router['post']('/',auth[_0x2c33('0xb')](),controller[_0x2c33('0x1a')]);router['post'](_0x2c33('0x1b'),auth['isAuthenticated'](),controller[_0x2c33('0x1c')]);router[_0x2c33('0x17')](_0x2c33('0xe'),auth[_0x2c33('0xb')](),controller[_0x2c33('0x1d')]);var upload=multer({'storage':multer[_0x2c33('0x1e')]({'destination':function(_0x5f42ce,_0x4cd09a,_0x614f61){_0x614f61(null,path[_0x2c33('0x1f')](config[_0x2c33('0x20')],_0x2c33('0x21')));},'filename':function(_0x5d653e,_0x2a1fd2,_0x60c570){_0x2a1fd2[_0x2c33('0x22')]=_0x2a1fd2[_0x2c33('0x22')][_0x2c33('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x60c570(null,util[_0x2c33('0x24')]('%s-%s%s',path[_0x2c33('0x25')](_0x2a1fd2[_0x2c33('0x22')],path['extname'](_0x2a1fd2[_0x2c33('0x22')])),Date[_0x2c33('0x26')](),path[_0x2c33('0x27')](_0x2a1fd2[_0x2c33('0x22')])));}})});router[_0x2c33('0x17')]('/csv',upload[_0x2c33('0x28')](_0x2c33('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x2c33('0x1e')]({'destination':function(_0x1b1d05,_0x24c1f1,_0x48bc3d){_0x48bc3d(null,path[_0x2c33('0x1f')](config[_0x2c33('0x20')],_0x2c33('0x21')));},'filename':function(_0x4acf97,_0x194f6a,_0x8ce3d9){_0x194f6a[_0x2c33('0x22')]=_0x194f6a[_0x2c33('0x22')][_0x2c33('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8ce3d9(null,util[_0x2c33('0x24')]('%s-%s%s',path[_0x2c33('0x25')](_0x194f6a[_0x2c33('0x22')],path[_0x2c33('0x27')](_0x194f6a['originalname'])),Date[_0x2c33('0x26')](),path[_0x2c33('0x27')](_0x194f6a[_0x2c33('0x22')])));}})});router['post'](_0x2c33('0x2a'),upload[_0x2c33('0x28')](_0x2c33('0x29')),controller[_0x2c33('0x2b')]);router[_0x2c33('0x17')](_0x2c33('0x2c'),auth[_0x2c33('0xb')](),controller[_0x2c33('0x2d')]);router['put'](_0x2c33('0xc'),auth[_0x2c33('0xb')](),controller[_0x2c33('0x2e')]);router[_0x2c33('0x2f')](_0x2c33('0xc'),auth[_0x2c33('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index cba4bd1..f2b757c 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 _0xc5cc=['TEXT','select','parse','values','setDataValue','stringify','BOOLEAN','ENUM','lodash','STRING','alias','getDataValue','name'];(function(_0x144d4b,_0x3fd8ce){var _0x15491b=function(_0xf4c8bf){while(--_0xf4c8bf){_0x144d4b['push'](_0x144d4b['shift']());}};_0x15491b(++_0x3fd8ce);}(_0xc5cc,0x70));var _0xcc5c=function(_0x26d2fd,_0x23f9c8){_0x26d2fd=_0x26d2fd-0x0;var _0x10d4ed=_0xc5cc[_0x26d2fd];return _0x10d4ed;};'use strict';var Sequelize=require('sequelize');var _=require(_0xcc5c('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x172bc7){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xcc5c('0x1')],'allowNull':![],'set':function(_0x1e29cc){this['setDataValue'](_0xcc5c('0x2'),_0x1e29cc?_0x1e29cc:this[_0xcc5c('0x3')](_0xcc5c('0x4')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xcc5c('0x5')]('long'),'get':function(){if(this['getDataValue']('type')===_0xcc5c('0x6')){return JSON[_0xcc5c('0x7')](this[_0xcc5c('0x3')]('values'));}else{return this[_0xcc5c('0x3')](_0xcc5c('0x8'));}},'set':function(_0x1b4bf8){if(Array['isArray'](_0x1b4bf8)){this[_0xcc5c('0x9')]('values',JSON[_0xcc5c('0xa')](_0x1b4bf8));}else{this[_0xcc5c('0x9')](_0xcc5c('0x8'),_0x1b4bf8);}}},'required':{'type':Sequelize[_0xcc5c('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcc5c('0xc')]('voice')}}; \ No newline at end of file +var _0x8e04=['BOOLEAN','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','values','isArray','stringify'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x8e04,0x91));var _0x48e0=function(_0x539d7b,_0x5f2eba){_0x539d7b=_0x539d7b-0x0;var _0x31953c=_0x8e04[_0x539d7b];return _0x31953c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x48e0('0x0'));module[_0x48e0('0x1')]={'name':{'type':Sequelize[_0x48e0('0x2')],'get':function(_0x38dd80){return this[_0x48e0('0x3')](_0x48e0('0x4'));}},'alias':{'type':Sequelize[_0x48e0('0x5')],'allowNull':![],'set':function(_0x6d9920){this[_0x48e0('0x6')](_0x48e0('0x4'),_0x6d9920?_0x6d9920:this['getDataValue'](_0x48e0('0x7')));}},'type':{'type':Sequelize[_0x48e0('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x48e0('0x8')](_0x48e0('0x9')),'get':function(){if(this[_0x48e0('0x3')](_0x48e0('0xa'))===_0x48e0('0xb')){return JSON['parse'](this[_0x48e0('0x3')](_0x48e0('0xc')));}else{return this[_0x48e0('0x3')](_0x48e0('0xc'));}},'set':function(_0x225a16){if(Array[_0x48e0('0xd')](_0x225a16)){this[_0x48e0('0x6')](_0x48e0('0xc'),JSON[_0x48e0('0xe')](_0x225a16));}else{this[_0x48e0('0x6')](_0x48e0('0xc'),_0x225a16);}}},'required':{'type':Sequelize[_0x48e0('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8e56053..fd889d9 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 _0x3648=['CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','update','body','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','destroy','then','error','stack','name','send'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x3648,0x80));var _0x8364=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3648[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8364('0x0'));var rimraf=require(_0x8364('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8364('0x2'));var rp=require('request-promise');var moment=require(_0x8364('0x3'));var BPromise=require(_0x8364('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8364('0x5'));var sox=require('sox');var csv=require(_0x8364('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8364('0x7'));var _=require('lodash');var squel=require(_0x8364('0x8'));var crypto=require(_0x8364('0x9'));var jsforce=require(_0x8364('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8364('0xb'));var Papa=require('papaparse');var Redis=require(_0x8364('0xc'));var authService=require(_0x8364('0xd'));var qs=require(_0x8364('0xe'));var as=require(_0x8364('0xf'));var hardwareService=require(_0x8364('0x10'));var logger=require('../../config/logger')(_0x8364('0x11'));var utils=require(_0x8364('0x12'));var config=require(_0x8364('0x13'));var licenseUtil=require(_0x8364('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9cc85b,_0x489d03){_0x489d03=_0x489d03||0xcc;return function(_0x4622b6){if(_0x4622b6){return _0x9cc85b[_0x8364('0x15')](_0x489d03);}return _0x9cc85b['status'](_0x489d03)[_0x8364('0x16')]();};}function respondWithResult(_0x4ff913,_0x24fa9b){_0x24fa9b=_0x24fa9b||0xc8;return function(_0x14d805){if(_0x14d805){return _0x4ff913[_0x8364('0x17')](_0x24fa9b)[_0x8364('0x18')](_0x14d805);}};}function respondWithFilteredResult(_0x313d8f,_0x2aaa56){return function(_0x524a6d){if(_0x524a6d){var _0x3894bd=typeof _0x2aaa56[_0x8364('0x19')]===_0x8364('0x1a')&&typeof _0x2aaa56[_0x8364('0x1b')]===_0x8364('0x1a');var _0x4dbbce=_0x524a6d['count'];var _0x3116b3=_0x3894bd?0x0:_0x2aaa56[_0x8364('0x19')];var _0x5eec19=_0x3894bd?_0x524a6d[_0x8364('0x1c')]:_0x2aaa56[_0x8364('0x19')]+_0x2aaa56['limit'];var _0x59914e;if(_0x5eec19>=_0x4dbbce){_0x5eec19=_0x4dbbce;_0x59914e=0xc8;}else{_0x59914e=0xce;}_0x313d8f['status'](_0x59914e);return _0x313d8f[_0x8364('0x1d')]('Content-Range',_0x3116b3+'-'+_0x5eec19+'/'+_0x4dbbce)[_0x8364('0x18')](_0x524a6d);}return null;};}function patchUpdates(_0x127f5b){return function(_0x874bb6){try{jsonpatch[_0x8364('0x1e')](_0x874bb6,_0x127f5b,!![]);}catch(_0x100f91){return BPromise[_0x8364('0x1f')](_0x100f91);}return _0x874bb6['save']();};}function saveUpdates(_0x2ee6ee,_0x2aed29){return function(_0x2eb94b){if(_0x2eb94b){return _0x2eb94b['update'](_0x2ee6ee)['then'](function(_0x58959b){return _0x58959b;});}return null;};}function removeEntity(_0x575fb4,_0x71342e){return function(_0x1e9db8){if(_0x1e9db8){return _0x1e9db8[_0x8364('0x20')]()[_0x8364('0x21')](function(){_0x575fb4[_0x8364('0x17')](0xcc)[_0x8364('0x16')]();});}};}function handleEntityNotFound(_0x5872a2,_0x52238a){return function(_0x365968){if(!_0x365968){_0x5872a2[_0x8364('0x15')](0x194);}return _0x365968;};}function handleError(_0x4368a1,_0x501c53){_0x501c53=_0x501c53||0x1f4;return function(_0x4b5fd6){logger[_0x8364('0x22')](_0x4b5fd6[_0x8364('0x23')]);if(_0x4b5fd6[_0x8364('0x24')]){delete _0x4b5fd6[_0x8364('0x24')];}_0x4368a1[_0x8364('0x17')](_0x501c53)[_0x8364('0x25')](_0x4b5fd6);};}exports['index']=function(_0x2b0e5d,_0xaa3db1){var _0x58aef3={},_0x19d795={},_0x1c4180={'count':0x0,'rows':[]};var _0x35abea=_['map'](db[_0x8364('0x26')][_0x8364('0x27')],function(_0x30ba32){return{'name':_0x30ba32[_0x8364('0x28')],'type':_0x30ba32[_0x8364('0x29')][_0x8364('0x2a')]};});_0x19d795[_0x8364('0x2b')]=_[_0x8364('0x2c')](_[_0x8364('0x2d')](_0x35abea,'name'),[_0x8364('0x24')]);_0x19d795['query']=_['keys'](_0x2b0e5d[_0x8364('0x2e')]);_0x19d795[_0x8364('0x2f')]=_[_0x8364('0x30')](_0x19d795[_0x8364('0x2b')],_0x19d795[_0x8364('0x2e')]);_0x58aef3[_0x8364('0x31')]=_[_0x8364('0x30')](_0x19d795[_0x8364('0x2b')],qs['fields'](_0x2b0e5d[_0x8364('0x2e')][_0x8364('0x32')]));_0x58aef3[_0x8364('0x31')]=_0x58aef3[_0x8364('0x31')][_0x8364('0x33')]?_0x58aef3[_0x8364('0x31')]:_0x19d795[_0x8364('0x2b')];if(!_0x2b0e5d['query'][_0x8364('0x34')]('nolimit')){_0x58aef3[_0x8364('0x1b')]=qs[_0x8364('0x1b')](_0x2b0e5d[_0x8364('0x2e')][_0x8364('0x1b')]);_0x58aef3[_0x8364('0x19')]=qs[_0x8364('0x19')](_0x2b0e5d['query'][_0x8364('0x19')]);}_0x58aef3[_0x8364('0x35')]=qs[_0x8364('0x36')](_0x2b0e5d['query']['sort']);_0x58aef3[_0x8364('0x37')]=qs[_0x8364('0x2f')](_['pick'](_0x2b0e5d[_0x8364('0x2e')],_0x19d795[_0x8364('0x2f')]),_0x35abea);if(_0x2b0e5d[_0x8364('0x2e')]['filter']){_0x58aef3['where']=_[_0x8364('0x38')](_0x58aef3[_0x8364('0x37')],{'$or':_[_0x8364('0x2d')](_0x35abea,function(_0x432b4c){if(_0x432b4c['type']!==_0x8364('0x39')){var _0x32bbd2={};_0x32bbd2[_0x432b4c[_0x8364('0x24')]]={'$like':'%'+_0x2b0e5d[_0x8364('0x2e')][_0x8364('0x3a')]+'%'};return _0x32bbd2;}})});}_0x58aef3=_[_0x8364('0x38')]({},_0x58aef3,_0x2b0e5d[_0x8364('0x3b')]);var _0x198100={'where':_0x58aef3['where']};return db[_0x8364('0x26')][_0x8364('0x1c')](_0x198100)[_0x8364('0x21')](function(_0x28a33a){_0x1c4180[_0x8364('0x1c')]=_0x28a33a;if(_0x2b0e5d['query']['includeAll']){_0x58aef3[_0x8364('0x3c')]=[{'all':!![]}];}return db[_0x8364('0x26')][_0x8364('0x3d')](_0x58aef3);})[_0x8364('0x21')](function(_0x597701){_0x1c4180[_0x8364('0x3e')]=_0x597701;return _0x1c4180;})[_0x8364('0x21')](respondWithFilteredResult(_0xaa3db1,_0x58aef3))[_0x8364('0x3f')](handleError(_0xaa3db1,null));};exports[_0x8364('0x40')]=function(_0x458185,_0x3fe76a){var _0xa81746={'raw':!![],'where':{'id':_0x458185[_0x8364('0x41')]['id']}},_0x446acd={};_0x446acd[_0x8364('0x2b')]=_[_0x8364('0x42')](db[_0x8364('0x26')][_0x8364('0x27')]);_0x446acd[_0x8364('0x2e')]=_['keys'](_0x458185[_0x8364('0x2e')]);_0x446acd[_0x8364('0x2f')]=_[_0x8364('0x30')](_0x446acd['model'],_0x446acd[_0x8364('0x2e')]);_0xa81746[_0x8364('0x31')]=_['intersection'](_0x446acd[_0x8364('0x2b')],qs[_0x8364('0x32')](_0x458185[_0x8364('0x2e')]['fields']));_0xa81746[_0x8364('0x31')]=_0xa81746[_0x8364('0x31')][_0x8364('0x33')]?_0xa81746['attributes']:_0x446acd[_0x8364('0x2b')];if(_0x458185[_0x8364('0x2e')][_0x8364('0x43')]){_0xa81746[_0x8364('0x3c')]=[{'all':!![]}];}_0xa81746=_[_0x8364('0x38')]({},_0xa81746,_0x458185[_0x8364('0x3b')]);return db[_0x8364('0x26')][_0x8364('0x44')](_0xa81746)[_0x8364('0x21')](handleEntityNotFound(_0x3fe76a,null))[_0x8364('0x21')](respondWithResult(_0x3fe76a,null))[_0x8364('0x3f')](handleError(_0x3fe76a,null));};exports[_0x8364('0x45')]=function(_0x4665c5,_0x5c466b){if(_0x4665c5['body']['id']){delete _0x4665c5[_0x8364('0x46')]['id'];}return db[_0x8364('0x26')][_0x8364('0x44')]({'where':{'id':_0x4665c5[_0x8364('0x41')]['id']}})[_0x8364('0x21')](handleEntityNotFound(_0x5c466b,null))[_0x8364('0x21')](saveUpdates(_0x4665c5[_0x8364('0x46')],null))[_0x8364('0x21')](respondWithResult(_0x5c466b,null))[_0x8364('0x3f')](handleError(_0x5c466b,null));};exports[_0x8364('0x20')]=function(_0x36ce54,_0x584d18){return db[_0x8364('0x26')][_0x8364('0x44')]({'where':{'id':_0x36ce54[_0x8364('0x41')]['id']}})[_0x8364('0x21')](handleEntityNotFound(_0x584d18,null))[_0x8364('0x21')](removeEntity(_0x584d18,null))[_0x8364('0x3f')](handleError(_0x584d18,null));};exports['create']=function(_0x506ebf,_0xf87804){var _0x5c7b46;return db[_0x8364('0x47')][_0x8364('0x48')](function(_0xe3470b){return db[_0x8364('0x26')]['create'](_0x506ebf[_0x8364('0x46')],{'transaction':_0xe3470b})[_0x8364('0x21')](function(_0x2c6130){_0x5c7b46=_0x2c6130;var _0x19d679={'type':db[_0x8364('0x49')][_0x8364('0x4a')],'transaction':_0xe3470b};switch(_0x506ebf[_0x8364('0x46')][_0x8364('0x29')]){case _0x8364('0x4b'):_0x19d679[_0x8364('0x29')]=db[_0x8364('0x49')][_0x8364('0x4a')];break;case'number':_0x19d679[_0x8364('0x29')]=db[_0x8364('0x49')][_0x8364('0x4c')];break;case _0x8364('0x4d'):_0x19d679[_0x8364('0x29')]=db[_0x8364('0x49')][_0x8364('0x4e')];_0x19d679['defaultValue']=![];break;default:}return db[_0x8364('0x47')]['queryInterface'][_0x8364('0x4f')](_0x8364('0x50'),util[_0x8364('0x51')](_0x8364('0x52'),_0x5c7b46['id']),_0x19d679);})[_0x8364('0x21')](function(){return _0x5c7b46;});})['then'](respondWithResult(_0xf87804,0xc9))[_0x8364('0x3f')](handleError(_0xf87804,null));}; \ No newline at end of file +var _0x9511=['sequelize','Sequelize','text','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','then','error','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create'];(function(_0x1c6289,_0x389a28){var _0x28ab7a=function(_0x4bcd12){while(--_0x4bcd12){_0x1c6289['push'](_0x1c6289['shift']());}};_0x28ab7a(++_0x389a28);}(_0x9511,0xbd));var _0x1951=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0x9511[_0x4f3242];return _0x49844f;};'use strict';var emlformat=require(_0x1951('0x0'));var rimraf=require(_0x1951('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1951('0x2'));var rp=require(_0x1951('0x3'));var moment=require(_0x1951('0x4'));var BPromise=require(_0x1951('0x5'));var Mustache=require(_0x1951('0x6'));var util=require(_0x1951('0x7'));var path=require(_0x1951('0x8'));var sox=require(_0x1951('0x9'));var csv=require('to-csv');var ejs=require(_0x1951('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1951('0xb'));var squel=require(_0x1951('0xc'));var crypto=require(_0x1951('0xd'));var jsforce=require(_0x1951('0xe'));var deskjs=require(_0x1951('0xf'));var toCsv=require(_0x1951('0x10'));var querystring=require(_0x1951('0x11'));var Papa=require(_0x1951('0x12'));var Redis=require(_0x1951('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1951('0x14'));var as=require(_0x1951('0x15'));var hardwareService=require(_0x1951('0x16'));var logger=require(_0x1951('0x17'))(_0x1951('0x18'));var utils=require(_0x1951('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1951('0x1a'));var db=require(_0x1951('0x1b'))['db'];function respondWithStatusCode(_0x50e7c1,_0x1fe366){_0x1fe366=_0x1fe366||0xcc;return function(_0x44150){if(_0x44150){return _0x50e7c1[_0x1951('0x1c')](_0x1fe366);}return _0x50e7c1[_0x1951('0x1d')](_0x1fe366)[_0x1951('0x1e')]();};}function respondWithResult(_0xf5e512,_0x29e4e0){_0x29e4e0=_0x29e4e0||0xc8;return function(_0x258a50){if(_0x258a50){return _0xf5e512[_0x1951('0x1d')](_0x29e4e0)[_0x1951('0x1f')](_0x258a50);}};}function respondWithFilteredResult(_0x56c7a1,_0x49b51f){return function(_0x35d5f6){if(_0x35d5f6){var _0x1be0b0=typeof _0x49b51f['offset']===_0x1951('0x20')&&typeof _0x49b51f[_0x1951('0x21')]===_0x1951('0x20');var _0x2c9eab=_0x35d5f6[_0x1951('0x22')];var _0x4cdc8c=_0x1be0b0?0x0:_0x49b51f[_0x1951('0x23')];var _0x1e757e=_0x1be0b0?_0x35d5f6[_0x1951('0x22')]:_0x49b51f[_0x1951('0x23')]+_0x49b51f[_0x1951('0x21')];var _0x1dba9c;if(_0x1e757e>=_0x2c9eab){_0x1e757e=_0x2c9eab;_0x1dba9c=0xc8;}else{_0x1dba9c=0xce;}_0x56c7a1['status'](_0x1dba9c);return _0x56c7a1['set'](_0x1951('0x24'),_0x4cdc8c+'-'+_0x1e757e+'/'+_0x2c9eab)['json'](_0x35d5f6);}return null;};}function patchUpdates(_0x373292){return function(_0x3cc150){try{jsonpatch[_0x1951('0x25')](_0x3cc150,_0x373292,!![]);}catch(_0x2a6887){return BPromise['reject'](_0x2a6887);}return _0x3cc150['save']();};}function saveUpdates(_0x173e53,_0x2ac861){return function(_0x1d9137){if(_0x1d9137){return _0x1d9137[_0x1951('0x26')](_0x173e53)['then'](function(_0x560cc1){return _0x560cc1;});}return null;};}function removeEntity(_0x15d67d,_0x1892fe){return function(_0x5c4ae6){if(_0x5c4ae6){return _0x5c4ae6[_0x1951('0x27')]()[_0x1951('0x28')](function(){_0x15d67d[_0x1951('0x1d')](0xcc)[_0x1951('0x1e')]();});}};}function handleEntityNotFound(_0x40dac3,_0x934337){return function(_0x1e0555){if(!_0x1e0555){_0x40dac3['sendStatus'](0x194);}return _0x1e0555;};}function handleError(_0x36e242,_0x40946d){_0x40946d=_0x40946d||0x1f4;return function(_0x5cb6b2){logger[_0x1951('0x29')](_0x5cb6b2['stack']);if(_0x5cb6b2['name']){delete _0x5cb6b2['name'];}_0x36e242[_0x1951('0x1d')](_0x40946d)[_0x1951('0x2a')](_0x5cb6b2);};}exports[_0x1951('0x2b')]=function(_0x5a1f29,_0x53ce57){var _0xe6c46d={},_0x2a863e={},_0x544429={'count':0x0,'rows':[]};var _0x4968f6=_[_0x1951('0x2c')](db[_0x1951('0x2d')][_0x1951('0x2e')],function(_0x28576e){return{'name':_0x28576e[_0x1951('0x2f')],'type':_0x28576e[_0x1951('0x30')][_0x1951('0x31')]};});_0x2a863e['model']=_['differenceBy'](_[_0x1951('0x2c')](_0x4968f6,_0x1951('0x32')),[_0x1951('0x32')]);_0x2a863e[_0x1951('0x33')]=_[_0x1951('0x34')](_0x5a1f29[_0x1951('0x33')]);_0x2a863e[_0x1951('0x35')]=_['intersection'](_0x2a863e[_0x1951('0x36')],_0x2a863e[_0x1951('0x33')]);_0xe6c46d[_0x1951('0x37')]=_[_0x1951('0x38')](_0x2a863e[_0x1951('0x36')],qs[_0x1951('0x39')](_0x5a1f29['query'][_0x1951('0x39')]));_0xe6c46d[_0x1951('0x37')]=_0xe6c46d[_0x1951('0x37')][_0x1951('0x3a')]?_0xe6c46d[_0x1951('0x37')]:_0x2a863e['model'];if(!_0x5a1f29[_0x1951('0x33')][_0x1951('0x3b')](_0x1951('0x3c'))){_0xe6c46d['limit']=qs[_0x1951('0x21')](_0x5a1f29['query']['limit']);_0xe6c46d['offset']=qs[_0x1951('0x23')](_0x5a1f29[_0x1951('0x33')]['offset']);}_0xe6c46d[_0x1951('0x3d')]=qs['sort'](_0x5a1f29[_0x1951('0x33')][_0x1951('0x3e')]);_0xe6c46d[_0x1951('0x3f')]=qs[_0x1951('0x35')](_[_0x1951('0x40')](_0x5a1f29['query'],_0x2a863e[_0x1951('0x35')]),_0x4968f6);if(_0x5a1f29[_0x1951('0x33')][_0x1951('0x41')]){_0xe6c46d[_0x1951('0x3f')]=_[_0x1951('0x42')](_0xe6c46d[_0x1951('0x3f')],{'$or':_[_0x1951('0x2c')](_0x4968f6,function(_0x56fe01){if(_0x56fe01[_0x1951('0x30')]!=='VIRTUAL'){var _0x103c67={};_0x103c67[_0x56fe01['name']]={'$like':'%'+_0x5a1f29[_0x1951('0x33')][_0x1951('0x41')]+'%'};return _0x103c67;}})});}_0xe6c46d=_[_0x1951('0x42')]({},_0xe6c46d,_0x5a1f29[_0x1951('0x43')]);var _0x4ca33a={'where':_0xe6c46d[_0x1951('0x3f')]};return db[_0x1951('0x2d')]['count'](_0x4ca33a)[_0x1951('0x28')](function(_0x3659e2){_0x544429['count']=_0x3659e2;if(_0x5a1f29[_0x1951('0x33')][_0x1951('0x44')]){_0xe6c46d[_0x1951('0x45')]=[{'all':!![]}];}return db['CmCustomField'][_0x1951('0x46')](_0xe6c46d);})[_0x1951('0x28')](function(_0x41b3b2){_0x544429[_0x1951('0x47')]=_0x41b3b2;return _0x544429;})[_0x1951('0x28')](respondWithFilteredResult(_0x53ce57,_0xe6c46d))[_0x1951('0x48')](handleError(_0x53ce57,null));};exports[_0x1951('0x49')]=function(_0x3441f4,_0x29eae4){var _0x5c9bca={'raw':!![],'where':{'id':_0x3441f4[_0x1951('0x4a')]['id']}},_0x2d4b2c={};_0x2d4b2c['model']=_[_0x1951('0x34')](db[_0x1951('0x2d')]['rawAttributes']);_0x2d4b2c[_0x1951('0x33')]=_[_0x1951('0x34')](_0x3441f4[_0x1951('0x33')]);_0x2d4b2c[_0x1951('0x35')]=_[_0x1951('0x38')](_0x2d4b2c['model'],_0x2d4b2c['query']);_0x5c9bca[_0x1951('0x37')]=_[_0x1951('0x38')](_0x2d4b2c['model'],qs[_0x1951('0x39')](_0x3441f4[_0x1951('0x33')][_0x1951('0x39')]));_0x5c9bca[_0x1951('0x37')]=_0x5c9bca[_0x1951('0x37')][_0x1951('0x3a')]?_0x5c9bca[_0x1951('0x37')]:_0x2d4b2c[_0x1951('0x36')];if(_0x3441f4[_0x1951('0x33')][_0x1951('0x44')]){_0x5c9bca[_0x1951('0x45')]=[{'all':!![]}];}_0x5c9bca=_[_0x1951('0x42')]({},_0x5c9bca,_0x3441f4[_0x1951('0x43')]);return db[_0x1951('0x2d')][_0x1951('0x4b')](_0x5c9bca)['then'](handleEntityNotFound(_0x29eae4,null))[_0x1951('0x28')](respondWithResult(_0x29eae4,null))[_0x1951('0x48')](handleError(_0x29eae4,null));};exports['update']=function(_0x338ea0,_0x47e6fb){if(_0x338ea0[_0x1951('0x4c')]['id']){delete _0x338ea0['body']['id'];}return db[_0x1951('0x2d')][_0x1951('0x4b')]({'where':{'id':_0x338ea0['params']['id']}})[_0x1951('0x28')](handleEntityNotFound(_0x47e6fb,null))[_0x1951('0x28')](saveUpdates(_0x338ea0[_0x1951('0x4c')],null))[_0x1951('0x28')](respondWithResult(_0x47e6fb,null))[_0x1951('0x48')](handleError(_0x47e6fb,null));};exports[_0x1951('0x27')]=function(_0x16c13d,_0x4c5328){return db[_0x1951('0x2d')]['find']({'where':{'id':_0x16c13d[_0x1951('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c5328,null))['then'](removeEntity(_0x4c5328,null))[_0x1951('0x48')](handleError(_0x4c5328,null));};exports[_0x1951('0x4d')]=function(_0x353c23,_0x217981){var _0x561b79;return db[_0x1951('0x4e')]['transaction'](function(_0x1513a6){return db[_0x1951('0x2d')][_0x1951('0x4d')](_0x353c23[_0x1951('0x4c')],{'transaction':_0x1513a6})[_0x1951('0x28')](function(_0x54a9ec){_0x561b79=_0x54a9ec;var _0xfdaf21={'type':db[_0x1951('0x4f')]['TEXT'],'transaction':_0x1513a6};switch(_0x353c23[_0x1951('0x4c')][_0x1951('0x30')]){case _0x1951('0x50'):_0xfdaf21[_0x1951('0x30')]=db[_0x1951('0x4f')]['TEXT'];break;case _0x1951('0x51'):_0xfdaf21[_0x1951('0x30')]=db[_0x1951('0x4f')][_0x1951('0x52')];break;case'switch':_0xfdaf21[_0x1951('0x30')]=db[_0x1951('0x4f')][_0x1951('0x53')];_0xfdaf21[_0x1951('0x54')]=![];break;default:}return db['sequelize']['queryInterface'][_0x1951('0x55')](_0x1951('0x56'),util[_0x1951('0x57')](_0x1951('0x58'),_0x561b79['id']),_0xfdaf21);})['then'](function(){return _0x561b79;});})[_0x1951('0x28')](respondWithResult(_0x217981,0xc9))[_0x1951('0x48')](handleError(_0x217981,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 65093f0..2429ab3 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 _0xc25b=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','moment'];(function(_0x1b0b64,_0x31a9a8){var _0x1ba915=function(_0x32e8cc){while(--_0x32e8cc){_0x1b0b64['push'](_0x1b0b64['shift']());}};_0x1ba915(++_0x31a9a8);}(_0xc25b,0xbe));var _0xbc25=function(_0x2c6af9,_0x5ce7c7){_0x2c6af9=_0x2c6af9-0x0;var _0x4552d3=_0xc25b[_0x2c6af9];return _0x4552d3;};'use strict';var _=require(_0xbc25('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc25('0x1'));var BPromise=require(_0xbc25('0x2'));var rp=require(_0xbc25('0x3'));var fs=require('fs');var path=require(_0xbc25('0x4'));var rimraf=require(_0xbc25('0x5'));var config=require(_0xbc25('0x6'));var attributes=require(_0xbc25('0x7'));module[_0xbc25('0x8')]=function(_0x59cc2b,_0x3d18fe){return _0x59cc2b[_0xbc25('0x9')](_0xbc25('0xa'),attributes,{'tableName':_0xbc25('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa933=['../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xa933,0x101));var _0x3a93=function(_0x55206d,_0x2be87e){_0x55206d=_0x55206d-0x0;var _0x76665c=_0xa933[_0x55206d];return _0x76665c;};'use strict';var _=require(_0x3a93('0x0'));var util=require(_0x3a93('0x1'));var logger=require(_0x3a93('0x2'))(_0x3a93('0x3'));var moment=require(_0x3a93('0x4'));var BPromise=require(_0x3a93('0x5'));var rp=require(_0x3a93('0x6'));var fs=require('fs');var path=require(_0x3a93('0x7'));var rimraf=require(_0x3a93('0x8'));var config=require(_0x3a93('0x9'));var attributes=require(_0x3a93('0xa'));module[_0x3a93('0xb')]=function(_0x436f13,_0x2f8dcf){return _0x436f13[_0x3a93('0xc')]('CmCustomField',attributes,{'tableName':_0x3a93('0xd'),'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 8acca17..a0601d5 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 _0x6859=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','info','result','lodash','util','bluebird'];(function(_0x20a51f,_0x175970){var _0x565ab1=function(_0x4b7d1c){while(--_0x4b7d1c){_0x20a51f['push'](_0x20a51f['shift']());}};_0x565ab1(++_0x175970);}(_0x6859,0x14d));var _0x9685=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x6859[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x9685('0x0'));var util=require(_0x9685('0x1'));var moment=require('moment');var BPromise=require(_0x9685('0x2'));var rs=require(_0x9685('0x3'));var fs=require('fs');var Redis=require(_0x9685('0x4'));var db=require(_0x9685('0x5'))['db'];var utils=require(_0x9685('0x6'));var logger=require(_0x9685('0x7'))(_0x9685('0x8'));var config=require('../../config/environment');var jayson=require(_0x9685('0x9'));var client=jayson[_0x9685('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x437e6f,_0x1abbf6,_0x1efc94){return new BPromise(function(_0x2124b9,_0x50b789){return client[_0x9685('0xb')](_0x437e6f,_0x1efc94)['then'](function(_0x32ae30){logger['info']('CmCustomField,\x20%s,\x20%s',_0x1abbf6,_0x9685('0xc'));logger[_0x9685('0xd')](_0x9685('0xe'),_0x1abbf6,_0x9685('0xc'),JSON[_0x9685('0xf')](_0x32ae30));if(_0x32ae30[_0x9685('0x10')]){if(_0x32ae30['error']['code']===0x1f4){logger[_0x9685('0x10')](_0x9685('0x11'),_0x1abbf6,_0x32ae30[_0x9685('0x10')][_0x9685('0x12')]);return _0x50b789(_0x32ae30['error'][_0x9685('0x12')]);}logger[_0x9685('0x10')](_0x9685('0x11'),_0x1abbf6,_0x32ae30[_0x9685('0x10')][_0x9685('0x12')]);return _0x2124b9(_0x32ae30[_0x9685('0x10')][_0x9685('0x12')]);}else{logger[_0x9685('0x13')](_0x9685('0x11'),_0x1abbf6,'request\x20sent');_0x2124b9(_0x32ae30[_0x9685('0x14')][_0x9685('0x12')]);}})['catch'](function(_0x2eeff1){logger[_0x9685('0x10')](_0x9685('0x11'),_0x1abbf6,_0x2eeff1);_0x50b789(_0x2eeff1);});});} \ No newline at end of file +var _0x7e15=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash'];(function(_0xf127ba,_0x57c409){var _0x1d01c6=function(_0x206374){while(--_0x206374){_0xf127ba['push'](_0xf127ba['shift']());}};_0x1d01c6(++_0x57c409);}(_0x7e15,0x144));var _0x57e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7e15[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57e1('0x0'));var util=require(_0x57e1('0x1'));var moment=require(_0x57e1('0x2'));var BPromise=require(_0x57e1('0x3'));var rs=require(_0x57e1('0x4'));var fs=require('fs');var Redis=require(_0x57e1('0x5'));var db=require(_0x57e1('0x6'))['db'];var utils=require(_0x57e1('0x7'));var logger=require(_0x57e1('0x8'))(_0x57e1('0x9'));var config=require(_0x57e1('0xa'));var jayson=require(_0x57e1('0xb'));var client=jayson[_0x57e1('0xc')][_0x57e1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x595f43,_0x954313,_0x4fdb3d){return new BPromise(function(_0x2b8185,_0x34fdc9){return client[_0x57e1('0xe')](_0x595f43,_0x4fdb3d)[_0x57e1('0xf')](function(_0x5913e4){logger['info'](_0x57e1('0x10'),_0x954313,_0x57e1('0x11'));logger[_0x57e1('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x954313,_0x57e1('0x11'),JSON[_0x57e1('0x13')](_0x5913e4));if(_0x5913e4[_0x57e1('0x14')]){if(_0x5913e4['error'][_0x57e1('0x15')]===0x1f4){logger[_0x57e1('0x14')](_0x57e1('0x10'),_0x954313,_0x5913e4[_0x57e1('0x14')]['message']);return _0x34fdc9(_0x5913e4[_0x57e1('0x14')][_0x57e1('0x16')]);}logger['error'](_0x57e1('0x10'),_0x954313,_0x5913e4[_0x57e1('0x14')][_0x57e1('0x16')]);return _0x2b8185(_0x5913e4[_0x57e1('0x14')]['message']);}else{logger[_0x57e1('0x17')](_0x57e1('0x10'),_0x954313,_0x57e1('0x11'));_0x2b8185(_0x5913e4[_0x57e1('0x18')][_0x57e1('0x16')]);}})['catch'](function(_0x15dfa7){logger[_0x57e1('0x14')](_0x57e1('0x10'),_0x954313,_0x15dfa7);_0x34fdc9(_0x15dfa7);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ac21904..78232c9 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 _0x6299=['./cmCustomField.controller','get','isAuthenticated','index','show','put','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x13a48b,_0x1da06d){var _0x3f23d8=function(_0x451820){while(--_0x451820){_0x13a48b['push'](_0x13a48b['shift']());}};_0x3f23d8(++_0x1da06d);}(_0x6299,0x169));var _0x9629=function(_0x5562f8,_0x119a68){_0x5562f8=_0x5562f8-0x0;var _0x3d00c2=_0x6299[_0x5562f8];return _0x3d00c2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9629('0x0'));var timeout=require(_0x9629('0x1'));var express=require(_0x9629('0x2'));var router=express[_0x9629('0x3')]();var fs_extra=require(_0x9629('0x4'));var auth=require(_0x9629('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9629('0x6'));var controller=require(_0x9629('0x7'));router[_0x9629('0x8')]('/',auth[_0x9629('0x9')](),controller[_0x9629('0xa')]);router['get']('/:id',auth[_0x9629('0x9')](),controller[_0x9629('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9629('0xc')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['update']);router[_0x9629('0xe')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['destroy']);module[_0x9629('0xf')]=router; \ No newline at end of file +var _0xb42d=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCustomField.controller','isAuthenticated','index','get','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x4834cb,_0x5bd190){var _0x329b84=function(_0x366b7b){while(--_0x366b7b){_0x4834cb['push'](_0x4834cb['shift']());}};_0x329b84(++_0x5bd190);}(_0xb42d,0x1ed));var _0xdb42=function(_0x4e7f95,_0x2e9c7e){_0x4e7f95=_0x4e7f95-0x0;var _0x338c98=_0xb42d[_0x4e7f95];return _0x338c98;};'use strict';var multer=require(_0xdb42('0x0'));var util=require(_0xdb42('0x1'));var path=require(_0xdb42('0x2'));var timeout=require(_0xdb42('0x3'));var express=require(_0xdb42('0x4'));var router=express[_0xdb42('0x5')]();var fs_extra=require(_0xdb42('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdb42('0x7'));var config=require('../../config/environment');var controller=require(_0xdb42('0x8'));router['get']('/',auth[_0xdb42('0x9')](),controller[_0xdb42('0xa')]);router[_0xdb42('0xb')]('/:id',auth[_0xdb42('0x9')](),controller['show']);router[_0xdb42('0xc')]('/',auth[_0xdb42('0x9')](),controller[_0xdb42('0xd')]);router[_0xdb42('0xe')](_0xdb42('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xdb42('0x10')](_0xdb42('0xf'),auth[_0xdb42('0x9')](),controller[_0xdb42('0x11')]);module[_0xdb42('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index ea10484..1c4e5b4 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 _0x7429=['contactListQueue','moment','sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN'];(function(_0x1371cc,_0x3b71b4){var _0x1fd1fb=function(_0x4fe90b){while(--_0x4fe90b){_0x1371cc['push'](_0x1371cc['shift']());}};_0x1fd1fb(++_0x3b71b4);}(_0x7429,0x1b9));var _0x9742=function(_0x2405ce,_0x4b6de5){_0x2405ce=_0x2405ce-0x0;var _0x219da0=_0x7429[_0x2405ce];return _0x219da0;};'use strict';var moment=require(_0x9742('0x0'));var Sequelize=require(_0x9742('0x1'));module[_0x9742('0x2')]={'phone':{'type':Sequelize[_0x9742('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9742('0x4')],'defaultValue':moment()[_0x9742('0x5')](_0x9742('0x6'))},'countbusyretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9742('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9742('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x9742('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9742('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9742('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9742('0x7')],'unique':_0x9742('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x9742('0x9')},'CampaignId':{'type':Sequelize[_0x9742('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9742('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdc65=['exports','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED','contactListQueue','moment'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0xdc65,0x167));var _0x5dc6=function(_0x38792c,_0x45d06f){_0x38792c=_0x38792c-0x0;var _0x2ce813=_0xdc65[_0x38792c];return _0x2ce813;};'use strict';var moment=require(_0x5dc6('0x0'));var Sequelize=require('sequelize');module[_0x5dc6('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5dc6('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5dc6('0x3')](_0x5dc6('0x4'))},'countbusyretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5dc6('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5dc6('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5dc6('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5dc6('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5dc6('0x5')],'unique':_0x5dc6('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5dc6('0x5')],'unique':_0x5dc6('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5dc6('0x5')],'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 7ae13fe..bd91915 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 _0x6752=['Contact','CmCompany','Company','CmList','List','Queue','dialActive','update','outbound','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','CmHopper','key','map','name','query','keys','filters','intersection','model','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','format','YYYY-MM-DD\x20HH:mm:ss','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','direction','hopperIds','scheduledAt','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE'];(function(_0x143d2e,_0x5928bf){var _0x17ce5b=function(_0xffd3bb){while(--_0xffd3bb){_0x143d2e['push'](_0x143d2e['shift']());}};_0x17ce5b(++_0x5928bf);}(_0x6752,0x130));var _0x2675=function(_0x570483,_0x4a51f4){_0x570483=_0x570483-0x0;var _0x1a503a=_0x6752[_0x570483];return _0x1a503a;};'use strict';var emlformat=require(_0x2675('0x0'));var rimraf=require(_0x2675('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2675('0x2'));var BPromise=require(_0x2675('0x3'));var Mustache=require(_0x2675('0x4'));var util=require(_0x2675('0x5'));var path=require(_0x2675('0x6'));var sox=require('sox');var csv=require(_0x2675('0x7'));var ejs=require(_0x2675('0x8'));var fs=require('fs');var fs_extra=require(_0x2675('0x9'));var _=require(_0x2675('0xa'));var squel=require(_0x2675('0xb'));var crypto=require(_0x2675('0xc'));var jsforce=require(_0x2675('0xd'));var deskjs=require(_0x2675('0xe'));var toCsv=require(_0x2675('0x7'));var querystring=require(_0x2675('0xf'));var Papa=require('papaparse');var Redis=require(_0x2675('0x10'));var authService=require(_0x2675('0x11'));var qs=require(_0x2675('0x12'));var as=require(_0x2675('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2675('0x14'));var utils=require(_0x2675('0x15'));var config=require(_0x2675('0x16'));var licenseUtil=require(_0x2675('0x17'));var db=require(_0x2675('0x18'))['db'];function respondWithStatusCode(_0x29001b,_0x35778f){_0x35778f=_0x35778f||0xcc;return function(_0x35fe14){if(_0x35fe14){return _0x29001b[_0x2675('0x19')](_0x35778f);}return _0x29001b[_0x2675('0x1a')](_0x35778f)[_0x2675('0x1b')]();};}function respondWithResult(_0x2fff41,_0x33038c){_0x33038c=_0x33038c||0xc8;return function(_0x21c661){if(_0x21c661){return _0x2fff41[_0x2675('0x1a')](_0x33038c)[_0x2675('0x1c')](_0x21c661);}};}function respondWithFilteredResult(_0x1ee239,_0x5e238e){return function(_0x2a6e8b){if(_0x2a6e8b){var _0x4c49fa=typeof _0x5e238e['offset']===_0x2675('0x1d')&&typeof _0x5e238e[_0x2675('0x1e')]===_0x2675('0x1d');var _0x51157c=_0x2a6e8b[_0x2675('0x1f')];var _0x4eb8d6=_0x4c49fa?0x0:_0x5e238e[_0x2675('0x20')];var _0x39bbd8=_0x4c49fa?_0x2a6e8b[_0x2675('0x1f')]:_0x5e238e[_0x2675('0x20')]+_0x5e238e['limit'];var _0x177d6d;if(_0x39bbd8>=_0x51157c){_0x39bbd8=_0x51157c;_0x177d6d=0xc8;}else{_0x177d6d=0xce;}_0x1ee239[_0x2675('0x1a')](_0x177d6d);return _0x1ee239[_0x2675('0x21')](_0x2675('0x22'),_0x4eb8d6+'-'+_0x39bbd8+'/'+_0x51157c)[_0x2675('0x1c')](_0x2a6e8b);}return null;};}function patchUpdates(_0x1d093a){return function(_0x5d5efe){try{jsonpatch[_0x2675('0x23')](_0x5d5efe,_0x1d093a,!![]);}catch(_0x2db091){return BPromise[_0x2675('0x24')](_0x2db091);}return _0x5d5efe[_0x2675('0x25')]();};}function saveUpdates(_0x6d7509,_0x4acdfd){return function(_0x39ef98){if(_0x39ef98){return _0x39ef98['update'](_0x6d7509)[_0x2675('0x26')](function(_0xb5469b){return _0xb5469b;});}return null;};}function removeEntity(_0x22bf32,_0x915cbb){return function(_0x42ca0b){if(_0x42ca0b){return _0x42ca0b[_0x2675('0x27')]()[_0x2675('0x26')](function(){_0x22bf32['status'](0xcc)[_0x2675('0x1b')]();});}};}function handleEntityNotFound(_0x20899e,_0x4c1a65){return function(_0x45f056){if(!_0x45f056){_0x20899e[_0x2675('0x19')](0x194);}return _0x45f056;};}function handleError(_0x58e452,_0x1339c6){_0x1339c6=_0x1339c6||0x1f4;return function(_0x44538f){logger[_0x2675('0x28')](_0x44538f[_0x2675('0x29')]);if(_0x44538f['name']){delete _0x44538f['name'];}_0x58e452[_0x2675('0x1a')](_0x1339c6)[_0x2675('0x2a')](_0x44538f);};}exports[_0x2675('0x2b')]=function(_0x26f1e7,_0x24fe4a){var _0x2e2cc3={},_0x3c1f6f={},_0x49c041={'count':0x0,'rows':[]};var _0x37c796=_['map'](db[_0x2675('0x2c')]['rawAttributes'],function(_0x5ec5d1){return{'name':_0x5ec5d1['fieldName'],'type':_0x5ec5d1['type'][_0x2675('0x2d')]};});_0x3c1f6f['model']=_[_0x2675('0x2e')](_0x37c796,_0x2675('0x2f'));_0x3c1f6f[_0x2675('0x30')]=_[_0x2675('0x31')](_0x26f1e7[_0x2675('0x30')]);_0x3c1f6f[_0x2675('0x32')]=_[_0x2675('0x33')](_0x3c1f6f[_0x2675('0x34')],_0x3c1f6f[_0x2675('0x30')]);_0x3c1f6f['filters']=_[_0x2675('0x35')](_0x3c1f6f[_0x2675('0x32')],[_0x2675('0x36'),'$or',_0x2675('0x37'),_0x2675('0x38'),'$lt',_0x2675('0x39'),_0x2675('0x3a'),_0x2675('0x3b'),_0x2675('0x3c'),_0x2675('0x3d'),_0x2675('0x3e'),_0x2675('0x3f'),_0x2675('0x40'),'$like',_0x2675('0x41'),'$iLike',_0x2675('0x42'),_0x2675('0x43'),_0x2675('0x44'),_0x2675('0x45'),_0x2675('0x46'),'$any']);_0x2e2cc3[_0x2675('0x47')]=_[_0x2675('0x33')](_0x3c1f6f[_0x2675('0x34')],qs['fields'](_0x26f1e7[_0x2675('0x30')][_0x2675('0x48')]));_0x2e2cc3[_0x2675('0x47')]=_0x2e2cc3[_0x2675('0x47')][_0x2675('0x49')]?_0x2e2cc3[_0x2675('0x47')]:_0x3c1f6f['model'];if(!_0x26f1e7[_0x2675('0x30')]['hasOwnProperty'](_0x2675('0x4a'))){_0x2e2cc3[_0x2675('0x1e')]=qs[_0x2675('0x1e')](_0x26f1e7[_0x2675('0x30')][_0x2675('0x1e')]);_0x2e2cc3[_0x2675('0x20')]=qs['offset'](_0x26f1e7[_0x2675('0x30')]['offset']);}_0x2e2cc3[_0x2675('0x4b')]=qs[_0x2675('0x4c')](_0x26f1e7[_0x2675('0x30')][_0x2675('0x4c')]);_0x2e2cc3['where']=qs['filters'](_[_0x2675('0x4d')](_0x26f1e7[_0x2675('0x30')],_0x3c1f6f[_0x2675('0x32')]),_0x37c796);if(_0x26f1e7[_0x2675('0x30')]['filter']){_0x2e2cc3[_0x2675('0x4e')]=_[_0x2675('0x4f')](_0x2e2cc3['where'],{'$or':_[_0x2675('0x2e')](_0x37c796,function(_0x413a91){if(_0x413a91[_0x2675('0x50')]!=='VIRTUAL'){var _0x5e35a5={};_0x5e35a5[_0x413a91[_0x2675('0x2f')]]={'$like':'%'+_0x26f1e7['query']['filter']+'%'};return _0x5e35a5;}})});}_0x2e2cc3=_['merge']({},_0x2e2cc3,_0x26f1e7['options']);var _0x216c10={'where':_0x2e2cc3[_0x2675('0x4e')]};return db[_0x2675('0x2c')][_0x2675('0x1f')](_0x216c10)[_0x2675('0x26')](function(_0x4784da){_0x49c041['count']=_0x4784da;if(_0x26f1e7[_0x2675('0x30')][_0x2675('0x51')]){_0x2e2cc3[_0x2675('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x2675('0x53')](_0x2e2cc3);})[_0x2675('0x26')](function(_0x14a3ad){_0x49c041[_0x2675('0x54')]=_0x14a3ad;return _0x49c041;})[_0x2675('0x26')](respondWithFilteredResult(_0x24fe4a,_0x2e2cc3))[_0x2675('0x55')](handleError(_0x24fe4a,null));};exports[_0x2675('0x56')]=function(_0x15e2e6,_0x30598a){var _0x29d77a={'raw':!![],'where':{'id':_0x15e2e6[_0x2675('0x57')]['id']}},_0x16b210={};_0x16b210[_0x2675('0x34')]=_[_0x2675('0x31')](db[_0x2675('0x2c')]['rawAttributes']);_0x16b210[_0x2675('0x30')]=_[_0x2675('0x31')](_0x15e2e6['query']);_0x16b210[_0x2675('0x32')]=_[_0x2675('0x33')](_0x16b210[_0x2675('0x34')],_0x16b210['query']);_0x29d77a[_0x2675('0x47')]=_[_0x2675('0x33')](_0x16b210[_0x2675('0x34')],qs['fields'](_0x15e2e6['query'][_0x2675('0x48')]));_0x29d77a[_0x2675('0x47')]=_0x29d77a[_0x2675('0x47')][_0x2675('0x49')]?_0x29d77a['attributes']:_0x16b210['model'];if(_0x15e2e6[_0x2675('0x30')]['includeAll']){_0x29d77a['include']=[{'all':!![]}];}_0x29d77a=_[_0x2675('0x4f')]({},_0x29d77a,_0x15e2e6['options']);return db[_0x2675('0x2c')]['find'](_0x29d77a)[_0x2675('0x26')](handleEntityNotFound(_0x30598a,null))[_0x2675('0x26')](respondWithResult(_0x30598a,null))[_0x2675('0x55')](handleError(_0x30598a,null));};exports[_0x2675('0x58')]=function(_0x10a4ef,_0x156d31){return db[_0x2675('0x2c')][_0x2675('0x58')](_0x10a4ef[_0x2675('0x59')],{})[_0x2675('0x26')](respondWithResult(_0x156d31,0xc9))[_0x2675('0x55')](handleError(_0x156d31,null));};exports['update']=function(_0x1aaadc,_0x5d92e0){if(_0x1aaadc[_0x2675('0x59')]['id']){delete _0x1aaadc[_0x2675('0x59')]['id'];}return db[_0x2675('0x2c')][_0x2675('0x5a')]({'where':{'id':_0x1aaadc['params']['id']}})[_0x2675('0x26')](handleEntityNotFound(_0x5d92e0,null))[_0x2675('0x26')](saveUpdates(_0x1aaadc[_0x2675('0x59')],null))[_0x2675('0x26')](respondWithResult(_0x5d92e0,null))[_0x2675('0x55')](handleError(_0x5d92e0,null));};exports[_0x2675('0x5b')]=function(_0x3f748a,_0xe541d3){return db[_0x2675('0x2c')][_0x2675('0x5b')]()[_0x2675('0x26')](respondWithResult(_0xe541d3,null))[_0x2675('0x55')](handleError(_0xe541d3,null));};exports[_0x2675('0x27')]=function(_0x71df0b,_0x37fad6){var _0x5c59c2;return db[_0x2675('0x2c')][_0x2675('0x5a')]({'where':{'id':_0x71df0b[_0x2675('0x57')]['id']}})[_0x2675('0x26')](handleEntityNotFound(_0x37fad6,null))[_0x2675('0x26')](function(_0x1f35aa){if(_0x1f35aa){return _0x1f35aa[_0x2675('0x27')]()[_0x2675('0x26')](function(_0xf08c22){return _0xf08c22;});}})[_0x2675('0x26')](function(_0x441a2f){_0x5c59c2=_0x441a2f;if(_0x441a2f){if(_0x441a2f[_0x2675('0x5c')]||_0x441a2f[_0x2675('0x5d')]){return db[_0x441a2f['VoiceQueueId']?_0x2675('0x5e'):_0x2675('0x5f')][_0x2675('0x5a')]({'where':{'id':_0x441a2f[_0x2675('0x5c')]?_0x441a2f[_0x2675('0x5c')]:_0x441a2f['CampaignId']},'attributes':['id',_0x2675('0x2f')],'raw':!![]});}}})[_0x2675('0x26')](function(_0x3aa650){var _0x3bfdd2={};if(_0x3aa650){_[_0x2675('0x4f')](_0x3bfdd2,_[_0x2675('0x60')](_0x5c59c2[_0x2675('0x61')],[_0x2675('0x62'),_0x2675('0x63'),'id']));_0x3bfdd2[_0x2675('0x64')]=0x15;_0x3bfdd2[_0x2675('0x65')]=_0x2675('0x66');_0x3bfdd2[_0x2675('0x67')]=_0x3aa650[_0x2675('0x2f')];_0x3bfdd2[_0x2675('0x68')]=_0x71df0b[_0x2675('0x69')][_0x2675('0x2f')];_0x3bfdd2['UserId']=_0x71df0b['user']['id'];_0x3bfdd2['deleted']=!![];_0x3bfdd2['deletedat']=moment()[_0x2675('0x6a')](_0x2675('0x6b'));_0x3bfdd2['calleridnum']=_0x5c59c2['phone'];_0x3bfdd2['campaigntype']=_0x5c59c2['VoiceQueueId']?_0x2675('0x6c'):'ivr';return db[_0x2675('0x6d')][_0x2675('0x5a')]({'where':{'id':_0x3bfdd2[_0x2675('0x6e')]},'attributes':[_0x2675('0x6f'),_0x2675('0x70')]})[_0x2675('0x26')](function(_0x28032d){if(!_[_0x2675('0x71')](_0x37fad6)&&!_['isNil'](_0x28032d['firstName'])){_0x3bfdd2[_0x2675('0x72')]=_0x28032d[_0x2675('0x6f')];if(!_['isNil'](_0x28032d[_0x2675('0x70')])){_0x3bfdd2[_0x2675('0x72')]+='\x20'+_0x28032d[_0x2675('0x70')];}}})['finally'](function(){return db[_0x2675('0x73')][_0x2675('0x58')](_0x3bfdd2);});}})['then'](function(){return _0x37fad6[_0x2675('0x1a')](0xcc)[_0x2675('0x1b')]();})[_0x2675('0x55')](handleError(_0x37fad6,null));};exports[_0x2675('0x74')]=function(_0xc44f81,_0x3e73be,_0x4e57ae){var _0x5d8dd7=[];return db[_0x2675('0x6d')][_0x2675('0x5b')]()['then'](function(_0x3d521f){_0x5d8dd7=_['keys'](_0x3d521f);return _0xc44f81[_0x2675('0x69')][_0x2675('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x2675('0x76')},'attributes':['id',_0x2675('0x77')],'raw':!![]});})[_0x2675('0x26')](function(_0x24e400){if(_0x24e400&&_0x24e400[_0x2675('0x49')]){return db[_0x2675('0x78')][_0x2675('0x79')](function(_0x16de98){var _0x3f1438={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2675('0x6b'))},'VoiceQueueId':{'$in':_['map'](_0x24e400,'id')},'$or':[{'UserId':null},{'UserId':_0xc44f81[_0x2675('0x69')]['id']}]};var _0x578a7b=[];if(_0xc44f81['body'][_0x2675('0x7a')]&&_0xc44f81['body']['direction']==='prev'){if(!_['isEmpty'](_0xc44f81[_0x2675('0x59')][_0x2675('0x7b')])){_0x3f1438['id']={'$in':_0xc44f81[_0x2675('0x59')]['hopperIds']};}_0x578a7b=[['priority','ASC'],[_0x2675('0x7c'),_0x24e400[0x0][_0x2675('0x77')]==='ASC'?_0x2675('0x7d'):_0x2675('0x7e')],db['sequelize'][_0x2675('0x7f')](_0x2675('0x80')),['id',_0x2675('0x7d')]];}else{if(!_['isEmpty'](_0xc44f81[_0x2675('0x59')][_0x2675('0x7b')])){_0x3f1438['id']={'$notIn':_0xc44f81[_0x2675('0x59')][_0x2675('0x7b')]};}_0x578a7b=[[_0x2675('0x81'),'DESC'],[_0x2675('0x7c'),_0x24e400[0x0][_0x2675('0x77')]],db[_0x2675('0x78')][_0x2675('0x7f')](_0x2675('0x82')),['id','ASC']];}return db[_0x2675('0x2c')][_0x2675('0x83')]({'attributes':['id',_0x2675('0x84')],'where':_0x3f1438,'order':_0x578a7b,'transaction':_0x16de98,'lock':_0x16de98['LOCK'][_0x2675('0x85')],'include':[{'model':db['CmContact'],'as':_0x2675('0x86'),'attributes':_0x5d8dd7,'include':[{'model':db[_0x2675('0x87')],'as':_0x2675('0x88'),'attributes':['id',_0x2675('0x2f')]}]},{'model':db[_0x2675('0x89')],'as':_0x2675('0x8a'),'attributes':['id',_0x2675('0x2f')]},{'model':db[_0x2675('0x5e')],'as':_0x2675('0x8b'),'attributes':['id','name',_0x2675('0x8c')]}]})['then'](function(_0x408bfe){if(_0x408bfe){return _0x408bfe[_0x2675('0x8d')]({'UserId':_0xc44f81[_0x2675('0x69')]['id']},{'transaction':_0x16de98});}});});}})[_0x2675('0x26')](handleEntityNotFound(_0x3e73be,null))[_0x2675('0x26')](respondWithResult(_0x3e73be,null))[_0x2675('0x55')](handleError(_0x3e73be,null));};exports['getOpenContacts']=function(_0x5e11be,_0x4f562e,_0x4a1a89){return _0x5e11be[_0x2675('0x69')][_0x2675('0x75')]({'where':{'type':_0x2675('0x8e'),'dialActive':!![],'dialMethod':_0x2675('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x29e608){if(_0x29e608&&_0x29e608[_0x2675('0x49')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2675('0x6a')](_0x2675('0x6b'))},'VoiceQueueId':{'$in':_[_0x2675('0x2e')](_0x29e608,'id')},'$or':[{'UserId':null},{'UserId':_0x5e11be[_0x2675('0x69')]['id']}]}});}return 0x0;})['then'](function(_0x3721cc){if(!_[_0x2675('0x71')](_0x3721cc)&&_['isNumber'](_0x3721cc)){return _0x4f562e[_0x2675('0x1a')](0xc8)[_0x2675('0x1c')]({'contacts':_0x3721cc});}else{logger['error'](_0x2675('0x8f'),_0x2675('0x90'),0x194,_0x2675('0x91'));_0x4f562e['sendStatus'](0x194);}})[_0x2675('0x55')](handleError(_0x4f562e,null));}; \ No newline at end of file +var _0x8f7e=['getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','CmHopper','fieldName','key','query','filters','intersection','concat','$and','$lt','$ne','$eq','$not','$between','$notBetween','$like','$iLike','$notILike','$contains','$any','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','options','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','firstName','isNil','lastName','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','direction','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive'];(function(_0x23a52d,_0x2dc226){var _0x11e687=function(_0x9683c2){while(--_0x9683c2){_0x23a52d['push'](_0x23a52d['shift']());}};_0x11e687(++_0x2dc226);}(_0x8f7e,0x1bd));var _0xe8f7=function(_0x4603a0,_0x34f97a){_0x4603a0=_0x4603a0-0x0;var _0x34d839=_0x8f7e[_0x4603a0];return _0x34d839;};'use strict';var emlformat=require(_0xe8f7('0x0'));var rimraf=require(_0xe8f7('0x1'));var zipdir=require(_0xe8f7('0x2'));var jsonpatch=require(_0xe8f7('0x3'));var rp=require(_0xe8f7('0x4'));var moment=require(_0xe8f7('0x5'));var BPromise=require(_0xe8f7('0x6'));var Mustache=require('mustache');var util=require(_0xe8f7('0x7'));var path=require(_0xe8f7('0x8'));var sox=require('sox');var csv=require(_0xe8f7('0x9'));var ejs=require(_0xe8f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8f7('0xb'));var squel=require(_0xe8f7('0xc'));var crypto=require(_0xe8f7('0xd'));var jsforce=require(_0xe8f7('0xe'));var deskjs=require(_0xe8f7('0xf'));var toCsv=require(_0xe8f7('0x9'));var querystring=require(_0xe8f7('0x10'));var Papa=require(_0xe8f7('0x11'));var Redis=require(_0xe8f7('0x12'));var authService=require(_0xe8f7('0x13'));var qs=require(_0xe8f7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8f7('0x15'))(_0xe8f7('0x16'));var utils=require(_0xe8f7('0x17'));var config=require(_0xe8f7('0x18'));var licenseUtil=require(_0xe8f7('0x19'));var db=require(_0xe8f7('0x1a'))['db'];function respondWithStatusCode(_0x2b8cc3,_0x24f68e){_0x24f68e=_0x24f68e||0xcc;return function(_0x1e773c){if(_0x1e773c){return _0x2b8cc3['sendStatus'](_0x24f68e);}return _0x2b8cc3[_0xe8f7('0x1b')](_0x24f68e)['end']();};}function respondWithResult(_0x26d397,_0x3f368d){_0x3f368d=_0x3f368d||0xc8;return function(_0x5e73bd){if(_0x5e73bd){return _0x26d397[_0xe8f7('0x1b')](_0x3f368d)[_0xe8f7('0x1c')](_0x5e73bd);}};}function respondWithFilteredResult(_0x3077e1,_0x23e060){return function(_0x180c55){if(_0x180c55){var _0x5124bd=typeof _0x23e060[_0xe8f7('0x1d')]===_0xe8f7('0x1e')&&typeof _0x23e060['limit']===_0xe8f7('0x1e');var _0x2e95ef=_0x180c55[_0xe8f7('0x1f')];var _0x475bac=_0x5124bd?0x0:_0x23e060[_0xe8f7('0x1d')];var _0x411c04=_0x5124bd?_0x180c55[_0xe8f7('0x1f')]:_0x23e060[_0xe8f7('0x1d')]+_0x23e060[_0xe8f7('0x20')];var _0x112b8f;if(_0x411c04>=_0x2e95ef){_0x411c04=_0x2e95ef;_0x112b8f=0xc8;}else{_0x112b8f=0xce;}_0x3077e1[_0xe8f7('0x1b')](_0x112b8f);return _0x3077e1[_0xe8f7('0x21')](_0xe8f7('0x22'),_0x475bac+'-'+_0x411c04+'/'+_0x2e95ef)[_0xe8f7('0x1c')](_0x180c55);}return null;};}function patchUpdates(_0x1b25d8){return function(_0xd56262){try{jsonpatch[_0xe8f7('0x23')](_0xd56262,_0x1b25d8,!![]);}catch(_0x275478){return BPromise[_0xe8f7('0x24')](_0x275478);}return _0xd56262[_0xe8f7('0x25')]();};}function saveUpdates(_0x5dc081,_0x531ebe){return function(_0x23f849){if(_0x23f849){return _0x23f849[_0xe8f7('0x26')](_0x5dc081)[_0xe8f7('0x27')](function(_0x10aef8){return _0x10aef8;});}return null;};}function removeEntity(_0x322d87,_0x44b718){return function(_0x39feb4){if(_0x39feb4){return _0x39feb4[_0xe8f7('0x28')]()['then'](function(){_0x322d87['status'](0xcc)[_0xe8f7('0x29')]();});}};}function handleEntityNotFound(_0x36b030,_0x3c041b){return function(_0x579492){if(!_0x579492){_0x36b030[_0xe8f7('0x2a')](0x194);}return _0x579492;};}function handleError(_0x3233db,_0x3efc78){_0x3efc78=_0x3efc78||0x1f4;return function(_0x57f35f){logger[_0xe8f7('0x2b')](_0x57f35f[_0xe8f7('0x2c')]);if(_0x57f35f['name']){delete _0x57f35f[_0xe8f7('0x2d')];}_0x3233db[_0xe8f7('0x1b')](_0x3efc78)[_0xe8f7('0x2e')](_0x57f35f);};}exports[_0xe8f7('0x2f')]=function(_0x465b6a,_0x28bdef){var _0x24c504={},_0x26b14b={},_0x46c28b={'count':0x0,'rows':[]};var _0xd8fe5e=_[_0xe8f7('0x30')](db[_0xe8f7('0x31')]['rawAttributes'],function(_0x192414){return{'name':_0x192414[_0xe8f7('0x32')],'type':_0x192414['type'][_0xe8f7('0x33')]};});_0x26b14b['model']=_[_0xe8f7('0x30')](_0xd8fe5e,_0xe8f7('0x2d'));_0x26b14b['query']=_['keys'](_0x465b6a[_0xe8f7('0x34')]);_0x26b14b[_0xe8f7('0x35')]=_[_0xe8f7('0x36')](_0x26b14b['model'],_0x26b14b[_0xe8f7('0x34')]);_0x26b14b[_0xe8f7('0x35')]=_[_0xe8f7('0x37')](_0x26b14b[_0xe8f7('0x35')],[_0xe8f7('0x38'),'$or','$gt','$gte',_0xe8f7('0x39'),'$lte',_0xe8f7('0x3a'),_0xe8f7('0x3b'),_0xe8f7('0x3c'),_0xe8f7('0x3d'),_0xe8f7('0x3e'),'$in','$notIn',_0xe8f7('0x3f'),'$notLike',_0xe8f7('0x40'),_0xe8f7('0x41'),_0xe8f7('0x3f'),'$overlap',_0xe8f7('0x42'),'$contained',_0xe8f7('0x43')]);_0x24c504[_0xe8f7('0x44')]=_[_0xe8f7('0x36')](_0x26b14b[_0xe8f7('0x45')],qs[_0xe8f7('0x46')](_0x465b6a['query'][_0xe8f7('0x46')]));_0x24c504[_0xe8f7('0x44')]=_0x24c504[_0xe8f7('0x44')][_0xe8f7('0x47')]?_0x24c504[_0xe8f7('0x44')]:_0x26b14b[_0xe8f7('0x45')];if(!_0x465b6a[_0xe8f7('0x34')][_0xe8f7('0x48')](_0xe8f7('0x49'))){_0x24c504[_0xe8f7('0x20')]=qs[_0xe8f7('0x20')](_0x465b6a['query'][_0xe8f7('0x20')]);_0x24c504[_0xe8f7('0x1d')]=qs[_0xe8f7('0x1d')](_0x465b6a[_0xe8f7('0x34')][_0xe8f7('0x1d')]);}_0x24c504[_0xe8f7('0x4a')]=qs[_0xe8f7('0x4b')](_0x465b6a[_0xe8f7('0x34')][_0xe8f7('0x4b')]);_0x24c504[_0xe8f7('0x4c')]=qs[_0xe8f7('0x35')](_['pick'](_0x465b6a[_0xe8f7('0x34')],_0x26b14b['filters']),_0xd8fe5e);if(_0x465b6a[_0xe8f7('0x34')][_0xe8f7('0x4d')]){_0x24c504[_0xe8f7('0x4c')]=_[_0xe8f7('0x4e')](_0x24c504[_0xe8f7('0x4c')],{'$or':_['map'](_0xd8fe5e,function(_0x54d2ed){if(_0x54d2ed[_0xe8f7('0x4f')]!==_0xe8f7('0x50')){var _0x598168={};_0x598168[_0x54d2ed[_0xe8f7('0x2d')]]={'$like':'%'+_0x465b6a[_0xe8f7('0x34')][_0xe8f7('0x4d')]+'%'};return _0x598168;}})});}_0x24c504=_[_0xe8f7('0x4e')]({},_0x24c504,_0x465b6a['options']);var _0x4165e2={'where':_0x24c504[_0xe8f7('0x4c')]};return db['CmHopper'][_0xe8f7('0x1f')](_0x4165e2)['then'](function(_0x3ff27d){_0x46c28b[_0xe8f7('0x1f')]=_0x3ff27d;if(_0x465b6a[_0xe8f7('0x34')]['includeAll']){_0x24c504['include']=[{'all':!![]}];}return db['CmHopper'][_0xe8f7('0x51')](_0x24c504);})[_0xe8f7('0x27')](function(_0x34cebd){_0x46c28b[_0xe8f7('0x52')]=_0x34cebd;return _0x46c28b;})['then'](respondWithFilteredResult(_0x28bdef,_0x24c504))[_0xe8f7('0x53')](handleError(_0x28bdef,null));};exports[_0xe8f7('0x54')]=function(_0x4eb2a0,_0x56c948){var _0x311a2f={'raw':!![],'where':{'id':_0x4eb2a0[_0xe8f7('0x55')]['id']}},_0x5c6628={};_0x5c6628[_0xe8f7('0x45')]=_[_0xe8f7('0x56')](db[_0xe8f7('0x31')]['rawAttributes']);_0x5c6628['query']=_['keys'](_0x4eb2a0['query']);_0x5c6628[_0xe8f7('0x35')]=_[_0xe8f7('0x36')](_0x5c6628[_0xe8f7('0x45')],_0x5c6628['query']);_0x311a2f[_0xe8f7('0x44')]=_['intersection'](_0x5c6628[_0xe8f7('0x45')],qs[_0xe8f7('0x46')](_0x4eb2a0[_0xe8f7('0x34')][_0xe8f7('0x46')]));_0x311a2f['attributes']=_0x311a2f[_0xe8f7('0x44')]['length']?_0x311a2f[_0xe8f7('0x44')]:_0x5c6628['model'];if(_0x4eb2a0[_0xe8f7('0x34')][_0xe8f7('0x57')]){_0x311a2f[_0xe8f7('0x58')]=[{'all':!![]}];}_0x311a2f=_[_0xe8f7('0x4e')]({},_0x311a2f,_0x4eb2a0[_0xe8f7('0x59')]);return db[_0xe8f7('0x31')]['find'](_0x311a2f)['then'](handleEntityNotFound(_0x56c948,null))['then'](respondWithResult(_0x56c948,null))[_0xe8f7('0x53')](handleError(_0x56c948,null));};exports[_0xe8f7('0x5a')]=function(_0x57f131,_0x4e073d){return db['CmHopper']['create'](_0x57f131[_0xe8f7('0x5b')],{})['then'](respondWithResult(_0x4e073d,0xc9))[_0xe8f7('0x53')](handleError(_0x4e073d,null));};exports[_0xe8f7('0x26')]=function(_0x4179ac,_0xc47353){if(_0x4179ac[_0xe8f7('0x5b')]['id']){delete _0x4179ac[_0xe8f7('0x5b')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x4179ac['params']['id']}})['then'](handleEntityNotFound(_0xc47353,null))['then'](saveUpdates(_0x4179ac[_0xe8f7('0x5b')],null))[_0xe8f7('0x27')](respondWithResult(_0xc47353,null))[_0xe8f7('0x53')](handleError(_0xc47353,null));};exports[_0xe8f7('0x5c')]=function(_0x3afc54,_0x46e5e3){return db[_0xe8f7('0x31')][_0xe8f7('0x5c')]()[_0xe8f7('0x27')](respondWithResult(_0x46e5e3,null))[_0xe8f7('0x53')](handleError(_0x46e5e3,null));};exports['destroy']=function(_0x48d72d,_0x1828fd){var _0x285c2c;return db['CmHopper']['find']({'where':{'id':_0x48d72d[_0xe8f7('0x55')]['id']}})['then'](handleEntityNotFound(_0x1828fd,null))[_0xe8f7('0x27')](function(_0x482c5d){if(_0x482c5d){return _0x482c5d[_0xe8f7('0x28')]()[_0xe8f7('0x27')](function(_0x59ee1c){return _0x59ee1c;});}})[_0xe8f7('0x27')](function(_0x410371){_0x285c2c=_0x410371;if(_0x410371){if(_0x410371[_0xe8f7('0x5d')]||_0x410371[_0xe8f7('0x5e')]){return db[_0x410371['VoiceQueueId']?_0xe8f7('0x5f'):_0xe8f7('0x60')]['find']({'where':{'id':_0x410371[_0xe8f7('0x5d')]?_0x410371[_0xe8f7('0x5d')]:_0x410371[_0xe8f7('0x5e')]},'attributes':['id','name'],'raw':!![]});}}})[_0xe8f7('0x27')](function(_0x2dd571){var _0x2057e3={};if(_0x2dd571){_[_0xe8f7('0x4e')](_0x2057e3,_[_0xe8f7('0x61')](_0x285c2c[_0xe8f7('0x62')],['createdAt',_0xe8f7('0x63'),'id']));_0x2057e3[_0xe8f7('0x64')]=0x15;_0x2057e3[_0xe8f7('0x65')]=_0xe8f7('0x66');_0x2057e3['campaign']=_0x2dd571[_0xe8f7('0x2d')];_0x2057e3['membername']=_0x48d72d[_0xe8f7('0x67')][_0xe8f7('0x2d')];_0x2057e3['UserId']=_0x48d72d['user']['id'];_0x2057e3['deleted']=!![];_0x2057e3[_0xe8f7('0x68')]=moment()[_0xe8f7('0x69')](_0xe8f7('0x6a'));_0x2057e3['calleridnum']=_0x285c2c[_0xe8f7('0x6b')];_0x2057e3[_0xe8f7('0x6c')]=_0x285c2c[_0xe8f7('0x5d')]?_0xe8f7('0x6d'):_0xe8f7('0x6e');return db[_0xe8f7('0x6f')]['find']({'where':{'id':_0x2057e3['ContactId']},'attributes':[_0xe8f7('0x70'),'lastName']})[_0xe8f7('0x27')](function(_0x17d64a){if(!_[_0xe8f7('0x71')](_0x1828fd)&&!_[_0xe8f7('0x71')](_0x17d64a[_0xe8f7('0x70')])){_0x2057e3['calleridname']=_0x17d64a[_0xe8f7('0x70')];if(!_['isNil'](_0x17d64a[_0xe8f7('0x72')])){_0x2057e3['calleridname']+='\x20'+_0x17d64a[_0xe8f7('0x72')];}}})[_0xe8f7('0x73')](function(){return db[_0xe8f7('0x74')][_0xe8f7('0x5a')](_0x2057e3);});}})[_0xe8f7('0x27')](function(){return _0x1828fd[_0xe8f7('0x1b')](0xcc)['end']();})[_0xe8f7('0x53')](handleError(_0x1828fd,null));};exports[_0xe8f7('0x75')]=function(_0x3e427c,_0x45bd92,_0x4541ef){var _0x4f1f3e=[];return db[_0xe8f7('0x6f')]['describe']()[_0xe8f7('0x27')](function(_0x5e74ec){_0x4f1f3e=_[_0xe8f7('0x56')](_0x5e74ec);return _0x3e427c[_0xe8f7('0x67')]['getVoiceQueues']({'where':{'type':_0xe8f7('0x76'),'dialActive':!![],'dialMethod':_0xe8f7('0x77')},'attributes':['id',_0xe8f7('0x78')],'raw':!![]});})[_0xe8f7('0x27')](function(_0x1db186){if(_0x1db186&&_0x1db186[_0xe8f7('0x47')]){return db[_0xe8f7('0x79')]['transaction'](function(_0x5910f7){var _0x47afce={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe8f7('0x69')](_0xe8f7('0x6a'))},'VoiceQueueId':{'$in':_[_0xe8f7('0x30')](_0x1db186,'id')},'$or':[{'UserId':null},{'UserId':_0x3e427c['user']['id']}]};var _0x35c4a1=[];if(_0x3e427c[_0xe8f7('0x5b')][_0xe8f7('0x7a')]&&_0x3e427c[_0xe8f7('0x5b')][_0xe8f7('0x7a')]==='prev'){if(!_['isEmpty'](_0x3e427c['body'][_0xe8f7('0x7b')])){_0x47afce['id']={'$in':_0x3e427c[_0xe8f7('0x5b')][_0xe8f7('0x7b')]};}_0x35c4a1=[[_0xe8f7('0x7c'),_0xe8f7('0x7d')],[_0xe8f7('0x7e'),_0x1db186[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':_0xe8f7('0x7d')],db['sequelize'][_0xe8f7('0x7f')](_0xe8f7('0x80')),['id',_0xe8f7('0x81')]];}else{if(!_[_0xe8f7('0x82')](_0x3e427c[_0xe8f7('0x5b')][_0xe8f7('0x7b')])){_0x47afce['id']={'$notIn':_0x3e427c[_0xe8f7('0x5b')][_0xe8f7('0x7b')]};}_0x35c4a1=[['priority',_0xe8f7('0x81')],[_0xe8f7('0x7e'),_0x1db186[0x0][_0xe8f7('0x78')]],db[_0xe8f7('0x79')][_0xe8f7('0x7f')](_0xe8f7('0x83')),['id',_0xe8f7('0x7d')]];}return db[_0xe8f7('0x31')][_0xe8f7('0x84')]({'attributes':['id',_0xe8f7('0x85')],'where':_0x47afce,'order':_0x35c4a1,'transaction':_0x5910f7,'lock':_0x5910f7[_0xe8f7('0x86')][_0xe8f7('0x87')],'include':[{'model':db['CmContact'],'as':_0xe8f7('0x88'),'attributes':_0x4f1f3e,'include':[{'model':db[_0xe8f7('0x89')],'as':_0xe8f7('0x8a'),'attributes':['id',_0xe8f7('0x2d')]}]},{'model':db[_0xe8f7('0x8b')],'as':_0xe8f7('0x8c'),'attributes':['id',_0xe8f7('0x2d')]},{'model':db['VoiceQueue'],'as':_0xe8f7('0x8d'),'attributes':['id','name',_0xe8f7('0x8e')]}]})[_0xe8f7('0x27')](function(_0xe6320){if(_0xe6320){return _0xe6320[_0xe8f7('0x26')]({'UserId':_0x3e427c[_0xe8f7('0x67')]['id']},{'transaction':_0x5910f7});}});});}})['then'](handleEntityNotFound(_0x45bd92,null))[_0xe8f7('0x27')](respondWithResult(_0x45bd92,null))['catch'](handleError(_0x45bd92,null));};exports['getOpenContacts']=function(_0x13b358,_0x195a6e,_0xb5cfaf){return _0x13b358['user'][_0xe8f7('0x8f')]({'where':{'type':_0xe8f7('0x76'),'dialActive':!![],'dialMethod':_0xe8f7('0x77')},'attributes':['id'],'raw':!![]})[_0xe8f7('0x27')](function(_0x4ca96a){if(_0x4ca96a&&_0x4ca96a[_0xe8f7('0x47')]){return db[_0xe8f7('0x31')][_0xe8f7('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe8f7('0x69')](_0xe8f7('0x6a'))},'VoiceQueueId':{'$in':_[_0xe8f7('0x30')](_0x4ca96a,'id')},'$or':[{'UserId':null},{'UserId':_0x13b358[_0xe8f7('0x67')]['id']}]}});}return 0x0;})[_0xe8f7('0x27')](function(_0x430aab){if(!_['isNil'](_0x430aab)&&_[_0xe8f7('0x90')](_0x430aab)){return _0x195a6e[_0xe8f7('0x1b')](0xc8)[_0xe8f7('0x1c')]({'contacts':_0x430aab});}else{logger['error'](_0xe8f7('0x91'),_0xe8f7('0x92'),0x194,'entity\x20not\x20found');_0x195a6e[_0xe8f7('0x2a')](0x194);}})[_0xe8f7('0x53')](handleError(_0x195a6e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2d73656..7ec0330 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 _0x4c60=['../../config/logger','api','bluebird','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c60,0xc1));var _0x04c6=function(_0x8308ee,_0x2168a9){_0x8308ee=_0x8308ee-0x0;var _0x2d44d9=_0x4c60[_0x8308ee];return _0x2d44d9;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x04c6('0xa')]},{'name':_0x04c6('0xb'),'fields':[_0x04c6('0xb')]},{'name':_0x04c6('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x471771,_0x4ac409){_0x471771=_0x471771-0x0;var _0x4ddd5f=_0xb4c7[_0x471771];return _0x4ddd5f;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('CmHopper',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[{'name':_0x7b4c('0xc'),'fields':['scheduledat']},{'name':_0x7b4c('0xd'),'fields':[_0x7b4c('0xd')]},{'name':_0x7b4c('0xe'),'fields':[_0x7b4c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index f0876e9..dc75eae 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 _0xc457=['sequelize','CmHopperFinal','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','UPDATE','GetCmHopperPreview','Contact','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','LOCK','keys','User','Agent','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer'];(function(_0x3e73f8,_0x4e0e6f){var _0x2422ba=function(_0x1a7d84){while(--_0x1a7d84){_0x3e73f8['push'](_0x3e73f8['shift']());}};_0x2422ba(++_0x4e0e6f);}(_0xc457,0xe5));var _0x7c45=function(_0x2859df,_0x1ebe34){_0x2859df=_0x2859df-0x0;var _0x378183=_0xc457[_0x2859df];return _0x378183;};'use strict';var _=require(_0x7c45('0x0'));var util=require(_0x7c45('0x1'));var moment=require(_0x7c45('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c45('0x3'));var fs=require('fs');var Redis=require(_0x7c45('0x4'));var db=require(_0x7c45('0x5'))['db'];var utils=require(_0x7c45('0x6'));var logger=require(_0x7c45('0x7'))(_0x7c45('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c45('0x9'));var client=jayson['client'][_0x7c45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420990,_0x5c0d11,_0x1fa383){return new BPromise(function(_0x221cbb,_0x5eeab2){return client[_0x7c45('0xb')](_0x420990,_0x1fa383)['then'](function(_0x214374){logger[_0x7c45('0xc')]('CmHopper,\x20%s,\x20%s',_0x5c0d11,_0x7c45('0xd'));logger[_0x7c45('0xe')](_0x7c45('0xf'),_0x5c0d11,_0x7c45('0xd'),JSON[_0x7c45('0x10')](_0x214374));if(_0x214374[_0x7c45('0x11')]){if(_0x214374[_0x7c45('0x11')][_0x7c45('0x12')]===0x1f4){logger[_0x7c45('0x11')](_0x7c45('0x13'),_0x5c0d11,_0x214374['error'][_0x7c45('0x14')]);return _0x5eeab2(_0x214374['error'][_0x7c45('0x14')]);}logger[_0x7c45('0x11')]('CmHopper,\x20%s,\x20%s',_0x5c0d11,_0x214374['error'][_0x7c45('0x14')]);return _0x221cbb(_0x214374['error'][_0x7c45('0x14')]);}else{logger[_0x7c45('0xc')](_0x7c45('0x13'),_0x5c0d11,_0x7c45('0xd'));_0x221cbb(_0x214374[_0x7c45('0x15')][_0x7c45('0x14')]);}})[_0x7c45('0x16')](function(_0x30fb35){logger[_0x7c45('0x11')](_0x7c45('0x13'),_0x5c0d11,_0x30fb35);_0x5eeab2(_0x30fb35);});});}exports[_0x7c45('0x17')]=function(_0x413dd7){var _0x1972a2=this;return new Promise(function(_0x23ee8b,_0x5f07df){return db[_0x7c45('0x18')][_0x7c45('0x19')]({'raw':_0x413dd7['options']?_0x413dd7[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'where':_0x413dd7['options']?_0x413dd7[_0x7c45('0x1a')][_0x7c45('0x1c')]||null:null,'attributes':_0x413dd7[_0x7c45('0x1a')]?_0x413dd7[_0x7c45('0x1a')]['attributes']||null:null,'limit':_0x413dd7[_0x7c45('0x1a')]?_0x413dd7[_0x7c45('0x1a')][_0x7c45('0x1d')]||null:null,'include':_0x413dd7[_0x7c45('0x1a')]?_0x413dd7[_0x7c45('0x1a')][_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x413dd7[_0x7c45('0x1a')][_0x7c45('0x1e')],function(_0x26d847){return{'model':db[_0x26d847[_0x7c45('0x20')]],'as':_0x26d847['as'],'attributes':_0x26d847[_0x7c45('0x21')],'include':_0x26d847[_0x7c45('0x1e')]?_['map'](_0x26d847[_0x7c45('0x1e')],function(_0x2853ea){return{'model':db[_0x2853ea['model']],'as':_0x2853ea['as'],'attributes':_0x2853ea[_0x7c45('0x21')],'include':_0x2853ea[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x2853ea['include'],function(_0x18f965){return{'model':db[_0x18f965[_0x7c45('0x20')]],'as':_0x18f965['as'],'attributes':_0x18f965[_0x7c45('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c45('0x22')](function(_0x2bd2f3){logger['info'](_0x7c45('0x17'),_0x413dd7);logger[_0x7c45('0xe')](_0x7c45('0x17'),_0x413dd7,JSON['stringify'](_0x2bd2f3));_0x23ee8b(_0x2bd2f3);})[_0x7c45('0x16')](function(_0x47aaf9){logger[_0x7c45('0x11')](_0x7c45('0x17'),_0x47aaf9[_0x7c45('0x14')],_0x413dd7);_0x5f07df(_0x1972a2[_0x7c45('0x11')](0x1f4,_0x47aaf9[_0x7c45('0x14')]));});});};exports[_0x7c45('0x23')]=function(_0x52fb49){var _0x57c0ea=this;return new Promise(function(_0x3378d1,_0x5b86ea){return db[_0x7c45('0x18')][_0x7c45('0x24')]({'raw':_0x52fb49[_0x7c45('0x1a')]?_0x52fb49[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'where':_0x52fb49[_0x7c45('0x1a')]?_0x52fb49['options'][_0x7c45('0x1c')]||null:null,'attributes':_0x52fb49[_0x7c45('0x1a')]?_0x52fb49['options']['attributes']||null:null,'include':_0x52fb49['options']?_0x52fb49[_0x7c45('0x1a')][_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x52fb49[_0x7c45('0x1a')][_0x7c45('0x1e')],function(_0x234f0e){return{'model':db[_0x234f0e['model']],'as':_0x234f0e['as'],'attributes':_0x234f0e[_0x7c45('0x21')],'include':_0x234f0e[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x234f0e[_0x7c45('0x1e')],function(_0x2201b5){return{'model':db[_0x2201b5[_0x7c45('0x20')]],'as':_0x2201b5['as'],'attributes':_0x2201b5['attributes'],'include':_0x2201b5[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x2201b5[_0x7c45('0x1e')],function(_0x666574){return{'model':db[_0x666574[_0x7c45('0x20')]],'as':_0x666574['as'],'attributes':_0x666574[_0x7c45('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x232dc2){logger[_0x7c45('0xc')](_0x7c45('0x23'),_0x52fb49);logger[_0x7c45('0xe')](_0x7c45('0x23'),_0x52fb49,JSON[_0x7c45('0x10')](_0x232dc2));_0x3378d1(_0x232dc2);})['catch'](function(_0x36617e){logger[_0x7c45('0x11')](_0x7c45('0x23'),_0x36617e['message'],_0x52fb49);_0x5b86ea(_0x57c0ea[_0x7c45('0x11')](0x1f4,_0x36617e['message']));});});};exports[_0x7c45('0x25')]=function(_0x172bb7){var _0x5db582=this;return new Promise(function(_0x3da249,_0x1463c5){return db['CmHopper'][_0x7c45('0x26')](_0x172bb7[_0x7c45('0x27')],{'raw':_0x172bb7[_0x7c45('0x1a')]?_0x172bb7[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3a3a3d){logger[_0x7c45('0xc')]('CreateCmHopper',_0x172bb7);logger[_0x7c45('0xe')](_0x7c45('0x25'),_0x172bb7,JSON['stringify'](_0x3a3a3d));_0x3da249(_0x3a3a3d);})[_0x7c45('0x16')](function(_0x1f870e){logger[_0x7c45('0x11')](_0x7c45('0x25'),_0x1f870e['message'],_0x172bb7);_0x1463c5(_0x5db582['error'](0x1f4,_0x1f870e[_0x7c45('0x14')]));});});};exports[_0x7c45('0x28')]=function(_0x3c203a){var _0x3936a7=this;return new Promise(function(_0x15f0fb,_0x1ac23c){return db[_0x7c45('0x18')][_0x7c45('0x29')](_0x3c203a[_0x7c45('0x27')],{'raw':_0x3c203a['options']?_0x3c203a[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c203a['options']?_0x3c203a[_0x7c45('0x1a')][_0x7c45('0x1c')]||null:null,'attributes':_0x3c203a[_0x7c45('0x1a')]?_0x3c203a[_0x7c45('0x1a')]['attributes']||null:null,'limit':_0x3c203a['options']?_0x3c203a[_0x7c45('0x1a')]['limit']||null:null})[_0x7c45('0x22')](function(_0x55056a){logger[_0x7c45('0xc')](_0x7c45('0x28'),_0x3c203a);logger[_0x7c45('0xe')](_0x7c45('0x28'),_0x3c203a,JSON[_0x7c45('0x10')](_0x55056a));_0x15f0fb(_0x55056a);})[_0x7c45('0x16')](function(_0x4bf9d6){logger[_0x7c45('0x11')](_0x7c45('0x28'),_0x4bf9d6['message'],_0x3c203a);_0x1ac23c(_0x3936a7['error'](0x1f4,_0x4bf9d6[_0x7c45('0x14')]));});});};exports['DestroyCmHopper']=function(_0xe2f863){var _0x222450=this;return new Promise(function(_0x35c673,_0x1f7d62){return db[_0x7c45('0x18')][_0x7c45('0x2a')]({'where':_0xe2f863[_0x7c45('0x1a')]?_0xe2f863[_0x7c45('0x1a')][_0x7c45('0x1c')]||null:null})[_0x7c45('0x22')](function(_0x5d3de0){logger[_0x7c45('0xc')]('DestroyCmHopper',_0xe2f863);logger[_0x7c45('0xe')](_0x7c45('0x2b'),_0xe2f863,JSON['stringify'](_0x5d3de0));_0x35c673(_0x5d3de0);})[_0x7c45('0x16')](function(_0x2bf648){logger['error'](_0x7c45('0x2b'),_0x2bf648[_0x7c45('0x14')],_0xe2f863);_0x1f7d62(_0x222450[_0x7c45('0x11')](0x1f4,_0x2bf648[_0x7c45('0x14')]));});});};exports[_0x7c45('0x2c')]=function(_0x402110){var _0x228ab9=this;return new Promise(function(_0x22348b,_0x220680){return db[_0x7c45('0x2d')][_0x7c45('0x2e')]()['then'](function(_0x695df3){return db['sequelize'][_0x7c45('0x2f')](function(_0xa80040){return db['CmHopper'][_0x7c45('0x19')]({'where':_0x402110[_0x7c45('0x1a')]?_0x402110[_0x7c45('0x1a')]['where']||null:null,'attributes':_0x402110[_0x7c45('0x1a')]?_0x402110[_0x7c45('0x1a')]['attributes']||null:null,'limit':_0x402110['options']?_0x402110['options']['limit']||null:null,'order':_0x402110[_0x7c45('0x1a')]?_0x402110[_0x7c45('0x1a')]['order']||null:null,'transaction':_0xa80040,'lock':_0xa80040[_0x7c45('0x30')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x7c45('0x31')](_0x695df3)},{'model':db[_0x7c45('0x32')],'as':_0x7c45('0x33'),'attributes':['id','name',_0x7c45('0x34')]}]})[_0x7c45('0x22')](function(_0x4ceeea){var _0x590082=[];var _0xc2c314=[];for(var _0x429de6=0x0;_0x429de6<_0x4ceeea[_0x7c45('0x35')];_0x429de6+=0x1){var _0x492118=_0x4ceeea[_0x429de6][_0x7c45('0x36')];if(_0x492118===null){_0x590082[_0x7c45('0x37')](_0x4ceeea[_0x429de6][_0x7c45('0x29')](_0x402110[_0x7c45('0x27')],{'transaction':_0xa80040}));}else if(!_0xc2c314[_0x7c45('0x38')](_0x492118)){_0xc2c314[_0x7c45('0x37')](_0x492118);_0x590082[_0x7c45('0x37')](_0x4ceeea[_0x429de6][_0x7c45('0x29')](_0x402110['body'],{'transaction':_0xa80040}));}}return BPromise[_0x7c45('0x39')](_0x590082);});})[_0x7c45('0x22')](function(_0x2db9ee){logger['info'](_0x7c45('0x2c'),_0x402110);logger[_0x7c45('0xe')](_0x7c45('0x2c'),_0x402110,JSON[_0x7c45('0x10')](_0x2db9ee));_0x22348b(_0x2db9ee);})[_0x7c45('0x16')](function(_0x955d90){logger[_0x7c45('0x11')]('GetContactDialer',_0x955d90[_0x7c45('0x14')],_0x402110);_0x220680(_0x228ab9[_0x7c45('0x11')](0x1f4,_0x955d90[_0x7c45('0x14')]));});});});};exports[_0x7c45('0x3a')]=function(_0x5dc331){var _0x3d1ff1=this;return new Promise(function(_0x45e2a5,_0x34e3d5){return db[_0x7c45('0x3b')][_0x7c45('0x2f')](function(_0x1907ba){return db[_0x7c45('0x3c')][_0x7c45('0x26')](_0x5dc331['body'],{'raw':_0x5dc331[_0x7c45('0x1a')]?_0x5dc331[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x1907ba})['then'](function(){return db['CmHopper']['destroy']({'where':_0x5dc331[_0x7c45('0x1a')]?_0x5dc331['options'][_0x7c45('0x1c')]||null:null,'transaction':_0x1907ba});});})['then'](function(_0x387716){logger['info'](_0x7c45('0x3a'),_0x5dc331);logger[_0x7c45('0xe')](_0x7c45('0x3a'),_0x5dc331,JSON[_0x7c45('0x10')](_0x387716));_0x45e2a5(_0x387716);})[_0x7c45('0x16')](function(_0x188f9f){logger[_0x7c45('0x11')]('MoveContactManagedDialer',_0x188f9f['message'],_0x5dc331);_0x34e3d5(_0x3d1ff1[_0x7c45('0x11')](0x1f4,_0x188f9f[_0x7c45('0x14')]));});});};exports['CountReScheduled']=function(_0x1d1003){var _0x2ee355=this;return new Promise(function(_0x3b6af0,_0x4dade6){return db[_0x7c45('0x18')][_0x7c45('0x19')]({'raw':_0x1d1003[_0x7c45('0x1a')]?_0x1d1003[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d1003['options']?_0x1d1003['options']['where']||null:null,'attributes':[[db[_0x7c45('0x3b')]['fn'](_0x7c45('0x3d'),db[_0x7c45('0x3b')]['fn']('IF',db[_0x7c45('0x3b')]['literal'](_0x7c45('0x3e')+util[_0x7c45('0x3f')](_0x7c45('0x40'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x7c45('0x41')]]})[_0x7c45('0x22')](function(_0x5e1f87){logger[_0x7c45('0xc')]('CountReScheduled',_0x1d1003);logger[_0x7c45('0xe')](_0x7c45('0x42'),_0x1d1003,JSON[_0x7c45('0x10')](_0x5e1f87));_0x3b6af0(_0x5e1f87);})[_0x7c45('0x16')](function(_0x5233a2){logger[_0x7c45('0x11')]('CountReScheduled',_0x5233a2[_0x7c45('0x14')],_0x1d1003);_0x4dade6(_0x2ee355[_0x7c45('0x11')](0x1f4,_0x5233a2['message']));});});};exports[_0x7c45('0x43')]=function(_0x1a8248){var _0x141fed=this;return new Promise(function(_0xc1c912,_0x43850d){return db[_0x7c45('0x2d')][_0x7c45('0x2e')]()['then'](function(_0x17f0a2){return db[_0x7c45('0x3b')][_0x7c45('0x2f')](function(_0x26ed3a){return db[_0x7c45('0x18')][_0x7c45('0x19')]({'where':_0x1a8248[_0x7c45('0x1a')]?_0x1a8248[_0x7c45('0x1a')][_0x7c45('0x1c')]||null:null,'attributes':_0x1a8248[_0x7c45('0x1a')]?_0x1a8248['options'][_0x7c45('0x21')]||null:null,'limit':0x1,'order':_0x1a8248[_0x7c45('0x1a')]?_0x1a8248[_0x7c45('0x1a')][_0x7c45('0x44')]||null:null,'group':db[_0x7c45('0x18')][_0x7c45('0x36')],'transaction':_0x26ed3a,'lock':_0x26ed3a['LOCK'][_0x7c45('0x45')],'include':_0x1a8248['options']?_0x1a8248[_0x7c45('0x1a')][_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x1a8248[_0x7c45('0x1a')]['include'],function(_0x115829){return{'model':db[_0x115829['model']],'as':_0x115829['as'],'attributes':_0x115829[_0x7c45('0x21')],'include':_0x115829[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x115829[_0x7c45('0x1e')],function(_0x2ea272){return{'model':db[_0x2ea272['model']],'as':_0x2ea272['as'],'attributes':_0x2ea272[_0x7c45('0x21')],'include':_0x2ea272[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x2ea272[_0x7c45('0x1e')],function(_0x1181d7){return{'model':db[_0x1181d7[_0x7c45('0x20')]],'as':_0x1181d7['as'],'attributes':_0x1181d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c45('0x22')](function(_0x2460be){var _0x979110=[];for(var _0x565998=0x0;_0x565998<_0x2460be[_0x7c45('0x35')];_0x565998+=0x1){_0x979110[_0x7c45('0x37')](_0x2460be[_0x565998][_0x7c45('0x29')](_0x1a8248[_0x7c45('0x27')],{'transaction':_0x26ed3a}));}return BPromise[_0x7c45('0x39')](_0x979110);});})['then'](function(_0x266ea6){logger[_0x7c45('0xc')]('GetContactRecallMe',_0x1a8248);logger[_0x7c45('0xe')](_0x7c45('0x43'),_0x1a8248,JSON['stringify'](_0x266ea6));_0xc1c912(_0x266ea6);})[_0x7c45('0x16')](function(_0x27f3af){logger['error'](_0x7c45('0x43'),_0x27f3af[_0x7c45('0x14')],_0x1a8248);_0x43850d(_0x141fed[_0x7c45('0x11')](0x1f4,_0x27f3af[_0x7c45('0x14')]));});});});};exports[_0x7c45('0x46')]=function(_0x4bcf0b){var _0x27c0ea=this;return new Promise(function(_0x56103f,_0x27c882){db['CmContact'][_0x7c45('0x2e')]()['then'](function(_0x37e1d1){return db[_0x7c45('0x18')]['findAll']({'raw':_0x4bcf0b[_0x7c45('0x1a')]?_0x4bcf0b[_0x7c45('0x1a')][_0x7c45('0x1b')]===undefined?!![]:![]:!![],'where':_0x4bcf0b[_0x7c45('0x1a')]?_0x4bcf0b[_0x7c45('0x1a')]['where']||null:null,'attributes':_0x4bcf0b[_0x7c45('0x1a')]?_0x4bcf0b[_0x7c45('0x1a')]['attributes']||null:null,'limit':_0x4bcf0b[_0x7c45('0x1a')]?_0x4bcf0b[_0x7c45('0x1a')][_0x7c45('0x1d')]||null:null,'include':_0x4bcf0b[_0x7c45('0x1a')]?_0x4bcf0b[_0x7c45('0x1a')][_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x4bcf0b[_0x7c45('0x1a')][_0x7c45('0x1e')],function(_0x5e6c2d){return{'model':db[_0x5e6c2d[_0x7c45('0x20')]],'as':_0x5e6c2d['as'],'attributes':_0x5e6c2d['as']===_0x7c45('0x47')?_['keys'](_0x37e1d1):_0x5e6c2d[_0x7c45('0x21')],'include':_0x5e6c2d['include']?_[_0x7c45('0x1f')](_0x5e6c2d[_0x7c45('0x1e')],function(_0x2e740d){return{'model':db[_0x2e740d['model']],'as':_0x2e740d['as'],'attributes':_0x2e740d['attributes'],'include':_0x2e740d[_0x7c45('0x1e')]?_[_0x7c45('0x1f')](_0x2e740d[_0x7c45('0x1e')],function(_0x3cfd07){return{'model':db[_0x3cfd07[_0x7c45('0x20')]],'as':_0x3cfd07['as'],'attributes':_0x3cfd07[_0x7c45('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c45('0x22')](function(_0x18a78c){logger[_0x7c45('0xc')]('GetCmHopper',_0x4bcf0b);logger[_0x7c45('0xe')](_0x7c45('0x17'),_0x4bcf0b,JSON['stringify'](_0x18a78c));_0x56103f(_0x18a78c);})[_0x7c45('0x16')](function(_0x3e42c3){logger[_0x7c45('0x11')]('GetCmHopper',_0x3e42c3[_0x7c45('0x14')],_0x4bcf0b);_0x27c882(_0x27c0ea[_0x7c45('0x11')](0x1f4,_0x3e42c3[_0x7c45('0x14')]));});});});}; \ No newline at end of file +var _0xcce0=['MoveContactManagedDialer','destroy','CountReScheduled','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','transaction','LOCK','describe','Contact','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CmHopper','findAll','options','attributes','include','map','model','then','GetCmHopper','stringify','ShowCmHopper','raw','CreateCmHopper','body','UpdateCmHopper','update','limit','DestroyCmHopper','where','GetContactDialer','CmContact','sequelize','order','UPDATE','keys','User','Agent','name','length','UserId','push','includes','all'];(function(_0x5c8208,_0x2699a1){var _0x3d56a6=function(_0x3fcaf6){while(--_0x3fcaf6){_0x5c8208['push'](_0x5c8208['shift']());}};_0x3d56a6(++_0x2699a1);}(_0xcce0,0x8c));var _0x0cce=function(_0x28418d,_0x3e0803){_0x28418d=_0x28418d-0x0;var _0x4f8e2d=_0xcce0[_0x28418d];return _0x4f8e2d;};'use strict';var _=require('lodash');var util=require(_0x0cce('0x0'));var moment=require(_0x0cce('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cce('0x2'))['db'];var utils=require(_0x0cce('0x3'));var logger=require(_0x0cce('0x4'))(_0x0cce('0x5'));var config=require(_0x0cce('0x6'));var jayson=require(_0x0cce('0x7'));var client=jayson[_0x0cce('0x8')][_0x0cce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a71a6,_0x4f64cf,_0x3938dc){return new BPromise(function(_0x578de5,_0x4ab993){return client[_0x0cce('0xa')](_0x1a71a6,_0x3938dc)['then'](function(_0x2f4048){logger[_0x0cce('0xb')](_0x0cce('0xc'),_0x4f64cf,_0x0cce('0xd'));logger[_0x0cce('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4f64cf,_0x0cce('0xd'),JSON['stringify'](_0x2f4048));if(_0x2f4048[_0x0cce('0xf')]){if(_0x2f4048['error'][_0x0cce('0x10')]===0x1f4){logger[_0x0cce('0xf')](_0x0cce('0xc'),_0x4f64cf,_0x2f4048[_0x0cce('0xf')][_0x0cce('0x11')]);return _0x4ab993(_0x2f4048[_0x0cce('0xf')][_0x0cce('0x11')]);}logger[_0x0cce('0xf')](_0x0cce('0xc'),_0x4f64cf,_0x2f4048[_0x0cce('0xf')][_0x0cce('0x11')]);return _0x578de5(_0x2f4048[_0x0cce('0xf')][_0x0cce('0x11')]);}else{logger[_0x0cce('0xb')]('CmHopper,\x20%s,\x20%s',_0x4f64cf,_0x0cce('0xd'));_0x578de5(_0x2f4048['result'][_0x0cce('0x11')]);}})[_0x0cce('0x12')](function(_0x3e992d){logger[_0x0cce('0xf')](_0x0cce('0xc'),_0x4f64cf,_0x3e992d);_0x4ab993(_0x3e992d);});});}exports['GetCmHopper']=function(_0x32582b){var _0x5b7bce=this;return new Promise(function(_0x523822,_0x13a067){return db[_0x0cce('0x13')][_0x0cce('0x14')]({'raw':_0x32582b[_0x0cce('0x15')]?_0x32582b[_0x0cce('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x32582b[_0x0cce('0x15')]?_0x32582b[_0x0cce('0x15')]['where']||null:null,'attributes':_0x32582b[_0x0cce('0x15')]?_0x32582b[_0x0cce('0x15')][_0x0cce('0x16')]||null:null,'limit':_0x32582b[_0x0cce('0x15')]?_0x32582b['options']['limit']||null:null,'include':_0x32582b[_0x0cce('0x15')]?_0x32582b[_0x0cce('0x15')][_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x32582b[_0x0cce('0x15')]['include'],function(_0x4fd553){return{'model':db[_0x4fd553[_0x0cce('0x19')]],'as':_0x4fd553['as'],'attributes':_0x4fd553[_0x0cce('0x16')],'include':_0x4fd553[_0x0cce('0x17')]?_['map'](_0x4fd553[_0x0cce('0x17')],function(_0x244aed){return{'model':db[_0x244aed['model']],'as':_0x244aed['as'],'attributes':_0x244aed[_0x0cce('0x16')],'include':_0x244aed[_0x0cce('0x17')]?_['map'](_0x244aed['include'],function(_0x26bcb8){return{'model':db[_0x26bcb8[_0x0cce('0x19')]],'as':_0x26bcb8['as'],'attributes':_0x26bcb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x0cce('0x1a')](function(_0x33acea){logger[_0x0cce('0xb')](_0x0cce('0x1b'),_0x32582b);logger['debug'](_0x0cce('0x1b'),_0x32582b,JSON[_0x0cce('0x1c')](_0x33acea));_0x523822(_0x33acea);})[_0x0cce('0x12')](function(_0xde8033){logger[_0x0cce('0xf')](_0x0cce('0x1b'),_0xde8033[_0x0cce('0x11')],_0x32582b);_0x13a067(_0x5b7bce[_0x0cce('0xf')](0x1f4,_0xde8033[_0x0cce('0x11')]));});});};exports[_0x0cce('0x1d')]=function(_0xfe84a2){var _0xb37c72=this;return new Promise(function(_0x3935e1,_0x2f452f){return db[_0x0cce('0x13')]['find']({'raw':_0xfe84a2[_0x0cce('0x15')]?_0xfe84a2[_0x0cce('0x15')][_0x0cce('0x1e')]===undefined?!![]:![]:!![],'where':_0xfe84a2[_0x0cce('0x15')]?_0xfe84a2[_0x0cce('0x15')]['where']||null:null,'attributes':_0xfe84a2[_0x0cce('0x15')]?_0xfe84a2[_0x0cce('0x15')]['attributes']||null:null,'include':_0xfe84a2[_0x0cce('0x15')]?_0xfe84a2['options'][_0x0cce('0x17')]?_[_0x0cce('0x18')](_0xfe84a2['options'][_0x0cce('0x17')],function(_0x5077d5){return{'model':db[_0x5077d5[_0x0cce('0x19')]],'as':_0x5077d5['as'],'attributes':_0x5077d5['attributes'],'include':_0x5077d5[_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x5077d5[_0x0cce('0x17')],function(_0x441a8d){return{'model':db[_0x441a8d['model']],'as':_0x441a8d['as'],'attributes':_0x441a8d[_0x0cce('0x16')],'include':_0x441a8d[_0x0cce('0x17')]?_['map'](_0x441a8d[_0x0cce('0x17')],function(_0x227ddf){return{'model':db[_0x227ddf[_0x0cce('0x19')]],'as':_0x227ddf['as'],'attributes':_0x227ddf['attributes']};}):[]};}):[]};}):[]:[]})[_0x0cce('0x1a')](function(_0x333d8c){logger['info']('ShowCmHopper',_0xfe84a2);logger[_0x0cce('0xe')](_0x0cce('0x1d'),_0xfe84a2,JSON[_0x0cce('0x1c')](_0x333d8c));_0x3935e1(_0x333d8c);})['catch'](function(_0x128288){logger[_0x0cce('0xf')](_0x0cce('0x1d'),_0x128288[_0x0cce('0x11')],_0xfe84a2);_0x2f452f(_0xb37c72[_0x0cce('0xf')](0x1f4,_0x128288['message']));});});};exports[_0x0cce('0x1f')]=function(_0x398242){var _0x1172ad=this;return new Promise(function(_0x1b7c99,_0x2d6d13){return db['CmHopper']['create'](_0x398242[_0x0cce('0x20')],{'raw':_0x398242[_0x0cce('0x15')]?_0x398242['options']['raw']===undefined?!![]:![]:!![]})[_0x0cce('0x1a')](function(_0x32cb80){logger[_0x0cce('0xb')]('CreateCmHopper',_0x398242);logger[_0x0cce('0xe')]('CreateCmHopper',_0x398242,JSON[_0x0cce('0x1c')](_0x32cb80));_0x1b7c99(_0x32cb80);})[_0x0cce('0x12')](function(_0x31c45f){logger[_0x0cce('0xf')](_0x0cce('0x1f'),_0x31c45f[_0x0cce('0x11')],_0x398242);_0x2d6d13(_0x1172ad[_0x0cce('0xf')](0x1f4,_0x31c45f[_0x0cce('0x11')]));});});};exports[_0x0cce('0x21')]=function(_0x2b7421){var _0x3a31dd=this;return new Promise(function(_0x9d9584,_0x40630a){return db[_0x0cce('0x13')][_0x0cce('0x22')](_0x2b7421[_0x0cce('0x20')],{'raw':_0x2b7421[_0x0cce('0x15')]?_0x2b7421[_0x0cce('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7421[_0x0cce('0x15')]?_0x2b7421[_0x0cce('0x15')]['where']||null:null,'attributes':_0x2b7421[_0x0cce('0x15')]?_0x2b7421[_0x0cce('0x15')][_0x0cce('0x16')]||null:null,'limit':_0x2b7421[_0x0cce('0x15')]?_0x2b7421[_0x0cce('0x15')][_0x0cce('0x23')]||null:null})[_0x0cce('0x1a')](function(_0x4f3de6){logger[_0x0cce('0xb')]('UpdateCmHopper',_0x2b7421);logger[_0x0cce('0xe')](_0x0cce('0x21'),_0x2b7421,JSON[_0x0cce('0x1c')](_0x4f3de6));_0x9d9584(_0x4f3de6);})[_0x0cce('0x12')](function(_0x685037){logger['error'](_0x0cce('0x21'),_0x685037[_0x0cce('0x11')],_0x2b7421);_0x40630a(_0x3a31dd[_0x0cce('0xf')](0x1f4,_0x685037[_0x0cce('0x11')]));});});};exports[_0x0cce('0x24')]=function(_0x57a7ca){var _0x2812ba=this;return new Promise(function(_0x50dfcc,_0x53d218){return db[_0x0cce('0x13')]['destroy']({'where':_0x57a7ca[_0x0cce('0x15')]?_0x57a7ca[_0x0cce('0x15')][_0x0cce('0x25')]||null:null})[_0x0cce('0x1a')](function(_0x4be3ea){logger[_0x0cce('0xb')](_0x0cce('0x24'),_0x57a7ca);logger[_0x0cce('0xe')]('DestroyCmHopper',_0x57a7ca,JSON[_0x0cce('0x1c')](_0x4be3ea));_0x50dfcc(_0x4be3ea);})[_0x0cce('0x12')](function(_0x1cc7ca){logger[_0x0cce('0xf')](_0x0cce('0x24'),_0x1cc7ca[_0x0cce('0x11')],_0x57a7ca);_0x53d218(_0x2812ba[_0x0cce('0xf')](0x1f4,_0x1cc7ca[_0x0cce('0x11')]));});});};exports[_0x0cce('0x26')]=function(_0x2e4f1d){var _0x117c59=this;return new Promise(function(_0x314300,_0x4e3078){return db[_0x0cce('0x27')]['describe']()[_0x0cce('0x1a')](function(_0x1f3fc4){return db[_0x0cce('0x28')]['transaction'](function(_0x37c43a){return db[_0x0cce('0x13')][_0x0cce('0x14')]({'where':_0x2e4f1d[_0x0cce('0x15')]?_0x2e4f1d[_0x0cce('0x15')]['where']||null:null,'attributes':_0x2e4f1d[_0x0cce('0x15')]?_0x2e4f1d[_0x0cce('0x15')][_0x0cce('0x16')]||null:null,'limit':_0x2e4f1d[_0x0cce('0x15')]?_0x2e4f1d[_0x0cce('0x15')]['limit']||null:null,'order':_0x2e4f1d[_0x0cce('0x15')]?_0x2e4f1d[_0x0cce('0x15')][_0x0cce('0x29')]||null:null,'transaction':_0x37c43a,'lock':_0x37c43a['LOCK'][_0x0cce('0x2a')],'include':[{'model':db[_0x0cce('0x27')],'as':'Contact','attributes':_[_0x0cce('0x2b')](_0x1f3fc4)},{'model':db[_0x0cce('0x2c')],'as':_0x0cce('0x2d'),'attributes':['id',_0x0cce('0x2e'),'voicePause']}]})[_0x0cce('0x1a')](function(_0x5d11d7){var _0x3da676=[];var _0xadea99=[];for(var _0x12c726=0x0;_0x12c726<_0x5d11d7[_0x0cce('0x2f')];_0x12c726+=0x1){var _0x38ed29=_0x5d11d7[_0x12c726][_0x0cce('0x30')];if(_0x38ed29===null){_0x3da676[_0x0cce('0x31')](_0x5d11d7[_0x12c726]['update'](_0x2e4f1d[_0x0cce('0x20')],{'transaction':_0x37c43a}));}else if(!_0xadea99[_0x0cce('0x32')](_0x38ed29)){_0xadea99[_0x0cce('0x31')](_0x38ed29);_0x3da676['push'](_0x5d11d7[_0x12c726]['update'](_0x2e4f1d['body'],{'transaction':_0x37c43a}));}}return BPromise[_0x0cce('0x33')](_0x3da676);});})[_0x0cce('0x1a')](function(_0x955215){logger[_0x0cce('0xb')](_0x0cce('0x26'),_0x2e4f1d);logger[_0x0cce('0xe')](_0x0cce('0x26'),_0x2e4f1d,JSON[_0x0cce('0x1c')](_0x955215));_0x314300(_0x955215);})['catch'](function(_0x336b3c){logger[_0x0cce('0xf')]('GetContactDialer',_0x336b3c['message'],_0x2e4f1d);_0x4e3078(_0x117c59[_0x0cce('0xf')](0x1f4,_0x336b3c[_0x0cce('0x11')]));});});});};exports[_0x0cce('0x34')]=function(_0x34fcd3){var _0x3690a8=this;return new Promise(function(_0x233ccf,_0x4715b7){return db[_0x0cce('0x28')]['transaction'](function(_0x4bb893){return db['CmHopperFinal']['create'](_0x34fcd3[_0x0cce('0x20')],{'raw':_0x34fcd3['options']?_0x34fcd3[_0x0cce('0x15')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4bb893})[_0x0cce('0x1a')](function(){return db[_0x0cce('0x13')][_0x0cce('0x35')]({'where':_0x34fcd3[_0x0cce('0x15')]?_0x34fcd3[_0x0cce('0x15')][_0x0cce('0x25')]||null:null,'transaction':_0x4bb893});});})['then'](function(_0xaa61a2){logger[_0x0cce('0xb')](_0x0cce('0x34'),_0x34fcd3);logger[_0x0cce('0xe')]('MoveContactManagedDialer',_0x34fcd3,JSON[_0x0cce('0x1c')](_0xaa61a2));_0x233ccf(_0xaa61a2);})[_0x0cce('0x12')](function(_0x4a65e7){logger[_0x0cce('0xf')](_0x0cce('0x34'),_0x4a65e7[_0x0cce('0x11')],_0x34fcd3);_0x4715b7(_0x3690a8[_0x0cce('0xf')](0x1f4,_0x4a65e7[_0x0cce('0x11')]));});});};exports[_0x0cce('0x36')]=function(_0x1fa476){var _0x331600=this;return new Promise(function(_0x18b5f5,_0x192270){return db[_0x0cce('0x13')][_0x0cce('0x14')]({'raw':_0x1fa476[_0x0cce('0x15')]?_0x1fa476[_0x0cce('0x15')][_0x0cce('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fa476['options']?_0x1fa476['options'][_0x0cce('0x25')]||null:null,'attributes':[[db[_0x0cce('0x28')]['fn']('COUNT',db[_0x0cce('0x28')]['fn']('IF',db[_0x0cce('0x28')]['literal']('`scheduledat`\x20>=\x20'+util['format'](_0x0cce('0x37'),moment()[_0x0cce('0x38')](_0x0cce('0x39')))+'\x20,\x201,\x20null'))),_0x0cce('0x3a')]]})['then'](function(_0x5c2127){logger[_0x0cce('0xb')](_0x0cce('0x36'),_0x1fa476);logger[_0x0cce('0xe')]('CountReScheduled',_0x1fa476,JSON['stringify'](_0x5c2127));_0x18b5f5(_0x5c2127);})[_0x0cce('0x12')](function(_0x1f15fd){logger[_0x0cce('0xf')]('CountReScheduled',_0x1f15fd['message'],_0x1fa476);_0x192270(_0x331600[_0x0cce('0xf')](0x1f4,_0x1f15fd['message']));});});};exports[_0x0cce('0x3b')]=function(_0x4ede11){var _0x4c9d1a=this;return new Promise(function(_0x17b5d9,_0x176956){return db[_0x0cce('0x27')]['describe']()[_0x0cce('0x1a')](function(_0x277651){return db[_0x0cce('0x28')][_0x0cce('0x3c')](function(_0x35f306){return db['CmHopper'][_0x0cce('0x14')]({'where':_0x4ede11['options']?_0x4ede11[_0x0cce('0x15')][_0x0cce('0x25')]||null:null,'attributes':_0x4ede11[_0x0cce('0x15')]?_0x4ede11[_0x0cce('0x15')][_0x0cce('0x16')]||null:null,'limit':0x1,'order':_0x4ede11[_0x0cce('0x15')]?_0x4ede11['options'][_0x0cce('0x29')]||null:null,'group':db[_0x0cce('0x13')]['UserId'],'transaction':_0x35f306,'lock':_0x35f306[_0x0cce('0x3d')]['UPDATE'],'include':_0x4ede11[_0x0cce('0x15')]?_0x4ede11['options'][_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x4ede11[_0x0cce('0x15')][_0x0cce('0x17')],function(_0x44a4aa){return{'model':db[_0x44a4aa[_0x0cce('0x19')]],'as':_0x44a4aa['as'],'attributes':_0x44a4aa[_0x0cce('0x16')],'include':_0x44a4aa[_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x44a4aa[_0x0cce('0x17')],function(_0x175463){return{'model':db[_0x175463['model']],'as':_0x175463['as'],'attributes':_0x175463[_0x0cce('0x16')],'include':_0x175463[_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x175463[_0x0cce('0x17')],function(_0x32c576){return{'model':db[_0x32c576[_0x0cce('0x19')]],'as':_0x32c576['as'],'attributes':_0x32c576['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xcdd751){var _0x577103=[];for(var _0x32fc5d=0x0;_0x32fc5d<_0xcdd751[_0x0cce('0x2f')];_0x32fc5d+=0x1){_0x577103[_0x0cce('0x31')](_0xcdd751[_0x32fc5d][_0x0cce('0x22')](_0x4ede11['body'],{'transaction':_0x35f306}));}return BPromise[_0x0cce('0x33')](_0x577103);});})[_0x0cce('0x1a')](function(_0x47dcbf){logger['info'](_0x0cce('0x3b'),_0x4ede11);logger[_0x0cce('0xe')](_0x0cce('0x3b'),_0x4ede11,JSON[_0x0cce('0x1c')](_0x47dcbf));_0x17b5d9(_0x47dcbf);})[_0x0cce('0x12')](function(_0x563c34){logger[_0x0cce('0xf')](_0x0cce('0x3b'),_0x563c34[_0x0cce('0x11')],_0x4ede11);_0x176956(_0x4c9d1a[_0x0cce('0xf')](0x1f4,_0x563c34[_0x0cce('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x5b6db7){var _0x241b28=this;return new Promise(function(_0x13d337,_0x4a6617){db['CmContact'][_0x0cce('0x3e')]()[_0x0cce('0x1a')](function(_0x5a168b){return db[_0x0cce('0x13')][_0x0cce('0x14')]({'raw':_0x5b6db7[_0x0cce('0x15')]?_0x5b6db7[_0x0cce('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5b6db7[_0x0cce('0x15')]?_0x5b6db7[_0x0cce('0x15')][_0x0cce('0x25')]||null:null,'attributes':_0x5b6db7[_0x0cce('0x15')]?_0x5b6db7[_0x0cce('0x15')]['attributes']||null:null,'limit':_0x5b6db7['options']?_0x5b6db7[_0x0cce('0x15')][_0x0cce('0x23')]||null:null,'include':_0x5b6db7[_0x0cce('0x15')]?_0x5b6db7['options'][_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x5b6db7[_0x0cce('0x15')][_0x0cce('0x17')],function(_0xd6b8f6){return{'model':db[_0xd6b8f6['model']],'as':_0xd6b8f6['as'],'attributes':_0xd6b8f6['as']===_0x0cce('0x3f')?_[_0x0cce('0x2b')](_0x5a168b):_0xd6b8f6['attributes'],'include':_0xd6b8f6[_0x0cce('0x17')]?_['map'](_0xd6b8f6['include'],function(_0x4101e5){return{'model':db[_0x4101e5[_0x0cce('0x19')]],'as':_0x4101e5['as'],'attributes':_0x4101e5[_0x0cce('0x16')],'include':_0x4101e5[_0x0cce('0x17')]?_[_0x0cce('0x18')](_0x4101e5['include'],function(_0x2dcf96){return{'model':db[_0x2dcf96[_0x0cce('0x19')]],'as':_0x2dcf96['as'],'attributes':_0x2dcf96[_0x0cce('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0cce('0x1a')](function(_0x161d14){logger[_0x0cce('0xb')](_0x0cce('0x1b'),_0x5b6db7);logger['debug'](_0x0cce('0x1b'),_0x5b6db7,JSON[_0x0cce('0x1c')](_0x161d14));_0x13d337(_0x161d14);})[_0x0cce('0x12')](function(_0x133173){logger[_0x0cce('0xf')]('GetCmHopper',_0x133173[_0x0cce('0x11')],_0x5b6db7);_0x4a6617(_0x241b28['error'](0x1f4,_0x133173[_0x0cce('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4881d35..c8b5e38 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 _0x56a3=['util','path','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','/:id','show','create','/preview','getPreview','put','update','delete','destroy','exports','multer'];(function(_0x4c50d5,_0x2e55bd){var _0x55cd3e=function(_0x227ad0){while(--_0x227ad0){_0x4c50d5['push'](_0x4c50d5['shift']());}};_0x55cd3e(++_0x2e55bd);}(_0x56a3,0x6d));var _0x356a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56a3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x356a('0x0'));var util=require(_0x356a('0x1'));var path=require(_0x356a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x356a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x356a('0x4'));var interaction=require(_0x356a('0x5'));var config=require('../../config/environment');var controller=require(_0x356a('0x6'));router[_0x356a('0x7')]('/',auth[_0x356a('0x8')](),controller[_0x356a('0x9')]);router['get'](_0x356a('0xa'),auth[_0x356a('0x8')](),controller['describe']);router['get'](_0x356a('0xb'),auth[_0x356a('0x8')](),controller['getOpenContacts']);router[_0x356a('0x7')](_0x356a('0xc'),auth[_0x356a('0x8')](),controller[_0x356a('0xd')]);router['post']('/',auth[_0x356a('0x8')](),controller[_0x356a('0xe')]);router['post'](_0x356a('0xf'),auth[_0x356a('0x8')](),controller[_0x356a('0x10')]);router[_0x356a('0x11')](_0x356a('0xc'),auth[_0x356a('0x8')](),controller[_0x356a('0x12')]);router[_0x356a('0x13')](_0x356a('0xc'),auth[_0x356a('0x8')](),controller[_0x356a('0x14')]);module[_0x356a('0x15')]=router; \ No newline at end of file +var _0x6157=['../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51dcca,_0x3322ba){var _0x1436fe=function(_0x1c57f2){while(--_0x1c57f2){_0x51dcca['push'](_0x51dcca['shift']());}};_0x1436fe(++_0x3322ba);}(_0x6157,0x1a9));var _0x7615=function(_0x5a13e9,_0x1ed393){_0x5a13e9=_0x5a13e9-0x0;var _0xeb7910=_0x6157[_0x5a13e9];return _0xeb7910;};'use strict';var multer=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var path=require('path');var timeout=require(_0x7615('0x2'));var express=require(_0x7615('0x3'));var router=express[_0x7615('0x4')]();var fs_extra=require(_0x7615('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7615('0x6'));var config=require(_0x7615('0x7'));var controller=require(_0x7615('0x8'));router[_0x7615('0x9')]('/',auth[_0x7615('0xa')](),controller[_0x7615('0xb')]);router[_0x7615('0x9')](_0x7615('0xc'),auth['isAuthenticated'](),controller[_0x7615('0xd')]);router[_0x7615('0x9')]('/opencontacts',auth[_0x7615('0xa')](),controller['getOpenContacts']);router[_0x7615('0x9')](_0x7615('0xe'),auth['isAuthenticated'](),controller[_0x7615('0xf')]);router[_0x7615('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7615('0x10')](_0x7615('0x11'),auth[_0x7615('0xa')](),controller[_0x7615('0x12')]);router[_0x7615('0x13')](_0x7615('0xe'),auth['isAuthenticated'](),controller[_0x7615('0x14')]);router[_0x7615('0x15')]('/:id',auth[_0x7615('0xa')](),controller[_0x7615('0x16')]);module[_0x7615('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a2e744b..073c4de 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 _0x1dcc=['exports','STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x5b7b89,_0xd6c285){_0x5b7b89=_0x5b7b89-0x0;var _0x476430=_0x1dcc[_0x5b7b89];return _0x476430;};'use strict';var moment=require(_0xc1dc('0x0'));var Sequelize=require(_0xc1dc('0x1'));module[_0xc1dc('0x2')]={'phone':{'type':Sequelize[_0xc1dc('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc1dc('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc1dc('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc1dc('0x5')],'unique':_0xc1dc('0x4')}}; \ No newline at end of file +var _0xc92f=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x4dd8fc,_0x4eb948){var _0x2f7a31=function(_0x31035c){while(--_0x31035c){_0x4dd8fc['push'](_0x4dd8fc['shift']());}};_0x2f7a31(++_0x4eb948);}(_0xc92f,0xf3));var _0xfc92=function(_0x56c824,_0x2a3b0c){_0x56c824=_0x56c824-0x0;var _0x45abd0=_0xc92f[_0x56c824];return _0x45abd0;};'use strict';var moment=require(_0xfc92('0x0'));var Sequelize=require(_0xfc92('0x1'));module['exports']={'phone':{'type':Sequelize[_0xfc92('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfc92('0x3')],'unique':_0xfc92('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xfc92('0x4')},'VoiceQueueId':{'type':Sequelize[_0xfc92('0x3')],'unique':_0xfc92('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index db00dc8..06275f5 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 _0x8815=['VIRTUAL','options','includeAll','include','CmHopperBlack','findAll','catch','params','fields','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x5eef8a,_0x399054){var _0x3b89e2=function(_0x38ba96){while(--_0x38ba96){_0x5eef8a['push'](_0x5eef8a['shift']());}};_0x3b89e2(++_0x399054);}(_0x8815,0x124));var _0x5881=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x8815[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0x5881('0x0'));var rimraf=require(_0x5881('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5881('0x2'));var rp=require(_0x5881('0x3'));var moment=require(_0x5881('0x4'));var BPromise=require(_0x5881('0x5'));var Mustache=require('mustache');var util=require(_0x5881('0x6'));var path=require(_0x5881('0x7'));var sox=require(_0x5881('0x8'));var csv=require(_0x5881('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5881('0xa'));var squel=require(_0x5881('0xb'));var crypto=require(_0x5881('0xc'));var jsforce=require(_0x5881('0xd'));var deskjs=require(_0x5881('0xe'));var toCsv=require(_0x5881('0x9'));var querystring=require('querystring');var Papa=require(_0x5881('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5881('0x10'));var as=require(_0x5881('0x11'));var hardwareService=require(_0x5881('0x12'));var logger=require('../../config/logger')(_0x5881('0x13'));var utils=require('../../config/utils');var config=require(_0x5881('0x14'));var licenseUtil=require(_0x5881('0x15'));var db=require(_0x5881('0x16'))['db'];function respondWithStatusCode(_0x25b6e1,_0x4bc929){_0x4bc929=_0x4bc929||0xcc;return function(_0x48eaa7){if(_0x48eaa7){return _0x25b6e1[_0x5881('0x17')](_0x4bc929);}return _0x25b6e1[_0x5881('0x18')](_0x4bc929)[_0x5881('0x19')]();};}function respondWithResult(_0x1fbeb0,_0x3a361e){_0x3a361e=_0x3a361e||0xc8;return function(_0x5c3103){if(_0x5c3103){return _0x1fbeb0['status'](_0x3a361e)[_0x5881('0x1a')](_0x5c3103);}};}function respondWithFilteredResult(_0x5d6cc7,_0x1f215a){return function(_0xaca9f9){if(_0xaca9f9){var _0x383b41=typeof _0x1f215a[_0x5881('0x1b')]===_0x5881('0x1c')&&typeof _0x1f215a['limit']==='undefined';var _0x436b69=_0xaca9f9[_0x5881('0x1d')];var _0x104be7=_0x383b41?0x0:_0x1f215a[_0x5881('0x1b')];var _0xd927c3=_0x383b41?_0xaca9f9[_0x5881('0x1d')]:_0x1f215a[_0x5881('0x1b')]+_0x1f215a[_0x5881('0x1e')];var _0x48374e;if(_0xd927c3>=_0x436b69){_0xd927c3=_0x436b69;_0x48374e=0xc8;}else{_0x48374e=0xce;}_0x5d6cc7[_0x5881('0x18')](_0x48374e);return _0x5d6cc7[_0x5881('0x1f')](_0x5881('0x20'),_0x104be7+'-'+_0xd927c3+'/'+_0x436b69)[_0x5881('0x1a')](_0xaca9f9);}return null;};}function patchUpdates(_0x10d051){return function(_0x3bcbd1){try{jsonpatch[_0x5881('0x21')](_0x3bcbd1,_0x10d051,!![]);}catch(_0x2cc250){return BPromise[_0x5881('0x22')](_0x2cc250);}return _0x3bcbd1[_0x5881('0x23')]();};}function saveUpdates(_0x26d89e,_0x496d05){return function(_0x4ff407){if(_0x4ff407){return _0x4ff407[_0x5881('0x24')](_0x26d89e)['then'](function(_0x5702aa){return _0x5702aa;});}return null;};}function removeEntity(_0x34cc67,_0x3a8a2c){return function(_0x45b74a){if(_0x45b74a){return _0x45b74a['destroy']()[_0x5881('0x25')](function(){_0x34cc67[_0x5881('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481961,_0x13756b){return function(_0x5adaac){if(!_0x5adaac){_0x481961[_0x5881('0x17')](0x194);}return _0x5adaac;};}function handleError(_0x4fea5d,_0x29bda0){_0x29bda0=_0x29bda0||0x1f4;return function(_0x1f54cc){logger['error'](_0x1f54cc[_0x5881('0x26')]);if(_0x1f54cc['name']){delete _0x1f54cc[_0x5881('0x27')];}_0x4fea5d['status'](_0x29bda0)[_0x5881('0x28')](_0x1f54cc);};}exports['index']=function(_0xfa5e55,_0x30d604){var _0x348590={},_0x13eb62={},_0x128d67={'count':0x0,'rows':[]};var _0x3d9159=_[_0x5881('0x29')](db['CmHopperBlack'][_0x5881('0x2a')],function(_0x3f76b6){return{'name':_0x3f76b6['fieldName'],'type':_0x3f76b6[_0x5881('0x2b')][_0x5881('0x2c')]};});_0x13eb62[_0x5881('0x2d')]=_[_0x5881('0x29')](_0x3d9159,'name');_0x13eb62[_0x5881('0x2e')]=_[_0x5881('0x2f')](_0xfa5e55[_0x5881('0x2e')]);_0x13eb62[_0x5881('0x30')]=_[_0x5881('0x31')](_0x13eb62['model'],_0x13eb62['query']);_0x348590['attributes']=_[_0x5881('0x31')](_0x13eb62['model'],qs['fields'](_0xfa5e55[_0x5881('0x2e')]['fields']));_0x348590[_0x5881('0x32')]=_0x348590[_0x5881('0x32')]['length']?_0x348590['attributes']:_0x13eb62[_0x5881('0x2d')];if(!_0xfa5e55[_0x5881('0x2e')][_0x5881('0x33')](_0x5881('0x34'))){_0x348590['limit']=qs[_0x5881('0x1e')](_0xfa5e55[_0x5881('0x2e')]['limit']);_0x348590[_0x5881('0x1b')]=qs[_0x5881('0x1b')](_0xfa5e55[_0x5881('0x2e')][_0x5881('0x1b')]);}_0x348590[_0x5881('0x35')]=qs['sort'](_0xfa5e55[_0x5881('0x2e')][_0x5881('0x36')]);_0x348590[_0x5881('0x37')]=qs[_0x5881('0x30')](_['pick'](_0xfa5e55[_0x5881('0x2e')],_0x13eb62['filters']),_0x3d9159);if(_0xfa5e55[_0x5881('0x2e')][_0x5881('0x38')]){_0x348590[_0x5881('0x37')]=_[_0x5881('0x39')](_0x348590[_0x5881('0x37')],{'$or':_['map'](_0x3d9159,function(_0x4a0ff5){if(_0x4a0ff5[_0x5881('0x2b')]!==_0x5881('0x3a')){var _0x36b12e={};_0x36b12e[_0x4a0ff5['name']]={'$like':'%'+_0xfa5e55[_0x5881('0x2e')][_0x5881('0x38')]+'%'};return _0x36b12e;}})});}_0x348590=_[_0x5881('0x39')]({},_0x348590,_0xfa5e55[_0x5881('0x3b')]);var _0x4f9f6d={'where':_0x348590['where']};return db['CmHopperBlack'][_0x5881('0x1d')](_0x4f9f6d)[_0x5881('0x25')](function(_0x2b7dca){_0x128d67['count']=_0x2b7dca;if(_0xfa5e55[_0x5881('0x2e')][_0x5881('0x3c')]){_0x348590[_0x5881('0x3d')]=[{'all':!![]}];}return db[_0x5881('0x3e')][_0x5881('0x3f')](_0x348590);})[_0x5881('0x25')](function(_0x20fff3){_0x128d67['rows']=_0x20fff3;return _0x128d67;})[_0x5881('0x25')](respondWithFilteredResult(_0x30d604,_0x348590))[_0x5881('0x40')](handleError(_0x30d604,null));};exports['show']=function(_0x40e51d,_0x2787a3){var _0x5d1e1e={'raw':!![],'where':{'id':_0x40e51d[_0x5881('0x41')]['id']}},_0x3a5cd9={};_0x3a5cd9['model']=_[_0x5881('0x2f')](db['CmHopperBlack']['rawAttributes']);_0x3a5cd9['query']=_[_0x5881('0x2f')](_0x40e51d[_0x5881('0x2e')]);_0x3a5cd9[_0x5881('0x30')]=_['intersection'](_0x3a5cd9[_0x5881('0x2d')],_0x3a5cd9[_0x5881('0x2e')]);_0x5d1e1e[_0x5881('0x32')]=_[_0x5881('0x31')](_0x3a5cd9['model'],qs[_0x5881('0x42')](_0x40e51d['query'][_0x5881('0x42')]));_0x5d1e1e[_0x5881('0x32')]=_0x5d1e1e['attributes']['length']?_0x5d1e1e[_0x5881('0x32')]:_0x3a5cd9['model'];if(_0x40e51d[_0x5881('0x2e')][_0x5881('0x3c')]){_0x5d1e1e[_0x5881('0x3d')]=[{'all':!![]}];}_0x5d1e1e=_['merge']({},_0x5d1e1e,_0x40e51d[_0x5881('0x3b')]);return db['CmHopperBlack'][_0x5881('0x43')](_0x5d1e1e)['then'](handleEntityNotFound(_0x2787a3,null))[_0x5881('0x25')](respondWithResult(_0x2787a3,null))[_0x5881('0x40')](handleError(_0x2787a3,null));};exports[_0x5881('0x24')]=function(_0x48b33b,_0x1182b2){if(_0x48b33b[_0x5881('0x44')]['id']){delete _0x48b33b[_0x5881('0x44')]['id'];}return db[_0x5881('0x3e')][_0x5881('0x43')]({'where':{'id':_0x48b33b[_0x5881('0x41')]['id']}})['then'](handleEntityNotFound(_0x1182b2,null))[_0x5881('0x25')](saveUpdates(_0x48b33b[_0x5881('0x44')],null))['then'](respondWithResult(_0x1182b2,null))[_0x5881('0x40')](handleError(_0x1182b2,null));};exports['destroy']=function(_0x545fba,_0x325746){return db['CmHopperBlack']['find']({'where':{'id':_0x545fba['params']['id']}})[_0x5881('0x25')](handleEntityNotFound(_0x325746,null))[_0x5881('0x25')](removeEntity(_0x325746,null))[_0x5881('0x40')](handleError(_0x325746,null));};exports[_0x5881('0x45')]=function(_0x693844,_0x343351){return db[_0x5881('0x3e')]['describe']()['then'](respondWithResult(_0x343351,null))['catch'](handleError(_0x343351,null));}; \ No newline at end of file +var _0xf0f4=['options','include','findAll','rows','show','params','find','body','catch','destroy','describe','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','CmHopperBlack','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3c43d4,_0x42d181){var _0x336d79=function(_0x48c388){while(--_0x48c388){_0x3c43d4['push'](_0x3c43d4['shift']());}};_0x336d79(++_0x42d181);}(_0xf0f4,0x182));var _0x4f0f=function(_0x26e7a9,_0x442501){_0x26e7a9=_0x26e7a9-0x0;var _0x4b05cd=_0xf0f4[_0x26e7a9];return _0x4b05cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f0f('0x3'));var util=require(_0x4f0f('0x4'));var path=require(_0x4f0f('0x5'));var sox=require(_0x4f0f('0x6'));var csv=require(_0x4f0f('0x7'));var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require(_0x4f0f('0x9'));var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x7'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var licenseUtil=require(_0x4f0f('0x17'));var db=require(_0x4f0f('0x18'))['db'];function respondWithStatusCode(_0x1a1b94,_0x123845){_0x123845=_0x123845||0xcc;return function(_0x11749b){if(_0x11749b){return _0x1a1b94[_0x4f0f('0x19')](_0x123845);}return _0x1a1b94[_0x4f0f('0x1a')](_0x123845)[_0x4f0f('0x1b')]();};}function respondWithResult(_0x4e1e26,_0xebecc0){_0xebecc0=_0xebecc0||0xc8;return function(_0x447238){if(_0x447238){return _0x4e1e26[_0x4f0f('0x1a')](_0xebecc0)[_0x4f0f('0x1c')](_0x447238);}};}function respondWithFilteredResult(_0x51a713,_0xd9ad12){return function(_0x46d7cf){if(_0x46d7cf){var _0x5783=typeof _0xd9ad12[_0x4f0f('0x1d')]===_0x4f0f('0x1e')&&typeof _0xd9ad12['limit']===_0x4f0f('0x1e');var _0x1942cf=_0x46d7cf[_0x4f0f('0x1f')];var _0x566049=_0x5783?0x0:_0xd9ad12[_0x4f0f('0x1d')];var _0x86186f=_0x5783?_0x46d7cf[_0x4f0f('0x1f')]:_0xd9ad12['offset']+_0xd9ad12[_0x4f0f('0x20')];var _0x2455f9;if(_0x86186f>=_0x1942cf){_0x86186f=_0x1942cf;_0x2455f9=0xc8;}else{_0x2455f9=0xce;}_0x51a713[_0x4f0f('0x1a')](_0x2455f9);return _0x51a713[_0x4f0f('0x21')](_0x4f0f('0x22'),_0x566049+'-'+_0x86186f+'/'+_0x1942cf)[_0x4f0f('0x1c')](_0x46d7cf);}return null;};}function patchUpdates(_0x537074){return function(_0x276387){try{jsonpatch['apply'](_0x276387,_0x537074,!![]);}catch(_0x3a6f22){return BPromise[_0x4f0f('0x23')](_0x3a6f22);}return _0x276387['save']();};}function saveUpdates(_0x4e4b28,_0x1bdfb4){return function(_0x55d318){if(_0x55d318){return _0x55d318[_0x4f0f('0x24')](_0x4e4b28)[_0x4f0f('0x25')](function(_0x18abde){return _0x18abde;});}return null;};}function removeEntity(_0x17f10c,_0x454720){return function(_0x17a9e9){if(_0x17a9e9){return _0x17a9e9['destroy']()[_0x4f0f('0x25')](function(){_0x17f10c[_0x4f0f('0x1a')](0xcc)[_0x4f0f('0x1b')]();});}};}function handleEntityNotFound(_0x3bc77d,_0xe969c7){return function(_0x3e6b72){if(!_0x3e6b72){_0x3bc77d[_0x4f0f('0x19')](0x194);}return _0x3e6b72;};}function handleError(_0x419986,_0x17cf17){_0x17cf17=_0x17cf17||0x1f4;return function(_0xb20be9){logger[_0x4f0f('0x26')](_0xb20be9[_0x4f0f('0x27')]);if(_0xb20be9[_0x4f0f('0x28')]){delete _0xb20be9['name'];}_0x419986[_0x4f0f('0x1a')](_0x17cf17)[_0x4f0f('0x29')](_0xb20be9);};}exports[_0x4f0f('0x2a')]=function(_0x58ec43,_0xa8a240){var _0x4e5f0d={},_0x449788={},_0x1f4e1d={'count':0x0,'rows':[]};var _0x5ada54=_['map'](db[_0x4f0f('0x2b')]['rawAttributes'],function(_0x1a005e){return{'name':_0x1a005e[_0x4f0f('0x2c')],'type':_0x1a005e['type'][_0x4f0f('0x2d')]};});_0x449788[_0x4f0f('0x2e')]=_[_0x4f0f('0x2f')](_0x5ada54,_0x4f0f('0x28'));_0x449788['query']=_[_0x4f0f('0x30')](_0x58ec43[_0x4f0f('0x31')]);_0x449788[_0x4f0f('0x32')]=_[_0x4f0f('0x33')](_0x449788['model'],_0x449788[_0x4f0f('0x31')]);_0x4e5f0d[_0x4f0f('0x34')]=_[_0x4f0f('0x33')](_0x449788['model'],qs[_0x4f0f('0x35')](_0x58ec43[_0x4f0f('0x31')]['fields']));_0x4e5f0d[_0x4f0f('0x34')]=_0x4e5f0d[_0x4f0f('0x34')][_0x4f0f('0x36')]?_0x4e5f0d[_0x4f0f('0x34')]:_0x449788['model'];if(!_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x37')](_0x4f0f('0x38'))){_0x4e5f0d[_0x4f0f('0x20')]=qs[_0x4f0f('0x20')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x20')]);_0x4e5f0d[_0x4f0f('0x1d')]=qs['offset'](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x1d')]);}_0x4e5f0d[_0x4f0f('0x39')]=qs[_0x4f0f('0x3a')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x3a')]);_0x4e5f0d[_0x4f0f('0x3b')]=qs['filters'](_[_0x4f0f('0x3c')](_0x58ec43[_0x4f0f('0x31')],_0x449788[_0x4f0f('0x32')]),_0x5ada54);if(_0x58ec43['query'][_0x4f0f('0x3d')]){_0x4e5f0d['where']=_[_0x4f0f('0x3e')](_0x4e5f0d['where'],{'$or':_[_0x4f0f('0x2f')](_0x5ada54,function(_0x27b5bf){if(_0x27b5bf['type']!==_0x4f0f('0x3f')){var _0x2d58b0={};_0x2d58b0[_0x27b5bf[_0x4f0f('0x28')]]={'$like':'%'+_0x58ec43['query'][_0x4f0f('0x3d')]+'%'};return _0x2d58b0;}})});}_0x4e5f0d=_[_0x4f0f('0x3e')]({},_0x4e5f0d,_0x58ec43[_0x4f0f('0x40')]);var _0x1b91d7={'where':_0x4e5f0d[_0x4f0f('0x3b')]};return db[_0x4f0f('0x2b')][_0x4f0f('0x1f')](_0x1b91d7)[_0x4f0f('0x25')](function(_0x2659b0){_0x1f4e1d[_0x4f0f('0x1f')]=_0x2659b0;if(_0x58ec43[_0x4f0f('0x31')]['includeAll']){_0x4e5f0d[_0x4f0f('0x41')]=[{'all':!![]}];}return db[_0x4f0f('0x2b')][_0x4f0f('0x42')](_0x4e5f0d);})[_0x4f0f('0x25')](function(_0x419cb4){_0x1f4e1d[_0x4f0f('0x43')]=_0x419cb4;return _0x1f4e1d;})[_0x4f0f('0x25')](respondWithFilteredResult(_0xa8a240,_0x4e5f0d))['catch'](handleError(_0xa8a240,null));};exports[_0x4f0f('0x44')]=function(_0x2e30d6,_0x1d8017){var _0x2bf0b3={'raw':!![],'where':{'id':_0x2e30d6[_0x4f0f('0x45')]['id']}},_0x1744f9={};_0x1744f9['model']=_[_0x4f0f('0x30')](db[_0x4f0f('0x2b')]['rawAttributes']);_0x1744f9['query']=_[_0x4f0f('0x30')](_0x2e30d6[_0x4f0f('0x31')]);_0x1744f9[_0x4f0f('0x32')]=_['intersection'](_0x1744f9[_0x4f0f('0x2e')],_0x1744f9['query']);_0x2bf0b3['attributes']=_[_0x4f0f('0x33')](_0x1744f9[_0x4f0f('0x2e')],qs[_0x4f0f('0x35')](_0x2e30d6[_0x4f0f('0x31')][_0x4f0f('0x35')]));_0x2bf0b3[_0x4f0f('0x34')]=_0x2bf0b3['attributes']['length']?_0x2bf0b3[_0x4f0f('0x34')]:_0x1744f9[_0x4f0f('0x2e')];if(_0x2e30d6[_0x4f0f('0x31')]['includeAll']){_0x2bf0b3[_0x4f0f('0x41')]=[{'all':!![]}];}_0x2bf0b3=_[_0x4f0f('0x3e')]({},_0x2bf0b3,_0x2e30d6[_0x4f0f('0x40')]);return db['CmHopperBlack'][_0x4f0f('0x46')](_0x2bf0b3)['then'](handleEntityNotFound(_0x1d8017,null))[_0x4f0f('0x25')](respondWithResult(_0x1d8017,null))['catch'](handleError(_0x1d8017,null));};exports[_0x4f0f('0x24')]=function(_0x3f2c6e,_0x2b0d3e){if(_0x3f2c6e[_0x4f0f('0x47')]['id']){delete _0x3f2c6e[_0x4f0f('0x47')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3f2c6e[_0x4f0f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b0d3e,null))[_0x4f0f('0x25')](saveUpdates(_0x3f2c6e[_0x4f0f('0x47')],null))[_0x4f0f('0x25')](respondWithResult(_0x2b0d3e,null))[_0x4f0f('0x48')](handleError(_0x2b0d3e,null));};exports[_0x4f0f('0x49')]=function(_0xf92f31,_0x168383){return db[_0x4f0f('0x2b')]['find']({'where':{'id':_0xf92f31[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x168383,null))[_0x4f0f('0x25')](removeEntity(_0x168383,null))[_0x4f0f('0x48')](handleError(_0x168383,null));};exports[_0x4f0f('0x4a')]=function(_0x3262a6,_0x23c9c3){return db[_0x4f0f('0x2b')][_0x4f0f('0x4a')]()[_0x4f0f('0x25')](respondWithResult(_0x23c9c3,null))['catch'](handleError(_0x23c9c3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9fc4015..50d82a7 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 _0xe09a=['request-promise','path','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird'];(function(_0x32ca38,_0x333440){var _0x282d1c=function(_0x4d3a86){while(--_0x4d3a86){_0x32ca38['push'](_0x32ca38['shift']());}};_0x282d1c(++_0x333440);}(_0xe09a,0xc2));var _0xae09=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0xe09a[_0x3a3b9e];return _0x148103;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae09('0x0'))(_0xae09('0x1'));var moment=require(_0xae09('0x2'));var BPromise=require(_0xae09('0x3'));var rp=require(_0xae09('0x4'));var fs=require('fs');var path=require(_0xae09('0x5'));var rimraf=require(_0xae09('0x6'));var config=require(_0xae09('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xae09('0x8')]=function(_0x376ad0,_0x57f72f){return _0x376ad0['define'](_0xae09('0x9'),attributes,{'tableName':_0xae09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b52=['../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x4bfd60,_0x4290e3){var _0x9e5697=function(_0x100daa){while(--_0x100daa){_0x4bfd60['push'](_0x4bfd60['shift']());}};_0x9e5697(++_0x4290e3);}(_0x8b52,0x170));var _0x28b5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8b52[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var logger=require(_0x28b5('0x2'))('api');var moment=require(_0x28b5('0x3'));var BPromise=require(_0x28b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x28b5('0x5'));var config=require(_0x28b5('0x6'));var attributes=require(_0x28b5('0x7'));module[_0x28b5('0x8')]=function(_0x19e8f3,_0x4ee8ab){return _0x19e8f3['define'](_0x28b5('0x9'),attributes,{'tableName':_0x28b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 747741d..049ecc5 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 _0x417c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCmHopperBlack','findAll','options','where','attributes','include','model','map','stringify','catch','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','limit','DestroyCmHopperBlack','debug','lodash','util','moment','randomstring','ioredis'];(function(_0x45990b,_0x34ec13){var _0x29ad96=function(_0x437339){while(--_0x437339){_0x45990b['push'](_0x45990b['shift']());}};_0x29ad96(++_0x34ec13);}(_0x417c,0x1c3));var _0xc417=function(_0x530858,_0x468373){_0x530858=_0x530858-0x0;var _0x2a8252=_0x417c[_0x530858];return _0x2a8252;};'use strict';var _=require(_0xc417('0x0'));var util=require(_0xc417('0x1'));var moment=require(_0xc417('0x2'));var BPromise=require('bluebird');var rs=require(_0xc417('0x3'));var fs=require('fs');var Redis=require(_0xc417('0x4'));var db=require(_0xc417('0x5'))['db'];var utils=require(_0xc417('0x6'));var logger=require(_0xc417('0x7'))(_0xc417('0x8'));var config=require('../../config/environment');var jayson=require(_0xc417('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4edab1,_0x3725f6,_0xcf5503){return new BPromise(function(_0x186457,_0x22ee30){return client[_0xc417('0xa')](_0x4edab1,_0xcf5503)[_0xc417('0xb')](function(_0x41a6e0){logger[_0xc417('0xc')](_0xc417('0xd'),_0x3725f6,_0xc417('0xe'));logger['debug'](_0xc417('0xf'),_0x3725f6,_0xc417('0xe'),JSON['stringify'](_0x41a6e0));if(_0x41a6e0[_0xc417('0x10')]){if(_0x41a6e0['error'][_0xc417('0x11')]===0x1f4){logger[_0xc417('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x3725f6,_0x41a6e0[_0xc417('0x10')][_0xc417('0x12')]);return _0x22ee30(_0x41a6e0[_0xc417('0x10')][_0xc417('0x12')]);}logger[_0xc417('0x10')](_0xc417('0xd'),_0x3725f6,_0x41a6e0[_0xc417('0x10')]['message']);return _0x186457(_0x41a6e0[_0xc417('0x10')][_0xc417('0x12')]);}else{logger['info'](_0xc417('0xd'),_0x3725f6,_0xc417('0xe'));_0x186457(_0x41a6e0[_0xc417('0x13')]['message']);}})['catch'](function(_0x24ac52){logger[_0xc417('0x10')](_0xc417('0xd'),_0x3725f6,_0x24ac52);_0x22ee30(_0x24ac52);});});}exports[_0xc417('0x14')]=function(_0x1e9721){var _0x1a0f2e=this;return new Promise(function(_0x8210d3,_0x5f3715){return db['CmHopperBlack'][_0xc417('0x15')]({'raw':_0x1e9721['options']?_0x1e9721[_0xc417('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1e9721['options']?_0x1e9721['options'][_0xc417('0x17')]||null:null,'attributes':_0x1e9721[_0xc417('0x16')]?_0x1e9721['options'][_0xc417('0x18')]||null:null,'limit':_0x1e9721[_0xc417('0x16')]?_0x1e9721[_0xc417('0x16')]['limit']||null:null,'include':_0x1e9721[_0xc417('0x16')]?_0x1e9721[_0xc417('0x16')]['include']?_['map'](_0x1e9721[_0xc417('0x16')][_0xc417('0x19')],function(_0x24875a){return{'model':db[_0x24875a[_0xc417('0x1a')]],'as':_0x24875a['as'],'attributes':_0x24875a[_0xc417('0x18')],'include':_0x24875a['include']?_[_0xc417('0x1b')](_0x24875a['include'],function(_0x236c50){return{'model':db[_0x236c50['model']],'as':_0x236c50['as'],'attributes':_0x236c50['attributes'],'include':_0x236c50[_0xc417('0x19')]?_[_0xc417('0x1b')](_0x236c50[_0xc417('0x19')],function(_0x2d8e4d){return{'model':db[_0x2d8e4d[_0xc417('0x1a')]],'as':_0x2d8e4d['as'],'attributes':_0x2d8e4d[_0xc417('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc417('0xb')](function(_0x41b49a){logger['info']('GetCmHopperBlack',_0x1e9721);logger['debug']('GetCmHopperBlack',_0x1e9721,JSON[_0xc417('0x1c')](_0x41b49a));_0x8210d3(_0x41b49a);})[_0xc417('0x1d')](function(_0x399192){logger[_0xc417('0x10')](_0xc417('0x14'),_0x399192[_0xc417('0x12')],_0x1e9721);_0x5f3715(_0x1a0f2e[_0xc417('0x10')](0x1f4,_0x399192[_0xc417('0x12')]));});});};exports[_0xc417('0x1e')]=function(_0x472f32){var _0x281d4f=this;return new Promise(function(_0x5aef1f,_0x18bbd1){return db[_0xc417('0x1f')][_0xc417('0x20')](_0x472f32[_0xc417('0x21')],{'raw':_0x472f32['options']?_0x472f32['options'][_0xc417('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472f32['options']?_0x472f32[_0xc417('0x16')]['where']||null:null,'attributes':_0x472f32['options']?_0x472f32['options']['attributes']||null:null,'limit':_0x472f32['options']?_0x472f32[_0xc417('0x16')][_0xc417('0x23')]||null:null})[_0xc417('0xb')](function(_0x277d0d){logger[_0xc417('0xc')]('UpdateCmHopperBlack',_0x472f32);logger['debug']('UpdateCmHopperBlack',_0x472f32,JSON[_0xc417('0x1c')](_0x277d0d));_0x5aef1f(_0x277d0d);})[_0xc417('0x1d')](function(_0x23ed91){logger[_0xc417('0x10')]('UpdateCmHopperBlack',_0x23ed91[_0xc417('0x12')],_0x472f32);_0x18bbd1(_0x281d4f[_0xc417('0x10')](0x1f4,_0x23ed91[_0xc417('0x12')]));});});};exports[_0xc417('0x24')]=function(_0x518bab){var _0x3d5847=this;return new Promise(function(_0x3cce15,_0x1a4ff3){return db['CmHopperBlack']['destroy']({'where':_0x518bab[_0xc417('0x16')]?_0x518bab[_0xc417('0x16')]['where']||null:null})[_0xc417('0xb')](function(_0x44ee0f){logger['info'](_0xc417('0x24'),_0x518bab);logger[_0xc417('0x25')](_0xc417('0x24'),_0x518bab,JSON[_0xc417('0x1c')](_0x44ee0f));_0x3cce15(_0x44ee0f);})[_0xc417('0x1d')](function(_0x4a2b13){logger['error']('DestroyCmHopperBlack',_0x4a2b13[_0xc417('0x12')],_0x518bab);_0x1a4ff3(_0x3d5847[_0xc417('0x10')](0x1f4,_0x4a2b13['message']));});});}; \ No newline at end of file +var _0x41ef=['update','body','raw','destroy','DestroyCmHopperBlack','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x41ef,0x1e7));var _0xf41e=function(_0xbf2f5,_0x576dd5){_0xbf2f5=_0xbf2f5-0x0;var _0x52c3db=_0x41ef[_0xbf2f5];return _0x52c3db;};'use strict';var _=require(_0xf41e('0x0'));var util=require(_0xf41e('0x1'));var moment=require('moment');var BPromise=require(_0xf41e('0x2'));var rs=require(_0xf41e('0x3'));var fs=require('fs');var Redis=require(_0xf41e('0x4'));var db=require(_0xf41e('0x5'))['db'];var utils=require(_0xf41e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf41e('0x7'));var client=jayson['client'][_0xf41e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ac8a2,_0x99fcd9,_0x5084bc){return new BPromise(function(_0x45781e,_0xf62e14){return client[_0xf41e('0x9')](_0x4ac8a2,_0x5084bc)[_0xf41e('0xa')](function(_0x1dcc75){logger[_0xf41e('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x99fcd9,'request\x20sent');logger['debug'](_0xf41e('0xc'),_0x99fcd9,_0xf41e('0xd'),JSON[_0xf41e('0xe')](_0x1dcc75));if(_0x1dcc75[_0xf41e('0xf')]){if(_0x1dcc75[_0xf41e('0xf')][_0xf41e('0x10')]===0x1f4){logger[_0xf41e('0xf')](_0xf41e('0x11'),_0x99fcd9,_0x1dcc75[_0xf41e('0xf')][_0xf41e('0x12')]);return _0xf62e14(_0x1dcc75[_0xf41e('0xf')][_0xf41e('0x12')]);}logger['error'](_0xf41e('0x11'),_0x99fcd9,_0x1dcc75[_0xf41e('0xf')][_0xf41e('0x12')]);return _0x45781e(_0x1dcc75['error']['message']);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x99fcd9,_0xf41e('0xd'));_0x45781e(_0x1dcc75['result'][_0xf41e('0x12')]);}})[_0xf41e('0x13')](function(_0x5ebec2){logger[_0xf41e('0xf')](_0xf41e('0x11'),_0x99fcd9,_0x5ebec2);_0xf62e14(_0x5ebec2);});});}exports[_0xf41e('0x14')]=function(_0x11ce95){var _0x1674dc=this;return new Promise(function(_0x362eac,_0x1a3459){return db[_0xf41e('0x15')][_0xf41e('0x16')]({'raw':_0x11ce95['options']?_0x11ce95['options']['raw']===undefined?!![]:![]:!![],'where':_0x11ce95['options']?_0x11ce95[_0xf41e('0x17')][_0xf41e('0x18')]||null:null,'attributes':_0x11ce95[_0xf41e('0x17')]?_0x11ce95['options'][_0xf41e('0x19')]||null:null,'limit':_0x11ce95[_0xf41e('0x17')]?_0x11ce95[_0xf41e('0x17')][_0xf41e('0x1a')]||null:null,'include':_0x11ce95[_0xf41e('0x17')]?_0x11ce95[_0xf41e('0x17')][_0xf41e('0x1b')]?_[_0xf41e('0x1c')](_0x11ce95['options'][_0xf41e('0x1b')],function(_0x5dc17d){return{'model':db[_0x5dc17d['model']],'as':_0x5dc17d['as'],'attributes':_0x5dc17d[_0xf41e('0x19')],'include':_0x5dc17d['include']?_[_0xf41e('0x1c')](_0x5dc17d[_0xf41e('0x1b')],function(_0x49b3b3){return{'model':db[_0x49b3b3[_0xf41e('0x1d')]],'as':_0x49b3b3['as'],'attributes':_0x49b3b3[_0xf41e('0x19')],'include':_0x49b3b3[_0xf41e('0x1b')]?_[_0xf41e('0x1c')](_0x49b3b3[_0xf41e('0x1b')],function(_0xc47e55){return{'model':db[_0xc47e55['model']],'as':_0xc47e55['as'],'attributes':_0xc47e55['attributes']};}):[]};}):[]};}):[]:[]})[_0xf41e('0xa')](function(_0x2d9f3f){logger[_0xf41e('0xb')]('GetCmHopperBlack',_0x11ce95);logger['debug'](_0xf41e('0x14'),_0x11ce95,JSON[_0xf41e('0xe')](_0x2d9f3f));_0x362eac(_0x2d9f3f);})['catch'](function(_0x2da19b){logger['error'](_0xf41e('0x14'),_0x2da19b[_0xf41e('0x12')],_0x11ce95);_0x1a3459(_0x1674dc[_0xf41e('0xf')](0x1f4,_0x2da19b[_0xf41e('0x12')]));});});};exports[_0xf41e('0x1e')]=function(_0x4dd6e2){var _0x1cfd10=this;return new Promise(function(_0xbd6897,_0x108c57){return db[_0xf41e('0x15')][_0xf41e('0x1f')](_0x4dd6e2[_0xf41e('0x20')],{'raw':_0x4dd6e2[_0xf41e('0x17')]?_0x4dd6e2[_0xf41e('0x17')][_0xf41e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dd6e2[_0xf41e('0x17')]?_0x4dd6e2['options'][_0xf41e('0x18')]||null:null,'attributes':_0x4dd6e2[_0xf41e('0x17')]?_0x4dd6e2[_0xf41e('0x17')][_0xf41e('0x19')]||null:null,'limit':_0x4dd6e2[_0xf41e('0x17')]?_0x4dd6e2[_0xf41e('0x17')][_0xf41e('0x1a')]||null:null})[_0xf41e('0xa')](function(_0x11a480){logger[_0xf41e('0xb')]('UpdateCmHopperBlack',_0x4dd6e2);logger['debug'](_0xf41e('0x1e'),_0x4dd6e2,JSON[_0xf41e('0xe')](_0x11a480));_0xbd6897(_0x11a480);})[_0xf41e('0x13')](function(_0x2c994f){logger[_0xf41e('0xf')](_0xf41e('0x1e'),_0x2c994f[_0xf41e('0x12')],_0x4dd6e2);_0x108c57(_0x1cfd10[_0xf41e('0xf')](0x1f4,_0x2c994f[_0xf41e('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x2e01d8){var _0x4f4695=this;return new Promise(function(_0x1c991c,_0x141b32){return db[_0xf41e('0x15')][_0xf41e('0x22')]({'where':_0x2e01d8[_0xf41e('0x17')]?_0x2e01d8[_0xf41e('0x17')][_0xf41e('0x18')]||null:null})[_0xf41e('0xa')](function(_0x3d584e){logger[_0xf41e('0xb')](_0xf41e('0x23'),_0x2e01d8);logger[_0xf41e('0x24')](_0xf41e('0x23'),_0x2e01d8,JSON['stringify'](_0x3d584e));_0x1c991c(_0x3d584e);})[_0xf41e('0x13')](function(_0x11c0d2){logger[_0xf41e('0xf')]('DestroyCmHopperBlack',_0x11c0d2['message'],_0x2e01d8);_0x141b32(_0x4f4695['error'](0x1f4,_0x11c0d2['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8496615..5c1a2bf 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 _0x2eb2=['/describe','describe','/:id','show','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x55b19c,_0x34e5f3){var _0x153e05=function(_0x289562){while(--_0x289562){_0x55b19c['push'](_0x55b19c['shift']());}};_0x153e05(++_0x34e5f3);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x2eb2[_0x5b561d];return _0x431060;};'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('./cmHopperBlack.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/:id',auth[_0x22eb('0x8')](),controller['update']);router['delete'](_0x22eb('0xc'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);module[_0x22eb('0x10')]=router; \ No newline at end of file +var _0x5d17=['index','/describe','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x5d17,0x114));var _0x75d1=function(_0x3cf387,_0x31ed26){_0x3cf387=_0x3cf387-0x0;var _0x24425f=_0x5d17[_0x3cf387];return _0x24425f;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0xf')]);router[_0x75d1('0x10')]('/:id',auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);module[_0x75d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6ab0180..304fccc 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 _0x64ac=['DATE','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x64ac,0x75));var _0xc64a=function(_0x102055,_0x582094){_0x102055=_0x102055-0x0;var _0x36e34a=_0x64ac[_0x102055];return _0x36e34a;};'use strict';var Sequelize=require(_0xc64a('0x0'));var moment=require('moment');module[_0xc64a('0x1')]={'state':{'type':Sequelize[_0xc64a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc64a('0x3')]},'scheduledat':{'type':Sequelize[_0xc64a('0x4')]},'countbusyretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc64a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc64a('0x3')]},'originatecalleridname':{'type':Sequelize[_0xc64a('0x3')]},'calleridnum':{'type':Sequelize[_0xc64a('0x3')]},'calleridname':{'type':Sequelize[_0xc64a('0x3')]},'starttime':{'type':Sequelize[_0xc64a('0x4')]},'responsetime':{'type':Sequelize[_0xc64a('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xc64a('0x4')]},'endtime':{'type':Sequelize[_0xc64a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xc64a('0x3')]},'membername':{'type':Sequelize[_0xc64a('0x3')]},'reason':{'type':Sequelize[_0xc64a('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc64a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc64a('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x52f1c6){var _0x308a79=this['getDataValue']('endtime');if(_0x308a79&&_0x52f1c6){this[_0xc64a('0x5')](_0xc64a('0x6'),moment(_0x52f1c6)[_0xc64a('0x7')](moment(_0x308a79),_0xc64a('0x8')));}return this[_0xc64a('0x5')](_0xc64a('0x9'),_0x52f1c6);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc64a('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc64a('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc64a('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xc64a('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc64a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc64a('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc64a('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc64a('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc64a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf7f=['followuptime','diff','seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','endtime','setDataValue'];(function(_0x55a44c,_0x4e67cb){var _0x22c6d3=function(_0x35a837){while(--_0x35a837){_0x55a44c['push'](_0x55a44c['shift']());}};_0x22c6d3(++_0x4e67cb);}(_0xaf7f,0x10d));var _0xfaf7=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xaf7f[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfaf7('0x0')]={'state':{'type':Sequelize[_0xfaf7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfaf7('0x2')]},'scheduledat':{'type':Sequelize[_0xfaf7('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfaf7('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xfaf7('0x2')]},'calleridnum':{'type':Sequelize[_0xfaf7('0x2')]},'calleridname':{'type':Sequelize[_0xfaf7('0x2')]},'starttime':{'type':Sequelize[_0xfaf7('0x3')]},'responsetime':{'type':Sequelize[_0xfaf7('0x3')]},'answertime':{'type':Sequelize[_0xfaf7('0x3')]},'droptime':{'type':Sequelize[_0xfaf7('0x3')]},'endtime':{'type':Sequelize[_0xfaf7('0x3')]},'ringtime':{'type':Sequelize[_0xfaf7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfaf7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfaf7('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfaf7('0x2')]},'campaign':{'type':Sequelize[_0xfaf7('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfaf7('0x2')]},'reason':{'type':Sequelize[_0xfaf7('0x2')]},'disposition':{'type':Sequelize[_0xfaf7('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xfaf7('0x3')],'set':function(_0xb472a1){var _0x25018c=this['getDataValue'](_0xfaf7('0x4'));if(_0x25018c&&_0xb472a1){this[_0xfaf7('0x5')](_0xfaf7('0x6'),moment(_0xb472a1)[_0xfaf7('0x7')](moment(_0x25018c),_0xfaf7('0x8')));}return this['setDataValue'](_0xfaf7('0x9'),_0xb472a1);}},'amd':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfaf7('0x3')]},'callback':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfaf7('0x3')]},'deleted':{'type':Sequelize[_0xfaf7('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfaf7('0x3')]},'recallme':{'type':Sequelize[_0xfaf7('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xfaf7('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfaf7('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfaf7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfaf7('0x1')],'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 983ab9b..2033a96 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 _0x1967=['sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmHopperFinal','includeAll','include','findAll','rows','show','params','fields','options','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','state','calleridnum','group','checkContactHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x34bd9f,_0x3b4450){var _0x387bd1=function(_0x41629e){while(--_0x41629e){_0x34bd9f['push'](_0x34bd9f['shift']());}};_0x387bd1(++_0x3b4450);}(_0x1967,0x173));var _0x7196=function(_0x2af111,_0x49459d){_0x2af111=_0x2af111-0x0;var _0x404a3e=_0x1967[_0x2af111];return _0x404a3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['CmHopperFinal'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':!![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['describe']=function(_0x29c7e8,_0x582884){return db['CmHopperFinal'][_0x7196('0x49')]()['then'](respondWithResult(_0x582884,null))['catch'](handleError(_0x582884,null));};exports['update']=function(_0x2299e2,_0x5052ee){if(_0x2299e2['body'][_0x7196('0x4a')]){delete _0x2299e2[_0x7196('0x4b')][_0x7196('0x4a')];}return db[_0x7196('0x3e')]['find']({'where':{'uniqueid':_0x2299e2[_0x7196('0x44')]['id']}})['then'](handleEntityNotFound(_0x5052ee,null))[_0x7196('0x27')](saveUpdates(_0x2299e2[_0x7196('0x4b')],null))['then'](respondWithResult(_0x5052ee,null))[_0x7196('0x48')](handleError(_0x5052ee,null));};exports[_0x7196('0x4c')]=function(_0x3fe092,_0x4fa18f,_0x317ab6){return db['CmHopperFinal'][_0x7196('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x3fe092[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),_0x7196('0x51')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x52')))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x54')))),_0x7196('0x55')],[db['sequelize']['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7196('0x58')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),'reCallContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7196('0x27')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x27')](respondWithResult(_0x4fa18f,null))[_0x7196('0x48')](handleError(_0x4fa18f,null));};exports[_0x7196('0x5a')]=function(_0x14cb38,_0x43b9ac,_0xe3fb61){return db[_0x7196('0x3e')][_0x7196('0x41')]({'raw':![],'where':{'CampaignId':_0x14cb38[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5b')))),_0x7196('0x51')],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x54')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5c')))),'abandonedContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),_0x7196('0x5d')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x7196('0x5e')]]})['then'](handleEntityNotFound(_0x43b9ac,null))[_0x7196('0x27')](respondWithResult(_0x43b9ac,null))[_0x7196('0x48')](handleError(_0x43b9ac,null));};exports[_0x7196('0x5f')]=function(_0x267903,_0x5ab6ae,_0x5a786a){return db[_0x7196('0x60')]['find']({'where':{'id':_0x267903[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x5ab6ae,null))[_0x7196('0x27')](function(_0x38c1b3){var _0xd4c784;if(_0x38c1b3){_0xd4c784=squel[_0x7196('0x61')]()['into'](_0x7196('0x62'))[_0x7196('0x63')]([_0x7196('0x64'),_0x7196('0x65'),_0x7196('0x66'),_0x7196('0x67'),_0x7196('0x68'),_0x7196('0x69'),_0x7196('0x6a')],squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x6d'),'phone')[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')['field'](_0x7196('0x6f'),_0x7196('0x66'))[_0x7196('0x6c')]('ANY_VALUE(ListId)',_0x7196('0x67'))['field'](_0x7196('0x70'),_0x7196('0x68'))['field'](_0x7196('0x6e'),'createdAt')['field'](_0x7196('0x6e'),_0x7196('0x6a'))[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')]('VoiceQueueId\x20=\x20?',_0x267903[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x73'),_0x267903[_0x7196('0x4b')]['state'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x74'))[_0x7196('0x3a')](_0x7196('0x75'),squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x64'))['from'](_0x7196('0x62'))[_0x7196('0x3a')](_0x7196('0x76'),_0x267903[_0x7196('0x44')]['id']['toString']()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')]('calleridnum')[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')](_0x7196('0x76'),_0x267903['params']['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x77')))['group']('ContactId'))[_0x7196('0x72')]();return db['sequelize']['query'](_0xd4c784);}return[];})[_0x7196('0x27')](respondWithResult(_0x5ab6ae,null))[_0x7196('0x48')](handleError(_0x5ab6ae,null));};exports[_0x7196('0x78')]=function(_0x509c4a,_0x35c5b3,_0x59370b){return db[_0x7196('0x79')][_0x7196('0x47')]({'where':{'id':_0x509c4a[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x35c5b3,null))[_0x7196('0x27')](function(_0x8673e){var _0x32ba47;if(_0x8673e){_0x32ba47=squel[_0x7196('0x61')]()[_0x7196('0x7a')]('cm_hopper')['fromQuery']([_0x7196('0x64'),'scheduledAt','ContactId',_0x7196('0x67'),_0x7196('0x7b'),_0x7196('0x69'),_0x7196('0x6a')],squel['select']()['field'](_0x7196('0x6d'),_0x7196('0x64'))[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')[_0x7196('0x6c')]('ANY_VALUE(ContactId)','ContactId')[_0x7196('0x6c')](_0x7196('0x7c'),_0x7196('0x67'))['field'](_0x7196('0x7d'),_0x7196('0x7b'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x69'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x6a'))['from'](_0x7196('0x7e'))[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())['where'](_0x7196('0x73'),_0x509c4a[_0x7196('0x4b')][_0x7196('0x80')]['toString']())[_0x7196('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7196('0x75'),squel[_0x7196('0x6b')]()['field'](_0x7196('0x64'))[_0x7196('0x71')]('cm_hopper')[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')](_0x7196('0x81'))[_0x7196('0x71')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')]('state\x20=\x204'))[_0x7196('0x82')]('ContactId'))[_0x7196('0x72')]();return db['sequelize'][_0x7196('0x31')](_0x32ba47);}return[];})[_0x7196('0x27')](respondWithResult(_0x35c5b3,null))[_0x7196('0x48')](handleError(_0x35c5b3,null));};exports[_0x7196('0x83')]=function(_0x37290e,_0x10b628,_0x43e7d5){return db['CmHopper'][_0x7196('0x84')]({'where':{'VoiceQueueId':_0x37290e['body']['VoiceQueueId'],'CampaignId':_0x37290e['body']['CampaignId'],'ContactId':_0x37290e['body'][_0x7196('0x66')]}})[_0x7196('0x27')](handleEntityNotFound(_0x10b628,null))[_0x7196('0x27')](function(_0x5bab25){if(_0x5bab25){return _0x5bab25;}return null;})[_0x7196('0x27')](respondWithResult(_0x10b628,null))['catch'](handleError(_0x10b628,null));}; \ No newline at end of file +var _0x1967=['sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmHopperFinal','includeAll','include','findAll','rows','show','params','fields','options','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','state','calleridnum','group','checkContactHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2ca6d1,_0x3c07ca){var _0x1b6c13=function(_0x4e6f0e){while(--_0x4e6f0e){_0x2ca6d1['push'](_0x2ca6d1['shift']());}};_0x1b6c13(++_0x3c07ca);}(_0x1967,0x173));var _0x7196=function(_0x1777cd,_0x34bf19){_0x1777cd=_0x1777cd-0x0;var _0x893781=_0x1967[_0x1777cd];return _0x893781;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['CmHopperFinal'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':!![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['describe']=function(_0x29c7e8,_0x582884){return db['CmHopperFinal'][_0x7196('0x49')]()['then'](respondWithResult(_0x582884,null))['catch'](handleError(_0x582884,null));};exports['update']=function(_0x2299e2,_0x5052ee){if(_0x2299e2['body'][_0x7196('0x4a')]){delete _0x2299e2[_0x7196('0x4b')][_0x7196('0x4a')];}return db[_0x7196('0x3e')]['find']({'where':{'uniqueid':_0x2299e2[_0x7196('0x44')]['id']}})['then'](handleEntityNotFound(_0x5052ee,null))[_0x7196('0x27')](saveUpdates(_0x2299e2[_0x7196('0x4b')],null))['then'](respondWithResult(_0x5052ee,null))[_0x7196('0x48')](handleError(_0x5052ee,null));};exports[_0x7196('0x4c')]=function(_0x3fe092,_0x4fa18f,_0x317ab6){return db['CmHopperFinal'][_0x7196('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x3fe092[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),_0x7196('0x51')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x52')))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x54')))),_0x7196('0x55')],[db['sequelize']['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7196('0x58')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),'reCallContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7196('0x27')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x27')](respondWithResult(_0x4fa18f,null))[_0x7196('0x48')](handleError(_0x4fa18f,null));};exports[_0x7196('0x5a')]=function(_0x14cb38,_0x43b9ac,_0xe3fb61){return db[_0x7196('0x3e')][_0x7196('0x41')]({'raw':![],'where':{'CampaignId':_0x14cb38[_0x7196('0x44')]['id']},'attributes':[[db[_0x7196('0x4d')]['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x50')))),'noSuchContacts'],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5b')))),_0x7196('0x51')],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x7196('0x53')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x54')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x7196('0x4d')]['fn']('IF',db['sequelize'][_0x7196('0x4f')](_0x7196('0x56')))),_0x7196('0x57')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x5c')))),'abandonedContacts'],[db['sequelize']['fn'](_0x7196('0x4e'),db[_0x7196('0x4d')]['fn']('IF',db[_0x7196('0x4d')][_0x7196('0x4f')](_0x7196('0x59')))),_0x7196('0x5d')],[db[_0x7196('0x4d')]['fn'](_0x7196('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x7196('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x7196('0x5e')]]})['then'](handleEntityNotFound(_0x43b9ac,null))[_0x7196('0x27')](respondWithResult(_0x43b9ac,null))[_0x7196('0x48')](handleError(_0x43b9ac,null));};exports[_0x7196('0x5f')]=function(_0x267903,_0x5ab6ae,_0x5a786a){return db[_0x7196('0x60')]['find']({'where':{'id':_0x267903[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x5ab6ae,null))[_0x7196('0x27')](function(_0x38c1b3){var _0xd4c784;if(_0x38c1b3){_0xd4c784=squel[_0x7196('0x61')]()['into'](_0x7196('0x62'))[_0x7196('0x63')]([_0x7196('0x64'),_0x7196('0x65'),_0x7196('0x66'),_0x7196('0x67'),_0x7196('0x68'),_0x7196('0x69'),_0x7196('0x6a')],squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x6d'),'phone')[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')['field'](_0x7196('0x6f'),_0x7196('0x66'))[_0x7196('0x6c')]('ANY_VALUE(ListId)',_0x7196('0x67'))['field'](_0x7196('0x70'),_0x7196('0x68'))['field'](_0x7196('0x6e'),'createdAt')['field'](_0x7196('0x6e'),_0x7196('0x6a'))[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')]('VoiceQueueId\x20=\x20?',_0x267903[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x73'),_0x267903[_0x7196('0x4b')]['state'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x74'))[_0x7196('0x3a')](_0x7196('0x75'),squel[_0x7196('0x6b')]()[_0x7196('0x6c')](_0x7196('0x64'))['from'](_0x7196('0x62'))[_0x7196('0x3a')](_0x7196('0x76'),_0x267903[_0x7196('0x44')]['id']['toString']()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')]('calleridnum')[_0x7196('0x71')]('cm_hopper_final')[_0x7196('0x3a')](_0x7196('0x76'),_0x267903['params']['id'][_0x7196('0x72')]())[_0x7196('0x3a')](_0x7196('0x77')))['group']('ContactId'))[_0x7196('0x72')]();return db['sequelize']['query'](_0xd4c784);}return[];})[_0x7196('0x27')](respondWithResult(_0x5ab6ae,null))[_0x7196('0x48')](handleError(_0x5ab6ae,null));};exports[_0x7196('0x78')]=function(_0x509c4a,_0x35c5b3,_0x59370b){return db[_0x7196('0x79')][_0x7196('0x47')]({'where':{'id':_0x509c4a[_0x7196('0x44')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x35c5b3,null))[_0x7196('0x27')](function(_0x8673e){var _0x32ba47;if(_0x8673e){_0x32ba47=squel[_0x7196('0x61')]()[_0x7196('0x7a')]('cm_hopper')['fromQuery']([_0x7196('0x64'),'scheduledAt','ContactId',_0x7196('0x67'),_0x7196('0x7b'),_0x7196('0x69'),_0x7196('0x6a')],squel['select']()['field'](_0x7196('0x6d'),_0x7196('0x64'))[_0x7196('0x6c')](_0x7196('0x6e'),'scheduledAt')[_0x7196('0x6c')]('ANY_VALUE(ContactId)','ContactId')[_0x7196('0x6c')](_0x7196('0x7c'),_0x7196('0x67'))['field'](_0x7196('0x7d'),_0x7196('0x7b'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x69'))[_0x7196('0x6c')](_0x7196('0x6e'),_0x7196('0x6a'))['from'](_0x7196('0x7e'))[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())['where'](_0x7196('0x73'),_0x509c4a[_0x7196('0x4b')][_0x7196('0x80')]['toString']())[_0x7196('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7196('0x75'),squel[_0x7196('0x6b')]()['field'](_0x7196('0x64'))[_0x7196('0x71')]('cm_hopper')[_0x7196('0x3a')](_0x7196('0x7f'),_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]()))[_0x7196('0x3a')](_0x7196('0x75'),squel['select']()[_0x7196('0x6c')](_0x7196('0x81'))[_0x7196('0x71')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x509c4a[_0x7196('0x44')]['id'][_0x7196('0x72')]())[_0x7196('0x3a')]('state\x20=\x204'))[_0x7196('0x82')]('ContactId'))[_0x7196('0x72')]();return db['sequelize'][_0x7196('0x31')](_0x32ba47);}return[];})[_0x7196('0x27')](respondWithResult(_0x35c5b3,null))[_0x7196('0x48')](handleError(_0x35c5b3,null));};exports[_0x7196('0x83')]=function(_0x37290e,_0x10b628,_0x43e7d5){return db['CmHopper'][_0x7196('0x84')]({'where':{'VoiceQueueId':_0x37290e['body']['VoiceQueueId'],'CampaignId':_0x37290e['body']['CampaignId'],'ContactId':_0x37290e['body'][_0x7196('0x66')]}})[_0x7196('0x27')](handleEntityNotFound(_0x10b628,null))[_0x7196('0x27')](function(_0x5bab25){if(_0x5bab25){return _0x5bab25;}return null;})[_0x7196('0x27')](respondWithResult(_0x10b628,null))['catch'](handleError(_0x10b628,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 90306c3..cbe6fe8 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 _0x5dbd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x5dbd,0xc3));var _0xd5db=function(_0x2685cd,_0x8d2bf3){_0x2685cd=_0x2685cd-0x0;var _0x3b4b9b=_0x5dbd[_0x2685cd];return _0x3b4b9b;};'use strict';var _=require(_0xd5db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd5db('0x1'));var BPromise=require(_0xd5db('0x2'));var rp=require(_0xd5db('0x3'));var fs=require('fs');var path=require(_0xd5db('0x4'));var rimraf=require(_0xd5db('0x5'));var config=require(_0xd5db('0x6'));var attributes=require(_0xd5db('0x7'));module[_0xd5db('0x8')]=function(_0x7b5790,_0xe58b2e){return _0x7b5790[_0xd5db('0x9')](_0xd5db('0xa'),attributes,{'tableName':_0xd5db('0xb'),'paranoid':![],'indexes':[{'name':_0xd5db('0xc'),'fields':[_0xd5db('0xc')]},{'name':_0xd5db('0xd'),'fields':[_0xd5db('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3108=['exports','CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x42a4a4,_0x310192){var _0x44bfa3=function(_0x33ea02){while(--_0x33ea02){_0x42a4a4['push'](_0x42a4a4['shift']());}};_0x44bfa3(++_0x310192);}(_0x3108,0xd0));var _0x8310=function(_0x4aa4dc,_0x38fca6){_0x4aa4dc=_0x4aa4dc-0x0;var _0x559cb3=_0x3108[_0x4aa4dc];return _0x559cb3;};'use strict';var _=require(_0x8310('0x0'));var util=require('util');var logger=require(_0x8310('0x1'))(_0x8310('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8310('0x3'));var fs=require('fs');var path=require(_0x8310('0x4'));var rimraf=require(_0x8310('0x5'));var config=require(_0x8310('0x6'));var attributes=require(_0x8310('0x7'));module[_0x8310('0x8')]=function(_0xc0b9ce,_0xa05c78){return _0xc0b9ce['define'](_0x8310('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x8310('0xa'),'fields':[_0x8310('0xa')]},{'name':'uniqueid','fields':[_0x8310('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 bd3ba79..8d131e4 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(_0x2c7c18,_0x396f65){var _0xae899d=function(_0x539c2e){while(--_0x539c2e){_0x2c7c18['push'](_0x2c7c18['shift']());}};_0xae899d(++_0x396f65);}(_0x7a54,0x106));var _0x47a5=function(_0x24d894,_0x23c73f){_0x24d894=_0x24d894-0x0;var _0x5477f3=_0x7a54[_0x24d894];return _0x5477f3;};'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(_0x137833,_0x4224c0){var _0x1735a1=function(_0x2bf2cc){while(--_0x2bf2cc){_0x137833['push'](_0x137833['shift']());}};_0x1735a1(++_0x4224c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x19a21c,_0x4e03f8){_0x19a21c=_0x19a21c-0x0;var _0x3e9b9f=_0xb10b[_0x19a21c];return _0x3e9b9f;};'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 14e1ba3..67a7cd1 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 _0x18b1=['describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','checkContactHopper','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','isAuthenticated'];(function(_0x3aa807,_0x367ae0){var _0x1377f9=function(_0x28a31d){while(--_0x28a31d){_0x3aa807['push'](_0x3aa807['shift']());}};_0x1377f9(++_0x367ae0);}(_0x18b1,0x9a));var _0x118b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x18b1[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x118b('0x0'));var util=require(_0x118b('0x1'));var path=require(_0x118b('0x2'));var timeout=require(_0x118b('0x3'));var express=require(_0x118b('0x4'));var router=express[_0x118b('0x5')]();var fs_extra=require(_0x118b('0x6'));var auth=require(_0x118b('0x7'));var interaction=require(_0x118b('0x8'));var config=require(_0x118b('0x9'));var controller=require(_0x118b('0xa'));router[_0x118b('0xb')]('/',auth['isAuthenticated'](),controller[_0x118b('0xc')]);router[_0x118b('0xb')]('/describe',auth[_0x118b('0xd')](),controller[_0x118b('0xe')]);router[_0x118b('0xb')](_0x118b('0xf'),auth[_0x118b('0xd')](),controller[_0x118b('0x10')]);router[_0x118b('0xb')](_0x118b('0x11'),auth[_0x118b('0xd')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x118b('0xb')](_0x118b('0x12'),auth[_0x118b('0xd')](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x118b('0x13')]);router[_0x118b('0x14')](_0x118b('0x15'),auth[_0x118b('0xd')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x118b('0x14')]('/checkContactHopper',auth[_0x118b('0xd')](),controller[_0x118b('0x16')]);router[_0x118b('0x17')](_0x118b('0xf'),auth[_0x118b('0xd')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xe2cf=['Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','/:id','update','exports','multer','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2cf,0x14e));var _0xfe2c=function(_0x53e6a8,_0x5839ab){_0x53e6a8=_0x53e6a8-0x0;var _0x2b6dcc=_0xe2cf[_0x53e6a8];return _0x2b6dcc;};'use strict';var multer=require(_0xfe2c('0x0'));var util=require(_0xfe2c('0x1'));var path=require(_0xfe2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe2c('0x3'));var router=express[_0xfe2c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfe2c('0x5'));var interaction=require(_0xfe2c('0x6'));var config=require('../../config/environment');var controller=require(_0xfe2c('0x7'));router[_0xfe2c('0x8')]('/',auth[_0xfe2c('0x9')](),controller[_0xfe2c('0xa')]);router['get']('/describe',auth[_0xfe2c('0x9')](),controller[_0xfe2c('0xb')]);router['get']('/:id',auth[_0xfe2c('0x9')](),controller[_0xfe2c('0xc')]);router['get'](_0xfe2c('0xd'),auth[_0xfe2c('0x9')](),controller[_0xfe2c('0xe')]);router[_0xfe2c('0x8')](_0xfe2c('0xf'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xfe2c('0x10')](_0xfe2c('0x11'),auth[_0xfe2c('0x9')](),controller[_0xfe2c('0x12')]);router[_0xfe2c('0x10')](_0xfe2c('0x13'),auth[_0xfe2c('0x9')](),controller[_0xfe2c('0x14')]);router[_0xfe2c('0x10')](_0xfe2c('0x15'),auth['isAuthenticated'](),controller['checkContactHopper']);router[_0xfe2c('0x16')](_0xfe2c('0x17'),auth[_0xfe2c('0x9')](),controller[_0xfe2c('0x18')]);module[_0xfe2c('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5e2b902..0322312 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 _0x9924=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x413d83,_0x487390){var _0xe15e65=function(_0x3ce0ee){while(--_0x3ce0ee){_0x413d83['push'](_0x413d83['shift']());}};_0xe15e65(++_0x487390);}(_0x9924,0xea));var _0x4992=function(_0x35b76b,_0x561a7f){_0x35b76b=_0x35b76b-0x0;var _0x3bd93f=_0x9924[_0x35b76b];return _0x3bd93f;};'use strict';var Sequelize=require(_0x4992('0x0'));module[_0x4992('0x1')]={'state':{'type':Sequelize[_0x4992('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4992('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4992('0x3')]},'calleridnum':{'type':Sequelize[_0x4992('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4992('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4992('0x4')]},'droptime':{'type':Sequelize[_0x4992('0x4')]},'endtime':{'type':Sequelize[_0x4992('0x4')]},'ringtime':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4992('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4992('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x4992('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4992('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4992('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4992('0x4')]},'recallme':{'type':Sequelize[_0x4992('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4992('0x4')]},'edited':{'type':Sequelize[_0x4992('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4992('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5cb4=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x2f8809,_0x167daf){var _0x561ef3=function(_0x472be4){while(--_0x472be4){_0x2f8809['push'](_0x2f8809['shift']());}};_0x561ef3(++_0x167daf);}(_0x5cb4,0x135));var _0x45cb=function(_0x17c466,_0x292eca){_0x17c466=_0x17c466-0x0;var _0x37cefb=_0x5cb4[_0x17c466];return _0x37cefb;};'use strict';var Sequelize=require('sequelize');module[_0x45cb('0x0')]={'state':{'type':Sequelize[_0x45cb('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x45cb('0x2')]},'scheduledat':{'type':Sequelize[_0x45cb('0x3')]},'countbusyretry':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x45cb('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x45cb('0x2')]},'calleridnum':{'type':Sequelize[_0x45cb('0x2')]},'calleridname':{'type':Sequelize[_0x45cb('0x2')]},'starttime':{'type':Sequelize[_0x45cb('0x3')]},'responsetime':{'type':Sequelize[_0x45cb('0x3')]},'answertime':{'type':Sequelize[_0x45cb('0x3')]},'droptime':{'type':Sequelize[_0x45cb('0x3')]},'endtime':{'type':Sequelize[_0x45cb('0x3')]},'ringtime':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x45cb('0x2')]},'campaigntype':{'type':Sequelize[_0x45cb('0x2')]},'membername':{'type':Sequelize[_0x45cb('0x2')]},'reason':{'type':Sequelize[_0x45cb('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x45cb('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x45cb('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 210eb8e..7ce36bc 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 _0x4d2d=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','VIRTUAL','options','CmHopperHistory','includeAll','rows','params','keys','include','find','catch','create','body','describe','uniqueid','zip-dir','fast-json-patch'];(function(_0x565f4e,_0x150803){var _0x4d80fe=function(_0x4c8808){while(--_0x4c8808){_0x565f4e['push'](_0x565f4e['shift']());}};_0x4d80fe(++_0x150803);}(_0x4d2d,0xdf));var _0xd4d2=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x4d2d[_0x5678b5];return _0x4c09a5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4d2('0x0'));var jsonpatch=require(_0xd4d2('0x1'));var rp=require(_0xd4d2('0x2'));var moment=require('moment');var BPromise=require(_0xd4d2('0x3'));var Mustache=require(_0xd4d2('0x4'));var util=require(_0xd4d2('0x5'));var path=require(_0xd4d2('0x6'));var sox=require(_0xd4d2('0x7'));var csv=require(_0xd4d2('0x8'));var ejs=require(_0xd4d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd4d2('0xa'));var _=require(_0xd4d2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4d2('0xc'));var deskjs=require(_0xd4d2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd4d2('0xe'));var Redis=require(_0xd4d2('0xf'));var authService=require(_0xd4d2('0x10'));var qs=require(_0xd4d2('0x11'));var as=require(_0xd4d2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4d2('0x13'))('api');var utils=require(_0xd4d2('0x14'));var config=require(_0xd4d2('0x15'));var licenseUtil=require(_0xd4d2('0x16'));var db=require(_0xd4d2('0x17'))['db'];function respondWithStatusCode(_0x1ab403,_0x175591){_0x175591=_0x175591||0xcc;return function(_0x5a49fe){if(_0x5a49fe){return _0x1ab403['sendStatus'](_0x175591);}return _0x1ab403[_0xd4d2('0x18')](_0x175591)[_0xd4d2('0x19')]();};}function respondWithResult(_0x5393a0,_0xe218c5){_0xe218c5=_0xe218c5||0xc8;return function(_0x5552ed){if(_0x5552ed){return _0x5393a0[_0xd4d2('0x18')](_0xe218c5)[_0xd4d2('0x1a')](_0x5552ed);}};}function respondWithFilteredResult(_0x2df2fc,_0x3e152d){return function(_0x1ab7f8){if(_0x1ab7f8){var _0x3076f4=typeof _0x3e152d['offset']===_0xd4d2('0x1b')&&typeof _0x3e152d[_0xd4d2('0x1c')]==='undefined';var _0x3b2669=_0x1ab7f8[_0xd4d2('0x1d')];var _0x214f36=_0x3076f4?0x0:_0x3e152d['offset'];var _0x4aac5a=_0x3076f4?_0x1ab7f8[_0xd4d2('0x1d')]:_0x3e152d['offset']+_0x3e152d['limit'];var _0x2b17b8;if(_0x4aac5a>=_0x3b2669){_0x4aac5a=_0x3b2669;_0x2b17b8=0xc8;}else{_0x2b17b8=0xce;}_0x2df2fc[_0xd4d2('0x18')](_0x2b17b8);return _0x2df2fc[_0xd4d2('0x1e')](_0xd4d2('0x1f'),_0x214f36+'-'+_0x4aac5a+'/'+_0x3b2669)['json'](_0x1ab7f8);}return null;};}function patchUpdates(_0x194941){return function(_0x35ed23){try{jsonpatch[_0xd4d2('0x20')](_0x35ed23,_0x194941,!![]);}catch(_0x39cca0){return BPromise[_0xd4d2('0x21')](_0x39cca0);}return _0x35ed23['save']();};}function saveUpdates(_0x5d45f3,_0x534431){return function(_0x5f15b6){if(_0x5f15b6){return _0x5f15b6[_0xd4d2('0x22')](_0x5d45f3)['then'](function(_0x24fce6){return _0x24fce6;});}return null;};}function removeEntity(_0x546b84,_0x143deb){return function(_0xaa7506){if(_0xaa7506){return _0xaa7506[_0xd4d2('0x23')]()[_0xd4d2('0x24')](function(){_0x546b84[_0xd4d2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39cd10,_0x599ac3){return function(_0x15b396){if(!_0x15b396){_0x39cd10[_0xd4d2('0x25')](0x194);}return _0x15b396;};}function handleError(_0x26bf05,_0x382253){_0x382253=_0x382253||0x1f4;return function(_0x4f8709){logger[_0xd4d2('0x26')](_0x4f8709[_0xd4d2('0x27')]);if(_0x4f8709[_0xd4d2('0x28')]){delete _0x4f8709['name'];}_0x26bf05[_0xd4d2('0x18')](_0x382253)['send'](_0x4f8709);};}exports['index']=function(_0x429508,_0x4cae2b){var _0x220a82={},_0x1f5e86={},_0x39f2da={'count':0x0,'rows':[]};var _0x14e2a4=_['map'](db['CmHopperHistory'][_0xd4d2('0x29')],function(_0x187691){return{'name':_0x187691[_0xd4d2('0x2a')],'type':_0x187691[_0xd4d2('0x2b')][_0xd4d2('0x2c')]};});_0x1f5e86[_0xd4d2('0x2d')]=_[_0xd4d2('0x2e')](_0x14e2a4,_0xd4d2('0x28'));_0x1f5e86[_0xd4d2('0x2f')]=_['keys'](_0x429508[_0xd4d2('0x2f')]);_0x1f5e86[_0xd4d2('0x30')]=_[_0xd4d2('0x31')](_0x1f5e86[_0xd4d2('0x2d')],_0x1f5e86[_0xd4d2('0x2f')]);_0x220a82[_0xd4d2('0x32')]=_[_0xd4d2('0x31')](_0x1f5e86[_0xd4d2('0x2d')],qs[_0xd4d2('0x33')](_0x429508['query'][_0xd4d2('0x33')]));_0x220a82[_0xd4d2('0x32')]=_0x220a82[_0xd4d2('0x32')][_0xd4d2('0x34')]?_0x220a82[_0xd4d2('0x32')]:_0x1f5e86['model'];if(!_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x35')](_0xd4d2('0x36'))){_0x220a82[_0xd4d2('0x1c')]=qs[_0xd4d2('0x1c')](_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x1c')]);_0x220a82[_0xd4d2('0x37')]=qs['offset'](_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x37')]);}_0x220a82[_0xd4d2('0x38')]=qs[_0xd4d2('0x39')](_0x429508[_0xd4d2('0x2f')]['sort']);_0x220a82['where']=qs[_0xd4d2('0x30')](_['pick'](_0x429508[_0xd4d2('0x2f')],_0x1f5e86[_0xd4d2('0x30')]),_0x14e2a4);if(_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x3a')]){_0x220a82[_0xd4d2('0x3b')]=_[_0xd4d2('0x3c')](_0x220a82[_0xd4d2('0x3b')],{'$or':_['map'](_0x14e2a4,function(_0x2f447f){if(_0x2f447f['type']!==_0xd4d2('0x3d')){var _0x2e75e2={};_0x2e75e2[_0x2f447f[_0xd4d2('0x28')]]={'$like':'%'+_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x3a')]+'%'};return _0x2e75e2;}})});}_0x220a82=_[_0xd4d2('0x3c')]({},_0x220a82,_0x429508[_0xd4d2('0x3e')]);var _0x3e6148={'where':_0x220a82[_0xd4d2('0x3b')]};return db[_0xd4d2('0x3f')][_0xd4d2('0x1d')](_0x3e6148)[_0xd4d2('0x24')](function(_0x13cf4a){_0x39f2da[_0xd4d2('0x1d')]=_0x13cf4a;if(_0x429508[_0xd4d2('0x2f')][_0xd4d2('0x40')]){_0x220a82['include']=[{'all':!![]}];}return db[_0xd4d2('0x3f')]['findAll'](_0x220a82);})[_0xd4d2('0x24')](function(_0x3b29a0){_0x39f2da[_0xd4d2('0x41')]=_0x3b29a0;return _0x39f2da;})[_0xd4d2('0x24')](respondWithFilteredResult(_0x4cae2b,_0x220a82))['catch'](handleError(_0x4cae2b,null));};exports['show']=function(_0x207d5e,_0x557b5f){var _0x3647f8={'raw':!![],'where':{'id':_0x207d5e[_0xd4d2('0x42')]['id']}},_0x16ae89={};_0x16ae89['model']=_[_0xd4d2('0x43')](db['CmHopperHistory'][_0xd4d2('0x29')]);_0x16ae89[_0xd4d2('0x2f')]=_['keys'](_0x207d5e['query']);_0x16ae89[_0xd4d2('0x30')]=_[_0xd4d2('0x31')](_0x16ae89[_0xd4d2('0x2d')],_0x16ae89[_0xd4d2('0x2f')]);_0x3647f8['attributes']=_['intersection'](_0x16ae89[_0xd4d2('0x2d')],qs[_0xd4d2('0x33')](_0x207d5e['query']['fields']));_0x3647f8[_0xd4d2('0x32')]=_0x3647f8[_0xd4d2('0x32')][_0xd4d2('0x34')]?_0x3647f8[_0xd4d2('0x32')]:_0x16ae89[_0xd4d2('0x2d')];if(_0x207d5e[_0xd4d2('0x2f')][_0xd4d2('0x40')]){_0x3647f8[_0xd4d2('0x44')]=[{'all':!![]}];}_0x3647f8=_['merge']({},_0x3647f8,_0x207d5e[_0xd4d2('0x3e')]);return db['CmHopperHistory'][_0xd4d2('0x45')](_0x3647f8)[_0xd4d2('0x24')](handleEntityNotFound(_0x557b5f,null))['then'](respondWithResult(_0x557b5f,null))[_0xd4d2('0x46')](handleError(_0x557b5f,null));};exports[_0xd4d2('0x47')]=function(_0x396e99,_0x4c4b82){return db[_0xd4d2('0x3f')][_0xd4d2('0x47')](_0x396e99[_0xd4d2('0x48')],{})[_0xd4d2('0x24')](respondWithResult(_0x4c4b82,0xc9))[_0xd4d2('0x46')](handleError(_0x4c4b82,null));};exports['describe']=function(_0x3ee6bf,_0xf6e244){return db[_0xd4d2('0x3f')][_0xd4d2('0x49')]()['then'](respondWithResult(_0xf6e244,null))[_0xd4d2('0x46')](handleError(_0xf6e244,null));};exports['update']=function(_0x208876,_0x3a4544){if(_0x208876[_0xd4d2('0x48')][_0xd4d2('0x4a')]){delete _0x208876[_0xd4d2('0x48')][_0xd4d2('0x4a')];}return db[_0xd4d2('0x3f')][_0xd4d2('0x45')]({'where':{'uniqueid':_0x208876[_0xd4d2('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a4544,null))[_0xd4d2('0x24')](saveUpdates(_0x208876[_0xd4d2('0x48')],null))[_0xd4d2('0x24')](respondWithResult(_0x3a4544,null))['catch'](handleError(_0x3a4544,null));}; \ No newline at end of file +var _0xff47=['limit','count','set','save','update','destroy','then','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','create','describe','catch','body','uniqueid','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0xff47,0xc4));var _0x7ff4=function(_0xa6df52,_0x1b8584){_0xa6df52=_0xa6df52-0x0;var _0x5edd57=_0xff47[_0xa6df52];return _0x5edd57;};'use strict';var emlformat=require(_0x7ff4('0x0'));var rimraf=require(_0x7ff4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ff4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7ff4('0x3'));var Mustache=require(_0x7ff4('0x4'));var util=require(_0x7ff4('0x5'));var path=require(_0x7ff4('0x6'));var sox=require(_0x7ff4('0x7'));var csv=require(_0x7ff4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ff4('0x9'));var _=require('lodash');var squel=require(_0x7ff4('0xa'));var crypto=require(_0x7ff4('0xb'));var jsforce=require(_0x7ff4('0xc'));var deskjs=require(_0x7ff4('0xd'));var toCsv=require(_0x7ff4('0x8'));var querystring=require(_0x7ff4('0xe'));var Papa=require(_0x7ff4('0xf'));var Redis=require(_0x7ff4('0x10'));var authService=require(_0x7ff4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ff4('0x12'));var hardwareService=require(_0x7ff4('0x13'));var logger=require(_0x7ff4('0x14'))(_0x7ff4('0x15'));var utils=require(_0x7ff4('0x16'));var config=require(_0x7ff4('0x17'));var licenseUtil=require(_0x7ff4('0x18'));var db=require(_0x7ff4('0x19'))['db'];function respondWithStatusCode(_0x389d59,_0x5b464b){_0x5b464b=_0x5b464b||0xcc;return function(_0x15211a){if(_0x15211a){return _0x389d59[_0x7ff4('0x1a')](_0x5b464b);}return _0x389d59[_0x7ff4('0x1b')](_0x5b464b)[_0x7ff4('0x1c')]();};}function respondWithResult(_0x2d1a87,_0x7187b5){_0x7187b5=_0x7187b5||0xc8;return function(_0x45919b){if(_0x45919b){return _0x2d1a87[_0x7ff4('0x1b')](_0x7187b5)[_0x7ff4('0x1d')](_0x45919b);}};}function respondWithFilteredResult(_0xd93465,_0x14333b){return function(_0x41b615){if(_0x41b615){var _0x16bac8=typeof _0x14333b[_0x7ff4('0x1e')]===_0x7ff4('0x1f')&&typeof _0x14333b[_0x7ff4('0x20')]===_0x7ff4('0x1f');var _0x257a38=_0x41b615[_0x7ff4('0x21')];var _0x4c5478=_0x16bac8?0x0:_0x14333b['offset'];var _0x704de6=_0x16bac8?_0x41b615['count']:_0x14333b[_0x7ff4('0x1e')]+_0x14333b[_0x7ff4('0x20')];var _0x12f1e1;if(_0x704de6>=_0x257a38){_0x704de6=_0x257a38;_0x12f1e1=0xc8;}else{_0x12f1e1=0xce;}_0xd93465['status'](_0x12f1e1);return _0xd93465[_0x7ff4('0x22')]('Content-Range',_0x4c5478+'-'+_0x704de6+'/'+_0x257a38)[_0x7ff4('0x1d')](_0x41b615);}return null;};}function patchUpdates(_0x282586){return function(_0x7fb9e7){try{jsonpatch['apply'](_0x7fb9e7,_0x282586,!![]);}catch(_0x26cd82){return BPromise['reject'](_0x26cd82);}return _0x7fb9e7[_0x7ff4('0x23')]();};}function saveUpdates(_0x2041af,_0x373413){return function(_0x40d1ea){if(_0x40d1ea){return _0x40d1ea[_0x7ff4('0x24')](_0x2041af)['then'](function(_0x5ad849){return _0x5ad849;});}return null;};}function removeEntity(_0xbedc0a,_0x1f4ba3){return function(_0xa81be5){if(_0xa81be5){return _0xa81be5[_0x7ff4('0x25')]()[_0x7ff4('0x26')](function(){_0xbedc0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdea712,_0x102121){return function(_0x20aba7){if(!_0x20aba7){_0xdea712[_0x7ff4('0x1a')](0x194);}return _0x20aba7;};}function handleError(_0x5231ff,_0x474901){_0x474901=_0x474901||0x1f4;return function(_0x5a0055){logger[_0x7ff4('0x27')](_0x5a0055['stack']);if(_0x5a0055[_0x7ff4('0x28')]){delete _0x5a0055[_0x7ff4('0x28')];}_0x5231ff[_0x7ff4('0x1b')](_0x474901)[_0x7ff4('0x29')](_0x5a0055);};}exports[_0x7ff4('0x2a')]=function(_0x6de555,_0x212987){var _0x2248e5={},_0x58d175={},_0x273f10={'count':0x0,'rows':[]};var _0x45ff07=_[_0x7ff4('0x2b')](db[_0x7ff4('0x2c')][_0x7ff4('0x2d')],function(_0x2b6867){return{'name':_0x2b6867[_0x7ff4('0x2e')],'type':_0x2b6867['type'][_0x7ff4('0x2f')]};});_0x58d175[_0x7ff4('0x30')]=_[_0x7ff4('0x2b')](_0x45ff07,_0x7ff4('0x28'));_0x58d175[_0x7ff4('0x31')]=_[_0x7ff4('0x32')](_0x6de555[_0x7ff4('0x31')]);_0x58d175[_0x7ff4('0x33')]=_[_0x7ff4('0x34')](_0x58d175[_0x7ff4('0x30')],_0x58d175['query']);_0x2248e5['attributes']=_[_0x7ff4('0x34')](_0x58d175[_0x7ff4('0x30')],qs[_0x7ff4('0x35')](_0x6de555[_0x7ff4('0x31')]['fields']));_0x2248e5[_0x7ff4('0x36')]=_0x2248e5[_0x7ff4('0x36')][_0x7ff4('0x37')]?_0x2248e5[_0x7ff4('0x36')]:_0x58d175['model'];if(!_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x38')](_0x7ff4('0x39'))){_0x2248e5[_0x7ff4('0x20')]=qs[_0x7ff4('0x20')](_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x20')]);_0x2248e5['offset']=qs['offset'](_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x1e')]);}_0x2248e5[_0x7ff4('0x3a')]=qs[_0x7ff4('0x3b')](_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x3b')]);_0x2248e5[_0x7ff4('0x3c')]=qs[_0x7ff4('0x33')](_[_0x7ff4('0x3d')](_0x6de555['query'],_0x58d175[_0x7ff4('0x33')]),_0x45ff07);if(_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x3e')]){_0x2248e5[_0x7ff4('0x3c')]=_[_0x7ff4('0x3f')](_0x2248e5[_0x7ff4('0x3c')],{'$or':_['map'](_0x45ff07,function(_0x37bd3f){if(_0x37bd3f['type']!==_0x7ff4('0x40')){var _0x30cf92={};_0x30cf92[_0x37bd3f[_0x7ff4('0x28')]]={'$like':'%'+_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x3e')]+'%'};return _0x30cf92;}})});}_0x2248e5=_[_0x7ff4('0x3f')]({},_0x2248e5,_0x6de555['options']);var _0x4c6e67={'where':_0x2248e5[_0x7ff4('0x3c')]};return db['CmHopperHistory']['count'](_0x4c6e67)[_0x7ff4('0x26')](function(_0x847bc9){_0x273f10[_0x7ff4('0x21')]=_0x847bc9;if(_0x6de555[_0x7ff4('0x31')][_0x7ff4('0x41')]){_0x2248e5[_0x7ff4('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7ff4('0x43')](_0x2248e5);})['then'](function(_0x1dabd8){_0x273f10[_0x7ff4('0x44')]=_0x1dabd8;return _0x273f10;})[_0x7ff4('0x26')](respondWithFilteredResult(_0x212987,_0x2248e5))['catch'](handleError(_0x212987,null));};exports['show']=function(_0x1f7f20,_0x389e3f){var _0x2596c1={'raw':!![],'where':{'id':_0x1f7f20[_0x7ff4('0x45')]['id']}},_0x3d907d={};_0x3d907d['model']=_[_0x7ff4('0x32')](db['CmHopperHistory'][_0x7ff4('0x2d')]);_0x3d907d[_0x7ff4('0x31')]=_[_0x7ff4('0x32')](_0x1f7f20[_0x7ff4('0x31')]);_0x3d907d[_0x7ff4('0x33')]=_['intersection'](_0x3d907d[_0x7ff4('0x30')],_0x3d907d[_0x7ff4('0x31')]);_0x2596c1[_0x7ff4('0x36')]=_[_0x7ff4('0x34')](_0x3d907d[_0x7ff4('0x30')],qs['fields'](_0x1f7f20['query'][_0x7ff4('0x35')]));_0x2596c1['attributes']=_0x2596c1[_0x7ff4('0x36')]['length']?_0x2596c1['attributes']:_0x3d907d['model'];if(_0x1f7f20[_0x7ff4('0x31')][_0x7ff4('0x41')]){_0x2596c1[_0x7ff4('0x42')]=[{'all':!![]}];}_0x2596c1=_['merge']({},_0x2596c1,_0x1f7f20[_0x7ff4('0x46')]);return db['CmHopperHistory']['find'](_0x2596c1)[_0x7ff4('0x26')](handleEntityNotFound(_0x389e3f,null))[_0x7ff4('0x26')](respondWithResult(_0x389e3f,null))['catch'](handleError(_0x389e3f,null));};exports[_0x7ff4('0x47')]=function(_0x35bed1,_0x58b9aa){return db['CmHopperHistory'][_0x7ff4('0x47')](_0x35bed1['body'],{})[_0x7ff4('0x26')](respondWithResult(_0x58b9aa,0xc9))['catch'](handleError(_0x58b9aa,null));};exports['describe']=function(_0x4f4db4,_0x23a8a0){return db[_0x7ff4('0x2c')][_0x7ff4('0x48')]()['then'](respondWithResult(_0x23a8a0,null))[_0x7ff4('0x49')](handleError(_0x23a8a0,null));};exports['update']=function(_0x28ab2a,_0xc24324){if(_0x28ab2a[_0x7ff4('0x4a')][_0x7ff4('0x4b')]){delete _0x28ab2a['body'][_0x7ff4('0x4b')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x28ab2a[_0x7ff4('0x45')]['id']}})['then'](handleEntityNotFound(_0xc24324,null))['then'](saveUpdates(_0x28ab2a['body'],null))[_0x7ff4('0x26')](respondWithResult(_0xc24324,null))[_0x7ff4('0x49')](handleError(_0xc24324,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c58bea5..f5b31cd 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 _0xffc0=['request-promise','path','rimraf','../../config/environment','exports','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x758d9d,_0x15e098){_0x758d9d=_0x758d9d-0x0;var _0x50e8f0=_0xffc0[_0x758d9d];return _0x50e8f0;};'use strict';var _=require('lodash');var util=require(_0x0ffc('0x0'));var logger=require('../../config/logger')(_0x0ffc('0x1'));var moment=require(_0x0ffc('0x2'));var BPromise=require(_0x0ffc('0x3'));var rp=require(_0x0ffc('0x4'));var fs=require('fs');var path=require(_0x0ffc('0x5'));var rimraf=require(_0x0ffc('0x6'));var config=require(_0x0ffc('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x0ffc('0x8')]=function(_0x23d3e0,_0x426ce2){return _0x23d3e0['define']('CmHopperHistory',attributes,{'tableName':_0x0ffc('0x9'),'paranoid':![],'indexes':[{'name':_0x0ffc('0xa'),'fields':[_0x0ffc('0xa')]},{'name':_0x0ffc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x80c4=['api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x80c4,0xa3));var _0x480c=function(_0x57e45c,_0x20cc9f){_0x57e45c=_0x57e45c-0x0;var _0x3fb855=_0x80c4[_0x57e45c];return _0x3fb855;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var logger=require(_0x480c('0x1'))(_0x480c('0x2'));var moment=require(_0x480c('0x3'));var BPromise=require(_0x480c('0x4'));var rp=require(_0x480c('0x5'));var fs=require('fs');var path=require(_0x480c('0x6'));var rimraf=require('rimraf');var config=require(_0x480c('0x7'));var attributes=require(_0x480c('0x8'));module[_0x480c('0x9')]=function(_0x1813b6,_0x9805b5){return _0x1813b6[_0x480c('0xa')](_0x480c('0xb'),attributes,{'tableName':_0x480c('0xc'),'paranoid':![],'indexes':[{'name':_0x480c('0xd'),'fields':['endtime']},{'name':_0x480c('0xe'),'fields':[_0x480c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2901737..6bf85e5 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 _0xdf8f=['AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit'];(function(_0x2e9773,_0x59523e){var _0x22c85d=function(_0x3833aa){while(--_0x3833aa){_0x2e9773['push'](_0x2e9773['shift']());}};_0x22c85d(++_0x59523e);}(_0xdf8f,0x1ca));var _0xfdf8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf8f[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xfdf8('0x0'));var util=require(_0xfdf8('0x1'));var moment=require('moment');var BPromise=require(_0xfdf8('0x2'));var rs=require(_0xfdf8('0x3'));var fs=require('fs');var Redis=require(_0xfdf8('0x4'));var db=require(_0xfdf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdf8('0x6'))('rpc');var config=require(_0xfdf8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfdf8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0b61,_0x50d1d8,_0x3cb99b){return new BPromise(function(_0x3df7f5,_0x2e75ef){return client[_0xfdf8('0x9')](_0x1a0b61,_0x3cb99b)[_0xfdf8('0xa')](function(_0x4aa274){logger['info'](_0xfdf8('0xb'),_0x50d1d8,_0xfdf8('0xc'));logger[_0xfdf8('0xd')](_0xfdf8('0xe'),_0x50d1d8,_0xfdf8('0xc'),JSON[_0xfdf8('0xf')](_0x4aa274));if(_0x4aa274[_0xfdf8('0x10')]){if(_0x4aa274[_0xfdf8('0x10')][_0xfdf8('0x11')]===0x1f4){logger[_0xfdf8('0x10')](_0xfdf8('0xb'),_0x50d1d8,_0x4aa274[_0xfdf8('0x10')][_0xfdf8('0x12')]);return _0x2e75ef(_0x4aa274[_0xfdf8('0x10')][_0xfdf8('0x12')]);}logger[_0xfdf8('0x10')](_0xfdf8('0xb'),_0x50d1d8,_0x4aa274['error']['message']);return _0x3df7f5(_0x4aa274[_0xfdf8('0x10')][_0xfdf8('0x12')]);}else{logger[_0xfdf8('0x13')](_0xfdf8('0xb'),_0x50d1d8,_0xfdf8('0xc'));_0x3df7f5(_0x4aa274[_0xfdf8('0x14')][_0xfdf8('0x12')]);}})[_0xfdf8('0x15')](function(_0x302672){logger[_0xfdf8('0x10')](_0xfdf8('0xb'),_0x50d1d8,_0x302672);_0x2e75ef(_0x302672);});});}exports[_0xfdf8('0x16')]=function(_0xcc1daf){var _0x248955=this;return new Promise(function(_0x51a409,_0x4455b2){return db[_0xfdf8('0x17')][_0xfdf8('0x18')](_0xcc1daf[_0xfdf8('0x19')],{'raw':_0xcc1daf[_0xfdf8('0x1a')]?_0xcc1daf[_0xfdf8('0x1a')][_0xfdf8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4cbf8f){logger[_0xfdf8('0x13')](_0xfdf8('0x16'),_0xcc1daf);logger[_0xfdf8('0xd')](_0xfdf8('0x16'),_0xcc1daf,JSON[_0xfdf8('0xf')](_0x4cbf8f));_0x51a409(_0x4cbf8f);})[_0xfdf8('0x15')](function(_0x7460b2){logger[_0xfdf8('0x10')](_0xfdf8('0x16'),_0x7460b2[_0xfdf8('0x12')],_0xcc1daf);_0x4455b2(_0x248955[_0xfdf8('0x10')](0x1f4,_0x7460b2['message']));});});};exports[_0xfdf8('0x1c')]=function(_0x10bb2e){var _0x3f3960=this;return new Promise(function(_0x2886c5,_0x38ae52){return db[_0xfdf8('0x17')][_0xfdf8('0x1d')]({'raw':_0x10bb2e[_0xfdf8('0x1a')]?_0x10bb2e[_0xfdf8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x10bb2e[_0xfdf8('0x1a')]?_0x10bb2e['options'][_0xfdf8('0x1e')]||null:null,'attributes':[[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')][_0xfdf8('0x21')]('id')),_0xfdf8('0x22')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x24')))),'predictiveIntervalAnsweredCalls'],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0xfdf8('0x26')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x27'),db[_0xfdf8('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xfdf8('0x28')))),_0xfdf8('0x29')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x27'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x2a')))),_0xfdf8('0x2b')]]})[_0xfdf8('0xa')](function(_0x33d752){logger[_0xfdf8('0x13')](_0xfdf8('0x1c'),_0x10bb2e);logger['debug'](_0xfdf8('0x1c'),_0x10bb2e,JSON[_0xfdf8('0xf')](_0x33d752));_0x2886c5(_0x33d752);})[_0xfdf8('0x15')](function(_0x396780){logger[_0xfdf8('0x10')](_0xfdf8('0x1c'),_0x396780[_0xfdf8('0x12')],_0x10bb2e);_0x38ae52(_0x3f3960[_0xfdf8('0x10')](0x1f4,_0x396780[_0xfdf8('0x12')]));});});};exports[_0xfdf8('0x2c')]=function(_0x1485e8){var _0x31727e=this;return new Promise(function(_0x38fba5,_0x1acd04){return db[_0xfdf8('0x17')][_0xfdf8('0x1d')]({'raw':_0x1485e8['options']?_0x1485e8['options'][_0xfdf8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1485e8[_0xfdf8('0x1a')]?_0x1485e8['options'][_0xfdf8('0x1e')]||null:null,'attributes':[[_0xfdf8('0x2d'),'name'],[db[_0xfdf8('0x1f')]['fn']('COUNT',db[_0xfdf8('0x1f')]['fn']('IF',db['sequelize'][_0xfdf8('0x23')](_0xfdf8('0x2e')))),_0xfdf8('0x2f')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x30')))),_0xfdf8('0x31')],[db['sequelize']['fn']('COUNT',db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x24')))),_0xfdf8('0x32')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x33')))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x34')))),_0xfdf8('0x35')],[db['sequelize']['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xfdf8('0x23')](_0xfdf8('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xfdf8('0x1f')]['fn']('COUNT',db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')]['literal'](_0xfdf8('0x37')))),_0xfdf8('0x38')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x39')))),_0xfdf8('0x3a')],[db[_0xfdf8('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x3b')))),_0xfdf8('0x3c')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x3d')))),_0xfdf8('0x3e')],[db['sequelize']['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x3f')))),_0xfdf8('0x40')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db['sequelize']['fn']('IF',db[_0xfdf8('0x1f')][_0xfdf8('0x23')](_0xfdf8('0x41')))),_0xfdf8('0x3e')],[db['sequelize']['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')]['literal'](_0xfdf8('0x42')))),_0xfdf8('0x43')]],'group':['campaign']})['then'](function(_0x1b5c9b){logger[_0xfdf8('0x13')](_0xfdf8('0x2c'),_0x1485e8);logger[_0xfdf8('0xd')](_0xfdf8('0x2c'),_0x1485e8,JSON[_0xfdf8('0xf')](_0x1b5c9b));_0x38fba5(_0x1b5c9b);})[_0xfdf8('0x15')](function(_0x3ee674){logger[_0xfdf8('0x10')](_0xfdf8('0x2c'),_0x3ee674[_0xfdf8('0x12')],_0x1485e8);_0x1acd04(_0x31727e[_0xfdf8('0x10')](0x1f4,_0x3ee674[_0xfdf8('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x31c3b8){var _0x46e6e6=this;return new Promise(function(_0x436609,_0x278cf1){return db[_0xfdf8('0x17')][_0xfdf8('0x1d')]({'raw':_0x31c3b8[_0xfdf8('0x1a')]?_0x31c3b8[_0xfdf8('0x1a')][_0xfdf8('0x1b')]===undefined?!![]:![]:!![],'where':_0x31c3b8[_0xfdf8('0x1a')]?_0x31c3b8[_0xfdf8('0x1a')]['where']||null:null,'attributes':[[_0xfdf8('0x2d'),_0xfdf8('0x44')],[db[_0xfdf8('0x1f')]['fn']('COUNT',db[_0xfdf8('0x1f')]['col']('id')),_0xfdf8('0x45')],[db[_0xfdf8('0x1f')]['fn'](_0xfdf8('0x20'),db[_0xfdf8('0x1f')]['fn']('IF',db[_0xfdf8('0x1f')]['literal'](_0xfdf8('0x24')))),'ivrAnswerCallsDay']],'group':[_0xfdf8('0x2d')]})[_0xfdf8('0xa')](function(_0x144246){logger['info']('GetCampaignHopperHistory',_0x31c3b8);logger[_0xfdf8('0xd')]('GetCampaignHopperHistory',_0x31c3b8,JSON[_0xfdf8('0xf')](_0x144246));_0x436609(_0x144246);})['catch'](function(_0x536b45){logger[_0xfdf8('0x10')](_0xfdf8('0x46'),_0x536b45[_0xfdf8('0x12')],_0x31c3b8);_0x278cf1(_0x46e6e6[_0xfdf8('0x10')](0x1f4,_0x536b45[_0xfdf8('0x12')]));});});}; \ No newline at end of file +var _0x6a24=['http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','info','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`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','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0x6a24,0xd1));var _0x46a2=function(_0x139cec,_0x12f759){_0x139cec=_0x139cec-0x0;var _0x4bef9f=_0x6a24[_0x139cec];return _0x4bef9f;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}exports[_0x46a2('0x15')]=function(_0x577f18){var _0x27250b=this;return new Promise(function(_0x24f75f,_0x529bb5){return db[_0x46a2('0x16')][_0x46a2('0x17')](_0x577f18[_0x46a2('0x18')],{'raw':_0x577f18[_0x46a2('0x19')]?_0x577f18[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![]})[_0x46a2('0x1b')](function(_0x202294){logger[_0x46a2('0x1c')](_0x46a2('0x15'),_0x577f18);logger[_0x46a2('0xe')](_0x46a2('0x15'),_0x577f18,JSON[_0x46a2('0x10')](_0x202294));_0x24f75f(_0x202294);})['catch'](function(_0xa37d90){logger['error'](_0x46a2('0x15'),_0xa37d90[_0x46a2('0x12')],_0x577f18);_0x529bb5(_0x27250b['error'](0x1f4,_0xa37d90[_0x46a2('0x12')]));});});};exports[_0x46a2('0x1d')]=function(_0x233c4e){var _0x3cc187=this;return new Promise(function(_0x4d50f5,_0x197230){return db[_0x46a2('0x16')][_0x46a2('0x1e')]({'raw':_0x233c4e[_0x46a2('0x19')]?_0x233c4e[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x233c4e[_0x46a2('0x19')]?_0x233c4e[_0x46a2('0x19')][_0x46a2('0x1f')]||null:null,'attributes':[[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db['sequelize'][_0x46a2('0x22')]('id')),_0x46a2('0x23')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')]['literal'](_0x46a2('0x24')))),_0x46a2('0x25')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')]('`state`\x20=\x2010,\x201,\x20null'))),_0x46a2('0x27')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x28')))),_0x46a2('0x29')],[db[_0x46a2('0x20')]['fn']('AVG',db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x2a')))),_0x46a2('0x2b')],[db['sequelize']['fn']('AVG',db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x2c')))),_0x46a2('0x2d')]]})[_0x46a2('0x1b')](function(_0x504195){logger['info'](_0x46a2('0x1d'),_0x233c4e);logger['debug'](_0x46a2('0x1d'),_0x233c4e,JSON[_0x46a2('0x10')](_0x504195));_0x4d50f5(_0x504195);})[_0x46a2('0x14')](function(_0x96b6f0){logger['error'](_0x46a2('0x1d'),_0x96b6f0[_0x46a2('0x12')],_0x233c4e);_0x197230(_0x3cc187[_0x46a2('0x11')](0x1f4,_0x96b6f0[_0x46a2('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x30d533){var _0x3f7d3f=this;return new Promise(function(_0x244c4b,_0x1cff82){return db['CmHopperHistory'][_0x46a2('0x1e')]({'raw':_0x30d533['options']?_0x30d533[_0x46a2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x30d533[_0x46a2('0x19')]?_0x30d533[_0x46a2('0x19')]['where']||null:null,'attributes':[[_0x46a2('0x2e'),'name'],[db['sequelize']['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x2f')))),_0x46a2('0x30')],[db['sequelize']['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x31')))),_0x46a2('0x32')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')]['literal'](_0x46a2('0x24')))),_0x46a2('0x33')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db['sequelize']['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x34')))),_0x46a2('0x35')],[db[_0x46a2('0x20')]['fn']('COUNT',db[_0x46a2('0x20')]['fn']('IF',db['sequelize'][_0x46a2('0x26')](_0x46a2('0x36')))),'outboundCongestionCallsDay'],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x37')))),_0x46a2('0x38')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db['sequelize'][_0x46a2('0x26')](_0x46a2('0x39')))),_0x46a2('0x3a')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db['sequelize']['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x3b')))),_0x46a2('0x3c')],[db[_0x46a2('0x20')]['fn']('COUNT',db[_0x46a2('0x20')]['fn']('IF',db['sequelize'][_0x46a2('0x26')](_0x46a2('0x3d')))),'outboundBlacklistCallsDay'],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x3e')))),_0x46a2('0x3f')],[db['sequelize']['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')]('`state`\x20=\x2018,\x201,\x20null'))),_0x46a2('0x40')],[db['sequelize']['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db['sequelize'][_0x46a2('0x26')]('`state`\x20=\x2016,\x201,\x20null'))),_0x46a2('0x41')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')]['fn']('IF',db[_0x46a2('0x20')][_0x46a2('0x26')](_0x46a2('0x42')))),_0x46a2('0x43')]],'group':['campaign']})[_0x46a2('0x1b')](function(_0x3665db){logger[_0x46a2('0x1c')](_0x46a2('0x44'),_0x30d533);logger[_0x46a2('0xe')](_0x46a2('0x44'),_0x30d533,JSON[_0x46a2('0x10')](_0x3665db));_0x244c4b(_0x3665db);})['catch'](function(_0x3ff55a){logger[_0x46a2('0x11')]('GetVoiceQueueHopperHistory',_0x3ff55a[_0x46a2('0x12')],_0x30d533);_0x1cff82(_0x3f7d3f[_0x46a2('0x11')](0x1f4,_0x3ff55a['message']));});});};exports[_0x46a2('0x45')]=function(_0x3b7f26){var _0x56bbc6=this;return new Promise(function(_0x537b0a,_0x23fb6a){return db['CmHopperHistory']['findAll']({'raw':_0x3b7f26['options']?_0x3b7f26['options'][_0x46a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b7f26['options']?_0x3b7f26['options'][_0x46a2('0x1f')]||null:null,'attributes':[[_0x46a2('0x2e'),_0x46a2('0x46')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db[_0x46a2('0x20')][_0x46a2('0x22')]('id')),_0x46a2('0x47')],[db[_0x46a2('0x20')]['fn'](_0x46a2('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x46a2('0x26')](_0x46a2('0x24')))),_0x46a2('0x48')]],'group':['campaign']})[_0x46a2('0x1b')](function(_0x58841d){logger[_0x46a2('0x1c')]('GetCampaignHopperHistory',_0x3b7f26);logger['debug'](_0x46a2('0x45'),_0x3b7f26,JSON['stringify'](_0x58841d));_0x537b0a(_0x58841d);})[_0x46a2('0x14')](function(_0x573776){logger[_0x46a2('0x11')]('GetCampaignHopperHistory',_0x573776[_0x46a2('0x12')],_0x3b7f26);_0x23fb6a(_0x56bbc6['error'](0x1f4,_0x573776[_0x46a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 938d160..175bbec 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 _0x7bdb=['isAuthenticated','index','get','describe','post','create','put','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller'];(function(_0x17fea6,_0x458f3d){var _0x34994e=function(_0x21308f){while(--_0x21308f){_0x17fea6['push'](_0x17fea6['shift']());}};_0x34994e(++_0x458f3d);}(_0x7bdb,0xe1));var _0xb7bd=function(_0x502285,_0x1b9c03){_0x502285=_0x502285-0x0;var _0xc4d4c2=_0x7bdb[_0x502285];return _0xc4d4c2;};'use strict';var multer=require('multer');var util=require(_0xb7bd('0x0'));var path=require(_0xb7bd('0x1'));var timeout=require(_0xb7bd('0x2'));var express=require(_0xb7bd('0x3'));var router=express[_0xb7bd('0x4')]();var fs_extra=require(_0xb7bd('0x5'));var auth=require(_0xb7bd('0x6'));var interaction=require(_0xb7bd('0x7'));var config=require('../../config/environment');var controller=require(_0xb7bd('0x8'));router['get']('/',auth[_0xb7bd('0x9')](),controller[_0xb7bd('0xa')]);router[_0xb7bd('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xb7bd('0xc')]);router[_0xb7bd('0xb')]('/:id',auth[_0xb7bd('0x9')](),controller['show']);router[_0xb7bd('0xd')]('/',auth[_0xb7bd('0x9')](),controller[_0xb7bd('0xe')]);router[_0xb7bd('0xf')](_0xb7bd('0x10'),auth[_0xb7bd('0x9')](),controller['update']);module[_0xb7bd('0x11')]=router; \ No newline at end of file +var _0x1e90=['describe','show','post','create','put','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x1aba96,_0x3565e8){var _0x311f29=function(_0x35c986){while(--_0x35c986){_0x1aba96['push'](_0x1aba96['shift']());}};_0x311f29(++_0x3565e8);}(_0x1e90,0x166));var _0x01e9=function(_0x403962,_0x365a7c){_0x403962=_0x403962-0x0;var _0x442c6e=_0x1e90[_0x403962];return _0x442c6e;};'use strict';var multer=require(_0x01e9('0x0'));var util=require(_0x01e9('0x1'));var path=require('path');var timeout=require(_0x01e9('0x2'));var express=require(_0x01e9('0x3'));var router=express[_0x01e9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x01e9('0x5'));var config=require(_0x01e9('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x01e9('0x7')]('/',auth[_0x01e9('0x8')](),controller['index']);router['get'](_0x01e9('0x9'),auth['isAuthenticated'](),controller[_0x01e9('0xa')]);router['get']('/:id',auth[_0x01e9('0x8')](),controller[_0x01e9('0xb')]);router[_0x01e9('0xc')]('/',auth[_0x01e9('0x8')](),controller[_0x01e9('0xd')]);router[_0x01e9('0xe')]('/:id',auth[_0x01e9('0x8')](),controller['update']);module[_0x01e9('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index fa46cf7..37f5276 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 _0x23d3=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x23d3,0xe8));var _0x323d=function(_0xf35484,_0x66e0ce){_0xf35484=_0xf35484-0x0;var _0x5cbfc5=_0x23d3[_0xf35484];return _0x5cbfc5;};'use strict';var Sequelize=require(_0x323d('0x0'));module[_0x323d('0x1')]={'name':{'type':Sequelize[_0x323d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x323d('0x2')]},'dialPrefix':{'type':Sequelize[_0x323d('0x2')]}}; \ No newline at end of file +var _0x1da1=['sequelize','exports','STRING','name'];(function(_0x2a36f1,_0x825453){var _0x5eb91b=function(_0x5eeaea){while(--_0x5eeaea){_0x2a36f1['push'](_0x2a36f1['shift']());}};_0x5eb91b(++_0x825453);}(_0x1da1,0x1a4));var _0x11da=function(_0x5d491f,_0x1daca1){_0x5d491f=_0x5d491f-0x0;var _0x6159e9=_0x1da1[_0x5d491f];return _0x6159e9;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'name':{'type':Sequelize[_0x11da('0x2')],'unique':_0x11da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x11da('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d18d7c6..3373245 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 _0x702e=['socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','apply','reject','update','then','destroy','get','end','error','name','send','index','CmList','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','where','rows','removeDispositions','ids','addContacts','CmContact','tags','push','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','format','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost'];(function(_0x4df63f,_0x32b841){var _0x422931=function(_0x59b3e5){while(--_0x59b3e5){_0x4df63f['push'](_0x4df63f['shift']());}};_0x422931(++_0x32b841);}(_0x702e,0x19a));var _0xe702=function(_0x48cc77,_0x22b6fd){_0x48cc77=_0x48cc77-0x0;var _0x34654e=_0x702e[_0x48cc77];return _0x34654e;};'use strict';var emlformat=require(_0xe702('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe702('0x1'));var jsonpatch=require(_0xe702('0x2'));var rp=require(_0xe702('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe702('0x4'));var util=require(_0xe702('0x5'));var path=require('path');var sox=require(_0xe702('0x6'));var csv=require(_0xe702('0x7'));var ejs=require(_0xe702('0x8'));var fs=require('fs');var fs_extra=require(_0xe702('0x9'));var _=require(_0xe702('0xa'));var squel=require(_0xe702('0xb'));var crypto=require('crypto');var jsforce=require(_0xe702('0xc'));var deskjs=require(_0xe702('0xd'));var toCsv=require(_0xe702('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe702('0xe'));var authService=require(_0xe702('0xf'));var qs=require(_0xe702('0x10'));var as=require(_0xe702('0x11'));var hardwareService=require(_0xe702('0x12'));var logger=require('../../config/logger')(_0xe702('0x13'));var utils=require(_0xe702('0x14'));var config=require(_0xe702('0x15'));var licenseUtil=require(_0xe702('0x16'));var db=require('../../mysqldb')['db'];config[_0xe702('0x17')]=_['defaults'](config[_0xe702('0x17')],{'host':_0xe702('0x18'),'port':0x18eb});var socket=require(_0xe702('0x19'))(new Redis(config[_0xe702('0x17')]));require(_0xe702('0x1a'))[_0xe702('0x1b')](socket);function respondWithStatusCode(_0xa0f5ef,_0x384f90){_0x384f90=_0x384f90||0xcc;return function(_0x383067){if(_0x383067){return _0xa0f5ef[_0xe702('0x1c')](_0x384f90);}return _0xa0f5ef[_0xe702('0x1d')](_0x384f90)['end']();};}function respondWithResult(_0x5d5ab7,_0x1149c8){_0x1149c8=_0x1149c8||0xc8;return function(_0x426d2e){if(_0x426d2e){return _0x5d5ab7[_0xe702('0x1d')](_0x1149c8)[_0xe702('0x1e')](_0x426d2e);}};}function respondWithFilteredResult(_0x4cd385,_0x3eb68b){return function(_0xdcbb18){if(_0xdcbb18){var _0x1d0c93=typeof _0x3eb68b[_0xe702('0x1f')]===_0xe702('0x20')&&typeof _0x3eb68b['limit']==='undefined';var _0x52dd1a=_0xdcbb18[_0xe702('0x21')];var _0x560ad9=_0x1d0c93?0x0:_0x3eb68b[_0xe702('0x1f')];var _0x498c1e=_0x1d0c93?_0xdcbb18[_0xe702('0x21')]:_0x3eb68b['offset']+_0x3eb68b['limit'];var _0x322286;if(_0x498c1e>=_0x52dd1a){_0x498c1e=_0x52dd1a;_0x322286=0xc8;}else{_0x322286=0xce;}_0x4cd385[_0xe702('0x1d')](_0x322286);return _0x4cd385['set']('Content-Range',_0x560ad9+'-'+_0x498c1e+'/'+_0x52dd1a)[_0xe702('0x1e')](_0xdcbb18);}return null;};}function patchUpdates(_0x131b38){return function(_0x379842){try{jsonpatch[_0xe702('0x22')](_0x379842,_0x131b38,!![]);}catch(_0x10ade0){return BPromise[_0xe702('0x23')](_0x10ade0);}return _0x379842['save']();};}function saveUpdates(_0xd97aba,_0x2fa008){return function(_0x3f37a9){if(_0x3f37a9){return _0x3f37a9[_0xe702('0x24')](_0xd97aba)[_0xe702('0x25')](function(_0xdd6ed1){return _0xdd6ed1;});}return null;};}function removeEntity(_0x18f5e3,_0x1bb3fe){return function(_0x45a88a){if(_0x45a88a){return _0x45a88a[_0xe702('0x26')]()[_0xe702('0x25')](function(){var _0x299cac=_0x45a88a[_0xe702('0x27')]({'plain':!![]});var _0x5dfd5d='Lists';return db['UserProfileResource'][_0xe702('0x26')]({'where':{'type':_0x5dfd5d,'resourceId':_0x299cac['id']}})[_0xe702('0x25')](function(){return _0x45a88a;});})[_0xe702('0x25')](function(){_0x18f5e3[_0xe702('0x1d')](0xcc)[_0xe702('0x28')]();});}};}function handleEntityNotFound(_0x326caa,_0x1c36b0){return function(_0x3ca07d){if(!_0x3ca07d){_0x326caa[_0xe702('0x1c')](0x194);}return _0x3ca07d;};}function handleError(_0x3f7d0c,_0x2e1f04){_0x2e1f04=_0x2e1f04||0x1f4;return function(_0x1701b8){logger[_0xe702('0x29')](_0x1701b8['stack']);if(_0x1701b8[_0xe702('0x2a')]){delete _0x1701b8[_0xe702('0x2a')];}_0x3f7d0c['status'](_0x2e1f04)[_0xe702('0x2b')](_0x1701b8);};}exports[_0xe702('0x2c')]=function(_0x13fb86,_0x386570){var _0xc9f3ef={},_0x289784={},_0x4efb11={'count':0x0,'rows':[]};var _0x3668c8=_['map'](db[_0xe702('0x2d')][_0xe702('0x2e')],function(_0x8048d6){return{'name':_0x8048d6[_0xe702('0x2f')],'type':_0x8048d6[_0xe702('0x30')]['key']};});_0x289784[_0xe702('0x31')]=_[_0xe702('0x32')](_0x3668c8,'name');_0x289784[_0xe702('0x33')]=_[_0xe702('0x34')](_0x13fb86['query']);_0x289784[_0xe702('0x35')]=_['intersection'](_0x289784[_0xe702('0x31')],_0x289784[_0xe702('0x33')]);_0xc9f3ef['attributes']=_[_0xe702('0x36')](_0x289784['model'],qs[_0xe702('0x37')](_0x13fb86[_0xe702('0x33')][_0xe702('0x37')]));_0xc9f3ef[_0xe702('0x38')]=_0xc9f3ef[_0xe702('0x38')][_0xe702('0x39')]?_0xc9f3ef[_0xe702('0x38')]:_0x289784[_0xe702('0x31')];if(!_0x13fb86['query'][_0xe702('0x3a')](_0xe702('0x3b'))){_0xc9f3ef[_0xe702('0x3c')]=qs[_0xe702('0x3c')](_0x13fb86[_0xe702('0x33')][_0xe702('0x3c')]);_0xc9f3ef[_0xe702('0x1f')]=qs[_0xe702('0x1f')](_0x13fb86[_0xe702('0x33')][_0xe702('0x1f')]);}_0xc9f3ef[_0xe702('0x3d')]=qs[_0xe702('0x3e')](_0x13fb86[_0xe702('0x33')]['sort']);_0xc9f3ef['where']=qs[_0xe702('0x35')](_[_0xe702('0x3f')](_0x13fb86['query'],_0x289784[_0xe702('0x35')]),_0x3668c8);if(_0x13fb86[_0xe702('0x33')][_0xe702('0x40')]){_0xc9f3ef['where']=_[_0xe702('0x41')](_0xc9f3ef['where'],{'$or':_['map'](_0x3668c8,function(_0x140064){if(_0x140064['type']!==_0xe702('0x42')){var _0x101469={};_0x101469[_0x140064[_0xe702('0x2a')]]={'$like':'%'+_0x13fb86[_0xe702('0x33')][_0xe702('0x40')]+'%'};return _0x101469;}})});}_0xc9f3ef=_['merge']({},_0xc9f3ef,_0x13fb86[_0xe702('0x43')]);var _0x50ccc9={'where':_0xc9f3ef['where']};return db[_0xe702('0x2d')]['count'](_0x50ccc9)[_0xe702('0x25')](function(_0x532190){_0x4efb11[_0xe702('0x21')]=_0x532190;if(_0x13fb86[_0xe702('0x33')][_0xe702('0x44')]){_0xc9f3ef[_0xe702('0x45')]=[{'all':!![]}];}return db[_0xe702('0x2d')][_0xe702('0x46')](_0xc9f3ef);})[_0xe702('0x25')](function(_0x2dbf83){_0x4efb11['rows']=_0x2dbf83;return _0x4efb11;})[_0xe702('0x25')](respondWithFilteredResult(_0x386570,_0xc9f3ef))[_0xe702('0x47')](handleError(_0x386570,null));};exports['show']=function(_0x315c08,_0x38f4f0){var _0x42ee0f={'raw':![],'where':{'id':_0x315c08[_0xe702('0x48')]['id']}},_0x5a52fa={};_0x5a52fa[_0xe702('0x31')]=_['keys'](db[_0xe702('0x2d')]['rawAttributes']);_0x5a52fa[_0xe702('0x33')]=_[_0xe702('0x34')](_0x315c08[_0xe702('0x33')]);_0x5a52fa[_0xe702('0x35')]=_[_0xe702('0x36')](_0x5a52fa[_0xe702('0x31')],_0x5a52fa[_0xe702('0x33')]);_0x42ee0f[_0xe702('0x38')]=_[_0xe702('0x36')](_0x5a52fa[_0xe702('0x31')],qs['fields'](_0x315c08['query'][_0xe702('0x37')]));_0x42ee0f['attributes']=_0x42ee0f[_0xe702('0x38')][_0xe702('0x39')]?_0x42ee0f[_0xe702('0x38')]:_0x5a52fa[_0xe702('0x31')];if(_0x315c08['query'][_0xe702('0x44')]){_0x42ee0f[_0xe702('0x45')]=[{'all':!![]}];}_0x42ee0f=_['merge']({},_0x42ee0f,_0x315c08[_0xe702('0x43')]);return db[_0xe702('0x2d')][_0xe702('0x49')](_0x42ee0f)[_0xe702('0x25')](handleEntityNotFound(_0x38f4f0,null))[_0xe702('0x25')](respondWithResult(_0x38f4f0,null))['catch'](handleError(_0x38f4f0,null));};exports['create']=function(_0x477acf,_0x4c7764){return db[_0xe702('0x2d')][_0xe702('0x4a')](_0x477acf['body'],{})[_0xe702('0x25')](function(_0x3c601c){var _0x520b07=_0x477acf[_0xe702('0x4b')][_0xe702('0x27')]({'plain':!![]});if(!_0x520b07)throw new Error(_0xe702('0x4c'));if(_0x520b07[_0xe702('0x4d')]==='user'){var _0x3aebaa=_0x3c601c[_0xe702('0x27')]({'plain':!![]});var _0x194bda='Lists';return db[_0xe702('0x4e')]['find']({'where':{'name':_0x194bda,'userProfileId':_0x520b07['userProfileId']},'raw':!![]})[_0xe702('0x25')](function(_0x3842cc){if(_0x3842cc&&_0x3842cc[_0xe702('0x4f')]===0x0){return db[_0xe702('0x50')][_0xe702('0x4a')]({'name':_0x3aebaa[_0xe702('0x2a')],'resourceId':_0x3aebaa['id'],'type':_0x3842cc[_0xe702('0x2a')],'sectionId':_0x3842cc['id']},{})['then'](function(){return _0x3c601c;});}else{return _0x3c601c;}})[_0xe702('0x47')](function(_0x19a8e0){logger[_0xe702('0x29')](_0xe702('0x51'),_0x19a8e0);throw _0x19a8e0;});}return _0x3c601c;})['then'](respondWithResult(_0x4c7764,0xc9))[_0xe702('0x47')](handleError(_0x4c7764,null));};exports[_0xe702('0x24')]=function(_0x4d618d,_0x1a4eee){if(_0x4d618d['body']['id']){delete _0x4d618d['body']['id'];}return db['CmList'][_0xe702('0x49')]({'where':{'id':_0x4d618d[_0xe702('0x48')]['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x1a4eee,null))[_0xe702('0x25')](saveUpdates(_0x4d618d[_0xe702('0x52')],null))[_0xe702('0x25')](respondWithResult(_0x1a4eee,null))[_0xe702('0x47')](handleError(_0x1a4eee,null));};exports[_0xe702('0x26')]=function(_0xc44ed8,_0x1bbb04){return db['CmList'][_0xe702('0x49')]({'where':{'id':_0xc44ed8[_0xe702('0x48')]['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x1bbb04,null))[_0xe702('0x25')](removeEntity(_0x1bbb04,null))['catch'](handleError(_0x1bbb04,null));};exports[_0xe702('0x53')]=function(_0x471245,_0x1cd04c){return db['CmList'][_0xe702('0x53')]()[_0xe702('0x25')](respondWithResult(_0x1cd04c,null))['catch'](handleError(_0x1cd04c,null));};exports[_0xe702('0x54')]=function(_0x57324c,_0x30c0c3,_0xf349a6){if(_0x57324c['body']['id']){delete _0x57324c[_0xe702('0x52')]['id'];}return db['CmList'][_0xe702('0x49')]({'where':{'id':_0x57324c['params']['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x30c0c3,null))[_0xe702('0x25')](function(_0xe55d72){if(_0xe55d72){_0x57324c['body'][_0xe702('0x55')]=_0xe55d72['id'];return db[_0xe702('0x56')]['create'](_0x57324c[_0xe702('0x52')]);}})[_0xe702('0x25')](respondWithResult(_0x30c0c3,null))[_0xe702('0x47')](handleError(_0x30c0c3,null));};exports[_0xe702('0x57')]=function(_0x2963b7,_0x51f34e,_0x433a26){var _0x281f0b={'raw':![],'where':{}};var _0x1f3643={};var _0x5e600a={'count':0x0,'rows':[]};return db[_0xe702('0x2d')][_0xe702('0x58')]({'where':{'id':_0x2963b7[_0xe702('0x48')]['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x51f34e,null))['then'](function(_0x508565){if(_0x508565){_0x1f3643[_0xe702('0x31')]=_[_0xe702('0x34')](db[_0xe702('0x56')][_0xe702('0x2e')]);_0x1f3643[_0xe702('0x33')]=_[_0xe702('0x34')](_0x2963b7[_0xe702('0x33')]);_0x1f3643['filters']=_[_0xe702('0x36')](_0x1f3643['model'],_0x1f3643['query']);_0x281f0b[_0xe702('0x38')]=_[_0xe702('0x36')](_0x1f3643[_0xe702('0x31')],qs[_0xe702('0x37')](_0x2963b7[_0xe702('0x33')][_0xe702('0x37')]));_0x281f0b['attributes']=_0x281f0b[_0xe702('0x38')][_0xe702('0x39')]?_0x281f0b[_0xe702('0x38')]:_0x1f3643[_0xe702('0x31')];if(!_0x2963b7['query'][_0xe702('0x3a')]('nolimit')){_0x281f0b['limit']=qs[_0xe702('0x3c')](_0x2963b7[_0xe702('0x33')]['limit']);_0x281f0b[_0xe702('0x1f')]=qs[_0xe702('0x1f')](_0x2963b7['query'][_0xe702('0x1f')]);}_0x281f0b[_0xe702('0x3d')]=qs[_0xe702('0x3e')](_0x2963b7[_0xe702('0x33')][_0xe702('0x3e')]);_0x281f0b[_0xe702('0x59')]=qs[_0xe702('0x35')](_[_0xe702('0x3f')](_0x2963b7[_0xe702('0x33')],_0x1f3643[_0xe702('0x35')]));_0x281f0b[_0xe702('0x59')][_0xe702('0x55')]=_0x508565['id'];if(_0x2963b7[_0xe702('0x33')]['filter']){_0x281f0b[_0xe702('0x59')]=_[_0xe702('0x41')](_0x281f0b[_0xe702('0x59')],{'$or':_['map'](_0x281f0b[_0xe702('0x38')],function(_0x1f77ba){var _0x14b6ef={};_0x14b6ef[_0x1f77ba]={'$like':'%'+_0x2963b7[_0xe702('0x33')][_0xe702('0x40')]+'%'};return _0x14b6ef;})});}_0x281f0b=_[_0xe702('0x41')]({},_0x281f0b,_0x2963b7[_0xe702('0x43')]);return db[_0xe702('0x56')][_0xe702('0x21')]({'where':_0x281f0b['where']})['then'](function(_0x51d6d0){_0x5e600a[_0xe702('0x21')]=_0x51d6d0;if(_0x2963b7[_0xe702('0x33')][_0xe702('0x44')]){_0x281f0b[_0xe702('0x45')]=[{'all':!![]}];}return db[_0xe702('0x56')][_0xe702('0x46')](_0x281f0b);})[_0xe702('0x25')](function(_0x15c373){_0x5e600a[_0xe702('0x5a')]=_0x15c373;return _0x5e600a;});}})[_0xe702('0x25')](respondWithFilteredResult(_0x51f34e,_0x281f0b))[_0xe702('0x47')](handleError(_0x51f34e,null));};exports['removeDispositions']=function(_0x48be01,_0x4292cf,_0x5bfee0){return db['CmList']['find']({'where':{'id':_0x48be01[_0xe702('0x48')]['id']}})['then'](handleEntityNotFound(_0x4292cf,null))[_0xe702('0x25')](function(_0x26acfa){if(_0x26acfa){return _0x26acfa[_0xe702('0x5b')](_0x48be01[_0xe702('0x33')][_0xe702('0x5c')]);}})['then'](respondWithStatusCode(_0x4292cf,null))[_0xe702('0x47')](handleError(_0x4292cf,null));};exports[_0xe702('0x5d')]=function(_0x5c3e69,_0x3ff20b,_0x56b5a2){return db[_0xe702('0x2d')][_0xe702('0x49')]({'where':{'id':_0x5c3e69[_0xe702('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ff20b,null))[_0xe702('0x25')](function(_0x1cce9f){if(_0x1cce9f){var _0x154549=[];var _0x1ccebc={'success':[],'errors':[]};return db[_0xe702('0x5e')][_0xe702('0x53')]()['then'](function(_0x5c0142){if(_0x5c3e69[_0xe702('0x52')][_0xe702('0x5f')]&&_['isArray'](_0x5c3e69[_0xe702('0x52')][_0xe702('0x5f')])){if(_0x5c3e69['body'][_0xe702('0x5f')][_0xe702('0x39')]){_0x5c3e69[_0xe702('0x52')][_0xe702('0x5f')]=_0x5c3e69[_0xe702('0x52')][_0xe702('0x5f')]['join'](';')+';';}else{_0x5c3e69['body'][_0xe702('0x5f')]=null;}}else{_0x5c3e69[_0xe702('0x52')][_0xe702('0x5f')]=null;}if(_0x5c3e69[_0xe702('0x52')]&&_['isArray'](_0x5c3e69[_0xe702('0x52')])){for(var _0x4369f7=0x0;_0x4369f7<_0x5c3e69[_0xe702('0x52')][_0xe702('0x39')];_0x4369f7+=0x1){_0x5c3e69[_0xe702('0x52')][_0x4369f7]['ListId']=_0x5c3e69[_0xe702('0x48')]['id'];_0x154549[_0xe702('0x60')](_0x5c3e69[_0xe702('0x52')][_0x4369f7]);}return BPromise['each'](_0x154549,function(_0x27ab9b){return db['CmContact']['create'](_[_0xe702('0x61')](_0x27ab9b,['ids','id'])||{},{'fields':_[_0xe702('0x34')](_0x5c0142),'raw':!![]})['then'](function(_0x4922d6){_0x1ccebc['success'][_0xe702('0x60')](_0x4922d6[_0xe702('0x62')]);})[_0xe702('0x47')](function(_0x5ef487){_0x1ccebc[_0xe702('0x63')]['push']({'data':_0x27ab9b,'error':_0x5ef487[_0xe702('0x64')]});});})[_0xe702('0x25')](function(_0x18198f){return _0x1ccebc;})[_0xe702('0x47')](function(_0x18e172){return _0x18e172;});}else{_0x3ff20b[_0xe702('0x1d')](0x190)[_0xe702('0x1e')]({'message':_0xe702('0x65')});}});}})[_0xe702('0x25')](respondWithResult(_0x3ff20b,null))[_0xe702('0x47')](handleError(_0x3ff20b,null));};exports[_0xe702('0x66')]=function(_0x509f77,_0x371a02,_0x571c85){var _0x2b872a;return db[_0xe702('0x2d')][_0xe702('0x49')]({'where':{'id':_0x509f77[_0xe702('0x48')]['id']},'include':[{'model':db[_0xe702('0x67')],'as':'CustomFields'}]})[_0xe702('0x25')](handleEntityNotFound(_0x371a02,null))['then'](function(_0x10b3f9){if(_0x10b3f9){_0x2b872a=_0x10b3f9;return db[_0xe702('0x5e')][_0xe702('0x2e')];}})[_0xe702('0x25')](function(_0x29b1ab){if(_0x29b1ab){var _0x315ec7={};var _0x2b2707={};_0x2b2707[_0xe702('0x31')]=_['concat'](_['keys'](_0x29b1ab),_[_0xe702('0x32')](_0x2b872a[_0xe702('0x68')],function(_0x3c2b39){return util['format'](_0xe702('0x69'),_0x3c2b39['id']);}));_0x2b2707[_0xe702('0x33')]=_[_0xe702('0x34')](_0x509f77['query']);_0x2b2707['filters']=_[_0xe702('0x36')](_0x2b2707[_0xe702('0x31')],_0x2b2707[_0xe702('0x33')]);_0x315ec7['attributes']=_[_0xe702('0x36')](_0x2b2707[_0xe702('0x31')],qs[_0xe702('0x37')](_0x509f77['query'][_0xe702('0x37')]));_0x315ec7[_0xe702('0x38')]=_0x315ec7[_0xe702('0x38')][_0xe702('0x39')]?_0x315ec7[_0xe702('0x38')]:_0x2b2707[_0xe702('0x31')];if(!_0x509f77[_0xe702('0x33')][_0xe702('0x3a')](_0xe702('0x3b'))){_0x315ec7[_0xe702('0x3c')]=qs[_0xe702('0x3c')](_0x509f77[_0xe702('0x33')][_0xe702('0x3c')]);_0x315ec7[_0xe702('0x1f')]=qs[_0xe702('0x1f')](_0x509f77[_0xe702('0x33')]['offset']);}_0x315ec7['order']=qs[_0xe702('0x3e')](_0x509f77[_0xe702('0x33')]['sort']);_0x315ec7['where']=qs['filters'](_[_0xe702('0x3f')](_0x509f77[_0xe702('0x33')],_0x2b2707['filters']));_0x315ec7[_0xe702('0x6a')]=!![];if(_0x509f77[_0xe702('0x33')][_0xe702('0x40')]){_0x315ec7[_0xe702('0x59')]=_[_0xe702('0x41')](_0x315ec7[_0xe702('0x59')],{'$or':_[_0xe702('0x32')](_0x315ec7['attributes'],function(_0x357b78){var _0x4b62e={};_0x4b62e[_0x357b78]={'$like':'%'+_0x509f77[_0xe702('0x33')][_0xe702('0x40')]+'%'};return _0x4b62e;})});}_0x315ec7=_['merge']({},_0x315ec7,_0x509f77[_0xe702('0x43')]);return _0x2b872a['getContacts'](_0x315ec7);}})[_0xe702('0x25')](respondWithResult(_0x371a02,null))[_0xe702('0x47')](handleError(_0x371a02,null));};exports[_0xe702('0x6b')]=function(_0x577c73,_0x49fc4c,_0x2b1507){var _0x27ef36;return db['CmList']['find']({'where':{'id':_0x577c73['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xe702('0x25')](handleEntityNotFound(_0x49fc4c,null))[_0xe702('0x25')](function(_0x4c6876){if(_0x4c6876){_0x27ef36=_0x4c6876;return db[_0xe702('0x5e')][_0xe702('0x2e')];}})[_0xe702('0x25')](function(_0x5a8437){if(_0x5a8437){var _0x28980d={};var _0x4cd985={};_0x4cd985[_0xe702('0x31')]=_['concat'](_['keys'](_0x5a8437),_[_0xe702('0x32')](_0x27ef36[_0xe702('0x68')],function(_0x591ae4){return util[_0xe702('0x6c')]('cf_%d',_0x591ae4['id']);}));_0x4cd985[_0xe702('0x33')]=_[_0xe702('0x34')](_0x577c73['query']);_0x4cd985[_0xe702('0x35')]=_[_0xe702('0x36')](_0x4cd985[_0xe702('0x31')],_0x4cd985[_0xe702('0x33')]);_0x28980d['attributes']=_[_0xe702('0x36')](_0x4cd985[_0xe702('0x31')],qs['fields'](_0x577c73[_0xe702('0x33')][_0xe702('0x37')]));_0x28980d[_0xe702('0x38')]=_0x28980d[_0xe702('0x38')]['length']?_0x28980d[_0xe702('0x38')]:_0x4cd985['model'];if(!_0x577c73[_0xe702('0x33')][_0xe702('0x3a')](_0xe702('0x3b'))){_0x28980d[_0xe702('0x3c')]=qs[_0xe702('0x3c')](_0x577c73[_0xe702('0x33')][_0xe702('0x3c')]);_0x28980d[_0xe702('0x1f')]=qs[_0xe702('0x1f')](_0x577c73['query'][_0xe702('0x1f')]);}_0x28980d[_0xe702('0x3d')]=qs[_0xe702('0x3e')](_0x577c73[_0xe702('0x33')][_0xe702('0x3e')]);_0x28980d[_0xe702('0x59')]=qs[_0xe702('0x35')](_[_0xe702('0x3f')](_0x577c73[_0xe702('0x33')],_0x4cd985['filters']));_0x28980d[_0xe702('0x6a')]=!![];if(_0x577c73['query']['filter']){_0x28980d[_0xe702('0x59')]=_[_0xe702('0x41')](_0x28980d[_0xe702('0x59')],{'$or':_[_0xe702('0x32')](_0x28980d[_0xe702('0x38')],function(_0xb6fe82){var _0x1bf412={};_0x1bf412[_0xb6fe82]={'$like':'%'+_0x577c73[_0xe702('0x33')][_0xe702('0x40')]+'%'};return _0x1bf412;})});}_0x28980d=_['merge']({},_0x28980d,_0x577c73[_0xe702('0x43')]);return _0x27ef36[_0xe702('0x66')](_0x28980d);}})[_0xe702('0x25')](function(_0x1c36b7){if(!_['isEmpty'](_0x1c36b7)){var _0x2561d7=toCsv(_0x1c36b7);var _0x13bc55=Date[_0xe702('0x6d')]();fs[_0xe702('0x6e')](util[_0xe702('0x6c')](_0xe702('0x6f'),_0x27ef36['id'],_0x13bc55),_0x2561d7);_0x49fc4c[_0xe702('0x70')](_0xe702('0x71'),_0xe702('0x72')+util[_0xe702('0x6c')](_0xe702('0x73'),_0x27ef36['id'],_0x13bc55));_0x49fc4c['setHeader'](_0xe702('0x74'),_0xe702('0x75'));return _0x49fc4c[_0xe702('0x76')](util['format'](_0xe702('0x6f'),_0x27ef36['id'],_0x13bc55));}else{return _0x49fc4c[_0xe702('0x1c')](0xcc);}})[_0xe702('0x47')](handleError(_0x49fc4c,null));};exports[_0xe702('0x77')]=function(_0x501bea,_0x4261da,_0x35e7dd){var _0x5dd2ee;delete _0x501bea['body']['id'];return db[_0xe702('0x2d')][_0xe702('0x58')]({'where':{'id':_0x501bea['params']['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x4261da,null))[_0xe702('0x25')](function(_0x387eda){if(_0x387eda){return db[_0xe702('0x78')][_0xe702('0x79')](function(_0x3cc2b1){return db[_0xe702('0x67')][_0xe702('0x4a')](_0x501bea[_0xe702('0x52')],{'transaction':_0x3cc2b1})[_0xe702('0x25')](function(_0x3d7220){_0x5dd2ee=_0x3d7220;return _0x387eda[_0xe702('0x7a')](_0x3d7220,{'transaction':_0x3cc2b1});})[_0xe702('0x25')](function(){var _0x323c63={'type':db[_0xe702('0x7b')][_0xe702('0x7c')],'transaction':_0x3cc2b1};switch(_0x501bea[_0xe702('0x52')][_0xe702('0x30')]){case _0xe702('0x7d'):_0x323c63['type']=db[_0xe702('0x7b')][_0xe702('0x7c')];break;case _0xe702('0x7e'):_0x323c63[_0xe702('0x30')]=db['Sequelize'][_0xe702('0x7f')];break;case _0xe702('0x80'):_0x323c63['type']=db[_0xe702('0x7b')][_0xe702('0x81')];_0x323c63[_0xe702('0x82')]=![];break;default:}return db['sequelize'][_0xe702('0x83')]['addColumn'](_0xe702('0x84'),util['format'](_0xe702('0x85'),_0x5dd2ee['id']),_0x323c63);})[_0xe702('0x25')](function(){return _0x5dd2ee;});});}})[_0xe702('0x25')](respondWithResult(_0x4261da,null))[_0xe702('0x47')](handleError(_0x4261da,null));};exports[_0xe702('0x86')]=function(_0x2cd24f,_0x51d51b,_0x223f4f){var _0x27e57e={};var _0x437b78={};var _0x220fa4;var _0x2cef91;return db['CmList'][_0xe702('0x58')]({'where':{'id':_0x2cd24f[_0xe702('0x48')]['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x51d51b,null))[_0xe702('0x25')](function(_0x38f2e4){if(_0x38f2e4){_0x220fa4=_0x38f2e4;_0x437b78[_0xe702('0x31')]=_[_0xe702('0x34')](db['CmCustomField']['rawAttributes']);_0x437b78[_0xe702('0x33')]=_[_0xe702('0x34')](_0x2cd24f[_0xe702('0x33')]);_0x437b78[_0xe702('0x35')]=_['intersection'](_0x437b78[_0xe702('0x31')],_0x437b78[_0xe702('0x33')]);_0x27e57e[_0xe702('0x38')]=_[_0xe702('0x36')](_0x437b78[_0xe702('0x31')],qs[_0xe702('0x37')](_0x2cd24f['query']['fields']));_0x27e57e[_0xe702('0x38')]=_0x27e57e[_0xe702('0x38')]['length']?_0x27e57e[_0xe702('0x38')]:_0x437b78[_0xe702('0x31')];_0x27e57e['order']=qs[_0xe702('0x3e')](_0x2cd24f[_0xe702('0x33')][_0xe702('0x3e')]);_0x27e57e[_0xe702('0x59')]=qs[_0xe702('0x35')](_[_0xe702('0x3f')](_0x2cd24f[_0xe702('0x33')],_0x437b78[_0xe702('0x35')]));_0x27e57e[_0xe702('0x59')]=_[_0xe702('0x41')](_0x27e57e['where'],{'$or':[{'ListId':_0x38f2e4['id']},{'ListId':null}]});if(_0x2cd24f['query'][_0xe702('0x40')]){_0x27e57e[_0xe702('0x59')]=_[_0xe702('0x41')](_0x27e57e[_0xe702('0x59')],{'$or':_[_0xe702('0x32')](_0x27e57e[_0xe702('0x38')],function(_0x2029b9){var _0x17a9fd={};_0x17a9fd[_0x2029b9]={'$like':'%'+_0x2cd24f[_0xe702('0x33')][_0xe702('0x40')]+'%'};return _0x17a9fd;})});}_0x27e57e=_[_0xe702('0x41')]({},_0x27e57e,_0x2cd24f[_0xe702('0x43')]);return db[_0xe702('0x67')][_0xe702('0x87')](_0x27e57e);}})[_0xe702('0x25')](respondWithResult(_0x51d51b,null))[_0xe702('0x47')](handleError(_0x51d51b,null));};exports[_0xe702('0x88')]=function(_0x4274e5,_0x317a4d,_0x15f515){return db[_0xe702('0x2d')][_0xe702('0x49')]({'where':{'id':_0x4274e5[_0xe702('0x48')]['id']}})[_0xe702('0x25')](handleEntityNotFound(_0x317a4d,null))['then'](function(_0x38987d){if(_0x38987d){return _0x38987d[_0xe702('0x88')](_0x4274e5[_0xe702('0x52')][_0xe702('0x5c')],_[_0xe702('0x61')](_0x4274e5[_0xe702('0x52')],[_0xe702('0x5c'),'id'])||{})[_0xe702('0x89')](function(_0x2f3c88){for(var _0xef5fff=0x0;_0xef5fff<_0x4274e5[_0xe702('0x52')][_0xe702('0x5c')]['length'];_0xef5fff+=0x1){socket[_0xe702('0x8a')](_0xe702('0x8b'),{'UserId':Number(_0x4274e5[_0xe702('0x52')][_0xe702('0x5c')][_0xef5fff]),'CmListId':Number(_0x4274e5[_0xe702('0x48')]['id'])});}return _0x2f3c88;});}})['then'](respondWithResult(_0x317a4d,null))[_0xe702('0x47')](handleError(_0x317a4d,null));};exports['removeAgents']=function(_0x15e723,_0x489383,_0x20bc7a){return db['CmList'][_0xe702('0x49')]({'where':{'id':_0x15e723[_0xe702('0x48')]['id']}})['then'](handleEntityNotFound(_0x489383,null))[_0xe702('0x25')](function(_0x11aa13){if(_0x11aa13){return _0x11aa13[_0xe702('0x8c')](_0x15e723['query'][_0xe702('0x5c')])[_0xe702('0x25')](function(){if(_[_0xe702('0x8d')](_0x15e723[_0xe702('0x33')][_0xe702('0x5c')])){for(var _0x2ed1ad=0x0;_0x2ed1ad<_0x15e723[_0xe702('0x33')][_0xe702('0x5c')][_0xe702('0x39')];_0x2ed1ad+=0x1){socket[_0xe702('0x8a')](_0xe702('0x8e'),{'UserId':Number(_0x15e723[_0xe702('0x33')][_0xe702('0x5c')][_0x2ed1ad]),'CmListId':Number(_0x15e723[_0xe702('0x48')]['id'])});}}else{socket[_0xe702('0x8a')](_0xe702('0x8e'),{'UserId':Number(_0x15e723['query'][_0xe702('0x5c')]),'CmListId':Number(_0x15e723['params']['id'])});}});}})[_0xe702('0x25')](respondWithStatusCode(_0x489383,null))[_0xe702('0x47')](handleError(_0x489383,null));};exports[_0xe702('0x8f')]=function(_0x8a5e8f,_0x3bba58,_0x3fded0){var _0x4a5612={};var _0x1e6a7a={};var _0x18ae1d;var _0x94df1e;return db[_0xe702('0x2d')]['findOne']({'where':{'id':_0x8a5e8f['params']['id']}})['then'](handleEntityNotFound(_0x3bba58,null))['then'](function(_0x223932){if(_0x223932){_0x18ae1d=_0x223932;_0x1e6a7a[_0xe702('0x31')]=_[_0xe702('0x34')](db[_0xe702('0x90')][_0xe702('0x2e')]);_0x1e6a7a[_0xe702('0x33')]=_[_0xe702('0x34')](_0x8a5e8f[_0xe702('0x33')]);_0x1e6a7a['filters']=_['intersection'](_0x1e6a7a['model'],_0x1e6a7a[_0xe702('0x33')]);_0x4a5612[_0xe702('0x38')]=_[_0xe702('0x36')](_0x1e6a7a[_0xe702('0x31')],qs['fields'](_0x8a5e8f['query'][_0xe702('0x37')]));_0x4a5612['attributes']=_0x4a5612['attributes'][_0xe702('0x39')]?_0x4a5612[_0xe702('0x38')]:_0x1e6a7a[_0xe702('0x31')];_0x4a5612[_0xe702('0x3d')]=qs[_0xe702('0x3e')](_0x8a5e8f[_0xe702('0x33')]['sort']);_0x4a5612[_0xe702('0x59')]=qs[_0xe702('0x35')](_[_0xe702('0x3f')](_0x8a5e8f[_0xe702('0x33')],_0x1e6a7a[_0xe702('0x35')]));if(_0x8a5e8f['query']['filter']){_0x4a5612[_0xe702('0x59')]=_[_0xe702('0x41')](_0x4a5612['where'],{'$or':_['map'](_0x4a5612[_0xe702('0x38')],function(_0x105c69){var _0x547e72={};_0x547e72[_0x105c69]={'$like':'%'+_0x8a5e8f['query'][_0xe702('0x40')]+'%'};return _0x547e72;})});}_0x4a5612=_['merge']({},_0x4a5612,_0x8a5e8f[_0xe702('0x43')]);return _0x18ae1d[_0xe702('0x8f')](_0x4a5612);}})[_0xe702('0x25')](function(_0x5195bd){if(_0x5195bd){_0x94df1e=_0x5195bd[_0xe702('0x39')];if(!_0x8a5e8f[_0xe702('0x33')][_0xe702('0x3a')](_0xe702('0x3b'))){_0x4a5612[_0xe702('0x3c')]=qs['limit'](_0x8a5e8f['query'][_0xe702('0x3c')]);_0x4a5612[_0xe702('0x1f')]=qs[_0xe702('0x1f')](_0x8a5e8f[_0xe702('0x33')][_0xe702('0x1f')]);}return _0x18ae1d[_0xe702('0x8f')](_0x4a5612);}})[_0xe702('0x25')](function(_0x50281b){if(_0x50281b){return _0x50281b?{'count':_0x94df1e,'rows':_0x50281b}:null;}})[_0xe702('0x25')](respondWithResult(_0x3bba58,null))[_0xe702('0x47')](handleError(_0x3bba58,null));}; \ No newline at end of file +var _0x2ad9=['./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','then','destroy','get','Lists','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','CmList','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','findOne','hasOwnProperty','findAll','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','each','omit','success','push','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2ad9,0x74));var _0x92ad=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2ad9[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x92ad('0x0'));var jsonpatch=require(_0x92ad('0x1'));var rp=require(_0x92ad('0x2'));var moment=require(_0x92ad('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x92ad('0x4'));var path=require(_0x92ad('0x5'));var sox=require(_0x92ad('0x6'));var csv=require(_0x92ad('0x7'));var ejs=require(_0x92ad('0x8'));var fs=require('fs');var fs_extra=require(_0x92ad('0x9'));var _=require(_0x92ad('0xa'));var squel=require(_0x92ad('0xb'));var crypto=require(_0x92ad('0xc'));var jsforce=require(_0x92ad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x92ad('0x7'));var querystring=require(_0x92ad('0xe'));var Papa=require(_0x92ad('0xf'));var Redis=require(_0x92ad('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x92ad('0x11'));var as=require(_0x92ad('0x12'));var hardwareService=require(_0x92ad('0x13'));var logger=require(_0x92ad('0x14'))(_0x92ad('0x15'));var utils=require(_0x92ad('0x16'));var config=require(_0x92ad('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x92ad('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x92ad('0x19'))(new Redis(config[_0x92ad('0x18')]));require(_0x92ad('0x1a'))[_0x92ad('0x1b')](socket);function respondWithStatusCode(_0x3df001,_0x196ca1){_0x196ca1=_0x196ca1||0xcc;return function(_0x3b76da){if(_0x3b76da){return _0x3df001[_0x92ad('0x1c')](_0x196ca1);}return _0x3df001[_0x92ad('0x1d')](_0x196ca1)[_0x92ad('0x1e')]();};}function respondWithResult(_0x5db96c,_0x4a8b8d){_0x4a8b8d=_0x4a8b8d||0xc8;return function(_0x62dca){if(_0x62dca){return _0x5db96c['status'](_0x4a8b8d)[_0x92ad('0x1f')](_0x62dca);}};}function respondWithFilteredResult(_0x5a313e,_0x230ecf){return function(_0x402d27){if(_0x402d27){var _0x4465b6=typeof _0x230ecf[_0x92ad('0x20')]===_0x92ad('0x21')&&typeof _0x230ecf['limit']===_0x92ad('0x21');var _0x40017c=_0x402d27['count'];var _0x5bdb25=_0x4465b6?0x0:_0x230ecf['offset'];var _0x2fd53b=_0x4465b6?_0x402d27[_0x92ad('0x22')]:_0x230ecf[_0x92ad('0x20')]+_0x230ecf['limit'];var _0x188d42;if(_0x2fd53b>=_0x40017c){_0x2fd53b=_0x40017c;_0x188d42=0xc8;}else{_0x188d42=0xce;}_0x5a313e[_0x92ad('0x1d')](_0x188d42);return _0x5a313e[_0x92ad('0x23')]('Content-Range',_0x5bdb25+'-'+_0x2fd53b+'/'+_0x40017c)[_0x92ad('0x1f')](_0x402d27);}return null;};}function patchUpdates(_0x30ca19){return function(_0x57fcbc){try{jsonpatch[_0x92ad('0x24')](_0x57fcbc,_0x30ca19,!![]);}catch(_0x2389cb){return BPromise[_0x92ad('0x25')](_0x2389cb);}return _0x57fcbc[_0x92ad('0x26')]();};}function saveUpdates(_0x3ca22d,_0x33c170){return function(_0x24e81f){if(_0x24e81f){return _0x24e81f['update'](_0x3ca22d)[_0x92ad('0x27')](function(_0x4c8475){return _0x4c8475;});}return null;};}function removeEntity(_0x4c8dc5,_0x4daaa6){return function(_0x349f39){if(_0x349f39){return _0x349f39[_0x92ad('0x28')]()['then'](function(){var _0x34194e=_0x349f39[_0x92ad('0x29')]({'plain':!![]});var _0x1864e3=_0x92ad('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1864e3,'resourceId':_0x34194e['id']}})['then'](function(){return _0x349f39;});})[_0x92ad('0x27')](function(){_0x4c8dc5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f216,_0x53edaa){return function(_0x5ae081){if(!_0x5ae081){_0x15f216[_0x92ad('0x1c')](0x194);}return _0x5ae081;};}function handleError(_0x5b94a5,_0x2b1056){_0x2b1056=_0x2b1056||0x1f4;return function(_0x45db03){logger[_0x92ad('0x2b')](_0x45db03[_0x92ad('0x2c')]);if(_0x45db03['name']){delete _0x45db03[_0x92ad('0x2d')];}_0x5b94a5[_0x92ad('0x1d')](_0x2b1056)[_0x92ad('0x2e')](_0x45db03);};}exports[_0x92ad('0x2f')]=function(_0xd3d5b3,_0x8a4232){var _0x138956={},_0x110fb6={},_0x5b66f1={'count':0x0,'rows':[]};var _0x5078c8=_['map'](db['CmList'][_0x92ad('0x30')],function(_0x1818a9){return{'name':_0x1818a9[_0x92ad('0x31')],'type':_0x1818a9[_0x92ad('0x32')][_0x92ad('0x33')]};});_0x110fb6['model']=_['map'](_0x5078c8,_0x92ad('0x2d'));_0x110fb6[_0x92ad('0x34')]=_[_0x92ad('0x35')](_0xd3d5b3['query']);_0x110fb6['filters']=_['intersection'](_0x110fb6[_0x92ad('0x36')],_0x110fb6['query']);_0x138956[_0x92ad('0x37')]=_[_0x92ad('0x38')](_0x110fb6[_0x92ad('0x36')],qs[_0x92ad('0x39')](_0xd3d5b3['query'][_0x92ad('0x39')]));_0x138956[_0x92ad('0x37')]=_0x138956[_0x92ad('0x37')][_0x92ad('0x3a')]?_0x138956['attributes']:_0x110fb6[_0x92ad('0x36')];if(!_0xd3d5b3['query']['hasOwnProperty'](_0x92ad('0x3b'))){_0x138956[_0x92ad('0x3c')]=qs[_0x92ad('0x3c')](_0xd3d5b3[_0x92ad('0x34')]['limit']);_0x138956[_0x92ad('0x20')]=qs[_0x92ad('0x20')](_0xd3d5b3[_0x92ad('0x34')][_0x92ad('0x20')]);}_0x138956[_0x92ad('0x3d')]=qs[_0x92ad('0x3e')](_0xd3d5b3['query'][_0x92ad('0x3e')]);_0x138956[_0x92ad('0x3f')]=qs['filters'](_[_0x92ad('0x40')](_0xd3d5b3['query'],_0x110fb6[_0x92ad('0x41')]),_0x5078c8);if(_0xd3d5b3[_0x92ad('0x34')][_0x92ad('0x42')]){_0x138956[_0x92ad('0x3f')]=_['merge'](_0x138956[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x5078c8,function(_0x1bb724){if(_0x1bb724[_0x92ad('0x32')]!==_0x92ad('0x44')){var _0x5901c7={};_0x5901c7[_0x1bb724['name']]={'$like':'%'+_0xd3d5b3['query'][_0x92ad('0x42')]+'%'};return _0x5901c7;}})});}_0x138956=_[_0x92ad('0x45')]({},_0x138956,_0xd3d5b3[_0x92ad('0x46')]);var _0x39c04f={'where':_0x138956[_0x92ad('0x3f')]};return db[_0x92ad('0x47')][_0x92ad('0x22')](_0x39c04f)[_0x92ad('0x27')](function(_0x28ac3c){_0x5b66f1[_0x92ad('0x22')]=_0x28ac3c;if(_0xd3d5b3['query'][_0x92ad('0x48')]){_0x138956[_0x92ad('0x49')]=[{'all':!![]}];}return db[_0x92ad('0x47')]['findAll'](_0x138956);})['then'](function(_0x22082f){_0x5b66f1['rows']=_0x22082f;return _0x5b66f1;})[_0x92ad('0x27')](respondWithFilteredResult(_0x8a4232,_0x138956))[_0x92ad('0x4a')](handleError(_0x8a4232,null));};exports['show']=function(_0x2782e1,_0x7e4f11){var _0x28fd2b={'raw':![],'where':{'id':_0x2782e1[_0x92ad('0x4b')]['id']}},_0x608d9a={};_0x608d9a['model']=_['keys'](db[_0x92ad('0x47')][_0x92ad('0x30')]);_0x608d9a['query']=_[_0x92ad('0x35')](_0x2782e1[_0x92ad('0x34')]);_0x608d9a[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x608d9a[_0x92ad('0x36')],_0x608d9a[_0x92ad('0x34')]);_0x28fd2b['attributes']=_['intersection'](_0x608d9a[_0x92ad('0x36')],qs[_0x92ad('0x39')](_0x2782e1['query'][_0x92ad('0x39')]));_0x28fd2b['attributes']=_0x28fd2b['attributes'][_0x92ad('0x3a')]?_0x28fd2b[_0x92ad('0x37')]:_0x608d9a['model'];if(_0x2782e1[_0x92ad('0x34')][_0x92ad('0x48')]){_0x28fd2b[_0x92ad('0x49')]=[{'all':!![]}];}_0x28fd2b=_[_0x92ad('0x45')]({},_0x28fd2b,_0x2782e1['options']);return db['CmList'][_0x92ad('0x4c')](_0x28fd2b)['then'](handleEntityNotFound(_0x7e4f11,null))[_0x92ad('0x27')](respondWithResult(_0x7e4f11,null))[_0x92ad('0x4a')](handleError(_0x7e4f11,null));};exports[_0x92ad('0x4d')]=function(_0x1c87d4,_0x5935fe){return db[_0x92ad('0x47')][_0x92ad('0x4d')](_0x1c87d4[_0x92ad('0x4e')],{})[_0x92ad('0x27')](function(_0x4adbeb){var _0x4e4f1b=_0x1c87d4[_0x92ad('0x4f')][_0x92ad('0x29')]({'plain':!![]});if(!_0x4e4f1b)throw new Error(_0x92ad('0x50'));if(_0x4e4f1b['role']==='user'){var _0x58323c=_0x4adbeb[_0x92ad('0x29')]({'plain':!![]});var _0x269006=_0x92ad('0x2a');return db[_0x92ad('0x51')][_0x92ad('0x4c')]({'where':{'name':_0x269006,'userProfileId':_0x4e4f1b['userProfileId']},'raw':!![]})[_0x92ad('0x27')](function(_0xf1b0b0){if(_0xf1b0b0&&_0xf1b0b0[_0x92ad('0x52')]===0x0){return db[_0x92ad('0x53')][_0x92ad('0x4d')]({'name':_0x58323c[_0x92ad('0x2d')],'resourceId':_0x58323c['id'],'type':_0xf1b0b0[_0x92ad('0x2d')],'sectionId':_0xf1b0b0['id']},{})[_0x92ad('0x27')](function(){return _0x4adbeb;});}else{return _0x4adbeb;}})[_0x92ad('0x4a')](function(_0xb8cfe4){logger[_0x92ad('0x2b')](_0x92ad('0x54'),_0xb8cfe4);throw _0xb8cfe4;});}return _0x4adbeb;})[_0x92ad('0x27')](respondWithResult(_0x5935fe,0xc9))[_0x92ad('0x4a')](handleError(_0x5935fe,null));};exports[_0x92ad('0x55')]=function(_0xdb8f71,_0x3ee068){if(_0xdb8f71[_0x92ad('0x4e')]['id']){delete _0xdb8f71[_0x92ad('0x4e')]['id'];}return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0xdb8f71[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ee068,null))[_0x92ad('0x27')](saveUpdates(_0xdb8f71['body'],null))[_0x92ad('0x27')](respondWithResult(_0x3ee068,null))[_0x92ad('0x4a')](handleError(_0x3ee068,null));};exports[_0x92ad('0x28')]=function(_0x56cf3a,_0x5cc7b7){return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x56cf3a[_0x92ad('0x4b')]['id']}})[_0x92ad('0x27')](handleEntityNotFound(_0x5cc7b7,null))[_0x92ad('0x27')](removeEntity(_0x5cc7b7,null))[_0x92ad('0x4a')](handleError(_0x5cc7b7,null));};exports[_0x92ad('0x56')]=function(_0x41fa15,_0x36e9a1){return db['CmList'][_0x92ad('0x56')]()['then'](respondWithResult(_0x36e9a1,null))[_0x92ad('0x4a')](handleError(_0x36e9a1,null));};exports[_0x92ad('0x57')]=function(_0x2bfd2b,_0x28a121,_0x387b17){if(_0x2bfd2b[_0x92ad('0x4e')]['id']){delete _0x2bfd2b['body']['id'];}return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x2bfd2b[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28a121,null))[_0x92ad('0x27')](function(_0x4c7f39){if(_0x4c7f39){_0x2bfd2b[_0x92ad('0x4e')][_0x92ad('0x58')]=_0x4c7f39['id'];return db['Disposition'][_0x92ad('0x4d')](_0x2bfd2b['body']);}})['then'](respondWithResult(_0x28a121,null))['catch'](handleError(_0x28a121,null));};exports[_0x92ad('0x59')]=function(_0x2e8cec,_0x43ad3f,_0x42b776){var _0x527447={'raw':![],'where':{}};var _0x27736a={};var _0x807a55={'count':0x0,'rows':[]};return db[_0x92ad('0x47')][_0x92ad('0x5a')]({'where':{'id':_0x2e8cec[_0x92ad('0x4b')]['id']}})[_0x92ad('0x27')](handleEntityNotFound(_0x43ad3f,null))[_0x92ad('0x27')](function(_0x4b2ac6){if(_0x4b2ac6){_0x27736a[_0x92ad('0x36')]=_[_0x92ad('0x35')](db['Disposition'][_0x92ad('0x30')]);_0x27736a[_0x92ad('0x34')]=_[_0x92ad('0x35')](_0x2e8cec['query']);_0x27736a[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x27736a[_0x92ad('0x36')],_0x27736a[_0x92ad('0x34')]);_0x527447[_0x92ad('0x37')]=_['intersection'](_0x27736a['model'],qs[_0x92ad('0x39')](_0x2e8cec[_0x92ad('0x34')]['fields']));_0x527447[_0x92ad('0x37')]=_0x527447['attributes']['length']?_0x527447[_0x92ad('0x37')]:_0x27736a[_0x92ad('0x36')];if(!_0x2e8cec[_0x92ad('0x34')][_0x92ad('0x5b')](_0x92ad('0x3b'))){_0x527447['limit']=qs[_0x92ad('0x3c')](_0x2e8cec[_0x92ad('0x34')][_0x92ad('0x3c')]);_0x527447[_0x92ad('0x20')]=qs['offset'](_0x2e8cec['query'][_0x92ad('0x20')]);}_0x527447['order']=qs[_0x92ad('0x3e')](_0x2e8cec[_0x92ad('0x34')][_0x92ad('0x3e')]);_0x527447[_0x92ad('0x3f')]=qs[_0x92ad('0x41')](_[_0x92ad('0x40')](_0x2e8cec[_0x92ad('0x34')],_0x27736a[_0x92ad('0x41')]));_0x527447[_0x92ad('0x3f')]['ListId']=_0x4b2ac6['id'];if(_0x2e8cec[_0x92ad('0x34')][_0x92ad('0x42')]){_0x527447[_0x92ad('0x3f')]=_[_0x92ad('0x45')](_0x527447[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x527447['attributes'],function(_0x4ccd1d){var _0x1eda36={};_0x1eda36[_0x4ccd1d]={'$like':'%'+_0x2e8cec['query'][_0x92ad('0x42')]+'%'};return _0x1eda36;})});}_0x527447=_['merge']({},_0x527447,_0x2e8cec['options']);return db['Disposition']['count']({'where':_0x527447[_0x92ad('0x3f')]})[_0x92ad('0x27')](function(_0x5b77d6){_0x807a55['count']=_0x5b77d6;if(_0x2e8cec['query'][_0x92ad('0x48')]){_0x527447[_0x92ad('0x49')]=[{'all':!![]}];}return db['Disposition'][_0x92ad('0x5c')](_0x527447);})[_0x92ad('0x27')](function(_0x51ae0d){_0x807a55['rows']=_0x51ae0d;return _0x807a55;});}})[_0x92ad('0x27')](respondWithFilteredResult(_0x43ad3f,_0x527447))[_0x92ad('0x4a')](handleError(_0x43ad3f,null));};exports[_0x92ad('0x5d')]=function(_0x3ecdf9,_0x571d97,_0x20a196){return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x3ecdf9[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x571d97,null))[_0x92ad('0x27')](function(_0x55b147){if(_0x55b147){return _0x55b147['removeDispositions'](_0x3ecdf9[_0x92ad('0x34')][_0x92ad('0x5e')]);}})['then'](respondWithStatusCode(_0x571d97,null))[_0x92ad('0x4a')](handleError(_0x571d97,null));};exports[_0x92ad('0x5f')]=function(_0x10a7c1,_0x526c36,_0x4ee52d){return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x10a7c1[_0x92ad('0x4b')]['id']}})[_0x92ad('0x27')](handleEntityNotFound(_0x526c36,null))[_0x92ad('0x27')](function(_0x420706){if(_0x420706){var _0x3dc901=[];var _0x15cf20={'success':[],'errors':[]};return db[_0x92ad('0x60')][_0x92ad('0x56')]()[_0x92ad('0x27')](function(_0x13fd87){if(_0x10a7c1[_0x92ad('0x4e')]['tags']&&_[_0x92ad('0x61')](_0x10a7c1['body'][_0x92ad('0x62')])){if(_0x10a7c1['body'][_0x92ad('0x62')]['length']){_0x10a7c1[_0x92ad('0x4e')][_0x92ad('0x62')]=_0x10a7c1[_0x92ad('0x4e')]['tags'][_0x92ad('0x63')](';')+';';}else{_0x10a7c1['body']['tags']=null;}}else{_0x10a7c1['body']['tags']=null;}if(_0x10a7c1[_0x92ad('0x4e')]&&_['isArray'](_0x10a7c1[_0x92ad('0x4e')])){for(var _0x102cfa=0x0;_0x102cfa<_0x10a7c1[_0x92ad('0x4e')][_0x92ad('0x3a')];_0x102cfa+=0x1){_0x10a7c1[_0x92ad('0x4e')][_0x102cfa]['ListId']=_0x10a7c1[_0x92ad('0x4b')]['id'];_0x3dc901['push'](_0x10a7c1[_0x92ad('0x4e')][_0x102cfa]);}return BPromise[_0x92ad('0x64')](_0x3dc901,function(_0x3d6321){return db[_0x92ad('0x60')]['create'](_[_0x92ad('0x65')](_0x3d6321,['ids','id'])||{},{'fields':_[_0x92ad('0x35')](_0x13fd87),'raw':!![]})[_0x92ad('0x27')](function(_0x51ef58){_0x15cf20[_0x92ad('0x66')][_0x92ad('0x67')](_0x51ef58['dataValues']);})['catch'](function(_0x5690c3){_0x15cf20[_0x92ad('0x68')]['push']({'data':_0x3d6321,'error':_0x5690c3[_0x92ad('0x69')]});});})['then'](function(_0x3aeb25){return _0x15cf20;})[_0x92ad('0x4a')](function(_0x4ef91e){return _0x4ef91e;});}else{_0x526c36[_0x92ad('0x1d')](0x190)[_0x92ad('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x92ad('0x27')](respondWithResult(_0x526c36,null))[_0x92ad('0x4a')](handleError(_0x526c36,null));};exports[_0x92ad('0x6a')]=function(_0x4ad700,_0x18dda4,_0x2eeef1){var _0x5369db;return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x4ad700[_0x92ad('0x4b')]['id']},'include':[{'model':db[_0x92ad('0x6b')],'as':_0x92ad('0x6c')}]})['then'](handleEntityNotFound(_0x18dda4,null))[_0x92ad('0x27')](function(_0x390903){if(_0x390903){_0x5369db=_0x390903;return db[_0x92ad('0x60')][_0x92ad('0x30')];}})[_0x92ad('0x27')](function(_0x527d3c){if(_0x527d3c){var _0x5da02b={};var _0x2e274d={};_0x2e274d[_0x92ad('0x36')]=_[_0x92ad('0x6d')](_[_0x92ad('0x35')](_0x527d3c),_[_0x92ad('0x43')](_0x5369db[_0x92ad('0x6c')],function(_0x5d3bd3){return util[_0x92ad('0x6e')](_0x92ad('0x6f'),_0x5d3bd3['id']);}));_0x2e274d[_0x92ad('0x34')]=_[_0x92ad('0x35')](_0x4ad700[_0x92ad('0x34')]);_0x2e274d[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x2e274d[_0x92ad('0x36')],_0x2e274d['query']);_0x5da02b['attributes']=_[_0x92ad('0x38')](_0x2e274d[_0x92ad('0x36')],qs['fields'](_0x4ad700['query']['fields']));_0x5da02b[_0x92ad('0x37')]=_0x5da02b[_0x92ad('0x37')]['length']?_0x5da02b[_0x92ad('0x37')]:_0x2e274d['model'];if(!_0x4ad700['query'][_0x92ad('0x5b')]('nolimit')){_0x5da02b['limit']=qs[_0x92ad('0x3c')](_0x4ad700[_0x92ad('0x34')][_0x92ad('0x3c')]);_0x5da02b[_0x92ad('0x20')]=qs[_0x92ad('0x20')](_0x4ad700[_0x92ad('0x34')][_0x92ad('0x20')]);}_0x5da02b[_0x92ad('0x3d')]=qs[_0x92ad('0x3e')](_0x4ad700[_0x92ad('0x34')][_0x92ad('0x3e')]);_0x5da02b['where']=qs[_0x92ad('0x41')](_[_0x92ad('0x40')](_0x4ad700[_0x92ad('0x34')],_0x2e274d[_0x92ad('0x41')]));_0x5da02b[_0x92ad('0x70')]=!![];if(_0x4ad700[_0x92ad('0x34')]['filter']){_0x5da02b[_0x92ad('0x3f')]=_[_0x92ad('0x45')](_0x5da02b[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x5da02b['attributes'],function(_0x38d277){var _0x5cd583={};_0x5cd583[_0x38d277]={'$like':'%'+_0x4ad700[_0x92ad('0x34')][_0x92ad('0x42')]+'%'};return _0x5cd583;})});}_0x5da02b=_[_0x92ad('0x45')]({},_0x5da02b,_0x4ad700[_0x92ad('0x46')]);return _0x5369db[_0x92ad('0x6a')](_0x5da02b);}})['then'](respondWithResult(_0x18dda4,null))[_0x92ad('0x4a')](handleError(_0x18dda4,null));};exports['getContactsCsv']=function(_0x41cd0c,_0x34d6ce,_0x38381d){var _0x535a0c;return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x41cd0c['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x92ad('0x6c')}]})[_0x92ad('0x27')](handleEntityNotFound(_0x34d6ce,null))[_0x92ad('0x27')](function(_0x510f03){if(_0x510f03){_0x535a0c=_0x510f03;return db['CmContact'][_0x92ad('0x30')];}})['then'](function(_0x29b71a){if(_0x29b71a){var _0x956453={};var _0x1dc8a2={};_0x1dc8a2[_0x92ad('0x36')]=_['concat'](_[_0x92ad('0x35')](_0x29b71a),_['map'](_0x535a0c[_0x92ad('0x6c')],function(_0x6801ca){return util[_0x92ad('0x6e')](_0x92ad('0x6f'),_0x6801ca['id']);}));_0x1dc8a2[_0x92ad('0x34')]=_[_0x92ad('0x35')](_0x41cd0c['query']);_0x1dc8a2[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x1dc8a2[_0x92ad('0x36')],_0x1dc8a2[_0x92ad('0x34')]);_0x956453[_0x92ad('0x37')]=_[_0x92ad('0x38')](_0x1dc8a2[_0x92ad('0x36')],qs[_0x92ad('0x39')](_0x41cd0c[_0x92ad('0x34')]['fields']));_0x956453[_0x92ad('0x37')]=_0x956453[_0x92ad('0x37')]['length']?_0x956453[_0x92ad('0x37')]:_0x1dc8a2[_0x92ad('0x36')];if(!_0x41cd0c['query'][_0x92ad('0x5b')](_0x92ad('0x3b'))){_0x956453[_0x92ad('0x3c')]=qs[_0x92ad('0x3c')](_0x41cd0c[_0x92ad('0x34')]['limit']);_0x956453[_0x92ad('0x20')]=qs[_0x92ad('0x20')](_0x41cd0c[_0x92ad('0x34')][_0x92ad('0x20')]);}_0x956453[_0x92ad('0x3d')]=qs[_0x92ad('0x3e')](_0x41cd0c[_0x92ad('0x34')][_0x92ad('0x3e')]);_0x956453[_0x92ad('0x3f')]=qs['filters'](_[_0x92ad('0x40')](_0x41cd0c[_0x92ad('0x34')],_0x1dc8a2[_0x92ad('0x41')]));_0x956453[_0x92ad('0x70')]=!![];if(_0x41cd0c[_0x92ad('0x34')][_0x92ad('0x42')]){_0x956453['where']=_[_0x92ad('0x45')](_0x956453[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x956453[_0x92ad('0x37')],function(_0x30487f){var _0x303441={};_0x303441[_0x30487f]={'$like':'%'+_0x41cd0c[_0x92ad('0x34')]['filter']+'%'};return _0x303441;})});}_0x956453=_[_0x92ad('0x45')]({},_0x956453,_0x41cd0c['options']);return _0x535a0c[_0x92ad('0x6a')](_0x956453);}})[_0x92ad('0x27')](function(_0x5f3936){if(!_[_0x92ad('0x71')](_0x5f3936)){var _0x3a5e1b=toCsv(_0x5f3936);var _0x397a98=Date[_0x92ad('0x72')]();fs[_0x92ad('0x73')](util['format'](_0x92ad('0x74'),_0x535a0c['id'],_0x397a98),_0x3a5e1b);_0x34d6ce[_0x92ad('0x75')](_0x92ad('0x76'),'attachment;\x20filename='+util[_0x92ad('0x6e')](_0x92ad('0x77'),_0x535a0c['id'],_0x397a98));_0x34d6ce[_0x92ad('0x75')](_0x92ad('0x78'),_0x92ad('0x79'));return _0x34d6ce[_0x92ad('0x7a')](util[_0x92ad('0x6e')](_0x92ad('0x74'),_0x535a0c['id'],_0x397a98));}else{return _0x34d6ce[_0x92ad('0x1c')](0xcc);}})['catch'](handleError(_0x34d6ce,null));};exports[_0x92ad('0x7b')]=function(_0x57d092,_0x5bac23,_0x1fd1da){var _0x290a5c;delete _0x57d092['body']['id'];return db['CmList'][_0x92ad('0x5a')]({'where':{'id':_0x57d092[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bac23,null))[_0x92ad('0x27')](function(_0x31cfec){if(_0x31cfec){return db[_0x92ad('0x7c')]['transaction'](function(_0x4e4151){return db[_0x92ad('0x6b')]['create'](_0x57d092[_0x92ad('0x4e')],{'transaction':_0x4e4151})[_0x92ad('0x27')](function(_0x18019f){_0x290a5c=_0x18019f;return _0x31cfec[_0x92ad('0x7d')](_0x18019f,{'transaction':_0x4e4151});})['then'](function(){var _0x549816={'type':db[_0x92ad('0x7e')][_0x92ad('0x7f')],'transaction':_0x4e4151};switch(_0x57d092[_0x92ad('0x4e')][_0x92ad('0x32')]){case _0x92ad('0x80'):_0x549816[_0x92ad('0x32')]=db['Sequelize'][_0x92ad('0x7f')];break;case _0x92ad('0x81'):_0x549816[_0x92ad('0x32')]=db['Sequelize']['INTEGER'];break;case'switch':_0x549816[_0x92ad('0x32')]=db[_0x92ad('0x7e')]['BOOLEAN'];_0x549816[_0x92ad('0x82')]=![];break;default:}return db[_0x92ad('0x7c')]['queryInterface'][_0x92ad('0x83')](_0x92ad('0x84'),util[_0x92ad('0x6e')](_0x92ad('0x85'),_0x290a5c['id']),_0x549816);})[_0x92ad('0x27')](function(){return _0x290a5c;});});}})['then'](respondWithResult(_0x5bac23,null))[_0x92ad('0x4a')](handleError(_0x5bac23,null));};exports[_0x92ad('0x86')]=function(_0xa01a79,_0x562167,_0x53fa2a){var _0x5e43ff={};var _0x4d3bd3={};var _0x5ae355;var _0x2d0d1f;return db[_0x92ad('0x47')][_0x92ad('0x5a')]({'where':{'id':_0xa01a79[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x562167,null))[_0x92ad('0x27')](function(_0x29cc61){if(_0x29cc61){_0x5ae355=_0x29cc61;_0x4d3bd3[_0x92ad('0x36')]=_[_0x92ad('0x35')](db['CmCustomField'][_0x92ad('0x30')]);_0x4d3bd3[_0x92ad('0x34')]=_[_0x92ad('0x35')](_0xa01a79[_0x92ad('0x34')]);_0x4d3bd3[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x4d3bd3[_0x92ad('0x36')],_0x4d3bd3['query']);_0x5e43ff[_0x92ad('0x37')]=_[_0x92ad('0x38')](_0x4d3bd3[_0x92ad('0x36')],qs[_0x92ad('0x39')](_0xa01a79[_0x92ad('0x34')][_0x92ad('0x39')]));_0x5e43ff[_0x92ad('0x37')]=_0x5e43ff[_0x92ad('0x37')][_0x92ad('0x3a')]?_0x5e43ff[_0x92ad('0x37')]:_0x4d3bd3[_0x92ad('0x36')];_0x5e43ff[_0x92ad('0x3d')]=qs['sort'](_0xa01a79['query'][_0x92ad('0x3e')]);_0x5e43ff[_0x92ad('0x3f')]=qs[_0x92ad('0x41')](_['pick'](_0xa01a79[_0x92ad('0x34')],_0x4d3bd3[_0x92ad('0x41')]));_0x5e43ff['where']=_[_0x92ad('0x45')](_0x5e43ff[_0x92ad('0x3f')],{'$or':[{'ListId':_0x29cc61['id']},{'ListId':null}]});if(_0xa01a79[_0x92ad('0x34')]['filter']){_0x5e43ff[_0x92ad('0x3f')]=_[_0x92ad('0x45')](_0x5e43ff[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x5e43ff[_0x92ad('0x37')],function(_0x437990){var _0x142ac0={};_0x142ac0[_0x437990]={'$like':'%'+_0xa01a79[_0x92ad('0x34')][_0x92ad('0x42')]+'%'};return _0x142ac0;})});}_0x5e43ff=_['merge']({},_0x5e43ff,_0xa01a79[_0x92ad('0x46')]);return db[_0x92ad('0x6b')][_0x92ad('0x87')](_0x5e43ff);}})[_0x92ad('0x27')](respondWithResult(_0x562167,null))[_0x92ad('0x4a')](handleError(_0x562167,null));};exports[_0x92ad('0x88')]=function(_0x3b4b07,_0x9ce3e6,_0x59ce98){return db['CmList'][_0x92ad('0x4c')]({'where':{'id':_0x3b4b07[_0x92ad('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9ce3e6,null))[_0x92ad('0x27')](function(_0x12cf3c){if(_0x12cf3c){return _0x12cf3c[_0x92ad('0x88')](_0x3b4b07[_0x92ad('0x4e')][_0x92ad('0x5e')],_[_0x92ad('0x65')](_0x3b4b07[_0x92ad('0x4e')],['ids','id'])||{})[_0x92ad('0x89')](function(_0x23b042){for(var _0x58f580=0x0;_0x58f580<_0x3b4b07['body'][_0x92ad('0x5e')][_0x92ad('0x3a')];_0x58f580+=0x1){socket['emit'](_0x92ad('0x8a'),{'UserId':Number(_0x3b4b07[_0x92ad('0x4e')][_0x92ad('0x5e')][_0x58f580]),'CmListId':Number(_0x3b4b07[_0x92ad('0x4b')]['id'])});}return _0x23b042;});}})[_0x92ad('0x27')](respondWithResult(_0x9ce3e6,null))[_0x92ad('0x4a')](handleError(_0x9ce3e6,null));};exports[_0x92ad('0x8b')]=function(_0x323129,_0x3728d3,_0x1a7be1){return db[_0x92ad('0x47')][_0x92ad('0x4c')]({'where':{'id':_0x323129[_0x92ad('0x4b')]['id']}})[_0x92ad('0x27')](handleEntityNotFound(_0x3728d3,null))[_0x92ad('0x27')](function(_0x2e8984){if(_0x2e8984){return _0x2e8984[_0x92ad('0x8b')](_0x323129['query']['ids'])[_0x92ad('0x27')](function(){if(_[_0x92ad('0x61')](_0x323129['query']['ids'])){for(var _0x3000f6=0x0;_0x3000f6<_0x323129[_0x92ad('0x34')]['ids']['length'];_0x3000f6+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x323129[_0x92ad('0x34')][_0x92ad('0x5e')][_0x3000f6]),'CmListId':Number(_0x323129['params']['id'])});}}else{socket['emit'](_0x92ad('0x8c'),{'UserId':Number(_0x323129[_0x92ad('0x34')][_0x92ad('0x5e')]),'CmListId':Number(_0x323129[_0x92ad('0x4b')]['id'])});}});}})[_0x92ad('0x27')](respondWithStatusCode(_0x3728d3,null))['catch'](handleError(_0x3728d3,null));};exports['getAgents']=function(_0x2e4ceb,_0x2e8452,_0x18833b){var _0x598c09={};var _0x524393={};var _0x55062e;var _0x22f74e;return db['CmList'][_0x92ad('0x5a')]({'where':{'id':_0x2e4ceb['params']['id']}})[_0x92ad('0x27')](handleEntityNotFound(_0x2e8452,null))[_0x92ad('0x27')](function(_0x59f0af){if(_0x59f0af){_0x55062e=_0x59f0af;_0x524393[_0x92ad('0x36')]=_['keys'](db['User'][_0x92ad('0x30')]);_0x524393[_0x92ad('0x34')]=_['keys'](_0x2e4ceb[_0x92ad('0x34')]);_0x524393[_0x92ad('0x41')]=_[_0x92ad('0x38')](_0x524393[_0x92ad('0x36')],_0x524393['query']);_0x598c09[_0x92ad('0x37')]=_[_0x92ad('0x38')](_0x524393['model'],qs['fields'](_0x2e4ceb[_0x92ad('0x34')][_0x92ad('0x39')]));_0x598c09['attributes']=_0x598c09['attributes'][_0x92ad('0x3a')]?_0x598c09[_0x92ad('0x37')]:_0x524393[_0x92ad('0x36')];_0x598c09['order']=qs['sort'](_0x2e4ceb[_0x92ad('0x34')]['sort']);_0x598c09[_0x92ad('0x3f')]=qs[_0x92ad('0x41')](_[_0x92ad('0x40')](_0x2e4ceb['query'],_0x524393['filters']));if(_0x2e4ceb[_0x92ad('0x34')][_0x92ad('0x42')]){_0x598c09[_0x92ad('0x3f')]=_['merge'](_0x598c09[_0x92ad('0x3f')],{'$or':_[_0x92ad('0x43')](_0x598c09['attributes'],function(_0xb0b9df){var _0x2d3d89={};_0x2d3d89[_0xb0b9df]={'$like':'%'+_0x2e4ceb[_0x92ad('0x34')]['filter']+'%'};return _0x2d3d89;})});}_0x598c09=_[_0x92ad('0x45')]({},_0x598c09,_0x2e4ceb['options']);return _0x55062e[_0x92ad('0x8d')](_0x598c09);}})[_0x92ad('0x27')](function(_0x5716a1){if(_0x5716a1){_0x22f74e=_0x5716a1[_0x92ad('0x3a')];if(!_0x2e4ceb['query']['hasOwnProperty'](_0x92ad('0x3b'))){_0x598c09[_0x92ad('0x3c')]=qs[_0x92ad('0x3c')](_0x2e4ceb[_0x92ad('0x34')][_0x92ad('0x3c')]);_0x598c09[_0x92ad('0x20')]=qs['offset'](_0x2e4ceb[_0x92ad('0x34')][_0x92ad('0x20')]);}return _0x55062e[_0x92ad('0x8d')](_0x598c09);}})[_0x92ad('0x27')](function(_0x14e601){if(_0x14e601){return _0x14e601?{'count':_0x22f74e,'rows':_0x14e601}:null;}})[_0x92ad('0x27')](respondWithResult(_0x2e8452,null))['catch'](handleError(_0x2e8452,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 9ce8620..919ecc2 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x55ca,0x126));var _0xa55c=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0x55ca[_0x3c6125];return _0x2f47b8;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'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 d226c43..485b221 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 _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0xacb7c6,_0x3ee785){var _0x15dc36=function(_0x593ad1){while(--_0x593ad1){_0xacb7c6['push'](_0xacb7c6['shift']());}};_0x15dc36(++_0x3ee785);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x2b1ccf,_0x3c3455){var _0x1a5bb0=function(_0x5c9986){while(--_0x5c9986){_0x2b1ccf['push'](_0x2b1ccf['shift']());}};_0x1a5bb0(++_0x3c3455);}(_0x54ef,0x112));var _0xf54e=function(_0x5e2c7e,_0x55e106){_0x5e2c7e=_0x5e2c7e-0x0;var _0x47b3a9=_0x54ef[_0x5e2c7e];return _0x47b3a9;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 47a615b..698e597 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 _0x245f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d70f3,_0x59bcfd){var _0x356f63=function(_0x250496){while(--_0x250496){_0x4d70f3['push'](_0x4d70f3['shift']());}};_0x356f63(++_0x59bcfd);}(_0x245f,0x72));var _0xf245=function(_0x4e45fc,_0x26a872){_0x4e45fc=_0x4e45fc-0x0;var _0x5cfdbb=_0x245f[_0x4e45fc];return _0x5cfdbb;};'use strict';var _=require(_0xf245('0x0'));var util=require(_0xf245('0x1'));var moment=require(_0xf245('0x2'));var BPromise=require(_0xf245('0x3'));var rs=require(_0xf245('0x4'));var fs=require('fs');var Redis=require(_0xf245('0x5'));var db=require(_0xf245('0x6'))['db'];var utils=require(_0xf245('0x7'));var logger=require(_0xf245('0x8'))(_0xf245('0x9'));var config=require('../../config/environment');var jayson=require(_0xf245('0xa'));var client=jayson['client'][_0xf245('0xb')]({'port':0x232a});config[_0xf245('0xc')]=_[_0xf245('0xd')](config[_0xf245('0xc')],{'host':_0xf245('0xe'),'port':0x18eb});var socket=require(_0xf245('0xf'))(new Redis(config['redis']));require(_0xf245('0x10'))[_0xf245('0x11')](socket);function respondWithRpcPromise(_0x106d5f,_0x1a59c6,_0xa72adf){return new BPromise(function(_0x50de83,_0x1ea084){return client[_0xf245('0x12')](_0x106d5f,_0xa72adf)[_0xf245('0x13')](function(_0x455392){logger[_0xf245('0x14')](_0xf245('0x15'),_0x1a59c6,_0xf245('0x16'));logger['debug'](_0xf245('0x17'),_0x1a59c6,_0xf245('0x16'),JSON[_0xf245('0x18')](_0x455392));if(_0x455392[_0xf245('0x19')]){if(_0x455392[_0xf245('0x19')][_0xf245('0x1a')]===0x1f4){logger[_0xf245('0x19')]('CmList,\x20%s,\x20%s',_0x1a59c6,_0x455392[_0xf245('0x19')]['message']);return _0x1ea084(_0x455392['error'][_0xf245('0x1b')]);}logger['error'](_0xf245('0x15'),_0x1a59c6,_0x455392['error'][_0xf245('0x1b')]);return _0x50de83(_0x455392[_0xf245('0x19')][_0xf245('0x1b')]);}else{logger[_0xf245('0x14')]('CmList,\x20%s,\x20%s',_0x1a59c6,_0xf245('0x16'));_0x50de83(_0x455392[_0xf245('0x1c')][_0xf245('0x1b')]);}})[_0xf245('0x1d')](function(_0x56531e){logger[_0xf245('0x19')](_0xf245('0x15'),_0x1a59c6,_0x56531e);_0x1ea084(_0x56531e);});});} \ No newline at end of file +var _0x03f2=['client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ad9f4,_0x150ffe){var _0x2e4d20=function(_0x34b714){while(--_0x34b714){_0x1ad9f4['push'](_0x1ad9f4['shift']());}};_0x2e4d20(++_0x150ffe);}(_0x03f2,0x19a));var _0x203f=function(_0xa3f831,_0x2d6613){_0xa3f831=_0xa3f831-0x0;var _0x57538c=_0x03f2[_0xa3f831];return _0x57538c;};'use strict';var _=require('lodash');var util=require(_0x203f('0x0'));var moment=require(_0x203f('0x1'));var BPromise=require(_0x203f('0x2'));var rs=require(_0x203f('0x3'));var fs=require('fs');var Redis=require(_0x203f('0x4'));var db=require(_0x203f('0x5'))['db'];var utils=require(_0x203f('0x6'));var logger=require(_0x203f('0x7'))(_0x203f('0x8'));var config=require(_0x203f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x203f('0xa')]['http']({'port':0x232a});config[_0x203f('0xb')]=_[_0x203f('0xc')](config[_0x203f('0xb')],{'host':_0x203f('0xd'),'port':0x18eb});var socket=require(_0x203f('0xe'))(new Redis(config[_0x203f('0xb')]));require(_0x203f('0xf'))[_0x203f('0x10')](socket);function respondWithRpcPromise(_0x12cc7e,_0x2038b3,_0x87e670){return new BPromise(function(_0xdb9723,_0x2c89f6){return client[_0x203f('0x11')](_0x12cc7e,_0x87e670)[_0x203f('0x12')](function(_0x3f4f80){logger[_0x203f('0x13')](_0x203f('0x14'),_0x2038b3,'request\x20sent');logger['debug'](_0x203f('0x15'),_0x2038b3,'request\x20sent',JSON[_0x203f('0x16')](_0x3f4f80));if(_0x3f4f80[_0x203f('0x17')]){if(_0x3f4f80[_0x203f('0x17')][_0x203f('0x18')]===0x1f4){logger['error'](_0x203f('0x14'),_0x2038b3,_0x3f4f80[_0x203f('0x17')][_0x203f('0x19')]);return _0x2c89f6(_0x3f4f80[_0x203f('0x17')][_0x203f('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x2038b3,_0x3f4f80[_0x203f('0x17')][_0x203f('0x19')]);return _0xdb9723(_0x3f4f80[_0x203f('0x17')][_0x203f('0x19')]);}else{logger[_0x203f('0x13')](_0x203f('0x14'),_0x2038b3,_0x203f('0x1a'));_0xdb9723(_0x3f4f80[_0x203f('0x1b')][_0x203f('0x19')]);}})['catch'](function(_0x5c650e){logger[_0x203f('0x17')](_0x203f('0x14'),_0x2038b3,_0x5c650e);_0x2c89f6(_0x5c650e);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 42f8d0e..6e9c429 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 _0xc795=['cmList:','./cmList.events','save','remove','update','removeListener','length'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xc795,0x1a5));var _0x5c79=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc795[_0x5d6456];return _0x4d66c1;};'use strict';var CmListEvents=require(_0x5c79('0x0'));var events=[_0x5c79('0x1'),_0x5c79('0x2'),_0x5c79('0x3')];function createListener(_0xa45a4d,_0x14158a){return function(_0x5bc9b8){_0x14158a['emit'](_0xa45a4d,_0x5bc9b8);};}function removeListener(_0x56d3bc,_0x249ce7){return function(){CmListEvents[_0x5c79('0x4')](_0x56d3bc,_0x249ce7);};}exports['register']=function(_0x59ad27){for(var _0xa6c03a=0x0,_0x576377=events[_0x5c79('0x5')];_0xa6c03a<_0x576377;_0xa6c03a++){var _0x871d04=events[_0xa6c03a];var _0x3bde84=createListener(_0x5c79('0x6')+_0x871d04,_0x59ad27);CmListEvents['on'](_0x871d04,_0x3bde84);}}; \ No newline at end of file +var _0xb15b=['removeListener','cmList:','save','remove','update','emit'];(function(_0x2211cd,_0xa8741c){var _0x49a339=function(_0x42bc01){while(--_0x42bc01){_0x2211cd['push'](_0x2211cd['shift']());}};_0x49a339(++_0xa8741c);}(_0xb15b,0x19a));var _0xbb15=function(_0x50ccf1,_0x57e553){_0x50ccf1=_0x50ccf1-0x0;var _0x4abd29=_0xb15b[_0x50ccf1];return _0x4abd29;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xbb15('0x0'),_0xbb15('0x1'),_0xbb15('0x2')];function createListener(_0x2b12d7,_0x3c9d57){return function(_0x5d13e2){_0x3c9d57[_0xbb15('0x3')](_0x2b12d7,_0x5d13e2);};}function removeListener(_0x5d1c12,_0x14fa12){return function(){CmListEvents[_0xbb15('0x4')](_0x5d1c12,_0x14fa12);};}exports['register']=function(_0x125418){for(var _0x54e1f3=0x0,_0x390854=events['length'];_0x54e1f3<_0x390854;_0x54e1f3++){var _0x98a04=events[_0x54e1f3];var _0x42706f=createListener(_0xbb15('0x5')+_0x98a04,_0x125418);CmListEvents['on'](_0x98a04,_0x42706f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index fa12361..05aa113 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 _0x2583=['/:id/fields','addCustomField','/:id/users','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','/:id/contacts','addContacts'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x2583,0x172));var _0x3258=function(_0x28f737,_0x5e6b71){_0x28f737=_0x28f737-0x0;var _0x5c5c6f=_0x2583[_0x28f737];return _0x5c5c6f;};'use strict';var multer=require(_0x3258('0x0'));var util=require(_0x3258('0x1'));var path=require(_0x3258('0x2'));var timeout=require(_0x3258('0x3'));var express=require('express');var router=express[_0x3258('0x4')]();var fs_extra=require(_0x3258('0x5'));var auth=require(_0x3258('0x6'));var interaction=require(_0x3258('0x7'));var config=require(_0x3258('0x8'));var controller=require(_0x3258('0x9'));router[_0x3258('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3258('0xa')](_0x3258('0xb'),auth[_0x3258('0xc')](),controller[_0x3258('0xd')]);router['get'](_0x3258('0xe'),auth[_0x3258('0xc')](),controller[_0x3258('0xf')]);router[_0x3258('0xa')](_0x3258('0x10'),auth[_0x3258('0xc')](),controller[_0x3258('0x11')]);router[_0x3258('0xa')]('/:id/contacts',auth[_0x3258('0xc')](),controller['getContacts']);router[_0x3258('0xa')](_0x3258('0x12'),auth['isAuthenticated'](),controller[_0x3258('0x13')]);router[_0x3258('0xa')]('/:id/fields',auth[_0x3258('0xc')](),controller[_0x3258('0x14')]);router[_0x3258('0xa')]('/:id/users',auth[_0x3258('0xc')](),controller[_0x3258('0x15')]);router[_0x3258('0x16')]('/',auth[_0x3258('0xc')](),controller[_0x3258('0x17')]);router[_0x3258('0x16')]('/:id/dispositions',auth[_0x3258('0xc')](),controller['addDisposition']);router[_0x3258('0x16')](_0x3258('0x18'),auth[_0x3258('0xc')](),controller[_0x3258('0x19')]);router[_0x3258('0x16')](_0x3258('0x1a'),auth[_0x3258('0xc')](),controller[_0x3258('0x1b')]);router[_0x3258('0x16')](_0x3258('0x1c'),auth[_0x3258('0xc')](),controller['addAgents']);router[_0x3258('0x1d')]('/:id',auth[_0x3258('0xc')](),controller[_0x3258('0x1e')]);router[_0x3258('0x1f')](_0x3258('0xe'),auth[_0x3258('0xc')](),controller[_0x3258('0x20')]);router[_0x3258('0x1f')](_0x3258('0x10'),auth[_0x3258('0xc')](),controller[_0x3258('0x21')]);router[_0x3258('0x1f')](_0x3258('0x1c'),auth[_0x3258('0xc')](),controller[_0x3258('0x22')]);module[_0x3258('0x23')]=router; \ No newline at end of file +var _0x04ec=['getAgents','post','create','addDisposition','addCustomField','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x04ec,0x1a5));var _0xc04e=function(_0x1f78cb,_0x58e9f3){_0x1f78cb=_0x1f78cb-0x0;var _0x2cf6b8=_0x04ec[_0x1f78cb];return _0x2cf6b8;};'use strict';var multer=require(_0xc04e('0x0'));var util=require(_0xc04e('0x1'));var path=require(_0xc04e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc04e('0x3'));var router=express[_0xc04e('0x4')]();var fs_extra=require(_0xc04e('0x5'));var auth=require(_0xc04e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc04e('0x7'));var controller=require('./cmList.controller');router[_0xc04e('0x8')]('/',auth[_0xc04e('0x9')](),controller[_0xc04e('0xa')]);router[_0xc04e('0x8')]('/describe',auth[_0xc04e('0x9')](),controller[_0xc04e('0xb')]);router['get'](_0xc04e('0xc'),auth[_0xc04e('0x9')](),controller[_0xc04e('0xd')]);router[_0xc04e('0x8')](_0xc04e('0xe'),auth[_0xc04e('0x9')](),controller[_0xc04e('0xf')]);router[_0xc04e('0x8')](_0xc04e('0x10'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x11')]);router[_0xc04e('0x8')]('/:id/contacts/csv',auth[_0xc04e('0x9')](),controller[_0xc04e('0x12')]);router[_0xc04e('0x8')](_0xc04e('0x13'),auth['isAuthenticated'](),controller[_0xc04e('0x14')]);router['get']('/:id/users',auth[_0xc04e('0x9')](),controller[_0xc04e('0x15')]);router[_0xc04e('0x16')]('/',auth[_0xc04e('0x9')](),controller[_0xc04e('0x17')]);router['post'](_0xc04e('0xe'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x18')]);router[_0xc04e('0x16')]('/:id/contacts',auth[_0xc04e('0x9')](),controller['addContacts']);router[_0xc04e('0x16')](_0xc04e('0x13'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x19')]);router[_0xc04e('0x16')](_0xc04e('0x1a'),auth['isAuthenticated'](),controller[_0xc04e('0x1b')]);router[_0xc04e('0x1c')]('/:id',auth[_0xc04e('0x9')](),controller['update']);router[_0xc04e('0x1d')](_0xc04e('0xc'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x1e')]);router['delete'](_0xc04e('0xe'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x1f')]);router[_0xc04e('0x1d')](_0xc04e('0x1a'),auth[_0xc04e('0x9')](),controller[_0xc04e('0x20')]);module[_0xc04e('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e5edd30..02e87a9 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 _0xa659=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xa659,0xed));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9a65('0x0')]={'name':{'type':Sequelize[_0x9a65('0x1')],'get':function(_0x2257a7){return this[_0x9a65('0x2')](_0x9a65('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x9a65('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x9a65('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x2a51=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x2a51,0xf9));var _0x12a5=function(_0x22eb51,_0x2e6718){_0x22eb51=_0x22eb51-0x0;var _0x534caa=_0x2a51[_0x22eb51];return _0x534caa;};'use strict';var Sequelize=require(_0x12a5('0x0'));module[_0x12a5('0x1')]={'name':{'type':Sequelize[_0x12a5('0x2')],'get':function(_0xc88983){return this[_0x12a5('0x3')]('field');}},'field':{'type':Sequelize[_0x12a5('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x12a5('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 cf80140..b8ac486 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x42b720,_0x2d8d37){var _0x3a5868=function(_0x32acba){while(--_0x32acba){_0x42b720['push'](_0x42b720['shift']());}};_0x3a5868(++_0x2d8d37);}(_0x7a54,0x106));var _0x47a5=function(_0x5ac9a4,_0x2f4a52){_0x5ac9a4=_0x5ac9a4-0x0;var _0x469b09=_0x7a54[_0x5ac9a4];return _0x469b09;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _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(_0x43659a,_0x20156b){var _0x19e45e=function(_0x595a18){while(--_0x595a18){_0x43659a['push'](_0x43659a['shift']());}};_0x19e45e(++_0x20156b);}(_0x7a54,0x106));var _0x47a5=function(_0x11632a,_0x5232b6){_0x11632a=_0x11632a-0x0;var _0x50081a=_0x7a54[_0x11632a];return _0x50081a;};'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 6965efa..3abf6bb 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 _0xde9e=['api','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xde9e,0x75));var _0xede9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xede9('0x0'));var util=require(_0xede9('0x1'));var logger=require(_0xede9('0x2'))(_0xede9('0x3'));var moment=require('moment');var BPromise=require(_0xede9('0x4'));var rp=require(_0xede9('0x5'));var fs=require('fs');var path=require(_0xede9('0x6'));var rimraf=require('rimraf');var config=require(_0xede9('0x7'));var attributes=require(_0xede9('0x8'));module[_0xede9('0x9')]=function(_0x2692ba,_0x2cdc88){return _0x2692ba[_0xede9('0xa')]('Condition',attributes,{'tableName':_0xede9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22b3=['exports','define','Condition','tools_conditions','util','api','moment','request-promise','path','../../config/environment','./condition.attributes'];(function(_0x266fdd,_0x23c6f6){var _0x38c629=function(_0x4fbd3f){while(--_0x4fbd3f){_0x266fdd['push'](_0x266fdd['shift']());}};_0x38c629(++_0x23c6f6);}(_0x22b3,0x1e8));var _0x322b=function(_0x1d9bfb,_0x537138){_0x1d9bfb=_0x1d9bfb-0x0;var _0x505f55=_0x22b3[_0x1d9bfb];return _0x505f55;};'use strict';var _=require('lodash');var util=require(_0x322b('0x0'));var logger=require('../../config/logger')(_0x322b('0x1'));var moment=require(_0x322b('0x2'));var BPromise=require('bluebird');var rp=require(_0x322b('0x3'));var fs=require('fs');var path=require(_0x322b('0x4'));var rimraf=require('rimraf');var config=require(_0x322b('0x5'));var attributes=require(_0x322b('0x6'));module[_0x322b('0x7')]=function(_0x3869ed,_0xd4ef44){return _0x3869ed[_0x322b('0x8')](_0x322b('0x9'),attributes,{'tableName':_0x322b('0xa'),'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 3acf8f2..1e8542d 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 _0x4a7f=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x270805,_0x5b9888){var _0x1ea920=function(_0x24ccb5){while(--_0x24ccb5){_0x270805['push'](_0x270805['shift']());}};_0x1ea920(++_0x5b9888);}(_0x4a7f,0x1d1));var _0xf4a7=function(_0x544f2a,_0x4c66e1){_0x544f2a=_0x544f2a-0x0;var _0x3c1538=_0x4a7f[_0x544f2a];return _0x3c1538;};'use strict';var _=require('lodash');var util=require(_0xf4a7('0x0'));var moment=require(_0xf4a7('0x1'));var BPromise=require(_0xf4a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4a7('0x3'));var db=require(_0xf4a7('0x4'))['db'];var utils=require(_0xf4a7('0x5'));var logger=require(_0xf4a7('0x6'))(_0xf4a7('0x7'));var config=require(_0xf4a7('0x8'));var jayson=require(_0xf4a7('0x9'));var client=jayson[_0xf4a7('0xa')][_0xf4a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324abc,_0x45301c,_0x11fb1a){return new BPromise(function(_0x45bf46,_0x4c01f5){return client['request'](_0x324abc,_0x11fb1a)[_0xf4a7('0xc')](function(_0x302e3e){logger['info'](_0xf4a7('0xd'),_0x45301c,_0xf4a7('0xe'));logger[_0xf4a7('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x45301c,_0xf4a7('0xe'),JSON[_0xf4a7('0x10')](_0x302e3e));if(_0x302e3e[_0xf4a7('0x11')]){if(_0x302e3e[_0xf4a7('0x11')][_0xf4a7('0x12')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x45301c,_0x302e3e['error'][_0xf4a7('0x13')]);return _0x4c01f5(_0x302e3e['error'][_0xf4a7('0x13')]);}logger[_0xf4a7('0x11')](_0xf4a7('0xd'),_0x45301c,_0x302e3e[_0xf4a7('0x11')][_0xf4a7('0x13')]);return _0x45bf46(_0x302e3e[_0xf4a7('0x11')]['message']);}else{logger['info'](_0xf4a7('0xd'),_0x45301c,_0xf4a7('0xe'));_0x45bf46(_0x302e3e[_0xf4a7('0x14')][_0xf4a7('0x13')]);}})[_0xf4a7('0x15')](function(_0x1e3826){logger[_0xf4a7('0x11')]('Condition,\x20%s,\x20%s',_0x45301c,_0x1e3826);_0x4c01f5(_0x1e3826);});});} \ No newline at end of file +var _0x7b35=['client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1675f8,_0x1d7d48){var _0xef1a07=function(_0x208b78){while(--_0x208b78){_0x1675f8['push'](_0x1675f8['shift']());}};_0xef1a07(++_0x1d7d48);}(_0x7b35,0x6f));var _0x57b3=function(_0x3abb03,_0x3c7f7e){_0x3abb03=_0x3abb03-0x0;var _0x49841d=_0x7b35[_0x3abb03];return _0x49841d;};'use strict';var _=require(_0x57b3('0x0'));var util=require('util');var moment=require(_0x57b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57b3('0x2'));var db=require(_0x57b3('0x3'))['db'];var utils=require(_0x57b3('0x4'));var logger=require(_0x57b3('0x5'))(_0x57b3('0x6'));var config=require(_0x57b3('0x7'));var jayson=require(_0x57b3('0x8'));var client=jayson[_0x57b3('0x9')][_0x57b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29201c,_0x8aa3d6,_0x2ca126){return new BPromise(function(_0x157a32,_0x485a9d){return client[_0x57b3('0xb')](_0x29201c,_0x2ca126)[_0x57b3('0xc')](function(_0x23d452){logger[_0x57b3('0xd')](_0x57b3('0xe'),_0x8aa3d6,_0x57b3('0xf'));logger[_0x57b3('0x10')](_0x57b3('0x11'),_0x8aa3d6,_0x57b3('0xf'),JSON[_0x57b3('0x12')](_0x23d452));if(_0x23d452[_0x57b3('0x13')]){if(_0x23d452[_0x57b3('0x13')][_0x57b3('0x14')]===0x1f4){logger[_0x57b3('0x13')](_0x57b3('0xe'),_0x8aa3d6,_0x23d452[_0x57b3('0x13')][_0x57b3('0x15')]);return _0x485a9d(_0x23d452[_0x57b3('0x13')][_0x57b3('0x15')]);}logger[_0x57b3('0x13')](_0x57b3('0xe'),_0x8aa3d6,_0x23d452[_0x57b3('0x13')][_0x57b3('0x15')]);return _0x157a32(_0x23d452[_0x57b3('0x13')][_0x57b3('0x15')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x8aa3d6,_0x57b3('0xf'));_0x157a32(_0x23d452[_0x57b3('0x16')]['message']);}})[_0x57b3('0x17')](function(_0x55068b){logger[_0x57b3('0x13')](_0x57b3('0xe'),_0x8aa3d6,_0x55068b);_0x485a9d(_0x55068b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 423c9b3..aba3b79 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 _0xc274=['update','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xc274,0x17e));var _0x4c27=function(_0x2caf14,_0xaec61c){_0x2caf14=_0x2caf14-0x0;var _0x5c40d8=_0xc274[_0x2caf14];return _0x5c40d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c27('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c27('0x1')]();var fs_extra=require(_0x4c27('0x2'));var auth=require(_0x4c27('0x3'));var interaction=require(_0x4c27('0x4'));var config=require(_0x4c27('0x5'));var controller=require(_0x4c27('0x6'));router[_0x4c27('0x7')](_0x4c27('0x8'),auth[_0x4c27('0x9')](),controller[_0x4c27('0xa')]);router[_0x4c27('0xb')](_0x4c27('0x8'),auth['isAuthenticated'](),controller[_0x4c27('0xc')]);module[_0x4c27('0xd')]=router; \ No newline at end of file +var _0x3fb6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','exports','util','path','connect-timeout'];(function(_0x4462a6,_0xd163c1){var _0x3a2da4=function(_0x228974){while(--_0x228974){_0x4462a6['push'](_0x4462a6['shift']());}};_0x3a2da4(++_0xd163c1);}(_0x3fb6,0x19d));var _0x63fb=function(_0x47c29b,_0x930e74){_0x47c29b=_0x47c29b-0x0;var _0x4d96fb=_0x3fb6[_0x47c29b];return _0x4d96fb;};'use strict';var multer=require('multer');var util=require(_0x63fb('0x0'));var path=require(_0x63fb('0x1'));var timeout=require(_0x63fb('0x2'));var express=require(_0x63fb('0x3'));var router=express[_0x63fb('0x4')]();var fs_extra=require(_0x63fb('0x5'));var auth=require(_0x63fb('0x6'));var interaction=require(_0x63fb('0x7'));var config=require(_0x63fb('0x8'));var controller=require(_0x63fb('0x9'));router[_0x63fb('0xa')]('/:id',auth[_0x63fb('0xb')](),controller[_0x63fb('0xc')]);router[_0x63fb('0xd')](_0x63fb('0xe'),auth[_0x63fb('0xb')](),controller['destroy']);module[_0x63fb('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 045273d..043042a 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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb7e7[_0x1d24eb];return _0x1dc576;};'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 _0xd8b0=['exports','sequelize'];(function(_0x697c09,_0x432098){var _0x4600cb=function(_0x9d5876){while(--_0x9d5876){_0x697c09['push'](_0x697c09['shift']());}};_0x4600cb(++_0x432098);}(_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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 214b62e..f9aa8ab 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 _0x93b6=['set','Content-Range','reject','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','sort','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93b6,0x151));var _0x693b=function(_0x10bb5c,_0x27bc3b){_0x10bb5c=_0x10bb5c-0x0;var _0x4428e3=_0x93b6[_0x10bb5c];return _0x4428e3;};'use strict';var emlformat=require(_0x693b('0x0'));var rimraf=require(_0x693b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x693b('0x2'));var rp=require(_0x693b('0x3'));var moment=require('moment');var BPromise=require(_0x693b('0x4'));var Mustache=require(_0x693b('0x5'));var util=require(_0x693b('0x6'));var path=require(_0x693b('0x7'));var sox=require(_0x693b('0x8'));var csv=require(_0x693b('0x9'));var ejs=require(_0x693b('0xa'));var fs=require('fs');var fs_extra=require(_0x693b('0xb'));var _=require(_0x693b('0xc'));var squel=require(_0x693b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x693b('0x9'));var querystring=require(_0x693b('0xe'));var Papa=require(_0x693b('0xf'));var Redis=require(_0x693b('0x10'));var authService=require(_0x693b('0x11'));var qs=require(_0x693b('0x12'));var as=require(_0x693b('0x13'));var hardwareService=require(_0x693b('0x14'));var logger=require('../../config/logger')(_0x693b('0x15'));var utils=require(_0x693b('0x16'));var config=require(_0x693b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x693b('0x18'))['db'];config[_0x693b('0x19')]=_[_0x693b('0x1a')](config[_0x693b('0x19')],{'host':_0x693b('0x1b'),'port':0x18eb});var socket=require(_0x693b('0x1c'))(new Redis(config[_0x693b('0x19')]));require('./dashboard.socket')[_0x693b('0x1d')](socket);function respondWithStatusCode(_0x1cf1ed,_0xd617c6){_0xd617c6=_0xd617c6||0xcc;return function(_0x248300){if(_0x248300){return _0x1cf1ed[_0x693b('0x1e')](_0xd617c6);}return _0x1cf1ed[_0x693b('0x1f')](_0xd617c6)[_0x693b('0x20')]();};}function respondWithResult(_0x1ffb5a,_0x3d7392){_0x3d7392=_0x3d7392||0xc8;return function(_0x475337){if(_0x475337){return _0x1ffb5a[_0x693b('0x1f')](_0x3d7392)[_0x693b('0x21')](_0x475337);}};}function respondWithFilteredResult(_0x53d9dc,_0x38a798){return function(_0x4215a3){if(_0x4215a3){var _0x3ead86=typeof _0x38a798[_0x693b('0x22')]===_0x693b('0x23')&&typeof _0x38a798['limit']===_0x693b('0x23');var _0xe109e7=_0x4215a3[_0x693b('0x24')];var _0x5719f6=_0x3ead86?0x0:_0x38a798[_0x693b('0x22')];var _0x382a0e=_0x3ead86?_0x4215a3[_0x693b('0x24')]:_0x38a798[_0x693b('0x22')]+_0x38a798[_0x693b('0x25')];var _0x34040b;if(_0x382a0e>=_0xe109e7){_0x382a0e=_0xe109e7;_0x34040b=0xc8;}else{_0x34040b=0xce;}_0x53d9dc['status'](_0x34040b);return _0x53d9dc[_0x693b('0x26')](_0x693b('0x27'),_0x5719f6+'-'+_0x382a0e+'/'+_0xe109e7)[_0x693b('0x21')](_0x4215a3);}return null;};}function patchUpdates(_0x4174e8){return function(_0x3780a1){try{jsonpatch['apply'](_0x3780a1,_0x4174e8,!![]);}catch(_0x102b1f){return BPromise[_0x693b('0x28')](_0x102b1f);}return _0x3780a1['save']();};}function saveUpdates(_0x443cdf,_0x440f3e){return function(_0x161e67){if(_0x161e67){return _0x161e67['update'](_0x443cdf)[_0x693b('0x29')](function(_0x3267a8){return _0x3267a8;});}return null;};}function removeEntity(_0x31ab0b,_0x288082){return function(_0x54d3c7){if(_0x54d3c7){return _0x54d3c7[_0x693b('0x2a')]()[_0x693b('0x29')](function(){var _0x1597ea=_0x54d3c7[_0x693b('0x2b')]({'plain':!![]});var _0x6fd398=_0x693b('0x2c');return db[_0x693b('0x2d')]['destroy']({'where':{'type':_0x6fd398,'resourceId':_0x1597ea['id']}})['then'](function(){return _0x54d3c7;});})[_0x693b('0x29')](function(){_0x31ab0b[_0x693b('0x1f')](0xcc)[_0x693b('0x20')]();});}};}function handleEntityNotFound(_0x39d3ac,_0xdf7888){return function(_0x41d63a){if(!_0x41d63a){_0x39d3ac['sendStatus'](0x194);}return _0x41d63a;};}function handleError(_0x1b7917,_0x4db555){_0x4db555=_0x4db555||0x1f4;return function(_0x404512){logger[_0x693b('0x2e')](_0x404512[_0x693b('0x2f')]);if(_0x404512[_0x693b('0x30')]){delete _0x404512[_0x693b('0x30')];}_0x1b7917[_0x693b('0x1f')](_0x4db555)[_0x693b('0x31')](_0x404512);};}exports[_0x693b('0x32')]=function(_0x1f23b9,_0x1c92d6){var _0x43a46f={},_0x2ee025={},_0xc07ce6={'count':0x0,'rows':[]};var _0xddf4d0=_[_0x693b('0x33')](db[_0x693b('0x34')][_0x693b('0x35')],function(_0x42ec88){return{'name':_0x42ec88[_0x693b('0x36')],'type':_0x42ec88['type'][_0x693b('0x37')]};});_0x2ee025[_0x693b('0x38')]=_[_0x693b('0x33')](_0xddf4d0,_0x693b('0x30'));_0x2ee025[_0x693b('0x39')]=_[_0x693b('0x3a')](_0x1f23b9[_0x693b('0x39')]);_0x2ee025[_0x693b('0x3b')]=_[_0x693b('0x3c')](_0x2ee025[_0x693b('0x38')],_0x2ee025[_0x693b('0x39')]);_0x43a46f[_0x693b('0x3d')]=_[_0x693b('0x3c')](_0x2ee025[_0x693b('0x38')],qs[_0x693b('0x3e')](_0x1f23b9[_0x693b('0x39')]['fields']));_0x43a46f[_0x693b('0x3d')]=_0x43a46f[_0x693b('0x3d')][_0x693b('0x3f')]?_0x43a46f[_0x693b('0x3d')]:_0x2ee025['model'];if(!_0x1f23b9['query'][_0x693b('0x40')](_0x693b('0x41'))){_0x43a46f[_0x693b('0x25')]=qs['limit'](_0x1f23b9[_0x693b('0x39')][_0x693b('0x25')]);_0x43a46f[_0x693b('0x22')]=qs[_0x693b('0x22')](_0x1f23b9['query']['offset']);}_0x43a46f[_0x693b('0x42')]=qs['sort'](_0x1f23b9[_0x693b('0x39')]['sort']);_0x43a46f[_0x693b('0x43')]=qs[_0x693b('0x3b')](_[_0x693b('0x44')](_0x1f23b9[_0x693b('0x39')],_0x2ee025['filters']),_0xddf4d0);if(_0x1f23b9[_0x693b('0x39')][_0x693b('0x45')]){_0x43a46f[_0x693b('0x43')]=_[_0x693b('0x46')](_0x43a46f[_0x693b('0x43')],{'$or':_['map'](_0xddf4d0,function(_0x5d6087){if(_0x5d6087['type']!=='VIRTUAL'){var _0x40eede={};_0x40eede[_0x5d6087[_0x693b('0x30')]]={'$like':'%'+_0x1f23b9['query'][_0x693b('0x45')]+'%'};return _0x40eede;}})});}_0x43a46f=_['merge']({},_0x43a46f,_0x1f23b9[_0x693b('0x47')]);var _0x1e7a49={'where':_0x43a46f[_0x693b('0x43')]};return db[_0x693b('0x34')][_0x693b('0x24')](_0x1e7a49)[_0x693b('0x29')](function(_0x5e38d9){_0xc07ce6['count']=_0x5e38d9;if(_0x1f23b9[_0x693b('0x39')][_0x693b('0x48')]){_0x43a46f[_0x693b('0x49')]=[{'all':!![]}];}return db['Dashboard'][_0x693b('0x4a')](_0x43a46f);})['then'](function(_0x1b1255){_0xc07ce6[_0x693b('0x4b')]=_0x1b1255;return _0xc07ce6;})['then'](respondWithFilteredResult(_0x1c92d6,_0x43a46f))[_0x693b('0x4c')](handleError(_0x1c92d6,null));};exports[_0x693b('0x4d')]=function(_0x2f0439,_0x59ae55){var _0x2dcf25={'raw':![],'where':{'id':_0x2f0439[_0x693b('0x4e')]['id']}},_0x46b2df={};_0x46b2df[_0x693b('0x38')]=_['keys'](db[_0x693b('0x34')][_0x693b('0x35')]);_0x46b2df[_0x693b('0x39')]=_['keys'](_0x2f0439[_0x693b('0x39')]);_0x46b2df[_0x693b('0x3b')]=_[_0x693b('0x3c')](_0x46b2df['model'],_0x46b2df[_0x693b('0x39')]);_0x2dcf25['attributes']=_['intersection'](_0x46b2df[_0x693b('0x38')],qs[_0x693b('0x3e')](_0x2f0439[_0x693b('0x39')]['fields']));_0x2dcf25[_0x693b('0x3d')]=_0x2dcf25[_0x693b('0x3d')][_0x693b('0x3f')]?_0x2dcf25[_0x693b('0x3d')]:_0x46b2df['model'];if(_0x2f0439['query'][_0x693b('0x48')]){_0x2dcf25[_0x693b('0x49')]=[{'all':!![]}];}_0x2dcf25=_[_0x693b('0x46')]({},_0x2dcf25,_0x2f0439[_0x693b('0x47')]);return db[_0x693b('0x34')][_0x693b('0x4f')](_0x2dcf25)[_0x693b('0x29')](handleEntityNotFound(_0x59ae55,null))[_0x693b('0x29')](respondWithResult(_0x59ae55,null))[_0x693b('0x4c')](handleError(_0x59ae55,null));};exports[_0x693b('0x50')]=function(_0xbdce63,_0x3e23db){return db[_0x693b('0x34')][_0x693b('0x50')](_0xbdce63[_0x693b('0x51')],{})['then'](function(_0x4b85a7){var _0x4f0eb5=_0xbdce63[_0x693b('0x52')][_0x693b('0x2b')]({'plain':!![]});if(!_0x4f0eb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f0eb5[_0x693b('0x53')]===_0x693b('0x52')){var _0x201895=_0x4b85a7[_0x693b('0x2b')]({'plain':!![]});var _0x119a3f=_0x693b('0x2c');return db[_0x693b('0x54')][_0x693b('0x4f')]({'where':{'name':_0x119a3f,'userProfileId':_0x4f0eb5[_0x693b('0x55')]},'raw':!![]})[_0x693b('0x29')](function(_0x326806){if(_0x326806&&_0x326806[_0x693b('0x56')]===0x0){return db[_0x693b('0x2d')]['create']({'name':_0x201895[_0x693b('0x30')],'resourceId':_0x201895['id'],'type':_0x326806[_0x693b('0x30')],'sectionId':_0x326806['id']},{})[_0x693b('0x29')](function(){return _0x4b85a7;});}else{return _0x4b85a7;}})['catch'](function(_0x1ad078){logger[_0x693b('0x2e')](_0x693b('0x57'),_0x1ad078);throw _0x1ad078;});}return _0x4b85a7;})[_0x693b('0x29')](respondWithResult(_0x3e23db,0xc9))[_0x693b('0x4c')](handleError(_0x3e23db,null));};exports[_0x693b('0x58')]=function(_0xc4f21e,_0x279373){var _0x11ce2b={'where':{'id':_0xc4f21e[_0x693b('0x4e')]['id']}},_0x5aedf6={};_0x5aedf6[_0x693b('0x38')]=_['keys'](db[_0x693b('0x34')][_0x693b('0x35')]);_0x11ce2b[_0x693b('0x3d')]=_[_0x693b('0x3c')](_0x5aedf6[_0x693b('0x38')],qs['fields'](_0xc4f21e[_0x693b('0x39')][_0x693b('0x3e')]));_0x11ce2b[_0x693b('0x3d')]=_0x11ce2b[_0x693b('0x3d')][_0x693b('0x3f')]?_0x11ce2b[_0x693b('0x3d')]:_0x5aedf6['model'];if(_0xc4f21e[_0x693b('0x39')][_0x693b('0x48')]){_0x11ce2b[_0x693b('0x49')]=[{'all':!![]}];}_0x11ce2b=_[_0x693b('0x46')]({},_0x11ce2b,_0xc4f21e[_0x693b('0x47')]);return db[_0x693b('0x34')][_0x693b('0x4f')](_0x11ce2b)['then'](handleEntityNotFound(_0x279373,null))[_0x693b('0x29')](function(_0x57bce1){if(_0x57bce1){var _0x167415=_0x57bce1[_0x693b('0x2b')]({'plain':!![]});_0x167415=qs[_0x693b('0x59')](_0x167415,['id',_0x693b('0x5a'),_0x693b('0x5b')]);_0xc4f21e[_0x693b('0x51')]=_[_0x693b('0x59')](_0xc4f21e['body'],['id','createdAt','updatedAt']);return db[_0x693b('0x34')][_0x693b('0x50')](_['merge'](_0x167415,_0xc4f21e[_0x693b('0x51')]),{'include':_0xc4f21e[_0x693b('0x39')][_0x693b('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x2a14e9){var _0x42aeb3=_0xc4f21e[_0x693b('0x52')]['get']({'plain':!![]});if(!_0x42aeb3)throw new Error(_0x693b('0x5c'));if(_0x42aeb3[_0x693b('0x53')]==='user'){var _0x8daaa0=_0x2a14e9[_0x693b('0x2b')]({'plain':!![]});var _0x4d7399=_0x693b('0x2c');return db['UserProfileSection'][_0x693b('0x4f')]({'where':{'name':_0x4d7399,'userProfileId':_0x42aeb3[_0x693b('0x55')]},'raw':!![]})[_0x693b('0x29')](function(_0x4df62d){if(_0x4df62d&&_0x4df62d[_0x693b('0x56')]===0x0){return db['UserProfileResource'][_0x693b('0x50')]({'name':_0x8daaa0[_0x693b('0x30')],'resourceId':_0x8daaa0['id'],'type':_0x4df62d[_0x693b('0x30')],'sectionId':_0x4df62d['id']},{})[_0x693b('0x29')](function(){return _0x2a14e9;});}else{return _0x2a14e9;}})['catch'](function(_0x1fa3d0){logger[_0x693b('0x2e')](_0x693b('0x57'),_0x1fa3d0);throw _0x1fa3d0;});}return _0x2a14e9;});}})['then'](respondWithResult(_0x279373,0xc9))[_0x693b('0x4c')](handleError(_0x279373,null));};exports[_0x693b('0x5d')]=function(_0x555de4,_0x2a1b80){if(_0x555de4['body']['id']){delete _0x555de4[_0x693b('0x51')]['id'];}return db[_0x693b('0x34')]['find']({'where':{'id':_0x555de4['params']['id']}})[_0x693b('0x29')](handleEntityNotFound(_0x2a1b80,null))[_0x693b('0x29')](saveUpdates(_0x555de4['body'],null))[_0x693b('0x29')](respondWithResult(_0x2a1b80,null))[_0x693b('0x4c')](handleError(_0x2a1b80,null));};exports[_0x693b('0x2a')]=function(_0x1b3877,_0x279600){return db[_0x693b('0x34')][_0x693b('0x4f')]({'where':{'id':_0x1b3877[_0x693b('0x4e')]['id']}})[_0x693b('0x29')](handleEntityNotFound(_0x279600,null))[_0x693b('0x29')](removeEntity(_0x279600,null))['catch'](handleError(_0x279600,null));};function widgetAttributes(_0x239512){try{switch(_0x239512['type']){case'iframe':return[{'name':'attrUrl','value':_0x239512[_0x693b('0x5e')]||(_0x239512[_0x693b('0x5f')]&&_0x239512[_0x693b('0x5f')][0x0]?_0x239512[_0x693b('0x5f')][0x0]['value']:undefined)||_0x693b('0x60')}];case _0x693b('0x61'):return[{'name':_0x693b('0x62'),'value':_0x239512['attrPath']||(_0x239512['attrs']&&_0x239512['attrs'][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x63')]:undefined)||''}];case _0x693b('0x64'):return[{'name':_0x693b('0x65'),'value':_0x239512[_0x693b('0x65')]||(_0x239512['attrs']&&_0x239512[_0x693b('0x5f')][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x63')]:undefined)||'HH:mm:ss'},{'name':_0x693b('0x66'),'value':_0x239512[_0x693b('0x66')]||(_0x239512[_0x693b('0x5f')]&&_0x239512[_0x693b('0x5f')][0x1]?_0x239512[_0x693b('0x5f')][0x1][_0x693b('0x63')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x239512[_0x693b('0x67')]||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x2]?_0x239512[_0x693b('0x5f')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x693b('0x68'),'value':_0x239512[_0x693b('0x68')]||(_0x239512['attrs']&&_0x239512[_0x693b('0x5f')][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x63')]:undefined)||_0x693b('0x69')},{'name':'attrVoiceQueues','value':_0x239512[_0x693b('0x6a')]||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x1]?_0x239512[_0x693b('0x5f')][0x1][_0x693b('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x239512[_0x693b('0x67')]||(_0x239512[_0x693b('0x5f')]&&_0x239512[_0x693b('0x5f')][0x2]?_0x239512[_0x693b('0x5f')][0x2][_0x693b('0x63')]:undefined)||0x14}];case _0x693b('0x6b'):case _0x693b('0x6c'):return[{'name':_0x693b('0x6d'),'value':_0x239512['attrSerie1']||(_0x239512[_0x693b('0x5f')]&&_0x239512[_0x693b('0x5f')][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x63')]:undefined)||_0x693b('0x69')},{'name':'attrSerie2','value':_0x239512[_0x693b('0x6e')]||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x1]?_0x239512[_0x693b('0x5f')][0x1][_0x693b('0x63')]:undefined)||null},{'name':_0x693b('0x6f'),'value':_0x239512[_0x693b('0x6f')]||(_0x239512['attrs']&&_0x239512[_0x693b('0x5f')][0x2]?_0x239512[_0x693b('0x5f')][0x2][_0x693b('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x239512[_0x693b('0x6a')]||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x3]?_0x239512[_0x693b('0x5f')][0x3]['value']:undefined)||[]}];case _0x693b('0x70'):return[{'name':_0x693b('0x71'),'type':_0x239512[_0x693b('0x72')]||(_0x239512[_0x693b('0x5f')]&&_0x239512[_0x693b('0x5f')][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x73')]:undefined)||null,'value':_0x239512['attrReport']||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x0]?_0x239512[_0x693b('0x5f')][0x0][_0x693b('0x63')]:undefined)||null},{'name':_0x693b('0x74'),'value':_0x239512[_0x693b('0x74')]||(_0x239512[_0x693b('0x5f')]&&_0x239512['attrs'][0x1]?_0x239512[_0x693b('0x5f')][0x1][_0x693b('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x5bb52d){logger[_0x693b('0x2e')](_0x693b('0x75'),JSON[_0x693b('0x76')](_0x5bb52d));return[];}}exports[_0x693b('0x77')]=function(_0x2099e0,_0x1d05f3,_0x1f660d){if(_0x2099e0[_0x693b('0x51')]['id']){delete _0x2099e0[_0x693b('0x51')]['id'];}return db[_0x693b('0x34')][_0x693b('0x4f')]({'where':{'id':_0x2099e0['params']['id']}})['then'](handleEntityNotFound(_0x1d05f3,null))[_0x693b('0x29')](function(_0x3731c5){if(_0x3731c5){_0x2099e0[_0x693b('0x51')][_0x693b('0x78')]=_0x3731c5['id'];_0x2099e0[_0x693b('0x51')][_0x693b('0x5f')]=widgetAttributes(_0x2099e0[_0x693b('0x51')]);return db[_0x693b('0x79')][_0x693b('0x50')](_0x2099e0['body']);}})[_0x693b('0x29')](respondWithResult(_0x1d05f3,null))[_0x693b('0x4c')](handleError(_0x1d05f3,null));};exports[_0x693b('0x7a')]=function(_0x2f568e,_0x12f94d,_0x4e28b5){var _0xd5963d={};var _0xe72bcc={};var _0x4949be;var _0x5c6061;return db[_0x693b('0x34')][_0x693b('0x7b')]({'where':{'id':_0x2f568e[_0x693b('0x4e')]['id']}})[_0x693b('0x29')](handleEntityNotFound(_0x12f94d,null))[_0x693b('0x29')](function(_0x268c39){if(_0x268c39){_0x4949be=_0x268c39;_0xe72bcc[_0x693b('0x38')]=_[_0x693b('0x3a')](db[_0x693b('0x79')][_0x693b('0x35')]);_0xe72bcc[_0x693b('0x39')]=_[_0x693b('0x3a')](_0x2f568e['query']);_0xe72bcc[_0x693b('0x3b')]=_[_0x693b('0x3c')](_0xe72bcc['model'],_0xe72bcc[_0x693b('0x39')]);_0xd5963d[_0x693b('0x3d')]=_[_0x693b('0x3c')](_0xe72bcc[_0x693b('0x38')],qs['fields'](_0x2f568e[_0x693b('0x39')][_0x693b('0x3e')]));_0xd5963d[_0x693b('0x3d')]=_0xd5963d[_0x693b('0x3d')][_0x693b('0x3f')]?_0xd5963d[_0x693b('0x3d')]:_0xe72bcc[_0x693b('0x38')];_0xd5963d[_0x693b('0x42')]=qs[_0x693b('0x7c')](_0x2f568e[_0x693b('0x39')][_0x693b('0x7c')]);_0xd5963d['where']=qs[_0x693b('0x3b')](_['pick'](_0x2f568e[_0x693b('0x39')],_0xe72bcc[_0x693b('0x3b')]));if(_0x2f568e[_0x693b('0x39')][_0x693b('0x45')]){_0xd5963d[_0x693b('0x43')]=_[_0x693b('0x46')](_0xd5963d[_0x693b('0x43')],{'$or':_[_0x693b('0x33')](_0xd5963d[_0x693b('0x3d')],function(_0x5cd7be){var _0x2d0557={};_0x2d0557[_0x5cd7be]={'$like':'%'+_0x2f568e[_0x693b('0x39')][_0x693b('0x45')]+'%'};return _0x2d0557;})});}_0xd5963d=_[_0x693b('0x46')]({},_0xd5963d,_0x2f568e[_0x693b('0x47')]);return _0x4949be[_0x693b('0x7a')](_0xd5963d);}})['then'](function(_0x40ebf7){if(_0x40ebf7){_0x5c6061=_0x40ebf7[_0x693b('0x3f')];if(!_0x2f568e[_0x693b('0x39')][_0x693b('0x40')](_0x693b('0x41'))){_0xd5963d[_0x693b('0x25')]=qs[_0x693b('0x25')](_0x2f568e[_0x693b('0x39')][_0x693b('0x25')]);_0xd5963d[_0x693b('0x22')]=qs[_0x693b('0x22')](_0x2f568e['query'][_0x693b('0x22')]);}return _0x4949be[_0x693b('0x7a')](_0xd5963d);}})[_0x693b('0x29')](function(_0x399f26){if(_0x399f26){return _0x399f26?{'count':_0x5c6061,'rows':_0x399f26}:null;}})[_0x693b('0x29')](respondWithResult(_0x12f94d,null))[_0x693b('0x4c')](handleError(_0x12f94d,null));}; \ No newline at end of file +var _0xbcc0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','./dashboard.socket','register','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','end','stack','send','Dashboard','rawAttributes','fieldName','model','map','name','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','show','params','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','UserProfileSection','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','findOne','getItems','nolimit','eml-format'];(function(_0x439110,_0x1ff60c){var _0x38bb50=function(_0x29b54b){while(--_0x29b54b){_0x439110['push'](_0x439110['shift']());}};_0x38bb50(++_0x1ff60c);}(_0xbcc0,0xed));var _0x0bcc=function(_0x406727,_0x5dfb85){_0x406727=_0x406727-0x0;var _0x31e55e=_0xbcc0[_0x406727];return _0x31e55e;};'use strict';var emlformat=require(_0x0bcc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bcc('0x1'));var jsonpatch=require(_0x0bcc('0x2'));var rp=require(_0x0bcc('0x3'));var moment=require(_0x0bcc('0x4'));var BPromise=require(_0x0bcc('0x5'));var Mustache=require('mustache');var util=require(_0x0bcc('0x6'));var path=require(_0x0bcc('0x7'));var sox=require(_0x0bcc('0x8'));var csv=require(_0x0bcc('0x9'));var ejs=require(_0x0bcc('0xa'));var fs=require('fs');var fs_extra=require(_0x0bcc('0xb'));var _=require(_0x0bcc('0xc'));var squel=require(_0x0bcc('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bcc('0xe'));var deskjs=require(_0x0bcc('0xf'));var toCsv=require(_0x0bcc('0x9'));var querystring=require(_0x0bcc('0x10'));var Papa=require('papaparse');var Redis=require(_0x0bcc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bcc('0x12'));var hardwareService=require(_0x0bcc('0x13'));var logger=require(_0x0bcc('0x14'))(_0x0bcc('0x15'));var utils=require('../../config/utils');var config=require(_0x0bcc('0x16'));var licenseUtil=require(_0x0bcc('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0bcc('0x18')](config[_0x0bcc('0x19')],{'host':_0x0bcc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0bcc('0x1b'))[_0x0bcc('0x1c')](socket);function respondWithStatusCode(_0x46d5c2,_0x5c5a44){_0x5c5a44=_0x5c5a44||0xcc;return function(_0x4fa094){if(_0x4fa094){return _0x46d5c2[_0x0bcc('0x1d')](_0x5c5a44);}return _0x46d5c2['status'](_0x5c5a44)['end']();};}function respondWithResult(_0x5e3167,_0x4ed9ba){_0x4ed9ba=_0x4ed9ba||0xc8;return function(_0x394d16){if(_0x394d16){return _0x5e3167[_0x0bcc('0x1e')](_0x4ed9ba)['json'](_0x394d16);}};}function respondWithFilteredResult(_0x6a618,_0x14af4d){return function(_0x2a9c3a){if(_0x2a9c3a){var _0x11c159=typeof _0x14af4d[_0x0bcc('0x1f')]===_0x0bcc('0x20')&&typeof _0x14af4d['limit']===_0x0bcc('0x20');var _0x50aa00=_0x2a9c3a[_0x0bcc('0x21')];var _0x45d8a7=_0x11c159?0x0:_0x14af4d['offset'];var _0x353f23=_0x11c159?_0x2a9c3a[_0x0bcc('0x21')]:_0x14af4d[_0x0bcc('0x1f')]+_0x14af4d['limit'];var _0x5082ff;if(_0x353f23>=_0x50aa00){_0x353f23=_0x50aa00;_0x5082ff=0xc8;}else{_0x5082ff=0xce;}_0x6a618[_0x0bcc('0x1e')](_0x5082ff);return _0x6a618[_0x0bcc('0x22')](_0x0bcc('0x23'),_0x45d8a7+'-'+_0x353f23+'/'+_0x50aa00)[_0x0bcc('0x24')](_0x2a9c3a);}return null;};}function patchUpdates(_0xd06314){return function(_0x16612b){try{jsonpatch['apply'](_0x16612b,_0xd06314,!![]);}catch(_0xf68f66){return BPromise[_0x0bcc('0x25')](_0xf68f66);}return _0x16612b[_0x0bcc('0x26')]();};}function saveUpdates(_0x2fc183,_0x5856ef){return function(_0x2ab5dc){if(_0x2ab5dc){return _0x2ab5dc[_0x0bcc('0x27')](_0x2fc183)[_0x0bcc('0x28')](function(_0x2c56ec){return _0x2c56ec;});}return null;};}function removeEntity(_0x424561,_0x55a370){return function(_0x3875f3){if(_0x3875f3){return _0x3875f3[_0x0bcc('0x29')]()['then'](function(){var _0x1c0836=_0x3875f3['get']({'plain':!![]});var _0x3f33a7=_0x0bcc('0x2a');return db[_0x0bcc('0x2b')][_0x0bcc('0x29')]({'where':{'type':_0x3f33a7,'resourceId':_0x1c0836['id']}})[_0x0bcc('0x28')](function(){return _0x3875f3;});})[_0x0bcc('0x28')](function(){_0x424561[_0x0bcc('0x1e')](0xcc)[_0x0bcc('0x2c')]();});}};}function handleEntityNotFound(_0x5a0b6d,_0x2f667b){return function(_0xa31ed5){if(!_0xa31ed5){_0x5a0b6d[_0x0bcc('0x1d')](0x194);}return _0xa31ed5;};}function handleError(_0x2e147d,_0x2a97a7){_0x2a97a7=_0x2a97a7||0x1f4;return function(_0x32ef9f){logger['error'](_0x32ef9f[_0x0bcc('0x2d')]);if(_0x32ef9f['name']){delete _0x32ef9f['name'];}_0x2e147d[_0x0bcc('0x1e')](_0x2a97a7)[_0x0bcc('0x2e')](_0x32ef9f);};}exports['index']=function(_0x59b7f2,_0x57478b){var _0x7743c1={},_0x388118={},_0x5af5c3={'count':0x0,'rows':[]};var _0x21cf4d=_['map'](db[_0x0bcc('0x2f')][_0x0bcc('0x30')],function(_0x5614f4){return{'name':_0x5614f4[_0x0bcc('0x31')],'type':_0x5614f4['type']['key']};});_0x388118[_0x0bcc('0x32')]=_[_0x0bcc('0x33')](_0x21cf4d,_0x0bcc('0x34'));_0x388118['query']=_[_0x0bcc('0x35')](_0x59b7f2[_0x0bcc('0x36')]);_0x388118[_0x0bcc('0x37')]=_[_0x0bcc('0x38')](_0x388118['model'],_0x388118['query']);_0x7743c1['attributes']=_[_0x0bcc('0x38')](_0x388118['model'],qs[_0x0bcc('0x39')](_0x59b7f2[_0x0bcc('0x36')][_0x0bcc('0x39')]));_0x7743c1[_0x0bcc('0x3a')]=_0x7743c1[_0x0bcc('0x3a')]['length']?_0x7743c1['attributes']:_0x388118[_0x0bcc('0x32')];if(!_0x59b7f2['query'][_0x0bcc('0x3b')]('nolimit')){_0x7743c1[_0x0bcc('0x3c')]=qs[_0x0bcc('0x3c')](_0x59b7f2['query'][_0x0bcc('0x3c')]);_0x7743c1['offset']=qs['offset'](_0x59b7f2[_0x0bcc('0x36')][_0x0bcc('0x1f')]);}_0x7743c1[_0x0bcc('0x3d')]=qs[_0x0bcc('0x3e')](_0x59b7f2[_0x0bcc('0x36')]['sort']);_0x7743c1[_0x0bcc('0x3f')]=qs[_0x0bcc('0x37')](_[_0x0bcc('0x40')](_0x59b7f2[_0x0bcc('0x36')],_0x388118[_0x0bcc('0x37')]),_0x21cf4d);if(_0x59b7f2[_0x0bcc('0x36')][_0x0bcc('0x41')]){_0x7743c1['where']=_[_0x0bcc('0x42')](_0x7743c1['where'],{'$or':_['map'](_0x21cf4d,function(_0x330741){if(_0x330741[_0x0bcc('0x43')]!==_0x0bcc('0x44')){var _0x55969b={};_0x55969b[_0x330741['name']]={'$like':'%'+_0x59b7f2[_0x0bcc('0x36')][_0x0bcc('0x41')]+'%'};return _0x55969b;}})});}_0x7743c1=_[_0x0bcc('0x42')]({},_0x7743c1,_0x59b7f2[_0x0bcc('0x45')]);var _0x1a57a0={'where':_0x7743c1[_0x0bcc('0x3f')]};return db[_0x0bcc('0x2f')][_0x0bcc('0x21')](_0x1a57a0)[_0x0bcc('0x28')](function(_0x233b02){_0x5af5c3[_0x0bcc('0x21')]=_0x233b02;if(_0x59b7f2[_0x0bcc('0x36')][_0x0bcc('0x46')]){_0x7743c1['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x7743c1);})[_0x0bcc('0x28')](function(_0x484759){_0x5af5c3['rows']=_0x484759;return _0x5af5c3;})['then'](respondWithFilteredResult(_0x57478b,_0x7743c1))['catch'](handleError(_0x57478b,null));};exports[_0x0bcc('0x47')]=function(_0xd662a3,_0x14ced5){var _0x4984cf={'raw':![],'where':{'id':_0xd662a3[_0x0bcc('0x48')]['id']}},_0x5c30a7={};_0x5c30a7[_0x0bcc('0x32')]=_[_0x0bcc('0x35')](db[_0x0bcc('0x2f')][_0x0bcc('0x30')]);_0x5c30a7[_0x0bcc('0x36')]=_[_0x0bcc('0x35')](_0xd662a3[_0x0bcc('0x36')]);_0x5c30a7[_0x0bcc('0x37')]=_[_0x0bcc('0x38')](_0x5c30a7[_0x0bcc('0x32')],_0x5c30a7[_0x0bcc('0x36')]);_0x4984cf[_0x0bcc('0x3a')]=_['intersection'](_0x5c30a7[_0x0bcc('0x32')],qs[_0x0bcc('0x39')](_0xd662a3['query'][_0x0bcc('0x39')]));_0x4984cf['attributes']=_0x4984cf[_0x0bcc('0x3a')][_0x0bcc('0x49')]?_0x4984cf['attributes']:_0x5c30a7[_0x0bcc('0x32')];if(_0xd662a3[_0x0bcc('0x36')][_0x0bcc('0x46')]){_0x4984cf[_0x0bcc('0x4a')]=[{'all':!![]}];}_0x4984cf=_[_0x0bcc('0x42')]({},_0x4984cf,_0xd662a3[_0x0bcc('0x45')]);return db['Dashboard'][_0x0bcc('0x4b')](_0x4984cf)[_0x0bcc('0x28')](handleEntityNotFound(_0x14ced5,null))[_0x0bcc('0x28')](respondWithResult(_0x14ced5,null))['catch'](handleError(_0x14ced5,null));};exports['create']=function(_0x5a193d,_0x3c240a){return db['Dashboard'][_0x0bcc('0x4c')](_0x5a193d[_0x0bcc('0x4d')],{})['then'](function(_0x986d53){var _0x4302d3=_0x5a193d[_0x0bcc('0x4e')][_0x0bcc('0x4f')]({'plain':!![]});if(!_0x4302d3)throw new Error(_0x0bcc('0x50'));if(_0x4302d3['role']===_0x0bcc('0x4e')){var _0x5a1dad=_0x986d53[_0x0bcc('0x4f')]({'plain':!![]});var _0x25c3ef=_0x0bcc('0x2a');return db['UserProfileSection'][_0x0bcc('0x4b')]({'where':{'name':_0x25c3ef,'userProfileId':_0x4302d3[_0x0bcc('0x51')]},'raw':!![]})[_0x0bcc('0x28')](function(_0x4d88a6){if(_0x4d88a6&&_0x4d88a6['autoAssociation']===0x0){return db['UserProfileResource'][_0x0bcc('0x4c')]({'name':_0x5a1dad[_0x0bcc('0x34')],'resourceId':_0x5a1dad['id'],'type':_0x4d88a6[_0x0bcc('0x34')],'sectionId':_0x4d88a6['id']},{})[_0x0bcc('0x28')](function(){return _0x986d53;});}else{return _0x986d53;}})[_0x0bcc('0x52')](function(_0x496ba0){logger[_0x0bcc('0x53')](_0x0bcc('0x54'),_0x496ba0);throw _0x496ba0;});}return _0x986d53;})[_0x0bcc('0x28')](respondWithResult(_0x3c240a,0xc9))[_0x0bcc('0x52')](handleError(_0x3c240a,null));};exports[_0x0bcc('0x55')]=function(_0x9523c,_0x5f0f33){var _0x12c47a={'where':{'id':_0x9523c[_0x0bcc('0x48')]['id']}},_0xce7ee5={};_0xce7ee5[_0x0bcc('0x32')]=_[_0x0bcc('0x35')](db[_0x0bcc('0x2f')]['rawAttributes']);_0x12c47a[_0x0bcc('0x3a')]=_[_0x0bcc('0x38')](_0xce7ee5['model'],qs['fields'](_0x9523c[_0x0bcc('0x36')][_0x0bcc('0x39')]));_0x12c47a[_0x0bcc('0x3a')]=_0x12c47a[_0x0bcc('0x3a')][_0x0bcc('0x49')]?_0x12c47a[_0x0bcc('0x3a')]:_0xce7ee5[_0x0bcc('0x32')];if(_0x9523c[_0x0bcc('0x36')][_0x0bcc('0x46')]){_0x12c47a['include']=[{'all':!![]}];}_0x12c47a=_[_0x0bcc('0x42')]({},_0x12c47a,_0x9523c[_0x0bcc('0x45')]);return db[_0x0bcc('0x2f')][_0x0bcc('0x4b')](_0x12c47a)[_0x0bcc('0x28')](handleEntityNotFound(_0x5f0f33,null))['then'](function(_0x3c5683){if(_0x3c5683){var _0x488eae=_0x3c5683[_0x0bcc('0x4f')]({'plain':!![]});_0x488eae=qs['omit'](_0x488eae,['id',_0x0bcc('0x56'),'updatedAt']);_0x9523c[_0x0bcc('0x4d')]=_[_0x0bcc('0x57')](_0x9523c[_0x0bcc('0x4d')],['id',_0x0bcc('0x56'),_0x0bcc('0x58')]);return db[_0x0bcc('0x2f')][_0x0bcc('0x4c')](_[_0x0bcc('0x42')](_0x488eae,_0x9523c[_0x0bcc('0x4d')]),{'include':_0x9523c[_0x0bcc('0x36')][_0x0bcc('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x550cfa){var _0x2dfcb9=_0x9523c[_0x0bcc('0x4e')]['get']({'plain':!![]});if(!_0x2dfcb9)throw new Error(_0x0bcc('0x50'));if(_0x2dfcb9['role']===_0x0bcc('0x4e')){var _0x2e865d=_0x550cfa[_0x0bcc('0x4f')]({'plain':!![]});var _0x52587c=_0x0bcc('0x2a');return db[_0x0bcc('0x59')][_0x0bcc('0x4b')]({'where':{'name':_0x52587c,'userProfileId':_0x2dfcb9['userProfileId']},'raw':!![]})['then'](function(_0x25b6a0){if(_0x25b6a0&&_0x25b6a0[_0x0bcc('0x5a')]===0x0){return db[_0x0bcc('0x2b')]['create']({'name':_0x2e865d[_0x0bcc('0x34')],'resourceId':_0x2e865d['id'],'type':_0x25b6a0[_0x0bcc('0x34')],'sectionId':_0x25b6a0['id']},{})[_0x0bcc('0x28')](function(){return _0x550cfa;});}else{return _0x550cfa;}})['catch'](function(_0x5c00ba){logger[_0x0bcc('0x53')](_0x0bcc('0x54'),_0x5c00ba);throw _0x5c00ba;});}return _0x550cfa;});}})[_0x0bcc('0x28')](respondWithResult(_0x5f0f33,0xc9))['catch'](handleError(_0x5f0f33,null));};exports[_0x0bcc('0x27')]=function(_0x6aee65,_0x34b5c1){if(_0x6aee65[_0x0bcc('0x4d')]['id']){delete _0x6aee65[_0x0bcc('0x4d')]['id'];}return db['Dashboard'][_0x0bcc('0x4b')]({'where':{'id':_0x6aee65[_0x0bcc('0x48')]['id']}})[_0x0bcc('0x28')](handleEntityNotFound(_0x34b5c1,null))[_0x0bcc('0x28')](saveUpdates(_0x6aee65[_0x0bcc('0x4d')],null))[_0x0bcc('0x28')](respondWithResult(_0x34b5c1,null))['catch'](handleError(_0x34b5c1,null));};exports[_0x0bcc('0x29')]=function(_0x5c7b6b,_0x1987c6){return db[_0x0bcc('0x2f')][_0x0bcc('0x4b')]({'where':{'id':_0x5c7b6b[_0x0bcc('0x48')]['id']}})[_0x0bcc('0x28')](handleEntityNotFound(_0x1987c6,null))['then'](removeEntity(_0x1987c6,null))[_0x0bcc('0x52')](handleError(_0x1987c6,null));};function widgetAttributes(_0xf45355){try{switch(_0xf45355['type']){case _0x0bcc('0x5b'):return[{'name':_0x0bcc('0x5c'),'value':_0xf45355['attrUrl']||(_0xf45355['attrs']&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355[_0x0bcc('0x5d')][0x0][_0x0bcc('0x5e')]:undefined)||'https://'}];case _0x0bcc('0x5f'):return[{'name':_0x0bcc('0x60'),'value':_0xf45355[_0x0bcc('0x60')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355[_0x0bcc('0x5d')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x0bcc('0x61'),'value':_0xf45355[_0x0bcc('0x61')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355['attrs'][0x0][_0x0bcc('0x5e')]:undefined)||_0x0bcc('0x62')},{'name':_0x0bcc('0x63'),'value':_0xf45355[_0x0bcc('0x63')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355['attrs'][0x1]?_0xf45355['attrs'][0x1]['value']:undefined)||_0x0bcc('0x64')},{'name':_0x0bcc('0x65'),'value':_0xf45355[_0x0bcc('0x65')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x2]?_0xf45355['attrs'][0x2][_0x0bcc('0x5e')]:undefined)||0xc}];case'counter':return[{'name':_0x0bcc('0x66'),'value':_0xf45355[_0x0bcc('0x66')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355['attrs'][0x0]?_0xf45355[_0x0bcc('0x5d')][0x0]['value']:undefined)||_0x0bcc('0x67')},{'name':'attrVoiceQueues','value':_0xf45355[_0x0bcc('0x68')]||(_0xf45355['attrs']&&_0xf45355[_0x0bcc('0x5d')][0x1]?_0xf45355[_0x0bcc('0x5d')][0x1][_0x0bcc('0x5e')]:undefined)||[]},{'name':_0x0bcc('0x65'),'value':_0xf45355['attrFontSize']||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x2]?_0xf45355['attrs'][0x2][_0x0bcc('0x5e')]:undefined)||0x14}];case _0x0bcc('0x69'):case _0x0bcc('0x6a'):return[{'name':_0x0bcc('0x6b'),'value':_0xf45355[_0x0bcc('0x6b')]||(_0xf45355['attrs']&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355['attrs'][0x0]['value']:undefined)||_0x0bcc('0x67')},{'name':_0x0bcc('0x6c'),'value':_0xf45355[_0x0bcc('0x6c')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x1]?_0xf45355['attrs'][0x1]['value']:undefined)||null},{'name':_0x0bcc('0x6d'),'value':_0xf45355['attrSerie3']||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355['attrs'][0x2]?_0xf45355['attrs'][0x2][_0x0bcc('0x5e')]:undefined)||null},{'name':_0x0bcc('0x68'),'value':_0xf45355[_0x0bcc('0x68')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x3]?_0xf45355[_0x0bcc('0x5d')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x0bcc('0x6e'),'type':_0xf45355[_0x0bcc('0x6f')]||(_0xf45355['attrs']&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355[_0x0bcc('0x5d')][0x0]['type']:undefined)||null,'value':_0xf45355[_0x0bcc('0x6e')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x0]?_0xf45355[_0x0bcc('0x5d')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0xf45355[_0x0bcc('0x70')]||(_0xf45355[_0x0bcc('0x5d')]&&_0xf45355[_0x0bcc('0x5d')][0x1]?_0xf45355[_0x0bcc('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3b65de){logger[_0x0bcc('0x53')](_0x0bcc('0x71'),JSON['stringify'](_0x3b65de));return[];}}exports[_0x0bcc('0x72')]=function(_0x5740b1,_0xc2b666,_0x12e240){if(_0x5740b1[_0x0bcc('0x4d')]['id']){delete _0x5740b1[_0x0bcc('0x4d')]['id'];}return db['Dashboard'][_0x0bcc('0x4b')]({'where':{'id':_0x5740b1[_0x0bcc('0x48')]['id']}})[_0x0bcc('0x28')](handleEntityNotFound(_0xc2b666,null))[_0x0bcc('0x28')](function(_0x1a7aae){if(_0x1a7aae){_0x5740b1['body'][_0x0bcc('0x73')]=_0x1a7aae['id'];_0x5740b1[_0x0bcc('0x4d')][_0x0bcc('0x5d')]=widgetAttributes(_0x5740b1[_0x0bcc('0x4d')]);return db['DashboardItem'][_0x0bcc('0x4c')](_0x5740b1[_0x0bcc('0x4d')]);}})[_0x0bcc('0x28')](respondWithResult(_0xc2b666,null))[_0x0bcc('0x52')](handleError(_0xc2b666,null));};exports['getItems']=function(_0x5dde19,_0x53ba09,_0x4059aa){var _0x3b40b6={};var _0x44c8ad={};var _0x1cf78d;var _0x3a4953;return db[_0x0bcc('0x2f')][_0x0bcc('0x74')]({'where':{'id':_0x5dde19['params']['id']}})[_0x0bcc('0x28')](handleEntityNotFound(_0x53ba09,null))[_0x0bcc('0x28')](function(_0x36741b){if(_0x36741b){_0x1cf78d=_0x36741b;_0x44c8ad[_0x0bcc('0x32')]=_[_0x0bcc('0x35')](db['DashboardItem'][_0x0bcc('0x30')]);_0x44c8ad['query']=_[_0x0bcc('0x35')](_0x5dde19[_0x0bcc('0x36')]);_0x44c8ad[_0x0bcc('0x37')]=_[_0x0bcc('0x38')](_0x44c8ad[_0x0bcc('0x32')],_0x44c8ad[_0x0bcc('0x36')]);_0x3b40b6[_0x0bcc('0x3a')]=_[_0x0bcc('0x38')](_0x44c8ad[_0x0bcc('0x32')],qs['fields'](_0x5dde19[_0x0bcc('0x36')][_0x0bcc('0x39')]));_0x3b40b6[_0x0bcc('0x3a')]=_0x3b40b6['attributes']['length']?_0x3b40b6[_0x0bcc('0x3a')]:_0x44c8ad[_0x0bcc('0x32')];_0x3b40b6['order']=qs[_0x0bcc('0x3e')](_0x5dde19['query'][_0x0bcc('0x3e')]);_0x3b40b6[_0x0bcc('0x3f')]=qs[_0x0bcc('0x37')](_[_0x0bcc('0x40')](_0x5dde19[_0x0bcc('0x36')],_0x44c8ad[_0x0bcc('0x37')]));if(_0x5dde19['query']['filter']){_0x3b40b6[_0x0bcc('0x3f')]=_[_0x0bcc('0x42')](_0x3b40b6['where'],{'$or':_[_0x0bcc('0x33')](_0x3b40b6[_0x0bcc('0x3a')],function(_0x36f1fa){var _0x72662f={};_0x72662f[_0x36f1fa]={'$like':'%'+_0x5dde19[_0x0bcc('0x36')]['filter']+'%'};return _0x72662f;})});}_0x3b40b6=_[_0x0bcc('0x42')]({},_0x3b40b6,_0x5dde19['options']);return _0x1cf78d[_0x0bcc('0x75')](_0x3b40b6);}})[_0x0bcc('0x28')](function(_0x14cf40){if(_0x14cf40){_0x3a4953=_0x14cf40[_0x0bcc('0x49')];if(!_0x5dde19['query'][_0x0bcc('0x3b')](_0x0bcc('0x76'))){_0x3b40b6[_0x0bcc('0x3c')]=qs[_0x0bcc('0x3c')](_0x5dde19[_0x0bcc('0x36')][_0x0bcc('0x3c')]);_0x3b40b6[_0x0bcc('0x1f')]=qs[_0x0bcc('0x1f')](_0x5dde19[_0x0bcc('0x36')][_0x0bcc('0x1f')]);}return _0x1cf78d[_0x0bcc('0x75')](_0x3b40b6);}})[_0x0bcc('0x28')](function(_0x4c9aca){if(_0x4c9aca){return _0x4c9aca?{'count':_0x3a4953,'rows':_0x4c9aca}:null;}})['then'](respondWithResult(_0x53ba09,null))[_0x0bcc('0x52')](handleError(_0x53ba09,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index cd2c4e0..cf8eac4 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 _0x4017=['update','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x4017,0x70));var _0x7401=function(_0x5efddd,_0x1eadd1){_0x5efddd=_0x5efddd-0x0;var _0x169562=_0x4017[_0x5efddd];return _0x169562;};'use strict';var EventEmitter=require(_0x7401('0x0'));var Dashboard=require(_0x7401('0x1'))['db'][_0x7401('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7401('0x3')](0x0);var events={'afterCreate':_0x7401('0x4'),'afterUpdate':_0x7401('0x5'),'afterDestroy':'remove'};function emitEvent(_0x55dc1a){return function(_0x442c7b,_0x1a7256,_0x33d712){DashboardEvents[_0x7401('0x6')](_0x55dc1a+':'+_0x442c7b['id'],_0x442c7b);DashboardEvents['emit'](_0x55dc1a,_0x442c7b);_0x33d712(null);};}for(var e in events){if(events[_0x7401('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x7401('0x8')]=DashboardEvents; \ No newline at end of file +var _0x1490=['hook','events','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0x1490,0x85));var _0x0149=function(_0x1f4ebb,_0x4937f8){_0x1f4ebb=_0x1f4ebb-0x0;var _0x4dd40e=_0x1490[_0x1f4ebb];return _0x4dd40e;};'use strict';var EventEmitter=require(_0x0149('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0149('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0149('0x2'),'afterDestroy':'remove'};function emitEvent(_0x461386){return function(_0x1bceac,_0x2cfd93,_0x330f0b){DashboardEvents['emit'](_0x461386+':'+_0x1bceac['id'],_0x1bceac);DashboardEvents[_0x0149('0x3')](_0x461386,_0x1bceac);_0x330f0b(null);};}for(var e in events){if(events[_0x0149('0x4')](e)){var event=events[e];Dashboard[_0x0149('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index b630695..69dd618 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 _0x2cae=['../../config/environment','./dashboard.attributes','Dashboard','lodash','util','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cae,0x16b));var _0xe2ca=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x2cae[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0xe2ca('0x0'));var util=require(_0xe2ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe2ca('0x2'));var BPromise=require(_0xe2ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2ca('0x4'));var rimraf=require(_0xe2ca('0x5'));var config=require(_0xe2ca('0x6'));var attributes=require(_0xe2ca('0x7'));module['exports']=function(_0x2b4c70,_0x3cabde){return _0x2b4c70['define'](_0xe2ca('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ba0=['../../config/environment','define','Dashboard','dashboards','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3b9a52,_0x1429ad){var _0x1155d8=function(_0x204313){while(--_0x204313){_0x3b9a52['push'](_0x3b9a52['shift']());}};_0x1155d8(++_0x1429ad);}(_0x4ba0,0xe0));var _0x04ba=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x4ba0[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x04ba('0x0'));var util=require('util');var logger=require(_0x04ba('0x1'))('api');var moment=require(_0x04ba('0x2'));var BPromise=require(_0x04ba('0x3'));var rp=require(_0x04ba('0x4'));var fs=require('fs');var path=require(_0x04ba('0x5'));var rimraf=require('rimraf');var config=require(_0x04ba('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x17959f,_0x5b7994){return _0x17959f[_0x04ba('0x7')](_0x04ba('0x8'),attributes,{'tableName':_0x04ba('0x9'),'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 cfafc5d..b073de0 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 _0xf87b=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28de16,_0x3695ef){var _0x4863d5=function(_0x3e1442){while(--_0x3e1442){_0x28de16['push'](_0x28de16['shift']());}};_0x4863d5(++_0x3695ef);}(_0xf87b,0xa4));var _0xbf87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf87b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbf87('0x0'));var util=require('util');var moment=require(_0xbf87('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf87('0x2'));var fs=require('fs');var Redis=require(_0xbf87('0x3'));var db=require(_0xbf87('0x4'))['db'];var utils=require(_0xbf87('0x5'));var logger=require(_0xbf87('0x6'))('rpc');var config=require(_0xbf87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbf87('0x8')][_0xbf87('0x9')]({'port':0x232a});config[_0xbf87('0xa')]=_[_0xbf87('0xb')](config[_0xbf87('0xa')],{'host':_0xbf87('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf87('0xa')]));require(_0xbf87('0xd'))[_0xbf87('0xe')](socket);function respondWithRpcPromise(_0x4bf857,_0x2af159,_0x2c27d9){return new BPromise(function(_0x4da0f7,_0x567f69){return client[_0xbf87('0xf')](_0x4bf857,_0x2c27d9)['then'](function(_0x337c49){logger[_0xbf87('0x10')](_0xbf87('0x11'),_0x2af159,_0xbf87('0x12'));logger[_0xbf87('0x13')](_0xbf87('0x14'),_0x2af159,_0xbf87('0x12'),JSON[_0xbf87('0x15')](_0x337c49));if(_0x337c49[_0xbf87('0x16')]){if(_0x337c49[_0xbf87('0x16')][_0xbf87('0x17')]===0x1f4){logger['error'](_0xbf87('0x11'),_0x2af159,_0x337c49['error'][_0xbf87('0x18')]);return _0x567f69(_0x337c49['error'][_0xbf87('0x18')]);}logger[_0xbf87('0x16')]('Dashboard,\x20%s,\x20%s',_0x2af159,_0x337c49[_0xbf87('0x16')]['message']);return _0x4da0f7(_0x337c49[_0xbf87('0x16')][_0xbf87('0x18')]);}else{logger['info'](_0xbf87('0x11'),_0x2af159,_0xbf87('0x12'));_0x4da0f7(_0x337c49[_0xbf87('0x19')][_0xbf87('0x18')]);}})[_0xbf87('0x1a')](function(_0x15257c){logger[_0xbf87('0x16')](_0xbf87('0x11'),_0x2af159,_0x15257c);_0x567f69(_0x15257c);});});} \ No newline at end of file +var _0x1468=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','socket.io-emitter','./dashboard.socket','request','then','info'];(function(_0x36b13d,_0x5b469e){var _0x279169=function(_0x37a279){while(--_0x37a279){_0x36b13d['push'](_0x36b13d['shift']());}};_0x279169(++_0x5b469e);}(_0x1468,0x68));var _0x8146=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x1468[_0x2de020];return _0x182b7c;};'use strict';var _=require(_0x8146('0x0'));var util=require(_0x8146('0x1'));var moment=require(_0x8146('0x2'));var BPromise=require(_0x8146('0x3'));var rs=require(_0x8146('0x4'));var fs=require('fs');var Redis=require(_0x8146('0x5'));var db=require(_0x8146('0x6'))['db'];var utils=require(_0x8146('0x7'));var logger=require(_0x8146('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8146('0x9')]({'port':0x232a});config[_0x8146('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8146('0xb'))(new Redis(config[_0x8146('0xa')]));require(_0x8146('0xc'))['register'](socket);function respondWithRpcPromise(_0x584fd4,_0x4e7f0c,_0x2fafad){return new BPromise(function(_0x2efdb4,_0x10a2a0){return client[_0x8146('0xd')](_0x584fd4,_0x2fafad)[_0x8146('0xe')](function(_0x2a8703){logger[_0x8146('0xf')](_0x8146('0x10'),_0x4e7f0c,_0x8146('0x11'));logger[_0x8146('0x12')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4e7f0c,_0x8146('0x11'),JSON[_0x8146('0x13')](_0x2a8703));if(_0x2a8703[_0x8146('0x14')]){if(_0x2a8703[_0x8146('0x14')][_0x8146('0x15')]===0x1f4){logger[_0x8146('0x14')]('Dashboard,\x20%s,\x20%s',_0x4e7f0c,_0x2a8703[_0x8146('0x14')][_0x8146('0x16')]);return _0x10a2a0(_0x2a8703['error']['message']);}logger[_0x8146('0x14')]('Dashboard,\x20%s,\x20%s',_0x4e7f0c,_0x2a8703['error'][_0x8146('0x16')]);return _0x2efdb4(_0x2a8703[_0x8146('0x14')][_0x8146('0x16')]);}else{logger['info'](_0x8146('0x10'),_0x4e7f0c,_0x8146('0x11'));_0x2efdb4(_0x2a8703[_0x8146('0x17')][_0x8146('0x16')]);}})['catch'](function(_0xcef919){logger[_0x8146('0x14')](_0x8146('0x10'),_0x4e7f0c,_0xcef919);_0x10a2a0(_0xcef919);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b96a3dd..559003f 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 _0xecfd=['update','register','length','remove'];(function(_0x5072fe,_0x40dce7){var _0x12d8d3=function(_0x52f11b){while(--_0x52f11b){_0x5072fe['push'](_0x5072fe['shift']());}};_0x12d8d3(++_0x40dce7);}(_0xecfd,0x1c7));var _0xdecf=function(_0x50fb34,_0x56b847){_0x50fb34=_0x50fb34-0x0;var _0x478797=_0xecfd[_0x50fb34];return _0x478797;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0xdecf('0x0'),_0xdecf('0x1')];function createListener(_0x3c8b23,_0x381e12){return function(_0x2cd27d){_0x381e12['emit'](_0x3c8b23,_0x2cd27d);};}function removeListener(_0x91daeb,_0x357201){return function(){DashboardEvents['removeListener'](_0x91daeb,_0x357201);};}exports[_0xdecf('0x2')]=function(_0x13db90){for(var _0x4a9d7d=0x0,_0x4055df=events[_0xdecf('0x3')];_0x4a9d7d<_0x4055df;_0x4a9d7d++){var _0x2cb78d=events[_0x4a9d7d];var _0x2f4a51=createListener('dashboard:'+_0x2cb78d,_0x13db90);DashboardEvents['on'](_0x2cb78d,_0x2f4a51);}}; \ No newline at end of file +var _0xa423=['length','dashboard:','./dashboard.events','save','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa423,0xb6));var _0x3a42=function(_0x543719,_0xea44b8){_0x543719=_0x543719-0x0;var _0x38bb38=_0xa423[_0x543719];return _0x38bb38;};'use strict';var DashboardEvents=require(_0x3a42('0x0'));var events=[_0x3a42('0x1'),'remove','update'];function createListener(_0x676cec,_0x3b0aa6){return function(_0x3f39df){_0x3b0aa6['emit'](_0x676cec,_0x3f39df);};}function removeListener(_0x1ba098,_0x5b6dd2){return function(){DashboardEvents[_0x3a42('0x2')](_0x1ba098,_0x5b6dd2);};}exports[_0x3a42('0x3')]=function(_0x1195a4){for(var _0x5ba465=0x0,_0x665bfd=events[_0x3a42('0x4')];_0x5ba465<_0x665bfd;_0x5ba465++){var _0x6d172e=events[_0x5ba465];var _0x3db317=createListener(_0x3a42('0x5')+_0x6d172e,_0x1195a4);DashboardEvents['on'](_0x6d172e,_0x3db317);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index dcf5d40..6e3131e 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 _0x3952=['index','show','getItems','post','clone','addItem','/:id','update','delete','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3952,0x127));var _0x2395=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x3952[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x2395('0x0'));var util=require('util');var path=require(_0x2395('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2395('0x2'));var auth=require(_0x2395('0x3'));var interaction=require(_0x2395('0x4'));var config=require(_0x2395('0x5'));var controller=require(_0x2395('0x6'));router[_0x2395('0x7')]('/',auth[_0x2395('0x8')](),controller[_0x2395('0x9')]);router['get']('/:id',auth[_0x2395('0x8')](),controller[_0x2395('0xa')]);router[_0x2395('0x7')]('/:id/items',auth[_0x2395('0x8')](),controller[_0x2395('0xb')]);router[_0x2395('0xc')]('/',auth[_0x2395('0x8')](),controller['create']);router[_0x2395('0xc')]('/:id/clone',auth[_0x2395('0x8')](),controller[_0x2395('0xd')]);router[_0x2395('0xc')]('/:id/items',auth[_0x2395('0x8')](),controller[_0x2395('0xe')]);router['put'](_0x2395('0xf'),auth[_0x2395('0x8')](),controller[_0x2395('0x10')]);router[_0x2395('0x11')](_0x2395('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2395('0x12')]=router; \ No newline at end of file +var _0xa3e1=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','update','delete','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa3e1,0x13b));var _0x1a3e=function(_0x34e79b,_0x488f5d){_0x34e79b=_0x34e79b-0x0;var _0xd05dfd=_0xa3e1[_0x34e79b];return _0xd05dfd;};'use strict';var multer=require('multer');var util=require(_0x1a3e('0x0'));var path=require(_0x1a3e('0x1'));var timeout=require(_0x1a3e('0x2'));var express=require(_0x1a3e('0x3'));var router=express[_0x1a3e('0x4')]();var fs_extra=require(_0x1a3e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1a3e('0x6'));var config=require(_0x1a3e('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1a3e('0x8')]);router[_0x1a3e('0x9')](_0x1a3e('0xa'),auth[_0x1a3e('0xb')](),controller[_0x1a3e('0xc')]);router[_0x1a3e('0x9')](_0x1a3e('0xd'),auth[_0x1a3e('0xb')](),controller[_0x1a3e('0xe')]);router[_0x1a3e('0xf')]('/',auth['isAuthenticated'](),controller[_0x1a3e('0x10')]);router[_0x1a3e('0xf')](_0x1a3e('0x11'),auth[_0x1a3e('0xb')](),controller['clone']);router[_0x1a3e('0xf')](_0x1a3e('0xd'),auth[_0x1a3e('0xb')](),controller['addItem']);router['put'](_0x1a3e('0xa'),auth[_0x1a3e('0xb')](),controller[_0x1a3e('0x12')]);router[_0x1a3e('0x13')]('/:id',auth[_0x1a3e('0xb')](),controller['destroy']);module[_0x1a3e('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 8cc67f8..400c6b7 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 _0x31f0=['INTEGER','#ffffff','#2196f3','sequelize','lodash','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify'];(function(_0x497022,_0x29f035){var _0x595d91=function(_0x4e7fdf){while(--_0x4e7fdf){_0x497022['push'](_0x497022['shift']());}};_0x595d91(++_0x29f035);}(_0x31f0,0xb7));var _0x031f=function(_0x2d3da5,_0xced3a9){_0x2d3da5=_0x2d3da5-0x0;var _0x312a53=_0x31f0[_0x2d3da5];return _0x312a53;};'use strict';var Sequelize=require(_0x031f('0x0'));var squel=require('squel');var _=require(_0x031f('0x1'));module['exports']={'title':{'type':Sequelize[_0x031f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x031f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x031f('0x3')](_0x031f('0x4')),'get':function(){try{return JSON['parse'](this[_0x031f('0x5')](_0x031f('0x6')));}catch(_0x4f6059){return[];}},'set':function(_0x4c0f94){try{this['setDataValue'](_0x031f('0x6'),JSON['stringify'](_0x4c0f94));}catch(_0x365f59){this[_0x031f('0x7')](_0x031f('0x6'),JSON[_0x031f('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x031f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x031f('0x9')]},'col':{'type':Sequelize[_0x031f('0x9')]},'background':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x031f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xd117=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd117,0x182));var _0x7d11=function(_0x114bf1,_0x16ac4a){_0x114bf1=_0x114bf1-0x0;var _0x58072f=_0xd117[_0x114bf1];return _0x58072f;};'use strict';var Sequelize=require(_0x7d11('0x0'));var squel=require(_0x7d11('0x1'));var _=require(_0x7d11('0x2'));module[_0x7d11('0x3')]={'title':{'type':Sequelize[_0x7d11('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6')),'get':function(){try{return JSON[_0x7d11('0x7')](this[_0x7d11('0x8')](_0x7d11('0x9')));}catch(_0x2689c6){return[];}},'set':function(_0x27d7e8){try{this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')](_0x27d7e8));}catch(_0x47b5e6){this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7d11('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7d11('0xc')]},'col':{'type':Sequelize[_0x7d11('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7d11('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7d11('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index d8de92e..afa22c6 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 _0x4b49=['redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','show','params','model','DashboardItem','query','intersection','fields','attributes','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4c42e1,_0x59686f){var _0xd26972=function(_0x48305d){while(--_0x48305d){_0x4c42e1['push'](_0x4c42e1['shift']());}};_0xd26972(++_0x59686f);}(_0x4b49,0xef));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x94b4('0x0'));var rimraf=require(_0x94b4('0x1'));var zipdir=require(_0x94b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94b4('0x3'));var moment=require(_0x94b4('0x4'));var BPromise=require(_0x94b4('0x5'));var Mustache=require('mustache');var util=require(_0x94b4('0x6'));var path=require('path');var sox=require(_0x94b4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x94b4('0x8'));var _=require(_0x94b4('0x9'));var squel=require(_0x94b4('0xa'));var crypto=require(_0x94b4('0xb'));var jsforce=require(_0x94b4('0xc'));var deskjs=require(_0x94b4('0xd'));var toCsv=require(_0x94b4('0xe'));var querystring=require(_0x94b4('0xf'));var Papa=require('papaparse');var Redis=require(_0x94b4('0x10'));var authService=require(_0x94b4('0x11'));var qs=require(_0x94b4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94b4('0x13'));var logger=require(_0x94b4('0x14'))(_0x94b4('0x15'));var utils=require(_0x94b4('0x16'));var config=require(_0x94b4('0x17'));var licenseUtil=require(_0x94b4('0x18'));var db=require('../../mysqldb')['db'];config[_0x94b4('0x19')]=_[_0x94b4('0x1a')](config[_0x94b4('0x19')],{'host':_0x94b4('0x1b'),'port':0x18eb});var socket=require(_0x94b4('0x1c'))(new Redis(config[_0x94b4('0x19')]));require(_0x94b4('0x1d'))['register'](socket);function respondWithStatusCode(_0x519c1c,_0x5e1ed3){_0x5e1ed3=_0x5e1ed3||0xcc;return function(_0x5f428e){if(_0x5f428e){return _0x519c1c[_0x94b4('0x1e')](_0x5e1ed3);}return _0x519c1c['status'](_0x5e1ed3)[_0x94b4('0x1f')]();};}function respondWithResult(_0x5b51fc,_0x4f4c99){_0x4f4c99=_0x4f4c99||0xc8;return function(_0x3b90f6){if(_0x3b90f6){return _0x5b51fc[_0x94b4('0x20')](_0x4f4c99)['json'](_0x3b90f6);}};}function respondWithFilteredResult(_0x1d5403,_0x2f4cf5){return function(_0x46a914){if(_0x46a914){var _0x246a9f=typeof _0x2f4cf5[_0x94b4('0x21')]===_0x94b4('0x22')&&typeof _0x2f4cf5[_0x94b4('0x23')]===_0x94b4('0x22');var _0x2bdaea=_0x46a914['count'];var _0x2c9715=_0x246a9f?0x0:_0x2f4cf5['offset'];var _0x128a1c=_0x246a9f?_0x46a914['count']:_0x2f4cf5[_0x94b4('0x21')]+_0x2f4cf5[_0x94b4('0x23')];var _0x3768f7;if(_0x128a1c>=_0x2bdaea){_0x128a1c=_0x2bdaea;_0x3768f7=0xc8;}else{_0x3768f7=0xce;}_0x1d5403[_0x94b4('0x20')](_0x3768f7);return _0x1d5403['set'](_0x94b4('0x24'),_0x2c9715+'-'+_0x128a1c+'/'+_0x2bdaea)[_0x94b4('0x25')](_0x46a914);}return null;};}function patchUpdates(_0x403e9c){return function(_0x29ae3e){try{jsonpatch['apply'](_0x29ae3e,_0x403e9c,!![]);}catch(_0x58b988){return BPromise[_0x94b4('0x26')](_0x58b988);}return _0x29ae3e[_0x94b4('0x27')]();};}function saveUpdates(_0x3c60b2,_0x3cd0eb){return function(_0x48a557){if(_0x48a557){return _0x48a557[_0x94b4('0x28')](_0x3c60b2)[_0x94b4('0x29')](function(_0x1c576b){return _0x1c576b;});}return null;};}function removeEntity(_0x50797d,_0x245ddf){return function(_0x4ad4c7){if(_0x4ad4c7){return _0x4ad4c7[_0x94b4('0x2a')]()[_0x94b4('0x29')](function(){_0x50797d['status'](0xcc)[_0x94b4('0x1f')]();});}};}function handleEntityNotFound(_0x467301,_0x237e99){return function(_0x215658){if(!_0x215658){_0x467301[_0x94b4('0x1e')](0x194);}return _0x215658;};}function handleError(_0x3ecf42,_0x151b83){_0x151b83=_0x151b83||0x1f4;return function(_0x544fac){logger[_0x94b4('0x2b')](_0x544fac[_0x94b4('0x2c')]);if(_0x544fac[_0x94b4('0x2d')]){delete _0x544fac[_0x94b4('0x2d')];}_0x3ecf42[_0x94b4('0x20')](_0x151b83)[_0x94b4('0x2e')](_0x544fac);};}exports[_0x94b4('0x2f')]=function(_0x1aa889,_0x31b3c0){var _0x4e2b8c={'raw':![],'where':{'id':_0x1aa889[_0x94b4('0x30')]['id']}},_0x8487f9={};_0x8487f9[_0x94b4('0x31')]=_['keys'](db[_0x94b4('0x32')]['rawAttributes']);_0x8487f9[_0x94b4('0x33')]=_['keys'](_0x1aa889['query']);_0x8487f9['filters']=_[_0x94b4('0x34')](_0x8487f9['model'],_0x8487f9[_0x94b4('0x33')]);_0x4e2b8c['attributes']=_[_0x94b4('0x34')](_0x8487f9[_0x94b4('0x31')],qs[_0x94b4('0x35')](_0x1aa889['query'][_0x94b4('0x35')]));_0x4e2b8c[_0x94b4('0x36')]=_0x4e2b8c[_0x94b4('0x36')]['length']?_0x4e2b8c[_0x94b4('0x36')]:_0x8487f9['model'];if(_0x1aa889['query']['includeAll']){_0x4e2b8c[_0x94b4('0x37')]=[{'all':!![]}];}_0x4e2b8c=_[_0x94b4('0x38')]({},_0x4e2b8c,_0x1aa889[_0x94b4('0x39')]);return db[_0x94b4('0x32')][_0x94b4('0x3a')](_0x4e2b8c)[_0x94b4('0x29')](handleEntityNotFound(_0x31b3c0,null))[_0x94b4('0x29')](respondWithResult(_0x31b3c0,null))[_0x94b4('0x3b')](handleError(_0x31b3c0,null));};exports[_0x94b4('0x2a')]=function(_0x17a70d,_0x1485b6){return db[_0x94b4('0x32')][_0x94b4('0x3a')]({'where':{'id':_0x17a70d['params']['id']}})[_0x94b4('0x29')](handleEntityNotFound(_0x1485b6,null))[_0x94b4('0x29')](removeEntity(_0x1485b6,null))[_0x94b4('0x3b')](handleError(_0x1485b6,null));};function widgetAttributes(_0x4608a5){try{switch(_0x4608a5[_0x94b4('0x3c')]){case _0x94b4('0x3d'):return[{'name':_0x94b4('0x3e'),'value':_0x4608a5['attrUrl']||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5['attrs'][0x0]?_0x4608a5['attrs'][0x0][_0x94b4('0x40')]:undefined)||_0x94b4('0x41')}];case _0x94b4('0x42'):return[{'name':_0x94b4('0x43'),'value':_0x4608a5['attrPath']||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5['attrs'][0x0]?_0x4608a5[_0x94b4('0x3f')][0x0][_0x94b4('0x40')]:undefined)||''}];case _0x94b4('0x44'):return[{'name':_0x94b4('0x45'),'value':_0x4608a5[_0x94b4('0x45')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x0]?_0x4608a5[_0x94b4('0x3f')][0x0][_0x94b4('0x40')]:undefined)||_0x94b4('0x46')},{'name':_0x94b4('0x47'),'value':_0x4608a5['attrTimezone']||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x1]?_0x4608a5[_0x94b4('0x3f')][0x1][_0x94b4('0x40')]:undefined)||_0x94b4('0x48')},{'name':_0x94b4('0x49'),'value':_0x4608a5[_0x94b4('0x49')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x2]?_0x4608a5[_0x94b4('0x3f')][0x2]['value']:undefined)||0xc}];case _0x94b4('0x4a'):return[{'name':'attrMetric','value':_0x4608a5[_0x94b4('0x4b')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x0]?_0x4608a5[_0x94b4('0x3f')][0x0][_0x94b4('0x40')]:undefined)||_0x94b4('0x4c')},{'name':_0x94b4('0x4d'),'value':_0x4608a5[_0x94b4('0x4d')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5['attrs'][0x1]?_0x4608a5[_0x94b4('0x3f')][0x1][_0x94b4('0x40')]:undefined)||[]},{'name':_0x94b4('0x49'),'value':_0x4608a5[_0x94b4('0x49')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5['attrs'][0x2]?_0x4608a5['attrs'][0x2][_0x94b4('0x40')]:undefined)||0x14}];case'multibar-chart':case _0x94b4('0x4e'):return[{'name':_0x94b4('0x4f'),'value':_0x4608a5[_0x94b4('0x4f')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x0]?_0x4608a5[_0x94b4('0x3f')][0x0][_0x94b4('0x40')]:undefined)||_0x94b4('0x4c')},{'name':_0x94b4('0x50'),'value':_0x4608a5[_0x94b4('0x50')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x1]?_0x4608a5[_0x94b4('0x3f')][0x1]['value']:undefined)||null},{'name':_0x94b4('0x51'),'value':_0x4608a5[_0x94b4('0x51')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x2]?_0x4608a5['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x4608a5['attrVoiceQueues']||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x3]?_0x4608a5['attrs'][0x3][_0x94b4('0x40')]:undefined)||[]}];case _0x94b4('0x52'):return[{'name':_0x94b4('0x53'),'type':_0x4608a5[_0x94b4('0x54')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x0]?_0x4608a5[_0x94b4('0x3f')][0x0][_0x94b4('0x3c')]:undefined)||null,'value':_0x4608a5[_0x94b4('0x53')]||(_0x4608a5['attrs']&&_0x4608a5['attrs'][0x0]?_0x4608a5['attrs'][0x0][_0x94b4('0x40')]:undefined)||null},{'name':_0x94b4('0x55'),'value':_0x4608a5[_0x94b4('0x55')]||(_0x4608a5[_0x94b4('0x3f')]&&_0x4608a5[_0x94b4('0x3f')][0x1]?_0x4608a5['attrs'][0x1][_0x94b4('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x375fa9){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x375fa9));return[];}}exports[_0x94b4('0x56')]=function(_0x373532,_0x359ee5){if(_0x373532['body']){_0x373532[_0x94b4('0x57')][_0x94b4('0x3f')]=widgetAttributes(_0x373532['body']);}return db[_0x94b4('0x32')]['create'](_0x373532['body'],{})[_0x94b4('0x29')](respondWithResult(_0x359ee5,0xc9))[_0x94b4('0x3b')](handleError(_0x359ee5,null));};exports[_0x94b4('0x28')]=function(_0x37f57a,_0xade233){if(_0x37f57a[_0x94b4('0x57')]['id']){delete _0x37f57a['body']['id'];}_0x37f57a[_0x94b4('0x57')][_0x94b4('0x3f')]=widgetAttributes(_0x37f57a['body']);return db[_0x94b4('0x32')][_0x94b4('0x3a')]({'where':{'id':_0x37f57a[_0x94b4('0x30')]['id']}})['then'](handleEntityNotFound(_0xade233,null))['then'](saveUpdates(_0x37f57a[_0x94b4('0x57')],null))[_0x94b4('0x29')](respondWithResult(_0xade233,null))['catch'](handleError(_0xade233,null));}; \ No newline at end of file +var _0x5f3a=['attrMetric','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','destroy','then','stack','name','show','model','DashboardItem','rawAttributes','query','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','counter'];(function(_0xfb33df,_0x53d118){var _0xa773df=function(_0x11d343){while(--_0x11d343){_0xfb33df['push'](_0xfb33df['shift']());}};_0xa773df(++_0x53d118);}(_0x5f3a,0x16d));var _0xa5f3=function(_0xef9edb,_0x406d7b){_0xef9edb=_0xef9edb-0x0;var _0x3583e3=_0x5f3a[_0xef9edb];return _0x3583e3;};'use strict';var emlformat=require(_0xa5f3('0x0'));var rimraf=require(_0xa5f3('0x1'));var zipdir=require(_0xa5f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5f3('0x3'));var BPromise=require(_0xa5f3('0x4'));var Mustache=require(_0xa5f3('0x5'));var util=require(_0xa5f3('0x6'));var path=require(_0xa5f3('0x7'));var sox=require(_0xa5f3('0x8'));var csv=require(_0xa5f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5f3('0xa'));var _=require(_0xa5f3('0xb'));var squel=require(_0xa5f3('0xc'));var crypto=require(_0xa5f3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa5f3('0x9'));var querystring=require(_0xa5f3('0xe'));var Papa=require(_0xa5f3('0xf'));var Redis=require(_0xa5f3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa5f3('0x11'));var hardwareService=require(_0xa5f3('0x12'));var logger=require(_0xa5f3('0x13'))(_0xa5f3('0x14'));var utils=require(_0xa5f3('0x15'));var config=require(_0xa5f3('0x16'));var licenseUtil=require(_0xa5f3('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa5f3('0x18')],{'host':_0xa5f3('0x19'),'port':0x18eb});var socket=require(_0xa5f3('0x1a'))(new Redis(config[_0xa5f3('0x18')]));require('./dashboardItem.socket')[_0xa5f3('0x1b')](socket);function respondWithStatusCode(_0x3fb7c9,_0x461767){_0x461767=_0x461767||0xcc;return function(_0x3fc084){if(_0x3fc084){return _0x3fb7c9[_0xa5f3('0x1c')](_0x461767);}return _0x3fb7c9[_0xa5f3('0x1d')](_0x461767)['end']();};}function respondWithResult(_0x27b521,_0x4bf49f){_0x4bf49f=_0x4bf49f||0xc8;return function(_0x16cd01){if(_0x16cd01){return _0x27b521['status'](_0x4bf49f)[_0xa5f3('0x1e')](_0x16cd01);}};}function respondWithFilteredResult(_0x39e822,_0x480077){return function(_0x147cdd){if(_0x147cdd){var _0x551779=typeof _0x480077[_0xa5f3('0x1f')]==='undefined'&&typeof _0x480077['limit']===_0xa5f3('0x20');var _0x3320ca=_0x147cdd[_0xa5f3('0x21')];var _0x1509bb=_0x551779?0x0:_0x480077['offset'];var _0x5b3d0c=_0x551779?_0x147cdd[_0xa5f3('0x21')]:_0x480077[_0xa5f3('0x1f')]+_0x480077['limit'];var _0x45611f;if(_0x5b3d0c>=_0x3320ca){_0x5b3d0c=_0x3320ca;_0x45611f=0xc8;}else{_0x45611f=0xce;}_0x39e822[_0xa5f3('0x1d')](_0x45611f);return _0x39e822['set'](_0xa5f3('0x22'),_0x1509bb+'-'+_0x5b3d0c+'/'+_0x3320ca)['json'](_0x147cdd);}return null;};}function patchUpdates(_0x58c8e3){return function(_0x572050){try{jsonpatch[_0xa5f3('0x23')](_0x572050,_0x58c8e3,!![]);}catch(_0x2a0d19){return BPromise[_0xa5f3('0x24')](_0x2a0d19);}return _0x572050['save']();};}function saveUpdates(_0x555363,_0x411da7){return function(_0x2be812){if(_0x2be812){return _0x2be812['update'](_0x555363)['then'](function(_0x4d5d8f){return _0x4d5d8f;});}return null;};}function removeEntity(_0x5add9f,_0x284c38){return function(_0x55d501){if(_0x55d501){return _0x55d501[_0xa5f3('0x25')]()[_0xa5f3('0x26')](function(){_0x5add9f[_0xa5f3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bac4,_0x506a99){return function(_0x4b2814){if(!_0x4b2814){_0x55bac4['sendStatus'](0x194);}return _0x4b2814;};}function handleError(_0x19f6f4,_0x16f382){_0x16f382=_0x16f382||0x1f4;return function(_0x1fb7c5){logger['error'](_0x1fb7c5[_0xa5f3('0x27')]);if(_0x1fb7c5['name']){delete _0x1fb7c5[_0xa5f3('0x28')];}_0x19f6f4[_0xa5f3('0x1d')](_0x16f382)['send'](_0x1fb7c5);};}exports[_0xa5f3('0x29')]=function(_0xcb7e4e,_0x38de6){var _0x5a2056={'raw':![],'where':{'id':_0xcb7e4e['params']['id']}},_0x12a290={};_0x12a290[_0xa5f3('0x2a')]=_['keys'](db[_0xa5f3('0x2b')][_0xa5f3('0x2c')]);_0x12a290[_0xa5f3('0x2d')]=_[_0xa5f3('0x2e')](_0xcb7e4e[_0xa5f3('0x2d')]);_0x12a290['filters']=_['intersection'](_0x12a290[_0xa5f3('0x2a')],_0x12a290[_0xa5f3('0x2d')]);_0x5a2056['attributes']=_[_0xa5f3('0x2f')](_0x12a290[_0xa5f3('0x2a')],qs[_0xa5f3('0x30')](_0xcb7e4e['query'][_0xa5f3('0x30')]));_0x5a2056[_0xa5f3('0x31')]=_0x5a2056[_0xa5f3('0x31')][_0xa5f3('0x32')]?_0x5a2056[_0xa5f3('0x31')]:_0x12a290['model'];if(_0xcb7e4e[_0xa5f3('0x2d')][_0xa5f3('0x33')]){_0x5a2056[_0xa5f3('0x34')]=[{'all':!![]}];}_0x5a2056=_[_0xa5f3('0x35')]({},_0x5a2056,_0xcb7e4e[_0xa5f3('0x36')]);return db['DashboardItem'][_0xa5f3('0x37')](_0x5a2056)[_0xa5f3('0x26')](handleEntityNotFound(_0x38de6,null))[_0xa5f3('0x26')](respondWithResult(_0x38de6,null))[_0xa5f3('0x38')](handleError(_0x38de6,null));};exports[_0xa5f3('0x25')]=function(_0x36be04,_0x1e3194){return db[_0xa5f3('0x2b')][_0xa5f3('0x37')]({'where':{'id':_0x36be04[_0xa5f3('0x39')]['id']}})[_0xa5f3('0x26')](handleEntityNotFound(_0x1e3194,null))[_0xa5f3('0x26')](removeEntity(_0x1e3194,null))[_0xa5f3('0x38')](handleError(_0x1e3194,null));};function widgetAttributes(_0x590ece){try{switch(_0x590ece[_0xa5f3('0x3a')]){case _0xa5f3('0x3b'):return[{'name':_0xa5f3('0x3c'),'value':_0x590ece[_0xa5f3('0x3c')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece['attrs'][0x0][_0xa5f3('0x3e')]:undefined)||_0xa5f3('0x3f')}];case _0xa5f3('0x40'):return[{'name':_0xa5f3('0x41'),'value':_0x590ece[_0xa5f3('0x41')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece[_0xa5f3('0x3d')][0x0][_0xa5f3('0x3e')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x590ece[_0xa5f3('0x42')]||(_0x590ece['attrs']&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece[_0xa5f3('0x3d')][0x0][_0xa5f3('0x3e')]:undefined)||_0xa5f3('0x43')},{'name':_0xa5f3('0x44'),'value':_0x590ece['attrTimezone']||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x1]?_0x590ece[_0xa5f3('0x3d')][0x1][_0xa5f3('0x3e')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x590ece['attrFontSize']||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x2]?_0x590ece[_0xa5f3('0x3d')][0x2][_0xa5f3('0x3e')]:undefined)||0xc}];case _0xa5f3('0x45'):return[{'name':_0xa5f3('0x46'),'value':_0x590ece[_0xa5f3('0x46')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece[_0xa5f3('0x3d')][0x0][_0xa5f3('0x3e')]:undefined)||'total'},{'name':_0xa5f3('0x47'),'value':_0x590ece[_0xa5f3('0x47')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x1]?_0x590ece[_0xa5f3('0x3d')][0x1][_0xa5f3('0x3e')]:undefined)||[]},{'name':_0xa5f3('0x48'),'value':_0x590ece[_0xa5f3('0x48')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x2]?_0x590ece[_0xa5f3('0x3d')][0x2][_0xa5f3('0x3e')]:undefined)||0x14}];case'multibar-chart':case _0xa5f3('0x49'):return[{'name':_0xa5f3('0x4a'),'value':_0x590ece[_0xa5f3('0x4a')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece['attrs'][0x0][_0xa5f3('0x3e')]:undefined)||_0xa5f3('0x4b')},{'name':_0xa5f3('0x4c'),'value':_0x590ece[_0xa5f3('0x4c')]||(_0x590ece['attrs']&&_0x590ece['attrs'][0x1]?_0x590ece[_0xa5f3('0x3d')][0x1][_0xa5f3('0x3e')]:undefined)||null},{'name':_0xa5f3('0x4d'),'value':_0x590ece[_0xa5f3('0x4d')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x2]?_0x590ece[_0xa5f3('0x3d')][0x2]['value']:undefined)||null},{'name':_0xa5f3('0x47'),'value':_0x590ece[_0xa5f3('0x47')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x3]?_0x590ece['attrs'][0x3][_0xa5f3('0x3e')]:undefined)||[]}];case'web-report':return[{'name':_0xa5f3('0x4e'),'type':_0x590ece[_0xa5f3('0x4f')]||(_0x590ece['attrs']&&_0x590ece['attrs'][0x0]?_0x590ece['attrs'][0x0]['type']:undefined)||null,'value':_0x590ece[_0xa5f3('0x4e')]||(_0x590ece[_0xa5f3('0x3d')]&&_0x590ece[_0xa5f3('0x3d')][0x0]?_0x590ece[_0xa5f3('0x3d')][0x0][_0xa5f3('0x3e')]:undefined)||null},{'name':_0xa5f3('0x50'),'value':_0x590ece[_0xa5f3('0x50')]||(_0x590ece['attrs']&&_0x590ece['attrs'][0x1]?_0x590ece[_0xa5f3('0x3d')][0x1][_0xa5f3('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x524215){logger[_0xa5f3('0x51')](_0xa5f3('0x52'),JSON[_0xa5f3('0x53')](_0x524215));return[];}}exports[_0xa5f3('0x54')]=function(_0x338628,_0x3530e4){if(_0x338628[_0xa5f3('0x55')]){_0x338628[_0xa5f3('0x55')][_0xa5f3('0x3d')]=widgetAttributes(_0x338628['body']);}return db[_0xa5f3('0x2b')]['create'](_0x338628[_0xa5f3('0x55')],{})[_0xa5f3('0x26')](respondWithResult(_0x3530e4,0xc9))[_0xa5f3('0x38')](handleError(_0x3530e4,null));};exports[_0xa5f3('0x56')]=function(_0x452dd4,_0x1e993b){if(_0x452dd4[_0xa5f3('0x55')]['id']){delete _0x452dd4[_0xa5f3('0x55')]['id'];}_0x452dd4[_0xa5f3('0x55')]['attrs']=widgetAttributes(_0x452dd4[_0xa5f3('0x55')]);return db['DashboardItem']['find']({'where':{'id':_0x452dd4[_0xa5f3('0x39')]['id']}})['then'](handleEntityNotFound(_0x1e993b,null))[_0xa5f3('0x26')](saveUpdates(_0x452dd4[_0xa5f3('0x55')],null))[_0xa5f3('0x26')](respondWithResult(_0x1e993b,null))[_0xa5f3('0x38')](handleError(_0x1e993b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 577c635..792fc2c 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 _0x2d0b=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x271191,_0x3486bf){var _0x2765db=function(_0x355f1b){while(--_0x355f1b){_0x271191['push'](_0x271191['shift']());}};_0x2765db(++_0x3486bf);}(_0x2d0b,0x102));var _0xb2d0=function(_0x504daf,_0x484b72){_0x504daf=_0x504daf-0x0;var _0x29da6f=_0x2d0b[_0x504daf];return _0x29da6f;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xb2d0('0x0'))['db'][_0xb2d0('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb2d0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2d0('0x3'),'afterDestroy':_0xb2d0('0x4')};function emitEvent(_0x5baccf){return function(_0x43206c,_0x59c298,_0x134f40){DashboardItemEvents['emit'](_0x5baccf+':'+_0x43206c['id'],_0x43206c);DashboardItemEvents[_0xb2d0('0x5')](_0x5baccf,_0x43206c);_0x134f40(null);};}for(var e in events){if(events[_0xb2d0('0x6')](e)){var event=events[e];DashboardItem[_0xb2d0('0x7')](e,emitEvent(event));}}module[_0xb2d0('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x458e=['emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x458e,0x159));var _0xe458=function(_0x561302,_0x49bb4d){_0x561302=_0x561302-0x0;var _0x191e55=_0x458e[_0x561302];return _0x191e55;};'use strict';var EventEmitter=require(_0xe458('0x0'));var DashboardItem=require(_0xe458('0x1'))['db'][_0xe458('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xe458('0x3')](0x0);var events={'afterCreate':_0xe458('0x4'),'afterUpdate':_0xe458('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47d787){return function(_0x1a15d5,_0x2eb24f,_0x51e5bc){DashboardItemEvents[_0xe458('0x6')](_0x47d787+':'+_0x1a15d5['id'],_0x1a15d5);DashboardItemEvents[_0xe458('0x6')](_0x47d787,_0x1a15d5);_0x51e5bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xe458('0x7')](e,emitEvent(event));}}module[_0xe458('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0d9b4aa..692a60b 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 _0xd6ec=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xd6ec,0x6e));var _0xcd6e=function(_0x3bbdd2,_0x44787f){_0x3bbdd2=_0x3bbdd2-0x0;var _0x3b68cb=_0xd6ec[_0x3bbdd2];return _0x3b68cb;};'use strict';var _=require('lodash');var util=require(_0xcd6e('0x0'));var logger=require(_0xcd6e('0x1'))(_0xcd6e('0x2'));var moment=require(_0xcd6e('0x3'));var BPromise=require(_0xcd6e('0x4'));var rp=require(_0xcd6e('0x5'));var fs=require('fs');var path=require(_0xcd6e('0x6'));var rimraf=require(_0xcd6e('0x7'));var config=require(_0xcd6e('0x8'));var attributes=require(_0xcd6e('0x9'));module[_0xcd6e('0xa')]=function(_0xb66d21,_0x2a5415){return _0xb66d21[_0xcd6e('0xb')](_0xcd6e('0xc'),attributes,{'tableName':_0xcd6e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a7=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x2de630,_0x534adc){var _0x35259e=function(_0x5672a3){while(--_0x5672a3){_0x2de630['push'](_0x2de630['shift']());}};_0x35259e(++_0x534adc);}(_0x98a7,0x9e));var _0x798a=function(_0xe326ed,_0x51c6d3){_0xe326ed=_0xe326ed-0x0;var _0x42d3bd=_0x98a7[_0xe326ed];return _0x42d3bd;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var logger=require(_0x798a('0x2'))(_0x798a('0x3'));var moment=require(_0x798a('0x4'));var BPromise=require(_0x798a('0x5'));var rp=require(_0x798a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x798a('0x7'));var config=require(_0x798a('0x8'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x128a0a,_0x451a05){return _0x128a0a[_0x798a('0x9')](_0x798a('0xa'),attributes,{'tableName':_0x798a('0xb'),'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 f4baab9..d7b0c41 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 _0x0bef=['client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bef,0xc2));var _0xf0be=function(_0x50caa0,_0x2431be){_0x50caa0=_0x50caa0-0x0;var _0x11b0c9=_0x0bef[_0x50caa0];return _0x11b0c9;};'use strict';var _=require(_0xf0be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf0be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0be('0x2'))['db'];var utils=require(_0xf0be('0x3'));var logger=require('../../config/logger')(_0xf0be('0x4'));var config=require(_0xf0be('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf0be('0x6')]['http']({'port':0x232a});config['redis']=_[_0xf0be('0x7')](config[_0xf0be('0x8')],{'host':_0xf0be('0x9'),'port':0x18eb});var socket=require(_0xf0be('0xa'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xf0be('0xb')](socket);function respondWithRpcPromise(_0xf18b57,_0x730d54,_0x499e3d){return new BPromise(function(_0x4a0382,_0x892fc2){return client[_0xf0be('0xc')](_0xf18b57,_0x499e3d)[_0xf0be('0xd')](function(_0x3f3f2c){logger[_0xf0be('0xe')](_0xf0be('0xf'),_0x730d54,_0xf0be('0x10'));logger[_0xf0be('0x11')](_0xf0be('0x12'),_0x730d54,_0xf0be('0x10'),JSON[_0xf0be('0x13')](_0x3f3f2c));if(_0x3f3f2c[_0xf0be('0x14')]){if(_0x3f3f2c[_0xf0be('0x14')][_0xf0be('0x15')]===0x1f4){logger['error'](_0xf0be('0xf'),_0x730d54,_0x3f3f2c[_0xf0be('0x14')][_0xf0be('0x16')]);return _0x892fc2(_0x3f3f2c[_0xf0be('0x14')][_0xf0be('0x16')]);}logger[_0xf0be('0x14')](_0xf0be('0xf'),_0x730d54,_0x3f3f2c[_0xf0be('0x14')][_0xf0be('0x16')]);return _0x4a0382(_0x3f3f2c['error'][_0xf0be('0x16')]);}else{logger[_0xf0be('0xe')](_0xf0be('0xf'),_0x730d54,_0xf0be('0x10'));_0x4a0382(_0x3f3f2c[_0xf0be('0x17')][_0xf0be('0x16')]);}})[_0xf0be('0x18')](function(_0x253ef8){logger[_0xf0be('0x14')]('DashboardItem,\x20%s,\x20%s',_0x730d54,_0x253ef8);_0x892fc2(_0x253ef8);});});} \ No newline at end of file +var _0xa364=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring'];(function(_0x118c30,_0x7eb1eb){var _0x569999=function(_0x550ba2){while(--_0x550ba2){_0x118c30['push'](_0x118c30['shift']());}};_0x569999(++_0x7eb1eb);}(_0xa364,0xaa));var _0x4a36=function(_0x372913,_0x2b9713){_0x372913=_0x372913-0x0;var _0x46ad14=_0xa364[_0x372913];return _0x46ad14;};'use strict';var _=require(_0x4a36('0x0'));var util=require(_0x4a36('0x1'));var moment=require(_0x4a36('0x2'));var BPromise=require(_0x4a36('0x3'));var rs=require(_0x4a36('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a36('0x5'))['db'];var utils=require(_0x4a36('0x6'));var logger=require(_0x4a36('0x7'))(_0x4a36('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a36('0x9')][_0x4a36('0xa')]({'port':0x232a});config[_0x4a36('0xb')]=_[_0x4a36('0xc')](config[_0x4a36('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a36('0xb')]));require(_0x4a36('0xd'))[_0x4a36('0xe')](socket);function respondWithRpcPromise(_0x2a7a60,_0x173c77,_0x43615a){return new BPromise(function(_0x388d6e,_0x276dbd){return client[_0x4a36('0xf')](_0x2a7a60,_0x43615a)[_0x4a36('0x10')](function(_0x215732){logger[_0x4a36('0x11')](_0x4a36('0x12'),_0x173c77,_0x4a36('0x13'));logger[_0x4a36('0x14')](_0x4a36('0x15'),_0x173c77,_0x4a36('0x13'),JSON[_0x4a36('0x16')](_0x215732));if(_0x215732[_0x4a36('0x17')]){if(_0x215732[_0x4a36('0x17')]['code']===0x1f4){logger['error'](_0x4a36('0x12'),_0x173c77,_0x215732['error'][_0x4a36('0x18')]);return _0x276dbd(_0x215732['error'][_0x4a36('0x18')]);}logger[_0x4a36('0x17')]('DashboardItem,\x20%s,\x20%s',_0x173c77,_0x215732[_0x4a36('0x17')][_0x4a36('0x18')]);return _0x388d6e(_0x215732[_0x4a36('0x17')][_0x4a36('0x18')]);}else{logger[_0x4a36('0x11')](_0x4a36('0x12'),_0x173c77,'request\x20sent');_0x388d6e(_0x215732['result']['message']);}})['catch'](function(_0x190ade){logger[_0x4a36('0x17')](_0x4a36('0x12'),_0x173c77,_0x190ade);_0x276dbd(_0x190ade);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 637414d..924112d 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 _0x8b64=['./dashboardItem.events','save','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x5d6a51,_0x1bb917){var _0x2ebed0=function(_0x3cd4f1){while(--_0x3cd4f1){_0x5d6a51['push'](_0x5d6a51['shift']());}};_0x2ebed0(++_0x1bb917);}(_0x8b64,0x98));var _0x48b6=function(_0x2b7081,_0x54c165){_0x2b7081=_0x2b7081-0x0;var _0x991e2f=_0x8b64[_0x2b7081];return _0x991e2f;};'use strict';var DashboardItemEvents=require(_0x48b6('0x0'));var events=[_0x48b6('0x1'),'remove',_0x48b6('0x2')];function createListener(_0x1374e5,_0xefaf60){return function(_0x23a977){_0xefaf60[_0x48b6('0x3')](_0x1374e5,_0x23a977);};}function removeListener(_0x4162c5,_0x1a3e06){return function(){DashboardItemEvents[_0x48b6('0x4')](_0x4162c5,_0x1a3e06);};}exports[_0x48b6('0x5')]=function(_0x16b981){for(var _0x5ec330=0x0,_0x1854bc=events[_0x48b6('0x6')];_0x5ec330<_0x1854bc;_0x5ec330++){var _0x359a21=events[_0x5ec330];var _0x30c225=createListener(_0x48b6('0x7')+_0x359a21,_0x16b981);DashboardItemEvents['on'](_0x359a21,_0x30c225);}}; \ No newline at end of file +var _0xa8f3=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove','update'];(function(_0x289c0e,_0x551fc9){var _0x2ace84=function(_0x13a289){while(--_0x13a289){_0x289c0e['push'](_0x289c0e['shift']());}};_0x2ace84(++_0x551fc9);}(_0xa8f3,0x137));var _0x3a8f=function(_0x3ac0a2,_0x304576){_0x3ac0a2=_0x3ac0a2-0x0;var _0x2d04cc=_0xa8f3[_0x3ac0a2];return _0x2d04cc;};'use strict';var DashboardItemEvents=require(_0x3a8f('0x0'));var events=[_0x3a8f('0x1'),_0x3a8f('0x2'),_0x3a8f('0x3')];function createListener(_0x526389,_0x360777){return function(_0x2f298e){_0x360777[_0x3a8f('0x4')](_0x526389,_0x2f298e);};}function removeListener(_0x1c9451,_0x96a32f){return function(){DashboardItemEvents[_0x3a8f('0x5')](_0x1c9451,_0x96a32f);};}exports[_0x3a8f('0x6')]=function(_0x366278){for(var _0xb335a2=0x0,_0x145ca4=events[_0x3a8f('0x7')];_0xb335a2<_0x145ca4;_0xb335a2++){var _0x478a53=events[_0xb335a2];var _0x2f2b99=createListener(_0x3a8f('0x8')+_0x478a53,_0x366278);DashboardItemEvents['on'](_0x478a53,_0x2f2b99);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 834c559..bfa5c5b 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 _0xa5bb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','isAuthenticated','/:id','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2cba15,_0x2d6ccf){var _0x43d0bb=function(_0x7de708){while(--_0x7de708){_0x2cba15['push'](_0x2cba15['shift']());}};_0x43d0bb(++_0x2d6ccf);}(_0xa5bb,0x73));var _0xba5b=function(_0x5cf21b,_0x449325){_0x5cf21b=_0x5cf21b-0x0;var _0x14dde5=_0xa5bb[_0x5cf21b];return _0x14dde5;};'use strict';var multer=require(_0xba5b('0x0'));var util=require(_0xba5b('0x1'));var path=require('path');var timeout=require(_0xba5b('0x2'));var express=require(_0xba5b('0x3'));var router=express[_0xba5b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba5b('0x5'));var interaction=require(_0xba5b('0x6'));var config=require(_0xba5b('0x7'));var controller=require(_0xba5b('0x8'));router[_0xba5b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba5b('0xa')]);router[_0xba5b('0xb')]('/',auth[_0xba5b('0xc')](),controller['create']);router['put'](_0xba5b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xba5b('0xe')]('/:id',auth[_0xba5b('0xc')](),controller[_0xba5b('0xf')]);module[_0xba5b('0x10')]=router; \ No newline at end of file +var _0xc218=['/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xc218,0x199));var _0x8c21=function(_0x2682a4,_0x871085){_0x2682a4=_0x2682a4-0x0;var _0x9002f8=_0xc218[_0x2682a4];return _0x9002f8;};'use strict';var multer=require(_0x8c21('0x0'));var util=require(_0x8c21('0x1'));var path=require(_0x8c21('0x2'));var timeout=require(_0x8c21('0x3'));var express=require(_0x8c21('0x4'));var router=express[_0x8c21('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c21('0x6'));var interaction=require(_0x8c21('0x7'));var config=require(_0x8c21('0x8'));var controller=require(_0x8c21('0x9'));router[_0x8c21('0xa')](_0x8c21('0xb'),auth[_0x8c21('0xc')](),controller[_0x8c21('0xd')]);router[_0x8c21('0xe')]('/',auth[_0x8c21('0xc')](),controller[_0x8c21('0xf')]);router[_0x8c21('0x10')]('/:id',auth[_0x8c21('0xc')](),controller['update']);router[_0x8c21('0x11')]('/:id',auth[_0x8c21('0xc')](),controller[_0x8c21('0x12')]);module[_0x8c21('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 30e2919..f1ea279 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 _0x1cc0=['third','first','sequelize','exports','STRING','ENUM'];(function(_0x52dcd,_0x1d3985){var _0x139af3=function(_0x2f8712){while(--_0x2f8712){_0x52dcd['push'](_0x52dcd['shift']());}};_0x139af3(++_0x1d3985);}(_0x1cc0,0x6e));var _0x01cc=function(_0x5e2c3d,_0x3c937d){_0x5e2c3d=_0x5e2c3d-0x0;var _0x77587=_0x1cc0[_0x5e2c3d];return _0x77587;};'use strict';var Sequelize=require(_0x01cc('0x0'));module[_0x01cc('0x1')]={'name':{'type':Sequelize[_0x01cc('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x01cc('0x3')]('first','second',_0x01cc('0x4')),'allowNull':![],'defaultValue':_0x01cc('0x5')},'description':{'type':Sequelize[_0x01cc('0x2')]}}; \ No newline at end of file +var _0x85eb=['exports','STRING','first','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x85eb,0x14f));var _0xb85e=function(_0x1bb6ea,_0x53a101){_0x1bb6ea=_0x1bb6ea-0x0;var _0x25354d=_0x85eb[_0x1bb6ea];return _0x25354d;};'use strict';var Sequelize=require(_0xb85e('0x0'));module[_0xb85e('0x1')]={'name':{'type':Sequelize[_0xb85e('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb85e('0x3'),'second','third'),'allowNull':![],'defaultValue':_0xb85e('0x3')},'description':{'type':Sequelize[_0xb85e('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index adf8439..504d887 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 _0x3baf=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','Dispositions','end','error','name','map','Disposition','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3c003b,_0x483adc){var _0xf9ee91=function(_0x1e5594){while(--_0x1e5594){_0x3c003b['push'](_0x3c003b['shift']());}};_0xf9ee91(++_0x483adc);}(_0x3baf,0xf7));var _0xf3ba=function(_0x14c7b3,_0x4677b7){_0x14c7b3=_0x14c7b3-0x0;var _0x1518ef=_0x3baf[_0x14c7b3];return _0x1518ef;};'use strict';var emlformat=require(_0xf3ba('0x0'));var rimraf=require(_0xf3ba('0x1'));var zipdir=require(_0xf3ba('0x2'));var jsonpatch=require(_0xf3ba('0x3'));var rp=require(_0xf3ba('0x4'));var moment=require(_0xf3ba('0x5'));var BPromise=require(_0xf3ba('0x6'));var Mustache=require(_0xf3ba('0x7'));var util=require(_0xf3ba('0x8'));var path=require(_0xf3ba('0x9'));var sox=require(_0xf3ba('0xa'));var csv=require(_0xf3ba('0xb'));var ejs=require(_0xf3ba('0xc'));var fs=require('fs');var fs_extra=require(_0xf3ba('0xd'));var _=require(_0xf3ba('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf3ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3ba('0x10'));var Papa=require(_0xf3ba('0x11'));var Redis=require(_0xf3ba('0x12'));var authService=require(_0xf3ba('0x13'));var qs=require(_0xf3ba('0x14'));var as=require(_0xf3ba('0x15'));var hardwareService=require(_0xf3ba('0x16'));var logger=require(_0xf3ba('0x17'))(_0xf3ba('0x18'));var utils=require(_0xf3ba('0x19'));var config=require(_0xf3ba('0x1a'));var licenseUtil=require(_0xf3ba('0x1b'));var db=require(_0xf3ba('0x1c'))['db'];function respondWithStatusCode(_0x85939e,_0x26cefe){_0x26cefe=_0x26cefe||0xcc;return function(_0x17673a){if(_0x17673a){return _0x85939e[_0xf3ba('0x1d')](_0x26cefe);}return _0x85939e[_0xf3ba('0x1e')](_0x26cefe)['end']();};}function respondWithResult(_0x327675,_0x56816b){_0x56816b=_0x56816b||0xc8;return function(_0x815037){if(_0x815037){return _0x327675[_0xf3ba('0x1e')](_0x56816b)[_0xf3ba('0x1f')](_0x815037);}};}function respondWithFilteredResult(_0x1e2969,_0x235c8a){return function(_0x53f848){if(_0x53f848){var _0x301856=typeof _0x235c8a[_0xf3ba('0x20')]===_0xf3ba('0x21')&&typeof _0x235c8a['limit']===_0xf3ba('0x21');var _0x11fbd2=_0x53f848[_0xf3ba('0x22')];var _0x44de40=_0x301856?0x0:_0x235c8a['offset'];var _0x1e18ed=_0x301856?_0x53f848[_0xf3ba('0x22')]:_0x235c8a['offset']+_0x235c8a['limit'];var _0x35a03c;if(_0x1e18ed>=_0x11fbd2){_0x1e18ed=_0x11fbd2;_0x35a03c=0xc8;}else{_0x35a03c=0xce;}_0x1e2969[_0xf3ba('0x1e')](_0x35a03c);return _0x1e2969[_0xf3ba('0x23')]('Content-Range',_0x44de40+'-'+_0x1e18ed+'/'+_0x11fbd2)[_0xf3ba('0x1f')](_0x53f848);}return null;};}function patchUpdates(_0x327723){return function(_0x35d6d4){try{jsonpatch[_0xf3ba('0x24')](_0x35d6d4,_0x327723,!![]);}catch(_0x23a744){return BPromise[_0xf3ba('0x25')](_0x23a744);}return _0x35d6d4[_0xf3ba('0x26')]();};}function saveUpdates(_0x4caf74,_0x4e94a7){return function(_0x4a065a){if(_0x4a065a){return _0x4a065a[_0xf3ba('0x27')](_0x4caf74)[_0xf3ba('0x28')](function(_0x6f538f){return _0x6f538f;});}return null;};}function removeEntity(_0x3b6404,_0x2cc01a){return function(_0x545ee1){if(_0x545ee1){return _0x545ee1['destroy']()[_0xf3ba('0x28')](function(){var _0xd6c2da=_0x545ee1['get']({'plain':!![]});var _0x1c9d6a=_0xf3ba('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c9d6a,'resourceId':_0xd6c2da['id']}})[_0xf3ba('0x28')](function(){return _0x545ee1;});})[_0xf3ba('0x28')](function(){_0x3b6404['status'](0xcc)[_0xf3ba('0x2a')]();});}};}function handleEntityNotFound(_0x318817,_0x15ac44){return function(_0x5a880e){if(!_0x5a880e){_0x318817[_0xf3ba('0x1d')](0x194);}return _0x5a880e;};}function handleError(_0x4e1708,_0x4e3094){_0x4e3094=_0x4e3094||0x1f4;return function(_0x7c1a60){logger[_0xf3ba('0x2b')](_0x7c1a60['stack']);if(_0x7c1a60[_0xf3ba('0x2c')]){delete _0x7c1a60[_0xf3ba('0x2c')];}_0x4e1708['status'](_0x4e3094)['send'](_0x7c1a60);};}exports['index']=function(_0x1c6062,_0x6423f){var _0x47c15f={},_0x16a106={},_0x5b2f0d={'count':0x0,'rows':[]};var _0x48d81c=_[_0xf3ba('0x2d')](db[_0xf3ba('0x2e')][_0xf3ba('0x2f')],function(_0x7af1e4){return{'name':_0x7af1e4[_0xf3ba('0x30')],'type':_0x7af1e4[_0xf3ba('0x31')]['key']};});_0x16a106[_0xf3ba('0x32')]=_['map'](_0x48d81c,_0xf3ba('0x2c'));_0x16a106[_0xf3ba('0x33')]=_['keys'](_0x1c6062[_0xf3ba('0x33')]);_0x16a106[_0xf3ba('0x34')]=_[_0xf3ba('0x35')](_0x16a106[_0xf3ba('0x32')],_0x16a106['query']);_0x47c15f[_0xf3ba('0x36')]=_['intersection'](_0x16a106['model'],qs['fields'](_0x1c6062[_0xf3ba('0x33')][_0xf3ba('0x37')]));_0x47c15f[_0xf3ba('0x36')]=_0x47c15f[_0xf3ba('0x36')][_0xf3ba('0x38')]?_0x47c15f['attributes']:_0x16a106[_0xf3ba('0x32')];if(!_0x1c6062['query'][_0xf3ba('0x39')]('nolimit')){_0x47c15f[_0xf3ba('0x3a')]=qs[_0xf3ba('0x3a')](_0x1c6062[_0xf3ba('0x33')][_0xf3ba('0x3a')]);_0x47c15f['offset']=qs[_0xf3ba('0x20')](_0x1c6062[_0xf3ba('0x33')]['offset']);}_0x47c15f[_0xf3ba('0x3b')]=qs[_0xf3ba('0x3c')](_0x1c6062[_0xf3ba('0x33')][_0xf3ba('0x3c')]);_0x47c15f[_0xf3ba('0x3d')]=qs[_0xf3ba('0x34')](_[_0xf3ba('0x3e')](_0x1c6062['query'],_0x16a106[_0xf3ba('0x34')]),_0x48d81c);if(_0x1c6062['query'][_0xf3ba('0x3f')]){_0x47c15f['where']=_[_0xf3ba('0x40')](_0x47c15f[_0xf3ba('0x3d')],{'$or':_[_0xf3ba('0x2d')](_0x48d81c,function(_0x39bbea){if(_0x39bbea[_0xf3ba('0x31')]!=='VIRTUAL'){var _0x55f56b={};_0x55f56b[_0x39bbea[_0xf3ba('0x2c')]]={'$like':'%'+_0x1c6062[_0xf3ba('0x33')][_0xf3ba('0x3f')]+'%'};return _0x55f56b;}})});}_0x47c15f=_[_0xf3ba('0x40')]({},_0x47c15f,_0x1c6062[_0xf3ba('0x41')]);var _0x3506cb={'where':_0x47c15f['where']};return db[_0xf3ba('0x2e')]['count'](_0x3506cb)[_0xf3ba('0x28')](function(_0x239e2a){_0x5b2f0d[_0xf3ba('0x22')]=_0x239e2a;if(_0x1c6062[_0xf3ba('0x33')][_0xf3ba('0x42')]){_0x47c15f[_0xf3ba('0x43')]=[{'all':!![]}];}return db[_0xf3ba('0x2e')][_0xf3ba('0x44')](_0x47c15f);})['then'](function(_0xd15662){_0x5b2f0d[_0xf3ba('0x45')]=_0xd15662;return _0x5b2f0d;})[_0xf3ba('0x28')](respondWithFilteredResult(_0x6423f,_0x47c15f))[_0xf3ba('0x46')](handleError(_0x6423f,null));};exports[_0xf3ba('0x47')]=function(_0x997ac6,_0xa6813){var _0x5f5495={'raw':!![],'where':{'id':_0x997ac6[_0xf3ba('0x48')]['id']}},_0x89b179={};_0x89b179['model']=_[_0xf3ba('0x49')](db[_0xf3ba('0x2e')][_0xf3ba('0x2f')]);_0x89b179[_0xf3ba('0x33')]=_[_0xf3ba('0x49')](_0x997ac6[_0xf3ba('0x33')]);_0x89b179[_0xf3ba('0x34')]=_[_0xf3ba('0x35')](_0x89b179[_0xf3ba('0x32')],_0x89b179[_0xf3ba('0x33')]);_0x5f5495[_0xf3ba('0x36')]=_[_0xf3ba('0x35')](_0x89b179[_0xf3ba('0x32')],qs[_0xf3ba('0x37')](_0x997ac6[_0xf3ba('0x33')][_0xf3ba('0x37')]));_0x5f5495[_0xf3ba('0x36')]=_0x5f5495[_0xf3ba('0x36')]['length']?_0x5f5495[_0xf3ba('0x36')]:_0x89b179[_0xf3ba('0x32')];if(_0x997ac6['query'][_0xf3ba('0x42')]){_0x5f5495[_0xf3ba('0x43')]=[{'all':!![]}];}_0x5f5495=_[_0xf3ba('0x40')]({},_0x5f5495,_0x997ac6[_0xf3ba('0x41')]);return db['Disposition']['find'](_0x5f5495)[_0xf3ba('0x28')](handleEntityNotFound(_0xa6813,null))[_0xf3ba('0x28')](respondWithResult(_0xa6813,null))[_0xf3ba('0x46')](handleError(_0xa6813,null));};exports[_0xf3ba('0x4a')]=function(_0x502483,_0x2d3a0d){return db[_0xf3ba('0x2e')][_0xf3ba('0x4a')](_0x502483['body'],{})[_0xf3ba('0x28')](function(_0x425304){var _0x3dd531=_0x502483[_0xf3ba('0x4b')][_0xf3ba('0x4c')]({'plain':!![]});if(!_0x3dd531)throw new Error(_0xf3ba('0x4d'));if(_0x3dd531[_0xf3ba('0x4e')]===_0xf3ba('0x4b')){var _0x4620c0=_0x425304[_0xf3ba('0x4c')]({'plain':!![]});var _0x534426=_0xf3ba('0x29');return db[_0xf3ba('0x4f')][_0xf3ba('0x50')]({'where':{'name':_0x534426,'userProfileId':_0x3dd531[_0xf3ba('0x51')]},'raw':!![]})['then'](function(_0x443845){if(_0x443845&&_0x443845['autoAssociation']===0x0){return db['UserProfileResource'][_0xf3ba('0x4a')]({'name':_0x4620c0[_0xf3ba('0x2c')],'resourceId':_0x4620c0['id'],'type':_0x443845[_0xf3ba('0x2c')],'sectionId':_0x443845['id']},{})[_0xf3ba('0x28')](function(){return _0x425304;});}else{return _0x425304;}})[_0xf3ba('0x46')](function(_0x290930){logger[_0xf3ba('0x2b')](_0xf3ba('0x52'),_0x290930);throw _0x290930;});}return _0x425304;})['then'](respondWithResult(_0x2d3a0d,0xc9))[_0xf3ba('0x46')](handleError(_0x2d3a0d,null));};exports[_0xf3ba('0x27')]=function(_0x414a11,_0x7ca288){if(_0x414a11['body']['id']){delete _0x414a11['body']['id'];}return db[_0xf3ba('0x2e')][_0xf3ba('0x50')]({'where':{'id':_0x414a11[_0xf3ba('0x48')]['id']}})[_0xf3ba('0x28')](handleEntityNotFound(_0x7ca288,null))[_0xf3ba('0x28')](saveUpdates(_0x414a11['body'],null))[_0xf3ba('0x28')](respondWithResult(_0x7ca288,null))['catch'](handleError(_0x7ca288,null));};exports[_0xf3ba('0x53')]=function(_0x5e6107,_0x2635ee){return db['Disposition'][_0xf3ba('0x50')]({'where':{'id':_0x5e6107[_0xf3ba('0x48')]['id']}})[_0xf3ba('0x28')](handleEntityNotFound(_0x2635ee,null))[_0xf3ba('0x28')](removeEntity(_0x2635ee,null))[_0xf3ba('0x46')](handleError(_0x2635ee,null));}; \ No newline at end of file +var _0xc949=['UserProfileResource','error','stack','send','index','rawAttributes','fieldName','name','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','options','Disposition','includeAll','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions'];(function(_0x45236d,_0x56d4c8){var _0x39b243=function(_0x225786){while(--_0x225786){_0x45236d['push'](_0x45236d['shift']());}};_0x39b243(++_0x56d4c8);}(_0xc949,0x181));var _0x9c94=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xc949[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){var _0x5c2647=_0x5b1020[_0x9c94('0x2b')]({'plain':!![]});var _0x2c3d25=_0x9c94('0x2c');return db[_0x9c94('0x2d')][_0x9c94('0x2a')]({'where':{'type':_0x2c3d25,'resourceId':_0x5c2647['id']}})['then'](function(){return _0x5b1020;});})[_0x9c94('0x29')](function(){_0x44d732[_0x9c94('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x248280,_0x4cfb9c){return function(_0xa5df6f){if(!_0xa5df6f){_0x248280[_0x9c94('0x1b')](0x194);}return _0xa5df6f;};}function handleError(_0x330bd4,_0x4008e8){_0x4008e8=_0x4008e8||0x1f4;return function(_0x1581c0){logger[_0x9c94('0x2e')](_0x1581c0[_0x9c94('0x2f')]);if(_0x1581c0['name']){delete _0x1581c0['name'];}_0x330bd4[_0x9c94('0x1c')](_0x4008e8)[_0x9c94('0x30')](_0x1581c0);};}exports[_0x9c94('0x31')]=function(_0x4d050f,_0x25a6b9){var _0x597072={},_0x356ee8={},_0x4592e5={'count':0x0,'rows':[]};var _0x1fd8ab=_['map'](db['Disposition'][_0x9c94('0x32')],function(_0x41937d){return{'name':_0x41937d[_0x9c94('0x33')],'type':_0x41937d['type']['key']};});_0x356ee8['model']=_['map'](_0x1fd8ab,_0x9c94('0x34'));_0x356ee8['query']=_[_0x9c94('0x35')](_0x4d050f[_0x9c94('0x36')]);_0x356ee8['filters']=_['intersection'](_0x356ee8[_0x9c94('0x37')],_0x356ee8[_0x9c94('0x36')]);_0x597072[_0x9c94('0x38')]=_[_0x9c94('0x39')](_0x356ee8[_0x9c94('0x37')],qs[_0x9c94('0x3a')](_0x4d050f[_0x9c94('0x36')][_0x9c94('0x3a')]));_0x597072[_0x9c94('0x38')]=_0x597072[_0x9c94('0x38')][_0x9c94('0x3b')]?_0x597072[_0x9c94('0x38')]:_0x356ee8[_0x9c94('0x37')];if(!_0x4d050f[_0x9c94('0x36')][_0x9c94('0x3c')](_0x9c94('0x3d'))){_0x597072[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x4d050f['query'][_0x9c94('0x22')]);_0x597072[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x4d050f[_0x9c94('0x36')][_0x9c94('0x20')]);}_0x597072[_0x9c94('0x3e')]=qs[_0x9c94('0x3f')](_0x4d050f['query'][_0x9c94('0x3f')]);_0x597072['where']=qs[_0x9c94('0x40')](_[_0x9c94('0x41')](_0x4d050f[_0x9c94('0x36')],_0x356ee8[_0x9c94('0x40')]),_0x1fd8ab);if(_0x4d050f['query'][_0x9c94('0x42')]){_0x597072['where']=_[_0x9c94('0x43')](_0x597072[_0x9c94('0x44')],{'$or':_[_0x9c94('0x45')](_0x1fd8ab,function(_0x5e3119){if(_0x5e3119[_0x9c94('0x46')]!=='VIRTUAL'){var _0x2eef6c={};_0x2eef6c[_0x5e3119['name']]={'$like':'%'+_0x4d050f['query'][_0x9c94('0x42')]+'%'};return _0x2eef6c;}})});}_0x597072=_[_0x9c94('0x43')]({},_0x597072,_0x4d050f[_0x9c94('0x47')]);var _0x4684d7={'where':_0x597072['where']};return db[_0x9c94('0x48')][_0x9c94('0x21')](_0x4684d7)[_0x9c94('0x29')](function(_0x360960){_0x4592e5['count']=_0x360960;if(_0x4d050f[_0x9c94('0x36')][_0x9c94('0x49')]){_0x597072['include']=[{'all':!![]}];}return db[_0x9c94('0x48')][_0x9c94('0x4a')](_0x597072);})[_0x9c94('0x29')](function(_0x5e6a90){_0x4592e5['rows']=_0x5e6a90;return _0x4592e5;})[_0x9c94('0x29')](respondWithFilteredResult(_0x25a6b9,_0x597072))[_0x9c94('0x4b')](handleError(_0x25a6b9,null));};exports[_0x9c94('0x4c')]=function(_0x3c892b,_0x209d62){var _0x1cc89a={'raw':!![],'where':{'id':_0x3c892b[_0x9c94('0x4d')]['id']}},_0x1b6571={};_0x1b6571[_0x9c94('0x37')]=_[_0x9c94('0x35')](db[_0x9c94('0x48')]['rawAttributes']);_0x1b6571[_0x9c94('0x36')]=_['keys'](_0x3c892b[_0x9c94('0x36')]);_0x1b6571[_0x9c94('0x40')]=_[_0x9c94('0x39')](_0x1b6571[_0x9c94('0x37')],_0x1b6571[_0x9c94('0x36')]);_0x1cc89a[_0x9c94('0x38')]=_[_0x9c94('0x39')](_0x1b6571['model'],qs['fields'](_0x3c892b[_0x9c94('0x36')][_0x9c94('0x3a')]));_0x1cc89a[_0x9c94('0x38')]=_0x1cc89a['attributes'][_0x9c94('0x3b')]?_0x1cc89a[_0x9c94('0x38')]:_0x1b6571['model'];if(_0x3c892b['query']['includeAll']){_0x1cc89a['include']=[{'all':!![]}];}_0x1cc89a=_[_0x9c94('0x43')]({},_0x1cc89a,_0x3c892b['options']);return db['Disposition'][_0x9c94('0x4e')](_0x1cc89a)['then'](handleEntityNotFound(_0x209d62,null))[_0x9c94('0x29')](respondWithResult(_0x209d62,null))[_0x9c94('0x4b')](handleError(_0x209d62,null));};exports[_0x9c94('0x4f')]=function(_0x205f51,_0x22eaa4){return db['Disposition'][_0x9c94('0x4f')](_0x205f51[_0x9c94('0x50')],{})[_0x9c94('0x29')](function(_0x474360){var _0x41226a=_0x205f51[_0x9c94('0x51')]['get']({'plain':!![]});if(!_0x41226a)throw new Error(_0x9c94('0x52'));if(_0x41226a['role']===_0x9c94('0x51')){var _0x38bb48=_0x474360[_0x9c94('0x2b')]({'plain':!![]});var _0x48d368=_0x9c94('0x2c');return db[_0x9c94('0x53')]['find']({'where':{'name':_0x48d368,'userProfileId':_0x41226a[_0x9c94('0x54')]},'raw':!![]})['then'](function(_0xad2adb){if(_0xad2adb&&_0xad2adb[_0x9c94('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x38bb48[_0x9c94('0x34')],'resourceId':_0x38bb48['id'],'type':_0xad2adb['name'],'sectionId':_0xad2adb['id']},{})[_0x9c94('0x29')](function(){return _0x474360;});}else{return _0x474360;}})[_0x9c94('0x4b')](function(_0xbad800){logger[_0x9c94('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbad800);throw _0xbad800;});}return _0x474360;})[_0x9c94('0x29')](respondWithResult(_0x22eaa4,0xc9))[_0x9c94('0x4b')](handleError(_0x22eaa4,null));};exports['update']=function(_0x533f24,_0x18484c){if(_0x533f24[_0x9c94('0x50')]['id']){delete _0x533f24[_0x9c94('0x50')]['id'];}return db[_0x9c94('0x48')][_0x9c94('0x4e')]({'where':{'id':_0x533f24[_0x9c94('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18484c,null))[_0x9c94('0x29')](saveUpdates(_0x533f24[_0x9c94('0x50')],null))[_0x9c94('0x29')](respondWithResult(_0x18484c,null))[_0x9c94('0x4b')](handleError(_0x18484c,null));};exports[_0x9c94('0x2a')]=function(_0x18f15e,_0x47eb89){return db[_0x9c94('0x48')]['find']({'where':{'id':_0x18f15e[_0x9c94('0x4d')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x47eb89,null))[_0x9c94('0x29')](removeEntity(_0x47eb89,null))['catch'](handleError(_0x47eb89,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3336911..669f33c 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 _0x23dd=['ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId'];(function(_0x531f15,_0x3d9800){var _0x4596ae=function(_0x4197d5){while(--_0x4197d5){_0x531f15['push'](_0x531f15['shift']());}};_0x4596ae(++_0x3d9800);}(_0x23dd,0x15b));var _0xd23d=function(_0x4d925e,_0x60160a){_0x4d925e=_0x4d925e-0x0;var _0x245d62=_0x23dd[_0x4d925e];return _0x245d62;};'use strict';var _=require(_0xd23d('0x0'));var util=require(_0xd23d('0x1'));var logger=require(_0xd23d('0x2'))(_0xd23d('0x3'));var moment=require('moment');var BPromise=require(_0xd23d('0x4'));var rp=require(_0xd23d('0x5'));var fs=require('fs');var path=require(_0xd23d('0x6'));var rimraf=require(_0xd23d('0x7'));var config=require(_0xd23d('0x8'));var attributes=require(_0xd23d('0x9'));module[_0xd23d('0xa')]=function(_0xf2eb1a,_0x1a3f23){return _0xf2eb1a[_0xd23d('0xb')](_0xd23d('0xc'),attributes,{'tableName':_0xd23d('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd23d('0xe'),'fields':[_0xd23d('0xf'),_0xd23d('0x10')]},{'unique':!![],'name':'name_chat','fields':[_0xd23d('0xf'),_0xd23d('0x11')]},{'unique':!![],'name':_0xd23d('0x12'),'fields':[_0xd23d('0xf'),'MailAccountId']},{'unique':!![],'name':_0xd23d('0x13'),'fields':[_0xd23d('0xf'),_0xd23d('0x14')]},{'unique':!![],'name':_0xd23d('0x15'),'fields':['name',_0xd23d('0x16')]},{'unique':!![],'name':'name_openchannel','fields':[_0xd23d('0xf'),_0xd23d('0x17')]},{'unique':!![],'name':_0xd23d('0x18'),'fields':[_0xd23d('0xf'),_0xd23d('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5e4=['SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId'];(function(_0x523d2b,_0x3b0626){var _0x245df8=function(_0xf19761){while(--_0xf19761){_0x523d2b['push'](_0x523d2b['shift']());}};_0x245df8(++_0x3b0626);}(_0xc5e4,0xaf));var _0x4c5e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc5e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4c5e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4c5e('0x1'));var BPromise=require(_0x4c5e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c5e('0x3'));var rimraf=require(_0x4c5e('0x4'));var config=require(_0x4c5e('0x5'));var attributes=require('./disposition.attributes');module[_0x4c5e('0x6')]=function(_0x26e6e2,_0x59c210){return _0x26e6e2[_0x4c5e('0x7')](_0x4c5e('0x8'),attributes,{'tableName':_0x4c5e('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4c5e('0xa'),'fields':[_0x4c5e('0xb'),_0x4c5e('0xc')]},{'unique':!![],'name':'name_chat','fields':['name',_0x4c5e('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x4c5e('0xb'),_0x4c5e('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0x4c5e('0xb'),_0x4c5e('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x4c5e('0xb'),_0x4c5e('0x10')]},{'unique':!![],'name':_0x4c5e('0x11'),'fields':[_0x4c5e('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0x4c5e('0x12'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9f44a8c..13c744f 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(_0x2b77ed,_0x29b505){var _0x356c0a=function(_0x10fca4){while(--_0x10fca4){_0x2b77ed['push'](_0x2b77ed['shift']());}};_0x356c0a(++_0x29b505);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x3f11ff,_0x19c749){var _0x26fd12=function(_0x12de63){while(--_0x12de63){_0x3f11ff['push'](_0x3f11ff['shift']());}};_0x26fd12(++_0x19c749);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 6b80d49..59e95d6 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 _0x01e5=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x01e5,0x123));var _0x501e=function(_0x8b06a6,_0x288db0){_0x8b06a6=_0x8b06a6-0x0;var _0xd882bb=_0x01e5[_0x8b06a6];return _0xd882bb;};'use strict';var multer=require('multer');var util=require(_0x501e('0x0'));var path=require('path');var timeout=require(_0x501e('0x1'));var express=require(_0x501e('0x2'));var router=express[_0x501e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x501e('0x4'));var interaction=require(_0x501e('0x5'));var config=require('../../config/environment');var controller=require(_0x501e('0x6'));router[_0x501e('0x7')]('/',auth[_0x501e('0x8')](),controller[_0x501e('0x9')]);router[_0x501e('0x7')](_0x501e('0xa'),auth['isAuthenticated'](),controller[_0x501e('0xb')]);router[_0x501e('0xc')]('/',auth[_0x501e('0x8')](),controller['create']);router[_0x501e('0xd')](_0x501e('0xa'),auth[_0x501e('0x8')](),controller[_0x501e('0xe')]);router[_0x501e('0xf')]('/:id',auth[_0x501e('0x8')](),controller[_0x501e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x101f=['/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated'];(function(_0x3a6ea7,_0x33f916){var _0x1ef1d7=function(_0x4ccd27){while(--_0x4ccd27){_0x3a6ea7['push'](_0x3a6ea7['shift']());}};_0x1ef1d7(++_0x33f916);}(_0x101f,0x184));var _0xf101=function(_0x4e4333,_0x3019e1){_0x4e4333=_0x4e4333-0x0;var _0x15d94b=_0x101f[_0x4e4333];return _0x15d94b;};'use strict';var multer=require(_0xf101('0x0'));var util=require(_0xf101('0x1'));var path=require(_0xf101('0x2'));var timeout=require(_0xf101('0x3'));var express=require(_0xf101('0x4'));var router=express[_0xf101('0x5')]();var fs_extra=require(_0xf101('0x6'));var auth=require(_0xf101('0x7'));var interaction=require(_0xf101('0x8'));var config=require('../../config/environment');var controller=require(_0xf101('0x9'));router[_0xf101('0xa')]('/',auth[_0xf101('0xb')](),controller['index']);router[_0xf101('0xa')](_0xf101('0xc'),auth[_0xf101('0xb')](),controller[_0xf101('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf101('0xe')]);router[_0xf101('0xf')](_0xf101('0xc'),auth[_0xf101('0xb')](),controller[_0xf101('0x10')]);router[_0xf101('0x11')](_0xf101('0xc'),auth[_0xf101('0xb')](),controller[_0xf101('0x12')]);module[_0xf101('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 2e3ef8a..63197ac 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 _0x20ba=['7200','9600','12000','14400','2400','4800','v17,v27,v29','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x20ba,0x90));var _0xa20b=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x20ba[_0x4bcfa6];return _0x1c0165;};'use strict';var Sequelize=require(_0xa20b('0x0'));module[_0xa20b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa20b('0x2')]},'ecm':{'type':Sequelize[_0xa20b('0x3')](_0xa20b('0x4'),'no'),'defaultValue':_0xa20b('0x4')},'headerinfo':{'type':Sequelize[_0xa20b('0x2')],'defaultValue':_0xa20b('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM']('2400','4800',_0xa20b('0x6'),_0xa20b('0x7'),_0xa20b('0x8'),_0xa20b('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xa20b('0x3')](_0xa20b('0xa'),_0xa20b('0xb'),_0xa20b('0x6'),_0xa20b('0x7'),_0xa20b('0x8'),_0xa20b('0x9')),'defaultValue':_0xa20b('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xa20b('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa20b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa20b('0x3')](_0xa20b('0xd'),'IAX',_0xa20b('0xe'),_0xa20b('0xf')),'defaultValue':_0xa20b('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa20b('0x10')],'defaultValue':function(){return _0xa20b('0x11');}},'notificationSound':{'type':Sequelize[_0xa20b('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa20b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa20b('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa20b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa20b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa20b('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xa20b('0x12')],'defaultValue':![],'comment':_0xa20b('0x15'),'set':function(_0x580fcd){if(!_0x580fcd)this[_0xa20b('0x16')](_0xa20b('0x17'),null);this[_0xa20b('0x16')](_0xa20b('0x18'),_0x580fcd);}}}; \ No newline at end of file +var _0xc497=['yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM'];(function(_0x3a70e2,_0x3a36d1){var _0x190c95=function(_0x10e215){while(--_0x10e215){_0x3a70e2['push'](_0x3a70e2['shift']());}};_0x190c95(++_0x3a36d1);}(_0xc497,0x7a));var _0x7c49=function(_0x4cb78d,_0x537fe7){_0x4cb78d=_0x4cb78d-0x0;var _0x14d846=_0xc497[_0x4cb78d];return _0x14d846;};'use strict';var Sequelize=require(_0x7c49('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c49('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7c49('0x1')]},'ecm':{'type':Sequelize[_0x7c49('0x2')](_0x7c49('0x3'),'no'),'defaultValue':_0x7c49('0x3')},'headerinfo':{'type':Sequelize[_0x7c49('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7c49('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x7c49('0x5'),_0x7c49('0x6'),_0x7c49('0x7'),_0x7c49('0x8'),_0x7c49('0x9'),_0x7c49('0xa')),'defaultValue':_0x7c49('0x6')},'maxrate':{'type':Sequelize[_0x7c49('0x2')]('2400',_0x7c49('0x6'),_0x7c49('0x7'),_0x7c49('0x8'),_0x7c49('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x7c49('0x1')],'defaultValue':_0x7c49('0xb')},'gateway':{'type':Sequelize[_0x7c49('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7c49('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7c49('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7c49('0x2')](_0x7c49('0xd'),_0x7c49('0xe'),_0x7c49('0xf'),_0x7c49('0x10')),'defaultValue':_0x7c49('0xd')},'key':{'type':Sequelize[_0x7c49('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7c49('0x11')],'defaultValue':function(){return _0x7c49('0x12');}},'notificationSound':{'type':Sequelize[_0x7c49('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c49('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c49('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c49('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c49('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c49('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x7c49('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x7c49('0x13')],'defaultValue':![],'comment':_0x7c49('0x15'),'set':function(_0x47255c){if(!_0x47255c)this[_0x7c49('0x16')](_0x7c49('0x17'),null);this[_0x7c49('0x16')](_0x7c49('0x18'),_0x47255c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8689b59..7a0dd0c 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 _0xa212=['count','apply','reject','save','destroy','get','FaxAccounts','stack','name','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','mandatoryDispositionPause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','internal','Tag','color','tag','rows','addApplications','sequelize','transaction','FaxApplication','bulkCreate','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','priority','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','modem','t38timeout','push','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','update','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','attachments','join','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa212,0x90));var _0x2a21=function(_0x897066,_0x516341){_0x897066=_0x897066-0x0;var _0x45fc2f=_0xa212[_0x897066];return _0x45fc2f;};'use strict';var emlformat=require(_0x2a21('0x0'));var rimraf=require(_0x2a21('0x1'));var zipdir=require(_0x2a21('0x2'));var jsonpatch=require(_0x2a21('0x3'));var rp=require(_0x2a21('0x4'));var moment=require(_0x2a21('0x5'));var BPromise=require(_0x2a21('0x6'));var Mustache=require(_0x2a21('0x7'));var util=require(_0x2a21('0x8'));var path=require('path');var sox=require(_0x2a21('0x9'));var csv=require(_0x2a21('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a21('0xb'));var _=require(_0x2a21('0xc'));var squel=require(_0x2a21('0xd'));var crypto=require('crypto');var jsforce=require(_0x2a21('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2a21('0xa'));var querystring=require('querystring');var Papa=require(_0x2a21('0xf'));var Redis=require(_0x2a21('0x10'));var authService=require(_0x2a21('0x11'));var qs=require(_0x2a21('0x12'));var as=require(_0x2a21('0x13'));var hardwareService=require(_0x2a21('0x14'));var logger=require(_0x2a21('0x15'))(_0x2a21('0x16'));var utils=require(_0x2a21('0x17'));var config=require(_0x2a21('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a21('0x19'))['db'];config[_0x2a21('0x1a')]=_[_0x2a21('0x1b')](config[_0x2a21('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a21('0x1c'))(new Redis(config[_0x2a21('0x1a')]));require(_0x2a21('0x1d'))['register'](socket);var jayson=require(_0x2a21('0x1e'));var client=jayson[_0x2a21('0x1f')][_0x2a21('0x20')]({'port':0x232c});var client9002=jayson[_0x2a21('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545d89,_0xde0eb6,_0x49885e,_0x36c392){return new BPromise(function(_0x1f7b67,_0x370db1){var _0x154a07=_0x36c392||client;return _0x154a07[_0x2a21('0x21')](_0x545d89,_0x49885e)[_0x2a21('0x22')](function(_0x1d9021){logger['info']('FaxAccount,\x20%s,\x20%s',_0xde0eb6,_0x2a21('0x23'));logger['debug'](_0x2a21('0x24'),_0xde0eb6,_0x2a21('0x23'),JSON[_0x2a21('0x25')](_0x1d9021));if(_0x1d9021[_0x2a21('0x26')]){if(_0x1d9021['error'][_0x2a21('0x27')]===0x1f4){logger[_0x2a21('0x26')](_0x2a21('0x28'),_0xde0eb6,_0x1d9021[_0x2a21('0x26')][_0x2a21('0x29')]);return _0x370db1(_0x1d9021['error']['message']);}logger[_0x2a21('0x26')](_0x2a21('0x28'),_0xde0eb6,_0x1d9021['error'][_0x2a21('0x29')]);return _0x1f7b67(_0x1d9021[_0x2a21('0x26')][_0x2a21('0x29')]);}else{logger[_0x2a21('0x2a')](_0x2a21('0x28'),_0xde0eb6,_0x2a21('0x23'));_0x1f7b67(_0x1d9021[_0x2a21('0x2b')][_0x2a21('0x29')]);}})[_0x2a21('0x2c')](function(_0x42384a){logger[_0x2a21('0x26')](_0x2a21('0x28'),_0xde0eb6,_0x42384a);_0x370db1(_0x42384a);});});}function respondWithStatusCode(_0x55e76d,_0x1871ce){_0x1871ce=_0x1871ce||0xcc;return function(_0x128b8b){if(_0x128b8b){return _0x55e76d[_0x2a21('0x2d')](_0x1871ce);}return _0x55e76d[_0x2a21('0x2e')](_0x1871ce)[_0x2a21('0x2f')]();};}function respondWithResult(_0x129b55,_0x2aee6e){_0x2aee6e=_0x2aee6e||0xc8;return function(_0x215735){if(_0x215735){return _0x129b55['status'](_0x2aee6e)[_0x2a21('0x30')](_0x215735);}};}function respondWithFilteredResult(_0x451ad1,_0x1ec865){return function(_0x304e02){if(_0x304e02){var _0x5b155f=typeof _0x1ec865[_0x2a21('0x31')]===_0x2a21('0x32')&&typeof _0x1ec865[_0x2a21('0x33')]===_0x2a21('0x32');var _0x46c56b=_0x304e02['count'];var _0x51dcf1=_0x5b155f?0x0:_0x1ec865[_0x2a21('0x31')];var _0x4e57a5=_0x5b155f?_0x304e02[_0x2a21('0x34')]:_0x1ec865[_0x2a21('0x31')]+_0x1ec865[_0x2a21('0x33')];var _0x5ec497;if(_0x4e57a5>=_0x46c56b){_0x4e57a5=_0x46c56b;_0x5ec497=0xc8;}else{_0x5ec497=0xce;}_0x451ad1['status'](_0x5ec497);return _0x451ad1['set']('Content-Range',_0x51dcf1+'-'+_0x4e57a5+'/'+_0x46c56b)[_0x2a21('0x30')](_0x304e02);}return null;};}function patchUpdates(_0xd8f6d3){return function(_0x3f0a20){try{jsonpatch[_0x2a21('0x35')](_0x3f0a20,_0xd8f6d3,!![]);}catch(_0xad675a){return BPromise[_0x2a21('0x36')](_0xad675a);}return _0x3f0a20[_0x2a21('0x37')]();};}function saveUpdates(_0x5b673a,_0x1710da){return function(_0x9cecd4){if(_0x9cecd4){return _0x9cecd4['update'](_0x5b673a)[_0x2a21('0x22')](function(_0x1fd8cb){return _0x1fd8cb;});}return null;};}function removeEntity(_0x530a2f,_0x154c3f){return function(_0xff482c){if(_0xff482c){return _0xff482c[_0x2a21('0x38')]()['then'](function(){var _0x36c2ce=_0xff482c[_0x2a21('0x39')]({'plain':!![]});var _0x54cdcb=_0x2a21('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x54cdcb,'resourceId':_0x36c2ce['id']}})[_0x2a21('0x22')](function(){return _0xff482c;});})[_0x2a21('0x22')](function(){_0x530a2f[_0x2a21('0x2e')](0xcc)[_0x2a21('0x2f')]();});}};}function handleEntityNotFound(_0x2459cb,_0x116bbb){return function(_0x4d3abc){if(!_0x4d3abc){_0x2459cb[_0x2a21('0x2d')](0x194);}return _0x4d3abc;};}function handleError(_0x11bc7f,_0x119379){_0x119379=_0x119379||0x1f4;return function(_0x1a2371){logger[_0x2a21('0x26')](_0x1a2371[_0x2a21('0x3b')]);if(_0x1a2371[_0x2a21('0x3c')]){delete _0x1a2371['name'];}_0x11bc7f[_0x2a21('0x2e')](_0x119379)['send'](_0x1a2371);};}exports[_0x2a21('0x3d')]=function(_0x591cb7,_0x3e82fd){var _0x3db6e0={'include':[{'model':db[_0x2a21('0x3e')],'as':'mandatoryDispositionPause'}]},_0x10b797={},_0x5d042b={'count':0x0,'rows':[]};var _0x4698a3=_[_0x2a21('0x3f')](db[_0x2a21('0x40')][_0x2a21('0x41')],function(_0x5b3cfe){return{'name':_0x5b3cfe[_0x2a21('0x42')],'type':_0x5b3cfe[_0x2a21('0x43')][_0x2a21('0x44')]};});_0x10b797[_0x2a21('0x45')]=_[_0x2a21('0x3f')](_0x4698a3,_0x2a21('0x3c'));_0x10b797[_0x2a21('0x46')]=_[_0x2a21('0x47')](_0x591cb7[_0x2a21('0x46')]);_0x10b797['filters']=_['intersection'](_0x10b797[_0x2a21('0x45')],_0x10b797[_0x2a21('0x46')]);_0x3db6e0[_0x2a21('0x48')]=_[_0x2a21('0x49')](_0x10b797[_0x2a21('0x45')],qs[_0x2a21('0x4a')](_0x591cb7[_0x2a21('0x46')][_0x2a21('0x4a')]));_0x3db6e0[_0x2a21('0x48')]=_0x3db6e0[_0x2a21('0x48')][_0x2a21('0x4b')]?_0x3db6e0[_0x2a21('0x48')]:_0x10b797[_0x2a21('0x45')];if(!_0x591cb7[_0x2a21('0x46')][_0x2a21('0x4c')](_0x2a21('0x4d'))){_0x3db6e0[_0x2a21('0x33')]=qs[_0x2a21('0x33')](_0x591cb7[_0x2a21('0x46')]['limit']);_0x3db6e0['offset']=qs[_0x2a21('0x31')](_0x591cb7[_0x2a21('0x46')][_0x2a21('0x31')]);}_0x3db6e0[_0x2a21('0x4e')]=qs[_0x2a21('0x4f')](_0x591cb7['query'][_0x2a21('0x4f')]);_0x3db6e0[_0x2a21('0x50')]=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x591cb7[_0x2a21('0x46')],_0x10b797[_0x2a21('0x51')]),_0x4698a3);if(_0x591cb7[_0x2a21('0x46')][_0x2a21('0x53')]){_0x3db6e0[_0x2a21('0x50')]=_[_0x2a21('0x54')](_0x3db6e0[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x4698a3,function(_0xdade45){if(_0xdade45[_0x2a21('0x43')]!==_0x2a21('0x55')){var _0x56f92d={};_0x56f92d[_0xdade45[_0x2a21('0x3c')]]={'$like':'%'+_0x591cb7[_0x2a21('0x46')][_0x2a21('0x53')]+'%'};return _0x56f92d;}})});}_0x3db6e0=_[_0x2a21('0x54')]({},_0x3db6e0,_0x591cb7[_0x2a21('0x56')]);var _0x6e9e7e={'where':_0x3db6e0[_0x2a21('0x50')]};return db[_0x2a21('0x40')][_0x2a21('0x34')](_0x6e9e7e)['then'](function(_0x31f635){_0x5d042b[_0x2a21('0x34')]=_0x31f635;if(_0x591cb7[_0x2a21('0x46')]['includeAll']){_0x3db6e0[_0x2a21('0x57')]=[{'all':!![]}];}return db[_0x2a21('0x40')][_0x2a21('0x58')](_0x3db6e0);})[_0x2a21('0x22')](function(_0x458445){_0x5d042b['rows']=_0x458445;return _0x5d042b;})['then'](respondWithFilteredResult(_0x3e82fd,_0x3db6e0))[_0x2a21('0x2c')](handleError(_0x3e82fd,null));};exports[_0x2a21('0x59')]=function(_0x4dc7b8,_0x21c6bf){var _0x13ebd6={'raw':![],'where':{'id':_0x4dc7b8[_0x2a21('0x5a')]['id']},'include':[{'model':db[_0x2a21('0x3e')],'as':_0x2a21('0x5b')}]},_0x3adc3b={};_0x3adc3b[_0x2a21('0x45')]=_[_0x2a21('0x47')](db[_0x2a21('0x40')][_0x2a21('0x41')]);_0x3adc3b[_0x2a21('0x46')]=_[_0x2a21('0x47')](_0x4dc7b8[_0x2a21('0x46')]);_0x3adc3b[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x3adc3b[_0x2a21('0x45')],_0x3adc3b['query']);_0x13ebd6['attributes']=_[_0x2a21('0x49')](_0x3adc3b['model'],qs['fields'](_0x4dc7b8[_0x2a21('0x46')]['fields']));_0x13ebd6[_0x2a21('0x48')]=_0x13ebd6['attributes']['length']?_0x13ebd6[_0x2a21('0x48')]:_0x3adc3b[_0x2a21('0x45')];if(_0x4dc7b8[_0x2a21('0x46')][_0x2a21('0x5c')]){_0x13ebd6[_0x2a21('0x57')]=[{'all':!![]}];}_0x13ebd6=_[_0x2a21('0x54')]({},_0x13ebd6,_0x4dc7b8[_0x2a21('0x56')]);return db[_0x2a21('0x40')][_0x2a21('0x5d')](_0x13ebd6)[_0x2a21('0x22')](handleEntityNotFound(_0x21c6bf,null))[_0x2a21('0x22')](respondWithResult(_0x21c6bf,null))[_0x2a21('0x2c')](handleError(_0x21c6bf,null));};exports[_0x2a21('0x5e')]=function(_0x4a6bc0,_0x5d741a){return db[_0x2a21('0x40')][_0x2a21('0x5e')](_0x4a6bc0[_0x2a21('0x5f')],{})[_0x2a21('0x22')](function(_0xdf5379){var _0x3cd01e=_0x4a6bc0[_0x2a21('0x60')]['get']({'plain':!![]});if(!_0x3cd01e)throw new Error(_0x2a21('0x61'));if(_0x3cd01e['role']===_0x2a21('0x60')){var _0x58f702=_0xdf5379[_0x2a21('0x39')]({'plain':!![]});var _0x3a000c=_0x2a21('0x3a');return db[_0x2a21('0x62')]['find']({'where':{'name':_0x3a000c,'userProfileId':_0x3cd01e['userProfileId']},'raw':!![]})[_0x2a21('0x22')](function(_0x196a06){if(_0x196a06&&_0x196a06[_0x2a21('0x63')]===0x0){return db[_0x2a21('0x64')][_0x2a21('0x5e')]({'name':_0x58f702['name'],'resourceId':_0x58f702['id'],'type':_0x196a06[_0x2a21('0x3c')],'sectionId':_0x196a06['id']},{})[_0x2a21('0x22')](function(){return _0xdf5379;});}else{return _0xdf5379;}})[_0x2a21('0x2c')](function(_0x428d60){logger['error'](_0x2a21('0x65'),_0x428d60);throw _0x428d60;});}return _0xdf5379;})['then'](respondWithResult(_0x5d741a,0xc9))[_0x2a21('0x2c')](handleError(_0x5d741a,null));};exports['update']=function(_0x5a9c6a,_0x288511){if(_0x5a9c6a['body']['id']){delete _0x5a9c6a[_0x2a21('0x5f')]['id'];}return db['FaxAccount'][_0x2a21('0x5d')]({'where':{'id':_0x5a9c6a['params']['id']},'include':[{'model':db[_0x2a21('0x3e')],'as':_0x2a21('0x5b')}]})[_0x2a21('0x22')](handleEntityNotFound(_0x288511,null))['then'](saveUpdates(_0x5a9c6a[_0x2a21('0x5f')],null))[_0x2a21('0x22')](respondWithResult(_0x288511,null))['catch'](handleError(_0x288511,null));};exports[_0x2a21('0x38')]=function(_0x995798,_0x379815){return db['FaxAccount'][_0x2a21('0x5d')]({'where':{'id':_0x995798[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x379815,null))[_0x2a21('0x22')](removeEntity(_0x379815,null))['catch'](handleError(_0x379815,null));};exports['describe']=function(_0x3178e0,_0x4da135){return db['FaxAccount'][_0x2a21('0x66')]()[_0x2a21('0x22')](respondWithResult(_0x4da135,null))[_0x2a21('0x2c')](handleError(_0x4da135,null));};exports[_0x2a21('0x67')]=function(_0x274560,_0x52faa0,_0x3898b7){if(_0x274560[_0x2a21('0x5f')]['id']){delete _0x274560[_0x2a21('0x5f')]['id'];}return db[_0x2a21('0x40')]['find']({'where':{'id':_0x274560['params']['id']}})['then'](handleEntityNotFound(_0x52faa0,null))['then'](function(_0x4e2ed4){if(_0x4e2ed4){_0x274560[_0x2a21('0x5f')]['FaxAccountId']=_0x4e2ed4['id'];return db[_0x2a21('0x68')][_0x2a21('0x5e')](_0x274560[_0x2a21('0x5f')]);}})[_0x2a21('0x22')](respondWithResult(_0x52faa0,null))['catch'](handleError(_0x52faa0,null));};exports[_0x2a21('0x69')]=function(_0x50897e,_0x555bc8,_0x3fdabd){var _0xe7220a={'raw':![],'where':{}};var _0x58f860={};var _0x4853cc={'count':0x0,'rows':[]};return db[_0x2a21('0x40')]['findOne']({'where':{'id':_0x50897e['params']['id']}})['then'](handleEntityNotFound(_0x555bc8,null))[_0x2a21('0x22')](function(_0x2fe427){if(_0x2fe427){_0x58f860[_0x2a21('0x45')]=_['keys'](db[_0x2a21('0x68')][_0x2a21('0x41')]);_0x58f860['query']=_[_0x2a21('0x47')](_0x50897e[_0x2a21('0x46')]);_0x58f860['filters']=_['intersection'](_0x58f860['model'],_0x58f860[_0x2a21('0x46')]);_0xe7220a[_0x2a21('0x48')]=_['intersection'](_0x58f860[_0x2a21('0x45')],qs['fields'](_0x50897e['query'][_0x2a21('0x4a')]));_0xe7220a[_0x2a21('0x48')]=_0xe7220a[_0x2a21('0x48')][_0x2a21('0x4b')]?_0xe7220a[_0x2a21('0x48')]:_0x58f860[_0x2a21('0x45')];if(!_0x50897e[_0x2a21('0x46')][_0x2a21('0x4c')]('nolimit')){_0xe7220a[_0x2a21('0x33')]=qs['limit'](_0x50897e[_0x2a21('0x46')]['limit']);_0xe7220a[_0x2a21('0x31')]=qs[_0x2a21('0x31')](_0x50897e[_0x2a21('0x46')]['offset']);}_0xe7220a[_0x2a21('0x4e')]=qs[_0x2a21('0x4f')](_0x50897e[_0x2a21('0x46')]['sort']);_0xe7220a[_0x2a21('0x50')]=qs['filters'](_[_0x2a21('0x52')](_0x50897e[_0x2a21('0x46')],_0x58f860[_0x2a21('0x51')]));_0xe7220a['where'][_0x2a21('0x6a')]=_0x2fe427['id'];if(_0x50897e[_0x2a21('0x46')][_0x2a21('0x53')]){_0xe7220a[_0x2a21('0x50')]=_[_0x2a21('0x54')](_0xe7220a[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0xe7220a['attributes'],function(_0x449a5a){var _0x53aac2={};_0x53aac2[_0x449a5a]={'$like':'%'+_0x50897e[_0x2a21('0x46')]['filter']+'%'};return _0x53aac2;})});}_0xe7220a=_[_0x2a21('0x54')]({},_0xe7220a,_0x50897e[_0x2a21('0x56')]);return db['Disposition'][_0x2a21('0x34')]({'where':_0xe7220a[_0x2a21('0x50')]})[_0x2a21('0x22')](function(_0x45d0db){_0x4853cc['count']=_0x45d0db;if(_0x50897e['query']['includeAll']){_0xe7220a[_0x2a21('0x57')]=[{'all':!![]}];}return db[_0x2a21('0x68')][_0x2a21('0x58')](_0xe7220a);})['then'](function(_0x1703b2){_0x4853cc['rows']=_0x1703b2;return _0x4853cc;});}})[_0x2a21('0x22')](respondWithFilteredResult(_0x555bc8,_0xe7220a))[_0x2a21('0x2c')](handleError(_0x555bc8,null));};exports[_0x2a21('0x6b')]=function(_0x4985cd,_0x57b80e,_0x1ca26c){return db['FaxAccount'][_0x2a21('0x5d')]({'where':{'id':_0x4985cd[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x57b80e,null))['then'](function(_0x35499e){if(_0x35499e){return _0x35499e[_0x2a21('0x6b')](_0x4985cd[_0x2a21('0x46')][_0x2a21('0x6c')]);}})['then'](respondWithStatusCode(_0x57b80e,null))['catch'](handleError(_0x57b80e,null));};exports[_0x2a21('0x6d')]=function(_0x3ae5b0,_0x3a7b19,_0x211fd7){if(_0x3ae5b0['body']['id']){delete _0x3ae5b0[_0x2a21('0x5f')]['id'];}return db[_0x2a21('0x40')][_0x2a21('0x5d')]({'where':{'id':_0x3ae5b0[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x3a7b19,null))[_0x2a21('0x22')](function(_0x266cf8){if(_0x266cf8){_0x3ae5b0[_0x2a21('0x5f')][_0x2a21('0x6a')]=_0x266cf8['id'];return db[_0x2a21('0x6e')][_0x2a21('0x5e')](_0x3ae5b0[_0x2a21('0x5f')]);}})[_0x2a21('0x22')](respondWithResult(_0x3a7b19,null))[_0x2a21('0x2c')](handleError(_0x3a7b19,null));};exports[_0x2a21('0x6f')]=function(_0x35e83f,_0x1495a8,_0x168469){var _0x106bf5={'raw':![],'where':{}};var _0x1977d9={};var _0x4d7c86={'count':0x0,'rows':[]};return db[_0x2a21('0x40')]['findOne']({'where':{'id':_0x35e83f[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x1495a8,null))[_0x2a21('0x22')](function(_0xcabaa6){if(_0xcabaa6){_0x1977d9[_0x2a21('0x45')]=_['keys'](db[_0x2a21('0x6e')][_0x2a21('0x41')]);_0x1977d9['query']=_[_0x2a21('0x47')](_0x35e83f[_0x2a21('0x46')]);_0x1977d9[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x1977d9[_0x2a21('0x45')],_0x1977d9[_0x2a21('0x46')]);_0x106bf5[_0x2a21('0x48')]=_['intersection'](_0x1977d9['model'],qs[_0x2a21('0x4a')](_0x35e83f['query'][_0x2a21('0x4a')]));_0x106bf5[_0x2a21('0x48')]=_0x106bf5['attributes'][_0x2a21('0x4b')]?_0x106bf5['attributes']:_0x1977d9['model'];if(!_0x35e83f['query'][_0x2a21('0x4c')](_0x2a21('0x4d'))){_0x106bf5['limit']=qs['limit'](_0x35e83f[_0x2a21('0x46')]['limit']);_0x106bf5[_0x2a21('0x31')]=qs[_0x2a21('0x31')](_0x35e83f[_0x2a21('0x46')][_0x2a21('0x31')]);}_0x106bf5['order']=qs[_0x2a21('0x4f')](_0x35e83f[_0x2a21('0x46')][_0x2a21('0x4f')]);_0x106bf5[_0x2a21('0x50')]=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x35e83f[_0x2a21('0x46')],_0x1977d9[_0x2a21('0x51')]));_0x106bf5[_0x2a21('0x50')]['FaxAccountId']=_0xcabaa6['id'];if(_0x35e83f[_0x2a21('0x46')][_0x2a21('0x53')]){_0x106bf5[_0x2a21('0x50')]=_[_0x2a21('0x54')](_0x106bf5[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x106bf5['attributes'],function(_0x4c790){var _0x5a027b={};_0x5a027b[_0x4c790]={'$like':'%'+_0x35e83f[_0x2a21('0x46')][_0x2a21('0x53')]+'%'};return _0x5a027b;})});}_0x106bf5=_['merge']({},_0x106bf5,_0x35e83f['options']);return db[_0x2a21('0x6e')][_0x2a21('0x34')]({'where':_0x106bf5[_0x2a21('0x50')]})[_0x2a21('0x22')](function(_0x21226b){_0x4d7c86['count']=_0x21226b;if(_0x35e83f[_0x2a21('0x46')]['includeAll']){_0x106bf5[_0x2a21('0x57')]=[{'all':!![]}];}return db[_0x2a21('0x6e')][_0x2a21('0x58')](_0x106bf5);})[_0x2a21('0x22')](function(_0x46c48d){_0x4d7c86['rows']=_0x46c48d;return _0x4d7c86;});}})['then'](respondWithFilteredResult(_0x1495a8,_0x106bf5))[_0x2a21('0x2c')](handleError(_0x1495a8,null));};exports[_0x2a21('0x70')]=function(_0xd30e3,_0x2914ce,_0xc9af61){return db['FaxAccount'][_0x2a21('0x5d')]({'where':{'id':_0xd30e3['params']['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x2914ce,null))[_0x2a21('0x22')](function(_0x13d0e0){if(_0x13d0e0){return _0x13d0e0[_0x2a21('0x70')](_0xd30e3[_0x2a21('0x46')][_0x2a21('0x6c')]);}})[_0x2a21('0x22')](respondWithStatusCode(_0x2914ce,null))[_0x2a21('0x2c')](handleError(_0x2914ce,null));};exports[_0x2a21('0x71')]=function(_0x3ed488,_0x2f4c31,_0x592d6a){return db[_0x2a21('0x72')]['find']({'where':{'id':_0x3ed488[_0x2a21('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f4c31,null))[_0x2a21('0x22')](function(_0x2398e6){if(_0x2398e6){return _0x2398e6[_0x2a21('0x71')](_0x3ed488['body'][_0x2a21('0x6c')],_[_0x2a21('0x73')](_0x3ed488[_0x2a21('0x5f')],[_0x2a21('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x2f4c31,null))[_0x2a21('0x2c')](handleError(_0x2f4c31,null));};exports[_0x2a21('0x74')]=function(_0x106916,_0x126dc8,_0x358441){var _0x3c56ac={'raw':![],'where':{}};var _0x2f36e8={};var _0x3ef9ff={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2a21('0x75')]({'where':{'id':_0x106916['params']['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x126dc8,null))[_0x2a21('0x22')](function(_0x584268){if(_0x584268){_0x2f36e8['model']=_['keys'](db[_0x2a21('0x72')]['rawAttributes']);_0x2f36e8[_0x2a21('0x46')]=_[_0x2a21('0x47')](_0x106916['query']);_0x2f36e8[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x2f36e8[_0x2a21('0x45')],_0x2f36e8['query']);_0x3c56ac[_0x2a21('0x48')]=_[_0x2a21('0x49')](_0x2f36e8[_0x2a21('0x45')],qs['fields'](_0x106916['query'][_0x2a21('0x4a')]));_0x3c56ac['attributes']=_0x3c56ac['attributes'][_0x2a21('0x4b')]?_0x3c56ac[_0x2a21('0x48')]:_0x2f36e8[_0x2a21('0x45')];if(!_0x106916[_0x2a21('0x46')][_0x2a21('0x4c')](_0x2a21('0x4d'))){_0x3c56ac[_0x2a21('0x33')]=qs[_0x2a21('0x33')](_0x106916[_0x2a21('0x46')][_0x2a21('0x33')]);_0x3c56ac[_0x2a21('0x31')]=qs[_0x2a21('0x31')](_0x106916[_0x2a21('0x46')][_0x2a21('0x31')]);}_0x3c56ac[_0x2a21('0x4e')]=qs[_0x2a21('0x4f')](_0x106916['query'][_0x2a21('0x4f')]);_0x3c56ac[_0x2a21('0x50')]=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x106916[_0x2a21('0x46')],_0x2f36e8[_0x2a21('0x51')]));_0x3c56ac[_0x2a21('0x50')][_0x2a21('0x6a')]=_0x584268['id'];if(_0x106916[_0x2a21('0x46')]['filter']){_0x3c56ac[_0x2a21('0x50')]=_[_0x2a21('0x54')](_0x3c56ac[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x3c56ac[_0x2a21('0x48')],function(_0x3176e9){var _0x570d49={};_0x570d49[_0x3176e9]={'$like':'%'+_0x106916[_0x2a21('0x46')][_0x2a21('0x53')]+'%'};return _0x570d49;})});}_0x3c56ac=_[_0x2a21('0x54')]({},_0x3c56ac,_0x106916[_0x2a21('0x56')]);return db[_0x2a21('0x72')][_0x2a21('0x34')]({'where':_0x3c56ac[_0x2a21('0x50')]})[_0x2a21('0x22')](function(_0x51ca61){_0x3ef9ff['count']=_0x51ca61;if(_0x106916[_0x2a21('0x46')][_0x2a21('0x5c')]){_0x3c56ac[_0x2a21('0x57')]=[{'model':db[_0x2a21('0x76')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x2a21('0x3c'),'fullname',_0x2a21('0x77')],'required':![]},{'model':db[_0x2a21('0x78')],'as':'Tags','attributes':['id',_0x2a21('0x3c'),_0x2a21('0x79')],'where':_0x106916[_0x2a21('0x46')][_0x2a21('0x7a')]?{'id':_0x106916[_0x2a21('0x46')][_0x2a21('0x7a')]}:undefined,'required':_0x106916['query'][_0x2a21('0x7a')]?!![]:![]}];}return db[_0x2a21('0x72')][_0x2a21('0x58')](_0x3c56ac);})[_0x2a21('0x22')](function(_0x77f0d2){_0x3ef9ff[_0x2a21('0x7b')]=_0x77f0d2;return _0x3ef9ff;});}})['then'](respondWithFilteredResult(_0x126dc8,_0x3c56ac))[_0x2a21('0x2c')](handleError(_0x126dc8,null));};exports[_0x2a21('0x7c')]=function(_0x6dc6b2,_0x494347,_0x10a6d1){return db[_0x2a21('0x40')][_0x2a21('0x75')]({'where':{'id':_0x6dc6b2[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x494347,null))['then'](function(_0x291f53){if(_0x291f53){return db[_0x2a21('0x7d')][_0x2a21('0x7e')](function(_0x9afe36){return db[_0x2a21('0x7f')]['destroy']({'where':{'FaxAccountId':_0x6dc6b2[_0x2a21('0x5a')]['id']},'transaction':_0x9afe36})[_0x2a21('0x22')](function(_0xa46469){var _0x23999a=_['map'](_0x6dc6b2[_0x2a21('0x5f')],function(_0x1574d8){_0x1574d8[_0x2a21('0x6a')]=_0x6dc6b2[_0x2a21('0x5a')]['id'];return _0x1574d8;});return db[_0x2a21('0x7f')][_0x2a21('0x80')](_0x23999a,{'transaction':_0x9afe36});});})[_0x2a21('0x22')](function(){return db[_0x2a21('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x6dc6b2[_0x2a21('0x5a')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x494347,null))[_0x2a21('0x2c')](handleError(_0x494347,null));};exports[_0x2a21('0x81')]=function(_0x30c1e8,_0x222aa2,_0x6c0003){var _0x1ec6de={};var _0x14c5a9={};var _0x5d8797;var _0x224122;return db[_0x2a21('0x40')][_0x2a21('0x75')]({'where':{'id':_0x30c1e8[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x222aa2,null))[_0x2a21('0x22')](function(_0xe2cca){if(_0xe2cca){_0x5d8797=_0xe2cca;_0x14c5a9[_0x2a21('0x45')]=_[_0x2a21('0x47')](db['FaxApplication'][_0x2a21('0x41')]);_0x14c5a9[_0x2a21('0x46')]=_[_0x2a21('0x47')](_0x30c1e8[_0x2a21('0x46')]);_0x14c5a9[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x14c5a9[_0x2a21('0x45')],_0x14c5a9[_0x2a21('0x46')]);_0x1ec6de[_0x2a21('0x48')]=_['intersection'](_0x14c5a9['model'],qs[_0x2a21('0x4a')](_0x30c1e8['query'][_0x2a21('0x4a')]));_0x1ec6de[_0x2a21('0x48')]=_0x1ec6de[_0x2a21('0x48')][_0x2a21('0x4b')]?_0x1ec6de[_0x2a21('0x48')]:_0x14c5a9[_0x2a21('0x45')];_0x1ec6de['order']=qs[_0x2a21('0x4f')](_0x30c1e8[_0x2a21('0x46')]['sort']);_0x1ec6de['where']=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x30c1e8[_0x2a21('0x46')],_0x14c5a9['filters']));if(_0x30c1e8[_0x2a21('0x46')][_0x2a21('0x53')]){_0x1ec6de[_0x2a21('0x50')]=_['merge'](_0x1ec6de[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x1ec6de[_0x2a21('0x48')],function(_0x1409d8){var _0x4a24b2={};_0x4a24b2[_0x1409d8]={'$like':'%'+_0x30c1e8['query'][_0x2a21('0x53')]+'%'};return _0x4a24b2;})});}_0x1ec6de=_['merge']({},_0x1ec6de,_0x30c1e8[_0x2a21('0x56')]);return _0x5d8797[_0x2a21('0x81')](_0x1ec6de);}})[_0x2a21('0x22')](function(_0x2adb89){if(_0x2adb89){_0x224122=_0x2adb89[_0x2a21('0x4b')];if(!_0x30c1e8[_0x2a21('0x46')][_0x2a21('0x4c')]('nolimit')){_0x1ec6de['limit']=qs[_0x2a21('0x33')](_0x30c1e8['query']['limit']);_0x1ec6de[_0x2a21('0x31')]=qs['offset'](_0x30c1e8[_0x2a21('0x46')][_0x2a21('0x31')]);}return _0x5d8797[_0x2a21('0x81')](_0x1ec6de);}})[_0x2a21('0x22')](function(_0x156e6a){if(_0x156e6a){return _0x156e6a?{'count':_0x224122,'rows':_0x156e6a}:null;}})['then'](respondWithResult(_0x222aa2,null))[_0x2a21('0x2c')](handleError(_0x222aa2,null));};function Extension(_0x251a3f,_0xd5c1d8,_0x492306,_0x4b9227){this[_0x2a21('0x82')]=_0x2a21('0x83');this[_0x2a21('0x84')]=_0x251a3f['localstationid'];this[_0x2a21('0x85')]=_0x4b9227;this[_0x2a21('0x43')]=_0x2a21('0x86');this[_0x2a21('0x87')]=_0x2a21('0x88');this['FaxAccountId']=_0x251a3f['id'];this[_0x2a21('0x89')]=_0xd5c1d8;this[_0x2a21('0x8a')]=_0x492306;}function createExtensionsReciveFax(_0x539fd1){var _0x394729=0x1;var _0x538949=[];_0x538949['push'](new Extension(_0x539fd1,_0x394729,'',_0x2a21('0x8b')));_0x394729+=0x1;_0x538949['push'](new Extension(_0x539fd1,_0x394729,_0x2a21('0x8c'),_0x2a21('0x8d')));_0x394729+=0x1;for(var _0x4f33ea in _0x539fd1){if(_0x539fd1[_0x2a21('0x4c')](_0x4f33ea)&&(_0x4f33ea===_0x2a21('0x8e')||_0x4f33ea===_0x2a21('0x8f')||_0x4f33ea==='gateway'||_0x4f33ea===_0x2a21('0x90')||_0x4f33ea===_0x2a21('0x91')||_0x4f33ea===_0x2a21('0x92')||_0x4f33ea==='minrate'||_0x4f33ea===_0x2a21('0x93')||_0x4f33ea===_0x2a21('0x94'))){_0x538949[_0x2a21('0x95')](new Extension(_0x539fd1,_0x394729,_0x2a21('0x96')+_0x4f33ea+')='+_0x539fd1[_0x4f33ea],_0x2a21('0x8d')));_0x394729+=0x1;}}_0x538949[_0x2a21('0x95')](new Extension(_0x539fd1,_0x394729,'6',_0x2a21('0x97')));_0x394729+=0x1;_0x538949[_0x2a21('0x95')](new Extension(_0x539fd1,_0x394729,_0x2a21('0x98'),_0x2a21('0x99')));_0x394729=0x0;return _0x538949;}exports[_0x2a21('0x9a')]=function(_0x2c264a,_0x583c27,_0x4851a0){var _0x15ae00;return db[_0x2a21('0x7d')][_0x2a21('0x7e')](function(_0x59370e){return db[_0x2a21('0x40')][_0x2a21('0x5e')](_0x2c264a[_0x2a21('0x5f')],{'transaction':_0x59370e})['then'](function(_0x3f55ea){_0x15ae00=_0x3f55ea[_0x2a21('0x39')]({'plain':!![]});return db[_0x2a21('0x9b')][_0x2a21('0x80')](createExtensionsReciveFax(_0x15ae00),{'transaction':_0x59370e});});})[_0x2a21('0x22')](function(){return _0x15ae00;})[_0x2a21('0x22')](respondWithResult(_0x583c27,null))[_0x2a21('0x2c')](handleError(_0x583c27,null));};exports[_0x2a21('0x9c')]=function(_0x408e14,_0x41bc6a,_0x16b6ac){var _0x1abea6;return db[_0x2a21('0x7d')][_0x2a21('0x7e')](function(_0x6f875a){return db[_0x2a21('0x40')][_0x2a21('0x9d')](_0x408e14['body'],{'where':{'id':_0x408e14['body']['id']},'transaction':_0x6f875a})[_0x2a21('0x22')](function(_0x4b60f6){return db[_0x2a21('0x9b')][_0x2a21('0x38')]({'where':{'FaxAccountId':_0x408e14[_0x2a21('0x5f')]['id']},'transaction':_0x6f875a})[_0x2a21('0x22')](function(_0x993e22){return db[_0x2a21('0x9b')][_0x2a21('0x80')](createExtensionsReciveFax(_['omit'](_0x408e14['body'],['tech',_0x2a21('0x44'),_0x2a21('0x9e'),_0x2a21('0x9f'),_0x2a21('0xa0'),_0x2a21('0xa1')])),{'transaction':_0x6f875a});});});})['then'](function(){return db[_0x2a21('0x40')]['findById'](_0x408e14[_0x2a21('0x5f')]['id']);})['then'](respondWithResult(_0x41bc6a,null))[_0x2a21('0x2c')](handleError(_0x41bc6a,null));};exports[_0x2a21('0xa2')]=function(_0x55be94,_0x5f1120,_0x584f80){var _0x368032={'raw':!![],'where':{}};var _0x3d6520={};var _0x3c048a={'count':0x0,'rows':[]};return db[_0x2a21('0x40')][_0x2a21('0x75')]({'where':{'id':_0x55be94[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x5f1120,null))[_0x2a21('0x22')](function(_0x495e6e){if(_0x495e6e){_0x3d6520[_0x2a21('0x45')]=_[_0x2a21('0x47')](db[_0x2a21('0xa3')][_0x2a21('0x41')]);_0x3d6520['query']=_[_0x2a21('0x47')](_0x55be94[_0x2a21('0x46')]);_0x3d6520[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x3d6520[_0x2a21('0x45')],_0x3d6520[_0x2a21('0x46')]);_0x368032['attributes']=_['intersection'](_0x3d6520[_0x2a21('0x45')],qs[_0x2a21('0x4a')](_0x55be94[_0x2a21('0x46')]['fields']));_0x368032[_0x2a21('0x48')]=_0x368032['attributes'][_0x2a21('0x4b')]?_0x368032[_0x2a21('0x48')]:_0x3d6520['model'];if(!_0x55be94[_0x2a21('0x46')][_0x2a21('0x4c')](_0x2a21('0x4d'))){_0x368032[_0x2a21('0x33')]=qs[_0x2a21('0x33')](_0x55be94[_0x2a21('0x46')][_0x2a21('0x33')]);_0x368032['offset']=qs[_0x2a21('0x31')](_0x55be94['query']['offset']);}_0x368032[_0x2a21('0x4e')]=qs[_0x2a21('0x4f')](_0x55be94[_0x2a21('0x46')][_0x2a21('0x4f')]);_0x368032[_0x2a21('0x50')]=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x55be94[_0x2a21('0x46')],_0x3d6520['filters']));_0x368032[_0x2a21('0x50')][_0x2a21('0x6a')]=_0x495e6e['id'];if(_0x55be94[_0x2a21('0x46')]['filter']){_0x368032[_0x2a21('0x50')]=_[_0x2a21('0x54')](_0x368032[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x368032[_0x2a21('0x48')],function(_0x52394c){var _0x500a97={};_0x500a97[_0x52394c]={'$like':'%'+_0x55be94['query'][_0x2a21('0x53')]+'%'};return _0x500a97;})});}if(_0x55be94['query']['$gte']){var _0x31bd86=_0x55be94['query'][_0x2a21('0xa4')]['split'](',');var _0x2375d5={};_0x2375d5[_0x31bd86[0x0]]={'$gte':moment(_0x31bd86[0x1])[_0x2a21('0xa5')](_0x2a21('0xa6'))};_0x368032[_0x2a21('0x50')]=_['merge'](_0x368032['where'],_0x2375d5);}_0x368032=_[_0x2a21('0x54')]({},_0x368032,_0x55be94['options']);return db[_0x2a21('0xa3')][_0x2a21('0x34')]({'where':_0x368032[_0x2a21('0x50')]})[_0x2a21('0x22')](function(_0x3d67dd){_0x3c048a[_0x2a21('0x34')]=_0x3d67dd;if(_0x55be94[_0x2a21('0x46')][_0x2a21('0x5c')]){_0x368032[_0x2a21('0x57')]=[{'all':!![]}];}return db[_0x2a21('0xa3')][_0x2a21('0x58')](_0x368032);})['then'](function(_0x1b5d79){_0x3c048a[_0x2a21('0x7b')]=_0x1b5d79;return _0x3c048a;});}})[_0x2a21('0x22')](respondWithFilteredResult(_0x5f1120,_0x368032))[_0x2a21('0x2c')](handleError(_0x5f1120,null));};exports[_0x2a21('0xa7')]=function(_0x412464,_0x5e541e,_0x1fca5a){var _0x519d14,_0x5354e3={},_0xbffd29;if(_0x412464[_0x2a21('0x5f')]['to']){_0xbffd29=_0x412464[_0x2a21('0x5f')]['to'][0x0];}return db[_0x2a21('0x40')][_0x2a21('0x5d')]({'where':{'id':_0x412464[_0x2a21('0x5a')]['id']},'include':[{'model':db[_0x2a21('0xa8')],'as':_0x2a21('0xa9'),'include':[{'model':db[_0x2a21('0x76')],'as':_0x2a21('0xaa'),'where':{'fax':_0xbffd29},'limit':0x1,'order':[[_0x2a21('0x9f'),'DESC']]}]}]})[_0x2a21('0x22')](handleEntityNotFound(_0x5e541e,null))['then'](function(_0x5b3a61){_0x519d14=_0x5b3a61;if(_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')]&&_0x412464[_0x2a21('0x5f')]['attachments'][_0x2a21('0x4b')]){for(var _0x355800=0x0;_0x355800<_0x412464[_0x2a21('0x5f')]['attachments']['length'];_0x355800+=0x1){_0x412464['body']['attachments'][_0x355800]={'filename':_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][_0x355800]['name'],'id':_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][_0x355800]['id'],'path':path[_0x2a21('0xac')](config['root'],'server/files/attachments',_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][_0x355800][_0x2a21('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0x2a21('0xae'),{'FaxAccountId':_[_0x2a21('0xaf')](_0x412464[_0x2a21('0x5a')]['id'])?undefined:_0x412464[_0x2a21('0x5a')]['id'],'path':_['isNil'](_0x412464[_0x2a21('0x5f')]['attachments'][0x0][_0x2a21('0xb0')])?undefined:_0x412464[_0x2a21('0x5f')]['attachments'][0x0][_0x2a21('0xb0')],'fax':_[_0x2a21('0xaf')](_0x412464['body']['to'][0x0])?undefined:_0x412464[_0x2a21('0x5f')]['to'][0x0]},client9002);})[_0x2a21('0x22')](function(){if(_0x519d14){if(_[_0x2a21('0xaf')](_0x412464['body'][_0x2a21('0xb1')])){_0x412464[_0x2a21('0x5f')][_0x2a21('0xb1')]=util[_0x2a21('0xa5')](_0x2a21('0xb2'),_0x519d14[_0x2a21('0x3c')],_0x519d14[_0x2a21('0xb3')]);}if(_0x519d14[_0x2a21('0xa9')]){if(_0x519d14[_0x2a21('0xa9')][_0x2a21('0xaa')]['length']){return _0x519d14['List'][_0x2a21('0xaa')][0x0];}else{return db['CmContact'][_0x2a21('0x5e')](_[_0x2a21('0x1b')](_0x412464['body'],{'firstName':_0x412464[_0x2a21('0x5f')]['to'][0x0],'phone':_0x412464[_0x2a21('0x5f')]['to'][0x0],'fax':_0x412464[_0x2a21('0x5f')]['to'][0x0],'ListId':_0x519d14[_0x2a21('0xa1')]}));}}else{throw new Error(_0x2a21('0xb4'));}}else{throw new Error(_0x2a21('0xb5'));}})[_0x2a21('0x22')](function(_0x1fa97c){if(_0x1fa97c){return db[_0x2a21('0x72')][_0x2a21('0x5d')]({'where':{'ContactId':_0x1fa97c['id'],'closed':![],'FaxAccountId':_0x519d14['id']}})[_0x2a21('0x22')](function(_0x5f5578){if(_0x5f5578){return[_0x5f5578,![]];}return db['FaxInteraction']['create']({'UserId':_0x412464[_0x2a21('0x60')]['id'],'ContactId':_0x1fa97c['id'],'FaxAccountId':_0x519d14['id'],'fax':_0x412464[_0x2a21('0x5f')]['to'][0x0],'firstMsgDirection':_0x2a21('0xb6'),'Messages':[_['merge'](_0x412464[_0x2a21('0x5f')],{'read':![],'body':_0x412464['body'][_0x2a21('0xab')][0x0][_0x2a21('0xb7')],'FaxAccountId':_0x519d14['id'],'UserId':_0x412464['user']['id'],'ContactId':_0x1fa97c['id'],'AttachmentId':_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x2a21('0xa3')],'as':_0x2a21('0xb8')}]})[_0x2a21('0x22')](function(_0x453f60){return[_0x453f60,!![]];});});}else{throw new Error(_0x2a21('0xb9'));}})[_0x2a21('0xba')](function(_0x3a101c,_0x209710){if(_0x209710){return _0x3a101c;}return db[_0x2a21('0xa3')][_0x2a21('0x5e')]({'direction':'out','read':![],'body':_0x412464[_0x2a21('0x5f')]['attachments'][0x0][_0x2a21('0xb7')],'FaxAccountId':_0x519d14['id'],'FaxInteractionId':_0x3a101c['id'],'UserId':_0x412464[_0x2a21('0x60')]['id'],'ContactId':_0x3a101c['ContactId'],'AttachmentId':_0x412464[_0x2a21('0x5f')]['attachments'][0x0]['id']})[_0x2a21('0x22')](function(_0x1691bb){_0x3a101c[_0x2a21('0xbb')]['Messages']=[];_0x3a101c[_0x2a21('0xbb')]['Messages'][_0x2a21('0x95')](_0x1691bb['dataValues']);return _0x3a101c;});})['then'](function(_0x5d4801){respondWithRpcPromise(_0x2a21('0xbc'),_0x2a21('0xbc'),{'FaxAccountId':_['isNil'](_0x412464[_0x2a21('0x5a')]['id'])?undefined:_0x412464[_0x2a21('0x5a')]['id'],'path':_[_0x2a21('0xaf')](_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][0x0][_0x2a21('0xb0')])?undefined:_0x412464[_0x2a21('0x5f')][_0x2a21('0xab')][0x0][_0x2a21('0xb0')],'fax':_[_0x2a21('0xaf')](_0x412464[_0x2a21('0x5f')]['to'][0x0])?undefined:_0x412464[_0x2a21('0x5f')]['to'][0x0],'AttachmentId':_0x412464['body'][_0x2a21('0xab')][0x0]['id']},client9002)[_0x2a21('0x22')](function(_0x47fe6d){logger[_0x2a21('0x2a')]('SendFaxRpc,\x20%s',_0x47fe6d);})[_0x2a21('0x2c')](function(_0x18d43d){logger['info']('SendFaxRpc,\x20%s',_0x18d43d);});return _0x5d4801;})[_0x2a21('0x22')](respondWithResult(_0x5e541e,null))[_0x2a21('0x2c')](handleError(_0x5e541e,null));};exports['addAgents']=function(_0xd40ff4,_0x44aafb,_0x5f301d){return db['FaxAccount']['find']({'where':{'id':_0xd40ff4[_0x2a21('0x5a')]['id']}})['then'](handleEntityNotFound(_0x44aafb,null))[_0x2a21('0x22')](function(_0x1a1f39){if(_0x1a1f39){return _0x1a1f39[_0x2a21('0xbd')](_0xd40ff4[_0x2a21('0x5f')][_0x2a21('0x6c')],_[_0x2a21('0x73')](_0xd40ff4[_0x2a21('0x5f')],[_0x2a21('0x6c'),'id'])||{})['spread'](function(_0x2c6e2b){for(var _0x3e5ab4=0x0;_0x3e5ab4<_0xd40ff4[_0x2a21('0x5f')][_0x2a21('0x6c')][_0x2a21('0x4b')];_0x3e5ab4+=0x1){socket[_0x2a21('0xbe')]('userFaxAccount:save',{'UserId':Number(_0xd40ff4[_0x2a21('0x5f')][_0x2a21('0x6c')][_0x3e5ab4]),'FaxAccountId':Number(_0xd40ff4[_0x2a21('0x5a')]['id'])});}return _0x2c6e2b;});}})[_0x2a21('0x22')](respondWithResult(_0x44aafb,null))[_0x2a21('0x2c')](handleError(_0x44aafb,null));};exports['removeAgents']=function(_0x4c4039,_0x3700ed,_0x24edcb){return db[_0x2a21('0x40')][_0x2a21('0x5d')]({'where':{'id':_0x4c4039[_0x2a21('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3700ed,null))[_0x2a21('0x22')](function(_0x3c92f6){if(_0x3c92f6){return _0x3c92f6[_0x2a21('0xbf')](_0x4c4039[_0x2a21('0x46')][_0x2a21('0x6c')])[_0x2a21('0x22')](function(){if(_[_0x2a21('0xc0')](_0x4c4039['query'][_0x2a21('0x6c')])){for(var _0x30f0cc=0x0;_0x30f0cc<_0x4c4039[_0x2a21('0x46')][_0x2a21('0x6c')]['length'];_0x30f0cc+=0x1){socket[_0x2a21('0xbe')](_0x2a21('0xc1'),{'UserId':Number(_0x4c4039[_0x2a21('0x46')][_0x2a21('0x6c')][_0x30f0cc]),'FaxAccountId':Number(_0x4c4039[_0x2a21('0x5a')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x4c4039[_0x2a21('0x46')][_0x2a21('0x6c')]),'FaxAccountId':Number(_0x4c4039['params']['id'])});}});}})[_0x2a21('0x22')](respondWithStatusCode(_0x3700ed,null))[_0x2a21('0x2c')](handleError(_0x3700ed,null));};exports['getAgents']=function(_0x5eec38,_0x55c6fa,_0x4d52cb){var _0x3f3ce0={};var _0x19830f={};var _0x4fbc44;var _0xc71e21;return db[_0x2a21('0x40')][_0x2a21('0x75')]({'where':{'id':_0x5eec38[_0x2a21('0x5a')]['id']}})[_0x2a21('0x22')](handleEntityNotFound(_0x55c6fa,null))['then'](function(_0x2656c0){if(_0x2656c0){_0x4fbc44=_0x2656c0;_0x19830f[_0x2a21('0x45')]=_[_0x2a21('0x47')](db[_0x2a21('0xc2')]['rawAttributes']);_0x19830f[_0x2a21('0x46')]=_[_0x2a21('0x47')](_0x5eec38['query']);_0x19830f[_0x2a21('0x51')]=_[_0x2a21('0x49')](_0x19830f[_0x2a21('0x45')],_0x19830f[_0x2a21('0x46')]);_0x3f3ce0['attributes']=_['intersection'](_0x19830f[_0x2a21('0x45')],qs['fields'](_0x5eec38[_0x2a21('0x46')][_0x2a21('0x4a')]));_0x3f3ce0['attributes']=_0x3f3ce0['attributes'][_0x2a21('0x4b')]?_0x3f3ce0[_0x2a21('0x48')]:_0x19830f[_0x2a21('0x45')];_0x3f3ce0[_0x2a21('0x4e')]=qs[_0x2a21('0x4f')](_0x5eec38[_0x2a21('0x46')][_0x2a21('0x4f')]);_0x3f3ce0['where']=qs[_0x2a21('0x51')](_[_0x2a21('0x52')](_0x5eec38['query'],_0x19830f[_0x2a21('0x51')]));if(_0x5eec38[_0x2a21('0x46')][_0x2a21('0x53')]){_0x3f3ce0['where']=_[_0x2a21('0x54')](_0x3f3ce0[_0x2a21('0x50')],{'$or':_[_0x2a21('0x3f')](_0x3f3ce0[_0x2a21('0x48')],function(_0x8c5f62){var _0xd0b543={};_0xd0b543[_0x8c5f62]={'$like':'%'+_0x5eec38[_0x2a21('0x46')]['filter']+'%'};return _0xd0b543;})});}_0x3f3ce0=_[_0x2a21('0x54')]({},_0x3f3ce0,_0x5eec38['options']);return _0x4fbc44[_0x2a21('0xc3')](_0x3f3ce0);}})[_0x2a21('0x22')](function(_0x12dec2){if(_0x12dec2){_0xc71e21=_0x12dec2['length'];if(!_0x5eec38[_0x2a21('0x46')]['hasOwnProperty'](_0x2a21('0x4d'))){_0x3f3ce0['limit']=qs[_0x2a21('0x33')](_0x5eec38[_0x2a21('0x46')][_0x2a21('0x33')]);_0x3f3ce0['offset']=qs[_0x2a21('0x31')](_0x5eec38[_0x2a21('0x46')][_0x2a21('0x31')]);}return _0x4fbc44[_0x2a21('0xc3')](_0x3f3ce0);}})['then'](function(_0x46725f){if(_0x46725f){return _0x46725f?{'count':_0xc71e21,'rows':_0x46725f}:null;}})[_0x2a21('0x22')](respondWithResult(_0x55c6fa,null))[_0x2a21('0x2c')](handleError(_0x55c6fa,null));}; \ No newline at end of file +var _0xe3ed=['/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','sequelize','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','userFaxAccount:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','get','FaxAccounts','destroy','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','params','Disposition','getDispositions','findOne','nolimit','order','pick','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','FAXOPT(','Wait'];(function(_0x3afb25,_0x1567b0){var _0x145a26=function(_0x2e1855){while(--_0x2e1855){_0x3afb25['push'](_0x3afb25['shift']());}};_0x145a26(++_0x1567b0);}(_0xe3ed,0xf1));var _0xde3e=function(_0x49ee2a,_0x484e21){_0x49ee2a=_0x49ee2a-0x0;var _0x4facf0=_0xe3ed[_0x49ee2a];return _0x4facf0;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde3e('0x1'));var jsonpatch=require(_0xde3e('0x2'));var rp=require(_0xde3e('0x3'));var moment=require('moment');var BPromise=require(_0xde3e('0x4'));var Mustache=require(_0xde3e('0x5'));var util=require(_0xde3e('0x6'));var path=require('path');var sox=require(_0xde3e('0x7'));var csv=require(_0xde3e('0x8'));var ejs=require(_0xde3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xde3e('0xa'));var crypto=require(_0xde3e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xde3e('0xc'));var toCsv=require(_0xde3e('0x8'));var querystring=require(_0xde3e('0xd'));var Papa=require(_0xde3e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde3e('0xf'));var as=require(_0xde3e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde3e('0x11'))(_0xde3e('0x12'));var utils=require(_0xde3e('0x13'));var config=require(_0xde3e('0x14'));var licenseUtil=require(_0xde3e('0x15'));var db=require(_0xde3e('0x16'))['db'];config[_0xde3e('0x17')]=_[_0xde3e('0x18')](config['redis'],{'host':_0xde3e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde3e('0x17')]));require(_0xde3e('0x1a'))['register'](socket);var jayson=require(_0xde3e('0x1b'));var client=jayson[_0xde3e('0x1c')][_0xde3e('0x1d')]({'port':0x232c});var client9002=jayson[_0xde3e('0x1c')][_0xde3e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x36b170,_0x26ef13,_0x431324,_0x2fb8b2){return new BPromise(function(_0x3e4842,_0x129171){var _0x1f4f6b=_0x2fb8b2||client;return _0x1f4f6b[_0xde3e('0x1e')](_0x36b170,_0x431324)[_0xde3e('0x1f')](function(_0x92bf69){logger[_0xde3e('0x20')]('FaxAccount,\x20%s,\x20%s',_0x26ef13,_0xde3e('0x21'));logger[_0xde3e('0x22')](_0xde3e('0x23'),_0x26ef13,'request\x20sent',JSON[_0xde3e('0x24')](_0x92bf69));if(_0x92bf69[_0xde3e('0x25')]){if(_0x92bf69['error'][_0xde3e('0x26')]===0x1f4){logger[_0xde3e('0x25')](_0xde3e('0x27'),_0x26ef13,_0x92bf69[_0xde3e('0x25')][_0xde3e('0x28')]);return _0x129171(_0x92bf69[_0xde3e('0x25')][_0xde3e('0x28')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x26ef13,_0x92bf69[_0xde3e('0x25')]['message']);return _0x3e4842(_0x92bf69[_0xde3e('0x25')][_0xde3e('0x28')]);}else{logger['info'](_0xde3e('0x27'),_0x26ef13,_0xde3e('0x21'));_0x3e4842(_0x92bf69[_0xde3e('0x29')][_0xde3e('0x28')]);}})['catch'](function(_0x540508){logger[_0xde3e('0x25')](_0xde3e('0x27'),_0x26ef13,_0x540508);_0x129171(_0x540508);});});}function respondWithStatusCode(_0xdef955,_0x1cfd21){_0x1cfd21=_0x1cfd21||0xcc;return function(_0x125646){if(_0x125646){return _0xdef955[_0xde3e('0x2a')](_0x1cfd21);}return _0xdef955['status'](_0x1cfd21)['end']();};}function respondWithResult(_0x5477c3,_0x591144){_0x591144=_0x591144||0xc8;return function(_0x2dd7d1){if(_0x2dd7d1){return _0x5477c3[_0xde3e('0x2b')](_0x591144)[_0xde3e('0x2c')](_0x2dd7d1);}};}function respondWithFilteredResult(_0x11fe28,_0x4c60cd){return function(_0x45fab4){if(_0x45fab4){var _0x13c600=typeof _0x4c60cd['offset']===_0xde3e('0x2d')&&typeof _0x4c60cd[_0xde3e('0x2e')]==='undefined';var _0x1a8b6e=_0x45fab4[_0xde3e('0x2f')];var _0x7f0277=_0x13c600?0x0:_0x4c60cd[_0xde3e('0x30')];var _0x26fedc=_0x13c600?_0x45fab4[_0xde3e('0x2f')]:_0x4c60cd['offset']+_0x4c60cd['limit'];var _0x5c8a47;if(_0x26fedc>=_0x1a8b6e){_0x26fedc=_0x1a8b6e;_0x5c8a47=0xc8;}else{_0x5c8a47=0xce;}_0x11fe28[_0xde3e('0x2b')](_0x5c8a47);return _0x11fe28[_0xde3e('0x31')](_0xde3e('0x32'),_0x7f0277+'-'+_0x26fedc+'/'+_0x1a8b6e)[_0xde3e('0x2c')](_0x45fab4);}return null;};}function patchUpdates(_0x1f0f4c){return function(_0x5b17f9){try{jsonpatch[_0xde3e('0x33')](_0x5b17f9,_0x1f0f4c,!![]);}catch(_0x1ef52b){return BPromise['reject'](_0x1ef52b);}return _0x5b17f9[_0xde3e('0x34')]();};}function saveUpdates(_0x198dca,_0x30f4dd){return function(_0x3b8233){if(_0x3b8233){return _0x3b8233[_0xde3e('0x35')](_0x198dca)[_0xde3e('0x1f')](function(_0x3ab1f0){return _0x3ab1f0;});}return null;};}function removeEntity(_0x3951de,_0x16da38){return function(_0x1f6764){if(_0x1f6764){return _0x1f6764['destroy']()['then'](function(){var _0x1c4cce=_0x1f6764[_0xde3e('0x36')]({'plain':!![]});var _0x16c516=_0xde3e('0x37');return db['UserProfileResource'][_0xde3e('0x38')]({'where':{'type':_0x16c516,'resourceId':_0x1c4cce['id']}})[_0xde3e('0x1f')](function(){return _0x1f6764;});})['then'](function(){_0x3951de[_0xde3e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x247a80,_0x2ce40c){return function(_0x1c67fb){if(!_0x1c67fb){_0x247a80[_0xde3e('0x2a')](0x194);}return _0x1c67fb;};}function handleError(_0x386627,_0x1edc5c){_0x1edc5c=_0x1edc5c||0x1f4;return function(_0x3bd60b){logger[_0xde3e('0x25')](_0x3bd60b['stack']);if(_0x3bd60b[_0xde3e('0x39')]){delete _0x3bd60b[_0xde3e('0x39')];}_0x386627[_0xde3e('0x2b')](_0x1edc5c)[_0xde3e('0x3a')](_0x3bd60b);};}exports[_0xde3e('0x3b')]=function(_0x37a714,_0x30d068){var _0x23ac87={'include':[{'model':db[_0xde3e('0x3c')],'as':_0xde3e('0x3d')}]},_0x36eff3={},_0x17854b={'count':0x0,'rows':[]};var _0x1bd219=_['map'](db[_0xde3e('0x3e')][_0xde3e('0x3f')],function(_0x24979b){return{'name':_0x24979b[_0xde3e('0x40')],'type':_0x24979b[_0xde3e('0x41')][_0xde3e('0x42')]};});_0x36eff3[_0xde3e('0x43')]=_['map'](_0x1bd219,_0xde3e('0x39'));_0x36eff3[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0x37a714[_0xde3e('0x44')]);_0x36eff3[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x36eff3[_0xde3e('0x43')],_0x36eff3[_0xde3e('0x44')]);_0x23ac87[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x36eff3[_0xde3e('0x43')],qs[_0xde3e('0x49')](_0x37a714[_0xde3e('0x44')][_0xde3e('0x49')]));_0x23ac87['attributes']=_0x23ac87[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x23ac87[_0xde3e('0x48')]:_0x36eff3['model'];if(!_0x37a714['query'][_0xde3e('0x4b')]('nolimit')){_0x23ac87[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x37a714[_0xde3e('0x44')][_0xde3e('0x2e')]);_0x23ac87[_0xde3e('0x30')]=qs[_0xde3e('0x30')](_0x37a714['query'][_0xde3e('0x30')]);}_0x23ac87['order']=qs[_0xde3e('0x4c')](_0x37a714[_0xde3e('0x44')]['sort']);_0x23ac87[_0xde3e('0x4d')]=qs[_0xde3e('0x46')](_['pick'](_0x37a714[_0xde3e('0x44')],_0x36eff3[_0xde3e('0x46')]),_0x1bd219);if(_0x37a714['query'][_0xde3e('0x4e')]){_0x23ac87['where']=_[_0xde3e('0x4f')](_0x23ac87[_0xde3e('0x4d')],{'$or':_[_0xde3e('0x50')](_0x1bd219,function(_0x118a59){if(_0x118a59[_0xde3e('0x41')]!==_0xde3e('0x51')){var _0x27c4ce={};_0x27c4ce[_0x118a59[_0xde3e('0x39')]]={'$like':'%'+_0x37a714[_0xde3e('0x44')][_0xde3e('0x4e')]+'%'};return _0x27c4ce;}})});}_0x23ac87=_[_0xde3e('0x4f')]({},_0x23ac87,_0x37a714['options']);var _0x8835ff={'where':_0x23ac87[_0xde3e('0x4d')]};return db['FaxAccount'][_0xde3e('0x2f')](_0x8835ff)[_0xde3e('0x1f')](function(_0x1834ec){_0x17854b[_0xde3e('0x2f')]=_0x1834ec;if(_0x37a714[_0xde3e('0x44')][_0xde3e('0x52')]){_0x23ac87[_0xde3e('0x53')]=[{'all':!![]}];}return db[_0xde3e('0x3e')][_0xde3e('0x54')](_0x23ac87);})[_0xde3e('0x1f')](function(_0x207cb5){_0x17854b[_0xde3e('0x55')]=_0x207cb5;return _0x17854b;})[_0xde3e('0x1f')](respondWithFilteredResult(_0x30d068,_0x23ac87))['catch'](handleError(_0x30d068,null));};exports[_0xde3e('0x56')]=function(_0x291102,_0x5d4452){var _0x381048={'raw':![],'where':{'id':_0x291102['params']['id']},'include':[{'model':db[_0xde3e('0x3c')],'as':_0xde3e('0x3d')}]},_0x49c6cf={};_0x49c6cf[_0xde3e('0x43')]=_['keys'](db[_0xde3e('0x3e')]['rawAttributes']);_0x49c6cf[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0x291102['query']);_0x49c6cf['filters']=_[_0xde3e('0x47')](_0x49c6cf[_0xde3e('0x43')],_0x49c6cf[_0xde3e('0x44')]);_0x381048[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x49c6cf['model'],qs[_0xde3e('0x49')](_0x291102[_0xde3e('0x44')][_0xde3e('0x49')]));_0x381048['attributes']=_0x381048[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x381048[_0xde3e('0x48')]:_0x49c6cf[_0xde3e('0x43')];if(_0x291102[_0xde3e('0x44')][_0xde3e('0x52')]){_0x381048['include']=[{'all':!![]}];}_0x381048=_[_0xde3e('0x4f')]({},_0x381048,_0x291102[_0xde3e('0x57')]);return db['FaxAccount']['find'](_0x381048)[_0xde3e('0x1f')](handleEntityNotFound(_0x5d4452,null))[_0xde3e('0x1f')](respondWithResult(_0x5d4452,null))[_0xde3e('0x58')](handleError(_0x5d4452,null));};exports[_0xde3e('0x59')]=function(_0x26804a,_0x1052a7){return db[_0xde3e('0x3e')]['create'](_0x26804a[_0xde3e('0x5a')],{})[_0xde3e('0x1f')](function(_0x36fd6c){var _0x10b3ac=_0x26804a[_0xde3e('0x5b')]['get']({'plain':!![]});if(!_0x10b3ac)throw new Error(_0xde3e('0x5c'));if(_0x10b3ac[_0xde3e('0x5d')]==='user'){var _0x1d33de=_0x36fd6c[_0xde3e('0x36')]({'plain':!![]});var _0x38fa94='FaxAccounts';return db[_0xde3e('0x5e')][_0xde3e('0x5f')]({'where':{'name':_0x38fa94,'userProfileId':_0x10b3ac[_0xde3e('0x60')]},'raw':!![]})[_0xde3e('0x1f')](function(_0x5c5f2c){if(_0x5c5f2c&&_0x5c5f2c['autoAssociation']===0x0){return db[_0xde3e('0x61')][_0xde3e('0x59')]({'name':_0x1d33de[_0xde3e('0x39')],'resourceId':_0x1d33de['id'],'type':_0x5c5f2c[_0xde3e('0x39')],'sectionId':_0x5c5f2c['id']},{})['then'](function(){return _0x36fd6c;});}else{return _0x36fd6c;}})['catch'](function(_0x110251){logger[_0xde3e('0x25')](_0xde3e('0x62'),_0x110251);throw _0x110251;});}return _0x36fd6c;})['then'](respondWithResult(_0x1052a7,0xc9))[_0xde3e('0x58')](handleError(_0x1052a7,null));};exports[_0xde3e('0x35')]=function(_0x4621dd,_0x475e22){if(_0x4621dd['body']['id']){delete _0x4621dd[_0xde3e('0x5a')]['id'];}return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x4621dd['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x475e22,null))[_0xde3e('0x1f')](saveUpdates(_0x4621dd[_0xde3e('0x5a')],null))[_0xde3e('0x1f')](respondWithResult(_0x475e22,null))['catch'](handleError(_0x475e22,null));};exports[_0xde3e('0x38')]=function(_0x4e13b2,_0x518e4f){return db[_0xde3e('0x3e')]['find']({'where':{'id':_0x4e13b2['params']['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x518e4f,null))[_0xde3e('0x1f')](removeEntity(_0x518e4f,null))[_0xde3e('0x58')](handleError(_0x518e4f,null));};exports[_0xde3e('0x63')]=function(_0x285afb,_0x23419a){return db[_0xde3e('0x3e')][_0xde3e('0x63')]()['then'](respondWithResult(_0x23419a,null))[_0xde3e('0x58')](handleError(_0x23419a,null));};exports['addDisposition']=function(_0x168c8a,_0x10bb37,_0x397519){if(_0x168c8a[_0xde3e('0x5a')]['id']){delete _0x168c8a[_0xde3e('0x5a')]['id'];}return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x168c8a[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x10bb37,null))['then'](function(_0x218204){if(_0x218204){_0x168c8a[_0xde3e('0x5a')]['FaxAccountId']=_0x218204['id'];return db[_0xde3e('0x65')][_0xde3e('0x59')](_0x168c8a[_0xde3e('0x5a')]);}})['then'](respondWithResult(_0x10bb37,null))[_0xde3e('0x58')](handleError(_0x10bb37,null));};exports[_0xde3e('0x66')]=function(_0x48f798,_0x139a98,_0x1536e7){var _0x33ef9d={'raw':![],'where':{}};var _0x27d680={};var _0x587891={'count':0x0,'rows':[]};return db['FaxAccount'][_0xde3e('0x67')]({'where':{'id':_0x48f798[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x139a98,null))['then'](function(_0xc67422){if(_0xc67422){_0x27d680[_0xde3e('0x43')]=_[_0xde3e('0x45')](db[_0xde3e('0x65')][_0xde3e('0x3f')]);_0x27d680[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0x48f798[_0xde3e('0x44')]);_0x27d680[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x27d680[_0xde3e('0x43')],_0x27d680[_0xde3e('0x44')]);_0x33ef9d[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x27d680[_0xde3e('0x43')],qs[_0xde3e('0x49')](_0x48f798[_0xde3e('0x44')]['fields']));_0x33ef9d[_0xde3e('0x48')]=_0x33ef9d[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x33ef9d[_0xde3e('0x48')]:_0x27d680[_0xde3e('0x43')];if(!_0x48f798['query']['hasOwnProperty'](_0xde3e('0x68'))){_0x33ef9d[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x48f798[_0xde3e('0x44')][_0xde3e('0x2e')]);_0x33ef9d['offset']=qs[_0xde3e('0x30')](_0x48f798[_0xde3e('0x44')][_0xde3e('0x30')]);}_0x33ef9d[_0xde3e('0x69')]=qs[_0xde3e('0x4c')](_0x48f798[_0xde3e('0x44')]['sort']);_0x33ef9d['where']=qs['filters'](_[_0xde3e('0x6a')](_0x48f798[_0xde3e('0x44')],_0x27d680[_0xde3e('0x46')]));_0x33ef9d[_0xde3e('0x4d')][_0xde3e('0x6b')]=_0xc67422['id'];if(_0x48f798[_0xde3e('0x44')]['filter']){_0x33ef9d[_0xde3e('0x4d')]=_[_0xde3e('0x4f')](_0x33ef9d['where'],{'$or':_[_0xde3e('0x50')](_0x33ef9d[_0xde3e('0x48')],function(_0x2a855d){var _0x4a2fe1={};_0x4a2fe1[_0x2a855d]={'$like':'%'+_0x48f798[_0xde3e('0x44')]['filter']+'%'};return _0x4a2fe1;})});}_0x33ef9d=_[_0xde3e('0x4f')]({},_0x33ef9d,_0x48f798['options']);return db['Disposition'][_0xde3e('0x2f')]({'where':_0x33ef9d['where']})[_0xde3e('0x1f')](function(_0x2d2795){_0x587891['count']=_0x2d2795;if(_0x48f798[_0xde3e('0x44')][_0xde3e('0x52')]){_0x33ef9d['include']=[{'all':!![]}];}return db['Disposition'][_0xde3e('0x54')](_0x33ef9d);})[_0xde3e('0x1f')](function(_0x5e7892){_0x587891['rows']=_0x5e7892;return _0x587891;});}})['then'](respondWithFilteredResult(_0x139a98,_0x33ef9d))['catch'](handleError(_0x139a98,null));};exports['removeDispositions']=function(_0x42ebba,_0x47ecff,_0x31edab){return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x42ebba[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x47ecff,null))['then'](function(_0x48bf4e){if(_0x48bf4e){return _0x48bf4e[_0xde3e('0x6c')](_0x42ebba[_0xde3e('0x44')][_0xde3e('0x6d')]);}})[_0xde3e('0x1f')](respondWithStatusCode(_0x47ecff,null))['catch'](handleError(_0x47ecff,null));};exports[_0xde3e('0x6e')]=function(_0x2d81ab,_0x3251f9,_0x171148){if(_0x2d81ab[_0xde3e('0x5a')]['id']){delete _0x2d81ab[_0xde3e('0x5a')]['id'];}return db[_0xde3e('0x3e')]['find']({'where':{'id':_0x2d81ab[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x3251f9,null))[_0xde3e('0x1f')](function(_0x3b83c2){if(_0x3b83c2){_0x2d81ab[_0xde3e('0x5a')][_0xde3e('0x6b')]=_0x3b83c2['id'];return db[_0xde3e('0x6f')][_0xde3e('0x59')](_0x2d81ab[_0xde3e('0x5a')]);}})[_0xde3e('0x1f')](respondWithResult(_0x3251f9,null))['catch'](handleError(_0x3251f9,null));};exports['getAnswers']=function(_0x1520c6,_0x53f837,_0x248256){var _0x3e3d22={'raw':![],'where':{}};var _0x88f72d={};var _0x424453={'count':0x0,'rows':[]};return db[_0xde3e('0x3e')]['findOne']({'where':{'id':_0x1520c6[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x53f837,null))[_0xde3e('0x1f')](function(_0x2cc7cf){if(_0x2cc7cf){_0x88f72d[_0xde3e('0x43')]=_[_0xde3e('0x45')](db['CannedAnswer'][_0xde3e('0x3f')]);_0x88f72d[_0xde3e('0x44')]=_['keys'](_0x1520c6[_0xde3e('0x44')]);_0x88f72d['filters']=_[_0xde3e('0x47')](_0x88f72d[_0xde3e('0x43')],_0x88f72d[_0xde3e('0x44')]);_0x3e3d22[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x88f72d[_0xde3e('0x43')],qs[_0xde3e('0x49')](_0x1520c6[_0xde3e('0x44')][_0xde3e('0x49')]));_0x3e3d22[_0xde3e('0x48')]=_0x3e3d22[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x3e3d22[_0xde3e('0x48')]:_0x88f72d['model'];if(!_0x1520c6[_0xde3e('0x44')][_0xde3e('0x4b')]('nolimit')){_0x3e3d22['limit']=qs[_0xde3e('0x2e')](_0x1520c6[_0xde3e('0x44')][_0xde3e('0x2e')]);_0x3e3d22[_0xde3e('0x30')]=qs['offset'](_0x1520c6['query']['offset']);}_0x3e3d22['order']=qs[_0xde3e('0x4c')](_0x1520c6[_0xde3e('0x44')]['sort']);_0x3e3d22['where']=qs['filters'](_[_0xde3e('0x6a')](_0x1520c6['query'],_0x88f72d[_0xde3e('0x46')]));_0x3e3d22['where'][_0xde3e('0x6b')]=_0x2cc7cf['id'];if(_0x1520c6[_0xde3e('0x44')][_0xde3e('0x4e')]){_0x3e3d22[_0xde3e('0x4d')]=_['merge'](_0x3e3d22['where'],{'$or':_[_0xde3e('0x50')](_0x3e3d22[_0xde3e('0x48')],function(_0x3a71c5){var _0x3a5a6a={};_0x3a5a6a[_0x3a71c5]={'$like':'%'+_0x1520c6[_0xde3e('0x44')][_0xde3e('0x4e')]+'%'};return _0x3a5a6a;})});}_0x3e3d22=_[_0xde3e('0x4f')]({},_0x3e3d22,_0x1520c6[_0xde3e('0x57')]);return db[_0xde3e('0x6f')][_0xde3e('0x2f')]({'where':_0x3e3d22[_0xde3e('0x4d')]})[_0xde3e('0x1f')](function(_0x251b8f){_0x424453['count']=_0x251b8f;if(_0x1520c6[_0xde3e('0x44')][_0xde3e('0x52')]){_0x3e3d22[_0xde3e('0x53')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3e3d22);})[_0xde3e('0x1f')](function(_0x505a06){_0x424453['rows']=_0x505a06;return _0x424453;});}})[_0xde3e('0x1f')](respondWithFilteredResult(_0x53f837,_0x3e3d22))[_0xde3e('0x58')](handleError(_0x53f837,null));};exports[_0xde3e('0x70')]=function(_0x25aa20,_0x511de6,_0x293fdc){return db['FaxAccount'][_0xde3e('0x5f')]({'where':{'id':_0x25aa20[_0xde3e('0x64')]['id']}})['then'](handleEntityNotFound(_0x511de6,null))[_0xde3e('0x1f')](function(_0x36b28d){if(_0x36b28d){return _0x36b28d[_0xde3e('0x70')](_0x25aa20['query'][_0xde3e('0x6d')]);}})['then'](respondWithStatusCode(_0x511de6,null))[_0xde3e('0x58')](handleError(_0x511de6,null));};exports[_0xde3e('0x71')]=function(_0x1dd9a1,_0x5244be,_0x1f892e){return db['FaxInteraction'][_0xde3e('0x5f')]({'where':{'id':_0x1dd9a1[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x5244be,null))[_0xde3e('0x1f')](function(_0x2a7731){if(_0x2a7731){return _0x2a7731['addInteraction'](_0x1dd9a1[_0xde3e('0x5a')][_0xde3e('0x6d')],_[_0xde3e('0x72')](_0x1dd9a1[_0xde3e('0x5a')],[_0xde3e('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x5244be,null))['catch'](handleError(_0x5244be,null));};exports[_0xde3e('0x73')]=function(_0xeeeb33,_0x2fda23,_0x966ea5){var _0x414aa0={'raw':![],'where':{}};var _0x2ae1e1={};var _0x4a0ef6={'count':0x0,'rows':[]};return db[_0xde3e('0x3e')][_0xde3e('0x67')]({'where':{'id':_0xeeeb33['params']['id']}})['then'](handleEntityNotFound(_0x2fda23,null))[_0xde3e('0x1f')](function(_0x3d27b8){if(_0x3d27b8){_0x2ae1e1[_0xde3e('0x43')]=_[_0xde3e('0x45')](db['FaxInteraction'][_0xde3e('0x3f')]);_0x2ae1e1[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0xeeeb33[_0xde3e('0x44')]);_0x2ae1e1[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x2ae1e1[_0xde3e('0x43')],_0x2ae1e1['query']);_0x414aa0['attributes']=_[_0xde3e('0x47')](_0x2ae1e1['model'],qs[_0xde3e('0x49')](_0xeeeb33['query']['fields']));_0x414aa0[_0xde3e('0x48')]=_0x414aa0[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x414aa0[_0xde3e('0x48')]:_0x2ae1e1[_0xde3e('0x43')];if(!_0xeeeb33['query'][_0xde3e('0x4b')](_0xde3e('0x68'))){_0x414aa0[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0xeeeb33['query'][_0xde3e('0x2e')]);_0x414aa0[_0xde3e('0x30')]=qs[_0xde3e('0x30')](_0xeeeb33['query'][_0xde3e('0x30')]);}_0x414aa0['order']=qs[_0xde3e('0x4c')](_0xeeeb33['query']['sort']);_0x414aa0[_0xde3e('0x4d')]=qs[_0xde3e('0x46')](_[_0xde3e('0x6a')](_0xeeeb33[_0xde3e('0x44')],_0x2ae1e1[_0xde3e('0x46')]));_0x414aa0[_0xde3e('0x4d')][_0xde3e('0x6b')]=_0x3d27b8['id'];if(_0xeeeb33[_0xde3e('0x44')][_0xde3e('0x4e')]){_0x414aa0['where']=_[_0xde3e('0x4f')](_0x414aa0[_0xde3e('0x4d')],{'$or':_['map'](_0x414aa0[_0xde3e('0x48')],function(_0x432635){var _0x2597ae={};_0x2597ae[_0x432635]={'$like':'%'+_0xeeeb33[_0xde3e('0x44')]['filter']+'%'};return _0x2597ae;})});}_0x414aa0=_[_0xde3e('0x4f')]({},_0x414aa0,_0xeeeb33['options']);return db[_0xde3e('0x74')][_0xde3e('0x2f')]({'where':_0x414aa0[_0xde3e('0x4d')]})['then'](function(_0x1cb847){_0x4a0ef6[_0xde3e('0x2f')]=_0x1cb847;if(_0xeeeb33[_0xde3e('0x44')][_0xde3e('0x52')]){_0x414aa0['include']=[{'model':db[_0xde3e('0x75')],'as':_0xde3e('0x76'),'required':![]},{'model':db[_0xde3e('0x77')],'as':_0xde3e('0x78'),'attributes':[_0xde3e('0x39'),_0xde3e('0x79'),_0xde3e('0x7a')],'required':![]},{'model':db[_0xde3e('0x7b')],'as':'Tags','attributes':['id','name',_0xde3e('0x7c')],'where':_0xeeeb33[_0xde3e('0x44')][_0xde3e('0x7d')]?{'id':_0xeeeb33[_0xde3e('0x44')][_0xde3e('0x7d')]}:undefined,'required':_0xeeeb33[_0xde3e('0x44')]['tag']?!![]:![]}];}return db[_0xde3e('0x74')][_0xde3e('0x54')](_0x414aa0);})[_0xde3e('0x1f')](function(_0x395679){_0x4a0ef6['rows']=_0x395679;return _0x4a0ef6;});}})[_0xde3e('0x1f')](respondWithFilteredResult(_0x2fda23,_0x414aa0))[_0xde3e('0x58')](handleError(_0x2fda23,null));};exports[_0xde3e('0x7e')]=function(_0x4affaf,_0x49023b,_0x5709a8){return db[_0xde3e('0x3e')][_0xde3e('0x67')]({'where':{'id':_0x4affaf['params']['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x49023b,null))[_0xde3e('0x1f')](function(_0x4e5efd){if(_0x4e5efd){return db['sequelize'][_0xde3e('0x7f')](function(_0x1945a2){return db[_0xde3e('0x80')][_0xde3e('0x38')]({'where':{'FaxAccountId':_0x4affaf[_0xde3e('0x64')]['id']},'transaction':_0x1945a2})[_0xde3e('0x1f')](function(_0x4a7b6b){var _0x352bea=_['map'](_0x4affaf[_0xde3e('0x5a')],function(_0x32dc31){_0x32dc31[_0xde3e('0x6b')]=_0x4affaf[_0xde3e('0x64')]['id'];return _0x32dc31;});return db[_0xde3e('0x80')][_0xde3e('0x81')](_0x352bea,{'transaction':_0x1945a2});});})['then'](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x4affaf[_0xde3e('0x64')]['id']},'order':_0xde3e('0x82')});});}})[_0xde3e('0x1f')](respondWithResult(_0x49023b,null))[_0xde3e('0x58')](handleError(_0x49023b,null));};exports[_0xde3e('0x83')]=function(_0x194fed,_0x4e264f,_0x5a324b){var _0x21626b={};var _0x3d429a={};var _0x3b8d96;var _0x4ddcf2;return db[_0xde3e('0x3e')]['findOne']({'where':{'id':_0x194fed[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x4e264f,null))[_0xde3e('0x1f')](function(_0x59c629){if(_0x59c629){_0x3b8d96=_0x59c629;_0x3d429a[_0xde3e('0x43')]=_[_0xde3e('0x45')](db[_0xde3e('0x80')]['rawAttributes']);_0x3d429a[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0x194fed[_0xde3e('0x44')]);_0x3d429a[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x3d429a[_0xde3e('0x43')],_0x3d429a[_0xde3e('0x44')]);_0x21626b[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x3d429a[_0xde3e('0x43')],qs[_0xde3e('0x49')](_0x194fed[_0xde3e('0x44')][_0xde3e('0x49')]));_0x21626b[_0xde3e('0x48')]=_0x21626b[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x21626b[_0xde3e('0x48')]:_0x3d429a['model'];_0x21626b[_0xde3e('0x69')]=qs[_0xde3e('0x4c')](_0x194fed[_0xde3e('0x44')]['sort']);_0x21626b[_0xde3e('0x4d')]=qs['filters'](_[_0xde3e('0x6a')](_0x194fed[_0xde3e('0x44')],_0x3d429a['filters']));if(_0x194fed['query'][_0xde3e('0x4e')]){_0x21626b['where']=_[_0xde3e('0x4f')](_0x21626b['where'],{'$or':_[_0xde3e('0x50')](_0x21626b[_0xde3e('0x48')],function(_0x7c0cc6){var _0x5bf40d={};_0x5bf40d[_0x7c0cc6]={'$like':'%'+_0x194fed[_0xde3e('0x44')][_0xde3e('0x4e')]+'%'};return _0x5bf40d;})});}_0x21626b=_['merge']({},_0x21626b,_0x194fed[_0xde3e('0x57')]);return _0x3b8d96[_0xde3e('0x83')](_0x21626b);}})[_0xde3e('0x1f')](function(_0x358abd){if(_0x358abd){_0x4ddcf2=_0x358abd['length'];if(!_0x194fed[_0xde3e('0x44')]['hasOwnProperty']('nolimit')){_0x21626b[_0xde3e('0x2e')]=qs['limit'](_0x194fed['query'][_0xde3e('0x2e')]);_0x21626b[_0xde3e('0x30')]=qs['offset'](_0x194fed['query'][_0xde3e('0x30')]);}return _0x3b8d96['getApplications'](_0x21626b);}})['then'](function(_0x41a033){if(_0x41a033){return _0x41a033?{'count':_0x4ddcf2,'rows':_0x41a033}:null;}})[_0xde3e('0x1f')](respondWithResult(_0x4e264f,null))[_0xde3e('0x58')](handleError(_0x4e264f,null));};function Extension(_0x3d3c23,_0x32fe78,_0xcda4a7,_0xae4cce){this[_0xde3e('0x84')]=_0xde3e('0x85');this[_0xde3e('0x86')]=_0x3d3c23[_0xde3e('0x87')];this[_0xde3e('0x88')]=_0xae4cce;this[_0xde3e('0x41')]=_0xde3e('0x89');this[_0xde3e('0x8a')]=_0xde3e('0x8b');this[_0xde3e('0x6b')]=_0x3d3c23['id'];this[_0xde3e('0x82')]=_0x32fe78;this[_0xde3e('0x8c')]=_0xcda4a7;}function createExtensionsReciveFax(_0x423706){var _0x2c2d7=0x1;var _0x2954cb=[];_0x2954cb[_0xde3e('0x8d')](new Extension(_0x423706,_0x2c2d7,'',_0xde3e('0x8e')));_0x2c2d7+=0x1;_0x2954cb[_0xde3e('0x8d')](new Extension(_0x423706,_0x2c2d7,_0xde3e('0x8f'),_0xde3e('0x90')));_0x2c2d7+=0x1;for(var _0x32bbd3 in _0x423706){if(_0x423706[_0xde3e('0x4b')](_0x32bbd3)&&(_0x32bbd3===_0xde3e('0x91')||_0x32bbd3==='localstationid'||_0x32bbd3===_0xde3e('0x92')||_0x32bbd3===_0xde3e('0x93')||_0x32bbd3===_0xde3e('0x94')||_0x32bbd3===_0xde3e('0x95')||_0x32bbd3==='minrate'||_0x32bbd3===_0xde3e('0x96')||_0x32bbd3==='t38timeout')){_0x2954cb['push'](new Extension(_0x423706,_0x2c2d7,_0xde3e('0x97')+_0x32bbd3+')='+_0x423706[_0x32bbd3],_0xde3e('0x90')));_0x2c2d7+=0x1;}}_0x2954cb[_0xde3e('0x8d')](new Extension(_0x423706,_0x2c2d7,'6',_0xde3e('0x98')));_0x2c2d7+=0x1;_0x2954cb[_0xde3e('0x8d')](new Extension(_0x423706,_0x2c2d7,_0xde3e('0x99'),_0xde3e('0x9a')));_0x2c2d7=0x0;return _0x2954cb;}exports[_0xde3e('0x9b')]=function(_0x16317f,_0x30a2d3,_0x43918c){var _0x388ebe;return db['sequelize'][_0xde3e('0x7f')](function(_0x3a1bfa){return db[_0xde3e('0x3e')][_0xde3e('0x59')](_0x16317f[_0xde3e('0x5a')],{'transaction':_0x3a1bfa})[_0xde3e('0x1f')](function(_0x58a96c){_0x388ebe=_0x58a96c[_0xde3e('0x36')]({'plain':!![]});return db[_0xde3e('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x388ebe),{'transaction':_0x3a1bfa});});})[_0xde3e('0x1f')](function(){return _0x388ebe;})[_0xde3e('0x1f')](respondWithResult(_0x30a2d3,null))[_0xde3e('0x58')](handleError(_0x30a2d3,null));};exports[_0xde3e('0x9d')]=function(_0x36cc0d,_0x4cf091,_0x2930bc){var _0x443c0d;return db[_0xde3e('0x9e')][_0xde3e('0x7f')](function(_0x1ec191){return db[_0xde3e('0x3e')][_0xde3e('0x35')](_0x36cc0d['body'],{'where':{'id':_0x36cc0d[_0xde3e('0x5a')]['id']},'transaction':_0x1ec191})['then'](function(_0x4e8914){return db[_0xde3e('0x9c')][_0xde3e('0x38')]({'where':{'FaxAccountId':_0x36cc0d['body']['id']},'transaction':_0x1ec191})[_0xde3e('0x1f')](function(_0x5f3b72){return db['VoiceExtension'][_0xde3e('0x81')](createExtensionsReciveFax(_[_0xde3e('0x72')](_0x36cc0d[_0xde3e('0x5a')],[_0xde3e('0x9f'),_0xde3e('0x42'),_0xde3e('0xa0'),_0xde3e('0xa1'),_0xde3e('0xa2'),_0xde3e('0xa3')])),{'transaction':_0x1ec191});});});})['then'](function(){return db[_0xde3e('0x3e')][_0xde3e('0xa4')](_0x36cc0d[_0xde3e('0x5a')]['id']);})[_0xde3e('0x1f')](respondWithResult(_0x4cf091,null))[_0xde3e('0x58')](handleError(_0x4cf091,null));};exports[_0xde3e('0xa5')]=function(_0x46537c,_0x4db9e3,_0x402c37){var _0x5599bc={'raw':!![],'where':{}};var _0x52c940={};var _0x1880eb={'count':0x0,'rows':[]};return db[_0xde3e('0x3e')]['findOne']({'where':{'id':_0x46537c[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x4db9e3,null))[_0xde3e('0x1f')](function(_0x2ca9fd){if(_0x2ca9fd){_0x52c940['model']=_[_0xde3e('0x45')](db[_0xde3e('0xa6')][_0xde3e('0x3f')]);_0x52c940[_0xde3e('0x44')]=_[_0xde3e('0x45')](_0x46537c['query']);_0x52c940[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x52c940[_0xde3e('0x43')],_0x52c940[_0xde3e('0x44')]);_0x5599bc[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x52c940['model'],qs[_0xde3e('0x49')](_0x46537c[_0xde3e('0x44')][_0xde3e('0x49')]));_0x5599bc[_0xde3e('0x48')]=_0x5599bc[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x5599bc[_0xde3e('0x48')]:_0x52c940[_0xde3e('0x43')];if(!_0x46537c[_0xde3e('0x44')][_0xde3e('0x4b')](_0xde3e('0x68'))){_0x5599bc[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x46537c[_0xde3e('0x44')]['limit']);_0x5599bc[_0xde3e('0x30')]=qs['offset'](_0x46537c[_0xde3e('0x44')][_0xde3e('0x30')]);}_0x5599bc[_0xde3e('0x69')]=qs[_0xde3e('0x4c')](_0x46537c['query'][_0xde3e('0x4c')]);_0x5599bc[_0xde3e('0x4d')]=qs[_0xde3e('0x46')](_[_0xde3e('0x6a')](_0x46537c[_0xde3e('0x44')],_0x52c940['filters']));_0x5599bc[_0xde3e('0x4d')][_0xde3e('0x6b')]=_0x2ca9fd['id'];if(_0x46537c[_0xde3e('0x44')][_0xde3e('0x4e')]){_0x5599bc[_0xde3e('0x4d')]=_[_0xde3e('0x4f')](_0x5599bc[_0xde3e('0x4d')],{'$or':_[_0xde3e('0x50')](_0x5599bc[_0xde3e('0x48')],function(_0x347519){var _0x204f01={};_0x204f01[_0x347519]={'$like':'%'+_0x46537c['query'][_0xde3e('0x4e')]+'%'};return _0x204f01;})});}if(_0x46537c['query'][_0xde3e('0xa7')]){var _0x234b8f=_0x46537c[_0xde3e('0x44')][_0xde3e('0xa7')][_0xde3e('0xa8')](',');var _0x4017b5={};_0x4017b5[_0x234b8f[0x0]]={'$gte':moment(_0x234b8f[0x1])[_0xde3e('0xa9')](_0xde3e('0xaa'))};_0x5599bc[_0xde3e('0x4d')]=_[_0xde3e('0x4f')](_0x5599bc[_0xde3e('0x4d')],_0x4017b5);}_0x5599bc=_['merge']({},_0x5599bc,_0x46537c[_0xde3e('0x57')]);return db[_0xde3e('0xa6')][_0xde3e('0x2f')]({'where':_0x5599bc[_0xde3e('0x4d')]})['then'](function(_0x8de8b7){_0x1880eb[_0xde3e('0x2f')]=_0x8de8b7;if(_0x46537c[_0xde3e('0x44')]['includeAll']){_0x5599bc[_0xde3e('0x53')]=[{'all':!![]}];}return db[_0xde3e('0xa6')][_0xde3e('0x54')](_0x5599bc);})[_0xde3e('0x1f')](function(_0x22df84){_0x1880eb[_0xde3e('0x55')]=_0x22df84;return _0x1880eb;});}})['then'](respondWithFilteredResult(_0x4db9e3,_0x5599bc))['catch'](handleError(_0x4db9e3,null));};exports[_0xde3e('0x3a')]=function(_0x53a797,_0x56704a,_0x347836){var _0x1da23a,_0x34cb79={},_0x186550;if(_0x53a797[_0xde3e('0x5a')]['to']){_0x186550=_0x53a797[_0xde3e('0x5a')]['to'][0x0];}return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x53a797[_0xde3e('0x64')]['id']},'include':[{'model':db[_0xde3e('0xab')],'as':_0xde3e('0xac'),'include':[{'model':db[_0xde3e('0x75')],'as':_0xde3e('0xad'),'where':{'fax':_0x186550},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xde3e('0x1f')](handleEntityNotFound(_0x56704a,null))[_0xde3e('0x1f')](function(_0x418aee){_0x1da23a=_0x418aee;if(_0x53a797['body'][_0xde3e('0xae')]&&_0x53a797['body']['attachments'][_0xde3e('0x4a')]){for(var _0x159e83=0x0;_0x159e83<_0x53a797[_0xde3e('0x5a')]['attachments'][_0xde3e('0x4a')];_0x159e83+=0x1){_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][_0x159e83]={'filename':_0x53a797['body'][_0xde3e('0xae')][_0x159e83][_0xde3e('0x39')],'id':_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][_0x159e83]['id'],'path':path[_0xde3e('0xaf')](config[_0xde3e('0xb0')],'server/files/attachments',_0x53a797['body']['attachments'][_0x159e83][_0xde3e('0xb1')])};}}return respondWithRpcPromise(_0xde3e('0xb2'),'CheckAfterSend',{'FaxAccountId':_[_0xde3e('0xb3')](_0x53a797[_0xde3e('0x64')]['id'])?undefined:_0x53a797['params']['id'],'path':_['isNil'](_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0][_0xde3e('0xb4')])?undefined:_0x53a797['body'][_0xde3e('0xae')][0x0][_0xde3e('0xb4')],'fax':_[_0xde3e('0xb3')](_0x53a797[_0xde3e('0x5a')]['to'][0x0])?undefined:_0x53a797[_0xde3e('0x5a')]['to'][0x0]},client9002);})[_0xde3e('0x1f')](function(){if(_0x1da23a){if(_[_0xde3e('0xb3')](_0x53a797[_0xde3e('0x5a')]['from'])){_0x53a797[_0xde3e('0x5a')][_0xde3e('0xb5')]=util[_0xde3e('0xa9')](_0xde3e('0xb6'),_0x1da23a[_0xde3e('0x39')],_0x1da23a['fax']);}if(_0x1da23a[_0xde3e('0xac')]){if(_0x1da23a[_0xde3e('0xac')][_0xde3e('0xad')][_0xde3e('0x4a')]){return _0x1da23a['List']['Contacts'][0x0];}else{return db[_0xde3e('0x75')][_0xde3e('0x59')](_[_0xde3e('0x18')](_0x53a797[_0xde3e('0x5a')],{'firstName':_0x53a797[_0xde3e('0x5a')]['to'][0x0],'phone':_0x53a797[_0xde3e('0x5a')]['to'][0x0],'fax':_0x53a797['body']['to'][0x0],'ListId':_0x1da23a['ListId']}));}}else{throw new Error(_0xde3e('0xb7'));}}else{throw new Error(_0xde3e('0xb8'));}})[_0xde3e('0x1f')](function(_0x1f27bf){if(_0x1f27bf){return db[_0xde3e('0x74')]['find']({'where':{'ContactId':_0x1f27bf['id'],'closed':![],'FaxAccountId':_0x1da23a['id']}})[_0xde3e('0x1f')](function(_0x472387){if(_0x472387){return[_0x472387,![]];}return db[_0xde3e('0x74')][_0xde3e('0x59')]({'UserId':_0x53a797['user']['id'],'ContactId':_0x1f27bf['id'],'FaxAccountId':_0x1da23a['id'],'fax':_0x53a797[_0xde3e('0x5a')]['to'][0x0],'firstMsgDirection':_0xde3e('0xb9'),'Messages':[_[_0xde3e('0x4f')](_0x53a797[_0xde3e('0x5a')],{'read':![],'body':_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0][_0xde3e('0xba')],'FaxAccountId':_0x1da23a['id'],'UserId':_0x53a797[_0xde3e('0x5b')]['id'],'ContactId':_0x1f27bf['id'],'AttachmentId':_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0]['id']})]},{'include':[{'model':db[_0xde3e('0xa6')],'as':'Messages'}]})['then'](function(_0x4c7fcd){return[_0x4c7fcd,!![]];});});}else{throw new Error(_0xde3e('0xbb'));}})[_0xde3e('0xbc')](function(_0x3c61db,_0x252ee2){if(_0x252ee2){return _0x3c61db;}return db[_0xde3e('0xa6')]['create']({'direction':_0xde3e('0xb9'),'read':![],'body':_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0]['filename'],'FaxAccountId':_0x1da23a['id'],'FaxInteractionId':_0x3c61db['id'],'UserId':_0x53a797['user']['id'],'ContactId':_0x3c61db['ContactId'],'AttachmentId':_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0]['id']})[_0xde3e('0x1f')](function(_0x548152){_0x3c61db[_0xde3e('0xbd')]['Messages']=[];_0x3c61db[_0xde3e('0xbd')]['Messages'][_0xde3e('0x8d')](_0x548152[_0xde3e('0xbd')]);return _0x3c61db;});})[_0xde3e('0x1f')](function(_0x1d2135){respondWithRpcPromise('SendFax',_0xde3e('0xbe'),{'FaxAccountId':_['isNil'](_0x53a797[_0xde3e('0x64')]['id'])?undefined:_0x53a797[_0xde3e('0x64')]['id'],'path':_[_0xde3e('0xb3')](_0x53a797[_0xde3e('0x5a')][_0xde3e('0xae')][0x0][_0xde3e('0xb4')])?undefined:_0x53a797[_0xde3e('0x5a')]['attachments'][0x0][_0xde3e('0xb4')],'fax':_['isNil'](_0x53a797[_0xde3e('0x5a')]['to'][0x0])?undefined:_0x53a797[_0xde3e('0x5a')]['to'][0x0],'AttachmentId':_0x53a797['body'][_0xde3e('0xae')][0x0]['id']},client9002)['then'](function(_0x1cdd9f){logger[_0xde3e('0x20')](_0xde3e('0xbf'),_0x1cdd9f);})['catch'](function(_0x2e281f){logger['info'](_0xde3e('0xbf'),_0x2e281f);});return _0x1d2135;})[_0xde3e('0x1f')](respondWithResult(_0x56704a,null))[_0xde3e('0x58')](handleError(_0x56704a,null));};exports[_0xde3e('0xc0')]=function(_0x7dd0ef,_0x264016,_0x2efef7){return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x7dd0ef[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x264016,null))[_0xde3e('0x1f')](function(_0x3c3ebb){if(_0x3c3ebb){return _0x3c3ebb[_0xde3e('0xc0')](_0x7dd0ef['body'][_0xde3e('0x6d')],_[_0xde3e('0x72')](_0x7dd0ef[_0xde3e('0x5a')],[_0xde3e('0x6d'),'id'])||{})[_0xde3e('0xbc')](function(_0x522027){for(var _0x40cfd9=0x0;_0x40cfd9<_0x7dd0ef[_0xde3e('0x5a')][_0xde3e('0x6d')][_0xde3e('0x4a')];_0x40cfd9+=0x1){socket['emit'](_0xde3e('0xc1'),{'UserId':Number(_0x7dd0ef[_0xde3e('0x5a')]['ids'][_0x40cfd9]),'FaxAccountId':Number(_0x7dd0ef[_0xde3e('0x64')]['id'])});}return _0x522027;});}})[_0xde3e('0x1f')](respondWithResult(_0x264016,null))[_0xde3e('0x58')](handleError(_0x264016,null));};exports['removeAgents']=function(_0x2f98df,_0x2065ff,_0x245695){return db[_0xde3e('0x3e')][_0xde3e('0x5f')]({'where':{'id':_0x2f98df[_0xde3e('0x64')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x2065ff,null))[_0xde3e('0x1f')](function(_0x3c3e1d){if(_0x3c3e1d){return _0x3c3e1d['removeAgents'](_0x2f98df[_0xde3e('0x44')][_0xde3e('0x6d')])[_0xde3e('0x1f')](function(){if(_['isArray'](_0x2f98df[_0xde3e('0x44')][_0xde3e('0x6d')])){for(var _0x55606a=0x0;_0x55606a<_0x2f98df['query'][_0xde3e('0x6d')]['length'];_0x55606a+=0x1){socket['emit'](_0xde3e('0xc2'),{'UserId':Number(_0x2f98df[_0xde3e('0x44')][_0xde3e('0x6d')][_0x55606a]),'FaxAccountId':Number(_0x2f98df[_0xde3e('0x64')]['id'])});}}else{socket[_0xde3e('0xc3')](_0xde3e('0xc2'),{'UserId':Number(_0x2f98df[_0xde3e('0x44')][_0xde3e('0x6d')]),'FaxAccountId':Number(_0x2f98df[_0xde3e('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x2065ff,null))[_0xde3e('0x58')](handleError(_0x2065ff,null));};exports[_0xde3e('0xc4')]=function(_0x24eaad,_0x5b923d,_0x3677eb){var _0x4cb574={};var _0x22d7cb={};var _0x584c03;var _0x29fbe4;return db[_0xde3e('0x3e')][_0xde3e('0x67')]({'where':{'id':_0x24eaad['params']['id']}})['then'](handleEntityNotFound(_0x5b923d,null))[_0xde3e('0x1f')](function(_0x17240){if(_0x17240){_0x584c03=_0x17240;_0x22d7cb[_0xde3e('0x43')]=_['keys'](db[_0xde3e('0x77')][_0xde3e('0x3f')]);_0x22d7cb['query']=_[_0xde3e('0x45')](_0x24eaad[_0xde3e('0x44')]);_0x22d7cb[_0xde3e('0x46')]=_[_0xde3e('0x47')](_0x22d7cb[_0xde3e('0x43')],_0x22d7cb[_0xde3e('0x44')]);_0x4cb574[_0xde3e('0x48')]=_[_0xde3e('0x47')](_0x22d7cb[_0xde3e('0x43')],qs[_0xde3e('0x49')](_0x24eaad['query'][_0xde3e('0x49')]));_0x4cb574[_0xde3e('0x48')]=_0x4cb574[_0xde3e('0x48')][_0xde3e('0x4a')]?_0x4cb574[_0xde3e('0x48')]:_0x22d7cb[_0xde3e('0x43')];_0x4cb574[_0xde3e('0x69')]=qs[_0xde3e('0x4c')](_0x24eaad['query'][_0xde3e('0x4c')]);_0x4cb574[_0xde3e('0x4d')]=qs[_0xde3e('0x46')](_['pick'](_0x24eaad[_0xde3e('0x44')],_0x22d7cb[_0xde3e('0x46')]));if(_0x24eaad[_0xde3e('0x44')][_0xde3e('0x4e')]){_0x4cb574[_0xde3e('0x4d')]=_[_0xde3e('0x4f')](_0x4cb574[_0xde3e('0x4d')],{'$or':_[_0xde3e('0x50')](_0x4cb574[_0xde3e('0x48')],function(_0x4bac50){var _0x3a576e={};_0x3a576e[_0x4bac50]={'$like':'%'+_0x24eaad[_0xde3e('0x44')][_0xde3e('0x4e')]+'%'};return _0x3a576e;})});}_0x4cb574=_['merge']({},_0x4cb574,_0x24eaad[_0xde3e('0x57')]);return _0x584c03[_0xde3e('0xc4')](_0x4cb574);}})['then'](function(_0x8b714f){if(_0x8b714f){_0x29fbe4=_0x8b714f[_0xde3e('0x4a')];if(!_0x24eaad['query']['hasOwnProperty'](_0xde3e('0x68'))){_0x4cb574['limit']=qs[_0xde3e('0x2e')](_0x24eaad[_0xde3e('0x44')][_0xde3e('0x2e')]);_0x4cb574['offset']=qs['offset'](_0x24eaad[_0xde3e('0x44')]['offset']);}return _0x584c03[_0xde3e('0xc4')](_0x4cb574);}})[_0xde3e('0x1f')](function(_0x1ddf0a){if(_0x1ddf0a){return _0x1ddf0a?{'count':_0x29fbe4,'rows':_0x1ddf0a}:null;}})['then'](respondWithResult(_0x5b923d,null))[_0xde3e('0x58')](handleError(_0x5b923d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 57bf220..36a90e1 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 _0xd742=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0xbb3b68,_0x3687e7){var _0x38aa35=function(_0x2435a0){while(--_0x2435a0){_0xbb3b68['push'](_0xbb3b68['shift']());}};_0x38aa35(++_0x3687e7);}(_0xd742,0x1ca));var _0x2d74=function(_0x3c57e6,_0x2e85d8){_0x3c57e6=_0x3c57e6-0x0;var _0x2788de=_0xd742[_0x3c57e6];return _0x2788de;};'use strict';var EventEmitter=require(_0x2d74('0x0'));var FaxAccount=require(_0x2d74('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2d74('0x2')](0x0);var events={'afterCreate':_0x2d74('0x3'),'afterUpdate':_0x2d74('0x4'),'afterDestroy':_0x2d74('0x5')};function emitEvent(_0x115626){return function(_0x40fc87,_0x208d79,_0x387f25){FaxAccountEvents[_0x2d74('0x6')](_0x115626+':'+_0x40fc87['id'],_0x40fc87);FaxAccountEvents[_0x2d74('0x6')](_0x115626,_0x40fc87);_0x387f25(null);};}for(var e in events){if(events[_0x2d74('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x2d74('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xdc38=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x3c0667,_0x3c4269){var _0x1d2d05=function(_0x167e25){while(--_0x167e25){_0x3c0667['push'](_0x3c0667['shift']());}};_0x1d2d05(++_0x3c4269);}(_0xdc38,0x107));var _0x8dc3=function(_0x48dfa8,_0x588540){_0x48dfa8=_0x48dfa8-0x0;var _0x1c8e58=_0xdc38[_0x48dfa8];return _0x1c8e58;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x8dc3('0x0'))['db'][_0x8dc3('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8dc3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8dc3('0x3'),'afterDestroy':_0x8dc3('0x4')};function emitEvent(_0x770553){return function(_0x1b900f,_0x5a0203,_0x162fae){FaxAccountEvents[_0x8dc3('0x5')](_0x770553+':'+_0x1b900f['id'],_0x1b900f);FaxAccountEvents[_0x8dc3('0x5')](_0x770553,_0x1b900f);_0x162fae(null);};}for(var e in events){if(events[_0x8dc3('0x6')](e)){var event=events[e];FaxAccount[_0x8dc3('0x7')](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 28dc2e5..1b88806 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 _0xdb6c=['request-promise','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0xfa8b4e,_0x268e58){var _0x40483b=function(_0x1752fa){while(--_0x1752fa){_0xfa8b4e['push'](_0xfa8b4e['shift']());}};_0x40483b(++_0x268e58);}(_0xdb6c,0xed));var _0xcdb6=function(_0x5e9bac,_0x5c00f0){_0x5e9bac=_0x5e9bac-0x0;var _0x599cd4=_0xdb6c[_0x5e9bac];return _0x599cd4;};'use strict';var _=require(_0xcdb6('0x0'));var util=require(_0xcdb6('0x1'));var logger=require(_0xcdb6('0x2'))('api');var moment=require(_0xcdb6('0x3'));var BPromise=require(_0xcdb6('0x4'));var rp=require(_0xcdb6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdb6('0x6'));module[_0xcdb6('0x7')]=function(_0x1260ac,_0x4a7944){return _0x1260ac[_0xcdb6('0x8')](_0xcdb6('0x9'),attributes,{'tableName':_0xcdb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3674=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3674,0x1c7));var _0x4367=function(_0x2539e6,_0x595d36){_0x2539e6=_0x2539e6-0x0;var _0xe83570=_0x3674[_0x2539e6];return _0xe83570;};'use strict';var _=require(_0x4367('0x0'));var util=require(_0x4367('0x1'));var logger=require(_0x4367('0x2'))(_0x4367('0x3'));var moment=require(_0x4367('0x4'));var BPromise=require('bluebird');var rp=require(_0x4367('0x5'));var fs=require('fs');var path=require(_0x4367('0x6'));var rimraf=require(_0x4367('0x7'));var config=require(_0x4367('0x8'));var attributes=require(_0x4367('0x9'));module[_0x4367('0xa')]=function(_0x2af422,_0x5c4099){return _0x2af422[_0x4367('0xb')](_0x4367('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 31554cf..dccd6f3 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 _0x6bfd=['request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','raw','options','limit','include','map','attributes','model','then','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','FaxApplication','Applications','get','account','applications','priority','asc','Contacts','defaults','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','./faxAccount.socket','register'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x6bfd,0x1c7));var _0xd6bf=function(_0x3585e2,_0x4cf6fd){_0x3585e2=_0x3585e2-0x0;var _0x115393=_0x6bfd[_0x3585e2];return _0x115393;};'use strict';var _=require('lodash');var util=require(_0xd6bf('0x0'));var moment=require(_0xd6bf('0x1'));var BPromise=require(_0xd6bf('0x2'));var rs=require(_0xd6bf('0x3'));var fs=require('fs');var Redis=require(_0xd6bf('0x4'));var db=require(_0xd6bf('0x5'))['db'];var utils=require(_0xd6bf('0x6'));var logger=require('../../config/logger')(_0xd6bf('0x7'));var config=require('../../config/environment');var jayson=require(_0xd6bf('0x8'));var client=jayson[_0xd6bf('0x9')][_0xd6bf('0xa')]({'port':0x232c});config[_0xd6bf('0xb')]=_['defaults'](config['redis'],{'host':_0xd6bf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6bf('0xb')]));require(_0xd6bf('0xd'))[_0xd6bf('0xe')](socket);function respondWithRpcPromise(_0x169db8,_0xf0e6d3,_0x56235c){return new BPromise(function(_0x3430d0,_0x1d10db){return client[_0xd6bf('0xf')](_0x169db8,_0x56235c)['then'](function(_0x3ee6c0){logger[_0xd6bf('0x10')](_0xd6bf('0x11'),_0xf0e6d3,_0xd6bf('0x12'));logger[_0xd6bf('0x13')](_0xd6bf('0x14'),_0xf0e6d3,_0xd6bf('0x12'),JSON[_0xd6bf('0x15')](_0x3ee6c0));if(_0x3ee6c0[_0xd6bf('0x16')]){if(_0x3ee6c0[_0xd6bf('0x16')][_0xd6bf('0x17')]===0x1f4){logger[_0xd6bf('0x16')]('FaxAccount,\x20%s,\x20%s',_0xf0e6d3,_0x3ee6c0['error'][_0xd6bf('0x18')]);return _0x1d10db(_0x3ee6c0[_0xd6bf('0x16')]['message']);}logger[_0xd6bf('0x16')](_0xd6bf('0x11'),_0xf0e6d3,_0x3ee6c0[_0xd6bf('0x16')]['message']);return _0x3430d0(_0x3ee6c0[_0xd6bf('0x16')][_0xd6bf('0x18')]);}else{logger[_0xd6bf('0x10')]('FaxAccount,\x20%s,\x20%s',_0xf0e6d3,'request\x20sent');_0x3430d0(_0x3ee6c0[_0xd6bf('0x19')][_0xd6bf('0x18')]);}})[_0xd6bf('0x1a')](function(_0x4cdd99){logger[_0xd6bf('0x16')](_0xd6bf('0x11'),_0xf0e6d3,_0x4cdd99);_0x1d10db(_0x4cdd99);});});}exports['GetFaxAccount']=function(_0x2a0ef8){var _0x1cf18b=this;return new Promise(function(_0x19de59,_0x1f635b){return db[_0xd6bf('0x1b')][_0xd6bf('0x1c')]({'raw':_0x2a0ef8['options']?_0x2a0ef8['options'][_0xd6bf('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a0ef8[_0xd6bf('0x1e')]?_0x2a0ef8[_0xd6bf('0x1e')]['where']||null:null,'attributes':_0x2a0ef8[_0xd6bf('0x1e')]?_0x2a0ef8[_0xd6bf('0x1e')]['attributes']||null:null,'limit':_0x2a0ef8[_0xd6bf('0x1e')]?_0x2a0ef8[_0xd6bf('0x1e')][_0xd6bf('0x1f')]||null:null,'include':_0x2a0ef8[_0xd6bf('0x1e')]?_0x2a0ef8[_0xd6bf('0x1e')][_0xd6bf('0x20')]?_['map'](_0x2a0ef8['options'][_0xd6bf('0x20')],function(_0x4872ac){return{'model':db[_0x4872ac['model']],'as':_0x4872ac['as'],'attributes':_0x4872ac['attributes'],'include':_0x4872ac['include']?_[_0xd6bf('0x21')](_0x4872ac[_0xd6bf('0x20')],function(_0x4a6993){return{'model':db[_0x4a6993['model']],'as':_0x4a6993['as'],'attributes':_0x4a6993[_0xd6bf('0x22')],'include':_0x4a6993['include']?_[_0xd6bf('0x21')](_0x4a6993[_0xd6bf('0x20')],function(_0x8eaa1e){return{'model':db[_0x8eaa1e[_0xd6bf('0x23')]],'as':_0x8eaa1e['as'],'attributes':_0x8eaa1e['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6bf('0x24')](function(_0x2340bf){logger['info']('GetFaxAccount',_0x2a0ef8);logger[_0xd6bf('0x13')](_0xd6bf('0x25'),_0x2a0ef8,JSON[_0xd6bf('0x15')](_0x2340bf));_0x19de59(_0x2340bf);})['catch'](function(_0x48dee7){logger[_0xd6bf('0x16')](_0xd6bf('0x25'),_0x48dee7[_0xd6bf('0x18')],_0x2a0ef8);_0x1f635b(_0x1cf18b[_0xd6bf('0x16')](0x1f4,_0x48dee7[_0xd6bf('0x18')]));});});};exports[_0xd6bf('0x26')]=function(_0x24971e,_0x559d65,_0x47b32d){var _0x19dda4=this;return new Promise(function(_0x2b1923,_0x3eac6a){var _0x2e7ede={'body':_0x24971e[_0xd6bf('0x27')],'channel':_0xd6bf('0x28')};var _0x47915d=[];var _0x1737b5=[];var _0x110e7c={};return db[_0xd6bf('0x29')][_0xd6bf('0x2a')]()['then'](function(_0x3ca712){if(!_0x3ca712){throw new db[(_0xd6bf('0x2b'))]['ValidationError'](_0xd6bf('0x2c'));}_0x47915d=_[_0xd6bf('0x2d')](_['keys'](_0x3ca712),[_0xd6bf('0x2e'),_0xd6bf('0x2f')]);_0x1737b5=_[_0xd6bf('0x2d')](_[_0xd6bf('0x30')](_0x3ca712),[_0xd6bf('0x2e'),_0xd6bf('0x2f'),_0xd6bf('0x31'),_0xd6bf('0x32')]);if(_0x24971e[_0xd6bf('0x27')]['id']){delete _0x24971e[_0xd6bf('0x27')]['id'];}if(_[_0xd6bf('0x33')](_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x34')])){throw new db[(_0xd6bf('0x2b'))][(_0xd6bf('0x35'))](_0xd6bf('0x36'));}if(_[_0xd6bf('0x33')](_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x27')])||_0x24971e['body']['body']===''){throw new db[(_0xd6bf('0x2b'))][(_0xd6bf('0x35'))](_0xd6bf('0x37'));}if(_[_0xd6bf('0x33')](_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x38')])){throw new db[(_0xd6bf('0x2b'))][(_0xd6bf('0x35'))](_0xd6bf('0x39')+_0x1737b5);}if(!_[_0xd6bf('0x3a')](_0x1737b5,_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x38')])){throw new db[(_0xd6bf('0x2b'))][(_0xd6bf('0x35'))](_0xd6bf('0x3b')+_0x1737b5);}_0x110e7c[_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x38')]]=_0x24971e[_0xd6bf('0x27')]['from'];})[_0xd6bf('0x24')](function(){return db[_0xd6bf('0x1b')]['find']({'where':{'id':_0x24971e['account']['id']},'include':[{'model':db[_0xd6bf('0x3c')],'as':_0xd6bf('0x3d'),'include':[{'model':db[_0xd6bf('0x29')],'as':'Contacts','where':_0x110e7c,'limit':0x1,'order':[[_0xd6bf('0x2f'),_0xd6bf('0x3e')]]}]},{'model':db[_0xd6bf('0x3f')],'as':_0xd6bf('0x40')}]});})[_0xd6bf('0x24')](function(_0x4f9b27){if(_0x4f9b27&&_0x4f9b27[_0xd6bf('0x3d')]){var _0x250426=_0x4f9b27[_0xd6bf('0x41')]({'plain':!![]});_0x2e7ede[_0xd6bf('0x42')]=_0x250426;_0x2e7ede[_0xd6bf('0x43')]=_0x250426['Applications'];_0x2e7ede['list']=_0x250426[_0xd6bf('0x3d')];_0x2e7ede['applications']=_['orderBy'](_0x2e7ede['applications'],[_0xd6bf('0x44')],[_0xd6bf('0x45')]);if(_0x2e7ede['account'][_0xd6bf('0x40')]){delete _0x2e7ede[_0xd6bf('0x42')]['Applications'];}if(_0x2e7ede[_0xd6bf('0x42')][_0xd6bf('0x3d')]&&_0x2e7ede['account'][_0xd6bf('0x3d')][_0xd6bf('0x46')]['length']){return _0x2e7ede[_0xd6bf('0x42')]['List']['Contacts'][0x0];}var _0x4990fc=_[_0xd6bf('0x47')](_0x24971e[_0xd6bf('0x27')],{'firstName':_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x34')],'ListId':_0x250426['ListId']});_0x4990fc[_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x38')]]=_0x24971e[_0xd6bf('0x27')][_0xd6bf('0x34')];return db[_0xd6bf('0x29')][_0xd6bf('0x48')](_0x4990fc,{'fields':_0x47915d,'raw':!![]});}})[_0xd6bf('0x24')](function(_0x8ec477){_0x2e7ede[_0xd6bf('0x49')]=_0x8ec477;if(_0x8ec477){var _0x5d1e6a={'ContactId':_0x8ec477['id'],'FaxAccountId':_0x24971e[_0xd6bf('0x42')]['id'],'fax':_0x8ec477['fax']};return db['FaxInteraction'][_0xd6bf('0x4a')]({'where':{'ContactId':_0x8ec477['id'],'closed':![],'FaxAccountId':_0x24971e[_0xd6bf('0x42')]['id']}})[_0xd6bf('0x24')](function(_0x263c2f){if(_0x263c2f){return[_0x263c2f,![]];}return db[_0xd6bf('0x4b')][_0xd6bf('0x48')](_0x5d1e6a)[_0xd6bf('0x24')](function(_0x13db63){return[_0x13db63,!![]];});});}else{throw new Error(_0xd6bf('0x4c'));}})[_0xd6bf('0x4d')](function(_0xd9752,_0x18e742){var _0xac88d2=_0xd9752[_0xd6bf('0x41')]({'plain':!![]});if(_0x18e742){if(_0x2e7ede[_0xd6bf('0x42')][_0xd6bf('0x4e')]){_0x2e7ede['applications'][_0xd6bf('0x4f')]({'id':0x0,'priority':_0x2e7ede[_0xd6bf('0x43')]['length']+0x1,'app':_0xd6bf('0x50'),'appdata':_0xd6bf('0x51'),'interval':'*,*,*,*'});}_0xac88d2[_0xd6bf('0x52')]=!![];}else{_0xac88d2[_0xd6bf('0x52')]=![];}_0x2e7ede[_0xd6bf('0x53')]=_0xac88d2;return db[_0xd6bf('0x54')][_0xd6bf('0x48')]({'body':_0x24971e[_0xd6bf('0x27')]['body'],'FaxAccountId':_0x24971e[_0xd6bf('0x42')]['id'],'FaxInteractionId':_0xd9752['id'],'direction':'in','ContactId':_0xd9752[_0xd6bf('0x55')],'AttachmentId':_0x24971e['body']['AttachmentId']});})['then'](function(_0x21c511){_0x2e7ede[_0xd6bf('0x18')]=_0x21c511;if(_0x2e7ede[_0xd6bf('0x53')][_0xd6bf('0x56')]){return db[_0xd6bf('0x57')][_0xd6bf('0x4a')]({'attributes':['id','name'],'where':{'id':_0x2e7ede['interaction'][_0xd6bf('0x56')]}})[_0xd6bf('0x24')](function(_0x154686){if(_0x154686){_0x2e7ede[_0xd6bf('0x43')][_0xd6bf('0x58')]({'id':0x0,'priority':0x0,'app':_0xd6bf('0x59'),'appdata':_0x154686['name']+','+(_0x2e7ede['account'][_0xd6bf('0x5a')]||0xa),'interval':_0xd6bf('0x5b')});}return respondWithRpcPromise(_0xd6bf('0x5c'),_0xd6bf('0x5d'),_0x2e7ede);});}return respondWithRpcPromise('Start',_0xd6bf('0x5d'),_0x2e7ede);})[_0xd6bf('0x24')](function(_0x622352){_0x2b1923(_0x622352);})[_0xd6bf('0x1a')](function(_0x44a557){_0x3eac6a(_0x19dda4['error'](0x1f4,_0x44a557[_0xd6bf('0x18')]));});});}; \ No newline at end of file +var _0xebd3=['AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','FaxAccount,\x20%s,\x20%s','message','info','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','NotifyFaxAccount','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','updatedAt','DESC','List','get','applications','Applications','list','orderBy','priority','length','create','fax','FaxInteraction','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','ContactId'];(function(_0x4a3fe9,_0x2d232a){var _0x51792f=function(_0x181217){while(--_0x181217){_0x4a3fe9['push'](_0x4a3fe9['shift']());}};_0x51792f(++_0x2d232a);}(_0xebd3,0x116));var _0x3ebd=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0xebd3[_0x311666];return _0x2bc692;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var moment=require(_0x3ebd('0x2'));var BPromise=require(_0x3ebd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ebd('0x4'));var db=require(_0x3ebd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ebd('0x6'))('rpc');var config=require(_0x3ebd('0x7'));var jayson=require(_0x3ebd('0x8'));var client=jayson[_0x3ebd('0x9')][_0x3ebd('0xa')]({'port':0x232c});config[_0x3ebd('0xb')]=_[_0x3ebd('0xc')](config[_0x3ebd('0xb')],{'host':_0x3ebd('0xd'),'port':0x18eb});var socket=require(_0x3ebd('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x3ebd('0xf')](socket);function respondWithRpcPromise(_0x34b2ba,_0x30b726,_0x5d9368){return new BPromise(function(_0x2b0856,_0x3c8d76){return client[_0x3ebd('0x10')](_0x34b2ba,_0x5d9368)[_0x3ebd('0x11')](function(_0x227c06){logger['info']('FaxAccount,\x20%s,\x20%s',_0x30b726,_0x3ebd('0x12'));logger[_0x3ebd('0x13')](_0x3ebd('0x14'),_0x30b726,'request\x20sent',JSON['stringify'](_0x227c06));if(_0x227c06[_0x3ebd('0x15')]){if(_0x227c06[_0x3ebd('0x15')]['code']===0x1f4){logger['error'](_0x3ebd('0x16'),_0x30b726,_0x227c06[_0x3ebd('0x15')]['message']);return _0x3c8d76(_0x227c06['error'][_0x3ebd('0x17')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x30b726,_0x227c06[_0x3ebd('0x15')][_0x3ebd('0x17')]);return _0x2b0856(_0x227c06[_0x3ebd('0x15')][_0x3ebd('0x17')]);}else{logger[_0x3ebd('0x18')]('FaxAccount,\x20%s,\x20%s',_0x30b726,_0x3ebd('0x12'));_0x2b0856(_0x227c06[_0x3ebd('0x19')]['message']);}})['catch'](function(_0x1144a2){logger[_0x3ebd('0x15')]('FaxAccount,\x20%s,\x20%s',_0x30b726,_0x1144a2);_0x3c8d76(_0x1144a2);});});}exports[_0x3ebd('0x1a')]=function(_0x2f9f71){var _0x5e5d7d=this;return new Promise(function(_0x1ce6bb,_0xd4a76a){return db[_0x3ebd('0x1b')][_0x3ebd('0x1c')]({'raw':_0x2f9f71[_0x3ebd('0x1d')]?_0x2f9f71[_0x3ebd('0x1d')][_0x3ebd('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f9f71[_0x3ebd('0x1d')]?_0x2f9f71[_0x3ebd('0x1d')][_0x3ebd('0x1f')]||null:null,'attributes':_0x2f9f71[_0x3ebd('0x1d')]?_0x2f9f71[_0x3ebd('0x1d')][_0x3ebd('0x20')]||null:null,'limit':_0x2f9f71[_0x3ebd('0x1d')]?_0x2f9f71[_0x3ebd('0x1d')][_0x3ebd('0x21')]||null:null,'include':_0x2f9f71[_0x3ebd('0x1d')]?_0x2f9f71['options'][_0x3ebd('0x22')]?_[_0x3ebd('0x23')](_0x2f9f71[_0x3ebd('0x1d')]['include'],function(_0x52085f){return{'model':db[_0x52085f['model']],'as':_0x52085f['as'],'attributes':_0x52085f[_0x3ebd('0x20')],'include':_0x52085f[_0x3ebd('0x22')]?_[_0x3ebd('0x23')](_0x52085f[_0x3ebd('0x22')],function(_0x549f26){return{'model':db[_0x549f26['model']],'as':_0x549f26['as'],'attributes':_0x549f26[_0x3ebd('0x20')],'include':_0x549f26[_0x3ebd('0x22')]?_[_0x3ebd('0x23')](_0x549f26[_0x3ebd('0x22')],function(_0x530242){return{'model':db[_0x530242[_0x3ebd('0x24')]],'as':_0x530242['as'],'attributes':_0x530242['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a71d4){logger[_0x3ebd('0x18')](_0x3ebd('0x1a'),_0x2f9f71);logger[_0x3ebd('0x13')]('GetFaxAccount',_0x2f9f71,JSON[_0x3ebd('0x25')](_0x5a71d4));_0x1ce6bb(_0x5a71d4);})[_0x3ebd('0x26')](function(_0x3dd899){logger[_0x3ebd('0x15')](_0x3ebd('0x1a'),_0x3dd899['message'],_0x2f9f71);_0xd4a76a(_0x5e5d7d[_0x3ebd('0x15')](0x1f4,_0x3dd899[_0x3ebd('0x17')]));});});};exports[_0x3ebd('0x27')]=function(_0x194e63,_0x590469,_0x274e49){var _0x3e28ed=this;return new Promise(function(_0x8bc997,_0x5c8ae9){var _0x3f309d={'body':_0x194e63['body'],'channel':'fax'};var _0x1818cf=[];var _0x5605cd=[];var _0x5568c6={};return db[_0x3ebd('0x28')]['describe']()[_0x3ebd('0x11')](function(_0x3a8bb4){if(!_0x3a8bb4){throw new db[(_0x3ebd('0x29'))][(_0x3ebd('0x2a'))](_0x3ebd('0x2b'));}_0x1818cf=_[_0x3ebd('0x2c')](_[_0x3ebd('0x2d')](_0x3a8bb4),[_0x3ebd('0x2e'),'updatedAt']);_0x5605cd=_['difference'](_['keys'](_0x3a8bb4),[_0x3ebd('0x2e'),'updatedAt',_0x3ebd('0x2f'),_0x3ebd('0x30')]);if(_0x194e63[_0x3ebd('0x31')]['id']){delete _0x194e63[_0x3ebd('0x31')]['id'];}if(_[_0x3ebd('0x32')](_0x194e63[_0x3ebd('0x31')][_0x3ebd('0x33')])){throw new db[(_0x3ebd('0x29'))][(_0x3ebd('0x2a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x194e63[_0x3ebd('0x31')][_0x3ebd('0x31')])||_0x194e63['body'][_0x3ebd('0x31')]===''){throw new db['Sequelize'][(_0x3ebd('0x2a'))](_0x3ebd('0x34'));}if(_[_0x3ebd('0x32')](_0x194e63[_0x3ebd('0x31')][_0x3ebd('0x35')])){throw new db['Sequelize']['ValidationError'](_0x3ebd('0x36')+_0x5605cd);}if(!_[_0x3ebd('0x37')](_0x5605cd,_0x194e63[_0x3ebd('0x31')]['mapKey'])){throw new db[(_0x3ebd('0x29'))][(_0x3ebd('0x2a'))](_0x3ebd('0x38')+_0x5605cd);}_0x5568c6[_0x194e63[_0x3ebd('0x31')]['mapKey']]=_0x194e63[_0x3ebd('0x31')][_0x3ebd('0x33')];})['then'](function(){return db[_0x3ebd('0x1b')][_0x3ebd('0x39')]({'where':{'id':_0x194e63[_0x3ebd('0x3a')]['id']},'include':[{'model':db[_0x3ebd('0x3b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3ebd('0x3c'),'where':_0x5568c6,'limit':0x1,'order':[[_0x3ebd('0x3d'),_0x3ebd('0x3e')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x3ebd('0x11')](function(_0x519b6b){if(_0x519b6b&&_0x519b6b[_0x3ebd('0x3f')]){var _0x241ef7=_0x519b6b[_0x3ebd('0x40')]({'plain':!![]});_0x3f309d['account']=_0x241ef7;_0x3f309d[_0x3ebd('0x41')]=_0x241ef7[_0x3ebd('0x42')];_0x3f309d[_0x3ebd('0x43')]=_0x241ef7['List'];_0x3f309d[_0x3ebd('0x41')]=_[_0x3ebd('0x44')](_0x3f309d[_0x3ebd('0x41')],[_0x3ebd('0x45')],['asc']);if(_0x3f309d['account'][_0x3ebd('0x42')]){delete _0x3f309d['account']['Applications'];}if(_0x3f309d[_0x3ebd('0x3a')]['List']&&_0x3f309d['account']['List']['Contacts'][_0x3ebd('0x46')]){return _0x3f309d[_0x3ebd('0x3a')]['List'][_0x3ebd('0x3c')][0x0];}var _0x26f2fa=_['defaults'](_0x194e63['body'],{'firstName':_0x194e63['body'][_0x3ebd('0x33')],'ListId':_0x241ef7[_0x3ebd('0x30')]});_0x26f2fa[_0x194e63[_0x3ebd('0x31')]['mapKey']]=_0x194e63['body'][_0x3ebd('0x33')];return db['CmContact'][_0x3ebd('0x47')](_0x26f2fa,{'fields':_0x1818cf,'raw':!![]});}})[_0x3ebd('0x11')](function(_0x24c9b1){_0x3f309d['contact']=_0x24c9b1;if(_0x24c9b1){var _0x159501={'ContactId':_0x24c9b1['id'],'FaxAccountId':_0x194e63['account']['id'],'fax':_0x24c9b1[_0x3ebd('0x48')]};return db[_0x3ebd('0x49')][_0x3ebd('0x39')]({'where':{'ContactId':_0x24c9b1['id'],'closed':![],'FaxAccountId':_0x194e63[_0x3ebd('0x3a')]['id']}})[_0x3ebd('0x11')](function(_0x29ca44){if(_0x29ca44){return[_0x29ca44,![]];}return db['FaxInteraction']['create'](_0x159501)['then'](function(_0xbbcc24){return[_0xbbcc24,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3ebd('0x4a')](function(_0x2686ea,_0x2615f){var _0x1e4374=_0x2686ea[_0x3ebd('0x40')]({'plain':!![]});if(_0x2615f){if(_0x3f309d['account'][_0x3ebd('0x4b')]){_0x3f309d[_0x3ebd('0x41')][_0x3ebd('0x4c')]({'id':0x0,'priority':_0x3f309d[_0x3ebd('0x41')][_0x3ebd('0x46')]+0x1,'app':'close','appdata':_0x3ebd('0x4d'),'interval':_0x3ebd('0x4e')});}_0x1e4374[_0x3ebd('0x4f')]=!![];}else{_0x1e4374[_0x3ebd('0x4f')]=![];}_0x3f309d[_0x3ebd('0x50')]=_0x1e4374;return db['FaxMessage'][_0x3ebd('0x47')]({'body':_0x194e63['body'][_0x3ebd('0x31')],'FaxAccountId':_0x194e63[_0x3ebd('0x3a')]['id'],'FaxInteractionId':_0x2686ea['id'],'direction':'in','ContactId':_0x2686ea[_0x3ebd('0x51')],'AttachmentId':_0x194e63[_0x3ebd('0x31')][_0x3ebd('0x52')]});})[_0x3ebd('0x11')](function(_0x49bcec){_0x3f309d['message']=_0x49bcec;if(_0x3f309d['interaction'][_0x3ebd('0x53')]){return db[_0x3ebd('0x54')][_0x3ebd('0x39')]({'attributes':['id','name'],'where':{'id':_0x3f309d['interaction']['UserId']}})[_0x3ebd('0x11')](function(_0x4e9dba){if(_0x4e9dba){_0x3f309d[_0x3ebd('0x41')][_0x3ebd('0x55')]({'id':0x0,'priority':0x0,'app':_0x3ebd('0x56'),'appdata':_0x4e9dba[_0x3ebd('0x57')]+','+(_0x3f309d[_0x3ebd('0x3a')][_0x3ebd('0x58')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3ebd('0x59'),'startRouting',_0x3f309d);});}return respondWithRpcPromise(_0x3ebd('0x59'),'startRouting',_0x3f309d);})[_0x3ebd('0x11')](function(_0x4a48f2){_0x8bc997(_0x4a48f2);})[_0x3ebd('0x26')](function(_0x153dc4){_0x5c8ae9(_0x3e28ed['error'](0x1f4,_0x153dc4[_0x3ebd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index af85114..e594431 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 _0xc9ef=['save','remove','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x3ea076,_0x577a67){var _0x5567ff=function(_0x55ef34){while(--_0x55ef34){_0x3ea076['push'](_0x3ea076['shift']());}};_0x5567ff(++_0x577a67);}(_0xc9ef,0x141));var _0xfc9e=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xc9ef[_0xbd4254];return _0x46c0f3;};'use strict';var FaxAccountEvents=require(_0xfc9e('0x0'));var events=[_0xfc9e('0x1'),_0xfc9e('0x2'),'update'];function createListener(_0x3a692d,_0x26f4f4){return function(_0x56865a){_0x26f4f4['emit'](_0x3a692d,_0x56865a);};}function removeListener(_0x55aa0b,_0x4f170e){return function(){FaxAccountEvents[_0xfc9e('0x3')](_0x55aa0b,_0x4f170e);};}exports[_0xfc9e('0x4')]=function(_0x4e4fab){for(var _0x4f162c=0x0,_0x2a0b62=events[_0xfc9e('0x5')];_0x4f162c<_0x2a0b62;_0x4f162c++){var _0x46ea78=events[_0x4f162c];var _0x45ab87=createListener(_0xfc9e('0x6')+_0x46ea78,_0x4e4fab);FaxAccountEvents['on'](_0x46ea78,_0x45ab87);}}; \ No newline at end of file +var _0xb4d2=['removeListener','register','length','save'];(function(_0x885eff,_0x555809){var _0x17819f=function(_0x3a69f0){while(--_0x3a69f0){_0x885eff['push'](_0x885eff['shift']());}};_0x17819f(++_0x555809);}(_0xb4d2,0xfb));var _0x2b4d=function(_0x1e9044,_0x514f15){_0x1e9044=_0x1e9044-0x0;var _0x589d56=_0xb4d2[_0x1e9044];return _0x589d56;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x2b4d('0x0'),'remove','update'];function createListener(_0x1a51f0,_0x5c2f63){return function(_0x5222ce){_0x5c2f63['emit'](_0x1a51f0,_0x5222ce);};}function removeListener(_0x56e466,_0x413b70){return function(){FaxAccountEvents[_0x2b4d('0x1')](_0x56e466,_0x413b70);};}exports[_0x2b4d('0x2')]=function(_0xb3f052){for(var _0x1c0cda=0x0,_0x331d87=events[_0x2b4d('0x3')];_0x1c0cda<_0x331d87;_0x1c0cda++){var _0x426307=events[_0x1c0cda];var _0x1fe9cc=createListener('faxAccount:'+_0x426307,_0xb3f052);FaxAccountEvents['on'](_0x426307,_0x1fe9cc);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index df5d343..0cb1dba 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(_0x1ce5fa,_0x32bf83){var _0x19bd14=function(_0x459120){while(--_0x459120){_0x1ce5fa['push'](_0x1ce5fa['shift']());}};_0x19bd14(++_0x32bf83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x3768fc,_0x382fe6){var _0x175a45=function(_0x273b1d){while(--_0x273b1d){_0x3768fc['push'](_0x3768fc['shift']());}};_0x175a45(++_0x382fe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 a7059da..7d365c1 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 _0x5ac1=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5ac1,0x1b0));var _0x15ac=function(_0x510199,_0x36886f){_0x510199=_0x510199-0x0;var _0x5a59ce=_0x5ac1[_0x510199];return _0x5a59ce;};'use strict';var Sequelize=require(_0x15ac('0x0'));module['exports']={'priority':{'type':Sequelize[_0x15ac('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x15ac('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x15ac('0x3')]()},'description':{'type':Sequelize[_0x15ac('0x2')]},'interval':{'type':Sequelize[_0x15ac('0x2')],'defaultValue':_0x15ac('0x4')}}; \ No newline at end of file +var _0xfdf9=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xfdf9,0x109));var _0x9fdf=function(_0x10de2a,_0xc6eee8){_0x10de2a=_0x10de2a-0x0;var _0x2199fb=_0xfdf9[_0x10de2a];return _0x2199fb;};'use strict';var Sequelize=require(_0x9fdf('0x0'));module[_0x9fdf('0x1')]={'priority':{'type':Sequelize[_0x9fdf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9fdf('0x3')],'allowNull':![],'defaultValue':_0x9fdf('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9fdf('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9fdf('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 7e517af..8722a49 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 _0x87ab=['type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','FaxApplication','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','where','filters','merge'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x87ab,0x97));var _0xb87a=function(_0x5a77ae,_0x3f0b24){_0x5a77ae=_0x5a77ae-0x0;var _0x3de3bf=_0x87ab[_0x5a77ae];return _0x3de3bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb87a('0x0'));var zipdir=require(_0xb87a('0x1'));var jsonpatch=require(_0xb87a('0x2'));var rp=require(_0xb87a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb87a('0x4'));var path=require('path');var sox=require(_0xb87a('0x5'));var csv=require(_0xb87a('0x6'));var ejs=require(_0xb87a('0x7'));var fs=require('fs');var fs_extra=require(_0xb87a('0x8'));var _=require(_0xb87a('0x9'));var squel=require(_0xb87a('0xa'));var crypto=require(_0xb87a('0xb'));var jsforce=require(_0xb87a('0xc'));var deskjs=require(_0xb87a('0xd'));var toCsv=require(_0xb87a('0x6'));var querystring=require(_0xb87a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb87a('0xf'));var authService=require(_0xb87a('0x10'));var qs=require(_0xb87a('0x11'));var as=require(_0xb87a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb87a('0x13'));var utils=require(_0xb87a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb87a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x133e1d,_0x4080f7){_0x4080f7=_0x4080f7||0xcc;return function(_0x186ca1){if(_0x186ca1){return _0x133e1d[_0xb87a('0x16')](_0x4080f7);}return _0x133e1d[_0xb87a('0x17')](_0x4080f7)[_0xb87a('0x18')]();};}function respondWithResult(_0x2d6509,_0x477cc6){_0x477cc6=_0x477cc6||0xc8;return function(_0x26c35a){if(_0x26c35a){return _0x2d6509[_0xb87a('0x17')](_0x477cc6)['json'](_0x26c35a);}};}function respondWithFilteredResult(_0x3f2a05,_0x4bfac0){return function(_0x55d2c9){if(_0x55d2c9){var _0xaacf20=typeof _0x4bfac0[_0xb87a('0x19')]===_0xb87a('0x1a')&&typeof _0x4bfac0[_0xb87a('0x1b')]===_0xb87a('0x1a');var _0x8a1397=_0x55d2c9[_0xb87a('0x1c')];var _0xe61828=_0xaacf20?0x0:_0x4bfac0[_0xb87a('0x19')];var _0x383909=_0xaacf20?_0x55d2c9[_0xb87a('0x1c')]:_0x4bfac0['offset']+_0x4bfac0['limit'];var _0x125024;if(_0x383909>=_0x8a1397){_0x383909=_0x8a1397;_0x125024=0xc8;}else{_0x125024=0xce;}_0x3f2a05[_0xb87a('0x17')](_0x125024);return _0x3f2a05[_0xb87a('0x1d')]('Content-Range',_0xe61828+'-'+_0x383909+'/'+_0x8a1397)['json'](_0x55d2c9);}return null;};}function patchUpdates(_0x34de1d){return function(_0x33e2c1){try{jsonpatch[_0xb87a('0x1e')](_0x33e2c1,_0x34de1d,!![]);}catch(_0x84fbf3){return BPromise[_0xb87a('0x1f')](_0x84fbf3);}return _0x33e2c1[_0xb87a('0x20')]();};}function saveUpdates(_0x19fda0,_0x14cfb0){return function(_0x4e1560){if(_0x4e1560){return _0x4e1560[_0xb87a('0x21')](_0x19fda0)[_0xb87a('0x22')](function(_0x25321d){return _0x25321d;});}return null;};}function removeEntity(_0x273935,_0x2f1b81){return function(_0x5c69a6){if(_0x5c69a6){return _0x5c69a6[_0xb87a('0x23')]()[_0xb87a('0x22')](function(){_0x273935[_0xb87a('0x17')](0xcc)[_0xb87a('0x18')]();});}};}function handleEntityNotFound(_0x53f1b8,_0xfd7d58){return function(_0x4d64d7){if(!_0x4d64d7){_0x53f1b8[_0xb87a('0x16')](0x194);}return _0x4d64d7;};}function handleError(_0x3e3485,_0xe1d3a0){_0xe1d3a0=_0xe1d3a0||0x1f4;return function(_0x3e4d03){logger[_0xb87a('0x24')](_0x3e4d03['stack']);if(_0x3e4d03[_0xb87a('0x25')]){delete _0x3e4d03[_0xb87a('0x25')];}_0x3e3485[_0xb87a('0x17')](_0xe1d3a0)[_0xb87a('0x26')](_0x3e4d03);};}exports[_0xb87a('0x27')]=function(_0x3088f5,_0x5982ea){var _0x605916={},_0x1cd4c0={},_0x441cf4={'count':0x0,'rows':[]};var _0x5b502a=_['map'](db[_0xb87a('0x28')][_0xb87a('0x29')],function(_0x335521){return{'name':_0x335521[_0xb87a('0x2a')],'type':_0x335521['type'][_0xb87a('0x2b')]};});_0x1cd4c0[_0xb87a('0x2c')]=_[_0xb87a('0x2d')](_0x5b502a,_0xb87a('0x25'));_0x1cd4c0['query']=_[_0xb87a('0x2e')](_0x3088f5[_0xb87a('0x2f')]);_0x1cd4c0['filters']=_['intersection'](_0x1cd4c0[_0xb87a('0x2c')],_0x1cd4c0[_0xb87a('0x2f')]);_0x605916[_0xb87a('0x30')]=_[_0xb87a('0x31')](_0x1cd4c0[_0xb87a('0x2c')],qs[_0xb87a('0x32')](_0x3088f5[_0xb87a('0x2f')][_0xb87a('0x32')]));_0x605916[_0xb87a('0x30')]=_0x605916[_0xb87a('0x30')][_0xb87a('0x33')]?_0x605916[_0xb87a('0x30')]:_0x1cd4c0[_0xb87a('0x2c')];if(!_0x3088f5['query'][_0xb87a('0x34')]('nolimit')){_0x605916[_0xb87a('0x1b')]=qs[_0xb87a('0x1b')](_0x3088f5[_0xb87a('0x2f')][_0xb87a('0x1b')]);_0x605916[_0xb87a('0x19')]=qs[_0xb87a('0x19')](_0x3088f5[_0xb87a('0x2f')]['offset']);}_0x605916['order']=qs['sort'](_0x3088f5[_0xb87a('0x2f')]['sort']);_0x605916[_0xb87a('0x35')]=qs[_0xb87a('0x36')](_['pick'](_0x3088f5[_0xb87a('0x2f')],_0x1cd4c0[_0xb87a('0x36')]),_0x5b502a);if(_0x3088f5[_0xb87a('0x2f')]['filter']){_0x605916[_0xb87a('0x35')]=_[_0xb87a('0x37')](_0x605916['where'],{'$or':_[_0xb87a('0x2d')](_0x5b502a,function(_0x9ff570){if(_0x9ff570[_0xb87a('0x38')]!==_0xb87a('0x39')){var _0x33d0be={};_0x33d0be[_0x9ff570[_0xb87a('0x25')]]={'$like':'%'+_0x3088f5['query'][_0xb87a('0x3a')]+'%'};return _0x33d0be;}})});}_0x605916=_[_0xb87a('0x37')]({},_0x605916,_0x3088f5[_0xb87a('0x3b')]);var _0x3f698f={'where':_0x605916[_0xb87a('0x35')]};return db['FaxApplication'][_0xb87a('0x1c')](_0x3f698f)['then'](function(_0xe43fa9){_0x441cf4[_0xb87a('0x1c')]=_0xe43fa9;if(_0x3088f5['query'][_0xb87a('0x3c')]){_0x605916['include']=[{'all':!![]}];}return db[_0xb87a('0x28')][_0xb87a('0x3d')](_0x605916);})[_0xb87a('0x22')](function(_0xc11d30){_0x441cf4['rows']=_0xc11d30;return _0x441cf4;})[_0xb87a('0x22')](respondWithFilteredResult(_0x5982ea,_0x605916))[_0xb87a('0x3e')](handleError(_0x5982ea,null));};exports[_0xb87a('0x3f')]=function(_0x5d20ab,_0x4e2f3f){var _0x35d333={'raw':!![],'where':{'id':_0x5d20ab[_0xb87a('0x40')]['id']}},_0x3cdf7e={};_0x3cdf7e[_0xb87a('0x2c')]=_[_0xb87a('0x2e')](db[_0xb87a('0x28')]['rawAttributes']);_0x3cdf7e[_0xb87a('0x2f')]=_[_0xb87a('0x2e')](_0x5d20ab[_0xb87a('0x2f')]);_0x3cdf7e['filters']=_[_0xb87a('0x31')](_0x3cdf7e[_0xb87a('0x2c')],_0x3cdf7e['query']);_0x35d333[_0xb87a('0x30')]=_[_0xb87a('0x31')](_0x3cdf7e['model'],qs[_0xb87a('0x32')](_0x5d20ab[_0xb87a('0x2f')][_0xb87a('0x32')]));_0x35d333[_0xb87a('0x30')]=_0x35d333['attributes'][_0xb87a('0x33')]?_0x35d333[_0xb87a('0x30')]:_0x3cdf7e[_0xb87a('0x2c')];if(_0x5d20ab['query'][_0xb87a('0x3c')]){_0x35d333[_0xb87a('0x41')]=[{'all':!![]}];}_0x35d333=_[_0xb87a('0x37')]({},_0x35d333,_0x5d20ab['options']);return db[_0xb87a('0x28')][_0xb87a('0x42')](_0x35d333)[_0xb87a('0x22')](handleEntityNotFound(_0x4e2f3f,null))[_0xb87a('0x22')](respondWithResult(_0x4e2f3f,null))[_0xb87a('0x3e')](handleError(_0x4e2f3f,null));};exports[_0xb87a('0x43')]=function(_0x312a3d,_0x18b496){return db[_0xb87a('0x28')]['create'](_0x312a3d[_0xb87a('0x44')],{})[_0xb87a('0x22')](respondWithResult(_0x18b496,0xc9))[_0xb87a('0x3e')](handleError(_0x18b496,null));};exports[_0xb87a('0x21')]=function(_0x7cb7df,_0x57a5ac){if(_0x7cb7df[_0xb87a('0x44')]['id']){delete _0x7cb7df['body']['id'];}return db[_0xb87a('0x28')][_0xb87a('0x42')]({'where':{'id':_0x7cb7df[_0xb87a('0x40')]['id']}})['then'](handleEntityNotFound(_0x57a5ac,null))['then'](saveUpdates(_0x7cb7df['body'],null))[_0xb87a('0x22')](respondWithResult(_0x57a5ac,null))[_0xb87a('0x3e')](handleError(_0x57a5ac,null));};exports[_0xb87a('0x23')]=function(_0x56378b,_0x319eb2){return db['FaxApplication'][_0xb87a('0x42')]({'where':{'id':_0x56378b[_0xb87a('0x40')]['id']}})[_0xb87a('0x22')](handleEntityNotFound(_0x319eb2,null))[_0xb87a('0x22')](removeEntity(_0x319eb2,null))[_0xb87a('0x3e')](handleError(_0x319eb2,null));}; \ No newline at end of file +var _0xfb30=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','include','findAll','catch','show','params','length','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x420749,_0x437ca5){var _0x463c32=function(_0x53b0af){while(--_0x53b0af){_0x420749['push'](_0x420749['shift']());}};_0x463c32(++_0x437ca5);}(_0xfb30,0x11b));var _0x0fb3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfb30[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0fb3('0x0'));var rimraf=require(_0x0fb3('0x1'));var zipdir=require(_0x0fb3('0x2'));var jsonpatch=require(_0x0fb3('0x3'));var rp=require(_0x0fb3('0x4'));var moment=require(_0x0fb3('0x5'));var BPromise=require(_0x0fb3('0x6'));var Mustache=require(_0x0fb3('0x7'));var util=require('util');var path=require(_0x0fb3('0x8'));var sox=require(_0x0fb3('0x9'));var csv=require(_0x0fb3('0xa'));var ejs=require(_0x0fb3('0xb'));var fs=require('fs');var fs_extra=require(_0x0fb3('0xc'));var _=require(_0x0fb3('0xd'));var squel=require('squel');var crypto=require(_0x0fb3('0xe'));var jsforce=require(_0x0fb3('0xf'));var deskjs=require(_0x0fb3('0x10'));var toCsv=require(_0x0fb3('0xa'));var querystring=require('querystring');var Papa=require(_0x0fb3('0x11'));var Redis=require('ioredis');var authService=require(_0x0fb3('0x12'));var qs=require(_0x0fb3('0x13'));var as=require(_0x0fb3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fb3('0x15'))(_0x0fb3('0x16'));var utils=require(_0x0fb3('0x17'));var config=require(_0x0fb3('0x18'));var licenseUtil=require(_0x0fb3('0x19'));var db=require(_0x0fb3('0x1a'))['db'];function respondWithStatusCode(_0x25de1e,_0x1065a6){_0x1065a6=_0x1065a6||0xcc;return function(_0x1808e0){if(_0x1808e0){return _0x25de1e[_0x0fb3('0x1b')](_0x1065a6);}return _0x25de1e[_0x0fb3('0x1c')](_0x1065a6)[_0x0fb3('0x1d')]();};}function respondWithResult(_0x57d313,_0x45c569){_0x45c569=_0x45c569||0xc8;return function(_0x4c40a0){if(_0x4c40a0){return _0x57d313[_0x0fb3('0x1c')](_0x45c569)[_0x0fb3('0x1e')](_0x4c40a0);}};}function respondWithFilteredResult(_0x210822,_0x54cb89){return function(_0x4f1dc0){if(_0x4f1dc0){var _0x1c8a41=typeof _0x54cb89[_0x0fb3('0x1f')]===_0x0fb3('0x20')&&typeof _0x54cb89['limit']===_0x0fb3('0x20');var _0x14fab6=_0x4f1dc0['count'];var _0x4807e4=_0x1c8a41?0x0:_0x54cb89[_0x0fb3('0x1f')];var _0x457df8=_0x1c8a41?_0x4f1dc0[_0x0fb3('0x21')]:_0x54cb89[_0x0fb3('0x1f')]+_0x54cb89[_0x0fb3('0x22')];var _0x54e29d;if(_0x457df8>=_0x14fab6){_0x457df8=_0x14fab6;_0x54e29d=0xc8;}else{_0x54e29d=0xce;}_0x210822[_0x0fb3('0x1c')](_0x54e29d);return _0x210822[_0x0fb3('0x23')](_0x0fb3('0x24'),_0x4807e4+'-'+_0x457df8+'/'+_0x14fab6)[_0x0fb3('0x1e')](_0x4f1dc0);}return null;};}function patchUpdates(_0x1cc17a){return function(_0x27caf1){try{jsonpatch[_0x0fb3('0x25')](_0x27caf1,_0x1cc17a,!![]);}catch(_0x129550){return BPromise[_0x0fb3('0x26')](_0x129550);}return _0x27caf1[_0x0fb3('0x27')]();};}function saveUpdates(_0xc0662e,_0x38f409){return function(_0x1ee2df){if(_0x1ee2df){return _0x1ee2df['update'](_0xc0662e)['then'](function(_0x14bcfe){return _0x14bcfe;});}return null;};}function removeEntity(_0x133f29,_0x22f5e1){return function(_0x3d1cad){if(_0x3d1cad){return _0x3d1cad[_0x0fb3('0x28')]()[_0x0fb3('0x29')](function(){_0x133f29[_0x0fb3('0x1c')](0xcc)[_0x0fb3('0x1d')]();});}};}function handleEntityNotFound(_0x34cfe6,_0x13c683){return function(_0x21b23a){if(!_0x21b23a){_0x34cfe6[_0x0fb3('0x1b')](0x194);}return _0x21b23a;};}function handleError(_0x1ea458,_0x3b5569){_0x3b5569=_0x3b5569||0x1f4;return function(_0xddcaff){logger[_0x0fb3('0x2a')](_0xddcaff[_0x0fb3('0x2b')]);if(_0xddcaff['name']){delete _0xddcaff['name'];}_0x1ea458[_0x0fb3('0x1c')](_0x3b5569)['send'](_0xddcaff);};}exports[_0x0fb3('0x2c')]=function(_0x18b1e9,_0xfa15d5){var _0x6feffa={},_0x52359a={},_0x395dba={'count':0x0,'rows':[]};var _0x229615=_[_0x0fb3('0x2d')](db[_0x0fb3('0x2e')]['rawAttributes'],function(_0x4d6c9c){return{'name':_0x4d6c9c[_0x0fb3('0x2f')],'type':_0x4d6c9c[_0x0fb3('0x30')][_0x0fb3('0x31')]};});_0x52359a[_0x0fb3('0x32')]=_[_0x0fb3('0x2d')](_0x229615,'name');_0x52359a[_0x0fb3('0x33')]=_[_0x0fb3('0x34')](_0x18b1e9[_0x0fb3('0x33')]);_0x52359a[_0x0fb3('0x35')]=_[_0x0fb3('0x36')](_0x52359a['model'],_0x52359a[_0x0fb3('0x33')]);_0x6feffa[_0x0fb3('0x37')]=_[_0x0fb3('0x36')](_0x52359a[_0x0fb3('0x32')],qs['fields'](_0x18b1e9[_0x0fb3('0x33')][_0x0fb3('0x38')]));_0x6feffa[_0x0fb3('0x37')]=_0x6feffa[_0x0fb3('0x37')]['length']?_0x6feffa[_0x0fb3('0x37')]:_0x52359a['model'];if(!_0x18b1e9[_0x0fb3('0x33')][_0x0fb3('0x39')](_0x0fb3('0x3a'))){_0x6feffa[_0x0fb3('0x22')]=qs[_0x0fb3('0x22')](_0x18b1e9['query'][_0x0fb3('0x22')]);_0x6feffa[_0x0fb3('0x1f')]=qs[_0x0fb3('0x1f')](_0x18b1e9['query'][_0x0fb3('0x1f')]);}_0x6feffa['order']=qs['sort'](_0x18b1e9[_0x0fb3('0x33')][_0x0fb3('0x3b')]);_0x6feffa[_0x0fb3('0x3c')]=qs[_0x0fb3('0x35')](_[_0x0fb3('0x3d')](_0x18b1e9['query'],_0x52359a['filters']),_0x229615);if(_0x18b1e9[_0x0fb3('0x33')][_0x0fb3('0x3e')]){_0x6feffa[_0x0fb3('0x3c')]=_[_0x0fb3('0x3f')](_0x6feffa['where'],{'$or':_[_0x0fb3('0x2d')](_0x229615,function(_0x8a9099){if(_0x8a9099[_0x0fb3('0x30')]!==_0x0fb3('0x40')){var _0x328c8c={};_0x328c8c[_0x8a9099[_0x0fb3('0x41')]]={'$like':'%'+_0x18b1e9[_0x0fb3('0x33')][_0x0fb3('0x3e')]+'%'};return _0x328c8c;}})});}_0x6feffa=_[_0x0fb3('0x3f')]({},_0x6feffa,_0x18b1e9['options']);var _0x36740c={'where':_0x6feffa[_0x0fb3('0x3c')]};return db[_0x0fb3('0x2e')]['count'](_0x36740c)['then'](function(_0xe209bd){_0x395dba['count']=_0xe209bd;if(_0x18b1e9[_0x0fb3('0x33')]['includeAll']){_0x6feffa[_0x0fb3('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x0fb3('0x43')](_0x6feffa);})[_0x0fb3('0x29')](function(_0x3fe0b0){_0x395dba['rows']=_0x3fe0b0;return _0x395dba;})[_0x0fb3('0x29')](respondWithFilteredResult(_0xfa15d5,_0x6feffa))[_0x0fb3('0x44')](handleError(_0xfa15d5,null));};exports[_0x0fb3('0x45')]=function(_0x1ba1de,_0x18e0ae){var _0x1f46d2={'raw':!![],'where':{'id':_0x1ba1de[_0x0fb3('0x46')]['id']}},_0xf74587={};_0xf74587['model']=_[_0x0fb3('0x34')](db[_0x0fb3('0x2e')]['rawAttributes']);_0xf74587[_0x0fb3('0x33')]=_['keys'](_0x1ba1de['query']);_0xf74587[_0x0fb3('0x35')]=_[_0x0fb3('0x36')](_0xf74587[_0x0fb3('0x32')],_0xf74587[_0x0fb3('0x33')]);_0x1f46d2['attributes']=_[_0x0fb3('0x36')](_0xf74587[_0x0fb3('0x32')],qs[_0x0fb3('0x38')](_0x1ba1de[_0x0fb3('0x33')][_0x0fb3('0x38')]));_0x1f46d2[_0x0fb3('0x37')]=_0x1f46d2['attributes'][_0x0fb3('0x47')]?_0x1f46d2[_0x0fb3('0x37')]:_0xf74587['model'];if(_0x1ba1de['query'][_0x0fb3('0x48')]){_0x1f46d2[_0x0fb3('0x42')]=[{'all':!![]}];}_0x1f46d2=_[_0x0fb3('0x3f')]({},_0x1f46d2,_0x1ba1de['options']);return db[_0x0fb3('0x2e')][_0x0fb3('0x49')](_0x1f46d2)['then'](handleEntityNotFound(_0x18e0ae,null))[_0x0fb3('0x29')](respondWithResult(_0x18e0ae,null))[_0x0fb3('0x44')](handleError(_0x18e0ae,null));};exports[_0x0fb3('0x4a')]=function(_0x3bd36b,_0x285c1d){return db['FaxApplication'][_0x0fb3('0x4a')](_0x3bd36b[_0x0fb3('0x4b')],{})[_0x0fb3('0x29')](respondWithResult(_0x285c1d,0xc9))[_0x0fb3('0x44')](handleError(_0x285c1d,null));};exports[_0x0fb3('0x4c')]=function(_0x4fc6c5,_0x113b9e){if(_0x4fc6c5['body']['id']){delete _0x4fc6c5[_0x0fb3('0x4b')]['id'];}return db[_0x0fb3('0x2e')][_0x0fb3('0x49')]({'where':{'id':_0x4fc6c5[_0x0fb3('0x46')]['id']}})[_0x0fb3('0x29')](handleEntityNotFound(_0x113b9e,null))[_0x0fb3('0x29')](saveUpdates(_0x4fc6c5[_0x0fb3('0x4b')],null))[_0x0fb3('0x29')](respondWithResult(_0x113b9e,null))['catch'](handleError(_0x113b9e,null));};exports[_0x0fb3('0x28')]=function(_0x2537ae,_0x13af19){return db[_0x0fb3('0x2e')][_0x0fb3('0x49')]({'where':{'id':_0x2537ae[_0x0fb3('0x46')]['id']}})[_0x0fb3('0x29')](handleEntityNotFound(_0x13af19,null))[_0x0fb3('0x29')](removeEntity(_0x13af19,null))['catch'](handleError(_0x13af19,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7103ef0..7b8101d 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 _0xca1b=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications'];(function(_0xd1e9e3,_0x2a4b07){var _0x259adc=function(_0x43aded){while(--_0x43aded){_0xd1e9e3['push'](_0xd1e9e3['shift']());}};_0x259adc(++_0x2a4b07);}(_0xca1b,0x69));var _0xbca1=function(_0x95e309,_0x525412){_0x95e309=_0x95e309-0x0;var _0x106753=_0xca1b[_0x95e309];return _0x106753;};'use strict';var _=require(_0xbca1('0x0'));var util=require(_0xbca1('0x1'));var logger=require(_0xbca1('0x2'))(_0xbca1('0x3'));var moment=require(_0xbca1('0x4'));var BPromise=require(_0xbca1('0x5'));var rp=require(_0xbca1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbca1('0x7'));var config=require('../../config/environment');var attributes=require(_0xbca1('0x8'));module['exports']=function(_0x32a940,_0x2eb110){return _0x32a940[_0xbca1('0x9')](_0xbca1('0xa'),attributes,{'tableName':_0xbca1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbca1('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4504=['./faxApplication.attributes','define','FaxApplication','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x538f1d,_0xe7c54d){var _0x564f74=function(_0x3f8b44){while(--_0x3f8b44){_0x538f1d['push'](_0x538f1d['shift']());}};_0x564f74(++_0xe7c54d);}(_0x4504,0xa0));var _0x4450=function(_0x4e3880,_0x82a0cf){_0x4e3880=_0x4e3880-0x0;var _0x279770=_0x4504[_0x4e3880];return _0x279770;};'use strict';var _=require(_0x4450('0x0'));var util=require(_0x4450('0x1'));var logger=require(_0x4450('0x2'))(_0x4450('0x3'));var moment=require(_0x4450('0x4'));var BPromise=require('bluebird');var rp=require(_0x4450('0x5'));var fs=require('fs');var path=require(_0x4450('0x6'));var rimraf=require(_0x4450('0x7'));var config=require('../../config/environment');var attributes=require(_0x4450('0x8'));module['exports']=function(_0x346a76,_0x58c83a){return _0x346a76[_0x4450('0x9')](_0x4450('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4450('0xb'),'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 45d6cee..70651f9 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 _0xdce3=['../../config/environment','jayson/promise','client','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','limit','then','lodash','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x40d20f,_0x702892){var _0x4953ce=function(_0x52fa3d){while(--_0x52fa3d){_0x40d20f['push'](_0x40d20f['shift']());}};_0x4953ce(++_0x702892);}(_0xdce3,0xd3));var _0x3dce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdce3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3dce('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dce('0x1'));var db=require(_0x3dce('0x2'))['db'];var utils=require(_0x3dce('0x3'));var logger=require('../../config/logger')(_0x3dce('0x4'));var config=require(_0x3dce('0x5'));var jayson=require(_0x3dce('0x6'));var client=jayson[_0x3dce('0x7')][_0x3dce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21bd57,_0x4a90cb,_0x5cc4c3){return new BPromise(function(_0x52f6d7,_0x21e5ca){return client['request'](_0x21bd57,_0x5cc4c3)['then'](function(_0x17d257){logger[_0x3dce('0x9')](_0x3dce('0xa'),_0x4a90cb,_0x3dce('0xb'));logger[_0x3dce('0xc')](_0x3dce('0xd'),_0x4a90cb,'request\x20sent',JSON[_0x3dce('0xe')](_0x17d257));if(_0x17d257['error']){if(_0x17d257['error']['code']===0x1f4){logger[_0x3dce('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4a90cb,_0x17d257[_0x3dce('0xf')]['message']);return _0x21e5ca(_0x17d257[_0x3dce('0xf')][_0x3dce('0x10')]);}logger[_0x3dce('0xf')](_0x3dce('0xa'),_0x4a90cb,_0x17d257[_0x3dce('0xf')][_0x3dce('0x10')]);return _0x52f6d7(_0x17d257[_0x3dce('0xf')]['message']);}else{logger[_0x3dce('0x9')]('FaxApplication,\x20%s,\x20%s',_0x4a90cb,_0x3dce('0xb'));_0x52f6d7(_0x17d257[_0x3dce('0x11')][_0x3dce('0x10')]);}})[_0x3dce('0x12')](function(_0x2597ef){logger[_0x3dce('0xf')](_0x3dce('0xa'),_0x4a90cb,_0x2597ef);_0x21e5ca(_0x2597ef);});});}exports[_0x3dce('0x13')]=function(_0x14ad3a){var _0x36b77e=this;return new Promise(function(_0x14fbb8,_0x440917){return db['FaxApplication'][_0x3dce('0x14')](_0x14ad3a[_0x3dce('0x15')],{'raw':_0x14ad3a[_0x3dce('0x16')]?_0x14ad3a[_0x3dce('0x16')][_0x3dce('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14ad3a[_0x3dce('0x16')]?_0x14ad3a[_0x3dce('0x16')][_0x3dce('0x18')]||null:null,'attributes':_0x14ad3a['options']?_0x14ad3a['options']['attributes']||null:null,'limit':_0x14ad3a[_0x3dce('0x16')]?_0x14ad3a['options'][_0x3dce('0x19')]||null:null})[_0x3dce('0x1a')](function(_0x10ee79){logger[_0x3dce('0x9')](_0x3dce('0x13'),_0x14ad3a);logger[_0x3dce('0xc')]('UpdateFaxApplication',_0x14ad3a,JSON['stringify'](_0x10ee79));_0x14fbb8(_0x10ee79);})[_0x3dce('0x12')](function(_0x424065){logger[_0x3dce('0xf')]('UpdateFaxApplication',_0x424065['message'],_0x14ad3a);_0x440917(_0x36b77e[_0x3dce('0xf')](0x1f4,_0x424065[_0x3dce('0x10')]));});});}; \ No newline at end of file +var _0x4db5=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s'];(function(_0x55ca72,_0x58376b){var _0x4e43d5=function(_0x4222a3){while(--_0x4222a3){_0x55ca72['push'](_0x55ca72['shift']());}};_0x4e43d5(++_0x58376b);}(_0x4db5,0x192));var _0x54db=function(_0x874e01,_0x3eac23){_0x874e01=_0x874e01-0x0;var _0x410f85=_0x4db5[_0x874e01];return _0x410f85;};'use strict';var _=require('lodash');var util=require(_0x54db('0x0'));var moment=require(_0x54db('0x1'));var BPromise=require(_0x54db('0x2'));var rs=require(_0x54db('0x3'));var fs=require('fs');var Redis=require(_0x54db('0x4'));var db=require(_0x54db('0x5'))['db'];var utils=require(_0x54db('0x6'));var logger=require(_0x54db('0x7'))('rpc');var config=require(_0x54db('0x8'));var jayson=require(_0x54db('0x9'));var client=jayson[_0x54db('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b4b0,_0x1b2ca4,_0x5bd98c){return new BPromise(function(_0x396420,_0x3aab0f){return client[_0x54db('0xb')](_0x50b4b0,_0x5bd98c)[_0x54db('0xc')](function(_0x21678c){logger['info'](_0x54db('0xd'),_0x1b2ca4,'request\x20sent');logger[_0x54db('0xe')](_0x54db('0xf'),_0x1b2ca4,'request\x20sent',JSON['stringify'](_0x21678c));if(_0x21678c[_0x54db('0x10')]){if(_0x21678c['error'][_0x54db('0x11')]===0x1f4){logger[_0x54db('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1b2ca4,_0x21678c[_0x54db('0x10')][_0x54db('0x12')]);return _0x3aab0f(_0x21678c[_0x54db('0x10')]['message']);}logger[_0x54db('0x10')](_0x54db('0xd'),_0x1b2ca4,_0x21678c[_0x54db('0x10')][_0x54db('0x12')]);return _0x396420(_0x21678c['error'][_0x54db('0x12')]);}else{logger[_0x54db('0x13')]('FaxApplication,\x20%s,\x20%s',_0x1b2ca4,_0x54db('0x14'));_0x396420(_0x21678c[_0x54db('0x15')][_0x54db('0x12')]);}})[_0x54db('0x16')](function(_0x483a34){logger[_0x54db('0x10')](_0x54db('0xd'),_0x1b2ca4,_0x483a34);_0x3aab0f(_0x483a34);});});}exports[_0x54db('0x17')]=function(_0x1eb3e4){var _0x7e649f=this;return new Promise(function(_0x30a298,_0x4145cd){return db[_0x54db('0x18')][_0x54db('0x19')](_0x1eb3e4[_0x54db('0x1a')],{'raw':_0x1eb3e4[_0x54db('0x1b')]?_0x1eb3e4[_0x54db('0x1b')][_0x54db('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eb3e4[_0x54db('0x1b')]?_0x1eb3e4['options'][_0x54db('0x1d')]||null:null,'attributes':_0x1eb3e4[_0x54db('0x1b')]?_0x1eb3e4[_0x54db('0x1b')][_0x54db('0x1e')]||null:null,'limit':_0x1eb3e4[_0x54db('0x1b')]?_0x1eb3e4[_0x54db('0x1b')][_0x54db('0x1f')]||null:null})[_0x54db('0xc')](function(_0x387022){logger[_0x54db('0x13')]('UpdateFaxApplication',_0x1eb3e4);logger['debug'](_0x54db('0x17'),_0x1eb3e4,JSON['stringify'](_0x387022));_0x30a298(_0x387022);})[_0x54db('0x16')](function(_0x501dd4){logger['error'](_0x54db('0x17'),_0x501dd4[_0x54db('0x12')],_0x1eb3e4);_0x4145cd(_0x7e649f['error'](0x1f4,_0x501dd4['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index b9cd593..0c9dd1c 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 _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x178d95,_0x5880c1){var _0x55688c=function(_0x481551){while(--_0x481551){_0x178d95['push'](_0x178d95['shift']());}};_0x55688c(++_0x5880c1);}(_0x7916,0x128));var _0x6791=function(_0x33fe7f,_0x344195){_0x33fe7f=_0x33fe7f-0x0;var _0x3f3b80=_0x7916[_0x33fe7f];return _0x3f3b80;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file +var _0x2547=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','update'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0x2547,0x1cd));var _0x7254=function(_0x1b7df5,_0x122778){_0x1b7df5=_0x1b7df5-0x0;var _0x297a19=_0x2547[_0x1b7df5];return _0x297a19;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['post']('/',auth[_0x7254('0xa')](),controller['create']);router['put']('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0xe')]);router[_0x7254('0xf')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 964771b..a99ff1b 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 _0x3972=['sequelize','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x31ee6c,_0x3c4217){var _0x8fae3a=function(_0x569129){while(--_0x569129){_0x31ee6c['push'](_0x31ee6c['shift']());}};_0x8fae3a(++_0x3c4217);}(_0x3972,0x120));var _0x2397=function(_0x20fba2,_0x4b0b0a){_0x20fba2=_0x20fba2-0x0;var _0x44c26e=_0x3972[_0x20fba2];return _0x44c26e;};'use strict';var Sequelize=require(_0x2397('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2397('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2397('0x2')]},'secondDisposition':{'type':Sequelize[_0x2397('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2397('0x2')]},'note':{'type':Sequelize[_0x2397('0x2')]},'read1stAt':{'type':Sequelize[_0x2397('0x3')]},'fax':{'type':Sequelize[_0x2397('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x2397('0x4')]('in',_0x2397('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2397('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xa4b1=['exports','BOOLEAN','STRING','DATE','out','ENUM','sequelize'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa4b1,0xae));var _0x1a4b=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xa4b1[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x1a4b('0x0'));module[_0x1a4b('0x1')]={'closed':{'type':Sequelize[_0x1a4b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1a4b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1a4b('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1a4b('0x4')]},'fax':{'type':Sequelize[_0x1a4b('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1a4b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1a4b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1a4b('0x6')]('in',_0x1a4b('0x5')),'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 76b5a9f..fb8d579 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 _0xa53c=['update','then','destroy','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','push','catch','FaxInteraction','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','value','`\x20=\x200','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','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.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','include','create','addMessage','FaxMessage','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','root','files','tmp','join','server','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','createWriteStream','basename','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa53c,0xb0));var _0xca53=function(_0x5b9ff7,_0x5ee9d9){_0x5b9ff7=_0x5b9ff7-0x0;var _0x53119d=_0xa53c[_0x5b9ff7];return _0x53119d;};'use strict';var emlformat=require(_0xca53('0x0'));var rimraf=require(_0xca53('0x1'));var zipdir=require(_0xca53('0x2'));var jsonpatch=require(_0xca53('0x3'));var rp=require(_0xca53('0x4'));var moment=require('moment');var BPromise=require(_0xca53('0x5'));var Mustache=require(_0xca53('0x6'));var util=require(_0xca53('0x7'));var path=require('path');var sox=require(_0xca53('0x8'));var csv=require(_0xca53('0x9'));var ejs=require(_0xca53('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca53('0xb'));var squel=require(_0xca53('0xc'));var crypto=require(_0xca53('0xd'));var jsforce=require(_0xca53('0xe'));var deskjs=require(_0xca53('0xf'));var toCsv=require(_0xca53('0x9'));var querystring=require(_0xca53('0x10'));var Papa=require('papaparse');var Redis=require(_0xca53('0x11'));var authService=require(_0xca53('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xca53('0x13'))(_0xca53('0x14'));var utils=require(_0xca53('0x15'));var config=require(_0xca53('0x16'));var licenseUtil=require(_0xca53('0x17'));var db=require(_0xca53('0x18'))['db'];config['redis']=_[_0xca53('0x19')](config[_0xca53('0x1a')],{'host':_0xca53('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca53('0x1a')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x352dc7,_0x14e925){_0x14e925=_0x14e925||0xcc;return function(_0x452db9){if(_0x452db9){return _0x352dc7['sendStatus'](_0x14e925);}return _0x352dc7[_0xca53('0x1c')](_0x14e925)[_0xca53('0x1d')]();};}function respondWithResult(_0x30e533,_0x14b867){_0x14b867=_0x14b867||0xc8;return function(_0x5623fa){if(_0x5623fa){return _0x30e533[_0xca53('0x1c')](_0x14b867)[_0xca53('0x1e')](_0x5623fa);}};}function respondWithFilteredResult(_0x3dd9e6,_0x30e811){return function(_0x587b0f){if(_0x587b0f){var _0x12395a=typeof _0x30e811[_0xca53('0x1f')]===_0xca53('0x20')&&typeof _0x30e811[_0xca53('0x21')]===_0xca53('0x20');var _0x2fd55a=_0x587b0f[_0xca53('0x22')];var _0x1b5620=_0x12395a?0x0:_0x30e811['offset'];var _0x3da8a4=_0x12395a?_0x587b0f[_0xca53('0x22')]:_0x30e811[_0xca53('0x1f')]+_0x30e811['limit'];var _0x4a7134;if(_0x3da8a4>=_0x2fd55a){_0x3da8a4=_0x2fd55a;_0x4a7134=0xc8;}else{_0x4a7134=0xce;}_0x3dd9e6[_0xca53('0x1c')](_0x4a7134);return _0x3dd9e6['set'](_0xca53('0x23'),_0x1b5620+'-'+_0x3da8a4+'/'+_0x2fd55a)[_0xca53('0x1e')](_0x587b0f);}return null;};}function patchUpdates(_0x1b68ab){return function(_0x3c28e0){try{jsonpatch[_0xca53('0x24')](_0x3c28e0,_0x1b68ab,!![]);}catch(_0x587685){return BPromise[_0xca53('0x25')](_0x587685);}return _0x3c28e0[_0xca53('0x26')]();};}function saveUpdates(_0xde1a74,_0xe2b61b){return function(_0x24e5e1){if(_0x24e5e1){return _0x24e5e1[_0xca53('0x27')](_0xde1a74)[_0xca53('0x28')](function(_0x1d9a8c){return _0x1d9a8c;});}return null;};}function removeEntity(_0x34239e,_0x5f27bc){return function(_0x127b38){if(_0x127b38){return _0x127b38[_0xca53('0x29')]()[_0xca53('0x28')](function(){_0x34239e[_0xca53('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c79b,_0x10a35c){return function(_0x2f483e){if(!_0x2f483e){_0x14c79b[_0xca53('0x2a')](0x194);}return _0x2f483e;};}function handleError(_0x22bbff,_0x516c4a){_0x516c4a=_0x516c4a||0x1f4;return function(_0x4dc5f9){logger[_0xca53('0x2b')](_0x4dc5f9[_0xca53('0x2c')]);if(_0x4dc5f9['name']){delete _0x4dc5f9[_0xca53('0x2d')];}_0x22bbff[_0xca53('0x1c')](_0x516c4a)[_0xca53('0x2e')](_0x4dc5f9);};}function getInteractionUsers(_0x2d5809,_0x1a0d5f){return new BPromise(function(_0x17eb5c,_0x578dec){try{if(_0x1a0d5f[_0x2d5809['id']]){_0x2d5809[_0xca53('0x2f')]=_[_0xca53('0x30')](_0x1a0d5f[_0x2d5809['id']],function(_0x153dfa){return{'id':_0x153dfa['id'],'fullname':_0x153dfa['fullname']};});}}catch(_0x5a5bae){_0x578dec(_0x5a5bae);}_0x17eb5c(_0x2d5809);});}function getInteractionTags(_0x1e2301,_0x48c050){return new BPromise(function(_0x4946a5,_0x4a7b22){try{if(_0x1e2301[_0xca53('0x31')]){_0x1e2301[_0xca53('0x32')]=[];_0x1e2301[_0xca53('0x31')][_0xca53('0x33')](',')['forEach'](function(_0x332744){_0x1e2301[_0xca53('0x32')][_0xca53('0x34')](_0x48c050[_0x332744]);});}delete _0x1e2301[_0xca53('0x31')];}catch(_0x5aef39){_0x4a7b22(_0x5aef39);}_0x4946a5(_0x1e2301);});}function updateFaxInteraction(_0x475992,_0x141af1,_0x14e363){return new BPromise(function(_0x35931c,_0x1cdaef){return getInteractionUsers(_0x475992,_0x14e363)['then'](function(_0xc7542){return getInteractionTags(_0xc7542,_0x141af1);})[_0xca53('0x28')](function(_0x5b31b1){_0x35931c(_0x5b31b1);})[_0xca53('0x35')](function(_0x486e09){_0x1cdaef(_0x486e09);});});}exports['index']=function(_0x2f30f6,_0x117cf4){var _0x56731a={},_0x4f46bd={},_0x2657f4={'count':0x0,'rows':[]};var _0x2a0fb6=_[_0xca53('0x30')](db[_0xca53('0x36')][_0xca53('0x37')],function(_0x2d53af){return{'name':_0x2d53af['fieldName'],'type':_0x2d53af[_0xca53('0x38')][_0xca53('0x39')]};});_0x4f46bd[_0xca53('0x3a')]=_[_0xca53('0x30')](_0x2a0fb6,'name');_0x4f46bd['query']=_[_0xca53('0x3b')](_0x2f30f6[_0xca53('0x3c')]);_0x4f46bd['filters']=_[_0xca53('0x3d')](_0x4f46bd['model'],_0x4f46bd['query']);_0x56731a[_0xca53('0x3e')]=_[_0xca53('0x3d')](_0x4f46bd[_0xca53('0x3a')],qs[_0xca53('0x3f')](_0x2f30f6[_0xca53('0x3c')]['fields']));_0x56731a['attributes']=_0x56731a[_0xca53('0x3e')][_0xca53('0x40')]?_0x56731a[_0xca53('0x3e')]:_0x4f46bd[_0xca53('0x3a')];if(!_0x2f30f6[_0xca53('0x3c')][_0xca53('0x41')](_0xca53('0x42'))){_0x56731a['limit']=qs[_0xca53('0x21')](_0x2f30f6[_0xca53('0x3c')][_0xca53('0x21')]);_0x56731a[_0xca53('0x1f')]=qs[_0xca53('0x1f')](_0x2f30f6[_0xca53('0x3c')]['offset']);}_0x56731a['order']=qs[_0xca53('0x43')](_0x2f30f6[_0xca53('0x3c')]['sort']);_0x56731a[_0xca53('0x44')]=qs[_0xca53('0x45')](_['pick'](_0x2f30f6[_0xca53('0x3c')],_0x4f46bd[_0xca53('0x45')]),_0x2a0fb6);var _0x49c239=[];var _0x427a31=squel[_0xca53('0x46')]()[_0xca53('0x47')]('id')['field'](_0xca53('0x2d'))[_0xca53('0x47')](_0xca53('0x48'))[_0xca53('0x49')](_0xca53('0x4a'));var _0xeb344a=squel[_0xca53('0x46')]()['field'](_0xca53('0x4b'))['field'](_0xca53('0x4c'))['field'](_0xca53('0x4d'))[_0xca53('0x49')](_0xca53('0x4e'),'ui')[_0xca53('0x4f')](_0xca53('0x50'),'u',_0xca53('0x51'));var _0x49c83c=squel[_0xca53('0x46')]()['from'](_0xca53('0x52'),'i')['left_join'](_0xca53('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xca53('0x4f')](_0xca53('0x50'),'o',_0xca53('0x54'))[_0xca53('0x4f')](_0xca53('0x55'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xca53('0x56'),'me',_0xca53('0x57'))[_0xca53('0x4f')](_0xca53('0x58'),'it',_0xca53('0x59'))[_0xca53('0x4f')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x499769=squel[_0xca53('0x5a')]();var _0x1be7b8=[];var _0x3b832b=squel['expr']();var _0x5623cb;if(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x5b')]){_0x5623cb=as['parseSearch'](_0x2f30f6[_0xca53('0x3c')][_0xca53('0x5b')]);var _0x545eda=_0x5623cb[_0xca53('0x5c')];for(var _0x441907=0x0;_0x441907<_0x5623cb[_0xca53('0x5d')][_0xca53('0x40')];_0x441907++){var _0x20af85=_0x5623cb[_0xca53('0x5d')][_0x441907];var _0x575061='i';var _0x2f2775=_[_0xca53('0x5e')](_0x2a0fb6,[_0xca53('0x2d'),_0x20af85[_0xca53('0x47')]]);if(!_0x2f2775){switch(_0x20af85[_0xca53('0x47')]){case'unreadMessages':if(_0x20af85[_0xca53('0x5f')]==0x1){_0x49c83c['having']('`'+_0x20af85['field']+_0xca53('0x60'));}else{_0x49c83c[_0xca53('0x61')]('`'+_0x20af85[_0xca53('0x47')]+_0xca53('0x62'));}break;case'Contact':if(_0x20af85['operator']===_0xca53('0x63')){if(_0x20af85[_0xca53('0x5f')]['split']('\x20')[_0xca53('0x40')]>0x1){_0x499769[_0x545eda](_0xca53('0x64'),qs[_0xca53('0x65')](_0x20af85['value']),null);}else{var _0x39ec67='%'+_0x20af85['value']+'%';_0x499769[_0x545eda](_0xca53('0x66'),_0x39ec67,_0x39ec67,_0x39ec67);}}else{_0x2f2775=_['find'](_0x2a0fb6,['name',_0xca53('0x67')]);_0x20af85[_0xca53('0x47')]=_0xca53('0x67');_0x2f1bfc=as[_0xca53('0x68')](_0x575061,_0x2f2775[_0xca53('0x38')],_0x20af85);_0x499769[_0x545eda](_0x2f1bfc[_0xca53('0x69')],_0x2f1bfc[_0xca53('0x5f')][_0xca53('0x6a')],_0x2f1bfc['value']['end']);}break;case _0xca53('0x6b'):var _0x5f455a=_0x20af85[_0xca53('0x5f')][_0xca53('0x33')](',')[_0xca53('0x30')](function(_0x3cf587){return Number(_0x3cf587);});_0x5f455a[_0xca53('0x6c')](function(_0x3e8366){_0x3b832b['or'](_0xca53('0x6d'),'%,'+_0x3e8366+',%');});_0x1be7b8=_['union'](_0x1be7b8,_0x5f455a);break;case _0xca53('0x6e'):if(_0x20af85['operator']===_0xca53('0x63')){_0x499769[_0x545eda]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x20af85[_0xca53('0x5f')]+'%',null);}else{_0x2f2775=_[_0xca53('0x5e')](_0x2a0fb6,[_0xca53('0x2d'),_0xca53('0x6f')]);_0x20af85['field']='UserId';_0x2f1bfc=as[_0xca53('0x68')](_0x575061,_0x2f2775['type'],_0x20af85);_0x499769[_0x545eda](_0x2f1bfc[_0xca53('0x69')],_0x2f1bfc['value'][_0xca53('0x6a')],_0x2f1bfc[_0xca53('0x5f')][_0xca53('0x1d')]);}break;case _0xca53('0x70'):_0x2f1bfc=as[_0xca53('0x68')]('me',null,_0x20af85);_0x499769[_0x545eda](_0x2f1bfc[_0xca53('0x69')],_0x2f1bfc[_0xca53('0x5f')]['start'],_0x2f1bfc[_0xca53('0x5f')][_0xca53('0x1d')]);break;}}else{var _0x2f1bfc=as[_0xca53('0x68')](_0x575061,_0x2f2775[_0xca53('0x38')],_0x20af85);_0x499769[_0x545eda](_0x2f1bfc[_0xca53('0x69')],_0x2f1bfc[_0xca53('0x5f')][_0xca53('0x6a')],_0x2f1bfc[_0xca53('0x5f')][_0xca53('0x1d')]);}}}else{var _0x49b4b0=_(_0x2f30f6[_0xca53('0x3c')])['keys']()['map'](function(_0x213164){return _[_0xca53('0x71')](_0x2a0fb6,['name',_0x213164])?_0x213164:undefined;})[_0xca53('0x72')]()[_0xca53('0x5f')]();if(!_[_0xca53('0x73')](_0x49b4b0)){_0x49b4b0['forEach'](function(_0x30b0d9){if(_0x30b0d9==='FaxAccountId'){_0x49c83c[_0xca53('0x44')](_0xca53('0x74'),[][_0xca53('0x75')](_0x2f30f6[_0xca53('0x3c')][_0x30b0d9]));}else if(_0x30b0d9==='createdAt'){var _0x5b5afc=JSON['parse'](_0x2f30f6[_0xca53('0x3c')][_0x30b0d9])[_0xca53('0x76')];var _0x3e82dc=JSON[_0xca53('0x77')](_0x2f30f6[_0xca53('0x3c')][_0x30b0d9])['$lte'];_0x49c83c[_0xca53('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b5afc,_0x3e82dc);}else{if(_0x2f30f6['query'][_0x30b0d9]===_0xca53('0x78')){_0x49c83c[_0xca53('0x44')]('i.'+_0x30b0d9+_0xca53('0x79'));}else{_0x49c83c[_0xca53('0x44')]('i.'+_0x30b0d9+_0xca53('0x7a'),_0x2f30f6[_0xca53('0x3c')][_0x30b0d9]);}}});}if(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x7b')]){if(_0x2f30f6['query']['read']==0x1){_0x49c83c[_0xca53('0x61')](_0xca53('0x7c'));}else{_0x49c83c['having'](_0xca53('0x7d'));}}if(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x7e')]){_0x1be7b8=_[_0xca53('0x7f')](_0x2f30f6['query'][_0xca53('0x7e')])?_0x2f30f6[_0xca53('0x3c')][_0xca53('0x7e')]:new Array(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x7e')]);_0x1be7b8[_0xca53('0x6c')](function(_0x107e93){_0x3b832b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x107e93+',%');});}if(_0x2f30f6[_0xca53('0x3c')]['filter']){var _0x3360b3=_0x2f30f6[_0xca53('0x3c')][_0xca53('0x80')][_0xca53('0x81')]('\x5c','\x5c\x5c')[_0xca53('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3360b3)){_0x499769['or']('i.id\x20LIKE\x20?',_0x3360b3+'%')['or'](_0xca53('0x82'),_0x3360b3+'%');}_0x499769['or'](_0xca53('0x83'),_0x3360b3+'%');}}_0x49c83c[_0xca53('0x44')](_0x499769);_0x49c83c[_0xca53('0x84')](_0xca53('0x85'));var _0x399d73={'type':db[_0xca53('0x86')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1a6f34=_0x49c83c[_0xca53('0x87')]();_0x1a6f34[_0xca53('0x47')]('i.id');_0x1a6f34[_0xca53('0x47')](_0xca53('0x88'),_0xca53('0x89'));if(_0x56731a[_0xca53('0x8a')]){_0x56731a['order'][_0xca53('0x6c')](function(_0x567d8e){var _0x200f9b=_0x567d8e[0x0]===_0xca53('0x8b')?_0x567d8e[0x0]:'i.'+_0x567d8e[0x0];_0x49c83c[_0xca53('0x8a')](_0x200f9b,_0x567d8e[0x1]===_0xca53('0x8c')?![]:!![]);});}if(!_[_0xca53('0x73')](_0x1be7b8)){_0x49c83c[_0xca53('0x61')](_0x3b832b);_0x1a6f34[_0xca53('0x44')](_0xca53('0x8d'),_0x1be7b8);}BPromise['resolve']()[_0xca53('0x28')](function(){if(!_0x5623cb){if(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x8e')])return;_0x1a6f34['where'](_0xca53('0x8f'));_0x49c83c[_0xca53('0x44')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2f30f6[_0xca53('0x90')]['role']!==_0xca53('0x91'))return;return _0x2f30f6[_0xca53('0x90')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xca53('0x28')](function(_0x3e43c2){if(_[_0xca53('0x73')](_0x3e43c2)){_0x1a6f34[_0xca53('0x44')]('i.FaxAccountId\x20IS\x20NULL');_0x49c83c[_0xca53('0x44')](_0xca53('0x92'));}else{_0x1a6f34[_0xca53('0x44')]('i.FaxAccountId\x20IN\x20?',_[_0xca53('0x30')](_0x3e43c2,'id'));_0x49c83c[_0xca53('0x44')]('i.FaxAccountId\x20IN\x20?',_[_0xca53('0x30')](_0x3e43c2,'id'));}});})[_0xca53('0x28')](function(){if(_0x2f30f6[_0xca53('0x90')][_0xca53('0x93')]==='agent'&&!_0x5623cb&&!_0x2f30f6[_0xca53('0x3c')][_0xca53('0x8e')])return[];return db[_0xca53('0x94')][_0xca53('0x3c')](_0x1a6f34[_0xca53('0x95')](),_0x399d73);})[_0xca53('0x28')](function(_0x283383){_0x2657f4[_0xca53('0x22')]=_0x283383[_0xca53('0x40')];if(_0x2657f4[_0xca53('0x22')]===0x0)return[];return db['sequelize'][_0xca53('0x3c')](_0x427a31[_0xca53('0x95')](),_0x399d73)[_0xca53('0x28')](function(_0x20fd57){_0x49c239=_[_0xca53('0x96')](_0x20fd57,'id');_0x399d73=_[_0xca53('0x97')](_0x399d73,{'model':db[_0xca53('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f30f6[_0xca53('0x3c')][_0xca53('0x3f')]){_0x56731a[_0xca53('0x3e')][_0xca53('0x6c')](function(_0x5a709c){_0x49c83c[_0xca53('0x47')]('i.'+_0x5a709c);});}else{_0x49c83c[_0xca53('0x47')](_0xca53('0x88'),_0xca53('0x89'));_0x49c83c[_0xca53('0x47')](_0xca53('0x98'),_0xca53('0x99'));_0x49c83c[_0xca53('0x47')]('a.mandatoryDisposition',_0xca53('0x9a'));_0x49c83c[_0xca53('0x47')](_0xca53('0x9b'),_0xca53('0x8b'));_0x49c83c[_0xca53('0x47')](_0xca53('0x9c'));_0x49c83c[_0xca53('0x47')]('c.firstName',_0xca53('0x9d'));_0x49c83c['field'](_0xca53('0x9e'),_0xca53('0x9f'));_0x49c83c[_0xca53('0x47')](_0xca53('0xa0'),_0xca53('0xa1'));_0x49c83c[_0xca53('0x47')](_0xca53('0xa2'),_0xca53('0xa3'));_0x49c83c['field'](_0xca53('0xa4'),_0xca53('0xa5'));_0x49c83c['field'](_0xca53('0xa6'),'Contact.fax');_0x49c83c[_0xca53('0x47')](_0xca53('0xa7'),_0xca53('0xa8'));_0x49c83c[_0xca53('0x47')](_0xca53('0xa9'),_0xca53('0xaa'));_0x49c83c[_0xca53('0x47')](_0xca53('0xab'),_0xca53('0x31'));}if(_0x56731a[_0xca53('0x21')])_0x49c83c[_0xca53('0x21')](_0x56731a[_0xca53('0x21')]);if(_0x56731a[_0xca53('0x1f')])_0x49c83c[_0xca53('0x1f')](_0x56731a[_0xca53('0x1f')]);return db['sequelize'][_0xca53('0x3c')](_0x49c83c[_0xca53('0x95')](),_0x399d73);})['then'](function(_0x5406a6){if(_0x5406a6['length']>0x0)_0xeb344a['where'](_0xca53('0xac'),_[_0xca53('0x30')](_0x5406a6,'id'));return db[_0xca53('0x94')][_0xca53('0x3c')](_0xeb344a['toString'](),_0x399d73)[_0xca53('0x28')](function(_0x27c899){var _0x335c29=_[_0xca53('0xad')](_0x27c899,_0xca53('0xae'));var _0x3eb850=[];_0x5406a6[_0xca53('0x6c')](function(_0x4b7703){_0x3eb850[_0xca53('0x34')](updateFaxInteraction(_0x4b7703,_0x49c239,_0x335c29));});return BPromise[_0xca53('0xaf')](_0x3eb850);});});})[_0xca53('0x28')](function(_0x15dd3c){_0x2657f4['rows']=_0x15dd3c;return _0x2657f4;})[_0xca53('0x28')](respondWithFilteredResult(_0x117cf4,_0x56731a))[_0xca53('0x35')](handleError(_0x117cf4,null));};exports[_0xca53('0xb0')]=function(_0x49dcdc,_0x2e7cfe){var _0x18f698={'raw':![],'where':{'id':_0x49dcdc[_0xca53('0xb1')]['id']}},_0x5edfd6={};_0x5edfd6[_0xca53('0x3a')]=_[_0xca53('0x3b')](db[_0xca53('0x36')]['rawAttributes']);_0x5edfd6['query']=_[_0xca53('0x3b')](_0x49dcdc[_0xca53('0x3c')]);_0x5edfd6[_0xca53('0x45')]=_['intersection'](_0x5edfd6[_0xca53('0x3a')],_0x5edfd6['query']);_0x18f698['attributes']=_[_0xca53('0x3d')](_0x5edfd6[_0xca53('0x3a')],qs[_0xca53('0x3f')](_0x49dcdc[_0xca53('0x3c')][_0xca53('0x3f')]));_0x18f698[_0xca53('0x3e')]=_0x18f698[_0xca53('0x3e')][_0xca53('0x40')]?_0x18f698[_0xca53('0x3e')]:_0x5edfd6[_0xca53('0x3a')];if(_0x49dcdc[_0xca53('0x3c')][_0xca53('0xb2')]){_0x18f698[_0xca53('0xb3')]=[{'all':!![]}];}_0x18f698=_[_0xca53('0x97')]({},_0x18f698,_0x49dcdc['options']);return db[_0xca53('0x36')][_0xca53('0x5e')](_0x18f698)[_0xca53('0x28')](handleEntityNotFound(_0x2e7cfe,null))[_0xca53('0x28')](respondWithResult(_0x2e7cfe,null))[_0xca53('0x35')](handleError(_0x2e7cfe,null));};exports[_0xca53('0xb4')]=function(_0x487709,_0x21f043){return db['FaxInteraction'][_0xca53('0xb4')](_0x487709[_0xca53('0x70')],{})['then'](respondWithResult(_0x21f043,0xc9))[_0xca53('0x35')](handleError(_0x21f043,null));};exports['update']=function(_0x597ad2,_0x89c48d){if(_0x597ad2[_0xca53('0x70')]['id']){delete _0x597ad2[_0xca53('0x70')]['id'];}return db[_0xca53('0x36')][_0xca53('0x5e')]({'where':{'id':_0x597ad2['params']['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x89c48d,null))[_0xca53('0x28')](saveUpdates(_0x597ad2[_0xca53('0x70')],null))[_0xca53('0x28')](respondWithResult(_0x89c48d,null))[_0xca53('0x35')](handleError(_0x89c48d,null));};exports[_0xca53('0x29')]=function(_0x29fdfd,_0x1b6922){return db[_0xca53('0x36')][_0xca53('0x5e')]({'where':{'id':_0x29fdfd[_0xca53('0xb1')]['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x1b6922,null))[_0xca53('0x28')](removeEntity(_0x1b6922,null))['catch'](handleError(_0x1b6922,null));};exports['describe']=function(_0x46eecf,_0x48c3cc){return db['FaxInteraction']['describe']()['then'](respondWithResult(_0x48c3cc,null))[_0xca53('0x35')](handleError(_0x48c3cc,null));};exports[_0xca53('0xb5')]=function(_0x514b2b,_0x25d195,_0x2c7821){return db[_0xca53('0xb6')][_0xca53('0x5e')]({'where':{'id':_0x514b2b[_0xca53('0xb1')]['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x25d195,null))['then'](function(_0x45e61a){if(_0x45e61a){return _0x45e61a['addMessage'](_0x514b2b[_0xca53('0x70')][_0xca53('0xb7')],_['omit'](_0x514b2b[_0xca53('0x70')],[_0xca53('0xb7'),'id'])||{});}})['then'](respondWithResult(_0x25d195,null))[_0xca53('0x35')](handleError(_0x25d195,null));};exports['getMessages']=function(_0x143adc,_0x5948b9,_0x466a67){var _0x12f0c2={'raw':![],'where':{}};var _0x4c38e7={};var _0x5f1c56={'count':0x0,'rows':[]};return db[_0xca53('0x36')][_0xca53('0xb8')]({'where':{'id':_0x143adc[_0xca53('0xb1')]['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x5948b9,null))[_0xca53('0x28')](function(_0x257a91){if(_0x257a91){_0x4c38e7[_0xca53('0x3a')]=_['keys'](db[_0xca53('0xb6')][_0xca53('0x37')]);_0x4c38e7[_0xca53('0x3c')]=_[_0xca53('0x3b')](_0x143adc[_0xca53('0x3c')]);_0x4c38e7['filters']=_[_0xca53('0x3d')](_0x4c38e7[_0xca53('0x3a')],_0x4c38e7[_0xca53('0x3c')]);_0x12f0c2[_0xca53('0x3e')]=_[_0xca53('0x3d')](_0x4c38e7['model'],qs[_0xca53('0x3f')](_0x143adc['query'][_0xca53('0x3f')]));_0x12f0c2[_0xca53('0x3e')]=_0x12f0c2['attributes'][_0xca53('0x40')]?_0x12f0c2[_0xca53('0x3e')]:_0x4c38e7[_0xca53('0x3a')];if(!_0x143adc['query'][_0xca53('0x41')](_0xca53('0x42'))){_0x12f0c2[_0xca53('0x21')]=qs['limit'](_0x143adc[_0xca53('0x3c')][_0xca53('0x21')]);_0x12f0c2[_0xca53('0x1f')]=qs[_0xca53('0x1f')](_0x143adc['query']['offset']);}_0x12f0c2['order']=qs[_0xca53('0x43')](_0x143adc[_0xca53('0x3c')][_0xca53('0x43')]);_0x12f0c2[_0xca53('0x44')]=qs['filters'](_['pick'](_0x143adc[_0xca53('0x3c')],_0x4c38e7['filters']));_0x12f0c2[_0xca53('0x44')][_0xca53('0xae')]=_0x257a91['id'];if(_0x143adc[_0xca53('0x3c')]['filter']){_0x12f0c2[_0xca53('0x44')]=_['merge'](_0x12f0c2['where'],{'$or':_[_0xca53('0x30')](_0x12f0c2[_0xca53('0x3e')],function(_0x2ef41a){var _0x139b71={};_0x139b71[_0x2ef41a]={'$like':'%'+_0x143adc[_0xca53('0x3c')][_0xca53('0x80')]+'%'};return _0x139b71;})});}if(_0x143adc[_0xca53('0x3c')]['$gte']){var _0x403e6c=_0x143adc[_0xca53('0x3c')][_0xca53('0x76')]['split'](',');var _0x1650a3={};_0x1650a3[_0x403e6c[0x0]]={'$gte':moment(_0x403e6c[0x1])[_0xca53('0xb9')](_0xca53('0xba'))};_0x12f0c2[_0xca53('0x44')]=_[_0xca53('0x97')](_0x12f0c2[_0xca53('0x44')],_0x1650a3);}_0x12f0c2=_[_0xca53('0x97')]({},_0x12f0c2,_0x143adc[_0xca53('0xbb')]);return db['FaxMessage']['count']({'where':_0x12f0c2['where']})[_0xca53('0x28')](function(_0x237fb9){_0x5f1c56[_0xca53('0x22')]=_0x237fb9;if(_0x143adc[_0xca53('0x3c')]['includeAll']){_0x12f0c2[_0xca53('0xb3')]=[{'all':!![]}];}return db[_0xca53('0xb6')][_0xca53('0xbc')](_0x12f0c2);})[_0xca53('0x28')](function(_0x50a1e1){_0x5f1c56[_0xca53('0xbd')]=_0x50a1e1;return _0x5f1c56;});}})['then'](respondWithFilteredResult(_0x5948b9,_0x12f0c2))['catch'](handleError(_0x5948b9,null));};exports[_0xca53('0xbe')]=function(_0x35550f,_0x292d75,_0x118ab8){return db[_0xca53('0x36')][_0xca53('0x5e')]({'where':{'id':_0x35550f[_0xca53('0xb1')]['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x292d75,null))[_0xca53('0x28')](function(_0x1a1d0b){if(_0x1a1d0b){return _0x1a1d0b[_0xca53('0xbf')](_0x35550f[_0xca53('0x70')][_0xca53('0xb7')],_['omit'](_0x35550f['body'],[_0xca53('0xb7'),'id'])||{})[_0xca53('0xc0')](function(){return db[_0xca53('0x6b')][_0xca53('0xbc')]({'attributes':['id',_0xca53('0x2d'),'color'],'where':{'id':_0x35550f[_0xca53('0x70')][_0xca53('0xb7')]}});})['then'](function(_0x48bdf0){socket[_0xca53('0xc1')](_0xca53('0xc2'),{'id':Number(_0x35550f[_0xca53('0xb1')]['id']),'tags':_0x48bdf0||[]});return{'id':Number(_0x35550f[_0xca53('0xb1')]['id']),'tags':_0x48bdf0||[]};});}})[_0xca53('0x28')](respondWithResult(_0x292d75,null))['catch'](handleError(_0x292d75,null));};exports['removeTags']=function(_0x76df07,_0x28a3d6,_0x506320){return db['FaxInteraction']['find']({'where':{'id':_0x76df07[_0xca53('0xb1')]['id']}})[_0xca53('0x28')](handleEntityNotFound(_0x28a3d6,null))[_0xca53('0x28')](function(_0x160bef){if(_0x160bef){return _0x160bef[_0xca53('0xc3')](_0x76df07[_0xca53('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x28a3d6,null))['catch'](handleError(_0x28a3d6,null));};exports[_0xca53('0xc4')]=function(_0x4f91c6,_0x367072){var _0x250454=moment()['unix']()[_0xca53('0x95')]();var _0x19f67d=path['join'](config[_0xca53('0xc5')],'server',_0xca53('0xc6'),_0xca53('0xc7'));var _0x36cd6c=path[_0xca53('0xc8')](config[_0xca53('0xc5')],_0xca53('0xc9'),'files','attachments');var _0x52883a=path[_0xca53('0xc8')](_0x19f67d,_0x250454);var _0x43aa84=util[_0xca53('0xb9')]('transcript-%d-%s.zip',_0x4f91c6[_0xca53('0xb1')]['id'],_0x250454);var _0x14f772=path[_0xca53('0xc8')](_0x19f67d,_0x43aa84);var _0x1001d8=[];_0x1001d8[_0xca53('0x34')]({'model':db[_0xca53('0xca')],'as':_0xca53('0xca'),'raw':!![]});var _0x363d6a=[{'model':db[_0xca53('0xb6')],'as':_0xca53('0xcb'),'attributes':['id','body',_0xca53('0xcc')],'include':_0x1001d8}];return db[_0xca53('0x36')][_0xca53('0x5e')]({'where':{'id':_0x4f91c6[_0xca53('0xb1')]['id']},'include':_0x363d6a})[_0xca53('0x28')](handleEntityNotFound(_0x367072,null))[_0xca53('0x28')](function(_0xe41f8a){if(_0xe41f8a&&_0xe41f8a[_0xca53('0xcb')]){var _0x17b64d=_0xe41f8a[_0xca53('0xcd')]({'plain':!![]});fs[_0xca53('0xce')](_0x52883a);for(var _0x417e0c=0x0;_0x417e0c<_0x17b64d[_0xca53('0xcb')][_0xca53('0x40')];_0x417e0c++){var _0x4e6033=_0x17b64d[_0xca53('0xcb')][_0x417e0c][_0xca53('0xca')];if(_0x4e6033){var _0x2bd2e8=path['join'](_0x36cd6c,_0x4e6033['basename']);if(fs[_0xca53('0xcf')](_0x2bd2e8)){fs[_0xca53('0xd0')](_0x2bd2e8)['pipe'](fs[_0xca53('0xd1')](path[_0xca53('0xc8')](_0x52883a,_0x4e6033[_0xca53('0xd2')])));}}}return BPromise[_0xca53('0xd3')]()[_0xca53('0x28')](function(){return new BPromise(function(_0x17320f,_0x2bc378){zipdir(_0x52883a,{'saveTo':_0x14f772},function(_0x30a3db,_0x9e6c13){if(_0x30a3db)return _0x2bc378(_0x30a3db);return _0x17320f(_0x9e6c13);});})['then'](function(){return new BPromise(function(_0x4ce539,_0x2abfce){rimraf(_0x52883a,function(_0x333f83){if(_0x333f83)_0x2abfce(_0x333f83);return _0x4ce539();});});})[_0xca53('0x28')](function(){return _0x367072[_0xca53('0xc4')](_0x14f772,_0x43aa84,function(_0x447431){if(_0x447431){console[_0xca53('0xd4')](_0xca53('0xd5'),_0x447431);}else{fs[_0xca53('0xd6')](_0x14f772);}});});});}else{return _0x367072['sendStatus'](0xc8);}})[_0xca53('0x35')](handleError(_0x367072,null));}; \ No newline at end of file +var _0x16eb=['Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','index','map','FaxInteraction','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','nolimit','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','users','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','end','Tag','union','User','operator','UserId','buildExpression','keys','some','isEmpty','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','FaxAccountId','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','catch','show','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','findOne','FaxMessage','hasOwnProperty','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','join','root','files','tmp','server','transcript-%d-%s.zip'];(function(_0x368dbc,_0x1b3ddc){var _0x257b6b=function(_0x4cef54){while(--_0x4cef54){_0x368dbc['push'](_0x368dbc['shift']());}};_0x257b6b(++_0x1b3ddc);}(_0x16eb,0x1b6));var _0xb16e=function(_0x224a32,_0xf156ca){_0x224a32=_0x224a32-0x0;var _0x5f279e=_0x16eb[_0x224a32];return _0x5f279e;};'use strict';var emlformat=require(_0xb16e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb16e('0x1'));var rp=require(_0xb16e('0x2'));var moment=require(_0xb16e('0x3'));var BPromise=require(_0xb16e('0x4'));var Mustache=require(_0xb16e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb16e('0x6'));var csv=require(_0xb16e('0x7'));var ejs=require(_0xb16e('0x8'));var fs=require('fs');var fs_extra=require(_0xb16e('0x9'));var _=require(_0xb16e('0xa'));var squel=require('squel');var crypto=require(_0xb16e('0xb'));var jsforce=require(_0xb16e('0xc'));var deskjs=require(_0xb16e('0xd'));var toCsv=require(_0xb16e('0x7'));var querystring=require(_0xb16e('0xe'));var Papa=require(_0xb16e('0xf'));var Redis=require(_0xb16e('0x10'));var authService=require(_0xb16e('0x11'));var qs=require(_0xb16e('0x12'));var as=require(_0xb16e('0x13'));var hardwareService=require(_0xb16e('0x14'));var logger=require('../../config/logger')(_0xb16e('0x15'));var utils=require('../../config/utils');var config=require(_0xb16e('0x16'));var licenseUtil=require(_0xb16e('0x17'));var db=require(_0xb16e('0x18'))['db'];config[_0xb16e('0x19')]=_[_0xb16e('0x1a')](config[_0xb16e('0x19')],{'host':_0xb16e('0x1b'),'port':0x18eb});var socket=require(_0xb16e('0x1c'))(new Redis(config[_0xb16e('0x19')]));require(_0xb16e('0x1d'))[_0xb16e('0x1e')](socket);function respondWithStatusCode(_0x455974,_0x1f1ec5){_0x1f1ec5=_0x1f1ec5||0xcc;return function(_0x21f64a){if(_0x21f64a){return _0x455974['sendStatus'](_0x1f1ec5);}return _0x455974[_0xb16e('0x1f')](_0x1f1ec5)['end']();};}function respondWithResult(_0x282862,_0x345e72){_0x345e72=_0x345e72||0xc8;return function(_0x5f064e){if(_0x5f064e){return _0x282862[_0xb16e('0x1f')](_0x345e72)[_0xb16e('0x20')](_0x5f064e);}};}function respondWithFilteredResult(_0x426d7f,_0x5259c7){return function(_0x39f015){if(_0x39f015){var _0x551f53=typeof _0x5259c7[_0xb16e('0x21')]===_0xb16e('0x22')&&typeof _0x5259c7[_0xb16e('0x23')]==='undefined';var _0x2c417c=_0x39f015[_0xb16e('0x24')];var _0x3f0fdc=_0x551f53?0x0:_0x5259c7[_0xb16e('0x21')];var _0x376519=_0x551f53?_0x39f015[_0xb16e('0x24')]:_0x5259c7[_0xb16e('0x21')]+_0x5259c7[_0xb16e('0x23')];var _0x594cb2;if(_0x376519>=_0x2c417c){_0x376519=_0x2c417c;_0x594cb2=0xc8;}else{_0x594cb2=0xce;}_0x426d7f[_0xb16e('0x1f')](_0x594cb2);return _0x426d7f[_0xb16e('0x25')]('Content-Range',_0x3f0fdc+'-'+_0x376519+'/'+_0x2c417c)[_0xb16e('0x20')](_0x39f015);}return null;};}function patchUpdates(_0xaf788){return function(_0x42870e){try{jsonpatch['apply'](_0x42870e,_0xaf788,!![]);}catch(_0xade8c7){return BPromise[_0xb16e('0x26')](_0xade8c7);}return _0x42870e[_0xb16e('0x27')]();};}function saveUpdates(_0xac9858,_0x36bf31){return function(_0x13af11){if(_0x13af11){return _0x13af11[_0xb16e('0x28')](_0xac9858)['then'](function(_0x1501a8){return _0x1501a8;});}return null;};}function removeEntity(_0x2bb3a4,_0x3ebd1d){return function(_0xf7d224){if(_0xf7d224){return _0xf7d224[_0xb16e('0x29')]()[_0xb16e('0x2a')](function(){_0x2bb3a4[_0xb16e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x469986,_0xea66a){return function(_0x3523ae){if(!_0x3523ae){_0x469986[_0xb16e('0x2b')](0x194);}return _0x3523ae;};}function handleError(_0x834ccc,_0xd9d799){_0xd9d799=_0xd9d799||0x1f4;return function(_0x49056f){logger[_0xb16e('0x2c')](_0x49056f[_0xb16e('0x2d')]);if(_0x49056f[_0xb16e('0x2e')]){delete _0x49056f[_0xb16e('0x2e')];}_0x834ccc['status'](_0xd9d799)[_0xb16e('0x2f')](_0x49056f);};}function getInteractionUsers(_0x68f93,_0x1d866d){return new BPromise(function(_0x1c2b01,_0x3557ec){try{if(_0x1d866d[_0x68f93['id']]){_0x68f93[_0xb16e('0x30')]=_['map'](_0x1d866d[_0x68f93['id']],function(_0x45f6d5){return{'id':_0x45f6d5['id'],'fullname':_0x45f6d5[_0xb16e('0x31')]};});}}catch(_0x5cc9a6){_0x3557ec(_0x5cc9a6);}_0x1c2b01(_0x68f93);});}function getInteractionTags(_0x4f822a,_0x2aeae){return new BPromise(function(_0x34bd67,_0xb38062){try{if(_0x4f822a[_0xb16e('0x32')]){_0x4f822a[_0xb16e('0x33')]=[];_0x4f822a[_0xb16e('0x32')][_0xb16e('0x34')](',')[_0xb16e('0x35')](function(_0x4d3476){_0x4f822a['Tags']['push'](_0x2aeae[_0x4d3476]);});}delete _0x4f822a[_0xb16e('0x32')];}catch(_0x193d0){_0xb38062(_0x193d0);}_0x34bd67(_0x4f822a);});}function updateFaxInteraction(_0xf8842e,_0x1329a1,_0x3ae4a4){return new BPromise(function(_0x1a344,_0x59f3ee){return getInteractionUsers(_0xf8842e,_0x3ae4a4)[_0xb16e('0x2a')](function(_0x3fbe0b){return getInteractionTags(_0x3fbe0b,_0x1329a1);})[_0xb16e('0x2a')](function(_0x1c2690){_0x1a344(_0x1c2690);})['catch'](function(_0x33db14){_0x59f3ee(_0x33db14);});});}exports[_0xb16e('0x36')]=function(_0x556a04,_0x34295d){var _0x3deac7={},_0x440bd7={},_0x23ef1f={'count':0x0,'rows':[]};var _0x542a2e=_[_0xb16e('0x37')](db[_0xb16e('0x38')][_0xb16e('0x39')],function(_0x35bacb){return{'name':_0x35bacb['fieldName'],'type':_0x35bacb[_0xb16e('0x3a')][_0xb16e('0x3b')]};});_0x440bd7['model']=_['map'](_0x542a2e,_0xb16e('0x2e'));_0x440bd7[_0xb16e('0x3c')]=_['keys'](_0x556a04[_0xb16e('0x3c')]);_0x440bd7[_0xb16e('0x3d')]=_[_0xb16e('0x3e')](_0x440bd7[_0xb16e('0x3f')],_0x440bd7['query']);_0x3deac7[_0xb16e('0x40')]=_[_0xb16e('0x3e')](_0x440bd7[_0xb16e('0x3f')],qs[_0xb16e('0x41')](_0x556a04[_0xb16e('0x3c')]['fields']));_0x3deac7[_0xb16e('0x40')]=_0x3deac7['attributes']['length']?_0x3deac7[_0xb16e('0x40')]:_0x440bd7[_0xb16e('0x3f')];if(!_0x556a04['query']['hasOwnProperty'](_0xb16e('0x42'))){_0x3deac7[_0xb16e('0x23')]=qs[_0xb16e('0x23')](_0x556a04[_0xb16e('0x3c')][_0xb16e('0x23')]);_0x3deac7[_0xb16e('0x21')]=qs['offset'](_0x556a04[_0xb16e('0x3c')]['offset']);}_0x3deac7[_0xb16e('0x43')]=qs[_0xb16e('0x44')](_0x556a04[_0xb16e('0x3c')][_0xb16e('0x44')]);_0x3deac7['where']=qs[_0xb16e('0x3d')](_['pick'](_0x556a04[_0xb16e('0x3c')],_0x440bd7[_0xb16e('0x3d')]),_0x542a2e);var _0x2e0eb5=[];var _0x1776ee=squel[_0xb16e('0x45')]()[_0xb16e('0x46')]('id')['field'](_0xb16e('0x2e'))[_0xb16e('0x46')](_0xb16e('0x47'))[_0xb16e('0x48')](_0xb16e('0x49'));var _0x1035e6=squel[_0xb16e('0x45')]()[_0xb16e('0x46')](_0xb16e('0x4a'))[_0xb16e('0x46')](_0xb16e('0x4b'))['field'](_0xb16e('0x4c'))[_0xb16e('0x48')]('user_has_fax_interactions','ui')[_0xb16e('0x4d')](_0xb16e('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x58160f=squel[_0xb16e('0x45')]()['from'](_0xb16e('0x4f'),'i')[_0xb16e('0x4d')]('cm_contacts','c',_0xb16e('0x50'))['left_join'](_0xb16e('0x4e'),'o',_0xb16e('0x51'))[_0xb16e('0x4d')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0xb16e('0x4d')](_0xb16e('0x52'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xb16e('0x4d')]('fax_interaction_has_tags','it',_0xb16e('0x53'))[_0xb16e('0x4d')](_0xb16e('0x49'),'t',_0xb16e('0x54'));var _0xa1ef25=squel[_0xb16e('0x55')]();var _0x114a53=[];var _0x584470=squel['expr']();var _0x3ff5e0;if(_0x556a04['query'][_0xb16e('0x56')]){_0x3ff5e0=as[_0xb16e('0x57')](_0x556a04[_0xb16e('0x3c')][_0xb16e('0x56')]);var _0x16df9c=_0x3ff5e0[_0xb16e('0x58')];for(var _0x5bb8ba=0x0;_0x5bb8ba<_0x3ff5e0[_0xb16e('0x59')][_0xb16e('0x5a')];_0x5bb8ba++){var _0x1f3001=_0x3ff5e0[_0xb16e('0x59')][_0x5bb8ba];var _0x4d815a='i';var _0x37fcae=_[_0xb16e('0x5b')](_0x542a2e,[_0xb16e('0x2e'),_0x1f3001[_0xb16e('0x46')]]);if(!_0x37fcae){switch(_0x1f3001[_0xb16e('0x46')]){case _0xb16e('0x5c'):if(_0x1f3001[_0xb16e('0x5d')]==0x1){_0x58160f['having']('`'+_0x1f3001[_0xb16e('0x46')]+'`\x20=\x200');}else{_0x58160f[_0xb16e('0x5e')]('`'+_0x1f3001[_0xb16e('0x46')]+_0xb16e('0x5f'));}break;case'Contact':if(_0x1f3001['operator']===_0xb16e('0x60')){if(_0x1f3001['value'][_0xb16e('0x34')]('\x20')[_0xb16e('0x5a')]>0x1){_0xa1ef25[_0x16df9c](_0xb16e('0x61'),qs[_0xb16e('0x62')](_0x1f3001[_0xb16e('0x5d')]),null);}else{var _0x1e89a3='%'+_0x1f3001[_0xb16e('0x5d')]+'%';_0xa1ef25[_0x16df9c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1e89a3,_0x1e89a3,_0x1e89a3);}}else{_0x37fcae=_['find'](_0x542a2e,[_0xb16e('0x2e'),_0xb16e('0x63')]);_0x1f3001[_0xb16e('0x46')]=_0xb16e('0x63');_0x322d42=as['buildExpression'](_0x4d815a,_0x37fcae[_0xb16e('0x3a')],_0x1f3001);_0xa1ef25[_0x16df9c](_0x322d42[_0xb16e('0x64')],_0x322d42[_0xb16e('0x5d')][_0xb16e('0x65')],_0x322d42['value'][_0xb16e('0x66')]);}break;case _0xb16e('0x67'):var _0x2ce9ad=_0x1f3001[_0xb16e('0x5d')][_0xb16e('0x34')](',')['map'](function(_0xf7f0d9){return Number(_0xf7f0d9);});_0x2ce9ad[_0xb16e('0x35')](function(_0x5af42a){_0x584470['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5af42a+',%');});_0x114a53=_[_0xb16e('0x68')](_0x114a53,_0x2ce9ad);break;case _0xb16e('0x69'):if(_0x1f3001[_0xb16e('0x6a')]===_0xb16e('0x60')){_0xa1ef25[_0x16df9c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1f3001[_0xb16e('0x5d')]+'%',null);}else{_0x37fcae=_[_0xb16e('0x5b')](_0x542a2e,['name','UserId']);_0x1f3001[_0xb16e('0x46')]=_0xb16e('0x6b');_0x322d42=as[_0xb16e('0x6c')](_0x4d815a,_0x37fcae[_0xb16e('0x3a')],_0x1f3001);_0xa1ef25[_0x16df9c](_0x322d42[_0xb16e('0x64')],_0x322d42[_0xb16e('0x5d')]['start'],_0x322d42[_0xb16e('0x5d')]['end']);}break;case'body':_0x322d42=as[_0xb16e('0x6c')]('me',null,_0x1f3001);_0xa1ef25[_0x16df9c](_0x322d42['text'],_0x322d42[_0xb16e('0x5d')][_0xb16e('0x65')],_0x322d42[_0xb16e('0x5d')][_0xb16e('0x66')]);break;}}else{var _0x322d42=as['buildExpression'](_0x4d815a,_0x37fcae[_0xb16e('0x3a')],_0x1f3001);_0xa1ef25[_0x16df9c](_0x322d42[_0xb16e('0x64')],_0x322d42[_0xb16e('0x5d')]['start'],_0x322d42[_0xb16e('0x5d')][_0xb16e('0x66')]);}}}else{var _0x2bb47d=_(_0x556a04[_0xb16e('0x3c')])[_0xb16e('0x6d')]()[_0xb16e('0x37')](function(_0x242ee5){return _[_0xb16e('0x6e')](_0x542a2e,[_0xb16e('0x2e'),_0x242ee5])?_0x242ee5:undefined;})['compact']()['value']();if(!_[_0xb16e('0x6f')](_0x2bb47d)){_0x2bb47d['forEach'](function(_0x1489f7){if(_0x1489f7==='FaxAccountId'){_0x58160f[_0xb16e('0x70')](_0xb16e('0x71'),[][_0xb16e('0x72')](_0x556a04[_0xb16e('0x3c')][_0x1489f7]));}else if(_0x1489f7===_0xb16e('0x73')){var _0x5b1b5d=JSON[_0xb16e('0x74')](_0x556a04[_0xb16e('0x3c')][_0x1489f7])['$gte'];var _0x2967c2=JSON[_0xb16e('0x74')](_0x556a04[_0xb16e('0x3c')][_0x1489f7])[_0xb16e('0x75')];_0x58160f[_0xb16e('0x70')](_0xb16e('0x76'),_0x5b1b5d,_0x2967c2);}else{if(_0x556a04[_0xb16e('0x3c')][_0x1489f7]===_0xb16e('0x77')){_0x58160f[_0xb16e('0x70')]('i.'+_0x1489f7+_0xb16e('0x78'));}else{_0x58160f[_0xb16e('0x70')]('i.'+_0x1489f7+'\x20=\x20?',_0x556a04[_0xb16e('0x3c')][_0x1489f7]);}}});}if(_0x556a04[_0xb16e('0x3c')][_0xb16e('0x79')]){if(_0x556a04['query']['read']==0x1){_0x58160f[_0xb16e('0x5e')](_0xb16e('0x7a'));}else{_0x58160f[_0xb16e('0x5e')](_0xb16e('0x7b'));}}if(_0x556a04[_0xb16e('0x3c')][_0xb16e('0x7c')]){_0x114a53=_[_0xb16e('0x7d')](_0x556a04[_0xb16e('0x3c')][_0xb16e('0x7c')])?_0x556a04[_0xb16e('0x3c')]['tag']:new Array(_0x556a04['query'][_0xb16e('0x7c')]);_0x114a53[_0xb16e('0x35')](function(_0x1c55f9){_0x584470['or'](_0xb16e('0x7e'),'%,'+_0x1c55f9+',%');});}if(_0x556a04[_0xb16e('0x3c')][_0xb16e('0x7f')]){var _0x2fd2fa=_0x556a04[_0xb16e('0x3c')]['filter'][_0xb16e('0x80')]('\x5c','\x5c\x5c')[_0xb16e('0x80')](/'/g,'\x27\x27');if(qs[_0xb16e('0x81')](_0x2fd2fa)){_0xa1ef25['or'](_0xb16e('0x82'),_0x2fd2fa+'%')['or'](_0xb16e('0x83'),_0x2fd2fa+'%');}_0xa1ef25['or'](_0xb16e('0x84'),_0x2fd2fa+'%');}}_0x58160f[_0xb16e('0x70')](_0xa1ef25);_0x58160f['group'](_0xb16e('0x85'));var _0x196c5c={'type':db[_0xb16e('0x86')][_0xb16e('0x87')][_0xb16e('0x88')],'raw':!![]};var _0x35dc6d=_0x58160f[_0xb16e('0x89')]();_0x35dc6d['field'](_0xb16e('0x85'));_0x35dc6d['field'](_0xb16e('0x8a'),_0xb16e('0x5c'));if(_0x3deac7[_0xb16e('0x43')]){_0x3deac7['order']['forEach'](function(_0x1f14fc){var _0x2f90cc=_0x1f14fc[0x0]===_0xb16e('0x8b')?_0x1f14fc[0x0]:'i.'+_0x1f14fc[0x0];_0x58160f[_0xb16e('0x43')](_0x2f90cc,_0x1f14fc[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb16e('0x6f')](_0x114a53)){_0x58160f[_0xb16e('0x5e')](_0x584470);_0x35dc6d['where']('t.id\x20IN\x20?',_0x114a53);}BPromise[_0xb16e('0x8c')]()[_0xb16e('0x2a')](function(){if(!_0x3ff5e0){if(_0x556a04['query']['FaxAccountId'])return;_0x35dc6d[_0xb16e('0x70')](_0xb16e('0x8d'));_0x58160f[_0xb16e('0x70')](_0xb16e('0x8d'));return;}if(_0x556a04['user'][_0xb16e('0x8e')]!==_0xb16e('0x8f'))return;return _0x556a04[_0xb16e('0x90')][_0xb16e('0x91')]({'attributes':['id'],'raw':!![]})[_0xb16e('0x2a')](function(_0x67f207){if(_[_0xb16e('0x6f')](_0x67f207)){_0x35dc6d[_0xb16e('0x70')]('i.FaxAccountId\x20IS\x20NULL');_0x58160f[_0xb16e('0x70')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x35dc6d[_0xb16e('0x70')](_0xb16e('0x71'),_[_0xb16e('0x37')](_0x67f207,'id'));_0x58160f['where'](_0xb16e('0x71'),_[_0xb16e('0x37')](_0x67f207,'id'));}});})[_0xb16e('0x2a')](function(){if(_0x556a04[_0xb16e('0x90')][_0xb16e('0x8e')]===_0xb16e('0x8f')&&!_0x3ff5e0&&!_0x556a04[_0xb16e('0x3c')][_0xb16e('0x92')])return[];return db[_0xb16e('0x93')][_0xb16e('0x3c')](_0x35dc6d[_0xb16e('0x94')](),_0x196c5c);})[_0xb16e('0x2a')](function(_0x1cdcd7){_0x23ef1f['count']=_0x1cdcd7[_0xb16e('0x5a')];if(_0x23ef1f[_0xb16e('0x24')]===0x0)return[];return db[_0xb16e('0x93')][_0xb16e('0x3c')](_0x1776ee['toString'](),_0x196c5c)[_0xb16e('0x2a')](function(_0x3a0209){_0x2e0eb5=_[_0xb16e('0x95')](_0x3a0209,'id');_0x196c5c=_[_0xb16e('0x96')](_0x196c5c,{'model':db[_0xb16e('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x556a04[_0xb16e('0x3c')][_0xb16e('0x41')]){_0x3deac7[_0xb16e('0x40')][_0xb16e('0x35')](function(_0x5e0516){_0x58160f[_0xb16e('0x46')]('i.'+_0x5e0516);});}else{_0x58160f[_0xb16e('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x58160f[_0xb16e('0x46')](_0xb16e('0x97'),_0xb16e('0x98'));_0x58160f['field'](_0xb16e('0x99'),_0xb16e('0x9a'));_0x58160f[_0xb16e('0x46')]('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',_0xb16e('0x8b'));_0x58160f[_0xb16e('0x46')](_0xb16e('0x9b'));_0x58160f[_0xb16e('0x46')](_0xb16e('0x9c'),_0xb16e('0x9d'));_0x58160f[_0xb16e('0x46')](_0xb16e('0x9e'),_0xb16e('0x9f'));_0x58160f['field'](_0xb16e('0xa0'),'Contact.email');_0x58160f[_0xb16e('0x46')]('c.phone','Contact.phone');_0x58160f[_0xb16e('0x46')]('c.mobile','Contact.mobile');_0x58160f['field'](_0xb16e('0xa1'),_0xb16e('0xa2'));_0x58160f[_0xb16e('0x46')](_0xb16e('0xa3'),_0xb16e('0xa4'));_0x58160f[_0xb16e('0x46')](_0xb16e('0xa5'),_0xb16e('0xa6'));_0x58160f[_0xb16e('0x46')](_0xb16e('0xa7'),_0xb16e('0x32'));}if(_0x3deac7[_0xb16e('0x23')])_0x58160f[_0xb16e('0x23')](_0x3deac7[_0xb16e('0x23')]);if(_0x3deac7[_0xb16e('0x21')])_0x58160f[_0xb16e('0x21')](_0x3deac7[_0xb16e('0x21')]);return db[_0xb16e('0x93')][_0xb16e('0x3c')](_0x58160f[_0xb16e('0x94')](),_0x196c5c);})[_0xb16e('0x2a')](function(_0x522f31){if(_0x522f31[_0xb16e('0x5a')]>0x0)_0x1035e6[_0xb16e('0x70')]('ui.FaxInteractionId\x20IN\x20?',_[_0xb16e('0x37')](_0x522f31,'id'));return db[_0xb16e('0x93')]['query'](_0x1035e6[_0xb16e('0x94')](),_0x196c5c)['then'](function(_0x3c38b4){var _0x456f77=_[_0xb16e('0xa8')](_0x3c38b4,_0xb16e('0xa9'));var _0xba24e0=[];_0x522f31[_0xb16e('0x35')](function(_0xd0566f){_0xba24e0['push'](updateFaxInteraction(_0xd0566f,_0x2e0eb5,_0x456f77));});return BPromise[_0xb16e('0xaa')](_0xba24e0);});});})[_0xb16e('0x2a')](function(_0x2ea452){_0x23ef1f[_0xb16e('0xab')]=_0x2ea452;return _0x23ef1f;})[_0xb16e('0x2a')](respondWithFilteredResult(_0x34295d,_0x3deac7))[_0xb16e('0xac')](handleError(_0x34295d,null));};exports[_0xb16e('0xad')]=function(_0x20161b,_0x51df80){var _0x1edf6d={'raw':![],'where':{'id':_0x20161b[_0xb16e('0xae')]['id']}},_0x4034c0={};_0x4034c0[_0xb16e('0x3f')]=_['keys'](db['FaxInteraction'][_0xb16e('0x39')]);_0x4034c0[_0xb16e('0x3c')]=_['keys'](_0x20161b['query']);_0x4034c0[_0xb16e('0x3d')]=_[_0xb16e('0x3e')](_0x4034c0[_0xb16e('0x3f')],_0x4034c0[_0xb16e('0x3c')]);_0x1edf6d['attributes']=_['intersection'](_0x4034c0[_0xb16e('0x3f')],qs[_0xb16e('0x41')](_0x20161b[_0xb16e('0x3c')][_0xb16e('0x41')]));_0x1edf6d['attributes']=_0x1edf6d[_0xb16e('0x40')][_0xb16e('0x5a')]?_0x1edf6d[_0xb16e('0x40')]:_0x4034c0[_0xb16e('0x3f')];if(_0x20161b[_0xb16e('0x3c')][_0xb16e('0xaf')]){_0x1edf6d[_0xb16e('0xb0')]=[{'all':!![]}];}_0x1edf6d=_['merge']({},_0x1edf6d,_0x20161b[_0xb16e('0xb1')]);return db[_0xb16e('0x38')][_0xb16e('0x5b')](_0x1edf6d)[_0xb16e('0x2a')](handleEntityNotFound(_0x51df80,null))[_0xb16e('0x2a')](respondWithResult(_0x51df80,null))['catch'](handleError(_0x51df80,null));};exports[_0xb16e('0xb2')]=function(_0x2252f3,_0x5ad26c){return db['FaxInteraction'][_0xb16e('0xb2')](_0x2252f3['body'],{})[_0xb16e('0x2a')](respondWithResult(_0x5ad26c,0xc9))[_0xb16e('0xac')](handleError(_0x5ad26c,null));};exports[_0xb16e('0x28')]=function(_0x154024,_0x35a173){if(_0x154024[_0xb16e('0xb3')]['id']){delete _0x154024[_0xb16e('0xb3')]['id'];}return db[_0xb16e('0x38')]['find']({'where':{'id':_0x154024[_0xb16e('0xae')]['id']}})[_0xb16e('0x2a')](handleEntityNotFound(_0x35a173,null))[_0xb16e('0x2a')](saveUpdates(_0x154024[_0xb16e('0xb3')],null))[_0xb16e('0x2a')](respondWithResult(_0x35a173,null))[_0xb16e('0xac')](handleError(_0x35a173,null));};exports[_0xb16e('0x29')]=function(_0x4bc72c,_0x1aa509){return db[_0xb16e('0x38')]['find']({'where':{'id':_0x4bc72c[_0xb16e('0xae')]['id']}})[_0xb16e('0x2a')](handleEntityNotFound(_0x1aa509,null))[_0xb16e('0x2a')](removeEntity(_0x1aa509,null))[_0xb16e('0xac')](handleError(_0x1aa509,null));};exports[_0xb16e('0xb4')]=function(_0x372c01,_0x477a6b){return db[_0xb16e('0x38')][_0xb16e('0xb4')]()[_0xb16e('0x2a')](respondWithResult(_0x477a6b,null))[_0xb16e('0xac')](handleError(_0x477a6b,null));};exports[_0xb16e('0xb5')]=function(_0x2b51ad,_0x17aa94,_0x531531){return db['FaxMessage']['find']({'where':{'id':_0x2b51ad['params']['id']}})[_0xb16e('0x2a')](handleEntityNotFound(_0x17aa94,null))[_0xb16e('0x2a')](function(_0x91eb56){if(_0x91eb56){return _0x91eb56[_0xb16e('0xb5')](_0x2b51ad['body'][_0xb16e('0xb6')],_[_0xb16e('0xb7')](_0x2b51ad[_0xb16e('0xb3')],[_0xb16e('0xb6'),'id'])||{});}})[_0xb16e('0x2a')](respondWithResult(_0x17aa94,null))[_0xb16e('0xac')](handleError(_0x17aa94,null));};exports['getMessages']=function(_0x422cf1,_0x2bbbc5,_0xcfa58){var _0x7bbaaf={'raw':![],'where':{}};var _0x2aded6={};var _0x142a41={'count':0x0,'rows':[]};return db[_0xb16e('0x38')][_0xb16e('0xb8')]({'where':{'id':_0x422cf1['params']['id']}})['then'](handleEntityNotFound(_0x2bbbc5,null))[_0xb16e('0x2a')](function(_0x49404e){if(_0x49404e){_0x2aded6[_0xb16e('0x3f')]=_[_0xb16e('0x6d')](db[_0xb16e('0xb9')][_0xb16e('0x39')]);_0x2aded6[_0xb16e('0x3c')]=_[_0xb16e('0x6d')](_0x422cf1[_0xb16e('0x3c')]);_0x2aded6[_0xb16e('0x3d')]=_['intersection'](_0x2aded6['model'],_0x2aded6[_0xb16e('0x3c')]);_0x7bbaaf[_0xb16e('0x40')]=_['intersection'](_0x2aded6[_0xb16e('0x3f')],qs[_0xb16e('0x41')](_0x422cf1[_0xb16e('0x3c')][_0xb16e('0x41')]));_0x7bbaaf[_0xb16e('0x40')]=_0x7bbaaf[_0xb16e('0x40')][_0xb16e('0x5a')]?_0x7bbaaf[_0xb16e('0x40')]:_0x2aded6[_0xb16e('0x3f')];if(!_0x422cf1[_0xb16e('0x3c')][_0xb16e('0xba')](_0xb16e('0x42'))){_0x7bbaaf['limit']=qs[_0xb16e('0x23')](_0x422cf1[_0xb16e('0x3c')][_0xb16e('0x23')]);_0x7bbaaf[_0xb16e('0x21')]=qs[_0xb16e('0x21')](_0x422cf1['query']['offset']);}_0x7bbaaf[_0xb16e('0x43')]=qs[_0xb16e('0x44')](_0x422cf1[_0xb16e('0x3c')][_0xb16e('0x44')]);_0x7bbaaf[_0xb16e('0x70')]=qs[_0xb16e('0x3d')](_[_0xb16e('0xbb')](_0x422cf1['query'],_0x2aded6[_0xb16e('0x3d')]));_0x7bbaaf['where'][_0xb16e('0xa9')]=_0x49404e['id'];if(_0x422cf1['query']['filter']){_0x7bbaaf['where']=_[_0xb16e('0x96')](_0x7bbaaf['where'],{'$or':_['map'](_0x7bbaaf[_0xb16e('0x40')],function(_0x1aa16e){var _0x4decc1={};_0x4decc1[_0x1aa16e]={'$like':'%'+_0x422cf1[_0xb16e('0x3c')][_0xb16e('0x7f')]+'%'};return _0x4decc1;})});}if(_0x422cf1[_0xb16e('0x3c')][_0xb16e('0xbc')]){var _0x1b90a5=_0x422cf1[_0xb16e('0x3c')][_0xb16e('0xbc')]['split'](',');var _0x518e3c={};_0x518e3c[_0x1b90a5[0x0]]={'$gte':moment(_0x1b90a5[0x1])[_0xb16e('0xbd')](_0xb16e('0xbe'))};_0x7bbaaf[_0xb16e('0x70')]=_[_0xb16e('0x96')](_0x7bbaaf[_0xb16e('0x70')],_0x518e3c);}_0x7bbaaf=_['merge']({},_0x7bbaaf,_0x422cf1[_0xb16e('0xb1')]);return db[_0xb16e('0xb9')][_0xb16e('0x24')]({'where':_0x7bbaaf['where']})[_0xb16e('0x2a')](function(_0x51239c){_0x142a41['count']=_0x51239c;if(_0x422cf1[_0xb16e('0x3c')][_0xb16e('0xaf')]){_0x7bbaaf[_0xb16e('0xb0')]=[{'all':!![]}];}return db[_0xb16e('0xb9')][_0xb16e('0xbf')](_0x7bbaaf);})['then'](function(_0x42a450){_0x142a41[_0xb16e('0xab')]=_0x42a450;return _0x142a41;});}})[_0xb16e('0x2a')](respondWithFilteredResult(_0x2bbbc5,_0x7bbaaf))[_0xb16e('0xac')](handleError(_0x2bbbc5,null));};exports[_0xb16e('0xc0')]=function(_0x11f995,_0x314f40,_0x457086){return db[_0xb16e('0x38')]['find']({'where':{'id':_0x11f995[_0xb16e('0xae')]['id']}})[_0xb16e('0x2a')](handleEntityNotFound(_0x314f40,null))['then'](function(_0x1833f){if(_0x1833f){return _0x1833f['setTags'](_0x11f995[_0xb16e('0xb3')][_0xb16e('0xb6')],_[_0xb16e('0xb7')](_0x11f995[_0xb16e('0xb3')],['ids','id'])||{})[_0xb16e('0xc1')](function(){return db['Tag'][_0xb16e('0xbf')]({'attributes':['id',_0xb16e('0x2e'),_0xb16e('0x47')],'where':{'id':_0x11f995[_0xb16e('0xb3')][_0xb16e('0xb6')]}});})[_0xb16e('0x2a')](function(_0xa798e8){socket[_0xb16e('0xc2')](_0xb16e('0xc3'),{'id':Number(_0x11f995[_0xb16e('0xae')]['id']),'tags':_0xa798e8||[]});return{'id':Number(_0x11f995[_0xb16e('0xae')]['id']),'tags':_0xa798e8||[]};});}})[_0xb16e('0x2a')](respondWithResult(_0x314f40,null))[_0xb16e('0xac')](handleError(_0x314f40,null));};exports[_0xb16e('0xc4')]=function(_0x57fbf8,_0x2fc299,_0x2bfc9f){return db['FaxInteraction'][_0xb16e('0x5b')]({'where':{'id':_0x57fbf8[_0xb16e('0xae')]['id']}})['then'](handleEntityNotFound(_0x2fc299,null))['then'](function(_0x1481c2){if(_0x1481c2){return _0x1481c2[_0xb16e('0xc4')](_0x57fbf8['query']['ids']);}})[_0xb16e('0x2a')](respondWithStatusCode(_0x2fc299,null))['catch'](handleError(_0x2fc299,null));};exports[_0xb16e('0xc5')]=function(_0x21a6ec,_0x30674a){var _0x3b1ca9=moment()['unix']()[_0xb16e('0x94')]();var _0x18cc99=path[_0xb16e('0xc6')](config[_0xb16e('0xc7')],'server',_0xb16e('0xc8'),_0xb16e('0xc9'));var _0x249f81=path[_0xb16e('0xc6')](config[_0xb16e('0xc7')],_0xb16e('0xca'),'files','attachments');var _0x3dbb52=path[_0xb16e('0xc6')](_0x18cc99,_0x3b1ca9);var _0x30d2b5=util[_0xb16e('0xbd')](_0xb16e('0xcb'),_0x21a6ec[_0xb16e('0xae')]['id'],_0x3b1ca9);var _0x3fce87=path['join'](_0x18cc99,_0x30d2b5);var _0x239f04=[];_0x239f04['push']({'model':db[_0xb16e('0xcc')],'as':_0xb16e('0xcc'),'raw':!![]});var _0x322dfc=[{'model':db['FaxMessage'],'as':_0xb16e('0xcd'),'attributes':['id',_0xb16e('0xb3'),_0xb16e('0x73')],'include':_0x239f04}];return db[_0xb16e('0x38')][_0xb16e('0x5b')]({'where':{'id':_0x21a6ec[_0xb16e('0xae')]['id']},'include':_0x322dfc})[_0xb16e('0x2a')](handleEntityNotFound(_0x30674a,null))[_0xb16e('0x2a')](function(_0x12216b){if(_0x12216b&&_0x12216b[_0xb16e('0xcd')]){var _0xf2b8e1=_0x12216b['get']({'plain':!![]});fs[_0xb16e('0xce')](_0x3dbb52);for(var _0x12f12b=0x0;_0x12f12b<_0xf2b8e1[_0xb16e('0xcd')][_0xb16e('0x5a')];_0x12f12b++){var _0x11559f=_0xf2b8e1[_0xb16e('0xcd')][_0x12f12b][_0xb16e('0xcc')];if(_0x11559f){var _0xd9191e=path[_0xb16e('0xc6')](_0x249f81,_0x11559f[_0xb16e('0xcf')]);if(fs[_0xb16e('0xd0')](_0xd9191e)){fs[_0xb16e('0xd1')](_0xd9191e)[_0xb16e('0xd2')](fs[_0xb16e('0xd3')](path['join'](_0x3dbb52,_0x11559f['basename'])));}}}return BPromise[_0xb16e('0x8c')]()[_0xb16e('0x2a')](function(){return new BPromise(function(_0x544dc3,_0x2a7639){zipdir(_0x3dbb52,{'saveTo':_0x3fce87},function(_0x109587,_0x5253cf){if(_0x109587)return _0x2a7639(_0x109587);return _0x544dc3(_0x5253cf);});})['then'](function(){return new BPromise(function(_0x41b653,_0x24023f){rimraf(_0x3dbb52,function(_0x36cfc8){if(_0x36cfc8)_0x24023f(_0x36cfc8);return _0x41b653();});});})[_0xb16e('0x2a')](function(){return _0x30674a[_0xb16e('0xc5')](_0x3fce87,_0x30d2b5,function(_0x59ff39){if(_0x59ff39){console['log'](_0xb16e('0xd4'),_0x59ff39);}else{fs[_0xb16e('0xd5')](_0x3fce87);}});});});}else{return _0x30674a[_0xb16e('0x2b')](0xc8);}})[_0xb16e('0xac')](handleError(_0x30674a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 0ea04f3..faa658f 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 _0xf319=['catch','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','setDataValue','Users','map','findAll','length','emit'];(function(_0x255ce5,_0x297772){var _0xeb9f60=function(_0x55815f){while(--_0x55815f){_0x255ce5['push'](_0x255ce5['shift']());}};_0xeb9f60(++_0x297772);}(_0xf319,0x162));var _0x9f31=function(_0x45aa1c,_0x3e8293){_0x45aa1c=_0x45aa1c-0x0;var _0x3f893a=_0xf319[_0x45aa1c];return _0x3f893a;};'use strict';var EventEmitter=require(_0x9f31('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x9f31('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9f31('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f31('0x3'),'afterDestroy':'remove'};function emitEvent(_0x191bae){return function(_0x3e3c9d,_0x20f540,_0x2fd5f2){_0x3e3c9d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x133fde){_0x3e3c9d[_0x9f31('0x4')](_0x9f31('0x5'),_0x133fde[_0x9f31('0x6')](function(_0x49d23a){return{'id':_0x49d23a['id']};}));return FaxMessage[_0x9f31('0x7')]({'where':{'FaxInteractionId':_0x3e3c9d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x189507){_0x3e3c9d[_0x9f31('0x4')]('unreadMessages',_0x189507[_0x9f31('0x8')]);FaxInteractionEvents[_0x9f31('0x9')](_0x191bae+':'+_0x3e3c9d['id'],_0x3e3c9d);FaxInteractionEvents[_0x9f31('0x9')](_0x191bae,_0x3e3c9d);_0x2fd5f2(null);})[_0x9f31('0xa')](_0x2fd5f2(null));};}for(var e in events){if(events[_0x9f31('0xb')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9f31('0xc')]=FaxInteractionEvents; \ No newline at end of file +var _0x2c93=['setDataValue','Users','map','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove'];(function(_0x39c775,_0x607a3e){var _0x5822a9=function(_0x1fa7f9){while(--_0x1fa7f9){_0x39c775['push'](_0x39c775['shift']());}};_0x5822a9(++_0x607a3e);}(_0x2c93,0x81));var _0x32c9=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x2c93[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0x32c9('0x0'));var FaxInteraction=require(_0x32c9('0x1'))['db'][_0x32c9('0x2')];var FaxMessage=require(_0x32c9('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32c9('0x3')](0x0);var events={'afterCreate':_0x32c9('0x4'),'afterUpdate':_0x32c9('0x5'),'afterDestroy':_0x32c9('0x6')};function emitEvent(_0x185a34){return function(_0x18f3c0,_0x58acc5,_0x1b00bb){_0x18f3c0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5c6b1c){_0x18f3c0[_0x32c9('0x7')](_0x32c9('0x8'),_0x5c6b1c[_0x32c9('0x9')](function(_0x4c4fee){return{'id':_0x4c4fee['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x18f3c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32c9('0xa')](function(_0x250ec3){_0x18f3c0[_0x32c9('0x7')](_0x32c9('0xb'),_0x250ec3[_0x32c9('0xc')]);FaxInteractionEvents['emit'](_0x185a34+':'+_0x18f3c0['id'],_0x18f3c0);FaxInteractionEvents[_0x32c9('0xd')](_0x185a34,_0x18f3c0);_0x1b00bb(null);})[_0x32c9('0xe')](_0x1b00bb(null));};}for(var e in events){if(events[_0x32c9('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32c9('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b90d59f..e0ca3f4 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 _0xee42=['path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','moment'];(function(_0x175cd2,_0x491fc5){var _0x72433d=function(_0x486a7d){while(--_0x486a7d){_0x175cd2['push'](_0x175cd2['shift']());}};_0x72433d(++_0x491fc5);}(_0xee42,0xe2));var _0x2ee4=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xee42[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x2ee4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2ee4('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ee4('0x2'));var rimraf=require('rimraf');var config=require(_0x2ee4('0x3'));var attributes=require(_0x2ee4('0x4'));module[_0x2ee4('0x5')]=function(_0x1cf3c5,_0x4976c8){return _0x1cf3c5[_0x2ee4('0x6')](_0x2ee4('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d5407,_0x4d7067,_0x289cf8){if(_0x1d5407[_0x2ee4('0x8')](_0x2ee4('0x9'))){_0x1d5407['closedAt']=moment()[_0x2ee4('0xa')](_0x2ee4('0xb'));}_0x289cf8(null,_0x1d5407);}}});}; \ No newline at end of file +var _0x4888=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','changed'];(function(_0x29d274,_0x1c4a68){var _0x31ff3d=function(_0x2fe72b){while(--_0x2fe72b){_0x29d274['push'](_0x29d274['shift']());}};_0x31ff3d(++_0x1c4a68);}(_0x4888,0x198));var _0x8488=function(_0x570b34,_0x537c5c){_0x570b34=_0x570b34-0x0;var _0x325f61=_0x4888[_0x570b34];return _0x325f61;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56aad0,_0x568a82,_0x151528){if(_0x56aad0[_0x8488('0xb')]('closed')){_0x56aad0[_0x8488('0xc')]=moment()[_0x8488('0xd')](_0x8488('0xe'));}_0x151528(null,_0x56aad0);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d5012bd..ae65a24 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 _0xfba1=['where','AddTagsToFaxInteraction','FaxInteraction','find','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw'];(function(_0x1188bc,_0x2f6576){var _0x5e7a16=function(_0x260455){while(--_0x260455){_0x1188bc['push'](_0x1188bc['shift']());}};_0x5e7a16(++_0x2f6576);}(_0xfba1,0x127));var _0x1fba=function(_0x262725,_0x44bcfb){_0x262725=_0x262725-0x0;var _0xf8ea3f=_0xfba1[_0x262725];return _0xf8ea3f;};'use strict';var _=require(_0x1fba('0x0'));var util=require(_0x1fba('0x1'));var moment=require(_0x1fba('0x2'));var BPromise=require(_0x1fba('0x3'));var rs=require(_0x1fba('0x4'));var fs=require('fs');var Redis=require(_0x1fba('0x5'));var db=require(_0x1fba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fba('0x7'))(_0x1fba('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1fba('0x9')][_0x1fba('0xa')]({'port':0x232a});config[_0x1fba('0xb')]=_['defaults'](config[_0x1fba('0xb')],{'host':_0x1fba('0xc'),'port':0x18eb});var socket=require(_0x1fba('0xd'))(new Redis(config[_0x1fba('0xb')]));require(_0x1fba('0xe'))[_0x1fba('0xf')](socket);function respondWithRpcPromise(_0x19863d,_0x4e8191,_0x2e0816){return new BPromise(function(_0x7f1b87,_0x50d086){return client[_0x1fba('0x10')](_0x19863d,_0x2e0816)[_0x1fba('0x11')](function(_0x2e57f8){logger[_0x1fba('0x12')](_0x1fba('0x13'),_0x4e8191,_0x1fba('0x14'));logger[_0x1fba('0x15')](_0x1fba('0x16'),_0x4e8191,_0x1fba('0x14'),JSON[_0x1fba('0x17')](_0x2e57f8));if(_0x2e57f8['error']){if(_0x2e57f8[_0x1fba('0x18')][_0x1fba('0x19')]===0x1f4){logger[_0x1fba('0x18')](_0x1fba('0x13'),_0x4e8191,_0x2e57f8[_0x1fba('0x18')][_0x1fba('0x1a')]);return _0x50d086(_0x2e57f8[_0x1fba('0x18')]['message']);}logger[_0x1fba('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x4e8191,_0x2e57f8[_0x1fba('0x18')]['message']);return _0x7f1b87(_0x2e57f8['error'][_0x1fba('0x1a')]);}else{logger[_0x1fba('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x4e8191,_0x1fba('0x14'));_0x7f1b87(_0x2e57f8[_0x1fba('0x1b')]['message']);}})[_0x1fba('0x1c')](function(_0x2566f4){logger[_0x1fba('0x18')](_0x1fba('0x13'),_0x4e8191,_0x2566f4);_0x50d086(_0x2566f4);});});}exports[_0x1fba('0x1d')]=function(_0x5e0100){var _0x18e9f4=this;return new Promise(function(_0x2837a6,_0x20057e){return db['FaxInteraction'][_0x1fba('0x1e')](_0x5e0100['body'],{'raw':_0x5e0100['options']?_0x5e0100[_0x1fba('0x1f')][_0x1fba('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e0100[_0x1fba('0x1f')]?_0x5e0100[_0x1fba('0x1f')][_0x1fba('0x21')]||null:null,'attributes':_0x5e0100[_0x1fba('0x1f')]?_0x5e0100[_0x1fba('0x1f')]['attributes']||null:null,'limit':_0x5e0100[_0x1fba('0x1f')]?_0x5e0100[_0x1fba('0x1f')]['limit']||null:null})['then'](function(_0xa48375){logger['info'](_0x1fba('0x1d'),_0x5e0100);logger[_0x1fba('0x15')](_0x1fba('0x1d'),_0x5e0100,JSON[_0x1fba('0x17')](_0xa48375));_0x2837a6(_0xa48375);})[_0x1fba('0x1c')](function(_0x276eb4){logger[_0x1fba('0x18')](_0x1fba('0x1d'),_0x276eb4[_0x1fba('0x1a')],_0x5e0100);_0x20057e(_0x18e9f4[_0x1fba('0x18')](0x1f4,_0x276eb4[_0x1fba('0x1a')]));});});};exports[_0x1fba('0x22')]=function(_0x5be8e9){return new Promise(function(_0x2bfa03,_0x387131){return db[_0x1fba('0x23')][_0x1fba('0x24')]({'where':_0x5be8e9[_0x1fba('0x1f')]?_0x5be8e9[_0x1fba('0x1f')][_0x1fba('0x21')]||null:null})['then'](function(_0x162f5c){if(_0x162f5c){return _0x162f5c['addTags'](_0x5be8e9[_0x1fba('0x25')]['ids'],_['omit'](_0x5be8e9[_0x1fba('0x25')],[_0x1fba('0x26'),'id'])||{});}})[_0x1fba('0x27')](function(_0x14a69f){logger[_0x1fba('0x12')](_0x1fba('0x28'),_0x5be8e9);logger[_0x1fba('0x15')]('AddTags',_0x5be8e9,JSON['stringify'](_0x14a69f));_0x2bfa03(_0x14a69f);})[_0x1fba('0x1c')](function(_0x2e48dd){logger[_0x1fba('0x18')](_0x1fba('0x28'),_0x2e48dd[_0x1fba('0x1a')],_0x5be8e9);_0x387131(_this[_0x1fba('0x18')](0x1f4,_0x2e48dd[_0x1fba('0x1a')]));});});}; \ No newline at end of file +var _0xdfe5=['UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','attributes','limit'];(function(_0x4219c3,_0x326488){var _0x3a8bf5=function(_0x179e89){while(--_0x179e89){_0x4219c3['push'](_0x4219c3['shift']());}};_0x3a8bf5(++_0x326488);}(_0xdfe5,0xbe));var _0x5dfe=function(_0x322042,_0x3a7aeb){_0x322042=_0x322042-0x0;var _0x557533=_0xdfe5[_0x322042];return _0x557533;};'use strict';var _=require(_0x5dfe('0x0'));var util=require(_0x5dfe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dfe('0x2'));var fs=require('fs');var Redis=require(_0x5dfe('0x3'));var db=require(_0x5dfe('0x4'))['db'];var utils=require(_0x5dfe('0x5'));var logger=require(_0x5dfe('0x6'))(_0x5dfe('0x7'));var config=require(_0x5dfe('0x8'));var jayson=require(_0x5dfe('0x9'));var client=jayson[_0x5dfe('0xa')]['http']({'port':0x232a});config[_0x5dfe('0xb')]=_[_0x5dfe('0xc')](config[_0x5dfe('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dfe('0xd'))(new Redis(config[_0x5dfe('0xb')]));require(_0x5dfe('0xe'))[_0x5dfe('0xf')](socket);function respondWithRpcPromise(_0x1a4357,_0x16604d,_0x270571){return new BPromise(function(_0x2d17e0,_0x3be582){return client[_0x5dfe('0x10')](_0x1a4357,_0x270571)[_0x5dfe('0x11')](function(_0x378d2c){logger[_0x5dfe('0x12')](_0x5dfe('0x13'),_0x16604d,_0x5dfe('0x14'));logger[_0x5dfe('0x15')](_0x5dfe('0x16'),_0x16604d,_0x5dfe('0x14'),JSON[_0x5dfe('0x17')](_0x378d2c));if(_0x378d2c[_0x5dfe('0x18')]){if(_0x378d2c[_0x5dfe('0x18')][_0x5dfe('0x19')]===0x1f4){logger[_0x5dfe('0x18')](_0x5dfe('0x13'),_0x16604d,_0x378d2c[_0x5dfe('0x18')][_0x5dfe('0x1a')]);return _0x3be582(_0x378d2c[_0x5dfe('0x18')][_0x5dfe('0x1a')]);}logger[_0x5dfe('0x18')](_0x5dfe('0x13'),_0x16604d,_0x378d2c[_0x5dfe('0x18')][_0x5dfe('0x1a')]);return _0x2d17e0(_0x378d2c['error'][_0x5dfe('0x1a')]);}else{logger[_0x5dfe('0x12')](_0x5dfe('0x13'),_0x16604d,_0x5dfe('0x14'));_0x2d17e0(_0x378d2c[_0x5dfe('0x1b')][_0x5dfe('0x1a')]);}})[_0x5dfe('0x1c')](function(_0xe2a5b3){logger[_0x5dfe('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x16604d,_0xe2a5b3);_0x3be582(_0xe2a5b3);});});}exports['UpdateFaxInteraction']=function(_0x20ddd8){var _0xb7e9cc=this;return new Promise(function(_0x18bfc5,_0x1680c7){return db['FaxInteraction'][_0x5dfe('0x1d')](_0x20ddd8[_0x5dfe('0x1e')],{'raw':_0x20ddd8[_0x5dfe('0x1f')]?_0x20ddd8[_0x5dfe('0x1f')][_0x5dfe('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ddd8[_0x5dfe('0x1f')]?_0x20ddd8[_0x5dfe('0x1f')]['where']||null:null,'attributes':_0x20ddd8[_0x5dfe('0x1f')]?_0x20ddd8['options'][_0x5dfe('0x21')]||null:null,'limit':_0x20ddd8['options']?_0x20ddd8['options'][_0x5dfe('0x22')]||null:null})[_0x5dfe('0x11')](function(_0x17aa75){logger[_0x5dfe('0x12')](_0x5dfe('0x23'),_0x20ddd8);logger[_0x5dfe('0x15')](_0x5dfe('0x23'),_0x20ddd8,JSON[_0x5dfe('0x17')](_0x17aa75));_0x18bfc5(_0x17aa75);})['catch'](function(_0x4ed4d5){logger[_0x5dfe('0x18')]('UpdateFaxInteraction',_0x4ed4d5[_0x5dfe('0x1a')],_0x20ddd8);_0x1680c7(_0xb7e9cc[_0x5dfe('0x18')](0x1f4,_0x4ed4d5[_0x5dfe('0x1a')]));});});};exports[_0x5dfe('0x24')]=function(_0x56c3dc){return new Promise(function(_0xda5af0,_0x2924a8){return db[_0x5dfe('0x25')][_0x5dfe('0x26')]({'where':_0x56c3dc[_0x5dfe('0x1f')]?_0x56c3dc[_0x5dfe('0x1f')][_0x5dfe('0x27')]||null:null})[_0x5dfe('0x11')](function(_0x520dcb){if(_0x520dcb){return _0x520dcb[_0x5dfe('0x28')](_0x56c3dc[_0x5dfe('0x1e')][_0x5dfe('0x29')],_[_0x5dfe('0x2a')](_0x56c3dc[_0x5dfe('0x1e')],[_0x5dfe('0x29'),'id'])||{});}})[_0x5dfe('0x2b')](function(_0x31c5fd){logger[_0x5dfe('0x12')](_0x5dfe('0x2c'),_0x56c3dc);logger[_0x5dfe('0x15')](_0x5dfe('0x2c'),_0x56c3dc,JSON[_0x5dfe('0x17')](_0x31c5fd));_0xda5af0(_0x31c5fd);})[_0x5dfe('0x1c')](function(_0x1d0bae){logger[_0x5dfe('0x18')](_0x5dfe('0x2c'),_0x1d0bae[_0x5dfe('0x1a')],_0x56c3dc);_0x2924a8(_this[_0x5dfe('0x18')](0x1f4,_0x1d0bae[_0x5dfe('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 095d2d2..ae09a91 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 _0x2100=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x1dac6e,_0x5f5aa6){var _0x2d2c2c=function(_0x186906){while(--_0x186906){_0x1dac6e['push'](_0x1dac6e['shift']());}};_0x2d2c2c(++_0x5f5aa6);}(_0x2100,0x17f));var _0x0210=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x2100[_0xbe40ad];return _0x50fac9;};'use strict';var FaxInteractionEvents=require(_0x0210('0x0'));var events=[_0x0210('0x1'),_0x0210('0x2'),_0x0210('0x3')];function createListener(_0x581d17,_0x1925ed){return function(_0x39546c){_0x1925ed[_0x0210('0x4')](_0x581d17,_0x39546c);};}function removeListener(_0x2dadca,_0x422bb6){return function(){FaxInteractionEvents[_0x0210('0x5')](_0x2dadca,_0x422bb6);};}exports[_0x0210('0x6')]=function(_0x2affc0){for(var _0x1d1df3=0x0,_0x52b219=events[_0x0210('0x7')];_0x1d1df3<_0x52b219;_0x1d1df3++){var _0x307913=events[_0x1d1df3];var _0x3808c9=createListener(_0x0210('0x8')+_0x307913,_0x2affc0);FaxInteractionEvents['on'](_0x307913,_0x3808c9);}}; \ No newline at end of file +var _0xfeab=['faxInteraction:','remove','update','removeListener','register'];(function(_0x18be5a,_0x9b6147){var _0x177c7c=function(_0x1553e5){while(--_0x1553e5){_0x18be5a['push'](_0x18be5a['shift']());}};_0x177c7c(++_0x9b6147);}(_0xfeab,0x14b));var _0xbfea=function(_0x2d5149,_0x17a299){_0x2d5149=_0x2d5149-0x0;var _0x48c0d7=_0xfeab[_0x2d5149];return _0x48c0d7;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0xbfea('0x0'),_0xbfea('0x1')];function createListener(_0x1dc4fe,_0x72f81a){return function(_0x100185){_0x72f81a['emit'](_0x1dc4fe,_0x100185);};}function removeListener(_0x516dcb,_0x56bc99){return function(){FaxInteractionEvents[_0xbfea('0x2')](_0x516dcb,_0x56bc99);};}exports[_0xbfea('0x3')]=function(_0x4b6be3){for(var _0x55ce99=0x0,_0x2d64c3=events['length'];_0x55ce99<_0x2d64c3;_0x55ce99++){var _0x4f84d4=events[_0x55ce99];var _0x4e1b2d=createListener(_0xbfea('0x4')+_0x4f84d4,_0x4b6be3);FaxInteractionEvents['on'](_0x4f84d4,_0x4e1b2d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 07937dc..2c56e11 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 _0xc5c9=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','fax','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x480ebe,_0x440c79){var _0xec7ffc=function(_0x59e995){while(--_0x59e995){_0x480ebe['push'](_0x480ebe['shift']());}};_0xec7ffc(++_0x440c79);}(_0xc5c9,0xb7));var _0x9c5c=function(_0x3683d7,_0x16711b){_0x3683d7=_0x3683d7-0x0;var _0x2e9205=_0xc5c9[_0x3683d7];return _0x2e9205;};'use strict';var multer=require(_0x9c5c('0x0'));var util=require(_0x9c5c('0x1'));var path=require(_0x9c5c('0x2'));var timeout=require(_0x9c5c('0x3'));var express=require('express');var router=express[_0x9c5c('0x4')]();var fs_extra=require(_0x9c5c('0x5'));var auth=require(_0x9c5c('0x6'));var interaction=require(_0x9c5c('0x7'));var config=require(_0x9c5c('0x8'));var controller=require(_0x9c5c('0x9'));router['get']('/',auth[_0x9c5c('0xa')](),controller[_0x9c5c('0xb')]);router[_0x9c5c('0xc')](_0x9c5c('0xd'),auth[_0x9c5c('0xa')](),controller[_0x9c5c('0xe')]);router[_0x9c5c('0xc')](_0x9c5c('0xf'),auth[_0x9c5c('0xa')](),controller[_0x9c5c('0x10')]);router[_0x9c5c('0xc')](_0x9c5c('0x11'),auth[_0x9c5c('0xa')](),controller[_0x9c5c('0x12')]);router[_0x9c5c('0xc')](_0x9c5c('0x13'),auth['isAuthenticated'](),controller[_0x9c5c('0x14')]);router[_0x9c5c('0x15')]('/',auth[_0x9c5c('0xa')](),controller[_0x9c5c('0x16')]);router[_0x9c5c('0x15')](_0x9c5c('0x11'),auth[_0x9c5c('0xa')](),controller[_0x9c5c('0x17')]);router[_0x9c5c('0x15')](_0x9c5c('0x18'),auth[_0x9c5c('0xa')](),interaction[_0x9c5c('0x19')]('fax','faxinteraction:addtags'),controller[_0x9c5c('0x1a')]);router['put']('/:id',auth[_0x9c5c('0xa')](),interaction['tracked'](_0x9c5c('0x1b'),'faxinteraction:update'),controller[_0x9c5c('0x1c')]);router['delete'](_0x9c5c('0xf'),auth['isAuthenticated'](),interaction[_0x9c5c('0x19')](_0x9c5c('0x1b'),'faxinteraction:destroy'),controller[_0x9c5c('0x1d')]);router[_0x9c5c('0x1e')](_0x9c5c('0x18'),auth[_0x9c5c('0xa')](),controller[_0x9c5c('0x1f')]);module[_0x9c5c('0x20')]=router; \ No newline at end of file +var _0xeb00=['../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download','create','post','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','express','Router','fs-extra'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0xeb00,0x1bb));var _0x0eb0=function(_0x5dea1d,_0x4a5859){_0x5dea1d=_0x5dea1d-0x0;var _0x487da0=_0xeb00[_0x5dea1d];return _0x487da0;};'use strict';var multer=require(_0x0eb0('0x0'));var util=require(_0x0eb0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0eb0('0x2'));var router=express[_0x0eb0('0x3')]();var fs_extra=require(_0x0eb0('0x4'));var auth=require(_0x0eb0('0x5'));var interaction=require(_0x0eb0('0x6'));var config=require('../../config/environment');var controller=require(_0x0eb0('0x7'));router[_0x0eb0('0x8')]('/',auth[_0x0eb0('0x9')](),controller[_0x0eb0('0xa')]);router[_0x0eb0('0x8')](_0x0eb0('0xb'),auth[_0x0eb0('0x9')](),controller[_0x0eb0('0xc')]);router['get'](_0x0eb0('0xd'),auth[_0x0eb0('0x9')](),controller['show']);router[_0x0eb0('0x8')](_0x0eb0('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0eb0('0x8')]('/:id/download',auth[_0x0eb0('0x9')](),controller[_0x0eb0('0xf')]);router['post']('/',auth[_0x0eb0('0x9')](),controller[_0x0eb0('0x10')]);router['post'](_0x0eb0('0xe'),auth[_0x0eb0('0x9')](),controller['addMessage']);router[_0x0eb0('0x11')](_0x0eb0('0x12'),auth[_0x0eb0('0x9')](),interaction[_0x0eb0('0x13')]('fax',_0x0eb0('0x14')),controller[_0x0eb0('0x15')]);router['put'](_0x0eb0('0xd'),auth[_0x0eb0('0x9')](),interaction[_0x0eb0('0x13')](_0x0eb0('0x16'),_0x0eb0('0x17')),controller['update']);router[_0x0eb0('0x18')](_0x0eb0('0xd'),auth[_0x0eb0('0x9')](),interaction[_0x0eb0('0x13')](_0x0eb0('0x16'),_0x0eb0('0x19')),controller[_0x0eb0('0x1a')]);router[_0x0eb0('0x18')](_0x0eb0('0x12'),auth[_0x0eb0('0x9')](),controller[_0x0eb0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 1826390..aee1b2a 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 _0x19da=['out','TEXT','DATE','exports','medium','ENUM'];(function(_0x5c9ac7,_0x10e782){var _0x4fd2e=function(_0x44696b){while(--_0x44696b){_0x5c9ac7['push'](_0x5c9ac7['shift']());}};_0x4fd2e(++_0x10e782);}(_0x19da,0x9f));var _0xa19d=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x19da[_0x40b493];return _0x548365;};'use strict';var Sequelize=require('sequelize');module[_0xa19d('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa19d('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa19d('0x2')]('in',_0xa19d('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xa19d('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa19d('0x5')]}}; \ No newline at end of file +var _0xb6b1=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0xb6b1[_0x101a17];return _0x3b76ee;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'body':{'type':Sequelize[_0x1b6b('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1b6b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1b6b('0x3')]('in','out'),'defaultValue':_0x1b6b('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x1b6b('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index db8a421..ac7e8c6 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 _0x73e6=['socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','body','describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','manual','SIP/%s','user','channel','EventManager','acceptmessage','fax','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','email','interface','motionChannel','event','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','Attachment','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x73e6,0x76));var _0x673e=function(_0x32bd85,_0x4a8919){_0x32bd85=_0x32bd85-0x0;var _0x45fff9=_0x73e6[_0x32bd85];return _0x45fff9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x673e('0x0'));var zipdir=require(_0x673e('0x1'));var jsonpatch=require(_0x673e('0x2'));var rp=require(_0x673e('0x3'));var moment=require('moment');var BPromise=require(_0x673e('0x4'));var Mustache=require(_0x673e('0x5'));var util=require(_0x673e('0x6'));var path=require(_0x673e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x673e('0x8'));var fs=require('fs');var fs_extra=require(_0x673e('0x9'));var _=require(_0x673e('0xa'));var squel=require(_0x673e('0xb'));var crypto=require('crypto');var jsforce=require(_0x673e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x673e('0xd'));var querystring=require(_0x673e('0xe'));var Papa=require(_0x673e('0xf'));var Redis=require(_0x673e('0x10'));var authService=require(_0x673e('0x11'));var qs=require(_0x673e('0x12'));var as=require(_0x673e('0x13'));var hardwareService=require(_0x673e('0x14'));var logger=require(_0x673e('0x15'))(_0x673e('0x16'));var utils=require('../../config/utils');var config=require(_0x673e('0x17'));var licenseUtil=require(_0x673e('0x18'));var db=require(_0x673e('0x19'))['db'];config[_0x673e('0x1a')]=_['defaults'](config[_0x673e('0x1a')],{'host':_0x673e('0x1b'),'port':0x18eb});var socket=require(_0x673e('0x1c'))(new Redis(config[_0x673e('0x1a')]));require(_0x673e('0x1d'))[_0x673e('0x1e')](socket);var jayson=require(_0x673e('0x1f'));var client=jayson[_0x673e('0x20')][_0x673e('0x21')]({'port':0x232c});var client9002=jayson[_0x673e('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab3dc,_0x408aa7,_0x5ce337,_0x3e41ed){return new BPromise(function(_0x29ab41,_0x26e729){var _0x486c3d=_0x3e41ed||client;return _0x486c3d[_0x673e('0x22')](_0x3ab3dc,_0x5ce337)[_0x673e('0x23')](function(_0x58ff9e){logger['info'](_0x673e('0x24'),_0x408aa7,'request\x20sent');logger[_0x673e('0x25')](_0x673e('0x26'),_0x408aa7,_0x673e('0x27'),JSON[_0x673e('0x28')](_0x58ff9e));if(_0x58ff9e[_0x673e('0x29')]){if(_0x58ff9e[_0x673e('0x29')]['code']===0x1f4){logger[_0x673e('0x29')](_0x673e('0x24'),_0x408aa7,_0x58ff9e['error'][_0x673e('0x2a')]);return _0x26e729(_0x58ff9e[_0x673e('0x29')]['message']);}logger[_0x673e('0x29')](_0x673e('0x24'),_0x408aa7,_0x58ff9e[_0x673e('0x29')][_0x673e('0x2a')]);return _0x29ab41(_0x58ff9e[_0x673e('0x29')]['message']);}else{logger[_0x673e('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x408aa7,_0x673e('0x27'));_0x29ab41(_0x58ff9e['result'][_0x673e('0x2a')]);}})[_0x673e('0x2c')](function(_0x43e556){logger['error'](_0x673e('0x24'),_0x408aa7,_0x43e556);_0x26e729(_0x43e556);});});}function respondWithStatusCode(_0x4a002e,_0x444b61){_0x444b61=_0x444b61||0xcc;return function(_0x48d6f4){if(_0x48d6f4){return _0x4a002e[_0x673e('0x2d')](_0x444b61);}return _0x4a002e[_0x673e('0x2e')](_0x444b61)[_0x673e('0x2f')]();};}function respondWithResult(_0x48edaf,_0x18a2a7){_0x18a2a7=_0x18a2a7||0xc8;return function(_0x53495e){if(_0x53495e){return _0x48edaf[_0x673e('0x2e')](_0x18a2a7)[_0x673e('0x30')](_0x53495e);}};}function respondWithFilteredResult(_0x1af035,_0x4b3c43){return function(_0x197659){if(_0x197659){var _0xb9dbd8=typeof _0x4b3c43[_0x673e('0x31')]===_0x673e('0x32')&&typeof _0x4b3c43[_0x673e('0x33')]===_0x673e('0x32');var _0x1eb168=_0x197659[_0x673e('0x34')];var _0x4de209=_0xb9dbd8?0x0:_0x4b3c43[_0x673e('0x31')];var _0x4e5c3d=_0xb9dbd8?_0x197659['count']:_0x4b3c43[_0x673e('0x31')]+_0x4b3c43[_0x673e('0x33')];var _0x1436c1;if(_0x4e5c3d>=_0x1eb168){_0x4e5c3d=_0x1eb168;_0x1436c1=0xc8;}else{_0x1436c1=0xce;}_0x1af035[_0x673e('0x2e')](_0x1436c1);return _0x1af035[_0x673e('0x35')](_0x673e('0x36'),_0x4de209+'-'+_0x4e5c3d+'/'+_0x1eb168)['json'](_0x197659);}return null;};}function patchUpdates(_0x304c60){return function(_0x1bff94){try{jsonpatch['apply'](_0x1bff94,_0x304c60,!![]);}catch(_0x1149c6){return BPromise[_0x673e('0x37')](_0x1149c6);}return _0x1bff94['save']();};}function saveUpdates(_0x8c9217,_0x3d6883){return function(_0x30bd8d){if(_0x30bd8d){return _0x30bd8d[_0x673e('0x38')](_0x8c9217)[_0x673e('0x23')](function(_0x5de74f){return _0x5de74f;});}return null;};}function removeEntity(_0x56c7c9,_0x42ab27){return function(_0x1f9757){if(_0x1f9757){return _0x1f9757[_0x673e('0x39')]()[_0x673e('0x23')](function(){_0x56c7c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db487,_0x32e57a){return function(_0x31dece){if(!_0x31dece){_0x1db487[_0x673e('0x2d')](0x194);}return _0x31dece;};}function handleError(_0x16df1e,_0x404128){_0x404128=_0x404128||0x1f4;return function(_0x1d0121){logger['error'](_0x1d0121[_0x673e('0x3a')]);if(_0x1d0121[_0x673e('0x3b')]){delete _0x1d0121[_0x673e('0x3b')];}_0x16df1e[_0x673e('0x2e')](_0x404128)[_0x673e('0x3c')](_0x1d0121);};}exports[_0x673e('0x3d')]=function(_0x5de725,_0x3b7fc0){var _0xc0a289={},_0x3f8eda={},_0x29622f={'count':0x0,'rows':[]};var _0x4e8fb4=_['map'](db[_0x673e('0x3e')][_0x673e('0x3f')],function(_0x384aa0){return{'name':_0x384aa0[_0x673e('0x40')],'type':_0x384aa0[_0x673e('0x41')]['key']};});_0x3f8eda['model']=_['map'](_0x4e8fb4,_0x673e('0x3b'));_0x3f8eda[_0x673e('0x42')]=_[_0x673e('0x43')](_0x5de725[_0x673e('0x42')]);_0x3f8eda[_0x673e('0x44')]=_['intersection'](_0x3f8eda[_0x673e('0x45')],_0x3f8eda['query']);_0xc0a289[_0x673e('0x46')]=_['intersection'](_0x3f8eda[_0x673e('0x45')],qs['fields'](_0x5de725['query'][_0x673e('0x47')]));_0xc0a289['attributes']=_0xc0a289[_0x673e('0x46')][_0x673e('0x48')]?_0xc0a289[_0x673e('0x46')]:_0x3f8eda[_0x673e('0x45')];if(!_0x5de725[_0x673e('0x42')][_0x673e('0x49')](_0x673e('0x4a'))){_0xc0a289[_0x673e('0x33')]=qs[_0x673e('0x33')](_0x5de725['query'][_0x673e('0x33')]);_0xc0a289[_0x673e('0x31')]=qs[_0x673e('0x31')](_0x5de725[_0x673e('0x42')]['offset']);}_0xc0a289[_0x673e('0x4b')]=qs['sort'](_0x5de725['query'][_0x673e('0x4c')]);_0xc0a289['where']=qs['filters'](_[_0x673e('0x4d')](_0x5de725[_0x673e('0x42')],_0x3f8eda[_0x673e('0x44')]),_0x4e8fb4);if(_0x5de725[_0x673e('0x42')][_0x673e('0x4e')]){_0xc0a289[_0x673e('0x4f')]=_[_0x673e('0x50')](_0xc0a289['where'],{'$or':_['map'](_0x4e8fb4,function(_0x423da4){if(_0x423da4[_0x673e('0x41')]!==_0x673e('0x51')){var _0x5e0c24={};_0x5e0c24[_0x423da4[_0x673e('0x3b')]]={'$like':'%'+_0x5de725['query'][_0x673e('0x4e')]+'%'};return _0x5e0c24;}})});}_0xc0a289=_['merge']({},_0xc0a289,_0x5de725[_0x673e('0x52')]);var _0x55e7d1={'where':_0xc0a289[_0x673e('0x4f')]};return db[_0x673e('0x3e')]['count'](_0x55e7d1)['then'](function(_0x2c6133){_0x29622f[_0x673e('0x34')]=_0x2c6133;if(_0x5de725[_0x673e('0x42')][_0x673e('0x53')]){_0xc0a289[_0x673e('0x54')]=[{'all':!![]}];}return db[_0x673e('0x3e')][_0x673e('0x55')](_0xc0a289);})['then'](function(_0xc2c2bd){_0x29622f[_0x673e('0x56')]=_0xc2c2bd;return _0x29622f;})['then'](respondWithFilteredResult(_0x3b7fc0,_0xc0a289))['catch'](handleError(_0x3b7fc0,null));};exports[_0x673e('0x57')]=function(_0xdb1df6,_0x518ec5){var _0xe8a0f0={'raw':!![],'where':{'id':_0xdb1df6[_0x673e('0x58')]['id']}},_0xc46e15={};_0xc46e15[_0x673e('0x45')]=_[_0x673e('0x43')](db['FaxMessage']['rawAttributes']);_0xc46e15['query']=_[_0x673e('0x43')](_0xdb1df6[_0x673e('0x42')]);_0xc46e15[_0x673e('0x44')]=_[_0x673e('0x59')](_0xc46e15['model'],_0xc46e15[_0x673e('0x42')]);_0xe8a0f0[_0x673e('0x46')]=_[_0x673e('0x59')](_0xc46e15[_0x673e('0x45')],qs[_0x673e('0x47')](_0xdb1df6[_0x673e('0x42')][_0x673e('0x47')]));_0xe8a0f0['attributes']=_0xe8a0f0['attributes']['length']?_0xe8a0f0[_0x673e('0x46')]:_0xc46e15[_0x673e('0x45')];if(_0xdb1df6[_0x673e('0x42')][_0x673e('0x53')]){_0xe8a0f0['include']=[{'all':!![]}];}_0xe8a0f0=_[_0x673e('0x50')]({},_0xe8a0f0,_0xdb1df6['options']);return db[_0x673e('0x3e')][_0x673e('0x5a')](_0xe8a0f0)[_0x673e('0x23')](handleEntityNotFound(_0x518ec5,null))[_0x673e('0x23')](respondWithResult(_0x518ec5,null))[_0x673e('0x2c')](handleError(_0x518ec5,null));};exports[_0x673e('0x38')]=function(_0x2f5a40,_0x40e174){if(_0x2f5a40[_0x673e('0x5b')]['id']){delete _0x2f5a40['body']['id'];}return db[_0x673e('0x3e')][_0x673e('0x5a')]({'where':{'id':_0x2f5a40['params']['id']}})['then'](handleEntityNotFound(_0x40e174,null))[_0x673e('0x23')](saveUpdates(_0x2f5a40[_0x673e('0x5b')],null))[_0x673e('0x23')](respondWithResult(_0x40e174,null))['catch'](handleError(_0x40e174,null));};exports[_0x673e('0x39')]=function(_0x38cab4,_0x3116d1){return db[_0x673e('0x3e')][_0x673e('0x5a')]({'where':{'id':_0x38cab4['params']['id']}})['then'](handleEntityNotFound(_0x3116d1,null))[_0x673e('0x23')](removeEntity(_0x3116d1,null))[_0x673e('0x2c')](handleError(_0x3116d1,null));};exports[_0x673e('0x5c')]=function(_0x246702,_0x7bdd44){return db[_0x673e('0x3e')][_0x673e('0x5c')]()['then'](respondWithResult(_0x7bdd44,null))['catch'](handleError(_0x7bdd44,null));};var interaction_log=require('../../config/logger')(_0x673e('0x5d'));exports[_0x673e('0x5e')]=function(_0x5acf5f,_0x3d77a8,_0x2656c2){var _0x5169e0={'agent':{},'channel':'fax'};if(_0x5acf5f[_0x673e('0x5b')]['id']){delete _0x5acf5f[_0x673e('0x5b')]['id'];}_0x5acf5f[_0x673e('0x5b')][_0x673e('0x5f')]=!![];_0x5acf5f['body'][_0x673e('0x60')]=moment()[_0x673e('0x61')](_0x673e('0x62'));_0x5acf5f['body'][_0x673e('0x63')]=_0x5acf5f[_0x673e('0x5b')][_0x673e('0x63')]||_0x5acf5f['user']['id'];_0x5169e0[_0x673e('0x64')]['id']=_0x5acf5f[_0x673e('0x5b')][_0x673e('0x63')];return db[_0x673e('0x3e')]['find']({'where':{'id':_0x5acf5f[_0x673e('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d77a8,null))['then'](saveUpdates(_0x5acf5f[_0x673e('0x5b')],null))['then'](function(_0x493e7b){if(_0x493e7b){_0x5169e0[_0x673e('0x2a')]=_0x493e7b['get']({'plain':!![]});return db['FaxInteraction'][_0x673e('0x5a')]({'where':{'id':_0x493e7b['FaxInteractionId']}});}return null;})[_0x673e('0x23')](handleEntityNotFound(_0x3d77a8,null))['then'](function(_0x21e9a9){if(_0x21e9a9){return _0x21e9a9[_0x673e('0x38')]({'UserId':_0x5acf5f[_0x673e('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x21e9a9[_0x673e('0x65')])?moment()[_0x673e('0x61')](_0x673e('0x62')):undefined});}return null;})[_0x673e('0x23')](function(_0x53b217){if(_0x53b217){_0x5169e0[_0x673e('0x66')]=_0x53b217[_0x673e('0x67')]({'plain':!![]});interaction_log[_0x673e('0x2b')](_0x673e('0x68'),_0x5acf5f['user']['id'],_0x5acf5f['user']['name'],_0x5acf5f['user'][_0x673e('0x69')],_0x5169e0[_0x673e('0x66')]['id'],_0x5acf5f[_0x673e('0x5b')]?JSON[_0x673e('0x28')](_0x5acf5f[_0x673e('0x5b')]):_0x673e('0x6a'));return respondWithRpcPromise(_0x673e('0x6b'),'acceptMessage',_0x5169e0);}return null;})[_0x673e('0x23')](function(_0x49b763){var _0x570b76=_0x673e('0x6c')+_0x49b763[_0x673e('0x2a')][_0x673e('0x6d')];return db[_0x673e('0x6e')][_0x673e('0x42')](_0x570b76,{'type':db['Sequelize']['QueryTypes'][_0x673e('0x6f')],'raw':!![]})[_0x673e('0x23')](function(_0x3be81d){return _0x3be81d;});})[_0x673e('0x23')](function(_0x2c6901){if(_0x2c6901){_0x5169e0['message'][_0x673e('0x70')]=_0x2c6901[0x0];if(!_0x5acf5f['body'][_0x673e('0x63')])return;return db[_0x673e('0x71')][_0x673e('0x5a')]({'where':{'id':_0x5acf5f['body']['UserId'],'role':_0x673e('0x64')},'attributes':['id',_0x673e('0x3b'),_0x673e('0x72'),'email',_0x673e('0x73')],'raw':!![]});}return null;})['then'](function(_0x4ca8af){if(!_0x4ca8af)return null;_0x5169e0[_0x673e('0x2a')]['agent']=_0x4ca8af;return _0x5169e0;})[_0x673e('0x23')](function(_0x48728c){if(_0x48728c){if(_0x5acf5f['body'][_0x673e('0x74')]){_0x5169e0[_0x673e('0x2a')]['interface']=util[_0x673e('0x61')](_0x673e('0x75'),_0x5acf5f[_0x673e('0x76')]['name']);_0x5169e0[_0x673e('0x2a')][_0x673e('0x77')]=_0x5169e0[_0x673e('0x77')];_0x5169e0[_0x673e('0x2a')]['motionChannel']=_0x5169e0[_0x673e('0x77')];_0x5169e0[_0x673e('0x2a')]['event']=_0x673e('0x5e');return respondWithRpcPromise(_0x673e('0x78'),_0x673e('0x78'),{'event':_0x673e('0x79'),'message':_0x5169e0[_0x673e('0x2a')]},client9002)['then'](function(){return _0x5169e0;});}return _0x5169e0;}return null;})['then'](respondWithResult(_0x3d77a8,null))[_0x673e('0x2c')](handleError(_0x3d77a8,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x673e('0x37')]=function(_0x1f9f9d,_0x5ed8d7,_0x2ea118){var _0x55942a={'agent':{},'channel':_0x673e('0x7a')};if(_0x1f9f9d['body']['id']){delete _0x1f9f9d[_0x673e('0x5b')]['id'];}_0x1f9f9d['body']['UserId']=_0x1f9f9d[_0x673e('0x5b')]['UserId']||_0x1f9f9d[_0x673e('0x76')]['id'];_0x55942a['agent']['id']=_0x1f9f9d[_0x673e('0x5b')]['UserId'];return db[_0x673e('0x3e')][_0x673e('0x5a')]({'where':{'id':_0x1f9f9d['params']['id'],'UserId':null}})[_0x673e('0x23')](handleEntityNotFound(_0x5ed8d7,null))[_0x673e('0x23')](function(_0x2a34fc){if(_0x2a34fc){_0x55942a[_0x673e('0x2a')]=_0x2a34fc[_0x673e('0x67')]({'plain':!![]});return db[_0x673e('0x7b')][_0x673e('0x5a')]({'where':{'id':_0x2a34fc[_0x673e('0x7c')]}});}return null;})[_0x673e('0x23')](handleEntityNotFound(_0x5ed8d7,null))[_0x673e('0x23')](function(_0x257c85){if(_0x257c85){_0x55942a[_0x673e('0x66')]=_0x257c85[_0x673e('0x67')]({'plain':!![]});interaction_log[_0x673e('0x2b')](_0x673e('0x7d'),_0x1f9f9d['user']['id'],_0x1f9f9d[_0x673e('0x76')][_0x673e('0x3b')],_0x1f9f9d[_0x673e('0x76')][_0x673e('0x69')],_0x55942a['interaction']['id'],_0x1f9f9d[_0x673e('0x5b')]?JSON['stringify'](_0x1f9f9d['body']):_0x673e('0x6a'));return respondWithRpcPromise(_0x673e('0x7e'),_0x673e('0x7f'),_0x55942a);}return null;})[_0x673e('0x23')](function(_0x393a66){var _0x16629e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x393a66['message'][_0x673e('0x6d')];return db[_0x673e('0x6e')]['query'](_0x16629e,{'type':db['Sequelize'][_0x673e('0x80')][_0x673e('0x6f')],'raw':!![]})[_0x673e('0x23')](function(_0x440f07){return _0x440f07;});})['then'](function(_0x47e807){if(_0x47e807){_0x55942a['message'][_0x673e('0x70')]=_0x47e807[0x0];if(!_0x1f9f9d[_0x673e('0x5b')][_0x673e('0x63')])return;return db['User']['find']({'where':{'id':_0x1f9f9d['body']['UserId'],'role':_0x673e('0x64')},'attributes':['id',_0x673e('0x3b'),_0x673e('0x72'),_0x673e('0x81'),_0x673e('0x73')],'raw':!![]});}return null;})['then'](function(_0x3a3327){if(!_0x3a3327)return null;_0x55942a['message'][_0x673e('0x64')]=_0x3a3327;return _0x55942a;})[_0x673e('0x23')](function(_0xb2a3b6){if(_0xb2a3b6){_0xb2a3b6[_0x673e('0x2a')][_0x673e('0x82')]=util[_0x673e('0x61')](_0x673e('0x75'),_0x1f9f9d[_0x673e('0x76')][_0x673e('0x3b')]);_0xb2a3b6[_0x673e('0x2a')][_0x673e('0x77')]=_0x55942a[_0x673e('0x77')];_0xb2a3b6[_0x673e('0x2a')][_0x673e('0x83')]=_0x55942a[_0x673e('0x77')];_0xb2a3b6[_0x673e('0x2a')][_0x673e('0x84')]=_0x673e('0x37');respondWithRpcPromise('EventManager',_0x673e('0x78'),{'event':_0x673e('0x85'),'message':_0xb2a3b6[_0x673e('0x2a')]},client9002);return _0x55942a;}return null;})['then'](respondWithResult(_0x5ed8d7,null))[_0x673e('0x2c')](handleError(_0x5ed8d7,null));};exports[_0x673e('0x86')]=function(_0x42d613,_0xb920f8){var _0x4dc441;return db[_0x673e('0x3e')][_0x673e('0x86')](_0x42d613['body'],{})['then'](function(_0x2e5895){_0x4dc441=_0x2e5895;return db[_0x673e('0x87')][_0x673e('0x88')]({'where':{'id':_0x4dc441['ContactId']}});})[_0x673e('0x23')](function(_0x357eff){if(_[_0x673e('0x89')](_0x357eff)){return;}else{_0x4dc441[_0x673e('0x7a')]=_0x357eff['fax'];return db['Attachment'][_0x673e('0x88')]({'where':{'id':_0x4dc441[_0x673e('0x8a')]}});}})[_0x673e('0x23')](function(_0xa1530e){return respondWithRpcPromise(_0x673e('0x8b'),_0x673e('0x8b'),{'FaxAccountId':_[_0x673e('0x89')](_0x42d613['body'])?undefined:_0x42d613[_0x673e('0x5b')]['FaxAccountId'],'path':_[_0x673e('0x89')](_0xa1530e)?undefined:util['format'](_0x673e('0x8c'),_0xa1530e['basename']),'fax':_['isNil'](_0x4dc441['fax'])?undefined:_0x4dc441[_0x673e('0x7a')],'AttachmentId':_0x4dc441[_0x673e('0x8a')]},client9002);})[_0x673e('0x23')](respondWithResult(_0xb920f8,0xc9))[_0x673e('0x2c')](handleError(_0xb920f8,null));};exports['download']=function(_0x20aeb3,_0x5deb92){var _0x53818e=path[_0x673e('0x8d')](config[_0x673e('0x8e')],_0x673e('0x8f'),_0x673e('0x90'),'attachments');return db[_0x673e('0x3e')][_0x673e('0x5a')]({'where':{'id':_0x20aeb3[_0x673e('0x58')]['id']},'include':[{'model':db[_0x673e('0x91')],'as':_0x673e('0x91')}]})[_0x673e('0x23')](handleEntityNotFound(_0x5deb92,null))[_0x673e('0x23')](function(_0x3e2eb3){if(_0x3e2eb3){return _0x5deb92['download'](path[_0x673e('0x8d')](_0x53818e,_0x3e2eb3['Attachment']['basename']));}})[_0x673e('0x2c')](handleError(_0x5deb92,null));}; \ No newline at end of file +var _0x0c3a=['merge','type','options','includeAll','include','findAll','rows','catch','show','params','fields','find','update','body','destroy','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','motionChannel','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','FaxAccountId','basename','join','root','files','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x0c3a,0xdc));var _0xa0c3=function(_0x1945a3,_0x578abd){_0x1945a3=_0x1945a3-0x0;var _0x218f60=_0x0c3a[_0x1945a3];return _0x218f60;};'use strict';var emlformat=require(_0xa0c3('0x0'));var rimraf=require(_0xa0c3('0x1'));var zipdir=require(_0xa0c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa0c3('0x3'));var moment=require('moment');var BPromise=require(_0xa0c3('0x4'));var Mustache=require(_0xa0c3('0x5'));var util=require('util');var path=require(_0xa0c3('0x6'));var sox=require('sox');var csv=require(_0xa0c3('0x7'));var ejs=require(_0xa0c3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa0c3('0x9'));var crypto=require('crypto');var jsforce=require(_0xa0c3('0xa'));var deskjs=require(_0xa0c3('0xb'));var toCsv=require(_0xa0c3('0x7'));var querystring=require(_0xa0c3('0xc'));var Papa=require(_0xa0c3('0xd'));var Redis=require(_0xa0c3('0xe'));var authService=require(_0xa0c3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa0c3('0x10'));var hardwareService=require(_0xa0c3('0x11'));var logger=require(_0xa0c3('0x12'))(_0xa0c3('0x13'));var utils=require(_0xa0c3('0x14'));var config=require(_0xa0c3('0x15'));var licenseUtil=require(_0xa0c3('0x16'));var db=require(_0xa0c3('0x17'))['db'];config[_0xa0c3('0x18')]=_[_0xa0c3('0x19')](config[_0xa0c3('0x18')],{'host':_0xa0c3('0x1a'),'port':0x18eb});var socket=require(_0xa0c3('0x1b'))(new Redis(config[_0xa0c3('0x18')]));require(_0xa0c3('0x1c'))[_0xa0c3('0x1d')](socket);var jayson=require(_0xa0c3('0x1e'));var client=jayson[_0xa0c3('0x1f')][_0xa0c3('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xa0c3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4f9a7b,_0x1b191c,_0x39d31b,_0x51e8b2){return new BPromise(function(_0x1dae30,_0xc57355){var _0x10b1ed=_0x51e8b2||client;return _0x10b1ed['request'](_0x4f9a7b,_0x39d31b)[_0xa0c3('0x21')](function(_0x216fe1){logger[_0xa0c3('0x22')](_0xa0c3('0x23'),_0x1b191c,'request\x20sent');logger[_0xa0c3('0x24')](_0xa0c3('0x25'),_0x1b191c,_0xa0c3('0x26'),JSON['stringify'](_0x216fe1));if(_0x216fe1[_0xa0c3('0x27')]){if(_0x216fe1[_0xa0c3('0x27')][_0xa0c3('0x28')]===0x1f4){logger[_0xa0c3('0x27')]('FaxMessage,\x20%s,\x20%s',_0x1b191c,_0x216fe1[_0xa0c3('0x27')][_0xa0c3('0x29')]);return _0xc57355(_0x216fe1['error'][_0xa0c3('0x29')]);}logger[_0xa0c3('0x27')](_0xa0c3('0x23'),_0x1b191c,_0x216fe1[_0xa0c3('0x27')][_0xa0c3('0x29')]);return _0x1dae30(_0x216fe1[_0xa0c3('0x27')][_0xa0c3('0x29')]);}else{logger['info'](_0xa0c3('0x23'),_0x1b191c,_0xa0c3('0x26'));_0x1dae30(_0x216fe1['result'][_0xa0c3('0x29')]);}})['catch'](function(_0x55f030){logger[_0xa0c3('0x27')]('FaxMessage,\x20%s,\x20%s',_0x1b191c,_0x55f030);_0xc57355(_0x55f030);});});}function respondWithStatusCode(_0x1f7e5a,_0x1bfc3f){_0x1bfc3f=_0x1bfc3f||0xcc;return function(_0x2159aa){if(_0x2159aa){return _0x1f7e5a[_0xa0c3('0x2a')](_0x1bfc3f);}return _0x1f7e5a[_0xa0c3('0x2b')](_0x1bfc3f)[_0xa0c3('0x2c')]();};}function respondWithResult(_0x37909e,_0xcef129){_0xcef129=_0xcef129||0xc8;return function(_0x43dad1){if(_0x43dad1){return _0x37909e[_0xa0c3('0x2b')](_0xcef129)[_0xa0c3('0x2d')](_0x43dad1);}};}function respondWithFilteredResult(_0x3de02b,_0x20f1a9){return function(_0xe2d3e7){if(_0xe2d3e7){var _0x24f61a=typeof _0x20f1a9[_0xa0c3('0x2e')]===_0xa0c3('0x2f')&&typeof _0x20f1a9['limit']==='undefined';var _0x3d4afd=_0xe2d3e7[_0xa0c3('0x30')];var _0x2d24ce=_0x24f61a?0x0:_0x20f1a9['offset'];var _0x303d31=_0x24f61a?_0xe2d3e7[_0xa0c3('0x30')]:_0x20f1a9[_0xa0c3('0x2e')]+_0x20f1a9[_0xa0c3('0x31')];var _0x42b0e3;if(_0x303d31>=_0x3d4afd){_0x303d31=_0x3d4afd;_0x42b0e3=0xc8;}else{_0x42b0e3=0xce;}_0x3de02b[_0xa0c3('0x2b')](_0x42b0e3);return _0x3de02b[_0xa0c3('0x32')]('Content-Range',_0x2d24ce+'-'+_0x303d31+'/'+_0x3d4afd)['json'](_0xe2d3e7);}return null;};}function patchUpdates(_0x2bafcf){return function(_0x281782){try{jsonpatch[_0xa0c3('0x33')](_0x281782,_0x2bafcf,!![]);}catch(_0x56312e){return BPromise[_0xa0c3('0x34')](_0x56312e);}return _0x281782[_0xa0c3('0x35')]();};}function saveUpdates(_0x36e5a0,_0x461b7c){return function(_0x3bd3c1){if(_0x3bd3c1){return _0x3bd3c1['update'](_0x36e5a0)[_0xa0c3('0x21')](function(_0x2484a0){return _0x2484a0;});}return null;};}function removeEntity(_0x115155,_0x466d1b){return function(_0x337201){if(_0x337201){return _0x337201['destroy']()[_0xa0c3('0x21')](function(){_0x115155[_0xa0c3('0x2b')](0xcc)[_0xa0c3('0x2c')]();});}};}function handleEntityNotFound(_0xdf7ad6,_0x116934){return function(_0x18e216){if(!_0x18e216){_0xdf7ad6[_0xa0c3('0x2a')](0x194);}return _0x18e216;};}function handleError(_0x55ab30,_0x2dc0be){_0x2dc0be=_0x2dc0be||0x1f4;return function(_0x3ba00a){logger[_0xa0c3('0x27')](_0x3ba00a[_0xa0c3('0x36')]);if(_0x3ba00a[_0xa0c3('0x37')]){delete _0x3ba00a[_0xa0c3('0x37')];}_0x55ab30[_0xa0c3('0x2b')](_0x2dc0be)[_0xa0c3('0x38')](_0x3ba00a);};}exports[_0xa0c3('0x39')]=function(_0x3361a9,_0xb0ae50){var _0x531020={},_0x43967c={},_0x565939={'count':0x0,'rows':[]};var _0x29a35f=_[_0xa0c3('0x3a')](db[_0xa0c3('0x3b')][_0xa0c3('0x3c')],function(_0x10372f){return{'name':_0x10372f[_0xa0c3('0x3d')],'type':_0x10372f['type'][_0xa0c3('0x3e')]};});_0x43967c['model']=_[_0xa0c3('0x3a')](_0x29a35f,'name');_0x43967c[_0xa0c3('0x3f')]=_[_0xa0c3('0x40')](_0x3361a9[_0xa0c3('0x3f')]);_0x43967c[_0xa0c3('0x41')]=_['intersection'](_0x43967c[_0xa0c3('0x42')],_0x43967c['query']);_0x531020[_0xa0c3('0x43')]=_[_0xa0c3('0x44')](_0x43967c[_0xa0c3('0x42')],qs['fields'](_0x3361a9[_0xa0c3('0x3f')]['fields']));_0x531020['attributes']=_0x531020[_0xa0c3('0x43')][_0xa0c3('0x45')]?_0x531020['attributes']:_0x43967c[_0xa0c3('0x42')];if(!_0x3361a9[_0xa0c3('0x3f')][_0xa0c3('0x46')](_0xa0c3('0x47'))){_0x531020['limit']=qs[_0xa0c3('0x31')](_0x3361a9['query'][_0xa0c3('0x31')]);_0x531020[_0xa0c3('0x2e')]=qs[_0xa0c3('0x2e')](_0x3361a9['query'][_0xa0c3('0x2e')]);}_0x531020['order']=qs[_0xa0c3('0x48')](_0x3361a9[_0xa0c3('0x3f')][_0xa0c3('0x48')]);_0x531020['where']=qs[_0xa0c3('0x41')](_[_0xa0c3('0x49')](_0x3361a9[_0xa0c3('0x3f')],_0x43967c['filters']),_0x29a35f);if(_0x3361a9['query'][_0xa0c3('0x4a')]){_0x531020[_0xa0c3('0x4b')]=_[_0xa0c3('0x4c')](_0x531020[_0xa0c3('0x4b')],{'$or':_[_0xa0c3('0x3a')](_0x29a35f,function(_0x55da86){if(_0x55da86[_0xa0c3('0x4d')]!=='VIRTUAL'){var _0x4a763f={};_0x4a763f[_0x55da86['name']]={'$like':'%'+_0x3361a9[_0xa0c3('0x3f')][_0xa0c3('0x4a')]+'%'};return _0x4a763f;}})});}_0x531020=_[_0xa0c3('0x4c')]({},_0x531020,_0x3361a9[_0xa0c3('0x4e')]);var _0x418d64={'where':_0x531020[_0xa0c3('0x4b')]};return db[_0xa0c3('0x3b')][_0xa0c3('0x30')](_0x418d64)['then'](function(_0x58b34d){_0x565939['count']=_0x58b34d;if(_0x3361a9[_0xa0c3('0x3f')][_0xa0c3('0x4f')]){_0x531020[_0xa0c3('0x50')]=[{'all':!![]}];}return db[_0xa0c3('0x3b')][_0xa0c3('0x51')](_0x531020);})['then'](function(_0x166d15){_0x565939[_0xa0c3('0x52')]=_0x166d15;return _0x565939;})['then'](respondWithFilteredResult(_0xb0ae50,_0x531020))[_0xa0c3('0x53')](handleError(_0xb0ae50,null));};exports[_0xa0c3('0x54')]=function(_0x5346f7,_0x4383b3){var _0x50be9e={'raw':!![],'where':{'id':_0x5346f7[_0xa0c3('0x55')]['id']}},_0x242115={};_0x242115[_0xa0c3('0x42')]=_[_0xa0c3('0x40')](db[_0xa0c3('0x3b')][_0xa0c3('0x3c')]);_0x242115[_0xa0c3('0x3f')]=_[_0xa0c3('0x40')](_0x5346f7[_0xa0c3('0x3f')]);_0x242115[_0xa0c3('0x41')]=_['intersection'](_0x242115[_0xa0c3('0x42')],_0x242115['query']);_0x50be9e[_0xa0c3('0x43')]=_[_0xa0c3('0x44')](_0x242115[_0xa0c3('0x42')],qs[_0xa0c3('0x56')](_0x5346f7[_0xa0c3('0x3f')][_0xa0c3('0x56')]));_0x50be9e['attributes']=_0x50be9e[_0xa0c3('0x43')][_0xa0c3('0x45')]?_0x50be9e[_0xa0c3('0x43')]:_0x242115[_0xa0c3('0x42')];if(_0x5346f7[_0xa0c3('0x3f')][_0xa0c3('0x4f')]){_0x50be9e[_0xa0c3('0x50')]=[{'all':!![]}];}_0x50be9e=_[_0xa0c3('0x4c')]({},_0x50be9e,_0x5346f7[_0xa0c3('0x4e')]);return db['FaxMessage'][_0xa0c3('0x57')](_0x50be9e)[_0xa0c3('0x21')](handleEntityNotFound(_0x4383b3,null))[_0xa0c3('0x21')](respondWithResult(_0x4383b3,null))[_0xa0c3('0x53')](handleError(_0x4383b3,null));};exports[_0xa0c3('0x58')]=function(_0x4738a6,_0x43bbeb){if(_0x4738a6[_0xa0c3('0x59')]['id']){delete _0x4738a6[_0xa0c3('0x59')]['id'];}return db[_0xa0c3('0x3b')]['find']({'where':{'id':_0x4738a6['params']['id']}})[_0xa0c3('0x21')](handleEntityNotFound(_0x43bbeb,null))[_0xa0c3('0x21')](saveUpdates(_0x4738a6[_0xa0c3('0x59')],null))[_0xa0c3('0x21')](respondWithResult(_0x43bbeb,null))[_0xa0c3('0x53')](handleError(_0x43bbeb,null));};exports[_0xa0c3('0x5a')]=function(_0x4b38ac,_0x23b450){return db[_0xa0c3('0x3b')][_0xa0c3('0x57')]({'where':{'id':_0x4b38ac[_0xa0c3('0x55')]['id']}})[_0xa0c3('0x21')](handleEntityNotFound(_0x23b450,null))['then'](removeEntity(_0x23b450,null))[_0xa0c3('0x53')](handleError(_0x23b450,null));};exports['describe']=function(_0x228678,_0x5980e7){return db['FaxMessage'][_0xa0c3('0x5b')]()[_0xa0c3('0x21')](respondWithResult(_0x5980e7,null))[_0xa0c3('0x53')](handleError(_0x5980e7,null));};var interaction_log=require(_0xa0c3('0x12'))(_0xa0c3('0x5c'));exports['accept']=function(_0xe54c3f,_0x5c45c6,_0x59dffd){var _0x527025={'agent':{},'channel':_0xa0c3('0x5d')};if(_0xe54c3f[_0xa0c3('0x59')]['id']){delete _0xe54c3f[_0xa0c3('0x59')]['id'];}_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x5e')]=!![];_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x5f')]=moment()[_0xa0c3('0x60')](_0xa0c3('0x61'));_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x62')]=_0xe54c3f['body'][_0xa0c3('0x62')]||_0xe54c3f[_0xa0c3('0x63')]['id'];_0x527025['agent']['id']=_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x62')];return db[_0xa0c3('0x3b')][_0xa0c3('0x57')]({'where':{'id':_0xe54c3f[_0xa0c3('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c45c6,null))[_0xa0c3('0x21')](saveUpdates(_0xe54c3f[_0xa0c3('0x59')],null))[_0xa0c3('0x21')](function(_0xcabb8d){if(_0xcabb8d){_0x527025[_0xa0c3('0x29')]=_0xcabb8d[_0xa0c3('0x64')]({'plain':!![]});return db[_0xa0c3('0x65')][_0xa0c3('0x57')]({'where':{'id':_0xcabb8d['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5c45c6,null))[_0xa0c3('0x21')](function(_0x56652c){if(_0x56652c){return _0x56652c[_0xa0c3('0x58')]({'UserId':_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x62')],'read1stAt':_[_0xa0c3('0x66')](_0x56652c[_0xa0c3('0x67')])?moment()['format'](_0xa0c3('0x61')):undefined});}return null;})[_0xa0c3('0x21')](function(_0x152f58){if(_0x152f58){_0x527025[_0xa0c3('0x68')]=_0x152f58[_0xa0c3('0x64')]({'plain':!![]});interaction_log[_0xa0c3('0x22')](_0xa0c3('0x69'),_0xe54c3f['user']['id'],_0xe54c3f[_0xa0c3('0x63')][_0xa0c3('0x37')],_0xe54c3f['user'][_0xa0c3('0x6a')],_0x527025[_0xa0c3('0x68')]['id'],_0xe54c3f[_0xa0c3('0x59')]?JSON[_0xa0c3('0x6b')](_0xe54c3f[_0xa0c3('0x59')]):_0xa0c3('0x6c'));return respondWithRpcPromise(_0xa0c3('0x6d'),_0xa0c3('0x6e'),_0x527025);}return null;})['then'](function(_0x1d518e){var _0x475ef6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d518e['message'][_0xa0c3('0x6f')];return db[_0xa0c3('0x70')][_0xa0c3('0x3f')](_0x475ef6,{'type':db[_0xa0c3('0x71')][_0xa0c3('0x72')][_0xa0c3('0x73')],'raw':!![]})[_0xa0c3('0x21')](function(_0x990c74){return _0x990c74;});})['then'](function(_0xd4b030){if(_0xd4b030){_0x527025[_0xa0c3('0x29')][_0xa0c3('0x74')]=_0xd4b030[0x0];if(!_0xe54c3f['body'][_0xa0c3('0x62')])return;return db[_0xa0c3('0x75')]['find']({'where':{'id':_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x62')],'role':_0xa0c3('0x76')},'attributes':['id','name','fullname',_0xa0c3('0x77'),_0xa0c3('0x78')],'raw':!![]});}return null;})['then'](function(_0x19db54){if(!_0x19db54)return null;_0x527025['message'][_0xa0c3('0x76')]=_0x19db54;return _0x527025;})[_0xa0c3('0x21')](function(_0x41cd9c){if(_0x41cd9c){if(_0xe54c3f[_0xa0c3('0x59')][_0xa0c3('0x79')]){_0x527025['message'][_0xa0c3('0x7a')]=util[_0xa0c3('0x60')](_0xa0c3('0x7b'),_0xe54c3f[_0xa0c3('0x63')][_0xa0c3('0x37')]);_0x527025[_0xa0c3('0x29')]['channel']=_0x527025[_0xa0c3('0x7c')];_0x527025[_0xa0c3('0x29')]['motionChannel']=_0x527025[_0xa0c3('0x7c')];_0x527025['message'][_0xa0c3('0x7d')]=_0xa0c3('0x7e');return respondWithRpcPromise(_0xa0c3('0x7f'),_0xa0c3('0x7f'),{'event':_0xa0c3('0x80'),'message':_0x527025['message']},client9002)[_0xa0c3('0x21')](function(){return _0x527025;});}return _0x527025;}return null;})[_0xa0c3('0x21')](respondWithResult(_0x5c45c6,null))[_0xa0c3('0x53')](handleError(_0x5c45c6,null));};var interaction_log=require('../../config/logger')(_0xa0c3('0x5c'));exports['reject']=function(_0x5850d9,_0x14b0ef,_0x107798){var _0x52364f={'agent':{},'channel':_0xa0c3('0x5d')};if(_0x5850d9[_0xa0c3('0x59')]['id']){delete _0x5850d9['body']['id'];}_0x5850d9[_0xa0c3('0x59')][_0xa0c3('0x62')]=_0x5850d9[_0xa0c3('0x59')][_0xa0c3('0x62')]||_0x5850d9[_0xa0c3('0x63')]['id'];_0x52364f[_0xa0c3('0x76')]['id']=_0x5850d9[_0xa0c3('0x59')][_0xa0c3('0x62')];return db[_0xa0c3('0x3b')][_0xa0c3('0x57')]({'where':{'id':_0x5850d9['params']['id'],'UserId':null}})[_0xa0c3('0x21')](handleEntityNotFound(_0x14b0ef,null))[_0xa0c3('0x21')](function(_0xe835da){if(_0xe835da){_0x52364f['message']=_0xe835da[_0xa0c3('0x64')]({'plain':!![]});return db[_0xa0c3('0x65')][_0xa0c3('0x57')]({'where':{'id':_0xe835da[_0xa0c3('0x81')]}});}return null;})[_0xa0c3('0x21')](handleEntityNotFound(_0x14b0ef,null))['then'](function(_0x5c40e2){if(_0x5c40e2){_0x52364f[_0xa0c3('0x68')]=_0x5c40e2[_0xa0c3('0x64')]({'plain':!![]});interaction_log[_0xa0c3('0x22')](_0xa0c3('0x82'),_0x5850d9[_0xa0c3('0x63')]['id'],_0x5850d9[_0xa0c3('0x63')][_0xa0c3('0x37')],_0x5850d9[_0xa0c3('0x63')][_0xa0c3('0x6a')],_0x52364f[_0xa0c3('0x68')]['id'],_0x5850d9[_0xa0c3('0x59')]?JSON[_0xa0c3('0x6b')](_0x5850d9[_0xa0c3('0x59')]):_0xa0c3('0x6c'));return respondWithRpcPromise(_0xa0c3('0x83'),_0xa0c3('0x84'),_0x52364f);}return null;})[_0xa0c3('0x21')](function(_0x55a35c){var _0x3e8d71=_0xa0c3('0x85')+_0x55a35c[_0xa0c3('0x29')][_0xa0c3('0x6f')];return db['sequelize'][_0xa0c3('0x3f')](_0x3e8d71,{'type':db[_0xa0c3('0x71')]['QueryTypes'][_0xa0c3('0x73')],'raw':!![]})['then'](function(_0x113ace){return _0x113ace;});})['then'](function(_0x4ff60d){if(_0x4ff60d){_0x52364f['message'][_0xa0c3('0x74')]=_0x4ff60d[0x0];if(!_0x5850d9[_0xa0c3('0x59')][_0xa0c3('0x62')])return;return db['User'][_0xa0c3('0x57')]({'where':{'id':_0x5850d9[_0xa0c3('0x59')][_0xa0c3('0x62')],'role':_0xa0c3('0x76')},'attributes':['id',_0xa0c3('0x37'),_0xa0c3('0x86'),_0xa0c3('0x77'),'internal'],'raw':!![]});}return null;})[_0xa0c3('0x21')](function(_0x10c9d5){if(!_0x10c9d5)return null;_0x52364f[_0xa0c3('0x29')][_0xa0c3('0x76')]=_0x10c9d5;return _0x52364f;})[_0xa0c3('0x21')](function(_0x5b4e1d){if(_0x5b4e1d){_0x5b4e1d[_0xa0c3('0x29')][_0xa0c3('0x7a')]=util[_0xa0c3('0x60')](_0xa0c3('0x7b'),_0x5850d9[_0xa0c3('0x63')][_0xa0c3('0x37')]);_0x5b4e1d[_0xa0c3('0x29')]['channel']=_0x52364f[_0xa0c3('0x7c')];_0x5b4e1d[_0xa0c3('0x29')][_0xa0c3('0x87')]=_0x52364f[_0xa0c3('0x7c')];_0x5b4e1d[_0xa0c3('0x29')][_0xa0c3('0x7d')]=_0xa0c3('0x34');respondWithRpcPromise('EventManager',_0xa0c3('0x7f'),{'event':_0xa0c3('0x88'),'message':_0x5b4e1d['message']},client9002);return _0x52364f;}return null;})[_0xa0c3('0x21')](respondWithResult(_0x14b0ef,null))[_0xa0c3('0x53')](handleError(_0x14b0ef,null));};exports[_0xa0c3('0x89')]=function(_0x1b0a8d,_0xe772b0){var _0x55dd3b;return db[_0xa0c3('0x3b')]['create'](_0x1b0a8d[_0xa0c3('0x59')],{})[_0xa0c3('0x21')](function(_0x2ec877){_0x55dd3b=_0x2ec877;return db[_0xa0c3('0x8a')]['findOne']({'where':{'id':_0x55dd3b[_0xa0c3('0x6f')]}});})['then'](function(_0x51447b){if(_[_0xa0c3('0x66')](_0x51447b)){return;}else{_0x55dd3b[_0xa0c3('0x5d')]=_0x51447b[_0xa0c3('0x5d')];return db[_0xa0c3('0x8b')][_0xa0c3('0x8c')]({'where':{'id':_0x55dd3b[_0xa0c3('0x8d')]}});}})[_0xa0c3('0x21')](function(_0x55b8aa){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x1b0a8d[_0xa0c3('0x59')])?undefined:_0x1b0a8d[_0xa0c3('0x59')][_0xa0c3('0x8e')],'path':_['isNil'](_0x55b8aa)?undefined:util[_0xa0c3('0x60')]('/var/opt/motion2/server/files/attachments/%s',_0x55b8aa[_0xa0c3('0x8f')]),'fax':_[_0xa0c3('0x66')](_0x55dd3b['fax'])?undefined:_0x55dd3b[_0xa0c3('0x5d')],'AttachmentId':_0x55dd3b[_0xa0c3('0x8d')]},client9002);})['then'](respondWithResult(_0xe772b0,0xc9))[_0xa0c3('0x53')](handleError(_0xe772b0,null));};exports['download']=function(_0x3b98c,_0x3cafe0){var _0x2482ae=path[_0xa0c3('0x90')](config[_0xa0c3('0x91')],'server',_0xa0c3('0x92'),'attachments');return db['FaxMessage'][_0xa0c3('0x57')]({'where':{'id':_0x3b98c['params']['id']},'include':[{'model':db['Attachment'],'as':_0xa0c3('0x8b')}]})[_0xa0c3('0x21')](handleEntityNotFound(_0x3cafe0,null))[_0xa0c3('0x21')](function(_0xec608e){if(_0xec608e){return _0x3cafe0[_0xa0c3('0x93')](path[_0xa0c3('0x90')](_0x2482ae,_0xec608e[_0xa0c3('0x8b')][_0xa0c3('0x8f')]));}})['catch'](handleError(_0x3cafe0,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 341ae1a..2a53586 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 _0x042a=['exports','events','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x41b07c,_0x2292f9){var _0x1ee607=function(_0x474e03){while(--_0x474e03){_0x41b07c['push'](_0x41b07c['shift']());}};_0x1ee607(++_0x2292f9);}(_0x042a,0x1d9));var _0xa042=function(_0x2eb56f,_0x18b857){_0x2eb56f=_0x2eb56f-0x0;var _0x489667=_0x042a[_0x2eb56f];return _0x489667;};'use strict';var EventEmitter=require(_0xa042('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xa042('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa042('0x2')](0x0);var events={'afterCreate':_0xa042('0x3'),'afterUpdate':'update','afterDestroy':_0xa042('0x4')};function emitEvent(_0x368f0d){return function(_0xc28407,_0x37c7a8,_0x3580d6){FaxMessageEvents[_0xa042('0x5')](_0x368f0d+':'+_0xc28407['id'],_0xc28407);FaxMessageEvents[_0xa042('0x5')](_0x368f0d,_0xc28407);_0x3580d6(null);};}for(var e in events){if(events[_0xa042('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xa042('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x00f0=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0xf55c59,_0x24f79c){var _0x208a0a=function(_0x33cd16){while(--_0x33cd16){_0xf55c59['push'](_0xf55c59['shift']());}};_0x208a0a(++_0x24f79c);}(_0x00f0,0xec));var _0x000f=function(_0x3c6013,_0x4ec949){_0x3c6013=_0x3c6013-0x0;var _0x25fc37=_0x00f0[_0x3c6013];return _0x25fc37;};'use strict';var EventEmitter=require(_0x000f('0x0'));var FaxMessage=require(_0x000f('0x1'))['db'][_0x000f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x000f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x000f('0x4')};function emitEvent(_0x4c8ce1){return function(_0x3cd8ed,_0x53989d,_0x3a0613){FaxMessageEvents[_0x000f('0x5')](_0x4c8ce1+':'+_0x3cd8ed['id'],_0x3cd8ed);FaxMessageEvents['emit'](_0x4c8ce1,_0x3cd8ed);_0x3a0613(null);};}for(var e in events){if(events[_0x000f('0x6')](e)){var event=events[e];FaxMessage[_0x000f('0x7')](e,emitEvent(event));}}module[_0x000f('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 22764d6..eb5f2a5 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 _0x1e5b=['rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','FaxInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53199b,_0x45efbb){var _0x27011f=function(_0x284e4b){while(--_0x284e4b){_0x53199b['push'](_0x53199b['shift']());}};_0x27011f(++_0x45efbb);}(_0x1e5b,0x173));var _0xb1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb1e5('0x0'));var util=require('util');var logger=require(_0xb1e5('0x1'))(_0xb1e5('0x2'));var moment=require(_0xb1e5('0x3'));var BPromise=require(_0xb1e5('0x4'));var rp=require(_0xb1e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1e5('0x6'));var config=require(_0xb1e5('0x7'));var attributes=require(_0xb1e5('0x8'));module[_0xb1e5('0x9')]=function(_0x2c8bd1,_0x15e1c4){return _0x2c8bd1['define'](_0xb1e5('0xa'),attributes,{'tableName':_0xb1e5('0xb'),'paranoid':![],'indexes':[{'name':_0xb1e5('0xc'),'fields':[_0xb1e5('0xd')],'type':_0xb1e5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31cc6e,_0x3dc33c,_0x3c17de){var _0x2bf3cf=_0x2c8bd1[_0xb1e5('0xf')];var _0x1b8bd9=_0x31cc6e[_0xb1e5('0x10')]({'plain':!![]});if(_0x1b8bd9[_0xb1e5('0x11')]['toLowerCase']()==='in'||_0x1b8bd9[_0xb1e5('0x11')]['toLowerCase']()===_0xb1e5('0x12')&&!_0x1b8bd9[_0xb1e5('0x13')]&&!_[_0xb1e5('0x14')](_0x1b8bd9[_0xb1e5('0x15')])){_0x2bf3cf[_0xb1e5('0x16')][_0xb1e5('0x17')]({'where':{'id':_0x1b8bd9['FaxInteractionId']}})['then'](function(_0x2ad6ac){if(_0x2ad6ac){_0x2ad6ac['update']({'lastMsgAt':_0x1b8bd9[_0xb1e5('0x18')],'lastMsgDirection':_0x1b8bd9['direction']['toLowerCase']()});}})[_0xb1e5('0x19')](function(_0x18773f){console[_0xb1e5('0x1a')](_0x18773f);});}_0x3c17de();}},'charset':_0xb1e5('0x1b'),'collate':_0xb1e5('0x1c')});}; \ No newline at end of file +var _0xdf10=['FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil'];(function(_0x34d3ef,_0x25da8f){var _0x287757=function(_0x588276){while(--_0x588276){_0x34d3ef['push'](_0x34d3ef['shift']());}};_0x287757(++_0x25da8f);}(_0xdf10,0x104));var _0x0df1=function(_0x35fe57,_0x23063c){_0x35fe57=_0x35fe57-0x0;var _0x545599=_0xdf10[_0x35fe57];return _0x545599;};'use strict';var _=require(_0x0df1('0x0'));var util=require(_0x0df1('0x1'));var logger=require(_0x0df1('0x2'))('api');var moment=require(_0x0df1('0x3'));var BPromise=require(_0x0df1('0x4'));var rp=require(_0x0df1('0x5'));var fs=require('fs');var path=require(_0x0df1('0x6'));var rimraf=require(_0x0df1('0x7'));var config=require('../../config/environment');var attributes=require(_0x0df1('0x8'));module[_0x0df1('0x9')]=function(_0x2363c2,_0x2a07af){return _0x2363c2['define'](_0x0df1('0xa'),attributes,{'tableName':_0x0df1('0xb'),'paranoid':![],'indexes':[{'name':_0x0df1('0xc'),'fields':[_0x0df1('0xd')],'type':_0x0df1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xba8278,_0x5daa86,_0x30e980){var _0x2c9d46=_0x2363c2['models'];var _0x5f04b3=_0xba8278['get']({'plain':!![]});if(_0x5f04b3[_0x0df1('0xf')]['toLowerCase']()==='in'||_0x5f04b3[_0x0df1('0xf')][_0x0df1('0x10')]()===_0x0df1('0x11')&&!_0x5f04b3[_0x0df1('0x12')]&&!_[_0x0df1('0x13')](_0x5f04b3['UserId'])){_0x2c9d46[_0x0df1('0x14')][_0x0df1('0x15')]({'where':{'id':_0x5f04b3[_0x0df1('0x16')]}})[_0x0df1('0x17')](function(_0x5cc53e){if(_0x5cc53e){_0x5cc53e['update']({'lastMsgAt':_0x5f04b3[_0x0df1('0x18')],'lastMsgDirection':_0x5f04b3[_0x0df1('0xf')]['toLowerCase']()});}})[_0x0df1('0x19')](function(_0x1e4103){console[_0x0df1('0x1a')](_0x1e4103);});}_0x30e980();}},'charset':'utf8mb4','collate':_0x0df1('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c884e21..0deda69 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 _0x81bd=['debug','request\x20sent','stringify','error','message','result','catch','CreateFaxMessage','create','body','options','raw','FaxMessage','update','limit','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s'];(function(_0x42bb1c,_0x37e20f){var _0x47f7b0=function(_0x2bd0d4){while(--_0x2bd0d4){_0x42bb1c['push'](_0x42bb1c['shift']());}};_0x47f7b0(++_0x37e20f);}(_0x81bd,0x7c));var _0xd81b=function(_0x30b547,_0x5b89e9){_0x30b547=_0x30b547-0x0;var _0xab9618=_0x81bd[_0x30b547];return _0xab9618;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});config[_0xd81b('0xc')]=_['defaults'](config['redis'],{'host':_0xd81b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0xc')]));require(_0xd81b('0xe'))[_0xd81b('0xf')](socket);function respondWithRpcPromise(_0x86dab6,_0x17fba4,_0x1ff60f){return new BPromise(function(_0x4391be,_0x17e09f){return client[_0xd81b('0x10')](_0x86dab6,_0x1ff60f)[_0xd81b('0x11')](function(_0x215b92){logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,'request\x20sent');logger[_0xd81b('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x17fba4,_0xd81b('0x15'),JSON[_0xd81b('0x16')](_0x215b92));if(_0x215b92['error']){if(_0x215b92[_0xd81b('0x17')]['code']===0x1f4){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);return _0x17e09f(_0x215b92[_0xd81b('0x17')]['message']);}logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92['error'][_0xd81b('0x18')]);return _0x4391be(_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);}else{logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,_0xd81b('0x15'));_0x4391be(_0x215b92[_0xd81b('0x19')][_0xd81b('0x18')]);}})[_0xd81b('0x1a')](function(_0x285164){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x285164);_0x17e09f(_0x285164);});});}exports[_0xd81b('0x1b')]=function(_0x3518f0){var _0x156894=this;return new Promise(function(_0x4f8c0b,_0x5f101a){return db['FaxMessage'][_0xd81b('0x1c')](_0x3518f0[_0xd81b('0x1d')],{'raw':_0x3518f0[_0xd81b('0x1e')]?_0x3518f0['options'][_0xd81b('0x1f')]===undefined?!![]:![]:!![]})[_0xd81b('0x11')](function(_0x542ee2){logger[_0xd81b('0x12')](_0xd81b('0x1b'),_0x3518f0);logger[_0xd81b('0x14')](_0xd81b('0x1b'),_0x3518f0,JSON[_0xd81b('0x16')](_0x542ee2));_0x4f8c0b(_0x542ee2);})[_0xd81b('0x1a')](function(_0x255011){logger[_0xd81b('0x17')](_0xd81b('0x1b'),_0x255011[_0xd81b('0x18')],_0x3518f0);_0x5f101a(_0x156894[_0xd81b('0x17')](0x1f4,_0x255011[_0xd81b('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x28768f){var _0x99dbc9=this;return new Promise(function(_0xe3637a,_0x31b9fd){return db[_0xd81b('0x20')][_0xd81b('0x21')](_0x28768f[_0xd81b('0x1d')],{'raw':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28768f[_0xd81b('0x1e')]?_0x28768f['options']['where']||null:null,'attributes':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['attributes']||null:null,'limit':_0x28768f['options']?_0x28768f[_0xd81b('0x1e')][_0xd81b('0x22')]||null:null})[_0xd81b('0x11')](function(_0x289f54){logger[_0xd81b('0x12')](_0xd81b('0x23'),_0x28768f);logger['debug'](_0xd81b('0x23'),_0x28768f,JSON[_0xd81b('0x16')](_0x289f54));_0xe3637a(_0x289f54);})['catch'](function(_0x56d80b){logger[_0xd81b('0x17')](_0xd81b('0x23'),_0x56d80b['message'],_0x28768f);_0x31b9fd(_0x99dbc9['error'](0x1f4,_0x56d80b['message']));});});}; \ No newline at end of file +var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x3918ed,_0x1ddda9){var _0x41bb12=function(_0x367f32){while(--_0x367f32){_0x3918ed['push'](_0x3918ed['shift']());}};_0x41bb12(++_0x1ddda9);}(_0x55e0,0xdc));var _0x055e=function(_0x1231d3,_0x2ea4f8){_0x1231d3=_0x1231d3-0x0;var _0x92313c=_0x55e0[_0x1231d3];return _0x92313c;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ad72d66..e802685 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 _0x5e82=['register','length','faxMessage:','remove','update','emit'];(function(_0x4e101c,_0x49d42c){var _0x59dc1c=function(_0x38ea19){while(--_0x38ea19){_0x4e101c['push'](_0x4e101c['shift']());}};_0x59dc1c(++_0x49d42c);}(_0x5e82,0x10b));var _0x25e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e82[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x25e8('0x0'),_0x25e8('0x1')];function createListener(_0xa9f4c1,_0x56b64){return function(_0x5e52b9){_0x56b64[_0x25e8('0x2')](_0xa9f4c1,_0x5e52b9);};}function removeListener(_0x276f27,_0x1dafbd){return function(){FaxMessageEvents['removeListener'](_0x276f27,_0x1dafbd);};}exports[_0x25e8('0x3')]=function(_0x2d18f6){for(var _0x483925=0x0,_0x1ace50=events[_0x25e8('0x4')];_0x483925<_0x1ace50;_0x483925++){var _0x47dc39=events[_0x483925];var _0x2b3d8e=createListener(_0x25e8('0x5')+_0x47dc39,_0x2d18f6);FaxMessageEvents['on'](_0x47dc39,_0x2b3d8e);}}; \ No newline at end of file +var _0xe4b0=['./faxMessage.events','save','remove','update','emit','removeListener','length','faxMessage:'];(function(_0x5c7fd6,_0xb24a89){var _0x1e7d73=function(_0x1447f9){while(--_0x1447f9){_0x5c7fd6['push'](_0x5c7fd6['shift']());}};_0x1e7d73(++_0xb24a89);}(_0xe4b0,0x170));var _0x0e4b=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0xe4b0[_0x39f097];return _0x544f6a;};'use strict';var FaxMessageEvents=require(_0x0e4b('0x0'));var events=[_0x0e4b('0x1'),_0x0e4b('0x2'),_0x0e4b('0x3')];function createListener(_0x5416af,_0x5e376c){return function(_0x3c8970){_0x5e376c[_0x0e4b('0x4')](_0x5416af,_0x3c8970);};}function removeListener(_0x47e9ed,_0x3bc849){return function(){FaxMessageEvents[_0x0e4b('0x5')](_0x47e9ed,_0x3bc849);};}exports['register']=function(_0x8159d5){for(var _0x4fb06e=0x0,_0x4de29c=events[_0x0e4b('0x6')];_0x4fb06e<_0x4de29c;_0x4fb06e++){var _0x19a8f8=events[_0x4fb06e];var _0x2bad19=createListener(_0x0e4b('0x7')+_0x19a8f8,_0x8159d5);FaxMessageEvents['on'](_0x19a8f8,_0x2bad19);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 756bf40..ac54d2a 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 _0xbb53=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','tracked','faxmessage:create','put','update','/:id/accept','accept','reject','destroy'];(function(_0xe5ed0e,_0x2522fc){var _0x3c995c=function(_0x20882b){while(--_0x20882b){_0xe5ed0e['push'](_0xe5ed0e['shift']());}};_0x3c995c(++_0x2522fc);}(_0xbb53,0x121));var _0x3bb5=function(_0x51692a,_0x6c1fdb){_0x51692a=_0x51692a-0x0;var _0xd04cd4=_0xbb53[_0x51692a];return _0xd04cd4;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./faxMessage.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),auth[_0x3bb5('0xa')](),controller['describe']);router['get']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xe')]);router[_0x3bb5('0xc')]('/:id/download',auth[_0x3bb5('0xa')](),controller['download']);router['post']('/',auth[_0x3bb5('0xa')](),interaction[_0x3bb5('0xf')]('fax',_0x3bb5('0x10')),controller['create']);router[_0x3bb5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x12')]);router[_0x3bb5('0x11')](_0x3bb5('0x13'),auth['isAuthenticated'](),controller[_0x3bb5('0x14')]);router[_0x3bb5('0x11')]('/:id/reject',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x16')]);module[_0x3bb5('0x17')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x21e176,_0xdf8d2c){var _0x285f74=function(_0x4b5a23){while(--_0x4b5a23){_0x21e176['push'](_0x21e176['shift']());}};_0x285f74(++_0xdf8d2c);}(_0x579c,0xda));var _0xc579=function(_0x1b3b80,_0x1de656){_0x1b3b80=_0x1b3b80-0x0;var _0xee4c46=_0x579c[_0x1b3b80];return _0xee4c46;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/describe',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),interaction[_0xc579('0x12')](_0xc579('0x13'),_0xc579('0x14')),controller[_0xc579('0x15')]);router[_0xc579('0x16')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x17')]);router['put'](_0xc579('0x18'),auth['isAuthenticated'](),controller[_0xc579('0x19')]);router['put'](_0xc579('0x1a'),auth['isAuthenticated'](),controller[_0xc579('0x1b')]);router['delete'](_0xc579('0xd'),auth[_0xc579('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 23e1134..53dc300 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 _0x9c4a=['INTEGER','exports','name','STRING','ENUM','beepall','roundrobin'];(function(_0x84c52f,_0x8bcc66){var _0x54ef98=function(_0x323873){while(--_0x323873){_0x84c52f['push'](_0x84c52f['shift']());}};_0x54ef98(++_0x8bcc66);}(_0x9c4a,0x1dd));var _0xa9c4=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x9c4a[_0x48e1ec];return _0x3b33eb;};'use strict';var Sequelize=require('sequelize');module[_0xa9c4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa9c4('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa9c4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa9c4('0x3')]('rrmemory',_0xa9c4('0x4'),_0xa9c4('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa9c4('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf6c=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x26de57,_0x3dd634){var _0x55584f=function(_0x53b82a){while(--_0x53b82a){_0x26de57['push'](_0x26de57['shift']());}};_0x55584f(++_0x3dd634);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x1f7f14,_0x267a98){_0x1f7f14=_0x1f7f14-0x0;var _0x28efbc=_0xbf6c[_0x1f7f14];return _0x28efbc;};'use strict';var Sequelize=require(_0xcbf6('0x0'));module[_0xcbf6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcbf6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcbf6('0x3')]},'timeout':{'type':Sequelize[_0xcbf6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcbf6('0x5')](_0xcbf6('0x6'),_0xcbf6('0x7'),_0xcbf6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xcbf6('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 8dcd224..9e5377a 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 _0x6eaa=['status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','FaxQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','sendStatus'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x6eaa,0x18d));var _0xa6ea=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6eaa[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xa6ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa6ea('0x1'));var jsonpatch=require(_0xa6ea('0x2'));var rp=require('request-promise');var moment=require(_0xa6ea('0x3'));var BPromise=require(_0xa6ea('0x4'));var Mustache=require('mustache');var util=require(_0xa6ea('0x5'));var path=require('path');var sox=require(_0xa6ea('0x6'));var csv=require(_0xa6ea('0x7'));var ejs=require(_0xa6ea('0x8'));var fs=require('fs');var fs_extra=require(_0xa6ea('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6ea('0xa'));var jsforce=require(_0xa6ea('0xb'));var deskjs=require(_0xa6ea('0xc'));var toCsv=require(_0xa6ea('0x7'));var querystring=require(_0xa6ea('0xd'));var Papa=require(_0xa6ea('0xe'));var Redis=require(_0xa6ea('0xf'));var authService=require(_0xa6ea('0x10'));var qs=require(_0xa6ea('0x11'));var as=require(_0xa6ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6ea('0x13'))(_0xa6ea('0x14'));var utils=require(_0xa6ea('0x15'));var config=require(_0xa6ea('0x16'));var licenseUtil=require(_0xa6ea('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa6ea('0x18')](config[_0xa6ea('0x19')],{'host':_0xa6ea('0x1a'),'port':0x18eb});var socket=require(_0xa6ea('0x1b'))(new Redis(config[_0xa6ea('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x49909c,_0x5df95d){_0x5df95d=_0x5df95d||0xcc;return function(_0x30795a){if(_0x30795a){return _0x49909c[_0xa6ea('0x1c')](_0x5df95d);}return _0x49909c[_0xa6ea('0x1d')](_0x5df95d)[_0xa6ea('0x1e')]();};}function respondWithResult(_0x413819,_0x57ad77){_0x57ad77=_0x57ad77||0xc8;return function(_0x21acb7){if(_0x21acb7){return _0x413819[_0xa6ea('0x1d')](_0x57ad77)[_0xa6ea('0x1f')](_0x21acb7);}};}function respondWithFilteredResult(_0x138618,_0x3324c2){return function(_0x5ebaa7){if(_0x5ebaa7){var _0x18aaec=typeof _0x3324c2[_0xa6ea('0x20')]===_0xa6ea('0x21')&&typeof _0x3324c2['limit']===_0xa6ea('0x21');var _0x58cb33=_0x5ebaa7[_0xa6ea('0x22')];var _0x4e2e79=_0x18aaec?0x0:_0x3324c2[_0xa6ea('0x20')];var _0x5a7f23=_0x18aaec?_0x5ebaa7[_0xa6ea('0x22')]:_0x3324c2[_0xa6ea('0x20')]+_0x3324c2['limit'];var _0x5a1b9a;if(_0x5a7f23>=_0x58cb33){_0x5a7f23=_0x58cb33;_0x5a1b9a=0xc8;}else{_0x5a1b9a=0xce;}_0x138618[_0xa6ea('0x1d')](_0x5a1b9a);return _0x138618[_0xa6ea('0x23')](_0xa6ea('0x24'),_0x4e2e79+'-'+_0x5a7f23+'/'+_0x58cb33)['json'](_0x5ebaa7);}return null;};}function patchUpdates(_0x1b62e0){return function(_0x2868cb){try{jsonpatch[_0xa6ea('0x25')](_0x2868cb,_0x1b62e0,!![]);}catch(_0x5a913f){return BPromise[_0xa6ea('0x26')](_0x5a913f);}return _0x2868cb[_0xa6ea('0x27')]();};}function saveUpdates(_0x1630e7,_0x3f6f35){return function(_0x4a7e17){if(_0x4a7e17){return _0x4a7e17[_0xa6ea('0x28')](_0x1630e7)[_0xa6ea('0x29')](function(_0x5129a0){return _0x5129a0;});}return null;};}function removeEntity(_0x465dbc,_0x28f90d){return function(_0x1ed1d6){if(_0x1ed1d6){return _0x1ed1d6[_0xa6ea('0x2a')]()[_0xa6ea('0x29')](function(){var _0x55c09e=_0x1ed1d6['get']({'plain':!![]});var _0x4f186b='FaxQueues';return db[_0xa6ea('0x2b')][_0xa6ea('0x2a')]({'where':{'type':_0x4f186b,'resourceId':_0x55c09e['id']}})['then'](function(){return _0x1ed1d6;});})[_0xa6ea('0x29')](function(){_0x465dbc[_0xa6ea('0x1d')](0xcc)[_0xa6ea('0x1e')]();});}};}function handleEntityNotFound(_0x29de8d,_0x3e573b){return function(_0x3e29be){if(!_0x3e29be){_0x29de8d[_0xa6ea('0x1c')](0x194);}return _0x3e29be;};}function handleError(_0x39ea33,_0x34240a){_0x34240a=_0x34240a||0x1f4;return function(_0x503b0e){logger[_0xa6ea('0x2c')](_0x503b0e[_0xa6ea('0x2d')]);if(_0x503b0e[_0xa6ea('0x2e')]){delete _0x503b0e[_0xa6ea('0x2e')];}_0x39ea33[_0xa6ea('0x1d')](_0x34240a)['send'](_0x503b0e);};}exports[_0xa6ea('0x2f')]=function(_0x72f6f,_0x134791){var _0x28b549={},_0x13a925={},_0xac4da2={'count':0x0,'rows':[]};var _0x4cc960=_[_0xa6ea('0x30')](db[_0xa6ea('0x31')][_0xa6ea('0x32')],function(_0x2ae0ea){return{'name':_0x2ae0ea[_0xa6ea('0x33')],'type':_0x2ae0ea['type'][_0xa6ea('0x34')]};});_0x13a925[_0xa6ea('0x35')]=_['map'](_0x4cc960,'name');_0x13a925[_0xa6ea('0x36')]=_[_0xa6ea('0x37')](_0x72f6f[_0xa6ea('0x36')]);_0x13a925[_0xa6ea('0x38')]=_[_0xa6ea('0x39')](_0x13a925[_0xa6ea('0x35')],_0x13a925[_0xa6ea('0x36')]);_0x28b549[_0xa6ea('0x3a')]=_[_0xa6ea('0x39')](_0x13a925['model'],qs[_0xa6ea('0x3b')](_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x3b')]));_0x28b549[_0xa6ea('0x3a')]=_0x28b549[_0xa6ea('0x3a')][_0xa6ea('0x3c')]?_0x28b549['attributes']:_0x13a925[_0xa6ea('0x35')];if(!_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x3d')](_0xa6ea('0x3e'))){_0x28b549[_0xa6ea('0x3f')]=qs[_0xa6ea('0x3f')](_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x3f')]);_0x28b549[_0xa6ea('0x20')]=qs[_0xa6ea('0x20')](_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x20')]);}_0x28b549[_0xa6ea('0x40')]=qs[_0xa6ea('0x41')](_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x41')]);_0x28b549[_0xa6ea('0x42')]=qs['filters'](_[_0xa6ea('0x43')](_0x72f6f[_0xa6ea('0x36')],_0x13a925[_0xa6ea('0x38')]),_0x4cc960);if(_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x44')]){_0x28b549[_0xa6ea('0x42')]=_[_0xa6ea('0x45')](_0x28b549['where'],{'$or':_[_0xa6ea('0x30')](_0x4cc960,function(_0x58a597){if(_0x58a597['type']!==_0xa6ea('0x46')){var _0x3ee294={};_0x3ee294[_0x58a597[_0xa6ea('0x2e')]]={'$like':'%'+_0x72f6f[_0xa6ea('0x36')][_0xa6ea('0x44')]+'%'};return _0x3ee294;}})});}_0x28b549=_['merge']({},_0x28b549,_0x72f6f[_0xa6ea('0x47')]);var _0x29db76={'where':_0x28b549[_0xa6ea('0x42')]};return db['FaxQueue'][_0xa6ea('0x22')](_0x29db76)[_0xa6ea('0x29')](function(_0x1be7b){_0xac4da2['count']=_0x1be7b;if(_0x72f6f['query'][_0xa6ea('0x48')]){_0x28b549[_0xa6ea('0x49')]=[{'all':!![]}];}return db[_0xa6ea('0x31')][_0xa6ea('0x4a')](_0x28b549);})[_0xa6ea('0x29')](function(_0x5ce897){_0xac4da2[_0xa6ea('0x4b')]=_0x5ce897;return _0xac4da2;})[_0xa6ea('0x29')](respondWithFilteredResult(_0x134791,_0x28b549))[_0xa6ea('0x4c')](handleError(_0x134791,null));};exports['show']=function(_0x27bb01,_0x2c6da4){var _0x4c0620={'raw':!![],'where':{'id':_0x27bb01[_0xa6ea('0x4d')]['id']}},_0x4b777e={};_0x4b777e[_0xa6ea('0x35')]=_[_0xa6ea('0x37')](db['FaxQueue'][_0xa6ea('0x32')]);_0x4b777e['query']=_[_0xa6ea('0x37')](_0x27bb01['query']);_0x4b777e[_0xa6ea('0x38')]=_[_0xa6ea('0x39')](_0x4b777e[_0xa6ea('0x35')],_0x4b777e[_0xa6ea('0x36')]);_0x4c0620['attributes']=_[_0xa6ea('0x39')](_0x4b777e[_0xa6ea('0x35')],qs[_0xa6ea('0x3b')](_0x27bb01[_0xa6ea('0x36')]['fields']));_0x4c0620['attributes']=_0x4c0620['attributes'][_0xa6ea('0x3c')]?_0x4c0620[_0xa6ea('0x3a')]:_0x4b777e['model'];if(_0x27bb01['query']['includeAll']){_0x4c0620['include']=[{'all':!![]}];}_0x4c0620=_[_0xa6ea('0x45')]({},_0x4c0620,_0x27bb01['options']);return db['FaxQueue'][_0xa6ea('0x4e')](_0x4c0620)['then'](handleEntityNotFound(_0x2c6da4,null))[_0xa6ea('0x29')](respondWithResult(_0x2c6da4,null))[_0xa6ea('0x4c')](handleError(_0x2c6da4,null));};exports['create']=function(_0x2a9363,_0x435c81){return db[_0xa6ea('0x31')][_0xa6ea('0x4f')](_0x2a9363[_0xa6ea('0x50')],{})[_0xa6ea('0x29')](function(_0x1918e6){var _0xd634de=_0x2a9363[_0xa6ea('0x51')][_0xa6ea('0x52')]({'plain':!![]});if(!_0xd634de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd634de['role']===_0xa6ea('0x51')){var _0x5cfde4=_0x1918e6[_0xa6ea('0x52')]({'plain':!![]});var _0x1cfa24=_0xa6ea('0x53');return db[_0xa6ea('0x54')][_0xa6ea('0x4e')]({'where':{'name':_0x1cfa24,'userProfileId':_0xd634de[_0xa6ea('0x55')]},'raw':!![]})[_0xa6ea('0x29')](function(_0x42b9ce){if(_0x42b9ce&&_0x42b9ce['autoAssociation']===0x0){return db[_0xa6ea('0x2b')]['create']({'name':_0x5cfde4['name'],'resourceId':_0x5cfde4['id'],'type':_0x42b9ce[_0xa6ea('0x2e')],'sectionId':_0x42b9ce['id']},{})[_0xa6ea('0x29')](function(){return _0x1918e6;});}else{return _0x1918e6;}})['catch'](function(_0x593a83){logger['error'](_0xa6ea('0x56'),_0x593a83);throw _0x593a83;});}return _0x1918e6;})[_0xa6ea('0x29')](respondWithResult(_0x435c81,0xc9))['catch'](handleError(_0x435c81,null));};exports[_0xa6ea('0x28')]=function(_0xc3155a,_0x2b9c27){if(_0xc3155a['body']['id']){delete _0xc3155a[_0xa6ea('0x50')]['id'];}return db[_0xa6ea('0x31')][_0xa6ea('0x4e')]({'where':{'id':_0xc3155a['params']['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x2b9c27,null))[_0xa6ea('0x29')](saveUpdates(_0xc3155a[_0xa6ea('0x50')],null))['then'](respondWithResult(_0x2b9c27,null))[_0xa6ea('0x4c')](handleError(_0x2b9c27,null));};exports[_0xa6ea('0x2a')]=function(_0x39fa4a,_0x16f2fc){return db['FaxQueue'][_0xa6ea('0x4e')]({'where':{'id':_0x39fa4a[_0xa6ea('0x4d')]['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x16f2fc,null))[_0xa6ea('0x29')](removeEntity(_0x16f2fc,null))[_0xa6ea('0x4c')](handleError(_0x16f2fc,null));};exports[_0xa6ea('0x57')]=function(_0xba1785,_0x4a111b){return db[_0xa6ea('0x31')][_0xa6ea('0x57')]()[_0xa6ea('0x29')](respondWithResult(_0x4a111b,null))[_0xa6ea('0x4c')](handleError(_0x4a111b,null));};exports['getMembers']=function(_0x1269ff,_0x3bd073,_0x3fce55){var _0x13201f={'raw':!![],'where':{}},_0x4a505c={},_0xf3b82b;return db[_0xa6ea('0x31')][_0xa6ea('0x58')]({'where':{'id':_0x1269ff[_0xa6ea('0x4d')]['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x3bd073,null))[_0xa6ea('0x29')](function(_0x10bb3c){if(_0x10bb3c){_0xf3b82b=_0x10bb3c[_0xa6ea('0x52')]({'plain':!![]});_0x4a505c[_0xa6ea('0x35')]=_[_0xa6ea('0x37')](db[_0xa6ea('0x59')][_0xa6ea('0x32')]);_0x4a505c[_0xa6ea('0x36')]=_[_0xa6ea('0x37')](_0x1269ff[_0xa6ea('0x36')]);_0x4a505c[_0xa6ea('0x38')]=_[_0xa6ea('0x39')](_0x4a505c[_0xa6ea('0x35')],_0x4a505c[_0xa6ea('0x36')]);_0x13201f[_0xa6ea('0x3a')]=_[_0xa6ea('0x39')](_0x4a505c['model'],qs[_0xa6ea('0x3b')](_0x1269ff[_0xa6ea('0x36')][_0xa6ea('0x3b')]));_0x13201f[_0xa6ea('0x3a')]=_0x13201f['attributes'][_0xa6ea('0x3c')]?_0x13201f['attributes']:_0x4a505c['model'];if(!_0x1269ff[_0xa6ea('0x36')][_0xa6ea('0x3d')]('nolimit')){_0x13201f[_0xa6ea('0x3f')]=qs[_0xa6ea('0x3f')](_0x1269ff[_0xa6ea('0x36')][_0xa6ea('0x3f')]);_0x13201f[_0xa6ea('0x20')]=qs[_0xa6ea('0x20')](_0x1269ff[_0xa6ea('0x36')]['offset']);}_0x13201f[_0xa6ea('0x40')]=qs[_0xa6ea('0x41')](_0x1269ff[_0xa6ea('0x36')][_0xa6ea('0x41')]);_0x13201f[_0xa6ea('0x42')]=qs['filters'](_[_0xa6ea('0x43')](_0x1269ff[_0xa6ea('0x36')],_0x4a505c[_0xa6ea('0x38')]));_0x13201f[_0xa6ea('0x42')][_0xa6ea('0x5a')]=_0x10bb3c['id'];if(_0x1269ff[_0xa6ea('0x36')][_0xa6ea('0x44')]){_0x13201f[_0xa6ea('0x42')]=_['merge'](_0x13201f['where'],{'$or':_['map'](_0x13201f[_0xa6ea('0x3a')],function(_0x37de12){var _0x367982={};_0x367982[_0x37de12]={'$like':'%'+_0x1269ff['query'][_0xa6ea('0x44')]+'%'};return _0x367982;})});}_0x13201f=_[_0xa6ea('0x45')]({},_0x13201f,_0x1269ff['options']);return db['UserFaxQueue'][_0xa6ea('0x4a')](_0x13201f);}})[_0xa6ea('0x29')](function(_0xa57e7f){if(_0xa57e7f){return db[_0xa6ea('0x5b')][_0xa6ea('0x5c')]({'where':{'id':_[_0xa6ea('0x30')](_0xa57e7f,_0xa6ea('0x5d')),'role':_0xa6ea('0x5e')},'attributes':['id',_0xa6ea('0x2e'),_0xa6ea('0x5f'),_0xa6ea('0x60'),_0xa6ea('0x61')]});}})[_0xa6ea('0x29')](function(_0x8e0987){if(_0x8e0987){return{'count':_0x8e0987[_0xa6ea('0x22')],'rows':_[_0xa6ea('0x30')](_0x8e0987[_0xa6ea('0x4b')],function(_0x2009af){return{'membername':_0x2009af['name'],'UserId':_0x2009af['id'],'queue_name':_0xf3b82b[_0xa6ea('0x2e')],'FaxQueueId':_0xf3b82b['id'],'interface':util[_0xa6ea('0x62')](_0xa6ea('0x63'),_0xa6ea('0x64'),_0x2009af[_0xa6ea('0x2e')]),'penalty':0x0,'paused':_0x2009af[_0xa6ea('0x5f')],'createdAt':_0x2009af[_0xa6ea('0x61')],'updatedAt':_0x2009af[_0xa6ea('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3bd073,_0x13201f))[_0xa6ea('0x4c')](handleError(_0x3bd073,null));};exports['getTeams']=function(_0x287f3f,_0x3bae1a,_0x566ec8){var _0x3983f9={};var _0x174453={};var _0x1bbcd3;var _0x3032ed;return db[_0xa6ea('0x31')][_0xa6ea('0x58')]({'where':{'id':_0x287f3f['params']['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x3bae1a,null))[_0xa6ea('0x29')](function(_0x30b06a){if(_0x30b06a){_0x1bbcd3=_0x30b06a;_0x174453[_0xa6ea('0x35')]=_[_0xa6ea('0x37')](db[_0xa6ea('0x65')]['rawAttributes']);_0x174453[_0xa6ea('0x36')]=_['keys'](_0x287f3f[_0xa6ea('0x36')]);_0x174453[_0xa6ea('0x38')]=_[_0xa6ea('0x39')](_0x174453[_0xa6ea('0x35')],_0x174453['query']);_0x3983f9[_0xa6ea('0x3a')]=_['intersection'](_0x174453[_0xa6ea('0x35')],qs[_0xa6ea('0x3b')](_0x287f3f[_0xa6ea('0x36')][_0xa6ea('0x3b')]));_0x3983f9['attributes']=_0x3983f9['attributes']['length']?_0x3983f9[_0xa6ea('0x3a')]:_0x174453[_0xa6ea('0x35')];_0x3983f9['order']=qs['sort'](_0x287f3f[_0xa6ea('0x36')][_0xa6ea('0x41')]);_0x3983f9[_0xa6ea('0x42')]=qs['filters'](_[_0xa6ea('0x43')](_0x287f3f['query'],_0x174453['filters']));if(_0x287f3f['query'][_0xa6ea('0x44')]){_0x3983f9['where']=_['merge'](_0x3983f9[_0xa6ea('0x42')],{'$or':_[_0xa6ea('0x30')](_0x3983f9['attributes'],function(_0x466776){var _0x6f07f8={};_0x6f07f8[_0x466776]={'$like':'%'+_0x287f3f[_0xa6ea('0x36')][_0xa6ea('0x44')]+'%'};return _0x6f07f8;})});}_0x3983f9=_[_0xa6ea('0x45')]({},_0x3983f9,_0x287f3f[_0xa6ea('0x47')]);return _0x1bbcd3['getTeams'](_0x3983f9);}})['then'](function(_0x123811){if(_0x123811){_0x3032ed=_0x123811[_0xa6ea('0x3c')];if(!_0x287f3f[_0xa6ea('0x36')][_0xa6ea('0x3d')](_0xa6ea('0x3e'))){_0x3983f9[_0xa6ea('0x3f')]=qs[_0xa6ea('0x3f')](_0x287f3f[_0xa6ea('0x36')][_0xa6ea('0x3f')]);_0x3983f9[_0xa6ea('0x20')]=qs['offset'](_0x287f3f['query'][_0xa6ea('0x20')]);}return _0x1bbcd3['getTeams'](_0x3983f9);}})[_0xa6ea('0x29')](function(_0x21ccf0){if(_0x21ccf0){return _0x21ccf0?{'count':_0x3032ed,'rows':_0x21ccf0}:null;}})[_0xa6ea('0x29')](respondWithResult(_0x3bae1a,null))[_0xa6ea('0x4c')](handleError(_0x3bae1a,null));};exports[_0xa6ea('0x66')]=function(_0xf6e839,_0x2efc84,_0x7693f){var _0x231db9=_0xf6e839[_0xa6ea('0x50')][_0xa6ea('0x67')];return db[_0xa6ea('0x65')]['findAll']({'where':{'id':_0x231db9},'attributes':['id'],'include':[{'model':db[_0xa6ea('0x5b')],'as':_0xa6ea('0x68'),'attributes':['id','name',_0xa6ea('0x69'),_0xa6ea('0x6a'),_0xa6ea('0x6b')],'raw':!![]}]})[_0xa6ea('0x29')](function(_0x4fd360){if(_0x4fd360){var _0x534a2f=_['flatMap'](_0x4fd360,function(_0x73fc6d){var _0x38ecff=_0x73fc6d[_0xa6ea('0x52')]({'plain':!![]});return _0x38ecff['Agents'];});return db[_0xa6ea('0x31')][_0xa6ea('0x4e')]({'where':{'id':_0xf6e839[_0xa6ea('0x4d')]['id']}})[_0xa6ea('0x29')](function(_0x47be28){return db[_0xa6ea('0x6c')][_0xa6ea('0x6d')](function(_0x4adb25){return _0x47be28[_0xa6ea('0x66')](_0x231db9,{'transaction':_0x4adb25})[_0xa6ea('0x29')](function(){return BPromise[_0xa6ea('0x6e')](_0x534a2f,function(_0x7b17a2){return db[_0xa6ea('0x59')][_0xa6ea('0x6f')]({'where':{'UserId':_0x7b17a2['id'],'FaxQueueId':_0xf6e839[_0xa6ea('0x4d')]['id']},'transaction':_0x4adb25});});})[_0xa6ea('0x29')](function(){_0x534a2f[_0xa6ea('0x70')](function(_0x19b058){socket['emit'](_0xa6ea('0x71'),{'UserId':_0x19b058['id'],'FaxQueueId':_0x47be28['id']});});});});});}})[_0xa6ea('0x29')](respondWithStatusCode(_0x2efc84,null))[_0xa6ea('0x4c')](handleError(_0x2efc84,null));};exports[_0xa6ea('0x72')]=function(_0x5ddfd5,_0x5d96bb,_0x1ae72f){return db[_0xa6ea('0x65')][_0xa6ea('0x4a')]({'where':{'id':_0x5ddfd5[_0xa6ea('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa6ea('0x5b')],'as':_0xa6ea('0x68'),'attributes':['id'],'raw':!![]}]})[_0xa6ea('0x29')](handleEntityNotFound(_0x5d96bb,null))[_0xa6ea('0x29')](function(_0x4185bd){var _0x2b0e8f=_[_0xa6ea('0x30')](_0x4185bd,'id');var _0x581fcb=[];var _0xc5f9e9=[];var _0x2e4d2e=squel[_0xa6ea('0x73')]();_0x2e4d2e[_0xa6ea('0x74')](_0xa6ea('0x75'))[_0xa6ea('0x76')]('team_has_fax_queues','tq')[_0xa6ea('0x77')](_0xa6ea('0x78'),'ut',_0xa6ea('0x79'))[_0xa6ea('0x42')](_0xa6ea('0x7a'),_0x5ddfd5[_0xa6ea('0x4d')]['id']);for(var _0x839f6d=0x0;_0x839f6d<_0x4185bd[_0xa6ea('0x3c')];_0x839f6d+=0x1){let _0x44a25a=_0x4185bd[_0x839f6d];for(var _0x14f2dc=0x0;_0x14f2dc<_0x44a25a['Agents'][_0xa6ea('0x3c')];_0x14f2dc+=0x1){let _0x2cce68=_0x44a25a[_0xa6ea('0x68')][_0x14f2dc];var _0x3aa844=_0x2e4d2e[_0xa6ea('0x7b')]();_0x3aa844[_0xa6ea('0x42')]('ut.UserId\x20=\x20?',_0x2cce68['id']);_0xc5f9e9['push'](db[_0xa6ea('0x6c')][_0xa6ea('0x36')](_0x3aa844[_0xa6ea('0x7c')](),{'type':db[_0xa6ea('0x6c')][_0xa6ea('0x7d')][_0xa6ea('0x7e')]})[_0xa6ea('0x29')](function(_0x35a025){if(_0x35a025[_0xa6ea('0x3c')]===0x1){return _0x2cce68['id'];}else{var _0xaeac5b=_[_0xa6ea('0x7f')](_[_0xa6ea('0x30')](_0x35a025,_0xa6ea('0x80')),function(_0xf45fee){return _[_0xa6ea('0x81')](_0x2b0e8f,_0xf45fee);});if(_0xaeac5b){return _0x2cce68['id'];}}}));}}return BPromise[_0xa6ea('0x82')](_0xc5f9e9)[_0xa6ea('0x29')](function(_0x46858a){_0x581fcb=_(_0x581fcb)[_0xa6ea('0x83')](_0x46858a)[_0xa6ea('0x84')]()[_0xa6ea('0x85')]();return db[_0xa6ea('0x31')][_0xa6ea('0x4e')]({'where':{'id':_0x5ddfd5['params']['id']}})['then'](function(_0x36ec21){return db['sequelize'][_0xa6ea('0x6d')](function(_0x275c68){return _0x36ec21[_0xa6ea('0x72')](_0x5ddfd5['query']['ids'],{'transaction':_0x275c68})[_0xa6ea('0x29')](function(){if(!_[_0xa6ea('0x86')](_0x581fcb)){return _0x36ec21[_0xa6ea('0x87')](_0x581fcb,{'transaction':_0x275c68});}})[_0xa6ea('0x29')](function(){_0x581fcb[_0xa6ea('0x70')](function(_0x577c5d){socket[_0xa6ea('0x88')](_0xa6ea('0x89'),{'UserId':_0x577c5d,'FaxQueueId':_0x36ec21['id']});});});});});});})[_0xa6ea('0x29')](respondWithStatusCode(_0x5d96bb,null))[_0xa6ea('0x4c')](handleError(_0x5d96bb,null));};exports[_0xa6ea('0x8a')]=function(_0xbcedda,_0x4a0180,_0x4e8fa8){return db[_0xa6ea('0x31')][_0xa6ea('0x4e')]({'where':{'id':_0xbcedda[_0xa6ea('0x4d')]['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x4a0180,null))['then'](function(_0x2e9d49){if(_0x2e9d49){return _0x2e9d49[_0xa6ea('0x8a')](_0xbcedda['body'][_0xa6ea('0x67')],_[_0xa6ea('0x8b')](_0xbcedda['body'],[_0xa6ea('0x67'),'id'])||{})[_0xa6ea('0x8c')](function(_0x11d4ca){for(var _0x136b08=0x0;_0x136b08<_0xbcedda['body'][_0xa6ea('0x67')][_0xa6ea('0x3c')];_0x136b08+=0x1){socket[_0xa6ea('0x88')](_0xa6ea('0x71'),{'UserId':Number(_0xbcedda[_0xa6ea('0x50')]['ids'][_0x136b08]),'FaxQueueId':Number(_0xbcedda[_0xa6ea('0x4d')]['id'])});}return _0x11d4ca;});}})[_0xa6ea('0x29')](respondWithResult(_0x4a0180,null))[_0xa6ea('0x4c')](handleError(_0x4a0180,null));};exports[_0xa6ea('0x87')]=function(_0x220bf3,_0x10e60f,_0x2037d9){return db[_0xa6ea('0x31')][_0xa6ea('0x4e')]({'where':{'id':_0x220bf3['params']['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x10e60f,null))[_0xa6ea('0x29')](function(_0x38f4d8){if(_0x38f4d8){return _0x38f4d8[_0xa6ea('0x87')](_0x220bf3[_0xa6ea('0x36')][_0xa6ea('0x67')])['then'](function(){if(_['isArray'](_0x220bf3[_0xa6ea('0x36')][_0xa6ea('0x67')])){for(var _0x28cb2f=0x0;_0x28cb2f<_0x220bf3[_0xa6ea('0x36')][_0xa6ea('0x67')][_0xa6ea('0x3c')];_0x28cb2f+=0x1){socket[_0xa6ea('0x88')](_0xa6ea('0x89'),{'UserId':Number(_0x220bf3[_0xa6ea('0x36')]['ids'][_0x28cb2f]),'FaxQueueId':Number(_0x220bf3[_0xa6ea('0x4d')]['id'])});}}else{socket[_0xa6ea('0x88')]('userFaxQueue:remove',{'UserId':Number(_0x220bf3[_0xa6ea('0x36')][_0xa6ea('0x67')]),'FaxQueueId':Number(_0x220bf3[_0xa6ea('0x4d')]['id'])});}});}})[_0xa6ea('0x29')](respondWithStatusCode(_0x10e60f,null))[_0xa6ea('0x4c')](handleError(_0x10e60f,null));};exports[_0xa6ea('0x8d')]=function(_0x385ed6,_0x1db1eb,_0x3d0b48){var _0x207433={};var _0x21354f={};var _0x49c66e;var _0x566dfd;return db[_0xa6ea('0x31')][_0xa6ea('0x58')]({'where':{'id':_0x385ed6[_0xa6ea('0x4d')]['id']}})[_0xa6ea('0x29')](handleEntityNotFound(_0x1db1eb,null))[_0xa6ea('0x29')](function(_0x20d4e9){if(_0x20d4e9){_0x49c66e=_0x20d4e9;_0x21354f[_0xa6ea('0x35')]=_[_0xa6ea('0x37')](db[_0xa6ea('0x5b')]['rawAttributes']);_0x21354f[_0xa6ea('0x36')]=_[_0xa6ea('0x37')](_0x385ed6['query']);_0x21354f[_0xa6ea('0x38')]=_[_0xa6ea('0x39')](_0x21354f[_0xa6ea('0x35')],_0x21354f[_0xa6ea('0x36')]);_0x207433['attributes']=_[_0xa6ea('0x39')](_0x21354f['model'],qs[_0xa6ea('0x3b')](_0x385ed6[_0xa6ea('0x36')][_0xa6ea('0x3b')]));_0x207433[_0xa6ea('0x3a')]=_0x207433['attributes'][_0xa6ea('0x3c')]?_0x207433[_0xa6ea('0x3a')]:_0x21354f[_0xa6ea('0x35')];_0x207433[_0xa6ea('0x40')]=qs[_0xa6ea('0x41')](_0x385ed6[_0xa6ea('0x36')][_0xa6ea('0x41')]);_0x207433['where']=qs[_0xa6ea('0x38')](_[_0xa6ea('0x43')](_0x385ed6[_0xa6ea('0x36')],_0x21354f['filters']));if(_0x385ed6[_0xa6ea('0x36')][_0xa6ea('0x44')]){_0x207433[_0xa6ea('0x42')]=_[_0xa6ea('0x45')](_0x207433['where'],{'$or':_[_0xa6ea('0x30')](_0x207433[_0xa6ea('0x3a')],function(_0xf57703){var _0x55ba44={};_0x55ba44[_0xf57703]={'$like':'%'+_0x385ed6[_0xa6ea('0x36')]['filter']+'%'};return _0x55ba44;})});}_0x207433=_[_0xa6ea('0x45')]({},_0x207433,_0x385ed6[_0xa6ea('0x47')]);return _0x49c66e[_0xa6ea('0x8d')](_0x207433);}})[_0xa6ea('0x29')](function(_0x2ae830){if(_0x2ae830){_0x566dfd=_0x2ae830[_0xa6ea('0x3c')];if(!_0x385ed6[_0xa6ea('0x36')]['hasOwnProperty'](_0xa6ea('0x3e'))){_0x207433[_0xa6ea('0x3f')]=qs[_0xa6ea('0x3f')](_0x385ed6[_0xa6ea('0x36')][_0xa6ea('0x3f')]);_0x207433[_0xa6ea('0x20')]=qs[_0xa6ea('0x20')](_0x385ed6['query'][_0xa6ea('0x20')]);}return _0x49c66e[_0xa6ea('0x8d')](_0x207433);}})['then'](function(_0x12e02d){if(_0x12e02d){return _0x12e02d?{'count':_0x566dfd,'rows':_0x12e02d}:null;}})[_0xa6ea('0x29')](respondWithResult(_0x1db1eb,null))['catch'](handleError(_0x1db1eb,null));}; \ No newline at end of file +var _0x4973=['UserProfileResource','end','error','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','options','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userFaxQueue:save','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','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','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','FaxQueues'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x4973,0x183));var _0x3497=function(_0x3c083b,_0x549e68){_0x3c083b=_0x3c083b-0x0;var _0x1c4f50=_0x4973[_0x3c083b];return _0x1c4f50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3497('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3497('0x1'));var rp=require(_0x3497('0x2'));var moment=require(_0x3497('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3497('0x4'));var util=require(_0x3497('0x5'));var path=require(_0x3497('0x6'));var sox=require(_0x3497('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3497('0x8'));var _=require(_0x3497('0x9'));var squel=require(_0x3497('0xa'));var crypto=require(_0x3497('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3497('0xc'));var querystring=require(_0x3497('0xd'));var Papa=require(_0x3497('0xe'));var Redis=require('ioredis');var authService=require(_0x3497('0xf'));var qs=require(_0x3497('0x10'));var as=require(_0x3497('0x11'));var hardwareService=require(_0x3497('0x12'));var logger=require(_0x3497('0x13'))(_0x3497('0x14'));var utils=require(_0x3497('0x15'));var config=require(_0x3497('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3497('0x17'))['db'];config[_0x3497('0x18')]=_[_0x3497('0x19')](config[_0x3497('0x18')],{'host':_0x3497('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3497('0x1b'))[_0x3497('0x1c')](socket);function respondWithStatusCode(_0x4f172f,_0x4f156f){_0x4f156f=_0x4f156f||0xcc;return function(_0x22e7b6){if(_0x22e7b6){return _0x4f172f[_0x3497('0x1d')](_0x4f156f);}return _0x4f172f['status'](_0x4f156f)['end']();};}function respondWithResult(_0x22b6d1,_0x540e6f){_0x540e6f=_0x540e6f||0xc8;return function(_0x2cca46){if(_0x2cca46){return _0x22b6d1[_0x3497('0x1e')](_0x540e6f)[_0x3497('0x1f')](_0x2cca46);}};}function respondWithFilteredResult(_0xd62f5d,_0xc2348d){return function(_0x5c7146){if(_0x5c7146){var _0x2ea173=typeof _0xc2348d['offset']===_0x3497('0x20')&&typeof _0xc2348d[_0x3497('0x21')]===_0x3497('0x20');var _0x469603=_0x5c7146[_0x3497('0x22')];var _0x27d73b=_0x2ea173?0x0:_0xc2348d[_0x3497('0x23')];var _0x5af224=_0x2ea173?_0x5c7146[_0x3497('0x22')]:_0xc2348d['offset']+_0xc2348d[_0x3497('0x21')];var _0x1ef5bb;if(_0x5af224>=_0x469603){_0x5af224=_0x469603;_0x1ef5bb=0xc8;}else{_0x1ef5bb=0xce;}_0xd62f5d[_0x3497('0x1e')](_0x1ef5bb);return _0xd62f5d[_0x3497('0x24')](_0x3497('0x25'),_0x27d73b+'-'+_0x5af224+'/'+_0x469603)[_0x3497('0x1f')](_0x5c7146);}return null;};}function patchUpdates(_0x17c24f){return function(_0x1744dd){try{jsonpatch[_0x3497('0x26')](_0x1744dd,_0x17c24f,!![]);}catch(_0x2bab90){return BPromise[_0x3497('0x27')](_0x2bab90);}return _0x1744dd['save']();};}function saveUpdates(_0x2ad259,_0x33d6b5){return function(_0x35479f){if(_0x35479f){return _0x35479f[_0x3497('0x28')](_0x2ad259)[_0x3497('0x29')](function(_0x3ac757){return _0x3ac757;});}return null;};}function removeEntity(_0x5660a9,_0x4fee67){return function(_0x3f60bc){if(_0x3f60bc){return _0x3f60bc[_0x3497('0x2a')]()[_0x3497('0x29')](function(){var _0x52a77a=_0x3f60bc[_0x3497('0x2b')]({'plain':!![]});var _0x141f26=_0x3497('0x2c');return db[_0x3497('0x2d')][_0x3497('0x2a')]({'where':{'type':_0x141f26,'resourceId':_0x52a77a['id']}})[_0x3497('0x29')](function(){return _0x3f60bc;});})[_0x3497('0x29')](function(){_0x5660a9[_0x3497('0x1e')](0xcc)[_0x3497('0x2e')]();});}};}function handleEntityNotFound(_0x3b2794,_0x1ba0e8){return function(_0x11f70d){if(!_0x11f70d){_0x3b2794[_0x3497('0x1d')](0x194);}return _0x11f70d;};}function handleError(_0x496b40,_0x4d6fcc){_0x4d6fcc=_0x4d6fcc||0x1f4;return function(_0x1c115a){logger[_0x3497('0x2f')](_0x1c115a['stack']);if(_0x1c115a[_0x3497('0x30')]){delete _0x1c115a[_0x3497('0x30')];}_0x496b40[_0x3497('0x1e')](_0x4d6fcc)[_0x3497('0x31')](_0x1c115a);};}exports[_0x3497('0x32')]=function(_0x1eae67,_0x33b9f7){var _0x46b612={},_0x33ffdd={},_0x4b9403={'count':0x0,'rows':[]};var _0x5d9d46=_[_0x3497('0x33')](db[_0x3497('0x34')][_0x3497('0x35')],function(_0x5e666f){return{'name':_0x5e666f['fieldName'],'type':_0x5e666f[_0x3497('0x36')][_0x3497('0x37')]};});_0x33ffdd[_0x3497('0x38')]=_['map'](_0x5d9d46,_0x3497('0x30'));_0x33ffdd[_0x3497('0x39')]=_[_0x3497('0x3a')](_0x1eae67[_0x3497('0x39')]);_0x33ffdd[_0x3497('0x3b')]=_[_0x3497('0x3c')](_0x33ffdd[_0x3497('0x38')],_0x33ffdd[_0x3497('0x39')]);_0x46b612['attributes']=_[_0x3497('0x3c')](_0x33ffdd[_0x3497('0x38')],qs[_0x3497('0x3d')](_0x1eae67[_0x3497('0x39')][_0x3497('0x3d')]));_0x46b612[_0x3497('0x3e')]=_0x46b612[_0x3497('0x3e')][_0x3497('0x3f')]?_0x46b612[_0x3497('0x3e')]:_0x33ffdd[_0x3497('0x38')];if(!_0x1eae67[_0x3497('0x39')][_0x3497('0x40')](_0x3497('0x41'))){_0x46b612[_0x3497('0x21')]=qs[_0x3497('0x21')](_0x1eae67[_0x3497('0x39')][_0x3497('0x21')]);_0x46b612[_0x3497('0x23')]=qs[_0x3497('0x23')](_0x1eae67[_0x3497('0x39')][_0x3497('0x23')]);}_0x46b612[_0x3497('0x42')]=qs[_0x3497('0x43')](_0x1eae67[_0x3497('0x39')]['sort']);_0x46b612[_0x3497('0x44')]=qs['filters'](_['pick'](_0x1eae67[_0x3497('0x39')],_0x33ffdd[_0x3497('0x3b')]),_0x5d9d46);if(_0x1eae67[_0x3497('0x39')]['filter']){_0x46b612['where']=_[_0x3497('0x45')](_0x46b612[_0x3497('0x44')],{'$or':_[_0x3497('0x33')](_0x5d9d46,function(_0x51fcf6){if(_0x51fcf6[_0x3497('0x36')]!==_0x3497('0x46')){var _0x26ad19={};_0x26ad19[_0x51fcf6['name']]={'$like':'%'+_0x1eae67[_0x3497('0x39')][_0x3497('0x47')]+'%'};return _0x26ad19;}})});}_0x46b612=_[_0x3497('0x45')]({},_0x46b612,_0x1eae67['options']);var _0x398c4a={'where':_0x46b612[_0x3497('0x44')]};return db[_0x3497('0x34')][_0x3497('0x22')](_0x398c4a)[_0x3497('0x29')](function(_0x5b5f30){_0x4b9403[_0x3497('0x22')]=_0x5b5f30;if(_0x1eae67[_0x3497('0x39')][_0x3497('0x48')]){_0x46b612[_0x3497('0x49')]=[{'all':!![]}];}return db[_0x3497('0x34')]['findAll'](_0x46b612);})['then'](function(_0x2c128d){_0x4b9403[_0x3497('0x4a')]=_0x2c128d;return _0x4b9403;})['then'](respondWithFilteredResult(_0x33b9f7,_0x46b612))[_0x3497('0x4b')](handleError(_0x33b9f7,null));};exports[_0x3497('0x4c')]=function(_0x426f7b,_0x35eeb8){var _0x7f50e6={'raw':!![],'where':{'id':_0x426f7b['params']['id']}},_0x40554f={};_0x40554f[_0x3497('0x38')]=_[_0x3497('0x3a')](db[_0x3497('0x34')][_0x3497('0x35')]);_0x40554f[_0x3497('0x39')]=_[_0x3497('0x3a')](_0x426f7b[_0x3497('0x39')]);_0x40554f[_0x3497('0x3b')]=_[_0x3497('0x3c')](_0x40554f[_0x3497('0x38')],_0x40554f[_0x3497('0x39')]);_0x7f50e6[_0x3497('0x3e')]=_[_0x3497('0x3c')](_0x40554f[_0x3497('0x38')],qs['fields'](_0x426f7b[_0x3497('0x39')][_0x3497('0x3d')]));_0x7f50e6['attributes']=_0x7f50e6[_0x3497('0x3e')][_0x3497('0x3f')]?_0x7f50e6[_0x3497('0x3e')]:_0x40554f[_0x3497('0x38')];if(_0x426f7b[_0x3497('0x39')]['includeAll']){_0x7f50e6[_0x3497('0x49')]=[{'all':!![]}];}_0x7f50e6=_[_0x3497('0x45')]({},_0x7f50e6,_0x426f7b['options']);return db[_0x3497('0x34')][_0x3497('0x4d')](_0x7f50e6)['then'](handleEntityNotFound(_0x35eeb8,null))[_0x3497('0x29')](respondWithResult(_0x35eeb8,null))[_0x3497('0x4b')](handleError(_0x35eeb8,null));};exports['create']=function(_0x2b30ec,_0x584862){return db[_0x3497('0x34')][_0x3497('0x4e')](_0x2b30ec[_0x3497('0x4f')],{})[_0x3497('0x29')](function(_0x472f1a){var _0x403c5b=_0x2b30ec[_0x3497('0x50')][_0x3497('0x2b')]({'plain':!![]});if(!_0x403c5b)throw new Error(_0x3497('0x51'));if(_0x403c5b['role']==='user'){var _0xe65cf3=_0x472f1a['get']({'plain':!![]});var _0x108f96=_0x3497('0x2c');return db[_0x3497('0x52')]['find']({'where':{'name':_0x108f96,'userProfileId':_0x403c5b[_0x3497('0x53')]},'raw':!![]})[_0x3497('0x29')](function(_0xa45e0e){if(_0xa45e0e&&_0xa45e0e['autoAssociation']===0x0){return db[_0x3497('0x2d')]['create']({'name':_0xe65cf3[_0x3497('0x30')],'resourceId':_0xe65cf3['id'],'type':_0xa45e0e[_0x3497('0x30')],'sectionId':_0xa45e0e['id']},{})[_0x3497('0x29')](function(){return _0x472f1a;});}else{return _0x472f1a;}})[_0x3497('0x4b')](function(_0x28508){logger['error'](_0x3497('0x54'),_0x28508);throw _0x28508;});}return _0x472f1a;})[_0x3497('0x29')](respondWithResult(_0x584862,0xc9))[_0x3497('0x4b')](handleError(_0x584862,null));};exports[_0x3497('0x28')]=function(_0x5d3beb,_0x2d3ee3){if(_0x5d3beb[_0x3497('0x4f')]['id']){delete _0x5d3beb[_0x3497('0x4f')]['id'];}return db[_0x3497('0x34')]['find']({'where':{'id':_0x5d3beb[_0x3497('0x55')]['id']}})[_0x3497('0x29')](handleEntityNotFound(_0x2d3ee3,null))[_0x3497('0x29')](saveUpdates(_0x5d3beb[_0x3497('0x4f')],null))[_0x3497('0x29')](respondWithResult(_0x2d3ee3,null))['catch'](handleError(_0x2d3ee3,null));};exports[_0x3497('0x2a')]=function(_0x2f9cb9,_0x460fb2){return db[_0x3497('0x34')][_0x3497('0x4d')]({'where':{'id':_0x2f9cb9[_0x3497('0x55')]['id']}})['then'](handleEntityNotFound(_0x460fb2,null))[_0x3497('0x29')](removeEntity(_0x460fb2,null))[_0x3497('0x4b')](handleError(_0x460fb2,null));};exports[_0x3497('0x56')]=function(_0x18b1ca,_0x64efa3){return db[_0x3497('0x34')][_0x3497('0x56')]()[_0x3497('0x29')](respondWithResult(_0x64efa3,null))['catch'](handleError(_0x64efa3,null));};exports[_0x3497('0x57')]=function(_0x5d1f2c,_0x3f15ee,_0x4f9ef4){var _0x46b9f3={'raw':!![],'where':{}},_0x300018={},_0x2f96a3;return db['FaxQueue'][_0x3497('0x58')]({'where':{'id':_0x5d1f2c[_0x3497('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f15ee,null))[_0x3497('0x29')](function(_0x4131b3){if(_0x4131b3){_0x2f96a3=_0x4131b3[_0x3497('0x2b')]({'plain':!![]});_0x300018['model']=_[_0x3497('0x3a')](db[_0x3497('0x59')][_0x3497('0x35')]);_0x300018[_0x3497('0x39')]=_[_0x3497('0x3a')](_0x5d1f2c['query']);_0x300018[_0x3497('0x3b')]=_[_0x3497('0x3c')](_0x300018['model'],_0x300018[_0x3497('0x39')]);_0x46b9f3[_0x3497('0x3e')]=_[_0x3497('0x3c')](_0x300018[_0x3497('0x38')],qs[_0x3497('0x3d')](_0x5d1f2c['query'][_0x3497('0x3d')]));_0x46b9f3[_0x3497('0x3e')]=_0x46b9f3[_0x3497('0x3e')][_0x3497('0x3f')]?_0x46b9f3[_0x3497('0x3e')]:_0x300018['model'];if(!_0x5d1f2c[_0x3497('0x39')][_0x3497('0x40')]('nolimit')){_0x46b9f3['limit']=qs['limit'](_0x5d1f2c[_0x3497('0x39')][_0x3497('0x21')]);_0x46b9f3[_0x3497('0x23')]=qs[_0x3497('0x23')](_0x5d1f2c['query'][_0x3497('0x23')]);}_0x46b9f3['order']=qs[_0x3497('0x43')](_0x5d1f2c[_0x3497('0x39')]['sort']);_0x46b9f3[_0x3497('0x44')]=qs['filters'](_[_0x3497('0x5a')](_0x5d1f2c['query'],_0x300018[_0x3497('0x3b')]));_0x46b9f3['where'][_0x3497('0x5b')]=_0x4131b3['id'];if(_0x5d1f2c[_0x3497('0x39')][_0x3497('0x47')]){_0x46b9f3['where']=_[_0x3497('0x45')](_0x46b9f3[_0x3497('0x44')],{'$or':_[_0x3497('0x33')](_0x46b9f3[_0x3497('0x3e')],function(_0x1fc686){var _0x361232={};_0x361232[_0x1fc686]={'$like':'%'+_0x5d1f2c[_0x3497('0x39')][_0x3497('0x47')]+'%'};return _0x361232;})});}_0x46b9f3=_[_0x3497('0x45')]({},_0x46b9f3,_0x5d1f2c[_0x3497('0x5c')]);return db[_0x3497('0x59')]['findAll'](_0x46b9f3);}})['then'](function(_0x57b4f9){if(_0x57b4f9){return db[_0x3497('0x5d')][_0x3497('0x5e')]({'where':{'id':_[_0x3497('0x33')](_0x57b4f9,_0x3497('0x5f')),'role':_0x3497('0x60')},'attributes':['id',_0x3497('0x30'),_0x3497('0x61'),'updatedAt',_0x3497('0x62')]});}})[_0x3497('0x29')](function(_0x33cec4){if(_0x33cec4){return{'count':_0x33cec4[_0x3497('0x22')],'rows':_[_0x3497('0x33')](_0x33cec4[_0x3497('0x4a')],function(_0x15f8c9){return{'membername':_0x15f8c9[_0x3497('0x30')],'UserId':_0x15f8c9['id'],'queue_name':_0x2f96a3[_0x3497('0x30')],'FaxQueueId':_0x2f96a3['id'],'interface':util[_0x3497('0x63')](_0x3497('0x64'),_0x3497('0x65'),_0x15f8c9[_0x3497('0x30')]),'penalty':0x0,'paused':_0x15f8c9[_0x3497('0x61')],'createdAt':_0x15f8c9[_0x3497('0x62')],'updatedAt':_0x15f8c9[_0x3497('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3497('0x29')](respondWithFilteredResult(_0x3f15ee,_0x46b9f3))[_0x3497('0x4b')](handleError(_0x3f15ee,null));};exports[_0x3497('0x67')]=function(_0x53119c,_0x32dd46,_0x29c982){var _0x34b0d3={};var _0x174795={};var _0x334980;var _0x14382c;return db['FaxQueue'][_0x3497('0x58')]({'where':{'id':_0x53119c['params']['id']}})['then'](handleEntityNotFound(_0x32dd46,null))[_0x3497('0x29')](function(_0x29d2c1){if(_0x29d2c1){_0x334980=_0x29d2c1;_0x174795['model']=_[_0x3497('0x3a')](db['Team'][_0x3497('0x35')]);_0x174795[_0x3497('0x39')]=_[_0x3497('0x3a')](_0x53119c[_0x3497('0x39')]);_0x174795['filters']=_[_0x3497('0x3c')](_0x174795[_0x3497('0x38')],_0x174795['query']);_0x34b0d3[_0x3497('0x3e')]=_[_0x3497('0x3c')](_0x174795[_0x3497('0x38')],qs[_0x3497('0x3d')](_0x53119c[_0x3497('0x39')][_0x3497('0x3d')]));_0x34b0d3[_0x3497('0x3e')]=_0x34b0d3['attributes'][_0x3497('0x3f')]?_0x34b0d3[_0x3497('0x3e')]:_0x174795[_0x3497('0x38')];_0x34b0d3[_0x3497('0x42')]=qs[_0x3497('0x43')](_0x53119c['query'][_0x3497('0x43')]);_0x34b0d3[_0x3497('0x44')]=qs['filters'](_[_0x3497('0x5a')](_0x53119c[_0x3497('0x39')],_0x174795[_0x3497('0x3b')]));if(_0x53119c[_0x3497('0x39')][_0x3497('0x47')]){_0x34b0d3['where']=_['merge'](_0x34b0d3[_0x3497('0x44')],{'$or':_[_0x3497('0x33')](_0x34b0d3[_0x3497('0x3e')],function(_0x410b30){var _0x3f4779={};_0x3f4779[_0x410b30]={'$like':'%'+_0x53119c['query'][_0x3497('0x47')]+'%'};return _0x3f4779;})});}_0x34b0d3=_['merge']({},_0x34b0d3,_0x53119c['options']);return _0x334980[_0x3497('0x67')](_0x34b0d3);}})[_0x3497('0x29')](function(_0x29a2b1){if(_0x29a2b1){_0x14382c=_0x29a2b1[_0x3497('0x3f')];if(!_0x53119c['query'][_0x3497('0x40')](_0x3497('0x41'))){_0x34b0d3['limit']=qs[_0x3497('0x21')](_0x53119c[_0x3497('0x39')][_0x3497('0x21')]);_0x34b0d3[_0x3497('0x23')]=qs[_0x3497('0x23')](_0x53119c[_0x3497('0x39')]['offset']);}return _0x334980['getTeams'](_0x34b0d3);}})[_0x3497('0x29')](function(_0x566de3){if(_0x566de3){return _0x566de3?{'count':_0x14382c,'rows':_0x566de3}:null;}})['then'](respondWithResult(_0x32dd46,null))[_0x3497('0x4b')](handleError(_0x32dd46,null));};exports[_0x3497('0x68')]=function(_0xedb131,_0xcd662e,_0x3203ba){var _0x1b6070=_0xedb131[_0x3497('0x4f')][_0x3497('0x69')];return db[_0x3497('0x6a')][_0x3497('0x6b')]({'where':{'id':_0x1b6070},'attributes':['id'],'include':[{'model':db[_0x3497('0x5d')],'as':'Agents','attributes':['id',_0x3497('0x30'),_0x3497('0x6c'),_0x3497('0x6d'),_0x3497('0x6e')],'raw':!![]}]})[_0x3497('0x29')](function(_0x4b8c16){if(_0x4b8c16){var _0x18e82e=_[_0x3497('0x6f')](_0x4b8c16,function(_0x26f413){var _0x24fc33=_0x26f413[_0x3497('0x2b')]({'plain':!![]});return _0x24fc33[_0x3497('0x70')];});return db['FaxQueue'][_0x3497('0x4d')]({'where':{'id':_0xedb131[_0x3497('0x55')]['id']}})[_0x3497('0x29')](function(_0x5e7048){return db[_0x3497('0x71')][_0x3497('0x72')](function(_0x2d2aef){return _0x5e7048[_0x3497('0x68')](_0x1b6070,{'transaction':_0x2d2aef})['then'](function(){return BPromise[_0x3497('0x73')](_0x18e82e,function(_0x2382a8){return db[_0x3497('0x59')]['findOrCreate']({'where':{'UserId':_0x2382a8['id'],'FaxQueueId':_0xedb131[_0x3497('0x55')]['id']},'transaction':_0x2d2aef});});})[_0x3497('0x29')](function(){_0x18e82e[_0x3497('0x74')](function(_0x24112c){socket[_0x3497('0x75')](_0x3497('0x76'),{'UserId':_0x24112c['id'],'FaxQueueId':_0x5e7048['id']});});});});});}})[_0x3497('0x29')](respondWithStatusCode(_0xcd662e,null))[_0x3497('0x4b')](handleError(_0xcd662e,null));};exports['removeTeams']=function(_0x34854e,_0x1910ca,_0x311090){return db['Team'][_0x3497('0x6b')]({'where':{'id':_0x34854e['query'][_0x3497('0x69')]},'attributes':['id'],'include':[{'model':db[_0x3497('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1910ca,null))[_0x3497('0x29')](function(_0x39b3a5){var _0x106ffa=_[_0x3497('0x33')](_0x39b3a5,'id');var _0x49fedf=[];var _0x3ef3fd=[];var _0x342c77=squel[_0x3497('0x77')]();_0x342c77['field'](_0x3497('0x78'))['from'](_0x3497('0x79'),'tq')[_0x3497('0x7a')](_0x3497('0x7b'),'ut',_0x3497('0x7c'))[_0x3497('0x44')]('FaxQueueId\x20=\x20?',_0x34854e[_0x3497('0x55')]['id']);for(var _0xda7eda=0x0;_0xda7eda<_0x39b3a5[_0x3497('0x3f')];_0xda7eda+=0x1){let _0x14a699=_0x39b3a5[_0xda7eda];for(var _0x414961=0x0;_0x414961<_0x14a699[_0x3497('0x70')][_0x3497('0x3f')];_0x414961+=0x1){let _0x21b5fc=_0x14a699[_0x3497('0x70')][_0x414961];var _0x2be6d6=_0x342c77[_0x3497('0x7d')]();_0x2be6d6[_0x3497('0x44')]('ut.UserId\x20=\x20?',_0x21b5fc['id']);_0x3ef3fd[_0x3497('0x7e')](db['sequelize'][_0x3497('0x39')](_0x2be6d6[_0x3497('0x7f')](),{'type':db['sequelize'][_0x3497('0x80')][_0x3497('0x81')]})[_0x3497('0x29')](function(_0x4eb092){if(_0x4eb092[_0x3497('0x3f')]===0x1){return _0x21b5fc['id'];}else{var _0x1509c4=_[_0x3497('0x82')](_[_0x3497('0x33')](_0x4eb092,'TeamId'),function(_0xfb2353){return _[_0x3497('0x83')](_0x106ffa,_0xfb2353);});if(_0x1509c4){return _0x21b5fc['id'];}}}));}}return BPromise[_0x3497('0x84')](_0x3ef3fd)[_0x3497('0x29')](function(_0x2eda88){_0x49fedf=_(_0x49fedf)[_0x3497('0x85')](_0x2eda88)['compact']()[_0x3497('0x86')]();return db[_0x3497('0x34')]['find']({'where':{'id':_0x34854e[_0x3497('0x55')]['id']}})[_0x3497('0x29')](function(_0x36bd49){return db[_0x3497('0x71')]['transaction'](function(_0x5685db){return _0x36bd49[_0x3497('0x87')](_0x34854e['query'][_0x3497('0x69')],{'transaction':_0x5685db})[_0x3497('0x29')](function(){if(!_[_0x3497('0x88')](_0x49fedf)){return _0x36bd49[_0x3497('0x89')](_0x49fedf,{'transaction':_0x5685db});}})[_0x3497('0x29')](function(){_0x49fedf['forEach'](function(_0x48e87a){socket['emit'](_0x3497('0x8a'),{'UserId':_0x48e87a,'FaxQueueId':_0x36bd49['id']});});});});});});})[_0x3497('0x29')](respondWithStatusCode(_0x1910ca,null))['catch'](handleError(_0x1910ca,null));};exports[_0x3497('0x8b')]=function(_0x91a2c8,_0x1d0006,_0x3e3fb7){return db[_0x3497('0x34')][_0x3497('0x4d')]({'where':{'id':_0x91a2c8[_0x3497('0x55')]['id']}})[_0x3497('0x29')](handleEntityNotFound(_0x1d0006,null))[_0x3497('0x29')](function(_0x593c6e){if(_0x593c6e){return _0x593c6e['addAgents'](_0x91a2c8[_0x3497('0x4f')][_0x3497('0x69')],_[_0x3497('0x8c')](_0x91a2c8['body'],[_0x3497('0x69'),'id'])||{})[_0x3497('0x8d')](function(_0x47a019){for(var _0xa45cd2=0x0;_0xa45cd2<_0x91a2c8[_0x3497('0x4f')][_0x3497('0x69')][_0x3497('0x3f')];_0xa45cd2+=0x1){socket['emit'](_0x3497('0x76'),{'UserId':Number(_0x91a2c8['body'][_0x3497('0x69')][_0xa45cd2]),'FaxQueueId':Number(_0x91a2c8[_0x3497('0x55')]['id'])});}return _0x47a019;});}})['then'](respondWithResult(_0x1d0006,null))[_0x3497('0x4b')](handleError(_0x1d0006,null));};exports[_0x3497('0x89')]=function(_0x542ff8,_0x18808b,_0x22b006){return db['FaxQueue'][_0x3497('0x4d')]({'where':{'id':_0x542ff8[_0x3497('0x55')]['id']}})['then'](handleEntityNotFound(_0x18808b,null))[_0x3497('0x29')](function(_0x59099b){if(_0x59099b){return _0x59099b['removeAgents'](_0x542ff8['query']['ids'])[_0x3497('0x29')](function(){if(_[_0x3497('0x8e')](_0x542ff8[_0x3497('0x39')][_0x3497('0x69')])){for(var _0x2ce96d=0x0;_0x2ce96d<_0x542ff8[_0x3497('0x39')][_0x3497('0x69')][_0x3497('0x3f')];_0x2ce96d+=0x1){socket[_0x3497('0x75')](_0x3497('0x8a'),{'UserId':Number(_0x542ff8['query']['ids'][_0x2ce96d]),'FaxQueueId':Number(_0x542ff8[_0x3497('0x55')]['id'])});}}else{socket[_0x3497('0x75')](_0x3497('0x8a'),{'UserId':Number(_0x542ff8['query']['ids']),'FaxQueueId':Number(_0x542ff8[_0x3497('0x55')]['id'])});}});}})[_0x3497('0x29')](respondWithStatusCode(_0x18808b,null))['catch'](handleError(_0x18808b,null));};exports[_0x3497('0x8f')]=function(_0x39237b,_0x5a53bd,_0x1e0ab8){var _0x5a9b5b={};var _0x49c9ab={};var _0xb1ed3d;var _0xf84268;return db['FaxQueue'][_0x3497('0x58')]({'where':{'id':_0x39237b[_0x3497('0x55')]['id']}})[_0x3497('0x29')](handleEntityNotFound(_0x5a53bd,null))[_0x3497('0x29')](function(_0x4c956d){if(_0x4c956d){_0xb1ed3d=_0x4c956d;_0x49c9ab[_0x3497('0x38')]=_[_0x3497('0x3a')](db['User'][_0x3497('0x35')]);_0x49c9ab[_0x3497('0x39')]=_[_0x3497('0x3a')](_0x39237b[_0x3497('0x39')]);_0x49c9ab['filters']=_['intersection'](_0x49c9ab[_0x3497('0x38')],_0x49c9ab['query']);_0x5a9b5b['attributes']=_[_0x3497('0x3c')](_0x49c9ab[_0x3497('0x38')],qs[_0x3497('0x3d')](_0x39237b[_0x3497('0x39')]['fields']));_0x5a9b5b[_0x3497('0x3e')]=_0x5a9b5b[_0x3497('0x3e')][_0x3497('0x3f')]?_0x5a9b5b[_0x3497('0x3e')]:_0x49c9ab[_0x3497('0x38')];_0x5a9b5b['order']=qs[_0x3497('0x43')](_0x39237b[_0x3497('0x39')][_0x3497('0x43')]);_0x5a9b5b[_0x3497('0x44')]=qs[_0x3497('0x3b')](_[_0x3497('0x5a')](_0x39237b[_0x3497('0x39')],_0x49c9ab[_0x3497('0x3b')]));if(_0x39237b['query'][_0x3497('0x47')]){_0x5a9b5b[_0x3497('0x44')]=_['merge'](_0x5a9b5b[_0x3497('0x44')],{'$or':_[_0x3497('0x33')](_0x5a9b5b[_0x3497('0x3e')],function(_0x4e6453){var _0x4a8f73={};_0x4a8f73[_0x4e6453]={'$like':'%'+_0x39237b[_0x3497('0x39')][_0x3497('0x47')]+'%'};return _0x4a8f73;})});}_0x5a9b5b=_[_0x3497('0x45')]({},_0x5a9b5b,_0x39237b[_0x3497('0x5c')]);return _0xb1ed3d[_0x3497('0x8f')](_0x5a9b5b);}})[_0x3497('0x29')](function(_0x37fcdb){if(_0x37fcdb){_0xf84268=_0x37fcdb['length'];if(!_0x39237b[_0x3497('0x39')][_0x3497('0x40')](_0x3497('0x41'))){_0x5a9b5b[_0x3497('0x21')]=qs[_0x3497('0x21')](_0x39237b[_0x3497('0x39')][_0x3497('0x21')]);_0x5a9b5b[_0x3497('0x23')]=qs['offset'](_0x39237b[_0x3497('0x39')][_0x3497('0x23')]);}return _0xb1ed3d[_0x3497('0x8f')](_0x5a9b5b);}})['then'](function(_0xb2254a){if(_0xb2254a){return _0xb2254a?{'count':_0xf84268,'rows':_0xb2254a}:null;}})[_0x3497('0x29')](respondWithResult(_0x5a53bd,null))['catch'](handleError(_0x5a53bd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 443781b..a1be463 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 _0x29dc=['save','remove','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x29dc,0xcc));var _0xc29d=function(_0x277272,_0x22cd56){_0x277272=_0x277272-0x0;var _0x15fcf0=_0x29dc[_0x277272];return _0x15fcf0;};'use strict';var EventEmitter=require(_0xc29d('0x0'));var FaxQueue=require(_0xc29d('0x1'))['db'][_0xc29d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc29d('0x3')](0x0);var events={'afterCreate':_0xc29d('0x4'),'afterUpdate':'update','afterDestroy':_0xc29d('0x5')};function emitEvent(_0x2d5108){return function(_0x1c2e59,_0x1b4918,_0x661cc8){FaxQueueEvents['emit'](_0x2d5108+':'+_0x1c2e59['id'],_0x1c2e59);FaxQueueEvents['emit'](_0x2d5108,_0x1c2e59);_0x661cc8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xc29d('0x6')](e,emitEvent(event));}}module[_0xc29d('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x12a3=['hook','exports','events','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x32b5c4,_0x3eb779){var _0x3d8246=function(_0x20843c){while(--_0x20843c){_0x32b5c4['push'](_0x32b5c4['shift']());}};_0x3d8246(++_0x3eb779);}(_0x12a3,0x185));var _0x312a=function(_0x450ee3,_0x2c6443){_0x450ee3=_0x450ee3-0x0;var _0x1e12e9=_0x12a3[_0x450ee3];return _0x1e12e9;};'use strict';var EventEmitter=require(_0x312a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x312a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x312a('0x2')](0x0);var events={'afterCreate':_0x312a('0x3'),'afterUpdate':_0x312a('0x4'),'afterDestroy':_0x312a('0x5')};function emitEvent(_0x557868){return function(_0x4d0da2,_0x2d584a,_0x2b1aa3){FaxQueueEvents[_0x312a('0x6')](_0x557868+':'+_0x4d0da2['id'],_0x4d0da2);FaxQueueEvents['emit'](_0x557868,_0x4d0da2);_0x2b1aa3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x312a('0x7')](e,emitEvent(event));}}module[_0x312a('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index df04e99..a1375e2 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 _0x9d58=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','FaxQueue','fax_queues'];(function(_0x5528dd,_0x36dcd3){var _0x18f20e=function(_0x5084e3){while(--_0x5084e3){_0x5528dd['push'](_0x5528dd['shift']());}};_0x18f20e(++_0x36dcd3);}(_0x9d58,0x1c2));var _0x89d5=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0x9d58[_0x1f69bc];return _0x1ac3c5;};'use strict';var _=require('lodash');var util=require(_0x89d5('0x0'));var logger=require(_0x89d5('0x1'))(_0x89d5('0x2'));var moment=require('moment');var BPromise=require(_0x89d5('0x3'));var rp=require(_0x89d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89d5('0x5'));var attributes=require('./faxQueue.attributes');module[_0x89d5('0x6')]=function(_0x2b4f4f,_0x24f07c){return _0x2b4f4f[_0x89d5('0x7')](_0x89d5('0x8'),attributes,{'tableName':_0x89d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7306=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash','../../config/logger','api','moment','request-promise'];(function(_0x50e07d,_0xe79b3b){var _0x3f4a60=function(_0x313323){while(--_0x313323){_0x50e07d['push'](_0x50e07d['shift']());}};_0x3f4a60(++_0xe79b3b);}(_0x7306,0xa3));var _0x6730=function(_0x44c415,_0x519fac){_0x44c415=_0x44c415-0x0;var _0x949562=_0x7306[_0x44c415];return _0x949562;};'use strict';var _=require(_0x6730('0x0'));var util=require('util');var logger=require(_0x6730('0x1'))(_0x6730('0x2'));var moment=require(_0x6730('0x3'));var BPromise=require('bluebird');var rp=require(_0x6730('0x4'));var fs=require('fs');var path=require(_0x6730('0x5'));var rimraf=require(_0x6730('0x6'));var config=require(_0x6730('0x7'));var attributes=require(_0x6730('0x8'));module[_0x6730('0x9')]=function(_0x3c8eaa,_0x5663bb){return _0x3c8eaa[_0x6730('0xa')](_0x6730('0xb'),attributes,{'tableName':'fax_queues','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 2e31d6e..b718d1f 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 _0x2709=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','catch','GetFaxQueue','FaxQueue','options','where','limit','include','attributes','model','then','debug','ShowFaxQueue','raw','map','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2e29c4,_0x3ccbda){var _0x401d70=function(_0x4bddaa){while(--_0x4bddaa){_0x2e29c4['push'](_0x2e29c4['shift']());}};_0x401d70(++_0x3ccbda);}(_0x2709,0x119));var _0x9270=function(_0x5ce5ae,_0x45be3d){_0x5ce5ae=_0x5ce5ae-0x0;var _0x2c6822=_0x2709[_0x5ce5ae];return _0x2c6822;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9270('0x0'));var BPromise=require(_0x9270('0x1'));var rs=require(_0x9270('0x2'));var fs=require('fs');var Redis=require(_0x9270('0x3'));var db=require(_0x9270('0x4'))['db'];var utils=require(_0x9270('0x5'));var logger=require(_0x9270('0x6'))(_0x9270('0x7'));var config=require(_0x9270('0x8'));var jayson=require(_0x9270('0x9'));var client=jayson[_0x9270('0xa')][_0x9270('0xb')]({'port':0x232a});config[_0x9270('0xc')]=_[_0x9270('0xd')](config[_0x9270('0xc')],{'host':_0x9270('0xe'),'port':0x18eb});var socket=require(_0x9270('0xf'))(new Redis(config[_0x9270('0xc')]));require(_0x9270('0x10'))[_0x9270('0x11')](socket);function respondWithRpcPromise(_0x4b27fa,_0x5cf04c,_0x5bad7f){return new BPromise(function(_0x114092,_0x40c852){return client[_0x9270('0x12')](_0x4b27fa,_0x5bad7f)['then'](function(_0x2af577){logger['info']('FaxQueue,\x20%s,\x20%s',_0x5cf04c,_0x9270('0x13'));logger['debug'](_0x9270('0x14'),_0x5cf04c,'request\x20sent',JSON[_0x9270('0x15')](_0x2af577));if(_0x2af577[_0x9270('0x16')]){if(_0x2af577[_0x9270('0x16')][_0x9270('0x17')]===0x1f4){logger['error'](_0x9270('0x18'),_0x5cf04c,_0x2af577[_0x9270('0x16')][_0x9270('0x19')]);return _0x40c852(_0x2af577[_0x9270('0x16')][_0x9270('0x19')]);}logger[_0x9270('0x16')](_0x9270('0x18'),_0x5cf04c,_0x2af577[_0x9270('0x16')][_0x9270('0x19')]);return _0x114092(_0x2af577[_0x9270('0x16')][_0x9270('0x19')]);}else{logger[_0x9270('0x1a')](_0x9270('0x18'),_0x5cf04c,_0x9270('0x13'));_0x114092(_0x2af577['result'][_0x9270('0x19')]);}})[_0x9270('0x1b')](function(_0x50e7d2){logger['error'](_0x9270('0x18'),_0x5cf04c,_0x50e7d2);_0x40c852(_0x50e7d2);});});}exports[_0x9270('0x1c')]=function(_0x13a456){var _0x4126a4=this;return new Promise(function(_0xcaa578,_0x4bec82){return db[_0x9270('0x1d')]['findAll']({'raw':_0x13a456[_0x9270('0x1e')]?_0x13a456[_0x9270('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x13a456['options']?_0x13a456['options'][_0x9270('0x1f')]||null:null,'attributes':_0x13a456[_0x9270('0x1e')]?_0x13a456['options']['attributes']||null:null,'limit':_0x13a456[_0x9270('0x1e')]?_0x13a456[_0x9270('0x1e')][_0x9270('0x20')]||null:null,'include':_0x13a456[_0x9270('0x1e')]?_0x13a456[_0x9270('0x1e')][_0x9270('0x21')]?_['map'](_0x13a456[_0x9270('0x1e')]['include'],function(_0x33c12a){return{'model':db[_0x33c12a['model']],'as':_0x33c12a['as'],'attributes':_0x33c12a[_0x9270('0x22')],'include':_0x33c12a[_0x9270('0x21')]?_['map'](_0x33c12a[_0x9270('0x21')],function(_0x47f30a){return{'model':db[_0x47f30a[_0x9270('0x23')]],'as':_0x47f30a['as'],'attributes':_0x47f30a[_0x9270('0x22')],'include':_0x47f30a[_0x9270('0x21')]?_['map'](_0x47f30a[_0x9270('0x21')],function(_0x357706){return{'model':db[_0x357706['model']],'as':_0x357706['as'],'attributes':_0x357706[_0x9270('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9270('0x24')](function(_0x42ad55){logger[_0x9270('0x1a')](_0x9270('0x1c'),_0x13a456);logger[_0x9270('0x25')](_0x9270('0x1c'),_0x13a456,JSON['stringify'](_0x42ad55));_0xcaa578(_0x42ad55);})['catch'](function(_0x31aab1){logger['error'](_0x9270('0x1c'),_0x31aab1[_0x9270('0x19')],_0x13a456);_0x4bec82(_0x4126a4[_0x9270('0x16')](0x1f4,_0x31aab1[_0x9270('0x19')]));});});};exports[_0x9270('0x26')]=function(_0x2b04fe){var _0x321e83=this;return new Promise(function(_0x523c97,_0x1f6d1a){return db[_0x9270('0x1d')]['find']({'raw':_0x2b04fe[_0x9270('0x1e')]?_0x2b04fe[_0x9270('0x1e')][_0x9270('0x27')]===undefined?!![]:![]:!![],'where':_0x2b04fe[_0x9270('0x1e')]?_0x2b04fe[_0x9270('0x1e')][_0x9270('0x1f')]||null:null,'attributes':_0x2b04fe[_0x9270('0x1e')]?_0x2b04fe['options'][_0x9270('0x22')]||null:null,'include':_0x2b04fe[_0x9270('0x1e')]?_0x2b04fe['options'][_0x9270('0x21')]?_[_0x9270('0x28')](_0x2b04fe[_0x9270('0x1e')][_0x9270('0x21')],function(_0x2a56ae){return{'model':db[_0x2a56ae['model']],'as':_0x2a56ae['as'],'attributes':_0x2a56ae['attributes'],'include':_0x2a56ae[_0x9270('0x21')]?_['map'](_0x2a56ae[_0x9270('0x21')],function(_0x1e9152){return{'model':db[_0x1e9152[_0x9270('0x23')]],'as':_0x1e9152['as'],'attributes':_0x1e9152[_0x9270('0x22')],'include':_0x1e9152['include']?_['map'](_0x1e9152[_0x9270('0x21')],function(_0x177ed7){return{'model':db[_0x177ed7[_0x9270('0x23')]],'as':_0x177ed7['as'],'attributes':_0x177ed7[_0x9270('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9270('0x24')](function(_0x50178f){logger[_0x9270('0x1a')]('ShowFaxQueue',_0x2b04fe);logger['debug'](_0x9270('0x26'),_0x2b04fe,JSON[_0x9270('0x15')](_0x50178f));_0x523c97(_0x50178f);})['catch'](function(_0xd6a05f){logger['error'](_0x9270('0x26'),_0xd6a05f[_0x9270('0x19')],_0x2b04fe);_0x1f6d1a(_0x321e83[_0x9270('0x16')](0x1f4,_0xd6a05f[_0x9270('0x19')]));});});}; \ No newline at end of file +var _0x4cc1=['register','then','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxQueue,\x20%s,\x20%s','message','info','catch','GetFaxQueue','FaxQueue','findAll','raw','options','where','attributes','limit','map','include','model','stringify','ShowFaxQueue','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x4cc1,0x151));var _0x14cc=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0x4cc1[_0x49b14d];return _0x3d2488;};'use strict';var _=require(_0x14cc('0x0'));var util=require('util');var moment=require(_0x14cc('0x1'));var BPromise=require('bluebird');var rs=require(_0x14cc('0x2'));var fs=require('fs');var Redis=require(_0x14cc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14cc('0x4'));var logger=require(_0x14cc('0x5'))(_0x14cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x14cc('0x7'));var client=jayson[_0x14cc('0x8')]['http']({'port':0x232a});config['redis']=_[_0x14cc('0x9')](config[_0x14cc('0xa')],{'host':_0x14cc('0xb'),'port':0x18eb});var socket=require(_0x14cc('0xc'))(new Redis(config[_0x14cc('0xa')]));require(_0x14cc('0xd'))[_0x14cc('0xe')](socket);function respondWithRpcPromise(_0x5d2950,_0x315dcd,_0x343ee2){return new BPromise(function(_0x5031c2,_0x42d97c){return client['request'](_0x5d2950,_0x343ee2)[_0x14cc('0xf')](function(_0x45e6b6){logger['info']('FaxQueue,\x20%s,\x20%s',_0x315dcd,'request\x20sent');logger[_0x14cc('0x10')](_0x14cc('0x11'),_0x315dcd,_0x14cc('0x12'),JSON['stringify'](_0x45e6b6));if(_0x45e6b6['error']){if(_0x45e6b6[_0x14cc('0x13')][_0x14cc('0x14')]===0x1f4){logger[_0x14cc('0x13')](_0x14cc('0x15'),_0x315dcd,_0x45e6b6[_0x14cc('0x13')][_0x14cc('0x16')]);return _0x42d97c(_0x45e6b6['error'][_0x14cc('0x16')]);}logger[_0x14cc('0x13')](_0x14cc('0x15'),_0x315dcd,_0x45e6b6[_0x14cc('0x13')][_0x14cc('0x16')]);return _0x5031c2(_0x45e6b6[_0x14cc('0x13')][_0x14cc('0x16')]);}else{logger[_0x14cc('0x17')](_0x14cc('0x15'),_0x315dcd,_0x14cc('0x12'));_0x5031c2(_0x45e6b6['result']['message']);}})[_0x14cc('0x18')](function(_0x4b8116){logger[_0x14cc('0x13')]('FaxQueue,\x20%s,\x20%s',_0x315dcd,_0x4b8116);_0x42d97c(_0x4b8116);});});}exports[_0x14cc('0x19')]=function(_0x255320){var _0x681a20=this;return new Promise(function(_0x3a8c21,_0x155d37){return db[_0x14cc('0x1a')][_0x14cc('0x1b')]({'raw':_0x255320['options']?_0x255320['options'][_0x14cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x255320[_0x14cc('0x1d')]?_0x255320[_0x14cc('0x1d')][_0x14cc('0x1e')]||null:null,'attributes':_0x255320[_0x14cc('0x1d')]?_0x255320[_0x14cc('0x1d')][_0x14cc('0x1f')]||null:null,'limit':_0x255320['options']?_0x255320[_0x14cc('0x1d')][_0x14cc('0x20')]||null:null,'include':_0x255320['options']?_0x255320['options']['include']?_[_0x14cc('0x21')](_0x255320['options'][_0x14cc('0x22')],function(_0x3eba34){return{'model':db[_0x3eba34[_0x14cc('0x23')]],'as':_0x3eba34['as'],'attributes':_0x3eba34['attributes'],'include':_0x3eba34[_0x14cc('0x22')]?_[_0x14cc('0x21')](_0x3eba34[_0x14cc('0x22')],function(_0x4d77ae){return{'model':db[_0x4d77ae[_0x14cc('0x23')]],'as':_0x4d77ae['as'],'attributes':_0x4d77ae[_0x14cc('0x1f')],'include':_0x4d77ae['include']?_[_0x14cc('0x21')](_0x4d77ae[_0x14cc('0x22')],function(_0x49ded6){return{'model':db[_0x49ded6['model']],'as':_0x49ded6['as'],'attributes':_0x49ded6[_0x14cc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x14cc('0xf')](function(_0x47a82b){logger[_0x14cc('0x17')](_0x14cc('0x19'),_0x255320);logger[_0x14cc('0x10')](_0x14cc('0x19'),_0x255320,JSON[_0x14cc('0x24')](_0x47a82b));_0x3a8c21(_0x47a82b);})[_0x14cc('0x18')](function(_0x31b665){logger['error'](_0x14cc('0x19'),_0x31b665[_0x14cc('0x16')],_0x255320);_0x155d37(_0x681a20['error'](0x1f4,_0x31b665[_0x14cc('0x16')]));});});};exports[_0x14cc('0x25')]=function(_0x2cce56){var _0x330047=this;return new Promise(function(_0x13b948,_0x321484){return db[_0x14cc('0x1a')][_0x14cc('0x26')]({'raw':_0x2cce56['options']?_0x2cce56[_0x14cc('0x1d')][_0x14cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x2cce56[_0x14cc('0x1d')]?_0x2cce56[_0x14cc('0x1d')][_0x14cc('0x1e')]||null:null,'attributes':_0x2cce56[_0x14cc('0x1d')]?_0x2cce56['options'][_0x14cc('0x1f')]||null:null,'include':_0x2cce56[_0x14cc('0x1d')]?_0x2cce56['options'][_0x14cc('0x22')]?_[_0x14cc('0x21')](_0x2cce56[_0x14cc('0x1d')][_0x14cc('0x22')],function(_0x3a4873){return{'model':db[_0x3a4873[_0x14cc('0x23')]],'as':_0x3a4873['as'],'attributes':_0x3a4873[_0x14cc('0x1f')],'include':_0x3a4873[_0x14cc('0x22')]?_['map'](_0x3a4873[_0x14cc('0x22')],function(_0x43681a){return{'model':db[_0x43681a[_0x14cc('0x23')]],'as':_0x43681a['as'],'attributes':_0x43681a[_0x14cc('0x1f')],'include':_0x43681a[_0x14cc('0x22')]?_[_0x14cc('0x21')](_0x43681a[_0x14cc('0x22')],function(_0x15dfa9){return{'model':db[_0x15dfa9[_0x14cc('0x23')]],'as':_0x15dfa9['as'],'attributes':_0x15dfa9[_0x14cc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x14cc('0xf')](function(_0x45190b){logger['info'](_0x14cc('0x25'),_0x2cce56);logger[_0x14cc('0x10')]('ShowFaxQueue',_0x2cce56,JSON[_0x14cc('0x24')](_0x45190b));_0x13b948(_0x45190b);})[_0x14cc('0x18')](function(_0x50d681){logger[_0x14cc('0x13')](_0x14cc('0x25'),_0x50d681[_0x14cc('0x16')],_0x2cce56);_0x321484(_0x330047['error'](0x1f4,_0x50d681[_0x14cc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 78b5a47..c54c77f 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 _0x33c5=['remove','emit','removeListener','register','length','faxQueue:','save'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x33c5,0xe6));var _0x533c=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0x33c5[_0x599d7f];return _0x3346d3;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x533c('0x0'),_0x533c('0x1'),'update'];function createListener(_0x9dafa,_0x26b916){return function(_0x221e43){_0x26b916[_0x533c('0x2')](_0x9dafa,_0x221e43);};}function removeListener(_0x358127,_0x49609e){return function(){FaxQueueEvents[_0x533c('0x3')](_0x358127,_0x49609e);};}exports[_0x533c('0x4')]=function(_0x31d912){for(var _0x151732=0x0,_0x34ca89=events[_0x533c('0x5')];_0x151732<_0x34ca89;_0x151732++){var _0x3a009b=events[_0x151732];var _0x36d74e=createListener(_0x533c('0x6')+_0x3a009b,_0x31d912);FaxQueueEvents['on'](_0x3a009b,_0x36d74e);}}; \ No newline at end of file +var _0x7073=['removeListener','register','length','faxQueue:','./faxQueue.events','save','update','emit'];(function(_0x245690,_0x3bf938){var _0x3fb9a4=function(_0x3354b3){while(--_0x3354b3){_0x245690['push'](_0x245690['shift']());}};_0x3fb9a4(++_0x3bf938);}(_0x7073,0x114));var _0x3707=function(_0x523321,_0x5a0daf){_0x523321=_0x523321-0x0;var _0x44ab1b=_0x7073[_0x523321];return _0x44ab1b;};'use strict';var FaxQueueEvents=require(_0x3707('0x0'));var events=[_0x3707('0x1'),'remove',_0x3707('0x2')];function createListener(_0xe73a0a,_0x152539){return function(_0x33ff4a){_0x152539[_0x3707('0x3')](_0xe73a0a,_0x33ff4a);};}function removeListener(_0x420341,_0x21936c){return function(){FaxQueueEvents[_0x3707('0x4')](_0x420341,_0x21936c);};}exports[_0x3707('0x5')]=function(_0xee5c72){for(var _0x5d21c5=0x0,_0x58a1ee=events[_0x3707('0x6')];_0x5d21c5<_0x58a1ee;_0x5d21c5++){var _0x18b22f=events[_0x5d21c5];var _0x59873a=createListener(_0x3707('0x7')+_0x18b22f,_0xee5c72);FaxQueueEvents['on'](_0x18b22f,_0x59873a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 112a122..ece0588 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 _0x444e=['addAgents','put','update','delete','destroy','/:id/users','removeAgents','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post'];(function(_0x52ed01,_0x1b9fd9){var _0x630ace=function(_0x72e0db){while(--_0x72e0db){_0x52ed01['push'](_0x52ed01['shift']());}};_0x630ace(++_0x1b9fd9);}(_0x444e,0xe8));var _0xe444=function(_0x41c1db,_0x8cd877){_0x41c1db=_0x41c1db-0x0;var _0x599517=_0x444e[_0x41c1db];return _0x599517;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/members',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe444('0x7')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x10')]);router['post']('/',auth[_0xe444('0x8')](),controller['create']);router['post'](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['addTeams']);router[_0xe444('0x11')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x12')]);router[_0xe444('0x13')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x16')]);router[_0xe444('0x15')](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['removeTeams']);router[_0xe444('0x15')](_0xe444('0x17'),auth[_0xe444('0x8')](),controller[_0xe444('0x18')]);module['exports']=router; \ No newline at end of file +var _0x8cad=['./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20f339,_0x2f802c){var _0x2ceb10=function(_0x27cbef){while(--_0x27cbef){_0x20f339['push'](_0x20f339['shift']());}};_0x2ceb10(++_0x2f802c);}(_0x8cad,0xfe));var _0xd8ca=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8cad[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var path=require(_0xd8ca('0x2'));var timeout=require(_0xd8ca('0x3'));var express=require(_0xd8ca('0x4'));var router=express[_0xd8ca('0x5')]();var fs_extra=require(_0xd8ca('0x6'));var auth=require(_0xd8ca('0x7'));var interaction=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var controller=require(_0xd8ca('0xa'));router[_0xd8ca('0xb')]('/',auth[_0xd8ca('0xc')](),controller[_0xd8ca('0xd')]);router['get'](_0xd8ca('0xe'),auth[_0xd8ca('0xc')](),controller[_0xd8ca('0xf')]);router[_0xd8ca('0xb')](_0xd8ca('0x10'),auth['isAuthenticated'](),controller[_0xd8ca('0x11')]);router['get'](_0xd8ca('0x12'),auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x13')]);router[_0xd8ca('0xb')](_0xd8ca('0x14'),auth[_0xd8ca('0xc')](),controller['getTeams']);router[_0xd8ca('0xb')](_0xd8ca('0x15'),auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x16')]);router[_0xd8ca('0x17')]('/',auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x18')]);router[_0xd8ca('0x17')](_0xd8ca('0x14'),auth['isAuthenticated'](),controller[_0xd8ca('0x19')]);router[_0xd8ca('0x17')](_0xd8ca('0x15'),auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x1a')]);router[_0xd8ca('0x1b')](_0xd8ca('0x10'),auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x1c')]);router[_0xd8ca('0x1d')]('/:id',auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x1e')]);router[_0xd8ca('0x1d')](_0xd8ca('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xd8ca('0x1d')]('/:id/users',auth[_0xd8ca('0xc')](),controller[_0xd8ca('0x1f')]);module[_0xd8ca('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8a5348f..8d1dacd 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 _0x749a=['moment','sequelize','exports','STRING','DATE'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x749a,0xbe));var _0xa749=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x749a[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require(_0xa749('0x0'));var Sequelize=require(_0xa749('0x1'));module[_0xa749('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa749('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa749('0x4')]},'acceptAt':{'type':Sequelize[_0xa749('0x4')]},'exitAt':{'type':Sequelize[_0xa749('0x4')]},'reason':{'type':Sequelize[_0xa749('0x3')]}}; \ No newline at end of file +var _0xb65d=['STRING','DATE','sequelize','exports'];(function(_0x41c227,_0x418d5c){var _0x4b14c9=function(_0x29a1fe){while(--_0x29a1fe){_0x41c227['push'](_0x41c227['shift']());}};_0x4b14c9(++_0x418d5c);}(_0xb65d,0x7e));var _0xdb65=function(_0x243771,_0x4a6f28){_0x243771=_0x243771-0x0;var _0x26e4f6=_0xb65d[_0x243771];return _0x26e4f6;};'use strict';var moment=require('moment');var Sequelize=require(_0xdb65('0x0'));module[_0xdb65('0x1')]={'uniqueid':{'type':Sequelize[_0xdb65('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdb65('0x2')]},'joinAt':{'type':Sequelize[_0xdb65('0x3')]},'leaveAt':{'type':Sequelize[_0xdb65('0x3')]},'acceptAt':{'type':Sequelize[_0xdb65('0x3')]},'exitAt':{'type':Sequelize[_0xdb65('0x3')]},'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 dcb5760..3928aa5 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 _0xbde2=['reject','save','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','merge','options','create','body','destroy','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../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','count','limit','set','Content-Range'];(function(_0x2c5614,_0x418e40){var _0x218f0c=function(_0x3ef91e){while(--_0x3ef91e){_0x2c5614['push'](_0x2c5614['shift']());}};_0x218f0c(++_0x418e40);}(_0xbde2,0x7a));var _0x2bde=function(_0x4bf39f,_0xb071dc){_0x4bf39f=_0x4bf39f-0x0;var _0x2fca36=_0xbde2[_0x4bf39f];return _0x2fca36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2bde('0x0'));var zipdir=require(_0x2bde('0x1'));var jsonpatch=require(_0x2bde('0x2'));var rp=require('request-promise');var moment=require(_0x2bde('0x3'));var BPromise=require(_0x2bde('0x4'));var Mustache=require(_0x2bde('0x5'));var util=require('util');var path=require(_0x2bde('0x6'));var sox=require(_0x2bde('0x7'));var csv=require(_0x2bde('0x8'));var ejs=require(_0x2bde('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bde('0xa'));var squel=require(_0x2bde('0xb'));var crypto=require(_0x2bde('0xc'));var jsforce=require(_0x2bde('0xd'));var deskjs=require(_0x2bde('0xe'));var toCsv=require(_0x2bde('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2bde('0xf'));var qs=require(_0x2bde('0x10'));var as=require(_0x2bde('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bde('0x12'))(_0x2bde('0x13'));var utils=require(_0x2bde('0x14'));var config=require(_0x2bde('0x15'));var licenseUtil=require(_0x2bde('0x16'));var db=require(_0x2bde('0x17'))['db'];function respondWithStatusCode(_0x5c98f3,_0x62de8f){_0x62de8f=_0x62de8f||0xcc;return function(_0x5ba816){if(_0x5ba816){return _0x5c98f3[_0x2bde('0x18')](_0x62de8f);}return _0x5c98f3[_0x2bde('0x19')](_0x62de8f)[_0x2bde('0x1a')]();};}function respondWithResult(_0x22b48,_0x3441dd){_0x3441dd=_0x3441dd||0xc8;return function(_0x2583da){if(_0x2583da){return _0x22b48[_0x2bde('0x19')](_0x3441dd)[_0x2bde('0x1b')](_0x2583da);}};}function respondWithFilteredResult(_0xaa6cec,_0x1bfcda){return function(_0x329331){if(_0x329331){var _0x1b2958=typeof _0x1bfcda[_0x2bde('0x1c')]===_0x2bde('0x1d')&&typeof _0x1bfcda['limit']==='undefined';var _0x145aa3=_0x329331[_0x2bde('0x1e')];var _0x39da17=_0x1b2958?0x0:_0x1bfcda[_0x2bde('0x1c')];var _0x590e44=_0x1b2958?_0x329331[_0x2bde('0x1e')]:_0x1bfcda[_0x2bde('0x1c')]+_0x1bfcda[_0x2bde('0x1f')];var _0x34f820;if(_0x590e44>=_0x145aa3){_0x590e44=_0x145aa3;_0x34f820=0xc8;}else{_0x34f820=0xce;}_0xaa6cec[_0x2bde('0x19')](_0x34f820);return _0xaa6cec[_0x2bde('0x20')](_0x2bde('0x21'),_0x39da17+'-'+_0x590e44+'/'+_0x145aa3)[_0x2bde('0x1b')](_0x329331);}return null;};}function patchUpdates(_0x58e640){return function(_0xe302eb){try{jsonpatch['apply'](_0xe302eb,_0x58e640,!![]);}catch(_0x560202){return BPromise[_0x2bde('0x22')](_0x560202);}return _0xe302eb[_0x2bde('0x23')]();};}function saveUpdates(_0x27b6e1,_0x481dd2){return function(_0x6c0da){if(_0x6c0da){return _0x6c0da[_0x2bde('0x24')](_0x27b6e1)[_0x2bde('0x25')](function(_0x5b4463){return _0x5b4463;});}return null;};}function removeEntity(_0x17d654,_0xc492e4){return function(_0x2479d7){if(_0x2479d7){return _0x2479d7['destroy']()['then'](function(){_0x17d654['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x109da2,_0x5100ca){return function(_0x24139d){if(!_0x24139d){_0x109da2[_0x2bde('0x18')](0x194);}return _0x24139d;};}function handleError(_0x44ad01,_0x27e62f){_0x27e62f=_0x27e62f||0x1f4;return function(_0x4d7371){logger[_0x2bde('0x26')](_0x4d7371[_0x2bde('0x27')]);if(_0x4d7371[_0x2bde('0x28')]){delete _0x4d7371['name'];}_0x44ad01[_0x2bde('0x19')](_0x27e62f)[_0x2bde('0x29')](_0x4d7371);};}exports[_0x2bde('0x2a')]=function(_0x336c7d,_0x800cc){var _0x435ce9={},_0x2b1eb6={},_0x4d668f={'count':0x0,'rows':[]};var _0x2e359e=_['map'](db[_0x2bde('0x2b')][_0x2bde('0x2c')],function(_0x2310b7){return{'name':_0x2310b7[_0x2bde('0x2d')],'type':_0x2310b7[_0x2bde('0x2e')][_0x2bde('0x2f')]};});_0x2b1eb6[_0x2bde('0x30')]=_[_0x2bde('0x31')](_0x2e359e,'name');_0x2b1eb6['query']=_[_0x2bde('0x32')](_0x336c7d[_0x2bde('0x33')]);_0x2b1eb6[_0x2bde('0x34')]=_[_0x2bde('0x35')](_0x2b1eb6[_0x2bde('0x30')],_0x2b1eb6[_0x2bde('0x33')]);_0x435ce9[_0x2bde('0x36')]=_['intersection'](_0x2b1eb6['model'],qs[_0x2bde('0x37')](_0x336c7d[_0x2bde('0x33')]['fields']));_0x435ce9[_0x2bde('0x36')]=_0x435ce9[_0x2bde('0x36')][_0x2bde('0x38')]?_0x435ce9[_0x2bde('0x36')]:_0x2b1eb6['model'];if(!_0x336c7d[_0x2bde('0x33')][_0x2bde('0x39')](_0x2bde('0x3a'))){_0x435ce9[_0x2bde('0x1f')]=qs[_0x2bde('0x1f')](_0x336c7d[_0x2bde('0x33')]['limit']);_0x435ce9[_0x2bde('0x1c')]=qs['offset'](_0x336c7d[_0x2bde('0x33')][_0x2bde('0x1c')]);}_0x435ce9[_0x2bde('0x3b')]=qs[_0x2bde('0x3c')](_0x336c7d['query'][_0x2bde('0x3c')]);_0x435ce9['where']=qs[_0x2bde('0x34')](_[_0x2bde('0x3d')](_0x336c7d[_0x2bde('0x33')],_0x2b1eb6['filters']),_0x2e359e);if(_0x336c7d['query'][_0x2bde('0x3e')]){_0x435ce9[_0x2bde('0x3f')]=_['merge'](_0x435ce9[_0x2bde('0x3f')],{'$or':_['map'](_0x2e359e,function(_0x802dd2){if(_0x802dd2['type']!==_0x2bde('0x40')){var _0x38ba97={};_0x38ba97[_0x802dd2[_0x2bde('0x28')]]={'$like':'%'+_0x336c7d['query'][_0x2bde('0x3e')]+'%'};return _0x38ba97;}})});}_0x435ce9=_['merge']({},_0x435ce9,_0x336c7d['options']);var _0x25d3e5={'where':_0x435ce9[_0x2bde('0x3f')]};return db[_0x2bde('0x2b')][_0x2bde('0x1e')](_0x25d3e5)[_0x2bde('0x25')](function(_0x3bda09){_0x4d668f[_0x2bde('0x1e')]=_0x3bda09;if(_0x336c7d[_0x2bde('0x33')][_0x2bde('0x41')]){_0x435ce9[_0x2bde('0x42')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x2bde('0x43')](_0x435ce9);})['then'](function(_0x5b8760){_0x4d668f[_0x2bde('0x44')]=_0x5b8760;return _0x4d668f;})['then'](respondWithFilteredResult(_0x800cc,_0x435ce9))[_0x2bde('0x45')](handleError(_0x800cc,null));};exports['show']=function(_0x399068,_0x505a46){var _0x28dc9c={'raw':!![],'where':{'id':_0x399068['params']['id']}},_0x2eb305={};_0x2eb305[_0x2bde('0x30')]=_['keys'](db['FaxQueueReport'][_0x2bde('0x2c')]);_0x2eb305['query']=_[_0x2bde('0x32')](_0x399068[_0x2bde('0x33')]);_0x2eb305['filters']=_['intersection'](_0x2eb305[_0x2bde('0x30')],_0x2eb305[_0x2bde('0x33')]);_0x28dc9c[_0x2bde('0x36')]=_[_0x2bde('0x35')](_0x2eb305[_0x2bde('0x30')],qs[_0x2bde('0x37')](_0x399068['query'][_0x2bde('0x37')]));_0x28dc9c[_0x2bde('0x36')]=_0x28dc9c[_0x2bde('0x36')][_0x2bde('0x38')]?_0x28dc9c['attributes']:_0x2eb305[_0x2bde('0x30')];if(_0x399068[_0x2bde('0x33')][_0x2bde('0x41')]){_0x28dc9c[_0x2bde('0x42')]=[{'all':!![]}];}_0x28dc9c=_[_0x2bde('0x46')]({},_0x28dc9c,_0x399068[_0x2bde('0x47')]);return db['FaxQueueReport']['find'](_0x28dc9c)['then'](handleEntityNotFound(_0x505a46,null))[_0x2bde('0x25')](respondWithResult(_0x505a46,null))[_0x2bde('0x45')](handleError(_0x505a46,null));};exports['create']=function(_0x1b90af,_0x5e716e){return db[_0x2bde('0x2b')][_0x2bde('0x48')](_0x1b90af[_0x2bde('0x49')],{})[_0x2bde('0x25')](respondWithResult(_0x5e716e,0xc9))['catch'](handleError(_0x5e716e,null));};exports[_0x2bde('0x24')]=function(_0x39cf8e,_0x5932fb){if(_0x39cf8e['body']['id']){delete _0x39cf8e[_0x2bde('0x49')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x39cf8e['params']['id']}})[_0x2bde('0x25')](handleEntityNotFound(_0x5932fb,null))[_0x2bde('0x25')](saveUpdates(_0x39cf8e[_0x2bde('0x49')],null))['then'](respondWithResult(_0x5932fb,null))['catch'](handleError(_0x5932fb,null));};exports[_0x2bde('0x4a')]=function(_0x490038,_0x13ae87){return db[_0x2bde('0x2b')][_0x2bde('0x4b')]({'where':{'id':_0x490038[_0x2bde('0x4c')]['id']}})[_0x2bde('0x25')](handleEntityNotFound(_0x13ae87,null))['then'](removeEntity(_0x13ae87,null))[_0x2bde('0x45')](handleError(_0x13ae87,null));};exports[_0x2bde('0x4d')]=function(_0x453c37,_0x17b8b7){return db['FaxQueueReport']['describe']()[_0x2bde('0x25')](respondWithResult(_0x17b8b7,null))[_0x2bde('0x45')](handleError(_0x17b8b7,null));}; \ No newline at end of file +var _0xf257=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','FaxQueueReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','keys','body','find','params','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x569ab2,_0xd19ef1){var _0x480709=function(_0x180416){while(--_0x180416){_0x569ab2['push'](_0x569ab2['shift']());}};_0x480709(++_0xd19ef1);}(_0xf257,0x82));var _0x7f25=function(_0x224012,_0x293e50){_0x224012=_0x224012-0x0;var _0x544142=_0xf257[_0x224012];return _0x544142;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f25('0x0'));var jsonpatch=require(_0x7f25('0x1'));var rp=require(_0x7f25('0x2'));var moment=require(_0x7f25('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7f25('0x4'));var util=require(_0x7f25('0x5'));var path=require(_0x7f25('0x6'));var sox=require(_0x7f25('0x7'));var csv=require(_0x7f25('0x8'));var ejs=require(_0x7f25('0x9'));var fs=require('fs');var fs_extra=require(_0x7f25('0xa'));var _=require(_0x7f25('0xb'));var squel=require(_0x7f25('0xc'));var crypto=require(_0x7f25('0xd'));var jsforce=require(_0x7f25('0xe'));var deskjs=require(_0x7f25('0xf'));var toCsv=require(_0x7f25('0x8'));var querystring=require(_0x7f25('0x10'));var Papa=require('papaparse');var Redis=require(_0x7f25('0x11'));var authService=require(_0x7f25('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f25('0x13'));var logger=require('../../config/logger')(_0x7f25('0x14'));var utils=require(_0x7f25('0x15'));var config=require(_0x7f25('0x16'));var licenseUtil=require(_0x7f25('0x17'));var db=require(_0x7f25('0x18'))['db'];function respondWithStatusCode(_0x1f7549,_0x2c960f){_0x2c960f=_0x2c960f||0xcc;return function(_0x5993ea){if(_0x5993ea){return _0x1f7549['sendStatus'](_0x2c960f);}return _0x1f7549[_0x7f25('0x19')](_0x2c960f)['end']();};}function respondWithResult(_0x397398,_0x19b76b){_0x19b76b=_0x19b76b||0xc8;return function(_0x3f8ed9){if(_0x3f8ed9){return _0x397398[_0x7f25('0x19')](_0x19b76b)[_0x7f25('0x1a')](_0x3f8ed9);}};}function respondWithFilteredResult(_0x4e00bf,_0x48778d){return function(_0x4eb36e){if(_0x4eb36e){var _0x3b5424=typeof _0x48778d[_0x7f25('0x1b')]===_0x7f25('0x1c')&&typeof _0x48778d[_0x7f25('0x1d')]===_0x7f25('0x1c');var _0x7cb17f=_0x4eb36e[_0x7f25('0x1e')];var _0x26d4aa=_0x3b5424?0x0:_0x48778d['offset'];var _0x23f30c=_0x3b5424?_0x4eb36e[_0x7f25('0x1e')]:_0x48778d[_0x7f25('0x1b')]+_0x48778d[_0x7f25('0x1d')];var _0x1647b9;if(_0x23f30c>=_0x7cb17f){_0x23f30c=_0x7cb17f;_0x1647b9=0xc8;}else{_0x1647b9=0xce;}_0x4e00bf[_0x7f25('0x19')](_0x1647b9);return _0x4e00bf['set']('Content-Range',_0x26d4aa+'-'+_0x23f30c+'/'+_0x7cb17f)[_0x7f25('0x1a')](_0x4eb36e);}return null;};}function patchUpdates(_0x57275e){return function(_0x18f978){try{jsonpatch[_0x7f25('0x1f')](_0x18f978,_0x57275e,!![]);}catch(_0x30be2f){return BPromise[_0x7f25('0x20')](_0x30be2f);}return _0x18f978[_0x7f25('0x21')]();};}function saveUpdates(_0x225948,_0x31bf5f){return function(_0x4be8b8){if(_0x4be8b8){return _0x4be8b8[_0x7f25('0x22')](_0x225948)[_0x7f25('0x23')](function(_0x456d84){return _0x456d84;});}return null;};}function removeEntity(_0x152fe9,_0x29039a){return function(_0x4955e0){if(_0x4955e0){return _0x4955e0[_0x7f25('0x24')]()[_0x7f25('0x23')](function(){_0x152fe9[_0x7f25('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b38c,_0x5372eb){return function(_0x467650){if(!_0x467650){_0x17b38c[_0x7f25('0x25')](0x194);}return _0x467650;};}function handleError(_0x217032,_0x1dad21){_0x1dad21=_0x1dad21||0x1f4;return function(_0x382fd4){logger[_0x7f25('0x26')](_0x382fd4[_0x7f25('0x27')]);if(_0x382fd4[_0x7f25('0x28')]){delete _0x382fd4[_0x7f25('0x28')];}_0x217032[_0x7f25('0x19')](_0x1dad21)['send'](_0x382fd4);};}exports['index']=function(_0x3a6b2f,_0x756b80){var _0x4934b4={},_0xa373ee={},_0x340f1b={'count':0x0,'rows':[]};var _0x2bc378=_[_0x7f25('0x29')](db[_0x7f25('0x2a')][_0x7f25('0x2b')],function(_0x574099){return{'name':_0x574099[_0x7f25('0x2c')],'type':_0x574099['type'][_0x7f25('0x2d')]};});_0xa373ee['model']=_[_0x7f25('0x29')](_0x2bc378,_0x7f25('0x28'));_0xa373ee[_0x7f25('0x2e')]=_['keys'](_0x3a6b2f[_0x7f25('0x2e')]);_0xa373ee[_0x7f25('0x2f')]=_[_0x7f25('0x30')](_0xa373ee[_0x7f25('0x31')],_0xa373ee[_0x7f25('0x2e')]);_0x4934b4[_0x7f25('0x32')]=_[_0x7f25('0x30')](_0xa373ee[_0x7f25('0x31')],qs['fields'](_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x33')]));_0x4934b4[_0x7f25('0x32')]=_0x4934b4[_0x7f25('0x32')][_0x7f25('0x34')]?_0x4934b4['attributes']:_0xa373ee['model'];if(!_0x3a6b2f['query'][_0x7f25('0x35')](_0x7f25('0x36'))){_0x4934b4[_0x7f25('0x1d')]=qs['limit'](_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x1d')]);_0x4934b4['offset']=qs[_0x7f25('0x1b')](_0x3a6b2f['query'][_0x7f25('0x1b')]);}_0x4934b4[_0x7f25('0x37')]=qs['sort'](_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x38')]);_0x4934b4[_0x7f25('0x39')]=qs[_0x7f25('0x2f')](_[_0x7f25('0x3a')](_0x3a6b2f[_0x7f25('0x2e')],_0xa373ee['filters']),_0x2bc378);if(_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x3b')]){_0x4934b4[_0x7f25('0x39')]=_['merge'](_0x4934b4[_0x7f25('0x39')],{'$or':_[_0x7f25('0x29')](_0x2bc378,function(_0x20f363){if(_0x20f363[_0x7f25('0x3c')]!==_0x7f25('0x3d')){var _0x51707b={};_0x51707b[_0x20f363[_0x7f25('0x28')]]={'$like':'%'+_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x3b')]+'%'};return _0x51707b;}})});}_0x4934b4=_[_0x7f25('0x3e')]({},_0x4934b4,_0x3a6b2f[_0x7f25('0x3f')]);var _0x237afc={'where':_0x4934b4[_0x7f25('0x39')]};return db[_0x7f25('0x2a')]['count'](_0x237afc)[_0x7f25('0x23')](function(_0x51d950){_0x340f1b[_0x7f25('0x1e')]=_0x51d950;if(_0x3a6b2f[_0x7f25('0x2e')][_0x7f25('0x40')]){_0x4934b4[_0x7f25('0x41')]=[{'all':!![]}];}return db[_0x7f25('0x2a')]['findAll'](_0x4934b4);})[_0x7f25('0x23')](function(_0x4de40f){_0x340f1b['rows']=_0x4de40f;return _0x340f1b;})['then'](respondWithFilteredResult(_0x756b80,_0x4934b4))[_0x7f25('0x42')](handleError(_0x756b80,null));};exports['show']=function(_0x2edc70,_0x169bc4){var _0x138439={'raw':!![],'where':{'id':_0x2edc70['params']['id']}},_0x4b1ba1={};_0x4b1ba1[_0x7f25('0x31')]=_[_0x7f25('0x43')](db[_0x7f25('0x2a')][_0x7f25('0x2b')]);_0x4b1ba1['query']=_[_0x7f25('0x43')](_0x2edc70['query']);_0x4b1ba1['filters']=_['intersection'](_0x4b1ba1[_0x7f25('0x31')],_0x4b1ba1['query']);_0x138439[_0x7f25('0x32')]=_[_0x7f25('0x30')](_0x4b1ba1[_0x7f25('0x31')],qs[_0x7f25('0x33')](_0x2edc70[_0x7f25('0x2e')][_0x7f25('0x33')]));_0x138439['attributes']=_0x138439[_0x7f25('0x32')]['length']?_0x138439['attributes']:_0x4b1ba1[_0x7f25('0x31')];if(_0x2edc70[_0x7f25('0x2e')][_0x7f25('0x40')]){_0x138439[_0x7f25('0x41')]=[{'all':!![]}];}_0x138439=_[_0x7f25('0x3e')]({},_0x138439,_0x2edc70[_0x7f25('0x3f')]);return db[_0x7f25('0x2a')]['find'](_0x138439)['then'](handleEntityNotFound(_0x169bc4,null))[_0x7f25('0x23')](respondWithResult(_0x169bc4,null))[_0x7f25('0x42')](handleError(_0x169bc4,null));};exports['create']=function(_0x177411,_0xc5875a){return db[_0x7f25('0x2a')]['create'](_0x177411[_0x7f25('0x44')],{})['then'](respondWithResult(_0xc5875a,0xc9))[_0x7f25('0x42')](handleError(_0xc5875a,null));};exports[_0x7f25('0x22')]=function(_0x390905,_0x4a372c){if(_0x390905[_0x7f25('0x44')]['id']){delete _0x390905[_0x7f25('0x44')]['id'];}return db[_0x7f25('0x2a')][_0x7f25('0x45')]({'where':{'id':_0x390905['params']['id']}})[_0x7f25('0x23')](handleEntityNotFound(_0x4a372c,null))[_0x7f25('0x23')](saveUpdates(_0x390905[_0x7f25('0x44')],null))['then'](respondWithResult(_0x4a372c,null))[_0x7f25('0x42')](handleError(_0x4a372c,null));};exports['destroy']=function(_0x4b277c,_0x5677ec){return db['FaxQueueReport']['find']({'where':{'id':_0x4b277c[_0x7f25('0x46')]['id']}})[_0x7f25('0x23')](handleEntityNotFound(_0x5677ec,null))[_0x7f25('0x23')](removeEntity(_0x5677ec,null))[_0x7f25('0x42')](handleError(_0x5677ec,null));};exports['describe']=function(_0x4f8bd1,_0x1aa6d3){return db[_0x7f25('0x2a')][_0x7f25('0x47')]()['then'](respondWithResult(_0x1aa6d3,null))[_0x7f25('0x42')](handleError(_0x1aa6d3,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c05e5b2..b7cf6c8 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x814b,0x1a2));var _0xb814=function(_0x3ba57e,_0x2e6810){_0x3ba57e=_0x3ba57e-0x0;var _0x5d95cf=_0x814b[_0x3ba57e];return _0x5d95cf;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x34fd8e,_0x4f98ba){var _0x33f9fb=function(_0x5c380e){while(--_0x5c380e){_0x34fd8e['push'](_0x34fd8e['shift']());}};_0x33f9fb(++_0x4f98ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 43530fe..cb900da 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 _0xea39=['body','options','UpdateFaxQueueReport','update','raw','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0xf7e9c3,_0x4d2536){var _0x17bdb8=function(_0x2ba7c3){while(--_0x2ba7c3){_0xf7e9c3['push'](_0xf7e9c3['shift']());}};_0x17bdb8(++_0x4d2536);}(_0xea39,0xb5));var _0x9ea3=function(_0x15a57d,_0x4471ae){_0x15a57d=_0x15a57d-0x0;var _0x639ee2=_0xea39[_0x15a57d];return _0x639ee2;};'use strict';var _=require(_0x9ea3('0x0'));var util=require('util');var moment=require(_0x9ea3('0x1'));var BPromise=require(_0x9ea3('0x2'));var rs=require(_0x9ea3('0x3'));var fs=require('fs');var Redis=require(_0x9ea3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ea3('0x5'));var logger=require(_0x9ea3('0x6'))(_0x9ea3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9ea3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54b64e,_0x1c0112,_0x632f8f){return new BPromise(function(_0x4beb41,_0x51587b){return client['request'](_0x54b64e,_0x632f8f)[_0x9ea3('0x9')](function(_0x4c4e5a){logger[_0x9ea3('0xa')](_0x9ea3('0xb'),_0x1c0112,_0x9ea3('0xc'));logger[_0x9ea3('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1c0112,_0x9ea3('0xc'),JSON[_0x9ea3('0xe')](_0x4c4e5a));if(_0x4c4e5a[_0x9ea3('0xf')]){if(_0x4c4e5a[_0x9ea3('0xf')]['code']===0x1f4){logger[_0x9ea3('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x1c0112,_0x4c4e5a[_0x9ea3('0xf')]['message']);return _0x51587b(_0x4c4e5a[_0x9ea3('0xf')]['message']);}logger[_0x9ea3('0xf')](_0x9ea3('0xb'),_0x1c0112,_0x4c4e5a[_0x9ea3('0xf')]['message']);return _0x4beb41(_0x4c4e5a['error'][_0x9ea3('0x10')]);}else{logger[_0x9ea3('0xa')](_0x9ea3('0xb'),_0x1c0112,_0x9ea3('0xc'));_0x4beb41(_0x4c4e5a[_0x9ea3('0x11')][_0x9ea3('0x10')]);}})[_0x9ea3('0x12')](function(_0xf12c44){logger[_0x9ea3('0xf')](_0x9ea3('0xb'),_0x1c0112,_0xf12c44);_0x51587b(_0xf12c44);});});}exports[_0x9ea3('0x13')]=function(_0x11b0f6){var _0x37cdc9=this;return new Promise(function(_0x5086de,_0x58c49b){return db[_0x9ea3('0x14')][_0x9ea3('0x15')](_0x11b0f6[_0x9ea3('0x16')],{'raw':_0x11b0f6['options']?_0x11b0f6[_0x9ea3('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9ea3('0x9')](function(_0x3c3060){logger['info'](_0x9ea3('0x13'),_0x11b0f6);logger[_0x9ea3('0xd')](_0x9ea3('0x13'),_0x11b0f6,JSON[_0x9ea3('0xe')](_0x3c3060));_0x5086de(_0x3c3060);})[_0x9ea3('0x12')](function(_0x5705e0){logger[_0x9ea3('0xf')](_0x9ea3('0x13'),_0x5705e0[_0x9ea3('0x10')],_0x11b0f6);_0x58c49b(_0x37cdc9[_0x9ea3('0xf')](0x1f4,_0x5705e0['message']));});});};exports[_0x9ea3('0x18')]=function(_0x11a77c){var _0x226932=this;return new Promise(function(_0x11dfdc,_0x5d0dc1){return db[_0x9ea3('0x14')][_0x9ea3('0x19')](_0x11a77c['body'],{'raw':_0x11a77c[_0x9ea3('0x17')]?_0x11a77c['options'][_0x9ea3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11a77c[_0x9ea3('0x17')]?_0x11a77c[_0x9ea3('0x17')]['where']||null:null,'attributes':_0x11a77c[_0x9ea3('0x17')]?_0x11a77c['options'][_0x9ea3('0x1b')]||null:null,'limit':_0x11a77c[_0x9ea3('0x17')]?_0x11a77c[_0x9ea3('0x17')][_0x9ea3('0x1c')]||null:null})[_0x9ea3('0x9')](function(_0x1532c8){logger[_0x9ea3('0xa')]('UpdateFaxQueueReport',_0x11a77c);logger[_0x9ea3('0xd')](_0x9ea3('0x18'),_0x11a77c,JSON['stringify'](_0x1532c8));_0x11dfdc(_0x1532c8);})['catch'](function(_0x2a81db){logger[_0x9ea3('0xf')]('UpdateFaxQueueReport',_0x2a81db[_0x9ea3('0x10')],_0x11a77c);_0x5d0dc1(_0x226932[_0x9ea3('0xf')](0x1f4,_0x2a81db[_0x9ea3('0x10')]));});});}; \ No newline at end of file +var _0xa4f1=['info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','catch','update','where','attributes','limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','request','then'];(function(_0x3a28e2,_0x58325a){var _0xfd325a=function(_0xf77ee7){while(--_0xf77ee7){_0x3a28e2['push'](_0x3a28e2['shift']());}};_0xfd325a(++_0x58325a);}(_0xa4f1,0x16b));var _0x1a4f=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xa4f1[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x1a4f('0x0'));var util=require('util');var moment=require(_0x1a4f('0x1'));var BPromise=require(_0x1a4f('0x2'));var rs=require(_0x1a4f('0x3'));var fs=require('fs');var Redis=require(_0x1a4f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a4f('0x5'))(_0x1a4f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e67ee,_0x1c76af,_0x388d34){return new BPromise(function(_0x57b686,_0x19be69){return client[_0x1a4f('0x7')](_0x4e67ee,_0x388d34)[_0x1a4f('0x8')](function(_0x5d8bdc){logger[_0x1a4f('0x9')]('FaxQueueReport,\x20%s,\x20%s',_0x1c76af,_0x1a4f('0xa'));logger[_0x1a4f('0xb')](_0x1a4f('0xc'),_0x1c76af,'request\x20sent',JSON[_0x1a4f('0xd')](_0x5d8bdc));if(_0x5d8bdc[_0x1a4f('0xe')]){if(_0x5d8bdc[_0x1a4f('0xe')][_0x1a4f('0xf')]===0x1f4){logger['error'](_0x1a4f('0x10'),_0x1c76af,_0x5d8bdc['error']['message']);return _0x19be69(_0x5d8bdc[_0x1a4f('0xe')][_0x1a4f('0x11')]);}logger[_0x1a4f('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x1c76af,_0x5d8bdc['error'][_0x1a4f('0x11')]);return _0x57b686(_0x5d8bdc['error']['message']);}else{logger[_0x1a4f('0x9')](_0x1a4f('0x10'),_0x1c76af,_0x1a4f('0xa'));_0x57b686(_0x5d8bdc[_0x1a4f('0x12')][_0x1a4f('0x11')]);}})['catch'](function(_0x672d55){logger['error'](_0x1a4f('0x10'),_0x1c76af,_0x672d55);_0x19be69(_0x672d55);});});}exports[_0x1a4f('0x13')]=function(_0x3ca703){var _0x43089f=this;return new Promise(function(_0x251a7e,_0xa5908e){return db[_0x1a4f('0x14')][_0x1a4f('0x15')](_0x3ca703[_0x1a4f('0x16')],{'raw':_0x3ca703[_0x1a4f('0x17')]?_0x3ca703['options'][_0x1a4f('0x18')]===undefined?!![]:![]:!![]})[_0x1a4f('0x8')](function(_0x539a67){logger[_0x1a4f('0x9')](_0x1a4f('0x13'),_0x3ca703);logger['debug']('CreateFaxQueueReport',_0x3ca703,JSON[_0x1a4f('0xd')](_0x539a67));_0x251a7e(_0x539a67);})[_0x1a4f('0x19')](function(_0x118448){logger[_0x1a4f('0xe')](_0x1a4f('0x13'),_0x118448[_0x1a4f('0x11')],_0x3ca703);_0xa5908e(_0x43089f['error'](0x1f4,_0x118448[_0x1a4f('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x44b434){var _0x4bc5f8=this;return new Promise(function(_0x2e679c,_0x238e8){return db['FaxQueueReport'][_0x1a4f('0x1a')](_0x44b434[_0x1a4f('0x16')],{'raw':_0x44b434[_0x1a4f('0x17')]?_0x44b434[_0x1a4f('0x17')][_0x1a4f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44b434[_0x1a4f('0x17')]?_0x44b434[_0x1a4f('0x17')][_0x1a4f('0x1b')]||null:null,'attributes':_0x44b434[_0x1a4f('0x17')]?_0x44b434[_0x1a4f('0x17')][_0x1a4f('0x1c')]||null:null,'limit':_0x44b434[_0x1a4f('0x17')]?_0x44b434[_0x1a4f('0x17')][_0x1a4f('0x1d')]||null:null})['then'](function(_0x2c4420){logger[_0x1a4f('0x9')](_0x1a4f('0x1e'),_0x44b434);logger[_0x1a4f('0xb')](_0x1a4f('0x1e'),_0x44b434,JSON['stringify'](_0x2c4420));_0x2e679c(_0x2c4420);})[_0x1a4f('0x19')](function(_0x3b6e6f){logger[_0x1a4f('0xe')]('UpdateFaxQueueReport',_0x3b6e6f[_0x1a4f('0x11')],_0x44b434);_0x238e8(_0x4bc5f8[_0x1a4f('0xe')](0x1f4,_0x3b6e6f[_0x1a4f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 888901d..d7cd195 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 _0x5ffa=['post','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x21aded,_0x436277){var _0x5c0d40=function(_0x36aef2){while(--_0x36aef2){_0x21aded['push'](_0x21aded['shift']());}};_0x5c0d40(++_0x436277);}(_0x5ffa,0x7d));var _0xa5ff=function(_0x5acd67,_0x4a8ce6){_0x5acd67=_0x5acd67-0x0;var _0x357520=_0x5ffa[_0x5acd67];return _0x357520;};'use strict';var multer=require('multer');var util=require(_0xa5ff('0x0'));var path=require(_0xa5ff('0x1'));var timeout=require(_0xa5ff('0x2'));var express=require('express');var router=express[_0xa5ff('0x3')]();var fs_extra=require(_0xa5ff('0x4'));var auth=require(_0xa5ff('0x5'));var interaction=require(_0xa5ff('0x6'));var config=require('../../config/environment');var controller=require(_0xa5ff('0x7'));router['get']('/',auth[_0xa5ff('0x8')](),controller[_0xa5ff('0x9')]);router[_0xa5ff('0xa')](_0xa5ff('0xb'),auth['isAuthenticated'](),controller[_0xa5ff('0xc')]);router['get'](_0xa5ff('0xd'),auth[_0xa5ff('0x8')](),controller[_0xa5ff('0xe')]);router[_0xa5ff('0xf')]('/',auth[_0xa5ff('0x8')](),controller['create']);router[_0xa5ff('0x10')]('/:id',auth[_0xa5ff('0x8')](),controller[_0xa5ff('0x11')]);router[_0xa5ff('0x12')](_0xa5ff('0xd'),auth['isAuthenticated'](),controller[_0xa5ff('0x13')]);module['exports']=router; \ No newline at end of file +var _0x380e=['post','create','put','delete','exports','multer','util','path','express','fs-extra','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x107179,_0x46e138){var _0x31f40e=function(_0x5973c1){while(--_0x5973c1){_0x107179['push'](_0x107179['shift']());}};_0x31f40e(++_0x46e138);}(_0x380e,0x1b5));var _0xe380=function(_0x4d71d0,_0x34f52f){_0x4d71d0=_0x4d71d0-0x0;var _0x40a5b2=_0x380e[_0x4d71d0];return _0x40a5b2;};'use strict';var multer=require(_0xe380('0x0'));var util=require(_0xe380('0x1'));var path=require(_0xe380('0x2'));var timeout=require('connect-timeout');var express=require(_0xe380('0x3'));var router=express['Router']();var fs_extra=require(_0xe380('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xe380('0x5')]('/',auth['isAuthenticated'](),controller[_0xe380('0x6')]);router[_0xe380('0x5')](_0xe380('0x7'),auth[_0xe380('0x8')](),controller[_0xe380('0x9')]);router[_0xe380('0x5')](_0xe380('0xa'),auth[_0xe380('0x8')](),controller['show']);router[_0xe380('0xb')]('/',auth[_0xe380('0x8')](),controller[_0xe380('0xc')]);router[_0xe380('0xd')]('/:id',auth[_0xe380('0x8')](),controller['update']);router[_0xe380('0xe')](_0xe380('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe380('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 18d4239..837caae 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x19735e,_0x577b50){var _0x13f0e9=function(_0x5c7059){while(--_0x5c7059){_0x19735e['push'](_0x19735e['shift']());}};_0x13f0e9(++_0x577b50);}(_0xf4eb,0xec));var _0xbf4e=function(_0x238e77,_0x575a8c){_0x238e77=_0x238e77-0x0;var _0x1dddab=_0xf4eb[_0x238e77];return _0x1dddab;};'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(_0x48d386,_0x40adbe){var _0x32f347=function(_0x10bfa8){while(--_0x10bfa8){_0x48d386['push'](_0x48d386['shift']());}};_0x32f347(++_0x40adbe);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 69a711b..2d67b94 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 _0xde4b=['undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','findAll','rows','show','rawAttributes','length','includeAll','options','create','body','catch','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x12fede,_0x2e0c84){var _0x5673ef=function(_0x3e40e5){while(--_0x3e40e5){_0x12fede['push'](_0x12fede['shift']());}};_0x5673ef(++_0x2e0c84);}(_0xde4b,0x1a5));var _0xbde4=function(_0x5c77f0,_0x104fe5){_0x5c77f0=_0x5c77f0-0x0;var _0x5e8782=_0xde4b[_0x5c77f0];return _0x5e8782;};'use strict';var emlformat=require(_0xbde4('0x0'));var rimraf=require(_0xbde4('0x1'));var zipdir=require(_0xbde4('0x2'));var jsonpatch=require(_0xbde4('0x3'));var rp=require('request-promise');var moment=require(_0xbde4('0x4'));var BPromise=require(_0xbde4('0x5'));var Mustache=require('mustache');var util=require(_0xbde4('0x6'));var path=require(_0xbde4('0x7'));var sox=require(_0xbde4('0x8'));var csv=require(_0xbde4('0x9'));var ejs=require(_0xbde4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbde4('0xb'));var squel=require(_0xbde4('0xc'));var crypto=require(_0xbde4('0xd'));var jsforce=require(_0xbde4('0xe'));var deskjs=require(_0xbde4('0xf'));var toCsv=require(_0xbde4('0x9'));var querystring=require(_0xbde4('0x10'));var Papa=require(_0xbde4('0x11'));var Redis=require('ioredis');var authService=require(_0xbde4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbde4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbde4('0x14'))('api');var utils=require(_0xbde4('0x15'));var config=require(_0xbde4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbde4('0x17'))['db'];function respondWithStatusCode(_0xebaa9f,_0x6a7264){_0x6a7264=_0x6a7264||0xcc;return function(_0x3e758f){if(_0x3e758f){return _0xebaa9f[_0xbde4('0x18')](_0x6a7264);}return _0xebaa9f[_0xbde4('0x19')](_0x6a7264)[_0xbde4('0x1a')]();};}function respondWithResult(_0x495005,_0x26159e){_0x26159e=_0x26159e||0xc8;return function(_0x533a66){if(_0x533a66){return _0x495005[_0xbde4('0x19')](_0x26159e)[_0xbde4('0x1b')](_0x533a66);}};}function respondWithFilteredResult(_0x5402e7,_0xc9c55e){return function(_0x23f0ed){if(_0x23f0ed){var _0x3a687b=typeof _0xc9c55e[_0xbde4('0x1c')]===_0xbde4('0x1d')&&typeof _0xc9c55e[_0xbde4('0x1e')]===_0xbde4('0x1d');var _0x2c312f=_0x23f0ed[_0xbde4('0x1f')];var _0x20bc89=_0x3a687b?0x0:_0xc9c55e['offset'];var _0x3408e1=_0x3a687b?_0x23f0ed[_0xbde4('0x1f')]:_0xc9c55e[_0xbde4('0x1c')]+_0xc9c55e['limit'];var _0x392962;if(_0x3408e1>=_0x2c312f){_0x3408e1=_0x2c312f;_0x392962=0xc8;}else{_0x392962=0xce;}_0x5402e7['status'](_0x392962);return _0x5402e7[_0xbde4('0x20')](_0xbde4('0x21'),_0x20bc89+'-'+_0x3408e1+'/'+_0x2c312f)[_0xbde4('0x1b')](_0x23f0ed);}return null;};}function patchUpdates(_0x7054f0){return function(_0x47e30e){try{jsonpatch[_0xbde4('0x22')](_0x47e30e,_0x7054f0,!![]);}catch(_0x1b5ec9){return BPromise[_0xbde4('0x23')](_0x1b5ec9);}return _0x47e30e['save']();};}function saveUpdates(_0x403fd4,_0x55688a){return function(_0x3ee12b){if(_0x3ee12b){return _0x3ee12b[_0xbde4('0x24')](_0x403fd4)[_0xbde4('0x25')](function(_0x480e7e){return _0x480e7e;});}return null;};}function removeEntity(_0x11444f,_0x2f7dda){return function(_0x2c0da3){if(_0x2c0da3){return _0x2c0da3['destroy']()[_0xbde4('0x25')](function(){_0x11444f[_0xbde4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb7d1,_0xaf9d6a){return function(_0x12bc75){if(!_0x12bc75){_0x4fb7d1[_0xbde4('0x18')](0x194);}return _0x12bc75;};}function handleError(_0x36a8bf,_0x5550c8){_0x5550c8=_0x5550c8||0x1f4;return function(_0x272461){logger[_0xbde4('0x26')](_0x272461[_0xbde4('0x27')]);if(_0x272461[_0xbde4('0x28')]){delete _0x272461[_0xbde4('0x28')];}_0x36a8bf['status'](_0x5550c8)[_0xbde4('0x29')](_0x272461);};}exports['index']=function(_0x52cab6,_0x1aa547){var _0x3aff04={},_0xf00e12={},_0x8b27dd={'count':0x0,'rows':[]};var _0x1e9f2a=_['map'](db[_0xbde4('0x2a')]['rawAttributes'],function(_0x3d36f9){return{'name':_0x3d36f9[_0xbde4('0x2b')],'type':_0x3d36f9[_0xbde4('0x2c')][_0xbde4('0x2d')]};});_0xf00e12[_0xbde4('0x2e')]=_['map'](_0x1e9f2a,_0xbde4('0x28'));_0xf00e12[_0xbde4('0x2f')]=_[_0xbde4('0x30')](_0x52cab6[_0xbde4('0x2f')]);_0xf00e12[_0xbde4('0x31')]=_[_0xbde4('0x32')](_0xf00e12[_0xbde4('0x2e')],_0xf00e12[_0xbde4('0x2f')]);_0x3aff04['attributes']=_['intersection'](_0xf00e12[_0xbde4('0x2e')],qs['fields'](_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x33')]));_0x3aff04[_0xbde4('0x34')]=_0x3aff04[_0xbde4('0x34')]['length']?_0x3aff04[_0xbde4('0x34')]:_0xf00e12['model'];if(!_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x35')]('nolimit')){_0x3aff04[_0xbde4('0x1e')]=qs['limit'](_0x52cab6['query']['limit']);_0x3aff04['offset']=qs[_0xbde4('0x1c')](_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x1c')]);}_0x3aff04[_0xbde4('0x36')]=qs['sort'](_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x37')]);_0x3aff04[_0xbde4('0x38')]=qs[_0xbde4('0x31')](_[_0xbde4('0x39')](_0x52cab6[_0xbde4('0x2f')],_0xf00e12[_0xbde4('0x31')]),_0x1e9f2a);if(_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x3a')]){_0x3aff04[_0xbde4('0x38')]=_[_0xbde4('0x3b')](_0x3aff04[_0xbde4('0x38')],{'$or':_[_0xbde4('0x3c')](_0x1e9f2a,function(_0x29980c){if(_0x29980c['type']!==_0xbde4('0x3d')){var _0x1e1a1e={};_0x1e1a1e[_0x29980c['name']]={'$like':'%'+_0x52cab6[_0xbde4('0x2f')][_0xbde4('0x3a')]+'%'};return _0x1e1a1e;}})});}_0x3aff04=_[_0xbde4('0x3b')]({},_0x3aff04,_0x52cab6['options']);var _0x4d886f={'where':_0x3aff04['where']};return db[_0xbde4('0x2a')][_0xbde4('0x1f')](_0x4d886f)[_0xbde4('0x25')](function(_0x5ac19c){_0x8b27dd[_0xbde4('0x1f')]=_0x5ac19c;if(_0x52cab6[_0xbde4('0x2f')]['includeAll']){_0x3aff04['include']=[{'all':!![]}];}return db[_0xbde4('0x2a')][_0xbde4('0x3e')](_0x3aff04);})['then'](function(_0x381036){_0x8b27dd[_0xbde4('0x3f')]=_0x381036;return _0x8b27dd;})[_0xbde4('0x25')](respondWithFilteredResult(_0x1aa547,_0x3aff04))['catch'](handleError(_0x1aa547,null));};exports[_0xbde4('0x40')]=function(_0x3323fb,_0x26e58f){var _0x43b07d={'raw':!![],'where':{'id':_0x3323fb['params']['id']}},_0x5e3d7b={};_0x5e3d7b[_0xbde4('0x2e')]=_[_0xbde4('0x30')](db[_0xbde4('0x2a')][_0xbde4('0x41')]);_0x5e3d7b[_0xbde4('0x2f')]=_[_0xbde4('0x30')](_0x3323fb[_0xbde4('0x2f')]);_0x5e3d7b[_0xbde4('0x31')]=_[_0xbde4('0x32')](_0x5e3d7b[_0xbde4('0x2e')],_0x5e3d7b[_0xbde4('0x2f')]);_0x43b07d['attributes']=_[_0xbde4('0x32')](_0x5e3d7b[_0xbde4('0x2e')],qs[_0xbde4('0x33')](_0x3323fb[_0xbde4('0x2f')][_0xbde4('0x33')]));_0x43b07d['attributes']=_0x43b07d['attributes'][_0xbde4('0x42')]?_0x43b07d[_0xbde4('0x34')]:_0x5e3d7b[_0xbde4('0x2e')];if(_0x3323fb[_0xbde4('0x2f')][_0xbde4('0x43')]){_0x43b07d['include']=[{'all':!![]}];}_0x43b07d=_['merge']({},_0x43b07d,_0x3323fb[_0xbde4('0x44')]);return db['FaxTransferReport']['find'](_0x43b07d)[_0xbde4('0x25')](handleEntityNotFound(_0x26e58f,null))[_0xbde4('0x25')](respondWithResult(_0x26e58f,null))['catch'](handleError(_0x26e58f,null));};exports[_0xbde4('0x45')]=function(_0x169e32,_0x7a7142){return db[_0xbde4('0x2a')][_0xbde4('0x45')](_0x169e32[_0xbde4('0x46')],{})[_0xbde4('0x25')](respondWithResult(_0x7a7142,0xc9))[_0xbde4('0x47')](handleError(_0x7a7142,null));};exports[_0xbde4('0x24')]=function(_0x3d03ff,_0x43f7dc){if(_0x3d03ff['body']['id']){delete _0x3d03ff[_0xbde4('0x46')]['id'];}return db['FaxTransferReport'][_0xbde4('0x48')]({'where':{'id':_0x3d03ff[_0xbde4('0x49')]['id']}})[_0xbde4('0x25')](handleEntityNotFound(_0x43f7dc,null))[_0xbde4('0x25')](saveUpdates(_0x3d03ff[_0xbde4('0x46')],null))[_0xbde4('0x25')](respondWithResult(_0x43f7dc,null))[_0xbde4('0x47')](handleError(_0x43f7dc,null));};exports['destroy']=function(_0x523363,_0x479950){return db[_0xbde4('0x2a')]['find']({'where':{'id':_0x523363[_0xbde4('0x49')]['id']}})[_0xbde4('0x25')](handleEntityNotFound(_0x479950,null))['then'](removeEntity(_0x479950,null))[_0xbde4('0x47')](handleError(_0x479950,null));};exports[_0xbde4('0x4a')]=function(_0x5f03de,_0x2b9c27){return db[_0xbde4('0x2a')][_0xbde4('0x4a')]()['then'](respondWithResult(_0x2b9c27,null))[_0xbde4('0x47')](handleError(_0x2b9c27,null));}; \ No newline at end of file +var _0x1b3e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','reject','save','update','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','describe','eml-format','rimraf'];(function(_0xabb0df,_0x479913){var _0xd67f28=function(_0x2f198e){while(--_0x2f198e){_0xabb0df['push'](_0xabb0df['shift']());}};_0xd67f28(++_0x479913);}(_0x1b3e,0xeb));var _0xe1b3=function(_0x1f10f1,_0x235ff2){_0x1f10f1=_0x1f10f1-0x0;var _0x555d81=_0x1b3e[_0x1f10f1];return _0x555d81;};'use strict';var emlformat=require(_0xe1b3('0x0'));var rimraf=require(_0xe1b3('0x1'));var zipdir=require(_0xe1b3('0x2'));var jsonpatch=require(_0xe1b3('0x3'));var rp=require(_0xe1b3('0x4'));var moment=require(_0xe1b3('0x5'));var BPromise=require(_0xe1b3('0x6'));var Mustache=require(_0xe1b3('0x7'));var util=require(_0xe1b3('0x8'));var path=require(_0xe1b3('0x9'));var sox=require(_0xe1b3('0xa'));var csv=require(_0xe1b3('0xb'));var ejs=require(_0xe1b3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1b3('0xd'));var squel=require(_0xe1b3('0xe'));var crypto=require(_0xe1b3('0xf'));var jsforce=require(_0xe1b3('0x10'));var deskjs=require(_0xe1b3('0x11'));var toCsv=require(_0xe1b3('0xb'));var querystring=require(_0xe1b3('0x12'));var Papa=require(_0xe1b3('0x13'));var Redis=require(_0xe1b3('0x14'));var authService=require(_0xe1b3('0x15'));var qs=require(_0xe1b3('0x16'));var as=require(_0xe1b3('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1b3('0x18'))(_0xe1b3('0x19'));var utils=require(_0xe1b3('0x1a'));var config=require(_0xe1b3('0x1b'));var licenseUtil=require(_0xe1b3('0x1c'));var db=require(_0xe1b3('0x1d'))['db'];function respondWithStatusCode(_0x358f00,_0x421310){_0x421310=_0x421310||0xcc;return function(_0x2159a6){if(_0x2159a6){return _0x358f00['sendStatus'](_0x421310);}return _0x358f00['status'](_0x421310)[_0xe1b3('0x1e')]();};}function respondWithResult(_0x13321f,_0x2b33bd){_0x2b33bd=_0x2b33bd||0xc8;return function(_0xbc815a){if(_0xbc815a){return _0x13321f[_0xe1b3('0x1f')](_0x2b33bd)['json'](_0xbc815a);}};}function respondWithFilteredResult(_0x4b5bba,_0x69cab1){return function(_0x3ae8ac){if(_0x3ae8ac){var _0x34b7a6=typeof _0x69cab1[_0xe1b3('0x20')]===_0xe1b3('0x21')&&typeof _0x69cab1['limit']===_0xe1b3('0x21');var _0x383658=_0x3ae8ac[_0xe1b3('0x22')];var _0x4fd43e=_0x34b7a6?0x0:_0x69cab1['offset'];var _0x140d9a=_0x34b7a6?_0x3ae8ac[_0xe1b3('0x22')]:_0x69cab1[_0xe1b3('0x20')]+_0x69cab1[_0xe1b3('0x23')];var _0x56b79e;if(_0x140d9a>=_0x383658){_0x140d9a=_0x383658;_0x56b79e=0xc8;}else{_0x56b79e=0xce;}_0x4b5bba[_0xe1b3('0x1f')](_0x56b79e);return _0x4b5bba[_0xe1b3('0x24')]('Content-Range',_0x4fd43e+'-'+_0x140d9a+'/'+_0x383658)['json'](_0x3ae8ac);}return null;};}function patchUpdates(_0xd1c38d){return function(_0x1a5494){try{jsonpatch['apply'](_0x1a5494,_0xd1c38d,!![]);}catch(_0x1a3a9d){return BPromise[_0xe1b3('0x25')](_0x1a3a9d);}return _0x1a5494[_0xe1b3('0x26')]();};}function saveUpdates(_0x4e25fe,_0x5802f7){return function(_0x563e0c){if(_0x563e0c){return _0x563e0c[_0xe1b3('0x27')](_0x4e25fe)[_0xe1b3('0x28')](function(_0x280b2c){return _0x280b2c;});}return null;};}function removeEntity(_0x2a1d2c,_0x59520b){return function(_0x37f8d7){if(_0x37f8d7){return _0x37f8d7['destroy']()[_0xe1b3('0x28')](function(){_0x2a1d2c[_0xe1b3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fa83e,_0x31cc8e){return function(_0x21d492){if(!_0x21d492){_0x2fa83e['sendStatus'](0x194);}return _0x21d492;};}function handleError(_0x1beae5,_0x44d584){_0x44d584=_0x44d584||0x1f4;return function(_0x1ab602){logger[_0xe1b3('0x29')](_0x1ab602[_0xe1b3('0x2a')]);if(_0x1ab602[_0xe1b3('0x2b')]){delete _0x1ab602[_0xe1b3('0x2b')];}_0x1beae5['status'](_0x44d584)[_0xe1b3('0x2c')](_0x1ab602);};}exports[_0xe1b3('0x2d')]=function(_0x240fa5,_0xb82da6){var _0x678ebc={},_0x3c7d74={},_0x5e1662={'count':0x0,'rows':[]};var _0x19d079=_[_0xe1b3('0x2e')](db[_0xe1b3('0x2f')][_0xe1b3('0x30')],function(_0x31efd8){return{'name':_0x31efd8[_0xe1b3('0x31')],'type':_0x31efd8['type'][_0xe1b3('0x32')]};});_0x3c7d74[_0xe1b3('0x33')]=_[_0xe1b3('0x2e')](_0x19d079,_0xe1b3('0x2b'));_0x3c7d74['query']=_[_0xe1b3('0x34')](_0x240fa5[_0xe1b3('0x35')]);_0x3c7d74[_0xe1b3('0x36')]=_[_0xe1b3('0x37')](_0x3c7d74['model'],_0x3c7d74[_0xe1b3('0x35')]);_0x678ebc['attributes']=_[_0xe1b3('0x37')](_0x3c7d74[_0xe1b3('0x33')],qs['fields'](_0x240fa5[_0xe1b3('0x35')][_0xe1b3('0x38')]));_0x678ebc[_0xe1b3('0x39')]=_0x678ebc[_0xe1b3('0x39')][_0xe1b3('0x3a')]?_0x678ebc[_0xe1b3('0x39')]:_0x3c7d74['model'];if(!_0x240fa5[_0xe1b3('0x35')][_0xe1b3('0x3b')](_0xe1b3('0x3c'))){_0x678ebc['limit']=qs[_0xe1b3('0x23')](_0x240fa5[_0xe1b3('0x35')][_0xe1b3('0x23')]);_0x678ebc[_0xe1b3('0x20')]=qs[_0xe1b3('0x20')](_0x240fa5[_0xe1b3('0x35')][_0xe1b3('0x20')]);}_0x678ebc['order']=qs[_0xe1b3('0x3d')](_0x240fa5['query']['sort']);_0x678ebc[_0xe1b3('0x3e')]=qs[_0xe1b3('0x36')](_[_0xe1b3('0x3f')](_0x240fa5[_0xe1b3('0x35')],_0x3c7d74[_0xe1b3('0x36')]),_0x19d079);if(_0x240fa5['query'][_0xe1b3('0x40')]){_0x678ebc['where']=_[_0xe1b3('0x41')](_0x678ebc[_0xe1b3('0x3e')],{'$or':_[_0xe1b3('0x2e')](_0x19d079,function(_0x44fd20){if(_0x44fd20['type']!==_0xe1b3('0x42')){var _0x58d841={};_0x58d841[_0x44fd20[_0xe1b3('0x2b')]]={'$like':'%'+_0x240fa5[_0xe1b3('0x35')]['filter']+'%'};return _0x58d841;}})});}_0x678ebc=_[_0xe1b3('0x41')]({},_0x678ebc,_0x240fa5['options']);var _0x2fd1b0={'where':_0x678ebc[_0xe1b3('0x3e')]};return db[_0xe1b3('0x2f')][_0xe1b3('0x22')](_0x2fd1b0)[_0xe1b3('0x28')](function(_0x2f969d){_0x5e1662[_0xe1b3('0x22')]=_0x2f969d;if(_0x240fa5['query'][_0xe1b3('0x43')]){_0x678ebc['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xe1b3('0x44')](_0x678ebc);})[_0xe1b3('0x28')](function(_0x5be996){_0x5e1662[_0xe1b3('0x45')]=_0x5be996;return _0x5e1662;})[_0xe1b3('0x28')](respondWithFilteredResult(_0xb82da6,_0x678ebc))['catch'](handleError(_0xb82da6,null));};exports[_0xe1b3('0x46')]=function(_0x417aac,_0x1645a8){var _0x2511f2={'raw':!![],'where':{'id':_0x417aac[_0xe1b3('0x47')]['id']}},_0x4d5fbc={};_0x4d5fbc[_0xe1b3('0x33')]=_[_0xe1b3('0x34')](db['FaxTransferReport'][_0xe1b3('0x30')]);_0x4d5fbc[_0xe1b3('0x35')]=_[_0xe1b3('0x34')](_0x417aac['query']);_0x4d5fbc['filters']=_[_0xe1b3('0x37')](_0x4d5fbc['model'],_0x4d5fbc[_0xe1b3('0x35')]);_0x2511f2['attributes']=_[_0xe1b3('0x37')](_0x4d5fbc[_0xe1b3('0x33')],qs[_0xe1b3('0x38')](_0x417aac[_0xe1b3('0x35')][_0xe1b3('0x38')]));_0x2511f2[_0xe1b3('0x39')]=_0x2511f2[_0xe1b3('0x39')]['length']?_0x2511f2['attributes']:_0x4d5fbc[_0xe1b3('0x33')];if(_0x417aac['query']['includeAll']){_0x2511f2[_0xe1b3('0x48')]=[{'all':!![]}];}_0x2511f2=_['merge']({},_0x2511f2,_0x417aac['options']);return db[_0xe1b3('0x2f')][_0xe1b3('0x49')](_0x2511f2)['then'](handleEntityNotFound(_0x1645a8,null))['then'](respondWithResult(_0x1645a8,null))[_0xe1b3('0x4a')](handleError(_0x1645a8,null));};exports[_0xe1b3('0x4b')]=function(_0x29e552,_0x523ba0){return db['FaxTransferReport'][_0xe1b3('0x4b')](_0x29e552['body'],{})[_0xe1b3('0x28')](respondWithResult(_0x523ba0,0xc9))['catch'](handleError(_0x523ba0,null));};exports['update']=function(_0x27f131,_0x1a7559){if(_0x27f131['body']['id']){delete _0x27f131[_0xe1b3('0x4c')]['id'];}return db[_0xe1b3('0x2f')][_0xe1b3('0x49')]({'where':{'id':_0x27f131['params']['id']}})[_0xe1b3('0x28')](handleEntityNotFound(_0x1a7559,null))[_0xe1b3('0x28')](saveUpdates(_0x27f131[_0xe1b3('0x4c')],null))[_0xe1b3('0x28')](respondWithResult(_0x1a7559,null))['catch'](handleError(_0x1a7559,null));};exports[_0xe1b3('0x4d')]=function(_0x4446cb,_0x369b24){return db[_0xe1b3('0x2f')]['find']({'where':{'id':_0x4446cb[_0xe1b3('0x47')]['id']}})[_0xe1b3('0x28')](handleEntityNotFound(_0x369b24,null))[_0xe1b3('0x28')](removeEntity(_0x369b24,null))[_0xe1b3('0x4a')](handleError(_0x369b24,null));};exports[_0xe1b3('0x4e')]=function(_0x569101,_0x51cefa){return db['FaxTransferReport']['describe']()[_0xe1b3('0x28')](respondWithResult(_0x51cefa,null))[_0xe1b3('0x4a')](handleError(_0x51cefa,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f401545..1b0db87 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 _0x06fb=['bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4a91e2,_0x439f8d){var _0x293414=function(_0x537429){while(--_0x537429){_0x4a91e2['push'](_0x4a91e2['shift']());}};_0x293414(++_0x439f8d);}(_0x06fb,0x1ad));var _0xb06f=function(_0x19bc5c,_0x4eaac0){_0x19bc5c=_0x19bc5c-0x0;var _0x58c6b0=_0x06fb[_0x19bc5c];return _0x58c6b0;};'use strict';var _=require(_0xb06f('0x0'));var util=require(_0xb06f('0x1'));var logger=require(_0xb06f('0x2'))(_0xb06f('0x3'));var moment=require(_0xb06f('0x4'));var BPromise=require(_0xb06f('0x5'));var rp=require(_0xb06f('0x6'));var fs=require('fs');var path=require(_0xb06f('0x7'));var rimraf=require(_0xb06f('0x8'));var config=require(_0xb06f('0x9'));var attributes=require('./faxTransferReport.attributes');module[_0xb06f('0xa')]=function(_0x2691f6,_0x64ef35){return _0x2691f6['define'](_0xb06f('0xb'),attributes,{'tableName':_0xb06f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb06f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98ad=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x671ef4,_0x263eec){var _0x2eda02=function(_0x393d0c){while(--_0x393d0c){_0x671ef4['push'](_0x671ef4['shift']());}};_0x2eda02(++_0x263eec);}(_0x98ad,0x1c1));var _0xd98a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x98ad[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd98a('0x0'));var util=require('util');var logger=require(_0xd98a('0x1'))('api');var moment=require(_0xd98a('0x2'));var BPromise=require(_0xd98a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd98a('0x4'));var rimraf=require(_0xd98a('0x5'));var config=require(_0xd98a('0x6'));var attributes=require(_0xd98a('0x7'));module[_0xd98a('0x8')]=function(_0x5afb5b,_0x14d7a4){return _0x5afb5b[_0xd98a('0x9')](_0xd98a('0xa'),attributes,{'tableName':_0xd98a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd98a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ec87e53..1834323 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 _0x2ff2=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x52063b,_0x59cccc){var _0x317c8d=function(_0x522a7c){while(--_0x522a7c){_0x52063b['push'](_0x52063b['shift']());}};_0x317c8d(++_0x59cccc);}(_0x2ff2,0x1ca));var _0x22ff=function(_0x4cb086,_0x4cc048){_0x4cb086=_0x4cb086-0x0;var _0x10d1af=_0x2ff2[_0x4cb086];return _0x10d1af;};'use strict';var _=require(_0x22ff('0x0'));var util=require(_0x22ff('0x1'));var moment=require('moment');var BPromise=require(_0x22ff('0x2'));var rs=require(_0x22ff('0x3'));var fs=require('fs');var Redis=require(_0x22ff('0x4'));var db=require(_0x22ff('0x5'))['db'];var utils=require(_0x22ff('0x6'));var logger=require(_0x22ff('0x7'))(_0x22ff('0x8'));var config=require(_0x22ff('0x9'));var jayson=require(_0x22ff('0xa'));var client=jayson[_0x22ff('0xb')][_0x22ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3336bd,_0x3726b5,_0x1d8b03){return new BPromise(function(_0x1f2859,_0x5ef8d0){return client[_0x22ff('0xd')](_0x3336bd,_0x1d8b03)[_0x22ff('0xe')](function(_0xb9c42e){logger[_0x22ff('0xf')](_0x22ff('0x10'),_0x3726b5,_0x22ff('0x11'));logger[_0x22ff('0x12')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3726b5,_0x22ff('0x11'),JSON['stringify'](_0xb9c42e));if(_0xb9c42e[_0x22ff('0x13')]){if(_0xb9c42e[_0x22ff('0x13')][_0x22ff('0x14')]===0x1f4){logger[_0x22ff('0x13')](_0x22ff('0x10'),_0x3726b5,_0xb9c42e[_0x22ff('0x13')][_0x22ff('0x15')]);return _0x5ef8d0(_0xb9c42e[_0x22ff('0x13')][_0x22ff('0x15')]);}logger[_0x22ff('0x13')](_0x22ff('0x10'),_0x3726b5,_0xb9c42e[_0x22ff('0x13')][_0x22ff('0x15')]);return _0x1f2859(_0xb9c42e[_0x22ff('0x13')][_0x22ff('0x15')]);}else{logger['info'](_0x22ff('0x10'),_0x3726b5,_0x22ff('0x11'));_0x1f2859(_0xb9c42e[_0x22ff('0x16')][_0x22ff('0x15')]);}})[_0x22ff('0x17')](function(_0x4b884a){logger[_0x22ff('0x13')](_0x22ff('0x10'),_0x3726b5,_0x4b884a);_0x5ef8d0(_0x4b884a);});});} \ No newline at end of file +var _0x651a=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x651a,0x136));var _0xa651=function(_0x22f5ea,_0x3a6a30){_0x22f5ea=_0x22f5ea-0x0;var _0xe5955=_0x651a[_0x22f5ea];return _0xe5955;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa651('0x0'));var BPromise=require(_0xa651('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa651('0x2'));var db=require(_0xa651('0x3'))['db'];var utils=require(_0xa651('0x4'));var logger=require(_0xa651('0x5'))(_0xa651('0x6'));var config=require(_0xa651('0x7'));var jayson=require(_0xa651('0x8'));var client=jayson[_0xa651('0x9')][_0xa651('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286a0d,_0x234d5c,_0x285f64){return new BPromise(function(_0x396204,_0x361809){return client[_0xa651('0xb')](_0x286a0d,_0x285f64)[_0xa651('0xc')](function(_0x48f5df){logger[_0xa651('0xd')](_0xa651('0xe'),_0x234d5c,_0xa651('0xf'));logger[_0xa651('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x234d5c,'request\x20sent',JSON[_0xa651('0x11')](_0x48f5df));if(_0x48f5df[_0xa651('0x12')]){if(_0x48f5df[_0xa651('0x12')]['code']===0x1f4){logger[_0xa651('0x12')](_0xa651('0xe'),_0x234d5c,_0x48f5df[_0xa651('0x12')]['message']);return _0x361809(_0x48f5df[_0xa651('0x12')][_0xa651('0x13')]);}logger['error'](_0xa651('0xe'),_0x234d5c,_0x48f5df[_0xa651('0x12')][_0xa651('0x13')]);return _0x396204(_0x48f5df[_0xa651('0x12')][_0xa651('0x13')]);}else{logger[_0xa651('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x234d5c,_0xa651('0xf'));_0x396204(_0x48f5df[_0xa651('0x14')][_0xa651('0x13')]);}})[_0xa651('0x15')](function(_0x45e11c){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x234d5c,_0x45e11c);_0x361809(_0x45e11c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b7772f1..ccd3e60 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 _0xbc63=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put'];(function(_0x5e1019,_0x30d62c){var _0xdb88e9=function(_0x180e72){while(--_0x180e72){_0x5e1019['push'](_0x5e1019['shift']());}};_0xdb88e9(++_0x30d62c);}(_0xbc63,0xd6));var _0x3bc6=function(_0x3aa37f,_0x34e8e7){_0x3aa37f=_0x3aa37f-0x0;var _0x123a19=_0xbc63[_0x3aa37f];return _0x123a19;};'use strict';var multer=require(_0x3bc6('0x0'));var util=require(_0x3bc6('0x1'));var path=require(_0x3bc6('0x2'));var timeout=require(_0x3bc6('0x3'));var express=require(_0x3bc6('0x4'));var router=express[_0x3bc6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3bc6('0x6'));var interaction=require(_0x3bc6('0x7'));var config=require('../../config/environment');var controller=require(_0x3bc6('0x8'));router[_0x3bc6('0x9')]('/',auth[_0x3bc6('0xa')](),controller[_0x3bc6('0xb')]);router['get'](_0x3bc6('0xc'),auth[_0x3bc6('0xa')](),controller[_0x3bc6('0xd')]);router[_0x3bc6('0x9')]('/:id',auth[_0x3bc6('0xa')](),controller[_0x3bc6('0xe')]);router['post']('/',auth[_0x3bc6('0xa')](),controller[_0x3bc6('0xf')]);router[_0x3bc6('0x10')](_0x3bc6('0x11'),auth[_0x3bc6('0xa')](),controller['update']);router[_0x3bc6('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3bc6('0x13')]);module[_0x3bc6('0x14')]=router; \ No newline at end of file +var _0x21fd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x115a89,_0x24c57d){var _0x5945d9=function(_0x3c4916){while(--_0x3c4916){_0x115a89['push'](_0x115a89['shift']());}};_0x5945d9(++_0x24c57d);}(_0x21fd,0x178));var _0xd21f=function(_0x224395,_0x1fd5ca){_0x224395=_0x224395-0x0;var _0x12af33=_0x21fd[_0x224395];return _0x12af33;};'use strict';var multer=require(_0xd21f('0x0'));var util=require(_0xd21f('0x1'));var path=require(_0xd21f('0x2'));var timeout=require(_0xd21f('0x3'));var express=require(_0xd21f('0x4'));var router=express[_0xd21f('0x5')]();var fs_extra=require(_0xd21f('0x6'));var auth=require(_0xd21f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd21f('0x8'));var controller=require('./faxTransferReport.controller');router[_0xd21f('0x9')]('/',auth[_0xd21f('0xa')](),controller['index']);router[_0xd21f('0x9')]('/describe',auth[_0xd21f('0xa')](),controller['describe']);router[_0xd21f('0x9')](_0xd21f('0xb'),auth[_0xd21f('0xa')](),controller[_0xd21f('0xc')]);router['post']('/',auth[_0xd21f('0xa')](),controller[_0xd21f('0xd')]);router['put'](_0xd21f('0xb'),auth[_0xd21f('0xa')](),controller[_0xd21f('0xe')]);router[_0xd21f('0xf')]('/:id',auth[_0xd21f('0xa')](),controller[_0xd21f('0x10')]);module[_0xd21f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 04861c0..0f63124 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 _0x74a9=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete'];(function(_0x3ee5d1,_0x568984){var _0x220af6=function(_0x143307){while(--_0x143307){_0x3ee5d1['push'](_0x3ee5d1['shift']());}};_0x220af6(++_0x568984);}(_0x74a9,0xc2));var _0x974a=function(_0x2f5fea,_0x3ba2c0){_0x2f5fea=_0x2f5fea-0x0;var _0x36fe14=_0x74a9[_0x2f5fea];return _0x36fe14;};'use strict';var multer=require(_0x974a('0x0'));var util=require(_0x974a('0x1'));var path=require(_0x974a('0x2'));var timeout=require(_0x974a('0x3'));var express=require(_0x974a('0x4'));var router=express[_0x974a('0x5')]();var fs_extra=require(_0x974a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x974a('0x7'));var config=require(_0x974a('0x8'));var controller=require('./intDeskAccount.controller');router[_0x974a('0x9')]('/',auth[_0x974a('0xa')](),controller[_0x974a('0xb')]);router[_0x974a('0x9')](_0x974a('0xc'),auth['isAuthenticated'](),controller[_0x974a('0xd')]);router[_0x974a('0x9')]('/:id/configurations',auth[_0x974a('0xa')](),controller[_0x974a('0xe')]);router['get'](_0x974a('0xf'),auth[_0x974a('0xa')](),controller[_0x974a('0x10')]);router[_0x974a('0x11')]('/',auth[_0x974a('0xa')](),controller[_0x974a('0x12')]);router[_0x974a('0x11')](_0x974a('0x13'),auth[_0x974a('0xa')](),controller['addConfiguration']);router['put'](_0x974a('0xc'),auth[_0x974a('0xa')](),controller[_0x974a('0x14')]);router[_0x974a('0x15')]('/:id',auth[_0x974a('0xa')](),controller[_0x974a('0x16')]);module[_0x974a('0x17')]=router; \ No newline at end of file +var _0xd0f7=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x4a002e,_0x14a5f6){var _0xb86ae3=function(_0x10a189){while(--_0x10a189){_0x4a002e['push'](_0x4a002e['shift']());}};_0xb86ae3(++_0x14a5f6);}(_0xd0f7,0x144));var _0x7d0f=function(_0xf81267,_0x2f5d56){_0xf81267=_0xf81267-0x0;var _0x53a546=_0xd0f7[_0xf81267];return _0x53a546;};'use strict';var multer=require(_0x7d0f('0x0'));var util=require(_0x7d0f('0x1'));var path=require(_0x7d0f('0x2'));var timeout=require(_0x7d0f('0x3'));var express=require(_0x7d0f('0x4'));var router=express[_0x7d0f('0x5')]();var fs_extra=require(_0x7d0f('0x6'));var auth=require(_0x7d0f('0x7'));var interaction=require(_0x7d0f('0x8'));var config=require(_0x7d0f('0x9'));var controller=require(_0x7d0f('0xa'));router[_0x7d0f('0xb')]('/',auth[_0x7d0f('0xc')](),controller[_0x7d0f('0xd')]);router[_0x7d0f('0xb')](_0x7d0f('0xe'),auth[_0x7d0f('0xc')](),controller[_0x7d0f('0xf')]);router[_0x7d0f('0xb')](_0x7d0f('0x10'),auth[_0x7d0f('0xc')](),controller[_0x7d0f('0x11')]);router[_0x7d0f('0xb')](_0x7d0f('0x12'),auth[_0x7d0f('0xc')](),controller[_0x7d0f('0x13')]);router[_0x7d0f('0x14')]('/',auth[_0x7d0f('0xc')](),controller[_0x7d0f('0x15')]);router[_0x7d0f('0x14')](_0x7d0f('0x10'),auth[_0x7d0f('0xc')](),controller['addConfiguration']);router[_0x7d0f('0x16')](_0x7d0f('0xe'),auth[_0x7d0f('0xc')](),controller['update']);router[_0x7d0f('0x17')](_0x7d0f('0xe'),auth['isAuthenticated'](),controller[_0x7d0f('0x18')]);module[_0x7d0f('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 96e0947..b1dff6c 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 _0x9a0d=['STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x23eb8c,_0x5618e8){var _0x4978ba=function(_0x1512ed){while(--_0x1512ed){_0x23eb8c['push'](_0x23eb8c['shift']());}};_0x4978ba(++_0x5618e8);}(_0x9a0d,0x1a3));var _0xd9a0=function(_0x114c53,_0x2249c6){_0x114c53=_0x114c53-0x0;var _0x4e0c14=_0x9a0d[_0x114c53];return _0x4e0c14;};'use strict';var Sequelize=require(_0xd9a0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9a0('0x1')]},'description':{'type':Sequelize[_0xd9a0('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd9a0('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd9a0('0x1')]},'consumerKey':{'type':Sequelize[_0xd9a0('0x1')]},'consumerSecret':{'type':Sequelize[_0xd9a0('0x1')]},'token':{'type':Sequelize[_0xd9a0('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd9a0('0x2')]('integrationTab',_0xd9a0('0x3')),'defaultValue':_0xd9a0('0x4')}}; \ No newline at end of file +var _0x3fe9=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5811f0,_0x13ba47){var _0x3f7013=function(_0x5b9d11){while(--_0x5b9d11){_0x5811f0['push'](_0x5811f0['shift']());}};_0x3f7013(++_0x13ba47);}(_0x3fe9,0x9e));var _0x93fe=function(_0xb167ca,_0xb6c033){_0xb167ca=_0xb167ca-0x0;var _0x4ca8e4=_0x3fe9[_0xb167ca];return _0x4ca8e4;};'use strict';var Sequelize=require(_0x93fe('0x0'));module[_0x93fe('0x1')]={'name':{'type':Sequelize[_0x93fe('0x2')]},'description':{'type':Sequelize[_0x93fe('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x93fe('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x93fe('0x3')),'defaultValue':_0x93fe('0x3')},'password':{'type':Sequelize[_0x93fe('0x2')]},'consumerKey':{'type':Sequelize[_0x93fe('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x93fe('0x2')]},'tokenSecret':{'type':Sequelize[_0x93fe('0x2')]},'serverUrl':{'type':Sequelize[_0x93fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x93fe('0x4')](_0x93fe('0x5'),_0x93fe('0x6')),'defaultValue':_0x93fe('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index fc01f6a..8489a17 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 _0x0011=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','set','apply','reject','save','then','end','sendStatus','error','stack','name','index','map','DeskAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','count','includeAll','include','catch','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','rawAttributes','order','filter','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1f5e65,_0x1ee9f2){var _0x3cef31=function(_0x24c66c){while(--_0x24c66c){_0x1f5e65['push'](_0x1f5e65['shift']());}};_0x3cef31(++_0x1ee9f2);}(_0x0011,0x14d));var _0x1001=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0011[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x1001('0x0'));var rimraf=require(_0x1001('0x1'));var zipdir=require(_0x1001('0x2'));var jsonpatch=require(_0x1001('0x3'));var rp=require(_0x1001('0x4'));var moment=require('moment');var BPromise=require(_0x1001('0x5'));var Mustache=require(_0x1001('0x6'));var util=require(_0x1001('0x7'));var path=require(_0x1001('0x8'));var sox=require(_0x1001('0x9'));var csv=require(_0x1001('0xa'));var ejs=require(_0x1001('0xb'));var fs=require('fs');var fs_extra=require(_0x1001('0xc'));var _=require(_0x1001('0xd'));var squel=require(_0x1001('0xe'));var crypto=require(_0x1001('0xf'));var jsforce=require(_0x1001('0x10'));var deskjs=require(_0x1001('0x11'));var toCsv=require(_0x1001('0xa'));var querystring=require(_0x1001('0x12'));var Papa=require(_0x1001('0x13'));var Redis=require('ioredis');var authService=require(_0x1001('0x14'));var qs=require(_0x1001('0x15'));var as=require(_0x1001('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1001('0x17'))(_0x1001('0x18'));var utils=require(_0x1001('0x19'));var config=require(_0x1001('0x1a'));var licenseUtil=require(_0x1001('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1001('0x1c'));function respondWithStatusCode(_0x34ba99,_0x41e51f){_0x41e51f=_0x41e51f||0xcc;return function(_0x7e62f6){if(_0x7e62f6){return _0x34ba99['sendStatus'](_0x41e51f);}return _0x34ba99['status'](_0x41e51f)['end']();};}function respondWithResult(_0x799f20,_0x13fec3){_0x13fec3=_0x13fec3||0xc8;return function(_0x4684af){if(_0x4684af){return _0x799f20[_0x1001('0x1d')](_0x13fec3)[_0x1001('0x1e')](_0x4684af);}};}function respondWithFilteredResult(_0x29cb03,_0x4d72f7){return function(_0xc0693c){if(_0xc0693c){var _0x7f63ec=typeof _0x4d72f7[_0x1001('0x1f')]===_0x1001('0x20')&&typeof _0x4d72f7[_0x1001('0x21')]===_0x1001('0x20');var _0x1c9186=_0xc0693c['count'];var _0x29c943=_0x7f63ec?0x0:_0x4d72f7[_0x1001('0x1f')];var _0x18fa3a=_0x7f63ec?_0xc0693c['count']:_0x4d72f7['offset']+_0x4d72f7[_0x1001('0x21')];var _0x15b91d;if(_0x18fa3a>=_0x1c9186){_0x18fa3a=_0x1c9186;_0x15b91d=0xc8;}else{_0x15b91d=0xce;}_0x29cb03[_0x1001('0x1d')](_0x15b91d);return _0x29cb03[_0x1001('0x22')]('Content-Range',_0x29c943+'-'+_0x18fa3a+'/'+_0x1c9186)[_0x1001('0x1e')](_0xc0693c);}return null;};}function patchUpdates(_0x19d0e0){return function(_0x4fe5bf){try{jsonpatch[_0x1001('0x23')](_0x4fe5bf,_0x19d0e0,!![]);}catch(_0x3debd0){return BPromise[_0x1001('0x24')](_0x3debd0);}return _0x4fe5bf[_0x1001('0x25')]();};}function saveUpdates(_0x12cc6a,_0x424da2){return function(_0x4a0a61){if(_0x4a0a61){return _0x4a0a61['update'](_0x12cc6a)[_0x1001('0x26')](function(_0x5143ba){return _0x5143ba;});}return null;};}function removeEntity(_0x3ea4aa,_0x3667d1){return function(_0x4aa1a9){if(_0x4aa1a9){return _0x4aa1a9['destroy']()[_0x1001('0x26')](function(){_0x3ea4aa[_0x1001('0x1d')](0xcc)[_0x1001('0x27')]();});}};}function handleEntityNotFound(_0x1700c8,_0x250bff){return function(_0x5677db){if(!_0x5677db){_0x1700c8[_0x1001('0x28')](0x194);}return _0x5677db;};}function handleError(_0x455acf,_0x55a989){_0x55a989=_0x55a989||0x1f4;return function(_0x26b948){logger[_0x1001('0x29')](_0x26b948[_0x1001('0x2a')]);if(_0x26b948[_0x1001('0x2b')]){delete _0x26b948['name'];}_0x455acf['status'](_0x55a989)['send'](_0x26b948);};}exports[_0x1001('0x2c')]=function(_0x1025d7,_0x526632){var _0x18dd0d={},_0x5ebf7a={},_0x25b18d={'count':0x0,'rows':[]};var _0x349d56=_[_0x1001('0x2d')](db[_0x1001('0x2e')]['rawAttributes'],function(_0x2d461c){return{'name':_0x2d461c[_0x1001('0x2f')],'type':_0x2d461c[_0x1001('0x30')]['key']};});_0x5ebf7a[_0x1001('0x31')]=_['map'](_0x349d56,'name');_0x5ebf7a[_0x1001('0x32')]=_[_0x1001('0x33')](_0x1025d7['query']);_0x5ebf7a[_0x1001('0x34')]=_[_0x1001('0x35')](_0x5ebf7a['model'],_0x5ebf7a['query']);_0x18dd0d['attributes']=_[_0x1001('0x35')](_0x5ebf7a[_0x1001('0x31')],qs[_0x1001('0x36')](_0x1025d7[_0x1001('0x32')][_0x1001('0x36')]));_0x18dd0d['attributes']=_0x18dd0d[_0x1001('0x37')][_0x1001('0x38')]?_0x18dd0d[_0x1001('0x37')]:_0x5ebf7a[_0x1001('0x31')];if(!_0x1025d7[_0x1001('0x32')][_0x1001('0x39')](_0x1001('0x3a'))){_0x18dd0d['limit']=qs[_0x1001('0x21')](_0x1025d7[_0x1001('0x32')][_0x1001('0x21')]);_0x18dd0d[_0x1001('0x1f')]=qs[_0x1001('0x1f')](_0x1025d7[_0x1001('0x32')]['offset']);}_0x18dd0d['order']=qs[_0x1001('0x3b')](_0x1025d7[_0x1001('0x32')][_0x1001('0x3b')]);_0x18dd0d[_0x1001('0x3c')]=qs[_0x1001('0x34')](_[_0x1001('0x3d')](_0x1025d7[_0x1001('0x32')],_0x5ebf7a[_0x1001('0x34')]),_0x349d56);if(_0x1025d7[_0x1001('0x32')]['filter']){_0x18dd0d[_0x1001('0x3c')]=_[_0x1001('0x3e')](_0x18dd0d[_0x1001('0x3c')],{'$or':_[_0x1001('0x2d')](_0x349d56,function(_0x83dafe){if(_0x83dafe['type']!=='VIRTUAL'){var _0x1a25cc={};_0x1a25cc[_0x83dafe[_0x1001('0x2b')]]={'$like':'%'+_0x1025d7[_0x1001('0x32')]['filter']+'%'};return _0x1a25cc;}})});}_0x18dd0d=_['merge']({},_0x18dd0d,_0x1025d7[_0x1001('0x3f')]);var _0x2f1c24={'where':_0x18dd0d[_0x1001('0x3c')]};return db[_0x1001('0x2e')][_0x1001('0x40')](_0x2f1c24)[_0x1001('0x26')](function(_0x4b6de0){_0x25b18d[_0x1001('0x40')]=_0x4b6de0;if(_0x1025d7['query'][_0x1001('0x41')]){_0x18dd0d[_0x1001('0x42')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x18dd0d);})['then'](function(_0x4b2374){_0x25b18d['rows']=_0x4b2374;return _0x25b18d;})['then'](respondWithFilteredResult(_0x526632,_0x18dd0d))[_0x1001('0x43')](handleError(_0x526632,null));};exports[_0x1001('0x44')]=function(_0x2eed37,_0x50b814){var _0x2adae5={'raw':![],'where':{'id':_0x2eed37[_0x1001('0x45')]['id']}},_0x58eb70={};_0x58eb70[_0x1001('0x31')]=_['keys'](db[_0x1001('0x2e')]['rawAttributes']);_0x58eb70[_0x1001('0x32')]=_['keys'](_0x2eed37[_0x1001('0x32')]);_0x58eb70[_0x1001('0x34')]=_['intersection'](_0x58eb70[_0x1001('0x31')],_0x58eb70[_0x1001('0x32')]);_0x2adae5[_0x1001('0x37')]=_[_0x1001('0x35')](_0x58eb70[_0x1001('0x31')],qs['fields'](_0x2eed37[_0x1001('0x32')][_0x1001('0x36')]));_0x2adae5[_0x1001('0x37')]=_0x2adae5[_0x1001('0x37')][_0x1001('0x38')]?_0x2adae5['attributes']:_0x58eb70[_0x1001('0x31')];if(_0x2eed37[_0x1001('0x32')][_0x1001('0x41')]){_0x2adae5[_0x1001('0x42')]=[{'all':!![]}];}_0x2adae5=_['merge']({},_0x2adae5,_0x2eed37[_0x1001('0x3f')]);return db[_0x1001('0x2e')][_0x1001('0x46')](_0x2adae5)['then'](handleEntityNotFound(_0x50b814,null))['then'](respondWithResult(_0x50b814,null))['catch'](handleError(_0x50b814,null));};exports['create']=function(_0x5109d2,_0x10c148){return db['DeskAccount'][_0x1001('0x47')](_0x5109d2['body'],{})[_0x1001('0x26')](respondWithResult(_0x10c148,0xc9))[_0x1001('0x43')](handleError(_0x10c148,null));};exports['update']=function(_0x112bf9,_0x29f0be){if(_0x112bf9['body']['id']){delete _0x112bf9[_0x1001('0x48')]['id'];}return db[_0x1001('0x2e')][_0x1001('0x46')]({'where':{'id':_0x112bf9[_0x1001('0x45')]['id']}})[_0x1001('0x26')](handleEntityNotFound(_0x29f0be,null))[_0x1001('0x26')](saveUpdates(_0x112bf9[_0x1001('0x48')],null))['then'](respondWithResult(_0x29f0be,null))[_0x1001('0x43')](handleError(_0x29f0be,null));};exports[_0x1001('0x49')]=function(_0x9c7958,_0x82874a){return db[_0x1001('0x2e')][_0x1001('0x46')]({'where':{'id':_0x9c7958[_0x1001('0x45')]['id']}})[_0x1001('0x26')](handleEntityNotFound(_0x82874a,null))[_0x1001('0x26')](removeEntity(_0x82874a,null))['catch'](handleError(_0x82874a,null));};exports[_0x1001('0x4a')]=function(_0x121db9,_0x568ec7,_0x2b60a2){var _0x179714={};var _0x149843={};var _0x3f86fc;var _0x3bf080;return db[_0x1001('0x2e')][_0x1001('0x4b')]({'where':{'id':_0x121db9[_0x1001('0x45')]['id']}})[_0x1001('0x26')](handleEntityNotFound(_0x568ec7,null))[_0x1001('0x26')](function(_0x14d261){if(_0x14d261){_0x3f86fc=_0x14d261;_0x149843['model']=_['keys'](db[_0x1001('0x4c')][_0x1001('0x4d')]);_0x149843['query']=_[_0x1001('0x33')](_0x121db9[_0x1001('0x32')]);_0x149843[_0x1001('0x34')]=_[_0x1001('0x35')](_0x149843['model'],_0x149843[_0x1001('0x32')]);_0x179714['attributes']=_[_0x1001('0x35')](_0x149843[_0x1001('0x31')],qs[_0x1001('0x36')](_0x121db9[_0x1001('0x32')][_0x1001('0x36')]));_0x179714[_0x1001('0x37')]=_0x179714[_0x1001('0x37')][_0x1001('0x38')]?_0x179714['attributes']:_0x149843[_0x1001('0x31')];_0x179714[_0x1001('0x4e')]=qs[_0x1001('0x3b')](_0x121db9[_0x1001('0x32')]['sort']);_0x179714[_0x1001('0x3c')]=qs[_0x1001('0x34')](_['pick'](_0x121db9[_0x1001('0x32')],_0x149843[_0x1001('0x34')]));if(_0x121db9[_0x1001('0x32')]['filter']){_0x179714[_0x1001('0x3c')]=_[_0x1001('0x3e')](_0x179714[_0x1001('0x3c')],{'$or':_[_0x1001('0x2d')](_0x179714[_0x1001('0x37')],function(_0x4c302c){var _0x2a30e6={};_0x2a30e6[_0x4c302c]={'$like':'%'+_0x121db9[_0x1001('0x32')][_0x1001('0x4f')]+'%'};return _0x2a30e6;})});}_0x179714=_[_0x1001('0x3e')]({},_0x179714,_0x121db9['options']);return _0x3f86fc[_0x1001('0x4a')](_0x179714);}})[_0x1001('0x26')](function(_0xb3c04e){if(_0xb3c04e){_0x3bf080=_0xb3c04e[_0x1001('0x38')];if(!_0x121db9[_0x1001('0x32')][_0x1001('0x39')](_0x1001('0x3a'))){_0x179714[_0x1001('0x21')]=qs[_0x1001('0x21')](_0x121db9['query'][_0x1001('0x21')]);_0x179714[_0x1001('0x1f')]=qs['offset'](_0x121db9[_0x1001('0x32')][_0x1001('0x1f')]);}return _0x3f86fc[_0x1001('0x4a')](_0x179714);}})[_0x1001('0x26')](function(_0x10c3f9){if(_0x10c3f9){return _0x10c3f9?{'count':_0x3bf080,'rows':_0x10c3f9}:null;}})[_0x1001('0x26')](respondWithResult(_0x568ec7,null))[_0x1001('0x43')](handleError(_0x568ec7,null));};exports['addConfiguration']=function(_0x2add4f,_0x344512,_0x1b278e){if(_0x2add4f[_0x1001('0x48')]['id']){delete _0x2add4f['body']['id'];}return db[_0x1001('0x2e')][_0x1001('0x4b')]({'where':{'id':_0x2add4f[_0x1001('0x45')]['id']}})[_0x1001('0x26')](handleEntityNotFound(_0x344512,null))['then'](function(_0x50b8ff){if(_0x50b8ff){_0x2add4f[_0x1001('0x48')][_0x1001('0x50')]=_0x50b8ff['id'];_0x2add4f['body'][_0x1001('0x51')]=integrations[_0x1001('0x52')](_0x2add4f[_0x1001('0x48')][_0x1001('0x53')],_0x2add4f['body'][_0x1001('0x30')]);_0x2add4f[_0x1001('0x48')][_0x1001('0x54')]=integrations['getDescriptions'](_0x2add4f['body'][_0x1001('0x53')],_0x2add4f[_0x1001('0x48')]['type']);return db['DeskConfiguration']['create'](_0x2add4f[_0x1001('0x48')],{'include':[{'model':db[_0x1001('0x55')],'as':_0x1001('0x51')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0x1001('0x26')](respondWithResult(_0x344512,null))[_0x1001('0x43')](handleError(_0x344512,null));};exports[_0x1001('0x56')]=function(_0x14cc9b,_0x4f503b,_0x50affd){var _0x4c3b31=[{'name':_0x1001('0x57'),'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 _0x251e22='';return db[_0x1001('0x2e')][_0x1001('0x4b')]({'where':{'id':_0x14cc9b[_0x1001('0x45')]['id']},'attributes':['id',_0x1001('0x58'),_0x1001('0x59'),_0x1001('0x5a'),_0x1001('0x5b'),_0x1001('0x5c'),_0x1001('0x5d'),_0x1001('0x5e'),_0x1001('0x5f')]})[_0x1001('0x26')](handleEntityNotFound(_0x4f503b,null))[_0x1001('0x26')](function(_0x31a60b){if(_0x31a60b){_0x251e22=_0x31a60b['remoteUri'];var _0x150cd1=_0x251e22['slice'](-0x1);if(_0x150cd1==='/'){_0x251e22=_0x251e22[_0x1001('0x60')](0x0,_0x251e22[_0x1001('0x61')](_0x150cd1));}var _0x5c9bf3={'method':'GET','uri':util['format']('%s/custom_fields',_0x251e22),'headers':{'Content-Type':_0x1001('0x62'),'Accept':'application/json'},'json':!![]};if(_0x31a60b[_0x1001('0x59')]===_0x1001('0x63')){_0x5c9bf3[_0x1001('0x64')][_0x1001('0x65')]=util['format'](_0x1001('0x66'),new Buffer(util['format'](_0x1001('0x67'),_0x31a60b['username'],_0x31a60b[_0x1001('0x5b')]))[_0x1001('0x68')](_0x1001('0x69')));}return rp(_0x5c9bf3)[_0x1001('0x26')](function(_0x301bbb){return _0x4c3b31['concat'](_[_0x1001('0x2d')](_0x301bbb['_embedded'][_0x1001('0x6a')],function(_0x449e52){return{'id':_0x449e52[_0x1001('0x2b')],'name':_0x449e52[_0x1001('0x2b')],'type':_0x449e52['type'],'active':_0x449e52[_0x1001('0x6b')],'label':_0x449e52[_0x1001('0x6c')],'custom':!![]};}));});}})[_0x1001('0x26')](function(_0x1122ab){return{'count':_0x1122ab[_0x1001('0x38')],'rows':_0x1122ab};})[_0x1001('0x26')](respondWithResult(_0x4f503b,null))[_0x1001('0x43')](function(_0x432203){var _0x4ad269=_0x14cc9b[_0x1001('0x32')][_0x1001('0x6d')]?0x1f4:_0x432203[_0x1001('0x6e')]||0x1f4;logger[_0x1001('0x29')](_0x1001('0x6f'),_0x1001('0x56'),_0x4ad269,JSON[_0x1001('0x70')](_0x432203));delete _0x432203[_0x1001('0x2b')];if(_0x4ad269===0x191){_0x4ad269=0x190;}_0x4f503b[_0x1001('0x1d')](_0x4ad269)[_0x1001('0x71')](_0x14cc9b[_0x1001('0x32')]['test']?{'message':_0x1001('0x72'),'statusCode':_0x432203[_0x1001('0x6e')]}:_0x432203);});}; \ No newline at end of file +var _0xc68b=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','basic','Authorization','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','DeskAccount','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','options','find','create','body','catch','update','destroy','getConfigurations','findOne','DeskConfiguration','order'];(function(_0x31115c,_0x490dcb){var _0x309f3d=function(_0x1df1c0){while(--_0x1df1c0){_0x31115c['push'](_0x31115c['shift']());}};_0x309f3d(++_0x490dcb);}(_0xc68b,0x108));var _0xbc68=function(_0x3b686d,_0xaa05f1){_0x3b686d=_0x3b686d-0x0;var _0x2a5754=_0xc68b[_0x3b686d];return _0x2a5754;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc68('0x0'));var zipdir=require(_0xbc68('0x1'));var jsonpatch=require(_0xbc68('0x2'));var rp=require('request-promise');var moment=require(_0xbc68('0x3'));var BPromise=require(_0xbc68('0x4'));var Mustache=require(_0xbc68('0x5'));var util=require('util');var path=require(_0xbc68('0x6'));var sox=require(_0xbc68('0x7'));var csv=require(_0xbc68('0x8'));var ejs=require(_0xbc68('0x9'));var fs=require('fs');var fs_extra=require(_0xbc68('0xa'));var _=require(_0xbc68('0xb'));var squel=require(_0xbc68('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc68('0xd'));var toCsv=require(_0xbc68('0x8'));var querystring=require(_0xbc68('0xe'));var Papa=require(_0xbc68('0xf'));var Redis=require('ioredis');var authService=require(_0xbc68('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbc68('0x11'));var utils=require(_0xbc68('0x12'));var config=require(_0xbc68('0x13'));var licenseUtil=require(_0xbc68('0x14'));var db=require(_0xbc68('0x15'))['db'];var integrations=require(_0xbc68('0x16'));function respondWithStatusCode(_0x3af852,_0x47e817){_0x47e817=_0x47e817||0xcc;return function(_0x2a6199){if(_0x2a6199){return _0x3af852[_0xbc68('0x17')](_0x47e817);}return _0x3af852[_0xbc68('0x18')](_0x47e817)['end']();};}function respondWithResult(_0xfe1ce2,_0x3d1ddb){_0x3d1ddb=_0x3d1ddb||0xc8;return function(_0x1bc86c){if(_0x1bc86c){return _0xfe1ce2[_0xbc68('0x18')](_0x3d1ddb)[_0xbc68('0x19')](_0x1bc86c);}};}function respondWithFilteredResult(_0x3ee8ab,_0x87ab9e){return function(_0x3537fb){if(_0x3537fb){var _0x216d60=typeof _0x87ab9e['offset']===_0xbc68('0x1a')&&typeof _0x87ab9e['limit']===_0xbc68('0x1a');var _0x52de73=_0x3537fb[_0xbc68('0x1b')];var _0x4f4d76=_0x216d60?0x0:_0x87ab9e[_0xbc68('0x1c')];var _0x1bb4cd=_0x216d60?_0x3537fb[_0xbc68('0x1b')]:_0x87ab9e[_0xbc68('0x1c')]+_0x87ab9e[_0xbc68('0x1d')];var _0x4c0d1c;if(_0x1bb4cd>=_0x52de73){_0x1bb4cd=_0x52de73;_0x4c0d1c=0xc8;}else{_0x4c0d1c=0xce;}_0x3ee8ab[_0xbc68('0x18')](_0x4c0d1c);return _0x3ee8ab['set'](_0xbc68('0x1e'),_0x4f4d76+'-'+_0x1bb4cd+'/'+_0x52de73)[_0xbc68('0x19')](_0x3537fb);}return null;};}function patchUpdates(_0x2b9625){return function(_0x54184e){try{jsonpatch[_0xbc68('0x1f')](_0x54184e,_0x2b9625,!![]);}catch(_0x21b483){return BPromise[_0xbc68('0x20')](_0x21b483);}return _0x54184e[_0xbc68('0x21')]();};}function saveUpdates(_0x40c421,_0x538ba4){return function(_0x56a0bd){if(_0x56a0bd){return _0x56a0bd['update'](_0x40c421)[_0xbc68('0x22')](function(_0x1ad192){return _0x1ad192;});}return null;};}function removeEntity(_0x5abc11,_0x735423){return function(_0x34c1cd){if(_0x34c1cd){return _0x34c1cd['destroy']()['then'](function(){_0x5abc11[_0xbc68('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43bc65,_0x3280cf){return function(_0x28e791){if(!_0x28e791){_0x43bc65['sendStatus'](0x194);}return _0x28e791;};}function handleError(_0x18fca2,_0x3024e4){_0x3024e4=_0x3024e4||0x1f4;return function(_0x285356){logger[_0xbc68('0x23')](_0x285356[_0xbc68('0x24')]);if(_0x285356[_0xbc68('0x25')]){delete _0x285356['name'];}_0x18fca2[_0xbc68('0x18')](_0x3024e4)[_0xbc68('0x26')](_0x285356);};}exports[_0xbc68('0x27')]=function(_0x105cee,_0x4366ca){var _0x554fab={},_0x13ccb6={},_0x39e7b6={'count':0x0,'rows':[]};var _0x489a82=_[_0xbc68('0x28')](db[_0xbc68('0x29')]['rawAttributes'],function(_0x3372c6){return{'name':_0x3372c6[_0xbc68('0x2a')],'type':_0x3372c6[_0xbc68('0x2b')][_0xbc68('0x2c')]};});_0x13ccb6['model']=_[_0xbc68('0x28')](_0x489a82,_0xbc68('0x25'));_0x13ccb6[_0xbc68('0x2d')]=_[_0xbc68('0x2e')](_0x105cee[_0xbc68('0x2d')]);_0x13ccb6[_0xbc68('0x2f')]=_[_0xbc68('0x30')](_0x13ccb6['model'],_0x13ccb6[_0xbc68('0x2d')]);_0x554fab[_0xbc68('0x31')]=_[_0xbc68('0x30')](_0x13ccb6[_0xbc68('0x32')],qs[_0xbc68('0x33')](_0x105cee[_0xbc68('0x2d')][_0xbc68('0x33')]));_0x554fab[_0xbc68('0x31')]=_0x554fab[_0xbc68('0x31')][_0xbc68('0x34')]?_0x554fab[_0xbc68('0x31')]:_0x13ccb6['model'];if(!_0x105cee['query'][_0xbc68('0x35')](_0xbc68('0x36'))){_0x554fab[_0xbc68('0x1d')]=qs['limit'](_0x105cee[_0xbc68('0x2d')][_0xbc68('0x1d')]);_0x554fab[_0xbc68('0x1c')]=qs[_0xbc68('0x1c')](_0x105cee['query'][_0xbc68('0x1c')]);}_0x554fab['order']=qs['sort'](_0x105cee[_0xbc68('0x2d')][_0xbc68('0x37')]);_0x554fab[_0xbc68('0x38')]=qs[_0xbc68('0x2f')](_[_0xbc68('0x39')](_0x105cee[_0xbc68('0x2d')],_0x13ccb6[_0xbc68('0x2f')]),_0x489a82);if(_0x105cee[_0xbc68('0x2d')][_0xbc68('0x3a')]){_0x554fab[_0xbc68('0x38')]=_[_0xbc68('0x3b')](_0x554fab[_0xbc68('0x38')],{'$or':_[_0xbc68('0x28')](_0x489a82,function(_0x59a9dc){if(_0x59a9dc[_0xbc68('0x2b')]!==_0xbc68('0x3c')){var _0x55d90c={};_0x55d90c[_0x59a9dc[_0xbc68('0x25')]]={'$like':'%'+_0x105cee[_0xbc68('0x2d')]['filter']+'%'};return _0x55d90c;}})});}_0x554fab=_['merge']({},_0x554fab,_0x105cee['options']);var _0x3c7709={'where':_0x554fab[_0xbc68('0x38')]};return db[_0xbc68('0x29')][_0xbc68('0x1b')](_0x3c7709)[_0xbc68('0x22')](function(_0x5488b1){_0x39e7b6[_0xbc68('0x1b')]=_0x5488b1;if(_0x105cee['query']['includeAll']){_0x554fab[_0xbc68('0x3d')]=[{'all':!![]}];}return db[_0xbc68('0x29')][_0xbc68('0x3e')](_0x554fab);})[_0xbc68('0x22')](function(_0x521d44){_0x39e7b6[_0xbc68('0x3f')]=_0x521d44;return _0x39e7b6;})['then'](respondWithFilteredResult(_0x4366ca,_0x554fab))['catch'](handleError(_0x4366ca,null));};exports[_0xbc68('0x40')]=function(_0x16f1d6,_0x316e35){var _0x17b34c={'raw':![],'where':{'id':_0x16f1d6[_0xbc68('0x41')]['id']}},_0x39c541={};_0x39c541[_0xbc68('0x32')]=_[_0xbc68('0x2e')](db['DeskAccount'][_0xbc68('0x42')]);_0x39c541[_0xbc68('0x2d')]=_['keys'](_0x16f1d6[_0xbc68('0x2d')]);_0x39c541[_0xbc68('0x2f')]=_['intersection'](_0x39c541['model'],_0x39c541['query']);_0x17b34c['attributes']=_['intersection'](_0x39c541['model'],qs['fields'](_0x16f1d6[_0xbc68('0x2d')][_0xbc68('0x33')]));_0x17b34c[_0xbc68('0x31')]=_0x17b34c[_0xbc68('0x31')][_0xbc68('0x34')]?_0x17b34c['attributes']:_0x39c541['model'];if(_0x16f1d6['query']['includeAll']){_0x17b34c[_0xbc68('0x3d')]=[{'all':!![]}];}_0x17b34c=_[_0xbc68('0x3b')]({},_0x17b34c,_0x16f1d6[_0xbc68('0x43')]);return db['DeskAccount'][_0xbc68('0x44')](_0x17b34c)['then'](handleEntityNotFound(_0x316e35,null))[_0xbc68('0x22')](respondWithResult(_0x316e35,null))['catch'](handleError(_0x316e35,null));};exports['create']=function(_0x3679bf,_0x2dd5d1){return db['DeskAccount'][_0xbc68('0x45')](_0x3679bf[_0xbc68('0x46')],{})[_0xbc68('0x22')](respondWithResult(_0x2dd5d1,0xc9))[_0xbc68('0x47')](handleError(_0x2dd5d1,null));};exports[_0xbc68('0x48')]=function(_0x204f77,_0x3c8c4b){if(_0x204f77[_0xbc68('0x46')]['id']){delete _0x204f77[_0xbc68('0x46')]['id'];}return db[_0xbc68('0x29')][_0xbc68('0x44')]({'where':{'id':_0x204f77[_0xbc68('0x41')]['id']}})[_0xbc68('0x22')](handleEntityNotFound(_0x3c8c4b,null))[_0xbc68('0x22')](saveUpdates(_0x204f77[_0xbc68('0x46')],null))[_0xbc68('0x22')](respondWithResult(_0x3c8c4b,null))[_0xbc68('0x47')](handleError(_0x3c8c4b,null));};exports[_0xbc68('0x49')]=function(_0x2dc975,_0xbf7240){return db[_0xbc68('0x29')][_0xbc68('0x44')]({'where':{'id':_0x2dc975[_0xbc68('0x41')]['id']}})[_0xbc68('0x22')](handleEntityNotFound(_0xbf7240,null))[_0xbc68('0x22')](removeEntity(_0xbf7240,null))['catch'](handleError(_0xbf7240,null));};exports[_0xbc68('0x4a')]=function(_0x7e175b,_0x39bdd3,_0x1c761e){var _0x1097fe={};var _0x2e8d55={};var _0x1613b9;var _0x2b7bd5;return db[_0xbc68('0x29')][_0xbc68('0x4b')]({'where':{'id':_0x7e175b[_0xbc68('0x41')]['id']}})[_0xbc68('0x22')](handleEntityNotFound(_0x39bdd3,null))[_0xbc68('0x22')](function(_0x25b695){if(_0x25b695){_0x1613b9=_0x25b695;_0x2e8d55[_0xbc68('0x32')]=_['keys'](db[_0xbc68('0x4c')][_0xbc68('0x42')]);_0x2e8d55[_0xbc68('0x2d')]=_[_0xbc68('0x2e')](_0x7e175b[_0xbc68('0x2d')]);_0x2e8d55[_0xbc68('0x2f')]=_[_0xbc68('0x30')](_0x2e8d55[_0xbc68('0x32')],_0x2e8d55[_0xbc68('0x2d')]);_0x1097fe[_0xbc68('0x31')]=_[_0xbc68('0x30')](_0x2e8d55[_0xbc68('0x32')],qs[_0xbc68('0x33')](_0x7e175b[_0xbc68('0x2d')][_0xbc68('0x33')]));_0x1097fe['attributes']=_0x1097fe[_0xbc68('0x31')]['length']?_0x1097fe[_0xbc68('0x31')]:_0x2e8d55[_0xbc68('0x32')];_0x1097fe[_0xbc68('0x4d')]=qs['sort'](_0x7e175b[_0xbc68('0x2d')][_0xbc68('0x37')]);_0x1097fe[_0xbc68('0x38')]=qs[_0xbc68('0x2f')](_[_0xbc68('0x39')](_0x7e175b['query'],_0x2e8d55['filters']));if(_0x7e175b['query']['filter']){_0x1097fe[_0xbc68('0x38')]=_[_0xbc68('0x3b')](_0x1097fe['where'],{'$or':_[_0xbc68('0x28')](_0x1097fe[_0xbc68('0x31')],function(_0x1bfb0e){var _0x4e7281={};_0x4e7281[_0x1bfb0e]={'$like':'%'+_0x7e175b[_0xbc68('0x2d')][_0xbc68('0x3a')]+'%'};return _0x4e7281;})});}_0x1097fe=_[_0xbc68('0x3b')]({},_0x1097fe,_0x7e175b[_0xbc68('0x43')]);return _0x1613b9[_0xbc68('0x4a')](_0x1097fe);}})[_0xbc68('0x22')](function(_0x59cd5a){if(_0x59cd5a){_0x2b7bd5=_0x59cd5a[_0xbc68('0x34')];if(!_0x7e175b['query'][_0xbc68('0x35')](_0xbc68('0x36'))){_0x1097fe[_0xbc68('0x1d')]=qs['limit'](_0x7e175b[_0xbc68('0x2d')][_0xbc68('0x1d')]);_0x1097fe[_0xbc68('0x1c')]=qs[_0xbc68('0x1c')](_0x7e175b['query'][_0xbc68('0x1c')]);}return _0x1613b9[_0xbc68('0x4a')](_0x1097fe);}})[_0xbc68('0x22')](function(_0x58886d){if(_0x58886d){return _0x58886d?{'count':_0x2b7bd5,'rows':_0x58886d}:null;}})[_0xbc68('0x22')](respondWithResult(_0x39bdd3,null))['catch'](handleError(_0x39bdd3,null));};exports[_0xbc68('0x4e')]=function(_0x1a2562,_0x1f7f14,_0xe2b747){if(_0x1a2562[_0xbc68('0x46')]['id']){delete _0x1a2562[_0xbc68('0x46')]['id'];}return db[_0xbc68('0x29')][_0xbc68('0x4b')]({'where':{'id':_0x1a2562['params']['id']}})['then'](handleEntityNotFound(_0x1f7f14,null))['then'](function(_0x2913b8){if(_0x2913b8){_0x1a2562[_0xbc68('0x46')][_0xbc68('0x4f')]=_0x2913b8['id'];_0x1a2562['body'][_0xbc68('0x50')]=integrations[_0xbc68('0x51')](_0x1a2562[_0xbc68('0x46')][_0xbc68('0x52')],_0x1a2562[_0xbc68('0x46')][_0xbc68('0x2b')]);_0x1a2562[_0xbc68('0x46')][_0xbc68('0x53')]=integrations[_0xbc68('0x54')](_0x1a2562[_0xbc68('0x46')][_0xbc68('0x52')],_0x1a2562['body'][_0xbc68('0x2b')]);return db['DeskConfiguration'][_0xbc68('0x45')](_0x1a2562['body'],{'include':[{'model':db[_0xbc68('0x55')],'as':_0xbc68('0x50')},{'model':db['DeskField'],'as':_0xbc68('0x53')}]});}return null;})[_0xbc68('0x22')](respondWithResult(_0x1f7f14,null))[_0xbc68('0x47')](handleError(_0x1f7f14,null));};exports['getFields']=function(_0x38d7e6,_0x1de0c9,_0x2a3f4d){var _0x2c0f3c=[{'name':_0xbc68('0x56'),'label':_0xbc68('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 _0x384831='';return db[_0xbc68('0x29')]['findOne']({'where':{'id':_0x38d7e6['params']['id']},'attributes':['id',_0xbc68('0x57'),_0xbc68('0x58'),_0xbc68('0x59'),_0xbc68('0x5a'),_0xbc68('0x5b'),'consumerSecret',_0xbc68('0x5c'),_0xbc68('0x5d')]})[_0xbc68('0x22')](handleEntityNotFound(_0x1de0c9,null))[_0xbc68('0x22')](function(_0x1c1a45){if(_0x1c1a45){_0x384831=_0x1c1a45[_0xbc68('0x57')];var _0xfa0961=_0x384831[_0xbc68('0x5e')](-0x1);if(_0xfa0961==='/'){_0x384831=_0x384831[_0xbc68('0x5f')](0x0,_0x384831[_0xbc68('0x60')](_0xfa0961));}var _0x257841={'method':_0xbc68('0x61'),'uri':util[_0xbc68('0x62')](_0xbc68('0x63'),_0x384831),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x1c1a45[_0xbc68('0x58')]===_0xbc68('0x64')){_0x257841['headers'][_0xbc68('0x65')]=util[_0xbc68('0x62')]('Basic\x20%s',new Buffer(util[_0xbc68('0x62')](_0xbc68('0x66'),_0x1c1a45[_0xbc68('0x59')],_0x1c1a45[_0xbc68('0x5a')]))['toString'](_0xbc68('0x67')));}return rp(_0x257841)[_0xbc68('0x22')](function(_0x4c8a4e){return _0x2c0f3c[_0xbc68('0x68')](_[_0xbc68('0x28')](_0x4c8a4e[_0xbc68('0x69')][_0xbc68('0x6a')],function(_0x423def){return{'id':_0x423def[_0xbc68('0x25')],'name':_0x423def[_0xbc68('0x25')],'type':_0x423def[_0xbc68('0x2b')],'active':_0x423def[_0xbc68('0x6b')],'label':_0x423def[_0xbc68('0x6c')],'custom':!![]};}));});}})[_0xbc68('0x22')](function(_0x246717){return{'count':_0x246717['length'],'rows':_0x246717};})['then'](respondWithResult(_0x1de0c9,null))[_0xbc68('0x47')](function(_0xd6e09e){var _0xe84937=_0x38d7e6['query'][_0xbc68('0x6d')]?0x1f4:_0xd6e09e[_0xbc68('0x6e')]||0x1f4;logger[_0xbc68('0x23')](_0xbc68('0x6f'),_0xbc68('0x70'),_0xe84937,JSON[_0xbc68('0x71')](_0xd6e09e));delete _0xd6e09e[_0xbc68('0x25')];if(_0xe84937===0x191){_0xe84937=0x190;}_0x1de0c9['status'](_0xe84937)[_0xbc68('0x26')](_0x38d7e6[_0xbc68('0x2d')][_0xbc68('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0xd6e09e[_0xbc68('0x6e')]}:_0xd6e09e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 2870a76..a6b497f 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 _0x4c62=['../../config/environment','./intDeskAccount.attributes','define','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x4c62,0x10c));var _0x24c6=function(_0x315bf4,_0x4bf3d6){_0x315bf4=_0x315bf4-0x0;var _0x50cd96=_0x4c62[_0x315bf4];return _0x50cd96;};'use strict';var _=require('lodash');var util=require(_0x24c6('0x0'));var logger=require(_0x24c6('0x1'))(_0x24c6('0x2'));var moment=require(_0x24c6('0x3'));var BPromise=require(_0x24c6('0x4'));var rp=require(_0x24c6('0x5'));var fs=require('fs');var path=require(_0x24c6('0x6'));var rimraf=require(_0x24c6('0x7'));var config=require(_0x24c6('0x8'));var attributes=require(_0x24c6('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x50211c,_0x4bd189){return _0x50211c[_0x24c6('0xa')]('DeskAccount',attributes,{'tableName':_0x24c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb24f=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xb24f,0x144));var _0xfb24=function(_0x3ee711,_0x4c6bb2){_0x3ee711=_0x3ee711-0x0;var _0x41f5d9=_0xb24f[_0x3ee711];return _0x41f5d9;};'use strict';var _=require(_0xfb24('0x0'));var util=require(_0xfb24('0x1'));var logger=require(_0xfb24('0x2'))(_0xfb24('0x3'));var moment=require(_0xfb24('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb24('0x5'));var fs=require('fs');var path=require(_0xfb24('0x6'));var rimraf=require(_0xfb24('0x7'));var config=require(_0xfb24('0x8'));var attributes=require(_0xfb24('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xfb24('0xa')]=function(_0x18d793,_0x684f9c){return _0x18d793[_0xfb24('0xb')](_0xfb24('0xc'),attributes,{'tableName':_0xfb24('0xd'),'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 c2eb1b7..aed0cb2 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 _0xcfc0=['message','result','catch','GetDeskAccount','DeskAccount','findAll','options','attributes','limit','include','model','map','debug','find','raw','where','ShowDeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fa36d,_0x2ed5b9){var _0x44bd94=function(_0x32ae1e){while(--_0x32ae1e){_0x4fa36d['push'](_0x4fa36d['shift']());}};_0x44bd94(++_0x2ed5b9);}(_0xcfc0,0x1d8));var _0x0cfc=function(_0x3f5af4,_0x1a2d76){_0x3f5af4=_0x3f5af4-0x0;var _0xeecbd9=_0xcfc0[_0x3f5af4];return _0xeecbd9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0cfc('0x0'));var BPromise=require(_0x0cfc('0x1'));var rs=require(_0x0cfc('0x2'));var fs=require('fs');var Redis=require(_0x0cfc('0x3'));var db=require(_0x0cfc('0x4'))['db'];var utils=require(_0x0cfc('0x5'));var logger=require('../../config/logger')(_0x0cfc('0x6'));var config=require(_0x0cfc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0cfc('0x8')][_0x0cfc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1575b3,_0x4b2dbb,_0x3a0cc9){return new BPromise(function(_0x27bd9c,_0x5b700f){return client[_0x0cfc('0xa')](_0x1575b3,_0x3a0cc9)[_0x0cfc('0xb')](function(_0x8d7402){logger[_0x0cfc('0xc')](_0x0cfc('0xd'),_0x4b2dbb,_0x0cfc('0xe'));logger['debug'](_0x0cfc('0xf'),_0x4b2dbb,_0x0cfc('0xe'),JSON[_0x0cfc('0x10')](_0x8d7402));if(_0x8d7402[_0x0cfc('0x11')]){if(_0x8d7402[_0x0cfc('0x11')]['code']===0x1f4){logger[_0x0cfc('0x11')](_0x0cfc('0xd'),_0x4b2dbb,_0x8d7402[_0x0cfc('0x11')][_0x0cfc('0x12')]);return _0x5b700f(_0x8d7402[_0x0cfc('0x11')][_0x0cfc('0x12')]);}logger[_0x0cfc('0x11')](_0x0cfc('0xd'),_0x4b2dbb,_0x8d7402[_0x0cfc('0x11')][_0x0cfc('0x12')]);return _0x27bd9c(_0x8d7402[_0x0cfc('0x11')][_0x0cfc('0x12')]);}else{logger[_0x0cfc('0xc')](_0x0cfc('0xd'),_0x4b2dbb,_0x0cfc('0xe'));_0x27bd9c(_0x8d7402[_0x0cfc('0x13')][_0x0cfc('0x12')]);}})[_0x0cfc('0x14')](function(_0x4977df){logger['error'](_0x0cfc('0xd'),_0x4b2dbb,_0x4977df);_0x5b700f(_0x4977df);});});}exports[_0x0cfc('0x15')]=function(_0x23cbc9){var _0xca8a30=this;return new Promise(function(_0xfa757b,_0x12aea3){return db[_0x0cfc('0x16')][_0x0cfc('0x17')]({'raw':_0x23cbc9[_0x0cfc('0x18')]?_0x23cbc9[_0x0cfc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23cbc9[_0x0cfc('0x18')]?_0x23cbc9['options']['where']||null:null,'attributes':_0x23cbc9[_0x0cfc('0x18')]?_0x23cbc9[_0x0cfc('0x18')][_0x0cfc('0x19')]||null:null,'limit':_0x23cbc9[_0x0cfc('0x18')]?_0x23cbc9['options'][_0x0cfc('0x1a')]||null:null,'include':_0x23cbc9[_0x0cfc('0x18')]?_0x23cbc9[_0x0cfc('0x18')]['include']?_['map'](_0x23cbc9[_0x0cfc('0x18')][_0x0cfc('0x1b')],function(_0x3e4520){return{'model':db[_0x3e4520[_0x0cfc('0x1c')]],'as':_0x3e4520['as'],'attributes':_0x3e4520[_0x0cfc('0x19')],'include':_0x3e4520[_0x0cfc('0x1b')]?_[_0x0cfc('0x1d')](_0x3e4520[_0x0cfc('0x1b')],function(_0x1b4110){return{'model':db[_0x1b4110[_0x0cfc('0x1c')]],'as':_0x1b4110['as'],'attributes':_0x1b4110[_0x0cfc('0x19')],'include':_0x1b4110[_0x0cfc('0x1b')]?_[_0x0cfc('0x1d')](_0x1b4110['include'],function(_0x228bd8){return{'model':db[_0x228bd8[_0x0cfc('0x1c')]],'as':_0x228bd8['as'],'attributes':_0x228bd8[_0x0cfc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0cfc('0xb')](function(_0x426b82){logger['info'](_0x0cfc('0x15'),_0x23cbc9);logger[_0x0cfc('0x1e')](_0x0cfc('0x15'),_0x23cbc9,JSON[_0x0cfc('0x10')](_0x426b82));_0xfa757b(_0x426b82);})['catch'](function(_0x3e3b98){logger[_0x0cfc('0x11')](_0x0cfc('0x15'),_0x3e3b98[_0x0cfc('0x12')],_0x23cbc9);_0x12aea3(_0xca8a30[_0x0cfc('0x11')](0x1f4,_0x3e3b98['message']));});});};exports['ShowDeskAccount']=function(_0x358da7){var _0x4bf13e=this;return new Promise(function(_0x36049f,_0x4d685c){return db[_0x0cfc('0x16')][_0x0cfc('0x1f')]({'raw':_0x358da7['options']?_0x358da7[_0x0cfc('0x18')][_0x0cfc('0x20')]===undefined?!![]:![]:!![],'where':_0x358da7[_0x0cfc('0x18')]?_0x358da7['options'][_0x0cfc('0x21')]||null:null,'attributes':_0x358da7[_0x0cfc('0x18')]?_0x358da7['options'][_0x0cfc('0x19')]||null:null,'include':_0x358da7[_0x0cfc('0x18')]?_0x358da7[_0x0cfc('0x18')][_0x0cfc('0x1b')]?_[_0x0cfc('0x1d')](_0x358da7[_0x0cfc('0x18')][_0x0cfc('0x1b')],function(_0x2fc8c4){return{'model':db[_0x2fc8c4['model']],'as':_0x2fc8c4['as'],'attributes':_0x2fc8c4[_0x0cfc('0x19')],'include':_0x2fc8c4[_0x0cfc('0x1b')]?_[_0x0cfc('0x1d')](_0x2fc8c4['include'],function(_0x4c807d){return{'model':db[_0x4c807d['model']],'as':_0x4c807d['as'],'attributes':_0x4c807d[_0x0cfc('0x19')],'include':_0x4c807d[_0x0cfc('0x1b')]?_[_0x0cfc('0x1d')](_0x4c807d[_0x0cfc('0x1b')],function(_0x41cecb){return{'model':db[_0x41cecb['model']],'as':_0x41cecb['as'],'attributes':_0x41cecb[_0x0cfc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0cfc('0xb')](function(_0x40965f){logger['info'](_0x0cfc('0x22'),_0x358da7);logger['debug']('ShowDeskAccount',_0x358da7,JSON[_0x0cfc('0x10')](_0x40965f));_0x36049f(_0x40965f);})['catch'](function(_0x5b2377){logger[_0x0cfc('0x11')](_0x0cfc('0x22'),_0x5b2377[_0x0cfc('0x12')],_0x358da7);_0x4d685c(_0x4bf13e['error'](0x1f4,_0x5b2377[_0x0cfc('0x12')]));});});}; \ No newline at end of file +var _0x070d=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info'];(function(_0x4d99cf,_0x51e711){var _0x5e54bb=function(_0x4b2964){while(--_0x4b2964){_0x4d99cf['push'](_0x4d99cf['shift']());}};_0x5e54bb(++_0x51e711);}(_0x070d,0x12e));var _0xd070=function(_0x745eb0,_0xa9731f){_0x745eb0=_0x745eb0-0x0;var _0x2945ba=_0x070d[_0x745eb0];return _0x2945ba;};'use strict';var _=require(_0xd070('0x0'));var util=require(_0xd070('0x1'));var moment=require(_0xd070('0x2'));var BPromise=require(_0xd070('0x3'));var rs=require(_0xd070('0x4'));var fs=require('fs');var Redis=require(_0xd070('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd070('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd070('0x7'));var client=jayson[_0xd070('0x8')][_0xd070('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32e480,_0x5644ae,_0x509599){return new BPromise(function(_0x458dc5,_0x3b3cc3){return client[_0xd070('0xa')](_0x32e480,_0x509599)[_0xd070('0xb')](function(_0xaa94d0){logger[_0xd070('0xc')](_0xd070('0xd'),_0x5644ae,_0xd070('0xe'));logger[_0xd070('0xf')](_0xd070('0x10'),_0x5644ae,'request\x20sent',JSON[_0xd070('0x11')](_0xaa94d0));if(_0xaa94d0[_0xd070('0x12')]){if(_0xaa94d0[_0xd070('0x12')][_0xd070('0x13')]===0x1f4){logger[_0xd070('0x12')]('DeskAccount,\x20%s,\x20%s',_0x5644ae,_0xaa94d0[_0xd070('0x12')][_0xd070('0x14')]);return _0x3b3cc3(_0xaa94d0[_0xd070('0x12')]['message']);}logger['error'](_0xd070('0xd'),_0x5644ae,_0xaa94d0[_0xd070('0x12')][_0xd070('0x14')]);return _0x458dc5(_0xaa94d0['error'][_0xd070('0x14')]);}else{logger['info'](_0xd070('0xd'),_0x5644ae,_0xd070('0xe'));_0x458dc5(_0xaa94d0[_0xd070('0x15')]['message']);}})[_0xd070('0x16')](function(_0x5880cb){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5644ae,_0x5880cb);_0x3b3cc3(_0x5880cb);});});}exports[_0xd070('0x17')]=function(_0x49a250){var _0x3b2841=this;return new Promise(function(_0x415dc8,_0x3b3536){return db['DeskAccount'][_0xd070('0x18')]({'raw':_0x49a250[_0xd070('0x19')]?_0x49a250[_0xd070('0x19')][_0xd070('0x1a')]===undefined?!![]:![]:!![],'where':_0x49a250['options']?_0x49a250[_0xd070('0x19')]['where']||null:null,'attributes':_0x49a250[_0xd070('0x19')]?_0x49a250[_0xd070('0x19')][_0xd070('0x1b')]||null:null,'limit':_0x49a250[_0xd070('0x19')]?_0x49a250['options'][_0xd070('0x1c')]||null:null,'include':_0x49a250['options']?_0x49a250['options'][_0xd070('0x1d')]?_[_0xd070('0x1e')](_0x49a250[_0xd070('0x19')]['include'],function(_0x43f0d3){return{'model':db[_0x43f0d3[_0xd070('0x1f')]],'as':_0x43f0d3['as'],'attributes':_0x43f0d3['attributes'],'include':_0x43f0d3[_0xd070('0x1d')]?_[_0xd070('0x1e')](_0x43f0d3[_0xd070('0x1d')],function(_0x50900b){return{'model':db[_0x50900b['model']],'as':_0x50900b['as'],'attributes':_0x50900b['attributes'],'include':_0x50900b[_0xd070('0x1d')]?_['map'](_0x50900b[_0xd070('0x1d')],function(_0x41bc5d){return{'model':db[_0x41bc5d[_0xd070('0x1f')]],'as':_0x41bc5d['as'],'attributes':_0x41bc5d[_0xd070('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59d7f1){logger[_0xd070('0xc')](_0xd070('0x17'),_0x49a250);logger[_0xd070('0xf')](_0xd070('0x17'),_0x49a250,JSON[_0xd070('0x11')](_0x59d7f1));_0x415dc8(_0x59d7f1);})[_0xd070('0x16')](function(_0x3a13df){logger[_0xd070('0x12')](_0xd070('0x17'),_0x3a13df[_0xd070('0x14')],_0x49a250);_0x3b3536(_0x3b2841[_0xd070('0x12')](0x1f4,_0x3a13df[_0xd070('0x14')]));});});};exports[_0xd070('0x20')]=function(_0x35121b){var _0x2a1e2c=this;return new Promise(function(_0x111b14,_0xf0faa0){return db[_0xd070('0x21')][_0xd070('0x22')]({'raw':_0x35121b[_0xd070('0x19')]?_0x35121b['options'][_0xd070('0x1a')]===undefined?!![]:![]:!![],'where':_0x35121b['options']?_0x35121b[_0xd070('0x19')]['where']||null:null,'attributes':_0x35121b[_0xd070('0x19')]?_0x35121b['options'][_0xd070('0x1b')]||null:null,'include':_0x35121b[_0xd070('0x19')]?_0x35121b[_0xd070('0x19')][_0xd070('0x1d')]?_[_0xd070('0x1e')](_0x35121b[_0xd070('0x19')]['include'],function(_0x42e19b){return{'model':db[_0x42e19b['model']],'as':_0x42e19b['as'],'attributes':_0x42e19b[_0xd070('0x1b')],'include':_0x42e19b[_0xd070('0x1d')]?_[_0xd070('0x1e')](_0x42e19b[_0xd070('0x1d')],function(_0x3d651d){return{'model':db[_0x3d651d['model']],'as':_0x3d651d['as'],'attributes':_0x3d651d[_0xd070('0x1b')],'include':_0x3d651d['include']?_['map'](_0x3d651d['include'],function(_0x192fd1){return{'model':db[_0x192fd1[_0xd070('0x1f')]],'as':_0x192fd1['as'],'attributes':_0x192fd1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd070('0xb')](function(_0xf43359){logger['info']('ShowDeskAccount',_0x35121b);logger[_0xd070('0xf')]('ShowDeskAccount',_0x35121b,JSON[_0xd070('0x11')](_0xf43359));_0x111b14(_0xf43359);})[_0xd070('0x16')](function(_0x5d1dea){logger[_0xd070('0x12')](_0xd070('0x20'),_0x5d1dea[_0xd070('0x14')],_0x35121b);_0xf0faa0(_0x2a1e2c[_0xd070('0x12')](0x1f4,_0x5d1dea[_0xd070('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 7492411..7cfaaab 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1a84f4,_0x1025dd){var _0x151462=function(_0x526c00){while(--_0x526c00){_0x1a84f4['push'](_0x1a84f4['shift']());}};_0x151462(++_0x1025dd);}(_0x008c,0x188));var _0xc008=function(_0x5d792b,_0x4a41de){_0x5d792b=_0x5d792b-0x0;var _0x219de9=_0x008c[_0x5d792b];return _0x219de9;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x36bd43,_0x417495){var _0x2575cd=function(_0x4fe00c){while(--_0x4fe00c){_0x36bd43['push'](_0x36bd43['shift']());}};_0x2575cd(++_0x417495);}(_0xedd9,0xfc));var _0x9edd=function(_0x32cf7e,_0x5d19d6){_0x32cf7e=_0x32cf7e-0x0;var _0x4fcaa6=_0xedd9[_0x32cf7e];return _0x4fcaa6;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 036a5ce..ffd1500 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 _0x3017=['STRING','sequelize'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3017,0x1a1));var _0x7301=function(_0x44e564,_0x3e84af){_0x44e564=_0x44e564-0x0;var _0x18de60=_0x3017[_0x44e564];return _0x18de60;};'use strict';var Sequelize=require(_0x7301('0x0'));module['exports']={'name':{'type':Sequelize[_0x7301('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x394a=['sequelize','exports','STRING'];(function(_0x21ab23,_0x552d08){var _0x48e889=function(_0x38534d){while(--_0x38534d){_0x21ab23['push'](_0x21ab23['shift']());}};_0x48e889(++_0x552d08);}(_0x394a,0x1aa));var _0xa394=function(_0x401268,_0x34e7cb){_0x401268=_0x401268-0x0;var _0x5ab5e2=_0x394a[_0x401268];return _0x5ab5e2;};'use strict';var Sequelize=require(_0xa394('0x0'));module[_0xa394('0x1')]={'name':{'type':Sequelize[_0xa394('0x2')]},'description':{'type':Sequelize[_0xa394('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 38cf9e9..f5c9a00 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 _0xba8c=['limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','order','pick','where','merge','VIRTUAL','name','includeAll','findAll','rows','catch','show','intersection','fields','include','options','find','create','body','params','getFields','sort','filter','nolimit','findOne','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','moment','util','path','sox','to-csv','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','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x1be068,_0x538f61){var _0x514d24=function(_0x4e8363){while(--_0x4e8363){_0x1be068['push'](_0x1be068['shift']());}};_0x514d24(++_0x538f61);}(_0xba8c,0x1e1));var _0xcba8=function(_0x4d02e3,_0x5f2ae2){_0x4d02e3=_0x4d02e3-0x0;var _0x1d8ee6=_0xba8c[_0x4d02e3];return _0x1d8ee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcba8('0x0'));var zipdir=require(_0xcba8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcba8('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcba8('0x3'));var path=require(_0xcba8('0x4'));var sox=require(_0xcba8('0x5'));var csv=require(_0xcba8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcba8('0x7'));var _=require(_0xcba8('0x8'));var squel=require(_0xcba8('0x9'));var crypto=require(_0xcba8('0xa'));var jsforce=require(_0xcba8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcba8('0x6'));var querystring=require(_0xcba8('0xc'));var Papa=require(_0xcba8('0xd'));var Redis=require(_0xcba8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcba8('0xf'));var as=require(_0xcba8('0x10'));var hardwareService=require(_0xcba8('0x11'));var logger=require(_0xcba8('0x12'))(_0xcba8('0x13'));var utils=require(_0xcba8('0x14'));var config=require(_0xcba8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcba8('0x16'))['db'];function respondWithStatusCode(_0xd1407d,_0x147b26){_0x147b26=_0x147b26||0xcc;return function(_0x29a140){if(_0x29a140){return _0xd1407d[_0xcba8('0x17')](_0x147b26);}return _0xd1407d[_0xcba8('0x18')](_0x147b26)[_0xcba8('0x19')]();};}function respondWithResult(_0x2979f3,_0x547a64){_0x547a64=_0x547a64||0xc8;return function(_0x32cfe8){if(_0x32cfe8){return _0x2979f3[_0xcba8('0x18')](_0x547a64)[_0xcba8('0x1a')](_0x32cfe8);}};}function respondWithFilteredResult(_0x56e323,_0x59c760){return function(_0x13eabc){if(_0x13eabc){var _0xd588de=typeof _0x59c760[_0xcba8('0x1b')]===_0xcba8('0x1c')&&typeof _0x59c760[_0xcba8('0x1d')]===_0xcba8('0x1c');var _0x364582=_0x13eabc[_0xcba8('0x1e')];var _0x1842b9=_0xd588de?0x0:_0x59c760[_0xcba8('0x1b')];var _0x3c73a4=_0xd588de?_0x13eabc[_0xcba8('0x1e')]:_0x59c760[_0xcba8('0x1b')]+_0x59c760[_0xcba8('0x1d')];var _0x25a0bf;if(_0x3c73a4>=_0x364582){_0x3c73a4=_0x364582;_0x25a0bf=0xc8;}else{_0x25a0bf=0xce;}_0x56e323[_0xcba8('0x18')](_0x25a0bf);return _0x56e323[_0xcba8('0x1f')](_0xcba8('0x20'),_0x1842b9+'-'+_0x3c73a4+'/'+_0x364582)[_0xcba8('0x1a')](_0x13eabc);}return null;};}function patchUpdates(_0x4ab5ca){return function(_0x1484ed){try{jsonpatch['apply'](_0x1484ed,_0x4ab5ca,!![]);}catch(_0x3ad290){return BPromise[_0xcba8('0x21')](_0x3ad290);}return _0x1484ed[_0xcba8('0x22')]();};}function saveUpdates(_0x47a70f,_0x534905){return function(_0x353ffc){if(_0x353ffc){return _0x353ffc[_0xcba8('0x23')](_0x47a70f)[_0xcba8('0x24')](function(_0x30da8b){return _0x30da8b;});}return null;};}function removeEntity(_0x2cf712,_0xf66701){return function(_0x202ec0){if(_0x202ec0){return _0x202ec0[_0xcba8('0x25')]()[_0xcba8('0x24')](function(){_0x2cf712[_0xcba8('0x18')](0xcc)[_0xcba8('0x19')]();});}};}function handleEntityNotFound(_0x246e31,_0x5c5e0a){return function(_0x1764e6){if(!_0x1764e6){_0x246e31[_0xcba8('0x17')](0x194);}return _0x1764e6;};}function handleError(_0x537b5f,_0x4c34fe){_0x4c34fe=_0x4c34fe||0x1f4;return function(_0x319155){logger[_0xcba8('0x26')](_0x319155[_0xcba8('0x27')]);if(_0x319155['name']){delete _0x319155['name'];}_0x537b5f['status'](_0x4c34fe)[_0xcba8('0x28')](_0x319155);};}exports['index']=function(_0x10733e,_0x377f21){var _0x530a22={},_0x111f73={},_0x497fde={'count':0x0,'rows':[]};var _0x5b567c=_[_0xcba8('0x29')](db[_0xcba8('0x2a')][_0xcba8('0x2b')],function(_0x3efee4){return{'name':_0x3efee4[_0xcba8('0x2c')],'type':_0x3efee4[_0xcba8('0x2d')][_0xcba8('0x2e')]};});_0x111f73[_0xcba8('0x2f')]=_[_0xcba8('0x29')](_0x5b567c,'name');_0x111f73[_0xcba8('0x30')]=_[_0xcba8('0x31')](_0x10733e[_0xcba8('0x30')]);_0x111f73[_0xcba8('0x32')]=_['intersection'](_0x111f73['model'],_0x111f73[_0xcba8('0x30')]);_0x530a22[_0xcba8('0x33')]=_['intersection'](_0x111f73['model'],qs['fields'](_0x10733e[_0xcba8('0x30')]['fields']));_0x530a22['attributes']=_0x530a22[_0xcba8('0x33')][_0xcba8('0x34')]?_0x530a22[_0xcba8('0x33')]:_0x111f73['model'];if(!_0x10733e['query'][_0xcba8('0x35')]('nolimit')){_0x530a22[_0xcba8('0x1d')]=qs[_0xcba8('0x1d')](_0x10733e[_0xcba8('0x30')][_0xcba8('0x1d')]);_0x530a22[_0xcba8('0x1b')]=qs['offset'](_0x10733e[_0xcba8('0x30')]['offset']);}_0x530a22[_0xcba8('0x36')]=qs['sort'](_0x10733e[_0xcba8('0x30')]['sort']);_0x530a22['where']=qs['filters'](_[_0xcba8('0x37')](_0x10733e[_0xcba8('0x30')],_0x111f73[_0xcba8('0x32')]),_0x5b567c);if(_0x10733e[_0xcba8('0x30')]['filter']){_0x530a22[_0xcba8('0x38')]=_[_0xcba8('0x39')](_0x530a22['where'],{'$or':_[_0xcba8('0x29')](_0x5b567c,function(_0x1a5d61){if(_0x1a5d61[_0xcba8('0x2d')]!==_0xcba8('0x3a')){var _0x514491={};_0x514491[_0x1a5d61[_0xcba8('0x3b')]]={'$like':'%'+_0x10733e['query']['filter']+'%'};return _0x514491;}})});}_0x530a22=_['merge']({},_0x530a22,_0x10733e['options']);var _0x38b150={'where':_0x530a22['where']};return db[_0xcba8('0x2a')]['count'](_0x38b150)[_0xcba8('0x24')](function(_0x35bbdf){_0x497fde[_0xcba8('0x1e')]=_0x35bbdf;if(_0x10733e[_0xcba8('0x30')][_0xcba8('0x3c')]){_0x530a22['include']=[{'all':!![]}];}return db[_0xcba8('0x2a')][_0xcba8('0x3d')](_0x530a22);})[_0xcba8('0x24')](function(_0x23edfb){_0x497fde[_0xcba8('0x3e')]=_0x23edfb;return _0x497fde;})[_0xcba8('0x24')](respondWithFilteredResult(_0x377f21,_0x530a22))[_0xcba8('0x3f')](handleError(_0x377f21,null));};exports[_0xcba8('0x40')]=function(_0x580e7b,_0x3b581d){var _0x113282={'raw':![],'where':{'id':_0x580e7b['params']['id']}},_0x6e1f0c={};_0x6e1f0c[_0xcba8('0x2f')]=_[_0xcba8('0x31')](db['DeskConfiguration'][_0xcba8('0x2b')]);_0x6e1f0c[_0xcba8('0x30')]=_[_0xcba8('0x31')](_0x580e7b[_0xcba8('0x30')]);_0x6e1f0c[_0xcba8('0x32')]=_['intersection'](_0x6e1f0c['model'],_0x6e1f0c[_0xcba8('0x30')]);_0x113282[_0xcba8('0x33')]=_[_0xcba8('0x41')](_0x6e1f0c[_0xcba8('0x2f')],qs[_0xcba8('0x42')](_0x580e7b[_0xcba8('0x30')]['fields']));_0x113282[_0xcba8('0x33')]=_0x113282[_0xcba8('0x33')][_0xcba8('0x34')]?_0x113282[_0xcba8('0x33')]:_0x6e1f0c['model'];if(_0x580e7b['query'][_0xcba8('0x3c')]){_0x113282[_0xcba8('0x43')]=[{'all':!![]}];}_0x113282=_[_0xcba8('0x39')]({},_0x113282,_0x580e7b[_0xcba8('0x44')]);return db[_0xcba8('0x2a')][_0xcba8('0x45')](_0x113282)[_0xcba8('0x24')](handleEntityNotFound(_0x3b581d,null))[_0xcba8('0x24')](respondWithResult(_0x3b581d,null))[_0xcba8('0x3f')](handleError(_0x3b581d,null));};exports[_0xcba8('0x46')]=function(_0x76cf0c,_0x56a705){return db[_0xcba8('0x2a')][_0xcba8('0x46')](_0x76cf0c[_0xcba8('0x47')],{})['then'](respondWithResult(_0x56a705,0xc9))[_0xcba8('0x3f')](handleError(_0x56a705,null));};exports[_0xcba8('0x23')]=function(_0x1eb37e,_0x34858a){if(_0x1eb37e[_0xcba8('0x47')]['id']){delete _0x1eb37e['body']['id'];}return db[_0xcba8('0x2a')][_0xcba8('0x45')]({'where':{'id':_0x1eb37e[_0xcba8('0x48')]['id']}})[_0xcba8('0x24')](handleEntityNotFound(_0x34858a,null))[_0xcba8('0x24')](saveUpdates(_0x1eb37e[_0xcba8('0x47')],null))['then'](respondWithResult(_0x34858a,null))[_0xcba8('0x3f')](handleError(_0x34858a,null));};exports[_0xcba8('0x25')]=function(_0x42aa4d,_0x57f72f){return db[_0xcba8('0x2a')][_0xcba8('0x45')]({'where':{'id':_0x42aa4d['params']['id']}})[_0xcba8('0x24')](handleEntityNotFound(_0x57f72f,null))[_0xcba8('0x24')](removeEntity(_0x57f72f,null))[_0xcba8('0x3f')](handleError(_0x57f72f,null));};exports[_0xcba8('0x49')]=function(_0x1ef89f,_0x3ac416,_0x1b8813){var _0x4c6397={};var _0x348381={};var _0x1b563d;var _0x178c83;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1ef89f[_0xcba8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ac416,null))['then'](function(_0x49cbde){if(_0x49cbde){_0x1b563d=_0x49cbde;_0x348381['model']=_[_0xcba8('0x31')](db['DeskField'][_0xcba8('0x2b')]);_0x348381[_0xcba8('0x30')]=_['keys'](_0x1ef89f[_0xcba8('0x30')]);_0x348381['filters']=_[_0xcba8('0x41')](_0x348381[_0xcba8('0x2f')],_0x348381[_0xcba8('0x30')]);_0x4c6397[_0xcba8('0x33')]=_['intersection'](_0x348381[_0xcba8('0x2f')],qs[_0xcba8('0x42')](_0x1ef89f[_0xcba8('0x30')]['fields']));_0x4c6397[_0xcba8('0x33')]=_0x4c6397[_0xcba8('0x33')][_0xcba8('0x34')]?_0x4c6397[_0xcba8('0x33')]:_0x348381[_0xcba8('0x2f')];_0x4c6397[_0xcba8('0x36')]=qs[_0xcba8('0x4a')](_0x1ef89f[_0xcba8('0x30')][_0xcba8('0x4a')]);_0x4c6397[_0xcba8('0x38')]=qs[_0xcba8('0x32')](_[_0xcba8('0x37')](_0x1ef89f[_0xcba8('0x30')],_0x348381[_0xcba8('0x32')]));if(_0x1ef89f[_0xcba8('0x30')][_0xcba8('0x4b')]){_0x4c6397[_0xcba8('0x38')]=_['merge'](_0x4c6397[_0xcba8('0x38')],{'$or':_[_0xcba8('0x29')](_0x4c6397[_0xcba8('0x33')],function(_0x319acf){var _0x62ea30={};_0x62ea30[_0x319acf]={'$like':'%'+_0x1ef89f['query'][_0xcba8('0x4b')]+'%'};return _0x62ea30;})});}_0x4c6397=_[_0xcba8('0x39')]({},_0x4c6397,_0x1ef89f[_0xcba8('0x44')]);return _0x1b563d[_0xcba8('0x49')](_0x4c6397);}})[_0xcba8('0x24')](function(_0x4996bb){if(_0x4996bb){_0x178c83=_0x4996bb[_0xcba8('0x34')];if(!_0x1ef89f[_0xcba8('0x30')]['hasOwnProperty'](_0xcba8('0x4c'))){_0x4c6397['limit']=qs['limit'](_0x1ef89f[_0xcba8('0x30')]['limit']);_0x4c6397['offset']=qs[_0xcba8('0x1b')](_0x1ef89f[_0xcba8('0x30')][_0xcba8('0x1b')]);}return _0x1b563d[_0xcba8('0x49')](_0x4c6397);}})['then'](function(_0x400351){if(_0x400351){return _0x400351?{'count':_0x178c83,'rows':_0x400351}:null;}})['then'](respondWithResult(_0x3ac416,null))[_0xcba8('0x3f')](handleError(_0x3ac416,null));};exports['getSubjects']=function(_0x463d55,_0x395248,_0x517da3){var _0x36a373={};var _0x3d79f2={};var _0x164e2d;var _0x14f6b5;return db[_0xcba8('0x2a')][_0xcba8('0x4d')]({'where':{'id':_0x463d55['params']['id']}})[_0xcba8('0x24')](handleEntityNotFound(_0x395248,null))[_0xcba8('0x24')](function(_0x433910){if(_0x433910){_0x164e2d=_0x433910;_0x3d79f2[_0xcba8('0x2f')]=_[_0xcba8('0x31')](db['DeskField']['rawAttributes']);_0x3d79f2[_0xcba8('0x30')]=_[_0xcba8('0x31')](_0x463d55[_0xcba8('0x30')]);_0x3d79f2['filters']=_[_0xcba8('0x41')](_0x3d79f2['model'],_0x3d79f2['query']);_0x36a373[_0xcba8('0x33')]=_[_0xcba8('0x41')](_0x3d79f2[_0xcba8('0x2f')],qs[_0xcba8('0x42')](_0x463d55[_0xcba8('0x30')][_0xcba8('0x42')]));_0x36a373[_0xcba8('0x33')]=_0x36a373[_0xcba8('0x33')]['length']?_0x36a373[_0xcba8('0x33')]:_0x3d79f2['model'];_0x36a373[_0xcba8('0x36')]=qs[_0xcba8('0x4a')](_0x463d55[_0xcba8('0x30')][_0xcba8('0x4a')]);_0x36a373[_0xcba8('0x38')]=qs['filters'](_[_0xcba8('0x37')](_0x463d55['query'],_0x3d79f2[_0xcba8('0x32')]));if(_0x463d55[_0xcba8('0x30')]['filter']){_0x36a373[_0xcba8('0x38')]=_[_0xcba8('0x39')](_0x36a373[_0xcba8('0x38')],{'$or':_[_0xcba8('0x29')](_0x36a373[_0xcba8('0x33')],function(_0x4a6593){var _0x5964fe={};_0x5964fe[_0x4a6593]={'$like':'%'+_0x463d55[_0xcba8('0x30')]['filter']+'%'};return _0x5964fe;})});}_0x36a373=_[_0xcba8('0x39')]({},_0x36a373,_0x463d55[_0xcba8('0x44')]);return _0x164e2d[_0xcba8('0x4e')](_0x36a373);}})[_0xcba8('0x24')](function(_0x4d41e7){if(_0x4d41e7){_0x14f6b5=_0x4d41e7[_0xcba8('0x34')];if(!_0x463d55[_0xcba8('0x30')]['hasOwnProperty'](_0xcba8('0x4c'))){_0x36a373[_0xcba8('0x1d')]=qs[_0xcba8('0x1d')](_0x463d55['query'][_0xcba8('0x1d')]);_0x36a373['offset']=qs[_0xcba8('0x1b')](_0x463d55[_0xcba8('0x30')]['offset']);}return _0x164e2d[_0xcba8('0x4e')](_0x36a373);}})[_0xcba8('0x24')](function(_0x3dc3ec){if(_0x3dc3ec){return _0x3dc3ec?{'count':_0x14f6b5,'rows':_0x3dc3ec}:null;}})[_0xcba8('0x24')](respondWithResult(_0x395248,null))[_0xcba8('0x3f')](handleError(_0x395248,null));};exports['getDescriptions']=function(_0x243b13,_0x239b73,_0x29fa24){var _0x12a36b={};var _0x136b54={};var _0x339589;var _0xdf6c1b;return db['DeskConfiguration'][_0xcba8('0x4d')]({'where':{'id':_0x243b13[_0xcba8('0x48')]['id']}})[_0xcba8('0x24')](handleEntityNotFound(_0x239b73,null))[_0xcba8('0x24')](function(_0x41758d){if(_0x41758d){_0x339589=_0x41758d;_0x136b54[_0xcba8('0x2f')]=_[_0xcba8('0x31')](db[_0xcba8('0x4f')][_0xcba8('0x2b')]);_0x136b54['query']=_[_0xcba8('0x31')](_0x243b13['query']);_0x136b54[_0xcba8('0x32')]=_['intersection'](_0x136b54[_0xcba8('0x2f')],_0x136b54[_0xcba8('0x30')]);_0x12a36b[_0xcba8('0x33')]=_[_0xcba8('0x41')](_0x136b54[_0xcba8('0x2f')],qs[_0xcba8('0x42')](_0x243b13[_0xcba8('0x30')][_0xcba8('0x42')]));_0x12a36b[_0xcba8('0x33')]=_0x12a36b['attributes'][_0xcba8('0x34')]?_0x12a36b[_0xcba8('0x33')]:_0x136b54[_0xcba8('0x2f')];_0x12a36b['order']=qs[_0xcba8('0x4a')](_0x243b13['query'][_0xcba8('0x4a')]);_0x12a36b[_0xcba8('0x38')]=qs[_0xcba8('0x32')](_[_0xcba8('0x37')](_0x243b13['query'],_0x136b54[_0xcba8('0x32')]));if(_0x243b13['query'][_0xcba8('0x4b')]){_0x12a36b[_0xcba8('0x38')]=_[_0xcba8('0x39')](_0x12a36b[_0xcba8('0x38')],{'$or':_[_0xcba8('0x29')](_0x12a36b['attributes'],function(_0x361bde){var _0x2ac6fd={};_0x2ac6fd[_0x361bde]={'$like':'%'+_0x243b13['query'][_0xcba8('0x4b')]+'%'};return _0x2ac6fd;})});}_0x12a36b=_[_0xcba8('0x39')]({},_0x12a36b,_0x243b13['options']);return _0x339589[_0xcba8('0x50')](_0x12a36b);}})['then'](function(_0x229f08){if(_0x229f08){_0xdf6c1b=_0x229f08[_0xcba8('0x34')];if(!_0x243b13['query'][_0xcba8('0x35')]('nolimit')){_0x12a36b['limit']=qs[_0xcba8('0x1d')](_0x243b13['query'][_0xcba8('0x1d')]);_0x12a36b['offset']=qs[_0xcba8('0x1b')](_0x243b13[_0xcba8('0x30')]['offset']);}return _0x339589[_0xcba8('0x50')](_0x12a36b);}})[_0xcba8('0x24')](function(_0xb714b9){if(_0xb714b9){return _0xb714b9?{'count':_0xdf6c1b,'rows':_0xb714b9}:null;}})[_0xcba8('0x24')](respondWithResult(_0x239b73,null))['catch'](handleError(_0x239b73,null));};exports[_0xcba8('0x51')]=function(_0x2f876d,_0x5c4973,_0x391e4d){var _0x381cc2={};var _0x55955f={};var _0x59c804;var _0x1855f4;return db[_0xcba8('0x2a')][_0xcba8('0x4d')]({'where':{'id':_0x2f876d[_0xcba8('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c4973,null))[_0xcba8('0x24')](function(_0x16d7aa){if(_0x16d7aa){_0x59c804=_0x16d7aa;_0x55955f['model']=_[_0xcba8('0x31')](db[_0xcba8('0x52')]['rawAttributes']);_0x55955f[_0xcba8('0x30')]=_[_0xcba8('0x31')](_0x2f876d[_0xcba8('0x30')]);_0x55955f[_0xcba8('0x32')]=_[_0xcba8('0x41')](_0x55955f[_0xcba8('0x2f')],_0x55955f[_0xcba8('0x30')]);_0x381cc2[_0xcba8('0x33')]=_[_0xcba8('0x41')](_0x55955f['model'],qs[_0xcba8('0x42')](_0x2f876d[_0xcba8('0x30')][_0xcba8('0x42')]));_0x381cc2[_0xcba8('0x33')]=_0x381cc2[_0xcba8('0x33')][_0xcba8('0x34')]?_0x381cc2[_0xcba8('0x33')]:_0x55955f['model'];_0x381cc2['order']=qs[_0xcba8('0x4a')](_0x2f876d[_0xcba8('0x30')]['sort']);_0x381cc2[_0xcba8('0x38')]=qs[_0xcba8('0x32')](_[_0xcba8('0x37')](_0x2f876d['query'],_0x55955f['filters']));if(_0x2f876d['query'][_0xcba8('0x4b')]){_0x381cc2[_0xcba8('0x38')]=_[_0xcba8('0x39')](_0x381cc2[_0xcba8('0x38')],{'$or':_[_0xcba8('0x29')](_0x381cc2[_0xcba8('0x33')],function(_0x2f6acd){var _0xeaa4ad={};_0xeaa4ad[_0x2f6acd]={'$like':'%'+_0x2f876d['query'][_0xcba8('0x4b')]+'%'};return _0xeaa4ad;})});}_0x381cc2=_[_0xcba8('0x39')]({},_0x381cc2,_0x2f876d[_0xcba8('0x44')]);return _0x59c804[_0xcba8('0x51')](_0x381cc2);}})['then'](function(_0x51a126){if(_0x51a126){_0x1855f4=_0x51a126[_0xcba8('0x34')];if(!_0x2f876d[_0xcba8('0x30')][_0xcba8('0x35')](_0xcba8('0x4c'))){_0x381cc2[_0xcba8('0x1d')]=qs[_0xcba8('0x1d')](_0x2f876d[_0xcba8('0x30')]['limit']);_0x381cc2['offset']=qs[_0xcba8('0x1b')](_0x2f876d[_0xcba8('0x30')][_0xcba8('0x1b')]);}return _0x59c804['getTags'](_0x381cc2);}})[_0xcba8('0x24')](function(_0x526ebf){if(_0x526ebf){return _0x526ebf?{'count':_0x1855f4,'rows':_0x526ebf}:null;}})[_0xcba8('0x24')](respondWithResult(_0x5c4973,null))[_0xcba8('0x3f')](handleError(_0x5c4973,null));};exports[_0xcba8('0x53')]=function(_0x3b6f60,_0x1eb354,_0x452872){if(_0x3b6f60[_0xcba8('0x47')]['id']){delete _0x3b6f60['body']['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x3b6f60['params']['id']}})[_0xcba8('0x24')](handleEntityNotFound(_0x1eb354,null))['then'](function(_0x839ea0){if(_0x839ea0){return _0x839ea0[_0xcba8('0x53')](_0x3b6f60[_0xcba8('0x47')][_0xcba8('0x54')]||[]);}return null;})[_0xcba8('0x24')](respondWithResult(_0x1eb354,null))[_0xcba8('0x3f')](handleError(_0x1eb354,null));}; \ No newline at end of file +var _0x9ddf=['keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','where','merge','type','filter','includeAll','findAll','params','include','options','find','catch','create','body','getFields','findOne','order','getSubjects','DeskField','getDescriptions','hasOwnProperty','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','query'];(function(_0x5560f6,_0x225f9c){var _0x25d4ef=function(_0xa642c0){while(--_0xa642c0){_0x5560f6['push'](_0x5560f6['shift']());}};_0x25d4ef(++_0x225f9c);}(_0x9ddf,0xc6));var _0xf9dd=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9ddf[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9dd('0x0'));var zipdir=require(_0xf9dd('0x1'));var jsonpatch=require(_0xf9dd('0x2'));var rp=require(_0xf9dd('0x3'));var moment=require('moment');var BPromise=require(_0xf9dd('0x4'));var Mustache=require(_0xf9dd('0x5'));var util=require(_0xf9dd('0x6'));var path=require(_0xf9dd('0x7'));var sox=require('sox');var csv=require(_0xf9dd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9dd('0x9'));var _=require(_0xf9dd('0xa'));var squel=require(_0xf9dd('0xb'));var crypto=require(_0xf9dd('0xc'));var jsforce=require(_0xf9dd('0xd'));var deskjs=require(_0xf9dd('0xe'));var toCsv=require(_0xf9dd('0x8'));var querystring=require(_0xf9dd('0xf'));var Papa=require(_0xf9dd('0x10'));var Redis=require(_0xf9dd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf9dd('0x12'));var hardwareService=require(_0xf9dd('0x13'));var logger=require(_0xf9dd('0x14'))(_0xf9dd('0x15'));var utils=require(_0xf9dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf9dd('0x17'));var db=require(_0xf9dd('0x18'))['db'];function respondWithStatusCode(_0x977bb2,_0x281d45){_0x281d45=_0x281d45||0xcc;return function(_0x1f0170){if(_0x1f0170){return _0x977bb2[_0xf9dd('0x19')](_0x281d45);}return _0x977bb2[_0xf9dd('0x1a')](_0x281d45)[_0xf9dd('0x1b')]();};}function respondWithResult(_0x2864c4,_0x47d08a){_0x47d08a=_0x47d08a||0xc8;return function(_0x3a3f72){if(_0x3a3f72){return _0x2864c4[_0xf9dd('0x1a')](_0x47d08a)[_0xf9dd('0x1c')](_0x3a3f72);}};}function respondWithFilteredResult(_0x3230ed,_0x35e305){return function(_0x1b99a9){if(_0x1b99a9){var _0x52f526=typeof _0x35e305[_0xf9dd('0x1d')]===_0xf9dd('0x1e')&&typeof _0x35e305['limit']===_0xf9dd('0x1e');var _0x1a09b5=_0x1b99a9[_0xf9dd('0x1f')];var _0x3670bc=_0x52f526?0x0:_0x35e305[_0xf9dd('0x1d')];var _0xd2809c=_0x52f526?_0x1b99a9[_0xf9dd('0x1f')]:_0x35e305[_0xf9dd('0x1d')]+_0x35e305[_0xf9dd('0x20')];var _0x2091a8;if(_0xd2809c>=_0x1a09b5){_0xd2809c=_0x1a09b5;_0x2091a8=0xc8;}else{_0x2091a8=0xce;}_0x3230ed[_0xf9dd('0x1a')](_0x2091a8);return _0x3230ed[_0xf9dd('0x21')](_0xf9dd('0x22'),_0x3670bc+'-'+_0xd2809c+'/'+_0x1a09b5)[_0xf9dd('0x1c')](_0x1b99a9);}return null;};}function patchUpdates(_0xe87bd5){return function(_0x247f00){try{jsonpatch['apply'](_0x247f00,_0xe87bd5,!![]);}catch(_0x129426){return BPromise['reject'](_0x129426);}return _0x247f00[_0xf9dd('0x23')]();};}function saveUpdates(_0x4b7129,_0x4fe044){return function(_0x5b9873){if(_0x5b9873){return _0x5b9873[_0xf9dd('0x24')](_0x4b7129)[_0xf9dd('0x25')](function(_0x4113d4){return _0x4113d4;});}return null;};}function removeEntity(_0x4a6268,_0x2dd5cf){return function(_0x10a9bd){if(_0x10a9bd){return _0x10a9bd[_0xf9dd('0x26')]()[_0xf9dd('0x25')](function(){_0x4a6268[_0xf9dd('0x1a')](0xcc)[_0xf9dd('0x1b')]();});}};}function handleEntityNotFound(_0x5a45e7,_0xdb58f2){return function(_0x137429){if(!_0x137429){_0x5a45e7[_0xf9dd('0x19')](0x194);}return _0x137429;};}function handleError(_0x33f332,_0x5b4dc4){_0x5b4dc4=_0x5b4dc4||0x1f4;return function(_0x425cfe){logger[_0xf9dd('0x27')](_0x425cfe[_0xf9dd('0x28')]);if(_0x425cfe[_0xf9dd('0x29')]){delete _0x425cfe[_0xf9dd('0x29')];}_0x33f332[_0xf9dd('0x1a')](_0x5b4dc4)[_0xf9dd('0x2a')](_0x425cfe);};}exports[_0xf9dd('0x2b')]=function(_0x2b7e19,_0x38b339){var _0x5388eb={},_0x3ef967={},_0x47f723={'count':0x0,'rows':[]};var _0x8f18e7=_[_0xf9dd('0x2c')](db[_0xf9dd('0x2d')][_0xf9dd('0x2e')],function(_0x31a46f){return{'name':_0x31a46f[_0xf9dd('0x2f')],'type':_0x31a46f['type'][_0xf9dd('0x30')]};});_0x3ef967[_0xf9dd('0x31')]=_[_0xf9dd('0x2c')](_0x8f18e7,_0xf9dd('0x29'));_0x3ef967[_0xf9dd('0x32')]=_[_0xf9dd('0x33')](_0x2b7e19[_0xf9dd('0x32')]);_0x3ef967['filters']=_[_0xf9dd('0x34')](_0x3ef967[_0xf9dd('0x31')],_0x3ef967['query']);_0x5388eb[_0xf9dd('0x35')]=_[_0xf9dd('0x34')](_0x3ef967[_0xf9dd('0x31')],qs[_0xf9dd('0x36')](_0x2b7e19[_0xf9dd('0x32')]['fields']));_0x5388eb['attributes']=_0x5388eb['attributes'][_0xf9dd('0x37')]?_0x5388eb[_0xf9dd('0x35')]:_0x3ef967[_0xf9dd('0x31')];if(!_0x2b7e19['query']['hasOwnProperty'](_0xf9dd('0x38'))){_0x5388eb[_0xf9dd('0x20')]=qs[_0xf9dd('0x20')](_0x2b7e19[_0xf9dd('0x32')][_0xf9dd('0x20')]);_0x5388eb[_0xf9dd('0x1d')]=qs[_0xf9dd('0x1d')](_0x2b7e19['query'][_0xf9dd('0x1d')]);}_0x5388eb['order']=qs[_0xf9dd('0x39')](_0x2b7e19[_0xf9dd('0x32')][_0xf9dd('0x39')]);_0x5388eb['where']=qs[_0xf9dd('0x3a')](_[_0xf9dd('0x3b')](_0x2b7e19['query'],_0x3ef967[_0xf9dd('0x3a')]),_0x8f18e7);if(_0x2b7e19['query']['filter']){_0x5388eb[_0xf9dd('0x3c')]=_[_0xf9dd('0x3d')](_0x5388eb[_0xf9dd('0x3c')],{'$or':_[_0xf9dd('0x2c')](_0x8f18e7,function(_0x11a9fe){if(_0x11a9fe[_0xf9dd('0x3e')]!=='VIRTUAL'){var _0xc808b1={};_0xc808b1[_0x11a9fe[_0xf9dd('0x29')]]={'$like':'%'+_0x2b7e19[_0xf9dd('0x32')][_0xf9dd('0x3f')]+'%'};return _0xc808b1;}})});}_0x5388eb=_[_0xf9dd('0x3d')]({},_0x5388eb,_0x2b7e19['options']);var _0xe82485={'where':_0x5388eb[_0xf9dd('0x3c')]};return db['DeskConfiguration'][_0xf9dd('0x1f')](_0xe82485)[_0xf9dd('0x25')](function(_0x309694){_0x47f723[_0xf9dd('0x1f')]=_0x309694;if(_0x2b7e19[_0xf9dd('0x32')][_0xf9dd('0x40')]){_0x5388eb['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xf9dd('0x41')](_0x5388eb);})[_0xf9dd('0x25')](function(_0x2f9277){_0x47f723['rows']=_0x2f9277;return _0x47f723;})['then'](respondWithFilteredResult(_0x38b339,_0x5388eb))['catch'](handleError(_0x38b339,null));};exports['show']=function(_0x159323,_0x437781){var _0x1167c6={'raw':![],'where':{'id':_0x159323[_0xf9dd('0x42')]['id']}},_0x4a363e={};_0x4a363e[_0xf9dd('0x31')]=_['keys'](db[_0xf9dd('0x2d')][_0xf9dd('0x2e')]);_0x4a363e['query']=_[_0xf9dd('0x33')](_0x159323[_0xf9dd('0x32')]);_0x4a363e[_0xf9dd('0x3a')]=_[_0xf9dd('0x34')](_0x4a363e[_0xf9dd('0x31')],_0x4a363e[_0xf9dd('0x32')]);_0x1167c6[_0xf9dd('0x35')]=_[_0xf9dd('0x34')](_0x4a363e[_0xf9dd('0x31')],qs[_0xf9dd('0x36')](_0x159323['query'][_0xf9dd('0x36')]));_0x1167c6[_0xf9dd('0x35')]=_0x1167c6['attributes'][_0xf9dd('0x37')]?_0x1167c6[_0xf9dd('0x35')]:_0x4a363e[_0xf9dd('0x31')];if(_0x159323[_0xf9dd('0x32')][_0xf9dd('0x40')]){_0x1167c6[_0xf9dd('0x43')]=[{'all':!![]}];}_0x1167c6=_[_0xf9dd('0x3d')]({},_0x1167c6,_0x159323[_0xf9dd('0x44')]);return db[_0xf9dd('0x2d')][_0xf9dd('0x45')](_0x1167c6)['then'](handleEntityNotFound(_0x437781,null))['then'](respondWithResult(_0x437781,null))[_0xf9dd('0x46')](handleError(_0x437781,null));};exports[_0xf9dd('0x47')]=function(_0xfef772,_0x5405d9){return db[_0xf9dd('0x2d')][_0xf9dd('0x47')](_0xfef772[_0xf9dd('0x48')],{})['then'](respondWithResult(_0x5405d9,0xc9))[_0xf9dd('0x46')](handleError(_0x5405d9,null));};exports[_0xf9dd('0x24')]=function(_0x2b15e8,_0x933abe){if(_0x2b15e8[_0xf9dd('0x48')]['id']){delete _0x2b15e8[_0xf9dd('0x48')]['id'];}return db[_0xf9dd('0x2d')][_0xf9dd('0x45')]({'where':{'id':_0x2b15e8[_0xf9dd('0x42')]['id']}})['then'](handleEntityNotFound(_0x933abe,null))[_0xf9dd('0x25')](saveUpdates(_0x2b15e8['body'],null))[_0xf9dd('0x25')](respondWithResult(_0x933abe,null))[_0xf9dd('0x46')](handleError(_0x933abe,null));};exports['destroy']=function(_0x1abb5a,_0x464b6e){return db[_0xf9dd('0x2d')][_0xf9dd('0x45')]({'where':{'id':_0x1abb5a[_0xf9dd('0x42')]['id']}})['then'](handleEntityNotFound(_0x464b6e,null))['then'](removeEntity(_0x464b6e,null))[_0xf9dd('0x46')](handleError(_0x464b6e,null));};exports[_0xf9dd('0x49')]=function(_0x33ba51,_0x53cfc1,_0x481633){var _0x59afbd={};var _0x300559={};var _0x2facc7;var _0x4dc2cf;return db[_0xf9dd('0x2d')][_0xf9dd('0x4a')]({'where':{'id':_0x33ba51[_0xf9dd('0x42')]['id']}})[_0xf9dd('0x25')](handleEntityNotFound(_0x53cfc1,null))[_0xf9dd('0x25')](function(_0x40a21c){if(_0x40a21c){_0x2facc7=_0x40a21c;_0x300559[_0xf9dd('0x31')]=_[_0xf9dd('0x33')](db['DeskField'][_0xf9dd('0x2e')]);_0x300559[_0xf9dd('0x32')]=_[_0xf9dd('0x33')](_0x33ba51[_0xf9dd('0x32')]);_0x300559['filters']=_[_0xf9dd('0x34')](_0x300559[_0xf9dd('0x31')],_0x300559[_0xf9dd('0x32')]);_0x59afbd[_0xf9dd('0x35')]=_[_0xf9dd('0x34')](_0x300559['model'],qs[_0xf9dd('0x36')](_0x33ba51[_0xf9dd('0x32')][_0xf9dd('0x36')]));_0x59afbd[_0xf9dd('0x35')]=_0x59afbd['attributes'][_0xf9dd('0x37')]?_0x59afbd[_0xf9dd('0x35')]:_0x300559[_0xf9dd('0x31')];_0x59afbd[_0xf9dd('0x4b')]=qs[_0xf9dd('0x39')](_0x33ba51[_0xf9dd('0x32')]['sort']);_0x59afbd[_0xf9dd('0x3c')]=qs[_0xf9dd('0x3a')](_[_0xf9dd('0x3b')](_0x33ba51[_0xf9dd('0x32')],_0x300559['filters']));if(_0x33ba51[_0xf9dd('0x32')][_0xf9dd('0x3f')]){_0x59afbd[_0xf9dd('0x3c')]=_[_0xf9dd('0x3d')](_0x59afbd[_0xf9dd('0x3c')],{'$or':_['map'](_0x59afbd[_0xf9dd('0x35')],function(_0x3d9f13){var _0x5f710b={};_0x5f710b[_0x3d9f13]={'$like':'%'+_0x33ba51[_0xf9dd('0x32')][_0xf9dd('0x3f')]+'%'};return _0x5f710b;})});}_0x59afbd=_[_0xf9dd('0x3d')]({},_0x59afbd,_0x33ba51[_0xf9dd('0x44')]);return _0x2facc7[_0xf9dd('0x49')](_0x59afbd);}})[_0xf9dd('0x25')](function(_0x3da58b){if(_0x3da58b){_0x4dc2cf=_0x3da58b[_0xf9dd('0x37')];if(!_0x33ba51['query']['hasOwnProperty']('nolimit')){_0x59afbd['limit']=qs['limit'](_0x33ba51[_0xf9dd('0x32')][_0xf9dd('0x20')]);_0x59afbd[_0xf9dd('0x1d')]=qs[_0xf9dd('0x1d')](_0x33ba51[_0xf9dd('0x32')][_0xf9dd('0x1d')]);}return _0x2facc7['getFields'](_0x59afbd);}})['then'](function(_0x5900bf){if(_0x5900bf){return _0x5900bf?{'count':_0x4dc2cf,'rows':_0x5900bf}:null;}})[_0xf9dd('0x25')](respondWithResult(_0x53cfc1,null))[_0xf9dd('0x46')](handleError(_0x53cfc1,null));};exports[_0xf9dd('0x4c')]=function(_0x1468fb,_0x4b7d17,_0x413fec){var _0x1a8f73={};var _0x5dd23d={};var _0x2c82ef;var _0x2c5512;return db[_0xf9dd('0x2d')][_0xf9dd('0x4a')]({'where':{'id':_0x1468fb['params']['id']}})[_0xf9dd('0x25')](handleEntityNotFound(_0x4b7d17,null))['then'](function(_0x4d263d){if(_0x4d263d){_0x2c82ef=_0x4d263d;_0x5dd23d[_0xf9dd('0x31')]=_['keys'](db[_0xf9dd('0x4d')][_0xf9dd('0x2e')]);_0x5dd23d['query']=_[_0xf9dd('0x33')](_0x1468fb[_0xf9dd('0x32')]);_0x5dd23d['filters']=_[_0xf9dd('0x34')](_0x5dd23d['model'],_0x5dd23d[_0xf9dd('0x32')]);_0x1a8f73[_0xf9dd('0x35')]=_[_0xf9dd('0x34')](_0x5dd23d['model'],qs[_0xf9dd('0x36')](_0x1468fb[_0xf9dd('0x32')][_0xf9dd('0x36')]));_0x1a8f73[_0xf9dd('0x35')]=_0x1a8f73[_0xf9dd('0x35')][_0xf9dd('0x37')]?_0x1a8f73[_0xf9dd('0x35')]:_0x5dd23d[_0xf9dd('0x31')];_0x1a8f73[_0xf9dd('0x4b')]=qs[_0xf9dd('0x39')](_0x1468fb[_0xf9dd('0x32')][_0xf9dd('0x39')]);_0x1a8f73[_0xf9dd('0x3c')]=qs[_0xf9dd('0x3a')](_[_0xf9dd('0x3b')](_0x1468fb[_0xf9dd('0x32')],_0x5dd23d[_0xf9dd('0x3a')]));if(_0x1468fb[_0xf9dd('0x32')]['filter']){_0x1a8f73[_0xf9dd('0x3c')]=_['merge'](_0x1a8f73['where'],{'$or':_[_0xf9dd('0x2c')](_0x1a8f73[_0xf9dd('0x35')],function(_0x32fe2d){var _0x3ae45a={};_0x3ae45a[_0x32fe2d]={'$like':'%'+_0x1468fb[_0xf9dd('0x32')][_0xf9dd('0x3f')]+'%'};return _0x3ae45a;})});}_0x1a8f73=_[_0xf9dd('0x3d')]({},_0x1a8f73,_0x1468fb['options']);return _0x2c82ef[_0xf9dd('0x4c')](_0x1a8f73);}})[_0xf9dd('0x25')](function(_0x45a170){if(_0x45a170){_0x2c5512=_0x45a170[_0xf9dd('0x37')];if(!_0x1468fb[_0xf9dd('0x32')]['hasOwnProperty'](_0xf9dd('0x38'))){_0x1a8f73[_0xf9dd('0x20')]=qs['limit'](_0x1468fb[_0xf9dd('0x32')][_0xf9dd('0x20')]);_0x1a8f73[_0xf9dd('0x1d')]=qs['offset'](_0x1468fb[_0xf9dd('0x32')][_0xf9dd('0x1d')]);}return _0x2c82ef[_0xf9dd('0x4c')](_0x1a8f73);}})['then'](function(_0x6825bc){if(_0x6825bc){return _0x6825bc?{'count':_0x2c5512,'rows':_0x6825bc}:null;}})[_0xf9dd('0x25')](respondWithResult(_0x4b7d17,null))[_0xf9dd('0x46')](handleError(_0x4b7d17,null));};exports['getDescriptions']=function(_0x4aeda8,_0x134299,_0x67cb7e){var _0x2f521c={};var _0x30bb5b={};var _0x39facd;var _0x493b99;return db[_0xf9dd('0x2d')][_0xf9dd('0x4a')]({'where':{'id':_0x4aeda8[_0xf9dd('0x42')]['id']}})[_0xf9dd('0x25')](handleEntityNotFound(_0x134299,null))[_0xf9dd('0x25')](function(_0x5c0756){if(_0x5c0756){_0x39facd=_0x5c0756;_0x30bb5b[_0xf9dd('0x31')]=_[_0xf9dd('0x33')](db['DeskField'][_0xf9dd('0x2e')]);_0x30bb5b[_0xf9dd('0x32')]=_['keys'](_0x4aeda8[_0xf9dd('0x32')]);_0x30bb5b[_0xf9dd('0x3a')]=_[_0xf9dd('0x34')](_0x30bb5b[_0xf9dd('0x31')],_0x30bb5b[_0xf9dd('0x32')]);_0x2f521c[_0xf9dd('0x35')]=_['intersection'](_0x30bb5b['model'],qs['fields'](_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x36')]));_0x2f521c[_0xf9dd('0x35')]=_0x2f521c[_0xf9dd('0x35')]['length']?_0x2f521c[_0xf9dd('0x35')]:_0x30bb5b[_0xf9dd('0x31')];_0x2f521c['order']=qs[_0xf9dd('0x39')](_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x39')]);_0x2f521c[_0xf9dd('0x3c')]=qs[_0xf9dd('0x3a')](_[_0xf9dd('0x3b')](_0x4aeda8['query'],_0x30bb5b[_0xf9dd('0x3a')]));if(_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x3f')]){_0x2f521c[_0xf9dd('0x3c')]=_[_0xf9dd('0x3d')](_0x2f521c[_0xf9dd('0x3c')],{'$or':_[_0xf9dd('0x2c')](_0x2f521c['attributes'],function(_0x3df0c6){var _0x1ab866={};_0x1ab866[_0x3df0c6]={'$like':'%'+_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x3f')]+'%'};return _0x1ab866;})});}_0x2f521c=_['merge']({},_0x2f521c,_0x4aeda8[_0xf9dd('0x44')]);return _0x39facd[_0xf9dd('0x4e')](_0x2f521c);}})[_0xf9dd('0x25')](function(_0x1e6375){if(_0x1e6375){_0x493b99=_0x1e6375['length'];if(!_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x4f')](_0xf9dd('0x38'))){_0x2f521c[_0xf9dd('0x20')]=qs['limit'](_0x4aeda8[_0xf9dd('0x32')][_0xf9dd('0x20')]);_0x2f521c['offset']=qs[_0xf9dd('0x1d')](_0x4aeda8['query'][_0xf9dd('0x1d')]);}return _0x39facd[_0xf9dd('0x4e')](_0x2f521c);}})['then'](function(_0x42bfba){if(_0x42bfba){return _0x42bfba?{'count':_0x493b99,'rows':_0x42bfba}:null;}})[_0xf9dd('0x25')](respondWithResult(_0x134299,null))[_0xf9dd('0x46')](handleError(_0x134299,null));};exports[_0xf9dd('0x50')]=function(_0x370073,_0x466a33,_0xd33d2f){var _0x3371fe={};var _0x5f1137={};var _0x17eddd;var _0x4d9a1e;return db[_0xf9dd('0x2d')][_0xf9dd('0x4a')]({'where':{'id':_0x370073[_0xf9dd('0x42')]['id']}})[_0xf9dd('0x25')](handleEntityNotFound(_0x466a33,null))[_0xf9dd('0x25')](function(_0xab444c){if(_0xab444c){_0x17eddd=_0xab444c;_0x5f1137[_0xf9dd('0x31')]=_[_0xf9dd('0x33')](db[_0xf9dd('0x51')][_0xf9dd('0x2e')]);_0x5f1137[_0xf9dd('0x32')]=_['keys'](_0x370073[_0xf9dd('0x32')]);_0x5f1137['filters']=_['intersection'](_0x5f1137[_0xf9dd('0x31')],_0x5f1137[_0xf9dd('0x32')]);_0x3371fe[_0xf9dd('0x35')]=_[_0xf9dd('0x34')](_0x5f1137['model'],qs[_0xf9dd('0x36')](_0x370073[_0xf9dd('0x32')][_0xf9dd('0x36')]));_0x3371fe[_0xf9dd('0x35')]=_0x3371fe['attributes']['length']?_0x3371fe[_0xf9dd('0x35')]:_0x5f1137['model'];_0x3371fe['order']=qs[_0xf9dd('0x39')](_0x370073[_0xf9dd('0x32')]['sort']);_0x3371fe['where']=qs[_0xf9dd('0x3a')](_[_0xf9dd('0x3b')](_0x370073[_0xf9dd('0x32')],_0x5f1137['filters']));if(_0x370073[_0xf9dd('0x32')][_0xf9dd('0x3f')]){_0x3371fe['where']=_[_0xf9dd('0x3d')](_0x3371fe['where'],{'$or':_[_0xf9dd('0x2c')](_0x3371fe[_0xf9dd('0x35')],function(_0x4bd44a){var _0x425f70={};_0x425f70[_0x4bd44a]={'$like':'%'+_0x370073[_0xf9dd('0x32')][_0xf9dd('0x3f')]+'%'};return _0x425f70;})});}_0x3371fe=_[_0xf9dd('0x3d')]({},_0x3371fe,_0x370073[_0xf9dd('0x44')]);return _0x17eddd[_0xf9dd('0x50')](_0x3371fe);}})['then'](function(_0x10bced){if(_0x10bced){_0x4d9a1e=_0x10bced['length'];if(!_0x370073[_0xf9dd('0x32')][_0xf9dd('0x4f')](_0xf9dd('0x38'))){_0x3371fe[_0xf9dd('0x20')]=qs['limit'](_0x370073[_0xf9dd('0x32')][_0xf9dd('0x20')]);_0x3371fe[_0xf9dd('0x1d')]=qs['offset'](_0x370073[_0xf9dd('0x32')][_0xf9dd('0x1d')]);}return _0x17eddd[_0xf9dd('0x50')](_0x3371fe);}})[_0xf9dd('0x25')](function(_0x35949a){if(_0x35949a){return _0x35949a?{'count':_0x4d9a1e,'rows':_0x35949a}:null;}})['then'](respondWithResult(_0x466a33,null))[_0xf9dd('0x46')](handleError(_0x466a33,null));};exports[_0xf9dd('0x52')]=function(_0x2fac04,_0x30e3fe,_0x3f66fd){if(_0x2fac04[_0xf9dd('0x48')]['id']){delete _0x2fac04[_0xf9dd('0x48')]['id'];}return db[_0xf9dd('0x2d')][_0xf9dd('0x4a')]({'where':{'id':_0x2fac04[_0xf9dd('0x42')]['id']}})[_0xf9dd('0x25')](handleEntityNotFound(_0x30e3fe,null))[_0xf9dd('0x25')](function(_0x445d69){if(_0x445d69){return _0x445d69['setTags'](_0x2fac04[_0xf9dd('0x48')]['ids']||[]);}return null;})[_0xf9dd('0x25')](respondWithResult(_0x30e3fe,null))['catch'](handleError(_0x30e3fe,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 8d9c79e..069a18d 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 _0xd4bd=['./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3a5959,_0x177af3){var _0x5358e7=function(_0x5e0dd6){while(--_0x5e0dd6){_0x3a5959['push'](_0x3a5959['shift']());}};_0x5358e7(++_0x177af3);}(_0xd4bd,0x15f));var _0xdd4b=function(_0x4ac007,_0x3632ae){_0x4ac007=_0x4ac007-0x0;var _0x42e227=_0xd4bd[_0x4ac007];return _0x42e227;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var logger=require(_0xdd4b('0x2'))(_0xdd4b('0x3'));var moment=require(_0xdd4b('0x4'));var BPromise=require('bluebird');var rp=require(_0xdd4b('0x5'));var fs=require('fs');var path=require(_0xdd4b('0x6'));var rimraf=require(_0xdd4b('0x7'));var config=require(_0xdd4b('0x8'));var attributes=require(_0xdd4b('0x9'));module['exports']=function(_0x48eda4,_0x1c72c7){return _0x48eda4['define'](_0xdd4b('0xa'),attributes,{'tableName':_0xdd4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcae6=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','path'];(function(_0x35b76f,_0x324c48){var _0x582906=function(_0x5e4a7b){while(--_0x5e4a7b){_0x35b76f['push'](_0x35b76f['shift']());}};_0x582906(++_0x324c48);}(_0xcae6,0x146));var _0x6cae=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xcae6[_0x4d08b8];return _0x70214a;};'use strict';var _=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var logger=require('../../config/logger')(_0x6cae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cae('0x3'));var rimraf=require(_0x6cae('0x4'));var config=require(_0x6cae('0x5'));var attributes=require(_0x6cae('0x6'));module[_0x6cae('0x7')]=function(_0x2b6cf3,_0x2d8114){return _0x2b6cf3[_0x6cae('0x8')](_0x6cae('0x9'),attributes,{'tableName':_0x6cae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index a14b556..9e7998a 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 _0xc893=['message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xc893,0x194));var _0x3c89=function(_0x3d6e20,_0x2bc829){_0x3d6e20=_0x3d6e20-0x0;var _0x310ab2=_0xc893[_0x3d6e20];return _0x310ab2;};'use strict';var _=require('lodash');var util=require(_0x3c89('0x0'));var moment=require(_0x3c89('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c89('0x2'));var db=require(_0x3c89('0x3'))['db'];var utils=require(_0x3c89('0x4'));var logger=require(_0x3c89('0x5'))(_0x3c89('0x6'));var config=require(_0x3c89('0x7'));var jayson=require(_0x3c89('0x8'));var client=jayson['client'][_0x3c89('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a0ec4,_0x189b7,_0x37cdcd){return new BPromise(function(_0x524125,_0x251b0c){return client['request'](_0x1a0ec4,_0x37cdcd)['then'](function(_0x3cfe79){logger['info'](_0x3c89('0xa'),_0x189b7,_0x3c89('0xb'));logger['debug'](_0x3c89('0xc'),_0x189b7,_0x3c89('0xb'),JSON[_0x3c89('0xd')](_0x3cfe79));if(_0x3cfe79[_0x3c89('0xe')]){if(_0x3cfe79[_0x3c89('0xe')][_0x3c89('0xf')]===0x1f4){logger[_0x3c89('0xe')](_0x3c89('0xa'),_0x189b7,_0x3cfe79[_0x3c89('0xe')][_0x3c89('0x10')]);return _0x251b0c(_0x3cfe79[_0x3c89('0xe')][_0x3c89('0x10')]);}logger[_0x3c89('0xe')](_0x3c89('0xa'),_0x189b7,_0x3cfe79['error'][_0x3c89('0x10')]);return _0x524125(_0x3cfe79[_0x3c89('0xe')][_0x3c89('0x10')]);}else{logger[_0x3c89('0x11')](_0x3c89('0xa'),_0x189b7,_0x3c89('0xb'));_0x524125(_0x3cfe79[_0x3c89('0x12')][_0x3c89('0x10')]);}})[_0x3c89('0x13')](function(_0x478744){logger[_0x3c89('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x189b7,_0x478744);_0x251b0c(_0x478744);});});} \ No newline at end of file +var _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x112929,_0x7da466){var _0x333c16=function(_0x762dc0){while(--_0x762dc0){_0x112929['push'](_0x112929['shift']());}};_0x333c16(++_0x7da466);}(_0x96f2,0xb0));var _0x296f=function(_0x679398,_0xaa9cd9){_0x679398=_0x679398-0x0;var _0x1368c1=_0x96f2[_0x679398];return _0x1368c1;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index dde7585..fa8c7fd 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 _0xe5e8=['fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4bd90d,_0x32001b){var _0x3948ed=function(_0x32eaf9){while(--_0x32eaf9){_0x4bd90d['push'](_0x4bd90d['shift']());}};_0x3948ed(++_0x32001b);}(_0xe5e8,0xe7));var _0x8e5e=function(_0x2a6f9f,_0x39f232){_0x2a6f9f=_0x2a6f9f-0x0;var _0x98124b=_0xe5e8[_0x2a6f9f];return _0x98124b;};'use strict';var multer=require(_0x8e5e('0x0'));var util=require(_0x8e5e('0x1'));var path=require(_0x8e5e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e5e('0x3'));var auth=require(_0x8e5e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8e5e('0x5'));var controller=require(_0x8e5e('0x6'));router[_0x8e5e('0x7')]('/',auth[_0x8e5e('0x8')](),controller[_0x8e5e('0x9')]);router['get'](_0x8e5e('0xa'),auth[_0x8e5e('0x8')](),controller[_0x8e5e('0xb')]);router['post']('/',auth[_0x8e5e('0x8')](),controller[_0x8e5e('0xc')]);router[_0x8e5e('0xd')](_0x8e5e('0xa'),auth[_0x8e5e('0x8')](),controller[_0x8e5e('0xe')]);router[_0x8e5e('0xf')](_0x8e5e('0xa'),auth[_0x8e5e('0x8')](),controller[_0x8e5e('0x10')]);module[_0x8e5e('0x11')]=router; \ No newline at end of file +var _0x733f=['show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x3bedd2,_0x41d736){var _0x3966d0=function(_0xf5cf6e){while(--_0xf5cf6e){_0x3bedd2['push'](_0x3bedd2['shift']());}};_0x3966d0(++_0x41d736);}(_0x733f,0x120));var _0xf733=function(_0x56bbd0,_0x4be5b8){_0x56bbd0=_0x56bbd0-0x0;var _0x32c8ce=_0x733f[_0x56bbd0];return _0x32c8ce;};'use strict';var multer=require(_0xf733('0x0'));var util=require('util');var path=require(_0xf733('0x1'));var timeout=require(_0xf733('0x2'));var express=require(_0xf733('0x3'));var router=express['Router']();var fs_extra=require(_0xf733('0x4'));var auth=require(_0xf733('0x5'));var interaction=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var controller=require(_0xf733('0x8'));router[_0xf733('0x9')]('/',auth[_0xf733('0xa')](),controller[_0xf733('0xb')]);router[_0xf733('0x9')]('/:id',auth[_0xf733('0xa')](),controller[_0xf733('0xc')]);router['post']('/',auth[_0xf733('0xa')](),controller[_0xf733('0xd')]);router[_0xf733('0xe')](_0xf733('0xf'),auth['isAuthenticated'](),controller[_0xf733('0x10')]);router[_0xf733('0x11')](_0xf733('0xf'),auth[_0xf733('0xa')](),controller[_0xf733('0x12')]);module[_0xf733('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 0a8fdf1..4b3fc5f 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 _0xcd12=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','picklist','STRING'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xcd12,0x1a0));var _0x2cd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd12[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2cd1('0x0'));module[_0x2cd1('0x1')]={'type':{'type':Sequelize[_0x2cd1('0x2')](_0x2cd1('0x3'),_0x2cd1('0x4'),'customVariable','keyValue',_0x2cd1('0x5')),'defaultValue':_0x2cd1('0x3')},'content':{'type':Sequelize[_0x2cd1('0x6')]},'key':{'type':Sequelize[_0x2cd1('0x6')]},'keyType':{'type':Sequelize[_0x2cd1('0x2')](_0x2cd1('0x3'),_0x2cd1('0x4'),_0x2cd1('0x7'))},'keyContent':{'type':Sequelize[_0x2cd1('0x6')]},'idField':{'type':Sequelize[_0x2cd1('0x6')]},'nameField':{'type':Sequelize[_0x2cd1('0x6')]},'customField':{'type':Sequelize[_0x2cd1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbf36=['picklist','STRING','customVariable','BOOLEAN','sequelize','string','keyValue'];(function(_0x6cf5ec,_0x194d2e){var _0x271c4f=function(_0x206fee){while(--_0x206fee){_0x6cf5ec['push'](_0x6cf5ec['shift']());}};_0x271c4f(++_0x194d2e);}(_0xbf36,0x115));var _0x6bf3=function(_0x149f69,_0x2fd9bd){_0x149f69=_0x149f69-0x0;var _0x57d8fc=_0xbf36[_0x149f69];return _0x57d8fc;};'use strict';var Sequelize=require(_0x6bf3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6bf3('0x1'),'variable','customVariable',_0x6bf3('0x2'),_0x6bf3('0x3')),'defaultValue':_0x6bf3('0x1')},'content':{'type':Sequelize[_0x6bf3('0x4')]},'key':{'type':Sequelize[_0x6bf3('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x6bf3('0x1'),'variable',_0x6bf3('0x5'))},'keyContent':{'type':Sequelize[_0x6bf3('0x4')]},'idField':{'type':Sequelize[_0x6bf3('0x4')]},'nameField':{'type':Sequelize[_0x6bf3('0x4')]},'customField':{'type':Sequelize[_0x6bf3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6bf3('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 74dac44..7838970 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 _0xe191=['fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','offset','order','sort','where','filter','merge','VIRTUAL','options','DeskField','includeAll','include','findAll','rows','catch','params'];(function(_0x4da2f0,_0x3070c7){var _0x36af1c=function(_0x4ac5ae){while(--_0x4ac5ae){_0x4da2f0['push'](_0x4da2f0['shift']());}};_0x36af1c(++_0x3070c7);}(_0xe191,0x98));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1e19('0x0'));var rimraf=require(_0x1e19('0x1'));var zipdir=require(_0x1e19('0x2'));var jsonpatch=require(_0x1e19('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e19('0x4'));var Mustache=require(_0x1e19('0x5'));var util=require(_0x1e19('0x6'));var path=require('path');var sox=require(_0x1e19('0x7'));var csv=require(_0x1e19('0x8'));var ejs=require(_0x1e19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e19('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e19('0xb'));var deskjs=require(_0x1e19('0xc'));var toCsv=require(_0x1e19('0x8'));var querystring=require('querystring');var Papa=require(_0x1e19('0xd'));var Redis=require(_0x1e19('0xe'));var authService=require(_0x1e19('0xf'));var qs=require(_0x1e19('0x10'));var as=require(_0x1e19('0x11'));var hardwareService=require(_0x1e19('0x12'));var logger=require(_0x1e19('0x13'))(_0x1e19('0x14'));var utils=require(_0x1e19('0x15'));var config=require(_0x1e19('0x16'));var licenseUtil=require(_0x1e19('0x17'));var db=require(_0x1e19('0x18'))['db'];function respondWithStatusCode(_0x52d8ed,_0x378b76){_0x378b76=_0x378b76||0xcc;return function(_0x49233c){if(_0x49233c){return _0x52d8ed['sendStatus'](_0x378b76);}return _0x52d8ed['status'](_0x378b76)[_0x1e19('0x19')]();};}function respondWithResult(_0x2c8dc3,_0x5dd4b1){_0x5dd4b1=_0x5dd4b1||0xc8;return function(_0x4cafa3){if(_0x4cafa3){return _0x2c8dc3[_0x1e19('0x1a')](_0x5dd4b1)[_0x1e19('0x1b')](_0x4cafa3);}};}function respondWithFilteredResult(_0x362cb8,_0x328a66){return function(_0x3fd50a){if(_0x3fd50a){var _0x4960ac=typeof _0x328a66['offset']===_0x1e19('0x1c')&&typeof _0x328a66[_0x1e19('0x1d')]===_0x1e19('0x1c');var _0x1810a3=_0x3fd50a['count'];var _0xee5e1d=_0x4960ac?0x0:_0x328a66['offset'];var _0x45f69a=_0x4960ac?_0x3fd50a[_0x1e19('0x1e')]:_0x328a66['offset']+_0x328a66['limit'];var _0x64a8b8;if(_0x45f69a>=_0x1810a3){_0x45f69a=_0x1810a3;_0x64a8b8=0xc8;}else{_0x64a8b8=0xce;}_0x362cb8[_0x1e19('0x1a')](_0x64a8b8);return _0x362cb8[_0x1e19('0x1f')](_0x1e19('0x20'),_0xee5e1d+'-'+_0x45f69a+'/'+_0x1810a3)[_0x1e19('0x1b')](_0x3fd50a);}return null;};}function patchUpdates(_0x15c282){return function(_0x5be25){try{jsonpatch[_0x1e19('0x21')](_0x5be25,_0x15c282,!![]);}catch(_0x71e932){return BPromise[_0x1e19('0x22')](_0x71e932);}return _0x5be25[_0x1e19('0x23')]();};}function saveUpdates(_0x3c6435,_0x4b4fbd){return function(_0x44c152){if(_0x44c152){return _0x44c152[_0x1e19('0x24')](_0x3c6435)[_0x1e19('0x25')](function(_0xe3626){return _0xe3626;});}return null;};}function removeEntity(_0x23a06b,_0x3dfd30){return function(_0x1ed6f0){if(_0x1ed6f0){return _0x1ed6f0[_0x1e19('0x26')]()[_0x1e19('0x25')](function(){_0x23a06b['status'](0xcc)[_0x1e19('0x19')]();});}};}function handleEntityNotFound(_0x58c322,_0x1c8a35){return function(_0x16a7d2){if(!_0x16a7d2){_0x58c322[_0x1e19('0x27')](0x194);}return _0x16a7d2;};}function handleError(_0x3d2356,_0x188307){_0x188307=_0x188307||0x1f4;return function(_0x143b21){logger[_0x1e19('0x28')](_0x143b21['stack']);if(_0x143b21[_0x1e19('0x29')]){delete _0x143b21[_0x1e19('0x29')];}_0x3d2356[_0x1e19('0x1a')](_0x188307)[_0x1e19('0x2a')](_0x143b21);};}exports['index']=function(_0x4facc9,_0x499ffd){var _0x279c9b={},_0x5da3a3={},_0x2cfa0b={'count':0x0,'rows':[]};var _0x501777=_[_0x1e19('0x2b')](db['DeskField'][_0x1e19('0x2c')],function(_0x27dd2b){return{'name':_0x27dd2b[_0x1e19('0x2d')],'type':_0x27dd2b[_0x1e19('0x2e')][_0x1e19('0x2f')]};});_0x5da3a3['model']=_[_0x1e19('0x2b')](_0x501777,_0x1e19('0x29'));_0x5da3a3[_0x1e19('0x30')]=_[_0x1e19('0x31')](_0x4facc9[_0x1e19('0x30')]);_0x5da3a3[_0x1e19('0x32')]=_[_0x1e19('0x33')](_0x5da3a3[_0x1e19('0x34')],_0x5da3a3[_0x1e19('0x30')]);_0x279c9b['attributes']=_[_0x1e19('0x33')](_0x5da3a3['model'],qs['fields'](_0x4facc9[_0x1e19('0x30')]['fields']));_0x279c9b['attributes']=_0x279c9b[_0x1e19('0x35')][_0x1e19('0x36')]?_0x279c9b[_0x1e19('0x35')]:_0x5da3a3[_0x1e19('0x34')];if(!_0x4facc9[_0x1e19('0x30')]['hasOwnProperty']('nolimit')){_0x279c9b['limit']=qs[_0x1e19('0x1d')](_0x4facc9[_0x1e19('0x30')][_0x1e19('0x1d')]);_0x279c9b['offset']=qs[_0x1e19('0x37')](_0x4facc9['query'][_0x1e19('0x37')]);}_0x279c9b[_0x1e19('0x38')]=qs[_0x1e19('0x39')](_0x4facc9['query'][_0x1e19('0x39')]);_0x279c9b[_0x1e19('0x3a')]=qs[_0x1e19('0x32')](_['pick'](_0x4facc9['query'],_0x5da3a3[_0x1e19('0x32')]),_0x501777);if(_0x4facc9['query'][_0x1e19('0x3b')]){_0x279c9b['where']=_[_0x1e19('0x3c')](_0x279c9b[_0x1e19('0x3a')],{'$or':_['map'](_0x501777,function(_0x17a15a){if(_0x17a15a['type']!==_0x1e19('0x3d')){var _0x113b2f={};_0x113b2f[_0x17a15a[_0x1e19('0x29')]]={'$like':'%'+_0x4facc9['query'][_0x1e19('0x3b')]+'%'};return _0x113b2f;}})});}_0x279c9b=_[_0x1e19('0x3c')]({},_0x279c9b,_0x4facc9[_0x1e19('0x3e')]);var _0x121aa6={'where':_0x279c9b['where']};return db[_0x1e19('0x3f')][_0x1e19('0x1e')](_0x121aa6)['then'](function(_0x35bcbc){_0x2cfa0b[_0x1e19('0x1e')]=_0x35bcbc;if(_0x4facc9[_0x1e19('0x30')][_0x1e19('0x40')]){_0x279c9b[_0x1e19('0x41')]=[{'all':!![]}];}return db[_0x1e19('0x3f')][_0x1e19('0x42')](_0x279c9b);})[_0x1e19('0x25')](function(_0x42f28c){_0x2cfa0b[_0x1e19('0x43')]=_0x42f28c;return _0x2cfa0b;})[_0x1e19('0x25')](respondWithFilteredResult(_0x499ffd,_0x279c9b))[_0x1e19('0x44')](handleError(_0x499ffd,null));};exports['show']=function(_0x510e3a,_0x335853){var _0x1ab61a={'raw':!![],'where':{'id':_0x510e3a[_0x1e19('0x45')]['id']}},_0x4b49fa={};_0x4b49fa[_0x1e19('0x34')]=_[_0x1e19('0x31')](db[_0x1e19('0x3f')][_0x1e19('0x2c')]);_0x4b49fa[_0x1e19('0x30')]=_[_0x1e19('0x31')](_0x510e3a[_0x1e19('0x30')]);_0x4b49fa[_0x1e19('0x32')]=_[_0x1e19('0x33')](_0x4b49fa[_0x1e19('0x34')],_0x4b49fa[_0x1e19('0x30')]);_0x1ab61a[_0x1e19('0x35')]=_[_0x1e19('0x33')](_0x4b49fa[_0x1e19('0x34')],qs[_0x1e19('0x46')](_0x510e3a[_0x1e19('0x30')][_0x1e19('0x46')]));_0x1ab61a[_0x1e19('0x35')]=_0x1ab61a[_0x1e19('0x35')][_0x1e19('0x36')]?_0x1ab61a['attributes']:_0x4b49fa[_0x1e19('0x34')];if(_0x510e3a['query']['includeAll']){_0x1ab61a[_0x1e19('0x41')]=[{'all':!![]}];}_0x1ab61a=_[_0x1e19('0x3c')]({},_0x1ab61a,_0x510e3a['options']);return db[_0x1e19('0x3f')][_0x1e19('0x47')](_0x1ab61a)[_0x1e19('0x25')](handleEntityNotFound(_0x335853,null))[_0x1e19('0x25')](respondWithResult(_0x335853,null))[_0x1e19('0x44')](handleError(_0x335853,null));};exports[_0x1e19('0x48')]=function(_0x337e8b,_0x118ee9){return db[_0x1e19('0x3f')][_0x1e19('0x48')](_0x337e8b['body'],{})[_0x1e19('0x25')](respondWithResult(_0x118ee9,0xc9))[_0x1e19('0x44')](handleError(_0x118ee9,null));};exports[_0x1e19('0x24')]=function(_0x10e7fe,_0x557406){if(_0x10e7fe[_0x1e19('0x49')]['id']){delete _0x10e7fe[_0x1e19('0x49')]['id'];}return db[_0x1e19('0x3f')][_0x1e19('0x47')]({'where':{'id':_0x10e7fe[_0x1e19('0x45')]['id']}})[_0x1e19('0x25')](handleEntityNotFound(_0x557406,null))[_0x1e19('0x25')](saveUpdates(_0x10e7fe[_0x1e19('0x49')],null))[_0x1e19('0x25')](respondWithResult(_0x557406,null))[_0x1e19('0x44')](handleError(_0x557406,null));};exports[_0x1e19('0x26')]=function(_0x21dbdf,_0x4505bd){return db[_0x1e19('0x3f')][_0x1e19('0x47')]({'where':{'id':_0x21dbdf[_0x1e19('0x45')]['id']}})[_0x1e19('0x25')](handleEntityNotFound(_0x4505bd,null))[_0x1e19('0x25')](removeEntity(_0x4505bd,null))[_0x1e19('0x44')](handleError(_0x4505bd,null));}; \ No newline at end of file +var _0xc43c=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','DeskField','includeAll','include','rows','catch','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','sox','to-csv','ejs'];(function(_0x54e5ad,_0x41aebd){var _0x519aeb=function(_0x185a8f){while(--_0x185a8f){_0x54e5ad['push'](_0x54e5ad['shift']());}};_0x519aeb(++_0x41aebd);}(_0xc43c,0xd4));var _0xcc43=function(_0x5355ac,_0x3239f7){_0x5355ac=_0x5355ac-0x0;var _0x403c7c=_0xc43c[_0x5355ac];return _0x403c7c;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc43('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcc43('0x4'));var csv=require(_0xcc43('0x5'));var ejs=require(_0xcc43('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc43('0x7'));var squel=require(_0xcc43('0x8'));var crypto=require(_0xcc43('0x9'));var jsforce=require(_0xcc43('0xa'));var deskjs=require(_0xcc43('0xb'));var toCsv=require(_0xcc43('0x5'));var querystring=require(_0xcc43('0xc'));var Papa=require(_0xcc43('0xd'));var Redis=require('ioredis');var authService=require(_0xcc43('0xe'));var qs=require(_0xcc43('0xf'));var as=require(_0xcc43('0x10'));var hardwareService=require(_0xcc43('0x11'));var logger=require(_0xcc43('0x12'))(_0xcc43('0x13'));var utils=require(_0xcc43('0x14'));var config=require(_0xcc43('0x15'));var licenseUtil=require(_0xcc43('0x16'));var db=require(_0xcc43('0x17'))['db'];function respondWithStatusCode(_0x31257d,_0x52c7fb){_0x52c7fb=_0x52c7fb||0xcc;return function(_0x2d17bb){if(_0x2d17bb){return _0x31257d[_0xcc43('0x18')](_0x52c7fb);}return _0x31257d[_0xcc43('0x19')](_0x52c7fb)[_0xcc43('0x1a')]();};}function respondWithResult(_0x5c4e8d,_0x2ce18b){_0x2ce18b=_0x2ce18b||0xc8;return function(_0x446095){if(_0x446095){return _0x5c4e8d[_0xcc43('0x19')](_0x2ce18b)[_0xcc43('0x1b')](_0x446095);}};}function respondWithFilteredResult(_0xed8608,_0x538d67){return function(_0x2e2a21){if(_0x2e2a21){var _0x3a1933=typeof _0x538d67['offset']===_0xcc43('0x1c')&&typeof _0x538d67['limit']===_0xcc43('0x1c');var _0x43ed95=_0x2e2a21[_0xcc43('0x1d')];var _0x50348a=_0x3a1933?0x0:_0x538d67[_0xcc43('0x1e')];var _0x295ecb=_0x3a1933?_0x2e2a21[_0xcc43('0x1d')]:_0x538d67[_0xcc43('0x1e')]+_0x538d67['limit'];var _0x2d526e;if(_0x295ecb>=_0x43ed95){_0x295ecb=_0x43ed95;_0x2d526e=0xc8;}else{_0x2d526e=0xce;}_0xed8608[_0xcc43('0x19')](_0x2d526e);return _0xed8608['set'](_0xcc43('0x1f'),_0x50348a+'-'+_0x295ecb+'/'+_0x43ed95)['json'](_0x2e2a21);}return null;};}function patchUpdates(_0xcfb0d9){return function(_0x5dda76){try{jsonpatch[_0xcc43('0x20')](_0x5dda76,_0xcfb0d9,!![]);}catch(_0x2a604e){return BPromise[_0xcc43('0x21')](_0x2a604e);}return _0x5dda76['save']();};}function saveUpdates(_0x213757,_0x5e0a61){return function(_0x1a578f){if(_0x1a578f){return _0x1a578f[_0xcc43('0x22')](_0x213757)[_0xcc43('0x23')](function(_0x948783){return _0x948783;});}return null;};}function removeEntity(_0x36b655,_0x5b9195){return function(_0x2ba3d0){if(_0x2ba3d0){return _0x2ba3d0[_0xcc43('0x24')]()['then'](function(){_0x36b655[_0xcc43('0x19')](0xcc)[_0xcc43('0x1a')]();});}};}function handleEntityNotFound(_0x7838d0,_0x55fd66){return function(_0x35d2a1){if(!_0x35d2a1){_0x7838d0['sendStatus'](0x194);}return _0x35d2a1;};}function handleError(_0x26a407,_0xf78759){_0xf78759=_0xf78759||0x1f4;return function(_0x399d3a){logger[_0xcc43('0x25')](_0x399d3a[_0xcc43('0x26')]);if(_0x399d3a['name']){delete _0x399d3a[_0xcc43('0x27')];}_0x26a407[_0xcc43('0x19')](_0xf78759)[_0xcc43('0x28')](_0x399d3a);};}exports[_0xcc43('0x29')]=function(_0x246ecb,_0x5940da){var _0x4c1492={},_0x17acce={},_0x3a0779={'count':0x0,'rows':[]};var _0x28cc44=_[_0xcc43('0x2a')](db['DeskField'][_0xcc43('0x2b')],function(_0x3c0b77){return{'name':_0x3c0b77[_0xcc43('0x2c')],'type':_0x3c0b77[_0xcc43('0x2d')]['key']};});_0x17acce[_0xcc43('0x2e')]=_[_0xcc43('0x2a')](_0x28cc44,_0xcc43('0x27'));_0x17acce[_0xcc43('0x2f')]=_['keys'](_0x246ecb['query']);_0x17acce[_0xcc43('0x30')]=_[_0xcc43('0x31')](_0x17acce[_0xcc43('0x2e')],_0x17acce[_0xcc43('0x2f')]);_0x4c1492[_0xcc43('0x32')]=_[_0xcc43('0x31')](_0x17acce[_0xcc43('0x2e')],qs[_0xcc43('0x33')](_0x246ecb['query'][_0xcc43('0x33')]));_0x4c1492['attributes']=_0x4c1492['attributes'][_0xcc43('0x34')]?_0x4c1492[_0xcc43('0x32')]:_0x17acce[_0xcc43('0x2e')];if(!_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x35')]('nolimit')){_0x4c1492['limit']=qs['limit'](_0x246ecb['query'][_0xcc43('0x36')]);_0x4c1492[_0xcc43('0x1e')]=qs[_0xcc43('0x1e')](_0x246ecb['query'][_0xcc43('0x1e')]);}_0x4c1492[_0xcc43('0x37')]=qs[_0xcc43('0x38')](_0x246ecb['query'][_0xcc43('0x38')]);_0x4c1492[_0xcc43('0x39')]=qs['filters'](_[_0xcc43('0x3a')](_0x246ecb[_0xcc43('0x2f')],_0x17acce[_0xcc43('0x30')]),_0x28cc44);if(_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x3b')]){_0x4c1492[_0xcc43('0x39')]=_[_0xcc43('0x3c')](_0x4c1492[_0xcc43('0x39')],{'$or':_[_0xcc43('0x2a')](_0x28cc44,function(_0x34ba54){if(_0x34ba54[_0xcc43('0x2d')]!==_0xcc43('0x3d')){var _0x4c9965={};_0x4c9965[_0x34ba54[_0xcc43('0x27')]]={'$like':'%'+_0x246ecb['query'][_0xcc43('0x3b')]+'%'};return _0x4c9965;}})});}_0x4c1492=_[_0xcc43('0x3c')]({},_0x4c1492,_0x246ecb['options']);var _0x225c4b={'where':_0x4c1492['where']};return db[_0xcc43('0x3e')][_0xcc43('0x1d')](_0x225c4b)[_0xcc43('0x23')](function(_0x36646e){_0x3a0779[_0xcc43('0x1d')]=_0x36646e;if(_0x246ecb[_0xcc43('0x2f')][_0xcc43('0x3f')]){_0x4c1492[_0xcc43('0x40')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x4c1492);})['then'](function(_0x1a071e){_0x3a0779[_0xcc43('0x41')]=_0x1a071e;return _0x3a0779;})[_0xcc43('0x23')](respondWithFilteredResult(_0x5940da,_0x4c1492))[_0xcc43('0x42')](handleError(_0x5940da,null));};exports['show']=function(_0xfa36a7,_0x143229){var _0x408de6={'raw':!![],'where':{'id':_0xfa36a7['params']['id']}},_0x50e5af={};_0x50e5af[_0xcc43('0x2e')]=_[_0xcc43('0x43')](db[_0xcc43('0x3e')][_0xcc43('0x2b')]);_0x50e5af['query']=_[_0xcc43('0x43')](_0xfa36a7['query']);_0x50e5af['filters']=_[_0xcc43('0x31')](_0x50e5af[_0xcc43('0x2e')],_0x50e5af[_0xcc43('0x2f')]);_0x408de6[_0xcc43('0x32')]=_['intersection'](_0x50e5af['model'],qs[_0xcc43('0x33')](_0xfa36a7[_0xcc43('0x2f')][_0xcc43('0x33')]));_0x408de6[_0xcc43('0x32')]=_0x408de6[_0xcc43('0x32')][_0xcc43('0x34')]?_0x408de6[_0xcc43('0x32')]:_0x50e5af[_0xcc43('0x2e')];if(_0xfa36a7[_0xcc43('0x2f')][_0xcc43('0x3f')]){_0x408de6[_0xcc43('0x40')]=[{'all':!![]}];}_0x408de6=_[_0xcc43('0x3c')]({},_0x408de6,_0xfa36a7[_0xcc43('0x44')]);return db[_0xcc43('0x3e')][_0xcc43('0x45')](_0x408de6)[_0xcc43('0x23')](handleEntityNotFound(_0x143229,null))[_0xcc43('0x23')](respondWithResult(_0x143229,null))[_0xcc43('0x42')](handleError(_0x143229,null));};exports['create']=function(_0x3cc4fd,_0x530576){return db[_0xcc43('0x3e')][_0xcc43('0x46')](_0x3cc4fd[_0xcc43('0x47')],{})[_0xcc43('0x23')](respondWithResult(_0x530576,0xc9))['catch'](handleError(_0x530576,null));};exports[_0xcc43('0x22')]=function(_0x32c2ff,_0x526328){if(_0x32c2ff[_0xcc43('0x47')]['id']){delete _0x32c2ff[_0xcc43('0x47')]['id'];}return db[_0xcc43('0x3e')][_0xcc43('0x45')]({'where':{'id':_0x32c2ff[_0xcc43('0x48')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x526328,null))[_0xcc43('0x23')](saveUpdates(_0x32c2ff[_0xcc43('0x47')],null))[_0xcc43('0x23')](respondWithResult(_0x526328,null))[_0xcc43('0x42')](handleError(_0x526328,null));};exports[_0xcc43('0x24')]=function(_0x489a70,_0x2fba49){return db[_0xcc43('0x3e')]['find']({'where':{'id':_0x489a70[_0xcc43('0x48')]['id']}})[_0xcc43('0x23')](handleEntityNotFound(_0x2fba49,null))[_0xcc43('0x23')](removeEntity(_0x2fba49,null))[_0xcc43('0x42')](handleError(_0x2fba49,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index dbba59e..f034ea5 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 _0x7a7d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','lodash','util','api'];(function(_0x1cd0e6,_0x5a79fb){var _0x52c158=function(_0x5249f3){while(--_0x5249f3){_0x1cd0e6['push'](_0x1cd0e6['shift']());}};_0x52c158(++_0x5a79fb);}(_0x7a7d,0xfc));var _0xd7a7=function(_0x3c3ab5,_0x219ad8){_0x3c3ab5=_0x3c3ab5-0x0;var _0x1ccebf=_0x7a7d[_0x3c3ab5];return _0x1ccebf;};'use strict';var _=require(_0xd7a7('0x0'));var util=require(_0xd7a7('0x1'));var logger=require('../../config/logger')(_0xd7a7('0x2'));var moment=require(_0xd7a7('0x3'));var BPromise=require(_0xd7a7('0x4'));var rp=require(_0xd7a7('0x5'));var fs=require('fs');var path=require(_0xd7a7('0x6'));var rimraf=require(_0xd7a7('0x7'));var config=require(_0xd7a7('0x8'));var attributes=require(_0xd7a7('0x9'));module[_0xd7a7('0xa')]=function(_0x3e9279,_0x2f996b){return _0x3e9279[_0xd7a7('0xb')](_0xd7a7('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xd7a7('0xd'),'fields':[_0xd7a7('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f4a=['moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','lodash','util','../../config/logger','api'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6f4a,0x65));var _0xa6f4=function(_0xb99f82,_0x39cda2){_0xb99f82=_0xb99f82-0x0;var _0x3c0be6=_0x6f4a[_0xb99f82];return _0x3c0be6;};'use strict';var _=require(_0xa6f4('0x0'));var util=require(_0xa6f4('0x1'));var logger=require(_0xa6f4('0x2'))(_0xa6f4('0x3'));var moment=require(_0xa6f4('0x4'));var BPromise=require(_0xa6f4('0x5'));var rp=require(_0xa6f4('0x6'));var fs=require('fs');var path=require(_0xa6f4('0x7'));var rimraf=require(_0xa6f4('0x8'));var config=require('../../config/environment');var attributes=require(_0xa6f4('0x9'));module[_0xa6f4('0xa')]=function(_0x5daf7,_0x16271b){return _0x5daf7[_0xa6f4('0xb')](_0xa6f4('0xc'),attributes,{'tableName':_0xa6f4('0xd'),'paranoid':![],'indexes':[{'name':_0xa6f4('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 087fec4..f6fb5b8 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 _0x4303=['rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5e40b0,_0x2d39c0){var _0x1948a7=function(_0x496bf4){while(--_0x496bf4){_0x5e40b0['push'](_0x5e40b0['shift']());}};_0x1948a7(++_0x2d39c0);}(_0x4303,0x196));var _0x3430=function(_0x3b5dfb,_0x31fa3f){_0x3b5dfb=_0x3b5dfb-0x0;var _0x3834a6=_0x4303[_0x3b5dfb];return _0x3834a6;};'use strict';var _=require(_0x3430('0x0'));var util=require('util');var moment=require(_0x3430('0x1'));var BPromise=require(_0x3430('0x2'));var rs=require(_0x3430('0x3'));var fs=require('fs');var Redis=require(_0x3430('0x4'));var db=require(_0x3430('0x5'))['db'];var utils=require(_0x3430('0x6'));var logger=require(_0x3430('0x7'))(_0x3430('0x8'));var config=require(_0x3430('0x9'));var jayson=require(_0x3430('0xa'));var client=jayson[_0x3430('0xb')][_0x3430('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fe511,_0x394da7,_0x253f8c){return new BPromise(function(_0x545248,_0x202f8a){return client['request'](_0x2fe511,_0x253f8c)[_0x3430('0xd')](function(_0x2a80f0){logger[_0x3430('0xe')](_0x3430('0xf'),_0x394da7,_0x3430('0x10'));logger['debug'](_0x3430('0x11'),_0x394da7,_0x3430('0x10'),JSON['stringify'](_0x2a80f0));if(_0x2a80f0[_0x3430('0x12')]){if(_0x2a80f0[_0x3430('0x12')][_0x3430('0x13')]===0x1f4){logger['error'](_0x3430('0xf'),_0x394da7,_0x2a80f0[_0x3430('0x12')][_0x3430('0x14')]);return _0x202f8a(_0x2a80f0[_0x3430('0x12')][_0x3430('0x14')]);}logger['error'](_0x3430('0xf'),_0x394da7,_0x2a80f0['error'][_0x3430('0x14')]);return _0x545248(_0x2a80f0[_0x3430('0x12')]['message']);}else{logger[_0x3430('0xe')](_0x3430('0xf'),_0x394da7,_0x3430('0x10'));_0x545248(_0x2a80f0[_0x3430('0x15')][_0x3430('0x14')]);}})[_0x3430('0x16')](function(_0x96583){logger[_0x3430('0x12')](_0x3430('0xf'),_0x394da7,_0x96583);_0x202f8a(_0x96583);});});} \ No newline at end of file +var _0xe8ea=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39e904,_0x548da1){var _0x1a958e=function(_0x46c309){while(--_0x46c309){_0x39e904['push'](_0x39e904['shift']());}};_0x1a958e(++_0x548da1);}(_0xe8ea,0x88));var _0xae8e=function(_0x37462c,_0x57e293){_0x37462c=_0x37462c-0x0;var _0x5a82e1=_0xe8ea[_0x37462c];return _0x5a82e1;};'use strict';var _=require(_0xae8e('0x0'));var util=require(_0xae8e('0x1'));var moment=require(_0xae8e('0x2'));var BPromise=require(_0xae8e('0x3'));var rs=require(_0xae8e('0x4'));var fs=require('fs');var Redis=require(_0xae8e('0x5'));var db=require(_0xae8e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae8e('0x7'))('rpc');var config=require(_0xae8e('0x8'));var jayson=require(_0xae8e('0x9'));var client=jayson['client'][_0xae8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37cbed,_0x4aa881,_0x4025ac){return new BPromise(function(_0x2b2cbe,_0x51ed9e){return client[_0xae8e('0xb')](_0x37cbed,_0x4025ac)['then'](function(_0x3e69b6){logger[_0xae8e('0xc')](_0xae8e('0xd'),_0x4aa881,'request\x20sent');logger[_0xae8e('0xe')](_0xae8e('0xf'),_0x4aa881,_0xae8e('0x10'),JSON[_0xae8e('0x11')](_0x3e69b6));if(_0x3e69b6[_0xae8e('0x12')]){if(_0x3e69b6[_0xae8e('0x12')][_0xae8e('0x13')]===0x1f4){logger[_0xae8e('0x12')](_0xae8e('0xd'),_0x4aa881,_0x3e69b6[_0xae8e('0x12')]['message']);return _0x51ed9e(_0x3e69b6[_0xae8e('0x12')]['message']);}logger['error'](_0xae8e('0xd'),_0x4aa881,_0x3e69b6[_0xae8e('0x12')][_0xae8e('0x14')]);return _0x2b2cbe(_0x3e69b6[_0xae8e('0x12')][_0xae8e('0x14')]);}else{logger[_0xae8e('0xc')](_0xae8e('0xd'),_0x4aa881,_0xae8e('0x10'));_0x2b2cbe(_0x3e69b6[_0xae8e('0x15')][_0xae8e('0x14')]);}})['catch'](function(_0x48758b){logger[_0xae8e('0x12')](_0xae8e('0xd'),_0x4aa881,_0x48758b);_0x51ed9e(_0x48758b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index cb85475..e150601 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 _0x8f03=['update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x8f03,0xa5));var _0x38f0=function(_0x2183ca,_0x3778a9){_0x2183ca=_0x2183ca-0x0;var _0x21d00e=_0x8f03[_0x2183ca];return _0x21d00e;};'use strict';var multer=require('multer');var util=require(_0x38f0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38f0('0x1'));var router=express[_0x38f0('0x2')]();var fs_extra=require(_0x38f0('0x3'));var auth=require(_0x38f0('0x4'));var interaction=require(_0x38f0('0x5'));var config=require('../../config/environment');var controller=require(_0x38f0('0x6'));router[_0x38f0('0x7')]('/',auth[_0x38f0('0x8')](),controller[_0x38f0('0x9')]);router[_0x38f0('0x7')](_0x38f0('0xa'),auth[_0x38f0('0x8')](),controller[_0x38f0('0xb')]);router[_0x38f0('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x38f0('0x7')](_0x38f0('0xc'),auth[_0x38f0('0x8')](),controller[_0x38f0('0xd')]);router[_0x38f0('0xe')]('/',auth['isAuthenticated'](),controller[_0x38f0('0xf')]);router[_0x38f0('0xe')](_0x38f0('0x10'),auth[_0x38f0('0x8')](),controller[_0x38f0('0x11')]);router[_0x38f0('0x12')](_0x38f0('0xa'),auth[_0x38f0('0x8')](),controller[_0x38f0('0x13')]);router[_0x38f0('0x14')](_0x38f0('0xa'),auth['isAuthenticated'](),controller[_0x38f0('0x15')]);module[_0x38f0('0x16')]=router; \ No newline at end of file +var _0x2cee=['create','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x2625ee,_0x44821d){var _0x5db885=function(_0x3cc070){while(--_0x3cc070){_0x2625ee['push'](_0x2625ee['shift']());}};_0x5db885(++_0x44821d);}(_0x2cee,0x16f));var _0xe2ce=function(_0xb2e541,_0x574700){_0xb2e541=_0xb2e541-0x0;var _0x2553e8=_0x2cee[_0xb2e541];return _0x2553e8;};'use strict';var multer=require(_0xe2ce('0x0'));var util=require(_0xe2ce('0x1'));var path=require(_0xe2ce('0x2'));var timeout=require(_0xe2ce('0x3'));var express=require(_0xe2ce('0x4'));var router=express[_0xe2ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe2ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe2ce('0x7'));var controller=require(_0xe2ce('0x8'));router[_0xe2ce('0x9')]('/',auth[_0xe2ce('0xa')](),controller[_0xe2ce('0xb')]);router['get']('/:id',auth[_0xe2ce('0xa')](),controller[_0xe2ce('0xc')]);router[_0xe2ce('0x9')](_0xe2ce('0xd'),auth[_0xe2ce('0xa')](),controller['getConfigurations']);router[_0xe2ce('0x9')](_0xe2ce('0xe'),auth['isAuthenticated'](),controller[_0xe2ce('0xf')]);router[_0xe2ce('0x10')]('/',auth[_0xe2ce('0xa')](),controller[_0xe2ce('0x11')]);router['post'](_0xe2ce('0xd'),auth[_0xe2ce('0xa')](),controller[_0xe2ce('0x12')]);router['put'](_0xe2ce('0x13'),auth[_0xe2ce('0xa')](),controller[_0xe2ce('0x14')]);router[_0xe2ce('0x15')](_0xe2ce('0x13'),auth[_0xe2ce('0xa')](),controller[_0xe2ce('0x16')]);module[_0xe2ce('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d2c5ec0..f6de4f3 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 _0xe4f4=['STRING','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe4f4,0x89));var _0x4e4f=function(_0x19ac90,_0x554f04){_0x19ac90=_0x19ac90-0x0;var _0x4b9d7d=_0xe4f4[_0x19ac90];return _0x4b9d7d;};'use strict';var Sequelize=require('sequelize');module[_0x4e4f('0x0')]={'name':{'type':Sequelize[_0x4e4f('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4e4f('0x1')]},'remoteUri':{'type':Sequelize[_0x4e4f('0x1')]},'tenantId':{'type':Sequelize[_0x4e4f('0x1')]},'clientId':{'type':Sequelize[_0x4e4f('0x1')]},'clientSecret':{'type':Sequelize[_0x4e4f('0x1')]},'serverUrl':{'type':Sequelize[_0x4e4f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4e4f('0x1')]}}; \ No newline at end of file +var _0x2d08=['sequelize','exports','STRING'];(function(_0x133042,_0x4c5982){var _0x3cdbff=function(_0x41cdd3){while(--_0x41cdd3){_0x133042['push'](_0x133042['shift']());}};_0x3cdbff(++_0x4c5982);}(_0x2d08,0x129));var _0x82d0=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0x2d08[_0x1b5a5a];return _0x42b32d;};'use strict';var Sequelize=require(_0x82d0('0x0'));module[_0x82d0('0x1')]={'name':{'type':Sequelize[_0x82d0('0x2')]},'username':{'type':Sequelize[_0x82d0('0x2')]},'password':{'type':Sequelize[_0x82d0('0x2')]},'remoteUri':{'type':Sequelize[_0x82d0('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x82d0('0x2')]},'clientSecret':{'type':Sequelize[_0x82d0('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x82d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index bd79856..7d5ee11 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 _0xef39=['order','sort','where','filter','VIRTUAL','includeAll','include','rows','catch','show','params','keys','length','merge','options','find','create','body','destroy','Dynamics365Configuration','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','concat','findOne','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','POST','clientId','username','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Dynamics365Account','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','nolimit'];(function(_0x11ee71,_0x4eef5c){var _0x57ffd6=function(_0x1b84f2){while(--_0x1b84f2){_0x11ee71['push'](_0x11ee71['shift']());}};_0x57ffd6(++_0x4eef5c);}(_0xef39,0x92));var _0x9ef3=function(_0x507983,_0x3f1f04){_0x507983=_0x507983-0x0;var _0xcf3116=_0xef39[_0x507983];return _0xcf3116;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ef3('0x0'));var zipdir=require(_0x9ef3('0x1'));var jsonpatch=require(_0x9ef3('0x2'));var rp=require(_0x9ef3('0x3'));var moment=require(_0x9ef3('0x4'));var BPromise=require(_0x9ef3('0x5'));var Mustache=require(_0x9ef3('0x6'));var util=require(_0x9ef3('0x7'));var path=require(_0x9ef3('0x8'));var sox=require(_0x9ef3('0x9'));var csv=require(_0x9ef3('0xa'));var ejs=require(_0x9ef3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ef3('0xc'));var squel=require(_0x9ef3('0xd'));var crypto=require(_0x9ef3('0xe'));var jsforce=require(_0x9ef3('0xf'));var deskjs=require(_0x9ef3('0x10'));var toCsv=require(_0x9ef3('0xa'));var querystring=require(_0x9ef3('0x11'));var Papa=require(_0x9ef3('0x12'));var Redis=require(_0x9ef3('0x13'));var authService=require(_0x9ef3('0x14'));var qs=require(_0x9ef3('0x15'));var as=require(_0x9ef3('0x16'));var hardwareService=require(_0x9ef3('0x17'));var logger=require('../../config/logger')(_0x9ef3('0x18'));var utils=require(_0x9ef3('0x19'));var config=require(_0x9ef3('0x1a'));var licenseUtil=require(_0x9ef3('0x1b'));var db=require(_0x9ef3('0x1c'))['db'];var integrations=require(_0x9ef3('0x1d'));function respondWithStatusCode(_0x4db247,_0xdd8ecb){_0xdd8ecb=_0xdd8ecb||0xcc;return function(_0x239082){if(_0x239082){return _0x4db247[_0x9ef3('0x1e')](_0xdd8ecb);}return _0x4db247['status'](_0xdd8ecb)[_0x9ef3('0x1f')]();};}function respondWithResult(_0xa1cda6,_0x50533b){_0x50533b=_0x50533b||0xc8;return function(_0x36b5b3){if(_0x36b5b3){return _0xa1cda6[_0x9ef3('0x20')](_0x50533b)[_0x9ef3('0x21')](_0x36b5b3);}};}function respondWithFilteredResult(_0x236cef,_0x46221c){return function(_0xb16892){if(_0xb16892){var _0x4e75ff=typeof _0x46221c[_0x9ef3('0x22')]===_0x9ef3('0x23')&&typeof _0x46221c[_0x9ef3('0x24')]==='undefined';var _0x20426c=_0xb16892[_0x9ef3('0x25')];var _0x5971c6=_0x4e75ff?0x0:_0x46221c['offset'];var _0x587bcb=_0x4e75ff?_0xb16892[_0x9ef3('0x25')]:_0x46221c[_0x9ef3('0x22')]+_0x46221c['limit'];var _0x5d338d;if(_0x587bcb>=_0x20426c){_0x587bcb=_0x20426c;_0x5d338d=0xc8;}else{_0x5d338d=0xce;}_0x236cef['status'](_0x5d338d);return _0x236cef[_0x9ef3('0x26')]('Content-Range',_0x5971c6+'-'+_0x587bcb+'/'+_0x20426c)[_0x9ef3('0x21')](_0xb16892);}return null;};}function patchUpdates(_0x50f85f){return function(_0x3b6deb){try{jsonpatch[_0x9ef3('0x27')](_0x3b6deb,_0x50f85f,!![]);}catch(_0x9eff48){return BPromise['reject'](_0x9eff48);}return _0x3b6deb[_0x9ef3('0x28')]();};}function saveUpdates(_0x15136f,_0x17eb48){return function(_0x47b42b){if(_0x47b42b){return _0x47b42b[_0x9ef3('0x29')](_0x15136f)[_0x9ef3('0x2a')](function(_0x390cca){return _0x390cca;});}return null;};}function removeEntity(_0x463181,_0xecef8e){return function(_0x1fdf01){if(_0x1fdf01){return _0x1fdf01['destroy']()[_0x9ef3('0x2a')](function(){_0x463181[_0x9ef3('0x20')](0xcc)[_0x9ef3('0x1f')]();});}};}function handleEntityNotFound(_0x540c9b,_0x207fb1){return function(_0x15f899){if(!_0x15f899){_0x540c9b[_0x9ef3('0x1e')](0x194);}return _0x15f899;};}function handleError(_0xfb2f8e,_0x3802a2){_0x3802a2=_0x3802a2||0x1f4;return function(_0x173eb8){logger[_0x9ef3('0x2b')](_0x173eb8[_0x9ef3('0x2c')]);if(_0x173eb8[_0x9ef3('0x2d')]){delete _0x173eb8[_0x9ef3('0x2d')];}_0xfb2f8e['status'](_0x3802a2)[_0x9ef3('0x2e')](_0x173eb8);};}exports['index']=function(_0x395e30,_0x22f32a){var _0x1fa0f3={},_0x1e13f2={},_0x33841={'count':0x0,'rows':[]};var _0x2112f1=_[_0x9ef3('0x2f')](db[_0x9ef3('0x30')][_0x9ef3('0x31')],function(_0x3ff44c){return{'name':_0x3ff44c['fieldName'],'type':_0x3ff44c[_0x9ef3('0x32')][_0x9ef3('0x33')]};});_0x1e13f2['model']=_[_0x9ef3('0x2f')](_0x2112f1,_0x9ef3('0x2d'));_0x1e13f2[_0x9ef3('0x34')]=_['keys'](_0x395e30['query']);_0x1e13f2[_0x9ef3('0x35')]=_[_0x9ef3('0x36')](_0x1e13f2[_0x9ef3('0x37')],_0x1e13f2['query']);_0x1fa0f3[_0x9ef3('0x38')]=_[_0x9ef3('0x36')](_0x1e13f2[_0x9ef3('0x37')],qs[_0x9ef3('0x39')](_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x39')]));_0x1fa0f3['attributes']=_0x1fa0f3[_0x9ef3('0x38')]['length']?_0x1fa0f3['attributes']:_0x1e13f2['model'];if(!_0x395e30[_0x9ef3('0x34')]['hasOwnProperty'](_0x9ef3('0x3a'))){_0x1fa0f3[_0x9ef3('0x24')]=qs[_0x9ef3('0x24')](_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x24')]);_0x1fa0f3[_0x9ef3('0x22')]=qs[_0x9ef3('0x22')](_0x395e30['query']['offset']);}_0x1fa0f3[_0x9ef3('0x3b')]=qs[_0x9ef3('0x3c')](_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x3c')]);_0x1fa0f3[_0x9ef3('0x3d')]=qs['filters'](_['pick'](_0x395e30[_0x9ef3('0x34')],_0x1e13f2[_0x9ef3('0x35')]),_0x2112f1);if(_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x3e')]){_0x1fa0f3[_0x9ef3('0x3d')]=_['merge'](_0x1fa0f3[_0x9ef3('0x3d')],{'$or':_[_0x9ef3('0x2f')](_0x2112f1,function(_0x5414ab){if(_0x5414ab[_0x9ef3('0x32')]!==_0x9ef3('0x3f')){var _0x30c7bc={};_0x30c7bc[_0x5414ab[_0x9ef3('0x2d')]]={'$like':'%'+_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x3e')]+'%'};return _0x30c7bc;}})});}_0x1fa0f3=_['merge']({},_0x1fa0f3,_0x395e30['options']);var _0x3adea6={'where':_0x1fa0f3['where']};return db[_0x9ef3('0x30')]['count'](_0x3adea6)[_0x9ef3('0x2a')](function(_0x286edd){_0x33841['count']=_0x286edd;if(_0x395e30[_0x9ef3('0x34')][_0x9ef3('0x40')]){_0x1fa0f3[_0x9ef3('0x41')]=[{'all':!![]}];}return db[_0x9ef3('0x30')]['findAll'](_0x1fa0f3);})['then'](function(_0x5b57af){_0x33841[_0x9ef3('0x42')]=_0x5b57af;return _0x33841;})['then'](respondWithFilteredResult(_0x22f32a,_0x1fa0f3))[_0x9ef3('0x43')](handleError(_0x22f32a,null));};exports[_0x9ef3('0x44')]=function(_0x24262f,_0x4f1a24){var _0x73c7c4={'raw':![],'where':{'id':_0x24262f[_0x9ef3('0x45')]['id']}},_0x370e13={};_0x370e13[_0x9ef3('0x37')]=_['keys'](db[_0x9ef3('0x30')]['rawAttributes']);_0x370e13[_0x9ef3('0x34')]=_[_0x9ef3('0x46')](_0x24262f['query']);_0x370e13[_0x9ef3('0x35')]=_[_0x9ef3('0x36')](_0x370e13['model'],_0x370e13[_0x9ef3('0x34')]);_0x73c7c4[_0x9ef3('0x38')]=_[_0x9ef3('0x36')](_0x370e13[_0x9ef3('0x37')],qs[_0x9ef3('0x39')](_0x24262f['query'][_0x9ef3('0x39')]));_0x73c7c4[_0x9ef3('0x38')]=_0x73c7c4[_0x9ef3('0x38')][_0x9ef3('0x47')]?_0x73c7c4[_0x9ef3('0x38')]:_0x370e13[_0x9ef3('0x37')];if(_0x24262f[_0x9ef3('0x34')][_0x9ef3('0x40')]){_0x73c7c4[_0x9ef3('0x41')]=[{'all':!![]}];}_0x73c7c4=_[_0x9ef3('0x48')]({},_0x73c7c4,_0x24262f[_0x9ef3('0x49')]);return db[_0x9ef3('0x30')][_0x9ef3('0x4a')](_0x73c7c4)[_0x9ef3('0x2a')](handleEntityNotFound(_0x4f1a24,null))[_0x9ef3('0x2a')](respondWithResult(_0x4f1a24,null))[_0x9ef3('0x43')](handleError(_0x4f1a24,null));};exports[_0x9ef3('0x4b')]=function(_0xaac1a1,_0x9beacd){return db[_0x9ef3('0x30')][_0x9ef3('0x4b')](_0xaac1a1[_0x9ef3('0x4c')],{})[_0x9ef3('0x2a')](respondWithResult(_0x9beacd,0xc9))[_0x9ef3('0x43')](handleError(_0x9beacd,null));};exports['update']=function(_0x341670,_0x2219e5){if(_0x341670[_0x9ef3('0x4c')]['id']){delete _0x341670[_0x9ef3('0x4c')]['id'];}return db[_0x9ef3('0x30')][_0x9ef3('0x4a')]({'where':{'id':_0x341670[_0x9ef3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2219e5,null))[_0x9ef3('0x2a')](saveUpdates(_0x341670[_0x9ef3('0x4c')],null))[_0x9ef3('0x2a')](respondWithResult(_0x2219e5,null))[_0x9ef3('0x43')](handleError(_0x2219e5,null));};exports[_0x9ef3('0x4d')]=function(_0x8b7a6d,_0x3af7d8){return db[_0x9ef3('0x30')]['find']({'where':{'id':_0x8b7a6d[_0x9ef3('0x45')]['id']}})['then'](handleEntityNotFound(_0x3af7d8,null))[_0x9ef3('0x2a')](removeEntity(_0x3af7d8,null))[_0x9ef3('0x43')](handleError(_0x3af7d8,null));};exports['getConfigurations']=function(_0x1194b1,_0x583cf8,_0x27a238){var _0xaa339={};var _0x14e1f2={};var _0x49d2db;var _0x8ae59b;return db['Dynamics365Account']['findOne']({'where':{'id':_0x1194b1[_0x9ef3('0x45')]['id']}})[_0x9ef3('0x2a')](handleEntityNotFound(_0x583cf8,null))[_0x9ef3('0x2a')](function(_0x3dbe6a){if(_0x3dbe6a){_0x49d2db=_0x3dbe6a;_0x14e1f2['model']=_[_0x9ef3('0x46')](db[_0x9ef3('0x4e')]['rawAttributes']);_0x14e1f2[_0x9ef3('0x34')]=_[_0x9ef3('0x46')](_0x1194b1['query']);_0x14e1f2[_0x9ef3('0x35')]=_[_0x9ef3('0x36')](_0x14e1f2[_0x9ef3('0x37')],_0x14e1f2[_0x9ef3('0x34')]);_0xaa339[_0x9ef3('0x38')]=_['intersection'](_0x14e1f2[_0x9ef3('0x37')],qs[_0x9ef3('0x39')](_0x1194b1[_0x9ef3('0x34')][_0x9ef3('0x39')]));_0xaa339[_0x9ef3('0x38')]=_0xaa339[_0x9ef3('0x38')][_0x9ef3('0x47')]?_0xaa339[_0x9ef3('0x38')]:_0x14e1f2[_0x9ef3('0x37')];_0xaa339[_0x9ef3('0x3b')]=qs[_0x9ef3('0x3c')](_0x1194b1['query'][_0x9ef3('0x3c')]);_0xaa339['where']=qs[_0x9ef3('0x35')](_[_0x9ef3('0x4f')](_0x1194b1[_0x9ef3('0x34')],_0x14e1f2['filters']));if(_0x1194b1[_0x9ef3('0x34')][_0x9ef3('0x3e')]){_0xaa339[_0x9ef3('0x3d')]=_[_0x9ef3('0x48')](_0xaa339['where'],{'$or':_[_0x9ef3('0x2f')](_0xaa339[_0x9ef3('0x38')],function(_0xc52fae){var _0x555fcd={};_0x555fcd[_0xc52fae]={'$like':'%'+_0x1194b1[_0x9ef3('0x34')]['filter']+'%'};return _0x555fcd;})});}_0xaa339=_[_0x9ef3('0x48')]({},_0xaa339,_0x1194b1[_0x9ef3('0x49')]);return _0x49d2db[_0x9ef3('0x50')](_0xaa339);}})[_0x9ef3('0x2a')](function(_0xec65b0){if(_0xec65b0){_0x8ae59b=_0xec65b0[_0x9ef3('0x47')];if(!_0x1194b1['query'][_0x9ef3('0x51')]('nolimit')){_0xaa339[_0x9ef3('0x24')]=qs['limit'](_0x1194b1[_0x9ef3('0x34')][_0x9ef3('0x24')]);_0xaa339[_0x9ef3('0x22')]=qs['offset'](_0x1194b1['query'][_0x9ef3('0x22')]);}return _0x49d2db[_0x9ef3('0x50')](_0xaa339);}})[_0x9ef3('0x2a')](function(_0x66d2d7){if(_0x66d2d7){return _0x66d2d7?{'count':_0x8ae59b,'rows':_0x66d2d7}:null;}})[_0x9ef3('0x2a')](respondWithResult(_0x583cf8,null))[_0x9ef3('0x43')](handleError(_0x583cf8,null));};exports[_0x9ef3('0x52')]=function(_0x5eebff,_0x10b310,_0x56449e){if(_0x5eebff[_0x9ef3('0x4c')]['id']){delete _0x5eebff[_0x9ef3('0x4c')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x5eebff['params']['id']}})[_0x9ef3('0x2a')](handleEntityNotFound(_0x10b310,null))[_0x9ef3('0x2a')](function(_0x5919d9){if(_0x5919d9){_0x5eebff[_0x9ef3('0x4c')][_0x9ef3('0x53')]=_0x5919d9['id'];_0x5eebff[_0x9ef3('0x4c')]['Subjects']=integrations[_0x9ef3('0x54')](_0x5eebff[_0x9ef3('0x4c')][_0x9ef3('0x55')],_0x5eebff[_0x9ef3('0x4c')][_0x9ef3('0x32')]);_0x5eebff[_0x9ef3('0x4c')][_0x9ef3('0x56')]=integrations[_0x9ef3('0x57')](_0x5eebff['body'][_0x9ef3('0x55')],_0x5eebff['body'][_0x9ef3('0x32')]);return db[_0x9ef3('0x4e')][_0x9ef3('0x4b')](_0x5eebff[_0x9ef3('0x4c')],{'include':[{'model':db[_0x9ef3('0x58')],'as':'Subjects'},{'model':db[_0x9ef3('0x58')],'as':'Descriptions'}]});}return null;})[_0x9ef3('0x2a')](respondWithResult(_0x10b310,null))[_0x9ef3('0x43')](handleError(_0x10b310,null));};exports[_0x9ef3('0x59')]=function(_0x840419,_0x33ff18,_0x5f59ca){var _0x2a151b=_0x840419[_0x9ef3('0x34')][_0x9ef3('0x5a')];var _0x1d5236=_0x2a151b===_0x9ef3('0x5b')?_0x9ef3('0x5c'):'PhoneCall';var _0x210d19='';var _0x45e55b='';var _0x6d56a7='';var _0x448b7b='';var _0x346746='';var _0x45a5db='';var _0x56001c='';var _0x3d924b='';var _0x261459=[_0x9ef3('0x5d'),_0x9ef3('0x5e'),_0x9ef3('0x5f'),_0x9ef3('0x60'),'caseorigincode',_0x9ef3('0x61'),_0x9ef3('0x62'),_0x9ef3('0x63'),_0x9ef3('0x64'),'phonecall_activity_parties'];var _0x2ac3f5=[_0x9ef3('0x65'),_0x9ef3('0x66'),_0x9ef3('0x67'),'billedserviceunits',_0x9ef3('0x68'),'contactidyominame',_0x9ef3('0x69'),_0x9ef3('0x6a'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x9ef3('0x6b'),_0x9ef3('0x6c'),_0x9ef3('0x6d'),_0x9ef3('0x6e'),_0x9ef3('0x6f'),'customeridname',_0x9ef3('0x70'),_0x9ef3('0x71'),_0x9ef3('0x72'),'entitlementidname',_0x9ef3('0x73'),_0x9ef3('0x74'),_0x9ef3('0x75'),_0x9ef3('0x76'),'firstresponsebykpiidname',_0x9ef3('0x77'),_0x9ef3('0x78'),_0x9ef3('0x79'),_0x9ef3('0x7a'),'lastonholdtime',_0x9ef3('0x7b'),_0x9ef3('0x7c'),_0x9ef3('0x7d'),_0x9ef3('0x7e'),_0x9ef3('0x7f'),'modifiedon',_0x9ef3('0x80'),_0x9ef3('0x81'),_0x9ef3('0x82'),_0x9ef3('0x83'),_0x9ef3('0x84'),'onholdtime',_0x9ef3('0x85'),_0x9ef3('0x86'),_0x9ef3('0x87'),'owneridyominame',_0x9ef3('0x88'),'primarycontactidname',_0x9ef3('0x89'),_0x9ef3('0x8a'),_0x9ef3('0x8b'),'productserialnumber',_0x9ef3('0x8c'),_0x9ef3('0x8d'),'responseby',_0x9ef3('0x8e'),_0x9ef3('0x8f'),_0x9ef3('0x90'),'slainvokedidname','slaname',_0x9ef3('0x91'),'statecode',_0x9ef3('0x92'),_0x9ef3('0x93'),_0x9ef3('0x94'),_0x9ef3('0x95'),'transactioncurrencyidname','traversedpath',_0x9ef3('0x96'),'versionnumber'];var _0x48b92a=_0x261459[_0x9ef3('0x97')](_0x2ac3f5);return db['Dynamics365Account'][_0x9ef3('0x98')]({'where':{'id':_0x840419['params']['id']},'attributes':['id','username','password',_0x9ef3('0x99'),_0x9ef3('0x9a'),'clientId',_0x9ef3('0x9b')]})['then'](handleEntityNotFound(_0x33ff18,null))[_0x9ef3('0x2a')](function(_0x13ad87){if(_0x13ad87){_0x3d924b=_0x13ad87[_0x9ef3('0x99')];var _0x1d1e7b=_0x3d924b[_0x9ef3('0x9c')](-0x1);if(_0x1d1e7b==='/'){_0x3d924b=_0x3d924b[_0x9ef3('0x9d')](0x0,_0x3d924b[_0x9ef3('0x9e')](_0x1d1e7b));}_0x56001c=util[_0x9ef3('0x9f')]('%s/api/data/v9.0/',_0x3d924b);var _0x47f310={'method':_0x9ef3('0xa0'),'uri':'https://login.microsoftonline.com/'+_0x13ad87[_0x9ef3('0x9a')]+'/oauth2/token','form':{'client_id':_0x13ad87[_0x9ef3('0xa1')],'resource':_0x3d924b,'username':_0x13ad87[_0x9ef3('0xa2')],'password':_0x13ad87[_0x9ef3('0xa3')],'grant_type':_0x9ef3('0xa3'),'client_secret':_0x13ad87[_0x9ef3('0x9b')]},'json':!![]};return rp(_0x47f310);}})[_0x9ef3('0x2a')](function(_0x553391){_0x45a5db=_0x553391['access_token'];var _0x1ececc={'method':_0x9ef3('0xa4'),'uri':encodeURI(_0x56001c+_0x9ef3('0xa5')+_0x1d5236+'\x27'),'headers':{'Authorization':_0x9ef3('0xa6')+_0x45a5db,'If-None-Match':null,'OData-Version':_0x9ef3('0xa7')},'json':!![]};return rp(_0x1ececc);})[_0x9ef3('0x2a')](function(_0x5a80bd){var _0x5d7cd8=_0x5a80bd['value'][0x0];var _0x5ade01=_0x5d7cd8[_0x9ef3('0xa8')];var _0x50fe31={'method':_0x9ef3('0xa4'),'uri':_0x56001c+_0x9ef3('0xa9')+_0x5ade01+_0x9ef3('0xaa'),'headers':{'Authorization':_0x9ef3('0xa6')+_0x45a5db,'If-None-Match':null,'OData-Version':_0x9ef3('0xa7')},'json':!![]};return rp(_0x50fe31);})[_0x9ef3('0x2a')](function(_0x4e2b27){_0x210d19=_0x4e2b27;_0x45e55b=_0x210d19[_0x9ef3('0xab')];_0x45e55b=_[_0x9ef3('0xac')](_0x45e55b,function(_0x264753){return!_0x48b92a['includes'](_0x264753[_0x9ef3('0xad')]);});var _0x116abb=[];var _0x380a0c=[];_0x45e55b['forEach'](function(_0x1020d1){if(_0x1020d1[_0x9ef3('0xae')]){var _0x1a56bb=_0x1020d1[_0x9ef3('0xae')]['substring'](_0x1020d1[_0x9ef3('0xae')][_0x9ef3('0x9e')]('.')+0x1);if(_0x1a56bb===_0x9ef3('0xaf')){_0x116abb[_0x9ef3('0xb0')](getSelectList(_0x56001c,_0x2a151b,_0x380a0c,_0x210d19[_0x9ef3('0xa8')],_0x1020d1[_0x9ef3('0xa8')],_0x45a5db));}}});return Promise[_0x9ef3('0xb1')](_0x116abb);})['then'](function(_0x35fab0){_0x6d56a7=_0x35fab0[0x0];var _0x24e5e2=[];var _0x533d37=[];_0x45e55b['forEach'](function(_0x495c7b){if(!_[_0x9ef3('0xb2')](_0x495c7b[_0x9ef3('0xae')])){var _0x3cbd2b=_0x495c7b[_0x9ef3('0xae')][_0x9ef3('0x9d')](_0x495c7b['@odata.type'][_0x9ef3('0x9e')]('.')+0x1);if(_0x3cbd2b===_0x9ef3('0xb3')){_0x24e5e2[_0x9ef3('0xb0')](getBooleanList(_0x56001c,_0x2a151b,_0x533d37,_0x210d19[_0x9ef3('0xa8')],_0x495c7b[_0x9ef3('0xa8')],_0x45a5db));}}});return Promise[_0x9ef3('0xb1')](_0x24e5e2);})[_0x9ef3('0x2a')](function(_0x1fb1ee){_0x448b7b=_0x1fb1ee[0x0];var _0x198e05=[];var _0x15b87f=[];_0x45e55b[_0x9ef3('0xb4')](function(_0x476d6b){if(_0x476d6b[_0x9ef3('0xae')]){var _0x1a0452=_0x476d6b['@odata.type'][_0x9ef3('0x9d')](_0x476d6b['@odata.type'][_0x9ef3('0x9e')]('.')+0x1);if(_0x1a0452===_0x9ef3('0xb5')||_0x1a0452===_0x9ef3('0xb6')||_0x1a0452==='BigIntAttributeMetadata'||_0x1a0452==='IntegerAttributeMetadata'||_0x1a0452===_0x9ef3('0xb7')||_0x1a0452===_0x9ef3('0xb8')||_0x1a0452==='StatusAttributeMetadata'||_0x1a0452===_0x9ef3('0xb9')||_0x1a0452===_0x9ef3('0xba')||_0x1a0452===_0x9ef3('0xbb')){_0x198e05[_0x9ef3('0xb0')](getInputList(_0x56001c,_0x2a151b,_0x1a0452,_0x15b87f,_0x210d19[_0x9ef3('0xa8')],_0x476d6b[_0x9ef3('0xa8')],_0x45a5db));}}});return Promise['all'](_0x198e05);})[_0x9ef3('0x2a')](function(_0x5e94dc){_0x346746=_0x5e94dc[0x0];var _0x1488fd=_0x6d56a7[_0x9ef3('0x97')](_0x448b7b)['concat'](_0x346746);var _0x4bb8a9={'count':_0x1488fd[_0x9ef3('0x47')],'rows':_0x1488fd};return _0x4bb8a9;})[_0x9ef3('0x2a')](respondWithResult(_0x33ff18,null))[_0x9ef3('0x43')](function(_0x1960ce){var _0x4853f9=_0x840419[_0x9ef3('0x34')]['test']?0x1f4:_0x1960ce[_0x9ef3('0xbc')]||0x1f4;logger['error'](_0x1960ce[_0x9ef3('0x2c')]);delete _0x1960ce[_0x9ef3('0x2d')];if(_0x4853f9===0x191){_0x4853f9=0x190;}_0x33ff18['status'](_0x4853f9)[_0x9ef3('0x2e')](_0x840419['query'][_0x9ef3('0xbd')]?{'message':_0x9ef3('0xbe'),'statusCode':_0x1960ce['statusCode']}:_0x1960ce);});};function getSelectList(_0x3ba2ef,_0x62d9a3,_0x1b33eb,_0x2d50d8,_0x38406d,_0x2691da){var _0x213ced={'method':_0x9ef3('0xa4'),'uri':_0x3ba2ef+'EntityDefinitions('+_0x2d50d8+_0x9ef3('0xbf')+_0x38406d+_0x9ef3('0xc0')+_0x9ef3('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x2691da,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x213ced)[_0x9ef3('0x2a')](function(_0x11648f){var _0x2f5adc=[];var _0x3966dd=_0x11648f[_0x9ef3('0xc2')][_0x9ef3('0xc3')];_0x3966dd[_0x9ef3('0xb4')](function(_0x4c6bcd){_0x2f5adc['push']({'name':_0x4c6bcd[_0x9ef3('0xc4')]['UserLocalizedLabel'][_0x9ef3('0xc4')],'value':String(_0x4c6bcd['Value'])});});var _0x2f64c5={'id':_0x62d9a3+'_'+_0x11648f[_0x9ef3('0xad')],'name':_0x11648f[_0x9ef3('0xc5')][_0x9ef3('0xc6')][_0x9ef3('0xc4')],'custom':![],'options':_0x2f5adc};_0x1b33eb[_0x9ef3('0xb0')](_0x2f64c5);return _0x1b33eb;});}function getBooleanList(_0x3fc126,_0x337440,_0x6d5ef2,_0x10c0c8,_0x23e3a9,_0x1dea59){var _0x36eb21={'method':_0x9ef3('0xa4'),'uri':_0x3fc126+_0x9ef3('0xa9')+_0x10c0c8+_0x9ef3('0xbf')+_0x23e3a9+_0x9ef3('0xc7'),'headers':{'Authorization':_0x9ef3('0xa6')+_0x1dea59,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x36eb21)[_0x9ef3('0x2a')](function(_0xbff2c1){var _0x474145=[];_0x474145[_0x9ef3('0xb0')]({'name':_0xbff2c1[_0x9ef3('0xc2')][_0x9ef3('0xc8')]['Label'][_0x9ef3('0xc6')][_0x9ef3('0xc4')],'value':_0x9ef3('0xc9')},{'name':_0xbff2c1[_0x9ef3('0xc2')][_0x9ef3('0xca')]['Label'][_0x9ef3('0xc6')][_0x9ef3('0xc4')],'value':_0x9ef3('0xcb')});var _0x2fe30b={'id':_0x337440+'_'+_0xbff2c1[_0x9ef3('0xad')],'name':_0xbff2c1['DisplayName'][_0x9ef3('0xc6')][_0x9ef3('0xc4')],'custom':![],'options':_0x474145};_0x6d5ef2[_0x9ef3('0xb0')](_0x2fe30b);return _0x6d5ef2;});}function getInputList(_0x5d42ef,_0x40333c,_0x1d6507,_0x52ed0f,_0x11553c,_0x20caa7,_0x10ce58){var _0x149d0c={'method':_0x9ef3('0xa4'),'uri':_0x5d42ef+_0x9ef3('0xa9')+_0x11553c+')/Attributes('+_0x20caa7+')/Microsoft.Dynamics.CRM.'+_0x1d6507+_0x9ef3('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x10ce58,'If-None-Match':null,'OData-Version':_0x9ef3('0xa7')},'json':!![]};return rp(_0x149d0c)[_0x9ef3('0x2a')](function(_0x3e2682){var _0x33cf12={'id':_0x40333c+'_'+_0x3e2682[_0x9ef3('0xad')],'name':_0x3e2682[_0x9ef3('0xc5')][_0x9ef3('0xc6')]?_0x3e2682['DisplayName'][_0x9ef3('0xc6')][_0x9ef3('0xc4')]:_0x3e2682['LogicalName'],'custom':![],'options':[]};_0x52ed0f[_0x9ef3('0xb0')](_0x33cf12);return _0x52ed0f;});} \ No newline at end of file +var _0x8bdf=['BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','stack','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','Dynamics365Account','includeAll','include','findAll','rows','catch','show','rawAttributes','options','create','body','find','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','description','customerid','ownerid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata'];(function(_0x3ad191,_0x29e58b){var _0x4384e5=function(_0x558fd9){while(--_0x558fd9){_0x3ad191['push'](_0x3ad191['shift']());}};_0x4384e5(++_0x29e58b);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8bdf[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xf8bd('0x0'));var rimraf=require(_0xf8bd('0x1'));var zipdir=require(_0xf8bd('0x2'));var jsonpatch=require(_0xf8bd('0x3'));var rp=require(_0xf8bd('0x4'));var moment=require('moment');var BPromise=require(_0xf8bd('0x5'));var Mustache=require(_0xf8bd('0x6'));var util=require(_0xf8bd('0x7'));var path=require(_0xf8bd('0x8'));var sox=require(_0xf8bd('0x9'));var csv=require(_0xf8bd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf8bd('0xb'));var crypto=require(_0xf8bd('0xc'));var jsforce=require(_0xf8bd('0xd'));var deskjs=require(_0xf8bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8bd('0xf'));var Papa=require(_0xf8bd('0x10'));var Redis=require('ioredis');var authService=require(_0xf8bd('0x11'));var qs=require(_0xf8bd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8bd('0x13'));var logger=require(_0xf8bd('0x14'))(_0xf8bd('0x15'));var utils=require(_0xf8bd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf8bd('0x17'));var db=require(_0xf8bd('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1a009e,_0x49e8c6){_0x49e8c6=_0x49e8c6||0xcc;return function(_0x1af936){if(_0x1af936){return _0x1a009e[_0xf8bd('0x19')](_0x49e8c6);}return _0x1a009e[_0xf8bd('0x1a')](_0x49e8c6)[_0xf8bd('0x1b')]();};}function respondWithResult(_0x43d517,_0xa0ee74){_0xa0ee74=_0xa0ee74||0xc8;return function(_0x56146e){if(_0x56146e){return _0x43d517['status'](_0xa0ee74)['json'](_0x56146e);}};}function respondWithFilteredResult(_0x13350a,_0x33facf){return function(_0x54dc30){if(_0x54dc30){var _0x277123=typeof _0x33facf[_0xf8bd('0x1c')]===_0xf8bd('0x1d')&&typeof _0x33facf[_0xf8bd('0x1e')]==='undefined';var _0x2b9fff=_0x54dc30[_0xf8bd('0x1f')];var _0x53c547=_0x277123?0x0:_0x33facf[_0xf8bd('0x1c')];var _0x1925bc=_0x277123?_0x54dc30[_0xf8bd('0x1f')]:_0x33facf[_0xf8bd('0x1c')]+_0x33facf[_0xf8bd('0x1e')];var _0x1b18db;if(_0x1925bc>=_0x2b9fff){_0x1925bc=_0x2b9fff;_0x1b18db=0xc8;}else{_0x1b18db=0xce;}_0x13350a['status'](_0x1b18db);return _0x13350a[_0xf8bd('0x20')](_0xf8bd('0x21'),_0x53c547+'-'+_0x1925bc+'/'+_0x2b9fff)['json'](_0x54dc30);}return null;};}function patchUpdates(_0x116946){return function(_0x528373){try{jsonpatch[_0xf8bd('0x22')](_0x528373,_0x116946,!![]);}catch(_0x1dc352){return BPromise['reject'](_0x1dc352);}return _0x528373[_0xf8bd('0x23')]();};}function saveUpdates(_0x45eb2d,_0x4c575f){return function(_0x4ea6fe){if(_0x4ea6fe){return _0x4ea6fe[_0xf8bd('0x24')](_0x45eb2d)[_0xf8bd('0x25')](function(_0x4edd5a){return _0x4edd5a;});}return null;};}function removeEntity(_0x280b5b,_0x59d0b9){return function(_0x36abba){if(_0x36abba){return _0x36abba[_0xf8bd('0x26')]()['then'](function(){_0x280b5b[_0xf8bd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd9bd,_0x5b85f5){return function(_0x261e8f){if(!_0x261e8f){_0x1dd9bd['sendStatus'](0x194);}return _0x261e8f;};}function handleError(_0x136bd2,_0x4fe184){_0x4fe184=_0x4fe184||0x1f4;return function(_0x5678bf){logger[_0xf8bd('0x27')](_0x5678bf['stack']);if(_0x5678bf[_0xf8bd('0x28')]){delete _0x5678bf[_0xf8bd('0x28')];}_0x136bd2[_0xf8bd('0x1a')](_0x4fe184)['send'](_0x5678bf);};}exports[_0xf8bd('0x29')]=function(_0x3974ff,_0xa3ff13){var _0x3aa54a={},_0x4fc088={},_0x4bff64={'count':0x0,'rows':[]};var _0x36a606=_['map'](db['Dynamics365Account']['rawAttributes'],function(_0x5be18c){return{'name':_0x5be18c[_0xf8bd('0x2a')],'type':_0x5be18c[_0xf8bd('0x2b')]['key']};});_0x4fc088[_0xf8bd('0x2c')]=_[_0xf8bd('0x2d')](_0x36a606,'name');_0x4fc088['query']=_[_0xf8bd('0x2e')](_0x3974ff['query']);_0x4fc088[_0xf8bd('0x2f')]=_[_0xf8bd('0x30')](_0x4fc088[_0xf8bd('0x2c')],_0x4fc088[_0xf8bd('0x31')]);_0x3aa54a[_0xf8bd('0x32')]=_[_0xf8bd('0x30')](_0x4fc088['model'],qs[_0xf8bd('0x33')](_0x3974ff[_0xf8bd('0x31')]['fields']));_0x3aa54a['attributes']=_0x3aa54a[_0xf8bd('0x32')][_0xf8bd('0x34')]?_0x3aa54a['attributes']:_0x4fc088[_0xf8bd('0x2c')];if(!_0x3974ff[_0xf8bd('0x31')][_0xf8bd('0x35')](_0xf8bd('0x36'))){_0x3aa54a[_0xf8bd('0x1e')]=qs[_0xf8bd('0x1e')](_0x3974ff[_0xf8bd('0x31')]['limit']);_0x3aa54a[_0xf8bd('0x1c')]=qs[_0xf8bd('0x1c')](_0x3974ff[_0xf8bd('0x31')][_0xf8bd('0x1c')]);}_0x3aa54a[_0xf8bd('0x37')]=qs[_0xf8bd('0x38')](_0x3974ff[_0xf8bd('0x31')]['sort']);_0x3aa54a['where']=qs[_0xf8bd('0x2f')](_['pick'](_0x3974ff['query'],_0x4fc088[_0xf8bd('0x2f')]),_0x36a606);if(_0x3974ff[_0xf8bd('0x31')][_0xf8bd('0x39')]){_0x3aa54a[_0xf8bd('0x3a')]=_[_0xf8bd('0x3b')](_0x3aa54a['where'],{'$or':_[_0xf8bd('0x2d')](_0x36a606,function(_0x2ef42d){if(_0x2ef42d[_0xf8bd('0x2b')]!=='VIRTUAL'){var _0x55b92f={};_0x55b92f[_0x2ef42d[_0xf8bd('0x28')]]={'$like':'%'+_0x3974ff['query']['filter']+'%'};return _0x55b92f;}})});}_0x3aa54a=_[_0xf8bd('0x3b')]({},_0x3aa54a,_0x3974ff['options']);var _0x419b20={'where':_0x3aa54a[_0xf8bd('0x3a')]};return db[_0xf8bd('0x3c')][_0xf8bd('0x1f')](_0x419b20)[_0xf8bd('0x25')](function(_0x313f19){_0x4bff64[_0xf8bd('0x1f')]=_0x313f19;if(_0x3974ff[_0xf8bd('0x31')][_0xf8bd('0x3d')]){_0x3aa54a[_0xf8bd('0x3e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xf8bd('0x3f')](_0x3aa54a);})[_0xf8bd('0x25')](function(_0x11de7e){_0x4bff64[_0xf8bd('0x40')]=_0x11de7e;return _0x4bff64;})['then'](respondWithFilteredResult(_0xa3ff13,_0x3aa54a))[_0xf8bd('0x41')](handleError(_0xa3ff13,null));};exports[_0xf8bd('0x42')]=function(_0x46e7d4,_0x282a35){var _0x504366={'raw':![],'where':{'id':_0x46e7d4['params']['id']}},_0x5ecda7={};_0x5ecda7['model']=_['keys'](db[_0xf8bd('0x3c')][_0xf8bd('0x43')]);_0x5ecda7[_0xf8bd('0x31')]=_[_0xf8bd('0x2e')](_0x46e7d4[_0xf8bd('0x31')]);_0x5ecda7[_0xf8bd('0x2f')]=_[_0xf8bd('0x30')](_0x5ecda7[_0xf8bd('0x2c')],_0x5ecda7['query']);_0x504366[_0xf8bd('0x32')]=_[_0xf8bd('0x30')](_0x5ecda7[_0xf8bd('0x2c')],qs[_0xf8bd('0x33')](_0x46e7d4[_0xf8bd('0x31')][_0xf8bd('0x33')]));_0x504366[_0xf8bd('0x32')]=_0x504366[_0xf8bd('0x32')][_0xf8bd('0x34')]?_0x504366['attributes']:_0x5ecda7[_0xf8bd('0x2c')];if(_0x46e7d4[_0xf8bd('0x31')][_0xf8bd('0x3d')]){_0x504366[_0xf8bd('0x3e')]=[{'all':!![]}];}_0x504366=_[_0xf8bd('0x3b')]({},_0x504366,_0x46e7d4[_0xf8bd('0x44')]);return db[_0xf8bd('0x3c')]['find'](_0x504366)[_0xf8bd('0x25')](handleEntityNotFound(_0x282a35,null))[_0xf8bd('0x25')](respondWithResult(_0x282a35,null))[_0xf8bd('0x41')](handleError(_0x282a35,null));};exports['create']=function(_0x1d6912,_0x4e2801){return db[_0xf8bd('0x3c')][_0xf8bd('0x45')](_0x1d6912[_0xf8bd('0x46')],{})['then'](respondWithResult(_0x4e2801,0xc9))[_0xf8bd('0x41')](handleError(_0x4e2801,null));};exports[_0xf8bd('0x24')]=function(_0x29b5a5,_0x27b4c0){if(_0x29b5a5[_0xf8bd('0x46')]['id']){delete _0x29b5a5[_0xf8bd('0x46')]['id'];}return db[_0xf8bd('0x3c')][_0xf8bd('0x47')]({'where':{'id':_0x29b5a5[_0xf8bd('0x48')]['id']}})[_0xf8bd('0x25')](handleEntityNotFound(_0x27b4c0,null))[_0xf8bd('0x25')](saveUpdates(_0x29b5a5[_0xf8bd('0x46')],null))[_0xf8bd('0x25')](respondWithResult(_0x27b4c0,null))[_0xf8bd('0x41')](handleError(_0x27b4c0,null));};exports[_0xf8bd('0x26')]=function(_0x2b0cb9,_0x2b5975){return db['Dynamics365Account'][_0xf8bd('0x47')]({'where':{'id':_0x2b0cb9[_0xf8bd('0x48')]['id']}})[_0xf8bd('0x25')](handleEntityNotFound(_0x2b5975,null))[_0xf8bd('0x25')](removeEntity(_0x2b5975,null))[_0xf8bd('0x41')](handleError(_0x2b5975,null));};exports[_0xf8bd('0x49')]=function(_0x283dfe,_0xcf4b86,_0x2d88a8){var _0x524299={};var _0x2ea54a={};var _0x324d5b;var _0x4023a8;return db[_0xf8bd('0x3c')][_0xf8bd('0x4a')]({'where':{'id':_0x283dfe['params']['id']}})[_0xf8bd('0x25')](handleEntityNotFound(_0xcf4b86,null))[_0xf8bd('0x25')](function(_0x1e1021){if(_0x1e1021){_0x324d5b=_0x1e1021;_0x2ea54a[_0xf8bd('0x2c')]=_[_0xf8bd('0x2e')](db['Dynamics365Configuration'][_0xf8bd('0x43')]);_0x2ea54a[_0xf8bd('0x31')]=_[_0xf8bd('0x2e')](_0x283dfe[_0xf8bd('0x31')]);_0x2ea54a[_0xf8bd('0x2f')]=_['intersection'](_0x2ea54a[_0xf8bd('0x2c')],_0x2ea54a['query']);_0x524299[_0xf8bd('0x32')]=_[_0xf8bd('0x30')](_0x2ea54a['model'],qs['fields'](_0x283dfe['query']['fields']));_0x524299[_0xf8bd('0x32')]=_0x524299['attributes'][_0xf8bd('0x34')]?_0x524299[_0xf8bd('0x32')]:_0x2ea54a[_0xf8bd('0x2c')];_0x524299['order']=qs[_0xf8bd('0x38')](_0x283dfe[_0xf8bd('0x31')][_0xf8bd('0x38')]);_0x524299[_0xf8bd('0x3a')]=qs['filters'](_['pick'](_0x283dfe['query'],_0x2ea54a[_0xf8bd('0x2f')]));if(_0x283dfe[_0xf8bd('0x31')][_0xf8bd('0x39')]){_0x524299[_0xf8bd('0x3a')]=_[_0xf8bd('0x3b')](_0x524299['where'],{'$or':_[_0xf8bd('0x2d')](_0x524299[_0xf8bd('0x32')],function(_0x5427d1){var _0x24339b={};_0x24339b[_0x5427d1]={'$like':'%'+_0x283dfe['query'][_0xf8bd('0x39')]+'%'};return _0x24339b;})});}_0x524299=_[_0xf8bd('0x3b')]({},_0x524299,_0x283dfe['options']);return _0x324d5b[_0xf8bd('0x49')](_0x524299);}})[_0xf8bd('0x25')](function(_0x123559){if(_0x123559){_0x4023a8=_0x123559[_0xf8bd('0x34')];if(!_0x283dfe[_0xf8bd('0x31')]['hasOwnProperty'](_0xf8bd('0x36'))){_0x524299[_0xf8bd('0x1e')]=qs[_0xf8bd('0x1e')](_0x283dfe['query']['limit']);_0x524299['offset']=qs[_0xf8bd('0x1c')](_0x283dfe['query']['offset']);}return _0x324d5b[_0xf8bd('0x49')](_0x524299);}})[_0xf8bd('0x25')](function(_0x3ddce9){if(_0x3ddce9){return _0x3ddce9?{'count':_0x4023a8,'rows':_0x3ddce9}:null;}})[_0xf8bd('0x25')](respondWithResult(_0xcf4b86,null))[_0xf8bd('0x41')](handleError(_0xcf4b86,null));};exports[_0xf8bd('0x4b')]=function(_0x2d7b2d,_0x34f50c,_0x4b9970){if(_0x2d7b2d[_0xf8bd('0x46')]['id']){delete _0x2d7b2d[_0xf8bd('0x46')]['id'];}return db[_0xf8bd('0x3c')][_0xf8bd('0x4a')]({'where':{'id':_0x2d7b2d['params']['id']}})[_0xf8bd('0x25')](handleEntityNotFound(_0x34f50c,null))[_0xf8bd('0x25')](function(_0x3ce75c){if(_0x3ce75c){_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x4c')]=_0x3ce75c['id'];_0x2d7b2d['body'][_0xf8bd('0x4d')]=integrations[_0xf8bd('0x4e')](_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x4f')],_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x2b')]);_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x50')]=integrations[_0xf8bd('0x51')](_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x4f')],_0x2d7b2d[_0xf8bd('0x46')][_0xf8bd('0x2b')]);return db[_0xf8bd('0x52')][_0xf8bd('0x45')](_0x2d7b2d['body'],{'include':[{'model':db[_0xf8bd('0x53')],'as':_0xf8bd('0x4d')},{'model':db['Dynamics365Field'],'as':_0xf8bd('0x50')}]});}return null;})[_0xf8bd('0x25')](respondWithResult(_0x34f50c,null))[_0xf8bd('0x41')](handleError(_0x34f50c,null));};exports[_0xf8bd('0x54')]=function(_0x4bb3b7,_0x5ee6f4,_0xbbaaa){var _0x35a8c1=_0x4bb3b7[_0xf8bd('0x31')][_0xf8bd('0x55')];var _0x5e0afb=_0x35a8c1===_0xf8bd('0x56')?_0xf8bd('0x57'):'PhoneCall';var _0x136a28='';var _0x2340c2='';var _0x327e46='';var _0x1d30a2='';var _0x5e7e26='';var _0x2a11e1='';var _0x334c5a='';var _0x523a68='';var _0x24d098=['title',_0xf8bd('0x58'),_0xf8bd('0x59'),_0xf8bd('0x5a'),'caseorigincode','subject','phonenumber','regardingobjectid',_0xf8bd('0x5b'),_0xf8bd('0x5c')];var _0x181c36=['accountidname',_0xf8bd('0x5d'),_0xf8bd('0x5e'),'billedserviceunits','contactidname','contactidyominame',_0xf8bd('0x5f'),'contractidname','createdbyexternalpartyname',_0xf8bd('0x60'),_0xf8bd('0x61'),_0xf8bd('0x62'),_0xf8bd('0x63'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xf8bd('0x64'),_0xf8bd('0x65'),_0xf8bd('0x66'),_0xf8bd('0x67'),_0xf8bd('0x68'),_0xf8bd('0x69'),_0xf8bd('0x6a'),_0xf8bd('0x6b'),'exchangerate',_0xf8bd('0x6c'),'followupby',_0xf8bd('0x6d'),_0xf8bd('0x6e'),_0xf8bd('0x6f'),_0xf8bd('0x70'),'masteridname',_0xf8bd('0x71'),_0xf8bd('0x72'),_0xf8bd('0x73'),_0xf8bd('0x74'),_0xf8bd('0x75'),_0xf8bd('0x76'),'modifiedonbehalfbyyominame',_0xf8bd('0x77'),_0xf8bd('0x78'),_0xf8bd('0x79'),'onholdtime',_0xf8bd('0x7a'),_0xf8bd('0x7b'),'owneridtype',_0xf8bd('0x7c'),_0xf8bd('0x7d'),'primarycontactidname',_0xf8bd('0x7e'),_0xf8bd('0x7f'),_0xf8bd('0x80'),_0xf8bd('0x81'),_0xf8bd('0x82'),'resolvebykpiidname','responseby',_0xf8bd('0x83'),_0xf8bd('0x84'),'sentimentvalue',_0xf8bd('0x85'),_0xf8bd('0x86'),'socialprofileidname',_0xf8bd('0x87'),_0xf8bd('0x88'),'subjectidname',_0xf8bd('0x89'),_0xf8bd('0x8a'),_0xf8bd('0x8b'),'traversedpath',_0xf8bd('0x8c'),'versionnumber'];var _0x511c79=_0x24d098[_0xf8bd('0x8d')](_0x181c36);return db['Dynamics365Account'][_0xf8bd('0x4a')]({'where':{'id':_0x4bb3b7['params']['id']},'attributes':['id','username',_0xf8bd('0x8e'),_0xf8bd('0x8f'),_0xf8bd('0x90'),_0xf8bd('0x91'),_0xf8bd('0x92')]})[_0xf8bd('0x25')](handleEntityNotFound(_0x5ee6f4,null))[_0xf8bd('0x25')](function(_0x5d4fc1){if(_0x5d4fc1){_0x523a68=_0x5d4fc1['remoteUri'];var _0x415eca=_0x523a68[_0xf8bd('0x93')](-0x1);if(_0x415eca==='/'){_0x523a68=_0x523a68[_0xf8bd('0x94')](0x0,_0x523a68[_0xf8bd('0x95')](_0x415eca));}_0x334c5a=util[_0xf8bd('0x96')](_0xf8bd('0x97'),_0x523a68);var _0x33081a={'method':'POST','uri':_0xf8bd('0x98')+_0x5d4fc1[_0xf8bd('0x90')]+_0xf8bd('0x99'),'form':{'client_id':_0x5d4fc1[_0xf8bd('0x91')],'resource':_0x523a68,'username':_0x5d4fc1[_0xf8bd('0x9a')],'password':_0x5d4fc1[_0xf8bd('0x8e')],'grant_type':_0xf8bd('0x8e'),'client_secret':_0x5d4fc1[_0xf8bd('0x92')]},'json':!![]};return rp(_0x33081a);}})[_0xf8bd('0x25')](function(_0x3ca358){_0x2a11e1=_0x3ca358[_0xf8bd('0x9b')];var _0x396034={'method':_0xf8bd('0x9c'),'uri':encodeURI(_0x334c5a+_0xf8bd('0x9d')+_0x5e0afb+'\x27'),'headers':{'Authorization':_0xf8bd('0x9e')+_0x2a11e1,'If-None-Match':null,'OData-Version':_0xf8bd('0x9f')},'json':!![]};return rp(_0x396034);})[_0xf8bd('0x25')](function(_0x15e169){var _0x2eb4d6=_0x15e169[_0xf8bd('0xa0')][0x0];var _0x594261=_0x2eb4d6[_0xf8bd('0xa1')];var _0x54ad68={'method':_0xf8bd('0x9c'),'uri':_0x334c5a+_0xf8bd('0xa2')+_0x594261+_0xf8bd('0xa3'),'headers':{'Authorization':'Bearer\x20'+_0x2a11e1,'If-None-Match':null,'OData-Version':_0xf8bd('0x9f')},'json':!![]};return rp(_0x54ad68);})['then'](function(_0x792e90){_0x136a28=_0x792e90;_0x2340c2=_0x136a28['Attributes'];_0x2340c2=_['remove'](_0x2340c2,function(_0x2e6958){return!_0x511c79[_0xf8bd('0xa4')](_0x2e6958[_0xf8bd('0xa5')]);});var _0x4eda50=[];var _0x1b9425=[];_0x2340c2[_0xf8bd('0xa6')](function(_0x1ea3a7){if(_0x1ea3a7['@odata.type']){var _0x31c5ad=_0x1ea3a7[_0xf8bd('0xa7')]['substring'](_0x1ea3a7[_0xf8bd('0xa7')][_0xf8bd('0x95')]('.')+0x1);if(_0x31c5ad===_0xf8bd('0xa8')){_0x4eda50[_0xf8bd('0xa9')](getSelectList(_0x334c5a,_0x35a8c1,_0x1b9425,_0x136a28[_0xf8bd('0xa1')],_0x1ea3a7[_0xf8bd('0xa1')],_0x2a11e1));}}});return Promise[_0xf8bd('0xaa')](_0x4eda50);})['then'](function(_0x44a6cd){_0x327e46=_0x44a6cd[0x0];var _0x2115c2=[];var _0x2f57b0=[];_0x2340c2[_0xf8bd('0xa6')](function(_0x5b7ae8){if(!_[_0xf8bd('0xab')](_0x5b7ae8[_0xf8bd('0xa7')])){var _0x128bde=_0x5b7ae8['@odata.type'][_0xf8bd('0x94')](_0x5b7ae8[_0xf8bd('0xa7')][_0xf8bd('0x95')]('.')+0x1);if(_0x128bde===_0xf8bd('0xac')){_0x2115c2['push'](getBooleanList(_0x334c5a,_0x35a8c1,_0x2f57b0,_0x136a28[_0xf8bd('0xa1')],_0x5b7ae8[_0xf8bd('0xa1')],_0x2a11e1));}}});return Promise[_0xf8bd('0xaa')](_0x2115c2);})[_0xf8bd('0x25')](function(_0x30a0fe){_0x1d30a2=_0x30a0fe[0x0];var _0x5ec0f8=[];var _0x4bc26c=[];_0x2340c2['forEach'](function(_0x5bffd7){if(_0x5bffd7[_0xf8bd('0xa7')]){var _0x33d593=_0x5bffd7[_0xf8bd('0xa7')][_0xf8bd('0x94')](_0x5bffd7[_0xf8bd('0xa7')][_0xf8bd('0x95')]('.')+0x1);if(_0x33d593===_0xf8bd('0xad')||_0x33d593==='DoubleAttributeMetadata'||_0x33d593===_0xf8bd('0xae')||_0x33d593===_0xf8bd('0xaf')||_0x33d593===_0xf8bd('0xb0')||_0x33d593===_0xf8bd('0xb1')||_0x33d593===_0xf8bd('0xb2')||_0x33d593===_0xf8bd('0xb3')||_0x33d593===_0xf8bd('0xb4')||_0x33d593==='DecimalAttributeMetadata'){_0x5ec0f8[_0xf8bd('0xa9')](getInputList(_0x334c5a,_0x35a8c1,_0x33d593,_0x4bc26c,_0x136a28['MetadataId'],_0x5bffd7[_0xf8bd('0xa1')],_0x2a11e1));}}});return Promise['all'](_0x5ec0f8);})['then'](function(_0x3339de){_0x5e7e26=_0x3339de[0x0];var _0x21db89=_0x327e46[_0xf8bd('0x8d')](_0x1d30a2)[_0xf8bd('0x8d')](_0x5e7e26);var _0x46570c={'count':_0x21db89[_0xf8bd('0x34')],'rows':_0x21db89};return _0x46570c;})['then'](respondWithResult(_0x5ee6f4,null))[_0xf8bd('0x41')](function(_0x5b0afe){var _0x24d99d=_0x4bb3b7[_0xf8bd('0x31')][_0xf8bd('0xb5')]?0x1f4:_0x5b0afe['statusCode']||0x1f4;logger[_0xf8bd('0x27')](_0x5b0afe[_0xf8bd('0xb6')]);delete _0x5b0afe[_0xf8bd('0x28')];if(_0x24d99d===0x191){_0x24d99d=0x190;}_0x5ee6f4[_0xf8bd('0x1a')](_0x24d99d)[_0xf8bd('0xb7')](_0x4bb3b7[_0xf8bd('0x31')][_0xf8bd('0xb5')]?{'message':_0xf8bd('0xb8'),'statusCode':_0x5b0afe[_0xf8bd('0xb9')]}:_0x5b0afe);});};function getSelectList(_0x4f3814,_0x4e41be,_0x45309f,_0xb16b0d,_0x2b6468,_0x40406c){var _0x52a265={'method':_0xf8bd('0x9c'),'uri':_0x4f3814+_0xf8bd('0xa2')+_0xb16b0d+_0xf8bd('0xba')+_0x2b6468+_0xf8bd('0xbb')+_0xf8bd('0xbc'),'headers':{'Authorization':_0xf8bd('0x9e')+_0x40406c,'If-None-Match':null,'OData-Version':_0xf8bd('0x9f')},'json':!![]};return rp(_0x52a265)[_0xf8bd('0x25')](function(_0x4a15a4){var _0x2720c3=[];var _0x5c5555=_0x4a15a4[_0xf8bd('0xbd')][_0xf8bd('0xbe')];_0x5c5555['forEach'](function(_0x39ea3f){_0x2720c3[_0xf8bd('0xa9')]({'name':_0x39ea3f['Label'][_0xf8bd('0xbf')][_0xf8bd('0xc0')],'value':String(_0x39ea3f['Value'])});});var _0x17e290={'id':_0x4e41be+'_'+_0x4a15a4[_0xf8bd('0xa5')],'name':_0x4a15a4[_0xf8bd('0xc1')][_0xf8bd('0xbf')][_0xf8bd('0xc0')],'custom':![],'options':_0x2720c3};_0x45309f[_0xf8bd('0xa9')](_0x17e290);return _0x45309f;});}function getBooleanList(_0x133390,_0x198dfd,_0x55d3dd,_0xba9b4b,_0x5f5176,_0x5979bb){var _0x18eee6={'method':'GET','uri':_0x133390+'EntityDefinitions('+_0xba9b4b+_0xf8bd('0xba')+_0x5f5176+_0xf8bd('0xc2'),'headers':{'Authorization':_0xf8bd('0x9e')+_0x5979bb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x18eee6)[_0xf8bd('0x25')](function(_0x3b0598){var _0x37d959=[];_0x37d959[_0xf8bd('0xa9')]({'name':_0x3b0598[_0xf8bd('0xbd')][_0xf8bd('0xc3')][_0xf8bd('0xc0')]['UserLocalizedLabel'][_0xf8bd('0xc0')],'value':_0xf8bd('0xc4')},{'name':_0x3b0598[_0xf8bd('0xbd')]['FalseOption'][_0xf8bd('0xc0')][_0xf8bd('0xbf')][_0xf8bd('0xc0')],'value':'false'});var _0x62b51c={'id':_0x198dfd+'_'+_0x3b0598[_0xf8bd('0xa5')],'name':_0x3b0598[_0xf8bd('0xc1')][_0xf8bd('0xbf')][_0xf8bd('0xc0')],'custom':![],'options':_0x37d959};_0x55d3dd[_0xf8bd('0xa9')](_0x62b51c);return _0x55d3dd;});}function getInputList(_0x4482a9,_0x4d22c2,_0x55597f,_0xe482ea,_0x2865d2,_0x4dbfcc,_0x16b04e){var _0x4ac77f={'method':'GET','uri':_0x4482a9+_0xf8bd('0xa2')+_0x2865d2+_0xf8bd('0xba')+_0x4dbfcc+_0xf8bd('0xc5')+_0x55597f+_0xf8bd('0xc6'),'headers':{'Authorization':_0xf8bd('0x9e')+_0x16b04e,'If-None-Match':null,'OData-Version':_0xf8bd('0x9f')},'json':!![]};return rp(_0x4ac77f)['then'](function(_0x135b18){var _0x141f22={'id':_0x4d22c2+'_'+_0x135b18[_0xf8bd('0xa5')],'name':_0x135b18[_0xf8bd('0xc1')][_0xf8bd('0xbf')]?_0x135b18['DisplayName'][_0xf8bd('0xbf')][_0xf8bd('0xc0')]:_0x135b18[_0xf8bd('0xa5')],'custom':![],'options':[]};_0xe482ea[_0xf8bd('0xa9')](_0x141f22);return _0xe482ea;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 97b991d..4385f34 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(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c9c24,_0x2d928d){var _0x11ec2b=function(_0x5d4927){while(--_0x5d4927){_0x2c9c24['push'](_0x2c9c24['shift']());}};_0x11ec2b(++_0x2d928d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 01f40e4..34e66da 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 _0xa2ae=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetDynamics365Account','findAll','options','where','attributes','limit','map','include','model','debug','ShowDynamics365Account','find','raw','lodash','util'];(function(_0x41c4f2,_0x118cac){var _0x3e8d5b=function(_0x323430){while(--_0x323430){_0x41c4f2['push'](_0x41c4f2['shift']());}};_0x3e8d5b(++_0x118cac);}(_0xa2ae,0x8e));var _0xea2a=function(_0x3c0569,_0x11da9f){_0x3c0569=_0x3c0569-0x0;var _0x142524=_0xa2ae[_0x3c0569];return _0x142524;};'use strict';var _=require(_0xea2a('0x0'));var util=require(_0xea2a('0x1'));var moment=require(_0xea2a('0x2'));var BPromise=require(_0xea2a('0x3'));var rs=require(_0xea2a('0x4'));var fs=require('fs');var Redis=require(_0xea2a('0x5'));var db=require(_0xea2a('0x6'))['db'];var utils=require(_0xea2a('0x7'));var logger=require(_0xea2a('0x8'))('rpc');var config=require(_0xea2a('0x9'));var jayson=require(_0xea2a('0xa'));var client=jayson[_0xea2a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x238a78,_0x1e93dd,_0x403974){return new BPromise(function(_0x119eca,_0x15e415){return client[_0xea2a('0xc')](_0x238a78,_0x403974)[_0xea2a('0xd')](function(_0x32a42a){logger[_0xea2a('0xe')](_0xea2a('0xf'),_0x1e93dd,'request\x20sent');logger['debug'](_0xea2a('0x10'),_0x1e93dd,_0xea2a('0x11'),JSON[_0xea2a('0x12')](_0x32a42a));if(_0x32a42a['error']){if(_0x32a42a[_0xea2a('0x13')]['code']===0x1f4){logger[_0xea2a('0x13')](_0xea2a('0xf'),_0x1e93dd,_0x32a42a['error'][_0xea2a('0x14')]);return _0x15e415(_0x32a42a[_0xea2a('0x13')][_0xea2a('0x14')]);}logger[_0xea2a('0x13')](_0xea2a('0xf'),_0x1e93dd,_0x32a42a[_0xea2a('0x13')][_0xea2a('0x14')]);return _0x119eca(_0x32a42a[_0xea2a('0x13')][_0xea2a('0x14')]);}else{logger['info'](_0xea2a('0xf'),_0x1e93dd,'request\x20sent');_0x119eca(_0x32a42a[_0xea2a('0x15')]['message']);}})[_0xea2a('0x16')](function(_0x231777){logger[_0xea2a('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x1e93dd,_0x231777);_0x15e415(_0x231777);});});}exports[_0xea2a('0x17')]=function(_0x5bf877){var _0x5c42aa=this;return new Promise(function(_0x5c7ae1,_0x4483f2){return db['Dynamics365Account'][_0xea2a('0x18')]({'raw':_0x5bf877[_0xea2a('0x19')]?_0x5bf877[_0xea2a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bf877[_0xea2a('0x19')]?_0x5bf877[_0xea2a('0x19')][_0xea2a('0x1a')]||null:null,'attributes':_0x5bf877[_0xea2a('0x19')]?_0x5bf877['options'][_0xea2a('0x1b')]||null:null,'limit':_0x5bf877[_0xea2a('0x19')]?_0x5bf877[_0xea2a('0x19')][_0xea2a('0x1c')]||null:null,'include':_0x5bf877[_0xea2a('0x19')]?_0x5bf877[_0xea2a('0x19')]['include']?_[_0xea2a('0x1d')](_0x5bf877[_0xea2a('0x19')][_0xea2a('0x1e')],function(_0x5b6fcb){return{'model':db[_0x5b6fcb['model']],'as':_0x5b6fcb['as'],'attributes':_0x5b6fcb[_0xea2a('0x1b')],'include':_0x5b6fcb[_0xea2a('0x1e')]?_[_0xea2a('0x1d')](_0x5b6fcb[_0xea2a('0x1e')],function(_0x57f9da){return{'model':db[_0x57f9da[_0xea2a('0x1f')]],'as':_0x57f9da['as'],'attributes':_0x57f9da[_0xea2a('0x1b')],'include':_0x57f9da[_0xea2a('0x1e')]?_[_0xea2a('0x1d')](_0x57f9da[_0xea2a('0x1e')],function(_0x2c5478){return{'model':db[_0x2c5478[_0xea2a('0x1f')]],'as':_0x2c5478['as'],'attributes':_0x2c5478[_0xea2a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c52df){logger[_0xea2a('0xe')](_0xea2a('0x17'),_0x5bf877);logger[_0xea2a('0x20')]('GetDynamics365Account',_0x5bf877,JSON['stringify'](_0x1c52df));_0x5c7ae1(_0x1c52df);})[_0xea2a('0x16')](function(_0x13ffaa){logger[_0xea2a('0x13')](_0xea2a('0x17'),_0x13ffaa[_0xea2a('0x14')],_0x5bf877);_0x4483f2(_0x5c42aa[_0xea2a('0x13')](0x1f4,_0x13ffaa[_0xea2a('0x14')]));});});};exports[_0xea2a('0x21')]=function(_0x2bebfd){var _0x24bc46=this;return new Promise(function(_0x38007c,_0x259404){return db['Dynamics365Account'][_0xea2a('0x22')]({'raw':_0x2bebfd['options']?_0x2bebfd[_0xea2a('0x19')][_0xea2a('0x23')]===undefined?!![]:![]:!![],'where':_0x2bebfd[_0xea2a('0x19')]?_0x2bebfd[_0xea2a('0x19')][_0xea2a('0x1a')]||null:null,'attributes':_0x2bebfd['options']?_0x2bebfd['options'][_0xea2a('0x1b')]||null:null,'include':_0x2bebfd[_0xea2a('0x19')]?_0x2bebfd['options']['include']?_[_0xea2a('0x1d')](_0x2bebfd['options'][_0xea2a('0x1e')],function(_0x26d9e8){return{'model':db[_0x26d9e8[_0xea2a('0x1f')]],'as':_0x26d9e8['as'],'attributes':_0x26d9e8[_0xea2a('0x1b')],'include':_0x26d9e8['include']?_[_0xea2a('0x1d')](_0x26d9e8[_0xea2a('0x1e')],function(_0x55191b){return{'model':db[_0x55191b[_0xea2a('0x1f')]],'as':_0x55191b['as'],'attributes':_0x55191b['attributes'],'include':_0x55191b[_0xea2a('0x1e')]?_[_0xea2a('0x1d')](_0x55191b[_0xea2a('0x1e')],function(_0x33d616){return{'model':db[_0x33d616['model']],'as':_0x33d616['as'],'attributes':_0x33d616['attributes']};}):[]};}):[]};}):[]:[]})[_0xea2a('0xd')](function(_0x3cf781){logger[_0xea2a('0xe')](_0xea2a('0x21'),_0x2bebfd);logger[_0xea2a('0x20')](_0xea2a('0x21'),_0x2bebfd,JSON[_0xea2a('0x12')](_0x3cf781));_0x38007c(_0x3cf781);})[_0xea2a('0x16')](function(_0x2f0e02){logger[_0xea2a('0x13')](_0xea2a('0x21'),_0x2f0e02['message'],_0x2bebfd);_0x259404(_0x24bc46[_0xea2a('0x13')](0x1f4,_0x2f0e02[_0xea2a('0x14')]));});});}; \ No newline at end of file +var _0x438e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','ShowDynamics365Account','find','util'];(function(_0x10c81e,_0x796c70){var _0x442daf=function(_0x35efbf){while(--_0x35efbf){_0x10c81e['push'](_0x10c81e['shift']());}};_0x442daf(++_0x796c70);}(_0x438e,0x6e));var _0xe438=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x438e[_0x2678d6];return _0x475503;};'use strict';var _=require('lodash');var util=require(_0xe438('0x0'));var moment=require(_0xe438('0x1'));var BPromise=require(_0xe438('0x2'));var rs=require(_0xe438('0x3'));var fs=require('fs');var Redis=require(_0xe438('0x4'));var db=require(_0xe438('0x5'))['db'];var utils=require(_0xe438('0x6'));var logger=require(_0xe438('0x7'))('rpc');var config=require(_0xe438('0x8'));var jayson=require(_0xe438('0x9'));var client=jayson[_0xe438('0xa')][_0xe438('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fbd20,_0xe42403,_0x43fdd1){return new BPromise(function(_0x39bda1,_0x563bbd){return client[_0xe438('0xc')](_0x1fbd20,_0x43fdd1)[_0xe438('0xd')](function(_0x1ac54a){logger[_0xe438('0xe')](_0xe438('0xf'),_0xe42403,_0xe438('0x10'));logger[_0xe438('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0xe42403,_0xe438('0x10'),JSON[_0xe438('0x12')](_0x1ac54a));if(_0x1ac54a[_0xe438('0x13')]){if(_0x1ac54a[_0xe438('0x13')][_0xe438('0x14')]===0x1f4){logger['error'](_0xe438('0xf'),_0xe42403,_0x1ac54a[_0xe438('0x13')]['message']);return _0x563bbd(_0x1ac54a[_0xe438('0x13')]['message']);}logger['error'](_0xe438('0xf'),_0xe42403,_0x1ac54a['error'][_0xe438('0x15')]);return _0x39bda1(_0x1ac54a['error'][_0xe438('0x15')]);}else{logger[_0xe438('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0xe42403,_0xe438('0x10'));_0x39bda1(_0x1ac54a[_0xe438('0x16')]['message']);}})[_0xe438('0x17')](function(_0xbcd100){logger[_0xe438('0x13')](_0xe438('0xf'),_0xe42403,_0xbcd100);_0x563bbd(_0xbcd100);});});}exports[_0xe438('0x18')]=function(_0x3980c5){var _0x216f90=this;return new Promise(function(_0x29330f,_0x3f20eb){return db[_0xe438('0x19')][_0xe438('0x1a')]({'raw':_0x3980c5[_0xe438('0x1b')]?_0x3980c5[_0xe438('0x1b')][_0xe438('0x1c')]===undefined?!![]:![]:!![],'where':_0x3980c5[_0xe438('0x1b')]?_0x3980c5[_0xe438('0x1b')][_0xe438('0x1d')]||null:null,'attributes':_0x3980c5['options']?_0x3980c5[_0xe438('0x1b')][_0xe438('0x1e')]||null:null,'limit':_0x3980c5[_0xe438('0x1b')]?_0x3980c5['options'][_0xe438('0x1f')]||null:null,'include':_0x3980c5['options']?_0x3980c5[_0xe438('0x1b')]['include']?_[_0xe438('0x20')](_0x3980c5[_0xe438('0x1b')][_0xe438('0x21')],function(_0xbe1e73){return{'model':db[_0xbe1e73[_0xe438('0x22')]],'as':_0xbe1e73['as'],'attributes':_0xbe1e73[_0xe438('0x1e')],'include':_0xbe1e73['include']?_[_0xe438('0x20')](_0xbe1e73[_0xe438('0x21')],function(_0x4f9c7e){return{'model':db[_0x4f9c7e[_0xe438('0x22')]],'as':_0x4f9c7e['as'],'attributes':_0x4f9c7e[_0xe438('0x1e')],'include':_0x4f9c7e[_0xe438('0x21')]?_[_0xe438('0x20')](_0x4f9c7e[_0xe438('0x21')],function(_0x1f6452){return{'model':db[_0x1f6452[_0xe438('0x22')]],'as':_0x1f6452['as'],'attributes':_0x1f6452[_0xe438('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe438('0xd')](function(_0x2827d6){logger['info'](_0xe438('0x18'),_0x3980c5);logger['debug']('GetDynamics365Account',_0x3980c5,JSON['stringify'](_0x2827d6));_0x29330f(_0x2827d6);})[_0xe438('0x17')](function(_0x1de33a){logger[_0xe438('0x13')](_0xe438('0x18'),_0x1de33a[_0xe438('0x15')],_0x3980c5);_0x3f20eb(_0x216f90[_0xe438('0x13')](0x1f4,_0x1de33a[_0xe438('0x15')]));});});};exports[_0xe438('0x23')]=function(_0x28becf){var _0x44b5c0=this;return new Promise(function(_0x599042,_0x5371b9){return db[_0xe438('0x19')][_0xe438('0x24')]({'raw':_0x28becf[_0xe438('0x1b')]?_0x28becf[_0xe438('0x1b')][_0xe438('0x1c')]===undefined?!![]:![]:!![],'where':_0x28becf[_0xe438('0x1b')]?_0x28becf[_0xe438('0x1b')][_0xe438('0x1d')]||null:null,'attributes':_0x28becf['options']?_0x28becf[_0xe438('0x1b')][_0xe438('0x1e')]||null:null,'include':_0x28becf[_0xe438('0x1b')]?_0x28becf['options'][_0xe438('0x21')]?_[_0xe438('0x20')](_0x28becf['options'][_0xe438('0x21')],function(_0x56e67c){return{'model':db[_0x56e67c['model']],'as':_0x56e67c['as'],'attributes':_0x56e67c[_0xe438('0x1e')],'include':_0x56e67c[_0xe438('0x21')]?_[_0xe438('0x20')](_0x56e67c[_0xe438('0x21')],function(_0x8ea2fc){return{'model':db[_0x8ea2fc[_0xe438('0x22')]],'as':_0x8ea2fc['as'],'attributes':_0x8ea2fc[_0xe438('0x1e')],'include':_0x8ea2fc[_0xe438('0x21')]?_[_0xe438('0x20')](_0x8ea2fc[_0xe438('0x21')],function(_0x3107f3){return{'model':db[_0x3107f3[_0xe438('0x22')]],'as':_0x3107f3['as'],'attributes':_0x3107f3[_0xe438('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b0b4c){logger[_0xe438('0xe')](_0xe438('0x23'),_0x28becf);logger['debug'](_0xe438('0x23'),_0x28becf,JSON['stringify'](_0x1b0b4c));_0x599042(_0x1b0b4c);})[_0xe438('0x17')](function(_0x4d904f){logger['error']('ShowDynamics365Account',_0x4d904f[_0xe438('0x15')],_0x28becf);_0x5371b9(_0x44b5c0[_0xe438('0x13')](0x1f4,_0x4d904f[_0xe438('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 5313fe3..3c93c1c 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 _0x9a43=['/:id/fields','getFields','/:id/subjects','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a43,0x15a));var _0x39a4=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0x9a43[_0x67b075];return _0x39d030;};'use strict';var multer=require('multer');var util=require(_0x39a4('0x0'));var path=require(_0x39a4('0x1'));var timeout=require(_0x39a4('0x2'));var express=require(_0x39a4('0x3'));var router=express[_0x39a4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x39a4('0x5'));var controller=require(_0x39a4('0x6'));router[_0x39a4('0x7')]('/',auth['isAuthenticated'](),controller[_0x39a4('0x8')]);router[_0x39a4('0x7')]('/:id',auth[_0x39a4('0x9')](),controller[_0x39a4('0xa')]);router[_0x39a4('0x7')](_0x39a4('0xb'),auth[_0x39a4('0x9')](),controller[_0x39a4('0xc')]);router[_0x39a4('0x7')](_0x39a4('0xd'),auth[_0x39a4('0x9')](),controller['getSubjects']);router[_0x39a4('0x7')]('/:id/descriptions',auth[_0x39a4('0x9')](),controller['getDescriptions']);router[_0x39a4('0xe')]('/',auth[_0x39a4('0x9')](),controller[_0x39a4('0xf')]);router['put'](_0x39a4('0x10'),auth['isAuthenticated'](),controller[_0x39a4('0x11')]);router[_0x39a4('0x12')](_0x39a4('0x10'),auth[_0x39a4('0x9')](),controller[_0x39a4('0x13')]);module[_0x39a4('0x14')]=router; \ No newline at end of file +var _0x8d75=['/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x2adb53,_0x4b8d22){var _0x49bd5b=function(_0x29a400){while(--_0x29a400){_0x2adb53['push'](_0x2adb53['shift']());}};_0x49bd5b(++_0x4b8d22);}(_0x8d75,0x6d));var _0x58d7=function(_0x4a4f31,_0x3dbbf9){_0x4a4f31=_0x4a4f31-0x0;var _0x4fce17=_0x8d75[_0x4a4f31];return _0x4fce17;};'use strict';var multer=require(_0x58d7('0x0'));var util=require(_0x58d7('0x1'));var path=require(_0x58d7('0x2'));var timeout=require(_0x58d7('0x3'));var express=require(_0x58d7('0x4'));var router=express[_0x58d7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58d7('0x6'));var config=require(_0x58d7('0x7'));var controller=require(_0x58d7('0x8'));router[_0x58d7('0x9')]('/',auth[_0x58d7('0xa')](),controller['index']);router['get'](_0x58d7('0xb'),auth[_0x58d7('0xa')](),controller[_0x58d7('0xc')]);router['get']('/:id/fields',auth[_0x58d7('0xa')](),controller['getFields']);router[_0x58d7('0x9')](_0x58d7('0xd'),auth[_0x58d7('0xa')](),controller[_0x58d7('0xe')]);router[_0x58d7('0x9')](_0x58d7('0xf'),auth[_0x58d7('0xa')](),controller[_0x58d7('0x10')]);router[_0x58d7('0x11')]('/',auth[_0x58d7('0xa')](),controller[_0x58d7('0x12')]);router[_0x58d7('0x13')](_0x58d7('0xb'),auth['isAuthenticated'](),controller[_0x58d7('0x14')]);router[_0x58d7('0x15')](_0x58d7('0xb'),auth[_0x58d7('0xa')](),controller[_0x58d7('0x16')]);module[_0x58d7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 79e31d3..8d6315f 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 _0x441b=['phonecall','incident','exports','STRING'];(function(_0x4b4e82,_0x1affdc){var _0x43d5fe=function(_0x1a814b){while(--_0x1a814b){_0x4b4e82['push'](_0x4b4e82['shift']());}};_0x43d5fe(++_0x1affdc);}(_0x441b,0xaa));var _0xb441=function(_0x1d5cbd,_0x1bbfa7){_0x1d5cbd=_0x1d5cbd-0x0;var _0x3d2215=_0x441b[_0x1d5cbd];return _0x3d2215;};'use strict';var Sequelize=require('sequelize');module[_0xb441('0x0')]={'name':{'type':Sequelize[_0xb441('0x1')]},'description':{'type':Sequelize[_0xb441('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0xb441('0x2')),'defaultValue':_0xb441('0x3')}}; \ No newline at end of file +var _0x422d=['incident','phonecall','sequelize','exports','STRING'];(function(_0x5d70dc,_0x3a1fbe){var _0x3004be=function(_0x1244bb){while(--_0x1244bb){_0x5d70dc['push'](_0x5d70dc['shift']());}};_0x3004be(++_0x3a1fbe);}(_0x422d,0x192));var _0xd422=function(_0x31127d,_0x24754a){_0x31127d=_0x31127d-0x0;var _0x4a11e2=_0x422d[_0x31127d];return _0x4a11e2;};'use strict';var Sequelize=require(_0xd422('0x0'));module[_0xd422('0x1')]={'name':{'type':Sequelize[_0xd422('0x2')]},'description':{'type':Sequelize[_0xd422('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xd422('0x3'),_0xd422('0x4')),'defaultValue':_0xd422('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8f38be8..92c0456 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 _0x84f3=['json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range'];(function(_0x3ed23e,_0x14df08){var _0x4ca1cc=function(_0xcf5d9c){while(--_0xcf5d9c){_0x3ed23e['push'](_0x3ed23e['shift']());}};_0x4ca1cc(++_0x14df08);}(_0x84f3,0x173));var _0x384f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x84f3[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x384f('0x0'));var rimraf=require(_0x384f('0x1'));var zipdir=require(_0x384f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x384f('0x3'));var BPromise=require(_0x384f('0x4'));var Mustache=require(_0x384f('0x5'));var util=require(_0x384f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x384f('0x7'));var ejs=require(_0x384f('0x8'));var fs=require('fs');var fs_extra=require(_0x384f('0x9'));var _=require(_0x384f('0xa'));var squel=require(_0x384f('0xb'));var crypto=require('crypto');var jsforce=require(_0x384f('0xc'));var deskjs=require(_0x384f('0xd'));var toCsv=require(_0x384f('0x7'));var querystring=require('querystring');var Papa=require(_0x384f('0xe'));var Redis=require(_0x384f('0xf'));var authService=require(_0x384f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x384f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x384f('0x12'))(_0x384f('0x13'));var utils=require(_0x384f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x384f('0x15'))['db'];function respondWithStatusCode(_0xc0304d,_0x3e894d){_0x3e894d=_0x3e894d||0xcc;return function(_0x249032){if(_0x249032){return _0xc0304d['sendStatus'](_0x3e894d);}return _0xc0304d[_0x384f('0x16')](_0x3e894d)['end']();};}function respondWithResult(_0x3ba64b,_0x5af49e){_0x5af49e=_0x5af49e||0xc8;return function(_0x3cdd24){if(_0x3cdd24){return _0x3ba64b[_0x384f('0x16')](_0x5af49e)['json'](_0x3cdd24);}};}function respondWithFilteredResult(_0x3dbf73,_0x33f2d5){return function(_0x4b2579){if(_0x4b2579){var _0x3810b8=typeof _0x33f2d5[_0x384f('0x17')]==='undefined'&&typeof _0x33f2d5[_0x384f('0x18')]===_0x384f('0x19');var _0x488d13=_0x4b2579[_0x384f('0x1a')];var _0x25fd6d=_0x3810b8?0x0:_0x33f2d5['offset'];var _0x4016ee=_0x3810b8?_0x4b2579[_0x384f('0x1a')]:_0x33f2d5[_0x384f('0x17')]+_0x33f2d5[_0x384f('0x18')];var _0x4ce50b;if(_0x4016ee>=_0x488d13){_0x4016ee=_0x488d13;_0x4ce50b=0xc8;}else{_0x4ce50b=0xce;}_0x3dbf73['status'](_0x4ce50b);return _0x3dbf73[_0x384f('0x1b')](_0x384f('0x1c'),_0x25fd6d+'-'+_0x4016ee+'/'+_0x488d13)[_0x384f('0x1d')](_0x4b2579);}return null;};}function patchUpdates(_0x2f3d0a){return function(_0x39a639){try{jsonpatch[_0x384f('0x1e')](_0x39a639,_0x2f3d0a,!![]);}catch(_0xd65c80){return BPromise[_0x384f('0x1f')](_0xd65c80);}return _0x39a639[_0x384f('0x20')]();};}function saveUpdates(_0x5a9db7,_0x3d137d){return function(_0x1a229b){if(_0x1a229b){return _0x1a229b[_0x384f('0x21')](_0x5a9db7)['then'](function(_0x44495e){return _0x44495e;});}return null;};}function removeEntity(_0x1dc601,_0x29a236){return function(_0x10d910){if(_0x10d910){return _0x10d910[_0x384f('0x22')]()[_0x384f('0x23')](function(){_0x1dc601[_0x384f('0x16')](0xcc)[_0x384f('0x24')]();});}};}function handleEntityNotFound(_0x2daed5,_0x249fcf){return function(_0x3c410a){if(!_0x3c410a){_0x2daed5[_0x384f('0x25')](0x194);}return _0x3c410a;};}function handleError(_0xa01e4a,_0x311d98){_0x311d98=_0x311d98||0x1f4;return function(_0x28133d){logger[_0x384f('0x26')](_0x28133d[_0x384f('0x27')]);if(_0x28133d[_0x384f('0x28')]){delete _0x28133d[_0x384f('0x28')];}_0xa01e4a[_0x384f('0x16')](_0x311d98)[_0x384f('0x29')](_0x28133d);};}exports['index']=function(_0x5919f5,_0x13fcd0){var _0x5de36a={},_0x9af0be={},_0x2ad2ef={'count':0x0,'rows':[]};var _0x277e3b=_[_0x384f('0x2a')](db[_0x384f('0x2b')][_0x384f('0x2c')],function(_0x3ba5b7){return{'name':_0x3ba5b7[_0x384f('0x2d')],'type':_0x3ba5b7[_0x384f('0x2e')][_0x384f('0x2f')]};});_0x9af0be['model']=_[_0x384f('0x2a')](_0x277e3b,'name');_0x9af0be[_0x384f('0x30')]=_['keys'](_0x5919f5[_0x384f('0x30')]);_0x9af0be[_0x384f('0x31')]=_[_0x384f('0x32')](_0x9af0be[_0x384f('0x33')],_0x9af0be[_0x384f('0x30')]);_0x5de36a['attributes']=_[_0x384f('0x32')](_0x9af0be[_0x384f('0x33')],qs['fields'](_0x5919f5[_0x384f('0x30')][_0x384f('0x34')]));_0x5de36a[_0x384f('0x35')]=_0x5de36a[_0x384f('0x35')][_0x384f('0x36')]?_0x5de36a[_0x384f('0x35')]:_0x9af0be[_0x384f('0x33')];if(!_0x5919f5[_0x384f('0x30')][_0x384f('0x37')](_0x384f('0x38'))){_0x5de36a[_0x384f('0x18')]=qs[_0x384f('0x18')](_0x5919f5[_0x384f('0x30')][_0x384f('0x18')]);_0x5de36a[_0x384f('0x17')]=qs[_0x384f('0x17')](_0x5919f5[_0x384f('0x30')][_0x384f('0x17')]);}_0x5de36a[_0x384f('0x39')]=qs[_0x384f('0x3a')](_0x5919f5[_0x384f('0x30')][_0x384f('0x3a')]);_0x5de36a[_0x384f('0x3b')]=qs[_0x384f('0x31')](_[_0x384f('0x3c')](_0x5919f5['query'],_0x9af0be[_0x384f('0x31')]),_0x277e3b);if(_0x5919f5['query'][_0x384f('0x3d')]){_0x5de36a[_0x384f('0x3b')]=_['merge'](_0x5de36a['where'],{'$or':_[_0x384f('0x2a')](_0x277e3b,function(_0x5b1297){if(_0x5b1297[_0x384f('0x2e')]!==_0x384f('0x3e')){var _0x373c61={};_0x373c61[_0x5b1297[_0x384f('0x28')]]={'$like':'%'+_0x5919f5['query'][_0x384f('0x3d')]+'%'};return _0x373c61;}})});}_0x5de36a=_[_0x384f('0x3f')]({},_0x5de36a,_0x5919f5[_0x384f('0x40')]);var _0x1f8e03={'where':_0x5de36a['where']};return db[_0x384f('0x2b')][_0x384f('0x1a')](_0x1f8e03)[_0x384f('0x23')](function(_0x4e8666){_0x2ad2ef[_0x384f('0x1a')]=_0x4e8666;if(_0x5919f5[_0x384f('0x30')][_0x384f('0x41')]){_0x5de36a[_0x384f('0x42')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x384f('0x43')](_0x5de36a);})['then'](function(_0x3e334c){_0x2ad2ef['rows']=_0x3e334c;return _0x2ad2ef;})['then'](respondWithFilteredResult(_0x13fcd0,_0x5de36a))[_0x384f('0x44')](handleError(_0x13fcd0,null));};exports[_0x384f('0x45')]=function(_0x1f41bf,_0x5e4255){var _0x172574={'raw':![],'where':{'id':_0x1f41bf['params']['id']}},_0x3f14a4={};_0x3f14a4[_0x384f('0x33')]=_[_0x384f('0x46')](db[_0x384f('0x2b')][_0x384f('0x2c')]);_0x3f14a4['query']=_['keys'](_0x1f41bf[_0x384f('0x30')]);_0x3f14a4['filters']=_[_0x384f('0x32')](_0x3f14a4['model'],_0x3f14a4[_0x384f('0x30')]);_0x172574['attributes']=_[_0x384f('0x32')](_0x3f14a4[_0x384f('0x33')],qs[_0x384f('0x34')](_0x1f41bf[_0x384f('0x30')]['fields']));_0x172574['attributes']=_0x172574[_0x384f('0x35')]['length']?_0x172574[_0x384f('0x35')]:_0x3f14a4['model'];if(_0x1f41bf['query']['includeAll']){_0x172574[_0x384f('0x42')]=[{'all':!![]}];}_0x172574=_['merge']({},_0x172574,_0x1f41bf[_0x384f('0x40')]);return db['Dynamics365Configuration'][_0x384f('0x47')](_0x172574)[_0x384f('0x23')](handleEntityNotFound(_0x5e4255,null))[_0x384f('0x23')](respondWithResult(_0x5e4255,null))[_0x384f('0x44')](handleError(_0x5e4255,null));};exports[_0x384f('0x48')]=function(_0xc7f399,_0x22e132){return db[_0x384f('0x2b')][_0x384f('0x48')](_0xc7f399[_0x384f('0x49')],{})[_0x384f('0x23')](respondWithResult(_0x22e132,0xc9))[_0x384f('0x44')](handleError(_0x22e132,null));};exports[_0x384f('0x21')]=function(_0x360b23,_0x29da84){if(_0x360b23[_0x384f('0x49')]['id']){delete _0x360b23[_0x384f('0x49')]['id'];}return db[_0x384f('0x2b')][_0x384f('0x47')]({'where':{'id':_0x360b23[_0x384f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29da84,null))['then'](saveUpdates(_0x360b23[_0x384f('0x49')],null))[_0x384f('0x23')](respondWithResult(_0x29da84,null))['catch'](handleError(_0x29da84,null));};exports[_0x384f('0x22')]=function(_0x227436,_0x3fa3e5){return db['Dynamics365Configuration'][_0x384f('0x47')]({'where':{'id':_0x227436[_0x384f('0x4a')]['id']}})[_0x384f('0x23')](handleEntityNotFound(_0x3fa3e5,null))[_0x384f('0x23')](removeEntity(_0x3fa3e5,null))[_0x384f('0x44')](handleError(_0x3fa3e5,null));};exports[_0x384f('0x4b')]=function(_0x20668b,_0x4ffb29,_0x1c107b){var _0x3ec187={};var _0x276854={};var _0x41a109;var _0x54fc20;return db['Dynamics365Configuration'][_0x384f('0x4c')]({'where':{'id':_0x20668b[_0x384f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ffb29,null))['then'](function(_0x51fa67){if(_0x51fa67){_0x41a109=_0x51fa67;_0x276854[_0x384f('0x33')]=_[_0x384f('0x46')](db['Dynamics365Field'][_0x384f('0x2c')]);_0x276854[_0x384f('0x30')]=_['keys'](_0x20668b[_0x384f('0x30')]);_0x276854[_0x384f('0x31')]=_['intersection'](_0x276854[_0x384f('0x33')],_0x276854[_0x384f('0x30')]);_0x3ec187[_0x384f('0x35')]=_['intersection'](_0x276854[_0x384f('0x33')],qs[_0x384f('0x34')](_0x20668b['query'][_0x384f('0x34')]));_0x3ec187[_0x384f('0x35')]=_0x3ec187[_0x384f('0x35')][_0x384f('0x36')]?_0x3ec187[_0x384f('0x35')]:_0x276854[_0x384f('0x33')];_0x3ec187['order']=qs[_0x384f('0x3a')](_0x20668b['query'][_0x384f('0x3a')]);_0x3ec187[_0x384f('0x3b')]=qs[_0x384f('0x31')](_[_0x384f('0x3c')](_0x20668b[_0x384f('0x30')],_0x276854[_0x384f('0x31')]));if(_0x20668b[_0x384f('0x30')][_0x384f('0x3d')]){_0x3ec187[_0x384f('0x3b')]=_[_0x384f('0x3f')](_0x3ec187[_0x384f('0x3b')],{'$or':_['map'](_0x3ec187[_0x384f('0x35')],function(_0x50d9f4){var _0x77396={};_0x77396[_0x50d9f4]={'$like':'%'+_0x20668b[_0x384f('0x30')][_0x384f('0x3d')]+'%'};return _0x77396;})});}_0x3ec187=_[_0x384f('0x3f')]({},_0x3ec187,_0x20668b['options']);return _0x41a109[_0x384f('0x4b')](_0x3ec187);}})[_0x384f('0x23')](function(_0x5538a5){if(_0x5538a5){_0x54fc20=_0x5538a5['length'];if(!_0x20668b[_0x384f('0x30')][_0x384f('0x37')]('nolimit')){_0x3ec187['limit']=qs['limit'](_0x20668b['query'][_0x384f('0x18')]);_0x3ec187[_0x384f('0x17')]=qs[_0x384f('0x17')](_0x20668b['query'][_0x384f('0x17')]);}return _0x41a109['getFields'](_0x3ec187);}})[_0x384f('0x23')](function(_0x13f56c){if(_0x13f56c){return _0x13f56c?{'count':_0x54fc20,'rows':_0x13f56c}:null;}})[_0x384f('0x23')](respondWithResult(_0x4ffb29,null))[_0x384f('0x44')](handleError(_0x4ffb29,null));};exports[_0x384f('0x4d')]=function(_0x61e6a,_0x51e492,_0xec2edf){var _0x16c612={};var _0x1c241c={};var _0x198e2e;var _0x145df3;return db[_0x384f('0x2b')][_0x384f('0x4c')]({'where':{'id':_0x61e6a[_0x384f('0x4a')]['id']}})[_0x384f('0x23')](handleEntityNotFound(_0x51e492,null))[_0x384f('0x23')](function(_0x4b333a){if(_0x4b333a){_0x198e2e=_0x4b333a;_0x1c241c[_0x384f('0x33')]=_['keys'](db['Dynamics365Field'][_0x384f('0x2c')]);_0x1c241c[_0x384f('0x30')]=_[_0x384f('0x46')](_0x61e6a['query']);_0x1c241c[_0x384f('0x31')]=_[_0x384f('0x32')](_0x1c241c[_0x384f('0x33')],_0x1c241c['query']);_0x16c612[_0x384f('0x35')]=_[_0x384f('0x32')](_0x1c241c[_0x384f('0x33')],qs[_0x384f('0x34')](_0x61e6a['query'][_0x384f('0x34')]));_0x16c612[_0x384f('0x35')]=_0x16c612[_0x384f('0x35')][_0x384f('0x36')]?_0x16c612[_0x384f('0x35')]:_0x1c241c[_0x384f('0x33')];_0x16c612[_0x384f('0x39')]=qs[_0x384f('0x3a')](_0x61e6a[_0x384f('0x30')][_0x384f('0x3a')]);_0x16c612[_0x384f('0x3b')]=qs['filters'](_['pick'](_0x61e6a[_0x384f('0x30')],_0x1c241c['filters']));if(_0x61e6a[_0x384f('0x30')][_0x384f('0x3d')]){_0x16c612[_0x384f('0x3b')]=_[_0x384f('0x3f')](_0x16c612[_0x384f('0x3b')],{'$or':_[_0x384f('0x2a')](_0x16c612['attributes'],function(_0x2b6eb1){var _0x5c8c68={};_0x5c8c68[_0x2b6eb1]={'$like':'%'+_0x61e6a[_0x384f('0x30')]['filter']+'%'};return _0x5c8c68;})});}_0x16c612=_[_0x384f('0x3f')]({},_0x16c612,_0x61e6a[_0x384f('0x40')]);return _0x198e2e[_0x384f('0x4d')](_0x16c612);}})[_0x384f('0x23')](function(_0x5719d5){if(_0x5719d5){_0x145df3=_0x5719d5['length'];if(!_0x61e6a['query'][_0x384f('0x37')]('nolimit')){_0x16c612[_0x384f('0x18')]=qs[_0x384f('0x18')](_0x61e6a[_0x384f('0x30')][_0x384f('0x18')]);_0x16c612[_0x384f('0x17')]=qs[_0x384f('0x17')](_0x61e6a[_0x384f('0x30')]['offset']);}return _0x198e2e[_0x384f('0x4d')](_0x16c612);}})[_0x384f('0x23')](function(_0x1be170){if(_0x1be170){return _0x1be170?{'count':_0x145df3,'rows':_0x1be170}:null;}})['then'](respondWithResult(_0x51e492,null))[_0x384f('0x44')](handleError(_0x51e492,null));};exports['getDescriptions']=function(_0x398843,_0x267ed3,_0x42d188){var _0x237278={};var _0x55528b={};var _0x2b843b;var _0x1b57fe;return db[_0x384f('0x2b')]['findOne']({'where':{'id':_0x398843[_0x384f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x267ed3,null))[_0x384f('0x23')](function(_0x334d32){if(_0x334d32){_0x2b843b=_0x334d32;_0x55528b[_0x384f('0x33')]=_[_0x384f('0x46')](db[_0x384f('0x4e')]['rawAttributes']);_0x55528b[_0x384f('0x30')]=_[_0x384f('0x46')](_0x398843[_0x384f('0x30')]);_0x55528b[_0x384f('0x31')]=_[_0x384f('0x32')](_0x55528b[_0x384f('0x33')],_0x55528b[_0x384f('0x30')]);_0x237278[_0x384f('0x35')]=_['intersection'](_0x55528b[_0x384f('0x33')],qs['fields'](_0x398843[_0x384f('0x30')][_0x384f('0x34')]));_0x237278[_0x384f('0x35')]=_0x237278[_0x384f('0x35')][_0x384f('0x36')]?_0x237278[_0x384f('0x35')]:_0x55528b['model'];_0x237278[_0x384f('0x39')]=qs[_0x384f('0x3a')](_0x398843[_0x384f('0x30')]['sort']);_0x237278['where']=qs['filters'](_[_0x384f('0x3c')](_0x398843['query'],_0x55528b[_0x384f('0x31')]));if(_0x398843[_0x384f('0x30')][_0x384f('0x3d')]){_0x237278[_0x384f('0x3b')]=_[_0x384f('0x3f')](_0x237278[_0x384f('0x3b')],{'$or':_[_0x384f('0x2a')](_0x237278[_0x384f('0x35')],function(_0x2d0301){var _0x526561={};_0x526561[_0x2d0301]={'$like':'%'+_0x398843[_0x384f('0x30')]['filter']+'%'};return _0x526561;})});}_0x237278=_[_0x384f('0x3f')]({},_0x237278,_0x398843[_0x384f('0x40')]);return _0x2b843b[_0x384f('0x4f')](_0x237278);}})[_0x384f('0x23')](function(_0xbcd0fe){if(_0xbcd0fe){_0x1b57fe=_0xbcd0fe[_0x384f('0x36')];if(!_0x398843['query']['hasOwnProperty'](_0x384f('0x38'))){_0x237278[_0x384f('0x18')]=qs[_0x384f('0x18')](_0x398843['query']['limit']);_0x237278[_0x384f('0x17')]=qs[_0x384f('0x17')](_0x398843[_0x384f('0x30')][_0x384f('0x17')]);}return _0x2b843b[_0x384f('0x4f')](_0x237278);}})[_0x384f('0x23')](function(_0x2f580d){if(_0x2f580d){return _0x2f580d?{'count':_0x1b57fe,'rows':_0x2f580d}:null;}})[_0x384f('0x23')](respondWithResult(_0x267ed3,null))[_0x384f('0x44')](handleError(_0x267ed3,null));}; \ No newline at end of file +var _0xad7d=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','attributes','intersection'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xad7d,0xb0));var _0xdad7=function(_0x1fdc10,_0x30bbab){_0x1fdc10=_0x1fdc10-0x0;var _0x3d6af2=_0xad7d[_0x1fdc10];return _0x3d6af2;};'use strict';var emlformat=require(_0xdad7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdad7('0x1'));var rp=require(_0xdad7('0x2'));var moment=require(_0xdad7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdad7('0x4'));var util=require(_0xdad7('0x5'));var path=require(_0xdad7('0x6'));var sox=require(_0xdad7('0x7'));var csv=require(_0xdad7('0x8'));var ejs=require(_0xdad7('0x9'));var fs=require('fs');var fs_extra=require(_0xdad7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdad7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdad7('0xc'));var Papa=require('papaparse');var Redis=require(_0xdad7('0xd'));var authService=require(_0xdad7('0xe'));var qs=require(_0xdad7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdad7('0x10'))(_0xdad7('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27b257,_0x3bf787){_0x3bf787=_0x3bf787||0xcc;return function(_0x26ee45){if(_0x26ee45){return _0x27b257[_0xdad7('0x12')](_0x3bf787);}return _0x27b257[_0xdad7('0x13')](_0x3bf787)[_0xdad7('0x14')]();};}function respondWithResult(_0x4c0c04,_0x1e64f8){_0x1e64f8=_0x1e64f8||0xc8;return function(_0x47a4fd){if(_0x47a4fd){return _0x4c0c04[_0xdad7('0x13')](_0x1e64f8)[_0xdad7('0x15')](_0x47a4fd);}};}function respondWithFilteredResult(_0x13db3f,_0x49d13f){return function(_0x57416c){if(_0x57416c){var _0x33d47d=typeof _0x49d13f[_0xdad7('0x16')]===_0xdad7('0x17')&&typeof _0x49d13f['limit']==='undefined';var _0x263fa2=_0x57416c[_0xdad7('0x18')];var _0x5178f3=_0x33d47d?0x0:_0x49d13f[_0xdad7('0x16')];var _0x5d3843=_0x33d47d?_0x57416c['count']:_0x49d13f[_0xdad7('0x16')]+_0x49d13f[_0xdad7('0x19')];var _0xa53e80;if(_0x5d3843>=_0x263fa2){_0x5d3843=_0x263fa2;_0xa53e80=0xc8;}else{_0xa53e80=0xce;}_0x13db3f[_0xdad7('0x13')](_0xa53e80);return _0x13db3f['set'](_0xdad7('0x1a'),_0x5178f3+'-'+_0x5d3843+'/'+_0x263fa2)[_0xdad7('0x15')](_0x57416c);}return null;};}function patchUpdates(_0x121dd6){return function(_0x121115){try{jsonpatch[_0xdad7('0x1b')](_0x121115,_0x121dd6,!![]);}catch(_0x4a068e){return BPromise[_0xdad7('0x1c')](_0x4a068e);}return _0x121115['save']();};}function saveUpdates(_0x44ee01,_0x11cf34){return function(_0x5876f2){if(_0x5876f2){return _0x5876f2[_0xdad7('0x1d')](_0x44ee01)[_0xdad7('0x1e')](function(_0x2cc03e){return _0x2cc03e;});}return null;};}function removeEntity(_0x40f1fd,_0x4fbfe1){return function(_0x41d8ce){if(_0x41d8ce){return _0x41d8ce['destroy']()[_0xdad7('0x1e')](function(){_0x40f1fd[_0xdad7('0x13')](0xcc)[_0xdad7('0x14')]();});}};}function handleEntityNotFound(_0x5debea,_0x46649a){return function(_0x2444e5){if(!_0x2444e5){_0x5debea['sendStatus'](0x194);}return _0x2444e5;};}function handleError(_0x5c5c39,_0x58e0e1){_0x58e0e1=_0x58e0e1||0x1f4;return function(_0x4c7500){logger['error'](_0x4c7500[_0xdad7('0x1f')]);if(_0x4c7500[_0xdad7('0x20')]){delete _0x4c7500[_0xdad7('0x20')];}_0x5c5c39[_0xdad7('0x13')](_0x58e0e1)[_0xdad7('0x21')](_0x4c7500);};}exports['index']=function(_0x57637c,_0x2e31b9){var _0x28d442={},_0x2f6bbb={},_0x123b8a={'count':0x0,'rows':[]};var _0x5ac7af=_[_0xdad7('0x22')](db[_0xdad7('0x23')][_0xdad7('0x24')],function(_0x5e48f9){return{'name':_0x5e48f9[_0xdad7('0x25')],'type':_0x5e48f9[_0xdad7('0x26')][_0xdad7('0x27')]};});_0x2f6bbb['model']=_['map'](_0x5ac7af,'name');_0x2f6bbb[_0xdad7('0x28')]=_['keys'](_0x57637c[_0xdad7('0x28')]);_0x2f6bbb['filters']=_['intersection'](_0x2f6bbb['model'],_0x2f6bbb['query']);_0x28d442[_0xdad7('0x29')]=_[_0xdad7('0x2a')](_0x2f6bbb[_0xdad7('0x2b')],qs[_0xdad7('0x2c')](_0x57637c[_0xdad7('0x28')]['fields']));_0x28d442[_0xdad7('0x29')]=_0x28d442[_0xdad7('0x29')][_0xdad7('0x2d')]?_0x28d442[_0xdad7('0x29')]:_0x2f6bbb[_0xdad7('0x2b')];if(!_0x57637c[_0xdad7('0x28')][_0xdad7('0x2e')](_0xdad7('0x2f'))){_0x28d442[_0xdad7('0x19')]=qs[_0xdad7('0x19')](_0x57637c[_0xdad7('0x28')][_0xdad7('0x19')]);_0x28d442[_0xdad7('0x16')]=qs['offset'](_0x57637c[_0xdad7('0x28')]['offset']);}_0x28d442[_0xdad7('0x30')]=qs[_0xdad7('0x31')](_0x57637c[_0xdad7('0x28')][_0xdad7('0x31')]);_0x28d442[_0xdad7('0x32')]=qs['filters'](_[_0xdad7('0x33')](_0x57637c[_0xdad7('0x28')],_0x2f6bbb[_0xdad7('0x34')]),_0x5ac7af);if(_0x57637c[_0xdad7('0x28')][_0xdad7('0x35')]){_0x28d442[_0xdad7('0x32')]=_[_0xdad7('0x36')](_0x28d442[_0xdad7('0x32')],{'$or':_[_0xdad7('0x22')](_0x5ac7af,function(_0x34b32f){if(_0x34b32f[_0xdad7('0x26')]!==_0xdad7('0x37')){var _0x5152cb={};_0x5152cb[_0x34b32f[_0xdad7('0x20')]]={'$like':'%'+_0x57637c[_0xdad7('0x28')][_0xdad7('0x35')]+'%'};return _0x5152cb;}})});}_0x28d442=_['merge']({},_0x28d442,_0x57637c[_0xdad7('0x38')]);var _0x576339={'where':_0x28d442[_0xdad7('0x32')]};return db['Dynamics365Configuration']['count'](_0x576339)['then'](function(_0x106878){_0x123b8a[_0xdad7('0x18')]=_0x106878;if(_0x57637c[_0xdad7('0x28')][_0xdad7('0x39')]){_0x28d442[_0xdad7('0x3a')]=[{'all':!![]}];}return db[_0xdad7('0x23')][_0xdad7('0x3b')](_0x28d442);})[_0xdad7('0x1e')](function(_0xf638a5){_0x123b8a[_0xdad7('0x3c')]=_0xf638a5;return _0x123b8a;})[_0xdad7('0x1e')](respondWithFilteredResult(_0x2e31b9,_0x28d442))[_0xdad7('0x3d')](handleError(_0x2e31b9,null));};exports[_0xdad7('0x3e')]=function(_0x425dcf,_0x17a390){var _0x41eee6={'raw':![],'where':{'id':_0x425dcf[_0xdad7('0x3f')]['id']}},_0xefc6e8={};_0xefc6e8[_0xdad7('0x2b')]=_[_0xdad7('0x40')](db['Dynamics365Configuration'][_0xdad7('0x24')]);_0xefc6e8['query']=_['keys'](_0x425dcf[_0xdad7('0x28')]);_0xefc6e8[_0xdad7('0x34')]=_[_0xdad7('0x2a')](_0xefc6e8[_0xdad7('0x2b')],_0xefc6e8[_0xdad7('0x28')]);_0x41eee6[_0xdad7('0x29')]=_[_0xdad7('0x2a')](_0xefc6e8[_0xdad7('0x2b')],qs['fields'](_0x425dcf[_0xdad7('0x28')][_0xdad7('0x2c')]));_0x41eee6[_0xdad7('0x29')]=_0x41eee6[_0xdad7('0x29')][_0xdad7('0x2d')]?_0x41eee6['attributes']:_0xefc6e8[_0xdad7('0x2b')];if(_0x425dcf[_0xdad7('0x28')][_0xdad7('0x39')]){_0x41eee6[_0xdad7('0x3a')]=[{'all':!![]}];}_0x41eee6=_[_0xdad7('0x36')]({},_0x41eee6,_0x425dcf[_0xdad7('0x38')]);return db[_0xdad7('0x23')][_0xdad7('0x41')](_0x41eee6)[_0xdad7('0x1e')](handleEntityNotFound(_0x17a390,null))[_0xdad7('0x1e')](respondWithResult(_0x17a390,null))[_0xdad7('0x3d')](handleError(_0x17a390,null));};exports[_0xdad7('0x42')]=function(_0x163845,_0x3adfc4){return db['Dynamics365Configuration'][_0xdad7('0x42')](_0x163845[_0xdad7('0x43')],{})[_0xdad7('0x1e')](respondWithResult(_0x3adfc4,0xc9))[_0xdad7('0x3d')](handleError(_0x3adfc4,null));};exports[_0xdad7('0x1d')]=function(_0x3854a2,_0x42b90b){if(_0x3854a2['body']['id']){delete _0x3854a2['body']['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x3854a2[_0xdad7('0x3f')]['id']}})[_0xdad7('0x1e')](handleEntityNotFound(_0x42b90b,null))[_0xdad7('0x1e')](saveUpdates(_0x3854a2[_0xdad7('0x43')],null))[_0xdad7('0x1e')](respondWithResult(_0x42b90b,null))[_0xdad7('0x3d')](handleError(_0x42b90b,null));};exports['destroy']=function(_0x3c0094,_0x1db209){return db[_0xdad7('0x23')]['find']({'where':{'id':_0x3c0094[_0xdad7('0x3f')]['id']}})[_0xdad7('0x1e')](handleEntityNotFound(_0x1db209,null))[_0xdad7('0x1e')](removeEntity(_0x1db209,null))['catch'](handleError(_0x1db209,null));};exports[_0xdad7('0x44')]=function(_0x2befa1,_0x3f1c33,_0x930a00){var _0x337ea9={};var _0xab1a5b={};var _0x11aedc;var _0x1692f2;return db[_0xdad7('0x23')][_0xdad7('0x45')]({'where':{'id':_0x2befa1[_0xdad7('0x3f')]['id']}})[_0xdad7('0x1e')](handleEntityNotFound(_0x3f1c33,null))[_0xdad7('0x1e')](function(_0x2f4c5b){if(_0x2f4c5b){_0x11aedc=_0x2f4c5b;_0xab1a5b[_0xdad7('0x2b')]=_[_0xdad7('0x40')](db['Dynamics365Field'][_0xdad7('0x24')]);_0xab1a5b[_0xdad7('0x28')]=_['keys'](_0x2befa1['query']);_0xab1a5b['filters']=_[_0xdad7('0x2a')](_0xab1a5b['model'],_0xab1a5b[_0xdad7('0x28')]);_0x337ea9[_0xdad7('0x29')]=_[_0xdad7('0x2a')](_0xab1a5b[_0xdad7('0x2b')],qs['fields'](_0x2befa1[_0xdad7('0x28')][_0xdad7('0x2c')]));_0x337ea9[_0xdad7('0x29')]=_0x337ea9[_0xdad7('0x29')][_0xdad7('0x2d')]?_0x337ea9[_0xdad7('0x29')]:_0xab1a5b['model'];_0x337ea9[_0xdad7('0x30')]=qs[_0xdad7('0x31')](_0x2befa1[_0xdad7('0x28')]['sort']);_0x337ea9[_0xdad7('0x32')]=qs[_0xdad7('0x34')](_[_0xdad7('0x33')](_0x2befa1[_0xdad7('0x28')],_0xab1a5b[_0xdad7('0x34')]));if(_0x2befa1[_0xdad7('0x28')][_0xdad7('0x35')]){_0x337ea9['where']=_[_0xdad7('0x36')](_0x337ea9[_0xdad7('0x32')],{'$or':_['map'](_0x337ea9[_0xdad7('0x29')],function(_0x12d344){var _0x17faaa={};_0x17faaa[_0x12d344]={'$like':'%'+_0x2befa1[_0xdad7('0x28')]['filter']+'%'};return _0x17faaa;})});}_0x337ea9=_[_0xdad7('0x36')]({},_0x337ea9,_0x2befa1[_0xdad7('0x38')]);return _0x11aedc['getFields'](_0x337ea9);}})[_0xdad7('0x1e')](function(_0x296a85){if(_0x296a85){_0x1692f2=_0x296a85[_0xdad7('0x2d')];if(!_0x2befa1['query']['hasOwnProperty'](_0xdad7('0x2f'))){_0x337ea9[_0xdad7('0x19')]=qs['limit'](_0x2befa1[_0xdad7('0x28')]['limit']);_0x337ea9[_0xdad7('0x16')]=qs[_0xdad7('0x16')](_0x2befa1[_0xdad7('0x28')][_0xdad7('0x16')]);}return _0x11aedc['getFields'](_0x337ea9);}})['then'](function(_0x27ef58){if(_0x27ef58){return _0x27ef58?{'count':_0x1692f2,'rows':_0x27ef58}:null;}})[_0xdad7('0x1e')](respondWithResult(_0x3f1c33,null))[_0xdad7('0x3d')](handleError(_0x3f1c33,null));};exports['getSubjects']=function(_0x4509d4,_0x3add3d,_0x390e70){var _0x376ed6={};var _0xc8653c={};var _0x5e9ac4;var _0x5ad642;return db[_0xdad7('0x23')][_0xdad7('0x45')]({'where':{'id':_0x4509d4['params']['id']}})['then'](handleEntityNotFound(_0x3add3d,null))[_0xdad7('0x1e')](function(_0x248cff){if(_0x248cff){_0x5e9ac4=_0x248cff;_0xc8653c['model']=_[_0xdad7('0x40')](db[_0xdad7('0x46')][_0xdad7('0x24')]);_0xc8653c[_0xdad7('0x28')]=_[_0xdad7('0x40')](_0x4509d4[_0xdad7('0x28')]);_0xc8653c[_0xdad7('0x34')]=_[_0xdad7('0x2a')](_0xc8653c[_0xdad7('0x2b')],_0xc8653c[_0xdad7('0x28')]);_0x376ed6['attributes']=_[_0xdad7('0x2a')](_0xc8653c['model'],qs['fields'](_0x4509d4[_0xdad7('0x28')][_0xdad7('0x2c')]));_0x376ed6[_0xdad7('0x29')]=_0x376ed6['attributes'][_0xdad7('0x2d')]?_0x376ed6[_0xdad7('0x29')]:_0xc8653c[_0xdad7('0x2b')];_0x376ed6['order']=qs[_0xdad7('0x31')](_0x4509d4[_0xdad7('0x28')]['sort']);_0x376ed6[_0xdad7('0x32')]=qs[_0xdad7('0x34')](_['pick'](_0x4509d4[_0xdad7('0x28')],_0xc8653c[_0xdad7('0x34')]));if(_0x4509d4[_0xdad7('0x28')][_0xdad7('0x35')]){_0x376ed6[_0xdad7('0x32')]=_[_0xdad7('0x36')](_0x376ed6[_0xdad7('0x32')],{'$or':_[_0xdad7('0x22')](_0x376ed6['attributes'],function(_0x4a11e5){var _0x158cac={};_0x158cac[_0x4a11e5]={'$like':'%'+_0x4509d4['query'][_0xdad7('0x35')]+'%'};return _0x158cac;})});}_0x376ed6=_[_0xdad7('0x36')]({},_0x376ed6,_0x4509d4[_0xdad7('0x38')]);return _0x5e9ac4[_0xdad7('0x47')](_0x376ed6);}})['then'](function(_0x40b2de){if(_0x40b2de){_0x5ad642=_0x40b2de[_0xdad7('0x2d')];if(!_0x4509d4[_0xdad7('0x28')]['hasOwnProperty']('nolimit')){_0x376ed6['limit']=qs[_0xdad7('0x19')](_0x4509d4[_0xdad7('0x28')][_0xdad7('0x19')]);_0x376ed6['offset']=qs[_0xdad7('0x16')](_0x4509d4[_0xdad7('0x28')][_0xdad7('0x16')]);}return _0x5e9ac4[_0xdad7('0x47')](_0x376ed6);}})[_0xdad7('0x1e')](function(_0x3e9ca9){if(_0x3e9ca9){return _0x3e9ca9?{'count':_0x5ad642,'rows':_0x3e9ca9}:null;}})[_0xdad7('0x1e')](respondWithResult(_0x3add3d,null))['catch'](handleError(_0x3add3d,null));};exports[_0xdad7('0x48')]=function(_0x267e3d,_0x4297f2,_0x204718){var _0x3657b2={};var _0x17cc08={};var _0x5178d0;var _0x64ead6;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x267e3d[_0xdad7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4297f2,null))[_0xdad7('0x1e')](function(_0x56a67b){if(_0x56a67b){_0x5178d0=_0x56a67b;_0x17cc08[_0xdad7('0x2b')]=_[_0xdad7('0x40')](db[_0xdad7('0x46')][_0xdad7('0x24')]);_0x17cc08[_0xdad7('0x28')]=_[_0xdad7('0x40')](_0x267e3d['query']);_0x17cc08[_0xdad7('0x34')]=_['intersection'](_0x17cc08[_0xdad7('0x2b')],_0x17cc08[_0xdad7('0x28')]);_0x3657b2[_0xdad7('0x29')]=_[_0xdad7('0x2a')](_0x17cc08[_0xdad7('0x2b')],qs['fields'](_0x267e3d[_0xdad7('0x28')][_0xdad7('0x2c')]));_0x3657b2['attributes']=_0x3657b2['attributes']['length']?_0x3657b2['attributes']:_0x17cc08[_0xdad7('0x2b')];_0x3657b2[_0xdad7('0x30')]=qs[_0xdad7('0x31')](_0x267e3d[_0xdad7('0x28')][_0xdad7('0x31')]);_0x3657b2[_0xdad7('0x32')]=qs[_0xdad7('0x34')](_['pick'](_0x267e3d[_0xdad7('0x28')],_0x17cc08['filters']));if(_0x267e3d['query'][_0xdad7('0x35')]){_0x3657b2[_0xdad7('0x32')]=_[_0xdad7('0x36')](_0x3657b2[_0xdad7('0x32')],{'$or':_['map'](_0x3657b2[_0xdad7('0x29')],function(_0x52fe6d){var _0x4abd27={};_0x4abd27[_0x52fe6d]={'$like':'%'+_0x267e3d[_0xdad7('0x28')][_0xdad7('0x35')]+'%'};return _0x4abd27;})});}_0x3657b2=_[_0xdad7('0x36')]({},_0x3657b2,_0x267e3d['options']);return _0x5178d0[_0xdad7('0x48')](_0x3657b2);}})[_0xdad7('0x1e')](function(_0x37131b){if(_0x37131b){_0x64ead6=_0x37131b[_0xdad7('0x2d')];if(!_0x267e3d[_0xdad7('0x28')][_0xdad7('0x2e')](_0xdad7('0x2f'))){_0x3657b2[_0xdad7('0x19')]=qs[_0xdad7('0x19')](_0x267e3d[_0xdad7('0x28')]['limit']);_0x3657b2[_0xdad7('0x16')]=qs['offset'](_0x267e3d[_0xdad7('0x28')]['offset']);}return _0x5178d0[_0xdad7('0x48')](_0x3657b2);}})[_0xdad7('0x1e')](function(_0x448247){if(_0x448247){return _0x448247?{'count':_0x64ead6,'rows':_0x448247}:null;}})[_0xdad7('0x1e')](respondWithResult(_0x4297f2,null))[_0xdad7('0x3d')](handleError(_0x4297f2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index b3bc170..e5269ee 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x5735ce,_0x5812dd){var _0x489f3d=function(_0x22e096){while(--_0x22e096){_0x5735ce['push'](_0x5735ce['shift']());}};_0x489f3d(++_0x5812dd);}(_0x54ef,0x112));var _0xf54e=function(_0x85bf6a,_0x53da7b){_0x85bf6a=_0x85bf6a-0x0;var _0x44b6b8=_0x54ef[_0x85bf6a];return _0x44b6b8;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x4b84[_0x545b71];return _0x26e587;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','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 e3715e5..dfacab5 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 _0xa03d=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x59e363,_0x1a70d7){var _0x951f96=function(_0x19b960){while(--_0x19b960){_0x59e363['push'](_0x59e363['shift']());}};_0x951f96(++_0x1a70d7);}(_0xa03d,0x16d));var _0xda03=function(_0x19d2a0,_0x1539c4){_0x19d2a0=_0x19d2a0-0x0;var _0x4169de=_0xa03d[_0x19d2a0];return _0x4169de;};'use strict';var _=require(_0xda03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda03('0x1'));var fs=require('fs');var Redis=require(_0xda03('0x2'));var db=require(_0xda03('0x3'))['db'];var utils=require(_0xda03('0x4'));var logger=require('../../config/logger')(_0xda03('0x5'));var config=require(_0xda03('0x6'));var jayson=require(_0xda03('0x7'));var client=jayson[_0xda03('0x8')][_0xda03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c934,_0x4b8116,_0x568995){return new BPromise(function(_0x44aa0d,_0xe1b157){return client[_0xda03('0xa')](_0x28c934,_0x568995)[_0xda03('0xb')](function(_0xfaf867){logger[_0xda03('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4b8116,'request\x20sent');logger['debug'](_0xda03('0xd'),_0x4b8116,_0xda03('0xe'),JSON[_0xda03('0xf')](_0xfaf867));if(_0xfaf867[_0xda03('0x10')]){if(_0xfaf867[_0xda03('0x10')]['code']===0x1f4){logger[_0xda03('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4b8116,_0xfaf867[_0xda03('0x10')][_0xda03('0x11')]);return _0xe1b157(_0xfaf867['error']['message']);}logger['error'](_0xda03('0x12'),_0x4b8116,_0xfaf867['error'][_0xda03('0x11')]);return _0x44aa0d(_0xfaf867[_0xda03('0x10')][_0xda03('0x11')]);}else{logger['info'](_0xda03('0x12'),_0x4b8116,'request\x20sent');_0x44aa0d(_0xfaf867[_0xda03('0x13')][_0xda03('0x11')]);}})[_0xda03('0x14')](function(_0xa57054){logger['error'](_0xda03('0x12'),_0x4b8116,_0xa57054);_0xe1b157(_0xa57054);});});} \ No newline at end of file +var _0xabd2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x231f1f,_0x44a49e){var _0x34c001=function(_0x4b6178){while(--_0x4b6178){_0x231f1f['push'](_0x231f1f['shift']());}};_0x34c001(++_0x44a49e);}(_0xabd2,0x10f));var _0x2abd=function(_0x35c3f5,_0x3ba5c0){_0x35c3f5=_0x35c3f5-0x0;var _0x2c195d=_0xabd2[_0x35c3f5];return _0x2c195d;};'use strict';var _=require(_0x2abd('0x0'));var util=require(_0x2abd('0x1'));var moment=require('moment');var BPromise=require(_0x2abd('0x2'));var rs=require(_0x2abd('0x3'));var fs=require('fs');var Redis=require(_0x2abd('0x4'));var db=require(_0x2abd('0x5'))['db'];var utils=require(_0x2abd('0x6'));var logger=require(_0x2abd('0x7'))(_0x2abd('0x8'));var config=require(_0x2abd('0x9'));var jayson=require(_0x2abd('0xa'));var client=jayson[_0x2abd('0xb')][_0x2abd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b52ab,_0x3392ac,_0x39a369){return new BPromise(function(_0xc1915f,_0x34c253){return client[_0x2abd('0xd')](_0x4b52ab,_0x39a369)['then'](function(_0x438437){logger[_0x2abd('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3392ac,_0x2abd('0xf'));logger[_0x2abd('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3392ac,_0x2abd('0xf'),JSON[_0x2abd('0x11')](_0x438437));if(_0x438437[_0x2abd('0x12')]){if(_0x438437[_0x2abd('0x12')]['code']===0x1f4){logger[_0x2abd('0x12')](_0x2abd('0x13'),_0x3392ac,_0x438437['error'][_0x2abd('0x14')]);return _0x34c253(_0x438437[_0x2abd('0x12')][_0x2abd('0x14')]);}logger[_0x2abd('0x12')](_0x2abd('0x13'),_0x3392ac,_0x438437['error'][_0x2abd('0x14')]);return _0xc1915f(_0x438437[_0x2abd('0x12')]['message']);}else{logger[_0x2abd('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3392ac,_0x2abd('0xf'));_0xc1915f(_0x438437[_0x2abd('0x15')][_0x2abd('0x14')]);}})[_0x2abd('0x16')](function(_0xb382e4){logger[_0x2abd('0x12')](_0x2abd('0x13'),_0x3392ac,_0xb382e4);_0x34c253(_0xb382e4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 75bab94..9ebbe6e 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 _0x827b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x379541,_0x36cc71){var _0x3d1093=function(_0xa9df1f){while(--_0xa9df1f){_0x379541['push'](_0x379541['shift']());}};_0x3d1093(++_0x36cc71);}(_0x827b,0x128));var _0xb827=function(_0x50098a,_0x47cb2b){_0x50098a=_0x50098a-0x0;var _0x4d03c4=_0x827b[_0x50098a];return _0x4d03c4;};'use strict';var multer=require(_0xb827('0x0'));var util=require(_0xb827('0x1'));var path=require(_0xb827('0x2'));var timeout=require(_0xb827('0x3'));var express=require(_0xb827('0x4'));var router=express['Router']();var fs_extra=require(_0xb827('0x5'));var auth=require(_0xb827('0x6'));var interaction=require(_0xb827('0x7'));var config=require('../../config/environment');var controller=require(_0xb827('0x8'));router['get']('/',auth[_0xb827('0x9')](),controller[_0xb827('0xa')]);router[_0xb827('0xb')](_0xb827('0xc'),auth[_0xb827('0x9')](),controller[_0xb827('0xd')]);router[_0xb827('0xe')]('/',auth[_0xb827('0x9')](),controller[_0xb827('0xf')]);router[_0xb827('0x10')]('/:id',auth[_0xb827('0x9')](),controller[_0xb827('0x11')]);router['delete']('/:id',auth[_0xb827('0x9')](),controller[_0xb827('0x12')]);module[_0xb827('0x13')]=router; \ No newline at end of file +var _0x0b56=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../config/environment'];(function(_0x57f510,_0x569f42){var _0x1a56a3=function(_0x53cd81){while(--_0x53cd81){_0x57f510['push'](_0x57f510['shift']());}};_0x1a56a3(++_0x569f42);}(_0x0b56,0xfa));var _0x60b5=function(_0x423bd3,_0x53c6c7){_0x423bd3=_0x423bd3-0x0;var _0x9ad0d1=_0x0b56[_0x423bd3];return _0x9ad0d1;};'use strict';var multer=require(_0x60b5('0x0'));var util=require(_0x60b5('0x1'));var path=require(_0x60b5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x60b5('0x3')]();var fs_extra=require(_0x60b5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x60b5('0x5'));var controller=require(_0x60b5('0x6'));router[_0x60b5('0x7')]('/',auth[_0x60b5('0x8')](),controller[_0x60b5('0x9')]);router[_0x60b5('0x7')](_0x60b5('0xa'),auth[_0x60b5('0x8')](),controller['show']);router['post']('/',auth[_0x60b5('0x8')](),controller[_0x60b5('0xb')]);router[_0x60b5('0xc')](_0x60b5('0xa'),auth[_0x60b5('0x8')](),controller['update']);router[_0x60b5('0xd')](_0x60b5('0xa'),auth[_0x60b5('0x8')](),controller[_0x60b5('0xe')]);module[_0x60b5('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index bcac696..b6663a6 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 _0x0d7a=['string','STRING','ENUM','BOOLEAN','variable','customVariable','keyValue','picklist'];(function(_0xfa7afd,_0x1bfb0d){var _0x23d4b8=function(_0x330586){while(--_0x330586){_0xfa7afd['push'](_0xfa7afd['shift']());}};_0x23d4b8(++_0x1bfb0d);}(_0x0d7a,0x1cc));var _0xa0d7=function(_0x46e0d0,_0x5a5827){_0x46e0d0=_0x46e0d0-0x0;var _0x33e962=_0x0d7a[_0x46e0d0];return _0x33e962;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xa0d7('0x0'),_0xa0d7('0x1'),_0xa0d7('0x2'),_0xa0d7('0x3')),'defaultValue':_0xa0d7('0x4')},'content':{'type':Sequelize[_0xa0d7('0x5')]},'key':{'type':Sequelize[_0xa0d7('0x5')]},'keyType':{'type':Sequelize[_0xa0d7('0x6')](_0xa0d7('0x4'),_0xa0d7('0x0'),_0xa0d7('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa0d7('0x5')]},'nameField':{'type':Sequelize[_0xa0d7('0x5')]},'customField':{'type':Sequelize[_0xa0d7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa0d7('0x5')]}}; \ No newline at end of file +var _0xf567=['variable','keyValue','picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x531219,_0x4dd9ac){var _0x57e2b3=function(_0x3b84c1){while(--_0x3b84c1){_0x531219['push'](_0x531219['shift']());}};_0x57e2b3(++_0x4dd9ac);}(_0xf567,0x152));var _0x7f56=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf567[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x7f56('0x0'));module[_0x7f56('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7f56('0x2'),'customVariable',_0x7f56('0x3'),_0x7f56('0x4')),'defaultValue':_0x7f56('0x5')},'content':{'type':Sequelize[_0x7f56('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7f56('0x7')]('string','variable',_0x7f56('0x8'))},'keyContent':{'type':Sequelize[_0x7f56('0x6')]},'idField':{'type':Sequelize[_0x7f56('0x6')]},'nameField':{'type':Sequelize[_0x7f56('0x6')]},'customField':{'type':Sequelize[_0x7f56('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f56('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 175c318..abff083 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 _0xbba5=['update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','Dynamics365Field','findAll','rows','catch','show','keys','includeAll','include','options','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1da954,_0x14a7da){var _0x5365ec=function(_0x2f4585){while(--_0x2f4585){_0x1da954['push'](_0x1da954['shift']());}};_0x5365ec(++_0x14a7da);}(_0xbba5,0x75));var _0x5bba=function(_0x1be991,_0x2fc440){_0x1be991=_0x1be991-0x0;var _0x2c4575=_0xbba5[_0x1be991];return _0x2c4575;};'use strict';var emlformat=require(_0x5bba('0x0'));var rimraf=require(_0x5bba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bba('0x2'));var rp=require(_0x5bba('0x3'));var moment=require(_0x5bba('0x4'));var BPromise=require(_0x5bba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5bba('0x6'));var sox=require(_0x5bba('0x7'));var csv=require(_0x5bba('0x8'));var ejs=require(_0x5bba('0x9'));var fs=require('fs');var fs_extra=require(_0x5bba('0xa'));var _=require(_0x5bba('0xb'));var squel=require(_0x5bba('0xc'));var crypto=require(_0x5bba('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5bba('0xe'));var toCsv=require(_0x5bba('0x8'));var querystring=require('querystring');var Papa=require(_0x5bba('0xf'));var Redis=require(_0x5bba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5bba('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bba('0x12'));var logger=require('../../config/logger')(_0x5bba('0x13'));var utils=require(_0x5bba('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe25746,_0x24a15d){_0x24a15d=_0x24a15d||0xcc;return function(_0x5e9ee6){if(_0x5e9ee6){return _0xe25746[_0x5bba('0x15')](_0x24a15d);}return _0xe25746[_0x5bba('0x16')](_0x24a15d)[_0x5bba('0x17')]();};}function respondWithResult(_0x28d0d5,_0x3be700){_0x3be700=_0x3be700||0xc8;return function(_0x2c37b5){if(_0x2c37b5){return _0x28d0d5[_0x5bba('0x16')](_0x3be700)[_0x5bba('0x18')](_0x2c37b5);}};}function respondWithFilteredResult(_0x5acb04,_0x1e7e24){return function(_0x53c9d7){if(_0x53c9d7){var _0x3de19e=typeof _0x1e7e24[_0x5bba('0x19')]===_0x5bba('0x1a')&&typeof _0x1e7e24[_0x5bba('0x1b')]==='undefined';var _0x14e982=_0x53c9d7[_0x5bba('0x1c')];var _0x140756=_0x3de19e?0x0:_0x1e7e24[_0x5bba('0x19')];var _0x59a4da=_0x3de19e?_0x53c9d7[_0x5bba('0x1c')]:_0x1e7e24[_0x5bba('0x19')]+_0x1e7e24['limit'];var _0x36fb85;if(_0x59a4da>=_0x14e982){_0x59a4da=_0x14e982;_0x36fb85=0xc8;}else{_0x36fb85=0xce;}_0x5acb04['status'](_0x36fb85);return _0x5acb04[_0x5bba('0x1d')](_0x5bba('0x1e'),_0x140756+'-'+_0x59a4da+'/'+_0x14e982)[_0x5bba('0x18')](_0x53c9d7);}return null;};}function patchUpdates(_0x674215){return function(_0x6ea189){try{jsonpatch[_0x5bba('0x1f')](_0x6ea189,_0x674215,!![]);}catch(_0x3eb126){return BPromise[_0x5bba('0x20')](_0x3eb126);}return _0x6ea189['save']();};}function saveUpdates(_0x1879c9,_0xf304fa){return function(_0x3399ca){if(_0x3399ca){return _0x3399ca[_0x5bba('0x21')](_0x1879c9)[_0x5bba('0x22')](function(_0x4be4a1){return _0x4be4a1;});}return null;};}function removeEntity(_0x25f6fd,_0x3ceb3f){return function(_0x1e7428){if(_0x1e7428){return _0x1e7428[_0x5bba('0x23')]()['then'](function(){_0x25f6fd[_0x5bba('0x16')](0xcc)[_0x5bba('0x17')]();});}};}function handleEntityNotFound(_0x13b397,_0x3afcc4){return function(_0x4c264c){if(!_0x4c264c){_0x13b397['sendStatus'](0x194);}return _0x4c264c;};}function handleError(_0xc4a378,_0x5f3442){_0x5f3442=_0x5f3442||0x1f4;return function(_0x3cb73d){logger[_0x5bba('0x24')](_0x3cb73d[_0x5bba('0x25')]);if(_0x3cb73d[_0x5bba('0x26')]){delete _0x3cb73d['name'];}_0xc4a378['status'](_0x5f3442)[_0x5bba('0x27')](_0x3cb73d);};}exports[_0x5bba('0x28')]=function(_0x3386d5,_0x11aa52){var _0x5689cb={},_0x5ad4f6={},_0x156594={'count':0x0,'rows':[]};var _0x2a1671=_['map'](db['Dynamics365Field'][_0x5bba('0x29')],function(_0x215397){return{'name':_0x215397[_0x5bba('0x2a')],'type':_0x215397[_0x5bba('0x2b')][_0x5bba('0x2c')]};});_0x5ad4f6['model']=_[_0x5bba('0x2d')](_0x2a1671,_0x5bba('0x26'));_0x5ad4f6['query']=_['keys'](_0x3386d5[_0x5bba('0x2e')]);_0x5ad4f6['filters']=_[_0x5bba('0x2f')](_0x5ad4f6['model'],_0x5ad4f6[_0x5bba('0x2e')]);_0x5689cb[_0x5bba('0x30')]=_[_0x5bba('0x2f')](_0x5ad4f6[_0x5bba('0x31')],qs[_0x5bba('0x32')](_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x32')]));_0x5689cb[_0x5bba('0x30')]=_0x5689cb[_0x5bba('0x30')][_0x5bba('0x33')]?_0x5689cb[_0x5bba('0x30')]:_0x5ad4f6[_0x5bba('0x31')];if(!_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x34')](_0x5bba('0x35'))){_0x5689cb[_0x5bba('0x1b')]=qs[_0x5bba('0x1b')](_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x1b')]);_0x5689cb[_0x5bba('0x19')]=qs[_0x5bba('0x19')](_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x19')]);}_0x5689cb[_0x5bba('0x36')]=qs[_0x5bba('0x37')](_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x37')]);_0x5689cb[_0x5bba('0x38')]=qs[_0x5bba('0x39')](_[_0x5bba('0x3a')](_0x3386d5[_0x5bba('0x2e')],_0x5ad4f6[_0x5bba('0x39')]),_0x2a1671);if(_0x3386d5[_0x5bba('0x2e')][_0x5bba('0x3b')]){_0x5689cb[_0x5bba('0x38')]=_[_0x5bba('0x3c')](_0x5689cb[_0x5bba('0x38')],{'$or':_['map'](_0x2a1671,function(_0x346c4a){if(_0x346c4a[_0x5bba('0x2b')]!==_0x5bba('0x3d')){var _0x10834d={};_0x10834d[_0x346c4a[_0x5bba('0x26')]]={'$like':'%'+_0x3386d5['query'][_0x5bba('0x3b')]+'%'};return _0x10834d;}})});}_0x5689cb=_[_0x5bba('0x3c')]({},_0x5689cb,_0x3386d5['options']);var _0x16f2c9={'where':_0x5689cb[_0x5bba('0x38')]};return db[_0x5bba('0x3e')][_0x5bba('0x1c')](_0x16f2c9)[_0x5bba('0x22')](function(_0x5dd4fe){_0x156594[_0x5bba('0x1c')]=_0x5dd4fe;if(_0x3386d5['query']['includeAll']){_0x5689cb['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x5bba('0x3f')](_0x5689cb);})[_0x5bba('0x22')](function(_0x4f2082){_0x156594[_0x5bba('0x40')]=_0x4f2082;return _0x156594;})[_0x5bba('0x22')](respondWithFilteredResult(_0x11aa52,_0x5689cb))[_0x5bba('0x41')](handleError(_0x11aa52,null));};exports[_0x5bba('0x42')]=function(_0x582581,_0x2ac7f0){var _0xf90dff={'raw':!![],'where':{'id':_0x582581['params']['id']}},_0x492139={};_0x492139['model']=_[_0x5bba('0x43')](db[_0x5bba('0x3e')][_0x5bba('0x29')]);_0x492139[_0x5bba('0x2e')]=_[_0x5bba('0x43')](_0x582581[_0x5bba('0x2e')]);_0x492139['filters']=_['intersection'](_0x492139['model'],_0x492139[_0x5bba('0x2e')]);_0xf90dff[_0x5bba('0x30')]=_[_0x5bba('0x2f')](_0x492139['model'],qs['fields'](_0x582581['query']['fields']));_0xf90dff[_0x5bba('0x30')]=_0xf90dff[_0x5bba('0x30')]['length']?_0xf90dff['attributes']:_0x492139['model'];if(_0x582581[_0x5bba('0x2e')][_0x5bba('0x44')]){_0xf90dff[_0x5bba('0x45')]=[{'all':!![]}];}_0xf90dff=_[_0x5bba('0x3c')]({},_0xf90dff,_0x582581[_0x5bba('0x46')]);return db[_0x5bba('0x3e')]['find'](_0xf90dff)['then'](handleEntityNotFound(_0x2ac7f0,null))[_0x5bba('0x22')](respondWithResult(_0x2ac7f0,null))[_0x5bba('0x41')](handleError(_0x2ac7f0,null));};exports[_0x5bba('0x47')]=function(_0x501e08,_0xf8dd51){return db['Dynamics365Field']['create'](_0x501e08['body'],{})[_0x5bba('0x22')](respondWithResult(_0xf8dd51,0xc9))['catch'](handleError(_0xf8dd51,null));};exports[_0x5bba('0x21')]=function(_0x2bb4ad,_0x58fe3b){if(_0x2bb4ad[_0x5bba('0x48')]['id']){delete _0x2bb4ad['body']['id'];}return db['Dynamics365Field'][_0x5bba('0x49')]({'where':{'id':_0x2bb4ad[_0x5bba('0x4a')]['id']}})[_0x5bba('0x22')](handleEntityNotFound(_0x58fe3b,null))[_0x5bba('0x22')](saveUpdates(_0x2bb4ad[_0x5bba('0x48')],null))['then'](respondWithResult(_0x58fe3b,null))[_0x5bba('0x41')](handleError(_0x58fe3b,null));};exports['destroy']=function(_0x358346,_0x4edb24){return db[_0x5bba('0x3e')][_0x5bba('0x49')]({'where':{'id':_0x358346[_0x5bba('0x4a')]['id']}})[_0x5bba('0x22')](handleEntityNotFound(_0x4edb24,null))[_0x5bba('0x22')](removeEntity(_0x4edb24,null))['catch'](handleError(_0x4edb24,null));}; \ No newline at end of file +var _0xa833=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','name','query','filters','intersection'];(function(_0x2bb398,_0xd7c0dc){var _0x4dfefc=function(_0x20b088){while(--_0x20b088){_0x2bb398['push'](_0x2bb398['shift']());}};_0x4dfefc(++_0xd7c0dc);}(_0xa833,0x1da));var _0x3a83=function(_0x4fd7e7,_0x29ad7e){_0x4fd7e7=_0x4fd7e7-0x0;var _0x430b8c=_0xa833[_0x4fd7e7];return _0x430b8c;};'use strict';var emlformat=require(_0x3a83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a83('0x1'));var jsonpatch=require(_0x3a83('0x2'));var rp=require(_0x3a83('0x3'));var moment=require('moment');var BPromise=require(_0x3a83('0x4'));var Mustache=require(_0x3a83('0x5'));var util=require(_0x3a83('0x6'));var path=require(_0x3a83('0x7'));var sox=require('sox');var csv=require(_0x3a83('0x8'));var ejs=require(_0x3a83('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a83('0xa'));var squel=require('squel');var crypto=require(_0x3a83('0xb'));var jsforce=require(_0x3a83('0xc'));var deskjs=require(_0x3a83('0xd'));var toCsv=require(_0x3a83('0x8'));var querystring=require(_0x3a83('0xe'));var Papa=require(_0x3a83('0xf'));var Redis=require(_0x3a83('0x10'));var authService=require(_0x3a83('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a83('0x12'));var hardwareService=require(_0x3a83('0x13'));var logger=require(_0x3a83('0x14'))(_0x3a83('0x15'));var utils=require(_0x3a83('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30f86d,_0x2a1f4a){_0x2a1f4a=_0x2a1f4a||0xcc;return function(_0x4fc638){if(_0x4fc638){return _0x30f86d[_0x3a83('0x17')](_0x2a1f4a);}return _0x30f86d['status'](_0x2a1f4a)['end']();};}function respondWithResult(_0x115c82,_0x43fab2){_0x43fab2=_0x43fab2||0xc8;return function(_0x986686){if(_0x986686){return _0x115c82['status'](_0x43fab2)[_0x3a83('0x18')](_0x986686);}};}function respondWithFilteredResult(_0x2eac56,_0x363434){return function(_0xc0eac3){if(_0xc0eac3){var _0x20b6f5=typeof _0x363434[_0x3a83('0x19')]===_0x3a83('0x1a')&&typeof _0x363434[_0x3a83('0x1b')]===_0x3a83('0x1a');var _0x29ffa5=_0xc0eac3[_0x3a83('0x1c')];var _0x1b6091=_0x20b6f5?0x0:_0x363434[_0x3a83('0x19')];var _0x43827c=_0x20b6f5?_0xc0eac3['count']:_0x363434[_0x3a83('0x19')]+_0x363434[_0x3a83('0x1b')];var _0x1d096b;if(_0x43827c>=_0x29ffa5){_0x43827c=_0x29ffa5;_0x1d096b=0xc8;}else{_0x1d096b=0xce;}_0x2eac56[_0x3a83('0x1d')](_0x1d096b);return _0x2eac56[_0x3a83('0x1e')]('Content-Range',_0x1b6091+'-'+_0x43827c+'/'+_0x29ffa5)[_0x3a83('0x18')](_0xc0eac3);}return null;};}function patchUpdates(_0x459e91){return function(_0x421b0b){try{jsonpatch[_0x3a83('0x1f')](_0x421b0b,_0x459e91,!![]);}catch(_0x255cf5){return BPromise[_0x3a83('0x20')](_0x255cf5);}return _0x421b0b[_0x3a83('0x21')]();};}function saveUpdates(_0x5095d1,_0x477536){return function(_0x403b69){if(_0x403b69){return _0x403b69[_0x3a83('0x22')](_0x5095d1)[_0x3a83('0x23')](function(_0x155cbd){return _0x155cbd;});}return null;};}function removeEntity(_0x46ea1c,_0x25439e){return function(_0x5bbeff){if(_0x5bbeff){return _0x5bbeff[_0x3a83('0x24')]()[_0x3a83('0x23')](function(){_0x46ea1c[_0x3a83('0x1d')](0xcc)[_0x3a83('0x25')]();});}};}function handleEntityNotFound(_0x338b97,_0x3fcee1){return function(_0x29e63b){if(!_0x29e63b){_0x338b97[_0x3a83('0x17')](0x194);}return _0x29e63b;};}function handleError(_0x1326b3,_0x3a349c){_0x3a349c=_0x3a349c||0x1f4;return function(_0x537de6){logger[_0x3a83('0x26')](_0x537de6[_0x3a83('0x27')]);if(_0x537de6['name']){delete _0x537de6['name'];}_0x1326b3[_0x3a83('0x1d')](_0x3a349c)[_0x3a83('0x28')](_0x537de6);};}exports[_0x3a83('0x29')]=function(_0x3b836b,_0xeea8e3){var _0x1177b8={},_0x3ebdfb={},_0xbd3c10={'count':0x0,'rows':[]};var _0x157438=_[_0x3a83('0x2a')](db[_0x3a83('0x2b')][_0x3a83('0x2c')],function(_0x32f1a6){return{'name':_0x32f1a6[_0x3a83('0x2d')],'type':_0x32f1a6['type']['key']};});_0x3ebdfb[_0x3a83('0x2e')]=_[_0x3a83('0x2a')](_0x157438,_0x3a83('0x2f'));_0x3ebdfb[_0x3a83('0x30')]=_['keys'](_0x3b836b[_0x3a83('0x30')]);_0x3ebdfb[_0x3a83('0x31')]=_[_0x3a83('0x32')](_0x3ebdfb[_0x3a83('0x2e')],_0x3ebdfb[_0x3a83('0x30')]);_0x1177b8[_0x3a83('0x33')]=_['intersection'](_0x3ebdfb[_0x3a83('0x2e')],qs[_0x3a83('0x34')](_0x3b836b[_0x3a83('0x30')][_0x3a83('0x34')]));_0x1177b8[_0x3a83('0x33')]=_0x1177b8[_0x3a83('0x33')][_0x3a83('0x35')]?_0x1177b8[_0x3a83('0x33')]:_0x3ebdfb[_0x3a83('0x2e')];if(!_0x3b836b['query'][_0x3a83('0x36')](_0x3a83('0x37'))){_0x1177b8['limit']=qs[_0x3a83('0x1b')](_0x3b836b[_0x3a83('0x30')][_0x3a83('0x1b')]);_0x1177b8[_0x3a83('0x19')]=qs[_0x3a83('0x19')](_0x3b836b['query'][_0x3a83('0x19')]);}_0x1177b8[_0x3a83('0x38')]=qs[_0x3a83('0x39')](_0x3b836b[_0x3a83('0x30')][_0x3a83('0x39')]);_0x1177b8[_0x3a83('0x3a')]=qs['filters'](_[_0x3a83('0x3b')](_0x3b836b[_0x3a83('0x30')],_0x3ebdfb[_0x3a83('0x31')]),_0x157438);if(_0x3b836b[_0x3a83('0x30')]['filter']){_0x1177b8[_0x3a83('0x3a')]=_[_0x3a83('0x3c')](_0x1177b8[_0x3a83('0x3a')],{'$or':_[_0x3a83('0x2a')](_0x157438,function(_0x4ffa65){if(_0x4ffa65[_0x3a83('0x3d')]!==_0x3a83('0x3e')){var _0x10cdad={};_0x10cdad[_0x4ffa65[_0x3a83('0x2f')]]={'$like':'%'+_0x3b836b['query'][_0x3a83('0x3f')]+'%'};return _0x10cdad;}})});}_0x1177b8=_[_0x3a83('0x3c')]({},_0x1177b8,_0x3b836b[_0x3a83('0x40')]);var _0x470efe={'where':_0x1177b8[_0x3a83('0x3a')]};return db[_0x3a83('0x2b')][_0x3a83('0x1c')](_0x470efe)[_0x3a83('0x23')](function(_0x14cdb5){_0xbd3c10[_0x3a83('0x1c')]=_0x14cdb5;if(_0x3b836b[_0x3a83('0x30')][_0x3a83('0x41')]){_0x1177b8[_0x3a83('0x42')]=[{'all':!![]}];}return db[_0x3a83('0x2b')][_0x3a83('0x43')](_0x1177b8);})['then'](function(_0x19411a){_0xbd3c10['rows']=_0x19411a;return _0xbd3c10;})['then'](respondWithFilteredResult(_0xeea8e3,_0x1177b8))['catch'](handleError(_0xeea8e3,null));};exports[_0x3a83('0x44')]=function(_0x55471f,_0x3b6892){var _0x16d703={'raw':!![],'where':{'id':_0x55471f[_0x3a83('0x45')]['id']}},_0x3d504b={};_0x3d504b[_0x3a83('0x2e')]=_[_0x3a83('0x46')](db[_0x3a83('0x2b')]['rawAttributes']);_0x3d504b['query']=_[_0x3a83('0x46')](_0x55471f[_0x3a83('0x30')]);_0x3d504b[_0x3a83('0x31')]=_[_0x3a83('0x32')](_0x3d504b[_0x3a83('0x2e')],_0x3d504b[_0x3a83('0x30')]);_0x16d703[_0x3a83('0x33')]=_[_0x3a83('0x32')](_0x3d504b['model'],qs[_0x3a83('0x34')](_0x55471f[_0x3a83('0x30')][_0x3a83('0x34')]));_0x16d703[_0x3a83('0x33')]=_0x16d703[_0x3a83('0x33')][_0x3a83('0x35')]?_0x16d703[_0x3a83('0x33')]:_0x3d504b['model'];if(_0x55471f[_0x3a83('0x30')][_0x3a83('0x41')]){_0x16d703['include']=[{'all':!![]}];}_0x16d703=_[_0x3a83('0x3c')]({},_0x16d703,_0x55471f['options']);return db[_0x3a83('0x2b')][_0x3a83('0x47')](_0x16d703)[_0x3a83('0x23')](handleEntityNotFound(_0x3b6892,null))[_0x3a83('0x23')](respondWithResult(_0x3b6892,null))[_0x3a83('0x48')](handleError(_0x3b6892,null));};exports['create']=function(_0x45dadb,_0x2d20a7){return db['Dynamics365Field'][_0x3a83('0x49')](_0x45dadb['body'],{})[_0x3a83('0x23')](respondWithResult(_0x2d20a7,0xc9))[_0x3a83('0x48')](handleError(_0x2d20a7,null));};exports[_0x3a83('0x22')]=function(_0x1a1e0b,_0x51fce9){if(_0x1a1e0b[_0x3a83('0x4a')]['id']){delete _0x1a1e0b[_0x3a83('0x4a')]['id'];}return db['Dynamics365Field'][_0x3a83('0x47')]({'where':{'id':_0x1a1e0b[_0x3a83('0x45')]['id']}})[_0x3a83('0x23')](handleEntityNotFound(_0x51fce9,null))[_0x3a83('0x23')](saveUpdates(_0x1a1e0b[_0x3a83('0x4a')],null))[_0x3a83('0x23')](respondWithResult(_0x51fce9,null))[_0x3a83('0x48')](handleError(_0x51fce9,null));};exports['destroy']=function(_0x46478f,_0x2de1cf){return db[_0x3a83('0x2b')][_0x3a83('0x47')]({'where':{'id':_0x46478f[_0x3a83('0x45')]['id']}})[_0x3a83('0x23')](handleEntityNotFound(_0x2de1cf,null))['then'](removeEntity(_0x2de1cf,null))[_0x3a83('0x48')](handleError(_0x2de1cf,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8f03c7a..97c00b3 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 _0x13ee=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util'];(function(_0x51de21,_0x2143bb){var _0x11e461=function(_0x1b17e8){while(--_0x1b17e8){_0x51de21['push'](_0x51de21['shift']());}};_0x11e461(++_0x2143bb);}(_0x13ee,0x148));var _0xe13e=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x13ee[_0x2074db];return _0x27324c;};'use strict';var _=require(_0xe13e('0x0'));var util=require(_0xe13e('0x1'));var logger=require(_0xe13e('0x2'))(_0xe13e('0x3'));var moment=require('moment');var BPromise=require(_0xe13e('0x4'));var rp=require(_0xe13e('0x5'));var fs=require('fs');var path=require(_0xe13e('0x6'));var rimraf=require(_0xe13e('0x7'));var config=require(_0xe13e('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xe13e('0x9')]=function(_0x238d9f,_0x479524){return _0x238d9f['define'](_0xe13e('0xa'),attributes,{'tableName':_0xe13e('0xb'),'paranoid':![],'indexes':[{'name':_0xe13e('0xc'),'fields':[_0xe13e('0xd'),_0xe13e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56ef=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x2e70e9,_0xa62fbc){var _0x2686ad=function(_0x3e7e06){while(--_0x3e7e06){_0x2e70e9['push'](_0x2e70e9['shift']());}};_0x2686ad(++_0xa62fbc);}(_0x56ef,0x7c));var _0xf56e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x56ef[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xf56e('0x0'));var util=require('util');var logger=require(_0xf56e('0x1'))(_0xf56e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf56e('0x3'));var fs=require('fs');var path=require(_0xf56e('0x4'));var rimraf=require('rimraf');var config=require(_0xf56e('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0xf56e('0x6')]=function(_0x5c7c4c,_0x123092){return _0x5c7c4c[_0xf56e('0x7')](_0xf56e('0x8'),attributes,{'tableName':_0xf56e('0x9'),'paranoid':![],'indexes':[{'name':_0xf56e('0xa'),'fields':[_0xf56e('0xb'),_0xf56e('0xc')],'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 e54c0b5..081170b 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 _0x25b0=['error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x3bb2e6,_0x204bff){var _0x25f839=function(_0x2ad8b2){while(--_0x2ad8b2){_0x3bb2e6['push'](_0x3bb2e6['shift']());}};_0x25f839(++_0x204bff);}(_0x25b0,0x1bd));var _0x025b=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0x25b0[_0x50a1f6];return _0x84f8d4;};'use strict';var _=require('lodash');var util=require(_0x025b('0x0'));var moment=require('moment');var BPromise=require(_0x025b('0x1'));var rs=require(_0x025b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x025b('0x3'))['db'];var utils=require(_0x025b('0x4'));var logger=require(_0x025b('0x5'))(_0x025b('0x6'));var config=require('../../config/environment');var jayson=require(_0x025b('0x7'));var client=jayson[_0x025b('0x8')][_0x025b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428a2b,_0x437f4a,_0x48c83c){return new BPromise(function(_0x3fe965,_0x3f190a){return client[_0x025b('0xa')](_0x428a2b,_0x48c83c)[_0x025b('0xb')](function(_0x35e7c2){logger[_0x025b('0xc')](_0x025b('0xd'),_0x437f4a,_0x025b('0xe'));logger[_0x025b('0xf')](_0x025b('0x10'),_0x437f4a,_0x025b('0xe'),JSON['stringify'](_0x35e7c2));if(_0x35e7c2[_0x025b('0x11')]){if(_0x35e7c2[_0x025b('0x11')][_0x025b('0x12')]===0x1f4){logger[_0x025b('0x11')](_0x025b('0xd'),_0x437f4a,_0x35e7c2['error'][_0x025b('0x13')]);return _0x3f190a(_0x35e7c2[_0x025b('0x11')][_0x025b('0x13')]);}logger[_0x025b('0x11')](_0x025b('0xd'),_0x437f4a,_0x35e7c2[_0x025b('0x11')][_0x025b('0x13')]);return _0x3fe965(_0x35e7c2['error']['message']);}else{logger[_0x025b('0xc')](_0x025b('0xd'),_0x437f4a,_0x025b('0xe'));_0x3fe965(_0x35e7c2[_0x025b('0x14')][_0x025b('0x13')]);}})[_0x025b('0x15')](function(_0x54ba1d){logger[_0x025b('0x11')](_0x025b('0xd'),_0x437f4a,_0x54ba1d);_0x3f190a(_0x54ba1d);});});} \ No newline at end of file +var _0xdf80=['client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1288f8,_0x4ebe31){var _0x1b1b6f=function(_0x41525c){while(--_0x41525c){_0x1288f8['push'](_0x1288f8['shift']());}};_0x1b1b6f(++_0x4ebe31);}(_0xdf80,0x1f1));var _0x0df8=function(_0x42a9e0,_0x2348d9){_0x42a9e0=_0x42a9e0-0x0;var _0x289c87=_0xdf80[_0x42a9e0];return _0x289c87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0df8('0x0'));var BPromise=require(_0x0df8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0df8('0x2'));var db=require(_0x0df8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0df8('0x4'))('rpc');var config=require(_0x0df8('0x5'));var jayson=require(_0x0df8('0x6'));var client=jayson[_0x0df8('0x7')][_0x0df8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28e0de,_0x4570ef,_0x55716c){return new BPromise(function(_0x165c78,_0xfd4d6){return client['request'](_0x28e0de,_0x55716c)[_0x0df8('0x9')](function(_0xce88f3){logger[_0x0df8('0xa')](_0x0df8('0xb'),_0x4570ef,_0x0df8('0xc'));logger[_0x0df8('0xd')](_0x0df8('0xe'),_0x4570ef,_0x0df8('0xc'),JSON[_0x0df8('0xf')](_0xce88f3));if(_0xce88f3[_0x0df8('0x10')]){if(_0xce88f3[_0x0df8('0x10')][_0x0df8('0x11')]===0x1f4){logger[_0x0df8('0x10')](_0x0df8('0xb'),_0x4570ef,_0xce88f3[_0x0df8('0x10')][_0x0df8('0x12')]);return _0xfd4d6(_0xce88f3[_0x0df8('0x10')][_0x0df8('0x12')]);}logger[_0x0df8('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4570ef,_0xce88f3['error'][_0x0df8('0x12')]);return _0x165c78(_0xce88f3['error']['message']);}else{logger['info'](_0x0df8('0xb'),_0x4570ef,_0x0df8('0xc'));_0x165c78(_0xce88f3[_0x0df8('0x13')][_0x0df8('0x12')]);}})[_0x0df8('0x14')](function(_0x1c67e1){logger[_0x0df8('0x10')](_0x0df8('0xb'),_0x4570ef,_0x1c67e1);_0xfd4d6(_0x1c67e1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1b31262..599ef1a 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 _0x4955=['destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','/:id'];(function(_0x2015a0,_0x1ce509){var _0x3ab9b7=function(_0x141d85){while(--_0x141d85){_0x2015a0['push'](_0x2015a0['shift']());}};_0x3ab9b7(++_0x1ce509);}(_0x4955,0x1b9));var _0x5495=function(_0x21488a,_0x3bd38f){_0x21488a=_0x21488a-0x0;var _0x230df0=_0x4955[_0x21488a];return _0x230df0;};'use strict';var multer=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var path=require(_0x5495('0x2'));var timeout=require('connect-timeout');var express=require(_0x5495('0x3'));var router=express[_0x5495('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5495('0x5'));var config=require(_0x5495('0x6'));var controller=require(_0x5495('0x7'));router[_0x5495('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x5495('0x9')](),controller[_0x5495('0xa')]);router['get'](_0x5495('0xb'),auth['isAuthenticated'](),controller[_0x5495('0xc')]);router[_0x5495('0x8')](_0x5495('0xd'),auth[_0x5495('0x9')](),controller[_0x5495('0xe')]);router[_0x5495('0xf')]('/',auth['isAuthenticated'](),controller[_0x5495('0x10')]);router[_0x5495('0xf')](_0x5495('0xb'),auth[_0x5495('0x9')](),controller[_0x5495('0x11')]);router[_0x5495('0x12')]('/:id',auth[_0x5495('0x9')](),controller['update']);router[_0x5495('0x13')](_0x5495('0x14'),auth['isAuthenticated'](),controller[_0x5495('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1816=['../../components/auth/service','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x2138a1,_0x24225e){var _0x34fe97=function(_0x3375b9){while(--_0x3375b9){_0x2138a1['push'](_0x2138a1['shift']());}};_0x34fe97(++_0x24225e);}(_0x1816,0x69));var _0x6181=function(_0x4704af,_0x43e999){_0x4704af=_0x4704af-0x0;var _0x1d1426=_0x1816[_0x4704af];return _0x1d1426;};'use strict';var multer=require(_0x6181('0x0'));var util=require(_0x6181('0x1'));var path=require('path');var timeout=require(_0x6181('0x2'));var express=require(_0x6181('0x3'));var router=express['Router']();var fs_extra=require(_0x6181('0x4'));var auth=require(_0x6181('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6181('0x6'));router[_0x6181('0x7')]('/',auth['isAuthenticated'](),controller[_0x6181('0x8')]);router['get'](_0x6181('0x9'),auth[_0x6181('0xa')](),controller[_0x6181('0xb')]);router[_0x6181('0x7')](_0x6181('0xc'),auth[_0x6181('0xa')](),controller[_0x6181('0xd')]);router[_0x6181('0x7')](_0x6181('0xe'),auth[_0x6181('0xa')](),controller['getFields']);router[_0x6181('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6181('0xc'),auth[_0x6181('0xa')](),controller[_0x6181('0x10')]);router[_0x6181('0x11')](_0x6181('0x9'),auth[_0x6181('0xa')](),controller[_0x6181('0x12')]);router[_0x6181('0x13')](_0x6181('0x9'),auth[_0x6181('0xa')](),controller[_0x6181('0x14')]);module[_0x6181('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 72fbc27..fe02a37 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 _0xeb3b=['sequelize','exports','STRING'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xeb3b[_0x57db49];return _0xd0636f;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'name':{'type':Sequelize[_0xbeb3('0x2')]},'description':{'type':Sequelize[_0xbeb3('0x2')]},'username':{'type':Sequelize[_0xbeb3('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbeb3('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xbeb3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6a55=['STRING','sequelize'];(function(_0x3eecaa,_0x436bcf){var _0xad423f=function(_0x4ec808){while(--_0x4ec808){_0x3eecaa['push'](_0x3eecaa['shift']());}};_0xad423f(++_0x436bcf);}(_0x6a55,0xdb));var _0x56a5=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x6a55[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 3289cae..ec1b38f 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 _0x7fce=['path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','getSubjects','getDescriptions','FreshdeskField','Descriptions','remoteUri','apiKey','slice','substring','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','custom_text','custom_dropdown','default','choices','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util'];(function(_0x344acd,_0x4716fa){var _0x26db0c=function(_0x56da1f){while(--_0x56da1f){_0x344acd['push'](_0x344acd['shift']());}};_0x26db0c(++_0x4716fa);}(_0x7fce,0xdc));var _0xe7fc=function(_0x4504bc,_0x58ee91){_0x4504bc=_0x4504bc-0x0;var _0x173d0f=_0x7fce[_0x4504bc];return _0x173d0f;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xe7fc('0x15'));function respondWithStatusCode(_0x59da2e,_0x38512a){_0x38512a=_0x38512a||0xcc;return function(_0x4e32e9){if(_0x4e32e9){return _0x59da2e['sendStatus'](_0x38512a);}return _0x59da2e[_0xe7fc('0x16')](_0x38512a)[_0xe7fc('0x17')]();};}function respondWithResult(_0x235692,_0x307f58){_0x307f58=_0x307f58||0xc8;return function(_0x293cf4){if(_0x293cf4){return _0x235692['status'](_0x307f58)[_0xe7fc('0x18')](_0x293cf4);}};}function respondWithFilteredResult(_0x5ce83f,_0x4da73b){return function(_0x1302e5){if(_0x1302e5){var _0x249725=typeof _0x4da73b[_0xe7fc('0x19')]===_0xe7fc('0x1a')&&typeof _0x4da73b['limit']==='undefined';var _0x4e549a=_0x1302e5['count'];var _0x52902f=_0x249725?0x0:_0x4da73b['offset'];var _0x14515d=_0x249725?_0x1302e5['count']:_0x4da73b[_0xe7fc('0x19')]+_0x4da73b[_0xe7fc('0x1b')];var _0x10230c;if(_0x14515d>=_0x4e549a){_0x14515d=_0x4e549a;_0x10230c=0xc8;}else{_0x10230c=0xce;}_0x5ce83f[_0xe7fc('0x16')](_0x10230c);return _0x5ce83f[_0xe7fc('0x1c')](_0xe7fc('0x1d'),_0x52902f+'-'+_0x14515d+'/'+_0x4e549a)[_0xe7fc('0x18')](_0x1302e5);}return null;};}function patchUpdates(_0x763103){return function(_0x597fde){try{jsonpatch[_0xe7fc('0x1e')](_0x597fde,_0x763103,!![]);}catch(_0x2eb35a){return BPromise['reject'](_0x2eb35a);}return _0x597fde['save']();};}function saveUpdates(_0x35bb53,_0x3c31e7){return function(_0x338613){if(_0x338613){return _0x338613[_0xe7fc('0x1f')](_0x35bb53)[_0xe7fc('0x20')](function(_0x11c5a3){return _0x11c5a3;});}return null;};}function removeEntity(_0x3f850f,_0x1731b6){return function(_0xb00cb9){if(_0xb00cb9){return _0xb00cb9[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x3f850f[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x17')]();});}};}function handleEntityNotFound(_0x5255b7,_0x2d9e77){return function(_0x158d6e){if(!_0x158d6e){_0x5255b7[_0xe7fc('0x22')](0x194);}return _0x158d6e;};}function handleError(_0x3be1fd,_0x2249ed){_0x2249ed=_0x2249ed||0x1f4;return function(_0x474592){logger['error'](_0x474592[_0xe7fc('0x23')]);if(_0x474592[_0xe7fc('0x24')]){delete _0x474592[_0xe7fc('0x24')];}_0x3be1fd[_0xe7fc('0x16')](_0x2249ed)[_0xe7fc('0x25')](_0x474592);};}exports[_0xe7fc('0x26')]=function(_0x383ca6,_0x4da084){var _0x36a68b={},_0x2a08a4={},_0x512518={'count':0x0,'rows':[]};var _0x37ab14=_['map'](db[_0xe7fc('0x27')][_0xe7fc('0x28')],function(_0x547219){return{'name':_0x547219[_0xe7fc('0x29')],'type':_0x547219['type'][_0xe7fc('0x2a')]};});_0x2a08a4[_0xe7fc('0x2b')]=_[_0xe7fc('0x2c')](_0x37ab14,'name');_0x2a08a4[_0xe7fc('0x2d')]=_['keys'](_0x383ca6[_0xe7fc('0x2d')]);_0x2a08a4[_0xe7fc('0x2e')]=_['intersection'](_0x2a08a4['model'],_0x2a08a4['query']);_0x36a68b['attributes']=_[_0xe7fc('0x2f')](_0x2a08a4[_0xe7fc('0x2b')],qs[_0xe7fc('0x30')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x36a68b[_0xe7fc('0x31')]=_0x36a68b[_0xe7fc('0x31')][_0xe7fc('0x32')]?_0x36a68b[_0xe7fc('0x31')]:_0x2a08a4[_0xe7fc('0x2b')];if(!_0x383ca6['query'][_0xe7fc('0x33')](_0xe7fc('0x34'))){_0x36a68b[_0xe7fc('0x1b')]=qs[_0xe7fc('0x1b')](_0x383ca6[_0xe7fc('0x2d')]['limit']);_0x36a68b[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x19')]);}_0x36a68b[_0xe7fc('0x35')]=qs[_0xe7fc('0x36')](_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x36')]);_0x36a68b[_0xe7fc('0x37')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x38')](_0x383ca6[_0xe7fc('0x2d')],_0x2a08a4['filters']),_0x37ab14);if(_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x39')]){_0x36a68b[_0xe7fc('0x37')]=_[_0xe7fc('0x3a')](_0x36a68b[_0xe7fc('0x37')],{'$or':_['map'](_0x37ab14,function(_0x23f53c){if(_0x23f53c[_0xe7fc('0x3b')]!==_0xe7fc('0x3c')){var _0x10d476={};_0x10d476[_0x23f53c[_0xe7fc('0x24')]]={'$like':'%'+_0x383ca6[_0xe7fc('0x2d')]['filter']+'%'};return _0x10d476;}})});}_0x36a68b=_['merge']({},_0x36a68b,_0x383ca6['options']);var _0x530e08={'where':_0x36a68b['where']};return db[_0xe7fc('0x27')][_0xe7fc('0x3d')](_0x530e08)['then'](function(_0x1bcf1a){_0x512518['count']=_0x1bcf1a;if(_0x383ca6[_0xe7fc('0x2d')][_0xe7fc('0x3e')]){_0x36a68b[_0xe7fc('0x3f')]=[{'all':!![]}];}return db[_0xe7fc('0x27')][_0xe7fc('0x40')](_0x36a68b);})[_0xe7fc('0x20')](function(_0x48e123){_0x512518[_0xe7fc('0x41')]=_0x48e123;return _0x512518;})['then'](respondWithFilteredResult(_0x4da084,_0x36a68b))[_0xe7fc('0x42')](handleError(_0x4da084,null));};exports[_0xe7fc('0x43')]=function(_0x533f26,_0x636368){var _0x3ce7ad={'raw':![],'where':{'id':_0x533f26[_0xe7fc('0x44')]['id']}},_0x44c825={};_0x44c825[_0xe7fc('0x2b')]=_[_0xe7fc('0x45')](db[_0xe7fc('0x27')][_0xe7fc('0x28')]);_0x44c825[_0xe7fc('0x2d')]=_[_0xe7fc('0x45')](_0x533f26[_0xe7fc('0x2d')]);_0x44c825[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x44c825[_0xe7fc('0x2b')],_0x44c825[_0xe7fc('0x2d')]);_0x3ce7ad[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x44c825['model'],qs[_0xe7fc('0x30')](_0x533f26[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x3ce7ad['attributes']=_0x3ce7ad[_0xe7fc('0x31')][_0xe7fc('0x32')]?_0x3ce7ad[_0xe7fc('0x31')]:_0x44c825[_0xe7fc('0x2b')];if(_0x533f26[_0xe7fc('0x2d')]['includeAll']){_0x3ce7ad['include']=[{'all':!![]}];}_0x3ce7ad=_[_0xe7fc('0x3a')]({},_0x3ce7ad,_0x533f26[_0xe7fc('0x46')]);return db[_0xe7fc('0x27')][_0xe7fc('0x47')](_0x3ce7ad)[_0xe7fc('0x20')](handleEntityNotFound(_0x636368,null))['then'](respondWithResult(_0x636368,null))[_0xe7fc('0x42')](handleError(_0x636368,null));};exports[_0xe7fc('0x48')]=function(_0x2807ff,_0x1ae0e4){return db[_0xe7fc('0x27')][_0xe7fc('0x48')](_0x2807ff[_0xe7fc('0x49')],{})[_0xe7fc('0x20')](respondWithResult(_0x1ae0e4,0xc9))[_0xe7fc('0x42')](handleError(_0x1ae0e4,null));};exports[_0xe7fc('0x1f')]=function(_0x533f31,_0x3e61c3){if(_0x533f31['body']['id']){delete _0x533f31[_0xe7fc('0x49')]['id'];}return db[_0xe7fc('0x27')][_0xe7fc('0x47')]({'where':{'id':_0x533f31[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3e61c3,null))[_0xe7fc('0x20')](saveUpdates(_0x533f31[_0xe7fc('0x49')],null))[_0xe7fc('0x20')](respondWithResult(_0x3e61c3,null))[_0xe7fc('0x42')](handleError(_0x3e61c3,null));};exports['destroy']=function(_0x63a8bf,_0xf553c1){return db[_0xe7fc('0x27')][_0xe7fc('0x47')]({'where':{'id':_0x63a8bf[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0xf553c1,null))['then'](removeEntity(_0xf553c1,null))[_0xe7fc('0x42')](handleError(_0xf553c1,null));};exports[_0xe7fc('0x4a')]=function(_0x29af8c,_0x3ffdd1,_0x2f3a91){var _0x2469c8={};var _0x47db6e={};var _0x588619;var _0x3d5f19;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x29af8c[_0xe7fc('0x44')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3ffdd1,null))[_0xe7fc('0x20')](function(_0x2cf52f){if(_0x2cf52f){_0x588619=_0x2cf52f;_0x47db6e[_0xe7fc('0x2b')]=_[_0xe7fc('0x45')](db[_0xe7fc('0x4b')][_0xe7fc('0x28')]);_0x47db6e[_0xe7fc('0x2d')]=_[_0xe7fc('0x45')](_0x29af8c[_0xe7fc('0x2d')]);_0x47db6e['filters']=_[_0xe7fc('0x2f')](_0x47db6e['model'],_0x47db6e[_0xe7fc('0x2d')]);_0x2469c8[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x47db6e[_0xe7fc('0x2b')],qs[_0xe7fc('0x30')](_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x30')]));_0x2469c8[_0xe7fc('0x31')]=_0x2469c8['attributes'][_0xe7fc('0x32')]?_0x2469c8[_0xe7fc('0x31')]:_0x47db6e['model'];_0x2469c8[_0xe7fc('0x35')]=qs[_0xe7fc('0x36')](_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x36')]);_0x2469c8[_0xe7fc('0x37')]=qs['filters'](_[_0xe7fc('0x38')](_0x29af8c[_0xe7fc('0x2d')],_0x47db6e[_0xe7fc('0x2e')]));if(_0x29af8c[_0xe7fc('0x2d')]['filter']){_0x2469c8[_0xe7fc('0x37')]=_[_0xe7fc('0x3a')](_0x2469c8[_0xe7fc('0x37')],{'$or':_['map'](_0x2469c8['attributes'],function(_0x323c66){var _0x40bd01={};_0x40bd01[_0x323c66]={'$like':'%'+_0x29af8c[_0xe7fc('0x2d')][_0xe7fc('0x39')]+'%'};return _0x40bd01;})});}_0x2469c8=_[_0xe7fc('0x3a')]({},_0x2469c8,_0x29af8c[_0xe7fc('0x46')]);return _0x588619['getConfigurations'](_0x2469c8);}})[_0xe7fc('0x20')](function(_0x4d9a11){if(_0x4d9a11){_0x3d5f19=_0x4d9a11[_0xe7fc('0x32')];if(!_0x29af8c[_0xe7fc('0x2d')]['hasOwnProperty'](_0xe7fc('0x34'))){_0x2469c8['limit']=qs['limit'](_0x29af8c['query'][_0xe7fc('0x1b')]);_0x2469c8[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x29af8c['query']['offset']);}return _0x588619['getConfigurations'](_0x2469c8);}})['then'](function(_0x3ea15b){if(_0x3ea15b){return _0x3ea15b?{'count':_0x3d5f19,'rows':_0x3ea15b}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x3ffdd1,null))[_0xe7fc('0x42')](handleError(_0x3ffdd1,null));};exports[_0xe7fc('0x4c')]=function(_0x149f53,_0x187f2f,_0x13a1c4){if(_0x149f53[_0xe7fc('0x49')]['id']){delete _0x149f53[_0xe7fc('0x49')]['id'];}return db['FreshdeskAccount'][_0xe7fc('0x4d')]({'where':{'id':_0x149f53['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x187f2f,null))[_0xe7fc('0x20')](function(_0x30c2e1){if(_0x30c2e1){_0x149f53['body'][_0xe7fc('0x4e')]=_0x30c2e1['id'];_0x149f53[_0xe7fc('0x49')]['Subjects']=integrations[_0xe7fc('0x4f')](_0x149f53[_0xe7fc('0x49')]['channel'],_0x149f53[_0xe7fc('0x49')][_0xe7fc('0x3b')]);_0x149f53[_0xe7fc('0x49')]['Descriptions']=integrations[_0xe7fc('0x50')](_0x149f53['body']['channel'],_0x149f53[_0xe7fc('0x49')][_0xe7fc('0x3b')]);return db[_0xe7fc('0x4b')][_0xe7fc('0x48')](_0x149f53[_0xe7fc('0x49')],{'include':[{'model':db[_0xe7fc('0x51')],'as':'Subjects'},{'model':db[_0xe7fc('0x51')],'as':_0xe7fc('0x52')}]});}return null;})[_0xe7fc('0x20')](respondWithResult(_0x187f2f,null))[_0xe7fc('0x42')](handleError(_0x187f2f,null));};exports['getFields']=function(_0x1b9dff,_0x21d85d,_0xbe9ac8){var _0x5ede3a='';return db[_0xe7fc('0x27')][_0xe7fc('0x4d')]({'where':{'id':_0x1b9dff['params']['id']},'attributes':['id',_0xe7fc('0x53'),_0xe7fc('0x54')]})[_0xe7fc('0x20')](handleEntityNotFound(_0x21d85d,null))[_0xe7fc('0x20')](function(_0xa75e96){if(_0xa75e96){_0x5ede3a=_0xa75e96[_0xe7fc('0x53')];var _0x33baac=_0x5ede3a[_0xe7fc('0x55')](-0x1);if(_0x33baac==='/'){_0x5ede3a=_0x5ede3a[_0xe7fc('0x56')](0x0,_0x5ede3a['lastIndexOf'](_0x33baac));}return rp({'method':'GET','uri':util['format'](_0xe7fc('0x57'),_0x5ede3a,_0xe7fc('0x58')),'headers':{'Authorization':util['format'](_0xe7fc('0x59'),new Buffer(util['format'](_0xe7fc('0x5a'),_0xa75e96['apiKey']))[_0xe7fc('0x5b')](_0xe7fc('0x5c')))},'json':!![]});}})[_0xe7fc('0x20')](function(_0x13cf1d){if(_0x13cf1d){var _0x15b4dc=[_0xe7fc('0x5d'),_0xe7fc('0x5e'),_0xe7fc('0x5f'),_0xe7fc('0x60'),_0xe7fc('0x16'),_0xe7fc('0x61'),'group',_0xe7fc('0x62'),_0xe7fc('0x63'),_0xe7fc('0x64'),_0xe7fc('0x65')];_['remove'](_0x13cf1d,function(_0xb548e9){return _0x15b4dc[_0xe7fc('0x66')](_0xb548e9[_0xe7fc('0x24')])||!_0xb548e9['default']&&_0xb548e9[_0xe7fc('0x3b')]!==_0xe7fc('0x67')&&_0xb548e9[_0xe7fc('0x3b')]!==_0xe7fc('0x68');});return{'count':_0x13cf1d[_0xe7fc('0x32')],'rows':_[_0xe7fc('0x2c')](_0x13cf1d,function(_0x469166){return{'id':_0x469166[_0xe7fc('0x24')],'name':_0x469166['label'],'custom':!_0x469166[_0xe7fc('0x69')],'options':_0x469166['choices']?_[_0xe7fc('0x2c')](_0x469166[_0xe7fc('0x6a')],function(_0x11973e){return{'name':_['capitalize'](_0x11973e),'value':_0x11973e};}):[]};})};}})[_0xe7fc('0x20')](respondWithResult(_0x21d85d,null))[_0xe7fc('0x42')](function(_0x31431c){var _0x5e06d3=_0x1b9dff[_0xe7fc('0x2d')]['test']?0x1f4:_0x31431c[_0xe7fc('0x6b')]||0x1f4;logger[_0xe7fc('0x6c')](_0xe7fc('0x6d'),_0xe7fc('0x6e'),_0x5e06d3,JSON[_0xe7fc('0x6f')](_0x31431c));delete _0x31431c['name'];if(_0x5e06d3===0x191){_0x5e06d3=0x190;}_0x21d85d[_0xe7fc('0x16')](_0x5e06d3)[_0xe7fc('0x25')](_0x1b9dff[_0xe7fc('0x2d')]['test']?{'message':_0xe7fc('0x70'),'statusCode':_0x31431c['statusCode']}:_0x31431c);});}; \ No newline at end of file +var _0xc900=['query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','apiKey','remoteUri','slice','substring','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','custom_text','default','choices','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskAccount','fieldName','type','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc900,0xb3));var _0x0c90=function(_0x5dc2f7,_0x1a0eda){_0x5dc2f7=_0x5dc2f7-0x0;var _0x3f5610=_0xc900[_0x5dc2f7];return _0x3f5610;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x459cdb,_0x26fc46){_0x26fc46=_0x26fc46||0xcc;return function(_0x4535a2){if(_0x4535a2){return _0x459cdb[_0x0c90('0x19')](_0x26fc46);}return _0x459cdb[_0x0c90('0x1a')](_0x26fc46)['end']();};}function respondWithResult(_0x467b32,_0x4451e0){_0x4451e0=_0x4451e0||0xc8;return function(_0x4f35f4){if(_0x4f35f4){return _0x467b32[_0x0c90('0x1a')](_0x4451e0)[_0x0c90('0x1b')](_0x4f35f4);}};}function respondWithFilteredResult(_0x3bd5e8,_0x5bef7d){return function(_0x5daeb7){if(_0x5daeb7){var _0x412635=typeof _0x5bef7d[_0x0c90('0x1c')]===_0x0c90('0x1d')&&typeof _0x5bef7d[_0x0c90('0x1e')]===_0x0c90('0x1d');var _0x2cab22=_0x5daeb7[_0x0c90('0x1f')];var _0x57b9a6=_0x412635?0x0:_0x5bef7d[_0x0c90('0x1c')];var _0x38becc=_0x412635?_0x5daeb7[_0x0c90('0x1f')]:_0x5bef7d[_0x0c90('0x1c')]+_0x5bef7d['limit'];var _0x10a775;if(_0x38becc>=_0x2cab22){_0x38becc=_0x2cab22;_0x10a775=0xc8;}else{_0x10a775=0xce;}_0x3bd5e8[_0x0c90('0x1a')](_0x10a775);return _0x3bd5e8[_0x0c90('0x20')](_0x0c90('0x21'),_0x57b9a6+'-'+_0x38becc+'/'+_0x2cab22)[_0x0c90('0x1b')](_0x5daeb7);}return null;};}function patchUpdates(_0xc08f54){return function(_0x4cc940){try{jsonpatch[_0x0c90('0x22')](_0x4cc940,_0xc08f54,!![]);}catch(_0x4d629f){return BPromise[_0x0c90('0x23')](_0x4d629f);}return _0x4cc940[_0x0c90('0x24')]();};}function saveUpdates(_0x47b13c,_0x2a053a){return function(_0x43ddc3){if(_0x43ddc3){return _0x43ddc3[_0x0c90('0x25')](_0x47b13c)[_0x0c90('0x26')](function(_0x212164){return _0x212164;});}return null;};}function removeEntity(_0x3b287c,_0x4dfbc3){return function(_0x26f0a3){if(_0x26f0a3){return _0x26f0a3[_0x0c90('0x27')]()['then'](function(){_0x3b287c['status'](0xcc)[_0x0c90('0x28')]();});}};}function handleEntityNotFound(_0x3ea861,_0x35c243){return function(_0x109a5f){if(!_0x109a5f){_0x3ea861['sendStatus'](0x194);}return _0x109a5f;};}function handleError(_0x2dfa14,_0x438652){_0x438652=_0x438652||0x1f4;return function(_0xeb7f58){logger[_0x0c90('0x29')](_0xeb7f58[_0x0c90('0x2a')]);if(_0xeb7f58[_0x0c90('0x2b')]){delete _0xeb7f58['name'];}_0x2dfa14[_0x0c90('0x1a')](_0x438652)[_0x0c90('0x2c')](_0xeb7f58);};}exports[_0x0c90('0x2d')]=function(_0x13b377,_0x52d28d){var _0x4c8603={},_0x1f27f1={},_0x25da6e={'count':0x0,'rows':[]};var _0x3bff04=_[_0x0c90('0x2e')](db[_0x0c90('0x2f')]['rawAttributes'],function(_0x120136){return{'name':_0x120136[_0x0c90('0x30')],'type':_0x120136[_0x0c90('0x31')]['key']};});_0x1f27f1[_0x0c90('0x32')]=_['map'](_0x3bff04,'name');_0x1f27f1[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x13b377[_0x0c90('0x33')]);_0x1f27f1[_0x0c90('0x35')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],_0x1f27f1['query']);_0x4c8603[_0x0c90('0x36')]=_['intersection'](_0x1f27f1[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x13b377['query'][_0x0c90('0x37')]));_0x4c8603[_0x0c90('0x36')]=_0x4c8603[_0x0c90('0x36')][_0x0c90('0x38')]?_0x4c8603[_0x0c90('0x36')]:_0x1f27f1[_0x0c90('0x32')];if(!_0x13b377[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0x4c8603[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1e')]);_0x4c8603['offset']=qs[_0x0c90('0x1c')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x1c')]);}_0x4c8603[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x13b377[_0x0c90('0x33')][_0x0c90('0x3b')]);_0x4c8603[_0x0c90('0x3c')]=qs['filters'](_[_0x0c90('0x3d')](_0x13b377[_0x0c90('0x33')],_0x1f27f1['filters']),_0x3bff04);if(_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]){_0x4c8603[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x4c8603[_0x0c90('0x3c')],{'$or':_['map'](_0x3bff04,function(_0x2f1d95){if(_0x2f1d95[_0x0c90('0x31')]!==_0x0c90('0x40')){var _0x2bca69={};_0x2bca69[_0x2f1d95[_0x0c90('0x2b')]]={'$like':'%'+_0x13b377[_0x0c90('0x33')][_0x0c90('0x3e')]+'%'};return _0x2bca69;}})});}_0x4c8603=_[_0x0c90('0x3f')]({},_0x4c8603,_0x13b377[_0x0c90('0x41')]);var _0x4f0227={'where':_0x4c8603[_0x0c90('0x3c')]};return db['FreshdeskAccount'][_0x0c90('0x1f')](_0x4f0227)['then'](function(_0xb126ef){_0x25da6e[_0x0c90('0x1f')]=_0xb126ef;if(_0x13b377['query']['includeAll']){_0x4c8603[_0x0c90('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x0c90('0x43')](_0x4c8603);})[_0x0c90('0x26')](function(_0x373f9f){_0x25da6e['rows']=_0x373f9f;return _0x25da6e;})[_0x0c90('0x26')](respondWithFilteredResult(_0x52d28d,_0x4c8603))[_0x0c90('0x44')](handleError(_0x52d28d,null));};exports[_0x0c90('0x45')]=function(_0x3e5137,_0x2139c3){var _0x1184c4={'raw':![],'where':{'id':_0x3e5137[_0x0c90('0x46')]['id']}},_0x565b10={};_0x565b10[_0x0c90('0x32')]=_[_0x0c90('0x34')](db[_0x0c90('0x2f')][_0x0c90('0x47')]);_0x565b10[_0x0c90('0x33')]=_[_0x0c90('0x34')](_0x3e5137['query']);_0x565b10[_0x0c90('0x35')]=_['intersection'](_0x565b10[_0x0c90('0x32')],_0x565b10[_0x0c90('0x33')]);_0x1184c4[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x565b10[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x3e5137[_0x0c90('0x33')][_0x0c90('0x37')]));_0x1184c4[_0x0c90('0x36')]=_0x1184c4[_0x0c90('0x36')][_0x0c90('0x38')]?_0x1184c4[_0x0c90('0x36')]:_0x565b10[_0x0c90('0x32')];if(_0x3e5137[_0x0c90('0x33')][_0x0c90('0x49')]){_0x1184c4['include']=[{'all':!![]}];}_0x1184c4=_[_0x0c90('0x3f')]({},_0x1184c4,_0x3e5137[_0x0c90('0x41')]);return db[_0x0c90('0x2f')][_0x0c90('0x4a')](_0x1184c4)[_0x0c90('0x26')](handleEntityNotFound(_0x2139c3,null))[_0x0c90('0x26')](respondWithResult(_0x2139c3,null))[_0x0c90('0x44')](handleError(_0x2139c3,null));};exports[_0x0c90('0x4b')]=function(_0x3bb138,_0x3af64f){return db[_0x0c90('0x2f')][_0x0c90('0x4b')](_0x3bb138[_0x0c90('0x4c')],{})[_0x0c90('0x26')](respondWithResult(_0x3af64f,0xc9))['catch'](handleError(_0x3af64f,null));};exports[_0x0c90('0x25')]=function(_0x38f492,_0x553fea){if(_0x38f492['body']['id']){delete _0x38f492['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x38f492[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x553fea,null))[_0x0c90('0x26')](saveUpdates(_0x38f492['body'],null))[_0x0c90('0x26')](respondWithResult(_0x553fea,null))[_0x0c90('0x44')](handleError(_0x553fea,null));};exports[_0x0c90('0x27')]=function(_0x549c78,_0x119776){return db[_0x0c90('0x2f')][_0x0c90('0x4a')]({'where':{'id':_0x549c78[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x119776,null))[_0x0c90('0x26')](removeEntity(_0x119776,null))[_0x0c90('0x44')](handleError(_0x119776,null));};exports[_0x0c90('0x4d')]=function(_0x1daeed,_0xeeee3b,_0x5e288e){var _0xac80b2={};var _0x4ba9e7={};var _0xda4331;var _0x67539d;return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x1daeed[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0xeeee3b,null))['then'](function(_0x4930fc){if(_0x4930fc){_0xda4331=_0x4930fc;_0x4ba9e7['model']=_['keys'](db[_0x0c90('0x4f')][_0x0c90('0x47')]);_0x4ba9e7[_0x0c90('0x33')]=_['keys'](_0x1daeed[_0x0c90('0x33')]);_0x4ba9e7[_0x0c90('0x35')]=_['intersection'](_0x4ba9e7[_0x0c90('0x32')],_0x4ba9e7['query']);_0xac80b2[_0x0c90('0x36')]=_[_0x0c90('0x48')](_0x4ba9e7[_0x0c90('0x32')],qs[_0x0c90('0x37')](_0x1daeed['query'][_0x0c90('0x37')]));_0xac80b2['attributes']=_0xac80b2[_0x0c90('0x36')][_0x0c90('0x38')]?_0xac80b2['attributes']:_0x4ba9e7['model'];_0xac80b2['order']=qs[_0x0c90('0x3b')](_0x1daeed[_0x0c90('0x33')][_0x0c90('0x3b')]);_0xac80b2[_0x0c90('0x3c')]=qs[_0x0c90('0x35')](_['pick'](_0x1daeed[_0x0c90('0x33')],_0x4ba9e7[_0x0c90('0x35')]));if(_0x1daeed['query'][_0x0c90('0x3e')]){_0xac80b2['where']=_[_0x0c90('0x3f')](_0xac80b2[_0x0c90('0x3c')],{'$or':_['map'](_0xac80b2[_0x0c90('0x36')],function(_0x5baf85){var _0x4de11a={};_0x4de11a[_0x5baf85]={'$like':'%'+_0x1daeed['query'][_0x0c90('0x3e')]+'%'};return _0x4de11a;})});}_0xac80b2=_[_0x0c90('0x3f')]({},_0xac80b2,_0x1daeed[_0x0c90('0x41')]);return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})['then'](function(_0x5b385b){if(_0x5b385b){_0x67539d=_0x5b385b[_0x0c90('0x38')];if(!_0x1daeed[_0x0c90('0x33')][_0x0c90('0x39')]('nolimit')){_0xac80b2[_0x0c90('0x1e')]=qs[_0x0c90('0x1e')](_0x1daeed[_0x0c90('0x33')]['limit']);_0xac80b2[_0x0c90('0x1c')]=qs[_0x0c90('0x1c')](_0x1daeed[_0x0c90('0x33')]['offset']);}return _0xda4331[_0x0c90('0x4d')](_0xac80b2);}})[_0x0c90('0x26')](function(_0x1a198b){if(_0x1a198b){return _0x1a198b?{'count':_0x67539d,'rows':_0x1a198b}:null;}})[_0x0c90('0x26')](respondWithResult(_0xeeee3b,null))[_0x0c90('0x44')](handleError(_0xeeee3b,null));};exports[_0x0c90('0x50')]=function(_0x19f4ac,_0x143e0d,_0x181fe3){if(_0x19f4ac['body']['id']){delete _0x19f4ac['body']['id'];}return db[_0x0c90('0x2f')][_0x0c90('0x4e')]({'where':{'id':_0x19f4ac[_0x0c90('0x46')]['id']}})[_0x0c90('0x26')](handleEntityNotFound(_0x143e0d,null))[_0x0c90('0x26')](function(_0x2dad30){if(_0x2dad30){_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x51')]=_0x2dad30['id'];_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x52')]=integrations[_0x0c90('0x53')](_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x54')],_0x19f4ac[_0x0c90('0x4c')][_0x0c90('0x31')]);_0x19f4ac['body'][_0x0c90('0x55')]=integrations[_0x0c90('0x56')](_0x19f4ac[_0x0c90('0x4c')]['channel'],_0x19f4ac['body'][_0x0c90('0x31')]);return db['FreshdeskConfiguration'][_0x0c90('0x4b')](_0x19f4ac[_0x0c90('0x4c')],{'include':[{'model':db['FreshdeskField'],'as':_0x0c90('0x52')},{'model':db[_0x0c90('0x57')],'as':_0x0c90('0x55')}]});}return null;})[_0x0c90('0x26')](respondWithResult(_0x143e0d,null))['catch'](handleError(_0x143e0d,null));};exports['getFields']=function(_0x5f32d6,_0x16b38a,_0x2d3287){var _0x3bc90d='';return db[_0x0c90('0x2f')]['findOne']({'where':{'id':_0x5f32d6[_0x0c90('0x46')]['id']},'attributes':['id','remoteUri',_0x0c90('0x58')]})[_0x0c90('0x26')](handleEntityNotFound(_0x16b38a,null))[_0x0c90('0x26')](function(_0x4f580a){if(_0x4f580a){_0x3bc90d=_0x4f580a[_0x0c90('0x59')];var _0x220819=_0x3bc90d[_0x0c90('0x5a')](-0x1);if(_0x220819==='/'){_0x3bc90d=_0x3bc90d[_0x0c90('0x5b')](0x0,_0x3bc90d['lastIndexOf'](_0x220819));}return rp({'method':'GET','uri':util[_0x0c90('0x5c')]('%s/%s',_0x3bc90d,_0x0c90('0x5d')),'headers':{'Authorization':util[_0x0c90('0x5c')](_0x0c90('0x5e'),new Buffer(util[_0x0c90('0x5c')](_0x0c90('0x5f'),_0x4f580a[_0x0c90('0x58')]))[_0x0c90('0x60')](_0x0c90('0x61')))},'json':!![]});}})[_0x0c90('0x26')](function(_0x198b8f){if(_0x198b8f){var _0x53779b=[_0x0c90('0x62'),_0x0c90('0x63'),_0x0c90('0x64'),_0x0c90('0x65'),_0x0c90('0x1a'),_0x0c90('0x66'),_0x0c90('0x67'),_0x0c90('0x68'),_0x0c90('0x69'),_0x0c90('0x67'),'company'];_[_0x0c90('0x6a')](_0x198b8f,function(_0x5268f8){return _0x53779b[_0x0c90('0x6b')](_0x5268f8[_0x0c90('0x2b')])||!_0x5268f8['default']&&_0x5268f8[_0x0c90('0x31')]!==_0x0c90('0x6c')&&_0x5268f8[_0x0c90('0x31')]!=='custom_dropdown';});return{'count':_0x198b8f[_0x0c90('0x38')],'rows':_[_0x0c90('0x2e')](_0x198b8f,function(_0x5857fa){return{'id':_0x5857fa[_0x0c90('0x2b')],'name':_0x5857fa['label'],'custom':!_0x5857fa[_0x0c90('0x6d')],'options':_0x5857fa['choices']?_['map'](_0x5857fa[_0x0c90('0x6e')],function(_0x137c30){return{'name':_['capitalize'](_0x137c30),'value':_0x137c30};}):[]};})};}})['then'](respondWithResult(_0x16b38a,null))[_0x0c90('0x44')](function(_0x3b0a82){var _0x5d80b9=_0x5f32d6['query'][_0x0c90('0x6f')]?0x1f4:_0x3b0a82['statusCode']||0x1f4;logger[_0x0c90('0x29')](_0x0c90('0x70'),_0x0c90('0x71'),_0x5d80b9,JSON[_0x0c90('0x72')](_0x3b0a82));delete _0x3b0a82[_0x0c90('0x2b')];if(_0x5d80b9===0x191){_0x5d80b9=0x190;}_0x16b38a['status'](_0x5d80b9)[_0x0c90('0x2c')](_0x5f32d6[_0x0c90('0x33')][_0x0c90('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x3b0a82['statusCode']}:_0x3b0a82);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 201a192..3ffd071 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 _0xed69=['exports','define','FreshdeskAccount','int_freshdesk_accounts','util','api','moment','request-promise','../../config/environment','../../components/integrations/configuration'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xed69,0x1bc));var _0x9ed6=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xed69[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x9ed6('0x0'));var logger=require('../../config/logger')(_0x9ed6('0x1'));var moment=require(_0x9ed6('0x2'));var BPromise=require('bluebird');var rp=require(_0x9ed6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ed6('0x4'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9ed6('0x5'));module[_0x9ed6('0x6')]=function(_0x180a58,_0x466a7a){return _0x180a58[_0x9ed6('0x7')](_0x9ed6('0x8'),attributes,{'tableName':_0x9ed6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46af=['exports','define','FreshdeskAccount','util','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0xf54728,_0x393556){var _0x1aa172=function(_0x33fefe){while(--_0x33fefe){_0xf54728['push'](_0xf54728['shift']());}};_0x1aa172(++_0x393556);}(_0x46af,0xfd));var _0xf46a=function(_0x4ad9cf,_0x1da46c){_0x4ad9cf=_0x4ad9cf-0x0;var _0x46be23=_0x46af[_0x4ad9cf];return _0x46be23;};'use strict';var _=require('lodash');var util=require(_0xf46a('0x0'));var logger=require('../../config/logger')(_0xf46a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf46a('0x2'));var fs=require('fs');var path=require(_0xf46a('0x3'));var rimraf=require(_0xf46a('0x4'));var config=require(_0xf46a('0x5'));var attributes=require(_0xf46a('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xf46a('0x7')]=function(_0x42b28f,_0x4a96b8){return _0x42b28f[_0xf46a('0x8')](_0xf46a('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 01387ba..df31b49 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 _0x05ee=['FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','findAll','options','raw','where','attributes','include','map','model','GetFreshdeskAccount','stringify','catch','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2a8d33,_0xfd5049){var _0x5cd65a=function(_0x48c00e){while(--_0x48c00e){_0x2a8d33['push'](_0x2a8d33['shift']());}};_0x5cd65a(++_0xfd5049);}(_0x05ee,0x88));var _0xe05e=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x05ee[_0x2431d6];return _0x4d0f9b;};'use strict';var _=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var moment=require(_0xe05e('0x2'));var BPromise=require(_0xe05e('0x3'));var rs=require(_0xe05e('0x4'));var fs=require('fs');var Redis=require(_0xe05e('0x5'));var db=require(_0xe05e('0x6'))['db'];var utils=require(_0xe05e('0x7'));var logger=require(_0xe05e('0x8'))(_0xe05e('0x9'));var config=require('../../config/environment');var jayson=require(_0xe05e('0xa'));var client=jayson[_0xe05e('0xb')][_0xe05e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22ac7f,_0x5c77d9,_0x3f2f49){return new BPromise(function(_0x461dc5,_0x5d59a1){return client[_0xe05e('0xd')](_0x22ac7f,_0x3f2f49)[_0xe05e('0xe')](function(_0x113cb5){logger[_0xe05e('0xf')](_0xe05e('0x10'),_0x5c77d9,'request\x20sent');logger[_0xe05e('0x11')](_0xe05e('0x12'),_0x5c77d9,_0xe05e('0x13'),JSON['stringify'](_0x113cb5));if(_0x113cb5[_0xe05e('0x14')]){if(_0x113cb5[_0xe05e('0x14')][_0xe05e('0x15')]===0x1f4){logger[_0xe05e('0x14')](_0xe05e('0x10'),_0x5c77d9,_0x113cb5[_0xe05e('0x14')][_0xe05e('0x16')]);return _0x5d59a1(_0x113cb5[_0xe05e('0x14')][_0xe05e('0x16')]);}logger[_0xe05e('0x14')](_0xe05e('0x10'),_0x5c77d9,_0x113cb5[_0xe05e('0x14')][_0xe05e('0x16')]);return _0x461dc5(_0x113cb5['error']['message']);}else{logger['info'](_0xe05e('0x10'),_0x5c77d9,_0xe05e('0x13'));_0x461dc5(_0x113cb5[_0xe05e('0x17')][_0xe05e('0x16')]);}})['catch'](function(_0x2c8ccc){logger['error'](_0xe05e('0x10'),_0x5c77d9,_0x2c8ccc);_0x5d59a1(_0x2c8ccc);});});}exports['GetFreshdeskAccount']=function(_0x5054de){var _0x15dcd6=this;return new Promise(function(_0x353130,_0x342702){return db['FreshdeskAccount'][_0xe05e('0x18')]({'raw':_0x5054de['options']?_0x5054de[_0xe05e('0x19')][_0xe05e('0x1a')]===undefined?!![]:![]:!![],'where':_0x5054de[_0xe05e('0x19')]?_0x5054de[_0xe05e('0x19')][_0xe05e('0x1b')]||null:null,'attributes':_0x5054de[_0xe05e('0x19')]?_0x5054de['options'][_0xe05e('0x1c')]||null:null,'limit':_0x5054de[_0xe05e('0x19')]?_0x5054de['options']['limit']||null:null,'include':_0x5054de['options']?_0x5054de[_0xe05e('0x19')][_0xe05e('0x1d')]?_[_0xe05e('0x1e')](_0x5054de[_0xe05e('0x19')]['include'],function(_0x51b5d0){return{'model':db[_0x51b5d0['model']],'as':_0x51b5d0['as'],'attributes':_0x51b5d0[_0xe05e('0x1c')],'include':_0x51b5d0[_0xe05e('0x1d')]?_[_0xe05e('0x1e')](_0x51b5d0['include'],function(_0x25c93d){return{'model':db[_0x25c93d[_0xe05e('0x1f')]],'as':_0x25c93d['as'],'attributes':_0x25c93d['attributes'],'include':_0x25c93d['include']?_[_0xe05e('0x1e')](_0x25c93d[_0xe05e('0x1d')],function(_0x54eaa1){return{'model':db[_0x54eaa1[_0xe05e('0x1f')]],'as':_0x54eaa1['as'],'attributes':_0x54eaa1[_0xe05e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe05e('0xe')](function(_0x41ae0a){logger[_0xe05e('0xf')](_0xe05e('0x20'),_0x5054de);logger[_0xe05e('0x11')](_0xe05e('0x20'),_0x5054de,JSON[_0xe05e('0x21')](_0x41ae0a));_0x353130(_0x41ae0a);})[_0xe05e('0x22')](function(_0x23f053){logger[_0xe05e('0x14')](_0xe05e('0x20'),_0x23f053[_0xe05e('0x16')],_0x5054de);_0x342702(_0x15dcd6[_0xe05e('0x14')](0x1f4,_0x23f053[_0xe05e('0x16')]));});});};exports[_0xe05e('0x23')]=function(_0x292591){var _0x505d4d=this;return new Promise(function(_0x1c8938,_0x4e7e52){return db[_0xe05e('0x24')][_0xe05e('0x25')]({'raw':_0x292591['options']?_0x292591[_0xe05e('0x19')][_0xe05e('0x1a')]===undefined?!![]:![]:!![],'where':_0x292591[_0xe05e('0x19')]?_0x292591[_0xe05e('0x19')][_0xe05e('0x1b')]||null:null,'attributes':_0x292591[_0xe05e('0x19')]?_0x292591[_0xe05e('0x19')]['attributes']||null:null,'include':_0x292591['options']?_0x292591[_0xe05e('0x19')][_0xe05e('0x1d')]?_['map'](_0x292591[_0xe05e('0x19')][_0xe05e('0x1d')],function(_0x500c15){return{'model':db[_0x500c15['model']],'as':_0x500c15['as'],'attributes':_0x500c15[_0xe05e('0x1c')],'include':_0x500c15[_0xe05e('0x1d')]?_[_0xe05e('0x1e')](_0x500c15['include'],function(_0x54b713){return{'model':db[_0x54b713[_0xe05e('0x1f')]],'as':_0x54b713['as'],'attributes':_0x54b713[_0xe05e('0x1c')],'include':_0x54b713['include']?_['map'](_0x54b713[_0xe05e('0x1d')],function(_0x2409b3){return{'model':db[_0x2409b3[_0xe05e('0x1f')]],'as':_0x2409b3['as'],'attributes':_0x2409b3[_0xe05e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe05e('0xe')](function(_0x287f0e){logger['info']('ShowFreshdeskAccount',_0x292591);logger[_0xe05e('0x11')](_0xe05e('0x23'),_0x292591,JSON[_0xe05e('0x21')](_0x287f0e));_0x1c8938(_0x287f0e);})[_0xe05e('0x22')](function(_0xdbee6d){logger[_0xe05e('0x14')]('ShowFreshdeskAccount',_0xdbee6d['message'],_0x292591);_0x4e7e52(_0x505d4d[_0xe05e('0x14')](0x1f4,_0xdbee6d[_0xe05e('0x16')]));});});}; \ No newline at end of file +var _0x57fe=['../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','options','raw','limit','include','map','attributes','model','catch','ShowFreshdeskAccount','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x57fe,0x13b));var _0xe57f=function(_0x269726,_0x1d8b34){_0x269726=_0x269726-0x0;var _0x2b7a71=_0x57fe[_0x269726];return _0x2b7a71;};'use strict';var _=require(_0xe57f('0x0'));var util=require(_0xe57f('0x1'));var moment=require('moment');var BPromise=require(_0xe57f('0x2'));var rs=require(_0xe57f('0x3'));var fs=require('fs');var Redis=require(_0xe57f('0x4'));var db=require(_0xe57f('0x5'))['db'];var utils=require(_0xe57f('0x6'));var logger=require(_0xe57f('0x7'))(_0xe57f('0x8'));var config=require(_0xe57f('0x9'));var jayson=require(_0xe57f('0xa'));var client=jayson['client'][_0xe57f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ed1af,_0x3ce7d6,_0x54dc3e){return new BPromise(function(_0x133ccd,_0x2225cc){return client[_0xe57f('0xc')](_0x2ed1af,_0x54dc3e)[_0xe57f('0xd')](function(_0x3584a8){logger[_0xe57f('0xe')](_0xe57f('0xf'),_0x3ce7d6,_0xe57f('0x10'));logger[_0xe57f('0x11')](_0xe57f('0x12'),_0x3ce7d6,'request\x20sent',JSON[_0xe57f('0x13')](_0x3584a8));if(_0x3584a8[_0xe57f('0x14')]){if(_0x3584a8[_0xe57f('0x14')][_0xe57f('0x15')]===0x1f4){logger[_0xe57f('0x14')](_0xe57f('0xf'),_0x3ce7d6,_0x3584a8['error']['message']);return _0x2225cc(_0x3584a8[_0xe57f('0x14')][_0xe57f('0x16')]);}logger[_0xe57f('0x14')](_0xe57f('0xf'),_0x3ce7d6,_0x3584a8['error'][_0xe57f('0x16')]);return _0x133ccd(_0x3584a8[_0xe57f('0x14')][_0xe57f('0x16')]);}else{logger[_0xe57f('0xe')](_0xe57f('0xf'),_0x3ce7d6,'request\x20sent');_0x133ccd(_0x3584a8[_0xe57f('0x17')][_0xe57f('0x16')]);}})['catch'](function(_0x63dbb8){logger[_0xe57f('0x14')](_0xe57f('0xf'),_0x3ce7d6,_0x63dbb8);_0x2225cc(_0x63dbb8);});});}exports[_0xe57f('0x18')]=function(_0xae5097){var _0x1fe730=this;return new Promise(function(_0x20ac23,_0x20a882){return db[_0xe57f('0x19')]['findAll']({'raw':_0xae5097[_0xe57f('0x1a')]?_0xae5097[_0xe57f('0x1a')][_0xe57f('0x1b')]===undefined?!![]:![]:!![],'where':_0xae5097[_0xe57f('0x1a')]?_0xae5097['options']['where']||null:null,'attributes':_0xae5097[_0xe57f('0x1a')]?_0xae5097['options']['attributes']||null:null,'limit':_0xae5097[_0xe57f('0x1a')]?_0xae5097[_0xe57f('0x1a')][_0xe57f('0x1c')]||null:null,'include':_0xae5097[_0xe57f('0x1a')]?_0xae5097['options'][_0xe57f('0x1d')]?_[_0xe57f('0x1e')](_0xae5097['options']['include'],function(_0x1817e2){return{'model':db[_0x1817e2['model']],'as':_0x1817e2['as'],'attributes':_0x1817e2[_0xe57f('0x1f')],'include':_0x1817e2[_0xe57f('0x1d')]?_[_0xe57f('0x1e')](_0x1817e2[_0xe57f('0x1d')],function(_0x547a04){return{'model':db[_0x547a04[_0xe57f('0x20')]],'as':_0x547a04['as'],'attributes':_0x547a04['attributes'],'include':_0x547a04[_0xe57f('0x1d')]?_['map'](_0x547a04['include'],function(_0x209680){return{'model':db[_0x209680[_0xe57f('0x20')]],'as':_0x209680['as'],'attributes':_0x209680[_0xe57f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe57f('0xd')](function(_0x10fb59){logger[_0xe57f('0xe')](_0xe57f('0x18'),_0xae5097);logger[_0xe57f('0x11')]('GetFreshdeskAccount',_0xae5097,JSON[_0xe57f('0x13')](_0x10fb59));_0x20ac23(_0x10fb59);})[_0xe57f('0x21')](function(_0x1f5e70){logger[_0xe57f('0x14')]('GetFreshdeskAccount',_0x1f5e70[_0xe57f('0x16')],_0xae5097);_0x20a882(_0x1fe730[_0xe57f('0x14')](0x1f4,_0x1f5e70[_0xe57f('0x16')]));});});};exports[_0xe57f('0x22')]=function(_0x1dfcc7){var _0x5f3a90=this;return new Promise(function(_0x110635,_0x36046b){return db[_0xe57f('0x19')]['find']({'raw':_0x1dfcc7[_0xe57f('0x1a')]?_0x1dfcc7['options'][_0xe57f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1dfcc7[_0xe57f('0x1a')]?_0x1dfcc7[_0xe57f('0x1a')][_0xe57f('0x23')]||null:null,'attributes':_0x1dfcc7[_0xe57f('0x1a')]?_0x1dfcc7['options'][_0xe57f('0x1f')]||null:null,'include':_0x1dfcc7[_0xe57f('0x1a')]?_0x1dfcc7['options']['include']?_['map'](_0x1dfcc7[_0xe57f('0x1a')][_0xe57f('0x1d')],function(_0x185ced){return{'model':db[_0x185ced[_0xe57f('0x20')]],'as':_0x185ced['as'],'attributes':_0x185ced[_0xe57f('0x1f')],'include':_0x185ced[_0xe57f('0x1d')]?_[_0xe57f('0x1e')](_0x185ced['include'],function(_0x551894){return{'model':db[_0x551894[_0xe57f('0x20')]],'as':_0x551894['as'],'attributes':_0x551894['attributes'],'include':_0x551894[_0xe57f('0x1d')]?_[_0xe57f('0x1e')](_0x551894[_0xe57f('0x1d')],function(_0x3801cc){return{'model':db[_0x3801cc[_0xe57f('0x20')]],'as':_0x3801cc['as'],'attributes':_0x3801cc[_0xe57f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe57f('0xd')](function(_0x43554e){logger[_0xe57f('0xe')](_0xe57f('0x22'),_0x1dfcc7);logger[_0xe57f('0x11')](_0xe57f('0x22'),_0x1dfcc7,JSON['stringify'](_0x43554e));_0x110635(_0x43554e);})[_0xe57f('0x21')](function(_0x1d47c3){logger[_0xe57f('0x14')](_0xe57f('0x22'),_0x1d47c3[_0xe57f('0x16')],_0x1dfcc7);_0x36046b(_0x5f3a90[_0xe57f('0x14')](0x1f4,_0x1d47c3[_0xe57f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c58f879..fb34cc6 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 _0x1653=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','update','delete','destroy','exports','multer'];(function(_0x48fa4e,_0x5705b3){var _0x10da1b=function(_0x43ee9a){while(--_0x43ee9a){_0x48fa4e['push'](_0x48fa4e['shift']());}};_0x10da1b(++_0x5705b3);}(_0x1653,0x9a));var _0x3165=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x1653[_0x112db5];return _0x1d7d06;};'use strict';var multer=require(_0x3165('0x0'));var util=require(_0x3165('0x1'));var path=require(_0x3165('0x2'));var timeout=require(_0x3165('0x3'));var express=require(_0x3165('0x4'));var router=express[_0x3165('0x5')]();var fs_extra=require(_0x3165('0x6'));var auth=require(_0x3165('0x7'));var interaction=require(_0x3165('0x8'));var config=require(_0x3165('0x9'));var controller=require(_0x3165('0xa'));router[_0x3165('0xb')]('/',auth[_0x3165('0xc')](),controller[_0x3165('0xd')]);router[_0x3165('0xb')](_0x3165('0xe'),auth[_0x3165('0xc')](),controller[_0x3165('0xf')]);router[_0x3165('0xb')](_0x3165('0x10'),auth[_0x3165('0xc')](),controller[_0x3165('0x11')]);router[_0x3165('0xb')](_0x3165('0x12'),auth[_0x3165('0xc')](),controller[_0x3165('0x13')]);router[_0x3165('0xb')](_0x3165('0x14'),auth[_0x3165('0xc')](),controller[_0x3165('0x15')]);router[_0x3165('0xb')]('/:id/tags',auth[_0x3165('0xc')](),controller[_0x3165('0x16')]);router[_0x3165('0x17')]('/',auth[_0x3165('0xc')](),controller[_0x3165('0x18')]);router[_0x3165('0x17')](_0x3165('0x19'),auth[_0x3165('0xc')](),controller[_0x3165('0x1a')]);router['put'](_0x3165('0xe'),auth[_0x3165('0xc')](),controller[_0x3165('0x1b')]);router[_0x3165('0x1c')](_0x3165('0xe'),auth[_0x3165('0xc')](),controller[_0x3165('0x1d')]);module[_0x3165('0x1e')]=router; \ No newline at end of file +var _0x9543=['create','setTags','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags'];(function(_0x5b6242,_0x2d1236){var _0x2978ea=function(_0x4fe0ea){while(--_0x4fe0ea){_0x5b6242['push'](_0x5b6242['shift']());}};_0x2978ea(++_0x2d1236);}(_0x9543,0x157));var _0x3954=function(_0x387090,_0x29be20){_0x387090=_0x387090-0x0;var _0x4c1a2d=_0x9543[_0x387090];return _0x4c1a2d;};'use strict';var multer=require('multer');var util=require(_0x3954('0x0'));var path=require('path');var timeout=require(_0x3954('0x1'));var express=require(_0x3954('0x2'));var router=express[_0x3954('0x3')]();var fs_extra=require(_0x3954('0x4'));var auth=require(_0x3954('0x5'));var interaction=require(_0x3954('0x6'));var config=require(_0x3954('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x3954('0x8')]('/',auth[_0x3954('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3954('0x8')](_0x3954('0xa'),auth['isAuthenticated'](),controller[_0x3954('0xb')]);router[_0x3954('0x8')](_0x3954('0xc'),auth[_0x3954('0x9')](),controller[_0x3954('0xd')]);router['get']('/:id/descriptions',auth[_0x3954('0x9')](),controller[_0x3954('0xe')]);router[_0x3954('0x8')](_0x3954('0xf'),auth[_0x3954('0x9')](),controller[_0x3954('0x10')]);router['post']('/',auth[_0x3954('0x9')](),controller[_0x3954('0x11')]);router['post'](_0x3954('0xf'),auth[_0x3954('0x9')](),controller[_0x3954('0x12')]);router[_0x3954('0x13')](_0x3954('0x14'),auth['isAuthenticated'](),controller[_0x3954('0x15')]);router['delete'](_0x3954('0x14'),auth['isAuthenticated'](),controller[_0x3954('0x16')]);module[_0x3954('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 5312ec1..1c7e9fd 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 _0x18bf=['STRING'];(function(_0x15b147,_0x784f7a){var _0x4923c1=function(_0x63996a){while(--_0x63996a){_0x15b147['push'](_0x15b147['shift']());}};_0x4923c1(++_0x784f7a);}(_0x18bf,0x1ec));var _0xf18b=function(_0x54aa3b,_0x1d3460){_0x54aa3b=_0x54aa3b-0x0;var _0x28efda=_0x18bf[_0x54aa3b];return _0x28efda;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf18b('0x0')]},'description':{'type':Sequelize[_0xf18b('0x0')]}}; \ No newline at end of file +var _0xf6c1=['exports','STRING','sequelize'];(function(_0x31c312,_0x3a5446){var _0x162fb9=function(_0x222857){while(--_0x222857){_0x31c312['push'](_0x31c312['shift']());}};_0x162fb9(++_0x3a5446);}(_0xf6c1,0x131));var _0x1f6c=function(_0x3ffde4,_0x2409c0){_0x3ffde4=_0x3ffde4-0x0;var _0x5b53ba=_0xf6c1[_0x3ffde4];return _0x5b53ba;};'use strict';var Sequelize=require(_0x1f6c('0x0'));module[_0x1f6c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1f6c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1f94308..4296cdc 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 _0x7310=['sort','pick','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','merge','create','body','find','destroy','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order'];(function(_0x32c4d5,_0x4c7736){var _0x3f2b2f=function(_0x1954d6){while(--_0x1954d6){_0x32c4d5['push'](_0x32c4d5['shift']());}};_0x3f2b2f(++_0x4c7736);}(_0x7310,0x1b3));var _0x0731=function(_0x3cc519,_0x2e9d79){_0x3cc519=_0x3cc519-0x0;var _0x4fb23c=_0x7310[_0x3cc519];return _0x4fb23c;};'use strict';var emlformat=require(_0x0731('0x0'));var rimraf=require(_0x0731('0x1'));var zipdir=require(_0x0731('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0731('0x3'));var moment=require(_0x0731('0x4'));var BPromise=require(_0x0731('0x5'));var Mustache=require(_0x0731('0x6'));var util=require(_0x0731('0x7'));var path=require('path');var sox=require(_0x0731('0x8'));var csv=require(_0x0731('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0731('0xa'));var _=require(_0x0731('0xb'));var squel=require('squel');var crypto=require(_0x0731('0xc'));var jsforce=require(_0x0731('0xd'));var deskjs=require(_0x0731('0xe'));var toCsv=require(_0x0731('0x9'));var querystring=require(_0x0731('0xf'));var Papa=require(_0x0731('0x10'));var Redis=require(_0x0731('0x11'));var authService=require(_0x0731('0x12'));var qs=require(_0x0731('0x13'));var as=require(_0x0731('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0731('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0731('0x16'));var db=require(_0x0731('0x17'))['db'];function respondWithStatusCode(_0x37b364,_0x29c630){_0x29c630=_0x29c630||0xcc;return function(_0x35035d){if(_0x35035d){return _0x37b364[_0x0731('0x18')](_0x29c630);}return _0x37b364[_0x0731('0x19')](_0x29c630)[_0x0731('0x1a')]();};}function respondWithResult(_0x25644a,_0x59e8cc){_0x59e8cc=_0x59e8cc||0xc8;return function(_0xf9ca2){if(_0xf9ca2){return _0x25644a[_0x0731('0x19')](_0x59e8cc)[_0x0731('0x1b')](_0xf9ca2);}};}function respondWithFilteredResult(_0xf70113,_0x466606){return function(_0x2837aa){if(_0x2837aa){var _0x22a3da=typeof _0x466606[_0x0731('0x1c')]===_0x0731('0x1d')&&typeof _0x466606[_0x0731('0x1e')]==='undefined';var _0x2f52a0=_0x2837aa[_0x0731('0x1f')];var _0x3800ea=_0x22a3da?0x0:_0x466606['offset'];var _0x470c4f=_0x22a3da?_0x2837aa[_0x0731('0x1f')]:_0x466606['offset']+_0x466606[_0x0731('0x1e')];var _0x11b5cd;if(_0x470c4f>=_0x2f52a0){_0x470c4f=_0x2f52a0;_0x11b5cd=0xc8;}else{_0x11b5cd=0xce;}_0xf70113[_0x0731('0x19')](_0x11b5cd);return _0xf70113['set'](_0x0731('0x20'),_0x3800ea+'-'+_0x470c4f+'/'+_0x2f52a0)[_0x0731('0x1b')](_0x2837aa);}return null;};}function patchUpdates(_0x186f12){return function(_0x3d6b79){try{jsonpatch[_0x0731('0x21')](_0x3d6b79,_0x186f12,!![]);}catch(_0x4394a2){return BPromise[_0x0731('0x22')](_0x4394a2);}return _0x3d6b79[_0x0731('0x23')]();};}function saveUpdates(_0x363cae,_0xc96f2d){return function(_0x44ccfa){if(_0x44ccfa){return _0x44ccfa[_0x0731('0x24')](_0x363cae)[_0x0731('0x25')](function(_0x5025c9){return _0x5025c9;});}return null;};}function removeEntity(_0x4280ea,_0x166c81){return function(_0xa8cfad){if(_0xa8cfad){return _0xa8cfad['destroy']()[_0x0731('0x25')](function(){_0x4280ea[_0x0731('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x391864,_0x479a2e){return function(_0xe03919){if(!_0xe03919){_0x391864[_0x0731('0x18')](0x194);}return _0xe03919;};}function handleError(_0xf49fad,_0x3fe9ef){_0x3fe9ef=_0x3fe9ef||0x1f4;return function(_0x12f87f){logger['error'](_0x12f87f[_0x0731('0x26')]);if(_0x12f87f[_0x0731('0x27')]){delete _0x12f87f[_0x0731('0x27')];}_0xf49fad[_0x0731('0x19')](_0x3fe9ef)['send'](_0x12f87f);};}exports[_0x0731('0x28')]=function(_0x17cba5,_0x1d26fa){var _0x52b8ef={},_0x4c7d15={},_0x2ef080={'count':0x0,'rows':[]};var _0x439445=_[_0x0731('0x29')](db[_0x0731('0x2a')][_0x0731('0x2b')],function(_0x264b33){return{'name':_0x264b33[_0x0731('0x2c')],'type':_0x264b33[_0x0731('0x2d')][_0x0731('0x2e')]};});_0x4c7d15['model']=_['map'](_0x439445,'name');_0x4c7d15[_0x0731('0x2f')]=_[_0x0731('0x30')](_0x17cba5['query']);_0x4c7d15[_0x0731('0x31')]=_[_0x0731('0x32')](_0x4c7d15['model'],_0x4c7d15['query']);_0x52b8ef[_0x0731('0x33')]=_['intersection'](_0x4c7d15['model'],qs[_0x0731('0x34')](_0x17cba5[_0x0731('0x2f')][_0x0731('0x34')]));_0x52b8ef[_0x0731('0x33')]=_0x52b8ef[_0x0731('0x33')][_0x0731('0x35')]?_0x52b8ef[_0x0731('0x33')]:_0x4c7d15[_0x0731('0x36')];if(!_0x17cba5['query'][_0x0731('0x37')]('nolimit')){_0x52b8ef[_0x0731('0x1e')]=qs[_0x0731('0x1e')](_0x17cba5[_0x0731('0x2f')]['limit']);_0x52b8ef[_0x0731('0x1c')]=qs[_0x0731('0x1c')](_0x17cba5[_0x0731('0x2f')]['offset']);}_0x52b8ef[_0x0731('0x38')]=qs[_0x0731('0x39')](_0x17cba5[_0x0731('0x2f')][_0x0731('0x39')]);_0x52b8ef['where']=qs[_0x0731('0x31')](_[_0x0731('0x3a')](_0x17cba5[_0x0731('0x2f')],_0x4c7d15[_0x0731('0x31')]),_0x439445);if(_0x17cba5['query']['filter']){_0x52b8ef[_0x0731('0x3b')]=_['merge'](_0x52b8ef['where'],{'$or':_['map'](_0x439445,function(_0x5b6eab){if(_0x5b6eab[_0x0731('0x2d')]!==_0x0731('0x3c')){var _0x4ed19a={};_0x4ed19a[_0x5b6eab['name']]={'$like':'%'+_0x17cba5[_0x0731('0x2f')][_0x0731('0x3d')]+'%'};return _0x4ed19a;}})});}_0x52b8ef=_['merge']({},_0x52b8ef,_0x17cba5[_0x0731('0x3e')]);var _0x555a15={'where':_0x52b8ef[_0x0731('0x3b')]};return db['FreshdeskConfiguration'][_0x0731('0x1f')](_0x555a15)[_0x0731('0x25')](function(_0x1fe3a7){_0x2ef080['count']=_0x1fe3a7;if(_0x17cba5['query'][_0x0731('0x3f')]){_0x52b8ef['include']=[{'all':!![]}];}return db[_0x0731('0x2a')][_0x0731('0x40')](_0x52b8ef);})['then'](function(_0x30db71){_0x2ef080['rows']=_0x30db71;return _0x2ef080;})[_0x0731('0x25')](respondWithFilteredResult(_0x1d26fa,_0x52b8ef))[_0x0731('0x41')](handleError(_0x1d26fa,null));};exports[_0x0731('0x42')]=function(_0x3ae80b,_0xfb1143){var _0x1f919a={'raw':![],'where':{'id':_0x3ae80b[_0x0731('0x43')]['id']}},_0x4a6f82={};_0x4a6f82[_0x0731('0x36')]=_[_0x0731('0x30')](db[_0x0731('0x2a')][_0x0731('0x2b')]);_0x4a6f82[_0x0731('0x2f')]=_[_0x0731('0x30')](_0x3ae80b['query']);_0x4a6f82[_0x0731('0x31')]=_[_0x0731('0x32')](_0x4a6f82[_0x0731('0x36')],_0x4a6f82[_0x0731('0x2f')]);_0x1f919a[_0x0731('0x33')]=_['intersection'](_0x4a6f82[_0x0731('0x36')],qs[_0x0731('0x34')](_0x3ae80b[_0x0731('0x2f')]['fields']));_0x1f919a[_0x0731('0x33')]=_0x1f919a['attributes'][_0x0731('0x35')]?_0x1f919a[_0x0731('0x33')]:_0x4a6f82[_0x0731('0x36')];if(_0x3ae80b[_0x0731('0x2f')]['includeAll']){_0x1f919a[_0x0731('0x44')]=[{'all':!![]}];}_0x1f919a=_[_0x0731('0x45')]({},_0x1f919a,_0x3ae80b['options']);return db[_0x0731('0x2a')]['find'](_0x1f919a)[_0x0731('0x25')](handleEntityNotFound(_0xfb1143,null))['then'](respondWithResult(_0xfb1143,null))['catch'](handleError(_0xfb1143,null));};exports[_0x0731('0x46')]=function(_0x14a57e,_0x4425d6){return db['FreshdeskConfiguration']['create'](_0x14a57e[_0x0731('0x47')],{})['then'](respondWithResult(_0x4425d6,0xc9))[_0x0731('0x41')](handleError(_0x4425d6,null));};exports['update']=function(_0x2d24aa,_0x3218dc){if(_0x2d24aa['body']['id']){delete _0x2d24aa[_0x0731('0x47')]['id'];}return db[_0x0731('0x2a')][_0x0731('0x48')]({'where':{'id':_0x2d24aa[_0x0731('0x43')]['id']}})[_0x0731('0x25')](handleEntityNotFound(_0x3218dc,null))[_0x0731('0x25')](saveUpdates(_0x2d24aa[_0x0731('0x47')],null))['then'](respondWithResult(_0x3218dc,null))['catch'](handleError(_0x3218dc,null));};exports[_0x0731('0x49')]=function(_0x196a6f,_0x3bc6d2){return db['FreshdeskConfiguration'][_0x0731('0x48')]({'where':{'id':_0x196a6f[_0x0731('0x43')]['id']}})[_0x0731('0x25')](handleEntityNotFound(_0x3bc6d2,null))[_0x0731('0x25')](removeEntity(_0x3bc6d2,null))[_0x0731('0x41')](handleError(_0x3bc6d2,null));};exports[_0x0731('0x4a')]=function(_0x53aad3,_0x3364b8,_0x4ee8ad){var _0x4d02f3={};var _0x24a04a={};var _0x3b7557;var _0x4f3933;return db['FreshdeskConfiguration'][_0x0731('0x4b')]({'where':{'id':_0x53aad3['params']['id']}})[_0x0731('0x25')](handleEntityNotFound(_0x3364b8,null))['then'](function(_0x1542a4){if(_0x1542a4){_0x3b7557=_0x1542a4;_0x24a04a[_0x0731('0x36')]=_[_0x0731('0x30')](db[_0x0731('0x4c')][_0x0731('0x2b')]);_0x24a04a[_0x0731('0x2f')]=_['keys'](_0x53aad3[_0x0731('0x2f')]);_0x24a04a[_0x0731('0x31')]=_[_0x0731('0x32')](_0x24a04a['model'],_0x24a04a[_0x0731('0x2f')]);_0x4d02f3[_0x0731('0x33')]=_[_0x0731('0x32')](_0x24a04a['model'],qs[_0x0731('0x34')](_0x53aad3['query']['fields']));_0x4d02f3[_0x0731('0x33')]=_0x4d02f3['attributes'][_0x0731('0x35')]?_0x4d02f3[_0x0731('0x33')]:_0x24a04a[_0x0731('0x36')];_0x4d02f3[_0x0731('0x38')]=qs[_0x0731('0x39')](_0x53aad3[_0x0731('0x2f')][_0x0731('0x39')]);_0x4d02f3[_0x0731('0x3b')]=qs[_0x0731('0x31')](_[_0x0731('0x3a')](_0x53aad3[_0x0731('0x2f')],_0x24a04a[_0x0731('0x31')]));if(_0x53aad3[_0x0731('0x2f')][_0x0731('0x3d')]){_0x4d02f3[_0x0731('0x3b')]=_[_0x0731('0x45')](_0x4d02f3[_0x0731('0x3b')],{'$or':_[_0x0731('0x29')](_0x4d02f3[_0x0731('0x33')],function(_0x2de98b){var _0x2f65f2={};_0x2f65f2[_0x2de98b]={'$like':'%'+_0x53aad3[_0x0731('0x2f')][_0x0731('0x3d')]+'%'};return _0x2f65f2;})});}_0x4d02f3=_['merge']({},_0x4d02f3,_0x53aad3[_0x0731('0x3e')]);return _0x3b7557[_0x0731('0x4a')](_0x4d02f3);}})[_0x0731('0x25')](function(_0x4d283a){if(_0x4d283a){_0x4f3933=_0x4d283a['length'];if(!_0x53aad3[_0x0731('0x2f')][_0x0731('0x37')](_0x0731('0x4d'))){_0x4d02f3['limit']=qs[_0x0731('0x1e')](_0x53aad3[_0x0731('0x2f')][_0x0731('0x1e')]);_0x4d02f3[_0x0731('0x1c')]=qs[_0x0731('0x1c')](_0x53aad3[_0x0731('0x2f')][_0x0731('0x1c')]);}return _0x3b7557[_0x0731('0x4a')](_0x4d02f3);}})[_0x0731('0x25')](function(_0x4ab5d5){if(_0x4ab5d5){return _0x4ab5d5?{'count':_0x4f3933,'rows':_0x4ab5d5}:null;}})[_0x0731('0x25')](respondWithResult(_0x3364b8,null))[_0x0731('0x41')](handleError(_0x3364b8,null));};exports[_0x0731('0x4e')]=function(_0x4dc4c1,_0x24961c,_0x26cf68){var _0x4bf64d={};var _0x29086={};var _0x300214;var _0x4664c7;return db[_0x0731('0x2a')][_0x0731('0x4b')]({'where':{'id':_0x4dc4c1[_0x0731('0x43')]['id']}})['then'](handleEntityNotFound(_0x24961c,null))[_0x0731('0x25')](function(_0x197aac){if(_0x197aac){_0x300214=_0x197aac;_0x29086[_0x0731('0x36')]=_['keys'](db[_0x0731('0x4c')][_0x0731('0x2b')]);_0x29086[_0x0731('0x2f')]=_[_0x0731('0x30')](_0x4dc4c1[_0x0731('0x2f')]);_0x29086[_0x0731('0x31')]=_[_0x0731('0x32')](_0x29086[_0x0731('0x36')],_0x29086[_0x0731('0x2f')]);_0x4bf64d[_0x0731('0x33')]=_[_0x0731('0x32')](_0x29086['model'],qs[_0x0731('0x34')](_0x4dc4c1[_0x0731('0x2f')][_0x0731('0x34')]));_0x4bf64d[_0x0731('0x33')]=_0x4bf64d[_0x0731('0x33')][_0x0731('0x35')]?_0x4bf64d[_0x0731('0x33')]:_0x29086[_0x0731('0x36')];_0x4bf64d['order']=qs[_0x0731('0x39')](_0x4dc4c1[_0x0731('0x2f')][_0x0731('0x39')]);_0x4bf64d[_0x0731('0x3b')]=qs[_0x0731('0x31')](_[_0x0731('0x3a')](_0x4dc4c1[_0x0731('0x2f')],_0x29086[_0x0731('0x31')]));if(_0x4dc4c1[_0x0731('0x2f')][_0x0731('0x3d')]){_0x4bf64d[_0x0731('0x3b')]=_[_0x0731('0x45')](_0x4bf64d['where'],{'$or':_[_0x0731('0x29')](_0x4bf64d['attributes'],function(_0x5df65b){var _0xea0fad={};_0xea0fad[_0x5df65b]={'$like':'%'+_0x4dc4c1[_0x0731('0x2f')][_0x0731('0x3d')]+'%'};return _0xea0fad;})});}_0x4bf64d=_[_0x0731('0x45')]({},_0x4bf64d,_0x4dc4c1['options']);return _0x300214[_0x0731('0x4e')](_0x4bf64d);}})[_0x0731('0x25')](function(_0x26c4fe){if(_0x26c4fe){_0x4664c7=_0x26c4fe['length'];if(!_0x4dc4c1[_0x0731('0x2f')]['hasOwnProperty'](_0x0731('0x4d'))){_0x4bf64d[_0x0731('0x1e')]=qs[_0x0731('0x1e')](_0x4dc4c1[_0x0731('0x2f')]['limit']);_0x4bf64d[_0x0731('0x1c')]=qs['offset'](_0x4dc4c1[_0x0731('0x2f')][_0x0731('0x1c')]);}return _0x300214[_0x0731('0x4e')](_0x4bf64d);}})[_0x0731('0x25')](function(_0x24a60b){if(_0x24a60b){return _0x24a60b?{'count':_0x4664c7,'rows':_0x24a60b}:null;}})[_0x0731('0x25')](respondWithResult(_0x24961c,null))[_0x0731('0x41')](handleError(_0x24961c,null));};exports[_0x0731('0x4f')]=function(_0x1c6ed5,_0x4898ce,_0x18e7ee){var _0x2ca096={};var _0x493015={};var _0x13f26b;var _0x114b64;return db['FreshdeskConfiguration'][_0x0731('0x4b')]({'where':{'id':_0x1c6ed5['params']['id']}})[_0x0731('0x25')](handleEntityNotFound(_0x4898ce,null))[_0x0731('0x25')](function(_0x26598c){if(_0x26598c){_0x13f26b=_0x26598c;_0x493015[_0x0731('0x36')]=_[_0x0731('0x30')](db[_0x0731('0x4c')][_0x0731('0x2b')]);_0x493015[_0x0731('0x2f')]=_[_0x0731('0x30')](_0x1c6ed5['query']);_0x493015[_0x0731('0x31')]=_[_0x0731('0x32')](_0x493015[_0x0731('0x36')],_0x493015['query']);_0x2ca096[_0x0731('0x33')]=_[_0x0731('0x32')](_0x493015['model'],qs[_0x0731('0x34')](_0x1c6ed5[_0x0731('0x2f')][_0x0731('0x34')]));_0x2ca096[_0x0731('0x33')]=_0x2ca096[_0x0731('0x33')][_0x0731('0x35')]?_0x2ca096[_0x0731('0x33')]:_0x493015[_0x0731('0x36')];_0x2ca096['order']=qs['sort'](_0x1c6ed5[_0x0731('0x2f')]['sort']);_0x2ca096[_0x0731('0x3b')]=qs[_0x0731('0x31')](_[_0x0731('0x3a')](_0x1c6ed5[_0x0731('0x2f')],_0x493015[_0x0731('0x31')]));if(_0x1c6ed5[_0x0731('0x2f')][_0x0731('0x3d')]){_0x2ca096[_0x0731('0x3b')]=_[_0x0731('0x45')](_0x2ca096['where'],{'$or':_['map'](_0x2ca096['attributes'],function(_0x4a63c6){var _0x51ca51={};_0x51ca51[_0x4a63c6]={'$like':'%'+_0x1c6ed5[_0x0731('0x2f')][_0x0731('0x3d')]+'%'};return _0x51ca51;})});}_0x2ca096=_[_0x0731('0x45')]({},_0x2ca096,_0x1c6ed5[_0x0731('0x3e')]);return _0x13f26b[_0x0731('0x4f')](_0x2ca096);}})[_0x0731('0x25')](function(_0x47c063){if(_0x47c063){_0x114b64=_0x47c063[_0x0731('0x35')];if(!_0x1c6ed5[_0x0731('0x2f')]['hasOwnProperty'](_0x0731('0x4d'))){_0x2ca096[_0x0731('0x1e')]=qs[_0x0731('0x1e')](_0x1c6ed5['query']['limit']);_0x2ca096[_0x0731('0x1c')]=qs['offset'](_0x1c6ed5[_0x0731('0x2f')][_0x0731('0x1c')]);}return _0x13f26b[_0x0731('0x4f')](_0x2ca096);}})[_0x0731('0x25')](function(_0x1b3acd){if(_0x1b3acd){return _0x1b3acd?{'count':_0x114b64,'rows':_0x1b3acd}:null;}})[_0x0731('0x25')](respondWithResult(_0x4898ce,null))[_0x0731('0x41')](handleError(_0x4898ce,null));};exports[_0x0731('0x50')]=function(_0xd267ea,_0xa7fa2b,_0x37399f){var _0x11acac={};var _0x5cda21={};var _0x516ebb;var _0x72a006;return db[_0x0731('0x2a')][_0x0731('0x4b')]({'where':{'id':_0xd267ea[_0x0731('0x43')]['id']}})[_0x0731('0x25')](handleEntityNotFound(_0xa7fa2b,null))[_0x0731('0x25')](function(_0x47fc8d){if(_0x47fc8d){_0x516ebb=_0x47fc8d;_0x5cda21['model']=_['keys'](db['Tag'][_0x0731('0x2b')]);_0x5cda21[_0x0731('0x2f')]=_[_0x0731('0x30')](_0xd267ea[_0x0731('0x2f')]);_0x5cda21['filters']=_[_0x0731('0x32')](_0x5cda21['model'],_0x5cda21[_0x0731('0x2f')]);_0x11acac['attributes']=_[_0x0731('0x32')](_0x5cda21[_0x0731('0x36')],qs[_0x0731('0x34')](_0xd267ea[_0x0731('0x2f')][_0x0731('0x34')]));_0x11acac['attributes']=_0x11acac[_0x0731('0x33')]['length']?_0x11acac['attributes']:_0x5cda21[_0x0731('0x36')];_0x11acac[_0x0731('0x38')]=qs[_0x0731('0x39')](_0xd267ea[_0x0731('0x2f')][_0x0731('0x39')]);_0x11acac[_0x0731('0x3b')]=qs['filters'](_[_0x0731('0x3a')](_0xd267ea[_0x0731('0x2f')],_0x5cda21[_0x0731('0x31')]));if(_0xd267ea[_0x0731('0x2f')][_0x0731('0x3d')]){_0x11acac['where']=_[_0x0731('0x45')](_0x11acac[_0x0731('0x3b')],{'$or':_[_0x0731('0x29')](_0x11acac['attributes'],function(_0x48e45b){var _0x2f4080={};_0x2f4080[_0x48e45b]={'$like':'%'+_0xd267ea[_0x0731('0x2f')][_0x0731('0x3d')]+'%'};return _0x2f4080;})});}_0x11acac=_['merge']({},_0x11acac,_0xd267ea['options']);return _0x516ebb[_0x0731('0x50')](_0x11acac);}})[_0x0731('0x25')](function(_0x353917){if(_0x353917){_0x72a006=_0x353917[_0x0731('0x35')];if(!_0xd267ea[_0x0731('0x2f')]['hasOwnProperty'](_0x0731('0x4d'))){_0x11acac[_0x0731('0x1e')]=qs[_0x0731('0x1e')](_0xd267ea[_0x0731('0x2f')][_0x0731('0x1e')]);_0x11acac[_0x0731('0x1c')]=qs[_0x0731('0x1c')](_0xd267ea[_0x0731('0x2f')]['offset']);}return _0x516ebb[_0x0731('0x50')](_0x11acac);}})[_0x0731('0x25')](function(_0x146709){if(_0x146709){return _0x146709?{'count':_0x72a006,'rows':_0x146709}:null;}})['then'](respondWithResult(_0xa7fa2b,null))['catch'](handleError(_0xa7fa2b,null));};exports[_0x0731('0x51')]=function(_0x5e5157,_0x70a94,_0x4652d2){if(_0x5e5157['body']['id']){delete _0x5e5157[_0x0731('0x47')]['id'];}return db[_0x0731('0x2a')]['findOne']({'where':{'id':_0x5e5157['params']['id']}})[_0x0731('0x25')](handleEntityNotFound(_0x70a94,null))['then'](function(_0x1e61cc){if(_0x1e61cc){return _0x1e61cc[_0x0731('0x51')](_0x5e5157['body']['ids']||[]);}return null;})[_0x0731('0x25')](respondWithResult(_0x70a94,null))[_0x0731('0x41')](handleError(_0x70a94,null));}; \ No newline at end of file +var _0x29b3=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','pick','getSubjects','FreshdeskField','findOne','getDescriptions','getTags','Tag','nolimit','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x29b3,0x1e6));var _0x329b=function(_0x4e1b5d,_0xa82e8f){_0x4e1b5d=_0x4e1b5d-0x0;var _0xb963eb=_0x29b3[_0x4e1b5d];return _0xb963eb;};'use strict';var emlformat=require(_0x329b('0x0'));var rimraf=require(_0x329b('0x1'));var zipdir=require(_0x329b('0x2'));var jsonpatch=require(_0x329b('0x3'));var rp=require('request-promise');var moment=require(_0x329b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x329b('0x5'));var util=require(_0x329b('0x6'));var path=require('path');var sox=require(_0x329b('0x7'));var csv=require(_0x329b('0x8'));var ejs=require(_0x329b('0x9'));var fs=require('fs');var fs_extra=require(_0x329b('0xa'));var _=require(_0x329b('0xb'));var squel=require(_0x329b('0xc'));var crypto=require(_0x329b('0xd'));var jsforce=require(_0x329b('0xe'));var deskjs=require(_0x329b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x329b('0x10'));var Papa=require(_0x329b('0x11'));var Redis=require(_0x329b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x329b('0x13'));var as=require(_0x329b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x329b('0x15'))(_0x329b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x329b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196c5a,_0x5c63d9){_0x5c63d9=_0x5c63d9||0xcc;return function(_0x46d24c){if(_0x46d24c){return _0x196c5a[_0x329b('0x18')](_0x5c63d9);}return _0x196c5a[_0x329b('0x19')](_0x5c63d9)[_0x329b('0x1a')]();};}function respondWithResult(_0x348317,_0x5d298d){_0x5d298d=_0x5d298d||0xc8;return function(_0x5d1820){if(_0x5d1820){return _0x348317['status'](_0x5d298d)[_0x329b('0x1b')](_0x5d1820);}};}function respondWithFilteredResult(_0x43f3ff,_0xb7a0e7){return function(_0x29a399){if(_0x29a399){var _0x5431fe=typeof _0xb7a0e7[_0x329b('0x1c')]===_0x329b('0x1d')&&typeof _0xb7a0e7['limit']==='undefined';var _0x42fd9f=_0x29a399[_0x329b('0x1e')];var _0x2cde18=_0x5431fe?0x0:_0xb7a0e7['offset'];var _0xb7156=_0x5431fe?_0x29a399[_0x329b('0x1e')]:_0xb7a0e7['offset']+_0xb7a0e7['limit'];var _0x4448a8;if(_0xb7156>=_0x42fd9f){_0xb7156=_0x42fd9f;_0x4448a8=0xc8;}else{_0x4448a8=0xce;}_0x43f3ff[_0x329b('0x19')](_0x4448a8);return _0x43f3ff[_0x329b('0x1f')](_0x329b('0x20'),_0x2cde18+'-'+_0xb7156+'/'+_0x42fd9f)['json'](_0x29a399);}return null;};}function patchUpdates(_0x14b1bc){return function(_0x32ce81){try{jsonpatch[_0x329b('0x21')](_0x32ce81,_0x14b1bc,!![]);}catch(_0x5bd040){return BPromise[_0x329b('0x22')](_0x5bd040);}return _0x32ce81[_0x329b('0x23')]();};}function saveUpdates(_0x2d1791,_0x535b16){return function(_0x11117a){if(_0x11117a){return _0x11117a[_0x329b('0x24')](_0x2d1791)[_0x329b('0x25')](function(_0x3ae578){return _0x3ae578;});}return null;};}function removeEntity(_0x4b1620,_0x111bf3){return function(_0x1b503f){if(_0x1b503f){return _0x1b503f[_0x329b('0x26')]()[_0x329b('0x25')](function(){_0x4b1620[_0x329b('0x19')](0xcc)[_0x329b('0x1a')]();});}};}function handleEntityNotFound(_0xef085e,_0x24297c){return function(_0x49a12e){if(!_0x49a12e){_0xef085e['sendStatus'](0x194);}return _0x49a12e;};}function handleError(_0x5214f2,_0x2dd5c4){_0x2dd5c4=_0x2dd5c4||0x1f4;return function(_0x46ed58){logger['error'](_0x46ed58['stack']);if(_0x46ed58[_0x329b('0x27')]){delete _0x46ed58[_0x329b('0x27')];}_0x5214f2[_0x329b('0x19')](_0x2dd5c4)[_0x329b('0x28')](_0x46ed58);};}exports[_0x329b('0x29')]=function(_0x30f8cf,_0x4fff09){var _0x1f64af={},_0x2f4fbd={},_0x284ce5={'count':0x0,'rows':[]};var _0xf5cd2b=_[_0x329b('0x2a')](db['FreshdeskConfiguration'][_0x329b('0x2b')],function(_0x282090){return{'name':_0x282090[_0x329b('0x2c')],'type':_0x282090[_0x329b('0x2d')][_0x329b('0x2e')]};});_0x2f4fbd[_0x329b('0x2f')]=_[_0x329b('0x2a')](_0xf5cd2b,'name');_0x2f4fbd[_0x329b('0x30')]=_[_0x329b('0x31')](_0x30f8cf[_0x329b('0x30')]);_0x2f4fbd[_0x329b('0x32')]=_[_0x329b('0x33')](_0x2f4fbd[_0x329b('0x2f')],_0x2f4fbd['query']);_0x1f64af[_0x329b('0x34')]=_['intersection'](_0x2f4fbd[_0x329b('0x2f')],qs[_0x329b('0x35')](_0x30f8cf['query'][_0x329b('0x35')]));_0x1f64af['attributes']=_0x1f64af[_0x329b('0x34')][_0x329b('0x36')]?_0x1f64af[_0x329b('0x34')]:_0x2f4fbd[_0x329b('0x2f')];if(!_0x30f8cf[_0x329b('0x30')][_0x329b('0x37')]('nolimit')){_0x1f64af[_0x329b('0x38')]=qs['limit'](_0x30f8cf[_0x329b('0x30')]['limit']);_0x1f64af['offset']=qs[_0x329b('0x1c')](_0x30f8cf[_0x329b('0x30')][_0x329b('0x1c')]);}_0x1f64af[_0x329b('0x39')]=qs['sort'](_0x30f8cf['query'][_0x329b('0x3a')]);_0x1f64af[_0x329b('0x3b')]=qs[_0x329b('0x32')](_['pick'](_0x30f8cf['query'],_0x2f4fbd[_0x329b('0x32')]),_0xf5cd2b);if(_0x30f8cf[_0x329b('0x30')][_0x329b('0x3c')]){_0x1f64af['where']=_['merge'](_0x1f64af['where'],{'$or':_[_0x329b('0x2a')](_0xf5cd2b,function(_0x425ea5){if(_0x425ea5['type']!==_0x329b('0x3d')){var _0x179f6f={};_0x179f6f[_0x425ea5[_0x329b('0x27')]]={'$like':'%'+_0x30f8cf[_0x329b('0x30')][_0x329b('0x3c')]+'%'};return _0x179f6f;}})});}_0x1f64af=_[_0x329b('0x3e')]({},_0x1f64af,_0x30f8cf[_0x329b('0x3f')]);var _0x5a3f22={'where':_0x1f64af[_0x329b('0x3b')]};return db[_0x329b('0x40')][_0x329b('0x1e')](_0x5a3f22)['then'](function(_0x97d000){_0x284ce5[_0x329b('0x1e')]=_0x97d000;if(_0x30f8cf[_0x329b('0x30')][_0x329b('0x41')]){_0x1f64af[_0x329b('0x42')]=[{'all':!![]}];}return db[_0x329b('0x40')][_0x329b('0x43')](_0x1f64af);})[_0x329b('0x25')](function(_0x234c12){_0x284ce5['rows']=_0x234c12;return _0x284ce5;})[_0x329b('0x25')](respondWithFilteredResult(_0x4fff09,_0x1f64af))[_0x329b('0x44')](handleError(_0x4fff09,null));};exports[_0x329b('0x45')]=function(_0x40837c,_0x2b6772){var _0x256236={'raw':![],'where':{'id':_0x40837c[_0x329b('0x46')]['id']}},_0x25146f={};_0x25146f['model']=_[_0x329b('0x31')](db[_0x329b('0x40')][_0x329b('0x2b')]);_0x25146f[_0x329b('0x30')]=_[_0x329b('0x31')](_0x40837c[_0x329b('0x30')]);_0x25146f[_0x329b('0x32')]=_['intersection'](_0x25146f[_0x329b('0x2f')],_0x25146f[_0x329b('0x30')]);_0x256236[_0x329b('0x34')]=_[_0x329b('0x33')](_0x25146f[_0x329b('0x2f')],qs[_0x329b('0x35')](_0x40837c[_0x329b('0x30')][_0x329b('0x35')]));_0x256236['attributes']=_0x256236[_0x329b('0x34')]['length']?_0x256236[_0x329b('0x34')]:_0x25146f[_0x329b('0x2f')];if(_0x40837c[_0x329b('0x30')]['includeAll']){_0x256236[_0x329b('0x42')]=[{'all':!![]}];}_0x256236=_[_0x329b('0x3e')]({},_0x256236,_0x40837c[_0x329b('0x3f')]);return db['FreshdeskConfiguration'][_0x329b('0x47')](_0x256236)[_0x329b('0x25')](handleEntityNotFound(_0x2b6772,null))[_0x329b('0x25')](respondWithResult(_0x2b6772,null))[_0x329b('0x44')](handleError(_0x2b6772,null));};exports[_0x329b('0x48')]=function(_0x4b32bb,_0x45bd6b){return db[_0x329b('0x40')][_0x329b('0x48')](_0x4b32bb[_0x329b('0x49')],{})['then'](respondWithResult(_0x45bd6b,0xc9))[_0x329b('0x44')](handleError(_0x45bd6b,null));};exports[_0x329b('0x24')]=function(_0x3b97cb,_0x4e931d){if(_0x3b97cb[_0x329b('0x49')]['id']){delete _0x3b97cb['body']['id'];}return db[_0x329b('0x40')][_0x329b('0x47')]({'where':{'id':_0x3b97cb[_0x329b('0x46')]['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x4e931d,null))[_0x329b('0x25')](saveUpdates(_0x3b97cb[_0x329b('0x49')],null))['then'](respondWithResult(_0x4e931d,null))[_0x329b('0x44')](handleError(_0x4e931d,null));};exports[_0x329b('0x26')]=function(_0x13cd58,_0x4c886a){return db[_0x329b('0x40')]['find']({'where':{'id':_0x13cd58[_0x329b('0x46')]['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x4c886a,null))['then'](removeEntity(_0x4c886a,null))[_0x329b('0x44')](handleError(_0x4c886a,null));};exports[_0x329b('0x4a')]=function(_0x41275c,_0x8d7bb5,_0x3aadf4){var _0x1ead4e={};var _0x5b5ecd={};var _0x1ac3ea;var _0x487459;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x41275c[_0x329b('0x46')]['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x8d7bb5,null))['then'](function(_0x163a42){if(_0x163a42){_0x1ac3ea=_0x163a42;_0x5b5ecd['model']=_[_0x329b('0x31')](db['FreshdeskField']['rawAttributes']);_0x5b5ecd['query']=_[_0x329b('0x31')](_0x41275c[_0x329b('0x30')]);_0x5b5ecd['filters']=_[_0x329b('0x33')](_0x5b5ecd[_0x329b('0x2f')],_0x5b5ecd[_0x329b('0x30')]);_0x1ead4e[_0x329b('0x34')]=_[_0x329b('0x33')](_0x5b5ecd[_0x329b('0x2f')],qs[_0x329b('0x35')](_0x41275c[_0x329b('0x30')][_0x329b('0x35')]));_0x1ead4e[_0x329b('0x34')]=_0x1ead4e[_0x329b('0x34')][_0x329b('0x36')]?_0x1ead4e[_0x329b('0x34')]:_0x5b5ecd[_0x329b('0x2f')];_0x1ead4e[_0x329b('0x39')]=qs['sort'](_0x41275c[_0x329b('0x30')][_0x329b('0x3a')]);_0x1ead4e[_0x329b('0x3b')]=qs[_0x329b('0x32')](_[_0x329b('0x4b')](_0x41275c[_0x329b('0x30')],_0x5b5ecd[_0x329b('0x32')]));if(_0x41275c[_0x329b('0x30')][_0x329b('0x3c')]){_0x1ead4e[_0x329b('0x3b')]=_[_0x329b('0x3e')](_0x1ead4e['where'],{'$or':_[_0x329b('0x2a')](_0x1ead4e[_0x329b('0x34')],function(_0x460628){var _0x2fc64b={};_0x2fc64b[_0x460628]={'$like':'%'+_0x41275c[_0x329b('0x30')][_0x329b('0x3c')]+'%'};return _0x2fc64b;})});}_0x1ead4e=_[_0x329b('0x3e')]({},_0x1ead4e,_0x41275c[_0x329b('0x3f')]);return _0x1ac3ea[_0x329b('0x4a')](_0x1ead4e);}})[_0x329b('0x25')](function(_0xdbf835){if(_0xdbf835){_0x487459=_0xdbf835[_0x329b('0x36')];if(!_0x41275c[_0x329b('0x30')][_0x329b('0x37')]('nolimit')){_0x1ead4e[_0x329b('0x38')]=qs['limit'](_0x41275c[_0x329b('0x30')][_0x329b('0x38')]);_0x1ead4e['offset']=qs[_0x329b('0x1c')](_0x41275c[_0x329b('0x30')]['offset']);}return _0x1ac3ea[_0x329b('0x4a')](_0x1ead4e);}})[_0x329b('0x25')](function(_0x38156a){if(_0x38156a){return _0x38156a?{'count':_0x487459,'rows':_0x38156a}:null;}})[_0x329b('0x25')](respondWithResult(_0x8d7bb5,null))['catch'](handleError(_0x8d7bb5,null));};exports[_0x329b('0x4c')]=function(_0x39d299,_0x543de8,_0x24fd37){var _0x58782f={};var _0x5b2371={};var _0x1b11e8;var _0x403a2c;return db[_0x329b('0x40')]['findOne']({'where':{'id':_0x39d299[_0x329b('0x46')]['id']}})['then'](handleEntityNotFound(_0x543de8,null))[_0x329b('0x25')](function(_0x3c76c0){if(_0x3c76c0){_0x1b11e8=_0x3c76c0;_0x5b2371['model']=_[_0x329b('0x31')](db[_0x329b('0x4d')]['rawAttributes']);_0x5b2371[_0x329b('0x30')]=_['keys'](_0x39d299['query']);_0x5b2371[_0x329b('0x32')]=_[_0x329b('0x33')](_0x5b2371['model'],_0x5b2371['query']);_0x58782f[_0x329b('0x34')]=_[_0x329b('0x33')](_0x5b2371[_0x329b('0x2f')],qs[_0x329b('0x35')](_0x39d299['query'][_0x329b('0x35')]));_0x58782f[_0x329b('0x34')]=_0x58782f[_0x329b('0x34')][_0x329b('0x36')]?_0x58782f[_0x329b('0x34')]:_0x5b2371[_0x329b('0x2f')];_0x58782f['order']=qs[_0x329b('0x3a')](_0x39d299[_0x329b('0x30')]['sort']);_0x58782f[_0x329b('0x3b')]=qs[_0x329b('0x32')](_[_0x329b('0x4b')](_0x39d299[_0x329b('0x30')],_0x5b2371['filters']));if(_0x39d299['query'][_0x329b('0x3c')]){_0x58782f[_0x329b('0x3b')]=_['merge'](_0x58782f['where'],{'$or':_[_0x329b('0x2a')](_0x58782f[_0x329b('0x34')],function(_0x40e22e){var _0x31e46e={};_0x31e46e[_0x40e22e]={'$like':'%'+_0x39d299['query'][_0x329b('0x3c')]+'%'};return _0x31e46e;})});}_0x58782f=_['merge']({},_0x58782f,_0x39d299['options']);return _0x1b11e8[_0x329b('0x4c')](_0x58782f);}})['then'](function(_0x2026a8){if(_0x2026a8){_0x403a2c=_0x2026a8['length'];if(!_0x39d299['query'][_0x329b('0x37')]('nolimit')){_0x58782f['limit']=qs[_0x329b('0x38')](_0x39d299[_0x329b('0x30')][_0x329b('0x38')]);_0x58782f[_0x329b('0x1c')]=qs['offset'](_0x39d299[_0x329b('0x30')][_0x329b('0x1c')]);}return _0x1b11e8[_0x329b('0x4c')](_0x58782f);}})[_0x329b('0x25')](function(_0x52252a){if(_0x52252a){return _0x52252a?{'count':_0x403a2c,'rows':_0x52252a}:null;}})['then'](respondWithResult(_0x543de8,null))[_0x329b('0x44')](handleError(_0x543de8,null));};exports['getDescriptions']=function(_0x387964,_0x3e20c9,_0x2333e7){var _0x14f038={};var _0x3f3d6a={};var _0x5a20a7;var _0x18561b;return db[_0x329b('0x40')][_0x329b('0x4e')]({'where':{'id':_0x387964[_0x329b('0x46')]['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x3e20c9,null))['then'](function(_0x3c5e0b){if(_0x3c5e0b){_0x5a20a7=_0x3c5e0b;_0x3f3d6a[_0x329b('0x2f')]=_[_0x329b('0x31')](db[_0x329b('0x4d')]['rawAttributes']);_0x3f3d6a[_0x329b('0x30')]=_[_0x329b('0x31')](_0x387964[_0x329b('0x30')]);_0x3f3d6a[_0x329b('0x32')]=_[_0x329b('0x33')](_0x3f3d6a['model'],_0x3f3d6a[_0x329b('0x30')]);_0x14f038[_0x329b('0x34')]=_[_0x329b('0x33')](_0x3f3d6a['model'],qs[_0x329b('0x35')](_0x387964[_0x329b('0x30')][_0x329b('0x35')]));_0x14f038[_0x329b('0x34')]=_0x14f038[_0x329b('0x34')][_0x329b('0x36')]?_0x14f038[_0x329b('0x34')]:_0x3f3d6a[_0x329b('0x2f')];_0x14f038[_0x329b('0x39')]=qs[_0x329b('0x3a')](_0x387964[_0x329b('0x30')][_0x329b('0x3a')]);_0x14f038[_0x329b('0x3b')]=qs['filters'](_['pick'](_0x387964[_0x329b('0x30')],_0x3f3d6a['filters']));if(_0x387964[_0x329b('0x30')][_0x329b('0x3c')]){_0x14f038[_0x329b('0x3b')]=_['merge'](_0x14f038[_0x329b('0x3b')],{'$or':_[_0x329b('0x2a')](_0x14f038[_0x329b('0x34')],function(_0x5ab223){var _0x2c998f={};_0x2c998f[_0x5ab223]={'$like':'%'+_0x387964['query'][_0x329b('0x3c')]+'%'};return _0x2c998f;})});}_0x14f038=_[_0x329b('0x3e')]({},_0x14f038,_0x387964['options']);return _0x5a20a7['getDescriptions'](_0x14f038);}})[_0x329b('0x25')](function(_0xef9693){if(_0xef9693){_0x18561b=_0xef9693[_0x329b('0x36')];if(!_0x387964['query'][_0x329b('0x37')]('nolimit')){_0x14f038[_0x329b('0x38')]=qs[_0x329b('0x38')](_0x387964['query'][_0x329b('0x38')]);_0x14f038[_0x329b('0x1c')]=qs[_0x329b('0x1c')](_0x387964['query'][_0x329b('0x1c')]);}return _0x5a20a7[_0x329b('0x4f')](_0x14f038);}})[_0x329b('0x25')](function(_0x596baa){if(_0x596baa){return _0x596baa?{'count':_0x18561b,'rows':_0x596baa}:null;}})['then'](respondWithResult(_0x3e20c9,null))[_0x329b('0x44')](handleError(_0x3e20c9,null));};exports[_0x329b('0x50')]=function(_0x7f78ab,_0x7ad923,_0x593dd1){var _0x3e1e54={};var _0x50572e={};var _0x15cf07;var _0x4a432e;return db[_0x329b('0x40')]['findOne']({'where':{'id':_0x7f78ab[_0x329b('0x46')]['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x7ad923,null))['then'](function(_0x42f746){if(_0x42f746){_0x15cf07=_0x42f746;_0x50572e[_0x329b('0x2f')]=_[_0x329b('0x31')](db[_0x329b('0x51')][_0x329b('0x2b')]);_0x50572e['query']=_[_0x329b('0x31')](_0x7f78ab[_0x329b('0x30')]);_0x50572e[_0x329b('0x32')]=_['intersection'](_0x50572e[_0x329b('0x2f')],_0x50572e[_0x329b('0x30')]);_0x3e1e54[_0x329b('0x34')]=_[_0x329b('0x33')](_0x50572e[_0x329b('0x2f')],qs[_0x329b('0x35')](_0x7f78ab[_0x329b('0x30')]['fields']));_0x3e1e54['attributes']=_0x3e1e54['attributes'][_0x329b('0x36')]?_0x3e1e54[_0x329b('0x34')]:_0x50572e['model'];_0x3e1e54[_0x329b('0x39')]=qs[_0x329b('0x3a')](_0x7f78ab[_0x329b('0x30')][_0x329b('0x3a')]);_0x3e1e54['where']=qs[_0x329b('0x32')](_[_0x329b('0x4b')](_0x7f78ab['query'],_0x50572e[_0x329b('0x32')]));if(_0x7f78ab[_0x329b('0x30')]['filter']){_0x3e1e54['where']=_['merge'](_0x3e1e54['where'],{'$or':_['map'](_0x3e1e54[_0x329b('0x34')],function(_0x259839){var _0x25b31d={};_0x25b31d[_0x259839]={'$like':'%'+_0x7f78ab[_0x329b('0x30')][_0x329b('0x3c')]+'%'};return _0x25b31d;})});}_0x3e1e54=_['merge']({},_0x3e1e54,_0x7f78ab[_0x329b('0x3f')]);return _0x15cf07['getTags'](_0x3e1e54);}})[_0x329b('0x25')](function(_0x22a4e3){if(_0x22a4e3){_0x4a432e=_0x22a4e3['length'];if(!_0x7f78ab[_0x329b('0x30')][_0x329b('0x37')](_0x329b('0x52'))){_0x3e1e54[_0x329b('0x38')]=qs[_0x329b('0x38')](_0x7f78ab[_0x329b('0x30')][_0x329b('0x38')]);_0x3e1e54['offset']=qs[_0x329b('0x1c')](_0x7f78ab[_0x329b('0x30')][_0x329b('0x1c')]);}return _0x15cf07[_0x329b('0x50')](_0x3e1e54);}})[_0x329b('0x25')](function(_0x5a54b5){if(_0x5a54b5){return _0x5a54b5?{'count':_0x4a432e,'rows':_0x5a54b5}:null;}})['then'](respondWithResult(_0x7ad923,null))['catch'](handleError(_0x7ad923,null));};exports[_0x329b('0x53')]=function(_0x48cbf5,_0x486bff,_0x331576){if(_0x48cbf5[_0x329b('0x49')]['id']){delete _0x48cbf5[_0x329b('0x49')]['id'];}return db[_0x329b('0x40')][_0x329b('0x4e')]({'where':{'id':_0x48cbf5['params']['id']}})[_0x329b('0x25')](handleEntityNotFound(_0x486bff,null))['then'](function(_0x2149b1){if(_0x2149b1){return _0x2149b1[_0x329b('0x53')](_0x48cbf5['body'][_0x329b('0x54')]||[]);}return null;})['then'](respondWithResult(_0x486bff,null))[_0x329b('0x44')](handleError(_0x486bff,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9b27d0f..4a0f303 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 _0xb860=['exports','define','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x431ef5,_0x347a89){var _0xc1231e=function(_0xb8142a){while(--_0xb8142a){_0x431ef5['push'](_0x431ef5['shift']());}};_0xc1231e(++_0x347a89);}(_0xb860,0x1b1));var _0x0b86=function(_0x4c403d,_0x5ef49f){_0x4c403d=_0x4c403d-0x0;var _0x5a0c35=_0xb860[_0x4c403d];return _0x5a0c35;};'use strict';var _=require(_0x0b86('0x0'));var util=require('util');var logger=require(_0x0b86('0x1'))('api');var moment=require(_0x0b86('0x2'));var BPromise=require(_0x0b86('0x3'));var rp=require(_0x0b86('0x4'));var fs=require('fs');var path=require(_0x0b86('0x5'));var rimraf=require('rimraf');var config=require(_0x0b86('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x0b86('0x7')]=function(_0x43a6b2,_0x5d624a){return _0x43a6b2[_0x0b86('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0x0b86('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63da=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x5cb8ba,_0x87365d){var _0x4770f1=function(_0x4b425a){while(--_0x4b425a){_0x5cb8ba['push'](_0x5cb8ba['shift']());}};_0x4770f1(++_0x87365d);}(_0x63da,0x1bc));var _0xa63d=function(_0x9e76d,_0x44e7a0){_0x9e76d=_0x9e76d-0x0;var _0x320985=_0x63da[_0x9e76d];return _0x320985;};'use strict';var _=require(_0xa63d('0x0'));var util=require(_0xa63d('0x1'));var logger=require(_0xa63d('0x2'))(_0xa63d('0x3'));var moment=require(_0xa63d('0x4'));var BPromise=require(_0xa63d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa63d('0x6'));var rimraf=require(_0xa63d('0x7'));var config=require(_0xa63d('0x8'));var attributes=require(_0xa63d('0x9'));module[_0xa63d('0xa')]=function(_0x1502fd,_0x22b0de){return _0x1502fd[_0xa63d('0xb')](_0xa63d('0xc'),attributes,{'tableName':_0xa63d('0xd'),'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 b88fb08..f9fdfda 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 _0xc008=['request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x90828,_0x1dd62c){var _0x4a74b0=function(_0x13769b){while(--_0x13769b){_0x90828['push'](_0x90828['shift']());}};_0x4a74b0(++_0x1dd62c);}(_0xc008,0x1ec));var _0x8c00=function(_0x356630,_0x8d6c56){_0x356630=_0x356630-0x0;var _0x575b3b=_0xc008[_0x356630];return _0x575b3b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c00('0x0'));var BPromise=require(_0x8c00('0x1'));var rs=require(_0x8c00('0x2'));var fs=require('fs');var Redis=require(_0x8c00('0x3'));var db=require(_0x8c00('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c00('0x5'))(_0x8c00('0x6'));var config=require(_0x8c00('0x7'));var jayson=require(_0x8c00('0x8'));var client=jayson[_0x8c00('0x9')][_0x8c00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c062f,_0x5c93ae,_0x1474fc){return new BPromise(function(_0x5de60d,_0x564e94){return client[_0x8c00('0xb')](_0x5c062f,_0x1474fc)['then'](function(_0x563a5a){logger[_0x8c00('0xc')](_0x8c00('0xd'),_0x5c93ae,_0x8c00('0xe'));logger[_0x8c00('0xf')](_0x8c00('0x10'),_0x5c93ae,'request\x20sent',JSON[_0x8c00('0x11')](_0x563a5a));if(_0x563a5a[_0x8c00('0x12')]){if(_0x563a5a['error']['code']===0x1f4){logger[_0x8c00('0x12')](_0x8c00('0xd'),_0x5c93ae,_0x563a5a[_0x8c00('0x12')][_0x8c00('0x13')]);return _0x564e94(_0x563a5a['error'][_0x8c00('0x13')]);}logger[_0x8c00('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c93ae,_0x563a5a[_0x8c00('0x12')]['message']);return _0x5de60d(_0x563a5a[_0x8c00('0x12')]['message']);}else{logger[_0x8c00('0xc')](_0x8c00('0xd'),_0x5c93ae,_0x8c00('0xe'));_0x5de60d(_0x563a5a[_0x8c00('0x14')][_0x8c00('0x13')]);}})[_0x8c00('0x15')](function(_0x3e3ffb){logger['error'](_0x8c00('0xd'),_0x5c93ae,_0x3e3ffb);_0x564e94(_0x3e3ffb);});});} \ No newline at end of file +var _0xf64f=['rpc','../../config/environment','client','request','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b1a41,_0x37fdba){var _0x2ef3b7=function(_0x4ee4e0){while(--_0x4ee4e0){_0x1b1a41['push'](_0x1b1a41['shift']());}};_0x2ef3b7(++_0x37fdba);}(_0xf64f,0x108));var _0xff64=function(_0x249a38,_0x1eec4c){_0x249a38=_0x249a38-0x0;var _0x5cd471=_0xf64f[_0x249a38];return _0x5cd471;};'use strict';var _=require(_0xff64('0x0'));var util=require(_0xff64('0x1'));var moment=require(_0xff64('0x2'));var BPromise=require(_0xff64('0x3'));var rs=require(_0xff64('0x4'));var fs=require('fs');var Redis=require(_0xff64('0x5'));var db=require(_0xff64('0x6'))['db'];var utils=require(_0xff64('0x7'));var logger=require(_0xff64('0x8'))(_0xff64('0x9'));var config=require(_0xff64('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xff64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22a25c,_0x47ddc1,_0x5d2027){return new BPromise(function(_0x49c17a,_0x2cc4ec){return client[_0xff64('0xc')](_0x22a25c,_0x5d2027)['then'](function(_0x5ada73){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x47ddc1,'request\x20sent');logger['debug'](_0xff64('0xd'),_0x47ddc1,_0xff64('0xe'),JSON[_0xff64('0xf')](_0x5ada73));if(_0x5ada73['error']){if(_0x5ada73[_0xff64('0x10')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x47ddc1,_0x5ada73[_0xff64('0x10')][_0xff64('0x11')]);return _0x2cc4ec(_0x5ada73[_0xff64('0x10')][_0xff64('0x11')]);}logger[_0xff64('0x10')](_0xff64('0x12'),_0x47ddc1,_0x5ada73[_0xff64('0x10')][_0xff64('0x11')]);return _0x49c17a(_0x5ada73[_0xff64('0x10')]['message']);}else{logger['info'](_0xff64('0x12'),_0x47ddc1,_0xff64('0xe'));_0x49c17a(_0x5ada73[_0xff64('0x13')][_0xff64('0x11')]);}})[_0xff64('0x14')](function(_0x165a84){logger[_0xff64('0x10')](_0xff64('0x12'),_0x47ddc1,_0x165a84);_0x2cc4ec(_0x165a84);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d307403..3bff7b4 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 _0x179c=['./intFreshdeskField.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a3324,_0x2d8316){var _0x5b1a7f=function(_0x4e47fc){while(--_0x4e47fc){_0x2a3324['push'](_0x2a3324['shift']());}};_0x5b1a7f(++_0x2d8316);}(_0x179c,0xfc));var _0xc179=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x179c[_0x4017b0];return _0x5ed4f7;};'use strict';var multer=require(_0xc179('0x0'));var util=require(_0xc179('0x1'));var path=require(_0xc179('0x2'));var timeout=require(_0xc179('0x3'));var express=require(_0xc179('0x4'));var router=express[_0xc179('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc179('0x6'));var interaction=require(_0xc179('0x7'));var config=require('../../config/environment');var controller=require(_0xc179('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc179('0x9')](_0xc179('0xa'),auth[_0xc179('0xb')](),controller[_0xc179('0xc')]);router[_0xc179('0xd')]('/',auth[_0xc179('0xb')](),controller[_0xc179('0xe')]);router[_0xc179('0xf')]('/:id',auth[_0xc179('0xb')](),controller[_0xc179('0x10')]);router[_0xc179('0x11')]('/:id',auth[_0xc179('0xb')](),controller[_0xc179('0x12')]);module[_0xc179('0x13')]=router; \ No newline at end of file +var _0xc7bf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','multer','util','path'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xc7bf,0x95));var _0xfc7b=function(_0x3c78d8,_0x40372b){_0x3c78d8=_0x3c78d8-0x0;var _0x5935d4=_0xc7bf[_0x3c78d8];return _0x5935d4;};'use strict';var multer=require(_0xfc7b('0x0'));var util=require(_0xfc7b('0x1'));var path=require(_0xfc7b('0x2'));var timeout=require(_0xfc7b('0x3'));var express=require(_0xfc7b('0x4'));var router=express[_0xfc7b('0x5')]();var fs_extra=require(_0xfc7b('0x6'));var auth=require(_0xfc7b('0x7'));var interaction=require(_0xfc7b('0x8'));var config=require(_0xfc7b('0x9'));var controller=require(_0xfc7b('0xa'));router[_0xfc7b('0xb')]('/',auth[_0xfc7b('0xc')](),controller['index']);router[_0xfc7b('0xb')](_0xfc7b('0xd'),auth['isAuthenticated'](),controller[_0xfc7b('0xe')]);router[_0xfc7b('0xf')]('/',auth[_0xfc7b('0xc')](),controller[_0xfc7b('0x10')]);router[_0xfc7b('0x11')](_0xfc7b('0xd'),auth[_0xfc7b('0xc')](),controller[_0xfc7b('0x12')]);router['delete'](_0xfc7b('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index a94823d..fd53148 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 _0x2cc2=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x159eab,_0x22d972){var _0x47e933=function(_0x58e802){while(--_0x58e802){_0x159eab['push'](_0x159eab['shift']());}};_0x47e933(++_0x22d972);}(_0x2cc2,0x15f));var _0x22cc=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x2cc2[_0x21c09f];return _0x164d58;};'use strict';var Sequelize=require(_0x22cc('0x0'));module[_0x22cc('0x1')]={'type':{'type':Sequelize[_0x22cc('0x2')](_0x22cc('0x3'),_0x22cc('0x4'),'customVariable',_0x22cc('0x5'),_0x22cc('0x6')),'defaultValue':_0x22cc('0x3')},'content':{'type':Sequelize[_0x22cc('0x7')]},'key':{'type':Sequelize[_0x22cc('0x7')]},'keyType':{'type':Sequelize[_0x22cc('0x2')](_0x22cc('0x3'),_0x22cc('0x4'),_0x22cc('0x8'))},'keyContent':{'type':Sequelize[_0x22cc('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x22cc('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x22cc('0x7')]}}; \ No newline at end of file +var _0x025c=['picklist','string','STRING','exports','ENUM','variable','customVariable','keyValue'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x025c,0x1d3));var _0xc025=function(_0x41df91,_0x533c02){_0x41df91=_0x41df91-0x0;var _0x12de3d=_0x025c[_0x41df91];return _0x12de3d;};'use strict';var Sequelize=require('sequelize');module[_0xc025('0x0')]={'type':{'type':Sequelize[_0xc025('0x1')]('string',_0xc025('0x2'),_0xc025('0x3'),_0xc025('0x4'),_0xc025('0x5')),'defaultValue':_0xc025('0x6')},'content':{'type':Sequelize[_0xc025('0x7')]},'key':{'type':Sequelize[_0xc025('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc025('0x6'),_0xc025('0x2'),_0xc025('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc025('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc025('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 445c3de..8a3c4cf 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 _0x3c81=['apply','reject','save','update','then','destroy','end','error','name','send','map','FreshdeskField','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c81,0x102));var _0x13c8=function(_0x2a6e0e,_0x3e5da2){_0x2a6e0e=_0x2a6e0e-0x0;var _0x4f11c0=_0x3c81[_0x2a6e0e];return _0x4f11c0;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x28')]();});}};}function handleEntityNotFound(_0x4aff35,_0x47e8ae){return function(_0x5ad0dc){if(!_0x5ad0dc){_0x4aff35[_0x13c8('0x19')](0x194);}return _0x5ad0dc;};}function handleError(_0xc7f1b6,_0x53ada9){_0x53ada9=_0x53ada9||0x1f4;return function(_0x4df077){logger[_0x13c8('0x29')](_0x4df077['stack']);if(_0x4df077['name']){delete _0x4df077[_0x13c8('0x2a')];}_0xc7f1b6[_0x13c8('0x1a')](_0x53ada9)[_0x13c8('0x2b')](_0x4df077);};}exports['index']=function(_0x5ef2f7,_0x277a89){var _0x1071a0={},_0x399840={},_0x441182={'count':0x0,'rows':[]};var _0x138017=_[_0x13c8('0x2c')](db[_0x13c8('0x2d')]['rawAttributes'],function(_0x109cb8){return{'name':_0x109cb8[_0x13c8('0x2e')],'type':_0x109cb8['type']['key']};});_0x399840[_0x13c8('0x2f')]=_[_0x13c8('0x2c')](_0x138017,'name');_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x31')](_0x5ef2f7['query']);_0x399840[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],_0x399840[_0x13c8('0x30')]);_0x1071a0[_0x13c8('0x34')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x5ef2f7['query']['fields']));_0x1071a0[_0x13c8('0x34')]=_0x1071a0[_0x13c8('0x34')]['length']?_0x1071a0[_0x13c8('0x34')]:_0x399840['model'];if(!_0x5ef2f7[_0x13c8('0x30')]['hasOwnProperty'](_0x13c8('0x36'))){_0x1071a0[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x1d')]);_0x1071a0[_0x13c8('0x1c')]=qs[_0x13c8('0x1c')](_0x5ef2f7['query'][_0x13c8('0x1c')]);}_0x1071a0[_0x13c8('0x37')]=qs['sort'](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x38')]);_0x1071a0[_0x13c8('0x39')]=qs['filters'](_['pick'](_0x5ef2f7['query'],_0x399840[_0x13c8('0x32')]),_0x138017);if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]){_0x1071a0[_0x13c8('0x39')]=_[_0x13c8('0x3b')](_0x1071a0[_0x13c8('0x39')],{'$or':_[_0x13c8('0x2c')](_0x138017,function(_0xe19858){if(_0xe19858[_0x13c8('0x3c')]!=='VIRTUAL'){var _0x5b2a28={};_0x5b2a28[_0xe19858[_0x13c8('0x2a')]]={'$like':'%'+_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]+'%'};return _0x5b2a28;}})});}_0x1071a0=_[_0x13c8('0x3b')]({},_0x1071a0,_0x5ef2f7['options']);var _0x35e1e7={'where':_0x1071a0['where']};return db[_0x13c8('0x2d')][_0x13c8('0x1f')](_0x35e1e7)[_0x13c8('0x26')](function(_0x1cd02c){_0x441182[_0x13c8('0x1f')]=_0x1cd02c;if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3d')]){_0x1071a0[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x2d')][_0x13c8('0x3f')](_0x1071a0);})[_0x13c8('0x26')](function(_0x416169){_0x441182[_0x13c8('0x40')]=_0x416169;return _0x441182;})[_0x13c8('0x26')](respondWithFilteredResult(_0x277a89,_0x1071a0))[_0x13c8('0x41')](handleError(_0x277a89,null));};exports[_0x13c8('0x42')]=function(_0x1b2ada,_0x1505fb){var _0xc5eb86={'raw':!![],'where':{'id':_0x1b2ada[_0x13c8('0x43')]['id']}},_0x1cff99={};_0x1cff99[_0x13c8('0x2f')]=_[_0x13c8('0x31')](db[_0x13c8('0x2d')][_0x13c8('0x44')]);_0x1cff99['query']=_[_0x13c8('0x31')](_0x1b2ada[_0x13c8('0x30')]);_0x1cff99[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],_0x1cff99['query']);_0xc5eb86['attributes']=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x1b2ada['query']['fields']));_0xc5eb86['attributes']=_0xc5eb86[_0x13c8('0x34')]['length']?_0xc5eb86[_0x13c8('0x34')]:_0x1cff99['model'];if(_0x1b2ada[_0x13c8('0x30')][_0x13c8('0x3d')]){_0xc5eb86[_0x13c8('0x3e')]=[{'all':!![]}];}_0xc5eb86=_[_0x13c8('0x3b')]({},_0xc5eb86,_0x1b2ada[_0x13c8('0x45')]);return db[_0x13c8('0x2d')]['find'](_0xc5eb86)[_0x13c8('0x26')](handleEntityNotFound(_0x1505fb,null))[_0x13c8('0x26')](respondWithResult(_0x1505fb,null))['catch'](handleError(_0x1505fb,null));};exports[_0x13c8('0x46')]=function(_0x26155d,_0x2e925f){return db[_0x13c8('0x2d')][_0x13c8('0x46')](_0x26155d['body'],{})[_0x13c8('0x26')](respondWithResult(_0x2e925f,0xc9))[_0x13c8('0x41')](handleError(_0x2e925f,null));};exports[_0x13c8('0x25')]=function(_0x38418b,_0x185d18){if(_0x38418b['body']['id']){delete _0x38418b[_0x13c8('0x47')]['id'];}return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x38418b[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x185d18,null))[_0x13c8('0x26')](saveUpdates(_0x38418b[_0x13c8('0x47')],null))[_0x13c8('0x26')](respondWithResult(_0x185d18,null))[_0x13c8('0x41')](handleError(_0x185d18,null));};exports[_0x13c8('0x27')]=function(_0x266f4e,_0x5e1fe5){return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x266f4e[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x5e1fe5,null))[_0x13c8('0x26')](removeEntity(_0x5e1fe5,null))[_0x13c8('0x41')](handleError(_0x5e1fe5,null));}; \ No newline at end of file +var _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0xad95,0x70));var _0x5ad9=function(_0x1562cc,_0x3f0df1){_0x1562cc=_0x1562cc-0x0;var _0x547b27=_0xad95[_0x1562cc];return _0x547b27;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2542937..99b9ff2 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 _0xb66c=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xb66c,0x175));var _0xcb66=function(_0x27542d,_0x4db65e){_0x27542d=_0x27542d-0x0;var _0x7b45e3=_0xb66c[_0x27542d];return _0x7b45e3;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[{'name':_0xcb66('0xc'),'fields':[_0xcb66('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78cc=['path','rimraf','../../config/environment','FreshdeskField','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x78cc,0x11c));var _0xc78c=function(_0x420223,_0x3e8768){_0x420223=_0x420223-0x0;var _0x2c744a=_0x78cc[_0x420223];return _0x2c744a;};'use strict';var _=require(_0xc78c('0x0'));var util=require('util');var logger=require(_0xc78c('0x1'))(_0xc78c('0x2'));var moment=require(_0xc78c('0x3'));var BPromise=require(_0xc78c('0x4'));var rp=require(_0xc78c('0x5'));var fs=require('fs');var path=require(_0xc78c('0x6'));var rimraf=require(_0xc78c('0x7'));var config=require(_0xc78c('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x5c884b,_0x204b56){return _0x5c884b['define'](_0xc78c('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'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 88cc1b6..0f64489 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 _0x9c5e=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x36a8da,_0x5a255e){_0x36a8da=_0x36a8da-0x0;var _0x5cd6a1=_0x9c5e[_0x36a8da];return _0x5cd6a1;};'use strict';var _=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var moment=require(_0xe9c5('0x2'));var BPromise=require(_0xe9c5('0x3'));var rs=require(_0xe9c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9c5('0x5'))(_0xe9c5('0x6'));var config=require('../../config/environment');var jayson=require(_0xe9c5('0x7'));var client=jayson[_0xe9c5('0x8')][_0xe9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6f6045,_0x5b1c04,_0x2fa290){return new BPromise(function(_0x34ee69,_0x228ef3){return client[_0xe9c5('0xa')](_0x6f6045,_0x2fa290)['then'](function(_0x596f4c){logger[_0xe9c5('0xb')](_0xe9c5('0xc'),_0x5b1c04,_0xe9c5('0xd'));logger[_0xe9c5('0xe')](_0xe9c5('0xf'),_0x5b1c04,_0xe9c5('0xd'),JSON[_0xe9c5('0x10')](_0x596f4c));if(_0x596f4c[_0xe9c5('0x11')]){if(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x12')]===0x1f4){logger[_0xe9c5('0x11')](_0xe9c5('0xc'),_0x5b1c04,_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);return _0x228ef3(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);}logger['error'](_0xe9c5('0xc'),_0x5b1c04,_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);return _0x34ee69(_0x596f4c[_0xe9c5('0x11')][_0xe9c5('0x13')]);}else{logger[_0xe9c5('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x5b1c04,_0xe9c5('0xd'));_0x34ee69(_0x596f4c[_0xe9c5('0x14')]['message']);}})[_0xe9c5('0x15')](function(_0x45d18d){logger[_0xe9c5('0x11')](_0xe9c5('0xc'),_0x5b1c04,_0x45d18d);_0x228ef3(_0x45d18d);});});} \ No newline at end of file +var _0xf571=['moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','FreshdeskField,\x20%s,\x20%s','message'];(function(_0x354f8c,_0x28cd59){var _0xb467ff=function(_0x522033){while(--_0x522033){_0x354f8c['push'](_0x354f8c['shift']());}};_0xb467ff(++_0x28cd59);}(_0xf571,0xaa));var _0x1f57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf571[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f57('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f57('0x1'));var db=require(_0x1f57('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f57('0x3'))('rpc');var config=require(_0x1f57('0x4'));var jayson=require(_0x1f57('0x5'));var client=jayson[_0x1f57('0x6')][_0x1f57('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2aa8f5,_0x3fc3d0,_0x38eac9){return new BPromise(function(_0x44bf7a,_0x4df89f){return client[_0x1f57('0x8')](_0x2aa8f5,_0x38eac9)[_0x1f57('0x9')](function(_0x3807f0){logger[_0x1f57('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x3fc3d0,_0x1f57('0xb'));logger['debug'](_0x1f57('0xc'),_0x3fc3d0,_0x1f57('0xb'),JSON['stringify'](_0x3807f0));if(_0x3807f0[_0x1f57('0xd')]){if(_0x3807f0[_0x1f57('0xd')][_0x1f57('0xe')]===0x1f4){logger['error'](_0x1f57('0xf'),_0x3fc3d0,_0x3807f0[_0x1f57('0xd')][_0x1f57('0x10')]);return _0x4df89f(_0x3807f0[_0x1f57('0xd')][_0x1f57('0x10')]);}logger[_0x1f57('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x3fc3d0,_0x3807f0['error']['message']);return _0x44bf7a(_0x3807f0[_0x1f57('0xd')]['message']);}else{logger[_0x1f57('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x3fc3d0,'request\x20sent');_0x44bf7a(_0x3807f0['result']['message']);}})['catch'](function(_0x4cdccd){logger['error'](_0x1f57('0xf'),_0x3fc3d0,_0x4cdccd);_0x4df89f(_0x4cdccd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 13e9385..7968c48 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(_0x21ccd7,_0x1a4fa6){_0x21ccd7=_0x21ccd7-0x0;var _0x462b03=_0x878f[_0x21ccd7];return _0x462b03;};'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 _0x9354=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x1f0b16,_0x47d18f){var _0x553d97=function(_0x4a3bcf){while(--_0x4a3bcf){_0x1f0b16['push'](_0x1f0b16['shift']());}};_0x553d97(++_0x47d18f);}(_0x9354,0x96));var _0x4935=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x9354[_0x1283d4];return _0x433643;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4935('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x15')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);module[_0x4935('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 725f448..28877b6 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0x4dee39,_0x47d1bf){var _0x269804=function(_0x598231){while(--_0x598231){_0x4dee39['push'](_0x4dee39['shift']());}};_0x269804(++_0x47d1bf);}(_0x7880,0x1f4));var _0x0788=function(_0x2abd13,_0x501317){_0x2abd13=_0x2abd13-0x0;var _0x5ad645=_0x7880[_0x2abd13];return _0x5ad645;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8aad=['STRING','username','sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8aad,0x146));var _0xd8aa=function(_0x2fac4d,_0x523212){_0x2fac4d=_0x2fac4d-0x0;var _0x1951b2=_0x8aad[_0x2fac4d];return _0x1951b2;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x3')},'apiKey':{'type':Sequelize[_0xd8aa('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd8aa('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 3d608e9..3e0b8ee 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 _0x122e=['format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET'];(function(_0x1e04f2,_0x4c41ce){var _0x5439ac=function(_0x272e40){while(--_0x272e40){_0x1e04f2['push'](_0x1e04f2['shift']());}};_0x5439ac(++_0x4c41ce);}(_0x122e,0x14f));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe122('0x0'));var rimraf=require(_0xe122('0x1'));var zipdir=require(_0xe122('0x2'));var jsonpatch=require(_0xe122('0x3'));var rp=require(_0xe122('0x4'));var moment=require(_0xe122('0x5'));var BPromise=require(_0xe122('0x6'));var Mustache=require(_0xe122('0x7'));var util=require('util');var path=require(_0xe122('0x8'));var sox=require('sox');var csv=require(_0xe122('0x9'));var ejs=require(_0xe122('0xa'));var fs=require('fs');var fs_extra=require(_0xe122('0xb'));var _=require(_0xe122('0xc'));var squel=require(_0xe122('0xd'));var crypto=require(_0xe122('0xe'));var jsforce=require(_0xe122('0xf'));var deskjs=require(_0xe122('0x10'));var toCsv=require(_0xe122('0x9'));var querystring=require(_0xe122('0x11'));var Papa=require(_0xe122('0x12'));var Redis=require(_0xe122('0x13'));var authService=require(_0xe122('0x14'));var qs=require(_0xe122('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe122('0x16'));var logger=require(_0xe122('0x17'))(_0xe122('0x18'));var utils=require(_0xe122('0x19'));var config=require(_0xe122('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe122('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x57fd17,_0xf4a1cc){_0xf4a1cc=_0xf4a1cc||0xcc;return function(_0x845d44){if(_0x845d44){return _0x57fd17[_0xe122('0x1c')](_0xf4a1cc);}return _0x57fd17[_0xe122('0x1d')](_0xf4a1cc)[_0xe122('0x1e')]();};}function respondWithResult(_0x2528eb,_0x198f5d){_0x198f5d=_0x198f5d||0xc8;return function(_0x3b3bda){if(_0x3b3bda){return _0x2528eb['status'](_0x198f5d)[_0xe122('0x1f')](_0x3b3bda);}};}function respondWithFilteredResult(_0x2048ae,_0x58bbc7){return function(_0x10afdc){if(_0x10afdc){var _0x18383c=typeof _0x58bbc7[_0xe122('0x20')]===_0xe122('0x21')&&typeof _0x58bbc7[_0xe122('0x22')]==='undefined';var _0x514ddd=_0x10afdc['count'];var _0x3eb3e9=_0x18383c?0x0:_0x58bbc7[_0xe122('0x20')];var _0x1961e4=_0x18383c?_0x10afdc['count']:_0x58bbc7[_0xe122('0x20')]+_0x58bbc7[_0xe122('0x22')];var _0x1d62aa;if(_0x1961e4>=_0x514ddd){_0x1961e4=_0x514ddd;_0x1d62aa=0xc8;}else{_0x1d62aa=0xce;}_0x2048ae[_0xe122('0x1d')](_0x1d62aa);return _0x2048ae[_0xe122('0x23')]('Content-Range',_0x3eb3e9+'-'+_0x1961e4+'/'+_0x514ddd)['json'](_0x10afdc);}return null;};}function patchUpdates(_0x569313){return function(_0x4e0481){try{jsonpatch[_0xe122('0x24')](_0x4e0481,_0x569313,!![]);}catch(_0x587458){return BPromise[_0xe122('0x25')](_0x587458);}return _0x4e0481[_0xe122('0x26')]();};}function saveUpdates(_0x232583,_0x558bf0){return function(_0x2c7168){if(_0x2c7168){return _0x2c7168[_0xe122('0x27')](_0x232583)['then'](function(_0x1ad5f3){return _0x1ad5f3;});}return null;};}function removeEntity(_0x53bcc,_0xab3029){return function(_0x4c9500){if(_0x4c9500){return _0x4c9500[_0xe122('0x28')]()[_0xe122('0x29')](function(){_0x53bcc[_0xe122('0x1d')](0xcc)[_0xe122('0x1e')]();});}};}function handleEntityNotFound(_0x2b696c,_0x39de9f){return function(_0xf9142a){if(!_0xf9142a){_0x2b696c[_0xe122('0x1c')](0x194);}return _0xf9142a;};}function handleError(_0x523cf8,_0x1b0baf){_0x1b0baf=_0x1b0baf||0x1f4;return function(_0x49000d){logger['error'](_0x49000d[_0xe122('0x2a')]);if(_0x49000d[_0xe122('0x2b')]){delete _0x49000d['name'];}_0x523cf8['status'](_0x1b0baf)[_0xe122('0x2c')](_0x49000d);};}exports[_0xe122('0x2d')]=function(_0x47ad4d,_0x1e2351){var _0x5d43db={},_0x5ace7c={},_0x442e03={'count':0x0,'rows':[]};var _0x30b26d=_[_0xe122('0x2e')](db[_0xe122('0x2f')][_0xe122('0x30')],function(_0x2a1bcf){return{'name':_0x2a1bcf['fieldName'],'type':_0x2a1bcf[_0xe122('0x31')][_0xe122('0x32')]};});_0x5ace7c[_0xe122('0x33')]=_[_0xe122('0x2e')](_0x30b26d,_0xe122('0x2b'));_0x5ace7c[_0xe122('0x34')]=_[_0xe122('0x35')](_0x47ad4d[_0xe122('0x34')]);_0x5ace7c[_0xe122('0x36')]=_[_0xe122('0x37')](_0x5ace7c[_0xe122('0x33')],_0x5ace7c['query']);_0x5d43db[_0xe122('0x38')]=_['intersection'](_0x5ace7c[_0xe122('0x33')],qs['fields'](_0x47ad4d['query']['fields']));_0x5d43db['attributes']=_0x5d43db[_0xe122('0x38')][_0xe122('0x39')]?_0x5d43db[_0xe122('0x38')]:_0x5ace7c[_0xe122('0x33')];if(!_0x47ad4d[_0xe122('0x34')]['hasOwnProperty']('nolimit')){_0x5d43db['limit']=qs[_0xe122('0x22')](_0x47ad4d[_0xe122('0x34')][_0xe122('0x22')]);_0x5d43db[_0xe122('0x20')]=qs['offset'](_0x47ad4d['query']['offset']);}_0x5d43db[_0xe122('0x3a')]=qs['sort'](_0x47ad4d[_0xe122('0x34')][_0xe122('0x3b')]);_0x5d43db[_0xe122('0x3c')]=qs[_0xe122('0x36')](_['pick'](_0x47ad4d[_0xe122('0x34')],_0x5ace7c[_0xe122('0x36')]),_0x30b26d);if(_0x47ad4d[_0xe122('0x34')]['filter']){_0x5d43db[_0xe122('0x3c')]=_[_0xe122('0x3d')](_0x5d43db[_0xe122('0x3c')],{'$or':_['map'](_0x30b26d,function(_0x22f1f5){if(_0x22f1f5[_0xe122('0x31')]!=='VIRTUAL'){var _0xdd3355={};_0xdd3355[_0x22f1f5[_0xe122('0x2b')]]={'$like':'%'+_0x47ad4d[_0xe122('0x34')][_0xe122('0x3e')]+'%'};return _0xdd3355;}})});}_0x5d43db=_['merge']({},_0x5d43db,_0x47ad4d[_0xe122('0x3f')]);var _0x9fb45={'where':_0x5d43db[_0xe122('0x3c')]};return db['FreshsalesAccount'][_0xe122('0x40')](_0x9fb45)[_0xe122('0x29')](function(_0x42d6b4){_0x442e03[_0xe122('0x40')]=_0x42d6b4;if(_0x47ad4d['query'][_0xe122('0x41')]){_0x5d43db[_0xe122('0x42')]=[{'all':!![]}];}return db[_0xe122('0x2f')][_0xe122('0x43')](_0x5d43db);})[_0xe122('0x29')](function(_0x2137c1){_0x442e03[_0xe122('0x44')]=_0x2137c1;return _0x442e03;})[_0xe122('0x29')](respondWithFilteredResult(_0x1e2351,_0x5d43db))[_0xe122('0x45')](handleError(_0x1e2351,null));};exports[_0xe122('0x46')]=function(_0x59588d,_0x1ef75a){var _0x58d3e2={'raw':![],'where':{'id':_0x59588d[_0xe122('0x47')]['id']}},_0x144473={};_0x144473[_0xe122('0x33')]=_[_0xe122('0x35')](db['FreshsalesAccount'][_0xe122('0x30')]);_0x144473[_0xe122('0x34')]=_['keys'](_0x59588d[_0xe122('0x34')]);_0x144473[_0xe122('0x36')]=_[_0xe122('0x37')](_0x144473['model'],_0x144473[_0xe122('0x34')]);_0x58d3e2['attributes']=_['intersection'](_0x144473[_0xe122('0x33')],qs[_0xe122('0x48')](_0x59588d[_0xe122('0x34')][_0xe122('0x48')]));_0x58d3e2[_0xe122('0x38')]=_0x58d3e2['attributes'][_0xe122('0x39')]?_0x58d3e2[_0xe122('0x38')]:_0x144473[_0xe122('0x33')];if(_0x59588d[_0xe122('0x34')][_0xe122('0x41')]){_0x58d3e2['include']=[{'all':!![]}];}_0x58d3e2=_[_0xe122('0x3d')]({},_0x58d3e2,_0x59588d['options']);return db[_0xe122('0x2f')][_0xe122('0x49')](_0x58d3e2)[_0xe122('0x29')](handleEntityNotFound(_0x1ef75a,null))[_0xe122('0x29')](respondWithResult(_0x1ef75a,null))[_0xe122('0x45')](handleError(_0x1ef75a,null));};exports[_0xe122('0x4a')]=function(_0x55a0e0,_0x170fcb){return db[_0xe122('0x2f')][_0xe122('0x4a')](_0x55a0e0[_0xe122('0x4b')],{})[_0xe122('0x29')](respondWithResult(_0x170fcb,0xc9))[_0xe122('0x45')](handleError(_0x170fcb,null));};exports[_0xe122('0x27')]=function(_0x5bad18,_0x2b5f24){if(_0x5bad18[_0xe122('0x4b')]['id']){delete _0x5bad18[_0xe122('0x4b')]['id'];}return db[_0xe122('0x2f')][_0xe122('0x49')]({'where':{'id':_0x5bad18[_0xe122('0x47')]['id']}})[_0xe122('0x29')](handleEntityNotFound(_0x2b5f24,null))[_0xe122('0x29')](saveUpdates(_0x5bad18[_0xe122('0x4b')],null))[_0xe122('0x29')](respondWithResult(_0x2b5f24,null))[_0xe122('0x45')](handleError(_0x2b5f24,null));};exports[_0xe122('0x28')]=function(_0xbab216,_0x45dd95){return db[_0xe122('0x2f')]['find']({'where':{'id':_0xbab216[_0xe122('0x47')]['id']}})[_0xe122('0x29')](handleEntityNotFound(_0x45dd95,null))[_0xe122('0x29')](removeEntity(_0x45dd95,null))['catch'](handleError(_0x45dd95,null));};exports[_0xe122('0x4c')]=function(_0x21def8,_0x32b952,_0x54b24e){var _0x2467bd={};var _0x1cb53d={};var _0x291ca2;var _0x9d04b0;return db['FreshsalesAccount'][_0xe122('0x4d')]({'where':{'id':_0x21def8[_0xe122('0x47')]['id']}})[_0xe122('0x29')](handleEntityNotFound(_0x32b952,null))['then'](function(_0x1ff39d){if(_0x1ff39d){_0x291ca2=_0x1ff39d;_0x1cb53d[_0xe122('0x33')]=_[_0xe122('0x35')](db[_0xe122('0x4e')][_0xe122('0x30')]);_0x1cb53d[_0xe122('0x34')]=_['keys'](_0x21def8[_0xe122('0x34')]);_0x1cb53d[_0xe122('0x36')]=_[_0xe122('0x37')](_0x1cb53d[_0xe122('0x33')],_0x1cb53d[_0xe122('0x34')]);_0x2467bd[_0xe122('0x38')]=_['intersection'](_0x1cb53d[_0xe122('0x33')],qs[_0xe122('0x48')](_0x21def8[_0xe122('0x34')][_0xe122('0x48')]));_0x2467bd[_0xe122('0x38')]=_0x2467bd[_0xe122('0x38')][_0xe122('0x39')]?_0x2467bd[_0xe122('0x38')]:_0x1cb53d[_0xe122('0x33')];_0x2467bd[_0xe122('0x3a')]=qs[_0xe122('0x3b')](_0x21def8[_0xe122('0x34')][_0xe122('0x3b')]);_0x2467bd[_0xe122('0x3c')]=qs[_0xe122('0x36')](_['pick'](_0x21def8[_0xe122('0x34')],_0x1cb53d[_0xe122('0x36')]));if(_0x21def8['query']['filter']){_0x2467bd['where']=_[_0xe122('0x3d')](_0x2467bd[_0xe122('0x3c')],{'$or':_[_0xe122('0x2e')](_0x2467bd[_0xe122('0x38')],function(_0x15bbe7){var _0x37147f={};_0x37147f[_0x15bbe7]={'$like':'%'+_0x21def8['query'][_0xe122('0x3e')]+'%'};return _0x37147f;})});}_0x2467bd=_[_0xe122('0x3d')]({},_0x2467bd,_0x21def8[_0xe122('0x3f')]);return _0x291ca2[_0xe122('0x4c')](_0x2467bd);}})['then'](function(_0x300b48){if(_0x300b48){_0x9d04b0=_0x300b48[_0xe122('0x39')];if(!_0x21def8[_0xe122('0x34')][_0xe122('0x4f')](_0xe122('0x50'))){_0x2467bd[_0xe122('0x22')]=qs[_0xe122('0x22')](_0x21def8[_0xe122('0x34')][_0xe122('0x22')]);_0x2467bd[_0xe122('0x20')]=qs['offset'](_0x21def8['query'][_0xe122('0x20')]);}return _0x291ca2[_0xe122('0x4c')](_0x2467bd);}})[_0xe122('0x29')](function(_0x387a6f){if(_0x387a6f){return _0x387a6f?{'count':_0x9d04b0,'rows':_0x387a6f}:null;}})['then'](respondWithResult(_0x32b952,null))[_0xe122('0x45')](handleError(_0x32b952,null));};exports[_0xe122('0x51')]=function(_0x4f58b6,_0x597399,_0x3fc8df){if(_0x4f58b6[_0xe122('0x4b')]['id']){delete _0x4f58b6[_0xe122('0x4b')]['id'];}return db[_0xe122('0x2f')][_0xe122('0x4d')]({'where':{'id':_0x4f58b6[_0xe122('0x47')]['id']}})[_0xe122('0x29')](handleEntityNotFound(_0x597399,null))[_0xe122('0x29')](function(_0x4b2da5){if(_0x4b2da5){_0x4f58b6[_0xe122('0x4b')][_0xe122('0x52')]=_0x4b2da5['id'];_0x4f58b6[_0xe122('0x4b')]['Subjects']=integrations[_0xe122('0x53')](_0x4f58b6[_0xe122('0x4b')][_0xe122('0x54')],_0x4f58b6[_0xe122('0x4b')][_0xe122('0x31')]);_0x4f58b6[_0xe122('0x4b')][_0xe122('0x55')]=integrations[_0xe122('0x56')](_0x4f58b6[_0xe122('0x4b')]['channel'],_0x4f58b6[_0xe122('0x4b')]['type']);return db[_0xe122('0x4e')][_0xe122('0x4a')](_0x4f58b6[_0xe122('0x4b')],{'include':[{'model':db[_0xe122('0x57')],'as':_0xe122('0x58')},{'model':db[_0xe122('0x57')],'as':'Descriptions'}]});}return null;})[_0xe122('0x29')](respondWithResult(_0x597399,null))[_0xe122('0x45')](handleError(_0x597399,null));};exports[_0xe122('0x59')]=function(_0x15ac5d,_0x3fdbae,_0x2382ac){var _0x2099ed='';var _0x173194='';return db[_0xe122('0x2f')]['findOne']({'where':{'id':_0x15ac5d[_0xe122('0x47')]['id']},'attributes':['id',_0xe122('0x5a'),_0xe122('0x5b'),_0xe122('0x5c')]})['then'](handleEntityNotFound(_0x3fdbae,null))[_0xe122('0x29')](function(_0x1fcbdf){if(_0x1fcbdf){_0x173194=_0x1fcbdf[_0xe122('0x5a')];_0x2099ed=_0x1fcbdf[_0xe122('0x5b')];var _0x4e5b2d=_0x1fcbdf[_0xe122('0x5b')][_0xe122('0x5d')](-0x1);if(_0x4e5b2d==='/'){_0x2099ed=_0x2099ed[_0xe122('0x5e')](0x0,_0x2099ed[_0xe122('0x5f')](_0x4e5b2d));}return rp({'method':_0xe122('0x60'),'uri':util[_0xe122('0x61')]('%s%s',_0x2099ed,_0xe122('0x62')),'headers':{'Authorization':_0xe122('0x63')+_0x1fcbdf[_0xe122('0x5c')]},'json':!![]});}})[_0xe122('0x29')](function(_0x317bba){if(_0x317bba){var _0x26021c=_0x317bba[_0xe122('0x64')];var _0x3968cb=![];var _0x2c77c2=null;for(_0x2c77c2=0x0;_0x2c77c2<_0x26021c['length'];_0x2c77c2++){if(_0x26021c[_0x2c77c2][_0xe122('0x65')]===_0x173194){_0x3968cb=!![];}}if(_0x3968cb){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe122('0x66')});}}})[_0xe122('0x29')](respondWithResult(_0x3fdbae,null))[_0xe122('0x45')](function(_0x33bbd4){var _0x2f8ee1=_0x15ac5d[_0xe122('0x34')][_0xe122('0x67')]?0x1f4:_0x33bbd4['statusCode']||0x1f4;logger[_0xe122('0x68')](_0xe122('0x69'),_0xe122('0x59'),_0x2f8ee1,JSON[_0xe122('0x6a')](_0x33bbd4));delete _0x33bbd4[_0xe122('0x2b')];if(_0x2f8ee1===0x191){_0x2f8ee1=0x190;}_0x3fdbae[_0xe122('0x1d')](_0x2f8ee1)['send'](_0x15ac5d['query'][_0xe122('0x67')]?{'message':'Wrong\x20credentials','statusCode':_0x33bbd4[_0xe122('0x6b')]}:_0x33bbd4);});}; \ No newline at end of file +var _0x09cc=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','index','map','FreshsalesAccount','rawAttributes','query','keys','filters','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','model','fields','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2988ea,_0x3eaee8){var _0x2c061c=function(_0x50077c){while(--_0x50077c){_0x2988ea['push'](_0x2988ea['shift']());}};_0x2c061c(++_0x3eaee8);}(_0x09cc,0xbf));var _0xc09c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x09cc[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xc09c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc09c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc09c('0x2'));var moment=require(_0xc09c('0x3'));var BPromise=require(_0xc09c('0x4'));var Mustache=require(_0xc09c('0x5'));var util=require(_0xc09c('0x6'));var path=require(_0xc09c('0x7'));var sox=require(_0xc09c('0x8'));var csv=require('to-csv');var ejs=require(_0xc09c('0x9'));var fs=require('fs');var fs_extra=require(_0xc09c('0xa'));var _=require('lodash');var squel=require(_0xc09c('0xb'));var crypto=require(_0xc09c('0xc'));var jsforce=require(_0xc09c('0xd'));var deskjs=require(_0xc09c('0xe'));var toCsv=require(_0xc09c('0xf'));var querystring=require(_0xc09c('0x10'));var Papa=require(_0xc09c('0x11'));var Redis=require(_0xc09c('0x12'));var authService=require(_0xc09c('0x13'));var qs=require(_0xc09c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc09c('0x15'));var logger=require(_0xc09c('0x16'))(_0xc09c('0x17'));var utils=require(_0xc09c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc09c('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc09c('0x1a'));function respondWithStatusCode(_0x4066b0,_0x7ed6ba){_0x7ed6ba=_0x7ed6ba||0xcc;return function(_0x29ca42){if(_0x29ca42){return _0x4066b0[_0xc09c('0x1b')](_0x7ed6ba);}return _0x4066b0['status'](_0x7ed6ba)['end']();};}function respondWithResult(_0x1e7330,_0x2f4f6b){_0x2f4f6b=_0x2f4f6b||0xc8;return function(_0x45b785){if(_0x45b785){return _0x1e7330['status'](_0x2f4f6b)[_0xc09c('0x1c')](_0x45b785);}};}function respondWithFilteredResult(_0x56a047,_0x2ae6cf){return function(_0x546743){if(_0x546743){var _0x1470d2=typeof _0x2ae6cf[_0xc09c('0x1d')]===_0xc09c('0x1e')&&typeof _0x2ae6cf[_0xc09c('0x1f')]===_0xc09c('0x1e');var _0x5bf633=_0x546743['count'];var _0x1c4fa7=_0x1470d2?0x0:_0x2ae6cf[_0xc09c('0x1d')];var _0x3d38e3=_0x1470d2?_0x546743[_0xc09c('0x20')]:_0x2ae6cf['offset']+_0x2ae6cf[_0xc09c('0x1f')];var _0x5f1420;if(_0x3d38e3>=_0x5bf633){_0x3d38e3=_0x5bf633;_0x5f1420=0xc8;}else{_0x5f1420=0xce;}_0x56a047[_0xc09c('0x21')](_0x5f1420);return _0x56a047[_0xc09c('0x22')](_0xc09c('0x23'),_0x1c4fa7+'-'+_0x3d38e3+'/'+_0x5bf633)[_0xc09c('0x1c')](_0x546743);}return null;};}function patchUpdates(_0x475609){return function(_0x189d99){try{jsonpatch[_0xc09c('0x24')](_0x189d99,_0x475609,!![]);}catch(_0x3ab3f0){return BPromise[_0xc09c('0x25')](_0x3ab3f0);}return _0x189d99['save']();};}function saveUpdates(_0x3efc64,_0x4f5106){return function(_0xae938e){if(_0xae938e){return _0xae938e[_0xc09c('0x26')](_0x3efc64)['then'](function(_0x18d37d){return _0x18d37d;});}return null;};}function removeEntity(_0x467137,_0x1c58ec){return function(_0x339468){if(_0x339468){return _0x339468[_0xc09c('0x27')]()[_0xc09c('0x28')](function(){_0x467137[_0xc09c('0x21')](0xcc)[_0xc09c('0x29')]();});}};}function handleEntityNotFound(_0x49fbce,_0x29e126){return function(_0x688bce){if(!_0x688bce){_0x49fbce[_0xc09c('0x1b')](0x194);}return _0x688bce;};}function handleError(_0x1db4f9,_0x4fc237){_0x4fc237=_0x4fc237||0x1f4;return function(_0x591ae0){logger[_0xc09c('0x2a')](_0x591ae0[_0xc09c('0x2b')]);if(_0x591ae0[_0xc09c('0x2c')]){delete _0x591ae0['name'];}_0x1db4f9[_0xc09c('0x21')](_0x4fc237)['send'](_0x591ae0);};}exports[_0xc09c('0x2d')]=function(_0x4b0e57,_0x5bb8cc){var _0x213941={},_0x335609={},_0x408800={'count':0x0,'rows':[]};var _0x49905f=_[_0xc09c('0x2e')](db[_0xc09c('0x2f')][_0xc09c('0x30')],function(_0x537616){return{'name':_0x537616['fieldName'],'type':_0x537616['type']['key']};});_0x335609['model']=_[_0xc09c('0x2e')](_0x49905f,_0xc09c('0x2c'));_0x335609[_0xc09c('0x31')]=_[_0xc09c('0x32')](_0x4b0e57[_0xc09c('0x31')]);_0x335609[_0xc09c('0x33')]=_['intersection'](_0x335609['model'],_0x335609[_0xc09c('0x31')]);_0x213941['attributes']=_[_0xc09c('0x34')](_0x335609['model'],qs['fields'](_0x4b0e57[_0xc09c('0x31')]['fields']));_0x213941['attributes']=_0x213941['attributes'][_0xc09c('0x35')]?_0x213941[_0xc09c('0x36')]:_0x335609['model'];if(!_0x4b0e57[_0xc09c('0x31')][_0xc09c('0x37')](_0xc09c('0x38'))){_0x213941[_0xc09c('0x1f')]=qs[_0xc09c('0x1f')](_0x4b0e57[_0xc09c('0x31')][_0xc09c('0x1f')]);_0x213941[_0xc09c('0x1d')]=qs[_0xc09c('0x1d')](_0x4b0e57[_0xc09c('0x31')][_0xc09c('0x1d')]);}_0x213941[_0xc09c('0x39')]=qs[_0xc09c('0x3a')](_0x4b0e57['query'][_0xc09c('0x3a')]);_0x213941[_0xc09c('0x3b')]=qs[_0xc09c('0x33')](_['pick'](_0x4b0e57[_0xc09c('0x31')],_0x335609[_0xc09c('0x33')]),_0x49905f);if(_0x4b0e57['query']['filter']){_0x213941['where']=_[_0xc09c('0x3c')](_0x213941['where'],{'$or':_['map'](_0x49905f,function(_0x7e5b9b){if(_0x7e5b9b[_0xc09c('0x3d')]!==_0xc09c('0x3e')){var _0x40e208={};_0x40e208[_0x7e5b9b[_0xc09c('0x2c')]]={'$like':'%'+_0x4b0e57[_0xc09c('0x31')][_0xc09c('0x3f')]+'%'};return _0x40e208;}})});}_0x213941=_[_0xc09c('0x3c')]({},_0x213941,_0x4b0e57[_0xc09c('0x40')]);var _0x40fdf0={'where':_0x213941[_0xc09c('0x3b')]};return db[_0xc09c('0x2f')][_0xc09c('0x20')](_0x40fdf0)[_0xc09c('0x28')](function(_0x190c22){_0x408800[_0xc09c('0x20')]=_0x190c22;if(_0x4b0e57[_0xc09c('0x31')][_0xc09c('0x41')]){_0x213941[_0xc09c('0x42')]=[{'all':!![]}];}return db[_0xc09c('0x2f')]['findAll'](_0x213941);})['then'](function(_0x2aff44){_0x408800[_0xc09c('0x43')]=_0x2aff44;return _0x408800;})[_0xc09c('0x28')](respondWithFilteredResult(_0x5bb8cc,_0x213941))[_0xc09c('0x44')](handleError(_0x5bb8cc,null));};exports[_0xc09c('0x45')]=function(_0x2943f5,_0x49342d){var _0x11df08={'raw':![],'where':{'id':_0x2943f5[_0xc09c('0x46')]['id']}},_0x2d3ddd={};_0x2d3ddd[_0xc09c('0x47')]=_['keys'](db[_0xc09c('0x2f')][_0xc09c('0x30')]);_0x2d3ddd[_0xc09c('0x31')]=_[_0xc09c('0x32')](_0x2943f5[_0xc09c('0x31')]);_0x2d3ddd[_0xc09c('0x33')]=_[_0xc09c('0x34')](_0x2d3ddd[_0xc09c('0x47')],_0x2d3ddd['query']);_0x11df08[_0xc09c('0x36')]=_[_0xc09c('0x34')](_0x2d3ddd[_0xc09c('0x47')],qs[_0xc09c('0x48')](_0x2943f5[_0xc09c('0x31')][_0xc09c('0x48')]));_0x11df08[_0xc09c('0x36')]=_0x11df08[_0xc09c('0x36')][_0xc09c('0x35')]?_0x11df08[_0xc09c('0x36')]:_0x2d3ddd[_0xc09c('0x47')];if(_0x2943f5[_0xc09c('0x31')][_0xc09c('0x41')]){_0x11df08[_0xc09c('0x42')]=[{'all':!![]}];}_0x11df08=_['merge']({},_0x11df08,_0x2943f5[_0xc09c('0x40')]);return db['FreshsalesAccount']['find'](_0x11df08)[_0xc09c('0x28')](handleEntityNotFound(_0x49342d,null))[_0xc09c('0x28')](respondWithResult(_0x49342d,null))[_0xc09c('0x44')](handleError(_0x49342d,null));};exports[_0xc09c('0x49')]=function(_0x626bc8,_0x14cd11){return db[_0xc09c('0x2f')][_0xc09c('0x49')](_0x626bc8[_0xc09c('0x4a')],{})[_0xc09c('0x28')](respondWithResult(_0x14cd11,0xc9))[_0xc09c('0x44')](handleError(_0x14cd11,null));};exports[_0xc09c('0x26')]=function(_0x477ae1,_0x2f8124){if(_0x477ae1['body']['id']){delete _0x477ae1['body']['id'];}return db['FreshsalesAccount'][_0xc09c('0x4b')]({'where':{'id':_0x477ae1[_0xc09c('0x46')]['id']}})[_0xc09c('0x28')](handleEntityNotFound(_0x2f8124,null))[_0xc09c('0x28')](saveUpdates(_0x477ae1[_0xc09c('0x4a')],null))['then'](respondWithResult(_0x2f8124,null))[_0xc09c('0x44')](handleError(_0x2f8124,null));};exports[_0xc09c('0x27')]=function(_0x219cf4,_0x146959){return db[_0xc09c('0x2f')][_0xc09c('0x4b')]({'where':{'id':_0x219cf4[_0xc09c('0x46')]['id']}})[_0xc09c('0x28')](handleEntityNotFound(_0x146959,null))[_0xc09c('0x28')](removeEntity(_0x146959,null))[_0xc09c('0x44')](handleError(_0x146959,null));};exports[_0xc09c('0x4c')]=function(_0x4316da,_0x343252,_0x2c0f00){var _0x48365a={};var _0x5af9a4={};var _0x19cf91;var _0x58911b;return db[_0xc09c('0x2f')][_0xc09c('0x4d')]({'where':{'id':_0x4316da['params']['id']}})[_0xc09c('0x28')](handleEntityNotFound(_0x343252,null))[_0xc09c('0x28')](function(_0x5bc59d){if(_0x5bc59d){_0x19cf91=_0x5bc59d;_0x5af9a4[_0xc09c('0x47')]=_[_0xc09c('0x32')](db[_0xc09c('0x4e')][_0xc09c('0x30')]);_0x5af9a4[_0xc09c('0x31')]=_[_0xc09c('0x32')](_0x4316da[_0xc09c('0x31')]);_0x5af9a4['filters']=_[_0xc09c('0x34')](_0x5af9a4[_0xc09c('0x47')],_0x5af9a4['query']);_0x48365a['attributes']=_[_0xc09c('0x34')](_0x5af9a4[_0xc09c('0x47')],qs['fields'](_0x4316da['query'][_0xc09c('0x48')]));_0x48365a['attributes']=_0x48365a[_0xc09c('0x36')][_0xc09c('0x35')]?_0x48365a['attributes']:_0x5af9a4[_0xc09c('0x47')];_0x48365a[_0xc09c('0x39')]=qs[_0xc09c('0x3a')](_0x4316da[_0xc09c('0x31')][_0xc09c('0x3a')]);_0x48365a['where']=qs['filters'](_[_0xc09c('0x4f')](_0x4316da[_0xc09c('0x31')],_0x5af9a4['filters']));if(_0x4316da[_0xc09c('0x31')][_0xc09c('0x3f')]){_0x48365a['where']=_['merge'](_0x48365a[_0xc09c('0x3b')],{'$or':_['map'](_0x48365a[_0xc09c('0x36')],function(_0x3097f3){var _0x2ab38b={};_0x2ab38b[_0x3097f3]={'$like':'%'+_0x4316da['query'][_0xc09c('0x3f')]+'%'};return _0x2ab38b;})});}_0x48365a=_[_0xc09c('0x3c')]({},_0x48365a,_0x4316da[_0xc09c('0x40')]);return _0x19cf91[_0xc09c('0x4c')](_0x48365a);}})['then'](function(_0x2df986){if(_0x2df986){_0x58911b=_0x2df986[_0xc09c('0x35')];if(!_0x4316da[_0xc09c('0x31')]['hasOwnProperty'](_0xc09c('0x38'))){_0x48365a[_0xc09c('0x1f')]=qs[_0xc09c('0x1f')](_0x4316da[_0xc09c('0x31')]['limit']);_0x48365a[_0xc09c('0x1d')]=qs['offset'](_0x4316da[_0xc09c('0x31')][_0xc09c('0x1d')]);}return _0x19cf91[_0xc09c('0x4c')](_0x48365a);}})[_0xc09c('0x28')](function(_0x3d8470){if(_0x3d8470){return _0x3d8470?{'count':_0x58911b,'rows':_0x3d8470}:null;}})[_0xc09c('0x28')](respondWithResult(_0x343252,null))[_0xc09c('0x44')](handleError(_0x343252,null));};exports[_0xc09c('0x50')]=function(_0x19c712,_0x5eae90,_0x21ef99){if(_0x19c712[_0xc09c('0x4a')]['id']){delete _0x19c712[_0xc09c('0x4a')]['id'];}return db['FreshsalesAccount'][_0xc09c('0x4d')]({'where':{'id':_0x19c712[_0xc09c('0x46')]['id']}})[_0xc09c('0x28')](handleEntityNotFound(_0x5eae90,null))['then'](function(_0x51f3bc){if(_0x51f3bc){_0x19c712[_0xc09c('0x4a')]['AccountId']=_0x51f3bc['id'];_0x19c712[_0xc09c('0x4a')][_0xc09c('0x51')]=integrations['getSubjects'](_0x19c712['body'][_0xc09c('0x52')],_0x19c712[_0xc09c('0x4a')][_0xc09c('0x3d')]);_0x19c712[_0xc09c('0x4a')]['Descriptions']=integrations[_0xc09c('0x53')](_0x19c712['body'][_0xc09c('0x52')],_0x19c712['body']['type']);return db[_0xc09c('0x4e')]['create'](_0x19c712[_0xc09c('0x4a')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0xc09c('0x54')],'as':_0xc09c('0x55')}]});}return null;})[_0xc09c('0x28')](respondWithResult(_0x5eae90,null))['catch'](handleError(_0x5eae90,null));};exports[_0xc09c('0x56')]=function(_0x4fa9bb,_0x4809ff,_0xb34052){var _0x3e0d81='';var _0x437bd8='';return db[_0xc09c('0x2f')]['findOne']({'where':{'id':_0x4fa9bb[_0xc09c('0x46')]['id']},'attributes':['id',_0xc09c('0x57'),_0xc09c('0x58'),_0xc09c('0x59')]})['then'](handleEntityNotFound(_0x4809ff,null))[_0xc09c('0x28')](function(_0x2fbb12){if(_0x2fbb12){_0x437bd8=_0x2fbb12['username'];_0x3e0d81=_0x2fbb12[_0xc09c('0x58')];var _0x467de1=_0x2fbb12[_0xc09c('0x58')][_0xc09c('0x5a')](-0x1);if(_0x467de1==='/'){_0x3e0d81=_0x3e0d81[_0xc09c('0x5b')](0x0,_0x3e0d81[_0xc09c('0x5c')](_0x467de1));}return rp({'method':_0xc09c('0x5d'),'uri':util[_0xc09c('0x5e')](_0xc09c('0x5f'),_0x3e0d81,_0xc09c('0x60')),'headers':{'Authorization':_0xc09c('0x61')+_0x2fbb12[_0xc09c('0x59')]},'json':!![]});}})['then'](function(_0x498803){if(_0x498803){var _0x2a181e=_0x498803[_0xc09c('0x62')];var _0x2991d2=![];var _0x549e12=null;for(_0x549e12=0x0;_0x549e12<_0x2a181e['length'];_0x549e12++){if(_0x2a181e[_0x549e12][_0xc09c('0x63')]===_0x437bd8){_0x2991d2=!![];}}if(_0x2991d2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc09c('0x64')});}}})[_0xc09c('0x28')](respondWithResult(_0x4809ff,null))[_0xc09c('0x44')](function(_0x315546){var _0x33a212=_0x4fa9bb[_0xc09c('0x31')]['test']?0x1f4:_0x315546['statusCode']||0x1f4;logger[_0xc09c('0x2a')](_0xc09c('0x65'),_0xc09c('0x56'),_0x33a212,JSON[_0xc09c('0x66')](_0x315546));delete _0x315546['name'];if(_0x33a212===0x191){_0x33a212=0x190;}_0x4809ff[_0xc09c('0x21')](_0x33a212)[_0xc09c('0x67')](_0x4fa9bb[_0xc09c('0x31')]['test']?{'message':_0xc09c('0x68'),'statusCode':_0x315546[_0xc09c('0x69')]}:_0x315546);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index df387b0..1f004f5 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 _0xdf55=['int_freshsales_accounts','lodash','util','api','moment','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf55,0x83));var _0x5df5=function(_0x47a8c0,_0x4d5931){_0x47a8c0=_0x47a8c0-0x0;var _0x551fa1=_0xdf55[_0x47a8c0];return _0x551fa1;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));var integrations=require(_0x5df5('0x8'));module[_0x5df5('0x9')]=function(_0x476e21,_0x9b8756){return _0x476e21[_0x5df5('0xa')](_0x5df5('0xb'),attributes,{'tableName':_0x5df5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','exports','int_freshsales_accounts'];(function(_0x4322be,_0x525d3f){var _0x37f74c=function(_0x129287){while(--_0x129287){_0x4322be['push'](_0x4322be['shift']());}};_0x37f74c(++_0x525d3f);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xfdbd[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdfdb('0xa')]=function(_0x41bd5e,_0x489f19){return _0x41bd5e['define']('FreshsalesAccount',attributes,{'tableName':_0xdfdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index a8e8910..fcc7188 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 _0x4745=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','limit','include','map','model','then','raw','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x4745,0x1e7));var _0x5474=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4745[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});}exports[_0x5474('0x18')]=function(_0x56dbfa){var _0x22b37d=this;return new Promise(function(_0x198fc8,_0x18b0fe){return db[_0x5474('0x19')][_0x5474('0x1a')]({'raw':_0x56dbfa['options']?_0x56dbfa[_0x5474('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')]['where']||null:null,'attributes':_0x56dbfa['options']?_0x56dbfa['options'][_0x5474('0x1c')]||null:null,'limit':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1d')]||null:null,'include':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')],function(_0x542d1f){return{'model':db[_0x542d1f['model']],'as':_0x542d1f['as'],'attributes':_0x542d1f[_0x5474('0x1c')],'include':_0x542d1f[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x542d1f['include'],function(_0x24997a){return{'model':db[_0x24997a['model']],'as':_0x24997a['as'],'attributes':_0x24997a[_0x5474('0x1c')],'include':_0x24997a[_0x5474('0x1e')]?_['map'](_0x24997a[_0x5474('0x1e')],function(_0x5d4cd7){return{'model':db[_0x5d4cd7[_0x5474('0x20')]],'as':_0x5d4cd7['as'],'attributes':_0x5d4cd7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x1384e4){logger[_0x5474('0xe')]('GetFreshsalesAccount',_0x56dbfa);logger[_0x5474('0x11')](_0x5474('0x18'),_0x56dbfa,JSON['stringify'](_0x1384e4));_0x198fc8(_0x1384e4);})['catch'](function(_0x5d2381){logger['error'](_0x5474('0x18'),_0x5d2381[_0x5474('0x16')],_0x56dbfa);_0x18b0fe(_0x22b37d['error'](0x1f4,_0x5d2381[_0x5474('0x16')]));});});};exports['ShowFreshsalesAccount']=function(_0xc1e0ce){var _0x58f27a=this;return new Promise(function(_0x70774f,_0x530cdb){return db[_0x5474('0x19')]['find']({'raw':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x22')]===undefined?!![]:![]:!![],'where':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['where']||null:null,'attributes':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x1c')]||null:null,'include':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['include']?_[_0x5474('0x1f')](_0xc1e0ce[_0x5474('0x1b')]['include'],function(_0x3ce359){return{'model':db[_0x3ce359[_0x5474('0x20')]],'as':_0x3ce359['as'],'attributes':_0x3ce359[_0x5474('0x1c')],'include':_0x3ce359[_0x5474('0x1e')]?_['map'](_0x3ce359[_0x5474('0x1e')],function(_0x409111){return{'model':db[_0x409111[_0x5474('0x20')]],'as':_0x409111['as'],'attributes':_0x409111['attributes'],'include':_0x409111[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x409111[_0x5474('0x1e')],function(_0x2f4589){return{'model':db[_0x2f4589['model']],'as':_0x2f4589['as'],'attributes':_0x2f4589['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x3eccef){logger[_0x5474('0xe')](_0x5474('0x23'),_0xc1e0ce);logger['debug'](_0x5474('0x23'),_0xc1e0ce,JSON[_0x5474('0x13')](_0x3eccef));_0x70774f(_0x3eccef);})[_0x5474('0x17')](function(_0x22009e){logger['error']('ShowFreshsalesAccount',_0x22009e['message'],_0xc1e0ce);_0x530cdb(_0x58f27a[_0x5474('0x14')](0x1f4,_0x22009e['message']));});});}; \ No newline at end of file +var _0xf61e=['include','map','then','ShowFreshsalesAccount','FreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','model'];(function(_0x297eec,_0x236a06){var _0x25e058=function(_0x138d79){while(--_0x138d79){_0x297eec['push'](_0x297eec['shift']());}};_0x25e058(++_0x236a06);}(_0xf61e,0x191));var _0xef61=function(_0xe91ecd,_0x18ab54){_0xe91ecd=_0xe91ecd-0x0;var _0x449bd1=_0xf61e[_0xe91ecd];return _0x449bd1;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['FreshsalesAccount'][_0xef61('0x18')]({'raw':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b['options'][_0xef61('0x1a')]===undefined?!![]:![]:!![],'where':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1b')]||null:null,'attributes':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1c')]||null:null,'limit':_0x22dc1b['options']?_0x22dc1b['options'][_0xef61('0x1d')]||null:null,'include':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x19')]['include']?_['map'](_0x22dc1b[_0xef61('0x19')]['include'],function(_0x53181b){return{'model':db[_0x53181b[_0xef61('0x1e')]],'as':_0x53181b['as'],'attributes':_0x53181b[_0xef61('0x1c')],'include':_0x53181b[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x53181b['include'],function(_0x16b144){return{'model':db[_0x16b144['model']],'as':_0x16b144['as'],'attributes':_0x16b144[_0xef61('0x1c')],'include':_0x16b144[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x16b144[_0xef61('0x1f')],function(_0x2155f1){return{'model':db[_0x2155f1[_0xef61('0x1e')]],'as':_0x2155f1['as'],'attributes':_0x2155f1[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef61('0x21')](function(_0x297df7){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')](_0xef61('0x17'),_0x22dc1b,JSON[_0xef61('0x12')](_0x297df7));_0x28315a(_0x297df7);})[_0xef61('0x16')](function(_0x85978){logger[_0xef61('0x13')](_0xef61('0x17'),_0x85978[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x85978[_0xef61('0x15')]));});});};exports[_0xef61('0x22')]=function(_0x4f35ad){var _0x51d5d1=this;return new Promise(function(_0x38b522,_0x36713e){return db[_0xef61('0x23')]['find']({'raw':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad[_0xef61('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options']['where']||null:null,'attributes':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options'][_0xef61('0x1c')]||null:null,'include':_0x4f35ad['options']?_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')]?_[_0xef61('0x20')](_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')],function(_0x1bdcb9){return{'model':db[_0x1bdcb9[_0xef61('0x1e')]],'as':_0x1bdcb9['as'],'attributes':_0x1bdcb9[_0xef61('0x1c')],'include':_0x1bdcb9[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x1bdcb9['include'],function(_0x569db6){return{'model':db[_0x569db6[_0xef61('0x1e')]],'as':_0x569db6['as'],'attributes':_0x569db6[_0xef61('0x1c')],'include':_0x569db6[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x569db6['include'],function(_0x1c38dc){return{'model':db[_0x1c38dc[_0xef61('0x1e')]],'as':_0x1c38dc['as'],'attributes':_0x1c38dc[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b97b){logger['info'](_0xef61('0x22'),_0x4f35ad);logger['debug']('ShowFreshsalesAccount',_0x4f35ad,JSON['stringify'](_0x59b97b));_0x38b522(_0x59b97b);})[_0xef61('0x16')](function(_0x294063){logger[_0xef61('0x13')]('ShowFreshsalesAccount',_0x294063['message'],_0x4f35ad);_0x36713e(_0x51d5d1['error'](0x1f4,_0x294063[_0xef61('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2f6e294..dd03f6e 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 _0x14f2=['destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','update','delete'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x14f2,0x11a));var _0x214f=function(_0x56384d,_0x53e267){_0x56384d=_0x56384d-0x0;var _0x521ca8=_0x14f2[_0x56384d];return _0x521ca8;};'use strict';var multer=require(_0x214f('0x0'));var util=require(_0x214f('0x1'));var path=require(_0x214f('0x2'));var timeout=require('connect-timeout');var express=require(_0x214f('0x3'));var router=express['Router']();var fs_extra=require(_0x214f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x214f('0x5'));var config=require(_0x214f('0x6'));var controller=require(_0x214f('0x7'));router[_0x214f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x214f('0x8')](_0x214f('0x9'),auth[_0x214f('0xa')](),controller['show']);router[_0x214f('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x214f('0xb')]);router[_0x214f('0x8')](_0x214f('0xc'),auth['isAuthenticated'](),controller[_0x214f('0xd')]);router[_0x214f('0x8')](_0x214f('0xe'),auth[_0x214f('0xa')](),controller['getFields']);router[_0x214f('0xf')]('/',auth[_0x214f('0xa')](),controller['create']);router['put'](_0x214f('0x9'),auth[_0x214f('0xa')](),controller[_0x214f('0x10')]);router[_0x214f('0x11')]('/:id',auth[_0x214f('0xa')](),controller[_0x214f('0x12')]);module[_0x214f('0x13')]=router; \ No newline at end of file +var _0xd92a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x570b6d,_0x34ee62){var _0xa77455=function(_0x43eb3c){while(--_0x43eb3c){_0x570b6d['push'](_0x570b6d['shift']());}};_0xa77455(++_0x34ee62);}(_0xd92a,0x188));var _0xad92=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd92a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xad92('0x0'));var util=require(_0xad92('0x1'));var path=require('path');var timeout=require(_0xad92('0x2'));var express=require(_0xad92('0x3'));var router=express[_0xad92('0x4')]();var fs_extra=require(_0xad92('0x5'));var auth=require(_0xad92('0x6'));var interaction=require(_0xad92('0x7'));var config=require(_0xad92('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xad92('0x9')]('/',auth['isAuthenticated'](),controller[_0xad92('0xa')]);router[_0xad92('0x9')](_0xad92('0xb'),auth[_0xad92('0xc')](),controller['show']);router[_0xad92('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xad92('0xd')]);router[_0xad92('0x9')](_0xad92('0xe'),auth[_0xad92('0xc')](),controller[_0xad92('0xf')]);router[_0xad92('0x9')]('/:id/fields',auth[_0xad92('0xc')](),controller['getFields']);router[_0xad92('0x10')]('/',auth['isAuthenticated'](),controller[_0xad92('0x11')]);router[_0xad92('0x12')]('/:id',auth[_0xad92('0xc')](),controller['update']);router[_0xad92('0x13')](_0xad92('0xb'),auth[_0xad92('0xc')](),controller[_0xad92('0x14')]);module[_0xad92('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 63ccb2d..f029760 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 _0xdc20=['STRING','exports'];(function(_0x4c1609,_0x337464){var _0x331231=function(_0x4d28c7){while(--_0x4d28c7){_0x4c1609['push'](_0x4c1609['shift']());}};_0x331231(++_0x337464);}(_0xdc20,0x65));var _0x0dc2=function(_0x43c2ff,_0x140542){_0x43c2ff=_0x43c2ff-0x0;var _0x2df920=_0xdc20[_0x43c2ff];return _0x2df920;};'use strict';var Sequelize=require('sequelize');module[_0x0dc2('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dc2('0x1')]}}; \ No newline at end of file +var _0x4d2e=['STRING','sequelize','exports'];(function(_0xa4be08,_0x1a4863){var _0x4a27a3=function(_0x545107){while(--_0x545107){_0xa4be08['push'](_0xa4be08['shift']());}};_0x4a27a3(++_0x1a4863);}(_0x4d2e,0x196));var _0xe4d2=function(_0x2c7db2,_0xd265e3){_0x2c7db2=_0x2c7db2-0x0;var _0x334830=_0x4d2e[_0x2c7db2];return _0x334830;};'use strict';var Sequelize=require(_0xe4d2('0x0'));module[_0xe4d2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe4d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index b063bc1..07a7557 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 _0x5dd6=['count','includeAll','findAll','rows','show','include','find','catch','create','body','params','findOne','getSubjects','getDescriptions','FreshsalesField','getFields','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5dd6,0x1b5));var _0x65dd=function(_0x29900d,_0x35548b){_0x29900d=_0x29900d-0x0;var _0x2d2895=_0x5dd6[_0x29900d];return _0x2d2895;};'use strict';var emlformat=require(_0x65dd('0x0'));var rimraf=require(_0x65dd('0x1'));var zipdir=require(_0x65dd('0x2'));var jsonpatch=require(_0x65dd('0x3'));var rp=require(_0x65dd('0x4'));var moment=require(_0x65dd('0x5'));var BPromise=require(_0x65dd('0x6'));var Mustache=require(_0x65dd('0x7'));var util=require(_0x65dd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x65dd('0x9'));var ejs=require(_0x65dd('0xa'));var fs=require('fs');var fs_extra=require(_0x65dd('0xb'));var _=require(_0x65dd('0xc'));var squel=require(_0x65dd('0xd'));var crypto=require(_0x65dd('0xe'));var jsforce=require(_0x65dd('0xf'));var deskjs=require(_0x65dd('0x10'));var toCsv=require(_0x65dd('0x9'));var querystring=require(_0x65dd('0x11'));var Papa=require(_0x65dd('0x12'));var Redis=require(_0x65dd('0x13'));var authService=require(_0x65dd('0x14'));var qs=require(_0x65dd('0x15'));var as=require(_0x65dd('0x16'));var hardwareService=require(_0x65dd('0x17'));var logger=require(_0x65dd('0x18'))(_0x65dd('0x19'));var utils=require(_0x65dd('0x1a'));var config=require(_0x65dd('0x1b'));var licenseUtil=require(_0x65dd('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa57527,_0xfe2354){_0xfe2354=_0xfe2354||0xcc;return function(_0x85766c){if(_0x85766c){return _0xa57527['sendStatus'](_0xfe2354);}return _0xa57527[_0x65dd('0x1d')](_0xfe2354)['end']();};}function respondWithResult(_0x2e7593,_0x2793cc){_0x2793cc=_0x2793cc||0xc8;return function(_0x4f5d88){if(_0x4f5d88){return _0x2e7593['status'](_0x2793cc)[_0x65dd('0x1e')](_0x4f5d88);}};}function respondWithFilteredResult(_0x24d9ab,_0x2f7440){return function(_0x225659){if(_0x225659){var _0x394bb6=typeof _0x2f7440[_0x65dd('0x1f')]===_0x65dd('0x20')&&typeof _0x2f7440[_0x65dd('0x21')]===_0x65dd('0x20');var _0x221cb0=_0x225659['count'];var _0x408e07=_0x394bb6?0x0:_0x2f7440[_0x65dd('0x1f')];var _0x4fefb9=_0x394bb6?_0x225659['count']:_0x2f7440['offset']+_0x2f7440[_0x65dd('0x21')];var _0x50bdbc;if(_0x4fefb9>=_0x221cb0){_0x4fefb9=_0x221cb0;_0x50bdbc=0xc8;}else{_0x50bdbc=0xce;}_0x24d9ab[_0x65dd('0x1d')](_0x50bdbc);return _0x24d9ab[_0x65dd('0x22')](_0x65dd('0x23'),_0x408e07+'-'+_0x4fefb9+'/'+_0x221cb0)[_0x65dd('0x1e')](_0x225659);}return null;};}function patchUpdates(_0x643dbd){return function(_0x2f2896){try{jsonpatch[_0x65dd('0x24')](_0x2f2896,_0x643dbd,!![]);}catch(_0x1df64e){return BPromise[_0x65dd('0x25')](_0x1df64e);}return _0x2f2896[_0x65dd('0x26')]();};}function saveUpdates(_0x35d76c,_0x2a6e1b){return function(_0x1d7ffa){if(_0x1d7ffa){return _0x1d7ffa[_0x65dd('0x27')](_0x35d76c)[_0x65dd('0x28')](function(_0x436c62){return _0x436c62;});}return null;};}function removeEntity(_0x163dd3,_0x5711c7){return function(_0x12786a){if(_0x12786a){return _0x12786a[_0x65dd('0x29')]()[_0x65dd('0x28')](function(){_0x163dd3[_0x65dd('0x1d')](0xcc)[_0x65dd('0x2a')]();});}};}function handleEntityNotFound(_0x4656a7,_0x47c235){return function(_0x20a81c){if(!_0x20a81c){_0x4656a7['sendStatus'](0x194);}return _0x20a81c;};}function handleError(_0x555079,_0x32deb1){_0x32deb1=_0x32deb1||0x1f4;return function(_0x38c676){logger['error'](_0x38c676[_0x65dd('0x2b')]);if(_0x38c676[_0x65dd('0x2c')]){delete _0x38c676['name'];}_0x555079[_0x65dd('0x1d')](_0x32deb1)['send'](_0x38c676);};}exports[_0x65dd('0x2d')]=function(_0x386b04,_0x1d14e2){var _0x23c9ba={},_0x240638={},_0x1f21c0={'count':0x0,'rows':[]};var _0x34a399=_[_0x65dd('0x2e')](db[_0x65dd('0x2f')][_0x65dd('0x30')],function(_0x25e878){return{'name':_0x25e878['fieldName'],'type':_0x25e878[_0x65dd('0x31')][_0x65dd('0x32')]};});_0x240638[_0x65dd('0x33')]=_['map'](_0x34a399,_0x65dd('0x2c'));_0x240638['query']=_[_0x65dd('0x34')](_0x386b04[_0x65dd('0x35')]);_0x240638['filters']=_[_0x65dd('0x36')](_0x240638[_0x65dd('0x33')],_0x240638[_0x65dd('0x35')]);_0x23c9ba[_0x65dd('0x37')]=_[_0x65dd('0x36')](_0x240638[_0x65dd('0x33')],qs[_0x65dd('0x38')](_0x386b04[_0x65dd('0x35')][_0x65dd('0x38')]));_0x23c9ba[_0x65dd('0x37')]=_0x23c9ba[_0x65dd('0x37')][_0x65dd('0x39')]?_0x23c9ba[_0x65dd('0x37')]:_0x240638[_0x65dd('0x33')];if(!_0x386b04[_0x65dd('0x35')][_0x65dd('0x3a')](_0x65dd('0x3b'))){_0x23c9ba[_0x65dd('0x21')]=qs[_0x65dd('0x21')](_0x386b04['query']['limit']);_0x23c9ba[_0x65dd('0x1f')]=qs[_0x65dd('0x1f')](_0x386b04['query'][_0x65dd('0x1f')]);}_0x23c9ba[_0x65dd('0x3c')]=qs[_0x65dd('0x3d')](_0x386b04[_0x65dd('0x35')][_0x65dd('0x3d')]);_0x23c9ba[_0x65dd('0x3e')]=qs[_0x65dd('0x3f')](_[_0x65dd('0x40')](_0x386b04[_0x65dd('0x35')],_0x240638[_0x65dd('0x3f')]),_0x34a399);if(_0x386b04[_0x65dd('0x35')]['filter']){_0x23c9ba['where']=_['merge'](_0x23c9ba[_0x65dd('0x3e')],{'$or':_['map'](_0x34a399,function(_0x50815e){if(_0x50815e[_0x65dd('0x31')]!=='VIRTUAL'){var _0x37ec30={};_0x37ec30[_0x50815e[_0x65dd('0x2c')]]={'$like':'%'+_0x386b04[_0x65dd('0x35')][_0x65dd('0x41')]+'%'};return _0x37ec30;}})});}_0x23c9ba=_[_0x65dd('0x42')]({},_0x23c9ba,_0x386b04['options']);var _0x29d8bb={'where':_0x23c9ba[_0x65dd('0x3e')]};return db[_0x65dd('0x2f')]['count'](_0x29d8bb)[_0x65dd('0x28')](function(_0x3659b0){_0x1f21c0[_0x65dd('0x43')]=_0x3659b0;if(_0x386b04['query'][_0x65dd('0x44')]){_0x23c9ba['include']=[{'all':!![]}];}return db[_0x65dd('0x2f')][_0x65dd('0x45')](_0x23c9ba);})[_0x65dd('0x28')](function(_0x2633a9){_0x1f21c0[_0x65dd('0x46')]=_0x2633a9;return _0x1f21c0;})[_0x65dd('0x28')](respondWithFilteredResult(_0x1d14e2,_0x23c9ba))['catch'](handleError(_0x1d14e2,null));};exports[_0x65dd('0x47')]=function(_0x8c4328,_0x2cceb4){var _0x333d84={'raw':![],'where':{'id':_0x8c4328['params']['id']}},_0x5410cb={};_0x5410cb['model']=_[_0x65dd('0x34')](db[_0x65dd('0x2f')][_0x65dd('0x30')]);_0x5410cb['query']=_[_0x65dd('0x34')](_0x8c4328['query']);_0x5410cb[_0x65dd('0x3f')]=_['intersection'](_0x5410cb[_0x65dd('0x33')],_0x5410cb['query']);_0x333d84[_0x65dd('0x37')]=_['intersection'](_0x5410cb[_0x65dd('0x33')],qs[_0x65dd('0x38')](_0x8c4328[_0x65dd('0x35')][_0x65dd('0x38')]));_0x333d84[_0x65dd('0x37')]=_0x333d84[_0x65dd('0x37')][_0x65dd('0x39')]?_0x333d84[_0x65dd('0x37')]:_0x5410cb['model'];if(_0x8c4328['query'][_0x65dd('0x44')]){_0x333d84[_0x65dd('0x48')]=[{'all':!![]}];}_0x333d84=_[_0x65dd('0x42')]({},_0x333d84,_0x8c4328['options']);return db[_0x65dd('0x2f')][_0x65dd('0x49')](_0x333d84)[_0x65dd('0x28')](handleEntityNotFound(_0x2cceb4,null))[_0x65dd('0x28')](respondWithResult(_0x2cceb4,null))[_0x65dd('0x4a')](handleError(_0x2cceb4,null));};exports[_0x65dd('0x4b')]=function(_0x596bed,_0x4352c4){return db[_0x65dd('0x2f')][_0x65dd('0x4b')](_0x596bed[_0x65dd('0x4c')],{})[_0x65dd('0x28')](respondWithResult(_0x4352c4,0xc9))[_0x65dd('0x4a')](handleError(_0x4352c4,null));};exports[_0x65dd('0x27')]=function(_0x538d3b,_0x592c38){if(_0x538d3b['body']['id']){delete _0x538d3b[_0x65dd('0x4c')]['id'];}return db[_0x65dd('0x2f')][_0x65dd('0x49')]({'where':{'id':_0x538d3b['params']['id']}})[_0x65dd('0x28')](handleEntityNotFound(_0x592c38,null))[_0x65dd('0x28')](saveUpdates(_0x538d3b[_0x65dd('0x4c')],null))[_0x65dd('0x28')](respondWithResult(_0x592c38,null))[_0x65dd('0x4a')](handleError(_0x592c38,null));};exports[_0x65dd('0x29')]=function(_0x3e40d1,_0x3a4217){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3e40d1[_0x65dd('0x4d')]['id']}})[_0x65dd('0x28')](handleEntityNotFound(_0x3a4217,null))[_0x65dd('0x28')](removeEntity(_0x3a4217,null))[_0x65dd('0x4a')](handleError(_0x3a4217,null));};exports['getSubjects']=function(_0x13357e,_0x18b8db,_0x5de71b){var _0x40c3de={};var _0x2b139f={};var _0x193eff;var _0x459d9e;return db['FreshsalesConfiguration'][_0x65dd('0x4e')]({'where':{'id':_0x13357e[_0x65dd('0x4d')]['id']}})[_0x65dd('0x28')](handleEntityNotFound(_0x18b8db,null))[_0x65dd('0x28')](function(_0x28208e){if(_0x28208e){_0x193eff=_0x28208e;_0x2b139f[_0x65dd('0x33')]=_[_0x65dd('0x34')](db['FreshsalesField'][_0x65dd('0x30')]);_0x2b139f[_0x65dd('0x35')]=_[_0x65dd('0x34')](_0x13357e[_0x65dd('0x35')]);_0x2b139f[_0x65dd('0x3f')]=_[_0x65dd('0x36')](_0x2b139f[_0x65dd('0x33')],_0x2b139f[_0x65dd('0x35')]);_0x40c3de[_0x65dd('0x37')]=_[_0x65dd('0x36')](_0x2b139f[_0x65dd('0x33')],qs['fields'](_0x13357e['query'][_0x65dd('0x38')]));_0x40c3de[_0x65dd('0x37')]=_0x40c3de[_0x65dd('0x37')][_0x65dd('0x39')]?_0x40c3de[_0x65dd('0x37')]:_0x2b139f[_0x65dd('0x33')];_0x40c3de['order']=qs[_0x65dd('0x3d')](_0x13357e['query'][_0x65dd('0x3d')]);_0x40c3de[_0x65dd('0x3e')]=qs['filters'](_['pick'](_0x13357e[_0x65dd('0x35')],_0x2b139f[_0x65dd('0x3f')]));if(_0x13357e[_0x65dd('0x35')]['filter']){_0x40c3de[_0x65dd('0x3e')]=_[_0x65dd('0x42')](_0x40c3de[_0x65dd('0x3e')],{'$or':_[_0x65dd('0x2e')](_0x40c3de[_0x65dd('0x37')],function(_0x1b265f){var _0x2435eb={};_0x2435eb[_0x1b265f]={'$like':'%'+_0x13357e[_0x65dd('0x35')]['filter']+'%'};return _0x2435eb;})});}_0x40c3de=_['merge']({},_0x40c3de,_0x13357e['options']);return _0x193eff['getSubjects'](_0x40c3de);}})['then'](function(_0x52ec97){if(_0x52ec97){_0x459d9e=_0x52ec97[_0x65dd('0x39')];if(!_0x13357e[_0x65dd('0x35')][_0x65dd('0x3a')](_0x65dd('0x3b'))){_0x40c3de[_0x65dd('0x21')]=qs[_0x65dd('0x21')](_0x13357e['query']['limit']);_0x40c3de[_0x65dd('0x1f')]=qs[_0x65dd('0x1f')](_0x13357e['query'][_0x65dd('0x1f')]);}return _0x193eff[_0x65dd('0x4f')](_0x40c3de);}})['then'](function(_0x52b9c3){if(_0x52b9c3){return _0x52b9c3?{'count':_0x459d9e,'rows':_0x52b9c3}:null;}})[_0x65dd('0x28')](respondWithResult(_0x18b8db,null))['catch'](handleError(_0x18b8db,null));};exports[_0x65dd('0x50')]=function(_0x5e796a,_0x3e059a,_0x3fb704){var _0x5358cd={};var _0x23b5c9={};var _0x152ba0;var _0xee4479;return db[_0x65dd('0x2f')][_0x65dd('0x4e')]({'where':{'id':_0x5e796a[_0x65dd('0x4d')]['id']}})[_0x65dd('0x28')](handleEntityNotFound(_0x3e059a,null))['then'](function(_0x57f4fc){if(_0x57f4fc){_0x152ba0=_0x57f4fc;_0x23b5c9[_0x65dd('0x33')]=_[_0x65dd('0x34')](db[_0x65dd('0x51')]['rawAttributes']);_0x23b5c9[_0x65dd('0x35')]=_[_0x65dd('0x34')](_0x5e796a[_0x65dd('0x35')]);_0x23b5c9[_0x65dd('0x3f')]=_[_0x65dd('0x36')](_0x23b5c9['model'],_0x23b5c9['query']);_0x5358cd[_0x65dd('0x37')]=_[_0x65dd('0x36')](_0x23b5c9[_0x65dd('0x33')],qs[_0x65dd('0x38')](_0x5e796a[_0x65dd('0x35')][_0x65dd('0x38')]));_0x5358cd['attributes']=_0x5358cd[_0x65dd('0x37')][_0x65dd('0x39')]?_0x5358cd[_0x65dd('0x37')]:_0x23b5c9[_0x65dd('0x33')];_0x5358cd[_0x65dd('0x3c')]=qs[_0x65dd('0x3d')](_0x5e796a[_0x65dd('0x35')]['sort']);_0x5358cd[_0x65dd('0x3e')]=qs[_0x65dd('0x3f')](_[_0x65dd('0x40')](_0x5e796a[_0x65dd('0x35')],_0x23b5c9[_0x65dd('0x3f')]));if(_0x5e796a['query'][_0x65dd('0x41')]){_0x5358cd['where']=_['merge'](_0x5358cd[_0x65dd('0x3e')],{'$or':_[_0x65dd('0x2e')](_0x5358cd[_0x65dd('0x37')],function(_0x1aa822){var _0x37f0b7={};_0x37f0b7[_0x1aa822]={'$like':'%'+_0x5e796a['query'][_0x65dd('0x41')]+'%'};return _0x37f0b7;})});}_0x5358cd=_[_0x65dd('0x42')]({},_0x5358cd,_0x5e796a['options']);return _0x152ba0['getDescriptions'](_0x5358cd);}})[_0x65dd('0x28')](function(_0x20b71c){if(_0x20b71c){_0xee4479=_0x20b71c[_0x65dd('0x39')];if(!_0x5e796a[_0x65dd('0x35')][_0x65dd('0x3a')](_0x65dd('0x3b'))){_0x5358cd[_0x65dd('0x21')]=qs[_0x65dd('0x21')](_0x5e796a[_0x65dd('0x35')][_0x65dd('0x21')]);_0x5358cd[_0x65dd('0x1f')]=qs['offset'](_0x5e796a['query'][_0x65dd('0x1f')]);}return _0x152ba0['getDescriptions'](_0x5358cd);}})[_0x65dd('0x28')](function(_0x43a1e2){if(_0x43a1e2){return _0x43a1e2?{'count':_0xee4479,'rows':_0x43a1e2}:null;}})[_0x65dd('0x28')](respondWithResult(_0x3e059a,null))['catch'](handleError(_0x3e059a,null));};exports[_0x65dd('0x52')]=function(_0x133503,_0x4548a7,_0x452bcb){var _0x28abd4={};var _0x5f50a1={};var _0x8ba2f6;var _0x3a92c5;return db[_0x65dd('0x2f')]['findOne']({'where':{'id':_0x133503['params']['id']}})[_0x65dd('0x28')](handleEntityNotFound(_0x4548a7,null))[_0x65dd('0x28')](function(_0x5ed217){if(_0x5ed217){_0x8ba2f6=_0x5ed217;_0x5f50a1[_0x65dd('0x33')]=_['keys'](db[_0x65dd('0x51')][_0x65dd('0x30')]);_0x5f50a1['query']=_[_0x65dd('0x34')](_0x133503[_0x65dd('0x35')]);_0x5f50a1[_0x65dd('0x3f')]=_[_0x65dd('0x36')](_0x5f50a1[_0x65dd('0x33')],_0x5f50a1['query']);_0x28abd4[_0x65dd('0x37')]=_[_0x65dd('0x36')](_0x5f50a1[_0x65dd('0x33')],qs[_0x65dd('0x38')](_0x133503['query'][_0x65dd('0x38')]));_0x28abd4[_0x65dd('0x37')]=_0x28abd4[_0x65dd('0x37')][_0x65dd('0x39')]?_0x28abd4[_0x65dd('0x37')]:_0x5f50a1['model'];_0x28abd4[_0x65dd('0x3c')]=qs[_0x65dd('0x3d')](_0x133503[_0x65dd('0x35')][_0x65dd('0x3d')]);_0x28abd4[_0x65dd('0x3e')]=qs[_0x65dd('0x3f')](_[_0x65dd('0x40')](_0x133503['query'],_0x5f50a1['filters']));if(_0x133503['query'][_0x65dd('0x41')]){_0x28abd4[_0x65dd('0x3e')]=_[_0x65dd('0x42')](_0x28abd4[_0x65dd('0x3e')],{'$or':_[_0x65dd('0x2e')](_0x28abd4[_0x65dd('0x37')],function(_0x164902){var _0x205776={};_0x205776[_0x164902]={'$like':'%'+_0x133503['query'][_0x65dd('0x41')]+'%'};return _0x205776;})});}_0x28abd4=_[_0x65dd('0x42')]({},_0x28abd4,_0x133503[_0x65dd('0x53')]);return _0x8ba2f6[_0x65dd('0x52')](_0x28abd4);}})[_0x65dd('0x28')](function(_0x463901){if(_0x463901){_0x3a92c5=_0x463901['length'];if(!_0x133503[_0x65dd('0x35')][_0x65dd('0x3a')](_0x65dd('0x3b'))){_0x28abd4['limit']=qs[_0x65dd('0x21')](_0x133503[_0x65dd('0x35')]['limit']);_0x28abd4[_0x65dd('0x1f')]=qs[_0x65dd('0x1f')](_0x133503[_0x65dd('0x35')]['offset']);}return _0x8ba2f6[_0x65dd('0x52')](_0x28abd4);}})[_0x65dd('0x28')](function(_0x4502f2){if(_0x4502f2){return _0x4502f2?{'count':_0x3a92c5,'rows':_0x4502f2}:null;}})['then'](respondWithResult(_0x4548a7,null))[_0x65dd('0x4a')](handleError(_0x4548a7,null));}; \ No newline at end of file +var _0xe2ef=['request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','find','catch','body','getSubjects','findOne','order','sort','pick','getDescriptions','nolimit','getFields','eml-format','rimraf','fast-json-patch'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0xe2ef,0xe1));var _0xfe2e=function(_0x5e7638,_0x2044d4){_0x5e7638=_0x5e7638-0x0;var _0x17f2ae=_0xe2ef[_0x5e7638];return _0x17f2ae;};'use strict';var emlformat=require(_0xfe2e('0x0'));var rimraf=require(_0xfe2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2e('0x2'));var rp=require(_0xfe2e('0x3'));var moment=require(_0xfe2e('0x4'));var BPromise=require(_0xfe2e('0x5'));var Mustache=require('mustache');var util=require(_0xfe2e('0x6'));var path=require(_0xfe2e('0x7'));var sox=require('sox');var csv=require(_0xfe2e('0x8'));var ejs=require(_0xfe2e('0x9'));var fs=require('fs');var fs_extra=require(_0xfe2e('0xa'));var _=require(_0xfe2e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2e('0xc'));var toCsv=require(_0xfe2e('0x8'));var querystring=require(_0xfe2e('0xd'));var Papa=require(_0xfe2e('0xe'));var Redis=require('ioredis');var authService=require(_0xfe2e('0xf'));var qs=require(_0xfe2e('0x10'));var as=require(_0xfe2e('0x11'));var hardwareService=require(_0xfe2e('0x12'));var logger=require('../../config/logger')(_0xfe2e('0x13'));var utils=require(_0xfe2e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfe2e('0x15'));var db=require(_0xfe2e('0x16'))['db'];function respondWithStatusCode(_0x1ad9bd,_0xd5b34b){_0xd5b34b=_0xd5b34b||0xcc;return function(_0x27ca7b){if(_0x27ca7b){return _0x1ad9bd[_0xfe2e('0x17')](_0xd5b34b);}return _0x1ad9bd[_0xfe2e('0x18')](_0xd5b34b)[_0xfe2e('0x19')]();};}function respondWithResult(_0x1a7b21,_0x290306){_0x290306=_0x290306||0xc8;return function(_0x11ab20){if(_0x11ab20){return _0x1a7b21['status'](_0x290306)[_0xfe2e('0x1a')](_0x11ab20);}};}function respondWithFilteredResult(_0x3343f9,_0x363028){return function(_0x2b3545){if(_0x2b3545){var _0x147037=typeof _0x363028[_0xfe2e('0x1b')]===_0xfe2e('0x1c')&&typeof _0x363028[_0xfe2e('0x1d')]===_0xfe2e('0x1c');var _0x52ce2c=_0x2b3545[_0xfe2e('0x1e')];var _0x254be4=_0x147037?0x0:_0x363028[_0xfe2e('0x1b')];var _0x2d76c6=_0x147037?_0x2b3545[_0xfe2e('0x1e')]:_0x363028[_0xfe2e('0x1b')]+_0x363028[_0xfe2e('0x1d')];var _0x433c42;if(_0x2d76c6>=_0x52ce2c){_0x2d76c6=_0x52ce2c;_0x433c42=0xc8;}else{_0x433c42=0xce;}_0x3343f9[_0xfe2e('0x18')](_0x433c42);return _0x3343f9[_0xfe2e('0x1f')](_0xfe2e('0x20'),_0x254be4+'-'+_0x2d76c6+'/'+_0x52ce2c)[_0xfe2e('0x1a')](_0x2b3545);}return null;};}function patchUpdates(_0x297900){return function(_0x3837cf){try{jsonpatch[_0xfe2e('0x21')](_0x3837cf,_0x297900,!![]);}catch(_0x36a597){return BPromise[_0xfe2e('0x22')](_0x36a597);}return _0x3837cf[_0xfe2e('0x23')]();};}function saveUpdates(_0x5d6043,_0x1a3597){return function(_0x598aac){if(_0x598aac){return _0x598aac[_0xfe2e('0x24')](_0x5d6043)[_0xfe2e('0x25')](function(_0xaf732a){return _0xaf732a;});}return null;};}function removeEntity(_0x3db39b,_0x16fff8){return function(_0x59ffd4){if(_0x59ffd4){return _0x59ffd4[_0xfe2e('0x26')]()[_0xfe2e('0x25')](function(){_0x3db39b[_0xfe2e('0x18')](0xcc)[_0xfe2e('0x19')]();});}};}function handleEntityNotFound(_0x58f379,_0x5919ba){return function(_0x5eef4e){if(!_0x5eef4e){_0x58f379[_0xfe2e('0x17')](0x194);}return _0x5eef4e;};}function handleError(_0x4f3949,_0x5ea0a0){_0x5ea0a0=_0x5ea0a0||0x1f4;return function(_0x534db9){logger[_0xfe2e('0x27')](_0x534db9['stack']);if(_0x534db9[_0xfe2e('0x28')]){delete _0x534db9[_0xfe2e('0x28')];}_0x4f3949[_0xfe2e('0x18')](_0x5ea0a0)[_0xfe2e('0x29')](_0x534db9);};}exports[_0xfe2e('0x2a')]=function(_0x37367e,_0x107dc5){var _0x4b8041={},_0x495ec4={},_0x2fc5ce={'count':0x0,'rows':[]};var _0x2c1094=_[_0xfe2e('0x2b')](db[_0xfe2e('0x2c')]['rawAttributes'],function(_0x5bd01e){return{'name':_0x5bd01e['fieldName'],'type':_0x5bd01e[_0xfe2e('0x2d')]['key']};});_0x495ec4['model']=_[_0xfe2e('0x2b')](_0x2c1094,'name');_0x495ec4[_0xfe2e('0x2e')]=_[_0xfe2e('0x2f')](_0x37367e[_0xfe2e('0x2e')]);_0x495ec4[_0xfe2e('0x30')]=_[_0xfe2e('0x31')](_0x495ec4[_0xfe2e('0x32')],_0x495ec4['query']);_0x4b8041['attributes']=_[_0xfe2e('0x31')](_0x495ec4[_0xfe2e('0x32')],qs[_0xfe2e('0x33')](_0x37367e[_0xfe2e('0x2e')]['fields']));_0x4b8041[_0xfe2e('0x34')]=_0x4b8041[_0xfe2e('0x34')][_0xfe2e('0x35')]?_0x4b8041[_0xfe2e('0x34')]:_0x495ec4[_0xfe2e('0x32')];if(!_0x37367e[_0xfe2e('0x2e')][_0xfe2e('0x36')]('nolimit')){_0x4b8041[_0xfe2e('0x1d')]=qs[_0xfe2e('0x1d')](_0x37367e[_0xfe2e('0x2e')]['limit']);_0x4b8041[_0xfe2e('0x1b')]=qs[_0xfe2e('0x1b')](_0x37367e[_0xfe2e('0x2e')]['offset']);}_0x4b8041['order']=qs['sort'](_0x37367e['query']['sort']);_0x4b8041[_0xfe2e('0x37')]=qs[_0xfe2e('0x30')](_['pick'](_0x37367e[_0xfe2e('0x2e')],_0x495ec4[_0xfe2e('0x30')]),_0x2c1094);if(_0x37367e[_0xfe2e('0x2e')][_0xfe2e('0x38')]){_0x4b8041['where']=_[_0xfe2e('0x39')](_0x4b8041[_0xfe2e('0x37')],{'$or':_[_0xfe2e('0x2b')](_0x2c1094,function(_0x53451f){if(_0x53451f[_0xfe2e('0x2d')]!==_0xfe2e('0x3a')){var _0x3dda24={};_0x3dda24[_0x53451f['name']]={'$like':'%'+_0x37367e[_0xfe2e('0x2e')][_0xfe2e('0x38')]+'%'};return _0x3dda24;}})});}_0x4b8041=_[_0xfe2e('0x39')]({},_0x4b8041,_0x37367e[_0xfe2e('0x3b')]);var _0x28f4f9={'where':_0x4b8041[_0xfe2e('0x37')]};return db[_0xfe2e('0x2c')][_0xfe2e('0x1e')](_0x28f4f9)['then'](function(_0x26eb09){_0x2fc5ce[_0xfe2e('0x1e')]=_0x26eb09;if(_0x37367e[_0xfe2e('0x2e')]['includeAll']){_0x4b8041[_0xfe2e('0x3c')]=[{'all':!![]}];}return db[_0xfe2e('0x2c')][_0xfe2e('0x3d')](_0x4b8041);})['then'](function(_0x45be9e){_0x2fc5ce[_0xfe2e('0x3e')]=_0x45be9e;return _0x2fc5ce;})[_0xfe2e('0x25')](respondWithFilteredResult(_0x107dc5,_0x4b8041))['catch'](handleError(_0x107dc5,null));};exports['show']=function(_0x51c203,_0x21ef6c){var _0x322999={'raw':![],'where':{'id':_0x51c203[_0xfe2e('0x3f')]['id']}},_0x1851cb={};_0x1851cb[_0xfe2e('0x32')]=_['keys'](db[_0xfe2e('0x2c')][_0xfe2e('0x40')]);_0x1851cb['query']=_[_0xfe2e('0x2f')](_0x51c203[_0xfe2e('0x2e')]);_0x1851cb[_0xfe2e('0x30')]=_[_0xfe2e('0x31')](_0x1851cb[_0xfe2e('0x32')],_0x1851cb[_0xfe2e('0x2e')]);_0x322999[_0xfe2e('0x34')]=_[_0xfe2e('0x31')](_0x1851cb['model'],qs[_0xfe2e('0x33')](_0x51c203[_0xfe2e('0x2e')]['fields']));_0x322999[_0xfe2e('0x34')]=_0x322999['attributes'][_0xfe2e('0x35')]?_0x322999[_0xfe2e('0x34')]:_0x1851cb[_0xfe2e('0x32')];if(_0x51c203[_0xfe2e('0x2e')]['includeAll']){_0x322999[_0xfe2e('0x3c')]=[{'all':!![]}];}_0x322999=_['merge']({},_0x322999,_0x51c203[_0xfe2e('0x3b')]);return db[_0xfe2e('0x2c')][_0xfe2e('0x41')](_0x322999)[_0xfe2e('0x25')](handleEntityNotFound(_0x21ef6c,null))[_0xfe2e('0x25')](respondWithResult(_0x21ef6c,null))[_0xfe2e('0x42')](handleError(_0x21ef6c,null));};exports['create']=function(_0x5e94b3,_0x3fd8de){return db['FreshsalesConfiguration']['create'](_0x5e94b3[_0xfe2e('0x43')],{})[_0xfe2e('0x25')](respondWithResult(_0x3fd8de,0xc9))[_0xfe2e('0x42')](handleError(_0x3fd8de,null));};exports[_0xfe2e('0x24')]=function(_0x549a3a,_0x5a45dd){if(_0x549a3a[_0xfe2e('0x43')]['id']){delete _0x549a3a[_0xfe2e('0x43')]['id'];}return db[_0xfe2e('0x2c')][_0xfe2e('0x41')]({'where':{'id':_0x549a3a['params']['id']}})[_0xfe2e('0x25')](handleEntityNotFound(_0x5a45dd,null))[_0xfe2e('0x25')](saveUpdates(_0x549a3a[_0xfe2e('0x43')],null))[_0xfe2e('0x25')](respondWithResult(_0x5a45dd,null))['catch'](handleError(_0x5a45dd,null));};exports[_0xfe2e('0x26')]=function(_0x5bee55,_0x1449ab){return db[_0xfe2e('0x2c')]['find']({'where':{'id':_0x5bee55[_0xfe2e('0x3f')]['id']}})[_0xfe2e('0x25')](handleEntityNotFound(_0x1449ab,null))[_0xfe2e('0x25')](removeEntity(_0x1449ab,null))['catch'](handleError(_0x1449ab,null));};exports[_0xfe2e('0x44')]=function(_0x75b93d,_0x35d542,_0x26f87a){var _0x43a20b={};var _0x223229={};var _0x5106f8;var _0x243d17;return db[_0xfe2e('0x2c')][_0xfe2e('0x45')]({'where':{'id':_0x75b93d[_0xfe2e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x35d542,null))[_0xfe2e('0x25')](function(_0xd7407b){if(_0xd7407b){_0x5106f8=_0xd7407b;_0x223229[_0xfe2e('0x32')]=_['keys'](db['FreshsalesField'][_0xfe2e('0x40')]);_0x223229['query']=_[_0xfe2e('0x2f')](_0x75b93d['query']);_0x223229[_0xfe2e('0x30')]=_['intersection'](_0x223229[_0xfe2e('0x32')],_0x223229[_0xfe2e('0x2e')]);_0x43a20b[_0xfe2e('0x34')]=_[_0xfe2e('0x31')](_0x223229['model'],qs[_0xfe2e('0x33')](_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x33')]));_0x43a20b[_0xfe2e('0x34')]=_0x43a20b[_0xfe2e('0x34')][_0xfe2e('0x35')]?_0x43a20b['attributes']:_0x223229[_0xfe2e('0x32')];_0x43a20b[_0xfe2e('0x46')]=qs['sort'](_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x47')]);_0x43a20b[_0xfe2e('0x37')]=qs[_0xfe2e('0x30')](_[_0xfe2e('0x48')](_0x75b93d['query'],_0x223229['filters']));if(_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x38')]){_0x43a20b['where']=_[_0xfe2e('0x39')](_0x43a20b[_0xfe2e('0x37')],{'$or':_['map'](_0x43a20b[_0xfe2e('0x34')],function(_0x2c63b9){var _0x2bf586={};_0x2bf586[_0x2c63b9]={'$like':'%'+_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x38')]+'%'};return _0x2bf586;})});}_0x43a20b=_['merge']({},_0x43a20b,_0x75b93d[_0xfe2e('0x3b')]);return _0x5106f8['getSubjects'](_0x43a20b);}})[_0xfe2e('0x25')](function(_0x24a065){if(_0x24a065){_0x243d17=_0x24a065[_0xfe2e('0x35')];if(!_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x36')]('nolimit')){_0x43a20b[_0xfe2e('0x1d')]=qs[_0xfe2e('0x1d')](_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x1d')]);_0x43a20b[_0xfe2e('0x1b')]=qs[_0xfe2e('0x1b')](_0x75b93d[_0xfe2e('0x2e')][_0xfe2e('0x1b')]);}return _0x5106f8[_0xfe2e('0x44')](_0x43a20b);}})[_0xfe2e('0x25')](function(_0x13b164){if(_0x13b164){return _0x13b164?{'count':_0x243d17,'rows':_0x13b164}:null;}})[_0xfe2e('0x25')](respondWithResult(_0x35d542,null))[_0xfe2e('0x42')](handleError(_0x35d542,null));};exports[_0xfe2e('0x49')]=function(_0x4cb0eb,_0x319764,_0x2d0458){var _0x4d4ac2={};var _0x3fb69c={};var _0x406c5f;var _0x5afee3;return db[_0xfe2e('0x2c')][_0xfe2e('0x45')]({'where':{'id':_0x4cb0eb[_0xfe2e('0x3f')]['id']}})[_0xfe2e('0x25')](handleEntityNotFound(_0x319764,null))['then'](function(_0x47ccd8){if(_0x47ccd8){_0x406c5f=_0x47ccd8;_0x3fb69c[_0xfe2e('0x32')]=_[_0xfe2e('0x2f')](db['FreshsalesField'][_0xfe2e('0x40')]);_0x3fb69c['query']=_[_0xfe2e('0x2f')](_0x4cb0eb[_0xfe2e('0x2e')]);_0x3fb69c[_0xfe2e('0x30')]=_[_0xfe2e('0x31')](_0x3fb69c['model'],_0x3fb69c[_0xfe2e('0x2e')]);_0x4d4ac2[_0xfe2e('0x34')]=_['intersection'](_0x3fb69c[_0xfe2e('0x32')],qs[_0xfe2e('0x33')](_0x4cb0eb[_0xfe2e('0x2e')][_0xfe2e('0x33')]));_0x4d4ac2[_0xfe2e('0x34')]=_0x4d4ac2[_0xfe2e('0x34')]['length']?_0x4d4ac2['attributes']:_0x3fb69c[_0xfe2e('0x32')];_0x4d4ac2['order']=qs['sort'](_0x4cb0eb['query'][_0xfe2e('0x47')]);_0x4d4ac2[_0xfe2e('0x37')]=qs[_0xfe2e('0x30')](_[_0xfe2e('0x48')](_0x4cb0eb[_0xfe2e('0x2e')],_0x3fb69c[_0xfe2e('0x30')]));if(_0x4cb0eb[_0xfe2e('0x2e')][_0xfe2e('0x38')]){_0x4d4ac2[_0xfe2e('0x37')]=_[_0xfe2e('0x39')](_0x4d4ac2['where'],{'$or':_[_0xfe2e('0x2b')](_0x4d4ac2[_0xfe2e('0x34')],function(_0x3a42e0){var _0x97fa0b={};_0x97fa0b[_0x3a42e0]={'$like':'%'+_0x4cb0eb['query'][_0xfe2e('0x38')]+'%'};return _0x97fa0b;})});}_0x4d4ac2=_[_0xfe2e('0x39')]({},_0x4d4ac2,_0x4cb0eb[_0xfe2e('0x3b')]);return _0x406c5f[_0xfe2e('0x49')](_0x4d4ac2);}})[_0xfe2e('0x25')](function(_0x53bf87){if(_0x53bf87){_0x5afee3=_0x53bf87[_0xfe2e('0x35')];if(!_0x4cb0eb[_0xfe2e('0x2e')][_0xfe2e('0x36')](_0xfe2e('0x4a'))){_0x4d4ac2[_0xfe2e('0x1d')]=qs[_0xfe2e('0x1d')](_0x4cb0eb[_0xfe2e('0x2e')][_0xfe2e('0x1d')]);_0x4d4ac2['offset']=qs[_0xfe2e('0x1b')](_0x4cb0eb['query'][_0xfe2e('0x1b')]);}return _0x406c5f[_0xfe2e('0x49')](_0x4d4ac2);}})['then'](function(_0x4dfb80){if(_0x4dfb80){return _0x4dfb80?{'count':_0x5afee3,'rows':_0x4dfb80}:null;}})[_0xfe2e('0x25')](respondWithResult(_0x319764,null))[_0xfe2e('0x42')](handleError(_0x319764,null));};exports['getFields']=function(_0x36f32a,_0x25040f,_0x397001){var _0x182dab={};var _0x231bbe={};var _0x66b85e;var _0x586118;return db[_0xfe2e('0x2c')][_0xfe2e('0x45')]({'where':{'id':_0x36f32a[_0xfe2e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x25040f,null))[_0xfe2e('0x25')](function(_0x71119c){if(_0x71119c){_0x66b85e=_0x71119c;_0x231bbe[_0xfe2e('0x32')]=_[_0xfe2e('0x2f')](db['FreshsalesField'][_0xfe2e('0x40')]);_0x231bbe[_0xfe2e('0x2e')]=_[_0xfe2e('0x2f')](_0x36f32a[_0xfe2e('0x2e')]);_0x231bbe['filters']=_[_0xfe2e('0x31')](_0x231bbe[_0xfe2e('0x32')],_0x231bbe[_0xfe2e('0x2e')]);_0x182dab[_0xfe2e('0x34')]=_['intersection'](_0x231bbe[_0xfe2e('0x32')],qs[_0xfe2e('0x33')](_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x33')]));_0x182dab['attributes']=_0x182dab[_0xfe2e('0x34')]['length']?_0x182dab['attributes']:_0x231bbe['model'];_0x182dab[_0xfe2e('0x46')]=qs[_0xfe2e('0x47')](_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x47')]);_0x182dab[_0xfe2e('0x37')]=qs['filters'](_[_0xfe2e('0x48')](_0x36f32a['query'],_0x231bbe[_0xfe2e('0x30')]));if(_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x38')]){_0x182dab['where']=_[_0xfe2e('0x39')](_0x182dab[_0xfe2e('0x37')],{'$or':_[_0xfe2e('0x2b')](_0x182dab[_0xfe2e('0x34')],function(_0x5db019){var _0x2b4d8f={};_0x2b4d8f[_0x5db019]={'$like':'%'+_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x38')]+'%'};return _0x2b4d8f;})});}_0x182dab=_[_0xfe2e('0x39')]({},_0x182dab,_0x36f32a[_0xfe2e('0x3b')]);return _0x66b85e[_0xfe2e('0x4b')](_0x182dab);}})['then'](function(_0xfb8a16){if(_0xfb8a16){_0x586118=_0xfb8a16['length'];if(!_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x36')]('nolimit')){_0x182dab[_0xfe2e('0x1d')]=qs[_0xfe2e('0x1d')](_0x36f32a[_0xfe2e('0x2e')][_0xfe2e('0x1d')]);_0x182dab[_0xfe2e('0x1b')]=qs['offset'](_0x36f32a[_0xfe2e('0x2e')]['offset']);}return _0x66b85e[_0xfe2e('0x4b')](_0x182dab);}})['then'](function(_0x5866a4){if(_0x5866a4){return _0x5866a4?{'count':_0x586118,'rows':_0x5866a4}:null;}})[_0xfe2e('0x25')](respondWithResult(_0x25040f,null))[_0xfe2e('0x42')](handleError(_0x25040f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4569147..0b036e1 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 _0x4755=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x4755,0xdd));var _0x5475=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0x4755[_0x2dee2f];return _0x327c18;};'use strict';var _=require(_0x5475('0x0'));var util=require(_0x5475('0x1'));var logger=require(_0x5475('0x2'))(_0x5475('0x3'));var moment=require(_0x5475('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5475('0x5'));var rimraf=require('rimraf');var config=require(_0x5475('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x5475('0x7')]=function(_0x3afe61,_0x2c82a6){return _0x3afe61[_0x5475('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x5475('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a4c=['int_freshsales_configurations','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x186d4a,_0x2aa165){var _0x1a4b9e=function(_0x4bd16e){while(--_0x4bd16e){_0x186d4a['push'](_0x186d4a['shift']());}};_0x1a4b9e(++_0x2aa165);}(_0x3a4c,0xbc));var _0xc3a4=function(_0x809ec2,_0x1e3909){_0x809ec2=_0x809ec2-0x0;var _0x56c9eb=_0x3a4c[_0x809ec2];return _0x56c9eb;};'use strict';var _=require(_0xc3a4('0x0'));var util=require(_0xc3a4('0x1'));var logger=require('../../config/logger')(_0xc3a4('0x2'));var moment=require(_0xc3a4('0x3'));var BPromise=require(_0xc3a4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3a4('0x5'));var rimraf=require(_0xc3a4('0x6'));var config=require(_0xc3a4('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xc3a4('0x8')]=function(_0x53ef9e,_0x40c0fa){return _0x53ef9e[_0xc3a4('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0xc3a4('0xa'),'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 64ac56b..36e31a7 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 _0x088d=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x3f83b2,_0x1ab68e){var _0x3e3451=function(_0x2e1e71){while(--_0x2e1e71){_0x3f83b2['push'](_0x3f83b2['shift']());}};_0x3e3451(++_0x1ab68e);}(_0x088d,0x1ca));var _0xd088=function(_0xb817c6,_0x45038c){_0xb817c6=_0xb817c6-0x0;var _0x513b57=_0x088d[_0xb817c6];return _0x513b57;};'use strict';var _=require('lodash');var util=require(_0xd088('0x0'));var moment=require('moment');var BPromise=require(_0xd088('0x1'));var rs=require(_0xd088('0x2'));var fs=require('fs');var Redis=require(_0xd088('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd088('0x4'));var logger=require(_0xd088('0x5'))(_0xd088('0x6'));var config=require(_0xd088('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x367cee,_0x35a03a,_0x19c1b2){return new BPromise(function(_0x17ed20,_0xa77f0e){return client[_0xd088('0x8')](_0x367cee,_0x19c1b2)[_0xd088('0x9')](function(_0x2aa7d2){logger[_0xd088('0xa')](_0xd088('0xb'),_0x35a03a,_0xd088('0xc'));logger[_0xd088('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x35a03a,_0xd088('0xc'),JSON[_0xd088('0xe')](_0x2aa7d2));if(_0x2aa7d2[_0xd088('0xf')]){if(_0x2aa7d2[_0xd088('0xf')][_0xd088('0x10')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x35a03a,_0x2aa7d2[_0xd088('0xf')][_0xd088('0x11')]);return _0xa77f0e(_0x2aa7d2[_0xd088('0xf')][_0xd088('0x11')]);}logger[_0xd088('0xf')](_0xd088('0xb'),_0x35a03a,_0x2aa7d2['error'][_0xd088('0x11')]);return _0x17ed20(_0x2aa7d2[_0xd088('0xf')][_0xd088('0x11')]);}else{logger[_0xd088('0xa')](_0xd088('0xb'),_0x35a03a,_0xd088('0xc'));_0x17ed20(_0x2aa7d2[_0xd088('0x12')]['message']);}})[_0xd088('0x13')](function(_0x57bf9f){logger[_0xd088('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x35a03a,_0x57bf9f);_0xa77f0e(_0x57bf9f);});});} \ No newline at end of file +var _0x4ef5=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8e4cd2,_0x1080e5){var _0x37a4aa=function(_0x34baf1){while(--_0x34baf1){_0x8e4cd2['push'](_0x8e4cd2['shift']());}};_0x37a4aa(++_0x1080e5);}(_0x4ef5,0xd2));var _0x54ef=function(_0x58ed84,_0x2d28a8){_0x58ed84=_0x58ed84-0x0;var _0x368f59=_0x4ef5[_0x58ed84];return _0x368f59;};'use strict';var _=require('lodash');var util=require(_0x54ef('0x0'));var moment=require(_0x54ef('0x1'));var BPromise=require('bluebird');var rs=require(_0x54ef('0x2'));var fs=require('fs');var Redis=require(_0x54ef('0x3'));var db=require(_0x54ef('0x4'))['db'];var utils=require(_0x54ef('0x5'));var logger=require(_0x54ef('0x6'))(_0x54ef('0x7'));var config=require(_0x54ef('0x8'));var jayson=require(_0x54ef('0x9'));var client=jayson[_0x54ef('0xa')][_0x54ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x360163,_0x477a7c,_0x8b7dbd){return new BPromise(function(_0x4023db,_0x189373){return client[_0x54ef('0xc')](_0x360163,_0x8b7dbd)[_0x54ef('0xd')](function(_0x188b58){logger[_0x54ef('0xe')](_0x54ef('0xf'),_0x477a7c,_0x54ef('0x10'));logger[_0x54ef('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x477a7c,'request\x20sent',JSON[_0x54ef('0x12')](_0x188b58));if(_0x188b58[_0x54ef('0x13')]){if(_0x188b58[_0x54ef('0x13')][_0x54ef('0x14')]===0x1f4){logger[_0x54ef('0x13')](_0x54ef('0xf'),_0x477a7c,_0x188b58[_0x54ef('0x13')][_0x54ef('0x15')]);return _0x189373(_0x188b58[_0x54ef('0x13')][_0x54ef('0x15')]);}logger[_0x54ef('0x13')](_0x54ef('0xf'),_0x477a7c,_0x188b58[_0x54ef('0x13')]['message']);return _0x4023db(_0x188b58[_0x54ef('0x13')][_0x54ef('0x15')]);}else{logger[_0x54ef('0xe')](_0x54ef('0xf'),_0x477a7c,'request\x20sent');_0x4023db(_0x188b58['result'][_0x54ef('0x15')]);}})['catch'](function(_0x3e9f45){logger[_0x54ef('0x13')](_0x54ef('0xf'),_0x477a7c,_0x3e9f45);_0x189373(_0x3e9f45);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1854268..ccb9ed9 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 _0x0aaf=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0x0aaf[_0x39479f];return _0x4a6d96;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0aa('0x0'));var timeout=require(_0xf0aa('0x1'));var express=require(_0xf0aa('0x2'));var router=express[_0xf0aa('0x3')]();var fs_extra=require(_0xf0aa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0aa('0x5'));var config=require(_0xf0aa('0x6'));var controller=require('./intFreshsalesField.controller');router[_0xf0aa('0x7')]('/',auth['isAuthenticated'](),controller[_0xf0aa('0x8')]);router['get'](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xb')]);router['post']('/',auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xc')]);router['put'](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xd')]);router[_0xf0aa('0xe')](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xf')]);module[_0xf0aa('0x10')]=router; \ No newline at end of file +var _0x1bb2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1bb2,0x152));var _0x21bb=function(_0x3831bc,_0x41279f){_0x3831bc=_0x3831bc-0x0;var _0x147995=_0x1bb2[_0x3831bc];return _0x147995;};'use strict';var multer=require('multer');var util=require(_0x21bb('0x0'));var path=require(_0x21bb('0x1'));var timeout=require(_0x21bb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x21bb('0x3'));var auth=require(_0x21bb('0x4'));var interaction=require(_0x21bb('0x5'));var config=require(_0x21bb('0x6'));var controller=require(_0x21bb('0x7'));router[_0x21bb('0x8')]('/',auth[_0x21bb('0x9')](),controller[_0x21bb('0xa')]);router[_0x21bb('0x8')](_0x21bb('0xb'),auth[_0x21bb('0x9')](),controller[_0x21bb('0xc')]);router['post']('/',auth[_0x21bb('0x9')](),controller['create']);router[_0x21bb('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x21bb('0xe')]);router[_0x21bb('0xf')](_0x21bb('0xb'),auth[_0x21bb('0x9')](),controller[_0x21bb('0x10')]);module[_0x21bb('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 84dec13..384881c 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 _0x4b03=['STRING','ENUM','sequelize','exports','variable','customVariable','picklist','string'];(function(_0x230806,_0x15c50c){var _0x24501e=function(_0x1a6b06){while(--_0x1a6b06){_0x230806['push'](_0x230806['shift']());}};_0x24501e(++_0x15c50c);}(_0x4b03,0x162));var _0x34b0=function(_0x2a8eab,_0x3ce63b){_0x2a8eab=_0x2a8eab-0x0;var _0x5abca4=_0x4b03[_0x2a8eab];return _0x5abca4;};'use strict';var Sequelize=require(_0x34b0('0x0'));module[_0x34b0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x34b0('0x2'),_0x34b0('0x3'),'keyValue',_0x34b0('0x4')),'defaultValue':_0x34b0('0x5')},'content':{'type':Sequelize[_0x34b0('0x6')]},'key':{'type':Sequelize[_0x34b0('0x6')]},'keyType':{'type':Sequelize[_0x34b0('0x7')](_0x34b0('0x5'),_0x34b0('0x2'),_0x34b0('0x3'))},'keyContent':{'type':Sequelize[_0x34b0('0x6')]},'idField':{'type':Sequelize[_0x34b0('0x6')]},'nameField':{'type':Sequelize[_0x34b0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x04f5=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0x04f5,0x138));var _0x504f=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x04f5[_0x328534];return _0x2796c0;};'use strict';var Sequelize=require(_0x504f('0x0'));module[_0x504f('0x1')]={'type':{'type':Sequelize[_0x504f('0x2')](_0x504f('0x3'),_0x504f('0x4'),_0x504f('0x5'),_0x504f('0x6'),_0x504f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x504f('0x8')]},'keyType':{'type':Sequelize[_0x504f('0x2')](_0x504f('0x3'),_0x504f('0x4'),_0x504f('0x5'))},'keyContent':{'type':Sequelize[_0x504f('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x504f('0x8')]},'customField':{'type':Sequelize[_0x504f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x504f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 462227c..97e0085 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 _0xa749=['util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','then','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','FreshsalesField','includeAll','include','findAll','rows','show','params','rawAttributes','options','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3ba748,_0x4b8fb9){var _0x5b04e2=function(_0x16bb9e){while(--_0x16bb9e){_0x3ba748['push'](_0x3ba748['shift']());}};_0x5b04e2(++_0x4b8fb9);}(_0xa749,0x1c0));var _0x9a74=function(_0x38d25d,_0x553433){_0x38d25d=_0x38d25d-0x0;var _0x2d6844=_0xa749[_0x38d25d];return _0x2d6844;};'use strict';var emlformat=require(_0x9a74('0x0'));var rimraf=require(_0x9a74('0x1'));var zipdir=require(_0x9a74('0x2'));var jsonpatch=require(_0x9a74('0x3'));var rp=require(_0x9a74('0x4'));var moment=require(_0x9a74('0x5'));var BPromise=require(_0x9a74('0x6'));var Mustache=require(_0x9a74('0x7'));var util=require(_0x9a74('0x8'));var path=require(_0x9a74('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a74('0xa'));var fs=require('fs');var fs_extra=require(_0x9a74('0xb'));var _=require(_0x9a74('0xc'));var squel=require('squel');var crypto=require(_0x9a74('0xd'));var jsforce=require(_0x9a74('0xe'));var deskjs=require(_0x9a74('0xf'));var toCsv=require(_0x9a74('0x10'));var querystring=require(_0x9a74('0x11'));var Papa=require(_0x9a74('0x12'));var Redis=require(_0x9a74('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9a74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a74('0x15'))(_0x9a74('0x16'));var utils=require(_0x9a74('0x17'));var config=require(_0x9a74('0x18'));var licenseUtil=require(_0x9a74('0x19'));var db=require(_0x9a74('0x1a'))['db'];function respondWithStatusCode(_0x13445a,_0x5159c8){_0x5159c8=_0x5159c8||0xcc;return function(_0x103976){if(_0x103976){return _0x13445a[_0x9a74('0x1b')](_0x5159c8);}return _0x13445a[_0x9a74('0x1c')](_0x5159c8)[_0x9a74('0x1d')]();};}function respondWithResult(_0x5441d4,_0x261a6c){_0x261a6c=_0x261a6c||0xc8;return function(_0x4b8d40){if(_0x4b8d40){return _0x5441d4['status'](_0x261a6c)[_0x9a74('0x1e')](_0x4b8d40);}};}function respondWithFilteredResult(_0x4696f8,_0x6b1301){return function(_0x5653ea){if(_0x5653ea){var _0x237f9d=typeof _0x6b1301[_0x9a74('0x1f')]===_0x9a74('0x20')&&typeof _0x6b1301[_0x9a74('0x21')]===_0x9a74('0x20');var _0x1c027c=_0x5653ea[_0x9a74('0x22')];var _0x2323cd=_0x237f9d?0x0:_0x6b1301[_0x9a74('0x1f')];var _0x55f1d3=_0x237f9d?_0x5653ea['count']:_0x6b1301['offset']+_0x6b1301[_0x9a74('0x21')];var _0x6db634;if(_0x55f1d3>=_0x1c027c){_0x55f1d3=_0x1c027c;_0x6db634=0xc8;}else{_0x6db634=0xce;}_0x4696f8[_0x9a74('0x1c')](_0x6db634);return _0x4696f8[_0x9a74('0x23')]('Content-Range',_0x2323cd+'-'+_0x55f1d3+'/'+_0x1c027c)['json'](_0x5653ea);}return null;};}function patchUpdates(_0x270e5b){return function(_0x273ada){try{jsonpatch['apply'](_0x273ada,_0x270e5b,!![]);}catch(_0x41c55c){return BPromise[_0x9a74('0x24')](_0x41c55c);}return _0x273ada[_0x9a74('0x25')]();};}function saveUpdates(_0x1d5f00,_0x2c4941){return function(_0x3c3d14){if(_0x3c3d14){return _0x3c3d14['update'](_0x1d5f00)['then'](function(_0x662856){return _0x662856;});}return null;};}function removeEntity(_0x39da29,_0x52d664){return function(_0xb613be){if(_0xb613be){return _0xb613be[_0x9a74('0x26')]()[_0x9a74('0x27')](function(){_0x39da29['status'](0xcc)[_0x9a74('0x1d')]();});}};}function handleEntityNotFound(_0x279d17,_0x2b9de3){return function(_0x40c196){if(!_0x40c196){_0x279d17[_0x9a74('0x1b')](0x194);}return _0x40c196;};}function handleError(_0x43e58e,_0x160f4b){_0x160f4b=_0x160f4b||0x1f4;return function(_0x5097f6){logger[_0x9a74('0x28')](_0x5097f6[_0x9a74('0x29')]);if(_0x5097f6[_0x9a74('0x2a')]){delete _0x5097f6[_0x9a74('0x2a')];}_0x43e58e[_0x9a74('0x1c')](_0x160f4b)[_0x9a74('0x2b')](_0x5097f6);};}exports['index']=function(_0x25e50d,_0x1c9a55){var _0x7d47f4={},_0x2d2d29={},_0x1bf764={'count':0x0,'rows':[]};var _0x3fb337=_[_0x9a74('0x2c')](db['FreshsalesField']['rawAttributes'],function(_0x3a1581){return{'name':_0x3a1581[_0x9a74('0x2d')],'type':_0x3a1581[_0x9a74('0x2e')][_0x9a74('0x2f')]};});_0x2d2d29['model']=_[_0x9a74('0x2c')](_0x3fb337,_0x9a74('0x2a'));_0x2d2d29[_0x9a74('0x30')]=_[_0x9a74('0x31')](_0x25e50d[_0x9a74('0x30')]);_0x2d2d29[_0x9a74('0x32')]=_[_0x9a74('0x33')](_0x2d2d29[_0x9a74('0x34')],_0x2d2d29[_0x9a74('0x30')]);_0x7d47f4[_0x9a74('0x35')]=_[_0x9a74('0x33')](_0x2d2d29[_0x9a74('0x34')],qs[_0x9a74('0x36')](_0x25e50d['query'][_0x9a74('0x36')]));_0x7d47f4[_0x9a74('0x35')]=_0x7d47f4[_0x9a74('0x35')][_0x9a74('0x37')]?_0x7d47f4['attributes']:_0x2d2d29[_0x9a74('0x34')];if(!_0x25e50d[_0x9a74('0x30')][_0x9a74('0x38')]('nolimit')){_0x7d47f4['limit']=qs[_0x9a74('0x21')](_0x25e50d[_0x9a74('0x30')][_0x9a74('0x21')]);_0x7d47f4[_0x9a74('0x1f')]=qs[_0x9a74('0x1f')](_0x25e50d[_0x9a74('0x30')][_0x9a74('0x1f')]);}_0x7d47f4[_0x9a74('0x39')]=qs['sort'](_0x25e50d[_0x9a74('0x30')][_0x9a74('0x3a')]);_0x7d47f4['where']=qs[_0x9a74('0x32')](_[_0x9a74('0x3b')](_0x25e50d[_0x9a74('0x30')],_0x2d2d29[_0x9a74('0x32')]),_0x3fb337);if(_0x25e50d[_0x9a74('0x30')][_0x9a74('0x3c')]){_0x7d47f4[_0x9a74('0x3d')]=_[_0x9a74('0x3e')](_0x7d47f4[_0x9a74('0x3d')],{'$or':_[_0x9a74('0x2c')](_0x3fb337,function(_0x51e643){if(_0x51e643['type']!=='VIRTUAL'){var _0x9334b2={};_0x9334b2[_0x51e643[_0x9a74('0x2a')]]={'$like':'%'+_0x25e50d[_0x9a74('0x30')]['filter']+'%'};return _0x9334b2;}})});}_0x7d47f4=_['merge']({},_0x7d47f4,_0x25e50d['options']);var _0x318b1d={'where':_0x7d47f4['where']};return db[_0x9a74('0x3f')]['count'](_0x318b1d)[_0x9a74('0x27')](function(_0x4d6eb8){_0x1bf764[_0x9a74('0x22')]=_0x4d6eb8;if(_0x25e50d['query'][_0x9a74('0x40')]){_0x7d47f4[_0x9a74('0x41')]=[{'all':!![]}];}return db[_0x9a74('0x3f')][_0x9a74('0x42')](_0x7d47f4);})[_0x9a74('0x27')](function(_0x187e69){_0x1bf764[_0x9a74('0x43')]=_0x187e69;return _0x1bf764;})['then'](respondWithFilteredResult(_0x1c9a55,_0x7d47f4))['catch'](handleError(_0x1c9a55,null));};exports[_0x9a74('0x44')]=function(_0xf5c216,_0x2f8134){var _0x2fe5b3={'raw':!![],'where':{'id':_0xf5c216[_0x9a74('0x45')]['id']}},_0x11d071={};_0x11d071[_0x9a74('0x34')]=_['keys'](db['FreshsalesField'][_0x9a74('0x46')]);_0x11d071[_0x9a74('0x30')]=_['keys'](_0xf5c216[_0x9a74('0x30')]);_0x11d071['filters']=_['intersection'](_0x11d071[_0x9a74('0x34')],_0x11d071['query']);_0x2fe5b3[_0x9a74('0x35')]=_[_0x9a74('0x33')](_0x11d071[_0x9a74('0x34')],qs['fields'](_0xf5c216[_0x9a74('0x30')][_0x9a74('0x36')]));_0x2fe5b3[_0x9a74('0x35')]=_0x2fe5b3[_0x9a74('0x35')][_0x9a74('0x37')]?_0x2fe5b3[_0x9a74('0x35')]:_0x11d071[_0x9a74('0x34')];if(_0xf5c216[_0x9a74('0x30')][_0x9a74('0x40')]){_0x2fe5b3[_0x9a74('0x41')]=[{'all':!![]}];}_0x2fe5b3=_[_0x9a74('0x3e')]({},_0x2fe5b3,_0xf5c216[_0x9a74('0x47')]);return db[_0x9a74('0x3f')]['find'](_0x2fe5b3)['then'](handleEntityNotFound(_0x2f8134,null))[_0x9a74('0x27')](respondWithResult(_0x2f8134,null))[_0x9a74('0x48')](handleError(_0x2f8134,null));};exports['create']=function(_0x3616cf,_0x505658){return db[_0x9a74('0x3f')][_0x9a74('0x49')](_0x3616cf[_0x9a74('0x4a')],{})[_0x9a74('0x27')](respondWithResult(_0x505658,0xc9))[_0x9a74('0x48')](handleError(_0x505658,null));};exports[_0x9a74('0x4b')]=function(_0x36a892,_0x1d858f){if(_0x36a892[_0x9a74('0x4a')]['id']){delete _0x36a892[_0x9a74('0x4a')]['id'];}return db[_0x9a74('0x3f')]['find']({'where':{'id':_0x36a892[_0x9a74('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d858f,null))[_0x9a74('0x27')](saveUpdates(_0x36a892[_0x9a74('0x4a')],null))[_0x9a74('0x27')](respondWithResult(_0x1d858f,null))[_0x9a74('0x48')](handleError(_0x1d858f,null));};exports['destroy']=function(_0x30396c,_0x309550){return db[_0x9a74('0x3f')]['find']({'where':{'id':_0x30396c[_0x9a74('0x45')]['id']}})[_0x9a74('0x27')](handleEntityNotFound(_0x309550,null))['then'](removeEntity(_0x309550,null))['catch'](handleError(_0x309550,null));}; \ No newline at end of file +var _0x0f83=['rows','params','merge','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','findAll'];(function(_0x3e3748,_0x118608){var _0x467996=function(_0x475275){while(--_0x475275){_0x3e3748['push'](_0x3e3748['shift']());}};_0x467996(++_0x118608);}(_0x0f83,0xf1));var _0x30f8=function(_0x2b4a90,_0x2ae989){_0x2b4a90=_0x2b4a90-0x0;var _0x4e1b7a=_0x0f83[_0x2b4a90];return _0x4e1b7a;};'use strict';var emlformat=require(_0x30f8('0x0'));var rimraf=require(_0x30f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30f8('0x2'));var rp=require(_0x30f8('0x3'));var moment=require(_0x30f8('0x4'));var BPromise=require(_0x30f8('0x5'));var Mustache=require(_0x30f8('0x6'));var util=require(_0x30f8('0x7'));var path=require(_0x30f8('0x8'));var sox=require(_0x30f8('0x9'));var csv=require(_0x30f8('0xa'));var ejs=require(_0x30f8('0xb'));var fs=require('fs');var fs_extra=require(_0x30f8('0xc'));var _=require(_0x30f8('0xd'));var squel=require(_0x30f8('0xe'));var crypto=require('crypto');var jsforce=require(_0x30f8('0xf'));var deskjs=require(_0x30f8('0x10'));var toCsv=require(_0x30f8('0xa'));var querystring=require(_0x30f8('0x11'));var Papa=require(_0x30f8('0x12'));var Redis=require(_0x30f8('0x13'));var authService=require(_0x30f8('0x14'));var qs=require(_0x30f8('0x15'));var as=require(_0x30f8('0x16'));var hardwareService=require(_0x30f8('0x17'));var logger=require(_0x30f8('0x18'))('api');var utils=require(_0x30f8('0x19'));var config=require(_0x30f8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x30f8('0x1b'))['db'];function respondWithStatusCode(_0x5ed3db,_0x4cbdf7){_0x4cbdf7=_0x4cbdf7||0xcc;return function(_0x4173d1){if(_0x4173d1){return _0x5ed3db[_0x30f8('0x1c')](_0x4cbdf7);}return _0x5ed3db[_0x30f8('0x1d')](_0x4cbdf7)[_0x30f8('0x1e')]();};}function respondWithResult(_0x29fd4a,_0x5eda26){_0x5eda26=_0x5eda26||0xc8;return function(_0x3a95b7){if(_0x3a95b7){return _0x29fd4a[_0x30f8('0x1d')](_0x5eda26)[_0x30f8('0x1f')](_0x3a95b7);}};}function respondWithFilteredResult(_0x128709,_0x465943){return function(_0x4a0ebf){if(_0x4a0ebf){var _0x12efa5=typeof _0x465943[_0x30f8('0x20')]===_0x30f8('0x21')&&typeof _0x465943[_0x30f8('0x22')]===_0x30f8('0x21');var _0xb802da=_0x4a0ebf[_0x30f8('0x23')];var _0x1ef18f=_0x12efa5?0x0:_0x465943[_0x30f8('0x20')];var _0x2302a8=_0x12efa5?_0x4a0ebf['count']:_0x465943[_0x30f8('0x20')]+_0x465943['limit'];var _0x23c37d;if(_0x2302a8>=_0xb802da){_0x2302a8=_0xb802da;_0x23c37d=0xc8;}else{_0x23c37d=0xce;}_0x128709[_0x30f8('0x1d')](_0x23c37d);return _0x128709[_0x30f8('0x24')]('Content-Range',_0x1ef18f+'-'+_0x2302a8+'/'+_0xb802da)[_0x30f8('0x1f')](_0x4a0ebf);}return null;};}function patchUpdates(_0x2b2ef9){return function(_0xf0683d){try{jsonpatch[_0x30f8('0x25')](_0xf0683d,_0x2b2ef9,!![]);}catch(_0x22e686){return BPromise[_0x30f8('0x26')](_0x22e686);}return _0xf0683d[_0x30f8('0x27')]();};}function saveUpdates(_0x4158b6,_0x37a297){return function(_0x55d1a0){if(_0x55d1a0){return _0x55d1a0[_0x30f8('0x28')](_0x4158b6)[_0x30f8('0x29')](function(_0x3405d5){return _0x3405d5;});}return null;};}function removeEntity(_0x3ffb46,_0x2136a9){return function(_0x251d1d){if(_0x251d1d){return _0x251d1d['destroy']()[_0x30f8('0x29')](function(){_0x3ffb46[_0x30f8('0x1d')](0xcc)[_0x30f8('0x1e')]();});}};}function handleEntityNotFound(_0x182365,_0x3706f6){return function(_0x4def8c){if(!_0x4def8c){_0x182365[_0x30f8('0x1c')](0x194);}return _0x4def8c;};}function handleError(_0x4f16f4,_0x1bfd22){_0x1bfd22=_0x1bfd22||0x1f4;return function(_0x1019bf){logger[_0x30f8('0x2a')](_0x1019bf[_0x30f8('0x2b')]);if(_0x1019bf[_0x30f8('0x2c')]){delete _0x1019bf[_0x30f8('0x2c')];}_0x4f16f4[_0x30f8('0x1d')](_0x1bfd22)[_0x30f8('0x2d')](_0x1019bf);};}exports[_0x30f8('0x2e')]=function(_0x16b1cd,_0x60505e){var _0xfb08d4={},_0xd51615={},_0x48caa8={'count':0x0,'rows':[]};var _0x264bbd=_[_0x30f8('0x2f')](db[_0x30f8('0x30')][_0x30f8('0x31')],function(_0x57bf48){return{'name':_0x57bf48[_0x30f8('0x32')],'type':_0x57bf48[_0x30f8('0x33')][_0x30f8('0x34')]};});_0xd51615['model']=_[_0x30f8('0x2f')](_0x264bbd,_0x30f8('0x2c'));_0xd51615['query']=_[_0x30f8('0x35')](_0x16b1cd[_0x30f8('0x36')]);_0xd51615[_0x30f8('0x37')]=_[_0x30f8('0x38')](_0xd51615['model'],_0xd51615['query']);_0xfb08d4[_0x30f8('0x39')]=_[_0x30f8('0x38')](_0xd51615['model'],qs[_0x30f8('0x3a')](_0x16b1cd[_0x30f8('0x36')]['fields']));_0xfb08d4[_0x30f8('0x39')]=_0xfb08d4[_0x30f8('0x39')][_0x30f8('0x3b')]?_0xfb08d4['attributes']:_0xd51615[_0x30f8('0x3c')];if(!_0x16b1cd[_0x30f8('0x36')][_0x30f8('0x3d')](_0x30f8('0x3e'))){_0xfb08d4['limit']=qs[_0x30f8('0x22')](_0x16b1cd[_0x30f8('0x36')]['limit']);_0xfb08d4[_0x30f8('0x20')]=qs[_0x30f8('0x20')](_0x16b1cd[_0x30f8('0x36')][_0x30f8('0x20')]);}_0xfb08d4[_0x30f8('0x3f')]=qs[_0x30f8('0x40')](_0x16b1cd[_0x30f8('0x36')]['sort']);_0xfb08d4['where']=qs[_0x30f8('0x37')](_['pick'](_0x16b1cd['query'],_0xd51615[_0x30f8('0x37')]),_0x264bbd);if(_0x16b1cd[_0x30f8('0x36')]['filter']){_0xfb08d4['where']=_['merge'](_0xfb08d4[_0x30f8('0x41')],{'$or':_[_0x30f8('0x2f')](_0x264bbd,function(_0x2bc376){if(_0x2bc376[_0x30f8('0x33')]!==_0x30f8('0x42')){var _0x2838a6={};_0x2838a6[_0x2bc376[_0x30f8('0x2c')]]={'$like':'%'+_0x16b1cd[_0x30f8('0x36')]['filter']+'%'};return _0x2838a6;}})});}_0xfb08d4=_['merge']({},_0xfb08d4,_0x16b1cd[_0x30f8('0x43')]);var _0x5778ae={'where':_0xfb08d4[_0x30f8('0x41')]};return db[_0x30f8('0x30')][_0x30f8('0x23')](_0x5778ae)['then'](function(_0x1c215e){_0x48caa8[_0x30f8('0x23')]=_0x1c215e;if(_0x16b1cd[_0x30f8('0x36')][_0x30f8('0x44')]){_0xfb08d4[_0x30f8('0x45')]=[{'all':!![]}];}return db[_0x30f8('0x30')][_0x30f8('0x46')](_0xfb08d4);})[_0x30f8('0x29')](function(_0x1ab30c){_0x48caa8[_0x30f8('0x47')]=_0x1ab30c;return _0x48caa8;})['then'](respondWithFilteredResult(_0x60505e,_0xfb08d4))['catch'](handleError(_0x60505e,null));};exports['show']=function(_0x4e7f84,_0xdd4d29){var _0x6c4f60={'raw':!![],'where':{'id':_0x4e7f84[_0x30f8('0x48')]['id']}},_0x3d76e4={};_0x3d76e4[_0x30f8('0x3c')]=_[_0x30f8('0x35')](db[_0x30f8('0x30')][_0x30f8('0x31')]);_0x3d76e4['query']=_[_0x30f8('0x35')](_0x4e7f84[_0x30f8('0x36')]);_0x3d76e4[_0x30f8('0x37')]=_[_0x30f8('0x38')](_0x3d76e4['model'],_0x3d76e4[_0x30f8('0x36')]);_0x6c4f60[_0x30f8('0x39')]=_[_0x30f8('0x38')](_0x3d76e4[_0x30f8('0x3c')],qs[_0x30f8('0x3a')](_0x4e7f84['query'][_0x30f8('0x3a')]));_0x6c4f60[_0x30f8('0x39')]=_0x6c4f60[_0x30f8('0x39')][_0x30f8('0x3b')]?_0x6c4f60[_0x30f8('0x39')]:_0x3d76e4[_0x30f8('0x3c')];if(_0x4e7f84[_0x30f8('0x36')]['includeAll']){_0x6c4f60[_0x30f8('0x45')]=[{'all':!![]}];}_0x6c4f60=_[_0x30f8('0x49')]({},_0x6c4f60,_0x4e7f84[_0x30f8('0x43')]);return db[_0x30f8('0x30')][_0x30f8('0x4a')](_0x6c4f60)['then'](handleEntityNotFound(_0xdd4d29,null))[_0x30f8('0x29')](respondWithResult(_0xdd4d29,null))[_0x30f8('0x4b')](handleError(_0xdd4d29,null));};exports[_0x30f8('0x4c')]=function(_0x32d153,_0x147675){return db['FreshsalesField']['create'](_0x32d153[_0x30f8('0x4d')],{})[_0x30f8('0x29')](respondWithResult(_0x147675,0xc9))[_0x30f8('0x4b')](handleError(_0x147675,null));};exports[_0x30f8('0x28')]=function(_0x46e1c4,_0x2d6ddc){if(_0x46e1c4[_0x30f8('0x4d')]['id']){delete _0x46e1c4[_0x30f8('0x4d')]['id'];}return db[_0x30f8('0x30')][_0x30f8('0x4a')]({'where':{'id':_0x46e1c4['params']['id']}})[_0x30f8('0x29')](handleEntityNotFound(_0x2d6ddc,null))[_0x30f8('0x29')](saveUpdates(_0x46e1c4[_0x30f8('0x4d')],null))[_0x30f8('0x29')](respondWithResult(_0x2d6ddc,null))[_0x30f8('0x4b')](handleError(_0x2d6ddc,null));};exports['destroy']=function(_0x1115ca,_0x12c663){return db[_0x30f8('0x30')]['find']({'where':{'id':_0x1115ca['params']['id']}})[_0x30f8('0x29')](handleEntityNotFound(_0x12c663,null))[_0x30f8('0x29')](removeEntity(_0x12c663,null))['catch'](handleError(_0x12c663,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 01476ac..639da2f 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 _0xcb22=['rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0xcb22,0xc8));var _0x2cb2=function(_0x1153aa,_0x19afab){_0x1153aa=_0x1153aa-0x0;var _0x18ed6f=_0xcb22[_0x1153aa];return _0x18ed6f;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var logger=require(_0x2cb2('0x2'))(_0x2cb2('0x3'));var moment=require(_0x2cb2('0x4'));var BPromise=require(_0x2cb2('0x5'));var rp=require(_0x2cb2('0x6'));var fs=require('fs');var path=require(_0x2cb2('0x7'));var rimraf=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var attributes=require(_0x2cb2('0xa'));module['exports']=function(_0x77ae56,_0x3582d7){return _0x77ae56[_0x2cb2('0xb')](_0x2cb2('0xc'),attributes,{'tableName':_0x2cb2('0xd'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x2cb2('0xe'),_0x2cb2('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6901=['int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','request-promise','path','./intFreshsalesField.attributes','define','FreshsalesField'];(function(_0x1708c1,_0x1a1456){var _0x48cedc=function(_0x3aaed9){while(--_0x3aaed9){_0x1708c1['push'](_0x1708c1['shift']());}};_0x48cedc(++_0x1a1456);}(_0x6901,0x100));var _0x1690=function(_0x4c4553,_0x68e5b8){_0x4c4553=_0x4c4553-0x0;var _0x16019e=_0x6901[_0x4c4553];return _0x16019e;};'use strict';var _=require(_0x1690('0x0'));var util=require('util');var logger=require(_0x1690('0x1'))(_0x1690('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1690('0x3'));var fs=require('fs');var path=require(_0x1690('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1690('0x5'));module['exports']=function(_0x5a1c50,_0x32f96e){return _0x5a1c50[_0x1690('0x6')](_0x1690('0x7'),attributes,{'tableName':_0x1690('0x8'),'paranoid':![],'indexes':[{'name':_0x1690('0x9'),'fields':[_0x1690('0xa'),'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 0150c81..0e742d9 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 _0x1967=['then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1967,0x173));var _0x7196=function(_0x2ab9eb,_0xaf576f){_0x2ab9eb=_0x2ab9eb-0x0;var _0x1eff07=_0x1967[_0x2ab9eb];return _0x1eff07;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f1bef,_0x51aa5d){var _0x59d625=function(_0x32cfd5){while(--_0x32cfd5){_0x1f1bef['push'](_0x1f1bef['shift']());}};_0x59d625(++_0x51aa5d);}(_0xda19,0xd5));var _0x9da1=function(_0x4a4798,_0xae29eb){_0x4a4798=_0x4a4798-0x0;var _0x147538=_0xda19[_0x4a4798];return _0x147538;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 7d7653a..3423c66 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(_0x674a5,_0x5bac8e){var _0x25a677=function(_0x1792c4){while(--_0x1792c4){_0x674a5['push'](_0x674a5['shift']());}};_0x25a677(++_0x5bac8e);}(_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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5104f5,_0x2908bd){var _0x2bb4f9=function(_0x431014){while(--_0x431014){_0x5104f5['push'](_0x5104f5['shift']());}};_0x2bb4f9(++_0x2908bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 82e7698..99797cd 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 _0x7e74=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x3c5751,_0x96fadb){var _0x2e8075=function(_0x38ba9f){while(--_0x38ba9f){_0x3c5751['push'](_0x3c5751['shift']());}};_0x2e8075(++_0x96fadb);}(_0x7e74,0xbd));var _0x47e7=function(_0x37fc4f,_0x1768c0){_0x37fc4f=_0x37fc4f-0x0;var _0x5a0e15=_0x7e74[_0x37fc4f];return _0x5a0e15;};'use strict';var Sequelize=require(_0x47e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x47e7('0x1')]},'description':{'type':Sequelize[_0x47e7('0x1')]},'username':{'type':Sequelize[_0x47e7('0x1')],'unique':_0x47e7('0x2')},'remoteUri':{'type':Sequelize[_0x47e7('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x47e7('0x1')]},'clientSecret':{'type':Sequelize[_0x47e7('0x1')]},'securityToken':{'type':Sequelize[_0x47e7('0x1')]},'serverUrl':{'type':Sequelize[_0x47e7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x47e7('0x3')](_0x47e7('0x4'),_0x47e7('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x5f66=['integrationTab','exports','STRING','username','ENUM'];(function(_0x18cadb,_0x5389e3){var _0xe21013=function(_0x317f8e){while(--_0x317f8e){_0x18cadb['push'](_0x18cadb['shift']());}};_0xe21013(++_0x5389e3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65f6('0x1')]},'username':{'type':Sequelize[_0x65f6('0x1')],'unique':_0x65f6('0x2')},'remoteUri':{'type':Sequelize[_0x65f6('0x1')]},'password':{'type':Sequelize[_0x65f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x65f6('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x65f6('0x3')]('integrationTab','newTab'),'defaultValue':_0x65f6('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 12016d2..27fa861 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 _0xe521=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','getConfigurations','findOne','SalesforceConfiguration','pick','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x3375b2,_0x571d5a){var _0x3fbd8e=function(_0x472b8c){while(--_0x472b8c){_0x3375b2['push'](_0x3375b2['shift']());}};_0x3fbd8e(++_0x571d5a);}(_0xe521,0x174));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1e52('0x0'));var rimraf=require(_0x1e52('0x1'));var zipdir=require(_0x1e52('0x2'));var jsonpatch=require(_0x1e52('0x3'));var rp=require(_0x1e52('0x4'));var moment=require(_0x1e52('0x5'));var BPromise=require(_0x1e52('0x6'));var Mustache=require(_0x1e52('0x7'));var util=require(_0x1e52('0x8'));var path=require(_0x1e52('0x9'));var sox=require(_0x1e52('0xa'));var csv=require('to-csv');var ejs=require(_0x1e52('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e52('0xc'));var squel=require('squel');var crypto=require(_0x1e52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1e52('0xe'));var toCsv=require(_0x1e52('0xf'));var querystring=require(_0x1e52('0x10'));var Papa=require(_0x1e52('0x11'));var Redis=require(_0x1e52('0x12'));var authService=require(_0x1e52('0x13'));var qs=require(_0x1e52('0x14'));var as=require(_0x1e52('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e52('0x16'))(_0x1e52('0x17'));var utils=require('../../config/utils');var config=require(_0x1e52('0x18'));var licenseUtil=require(_0x1e52('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1e52('0x1a'));function respondWithStatusCode(_0x171feb,_0xbcbd4e){_0xbcbd4e=_0xbcbd4e||0xcc;return function(_0x2529fe){if(_0x2529fe){return _0x171feb[_0x1e52('0x1b')](_0xbcbd4e);}return _0x171feb[_0x1e52('0x1c')](_0xbcbd4e)[_0x1e52('0x1d')]();};}function respondWithResult(_0x4bd2d9,_0x36ce6b){_0x36ce6b=_0x36ce6b||0xc8;return function(_0x16cf50){if(_0x16cf50){return _0x4bd2d9[_0x1e52('0x1c')](_0x36ce6b)[_0x1e52('0x1e')](_0x16cf50);}};}function respondWithFilteredResult(_0x3b1098,_0xee6f86){return function(_0x2f0fba){if(_0x2f0fba){var _0x9132ea=typeof _0xee6f86[_0x1e52('0x1f')]==='undefined'&&typeof _0xee6f86[_0x1e52('0x20')]===_0x1e52('0x21');var _0x58ef4a=_0x2f0fba[_0x1e52('0x22')];var _0x29c574=_0x9132ea?0x0:_0xee6f86[_0x1e52('0x1f')];var _0xc53c30=_0x9132ea?_0x2f0fba[_0x1e52('0x22')]:_0xee6f86[_0x1e52('0x1f')]+_0xee6f86['limit'];var _0x4ebee9;if(_0xc53c30>=_0x58ef4a){_0xc53c30=_0x58ef4a;_0x4ebee9=0xc8;}else{_0x4ebee9=0xce;}_0x3b1098[_0x1e52('0x1c')](_0x4ebee9);return _0x3b1098[_0x1e52('0x23')](_0x1e52('0x24'),_0x29c574+'-'+_0xc53c30+'/'+_0x58ef4a)['json'](_0x2f0fba);}return null;};}function patchUpdates(_0x282b5a){return function(_0x25af62){try{jsonpatch[_0x1e52('0x25')](_0x25af62,_0x282b5a,!![]);}catch(_0x31c419){return BPromise['reject'](_0x31c419);}return _0x25af62[_0x1e52('0x26')]();};}function saveUpdates(_0x538773,_0xda1b87){return function(_0x4b77fa){if(_0x4b77fa){return _0x4b77fa['update'](_0x538773)[_0x1e52('0x27')](function(_0x4ad36d){return _0x4ad36d;});}return null;};}function removeEntity(_0x9edb99,_0x4ee77f){return function(_0x3f9880){if(_0x3f9880){return _0x3f9880[_0x1e52('0x28')]()[_0x1e52('0x27')](function(){_0x9edb99[_0x1e52('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x166e92,_0x39f7d2){return function(_0x2e9fae){if(!_0x2e9fae){_0x166e92[_0x1e52('0x1b')](0x194);}return _0x2e9fae;};}function handleError(_0x3ec603,_0x3123b0){_0x3123b0=_0x3123b0||0x1f4;return function(_0x47017e){logger[_0x1e52('0x29')](_0x47017e[_0x1e52('0x2a')]);if(_0x47017e[_0x1e52('0x2b')]){delete _0x47017e[_0x1e52('0x2b')];}_0x3ec603['status'](_0x3123b0)[_0x1e52('0x2c')](_0x47017e);};}exports[_0x1e52('0x2d')]=function(_0x21bd1c,_0x42fca5){var _0x4126c4={},_0x422d63={},_0x15946a={'count':0x0,'rows':[]};var _0x2ab167=_[_0x1e52('0x2e')](db[_0x1e52('0x2f')][_0x1e52('0x30')],function(_0x2649ae){return{'name':_0x2649ae[_0x1e52('0x31')],'type':_0x2649ae['type']['key']};});_0x422d63[_0x1e52('0x32')]=_['map'](_0x2ab167,'name');_0x422d63[_0x1e52('0x33')]=_[_0x1e52('0x34')](_0x21bd1c[_0x1e52('0x33')]);_0x422d63['filters']=_[_0x1e52('0x35')](_0x422d63[_0x1e52('0x32')],_0x422d63['query']);_0x4126c4[_0x1e52('0x36')]=_[_0x1e52('0x35')](_0x422d63[_0x1e52('0x32')],qs[_0x1e52('0x37')](_0x21bd1c[_0x1e52('0x33')][_0x1e52('0x37')]));_0x4126c4[_0x1e52('0x36')]=_0x4126c4[_0x1e52('0x36')]['length']?_0x4126c4[_0x1e52('0x36')]:_0x422d63[_0x1e52('0x32')];if(!_0x21bd1c['query']['hasOwnProperty'](_0x1e52('0x38'))){_0x4126c4[_0x1e52('0x20')]=qs['limit'](_0x21bd1c[_0x1e52('0x33')]['limit']);_0x4126c4[_0x1e52('0x1f')]=qs['offset'](_0x21bd1c[_0x1e52('0x33')][_0x1e52('0x1f')]);}_0x4126c4[_0x1e52('0x39')]=qs[_0x1e52('0x3a')](_0x21bd1c[_0x1e52('0x33')][_0x1e52('0x3a')]);_0x4126c4[_0x1e52('0x3b')]=qs[_0x1e52('0x3c')](_['pick'](_0x21bd1c[_0x1e52('0x33')],_0x422d63[_0x1e52('0x3c')]),_0x2ab167);if(_0x21bd1c[_0x1e52('0x33')][_0x1e52('0x3d')]){_0x4126c4[_0x1e52('0x3b')]=_[_0x1e52('0x3e')](_0x4126c4[_0x1e52('0x3b')],{'$or':_[_0x1e52('0x2e')](_0x2ab167,function(_0x1e059e){if(_0x1e059e[_0x1e52('0x3f')]!==_0x1e52('0x40')){var _0x3636c2={};_0x3636c2[_0x1e059e[_0x1e52('0x2b')]]={'$like':'%'+_0x21bd1c[_0x1e52('0x33')][_0x1e52('0x3d')]+'%'};return _0x3636c2;}})});}_0x4126c4=_[_0x1e52('0x3e')]({},_0x4126c4,_0x21bd1c['options']);var _0x546f27={'where':_0x4126c4['where']};return db['SalesforceAccount'][_0x1e52('0x22')](_0x546f27)[_0x1e52('0x27')](function(_0x2779de){_0x15946a['count']=_0x2779de;if(_0x21bd1c['query'][_0x1e52('0x41')]){_0x4126c4[_0x1e52('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x1e52('0x43')](_0x4126c4);})['then'](function(_0x2ccd40){_0x15946a[_0x1e52('0x44')]=_0x2ccd40;return _0x15946a;})[_0x1e52('0x27')](respondWithFilteredResult(_0x42fca5,_0x4126c4))['catch'](handleError(_0x42fca5,null));};exports[_0x1e52('0x45')]=function(_0xac7111,_0x3fa9ca){var _0x269efc={'raw':![],'where':{'id':_0xac7111[_0x1e52('0x46')]['id']}},_0xa8a9d4={};_0xa8a9d4[_0x1e52('0x32')]=_[_0x1e52('0x34')](db[_0x1e52('0x2f')][_0x1e52('0x30')]);_0xa8a9d4[_0x1e52('0x33')]=_[_0x1e52('0x34')](_0xac7111[_0x1e52('0x33')]);_0xa8a9d4[_0x1e52('0x3c')]=_[_0x1e52('0x35')](_0xa8a9d4[_0x1e52('0x32')],_0xa8a9d4[_0x1e52('0x33')]);_0x269efc[_0x1e52('0x36')]=_[_0x1e52('0x35')](_0xa8a9d4[_0x1e52('0x32')],qs[_0x1e52('0x37')](_0xac7111['query'][_0x1e52('0x37')]));_0x269efc[_0x1e52('0x36')]=_0x269efc[_0x1e52('0x36')][_0x1e52('0x47')]?_0x269efc[_0x1e52('0x36')]:_0xa8a9d4[_0x1e52('0x32')];if(_0xac7111['query'][_0x1e52('0x41')]){_0x269efc[_0x1e52('0x42')]=[{'all':!![]}];}_0x269efc=_['merge']({},_0x269efc,_0xac7111['options']);return db[_0x1e52('0x2f')]['find'](_0x269efc)[_0x1e52('0x27')](handleEntityNotFound(_0x3fa9ca,null))['then'](respondWithResult(_0x3fa9ca,null))[_0x1e52('0x48')](handleError(_0x3fa9ca,null));};exports[_0x1e52('0x49')]=function(_0x1a0a3e,_0x3b2548){return db[_0x1e52('0x2f')]['create'](_0x1a0a3e[_0x1e52('0x4a')],{})['then'](respondWithResult(_0x3b2548,0xc9))[_0x1e52('0x48')](handleError(_0x3b2548,null));};exports['update']=function(_0xe36ef6,_0x2ef056){if(_0xe36ef6[_0x1e52('0x4a')]['id']){delete _0xe36ef6[_0x1e52('0x4a')]['id'];}return db[_0x1e52('0x2f')][_0x1e52('0x4b')]({'where':{'id':_0xe36ef6[_0x1e52('0x46')]['id']}})[_0x1e52('0x27')](handleEntityNotFound(_0x2ef056,null))[_0x1e52('0x27')](saveUpdates(_0xe36ef6[_0x1e52('0x4a')],null))[_0x1e52('0x27')](respondWithResult(_0x2ef056,null))[_0x1e52('0x48')](handleError(_0x2ef056,null));};exports['destroy']=function(_0x43be9b,_0x2d2f87){return db[_0x1e52('0x2f')]['find']({'where':{'id':_0x43be9b[_0x1e52('0x46')]['id']}})[_0x1e52('0x27')](handleEntityNotFound(_0x2d2f87,null))['then'](removeEntity(_0x2d2f87,null))[_0x1e52('0x48')](handleError(_0x2d2f87,null));};exports[_0x1e52('0x4c')]=function(_0x305299,_0x373b19,_0x21e3cf){var _0x10c290={};var _0x5eb323={};var _0x1bd0a2;var _0x4cdea4;return db[_0x1e52('0x2f')][_0x1e52('0x4d')]({'where':{'id':_0x305299[_0x1e52('0x46')]['id']}})['then'](handleEntityNotFound(_0x373b19,null))[_0x1e52('0x27')](function(_0x56c8bc){if(_0x56c8bc){_0x1bd0a2=_0x56c8bc;_0x5eb323[_0x1e52('0x32')]=_['keys'](db[_0x1e52('0x4e')]['rawAttributes']);_0x5eb323['query']=_['keys'](_0x305299[_0x1e52('0x33')]);_0x5eb323[_0x1e52('0x3c')]=_['intersection'](_0x5eb323[_0x1e52('0x32')],_0x5eb323[_0x1e52('0x33')]);_0x10c290[_0x1e52('0x36')]=_[_0x1e52('0x35')](_0x5eb323['model'],qs['fields'](_0x305299[_0x1e52('0x33')][_0x1e52('0x37')]));_0x10c290[_0x1e52('0x36')]=_0x10c290[_0x1e52('0x36')][_0x1e52('0x47')]?_0x10c290[_0x1e52('0x36')]:_0x5eb323[_0x1e52('0x32')];_0x10c290[_0x1e52('0x39')]=qs[_0x1e52('0x3a')](_0x305299[_0x1e52('0x33')][_0x1e52('0x3a')]);_0x10c290[_0x1e52('0x3b')]=qs[_0x1e52('0x3c')](_[_0x1e52('0x4f')](_0x305299[_0x1e52('0x33')],_0x5eb323['filters']));if(_0x305299[_0x1e52('0x33')]['filter']){_0x10c290[_0x1e52('0x3b')]=_[_0x1e52('0x3e')](_0x10c290[_0x1e52('0x3b')],{'$or':_[_0x1e52('0x2e')](_0x10c290['attributes'],function(_0x1ed77e){var _0x419aaf={};_0x419aaf[_0x1ed77e]={'$like':'%'+_0x305299[_0x1e52('0x33')][_0x1e52('0x3d')]+'%'};return _0x419aaf;})});}_0x10c290=_['merge']({},_0x10c290,_0x305299[_0x1e52('0x50')]);return _0x1bd0a2[_0x1e52('0x4c')](_0x10c290);}})[_0x1e52('0x27')](function(_0x52da3b){if(_0x52da3b){_0x4cdea4=_0x52da3b[_0x1e52('0x47')];if(!_0x305299['query'][_0x1e52('0x51')](_0x1e52('0x38'))){_0x10c290[_0x1e52('0x20')]=qs[_0x1e52('0x20')](_0x305299[_0x1e52('0x33')][_0x1e52('0x20')]);_0x10c290[_0x1e52('0x1f')]=qs[_0x1e52('0x1f')](_0x305299[_0x1e52('0x33')][_0x1e52('0x1f')]);}return _0x1bd0a2['getConfigurations'](_0x10c290);}})[_0x1e52('0x27')](function(_0x4c477c){if(_0x4c477c){return _0x4c477c?{'count':_0x4cdea4,'rows':_0x4c477c}:null;}})['then'](respondWithResult(_0x373b19,null))[_0x1e52('0x48')](handleError(_0x373b19,null));};exports[_0x1e52('0x52')]=function(_0x4fb8b7,_0xea4e5,_0x4e4a09){if(_0x4fb8b7[_0x1e52('0x4a')]['id']){delete _0x4fb8b7[_0x1e52('0x4a')]['id'];}return db[_0x1e52('0x2f')][_0x1e52('0x4d')]({'where':{'id':_0x4fb8b7[_0x1e52('0x46')]['id']}})[_0x1e52('0x27')](handleEntityNotFound(_0xea4e5,null))[_0x1e52('0x27')](function(_0x129cbd){if(_0x129cbd){_0x4fb8b7['body'][_0x1e52('0x53')]=_0x129cbd['id'];_0x4fb8b7['body'][_0x1e52('0x54')]=integrations[_0x1e52('0x55')](_0x4fb8b7[_0x1e52('0x4a')]['channel'],_0x4fb8b7[_0x1e52('0x4a')][_0x1e52('0x3f')]);_0x4fb8b7[_0x1e52('0x4a')][_0x1e52('0x56')]=integrations[_0x1e52('0x57')](_0x4fb8b7[_0x1e52('0x4a')][_0x1e52('0x58')],_0x4fb8b7[_0x1e52('0x4a')][_0x1e52('0x3f')]);return db[_0x1e52('0x4e')][_0x1e52('0x49')](_0x4fb8b7[_0x1e52('0x4a')],{'include':[{'model':db[_0x1e52('0x59')],'as':_0x1e52('0x54')},{'model':db[_0x1e52('0x59')],'as':_0x1e52('0x56')}]});}return null;})['then'](respondWithResult(_0xea4e5,null))[_0x1e52('0x48')](handleError(_0xea4e5,null));};exports[_0x1e52('0x5a')]=function(_0x57406e,_0x54fcf8,_0x512f18){var _0x338589;var _0x305070='';var _0xc72a3d=_0x1e52('0x5b');return db['SalesforceAccount'][_0x1e52('0x4d')]({'where':{'id':_0x57406e[_0x1e52('0x46')]['id']},'attributes':['id',_0x1e52('0x5c'),'clientId',_0x1e52('0x5d'),'username',_0x1e52('0x5e'),_0x1e52('0x5f')]})[_0x1e52('0x27')](handleEntityNotFound(_0x54fcf8,null))[_0x1e52('0x27')](function(_0x4871ef){if(_0x4871ef){_0x305070=_0x4871ef[_0x1e52('0x5c')];var _0x1236d6=_0x305070[_0x1e52('0x60')](-0x1);if(_0x1236d6==='/'){_0x305070=_0x305070[_0x1e52('0x61')](0x0,_0x305070[_0x1e52('0x62')](_0x1236d6));}_0x338589=new jsforce[(_0x1e52('0x63'))]({'oauth2':{'loginUrl':_0x305070,'clientId':_0x4871ef['clientId'],'clientSecret':_0x4871ef[_0x1e52('0x5d')]}});return _0x338589[_0x1e52('0x64')](_0x4871ef[_0x1e52('0x65')],_0x4871ef['password'][_0x1e52('0x66')](_0x4871ef[_0x1e52('0x5f')]));}})[_0x1e52('0x27')](function(_0xe23db7){if(_0xe23db7){if(!_[_0x1e52('0x67')](_0x57406e[_0x1e52('0x33')]['ticketType'])){_0xc72a3d=_0x57406e[_0x1e52('0x33')][_0x1e52('0x68')];}return _0x338589[_0x1e52('0x69')](_0xc72a3d)[_0x1e52('0x6a')]();}})[_0x1e52('0x27')](function(_0x1c74c2){var _0x38a8d2=[_0x1e52('0x6b'),_0x1e52('0x6c'),'IsReminderSet',_0x1e52('0x6d'),_0x1e52('0x6e'),_0x1e52('0x6f')];var _0x9e99c7=[_0x1e52('0x70'),'int','picklist',_0x1e52('0x71'),_0x1e52('0x72'),_0x1e52('0x73'),_0x1e52('0x74')];if(_0x1c74c2){_[_0x1e52('0x75')](_0x1c74c2[_0x1e52('0x37')],function(_0x4fc6d8){return _0x38a8d2[_0x1e52('0x76')](_0x4fc6d8[_0x1e52('0x2b')])||!_0x9e99c7[_0x1e52('0x76')](_0x4fc6d8[_0x1e52('0x3f')]);});return{'count':_0x1c74c2[_0x1e52('0x37')][_0x1e52('0x47')],'rows':_[_0x1e52('0x2e')](_0x1c74c2[_0x1e52('0x37')],function(_0x4a0ea9){return{'id':_0x4a0ea9[_0x1e52('0x2b')],'name':_0x4a0ea9[_0x1e52('0x77')],'custom':_0x4a0ea9[_0x1e52('0x78')],'options':_0x4a0ea9[_0x1e52('0x79')]['length']>0x0?_[_0x1e52('0x2e')](_0x4a0ea9[_0x1e52('0x79')],function(_0x4a7704){return{'name':_0x4a7704[_0x1e52('0x77')],'value':_0x4a7704[_0x1e52('0x7a')]};}):_0x4a0ea9[_0x1e52('0x3f')]==_0x1e52('0x71')?[{'name':_0x1e52('0x7b'),'value':_0x1e52('0x7c')},{'name':'False','value':_0x1e52('0x7d')}]:[]};})};}})[_0x1e52('0x27')](respondWithResult(_0x54fcf8,null))[_0x1e52('0x48')](function(_0x4a0507){var _0x526b52=_0x57406e[_0x1e52('0x33')][_0x1e52('0x7e')]?0x1f4:_0x4a0507[_0x1e52('0x7f')]||0x1f4;logger[_0x1e52('0x29')](_0x1e52('0x80'),_0x1e52('0x5a'),_0x526b52,JSON[_0x1e52('0x81')](_0x4a0507));delete _0x4a0507[_0x1e52('0x2b')];if(_0x526b52===0x191){_0x526b52=0x190;}_0x54fcf8[_0x1e52('0x1c')](_0x526b52)[_0x1e52('0x2c')](_0x57406e[_0x1e52('0x33')][_0x1e52('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x4a0507[_0x1e52('0x7f')]}:_0x4a0507);});}; \ No newline at end of file +var _0xd3e3=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','SalesforceAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','options','create','body','find','findOne','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','clientId','clientSecret','username','password','substring','lastIndexOf','concat','securityToken','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3e3,0x1d0));var _0x3d3e=function(_0x168120,_0x4e19de){_0x168120=_0x168120-0x0;var _0x5c827e=_0xd3e3[_0x168120];return _0x5c827e;};'use strict';var emlformat=require(_0x3d3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d3e('0x1'));var jsonpatch=require(_0x3d3e('0x2'));var rp=require(_0x3d3e('0x3'));var moment=require(_0x3d3e('0x4'));var BPromise=require(_0x3d3e('0x5'));var Mustache=require(_0x3d3e('0x6'));var util=require('util');var path=require(_0x3d3e('0x7'));var sox=require('sox');var csv=require(_0x3d3e('0x8'));var ejs=require(_0x3d3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d3e('0xa'));var squel=require(_0x3d3e('0xb'));var crypto=require(_0x3d3e('0xc'));var jsforce=require(_0x3d3e('0xd'));var deskjs=require(_0x3d3e('0xe'));var toCsv=require(_0x3d3e('0x8'));var querystring=require(_0x3d3e('0xf'));var Papa=require(_0x3d3e('0x10'));var Redis=require('ioredis');var authService=require(_0x3d3e('0x11'));var qs=require(_0x3d3e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d3e('0x13'));var logger=require(_0x3d3e('0x14'))(_0x3d3e('0x15'));var utils=require(_0x3d3e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3e('0x17'));var db=require(_0x3d3e('0x18'))['db'];var integrations=require(_0x3d3e('0x19'));function respondWithStatusCode(_0x579cf1,_0x3cb551){_0x3cb551=_0x3cb551||0xcc;return function(_0x2e5114){if(_0x2e5114){return _0x579cf1[_0x3d3e('0x1a')](_0x3cb551);}return _0x579cf1[_0x3d3e('0x1b')](_0x3cb551)[_0x3d3e('0x1c')]();};}function respondWithResult(_0x34043e,_0x1f103e){_0x1f103e=_0x1f103e||0xc8;return function(_0xee9da5){if(_0xee9da5){return _0x34043e[_0x3d3e('0x1b')](_0x1f103e)['json'](_0xee9da5);}};}function respondWithFilteredResult(_0x437db9,_0x567c0f){return function(_0x209a48){if(_0x209a48){var _0x2c797d=typeof _0x567c0f[_0x3d3e('0x1d')]===_0x3d3e('0x1e')&&typeof _0x567c0f[_0x3d3e('0x1f')]===_0x3d3e('0x1e');var _0x41a4e1=_0x209a48['count'];var _0x4a8438=_0x2c797d?0x0:_0x567c0f[_0x3d3e('0x1d')];var _0x427257=_0x2c797d?_0x209a48[_0x3d3e('0x20')]:_0x567c0f['offset']+_0x567c0f[_0x3d3e('0x1f')];var _0x2f5ace;if(_0x427257>=_0x41a4e1){_0x427257=_0x41a4e1;_0x2f5ace=0xc8;}else{_0x2f5ace=0xce;}_0x437db9['status'](_0x2f5ace);return _0x437db9['set'](_0x3d3e('0x21'),_0x4a8438+'-'+_0x427257+'/'+_0x41a4e1)[_0x3d3e('0x22')](_0x209a48);}return null;};}function patchUpdates(_0x2dada7){return function(_0x2a17e3){try{jsonpatch[_0x3d3e('0x23')](_0x2a17e3,_0x2dada7,!![]);}catch(_0x27b40c){return BPromise[_0x3d3e('0x24')](_0x27b40c);}return _0x2a17e3['save']();};}function saveUpdates(_0x5e288f,_0x982266){return function(_0x39cb0c){if(_0x39cb0c){return _0x39cb0c[_0x3d3e('0x25')](_0x5e288f)[_0x3d3e('0x26')](function(_0x45ab7d){return _0x45ab7d;});}return null;};}function removeEntity(_0x4eb44a,_0x2778d4){return function(_0x2f10ee){if(_0x2f10ee){return _0x2f10ee[_0x3d3e('0x27')]()[_0x3d3e('0x26')](function(){_0x4eb44a[_0x3d3e('0x1b')](0xcc)[_0x3d3e('0x1c')]();});}};}function handleEntityNotFound(_0x48e167,_0x1bb44b){return function(_0x43fb93){if(!_0x43fb93){_0x48e167[_0x3d3e('0x1a')](0x194);}return _0x43fb93;};}function handleError(_0x9951b2,_0x1ad0a3){_0x1ad0a3=_0x1ad0a3||0x1f4;return function(_0x351866){logger['error'](_0x351866['stack']);if(_0x351866[_0x3d3e('0x28')]){delete _0x351866[_0x3d3e('0x28')];}_0x9951b2[_0x3d3e('0x1b')](_0x1ad0a3)[_0x3d3e('0x29')](_0x351866);};}exports[_0x3d3e('0x2a')]=function(_0x513743,_0x49276a){var _0x6e5c91={},_0x57dd54={},_0x424399={'count':0x0,'rows':[]};var _0x246922=_[_0x3d3e('0x2b')](db[_0x3d3e('0x2c')][_0x3d3e('0x2d')],function(_0x20c85b){return{'name':_0x20c85b['fieldName'],'type':_0x20c85b[_0x3d3e('0x2e')][_0x3d3e('0x2f')]};});_0x57dd54[_0x3d3e('0x30')]=_[_0x3d3e('0x2b')](_0x246922,_0x3d3e('0x28'));_0x57dd54[_0x3d3e('0x31')]=_[_0x3d3e('0x32')](_0x513743[_0x3d3e('0x31')]);_0x57dd54[_0x3d3e('0x33')]=_[_0x3d3e('0x34')](_0x57dd54[_0x3d3e('0x30')],_0x57dd54[_0x3d3e('0x31')]);_0x6e5c91[_0x3d3e('0x35')]=_[_0x3d3e('0x34')](_0x57dd54[_0x3d3e('0x30')],qs[_0x3d3e('0x36')](_0x513743[_0x3d3e('0x31')]['fields']));_0x6e5c91[_0x3d3e('0x35')]=_0x6e5c91[_0x3d3e('0x35')][_0x3d3e('0x37')]?_0x6e5c91['attributes']:_0x57dd54[_0x3d3e('0x30')];if(!_0x513743[_0x3d3e('0x31')]['hasOwnProperty'](_0x3d3e('0x38'))){_0x6e5c91[_0x3d3e('0x1f')]=qs['limit'](_0x513743[_0x3d3e('0x31')][_0x3d3e('0x1f')]);_0x6e5c91[_0x3d3e('0x1d')]=qs[_0x3d3e('0x1d')](_0x513743['query'][_0x3d3e('0x1d')]);}_0x6e5c91[_0x3d3e('0x39')]=qs[_0x3d3e('0x3a')](_0x513743['query'][_0x3d3e('0x3a')]);_0x6e5c91[_0x3d3e('0x3b')]=qs[_0x3d3e('0x33')](_[_0x3d3e('0x3c')](_0x513743[_0x3d3e('0x31')],_0x57dd54[_0x3d3e('0x33')]),_0x246922);if(_0x513743['query'][_0x3d3e('0x3d')]){_0x6e5c91[_0x3d3e('0x3b')]=_[_0x3d3e('0x3e')](_0x6e5c91[_0x3d3e('0x3b')],{'$or':_[_0x3d3e('0x2b')](_0x246922,function(_0x475b49){if(_0x475b49['type']!==_0x3d3e('0x3f')){var _0x3d7c7f={};_0x3d7c7f[_0x475b49['name']]={'$like':'%'+_0x513743[_0x3d3e('0x31')][_0x3d3e('0x3d')]+'%'};return _0x3d7c7f;}})});}_0x6e5c91=_[_0x3d3e('0x3e')]({},_0x6e5c91,_0x513743['options']);var _0x3b7a95={'where':_0x6e5c91[_0x3d3e('0x3b')]};return db[_0x3d3e('0x2c')][_0x3d3e('0x20')](_0x3b7a95)[_0x3d3e('0x26')](function(_0x3ec967){_0x424399[_0x3d3e('0x20')]=_0x3ec967;if(_0x513743[_0x3d3e('0x31')][_0x3d3e('0x40')]){_0x6e5c91['include']=[{'all':!![]}];}return db[_0x3d3e('0x2c')][_0x3d3e('0x41')](_0x6e5c91);})[_0x3d3e('0x26')](function(_0x9ed32b){_0x424399['rows']=_0x9ed32b;return _0x424399;})[_0x3d3e('0x26')](respondWithFilteredResult(_0x49276a,_0x6e5c91))[_0x3d3e('0x42')](handleError(_0x49276a,null));};exports[_0x3d3e('0x43')]=function(_0xb15d65,_0x3c2221){var _0x8719f5={'raw':![],'where':{'id':_0xb15d65[_0x3d3e('0x44')]['id']}},_0x2f3321={};_0x2f3321['model']=_[_0x3d3e('0x32')](db['SalesforceAccount'][_0x3d3e('0x2d')]);_0x2f3321[_0x3d3e('0x31')]=_[_0x3d3e('0x32')](_0xb15d65[_0x3d3e('0x31')]);_0x2f3321[_0x3d3e('0x33')]=_[_0x3d3e('0x34')](_0x2f3321[_0x3d3e('0x30')],_0x2f3321['query']);_0x8719f5[_0x3d3e('0x35')]=_[_0x3d3e('0x34')](_0x2f3321['model'],qs[_0x3d3e('0x36')](_0xb15d65[_0x3d3e('0x31')]['fields']));_0x8719f5[_0x3d3e('0x35')]=_0x8719f5[_0x3d3e('0x35')][_0x3d3e('0x37')]?_0x8719f5['attributes']:_0x2f3321[_0x3d3e('0x30')];if(_0xb15d65[_0x3d3e('0x31')]['includeAll']){_0x8719f5['include']=[{'all':!![]}];}_0x8719f5=_[_0x3d3e('0x3e')]({},_0x8719f5,_0xb15d65[_0x3d3e('0x45')]);return db['SalesforceAccount']['find'](_0x8719f5)[_0x3d3e('0x26')](handleEntityNotFound(_0x3c2221,null))[_0x3d3e('0x26')](respondWithResult(_0x3c2221,null))[_0x3d3e('0x42')](handleError(_0x3c2221,null));};exports[_0x3d3e('0x46')]=function(_0xaf7f90,_0xdbec1d){return db[_0x3d3e('0x2c')][_0x3d3e('0x46')](_0xaf7f90[_0x3d3e('0x47')],{})[_0x3d3e('0x26')](respondWithResult(_0xdbec1d,0xc9))[_0x3d3e('0x42')](handleError(_0xdbec1d,null));};exports[_0x3d3e('0x25')]=function(_0x4169db,_0x1dff16){if(_0x4169db[_0x3d3e('0x47')]['id']){delete _0x4169db[_0x3d3e('0x47')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x4169db[_0x3d3e('0x44')]['id']}})[_0x3d3e('0x26')](handleEntityNotFound(_0x1dff16,null))[_0x3d3e('0x26')](saveUpdates(_0x4169db[_0x3d3e('0x47')],null))[_0x3d3e('0x26')](respondWithResult(_0x1dff16,null))[_0x3d3e('0x42')](handleError(_0x1dff16,null));};exports[_0x3d3e('0x27')]=function(_0x3c6970,_0x4222b4){return db[_0x3d3e('0x2c')][_0x3d3e('0x48')]({'where':{'id':_0x3c6970[_0x3d3e('0x44')]['id']}})['then'](handleEntityNotFound(_0x4222b4,null))['then'](removeEntity(_0x4222b4,null))[_0x3d3e('0x42')](handleError(_0x4222b4,null));};exports['getConfigurations']=function(_0x19b0ce,_0x433e2f,_0x3e56ca){var _0xc7e84f={};var _0x135854={};var _0x478609;var _0xb62607;return db[_0x3d3e('0x2c')][_0x3d3e('0x49')]({'where':{'id':_0x19b0ce['params']['id']}})[_0x3d3e('0x26')](handleEntityNotFound(_0x433e2f,null))[_0x3d3e('0x26')](function(_0x5cefa6){if(_0x5cefa6){_0x478609=_0x5cefa6;_0x135854[_0x3d3e('0x30')]=_['keys'](db['SalesforceConfiguration'][_0x3d3e('0x2d')]);_0x135854[_0x3d3e('0x31')]=_['keys'](_0x19b0ce[_0x3d3e('0x31')]);_0x135854[_0x3d3e('0x33')]=_[_0x3d3e('0x34')](_0x135854[_0x3d3e('0x30')],_0x135854[_0x3d3e('0x31')]);_0xc7e84f[_0x3d3e('0x35')]=_[_0x3d3e('0x34')](_0x135854[_0x3d3e('0x30')],qs[_0x3d3e('0x36')](_0x19b0ce[_0x3d3e('0x31')][_0x3d3e('0x36')]));_0xc7e84f[_0x3d3e('0x35')]=_0xc7e84f[_0x3d3e('0x35')][_0x3d3e('0x37')]?_0xc7e84f['attributes']:_0x135854[_0x3d3e('0x30')];_0xc7e84f[_0x3d3e('0x39')]=qs[_0x3d3e('0x3a')](_0x19b0ce[_0x3d3e('0x31')][_0x3d3e('0x3a')]);_0xc7e84f[_0x3d3e('0x3b')]=qs['filters'](_[_0x3d3e('0x3c')](_0x19b0ce[_0x3d3e('0x31')],_0x135854[_0x3d3e('0x33')]));if(_0x19b0ce[_0x3d3e('0x31')]['filter']){_0xc7e84f[_0x3d3e('0x3b')]=_[_0x3d3e('0x3e')](_0xc7e84f['where'],{'$or':_[_0x3d3e('0x2b')](_0xc7e84f[_0x3d3e('0x35')],function(_0xeefbfb){var _0x2782f6={};_0x2782f6[_0xeefbfb]={'$like':'%'+_0x19b0ce[_0x3d3e('0x31')][_0x3d3e('0x3d')]+'%'};return _0x2782f6;})});}_0xc7e84f=_[_0x3d3e('0x3e')]({},_0xc7e84f,_0x19b0ce[_0x3d3e('0x45')]);return _0x478609['getConfigurations'](_0xc7e84f);}})[_0x3d3e('0x26')](function(_0x203eba){if(_0x203eba){_0xb62607=_0x203eba['length'];if(!_0x19b0ce['query'][_0x3d3e('0x4a')](_0x3d3e('0x38'))){_0xc7e84f[_0x3d3e('0x1f')]=qs[_0x3d3e('0x1f')](_0x19b0ce[_0x3d3e('0x31')][_0x3d3e('0x1f')]);_0xc7e84f[_0x3d3e('0x1d')]=qs[_0x3d3e('0x1d')](_0x19b0ce[_0x3d3e('0x31')][_0x3d3e('0x1d')]);}return _0x478609['getConfigurations'](_0xc7e84f);}})['then'](function(_0x5e9d4f){if(_0x5e9d4f){return _0x5e9d4f?{'count':_0xb62607,'rows':_0x5e9d4f}:null;}})[_0x3d3e('0x26')](respondWithResult(_0x433e2f,null))['catch'](handleError(_0x433e2f,null));};exports['addConfiguration']=function(_0x1d3c4b,_0x1e5a5b,_0x36c261){if(_0x1d3c4b[_0x3d3e('0x47')]['id']){delete _0x1d3c4b[_0x3d3e('0x47')]['id'];}return db[_0x3d3e('0x2c')]['findOne']({'where':{'id':_0x1d3c4b['params']['id']}})[_0x3d3e('0x26')](handleEntityNotFound(_0x1e5a5b,null))[_0x3d3e('0x26')](function(_0x2a48d5){if(_0x2a48d5){_0x1d3c4b[_0x3d3e('0x47')][_0x3d3e('0x4b')]=_0x2a48d5['id'];_0x1d3c4b[_0x3d3e('0x47')][_0x3d3e('0x4c')]=integrations[_0x3d3e('0x4d')](_0x1d3c4b[_0x3d3e('0x47')][_0x3d3e('0x4e')],_0x1d3c4b[_0x3d3e('0x47')][_0x3d3e('0x2e')]);_0x1d3c4b[_0x3d3e('0x47')]['Descriptions']=integrations[_0x3d3e('0x4f')](_0x1d3c4b['body'][_0x3d3e('0x4e')],_0x1d3c4b[_0x3d3e('0x47')][_0x3d3e('0x2e')]);return db[_0x3d3e('0x50')][_0x3d3e('0x46')](_0x1d3c4b[_0x3d3e('0x47')],{'include':[{'model':db[_0x3d3e('0x51')],'as':_0x3d3e('0x4c')},{'model':db[_0x3d3e('0x51')],'as':'Descriptions'}]});}return null;})[_0x3d3e('0x26')](respondWithResult(_0x1e5a5b,null))['catch'](handleError(_0x1e5a5b,null));};exports[_0x3d3e('0x52')]=function(_0x31150e,_0x44cfa3,_0x36c538){var _0x5869af;var _0x47533d='';var _0x4999e6=_0x3d3e('0x53');return db[_0x3d3e('0x2c')]['findOne']({'where':{'id':_0x31150e[_0x3d3e('0x44')]['id']},'attributes':['id','remoteUri',_0x3d3e('0x54'),_0x3d3e('0x55'),_0x3d3e('0x56'),_0x3d3e('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x44cfa3,null))[_0x3d3e('0x26')](function(_0x572e4b){if(_0x572e4b){_0x47533d=_0x572e4b['remoteUri'];var _0x2fd0db=_0x47533d['slice'](-0x1);if(_0x2fd0db==='/'){_0x47533d=_0x47533d[_0x3d3e('0x58')](0x0,_0x47533d[_0x3d3e('0x59')](_0x2fd0db));}_0x5869af=new jsforce['Connection']({'oauth2':{'loginUrl':_0x47533d,'clientId':_0x572e4b['clientId'],'clientSecret':_0x572e4b[_0x3d3e('0x55')]}});return _0x5869af['login'](_0x572e4b['username'],_0x572e4b['password'][_0x3d3e('0x5a')](_0x572e4b[_0x3d3e('0x5b')]));}})[_0x3d3e('0x26')](function(_0x2c3fef){if(_0x2c3fef){if(!_['isNil'](_0x31150e[_0x3d3e('0x31')][_0x3d3e('0x5c')])){_0x4999e6=_0x31150e['query'][_0x3d3e('0x5c')];}return _0x5869af[_0x3d3e('0x5d')](_0x4999e6)[_0x3d3e('0x5e')]();}})[_0x3d3e('0x26')](function(_0x1f005c){var _0x3ff9d2=[_0x3d3e('0x5f'),_0x3d3e('0x60'),_0x3d3e('0x61'),_0x3d3e('0x62'),_0x3d3e('0x63'),_0x3d3e('0x64')];var _0x461fe3=[_0x3d3e('0x65'),_0x3d3e('0x66'),_0x3d3e('0x67'),'boolean',_0x3d3e('0x68'),_0x3d3e('0x69'),_0x3d3e('0x6a')];if(_0x1f005c){_[_0x3d3e('0x6b')](_0x1f005c[_0x3d3e('0x36')],function(_0x31a092){return _0x3ff9d2[_0x3d3e('0x6c')](_0x31a092[_0x3d3e('0x28')])||!_0x461fe3[_0x3d3e('0x6c')](_0x31a092[_0x3d3e('0x2e')]);});return{'count':_0x1f005c['fields'][_0x3d3e('0x37')],'rows':_[_0x3d3e('0x2b')](_0x1f005c[_0x3d3e('0x36')],function(_0x15373f){return{'id':_0x15373f['name'],'name':_0x15373f[_0x3d3e('0x6d')],'custom':_0x15373f[_0x3d3e('0x6e')],'options':_0x15373f[_0x3d3e('0x6f')][_0x3d3e('0x37')]>0x0?_[_0x3d3e('0x2b')](_0x15373f[_0x3d3e('0x6f')],function(_0x4e8b5f){return{'name':_0x4e8b5f[_0x3d3e('0x6d')],'value':_0x4e8b5f[_0x3d3e('0x70')]};}):_0x15373f[_0x3d3e('0x2e')]==_0x3d3e('0x71')?[{'name':'True','value':_0x3d3e('0x72')},{'name':_0x3d3e('0x73'),'value':_0x3d3e('0x74')}]:[]};})};}})[_0x3d3e('0x26')](respondWithResult(_0x44cfa3,null))[_0x3d3e('0x42')](function(_0x383258){var _0x13c298=_0x31150e[_0x3d3e('0x31')]['test']?0x1f4:_0x383258[_0x3d3e('0x75')]||0x1f4;logger['error'](_0x3d3e('0x76'),_0x3d3e('0x52'),_0x13c298,JSON['stringify'](_0x383258));delete _0x383258['name'];if(_0x13c298===0x191){_0x13c298=0x190;}_0x44cfa3['status'](_0x13c298)[_0x3d3e('0x29')](_0x31150e['query']['test']?{'message':_0x3d3e('0x77'),'statusCode':_0x383258[_0x3d3e('0x75')]}:_0x383258);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index aee4444..d0eb678 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 _0xd84e=['path','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xd84e,0x166));var _0xed84=function(_0x4c335d,_0x3f0f3f){_0x4c335d=_0x4c335d-0x0;var _0x5abcd5=_0xd84e[_0x4c335d];return _0x5abcd5;};'use strict';var _=require('lodash');var util=require(_0xed84('0x0'));var logger=require(_0xed84('0x1'))(_0xed84('0x2'));var moment=require(_0xed84('0x3'));var BPromise=require(_0xed84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed84('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed84('0x6'));var integrations=require(_0xed84('0x7'));module['exports']=function(_0x927854,_0x471d41){return _0x927854[_0xed84('0x8')](_0xed84('0x9'),attributes,{'tableName':_0xed84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbb8=['lodash','util','../../config/logger','api','bluebird','path','rimraf','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts'];(function(_0x3d4502,_0x21b87b){var _0x4f0f0e=function(_0x2442c2){while(--_0x2442c2){_0x3d4502['push'](_0x3d4502['shift']());}};_0x4f0f0e(++_0x21b87b);}(_0xfbb8,0x160));var _0x8fbb=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xfbb8[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x8fbb('0x0'));var util=require(_0x8fbb('0x1'));var logger=require(_0x8fbb('0x2'))(_0x8fbb('0x3'));var moment=require('moment');var BPromise=require(_0x8fbb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbb('0x5'));var rimraf=require(_0x8fbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x8fbb('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8fbb('0x8')]=function(_0x3c14a9,_0x4a494a){return _0x3c14a9[_0x8fbb('0x9')]('SalesforceAccount',attributes,{'tableName':_0x8fbb('0xa'),'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 5947ec9..5e76e5e 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 _0x1d98=['client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','map','include','model','debug','find','raw','ShowSalesforceAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x432d58,_0x535ca9){var _0x3c25c4=function(_0x2f1bac){while(--_0x2f1bac){_0x432d58['push'](_0x432d58['shift']());}};_0x3c25c4(++_0x535ca9);}(_0x1d98,0x117));var _0x81d9=function(_0x22a88c,_0x5430c3){_0x22a88c=_0x22a88c-0x0;var _0x1e0629=_0x1d98[_0x22a88c];return _0x1e0629;};'use strict';var _=require(_0x81d9('0x0'));var util=require(_0x81d9('0x1'));var moment=require('moment');var BPromise=require(_0x81d9('0x2'));var rs=require(_0x81d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81d9('0x4'))['db'];var utils=require(_0x81d9('0x5'));var logger=require(_0x81d9('0x6'))(_0x81d9('0x7'));var config=require(_0x81d9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81d9('0x9')][_0x81d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x260171,_0x5ed9f1,_0xb6012f){return new BPromise(function(_0xf46fa6,_0x39a771){return client['request'](_0x260171,_0xb6012f)[_0x81d9('0xb')](function(_0x4a95c4){logger[_0x81d9('0xc')](_0x81d9('0xd'),_0x5ed9f1,_0x81d9('0xe'));logger['debug'](_0x81d9('0xf'),_0x5ed9f1,_0x81d9('0xe'),JSON[_0x81d9('0x10')](_0x4a95c4));if(_0x4a95c4[_0x81d9('0x11')]){if(_0x4a95c4[_0x81d9('0x11')][_0x81d9('0x12')]===0x1f4){logger[_0x81d9('0x11')](_0x81d9('0xd'),_0x5ed9f1,_0x4a95c4[_0x81d9('0x11')][_0x81d9('0x13')]);return _0x39a771(_0x4a95c4['error'][_0x81d9('0x13')]);}logger[_0x81d9('0x11')](_0x81d9('0xd'),_0x5ed9f1,_0x4a95c4[_0x81d9('0x11')][_0x81d9('0x13')]);return _0xf46fa6(_0x4a95c4['error'][_0x81d9('0x13')]);}else{logger[_0x81d9('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5ed9f1,'request\x20sent');_0xf46fa6(_0x4a95c4[_0x81d9('0x14')][_0x81d9('0x13')]);}})[_0x81d9('0x15')](function(_0x26278e){logger[_0x81d9('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x5ed9f1,_0x26278e);_0x39a771(_0x26278e);});});}exports[_0x81d9('0x16')]=function(_0x5780f5){var _0x41926f=this;return new Promise(function(_0x5b7faa,_0x5c129f){return db[_0x81d9('0x17')][_0x81d9('0x18')]({'raw':_0x5780f5['options']?_0x5780f5[_0x81d9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5780f5[_0x81d9('0x19')]?_0x5780f5['options'][_0x81d9('0x1a')]||null:null,'attributes':_0x5780f5[_0x81d9('0x19')]?_0x5780f5[_0x81d9('0x19')][_0x81d9('0x1b')]||null:null,'limit':_0x5780f5[_0x81d9('0x19')]?_0x5780f5[_0x81d9('0x19')][_0x81d9('0x1c')]||null:null,'include':_0x5780f5[_0x81d9('0x19')]?_0x5780f5['options']['include']?_[_0x81d9('0x1d')](_0x5780f5['options'][_0x81d9('0x1e')],function(_0x39b1c2){return{'model':db[_0x39b1c2[_0x81d9('0x1f')]],'as':_0x39b1c2['as'],'attributes':_0x39b1c2[_0x81d9('0x1b')],'include':_0x39b1c2['include']?_[_0x81d9('0x1d')](_0x39b1c2['include'],function(_0x526eb2){return{'model':db[_0x526eb2[_0x81d9('0x1f')]],'as':_0x526eb2['as'],'attributes':_0x526eb2[_0x81d9('0x1b')],'include':_0x526eb2['include']?_[_0x81d9('0x1d')](_0x526eb2['include'],function(_0x5ddc5c){return{'model':db[_0x5ddc5c[_0x81d9('0x1f')]],'as':_0x5ddc5c['as'],'attributes':_0x5ddc5c[_0x81d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x81d9('0xb')](function(_0x4ac9b2){logger[_0x81d9('0xc')](_0x81d9('0x16'),_0x5780f5);logger[_0x81d9('0x20')]('GetSalesforceAccount',_0x5780f5,JSON['stringify'](_0x4ac9b2));_0x5b7faa(_0x4ac9b2);})[_0x81d9('0x15')](function(_0x46ccc6){logger[_0x81d9('0x11')](_0x81d9('0x16'),_0x46ccc6['message'],_0x5780f5);_0x5c129f(_0x41926f['error'](0x1f4,_0x46ccc6[_0x81d9('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x574893){var _0x75cb15=this;return new Promise(function(_0x4f7b3e,_0x10de8c){return db[_0x81d9('0x17')][_0x81d9('0x21')]({'raw':_0x574893[_0x81d9('0x19')]?_0x574893[_0x81d9('0x19')][_0x81d9('0x22')]===undefined?!![]:![]:!![],'where':_0x574893[_0x81d9('0x19')]?_0x574893['options'][_0x81d9('0x1a')]||null:null,'attributes':_0x574893[_0x81d9('0x19')]?_0x574893[_0x81d9('0x19')][_0x81d9('0x1b')]||null:null,'include':_0x574893[_0x81d9('0x19')]?_0x574893['options'][_0x81d9('0x1e')]?_['map'](_0x574893[_0x81d9('0x19')][_0x81d9('0x1e')],function(_0x5dc5ed){return{'model':db[_0x5dc5ed[_0x81d9('0x1f')]],'as':_0x5dc5ed['as'],'attributes':_0x5dc5ed['attributes'],'include':_0x5dc5ed[_0x81d9('0x1e')]?_[_0x81d9('0x1d')](_0x5dc5ed['include'],function(_0x91215c){return{'model':db[_0x91215c[_0x81d9('0x1f')]],'as':_0x91215c['as'],'attributes':_0x91215c[_0x81d9('0x1b')],'include':_0x91215c['include']?_[_0x81d9('0x1d')](_0x91215c[_0x81d9('0x1e')],function(_0xa40963){return{'model':db[_0xa40963[_0x81d9('0x1f')]],'as':_0xa40963['as'],'attributes':_0xa40963[_0x81d9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d53b6){logger[_0x81d9('0xc')](_0x81d9('0x23'),_0x574893);logger[_0x81d9('0x20')](_0x81d9('0x23'),_0x574893,JSON[_0x81d9('0x10')](_0x3d53b6));_0x4f7b3e(_0x3d53b6);})[_0x81d9('0x15')](function(_0xd21b9d){logger[_0x81d9('0x11')](_0x81d9('0x23'),_0xd21b9d[_0x81d9('0x13')],_0x574893);_0x10de8c(_0x75cb15[_0x81d9('0x11')](0x1f4,_0xd21b9d[_0x81d9('0x13')]));});});}; \ No newline at end of file +var _0xa5fd=['where','attributes','limit','include','map','model','ShowSalesforceAccount','find','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options'];(function(_0x522bc8,_0x3525bf){var _0x5c5ab4=function(_0x48cafe){while(--_0x48cafe){_0x522bc8['push'](_0x522bc8['shift']());}};_0x5c5ab4(++_0x3525bf);}(_0xa5fd,0x173));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda5f('0x0'));var BPromise=require(_0xda5f('0x1'));var rs=require(_0xda5f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xda5f('0x3'))(_0xda5f('0x4'));var config=require(_0xda5f('0x5'));var jayson=require(_0xda5f('0x6'));var client=jayson['client'][_0xda5f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4b3098,_0x16d2ef,_0xcf238e){return new BPromise(function(_0x3b0ead,_0x585e03){return client[_0xda5f('0x8')](_0x4b3098,_0xcf238e)[_0xda5f('0x9')](function(_0x320a34){logger[_0xda5f('0xa')](_0xda5f('0xb'),_0x16d2ef,_0xda5f('0xc'));logger[_0xda5f('0xd')](_0xda5f('0xe'),_0x16d2ef,'request\x20sent',JSON[_0xda5f('0xf')](_0x320a34));if(_0x320a34[_0xda5f('0x10')]){if(_0x320a34[_0xda5f('0x10')][_0xda5f('0x11')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x16d2ef,_0x320a34[_0xda5f('0x10')][_0xda5f('0x12')]);return _0x585e03(_0x320a34[_0xda5f('0x10')][_0xda5f('0x12')]);}logger[_0xda5f('0x10')](_0xda5f('0xb'),_0x16d2ef,_0x320a34['error'][_0xda5f('0x12')]);return _0x3b0ead(_0x320a34['error'][_0xda5f('0x12')]);}else{logger[_0xda5f('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x16d2ef,_0xda5f('0xc'));_0x3b0ead(_0x320a34[_0xda5f('0x13')][_0xda5f('0x12')]);}})[_0xda5f('0x14')](function(_0x53357c){logger[_0xda5f('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x16d2ef,_0x53357c);_0x585e03(_0x53357c);});});}exports[_0xda5f('0x15')]=function(_0x3486d6){var _0x27ea78=this;return new Promise(function(_0x111f77,_0x4b0178){return db[_0xda5f('0x16')][_0xda5f('0x17')]({'raw':_0x3486d6[_0xda5f('0x18')]?_0x3486d6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3486d6[_0xda5f('0x18')]?_0x3486d6[_0xda5f('0x18')][_0xda5f('0x19')]||null:null,'attributes':_0x3486d6[_0xda5f('0x18')]?_0x3486d6['options'][_0xda5f('0x1a')]||null:null,'limit':_0x3486d6[_0xda5f('0x18')]?_0x3486d6[_0xda5f('0x18')][_0xda5f('0x1b')]||null:null,'include':_0x3486d6[_0xda5f('0x18')]?_0x3486d6['options'][_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0x3486d6[_0xda5f('0x18')][_0xda5f('0x1c')],function(_0xf53945){return{'model':db[_0xf53945['model']],'as':_0xf53945['as'],'attributes':_0xf53945[_0xda5f('0x1a')],'include':_0xf53945[_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0xf53945['include'],function(_0x34b3f6){return{'model':db[_0x34b3f6[_0xda5f('0x1e')]],'as':_0x34b3f6['as'],'attributes':_0x34b3f6[_0xda5f('0x1a')],'include':_0x34b3f6[_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0x34b3f6['include'],function(_0x3773a8){return{'model':db[_0x3773a8[_0xda5f('0x1e')]],'as':_0x3773a8['as'],'attributes':_0x3773a8[_0xda5f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda5f('0x9')](function(_0x109263){logger['info'](_0xda5f('0x15'),_0x3486d6);logger[_0xda5f('0xd')]('GetSalesforceAccount',_0x3486d6,JSON[_0xda5f('0xf')](_0x109263));_0x111f77(_0x109263);})[_0xda5f('0x14')](function(_0x12796c){logger[_0xda5f('0x10')](_0xda5f('0x15'),_0x12796c[_0xda5f('0x12')],_0x3486d6);_0x4b0178(_0x27ea78['error'](0x1f4,_0x12796c[_0xda5f('0x12')]));});});};exports[_0xda5f('0x1f')]=function(_0x1d9488){var _0x303990=this;return new Promise(function(_0x3eaf92,_0x566ba8){return db[_0xda5f('0x16')][_0xda5f('0x20')]({'raw':_0x1d9488['options']?_0x1d9488[_0xda5f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1d9488['options']?_0x1d9488[_0xda5f('0x18')][_0xda5f('0x19')]||null:null,'attributes':_0x1d9488[_0xda5f('0x18')]?_0x1d9488[_0xda5f('0x18')][_0xda5f('0x1a')]||null:null,'include':_0x1d9488[_0xda5f('0x18')]?_0x1d9488['options'][_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0x1d9488['options'][_0xda5f('0x1c')],function(_0x18b732){return{'model':db[_0x18b732[_0xda5f('0x1e')]],'as':_0x18b732['as'],'attributes':_0x18b732['attributes'],'include':_0x18b732[_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0x18b732[_0xda5f('0x1c')],function(_0x5c0cc9){return{'model':db[_0x5c0cc9['model']],'as':_0x5c0cc9['as'],'attributes':_0x5c0cc9[_0xda5f('0x1a')],'include':_0x5c0cc9[_0xda5f('0x1c')]?_[_0xda5f('0x1d')](_0x5c0cc9[_0xda5f('0x1c')],function(_0x24b6d0){return{'model':db[_0x24b6d0[_0xda5f('0x1e')]],'as':_0x24b6d0['as'],'attributes':_0x24b6d0[_0xda5f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xda5f('0x9')](function(_0x2a7dad){logger[_0xda5f('0xa')](_0xda5f('0x1f'),_0x1d9488);logger['debug']('ShowSalesforceAccount',_0x1d9488,JSON['stringify'](_0x2a7dad));_0x3eaf92(_0x2a7dad);})['catch'](function(_0x10495d){logger[_0xda5f('0x10')](_0xda5f('0x1f'),_0x10495d[_0xda5f('0x12')],_0x1d9488);_0x566ba8(_0x303990[_0xda5f('0x10')](0x1f4,_0x10495d[_0xda5f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 19c55a1..f380069 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 _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x3c1eab,_0x3cee3f){_0x3c1eab=_0x3c1eab-0x0;var _0x296948=_0x2032[_0x3c1eab];return _0x296948;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x34daef,_0x4c5c3a){var _0x5188fc=function(_0x3ac602){while(--_0x3ac602){_0x34daef['push'](_0x34daef['shift']());}};_0x5188fc(++_0x4c5c3a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 5106d86..1d5e31f 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 _0xd3ee=['exports','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x3c81d5,_0x2bf964){var _0x3212fd=function(_0x19aa36){while(--_0x19aa36){_0x3c81d5['push'](_0x3c81d5['shift']());}};_0x3212fd(++_0x2bf964);}(_0xd3ee,0x190));var _0xed3e=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0xd3ee[_0x12a62c];return _0x268a58;};'use strict';var Sequelize=require('sequelize');module[_0xed3e('0x0')]={'name':{'type':Sequelize[_0xed3e('0x1')]},'description':{'type':Sequelize[_0xed3e('0x1')]},'ticketType':{'type':Sequelize[_0xed3e('0x2')](_0xed3e('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xed3e('0x2')](_0xed3e('0x4'),_0xed3e('0x5'),_0xed3e('0x6'),_0xed3e('0x7'),_0xed3e('0x8')),'defaultValue':_0xed3e('0x4')},'moduleCreate':{'type':Sequelize[_0xed3e('0x2')](_0xed3e('0x9'),_0xed3e('0x5'),_0xed3e('0x6'),_0xed3e('0x8')),'defaultValue':_0xed3e('0x6')},'leadId':{'type':Sequelize[_0xed3e('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xed3e('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xed3e('0x1')]}}; \ No newline at end of file +var _0x5df3=['lead','account_contact_lead','contact_lead','STRING','ENUM','Task','contact'];(function(_0x5ded1c,_0x2c8d0e){var _0x515ee2=function(_0x169ebb){while(--_0x169ebb){_0x5ded1c['push'](_0x5ded1c['shift']());}};_0x515ee2(++_0x2c8d0e);}(_0x5df3,0xb2));var _0x35df=function(_0x3e5147,_0x33eef9){_0x3e5147=_0x3e5147-0x0;var _0x18c779=_0x5df3[_0x3e5147];return _0x18c779;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x35df('0x0')]},'description':{'type':Sequelize[_0x35df('0x0')]},'ticketType':{'type':Sequelize[_0x35df('0x1')](_0x35df('0x2'),'Case'),'defaultValue':_0x35df('0x2')},'moduleSearch':{'type':Sequelize[_0x35df('0x1')]('contact_lead',_0x35df('0x3'),_0x35df('0x4'),_0x35df('0x5'),'account'),'defaultValue':_0x35df('0x6')},'moduleCreate':{'type':Sequelize[_0x35df('0x1')]('nothing','contact',_0x35df('0x4'),'account'),'defaultValue':_0x35df('0x4')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x35df('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x35df('0x0')]},'additionalSearchLead':{'type':Sequelize[_0x35df('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index bd667e7..4b1c072 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 _0xeb54=['catch','rawAttributes','merge','find','create','body','params','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x3c77c4,_0xba72c3){var _0x3e1245=function(_0x5e525e){while(--_0x5e525e){_0x3c77c4['push'](_0x3c77c4['shift']());}};_0x3e1245(++_0xba72c3);}(_0xeb54,0xfa));var _0x4eb5=function(_0x41ce81,_0x30d247){_0x41ce81=_0x41ce81-0x0;var _0x1331a4=_0xeb54[_0x41ce81];return _0x1331a4;};'use strict';var emlformat=require(_0x4eb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4eb5('0x1'));var jsonpatch=require(_0x4eb5('0x2'));var rp=require(_0x4eb5('0x3'));var moment=require(_0x4eb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4eb5('0x5'));var sox=require(_0x4eb5('0x6'));var csv=require(_0x4eb5('0x7'));var ejs=require(_0x4eb5('0x8'));var fs=require('fs');var fs_extra=require(_0x4eb5('0x9'));var _=require('lodash');var squel=require(_0x4eb5('0xa'));var crypto=require(_0x4eb5('0xb'));var jsforce=require(_0x4eb5('0xc'));var deskjs=require(_0x4eb5('0xd'));var toCsv=require(_0x4eb5('0x7'));var querystring=require(_0x4eb5('0xe'));var Papa=require(_0x4eb5('0xf'));var Redis=require(_0x4eb5('0x10'));var authService=require(_0x4eb5('0x11'));var qs=require(_0x4eb5('0x12'));var as=require(_0x4eb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4eb5('0x14'))(_0x4eb5('0x15'));var utils=require(_0x4eb5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4eb5('0x17'))['db'];function respondWithStatusCode(_0x5efb3b,_0x50e803){_0x50e803=_0x50e803||0xcc;return function(_0x2b0ab0){if(_0x2b0ab0){return _0x5efb3b['sendStatus'](_0x50e803);}return _0x5efb3b[_0x4eb5('0x18')](_0x50e803)[_0x4eb5('0x19')]();};}function respondWithResult(_0x4fd9ee,_0x39b9c2){_0x39b9c2=_0x39b9c2||0xc8;return function(_0x303dc1){if(_0x303dc1){return _0x4fd9ee[_0x4eb5('0x18')](_0x39b9c2)['json'](_0x303dc1);}};}function respondWithFilteredResult(_0xdfe301,_0x5f3918){return function(_0x580beb){if(_0x580beb){var _0xf778e=typeof _0x5f3918[_0x4eb5('0x1a')]===_0x4eb5('0x1b')&&typeof _0x5f3918[_0x4eb5('0x1c')]===_0x4eb5('0x1b');var _0x36edd7=_0x580beb[_0x4eb5('0x1d')];var _0x350bed=_0xf778e?0x0:_0x5f3918[_0x4eb5('0x1a')];var _0xac1ef2=_0xf778e?_0x580beb[_0x4eb5('0x1d')]:_0x5f3918[_0x4eb5('0x1a')]+_0x5f3918['limit'];var _0x1567ab;if(_0xac1ef2>=_0x36edd7){_0xac1ef2=_0x36edd7;_0x1567ab=0xc8;}else{_0x1567ab=0xce;}_0xdfe301[_0x4eb5('0x18')](_0x1567ab);return _0xdfe301[_0x4eb5('0x1e')](_0x4eb5('0x1f'),_0x350bed+'-'+_0xac1ef2+'/'+_0x36edd7)[_0x4eb5('0x20')](_0x580beb);}return null;};}function patchUpdates(_0x18b1b0){return function(_0x417754){try{jsonpatch['apply'](_0x417754,_0x18b1b0,!![]);}catch(_0x41c3d9){return BPromise[_0x4eb5('0x21')](_0x41c3d9);}return _0x417754['save']();};}function saveUpdates(_0x31a163,_0x592f88){return function(_0x2222e1){if(_0x2222e1){return _0x2222e1[_0x4eb5('0x22')](_0x31a163)[_0x4eb5('0x23')](function(_0x543481){return _0x543481;});}return null;};}function removeEntity(_0x453fa1,_0x2ff07e){return function(_0x88ca12){if(_0x88ca12){return _0x88ca12[_0x4eb5('0x24')]()[_0x4eb5('0x23')](function(){_0x453fa1[_0x4eb5('0x18')](0xcc)[_0x4eb5('0x19')]();});}};}function handleEntityNotFound(_0x14d16f,_0x511943){return function(_0x28e5ac){if(!_0x28e5ac){_0x14d16f['sendStatus'](0x194);}return _0x28e5ac;};}function handleError(_0x196734,_0x3dfc6e){_0x3dfc6e=_0x3dfc6e||0x1f4;return function(_0x276475){logger[_0x4eb5('0x25')](_0x276475['stack']);if(_0x276475[_0x4eb5('0x26')]){delete _0x276475['name'];}_0x196734['status'](_0x3dfc6e)[_0x4eb5('0x27')](_0x276475);};}exports[_0x4eb5('0x28')]=function(_0x364668,_0x24a95a){var _0x7d66ea={},_0x292628={},_0x3e3282={'count':0x0,'rows':[]};var _0xcd7250=_[_0x4eb5('0x29')](db[_0x4eb5('0x2a')]['rawAttributes'],function(_0x49d497){return{'name':_0x49d497[_0x4eb5('0x2b')],'type':_0x49d497[_0x4eb5('0x2c')][_0x4eb5('0x2d')]};});_0x292628[_0x4eb5('0x2e')]=_['map'](_0xcd7250,'name');_0x292628[_0x4eb5('0x2f')]=_[_0x4eb5('0x30')](_0x364668[_0x4eb5('0x2f')]);_0x292628['filters']=_['intersection'](_0x292628['model'],_0x292628['query']);_0x7d66ea[_0x4eb5('0x31')]=_[_0x4eb5('0x32')](_0x292628[_0x4eb5('0x2e')],qs[_0x4eb5('0x33')](_0x364668['query']['fields']));_0x7d66ea[_0x4eb5('0x31')]=_0x7d66ea['attributes'][_0x4eb5('0x34')]?_0x7d66ea[_0x4eb5('0x31')]:_0x292628[_0x4eb5('0x2e')];if(!_0x364668[_0x4eb5('0x2f')][_0x4eb5('0x35')](_0x4eb5('0x36'))){_0x7d66ea[_0x4eb5('0x1c')]=qs['limit'](_0x364668[_0x4eb5('0x2f')][_0x4eb5('0x1c')]);_0x7d66ea[_0x4eb5('0x1a')]=qs['offset'](_0x364668['query']['offset']);}_0x7d66ea[_0x4eb5('0x37')]=qs[_0x4eb5('0x38')](_0x364668[_0x4eb5('0x2f')][_0x4eb5('0x38')]);_0x7d66ea['where']=qs[_0x4eb5('0x39')](_['pick'](_0x364668[_0x4eb5('0x2f')],_0x292628['filters']),_0xcd7250);if(_0x364668[_0x4eb5('0x2f')]['filter']){_0x7d66ea[_0x4eb5('0x3a')]=_['merge'](_0x7d66ea[_0x4eb5('0x3a')],{'$or':_['map'](_0xcd7250,function(_0x1ce9a2){if(_0x1ce9a2['type']!==_0x4eb5('0x3b')){var _0x233570={};_0x233570[_0x1ce9a2[_0x4eb5('0x26')]]={'$like':'%'+_0x364668['query'][_0x4eb5('0x3c')]+'%'};return _0x233570;}})});}_0x7d66ea=_['merge']({},_0x7d66ea,_0x364668[_0x4eb5('0x3d')]);var _0x4606f4={'where':_0x7d66ea['where']};return db[_0x4eb5('0x2a')][_0x4eb5('0x1d')](_0x4606f4)['then'](function(_0x546c43){_0x3e3282[_0x4eb5('0x1d')]=_0x546c43;if(_0x364668['query'][_0x4eb5('0x3e')]){_0x7d66ea[_0x4eb5('0x3f')]=[{'all':!![]}];}return db[_0x4eb5('0x2a')][_0x4eb5('0x40')](_0x7d66ea);})[_0x4eb5('0x23')](function(_0x2ddfc8){_0x3e3282[_0x4eb5('0x41')]=_0x2ddfc8;return _0x3e3282;})[_0x4eb5('0x23')](respondWithFilteredResult(_0x24a95a,_0x7d66ea))[_0x4eb5('0x42')](handleError(_0x24a95a,null));};exports['show']=function(_0x391eda,_0x156b07){var _0x90660d={'raw':![],'where':{'id':_0x391eda['params']['id']}},_0x3c55fb={};_0x3c55fb[_0x4eb5('0x2e')]=_[_0x4eb5('0x30')](db[_0x4eb5('0x2a')][_0x4eb5('0x43')]);_0x3c55fb[_0x4eb5('0x2f')]=_[_0x4eb5('0x30')](_0x391eda[_0x4eb5('0x2f')]);_0x3c55fb[_0x4eb5('0x39')]=_[_0x4eb5('0x32')](_0x3c55fb[_0x4eb5('0x2e')],_0x3c55fb['query']);_0x90660d[_0x4eb5('0x31')]=_[_0x4eb5('0x32')](_0x3c55fb[_0x4eb5('0x2e')],qs['fields'](_0x391eda['query']['fields']));_0x90660d[_0x4eb5('0x31')]=_0x90660d[_0x4eb5('0x31')][_0x4eb5('0x34')]?_0x90660d[_0x4eb5('0x31')]:_0x3c55fb['model'];if(_0x391eda[_0x4eb5('0x2f')][_0x4eb5('0x3e')]){_0x90660d[_0x4eb5('0x3f')]=[{'all':!![]}];}_0x90660d=_[_0x4eb5('0x44')]({},_0x90660d,_0x391eda[_0x4eb5('0x3d')]);return db[_0x4eb5('0x2a')][_0x4eb5('0x45')](_0x90660d)[_0x4eb5('0x23')](handleEntityNotFound(_0x156b07,null))[_0x4eb5('0x23')](respondWithResult(_0x156b07,null))[_0x4eb5('0x42')](handleError(_0x156b07,null));};exports['create']=function(_0x15bff9,_0x197a78){return db[_0x4eb5('0x2a')][_0x4eb5('0x46')](_0x15bff9[_0x4eb5('0x47')],{})[_0x4eb5('0x23')](respondWithResult(_0x197a78,0xc9))[_0x4eb5('0x42')](handleError(_0x197a78,null));};exports[_0x4eb5('0x22')]=function(_0x27b844,_0x26cdca){if(_0x27b844[_0x4eb5('0x47')]['id']){delete _0x27b844['body']['id'];}return db[_0x4eb5('0x2a')][_0x4eb5('0x45')]({'where':{'id':_0x27b844[_0x4eb5('0x48')]['id']}})['then'](handleEntityNotFound(_0x26cdca,null))['then'](saveUpdates(_0x27b844[_0x4eb5('0x47')],null))[_0x4eb5('0x23')](respondWithResult(_0x26cdca,null))[_0x4eb5('0x42')](handleError(_0x26cdca,null));};exports[_0x4eb5('0x24')]=function(_0x224133,_0xf4d2d8){return db[_0x4eb5('0x2a')][_0x4eb5('0x45')]({'where':{'id':_0x224133[_0x4eb5('0x48')]['id']}})[_0x4eb5('0x23')](handleEntityNotFound(_0xf4d2d8,null))['then'](removeEntity(_0xf4d2d8,null))['catch'](handleError(_0xf4d2d8,null));};exports[_0x4eb5('0x49')]=function(_0x373b13,_0xefa022,_0xfabcd7){var _0x2b03f8={};var _0x3fe0b9={};var _0x459e41;var _0x4e9b5e;return db['SalesforceConfiguration'][_0x4eb5('0x4a')]({'where':{'id':_0x373b13[_0x4eb5('0x48')]['id']}})[_0x4eb5('0x23')](handleEntityNotFound(_0xefa022,null))[_0x4eb5('0x23')](function(_0x2e4e79){if(_0x2e4e79){_0x459e41=_0x2e4e79;_0x3fe0b9[_0x4eb5('0x2e')]=_[_0x4eb5('0x30')](db[_0x4eb5('0x4b')]['rawAttributes']);_0x3fe0b9[_0x4eb5('0x2f')]=_[_0x4eb5('0x30')](_0x373b13[_0x4eb5('0x2f')]);_0x3fe0b9[_0x4eb5('0x39')]=_[_0x4eb5('0x32')](_0x3fe0b9[_0x4eb5('0x2e')],_0x3fe0b9['query']);_0x2b03f8['attributes']=_[_0x4eb5('0x32')](_0x3fe0b9['model'],qs[_0x4eb5('0x33')](_0x373b13[_0x4eb5('0x2f')][_0x4eb5('0x33')]));_0x2b03f8[_0x4eb5('0x31')]=_0x2b03f8[_0x4eb5('0x31')][_0x4eb5('0x34')]?_0x2b03f8[_0x4eb5('0x31')]:_0x3fe0b9[_0x4eb5('0x2e')];_0x2b03f8[_0x4eb5('0x37')]=qs[_0x4eb5('0x38')](_0x373b13[_0x4eb5('0x2f')]['sort']);_0x2b03f8[_0x4eb5('0x3a')]=qs[_0x4eb5('0x39')](_[_0x4eb5('0x4c')](_0x373b13[_0x4eb5('0x2f')],_0x3fe0b9[_0x4eb5('0x39')]));if(_0x373b13[_0x4eb5('0x2f')][_0x4eb5('0x3c')]){_0x2b03f8[_0x4eb5('0x3a')]=_[_0x4eb5('0x44')](_0x2b03f8['where'],{'$or':_['map'](_0x2b03f8['attributes'],function(_0x898e79){var _0x32d582={};_0x32d582[_0x898e79]={'$like':'%'+_0x373b13[_0x4eb5('0x2f')][_0x4eb5('0x3c')]+'%'};return _0x32d582;})});}_0x2b03f8=_['merge']({},_0x2b03f8,_0x373b13[_0x4eb5('0x3d')]);return _0x459e41['getFields'](_0x2b03f8);}})[_0x4eb5('0x23')](function(_0x338264){if(_0x338264){_0x4e9b5e=_0x338264[_0x4eb5('0x34')];if(!_0x373b13[_0x4eb5('0x2f')]['hasOwnProperty']('nolimit')){_0x2b03f8[_0x4eb5('0x1c')]=qs[_0x4eb5('0x1c')](_0x373b13[_0x4eb5('0x2f')][_0x4eb5('0x1c')]);_0x2b03f8[_0x4eb5('0x1a')]=qs[_0x4eb5('0x1a')](_0x373b13[_0x4eb5('0x2f')]['offset']);}return _0x459e41[_0x4eb5('0x49')](_0x2b03f8);}})['then'](function(_0x16ab4f){if(_0x16ab4f){return _0x16ab4f?{'count':_0x4e9b5e,'rows':_0x16ab4f}:null;}})[_0x4eb5('0x23')](respondWithResult(_0xefa022,null))[_0x4eb5('0x42')](handleError(_0xefa022,null));};exports[_0x4eb5('0x4d')]=function(_0x359673,_0x57a6ee,_0x51d23c){var _0x1bde13={};var _0x1c0ecb={};var _0xddf617;var _0x5a9829;return db[_0x4eb5('0x2a')][_0x4eb5('0x4a')]({'where':{'id':_0x359673[_0x4eb5('0x48')]['id']}})[_0x4eb5('0x23')](handleEntityNotFound(_0x57a6ee,null))[_0x4eb5('0x23')](function(_0x135822){if(_0x135822){_0xddf617=_0x135822;_0x1c0ecb[_0x4eb5('0x2e')]=_[_0x4eb5('0x30')](db[_0x4eb5('0x4b')][_0x4eb5('0x43')]);_0x1c0ecb[_0x4eb5('0x2f')]=_[_0x4eb5('0x30')](_0x359673[_0x4eb5('0x2f')]);_0x1c0ecb[_0x4eb5('0x39')]=_[_0x4eb5('0x32')](_0x1c0ecb['model'],_0x1c0ecb['query']);_0x1bde13['attributes']=_[_0x4eb5('0x32')](_0x1c0ecb[_0x4eb5('0x2e')],qs[_0x4eb5('0x33')](_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x33')]));_0x1bde13[_0x4eb5('0x31')]=_0x1bde13[_0x4eb5('0x31')][_0x4eb5('0x34')]?_0x1bde13[_0x4eb5('0x31')]:_0x1c0ecb['model'];_0x1bde13[_0x4eb5('0x37')]=qs[_0x4eb5('0x38')](_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x38')]);_0x1bde13[_0x4eb5('0x3a')]=qs[_0x4eb5('0x39')](_[_0x4eb5('0x4c')](_0x359673[_0x4eb5('0x2f')],_0x1c0ecb[_0x4eb5('0x39')]));if(_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x3c')]){_0x1bde13[_0x4eb5('0x3a')]=_[_0x4eb5('0x44')](_0x1bde13[_0x4eb5('0x3a')],{'$or':_['map'](_0x1bde13[_0x4eb5('0x31')],function(_0xfbc60e){var _0xa9f05a={};_0xa9f05a[_0xfbc60e]={'$like':'%'+_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x3c')]+'%'};return _0xa9f05a;})});}_0x1bde13=_[_0x4eb5('0x44')]({},_0x1bde13,_0x359673['options']);return _0xddf617[_0x4eb5('0x4d')](_0x1bde13);}})[_0x4eb5('0x23')](function(_0x5e3add){if(_0x5e3add){_0x5a9829=_0x5e3add[_0x4eb5('0x34')];if(!_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x35')](_0x4eb5('0x36'))){_0x1bde13[_0x4eb5('0x1c')]=qs[_0x4eb5('0x1c')](_0x359673[_0x4eb5('0x2f')]['limit']);_0x1bde13['offset']=qs[_0x4eb5('0x1a')](_0x359673[_0x4eb5('0x2f')][_0x4eb5('0x1a')]);}return _0xddf617[_0x4eb5('0x4d')](_0x1bde13);}})['then'](function(_0x4265f){if(_0x4265f){return _0x4265f?{'count':_0x5a9829,'rows':_0x4265f}:null;}})['then'](respondWithResult(_0x57a6ee,null))[_0x4eb5('0x42')](handleError(_0x57a6ee,null));};exports[_0x4eb5('0x4e')]=function(_0x584534,_0x280d6b,_0x25d7f0){var _0x50984b={};var _0x13eb49={};var _0x31ccd9;var _0x256fba;return db['SalesforceConfiguration'][_0x4eb5('0x4a')]({'where':{'id':_0x584534[_0x4eb5('0x48')]['id']}})[_0x4eb5('0x23')](handleEntityNotFound(_0x280d6b,null))[_0x4eb5('0x23')](function(_0x1b7643){if(_0x1b7643){_0x31ccd9=_0x1b7643;_0x13eb49['model']=_['keys'](db['SalesforceField'][_0x4eb5('0x43')]);_0x13eb49[_0x4eb5('0x2f')]=_[_0x4eb5('0x30')](_0x584534['query']);_0x13eb49['filters']=_[_0x4eb5('0x32')](_0x13eb49[_0x4eb5('0x2e')],_0x13eb49[_0x4eb5('0x2f')]);_0x50984b[_0x4eb5('0x31')]=_['intersection'](_0x13eb49[_0x4eb5('0x2e')],qs[_0x4eb5('0x33')](_0x584534[_0x4eb5('0x2f')]['fields']));_0x50984b[_0x4eb5('0x31')]=_0x50984b[_0x4eb5('0x31')][_0x4eb5('0x34')]?_0x50984b['attributes']:_0x13eb49[_0x4eb5('0x2e')];_0x50984b[_0x4eb5('0x37')]=qs[_0x4eb5('0x38')](_0x584534[_0x4eb5('0x2f')][_0x4eb5('0x38')]);_0x50984b[_0x4eb5('0x3a')]=qs[_0x4eb5('0x39')](_[_0x4eb5('0x4c')](_0x584534[_0x4eb5('0x2f')],_0x13eb49[_0x4eb5('0x39')]));if(_0x584534[_0x4eb5('0x2f')]['filter']){_0x50984b['where']=_[_0x4eb5('0x44')](_0x50984b['where'],{'$or':_['map'](_0x50984b[_0x4eb5('0x31')],function(_0x5c9245){var _0x10c787={};_0x10c787[_0x5c9245]={'$like':'%'+_0x584534[_0x4eb5('0x2f')][_0x4eb5('0x3c')]+'%'};return _0x10c787;})});}_0x50984b=_['merge']({},_0x50984b,_0x584534[_0x4eb5('0x3d')]);return _0x31ccd9[_0x4eb5('0x4e')](_0x50984b);}})[_0x4eb5('0x23')](function(_0x2df16a){if(_0x2df16a){_0x256fba=_0x2df16a[_0x4eb5('0x34')];if(!_0x584534['query'][_0x4eb5('0x35')](_0x4eb5('0x36'))){_0x50984b[_0x4eb5('0x1c')]=qs[_0x4eb5('0x1c')](_0x584534[_0x4eb5('0x2f')][_0x4eb5('0x1c')]);_0x50984b['offset']=qs[_0x4eb5('0x1a')](_0x584534[_0x4eb5('0x2f')][_0x4eb5('0x1a')]);}return _0x31ccd9[_0x4eb5('0x4e')](_0x50984b);}})['then'](function(_0x50d857){if(_0x50d857){return _0x50d857?{'count':_0x256fba,'rows':_0x50d857}:null;}})['then'](respondWithResult(_0x280d6b,null))['catch'](handleError(_0x280d6b,null));}; \ No newline at end of file +var _0x1500=['params','SalesforceField','getFields','getSubjects','findOne','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body'];(function(_0x5ce30f,_0x5270de){var _0x10cd96=function(_0x3afafc){while(--_0x3afafc){_0x5ce30f['push'](_0x5ce30f['shift']());}};_0x10cd96(++_0x5270de);}(_0x1500,0x191));var _0x0150=function(_0x3fc236,_0x289c29){_0x3fc236=_0x3fc236-0x0;var _0x1eaf00=_0x1500[_0x3fc236];return _0x1eaf00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0150('0x0'));var zipdir=require(_0x0150('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0150('0x2'));var moment=require(_0x0150('0x3'));var BPromise=require(_0x0150('0x4'));var Mustache=require('mustache');var util=require(_0x0150('0x5'));var path=require('path');var sox=require(_0x0150('0x6'));var csv=require(_0x0150('0x7'));var ejs=require(_0x0150('0x8'));var fs=require('fs');var fs_extra=require(_0x0150('0x9'));var _=require(_0x0150('0xa'));var squel=require(_0x0150('0xb'));var crypto=require(_0x0150('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0150('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0150('0xe'));var authService=require(_0x0150('0xf'));var qs=require(_0x0150('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0150('0x11'));var utils=require(_0x0150('0x12'));var config=require(_0x0150('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0150('0x14'))['db'];function respondWithStatusCode(_0x517ac5,_0x83b814){_0x83b814=_0x83b814||0xcc;return function(_0x45f301){if(_0x45f301){return _0x517ac5['sendStatus'](_0x83b814);}return _0x517ac5[_0x0150('0x15')](_0x83b814)['end']();};}function respondWithResult(_0x54420c,_0x34bcc8){_0x34bcc8=_0x34bcc8||0xc8;return function(_0x3b1b7b){if(_0x3b1b7b){return _0x54420c['status'](_0x34bcc8)[_0x0150('0x16')](_0x3b1b7b);}};}function respondWithFilteredResult(_0x721012,_0x10b3eb){return function(_0x559faa){if(_0x559faa){var _0x546b03=typeof _0x10b3eb[_0x0150('0x17')]===_0x0150('0x18')&&typeof _0x10b3eb['limit']==='undefined';var _0x202019=_0x559faa[_0x0150('0x19')];var _0x3e671=_0x546b03?0x0:_0x10b3eb['offset'];var _0x1bd2e9=_0x546b03?_0x559faa[_0x0150('0x19')]:_0x10b3eb[_0x0150('0x17')]+_0x10b3eb[_0x0150('0x1a')];var _0xb56d93;if(_0x1bd2e9>=_0x202019){_0x1bd2e9=_0x202019;_0xb56d93=0xc8;}else{_0xb56d93=0xce;}_0x721012[_0x0150('0x15')](_0xb56d93);return _0x721012[_0x0150('0x1b')](_0x0150('0x1c'),_0x3e671+'-'+_0x1bd2e9+'/'+_0x202019)[_0x0150('0x16')](_0x559faa);}return null;};}function patchUpdates(_0x1b84da){return function(_0x124a5f){try{jsonpatch[_0x0150('0x1d')](_0x124a5f,_0x1b84da,!![]);}catch(_0x1916fe){return BPromise[_0x0150('0x1e')](_0x1916fe);}return _0x124a5f[_0x0150('0x1f')]();};}function saveUpdates(_0x308b8a,_0x544bad){return function(_0x21598e){if(_0x21598e){return _0x21598e[_0x0150('0x20')](_0x308b8a)[_0x0150('0x21')](function(_0xf719b4){return _0xf719b4;});}return null;};}function removeEntity(_0x4175b7,_0xd30058){return function(_0x599e3a){if(_0x599e3a){return _0x599e3a['destroy']()[_0x0150('0x21')](function(){_0x4175b7[_0x0150('0x15')](0xcc)[_0x0150('0x22')]();});}};}function handleEntityNotFound(_0x5bcd22,_0x20c448){return function(_0x12ac65){if(!_0x12ac65){_0x5bcd22[_0x0150('0x23')](0x194);}return _0x12ac65;};}function handleError(_0x51c429,_0x228c71){_0x228c71=_0x228c71||0x1f4;return function(_0x1d1b3e){logger[_0x0150('0x24')](_0x1d1b3e[_0x0150('0x25')]);if(_0x1d1b3e[_0x0150('0x26')]){delete _0x1d1b3e[_0x0150('0x26')];}_0x51c429[_0x0150('0x15')](_0x228c71)[_0x0150('0x27')](_0x1d1b3e);};}exports[_0x0150('0x28')]=function(_0x34faa3,_0x50a965){var _0x36fb57={},_0x191d41={},_0x4bb59e={'count':0x0,'rows':[]};var _0x32769a=_[_0x0150('0x29')](db[_0x0150('0x2a')][_0x0150('0x2b')],function(_0x2c3cec){return{'name':_0x2c3cec[_0x0150('0x2c')],'type':_0x2c3cec['type']['key']};});_0x191d41['model']=_[_0x0150('0x29')](_0x32769a,_0x0150('0x26'));_0x191d41[_0x0150('0x2d')]=_[_0x0150('0x2e')](_0x34faa3[_0x0150('0x2d')]);_0x191d41[_0x0150('0x2f')]=_[_0x0150('0x30')](_0x191d41['model'],_0x191d41[_0x0150('0x2d')]);_0x36fb57['attributes']=_['intersection'](_0x191d41[_0x0150('0x31')],qs[_0x0150('0x32')](_0x34faa3['query'][_0x0150('0x32')]));_0x36fb57['attributes']=_0x36fb57['attributes'][_0x0150('0x33')]?_0x36fb57[_0x0150('0x34')]:_0x191d41[_0x0150('0x31')];if(!_0x34faa3[_0x0150('0x2d')][_0x0150('0x35')](_0x0150('0x36'))){_0x36fb57[_0x0150('0x1a')]=qs[_0x0150('0x1a')](_0x34faa3[_0x0150('0x2d')]['limit']);_0x36fb57[_0x0150('0x17')]=qs[_0x0150('0x17')](_0x34faa3['query']['offset']);}_0x36fb57[_0x0150('0x37')]=qs[_0x0150('0x38')](_0x34faa3[_0x0150('0x2d')][_0x0150('0x38')]);_0x36fb57[_0x0150('0x39')]=qs['filters'](_[_0x0150('0x3a')](_0x34faa3[_0x0150('0x2d')],_0x191d41[_0x0150('0x2f')]),_0x32769a);if(_0x34faa3[_0x0150('0x2d')][_0x0150('0x3b')]){_0x36fb57['where']=_[_0x0150('0x3c')](_0x36fb57[_0x0150('0x39')],{'$or':_['map'](_0x32769a,function(_0x56813e){if(_0x56813e[_0x0150('0x3d')]!==_0x0150('0x3e')){var _0x56eb64={};_0x56eb64[_0x56813e[_0x0150('0x26')]]={'$like':'%'+_0x34faa3[_0x0150('0x2d')][_0x0150('0x3b')]+'%'};return _0x56eb64;}})});}_0x36fb57=_[_0x0150('0x3c')]({},_0x36fb57,_0x34faa3['options']);var _0x3290a2={'where':_0x36fb57[_0x0150('0x39')]};return db['SalesforceConfiguration'][_0x0150('0x19')](_0x3290a2)[_0x0150('0x21')](function(_0x15c8be){_0x4bb59e[_0x0150('0x19')]=_0x15c8be;if(_0x34faa3[_0x0150('0x2d')][_0x0150('0x3f')]){_0x36fb57[_0x0150('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x0150('0x41')](_0x36fb57);})[_0x0150('0x21')](function(_0x5b3506){_0x4bb59e[_0x0150('0x42')]=_0x5b3506;return _0x4bb59e;})['then'](respondWithFilteredResult(_0x50a965,_0x36fb57))[_0x0150('0x43')](handleError(_0x50a965,null));};exports[_0x0150('0x44')]=function(_0x29e2eb,_0x43da70){var _0x352d30={'raw':![],'where':{'id':_0x29e2eb['params']['id']}},_0x26314f={};_0x26314f['model']=_['keys'](db[_0x0150('0x2a')][_0x0150('0x2b')]);_0x26314f['query']=_[_0x0150('0x2e')](_0x29e2eb[_0x0150('0x2d')]);_0x26314f['filters']=_[_0x0150('0x30')](_0x26314f[_0x0150('0x31')],_0x26314f[_0x0150('0x2d')]);_0x352d30['attributes']=_[_0x0150('0x30')](_0x26314f[_0x0150('0x31')],qs[_0x0150('0x32')](_0x29e2eb[_0x0150('0x2d')][_0x0150('0x32')]));_0x352d30[_0x0150('0x34')]=_0x352d30[_0x0150('0x34')][_0x0150('0x33')]?_0x352d30[_0x0150('0x34')]:_0x26314f['model'];if(_0x29e2eb[_0x0150('0x2d')][_0x0150('0x3f')]){_0x352d30['include']=[{'all':!![]}];}_0x352d30=_[_0x0150('0x3c')]({},_0x352d30,_0x29e2eb[_0x0150('0x45')]);return db[_0x0150('0x2a')][_0x0150('0x46')](_0x352d30)[_0x0150('0x21')](handleEntityNotFound(_0x43da70,null))[_0x0150('0x21')](respondWithResult(_0x43da70,null))[_0x0150('0x43')](handleError(_0x43da70,null));};exports[_0x0150('0x47')]=function(_0x2bffb0,_0x373de7){return db[_0x0150('0x2a')][_0x0150('0x47')](_0x2bffb0[_0x0150('0x48')],{})[_0x0150('0x21')](respondWithResult(_0x373de7,0xc9))[_0x0150('0x43')](handleError(_0x373de7,null));};exports[_0x0150('0x20')]=function(_0x31acc6,_0x369458){if(_0x31acc6[_0x0150('0x48')]['id']){delete _0x31acc6['body']['id'];}return db['SalesforceConfiguration'][_0x0150('0x46')]({'where':{'id':_0x31acc6[_0x0150('0x49')]['id']}})['then'](handleEntityNotFound(_0x369458,null))[_0x0150('0x21')](saveUpdates(_0x31acc6[_0x0150('0x48')],null))['then'](respondWithResult(_0x369458,null))['catch'](handleError(_0x369458,null));};exports['destroy']=function(_0x3b9aee,_0x5ee814){return db['SalesforceConfiguration'][_0x0150('0x46')]({'where':{'id':_0x3b9aee[_0x0150('0x49')]['id']}})[_0x0150('0x21')](handleEntityNotFound(_0x5ee814,null))[_0x0150('0x21')](removeEntity(_0x5ee814,null))[_0x0150('0x43')](handleError(_0x5ee814,null));};exports['getFields']=function(_0x337669,_0x88a4c2,_0x2ac651){var _0x219633={};var _0x298951={};var _0x55d709;var _0x36b68e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x337669[_0x0150('0x49')]['id']}})['then'](handleEntityNotFound(_0x88a4c2,null))[_0x0150('0x21')](function(_0x279ac7){if(_0x279ac7){_0x55d709=_0x279ac7;_0x298951[_0x0150('0x31')]=_[_0x0150('0x2e')](db[_0x0150('0x4a')]['rawAttributes']);_0x298951['query']=_[_0x0150('0x2e')](_0x337669['query']);_0x298951[_0x0150('0x2f')]=_[_0x0150('0x30')](_0x298951[_0x0150('0x31')],_0x298951[_0x0150('0x2d')]);_0x219633[_0x0150('0x34')]=_[_0x0150('0x30')](_0x298951[_0x0150('0x31')],qs[_0x0150('0x32')](_0x337669[_0x0150('0x2d')][_0x0150('0x32')]));_0x219633[_0x0150('0x34')]=_0x219633[_0x0150('0x34')]['length']?_0x219633['attributes']:_0x298951[_0x0150('0x31')];_0x219633[_0x0150('0x37')]=qs[_0x0150('0x38')](_0x337669[_0x0150('0x2d')][_0x0150('0x38')]);_0x219633[_0x0150('0x39')]=qs[_0x0150('0x2f')](_[_0x0150('0x3a')](_0x337669[_0x0150('0x2d')],_0x298951[_0x0150('0x2f')]));if(_0x337669[_0x0150('0x2d')][_0x0150('0x3b')]){_0x219633[_0x0150('0x39')]=_['merge'](_0x219633[_0x0150('0x39')],{'$or':_[_0x0150('0x29')](_0x219633[_0x0150('0x34')],function(_0x3d61e6){var _0x473c10={};_0x473c10[_0x3d61e6]={'$like':'%'+_0x337669[_0x0150('0x2d')][_0x0150('0x3b')]+'%'};return _0x473c10;})});}_0x219633=_[_0x0150('0x3c')]({},_0x219633,_0x337669[_0x0150('0x45')]);return _0x55d709[_0x0150('0x4b')](_0x219633);}})['then'](function(_0x2f1c49){if(_0x2f1c49){_0x36b68e=_0x2f1c49[_0x0150('0x33')];if(!_0x337669[_0x0150('0x2d')]['hasOwnProperty'](_0x0150('0x36'))){_0x219633[_0x0150('0x1a')]=qs[_0x0150('0x1a')](_0x337669[_0x0150('0x2d')]['limit']);_0x219633[_0x0150('0x17')]=qs['offset'](_0x337669[_0x0150('0x2d')][_0x0150('0x17')]);}return _0x55d709[_0x0150('0x4b')](_0x219633);}})[_0x0150('0x21')](function(_0x5c206f){if(_0x5c206f){return _0x5c206f?{'count':_0x36b68e,'rows':_0x5c206f}:null;}})[_0x0150('0x21')](respondWithResult(_0x88a4c2,null))[_0x0150('0x43')](handleError(_0x88a4c2,null));};exports[_0x0150('0x4c')]=function(_0x2dfcba,_0x286c45,_0x25c1d9){var _0x2ce847={};var _0x253bed={};var _0x257dac;var _0x2b31ae;return db[_0x0150('0x2a')][_0x0150('0x4d')]({'where':{'id':_0x2dfcba[_0x0150('0x49')]['id']}})['then'](handleEntityNotFound(_0x286c45,null))[_0x0150('0x21')](function(_0x2cf605){if(_0x2cf605){_0x257dac=_0x2cf605;_0x253bed['model']=_['keys'](db[_0x0150('0x4a')][_0x0150('0x2b')]);_0x253bed[_0x0150('0x2d')]=_[_0x0150('0x2e')](_0x2dfcba[_0x0150('0x2d')]);_0x253bed['filters']=_[_0x0150('0x30')](_0x253bed[_0x0150('0x31')],_0x253bed[_0x0150('0x2d')]);_0x2ce847['attributes']=_[_0x0150('0x30')](_0x253bed[_0x0150('0x31')],qs[_0x0150('0x32')](_0x2dfcba[_0x0150('0x2d')]['fields']));_0x2ce847[_0x0150('0x34')]=_0x2ce847[_0x0150('0x34')][_0x0150('0x33')]?_0x2ce847[_0x0150('0x34')]:_0x253bed['model'];_0x2ce847[_0x0150('0x37')]=qs['sort'](_0x2dfcba[_0x0150('0x2d')][_0x0150('0x38')]);_0x2ce847['where']=qs[_0x0150('0x2f')](_[_0x0150('0x3a')](_0x2dfcba['query'],_0x253bed[_0x0150('0x2f')]));if(_0x2dfcba[_0x0150('0x2d')][_0x0150('0x3b')]){_0x2ce847[_0x0150('0x39')]=_['merge'](_0x2ce847[_0x0150('0x39')],{'$or':_[_0x0150('0x29')](_0x2ce847[_0x0150('0x34')],function(_0x4de26e){var _0x1af968={};_0x1af968[_0x4de26e]={'$like':'%'+_0x2dfcba[_0x0150('0x2d')][_0x0150('0x3b')]+'%'};return _0x1af968;})});}_0x2ce847=_[_0x0150('0x3c')]({},_0x2ce847,_0x2dfcba[_0x0150('0x45')]);return _0x257dac[_0x0150('0x4c')](_0x2ce847);}})[_0x0150('0x21')](function(_0x4ac1b3){if(_0x4ac1b3){_0x2b31ae=_0x4ac1b3[_0x0150('0x33')];if(!_0x2dfcba[_0x0150('0x2d')][_0x0150('0x35')](_0x0150('0x36'))){_0x2ce847[_0x0150('0x1a')]=qs[_0x0150('0x1a')](_0x2dfcba['query']['limit']);_0x2ce847[_0x0150('0x17')]=qs[_0x0150('0x17')](_0x2dfcba[_0x0150('0x2d')][_0x0150('0x17')]);}return _0x257dac[_0x0150('0x4c')](_0x2ce847);}})[_0x0150('0x21')](function(_0x280ac7){if(_0x280ac7){return _0x280ac7?{'count':_0x2b31ae,'rows':_0x280ac7}:null;}})[_0x0150('0x21')](respondWithResult(_0x286c45,null))[_0x0150('0x43')](handleError(_0x286c45,null));};exports[_0x0150('0x4e')]=function(_0x3e02dd,_0x3a4f8e,_0x241c56){var _0x36c5bf={};var _0x3557c1={};var _0x375455;var _0x60d60b;return db[_0x0150('0x2a')][_0x0150('0x4d')]({'where':{'id':_0x3e02dd[_0x0150('0x49')]['id']}})[_0x0150('0x21')](handleEntityNotFound(_0x3a4f8e,null))[_0x0150('0x21')](function(_0x5480df){if(_0x5480df){_0x375455=_0x5480df;_0x3557c1[_0x0150('0x31')]=_[_0x0150('0x2e')](db[_0x0150('0x4a')][_0x0150('0x2b')]);_0x3557c1[_0x0150('0x2d')]=_['keys'](_0x3e02dd['query']);_0x3557c1[_0x0150('0x2f')]=_[_0x0150('0x30')](_0x3557c1[_0x0150('0x31')],_0x3557c1[_0x0150('0x2d')]);_0x36c5bf[_0x0150('0x34')]=_['intersection'](_0x3557c1[_0x0150('0x31')],qs['fields'](_0x3e02dd[_0x0150('0x2d')]['fields']));_0x36c5bf[_0x0150('0x34')]=_0x36c5bf[_0x0150('0x34')][_0x0150('0x33')]?_0x36c5bf[_0x0150('0x34')]:_0x3557c1['model'];_0x36c5bf['order']=qs[_0x0150('0x38')](_0x3e02dd[_0x0150('0x2d')][_0x0150('0x38')]);_0x36c5bf[_0x0150('0x39')]=qs[_0x0150('0x2f')](_[_0x0150('0x3a')](_0x3e02dd[_0x0150('0x2d')],_0x3557c1[_0x0150('0x2f')]));if(_0x3e02dd[_0x0150('0x2d')][_0x0150('0x3b')]){_0x36c5bf[_0x0150('0x39')]=_[_0x0150('0x3c')](_0x36c5bf[_0x0150('0x39')],{'$or':_[_0x0150('0x29')](_0x36c5bf[_0x0150('0x34')],function(_0x1fbcac){var _0x29aa8e={};_0x29aa8e[_0x1fbcac]={'$like':'%'+_0x3e02dd['query'][_0x0150('0x3b')]+'%'};return _0x29aa8e;})});}_0x36c5bf=_[_0x0150('0x3c')]({},_0x36c5bf,_0x3e02dd['options']);return _0x375455[_0x0150('0x4e')](_0x36c5bf);}})[_0x0150('0x21')](function(_0x310de6){if(_0x310de6){_0x60d60b=_0x310de6[_0x0150('0x33')];if(!_0x3e02dd['query'][_0x0150('0x35')](_0x0150('0x36'))){_0x36c5bf[_0x0150('0x1a')]=qs[_0x0150('0x1a')](_0x3e02dd[_0x0150('0x2d')][_0x0150('0x1a')]);_0x36c5bf[_0x0150('0x17')]=qs[_0x0150('0x17')](_0x3e02dd[_0x0150('0x2d')][_0x0150('0x17')]);}return _0x375455['getDescriptions'](_0x36c5bf);}})['then'](function(_0x528657){if(_0x528657){return _0x528657?{'count':_0x60d60b,'rows':_0x528657}:null;}})[_0x0150('0x21')](respondWithResult(_0x3a4f8e,null))[_0x0150('0x43')](handleError(_0x3a4f8e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 8070f87..3b7939c 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 _0x4e17=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x646327,_0x4f0479){var _0x5056b9=function(_0xa14a47){while(--_0xa14a47){_0x646327['push'](_0x646327['shift']());}};_0x5056b9(++_0x4f0479);}(_0x4e17,0x143));var _0x74e1=function(_0x53ea61,_0x59fb22){_0x53ea61=_0x53ea61-0x0;var _0x327c50=_0x4e17[_0x53ea61];return _0x327c50;};'use strict';var _=require(_0x74e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x74e1('0x1'));var moment=require(_0x74e1('0x2'));var BPromise=require('bluebird');var rp=require(_0x74e1('0x3'));var fs=require('fs');var path=require(_0x74e1('0x4'));var rimraf=require(_0x74e1('0x5'));var config=require(_0x74e1('0x6'));var attributes=require(_0x74e1('0x7'));module[_0x74e1('0x8')]=function(_0x4a338e,_0x1e0e2f){return _0x4a338e[_0x74e1('0x9')](_0x74e1('0xa'),attributes,{'tableName':_0x74e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92c4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x274494,_0x17feb1){var _0x494063=function(_0x858ce7){while(--_0x858ce7){_0x274494['push'](_0x274494['shift']());}};_0x494063(++_0x17feb1);}(_0x92c4,0x178));var _0x492c=function(_0xc65f3f,_0x3ac9cc){_0xc65f3f=_0xc65f3f-0x0;var _0x3f44f7=_0x92c4[_0xc65f3f];return _0x3f44f7;};'use strict';var _=require(_0x492c('0x0'));var util=require(_0x492c('0x1'));var logger=require(_0x492c('0x2'))(_0x492c('0x3'));var moment=require(_0x492c('0x4'));var BPromise=require(_0x492c('0x5'));var rp=require(_0x492c('0x6'));var fs=require('fs');var path=require(_0x492c('0x7'));var rimraf=require(_0x492c('0x8'));var config=require(_0x492c('0x9'));var attributes=require(_0x492c('0xa'));module[_0x492c('0xb')]=function(_0x57d58b,_0x2a3593){return _0x57d58b['define'](_0x492c('0xc'),attributes,{'tableName':_0x492c('0xd'),'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 c5dadaf..f50a101 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 _0x097e=['code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xad22ed,_0x310a50){var _0x17689f=function(_0x5902ea){while(--_0x5902ea){_0xad22ed['push'](_0xad22ed['shift']());}};_0x17689f(++_0x310a50);}(_0x097e,0x119));var _0xe097=function(_0x2faaad,_0x5e13f7){_0x2faaad=_0x2faaad-0x0;var _0x58e14f=_0x097e[_0x2faaad];return _0x58e14f;};'use strict';var _=require('lodash');var util=require(_0xe097('0x0'));var moment=require('moment');var BPromise=require(_0xe097('0x1'));var rs=require(_0xe097('0x2'));var fs=require('fs');var Redis=require(_0xe097('0x3'));var db=require(_0xe097('0x4'))['db'];var utils=require(_0xe097('0x5'));var logger=require('../../config/logger')(_0xe097('0x6'));var config=require(_0xe097('0x7'));var jayson=require(_0xe097('0x8'));var client=jayson[_0xe097('0x9')][_0xe097('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11062b,_0x1662b1,_0x44f5d9){return new BPromise(function(_0x5186f7,_0x5a5d21){return client[_0xe097('0xb')](_0x11062b,_0x44f5d9)[_0xe097('0xc')](function(_0x27835){logger[_0xe097('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1662b1,_0xe097('0xe'));logger[_0xe097('0xf')](_0xe097('0x10'),_0x1662b1,_0xe097('0xe'),JSON['stringify'](_0x27835));if(_0x27835['error']){if(_0x27835[_0xe097('0x11')][_0xe097('0x12')]===0x1f4){logger['error'](_0xe097('0x13'),_0x1662b1,_0x27835[_0xe097('0x11')]['message']);return _0x5a5d21(_0x27835[_0xe097('0x11')][_0xe097('0x14')]);}logger[_0xe097('0x11')](_0xe097('0x13'),_0x1662b1,_0x27835['error'][_0xe097('0x14')]);return _0x5186f7(_0x27835[_0xe097('0x11')]['message']);}else{logger['info'](_0xe097('0x13'),_0x1662b1,_0xe097('0xe'));_0x5186f7(_0x27835[_0xe097('0x15')][_0xe097('0x14')]);}})[_0xe097('0x16')](function(_0x1010c3){logger[_0xe097('0x11')](_0xe097('0x13'),_0x1662b1,_0x1010c3);_0x5a5d21(_0x1010c3);});});} \ No newline at end of file +var _0x953b=['jayson/promise','client','request','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4b487e,_0x261a22){var _0x56c156=function(_0x3b6374){while(--_0x3b6374){_0x4b487e['push'](_0x4b487e['shift']());}};_0x56c156(++_0x261a22);}(_0x953b,0x11d));var _0xb953=function(_0x2d192e,_0x1ff7c9){_0x2d192e=_0x2d192e-0x0;var _0x1d046e=_0x953b[_0x2d192e];return _0x1d046e;};'use strict';var _=require('lodash');var util=require(_0xb953('0x0'));var moment=require(_0xb953('0x1'));var BPromise=require(_0xb953('0x2'));var rs=require(_0xb953('0x3'));var fs=require('fs');var Redis=require(_0xb953('0x4'));var db=require(_0xb953('0x5'))['db'];var utils=require(_0xb953('0x6'));var logger=require(_0xb953('0x7'))('rpc');var config=require(_0xb953('0x8'));var jayson=require(_0xb953('0x9'));var client=jayson[_0xb953('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39574f,_0x8bda9,_0x202ec1){return new BPromise(function(_0x433d7d,_0x457708){return client[_0xb953('0xb')](_0x39574f,_0x202ec1)['then'](function(_0x3dec6c){logger[_0xb953('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8bda9,_0xb953('0xd'));logger[_0xb953('0xe')](_0xb953('0xf'),_0x8bda9,_0xb953('0xd'),JSON['stringify'](_0x3dec6c));if(_0x3dec6c[_0xb953('0x10')]){if(_0x3dec6c[_0xb953('0x10')][_0xb953('0x11')]===0x1f4){logger[_0xb953('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8bda9,_0x3dec6c['error'][_0xb953('0x12')]);return _0x457708(_0x3dec6c[_0xb953('0x10')][_0xb953('0x12')]);}logger[_0xb953('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8bda9,_0x3dec6c['error'][_0xb953('0x12')]);return _0x433d7d(_0x3dec6c['error'][_0xb953('0x12')]);}else{logger[_0xb953('0xc')](_0xb953('0x13'),_0x8bda9,_0xb953('0xd'));_0x433d7d(_0x3dec6c[_0xb953('0x14')]['message']);}})['catch'](function(_0x17a0e8){logger[_0xb953('0x10')](_0xb953('0x13'),_0x8bda9,_0x17a0e8);_0x457708(_0x17a0e8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 6144346..f603dfc 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 _0x4bf2=['fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2363a8,_0x280ab6){var _0x5333cb=function(_0x58c6a3){while(--_0x58c6a3){_0x2363a8['push'](_0x2363a8['shift']());}};_0x5333cb(++_0x280ab6);}(_0x4bf2,0xae));var _0x24bf=function(_0x2ed4b3,_0x413430){_0x2ed4b3=_0x2ed4b3-0x0;var _0x16b3f0=_0x4bf2[_0x2ed4b3];return _0x16b3f0;};'use strict';var multer=require(_0x24bf('0x0'));var util=require(_0x24bf('0x1'));var path=require(_0x24bf('0x2'));var timeout=require(_0x24bf('0x3'));var express=require(_0x24bf('0x4'));var router=express[_0x24bf('0x5')]();var fs_extra=require(_0x24bf('0x6'));var auth=require(_0x24bf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x24bf('0x8'));var controller=require(_0x24bf('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x24bf('0xa')]);router['get'](_0x24bf('0xb'),auth['isAuthenticated'](),controller[_0x24bf('0xc')]);router[_0x24bf('0xd')]('/',auth[_0x24bf('0xe')](),controller['create']);router[_0x24bf('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x24bf('0x10')]);router[_0x24bf('0x11')](_0x24bf('0xb'),auth[_0x24bf('0xe')](),controller[_0x24bf('0x12')]);module[_0x24bf('0x13')]=router; \ No newline at end of file +var _0xf5f1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','post','create'];(function(_0x3afece,_0x112b15){var _0x1dcdc2=function(_0x513a2c){while(--_0x513a2c){_0x3afece['push'](_0x3afece['shift']());}};_0x1dcdc2(++_0x112b15);}(_0xf5f1,0x181));var _0x1f5f=function(_0x10a261,_0x1c1289){_0x10a261=_0x10a261-0x0;var _0x574dd0=_0xf5f1[_0x10a261];return _0x574dd0;};'use strict';var multer=require(_0x1f5f('0x0'));var util=require(_0x1f5f('0x1'));var path=require(_0x1f5f('0x2'));var timeout=require(_0x1f5f('0x3'));var express=require(_0x1f5f('0x4'));var router=express[_0x1f5f('0x5')]();var fs_extra=require(_0x1f5f('0x6'));var auth=require(_0x1f5f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1f5f('0x8'));var controller=require('./intSalesforceField.controller');router[_0x1f5f('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f5f('0xa')]);router[_0x1f5f('0x9')](_0x1f5f('0xb'),auth[_0x1f5f('0xc')](),controller['show']);router[_0x1f5f('0xd')]('/',auth['isAuthenticated'](),controller[_0x1f5f('0xe')]);router[_0x1f5f('0xf')]('/:id',auth[_0x1f5f('0xc')](),controller[_0x1f5f('0x10')]);router[_0x1f5f('0x11')](_0x1f5f('0xb'),auth[_0x1f5f('0xc')](),controller[_0x1f5f('0x12')]);module[_0x1f5f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7c4ca47..8a7af0d 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 _0x6d9a=['variable','customVariable','STRING','exports','ENUM','string'];(function(_0x479135,_0xc23d55){var _0x56e696=function(_0x37f73d){while(--_0x37f73d){_0x479135['push'](_0x479135['shift']());}};_0x56e696(++_0xc23d55);}(_0x6d9a,0xb1));var _0xa6d9=function(_0xbebee4,_0xb46f6a){_0xbebee4=_0xbebee4-0x0;var _0x4bbb2d=_0x6d9a[_0xbebee4];return _0x4bbb2d;};'use strict';var Sequelize=require('sequelize');module[_0xa6d9('0x0')]={'type':{'type':Sequelize[_0xa6d9('0x1')](_0xa6d9('0x2'),_0xa6d9('0x3'),_0xa6d9('0x4'),'keyValue','picklist'),'defaultValue':_0xa6d9('0x2')},'content':{'type':Sequelize[_0xa6d9('0x5')]},'key':{'type':Sequelize[_0xa6d9('0x5')]},'keyType':{'type':Sequelize[_0xa6d9('0x1')](_0xa6d9('0x2'),_0xa6d9('0x3'),_0xa6d9('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa6d9('0x5')]},'variableName':{'type':Sequelize[_0xa6d9('0x5')]}}; \ No newline at end of file +var _0x983a=['ENUM','STRING','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x3f42d9,_0x1620d9){var _0x79f628=function(_0x4aabf1){while(--_0x4aabf1){_0x3f42d9['push'](_0x3f42d9['shift']());}};_0x79f628(++_0x1620d9);}(_0x983a,0x146));var _0xa983=function(_0x4f93d4,_0x2a1b36){_0x4f93d4=_0x4f93d4-0x0;var _0x5f4fa0=_0x983a[_0x4f93d4];return _0x5f4fa0;};'use strict';var Sequelize=require(_0xa983('0x0'));module[_0xa983('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa983('0x2'),_0xa983('0x3'),_0xa983('0x4'),_0xa983('0x5'),_0xa983('0x6')),'defaultValue':_0xa983('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa983('0x7')](_0xa983('0x2'),'variable',_0xa983('0x4'))},'keyContent':{'type':Sequelize[_0xa983('0x8')]},'idField':{'type':Sequelize[_0xa983('0x8')]},'variableName':{'type':Sequelize[_0xa983('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f8d516d..95ae707 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 _0x2ddf=['fields','attributes','length','hasOwnProperty','nolimit','limit','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceField','fieldName','keys','query','filters','model','intersection'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0x2ddf,0xa8));var _0xf2dd=function(_0x4d9596,_0x3e347b){_0x4d9596=_0x4d9596-0x0;var _0x58dd56=_0x2ddf[_0x4d9596];return _0x58dd56;};'use strict';var emlformat=require(_0xf2dd('0x0'));var rimraf=require(_0xf2dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2dd('0x2'));var rp=require(_0xf2dd('0x3'));var moment=require(_0xf2dd('0x4'));var BPromise=require(_0xf2dd('0x5'));var Mustache=require(_0xf2dd('0x6'));var util=require(_0xf2dd('0x7'));var path=require(_0xf2dd('0x8'));var sox=require(_0xf2dd('0x9'));var csv=require(_0xf2dd('0xa'));var ejs=require(_0xf2dd('0xb'));var fs=require('fs');var fs_extra=require(_0xf2dd('0xc'));var _=require(_0xf2dd('0xd'));var squel=require(_0xf2dd('0xe'));var crypto=require('crypto');var jsforce=require(_0xf2dd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf2dd('0xa'));var querystring=require('querystring');var Papa=require(_0xf2dd('0x10'));var Redis=require('ioredis');var authService=require(_0xf2dd('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2dd('0x12'))(_0xf2dd('0x13'));var utils=require(_0xf2dd('0x14'));var config=require(_0xf2dd('0x15'));var licenseUtil=require(_0xf2dd('0x16'));var db=require(_0xf2dd('0x17'))['db'];function respondWithStatusCode(_0x20f0e3,_0x1bfec8){_0x1bfec8=_0x1bfec8||0xcc;return function(_0x3a97a3){if(_0x3a97a3){return _0x20f0e3[_0xf2dd('0x18')](_0x1bfec8);}return _0x20f0e3[_0xf2dd('0x19')](_0x1bfec8)[_0xf2dd('0x1a')]();};}function respondWithResult(_0x156e1d,_0x5c135b){_0x5c135b=_0x5c135b||0xc8;return function(_0x259ead){if(_0x259ead){return _0x156e1d['status'](_0x5c135b)[_0xf2dd('0x1b')](_0x259ead);}};}function respondWithFilteredResult(_0x42deda,_0x8853fa){return function(_0x491f90){if(_0x491f90){var _0x12e95a=typeof _0x8853fa[_0xf2dd('0x1c')]===_0xf2dd('0x1d')&&typeof _0x8853fa['limit']===_0xf2dd('0x1d');var _0x5556f4=_0x491f90[_0xf2dd('0x1e')];var _0x563269=_0x12e95a?0x0:_0x8853fa[_0xf2dd('0x1c')];var _0x614329=_0x12e95a?_0x491f90[_0xf2dd('0x1e')]:_0x8853fa['offset']+_0x8853fa['limit'];var _0x9a1c6d;if(_0x614329>=_0x5556f4){_0x614329=_0x5556f4;_0x9a1c6d=0xc8;}else{_0x9a1c6d=0xce;}_0x42deda[_0xf2dd('0x19')](_0x9a1c6d);return _0x42deda[_0xf2dd('0x1f')](_0xf2dd('0x20'),_0x563269+'-'+_0x614329+'/'+_0x5556f4)[_0xf2dd('0x1b')](_0x491f90);}return null;};}function patchUpdates(_0x3fe600){return function(_0x3f2770){try{jsonpatch[_0xf2dd('0x21')](_0x3f2770,_0x3fe600,!![]);}catch(_0x2799ed){return BPromise[_0xf2dd('0x22')](_0x2799ed);}return _0x3f2770[_0xf2dd('0x23')]();};}function saveUpdates(_0x33de24,_0x295a6e){return function(_0x210d18){if(_0x210d18){return _0x210d18[_0xf2dd('0x24')](_0x33de24)[_0xf2dd('0x25')](function(_0x5b87e3){return _0x5b87e3;});}return null;};}function removeEntity(_0x58ab52,_0x5924fb){return function(_0x2adef9){if(_0x2adef9){return _0x2adef9[_0xf2dd('0x26')]()[_0xf2dd('0x25')](function(){_0x58ab52[_0xf2dd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5dd2,_0x12e9e5){return function(_0x47a428){if(!_0x47a428){_0x2a5dd2[_0xf2dd('0x18')](0x194);}return _0x47a428;};}function handleError(_0x483478,_0x46241){_0x46241=_0x46241||0x1f4;return function(_0x1877f5){logger[_0xf2dd('0x27')](_0x1877f5[_0xf2dd('0x28')]);if(_0x1877f5[_0xf2dd('0x29')]){delete _0x1877f5[_0xf2dd('0x29')];}_0x483478[_0xf2dd('0x19')](_0x46241)['send'](_0x1877f5);};}exports[_0xf2dd('0x2a')]=function(_0x1a1976,_0x3291b2){var _0x3f32c1={},_0x36e1d3={},_0x1699dc={'count':0x0,'rows':[]};var _0x282794=_[_0xf2dd('0x2b')](db[_0xf2dd('0x2c')]['rawAttributes'],function(_0x1552db){return{'name':_0x1552db[_0xf2dd('0x2d')],'type':_0x1552db['type']['key']};});_0x36e1d3['model']=_[_0xf2dd('0x2b')](_0x282794,_0xf2dd('0x29'));_0x36e1d3['query']=_[_0xf2dd('0x2e')](_0x1a1976[_0xf2dd('0x2f')]);_0x36e1d3[_0xf2dd('0x30')]=_['intersection'](_0x36e1d3[_0xf2dd('0x31')],_0x36e1d3[_0xf2dd('0x2f')]);_0x3f32c1['attributes']=_[_0xf2dd('0x32')](_0x36e1d3['model'],qs[_0xf2dd('0x33')](_0x1a1976[_0xf2dd('0x2f')]['fields']));_0x3f32c1['attributes']=_0x3f32c1[_0xf2dd('0x34')][_0xf2dd('0x35')]?_0x3f32c1[_0xf2dd('0x34')]:_0x36e1d3[_0xf2dd('0x31')];if(!_0x1a1976[_0xf2dd('0x2f')][_0xf2dd('0x36')](_0xf2dd('0x37'))){_0x3f32c1[_0xf2dd('0x38')]=qs[_0xf2dd('0x38')](_0x1a1976['query']['limit']);_0x3f32c1[_0xf2dd('0x1c')]=qs['offset'](_0x1a1976[_0xf2dd('0x2f')][_0xf2dd('0x1c')]);}_0x3f32c1['order']=qs['sort'](_0x1a1976['query']['sort']);_0x3f32c1[_0xf2dd('0x39')]=qs[_0xf2dd('0x30')](_['pick'](_0x1a1976[_0xf2dd('0x2f')],_0x36e1d3[_0xf2dd('0x30')]),_0x282794);if(_0x1a1976[_0xf2dd('0x2f')][_0xf2dd('0x3a')]){_0x3f32c1[_0xf2dd('0x39')]=_[_0xf2dd('0x3b')](_0x3f32c1[_0xf2dd('0x39')],{'$or':_[_0xf2dd('0x2b')](_0x282794,function(_0x54538e){if(_0x54538e[_0xf2dd('0x3c')]!==_0xf2dd('0x3d')){var _0x4f2550={};_0x4f2550[_0x54538e['name']]={'$like':'%'+_0x1a1976[_0xf2dd('0x2f')][_0xf2dd('0x3a')]+'%'};return _0x4f2550;}})});}_0x3f32c1=_['merge']({},_0x3f32c1,_0x1a1976[_0xf2dd('0x3e')]);var _0x329a31={'where':_0x3f32c1[_0xf2dd('0x39')]};return db['SalesforceField'][_0xf2dd('0x1e')](_0x329a31)[_0xf2dd('0x25')](function(_0x4a0a2b){_0x1699dc[_0xf2dd('0x1e')]=_0x4a0a2b;if(_0x1a1976[_0xf2dd('0x2f')][_0xf2dd('0x3f')]){_0x3f32c1['include']=[{'all':!![]}];}return db[_0xf2dd('0x2c')][_0xf2dd('0x40')](_0x3f32c1);})[_0xf2dd('0x25')](function(_0x2d732c){_0x1699dc[_0xf2dd('0x41')]=_0x2d732c;return _0x1699dc;})[_0xf2dd('0x25')](respondWithFilteredResult(_0x3291b2,_0x3f32c1))[_0xf2dd('0x42')](handleError(_0x3291b2,null));};exports[_0xf2dd('0x43')]=function(_0x2eb095,_0x558649){var _0x3b86d3={'raw':!![],'where':{'id':_0x2eb095[_0xf2dd('0x44')]['id']}},_0x3405d8={};_0x3405d8[_0xf2dd('0x31')]=_[_0xf2dd('0x2e')](db['SalesforceField'][_0xf2dd('0x45')]);_0x3405d8['query']=_[_0xf2dd('0x2e')](_0x2eb095[_0xf2dd('0x2f')]);_0x3405d8[_0xf2dd('0x30')]=_[_0xf2dd('0x32')](_0x3405d8['model'],_0x3405d8['query']);_0x3b86d3[_0xf2dd('0x34')]=_['intersection'](_0x3405d8[_0xf2dd('0x31')],qs[_0xf2dd('0x33')](_0x2eb095['query']['fields']));_0x3b86d3['attributes']=_0x3b86d3[_0xf2dd('0x34')]['length']?_0x3b86d3[_0xf2dd('0x34')]:_0x3405d8[_0xf2dd('0x31')];if(_0x2eb095[_0xf2dd('0x2f')][_0xf2dd('0x3f')]){_0x3b86d3['include']=[{'all':!![]}];}_0x3b86d3=_[_0xf2dd('0x3b')]({},_0x3b86d3,_0x2eb095[_0xf2dd('0x3e')]);return db[_0xf2dd('0x2c')][_0xf2dd('0x46')](_0x3b86d3)[_0xf2dd('0x25')](handleEntityNotFound(_0x558649,null))[_0xf2dd('0x25')](respondWithResult(_0x558649,null))[_0xf2dd('0x42')](handleError(_0x558649,null));};exports[_0xf2dd('0x47')]=function(_0x1eb0bf,_0x528aca){return db[_0xf2dd('0x2c')][_0xf2dd('0x47')](_0x1eb0bf[_0xf2dd('0x48')],{})[_0xf2dd('0x25')](respondWithResult(_0x528aca,0xc9))['catch'](handleError(_0x528aca,null));};exports['update']=function(_0x16cc17,_0x73c38){if(_0x16cc17[_0xf2dd('0x48')]['id']){delete _0x16cc17[_0xf2dd('0x48')]['id'];}return db['SalesforceField'][_0xf2dd('0x46')]({'where':{'id':_0x16cc17[_0xf2dd('0x44')]['id']}})[_0xf2dd('0x25')](handleEntityNotFound(_0x73c38,null))[_0xf2dd('0x25')](saveUpdates(_0x16cc17['body'],null))['then'](respondWithResult(_0x73c38,null))['catch'](handleError(_0x73c38,null));};exports[_0xf2dd('0x26')]=function(_0x4577cd,_0x492bb7){return db[_0xf2dd('0x2c')][_0xf2dd('0x46')]({'where':{'id':_0x4577cd[_0xf2dd('0x44')]['id']}})[_0xf2dd('0x25')](handleEntityNotFound(_0x492bb7,null))[_0xf2dd('0x25')](removeEntity(_0x492bb7,null))[_0xf2dd('0x42')](handleError(_0x492bb7,null));}; \ No newline at end of file +var _0x5f8c=['end','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','SalesforceField','findAll','rows','catch','show','params','intersection','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then'];(function(_0x69389f,_0x2e8d04){var _0x31d36e=function(_0x4a8744){while(--_0x4a8744){_0x69389f['push'](_0x69389f['shift']());}};_0x31d36e(++_0x2e8d04);}(_0x5f8c,0x108));var _0xc5f8=function(_0x3bb966,_0x12f2ce){_0x3bb966=_0x3bb966-0x0;var _0xa1257d=_0x5f8c[_0x3bb966];return _0xa1257d;};'use strict';var emlformat=require(_0xc5f8('0x0'));var rimraf=require(_0xc5f8('0x1'));var zipdir=require(_0xc5f8('0x2'));var jsonpatch=require(_0xc5f8('0x3'));var rp=require(_0xc5f8('0x4'));var moment=require('moment');var BPromise=require(_0xc5f8('0x5'));var Mustache=require(_0xc5f8('0x6'));var util=require(_0xc5f8('0x7'));var path=require(_0xc5f8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5f8('0x9'));var _=require(_0xc5f8('0xa'));var squel=require(_0xc5f8('0xb'));var crypto=require(_0xc5f8('0xc'));var jsforce=require(_0xc5f8('0xd'));var deskjs=require(_0xc5f8('0xe'));var toCsv=require(_0xc5f8('0xf'));var querystring=require(_0xc5f8('0x10'));var Papa=require('papaparse');var Redis=require(_0xc5f8('0x11'));var authService=require(_0xc5f8('0x12'));var qs=require(_0xc5f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5f8('0x14'));var logger=require(_0xc5f8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc5f8('0x16'));var licenseUtil=require(_0xc5f8('0x17'));var db=require(_0xc5f8('0x18'))['db'];function respondWithStatusCode(_0x287c72,_0x4bca2d){_0x4bca2d=_0x4bca2d||0xcc;return function(_0x7972d1){if(_0x7972d1){return _0x287c72[_0xc5f8('0x19')](_0x4bca2d);}return _0x287c72[_0xc5f8('0x1a')](_0x4bca2d)['end']();};}function respondWithResult(_0x4f698e,_0x7e2240){_0x7e2240=_0x7e2240||0xc8;return function(_0xf055a1){if(_0xf055a1){return _0x4f698e[_0xc5f8('0x1a')](_0x7e2240)[_0xc5f8('0x1b')](_0xf055a1);}};}function respondWithFilteredResult(_0x180a8e,_0x2aff1c){return function(_0x27b480){if(_0x27b480){var _0x48b1a7=typeof _0x2aff1c[_0xc5f8('0x1c')]===_0xc5f8('0x1d')&&typeof _0x2aff1c[_0xc5f8('0x1e')]===_0xc5f8('0x1d');var _0x1532af=_0x27b480[_0xc5f8('0x1f')];var _0x37bb54=_0x48b1a7?0x0:_0x2aff1c['offset'];var _0x4f2452=_0x48b1a7?_0x27b480['count']:_0x2aff1c[_0xc5f8('0x1c')]+_0x2aff1c[_0xc5f8('0x1e')];var _0x3cc3f0;if(_0x4f2452>=_0x1532af){_0x4f2452=_0x1532af;_0x3cc3f0=0xc8;}else{_0x3cc3f0=0xce;}_0x180a8e[_0xc5f8('0x1a')](_0x3cc3f0);return _0x180a8e['set']('Content-Range',_0x37bb54+'-'+_0x4f2452+'/'+_0x1532af)[_0xc5f8('0x1b')](_0x27b480);}return null;};}function patchUpdates(_0x1ef55c){return function(_0x3bfe61){try{jsonpatch[_0xc5f8('0x20')](_0x3bfe61,_0x1ef55c,!![]);}catch(_0x35b0c9){return BPromise['reject'](_0x35b0c9);}return _0x3bfe61[_0xc5f8('0x21')]();};}function saveUpdates(_0xedfc2f,_0x229784){return function(_0x4418a3){if(_0x4418a3){return _0x4418a3[_0xc5f8('0x22')](_0xedfc2f)[_0xc5f8('0x23')](function(_0x42aee4){return _0x42aee4;});}return null;};}function removeEntity(_0xffbe4f,_0x5ce659){return function(_0x180ba2){if(_0x180ba2){return _0x180ba2['destroy']()[_0xc5f8('0x23')](function(){_0xffbe4f[_0xc5f8('0x1a')](0xcc)[_0xc5f8('0x24')]();});}};}function handleEntityNotFound(_0x119d44,_0x30d582){return function(_0x4a62a6){if(!_0x4a62a6){_0x119d44[_0xc5f8('0x19')](0x194);}return _0x4a62a6;};}function handleError(_0x5b3632,_0x2e0b8a){_0x2e0b8a=_0x2e0b8a||0x1f4;return function(_0x53627d){logger[_0xc5f8('0x25')](_0x53627d[_0xc5f8('0x26')]);if(_0x53627d[_0xc5f8('0x27')]){delete _0x53627d[_0xc5f8('0x27')];}_0x5b3632[_0xc5f8('0x1a')](_0x2e0b8a)['send'](_0x53627d);};}exports[_0xc5f8('0x28')]=function(_0x670bb0,_0x48fdc0){var _0x21135a={},_0x6f5244={},_0x3c556a={'count':0x0,'rows':[]};var _0x4ea568=_['map'](db['SalesforceField'][_0xc5f8('0x29')],function(_0xc5137c){return{'name':_0xc5137c[_0xc5f8('0x2a')],'type':_0xc5137c['type'][_0xc5f8('0x2b')]};});_0x6f5244[_0xc5f8('0x2c')]=_[_0xc5f8('0x2d')](_0x4ea568,'name');_0x6f5244[_0xc5f8('0x2e')]=_[_0xc5f8('0x2f')](_0x670bb0[_0xc5f8('0x2e')]);_0x6f5244[_0xc5f8('0x30')]=_['intersection'](_0x6f5244[_0xc5f8('0x2c')],_0x6f5244[_0xc5f8('0x2e')]);_0x21135a[_0xc5f8('0x31')]=_['intersection'](_0x6f5244[_0xc5f8('0x2c')],qs['fields'](_0x670bb0[_0xc5f8('0x2e')][_0xc5f8('0x32')]));_0x21135a[_0xc5f8('0x31')]=_0x21135a['attributes'][_0xc5f8('0x33')]?_0x21135a['attributes']:_0x6f5244[_0xc5f8('0x2c')];if(!_0x670bb0[_0xc5f8('0x2e')][_0xc5f8('0x34')](_0xc5f8('0x35'))){_0x21135a[_0xc5f8('0x1e')]=qs[_0xc5f8('0x1e')](_0x670bb0[_0xc5f8('0x2e')]['limit']);_0x21135a[_0xc5f8('0x1c')]=qs['offset'](_0x670bb0['query'][_0xc5f8('0x1c')]);}_0x21135a[_0xc5f8('0x36')]=qs[_0xc5f8('0x37')](_0x670bb0[_0xc5f8('0x2e')]['sort']);_0x21135a[_0xc5f8('0x38')]=qs['filters'](_[_0xc5f8('0x39')](_0x670bb0[_0xc5f8('0x2e')],_0x6f5244[_0xc5f8('0x30')]),_0x4ea568);if(_0x670bb0['query'][_0xc5f8('0x3a')]){_0x21135a[_0xc5f8('0x38')]=_[_0xc5f8('0x3b')](_0x21135a['where'],{'$or':_['map'](_0x4ea568,function(_0x3fbba6){if(_0x3fbba6[_0xc5f8('0x3c')]!=='VIRTUAL'){var _0x18505d={};_0x18505d[_0x3fbba6[_0xc5f8('0x27')]]={'$like':'%'+_0x670bb0['query']['filter']+'%'};return _0x18505d;}})});}_0x21135a=_[_0xc5f8('0x3b')]({},_0x21135a,_0x670bb0[_0xc5f8('0x3d')]);var _0x2a3277={'where':_0x21135a['where']};return db['SalesforceField'][_0xc5f8('0x1f')](_0x2a3277)['then'](function(_0x3110f2){_0x3c556a[_0xc5f8('0x1f')]=_0x3110f2;if(_0x670bb0[_0xc5f8('0x2e')][_0xc5f8('0x3e')]){_0x21135a[_0xc5f8('0x3f')]=[{'all':!![]}];}return db[_0xc5f8('0x40')][_0xc5f8('0x41')](_0x21135a);})[_0xc5f8('0x23')](function(_0x35f4ad){_0x3c556a[_0xc5f8('0x42')]=_0x35f4ad;return _0x3c556a;})['then'](respondWithFilteredResult(_0x48fdc0,_0x21135a))[_0xc5f8('0x43')](handleError(_0x48fdc0,null));};exports[_0xc5f8('0x44')]=function(_0x444fd,_0x36eb49){var _0x1076be={'raw':!![],'where':{'id':_0x444fd[_0xc5f8('0x45')]['id']}},_0x12ae94={};_0x12ae94[_0xc5f8('0x2c')]=_[_0xc5f8('0x2f')](db['SalesforceField']['rawAttributes']);_0x12ae94['query']=_[_0xc5f8('0x2f')](_0x444fd[_0xc5f8('0x2e')]);_0x12ae94[_0xc5f8('0x30')]=_['intersection'](_0x12ae94[_0xc5f8('0x2c')],_0x12ae94[_0xc5f8('0x2e')]);_0x1076be[_0xc5f8('0x31')]=_[_0xc5f8('0x46')](_0x12ae94['model'],qs['fields'](_0x444fd[_0xc5f8('0x2e')][_0xc5f8('0x32')]));_0x1076be[_0xc5f8('0x31')]=_0x1076be['attributes']['length']?_0x1076be[_0xc5f8('0x31')]:_0x12ae94['model'];if(_0x444fd[_0xc5f8('0x2e')][_0xc5f8('0x3e')]){_0x1076be['include']=[{'all':!![]}];}_0x1076be=_[_0xc5f8('0x3b')]({},_0x1076be,_0x444fd[_0xc5f8('0x3d')]);return db['SalesforceField'][_0xc5f8('0x47')](_0x1076be)[_0xc5f8('0x23')](handleEntityNotFound(_0x36eb49,null))[_0xc5f8('0x23')](respondWithResult(_0x36eb49,null))[_0xc5f8('0x43')](handleError(_0x36eb49,null));};exports['create']=function(_0x37e833,_0x6c370b){return db[_0xc5f8('0x40')][_0xc5f8('0x48')](_0x37e833[_0xc5f8('0x49')],{})[_0xc5f8('0x23')](respondWithResult(_0x6c370b,0xc9))['catch'](handleError(_0x6c370b,null));};exports[_0xc5f8('0x22')]=function(_0x404e7e,_0x27e368){if(_0x404e7e[_0xc5f8('0x49')]['id']){delete _0x404e7e[_0xc5f8('0x49')]['id'];}return db[_0xc5f8('0x40')][_0xc5f8('0x47')]({'where':{'id':_0x404e7e[_0xc5f8('0x45')]['id']}})[_0xc5f8('0x23')](handleEntityNotFound(_0x27e368,null))[_0xc5f8('0x23')](saveUpdates(_0x404e7e['body'],null))[_0xc5f8('0x23')](respondWithResult(_0x27e368,null))['catch'](handleError(_0x27e368,null));};exports[_0xc5f8('0x4a')]=function(_0x576e69,_0x416bc8){return db[_0xc5f8('0x40')][_0xc5f8('0x47')]({'where':{'id':_0x576e69[_0xc5f8('0x45')]['id']}})['then'](handleEntityNotFound(_0x416bc8,null))['then'](removeEntity(_0x416bc8,null))[_0xc5f8('0x43')](handleError(_0x416bc8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 49fe042..152f4d3 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 _0x467c=['int_salesforce_fields','salesforce_unique_index','lodash','util','api','moment','bluebird','rimraf','./intSalesforceField.attributes','exports','SalesforceField'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x467c,0x1f1));var _0xc467=function(_0x43281a,_0x38b2db){_0x43281a=_0x43281a-0x0;var _0x1be8f0=_0x467c[_0x43281a];return _0x1be8f0;};'use strict';var _=require(_0xc467('0x0'));var util=require(_0xc467('0x1'));var logger=require('../../config/logger')(_0xc467('0x2'));var moment=require(_0xc467('0x3'));var BPromise=require(_0xc467('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc467('0x5'));var config=require('../../config/environment');var attributes=require(_0xc467('0x6'));module[_0xc467('0x7')]=function(_0x575a02,_0x470ecd){return _0x575a02['define'](_0xc467('0x8'),attributes,{'tableName':_0xc467('0x9'),'paranoid':![],'indexes':[{'name':_0xc467('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8cd6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8cd6,0xfe));var _0x68cd=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0x8cd6[_0x51d71a];return _0xff01f1;};'use strict';var _=require(_0x68cd('0x0'));var util=require(_0x68cd('0x1'));var logger=require(_0x68cd('0x2'))(_0x68cd('0x3'));var moment=require(_0x68cd('0x4'));var BPromise=require(_0x68cd('0x5'));var rp=require(_0x68cd('0x6'));var fs=require('fs');var path=require(_0x68cd('0x7'));var rimraf=require(_0x68cd('0x8'));var config=require(_0x68cd('0x9'));var attributes=require(_0x68cd('0xa'));module[_0x68cd('0xb')]=function(_0x20df32,_0x15fac4){return _0x20df32[_0x68cd('0xc')](_0x68cd('0xd'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x68cd('0xe'),'fields':[_0x68cd('0xf'),_0x68cd('0x10')],'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 70f4024..ad90a6e 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 _0xfb02=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x6523,_0x4de424){var _0x5a774b=function(_0x5a208a){while(--_0x5a208a){_0x6523['push'](_0x6523['shift']());}};_0x5a774b(++_0x4de424);}(_0xfb02,0x9d));var _0x2fb0=function(_0x190a13,_0x5315a3){_0x190a13=_0x190a13-0x0;var _0x3f9b79=_0xfb02[_0x190a13];return _0x3f9b79;};'use strict';var _=require(_0x2fb0('0x0'));var util=require(_0x2fb0('0x1'));var moment=require(_0x2fb0('0x2'));var BPromise=require(_0x2fb0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fb0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fb0('0x5'));var logger=require(_0x2fb0('0x6'))(_0x2fb0('0x7'));var config=require('../../config/environment');var jayson=require(_0x2fb0('0x8'));var client=jayson['client'][_0x2fb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cec99,_0x14e0a9,_0x3458ba){return new BPromise(function(_0x45204d,_0x2f31a2){return client['request'](_0x1cec99,_0x3458ba)[_0x2fb0('0xa')](function(_0x85e82e){logger[_0x2fb0('0xb')](_0x2fb0('0xc'),_0x14e0a9,_0x2fb0('0xd'));logger[_0x2fb0('0xe')](_0x2fb0('0xf'),_0x14e0a9,_0x2fb0('0xd'),JSON[_0x2fb0('0x10')](_0x85e82e));if(_0x85e82e[_0x2fb0('0x11')]){if(_0x85e82e['error'][_0x2fb0('0x12')]===0x1f4){logger[_0x2fb0('0x11')]('SalesforceField,\x20%s,\x20%s',_0x14e0a9,_0x85e82e[_0x2fb0('0x11')][_0x2fb0('0x13')]);return _0x2f31a2(_0x85e82e[_0x2fb0('0x11')][_0x2fb0('0x13')]);}logger[_0x2fb0('0x11')](_0x2fb0('0xc'),_0x14e0a9,_0x85e82e[_0x2fb0('0x11')][_0x2fb0('0x13')]);return _0x45204d(_0x85e82e[_0x2fb0('0x11')][_0x2fb0('0x13')]);}else{logger[_0x2fb0('0xb')](_0x2fb0('0xc'),_0x14e0a9,_0x2fb0('0xd'));_0x45204d(_0x85e82e['result'][_0x2fb0('0x13')]);}})['catch'](function(_0x58b1c7){logger[_0x2fb0('0x11')](_0x2fb0('0xc'),_0x14e0a9,_0x58b1c7);_0x2f31a2(_0x58b1c7);});});} \ No newline at end of file +var _0xa504=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3376b6,_0x3dde12){var _0xcb07c6=function(_0x20e5be){while(--_0x20e5be){_0x3376b6['push'](_0x3376b6['shift']());}};_0xcb07c6(++_0x3dde12);}(_0xa504,0x1c8));var _0x4a50=function(_0x2f6b28,_0x1d0c9f){_0x2f6b28=_0x2f6b28-0x0;var _0x228b0e=_0xa504[_0x2f6b28];return _0x228b0e;};'use strict';var _=require(_0x4a50('0x0'));var util=require(_0x4a50('0x1'));var moment=require(_0x4a50('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a50('0x3'));var fs=require('fs');var Redis=require(_0x4a50('0x4'));var db=require(_0x4a50('0x5'))['db'];var utils=require(_0x4a50('0x6'));var logger=require('../../config/logger')(_0x4a50('0x7'));var config=require(_0x4a50('0x8'));var jayson=require(_0x4a50('0x9'));var client=jayson[_0x4a50('0xa')][_0x4a50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8c1d,_0x17857f,_0x1ca32d){return new BPromise(function(_0x2f83bf,_0x1bc9dd){return client[_0x4a50('0xc')](_0x4c8c1d,_0x1ca32d)[_0x4a50('0xd')](function(_0x21916c){logger[_0x4a50('0xe')](_0x4a50('0xf'),_0x17857f,_0x4a50('0x10'));logger[_0x4a50('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x17857f,_0x4a50('0x10'),JSON[_0x4a50('0x12')](_0x21916c));if(_0x21916c['error']){if(_0x21916c['error']['code']===0x1f4){logger[_0x4a50('0x13')]('SalesforceField,\x20%s,\x20%s',_0x17857f,_0x21916c['error']['message']);return _0x1bc9dd(_0x21916c[_0x4a50('0x13')][_0x4a50('0x14')]);}logger[_0x4a50('0x13')]('SalesforceField,\x20%s,\x20%s',_0x17857f,_0x21916c['error'][_0x4a50('0x14')]);return _0x2f83bf(_0x21916c[_0x4a50('0x13')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x17857f,_0x4a50('0x10'));_0x2f83bf(_0x21916c['result'][_0x4a50('0x14')]);}})[_0x4a50('0x15')](function(_0x2372e9){logger[_0x4a50('0x13')](_0x4a50('0xf'),_0x17857f,_0x2372e9);_0x1bc9dd(_0x2372e9);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3074ac2..7a86957 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 _0xb544=['/:id/fields','getFields','post','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations'];(function(_0x46109e,_0x11a08e){var _0x115830=function(_0x4fddf6){while(--_0x4fddf6){_0x46109e['push'](_0x46109e['shift']());}};_0x115830(++_0x11a08e);}(_0xb544,0xd0));var _0x4b54=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xb544[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b54('0x0'));var timeout=require(_0x4b54('0x1'));var express=require(_0x4b54('0x2'));var router=express[_0x4b54('0x3')]();var fs_extra=require(_0x4b54('0x4'));var auth=require(_0x4b54('0x5'));var interaction=require(_0x4b54('0x6'));var config=require(_0x4b54('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b54('0x8')]('/:id',auth[_0x4b54('0x9')](),controller['show']);router[_0x4b54('0x8')](_0x4b54('0xa'),auth['isAuthenticated'](),controller[_0x4b54('0xb')]);router[_0x4b54('0x8')](_0x4b54('0xc'),auth[_0x4b54('0x9')](),controller[_0x4b54('0xd')]);router[_0x4b54('0xe')]('/',auth[_0x4b54('0x9')](),controller['create']);router[_0x4b54('0xe')](_0x4b54('0xa'),auth[_0x4b54('0x9')](),controller['addConfiguration']);router[_0x4b54('0xf')](_0x4b54('0x10'),auth['isAuthenticated'](),controller[_0x4b54('0x11')]);router[_0x4b54('0x12')]('/:id',auth[_0x4b54('0x9')](),controller[_0x4b54('0x13')]);module['exports']=router; \ No newline at end of file +var _0x88cc=['put','/:id','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration'];(function(_0x524c29,_0xa0b130){var _0x231dd3=function(_0xae9a88){while(--_0xae9a88){_0x524c29['push'](_0x524c29['shift']());}};_0x231dd3(++_0xa0b130);}(_0x88cc,0x1bd));var _0xc88c=function(_0x3bd497,_0x37d7a8){_0x3bd497=_0x3bd497-0x0;var _0x32f967=_0x88cc[_0x3bd497];return _0x32f967;};'use strict';var multer=require(_0xc88c('0x0'));var util=require(_0xc88c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc88c('0x2'));var router=express[_0xc88c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc88c('0x4'));var interaction=require(_0xc88c('0x5'));var config=require('../../config/environment');var controller=require(_0xc88c('0x6'));router[_0xc88c('0x7')]('/',auth['isAuthenticated'](),controller[_0xc88c('0x8')]);router[_0xc88c('0x7')]('/:id',auth[_0xc88c('0x9')](),controller[_0xc88c('0xa')]);router[_0xc88c('0x7')]('/:id/configurations',auth[_0xc88c('0x9')](),controller[_0xc88c('0xb')]);router[_0xc88c('0x7')](_0xc88c('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xc88c('0xd')]('/',auth[_0xc88c('0x9')](),controller[_0xc88c('0xe')]);router[_0xc88c('0xd')](_0xc88c('0xf'),auth[_0xc88c('0x9')](),controller[_0xc88c('0x10')]);router[_0xc88c('0x11')](_0xc88c('0x12'),auth['isAuthenticated'](),controller[_0xc88c('0x13')]);router['delete'](_0xc88c('0x12'),auth[_0xc88c('0x9')](),controller[_0xc88c('0x14')]);module[_0xc88c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0492945..1a801a2 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 _0x5490=['STRING','username','exports'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x5490,0x95));var _0x0549=function(_0x52739b,_0x1d8dc3){_0x52739b=_0x52739b-0x0;var _0x5e0c4f=_0x5490[_0x52739b];return _0x5e0c4f;};'use strict';var Sequelize=require('sequelize');module[_0x0549('0x0')]={'name':{'type':Sequelize[_0x0549('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0549('0x1')],'unique':_0x0549('0x2')},'password':{'type':Sequelize[_0x0549('0x1')]},'email':{'type':Sequelize[_0x0549('0x1')]},'remoteUri':{'type':Sequelize[_0x0549('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0549('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2099=['STRING','sequelize','exports'];(function(_0x32c434,_0x5c9346){var _0x3a7160=function(_0x2b3b9d){while(--_0x2b3b9d){_0x32c434['push'](_0x32c434['shift']());}};_0x3a7160(++_0x5c9346);}(_0x2099,0x12d));var _0x9209=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2099[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x9209('0x0'));module[_0x9209('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9209('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9209('0x2')]},'remoteUri':{'type':Sequelize[_0x9209('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 6bf0371..92bfbfc 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 _0x66fe=['create','body','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','caused_by','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','sys_created_on','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','approval','due_date','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','GET','incident?sysparm_display_value=all','result','log','assign','label','push','all','TCL:\x20_object','includes','forEach','internalType','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x66fe,0x1c6));var _0xe66f=function(_0x3929c1,_0x14dcda){_0x3929c1=_0x3929c1-0x0;var _0x5d885f=_0x66fe[_0x3929c1];return _0x5d885f;};'use strict';var emlformat=require(_0xe66f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe66f('0x1'));var rp=require(_0xe66f('0x2'));var moment=require(_0xe66f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe66f('0x4'));var util=require('util');var path=require(_0xe66f('0x5'));var sox=require(_0xe66f('0x6'));var csv=require(_0xe66f('0x7'));var ejs=require(_0xe66f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe66f('0x9'));var squel=require(_0xe66f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe66f('0xb'));var toCsv=require(_0xe66f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe66f('0xc'));var qs=require(_0xe66f('0xd'));var as=require(_0xe66f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe66f('0xf'));var licenseUtil=require(_0xe66f('0x10'));var db=require(_0xe66f('0x11'))['db'];var integrations=require(_0xe66f('0x12'));function respondWithStatusCode(_0x1e829a,_0x2755a9){_0x2755a9=_0x2755a9||0xcc;return function(_0xf7af00){if(_0xf7af00){return _0x1e829a[_0xe66f('0x13')](_0x2755a9);}return _0x1e829a[_0xe66f('0x14')](_0x2755a9)[_0xe66f('0x15')]();};}function respondWithResult(_0x3bc0d6,_0x2d3409){_0x2d3409=_0x2d3409||0xc8;return function(_0x5572f8){if(_0x5572f8){return _0x3bc0d6[_0xe66f('0x14')](_0x2d3409)[_0xe66f('0x16')](_0x5572f8);}};}function respondWithFilteredResult(_0x4a382a,_0x22d3d1){return function(_0x4a7c1a){if(_0x4a7c1a){var _0x1d9530=typeof _0x22d3d1['offset']==='undefined'&&typeof _0x22d3d1[_0xe66f('0x17')]===_0xe66f('0x18');var _0x36c084=_0x4a7c1a[_0xe66f('0x19')];var _0x663b04=_0x1d9530?0x0:_0x22d3d1[_0xe66f('0x1a')];var _0x2826d2=_0x1d9530?_0x4a7c1a[_0xe66f('0x19')]:_0x22d3d1[_0xe66f('0x1a')]+_0x22d3d1[_0xe66f('0x17')];var _0x130cc7;if(_0x2826d2>=_0x36c084){_0x2826d2=_0x36c084;_0x130cc7=0xc8;}else{_0x130cc7=0xce;}_0x4a382a[_0xe66f('0x14')](_0x130cc7);return _0x4a382a[_0xe66f('0x1b')](_0xe66f('0x1c'),_0x663b04+'-'+_0x2826d2+'/'+_0x36c084)[_0xe66f('0x16')](_0x4a7c1a);}return null;};}function patchUpdates(_0x4d7d93){return function(_0x274110){try{jsonpatch[_0xe66f('0x1d')](_0x274110,_0x4d7d93,!![]);}catch(_0x5775af){return BPromise[_0xe66f('0x1e')](_0x5775af);}return _0x274110[_0xe66f('0x1f')]();};}function saveUpdates(_0x148692,_0x105245){return function(_0x9c7ee0){if(_0x9c7ee0){return _0x9c7ee0[_0xe66f('0x20')](_0x148692)[_0xe66f('0x21')](function(_0x179d71){return _0x179d71;});}return null;};}function removeEntity(_0x37b0ae,_0x194816){return function(_0x5c39cd){if(_0x5c39cd){return _0x5c39cd['destroy']()[_0xe66f('0x21')](function(){_0x37b0ae[_0xe66f('0x14')](0xcc)[_0xe66f('0x15')]();});}};}function handleEntityNotFound(_0x47efa1,_0x1efaa1){return function(_0xf4c422){if(!_0xf4c422){_0x47efa1[_0xe66f('0x13')](0x194);}return _0xf4c422;};}function handleError(_0x25e36c,_0x8b5f53){_0x8b5f53=_0x8b5f53||0x1f4;return function(_0xae6153){logger[_0xe66f('0x22')](_0xae6153[_0xe66f('0x23')]);if(_0xae6153[_0xe66f('0x24')]){delete _0xae6153['name'];}_0x25e36c[_0xe66f('0x14')](_0x8b5f53)[_0xe66f('0x25')](_0xae6153);};}exports[_0xe66f('0x26')]=function(_0x16a054,_0x56fd29){var _0x499698={},_0x4bba2c={},_0x564dbb={'count':0x0,'rows':[]};var _0x2a3542=_[_0xe66f('0x27')](db[_0xe66f('0x28')][_0xe66f('0x29')],function(_0x28f620){return{'name':_0x28f620['fieldName'],'type':_0x28f620[_0xe66f('0x2a')][_0xe66f('0x2b')]};});_0x4bba2c['model']=_[_0xe66f('0x27')](_0x2a3542,_0xe66f('0x24'));_0x4bba2c[_0xe66f('0x2c')]=_[_0xe66f('0x2d')](_0x16a054['query']);_0x4bba2c[_0xe66f('0x2e')]=_[_0xe66f('0x2f')](_0x4bba2c[_0xe66f('0x30')],_0x4bba2c[_0xe66f('0x2c')]);_0x499698[_0xe66f('0x31')]=_[_0xe66f('0x2f')](_0x4bba2c[_0xe66f('0x30')],qs[_0xe66f('0x32')](_0x16a054[_0xe66f('0x2c')][_0xe66f('0x32')]));_0x499698[_0xe66f('0x31')]=_0x499698[_0xe66f('0x31')][_0xe66f('0x33')]?_0x499698['attributes']:_0x4bba2c[_0xe66f('0x30')];if(!_0x16a054['query']['hasOwnProperty']('nolimit')){_0x499698[_0xe66f('0x17')]=qs['limit'](_0x16a054[_0xe66f('0x2c')][_0xe66f('0x17')]);_0x499698[_0xe66f('0x1a')]=qs[_0xe66f('0x1a')](_0x16a054['query'][_0xe66f('0x1a')]);}_0x499698[_0xe66f('0x34')]=qs[_0xe66f('0x35')](_0x16a054[_0xe66f('0x2c')][_0xe66f('0x35')]);_0x499698[_0xe66f('0x36')]=qs[_0xe66f('0x2e')](_[_0xe66f('0x37')](_0x16a054[_0xe66f('0x2c')],_0x4bba2c['filters']),_0x2a3542);if(_0x16a054[_0xe66f('0x2c')]['filter']){_0x499698[_0xe66f('0x36')]=_['merge'](_0x499698[_0xe66f('0x36')],{'$or':_[_0xe66f('0x27')](_0x2a3542,function(_0x1a2dcf){if(_0x1a2dcf[_0xe66f('0x2a')]!==_0xe66f('0x38')){var _0x5bb80e={};_0x5bb80e[_0x1a2dcf['name']]={'$like':'%'+_0x16a054[_0xe66f('0x2c')][_0xe66f('0x39')]+'%'};return _0x5bb80e;}})});}_0x499698=_[_0xe66f('0x3a')]({},_0x499698,_0x16a054[_0xe66f('0x3b')]);var _0x34bd1c={'where':_0x499698[_0xe66f('0x36')]};return db['ServicenowAccount'][_0xe66f('0x19')](_0x34bd1c)['then'](function(_0x2a9fcc){_0x564dbb[_0xe66f('0x19')]=_0x2a9fcc;if(_0x16a054[_0xe66f('0x2c')][_0xe66f('0x3c')]){_0x499698['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xe66f('0x3d')](_0x499698);})[_0xe66f('0x21')](function(_0x4c333c){_0x564dbb[_0xe66f('0x3e')]=_0x4c333c;return _0x564dbb;})[_0xe66f('0x21')](respondWithFilteredResult(_0x56fd29,_0x499698))['catch'](handleError(_0x56fd29,null));};exports[_0xe66f('0x3f')]=function(_0x56251e,_0x9d1db4){var _0x2b3db8={'raw':![],'where':{'id':_0x56251e[_0xe66f('0x40')]['id']}},_0x4f7ae3={};_0x4f7ae3[_0xe66f('0x30')]=_[_0xe66f('0x2d')](db[_0xe66f('0x28')][_0xe66f('0x29')]);_0x4f7ae3[_0xe66f('0x2c')]=_['keys'](_0x56251e[_0xe66f('0x2c')]);_0x4f7ae3[_0xe66f('0x2e')]=_[_0xe66f('0x2f')](_0x4f7ae3['model'],_0x4f7ae3[_0xe66f('0x2c')]);_0x2b3db8[_0xe66f('0x31')]=_[_0xe66f('0x2f')](_0x4f7ae3[_0xe66f('0x30')],qs[_0xe66f('0x32')](_0x56251e[_0xe66f('0x2c')][_0xe66f('0x32')]));_0x2b3db8['attributes']=_0x2b3db8[_0xe66f('0x31')][_0xe66f('0x33')]?_0x2b3db8['attributes']:_0x4f7ae3['model'];if(_0x56251e[_0xe66f('0x2c')][_0xe66f('0x3c')]){_0x2b3db8[_0xe66f('0x41')]=[{'all':!![]}];}_0x2b3db8=_[_0xe66f('0x3a')]({},_0x2b3db8,_0x56251e[_0xe66f('0x3b')]);return db[_0xe66f('0x28')][_0xe66f('0x42')](_0x2b3db8)[_0xe66f('0x21')](handleEntityNotFound(_0x9d1db4,null))[_0xe66f('0x21')](respondWithResult(_0x9d1db4,null))[_0xe66f('0x43')](handleError(_0x9d1db4,null));};exports[_0xe66f('0x44')]=function(_0x6cc1e5,_0x4445e5){return db[_0xe66f('0x28')]['create'](_0x6cc1e5[_0xe66f('0x45')],{})[_0xe66f('0x21')](respondWithResult(_0x4445e5,0xc9))[_0xe66f('0x43')](handleError(_0x4445e5,null));};exports[_0xe66f('0x20')]=function(_0x1e8d0d,_0x5bcc10){if(_0x1e8d0d[_0xe66f('0x45')]['id']){delete _0x1e8d0d['body']['id'];}return db[_0xe66f('0x28')][_0xe66f('0x42')]({'where':{'id':_0x1e8d0d[_0xe66f('0x40')]['id']}})[_0xe66f('0x21')](handleEntityNotFound(_0x5bcc10,null))[_0xe66f('0x21')](saveUpdates(_0x1e8d0d['body'],null))[_0xe66f('0x21')](respondWithResult(_0x5bcc10,null))['catch'](handleError(_0x5bcc10,null));};exports['destroy']=function(_0x226800,_0x28eb40){return db[_0xe66f('0x28')][_0xe66f('0x42')]({'where':{'id':_0x226800[_0xe66f('0x40')]['id']}})[_0xe66f('0x21')](handleEntityNotFound(_0x28eb40,null))['then'](removeEntity(_0x28eb40,null))[_0xe66f('0x43')](handleError(_0x28eb40,null));};exports[_0xe66f('0x46')]=function(_0x5857ca,_0x333ae8,_0x34855d){var _0x3c4bcc={};var _0x1cbc7a={};var _0x26ccff;var _0x35828f;return db['ServicenowAccount'][_0xe66f('0x47')]({'where':{'id':_0x5857ca['params']['id']}})[_0xe66f('0x21')](handleEntityNotFound(_0x333ae8,null))[_0xe66f('0x21')](function(_0x4d9d75){if(_0x4d9d75){_0x26ccff=_0x4d9d75;_0x1cbc7a['model']=_[_0xe66f('0x2d')](db[_0xe66f('0x48')][_0xe66f('0x29')]);_0x1cbc7a[_0xe66f('0x2c')]=_[_0xe66f('0x2d')](_0x5857ca['query']);_0x1cbc7a['filters']=_[_0xe66f('0x2f')](_0x1cbc7a[_0xe66f('0x30')],_0x1cbc7a['query']);_0x3c4bcc[_0xe66f('0x31')]=_[_0xe66f('0x2f')](_0x1cbc7a['model'],qs[_0xe66f('0x32')](_0x5857ca[_0xe66f('0x2c')]['fields']));_0x3c4bcc[_0xe66f('0x31')]=_0x3c4bcc[_0xe66f('0x31')][_0xe66f('0x33')]?_0x3c4bcc[_0xe66f('0x31')]:_0x1cbc7a[_0xe66f('0x30')];_0x3c4bcc['order']=qs[_0xe66f('0x35')](_0x5857ca['query'][_0xe66f('0x35')]);_0x3c4bcc[_0xe66f('0x36')]=qs['filters'](_[_0xe66f('0x37')](_0x5857ca[_0xe66f('0x2c')],_0x1cbc7a['filters']));if(_0x5857ca['query']['filter']){_0x3c4bcc[_0xe66f('0x36')]=_[_0xe66f('0x3a')](_0x3c4bcc['where'],{'$or':_[_0xe66f('0x27')](_0x3c4bcc[_0xe66f('0x31')],function(_0x3054a9){var _0x140388={};_0x140388[_0x3054a9]={'$like':'%'+_0x5857ca[_0xe66f('0x2c')][_0xe66f('0x39')]+'%'};return _0x140388;})});}_0x3c4bcc=_[_0xe66f('0x3a')]({},_0x3c4bcc,_0x5857ca['options']);return _0x26ccff['getConfigurations'](_0x3c4bcc);}})[_0xe66f('0x21')](function(_0x367994){if(_0x367994){_0x35828f=_0x367994[_0xe66f('0x33')];if(!_0x5857ca[_0xe66f('0x2c')][_0xe66f('0x49')](_0xe66f('0x4a'))){_0x3c4bcc['limit']=qs['limit'](_0x5857ca[_0xe66f('0x2c')]['limit']);_0x3c4bcc[_0xe66f('0x1a')]=qs[_0xe66f('0x1a')](_0x5857ca[_0xe66f('0x2c')][_0xe66f('0x1a')]);}return _0x26ccff[_0xe66f('0x46')](_0x3c4bcc);}})[_0xe66f('0x21')](function(_0x519c54){if(_0x519c54){return _0x519c54?{'count':_0x35828f,'rows':_0x519c54}:null;}})[_0xe66f('0x21')](respondWithResult(_0x333ae8,null))['catch'](handleError(_0x333ae8,null));};exports['addConfiguration']=function(_0x4c1c12,_0x43c051,_0x34a702){if(_0x4c1c12[_0xe66f('0x45')]['id']){delete _0x4c1c12['body']['id'];}return db['ServicenowAccount'][_0xe66f('0x47')]({'where':{'id':_0x4c1c12['params']['id']}})[_0xe66f('0x21')](handleEntityNotFound(_0x43c051,null))[_0xe66f('0x21')](function(_0x3c1d26){if(_0x3c1d26){_0x4c1c12['body'][_0xe66f('0x4b')]=_0x3c1d26['id'];_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x4c')]=integrations[_0xe66f('0x4d')](_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x4e')],_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x2a')]);_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x4f')]=integrations[_0xe66f('0x50')](_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x4e')],_0x4c1c12[_0xe66f('0x45')][_0xe66f('0x2a')]);return db[_0xe66f('0x48')][_0xe66f('0x44')](_0x4c1c12['body'],{'include':[{'model':db[_0xe66f('0x51')],'as':_0xe66f('0x4c')},{'model':db[_0xe66f('0x51')],'as':_0xe66f('0x4f')}]});}return null;})['then'](respondWithResult(_0x43c051,null))[_0xe66f('0x43')](handleError(_0x43c051,null));};exports[_0xe66f('0x52')]=function(_0x38a3f5,_0x23efe7,_0x583eda){var _0xcdb974=[_0xe66f('0x53'),_0xe66f('0x54'),_0xe66f('0x55'),_0xe66f('0x56'),_0xe66f('0x57'),_0xe66f('0x58'),_0xe66f('0x59'),'severity',_0xe66f('0x5a')];var _0x4446e6=['parent',_0xe66f('0x53'),_0xe66f('0x5b'),'watch_list',_0xe66f('0x5c'),'sys_updated_on',_0xe66f('0x5d'),_0xe66f('0x54'),_0xe66f('0x5e'),_0xe66f('0x5f'),_0xe66f('0x60'),_0xe66f('0x61'),'opened_by','user_input',_0xe66f('0x62'),'sys_domain','state','sys_created_by','knowledge',_0xe66f('0x34'),_0xe66f('0x63'),_0xe66f('0x64'),_0xe66f('0x65'),_0xe66f('0x66'),_0xe66f('0x67'),'active','work_notes_list',_0xe66f('0x68'),'priority',_0xe66f('0x69'),_0xe66f('0x6a'),_0xe66f('0x6b'),_0xe66f('0x6c'),_0xe66f('0x6d'),_0xe66f('0x6e'),'group_list',_0xe66f('0x6f'),_0xe66f('0x70'),_0xe66f('0x71'),_0xe66f('0x72'),'approval_set','subcategory',_0xe66f('0x73'),'short_description',_0xe66f('0x57'),_0xe66f('0x74'),_0xe66f('0x75'),_0xe66f('0x76'),_0xe66f('0x77'),_0xe66f('0x78'),_0xe66f('0x79'),'description',_0xe66f('0x7a'),_0xe66f('0x58'),_0xe66f('0x7b'),'close_notes','closed_by',_0xe66f('0x7c'),_0xe66f('0x7d'),_0xe66f('0x7e'),_0xe66f('0x7f'),_0xe66f('0x80'),_0xe66f('0x59'),'urgency',_0xe66f('0x81'),_0xe66f('0x82'),_0xe66f('0x83'),_0xe66f('0x84'),'assigned_to',_0xe66f('0x85'),_0xe66f('0x86'),_0xe66f('0x87'),_0xe66f('0x88'),'comments_and_work_notes',_0xe66f('0x89'),'sys_mod_count',_0xe66f('0x8a'),_0xe66f('0x8b'),_0xe66f('0x8c'),'upon_approval',_0xe66f('0x8d'),_0xe66f('0x8e'),_0xe66f('0x5a')];var _0x281031='';var _0x2a5f60='';var _0x21616a=[];var _0x8641ed='';var _0x3513a6='';var _0x251f65=[];var _0x330311='';var _0x47fa3a='';var _0xed6fcf={};var _0x7c5c2='';return db[_0xe66f('0x28')][_0xe66f('0x47')]({'where':{'id':_0x38a3f5[_0xe66f('0x40')]['id']},'attributes':['id',_0xe66f('0x8f'),_0xe66f('0x90'),_0xe66f('0x91'),_0xe66f('0x92'),_0xe66f('0x93')]})[_0xe66f('0x21')](handleEntityNotFound(_0x23efe7,null))[_0xe66f('0x21')](function(_0x1938ca){if(_0x1938ca){_0x7c5c2=_0x1938ca[_0xe66f('0x92')];var _0x5cfa77=_0x7c5c2[_0xe66f('0x94')](-0x1);if(_0x5cfa77==='/'){_0x7c5c2=_0x7c5c2[_0xe66f('0x95')](0x0,_0x7c5c2['lastIndexOf'](_0x5cfa77));}_0x47fa3a=util['format']('%s/api/now/doc/table/schema/',_0x7c5c2);_0x330311=util[_0xe66f('0x96')]('%s/api/now/table/',_0x7c5c2);_0xed6fcf={'user':_0x1938ca[_0xe66f('0x8f')],'pass':_0x1938ca[_0xe66f('0x90')]};var _0x29c08c={'method':_0xe66f('0x97'),'uri':_0x47fa3a+_0xe66f('0x98'),'auth':_0xed6fcf,'json':!![]};return rp(_0x29c08c);}})[_0xe66f('0x21')](function(_0x5851d3){if(_0x5851d3['result'][_0xe66f('0x33')]>0x0){_0x281031=_0x5851d3[_0xe66f('0x99')];}console[_0xe66f('0x9a')]('incident\x20table\x20objects',_0x281031);_0x251f65=[];_0x2a5f60=Object[_0xe66f('0x9b')]([],_0x281031);_['remove'](_0x2a5f60,function(_0x59c1dd){return!_0xcdb974['includes'](_0x59c1dd[_0xe66f('0x24')]);});_0x2a5f60['forEach'](function(_0x3fbad3){var _0x522453=createFieldObject(_0x330311,_0xed6fcf,_0x3fbad3['internalType'],_0x3fbad3[_0xe66f('0x24')],_0x3fbad3[_0xe66f('0x9c')],![]);_0x251f65[_0xe66f('0x9d')](_0x522453);});return Promise[_0xe66f('0x9e')](_0x251f65);})[_0xe66f('0x21')](function(_0x2da67b){_0x21616a=_0x2da67b;_0x8641ed=Object[_0xe66f('0x9b')]([],_0x281031);console[_0xe66f('0x9a')](_0xe66f('0x9f'),_0x281031);_['remove'](_0x8641ed,function(_0x2b6d71){return _0x4446e6[_0xe66f('0xa0')](_0x2b6d71['name']);});console[_0xe66f('0x9a')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x8641ed);_0x251f65=[];_0x8641ed[_0xe66f('0xa1')](function(_0x41f1bc){var _0x5a82f3=createFieldObject(_0x330311,_0xed6fcf,_0x41f1bc[_0xe66f('0xa2')],_0x41f1bc['name'],_0x41f1bc[_0xe66f('0x9c')],!![]);_0x251f65[_0xe66f('0x9d')](_0x5a82f3);});return Promise[_0xe66f('0x9e')](_0x251f65);})['then'](function(_0x2d8a56){_0x3513a6=_0x2d8a56;var _0x22ad20=_0x21616a[_0xe66f('0xa3')](_0x3513a6);return{'count':_0x22ad20['length'],'rows':_0x22ad20};})[_0xe66f('0x21')](respondWithResult(_0x23efe7,null))[_0xe66f('0x43')](function(_0x31ef4b){console[_0xe66f('0x9a')](_0xe66f('0xa4')+_0x31ef4b);var _0x1981c1=_0x38a3f5['query']['test']?0x1f4:_0x31ef4b['statusCode']||0x1f4;logger['error'](_0x31ef4b['stack']);delete _0x31ef4b[_0xe66f('0x24')];if(_0x1981c1===0x191){_0x1981c1=0x190;}_0x23efe7['status'](_0x1981c1)['send'](_0x38a3f5[_0xe66f('0x2c')][_0xe66f('0xa5')]?{'message':_0xe66f('0xa6'),'statusCode':_0x31ef4b[_0xe66f('0xa7')]}:_0x31ef4b);});};function createFieldObject(_0x3b2a15,_0x1255cf,_0x2df02c,_0xaef210,_0x4ffff7,_0x227891){return new Promise(function(_0x5fe8cb,_0x15f7df){var _0x33929e={'id':_0xaef210,'name':_0x4ffff7,'custom':_0x227891};if(_0x2df02c===_0xe66f('0xa8')){_0x33929e[_0xe66f('0x3b')]=[{'name':'True','value':_0xe66f('0xa9')},{'name':_0xe66f('0xaa'),'value':_0xe66f('0xab')}];_0x5fe8cb(_0x33929e);}else{var _0x5c52e3={'method':_0xe66f('0x97'),'uri':_0x3b2a15+_0xe66f('0xac')+_0xaef210,'auth':_0x1255cf,'json':!![]};return rp(_0x5c52e3)['then'](function(_0x56c502){var _0x51eaf5=[];if(_0x56c502[_0xe66f('0x99')][_0xe66f('0x33')]>0x0){_0x56c502[_0xe66f('0x99')][_0xe66f('0xa1')](function(_0x3ab3f3){if(_0x3ab3f3['inactive']===_0xe66f('0xab')){var _0x4d6166={'name':_0x3ab3f3[_0xe66f('0x9c')],'value':_0x3ab3f3[_0xe66f('0xad')]};_0x51eaf5[_0xe66f('0x9d')](_0x4d6166);}});}_0x33929e[_0xe66f('0x3b')]=_0x51eaf5;if(_0x33929e[_0xe66f('0x3b')][_0xe66f('0x33')]>0x0){_0x5fe8cb(_0x33929e);}else{if(_0x227891==![]){_0x5fe8cb();}else{_0x5fe8cb(_0x33929e);}}});}});} \ No newline at end of file +var _0x8351=['lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','push','all','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','count','limit','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','options','ServicenowAccount','includeAll','findAll','rows','include','merge','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','filter','nolimit','addConfiguration','AccountId','channel','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','resolved_at','approval_set','subcategory','work_notes','short_description','close_code','delivery_task','work_start','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','location','username','password','email','remoteUri','serverUrl','substring'];(function(_0x4930e1,_0x371759){var _0x4441a8=function(_0x42c187){while(--_0x42c187){_0x4930e1['push'](_0x4930e1['shift']());}};_0x4441a8(++_0x371759);}(_0x8351,0x185));var _0x1835=function(_0x2bf5f9,_0x2a6467){_0x2bf5f9=_0x2bf5f9-0x0;var _0x215f9c=_0x8351[_0x2bf5f9];return _0x215f9c;};'use strict';var emlformat=require(_0x1835('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1835('0x1'));var jsonpatch=require(_0x1835('0x2'));var rp=require(_0x1835('0x3'));var moment=require(_0x1835('0x4'));var BPromise=require(_0x1835('0x5'));var Mustache=require(_0x1835('0x6'));var util=require(_0x1835('0x7'));var path=require(_0x1835('0x8'));var sox=require(_0x1835('0x9'));var csv=require(_0x1835('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1835('0xb'));var _=require(_0x1835('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1835('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1835('0xa'));var querystring=require(_0x1835('0xe'));var Papa=require(_0x1835('0xf'));var Redis=require(_0x1835('0x10'));var authService=require(_0x1835('0x11'));var qs=require(_0x1835('0x12'));var as=require(_0x1835('0x13'));var hardwareService=require(_0x1835('0x14'));var logger=require(_0x1835('0x15'))(_0x1835('0x16'));var utils=require(_0x1835('0x17'));var config=require(_0x1835('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1835('0x19'))['db'];var integrations=require(_0x1835('0x1a'));function respondWithStatusCode(_0x241430,_0x1ce47d){_0x1ce47d=_0x1ce47d||0xcc;return function(_0x20dbe2){if(_0x20dbe2){return _0x241430[_0x1835('0x1b')](_0x1ce47d);}return _0x241430['status'](_0x1ce47d)['end']();};}function respondWithResult(_0x105b26,_0x4bcb9a){_0x4bcb9a=_0x4bcb9a||0xc8;return function(_0x5dfa9a){if(_0x5dfa9a){return _0x105b26[_0x1835('0x1c')](_0x4bcb9a)[_0x1835('0x1d')](_0x5dfa9a);}};}function respondWithFilteredResult(_0x457106,_0x31946e){return function(_0x3dbf47){if(_0x3dbf47){var _0x5cfbd9=typeof _0x31946e[_0x1835('0x1e')]==='undefined'&&typeof _0x31946e['limit']==='undefined';var _0x305fc9=_0x3dbf47[_0x1835('0x1f')];var _0xb6e12=_0x5cfbd9?0x0:_0x31946e[_0x1835('0x1e')];var _0x14d6f9=_0x5cfbd9?_0x3dbf47['count']:_0x31946e[_0x1835('0x1e')]+_0x31946e[_0x1835('0x20')];var _0x36838;if(_0x14d6f9>=_0x305fc9){_0x14d6f9=_0x305fc9;_0x36838=0xc8;}else{_0x36838=0xce;}_0x457106[_0x1835('0x1c')](_0x36838);return _0x457106['set'](_0x1835('0x21'),_0xb6e12+'-'+_0x14d6f9+'/'+_0x305fc9)['json'](_0x3dbf47);}return null;};}function patchUpdates(_0x435b2f){return function(_0x30e04e){try{jsonpatch['apply'](_0x30e04e,_0x435b2f,!![]);}catch(_0x5f1ff9){return BPromise['reject'](_0x5f1ff9);}return _0x30e04e[_0x1835('0x22')]();};}function saveUpdates(_0x336841,_0x525fab){return function(_0x475236){if(_0x475236){return _0x475236[_0x1835('0x23')](_0x336841)[_0x1835('0x24')](function(_0xaf1e9e){return _0xaf1e9e;});}return null;};}function removeEntity(_0x59dd54,_0x434b53){return function(_0x2cf889){if(_0x2cf889){return _0x2cf889[_0x1835('0x25')]()[_0x1835('0x24')](function(){_0x59dd54[_0x1835('0x1c')](0xcc)[_0x1835('0x26')]();});}};}function handleEntityNotFound(_0x5cefd0,_0x4c564d){return function(_0x306723){if(!_0x306723){_0x5cefd0[_0x1835('0x1b')](0x194);}return _0x306723;};}function handleError(_0x45d235,_0x536206){_0x536206=_0x536206||0x1f4;return function(_0x4d8148){logger[_0x1835('0x27')](_0x4d8148[_0x1835('0x28')]);if(_0x4d8148[_0x1835('0x29')]){delete _0x4d8148['name'];}_0x45d235[_0x1835('0x1c')](_0x536206)[_0x1835('0x2a')](_0x4d8148);};}exports[_0x1835('0x2b')]=function(_0xd647e5,_0x391e99){var _0x403c3f={},_0x25db78={},_0xa50e7d={'count':0x0,'rows':[]};var _0x158dda=_[_0x1835('0x2c')](db['ServicenowAccount']['rawAttributes'],function(_0x474959){return{'name':_0x474959[_0x1835('0x2d')],'type':_0x474959[_0x1835('0x2e')][_0x1835('0x2f')]};});_0x25db78[_0x1835('0x30')]=_[_0x1835('0x2c')](_0x158dda,'name');_0x25db78[_0x1835('0x31')]=_[_0x1835('0x32')](_0xd647e5[_0x1835('0x31')]);_0x25db78[_0x1835('0x33')]=_[_0x1835('0x34')](_0x25db78['model'],_0x25db78['query']);_0x403c3f[_0x1835('0x35')]=_[_0x1835('0x34')](_0x25db78['model'],qs[_0x1835('0x36')](_0xd647e5['query'][_0x1835('0x36')]));_0x403c3f[_0x1835('0x35')]=_0x403c3f[_0x1835('0x35')][_0x1835('0x37')]?_0x403c3f[_0x1835('0x35')]:_0x25db78[_0x1835('0x30')];if(!_0xd647e5[_0x1835('0x31')][_0x1835('0x38')]('nolimit')){_0x403c3f[_0x1835('0x20')]=qs[_0x1835('0x20')](_0xd647e5[_0x1835('0x31')][_0x1835('0x20')]);_0x403c3f[_0x1835('0x1e')]=qs[_0x1835('0x1e')](_0xd647e5[_0x1835('0x31')]['offset']);}_0x403c3f['order']=qs[_0x1835('0x39')](_0xd647e5[_0x1835('0x31')][_0x1835('0x39')]);_0x403c3f[_0x1835('0x3a')]=qs['filters'](_[_0x1835('0x3b')](_0xd647e5['query'],_0x25db78[_0x1835('0x33')]),_0x158dda);if(_0xd647e5['query']['filter']){_0x403c3f[_0x1835('0x3a')]=_['merge'](_0x403c3f[_0x1835('0x3a')],{'$or':_[_0x1835('0x2c')](_0x158dda,function(_0x3d3fab){if(_0x3d3fab['type']!=='VIRTUAL'){var _0x15a2e3={};_0x15a2e3[_0x3d3fab['name']]={'$like':'%'+_0xd647e5['query']['filter']+'%'};return _0x15a2e3;}})});}_0x403c3f=_['merge']({},_0x403c3f,_0xd647e5[_0x1835('0x3c')]);var _0x6f5500={'where':_0x403c3f[_0x1835('0x3a')]};return db[_0x1835('0x3d')][_0x1835('0x1f')](_0x6f5500)['then'](function(_0x1b3728){_0xa50e7d['count']=_0x1b3728;if(_0xd647e5[_0x1835('0x31')][_0x1835('0x3e')]){_0x403c3f['include']=[{'all':!![]}];}return db[_0x1835('0x3d')][_0x1835('0x3f')](_0x403c3f);})[_0x1835('0x24')](function(_0x865e10){_0xa50e7d[_0x1835('0x40')]=_0x865e10;return _0xa50e7d;})[_0x1835('0x24')](respondWithFilteredResult(_0x391e99,_0x403c3f))['catch'](handleError(_0x391e99,null));};exports['show']=function(_0x3e0929,_0x3cbac2){var _0x1b83b5={'raw':![],'where':{'id':_0x3e0929['params']['id']}},_0xcc8b3a={};_0xcc8b3a['model']=_['keys'](db[_0x1835('0x3d')]['rawAttributes']);_0xcc8b3a[_0x1835('0x31')]=_[_0x1835('0x32')](_0x3e0929[_0x1835('0x31')]);_0xcc8b3a['filters']=_[_0x1835('0x34')](_0xcc8b3a['model'],_0xcc8b3a['query']);_0x1b83b5[_0x1835('0x35')]=_[_0x1835('0x34')](_0xcc8b3a[_0x1835('0x30')],qs[_0x1835('0x36')](_0x3e0929[_0x1835('0x31')][_0x1835('0x36')]));_0x1b83b5[_0x1835('0x35')]=_0x1b83b5[_0x1835('0x35')]['length']?_0x1b83b5['attributes']:_0xcc8b3a[_0x1835('0x30')];if(_0x3e0929[_0x1835('0x31')][_0x1835('0x3e')]){_0x1b83b5[_0x1835('0x41')]=[{'all':!![]}];}_0x1b83b5=_[_0x1835('0x42')]({},_0x1b83b5,_0x3e0929[_0x1835('0x3c')]);return db[_0x1835('0x3d')][_0x1835('0x43')](_0x1b83b5)[_0x1835('0x24')](handleEntityNotFound(_0x3cbac2,null))['then'](respondWithResult(_0x3cbac2,null))[_0x1835('0x44')](handleError(_0x3cbac2,null));};exports[_0x1835('0x45')]=function(_0x485d2b,_0x5cd90d){return db['ServicenowAccount'][_0x1835('0x45')](_0x485d2b[_0x1835('0x46')],{})[_0x1835('0x24')](respondWithResult(_0x5cd90d,0xc9))[_0x1835('0x44')](handleError(_0x5cd90d,null));};exports['update']=function(_0x100080,_0xfb97f7){if(_0x100080[_0x1835('0x46')]['id']){delete _0x100080[_0x1835('0x46')]['id'];}return db[_0x1835('0x3d')]['find']({'where':{'id':_0x100080[_0x1835('0x47')]['id']}})[_0x1835('0x24')](handleEntityNotFound(_0xfb97f7,null))[_0x1835('0x24')](saveUpdates(_0x100080['body'],null))['then'](respondWithResult(_0xfb97f7,null))['catch'](handleError(_0xfb97f7,null));};exports['destroy']=function(_0x38ea9c,_0x30eba9){return db[_0x1835('0x3d')]['find']({'where':{'id':_0x38ea9c[_0x1835('0x47')]['id']}})['then'](handleEntityNotFound(_0x30eba9,null))[_0x1835('0x24')](removeEntity(_0x30eba9,null))[_0x1835('0x44')](handleError(_0x30eba9,null));};exports[_0x1835('0x48')]=function(_0x1e7dbb,_0x4daa43,_0x5d7252){var _0x3b5e60={};var _0x4a61f3={};var _0xddb547;var _0x6c37f8;return db[_0x1835('0x3d')][_0x1835('0x49')]({'where':{'id':_0x1e7dbb['params']['id']}})[_0x1835('0x24')](handleEntityNotFound(_0x4daa43,null))[_0x1835('0x24')](function(_0x56e93e){if(_0x56e93e){_0xddb547=_0x56e93e;_0x4a61f3[_0x1835('0x30')]=_[_0x1835('0x32')](db[_0x1835('0x4a')]['rawAttributes']);_0x4a61f3[_0x1835('0x31')]=_[_0x1835('0x32')](_0x1e7dbb['query']);_0x4a61f3[_0x1835('0x33')]=_[_0x1835('0x34')](_0x4a61f3[_0x1835('0x30')],_0x4a61f3[_0x1835('0x31')]);_0x3b5e60['attributes']=_[_0x1835('0x34')](_0x4a61f3[_0x1835('0x30')],qs['fields'](_0x1e7dbb[_0x1835('0x31')][_0x1835('0x36')]));_0x3b5e60[_0x1835('0x35')]=_0x3b5e60[_0x1835('0x35')][_0x1835('0x37')]?_0x3b5e60[_0x1835('0x35')]:_0x4a61f3[_0x1835('0x30')];_0x3b5e60[_0x1835('0x4b')]=qs['sort'](_0x1e7dbb['query']['sort']);_0x3b5e60[_0x1835('0x3a')]=qs[_0x1835('0x33')](_['pick'](_0x1e7dbb['query'],_0x4a61f3[_0x1835('0x33')]));if(_0x1e7dbb[_0x1835('0x31')]['filter']){_0x3b5e60['where']=_[_0x1835('0x42')](_0x3b5e60[_0x1835('0x3a')],{'$or':_[_0x1835('0x2c')](_0x3b5e60[_0x1835('0x35')],function(_0x537115){var _0x1237b7={};_0x1237b7[_0x537115]={'$like':'%'+_0x1e7dbb[_0x1835('0x31')][_0x1835('0x4c')]+'%'};return _0x1237b7;})});}_0x3b5e60=_[_0x1835('0x42')]({},_0x3b5e60,_0x1e7dbb[_0x1835('0x3c')]);return _0xddb547['getConfigurations'](_0x3b5e60);}})[_0x1835('0x24')](function(_0x26f05e){if(_0x26f05e){_0x6c37f8=_0x26f05e[_0x1835('0x37')];if(!_0x1e7dbb['query'][_0x1835('0x38')](_0x1835('0x4d'))){_0x3b5e60['limit']=qs[_0x1835('0x20')](_0x1e7dbb[_0x1835('0x31')][_0x1835('0x20')]);_0x3b5e60['offset']=qs['offset'](_0x1e7dbb[_0x1835('0x31')]['offset']);}return _0xddb547[_0x1835('0x48')](_0x3b5e60);}})['then'](function(_0x2e851a){if(_0x2e851a){return _0x2e851a?{'count':_0x6c37f8,'rows':_0x2e851a}:null;}})[_0x1835('0x24')](respondWithResult(_0x4daa43,null))[_0x1835('0x44')](handleError(_0x4daa43,null));};exports[_0x1835('0x4e')]=function(_0x56a5d2,_0x27db30,_0x23cf8a){if(_0x56a5d2[_0x1835('0x46')]['id']){delete _0x56a5d2['body']['id'];}return db['ServicenowAccount'][_0x1835('0x49')]({'where':{'id':_0x56a5d2[_0x1835('0x47')]['id']}})[_0x1835('0x24')](handleEntityNotFound(_0x27db30,null))[_0x1835('0x24')](function(_0x4cb352){if(_0x4cb352){_0x56a5d2[_0x1835('0x46')][_0x1835('0x4f')]=_0x4cb352['id'];_0x56a5d2[_0x1835('0x46')]['Subjects']=integrations['getSubjects'](_0x56a5d2[_0x1835('0x46')][_0x1835('0x50')],_0x56a5d2[_0x1835('0x46')]['type']);_0x56a5d2[_0x1835('0x46')][_0x1835('0x51')]=integrations['getDescriptions'](_0x56a5d2[_0x1835('0x46')]['channel'],_0x56a5d2[_0x1835('0x46')][_0x1835('0x2e')]);return db[_0x1835('0x4a')][_0x1835('0x45')](_0x56a5d2[_0x1835('0x46')],{'include':[{'model':db[_0x1835('0x52')],'as':_0x1835('0x53')},{'model':db[_0x1835('0x52')],'as':_0x1835('0x51')}]});}return null;})['then'](respondWithResult(_0x27db30,null))[_0x1835('0x44')](handleError(_0x27db30,null));};exports[_0x1835('0x54')]=function(_0x296edb,_0xf1c32d,_0x63ce4e){var _0x5f263a=[_0x1835('0x55'),_0x1835('0x56'),_0x1835('0x57'),'subcategory','close_code',_0x1835('0x58'),_0x1835('0x59'),_0x1835('0x5a'),_0x1835('0x5b')];var _0x55e114=[_0x1835('0x5c'),'made_sla',_0x1835('0x5d'),'watch_list',_0x1835('0x5e'),_0x1835('0x5f'),_0x1835('0x60'),_0x1835('0x56'),_0x1835('0x61'),_0x1835('0x62'),_0x1835('0x63'),_0x1835('0x64'),'opened_by',_0x1835('0x65'),'sys_created_on',_0x1835('0x66'),_0x1835('0x67'),'sys_created_by',_0x1835('0x57'),_0x1835('0x4b'),_0x1835('0x68'),_0x1835('0x69'),_0x1835('0x6a'),_0x1835('0x6b'),_0x1835('0x6c'),'active','work_notes_list',_0x1835('0x6d'),'priority',_0x1835('0x6e'),_0x1835('0x6f'),_0x1835('0x70'),_0x1835('0x71'),_0x1835('0x72'),'business_duration',_0x1835('0x73'),_0x1835('0x74'),'reopened_time',_0x1835('0x75'),'caller_id',_0x1835('0x76'),_0x1835('0x77'),_0x1835('0x78'),_0x1835('0x79'),_0x1835('0x7a'),'correlation_display',_0x1835('0x7b'),_0x1835('0x7c'),'assignment_group',_0x1835('0x7d'),'additional_assignee_list',_0x1835('0x7e'),_0x1835('0x7f'),'notify','sys_class_name',_0x1835('0x80'),_0x1835('0x81'),_0x1835('0x82'),_0x1835('0x83'),_0x1835('0x84'),'contact_type',_0x1835('0x85'),_0x1835('0x59'),_0x1835('0x86'),_0x1835('0x87'),'company',_0x1835('0x88'),_0x1835('0x89'),_0x1835('0x8a'),_0x1835('0x5a'),_0x1835('0x8b'),_0x1835('0x8c'),'approval',_0x1835('0x8d'),_0x1835('0x8e'),_0x1835('0x8f'),_0x1835('0x90'),_0x1835('0x91'),'escalation',_0x1835('0x92'),'correlation_id',_0x1835('0x93'),_0x1835('0x5b')];var _0x33e297='';var _0x23a96b='';var _0x137231=[];var _0x29856e='';var _0x5bd7f8='';var _0x36eb2c=[];var _0x485134='';var _0x23e354='';var _0x3bbac3={};var _0x37ebd2='';return db[_0x1835('0x3d')][_0x1835('0x49')]({'where':{'id':_0x296edb[_0x1835('0x47')]['id']},'attributes':['id',_0x1835('0x94'),_0x1835('0x95'),_0x1835('0x96'),_0x1835('0x97'),_0x1835('0x98')]})[_0x1835('0x24')](handleEntityNotFound(_0xf1c32d,null))[_0x1835('0x24')](function(_0x262f31){if(_0x262f31){_0x37ebd2=_0x262f31[_0x1835('0x97')];var _0x33483b=_0x37ebd2['slice'](-0x1);if(_0x33483b==='/'){_0x37ebd2=_0x37ebd2[_0x1835('0x99')](0x0,_0x37ebd2[_0x1835('0x9a')](_0x33483b));}_0x23e354=util['format'](_0x1835('0x9b'),_0x37ebd2);_0x485134=util[_0x1835('0x9c')](_0x1835('0x9d'),_0x37ebd2);_0x3bbac3={'user':_0x262f31[_0x1835('0x94')],'pass':_0x262f31['password']};var _0x5cd79e={'method':_0x1835('0x9e'),'uri':_0x23e354+_0x1835('0x9f'),'auth':_0x3bbac3,'json':!![]};return rp(_0x5cd79e);}})[_0x1835('0x24')](function(_0x21ceca){if(_0x21ceca[_0x1835('0xa0')][_0x1835('0x37')]>0x0){_0x33e297=_0x21ceca[_0x1835('0xa0')];}console['log'](_0x1835('0xa1'),_0x33e297);_0x36eb2c=[];_0x23a96b=Object[_0x1835('0xa2')]([],_0x33e297);_['remove'](_0x23a96b,function(_0x114c2c){return!_0x5f263a[_0x1835('0xa3')](_0x114c2c[_0x1835('0x29')]);});_0x23a96b[_0x1835('0xa4')](function(_0x5414a8){var _0x56a1d5=createFieldObject(_0x485134,_0x3bbac3,_0x5414a8['internalType'],_0x5414a8[_0x1835('0x29')],_0x5414a8['label'],![]);_0x36eb2c[_0x1835('0xa5')](_0x56a1d5);});return Promise[_0x1835('0xa6')](_0x36eb2c);})[_0x1835('0x24')](function(_0x5bb424){_0x137231=_0x5bb424;_0x29856e=Object[_0x1835('0xa2')]([],_0x33e297);console[_0x1835('0xa7')]('TCL:\x20_object',_0x33e297);_[_0x1835('0xa8')](_0x29856e,function(_0x57b62e){return _0x55e114['includes'](_0x57b62e[_0x1835('0x29')]);});console['log'](_0x1835('0xa9'),_0x29856e);_0x36eb2c=[];_0x29856e['forEach'](function(_0x431b97){var _0x42d5c3=createFieldObject(_0x485134,_0x3bbac3,_0x431b97[_0x1835('0xaa')],_0x431b97[_0x1835('0x29')],_0x431b97['label'],!![]);_0x36eb2c[_0x1835('0xa5')](_0x42d5c3);});return Promise['all'](_0x36eb2c);})['then'](function(_0x2eee2c){_0x5bd7f8=_0x2eee2c;var _0x811d08=_0x137231['concat'](_0x5bd7f8);return{'count':_0x811d08[_0x1835('0x37')],'rows':_0x811d08};})[_0x1835('0x24')](respondWithResult(_0xf1c32d,null))[_0x1835('0x44')](function(_0x2db719){console[_0x1835('0xa7')](_0x1835('0xab')+_0x2db719);var _0x5df33a=_0x296edb[_0x1835('0x31')]['test']?0x1f4:_0x2db719['statusCode']||0x1f4;logger[_0x1835('0x27')](_0x2db719['stack']);delete _0x2db719[_0x1835('0x29')];if(_0x5df33a===0x191){_0x5df33a=0x190;}_0xf1c32d[_0x1835('0x1c')](_0x5df33a)[_0x1835('0x2a')](_0x296edb[_0x1835('0x31')][_0x1835('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x2db719[_0x1835('0xad')]}:_0x2db719);});};function createFieldObject(_0x1564ad,_0x2abe72,_0x225337,_0x5b4fbe,_0xc0c5f1,_0x34340c){return new Promise(function(_0x13f7db,_0x346ecf){var _0xcedcff={'id':_0x5b4fbe,'name':_0xc0c5f1,'custom':_0x34340c};if(_0x225337===_0x1835('0xae')){_0xcedcff[_0x1835('0x3c')]=[{'name':_0x1835('0xaf'),'value':_0x1835('0xb0')},{'name':'False','value':_0x1835('0xb1')}];_0x13f7db(_0xcedcff);}else{var _0x334a2a={'method':_0x1835('0x9e'),'uri':_0x1564ad+_0x1835('0xb2')+_0x5b4fbe,'auth':_0x2abe72,'json':!![]};return rp(_0x334a2a)[_0x1835('0x24')](function(_0x1325e4){var _0x22c28b=[];if(_0x1325e4[_0x1835('0xa0')][_0x1835('0x37')]>0x0){_0x1325e4[_0x1835('0xa0')]['forEach'](function(_0x54f519){if(_0x54f519[_0x1835('0xb3')]===_0x1835('0xb1')){var _0x134d52={'name':_0x54f519['label'],'value':_0x54f519[_0x1835('0xb4')]};_0x22c28b[_0x1835('0xa5')](_0x134d52);}});}_0xcedcff[_0x1835('0x3c')]=_0x22c28b;if(_0xcedcff[_0x1835('0x3c')]['length']>0x0){_0x13f7db(_0xcedcff);}else{if(_0x34340c==![]){_0x13f7db();}else{_0x13f7db(_0xcedcff);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5cacbe6..29ce9a0 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 _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0xf2ca[_0xe501ff];return _0x17135d;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xaf2c('0x9'));module[_0xaf2c('0xa')]=function(_0x297740,_0x1f9531){return _0x297740['define'](_0xaf2c('0xb'),attributes,{'tableName':_0xaf2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee14=['ServicenowAccount','int_servicenow_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define'];(function(_0x3fcc63,_0x58cc56){var _0x259fbc=function(_0x56ef16){while(--_0x56ef16){_0x3fcc63['push'](_0x3fcc63['shift']());}};_0x259fbc(++_0x58cc56);}(_0xee14,0x13a));var _0x4ee1=function(_0x81d1f6,_0x271c0c){_0x81d1f6=_0x81d1f6-0x0;var _0x154677=_0xee14[_0x81d1f6];return _0x154677;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4ee1('0x9')]=function(_0x573700,_0x327c18){return _0x573700[_0x4ee1('0xa')](_0x4ee1('0xb'),attributes,{'tableName':_0x4ee1('0xc'),'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 293c8c8..6874a0e 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 _0x4228=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','options','where','attributes','limit','include','map','model','then','info','GetServicenowAccount','find','ShowServicenowAccount','lodash'];(function(_0x4036d9,_0x2804ee){var _0x2d0bf1=function(_0x431fa9){while(--_0x431fa9){_0x4036d9['push'](_0x4036d9['shift']());}};_0x2d0bf1(++_0x2804ee);}(_0x4228,0xae));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8422('0x0'));var util=require('util');var moment=require(_0x8422('0x1'));var BPromise=require(_0x8422('0x2'));var rs=require(_0x8422('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8422('0x4'));var logger=require(_0x8422('0x5'))(_0x8422('0x6'));var config=require(_0x8422('0x7'));var jayson=require(_0x8422('0x8'));var client=jayson[_0x8422('0x9')][_0x8422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaf6685,_0x1392a0,_0x4fc325){return new BPromise(function(_0x285958,_0x14896b){return client[_0x8422('0xb')](_0xaf6685,_0x4fc325)['then'](function(_0x489603){logger['info'](_0x8422('0xc'),_0x1392a0,_0x8422('0xd'));logger[_0x8422('0xe')](_0x8422('0xf'),_0x1392a0,_0x8422('0xd'),JSON[_0x8422('0x10')](_0x489603));if(_0x489603[_0x8422('0x11')]){if(_0x489603[_0x8422('0x11')][_0x8422('0x12')]===0x1f4){logger[_0x8422('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1392a0,_0x489603['error']['message']);return _0x14896b(_0x489603[_0x8422('0x11')]['message']);}logger[_0x8422('0x11')](_0x8422('0xc'),_0x1392a0,_0x489603[_0x8422('0x11')][_0x8422('0x13')]);return _0x285958(_0x489603[_0x8422('0x11')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1392a0,_0x8422('0xd'));_0x285958(_0x489603[_0x8422('0x14')]['message']);}})[_0x8422('0x15')](function(_0x59ac28){logger[_0x8422('0x11')](_0x8422('0xc'),_0x1392a0,_0x59ac28);_0x14896b(_0x59ac28);});});}exports['GetServicenowAccount']=function(_0x6b4d8b){var _0x7171f3=this;return new Promise(function(_0xb6b67e,_0x32bd17){return db[_0x8422('0x16')]['findAll']({'raw':_0x6b4d8b[_0x8422('0x17')]?_0x6b4d8b[_0x8422('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x6b4d8b[_0x8422('0x17')]?_0x6b4d8b[_0x8422('0x17')][_0x8422('0x18')]||null:null,'attributes':_0x6b4d8b[_0x8422('0x17')]?_0x6b4d8b['options'][_0x8422('0x19')]||null:null,'limit':_0x6b4d8b['options']?_0x6b4d8b['options'][_0x8422('0x1a')]||null:null,'include':_0x6b4d8b['options']?_0x6b4d8b[_0x8422('0x17')][_0x8422('0x1b')]?_[_0x8422('0x1c')](_0x6b4d8b['options']['include'],function(_0x580fd8){return{'model':db[_0x580fd8['model']],'as':_0x580fd8['as'],'attributes':_0x580fd8[_0x8422('0x19')],'include':_0x580fd8[_0x8422('0x1b')]?_['map'](_0x580fd8[_0x8422('0x1b')],function(_0x547d8d){return{'model':db[_0x547d8d[_0x8422('0x1d')]],'as':_0x547d8d['as'],'attributes':_0x547d8d['attributes'],'include':_0x547d8d[_0x8422('0x1b')]?_[_0x8422('0x1c')](_0x547d8d[_0x8422('0x1b')],function(_0x5638ea){return{'model':db[_0x5638ea['model']],'as':_0x5638ea['as'],'attributes':_0x5638ea[_0x8422('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8422('0x1e')](function(_0x4045fa){logger[_0x8422('0x1f')]('GetServicenowAccount',_0x6b4d8b);logger['debug'](_0x8422('0x20'),_0x6b4d8b,JSON['stringify'](_0x4045fa));_0xb6b67e(_0x4045fa);})[_0x8422('0x15')](function(_0x5baf7c){logger[_0x8422('0x11')](_0x8422('0x20'),_0x5baf7c[_0x8422('0x13')],_0x6b4d8b);_0x32bd17(_0x7171f3[_0x8422('0x11')](0x1f4,_0x5baf7c[_0x8422('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x45756f){var _0x5a52b8=this;return new Promise(function(_0x2a1cdd,_0x16748c){return db[_0x8422('0x16')][_0x8422('0x21')]({'raw':_0x45756f[_0x8422('0x17')]?_0x45756f[_0x8422('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x45756f[_0x8422('0x17')]?_0x45756f[_0x8422('0x17')][_0x8422('0x18')]||null:null,'attributes':_0x45756f[_0x8422('0x17')]?_0x45756f[_0x8422('0x17')][_0x8422('0x19')]||null:null,'include':_0x45756f[_0x8422('0x17')]?_0x45756f[_0x8422('0x17')][_0x8422('0x1b')]?_[_0x8422('0x1c')](_0x45756f[_0x8422('0x17')][_0x8422('0x1b')],function(_0x7ab1f1){return{'model':db[_0x7ab1f1[_0x8422('0x1d')]],'as':_0x7ab1f1['as'],'attributes':_0x7ab1f1[_0x8422('0x19')],'include':_0x7ab1f1[_0x8422('0x1b')]?_[_0x8422('0x1c')](_0x7ab1f1[_0x8422('0x1b')],function(_0x152c91){return{'model':db[_0x152c91[_0x8422('0x1d')]],'as':_0x152c91['as'],'attributes':_0x152c91['attributes'],'include':_0x152c91['include']?_[_0x8422('0x1c')](_0x152c91[_0x8422('0x1b')],function(_0xabd59f){return{'model':db[_0xabd59f[_0x8422('0x1d')]],'as':_0xabd59f['as'],'attributes':_0xabd59f[_0x8422('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8422('0x1e')](function(_0x265f44){logger['info']('ShowServicenowAccount',_0x45756f);logger[_0x8422('0xe')](_0x8422('0x22'),_0x45756f,JSON[_0x8422('0x10')](_0x265f44));_0x2a1cdd(_0x265f44);})[_0x8422('0x15')](function(_0x360328){logger['error'](_0x8422('0x22'),_0x360328[_0x8422('0x13')],_0x45756f);_0x16748c(_0x5a52b8[_0x8422('0x11')](0x1f4,_0x360328[_0x8422('0x13')]));});});}; \ No newline at end of file +var _0x5730=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','ShowServicenowAccount','find','raw','lodash','util'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5730,0x18e));var _0x0573=function(_0x1dffa2,_0x317944){_0x1dffa2=_0x1dffa2-0x0;var _0x4ddc51=_0x5730[_0x1dffa2];return _0x4ddc51;};'use strict';var _=require(_0x0573('0x0'));var util=require(_0x0573('0x1'));var moment=require(_0x0573('0x2'));var BPromise=require(_0x0573('0x3'));var rs=require(_0x0573('0x4'));var fs=require('fs');var Redis=require(_0x0573('0x5'));var db=require(_0x0573('0x6'))['db'];var utils=require(_0x0573('0x7'));var logger=require(_0x0573('0x8'))(_0x0573('0x9'));var config=require(_0x0573('0xa'));var jayson=require(_0x0573('0xb'));var client=jayson[_0x0573('0xc')][_0x0573('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x12ee13,_0x508449,_0x288904){return new BPromise(function(_0x417676,_0x173a70){return client[_0x0573('0xe')](_0x12ee13,_0x288904)[_0x0573('0xf')](function(_0x540720){logger[_0x0573('0x10')](_0x0573('0x11'),_0x508449,_0x0573('0x12'));logger[_0x0573('0x13')](_0x0573('0x14'),_0x508449,_0x0573('0x12'),JSON[_0x0573('0x15')](_0x540720));if(_0x540720[_0x0573('0x16')]){if(_0x540720['error'][_0x0573('0x17')]===0x1f4){logger[_0x0573('0x16')](_0x0573('0x11'),_0x508449,_0x540720['error']['message']);return _0x173a70(_0x540720[_0x0573('0x16')][_0x0573('0x18')]);}logger[_0x0573('0x16')](_0x0573('0x11'),_0x508449,_0x540720['error']['message']);return _0x417676(_0x540720[_0x0573('0x16')][_0x0573('0x18')]);}else{logger[_0x0573('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x508449,_0x0573('0x12'));_0x417676(_0x540720[_0x0573('0x19')]['message']);}})[_0x0573('0x1a')](function(_0x46cdd2){logger[_0x0573('0x16')]('ServicenowAccount,\x20%s,\x20%s',_0x508449,_0x46cdd2);_0x173a70(_0x46cdd2);});});}exports[_0x0573('0x1b')]=function(_0xe93cb5){var _0x43856c=this;return new Promise(function(_0xc5eb0c,_0x5047f5){return db[_0x0573('0x1c')][_0x0573('0x1d')]({'raw':_0xe93cb5['options']?_0xe93cb5[_0x0573('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xe93cb5[_0x0573('0x1e')]?_0xe93cb5[_0x0573('0x1e')][_0x0573('0x1f')]||null:null,'attributes':_0xe93cb5[_0x0573('0x1e')]?_0xe93cb5['options'][_0x0573('0x20')]||null:null,'limit':_0xe93cb5[_0x0573('0x1e')]?_0xe93cb5[_0x0573('0x1e')][_0x0573('0x21')]||null:null,'include':_0xe93cb5[_0x0573('0x1e')]?_0xe93cb5[_0x0573('0x1e')][_0x0573('0x22')]?_[_0x0573('0x23')](_0xe93cb5['options']['include'],function(_0x2377bf){return{'model':db[_0x2377bf['model']],'as':_0x2377bf['as'],'attributes':_0x2377bf[_0x0573('0x20')],'include':_0x2377bf[_0x0573('0x22')]?_[_0x0573('0x23')](_0x2377bf[_0x0573('0x22')],function(_0x5d6266){return{'model':db[_0x5d6266[_0x0573('0x24')]],'as':_0x5d6266['as'],'attributes':_0x5d6266[_0x0573('0x20')],'include':_0x5d6266['include']?_[_0x0573('0x23')](_0x5d6266['include'],function(_0x16003b){return{'model':db[_0x16003b[_0x0573('0x24')]],'as':_0x16003b['as'],'attributes':_0x16003b[_0x0573('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0573('0xf')](function(_0x53a213){logger[_0x0573('0x10')](_0x0573('0x1b'),_0xe93cb5);logger[_0x0573('0x13')](_0x0573('0x1b'),_0xe93cb5,JSON[_0x0573('0x15')](_0x53a213));_0xc5eb0c(_0x53a213);})[_0x0573('0x1a')](function(_0xe197bd){logger[_0x0573('0x16')](_0x0573('0x1b'),_0xe197bd[_0x0573('0x18')],_0xe93cb5);_0x5047f5(_0x43856c['error'](0x1f4,_0xe197bd[_0x0573('0x18')]));});});};exports[_0x0573('0x25')]=function(_0x1fbb88){var _0x45efc8=this;return new Promise(function(_0x559eda,_0xde38e6){return db[_0x0573('0x1c')][_0x0573('0x26')]({'raw':_0x1fbb88['options']?_0x1fbb88[_0x0573('0x1e')][_0x0573('0x27')]===undefined?!![]:![]:!![],'where':_0x1fbb88[_0x0573('0x1e')]?_0x1fbb88[_0x0573('0x1e')][_0x0573('0x1f')]||null:null,'attributes':_0x1fbb88[_0x0573('0x1e')]?_0x1fbb88[_0x0573('0x1e')]['attributes']||null:null,'include':_0x1fbb88[_0x0573('0x1e')]?_0x1fbb88[_0x0573('0x1e')][_0x0573('0x22')]?_[_0x0573('0x23')](_0x1fbb88[_0x0573('0x1e')][_0x0573('0x22')],function(_0x27020b){return{'model':db[_0x27020b['model']],'as':_0x27020b['as'],'attributes':_0x27020b[_0x0573('0x20')],'include':_0x27020b[_0x0573('0x22')]?_[_0x0573('0x23')](_0x27020b[_0x0573('0x22')],function(_0x2f1cc4){return{'model':db[_0x2f1cc4['model']],'as':_0x2f1cc4['as'],'attributes':_0x2f1cc4[_0x0573('0x20')],'include':_0x2f1cc4['include']?_[_0x0573('0x23')](_0x2f1cc4[_0x0573('0x22')],function(_0x2fd00f){return{'model':db[_0x2fd00f['model']],'as':_0x2fd00f['as'],'attributes':_0x2fd00f[_0x0573('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0573('0xf')](function(_0x12d2aa){logger[_0x0573('0x10')](_0x0573('0x25'),_0x1fbb88);logger[_0x0573('0x13')](_0x0573('0x25'),_0x1fbb88,JSON['stringify'](_0x12d2aa));_0x559eda(_0x12d2aa);})[_0x0573('0x1a')](function(_0x4f7e4d){logger['error'](_0x0573('0x25'),_0x4f7e4d['message'],_0x1fbb88);_0xde38e6(_0x45efc8[_0x0573('0x16')](0x1f4,_0x4f7e4d[_0x0573('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 420252c..18480b5 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 _0x4e9d=['/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show'];(function(_0x3d76d,_0x56f6e8){var _0x1c2a5f=function(_0x24d5fc){while(--_0x24d5fc){_0x3d76d['push'](_0x3d76d['shift']());}};_0x1c2a5f(++_0x56f6e8);}(_0x4e9d,0x9a));var _0xd4e9=function(_0x35245d,_0x193583){_0x35245d=_0x35245d-0x0;var _0x184a83=_0x4e9d[_0x35245d];return _0x184a83;};'use strict';var multer=require(_0xd4e9('0x0'));var util=require('util');var path=require(_0xd4e9('0x1'));var timeout=require(_0xd4e9('0x2'));var express=require(_0xd4e9('0x3'));var router=express[_0xd4e9('0x4')]();var fs_extra=require(_0xd4e9('0x5'));var auth=require(_0xd4e9('0x6'));var interaction=require(_0xd4e9('0x7'));var config=require(_0xd4e9('0x8'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4e9('0x9')]);router[_0xd4e9('0xa')](_0xd4e9('0xb'),auth[_0xd4e9('0xc')](),controller[_0xd4e9('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0xd4e9('0xe'),auth[_0xd4e9('0xc')](),controller[_0xd4e9('0xf')]);router[_0xd4e9('0xa')](_0xd4e9('0x10'),auth[_0xd4e9('0xc')](),controller['getDescriptions']);router[_0xd4e9('0x11')]('/',auth['isAuthenticated'](),controller[_0xd4e9('0x12')]);router[_0xd4e9('0x13')](_0xd4e9('0xb'),auth[_0xd4e9('0xc')](),controller[_0xd4e9('0x14')]);router[_0xd4e9('0x15')](_0xd4e9('0xb'),auth[_0xd4e9('0xc')](),controller[_0xd4e9('0x16')]);module[_0xd4e9('0x17')]=router; \ No newline at end of file +var _0xd313=['/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0xca5fbd,_0x479c8e){var _0x5ee881=function(_0x18d288){while(--_0x18d288){_0xca5fbd['push'](_0xca5fbd['shift']());}};_0x5ee881(++_0x479c8e);}(_0xd313,0x1d1));var _0x3d31=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0xd313[_0x476c6c];return _0xbb94db;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3d31('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d31('0x1'));var interaction=require(_0x3d31('0x2'));var config=require(_0x3d31('0x3'));var controller=require('./intServicenowConfiguration.controller');router[_0x3d31('0x4')]('/',auth[_0x3d31('0x5')](),controller['index']);router[_0x3d31('0x4')](_0x3d31('0x6'),auth['isAuthenticated'](),controller[_0x3d31('0x7')]);router[_0x3d31('0x4')](_0x3d31('0x8'),auth[_0x3d31('0x5')](),controller[_0x3d31('0x9')]);router[_0x3d31('0x4')]('/:id/subjects',auth[_0x3d31('0x5')](),controller['getSubjects']);router[_0x3d31('0x4')](_0x3d31('0xa'),auth[_0x3d31('0x5')](),controller[_0x3d31('0xb')]);router[_0x3d31('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d31('0xd')]);router[_0x3d31('0xe')](_0x3d31('0x6'),auth[_0x3d31('0x5')](),controller[_0x3d31('0xf')]);router[_0x3d31('0x10')](_0x3d31('0x6'),auth[_0x3d31('0x5')](),controller[_0x3d31('0x11')]);module[_0x3d31('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 7241b2a..4b6b6fa 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 _0xb80e=['exports','STRING'];(function(_0x4e24bd,_0x42d029){var _0x25f5a1=function(_0x516f0f){while(--_0x516f0f){_0x4e24bd['push'](_0x4e24bd['shift']());}};_0x25f5a1(++_0x42d029);}(_0xb80e,0x154));var _0xeb80=function(_0x1fa19c,_0x5c740b){_0x1fa19c=_0x1fa19c-0x0;var _0x5b332d=_0xb80e[_0x1fa19c];return _0x5b332d;};'use strict';var Sequelize=require('sequelize');module[_0xeb80('0x0')]={'name':{'type':Sequelize[_0xeb80('0x1')]},'description':{'type':Sequelize[_0xeb80('0x1')]}}; \ No newline at end of file +var _0xb087=['STRING'];(function(_0x190349,_0x5b508e){var _0x1a236c=function(_0x4b1e56){while(--_0x4b1e56){_0x190349['push'](_0x190349['shift']());}};_0x1a236c(++_0x5b508e);}(_0xb087,0xdc));var _0x7b08=function(_0x5e0a3d,_0x1062be){_0x5e0a3d=_0x5e0a3d-0x0;var _0x12fdb1=_0xb087[_0x5e0a3d];return _0x12fdb1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7b08('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a95cba5..41e6196 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 _0x5618=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','include','findAll','rows','catch','params','includeAll','find','create','body','getFields','findOne','ServicenowField','pick','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x5618,0xe5));var _0x8561=function(_0x37ccb8,_0x2b412e){_0x37ccb8=_0x37ccb8-0x0;var _0x5e09cb=_0x5618[_0x37ccb8];return _0x5e09cb;};'use strict';var emlformat=require(_0x8561('0x0'));var rimraf=require(_0x8561('0x1'));var zipdir=require(_0x8561('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8561('0x3'));var Mustache=require(_0x8561('0x4'));var util=require(_0x8561('0x5'));var path=require(_0x8561('0x6'));var sox=require(_0x8561('0x7'));var csv=require('to-csv');var ejs=require(_0x8561('0x8'));var fs=require('fs');var fs_extra=require(_0x8561('0x9'));var _=require(_0x8561('0xa'));var squel=require(_0x8561('0xb'));var crypto=require(_0x8561('0xc'));var jsforce=require(_0x8561('0xd'));var deskjs=require(_0x8561('0xe'));var toCsv=require(_0x8561('0xf'));var querystring=require(_0x8561('0x10'));var Papa=require(_0x8561('0x11'));var Redis=require(_0x8561('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8561('0x13'));var as=require(_0x8561('0x14'));var hardwareService=require(_0x8561('0x15'));var logger=require(_0x8561('0x16'))(_0x8561('0x17'));var utils=require(_0x8561('0x18'));var config=require(_0x8561('0x19'));var licenseUtil=require(_0x8561('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b7d21,_0x26948d){_0x26948d=_0x26948d||0xcc;return function(_0x19f67b){if(_0x19f67b){return _0x3b7d21[_0x8561('0x1b')](_0x26948d);}return _0x3b7d21[_0x8561('0x1c')](_0x26948d)[_0x8561('0x1d')]();};}function respondWithResult(_0x278ae8,_0xc97b91){_0xc97b91=_0xc97b91||0xc8;return function(_0x4b9b74){if(_0x4b9b74){return _0x278ae8[_0x8561('0x1c')](_0xc97b91)[_0x8561('0x1e')](_0x4b9b74);}};}function respondWithFilteredResult(_0x5572c2,_0x292434){return function(_0x3b694f){if(_0x3b694f){var _0x881799=typeof _0x292434['offset']==='undefined'&&typeof _0x292434[_0x8561('0x1f')]==='undefined';var _0x52c707=_0x3b694f[_0x8561('0x20')];var _0x578d6c=_0x881799?0x0:_0x292434[_0x8561('0x21')];var _0x201224=_0x881799?_0x3b694f['count']:_0x292434[_0x8561('0x21')]+_0x292434[_0x8561('0x1f')];var _0x1fef4c;if(_0x201224>=_0x52c707){_0x201224=_0x52c707;_0x1fef4c=0xc8;}else{_0x1fef4c=0xce;}_0x5572c2[_0x8561('0x1c')](_0x1fef4c);return _0x5572c2[_0x8561('0x22')](_0x8561('0x23'),_0x578d6c+'-'+_0x201224+'/'+_0x52c707)[_0x8561('0x1e')](_0x3b694f);}return null;};}function patchUpdates(_0x5af174){return function(_0x5b52ac){try{jsonpatch[_0x8561('0x24')](_0x5b52ac,_0x5af174,!![]);}catch(_0x37e403){return BPromise[_0x8561('0x25')](_0x37e403);}return _0x5b52ac[_0x8561('0x26')]();};}function saveUpdates(_0x38081e,_0x1cad67){return function(_0x1a92b0){if(_0x1a92b0){return _0x1a92b0[_0x8561('0x27')](_0x38081e)[_0x8561('0x28')](function(_0x1bdd1c){return _0x1bdd1c;});}return null;};}function removeEntity(_0x25ee13,_0x319fb9){return function(_0x5d7a67){if(_0x5d7a67){return _0x5d7a67[_0x8561('0x29')]()[_0x8561('0x28')](function(){_0x25ee13[_0x8561('0x1c')](0xcc)[_0x8561('0x1d')]();});}};}function handleEntityNotFound(_0x355215,_0x2a2508){return function(_0x3e9feb){if(!_0x3e9feb){_0x355215[_0x8561('0x1b')](0x194);}return _0x3e9feb;};}function handleError(_0x4f409e,_0x4e4a57){_0x4e4a57=_0x4e4a57||0x1f4;return function(_0x47e3da){logger[_0x8561('0x2a')](_0x47e3da['stack']);if(_0x47e3da['name']){delete _0x47e3da['name'];}_0x4f409e[_0x8561('0x1c')](_0x4e4a57)[_0x8561('0x2b')](_0x47e3da);};}exports['index']=function(_0x9b11a2,_0x31fdbf){var _0x5e40c2={},_0x15a0e7={},_0x4f782c={'count':0x0,'rows':[]};var _0x411ec1=_[_0x8561('0x2c')](db[_0x8561('0x2d')][_0x8561('0x2e')],function(_0x45d552){return{'name':_0x45d552[_0x8561('0x2f')],'type':_0x45d552[_0x8561('0x30')][_0x8561('0x31')]};});_0x15a0e7[_0x8561('0x32')]=_[_0x8561('0x2c')](_0x411ec1,'name');_0x15a0e7[_0x8561('0x33')]=_[_0x8561('0x34')](_0x9b11a2[_0x8561('0x33')]);_0x15a0e7[_0x8561('0x35')]=_['intersection'](_0x15a0e7['model'],_0x15a0e7['query']);_0x5e40c2['attributes']=_[_0x8561('0x36')](_0x15a0e7[_0x8561('0x32')],qs[_0x8561('0x37')](_0x9b11a2['query'][_0x8561('0x37')]));_0x5e40c2[_0x8561('0x38')]=_0x5e40c2['attributes'][_0x8561('0x39')]?_0x5e40c2[_0x8561('0x38')]:_0x15a0e7[_0x8561('0x32')];if(!_0x9b11a2[_0x8561('0x33')][_0x8561('0x3a')](_0x8561('0x3b'))){_0x5e40c2[_0x8561('0x1f')]=qs['limit'](_0x9b11a2[_0x8561('0x33')][_0x8561('0x1f')]);_0x5e40c2[_0x8561('0x21')]=qs[_0x8561('0x21')](_0x9b11a2['query'][_0x8561('0x21')]);}_0x5e40c2[_0x8561('0x3c')]=qs[_0x8561('0x3d')](_0x9b11a2[_0x8561('0x33')]['sort']);_0x5e40c2[_0x8561('0x3e')]=qs['filters'](_['pick'](_0x9b11a2[_0x8561('0x33')],_0x15a0e7[_0x8561('0x35')]),_0x411ec1);if(_0x9b11a2[_0x8561('0x33')][_0x8561('0x3f')]){_0x5e40c2[_0x8561('0x3e')]=_[_0x8561('0x40')](_0x5e40c2[_0x8561('0x3e')],{'$or':_['map'](_0x411ec1,function(_0x48fd3f){if(_0x48fd3f[_0x8561('0x30')]!==_0x8561('0x41')){var _0x19c26b={};_0x19c26b[_0x48fd3f[_0x8561('0x42')]]={'$like':'%'+_0x9b11a2['query'][_0x8561('0x3f')]+'%'};return _0x19c26b;}})});}_0x5e40c2=_[_0x8561('0x40')]({},_0x5e40c2,_0x9b11a2['options']);var _0x31bdb8={'where':_0x5e40c2[_0x8561('0x3e')]};return db['ServicenowConfiguration'][_0x8561('0x20')](_0x31bdb8)[_0x8561('0x28')](function(_0x3a5051){_0x4f782c['count']=_0x3a5051;if(_0x9b11a2[_0x8561('0x33')]['includeAll']){_0x5e40c2[_0x8561('0x43')]=[{'all':!![]}];}return db[_0x8561('0x2d')][_0x8561('0x44')](_0x5e40c2);})[_0x8561('0x28')](function(_0x42f9c2){_0x4f782c[_0x8561('0x45')]=_0x42f9c2;return _0x4f782c;})['then'](respondWithFilteredResult(_0x31fdbf,_0x5e40c2))[_0x8561('0x46')](handleError(_0x31fdbf,null));};exports['show']=function(_0x5ee411,_0x1d38a9){var _0xe0a98e={'raw':![],'where':{'id':_0x5ee411[_0x8561('0x47')]['id']}},_0x1e6660={};_0x1e6660[_0x8561('0x32')]=_[_0x8561('0x34')](db[_0x8561('0x2d')][_0x8561('0x2e')]);_0x1e6660[_0x8561('0x33')]=_['keys'](_0x5ee411['query']);_0x1e6660[_0x8561('0x35')]=_['intersection'](_0x1e6660[_0x8561('0x32')],_0x1e6660['query']);_0xe0a98e['attributes']=_[_0x8561('0x36')](_0x1e6660[_0x8561('0x32')],qs[_0x8561('0x37')](_0x5ee411[_0x8561('0x33')]['fields']));_0xe0a98e[_0x8561('0x38')]=_0xe0a98e['attributes'][_0x8561('0x39')]?_0xe0a98e[_0x8561('0x38')]:_0x1e6660[_0x8561('0x32')];if(_0x5ee411['query'][_0x8561('0x48')]){_0xe0a98e['include']=[{'all':!![]}];}_0xe0a98e=_[_0x8561('0x40')]({},_0xe0a98e,_0x5ee411['options']);return db['ServicenowConfiguration'][_0x8561('0x49')](_0xe0a98e)[_0x8561('0x28')](handleEntityNotFound(_0x1d38a9,null))[_0x8561('0x28')](respondWithResult(_0x1d38a9,null))[_0x8561('0x46')](handleError(_0x1d38a9,null));};exports[_0x8561('0x4a')]=function(_0x1b6c20,_0x3652c3){return db[_0x8561('0x2d')][_0x8561('0x4a')](_0x1b6c20['body'],{})[_0x8561('0x28')](respondWithResult(_0x3652c3,0xc9))[_0x8561('0x46')](handleError(_0x3652c3,null));};exports['update']=function(_0xe0d21e,_0x16bda1){if(_0xe0d21e[_0x8561('0x4b')]['id']){delete _0xe0d21e[_0x8561('0x4b')]['id'];}return db[_0x8561('0x2d')][_0x8561('0x49')]({'where':{'id':_0xe0d21e[_0x8561('0x47')]['id']}})[_0x8561('0x28')](handleEntityNotFound(_0x16bda1,null))[_0x8561('0x28')](saveUpdates(_0xe0d21e[_0x8561('0x4b')],null))[_0x8561('0x28')](respondWithResult(_0x16bda1,null))[_0x8561('0x46')](handleError(_0x16bda1,null));};exports['destroy']=function(_0x31b27b,_0xef4f56){return db[_0x8561('0x2d')][_0x8561('0x49')]({'where':{'id':_0x31b27b[_0x8561('0x47')]['id']}})[_0x8561('0x28')](handleEntityNotFound(_0xef4f56,null))[_0x8561('0x28')](removeEntity(_0xef4f56,null))['catch'](handleError(_0xef4f56,null));};exports[_0x8561('0x4c')]=function(_0x15033c,_0x9e61d6,_0x418a90){var _0x251d01={};var _0x5286f3={};var _0x3599a0;var _0x16ad9a;return db[_0x8561('0x2d')][_0x8561('0x4d')]({'where':{'id':_0x15033c[_0x8561('0x47')]['id']}})[_0x8561('0x28')](handleEntityNotFound(_0x9e61d6,null))[_0x8561('0x28')](function(_0x248f7c){if(_0x248f7c){_0x3599a0=_0x248f7c;_0x5286f3[_0x8561('0x32')]=_[_0x8561('0x34')](db[_0x8561('0x4e')][_0x8561('0x2e')]);_0x5286f3[_0x8561('0x33')]=_[_0x8561('0x34')](_0x15033c['query']);_0x5286f3['filters']=_[_0x8561('0x36')](_0x5286f3['model'],_0x5286f3[_0x8561('0x33')]);_0x251d01[_0x8561('0x38')]=_[_0x8561('0x36')](_0x5286f3['model'],qs['fields'](_0x15033c[_0x8561('0x33')]['fields']));_0x251d01[_0x8561('0x38')]=_0x251d01['attributes'][_0x8561('0x39')]?_0x251d01['attributes']:_0x5286f3[_0x8561('0x32')];_0x251d01[_0x8561('0x3c')]=qs[_0x8561('0x3d')](_0x15033c[_0x8561('0x33')][_0x8561('0x3d')]);_0x251d01[_0x8561('0x3e')]=qs[_0x8561('0x35')](_[_0x8561('0x4f')](_0x15033c[_0x8561('0x33')],_0x5286f3['filters']));if(_0x15033c['query'][_0x8561('0x3f')]){_0x251d01[_0x8561('0x3e')]=_[_0x8561('0x40')](_0x251d01[_0x8561('0x3e')],{'$or':_[_0x8561('0x2c')](_0x251d01[_0x8561('0x38')],function(_0x228ac6){var _0x263d81={};_0x263d81[_0x228ac6]={'$like':'%'+_0x15033c['query'][_0x8561('0x3f')]+'%'};return _0x263d81;})});}_0x251d01=_[_0x8561('0x40')]({},_0x251d01,_0x15033c[_0x8561('0x50')]);return _0x3599a0['getFields'](_0x251d01);}})[_0x8561('0x28')](function(_0x4e9e78){if(_0x4e9e78){_0x16ad9a=_0x4e9e78[_0x8561('0x39')];if(!_0x15033c[_0x8561('0x33')][_0x8561('0x3a')](_0x8561('0x3b'))){_0x251d01[_0x8561('0x1f')]=qs[_0x8561('0x1f')](_0x15033c[_0x8561('0x33')][_0x8561('0x1f')]);_0x251d01['offset']=qs[_0x8561('0x21')](_0x15033c[_0x8561('0x33')][_0x8561('0x21')]);}return _0x3599a0[_0x8561('0x4c')](_0x251d01);}})[_0x8561('0x28')](function(_0x4d659f){if(_0x4d659f){return _0x4d659f?{'count':_0x16ad9a,'rows':_0x4d659f}:null;}})[_0x8561('0x28')](respondWithResult(_0x9e61d6,null))[_0x8561('0x46')](handleError(_0x9e61d6,null));};exports[_0x8561('0x51')]=function(_0x39f9c4,_0x2ce57a,_0x33a81d){var _0xc38c20={};var _0x33be01={};var _0x12fbdb;var _0x29ef9e;return db[_0x8561('0x2d')][_0x8561('0x4d')]({'where':{'id':_0x39f9c4[_0x8561('0x47')]['id']}})[_0x8561('0x28')](handleEntityNotFound(_0x2ce57a,null))[_0x8561('0x28')](function(_0xfd970a){if(_0xfd970a){_0x12fbdb=_0xfd970a;_0x33be01[_0x8561('0x32')]=_[_0x8561('0x34')](db['ServicenowField']['rawAttributes']);_0x33be01[_0x8561('0x33')]=_['keys'](_0x39f9c4['query']);_0x33be01[_0x8561('0x35')]=_[_0x8561('0x36')](_0x33be01['model'],_0x33be01[_0x8561('0x33')]);_0xc38c20[_0x8561('0x38')]=_['intersection'](_0x33be01[_0x8561('0x32')],qs[_0x8561('0x37')](_0x39f9c4[_0x8561('0x33')][_0x8561('0x37')]));_0xc38c20[_0x8561('0x38')]=_0xc38c20[_0x8561('0x38')][_0x8561('0x39')]?_0xc38c20[_0x8561('0x38')]:_0x33be01[_0x8561('0x32')];_0xc38c20[_0x8561('0x3c')]=qs['sort'](_0x39f9c4[_0x8561('0x33')][_0x8561('0x3d')]);_0xc38c20[_0x8561('0x3e')]=qs['filters'](_[_0x8561('0x4f')](_0x39f9c4[_0x8561('0x33')],_0x33be01['filters']));if(_0x39f9c4[_0x8561('0x33')][_0x8561('0x3f')]){_0xc38c20[_0x8561('0x3e')]=_[_0x8561('0x40')](_0xc38c20[_0x8561('0x3e')],{'$or':_['map'](_0xc38c20['attributes'],function(_0x373cbd){var _0x331695={};_0x331695[_0x373cbd]={'$like':'%'+_0x39f9c4['query']['filter']+'%'};return _0x331695;})});}_0xc38c20=_[_0x8561('0x40')]({},_0xc38c20,_0x39f9c4[_0x8561('0x50')]);return _0x12fbdb[_0x8561('0x51')](_0xc38c20);}})[_0x8561('0x28')](function(_0x1edeb9){if(_0x1edeb9){_0x29ef9e=_0x1edeb9[_0x8561('0x39')];if(!_0x39f9c4[_0x8561('0x33')][_0x8561('0x3a')](_0x8561('0x3b'))){_0xc38c20['limit']=qs['limit'](_0x39f9c4[_0x8561('0x33')][_0x8561('0x1f')]);_0xc38c20[_0x8561('0x21')]=qs[_0x8561('0x21')](_0x39f9c4[_0x8561('0x33')][_0x8561('0x21')]);}return _0x12fbdb[_0x8561('0x51')](_0xc38c20);}})[_0x8561('0x28')](function(_0xa8be6f){if(_0xa8be6f){return _0xa8be6f?{'count':_0x29ef9e,'rows':_0xa8be6f}:null;}})[_0x8561('0x28')](respondWithResult(_0x2ce57a,null))[_0x8561('0x46')](handleError(_0x2ce57a,null));};exports[_0x8561('0x52')]=function(_0x132656,_0x13ab61,_0x306a47){var _0x2341fe={};var _0x586c60={};var _0x526c15;var _0x368693;return db[_0x8561('0x2d')]['findOne']({'where':{'id':_0x132656[_0x8561('0x47')]['id']}})[_0x8561('0x28')](handleEntityNotFound(_0x13ab61,null))[_0x8561('0x28')](function(_0x6458d7){if(_0x6458d7){_0x526c15=_0x6458d7;_0x586c60[_0x8561('0x32')]=_[_0x8561('0x34')](db[_0x8561('0x4e')][_0x8561('0x2e')]);_0x586c60[_0x8561('0x33')]=_[_0x8561('0x34')](_0x132656[_0x8561('0x33')]);_0x586c60['filters']=_[_0x8561('0x36')](_0x586c60[_0x8561('0x32')],_0x586c60[_0x8561('0x33')]);_0x2341fe[_0x8561('0x38')]=_[_0x8561('0x36')](_0x586c60[_0x8561('0x32')],qs[_0x8561('0x37')](_0x132656[_0x8561('0x33')][_0x8561('0x37')]));_0x2341fe[_0x8561('0x38')]=_0x2341fe[_0x8561('0x38')][_0x8561('0x39')]?_0x2341fe[_0x8561('0x38')]:_0x586c60[_0x8561('0x32')];_0x2341fe[_0x8561('0x3c')]=qs[_0x8561('0x3d')](_0x132656[_0x8561('0x33')][_0x8561('0x3d')]);_0x2341fe[_0x8561('0x3e')]=qs[_0x8561('0x35')](_['pick'](_0x132656['query'],_0x586c60[_0x8561('0x35')]));if(_0x132656['query'][_0x8561('0x3f')]){_0x2341fe[_0x8561('0x3e')]=_[_0x8561('0x40')](_0x2341fe[_0x8561('0x3e')],{'$or':_[_0x8561('0x2c')](_0x2341fe['attributes'],function(_0x28aa04){var _0x4876da={};_0x4876da[_0x28aa04]={'$like':'%'+_0x132656[_0x8561('0x33')][_0x8561('0x3f')]+'%'};return _0x4876da;})});}_0x2341fe=_[_0x8561('0x40')]({},_0x2341fe,_0x132656['options']);return _0x526c15[_0x8561('0x52')](_0x2341fe);}})[_0x8561('0x28')](function(_0x2493a8){if(_0x2493a8){_0x368693=_0x2493a8[_0x8561('0x39')];if(!_0x132656[_0x8561('0x33')]['hasOwnProperty'](_0x8561('0x3b'))){_0x2341fe[_0x8561('0x1f')]=qs[_0x8561('0x1f')](_0x132656['query']['limit']);_0x2341fe[_0x8561('0x21')]=qs[_0x8561('0x21')](_0x132656[_0x8561('0x33')][_0x8561('0x21')]);}return _0x526c15[_0x8561('0x52')](_0x2341fe);}})[_0x8561('0x28')](function(_0x4a5c23){if(_0x4a5c23){return _0x4a5c23?{'count':_0x368693,'rows':_0x4a5c23}:null;}})[_0x8561('0x28')](respondWithResult(_0x13ab61,null))[_0x8561('0x46')](handleError(_0x13ab61,null));}; \ No newline at end of file +var _0xcc58=['getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','then','include','rows','params','keys','fields','length','find','catch','create','body','getFields','findOne','ServicenowField','order','nolimit','getSubjects'];(function(_0x1729f7,_0x1ea2f9){var _0x226d24=function(_0x2a84ae){while(--_0x2a84ae){_0x1729f7['push'](_0x1729f7['shift']());}};_0x226d24(++_0x1ea2f9);}(_0xcc58,0xe8));var _0x8cc5=function(_0x4211b7,_0x21e1a6){_0x4211b7=_0x4211b7-0x0;var _0x479384=_0xcc58[_0x4211b7];return _0x479384;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cc5('0x0'));var zipdir=require(_0x8cc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8cc5('0x2'));var BPromise=require(_0x8cc5('0x3'));var Mustache=require(_0x8cc5('0x4'));var util=require(_0x8cc5('0x5'));var path=require(_0x8cc5('0x6'));var sox=require(_0x8cc5('0x7'));var csv=require(_0x8cc5('0x8'));var ejs=require(_0x8cc5('0x9'));var fs=require('fs');var fs_extra=require(_0x8cc5('0xa'));var _=require(_0x8cc5('0xb'));var squel=require('squel');var crypto=require(_0x8cc5('0xc'));var jsforce=require(_0x8cc5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8cc5('0xe'));var authService=require(_0x8cc5('0xf'));var qs=require(_0x8cc5('0x10'));var as=require(_0x8cc5('0x11'));var hardwareService=require(_0x8cc5('0x12'));var logger=require(_0x8cc5('0x13'))(_0x8cc5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8cc5('0x15'));var db=require(_0x8cc5('0x16'))['db'];function respondWithStatusCode(_0x3b5e6f,_0x3e9a56){_0x3e9a56=_0x3e9a56||0xcc;return function(_0xff2303){if(_0xff2303){return _0x3b5e6f[_0x8cc5('0x17')](_0x3e9a56);}return _0x3b5e6f[_0x8cc5('0x18')](_0x3e9a56)[_0x8cc5('0x19')]();};}function respondWithResult(_0x3abbe3,_0x43918d){_0x43918d=_0x43918d||0xc8;return function(_0x4d7961){if(_0x4d7961){return _0x3abbe3['status'](_0x43918d)['json'](_0x4d7961);}};}function respondWithFilteredResult(_0x44996e,_0x241845){return function(_0x28d752){if(_0x28d752){var _0x5a6c72=typeof _0x241845['offset']===_0x8cc5('0x1a')&&typeof _0x241845[_0x8cc5('0x1b')]===_0x8cc5('0x1a');var _0x3c4325=_0x28d752[_0x8cc5('0x1c')];var _0x46ec2d=_0x5a6c72?0x0:_0x241845[_0x8cc5('0x1d')];var _0x399bc4=_0x5a6c72?_0x28d752[_0x8cc5('0x1c')]:_0x241845[_0x8cc5('0x1d')]+_0x241845[_0x8cc5('0x1b')];var _0x38ff12;if(_0x399bc4>=_0x3c4325){_0x399bc4=_0x3c4325;_0x38ff12=0xc8;}else{_0x38ff12=0xce;}_0x44996e[_0x8cc5('0x18')](_0x38ff12);return _0x44996e['set']('Content-Range',_0x46ec2d+'-'+_0x399bc4+'/'+_0x3c4325)[_0x8cc5('0x1e')](_0x28d752);}return null;};}function patchUpdates(_0x4d04a1){return function(_0x7f05cc){try{jsonpatch[_0x8cc5('0x1f')](_0x7f05cc,_0x4d04a1,!![]);}catch(_0x4069a8){return BPromise[_0x8cc5('0x20')](_0x4069a8);}return _0x7f05cc[_0x8cc5('0x21')]();};}function saveUpdates(_0x37b044,_0x4cd6c2){return function(_0x1be0de){if(_0x1be0de){return _0x1be0de[_0x8cc5('0x22')](_0x37b044)['then'](function(_0x125542){return _0x125542;});}return null;};}function removeEntity(_0x1d2bb4,_0xa92c2d){return function(_0x232552){if(_0x232552){return _0x232552[_0x8cc5('0x23')]()['then'](function(){_0x1d2bb4[_0x8cc5('0x18')](0xcc)[_0x8cc5('0x19')]();});}};}function handleEntityNotFound(_0x384fca,_0xf539ee){return function(_0x4706c4){if(!_0x4706c4){_0x384fca[_0x8cc5('0x17')](0x194);}return _0x4706c4;};}function handleError(_0x2c7bee,_0x5bf983){_0x5bf983=_0x5bf983||0x1f4;return function(_0x23bd45){logger[_0x8cc5('0x24')](_0x23bd45[_0x8cc5('0x25')]);if(_0x23bd45['name']){delete _0x23bd45['name'];}_0x2c7bee[_0x8cc5('0x18')](_0x5bf983)['send'](_0x23bd45);};}exports[_0x8cc5('0x26')]=function(_0x8b2ae2,_0x17b359){var _0x39440a={},_0x1137db={},_0xddfa52={'count':0x0,'rows':[]};var _0x5a442f=_[_0x8cc5('0x27')](db['ServicenowConfiguration'][_0x8cc5('0x28')],function(_0x129dd3){return{'name':_0x129dd3[_0x8cc5('0x29')],'type':_0x129dd3[_0x8cc5('0x2a')][_0x8cc5('0x2b')]};});_0x1137db[_0x8cc5('0x2c')]=_[_0x8cc5('0x27')](_0x5a442f,_0x8cc5('0x2d'));_0x1137db[_0x8cc5('0x2e')]=_['keys'](_0x8b2ae2['query']);_0x1137db[_0x8cc5('0x2f')]=_[_0x8cc5('0x30')](_0x1137db['model'],_0x1137db[_0x8cc5('0x2e')]);_0x39440a[_0x8cc5('0x31')]=_[_0x8cc5('0x30')](_0x1137db['model'],qs['fields'](_0x8b2ae2['query']['fields']));_0x39440a[_0x8cc5('0x31')]=_0x39440a['attributes']['length']?_0x39440a[_0x8cc5('0x31')]:_0x1137db[_0x8cc5('0x2c')];if(!_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x32')]('nolimit')){_0x39440a[_0x8cc5('0x1b')]=qs[_0x8cc5('0x1b')](_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x1b')]);_0x39440a[_0x8cc5('0x1d')]=qs[_0x8cc5('0x1d')](_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x1d')]);}_0x39440a['order']=qs[_0x8cc5('0x33')](_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x33')]);_0x39440a[_0x8cc5('0x34')]=qs[_0x8cc5('0x2f')](_[_0x8cc5('0x35')](_0x8b2ae2['query'],_0x1137db[_0x8cc5('0x2f')]),_0x5a442f);if(_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x36')]){_0x39440a[_0x8cc5('0x34')]=_[_0x8cc5('0x37')](_0x39440a['where'],{'$or':_[_0x8cc5('0x27')](_0x5a442f,function(_0x12ebc9){if(_0x12ebc9[_0x8cc5('0x2a')]!==_0x8cc5('0x38')){var _0xf2ef98={};_0xf2ef98[_0x12ebc9['name']]={'$like':'%'+_0x8b2ae2[_0x8cc5('0x2e')][_0x8cc5('0x36')]+'%'};return _0xf2ef98;}})});}_0x39440a=_['merge']({},_0x39440a,_0x8b2ae2[_0x8cc5('0x39')]);var _0x148810={'where':_0x39440a[_0x8cc5('0x34')]};return db[_0x8cc5('0x3a')]['count'](_0x148810)[_0x8cc5('0x3b')](function(_0x332d1b){_0xddfa52[_0x8cc5('0x1c')]=_0x332d1b;if(_0x8b2ae2['query']['includeAll']){_0x39440a[_0x8cc5('0x3c')]=[{'all':!![]}];}return db[_0x8cc5('0x3a')]['findAll'](_0x39440a);})[_0x8cc5('0x3b')](function(_0x164bc6){_0xddfa52[_0x8cc5('0x3d')]=_0x164bc6;return _0xddfa52;})[_0x8cc5('0x3b')](respondWithFilteredResult(_0x17b359,_0x39440a))['catch'](handleError(_0x17b359,null));};exports['show']=function(_0x3e5c5f,_0x1abeaf){var _0x296ea1={'raw':![],'where':{'id':_0x3e5c5f[_0x8cc5('0x3e')]['id']}},_0x34d198={};_0x34d198['model']=_['keys'](db['ServicenowConfiguration'][_0x8cc5('0x28')]);_0x34d198[_0x8cc5('0x2e')]=_[_0x8cc5('0x3f')](_0x3e5c5f[_0x8cc5('0x2e')]);_0x34d198[_0x8cc5('0x2f')]=_[_0x8cc5('0x30')](_0x34d198['model'],_0x34d198[_0x8cc5('0x2e')]);_0x296ea1[_0x8cc5('0x31')]=_[_0x8cc5('0x30')](_0x34d198[_0x8cc5('0x2c')],qs[_0x8cc5('0x40')](_0x3e5c5f[_0x8cc5('0x2e')][_0x8cc5('0x40')]));_0x296ea1[_0x8cc5('0x31')]=_0x296ea1[_0x8cc5('0x31')][_0x8cc5('0x41')]?_0x296ea1[_0x8cc5('0x31')]:_0x34d198['model'];if(_0x3e5c5f[_0x8cc5('0x2e')]['includeAll']){_0x296ea1[_0x8cc5('0x3c')]=[{'all':!![]}];}_0x296ea1=_[_0x8cc5('0x37')]({},_0x296ea1,_0x3e5c5f['options']);return db['ServicenowConfiguration'][_0x8cc5('0x42')](_0x296ea1)[_0x8cc5('0x3b')](handleEntityNotFound(_0x1abeaf,null))['then'](respondWithResult(_0x1abeaf,null))[_0x8cc5('0x43')](handleError(_0x1abeaf,null));};exports[_0x8cc5('0x44')]=function(_0x38acc1,_0x38c281){return db[_0x8cc5('0x3a')][_0x8cc5('0x44')](_0x38acc1['body'],{})[_0x8cc5('0x3b')](respondWithResult(_0x38c281,0xc9))[_0x8cc5('0x43')](handleError(_0x38c281,null));};exports['update']=function(_0x65318d,_0x34e1af){if(_0x65318d[_0x8cc5('0x45')]['id']){delete _0x65318d[_0x8cc5('0x45')]['id'];}return db[_0x8cc5('0x3a')][_0x8cc5('0x42')]({'where':{'id':_0x65318d['params']['id']}})[_0x8cc5('0x3b')](handleEntityNotFound(_0x34e1af,null))[_0x8cc5('0x3b')](saveUpdates(_0x65318d[_0x8cc5('0x45')],null))['then'](respondWithResult(_0x34e1af,null))[_0x8cc5('0x43')](handleError(_0x34e1af,null));};exports[_0x8cc5('0x23')]=function(_0x35d057,_0x4c30df){return db[_0x8cc5('0x3a')]['find']({'where':{'id':_0x35d057[_0x8cc5('0x3e')]['id']}})[_0x8cc5('0x3b')](handleEntityNotFound(_0x4c30df,null))['then'](removeEntity(_0x4c30df,null))[_0x8cc5('0x43')](handleError(_0x4c30df,null));};exports[_0x8cc5('0x46')]=function(_0x52e210,_0x3978bf,_0x18eaa4){var _0x2c226d={};var _0x1864be={};var _0x133acd;var _0x5724e8;return db['ServicenowConfiguration'][_0x8cc5('0x47')]({'where':{'id':_0x52e210['params']['id']}})[_0x8cc5('0x3b')](handleEntityNotFound(_0x3978bf,null))['then'](function(_0x3efd60){if(_0x3efd60){_0x133acd=_0x3efd60;_0x1864be['model']=_['keys'](db[_0x8cc5('0x48')]['rawAttributes']);_0x1864be['query']=_[_0x8cc5('0x3f')](_0x52e210[_0x8cc5('0x2e')]);_0x1864be[_0x8cc5('0x2f')]=_[_0x8cc5('0x30')](_0x1864be[_0x8cc5('0x2c')],_0x1864be[_0x8cc5('0x2e')]);_0x2c226d[_0x8cc5('0x31')]=_['intersection'](_0x1864be['model'],qs[_0x8cc5('0x40')](_0x52e210[_0x8cc5('0x2e')]['fields']));_0x2c226d[_0x8cc5('0x31')]=_0x2c226d['attributes'][_0x8cc5('0x41')]?_0x2c226d[_0x8cc5('0x31')]:_0x1864be[_0x8cc5('0x2c')];_0x2c226d[_0x8cc5('0x49')]=qs[_0x8cc5('0x33')](_0x52e210['query'][_0x8cc5('0x33')]);_0x2c226d[_0x8cc5('0x34')]=qs[_0x8cc5('0x2f')](_['pick'](_0x52e210[_0x8cc5('0x2e')],_0x1864be['filters']));if(_0x52e210['query'][_0x8cc5('0x36')]){_0x2c226d[_0x8cc5('0x34')]=_['merge'](_0x2c226d[_0x8cc5('0x34')],{'$or':_[_0x8cc5('0x27')](_0x2c226d['attributes'],function(_0xcd0c86){var _0x1ad82b={};_0x1ad82b[_0xcd0c86]={'$like':'%'+_0x52e210[_0x8cc5('0x2e')][_0x8cc5('0x36')]+'%'};return _0x1ad82b;})});}_0x2c226d=_[_0x8cc5('0x37')]({},_0x2c226d,_0x52e210['options']);return _0x133acd['getFields'](_0x2c226d);}})[_0x8cc5('0x3b')](function(_0x24522e){if(_0x24522e){_0x5724e8=_0x24522e[_0x8cc5('0x41')];if(!_0x52e210['query']['hasOwnProperty'](_0x8cc5('0x4a'))){_0x2c226d[_0x8cc5('0x1b')]=qs[_0x8cc5('0x1b')](_0x52e210[_0x8cc5('0x2e')][_0x8cc5('0x1b')]);_0x2c226d[_0x8cc5('0x1d')]=qs[_0x8cc5('0x1d')](_0x52e210[_0x8cc5('0x2e')][_0x8cc5('0x1d')]);}return _0x133acd[_0x8cc5('0x46')](_0x2c226d);}})[_0x8cc5('0x3b')](function(_0x10571e){if(_0x10571e){return _0x10571e?{'count':_0x5724e8,'rows':_0x10571e}:null;}})['then'](respondWithResult(_0x3978bf,null))['catch'](handleError(_0x3978bf,null));};exports['getSubjects']=function(_0x512e7b,_0x5291e3,_0x4cd223){var _0x2deed5={};var _0xedd30c={};var _0x21d54d;var _0x4ff80d;return db[_0x8cc5('0x3a')][_0x8cc5('0x47')]({'where':{'id':_0x512e7b[_0x8cc5('0x3e')]['id']}})[_0x8cc5('0x3b')](handleEntityNotFound(_0x5291e3,null))['then'](function(_0x4183b5){if(_0x4183b5){_0x21d54d=_0x4183b5;_0xedd30c['model']=_[_0x8cc5('0x3f')](db[_0x8cc5('0x48')][_0x8cc5('0x28')]);_0xedd30c[_0x8cc5('0x2e')]=_[_0x8cc5('0x3f')](_0x512e7b[_0x8cc5('0x2e')]);_0xedd30c[_0x8cc5('0x2f')]=_[_0x8cc5('0x30')](_0xedd30c['model'],_0xedd30c['query']);_0x2deed5[_0x8cc5('0x31')]=_[_0x8cc5('0x30')](_0xedd30c[_0x8cc5('0x2c')],qs[_0x8cc5('0x40')](_0x512e7b[_0x8cc5('0x2e')]['fields']));_0x2deed5[_0x8cc5('0x31')]=_0x2deed5[_0x8cc5('0x31')][_0x8cc5('0x41')]?_0x2deed5[_0x8cc5('0x31')]:_0xedd30c['model'];_0x2deed5[_0x8cc5('0x49')]=qs['sort'](_0x512e7b[_0x8cc5('0x2e')]['sort']);_0x2deed5['where']=qs[_0x8cc5('0x2f')](_[_0x8cc5('0x35')](_0x512e7b[_0x8cc5('0x2e')],_0xedd30c[_0x8cc5('0x2f')]));if(_0x512e7b[_0x8cc5('0x2e')][_0x8cc5('0x36')]){_0x2deed5[_0x8cc5('0x34')]=_['merge'](_0x2deed5[_0x8cc5('0x34')],{'$or':_['map'](_0x2deed5[_0x8cc5('0x31')],function(_0x56cabe){var _0x5a3ad4={};_0x5a3ad4[_0x56cabe]={'$like':'%'+_0x512e7b[_0x8cc5('0x2e')]['filter']+'%'};return _0x5a3ad4;})});}_0x2deed5=_[_0x8cc5('0x37')]({},_0x2deed5,_0x512e7b[_0x8cc5('0x39')]);return _0x21d54d[_0x8cc5('0x4b')](_0x2deed5);}})[_0x8cc5('0x3b')](function(_0x5872ad){if(_0x5872ad){_0x4ff80d=_0x5872ad[_0x8cc5('0x41')];if(!_0x512e7b[_0x8cc5('0x2e')]['hasOwnProperty'](_0x8cc5('0x4a'))){_0x2deed5[_0x8cc5('0x1b')]=qs[_0x8cc5('0x1b')](_0x512e7b[_0x8cc5('0x2e')][_0x8cc5('0x1b')]);_0x2deed5['offset']=qs[_0x8cc5('0x1d')](_0x512e7b[_0x8cc5('0x2e')][_0x8cc5('0x1d')]);}return _0x21d54d[_0x8cc5('0x4b')](_0x2deed5);}})['then'](function(_0x30a14e){if(_0x30a14e){return _0x30a14e?{'count':_0x4ff80d,'rows':_0x30a14e}:null;}})[_0x8cc5('0x3b')](respondWithResult(_0x5291e3,null))[_0x8cc5('0x43')](handleError(_0x5291e3,null));};exports['getDescriptions']=function(_0x17f7ef,_0x5aafed,_0x107328){var _0x4402d3={};var _0x3950a4={};var _0x2ac5df;var _0x352933;return db[_0x8cc5('0x3a')][_0x8cc5('0x47')]({'where':{'id':_0x17f7ef['params']['id']}})[_0x8cc5('0x3b')](handleEntityNotFound(_0x5aafed,null))[_0x8cc5('0x3b')](function(_0x4825f0){if(_0x4825f0){_0x2ac5df=_0x4825f0;_0x3950a4[_0x8cc5('0x2c')]=_['keys'](db[_0x8cc5('0x48')][_0x8cc5('0x28')]);_0x3950a4[_0x8cc5('0x2e')]=_[_0x8cc5('0x3f')](_0x17f7ef[_0x8cc5('0x2e')]);_0x3950a4[_0x8cc5('0x2f')]=_['intersection'](_0x3950a4[_0x8cc5('0x2c')],_0x3950a4[_0x8cc5('0x2e')]);_0x4402d3[_0x8cc5('0x31')]=_[_0x8cc5('0x30')](_0x3950a4[_0x8cc5('0x2c')],qs[_0x8cc5('0x40')](_0x17f7ef[_0x8cc5('0x2e')][_0x8cc5('0x40')]));_0x4402d3[_0x8cc5('0x31')]=_0x4402d3[_0x8cc5('0x31')]['length']?_0x4402d3['attributes']:_0x3950a4['model'];_0x4402d3[_0x8cc5('0x49')]=qs[_0x8cc5('0x33')](_0x17f7ef[_0x8cc5('0x2e')][_0x8cc5('0x33')]);_0x4402d3['where']=qs[_0x8cc5('0x2f')](_['pick'](_0x17f7ef[_0x8cc5('0x2e')],_0x3950a4[_0x8cc5('0x2f')]));if(_0x17f7ef[_0x8cc5('0x2e')][_0x8cc5('0x36')]){_0x4402d3[_0x8cc5('0x34')]=_[_0x8cc5('0x37')](_0x4402d3[_0x8cc5('0x34')],{'$or':_[_0x8cc5('0x27')](_0x4402d3['attributes'],function(_0xf02578){var _0x4a17b8={};_0x4a17b8[_0xf02578]={'$like':'%'+_0x17f7ef[_0x8cc5('0x2e')][_0x8cc5('0x36')]+'%'};return _0x4a17b8;})});}_0x4402d3=_[_0x8cc5('0x37')]({},_0x4402d3,_0x17f7ef[_0x8cc5('0x39')]);return _0x2ac5df[_0x8cc5('0x4c')](_0x4402d3);}})[_0x8cc5('0x3b')](function(_0x584f67){if(_0x584f67){_0x352933=_0x584f67['length'];if(!_0x17f7ef['query'][_0x8cc5('0x32')](_0x8cc5('0x4a'))){_0x4402d3[_0x8cc5('0x1b')]=qs[_0x8cc5('0x1b')](_0x17f7ef[_0x8cc5('0x2e')][_0x8cc5('0x1b')]);_0x4402d3[_0x8cc5('0x1d')]=qs[_0x8cc5('0x1d')](_0x17f7ef['query']['offset']);}return _0x2ac5df[_0x8cc5('0x4c')](_0x4402d3);}})['then'](function(_0x35783a){if(_0x35783a){return _0x35783a?{'count':_0x352933,'rows':_0x35783a}:null;}})[_0x8cc5('0x3b')](respondWithResult(_0x5aafed,null))[_0x8cc5('0x43')](handleError(_0x5aafed,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 33b130e..1f57763 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 _0x1219=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x496bb7,_0x32b9fa){var _0x589721=function(_0x4ca56b){while(--_0x4ca56b){_0x496bb7['push'](_0x496bb7['shift']());}};_0x589721(++_0x32b9fa);}(_0x1219,0x17c));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var logger=require(_0x9121('0x2'))(_0x9121('0x3'));var moment=require(_0x9121('0x4'));var BPromise=require('bluebird');var rp=require(_0x9121('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9121('0x6'));var config=require(_0x9121('0x7'));var attributes=require(_0x9121('0x8'));module[_0x9121('0x9')]=function(_0x420b62,_0x430583){return _0x420b62[_0x9121('0xa')](_0x9121('0xb'),attributes,{'tableName':_0x9121('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2f3=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xb2f3[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var attributes=require(_0x3b2f('0x9'));module[_0x3b2f('0xa')]=function(_0x1879cf,_0xa38042){return _0x1879cf[_0x3b2f('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0x3b2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index bd6ef3b..6d91dcd 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 _0x124a=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x59c8ac,_0x3b5218){var _0x4d08cb=function(_0x2b09a6){while(--_0x2b09a6){_0x59c8ac['push'](_0x59c8ac['shift']());}};_0x4d08cb(++_0x3b5218);}(_0x124a,0x171));var _0xa124=function(_0x215393,_0x4c406d){_0x215393=_0x215393-0x0;var _0x595198=_0x124a[_0x215393];return _0x595198;};'use strict';var _=require(_0xa124('0x0'));var util=require(_0xa124('0x1'));var moment=require(_0xa124('0x2'));var BPromise=require(_0xa124('0x3'));var rs=require(_0xa124('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa124('0x5'));var logger=require(_0xa124('0x6'))('rpc');var config=require(_0xa124('0x7'));var jayson=require(_0xa124('0x8'));var client=jayson[_0xa124('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421685,_0x4d1d7f,_0x3ab306){return new BPromise(function(_0x2802bf,_0x442d4f){return client[_0xa124('0xa')](_0x421685,_0x3ab306)[_0xa124('0xb')](function(_0x253ef8){logger[_0xa124('0xc')](_0xa124('0xd'),_0x4d1d7f,_0xa124('0xe'));logger[_0xa124('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4d1d7f,_0xa124('0xe'),JSON[_0xa124('0x10')](_0x253ef8));if(_0x253ef8[_0xa124('0x11')]){if(_0x253ef8[_0xa124('0x11')]['code']===0x1f4){logger['error'](_0xa124('0xd'),_0x4d1d7f,_0x253ef8[_0xa124('0x11')][_0xa124('0x12')]);return _0x442d4f(_0x253ef8[_0xa124('0x11')]['message']);}logger[_0xa124('0x11')](_0xa124('0xd'),_0x4d1d7f,_0x253ef8[_0xa124('0x11')]['message']);return _0x2802bf(_0x253ef8[_0xa124('0x11')][_0xa124('0x12')]);}else{logger[_0xa124('0xc')](_0xa124('0xd'),_0x4d1d7f,'request\x20sent');_0x2802bf(_0x253ef8[_0xa124('0x13')][_0xa124('0x12')]);}})['catch'](function(_0x44db8c){logger[_0xa124('0x11')](_0xa124('0xd'),_0x4d1d7f,_0x44db8c);_0x442d4f(_0x44db8c);});});} \ No newline at end of file +var _0xf31b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5d7030,_0x5624b4){var _0x1f855d=function(_0x1e6741){while(--_0x1e6741){_0x5d7030['push'](_0x5d7030['shift']());}};_0x1f855d(++_0x5624b4);}(_0xf31b,0x1a0));var _0xbf31=function(_0x2e33c9,_0x498549){_0x2e33c9=_0x2e33c9-0x0;var _0x12fbb4=_0xf31b[_0x2e33c9];return _0x12fbb4;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var moment=require(_0xbf31('0x2'));var BPromise=require(_0xbf31('0x3'));var rs=require(_0xbf31('0x4'));var fs=require('fs');var Redis=require(_0xbf31('0x5'));var db=require(_0xbf31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf31('0x7'))(_0xbf31('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf6c0f,_0xde14a4,_0x547919){return new BPromise(function(_0x4d02dd,_0x3da1a2){return client['request'](_0xcf6c0f,_0x547919)[_0xbf31('0xa')](function(_0x23d576){logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));logger[_0xbf31('0xe')](_0xbf31('0xf'),_0xde14a4,_0xbf31('0xd'),JSON[_0xbf31('0x10')](_0x23d576));if(_0x23d576[_0xbf31('0x11')]){if(_0x23d576[_0xbf31('0x11')][_0xbf31('0x12')]===0x1f4){logger[_0xbf31('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xde14a4,_0x23d576['error']['message']);return _0x3da1a2(_0x23d576['error'][_0xbf31('0x13')]);}logger[_0xbf31('0x11')](_0xbf31('0xc'),_0xde14a4,_0x23d576[_0xbf31('0x11')]['message']);return _0x4d02dd(_0x23d576['error'][_0xbf31('0x13')]);}else{logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));_0x4d02dd(_0x23d576[_0xbf31('0x14')]['message']);}})[_0xbf31('0x15')](function(_0x5e9b58){logger['error'](_0xbf31('0xc'),_0xde14a4,_0x5e9b58);_0x3da1a2(_0x5e9b58);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 2268f59..c0a93b0 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 _0xba9f=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','isAuthenticated','show','create'];(function(_0x35bc30,_0x5d9fc3){var _0x5961fc=function(_0xa071e5){while(--_0xa071e5){_0x35bc30['push'](_0x35bc30['shift']());}};_0x5961fc(++_0x5d9fc3);}(_0xba9f,0x1a7));var _0xfba9=function(_0x198fd1,_0x3fb263){_0x198fd1=_0x198fd1-0x0;var _0x55f44c=_0xba9f[_0x198fd1];return _0x55f44c;};'use strict';var multer=require(_0xfba9('0x0'));var util=require(_0xfba9('0x1'));var path=require('path');var timeout=require(_0xfba9('0x2'));var express=require(_0xfba9('0x3'));var router=express[_0xfba9('0x4')]();var fs_extra=require(_0xfba9('0x5'));var auth=require(_0xfba9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfba9('0x7'));var controller=require(_0xfba9('0x8'));router[_0xfba9('0x9')]('/',auth['isAuthenticated'](),controller[_0xfba9('0xa')]);router[_0xfba9('0x9')]('/:id',auth[_0xfba9('0xb')](),controller[_0xfba9('0xc')]);router['post']('/',auth[_0xfba9('0xb')](),controller[_0xfba9('0xd')]);router[_0xfba9('0xe')](_0xfba9('0xf'),auth[_0xfba9('0xb')](),controller[_0xfba9('0x10')]);router[_0xfba9('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfba9('0x12')]=router; \ No newline at end of file +var _0x1fe3=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x510000,_0x3ad84a){var _0x38f83b=function(_0x1c5a25){while(--_0x1c5a25){_0x510000['push'](_0x510000['shift']());}};_0x38f83b(++_0x3ad84a);}(_0x1fe3,0x159));var _0x31fe=function(_0x4a6070,_0x18512b){_0x4a6070=_0x4a6070-0x0;var _0x4ae9cb=_0x1fe3[_0x4a6070];return _0x4ae9cb;};'use strict';var multer=require(_0x31fe('0x0'));var util=require(_0x31fe('0x1'));var path=require(_0x31fe('0x2'));var timeout=require(_0x31fe('0x3'));var express=require(_0x31fe('0x4'));var router=express[_0x31fe('0x5')]();var fs_extra=require(_0x31fe('0x6'));var auth=require(_0x31fe('0x7'));var interaction=require(_0x31fe('0x8'));var config=require(_0x31fe('0x9'));var controller=require('./intServicenowField.controller');router[_0x31fe('0xa')]('/',auth[_0x31fe('0xb')](),controller['index']);router['get'](_0x31fe('0xc'),auth[_0x31fe('0xb')](),controller[_0x31fe('0xd')]);router[_0x31fe('0xe')]('/',auth[_0x31fe('0xb')](),controller[_0x31fe('0xf')]);router[_0x31fe('0x10')](_0x31fe('0xc'),auth['isAuthenticated'](),controller[_0x31fe('0x11')]);router['delete'](_0x31fe('0xc'),auth['isAuthenticated'](),controller[_0x31fe('0x12')]);module[_0x31fe('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ab04530..1c88c1c 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 _0x3e88=['STRING','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x47b226,_0xf5d1fe){var _0x5d5b00=function(_0x136620){while(--_0x136620){_0x47b226['push'](_0x47b226['shift']());}};_0x5d5b00(++_0xf5d1fe);}(_0x3e88,0x1e2));var _0x83e8=function(_0x4333f5,_0x149295){_0x4333f5=_0x4333f5-0x0;var _0x5672e0=_0x3e88[_0x4333f5];return _0x5672e0;};'use strict';var Sequelize=require('sequelize');module[_0x83e8('0x0')]={'type':{'type':Sequelize[_0x83e8('0x1')](_0x83e8('0x2'),'variable',_0x83e8('0x3'),_0x83e8('0x4'),_0x83e8('0x5')),'defaultValue':_0x83e8('0x2')},'content':{'type':Sequelize[_0x83e8('0x6')]},'key':{'type':Sequelize[_0x83e8('0x6')]},'keyType':{'type':Sequelize[_0x83e8('0x1')](_0x83e8('0x2'),'variable',_0x83e8('0x3'))},'keyContent':{'type':Sequelize[_0x83e8('0x6')]},'idField':{'type':Sequelize[_0x83e8('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x83e8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83e8('0x6')]}}; \ No newline at end of file +var _0x3402=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x467095,_0x26a3b3){var _0x541b8d=function(_0xa8e279){while(--_0xa8e279){_0x467095['push'](_0x467095['shift']());}};_0x541b8d(++_0x26a3b3);}(_0x3402,0x18b));var _0x2340=function(_0xc43672,_0x178efd){_0xc43672=_0xc43672-0x0;var _0x390944=_0x3402[_0xc43672];return _0x390944;};'use strict';var Sequelize=require(_0x2340('0x0'));module[_0x2340('0x1')]={'type':{'type':Sequelize[_0x2340('0x2')]('string',_0x2340('0x3'),_0x2340('0x4'),_0x2340('0x5'),'picklist'),'defaultValue':_0x2340('0x6')},'content':{'type':Sequelize[_0x2340('0x7')]},'key':{'type':Sequelize[_0x2340('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2340('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2340('0x7')]},'idField':{'type':Sequelize[_0x2340('0x7')]},'nameField':{'type':Sequelize[_0x2340('0x7')]},'customField':{'type':Sequelize[_0x2340('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2340('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 27f3f06..a2ab7d1 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 _0x56c3=['moment','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','ServicenowField','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3abe6a,_0xdd7b1a){var _0x2fc39e=function(_0x13911e){while(--_0x13911e){_0x3abe6a['push'](_0x3abe6a['shift']());}};_0x2fc39e(++_0xdd7b1a);}(_0x56c3,0x1b2));var _0x356c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x356c('0x0'));var rimraf=require(_0x356c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x356c('0x2'));var rp=require(_0x356c('0x3'));var moment=require(_0x356c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x356c('0x5'));var path=require(_0x356c('0x6'));var sox=require('sox');var csv=require(_0x356c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x356c('0x8'));var _=require(_0x356c('0x9'));var squel=require(_0x356c('0xa'));var crypto=require(_0x356c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x356c('0x7'));var querystring=require(_0x356c('0xc'));var Papa=require(_0x356c('0xd'));var Redis=require(_0x356c('0xe'));var authService=require(_0x356c('0xf'));var qs=require(_0x356c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x356c('0x11'));var logger=require(_0x356c('0x12'))(_0x356c('0x13'));var utils=require(_0x356c('0x14'));var config=require(_0x356c('0x15'));var licenseUtil=require(_0x356c('0x16'));var db=require(_0x356c('0x17'))['db'];function respondWithStatusCode(_0x2272f2,_0x523b28){_0x523b28=_0x523b28||0xcc;return function(_0x5837b8){if(_0x5837b8){return _0x2272f2[_0x356c('0x18')](_0x523b28);}return _0x2272f2['status'](_0x523b28)['end']();};}function respondWithResult(_0x5798c1,_0x401626){_0x401626=_0x401626||0xc8;return function(_0x388d0d){if(_0x388d0d){return _0x5798c1[_0x356c('0x19')](_0x401626)[_0x356c('0x1a')](_0x388d0d);}};}function respondWithFilteredResult(_0x1c045c,_0x34adf4){return function(_0x159f19){if(_0x159f19){var _0x3eace8=typeof _0x34adf4[_0x356c('0x1b')]===_0x356c('0x1c')&&typeof _0x34adf4[_0x356c('0x1d')]===_0x356c('0x1c');var _0x456cb4=_0x159f19[_0x356c('0x1e')];var _0x2197d7=_0x3eace8?0x0:_0x34adf4[_0x356c('0x1b')];var _0x5b8c1e=_0x3eace8?_0x159f19['count']:_0x34adf4[_0x356c('0x1b')]+_0x34adf4[_0x356c('0x1d')];var _0xbcf29d;if(_0x5b8c1e>=_0x456cb4){_0x5b8c1e=_0x456cb4;_0xbcf29d=0xc8;}else{_0xbcf29d=0xce;}_0x1c045c['status'](_0xbcf29d);return _0x1c045c['set'](_0x356c('0x1f'),_0x2197d7+'-'+_0x5b8c1e+'/'+_0x456cb4)[_0x356c('0x1a')](_0x159f19);}return null;};}function patchUpdates(_0x42c172){return function(_0x206d61){try{jsonpatch[_0x356c('0x20')](_0x206d61,_0x42c172,!![]);}catch(_0x48bf8e){return BPromise[_0x356c('0x21')](_0x48bf8e);}return _0x206d61[_0x356c('0x22')]();};}function saveUpdates(_0x39218d,_0x386951){return function(_0x45788d){if(_0x45788d){return _0x45788d[_0x356c('0x23')](_0x39218d)[_0x356c('0x24')](function(_0x5434eb){return _0x5434eb;});}return null;};}function removeEntity(_0x4c3e8f,_0x4c4459){return function(_0x4593af){if(_0x4593af){return _0x4593af[_0x356c('0x25')]()[_0x356c('0x24')](function(){_0x4c3e8f[_0x356c('0x19')](0xcc)[_0x356c('0x26')]();});}};}function handleEntityNotFound(_0x51739b,_0x168ea9){return function(_0x3b90e8){if(!_0x3b90e8){_0x51739b[_0x356c('0x18')](0x194);}return _0x3b90e8;};}function handleError(_0x19cc1a,_0x175be4){_0x175be4=_0x175be4||0x1f4;return function(_0x4fe566){logger[_0x356c('0x27')](_0x4fe566[_0x356c('0x28')]);if(_0x4fe566['name']){delete _0x4fe566[_0x356c('0x29')];}_0x19cc1a[_0x356c('0x19')](_0x175be4)['send'](_0x4fe566);};}exports[_0x356c('0x2a')]=function(_0x56f6a3,_0x17d140){var _0x3dd961={},_0x3281ec={},_0x4730bc={'count':0x0,'rows':[]};var _0x4ab01d=_['map'](db[_0x356c('0x2b')]['rawAttributes'],function(_0x26011a){return{'name':_0x26011a[_0x356c('0x2c')],'type':_0x26011a[_0x356c('0x2d')][_0x356c('0x2e')]};});_0x3281ec['model']=_[_0x356c('0x2f')](_0x4ab01d,'name');_0x3281ec[_0x356c('0x30')]=_[_0x356c('0x31')](_0x56f6a3[_0x356c('0x30')]);_0x3281ec[_0x356c('0x32')]=_[_0x356c('0x33')](_0x3281ec[_0x356c('0x34')],_0x3281ec[_0x356c('0x30')]);_0x3dd961[_0x356c('0x35')]=_[_0x356c('0x33')](_0x3281ec['model'],qs[_0x356c('0x36')](_0x56f6a3['query']['fields']));_0x3dd961[_0x356c('0x35')]=_0x3dd961[_0x356c('0x35')][_0x356c('0x37')]?_0x3dd961[_0x356c('0x35')]:_0x3281ec['model'];if(!_0x56f6a3['query'][_0x356c('0x38')]('nolimit')){_0x3dd961[_0x356c('0x1d')]=qs['limit'](_0x56f6a3['query']['limit']);_0x3dd961[_0x356c('0x1b')]=qs[_0x356c('0x1b')](_0x56f6a3[_0x356c('0x30')][_0x356c('0x1b')]);}_0x3dd961[_0x356c('0x39')]=qs[_0x356c('0x3a')](_0x56f6a3['query'][_0x356c('0x3a')]);_0x3dd961['where']=qs[_0x356c('0x32')](_[_0x356c('0x3b')](_0x56f6a3[_0x356c('0x30')],_0x3281ec[_0x356c('0x32')]),_0x4ab01d);if(_0x56f6a3['query']['filter']){_0x3dd961['where']=_[_0x356c('0x3c')](_0x3dd961[_0x356c('0x3d')],{'$or':_[_0x356c('0x2f')](_0x4ab01d,function(_0x70872c){if(_0x70872c[_0x356c('0x2d')]!==_0x356c('0x3e')){var _0x49470e={};_0x49470e[_0x70872c['name']]={'$like':'%'+_0x56f6a3[_0x356c('0x30')]['filter']+'%'};return _0x49470e;}})});}_0x3dd961=_['merge']({},_0x3dd961,_0x56f6a3[_0x356c('0x3f')]);var _0x1952f0={'where':_0x3dd961['where']};return db['ServicenowField'][_0x356c('0x1e')](_0x1952f0)[_0x356c('0x24')](function(_0x405b07){_0x4730bc[_0x356c('0x1e')]=_0x405b07;if(_0x56f6a3[_0x356c('0x30')][_0x356c('0x40')]){_0x3dd961[_0x356c('0x41')]=[{'all':!![]}];}return db[_0x356c('0x2b')][_0x356c('0x42')](_0x3dd961);})[_0x356c('0x24')](function(_0x551d86){_0x4730bc['rows']=_0x551d86;return _0x4730bc;})['then'](respondWithFilteredResult(_0x17d140,_0x3dd961))[_0x356c('0x43')](handleError(_0x17d140,null));};exports['show']=function(_0x59e73e,_0x33b2f8){var _0x5c4930={'raw':!![],'where':{'id':_0x59e73e[_0x356c('0x44')]['id']}},_0x4918a1={};_0x4918a1[_0x356c('0x34')]=_[_0x356c('0x31')](db[_0x356c('0x2b')][_0x356c('0x45')]);_0x4918a1[_0x356c('0x30')]=_[_0x356c('0x31')](_0x59e73e[_0x356c('0x30')]);_0x4918a1[_0x356c('0x32')]=_[_0x356c('0x33')](_0x4918a1[_0x356c('0x34')],_0x4918a1[_0x356c('0x30')]);_0x5c4930[_0x356c('0x35')]=_[_0x356c('0x33')](_0x4918a1[_0x356c('0x34')],qs[_0x356c('0x36')](_0x59e73e[_0x356c('0x30')][_0x356c('0x36')]));_0x5c4930[_0x356c('0x35')]=_0x5c4930[_0x356c('0x35')]['length']?_0x5c4930[_0x356c('0x35')]:_0x4918a1['model'];if(_0x59e73e[_0x356c('0x30')][_0x356c('0x40')]){_0x5c4930[_0x356c('0x41')]=[{'all':!![]}];}_0x5c4930=_['merge']({},_0x5c4930,_0x59e73e['options']);return db[_0x356c('0x2b')]['find'](_0x5c4930)[_0x356c('0x24')](handleEntityNotFound(_0x33b2f8,null))[_0x356c('0x24')](respondWithResult(_0x33b2f8,null))[_0x356c('0x43')](handleError(_0x33b2f8,null));};exports[_0x356c('0x46')]=function(_0x281085,_0x503d1d){return db[_0x356c('0x2b')]['create'](_0x281085[_0x356c('0x47')],{})[_0x356c('0x24')](respondWithResult(_0x503d1d,0xc9))[_0x356c('0x43')](handleError(_0x503d1d,null));};exports[_0x356c('0x23')]=function(_0x4b47de,_0x55bf37){if(_0x4b47de[_0x356c('0x47')]['id']){delete _0x4b47de[_0x356c('0x47')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x4b47de[_0x356c('0x44')]['id']}})[_0x356c('0x24')](handleEntityNotFound(_0x55bf37,null))[_0x356c('0x24')](saveUpdates(_0x4b47de[_0x356c('0x47')],null))['then'](respondWithResult(_0x55bf37,null))[_0x356c('0x43')](handleError(_0x55bf37,null));};exports[_0x356c('0x25')]=function(_0x50a988,_0x22841e){return db[_0x356c('0x2b')][_0x356c('0x48')]({'where':{'id':_0x50a988[_0x356c('0x44')]['id']}})['then'](handleEntityNotFound(_0x22841e,null))[_0x356c('0x24')](removeEntity(_0x22841e,null))[_0x356c('0x43')](handleError(_0x22841e,null));}; \ No newline at end of file +var _0xd56a=['catch','body','update','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find'];(function(_0x5c7059,_0x2828a1){var _0x21b9d5=function(_0x2eb2dc){while(--_0x2eb2dc){_0x5c7059['push'](_0x5c7059['shift']());}};_0x21b9d5(++_0x2828a1);}(_0xd56a,0xde));var _0xad56=function(_0x267120,_0x4aee8f){_0x267120=_0x267120-0x0;var _0x3d4afa=_0xd56a[_0x267120];return _0x3d4afa;};'use strict';var emlformat=require(_0xad56('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad56('0x1'));var jsonpatch=require(_0xad56('0x2'));var rp=require('request-promise');var moment=require(_0xad56('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad56('0x4'));var util=require(_0xad56('0x5'));var path=require(_0xad56('0x6'));var sox=require(_0xad56('0x7'));var csv=require(_0xad56('0x8'));var ejs=require(_0xad56('0x9'));var fs=require('fs');var fs_extra=require(_0xad56('0xa'));var _=require(_0xad56('0xb'));var squel=require(_0xad56('0xc'));var crypto=require(_0xad56('0xd'));var jsforce=require(_0xad56('0xe'));var deskjs=require(_0xad56('0xf'));var toCsv=require(_0xad56('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad56('0x10'));var authService=require(_0xad56('0x11'));var qs=require(_0xad56('0x12'));var as=require(_0xad56('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad56('0x14'))(_0xad56('0x15'));var utils=require(_0xad56('0x16'));var config=require(_0xad56('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xad56('0x18'))['db'];function respondWithStatusCode(_0x2d5db6,_0x23319d){_0x23319d=_0x23319d||0xcc;return function(_0x4791e1){if(_0x4791e1){return _0x2d5db6[_0xad56('0x19')](_0x23319d);}return _0x2d5db6['status'](_0x23319d)[_0xad56('0x1a')]();};}function respondWithResult(_0x49d5e0,_0x81aeec){_0x81aeec=_0x81aeec||0xc8;return function(_0x13550b){if(_0x13550b){return _0x49d5e0[_0xad56('0x1b')](_0x81aeec)[_0xad56('0x1c')](_0x13550b);}};}function respondWithFilteredResult(_0xbaaf59,_0x2aeb95){return function(_0x371feb){if(_0x371feb){var _0x225d10=typeof _0x2aeb95[_0xad56('0x1d')]===_0xad56('0x1e')&&typeof _0x2aeb95[_0xad56('0x1f')]===_0xad56('0x1e');var _0x4600b2=_0x371feb[_0xad56('0x20')];var _0x5c6bfc=_0x225d10?0x0:_0x2aeb95[_0xad56('0x1d')];var _0x90321d=_0x225d10?_0x371feb[_0xad56('0x20')]:_0x2aeb95[_0xad56('0x1d')]+_0x2aeb95[_0xad56('0x1f')];var _0x37d040;if(_0x90321d>=_0x4600b2){_0x90321d=_0x4600b2;_0x37d040=0xc8;}else{_0x37d040=0xce;}_0xbaaf59[_0xad56('0x1b')](_0x37d040);return _0xbaaf59['set'](_0xad56('0x21'),_0x5c6bfc+'-'+_0x90321d+'/'+_0x4600b2)['json'](_0x371feb);}return null;};}function patchUpdates(_0x3e9bcf){return function(_0x176676){try{jsonpatch[_0xad56('0x22')](_0x176676,_0x3e9bcf,!![]);}catch(_0x105d75){return BPromise[_0xad56('0x23')](_0x105d75);}return _0x176676['save']();};}function saveUpdates(_0x319d5d,_0x3f38bb){return function(_0x222bda){if(_0x222bda){return _0x222bda['update'](_0x319d5d)[_0xad56('0x24')](function(_0x1dd1e7){return _0x1dd1e7;});}return null;};}function removeEntity(_0x23f048,_0x30267f){return function(_0x2fab20){if(_0x2fab20){return _0x2fab20[_0xad56('0x25')]()[_0xad56('0x24')](function(){_0x23f048[_0xad56('0x1b')](0xcc)[_0xad56('0x1a')]();});}};}function handleEntityNotFound(_0x52b138,_0x4ccac9){return function(_0xf3ce57){if(!_0xf3ce57){_0x52b138[_0xad56('0x19')](0x194);}return _0xf3ce57;};}function handleError(_0x43f83a,_0x136024){_0x136024=_0x136024||0x1f4;return function(_0x1cb3b4){logger['error'](_0x1cb3b4[_0xad56('0x26')]);if(_0x1cb3b4[_0xad56('0x27')]){delete _0x1cb3b4['name'];}_0x43f83a[_0xad56('0x1b')](_0x136024)[_0xad56('0x28')](_0x1cb3b4);};}exports[_0xad56('0x29')]=function(_0x183d91,_0x16cb01){var _0x25b982={},_0x48a47b={},_0x537e97={'count':0x0,'rows':[]};var _0x47ab95=_[_0xad56('0x2a')](db[_0xad56('0x2b')][_0xad56('0x2c')],function(_0x42c7ce){return{'name':_0x42c7ce['fieldName'],'type':_0x42c7ce[_0xad56('0x2d')]['key']};});_0x48a47b[_0xad56('0x2e')]=_[_0xad56('0x2a')](_0x47ab95,_0xad56('0x27'));_0x48a47b['query']=_[_0xad56('0x2f')](_0x183d91[_0xad56('0x30')]);_0x48a47b[_0xad56('0x31')]=_[_0xad56('0x32')](_0x48a47b[_0xad56('0x2e')],_0x48a47b[_0xad56('0x30')]);_0x25b982[_0xad56('0x33')]=_[_0xad56('0x32')](_0x48a47b['model'],qs['fields'](_0x183d91['query'][_0xad56('0x34')]));_0x25b982['attributes']=_0x25b982[_0xad56('0x33')][_0xad56('0x35')]?_0x25b982[_0xad56('0x33')]:_0x48a47b[_0xad56('0x2e')];if(!_0x183d91[_0xad56('0x30')][_0xad56('0x36')](_0xad56('0x37'))){_0x25b982['limit']=qs[_0xad56('0x1f')](_0x183d91['query'][_0xad56('0x1f')]);_0x25b982[_0xad56('0x1d')]=qs[_0xad56('0x1d')](_0x183d91[_0xad56('0x30')][_0xad56('0x1d')]);}_0x25b982['order']=qs[_0xad56('0x38')](_0x183d91['query'][_0xad56('0x38')]);_0x25b982[_0xad56('0x39')]=qs[_0xad56('0x31')](_[_0xad56('0x3a')](_0x183d91['query'],_0x48a47b[_0xad56('0x31')]),_0x47ab95);if(_0x183d91[_0xad56('0x30')][_0xad56('0x3b')]){_0x25b982[_0xad56('0x39')]=_[_0xad56('0x3c')](_0x25b982['where'],{'$or':_[_0xad56('0x2a')](_0x47ab95,function(_0x318cf8){if(_0x318cf8[_0xad56('0x2d')]!==_0xad56('0x3d')){var _0x338e6c={};_0x338e6c[_0x318cf8[_0xad56('0x27')]]={'$like':'%'+_0x183d91[_0xad56('0x30')][_0xad56('0x3b')]+'%'};return _0x338e6c;}})});}_0x25b982=_['merge']({},_0x25b982,_0x183d91['options']);var _0x47875a={'where':_0x25b982[_0xad56('0x39')]};return db[_0xad56('0x2b')][_0xad56('0x20')](_0x47875a)['then'](function(_0x16cd8e){_0x537e97[_0xad56('0x20')]=_0x16cd8e;if(_0x183d91[_0xad56('0x30')][_0xad56('0x3e')]){_0x25b982['include']=[{'all':!![]}];}return db[_0xad56('0x2b')][_0xad56('0x3f')](_0x25b982);})[_0xad56('0x24')](function(_0x38284c){_0x537e97[_0xad56('0x40')]=_0x38284c;return _0x537e97;})[_0xad56('0x24')](respondWithFilteredResult(_0x16cb01,_0x25b982))['catch'](handleError(_0x16cb01,null));};exports[_0xad56('0x41')]=function(_0x144f07,_0x2e7b43){var _0x30e7d0={'raw':!![],'where':{'id':_0x144f07[_0xad56('0x42')]['id']}},_0x47afc6={};_0x47afc6[_0xad56('0x2e')]=_['keys'](db['ServicenowField'][_0xad56('0x2c')]);_0x47afc6[_0xad56('0x30')]=_[_0xad56('0x2f')](_0x144f07[_0xad56('0x30')]);_0x47afc6[_0xad56('0x31')]=_[_0xad56('0x32')](_0x47afc6[_0xad56('0x2e')],_0x47afc6['query']);_0x30e7d0['attributes']=_[_0xad56('0x32')](_0x47afc6[_0xad56('0x2e')],qs['fields'](_0x144f07[_0xad56('0x30')][_0xad56('0x34')]));_0x30e7d0['attributes']=_0x30e7d0['attributes']['length']?_0x30e7d0[_0xad56('0x33')]:_0x47afc6['model'];if(_0x144f07[_0xad56('0x30')][_0xad56('0x3e')]){_0x30e7d0[_0xad56('0x43')]=[{'all':!![]}];}_0x30e7d0=_[_0xad56('0x3c')]({},_0x30e7d0,_0x144f07[_0xad56('0x44')]);return db['ServicenowField'][_0xad56('0x45')](_0x30e7d0)[_0xad56('0x24')](handleEntityNotFound(_0x2e7b43,null))[_0xad56('0x24')](respondWithResult(_0x2e7b43,null))[_0xad56('0x46')](handleError(_0x2e7b43,null));};exports['create']=function(_0x13e92e,_0xd5d3ed){return db[_0xad56('0x2b')]['create'](_0x13e92e[_0xad56('0x47')],{})[_0xad56('0x24')](respondWithResult(_0xd5d3ed,0xc9))[_0xad56('0x46')](handleError(_0xd5d3ed,null));};exports[_0xad56('0x48')]=function(_0x23cda4,_0x3fd0b9){if(_0x23cda4[_0xad56('0x47')]['id']){delete _0x23cda4[_0xad56('0x47')]['id'];}return db['ServicenowField'][_0xad56('0x45')]({'where':{'id':_0x23cda4[_0xad56('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fd0b9,null))[_0xad56('0x24')](saveUpdates(_0x23cda4['body'],null))['then'](respondWithResult(_0x3fd0b9,null))[_0xad56('0x46')](handleError(_0x3fd0b9,null));};exports['destroy']=function(_0x584e04,_0x3927bd){return db[_0xad56('0x2b')][_0xad56('0x45')]({'where':{'id':_0x584e04[_0xad56('0x42')]['id']}})['then'](handleEntityNotFound(_0x3927bd,null))[_0xad56('0x24')](removeEntity(_0x3927bd,null))['catch'](handleError(_0x3927bd,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 9cd2492..a1c4dd5 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 _0x08b4=['exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intServicenowField.attributes'];(function(_0x300651,_0x1e0922){var _0x2f6260=function(_0x2e74cd){while(--_0x2e74cd){_0x300651['push'](_0x300651['shift']());}};_0x2f6260(++_0x1e0922);}(_0x08b4,0x67));var _0x408b=function(_0x2c6fb9,_0xc7d7c0){_0x2c6fb9=_0x2c6fb9-0x0;var _0x49fd5e=_0x08b4[_0x2c6fb9];return _0x49fd5e;};'use strict';var _=require(_0x408b('0x0'));var util=require(_0x408b('0x1'));var logger=require(_0x408b('0x2'))(_0x408b('0x3'));var moment=require(_0x408b('0x4'));var BPromise=require(_0x408b('0x5'));var rp=require(_0x408b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x408b('0x7'));var attributes=require(_0x408b('0x8'));module[_0x408b('0x9')]=function(_0x546717,_0x4331e0){return _0x546717[_0x408b('0xa')](_0x408b('0xb'),attributes,{'tableName':_0x408b('0xc'),'paranoid':![],'indexes':[{'name':_0x408b('0xd'),'fields':[_0x408b('0xe'),_0x408b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9c=['ServicenowField','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2a9c,0x155));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2a9('0x0'));var util=require(_0xc2a9('0x1'));var logger=require(_0xc2a9('0x2'))('api');var moment=require(_0xc2a9('0x3'));var BPromise=require(_0xc2a9('0x4'));var rp=require(_0xc2a9('0x5'));var fs=require('fs');var path=require(_0xc2a9('0x6'));var rimraf=require(_0xc2a9('0x7'));var config=require(_0xc2a9('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x4532a7,_0x56d626){return _0x4532a7[_0xc2a9('0x9')](_0xc2a9('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc2a9('0xb'),_0xc2a9('0xc')],'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 c75a904..de01ef8 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x5073f4,_0x49e432){var _0x597feb=function(_0x188fa2){while(--_0x188fa2){_0x5073f4['push'](_0x5073f4['shift']());}};_0x597feb(++_0x49e432);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x14dc6a,_0x3da3b7){_0x14dc6a=_0x14dc6a-0x0;var _0x120060=_0x9ffd[_0x14dc6a];return _0x120060;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index cd693e0..e1e98c9 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x211f6d,_0x557eb6){var _0x23672e=function(_0x5c7c88){while(--_0x5c7c88){_0x211f6d['push'](_0x211f6d['shift']());}};_0x23672e(++_0x557eb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 1069894..432e5c7 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(_0x5d5ad6,_0x582c8b){var _0x386bf5=function(_0x33766f){while(--_0x33766f){_0x5d5ad6['push'](_0x5d5ad6['shift']());}};_0x386bf5(++_0x582c8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x43c698,_0x17f36b){var _0x11450d=function(_0x539b74){while(--_0x539b74){_0x43c698['push'](_0x43c698['shift']());}};_0x11450d(++_0x17f36b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 db23e77..133ebb7 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 _0x5b02=['then','destroy','sendStatus','name','send','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','catch','show','rawAttributes','length','create','body','find','params','getConfigurations','SugarcrmConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','created_by','description','duration_hours','duration_minutes','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','remove','includes','label','values','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update'];(function(_0x4a395d,_0x3f7b8f){var _0xb50b42=function(_0xed56c0){while(--_0xed56c0){_0x4a395d['push'](_0x4a395d['shift']());}};_0xb50b42(++_0x3f7b8f);}(_0x5b02,0xbf));var _0x25b0=function(_0x62a0c2,_0x259c05){_0x62a0c2=_0x62a0c2-0x0;var _0x2a64d8=_0x5b02[_0x62a0c2];return _0x2a64d8;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x25b0('0x1'));var jsonpatch=require(_0x25b0('0x2'));var rp=require(_0x25b0('0x3'));var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require(_0x25b0('0x5'));var util=require(_0x25b0('0x6'));var path=require(_0x25b0('0x7'));var sox=require(_0x25b0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25b0('0x9'));var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x25b0('0xc'));var toCsv=require(_0x25b0('0xd'));var querystring=require(_0x25b0('0xe'));var Papa=require(_0x25b0('0xf'));var Redis=require(_0x25b0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25b0('0x11'));var logger=require(_0x25b0('0x12'))('api');var utils=require(_0x25b0('0x13'));var config=require(_0x25b0('0x14'));var licenseUtil=require(_0x25b0('0x15'));var db=require(_0x25b0('0x16'))['db'];var integrations=require(_0x25b0('0x17'));function respondWithStatusCode(_0x47267d,_0x218fdb){_0x218fdb=_0x218fdb||0xcc;return function(_0x1aab70){if(_0x1aab70){return _0x47267d['sendStatus'](_0x218fdb);}return _0x47267d['status'](_0x218fdb)['end']();};}function respondWithResult(_0x4cbfa4,_0x3f897b){_0x3f897b=_0x3f897b||0xc8;return function(_0x4ed61f){if(_0x4ed61f){return _0x4cbfa4[_0x25b0('0x18')](_0x3f897b)['json'](_0x4ed61f);}};}function respondWithFilteredResult(_0x4671f3,_0x853fe3){return function(_0x3a818f){if(_0x3a818f){var _0x15ba3a=typeof _0x853fe3[_0x25b0('0x19')]==='undefined'&&typeof _0x853fe3[_0x25b0('0x1a')]===_0x25b0('0x1b');var _0x7d9d41=_0x3a818f[_0x25b0('0x1c')];var _0x5b12aa=_0x15ba3a?0x0:_0x853fe3[_0x25b0('0x19')];var _0x2d7ab1=_0x15ba3a?_0x3a818f[_0x25b0('0x1c')]:_0x853fe3[_0x25b0('0x19')]+_0x853fe3[_0x25b0('0x1a')];var _0x108a08;if(_0x2d7ab1>=_0x7d9d41){_0x2d7ab1=_0x7d9d41;_0x108a08=0xc8;}else{_0x108a08=0xce;}_0x4671f3['status'](_0x108a08);return _0x4671f3[_0x25b0('0x1d')](_0x25b0('0x1e'),_0x5b12aa+'-'+_0x2d7ab1+'/'+_0x7d9d41)[_0x25b0('0x1f')](_0x3a818f);}return null;};}function patchUpdates(_0x3730d5){return function(_0x107b94){try{jsonpatch['apply'](_0x107b94,_0x3730d5,!![]);}catch(_0x5eaba2){return BPromise[_0x25b0('0x20')](_0x5eaba2);}return _0x107b94[_0x25b0('0x21')]();};}function saveUpdates(_0x2a155a,_0x433f71){return function(_0x452b2f){if(_0x452b2f){return _0x452b2f[_0x25b0('0x22')](_0x2a155a)[_0x25b0('0x23')](function(_0x500453){return _0x500453;});}return null;};}function removeEntity(_0x6c19d9,_0x5db42c){return function(_0x217e45){if(_0x217e45){return _0x217e45[_0x25b0('0x24')]()['then'](function(){_0x6c19d9[_0x25b0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1c05,_0x254caa){return function(_0x223b91){if(!_0x223b91){_0x1c1c05[_0x25b0('0x25')](0x194);}return _0x223b91;};}function handleError(_0x2380c6,_0x5545d4){_0x5545d4=_0x5545d4||0x1f4;return function(_0x4ceb1f){logger['error'](_0x4ceb1f['stack']);if(_0x4ceb1f['name']){delete _0x4ceb1f[_0x25b0('0x26')];}_0x2380c6[_0x25b0('0x18')](_0x5545d4)[_0x25b0('0x27')](_0x4ceb1f);};}exports['index']=function(_0x4faf89,_0x2cc320){var _0x48f908={},_0x408cd8={},_0x3e0e83={'count':0x0,'rows':[]};var _0x3ba8cd=_[_0x25b0('0x28')](db['SugarcrmAccount']['rawAttributes'],function(_0x5c85d5){return{'name':_0x5c85d5[_0x25b0('0x29')],'type':_0x5c85d5['type'][_0x25b0('0x2a')]};});_0x408cd8[_0x25b0('0x2b')]=_[_0x25b0('0x28')](_0x3ba8cd,'name');_0x408cd8['query']=_[_0x25b0('0x2c')](_0x4faf89[_0x25b0('0x2d')]);_0x408cd8[_0x25b0('0x2e')]=_[_0x25b0('0x2f')](_0x408cd8[_0x25b0('0x2b')],_0x408cd8[_0x25b0('0x2d')]);_0x48f908[_0x25b0('0x30')]=_[_0x25b0('0x2f')](_0x408cd8['model'],qs[_0x25b0('0x31')](_0x4faf89[_0x25b0('0x2d')][_0x25b0('0x31')]));_0x48f908['attributes']=_0x48f908[_0x25b0('0x30')]['length']?_0x48f908['attributes']:_0x408cd8[_0x25b0('0x2b')];if(!_0x4faf89[_0x25b0('0x2d')][_0x25b0('0x32')]('nolimit')){_0x48f908[_0x25b0('0x1a')]=qs[_0x25b0('0x1a')](_0x4faf89['query'][_0x25b0('0x1a')]);_0x48f908[_0x25b0('0x19')]=qs[_0x25b0('0x19')](_0x4faf89['query'][_0x25b0('0x19')]);}_0x48f908[_0x25b0('0x33')]=qs[_0x25b0('0x34')](_0x4faf89[_0x25b0('0x2d')]['sort']);_0x48f908[_0x25b0('0x35')]=qs[_0x25b0('0x2e')](_[_0x25b0('0x36')](_0x4faf89[_0x25b0('0x2d')],_0x408cd8[_0x25b0('0x2e')]),_0x3ba8cd);if(_0x4faf89[_0x25b0('0x2d')][_0x25b0('0x37')]){_0x48f908[_0x25b0('0x35')]=_[_0x25b0('0x38')](_0x48f908[_0x25b0('0x35')],{'$or':_[_0x25b0('0x28')](_0x3ba8cd,function(_0x7e078c){if(_0x7e078c[_0x25b0('0x39')]!==_0x25b0('0x3a')){var _0x4cfda5={};_0x4cfda5[_0x7e078c[_0x25b0('0x26')]]={'$like':'%'+_0x4faf89['query']['filter']+'%'};return _0x4cfda5;}})});}_0x48f908=_[_0x25b0('0x38')]({},_0x48f908,_0x4faf89[_0x25b0('0x3b')]);var _0x9a9cbe={'where':_0x48f908[_0x25b0('0x35')]};return db[_0x25b0('0x3c')]['count'](_0x9a9cbe)['then'](function(_0x168981){_0x3e0e83[_0x25b0('0x1c')]=_0x168981;if(_0x4faf89['query'][_0x25b0('0x3d')]){_0x48f908[_0x25b0('0x3e')]=[{'all':!![]}];}return db[_0x25b0('0x3c')][_0x25b0('0x3f')](_0x48f908);})[_0x25b0('0x23')](function(_0x266fe1){_0x3e0e83['rows']=_0x266fe1;return _0x3e0e83;})[_0x25b0('0x23')](respondWithFilteredResult(_0x2cc320,_0x48f908))[_0x25b0('0x40')](handleError(_0x2cc320,null));};exports[_0x25b0('0x41')]=function(_0x526229,_0x215c92){var _0x306097={'raw':![],'where':{'id':_0x526229['params']['id']}},_0x2f0a66={};_0x2f0a66[_0x25b0('0x2b')]=_['keys'](db['SugarcrmAccount'][_0x25b0('0x42')]);_0x2f0a66[_0x25b0('0x2d')]=_[_0x25b0('0x2c')](_0x526229[_0x25b0('0x2d')]);_0x2f0a66[_0x25b0('0x2e')]=_[_0x25b0('0x2f')](_0x2f0a66['model'],_0x2f0a66[_0x25b0('0x2d')]);_0x306097[_0x25b0('0x30')]=_[_0x25b0('0x2f')](_0x2f0a66[_0x25b0('0x2b')],qs[_0x25b0('0x31')](_0x526229[_0x25b0('0x2d')]['fields']));_0x306097[_0x25b0('0x30')]=_0x306097['attributes'][_0x25b0('0x43')]?_0x306097[_0x25b0('0x30')]:_0x2f0a66[_0x25b0('0x2b')];if(_0x526229[_0x25b0('0x2d')][_0x25b0('0x3d')]){_0x306097[_0x25b0('0x3e')]=[{'all':!![]}];}_0x306097=_[_0x25b0('0x38')]({},_0x306097,_0x526229[_0x25b0('0x3b')]);return db[_0x25b0('0x3c')]['find'](_0x306097)[_0x25b0('0x23')](handleEntityNotFound(_0x215c92,null))[_0x25b0('0x23')](respondWithResult(_0x215c92,null))[_0x25b0('0x40')](handleError(_0x215c92,null));};exports[_0x25b0('0x44')]=function(_0x211c90,_0x25d1a3){return db[_0x25b0('0x3c')][_0x25b0('0x44')](_0x211c90[_0x25b0('0x45')],{})[_0x25b0('0x23')](respondWithResult(_0x25d1a3,0xc9))[_0x25b0('0x40')](handleError(_0x25d1a3,null));};exports[_0x25b0('0x22')]=function(_0x10790a,_0x18ca9c){if(_0x10790a['body']['id']){delete _0x10790a[_0x25b0('0x45')]['id'];}return db[_0x25b0('0x3c')][_0x25b0('0x46')]({'where':{'id':_0x10790a[_0x25b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x18ca9c,null))[_0x25b0('0x23')](saveUpdates(_0x10790a['body'],null))[_0x25b0('0x23')](respondWithResult(_0x18ca9c,null))[_0x25b0('0x40')](handleError(_0x18ca9c,null));};exports['destroy']=function(_0x56c174,_0x2a78cc){return db[_0x25b0('0x3c')][_0x25b0('0x46')]({'where':{'id':_0x56c174[_0x25b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a78cc,null))['then'](removeEntity(_0x2a78cc,null))[_0x25b0('0x40')](handleError(_0x2a78cc,null));};exports[_0x25b0('0x48')]=function(_0x4bdeeb,_0x3f3d24,_0x36f7a8){var _0x439845={};var _0x379bb0={};var _0x29f3ae;var _0x1c3a6a;return db[_0x25b0('0x3c')]['findOne']({'where':{'id':_0x4bdeeb['params']['id']}})[_0x25b0('0x23')](handleEntityNotFound(_0x3f3d24,null))['then'](function(_0x3c4921){if(_0x3c4921){_0x29f3ae=_0x3c4921;_0x379bb0[_0x25b0('0x2b')]=_['keys'](db[_0x25b0('0x49')][_0x25b0('0x42')]);_0x379bb0['query']=_['keys'](_0x4bdeeb['query']);_0x379bb0[_0x25b0('0x2e')]=_[_0x25b0('0x2f')](_0x379bb0[_0x25b0('0x2b')],_0x379bb0['query']);_0x439845[_0x25b0('0x30')]=_[_0x25b0('0x2f')](_0x379bb0['model'],qs[_0x25b0('0x31')](_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x31')]));_0x439845['attributes']=_0x439845[_0x25b0('0x30')][_0x25b0('0x43')]?_0x439845[_0x25b0('0x30')]:_0x379bb0['model'];_0x439845[_0x25b0('0x33')]=qs[_0x25b0('0x34')](_0x4bdeeb[_0x25b0('0x2d')]['sort']);_0x439845['where']=qs['filters'](_[_0x25b0('0x36')](_0x4bdeeb[_0x25b0('0x2d')],_0x379bb0[_0x25b0('0x2e')]));if(_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x37')]){_0x439845[_0x25b0('0x35')]=_[_0x25b0('0x38')](_0x439845['where'],{'$or':_[_0x25b0('0x28')](_0x439845['attributes'],function(_0x2307d3){var _0x1b38b1={};_0x1b38b1[_0x2307d3]={'$like':'%'+_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x37')]+'%'};return _0x1b38b1;})});}_0x439845=_[_0x25b0('0x38')]({},_0x439845,_0x4bdeeb['options']);return _0x29f3ae['getConfigurations'](_0x439845);}})[_0x25b0('0x23')](function(_0x358421){if(_0x358421){_0x1c3a6a=_0x358421[_0x25b0('0x43')];if(!_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x32')](_0x25b0('0x4a'))){_0x439845[_0x25b0('0x1a')]=qs['limit'](_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x1a')]);_0x439845[_0x25b0('0x19')]=qs[_0x25b0('0x19')](_0x4bdeeb[_0x25b0('0x2d')][_0x25b0('0x19')]);}return _0x29f3ae['getConfigurations'](_0x439845);}})['then'](function(_0x496548){if(_0x496548){return _0x496548?{'count':_0x1c3a6a,'rows':_0x496548}:null;}})[_0x25b0('0x23')](respondWithResult(_0x3f3d24,null))[_0x25b0('0x40')](handleError(_0x3f3d24,null));};exports['addConfiguration']=function(_0x3c817c,_0x2ffe54,_0x400f89){if(_0x3c817c[_0x25b0('0x45')]['id']){delete _0x3c817c['body']['id'];}return db[_0x25b0('0x3c')]['findOne']({'where':{'id':_0x3c817c['params']['id']}})[_0x25b0('0x23')](handleEntityNotFound(_0x2ffe54,null))[_0x25b0('0x23')](function(_0x558cc9){if(_0x558cc9){_0x3c817c[_0x25b0('0x45')][_0x25b0('0x4b')]=_0x558cc9['id'];_0x3c817c[_0x25b0('0x45')][_0x25b0('0x4c')]=integrations[_0x25b0('0x4d')](_0x3c817c[_0x25b0('0x45')][_0x25b0('0x4e')],_0x3c817c[_0x25b0('0x45')][_0x25b0('0x39')]);_0x3c817c['body']['Descriptions']=integrations['getDescriptions'](_0x3c817c['body'][_0x25b0('0x4e')],_0x3c817c[_0x25b0('0x45')]['type']);return db['SugarcrmConfiguration'][_0x25b0('0x44')](_0x3c817c[_0x25b0('0x45')],{'include':[{'model':db[_0x25b0('0x4f')],'as':_0x25b0('0x4c')},{'model':db[_0x25b0('0x4f')],'as':_0x25b0('0x50')}]});}return null;})['then'](respondWithResult(_0x2ffe54,null))[_0x25b0('0x40')](handleError(_0x2ffe54,null));};exports['getFields']=function(_0x5a5e98,_0x341f94,_0xbda3f0){var _0x22b205='';var _0x242bbb=['id',_0x25b0('0x26'),'assigned_user_id',_0x25b0('0x51'),_0x25b0('0x52'),'date_start',_0x25b0('0x53'),_0x25b0('0x54'),'parent_id',_0x25b0('0x55'),_0x25b0('0x56'),_0x25b0('0x57')];return db['SugarcrmAccount'][_0x25b0('0x58')]({'where':{'id':_0x5a5e98[_0x25b0('0x47')]['id']},'attributes':['id',_0x25b0('0x59'),_0x25b0('0x5a'),'remoteUri']})[_0x25b0('0x23')](handleEntityNotFound(_0x341f94,null))['then'](function(_0x1c79e2){if(_0x1c79e2){_0x22b205=_0x1c79e2[_0x25b0('0x5b')];var _0x113ef5=_0x22b205[_0x25b0('0x5c')](-0x1);if(_0x113ef5==='/'){_0x22b205=_0x22b205['substring'](0x0,_0x22b205['lastIndexOf'](_0x113ef5));}return rp({'method':'POST','uri':util[_0x25b0('0x5d')](_0x25b0('0x5e'),_0x22b205,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x25b0('0x5f'),'input_type':_0x25b0('0x60'),'response_type':_0x25b0('0x60'),'rest_data':JSON[_0x25b0('0x61')]({'user_auth':{'user_name':_0x1c79e2[_0x25b0('0x59')],'password':_0x1c79e2[_0x25b0('0x5a')],'encryption':_0x25b0('0x62')},'application':_0x25b0('0x63')})}});}})['then'](function(_0x47107f){if(_0x47107f&&_0x47107f['name']!=='Invalid\x20Login'&&_0x47107f[_0x25b0('0x26')]!==_0x25b0('0x64')){return rp({'method':'POST','uri':util[_0x25b0('0x5d')](_0x25b0('0x5e'),_0x22b205,_0x25b0('0x65')),'json':!![],'form':{'method':_0x25b0('0x66'),'input_type':_0x25b0('0x60'),'response_type':_0x25b0('0x60'),'rest_data':JSON[_0x25b0('0x61')]({'session':_0x47107f['id'],'module_name':_0x25b0('0x67')})}})[_0x25b0('0x23')](function(_0x41da96){if(_0x41da96){var _0x2d5c24=_['values'](_0x41da96['module_fields']);_[_0x25b0('0x68')](_0x2d5c24,function(_0x5a88d1){return _0x242bbb[_0x25b0('0x69')](_0x5a88d1[_0x25b0('0x26')]);});return{'count':_0x2d5c24['length'],'rows':_[_0x25b0('0x28')](_0x2d5c24,function(_0x55cd27){return{'id':_0x55cd27['name'],'name':_0x55cd27[_0x25b0('0x6a')],'custom':_['endsWith'](_0x55cd27[_0x25b0('0x26')],'_c')?!![]:![],'options':_0x55cd27[_0x25b0('0x3b')]?_['map'](_[_0x25b0('0x6b')](_0x55cd27[_0x25b0('0x3b')]),function(_0xbe135c){return{'name':_0xbe135c[_0x25b0('0x6c')],'value':_0xbe135c[_0x25b0('0x26')]};}):[]};})};}})[_0x25b0('0x23')](respondWithResult(_0x341f94,null))[_0x25b0('0x40')](function(_0x2ef0ba){var _0x2d5490=_0x5a5e98[_0x25b0('0x2d')][_0x25b0('0x6d')]?0x1f4:_0x2ef0ba[_0x25b0('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x25b0('0x6f'),_0x2d5490,JSON[_0x25b0('0x61')](_0x2ef0ba));delete _0x2ef0ba['name'];if(_0x2d5490===0x191){_0x2d5490=0x190;}_0x341f94[_0x25b0('0x18')](_0x2d5490)['send'](_0x5a5e98[_0x25b0('0x2d')][_0x25b0('0x6d')]?{'message':_0x25b0('0x70'),'statusCode':_0x2ef0ba[_0x25b0('0x6e')]}:_0x2ef0ba);});}else{var _0x338df4=0x1f4;_0x341f94['status'](_0x338df4)[_0x25b0('0x27')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x2271=['update','destroy','then','error','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','type','includeAll','SugarcrmAccount','findAll','catch','show','params','keys','include','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','sort','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','values','module_fields','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x2a7252,_0x3df8b8){var _0x22efc0=function(_0x48923e){while(--_0x48923e){_0x2a7252['push'](_0x2a7252['shift']());}};_0x22efc0(++_0x3df8b8);}(_0x2271,0x133));var _0x1227=function(_0x1806c8,_0xa1ee03){_0x1806c8=_0x1806c8-0x0;var _0x25d866=_0x2271[_0x1806c8];return _0x25d866;};'use strict';var emlformat=require(_0x1227('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1227('0x1'));var jsonpatch=require(_0x1227('0x2'));var rp=require(_0x1227('0x3'));var moment=require(_0x1227('0x4'));var BPromise=require(_0x1227('0x5'));var Mustache=require(_0x1227('0x6'));var util=require(_0x1227('0x7'));var path=require(_0x1227('0x8'));var sox=require(_0x1227('0x9'));var csv=require(_0x1227('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1227('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1227('0xc'));var deskjs=require(_0x1227('0xd'));var toCsv=require(_0x1227('0xa'));var querystring=require(_0x1227('0xe'));var Papa=require('papaparse');var Redis=require(_0x1227('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1227('0x10'));var as=require(_0x1227('0x11'));var hardwareService=require(_0x1227('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1227('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b68a1,_0x499965){_0x499965=_0x499965||0xcc;return function(_0xd43055){if(_0xd43055){return _0x1b68a1[_0x1227('0x14')](_0x499965);}return _0x1b68a1[_0x1227('0x15')](_0x499965)[_0x1227('0x16')]();};}function respondWithResult(_0x667bc9,_0x12f71d){_0x12f71d=_0x12f71d||0xc8;return function(_0x197a6c){if(_0x197a6c){return _0x667bc9[_0x1227('0x15')](_0x12f71d)['json'](_0x197a6c);}};}function respondWithFilteredResult(_0x25a589,_0x50b34){return function(_0x55ec43){if(_0x55ec43){var _0x10d437=typeof _0x50b34[_0x1227('0x17')]==='undefined'&&typeof _0x50b34[_0x1227('0x18')]==='undefined';var _0x1c1308=_0x55ec43['count'];var _0x38b5db=_0x10d437?0x0:_0x50b34['offset'];var _0x190ecb=_0x10d437?_0x55ec43[_0x1227('0x19')]:_0x50b34[_0x1227('0x17')]+_0x50b34[_0x1227('0x18')];var _0x39fcf1;if(_0x190ecb>=_0x1c1308){_0x190ecb=_0x1c1308;_0x39fcf1=0xc8;}else{_0x39fcf1=0xce;}_0x25a589['status'](_0x39fcf1);return _0x25a589[_0x1227('0x1a')](_0x1227('0x1b'),_0x38b5db+'-'+_0x190ecb+'/'+_0x1c1308)[_0x1227('0x1c')](_0x55ec43);}return null;};}function patchUpdates(_0x4cca6d){return function(_0x546535){try{jsonpatch[_0x1227('0x1d')](_0x546535,_0x4cca6d,!![]);}catch(_0x23f987){return BPromise[_0x1227('0x1e')](_0x23f987);}return _0x546535[_0x1227('0x1f')]();};}function saveUpdates(_0x10c8d2,_0xc72188){return function(_0x187451){if(_0x187451){return _0x187451[_0x1227('0x20')](_0x10c8d2)['then'](function(_0x1159bb){return _0x1159bb;});}return null;};}function removeEntity(_0x1d53ed,_0x44de38){return function(_0x8decd2){if(_0x8decd2){return _0x8decd2[_0x1227('0x21')]()[_0x1227('0x22')](function(){_0x1d53ed['status'](0xcc)[_0x1227('0x16')]();});}};}function handleEntityNotFound(_0x59757b,_0x4e5129){return function(_0x434d36){if(!_0x434d36){_0x59757b[_0x1227('0x14')](0x194);}return _0x434d36;};}function handleError(_0x4d0432,_0x1ce976){_0x1ce976=_0x1ce976||0x1f4;return function(_0x3740a2){logger[_0x1227('0x23')](_0x3740a2['stack']);if(_0x3740a2[_0x1227('0x24')]){delete _0x3740a2[_0x1227('0x24')];}_0x4d0432[_0x1227('0x15')](_0x1ce976)[_0x1227('0x25')](_0x3740a2);};}exports[_0x1227('0x26')]=function(_0x3c29ef,_0x49c52d){var _0x35744e={},_0x2f13a9={},_0x143acb={'count':0x0,'rows':[]};var _0x27e723=_[_0x1227('0x27')](db['SugarcrmAccount'][_0x1227('0x28')],function(_0x215716){return{'name':_0x215716['fieldName'],'type':_0x215716['type'][_0x1227('0x29')]};});_0x2f13a9[_0x1227('0x2a')]=_[_0x1227('0x27')](_0x27e723,_0x1227('0x24'));_0x2f13a9[_0x1227('0x2b')]=_['keys'](_0x3c29ef[_0x1227('0x2b')]);_0x2f13a9[_0x1227('0x2c')]=_[_0x1227('0x2d')](_0x2f13a9[_0x1227('0x2a')],_0x2f13a9[_0x1227('0x2b')]);_0x35744e[_0x1227('0x2e')]=_[_0x1227('0x2d')](_0x2f13a9[_0x1227('0x2a')],qs[_0x1227('0x2f')](_0x3c29ef[_0x1227('0x2b')][_0x1227('0x2f')]));_0x35744e[_0x1227('0x2e')]=_0x35744e['attributes'][_0x1227('0x30')]?_0x35744e[_0x1227('0x2e')]:_0x2f13a9[_0x1227('0x2a')];if(!_0x3c29ef['query'][_0x1227('0x31')]('nolimit')){_0x35744e[_0x1227('0x18')]=qs[_0x1227('0x18')](_0x3c29ef['query'][_0x1227('0x18')]);_0x35744e[_0x1227('0x17')]=qs[_0x1227('0x17')](_0x3c29ef[_0x1227('0x2b')][_0x1227('0x17')]);}_0x35744e[_0x1227('0x32')]=qs['sort'](_0x3c29ef[_0x1227('0x2b')]['sort']);_0x35744e[_0x1227('0x33')]=qs[_0x1227('0x2c')](_[_0x1227('0x34')](_0x3c29ef[_0x1227('0x2b')],_0x2f13a9[_0x1227('0x2c')]),_0x27e723);if(_0x3c29ef[_0x1227('0x2b')]['filter']){_0x35744e[_0x1227('0x33')]=_[_0x1227('0x35')](_0x35744e[_0x1227('0x33')],{'$or':_['map'](_0x27e723,function(_0x562ca1){if(_0x562ca1[_0x1227('0x36')]!=='VIRTUAL'){var _0x48d326={};_0x48d326[_0x562ca1[_0x1227('0x24')]]={'$like':'%'+_0x3c29ef[_0x1227('0x2b')]['filter']+'%'};return _0x48d326;}})});}_0x35744e=_['merge']({},_0x35744e,_0x3c29ef['options']);var _0x3dfa7e={'where':_0x35744e['where']};return db['SugarcrmAccount'][_0x1227('0x19')](_0x3dfa7e)[_0x1227('0x22')](function(_0x226708){_0x143acb[_0x1227('0x19')]=_0x226708;if(_0x3c29ef[_0x1227('0x2b')][_0x1227('0x37')]){_0x35744e['include']=[{'all':!![]}];}return db[_0x1227('0x38')][_0x1227('0x39')](_0x35744e);})['then'](function(_0x150595){_0x143acb['rows']=_0x150595;return _0x143acb;})['then'](respondWithFilteredResult(_0x49c52d,_0x35744e))[_0x1227('0x3a')](handleError(_0x49c52d,null));};exports[_0x1227('0x3b')]=function(_0x41c688,_0x4e570c){var _0x32b1a4={'raw':![],'where':{'id':_0x41c688[_0x1227('0x3c')]['id']}},_0xf4ed91={};_0xf4ed91['model']=_[_0x1227('0x3d')](db[_0x1227('0x38')]['rawAttributes']);_0xf4ed91[_0x1227('0x2b')]=_['keys'](_0x41c688[_0x1227('0x2b')]);_0xf4ed91[_0x1227('0x2c')]=_[_0x1227('0x2d')](_0xf4ed91['model'],_0xf4ed91[_0x1227('0x2b')]);_0x32b1a4[_0x1227('0x2e')]=_[_0x1227('0x2d')](_0xf4ed91['model'],qs[_0x1227('0x2f')](_0x41c688[_0x1227('0x2b')]['fields']));_0x32b1a4[_0x1227('0x2e')]=_0x32b1a4['attributes'][_0x1227('0x30')]?_0x32b1a4[_0x1227('0x2e')]:_0xf4ed91[_0x1227('0x2a')];if(_0x41c688[_0x1227('0x2b')][_0x1227('0x37')]){_0x32b1a4[_0x1227('0x3e')]=[{'all':!![]}];}_0x32b1a4=_['merge']({},_0x32b1a4,_0x41c688[_0x1227('0x3f')]);return db['SugarcrmAccount'][_0x1227('0x40')](_0x32b1a4)[_0x1227('0x22')](handleEntityNotFound(_0x4e570c,null))['then'](respondWithResult(_0x4e570c,null))[_0x1227('0x3a')](handleError(_0x4e570c,null));};exports['create']=function(_0x3aac00,_0x1c664a){return db['SugarcrmAccount'][_0x1227('0x41')](_0x3aac00['body'],{})[_0x1227('0x22')](respondWithResult(_0x1c664a,0xc9))['catch'](handleError(_0x1c664a,null));};exports[_0x1227('0x20')]=function(_0xea01df,_0x268d67){if(_0xea01df[_0x1227('0x42')]['id']){delete _0xea01df[_0x1227('0x42')]['id'];}return db[_0x1227('0x38')][_0x1227('0x40')]({'where':{'id':_0xea01df['params']['id']}})['then'](handleEntityNotFound(_0x268d67,null))[_0x1227('0x22')](saveUpdates(_0xea01df[_0x1227('0x42')],null))[_0x1227('0x22')](respondWithResult(_0x268d67,null))['catch'](handleError(_0x268d67,null));};exports[_0x1227('0x21')]=function(_0x1ba566,_0x5ec33b){return db[_0x1227('0x38')][_0x1227('0x40')]({'where':{'id':_0x1ba566['params']['id']}})[_0x1227('0x22')](handleEntityNotFound(_0x5ec33b,null))[_0x1227('0x22')](removeEntity(_0x5ec33b,null))[_0x1227('0x3a')](handleError(_0x5ec33b,null));};exports[_0x1227('0x43')]=function(_0x16c56b,_0x20f821,_0x46cf48){var _0x384d68={};var _0x5d408e={};var _0x43aab5;var _0x1c02a1;return db['SugarcrmAccount'][_0x1227('0x44')]({'where':{'id':_0x16c56b[_0x1227('0x3c')]['id']}})[_0x1227('0x22')](handleEntityNotFound(_0x20f821,null))[_0x1227('0x22')](function(_0x371f30){if(_0x371f30){_0x43aab5=_0x371f30;_0x5d408e[_0x1227('0x2a')]=_[_0x1227('0x3d')](db[_0x1227('0x45')][_0x1227('0x28')]);_0x5d408e[_0x1227('0x2b')]=_[_0x1227('0x3d')](_0x16c56b['query']);_0x5d408e[_0x1227('0x2c')]=_[_0x1227('0x2d')](_0x5d408e[_0x1227('0x2a')],_0x5d408e['query']);_0x384d68[_0x1227('0x2e')]=_[_0x1227('0x2d')](_0x5d408e[_0x1227('0x2a')],qs[_0x1227('0x2f')](_0x16c56b['query']['fields']));_0x384d68[_0x1227('0x2e')]=_0x384d68[_0x1227('0x2e')]['length']?_0x384d68[_0x1227('0x2e')]:_0x5d408e[_0x1227('0x2a')];_0x384d68[_0x1227('0x32')]=qs['sort'](_0x16c56b[_0x1227('0x2b')][_0x1227('0x46')]);_0x384d68[_0x1227('0x33')]=qs[_0x1227('0x2c')](_[_0x1227('0x34')](_0x16c56b[_0x1227('0x2b')],_0x5d408e['filters']));if(_0x16c56b[_0x1227('0x2b')]['filter']){_0x384d68['where']=_['merge'](_0x384d68[_0x1227('0x33')],{'$or':_[_0x1227('0x27')](_0x384d68[_0x1227('0x2e')],function(_0x26b487){var _0x2c0af4={};_0x2c0af4[_0x26b487]={'$like':'%'+_0x16c56b[_0x1227('0x2b')][_0x1227('0x47')]+'%'};return _0x2c0af4;})});}_0x384d68=_[_0x1227('0x35')]({},_0x384d68,_0x16c56b['options']);return _0x43aab5[_0x1227('0x43')](_0x384d68);}})[_0x1227('0x22')](function(_0x33391f){if(_0x33391f){_0x1c02a1=_0x33391f['length'];if(!_0x16c56b[_0x1227('0x2b')][_0x1227('0x31')](_0x1227('0x48'))){_0x384d68[_0x1227('0x18')]=qs[_0x1227('0x18')](_0x16c56b[_0x1227('0x2b')][_0x1227('0x18')]);_0x384d68['offset']=qs[_0x1227('0x17')](_0x16c56b[_0x1227('0x2b')][_0x1227('0x17')]);}return _0x43aab5[_0x1227('0x43')](_0x384d68);}})['then'](function(_0x16339a){if(_0x16339a){return _0x16339a?{'count':_0x1c02a1,'rows':_0x16339a}:null;}})[_0x1227('0x22')](respondWithResult(_0x20f821,null))[_0x1227('0x3a')](handleError(_0x20f821,null));};exports[_0x1227('0x49')]=function(_0x1196db,_0x2f034e,_0x21d251){if(_0x1196db[_0x1227('0x42')]['id']){delete _0x1196db[_0x1227('0x42')]['id'];}return db['SugarcrmAccount'][_0x1227('0x44')]({'where':{'id':_0x1196db[_0x1227('0x3c')]['id']}})[_0x1227('0x22')](handleEntityNotFound(_0x2f034e,null))['then'](function(_0x4befee){if(_0x4befee){_0x1196db[_0x1227('0x42')][_0x1227('0x4a')]=_0x4befee['id'];_0x1196db[_0x1227('0x42')][_0x1227('0x4b')]=integrations[_0x1227('0x4c')](_0x1196db[_0x1227('0x42')][_0x1227('0x4d')],_0x1196db[_0x1227('0x42')]['type']);_0x1196db['body'][_0x1227('0x4e')]=integrations[_0x1227('0x4f')](_0x1196db[_0x1227('0x42')][_0x1227('0x4d')],_0x1196db[_0x1227('0x42')][_0x1227('0x36')]);return db[_0x1227('0x45')][_0x1227('0x41')](_0x1196db['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x1227('0x4b')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x1227('0x22')](respondWithResult(_0x2f034e,null))[_0x1227('0x3a')](handleError(_0x2f034e,null));};exports['getFields']=function(_0x280e19,_0x1a346e,_0x299dfd){var _0x2fbb65='';var _0x3975a4=['id',_0x1227('0x24'),_0x1227('0x50'),_0x1227('0x51'),_0x1227('0x52'),_0x1227('0x53'),_0x1227('0x54'),_0x1227('0x55'),_0x1227('0x56'),_0x1227('0x57'),_0x1227('0x58'),_0x1227('0x59')];return db[_0x1227('0x38')][_0x1227('0x44')]({'where':{'id':_0x280e19[_0x1227('0x3c')]['id']},'attributes':['id','username',_0x1227('0x5a'),_0x1227('0x5b')]})['then'](handleEntityNotFound(_0x1a346e,null))[_0x1227('0x22')](function(_0x44f730){if(_0x44f730){_0x2fbb65=_0x44f730[_0x1227('0x5b')];var _0x43274f=_0x2fbb65[_0x1227('0x5c')](-0x1);if(_0x43274f==='/'){_0x2fbb65=_0x2fbb65[_0x1227('0x5d')](0x0,_0x2fbb65['lastIndexOf'](_0x43274f));}return rp({'method':'POST','uri':util[_0x1227('0x5e')](_0x1227('0x5f'),_0x2fbb65,_0x1227('0x60')),'json':!![],'form':{'method':_0x1227('0x61'),'input_type':_0x1227('0x62'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x44f730[_0x1227('0x63')],'password':_0x44f730[_0x1227('0x5a')],'encryption':'PLAIN'},'application':_0x1227('0x64')})}});}})[_0x1227('0x22')](function(_0x3c4489){if(_0x3c4489&&_0x3c4489[_0x1227('0x24')]!==_0x1227('0x65')&&_0x3c4489['name']!==_0x1227('0x66')){return rp({'method':'POST','uri':util['format']('%s%s',_0x2fbb65,_0x1227('0x60')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x1227('0x62'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3c4489['id'],'module_name':'Calls'})}})['then'](function(_0x263304){if(_0x263304){var _0x3bb35f=_[_0x1227('0x67')](_0x263304[_0x1227('0x68')]);_['remove'](_0x3bb35f,function(_0x84cf6a){return _0x3975a4[_0x1227('0x69')](_0x84cf6a[_0x1227('0x24')]);});return{'count':_0x3bb35f['length'],'rows':_['map'](_0x3bb35f,function(_0x2d6f65){return{'id':_0x2d6f65[_0x1227('0x24')],'name':_0x2d6f65[_0x1227('0x6a')],'custom':_[_0x1227('0x6b')](_0x2d6f65['name'],'_c')?!![]:![],'options':_0x2d6f65[_0x1227('0x3f')]?_['map'](_[_0x1227('0x67')](_0x2d6f65['options']),function(_0x1beab0){return{'name':_0x1beab0['value'],'value':_0x1beab0[_0x1227('0x24')]};}):[]};})};}})[_0x1227('0x22')](respondWithResult(_0x1a346e,null))[_0x1227('0x3a')](function(_0x27d7e1){var _0x4a37b5=_0x280e19[_0x1227('0x2b')][_0x1227('0x6c')]?0x1f4:_0x27d7e1[_0x1227('0x6d')]||0x1f4;logger[_0x1227('0x23')](_0x1227('0x6e'),_0x1227('0x6f'),_0x4a37b5,JSON[_0x1227('0x70')](_0x27d7e1));delete _0x27d7e1['name'];if(_0x4a37b5===0x191){_0x4a37b5=0x190;}_0x1a346e[_0x1227('0x15')](_0x4a37b5)[_0x1227('0x25')](_0x280e19[_0x1227('0x2b')][_0x1227('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x27d7e1[_0x1227('0x6d')]}:_0x27d7e1);});}else{var _0x17a812=0x1f4;_0x1a346e['status'](_0x17a812)[_0x1227('0x25')]({'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 465eba6..15f660f 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 _0x1e77=['../../config/logger','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x1e77,0xca));var _0x71e7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1e77[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x71e7('0x0'));var util=require(_0x71e7('0x1'));var logger=require(_0x71e7('0x2'))('api');var moment=require(_0x71e7('0x3'));var BPromise=require(_0x71e7('0x4'));var rp=require(_0x71e7('0x5'));var fs=require('fs');var path=require(_0x71e7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x71e7('0x7'));module[_0x71e7('0x8')]=function(_0x13bc6e,_0x30918b){return _0x13bc6e[_0x71e7('0x9')](_0x71e7('0xa'),attributes,{'tableName':_0x71e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5437=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0xe2b5a5,_0x436100){var _0x18f9d6=function(_0x375b9f){while(--_0x375b9f){_0xe2b5a5['push'](_0xe2b5a5['shift']());}};_0x18f9d6(++_0x436100);}(_0x5437,0x110));var _0x7543=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0x5437[_0x146be0];return _0x1bcc25;};'use strict';var _=require(_0x7543('0x0'));var util=require(_0x7543('0x1'));var logger=require('../../config/logger')(_0x7543('0x2'));var moment=require('moment');var BPromise=require(_0x7543('0x3'));var rp=require(_0x7543('0x4'));var fs=require('fs');var path=require(_0x7543('0x5'));var rimraf=require(_0x7543('0x6'));var config=require(_0x7543('0x7'));var attributes=require(_0x7543('0x8'));var integrations=require(_0x7543('0x9'));module['exports']=function(_0xc4a81c,_0x48b87c){return _0xc4a81c[_0x7543('0xa')](_0x7543('0xb'),attributes,{'tableName':_0x7543('0xc'),'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 4d48b25..35291bd 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 _0x39fd=['ShowSugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','map','include','model','attributes','debug'];(function(_0x29db25,_0x457467){var _0x48b1a5=function(_0x5cb05f){while(--_0x5cb05f){_0x29db25['push'](_0x29db25['shift']());}};_0x48b1a5(++_0x457467);}(_0x39fd,0x1d6));var _0xd39f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x39fd[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var moment=require(_0xd39f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd39f('0x3'));var fs=require('fs');var Redis=require(_0xd39f('0x4'));var db=require(_0xd39f('0x5'))['db'];var utils=require(_0xd39f('0x6'));var logger=require(_0xd39f('0x7'))(_0xd39f('0x8'));var config=require(_0xd39f('0x9'));var jayson=require(_0xd39f('0xa'));var client=jayson[_0xd39f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a66ff,_0x4f0a60,_0x31b285){return new BPromise(function(_0x331dd8,_0x27cd74){return client['request'](_0x2a66ff,_0x31b285)[_0xd39f('0xc')](function(_0x3c0268){logger[_0xd39f('0xd')](_0xd39f('0xe'),_0x4f0a60,'request\x20sent');logger['debug'](_0xd39f('0xf'),_0x4f0a60,_0xd39f('0x10'),JSON[_0xd39f('0x11')](_0x3c0268));if(_0x3c0268[_0xd39f('0x12')]){if(_0x3c0268['error']['code']===0x1f4){logger[_0xd39f('0x12')](_0xd39f('0xe'),_0x4f0a60,_0x3c0268['error'][_0xd39f('0x13')]);return _0x27cd74(_0x3c0268[_0xd39f('0x12')][_0xd39f('0x13')]);}logger[_0xd39f('0x12')](_0xd39f('0xe'),_0x4f0a60,_0x3c0268[_0xd39f('0x12')][_0xd39f('0x13')]);return _0x331dd8(_0x3c0268['error'][_0xd39f('0x13')]);}else{logger[_0xd39f('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x4f0a60,_0xd39f('0x10'));_0x331dd8(_0x3c0268[_0xd39f('0x14')][_0xd39f('0x13')]);}})[_0xd39f('0x15')](function(_0x4329e1){logger['error'](_0xd39f('0xe'),_0x4f0a60,_0x4329e1);_0x27cd74(_0x4329e1);});});}exports[_0xd39f('0x16')]=function(_0x319ddf){var _0x191a43=this;return new Promise(function(_0x2c4e74,_0x4bee20){return db[_0xd39f('0x17')][_0xd39f('0x18')]({'raw':_0x319ddf[_0xd39f('0x19')]?_0x319ddf[_0xd39f('0x19')][_0xd39f('0x1a')]===undefined?!![]:![]:!![],'where':_0x319ddf[_0xd39f('0x19')]?_0x319ddf[_0xd39f('0x19')][_0xd39f('0x1b')]||null:null,'attributes':_0x319ddf[_0xd39f('0x19')]?_0x319ddf[_0xd39f('0x19')]['attributes']||null:null,'limit':_0x319ddf[_0xd39f('0x19')]?_0x319ddf['options'][_0xd39f('0x1c')]||null:null,'include':_0x319ddf[_0xd39f('0x19')]?_0x319ddf['options']['include']?_[_0xd39f('0x1d')](_0x319ddf[_0xd39f('0x19')][_0xd39f('0x1e')],function(_0x5cf9d7){return{'model':db[_0x5cf9d7[_0xd39f('0x1f')]],'as':_0x5cf9d7['as'],'attributes':_0x5cf9d7['attributes'],'include':_0x5cf9d7[_0xd39f('0x1e')]?_['map'](_0x5cf9d7[_0xd39f('0x1e')],function(_0x29c38e){return{'model':db[_0x29c38e[_0xd39f('0x1f')]],'as':_0x29c38e['as'],'attributes':_0x29c38e[_0xd39f('0x20')],'include':_0x29c38e[_0xd39f('0x1e')]?_['map'](_0x29c38e[_0xd39f('0x1e')],function(_0x279f95){return{'model':db[_0x279f95[_0xd39f('0x1f')]],'as':_0x279f95['as'],'attributes':_0x279f95[_0xd39f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd39f('0xc')](function(_0x3e6154){logger[_0xd39f('0xd')](_0xd39f('0x16'),_0x319ddf);logger[_0xd39f('0x21')](_0xd39f('0x16'),_0x319ddf,JSON[_0xd39f('0x11')](_0x3e6154));_0x2c4e74(_0x3e6154);})[_0xd39f('0x15')](function(_0x31b621){logger[_0xd39f('0x12')](_0xd39f('0x16'),_0x31b621['message'],_0x319ddf);_0x4bee20(_0x191a43[_0xd39f('0x12')](0x1f4,_0x31b621[_0xd39f('0x13')]));});});};exports[_0xd39f('0x22')]=function(_0x998ac3){var _0x5380a1=this;return new Promise(function(_0x41d86d,_0x24b683){return db[_0xd39f('0x17')][_0xd39f('0x23')]({'raw':_0x998ac3[_0xd39f('0x19')]?_0x998ac3[_0xd39f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x998ac3[_0xd39f('0x19')]?_0x998ac3[_0xd39f('0x19')]['where']||null:null,'attributes':_0x998ac3['options']?_0x998ac3[_0xd39f('0x19')][_0xd39f('0x20')]||null:null,'include':_0x998ac3['options']?_0x998ac3[_0xd39f('0x19')][_0xd39f('0x1e')]?_['map'](_0x998ac3[_0xd39f('0x19')]['include'],function(_0x48f8bd){return{'model':db[_0x48f8bd[_0xd39f('0x1f')]],'as':_0x48f8bd['as'],'attributes':_0x48f8bd[_0xd39f('0x20')],'include':_0x48f8bd[_0xd39f('0x1e')]?_[_0xd39f('0x1d')](_0x48f8bd['include'],function(_0x89f82f){return{'model':db[_0x89f82f[_0xd39f('0x1f')]],'as':_0x89f82f['as'],'attributes':_0x89f82f[_0xd39f('0x20')],'include':_0x89f82f['include']?_[_0xd39f('0x1d')](_0x89f82f[_0xd39f('0x1e')],function(_0x21595a){return{'model':db[_0x21595a[_0xd39f('0x1f')]],'as':_0x21595a['as'],'attributes':_0x21595a[_0xd39f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd39f('0xc')](function(_0x553039){logger[_0xd39f('0xd')](_0xd39f('0x22'),_0x998ac3);logger[_0xd39f('0x21')](_0xd39f('0x22'),_0x998ac3,JSON[_0xd39f('0x11')](_0x553039));_0x41d86d(_0x553039);})[_0xd39f('0x15')](function(_0x30813c){logger[_0xd39f('0x12')](_0xd39f('0x22'),_0x30813c[_0xd39f('0x13')],_0x998ac3);_0x24b683(_0x5380a1[_0xd39f('0x12')](0x1f4,_0x30813c[_0xd39f('0x13')]));});});}; \ No newline at end of file +var _0x7494=['options','where','attributes','include','map','model','stringify','catch','ShowSugarcrmAccount','SugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSugarcrmAccount','findAll'];(function(_0x28507f,_0x1ec908){var _0x5599be=function(_0x51d287){while(--_0x51d287){_0x28507f['push'](_0x28507f['shift']());}};_0x5599be(++_0x1ec908);}(_0x7494,0x192));var _0x4749=function(_0x5d85c6,_0x155584){_0x5d85c6=_0x5d85c6-0x0;var _0x13a206=_0x7494[_0x5d85c6];return _0x13a206;};'use strict';var _=require(_0x4749('0x0'));var util=require(_0x4749('0x1'));var moment=require(_0x4749('0x2'));var BPromise=require(_0x4749('0x3'));var rs=require(_0x4749('0x4'));var fs=require('fs');var Redis=require(_0x4749('0x5'));var db=require(_0x4749('0x6'))['db'];var utils=require(_0x4749('0x7'));var logger=require(_0x4749('0x8'))(_0x4749('0x9'));var config=require(_0x4749('0xa'));var jayson=require(_0x4749('0xb'));var client=jayson[_0x4749('0xc')][_0x4749('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2decda,_0x2c93c1,_0xf1cd3b){return new BPromise(function(_0x5efc21,_0xe0257b){return client[_0x4749('0xe')](_0x2decda,_0xf1cd3b)[_0x4749('0xf')](function(_0x54cb11){logger[_0x4749('0x10')](_0x4749('0x11'),_0x2c93c1,_0x4749('0x12'));logger[_0x4749('0x13')](_0x4749('0x14'),_0x2c93c1,_0x4749('0x12'),JSON['stringify'](_0x54cb11));if(_0x54cb11[_0x4749('0x15')]){if(_0x54cb11['error'][_0x4749('0x16')]===0x1f4){logger[_0x4749('0x15')](_0x4749('0x11'),_0x2c93c1,_0x54cb11[_0x4749('0x15')][_0x4749('0x17')]);return _0xe0257b(_0x54cb11['error']['message']);}logger[_0x4749('0x15')](_0x4749('0x11'),_0x2c93c1,_0x54cb11[_0x4749('0x15')][_0x4749('0x17')]);return _0x5efc21(_0x54cb11[_0x4749('0x15')]['message']);}else{logger[_0x4749('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2c93c1,_0x4749('0x12'));_0x5efc21(_0x54cb11[_0x4749('0x18')]['message']);}})['catch'](function(_0x3dfef9){logger[_0x4749('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x2c93c1,_0x3dfef9);_0xe0257b(_0x3dfef9);});});}exports[_0x4749('0x19')]=function(_0x1b1f53){var _0x4840f1=this;return new Promise(function(_0x35a9f4,_0x446352){return db['SugarcrmAccount'][_0x4749('0x1a')]({'raw':_0x1b1f53[_0x4749('0x1b')]?_0x1b1f53['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b1f53[_0x4749('0x1b')]?_0x1b1f53[_0x4749('0x1b')][_0x4749('0x1c')]||null:null,'attributes':_0x1b1f53[_0x4749('0x1b')]?_0x1b1f53[_0x4749('0x1b')][_0x4749('0x1d')]||null:null,'limit':_0x1b1f53[_0x4749('0x1b')]?_0x1b1f53[_0x4749('0x1b')]['limit']||null:null,'include':_0x1b1f53[_0x4749('0x1b')]?_0x1b1f53[_0x4749('0x1b')][_0x4749('0x1e')]?_[_0x4749('0x1f')](_0x1b1f53[_0x4749('0x1b')][_0x4749('0x1e')],function(_0x512f04){return{'model':db[_0x512f04[_0x4749('0x20')]],'as':_0x512f04['as'],'attributes':_0x512f04[_0x4749('0x1d')],'include':_0x512f04['include']?_[_0x4749('0x1f')](_0x512f04[_0x4749('0x1e')],function(_0x3bd6b2){return{'model':db[_0x3bd6b2[_0x4749('0x20')]],'as':_0x3bd6b2['as'],'attributes':_0x3bd6b2[_0x4749('0x1d')],'include':_0x3bd6b2[_0x4749('0x1e')]?_['map'](_0x3bd6b2[_0x4749('0x1e')],function(_0x526560){return{'model':db[_0x526560['model']],'as':_0x526560['as'],'attributes':_0x526560['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5375b8){logger[_0x4749('0x10')](_0x4749('0x19'),_0x1b1f53);logger[_0x4749('0x13')](_0x4749('0x19'),_0x1b1f53,JSON[_0x4749('0x21')](_0x5375b8));_0x35a9f4(_0x5375b8);})[_0x4749('0x22')](function(_0xacfa1b){logger[_0x4749('0x15')](_0x4749('0x19'),_0xacfa1b[_0x4749('0x17')],_0x1b1f53);_0x446352(_0x4840f1[_0x4749('0x15')](0x1f4,_0xacfa1b[_0x4749('0x17')]));});});};exports[_0x4749('0x23')]=function(_0x2e719f){var _0x116493=this;return new Promise(function(_0x5d8526,_0x32fd78){return db[_0x4749('0x24')][_0x4749('0x25')]({'raw':_0x2e719f[_0x4749('0x1b')]?_0x2e719f[_0x4749('0x1b')][_0x4749('0x26')]===undefined?!![]:![]:!![],'where':_0x2e719f[_0x4749('0x1b')]?_0x2e719f[_0x4749('0x1b')]['where']||null:null,'attributes':_0x2e719f['options']?_0x2e719f[_0x4749('0x1b')][_0x4749('0x1d')]||null:null,'include':_0x2e719f[_0x4749('0x1b')]?_0x2e719f[_0x4749('0x1b')][_0x4749('0x1e')]?_[_0x4749('0x1f')](_0x2e719f[_0x4749('0x1b')][_0x4749('0x1e')],function(_0x179942){return{'model':db[_0x179942['model']],'as':_0x179942['as'],'attributes':_0x179942[_0x4749('0x1d')],'include':_0x179942[_0x4749('0x1e')]?_['map'](_0x179942[_0x4749('0x1e')],function(_0x28961f){return{'model':db[_0x28961f['model']],'as':_0x28961f['as'],'attributes':_0x28961f[_0x4749('0x1d')],'include':_0x28961f[_0x4749('0x1e')]?_[_0x4749('0x1f')](_0x28961f[_0x4749('0x1e')],function(_0x3be612){return{'model':db[_0x3be612[_0x4749('0x20')]],'as':_0x3be612['as'],'attributes':_0x3be612[_0x4749('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d0644){logger['info'](_0x4749('0x23'),_0x2e719f);logger['debug'](_0x4749('0x23'),_0x2e719f,JSON[_0x4749('0x21')](_0x2d0644));_0x5d8526(_0x2d0644);})[_0x4749('0x22')](function(_0x5af329){logger[_0x4749('0x15')](_0x4749('0x23'),_0x5af329[_0x4749('0x17')],_0x2e719f);_0x32fd78(_0x116493[_0x4749('0x15')](0x1f4,_0x5af329[_0x4749('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 30a9932..6aa86b1 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 _0x662e=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x107097,_0x37b305){var _0x4d5867=function(_0xd446ce){while(--_0xd446ce){_0x107097['push'](_0x107097['shift']());}};_0x4d5867(++_0x37b305);}(_0x662e,0x84));var _0xe662=function(_0x5a87dc,_0x5cb55f){_0x5a87dc=_0x5a87dc-0x0;var _0x7cf84a=_0x662e[_0x5a87dc];return _0x7cf84a;};'use strict';var multer=require(_0xe662('0x0'));var util=require(_0xe662('0x1'));var path=require(_0xe662('0x2'));var timeout=require(_0xe662('0x3'));var express=require(_0xe662('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe662('0x5'));var interaction=require(_0xe662('0x6'));var config=require(_0xe662('0x7'));var controller=require(_0xe662('0x8'));router[_0xe662('0x9')]('/',auth[_0xe662('0xa')](),controller['index']);router[_0xe662('0x9')]('/:id',auth[_0xe662('0xa')](),controller[_0xe662('0xb')]);router[_0xe662('0x9')](_0xe662('0xc'),auth[_0xe662('0xa')](),controller[_0xe662('0xd')]);router[_0xe662('0x9')](_0xe662('0xe'),auth[_0xe662('0xa')](),controller[_0xe662('0xf')]);router[_0xe662('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe662('0x10')]);router[_0xe662('0x11')]('/',auth[_0xe662('0xa')](),controller['create']);router[_0xe662('0x12')](_0xe662('0x13'),auth[_0xe662('0xa')](),controller[_0xe662('0x14')]);router['delete'](_0xe662('0x13'),auth[_0xe662('0xa')](),controller[_0xe662('0x15')]);module[_0xe662('0x16')]=router; \ No newline at end of file +var _0xc9c0=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','delete'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xc9c0,0xff));var _0x0c9c=function(_0x267ca4,_0x27f27e){_0x267ca4=_0x267ca4-0x0;var _0x366eeb=_0xc9c0[_0x267ca4];return _0x366eeb;};'use strict';var multer=require('multer');var util=require(_0x0c9c('0x0'));var path=require(_0x0c9c('0x1'));var timeout=require(_0x0c9c('0x2'));var express=require('express');var router=express[_0x0c9c('0x3')]();var fs_extra=require(_0x0c9c('0x4'));var auth=require(_0x0c9c('0x5'));var interaction=require(_0x0c9c('0x6'));var config=require(_0x0c9c('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x0c9c('0x8')]('/',auth[_0x0c9c('0x9')](),controller[_0x0c9c('0xa')]);router[_0x0c9c('0x8')](_0x0c9c('0xb'),auth[_0x0c9c('0x9')](),controller[_0x0c9c('0xc')]);router[_0x0c9c('0x8')](_0x0c9c('0xd'),auth['isAuthenticated'](),controller[_0x0c9c('0xe')]);router['get'](_0x0c9c('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x0c9c('0x10'),auth[_0x0c9c('0x9')](),controller['getDescriptions']);router[_0x0c9c('0x11')]('/',auth[_0x0c9c('0x9')](),controller['create']);router[_0x0c9c('0x12')](_0x0c9c('0xb'),auth['isAuthenticated'](),controller[_0x0c9c('0x13')]);router[_0x0c9c('0x14')](_0x0c9c('0xb'),auth['isAuthenticated'](),controller[_0x0c9c('0x15')]);module[_0x0c9c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 66392f8..1d240c4 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 _0xceef=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceef,0x140));var _0xfcee=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0xceef[_0x1057cb];return _0x7fbf7e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfcee('0x0')]}}; \ No newline at end of file +var _0x4322=['STRING'];(function(_0x21fdd2,_0x3990c6){var _0x27b1ba=function(_0x55f23c){while(--_0x55f23c){_0x21fdd2['push'](_0x21fdd2['shift']());}};_0x27b1ba(++_0x3990c6);}(_0x4322,0xff));var _0x2432=function(_0x3eb7a3,_0x543d67){_0x3eb7a3=_0x3eb7a3-0x0;var _0xfd4e54=_0x4322[_0x3eb7a3];return _0xfd4e54;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2432('0x0')]},'description':{'type':Sequelize[_0x2432('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e8ace19..15f371a 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 _0x2a13=['lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','intersection','length','includeAll','find','catch','create','body','update','findOne','SugarcrmField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra'];(function(_0x52e668,_0x1f9d05){var _0x18f0af=function(_0x49e5ee){while(--_0x49e5ee){_0x52e668['push'](_0x52e668['shift']());}};_0x18f0af(++_0x1f9d05);}(_0x2a13,0x190));var _0x32a1=function(_0x5d3623,_0x2330b6){_0x5d3623=_0x5d3623-0x0;var _0x4e6a21=_0x2a13[_0x5d3623];return _0x4e6a21;};'use strict';var emlformat=require(_0x32a1('0x0'));var rimraf=require(_0x32a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x32a1('0x2'));var rp=require(_0x32a1('0x3'));var moment=require('moment');var BPromise=require(_0x32a1('0x4'));var Mustache=require(_0x32a1('0x5'));var util=require('util');var path=require(_0x32a1('0x6'));var sox=require(_0x32a1('0x7'));var csv=require('to-csv');var ejs=require(_0x32a1('0x8'));var fs=require('fs');var fs_extra=require(_0x32a1('0x9'));var _=require(_0x32a1('0xa'));var squel=require('squel');var crypto=require(_0x32a1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x32a1('0xc'));var toCsv=require(_0x32a1('0xd'));var querystring=require(_0x32a1('0xe'));var Papa=require('papaparse');var Redis=require(_0x32a1('0xf'));var authService=require(_0x32a1('0x10'));var qs=require(_0x32a1('0x11'));var as=require(_0x32a1('0x12'));var hardwareService=require(_0x32a1('0x13'));var logger=require(_0x32a1('0x14'))(_0x32a1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x32a1('0x16'))['db'];function respondWithStatusCode(_0x57cacb,_0x229c6d){_0x229c6d=_0x229c6d||0xcc;return function(_0x355942){if(_0x355942){return _0x57cacb[_0x32a1('0x17')](_0x229c6d);}return _0x57cacb[_0x32a1('0x18')](_0x229c6d)[_0x32a1('0x19')]();};}function respondWithResult(_0x15a6ca,_0x283043){_0x283043=_0x283043||0xc8;return function(_0x5034dd){if(_0x5034dd){return _0x15a6ca[_0x32a1('0x18')](_0x283043)['json'](_0x5034dd);}};}function respondWithFilteredResult(_0x5a8cdb,_0x4ccbaf){return function(_0xb8ba52){if(_0xb8ba52){var _0x2a7a52=typeof _0x4ccbaf[_0x32a1('0x1a')]==='undefined'&&typeof _0x4ccbaf[_0x32a1('0x1b')]===_0x32a1('0x1c');var _0x5e7dd9=_0xb8ba52['count'];var _0x466d78=_0x2a7a52?0x0:_0x4ccbaf[_0x32a1('0x1a')];var _0x5c610b=_0x2a7a52?_0xb8ba52[_0x32a1('0x1d')]:_0x4ccbaf[_0x32a1('0x1a')]+_0x4ccbaf[_0x32a1('0x1b')];var _0x4d06ca;if(_0x5c610b>=_0x5e7dd9){_0x5c610b=_0x5e7dd9;_0x4d06ca=0xc8;}else{_0x4d06ca=0xce;}_0x5a8cdb[_0x32a1('0x18')](_0x4d06ca);return _0x5a8cdb[_0x32a1('0x1e')](_0x32a1('0x1f'),_0x466d78+'-'+_0x5c610b+'/'+_0x5e7dd9)[_0x32a1('0x20')](_0xb8ba52);}return null;};}function patchUpdates(_0xb0d4a0){return function(_0x538524){try{jsonpatch[_0x32a1('0x21')](_0x538524,_0xb0d4a0,!![]);}catch(_0xddbf07){return BPromise[_0x32a1('0x22')](_0xddbf07);}return _0x538524[_0x32a1('0x23')]();};}function saveUpdates(_0x2ec78d,_0xd69db7){return function(_0x25ba55){if(_0x25ba55){return _0x25ba55['update'](_0x2ec78d)[_0x32a1('0x24')](function(_0x139500){return _0x139500;});}return null;};}function removeEntity(_0x26cd98,_0x1ce0a8){return function(_0x267e88){if(_0x267e88){return _0x267e88[_0x32a1('0x25')]()[_0x32a1('0x24')](function(){_0x26cd98[_0x32a1('0x18')](0xcc)[_0x32a1('0x19')]();});}};}function handleEntityNotFound(_0x29d688,_0xa9f168){return function(_0x245f60){if(!_0x245f60){_0x29d688['sendStatus'](0x194);}return _0x245f60;};}function handleError(_0x5cc31a,_0x5253e1){_0x5253e1=_0x5253e1||0x1f4;return function(_0xe480bf){logger[_0x32a1('0x26')](_0xe480bf['stack']);if(_0xe480bf['name']){delete _0xe480bf[_0x32a1('0x27')];}_0x5cc31a[_0x32a1('0x18')](_0x5253e1)[_0x32a1('0x28')](_0xe480bf);};}exports[_0x32a1('0x29')]=function(_0x5ca800,_0x4035b9){var _0x3e0479={},_0x56eee2={},_0xe87906={'count':0x0,'rows':[]};var _0x4df5d2=_['map'](db[_0x32a1('0x2a')][_0x32a1('0x2b')],function(_0x999efb){return{'name':_0x999efb[_0x32a1('0x2c')],'type':_0x999efb[_0x32a1('0x2d')][_0x32a1('0x2e')]};});_0x56eee2[_0x32a1('0x2f')]=_[_0x32a1('0x30')](_0x4df5d2,_0x32a1('0x27'));_0x56eee2[_0x32a1('0x31')]=_['keys'](_0x5ca800[_0x32a1('0x31')]);_0x56eee2[_0x32a1('0x32')]=_['intersection'](_0x56eee2[_0x32a1('0x2f')],_0x56eee2['query']);_0x3e0479[_0x32a1('0x33')]=_['intersection'](_0x56eee2[_0x32a1('0x2f')],qs[_0x32a1('0x34')](_0x5ca800[_0x32a1('0x31')][_0x32a1('0x34')]));_0x3e0479[_0x32a1('0x33')]=_0x3e0479[_0x32a1('0x33')]['length']?_0x3e0479['attributes']:_0x56eee2[_0x32a1('0x2f')];if(!_0x5ca800[_0x32a1('0x31')][_0x32a1('0x35')]('nolimit')){_0x3e0479[_0x32a1('0x1b')]=qs[_0x32a1('0x1b')](_0x5ca800[_0x32a1('0x31')][_0x32a1('0x1b')]);_0x3e0479[_0x32a1('0x1a')]=qs['offset'](_0x5ca800[_0x32a1('0x31')][_0x32a1('0x1a')]);}_0x3e0479[_0x32a1('0x36')]=qs[_0x32a1('0x37')](_0x5ca800[_0x32a1('0x31')][_0x32a1('0x37')]);_0x3e0479[_0x32a1('0x38')]=qs['filters'](_[_0x32a1('0x39')](_0x5ca800['query'],_0x56eee2[_0x32a1('0x32')]),_0x4df5d2);if(_0x5ca800[_0x32a1('0x31')][_0x32a1('0x3a')]){_0x3e0479[_0x32a1('0x38')]=_[_0x32a1('0x3b')](_0x3e0479[_0x32a1('0x38')],{'$or':_['map'](_0x4df5d2,function(_0x25f9fc){if(_0x25f9fc[_0x32a1('0x2d')]!==_0x32a1('0x3c')){var _0x2c730d={};_0x2c730d[_0x25f9fc[_0x32a1('0x27')]]={'$like':'%'+_0x5ca800[_0x32a1('0x31')][_0x32a1('0x3a')]+'%'};return _0x2c730d;}})});}_0x3e0479=_[_0x32a1('0x3b')]({},_0x3e0479,_0x5ca800[_0x32a1('0x3d')]);var _0x25d650={'where':_0x3e0479['where']};return db[_0x32a1('0x2a')][_0x32a1('0x1d')](_0x25d650)[_0x32a1('0x24')](function(_0x203201){_0xe87906[_0x32a1('0x1d')]=_0x203201;if(_0x5ca800['query']['includeAll']){_0x3e0479[_0x32a1('0x3e')]=[{'all':!![]}];}return db[_0x32a1('0x2a')][_0x32a1('0x3f')](_0x3e0479);})['then'](function(_0x2da27c){_0xe87906[_0x32a1('0x40')]=_0x2da27c;return _0xe87906;})[_0x32a1('0x24')](respondWithFilteredResult(_0x4035b9,_0x3e0479))['catch'](handleError(_0x4035b9,null));};exports[_0x32a1('0x41')]=function(_0xf4aa9e,_0x4b9f09){var _0x2b6652={'raw':![],'where':{'id':_0xf4aa9e[_0x32a1('0x42')]['id']}},_0x79fc48={};_0x79fc48[_0x32a1('0x2f')]=_['keys'](db[_0x32a1('0x2a')][_0x32a1('0x2b')]);_0x79fc48[_0x32a1('0x31')]=_[_0x32a1('0x43')](_0xf4aa9e[_0x32a1('0x31')]);_0x79fc48['filters']=_[_0x32a1('0x44')](_0x79fc48['model'],_0x79fc48['query']);_0x2b6652[_0x32a1('0x33')]=_['intersection'](_0x79fc48[_0x32a1('0x2f')],qs[_0x32a1('0x34')](_0xf4aa9e[_0x32a1('0x31')][_0x32a1('0x34')]));_0x2b6652['attributes']=_0x2b6652[_0x32a1('0x33')][_0x32a1('0x45')]?_0x2b6652['attributes']:_0x79fc48[_0x32a1('0x2f')];if(_0xf4aa9e['query'][_0x32a1('0x46')]){_0x2b6652[_0x32a1('0x3e')]=[{'all':!![]}];}_0x2b6652=_[_0x32a1('0x3b')]({},_0x2b6652,_0xf4aa9e[_0x32a1('0x3d')]);return db['SugarcrmConfiguration'][_0x32a1('0x47')](_0x2b6652)[_0x32a1('0x24')](handleEntityNotFound(_0x4b9f09,null))[_0x32a1('0x24')](respondWithResult(_0x4b9f09,null))[_0x32a1('0x48')](handleError(_0x4b9f09,null));};exports[_0x32a1('0x49')]=function(_0x2a7f72,_0xab059f){return db[_0x32a1('0x2a')][_0x32a1('0x49')](_0x2a7f72[_0x32a1('0x4a')],{})[_0x32a1('0x24')](respondWithResult(_0xab059f,0xc9))['catch'](handleError(_0xab059f,null));};exports[_0x32a1('0x4b')]=function(_0x3487b5,_0x103c44){if(_0x3487b5[_0x32a1('0x4a')]['id']){delete _0x3487b5['body']['id'];}return db['SugarcrmConfiguration'][_0x32a1('0x47')]({'where':{'id':_0x3487b5[_0x32a1('0x42')]['id']}})[_0x32a1('0x24')](handleEntityNotFound(_0x103c44,null))[_0x32a1('0x24')](saveUpdates(_0x3487b5[_0x32a1('0x4a')],null))[_0x32a1('0x24')](respondWithResult(_0x103c44,null))[_0x32a1('0x48')](handleError(_0x103c44,null));};exports[_0x32a1('0x25')]=function(_0x511469,_0x364be3){return db[_0x32a1('0x2a')]['find']({'where':{'id':_0x511469[_0x32a1('0x42')]['id']}})[_0x32a1('0x24')](handleEntityNotFound(_0x364be3,null))[_0x32a1('0x24')](removeEntity(_0x364be3,null))[_0x32a1('0x48')](handleError(_0x364be3,null));};exports['getFields']=function(_0x289f3a,_0x5de8e2,_0x2e209f){var _0x470eef={};var _0x4b40c4={};var _0x2a5c76;var _0x5380c9;return db[_0x32a1('0x2a')][_0x32a1('0x4c')]({'where':{'id':_0x289f3a[_0x32a1('0x42')]['id']}})[_0x32a1('0x24')](handleEntityNotFound(_0x5de8e2,null))[_0x32a1('0x24')](function(_0x532b62){if(_0x532b62){_0x2a5c76=_0x532b62;_0x4b40c4[_0x32a1('0x2f')]=_[_0x32a1('0x43')](db[_0x32a1('0x4d')][_0x32a1('0x2b')]);_0x4b40c4[_0x32a1('0x31')]=_[_0x32a1('0x43')](_0x289f3a[_0x32a1('0x31')]);_0x4b40c4[_0x32a1('0x32')]=_['intersection'](_0x4b40c4[_0x32a1('0x2f')],_0x4b40c4['query']);_0x470eef[_0x32a1('0x33')]=_[_0x32a1('0x44')](_0x4b40c4[_0x32a1('0x2f')],qs['fields'](_0x289f3a[_0x32a1('0x31')][_0x32a1('0x34')]));_0x470eef[_0x32a1('0x33')]=_0x470eef[_0x32a1('0x33')][_0x32a1('0x45')]?_0x470eef[_0x32a1('0x33')]:_0x4b40c4[_0x32a1('0x2f')];_0x470eef[_0x32a1('0x36')]=qs[_0x32a1('0x37')](_0x289f3a[_0x32a1('0x31')][_0x32a1('0x37')]);_0x470eef[_0x32a1('0x38')]=qs[_0x32a1('0x32')](_['pick'](_0x289f3a[_0x32a1('0x31')],_0x4b40c4['filters']));if(_0x289f3a[_0x32a1('0x31')][_0x32a1('0x3a')]){_0x470eef['where']=_[_0x32a1('0x3b')](_0x470eef[_0x32a1('0x38')],{'$or':_['map'](_0x470eef[_0x32a1('0x33')],function(_0x19b6de){var _0x24697e={};_0x24697e[_0x19b6de]={'$like':'%'+_0x289f3a[_0x32a1('0x31')][_0x32a1('0x3a')]+'%'};return _0x24697e;})});}_0x470eef=_[_0x32a1('0x3b')]({},_0x470eef,_0x289f3a[_0x32a1('0x3d')]);return _0x2a5c76[_0x32a1('0x4e')](_0x470eef);}})[_0x32a1('0x24')](function(_0x4a1618){if(_0x4a1618){_0x5380c9=_0x4a1618['length'];if(!_0x289f3a[_0x32a1('0x31')][_0x32a1('0x35')](_0x32a1('0x4f'))){_0x470eef[_0x32a1('0x1b')]=qs[_0x32a1('0x1b')](_0x289f3a['query'][_0x32a1('0x1b')]);_0x470eef['offset']=qs[_0x32a1('0x1a')](_0x289f3a[_0x32a1('0x31')][_0x32a1('0x1a')]);}return _0x2a5c76['getFields'](_0x470eef);}})[_0x32a1('0x24')](function(_0x3979b2){if(_0x3979b2){return _0x3979b2?{'count':_0x5380c9,'rows':_0x3979b2}:null;}})[_0x32a1('0x24')](respondWithResult(_0x5de8e2,null))[_0x32a1('0x48')](handleError(_0x5de8e2,null));};exports[_0x32a1('0x50')]=function(_0x1c0074,_0x531822,_0x94e00e){var _0x3c2af8={};var _0x5c4f04={};var _0x211b10;var _0x5aec18;return db[_0x32a1('0x2a')][_0x32a1('0x4c')]({'where':{'id':_0x1c0074[_0x32a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x531822,null))[_0x32a1('0x24')](function(_0x24efc4){if(_0x24efc4){_0x211b10=_0x24efc4;_0x5c4f04[_0x32a1('0x2f')]=_[_0x32a1('0x43')](db[_0x32a1('0x4d')][_0x32a1('0x2b')]);_0x5c4f04['query']=_['keys'](_0x1c0074[_0x32a1('0x31')]);_0x5c4f04[_0x32a1('0x32')]=_[_0x32a1('0x44')](_0x5c4f04[_0x32a1('0x2f')],_0x5c4f04[_0x32a1('0x31')]);_0x3c2af8[_0x32a1('0x33')]=_[_0x32a1('0x44')](_0x5c4f04['model'],qs[_0x32a1('0x34')](_0x1c0074['query'][_0x32a1('0x34')]));_0x3c2af8[_0x32a1('0x33')]=_0x3c2af8[_0x32a1('0x33')][_0x32a1('0x45')]?_0x3c2af8[_0x32a1('0x33')]:_0x5c4f04[_0x32a1('0x2f')];_0x3c2af8['order']=qs[_0x32a1('0x37')](_0x1c0074['query'][_0x32a1('0x37')]);_0x3c2af8[_0x32a1('0x38')]=qs[_0x32a1('0x32')](_[_0x32a1('0x39')](_0x1c0074[_0x32a1('0x31')],_0x5c4f04[_0x32a1('0x32')]));if(_0x1c0074[_0x32a1('0x31')][_0x32a1('0x3a')]){_0x3c2af8[_0x32a1('0x38')]=_[_0x32a1('0x3b')](_0x3c2af8[_0x32a1('0x38')],{'$or':_[_0x32a1('0x30')](_0x3c2af8[_0x32a1('0x33')],function(_0x1c17bf){var _0x58aaea={};_0x58aaea[_0x1c17bf]={'$like':'%'+_0x1c0074[_0x32a1('0x31')][_0x32a1('0x3a')]+'%'};return _0x58aaea;})});}_0x3c2af8=_[_0x32a1('0x3b')]({},_0x3c2af8,_0x1c0074[_0x32a1('0x3d')]);return _0x211b10[_0x32a1('0x50')](_0x3c2af8);}})[_0x32a1('0x24')](function(_0x5b59eb){if(_0x5b59eb){_0x5aec18=_0x5b59eb['length'];if(!_0x1c0074['query'][_0x32a1('0x35')](_0x32a1('0x4f'))){_0x3c2af8[_0x32a1('0x1b')]=qs[_0x32a1('0x1b')](_0x1c0074[_0x32a1('0x31')][_0x32a1('0x1b')]);_0x3c2af8[_0x32a1('0x1a')]=qs['offset'](_0x1c0074['query'][_0x32a1('0x1a')]);}return _0x211b10[_0x32a1('0x50')](_0x3c2af8);}})['then'](function(_0x3901a0){if(_0x3901a0){return _0x3901a0?{'count':_0x5aec18,'rows':_0x3901a0}:null;}})['then'](respondWithResult(_0x531822,null))[_0x32a1('0x48')](handleError(_0x531822,null));};exports[_0x32a1('0x51')]=function(_0x466b9b,_0x2b8ae2,_0xc9e969){var _0x3ba0df={};var _0x15924f={};var _0x38e016;var _0x1e61b1;return db[_0x32a1('0x2a')][_0x32a1('0x4c')]({'where':{'id':_0x466b9b['params']['id']}})[_0x32a1('0x24')](handleEntityNotFound(_0x2b8ae2,null))['then'](function(_0x13f198){if(_0x13f198){_0x38e016=_0x13f198;_0x15924f[_0x32a1('0x2f')]=_[_0x32a1('0x43')](db[_0x32a1('0x4d')]['rawAttributes']);_0x15924f[_0x32a1('0x31')]=_[_0x32a1('0x43')](_0x466b9b['query']);_0x15924f[_0x32a1('0x32')]=_[_0x32a1('0x44')](_0x15924f[_0x32a1('0x2f')],_0x15924f[_0x32a1('0x31')]);_0x3ba0df[_0x32a1('0x33')]=_['intersection'](_0x15924f[_0x32a1('0x2f')],qs[_0x32a1('0x34')](_0x466b9b[_0x32a1('0x31')][_0x32a1('0x34')]));_0x3ba0df[_0x32a1('0x33')]=_0x3ba0df[_0x32a1('0x33')][_0x32a1('0x45')]?_0x3ba0df['attributes']:_0x15924f[_0x32a1('0x2f')];_0x3ba0df[_0x32a1('0x36')]=qs[_0x32a1('0x37')](_0x466b9b[_0x32a1('0x31')][_0x32a1('0x37')]);_0x3ba0df[_0x32a1('0x38')]=qs[_0x32a1('0x32')](_[_0x32a1('0x39')](_0x466b9b[_0x32a1('0x31')],_0x15924f[_0x32a1('0x32')]));if(_0x466b9b['query']['filter']){_0x3ba0df['where']=_['merge'](_0x3ba0df['where'],{'$or':_[_0x32a1('0x30')](_0x3ba0df[_0x32a1('0x33')],function(_0x133c36){var _0x475a14={};_0x475a14[_0x133c36]={'$like':'%'+_0x466b9b[_0x32a1('0x31')][_0x32a1('0x3a')]+'%'};return _0x475a14;})});}_0x3ba0df=_[_0x32a1('0x3b')]({},_0x3ba0df,_0x466b9b[_0x32a1('0x3d')]);return _0x38e016[_0x32a1('0x51')](_0x3ba0df);}})['then'](function(_0x1f62b0){if(_0x1f62b0){_0x1e61b1=_0x1f62b0['length'];if(!_0x466b9b[_0x32a1('0x31')][_0x32a1('0x35')](_0x32a1('0x4f'))){_0x3ba0df[_0x32a1('0x1b')]=qs[_0x32a1('0x1b')](_0x466b9b[_0x32a1('0x31')][_0x32a1('0x1b')]);_0x3ba0df[_0x32a1('0x1a')]=qs['offset'](_0x466b9b['query']['offset']);}return _0x38e016[_0x32a1('0x51')](_0x3ba0df);}})[_0x32a1('0x24')](function(_0x46a24a){if(_0x46a24a){return _0x46a24a?{'count':_0x1e61b1,'rows':_0x46a24a}:null;}})[_0x32a1('0x24')](respondWithResult(_0x2b8ae2,null))[_0x32a1('0x48')](handleError(_0x2b8ae2,null));}; \ No newline at end of file +var _0x13a6=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','index','SugarcrmConfiguration','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','getFields','SugarcrmField','order','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x425d8d,_0x127bc7){var _0x482d72=function(_0x1b9f0e){while(--_0x1b9f0e){_0x425d8d['push'](_0x425d8d['shift']());}};_0x482d72(++_0x127bc7);}(_0x13a6,0xde));var _0x613a=function(_0x1cae11,_0x4d81e8){_0x1cae11=_0x1cae11-0x0;var _0x123839=_0x13a6[_0x1cae11];return _0x123839;};'use strict';var emlformat=require(_0x613a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x613a('0x1'));var jsonpatch=require(_0x613a('0x2'));var rp=require('request-promise');var moment=require(_0x613a('0x3'));var BPromise=require(_0x613a('0x4'));var Mustache=require(_0x613a('0x5'));var util=require(_0x613a('0x6'));var path=require(_0x613a('0x7'));var sox=require(_0x613a('0x8'));var csv=require(_0x613a('0x9'));var ejs=require(_0x613a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x613a('0xb'));var squel=require(_0x613a('0xc'));var crypto=require('crypto');var jsforce=require(_0x613a('0xd'));var deskjs=require(_0x613a('0xe'));var toCsv=require(_0x613a('0x9'));var querystring=require('querystring');var Papa=require(_0x613a('0xf'));var Redis=require(_0x613a('0x10'));var authService=require(_0x613a('0x11'));var qs=require(_0x613a('0x12'));var as=require(_0x613a('0x13'));var hardwareService=require(_0x613a('0x14'));var logger=require(_0x613a('0x15'))(_0x613a('0x16'));var utils=require(_0x613a('0x17'));var config=require(_0x613a('0x18'));var licenseUtil=require(_0x613a('0x19'));var db=require(_0x613a('0x1a'))['db'];function respondWithStatusCode(_0x57b6c0,_0x5b90b1){_0x5b90b1=_0x5b90b1||0xcc;return function(_0x3f9b37){if(_0x3f9b37){return _0x57b6c0['sendStatus'](_0x5b90b1);}return _0x57b6c0[_0x613a('0x1b')](_0x5b90b1)[_0x613a('0x1c')]();};}function respondWithResult(_0x28275c,_0x34b675){_0x34b675=_0x34b675||0xc8;return function(_0x35e3d3){if(_0x35e3d3){return _0x28275c[_0x613a('0x1b')](_0x34b675)[_0x613a('0x1d')](_0x35e3d3);}};}function respondWithFilteredResult(_0x1e4b20,_0x3f3561){return function(_0xc0572c){if(_0xc0572c){var _0x39ffa8=typeof _0x3f3561[_0x613a('0x1e')]===_0x613a('0x1f')&&typeof _0x3f3561[_0x613a('0x20')]===_0x613a('0x1f');var _0x2f6336=_0xc0572c[_0x613a('0x21')];var _0x15bc95=_0x39ffa8?0x0:_0x3f3561[_0x613a('0x1e')];var _0x5438f3=_0x39ffa8?_0xc0572c[_0x613a('0x21')]:_0x3f3561[_0x613a('0x1e')]+_0x3f3561[_0x613a('0x20')];var _0x2dd234;if(_0x5438f3>=_0x2f6336){_0x5438f3=_0x2f6336;_0x2dd234=0xc8;}else{_0x2dd234=0xce;}_0x1e4b20[_0x613a('0x1b')](_0x2dd234);return _0x1e4b20['set'](_0x613a('0x22'),_0x15bc95+'-'+_0x5438f3+'/'+_0x2f6336)['json'](_0xc0572c);}return null;};}function patchUpdates(_0x97b48f){return function(_0x359bec){try{jsonpatch[_0x613a('0x23')](_0x359bec,_0x97b48f,!![]);}catch(_0x30bac9){return BPromise[_0x613a('0x24')](_0x30bac9);}return _0x359bec['save']();};}function saveUpdates(_0x33f58a,_0x3ddd5b){return function(_0x1da5f1){if(_0x1da5f1){return _0x1da5f1[_0x613a('0x25')](_0x33f58a)['then'](function(_0x2dca81){return _0x2dca81;});}return null;};}function removeEntity(_0x4a97bd,_0xbe82f6){return function(_0x123494){if(_0x123494){return _0x123494[_0x613a('0x26')]()[_0x613a('0x27')](function(){_0x4a97bd[_0x613a('0x1b')](0xcc)[_0x613a('0x1c')]();});}};}function handleEntityNotFound(_0x26e531,_0x2a6cfe){return function(_0x1bcec5){if(!_0x1bcec5){_0x26e531[_0x613a('0x28')](0x194);}return _0x1bcec5;};}function handleError(_0x141429,_0x1b8e3e){_0x1b8e3e=_0x1b8e3e||0x1f4;return function(_0x2fc90f){logger[_0x613a('0x29')](_0x2fc90f[_0x613a('0x2a')]);if(_0x2fc90f['name']){delete _0x2fc90f[_0x613a('0x2b')];}_0x141429[_0x613a('0x1b')](_0x1b8e3e)['send'](_0x2fc90f);};}exports[_0x613a('0x2c')]=function(_0x339482,_0x33540e){var _0x464f5f={},_0x1da8c8={},_0x131d68={'count':0x0,'rows':[]};var _0x3831d7=_['map'](db[_0x613a('0x2d')]['rawAttributes'],function(_0x37f5b4){return{'name':_0x37f5b4[_0x613a('0x2e')],'type':_0x37f5b4['type']['key']};});_0x1da8c8[_0x613a('0x2f')]=_[_0x613a('0x30')](_0x3831d7,_0x613a('0x2b'));_0x1da8c8[_0x613a('0x31')]=_[_0x613a('0x32')](_0x339482['query']);_0x1da8c8['filters']=_[_0x613a('0x33')](_0x1da8c8[_0x613a('0x2f')],_0x1da8c8[_0x613a('0x31')]);_0x464f5f['attributes']=_[_0x613a('0x33')](_0x1da8c8[_0x613a('0x2f')],qs['fields'](_0x339482['query'][_0x613a('0x34')]));_0x464f5f['attributes']=_0x464f5f[_0x613a('0x35')][_0x613a('0x36')]?_0x464f5f[_0x613a('0x35')]:_0x1da8c8[_0x613a('0x2f')];if(!_0x339482[_0x613a('0x31')][_0x613a('0x37')](_0x613a('0x38'))){_0x464f5f[_0x613a('0x20')]=qs[_0x613a('0x20')](_0x339482['query'][_0x613a('0x20')]);_0x464f5f[_0x613a('0x1e')]=qs[_0x613a('0x1e')](_0x339482['query'][_0x613a('0x1e')]);}_0x464f5f['order']=qs[_0x613a('0x39')](_0x339482['query']['sort']);_0x464f5f['where']=qs['filters'](_[_0x613a('0x3a')](_0x339482[_0x613a('0x31')],_0x1da8c8[_0x613a('0x3b')]),_0x3831d7);if(_0x339482[_0x613a('0x31')][_0x613a('0x3c')]){_0x464f5f[_0x613a('0x3d')]=_['merge'](_0x464f5f[_0x613a('0x3d')],{'$or':_[_0x613a('0x30')](_0x3831d7,function(_0x2dacd4){if(_0x2dacd4[_0x613a('0x3e')]!=='VIRTUAL'){var _0x1a318d={};_0x1a318d[_0x2dacd4[_0x613a('0x2b')]]={'$like':'%'+_0x339482[_0x613a('0x31')][_0x613a('0x3c')]+'%'};return _0x1a318d;}})});}_0x464f5f=_['merge']({},_0x464f5f,_0x339482[_0x613a('0x3f')]);var _0x4bb1ef={'where':_0x464f5f[_0x613a('0x3d')]};return db[_0x613a('0x2d')]['count'](_0x4bb1ef)[_0x613a('0x27')](function(_0x2890dd){_0x131d68[_0x613a('0x21')]=_0x2890dd;if(_0x339482[_0x613a('0x31')][_0x613a('0x40')]){_0x464f5f[_0x613a('0x41')]=[{'all':!![]}];}return db[_0x613a('0x2d')][_0x613a('0x42')](_0x464f5f);})[_0x613a('0x27')](function(_0x5c38b0){_0x131d68[_0x613a('0x43')]=_0x5c38b0;return _0x131d68;})[_0x613a('0x27')](respondWithFilteredResult(_0x33540e,_0x464f5f))[_0x613a('0x44')](handleError(_0x33540e,null));};exports[_0x613a('0x45')]=function(_0x5e7653,_0x228414){var _0x32a0dd={'raw':![],'where':{'id':_0x5e7653[_0x613a('0x46')]['id']}},_0x278d52={};_0x278d52['model']=_[_0x613a('0x32')](db[_0x613a('0x2d')][_0x613a('0x47')]);_0x278d52[_0x613a('0x31')]=_[_0x613a('0x32')](_0x5e7653[_0x613a('0x31')]);_0x278d52[_0x613a('0x3b')]=_[_0x613a('0x33')](_0x278d52[_0x613a('0x2f')],_0x278d52['query']);_0x32a0dd[_0x613a('0x35')]=_[_0x613a('0x33')](_0x278d52[_0x613a('0x2f')],qs[_0x613a('0x34')](_0x5e7653[_0x613a('0x31')]['fields']));_0x32a0dd[_0x613a('0x35')]=_0x32a0dd[_0x613a('0x35')][_0x613a('0x36')]?_0x32a0dd[_0x613a('0x35')]:_0x278d52[_0x613a('0x2f')];if(_0x5e7653[_0x613a('0x31')][_0x613a('0x40')]){_0x32a0dd[_0x613a('0x41')]=[{'all':!![]}];}_0x32a0dd=_[_0x613a('0x48')]({},_0x32a0dd,_0x5e7653[_0x613a('0x3f')]);return db['SugarcrmConfiguration'][_0x613a('0x49')](_0x32a0dd)[_0x613a('0x27')](handleEntityNotFound(_0x228414,null))['then'](respondWithResult(_0x228414,null))[_0x613a('0x44')](handleError(_0x228414,null));};exports[_0x613a('0x4a')]=function(_0x1bceee,_0x23eb16){return db[_0x613a('0x2d')]['create'](_0x1bceee[_0x613a('0x4b')],{})[_0x613a('0x27')](respondWithResult(_0x23eb16,0xc9))['catch'](handleError(_0x23eb16,null));};exports[_0x613a('0x25')]=function(_0x190262,_0x4a545a){if(_0x190262[_0x613a('0x4b')]['id']){delete _0x190262['body']['id'];}return db['SugarcrmConfiguration'][_0x613a('0x49')]({'where':{'id':_0x190262[_0x613a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a545a,null))[_0x613a('0x27')](saveUpdates(_0x190262[_0x613a('0x4b')],null))[_0x613a('0x27')](respondWithResult(_0x4a545a,null))[_0x613a('0x44')](handleError(_0x4a545a,null));};exports[_0x613a('0x26')]=function(_0x2c9ebc,_0xa8fb8){return db[_0x613a('0x2d')]['find']({'where':{'id':_0x2c9ebc[_0x613a('0x46')]['id']}})[_0x613a('0x27')](handleEntityNotFound(_0xa8fb8,null))[_0x613a('0x27')](removeEntity(_0xa8fb8,null))[_0x613a('0x44')](handleError(_0xa8fb8,null));};exports[_0x613a('0x4c')]=function(_0xabe447,_0x245a6f,_0x142297){var _0x3be429={};var _0x3454fb={};var _0x70fe42;var _0x37b3f8;return db[_0x613a('0x2d')]['findOne']({'where':{'id':_0xabe447[_0x613a('0x46')]['id']}})[_0x613a('0x27')](handleEntityNotFound(_0x245a6f,null))['then'](function(_0x23249b){if(_0x23249b){_0x70fe42=_0x23249b;_0x3454fb['model']=_['keys'](db[_0x613a('0x4d')][_0x613a('0x47')]);_0x3454fb[_0x613a('0x31')]=_[_0x613a('0x32')](_0xabe447[_0x613a('0x31')]);_0x3454fb['filters']=_[_0x613a('0x33')](_0x3454fb[_0x613a('0x2f')],_0x3454fb[_0x613a('0x31')]);_0x3be429['attributes']=_[_0x613a('0x33')](_0x3454fb[_0x613a('0x2f')],qs[_0x613a('0x34')](_0xabe447[_0x613a('0x31')][_0x613a('0x34')]));_0x3be429[_0x613a('0x35')]=_0x3be429['attributes'][_0x613a('0x36')]?_0x3be429['attributes']:_0x3454fb[_0x613a('0x2f')];_0x3be429[_0x613a('0x4e')]=qs['sort'](_0xabe447['query']['sort']);_0x3be429[_0x613a('0x3d')]=qs[_0x613a('0x3b')](_[_0x613a('0x3a')](_0xabe447[_0x613a('0x31')],_0x3454fb[_0x613a('0x3b')]));if(_0xabe447['query']['filter']){_0x3be429[_0x613a('0x3d')]=_[_0x613a('0x48')](_0x3be429[_0x613a('0x3d')],{'$or':_[_0x613a('0x30')](_0x3be429[_0x613a('0x35')],function(_0x43d2e3){var _0x55091b={};_0x55091b[_0x43d2e3]={'$like':'%'+_0xabe447['query'][_0x613a('0x3c')]+'%'};return _0x55091b;})});}_0x3be429=_[_0x613a('0x48')]({},_0x3be429,_0xabe447[_0x613a('0x3f')]);return _0x70fe42[_0x613a('0x4c')](_0x3be429);}})['then'](function(_0x13eb9e){if(_0x13eb9e){_0x37b3f8=_0x13eb9e[_0x613a('0x36')];if(!_0xabe447['query'][_0x613a('0x37')](_0x613a('0x38'))){_0x3be429['limit']=qs[_0x613a('0x20')](_0xabe447[_0x613a('0x31')][_0x613a('0x20')]);_0x3be429[_0x613a('0x1e')]=qs[_0x613a('0x1e')](_0xabe447['query'][_0x613a('0x1e')]);}return _0x70fe42[_0x613a('0x4c')](_0x3be429);}})['then'](function(_0x95ccde){if(_0x95ccde){return _0x95ccde?{'count':_0x37b3f8,'rows':_0x95ccde}:null;}})[_0x613a('0x27')](respondWithResult(_0x245a6f,null))[_0x613a('0x44')](handleError(_0x245a6f,null));};exports[_0x613a('0x4f')]=function(_0xa4f31f,_0x546177,_0x1f723b){var _0x163ee7={};var _0x37cab8={};var _0x33b36f;var _0x5dbe97;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0xa4f31f[_0x613a('0x46')]['id']}})['then'](handleEntityNotFound(_0x546177,null))[_0x613a('0x27')](function(_0x4dff1a){if(_0x4dff1a){_0x33b36f=_0x4dff1a;_0x37cab8[_0x613a('0x2f')]=_[_0x613a('0x32')](db[_0x613a('0x4d')][_0x613a('0x47')]);_0x37cab8[_0x613a('0x31')]=_['keys'](_0xa4f31f[_0x613a('0x31')]);_0x37cab8[_0x613a('0x3b')]=_[_0x613a('0x33')](_0x37cab8[_0x613a('0x2f')],_0x37cab8[_0x613a('0x31')]);_0x163ee7[_0x613a('0x35')]=_[_0x613a('0x33')](_0x37cab8[_0x613a('0x2f')],qs[_0x613a('0x34')](_0xa4f31f[_0x613a('0x31')][_0x613a('0x34')]));_0x163ee7[_0x613a('0x35')]=_0x163ee7[_0x613a('0x35')][_0x613a('0x36')]?_0x163ee7[_0x613a('0x35')]:_0x37cab8[_0x613a('0x2f')];_0x163ee7[_0x613a('0x4e')]=qs[_0x613a('0x39')](_0xa4f31f[_0x613a('0x31')]['sort']);_0x163ee7[_0x613a('0x3d')]=qs[_0x613a('0x3b')](_[_0x613a('0x3a')](_0xa4f31f['query'],_0x37cab8[_0x613a('0x3b')]));if(_0xa4f31f[_0x613a('0x31')][_0x613a('0x3c')]){_0x163ee7[_0x613a('0x3d')]=_[_0x613a('0x48')](_0x163ee7[_0x613a('0x3d')],{'$or':_[_0x613a('0x30')](_0x163ee7[_0x613a('0x35')],function(_0x121095){var _0x477c0d={};_0x477c0d[_0x121095]={'$like':'%'+_0xa4f31f['query'][_0x613a('0x3c')]+'%'};return _0x477c0d;})});}_0x163ee7=_[_0x613a('0x48')]({},_0x163ee7,_0xa4f31f[_0x613a('0x3f')]);return _0x33b36f[_0x613a('0x4f')](_0x163ee7);}})['then'](function(_0x33c1e2){if(_0x33c1e2){_0x5dbe97=_0x33c1e2[_0x613a('0x36')];if(!_0xa4f31f[_0x613a('0x31')][_0x613a('0x37')](_0x613a('0x38'))){_0x163ee7[_0x613a('0x20')]=qs[_0x613a('0x20')](_0xa4f31f['query']['limit']);_0x163ee7[_0x613a('0x1e')]=qs[_0x613a('0x1e')](_0xa4f31f[_0x613a('0x31')][_0x613a('0x1e')]);}return _0x33b36f[_0x613a('0x4f')](_0x163ee7);}})[_0x613a('0x27')](function(_0x52fcbb){if(_0x52fcbb){return _0x52fcbb?{'count':_0x5dbe97,'rows':_0x52fcbb}:null;}})[_0x613a('0x27')](respondWithResult(_0x546177,null))[_0x613a('0x44')](handleError(_0x546177,null));};exports[_0x613a('0x50')]=function(_0x1e3a1a,_0x23959c,_0x577e84){var _0x2b5bcd={};var _0x4956f0={};var _0x45424d;var _0x478123;return db[_0x613a('0x2d')][_0x613a('0x51')]({'where':{'id':_0x1e3a1a[_0x613a('0x46')]['id']}})[_0x613a('0x27')](handleEntityNotFound(_0x23959c,null))['then'](function(_0x23d554){if(_0x23d554){_0x45424d=_0x23d554;_0x4956f0[_0x613a('0x2f')]=_[_0x613a('0x32')](db[_0x613a('0x4d')]['rawAttributes']);_0x4956f0[_0x613a('0x31')]=_['keys'](_0x1e3a1a['query']);_0x4956f0[_0x613a('0x3b')]=_[_0x613a('0x33')](_0x4956f0[_0x613a('0x2f')],_0x4956f0[_0x613a('0x31')]);_0x2b5bcd['attributes']=_[_0x613a('0x33')](_0x4956f0['model'],qs[_0x613a('0x34')](_0x1e3a1a['query']['fields']));_0x2b5bcd['attributes']=_0x2b5bcd[_0x613a('0x35')][_0x613a('0x36')]?_0x2b5bcd[_0x613a('0x35')]:_0x4956f0[_0x613a('0x2f')];_0x2b5bcd['order']=qs[_0x613a('0x39')](_0x1e3a1a[_0x613a('0x31')][_0x613a('0x39')]);_0x2b5bcd['where']=qs[_0x613a('0x3b')](_[_0x613a('0x3a')](_0x1e3a1a[_0x613a('0x31')],_0x4956f0[_0x613a('0x3b')]));if(_0x1e3a1a[_0x613a('0x31')][_0x613a('0x3c')]){_0x2b5bcd['where']=_[_0x613a('0x48')](_0x2b5bcd[_0x613a('0x3d')],{'$or':_['map'](_0x2b5bcd[_0x613a('0x35')],function(_0x564f1a){var _0x141f1a={};_0x141f1a[_0x564f1a]={'$like':'%'+_0x1e3a1a[_0x613a('0x31')][_0x613a('0x3c')]+'%'};return _0x141f1a;})});}_0x2b5bcd=_[_0x613a('0x48')]({},_0x2b5bcd,_0x1e3a1a['options']);return _0x45424d[_0x613a('0x50')](_0x2b5bcd);}})[_0x613a('0x27')](function(_0x44eb66){if(_0x44eb66){_0x478123=_0x44eb66['length'];if(!_0x1e3a1a[_0x613a('0x31')]['hasOwnProperty'](_0x613a('0x38'))){_0x2b5bcd[_0x613a('0x20')]=qs['limit'](_0x1e3a1a['query'][_0x613a('0x20')]);_0x2b5bcd[_0x613a('0x1e')]=qs[_0x613a('0x1e')](_0x1e3a1a[_0x613a('0x31')]['offset']);}return _0x45424d[_0x613a('0x50')](_0x2b5bcd);}})['then'](function(_0x43495b){if(_0x43495b){return _0x43495b?{'count':_0x478123,'rows':_0x43495b}:null;}})['then'](respondWithResult(_0x23959c,null))['catch'](handleError(_0x23959c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fc7aaca..df6774d 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 _0xa4b4=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa4b4,0x1a2));var _0x4a4b=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xa4b4[_0x2d9535];return _0xb4e710;};'use strict';var _=require('lodash');var util=require(_0x4a4b('0x0'));var logger=require(_0x4a4b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4a4b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a4b('0x3'));var rimraf=require('rimraf');var config=require(_0x4a4b('0x4'));var attributes=require(_0x4a4b('0x5'));module[_0x4a4b('0x6')]=function(_0x16868e,_0x523243){return _0x16868e[_0x4a4b('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x4a4b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bd0=['exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x335488,_0x40228e){var _0x241645=function(_0x1c6c6d){while(--_0x1c6c6d){_0x335488['push'](_0x335488['shift']());}};_0x241645(++_0x40228e);}(_0x7bd0,0x10a));var _0x07bd=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x7bd0[_0x4e8286];return _0x44a440;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x07bd('0xa')]=function(_0x3f7ed0,_0x2b7e0d){return _0x3f7ed0['define'](_0x07bd('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index b8c1a29..d4a1852 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 _0xc8f2=['../../config/utils','../../config/logger','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x482f04,_0x567865){var _0x1f1cb8=function(_0x399d1f){while(--_0x399d1f){_0x482f04['push'](_0x482f04['shift']());}};_0x1f1cb8(++_0x567865);}(_0xc8f2,0xaa));var _0x2c8f=function(_0x1d9791,_0x41fe64){_0x1d9791=_0x1d9791-0x0;var _0x315536=_0xc8f2[_0x1d9791];return _0x315536;};'use strict';var _=require(_0x2c8f('0x0'));var util=require('util');var moment=require(_0x2c8f('0x1'));var BPromise=require(_0x2c8f('0x2'));var rs=require(_0x2c8f('0x3'));var fs=require('fs');var Redis=require(_0x2c8f('0x4'));var db=require(_0x2c8f('0x5'))['db'];var utils=require(_0x2c8f('0x6'));var logger=require(_0x2c8f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2c8f('0x8')][_0x2c8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481912,_0x188233,_0x209351){return new BPromise(function(_0x1c11fb,_0x35fe19){return client[_0x2c8f('0xa')](_0x481912,_0x209351)[_0x2c8f('0xb')](function(_0xd251c0){logger[_0x2c8f('0xc')](_0x2c8f('0xd'),_0x188233,'request\x20sent');logger[_0x2c8f('0xe')](_0x2c8f('0xf'),_0x188233,_0x2c8f('0x10'),JSON[_0x2c8f('0x11')](_0xd251c0));if(_0xd251c0[_0x2c8f('0x12')]){if(_0xd251c0[_0x2c8f('0x12')]['code']===0x1f4){logger[_0x2c8f('0x12')](_0x2c8f('0xd'),_0x188233,_0xd251c0[_0x2c8f('0x12')][_0x2c8f('0x13')]);return _0x35fe19(_0xd251c0['error'][_0x2c8f('0x13')]);}logger[_0x2c8f('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x188233,_0xd251c0[_0x2c8f('0x12')][_0x2c8f('0x13')]);return _0x1c11fb(_0xd251c0[_0x2c8f('0x12')]['message']);}else{logger[_0x2c8f('0xc')](_0x2c8f('0xd'),_0x188233,_0x2c8f('0x10'));_0x1c11fb(_0xd251c0[_0x2c8f('0x14')][_0x2c8f('0x13')]);}})[_0x2c8f('0x15')](function(_0xf09f8d){logger[_0x2c8f('0x12')](_0x2c8f('0xd'),_0x188233,_0xf09f8d);_0x35fe19(_0xf09f8d);});});} \ No newline at end of file +var _0x69d1=['catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4bff30,_0x5d8caa){var _0x112bcf=function(_0x37c045){while(--_0x37c045){_0x4bff30['push'](_0x4bff30['shift']());}};_0x112bcf(++_0x5d8caa);}(_0x69d1,0xdd));var _0x169d=function(_0x2cde74,_0x55cf68){_0x2cde74=_0x2cde74-0x0;var _0x39ee49=_0x69d1[_0x2cde74];return _0x39ee49;};'use strict';var _=require(_0x169d('0x0'));var util=require('util');var moment=require(_0x169d('0x1'));var BPromise=require(_0x169d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x169d('0x3'));var logger=require(_0x169d('0x4'))(_0x169d('0x5'));var config=require(_0x169d('0x6'));var jayson=require(_0x169d('0x7'));var client=jayson[_0x169d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41f43f,_0x14bfee,_0x229694){return new BPromise(function(_0x571ef9,_0xb1f8b){return client[_0x169d('0x9')](_0x41f43f,_0x229694)['then'](function(_0x5b5d9f){logger[_0x169d('0xa')](_0x169d('0xb'),_0x14bfee,_0x169d('0xc'));logger[_0x169d('0xd')](_0x169d('0xe'),_0x14bfee,_0x169d('0xc'),JSON[_0x169d('0xf')](_0x5b5d9f));if(_0x5b5d9f[_0x169d('0x10')]){if(_0x5b5d9f[_0x169d('0x10')][_0x169d('0x11')]===0x1f4){logger[_0x169d('0x10')](_0x169d('0xb'),_0x14bfee,_0x5b5d9f[_0x169d('0x10')][_0x169d('0x12')]);return _0xb1f8b(_0x5b5d9f['error'][_0x169d('0x12')]);}logger[_0x169d('0x10')](_0x169d('0xb'),_0x14bfee,_0x5b5d9f[_0x169d('0x10')][_0x169d('0x12')]);return _0x571ef9(_0x5b5d9f['error']['message']);}else{logger[_0x169d('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x14bfee,_0x169d('0xc'));_0x571ef9(_0x5b5d9f['result'][_0x169d('0x12')]);}})[_0x169d('0x13')](function(_0x28db23){logger[_0x169d('0x10')](_0x169d('0xb'),_0x14bfee,_0x28db23);_0xb1f8b(_0x28db23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 24d6a9b..fc79ff7 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 _0x250c=['post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xab1021,_0xe4fec5){var _0x3f8b7f=function(_0x49d8f1){while(--_0x49d8f1){_0xab1021['push'](_0xab1021['shift']());}};_0x3f8b7f(++_0xe4fec5);}(_0x250c,0x196));var _0xc250=function(_0x4b2c2c,_0x50fa56){_0x4b2c2c=_0x4b2c2c-0x0;var _0x31e0fd=_0x250c[_0x4b2c2c];return _0x31e0fd;};'use strict';var multer=require(_0xc250('0x0'));var util=require('util');var path=require(_0xc250('0x1'));var timeout=require('connect-timeout');var express=require(_0xc250('0x2'));var router=express[_0xc250('0x3')]();var fs_extra=require(_0xc250('0x4'));var auth=require(_0xc250('0x5'));var interaction=require(_0xc250('0x6'));var config=require(_0xc250('0x7'));var controller=require(_0xc250('0x8'));router[_0xc250('0x9')]('/',auth[_0xc250('0xa')](),controller[_0xc250('0xb')]);router[_0xc250('0x9')](_0xc250('0xc'),auth[_0xc250('0xa')](),controller[_0xc250('0xd')]);router[_0xc250('0xe')]('/',auth[_0xc250('0xa')](),controller[_0xc250('0xf')]);router[_0xc250('0x10')](_0xc250('0xc'),auth[_0xc250('0xa')](),controller[_0xc250('0x11')]);router[_0xc250('0x12')]('/:id',auth[_0xc250('0xa')](),controller[_0xc250('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9832=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x2e12ab,_0x1652a5){var _0x2d38d8=function(_0x4e1cab){while(--_0x4e1cab){_0x2e12ab['push'](_0x2e12ab['shift']());}};_0x2d38d8(++_0x1652a5);}(_0x9832,0x1bb));var _0x2983=function(_0x1901cf,_0x2381cb){_0x1901cf=_0x1901cf-0x0;var _0x7afff0=_0x9832[_0x1901cf];return _0x7afff0;};'use strict';var multer=require(_0x2983('0x0'));var util=require(_0x2983('0x1'));var path=require(_0x2983('0x2'));var timeout=require(_0x2983('0x3'));var express=require(_0x2983('0x4'));var router=express['Router']();var fs_extra=require(_0x2983('0x5'));var auth=require(_0x2983('0x6'));var interaction=require(_0x2983('0x7'));var config=require(_0x2983('0x8'));var controller=require(_0x2983('0x9'));router[_0x2983('0xa')]('/',auth['isAuthenticated'](),controller[_0x2983('0xb')]);router[_0x2983('0xa')]('/:id',auth[_0x2983('0xc')](),controller[_0x2983('0xd')]);router[_0x2983('0xe')]('/',auth[_0x2983('0xc')](),controller[_0x2983('0xf')]);router[_0x2983('0x10')](_0x2983('0x11'),auth[_0x2983('0xc')](),controller[_0x2983('0x12')]);router['delete'](_0x2983('0x11'),auth['isAuthenticated'](),controller[_0x2983('0x13')]);module[_0x2983('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e9e168d..3a58d8f 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 _0xf6f1=['BOOLEAN','sequelize','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xf6f1,0x157));var _0x1f6f=function(_0x484cf9,_0x2a6368){_0x484cf9=_0x484cf9-0x0;var _0x41d27d=_0xf6f1[_0x484cf9];return _0x41d27d;};'use strict';var Sequelize=require(_0x1f6f('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1f6f('0x1'),_0x1f6f('0x2'),'customVariable',_0x1f6f('0x3'),_0x1f6f('0x4')),'defaultValue':_0x1f6f('0x1')},'content':{'type':Sequelize[_0x1f6f('0x5')]},'key':{'type':Sequelize[_0x1f6f('0x5')]},'keyType':{'type':Sequelize[_0x1f6f('0x6')](_0x1f6f('0x1'),_0x1f6f('0x2'),_0x1f6f('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1f6f('0x5')]},'nameField':{'type':Sequelize[_0x1f6f('0x5')]},'customField':{'type':Sequelize[_0x1f6f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f6f('0x5')]}}; \ No newline at end of file +var _0x5975=['picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0xc4663b,_0x3d556b){var _0x261d8=function(_0x36a064){while(--_0x36a064){_0xc4663b['push'](_0xc4663b['shift']());}};_0x261d8(++_0x3d556b);}(_0x5975,0xcd));var _0x5597=function(_0x30e2da,_0x5434cf){_0x30e2da=_0x30e2da-0x0;var _0x31065d=_0x5975[_0x30e2da];return _0x31065d;};'use strict';var Sequelize=require(_0x5597('0x0'));module[_0x5597('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5597('0x2'),_0x5597('0x3'),_0x5597('0x4'),_0x5597('0x5')),'defaultValue':_0x5597('0x6')},'content':{'type':Sequelize[_0x5597('0x7')]},'key':{'type':Sequelize[_0x5597('0x7')]},'keyType':{'type':Sequelize[_0x5597('0x8')](_0x5597('0x6'),_0x5597('0x2'),_0x5597('0x3'))},'keyContent':{'type':Sequelize[_0x5597('0x7')]},'idField':{'type':Sequelize[_0x5597('0x7')]},'nameField':{'type':Sequelize[_0x5597('0x7')]},'customField':{'type':Sequelize[_0x5597('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5597('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a7e9b21..81c05fc 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 _0xb653=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','catch','show','params','fields','include','find','create','body','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x58c9f7,_0x59191d){var _0x29351d=function(_0x5b83a4){while(--_0x5b83a4){_0x58c9f7['push'](_0x58c9f7['shift']());}};_0x29351d(++_0x59191d);}(_0xb653,0xe6));var _0x3b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb653[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b65('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b65('0x1'));var BPromise=require(_0x3b65('0x2'));var Mustache=require(_0x3b65('0x3'));var util=require(_0x3b65('0x4'));var path=require('path');var sox=require(_0x3b65('0x5'));var csv=require(_0x3b65('0x6'));var ejs=require(_0x3b65('0x7'));var fs=require('fs');var fs_extra=require(_0x3b65('0x8'));var _=require(_0x3b65('0x9'));var squel=require(_0x3b65('0xa'));var crypto=require('crypto');var jsforce=require(_0x3b65('0xb'));var deskjs=require(_0x3b65('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3b65('0xd'));var Papa=require('papaparse');var Redis=require(_0x3b65('0xe'));var authService=require(_0x3b65('0xf'));var qs=require(_0x3b65('0x10'));var as=require(_0x3b65('0x11'));var hardwareService=require(_0x3b65('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3b65('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3b65('0x14'));var db=require(_0x3b65('0x15'))['db'];function respondWithStatusCode(_0x154411,_0x29c0d3){_0x29c0d3=_0x29c0d3||0xcc;return function(_0x35e9b5){if(_0x35e9b5){return _0x154411['sendStatus'](_0x29c0d3);}return _0x154411[_0x3b65('0x16')](_0x29c0d3)[_0x3b65('0x17')]();};}function respondWithResult(_0x3b33a8,_0x40ed1c){_0x40ed1c=_0x40ed1c||0xc8;return function(_0x3a66ff){if(_0x3a66ff){return _0x3b33a8[_0x3b65('0x16')](_0x40ed1c)['json'](_0x3a66ff);}};}function respondWithFilteredResult(_0x4ed501,_0x2baf78){return function(_0x3db596){if(_0x3db596){var _0x46e1ca=typeof _0x2baf78[_0x3b65('0x18')]===_0x3b65('0x19')&&typeof _0x2baf78[_0x3b65('0x1a')]===_0x3b65('0x19');var _0x3409cf=_0x3db596['count'];var _0x223408=_0x46e1ca?0x0:_0x2baf78[_0x3b65('0x18')];var _0x3b4517=_0x46e1ca?_0x3db596[_0x3b65('0x1b')]:_0x2baf78[_0x3b65('0x18')]+_0x2baf78['limit'];var _0x54cef4;if(_0x3b4517>=_0x3409cf){_0x3b4517=_0x3409cf;_0x54cef4=0xc8;}else{_0x54cef4=0xce;}_0x4ed501[_0x3b65('0x16')](_0x54cef4);return _0x4ed501[_0x3b65('0x1c')](_0x3b65('0x1d'),_0x223408+'-'+_0x3b4517+'/'+_0x3409cf)[_0x3b65('0x1e')](_0x3db596);}return null;};}function patchUpdates(_0x33f04a){return function(_0x45c756){try{jsonpatch[_0x3b65('0x1f')](_0x45c756,_0x33f04a,!![]);}catch(_0x458a99){return BPromise['reject'](_0x458a99);}return _0x45c756[_0x3b65('0x20')]();};}function saveUpdates(_0x3f7959,_0x2b3e47){return function(_0x3f04aa){if(_0x3f04aa){return _0x3f04aa[_0x3b65('0x21')](_0x3f7959)[_0x3b65('0x22')](function(_0x4cf8ca){return _0x4cf8ca;});}return null;};}function removeEntity(_0x51f1c1,_0x1e2c73){return function(_0x48ff12){if(_0x48ff12){return _0x48ff12['destroy']()['then'](function(){_0x51f1c1[_0x3b65('0x16')](0xcc)[_0x3b65('0x17')]();});}};}function handleEntityNotFound(_0xb25a27,_0x286c46){return function(_0x121446){if(!_0x121446){_0xb25a27[_0x3b65('0x23')](0x194);}return _0x121446;};}function handleError(_0xceb059,_0x44f4e2){_0x44f4e2=_0x44f4e2||0x1f4;return function(_0x599acd){logger[_0x3b65('0x24')](_0x599acd['stack']);if(_0x599acd[_0x3b65('0x25')]){delete _0x599acd['name'];}_0xceb059[_0x3b65('0x16')](_0x44f4e2)['send'](_0x599acd);};}exports[_0x3b65('0x26')]=function(_0x49a9fa,_0x4342cc){var _0xae25b7={},_0x3dc77f={},_0xd3343a={'count':0x0,'rows':[]};var _0x5179ba=_[_0x3b65('0x27')](db[_0x3b65('0x28')][_0x3b65('0x29')],function(_0x1ec9f7){return{'name':_0x1ec9f7[_0x3b65('0x2a')],'type':_0x1ec9f7[_0x3b65('0x2b')][_0x3b65('0x2c')]};});_0x3dc77f[_0x3b65('0x2d')]=_[_0x3b65('0x27')](_0x5179ba,'name');_0x3dc77f[_0x3b65('0x2e')]=_[_0x3b65('0x2f')](_0x49a9fa[_0x3b65('0x2e')]);_0x3dc77f[_0x3b65('0x30')]=_[_0x3b65('0x31')](_0x3dc77f['model'],_0x3dc77f[_0x3b65('0x2e')]);_0xae25b7['attributes']=_[_0x3b65('0x31')](_0x3dc77f['model'],qs['fields'](_0x49a9fa[_0x3b65('0x2e')]['fields']));_0xae25b7[_0x3b65('0x32')]=_0xae25b7[_0x3b65('0x32')][_0x3b65('0x33')]?_0xae25b7['attributes']:_0x3dc77f[_0x3b65('0x2d')];if(!_0x49a9fa[_0x3b65('0x2e')][_0x3b65('0x34')](_0x3b65('0x35'))){_0xae25b7['limit']=qs['limit'](_0x49a9fa['query']['limit']);_0xae25b7[_0x3b65('0x18')]=qs[_0x3b65('0x18')](_0x49a9fa[_0x3b65('0x2e')]['offset']);}_0xae25b7[_0x3b65('0x36')]=qs[_0x3b65('0x37')](_0x49a9fa[_0x3b65('0x2e')][_0x3b65('0x37')]);_0xae25b7[_0x3b65('0x38')]=qs['filters'](_['pick'](_0x49a9fa[_0x3b65('0x2e')],_0x3dc77f[_0x3b65('0x30')]),_0x5179ba);if(_0x49a9fa[_0x3b65('0x2e')][_0x3b65('0x39')]){_0xae25b7[_0x3b65('0x38')]=_['merge'](_0xae25b7[_0x3b65('0x38')],{'$or':_[_0x3b65('0x27')](_0x5179ba,function(_0x4a7ddb){if(_0x4a7ddb[_0x3b65('0x2b')]!==_0x3b65('0x3a')){var _0x235e6f={};_0x235e6f[_0x4a7ddb[_0x3b65('0x25')]]={'$like':'%'+_0x49a9fa['query'][_0x3b65('0x39')]+'%'};return _0x235e6f;}})});}_0xae25b7=_[_0x3b65('0x3b')]({},_0xae25b7,_0x49a9fa[_0x3b65('0x3c')]);var _0x238380={'where':_0xae25b7['where']};return db[_0x3b65('0x28')][_0x3b65('0x1b')](_0x238380)[_0x3b65('0x22')](function(_0x255974){_0xd3343a[_0x3b65('0x1b')]=_0x255974;if(_0x49a9fa[_0x3b65('0x2e')][_0x3b65('0x3d')]){_0xae25b7['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0xae25b7);})['then'](function(_0x3e49ed){_0xd3343a['rows']=_0x3e49ed;return _0xd3343a;})['then'](respondWithFilteredResult(_0x4342cc,_0xae25b7))[_0x3b65('0x3e')](handleError(_0x4342cc,null));};exports[_0x3b65('0x3f')]=function(_0x5df404,_0x5620ff){var _0x585e77={'raw':!![],'where':{'id':_0x5df404[_0x3b65('0x40')]['id']}},_0x54bb8a={};_0x54bb8a[_0x3b65('0x2d')]=_[_0x3b65('0x2f')](db[_0x3b65('0x28')]['rawAttributes']);_0x54bb8a[_0x3b65('0x2e')]=_[_0x3b65('0x2f')](_0x5df404[_0x3b65('0x2e')]);_0x54bb8a[_0x3b65('0x30')]=_[_0x3b65('0x31')](_0x54bb8a['model'],_0x54bb8a[_0x3b65('0x2e')]);_0x585e77[_0x3b65('0x32')]=_[_0x3b65('0x31')](_0x54bb8a[_0x3b65('0x2d')],qs[_0x3b65('0x41')](_0x5df404[_0x3b65('0x2e')][_0x3b65('0x41')]));_0x585e77['attributes']=_0x585e77['attributes'][_0x3b65('0x33')]?_0x585e77[_0x3b65('0x32')]:_0x54bb8a[_0x3b65('0x2d')];if(_0x5df404['query']['includeAll']){_0x585e77[_0x3b65('0x42')]=[{'all':!![]}];}_0x585e77=_[_0x3b65('0x3b')]({},_0x585e77,_0x5df404[_0x3b65('0x3c')]);return db[_0x3b65('0x28')][_0x3b65('0x43')](_0x585e77)[_0x3b65('0x22')](handleEntityNotFound(_0x5620ff,null))[_0x3b65('0x22')](respondWithResult(_0x5620ff,null))[_0x3b65('0x3e')](handleError(_0x5620ff,null));};exports[_0x3b65('0x44')]=function(_0x1b7911,_0x49702f){return db[_0x3b65('0x28')][_0x3b65('0x44')](_0x1b7911[_0x3b65('0x45')],{})[_0x3b65('0x22')](respondWithResult(_0x49702f,0xc9))[_0x3b65('0x3e')](handleError(_0x49702f,null));};exports[_0x3b65('0x21')]=function(_0x379fb4,_0x4423b3){if(_0x379fb4[_0x3b65('0x45')]['id']){delete _0x379fb4['body']['id'];}return db[_0x3b65('0x28')][_0x3b65('0x43')]({'where':{'id':_0x379fb4[_0x3b65('0x40')]['id']}})[_0x3b65('0x22')](handleEntityNotFound(_0x4423b3,null))[_0x3b65('0x22')](saveUpdates(_0x379fb4['body'],null))[_0x3b65('0x22')](respondWithResult(_0x4423b3,null))[_0x3b65('0x3e')](handleError(_0x4423b3,null));};exports['destroy']=function(_0x323fd9,_0x134db0){return db[_0x3b65('0x28')][_0x3b65('0x43')]({'where':{'id':_0x323fd9[_0x3b65('0x40')]['id']}})[_0x3b65('0x22')](handleEntityNotFound(_0x134db0,null))[_0x3b65('0x22')](removeEntity(_0x134db0,null))[_0x3b65('0x3e')](handleError(_0x134db0,null));}; \ No newline at end of file +var _0x38d8=['params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','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','sendStatus','status','end','json','offset','limit','undefined','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch'];(function(_0x20b51a,_0x27eae2){var _0x209b67=function(_0x8c20ec){while(--_0x8c20ec){_0x20b51a['push'](_0x20b51a['shift']());}};_0x209b67(++_0x27eae2);}(_0x38d8,0x1b5));var _0x838d=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x38d8[_0x3a9635];return _0x10d08c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x838d('0x0'));var zipdir=require(_0x838d('0x1'));var jsonpatch=require(_0x838d('0x2'));var rp=require(_0x838d('0x3'));var moment=require('moment');var BPromise=require(_0x838d('0x4'));var Mustache=require(_0x838d('0x5'));var util=require('util');var path=require(_0x838d('0x6'));var sox=require(_0x838d('0x7'));var csv=require('to-csv');var ejs=require(_0x838d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x838d('0x9'));var squel=require(_0x838d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x838d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x838d('0xc'));var Redis=require(_0x838d('0xd'));var authService=require(_0x838d('0xe'));var qs=require(_0x838d('0xf'));var as=require(_0x838d('0x10'));var hardwareService=require(_0x838d('0x11'));var logger=require(_0x838d('0x12'))('api');var utils=require(_0x838d('0x13'));var config=require(_0x838d('0x14'));var licenseUtil=require(_0x838d('0x15'));var db=require(_0x838d('0x16'))['db'];function respondWithStatusCode(_0x209085,_0x456bd3){_0x456bd3=_0x456bd3||0xcc;return function(_0xde7afb){if(_0xde7afb){return _0x209085[_0x838d('0x17')](_0x456bd3);}return _0x209085[_0x838d('0x18')](_0x456bd3)[_0x838d('0x19')]();};}function respondWithResult(_0x1c2e60,_0x2f8202){_0x2f8202=_0x2f8202||0xc8;return function(_0x49b94e){if(_0x49b94e){return _0x1c2e60[_0x838d('0x18')](_0x2f8202)[_0x838d('0x1a')](_0x49b94e);}};}function respondWithFilteredResult(_0x34eb20,_0x443867){return function(_0x26fee4){if(_0x26fee4){var _0x35ca38=typeof _0x443867[_0x838d('0x1b')]==='undefined'&&typeof _0x443867[_0x838d('0x1c')]===_0x838d('0x1d');var _0x3bfb1e=_0x26fee4['count'];var _0x1f0362=_0x35ca38?0x0:_0x443867[_0x838d('0x1b')];var _0x377345=_0x35ca38?_0x26fee4['count']:_0x443867[_0x838d('0x1b')]+_0x443867[_0x838d('0x1c')];var _0x54c3d3;if(_0x377345>=_0x3bfb1e){_0x377345=_0x3bfb1e;_0x54c3d3=0xc8;}else{_0x54c3d3=0xce;}_0x34eb20[_0x838d('0x18')](_0x54c3d3);return _0x34eb20['set']('Content-Range',_0x1f0362+'-'+_0x377345+'/'+_0x3bfb1e)[_0x838d('0x1a')](_0x26fee4);}return null;};}function patchUpdates(_0x240dc8){return function(_0x4bda69){try{jsonpatch[_0x838d('0x1e')](_0x4bda69,_0x240dc8,!![]);}catch(_0xa18d7d){return BPromise[_0x838d('0x1f')](_0xa18d7d);}return _0x4bda69[_0x838d('0x20')]();};}function saveUpdates(_0x5a7151,_0x3b7896){return function(_0x52412d){if(_0x52412d){return _0x52412d[_0x838d('0x21')](_0x5a7151)[_0x838d('0x22')](function(_0x46b75f){return _0x46b75f;});}return null;};}function removeEntity(_0x301b45,_0x5461e0){return function(_0x4c7caa){if(_0x4c7caa){return _0x4c7caa[_0x838d('0x23')]()[_0x838d('0x22')](function(){_0x301b45[_0x838d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e5c2,_0x22a4cc){return function(_0x2e574d){if(!_0x2e574d){_0x44e5c2[_0x838d('0x17')](0x194);}return _0x2e574d;};}function handleError(_0x11ae46,_0x560c38){_0x560c38=_0x560c38||0x1f4;return function(_0x388f39){logger[_0x838d('0x24')](_0x388f39[_0x838d('0x25')]);if(_0x388f39[_0x838d('0x26')]){delete _0x388f39[_0x838d('0x26')];}_0x11ae46[_0x838d('0x18')](_0x560c38)['send'](_0x388f39);};}exports[_0x838d('0x27')]=function(_0x3b5260,_0x2b7402){var _0x2ca1da={},_0x263dee={},_0x2ae44b={'count':0x0,'rows':[]};var _0x23b23d=_[_0x838d('0x28')](db[_0x838d('0x29')]['rawAttributes'],function(_0x346228){return{'name':_0x346228[_0x838d('0x2a')],'type':_0x346228[_0x838d('0x2b')][_0x838d('0x2c')]};});_0x263dee['model']=_[_0x838d('0x28')](_0x23b23d,'name');_0x263dee[_0x838d('0x2d')]=_[_0x838d('0x2e')](_0x3b5260[_0x838d('0x2d')]);_0x263dee[_0x838d('0x2f')]=_[_0x838d('0x30')](_0x263dee[_0x838d('0x31')],_0x263dee['query']);_0x2ca1da[_0x838d('0x32')]=_[_0x838d('0x30')](_0x263dee[_0x838d('0x31')],qs[_0x838d('0x33')](_0x3b5260['query'][_0x838d('0x33')]));_0x2ca1da['attributes']=_0x2ca1da['attributes'][_0x838d('0x34')]?_0x2ca1da[_0x838d('0x32')]:_0x263dee[_0x838d('0x31')];if(!_0x3b5260[_0x838d('0x2d')][_0x838d('0x35')](_0x838d('0x36'))){_0x2ca1da[_0x838d('0x1c')]=qs['limit'](_0x3b5260['query'][_0x838d('0x1c')]);_0x2ca1da[_0x838d('0x1b')]=qs[_0x838d('0x1b')](_0x3b5260[_0x838d('0x2d')][_0x838d('0x1b')]);}_0x2ca1da[_0x838d('0x37')]=qs[_0x838d('0x38')](_0x3b5260['query']['sort']);_0x2ca1da[_0x838d('0x39')]=qs['filters'](_[_0x838d('0x3a')](_0x3b5260[_0x838d('0x2d')],_0x263dee[_0x838d('0x2f')]),_0x23b23d);if(_0x3b5260[_0x838d('0x2d')][_0x838d('0x3b')]){_0x2ca1da['where']=_[_0x838d('0x3c')](_0x2ca1da[_0x838d('0x39')],{'$or':_[_0x838d('0x28')](_0x23b23d,function(_0x457b64){if(_0x457b64[_0x838d('0x2b')]!==_0x838d('0x3d')){var _0x143ced={};_0x143ced[_0x457b64[_0x838d('0x26')]]={'$like':'%'+_0x3b5260[_0x838d('0x2d')][_0x838d('0x3b')]+'%'};return _0x143ced;}})});}_0x2ca1da=_['merge']({},_0x2ca1da,_0x3b5260[_0x838d('0x3e')]);var _0x4719d4={'where':_0x2ca1da['where']};return db[_0x838d('0x29')][_0x838d('0x3f')](_0x4719d4)[_0x838d('0x22')](function(_0x59c7a4){_0x2ae44b[_0x838d('0x3f')]=_0x59c7a4;if(_0x3b5260[_0x838d('0x2d')]['includeAll']){_0x2ca1da[_0x838d('0x40')]=[{'all':!![]}];}return db[_0x838d('0x29')]['findAll'](_0x2ca1da);})[_0x838d('0x22')](function(_0x2f7627){_0x2ae44b[_0x838d('0x41')]=_0x2f7627;return _0x2ae44b;})[_0x838d('0x22')](respondWithFilteredResult(_0x2b7402,_0x2ca1da))[_0x838d('0x42')](handleError(_0x2b7402,null));};exports['show']=function(_0x491757,_0x116259){var _0x516410={'raw':!![],'where':{'id':_0x491757[_0x838d('0x43')]['id']}},_0x4157dc={};_0x4157dc[_0x838d('0x31')]=_[_0x838d('0x2e')](db[_0x838d('0x29')]['rawAttributes']);_0x4157dc['query']=_['keys'](_0x491757['query']);_0x4157dc['filters']=_['intersection'](_0x4157dc['model'],_0x4157dc[_0x838d('0x2d')]);_0x516410['attributes']=_[_0x838d('0x30')](_0x4157dc['model'],qs[_0x838d('0x33')](_0x491757[_0x838d('0x2d')][_0x838d('0x33')]));_0x516410[_0x838d('0x32')]=_0x516410['attributes'][_0x838d('0x34')]?_0x516410['attributes']:_0x4157dc[_0x838d('0x31')];if(_0x491757[_0x838d('0x2d')][_0x838d('0x44')]){_0x516410['include']=[{'all':!![]}];}_0x516410=_[_0x838d('0x3c')]({},_0x516410,_0x491757[_0x838d('0x3e')]);return db['SugarcrmField'][_0x838d('0x45')](_0x516410)[_0x838d('0x22')](handleEntityNotFound(_0x116259,null))[_0x838d('0x22')](respondWithResult(_0x116259,null))[_0x838d('0x42')](handleError(_0x116259,null));};exports[_0x838d('0x46')]=function(_0x478c81,_0x26e9ff){return db[_0x838d('0x29')][_0x838d('0x46')](_0x478c81[_0x838d('0x47')],{})[_0x838d('0x22')](respondWithResult(_0x26e9ff,0xc9))[_0x838d('0x42')](handleError(_0x26e9ff,null));};exports[_0x838d('0x21')]=function(_0x54d368,_0x24927c){if(_0x54d368[_0x838d('0x47')]['id']){delete _0x54d368['body']['id'];}return db[_0x838d('0x29')][_0x838d('0x45')]({'where':{'id':_0x54d368[_0x838d('0x43')]['id']}})[_0x838d('0x22')](handleEntityNotFound(_0x24927c,null))[_0x838d('0x22')](saveUpdates(_0x54d368[_0x838d('0x47')],null))[_0x838d('0x22')](respondWithResult(_0x24927c,null))[_0x838d('0x42')](handleError(_0x24927c,null));};exports[_0x838d('0x23')]=function(_0x478c31,_0x382938){return db[_0x838d('0x29')][_0x838d('0x45')]({'where':{'id':_0x478c31[_0x838d('0x43')]['id']}})[_0x838d('0x22')](handleEntityNotFound(_0x382938,null))[_0x838d('0x22')](removeEntity(_0x382938,null))[_0x838d('0x42')](handleError(_0x382938,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 3c12d21..2f217de 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 _0xa826=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','api','moment','request-promise','rimraf'];(function(_0xe6d045,_0x160df3){var _0x3684cd=function(_0x4f0d47){while(--_0x4f0d47){_0xe6d045['push'](_0xe6d045['shift']());}};_0x3684cd(++_0x160df3);}(_0xa826,0x78));var _0x6a82=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa826[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x6a82('0x0'));var util=require(_0x6a82('0x1'));var logger=require('../../config/logger')(_0x6a82('0x2'));var moment=require(_0x6a82('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a82('0x5'));var config=require(_0x6a82('0x6'));var attributes=require(_0x6a82('0x7'));module[_0x6a82('0x8')]=function(_0x43bf05,_0x1a27ca){return _0x43bf05[_0x6a82('0x9')](_0x6a82('0xa'),attributes,{'tableName':_0x6a82('0xb'),'paranoid':![],'indexes':[{'name':_0x6a82('0xc'),'fields':[_0x6a82('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5e8=['FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x4ddfd4,_0x44278b){var _0x5a5846=function(_0x3bff99){while(--_0x3bff99){_0x4ddfd4['push'](_0x4ddfd4['shift']());}};_0x5a5846(++_0x44278b);}(_0xc5e8,0x9d));var _0x8c5e=function(_0x2a7e6c,_0x334756){_0x2a7e6c=_0x2a7e6c-0x0;var _0x322fce=_0xc5e8[_0x2a7e6c];return _0x322fce;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8c5e('0x0'));var moment=require(_0x8c5e('0x1'));var BPromise=require(_0x8c5e('0x2'));var rp=require(_0x8c5e('0x3'));var fs=require('fs');var path=require(_0x8c5e('0x4'));var rimraf=require(_0x8c5e('0x5'));var config=require(_0x8c5e('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x8c5e('0x7')]=function(_0x23c70a,_0x513d1d){return _0x23c70a['define'](_0x8c5e('0x8'),attributes,{'tableName':_0x8c5e('0x9'),'paranoid':![],'indexes':[{'name':_0x8c5e('0xa'),'fields':[_0x8c5e('0xb'),_0x8c5e('0xc')],'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 a73e52f..cee7e6a 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 _0x4d67=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x298500,_0x10e07f){var _0x2d45bc=function(_0x3d04e4){while(--_0x3d04e4){_0x298500['push'](_0x298500['shift']());}};_0x2d45bc(++_0x10e07f);}(_0x4d67,0x1d5));var _0x74d6=function(_0x5e3ffe,_0x4d333c){_0x5e3ffe=_0x5e3ffe-0x0;var _0x4bdea9=_0x4d67[_0x5e3ffe];return _0x4bdea9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74d6('0x0'));var BPromise=require(_0x74d6('0x1'));var rs=require(_0x74d6('0x2'));var fs=require('fs');var Redis=require(_0x74d6('0x3'));var db=require(_0x74d6('0x4'))['db'];var utils=require(_0x74d6('0x5'));var logger=require(_0x74d6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x74d6('0x7'));var client=jayson[_0x74d6('0x8')][_0x74d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f63e,_0x2da661,_0x3859ec){return new BPromise(function(_0x59b3d5,_0x27414e){return client[_0x74d6('0xa')](_0x26f63e,_0x3859ec)[_0x74d6('0xb')](function(_0x205ee5){logger[_0x74d6('0xc')](_0x74d6('0xd'),_0x2da661,_0x74d6('0xe'));logger[_0x74d6('0xf')](_0x74d6('0x10'),_0x2da661,_0x74d6('0xe'),JSON[_0x74d6('0x11')](_0x205ee5));if(_0x205ee5['error']){if(_0x205ee5[_0x74d6('0x12')][_0x74d6('0x13')]===0x1f4){logger[_0x74d6('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x2da661,_0x205ee5[_0x74d6('0x12')][_0x74d6('0x14')]);return _0x27414e(_0x205ee5[_0x74d6('0x12')][_0x74d6('0x14')]);}logger[_0x74d6('0x12')](_0x74d6('0xd'),_0x2da661,_0x205ee5[_0x74d6('0x12')]['message']);return _0x59b3d5(_0x205ee5['error'][_0x74d6('0x14')]);}else{logger[_0x74d6('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x2da661,_0x74d6('0xe'));_0x59b3d5(_0x205ee5[_0x74d6('0x15')][_0x74d6('0x14')]);}})[_0x74d6('0x16')](function(_0x2e2a0c){logger[_0x74d6('0x12')](_0x74d6('0xd'),_0x2da661,_0x2e2a0c);_0x27414e(_0x2e2a0c);});});} \ No newline at end of file +var _0x277c=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x277c,0x1e5));var _0xc277=function(_0x1aeff9,_0x27e0ca){_0x1aeff9=_0x1aeff9-0x0;var _0xccb526=_0x277c[_0x1aeff9];return _0xccb526;};'use strict';var _=require(_0xc277('0x0'));var util=require(_0xc277('0x1'));var moment=require(_0xc277('0x2'));var BPromise=require(_0xc277('0x3'));var rs=require(_0xc277('0x4'));var fs=require('fs');var Redis=require(_0xc277('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc277('0x6'));var logger=require(_0xc277('0x7'))(_0xc277('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x338a3c,_0x49bc46,_0xa45430){return new BPromise(function(_0x51327d,_0x4d66d1){return client[_0xc277('0x9')](_0x338a3c,_0xa45430)[_0xc277('0xa')](function(_0x5dd252){logger[_0xc277('0xb')](_0xc277('0xc'),_0x49bc46,'request\x20sent');logger['debug'](_0xc277('0xd'),_0x49bc46,_0xc277('0xe'),JSON['stringify'](_0x5dd252));if(_0x5dd252[_0xc277('0xf')]){if(_0x5dd252['error'][_0xc277('0x10')]===0x1f4){logger[_0xc277('0xf')](_0xc277('0xc'),_0x49bc46,_0x5dd252[_0xc277('0xf')][_0xc277('0x11')]);return _0x4d66d1(_0x5dd252[_0xc277('0xf')]['message']);}logger[_0xc277('0xf')](_0xc277('0xc'),_0x49bc46,_0x5dd252[_0xc277('0xf')][_0xc277('0x11')]);return _0x51327d(_0x5dd252[_0xc277('0xf')][_0xc277('0x11')]);}else{logger[_0xc277('0xb')](_0xc277('0xc'),_0x49bc46,_0xc277('0xe'));_0x51327d(_0x5dd252[_0xc277('0x12')][_0xc277('0x11')]);}})[_0xc277('0x13')](function(_0x21ff24){logger[_0xc277('0xf')](_0xc277('0xc'),_0x49bc46,_0x21ff24);_0x4d66d1(_0x21ff24);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 7cbee06..c5ce46d 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 _0xdfcc=['../../components/interaction/service','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','post','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x41afa3,_0x30d02e){var _0x4d9865=function(_0x1d6879){while(--_0x1d6879){_0x41afa3['push'](_0x41afa3['shift']());}};_0x4d9865(++_0x30d02e);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdfcc[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xcdfc('0x0'));var util=require(_0xcdfc('0x1'));var path=require(_0xcdfc('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdfc('0x3'));var router=express[_0xcdfc('0x4')]();var fs_extra=require(_0xcdfc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcdfc('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xcdfc('0x7')](),controller[_0xcdfc('0x8')]);router['get'](_0xcdfc('0x9'),auth[_0xcdfc('0x7')](),controller[_0xcdfc('0xa')]);router[_0xcdfc('0xb')]('/:id/configurations',auth[_0xcdfc('0x7')](),controller['getConfigurations']);router[_0xcdfc('0xb')](_0xcdfc('0xc'),auth[_0xcdfc('0x7')](),controller[_0xcdfc('0xd')]);router[_0xcdfc('0xe')]('/',auth[_0xcdfc('0x7')](),controller['create']);router['post'](_0xcdfc('0xf'),auth[_0xcdfc('0x7')](),controller['addConfiguration']);router[_0xcdfc('0x10')](_0xcdfc('0x9'),auth['isAuthenticated'](),controller[_0xcdfc('0x11')]);router[_0xcdfc('0x12')](_0xcdfc('0x9'),auth['isAuthenticated'](),controller[_0xcdfc('0x13')]);module[_0xcdfc('0x14')]=router; \ No newline at end of file +var _0xe4ef=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','addConfiguration','/:id','update','delete','destroy'];(function(_0x1cd087,_0x5bb8a0){var _0x5d4d76=function(_0x4982aa){while(--_0x4982aa){_0x1cd087['push'](_0x1cd087['shift']());}};_0x5d4d76(++_0x5bb8a0);}(_0xe4ef,0x17b));var _0xfe4e=function(_0x1d1d59,_0x469b4d){_0x1d1d59=_0x1d1d59-0x0;var _0x5dfb25=_0xe4ef[_0x1d1d59];return _0x5dfb25;};'use strict';var multer=require(_0xfe4e('0x0'));var util=require('util');var path=require(_0xfe4e('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe4e('0x2'));var router=express[_0xfe4e('0x3')]();var fs_extra=require(_0xfe4e('0x4'));var auth=require(_0xfe4e('0x5'));var interaction=require(_0xfe4e('0x6'));var config=require(_0xfe4e('0x7'));var controller=require(_0xfe4e('0x8'));router[_0xfe4e('0x9')]('/',auth[_0xfe4e('0xa')](),controller['index']);router[_0xfe4e('0x9')]('/:id',auth[_0xfe4e('0xa')](),controller['show']);router[_0xfe4e('0x9')](_0xfe4e('0xb'),auth['isAuthenticated'](),controller[_0xfe4e('0xc')]);router[_0xfe4e('0x9')]('/:id/fields',auth[_0xfe4e('0xa')](),controller[_0xfe4e('0xd')]);router[_0xfe4e('0xe')]('/',auth[_0xfe4e('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0xfe4e('0xa')](),controller[_0xfe4e('0xf')]);router['put'](_0xfe4e('0x10'),auth[_0xfe4e('0xa')](),controller[_0xfe4e('0x11')]);router[_0xfe4e('0x12')](_0xfe4e('0x10'),auth['isAuthenticated'](),controller[_0xfe4e('0x13')]);module[_0xfe4e('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 be011ed..36046d7 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 _0xfd09=['sequelize','exports','STRING'];(function(_0x2b5346,_0x5ff26c){var _0x3cdcc9=function(_0x4fbafe){while(--_0x4fbafe){_0x2b5346['push'](_0x2b5346['shift']());}};_0x3cdcc9(++_0x5ff26c);}(_0xfd09,0x16e));var _0x9fd0=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0xfd09[_0x4d0df6];return _0x4e2615;};'use strict';var Sequelize=require(_0x9fd0('0x0'));module[_0x9fd0('0x1')]={'name':{'type':Sequelize[_0x9fd0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9fd0('0x2')]},'username':{'type':Sequelize[_0x9fd0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9fd0('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9fd0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc07a=['sequelize','STRING','HelpDesk'];(function(_0x49f30e,_0xf28439){var _0x2cafd5=function(_0x581d4c){while(--_0x581d4c){_0x49f30e['push'](_0x49f30e['shift']());}};_0x2cafd5(++_0xf28439);}(_0xc07a,0x177));var _0xac07=function(_0x55cffc,_0x96dbf5){_0x55cffc=_0x55cffc-0x0;var _0x4fd082=_0xc07a[_0x55cffc];return _0x4fd082;};'use strict';var Sequelize=require(_0xac07('0x0'));module['exports']={'name':{'type':Sequelize[_0xac07('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xac07('0x1')]},'username':{'type':Sequelize[_0xac07('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac07('0x2')},'remoteUri':{'type':Sequelize[_0xac07('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xac07('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xac07('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b91afd5..efe2432 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 _0x89c4=['serverUrl','accessKey','username','remoteUri','substring','format','%s/webservice.php','getchallenge','POST','login','result','token','success','GET','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','catch','show','params','includeAll','include','create','body','find','destroy','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','description','moduleName'];(function(_0x20b342,_0x12765b){var _0x5bfb4d=function(_0x534264){while(--_0x534264){_0x20b342['push'](_0x20b342['shift']());}};_0x5bfb4d(++_0x12765b);}(_0x89c4,0x9a));var _0x489c=function(_0x56c41b,_0x2b6958){_0x56c41b=_0x56c41b-0x0;var _0x3c5a6d=_0x89c4[_0x56c41b];return _0x3c5a6d;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require(_0x489c('0x2'));var jsonpatch=require(_0x489c('0x3'));var rp=require(_0x489c('0x4'));var moment=require(_0x489c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x489c('0x6'));var path=require(_0x489c('0x7'));var sox=require(_0x489c('0x8'));var csv=require('to-csv');var ejs=require(_0x489c('0x9'));var fs=require('fs');var fs_extra=require(_0x489c('0xa'));var _=require(_0x489c('0xb'));var squel=require(_0x489c('0xc'));var crypto=require(_0x489c('0xd'));var jsforce=require(_0x489c('0xe'));var deskjs=require(_0x489c('0xf'));var toCsv=require(_0x489c('0x10'));var querystring=require(_0x489c('0x11'));var Papa=require(_0x489c('0x12'));var Redis=require(_0x489c('0x13'));var authService=require(_0x489c('0x14'));var qs=require(_0x489c('0x15'));var as=require(_0x489c('0x16'));var hardwareService=require(_0x489c('0x17'));var logger=require(_0x489c('0x18'))('api');var utils=require(_0x489c('0x19'));var config=require(_0x489c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x489c('0x1b'))['db'];var integrations=require(_0x489c('0x1c'));function respondWithStatusCode(_0x5c03bd,_0x2bb7c2){_0x2bb7c2=_0x2bb7c2||0xcc;return function(_0x26c105){if(_0x26c105){return _0x5c03bd[_0x489c('0x1d')](_0x2bb7c2);}return _0x5c03bd[_0x489c('0x1e')](_0x2bb7c2)['end']();};}function respondWithResult(_0x20e11a,_0x30e5f7){_0x30e5f7=_0x30e5f7||0xc8;return function(_0x3d8a45){if(_0x3d8a45){return _0x20e11a['status'](_0x30e5f7)[_0x489c('0x1f')](_0x3d8a45);}};}function respondWithFilteredResult(_0x15922b,_0x1aadf7){return function(_0x2eebd5){if(_0x2eebd5){var _0x175797=typeof _0x1aadf7['offset']===_0x489c('0x20')&&typeof _0x1aadf7['limit']==='undefined';var _0x36737e=_0x2eebd5[_0x489c('0x21')];var _0x4ba543=_0x175797?0x0:_0x1aadf7[_0x489c('0x22')];var _0x2409ab=_0x175797?_0x2eebd5[_0x489c('0x21')]:_0x1aadf7[_0x489c('0x22')]+_0x1aadf7[_0x489c('0x23')];var _0xa3a5d;if(_0x2409ab>=_0x36737e){_0x2409ab=_0x36737e;_0xa3a5d=0xc8;}else{_0xa3a5d=0xce;}_0x15922b[_0x489c('0x1e')](_0xa3a5d);return _0x15922b['set'](_0x489c('0x24'),_0x4ba543+'-'+_0x2409ab+'/'+_0x36737e)[_0x489c('0x1f')](_0x2eebd5);}return null;};}function patchUpdates(_0x5707b1){return function(_0x2f14c2){try{jsonpatch[_0x489c('0x25')](_0x2f14c2,_0x5707b1,!![]);}catch(_0x2ea93c){return BPromise[_0x489c('0x26')](_0x2ea93c);}return _0x2f14c2['save']();};}function saveUpdates(_0x5405f2,_0x18d024){return function(_0x2b20f2){if(_0x2b20f2){return _0x2b20f2[_0x489c('0x27')](_0x5405f2)[_0x489c('0x28')](function(_0x555266){return _0x555266;});}return null;};}function removeEntity(_0x56e0c0,_0x48b09b){return function(_0x522183){if(_0x522183){return _0x522183['destroy']()[_0x489c('0x28')](function(){_0x56e0c0[_0x489c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382b04,_0x3ef114){return function(_0x1e8a27){if(!_0x1e8a27){_0x382b04[_0x489c('0x1d')](0x194);}return _0x1e8a27;};}function handleError(_0x54aea9,_0x5a657f){_0x5a657f=_0x5a657f||0x1f4;return function(_0x45b9c7){logger['error'](_0x45b9c7['stack']);if(_0x45b9c7[_0x489c('0x29')]){delete _0x45b9c7[_0x489c('0x29')];}_0x54aea9['status'](_0x5a657f)[_0x489c('0x2a')](_0x45b9c7);};}exports[_0x489c('0x2b')]=function(_0x3d9ec4,_0x5270b8){var _0x251bb6={},_0x56368f={},_0x44fab7={'count':0x0,'rows':[]};var _0x4d5217=_[_0x489c('0x2c')](db[_0x489c('0x2d')][_0x489c('0x2e')],function(_0x13ab3c){return{'name':_0x13ab3c[_0x489c('0x2f')],'type':_0x13ab3c[_0x489c('0x30')][_0x489c('0x31')]};});_0x56368f[_0x489c('0x32')]=_[_0x489c('0x2c')](_0x4d5217,_0x489c('0x29'));_0x56368f['query']=_[_0x489c('0x33')](_0x3d9ec4['query']);_0x56368f[_0x489c('0x34')]=_[_0x489c('0x35')](_0x56368f[_0x489c('0x32')],_0x56368f[_0x489c('0x36')]);_0x251bb6[_0x489c('0x37')]=_[_0x489c('0x35')](_0x56368f['model'],qs[_0x489c('0x38')](_0x3d9ec4[_0x489c('0x36')]['fields']));_0x251bb6['attributes']=_0x251bb6['attributes'][_0x489c('0x39')]?_0x251bb6[_0x489c('0x37')]:_0x56368f[_0x489c('0x32')];if(!_0x3d9ec4[_0x489c('0x36')]['hasOwnProperty']('nolimit')){_0x251bb6['limit']=qs[_0x489c('0x23')](_0x3d9ec4[_0x489c('0x36')][_0x489c('0x23')]);_0x251bb6['offset']=qs[_0x489c('0x22')](_0x3d9ec4[_0x489c('0x36')][_0x489c('0x22')]);}_0x251bb6[_0x489c('0x3a')]=qs[_0x489c('0x3b')](_0x3d9ec4['query'][_0x489c('0x3b')]);_0x251bb6[_0x489c('0x3c')]=qs['filters'](_['pick'](_0x3d9ec4[_0x489c('0x36')],_0x56368f[_0x489c('0x34')]),_0x4d5217);if(_0x3d9ec4[_0x489c('0x36')][_0x489c('0x3d')]){_0x251bb6[_0x489c('0x3c')]=_[_0x489c('0x3e')](_0x251bb6[_0x489c('0x3c')],{'$or':_[_0x489c('0x2c')](_0x4d5217,function(_0x2dd131){if(_0x2dd131[_0x489c('0x30')]!==_0x489c('0x3f')){var _0x3068b4={};_0x3068b4[_0x2dd131[_0x489c('0x29')]]={'$like':'%'+_0x3d9ec4[_0x489c('0x36')][_0x489c('0x3d')]+'%'};return _0x3068b4;}})});}_0x251bb6=_[_0x489c('0x3e')]({},_0x251bb6,_0x3d9ec4[_0x489c('0x40')]);var _0x369950={'where':_0x251bb6[_0x489c('0x3c')]};return db[_0x489c('0x2d')]['count'](_0x369950)[_0x489c('0x28')](function(_0x541c07){_0x44fab7[_0x489c('0x21')]=_0x541c07;if(_0x3d9ec4[_0x489c('0x36')]['includeAll']){_0x251bb6['include']=[{'all':!![]}];}return db[_0x489c('0x2d')]['findAll'](_0x251bb6);})[_0x489c('0x28')](function(_0x583150){_0x44fab7['rows']=_0x583150;return _0x44fab7;})[_0x489c('0x28')](respondWithFilteredResult(_0x5270b8,_0x251bb6))[_0x489c('0x41')](handleError(_0x5270b8,null));};exports[_0x489c('0x42')]=function(_0x172acc,_0x2768fc){var _0x54425b={'raw':![],'where':{'id':_0x172acc[_0x489c('0x43')]['id']}},_0x1b4930={};_0x1b4930[_0x489c('0x32')]=_[_0x489c('0x33')](db[_0x489c('0x2d')]['rawAttributes']);_0x1b4930[_0x489c('0x36')]=_['keys'](_0x172acc['query']);_0x1b4930[_0x489c('0x34')]=_[_0x489c('0x35')](_0x1b4930[_0x489c('0x32')],_0x1b4930[_0x489c('0x36')]);_0x54425b['attributes']=_[_0x489c('0x35')](_0x1b4930[_0x489c('0x32')],qs[_0x489c('0x38')](_0x172acc['query']['fields']));_0x54425b[_0x489c('0x37')]=_0x54425b['attributes']['length']?_0x54425b[_0x489c('0x37')]:_0x1b4930[_0x489c('0x32')];if(_0x172acc[_0x489c('0x36')][_0x489c('0x44')]){_0x54425b[_0x489c('0x45')]=[{'all':!![]}];}_0x54425b=_[_0x489c('0x3e')]({},_0x54425b,_0x172acc[_0x489c('0x40')]);return db['VtigerAccount']['find'](_0x54425b)[_0x489c('0x28')](handleEntityNotFound(_0x2768fc,null))[_0x489c('0x28')](respondWithResult(_0x2768fc,null))['catch'](handleError(_0x2768fc,null));};exports[_0x489c('0x46')]=function(_0x4e5d2e,_0x1ef4f5){return db[_0x489c('0x2d')][_0x489c('0x46')](_0x4e5d2e[_0x489c('0x47')],{})[_0x489c('0x28')](respondWithResult(_0x1ef4f5,0xc9))[_0x489c('0x41')](handleError(_0x1ef4f5,null));};exports[_0x489c('0x27')]=function(_0x21b1a3,_0x36be7b){if(_0x21b1a3[_0x489c('0x47')]['id']){delete _0x21b1a3[_0x489c('0x47')]['id'];}return db[_0x489c('0x2d')][_0x489c('0x48')]({'where':{'id':_0x21b1a3['params']['id']}})[_0x489c('0x28')](handleEntityNotFound(_0x36be7b,null))[_0x489c('0x28')](saveUpdates(_0x21b1a3['body'],null))[_0x489c('0x28')](respondWithResult(_0x36be7b,null))[_0x489c('0x41')](handleError(_0x36be7b,null));};exports[_0x489c('0x49')]=function(_0xf001dd,_0x87474){return db[_0x489c('0x2d')]['find']({'where':{'id':_0xf001dd[_0x489c('0x43')]['id']}})[_0x489c('0x28')](handleEntityNotFound(_0x87474,null))[_0x489c('0x28')](removeEntity(_0x87474,null))['catch'](handleError(_0x87474,null));};exports[_0x489c('0x4a')]=function(_0x3045f2,_0x2dee92,_0x275320){var _0x3d65a9={};var _0x44387e={};var _0x45a5ea;var _0x40d47f;return db[_0x489c('0x2d')]['findOne']({'where':{'id':_0x3045f2[_0x489c('0x43')]['id']}})[_0x489c('0x28')](handleEntityNotFound(_0x2dee92,null))[_0x489c('0x28')](function(_0x5cafd0){if(_0x5cafd0){_0x45a5ea=_0x5cafd0;_0x44387e[_0x489c('0x32')]=_[_0x489c('0x33')](db['VtigerConfiguration'][_0x489c('0x2e')]);_0x44387e[_0x489c('0x36')]=_['keys'](_0x3045f2['query']);_0x44387e[_0x489c('0x34')]=_['intersection'](_0x44387e['model'],_0x44387e[_0x489c('0x36')]);_0x3d65a9[_0x489c('0x37')]=_['intersection'](_0x44387e[_0x489c('0x32')],qs['fields'](_0x3045f2[_0x489c('0x36')][_0x489c('0x38')]));_0x3d65a9[_0x489c('0x37')]=_0x3d65a9[_0x489c('0x37')]['length']?_0x3d65a9[_0x489c('0x37')]:_0x44387e[_0x489c('0x32')];_0x3d65a9[_0x489c('0x3a')]=qs[_0x489c('0x3b')](_0x3045f2[_0x489c('0x36')][_0x489c('0x3b')]);_0x3d65a9[_0x489c('0x3c')]=qs['filters'](_['pick'](_0x3045f2[_0x489c('0x36')],_0x44387e[_0x489c('0x34')]));if(_0x3045f2[_0x489c('0x36')][_0x489c('0x3d')]){_0x3d65a9['where']=_[_0x489c('0x3e')](_0x3d65a9[_0x489c('0x3c')],{'$or':_[_0x489c('0x2c')](_0x3d65a9['attributes'],function(_0x499a36){var _0x40d596={};_0x40d596[_0x499a36]={'$like':'%'+_0x3045f2[_0x489c('0x36')][_0x489c('0x3d')]+'%'};return _0x40d596;})});}_0x3d65a9=_[_0x489c('0x3e')]({},_0x3d65a9,_0x3045f2['options']);return _0x45a5ea[_0x489c('0x4a')](_0x3d65a9);}})['then'](function(_0x1f84e5){if(_0x1f84e5){_0x40d47f=_0x1f84e5['length'];if(!_0x3045f2['query'][_0x489c('0x4b')](_0x489c('0x4c'))){_0x3d65a9['limit']=qs[_0x489c('0x23')](_0x3045f2['query'][_0x489c('0x23')]);_0x3d65a9['offset']=qs[_0x489c('0x22')](_0x3045f2[_0x489c('0x36')][_0x489c('0x22')]);}return _0x45a5ea[_0x489c('0x4a')](_0x3d65a9);}})['then'](function(_0x525df1){if(_0x525df1){return _0x525df1?{'count':_0x40d47f,'rows':_0x525df1}:null;}})[_0x489c('0x28')](respondWithResult(_0x2dee92,null))[_0x489c('0x41')](handleError(_0x2dee92,null));};exports[_0x489c('0x4d')]=function(_0x2ec77d,_0x250c69,_0x25d507){if(_0x2ec77d[_0x489c('0x47')]['id']){delete _0x2ec77d[_0x489c('0x47')]['id'];}return db['VtigerAccount'][_0x489c('0x4e')]({'where':{'id':_0x2ec77d[_0x489c('0x43')]['id']}})[_0x489c('0x28')](handleEntityNotFound(_0x250c69,null))[_0x489c('0x28')](function(_0x4e0783){if(_0x4e0783){_0x2ec77d['body'][_0x489c('0x4f')]=_0x4e0783['id'];_0x2ec77d['body'][_0x489c('0x50')]=integrations[_0x489c('0x51')](_0x2ec77d['body']['channel'],_0x2ec77d[_0x489c('0x47')][_0x489c('0x30')]);_0x2ec77d[_0x489c('0x47')][_0x489c('0x52')]=integrations[_0x489c('0x53')](_0x2ec77d['body']['channel'],_0x2ec77d[_0x489c('0x47')][_0x489c('0x30')]);return db[_0x489c('0x54')][_0x489c('0x46')](_0x2ec77d['body'],{'include':[{'model':db[_0x489c('0x55')],'as':_0x489c('0x50')},{'model':db[_0x489c('0x55')],'as':_0x489c('0x52')}]});}return null;})['then'](respondWithResult(_0x250c69,null))[_0x489c('0x41')](handleError(_0x250c69,null));};var md5=require(_0x489c('0x56'));exports[_0x489c('0x57')]=function(_0x246aeb,_0x15be5f,_0x456883){var _0xea2ede=null;var _0x1cdce7=null;var _0x1041d7=null;var _0x397833=null;var _0x54ce30='';return db['VtigerAccount'][_0x489c('0x4e')]({'where':{'id':_0x246aeb['params']['id']},'attributes':['id','name','username',_0x489c('0x58'),_0x489c('0x59'),'remoteUri',_0x489c('0x5a'),_0x489c('0x5b')]})[_0x489c('0x28')](handleEntityNotFound(_0x15be5f,null))[_0x489c('0x28')](function(_0xbf68d3){if(_0xbf68d3){_0xea2ede=_0xbf68d3[_0x489c('0x5c')];_0x1cdce7=_0xbf68d3[_0x489c('0x5b')];_0x1041d7=_0xbf68d3['moduleName'];_0x54ce30=_0xbf68d3[_0x489c('0x5d')];var _0x2ccfa6=_0x54ce30['slice'](-0x1);if(_0x2ccfa6==='/'){_0x54ce30=_0x54ce30[_0x489c('0x5e')](0x0,_0x54ce30['lastIndexOf'](_0x2ccfa6));}_0x397833=util[_0x489c('0x5f')](_0x489c('0x60'),_0x54ce30);var _0x39ff85={'method':'GET','uri':_0x397833,'qs':{'operation':_0x489c('0x61'),'username':_0xbf68d3['username']},'json':!![]};return rp(_0x39ff85);}})[_0x489c('0x28')](function(_0x150d04){if(_0x150d04['success']){var _0x6b060e={'method':_0x489c('0x62'),'uri':_0x397833,'form':{'operation':_0x489c('0x63'),'username':_0xea2ede,'accessKey':md5(_0x150d04[_0x489c('0x64')][_0x489c('0x65')]+_0x1cdce7)},'json':!![]};return rp(_0x6b060e);}})['then'](function(_0x553eac){if(_0x553eac[_0x489c('0x66')]){var _0x14d52e={'method':_0x489c('0x67'),'uri':_0x397833,'qs':{'operation':'describe','username':_0xea2ede,'sessionName':_0x553eac['result'][_0x489c('0x68')],'elementType':_0x1041d7},'json':!![]};return rp(_0x14d52e);}})[_0x489c('0x28')](function(_0x30ded8){if(_0x30ded8[_0x489c('0x66')]){var _0x2ca197=['autogenerated',_0x489c('0x69'),_0x489c('0x6a')];_[_0x489c('0x6b')](_0x30ded8['result'][_0x489c('0x38')],function(_0x1d7d75){return _0x2ca197[_0x489c('0x6c')](_0x1d7d75['type'][_0x489c('0x29')]);});_[_0x489c('0x6b')](_0x30ded8[_0x489c('0x64')][_0x489c('0x38')],function(_0x105b7f){return _0x105b7f[_0x489c('0x6d')]===_0x489c('0x6e');});return{'count':_0x30ded8[_0x489c('0x64')][_0x489c('0x38')]['length'],'rows':_[_0x489c('0x2c')](_0x30ded8['result'][_0x489c('0x38')],function(_0x3191df){return{'id':_0x3191df[_0x489c('0x29')],'name':_0x3191df[_0x489c('0x6f')],'custom':_[_0x489c('0x70')](_0x3191df['name'],'cf_')?!![]:![],'options':_0x3191df['type'][_0x489c('0x29')]===_0x489c('0x71')&&_0x3191df[_0x489c('0x30')][_0x489c('0x72')]['length']>0x0?_[_0x489c('0x2c')](_0x3191df[_0x489c('0x30')][_0x489c('0x72')],function(_0x3dbc23){return{'name':_0x3dbc23[_0x489c('0x6f')],'value':_0x3dbc23[_0x489c('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x15be5f,null))[_0x489c('0x41')](function(_0x44e34b){console[_0x489c('0x74')](_0x489c('0x75')+_0x44e34b);var _0x363116=_0x246aeb['query'][_0x489c('0x76')]?0x1f4:_0x44e34b[_0x489c('0x77')]||0x1f4;logger['error'](_0x489c('0x78'),_0x489c('0x57'),_0x363116,JSON['stringify'](_0x44e34b));delete _0x44e34b[_0x489c('0x29')];if(_0x363116===0x191){_0x363116=0x190;}_0x15be5f['status'](_0x363116)[_0x489c('0x2a')](_0x246aeb[_0x489c('0x36')][_0x489c('0x76')]?{'message':_0x489c('0x79'),'statusCode':_0x44e34b[_0x489c('0x77')]}:_0x44e34b);});}; \ No newline at end of file +var _0x3725=['options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','channel','Descriptions','getDescriptions','Subjects','VtigerField','getFields','moduleName','remoteUri','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','token','describe','autogenerated','owner','result','includes','remove','false','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x28d2ca,_0x14eb57){var _0x4d7149=function(_0x11dd99){while(--_0x11dd99){_0x28d2ca['push'](_0x28d2ca['shift']());}};_0x4d7149(++_0x14eb57);}(_0x3725,0x11f));var _0x5372=function(_0x1501da,_0x1651c3){_0x1501da=_0x1501da-0x0;var _0x1957a7=_0x3725[_0x1501da];return _0x1957a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5372('0x0'));var jsonpatch=require(_0x5372('0x1'));var rp=require(_0x5372('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5372('0x3'));var util=require(_0x5372('0x4'));var path=require(_0x5372('0x5'));var sox=require(_0x5372('0x6'));var csv=require(_0x5372('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5372('0x8'));var _=require(_0x5372('0x9'));var squel=require(_0x5372('0xa'));var crypto=require(_0x5372('0xb'));var jsforce=require(_0x5372('0xc'));var deskjs=require(_0x5372('0xd'));var toCsv=require(_0x5372('0x7'));var querystring=require('querystring');var Papa=require(_0x5372('0xe'));var Redis=require(_0x5372('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5372('0x10'));var as=require(_0x5372('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5372('0x12'))(_0x5372('0x13'));var utils=require(_0x5372('0x14'));var config=require(_0x5372('0x15'));var licenseUtil=require(_0x5372('0x16'));var db=require(_0x5372('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4bf01e,_0x1e0791){_0x1e0791=_0x1e0791||0xcc;return function(_0x56905a){if(_0x56905a){return _0x4bf01e[_0x5372('0x18')](_0x1e0791);}return _0x4bf01e[_0x5372('0x19')](_0x1e0791)[_0x5372('0x1a')]();};}function respondWithResult(_0x1c95a2,_0x495048){_0x495048=_0x495048||0xc8;return function(_0x2cd66a){if(_0x2cd66a){return _0x1c95a2[_0x5372('0x19')](_0x495048)[_0x5372('0x1b')](_0x2cd66a);}};}function respondWithFilteredResult(_0x13eb0c,_0x1a9c10){return function(_0x1ce8a0){if(_0x1ce8a0){var _0x3e88a1=typeof _0x1a9c10[_0x5372('0x1c')]===_0x5372('0x1d')&&typeof _0x1a9c10[_0x5372('0x1e')]==='undefined';var _0x1fe6b9=_0x1ce8a0[_0x5372('0x1f')];var _0x197339=_0x3e88a1?0x0:_0x1a9c10[_0x5372('0x1c')];var _0x4538a7=_0x3e88a1?_0x1ce8a0[_0x5372('0x1f')]:_0x1a9c10['offset']+_0x1a9c10[_0x5372('0x1e')];var _0x17f3fe;if(_0x4538a7>=_0x1fe6b9){_0x4538a7=_0x1fe6b9;_0x17f3fe=0xc8;}else{_0x17f3fe=0xce;}_0x13eb0c['status'](_0x17f3fe);return _0x13eb0c[_0x5372('0x20')](_0x5372('0x21'),_0x197339+'-'+_0x4538a7+'/'+_0x1fe6b9)[_0x5372('0x1b')](_0x1ce8a0);}return null;};}function patchUpdates(_0x1724f5){return function(_0x4f5791){try{jsonpatch[_0x5372('0x22')](_0x4f5791,_0x1724f5,!![]);}catch(_0x5c8fe9){return BPromise[_0x5372('0x23')](_0x5c8fe9);}return _0x4f5791[_0x5372('0x24')]();};}function saveUpdates(_0x5665af,_0x232622){return function(_0x172cfa){if(_0x172cfa){return _0x172cfa[_0x5372('0x25')](_0x5665af)[_0x5372('0x26')](function(_0x5cf66f){return _0x5cf66f;});}return null;};}function removeEntity(_0x620415,_0x25aa46){return function(_0x307fe2){if(_0x307fe2){return _0x307fe2[_0x5372('0x27')]()['then'](function(){_0x620415[_0x5372('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b78c,_0x2f2cda){return function(_0x228540){if(!_0x228540){_0x14b78c['sendStatus'](0x194);}return _0x228540;};}function handleError(_0x1895fe,_0xb5054){_0xb5054=_0xb5054||0x1f4;return function(_0x71fe6b){logger[_0x5372('0x28')](_0x71fe6b[_0x5372('0x29')]);if(_0x71fe6b[_0x5372('0x2a')]){delete _0x71fe6b[_0x5372('0x2a')];}_0x1895fe[_0x5372('0x19')](_0xb5054)[_0x5372('0x2b')](_0x71fe6b);};}exports[_0x5372('0x2c')]=function(_0x250aa7,_0x23613a){var _0x38b4b4={},_0x119b58={},_0x211723={'count':0x0,'rows':[]};var _0xc638a0=_[_0x5372('0x2d')](db[_0x5372('0x2e')][_0x5372('0x2f')],function(_0x3d97ca){return{'name':_0x3d97ca[_0x5372('0x30')],'type':_0x3d97ca['type'][_0x5372('0x31')]};});_0x119b58['model']=_['map'](_0xc638a0,_0x5372('0x2a'));_0x119b58[_0x5372('0x32')]=_[_0x5372('0x33')](_0x250aa7[_0x5372('0x32')]);_0x119b58[_0x5372('0x34')]=_['intersection'](_0x119b58['model'],_0x119b58[_0x5372('0x32')]);_0x38b4b4[_0x5372('0x35')]=_[_0x5372('0x36')](_0x119b58[_0x5372('0x37')],qs[_0x5372('0x38')](_0x250aa7[_0x5372('0x32')][_0x5372('0x38')]));_0x38b4b4[_0x5372('0x35')]=_0x38b4b4['attributes'][_0x5372('0x39')]?_0x38b4b4[_0x5372('0x35')]:_0x119b58[_0x5372('0x37')];if(!_0x250aa7[_0x5372('0x32')]['hasOwnProperty'](_0x5372('0x3a'))){_0x38b4b4[_0x5372('0x1e')]=qs[_0x5372('0x1e')](_0x250aa7[_0x5372('0x32')][_0x5372('0x1e')]);_0x38b4b4[_0x5372('0x1c')]=qs['offset'](_0x250aa7['query'][_0x5372('0x1c')]);}_0x38b4b4[_0x5372('0x3b')]=qs[_0x5372('0x3c')](_0x250aa7[_0x5372('0x32')][_0x5372('0x3c')]);_0x38b4b4[_0x5372('0x3d')]=qs[_0x5372('0x34')](_[_0x5372('0x3e')](_0x250aa7[_0x5372('0x32')],_0x119b58['filters']),_0xc638a0);if(_0x250aa7[_0x5372('0x32')][_0x5372('0x3f')]){_0x38b4b4[_0x5372('0x3d')]=_[_0x5372('0x40')](_0x38b4b4[_0x5372('0x3d')],{'$or':_[_0x5372('0x2d')](_0xc638a0,function(_0x12b3cf){if(_0x12b3cf[_0x5372('0x41')]!==_0x5372('0x42')){var _0x50e5e7={};_0x50e5e7[_0x12b3cf['name']]={'$like':'%'+_0x250aa7[_0x5372('0x32')][_0x5372('0x3f')]+'%'};return _0x50e5e7;}})});}_0x38b4b4=_[_0x5372('0x40')]({},_0x38b4b4,_0x250aa7[_0x5372('0x43')]);var _0x2f747c={'where':_0x38b4b4[_0x5372('0x3d')]};return db[_0x5372('0x2e')][_0x5372('0x1f')](_0x2f747c)[_0x5372('0x26')](function(_0x98c99f){_0x211723['count']=_0x98c99f;if(_0x250aa7[_0x5372('0x32')][_0x5372('0x44')]){_0x38b4b4[_0x5372('0x45')]=[{'all':!![]}];}return db[_0x5372('0x2e')][_0x5372('0x46')](_0x38b4b4);})[_0x5372('0x26')](function(_0x28609a){_0x211723[_0x5372('0x47')]=_0x28609a;return _0x211723;})[_0x5372('0x26')](respondWithFilteredResult(_0x23613a,_0x38b4b4))[_0x5372('0x48')](handleError(_0x23613a,null));};exports[_0x5372('0x49')]=function(_0x1191a6,_0x581782){var _0x58faef={'raw':![],'where':{'id':_0x1191a6[_0x5372('0x4a')]['id']}},_0x40818d={};_0x40818d[_0x5372('0x37')]=_[_0x5372('0x33')](db['VtigerAccount'][_0x5372('0x2f')]);_0x40818d[_0x5372('0x32')]=_['keys'](_0x1191a6['query']);_0x40818d[_0x5372('0x34')]=_['intersection'](_0x40818d[_0x5372('0x37')],_0x40818d[_0x5372('0x32')]);_0x58faef[_0x5372('0x35')]=_[_0x5372('0x36')](_0x40818d[_0x5372('0x37')],qs[_0x5372('0x38')](_0x1191a6[_0x5372('0x32')][_0x5372('0x38')]));_0x58faef['attributes']=_0x58faef['attributes'][_0x5372('0x39')]?_0x58faef[_0x5372('0x35')]:_0x40818d[_0x5372('0x37')];if(_0x1191a6['query'][_0x5372('0x44')]){_0x58faef[_0x5372('0x45')]=[{'all':!![]}];}_0x58faef=_[_0x5372('0x40')]({},_0x58faef,_0x1191a6['options']);return db[_0x5372('0x2e')]['find'](_0x58faef)['then'](handleEntityNotFound(_0x581782,null))[_0x5372('0x26')](respondWithResult(_0x581782,null))['catch'](handleError(_0x581782,null));};exports[_0x5372('0x4b')]=function(_0xcfdb7a,_0x2b7426){return db[_0x5372('0x2e')]['create'](_0xcfdb7a[_0x5372('0x4c')],{})[_0x5372('0x26')](respondWithResult(_0x2b7426,0xc9))[_0x5372('0x48')](handleError(_0x2b7426,null));};exports['update']=function(_0x55fba7,_0x439497){if(_0x55fba7[_0x5372('0x4c')]['id']){delete _0x55fba7[_0x5372('0x4c')]['id'];}return db[_0x5372('0x2e')][_0x5372('0x4d')]({'where':{'id':_0x55fba7[_0x5372('0x4a')]['id']}})[_0x5372('0x26')](handleEntityNotFound(_0x439497,null))['then'](saveUpdates(_0x55fba7[_0x5372('0x4c')],null))['then'](respondWithResult(_0x439497,null))[_0x5372('0x48')](handleError(_0x439497,null));};exports[_0x5372('0x27')]=function(_0x1ac47c,_0x41cc02){return db[_0x5372('0x2e')][_0x5372('0x4d')]({'where':{'id':_0x1ac47c[_0x5372('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41cc02,null))[_0x5372('0x26')](removeEntity(_0x41cc02,null))[_0x5372('0x48')](handleError(_0x41cc02,null));};exports[_0x5372('0x4e')]=function(_0x94a05,_0x3e3b01,_0x3d4e8a){var _0x31777d={};var _0x3fd11c={};var _0x5e374a;var _0x1014f1;return db[_0x5372('0x2e')][_0x5372('0x4f')]({'where':{'id':_0x94a05['params']['id']}})[_0x5372('0x26')](handleEntityNotFound(_0x3e3b01,null))[_0x5372('0x26')](function(_0x26ba3e){if(_0x26ba3e){_0x5e374a=_0x26ba3e;_0x3fd11c[_0x5372('0x37')]=_['keys'](db[_0x5372('0x50')]['rawAttributes']);_0x3fd11c[_0x5372('0x32')]=_[_0x5372('0x33')](_0x94a05[_0x5372('0x32')]);_0x3fd11c[_0x5372('0x34')]=_['intersection'](_0x3fd11c['model'],_0x3fd11c['query']);_0x31777d['attributes']=_[_0x5372('0x36')](_0x3fd11c[_0x5372('0x37')],qs['fields'](_0x94a05[_0x5372('0x32')]['fields']));_0x31777d[_0x5372('0x35')]=_0x31777d[_0x5372('0x35')]['length']?_0x31777d[_0x5372('0x35')]:_0x3fd11c['model'];_0x31777d[_0x5372('0x3b')]=qs[_0x5372('0x3c')](_0x94a05['query']['sort']);_0x31777d[_0x5372('0x3d')]=qs[_0x5372('0x34')](_['pick'](_0x94a05[_0x5372('0x32')],_0x3fd11c['filters']));if(_0x94a05[_0x5372('0x32')][_0x5372('0x3f')]){_0x31777d[_0x5372('0x3d')]=_[_0x5372('0x40')](_0x31777d[_0x5372('0x3d')],{'$or':_[_0x5372('0x2d')](_0x31777d[_0x5372('0x35')],function(_0xf70e06){var _0x23e888={};_0x23e888[_0xf70e06]={'$like':'%'+_0x94a05[_0x5372('0x32')][_0x5372('0x3f')]+'%'};return _0x23e888;})});}_0x31777d=_[_0x5372('0x40')]({},_0x31777d,_0x94a05[_0x5372('0x43')]);return _0x5e374a['getConfigurations'](_0x31777d);}})[_0x5372('0x26')](function(_0x8ad3e9){if(_0x8ad3e9){_0x1014f1=_0x8ad3e9[_0x5372('0x39')];if(!_0x94a05['query'][_0x5372('0x51')](_0x5372('0x3a'))){_0x31777d['limit']=qs['limit'](_0x94a05['query']['limit']);_0x31777d[_0x5372('0x1c')]=qs[_0x5372('0x1c')](_0x94a05[_0x5372('0x32')]['offset']);}return _0x5e374a[_0x5372('0x4e')](_0x31777d);}})[_0x5372('0x26')](function(_0x4dc59b){if(_0x4dc59b){return _0x4dc59b?{'count':_0x1014f1,'rows':_0x4dc59b}:null;}})[_0x5372('0x26')](respondWithResult(_0x3e3b01,null))[_0x5372('0x48')](handleError(_0x3e3b01,null));};exports[_0x5372('0x52')]=function(_0x108a11,_0x44021d,_0x472680){if(_0x108a11[_0x5372('0x4c')]['id']){delete _0x108a11[_0x5372('0x4c')]['id'];}return db[_0x5372('0x2e')][_0x5372('0x4f')]({'where':{'id':_0x108a11[_0x5372('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44021d,null))[_0x5372('0x26')](function(_0x58a4f4){if(_0x58a4f4){_0x108a11[_0x5372('0x4c')]['AccountId']=_0x58a4f4['id'];_0x108a11[_0x5372('0x4c')]['Subjects']=integrations['getSubjects'](_0x108a11[_0x5372('0x4c')][_0x5372('0x53')],_0x108a11[_0x5372('0x4c')][_0x5372('0x41')]);_0x108a11[_0x5372('0x4c')][_0x5372('0x54')]=integrations[_0x5372('0x55')](_0x108a11[_0x5372('0x4c')][_0x5372('0x53')],_0x108a11['body'][_0x5372('0x41')]);return db[_0x5372('0x50')][_0x5372('0x4b')](_0x108a11[_0x5372('0x4c')],{'include':[{'model':db['VtigerField'],'as':_0x5372('0x56')},{'model':db[_0x5372('0x57')],'as':_0x5372('0x54')}]});}return null;})[_0x5372('0x26')](respondWithResult(_0x44021d,null))['catch'](handleError(_0x44021d,null));};var md5=require('md5');exports[_0x5372('0x58')]=function(_0x1b9f44,_0x182f90,_0x248c87){var _0x3f5621=null;var _0x2ea81d=null;var _0x368b7d=null;var _0x8b1349=null;var _0x4f1f9f='';return db[_0x5372('0x2e')][_0x5372('0x4f')]({'where':{'id':_0x1b9f44[_0x5372('0x4a')]['id']},'attributes':['id','name','username','description',_0x5372('0x59'),_0x5372('0x5a'),'serverUrl',_0x5372('0x5b')]})['then'](handleEntityNotFound(_0x182f90,null))[_0x5372('0x26')](function(_0x35c504){if(_0x35c504){_0x3f5621=_0x35c504[_0x5372('0x5c')];_0x2ea81d=_0x35c504[_0x5372('0x5b')];_0x368b7d=_0x35c504[_0x5372('0x59')];_0x4f1f9f=_0x35c504[_0x5372('0x5a')];var _0x260240=_0x4f1f9f[_0x5372('0x5d')](-0x1);if(_0x260240==='/'){_0x4f1f9f=_0x4f1f9f[_0x5372('0x5e')](0x0,_0x4f1f9f[_0x5372('0x5f')](_0x260240));}_0x8b1349=util[_0x5372('0x60')](_0x5372('0x61'),_0x4f1f9f);var _0x580208={'method':_0x5372('0x62'),'uri':_0x8b1349,'qs':{'operation':_0x5372('0x63'),'username':_0x35c504[_0x5372('0x5c')]},'json':!![]};return rp(_0x580208);}})[_0x5372('0x26')](function(_0x1cf934){if(_0x1cf934[_0x5372('0x64')]){var _0x1646c3={'method':_0x5372('0x65'),'uri':_0x8b1349,'form':{'operation':'login','username':_0x3f5621,'accessKey':md5(_0x1cf934['result'][_0x5372('0x66')]+_0x2ea81d)},'json':!![]};return rp(_0x1646c3);}})[_0x5372('0x26')](function(_0x310644){if(_0x310644[_0x5372('0x64')]){var _0xdb79e6={'method':'GET','uri':_0x8b1349,'qs':{'operation':_0x5372('0x67'),'username':_0x3f5621,'sessionName':_0x310644['result']['sessionName'],'elementType':_0x368b7d},'json':!![]};return rp(_0xdb79e6);}})['then'](function(_0x491ffe){if(_0x491ffe[_0x5372('0x64')]){var _0x3c5b08=[_0x5372('0x68'),'reference',_0x5372('0x69')];_['remove'](_0x491ffe[_0x5372('0x6a')][_0x5372('0x38')],function(_0x48c9c8){return _0x3c5b08[_0x5372('0x6b')](_0x48c9c8[_0x5372('0x41')][_0x5372('0x2a')]);});_[_0x5372('0x6c')](_0x491ffe[_0x5372('0x6a')]['fields'],function(_0xd50b62){return _0xd50b62['editable']===_0x5372('0x6d');});return{'count':_0x491ffe['result']['fields'][_0x5372('0x39')],'rows':_[_0x5372('0x2d')](_0x491ffe[_0x5372('0x6a')]['fields'],function(_0xabe46c){return{'id':_0xabe46c[_0x5372('0x2a')],'name':_0xabe46c['label'],'custom':_['startsWith'](_0xabe46c[_0x5372('0x2a')],_0x5372('0x6e'))?!![]:![],'options':_0xabe46c[_0x5372('0x41')][_0x5372('0x2a')]===_0x5372('0x6f')&&_0xabe46c[_0x5372('0x41')][_0x5372('0x70')][_0x5372('0x39')]>0x0?_[_0x5372('0x2d')](_0xabe46c['type'][_0x5372('0x70')],function(_0x3f1d2b){return{'name':_0x3f1d2b['label'],'value':_0x3f1d2b['value']};}):[]};})};}})[_0x5372('0x26')](respondWithResult(_0x182f90,null))[_0x5372('0x48')](function(_0x1236d1){console[_0x5372('0x71')](_0x5372('0x72')+_0x1236d1);var _0x131930=_0x1b9f44[_0x5372('0x32')][_0x5372('0x73')]?0x1f4:_0x1236d1['statusCode']||0x1f4;logger[_0x5372('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x5372('0x58'),_0x131930,JSON[_0x5372('0x74')](_0x1236d1));delete _0x1236d1['name'];if(_0x131930===0x191){_0x131930=0x190;}_0x182f90[_0x5372('0x19')](_0x131930)['send'](_0x1b9f44[_0x5372('0x32')]['test']?{'message':_0x5372('0x75'),'statusCode':_0x1236d1['statusCode']}:_0x1236d1);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a6ac7de..cbf698d 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 _0x54b6=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x54b6,0x193));var _0x654b=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x54b6[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x654b('0x0'));var util=require(_0x654b('0x1'));var logger=require(_0x654b('0x2'))(_0x654b('0x3'));var moment=require('moment');var BPromise=require(_0x654b('0x4'));var rp=require(_0x654b('0x5'));var fs=require('fs');var path=require(_0x654b('0x6'));var rimraf=require(_0x654b('0x7'));var config=require(_0x654b('0x8'));var attributes=require(_0x654b('0x9'));var integrations=require(_0x654b('0xa'));module[_0x654b('0xb')]=function(_0x398ff8,_0x14a202){return _0x398ff8['define'](_0x654b('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba45=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x1756b0,_0x3ab9f3){var _0x319e6d=function(_0x50da41){while(--_0x50da41){_0x1756b0['push'](_0x1756b0['shift']());}};_0x319e6d(++_0x3ab9f3);}(_0xba45,0x1a0));var _0x5ba4=function(_0x452450,_0x40b419){_0x452450=_0x452450-0x0;var _0x448b19=_0xba45[_0x452450];return _0x448b19;};'use strict';var _=require(_0x5ba4('0x0'));var util=require(_0x5ba4('0x1'));var logger=require(_0x5ba4('0x2'))(_0x5ba4('0x3'));var moment=require(_0x5ba4('0x4'));var BPromise=require(_0x5ba4('0x5'));var rp=require(_0x5ba4('0x6'));var fs=require('fs');var path=require(_0x5ba4('0x7'));var rimraf=require(_0x5ba4('0x8'));var config=require(_0x5ba4('0x9'));var attributes=require(_0x5ba4('0xa'));var integrations=require(_0x5ba4('0xb'));module['exports']=function(_0x41047f,_0x121a85){return _0x41047f[_0x5ba4('0xc')](_0x5ba4('0xd'),attributes,{'tableName':_0x5ba4('0xe'),'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 703210e..f479b43 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 _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowVtigerAccount','find','moment','bluebird'];(function(_0x1763af,_0x4aeeac){var _0x5263e7=function(_0x454137){while(--_0x454137){_0x1763af['push'](_0x1763af['shift']());}};_0x5263e7(++_0x4aeeac);}(_0x34b7,0x196));var _0x734b=function(_0x1d0e07,_0x2037e9){_0x1d0e07=_0x1d0e07-0x0;var _0x8912e0=_0x34b7[_0x1d0e07];return _0x8912e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x750a=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','where'];(function(_0xddb763,_0x2afc17){var _0x464c67=function(_0x5d017d){while(--_0x5d017d){_0xddb763['push'](_0xddb763['shift']());}};_0x464c67(++_0x2afc17);}(_0x750a,0x140));var _0xa750=function(_0x23de33,_0x20cff7){_0x23de33=_0x23de33-0x0;var _0x5634a1=_0x750a[_0x23de33];return _0x5634a1;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetVtigerAccount']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['VtigerAccount']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};exports[_0xa750('0x1d')]=function(_0x59ab33){var _0x46cc11=this;return new Promise(function(_0x4c2c9e,_0x2d0e93){return db[_0xa750('0x1e')]['find']({'raw':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x1f')]||null:null,'attributes':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')]['attributes']||null:null,'include':_0x59ab33[_0xa750('0x15')]?_0x59ab33['options'][_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x59ab33[_0xa750('0x15')][_0xa750('0x1a')],function(_0x556fde){return{'model':db[_0x556fde[_0xa750('0x19')]],'as':_0x556fde['as'],'attributes':_0x556fde[_0xa750('0x17')],'include':_0x556fde['include']?_[_0xa750('0x1b')](_0x556fde[_0xa750('0x1a')],function(_0x280b87){return{'model':db[_0x280b87[_0xa750('0x19')]],'as':_0x280b87['as'],'attributes':_0x280b87['attributes'],'include':_0x280b87[_0xa750('0x1a')]?_['map'](_0x280b87['include'],function(_0x4e59f3){return{'model':db[_0x4e59f3[_0xa750('0x19')]],'as':_0x4e59f3['as'],'attributes':_0x4e59f3[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470089){logger[_0xa750('0xc')](_0xa750('0x1d'),_0x59ab33);logger['debug'](_0xa750('0x1d'),_0x59ab33,JSON[_0xa750('0xf')](_0x470089));_0x4c2c9e(_0x470089);})[_0xa750('0x14')](function(_0x5d402a){logger[_0xa750('0x10')](_0xa750('0x1d'),_0x5d402a[_0xa750('0x13')],_0x59ab33);_0x2d0e93(_0x46cc11['error'](0x1f4,_0x5d402a[_0xa750('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9209535..0674895 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 _0x0a51=['index','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x782549,_0x3518b9){var _0x5ba74d=function(_0xf04ee6){while(--_0xf04ee6){_0x782549['push'](_0x782549['shift']());}};_0x5ba74d(++_0x3518b9);}(_0x0a51,0x123));var _0x10a5=function(_0x57c1d3,_0x34ded9){_0x57c1d3=_0x57c1d3-0x0;var _0x29f757=_0x0a51[_0x57c1d3];return _0x29f757;};'use strict';var multer=require(_0x10a5('0x0'));var util=require('util');var path=require(_0x10a5('0x1'));var timeout=require(_0x10a5('0x2'));var express=require(_0x10a5('0x3'));var router=express[_0x10a5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x10a5('0x5'));var config=require('../../config/environment');var controller=require(_0x10a5('0x6'));router[_0x10a5('0x7')]('/',auth[_0x10a5('0x8')](),controller[_0x10a5('0x9')]);router[_0x10a5('0x7')]('/:id',auth[_0x10a5('0x8')](),controller['show']);router[_0x10a5('0x7')](_0x10a5('0xa'),auth[_0x10a5('0x8')](),controller[_0x10a5('0xb')]);router[_0x10a5('0x7')](_0x10a5('0xc'),auth[_0x10a5('0x8')](),controller[_0x10a5('0xd')]);router['get']('/:id/descriptions',auth[_0x10a5('0x8')](),controller[_0x10a5('0xe')]);router[_0x10a5('0xf')]('/',auth[_0x10a5('0x8')](),controller['create']);router['put'](_0x10a5('0x10'),auth[_0x10a5('0x8')](),controller['update']);router[_0x10a5('0x11')](_0x10a5('0x10'),auth[_0x10a5('0x8')](),controller[_0x10a5('0x12')]);module[_0x10a5('0x13')]=router; \ No newline at end of file +var _0x7669=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7669,0x1ac));var _0x9766=function(_0x1daced,_0x184118){_0x1daced=_0x1daced-0x0;var _0x4d19b3=_0x7669[_0x1daced];return _0x4d19b3;};'use strict';var multer=require('multer');var util=require(_0x9766('0x0'));var path=require(_0x9766('0x1'));var timeout=require(_0x9766('0x2'));var express=require(_0x9766('0x3'));var router=express[_0x9766('0x4')]();var fs_extra=require(_0x9766('0x5'));var auth=require(_0x9766('0x6'));var interaction=require(_0x9766('0x7'));var config=require(_0x9766('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x9766('0x9')]('/',auth[_0x9766('0xa')](),controller['index']);router[_0x9766('0x9')](_0x9766('0xb'),auth[_0x9766('0xa')](),controller[_0x9766('0xc')]);router[_0x9766('0x9')](_0x9766('0xd'),auth[_0x9766('0xa')](),controller[_0x9766('0xe')]);router[_0x9766('0x9')](_0x9766('0xf'),auth[_0x9766('0xa')](),controller[_0x9766('0x10')]);router[_0x9766('0x9')](_0x9766('0x11'),auth[_0x9766('0xa')](),controller[_0x9766('0x12')]);router[_0x9766('0x13')]('/',auth[_0x9766('0xa')](),controller[_0x9766('0x14')]);router['put'](_0x9766('0xb'),auth[_0x9766('0xa')](),controller['update']);router[_0x9766('0x15')](_0x9766('0xb'),auth[_0x9766('0xa')](),controller[_0x9766('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 9fb272f..0c2a373 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 _0x61a5=['sequelize','exports'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x61a5,0xcc));var _0x561a=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0x61a5[_0x2dbcef];return _0x5a90ea;};'use strict';var Sequelize=require(_0x561a('0x0'));module[_0x561a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3193=['exports','STRING'];(function(_0x12cdb8,_0xd9970b){var _0x1dd5bb=function(_0x30af1b){while(--_0x30af1b){_0x12cdb8['push'](_0x12cdb8['shift']());}};_0x1dd5bb(++_0xd9970b);}(_0x3193,0x1ba));var _0x3319=function(_0x346295,_0x28ae51){_0x346295=_0x346295-0x0;var _0x2e8ada=_0x3193[_0x346295];return _0x2e8ada;};'use strict';var Sequelize=require('sequelize');module[_0x3319('0x0')]={'name':{'type':Sequelize[_0x3319('0x1')]},'description':{'type':Sequelize[_0x3319('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 1b751c8..0ed7545 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 _0x4228=['Content-Range','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','order','getDescriptions','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3c78af,_0x13a87a){var _0x14b0cb=function(_0x2a6f28){while(--_0x2a6f28){_0x3c78af['push'](_0x3c78af['shift']());}};_0x14b0cb(++_0x13a87a);}(_0x4228,0xd8));var _0x8422=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4228[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8422('0x0'));var rimraf=require(_0x8422('0x1'));var zipdir=require(_0x8422('0x2'));var jsonpatch=require(_0x8422('0x3'));var rp=require(_0x8422('0x4'));var moment=require(_0x8422('0x5'));var BPromise=require(_0x8422('0x6'));var Mustache=require('mustache');var util=require(_0x8422('0x7'));var path=require(_0x8422('0x8'));var sox=require(_0x8422('0x9'));var csv=require(_0x8422('0xa'));var ejs=require(_0x8422('0xb'));var fs=require('fs');var fs_extra=require(_0x8422('0xc'));var _=require(_0x8422('0xd'));var squel=require(_0x8422('0xe'));var crypto=require(_0x8422('0xf'));var jsforce=require(_0x8422('0x10'));var deskjs=require(_0x8422('0x11'));var toCsv=require(_0x8422('0xa'));var querystring=require('querystring');var Papa=require(_0x8422('0x12'));var Redis=require(_0x8422('0x13'));var authService=require(_0x8422('0x14'));var qs=require(_0x8422('0x15'));var as=require(_0x8422('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8422('0x17'))(_0x8422('0x18'));var utils=require('../../config/utils');var config=require(_0x8422('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8422('0x1a'))['db'];function respondWithStatusCode(_0x12cca8,_0x5e173e){_0x5e173e=_0x5e173e||0xcc;return function(_0xe5cd2c){if(_0xe5cd2c){return _0x12cca8[_0x8422('0x1b')](_0x5e173e);}return _0x12cca8[_0x8422('0x1c')](_0x5e173e)[_0x8422('0x1d')]();};}function respondWithResult(_0x41c8d3,_0x597a56){_0x597a56=_0x597a56||0xc8;return function(_0x327ae0){if(_0x327ae0){return _0x41c8d3[_0x8422('0x1c')](_0x597a56)[_0x8422('0x1e')](_0x327ae0);}};}function respondWithFilteredResult(_0x508274,_0x5cb6c7){return function(_0x51e1bb){if(_0x51e1bb){var _0x1cf4ee=typeof _0x5cb6c7[_0x8422('0x1f')]===_0x8422('0x20')&&typeof _0x5cb6c7[_0x8422('0x21')]==='undefined';var _0x460825=_0x51e1bb[_0x8422('0x22')];var _0x44c5a2=_0x1cf4ee?0x0:_0x5cb6c7[_0x8422('0x1f')];var _0x4dbb77=_0x1cf4ee?_0x51e1bb[_0x8422('0x22')]:_0x5cb6c7[_0x8422('0x1f')]+_0x5cb6c7[_0x8422('0x21')];var _0x4c205c;if(_0x4dbb77>=_0x460825){_0x4dbb77=_0x460825;_0x4c205c=0xc8;}else{_0x4c205c=0xce;}_0x508274[_0x8422('0x1c')](_0x4c205c);return _0x508274[_0x8422('0x23')](_0x8422('0x24'),_0x44c5a2+'-'+_0x4dbb77+'/'+_0x460825)[_0x8422('0x1e')](_0x51e1bb);}return null;};}function patchUpdates(_0xf84561){return function(_0x3cb127){try{jsonpatch['apply'](_0x3cb127,_0xf84561,!![]);}catch(_0x22dffa){return BPromise[_0x8422('0x25')](_0x22dffa);}return _0x3cb127['save']();};}function saveUpdates(_0x13ea66,_0x5cdc9f){return function(_0x469041){if(_0x469041){return _0x469041[_0x8422('0x26')](_0x13ea66)[_0x8422('0x27')](function(_0x9c25c){return _0x9c25c;});}return null;};}function removeEntity(_0x423033,_0x830f3d){return function(_0x5d680d){if(_0x5d680d){return _0x5d680d[_0x8422('0x28')]()[_0x8422('0x27')](function(){_0x423033[_0x8422('0x1c')](0xcc)[_0x8422('0x1d')]();});}};}function handleEntityNotFound(_0x32b369,_0x5691cc){return function(_0x59c678){if(!_0x59c678){_0x32b369['sendStatus'](0x194);}return _0x59c678;};}function handleError(_0x30f125,_0x536b62){_0x536b62=_0x536b62||0x1f4;return function(_0xb573a5){logger[_0x8422('0x29')](_0xb573a5['stack']);if(_0xb573a5[_0x8422('0x2a')]){delete _0xb573a5[_0x8422('0x2a')];}_0x30f125[_0x8422('0x1c')](_0x536b62)[_0x8422('0x2b')](_0xb573a5);};}exports[_0x8422('0x2c')]=function(_0xb3f0c1,_0x412b6f){var _0x1d65c5={},_0x433bbd={},_0x35742f={'count':0x0,'rows':[]};var _0x11a379=_[_0x8422('0x2d')](db['VtigerConfiguration'][_0x8422('0x2e')],function(_0x55a19b){return{'name':_0x55a19b[_0x8422('0x2f')],'type':_0x55a19b[_0x8422('0x30')][_0x8422('0x31')]};});_0x433bbd['model']=_[_0x8422('0x2d')](_0x11a379,_0x8422('0x2a'));_0x433bbd[_0x8422('0x32')]=_[_0x8422('0x33')](_0xb3f0c1[_0x8422('0x32')]);_0x433bbd['filters']=_[_0x8422('0x34')](_0x433bbd[_0x8422('0x35')],_0x433bbd[_0x8422('0x32')]);_0x1d65c5[_0x8422('0x36')]=_[_0x8422('0x34')](_0x433bbd[_0x8422('0x35')],qs[_0x8422('0x37')](_0xb3f0c1['query']['fields']));_0x1d65c5[_0x8422('0x36')]=_0x1d65c5[_0x8422('0x36')][_0x8422('0x38')]?_0x1d65c5[_0x8422('0x36')]:_0x433bbd[_0x8422('0x35')];if(!_0xb3f0c1['query']['hasOwnProperty'](_0x8422('0x39'))){_0x1d65c5[_0x8422('0x21')]=qs['limit'](_0xb3f0c1[_0x8422('0x32')]['limit']);_0x1d65c5[_0x8422('0x1f')]=qs[_0x8422('0x1f')](_0xb3f0c1['query'][_0x8422('0x1f')]);}_0x1d65c5['order']=qs[_0x8422('0x3a')](_0xb3f0c1[_0x8422('0x32')][_0x8422('0x3a')]);_0x1d65c5['where']=qs[_0x8422('0x3b')](_[_0x8422('0x3c')](_0xb3f0c1[_0x8422('0x32')],_0x433bbd[_0x8422('0x3b')]),_0x11a379);if(_0xb3f0c1[_0x8422('0x32')][_0x8422('0x3d')]){_0x1d65c5[_0x8422('0x3e')]=_['merge'](_0x1d65c5[_0x8422('0x3e')],{'$or':_[_0x8422('0x2d')](_0x11a379,function(_0x39368d){if(_0x39368d['type']!==_0x8422('0x3f')){var _0x58d07f={};_0x58d07f[_0x39368d['name']]={'$like':'%'+_0xb3f0c1[_0x8422('0x32')]['filter']+'%'};return _0x58d07f;}})});}_0x1d65c5=_[_0x8422('0x40')]({},_0x1d65c5,_0xb3f0c1[_0x8422('0x41')]);var _0x1632f3={'where':_0x1d65c5[_0x8422('0x3e')]};return db[_0x8422('0x42')][_0x8422('0x22')](_0x1632f3)[_0x8422('0x27')](function(_0x285a4b){_0x35742f[_0x8422('0x22')]=_0x285a4b;if(_0xb3f0c1[_0x8422('0x32')][_0x8422('0x43')]){_0x1d65c5[_0x8422('0x44')]=[{'all':!![]}];}return db[_0x8422('0x42')][_0x8422('0x45')](_0x1d65c5);})[_0x8422('0x27')](function(_0x142d31){_0x35742f[_0x8422('0x46')]=_0x142d31;return _0x35742f;})['then'](respondWithFilteredResult(_0x412b6f,_0x1d65c5))[_0x8422('0x47')](handleError(_0x412b6f,null));};exports[_0x8422('0x48')]=function(_0x103b1a,_0x587630){var _0x5b3094={'raw':![],'where':{'id':_0x103b1a[_0x8422('0x49')]['id']}},_0x12fa7c={};_0x12fa7c[_0x8422('0x35')]=_[_0x8422('0x33')](db[_0x8422('0x42')][_0x8422('0x2e')]);_0x12fa7c[_0x8422('0x32')]=_[_0x8422('0x33')](_0x103b1a[_0x8422('0x32')]);_0x12fa7c[_0x8422('0x3b')]=_['intersection'](_0x12fa7c[_0x8422('0x35')],_0x12fa7c['query']);_0x5b3094[_0x8422('0x36')]=_[_0x8422('0x34')](_0x12fa7c[_0x8422('0x35')],qs[_0x8422('0x37')](_0x103b1a[_0x8422('0x32')][_0x8422('0x37')]));_0x5b3094[_0x8422('0x36')]=_0x5b3094['attributes']['length']?_0x5b3094[_0x8422('0x36')]:_0x12fa7c[_0x8422('0x35')];if(_0x103b1a['query'][_0x8422('0x43')]){_0x5b3094[_0x8422('0x44')]=[{'all':!![]}];}_0x5b3094=_['merge']({},_0x5b3094,_0x103b1a['options']);return db[_0x8422('0x42')][_0x8422('0x4a')](_0x5b3094)[_0x8422('0x27')](handleEntityNotFound(_0x587630,null))[_0x8422('0x27')](respondWithResult(_0x587630,null))[_0x8422('0x47')](handleError(_0x587630,null));};exports[_0x8422('0x4b')]=function(_0x3ac645,_0x284b17){return db[_0x8422('0x42')][_0x8422('0x4b')](_0x3ac645[_0x8422('0x4c')],{})[_0x8422('0x27')](respondWithResult(_0x284b17,0xc9))[_0x8422('0x47')](handleError(_0x284b17,null));};exports['update']=function(_0x52a34c,_0x17c7f2){if(_0x52a34c['body']['id']){delete _0x52a34c[_0x8422('0x4c')]['id'];}return db[_0x8422('0x42')][_0x8422('0x4a')]({'where':{'id':_0x52a34c[_0x8422('0x49')]['id']}})[_0x8422('0x27')](handleEntityNotFound(_0x17c7f2,null))[_0x8422('0x27')](saveUpdates(_0x52a34c[_0x8422('0x4c')],null))[_0x8422('0x27')](respondWithResult(_0x17c7f2,null))[_0x8422('0x47')](handleError(_0x17c7f2,null));};exports[_0x8422('0x28')]=function(_0x21d377,_0x1ff6aa){return db[_0x8422('0x42')][_0x8422('0x4a')]({'where':{'id':_0x21d377[_0x8422('0x49')]['id']}})[_0x8422('0x27')](handleEntityNotFound(_0x1ff6aa,null))[_0x8422('0x27')](removeEntity(_0x1ff6aa,null))[_0x8422('0x47')](handleError(_0x1ff6aa,null));};exports[_0x8422('0x4d')]=function(_0x150f35,_0x3bfe6a,_0x34106c){var _0x4c16af={};var _0x2eb254={};var _0x488a98;var _0x27fa87;return db[_0x8422('0x42')][_0x8422('0x4e')]({'where':{'id':_0x150f35[_0x8422('0x49')]['id']}})[_0x8422('0x27')](handleEntityNotFound(_0x3bfe6a,null))['then'](function(_0x95c9b5){if(_0x95c9b5){_0x488a98=_0x95c9b5;_0x2eb254['model']=_[_0x8422('0x33')](db[_0x8422('0x4f')][_0x8422('0x2e')]);_0x2eb254['query']=_[_0x8422('0x33')](_0x150f35[_0x8422('0x32')]);_0x2eb254['filters']=_['intersection'](_0x2eb254['model'],_0x2eb254[_0x8422('0x32')]);_0x4c16af[_0x8422('0x36')]=_['intersection'](_0x2eb254[_0x8422('0x35')],qs[_0x8422('0x37')](_0x150f35[_0x8422('0x32')]['fields']));_0x4c16af['attributes']=_0x4c16af[_0x8422('0x36')][_0x8422('0x38')]?_0x4c16af[_0x8422('0x36')]:_0x2eb254[_0x8422('0x35')];_0x4c16af['order']=qs[_0x8422('0x3a')](_0x150f35[_0x8422('0x32')][_0x8422('0x3a')]);_0x4c16af[_0x8422('0x3e')]=qs[_0x8422('0x3b')](_[_0x8422('0x3c')](_0x150f35['query'],_0x2eb254[_0x8422('0x3b')]));if(_0x150f35[_0x8422('0x32')][_0x8422('0x3d')]){_0x4c16af[_0x8422('0x3e')]=_[_0x8422('0x40')](_0x4c16af['where'],{'$or':_[_0x8422('0x2d')](_0x4c16af[_0x8422('0x36')],function(_0x379a1a){var _0xedb92f={};_0xedb92f[_0x379a1a]={'$like':'%'+_0x150f35['query'][_0x8422('0x3d')]+'%'};return _0xedb92f;})});}_0x4c16af=_[_0x8422('0x40')]({},_0x4c16af,_0x150f35[_0x8422('0x41')]);return _0x488a98[_0x8422('0x4d')](_0x4c16af);}})[_0x8422('0x27')](function(_0x863b94){if(_0x863b94){_0x27fa87=_0x863b94[_0x8422('0x38')];if(!_0x150f35[_0x8422('0x32')][_0x8422('0x50')]('nolimit')){_0x4c16af[_0x8422('0x21')]=qs[_0x8422('0x21')](_0x150f35[_0x8422('0x32')][_0x8422('0x21')]);_0x4c16af[_0x8422('0x1f')]=qs[_0x8422('0x1f')](_0x150f35[_0x8422('0x32')][_0x8422('0x1f')]);}return _0x488a98[_0x8422('0x4d')](_0x4c16af);}})['then'](function(_0x2be18b){if(_0x2be18b){return _0x2be18b?{'count':_0x27fa87,'rows':_0x2be18b}:null;}})[_0x8422('0x27')](respondWithResult(_0x3bfe6a,null))['catch'](handleError(_0x3bfe6a,null));};exports[_0x8422('0x51')]=function(_0x36dfc1,_0x2f6fab,_0xbb9fc6){var _0x2ae910={};var _0x41b6c5={};var _0x136f3e;var _0x346d68;return db[_0x8422('0x42')][_0x8422('0x4e')]({'where':{'id':_0x36dfc1[_0x8422('0x49')]['id']}})[_0x8422('0x27')](handleEntityNotFound(_0x2f6fab,null))['then'](function(_0x598ea6){if(_0x598ea6){_0x136f3e=_0x598ea6;_0x41b6c5[_0x8422('0x35')]=_[_0x8422('0x33')](db['VtigerField']['rawAttributes']);_0x41b6c5['query']=_['keys'](_0x36dfc1[_0x8422('0x32')]);_0x41b6c5[_0x8422('0x3b')]=_['intersection'](_0x41b6c5['model'],_0x41b6c5[_0x8422('0x32')]);_0x2ae910[_0x8422('0x36')]=_['intersection'](_0x41b6c5[_0x8422('0x35')],qs['fields'](_0x36dfc1['query']['fields']));_0x2ae910['attributes']=_0x2ae910[_0x8422('0x36')][_0x8422('0x38')]?_0x2ae910[_0x8422('0x36')]:_0x41b6c5[_0x8422('0x35')];_0x2ae910[_0x8422('0x52')]=qs['sort'](_0x36dfc1[_0x8422('0x32')][_0x8422('0x3a')]);_0x2ae910[_0x8422('0x3e')]=qs[_0x8422('0x3b')](_[_0x8422('0x3c')](_0x36dfc1[_0x8422('0x32')],_0x41b6c5[_0x8422('0x3b')]));if(_0x36dfc1[_0x8422('0x32')][_0x8422('0x3d')]){_0x2ae910['where']=_[_0x8422('0x40')](_0x2ae910['where'],{'$or':_['map'](_0x2ae910[_0x8422('0x36')],function(_0x1896b6){var _0x1c672f={};_0x1c672f[_0x1896b6]={'$like':'%'+_0x36dfc1[_0x8422('0x32')]['filter']+'%'};return _0x1c672f;})});}_0x2ae910=_[_0x8422('0x40')]({},_0x2ae910,_0x36dfc1[_0x8422('0x41')]);return _0x136f3e[_0x8422('0x51')](_0x2ae910);}})[_0x8422('0x27')](function(_0x457640){if(_0x457640){_0x346d68=_0x457640[_0x8422('0x38')];if(!_0x36dfc1['query'][_0x8422('0x50')](_0x8422('0x39'))){_0x2ae910[_0x8422('0x21')]=qs['limit'](_0x36dfc1[_0x8422('0x32')]['limit']);_0x2ae910[_0x8422('0x1f')]=qs['offset'](_0x36dfc1[_0x8422('0x32')]['offset']);}return _0x136f3e[_0x8422('0x51')](_0x2ae910);}})[_0x8422('0x27')](function(_0x413c94){if(_0x413c94){return _0x413c94?{'count':_0x346d68,'rows':_0x413c94}:null;}})[_0x8422('0x27')](respondWithResult(_0x2f6fab,null))['catch'](handleError(_0x2f6fab,null));};exports[_0x8422('0x53')]=function(_0x48824c,_0x3253c7,_0x1f6d70){var _0x10abe7={};var _0x1c0478={};var _0x33e0e5;var _0x581a47;return db[_0x8422('0x42')]['findOne']({'where':{'id':_0x48824c[_0x8422('0x49')]['id']}})[_0x8422('0x27')](handleEntityNotFound(_0x3253c7,null))['then'](function(_0x4d4027){if(_0x4d4027){_0x33e0e5=_0x4d4027;_0x1c0478[_0x8422('0x35')]=_[_0x8422('0x33')](db[_0x8422('0x4f')][_0x8422('0x2e')]);_0x1c0478[_0x8422('0x32')]=_[_0x8422('0x33')](_0x48824c[_0x8422('0x32')]);_0x1c0478[_0x8422('0x3b')]=_[_0x8422('0x34')](_0x1c0478['model'],_0x1c0478['query']);_0x10abe7[_0x8422('0x36')]=_[_0x8422('0x34')](_0x1c0478[_0x8422('0x35')],qs[_0x8422('0x37')](_0x48824c[_0x8422('0x32')]['fields']));_0x10abe7[_0x8422('0x36')]=_0x10abe7[_0x8422('0x36')]['length']?_0x10abe7[_0x8422('0x36')]:_0x1c0478[_0x8422('0x35')];_0x10abe7[_0x8422('0x52')]=qs[_0x8422('0x3a')](_0x48824c[_0x8422('0x32')][_0x8422('0x3a')]);_0x10abe7[_0x8422('0x3e')]=qs['filters'](_[_0x8422('0x3c')](_0x48824c[_0x8422('0x32')],_0x1c0478[_0x8422('0x3b')]));if(_0x48824c[_0x8422('0x32')][_0x8422('0x3d')]){_0x10abe7[_0x8422('0x3e')]=_[_0x8422('0x40')](_0x10abe7[_0x8422('0x3e')],{'$or':_[_0x8422('0x2d')](_0x10abe7['attributes'],function(_0x323cf3){var _0x3c0b44={};_0x3c0b44[_0x323cf3]={'$like':'%'+_0x48824c[_0x8422('0x32')][_0x8422('0x3d')]+'%'};return _0x3c0b44;})});}_0x10abe7=_['merge']({},_0x10abe7,_0x48824c[_0x8422('0x41')]);return _0x33e0e5[_0x8422('0x53')](_0x10abe7);}})[_0x8422('0x27')](function(_0x119da8){if(_0x119da8){_0x581a47=_0x119da8[_0x8422('0x38')];if(!_0x48824c[_0x8422('0x32')][_0x8422('0x50')](_0x8422('0x39'))){_0x10abe7[_0x8422('0x21')]=qs['limit'](_0x48824c[_0x8422('0x32')][_0x8422('0x21')]);_0x10abe7[_0x8422('0x1f')]=qs[_0x8422('0x1f')](_0x48824c[_0x8422('0x32')][_0x8422('0x1f')]);}return _0x33e0e5[_0x8422('0x53')](_0x10abe7);}})['then'](function(_0x5eb0ff){if(_0x5eb0ff){return _0x5eb0ff?{'count':_0x581a47,'rows':_0x5eb0ff}:null;}})[_0x8422('0x27')](respondWithResult(_0x3253c7,null))[_0x8422('0x47')](handleError(_0x3253c7,null));}; \ No newline at end of file +var _0xa1a2=['destroy','stack','name','index','VtigerConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','update','getFields','findOne','pick','map','hasOwnProperty','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then'];(function(_0x34d545,_0x376905){var _0x58b9b8=function(_0x238104){while(--_0x238104){_0x34d545['push'](_0x34d545['shift']());}};_0x58b9b8(++_0x376905);}(_0xa1a2,0x76));var _0x2a1a=function(_0x1b9780,_0x916575){_0x1b9780=_0x1b9780-0x0;var _0x4b2d5c=_0xa1a2[_0x1b9780];return _0x4b2d5c;};'use strict';var emlformat=require(_0x2a1a('0x0'));var rimraf=require(_0x2a1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2a1a('0x2'));var moment=require(_0x2a1a('0x3'));var BPromise=require(_0x2a1a('0x4'));var Mustache=require(_0x2a1a('0x5'));var util=require(_0x2a1a('0x6'));var path=require(_0x2a1a('0x7'));var sox=require(_0x2a1a('0x8'));var csv=require(_0x2a1a('0x9'));var ejs=require(_0x2a1a('0xa'));var fs=require('fs');var fs_extra=require(_0x2a1a('0xb'));var _=require(_0x2a1a('0xc'));var squel=require(_0x2a1a('0xd'));var crypto=require(_0x2a1a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2a1a('0xf'));var toCsv=require(_0x2a1a('0x9'));var querystring=require(_0x2a1a('0x10'));var Papa=require('papaparse');var Redis=require(_0x2a1a('0x11'));var authService=require(_0x2a1a('0x12'));var qs=require(_0x2a1a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a1a('0x14'));var logger=require(_0x2a1a('0x15'))('api');var utils=require(_0x2a1a('0x16'));var config=require(_0x2a1a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a1a('0x18'))['db'];function respondWithStatusCode(_0x1844fe,_0x55e962){_0x55e962=_0x55e962||0xcc;return function(_0x390e34){if(_0x390e34){return _0x1844fe['sendStatus'](_0x55e962);}return _0x1844fe[_0x2a1a('0x19')](_0x55e962)['end']();};}function respondWithResult(_0x159909,_0x424a43){_0x424a43=_0x424a43||0xc8;return function(_0x1e0491){if(_0x1e0491){return _0x159909[_0x2a1a('0x19')](_0x424a43)[_0x2a1a('0x1a')](_0x1e0491);}};}function respondWithFilteredResult(_0x28fd00,_0x27f019){return function(_0x5514e8){if(_0x5514e8){var _0x2d3ade=typeof _0x27f019[_0x2a1a('0x1b')]==='undefined'&&typeof _0x27f019[_0x2a1a('0x1c')]===_0x2a1a('0x1d');var _0x71c525=_0x5514e8[_0x2a1a('0x1e')];var _0x4598f0=_0x2d3ade?0x0:_0x27f019[_0x2a1a('0x1b')];var _0x3015e0=_0x2d3ade?_0x5514e8[_0x2a1a('0x1e')]:_0x27f019[_0x2a1a('0x1b')]+_0x27f019[_0x2a1a('0x1c')];var _0x4a6aba;if(_0x3015e0>=_0x71c525){_0x3015e0=_0x71c525;_0x4a6aba=0xc8;}else{_0x4a6aba=0xce;}_0x28fd00[_0x2a1a('0x19')](_0x4a6aba);return _0x28fd00[_0x2a1a('0x1f')](_0x2a1a('0x20'),_0x4598f0+'-'+_0x3015e0+'/'+_0x71c525)[_0x2a1a('0x1a')](_0x5514e8);}return null;};}function patchUpdates(_0x3ffc97){return function(_0x5c2df7){try{jsonpatch[_0x2a1a('0x21')](_0x5c2df7,_0x3ffc97,!![]);}catch(_0x2dc8dd){return BPromise['reject'](_0x2dc8dd);}return _0x5c2df7[_0x2a1a('0x22')]();};}function saveUpdates(_0x555b87,_0x5a2e17){return function(_0x1acde1){if(_0x1acde1){return _0x1acde1['update'](_0x555b87)[_0x2a1a('0x23')](function(_0x3ba44f){return _0x3ba44f;});}return null;};}function removeEntity(_0x47cd42,_0x2c7790){return function(_0x19e8ca){if(_0x19e8ca){return _0x19e8ca[_0x2a1a('0x24')]()['then'](function(){_0x47cd42[_0x2a1a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b037,_0x3125b4){return function(_0x342165){if(!_0x342165){_0x18b037['sendStatus'](0x194);}return _0x342165;};}function handleError(_0x499af3,_0x5f3634){_0x5f3634=_0x5f3634||0x1f4;return function(_0x2ef8e2){logger['error'](_0x2ef8e2[_0x2a1a('0x25')]);if(_0x2ef8e2[_0x2a1a('0x26')]){delete _0x2ef8e2[_0x2a1a('0x26')];}_0x499af3[_0x2a1a('0x19')](_0x5f3634)['send'](_0x2ef8e2);};}exports[_0x2a1a('0x27')]=function(_0x361d16,_0x4de472){var _0x4ec380={},_0x2c04ac={},_0x290292={'count':0x0,'rows':[]};var _0x561705=_['map'](db[_0x2a1a('0x28')][_0x2a1a('0x29')],function(_0x2cc2cc){return{'name':_0x2cc2cc[_0x2a1a('0x2a')],'type':_0x2cc2cc[_0x2a1a('0x2b')]['key']};});_0x2c04ac[_0x2a1a('0x2c')]=_['map'](_0x561705,_0x2a1a('0x26'));_0x2c04ac[_0x2a1a('0x2d')]=_['keys'](_0x361d16['query']);_0x2c04ac[_0x2a1a('0x2e')]=_['intersection'](_0x2c04ac[_0x2a1a('0x2c')],_0x2c04ac['query']);_0x4ec380['attributes']=_[_0x2a1a('0x2f')](_0x2c04ac[_0x2a1a('0x2c')],qs[_0x2a1a('0x30')](_0x361d16[_0x2a1a('0x2d')][_0x2a1a('0x30')]));_0x4ec380[_0x2a1a('0x31')]=_0x4ec380['attributes'][_0x2a1a('0x32')]?_0x4ec380[_0x2a1a('0x31')]:_0x2c04ac[_0x2a1a('0x2c')];if(!_0x361d16[_0x2a1a('0x2d')]['hasOwnProperty'](_0x2a1a('0x33'))){_0x4ec380['limit']=qs[_0x2a1a('0x1c')](_0x361d16[_0x2a1a('0x2d')]['limit']);_0x4ec380[_0x2a1a('0x1b')]=qs[_0x2a1a('0x1b')](_0x361d16[_0x2a1a('0x2d')]['offset']);}_0x4ec380[_0x2a1a('0x34')]=qs[_0x2a1a('0x35')](_0x361d16[_0x2a1a('0x2d')][_0x2a1a('0x35')]);_0x4ec380['where']=qs['filters'](_['pick'](_0x361d16[_0x2a1a('0x2d')],_0x2c04ac[_0x2a1a('0x2e')]),_0x561705);if(_0x361d16[_0x2a1a('0x2d')][_0x2a1a('0x36')]){_0x4ec380[_0x2a1a('0x37')]=_[_0x2a1a('0x38')](_0x4ec380['where'],{'$or':_['map'](_0x561705,function(_0x1a9a71){if(_0x1a9a71[_0x2a1a('0x2b')]!==_0x2a1a('0x39')){var _0xe09894={};_0xe09894[_0x1a9a71[_0x2a1a('0x26')]]={'$like':'%'+_0x361d16[_0x2a1a('0x2d')][_0x2a1a('0x36')]+'%'};return _0xe09894;}})});}_0x4ec380=_['merge']({},_0x4ec380,_0x361d16[_0x2a1a('0x3a')]);var _0x395c27={'where':_0x4ec380[_0x2a1a('0x37')]};return db[_0x2a1a('0x28')]['count'](_0x395c27)[_0x2a1a('0x23')](function(_0x4bac47){_0x290292['count']=_0x4bac47;if(_0x361d16[_0x2a1a('0x2d')][_0x2a1a('0x3b')]){_0x4ec380[_0x2a1a('0x3c')]=[{'all':!![]}];}return db[_0x2a1a('0x28')]['findAll'](_0x4ec380);})[_0x2a1a('0x23')](function(_0x504c74){_0x290292['rows']=_0x504c74;return _0x290292;})[_0x2a1a('0x23')](respondWithFilteredResult(_0x4de472,_0x4ec380))[_0x2a1a('0x3d')](handleError(_0x4de472,null));};exports[_0x2a1a('0x3e')]=function(_0x568a9,_0x4b0e7d){var _0x5d1c01={'raw':![],'where':{'id':_0x568a9[_0x2a1a('0x3f')]['id']}},_0xa9dcda={};_0xa9dcda[_0x2a1a('0x2c')]=_[_0x2a1a('0x40')](db[_0x2a1a('0x28')][_0x2a1a('0x29')]);_0xa9dcda[_0x2a1a('0x2d')]=_['keys'](_0x568a9[_0x2a1a('0x2d')]);_0xa9dcda[_0x2a1a('0x2e')]=_['intersection'](_0xa9dcda[_0x2a1a('0x2c')],_0xa9dcda[_0x2a1a('0x2d')]);_0x5d1c01[_0x2a1a('0x31')]=_[_0x2a1a('0x2f')](_0xa9dcda['model'],qs[_0x2a1a('0x30')](_0x568a9[_0x2a1a('0x2d')][_0x2a1a('0x30')]));_0x5d1c01[_0x2a1a('0x31')]=_0x5d1c01[_0x2a1a('0x31')]['length']?_0x5d1c01[_0x2a1a('0x31')]:_0xa9dcda[_0x2a1a('0x2c')];if(_0x568a9[_0x2a1a('0x2d')][_0x2a1a('0x3b')]){_0x5d1c01['include']=[{'all':!![]}];}_0x5d1c01=_[_0x2a1a('0x38')]({},_0x5d1c01,_0x568a9[_0x2a1a('0x3a')]);return db['VtigerConfiguration'][_0x2a1a('0x41')](_0x5d1c01)[_0x2a1a('0x23')](handleEntityNotFound(_0x4b0e7d,null))[_0x2a1a('0x23')](respondWithResult(_0x4b0e7d,null))[_0x2a1a('0x3d')](handleError(_0x4b0e7d,null));};exports[_0x2a1a('0x42')]=function(_0xd910ad,_0x44688c){return db[_0x2a1a('0x28')][_0x2a1a('0x42')](_0xd910ad[_0x2a1a('0x43')],{})[_0x2a1a('0x23')](respondWithResult(_0x44688c,0xc9))[_0x2a1a('0x3d')](handleError(_0x44688c,null));};exports[_0x2a1a('0x44')]=function(_0x2b432c,_0x9e796a){if(_0x2b432c[_0x2a1a('0x43')]['id']){delete _0x2b432c[_0x2a1a('0x43')]['id'];}return db[_0x2a1a('0x28')]['find']({'where':{'id':_0x2b432c[_0x2a1a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x9e796a,null))[_0x2a1a('0x23')](saveUpdates(_0x2b432c['body'],null))['then'](respondWithResult(_0x9e796a,null))['catch'](handleError(_0x9e796a,null));};exports[_0x2a1a('0x24')]=function(_0x482077,_0x4119b6){return db[_0x2a1a('0x28')][_0x2a1a('0x41')]({'where':{'id':_0x482077['params']['id']}})[_0x2a1a('0x23')](handleEntityNotFound(_0x4119b6,null))[_0x2a1a('0x23')](removeEntity(_0x4119b6,null))[_0x2a1a('0x3d')](handleError(_0x4119b6,null));};exports[_0x2a1a('0x45')]=function(_0x5d2b22,_0x58856f,_0x11ff3a){var _0x475c7d={};var _0x103b9a={};var _0x378246;var _0x1a4704;return db[_0x2a1a('0x28')][_0x2a1a('0x46')]({'where':{'id':_0x5d2b22[_0x2a1a('0x3f')]['id']}})[_0x2a1a('0x23')](handleEntityNotFound(_0x58856f,null))[_0x2a1a('0x23')](function(_0x456418){if(_0x456418){_0x378246=_0x456418;_0x103b9a[_0x2a1a('0x2c')]=_[_0x2a1a('0x40')](db['VtigerField'][_0x2a1a('0x29')]);_0x103b9a[_0x2a1a('0x2d')]=_['keys'](_0x5d2b22[_0x2a1a('0x2d')]);_0x103b9a['filters']=_[_0x2a1a('0x2f')](_0x103b9a[_0x2a1a('0x2c')],_0x103b9a[_0x2a1a('0x2d')]);_0x475c7d[_0x2a1a('0x31')]=_['intersection'](_0x103b9a[_0x2a1a('0x2c')],qs['fields'](_0x5d2b22[_0x2a1a('0x2d')][_0x2a1a('0x30')]));_0x475c7d[_0x2a1a('0x31')]=_0x475c7d[_0x2a1a('0x31')][_0x2a1a('0x32')]?_0x475c7d[_0x2a1a('0x31')]:_0x103b9a['model'];_0x475c7d[_0x2a1a('0x34')]=qs['sort'](_0x5d2b22['query'][_0x2a1a('0x35')]);_0x475c7d['where']=qs['filters'](_[_0x2a1a('0x47')](_0x5d2b22[_0x2a1a('0x2d')],_0x103b9a[_0x2a1a('0x2e')]));if(_0x5d2b22['query']['filter']){_0x475c7d[_0x2a1a('0x37')]=_[_0x2a1a('0x38')](_0x475c7d[_0x2a1a('0x37')],{'$or':_[_0x2a1a('0x48')](_0x475c7d['attributes'],function(_0x4dbc07){var _0x5a0a72={};_0x5a0a72[_0x4dbc07]={'$like':'%'+_0x5d2b22[_0x2a1a('0x2d')][_0x2a1a('0x36')]+'%'};return _0x5a0a72;})});}_0x475c7d=_[_0x2a1a('0x38')]({},_0x475c7d,_0x5d2b22[_0x2a1a('0x3a')]);return _0x378246[_0x2a1a('0x45')](_0x475c7d);}})[_0x2a1a('0x23')](function(_0x236eeb){if(_0x236eeb){_0x1a4704=_0x236eeb['length'];if(!_0x5d2b22[_0x2a1a('0x2d')][_0x2a1a('0x49')]('nolimit')){_0x475c7d[_0x2a1a('0x1c')]=qs[_0x2a1a('0x1c')](_0x5d2b22[_0x2a1a('0x2d')][_0x2a1a('0x1c')]);_0x475c7d[_0x2a1a('0x1b')]=qs[_0x2a1a('0x1b')](_0x5d2b22[_0x2a1a('0x2d')][_0x2a1a('0x1b')]);}return _0x378246[_0x2a1a('0x45')](_0x475c7d);}})[_0x2a1a('0x23')](function(_0x1f6324){if(_0x1f6324){return _0x1f6324?{'count':_0x1a4704,'rows':_0x1f6324}:null;}})['then'](respondWithResult(_0x58856f,null))[_0x2a1a('0x3d')](handleError(_0x58856f,null));};exports['getSubjects']=function(_0x4bb084,_0x5b0d22,_0x1c13d2){var _0x3b942f={};var _0x1ef423={};var _0x1b4971;var _0x358639;return db['VtigerConfiguration'][_0x2a1a('0x46')]({'where':{'id':_0x4bb084[_0x2a1a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5b0d22,null))[_0x2a1a('0x23')](function(_0x6326fd){if(_0x6326fd){_0x1b4971=_0x6326fd;_0x1ef423[_0x2a1a('0x2c')]=_[_0x2a1a('0x40')](db[_0x2a1a('0x4a')]['rawAttributes']);_0x1ef423[_0x2a1a('0x2d')]=_[_0x2a1a('0x40')](_0x4bb084[_0x2a1a('0x2d')]);_0x1ef423['filters']=_['intersection'](_0x1ef423['model'],_0x1ef423['query']);_0x3b942f[_0x2a1a('0x31')]=_[_0x2a1a('0x2f')](_0x1ef423[_0x2a1a('0x2c')],qs[_0x2a1a('0x30')](_0x4bb084[_0x2a1a('0x2d')]['fields']));_0x3b942f[_0x2a1a('0x31')]=_0x3b942f[_0x2a1a('0x31')][_0x2a1a('0x32')]?_0x3b942f[_0x2a1a('0x31')]:_0x1ef423[_0x2a1a('0x2c')];_0x3b942f[_0x2a1a('0x34')]=qs['sort'](_0x4bb084['query'][_0x2a1a('0x35')]);_0x3b942f['where']=qs[_0x2a1a('0x2e')](_[_0x2a1a('0x47')](_0x4bb084['query'],_0x1ef423[_0x2a1a('0x2e')]));if(_0x4bb084[_0x2a1a('0x2d')][_0x2a1a('0x36')]){_0x3b942f[_0x2a1a('0x37')]=_[_0x2a1a('0x38')](_0x3b942f['where'],{'$or':_[_0x2a1a('0x48')](_0x3b942f[_0x2a1a('0x31')],function(_0x56cc73){var _0x5dfe41={};_0x5dfe41[_0x56cc73]={'$like':'%'+_0x4bb084[_0x2a1a('0x2d')]['filter']+'%'};return _0x5dfe41;})});}_0x3b942f=_[_0x2a1a('0x38')]({},_0x3b942f,_0x4bb084[_0x2a1a('0x3a')]);return _0x1b4971[_0x2a1a('0x4b')](_0x3b942f);}})[_0x2a1a('0x23')](function(_0x50d970){if(_0x50d970){_0x358639=_0x50d970[_0x2a1a('0x32')];if(!_0x4bb084['query'][_0x2a1a('0x49')](_0x2a1a('0x33'))){_0x3b942f['limit']=qs['limit'](_0x4bb084['query'][_0x2a1a('0x1c')]);_0x3b942f[_0x2a1a('0x1b')]=qs['offset'](_0x4bb084['query']['offset']);}return _0x1b4971[_0x2a1a('0x4b')](_0x3b942f);}})[_0x2a1a('0x23')](function(_0x48fb04){if(_0x48fb04){return _0x48fb04?{'count':_0x358639,'rows':_0x48fb04}:null;}})[_0x2a1a('0x23')](respondWithResult(_0x5b0d22,null))[_0x2a1a('0x3d')](handleError(_0x5b0d22,null));};exports['getDescriptions']=function(_0x56da3e,_0x32db8a,_0x4f0157){var _0x11c13a={};var _0x45b28c={};var _0x59051e;var _0x4880e3;return db['VtigerConfiguration'][_0x2a1a('0x46')]({'where':{'id':_0x56da3e[_0x2a1a('0x3f')]['id']}})[_0x2a1a('0x23')](handleEntityNotFound(_0x32db8a,null))[_0x2a1a('0x23')](function(_0x4ffde3){if(_0x4ffde3){_0x59051e=_0x4ffde3;_0x45b28c[_0x2a1a('0x2c')]=_['keys'](db[_0x2a1a('0x4a')][_0x2a1a('0x29')]);_0x45b28c[_0x2a1a('0x2d')]=_[_0x2a1a('0x40')](_0x56da3e[_0x2a1a('0x2d')]);_0x45b28c['filters']=_['intersection'](_0x45b28c[_0x2a1a('0x2c')],_0x45b28c[_0x2a1a('0x2d')]);_0x11c13a[_0x2a1a('0x31')]=_['intersection'](_0x45b28c['model'],qs['fields'](_0x56da3e['query'][_0x2a1a('0x30')]));_0x11c13a['attributes']=_0x11c13a[_0x2a1a('0x31')][_0x2a1a('0x32')]?_0x11c13a[_0x2a1a('0x31')]:_0x45b28c[_0x2a1a('0x2c')];_0x11c13a[_0x2a1a('0x34')]=qs[_0x2a1a('0x35')](_0x56da3e[_0x2a1a('0x2d')]['sort']);_0x11c13a['where']=qs[_0x2a1a('0x2e')](_[_0x2a1a('0x47')](_0x56da3e[_0x2a1a('0x2d')],_0x45b28c[_0x2a1a('0x2e')]));if(_0x56da3e[_0x2a1a('0x2d')][_0x2a1a('0x36')]){_0x11c13a[_0x2a1a('0x37')]=_[_0x2a1a('0x38')](_0x11c13a['where'],{'$or':_[_0x2a1a('0x48')](_0x11c13a['attributes'],function(_0xff7ded){var _0x47706d={};_0x47706d[_0xff7ded]={'$like':'%'+_0x56da3e[_0x2a1a('0x2d')][_0x2a1a('0x36')]+'%'};return _0x47706d;})});}_0x11c13a=_[_0x2a1a('0x38')]({},_0x11c13a,_0x56da3e[_0x2a1a('0x3a')]);return _0x59051e[_0x2a1a('0x4c')](_0x11c13a);}})[_0x2a1a('0x23')](function(_0x6fc938){if(_0x6fc938){_0x4880e3=_0x6fc938[_0x2a1a('0x32')];if(!_0x56da3e[_0x2a1a('0x2d')][_0x2a1a('0x49')]('nolimit')){_0x11c13a[_0x2a1a('0x1c')]=qs[_0x2a1a('0x1c')](_0x56da3e['query'][_0x2a1a('0x1c')]);_0x11c13a[_0x2a1a('0x1b')]=qs['offset'](_0x56da3e['query'][_0x2a1a('0x1b')]);}return _0x59051e[_0x2a1a('0x4c')](_0x11c13a);}})['then'](function(_0x2cbebf){if(_0x2cbebf){return _0x2cbebf?{'count':_0x4880e3,'rows':_0x2cbebf}:null;}})['then'](respondWithResult(_0x32db8a,null))['catch'](handleError(_0x32db8a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a8bb2e0..de442d3 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 _0x88ac=['moment','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x88ac,0x197));var _0xc88a=function(_0x4ea44b,_0x546b89){_0x4ea44b=_0x4ea44b-0x0;var _0x418cc9=_0x88ac[_0x4ea44b];return _0x418cc9;};'use strict';var _=require(_0xc88a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc88a('0x1'));var BPromise=require('bluebird');var rp=require(_0xc88a('0x2'));var fs=require('fs');var path=require(_0xc88a('0x3'));var rimraf=require('rimraf');var config=require(_0xc88a('0x4'));var attributes=require(_0xc88a('0x5'));module['exports']=function(_0x12e6dd,_0x51f86f){return _0x12e6dd['define'](_0xc88a('0x6'),attributes,{'tableName':_0xc88a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08b5=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x45b3b7,_0x2b645e){var _0x2849dd=function(_0x2e79bd){while(--_0x2e79bd){_0x45b3b7['push'](_0x45b3b7['shift']());}};_0x2849dd(++_0x2b645e);}(_0x08b5,0x95));var _0x508b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x08b5[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x508b('0x0'));var util=require(_0x508b('0x1'));var logger=require(_0x508b('0x2'))(_0x508b('0x3'));var moment=require(_0x508b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x508b('0x5'));var rimraf=require(_0x508b('0x6'));var config=require(_0x508b('0x7'));var attributes=require(_0x508b('0x8'));module[_0x508b('0x9')]=function(_0x21b36f,_0x58ad1e){return _0x21b36f[_0x508b('0xa')](_0x508b('0xb'),attributes,{'tableName':_0x508b('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 1e5b28a..f634ce3 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 _0x7aa7=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7aa7,0xf3));var _0x77aa=function(_0x1c1820,_0x18bb79){_0x1c1820=_0x1c1820-0x0;var _0x6690e6=_0x7aa7[_0x1c1820];return _0x6690e6;};'use strict';var _=require('lodash');var util=require(_0x77aa('0x0'));var moment=require(_0x77aa('0x1'));var BPromise=require(_0x77aa('0x2'));var rs=require(_0x77aa('0x3'));var fs=require('fs');var Redis=require(_0x77aa('0x4'));var db=require(_0x77aa('0x5'))['db'];var utils=require(_0x77aa('0x6'));var logger=require(_0x77aa('0x7'))('rpc');var config=require(_0x77aa('0x8'));var jayson=require(_0x77aa('0x9'));var client=jayson[_0x77aa('0xa')][_0x77aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482b39,_0x5f1248,_0x37562b){return new BPromise(function(_0x1f786e,_0x1f33da){return client[_0x77aa('0xc')](_0x482b39,_0x37562b)[_0x77aa('0xd')](function(_0x372a9e){logger[_0x77aa('0xe')](_0x77aa('0xf'),_0x5f1248,_0x77aa('0x10'));logger[_0x77aa('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5f1248,_0x77aa('0x10'),JSON[_0x77aa('0x12')](_0x372a9e));if(_0x372a9e[_0x77aa('0x13')]){if(_0x372a9e[_0x77aa('0x13')][_0x77aa('0x14')]===0x1f4){logger[_0x77aa('0x13')](_0x77aa('0xf'),_0x5f1248,_0x372a9e[_0x77aa('0x13')]['message']);return _0x1f33da(_0x372a9e['error']['message']);}logger[_0x77aa('0x13')](_0x77aa('0xf'),_0x5f1248,_0x372a9e[_0x77aa('0x13')]['message']);return _0x1f786e(_0x372a9e['error'][_0x77aa('0x15')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5f1248,'request\x20sent');_0x1f786e(_0x372a9e['result'][_0x77aa('0x15')]);}})[_0x77aa('0x16')](function(_0xc049f1){logger[_0x77aa('0x13')](_0x77aa('0xf'),_0x5f1248,_0xc049f1);_0x1f33da(_0xc049f1);});});} \ No newline at end of file +var _0x2e0d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2e0d,0x1c7));var _0xd2e0=function(_0x3e33ee,_0x1d44f0){_0x3e33ee=_0x3e33ee-0x0;var _0x270717=_0x2e0d[_0x3e33ee];return _0x270717;};'use strict';var _=require(_0xd2e0('0x0'));var util=require(_0xd2e0('0x1'));var moment=require('moment');var BPromise=require(_0xd2e0('0x2'));var rs=require(_0xd2e0('0x3'));var fs=require('fs');var Redis=require(_0xd2e0('0x4'));var db=require(_0xd2e0('0x5'))['db'];var utils=require(_0xd2e0('0x6'));var logger=require(_0xd2e0('0x7'))('rpc');var config=require(_0xd2e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd2e0('0x9')][_0xd2e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xda0e82,_0x54cbf7,_0x1d9338){return new BPromise(function(_0x1b05c0,_0x4be4df){return client[_0xd2e0('0xb')](_0xda0e82,_0x1d9338)[_0xd2e0('0xc')](function(_0x5e4ea0){logger[_0xd2e0('0xd')](_0xd2e0('0xe'),_0x54cbf7,_0xd2e0('0xf'));logger['debug'](_0xd2e0('0x10'),_0x54cbf7,_0xd2e0('0xf'),JSON[_0xd2e0('0x11')](_0x5e4ea0));if(_0x5e4ea0[_0xd2e0('0x12')]){if(_0x5e4ea0[_0xd2e0('0x12')][_0xd2e0('0x13')]===0x1f4){logger['error'](_0xd2e0('0xe'),_0x54cbf7,_0x5e4ea0[_0xd2e0('0x12')][_0xd2e0('0x14')]);return _0x4be4df(_0x5e4ea0['error'][_0xd2e0('0x14')]);}logger[_0xd2e0('0x12')](_0xd2e0('0xe'),_0x54cbf7,_0x5e4ea0[_0xd2e0('0x12')][_0xd2e0('0x14')]);return _0x1b05c0(_0x5e4ea0[_0xd2e0('0x12')][_0xd2e0('0x14')]);}else{logger['info'](_0xd2e0('0xe'),_0x54cbf7,_0xd2e0('0xf'));_0x1b05c0(_0x5e4ea0[_0xd2e0('0x15')][_0xd2e0('0x14')]);}})[_0xd2e0('0x16')](function(_0x48fef3){logger['error'](_0xd2e0('0xe'),_0x54cbf7,_0x48fef3);_0x4be4df(_0x48fef3);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 31785df..551006f 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 _0x4a28=['exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy'];(function(_0x107ec7,_0x69cabe){var _0x5c9467=function(_0x1cc4a6){while(--_0x1cc4a6){_0x107ec7['push'](_0x107ec7['shift']());}};_0x5c9467(++_0x69cabe);}(_0x4a28,0x111));var _0x84a2=function(_0xf77114,_0x36b1de){_0xf77114=_0xf77114-0x0;var _0x2b29c6=_0x4a28[_0xf77114];return _0x2b29c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x84a2('0x0'));var timeout=require(_0x84a2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x84a2('0x2'));var auth=require(_0x84a2('0x3'));var interaction=require(_0x84a2('0x4'));var config=require(_0x84a2('0x5'));var controller=require(_0x84a2('0x6'));router[_0x84a2('0x7')]('/',auth[_0x84a2('0x8')](),controller[_0x84a2('0x9')]);router['get'](_0x84a2('0xa'),auth[_0x84a2('0x8')](),controller['show']);router['post']('/',auth[_0x84a2('0x8')](),controller[_0x84a2('0xb')]);router['put'](_0x84a2('0xa'),auth[_0x84a2('0x8')](),controller[_0x84a2('0xc')]);router[_0x84a2('0xd')](_0x84a2('0xa'),auth[_0x84a2('0x8')](),controller[_0x84a2('0xe')]);module[_0x84a2('0xf')]=router; \ No newline at end of file +var _0x5030=['./intVtigerField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28427b,_0x21cd94){var _0x25b8a7=function(_0x3365ad){while(--_0x3365ad){_0x28427b['push'](_0x28427b['shift']());}};_0x25b8a7(++_0x21cd94);}(_0x5030,0xc0));var _0x0503=function(_0x55f975,_0x5eca3f){_0x55f975=_0x55f975-0x0;var _0x44942d=_0x5030[_0x55f975];return _0x44942d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0503('0x0'));var timeout=require(_0x0503('0x1'));var express=require(_0x0503('0x2'));var router=express[_0x0503('0x3')]();var fs_extra=require(_0x0503('0x4'));var auth=require(_0x0503('0x5'));var interaction=require(_0x0503('0x6'));var config=require(_0x0503('0x7'));var controller=require(_0x0503('0x8'));router[_0x0503('0x9')]('/',auth[_0x0503('0xa')](),controller[_0x0503('0xb')]);router['get']('/:id',auth[_0x0503('0xa')](),controller[_0x0503('0xc')]);router[_0x0503('0xd')]('/',auth['isAuthenticated'](),controller[_0x0503('0xe')]);router['put'](_0x0503('0xf'),auth[_0x0503('0xa')](),controller[_0x0503('0x10')]);router[_0x0503('0x11')](_0x0503('0xf'),auth['isAuthenticated'](),controller[_0x0503('0x12')]);module[_0x0503('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 921abec..e0fc194 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 _0x009d=['STRING','variable','customVariable','BOOLEAN','sequelize','exports','string','keyValue'];(function(_0x580cea,_0x41fab5){var _0x5311c8=function(_0x3c654f){while(--_0x3c654f){_0x580cea['push'](_0x580cea['shift']());}};_0x5311c8(++_0x41fab5);}(_0x009d,0x194));var _0xd009=function(_0x212517,_0x22ad5f){_0x212517=_0x212517-0x0;var _0x30ecd6=_0x009d[_0x212517];return _0x30ecd6;};'use strict';var Sequelize=require(_0xd009('0x0'));module[_0xd009('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd009('0x2'),'variable','customVariable',_0xd009('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xd009('0x4')]},'key':{'type':Sequelize[_0xd009('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xd009('0x2'),_0xd009('0x5'),_0xd009('0x6'))},'keyContent':{'type':Sequelize[_0xd009('0x4')]},'idField':{'type':Sequelize[_0xd009('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd009('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd009('0x4')]}}; \ No newline at end of file +var _0xaa8b=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa8b,0xaf));var _0xbaa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa8b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbaa8('0x0'));module[_0xbaa8('0x1')]={'type':{'type':Sequelize[_0xbaa8('0x2')]('string',_0xbaa8('0x3'),_0xbaa8('0x4'),_0xbaa8('0x5'),_0xbaa8('0x6')),'defaultValue':_0xbaa8('0x7')},'content':{'type':Sequelize[_0xbaa8('0x8')]},'key':{'type':Sequelize[_0xbaa8('0x8')]},'keyType':{'type':Sequelize[_0xbaa8('0x2')](_0xbaa8('0x7'),_0xbaa8('0x3'),_0xbaa8('0x4'))},'keyContent':{'type':Sequelize[_0xbaa8('0x8')]},'idField':{'type':Sequelize[_0xbaa8('0x8')]},'nameField':{'type':Sequelize[_0xbaa8('0x8')]},'customField':{'type':Sequelize[_0xbaa8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbaa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 2576c87..6549b69 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 _0xa7b0=['fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','end','error','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7b0,0x121));var _0x0a7b=function(_0x450eae,_0x2ad04d){_0x450eae=_0x450eae-0x0;var _0x2379d3=_0xa7b0[_0x450eae];return _0x2379d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a7b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a7b('0x1'));var rp=require(_0x0a7b('0x2'));var moment=require(_0x0a7b('0x3'));var BPromise=require(_0x0a7b('0x4'));var Mustache=require(_0x0a7b('0x5'));var util=require(_0x0a7b('0x6'));var path=require(_0x0a7b('0x7'));var sox=require(_0x0a7b('0x8'));var csv=require(_0x0a7b('0x9'));var ejs=require(_0x0a7b('0xa'));var fs=require('fs');var fs_extra=require(_0x0a7b('0xb'));var _=require(_0x0a7b('0xc'));var squel=require('squel');var crypto=require(_0x0a7b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a7b('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a7b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0a7b('0x10'));var hardwareService=require(_0x0a7b('0x11'));var logger=require(_0x0a7b('0x12'))(_0x0a7b('0x13'));var utils=require(_0x0a7b('0x14'));var config=require(_0x0a7b('0x15'));var licenseUtil=require(_0x0a7b('0x16'));var db=require(_0x0a7b('0x17'))['db'];function respondWithStatusCode(_0x17c3b7,_0x20207b){_0x20207b=_0x20207b||0xcc;return function(_0x407348){if(_0x407348){return _0x17c3b7[_0x0a7b('0x18')](_0x20207b);}return _0x17c3b7['status'](_0x20207b)['end']();};}function respondWithResult(_0x48ad4b,_0x29e5ff){_0x29e5ff=_0x29e5ff||0xc8;return function(_0x180203){if(_0x180203){return _0x48ad4b[_0x0a7b('0x19')](_0x29e5ff)[_0x0a7b('0x1a')](_0x180203);}};}function respondWithFilteredResult(_0x4af8d3,_0x217033){return function(_0x4a078a){if(_0x4a078a){var _0x204a4d=typeof _0x217033['offset']===_0x0a7b('0x1b')&&typeof _0x217033['limit']===_0x0a7b('0x1b');var _0x4f978f=_0x4a078a[_0x0a7b('0x1c')];var _0x6d7d5b=_0x204a4d?0x0:_0x217033[_0x0a7b('0x1d')];var _0x2a81bb=_0x204a4d?_0x4a078a[_0x0a7b('0x1c')]:_0x217033[_0x0a7b('0x1d')]+_0x217033[_0x0a7b('0x1e')];var _0x4e486c;if(_0x2a81bb>=_0x4f978f){_0x2a81bb=_0x4f978f;_0x4e486c=0xc8;}else{_0x4e486c=0xce;}_0x4af8d3[_0x0a7b('0x19')](_0x4e486c);return _0x4af8d3[_0x0a7b('0x1f')](_0x0a7b('0x20'),_0x6d7d5b+'-'+_0x2a81bb+'/'+_0x4f978f)[_0x0a7b('0x1a')](_0x4a078a);}return null;};}function patchUpdates(_0x27f831){return function(_0x3c36b5){try{jsonpatch['apply'](_0x3c36b5,_0x27f831,!![]);}catch(_0x5e20e1){return BPromise[_0x0a7b('0x21')](_0x5e20e1);}return _0x3c36b5[_0x0a7b('0x22')]();};}function saveUpdates(_0x18371b,_0x1c9504){return function(_0x3c133a){if(_0x3c133a){return _0x3c133a[_0x0a7b('0x23')](_0x18371b)['then'](function(_0x4817b7){return _0x4817b7;});}return null;};}function removeEntity(_0x4b7338,_0x1d58a6){return function(_0x1e2e2c){if(_0x1e2e2c){return _0x1e2e2c['destroy']()[_0x0a7b('0x24')](function(){_0x4b7338[_0x0a7b('0x19')](0xcc)[_0x0a7b('0x25')]();});}};}function handleEntityNotFound(_0xa60a1d,_0x2ad57b){return function(_0x30274c){if(!_0x30274c){_0xa60a1d[_0x0a7b('0x18')](0x194);}return _0x30274c;};}function handleError(_0x5ca536,_0x4e7534){_0x4e7534=_0x4e7534||0x1f4;return function(_0x5bf034){logger[_0x0a7b('0x26')](_0x5bf034['stack']);if(_0x5bf034['name']){delete _0x5bf034['name'];}_0x5ca536['status'](_0x4e7534)[_0x0a7b('0x27')](_0x5bf034);};}exports[_0x0a7b('0x28')]=function(_0x54c7fc,_0x3dfbb1){var _0x35268e={},_0x570c2b={},_0x21478d={'count':0x0,'rows':[]};var _0x49f154=_[_0x0a7b('0x29')](db[_0x0a7b('0x2a')][_0x0a7b('0x2b')],function(_0x435507){return{'name':_0x435507[_0x0a7b('0x2c')],'type':_0x435507[_0x0a7b('0x2d')][_0x0a7b('0x2e')]};});_0x570c2b[_0x0a7b('0x2f')]=_[_0x0a7b('0x29')](_0x49f154,_0x0a7b('0x30'));_0x570c2b['query']=_[_0x0a7b('0x31')](_0x54c7fc[_0x0a7b('0x32')]);_0x570c2b[_0x0a7b('0x33')]=_[_0x0a7b('0x34')](_0x570c2b[_0x0a7b('0x2f')],_0x570c2b[_0x0a7b('0x32')]);_0x35268e[_0x0a7b('0x35')]=_[_0x0a7b('0x34')](_0x570c2b[_0x0a7b('0x2f')],qs[_0x0a7b('0x36')](_0x54c7fc['query'][_0x0a7b('0x36')]));_0x35268e[_0x0a7b('0x35')]=_0x35268e[_0x0a7b('0x35')][_0x0a7b('0x37')]?_0x35268e[_0x0a7b('0x35')]:_0x570c2b[_0x0a7b('0x2f')];if(!_0x54c7fc['query'][_0x0a7b('0x38')](_0x0a7b('0x39'))){_0x35268e[_0x0a7b('0x1e')]=qs[_0x0a7b('0x1e')](_0x54c7fc[_0x0a7b('0x32')]['limit']);_0x35268e['offset']=qs[_0x0a7b('0x1d')](_0x54c7fc['query'][_0x0a7b('0x1d')]);}_0x35268e[_0x0a7b('0x3a')]=qs[_0x0a7b('0x3b')](_0x54c7fc[_0x0a7b('0x32')]['sort']);_0x35268e[_0x0a7b('0x3c')]=qs['filters'](_[_0x0a7b('0x3d')](_0x54c7fc['query'],_0x570c2b['filters']),_0x49f154);if(_0x54c7fc[_0x0a7b('0x32')][_0x0a7b('0x3e')]){_0x35268e[_0x0a7b('0x3c')]=_[_0x0a7b('0x3f')](_0x35268e[_0x0a7b('0x3c')],{'$or':_[_0x0a7b('0x29')](_0x49f154,function(_0x4f9f10){if(_0x4f9f10[_0x0a7b('0x2d')]!==_0x0a7b('0x40')){var _0x5758ba={};_0x5758ba[_0x4f9f10['name']]={'$like':'%'+_0x54c7fc[_0x0a7b('0x32')][_0x0a7b('0x3e')]+'%'};return _0x5758ba;}})});}_0x35268e=_['merge']({},_0x35268e,_0x54c7fc[_0x0a7b('0x41')]);var _0x1ce1df={'where':_0x35268e[_0x0a7b('0x3c')]};return db[_0x0a7b('0x2a')]['count'](_0x1ce1df)[_0x0a7b('0x24')](function(_0x288ff0){_0x21478d[_0x0a7b('0x1c')]=_0x288ff0;if(_0x54c7fc[_0x0a7b('0x32')][_0x0a7b('0x42')]){_0x35268e[_0x0a7b('0x43')]=[{'all':!![]}];}return db[_0x0a7b('0x2a')][_0x0a7b('0x44')](_0x35268e);})[_0x0a7b('0x24')](function(_0x480a00){_0x21478d[_0x0a7b('0x45')]=_0x480a00;return _0x21478d;})[_0x0a7b('0x24')](respondWithFilteredResult(_0x3dfbb1,_0x35268e))[_0x0a7b('0x46')](handleError(_0x3dfbb1,null));};exports[_0x0a7b('0x47')]=function(_0x24f716,_0x1c9cac){var _0x8266dd={'raw':!![],'where':{'id':_0x24f716[_0x0a7b('0x48')]['id']}},_0xe831f5={};_0xe831f5[_0x0a7b('0x2f')]=_['keys'](db['VtigerField'][_0x0a7b('0x2b')]);_0xe831f5[_0x0a7b('0x32')]=_[_0x0a7b('0x31')](_0x24f716['query']);_0xe831f5[_0x0a7b('0x33')]=_['intersection'](_0xe831f5[_0x0a7b('0x2f')],_0xe831f5[_0x0a7b('0x32')]);_0x8266dd[_0x0a7b('0x35')]=_[_0x0a7b('0x34')](_0xe831f5['model'],qs[_0x0a7b('0x36')](_0x24f716[_0x0a7b('0x32')][_0x0a7b('0x36')]));_0x8266dd[_0x0a7b('0x35')]=_0x8266dd[_0x0a7b('0x35')][_0x0a7b('0x37')]?_0x8266dd[_0x0a7b('0x35')]:_0xe831f5[_0x0a7b('0x2f')];if(_0x24f716[_0x0a7b('0x32')][_0x0a7b('0x42')]){_0x8266dd['include']=[{'all':!![]}];}_0x8266dd=_[_0x0a7b('0x3f')]({},_0x8266dd,_0x24f716['options']);return db[_0x0a7b('0x2a')][_0x0a7b('0x49')](_0x8266dd)[_0x0a7b('0x24')](handleEntityNotFound(_0x1c9cac,null))[_0x0a7b('0x24')](respondWithResult(_0x1c9cac,null))[_0x0a7b('0x46')](handleError(_0x1c9cac,null));};exports['create']=function(_0x278efd,_0x44a135){return db[_0x0a7b('0x2a')]['create'](_0x278efd['body'],{})[_0x0a7b('0x24')](respondWithResult(_0x44a135,0xc9))['catch'](handleError(_0x44a135,null));};exports[_0x0a7b('0x23')]=function(_0x5792a1,_0x15b644){if(_0x5792a1[_0x0a7b('0x4a')]['id']){delete _0x5792a1[_0x0a7b('0x4a')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x5792a1[_0x0a7b('0x48')]['id']}})[_0x0a7b('0x24')](handleEntityNotFound(_0x15b644,null))[_0x0a7b('0x24')](saveUpdates(_0x5792a1[_0x0a7b('0x4a')],null))[_0x0a7b('0x24')](respondWithResult(_0x15b644,null))[_0x0a7b('0x46')](handleError(_0x15b644,null));};exports['destroy']=function(_0x4c6131,_0xbbbd8e){return db[_0x0a7b('0x2a')][_0x0a7b('0x49')]({'where':{'id':_0x4c6131['params']['id']}})[_0x0a7b('0x24')](handleEntityNotFound(_0xbbbd8e,null))[_0x0a7b('0x24')](removeEntity(_0xbbbd8e,null))[_0x0a7b('0x46')](handleError(_0xbbbd8e,null));}; \ No newline at end of file +var _0xbaa7=['api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','VtigerField','includeAll','rows','catch','show','include','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5b7f24,_0x52a1a8){var _0x4c1ec9=function(_0x3b7e09){while(--_0x3b7e09){_0x5b7f24['push'](_0x5b7f24['shift']());}};_0x4c1ec9(++_0x52a1a8);}(_0xbaa7,0x158));var _0x7baa=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbaa7[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7baa('0x0'));var rimraf=require(_0x7baa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7baa('0x2'));var rp=require(_0x7baa('0x3'));var moment=require(_0x7baa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7baa('0x5'));var util=require('util');var path=require(_0x7baa('0x6'));var sox=require(_0x7baa('0x7'));var csv=require(_0x7baa('0x8'));var ejs=require(_0x7baa('0x9'));var fs=require('fs');var fs_extra=require(_0x7baa('0xa'));var _=require(_0x7baa('0xb'));var squel=require(_0x7baa('0xc'));var crypto=require(_0x7baa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7baa('0x8'));var querystring=require(_0x7baa('0xe'));var Papa=require(_0x7baa('0xf'));var Redis=require(_0x7baa('0x10'));var authService=require(_0x7baa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7baa('0x12'));var hardwareService=require(_0x7baa('0x13'));var logger=require(_0x7baa('0x14'))(_0x7baa('0x15'));var utils=require('../../config/utils');var config=require(_0x7baa('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7baa('0x17'))['db'];function respondWithStatusCode(_0x176c74,_0x1d40e1){_0x1d40e1=_0x1d40e1||0xcc;return function(_0x53ed1f){if(_0x53ed1f){return _0x176c74['sendStatus'](_0x1d40e1);}return _0x176c74[_0x7baa('0x18')](_0x1d40e1)[_0x7baa('0x19')]();};}function respondWithResult(_0xabd80f,_0x2977a0){_0x2977a0=_0x2977a0||0xc8;return function(_0x25bfee){if(_0x25bfee){return _0xabd80f[_0x7baa('0x18')](_0x2977a0)['json'](_0x25bfee);}};}function respondWithFilteredResult(_0x18df2f,_0xc60a0e){return function(_0x4f2849){if(_0x4f2849){var _0x5c51e4=typeof _0xc60a0e[_0x7baa('0x1a')]===_0x7baa('0x1b')&&typeof _0xc60a0e[_0x7baa('0x1c')]==='undefined';var _0x5b5f67=_0x4f2849[_0x7baa('0x1d')];var _0x339e1b=_0x5c51e4?0x0:_0xc60a0e['offset'];var _0x792aee=_0x5c51e4?_0x4f2849['count']:_0xc60a0e[_0x7baa('0x1a')]+_0xc60a0e['limit'];var _0x15b3b1;if(_0x792aee>=_0x5b5f67){_0x792aee=_0x5b5f67;_0x15b3b1=0xc8;}else{_0x15b3b1=0xce;}_0x18df2f[_0x7baa('0x18')](_0x15b3b1);return _0x18df2f[_0x7baa('0x1e')](_0x7baa('0x1f'),_0x339e1b+'-'+_0x792aee+'/'+_0x5b5f67)[_0x7baa('0x20')](_0x4f2849);}return null;};}function patchUpdates(_0x2224f1){return function(_0x182002){try{jsonpatch[_0x7baa('0x21')](_0x182002,_0x2224f1,!![]);}catch(_0x425caa){return BPromise['reject'](_0x425caa);}return _0x182002['save']();};}function saveUpdates(_0x39d2d9,_0xab12ae){return function(_0x502cce){if(_0x502cce){return _0x502cce[_0x7baa('0x22')](_0x39d2d9)[_0x7baa('0x23')](function(_0x2d1a28){return _0x2d1a28;});}return null;};}function removeEntity(_0x16f352,_0x47837d){return function(_0x5b04d4){if(_0x5b04d4){return _0x5b04d4[_0x7baa('0x24')]()['then'](function(){_0x16f352[_0x7baa('0x18')](0xcc)[_0x7baa('0x19')]();});}};}function handleEntityNotFound(_0x27eeb9,_0x1130ef){return function(_0x1d1fed){if(!_0x1d1fed){_0x27eeb9[_0x7baa('0x25')](0x194);}return _0x1d1fed;};}function handleError(_0x134d83,_0x16abfe){_0x16abfe=_0x16abfe||0x1f4;return function(_0x7260fe){logger[_0x7baa('0x26')](_0x7260fe[_0x7baa('0x27')]);if(_0x7260fe[_0x7baa('0x28')]){delete _0x7260fe[_0x7baa('0x28')];}_0x134d83[_0x7baa('0x18')](_0x16abfe)[_0x7baa('0x29')](_0x7260fe);};}exports['index']=function(_0x2718f5,_0x1cfbb4){var _0x36686b={},_0x44fd54={},_0x512891={'count':0x0,'rows':[]};var _0x4b14da=_[_0x7baa('0x2a')](db['VtigerField'][_0x7baa('0x2b')],function(_0x118f5a){return{'name':_0x118f5a[_0x7baa('0x2c')],'type':_0x118f5a['type'][_0x7baa('0x2d')]};});_0x44fd54[_0x7baa('0x2e')]=_[_0x7baa('0x2a')](_0x4b14da,_0x7baa('0x28'));_0x44fd54['query']=_[_0x7baa('0x2f')](_0x2718f5[_0x7baa('0x30')]);_0x44fd54[_0x7baa('0x31')]=_[_0x7baa('0x32')](_0x44fd54[_0x7baa('0x2e')],_0x44fd54[_0x7baa('0x30')]);_0x36686b[_0x7baa('0x33')]=_[_0x7baa('0x32')](_0x44fd54[_0x7baa('0x2e')],qs['fields'](_0x2718f5[_0x7baa('0x30')][_0x7baa('0x34')]));_0x36686b[_0x7baa('0x33')]=_0x36686b[_0x7baa('0x33')][_0x7baa('0x35')]?_0x36686b[_0x7baa('0x33')]:_0x44fd54[_0x7baa('0x2e')];if(!_0x2718f5[_0x7baa('0x30')][_0x7baa('0x36')]('nolimit')){_0x36686b['limit']=qs[_0x7baa('0x1c')](_0x2718f5[_0x7baa('0x30')][_0x7baa('0x1c')]);_0x36686b[_0x7baa('0x1a')]=qs[_0x7baa('0x1a')](_0x2718f5['query'][_0x7baa('0x1a')]);}_0x36686b[_0x7baa('0x37')]=qs[_0x7baa('0x38')](_0x2718f5[_0x7baa('0x30')][_0x7baa('0x38')]);_0x36686b[_0x7baa('0x39')]=qs[_0x7baa('0x31')](_[_0x7baa('0x3a')](_0x2718f5['query'],_0x44fd54[_0x7baa('0x31')]),_0x4b14da);if(_0x2718f5[_0x7baa('0x30')][_0x7baa('0x3b')]){_0x36686b['where']=_[_0x7baa('0x3c')](_0x36686b[_0x7baa('0x39')],{'$or':_['map'](_0x4b14da,function(_0x251fa6){if(_0x251fa6[_0x7baa('0x3d')]!=='VIRTUAL'){var _0x2ed18b={};_0x2ed18b[_0x251fa6[_0x7baa('0x28')]]={'$like':'%'+_0x2718f5['query'][_0x7baa('0x3b')]+'%'};return _0x2ed18b;}})});}_0x36686b=_['merge']({},_0x36686b,_0x2718f5[_0x7baa('0x3e')]);var _0x309a09={'where':_0x36686b[_0x7baa('0x39')]};return db[_0x7baa('0x3f')][_0x7baa('0x1d')](_0x309a09)[_0x7baa('0x23')](function(_0x1a3945){_0x512891['count']=_0x1a3945;if(_0x2718f5['query'][_0x7baa('0x40')]){_0x36686b['include']=[{'all':!![]}];}return db[_0x7baa('0x3f')]['findAll'](_0x36686b);})[_0x7baa('0x23')](function(_0x474419){_0x512891[_0x7baa('0x41')]=_0x474419;return _0x512891;})[_0x7baa('0x23')](respondWithFilteredResult(_0x1cfbb4,_0x36686b))[_0x7baa('0x42')](handleError(_0x1cfbb4,null));};exports[_0x7baa('0x43')]=function(_0x2f9cc7,_0x2690dc){var _0x1c8362={'raw':!![],'where':{'id':_0x2f9cc7['params']['id']}},_0x38a2ac={};_0x38a2ac[_0x7baa('0x2e')]=_[_0x7baa('0x2f')](db['VtigerField'][_0x7baa('0x2b')]);_0x38a2ac[_0x7baa('0x30')]=_['keys'](_0x2f9cc7[_0x7baa('0x30')]);_0x38a2ac[_0x7baa('0x31')]=_[_0x7baa('0x32')](_0x38a2ac[_0x7baa('0x2e')],_0x38a2ac[_0x7baa('0x30')]);_0x1c8362[_0x7baa('0x33')]=_[_0x7baa('0x32')](_0x38a2ac[_0x7baa('0x2e')],qs[_0x7baa('0x34')](_0x2f9cc7[_0x7baa('0x30')][_0x7baa('0x34')]));_0x1c8362['attributes']=_0x1c8362[_0x7baa('0x33')][_0x7baa('0x35')]?_0x1c8362[_0x7baa('0x33')]:_0x38a2ac[_0x7baa('0x2e')];if(_0x2f9cc7[_0x7baa('0x30')][_0x7baa('0x40')]){_0x1c8362[_0x7baa('0x44')]=[{'all':!![]}];}_0x1c8362=_[_0x7baa('0x3c')]({},_0x1c8362,_0x2f9cc7[_0x7baa('0x3e')]);return db['VtigerField']['find'](_0x1c8362)[_0x7baa('0x23')](handleEntityNotFound(_0x2690dc,null))[_0x7baa('0x23')](respondWithResult(_0x2690dc,null))['catch'](handleError(_0x2690dc,null));};exports['create']=function(_0x1595e6,_0x2db21e){return db[_0x7baa('0x3f')][_0x7baa('0x45')](_0x1595e6[_0x7baa('0x46')],{})[_0x7baa('0x23')](respondWithResult(_0x2db21e,0xc9))[_0x7baa('0x42')](handleError(_0x2db21e,null));};exports[_0x7baa('0x22')]=function(_0x2c870d,_0x1b1b3f){if(_0x2c870d[_0x7baa('0x46')]['id']){delete _0x2c870d[_0x7baa('0x46')]['id'];}return db[_0x7baa('0x3f')][_0x7baa('0x47')]({'where':{'id':_0x2c870d[_0x7baa('0x48')]['id']}})[_0x7baa('0x23')](handleEntityNotFound(_0x1b1b3f,null))[_0x7baa('0x23')](saveUpdates(_0x2c870d[_0x7baa('0x46')],null))[_0x7baa('0x23')](respondWithResult(_0x1b1b3f,null))[_0x7baa('0x42')](handleError(_0x1b1b3f,null));};exports[_0x7baa('0x24')]=function(_0x2c742c,_0x496403){return db[_0x7baa('0x3f')]['find']({'where':{'id':_0x2c742c[_0x7baa('0x48')]['id']}})[_0x7baa('0x23')](handleEntityNotFound(_0x496403,null))[_0x7baa('0x23')](removeEntity(_0x496403,null))[_0x7baa('0x42')](handleError(_0x496403,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 366973e..5e536d0 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 _0x8c99=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId'];(function(_0x361a4d,_0x106561){var _0x4a7c9d=function(_0x596788){while(--_0x596788){_0x361a4d['push'](_0x361a4d['shift']());}};_0x4a7c9d(++_0x106561);}(_0x8c99,0xd0));var _0x98c9=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x8c99[_0x43941d];return _0x27b82a;};'use strict';var _=require('lodash');var util=require(_0x98c9('0x0'));var logger=require(_0x98c9('0x1'))(_0x98c9('0x2'));var moment=require(_0x98c9('0x3'));var BPromise=require(_0x98c9('0x4'));var rp=require(_0x98c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98c9('0x6'));var config=require('../../config/environment');var attributes=require(_0x98c9('0x7'));module['exports']=function(_0x37f724,_0xd31db4){return _0x37f724[_0x98c9('0x8')](_0x98c9('0x9'),attributes,{'tableName':_0x98c9('0xa'),'paranoid':![],'indexes':[{'name':_0x98c9('0xb'),'fields':['idField',_0x98c9('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fdf=['exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x13a28c,_0x1ea305){var _0xb7028f=function(_0x41dd8d){while(--_0x41dd8d){_0x13a28c['push'](_0x13a28c['shift']());}};_0xb7028f(++_0x1ea305);}(_0x8fdf,0x116));var _0xf8fd=function(_0x57c866,_0x25589f){_0x57c866=_0x57c866-0x0;var _0x5671a5=_0x8fdf[_0x57c866];return _0x5671a5;};'use strict';var _=require(_0xf8fd('0x0'));var util=require('util');var logger=require(_0xf8fd('0x1'))(_0xf8fd('0x2'));var moment=require(_0xf8fd('0x3'));var BPromise=require(_0xf8fd('0x4'));var rp=require(_0xf8fd('0x5'));var fs=require('fs');var path=require(_0xf8fd('0x6'));var rimraf=require(_0xf8fd('0x7'));var config=require(_0xf8fd('0x8'));var attributes=require(_0xf8fd('0x9'));module[_0xf8fd('0xa')]=function(_0x107be0,_0x372a1b){return _0x107be0['define'](_0xf8fd('0xb'),attributes,{'tableName':_0xf8fd('0xc'),'paranoid':![],'indexes':[{'name':_0xf8fd('0xd'),'fields':[_0xf8fd('0xe'),_0xf8fd('0xf')],'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 f1fc32c..8e4f354 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 _0x7eac=['VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5f36d0,_0x4c9714){var _0x2d71a8=function(_0x57f428){while(--_0x57f428){_0x5f36d0['push'](_0x5f36d0['shift']());}};_0x2d71a8(++_0x4c9714);}(_0x7eac,0x1ac));var _0xc7ea=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7eac[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xc7ea('0x0'));var util=require('util');var moment=require(_0xc7ea('0x1'));var BPromise=require(_0xc7ea('0x2'));var rs=require(_0xc7ea('0x3'));var fs=require('fs');var Redis=require(_0xc7ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7ea('0x5'));var config=require(_0xc7ea('0x6'));var jayson=require(_0xc7ea('0x7'));var client=jayson['client'][_0xc7ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2278ea,_0x5755ce,_0x169726){return new BPromise(function(_0x140c4c,_0x5022d5){return client[_0xc7ea('0x9')](_0x2278ea,_0x169726)[_0xc7ea('0xa')](function(_0x11c047){logger[_0xc7ea('0xb')](_0xc7ea('0xc'),_0x5755ce,_0xc7ea('0xd'));logger['debug'](_0xc7ea('0xe'),_0x5755ce,_0xc7ea('0xd'),JSON[_0xc7ea('0xf')](_0x11c047));if(_0x11c047['error']){if(_0x11c047['error']['code']===0x1f4){logger[_0xc7ea('0x10')](_0xc7ea('0xc'),_0x5755ce,_0x11c047[_0xc7ea('0x10')][_0xc7ea('0x11')]);return _0x5022d5(_0x11c047[_0xc7ea('0x10')]['message']);}logger[_0xc7ea('0x10')]('VtigerField,\x20%s,\x20%s',_0x5755ce,_0x11c047[_0xc7ea('0x10')][_0xc7ea('0x11')]);return _0x140c4c(_0x11c047[_0xc7ea('0x10')][_0xc7ea('0x11')]);}else{logger[_0xc7ea('0xb')](_0xc7ea('0xc'),_0x5755ce,'request\x20sent');_0x140c4c(_0x11c047[_0xc7ea('0x12')][_0xc7ea('0x11')]);}})[_0xc7ea('0x13')](function(_0x2c08a4){logger[_0xc7ea('0x10')](_0xc7ea('0xc'),_0x5755ce,_0x2c08a4);_0x5022d5(_0x2c08a4);});});} \ No newline at end of file +var _0x94b1=['rpc','../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2df289,_0x39be70){var _0x310bef=function(_0x319ec5){while(--_0x319ec5){_0x2df289['push'](_0x2df289['shift']());}};_0x310bef(++_0x39be70);}(_0x94b1,0x102));var _0x194b=function(_0x470b96,_0x478bf4){_0x470b96=_0x470b96-0x0;var _0x17ebc4=_0x94b1[_0x470b96];return _0x17ebc4;};'use strict';var _=require('lodash');var util=require(_0x194b('0x0'));var moment=require('moment');var BPromise=require(_0x194b('0x1'));var rs=require(_0x194b('0x2'));var fs=require('fs');var Redis=require(_0x194b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x194b('0x4'));var logger=require(_0x194b('0x5'))(_0x194b('0x6'));var config=require(_0x194b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x194b('0x8')][_0x194b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5213ad,_0x3ec8c2,_0x4e82ac){return new BPromise(function(_0x24b450,_0x4759c0){return client[_0x194b('0xa')](_0x5213ad,_0x4e82ac)[_0x194b('0xb')](function(_0x2f5bb3){logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,'request\x20sent');logger[_0x194b('0xe')](_0x194b('0xf'),_0x3ec8c2,_0x194b('0x10'),JSON['stringify'](_0x2f5bb3));if(_0x2f5bb3[_0x194b('0x11')]){if(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x12')]===0x1f4){logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x4759c0(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x24b450(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}else{logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,_0x194b('0x10'));_0x24b450(_0x2f5bb3[_0x194b('0x14')][_0x194b('0x13')]);}})[_0x194b('0x15')](function(_0x4a115a){logger['error'](_0x194b('0xd'),_0x3ec8c2,_0x4a115a);_0x4759c0(_0x4a115a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 7ca4e4d..85d64dd 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 _0x297a=['create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x130079,_0x41274e){var _0x3b21fc=function(_0x247cc9){while(--_0x247cc9){_0x130079['push'](_0x130079['shift']());}};_0x3b21fc(++_0x41274e);}(_0x297a,0x19d));var _0xa297=function(_0x241950,_0x3bd68f){_0x241950=_0x241950-0x0;var _0x16db76=_0x297a[_0x241950];return _0x16db76;};'use strict';var multer=require(_0xa297('0x0'));var util=require(_0xa297('0x1'));var path=require(_0xa297('0x2'));var timeout=require(_0xa297('0x3'));var express=require(_0xa297('0x4'));var router=express['Router']();var fs_extra=require(_0xa297('0x5'));var auth=require(_0xa297('0x6'));var interaction=require(_0xa297('0x7'));var config=require(_0xa297('0x8'));var controller=require(_0xa297('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa297('0xa')]);router[_0xa297('0xb')]('/:id',auth[_0xa297('0xc')](),controller[_0xa297('0xd')]);router[_0xa297('0xb')](_0xa297('0xe'),auth[_0xa297('0xc')](),controller[_0xa297('0xf')]);router[_0xa297('0xb')](_0xa297('0x10'),auth['isAuthenticated'](),controller[_0xa297('0x11')]);router[_0xa297('0x12')]('/',auth[_0xa297('0xc')](),controller[_0xa297('0x13')]);router[_0xa297('0x12')](_0xa297('0xe'),auth[_0xa297('0xc')](),controller[_0xa297('0x14')]);router[_0xa297('0x15')](_0xa297('0x16'),auth[_0xa297('0xc')](),controller[_0xa297('0x17')]);router[_0xa297('0x18')](_0xa297('0x16'),auth[_0xa297('0xc')](),controller[_0xa297('0x19')]);module[_0xa297('0x1a')]=router; \ No newline at end of file +var _0x84ef=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','addConfiguration','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x84ef,0x1d5));var _0xf84e=function(_0x8068b6,_0x36db38){_0x8068b6=_0x8068b6-0x0;var _0x46c9cc=_0x84ef[_0x8068b6];return _0x46c9cc;};'use strict';var multer=require('multer');var util=require(_0xf84e('0x0'));var path=require(_0xf84e('0x1'));var timeout=require(_0xf84e('0x2'));var express=require(_0xf84e('0x3'));var router=express[_0xf84e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf84e('0x5'));var interaction=require(_0xf84e('0x6'));var config=require(_0xf84e('0x7'));var controller=require(_0xf84e('0x8'));router[_0xf84e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf84e('0x9')](_0xf84e('0xa'),auth[_0xf84e('0xb')](),controller['show']);router[_0xf84e('0x9')](_0xf84e('0xc'),auth['isAuthenticated'](),controller[_0xf84e('0xd')]);router[_0xf84e('0x9')]('/:id/fields',auth[_0xf84e('0xb')](),controller[_0xf84e('0xe')]);router[_0xf84e('0xf')]('/',auth[_0xf84e('0xb')](),controller['create']);router['post'](_0xf84e('0xc'),auth['isAuthenticated'](),controller[_0xf84e('0x10')]);router['put']('/:id',auth[_0xf84e('0xb')](),controller[_0xf84e('0x11')]);router[_0xf84e('0x12')](_0xf84e('0xa'),auth['isAuthenticated'](),controller['destroy']);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 4d5f36d..213f661 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 _0x2581=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri'];(function(_0x1a7e4b,_0x2fbd40){var _0x37a8fd=function(_0x4eaa73){while(--_0x4eaa73){_0x1a7e4b['push'](_0x1a7e4b['shift']());}};_0x37a8fd(++_0x2fbd40);}(_0x2581,0xcb));var _0x1258=function(_0x203a88,_0x32521b){_0x203a88=_0x203a88-0x0;var _0x46e6ce=_0x2581[_0x203a88];return _0x46e6ce;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')]},'description':{'type':Sequelize[_0x1258('0x2')]},'username':{'type':Sequelize[_0x1258('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1258('0x2')]},'token':{'type':Sequelize[_0x1258('0x2')]},'remoteUri':{'type':Sequelize[_0x1258('0x2')],'unique':_0x1258('0x3')},'authType':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x5'),_0x1258('0x6')),'defaultValue':_0x1258('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x7'),_0x1258('0x8')),'defaultValue':_0x1258('0x7')}}; \ No newline at end of file +var _0xf69c=['token','ENUM','newTab','integrationTab','sequelize','STRING','username','remoteUri','password'];(function(_0x4b4966,_0x79b34b){var _0x52192a=function(_0x5392cd){while(--_0x5392cd){_0x4b4966['push'](_0x4b4966['shift']());}};_0x52192a(++_0x79b34b);}(_0xf69c,0x151));var _0xcf69=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0xf69c[_0xca18be];return _0x2815ad;};'use strict';var Sequelize=require(_0xcf69('0x0'));module['exports']={'name':{'type':Sequelize[_0xcf69('0x1')]},'description':{'type':Sequelize[_0xcf69('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xcf69('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xcf69('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcf69('0x3')},'authType':{'type':Sequelize['ENUM'](_0xcf69('0x4'),_0xcf69('0x5')),'defaultValue':_0xcf69('0x4')},'serverUrl':{'type':Sequelize[_0xcf69('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcf69('0x6')]('integrationTab',_0xcf69('0x7')),'defaultValue':_0xcf69('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a2557ff..080506d 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f68=['find','create','body','catch','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','username','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x2370bd,_0x47608c){var _0x590de2=function(_0x4b2735){while(--_0x4b2735){_0x2370bd['push'](_0x2370bd['shift']());}};_0x590de2(++_0x47608c);}(_0x2f68,0x9a));var _0x82f6=function(_0x348738,_0x5dfc52){_0x348738=_0x348738-0x0;var _0x571268=_0x2f68[_0x348738];return _0x571268;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];var integrations=require(_0x82f6('0x15'));function respondWithStatusCode(_0x4cc967,_0x194da7){_0x194da7=_0x194da7||0xcc;return function(_0x1f8bf5){if(_0x1f8bf5){return _0x4cc967[_0x82f6('0x16')](_0x194da7);}return _0x4cc967[_0x82f6('0x17')](_0x194da7)[_0x82f6('0x18')]();};}function respondWithResult(_0xa00275,_0x115c7b){_0x115c7b=_0x115c7b||0xc8;return function(_0x171815){if(_0x171815){return _0xa00275[_0x82f6('0x17')](_0x115c7b)['json'](_0x171815);}};}function respondWithFilteredResult(_0x389949,_0x5d0827){return function(_0x249222){if(_0x249222){var _0x1d0263=typeof _0x5d0827[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x5d0827[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x326378=_0x249222[_0x82f6('0x1c')];var _0x4072f0=_0x1d0263?0x0:_0x5d0827[_0x82f6('0x19')];var _0x1c79f9=_0x1d0263?_0x249222[_0x82f6('0x1c')]:_0x5d0827[_0x82f6('0x19')]+_0x5d0827[_0x82f6('0x1b')];var _0x3a8269;if(_0x1c79f9>=_0x326378){_0x1c79f9=_0x326378;_0x3a8269=0xc8;}else{_0x3a8269=0xce;}_0x389949['status'](_0x3a8269);return _0x389949[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x4072f0+'-'+_0x1c79f9+'/'+_0x326378)['json'](_0x249222);}return null;};}function patchUpdates(_0x2b03ad){return function(_0x4b9f0){try{jsonpatch[_0x82f6('0x1f')](_0x4b9f0,_0x2b03ad,!![]);}catch(_0x25cae6){return BPromise['reject'](_0x25cae6);}return _0x4b9f0[_0x82f6('0x20')]();};}function saveUpdates(_0x4beccf,_0x8668bb){return function(_0x2a0ce6){if(_0x2a0ce6){return _0x2a0ce6['update'](_0x4beccf)['then'](function(_0x3af5f7){return _0x3af5f7;});}return null;};}function removeEntity(_0x1d96d5,_0x4c57c5){return function(_0x5a5059){if(_0x5a5059){return _0x5a5059[_0x82f6('0x21')]()[_0x82f6('0x22')](function(){_0x1d96d5['status'](0xcc)[_0x82f6('0x18')]();});}};}function handleEntityNotFound(_0x304e83,_0x5037f8){return function(_0x57ac0d){if(!_0x57ac0d){_0x304e83[_0x82f6('0x16')](0x194);}return _0x57ac0d;};}function handleError(_0x5187d0,_0x469b6b){_0x469b6b=_0x469b6b||0x1f4;return function(_0x5a6d69){logger['error'](_0x5a6d69[_0x82f6('0x23')]);if(_0x5a6d69[_0x82f6('0x24')]){delete _0x5a6d69[_0x82f6('0x24')];}_0x5187d0[_0x82f6('0x17')](_0x469b6b)['send'](_0x5a6d69);};}exports[_0x82f6('0x25')]=function(_0x1fb461,_0x14a309){var _0x400137={},_0x271c28={},_0x328707={'count':0x0,'rows':[]};var _0x27e473=_[_0x82f6('0x26')](db[_0x82f6('0x27')][_0x82f6('0x28')],function(_0x3c9419){return{'name':_0x3c9419[_0x82f6('0x29')],'type':_0x3c9419[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x271c28['model']=_[_0x82f6('0x26')](_0x27e473,_0x82f6('0x24'));_0x271c28[_0x82f6('0x2c')]=_['keys'](_0x1fb461[_0x82f6('0x2c')]);_0x271c28[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],_0x271c28[_0x82f6('0x2c')]);_0x400137[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x400137[_0x82f6('0x30')]=_0x400137[_0x82f6('0x30')][_0x82f6('0x32')]?_0x400137['attributes']:_0x271c28[_0x82f6('0x2f')];if(!_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x400137[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x1b')]);_0x400137[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x19')]);}_0x400137[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x1fb461['query'][_0x82f6('0x36')]);_0x400137['where']=qs['filters'](_[_0x82f6('0x37')](_0x1fb461[_0x82f6('0x2c')],_0x271c28['filters']),_0x27e473);if(_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x38')]){_0x400137[_0x82f6('0x39')]=_['merge'](_0x400137[_0x82f6('0x39')],{'$or':_['map'](_0x27e473,function(_0x2be8cf){if(_0x2be8cf['type']!==_0x82f6('0x3a')){var _0x47ef9e={};_0x47ef9e[_0x2be8cf[_0x82f6('0x24')]]={'$like':'%'+_0x1fb461[_0x82f6('0x2c')]['filter']+'%'};return _0x47ef9e;}})});}_0x400137=_[_0x82f6('0x3b')]({},_0x400137,_0x1fb461[_0x82f6('0x3c')]);var _0x3e7c53={'where':_0x400137[_0x82f6('0x39')]};return db['ZendeskAccount'][_0x82f6('0x1c')](_0x3e7c53)[_0x82f6('0x22')](function(_0x23ea04){_0x328707[_0x82f6('0x1c')]=_0x23ea04;if(_0x1fb461['query'][_0x82f6('0x3d')]){_0x400137[_0x82f6('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x82f6('0x3f')](_0x400137);})[_0x82f6('0x22')](function(_0x2d7509){_0x328707[_0x82f6('0x40')]=_0x2d7509;return _0x328707;})[_0x82f6('0x22')](respondWithFilteredResult(_0x14a309,_0x400137))['catch'](handleError(_0x14a309,null));};exports[_0x82f6('0x41')]=function(_0x5786ce,_0x139614){var _0x38e82d={'raw':![],'where':{'id':_0x5786ce[_0x82f6('0x42')]['id']}},_0x32d6b5={};_0x32d6b5[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db[_0x82f6('0x27')]['rawAttributes']);_0x32d6b5[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x5786ce[_0x82f6('0x2c')]);_0x32d6b5[_0x82f6('0x2d')]=_['intersection'](_0x32d6b5[_0x82f6('0x2f')],_0x32d6b5['query']);_0x38e82d[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x32d6b5[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x38e82d['attributes']=_0x38e82d[_0x82f6('0x30')][_0x82f6('0x32')]?_0x38e82d[_0x82f6('0x30')]:_0x32d6b5[_0x82f6('0x2f')];if(_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x3d')]){_0x38e82d[_0x82f6('0x3e')]=[{'all':!![]}];}_0x38e82d=_[_0x82f6('0x3b')]({},_0x38e82d,_0x5786ce['options']);return db[_0x82f6('0x27')][_0x82f6('0x44')](_0x38e82d)['then'](handleEntityNotFound(_0x139614,null))[_0x82f6('0x22')](respondWithResult(_0x139614,null))['catch'](handleError(_0x139614,null));};exports[_0x82f6('0x45')]=function(_0x5e3321,_0x227ab8){return db[_0x82f6('0x27')][_0x82f6('0x45')](_0x5e3321[_0x82f6('0x46')],{})[_0x82f6('0x22')](respondWithResult(_0x227ab8,0xc9))[_0x82f6('0x47')](handleError(_0x227ab8,null));};exports['update']=function(_0x3cb1f0,_0xdc77ca){if(_0x3cb1f0['body']['id']){delete _0x3cb1f0['body']['id'];}return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x3cb1f0[_0x82f6('0x42')]['id']}})['then'](handleEntityNotFound(_0xdc77ca,null))[_0x82f6('0x22')](saveUpdates(_0x3cb1f0[_0x82f6('0x46')],null))[_0x82f6('0x22')](respondWithResult(_0xdc77ca,null))[_0x82f6('0x47')](handleError(_0xdc77ca,null));};exports['destroy']=function(_0x495400,_0x1695ea){return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x495400['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x1695ea,null))[_0x82f6('0x22')](removeEntity(_0x1695ea,null))['catch'](handleError(_0x1695ea,null));};exports['getConfigurations']=function(_0x4fa2ca,_0x2e6b03,_0x4a63a6){var _0x259d83={};var _0x57c023={};var _0x33c359;var _0x4f69de;return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x4fa2ca[_0x82f6('0x42')]['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x2e6b03,null))[_0x82f6('0x22')](function(_0x1633cf){if(_0x1633cf){_0x33c359=_0x1633cf;_0x57c023[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db['ZendeskConfiguration'][_0x82f6('0x28')]);_0x57c023[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x4fa2ca['query']);_0x57c023['filters']=_[_0x82f6('0x2e')](_0x57c023[_0x82f6('0x2f')],_0x57c023[_0x82f6('0x2c')]);_0x259d83[_0x82f6('0x30')]=_['intersection'](_0x57c023[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x4fa2ca[_0x82f6('0x2c')]['fields']));_0x259d83['attributes']=_0x259d83['attributes'][_0x82f6('0x32')]?_0x259d83[_0x82f6('0x30')]:_0x57c023[_0x82f6('0x2f')];_0x259d83[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x36')]);_0x259d83[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x37')](_0x4fa2ca[_0x82f6('0x2c')],_0x57c023[_0x82f6('0x2d')]));if(_0x4fa2ca[_0x82f6('0x2c')]['filter']){_0x259d83['where']=_[_0x82f6('0x3b')](_0x259d83[_0x82f6('0x39')],{'$or':_['map'](_0x259d83[_0x82f6('0x30')],function(_0xa12f6e){var _0x404d09={};_0x404d09[_0xa12f6e]={'$like':'%'+_0x4fa2ca['query'][_0x82f6('0x38')]+'%'};return _0x404d09;})});}_0x259d83=_[_0x82f6('0x3b')]({},_0x259d83,_0x4fa2ca[_0x82f6('0x3c')]);return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x41da7f){if(_0x41da7f){_0x4f69de=_0x41da7f['length'];if(!_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x259d83[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x4fa2ca['query'][_0x82f6('0x1b')]);_0x259d83[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x19')]);}return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x17389a){if(_0x17389a){return _0x17389a?{'count':_0x4f69de,'rows':_0x17389a}:null;}})['then'](respondWithResult(_0x2e6b03,null))[_0x82f6('0x47')](handleError(_0x2e6b03,null));};exports['addConfiguration']=function(_0x3f0337,_0x85ea2e,_0x4e51a6){if(_0x3f0337[_0x82f6('0x46')]['id']){delete _0x3f0337[_0x82f6('0x46')]['id'];}return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x3f0337['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x85ea2e,null))[_0x82f6('0x22')](function(_0x58b96b){if(_0x58b96b){_0x3f0337['body'][_0x82f6('0x49')]=_0x58b96b['id'];_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4a')]=integrations[_0x82f6('0x4b')](_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4c')],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4d')]=integrations[_0x82f6('0x4e')](_0x3f0337[_0x82f6('0x46')]['channel'],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);return db[_0x82f6('0x4f')][_0x82f6('0x45')](_0x3f0337[_0x82f6('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x82f6('0x4a')},{'model':db[_0x82f6('0x50')],'as':_0x82f6('0x4d')}]});}return null;})['then'](respondWithResult(_0x85ea2e,null))[_0x82f6('0x47')](handleError(_0x85ea2e,null));};exports[_0x82f6('0x51')]=function(_0x17924d,_0x27a79c,_0xeec407){var _0x39a4b3='';return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x17924d[_0x82f6('0x42')]['id']},'attributes':['id','username',_0x82f6('0x52'),_0x82f6('0x53'),_0x82f6('0x54'),_0x82f6('0x55')]})[_0x82f6('0x22')](handleEntityNotFound(_0x27a79c,null))[_0x82f6('0x22')](function(_0x2d8721){if(_0x2d8721){_0x39a4b3=_0x2d8721[_0x82f6('0x55')];var _0x30b903=_0x39a4b3['slice'](-0x1);if(_0x30b903==='/'){_0x39a4b3=_0x39a4b3[_0x82f6('0x56')](0x0,_0x39a4b3[_0x82f6('0x57')](_0x30b903));}var _0x33cc55={'method':_0x82f6('0x58'),'uri':util[_0x82f6('0x59')](_0x82f6('0x5a'),_0x39a4b3,'ticket_fields'),'json':!![]};switch(_0x2d8721[_0x82f6('0x54')]){case _0x82f6('0x52'):_0x33cc55['headers']={'Authorization':util['format'](_0x82f6('0x5b'),new Buffer(util[_0x82f6('0x59')](_0x82f6('0x5c'),_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x52')]))[_0x82f6('0x5e')]('base64'))};break;case _0x82f6('0x53'):_0x33cc55['headers']={'Authorization':util[_0x82f6('0x59')]('Basic\x20%s',new Buffer(util[_0x82f6('0x59')]('%s/token:%s',_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x53')]))[_0x82f6('0x5e')]('base64'))};break;default:throw new db[(_0x82f6('0x5f'))]['ValidationError'](_0x82f6('0x60'));}return rp(_0x33cc55);}})[_0x82f6('0x22')](function(_0x3e69f6){if(_0x3e69f6){var _0x4d1bfd=[_0x82f6('0x61'),_0x82f6('0x62'),_0x82f6('0x63'),'assignee'];_['remove'](_0x3e69f6[_0x82f6('0x64')],function(_0x30327a){return _0x4d1bfd[_0x82f6('0x65')](_0x30327a[_0x82f6('0x2a')]);});return{'count':_0x3e69f6[_0x82f6('0x64')][_0x82f6('0x32')],'rows':_[_0x82f6('0x26')](_0x3e69f6[_0x82f6('0x64')],function(_0x4df767){return{'id':_0x4df767['id'],'name':_0x4df767[_0x82f6('0x66')]>0x7?_0x4df767[_0x82f6('0x67')]:_0x4df767['type'],'custom':_0x4df767[_0x82f6('0x66')]>0x7?!![]:![],'options':_0x4df767[_0x82f6('0x68')]?_0x4df767[_0x82f6('0x68')]:_0x4df767['custom_field_options']?_0x4df767[_0x82f6('0x69')]:[]};})};}})[_0x82f6('0x22')](respondWithResult(_0x27a79c,null))[_0x82f6('0x47')](function(_0x2cc906){var _0x50ab5c=_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?0x1f4:_0x2cc906[_0x82f6('0x6b')]||0x1f4;logger[_0x82f6('0x6c')](_0x82f6('0x6d'),_0x82f6('0x51'),_0x50ab5c,JSON['stringify'](_0x2cc906));delete _0x2cc906[_0x82f6('0x24')];if(_0x50ab5c===0x191){_0x50ab5c=0x190;}_0x27a79c[_0x82f6('0x17')](_0x50ab5c)[_0x82f6('0x6e')](_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x2cc906[_0x82f6('0x6b')]}:_0x2cc906);});}; \ No newline at end of file +var _0xea28=['stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','length','find','catch','create','body','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','authType','%s:%s','token','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x14614a,_0x505b10){var _0x4297e8=function(_0xe81f41){while(--_0xe81f41){_0x14614a['push'](_0x14614a['shift']());}};_0x4297e8(++_0x505b10);}(_0xea28,0x13a));var _0x8ea2=function(_0x4f4fd1,_0x27d50b){_0x4f4fd1=_0x4f4fd1-0x0;var _0x125c61=_0xea28[_0x4f4fd1];return _0x125c61;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];var integrations=require(_0x8ea2('0x1b'));function respondWithStatusCode(_0x10aead,_0xe47c0e){_0xe47c0e=_0xe47c0e||0xcc;return function(_0x5e662e){if(_0x5e662e){return _0x10aead[_0x8ea2('0x1c')](_0xe47c0e);}return _0x10aead['status'](_0xe47c0e)['end']();};}function respondWithResult(_0x772bad,_0x4726a7){_0x4726a7=_0x4726a7||0xc8;return function(_0x416bae){if(_0x416bae){return _0x772bad[_0x8ea2('0x1d')](_0x4726a7)[_0x8ea2('0x1e')](_0x416bae);}};}function respondWithFilteredResult(_0xbb9bd1,_0x3cff96){return function(_0x11f5e8){if(_0x11f5e8){var _0x474873=typeof _0x3cff96[_0x8ea2('0x1f')]===_0x8ea2('0x20')&&typeof _0x3cff96[_0x8ea2('0x21')]===_0x8ea2('0x20');var _0xaa8abf=_0x11f5e8[_0x8ea2('0x22')];var _0x174ef2=_0x474873?0x0:_0x3cff96[_0x8ea2('0x1f')];var _0x2a0329=_0x474873?_0x11f5e8[_0x8ea2('0x22')]:_0x3cff96[_0x8ea2('0x1f')]+_0x3cff96[_0x8ea2('0x21')];var _0x287597;if(_0x2a0329>=_0xaa8abf){_0x2a0329=_0xaa8abf;_0x287597=0xc8;}else{_0x287597=0xce;}_0xbb9bd1['status'](_0x287597);return _0xbb9bd1['set'](_0x8ea2('0x23'),_0x174ef2+'-'+_0x2a0329+'/'+_0xaa8abf)[_0x8ea2('0x1e')](_0x11f5e8);}return null;};}function patchUpdates(_0x29151a){return function(_0x5ebc04){try{jsonpatch[_0x8ea2('0x24')](_0x5ebc04,_0x29151a,!![]);}catch(_0x218bd0){return BPromise['reject'](_0x218bd0);}return _0x5ebc04[_0x8ea2('0x25')]();};}function saveUpdates(_0x283f00,_0x37229a){return function(_0x9f9548){if(_0x9f9548){return _0x9f9548[_0x8ea2('0x26')](_0x283f00)[_0x8ea2('0x27')](function(_0x199417){return _0x199417;});}return null;};}function removeEntity(_0x1e4cc9,_0x18ec34){return function(_0x4d5030){if(_0x4d5030){return _0x4d5030[_0x8ea2('0x28')]()['then'](function(){_0x1e4cc9[_0x8ea2('0x1d')](0xcc)[_0x8ea2('0x29')]();});}};}function handleEntityNotFound(_0x29b38f,_0x4e2106){return function(_0x53ed43){if(!_0x53ed43){_0x29b38f[_0x8ea2('0x1c')](0x194);}return _0x53ed43;};}function handleError(_0x4dc7bf,_0x200a49){_0x200a49=_0x200a49||0x1f4;return function(_0x4e786d){logger[_0x8ea2('0x2a')](_0x4e786d[_0x8ea2('0x2b')]);if(_0x4e786d[_0x8ea2('0x2c')]){delete _0x4e786d[_0x8ea2('0x2c')];}_0x4dc7bf['status'](_0x200a49)['send'](_0x4e786d);};}exports[_0x8ea2('0x2d')]=function(_0x4da5b3,_0x4a9875){var _0x287078={},_0x24f187={},_0x41f482={'count':0x0,'rows':[]};var _0x307c74=_[_0x8ea2('0x2e')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')],function(_0x19e868){return{'name':_0x19e868[_0x8ea2('0x31')],'type':_0x19e868['type']['key']};});_0x24f187[_0x8ea2('0x32')]=_[_0x8ea2('0x2e')](_0x307c74,'name');_0x24f187['query']=_[_0x8ea2('0x33')](_0x4da5b3['query']);_0x24f187[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x24f187['model'],_0x24f187[_0x8ea2('0x36')]);_0x287078[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x24f187['model'],qs['fields'](_0x4da5b3['query'][_0x8ea2('0x38')]));_0x287078[_0x8ea2('0x37')]=_0x287078[_0x8ea2('0x37')]['length']?_0x287078[_0x8ea2('0x37')]:_0x24f187[_0x8ea2('0x32')];if(!_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x287078[_0x8ea2('0x21')]=qs[_0x8ea2('0x21')](_0x4da5b3[_0x8ea2('0x36')]['limit']);_0x287078[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}_0x287078['order']=qs[_0x8ea2('0x3b')](_0x4da5b3['query'][_0x8ea2('0x3b')]);_0x287078[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x4da5b3['query'],_0x24f187[_0x8ea2('0x34')]),_0x307c74);if(_0x4da5b3['query']['filter']){_0x287078[_0x8ea2('0x3c')]=_['merge'](_0x287078[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x307c74,function(_0x1c229d){if(_0x1c229d[_0x8ea2('0x3e')]!==_0x8ea2('0x3f')){var _0x4ae536={};_0x4ae536[_0x1c229d[_0x8ea2('0x2c')]]={'$like':'%'+_0x4da5b3['query'][_0x8ea2('0x40')]+'%'};return _0x4ae536;}})});}_0x287078=_[_0x8ea2('0x41')]({},_0x287078,_0x4da5b3[_0x8ea2('0x42')]);var _0x3995ff={'where':_0x287078['where']};return db[_0x8ea2('0x2f')]['count'](_0x3995ff)[_0x8ea2('0x27')](function(_0x5ba351){_0x41f482[_0x8ea2('0x22')]=_0x5ba351;if(_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x287078[_0x8ea2('0x44')]=[{'all':!![]}];}return db[_0x8ea2('0x2f')][_0x8ea2('0x45')](_0x287078);})[_0x8ea2('0x27')](function(_0x478d5c){_0x41f482['rows']=_0x478d5c;return _0x41f482;})[_0x8ea2('0x27')](respondWithFilteredResult(_0x4a9875,_0x287078))['catch'](handleError(_0x4a9875,null));};exports['show']=function(_0x59e2fa,_0x3cbc09){var _0x5d9ba0={'raw':![],'where':{'id':_0x59e2fa[_0x8ea2('0x46')]['id']}},_0x40a532={};_0x40a532[_0x8ea2('0x32')]=_[_0x8ea2('0x33')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')]);_0x40a532[_0x8ea2('0x36')]=_[_0x8ea2('0x33')](_0x59e2fa['query']);_0x40a532[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],_0x40a532['query']);_0x5d9ba0[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],qs[_0x8ea2('0x38')](_0x59e2fa[_0x8ea2('0x36')]['fields']));_0x5d9ba0[_0x8ea2('0x37')]=_0x5d9ba0[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x5d9ba0['attributes']:_0x40a532[_0x8ea2('0x32')];if(_0x59e2fa[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x5d9ba0[_0x8ea2('0x44')]=[{'all':!![]}];}_0x5d9ba0=_[_0x8ea2('0x41')]({},_0x5d9ba0,_0x59e2fa[_0x8ea2('0x42')]);return db[_0x8ea2('0x2f')][_0x8ea2('0x48')](_0x5d9ba0)[_0x8ea2('0x27')](handleEntityNotFound(_0x3cbc09,null))[_0x8ea2('0x27')](respondWithResult(_0x3cbc09,null))[_0x8ea2('0x49')](handleError(_0x3cbc09,null));};exports[_0x8ea2('0x4a')]=function(_0x220970,_0x12e81f){return db['ZendeskAccount'][_0x8ea2('0x4a')](_0x220970[_0x8ea2('0x4b')],{})[_0x8ea2('0x27')](respondWithResult(_0x12e81f,0xc9))[_0x8ea2('0x49')](handleError(_0x12e81f,null));};exports[_0x8ea2('0x26')]=function(_0x1daa25,_0x11b3ef){if(_0x1daa25[_0x8ea2('0x4b')]['id']){delete _0x1daa25['body']['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x1daa25[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x11b3ef,null))['then'](saveUpdates(_0x1daa25[_0x8ea2('0x4b')],null))[_0x8ea2('0x27')](respondWithResult(_0x11b3ef,null))[_0x8ea2('0x49')](handleError(_0x11b3ef,null));};exports['destroy']=function(_0x3d86f3,_0x315b5d){return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x3d86f3[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x315b5d,null))['then'](removeEntity(_0x315b5d,null))[_0x8ea2('0x49')](handleError(_0x315b5d,null));};exports[_0x8ea2('0x4c')]=function(_0x1b8c4b,_0x5e4268,_0x18cbe9){var _0x100e29={};var _0x442dce={};var _0x54c9d7;var _0x5c6524;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1b8c4b['params']['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x5e4268,null))[_0x8ea2('0x27')](function(_0x5f56f8){if(_0x5f56f8){_0x54c9d7=_0x5f56f8;_0x442dce['model']=_[_0x8ea2('0x33')](db[_0x8ea2('0x4d')][_0x8ea2('0x30')]);_0x442dce['query']=_[_0x8ea2('0x33')](_0x1b8c4b[_0x8ea2('0x36')]);_0x442dce['filters']=_[_0x8ea2('0x35')](_0x442dce[_0x8ea2('0x32')],_0x442dce[_0x8ea2('0x36')]);_0x100e29[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x442dce['model'],qs['fields'](_0x1b8c4b['query'][_0x8ea2('0x38')]));_0x100e29[_0x8ea2('0x37')]=_0x100e29[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x100e29[_0x8ea2('0x37')]:_0x442dce[_0x8ea2('0x32')];_0x100e29[_0x8ea2('0x4e')]=qs['sort'](_0x1b8c4b['query']['sort']);_0x100e29[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x1b8c4b[_0x8ea2('0x36')],_0x442dce['filters']));if(_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x40')]){_0x100e29['where']=_[_0x8ea2('0x41')](_0x100e29[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x100e29[_0x8ea2('0x37')],function(_0x3de1a2){var _0x48c1de={};_0x48c1de[_0x3de1a2]={'$like':'%'+_0x1b8c4b['query']['filter']+'%'};return _0x48c1de;})});}_0x100e29=_[_0x8ea2('0x41')]({},_0x100e29,_0x1b8c4b[_0x8ea2('0x42')]);return _0x54c9d7[_0x8ea2('0x4c')](_0x100e29);}})[_0x8ea2('0x27')](function(_0x3c44ef){if(_0x3c44ef){_0x5c6524=_0x3c44ef['length'];if(!_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x100e29[_0x8ea2('0x21')]=qs['limit'](_0x1b8c4b[_0x8ea2('0x36')]['limit']);_0x100e29[_0x8ea2('0x1f')]=qs['offset'](_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}return _0x54c9d7['getConfigurations'](_0x100e29);}})['then'](function(_0x1d0326){if(_0x1d0326){return _0x1d0326?{'count':_0x5c6524,'rows':_0x1d0326}:null;}})['then'](respondWithResult(_0x5e4268,null))[_0x8ea2('0x49')](handleError(_0x5e4268,null));};exports[_0x8ea2('0x4f')]=function(_0x1c5489,_0x23185e,_0x4dab8f){if(_0x1c5489[_0x8ea2('0x4b')]['id']){delete _0x1c5489[_0x8ea2('0x4b')]['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x1c5489[_0x8ea2('0x46')]['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x23185e,null))[_0x8ea2('0x27')](function(_0x3a78c9){if(_0x3a78c9){_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x51')]=_0x3a78c9['id'];_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x52')]=integrations['getSubjects'](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x54')]=integrations[_0x8ea2('0x55')](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);return db[_0x8ea2('0x4d')]['create'](_0x1c5489[_0x8ea2('0x4b')],{'include':[{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x52')},{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x54')}]});}return null;})['then'](respondWithResult(_0x23185e,null))['catch'](handleError(_0x23185e,null));};exports['getFields']=function(_0x17f2f2,_0xe8b3ed,_0x380066){var _0x31bda0='';return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x17f2f2['params']['id']},'attributes':['id',_0x8ea2('0x57'),_0x8ea2('0x58'),'token','authType',_0x8ea2('0x59')]})[_0x8ea2('0x27')](handleEntityNotFound(_0xe8b3ed,null))[_0x8ea2('0x27')](function(_0x289e74){if(_0x289e74){_0x31bda0=_0x289e74[_0x8ea2('0x59')];var _0x32a8f2=_0x31bda0[_0x8ea2('0x5a')](-0x1);if(_0x32a8f2==='/'){_0x31bda0=_0x31bda0['substring'](0x0,_0x31bda0[_0x8ea2('0x5b')](_0x32a8f2));}var _0x3fa2c8={'method':_0x8ea2('0x5c'),'uri':util[_0x8ea2('0x5d')]('%s/%s',_0x31bda0,_0x8ea2('0x5e')),'json':!![]};switch(_0x289e74[_0x8ea2('0x5f')]){case _0x8ea2('0x58'):_0x3fa2c8['headers']={'Authorization':util[_0x8ea2('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0x8ea2('0x60'),_0x289e74[_0x8ea2('0x57')],_0x289e74['password']))['toString']('base64'))};break;case _0x8ea2('0x61'):_0x3fa2c8['headers']={'Authorization':util['format'](_0x8ea2('0x62'),new Buffer(util[_0x8ea2('0x5d')](_0x8ea2('0x63'),_0x289e74[_0x8ea2('0x57')],_0x289e74[_0x8ea2('0x61')]))[_0x8ea2('0x64')](_0x8ea2('0x65')))};break;default:throw new db[(_0x8ea2('0x66'))][(_0x8ea2('0x67'))](_0x8ea2('0x68'));}return rp(_0x3fa2c8);}})[_0x8ea2('0x27')](function(_0x15eab7){if(_0x15eab7){var _0x1961a9=[_0x8ea2('0x69'),'description',_0x8ea2('0x6a'),_0x8ea2('0x6b')];_[_0x8ea2('0x6c')](_0x15eab7['ticket_fields'],function(_0x1807bb){return _0x1961a9['includes'](_0x1807bb[_0x8ea2('0x3e')]);});return{'count':_0x15eab7['ticket_fields'][_0x8ea2('0x47')],'rows':_['map'](_0x15eab7[_0x8ea2('0x5e')],function(_0x165052){return{'id':_0x165052['id'],'name':_0x165052['position']>0x7?_0x165052[_0x8ea2('0x6d')]:_0x165052['type'],'custom':_0x165052[_0x8ea2('0x6e')]>0x7?!![]:![],'options':_0x165052[_0x8ea2('0x6f')]?_0x165052[_0x8ea2('0x6f')]:_0x165052[_0x8ea2('0x70')]?_0x165052[_0x8ea2('0x70')]:[]};})};}})['then'](respondWithResult(_0xe8b3ed,null))['catch'](function(_0x39d0d7){var _0x4b7e5e=_0x17f2f2[_0x8ea2('0x36')][_0x8ea2('0x71')]?0x1f4:_0x39d0d7[_0x8ea2('0x72')]||0x1f4;logger[_0x8ea2('0x2a')](_0x8ea2('0x73'),_0x8ea2('0x74'),_0x4b7e5e,JSON['stringify'](_0x39d0d7));delete _0x39d0d7['name'];if(_0x4b7e5e===0x191){_0x4b7e5e=0x190;}_0xe8b3ed['status'](_0x4b7e5e)[_0x8ea2('0x75')](_0x17f2f2['query'][_0x8ea2('0x71')]?{'message':_0x8ea2('0x76'),'statusCode':_0x39d0d7[_0x8ea2('0x72')]}:_0x39d0d7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4eb6997..ec7e858 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 _0x6c7f=['../../config/logger','moment','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x469ac0,_0x2a13c7){var _0x806df5=function(_0x26dcd5){while(--_0x26dcd5){_0x469ac0['push'](_0x469ac0['shift']());}};_0x806df5(++_0x2a13c7);}(_0x6c7f,0x11c));var _0xf6c7=function(_0x1d73f5,_0x4c89f5){_0x1d73f5=_0x1d73f5-0x0;var _0x51f3b3=_0x6c7f[_0x1d73f5];return _0x51f3b3;};'use strict';var _=require(_0xf6c7('0x0'));var util=require(_0xf6c7('0x1'));var logger=require(_0xf6c7('0x2'))('api');var moment=require(_0xf6c7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6c7('0x4'));var rimraf=require(_0xf6c7('0x5'));var config=require(_0xf6c7('0x6'));var attributes=require(_0xf6c7('0x7'));var integrations=require(_0xf6c7('0x8'));module[_0xf6c7('0x9')]=function(_0x2d6954,_0x3c1353){return _0x2d6954[_0xf6c7('0xa')](_0xf6c7('0xb'),attributes,{'tableName':_0xf6c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bfd=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','bluebird','path','./intZendeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x45ee52,_0x28c470){var _0xd4fdd2=function(_0x4f99d){while(--_0x4f99d){_0x45ee52['push'](_0x45ee52['shift']());}};_0xd4fdd2(++_0x28c470);}(_0x7bfd,0x138));var _0xd7bf=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7bfd[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd7bf('0x0'));var util=require(_0xd7bf('0x1'));var logger=require(_0xd7bf('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd7bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7bf('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7bf('0x5'));var integrations=require(_0xd7bf('0x6'));module['exports']=function(_0x145bbc,_0x355a9d){return _0x145bbc[_0xd7bf('0x7')](_0xd7bf('0x8'),attributes,{'tableName':_0xd7bf('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 d41df88..f99a67f 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 _0x3b9a=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','ZendeskAccount','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','catch','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3b9a,0xdf));var _0xa3b9=function(_0x6e6278,_0x34fe51){_0x6e6278=_0x6e6278-0x0;var _0x327546=_0x3b9a[_0x6e6278];return _0x327546;};'use strict';var _=require('lodash');var util=require(_0xa3b9('0x0'));var moment=require('moment');var BPromise=require(_0xa3b9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3b9('0x2'));var db=require(_0xa3b9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa3b9('0x4'))(_0xa3b9('0x5'));var config=require(_0xa3b9('0x6'));var jayson=require(_0xa3b9('0x7'));var client=jayson[_0xa3b9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa69716,_0x471b46,_0x31581b){return new BPromise(function(_0x899500,_0x577229){return client['request'](_0xa69716,_0x31581b)[_0xa3b9('0x9')](function(_0xba1ab8){logger[_0xa3b9('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x471b46,_0xa3b9('0xb'));logger[_0xa3b9('0xc')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x471b46,_0xa3b9('0xb'),JSON[_0xa3b9('0xd')](_0xba1ab8));if(_0xba1ab8['error']){if(_0xba1ab8[_0xa3b9('0xe')][_0xa3b9('0xf')]===0x1f4){logger[_0xa3b9('0xe')](_0xa3b9('0x10'),_0x471b46,_0xba1ab8[_0xa3b9('0xe')][_0xa3b9('0x11')]);return _0x577229(_0xba1ab8[_0xa3b9('0xe')]['message']);}logger[_0xa3b9('0xe')](_0xa3b9('0x10'),_0x471b46,_0xba1ab8['error'][_0xa3b9('0x11')]);return _0x899500(_0xba1ab8['error'][_0xa3b9('0x11')]);}else{logger[_0xa3b9('0xa')](_0xa3b9('0x10'),_0x471b46,_0xa3b9('0xb'));_0x899500(_0xba1ab8[_0xa3b9('0x12')][_0xa3b9('0x11')]);}})['catch'](function(_0x277804){logger[_0xa3b9('0xe')](_0xa3b9('0x10'),_0x471b46,_0x277804);_0x577229(_0x277804);});});}exports['GetZendeskAccount']=function(_0x56aa10){var _0x4c2f1c=this;return new Promise(function(_0x5a468f,_0x11217d){return db[_0xa3b9('0x13')]['findAll']({'raw':_0x56aa10['options']?_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x15')]===undefined?!![]:![]:!![],'where':_0x56aa10['options']?_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x16')]||null:null,'attributes':_0x56aa10[_0xa3b9('0x14')]?_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x17')]||null:null,'limit':_0x56aa10['options']?_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x18')]||null:null,'include':_0x56aa10['options']?_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x19')]?_[_0xa3b9('0x1a')](_0x56aa10[_0xa3b9('0x14')][_0xa3b9('0x19')],function(_0x129e63){return{'model':db[_0x129e63[_0xa3b9('0x1b')]],'as':_0x129e63['as'],'attributes':_0x129e63[_0xa3b9('0x17')],'include':_0x129e63[_0xa3b9('0x19')]?_[_0xa3b9('0x1a')](_0x129e63[_0xa3b9('0x19')],function(_0x122be3){return{'model':db[_0x122be3['model']],'as':_0x122be3['as'],'attributes':_0x122be3[_0xa3b9('0x17')],'include':_0x122be3['include']?_[_0xa3b9('0x1a')](_0x122be3[_0xa3b9('0x19')],function(_0x269816){return{'model':db[_0x269816[_0xa3b9('0x1b')]],'as':_0x269816['as'],'attributes':_0x269816['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x577987){logger['info'](_0xa3b9('0x1c'),_0x56aa10);logger[_0xa3b9('0xc')](_0xa3b9('0x1c'),_0x56aa10,JSON[_0xa3b9('0xd')](_0x577987));_0x5a468f(_0x577987);})['catch'](function(_0x43cd16){logger[_0xa3b9('0xe')](_0xa3b9('0x1c'),_0x43cd16[_0xa3b9('0x11')],_0x56aa10);_0x11217d(_0x4c2f1c[_0xa3b9('0xe')](0x1f4,_0x43cd16[_0xa3b9('0x11')]));});});};exports[_0xa3b9('0x1d')]=function(_0x598540){var _0x36fe02=this;return new Promise(function(_0x474e3a,_0x45ddd7){return db[_0xa3b9('0x13')][_0xa3b9('0x1e')]({'raw':_0x598540[_0xa3b9('0x14')]?_0x598540[_0xa3b9('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x598540[_0xa3b9('0x14')]?_0x598540['options']['where']||null:null,'attributes':_0x598540['options']?_0x598540['options'][_0xa3b9('0x17')]||null:null,'include':_0x598540[_0xa3b9('0x14')]?_0x598540[_0xa3b9('0x14')]['include']?_[_0xa3b9('0x1a')](_0x598540[_0xa3b9('0x14')][_0xa3b9('0x19')],function(_0x103e47){return{'model':db[_0x103e47[_0xa3b9('0x1b')]],'as':_0x103e47['as'],'attributes':_0x103e47[_0xa3b9('0x17')],'include':_0x103e47[_0xa3b9('0x19')]?_['map'](_0x103e47[_0xa3b9('0x19')],function(_0x13ba6a){return{'model':db[_0x13ba6a['model']],'as':_0x13ba6a['as'],'attributes':_0x13ba6a[_0xa3b9('0x17')],'include':_0x13ba6a['include']?_[_0xa3b9('0x1a')](_0x13ba6a[_0xa3b9('0x19')],function(_0x2a2e8c){return{'model':db[_0x2a2e8c[_0xa3b9('0x1b')]],'as':_0x2a2e8c['as'],'attributes':_0x2a2e8c[_0xa3b9('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa3b9('0x9')](function(_0xfd87a1){logger[_0xa3b9('0xa')](_0xa3b9('0x1d'),_0x598540);logger['debug'](_0xa3b9('0x1d'),_0x598540,JSON['stringify'](_0xfd87a1));_0x474e3a(_0xfd87a1);})[_0xa3b9('0x1f')](function(_0x16f99a){logger[_0xa3b9('0xe')]('ShowZendeskAccount',_0x16f99a[_0xa3b9('0x11')],_0x598540);_0x45ddd7(_0x36fe02['error'](0x1f4,_0x16f99a['message']));});});}; \ No newline at end of file +var _0x484d=['http','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','ZendeskAccount,\x20%s,\x20%s','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','stringify','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x48836a,_0x212cf5){var _0x2a3c78=function(_0x314c9a){while(--_0x314c9a){_0x48836a['push'](_0x48836a['shift']());}};_0x2a3c78(++_0x212cf5);}(_0x484d,0xd2));var _0xd484=function(_0x490dd9,_0x522e6d){_0x490dd9=_0x490dd9-0x0;var _0x55f305=_0x484d[_0x490dd9];return _0x55f305;};'use strict';var _=require(_0xd484('0x0'));var util=require(_0xd484('0x1'));var moment=require(_0xd484('0x2'));var BPromise=require(_0xd484('0x3'));var rs=require(_0xd484('0x4'));var fs=require('fs');var Redis=require(_0xd484('0x5'));var db=require(_0xd484('0x6'))['db'];var utils=require(_0xd484('0x7'));var logger=require('../../config/logger')(_0xd484('0x8'));var config=require(_0xd484('0x9'));var jayson=require(_0xd484('0xa'));var client=jayson[_0xd484('0xb')][_0xd484('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51ca43,_0x43db18,_0x59576b){return new BPromise(function(_0x591e9a,_0x287ee7){return client['request'](_0x51ca43,_0x59576b)[_0xd484('0xd')](function(_0xd31479){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x43db18,_0xd484('0xe'));logger[_0xd484('0xf')](_0xd484('0x10'),_0x43db18,_0xd484('0xe'),JSON['stringify'](_0xd31479));if(_0xd31479['error']){if(_0xd31479[_0xd484('0x11')]['code']===0x1f4){logger[_0xd484('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x43db18,_0xd31479[_0xd484('0x11')][_0xd484('0x12')]);return _0x287ee7(_0xd31479[_0xd484('0x11')]['message']);}logger[_0xd484('0x11')](_0xd484('0x13'),_0x43db18,_0xd31479[_0xd484('0x11')]['message']);return _0x591e9a(_0xd31479[_0xd484('0x11')][_0xd484('0x12')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x43db18,_0xd484('0xe'));_0x591e9a(_0xd31479[_0xd484('0x14')][_0xd484('0x12')]);}})[_0xd484('0x15')](function(_0x2c0180){logger[_0xd484('0x11')](_0xd484('0x13'),_0x43db18,_0x2c0180);_0x287ee7(_0x2c0180);});});}exports[_0xd484('0x16')]=function(_0x1fbad0){var _0x3bfbfc=this;return new Promise(function(_0x20c859,_0x4c4459){return db[_0xd484('0x17')][_0xd484('0x18')]({'raw':_0x1fbad0[_0xd484('0x19')]?_0x1fbad0[_0xd484('0x19')][_0xd484('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fbad0[_0xd484('0x19')]?_0x1fbad0[_0xd484('0x19')][_0xd484('0x1b')]||null:null,'attributes':_0x1fbad0['options']?_0x1fbad0['options'][_0xd484('0x1c')]||null:null,'limit':_0x1fbad0[_0xd484('0x19')]?_0x1fbad0[_0xd484('0x19')][_0xd484('0x1d')]||null:null,'include':_0x1fbad0['options']?_0x1fbad0[_0xd484('0x19')][_0xd484('0x1e')]?_[_0xd484('0x1f')](_0x1fbad0[_0xd484('0x19')][_0xd484('0x1e')],function(_0x1cd8c1){return{'model':db[_0x1cd8c1[_0xd484('0x20')]],'as':_0x1cd8c1['as'],'attributes':_0x1cd8c1[_0xd484('0x1c')],'include':_0x1cd8c1[_0xd484('0x1e')]?_[_0xd484('0x1f')](_0x1cd8c1[_0xd484('0x1e')],function(_0x34d973){return{'model':db[_0x34d973['model']],'as':_0x34d973['as'],'attributes':_0x34d973[_0xd484('0x1c')],'include':_0x34d973[_0xd484('0x1e')]?_[_0xd484('0x1f')](_0x34d973[_0xd484('0x1e')],function(_0xb37657){return{'model':db[_0xb37657[_0xd484('0x20')]],'as':_0xb37657['as'],'attributes':_0xb37657[_0xd484('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd484('0xd')](function(_0x3c74d3){logger[_0xd484('0x21')]('GetZendeskAccount',_0x1fbad0);logger[_0xd484('0xf')](_0xd484('0x16'),_0x1fbad0,JSON[_0xd484('0x22')](_0x3c74d3));_0x20c859(_0x3c74d3);})['catch'](function(_0x36c5eb){logger[_0xd484('0x11')]('GetZendeskAccount',_0x36c5eb['message'],_0x1fbad0);_0x4c4459(_0x3bfbfc[_0xd484('0x11')](0x1f4,_0x36c5eb['message']));});});};exports[_0xd484('0x23')]=function(_0x4e8cc0){var _0x231efc=this;return new Promise(function(_0x21b46c,_0x318bd4){return db['ZendeskAccount'][_0xd484('0x24')]({'raw':_0x4e8cc0[_0xd484('0x19')]?_0x4e8cc0[_0xd484('0x19')][_0xd484('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e8cc0[_0xd484('0x19')]?_0x4e8cc0[_0xd484('0x19')][_0xd484('0x1b')]||null:null,'attributes':_0x4e8cc0[_0xd484('0x19')]?_0x4e8cc0[_0xd484('0x19')]['attributes']||null:null,'include':_0x4e8cc0[_0xd484('0x19')]?_0x4e8cc0['options']['include']?_['map'](_0x4e8cc0[_0xd484('0x19')][_0xd484('0x1e')],function(_0x46589d){return{'model':db[_0x46589d[_0xd484('0x20')]],'as':_0x46589d['as'],'attributes':_0x46589d[_0xd484('0x1c')],'include':_0x46589d[_0xd484('0x1e')]?_[_0xd484('0x1f')](_0x46589d[_0xd484('0x1e')],function(_0x121d67){return{'model':db[_0x121d67['model']],'as':_0x121d67['as'],'attributes':_0x121d67['attributes'],'include':_0x121d67[_0xd484('0x1e')]?_[_0xd484('0x1f')](_0x121d67[_0xd484('0x1e')],function(_0x5a71e0){return{'model':db[_0x5a71e0[_0xd484('0x20')]],'as':_0x5a71e0['as'],'attributes':_0x5a71e0[_0xd484('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd484('0xd')](function(_0x4e30c9){logger['info']('ShowZendeskAccount',_0x4e8cc0);logger['debug']('ShowZendeskAccount',_0x4e8cc0,JSON[_0xd484('0x22')](_0x4e30c9));_0x21b46c(_0x4e30c9);})['catch'](function(_0x166821){logger[_0xd484('0x11')](_0xd484('0x23'),_0x166821[_0xd484('0x12')],_0x4e8cc0);_0x318bd4(_0x231efc[_0xd484('0x11')](0x1f4,_0x166821[_0xd484('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index bc16215..ee3c0d0 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 _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x509b3d,_0x5c33d4){var _0x4bfd61=function(_0x422c07){while(--_0x422c07){_0x509b3d['push'](_0x509b3d['shift']());}};_0x4bfd61(++_0x5c33d4);}(_0x0bb5,0x148));var _0x50bb=function(_0x27dea8,_0x2b02ca){_0x27dea8=_0x27dea8-0x0;var _0xd62b2e=_0x0bb5[_0x27dea8];return _0xd62b2e;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a52c2f0..54dce07 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 _0x9d5c=['STRING'];(function(_0x34eae5,_0x187c2e){var _0x521fe7=function(_0x48794c){while(--_0x48794c){_0x34eae5['push'](_0x34eae5['shift']());}};_0x521fe7(++_0x187c2e);}(_0x9d5c,0x19c));var _0xc9d5=function(_0x212d4c,_0x27d8f9){_0x212d4c=_0x212d4c-0x0;var _0x17a159=_0x9d5c[_0x212d4c];return _0x17a159;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc9d5('0x0')]},'description':{'type':Sequelize[_0xc9d5('0x0')]}}; \ No newline at end of file +var _0x7a56=['sequelize','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a56,0x19c));var _0x67a5=function(_0x401181,_0x207187){_0x401181=_0x401181-0x0;var _0xed9f46=_0x7a56[_0x401181];return _0xed9f46;};'use strict';var Sequelize=require(_0x67a5('0x0'));module[_0x67a5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d0e21c5..e49626a 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 _0xcdfa=['undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','ZendeskConfiguration','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','type','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','findOne','ZendeskField','pick','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xcdfa,0x180));var _0xacdf=function(_0x54cecb,_0x473d29){_0x54cecb=_0x54cecb-0x0;var _0x2e60a5=_0xcdfa[_0x54cecb];return _0x2e60a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacdf('0x0'));var zipdir=require(_0xacdf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xacdf('0x2'));var moment=require(_0xacdf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xacdf('0x4'));var path=require(_0xacdf('0x5'));var sox=require(_0xacdf('0x6'));var csv=require(_0xacdf('0x7'));var ejs=require(_0xacdf('0x8'));var fs=require('fs');var fs_extra=require(_0xacdf('0x9'));var _=require(_0xacdf('0xa'));var squel=require(_0xacdf('0xb'));var crypto=require(_0xacdf('0xc'));var jsforce=require(_0xacdf('0xd'));var deskjs=require(_0xacdf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xacdf('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xacdf('0x10'));var as=require(_0xacdf('0x11'));var hardwareService=require(_0xacdf('0x12'));var logger=require('../../config/logger')(_0xacdf('0x13'));var utils=require(_0xacdf('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xacdf('0x15'))['db'];function respondWithStatusCode(_0x15f9a6,_0x5cb61c){_0x5cb61c=_0x5cb61c||0xcc;return function(_0x441219){if(_0x441219){return _0x15f9a6[_0xacdf('0x16')](_0x5cb61c);}return _0x15f9a6['status'](_0x5cb61c)[_0xacdf('0x17')]();};}function respondWithResult(_0x7030cd,_0x17ebed){_0x17ebed=_0x17ebed||0xc8;return function(_0x3b12cc){if(_0x3b12cc){return _0x7030cd[_0xacdf('0x18')](_0x17ebed)[_0xacdf('0x19')](_0x3b12cc);}};}function respondWithFilteredResult(_0x13b803,_0x34b08c){return function(_0x20b065){if(_0x20b065){var _0x4b08d6=typeof _0x34b08c['offset']===_0xacdf('0x1a')&&typeof _0x34b08c[_0xacdf('0x1b')]===_0xacdf('0x1a');var _0x5c3ecf=_0x20b065[_0xacdf('0x1c')];var _0x2f9fea=_0x4b08d6?0x0:_0x34b08c[_0xacdf('0x1d')];var _0x408e91=_0x4b08d6?_0x20b065[_0xacdf('0x1c')]:_0x34b08c['offset']+_0x34b08c['limit'];var _0x26f0a1;if(_0x408e91>=_0x5c3ecf){_0x408e91=_0x5c3ecf;_0x26f0a1=0xc8;}else{_0x26f0a1=0xce;}_0x13b803[_0xacdf('0x18')](_0x26f0a1);return _0x13b803[_0xacdf('0x1e')](_0xacdf('0x1f'),_0x2f9fea+'-'+_0x408e91+'/'+_0x5c3ecf)['json'](_0x20b065);}return null;};}function patchUpdates(_0x41af20){return function(_0xff45d0){try{jsonpatch[_0xacdf('0x20')](_0xff45d0,_0x41af20,!![]);}catch(_0x8a8b07){return BPromise[_0xacdf('0x21')](_0x8a8b07);}return _0xff45d0['save']();};}function saveUpdates(_0x55a7d5,_0x1f7e43){return function(_0x8e5814){if(_0x8e5814){return _0x8e5814[_0xacdf('0x22')](_0x55a7d5)[_0xacdf('0x23')](function(_0x381c1a){return _0x381c1a;});}return null;};}function removeEntity(_0x57bd17,_0x63d073){return function(_0x2d15ac){if(_0x2d15ac){return _0x2d15ac[_0xacdf('0x24')]()[_0xacdf('0x23')](function(){_0x57bd17[_0xacdf('0x18')](0xcc)[_0xacdf('0x17')]();});}};}function handleEntityNotFound(_0x28e9bb,_0x1fbca4){return function(_0x29bd11){if(!_0x29bd11){_0x28e9bb[_0xacdf('0x16')](0x194);}return _0x29bd11;};}function handleError(_0x5c03f5,_0x1facb3){_0x1facb3=_0x1facb3||0x1f4;return function(_0x3ab5f2){logger[_0xacdf('0x25')](_0x3ab5f2[_0xacdf('0x26')]);if(_0x3ab5f2['name']){delete _0x3ab5f2[_0xacdf('0x27')];}_0x5c03f5['status'](_0x1facb3)['send'](_0x3ab5f2);};}exports['index']=function(_0x2fe3ca,_0x5c711a){var _0x3a1f25={},_0x151669={},_0xd40c1a={'count':0x0,'rows':[]};var _0x1f2a7c=_[_0xacdf('0x28')](db[_0xacdf('0x29')]['rawAttributes'],function(_0x2ad863){return{'name':_0x2ad863[_0xacdf('0x2a')],'type':_0x2ad863['type'][_0xacdf('0x2b')]};});_0x151669[_0xacdf('0x2c')]=_['map'](_0x1f2a7c,_0xacdf('0x27'));_0x151669[_0xacdf('0x2d')]=_[_0xacdf('0x2e')](_0x2fe3ca[_0xacdf('0x2d')]);_0x151669['filters']=_[_0xacdf('0x2f')](_0x151669[_0xacdf('0x2c')],_0x151669[_0xacdf('0x2d')]);_0x3a1f25['attributes']=_['intersection'](_0x151669[_0xacdf('0x2c')],qs[_0xacdf('0x30')](_0x2fe3ca[_0xacdf('0x2d')][_0xacdf('0x30')]));_0x3a1f25[_0xacdf('0x31')]=_0x3a1f25[_0xacdf('0x31')][_0xacdf('0x32')]?_0x3a1f25[_0xacdf('0x31')]:_0x151669[_0xacdf('0x2c')];if(!_0x2fe3ca[_0xacdf('0x2d')][_0xacdf('0x33')]('nolimit')){_0x3a1f25[_0xacdf('0x1b')]=qs[_0xacdf('0x1b')](_0x2fe3ca[_0xacdf('0x2d')][_0xacdf('0x1b')]);_0x3a1f25[_0xacdf('0x1d')]=qs[_0xacdf('0x1d')](_0x2fe3ca['query'][_0xacdf('0x1d')]);}_0x3a1f25[_0xacdf('0x34')]=qs[_0xacdf('0x35')](_0x2fe3ca[_0xacdf('0x2d')][_0xacdf('0x35')]);_0x3a1f25[_0xacdf('0x36')]=qs[_0xacdf('0x37')](_['pick'](_0x2fe3ca[_0xacdf('0x2d')],_0x151669['filters']),_0x1f2a7c);if(_0x2fe3ca[_0xacdf('0x2d')]['filter']){_0x3a1f25[_0xacdf('0x36')]=_['merge'](_0x3a1f25[_0xacdf('0x36')],{'$or':_[_0xacdf('0x28')](_0x1f2a7c,function(_0x2c25b2){if(_0x2c25b2[_0xacdf('0x38')]!==_0xacdf('0x39')){var _0x36d9fe={};_0x36d9fe[_0x2c25b2[_0xacdf('0x27')]]={'$like':'%'+_0x2fe3ca['query'][_0xacdf('0x3a')]+'%'};return _0x36d9fe;}})});}_0x3a1f25=_[_0xacdf('0x3b')]({},_0x3a1f25,_0x2fe3ca['options']);var _0x146b53={'where':_0x3a1f25[_0xacdf('0x36')]};return db[_0xacdf('0x29')][_0xacdf('0x1c')](_0x146b53)[_0xacdf('0x23')](function(_0x571aef){_0xd40c1a[_0xacdf('0x1c')]=_0x571aef;if(_0x2fe3ca['query'][_0xacdf('0x3c')]){_0x3a1f25[_0xacdf('0x3d')]=[{'all':!![]}];}return db[_0xacdf('0x29')][_0xacdf('0x3e')](_0x3a1f25);})[_0xacdf('0x23')](function(_0x3ce26f){_0xd40c1a['rows']=_0x3ce26f;return _0xd40c1a;})[_0xacdf('0x23')](respondWithFilteredResult(_0x5c711a,_0x3a1f25))[_0xacdf('0x3f')](handleError(_0x5c711a,null));};exports[_0xacdf('0x40')]=function(_0x3ee77a,_0x220604){var _0x389f56={'raw':![],'where':{'id':_0x3ee77a[_0xacdf('0x41')]['id']}},_0x50e3bf={};_0x50e3bf[_0xacdf('0x2c')]=_['keys'](db['ZendeskConfiguration'][_0xacdf('0x42')]);_0x50e3bf[_0xacdf('0x2d')]=_[_0xacdf('0x2e')](_0x3ee77a[_0xacdf('0x2d')]);_0x50e3bf['filters']=_[_0xacdf('0x2f')](_0x50e3bf['model'],_0x50e3bf[_0xacdf('0x2d')]);_0x389f56[_0xacdf('0x31')]=_['intersection'](_0x50e3bf[_0xacdf('0x2c')],qs[_0xacdf('0x30')](_0x3ee77a[_0xacdf('0x2d')]['fields']));_0x389f56[_0xacdf('0x31')]=_0x389f56[_0xacdf('0x31')]['length']?_0x389f56[_0xacdf('0x31')]:_0x50e3bf['model'];if(_0x3ee77a[_0xacdf('0x2d')]['includeAll']){_0x389f56['include']=[{'all':!![]}];}_0x389f56=_[_0xacdf('0x3b')]({},_0x389f56,_0x3ee77a[_0xacdf('0x43')]);return db[_0xacdf('0x29')][_0xacdf('0x44')](_0x389f56)['then'](handleEntityNotFound(_0x220604,null))[_0xacdf('0x23')](respondWithResult(_0x220604,null))['catch'](handleError(_0x220604,null));};exports['create']=function(_0x3cf971,_0x579eb0){return db[_0xacdf('0x29')][_0xacdf('0x45')](_0x3cf971[_0xacdf('0x46')],{})[_0xacdf('0x23')](respondWithResult(_0x579eb0,0xc9))['catch'](handleError(_0x579eb0,null));};exports[_0xacdf('0x22')]=function(_0x356e92,_0x5b1d46){if(_0x356e92[_0xacdf('0x46')]['id']){delete _0x356e92[_0xacdf('0x46')]['id'];}return db[_0xacdf('0x29')]['find']({'where':{'id':_0x356e92[_0xacdf('0x41')]['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x5b1d46,null))['then'](saveUpdates(_0x356e92['body'],null))[_0xacdf('0x23')](respondWithResult(_0x5b1d46,null))[_0xacdf('0x3f')](handleError(_0x5b1d46,null));};exports[_0xacdf('0x24')]=function(_0x5661c1,_0x33633c){return db['ZendeskConfiguration'][_0xacdf('0x44')]({'where':{'id':_0x5661c1[_0xacdf('0x41')]['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x33633c,null))['then'](removeEntity(_0x33633c,null))[_0xacdf('0x3f')](handleError(_0x33633c,null));};exports['getFields']=function(_0x2a3336,_0x4dd63f,_0x4cbe93){var _0x367e24={};var _0x52f56c={};var _0x35921e;var _0x33a715;return db[_0xacdf('0x29')][_0xacdf('0x47')]({'where':{'id':_0x2a3336[_0xacdf('0x41')]['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x4dd63f,null))[_0xacdf('0x23')](function(_0x32bd6a){if(_0x32bd6a){_0x35921e=_0x32bd6a;_0x52f56c[_0xacdf('0x2c')]=_[_0xacdf('0x2e')](db[_0xacdf('0x48')]['rawAttributes']);_0x52f56c[_0xacdf('0x2d')]=_[_0xacdf('0x2e')](_0x2a3336[_0xacdf('0x2d')]);_0x52f56c[_0xacdf('0x37')]=_[_0xacdf('0x2f')](_0x52f56c[_0xacdf('0x2c')],_0x52f56c[_0xacdf('0x2d')]);_0x367e24[_0xacdf('0x31')]=_[_0xacdf('0x2f')](_0x52f56c[_0xacdf('0x2c')],qs[_0xacdf('0x30')](_0x2a3336['query'][_0xacdf('0x30')]));_0x367e24[_0xacdf('0x31')]=_0x367e24[_0xacdf('0x31')]['length']?_0x367e24[_0xacdf('0x31')]:_0x52f56c[_0xacdf('0x2c')];_0x367e24[_0xacdf('0x34')]=qs['sort'](_0x2a3336['query'][_0xacdf('0x35')]);_0x367e24['where']=qs[_0xacdf('0x37')](_[_0xacdf('0x49')](_0x2a3336[_0xacdf('0x2d')],_0x52f56c[_0xacdf('0x37')]));if(_0x2a3336[_0xacdf('0x2d')][_0xacdf('0x3a')]){_0x367e24[_0xacdf('0x36')]=_[_0xacdf('0x3b')](_0x367e24[_0xacdf('0x36')],{'$or':_[_0xacdf('0x28')](_0x367e24[_0xacdf('0x31')],function(_0x268b53){var _0x447832={};_0x447832[_0x268b53]={'$like':'%'+_0x2a3336[_0xacdf('0x2d')][_0xacdf('0x3a')]+'%'};return _0x447832;})});}_0x367e24=_[_0xacdf('0x3b')]({},_0x367e24,_0x2a3336['options']);return _0x35921e[_0xacdf('0x4a')](_0x367e24);}})[_0xacdf('0x23')](function(_0x190576){if(_0x190576){_0x33a715=_0x190576[_0xacdf('0x32')];if(!_0x2a3336[_0xacdf('0x2d')]['hasOwnProperty'](_0xacdf('0x4b'))){_0x367e24[_0xacdf('0x1b')]=qs['limit'](_0x2a3336['query']['limit']);_0x367e24['offset']=qs[_0xacdf('0x1d')](_0x2a3336['query'][_0xacdf('0x1d')]);}return _0x35921e['getFields'](_0x367e24);}})[_0xacdf('0x23')](function(_0x4c6ebd){if(_0x4c6ebd){return _0x4c6ebd?{'count':_0x33a715,'rows':_0x4c6ebd}:null;}})[_0xacdf('0x23')](respondWithResult(_0x4dd63f,null))[_0xacdf('0x3f')](handleError(_0x4dd63f,null));};exports[_0xacdf('0x4c')]=function(_0x575829,_0x7f3b7c,_0x37f9b1){var _0x1570cc={};var _0x25b519={};var _0x35a6d1;var _0x1a1661;return db[_0xacdf('0x29')]['findOne']({'where':{'id':_0x575829[_0xacdf('0x41')]['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x7f3b7c,null))[_0xacdf('0x23')](function(_0x288890){if(_0x288890){_0x35a6d1=_0x288890;_0x25b519[_0xacdf('0x2c')]=_[_0xacdf('0x2e')](db['ZendeskField'][_0xacdf('0x42')]);_0x25b519[_0xacdf('0x2d')]=_[_0xacdf('0x2e')](_0x575829['query']);_0x25b519['filters']=_[_0xacdf('0x2f')](_0x25b519[_0xacdf('0x2c')],_0x25b519['query']);_0x1570cc[_0xacdf('0x31')]=_['intersection'](_0x25b519[_0xacdf('0x2c')],qs[_0xacdf('0x30')](_0x575829[_0xacdf('0x2d')][_0xacdf('0x30')]));_0x1570cc['attributes']=_0x1570cc[_0xacdf('0x31')][_0xacdf('0x32')]?_0x1570cc[_0xacdf('0x31')]:_0x25b519[_0xacdf('0x2c')];_0x1570cc[_0xacdf('0x34')]=qs[_0xacdf('0x35')](_0x575829[_0xacdf('0x2d')]['sort']);_0x1570cc[_0xacdf('0x36')]=qs[_0xacdf('0x37')](_['pick'](_0x575829['query'],_0x25b519['filters']));if(_0x575829[_0xacdf('0x2d')][_0xacdf('0x3a')]){_0x1570cc[_0xacdf('0x36')]=_['merge'](_0x1570cc[_0xacdf('0x36')],{'$or':_['map'](_0x1570cc[_0xacdf('0x31')],function(_0x95b605){var _0x467eea={};_0x467eea[_0x95b605]={'$like':'%'+_0x575829['query'][_0xacdf('0x3a')]+'%'};return _0x467eea;})});}_0x1570cc=_[_0xacdf('0x3b')]({},_0x1570cc,_0x575829[_0xacdf('0x43')]);return _0x35a6d1['getSubjects'](_0x1570cc);}})[_0xacdf('0x23')](function(_0x31f0c3){if(_0x31f0c3){_0x1a1661=_0x31f0c3['length'];if(!_0x575829[_0xacdf('0x2d')][_0xacdf('0x33')](_0xacdf('0x4b'))){_0x1570cc[_0xacdf('0x1b')]=qs['limit'](_0x575829[_0xacdf('0x2d')][_0xacdf('0x1b')]);_0x1570cc[_0xacdf('0x1d')]=qs[_0xacdf('0x1d')](_0x575829[_0xacdf('0x2d')][_0xacdf('0x1d')]);}return _0x35a6d1[_0xacdf('0x4c')](_0x1570cc);}})['then'](function(_0x3021d3){if(_0x3021d3){return _0x3021d3?{'count':_0x1a1661,'rows':_0x3021d3}:null;}})[_0xacdf('0x23')](respondWithResult(_0x7f3b7c,null))['catch'](handleError(_0x7f3b7c,null));};exports['getDescriptions']=function(_0x59a3bd,_0x783b54,_0x151487){var _0x3a2748={};var _0x565abe={};var _0x427502;var _0x1aa980;return db['ZendeskConfiguration'][_0xacdf('0x47')]({'where':{'id':_0x59a3bd[_0xacdf('0x41')]['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x783b54,null))[_0xacdf('0x23')](function(_0x5cf15d){if(_0x5cf15d){_0x427502=_0x5cf15d;_0x565abe[_0xacdf('0x2c')]=_['keys'](db['ZendeskField'][_0xacdf('0x42')]);_0x565abe['query']=_[_0xacdf('0x2e')](_0x59a3bd[_0xacdf('0x2d')]);_0x565abe[_0xacdf('0x37')]=_[_0xacdf('0x2f')](_0x565abe[_0xacdf('0x2c')],_0x565abe[_0xacdf('0x2d')]);_0x3a2748['attributes']=_['intersection'](_0x565abe[_0xacdf('0x2c')],qs['fields'](_0x59a3bd[_0xacdf('0x2d')][_0xacdf('0x30')]));_0x3a2748[_0xacdf('0x31')]=_0x3a2748[_0xacdf('0x31')][_0xacdf('0x32')]?_0x3a2748[_0xacdf('0x31')]:_0x565abe[_0xacdf('0x2c')];_0x3a2748['order']=qs[_0xacdf('0x35')](_0x59a3bd[_0xacdf('0x2d')]['sort']);_0x3a2748['where']=qs[_0xacdf('0x37')](_[_0xacdf('0x49')](_0x59a3bd[_0xacdf('0x2d')],_0x565abe[_0xacdf('0x37')]));if(_0x59a3bd[_0xacdf('0x2d')]['filter']){_0x3a2748[_0xacdf('0x36')]=_['merge'](_0x3a2748['where'],{'$or':_[_0xacdf('0x28')](_0x3a2748[_0xacdf('0x31')],function(_0xc493a9){var _0x56217d={};_0x56217d[_0xc493a9]={'$like':'%'+_0x59a3bd[_0xacdf('0x2d')][_0xacdf('0x3a')]+'%'};return _0x56217d;})});}_0x3a2748=_[_0xacdf('0x3b')]({},_0x3a2748,_0x59a3bd[_0xacdf('0x43')]);return _0x427502['getDescriptions'](_0x3a2748);}})[_0xacdf('0x23')](function(_0x441716){if(_0x441716){_0x1aa980=_0x441716['length'];if(!_0x59a3bd['query']['hasOwnProperty'](_0xacdf('0x4b'))){_0x3a2748[_0xacdf('0x1b')]=qs[_0xacdf('0x1b')](_0x59a3bd[_0xacdf('0x2d')]['limit']);_0x3a2748[_0xacdf('0x1d')]=qs[_0xacdf('0x1d')](_0x59a3bd[_0xacdf('0x2d')][_0xacdf('0x1d')]);}return _0x427502[_0xacdf('0x4d')](_0x3a2748);}})['then'](function(_0x63a5e8){if(_0x63a5e8){return _0x63a5e8?{'count':_0x1aa980,'rows':_0x63a5e8}:null;}})[_0xacdf('0x23')](respondWithResult(_0x783b54,null))[_0xacdf('0x3f')](handleError(_0x783b54,null));};exports[_0xacdf('0x4e')]=function(_0x255e77,_0x3a3f10,_0x227ac4){var _0x5041f7={};var _0x97a464={};var _0x2209c1;var _0x2f8467;return db[_0xacdf('0x29')][_0xacdf('0x47')]({'where':{'id':_0x255e77['params']['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x3a3f10,null))[_0xacdf('0x23')](function(_0x5c9ed8){if(_0x5c9ed8){_0x2209c1=_0x5c9ed8;_0x97a464[_0xacdf('0x2c')]=_['keys'](db[_0xacdf('0x4f')][_0xacdf('0x42')]);_0x97a464['query']=_[_0xacdf('0x2e')](_0x255e77[_0xacdf('0x2d')]);_0x97a464[_0xacdf('0x37')]=_[_0xacdf('0x2f')](_0x97a464[_0xacdf('0x2c')],_0x97a464[_0xacdf('0x2d')]);_0x5041f7[_0xacdf('0x31')]=_[_0xacdf('0x2f')](_0x97a464[_0xacdf('0x2c')],qs[_0xacdf('0x30')](_0x255e77['query'][_0xacdf('0x30')]));_0x5041f7[_0xacdf('0x31')]=_0x5041f7[_0xacdf('0x31')][_0xacdf('0x32')]?_0x5041f7[_0xacdf('0x31')]:_0x97a464[_0xacdf('0x2c')];_0x5041f7[_0xacdf('0x34')]=qs[_0xacdf('0x35')](_0x255e77[_0xacdf('0x2d')][_0xacdf('0x35')]);_0x5041f7[_0xacdf('0x36')]=qs['filters'](_[_0xacdf('0x49')](_0x255e77[_0xacdf('0x2d')],_0x97a464[_0xacdf('0x37')]));if(_0x255e77[_0xacdf('0x2d')][_0xacdf('0x3a')]){_0x5041f7[_0xacdf('0x36')]=_[_0xacdf('0x3b')](_0x5041f7[_0xacdf('0x36')],{'$or':_[_0xacdf('0x28')](_0x5041f7[_0xacdf('0x31')],function(_0x1c47d1){var _0x2096ae={};_0x2096ae[_0x1c47d1]={'$like':'%'+_0x255e77[_0xacdf('0x2d')][_0xacdf('0x3a')]+'%'};return _0x2096ae;})});}_0x5041f7=_[_0xacdf('0x3b')]({},_0x5041f7,_0x255e77[_0xacdf('0x43')]);return _0x2209c1[_0xacdf('0x4e')](_0x5041f7);}})['then'](function(_0x48e436){if(_0x48e436){_0x2f8467=_0x48e436[_0xacdf('0x32')];if(!_0x255e77[_0xacdf('0x2d')][_0xacdf('0x33')]('nolimit')){_0x5041f7[_0xacdf('0x1b')]=qs['limit'](_0x255e77[_0xacdf('0x2d')][_0xacdf('0x1b')]);_0x5041f7[_0xacdf('0x1d')]=qs['offset'](_0x255e77['query'][_0xacdf('0x1d')]);}return _0x2209c1['getTags'](_0x5041f7);}})[_0xacdf('0x23')](function(_0x307a0a){if(_0x307a0a){return _0x307a0a?{'count':_0x2f8467,'rows':_0x307a0a}:null;}})[_0xacdf('0x23')](respondWithResult(_0x3a3f10,null))[_0xacdf('0x3f')](handleError(_0x3a3f10,null));};exports['setTags']=function(_0x13ccac,_0x4dbbb5,_0x3065c3){if(_0x13ccac[_0xacdf('0x46')]['id']){delete _0x13ccac[_0xacdf('0x46')]['id'];}return db['ZendeskConfiguration'][_0xacdf('0x47')]({'where':{'id':_0x13ccac['params']['id']}})[_0xacdf('0x23')](handleEntityNotFound(_0x4dbbb5,null))[_0xacdf('0x23')](function(_0x666a88){if(_0x666a88){return _0x666a88[_0xacdf('0x50')](_0x13ccac[_0xacdf('0x46')][_0xacdf('0x51')]||[]);}return null;})[_0xacdf('0x23')](respondWithResult(_0x4dbbb5,null))[_0xacdf('0x3f')](handleError(_0x4dbbb5,null));}; \ No newline at end of file +var _0xd498=['undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','mustache','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','sendStatus','status','end','json','offset'];(function(_0x16d5d3,_0x1cb6eb){var _0x8c36f0=function(_0x373a9d){while(--_0x373a9d){_0x16d5d3['push'](_0x16d5d3['shift']());}};_0x8c36f0(++_0x1cb6eb);}(_0xd498,0x144));var _0x8d49=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xd498[_0xffa198];return _0x1e4b50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d49('0x0'));var zipdir=require(_0x8d49('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d49('0x2'));var moment=require(_0x8d49('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8d49('0x4'));var util=require('util');var path=require(_0x8d49('0x5'));var sox=require(_0x8d49('0x6'));var csv=require(_0x8d49('0x7'));var ejs=require(_0x8d49('0x8'));var fs=require('fs');var fs_extra=require(_0x8d49('0x9'));var _=require(_0x8d49('0xa'));var squel=require(_0x8d49('0xb'));var crypto=require(_0x8d49('0xc'));var jsforce=require(_0x8d49('0xd'));var deskjs=require(_0x8d49('0xe'));var toCsv=require(_0x8d49('0x7'));var querystring=require('querystring');var Papa=require(_0x8d49('0xf'));var Redis=require(_0x8d49('0x10'));var authService=require(_0x8d49('0x11'));var qs=require(_0x8d49('0x12'));var as=require(_0x8d49('0x13'));var hardwareService=require(_0x8d49('0x14'));var logger=require(_0x8d49('0x15'))(_0x8d49('0x16'));var utils=require(_0x8d49('0x17'));var config=require(_0x8d49('0x18'));var licenseUtil=require(_0x8d49('0x19'));var db=require(_0x8d49('0x1a'))['db'];function respondWithStatusCode(_0x56c1d6,_0x402809){_0x402809=_0x402809||0xcc;return function(_0x16e989){if(_0x16e989){return _0x56c1d6[_0x8d49('0x1b')](_0x402809);}return _0x56c1d6[_0x8d49('0x1c')](_0x402809)[_0x8d49('0x1d')]();};}function respondWithResult(_0x227d06,_0xc1c41f){_0xc1c41f=_0xc1c41f||0xc8;return function(_0x37c4e9){if(_0x37c4e9){return _0x227d06[_0x8d49('0x1c')](_0xc1c41f)[_0x8d49('0x1e')](_0x37c4e9);}};}function respondWithFilteredResult(_0x479a53,_0xd14724){return function(_0x284fec){if(_0x284fec){var _0x4ea6d4=typeof _0xd14724[_0x8d49('0x1f')]===_0x8d49('0x20')&&typeof _0xd14724[_0x8d49('0x21')]===_0x8d49('0x20');var _0x234b40=_0x284fec['count'];var _0x5584c0=_0x4ea6d4?0x0:_0xd14724[_0x8d49('0x1f')];var _0x43a7a1=_0x4ea6d4?_0x284fec[_0x8d49('0x22')]:_0xd14724['offset']+_0xd14724[_0x8d49('0x21')];var _0x541e5d;if(_0x43a7a1>=_0x234b40){_0x43a7a1=_0x234b40;_0x541e5d=0xc8;}else{_0x541e5d=0xce;}_0x479a53['status'](_0x541e5d);return _0x479a53[_0x8d49('0x23')]('Content-Range',_0x5584c0+'-'+_0x43a7a1+'/'+_0x234b40)['json'](_0x284fec);}return null;};}function patchUpdates(_0x5b8bd9){return function(_0x29f209){try{jsonpatch[_0x8d49('0x24')](_0x29f209,_0x5b8bd9,!![]);}catch(_0x318c27){return BPromise[_0x8d49('0x25')](_0x318c27);}return _0x29f209[_0x8d49('0x26')]();};}function saveUpdates(_0x851fa2,_0x542d37){return function(_0x33c907){if(_0x33c907){return _0x33c907[_0x8d49('0x27')](_0x851fa2)[_0x8d49('0x28')](function(_0x412824){return _0x412824;});}return null;};}function removeEntity(_0x51b44e,_0x8bb88a){return function(_0x487a2d){if(_0x487a2d){return _0x487a2d[_0x8d49('0x29')]()['then'](function(){_0x51b44e[_0x8d49('0x1c')](0xcc)[_0x8d49('0x1d')]();});}};}function handleEntityNotFound(_0x2c0170,_0x1ce84b){return function(_0x5cf10b){if(!_0x5cf10b){_0x2c0170['sendStatus'](0x194);}return _0x5cf10b;};}function handleError(_0x589bc9,_0xd35859){_0xd35859=_0xd35859||0x1f4;return function(_0x57b81d){logger[_0x8d49('0x2a')](_0x57b81d[_0x8d49('0x2b')]);if(_0x57b81d[_0x8d49('0x2c')]){delete _0x57b81d['name'];}_0x589bc9[_0x8d49('0x1c')](_0xd35859)[_0x8d49('0x2d')](_0x57b81d);};}exports[_0x8d49('0x2e')]=function(_0x1e60f6,_0x5a3d5c){var _0x38a75a={},_0x932d5b={},_0x522e62={'count':0x0,'rows':[]};var _0x2350ed=_['map'](db[_0x8d49('0x2f')][_0x8d49('0x30')],function(_0xba26b5){return{'name':_0xba26b5[_0x8d49('0x31')],'type':_0xba26b5[_0x8d49('0x32')]['key']};});_0x932d5b[_0x8d49('0x33')]=_[_0x8d49('0x34')](_0x2350ed,_0x8d49('0x2c'));_0x932d5b[_0x8d49('0x35')]=_[_0x8d49('0x36')](_0x1e60f6['query']);_0x932d5b[_0x8d49('0x37')]=_[_0x8d49('0x38')](_0x932d5b['model'],_0x932d5b[_0x8d49('0x35')]);_0x38a75a[_0x8d49('0x39')]=_['intersection'](_0x932d5b[_0x8d49('0x33')],qs[_0x8d49('0x3a')](_0x1e60f6['query'][_0x8d49('0x3a')]));_0x38a75a[_0x8d49('0x39')]=_0x38a75a[_0x8d49('0x39')][_0x8d49('0x3b')]?_0x38a75a['attributes']:_0x932d5b['model'];if(!_0x1e60f6[_0x8d49('0x35')][_0x8d49('0x3c')](_0x8d49('0x3d'))){_0x38a75a[_0x8d49('0x21')]=qs[_0x8d49('0x21')](_0x1e60f6[_0x8d49('0x35')][_0x8d49('0x21')]);_0x38a75a[_0x8d49('0x1f')]=qs['offset'](_0x1e60f6[_0x8d49('0x35')][_0x8d49('0x1f')]);}_0x38a75a[_0x8d49('0x3e')]=qs[_0x8d49('0x3f')](_0x1e60f6[_0x8d49('0x35')][_0x8d49('0x3f')]);_0x38a75a[_0x8d49('0x40')]=qs[_0x8d49('0x37')](_[_0x8d49('0x41')](_0x1e60f6[_0x8d49('0x35')],_0x932d5b[_0x8d49('0x37')]),_0x2350ed);if(_0x1e60f6['query'][_0x8d49('0x42')]){_0x38a75a['where']=_[_0x8d49('0x43')](_0x38a75a[_0x8d49('0x40')],{'$or':_[_0x8d49('0x34')](_0x2350ed,function(_0x18b036){if(_0x18b036[_0x8d49('0x32')]!==_0x8d49('0x44')){var _0x34e086={};_0x34e086[_0x18b036[_0x8d49('0x2c')]]={'$like':'%'+_0x1e60f6[_0x8d49('0x35')]['filter']+'%'};return _0x34e086;}})});}_0x38a75a=_['merge']({},_0x38a75a,_0x1e60f6[_0x8d49('0x45')]);var _0x45bfc8={'where':_0x38a75a[_0x8d49('0x40')]};return db[_0x8d49('0x2f')][_0x8d49('0x22')](_0x45bfc8)[_0x8d49('0x28')](function(_0x128c0a){_0x522e62['count']=_0x128c0a;if(_0x1e60f6[_0x8d49('0x35')][_0x8d49('0x46')]){_0x38a75a[_0x8d49('0x47')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x8d49('0x48')](_0x38a75a);})['then'](function(_0x913c1c){_0x522e62[_0x8d49('0x49')]=_0x913c1c;return _0x522e62;})[_0x8d49('0x28')](respondWithFilteredResult(_0x5a3d5c,_0x38a75a))[_0x8d49('0x4a')](handleError(_0x5a3d5c,null));};exports[_0x8d49('0x4b')]=function(_0x3be234,_0x111e19){var _0x1b80a9={'raw':![],'where':{'id':_0x3be234[_0x8d49('0x4c')]['id']}},_0x16276d={};_0x16276d['model']=_[_0x8d49('0x36')](db[_0x8d49('0x2f')][_0x8d49('0x30')]);_0x16276d[_0x8d49('0x35')]=_[_0x8d49('0x36')](_0x3be234[_0x8d49('0x35')]);_0x16276d[_0x8d49('0x37')]=_[_0x8d49('0x38')](_0x16276d[_0x8d49('0x33')],_0x16276d[_0x8d49('0x35')]);_0x1b80a9[_0x8d49('0x39')]=_[_0x8d49('0x38')](_0x16276d[_0x8d49('0x33')],qs['fields'](_0x3be234[_0x8d49('0x35')][_0x8d49('0x3a')]));_0x1b80a9[_0x8d49('0x39')]=_0x1b80a9[_0x8d49('0x39')]['length']?_0x1b80a9[_0x8d49('0x39')]:_0x16276d[_0x8d49('0x33')];if(_0x3be234['query'][_0x8d49('0x46')]){_0x1b80a9[_0x8d49('0x47')]=[{'all':!![]}];}_0x1b80a9=_[_0x8d49('0x43')]({},_0x1b80a9,_0x3be234[_0x8d49('0x45')]);return db[_0x8d49('0x2f')][_0x8d49('0x4d')](_0x1b80a9)[_0x8d49('0x28')](handleEntityNotFound(_0x111e19,null))['then'](respondWithResult(_0x111e19,null))[_0x8d49('0x4a')](handleError(_0x111e19,null));};exports[_0x8d49('0x4e')]=function(_0x42722f,_0x2d0a8e){return db[_0x8d49('0x2f')][_0x8d49('0x4e')](_0x42722f[_0x8d49('0x4f')],{})[_0x8d49('0x28')](respondWithResult(_0x2d0a8e,0xc9))[_0x8d49('0x4a')](handleError(_0x2d0a8e,null));};exports[_0x8d49('0x27')]=function(_0x14ce12,_0x22d354){if(_0x14ce12[_0x8d49('0x4f')]['id']){delete _0x14ce12['body']['id'];}return db[_0x8d49('0x2f')][_0x8d49('0x4d')]({'where':{'id':_0x14ce12[_0x8d49('0x4c')]['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x22d354,null))['then'](saveUpdates(_0x14ce12[_0x8d49('0x4f')],null))[_0x8d49('0x28')](respondWithResult(_0x22d354,null))[_0x8d49('0x4a')](handleError(_0x22d354,null));};exports[_0x8d49('0x29')]=function(_0x3cb741,_0x3e9a61){return db[_0x8d49('0x2f')][_0x8d49('0x4d')]({'where':{'id':_0x3cb741[_0x8d49('0x4c')]['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x3e9a61,null))[_0x8d49('0x28')](removeEntity(_0x3e9a61,null))[_0x8d49('0x4a')](handleError(_0x3e9a61,null));};exports[_0x8d49('0x50')]=function(_0xa90060,_0x1e6542,_0x3ce357){var _0x5599c6={};var _0xadbc91={};var _0x47afaa;var _0x7d2e7a;return db[_0x8d49('0x2f')][_0x8d49('0x51')]({'where':{'id':_0xa90060['params']['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x1e6542,null))['then'](function(_0x5a135c){if(_0x5a135c){_0x47afaa=_0x5a135c;_0xadbc91['model']=_[_0x8d49('0x36')](db[_0x8d49('0x52')][_0x8d49('0x30')]);_0xadbc91[_0x8d49('0x35')]=_['keys'](_0xa90060[_0x8d49('0x35')]);_0xadbc91[_0x8d49('0x37')]=_[_0x8d49('0x38')](_0xadbc91[_0x8d49('0x33')],_0xadbc91['query']);_0x5599c6[_0x8d49('0x39')]=_['intersection'](_0xadbc91[_0x8d49('0x33')],qs[_0x8d49('0x3a')](_0xa90060[_0x8d49('0x35')][_0x8d49('0x3a')]));_0x5599c6[_0x8d49('0x39')]=_0x5599c6[_0x8d49('0x39')]['length']?_0x5599c6[_0x8d49('0x39')]:_0xadbc91[_0x8d49('0x33')];_0x5599c6[_0x8d49('0x3e')]=qs[_0x8d49('0x3f')](_0xa90060[_0x8d49('0x35')][_0x8d49('0x3f')]);_0x5599c6[_0x8d49('0x40')]=qs[_0x8d49('0x37')](_[_0x8d49('0x41')](_0xa90060[_0x8d49('0x35')],_0xadbc91[_0x8d49('0x37')]));if(_0xa90060[_0x8d49('0x35')][_0x8d49('0x42')]){_0x5599c6[_0x8d49('0x40')]=_['merge'](_0x5599c6[_0x8d49('0x40')],{'$or':_['map'](_0x5599c6[_0x8d49('0x39')],function(_0x18fe0e){var _0x386d14={};_0x386d14[_0x18fe0e]={'$like':'%'+_0xa90060[_0x8d49('0x35')]['filter']+'%'};return _0x386d14;})});}_0x5599c6=_[_0x8d49('0x43')]({},_0x5599c6,_0xa90060['options']);return _0x47afaa[_0x8d49('0x50')](_0x5599c6);}})['then'](function(_0x1f2e0a){if(_0x1f2e0a){_0x7d2e7a=_0x1f2e0a[_0x8d49('0x3b')];if(!_0xa90060[_0x8d49('0x35')][_0x8d49('0x3c')](_0x8d49('0x3d'))){_0x5599c6[_0x8d49('0x21')]=qs['limit'](_0xa90060['query'][_0x8d49('0x21')]);_0x5599c6[_0x8d49('0x1f')]=qs['offset'](_0xa90060[_0x8d49('0x35')][_0x8d49('0x1f')]);}return _0x47afaa['getFields'](_0x5599c6);}})[_0x8d49('0x28')](function(_0x3b61c4){if(_0x3b61c4){return _0x3b61c4?{'count':_0x7d2e7a,'rows':_0x3b61c4}:null;}})['then'](respondWithResult(_0x1e6542,null))[_0x8d49('0x4a')](handleError(_0x1e6542,null));};exports['getSubjects']=function(_0x2ed61a,_0x5d4037,_0xa557a8){var _0xd6ce28={};var _0x4f5278={};var _0x27eb52;var _0x9c2e53;return db[_0x8d49('0x2f')][_0x8d49('0x51')]({'where':{'id':_0x2ed61a[_0x8d49('0x4c')]['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x5d4037,null))[_0x8d49('0x28')](function(_0x42b438){if(_0x42b438){_0x27eb52=_0x42b438;_0x4f5278[_0x8d49('0x33')]=_[_0x8d49('0x36')](db['ZendeskField'][_0x8d49('0x30')]);_0x4f5278[_0x8d49('0x35')]=_[_0x8d49('0x36')](_0x2ed61a[_0x8d49('0x35')]);_0x4f5278['filters']=_[_0x8d49('0x38')](_0x4f5278[_0x8d49('0x33')],_0x4f5278[_0x8d49('0x35')]);_0xd6ce28[_0x8d49('0x39')]=_[_0x8d49('0x38')](_0x4f5278[_0x8d49('0x33')],qs[_0x8d49('0x3a')](_0x2ed61a[_0x8d49('0x35')][_0x8d49('0x3a')]));_0xd6ce28[_0x8d49('0x39')]=_0xd6ce28['attributes'][_0x8d49('0x3b')]?_0xd6ce28['attributes']:_0x4f5278[_0x8d49('0x33')];_0xd6ce28[_0x8d49('0x3e')]=qs[_0x8d49('0x3f')](_0x2ed61a['query'][_0x8d49('0x3f')]);_0xd6ce28[_0x8d49('0x40')]=qs[_0x8d49('0x37')](_['pick'](_0x2ed61a[_0x8d49('0x35')],_0x4f5278[_0x8d49('0x37')]));if(_0x2ed61a[_0x8d49('0x35')]['filter']){_0xd6ce28[_0x8d49('0x40')]=_[_0x8d49('0x43')](_0xd6ce28['where'],{'$or':_['map'](_0xd6ce28[_0x8d49('0x39')],function(_0x570af5){var _0x33c41d={};_0x33c41d[_0x570af5]={'$like':'%'+_0x2ed61a[_0x8d49('0x35')][_0x8d49('0x42')]+'%'};return _0x33c41d;})});}_0xd6ce28=_['merge']({},_0xd6ce28,_0x2ed61a[_0x8d49('0x45')]);return _0x27eb52['getSubjects'](_0xd6ce28);}})[_0x8d49('0x28')](function(_0x4d71d1){if(_0x4d71d1){_0x9c2e53=_0x4d71d1[_0x8d49('0x3b')];if(!_0x2ed61a[_0x8d49('0x35')][_0x8d49('0x3c')](_0x8d49('0x3d'))){_0xd6ce28[_0x8d49('0x21')]=qs['limit'](_0x2ed61a[_0x8d49('0x35')][_0x8d49('0x21')]);_0xd6ce28['offset']=qs['offset'](_0x2ed61a[_0x8d49('0x35')][_0x8d49('0x1f')]);}return _0x27eb52[_0x8d49('0x53')](_0xd6ce28);}})[_0x8d49('0x28')](function(_0x3cd25b){if(_0x3cd25b){return _0x3cd25b?{'count':_0x9c2e53,'rows':_0x3cd25b}:null;}})[_0x8d49('0x28')](respondWithResult(_0x5d4037,null))[_0x8d49('0x4a')](handleError(_0x5d4037,null));};exports[_0x8d49('0x54')]=function(_0x190679,_0x3bdcde,_0xb59d96){var _0x54679a={};var _0x47406a={};var _0x4038f9;var _0x2addf0;return db['ZendeskConfiguration'][_0x8d49('0x51')]({'where':{'id':_0x190679[_0x8d49('0x4c')]['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x3bdcde,null))[_0x8d49('0x28')](function(_0x3003d3){if(_0x3003d3){_0x4038f9=_0x3003d3;_0x47406a[_0x8d49('0x33')]=_[_0x8d49('0x36')](db['ZendeskField'][_0x8d49('0x30')]);_0x47406a[_0x8d49('0x35')]=_[_0x8d49('0x36')](_0x190679[_0x8d49('0x35')]);_0x47406a[_0x8d49('0x37')]=_[_0x8d49('0x38')](_0x47406a[_0x8d49('0x33')],_0x47406a[_0x8d49('0x35')]);_0x54679a[_0x8d49('0x39')]=_[_0x8d49('0x38')](_0x47406a[_0x8d49('0x33')],qs[_0x8d49('0x3a')](_0x190679[_0x8d49('0x35')][_0x8d49('0x3a')]));_0x54679a[_0x8d49('0x39')]=_0x54679a[_0x8d49('0x39')][_0x8d49('0x3b')]?_0x54679a[_0x8d49('0x39')]:_0x47406a[_0x8d49('0x33')];_0x54679a['order']=qs[_0x8d49('0x3f')](_0x190679[_0x8d49('0x35')][_0x8d49('0x3f')]);_0x54679a[_0x8d49('0x40')]=qs['filters'](_[_0x8d49('0x41')](_0x190679['query'],_0x47406a[_0x8d49('0x37')]));if(_0x190679[_0x8d49('0x35')][_0x8d49('0x42')]){_0x54679a[_0x8d49('0x40')]=_[_0x8d49('0x43')](_0x54679a['where'],{'$or':_[_0x8d49('0x34')](_0x54679a[_0x8d49('0x39')],function(_0x439aa8){var _0x4eb09b={};_0x4eb09b[_0x439aa8]={'$like':'%'+_0x190679['query']['filter']+'%'};return _0x4eb09b;})});}_0x54679a=_['merge']({},_0x54679a,_0x190679[_0x8d49('0x45')]);return _0x4038f9[_0x8d49('0x54')](_0x54679a);}})[_0x8d49('0x28')](function(_0x555ff7){if(_0x555ff7){_0x2addf0=_0x555ff7[_0x8d49('0x3b')];if(!_0x190679[_0x8d49('0x35')]['hasOwnProperty'](_0x8d49('0x3d'))){_0x54679a[_0x8d49('0x21')]=qs[_0x8d49('0x21')](_0x190679[_0x8d49('0x35')][_0x8d49('0x21')]);_0x54679a[_0x8d49('0x1f')]=qs[_0x8d49('0x1f')](_0x190679[_0x8d49('0x35')][_0x8d49('0x1f')]);}return _0x4038f9[_0x8d49('0x54')](_0x54679a);}})[_0x8d49('0x28')](function(_0x2d31d8){if(_0x2d31d8){return _0x2d31d8?{'count':_0x2addf0,'rows':_0x2d31d8}:null;}})[_0x8d49('0x28')](respondWithResult(_0x3bdcde,null))[_0x8d49('0x4a')](handleError(_0x3bdcde,null));};exports[_0x8d49('0x55')]=function(_0x4318d7,_0x2e983d,_0x530de8){var _0x2b6c56={};var _0x1b17f4={};var _0x2b163c;var _0x26f241;return db[_0x8d49('0x2f')]['findOne']({'where':{'id':_0x4318d7[_0x8d49('0x4c')]['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x2e983d,null))[_0x8d49('0x28')](function(_0x2be90f){if(_0x2be90f){_0x2b163c=_0x2be90f;_0x1b17f4[_0x8d49('0x33')]=_[_0x8d49('0x36')](db[_0x8d49('0x56')]['rawAttributes']);_0x1b17f4[_0x8d49('0x35')]=_[_0x8d49('0x36')](_0x4318d7['query']);_0x1b17f4['filters']=_[_0x8d49('0x38')](_0x1b17f4[_0x8d49('0x33')],_0x1b17f4[_0x8d49('0x35')]);_0x2b6c56['attributes']=_['intersection'](_0x1b17f4[_0x8d49('0x33')],qs[_0x8d49('0x3a')](_0x4318d7[_0x8d49('0x35')][_0x8d49('0x3a')]));_0x2b6c56[_0x8d49('0x39')]=_0x2b6c56[_0x8d49('0x39')][_0x8d49('0x3b')]?_0x2b6c56['attributes']:_0x1b17f4[_0x8d49('0x33')];_0x2b6c56[_0x8d49('0x3e')]=qs[_0x8d49('0x3f')](_0x4318d7[_0x8d49('0x35')][_0x8d49('0x3f')]);_0x2b6c56[_0x8d49('0x40')]=qs[_0x8d49('0x37')](_[_0x8d49('0x41')](_0x4318d7[_0x8d49('0x35')],_0x1b17f4[_0x8d49('0x37')]));if(_0x4318d7[_0x8d49('0x35')]['filter']){_0x2b6c56[_0x8d49('0x40')]=_[_0x8d49('0x43')](_0x2b6c56[_0x8d49('0x40')],{'$or':_[_0x8d49('0x34')](_0x2b6c56[_0x8d49('0x39')],function(_0x44ffe0){var _0x118cd8={};_0x118cd8[_0x44ffe0]={'$like':'%'+_0x4318d7['query'][_0x8d49('0x42')]+'%'};return _0x118cd8;})});}_0x2b6c56=_[_0x8d49('0x43')]({},_0x2b6c56,_0x4318d7[_0x8d49('0x45')]);return _0x2b163c[_0x8d49('0x55')](_0x2b6c56);}})['then'](function(_0x201db4){if(_0x201db4){_0x26f241=_0x201db4['length'];if(!_0x4318d7[_0x8d49('0x35')][_0x8d49('0x3c')]('nolimit')){_0x2b6c56[_0x8d49('0x21')]=qs[_0x8d49('0x21')](_0x4318d7[_0x8d49('0x35')][_0x8d49('0x21')]);_0x2b6c56[_0x8d49('0x1f')]=qs[_0x8d49('0x1f')](_0x4318d7[_0x8d49('0x35')][_0x8d49('0x1f')]);}return _0x2b163c[_0x8d49('0x55')](_0x2b6c56);}})[_0x8d49('0x28')](function(_0x6dcddd){if(_0x6dcddd){return _0x6dcddd?{'count':_0x26f241,'rows':_0x6dcddd}:null;}})[_0x8d49('0x28')](respondWithResult(_0x2e983d,null))[_0x8d49('0x4a')](handleError(_0x2e983d,null));};exports[_0x8d49('0x57')]=function(_0x37b7b1,_0x274e93,_0x1040ae){if(_0x37b7b1[_0x8d49('0x4f')]['id']){delete _0x37b7b1[_0x8d49('0x4f')]['id'];}return db[_0x8d49('0x2f')][_0x8d49('0x51')]({'where':{'id':_0x37b7b1['params']['id']}})[_0x8d49('0x28')](handleEntityNotFound(_0x274e93,null))['then'](function(_0x456a1d){if(_0x456a1d){return _0x456a1d['setTags'](_0x37b7b1[_0x8d49('0x4f')][_0x8d49('0x58')]||[]);}return null;})['then'](respondWithResult(_0x274e93,null))[_0x8d49('0x4a')](handleError(_0x274e93,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index eb25f4d..15397a4 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 _0xe820=['exports','define','ZendeskConfiguration','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x319b14,_0x75d1b1){var _0x3e4e51=function(_0x30fa8d){while(--_0x30fa8d){_0x319b14['push'](_0x319b14['shift']());}};_0x3e4e51(++_0x75d1b1);}(_0xe820,0xd2));var _0x0e82=function(_0xb791cc,_0xd2b81e){_0xb791cc=_0xb791cc-0x0;var _0x3ef4f4=_0xe820[_0xb791cc];return _0x3ef4f4;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x22df11,_0x133371){var _0x42a8c5=function(_0xaf1176){while(--_0xaf1176){_0x22df11['push'](_0x22df11['shift']());}};_0x42a8c5(++_0x133371);}(_0xa571,0x107));var _0x1a57=function(_0x138688,_0x186edf){_0x138688=_0x138688-0x0;var _0x24b567=_0xa571[_0x138688];return _0x24b567;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'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 7b4cf88..7f1b67e 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 _0xfdb5=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x21a96a,_0x75e2d6){var _0x1d6986=function(_0x2a3f8d){while(--_0x2a3f8d){_0x21a96a['push'](_0x21a96a['shift']());}};_0x1d6986(++_0x75e2d6);}(_0xfdb5,0x6d));var _0x5fdb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfdb5[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5fdb('0x0'));var util=require(_0x5fdb('0x1'));var moment=require(_0x5fdb('0x2'));var BPromise=require(_0x5fdb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fdb('0x4'))['db'];var utils=require(_0x5fdb('0x5'));var logger=require(_0x5fdb('0x6'))(_0x5fdb('0x7'));var config=require(_0x5fdb('0x8'));var jayson=require(_0x5fdb('0x9'));var client=jayson['client'][_0x5fdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x156344,_0x4c7df5,_0x5a6090){return new BPromise(function(_0x422952,_0x1b54f1){return client[_0x5fdb('0xb')](_0x156344,_0x5a6090)[_0x5fdb('0xc')](function(_0x2ac05c){logger[_0x5fdb('0xd')](_0x5fdb('0xe'),_0x4c7df5,_0x5fdb('0xf'));logger[_0x5fdb('0x10')](_0x5fdb('0x11'),_0x4c7df5,'request\x20sent',JSON[_0x5fdb('0x12')](_0x2ac05c));if(_0x2ac05c['error']){if(_0x2ac05c[_0x5fdb('0x13')][_0x5fdb('0x14')]===0x1f4){logger['error'](_0x5fdb('0xe'),_0x4c7df5,_0x2ac05c[_0x5fdb('0x13')][_0x5fdb('0x15')]);return _0x1b54f1(_0x2ac05c[_0x5fdb('0x13')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4c7df5,_0x2ac05c[_0x5fdb('0x13')][_0x5fdb('0x15')]);return _0x422952(_0x2ac05c[_0x5fdb('0x13')]['message']);}else{logger[_0x5fdb('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4c7df5,_0x5fdb('0xf'));_0x422952(_0x2ac05c['result'][_0x5fdb('0x15')]);}})['catch'](function(_0x49044b){logger[_0x5fdb('0x13')](_0x5fdb('0xe'),_0x4c7df5,_0x49044b);_0x1b54f1(_0x49044b);});});} \ No newline at end of file +var _0x9195=['result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x59e455,_0x54ccf2){var _0x371e48=function(_0x1d88ac){while(--_0x1d88ac){_0x59e455['push'](_0x59e455['shift']());}};_0x371e48(++_0x54ccf2);}(_0x9195,0xe8));var _0x5919=function(_0x542f2f,_0x46dcf8){_0x542f2f=_0x542f2f-0x0;var _0x474845=_0x9195[_0x542f2f];return _0x474845;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5919('0x0'));var rs=require(_0x5919('0x1'));var fs=require('fs');var Redis=require(_0x5919('0x2'));var db=require(_0x5919('0x3'))['db'];var utils=require(_0x5919('0x4'));var logger=require(_0x5919('0x5'))(_0x5919('0x6'));var config=require(_0x5919('0x7'));var jayson=require(_0x5919('0x8'));var client=jayson[_0x5919('0x9')][_0x5919('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb7cb,_0x2b105a,_0x3a12e4){return new BPromise(function(_0x247b87,_0x33e9b2){return client[_0x5919('0xb')](_0x3eb7cb,_0x3a12e4)[_0x5919('0xc')](function(_0x4d02b7){logger['info'](_0x5919('0xd'),_0x2b105a,_0x5919('0xe'));logger[_0x5919('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b105a,_0x5919('0xe'),JSON['stringify'](_0x4d02b7));if(_0x4d02b7[_0x5919('0x10')]){if(_0x4d02b7[_0x5919('0x10')][_0x5919('0x11')]===0x1f4){logger[_0x5919('0x10')](_0x5919('0xd'),_0x2b105a,_0x4d02b7[_0x5919('0x10')][_0x5919('0x12')]);return _0x33e9b2(_0x4d02b7[_0x5919('0x10')][_0x5919('0x12')]);}logger['error'](_0x5919('0xd'),_0x2b105a,_0x4d02b7['error']['message']);return _0x247b87(_0x4d02b7[_0x5919('0x10')][_0x5919('0x12')]);}else{logger[_0x5919('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2b105a,_0x5919('0xe'));_0x247b87(_0x4d02b7[_0x5919('0x14')][_0x5919('0x12')]);}})['catch'](function(_0x29aa9d){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2b105a,_0x29aa9d);_0x33e9b2(_0x29aa9d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 8446653..0a4ba44 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 _0x6604=['multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x6604,0x6c));var _0x4660=function(_0x3632c9,_0x3ea29e){_0x3632c9=_0x3632c9-0x0;var _0x1cc20d=_0x6604[_0x3632c9];return _0x1cc20d;};'use strict';var multer=require(_0x4660('0x0'));var util=require(_0x4660('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4660('0x2'));var router=express[_0x4660('0x3')]();var fs_extra=require(_0x4660('0x4'));var auth=require(_0x4660('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4660('0x6'));var controller=require(_0x4660('0x7'));router[_0x4660('0x8')]('/',auth[_0x4660('0x9')](),controller[_0x4660('0xa')]);router[_0x4660('0x8')](_0x4660('0xb'),auth[_0x4660('0x9')](),controller[_0x4660('0xc')]);router[_0x4660('0xd')]('/',auth[_0x4660('0x9')](),controller['create']);router[_0x4660('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4660('0xf')]);router[_0x4660('0x10')](_0x4660('0xb'),auth['isAuthenticated'](),controller[_0x4660('0x11')]);module['exports']=router; \ No newline at end of file +var _0x91f7=['../../config/environment','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5c3598,_0x3eba5d){var _0x58d76a=function(_0x35813d){while(--_0x35813d){_0x5c3598['push'](_0x5c3598['shift']());}};_0x58d76a(++_0x3eba5d);}(_0x91f7,0x107));var _0x791f=function(_0x1ebbb9,_0x707661){_0x1ebbb9=_0x1ebbb9-0x0;var _0x50be6c=_0x91f7[_0x1ebbb9];return _0x50be6c;};'use strict';var multer=require('multer');var util=require(_0x791f('0x0'));var path=require(_0x791f('0x1'));var timeout=require(_0x791f('0x2'));var express=require(_0x791f('0x3'));var router=express[_0x791f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x791f('0x5'));var interaction=require(_0x791f('0x6'));var config=require(_0x791f('0x7'));var controller=require('./intZendeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x791f('0x8')]);router['get'](_0x791f('0x9'),auth[_0x791f('0xa')](),controller[_0x791f('0xb')]);router[_0x791f('0xc')]('/',auth[_0x791f('0xa')](),controller[_0x791f('0xd')]);router['put'](_0x791f('0x9'),auth['isAuthenticated'](),controller[_0x791f('0xe')]);router[_0x791f('0xf')](_0x791f('0x9'),auth['isAuthenticated'](),controller[_0x791f('0x10')]);module[_0x791f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e6030e9..707f569 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 _0xa947=['ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x57f9d4,_0x1dc4e1){var _0x30d75a=function(_0xb9f235){while(--_0xb9f235){_0x57f9d4['push'](_0x57f9d4['shift']());}};_0x30d75a(++_0x1dc4e1);}(_0xa947,0x181));var _0x7a94=function(_0x68b196,_0xf5d786){_0x68b196=_0x68b196-0x0;var _0x1de95a=_0xa947[_0x68b196];return _0x1de95a;};'use strict';var Sequelize=require(_0x7a94('0x0'));module[_0x7a94('0x1')]={'type':{'type':Sequelize[_0x7a94('0x2')](_0x7a94('0x3'),'variable',_0x7a94('0x4'),_0x7a94('0x5'),'picklist'),'defaultValue':_0x7a94('0x3')},'content':{'type':Sequelize[_0x7a94('0x6')]},'key':{'type':Sequelize[_0x7a94('0x6')]},'keyType':{'type':Sequelize[_0x7a94('0x2')]('string',_0x7a94('0x7'),_0x7a94('0x4'))},'keyContent':{'type':Sequelize[_0x7a94('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7a94('0x6')]},'customField':{'type':Sequelize[_0x7a94('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7a94('0x6')]}}; \ No newline at end of file +var _0x1071=['keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x3d71d8,_0x15d0b4){var _0x480319=function(_0x489d64){while(--_0x489d64){_0x3d71d8['push'](_0x3d71d8['shift']());}};_0x480319(++_0x15d0b4);}(_0x1071,0x181));var _0x1107=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1071[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x1107('0x0'));module[_0x1107('0x1')]={'type':{'type':Sequelize[_0x1107('0x2')](_0x1107('0x3'),'variable',_0x1107('0x4'),_0x1107('0x5'),_0x1107('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1107('0x7')]},'key':{'type':Sequelize[_0x1107('0x7')]},'keyType':{'type':Sequelize[_0x1107('0x2')]('string',_0x1107('0x8'),_0x1107('0x4'))},'keyContent':{'type':Sequelize[_0x1107('0x7')]},'idField':{'type':Sequelize[_0x1107('0x7')]},'nameField':{'type':Sequelize[_0x1107('0x7')]},'customField':{'type':Sequelize[_0x1107('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1107('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1213ec3..08e1fbf 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 _0x2ccd=['ZendeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map'];(function(_0x43b7f0,_0x378196){var _0x207a45=function(_0x194783){while(--_0x194783){_0x43b7f0['push'](_0x43b7f0['shift']());}};_0x207a45(++_0x378196);}(_0x2ccd,0x1e6));var _0xd2cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ccd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd2cc('0x0'));var rimraf=require(_0xd2cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2cc('0x2'));var rp=require(_0xd2cc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2cc('0x4'));var util=require(_0xd2cc('0x5'));var path=require(_0xd2cc('0x6'));var sox=require(_0xd2cc('0x7'));var csv=require(_0xd2cc('0x8'));var ejs=require(_0xd2cc('0x9'));var fs=require('fs');var fs_extra=require(_0xd2cc('0xa'));var _=require(_0xd2cc('0xb'));var squel=require(_0xd2cc('0xc'));var crypto=require(_0xd2cc('0xd'));var jsforce=require(_0xd2cc('0xe'));var deskjs=require(_0xd2cc('0xf'));var toCsv=require(_0xd2cc('0x8'));var querystring=require(_0xd2cc('0x10'));var Papa=require(_0xd2cc('0x11'));var Redis=require(_0xd2cc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd2cc('0x13'));var as=require(_0xd2cc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2cc('0x15'))(_0xd2cc('0x16'));var utils=require(_0xd2cc('0x17'));var config=require(_0xd2cc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2cc('0x19'))['db'];function respondWithStatusCode(_0x5cb42d,_0x276555){_0x276555=_0x276555||0xcc;return function(_0x24b2b8){if(_0x24b2b8){return _0x5cb42d['sendStatus'](_0x276555);}return _0x5cb42d[_0xd2cc('0x1a')](_0x276555)[_0xd2cc('0x1b')]();};}function respondWithResult(_0x2f97e1,_0x107d40){_0x107d40=_0x107d40||0xc8;return function(_0x219581){if(_0x219581){return _0x2f97e1[_0xd2cc('0x1a')](_0x107d40)[_0xd2cc('0x1c')](_0x219581);}};}function respondWithFilteredResult(_0x3d070d,_0x4aa5b2){return function(_0x22d86f){if(_0x22d86f){var _0x1257e6=typeof _0x4aa5b2[_0xd2cc('0x1d')]===_0xd2cc('0x1e')&&typeof _0x4aa5b2[_0xd2cc('0x1f')]===_0xd2cc('0x1e');var _0x49f878=_0x22d86f[_0xd2cc('0x20')];var _0x1295d6=_0x1257e6?0x0:_0x4aa5b2['offset'];var _0x3b6173=_0x1257e6?_0x22d86f[_0xd2cc('0x20')]:_0x4aa5b2[_0xd2cc('0x1d')]+_0x4aa5b2[_0xd2cc('0x1f')];var _0x146021;if(_0x3b6173>=_0x49f878){_0x3b6173=_0x49f878;_0x146021=0xc8;}else{_0x146021=0xce;}_0x3d070d[_0xd2cc('0x1a')](_0x146021);return _0x3d070d[_0xd2cc('0x21')](_0xd2cc('0x22'),_0x1295d6+'-'+_0x3b6173+'/'+_0x49f878)[_0xd2cc('0x1c')](_0x22d86f);}return null;};}function patchUpdates(_0x5d0d7e){return function(_0x4a27e5){try{jsonpatch[_0xd2cc('0x23')](_0x4a27e5,_0x5d0d7e,!![]);}catch(_0x521d1e){return BPromise[_0xd2cc('0x24')](_0x521d1e);}return _0x4a27e5['save']();};}function saveUpdates(_0x436732,_0x1c3b4e){return function(_0x3f8b5e){if(_0x3f8b5e){return _0x3f8b5e[_0xd2cc('0x25')](_0x436732)[_0xd2cc('0x26')](function(_0xa14cc9){return _0xa14cc9;});}return null;};}function removeEntity(_0x330854,_0x108ba6){return function(_0x2c7ffd){if(_0x2c7ffd){return _0x2c7ffd[_0xd2cc('0x27')]()[_0xd2cc('0x26')](function(){_0x330854['status'](0xcc)[_0xd2cc('0x1b')]();});}};}function handleEntityNotFound(_0x4518b7,_0x57fed3){return function(_0x48c1df){if(!_0x48c1df){_0x4518b7[_0xd2cc('0x28')](0x194);}return _0x48c1df;};}function handleError(_0x34a326,_0x138906){_0x138906=_0x138906||0x1f4;return function(_0x4d99f0){logger['error'](_0x4d99f0[_0xd2cc('0x29')]);if(_0x4d99f0[_0xd2cc('0x2a')]){delete _0x4d99f0[_0xd2cc('0x2a')];}_0x34a326['status'](_0x138906)[_0xd2cc('0x2b')](_0x4d99f0);};}exports[_0xd2cc('0x2c')]=function(_0x112788,_0x33f0cd){var _0x3cef82={},_0x3eaf62={},_0x1fa2c9={'count':0x0,'rows':[]};var _0x20b305=_[_0xd2cc('0x2d')](db[_0xd2cc('0x2e')][_0xd2cc('0x2f')],function(_0x1e19ec){return{'name':_0x1e19ec[_0xd2cc('0x30')],'type':_0x1e19ec[_0xd2cc('0x31')][_0xd2cc('0x32')]};});_0x3eaf62['model']=_[_0xd2cc('0x2d')](_0x20b305,_0xd2cc('0x2a'));_0x3eaf62[_0xd2cc('0x33')]=_[_0xd2cc('0x34')](_0x112788[_0xd2cc('0x33')]);_0x3eaf62[_0xd2cc('0x35')]=_[_0xd2cc('0x36')](_0x3eaf62['model'],_0x3eaf62[_0xd2cc('0x33')]);_0x3cef82[_0xd2cc('0x37')]=_[_0xd2cc('0x36')](_0x3eaf62[_0xd2cc('0x38')],qs['fields'](_0x112788[_0xd2cc('0x33')][_0xd2cc('0x39')]));_0x3cef82[_0xd2cc('0x37')]=_0x3cef82['attributes']['length']?_0x3cef82[_0xd2cc('0x37')]:_0x3eaf62[_0xd2cc('0x38')];if(!_0x112788[_0xd2cc('0x33')]['hasOwnProperty'](_0xd2cc('0x3a'))){_0x3cef82['limit']=qs[_0xd2cc('0x1f')](_0x112788[_0xd2cc('0x33')][_0xd2cc('0x1f')]);_0x3cef82[_0xd2cc('0x1d')]=qs['offset'](_0x112788[_0xd2cc('0x33')][_0xd2cc('0x1d')]);}_0x3cef82[_0xd2cc('0x3b')]=qs[_0xd2cc('0x3c')](_0x112788[_0xd2cc('0x33')]['sort']);_0x3cef82[_0xd2cc('0x3d')]=qs[_0xd2cc('0x35')](_[_0xd2cc('0x3e')](_0x112788[_0xd2cc('0x33')],_0x3eaf62[_0xd2cc('0x35')]),_0x20b305);if(_0x112788[_0xd2cc('0x33')][_0xd2cc('0x3f')]){_0x3cef82[_0xd2cc('0x3d')]=_['merge'](_0x3cef82['where'],{'$or':_[_0xd2cc('0x2d')](_0x20b305,function(_0x393618){if(_0x393618[_0xd2cc('0x31')]!==_0xd2cc('0x40')){var _0x3e0d91={};_0x3e0d91[_0x393618['name']]={'$like':'%'+_0x112788[_0xd2cc('0x33')][_0xd2cc('0x3f')]+'%'};return _0x3e0d91;}})});}_0x3cef82=_[_0xd2cc('0x41')]({},_0x3cef82,_0x112788[_0xd2cc('0x42')]);var _0x1b18ff={'where':_0x3cef82[_0xd2cc('0x3d')]};return db[_0xd2cc('0x2e')][_0xd2cc('0x20')](_0x1b18ff)['then'](function(_0x362176){_0x1fa2c9[_0xd2cc('0x20')]=_0x362176;if(_0x112788[_0xd2cc('0x33')][_0xd2cc('0x43')]){_0x3cef82['include']=[{'all':!![]}];}return db['ZendeskField'][_0xd2cc('0x44')](_0x3cef82);})[_0xd2cc('0x26')](function(_0x46923f){_0x1fa2c9['rows']=_0x46923f;return _0x1fa2c9;})[_0xd2cc('0x26')](respondWithFilteredResult(_0x33f0cd,_0x3cef82))[_0xd2cc('0x45')](handleError(_0x33f0cd,null));};exports[_0xd2cc('0x46')]=function(_0x3efe4b,_0x1d65bc){var _0x30e3ba={'raw':!![],'where':{'id':_0x3efe4b[_0xd2cc('0x47')]['id']}},_0x1c73d7={};_0x1c73d7[_0xd2cc('0x38')]=_[_0xd2cc('0x34')](db[_0xd2cc('0x2e')]['rawAttributes']);_0x1c73d7[_0xd2cc('0x33')]=_[_0xd2cc('0x34')](_0x3efe4b['query']);_0x1c73d7[_0xd2cc('0x35')]=_[_0xd2cc('0x36')](_0x1c73d7['model'],_0x1c73d7['query']);_0x30e3ba['attributes']=_['intersection'](_0x1c73d7[_0xd2cc('0x38')],qs['fields'](_0x3efe4b[_0xd2cc('0x33')]['fields']));_0x30e3ba['attributes']=_0x30e3ba[_0xd2cc('0x37')]['length']?_0x30e3ba[_0xd2cc('0x37')]:_0x1c73d7[_0xd2cc('0x38')];if(_0x3efe4b['query'][_0xd2cc('0x43')]){_0x30e3ba[_0xd2cc('0x48')]=[{'all':!![]}];}_0x30e3ba=_[_0xd2cc('0x41')]({},_0x30e3ba,_0x3efe4b['options']);return db[_0xd2cc('0x2e')][_0xd2cc('0x49')](_0x30e3ba)[_0xd2cc('0x26')](handleEntityNotFound(_0x1d65bc,null))[_0xd2cc('0x26')](respondWithResult(_0x1d65bc,null))[_0xd2cc('0x45')](handleError(_0x1d65bc,null));};exports[_0xd2cc('0x4a')]=function(_0x3040e2,_0x42b251){return db['ZendeskField']['create'](_0x3040e2[_0xd2cc('0x4b')],{})[_0xd2cc('0x26')](respondWithResult(_0x42b251,0xc9))['catch'](handleError(_0x42b251,null));};exports[_0xd2cc('0x25')]=function(_0x497f94,_0x1d8ca8){if(_0x497f94[_0xd2cc('0x4b')]['id']){delete _0x497f94[_0xd2cc('0x4b')]['id'];}return db[_0xd2cc('0x2e')]['find']({'where':{'id':_0x497f94[_0xd2cc('0x47')]['id']}})[_0xd2cc('0x26')](handleEntityNotFound(_0x1d8ca8,null))[_0xd2cc('0x26')](saveUpdates(_0x497f94[_0xd2cc('0x4b')],null))[_0xd2cc('0x26')](respondWithResult(_0x1d8ca8,null))[_0xd2cc('0x45')](handleError(_0x1d8ca8,null));};exports[_0xd2cc('0x27')]=function(_0x34e91a,_0x6518fa){return db[_0xd2cc('0x2e')][_0xd2cc('0x49')]({'where':{'id':_0x34e91a[_0xd2cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x6518fa,null))['then'](removeEntity(_0x6518fa,null))[_0xd2cc('0x45')](handleError(_0x6518fa,null));}; \ No newline at end of file +var _0xb962=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xb962,0x1ae));var _0x2b96=function(_0x28bb1d,_0x28cf00){_0x28bb1d=_0x28bb1d-0x0;var _0x2fc062=_0xb962[_0x28bb1d];return _0x2fc062;};'use strict';var emlformat=require(_0x2b96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b96('0x1'));var rp=require('request-promise');var moment=require(_0x2b96('0x2'));var BPromise=require(_0x2b96('0x3'));var Mustache=require(_0x2b96('0x4'));var util=require('util');var path=require(_0x2b96('0x5'));var sox=require(_0x2b96('0x6'));var csv=require(_0x2b96('0x7'));var ejs=require(_0x2b96('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2b96('0x9'));var crypto=require(_0x2b96('0xa'));var jsforce=require(_0x2b96('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2b96('0x7'));var querystring=require(_0x2b96('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b96('0xd'));var authService=require(_0x2b96('0xe'));var qs=require(_0x2b96('0xf'));var as=require(_0x2b96('0x10'));var hardwareService=require(_0x2b96('0x11'));var logger=require(_0x2b96('0x12'))(_0x2b96('0x13'));var utils=require('../../config/utils');var config=require(_0x2b96('0x14'));var licenseUtil=require(_0x2b96('0x15'));var db=require(_0x2b96('0x16'))['db'];function respondWithStatusCode(_0xd6d39b,_0x154059){_0x154059=_0x154059||0xcc;return function(_0x5464ab){if(_0x5464ab){return _0xd6d39b[_0x2b96('0x17')](_0x154059);}return _0xd6d39b[_0x2b96('0x18')](_0x154059)[_0x2b96('0x19')]();};}function respondWithResult(_0x53930a,_0x1ccc00){_0x1ccc00=_0x1ccc00||0xc8;return function(_0x622a03){if(_0x622a03){return _0x53930a[_0x2b96('0x18')](_0x1ccc00)[_0x2b96('0x1a')](_0x622a03);}};}function respondWithFilteredResult(_0x586964,_0x33f9f0){return function(_0x291419){if(_0x291419){var _0x2c648f=typeof _0x33f9f0[_0x2b96('0x1b')]==='undefined'&&typeof _0x33f9f0[_0x2b96('0x1c')]===_0x2b96('0x1d');var _0x28d78b=_0x291419['count'];var _0x4178d3=_0x2c648f?0x0:_0x33f9f0['offset'];var _0x2b714b=_0x2c648f?_0x291419[_0x2b96('0x1e')]:_0x33f9f0['offset']+_0x33f9f0[_0x2b96('0x1c')];var _0x1dbdd4;if(_0x2b714b>=_0x28d78b){_0x2b714b=_0x28d78b;_0x1dbdd4=0xc8;}else{_0x1dbdd4=0xce;}_0x586964[_0x2b96('0x18')](_0x1dbdd4);return _0x586964[_0x2b96('0x1f')](_0x2b96('0x20'),_0x4178d3+'-'+_0x2b714b+'/'+_0x28d78b)['json'](_0x291419);}return null;};}function patchUpdates(_0x835faa){return function(_0x48903a){try{jsonpatch[_0x2b96('0x21')](_0x48903a,_0x835faa,!![]);}catch(_0x1da653){return BPromise[_0x2b96('0x22')](_0x1da653);}return _0x48903a['save']();};}function saveUpdates(_0x3f0687,_0x524e4d){return function(_0x27a1b0){if(_0x27a1b0){return _0x27a1b0[_0x2b96('0x23')](_0x3f0687)[_0x2b96('0x24')](function(_0x292605){return _0x292605;});}return null;};}function removeEntity(_0x21364c,_0x1b6933){return function(_0x391ae9){if(_0x391ae9){return _0x391ae9[_0x2b96('0x25')]()[_0x2b96('0x24')](function(){_0x21364c[_0x2b96('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251e66,_0x1afac6){return function(_0x48fcfa){if(!_0x48fcfa){_0x251e66[_0x2b96('0x17')](0x194);}return _0x48fcfa;};}function handleError(_0x4c107a,_0x5b0945){_0x5b0945=_0x5b0945||0x1f4;return function(_0x12558d){logger[_0x2b96('0x26')](_0x12558d[_0x2b96('0x27')]);if(_0x12558d[_0x2b96('0x28')]){delete _0x12558d[_0x2b96('0x28')];}_0x4c107a[_0x2b96('0x18')](_0x5b0945)[_0x2b96('0x29')](_0x12558d);};}exports[_0x2b96('0x2a')]=function(_0x40e3c6,_0x373cab){var _0x2f0bb4={},_0x5f59cd={},_0x58c259={'count':0x0,'rows':[]};var _0x153b95=_['map'](db[_0x2b96('0x2b')][_0x2b96('0x2c')],function(_0x254067){return{'name':_0x254067[_0x2b96('0x2d')],'type':_0x254067[_0x2b96('0x2e')][_0x2b96('0x2f')]};});_0x5f59cd['model']=_[_0x2b96('0x30')](_0x153b95,'name');_0x5f59cd[_0x2b96('0x31')]=_[_0x2b96('0x32')](_0x40e3c6[_0x2b96('0x31')]);_0x5f59cd['filters']=_[_0x2b96('0x33')](_0x5f59cd[_0x2b96('0x34')],_0x5f59cd[_0x2b96('0x31')]);_0x2f0bb4[_0x2b96('0x35')]=_['intersection'](_0x5f59cd[_0x2b96('0x34')],qs[_0x2b96('0x36')](_0x40e3c6[_0x2b96('0x31')]['fields']));_0x2f0bb4['attributes']=_0x2f0bb4[_0x2b96('0x35')][_0x2b96('0x37')]?_0x2f0bb4[_0x2b96('0x35')]:_0x5f59cd[_0x2b96('0x34')];if(!_0x40e3c6[_0x2b96('0x31')][_0x2b96('0x38')](_0x2b96('0x39'))){_0x2f0bb4['limit']=qs[_0x2b96('0x1c')](_0x40e3c6[_0x2b96('0x31')][_0x2b96('0x1c')]);_0x2f0bb4['offset']=qs[_0x2b96('0x1b')](_0x40e3c6[_0x2b96('0x31')][_0x2b96('0x1b')]);}_0x2f0bb4[_0x2b96('0x3a')]=qs['sort'](_0x40e3c6[_0x2b96('0x31')][_0x2b96('0x3b')]);_0x2f0bb4['where']=qs[_0x2b96('0x3c')](_[_0x2b96('0x3d')](_0x40e3c6['query'],_0x5f59cd['filters']),_0x153b95);if(_0x40e3c6['query']['filter']){_0x2f0bb4[_0x2b96('0x3e')]=_['merge'](_0x2f0bb4[_0x2b96('0x3e')],{'$or':_[_0x2b96('0x30')](_0x153b95,function(_0x2c18e4){if(_0x2c18e4['type']!==_0x2b96('0x3f')){var _0x389494={};_0x389494[_0x2c18e4[_0x2b96('0x28')]]={'$like':'%'+_0x40e3c6['query'][_0x2b96('0x40')]+'%'};return _0x389494;}})});}_0x2f0bb4=_[_0x2b96('0x41')]({},_0x2f0bb4,_0x40e3c6[_0x2b96('0x42')]);var _0x31ae68={'where':_0x2f0bb4['where']};return db[_0x2b96('0x2b')][_0x2b96('0x1e')](_0x31ae68)[_0x2b96('0x24')](function(_0x1d9e78){_0x58c259[_0x2b96('0x1e')]=_0x1d9e78;if(_0x40e3c6[_0x2b96('0x31')]['includeAll']){_0x2f0bb4[_0x2b96('0x43')]=[{'all':!![]}];}return db[_0x2b96('0x2b')][_0x2b96('0x44')](_0x2f0bb4);})[_0x2b96('0x24')](function(_0x38512e){_0x58c259[_0x2b96('0x45')]=_0x38512e;return _0x58c259;})[_0x2b96('0x24')](respondWithFilteredResult(_0x373cab,_0x2f0bb4))['catch'](handleError(_0x373cab,null));};exports[_0x2b96('0x46')]=function(_0x4785c0,_0x2bc02c){var _0x320317={'raw':!![],'where':{'id':_0x4785c0[_0x2b96('0x47')]['id']}},_0x515c43={};_0x515c43['model']=_[_0x2b96('0x32')](db[_0x2b96('0x2b')][_0x2b96('0x2c')]);_0x515c43[_0x2b96('0x31')]=_[_0x2b96('0x32')](_0x4785c0[_0x2b96('0x31')]);_0x515c43[_0x2b96('0x3c')]=_['intersection'](_0x515c43[_0x2b96('0x34')],_0x515c43['query']);_0x320317[_0x2b96('0x35')]=_[_0x2b96('0x33')](_0x515c43[_0x2b96('0x34')],qs[_0x2b96('0x36')](_0x4785c0[_0x2b96('0x31')][_0x2b96('0x36')]));_0x320317[_0x2b96('0x35')]=_0x320317[_0x2b96('0x35')][_0x2b96('0x37')]?_0x320317[_0x2b96('0x35')]:_0x515c43[_0x2b96('0x34')];if(_0x4785c0[_0x2b96('0x31')][_0x2b96('0x48')]){_0x320317[_0x2b96('0x43')]=[{'all':!![]}];}_0x320317=_['merge']({},_0x320317,_0x4785c0[_0x2b96('0x42')]);return db[_0x2b96('0x2b')][_0x2b96('0x49')](_0x320317)[_0x2b96('0x24')](handleEntityNotFound(_0x2bc02c,null))[_0x2b96('0x24')](respondWithResult(_0x2bc02c,null))['catch'](handleError(_0x2bc02c,null));};exports['create']=function(_0x704d0f,_0x4fb4b0){return db[_0x2b96('0x2b')][_0x2b96('0x4a')](_0x704d0f[_0x2b96('0x4b')],{})['then'](respondWithResult(_0x4fb4b0,0xc9))[_0x2b96('0x4c')](handleError(_0x4fb4b0,null));};exports[_0x2b96('0x23')]=function(_0xc6acb9,_0x560ab2){if(_0xc6acb9['body']['id']){delete _0xc6acb9[_0x2b96('0x4b')]['id'];}return db[_0x2b96('0x2b')][_0x2b96('0x49')]({'where':{'id':_0xc6acb9['params']['id']}})[_0x2b96('0x24')](handleEntityNotFound(_0x560ab2,null))[_0x2b96('0x24')](saveUpdates(_0xc6acb9[_0x2b96('0x4b')],null))['then'](respondWithResult(_0x560ab2,null))[_0x2b96('0x4c')](handleError(_0x560ab2,null));};exports[_0x2b96('0x25')]=function(_0x2f7f87,_0xb67855){return db[_0x2b96('0x2b')][_0x2b96('0x49')]({'where':{'id':_0x2f7f87[_0x2b96('0x47')]['id']}})[_0x2b96('0x24')](handleEntityNotFound(_0xb67855,null))[_0x2b96('0x24')](removeEntity(_0xb67855,null))[_0x2b96('0x4c')](handleError(_0xb67855,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index eb46521..3ff2520 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 _0xcb99=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','FieldId','lodash','api','moment','path'];(function(_0x3c0766,_0x2e8d6b){var _0x2883ec=function(_0xe2068c){while(--_0xe2068c){_0x3c0766['push'](_0x3c0766['shift']());}};_0x2883ec(++_0x2e8d6b);}(_0xcb99,0x1d0));var _0x9cb9=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0xcb99[_0x50148e];return _0x446e9d;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9cb9('0x1'));var moment=require(_0x9cb9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cb9('0x3'));var rimraf=require(_0x9cb9('0x4'));var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module[_0x9cb9('0x7')]=function(_0x1fc622,_0x547cb4){return _0x1fc622[_0x9cb9('0x8')](_0x9cb9('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x9cb9('0xa'),'fields':['idField',_0x9cb9('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7dca=['path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3f6a80,_0x5362af){var _0x4d12a3=function(_0x4018ca){while(--_0x4018ca){_0x3f6a80['push'](_0x3f6a80['shift']());}};_0x4d12a3(++_0x5362af);}(_0x7dca,0x1ca));var _0xa7dc=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7dca[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xa7dc('0x0'));var util=require(_0xa7dc('0x1'));var logger=require(_0xa7dc('0x2'))(_0xa7dc('0x3'));var moment=require('moment');var BPromise=require(_0xa7dc('0x4'));var rp=require(_0xa7dc('0x5'));var fs=require('fs');var path=require(_0xa7dc('0x6'));var rimraf=require(_0xa7dc('0x7'));var config=require(_0xa7dc('0x8'));var attributes=require('./intZendeskField.attributes');module[_0xa7dc('0x9')]=function(_0x27e666,_0x26c983){return _0x27e666[_0xa7dc('0xa')](_0xa7dc('0xb'),attributes,{'tableName':_0xa7dc('0xc'),'paranoid':![],'indexes':[{'name':_0xa7dc('0xd'),'fields':[_0xa7dc('0xe'),_0xa7dc('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 1eb4386..03736b7 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 _0x48e9=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x48e9,0x69));var _0x948e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x48e9[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x948e('0x0'));var moment=require(_0x948e('0x1'));var BPromise=require(_0x948e('0x2'));var rs=require(_0x948e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x948e('0x4'))['db'];var utils=require(_0x948e('0x5'));var logger=require(_0x948e('0x6'))(_0x948e('0x7'));var config=require(_0x948e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x948e('0x9')][_0x948e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24b268,_0x33c5cf,_0xd87810){return new BPromise(function(_0x4277aa,_0x5dc025){return client['request'](_0x24b268,_0xd87810)[_0x948e('0xb')](function(_0x56aa82){logger['info'](_0x948e('0xc'),_0x33c5cf,_0x948e('0xd'));logger[_0x948e('0xe')](_0x948e('0xf'),_0x33c5cf,_0x948e('0xd'),JSON['stringify'](_0x56aa82));if(_0x56aa82[_0x948e('0x10')]){if(_0x56aa82['error'][_0x948e('0x11')]===0x1f4){logger['error'](_0x948e('0xc'),_0x33c5cf,_0x56aa82[_0x948e('0x10')]['message']);return _0x5dc025(_0x56aa82['error']['message']);}logger[_0x948e('0x10')](_0x948e('0xc'),_0x33c5cf,_0x56aa82[_0x948e('0x10')][_0x948e('0x12')]);return _0x4277aa(_0x56aa82[_0x948e('0x10')][_0x948e('0x12')]);}else{logger[_0x948e('0x13')](_0x948e('0xc'),_0x33c5cf,'request\x20sent');_0x4277aa(_0x56aa82[_0x948e('0x14')][_0x948e('0x12')]);}})[_0x948e('0x15')](function(_0x574184){logger[_0x948e('0x10')](_0x948e('0xc'),_0x33c5cf,_0x574184);_0x5dc025(_0x574184);});});} \ No newline at end of file +var _0x75db=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xe23d59,_0x2b81f9){var _0x4c26d9=function(_0x4ce648){while(--_0x4ce648){_0xe23d59['push'](_0xe23d59['shift']());}};_0x4c26d9(++_0x2b81f9);}(_0x75db,0x1a0));var _0xb75d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb75d('0x0'));var moment=require('moment');var BPromise=require(_0xb75d('0x1'));var rs=require(_0xb75d('0x2'));var fs=require('fs');var Redis=require(_0xb75d('0x3'));var db=require(_0xb75d('0x4'))['db'];var utils=require(_0xb75d('0x5'));var logger=require(_0xb75d('0x6'))(_0xb75d('0x7'));var config=require(_0xb75d('0x8'));var jayson=require(_0xb75d('0x9'));var client=jayson[_0xb75d('0xa')][_0xb75d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5846f5,_0x43c074,_0x39a2fc){return new BPromise(function(_0x1d3870,_0xcc30f5){return client['request'](_0x5846f5,_0x39a2fc)['then'](function(_0x3247fb){logger[_0xb75d('0xc')](_0xb75d('0xd'),_0x43c074,_0xb75d('0xe'));logger[_0xb75d('0xf')](_0xb75d('0x10'),_0x43c074,_0xb75d('0xe'),JSON[_0xb75d('0x11')](_0x3247fb));if(_0x3247fb[_0xb75d('0x12')]){if(_0x3247fb[_0xb75d('0x12')][_0xb75d('0x13')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x43c074,_0x3247fb[_0xb75d('0x12')]['message']);return _0xcc30f5(_0x3247fb[_0xb75d('0x12')]['message']);}logger[_0xb75d('0x12')](_0xb75d('0xd'),_0x43c074,_0x3247fb['error'][_0xb75d('0x14')]);return _0x1d3870(_0x3247fb[_0xb75d('0x12')][_0xb75d('0x14')]);}else{logger[_0xb75d('0xc')](_0xb75d('0xd'),_0x43c074,_0xb75d('0xe'));_0x1d3870(_0x3247fb[_0xb75d('0x15')][_0xb75d('0x14')]);}})[_0xb75d('0x16')](function(_0xaa4c3d){logger[_0xb75d('0x12')](_0xb75d('0xd'),_0x43c074,_0xaa4c3d);_0xcc30f5(_0xaa4c3d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 3662ac2..4fe5b41 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 _0x8bab=['index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated'];(function(_0x573d0e,_0x577ced){var _0x9d6026=function(_0x302625){while(--_0x302625){_0x573d0e['push'](_0x573d0e['shift']());}};_0x9d6026(++_0x577ced);}(_0x8bab,0x166));var _0xb8ba=function(_0x325047,_0x480544){_0x325047=_0x325047-0x0;var _0xf23107=_0x8bab[_0x325047];return _0xf23107;};'use strict';var multer=require(_0xb8ba('0x0'));var util=require(_0xb8ba('0x1'));var path=require(_0xb8ba('0x2'));var timeout=require('connect-timeout');var express=require(_0xb8ba('0x3'));var router=express['Router']();var fs_extra=require(_0xb8ba('0x4'));var auth=require(_0xb8ba('0x5'));var interaction=require(_0xb8ba('0x6'));var config=require(_0xb8ba('0x7'));var controller=require(_0xb8ba('0x8'));router['get']('/',auth[_0xb8ba('0x9')](),controller[_0xb8ba('0xa')]);router[_0xb8ba('0xb')](_0xb8ba('0xc'),auth[_0xb8ba('0x9')](),controller[_0xb8ba('0xd')]);router[_0xb8ba('0xb')](_0xb8ba('0xe'),auth[_0xb8ba('0x9')](),controller['getConfigurations']);router['get'](_0xb8ba('0xf'),auth['isAuthenticated'](),controller[_0xb8ba('0x10')]);router['post']('/',auth[_0xb8ba('0x9')](),controller[_0xb8ba('0x11')]);router[_0xb8ba('0x12')](_0xb8ba('0xe'),auth[_0xb8ba('0x9')](),controller['addConfiguration']);router[_0xb8ba('0x13')](_0xb8ba('0xc'),auth[_0xb8ba('0x9')](),controller['update']);router[_0xb8ba('0x14')](_0xb8ba('0xc'),auth['isAuthenticated'](),controller[_0xb8ba('0x15')]);module[_0xb8ba('0x16')]=router; \ No newline at end of file +var _0xc091=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2f02d4,_0x27b24a){var _0x4b707d=function(_0x52f3ba){while(--_0x52f3ba){_0x2f02d4['push'](_0x2f02d4['shift']());}};_0x4b707d(++_0x27b24a);}(_0xc091,0x1b3));var _0x1c09=function(_0x5186f5,_0x4e4d24){_0x5186f5=_0x5186f5-0x0;var _0x575a0d=_0xc091[_0x5186f5];return _0x575a0d;};'use strict';var multer=require(_0x1c09('0x0'));var util=require(_0x1c09('0x1'));var path=require(_0x1c09('0x2'));var timeout=require(_0x1c09('0x3'));var express=require(_0x1c09('0x4'));var router=express[_0x1c09('0x5')]();var fs_extra=require(_0x1c09('0x6'));var auth=require(_0x1c09('0x7'));var interaction=require(_0x1c09('0x8'));var config=require(_0x1c09('0x9'));var controller=require(_0x1c09('0xa'));router[_0x1c09('0xb')]('/',auth[_0x1c09('0xc')](),controller[_0x1c09('0xd')]);router[_0x1c09('0xb')](_0x1c09('0xe'),auth[_0x1c09('0xc')](),controller[_0x1c09('0xf')]);router[_0x1c09('0xb')](_0x1c09('0x10'),auth[_0x1c09('0xc')](),controller[_0x1c09('0x11')]);router[_0x1c09('0xb')](_0x1c09('0x12'),auth[_0x1c09('0xc')](),controller[_0x1c09('0x13')]);router[_0x1c09('0x14')]('/',auth[_0x1c09('0xc')](),controller[_0x1c09('0x15')]);router['post'](_0x1c09('0x10'),auth[_0x1c09('0xc')](),controller['addConfiguration']);router[_0x1c09('0x16')](_0x1c09('0xe'),auth[_0x1c09('0xc')](),controller[_0x1c09('0x17')]);router['delete'](_0x1c09('0xe'),auth[_0x1c09('0xc')](),controller[_0x1c09('0x18')]);module[_0x1c09('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0d271c1..e8acbc8 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 _0xf109=['exports','STRING','sequelize'];(function(_0x5aab88,_0x1bd532){var _0x4c73db=function(_0x1adc44){while(--_0x1adc44){_0x5aab88['push'](_0x5aab88['shift']());}};_0x4c73db(++_0x1bd532);}(_0xf109,0xce));var _0x9f10=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xf109[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file +var _0x99e9=['exports','STRING'];(function(_0x12fff4,_0x3f32b8){var _0x24b61b=function(_0x2a605f){while(--_0x2a605f){_0x12fff4['push'](_0x12fff4['shift']());}};_0x24b61b(++_0x3f32b8);}(_0x99e9,0xb4));var _0x999e=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x99e9[_0x33d4a2];return _0x2c793f;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index cc5d936..63cf56e 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 _0x25f5=['pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','ZohoConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Call_Result','Call_Start_Time','includes','api_name','custom_field','data_type','picklist'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x25f5,0x1f0));var _0x525f=function(_0x5dc0de,_0x25bba4){_0x5dc0de=_0x5dc0de-0x0;var _0x54ba0e=_0x25f5[_0x5dc0de];return _0x54ba0e;};'use strict';var emlformat=require(_0x525f('0x0'));var rimraf=require(_0x525f('0x1'));var zipdir=require(_0x525f('0x2'));var jsonpatch=require(_0x525f('0x3'));var rp=require(_0x525f('0x4'));var moment=require('moment');var BPromise=require(_0x525f('0x5'));var Mustache=require('mustache');var util=require(_0x525f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x525f('0x7'));var ejs=require(_0x525f('0x8'));var fs=require('fs');var fs_extra=require(_0x525f('0x9'));var _=require(_0x525f('0xa'));var squel=require(_0x525f('0xb'));var crypto=require(_0x525f('0xc'));var jsforce=require(_0x525f('0xd'));var deskjs=require(_0x525f('0xe'));var toCsv=require(_0x525f('0x7'));var querystring=require(_0x525f('0xf'));var Papa=require('papaparse');var Redis=require(_0x525f('0x10'));var authService=require(_0x525f('0x11'));var qs=require(_0x525f('0x12'));var as=require(_0x525f('0x13'));var hardwareService=require(_0x525f('0x14'));var logger=require('../../config/logger')(_0x525f('0x15'));var utils=require(_0x525f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x525f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c86e5,_0x3da01a){_0x3da01a=_0x3da01a||0xcc;return function(_0x2f4d0d){if(_0x2f4d0d){return _0x3c86e5['sendStatus'](_0x3da01a);}return _0x3c86e5['status'](_0x3da01a)[_0x525f('0x18')]();};}function respondWithResult(_0x2351c7,_0x2addd3){_0x2addd3=_0x2addd3||0xc8;return function(_0x3deb6d){if(_0x3deb6d){return _0x2351c7[_0x525f('0x19')](_0x2addd3)['json'](_0x3deb6d);}};}function respondWithFilteredResult(_0x472a80,_0x1a1ab3){return function(_0x3004a2){if(_0x3004a2){var _0x3aaf47=typeof _0x1a1ab3[_0x525f('0x1a')]==='undefined'&&typeof _0x1a1ab3[_0x525f('0x1b')]===_0x525f('0x1c');var _0x6141e4=_0x3004a2[_0x525f('0x1d')];var _0x5599ef=_0x3aaf47?0x0:_0x1a1ab3[_0x525f('0x1a')];var _0x2a9b66=_0x3aaf47?_0x3004a2[_0x525f('0x1d')]:_0x1a1ab3[_0x525f('0x1a')]+_0x1a1ab3[_0x525f('0x1b')];var _0x3e5ec1;if(_0x2a9b66>=_0x6141e4){_0x2a9b66=_0x6141e4;_0x3e5ec1=0xc8;}else{_0x3e5ec1=0xce;}_0x472a80[_0x525f('0x19')](_0x3e5ec1);return _0x472a80[_0x525f('0x1e')](_0x525f('0x1f'),_0x5599ef+'-'+_0x2a9b66+'/'+_0x6141e4)[_0x525f('0x20')](_0x3004a2);}return null;};}function patchUpdates(_0x42af86){return function(_0x49ae40){try{jsonpatch[_0x525f('0x21')](_0x49ae40,_0x42af86,!![]);}catch(_0x503915){return BPromise[_0x525f('0x22')](_0x503915);}return _0x49ae40['save']();};}function saveUpdates(_0x3da0a6,_0x47126c){return function(_0x4f469d){if(_0x4f469d){return _0x4f469d[_0x525f('0x23')](_0x3da0a6)[_0x525f('0x24')](function(_0x47f473){return _0x47f473;});}return null;};}function removeEntity(_0xa62c39,_0x4f6523){return function(_0x46ae22){if(_0x46ae22){return _0x46ae22[_0x525f('0x25')]()[_0x525f('0x24')](function(){_0xa62c39[_0x525f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ccb49,_0x48bb62){return function(_0x43d13c){if(!_0x43d13c){_0x4ccb49[_0x525f('0x26')](0x194);}return _0x43d13c;};}function handleError(_0x533671,_0x474c68){_0x474c68=_0x474c68||0x1f4;return function(_0x6bc8cb){logger[_0x525f('0x27')](_0x6bc8cb['stack']);if(_0x6bc8cb['name']){delete _0x6bc8cb[_0x525f('0x28')];}_0x533671[_0x525f('0x19')](_0x474c68)[_0x525f('0x29')](_0x6bc8cb);};}exports[_0x525f('0x2a')]=function(_0x1f0bfb,_0x44d9c8){var _0x562d43={},_0x4b184a={},_0x4a6cb8={'count':0x0,'rows':[]};var _0x47c4d0=_[_0x525f('0x2b')](db[_0x525f('0x2c')][_0x525f('0x2d')],function(_0x3d5c11){return{'name':_0x3d5c11[_0x525f('0x2e')],'type':_0x3d5c11[_0x525f('0x2f')][_0x525f('0x30')]};});_0x4b184a[_0x525f('0x31')]=_[_0x525f('0x2b')](_0x47c4d0,'name');_0x4b184a[_0x525f('0x32')]=_['keys'](_0x1f0bfb['query']);_0x4b184a[_0x525f('0x33')]=_[_0x525f('0x34')](_0x4b184a[_0x525f('0x31')],_0x4b184a[_0x525f('0x32')]);_0x562d43[_0x525f('0x35')]=_[_0x525f('0x34')](_0x4b184a[_0x525f('0x31')],qs[_0x525f('0x36')](_0x1f0bfb['query'][_0x525f('0x36')]));_0x562d43[_0x525f('0x35')]=_0x562d43[_0x525f('0x35')][_0x525f('0x37')]?_0x562d43[_0x525f('0x35')]:_0x4b184a[_0x525f('0x31')];if(!_0x1f0bfb['query'][_0x525f('0x38')](_0x525f('0x39'))){_0x562d43['limit']=qs[_0x525f('0x1b')](_0x1f0bfb[_0x525f('0x32')][_0x525f('0x1b')]);_0x562d43[_0x525f('0x1a')]=qs['offset'](_0x1f0bfb[_0x525f('0x32')][_0x525f('0x1a')]);}_0x562d43[_0x525f('0x3a')]=qs['sort'](_0x1f0bfb[_0x525f('0x32')][_0x525f('0x3b')]);_0x562d43[_0x525f('0x3c')]=qs[_0x525f('0x33')](_[_0x525f('0x3d')](_0x1f0bfb['query'],_0x4b184a[_0x525f('0x33')]),_0x47c4d0);if(_0x1f0bfb[_0x525f('0x32')][_0x525f('0x3e')]){_0x562d43['where']=_[_0x525f('0x3f')](_0x562d43[_0x525f('0x3c')],{'$or':_['map'](_0x47c4d0,function(_0x2200d8){if(_0x2200d8['type']!==_0x525f('0x40')){var _0x51439e={};_0x51439e[_0x2200d8[_0x525f('0x28')]]={'$like':'%'+_0x1f0bfb['query'][_0x525f('0x3e')]+'%'};return _0x51439e;}})});}_0x562d43=_[_0x525f('0x3f')]({},_0x562d43,_0x1f0bfb[_0x525f('0x41')]);var _0x37c9f6={'where':_0x562d43[_0x525f('0x3c')]};return db[_0x525f('0x2c')][_0x525f('0x1d')](_0x37c9f6)['then'](function(_0x37f5eb){_0x4a6cb8[_0x525f('0x1d')]=_0x37f5eb;if(_0x1f0bfb[_0x525f('0x32')][_0x525f('0x42')]){_0x562d43[_0x525f('0x43')]=[{'all':!![]}];}return db['ZohoAccount'][_0x525f('0x44')](_0x562d43);})[_0x525f('0x24')](function(_0x53a54e){_0x4a6cb8[_0x525f('0x45')]=_0x53a54e;return _0x4a6cb8;})[_0x525f('0x24')](respondWithFilteredResult(_0x44d9c8,_0x562d43))[_0x525f('0x46')](handleError(_0x44d9c8,null));};exports[_0x525f('0x47')]=function(_0x4759d8,_0x5e91d0){var _0x2171c9={'raw':![],'where':{'id':_0x4759d8[_0x525f('0x48')]['id']}},_0xd3aca8={};_0xd3aca8['model']=_[_0x525f('0x49')](db['ZohoAccount'][_0x525f('0x2d')]);_0xd3aca8[_0x525f('0x32')]=_['keys'](_0x4759d8['query']);_0xd3aca8[_0x525f('0x33')]=_['intersection'](_0xd3aca8[_0x525f('0x31')],_0xd3aca8['query']);_0x2171c9[_0x525f('0x35')]=_[_0x525f('0x34')](_0xd3aca8[_0x525f('0x31')],qs[_0x525f('0x36')](_0x4759d8[_0x525f('0x32')][_0x525f('0x36')]));_0x2171c9[_0x525f('0x35')]=_0x2171c9['attributes'][_0x525f('0x37')]?_0x2171c9[_0x525f('0x35')]:_0xd3aca8[_0x525f('0x31')];if(_0x4759d8[_0x525f('0x32')][_0x525f('0x42')]){_0x2171c9[_0x525f('0x43')]=[{'all':!![]}];}_0x2171c9=_[_0x525f('0x3f')]({},_0x2171c9,_0x4759d8['options']);return db[_0x525f('0x2c')][_0x525f('0x4a')](_0x2171c9)['then'](handleEntityNotFound(_0x5e91d0,null))[_0x525f('0x24')](respondWithResult(_0x5e91d0,null))[_0x525f('0x46')](handleError(_0x5e91d0,null));};exports[_0x525f('0x4b')]=function(_0x1886dc,_0x38b92f){return db[_0x525f('0x2c')][_0x525f('0x4b')](_0x1886dc[_0x525f('0x4c')],{})[_0x525f('0x24')](respondWithResult(_0x38b92f,0xc9))['catch'](handleError(_0x38b92f,null));};exports[_0x525f('0x23')]=function(_0x7e4e89,_0x1b88d5){if(_0x7e4e89[_0x525f('0x4c')]['id']){delete _0x7e4e89[_0x525f('0x4c')]['id'];}return db[_0x525f('0x2c')]['find']({'where':{'id':_0x7e4e89[_0x525f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b88d5,null))[_0x525f('0x24')](saveUpdates(_0x7e4e89['body'],null))['then'](respondWithResult(_0x1b88d5,null))['catch'](handleError(_0x1b88d5,null));};exports[_0x525f('0x25')]=function(_0x331aed,_0x4d29e7){return db['ZohoAccount']['find']({'where':{'id':_0x331aed[_0x525f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d29e7,null))[_0x525f('0x24')](removeEntity(_0x4d29e7,null))[_0x525f('0x46')](handleError(_0x4d29e7,null));};exports[_0x525f('0x4d')]=function(_0x16c9aa,_0x3a91a0,_0x57eebd){var _0x2fca3d={};var _0x10bb78={};var _0x2184c6;var _0x2a7e4b;return db[_0x525f('0x2c')][_0x525f('0x4e')]({'where':{'id':_0x16c9aa['params']['id']}})['then'](handleEntityNotFound(_0x3a91a0,null))[_0x525f('0x24')](function(_0x460f2e){if(_0x460f2e){_0x2184c6=_0x460f2e;_0x10bb78[_0x525f('0x31')]=_[_0x525f('0x49')](db[_0x525f('0x4f')][_0x525f('0x2d')]);_0x10bb78[_0x525f('0x32')]=_['keys'](_0x16c9aa[_0x525f('0x32')]);_0x10bb78['filters']=_[_0x525f('0x34')](_0x10bb78[_0x525f('0x31')],_0x10bb78[_0x525f('0x32')]);_0x2fca3d[_0x525f('0x35')]=_[_0x525f('0x34')](_0x10bb78[_0x525f('0x31')],qs[_0x525f('0x36')](_0x16c9aa['query'][_0x525f('0x36')]));_0x2fca3d[_0x525f('0x35')]=_0x2fca3d[_0x525f('0x35')][_0x525f('0x37')]?_0x2fca3d[_0x525f('0x35')]:_0x10bb78[_0x525f('0x31')];_0x2fca3d[_0x525f('0x3a')]=qs[_0x525f('0x3b')](_0x16c9aa[_0x525f('0x32')][_0x525f('0x3b')]);_0x2fca3d[_0x525f('0x3c')]=qs['filters'](_[_0x525f('0x3d')](_0x16c9aa[_0x525f('0x32')],_0x10bb78[_0x525f('0x33')]));if(_0x16c9aa[_0x525f('0x32')]['filter']){_0x2fca3d[_0x525f('0x3c')]=_['merge'](_0x2fca3d[_0x525f('0x3c')],{'$or':_[_0x525f('0x2b')](_0x2fca3d['attributes'],function(_0x1eb71e){var _0x4703ab={};_0x4703ab[_0x1eb71e]={'$like':'%'+_0x16c9aa[_0x525f('0x32')][_0x525f('0x3e')]+'%'};return _0x4703ab;})});}_0x2fca3d=_[_0x525f('0x3f')]({},_0x2fca3d,_0x16c9aa[_0x525f('0x41')]);return _0x2184c6['getConfigurations'](_0x2fca3d);}})[_0x525f('0x24')](function(_0x375498){if(_0x375498){_0x2a7e4b=_0x375498[_0x525f('0x37')];if(!_0x16c9aa[_0x525f('0x32')][_0x525f('0x38')](_0x525f('0x39'))){_0x2fca3d['limit']=qs[_0x525f('0x1b')](_0x16c9aa[_0x525f('0x32')]['limit']);_0x2fca3d[_0x525f('0x1a')]=qs[_0x525f('0x1a')](_0x16c9aa[_0x525f('0x32')]['offset']);}return _0x2184c6[_0x525f('0x4d')](_0x2fca3d);}})[_0x525f('0x24')](function(_0x2b3185){if(_0x2b3185){return _0x2b3185?{'count':_0x2a7e4b,'rows':_0x2b3185}:null;}})[_0x525f('0x24')](respondWithResult(_0x3a91a0,null))['catch'](handleError(_0x3a91a0,null));};exports['addConfiguration']=function(_0x50b1f7,_0x148088,_0xa7f9b9){if(_0x50b1f7['body']['id']){delete _0x50b1f7[_0x525f('0x4c')]['id'];}return db[_0x525f('0x2c')]['findOne']({'where':{'id':_0x50b1f7[_0x525f('0x48')]['id']}})[_0x525f('0x24')](handleEntityNotFound(_0x148088,null))[_0x525f('0x24')](function(_0x457f9e){if(_0x457f9e){_0x50b1f7[_0x525f('0x4c')][_0x525f('0x50')]=_0x457f9e['id'];_0x50b1f7[_0x525f('0x4c')][_0x525f('0x51')]=integrations[_0x525f('0x52')](_0x50b1f7[_0x525f('0x4c')]['channel'],_0x50b1f7['body'][_0x525f('0x2f')]);_0x50b1f7[_0x525f('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x50b1f7[_0x525f('0x4c')][_0x525f('0x53')],_0x50b1f7[_0x525f('0x4c')][_0x525f('0x2f')]);return db[_0x525f('0x4f')][_0x525f('0x4b')](_0x50b1f7[_0x525f('0x4c')],{'include':[{'model':db[_0x525f('0x54')],'as':_0x525f('0x51')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x525f('0x24')](respondWithResult(_0x148088,null))['catch'](handleError(_0x148088,null));};function getAccessToken(_0x3a1fea){return new Promise(function(_0x13977b,_0x454260){var _0x46e9df;switch(_0x3a1fea[_0x525f('0x55')]){case'US':_0x46e9df=_0x525f('0x56');break;case'AU':_0x46e9df=_0x525f('0x57');break;case'EU':_0x46e9df=_0x525f('0x58');break;case'IN':_0x46e9df=_0x525f('0x59');break;case'CN':_0x46e9df=_0x525f('0x5a');break;default:_0x46e9df=_0x525f('0x58');break;}var _0x130aaa={'method':_0x525f('0x5b'),'uri':_0x46e9df+_0x525f('0x5c'),'qs':{'refresh_token':_0x3a1fea[_0x525f('0x5d')],'client_id':_0x3a1fea[_0x525f('0x5e')],'client_secret':_0x3a1fea[_0x525f('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x130aaa)[_0x525f('0x24')](function(_0x3ae39f){if(_0x3ae39f[_0x525f('0x60')]){_0x13977b(_0x3ae39f[_0x525f('0x60')]);}else{_0x454260(_0x525f('0x61'));}})['catch'](function(_0x26e775){_0x454260(_0x26e775);});});}exports[_0x525f('0x62')]=function(_0x5d6d98,_0x4f7c73,_0x583770){var _0x3edcea,_0x55e560,_0x3e5d3d,_0x162eec,_0x1e8d52;return db[_0x525f('0x2c')][_0x525f('0x4e')]({'where':{'id':_0x5d6d98[_0x525f('0x48')]['id']},'attributes':['id',_0x525f('0x63'),_0x525f('0x55'),'clientId','clientSecret',_0x525f('0x64'),_0x525f('0x65'),'refreshToken']})[_0x525f('0x24')](handleEntityNotFound(_0x4f7c73,null))[_0x525f('0x24')](function(_0x55466d){_0x1e8d52=_0x55466d;_0x3edcea=_0x1e8d52[_0x525f('0x63')];_0x55e560=_0x3edcea==='zoho.eu'?'eu':_0x525f('0x66');_0x3e5d3d=_0x1e8d52['serverUrl'];var _0x50702f=_0x3e5d3d[_0x525f('0x67')](-0x1);if(_0x50702f==='/'||_0x50702f==='\x5c'||_0x50702f===':'){_0x3e5d3d=_0x3e5d3d['substring'](0x0,_0x3e5d3d[_0x525f('0x68')](_0x50702f));}if(!_0x1e8d52[_0x525f('0x5d')]){throw new Error(_0x525f('0x69'));}return getAccessToken(_0x1e8d52);})[_0x525f('0x24')](function(_0x597135){if(_0x597135){return rp({'method':_0x525f('0x6a'),'uri':util[_0x525f('0x6b')](_0x525f('0x6c'),_0x55e560),'qs':{'module':_0x525f('0x6d')},'headers':{'Authorization':_0x525f('0x6e')+_0x597135},'json':!![]});}})['then'](function(_0x333842){if(_0x333842){if(_0x333842[_0x525f('0x6f')]&&_0x333842[_0x525f('0x6f')]['error']){throw new Error(_0x333842[_0x525f('0x6f')][_0x525f('0x27')]['message']);}var _0x7f3744=[];var _0x27e91f=[];var _0x57dfc2=['Owner','Subject','Description','WhoId','Call_Duration',_0x525f('0x70'),_0x525f('0x71'),'Call_Type'];_0x27e91f=_['remove'](_0x333842[_0x525f('0x36')],function(_0x4ce75b){return _0x57dfc2[_0x525f('0x72')](_0x4ce75b[_0x525f('0x73')]);});for(var _0x1776b9=0x0;_0x1776b9<_0x27e91f[_0x525f('0x37')];_0x1776b9++){if(_0x27e91f[_0x1776b9]['system_mandatory']===![]){_0x7f3744['push']({'id':_0x27e91f[_0x1776b9]['id'],'name':_0x27e91f[_0x1776b9]['display_label'],'custom':_0x27e91f[_0x1776b9][_0x525f('0x74')],'options':_0x27e91f[_0x1776b9][_0x525f('0x75')]===_0x525f('0x76')&&_0x27e91f[_0x1776b9]['pick_list_values'][_0x525f('0x37')]>-0x1?_[_0x525f('0x2b')](_0x27e91f[_0x1776b9][_0x525f('0x77')],function(_0x20b057){return{'name':_0x20b057,'value':_0x20b057};}):[]});}}return{'count':_0x7f3744['length'],'rows':_0x7f3744};}else{return{'count':0x0,'rows':[]};}})[_0x525f('0x24')](respondWithResult(_0x4f7c73,null))[_0x525f('0x46')](function(_0x4b6ccd){var _0x5469b5=_0x5d6d98[_0x525f('0x32')][_0x525f('0x78')]?0x1f4:_0x4b6ccd['statusCode']||0x1f4;logger[_0x525f('0x27')](_0x525f('0x79'),'getFields',_0x5469b5,JSON['stringify'](_0x4b6ccd));delete _0x4b6ccd['name'];if(_0x5469b5===0x191){_0x5469b5=0x190;}_0x4f7c73[_0x525f('0x19')](_0x5469b5)['send'](_0x5d6d98[_0x525f('0x32')][_0x525f('0x78')]?{'message':_0x525f('0x7a'),'statusCode':_0x4b6ccd['statusCode']}:_0x4b6ccd);});}; \ No newline at end of file +var _0xe6e4=['params','find','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','host','serverUrl','code','zoho.eu','com','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x149ca2,_0x257b8d){var _0x478ac1=function(_0x5bdc71){while(--_0x5bdc71){_0x149ca2['push'](_0x149ca2['shift']());}};_0x478ac1(++_0x257b8d);}(_0xe6e4,0x13b));var _0x4e6e=function(_0x550a09,_0x54b8dc){_0x550a09=_0x550a09-0x0;var _0x4ca9cd=_0xe6e4[_0x550a09];return _0x4ca9cd;};'use strict';var emlformat=require(_0x4e6e('0x0'));var rimraf=require(_0x4e6e('0x1'));var zipdir=require(_0x4e6e('0x2'));var jsonpatch=require(_0x4e6e('0x3'));var rp=require(_0x4e6e('0x4'));var moment=require(_0x4e6e('0x5'));var BPromise=require(_0x4e6e('0x6'));var Mustache=require(_0x4e6e('0x7'));var util=require('util');var path=require(_0x4e6e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e6e('0x9'));var fs=require('fs');var fs_extra=require(_0x4e6e('0xa'));var _=require(_0x4e6e('0xb'));var squel=require('squel');var crypto=require(_0x4e6e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4e6e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e6e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4e6e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e6e('0x10'));var logger=require(_0x4e6e('0x11'))(_0x4e6e('0x12'));var utils=require(_0x4e6e('0x13'));var config=require(_0x4e6e('0x14'));var licenseUtil=require(_0x4e6e('0x15'));var db=require(_0x4e6e('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x350b78,_0x201235){_0x201235=_0x201235||0xcc;return function(_0xcf53ca){if(_0xcf53ca){return _0x350b78[_0x4e6e('0x17')](_0x201235);}return _0x350b78[_0x4e6e('0x18')](_0x201235)[_0x4e6e('0x19')]();};}function respondWithResult(_0x485873,_0x5a5c3c){_0x5a5c3c=_0x5a5c3c||0xc8;return function(_0xba1504){if(_0xba1504){return _0x485873[_0x4e6e('0x18')](_0x5a5c3c)[_0x4e6e('0x1a')](_0xba1504);}};}function respondWithFilteredResult(_0x24d57e,_0x2ac441){return function(_0x42ac5f){if(_0x42ac5f){var _0x1dee21=typeof _0x2ac441[_0x4e6e('0x1b')]==='undefined'&&typeof _0x2ac441[_0x4e6e('0x1c')]===_0x4e6e('0x1d');var _0x53ec47=_0x42ac5f[_0x4e6e('0x1e')];var _0x53a3a6=_0x1dee21?0x0:_0x2ac441[_0x4e6e('0x1b')];var _0x508854=_0x1dee21?_0x42ac5f[_0x4e6e('0x1e')]:_0x2ac441[_0x4e6e('0x1b')]+_0x2ac441[_0x4e6e('0x1c')];var _0x5aa411;if(_0x508854>=_0x53ec47){_0x508854=_0x53ec47;_0x5aa411=0xc8;}else{_0x5aa411=0xce;}_0x24d57e[_0x4e6e('0x18')](_0x5aa411);return _0x24d57e['set'](_0x4e6e('0x1f'),_0x53a3a6+'-'+_0x508854+'/'+_0x53ec47)['json'](_0x42ac5f);}return null;};}function patchUpdates(_0x42d461){return function(_0x3da49d){try{jsonpatch[_0x4e6e('0x20')](_0x3da49d,_0x42d461,!![]);}catch(_0x513743){return BPromise[_0x4e6e('0x21')](_0x513743);}return _0x3da49d[_0x4e6e('0x22')]();};}function saveUpdates(_0x303966,_0x85f92f){return function(_0xbc30c0){if(_0xbc30c0){return _0xbc30c0[_0x4e6e('0x23')](_0x303966)[_0x4e6e('0x24')](function(_0x111c51){return _0x111c51;});}return null;};}function removeEntity(_0x4b0616,_0x1e01a4){return function(_0x3d847f){if(_0x3d847f){return _0x3d847f[_0x4e6e('0x25')]()[_0x4e6e('0x24')](function(){_0x4b0616['status'](0xcc)[_0x4e6e('0x19')]();});}};}function handleEntityNotFound(_0x522f3e,_0x1078ad){return function(_0x353781){if(!_0x353781){_0x522f3e[_0x4e6e('0x17')](0x194);}return _0x353781;};}function handleError(_0x233376,_0x2dc97d){_0x2dc97d=_0x2dc97d||0x1f4;return function(_0x35a354){logger['error'](_0x35a354['stack']);if(_0x35a354[_0x4e6e('0x26')]){delete _0x35a354[_0x4e6e('0x26')];}_0x233376[_0x4e6e('0x18')](_0x2dc97d)['send'](_0x35a354);};}exports[_0x4e6e('0x27')]=function(_0x5d7b5b,_0x25b439){var _0x798ad5={},_0x12c6d1={},_0x1ec2e7={'count':0x0,'rows':[]};var _0x4f954f=_[_0x4e6e('0x28')](db[_0x4e6e('0x29')][_0x4e6e('0x2a')],function(_0x23ea62){return{'name':_0x23ea62[_0x4e6e('0x2b')],'type':_0x23ea62[_0x4e6e('0x2c')]['key']};});_0x12c6d1['model']=_[_0x4e6e('0x28')](_0x4f954f,'name');_0x12c6d1[_0x4e6e('0x2d')]=_[_0x4e6e('0x2e')](_0x5d7b5b[_0x4e6e('0x2d')]);_0x12c6d1[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x12c6d1[_0x4e6e('0x31')],_0x12c6d1['query']);_0x798ad5[_0x4e6e('0x32')]=_[_0x4e6e('0x30')](_0x12c6d1[_0x4e6e('0x31')],qs['fields'](_0x5d7b5b['query'][_0x4e6e('0x33')]));_0x798ad5[_0x4e6e('0x32')]=_0x798ad5[_0x4e6e('0x32')][_0x4e6e('0x34')]?_0x798ad5['attributes']:_0x12c6d1['model'];if(!_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x35')](_0x4e6e('0x36'))){_0x798ad5[_0x4e6e('0x1c')]=qs[_0x4e6e('0x1c')](_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x1c')]);_0x798ad5[_0x4e6e('0x1b')]=qs[_0x4e6e('0x1b')](_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x1b')]);}_0x798ad5[_0x4e6e('0x37')]=qs[_0x4e6e('0x38')](_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x38')]);_0x798ad5[_0x4e6e('0x39')]=qs[_0x4e6e('0x2f')](_[_0x4e6e('0x3a')](_0x5d7b5b[_0x4e6e('0x2d')],_0x12c6d1[_0x4e6e('0x2f')]),_0x4f954f);if(_0x5d7b5b['query'][_0x4e6e('0x3b')]){_0x798ad5[_0x4e6e('0x39')]=_[_0x4e6e('0x3c')](_0x798ad5[_0x4e6e('0x39')],{'$or':_[_0x4e6e('0x28')](_0x4f954f,function(_0x413668){if(_0x413668[_0x4e6e('0x2c')]!==_0x4e6e('0x3d')){var _0x2efac4={};_0x2efac4[_0x413668[_0x4e6e('0x26')]]={'$like':'%'+_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x3b')]+'%'};return _0x2efac4;}})});}_0x798ad5=_[_0x4e6e('0x3c')]({},_0x798ad5,_0x5d7b5b[_0x4e6e('0x3e')]);var _0x14fbb0={'where':_0x798ad5[_0x4e6e('0x39')]};return db[_0x4e6e('0x29')]['count'](_0x14fbb0)[_0x4e6e('0x24')](function(_0x3dd276){_0x1ec2e7[_0x4e6e('0x1e')]=_0x3dd276;if(_0x5d7b5b[_0x4e6e('0x2d')][_0x4e6e('0x3f')]){_0x798ad5[_0x4e6e('0x40')]=[{'all':!![]}];}return db[_0x4e6e('0x29')][_0x4e6e('0x41')](_0x798ad5);})[_0x4e6e('0x24')](function(_0xddb3c4){_0x1ec2e7[_0x4e6e('0x42')]=_0xddb3c4;return _0x1ec2e7;})[_0x4e6e('0x24')](respondWithFilteredResult(_0x25b439,_0x798ad5))[_0x4e6e('0x43')](handleError(_0x25b439,null));};exports[_0x4e6e('0x44')]=function(_0x236bd5,_0x4fe6a2){var _0x5e45cd={'raw':![],'where':{'id':_0x236bd5[_0x4e6e('0x45')]['id']}},_0x1b2688={};_0x1b2688[_0x4e6e('0x31')]=_[_0x4e6e('0x2e')](db['ZohoAccount'][_0x4e6e('0x2a')]);_0x1b2688[_0x4e6e('0x2d')]=_[_0x4e6e('0x2e')](_0x236bd5[_0x4e6e('0x2d')]);_0x1b2688[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x1b2688[_0x4e6e('0x31')],_0x1b2688[_0x4e6e('0x2d')]);_0x5e45cd[_0x4e6e('0x32')]=_[_0x4e6e('0x30')](_0x1b2688[_0x4e6e('0x31')],qs[_0x4e6e('0x33')](_0x236bd5[_0x4e6e('0x2d')][_0x4e6e('0x33')]));_0x5e45cd['attributes']=_0x5e45cd[_0x4e6e('0x32')][_0x4e6e('0x34')]?_0x5e45cd['attributes']:_0x1b2688[_0x4e6e('0x31')];if(_0x236bd5[_0x4e6e('0x2d')][_0x4e6e('0x3f')]){_0x5e45cd[_0x4e6e('0x40')]=[{'all':!![]}];}_0x5e45cd=_[_0x4e6e('0x3c')]({},_0x5e45cd,_0x236bd5[_0x4e6e('0x3e')]);return db[_0x4e6e('0x29')][_0x4e6e('0x46')](_0x5e45cd)[_0x4e6e('0x24')](handleEntityNotFound(_0x4fe6a2,null))[_0x4e6e('0x24')](respondWithResult(_0x4fe6a2,null))[_0x4e6e('0x43')](handleError(_0x4fe6a2,null));};exports[_0x4e6e('0x47')]=function(_0x31e4e1,_0x3e9240){return db[_0x4e6e('0x29')][_0x4e6e('0x47')](_0x31e4e1[_0x4e6e('0x48')],{})['then'](respondWithResult(_0x3e9240,0xc9))['catch'](handleError(_0x3e9240,null));};exports[_0x4e6e('0x23')]=function(_0x31122a,_0x2d7321){if(_0x31122a[_0x4e6e('0x48')]['id']){delete _0x31122a[_0x4e6e('0x48')]['id'];}return db[_0x4e6e('0x29')]['find']({'where':{'id':_0x31122a[_0x4e6e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d7321,null))[_0x4e6e('0x24')](saveUpdates(_0x31122a[_0x4e6e('0x48')],null))[_0x4e6e('0x24')](respondWithResult(_0x2d7321,null))[_0x4e6e('0x43')](handleError(_0x2d7321,null));};exports[_0x4e6e('0x25')]=function(_0x4d6fc4,_0x4c4fd6){return db[_0x4e6e('0x29')]['find']({'where':{'id':_0x4d6fc4[_0x4e6e('0x45')]['id']}})[_0x4e6e('0x24')](handleEntityNotFound(_0x4c4fd6,null))['then'](removeEntity(_0x4c4fd6,null))[_0x4e6e('0x43')](handleError(_0x4c4fd6,null));};exports['getConfigurations']=function(_0x2c260d,_0x45ab18,_0x716ac3){var _0x4c30ad={};var _0x208ca6={};var _0x1bcd4b;var _0x10e54d;return db[_0x4e6e('0x29')][_0x4e6e('0x49')]({'where':{'id':_0x2c260d[_0x4e6e('0x45')]['id']}})['then'](handleEntityNotFound(_0x45ab18,null))['then'](function(_0x54fb03){if(_0x54fb03){_0x1bcd4b=_0x54fb03;_0x208ca6[_0x4e6e('0x31')]=_['keys'](db[_0x4e6e('0x4a')]['rawAttributes']);_0x208ca6[_0x4e6e('0x2d')]=_[_0x4e6e('0x2e')](_0x2c260d[_0x4e6e('0x2d')]);_0x208ca6[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x208ca6[_0x4e6e('0x31')],_0x208ca6[_0x4e6e('0x2d')]);_0x4c30ad[_0x4e6e('0x32')]=_[_0x4e6e('0x30')](_0x208ca6['model'],qs['fields'](_0x2c260d[_0x4e6e('0x2d')]['fields']));_0x4c30ad[_0x4e6e('0x32')]=_0x4c30ad[_0x4e6e('0x32')]['length']?_0x4c30ad['attributes']:_0x208ca6[_0x4e6e('0x31')];_0x4c30ad[_0x4e6e('0x37')]=qs[_0x4e6e('0x38')](_0x2c260d[_0x4e6e('0x2d')][_0x4e6e('0x38')]);_0x4c30ad[_0x4e6e('0x39')]=qs[_0x4e6e('0x2f')](_['pick'](_0x2c260d[_0x4e6e('0x2d')],_0x208ca6['filters']));if(_0x2c260d[_0x4e6e('0x2d')][_0x4e6e('0x3b')]){_0x4c30ad[_0x4e6e('0x39')]=_[_0x4e6e('0x3c')](_0x4c30ad[_0x4e6e('0x39')],{'$or':_[_0x4e6e('0x28')](_0x4c30ad[_0x4e6e('0x32')],function(_0x17df43){var _0x2ae1bb={};_0x2ae1bb[_0x17df43]={'$like':'%'+_0x2c260d[_0x4e6e('0x2d')][_0x4e6e('0x3b')]+'%'};return _0x2ae1bb;})});}_0x4c30ad=_[_0x4e6e('0x3c')]({},_0x4c30ad,_0x2c260d[_0x4e6e('0x3e')]);return _0x1bcd4b[_0x4e6e('0x4b')](_0x4c30ad);}})['then'](function(_0x4e029e){if(_0x4e029e){_0x10e54d=_0x4e029e[_0x4e6e('0x34')];if(!_0x2c260d[_0x4e6e('0x2d')][_0x4e6e('0x35')](_0x4e6e('0x36'))){_0x4c30ad['limit']=qs[_0x4e6e('0x1c')](_0x2c260d['query'][_0x4e6e('0x1c')]);_0x4c30ad['offset']=qs[_0x4e6e('0x1b')](_0x2c260d['query'][_0x4e6e('0x1b')]);}return _0x1bcd4b[_0x4e6e('0x4b')](_0x4c30ad);}})['then'](function(_0x3cf866){if(_0x3cf866){return _0x3cf866?{'count':_0x10e54d,'rows':_0x3cf866}:null;}})[_0x4e6e('0x24')](respondWithResult(_0x45ab18,null))[_0x4e6e('0x43')](handleError(_0x45ab18,null));};exports[_0x4e6e('0x4c')]=function(_0xccdc84,_0x51cdcc,_0x5cbff6){if(_0xccdc84[_0x4e6e('0x48')]['id']){delete _0xccdc84[_0x4e6e('0x48')]['id'];}return db[_0x4e6e('0x29')][_0x4e6e('0x49')]({'where':{'id':_0xccdc84['params']['id']}})[_0x4e6e('0x24')](handleEntityNotFound(_0x51cdcc,null))[_0x4e6e('0x24')](function(_0x190b71){if(_0x190b71){_0xccdc84[_0x4e6e('0x48')][_0x4e6e('0x4d')]=_0x190b71['id'];_0xccdc84['body'][_0x4e6e('0x4e')]=integrations['getSubjects'](_0xccdc84['body']['channel'],_0xccdc84[_0x4e6e('0x48')][_0x4e6e('0x2c')]);_0xccdc84['body'][_0x4e6e('0x4f')]=integrations[_0x4e6e('0x50')](_0xccdc84[_0x4e6e('0x48')][_0x4e6e('0x51')],_0xccdc84[_0x4e6e('0x48')][_0x4e6e('0x2c')]);return db[_0x4e6e('0x4a')][_0x4e6e('0x47')](_0xccdc84[_0x4e6e('0x48')],{'include':[{'model':db[_0x4e6e('0x52')],'as':_0x4e6e('0x4e')},{'model':db['ZohoField'],'as':_0x4e6e('0x4f')}]});}return null;})[_0x4e6e('0x24')](respondWithResult(_0x51cdcc,null))['catch'](handleError(_0x51cdcc,null));};function getAccessToken(_0x37bf11){return new Promise(function(_0x3e4492,_0x2053d0){var _0x4682ff;switch(_0x37bf11[_0x4e6e('0x53')]){case'US':_0x4682ff=_0x4e6e('0x54');break;case'AU':_0x4682ff=_0x4e6e('0x55');break;case'EU':_0x4682ff='https://accounts.zoho.eu';break;case'IN':_0x4682ff=_0x4e6e('0x56');break;case'CN':_0x4682ff=_0x4e6e('0x57');break;default:_0x4682ff='https://accounts.zoho.eu';break;}var _0x637e89={'method':_0x4e6e('0x58'),'uri':_0x4682ff+'/oauth/v2/token','qs':{'refresh_token':_0x37bf11[_0x4e6e('0x59')],'client_id':_0x37bf11[_0x4e6e('0x5a')],'client_secret':_0x37bf11[_0x4e6e('0x5b')],'grant_type':_0x4e6e('0x5c')},'json':!![]};return rp(_0x637e89)[_0x4e6e('0x24')](function(_0x5b2dd7){if(_0x5b2dd7[_0x4e6e('0x5d')]){_0x3e4492(_0x5b2dd7[_0x4e6e('0x5d')]);}else{_0x2053d0('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x4e6e('0x43')](function(_0x5e9c2f){_0x2053d0(_0x5e9c2f);});});}exports['getFields']=function(_0xfe6259,_0x3937f5,_0x5a86d5){var _0x303cb6,_0xb01570,_0x144781,_0x30505c,_0x28c631;return db[_0x4e6e('0x29')][_0x4e6e('0x49')]({'where':{'id':_0xfe6259['params']['id']},'attributes':['id',_0x4e6e('0x5e'),'zone',_0x4e6e('0x5a'),_0x4e6e('0x5b'),_0x4e6e('0x5f'),_0x4e6e('0x60'),_0x4e6e('0x59')]})[_0x4e6e('0x24')](handleEntityNotFound(_0x3937f5,null))['then'](function(_0x15342e){_0x28c631=_0x15342e;_0x303cb6=_0x28c631[_0x4e6e('0x5e')];_0xb01570=_0x303cb6===_0x4e6e('0x61')?'eu':_0x4e6e('0x62');_0x144781=_0x28c631[_0x4e6e('0x5f')];var _0x4eb253=_0x144781[_0x4e6e('0x63')](-0x1);if(_0x4eb253==='/'||_0x4eb253==='\x5c'||_0x4eb253===':'){_0x144781=_0x144781['substring'](0x0,_0x144781['lastIndexOf'](_0x4eb253));}if(!_0x28c631[_0x4e6e('0x59')]){throw new Error(_0x4e6e('0x64'));}return getAccessToken(_0x28c631);})['then'](function(_0x7dba99){if(_0x7dba99){return rp({'method':_0x4e6e('0x65'),'uri':util[_0x4e6e('0x66')](_0x4e6e('0x67'),_0xb01570),'qs':{'module':_0x4e6e('0x68')},'headers':{'Authorization':_0x4e6e('0x69')+_0x7dba99},'json':!![]});}})['then'](function(_0x16662c){if(_0x16662c){if(_0x16662c[_0x4e6e('0x6a')]&&_0x16662c[_0x4e6e('0x6a')][_0x4e6e('0x6b')]){throw new Error(_0x16662c[_0x4e6e('0x6a')]['error']['message']);}var _0x295c46=[];var _0x2a5d6b=[];var _0x3c8644=['Owner',_0x4e6e('0x6c'),_0x4e6e('0x6d'),_0x4e6e('0x6e'),_0x4e6e('0x6f'),_0x4e6e('0x70'),_0x4e6e('0x71'),_0x4e6e('0x72')];_0x2a5d6b=_[_0x4e6e('0x73')](_0x16662c['fields'],function(_0x3fc102){return _0x3c8644[_0x4e6e('0x74')](_0x3fc102['api_name']);});for(var _0x34ab1b=0x0;_0x34ab1b<_0x2a5d6b['length'];_0x34ab1b++){if(_0x2a5d6b[_0x34ab1b]['system_mandatory']===![]){_0x295c46['push']({'id':_0x2a5d6b[_0x34ab1b]['id'],'name':_0x2a5d6b[_0x34ab1b][_0x4e6e('0x75')],'custom':_0x2a5d6b[_0x34ab1b]['custom_field'],'options':_0x2a5d6b[_0x34ab1b][_0x4e6e('0x76')]===_0x4e6e('0x77')&&_0x2a5d6b[_0x34ab1b][_0x4e6e('0x78')]['length']>-0x1?_['map'](_0x2a5d6b[_0x34ab1b][_0x4e6e('0x78')],function(_0x1d2f9d){return{'name':_0x1d2f9d,'value':_0x1d2f9d};}):[]});}}return{'count':_0x295c46[_0x4e6e('0x34')],'rows':_0x295c46};}else{return{'count':0x0,'rows':[]};}})[_0x4e6e('0x24')](respondWithResult(_0x3937f5,null))[_0x4e6e('0x43')](function(_0x443f4b){var _0x50a98d=_0xfe6259[_0x4e6e('0x2d')][_0x4e6e('0x79')]?0x1f4:_0x443f4b[_0x4e6e('0x7a')]||0x1f4;logger[_0x4e6e('0x6b')](_0x4e6e('0x7b'),_0x4e6e('0x7c'),_0x50a98d,JSON[_0x4e6e('0x7d')](_0x443f4b));delete _0x443f4b[_0x4e6e('0x26')];if(_0x50a98d===0x191){_0x50a98d=0x190;}_0x3937f5['status'](_0x50a98d)[_0x4e6e('0x7e')](_0xfe6259['query']['test']?{'message':_0x4e6e('0x7f'),'statusCode':_0x443f4b[_0x4e6e('0x7a')]}:_0x443f4b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c1477d7..c1c2e3b 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 _0xe9c6=['name','inspect','https://accounts.zoho.eu','authorization_code','parse','util','api','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xe9c6,0xa9));var _0x6e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6e9c('0x0'));var logger=require('../../config/logger')(_0x6e9c('0x1'));var moment=require('moment');var BPromise=require(_0x6e9c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e9c('0x3'));var rimraf=require('rimraf');var config=require(_0x6e9c('0x4'));var attributes=require(_0x6e9c('0x5'));var integrations=require(_0x6e9c('0x6'));module[_0x6e9c('0x7')]=function(_0x10f69a,_0x359bee){return _0x10f69a[_0x6e9c('0x8')](_0x6e9c('0x9'),attributes,{'tableName':_0x6e9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xfd8935,_0x22a772,_0x1af13d){if(_0xfd8935[_0x6e9c('0xb')](_0x6e9c('0xc'))||_0xfd8935[_0x6e9c('0xb')](_0x6e9c('0xd'))||_0xfd8935[_0x6e9c('0xb')](_0x6e9c('0xe'))||_0xfd8935[_0x6e9c('0xb')](_0x6e9c('0xf'))||_0xfd8935['changed']('code')||_0xfd8935['changed'](_0x6e9c('0x10'))){var _0x476b74,_0x5b4987;_0x476b74=_0xfd8935['serverUrl'];var _0x4ae5e8=_0x476b74[_0x6e9c('0x11')](-0x1);if(_0x4ae5e8==='/'||_0x4ae5e8==='\x5c'||_0x4ae5e8===':'){_0x476b74=_0x476b74[_0x6e9c('0x12')](0x0,_0x476b74[_0x6e9c('0x13')](_0x4ae5e8));}switch(_0xfd8935[_0x6e9c('0xc')]){case'US':_0x5b4987=_0x6e9c('0x14');break;case'AU':_0x5b4987=_0x6e9c('0x15');break;case'IN':_0x5b4987=_0x6e9c('0x16');break;case'CN':_0x5b4987=_0x6e9c('0x17');break;default:_0x5b4987='https://accounts.zoho.eu';break;}var _0x5c499c={'method':_0x6e9c('0x18'),'uri':_0x5b4987+_0x6e9c('0x19'),'form':{'grant_type':'authorization_code','client_id':_0xfd8935[_0x6e9c('0xe')],'client_secret':_0xfd8935['clientSecret'],'redirect_uri':_0xfd8935['serverUrl'],'code':_0xfd8935[_0x6e9c('0x1a')]},'headers':{'Content-Type':_0x6e9c('0x1b')}};return rp(_0x5c499c)[_0x6e9c('0x1c')](function(_0x23ebd8){var _0x191038=JSON['parse'](_0x23ebd8);if(_0x191038[_0x6e9c('0x1d')]){_0xfd8935[_0x6e9c('0x1e')]=_0x191038['refresh_token'];logger[_0x6e9c('0x1f')](util[_0x6e9c('0x20')](_0x6e9c('0x21'),_0xfd8935['name'],_0xfd8935['id']));}else{logger[_0x6e9c('0x22')](util[_0x6e9c('0x20')](_0x6e9c('0x23'),_0xfd8935[_0x6e9c('0x24')],_0xfd8935['id']),util[_0x6e9c('0x25')](_0x191038,{'showHidden':![],'depth':null}));}return _0x1af13d(null,_0x22a772);})['catch'](function(_0x308c74){logger[_0x6e9c('0x22')](util[_0x6e9c('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xfd8935[_0x6e9c('0x24')],_0xfd8935['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1af13d(_0x308c74);});}else{return _0x1af13d(null,_0x22a772);}},'beforeUpdate':function(_0x35c77d,_0x3edee9,_0x5cc91f){if(_0x35c77d[_0x6e9c('0xb')](_0x6e9c('0xc'))||_0x35c77d[_0x6e9c('0xb')](_0x6e9c('0xd'))||_0x35c77d[_0x6e9c('0xb')]('clientId')||_0x35c77d[_0x6e9c('0xb')](_0x6e9c('0xf'))||_0x35c77d['changed'](_0x6e9c('0x1a'))||_0x35c77d['changed'](_0x6e9c('0x10'))){var _0x2b4f11,_0x36f67b;_0x2b4f11=_0x35c77d[_0x6e9c('0xd')];var _0x31586b=_0x2b4f11[_0x6e9c('0x11')](-0x1);if(_0x31586b==='/'||_0x31586b==='\x5c'||_0x31586b===':'){_0x2b4f11=_0x2b4f11[_0x6e9c('0x12')](0x0,_0x2b4f11[_0x6e9c('0x13')](_0x31586b));}switch(_0x35c77d['zone']){case'US':_0x36f67b=_0x6e9c('0x14');break;case'AU':_0x36f67b=_0x6e9c('0x15');break;case'IN':_0x36f67b=_0x6e9c('0x16');break;case'CN':_0x36f67b=_0x6e9c('0x17');break;default:_0x36f67b=_0x6e9c('0x26');break;}var _0x49e097={'method':'POST','uri':_0x36f67b+_0x6e9c('0x19'),'form':{'grant_type':_0x6e9c('0x27'),'client_id':_0x35c77d[_0x6e9c('0xe')],'client_secret':_0x35c77d[_0x6e9c('0xf')],'redirect_uri':_0x35c77d[_0x6e9c('0xd')],'code':_0x35c77d[_0x6e9c('0x1a')]},'headers':{'Content-Type':_0x6e9c('0x1b')}};return rp(_0x49e097)[_0x6e9c('0x1c')](function(_0x462ed3){var _0x447071=JSON[_0x6e9c('0x28')](_0x462ed3);if(_0x447071[_0x6e9c('0x1d')]){_0x35c77d[_0x6e9c('0x1e')]=_0x447071['refresh_token'];logger['info'](util[_0x6e9c('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x35c77d[_0x6e9c('0x24')],_0x35c77d['id']));}else{logger[_0x6e9c('0x22')](util['format'](_0x6e9c('0x23'),_0x35c77d['name'],_0x35c77d['id']),util[_0x6e9c('0x25')](_0x447071,{'showHidden':![],'depth':null}));}return _0x5cc91f(null,_0x3edee9);})['catch'](function(_0xd412e4){logger[_0x6e9c('0x22')](util['format'](_0x6e9c('0x23'),_0x35c77d['name'],_0x35c77d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5cc91f(_0xd412e4);});}else{return _0x5cc91f(null,_0x3edee9);}}}});}; \ No newline at end of file +var _0x5b7d=['./intZohoAccount.attributes','../../components/integrations/configuration','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','refresh_token','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','https://accounts.zoho.com','https://accounts.zoho.in','then','parse','info','catch','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5b7d,0x1bb));var _0xd5b7=function(_0x280e40,_0x145257){_0x280e40=_0x280e40-0x0;var _0x18a855=_0x5b7d[_0x280e40];return _0x18a855;};'use strict';var _=require(_0xd5b7('0x0'));var util=require(_0xd5b7('0x1'));var logger=require(_0xd5b7('0x2'))(_0xd5b7('0x3'));var moment=require(_0xd5b7('0x4'));var BPromise=require('bluebird');var rp=require(_0xd5b7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5b7('0x6'));var config=require(_0xd5b7('0x7'));var attributes=require(_0xd5b7('0x8'));var integrations=require(_0xd5b7('0x9'));module['exports']=function(_0x9b3bfd,_0x3ec5e9){return _0x9b3bfd['define']('ZohoAccount',attributes,{'tableName':_0xd5b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1298f8,_0x34b7fe,_0x1823b6){if(_0x1298f8[_0xd5b7('0xb')](_0xd5b7('0xc'))||_0x1298f8[_0xd5b7('0xb')](_0xd5b7('0xd'))||_0x1298f8[_0xd5b7('0xb')](_0xd5b7('0xe'))||_0x1298f8['changed'](_0xd5b7('0xf'))||_0x1298f8[_0xd5b7('0xb')]('code')||_0x1298f8[_0xd5b7('0xb')](_0xd5b7('0x10'))){var _0x330732,_0x1547f8;_0x330732=_0x1298f8[_0xd5b7('0xd')];var _0x4a4d4d=_0x330732[_0xd5b7('0x11')](-0x1);if(_0x4a4d4d==='/'||_0x4a4d4d==='\x5c'||_0x4a4d4d===':'){_0x330732=_0x330732[_0xd5b7('0x12')](0x0,_0x330732[_0xd5b7('0x13')](_0x4a4d4d));}switch(_0x1298f8[_0xd5b7('0xc')]){case'US':_0x1547f8='https://accounts.zoho.com';break;case'AU':_0x1547f8=_0xd5b7('0x14');break;case'IN':_0x1547f8='https://accounts.zoho.in';break;case'CN':_0x1547f8=_0xd5b7('0x15');break;default:_0x1547f8=_0xd5b7('0x16');break;}var _0x52b372={'method':_0xd5b7('0x17'),'uri':_0x1547f8+_0xd5b7('0x18'),'form':{'grant_type':_0xd5b7('0x19'),'client_id':_0x1298f8['clientId'],'client_secret':_0x1298f8[_0xd5b7('0xf')],'redirect_uri':_0x1298f8[_0xd5b7('0xd')],'code':_0x1298f8[_0xd5b7('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x52b372)['then'](function(_0x5aa8df){var _0x4a8683=JSON['parse'](_0x5aa8df);if(_0x4a8683[_0xd5b7('0x1b')]){_0x1298f8[_0xd5b7('0x1c')]=_0x4a8683[_0xd5b7('0x1b')];logger['info'](util[_0xd5b7('0x1d')](_0xd5b7('0x1e'),_0x1298f8[_0xd5b7('0x1f')],_0x1298f8['id']));}else{logger[_0xd5b7('0x20')](util[_0xd5b7('0x1d')](_0xd5b7('0x21'),_0x1298f8[_0xd5b7('0x1f')],_0x1298f8['id']),util[_0xd5b7('0x22')](_0x4a8683,{'showHidden':![],'depth':null}));}return _0x1823b6(null,_0x34b7fe);})['catch'](function(_0x299c3d){logger[_0xd5b7('0x20')](util[_0xd5b7('0x1d')](_0xd5b7('0x21'),_0x1298f8[_0xd5b7('0x1f')],_0x1298f8['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1823b6(_0x299c3d);});}else{return _0x1823b6(null,_0x34b7fe);}},'beforeUpdate':function(_0x3029b0,_0x5f2d9c,_0x54fad4){if(_0x3029b0[_0xd5b7('0xb')](_0xd5b7('0xc'))||_0x3029b0[_0xd5b7('0xb')]('serverUrl')||_0x3029b0['changed'](_0xd5b7('0xe'))||_0x3029b0[_0xd5b7('0xb')]('clientSecret')||_0x3029b0[_0xd5b7('0xb')](_0xd5b7('0x1a'))||_0x3029b0[_0xd5b7('0xb')]('host')){var _0x224bf3,_0x145420;_0x224bf3=_0x3029b0['serverUrl'];var _0x241943=_0x224bf3[_0xd5b7('0x11')](-0x1);if(_0x241943==='/'||_0x241943==='\x5c'||_0x241943===':'){_0x224bf3=_0x224bf3[_0xd5b7('0x12')](0x0,_0x224bf3[_0xd5b7('0x13')](_0x241943));}switch(_0x3029b0[_0xd5b7('0xc')]){case'US':_0x145420=_0xd5b7('0x23');break;case'AU':_0x145420='https://accounts.zoho.com.au';break;case'IN':_0x145420=_0xd5b7('0x24');break;case'CN':_0x145420=_0xd5b7('0x15');break;default:_0x145420=_0xd5b7('0x16');break;}var _0xb0f981={'method':_0xd5b7('0x17'),'uri':_0x145420+_0xd5b7('0x18'),'form':{'grant_type':_0xd5b7('0x19'),'client_id':_0x3029b0[_0xd5b7('0xe')],'client_secret':_0x3029b0[_0xd5b7('0xf')],'redirect_uri':_0x3029b0[_0xd5b7('0xd')],'code':_0x3029b0[_0xd5b7('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0xb0f981)[_0xd5b7('0x25')](function(_0x394e3e){var _0xd331d6=JSON[_0xd5b7('0x26')](_0x394e3e);if(_0xd331d6[_0xd5b7('0x1b')]){_0x3029b0[_0xd5b7('0x1c')]=_0xd331d6['refresh_token'];logger[_0xd5b7('0x27')](util['format'](_0xd5b7('0x1e'),_0x3029b0[_0xd5b7('0x1f')],_0x3029b0['id']));}else{logger[_0xd5b7('0x20')](util['format'](_0xd5b7('0x21'),_0x3029b0[_0xd5b7('0x1f')],_0x3029b0['id']),util['inspect'](_0xd331d6,{'showHidden':![],'depth':null}));}return _0x54fad4(null,_0x5f2d9c);})[_0xd5b7('0x28')](function(_0x3a7d00){logger[_0xd5b7('0x20')](util[_0xd5b7('0x1d')](_0xd5b7('0x21'),_0x3029b0[_0xd5b7('0x1f')],_0x3029b0['id']),util[_0xd5b7('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x54fad4(_0x3a7d00);});}else{return _0x54fad4(null,_0x5f2d9c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 77cb375..3b3c5d2 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 _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowZohoAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4bd3,0x174));var _0x34bd=function(_0x4c61c3,_0x182d1b){_0x4c61c3=_0x4c61c3-0x0;var _0x4da9f2=_0x4bd3[_0x4c61c3];return _0x4da9f2;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')]({'raw':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options'][_0x34bd('0x19')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x1a')]||null:null,'include':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options']['include']?_['map'](_0x3b4bf8['options'][_0x34bd('0x1b')],function(_0x503a60){return{'model':db[_0x503a60[_0x34bd('0x1c')]],'as':_0x503a60['as'],'attributes':_0x503a60[_0x34bd('0x19')],'include':_0x503a60[_0x34bd('0x1b')]?_['map'](_0x503a60[_0x34bd('0x1b')],function(_0x14479a){return{'model':db[_0x14479a[_0x34bd('0x1c')]],'as':_0x14479a['as'],'attributes':_0x14479a[_0x34bd('0x19')],'include':_0x14479a['include']?_[_0x34bd('0x1d')](_0x14479a[_0x34bd('0x1b')],function(_0x264c94){return{'model':db[_0x264c94[_0x34bd('0x1c')]],'as':_0x264c94['as'],'attributes':_0x264c94['attributes']};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x3fe8b0){logger['info'](_0x34bd('0x13'),_0x3b4bf8);logger[_0x34bd('0xc')](_0x34bd('0x13'),_0x3b4bf8,JSON[_0x34bd('0x1e')](_0x3fe8b0));_0x4b5ebb(_0x3fe8b0);})[_0x34bd('0x12')](function(_0x4500c8){logger[_0x34bd('0xe')]('GetZohoAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowZohoAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['ZohoAccount'][_0x34bd('0x1f')]({'raw':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x38bdba['options']?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x19')]||null:null,'include':_0x38bdba[_0x34bd('0x16')]?_0x38bdba['options'][_0x34bd('0x1b')]?_['map'](_0x38bdba[_0x34bd('0x16')][_0x34bd('0x1b')],function(_0xf12ee6){return{'model':db[_0xf12ee6['model']],'as':_0xf12ee6['as'],'attributes':_0xf12ee6[_0x34bd('0x19')],'include':_0xf12ee6[_0x34bd('0x1b')]?_['map'](_0xf12ee6[_0x34bd('0x1b')],function(_0x21c7d6){return{'model':db[_0x21c7d6[_0x34bd('0x1c')]],'as':_0x21c7d6['as'],'attributes':_0x21c7d6['attributes'],'include':_0x21c7d6[_0x34bd('0x1b')]?_[_0x34bd('0x1d')](_0x21c7d6['include'],function(_0x117188){return{'model':db[_0x117188[_0x34bd('0x1c')]],'as':_0x117188['as'],'attributes':_0x117188[_0x34bd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x320643){logger[_0x34bd('0xa')]('ShowZohoAccount',_0x38bdba);logger['debug']('ShowZohoAccount',_0x38bdba,JSON[_0x34bd('0x1e')](_0x320643));_0xd176f7(_0x320643);})[_0x34bd('0x12')](function(_0x5e30c5){logger['error'](_0x34bd('0x20'),_0x5e30c5['message'],_0x38bdba);_0x536b2c(_0xca9897['error'](0x1f4,_0x5e30c5[_0x34bd('0x10')]));});});}; \ No newline at end of file +var _0x3e0c=['ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZohoAccount'];(function(_0x5243cf,_0x4c43fa){var _0x25d65b=function(_0x45ea7e){while(--_0x45ea7e){_0x5243cf['push'](_0x5243cf['shift']());}};_0x25d65b(++_0x4c43fa);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x4471c2,_0x531995){_0x4471c2=_0x4471c2-0x0;var _0x15361c=_0x3e0c[_0x4471c2];return _0x15361c;};'use strict';var _=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var moment=require(_0xc3e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e0('0x3'));var fs=require('fs');var Redis=require(_0xc3e0('0x4'));var db=require(_0xc3e0('0x5'))['db'];var utils=require(_0xc3e0('0x6'));var logger=require(_0xc3e0('0x7'))('rpc');var config=require(_0xc3e0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x553e6d,_0x6db846,_0x32976c){return new BPromise(function(_0x1cfcf5,_0x4ad1bd){return client['request'](_0x553e6d,_0x32976c)['then'](function(_0x5a2630){logger[_0xc3e0('0x9')](_0xc3e0('0xa'),_0x6db846,_0xc3e0('0xb'));logger[_0xc3e0('0xc')](_0xc3e0('0xd'),_0x6db846,_0xc3e0('0xb'),JSON[_0xc3e0('0xe')](_0x5a2630));if(_0x5a2630['error']){if(_0x5a2630[_0xc3e0('0xf')]['code']===0x1f4){logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x5a2630['error'][_0xc3e0('0x10')]);return _0x4ad1bd(_0x5a2630['error'][_0xc3e0('0x10')]);}logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x5a2630[_0xc3e0('0xf')][_0xc3e0('0x10')]);return _0x1cfcf5(_0x5a2630[_0xc3e0('0xf')][_0xc3e0('0x10')]);}else{logger['info'](_0xc3e0('0xa'),_0x6db846,_0xc3e0('0xb'));_0x1cfcf5(_0x5a2630['result'][_0xc3e0('0x10')]);}})[_0xc3e0('0x11')](function(_0x25891a){logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x25891a);_0x4ad1bd(_0x25891a);});});}exports[_0xc3e0('0x12')]=function(_0x2e98d5){var _0xb64df8=this;return new Promise(function(_0x3207c6,_0x36445c){return db[_0xc3e0('0x13')][_0xc3e0('0x14')]({'raw':_0x2e98d5[_0xc3e0('0x15')]?_0x2e98d5['options'][_0xc3e0('0x16')]===undefined?!![]:![]:!![],'where':_0x2e98d5[_0xc3e0('0x15')]?_0x2e98d5[_0xc3e0('0x15')][_0xc3e0('0x17')]||null:null,'attributes':_0x2e98d5[_0xc3e0('0x15')]?_0x2e98d5['options'][_0xc3e0('0x18')]||null:null,'limit':_0x2e98d5['options']?_0x2e98d5[_0xc3e0('0x15')][_0xc3e0('0x19')]||null:null,'include':_0x2e98d5[_0xc3e0('0x15')]?_0x2e98d5['options']['include']?_[_0xc3e0('0x1a')](_0x2e98d5['options'][_0xc3e0('0x1b')],function(_0x514488){return{'model':db[_0x514488[_0xc3e0('0x1c')]],'as':_0x514488['as'],'attributes':_0x514488[_0xc3e0('0x18')],'include':_0x514488['include']?_[_0xc3e0('0x1a')](_0x514488['include'],function(_0x278e27){return{'model':db[_0x278e27[_0xc3e0('0x1c')]],'as':_0x278e27['as'],'attributes':_0x278e27[_0xc3e0('0x18')],'include':_0x278e27[_0xc3e0('0x1b')]?_['map'](_0x278e27[_0xc3e0('0x1b')],function(_0x3b4df3){return{'model':db[_0x3b4df3['model']],'as':_0x3b4df3['as'],'attributes':_0x3b4df3[_0xc3e0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc3e0('0x1d')](function(_0x429e6d){logger[_0xc3e0('0x9')]('GetZohoAccount',_0x2e98d5);logger[_0xc3e0('0xc')](_0xc3e0('0x12'),_0x2e98d5,JSON[_0xc3e0('0xe')](_0x429e6d));_0x3207c6(_0x429e6d);})[_0xc3e0('0x11')](function(_0x36e1ab){logger[_0xc3e0('0xf')]('GetZohoAccount',_0x36e1ab[_0xc3e0('0x10')],_0x2e98d5);_0x36445c(_0xb64df8[_0xc3e0('0xf')](0x1f4,_0x36e1ab[_0xc3e0('0x10')]));});});};exports[_0xc3e0('0x1e')]=function(_0x1e67b5){var _0x25b972=this;return new Promise(function(_0x2430a5,_0x3692be){return db[_0xc3e0('0x13')][_0xc3e0('0x1f')]({'raw':_0x1e67b5[_0xc3e0('0x15')]?_0x1e67b5[_0xc3e0('0x15')][_0xc3e0('0x16')]===undefined?!![]:![]:!![],'where':_0x1e67b5[_0xc3e0('0x15')]?_0x1e67b5['options'][_0xc3e0('0x17')]||null:null,'attributes':_0x1e67b5[_0xc3e0('0x15')]?_0x1e67b5[_0xc3e0('0x15')][_0xc3e0('0x18')]||null:null,'include':_0x1e67b5[_0xc3e0('0x15')]?_0x1e67b5['options'][_0xc3e0('0x1b')]?_['map'](_0x1e67b5[_0xc3e0('0x15')][_0xc3e0('0x1b')],function(_0x30a3b6){return{'model':db[_0x30a3b6[_0xc3e0('0x1c')]],'as':_0x30a3b6['as'],'attributes':_0x30a3b6[_0xc3e0('0x18')],'include':_0x30a3b6['include']?_[_0xc3e0('0x1a')](_0x30a3b6[_0xc3e0('0x1b')],function(_0x55e06b){return{'model':db[_0x55e06b['model']],'as':_0x55e06b['as'],'attributes':_0x55e06b[_0xc3e0('0x18')],'include':_0x55e06b['include']?_[_0xc3e0('0x1a')](_0x55e06b[_0xc3e0('0x1b')],function(_0x21aa3f){return{'model':db[_0x21aa3f[_0xc3e0('0x1c')]],'as':_0x21aa3f['as'],'attributes':_0x21aa3f[_0xc3e0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc3e0('0x1d')](function(_0x245abd){logger[_0xc3e0('0x9')](_0xc3e0('0x1e'),_0x1e67b5);logger['debug'](_0xc3e0('0x1e'),_0x1e67b5,JSON['stringify'](_0x245abd));_0x2430a5(_0x245abd);})[_0xc3e0('0x11')](function(_0xa75220){logger['error']('ShowZohoAccount',_0xa75220['message'],_0x1e67b5);_0x3692be(_0x25b972[_0xc3e0('0xf')](0x1f4,_0xa75220['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0246157..ba70ed8 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 _0xddd8=['./intZohoConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3f8759,_0x3fe6fb){var _0x2d33ca=function(_0x39b5c9){while(--_0x39b5c9){_0x3f8759['push'](_0x3f8759['shift']());}};_0x2d33ca(++_0x3fe6fb);}(_0xddd8,0x1b9));var _0x8ddd=function(_0x6a1b3,_0x30e376){_0x6a1b3=_0x6a1b3-0x0;var _0x5d2241=_0xddd8[_0x6a1b3];return _0x5d2241;};'use strict';var multer=require(_0x8ddd('0x0'));var util=require(_0x8ddd('0x1'));var path=require('path');var timeout=require(_0x8ddd('0x2'));var express=require(_0x8ddd('0x3'));var router=express[_0x8ddd('0x4')]();var fs_extra=require(_0x8ddd('0x5'));var auth=require(_0x8ddd('0x6'));var interaction=require(_0x8ddd('0x7'));var config=require(_0x8ddd('0x8'));var controller=require(_0x8ddd('0x9'));router[_0x8ddd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8ddd('0xa')](_0x8ddd('0xb'),auth['isAuthenticated'](),controller[_0x8ddd('0xc')]);router[_0x8ddd('0xa')](_0x8ddd('0xd'),auth[_0x8ddd('0xe')](),controller[_0x8ddd('0xf')]);router[_0x8ddd('0xa')](_0x8ddd('0x10'),auth[_0x8ddd('0xe')](),controller[_0x8ddd('0x11')]);router['get']('/:id/descriptions',auth[_0x8ddd('0xe')](),controller[_0x8ddd('0x12')]);router[_0x8ddd('0x13')]('/',auth[_0x8ddd('0xe')](),controller[_0x8ddd('0x14')]);router[_0x8ddd('0x15')](_0x8ddd('0xb'),auth[_0x8ddd('0xe')](),controller[_0x8ddd('0x16')]);router[_0x8ddd('0x17')](_0x8ddd('0xb'),auth[_0x8ddd('0xe')](),controller[_0x8ddd('0x18')]);module['exports']=router; \ No newline at end of file +var _0xf558=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','multer','util','path','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf558,0x6f));var _0x8f55=function(_0x38154f,_0xf0d239){_0x38154f=_0x38154f-0x0;var _0x9e29fe=_0xf558[_0x38154f];return _0x9e29fe;};'use strict';var multer=require(_0x8f55('0x0'));var util=require(_0x8f55('0x1'));var path=require(_0x8f55('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8f55('0x3')]();var fs_extra=require(_0x8f55('0x4'));var auth=require(_0x8f55('0x5'));var interaction=require(_0x8f55('0x6'));var config=require(_0x8f55('0x7'));var controller=require(_0x8f55('0x8'));router[_0x8f55('0x9')]('/',auth['isAuthenticated'](),controller[_0x8f55('0xa')]);router[_0x8f55('0x9')](_0x8f55('0xb'),auth[_0x8f55('0xc')](),controller[_0x8f55('0xd')]);router[_0x8f55('0x9')](_0x8f55('0xe'),auth[_0x8f55('0xc')](),controller['getFields']);router[_0x8f55('0x9')](_0x8f55('0xf'),auth[_0x8f55('0xc')](),controller[_0x8f55('0x10')]);router['get'](_0x8f55('0x11'),auth[_0x8f55('0xc')](),controller[_0x8f55('0x12')]);router['post']('/',auth[_0x8f55('0xc')](),controller[_0x8f55('0x13')]);router[_0x8f55('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8f55('0x15')]);router[_0x8f55('0x16')](_0x8f55('0xb'),auth[_0x8f55('0xc')](),controller['destroy']);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 f2b1b2a..2b28d34 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 _0x8c29=['STRING','ENUM','contact','nothing','lead','contact_lead','sequelize','exports'];(function(_0x428cac,_0xc3e5){var _0x26446e=function(_0x3c8fe6){while(--_0x3c8fe6){_0x428cac['push'](_0x428cac['shift']());}};_0x26446e(++_0xc3e5);}(_0x8c29,0x8e));var _0x98c2=function(_0x4b2310,_0x501452){_0x4b2310=_0x4b2310-0x0;var _0x52023b=_0x8c29[_0x4b2310];return _0x52023b;};'use strict';var Sequelize=require(_0x98c2('0x0'));module[_0x98c2('0x1')]={'name':{'type':Sequelize[_0x98c2('0x2')]},'moduleCreate':{'type':Sequelize[_0x98c2('0x3')]('lead',_0x98c2('0x4'),_0x98c2('0x5')),'defaultValue':_0x98c2('0x6')},'moduleSearch':{'type':Sequelize['ENUM'](_0x98c2('0x7'),_0x98c2('0x4'),'lead'),'defaultValue':_0x98c2('0x7')},'description':{'type':Sequelize[_0x98c2('0x2')]}}; \ No newline at end of file +var _0x5b3b=['sequelize','STRING','lead','contact','nothing','ENUM','contact_lead'];(function(_0x422901,_0x5c843b){var _0x5edcdf=function(_0x3b01de){while(--_0x3b01de){_0x422901['push'](_0x422901['shift']());}};_0x5edcdf(++_0x5c843b);}(_0x5b3b,0xd2));var _0xb5b3=function(_0x4d776b,_0x3e55b0){_0x4d776b=_0x4d776b-0x0;var _0x5dfa91=_0x5b3b[_0x4d776b];return _0x5dfa91;};'use strict';var Sequelize=require(_0xb5b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xb5b3('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xb5b3('0x2'),_0xb5b3('0x3'),_0xb5b3('0x4')),'defaultValue':_0xb5b3('0x2')},'moduleSearch':{'type':Sequelize[_0xb5b3('0x5')](_0xb5b3('0x6'),_0xb5b3('0x3'),_0xb5b3('0x2')),'defaultValue':_0xb5b3('0x6')},'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 8f85ca8..bea4df6 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 _0x3082=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','ZohoConfiguration','includeAll','include','catch','keys','create','body','find','params','getFields','findOne','ZohoField','length','pick','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring'];(function(_0x271934,_0x236c06){var _0x26db69=function(_0x1c2314){while(--_0x1c2314){_0x271934['push'](_0x271934['shift']());}};_0x26db69(++_0x236c06);}(_0x3082,0x1c4));var _0x2308=function(_0x4dc427,_0x1331f4){_0x4dc427=_0x4dc427-0x0;var _0x5ad396=_0x3082[_0x4dc427];return _0x5ad396;};'use strict';var emlformat=require(_0x2308('0x0'));var rimraf=require(_0x2308('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2308('0x2'));var rp=require(_0x2308('0x3'));var moment=require(_0x2308('0x4'));var BPromise=require(_0x2308('0x5'));var Mustache=require(_0x2308('0x6'));var util=require(_0x2308('0x7'));var path=require(_0x2308('0x8'));var sox=require(_0x2308('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2308('0xa'));var _=require(_0x2308('0xb'));var squel=require('squel');var crypto=require(_0x2308('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2308('0xd'));var toCsv=require(_0x2308('0xe'));var querystring=require(_0x2308('0xf'));var Papa=require('papaparse');var Redis=require(_0x2308('0x10'));var authService=require(_0x2308('0x11'));var qs=require(_0x2308('0x12'));var as=require(_0x2308('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2308('0x14'))(_0x2308('0x15'));var utils=require(_0x2308('0x16'));var config=require(_0x2308('0x17'));var licenseUtil=require(_0x2308('0x18'));var db=require(_0x2308('0x19'))['db'];function respondWithStatusCode(_0x37b54b,_0x3035e4){_0x3035e4=_0x3035e4||0xcc;return function(_0x3f5f93){if(_0x3f5f93){return _0x37b54b[_0x2308('0x1a')](_0x3035e4);}return _0x37b54b[_0x2308('0x1b')](_0x3035e4)[_0x2308('0x1c')]();};}function respondWithResult(_0x5e68ab,_0x42dcea){_0x42dcea=_0x42dcea||0xc8;return function(_0x50ba0){if(_0x50ba0){return _0x5e68ab[_0x2308('0x1b')](_0x42dcea)[_0x2308('0x1d')](_0x50ba0);}};}function respondWithFilteredResult(_0x5ad271,_0xa7dd23){return function(_0x59fe14){if(_0x59fe14){var _0x4d2731=typeof _0xa7dd23[_0x2308('0x1e')]===_0x2308('0x1f')&&typeof _0xa7dd23['limit']===_0x2308('0x1f');var _0x4ffde2=_0x59fe14[_0x2308('0x20')];var _0x26e0e6=_0x4d2731?0x0:_0xa7dd23[_0x2308('0x1e')];var _0x163793=_0x4d2731?_0x59fe14[_0x2308('0x20')]:_0xa7dd23[_0x2308('0x1e')]+_0xa7dd23[_0x2308('0x21')];var _0x2cfb6d;if(_0x163793>=_0x4ffde2){_0x163793=_0x4ffde2;_0x2cfb6d=0xc8;}else{_0x2cfb6d=0xce;}_0x5ad271[_0x2308('0x1b')](_0x2cfb6d);return _0x5ad271['set'](_0x2308('0x22'),_0x26e0e6+'-'+_0x163793+'/'+_0x4ffde2)['json'](_0x59fe14);}return null;};}function patchUpdates(_0x33cb5e){return function(_0x10b753){try{jsonpatch[_0x2308('0x23')](_0x10b753,_0x33cb5e,!![]);}catch(_0x408107){return BPromise[_0x2308('0x24')](_0x408107);}return _0x10b753[_0x2308('0x25')]();};}function saveUpdates(_0x354f7f,_0x134650){return function(_0x3da1a9){if(_0x3da1a9){return _0x3da1a9['update'](_0x354f7f)['then'](function(_0x5714ad){return _0x5714ad;});}return null;};}function removeEntity(_0x47b1b7,_0x59f6a2){return function(_0x3a0ac2){if(_0x3a0ac2){return _0x3a0ac2[_0x2308('0x26')]()[_0x2308('0x27')](function(){_0x47b1b7[_0x2308('0x1b')](0xcc)[_0x2308('0x1c')]();});}};}function handleEntityNotFound(_0x1eabc0,_0x1127f5){return function(_0x1c4e94){if(!_0x1c4e94){_0x1eabc0['sendStatus'](0x194);}return _0x1c4e94;};}function handleError(_0x21158f,_0x2e265d){_0x2e265d=_0x2e265d||0x1f4;return function(_0x29dafd){logger[_0x2308('0x28')](_0x29dafd[_0x2308('0x29')]);if(_0x29dafd['name']){delete _0x29dafd[_0x2308('0x2a')];}_0x21158f[_0x2308('0x1b')](_0x2e265d)['send'](_0x29dafd);};}exports[_0x2308('0x2b')]=function(_0x27e400,_0x78a120){var _0x18c11d={},_0x502136={},_0x4f2f57={'count':0x0,'rows':[]};var _0x2666ba=_[_0x2308('0x2c')](db['ZohoConfiguration'][_0x2308('0x2d')],function(_0x583de5){return{'name':_0x583de5[_0x2308('0x2e')],'type':_0x583de5[_0x2308('0x2f')]['key']};});_0x502136['model']=_['map'](_0x2666ba,_0x2308('0x2a'));_0x502136[_0x2308('0x30')]=_['keys'](_0x27e400['query']);_0x502136[_0x2308('0x31')]=_['intersection'](_0x502136[_0x2308('0x32')],_0x502136[_0x2308('0x30')]);_0x18c11d['attributes']=_[_0x2308('0x33')](_0x502136[_0x2308('0x32')],qs[_0x2308('0x34')](_0x27e400[_0x2308('0x30')][_0x2308('0x34')]));_0x18c11d[_0x2308('0x35')]=_0x18c11d['attributes']['length']?_0x18c11d[_0x2308('0x35')]:_0x502136[_0x2308('0x32')];if(!_0x27e400[_0x2308('0x30')][_0x2308('0x36')](_0x2308('0x37'))){_0x18c11d['limit']=qs['limit'](_0x27e400[_0x2308('0x30')][_0x2308('0x21')]);_0x18c11d[_0x2308('0x1e')]=qs['offset'](_0x27e400[_0x2308('0x30')][_0x2308('0x1e')]);}_0x18c11d['order']=qs[_0x2308('0x38')](_0x27e400[_0x2308('0x30')][_0x2308('0x38')]);_0x18c11d[_0x2308('0x39')]=qs['filters'](_['pick'](_0x27e400[_0x2308('0x30')],_0x502136[_0x2308('0x31')]),_0x2666ba);if(_0x27e400[_0x2308('0x30')][_0x2308('0x3a')]){_0x18c11d[_0x2308('0x39')]=_[_0x2308('0x3b')](_0x18c11d[_0x2308('0x39')],{'$or':_[_0x2308('0x2c')](_0x2666ba,function(_0x3ea466){if(_0x3ea466[_0x2308('0x2f')]!=='VIRTUAL'){var _0xf5bb8a={};_0xf5bb8a[_0x3ea466[_0x2308('0x2a')]]={'$like':'%'+_0x27e400[_0x2308('0x30')]['filter']+'%'};return _0xf5bb8a;}})});}_0x18c11d=_[_0x2308('0x3b')]({},_0x18c11d,_0x27e400[_0x2308('0x3c')]);var _0x4bc97c={'where':_0x18c11d[_0x2308('0x39')]};return db[_0x2308('0x3d')]['count'](_0x4bc97c)['then'](function(_0x59f83b){_0x4f2f57[_0x2308('0x20')]=_0x59f83b;if(_0x27e400['query'][_0x2308('0x3e')]){_0x18c11d[_0x2308('0x3f')]=[{'all':!![]}];}return db[_0x2308('0x3d')]['findAll'](_0x18c11d);})[_0x2308('0x27')](function(_0x4bae17){_0x4f2f57['rows']=_0x4bae17;return _0x4f2f57;})['then'](respondWithFilteredResult(_0x78a120,_0x18c11d))[_0x2308('0x40')](handleError(_0x78a120,null));};exports['show']=function(_0x2830bb,_0x413130){var _0x26448e={'raw':![],'where':{'id':_0x2830bb['params']['id']}},_0x3bb7d6={};_0x3bb7d6[_0x2308('0x32')]=_[_0x2308('0x41')](db[_0x2308('0x3d')][_0x2308('0x2d')]);_0x3bb7d6[_0x2308('0x30')]=_[_0x2308('0x41')](_0x2830bb['query']);_0x3bb7d6[_0x2308('0x31')]=_[_0x2308('0x33')](_0x3bb7d6[_0x2308('0x32')],_0x3bb7d6[_0x2308('0x30')]);_0x26448e[_0x2308('0x35')]=_[_0x2308('0x33')](_0x3bb7d6[_0x2308('0x32')],qs[_0x2308('0x34')](_0x2830bb[_0x2308('0x30')][_0x2308('0x34')]));_0x26448e['attributes']=_0x26448e['attributes']['length']?_0x26448e['attributes']:_0x3bb7d6[_0x2308('0x32')];if(_0x2830bb[_0x2308('0x30')][_0x2308('0x3e')]){_0x26448e[_0x2308('0x3f')]=[{'all':!![]}];}_0x26448e=_['merge']({},_0x26448e,_0x2830bb[_0x2308('0x3c')]);return db[_0x2308('0x3d')]['find'](_0x26448e)[_0x2308('0x27')](handleEntityNotFound(_0x413130,null))['then'](respondWithResult(_0x413130,null))[_0x2308('0x40')](handleError(_0x413130,null));};exports['create']=function(_0x3e54e8,_0x260429){return db[_0x2308('0x3d')][_0x2308('0x42')](_0x3e54e8[_0x2308('0x43')],{})[_0x2308('0x27')](respondWithResult(_0x260429,0xc9))[_0x2308('0x40')](handleError(_0x260429,null));};exports['update']=function(_0x3851e8,_0x5b0860){if(_0x3851e8[_0x2308('0x43')]['id']){delete _0x3851e8[_0x2308('0x43')]['id'];}return db[_0x2308('0x3d')][_0x2308('0x44')]({'where':{'id':_0x3851e8['params']['id']}})[_0x2308('0x27')](handleEntityNotFound(_0x5b0860,null))[_0x2308('0x27')](saveUpdates(_0x3851e8[_0x2308('0x43')],null))['then'](respondWithResult(_0x5b0860,null))['catch'](handleError(_0x5b0860,null));};exports[_0x2308('0x26')]=function(_0x317ef7,_0x56164e){return db[_0x2308('0x3d')][_0x2308('0x44')]({'where':{'id':_0x317ef7[_0x2308('0x45')]['id']}})[_0x2308('0x27')](handleEntityNotFound(_0x56164e,null))[_0x2308('0x27')](removeEntity(_0x56164e,null))[_0x2308('0x40')](handleError(_0x56164e,null));};exports[_0x2308('0x46')]=function(_0x1da8f7,_0x4833e0,_0x2615be){var _0x2f7c8c={};var _0x2a910b={};var _0x37fbbd;var _0xde3275;return db[_0x2308('0x3d')][_0x2308('0x47')]({'where':{'id':_0x1da8f7['params']['id']}})[_0x2308('0x27')](handleEntityNotFound(_0x4833e0,null))['then'](function(_0x886087){if(_0x886087){_0x37fbbd=_0x886087;_0x2a910b[_0x2308('0x32')]=_[_0x2308('0x41')](db[_0x2308('0x48')]['rawAttributes']);_0x2a910b['query']=_['keys'](_0x1da8f7[_0x2308('0x30')]);_0x2a910b[_0x2308('0x31')]=_[_0x2308('0x33')](_0x2a910b[_0x2308('0x32')],_0x2a910b[_0x2308('0x30')]);_0x2f7c8c[_0x2308('0x35')]=_[_0x2308('0x33')](_0x2a910b[_0x2308('0x32')],qs[_0x2308('0x34')](_0x1da8f7[_0x2308('0x30')][_0x2308('0x34')]));_0x2f7c8c[_0x2308('0x35')]=_0x2f7c8c[_0x2308('0x35')][_0x2308('0x49')]?_0x2f7c8c[_0x2308('0x35')]:_0x2a910b[_0x2308('0x32')];_0x2f7c8c['order']=qs[_0x2308('0x38')](_0x1da8f7[_0x2308('0x30')][_0x2308('0x38')]);_0x2f7c8c['where']=qs[_0x2308('0x31')](_[_0x2308('0x4a')](_0x1da8f7[_0x2308('0x30')],_0x2a910b[_0x2308('0x31')]));if(_0x1da8f7[_0x2308('0x30')][_0x2308('0x3a')]){_0x2f7c8c[_0x2308('0x39')]=_[_0x2308('0x3b')](_0x2f7c8c['where'],{'$or':_[_0x2308('0x2c')](_0x2f7c8c[_0x2308('0x35')],function(_0xed26b0){var _0x33380e={};_0x33380e[_0xed26b0]={'$like':'%'+_0x1da8f7[_0x2308('0x30')][_0x2308('0x3a')]+'%'};return _0x33380e;})});}_0x2f7c8c=_[_0x2308('0x3b')]({},_0x2f7c8c,_0x1da8f7['options']);return _0x37fbbd[_0x2308('0x46')](_0x2f7c8c);}})[_0x2308('0x27')](function(_0x4d2d3f){if(_0x4d2d3f){_0xde3275=_0x4d2d3f[_0x2308('0x49')];if(!_0x1da8f7['query'][_0x2308('0x36')](_0x2308('0x37'))){_0x2f7c8c[_0x2308('0x21')]=qs['limit'](_0x1da8f7[_0x2308('0x30')]['limit']);_0x2f7c8c['offset']=qs['offset'](_0x1da8f7[_0x2308('0x30')]['offset']);}return _0x37fbbd[_0x2308('0x46')](_0x2f7c8c);}})[_0x2308('0x27')](function(_0x4d3d8b){if(_0x4d3d8b){return _0x4d3d8b?{'count':_0xde3275,'rows':_0x4d3d8b}:null;}})['then'](respondWithResult(_0x4833e0,null))[_0x2308('0x40')](handleError(_0x4833e0,null));};exports[_0x2308('0x4b')]=function(_0x50e1fe,_0x3c2867,_0x168d2d){var _0x33e2ca={};var _0x4ed848={};var _0x4aa3d0;var _0x2707e4;return db[_0x2308('0x3d')]['findOne']({'where':{'id':_0x50e1fe[_0x2308('0x45')]['id']}})[_0x2308('0x27')](handleEntityNotFound(_0x3c2867,null))[_0x2308('0x27')](function(_0x1ebc13){if(_0x1ebc13){_0x4aa3d0=_0x1ebc13;_0x4ed848[_0x2308('0x32')]=_[_0x2308('0x41')](db[_0x2308('0x48')][_0x2308('0x2d')]);_0x4ed848[_0x2308('0x30')]=_[_0x2308('0x41')](_0x50e1fe['query']);_0x4ed848[_0x2308('0x31')]=_[_0x2308('0x33')](_0x4ed848[_0x2308('0x32')],_0x4ed848[_0x2308('0x30')]);_0x33e2ca[_0x2308('0x35')]=_[_0x2308('0x33')](_0x4ed848[_0x2308('0x32')],qs[_0x2308('0x34')](_0x50e1fe['query'][_0x2308('0x34')]));_0x33e2ca[_0x2308('0x35')]=_0x33e2ca[_0x2308('0x35')][_0x2308('0x49')]?_0x33e2ca[_0x2308('0x35')]:_0x4ed848[_0x2308('0x32')];_0x33e2ca['order']=qs[_0x2308('0x38')](_0x50e1fe[_0x2308('0x30')]['sort']);_0x33e2ca[_0x2308('0x39')]=qs[_0x2308('0x31')](_['pick'](_0x50e1fe['query'],_0x4ed848[_0x2308('0x31')]));if(_0x50e1fe[_0x2308('0x30')]['filter']){_0x33e2ca[_0x2308('0x39')]=_[_0x2308('0x3b')](_0x33e2ca[_0x2308('0x39')],{'$or':_[_0x2308('0x2c')](_0x33e2ca['attributes'],function(_0x34b85c){var _0x286fcb={};_0x286fcb[_0x34b85c]={'$like':'%'+_0x50e1fe[_0x2308('0x30')]['filter']+'%'};return _0x286fcb;})});}_0x33e2ca=_[_0x2308('0x3b')]({},_0x33e2ca,_0x50e1fe[_0x2308('0x3c')]);return _0x4aa3d0[_0x2308('0x4b')](_0x33e2ca);}})['then'](function(_0x3e14a4){if(_0x3e14a4){_0x2707e4=_0x3e14a4[_0x2308('0x49')];if(!_0x50e1fe['query'][_0x2308('0x36')](_0x2308('0x37'))){_0x33e2ca[_0x2308('0x21')]=qs['limit'](_0x50e1fe[_0x2308('0x30')][_0x2308('0x21')]);_0x33e2ca['offset']=qs[_0x2308('0x1e')](_0x50e1fe[_0x2308('0x30')][_0x2308('0x1e')]);}return _0x4aa3d0[_0x2308('0x4b')](_0x33e2ca);}})['then'](function(_0x3ab88c){if(_0x3ab88c){return _0x3ab88c?{'count':_0x2707e4,'rows':_0x3ab88c}:null;}})['then'](respondWithResult(_0x3c2867,null))[_0x2308('0x40')](handleError(_0x3c2867,null));};exports['getDescriptions']=function(_0x2ef0cb,_0x112ea5,_0x1a4188){var _0x545725={};var _0x105da6={};var _0x37d59d;var _0x20d37a;return db[_0x2308('0x3d')]['findOne']({'where':{'id':_0x2ef0cb['params']['id']}})['then'](handleEntityNotFound(_0x112ea5,null))[_0x2308('0x27')](function(_0x1c8604){if(_0x1c8604){_0x37d59d=_0x1c8604;_0x105da6[_0x2308('0x32')]=_[_0x2308('0x41')](db[_0x2308('0x48')][_0x2308('0x2d')]);_0x105da6['query']=_[_0x2308('0x41')](_0x2ef0cb[_0x2308('0x30')]);_0x105da6[_0x2308('0x31')]=_[_0x2308('0x33')](_0x105da6[_0x2308('0x32')],_0x105da6['query']);_0x545725[_0x2308('0x35')]=_['intersection'](_0x105da6[_0x2308('0x32')],qs[_0x2308('0x34')](_0x2ef0cb[_0x2308('0x30')][_0x2308('0x34')]));_0x545725[_0x2308('0x35')]=_0x545725[_0x2308('0x35')][_0x2308('0x49')]?_0x545725[_0x2308('0x35')]:_0x105da6['model'];_0x545725[_0x2308('0x4c')]=qs['sort'](_0x2ef0cb['query'][_0x2308('0x38')]);_0x545725[_0x2308('0x39')]=qs[_0x2308('0x31')](_[_0x2308('0x4a')](_0x2ef0cb[_0x2308('0x30')],_0x105da6[_0x2308('0x31')]));if(_0x2ef0cb[_0x2308('0x30')][_0x2308('0x3a')]){_0x545725[_0x2308('0x39')]=_[_0x2308('0x3b')](_0x545725[_0x2308('0x39')],{'$or':_[_0x2308('0x2c')](_0x545725[_0x2308('0x35')],function(_0x40be4f){var _0x520e81={};_0x520e81[_0x40be4f]={'$like':'%'+_0x2ef0cb[_0x2308('0x30')][_0x2308('0x3a')]+'%'};return _0x520e81;})});}_0x545725=_[_0x2308('0x3b')]({},_0x545725,_0x2ef0cb[_0x2308('0x3c')]);return _0x37d59d[_0x2308('0x4d')](_0x545725);}})[_0x2308('0x27')](function(_0x2376c4){if(_0x2376c4){_0x20d37a=_0x2376c4[_0x2308('0x49')];if(!_0x2ef0cb[_0x2308('0x30')][_0x2308('0x36')](_0x2308('0x37'))){_0x545725[_0x2308('0x21')]=qs['limit'](_0x2ef0cb[_0x2308('0x30')][_0x2308('0x21')]);_0x545725['offset']=qs[_0x2308('0x1e')](_0x2ef0cb[_0x2308('0x30')][_0x2308('0x1e')]);}return _0x37d59d['getDescriptions'](_0x545725);}})[_0x2308('0x27')](function(_0x52d01c){if(_0x52d01c){return _0x52d01c?{'count':_0x20d37a,'rows':_0x52d01c}:null;}})['then'](respondWithResult(_0x112ea5,null))['catch'](handleError(_0x112ea5,null));}; \ No newline at end of file +var _0x6b19=['name','send','index','rawAttributes','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','type','options','ZohoConfiguration','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x4da78e,_0x13cb84){var _0x4463b1=function(_0x41aaf1){while(--_0x41aaf1){_0x4da78e['push'](_0x4da78e['shift']());}};_0x4463b1(++_0x13cb84);}(_0x6b19,0x77));var _0x96b1=function(_0x1f2799,_0x36257b){_0x1f2799=_0x1f2799-0x0;var _0x3984ab=_0x6b19[_0x1f2799];return _0x3984ab;};'use strict';var emlformat=require(_0x96b1('0x0'));var rimraf=require(_0x96b1('0x1'));var zipdir=require(_0x96b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96b1('0x3'));var moment=require(_0x96b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96b1('0x5'));var util=require(_0x96b1('0x6'));var path=require(_0x96b1('0x7'));var sox=require(_0x96b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96b1('0x9'));var squel=require(_0x96b1('0xa'));var crypto=require(_0x96b1('0xb'));var jsforce=require(_0x96b1('0xc'));var deskjs=require(_0x96b1('0xd'));var toCsv=require(_0x96b1('0xe'));var querystring=require('querystring');var Papa=require(_0x96b1('0xf'));var Redis=require('ioredis');var authService=require(_0x96b1('0x10'));var qs=require(_0x96b1('0x11'));var as=require(_0x96b1('0x12'));var hardwareService=require(_0x96b1('0x13'));var logger=require(_0x96b1('0x14'))(_0x96b1('0x15'));var utils=require(_0x96b1('0x16'));var config=require(_0x96b1('0x17'));var licenseUtil=require(_0x96b1('0x18'));var db=require(_0x96b1('0x19'))['db'];function respondWithStatusCode(_0x3fef7d,_0x5950c4){_0x5950c4=_0x5950c4||0xcc;return function(_0x37474e){if(_0x37474e){return _0x3fef7d[_0x96b1('0x1a')](_0x5950c4);}return _0x3fef7d[_0x96b1('0x1b')](_0x5950c4)[_0x96b1('0x1c')]();};}function respondWithResult(_0x2aa924,_0x4e1f26){_0x4e1f26=_0x4e1f26||0xc8;return function(_0x1184d8){if(_0x1184d8){return _0x2aa924[_0x96b1('0x1b')](_0x4e1f26)[_0x96b1('0x1d')](_0x1184d8);}};}function respondWithFilteredResult(_0x19c271,_0x1406b9){return function(_0x38786e){if(_0x38786e){var _0x57c161=typeof _0x1406b9['offset']===_0x96b1('0x1e')&&typeof _0x1406b9['limit']===_0x96b1('0x1e');var _0x41faa6=_0x38786e[_0x96b1('0x1f')];var _0x506154=_0x57c161?0x0:_0x1406b9[_0x96b1('0x20')];var _0xdd251b=_0x57c161?_0x38786e[_0x96b1('0x1f')]:_0x1406b9[_0x96b1('0x20')]+_0x1406b9[_0x96b1('0x21')];var _0x268c6b;if(_0xdd251b>=_0x41faa6){_0xdd251b=_0x41faa6;_0x268c6b=0xc8;}else{_0x268c6b=0xce;}_0x19c271[_0x96b1('0x1b')](_0x268c6b);return _0x19c271['set'](_0x96b1('0x22'),_0x506154+'-'+_0xdd251b+'/'+_0x41faa6)[_0x96b1('0x1d')](_0x38786e);}return null;};}function patchUpdates(_0xd8d40a){return function(_0x30e260){try{jsonpatch['apply'](_0x30e260,_0xd8d40a,!![]);}catch(_0xf47e00){return BPromise[_0x96b1('0x23')](_0xf47e00);}return _0x30e260['save']();};}function saveUpdates(_0xfcd132,_0x16aa17){return function(_0xb2fa1a){if(_0xb2fa1a){return _0xb2fa1a[_0x96b1('0x24')](_0xfcd132)[_0x96b1('0x25')](function(_0x10ba07){return _0x10ba07;});}return null;};}function removeEntity(_0x95f1cd,_0x383891){return function(_0xf39614){if(_0xf39614){return _0xf39614[_0x96b1('0x26')]()['then'](function(){_0x95f1cd[_0x96b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4278,_0x33dd0c){return function(_0x3b60ce){if(!_0x3b60ce){_0x5a4278[_0x96b1('0x1a')](0x194);}return _0x3b60ce;};}function handleError(_0x43dbcb,_0x32f557){_0x32f557=_0x32f557||0x1f4;return function(_0x419b2e){logger[_0x96b1('0x27')](_0x419b2e[_0x96b1('0x28')]);if(_0x419b2e[_0x96b1('0x29')]){delete _0x419b2e['name'];}_0x43dbcb[_0x96b1('0x1b')](_0x32f557)[_0x96b1('0x2a')](_0x419b2e);};}exports[_0x96b1('0x2b')]=function(_0x370426,_0x49d09b){var _0x4809f7={},_0x577261={},_0x4ffea9={'count':0x0,'rows':[]};var _0xc44415=_['map'](db['ZohoConfiguration'][_0x96b1('0x2c')],function(_0x5a4c5){return{'name':_0x5a4c5['fieldName'],'type':_0x5a4c5['type']['key']};});_0x577261['model']=_['map'](_0xc44415,'name');_0x577261[_0x96b1('0x2d')]=_[_0x96b1('0x2e')](_0x370426[_0x96b1('0x2d')]);_0x577261[_0x96b1('0x2f')]=_[_0x96b1('0x30')](_0x577261[_0x96b1('0x31')],_0x577261[_0x96b1('0x2d')]);_0x4809f7[_0x96b1('0x32')]=_[_0x96b1('0x30')](_0x577261[_0x96b1('0x31')],qs[_0x96b1('0x33')](_0x370426[_0x96b1('0x2d')]['fields']));_0x4809f7[_0x96b1('0x32')]=_0x4809f7[_0x96b1('0x32')]['length']?_0x4809f7['attributes']:_0x577261['model'];if(!_0x370426[_0x96b1('0x2d')]['hasOwnProperty'](_0x96b1('0x34'))){_0x4809f7[_0x96b1('0x21')]=qs[_0x96b1('0x21')](_0x370426[_0x96b1('0x2d')][_0x96b1('0x21')]);_0x4809f7[_0x96b1('0x20')]=qs[_0x96b1('0x20')](_0x370426[_0x96b1('0x2d')][_0x96b1('0x20')]);}_0x4809f7[_0x96b1('0x35')]=qs[_0x96b1('0x36')](_0x370426[_0x96b1('0x2d')][_0x96b1('0x36')]);_0x4809f7[_0x96b1('0x37')]=qs[_0x96b1('0x2f')](_[_0x96b1('0x38')](_0x370426[_0x96b1('0x2d')],_0x577261['filters']),_0xc44415);if(_0x370426[_0x96b1('0x2d')][_0x96b1('0x39')]){_0x4809f7[_0x96b1('0x37')]=_[_0x96b1('0x3a')](_0x4809f7[_0x96b1('0x37')],{'$or':_[_0x96b1('0x3b')](_0xc44415,function(_0x1cea9d){if(_0x1cea9d[_0x96b1('0x3c')]!=='VIRTUAL'){var _0x17225a={};_0x17225a[_0x1cea9d[_0x96b1('0x29')]]={'$like':'%'+_0x370426[_0x96b1('0x2d')]['filter']+'%'};return _0x17225a;}})});}_0x4809f7=_[_0x96b1('0x3a')]({},_0x4809f7,_0x370426[_0x96b1('0x3d')]);var _0x5ab855={'where':_0x4809f7[_0x96b1('0x37')]};return db[_0x96b1('0x3e')][_0x96b1('0x1f')](_0x5ab855)[_0x96b1('0x25')](function(_0x23f48d){_0x4ffea9[_0x96b1('0x1f')]=_0x23f48d;if(_0x370426[_0x96b1('0x2d')]['includeAll']){_0x4809f7[_0x96b1('0x3f')]=[{'all':!![]}];}return db[_0x96b1('0x3e')][_0x96b1('0x40')](_0x4809f7);})['then'](function(_0x44a7dd){_0x4ffea9[_0x96b1('0x41')]=_0x44a7dd;return _0x4ffea9;})[_0x96b1('0x25')](respondWithFilteredResult(_0x49d09b,_0x4809f7))[_0x96b1('0x42')](handleError(_0x49d09b,null));};exports[_0x96b1('0x43')]=function(_0x4a329e,_0x26272a){var _0x41c32a={'raw':![],'where':{'id':_0x4a329e['params']['id']}},_0x39deff={};_0x39deff['model']=_['keys'](db[_0x96b1('0x3e')]['rawAttributes']);_0x39deff[_0x96b1('0x2d')]=_[_0x96b1('0x2e')](_0x4a329e[_0x96b1('0x2d')]);_0x39deff[_0x96b1('0x2f')]=_['intersection'](_0x39deff['model'],_0x39deff[_0x96b1('0x2d')]);_0x41c32a['attributes']=_[_0x96b1('0x30')](_0x39deff[_0x96b1('0x31')],qs['fields'](_0x4a329e[_0x96b1('0x2d')][_0x96b1('0x33')]));_0x41c32a['attributes']=_0x41c32a[_0x96b1('0x32')][_0x96b1('0x44')]?_0x41c32a['attributes']:_0x39deff[_0x96b1('0x31')];if(_0x4a329e[_0x96b1('0x2d')][_0x96b1('0x45')]){_0x41c32a[_0x96b1('0x3f')]=[{'all':!![]}];}_0x41c32a=_[_0x96b1('0x3a')]({},_0x41c32a,_0x4a329e[_0x96b1('0x3d')]);return db[_0x96b1('0x3e')][_0x96b1('0x46')](_0x41c32a)[_0x96b1('0x25')](handleEntityNotFound(_0x26272a,null))[_0x96b1('0x25')](respondWithResult(_0x26272a,null))['catch'](handleError(_0x26272a,null));};exports[_0x96b1('0x47')]=function(_0x687613,_0x1c2008){return db[_0x96b1('0x3e')][_0x96b1('0x47')](_0x687613[_0x96b1('0x48')],{})[_0x96b1('0x25')](respondWithResult(_0x1c2008,0xc9))['catch'](handleError(_0x1c2008,null));};exports[_0x96b1('0x24')]=function(_0x34d74,_0x3e1bf6){if(_0x34d74[_0x96b1('0x48')]['id']){delete _0x34d74[_0x96b1('0x48')]['id'];}return db[_0x96b1('0x3e')]['find']({'where':{'id':_0x34d74[_0x96b1('0x49')]['id']}})[_0x96b1('0x25')](handleEntityNotFound(_0x3e1bf6,null))[_0x96b1('0x25')](saveUpdates(_0x34d74[_0x96b1('0x48')],null))[_0x96b1('0x25')](respondWithResult(_0x3e1bf6,null))[_0x96b1('0x42')](handleError(_0x3e1bf6,null));};exports[_0x96b1('0x26')]=function(_0x2715e8,_0x164ede){return db[_0x96b1('0x3e')][_0x96b1('0x46')]({'where':{'id':_0x2715e8[_0x96b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x164ede,null))[_0x96b1('0x25')](removeEntity(_0x164ede,null))[_0x96b1('0x42')](handleError(_0x164ede,null));};exports[_0x96b1('0x4a')]=function(_0x493cc1,_0x353942,_0x275e0d){var _0x1cf388={};var _0x1136f4={};var _0x19bf24;var _0x89dcec;return db['ZohoConfiguration'][_0x96b1('0x4b')]({'where':{'id':_0x493cc1[_0x96b1('0x49')]['id']}})[_0x96b1('0x25')](handleEntityNotFound(_0x353942,null))[_0x96b1('0x25')](function(_0xa4f5dc){if(_0xa4f5dc){_0x19bf24=_0xa4f5dc;_0x1136f4['model']=_[_0x96b1('0x2e')](db[_0x96b1('0x4c')][_0x96b1('0x2c')]);_0x1136f4['query']=_['keys'](_0x493cc1[_0x96b1('0x2d')]);_0x1136f4[_0x96b1('0x2f')]=_[_0x96b1('0x30')](_0x1136f4[_0x96b1('0x31')],_0x1136f4[_0x96b1('0x2d')]);_0x1cf388[_0x96b1('0x32')]=_[_0x96b1('0x30')](_0x1136f4[_0x96b1('0x31')],qs[_0x96b1('0x33')](_0x493cc1[_0x96b1('0x2d')][_0x96b1('0x33')]));_0x1cf388['attributes']=_0x1cf388['attributes']['length']?_0x1cf388[_0x96b1('0x32')]:_0x1136f4[_0x96b1('0x31')];_0x1cf388[_0x96b1('0x35')]=qs[_0x96b1('0x36')](_0x493cc1['query']['sort']);_0x1cf388[_0x96b1('0x37')]=qs['filters'](_[_0x96b1('0x38')](_0x493cc1[_0x96b1('0x2d')],_0x1136f4['filters']));if(_0x493cc1[_0x96b1('0x2d')]['filter']){_0x1cf388[_0x96b1('0x37')]=_['merge'](_0x1cf388[_0x96b1('0x37')],{'$or':_[_0x96b1('0x3b')](_0x1cf388[_0x96b1('0x32')],function(_0x5a799b){var _0x176fbc={};_0x176fbc[_0x5a799b]={'$like':'%'+_0x493cc1[_0x96b1('0x2d')]['filter']+'%'};return _0x176fbc;})});}_0x1cf388=_[_0x96b1('0x3a')]({},_0x1cf388,_0x493cc1[_0x96b1('0x3d')]);return _0x19bf24[_0x96b1('0x4a')](_0x1cf388);}})[_0x96b1('0x25')](function(_0x3b101d){if(_0x3b101d){_0x89dcec=_0x3b101d[_0x96b1('0x44')];if(!_0x493cc1[_0x96b1('0x2d')][_0x96b1('0x4d')](_0x96b1('0x34'))){_0x1cf388[_0x96b1('0x21')]=qs[_0x96b1('0x21')](_0x493cc1[_0x96b1('0x2d')]['limit']);_0x1cf388['offset']=qs[_0x96b1('0x20')](_0x493cc1[_0x96b1('0x2d')][_0x96b1('0x20')]);}return _0x19bf24[_0x96b1('0x4a')](_0x1cf388);}})[_0x96b1('0x25')](function(_0x5b9fff){if(_0x5b9fff){return _0x5b9fff?{'count':_0x89dcec,'rows':_0x5b9fff}:null;}})[_0x96b1('0x25')](respondWithResult(_0x353942,null))[_0x96b1('0x42')](handleError(_0x353942,null));};exports[_0x96b1('0x4e')]=function(_0x3b109a,_0x24fc01,_0x21b0ae){var _0xe7682f={};var _0x223b47={};var _0x13db88;var _0x53a756;return db['ZohoConfiguration'][_0x96b1('0x4b')]({'where':{'id':_0x3b109a[_0x96b1('0x49')]['id']}})[_0x96b1('0x25')](handleEntityNotFound(_0x24fc01,null))[_0x96b1('0x25')](function(_0x1f6c16){if(_0x1f6c16){_0x13db88=_0x1f6c16;_0x223b47[_0x96b1('0x31')]=_[_0x96b1('0x2e')](db[_0x96b1('0x4c')][_0x96b1('0x2c')]);_0x223b47['query']=_[_0x96b1('0x2e')](_0x3b109a[_0x96b1('0x2d')]);_0x223b47[_0x96b1('0x2f')]=_[_0x96b1('0x30')](_0x223b47[_0x96b1('0x31')],_0x223b47['query']);_0xe7682f[_0x96b1('0x32')]=_[_0x96b1('0x30')](_0x223b47[_0x96b1('0x31')],qs[_0x96b1('0x33')](_0x3b109a[_0x96b1('0x2d')][_0x96b1('0x33')]));_0xe7682f[_0x96b1('0x32')]=_0xe7682f['attributes']['length']?_0xe7682f['attributes']:_0x223b47['model'];_0xe7682f[_0x96b1('0x35')]=qs[_0x96b1('0x36')](_0x3b109a[_0x96b1('0x2d')][_0x96b1('0x36')]);_0xe7682f['where']=qs['filters'](_[_0x96b1('0x38')](_0x3b109a[_0x96b1('0x2d')],_0x223b47[_0x96b1('0x2f')]));if(_0x3b109a['query']['filter']){_0xe7682f[_0x96b1('0x37')]=_[_0x96b1('0x3a')](_0xe7682f[_0x96b1('0x37')],{'$or':_[_0x96b1('0x3b')](_0xe7682f[_0x96b1('0x32')],function(_0x30a9d0){var _0x57df18={};_0x57df18[_0x30a9d0]={'$like':'%'+_0x3b109a['query'][_0x96b1('0x39')]+'%'};return _0x57df18;})});}_0xe7682f=_['merge']({},_0xe7682f,_0x3b109a[_0x96b1('0x3d')]);return _0x13db88[_0x96b1('0x4e')](_0xe7682f);}})[_0x96b1('0x25')](function(_0x34f2cd){if(_0x34f2cd){_0x53a756=_0x34f2cd[_0x96b1('0x44')];if(!_0x3b109a[_0x96b1('0x2d')]['hasOwnProperty']('nolimit')){_0xe7682f['limit']=qs['limit'](_0x3b109a[_0x96b1('0x2d')][_0x96b1('0x21')]);_0xe7682f[_0x96b1('0x20')]=qs['offset'](_0x3b109a['query'][_0x96b1('0x20')]);}return _0x13db88['getSubjects'](_0xe7682f);}})['then'](function(_0xf86286){if(_0xf86286){return _0xf86286?{'count':_0x53a756,'rows':_0xf86286}:null;}})[_0x96b1('0x25')](respondWithResult(_0x24fc01,null))[_0x96b1('0x42')](handleError(_0x24fc01,null));};exports[_0x96b1('0x4f')]=function(_0xb34067,_0xc8c45e,_0x5b7d61){var _0x332681={};var _0x3a3210={};var _0x5e0f40;var _0x1c39a0;return db[_0x96b1('0x3e')]['findOne']({'where':{'id':_0xb34067['params']['id']}})['then'](handleEntityNotFound(_0xc8c45e,null))[_0x96b1('0x25')](function(_0x85c724){if(_0x85c724){_0x5e0f40=_0x85c724;_0x3a3210[_0x96b1('0x31')]=_[_0x96b1('0x2e')](db[_0x96b1('0x4c')]['rawAttributes']);_0x3a3210[_0x96b1('0x2d')]=_[_0x96b1('0x2e')](_0xb34067[_0x96b1('0x2d')]);_0x3a3210[_0x96b1('0x2f')]=_[_0x96b1('0x30')](_0x3a3210['model'],_0x3a3210[_0x96b1('0x2d')]);_0x332681[_0x96b1('0x32')]=_[_0x96b1('0x30')](_0x3a3210[_0x96b1('0x31')],qs[_0x96b1('0x33')](_0xb34067['query'][_0x96b1('0x33')]));_0x332681[_0x96b1('0x32')]=_0x332681['attributes'][_0x96b1('0x44')]?_0x332681[_0x96b1('0x32')]:_0x3a3210[_0x96b1('0x31')];_0x332681['order']=qs[_0x96b1('0x36')](_0xb34067[_0x96b1('0x2d')]['sort']);_0x332681['where']=qs[_0x96b1('0x2f')](_[_0x96b1('0x38')](_0xb34067[_0x96b1('0x2d')],_0x3a3210[_0x96b1('0x2f')]));if(_0xb34067[_0x96b1('0x2d')]['filter']){_0x332681['where']=_['merge'](_0x332681[_0x96b1('0x37')],{'$or':_[_0x96b1('0x3b')](_0x332681[_0x96b1('0x32')],function(_0x1527e6){var _0x209cf9={};_0x209cf9[_0x1527e6]={'$like':'%'+_0xb34067[_0x96b1('0x2d')][_0x96b1('0x39')]+'%'};return _0x209cf9;})});}_0x332681=_[_0x96b1('0x3a')]({},_0x332681,_0xb34067[_0x96b1('0x3d')]);return _0x5e0f40['getDescriptions'](_0x332681);}})[_0x96b1('0x25')](function(_0x4a09e9){if(_0x4a09e9){_0x1c39a0=_0x4a09e9[_0x96b1('0x44')];if(!_0xb34067[_0x96b1('0x2d')][_0x96b1('0x4d')](_0x96b1('0x34'))){_0x332681[_0x96b1('0x21')]=qs[_0x96b1('0x21')](_0xb34067[_0x96b1('0x2d')][_0x96b1('0x21')]);_0x332681[_0x96b1('0x20')]=qs['offset'](_0xb34067[_0x96b1('0x2d')][_0x96b1('0x20')]);}return _0x5e0f40[_0x96b1('0x4f')](_0x332681);}})[_0x96b1('0x25')](function(_0x1e3606){if(_0x1e3606){return _0x1e3606?{'count':_0x1c39a0,'rows':_0x1e3606}:null;}})['then'](respondWithResult(_0xc8c45e,null))[_0x96b1('0x42')](handleError(_0xc8c45e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 927160c..c558269 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 _0x7b2c=['../../config/logger','moment','request-promise','path','rimraf','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0xf3af53,_0x4e848b){var _0x1be359=function(_0x16dbc3){while(--_0x16dbc3){_0xf3af53['push'](_0xf3af53['shift']());}};_0x1be359(++_0x4e848b);}(_0x7b2c,0x1ac));var _0xc7b2=function(_0x3b75a1,_0x1dbfbc){_0x3b75a1=_0x3b75a1-0x0;var _0x3bd038=_0x7b2c[_0x3b75a1];return _0x3bd038;};'use strict';var _=require(_0xc7b2('0x0'));var util=require(_0xc7b2('0x1'));var logger=require(_0xc7b2('0x2'))('api');var moment=require(_0xc7b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xc7b2('0x4'));var fs=require('fs');var path=require(_0xc7b2('0x5'));var rimraf=require(_0xc7b2('0x6'));var config=require('../../config/environment');var attributes=require(_0xc7b2('0x7'));module['exports']=function(_0x452f74,_0x1f22ff){return _0x452f74['define'](_0xc7b2('0x8'),attributes,{'tableName':_0xc7b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe758=['bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment'];(function(_0x5ef41,_0x595ffa){var _0x49b521=function(_0x256a87){while(--_0x256a87){_0x5ef41['push'](_0x5ef41['shift']());}};_0x49b521(++_0x595ffa);}(_0xe758,0x159));var _0x8e75=function(_0x569b19,_0x26e8fb){_0x569b19=_0x569b19-0x0;var _0x5c067b=_0xe758[_0x569b19];return _0x5c067b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e75('0x0'))(_0x8e75('0x1'));var moment=require(_0x8e75('0x2'));var BPromise=require(_0x8e75('0x3'));var rp=require(_0x8e75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e75('0x5'));var config=require(_0x8e75('0x6'));var attributes=require(_0x8e75('0x7'));module[_0x8e75('0x8')]=function(_0x44596d,_0x47b492){return _0x44596d[_0x8e75('0x9')](_0x8e75('0xa'),attributes,{'tableName':_0x8e75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 3d67a0f..69566da 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 _0x8a15=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x14631f,_0x58a238){var _0x3988d3=function(_0x4b7e4a){while(--_0x4b7e4a){_0x14631f['push'](_0x14631f['shift']());}};_0x3988d3(++_0x58a238);}(_0x8a15,0xa4));var _0x58a1=function(_0x3899cb,_0xb95555){_0x3899cb=_0x3899cb-0x0;var _0x3fe239=_0x8a15[_0x3899cb];return _0x3fe239;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x58a1('0x0'));var BPromise=require(_0x58a1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58a1('0x2'));var db=require(_0x58a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x58a1('0x4'))(_0x58a1('0x5'));var config=require(_0x58a1('0x6'));var jayson=require(_0x58a1('0x7'));var client=jayson[_0x58a1('0x8')][_0x58a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4476ca,_0x45833a,_0x33c1c1){return new BPromise(function(_0x365ded,_0x276800){return client['request'](_0x4476ca,_0x33c1c1)[_0x58a1('0xa')](function(_0x374b91){logger[_0x58a1('0xb')](_0x58a1('0xc'),_0x45833a,_0x58a1('0xd'));logger['debug'](_0x58a1('0xe'),_0x45833a,_0x58a1('0xd'),JSON[_0x58a1('0xf')](_0x374b91));if(_0x374b91['error']){if(_0x374b91[_0x58a1('0x10')][_0x58a1('0x11')]===0x1f4){logger[_0x58a1('0x10')](_0x58a1('0xc'),_0x45833a,_0x374b91[_0x58a1('0x10')][_0x58a1('0x12')]);return _0x276800(_0x374b91[_0x58a1('0x10')][_0x58a1('0x12')]);}logger[_0x58a1('0x10')](_0x58a1('0xc'),_0x45833a,_0x374b91[_0x58a1('0x10')]['message']);return _0x365ded(_0x374b91['error'][_0x58a1('0x12')]);}else{logger['info'](_0x58a1('0xc'),_0x45833a,_0x58a1('0xd'));_0x365ded(_0x374b91[_0x58a1('0x13')][_0x58a1('0x12')]);}})[_0x58a1('0x14')](function(_0x5d0a7d){logger[_0x58a1('0x10')](_0x58a1('0xc'),_0x45833a,_0x5d0a7d);_0x276800(_0x5d0a7d);});});} \ No newline at end of file +var _0xd31b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xd31b,0x195));var _0xbd31=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0xd31b[_0x21125f];return _0x2f421d;};'use strict';var _=require(_0xbd31('0x0'));var util=require(_0xbd31('0x1'));var moment=require('moment');var BPromise=require(_0xbd31('0x2'));var rs=require(_0xbd31('0x3'));var fs=require('fs');var Redis=require(_0xbd31('0x4'));var db=require(_0xbd31('0x5'))['db'];var utils=require(_0xbd31('0x6'));var logger=require('../../config/logger')(_0xbd31('0x7'));var config=require(_0xbd31('0x8'));var jayson=require(_0xbd31('0x9'));var client=jayson[_0xbd31('0xa')][_0xbd31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da5e6,_0x1d4ae1,_0x4e318d){return new BPromise(function(_0x52dae4,_0x20f006){return client[_0xbd31('0xc')](_0x5da5e6,_0x4e318d)[_0xbd31('0xd')](function(_0x577cfd){logger[_0xbd31('0xe')](_0xbd31('0xf'),_0x1d4ae1,_0xbd31('0x10'));logger[_0xbd31('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1d4ae1,_0xbd31('0x10'),JSON[_0xbd31('0x12')](_0x577cfd));if(_0x577cfd['error']){if(_0x577cfd[_0xbd31('0x13')][_0xbd31('0x14')]===0x1f4){logger[_0xbd31('0x13')](_0xbd31('0xf'),_0x1d4ae1,_0x577cfd[_0xbd31('0x13')]['message']);return _0x20f006(_0x577cfd['error'][_0xbd31('0x15')]);}logger[_0xbd31('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1d4ae1,_0x577cfd[_0xbd31('0x13')][_0xbd31('0x15')]);return _0x52dae4(_0x577cfd['error'][_0xbd31('0x15')]);}else{logger[_0xbd31('0xe')](_0xbd31('0xf'),_0x1d4ae1,_0xbd31('0x10'));_0x52dae4(_0x577cfd[_0xbd31('0x16')]['message']);}})[_0xbd31('0x17')](function(_0x448d63){logger[_0xbd31('0x13')](_0xbd31('0xf'),_0x1d4ae1,_0x448d63);_0x20f006(_0x448d63);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index fa9b20a..87f319c 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 _0x670b=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','delete','destroy','exports','multer','util','express','fs-extra'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x670b,0x130));var _0xb670=function(_0x5c9867,_0x26cb7e){_0x5c9867=_0x5c9867-0x0;var _0x576180=_0x670b[_0x5c9867];return _0x576180;};'use strict';var multer=require(_0xb670('0x0'));var util=require(_0xb670('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb670('0x2'));var router=express['Router']();var fs_extra=require(_0xb670('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb670('0x4'));var config=require(_0xb670('0x5'));var controller=require('./intZohoField.controller');router[_0xb670('0x6')]('/',auth[_0xb670('0x7')](),controller['index']);router[_0xb670('0x6')](_0xb670('0x8'),auth[_0xb670('0x7')](),controller[_0xb670('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb670('0xa')]);router['put']('/:id',auth[_0xb670('0x7')](),controller['update']);router[_0xb670('0xb')](_0xb670('0x8'),auth[_0xb670('0x7')](),controller[_0xb670('0xc')]);module[_0xb670('0xd')]=router; \ No newline at end of file +var _0xc2c5=['isAuthenticated','index','/:id','post','create','put','exports','multer','util','express','Router','../../config/environment','get'];(function(_0x2b65da,_0x402eb1){var _0x288b1b=function(_0x396f3f){while(--_0x396f3f){_0x2b65da['push'](_0x2b65da['shift']());}};_0x288b1b(++_0x402eb1);}(_0xc2c5,0x1c1));var _0x5c2c=function(_0x3bd019,_0x126b7c){_0x3bd019=_0x3bd019-0x0;var _0x136936=_0xc2c5[_0x3bd019];return _0x136936;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require(_0x5c2c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5c2c('0x2'));var router=express[_0x5c2c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5c2c('0x4'));var controller=require('./intZohoField.controller');router[_0x5c2c('0x5')]('/',auth[_0x5c2c('0x6')](),controller[_0x5c2c('0x7')]);router['get'](_0x5c2c('0x8'),auth[_0x5c2c('0x6')](),controller['show']);router[_0x5c2c('0x9')]('/',auth[_0x5c2c('0x6')](),controller[_0x5c2c('0xa')]);router[_0x5c2c('0xb')](_0x5c2c('0x8'),auth[_0x5c2c('0x6')](),controller['update']);router['delete'](_0x5c2c('0x8'),auth[_0x5c2c('0x6')](),controller['destroy']);module[_0x5c2c('0xc')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8ca85c2..24e227c 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 _0xd137=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','picklist'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd137,0x7b));var _0x7d13=function(_0x4c1020,_0x1db636){_0x4c1020=_0x4c1020-0x0;var _0x50f1e7=_0xd137[_0x4c1020];return _0x50f1e7;};'use strict';var Sequelize=require(_0x7d13('0x0'));module[_0x7d13('0x1')]={'type':{'type':Sequelize[_0x7d13('0x2')](_0x7d13('0x3'),'variable','customVariable','keyValue',_0x7d13('0x4')),'defaultValue':_0x7d13('0x3')},'content':{'type':Sequelize[_0x7d13('0x5')]},'key':{'type':Sequelize[_0x7d13('0x5')]},'keyType':{'type':Sequelize[_0x7d13('0x2')](_0x7d13('0x3'),_0x7d13('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x7d13('0x5')]},'idField':{'type':Sequelize[_0x7d13('0x5')]},'nameField':{'type':Sequelize[_0x7d13('0x5')]},'customField':{'type':Sequelize[_0x7d13('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d13('0x5')]}}; \ No newline at end of file +var _0x953d=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3b7cc9,_0x18cd9b){var _0x5751ea=function(_0x141c47){while(--_0x141c47){_0x3b7cc9['push'](_0x3b7cc9['shift']());}};_0x5751ea(++_0x18cd9b);}(_0x953d,0x101));var _0xd953=function(_0x5ebb4d,_0x3180ec){_0x5ebb4d=_0x5ebb4d-0x0;var _0x7e1980=_0x953d[_0x5ebb4d];return _0x7e1980;};'use strict';var Sequelize=require(_0xd953('0x0'));module[_0xd953('0x1')]={'type':{'type':Sequelize[_0xd953('0x2')](_0xd953('0x3'),_0xd953('0x4'),_0xd953('0x5'),_0xd953('0x6'),'picklist'),'defaultValue':_0xd953('0x3')},'content':{'type':Sequelize[_0xd953('0x7')]},'key':{'type':Sequelize[_0xd953('0x7')]},'keyType':{'type':Sequelize[_0xd953('0x2')](_0xd953('0x3'),_0xd953('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xd953('0x7')]},'idField':{'type':Sequelize[_0xd953('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd953('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4ebd267..ab42478 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 _0x079a=['name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','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','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x079a,0x1a5));var _0xa079=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x079a[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xa079('0x0'));var rimraf=require(_0xa079('0x1'));var zipdir=require(_0xa079('0x2'));var jsonpatch=require(_0xa079('0x3'));var rp=require(_0xa079('0x4'));var moment=require(_0xa079('0x5'));var BPromise=require(_0xa079('0x6'));var Mustache=require(_0xa079('0x7'));var util=require(_0xa079('0x8'));var path=require(_0xa079('0x9'));var sox=require('sox');var csv=require(_0xa079('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa079('0xb'));var squel=require('squel');var crypto=require(_0xa079('0xc'));var jsforce=require(_0xa079('0xd'));var deskjs=require(_0xa079('0xe'));var toCsv=require(_0xa079('0xa'));var querystring=require(_0xa079('0xf'));var Papa=require(_0xa079('0x10'));var Redis=require('ioredis');var authService=require(_0xa079('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa079('0x12'));var hardwareService=require(_0xa079('0x13'));var logger=require(_0xa079('0x14'))(_0xa079('0x15'));var utils=require(_0xa079('0x16'));var config=require(_0xa079('0x17'));var licenseUtil=require(_0xa079('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb92b3e,_0x4dc48e){_0x4dc48e=_0x4dc48e||0xcc;return function(_0x49ff4f){if(_0x49ff4f){return _0xb92b3e[_0xa079('0x19')](_0x4dc48e);}return _0xb92b3e['status'](_0x4dc48e)[_0xa079('0x1a')]();};}function respondWithResult(_0x502651,_0x20bb92){_0x20bb92=_0x20bb92||0xc8;return function(_0x572c48){if(_0x572c48){return _0x502651[_0xa079('0x1b')](_0x20bb92)[_0xa079('0x1c')](_0x572c48);}};}function respondWithFilteredResult(_0x21b8f0,_0x40a369){return function(_0x4b93be){if(_0x4b93be){var _0x399fae=typeof _0x40a369[_0xa079('0x1d')]===_0xa079('0x1e')&&typeof _0x40a369['limit']==='undefined';var _0x5f4713=_0x4b93be['count'];var _0x56396e=_0x399fae?0x0:_0x40a369[_0xa079('0x1d')];var _0x1777fd=_0x399fae?_0x4b93be[_0xa079('0x1f')]:_0x40a369[_0xa079('0x1d')]+_0x40a369[_0xa079('0x20')];var _0x372dc5;if(_0x1777fd>=_0x5f4713){_0x1777fd=_0x5f4713;_0x372dc5=0xc8;}else{_0x372dc5=0xce;}_0x21b8f0[_0xa079('0x1b')](_0x372dc5);return _0x21b8f0[_0xa079('0x21')](_0xa079('0x22'),_0x56396e+'-'+_0x1777fd+'/'+_0x5f4713)[_0xa079('0x1c')](_0x4b93be);}return null;};}function patchUpdates(_0x4a5b54){return function(_0x4435de){try{jsonpatch[_0xa079('0x23')](_0x4435de,_0x4a5b54,!![]);}catch(_0x4acf1c){return BPromise[_0xa079('0x24')](_0x4acf1c);}return _0x4435de[_0xa079('0x25')]();};}function saveUpdates(_0x2f205e,_0x3fa644){return function(_0xeb631){if(_0xeb631){return _0xeb631[_0xa079('0x26')](_0x2f205e)[_0xa079('0x27')](function(_0x1b8e04){return _0x1b8e04;});}return null;};}function removeEntity(_0x5e329b,_0x94e24d){return function(_0x3452b7){if(_0x3452b7){return _0x3452b7[_0xa079('0x28')]()[_0xa079('0x27')](function(){_0x5e329b[_0xa079('0x1b')](0xcc)[_0xa079('0x1a')]();});}};}function handleEntityNotFound(_0x4f3b01,_0x3d97ff){return function(_0x48973a){if(!_0x48973a){_0x4f3b01[_0xa079('0x19')](0x194);}return _0x48973a;};}function handleError(_0x3c8652,_0x2f4e0f){_0x2f4e0f=_0x2f4e0f||0x1f4;return function(_0x458698){logger['error'](_0x458698['stack']);if(_0x458698[_0xa079('0x29')]){delete _0x458698[_0xa079('0x29')];}_0x3c8652[_0xa079('0x1b')](_0x2f4e0f)[_0xa079('0x2a')](_0x458698);};}exports[_0xa079('0x2b')]=function(_0x4688f6,_0x2ffd2d){var _0x1d4abe={},_0x2c1039={},_0x1b4099={'count':0x0,'rows':[]};var _0x4b7a05=_[_0xa079('0x2c')](db['ZohoField'][_0xa079('0x2d')],function(_0x55b968){return{'name':_0x55b968[_0xa079('0x2e')],'type':_0x55b968['type'][_0xa079('0x2f')]};});_0x2c1039['model']=_[_0xa079('0x2c')](_0x4b7a05,_0xa079('0x29'));_0x2c1039[_0xa079('0x30')]=_[_0xa079('0x31')](_0x4688f6['query']);_0x2c1039[_0xa079('0x32')]=_['intersection'](_0x2c1039[_0xa079('0x33')],_0x2c1039[_0xa079('0x30')]);_0x1d4abe[_0xa079('0x34')]=_[_0xa079('0x35')](_0x2c1039[_0xa079('0x33')],qs[_0xa079('0x36')](_0x4688f6[_0xa079('0x30')][_0xa079('0x36')]));_0x1d4abe[_0xa079('0x34')]=_0x1d4abe[_0xa079('0x34')][_0xa079('0x37')]?_0x1d4abe[_0xa079('0x34')]:_0x2c1039[_0xa079('0x33')];if(!_0x4688f6['query'][_0xa079('0x38')](_0xa079('0x39'))){_0x1d4abe['limit']=qs[_0xa079('0x20')](_0x4688f6['query'][_0xa079('0x20')]);_0x1d4abe[_0xa079('0x1d')]=qs[_0xa079('0x1d')](_0x4688f6['query'][_0xa079('0x1d')]);}_0x1d4abe[_0xa079('0x3a')]=qs['sort'](_0x4688f6[_0xa079('0x30')][_0xa079('0x3b')]);_0x1d4abe['where']=qs['filters'](_[_0xa079('0x3c')](_0x4688f6[_0xa079('0x30')],_0x2c1039['filters']),_0x4b7a05);if(_0x4688f6[_0xa079('0x30')][_0xa079('0x3d')]){_0x1d4abe[_0xa079('0x3e')]=_[_0xa079('0x3f')](_0x1d4abe[_0xa079('0x3e')],{'$or':_['map'](_0x4b7a05,function(_0x2e22d1){if(_0x2e22d1['type']!==_0xa079('0x40')){var _0x2569df={};_0x2569df[_0x2e22d1[_0xa079('0x29')]]={'$like':'%'+_0x4688f6[_0xa079('0x30')]['filter']+'%'};return _0x2569df;}})});}_0x1d4abe=_['merge']({},_0x1d4abe,_0x4688f6[_0xa079('0x41')]);var _0x20b714={'where':_0x1d4abe['where']};return db[_0xa079('0x42')][_0xa079('0x1f')](_0x20b714)['then'](function(_0x36c6ca){_0x1b4099[_0xa079('0x1f')]=_0x36c6ca;if(_0x4688f6[_0xa079('0x30')][_0xa079('0x43')]){_0x1d4abe[_0xa079('0x44')]=[{'all':!![]}];}return db['ZohoField'][_0xa079('0x45')](_0x1d4abe);})[_0xa079('0x27')](function(_0x1cf96b){_0x1b4099[_0xa079('0x46')]=_0x1cf96b;return _0x1b4099;})[_0xa079('0x27')](respondWithFilteredResult(_0x2ffd2d,_0x1d4abe))[_0xa079('0x47')](handleError(_0x2ffd2d,null));};exports[_0xa079('0x48')]=function(_0x1be84d,_0x143b26){var _0x3609df={'raw':!![],'where':{'id':_0x1be84d[_0xa079('0x49')]['id']}},_0x25b441={};_0x25b441[_0xa079('0x33')]=_[_0xa079('0x31')](db[_0xa079('0x42')][_0xa079('0x2d')]);_0x25b441[_0xa079('0x30')]=_[_0xa079('0x31')](_0x1be84d['query']);_0x25b441[_0xa079('0x32')]=_[_0xa079('0x35')](_0x25b441[_0xa079('0x33')],_0x25b441[_0xa079('0x30')]);_0x3609df[_0xa079('0x34')]=_[_0xa079('0x35')](_0x25b441['model'],qs[_0xa079('0x36')](_0x1be84d[_0xa079('0x30')][_0xa079('0x36')]));_0x3609df[_0xa079('0x34')]=_0x3609df[_0xa079('0x34')][_0xa079('0x37')]?_0x3609df[_0xa079('0x34')]:_0x25b441[_0xa079('0x33')];if(_0x1be84d['query']['includeAll']){_0x3609df[_0xa079('0x44')]=[{'all':!![]}];}_0x3609df=_[_0xa079('0x3f')]({},_0x3609df,_0x1be84d[_0xa079('0x41')]);return db['ZohoField']['find'](_0x3609df)[_0xa079('0x27')](handleEntityNotFound(_0x143b26,null))[_0xa079('0x27')](respondWithResult(_0x143b26,null))[_0xa079('0x47')](handleError(_0x143b26,null));};exports[_0xa079('0x4a')]=function(_0x5a7a48,_0x4de25f){return db[_0xa079('0x42')]['create'](_0x5a7a48['body'],{})['then'](respondWithResult(_0x4de25f,0xc9))[_0xa079('0x47')](handleError(_0x4de25f,null));};exports['update']=function(_0x679aa1,_0x411ec4){if(_0x679aa1['body']['id']){delete _0x679aa1[_0xa079('0x4b')]['id'];}return db[_0xa079('0x42')][_0xa079('0x4c')]({'where':{'id':_0x679aa1[_0xa079('0x49')]['id']}})['then'](handleEntityNotFound(_0x411ec4,null))[_0xa079('0x27')](saveUpdates(_0x679aa1[_0xa079('0x4b')],null))[_0xa079('0x27')](respondWithResult(_0x411ec4,null))[_0xa079('0x47')](handleError(_0x411ec4,null));};exports[_0xa079('0x28')]=function(_0x323ce2,_0x58f655){return db[_0xa079('0x42')][_0xa079('0x4c')]({'where':{'id':_0x323ce2['params']['id']}})[_0xa079('0x27')](handleEntityNotFound(_0x58f655,null))[_0xa079('0x27')](removeEntity(_0x58f655,null))[_0xa079('0x47')](handleError(_0x58f655,null));}; \ No newline at end of file +var _0x9950=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x460152,_0xa75a42){var _0xd4ecad=function(_0x54745c){while(--_0x54745c){_0x460152['push'](_0x460152['shift']());}};_0xd4ecad(++_0xa75a42);}(_0x9950,0x1ea));var _0x0995=function(_0x3d200f,_0x45af4d){_0x3d200f=_0x3d200f-0x0;var _0x25e3b0=_0x9950[_0x3d200f];return _0x25e3b0;};'use strict';var emlformat=require(_0x0995('0x0'));var rimraf=require(_0x0995('0x1'));var zipdir=require(_0x0995('0x2'));var jsonpatch=require(_0x0995('0x3'));var rp=require(_0x0995('0x4'));var moment=require(_0x0995('0x5'));var BPromise=require(_0x0995('0x6'));var Mustache=require('mustache');var util=require(_0x0995('0x7'));var path=require(_0x0995('0x8'));var sox=require(_0x0995('0x9'));var csv=require(_0x0995('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0995('0xb'));var _=require(_0x0995('0xc'));var squel=require('squel');var crypto=require(_0x0995('0xd'));var jsforce=require(_0x0995('0xe'));var deskjs=require(_0x0995('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0995('0x10'));var Redis=require('ioredis');var authService=require(_0x0995('0x11'));var qs=require(_0x0995('0x12'));var as=require(_0x0995('0x13'));var hardwareService=require(_0x0995('0x14'));var logger=require(_0x0995('0x15'))(_0x0995('0x16'));var utils=require(_0x0995('0x17'));var config=require(_0x0995('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4457d3,_0x5025bb){_0x5025bb=_0x5025bb||0xcc;return function(_0x4cd747){if(_0x4cd747){return _0x4457d3[_0x0995('0x19')](_0x5025bb);}return _0x4457d3[_0x0995('0x1a')](_0x5025bb)[_0x0995('0x1b')]();};}function respondWithResult(_0x1df57b,_0x5be8c3){_0x5be8c3=_0x5be8c3||0xc8;return function(_0x4e1aaf){if(_0x4e1aaf){return _0x1df57b[_0x0995('0x1a')](_0x5be8c3)[_0x0995('0x1c')](_0x4e1aaf);}};}function respondWithFilteredResult(_0x1e453a,_0x5e3c2c){return function(_0x3d3367){if(_0x3d3367){var _0xcfd267=typeof _0x5e3c2c['offset']===_0x0995('0x1d')&&typeof _0x5e3c2c[_0x0995('0x1e')]===_0x0995('0x1d');var _0x19d5e8=_0x3d3367[_0x0995('0x1f')];var _0x3deedd=_0xcfd267?0x0:_0x5e3c2c[_0x0995('0x20')];var _0x3b9cc6=_0xcfd267?_0x3d3367[_0x0995('0x1f')]:_0x5e3c2c['offset']+_0x5e3c2c[_0x0995('0x1e')];var _0x16c7ad;if(_0x3b9cc6>=_0x19d5e8){_0x3b9cc6=_0x19d5e8;_0x16c7ad=0xc8;}else{_0x16c7ad=0xce;}_0x1e453a[_0x0995('0x1a')](_0x16c7ad);return _0x1e453a[_0x0995('0x21')](_0x0995('0x22'),_0x3deedd+'-'+_0x3b9cc6+'/'+_0x19d5e8)[_0x0995('0x1c')](_0x3d3367);}return null;};}function patchUpdates(_0x303ca1){return function(_0x32c99a){try{jsonpatch[_0x0995('0x23')](_0x32c99a,_0x303ca1,!![]);}catch(_0x3b1a89){return BPromise[_0x0995('0x24')](_0x3b1a89);}return _0x32c99a[_0x0995('0x25')]();};}function saveUpdates(_0x43bdfc,_0xe2b155){return function(_0xc1458c){if(_0xc1458c){return _0xc1458c['update'](_0x43bdfc)[_0x0995('0x26')](function(_0x3601e0){return _0x3601e0;});}return null;};}function removeEntity(_0x46536d,_0x27d756){return function(_0x4599fc){if(_0x4599fc){return _0x4599fc['destroy']()[_0x0995('0x26')](function(){_0x46536d['status'](0xcc)[_0x0995('0x1b')]();});}};}function handleEntityNotFound(_0x528dac,_0x1600f9){return function(_0x490664){if(!_0x490664){_0x528dac['sendStatus'](0x194);}return _0x490664;};}function handleError(_0x245090,_0x4bcda0){_0x4bcda0=_0x4bcda0||0x1f4;return function(_0x3490b2){logger[_0x0995('0x27')](_0x3490b2[_0x0995('0x28')]);if(_0x3490b2[_0x0995('0x29')]){delete _0x3490b2[_0x0995('0x29')];}_0x245090['status'](_0x4bcda0)[_0x0995('0x2a')](_0x3490b2);};}exports['index']=function(_0x10cebd,_0x2b48b9){var _0x38d9b8={},_0x1a2b74={},_0x5d2ac1={'count':0x0,'rows':[]};var _0x1444d0=_[_0x0995('0x2b')](db[_0x0995('0x2c')]['rawAttributes'],function(_0x7911bf){return{'name':_0x7911bf[_0x0995('0x2d')],'type':_0x7911bf[_0x0995('0x2e')]['key']};});_0x1a2b74[_0x0995('0x2f')]=_['map'](_0x1444d0,_0x0995('0x29'));_0x1a2b74[_0x0995('0x30')]=_[_0x0995('0x31')](_0x10cebd['query']);_0x1a2b74[_0x0995('0x32')]=_[_0x0995('0x33')](_0x1a2b74[_0x0995('0x2f')],_0x1a2b74[_0x0995('0x30')]);_0x38d9b8[_0x0995('0x34')]=_[_0x0995('0x33')](_0x1a2b74[_0x0995('0x2f')],qs[_0x0995('0x35')](_0x10cebd[_0x0995('0x30')][_0x0995('0x35')]));_0x38d9b8[_0x0995('0x34')]=_0x38d9b8[_0x0995('0x34')][_0x0995('0x36')]?_0x38d9b8[_0x0995('0x34')]:_0x1a2b74[_0x0995('0x2f')];if(!_0x10cebd[_0x0995('0x30')][_0x0995('0x37')](_0x0995('0x38'))){_0x38d9b8[_0x0995('0x1e')]=qs[_0x0995('0x1e')](_0x10cebd[_0x0995('0x30')][_0x0995('0x1e')]);_0x38d9b8[_0x0995('0x20')]=qs[_0x0995('0x20')](_0x10cebd['query'][_0x0995('0x20')]);}_0x38d9b8[_0x0995('0x39')]=qs[_0x0995('0x3a')](_0x10cebd[_0x0995('0x30')][_0x0995('0x3a')]);_0x38d9b8['where']=qs[_0x0995('0x32')](_[_0x0995('0x3b')](_0x10cebd[_0x0995('0x30')],_0x1a2b74[_0x0995('0x32')]),_0x1444d0);if(_0x10cebd['query'][_0x0995('0x3c')]){_0x38d9b8[_0x0995('0x3d')]=_[_0x0995('0x3e')](_0x38d9b8['where'],{'$or':_[_0x0995('0x2b')](_0x1444d0,function(_0xfdf42b){if(_0xfdf42b['type']!=='VIRTUAL'){var _0x89539e={};_0x89539e[_0xfdf42b[_0x0995('0x29')]]={'$like':'%'+_0x10cebd[_0x0995('0x30')][_0x0995('0x3c')]+'%'};return _0x89539e;}})});}_0x38d9b8=_[_0x0995('0x3e')]({},_0x38d9b8,_0x10cebd[_0x0995('0x3f')]);var _0x56aa19={'where':_0x38d9b8[_0x0995('0x3d')]};return db[_0x0995('0x2c')][_0x0995('0x1f')](_0x56aa19)['then'](function(_0x1435ad){_0x5d2ac1[_0x0995('0x1f')]=_0x1435ad;if(_0x10cebd[_0x0995('0x30')]['includeAll']){_0x38d9b8[_0x0995('0x40')]=[{'all':!![]}];}return db[_0x0995('0x2c')][_0x0995('0x41')](_0x38d9b8);})[_0x0995('0x26')](function(_0x4ed330){_0x5d2ac1[_0x0995('0x42')]=_0x4ed330;return _0x5d2ac1;})['then'](respondWithFilteredResult(_0x2b48b9,_0x38d9b8))[_0x0995('0x43')](handleError(_0x2b48b9,null));};exports['show']=function(_0x41a46d,_0xa939e1){var _0x242296={'raw':!![],'where':{'id':_0x41a46d[_0x0995('0x44')]['id']}},_0x1a19e9={};_0x1a19e9[_0x0995('0x2f')]=_[_0x0995('0x31')](db[_0x0995('0x2c')][_0x0995('0x45')]);_0x1a19e9['query']=_['keys'](_0x41a46d[_0x0995('0x30')]);_0x1a19e9[_0x0995('0x32')]=_[_0x0995('0x33')](_0x1a19e9[_0x0995('0x2f')],_0x1a19e9[_0x0995('0x30')]);_0x242296[_0x0995('0x34')]=_['intersection'](_0x1a19e9[_0x0995('0x2f')],qs[_0x0995('0x35')](_0x41a46d[_0x0995('0x30')][_0x0995('0x35')]));_0x242296['attributes']=_0x242296['attributes'][_0x0995('0x36')]?_0x242296[_0x0995('0x34')]:_0x1a19e9[_0x0995('0x2f')];if(_0x41a46d[_0x0995('0x30')]['includeAll']){_0x242296[_0x0995('0x40')]=[{'all':!![]}];}_0x242296=_[_0x0995('0x3e')]({},_0x242296,_0x41a46d[_0x0995('0x3f')]);return db[_0x0995('0x2c')][_0x0995('0x46')](_0x242296)['then'](handleEntityNotFound(_0xa939e1,null))[_0x0995('0x26')](respondWithResult(_0xa939e1,null))['catch'](handleError(_0xa939e1,null));};exports[_0x0995('0x47')]=function(_0x21e5a6,_0x2418a3){return db[_0x0995('0x2c')]['create'](_0x21e5a6[_0x0995('0x48')],{})[_0x0995('0x26')](respondWithResult(_0x2418a3,0xc9))[_0x0995('0x43')](handleError(_0x2418a3,null));};exports['update']=function(_0x5d777b,_0x4e5918){if(_0x5d777b[_0x0995('0x48')]['id']){delete _0x5d777b[_0x0995('0x48')]['id'];}return db[_0x0995('0x2c')][_0x0995('0x46')]({'where':{'id':_0x5d777b[_0x0995('0x44')]['id']}})[_0x0995('0x26')](handleEntityNotFound(_0x4e5918,null))[_0x0995('0x26')](saveUpdates(_0x5d777b['body'],null))[_0x0995('0x26')](respondWithResult(_0x4e5918,null))[_0x0995('0x43')](handleError(_0x4e5918,null));};exports['destroy']=function(_0x1493e1,_0x13af27){return db[_0x0995('0x2c')]['find']({'where':{'id':_0x1493e1[_0x0995('0x44')]['id']}})[_0x0995('0x26')](handleEntityNotFound(_0x13af27,null))[_0x0995('0x26')](removeEntity(_0x13af27,null))[_0x0995('0x43')](handleError(_0x13af27,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index c379346..c5b5d77 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 _0x1967=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger','api','moment'];(function(_0x48e69c,_0x317196){var _0x4d9a29=function(_0x41b40d){while(--_0x41b40d){_0x48e69c['push'](_0x48e69c['shift']());}};_0x4d9a29(++_0x317196);}(_0x1967,0x173));var _0x7196=function(_0x33fbac,_0x461896){_0x33fbac=_0x33fbac-0x0;var _0x3c5c50=_0x1967[_0x33fbac];return _0x3c5c50;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'fields':['idField',_0x7196('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a6d=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xc7dde8,_0x1d3651){var _0x19efa3=function(_0x10a00b){while(--_0x10a00b){_0xc7dde8['push'](_0xc7dde8['shift']());}};_0x19efa3(++_0x1d3651);}(_0x3a6d,0x143));var _0xd3a6=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3a6d[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('ZohoField',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 28ba9a6..6037d5a 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 _0xf3da=['ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x159963,_0x273e6a){var _0x5879e4=function(_0x12767a){while(--_0x12767a){_0x159963['push'](_0x159963['shift']());}};_0x5879e4(++_0x273e6a);}(_0xf3da,0xc5));var _0xaf3d=function(_0x2bfada,_0x1df3c9){_0x2bfada=_0x2bfada-0x0;var _0x1311c7=_0xf3da[_0x2bfada];return _0x1311c7;};'use strict';var _=require(_0xaf3d('0x0'));var util=require(_0xaf3d('0x1'));var moment=require('moment');var BPromise=require(_0xaf3d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf3d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf3d('0x4'));var logger=require(_0xaf3d('0x5'))(_0xaf3d('0x6'));var config=require('../../config/environment');var jayson=require(_0xaf3d('0x7'));var client=jayson[_0xaf3d('0x8')][_0xaf3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d92e,_0x1d9eea,_0x4dfcb7){return new BPromise(function(_0x546414,_0x413866){return client[_0xaf3d('0xa')](_0x20d92e,_0x4dfcb7)[_0xaf3d('0xb')](function(_0x1e8e8a){logger[_0xaf3d('0xc')](_0xaf3d('0xd'),_0x1d9eea,_0xaf3d('0xe'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x1d9eea,_0xaf3d('0xe'),JSON[_0xaf3d('0xf')](_0x1e8e8a));if(_0x1e8e8a['error']){if(_0x1e8e8a[_0xaf3d('0x10')][_0xaf3d('0x11')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x1d9eea,_0x1e8e8a['error'][_0xaf3d('0x12')]);return _0x413866(_0x1e8e8a['error'][_0xaf3d('0x12')]);}logger[_0xaf3d('0x10')](_0xaf3d('0xd'),_0x1d9eea,_0x1e8e8a[_0xaf3d('0x10')][_0xaf3d('0x12')]);return _0x546414(_0x1e8e8a['error']['message']);}else{logger['info'](_0xaf3d('0xd'),_0x1d9eea,_0xaf3d('0xe'));_0x546414(_0x1e8e8a[_0xaf3d('0x13')][_0xaf3d('0x12')]);}})[_0xaf3d('0x14')](function(_0x5ebf77){logger[_0xaf3d('0x10')](_0xaf3d('0xd'),_0x1d9eea,_0x5ebf77);_0x413866(_0x5ebf77);});});} \ No newline at end of file +var _0x85dc=['jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x42c42b,_0xf72856){var _0x4c0eb0=function(_0x294138){while(--_0x294138){_0x42c42b['push'](_0x42c42b['shift']());}};_0x4c0eb0(++_0xf72856);}(_0x85dc,0xa9));var _0xc85d=function(_0x222834,_0x11bac8){_0x222834=_0x222834-0x0;var _0x30ea5f=_0x85dc[_0x222834];return _0x30ea5f;};'use strict';var _=require(_0xc85d('0x0'));var util=require(_0xc85d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc85d('0x2'));var db=require(_0xc85d('0x3'))['db'];var utils=require(_0xc85d('0x4'));var logger=require(_0xc85d('0x5'))(_0xc85d('0x6'));var config=require('../../config/environment');var jayson=require(_0xc85d('0x7'));var client=jayson[_0xc85d('0x8')][_0xc85d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12101c,_0x1c8412,_0x5c8c96){return new BPromise(function(_0x318832,_0x23eb26){return client[_0xc85d('0xa')](_0x12101c,_0x5c8c96)[_0xc85d('0xb')](function(_0x3956e9){logger[_0xc85d('0xc')](_0xc85d('0xd'),_0x1c8412,_0xc85d('0xe'));logger[_0xc85d('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1c8412,_0xc85d('0xe'),JSON[_0xc85d('0x10')](_0x3956e9));if(_0x3956e9['error']){if(_0x3956e9[_0xc85d('0x11')][_0xc85d('0x12')]===0x1f4){logger[_0xc85d('0x11')](_0xc85d('0xd'),_0x1c8412,_0x3956e9[_0xc85d('0x11')][_0xc85d('0x13')]);return _0x23eb26(_0x3956e9[_0xc85d('0x11')][_0xc85d('0x13')]);}logger['error'](_0xc85d('0xd'),_0x1c8412,_0x3956e9[_0xc85d('0x11')][_0xc85d('0x13')]);return _0x318832(_0x3956e9[_0xc85d('0x11')]['message']);}else{logger[_0xc85d('0xc')](_0xc85d('0xd'),_0x1c8412,'request\x20sent');_0x318832(_0x3956e9[_0xc85d('0x14')]['message']);}})[_0xc85d('0x15')](function(_0x33e39b){logger[_0xc85d('0x11')]('ZohoField,\x20%s,\x20%s',_0x1c8412,_0x33e39b);_0x23eb26(_0x33e39b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8cce19e..8f9e827 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1bd39f,_0x53ad83){var _0x42ecb0=function(_0x5032c1){while(--_0x5032c1){_0x1bd39f['push'](_0x1bd39f['shift']());}};_0x42ecb0(++_0x53ad83);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x26baee,_0x1e7855){var _0x46e2ee=function(_0x58d29e){while(--_0x58d29e){_0x26baee['push'](_0x26baee['shift']());}};_0x46e2ee(++_0x1e7855);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xcb91[_0x2d994d];return _0xd54be4;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b43801d..b84b939 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 _0xb353=['exports','STRING','unique_name_and_version','BOOLEAN','state','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb353,0x1e5));var _0x3b35=function(_0x5de7c8,_0x392fc9){_0x5de7c8=_0x5de7c8-0x0;var _0xb4ff18=_0xb353[_0x5de7c8];return _0xb4ff18;};'use strict';var Sequelize=require(_0x3b35('0x0'));module[_0x3b35('0x1')]={'name':{'type':Sequelize[_0x3b35('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x3b35('0x2')],'allowNull':![],'unique':_0x3b35('0x3')},'main':{'type':Sequelize[_0x3b35('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x3b35('0x2')]},'path':{'type':Sequelize[_0x3b35('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3b35('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3b35('0x2')]},'logo':{'type':Sequelize[_0x3b35('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x3b35('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x3b35('0x2')]},'remoteUri':{'type':Sequelize[_0x3b35('0x2')]},'link':{'type':Sequelize[_0x3b35('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xfdc1=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','sequelize'];(function(_0x5cb4c0,_0x237d4b){var _0x634de7=function(_0xb91e7f){while(--_0xb91e7f){_0x5cb4c0['push'](_0x5cb4c0['shift']());}};_0x634de7(++_0x237d4b);}(_0xfdc1,0x71));var _0x1fdc=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0xfdc1[_0x3239f5];return _0x3559c8;};'use strict';var Sequelize=require(_0x1fdc('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fdc('0x1')],'allowNull':![],'unique':_0x1fdc('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x1fdc('0x1')],'defaultValue':_0x1fdc('0x3')},'filename':{'type':Sequelize[_0x1fdc('0x1')]},'path':{'type':Sequelize[_0x1fdc('0x1')]},'type':{'type':Sequelize[_0x1fdc('0x1')]},'size':{'type':Sequelize[_0x1fdc('0x4')]},'active':{'type':Sequelize[_0x1fdc('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x1fdc('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x1fdc('0x1')]},'title':{'type':Sequelize[_0x1fdc('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x1fdc('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 08ac6b1..8e08994 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 _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x39f375,_0x3aa8ec){var _0x463f93=function(_0x290215){while(--_0x290215){_0x39f375['push'](_0x39f375['shift']());}};_0x463f93(++_0x3aa8ec);}(_0x9582,0x95));var _0x2958=function(_0x3b0779,_0x47ce14){_0x3b0779=_0x3b0779-0x0;var _0x123e51=_0x9582[_0x3b0779];return _0x123e51;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +var _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x821c5e,_0x2d3da3){var _0x2675ba=function(_0x574064){while(--_0x574064){_0x821c5e['push'](_0x821c5e['shift']());}};_0x2675ba(++_0x2d3da3);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4d32e3,_0x55bb28){_0x4d32e3=_0x4d32e3-0x0;var _0xf228ab=_0x9f0e[_0x4d32e3];return _0xf228ab;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index a719f4e..87a9fc1 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 _0x3bcb=['../../config/environment','Integration','integrations','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x544167,_0x2764bc){var _0x49db33=function(_0xedd52e){while(--_0xedd52e){_0x544167['push'](_0x544167['shift']());}};_0x49db33(++_0x2764bc);}(_0x3bcb,0x18f));var _0xb3bc=function(_0x451539,_0x4ddef2){_0x451539=_0x451539-0x0;var _0x290fd9=_0x3bcb[_0x451539];return _0x290fd9;};'use strict';var _=require(_0xb3bc('0x0'));var util=require('util');var logger=require(_0xb3bc('0x1'))('api');var moment=require(_0xb3bc('0x2'));var BPromise=require(_0xb3bc('0x3'));var rp=require(_0xb3bc('0x4'));var fs=require('fs');var path=require(_0xb3bc('0x5'));var rimraf=require('rimraf');var config=require(_0xb3bc('0x6'));var attributes=require('./integration.attributes');module['exports']=function(_0x559169,_0x59145f){return _0x559169['define'](_0xb3bc('0x7'),attributes,{'tableName':_0xb3bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2dd=['../../config/environment','./integration.attributes','exports','define','Integration','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd2dd,0x186));var _0xdd2d=function(_0xaf05eb,_0x2918f6){_0xaf05eb=_0xaf05eb-0x0;var _0x39c7df=_0xd2dd[_0xaf05eb];return _0x39c7df;};'use strict';var _=require('lodash');var util=require(_0xdd2d('0x0'));var logger=require(_0xdd2d('0x1'))(_0xdd2d('0x2'));var moment=require(_0xdd2d('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd2d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd2d('0x5'));var config=require(_0xdd2d('0x6'));var attributes=require(_0xdd2d('0x7'));module[_0xdd2d('0x8')]=function(_0x281e12,_0x517d5a){return _0x281e12[_0xdd2d('0x9')](_0xdd2d('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index f279c26..06fbb34 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 _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x1967,0x173));var _0x7196=function(_0x415b53,_0x3de2e3){_0x415b53=_0x415b53-0x0;var _0x4416bc=_0x1967[_0x415b53];return _0x4416bc;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x27e371,_0x27cf8a){var _0x496b85=function(_0x3d69d3){while(--_0x3d69d3){_0x27e371['push'](_0x27e371['shift']());}};_0x496b85(++_0x27cf8a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 11b83db..0e87832 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0xadb5,0xad));var _0x5adb=function(_0x41e650,_0x2db934){_0x41e650=_0x41e650-0x0;var _0x99cf75=_0xadb5[_0x41e650];return _0x99cf75;};'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('./integrationReport.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 _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x32cd89,_0x147c7f){var _0x1fcbe3=function(_0x55b49b){while(--_0x55b49b){_0x32cd89['push'](_0x32cd89['shift']());}};_0x1fcbe3(++_0x147c7f);}(_0xc2c7,0x134));var _0x7c2c=function(_0x389ac9,_0x4e1165){_0x389ac9=_0x389ac9-0x0;var _0xe2f129=_0xc2c7[_0x389ac9];return _0xe2f129;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f243ddd..a623e6b 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 _0x990e=['ENUM','SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x990e,0x139));var _0xe990=function(_0x30d54b,_0x47b7db){_0x30d54b=_0x30d54b-0x0;var _0x1b80af=_0x990e[_0x30d54b];return _0x1b80af;};'use strict';var Sequelize=require(_0xe990('0x0'));module[_0xe990('0x1')]={'integration':{'type':Sequelize[_0xe990('0x2')]},'eventChannel':{'type':Sequelize[_0xe990('0x2')]},'exitStatus':{'type':Sequelize[_0xe990('0x2')]},'ticketId':{'type':Sequelize[_0xe990('0x2')]},'integrationId':{'type':Sequelize[_0xe990('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe990('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe990('0x2')]},'interface':{'type':Sequelize[_0xe990('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe990('0x4')]},'agentconnectAt':{'type':Sequelize[_0xe990('0x4')]},'holdtime':{'type':Sequelize[_0xe990('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe990('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe990('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xe990('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe990('0x4')]},'agentdump':{'type':Sequelize[_0xe990('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe990('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe990('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe990('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe990('0x2')]},'connectedlinename':{'type':Sequelize[_0xe990('0x2')]},'language':{'type':Sequelize[_0xe990('0x2')]},'accountcode':{'type':Sequelize[_0xe990('0x2')]},'context':{'type':Sequelize[_0xe990('0x2')]},'exten':{'type':Sequelize[_0xe990('0x2')]},'priority':{'type':Sequelize[_0xe990('0x2')]},'destchannel':{'type':Sequelize[_0xe990('0x2')]},'destchannelstate':{'type':Sequelize[_0xe990('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe990('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe990('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe990('0x2')]},'destlanguage':{'type':Sequelize[_0xe990('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe990('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe990('0x2')]},'destuniqueid':{'type':Sequelize[_0xe990('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xe990('0x2')]},'subject':{'type':Sequelize[_0xe990('0x2')]},'from':{'type':Sequelize[_0xe990('0x2')]},'to':{'type':Sequelize[_0xe990('0x2')]},'cc':{'type':Sequelize[_0xe990('0x2')]},'attachment':{'type':Sequelize[_0xe990('0x6')]},'html':{'type':Sequelize[_0xe990('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xe990('0x7')]('SENT',_0xe990('0x8'),_0xe990('0x9'),'FAILED')},'url':{'type':Sequelize[_0xe990('0x2')]},'app':{'type':Sequelize[_0xe990('0x2')]},'appdata':{'type':Sequelize[_0xe990('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x027c=['FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENDING','RECEIVED'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x027c,0x90));var _0xc027=function(_0x506bfc,_0x33605e){_0x506bfc=_0x506bfc-0x0;var _0x202bfa=_0x027c[_0x506bfc];return _0x202bfa;};'use strict';var Sequelize=require(_0xc027('0x0'));module[_0xc027('0x1')]={'integration':{'type':Sequelize[_0xc027('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xc027('0x2')]},'ticketId':{'type':Sequelize[_0xc027('0x2')]},'integrationId':{'type':Sequelize[_0xc027('0x3')]},'contacts':{'type':Sequelize[_0xc027('0x2')]},'uniqueid':{'type':Sequelize[_0xc027('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc027('0x2')]},'queue':{'type':Sequelize[_0xc027('0x2')]},'interface':{'type':Sequelize[_0xc027('0x2')]},'membername':{'type':Sequelize[_0xc027('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc027('0x3')]},'agentcomplete':{'type':Sequelize[_0xc027('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc027('0x5')]},'talktime':{'type':Sequelize[_0xc027('0x3')]},'agentacw':{'type':Sequelize[_0xc027('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc027('0x3')]},'reason':{'type':Sequelize[_0xc027('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc027('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc027('0x5')]},'agentdump':{'type':Sequelize[_0xc027('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xc027('0x2')]},'channel':{'type':Sequelize[_0xc027('0x2')]},'channelstate':{'type':Sequelize[_0xc027('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc027('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc027('0x2')]},'language':{'type':Sequelize[_0xc027('0x2')]},'accountcode':{'type':Sequelize[_0xc027('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xc027('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc027('0x2')]},'destchannelstate':{'type':Sequelize[_0xc027('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc027('0x2')]},'destcalleridname':{'type':Sequelize[_0xc027('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc027('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc027('0x2')]},'destlanguage':{'type':Sequelize[_0xc027('0x2')]},'destaccountcode':{'type':Sequelize[_0xc027('0x2')]},'destcontext':{'type':Sequelize[_0xc027('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xc027('0x2')]},'destuniqueid':{'type':Sequelize[_0xc027('0x2')]},'messageId':{'type':Sequelize[_0xc027('0x2')]},'inReplyTo':{'type':Sequelize[_0xc027('0x2')]},'subject':{'type':Sequelize[_0xc027('0x2')]},'from':{'type':Sequelize[_0xc027('0x2')]},'to':{'type':Sequelize[_0xc027('0x2')]},'cc':{'type':Sequelize[_0xc027('0x2')]},'attachment':{'type':Sequelize[_0xc027('0x6')]},'html':{'type':Sequelize[_0xc027('0x6')]},'text':{'type':Sequelize[_0xc027('0x6')]},'status':{'type':Sequelize[_0xc027('0x7')]('SENT',_0xc027('0x8'),_0xc027('0x9'),_0xc027('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xc027('0x2')]},'appdata':{'type':Sequelize[_0xc027('0x2')]},'projectId':{'type':Sequelize[_0xc027('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index ea77011..012aa95 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 _0x90e4=['send','index','IntegrationReport','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','merge','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','count','offset','Content-Range','json','update','then','destroy','error','stack','name'];(function(_0x1ae8ad,_0x3aef1c){var _0x173dd0=function(_0x29c8b2){while(--_0x29c8b2){_0x1ae8ad['push'](_0x1ae8ad['shift']());}};_0x173dd0(++_0x3aef1c);}(_0x90e4,0x143));var _0x490e=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x90e4[_0x3c2166];return _0x30ccc3;};'use strict';var emlformat=require(_0x490e('0x0'));var rimraf=require(_0x490e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x490e('0x2'));var rp=require(_0x490e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x490e('0x4'));var csv=require(_0x490e('0x5'));var ejs=require(_0x490e('0x6'));var fs=require('fs');var fs_extra=require(_0x490e('0x7'));var _=require(_0x490e('0x8'));var squel=require(_0x490e('0x9'));var crypto=require(_0x490e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x490e('0xb'));var toCsv=require(_0x490e('0x5'));var querystring=require(_0x490e('0xc'));var Papa=require('papaparse');var Redis=require(_0x490e('0xd'));var authService=require(_0x490e('0xe'));var qs=require(_0x490e('0xf'));var as=require(_0x490e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x490e('0x11'))(_0x490e('0x12'));var utils=require(_0x490e('0x13'));var config=require(_0x490e('0x14'));var licenseUtil=require(_0x490e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x108b02,_0x201f24){_0x201f24=_0x201f24||0xcc;return function(_0x4bb5ed){if(_0x4bb5ed){return _0x108b02[_0x490e('0x16')](_0x201f24);}return _0x108b02[_0x490e('0x17')](_0x201f24)[_0x490e('0x18')]();};}function respondWithResult(_0xfbe065,_0x1957ff){_0x1957ff=_0x1957ff||0xc8;return function(_0x35d244){if(_0x35d244){return _0xfbe065[_0x490e('0x17')](_0x1957ff)['json'](_0x35d244);}};}function respondWithFilteredResult(_0x375e7e,_0x3a4186){return function(_0x4f356d){if(_0x4f356d){var _0x530846=typeof _0x3a4186['offset']===_0x490e('0x19')&&typeof _0x3a4186[_0x490e('0x1a')]==='undefined';var _0x2c68ac=_0x4f356d[_0x490e('0x1b')];var _0x4f45a3=_0x530846?0x0:_0x3a4186[_0x490e('0x1c')];var _0x142ca0=_0x530846?_0x4f356d[_0x490e('0x1b')]:_0x3a4186[_0x490e('0x1c')]+_0x3a4186['limit'];var _0x354ff8;if(_0x142ca0>=_0x2c68ac){_0x142ca0=_0x2c68ac;_0x354ff8=0xc8;}else{_0x354ff8=0xce;}_0x375e7e[_0x490e('0x17')](_0x354ff8);return _0x375e7e['set'](_0x490e('0x1d'),_0x4f45a3+'-'+_0x142ca0+'/'+_0x2c68ac)[_0x490e('0x1e')](_0x4f356d);}return null;};}function patchUpdates(_0x4d5c90){return function(_0x36a905){try{jsonpatch['apply'](_0x36a905,_0x4d5c90,!![]);}catch(_0x523d4e){return BPromise['reject'](_0x523d4e);}return _0x36a905['save']();};}function saveUpdates(_0x471806,_0x566048){return function(_0x2f5c61){if(_0x2f5c61){return _0x2f5c61[_0x490e('0x1f')](_0x471806)[_0x490e('0x20')](function(_0xab07af){return _0xab07af;});}return null;};}function removeEntity(_0x45f00c,_0x5aeb24){return function(_0x2bfdc4){if(_0x2bfdc4){return _0x2bfdc4[_0x490e('0x21')]()[_0x490e('0x20')](function(){_0x45f00c[_0x490e('0x17')](0xcc)[_0x490e('0x18')]();});}};}function handleEntityNotFound(_0x446ef6,_0x3be342){return function(_0x227512){if(!_0x227512){_0x446ef6[_0x490e('0x16')](0x194);}return _0x227512;};}function handleError(_0x41694b,_0x2becf8){_0x2becf8=_0x2becf8||0x1f4;return function(_0x2dd6b1){logger[_0x490e('0x22')](_0x2dd6b1[_0x490e('0x23')]);if(_0x2dd6b1[_0x490e('0x24')]){delete _0x2dd6b1[_0x490e('0x24')];}_0x41694b[_0x490e('0x17')](_0x2becf8)[_0x490e('0x25')](_0x2dd6b1);};}exports[_0x490e('0x26')]=function(_0x398874,_0x2156df){var _0x56776e={},_0x166053={},_0x6af997={'count':0x0,'rows':[]};var _0x508adb=_['map'](db[_0x490e('0x27')][_0x490e('0x28')],function(_0x8f1ed2){return{'name':_0x8f1ed2[_0x490e('0x29')],'type':_0x8f1ed2['type']['key']};});_0x166053[_0x490e('0x2a')]=_[_0x490e('0x2b')](_0x508adb,_0x490e('0x24'));_0x166053['query']=_[_0x490e('0x2c')](_0x398874[_0x490e('0x2d')]);_0x166053[_0x490e('0x2e')]=_[_0x490e('0x2f')](_0x166053[_0x490e('0x2a')],_0x166053['query']);_0x56776e[_0x490e('0x30')]=_[_0x490e('0x2f')](_0x166053[_0x490e('0x2a')],qs[_0x490e('0x31')](_0x398874['query'][_0x490e('0x31')]));_0x56776e[_0x490e('0x30')]=_0x56776e[_0x490e('0x30')][_0x490e('0x32')]?_0x56776e[_0x490e('0x30')]:_0x166053['model'];if(!_0x398874['query']['hasOwnProperty'](_0x490e('0x33'))){_0x56776e[_0x490e('0x1a')]=qs[_0x490e('0x1a')](_0x398874[_0x490e('0x2d')][_0x490e('0x1a')]);_0x56776e[_0x490e('0x1c')]=qs[_0x490e('0x1c')](_0x398874['query'][_0x490e('0x1c')]);}_0x56776e[_0x490e('0x34')]=qs[_0x490e('0x35')](_0x398874['query']['sort']);_0x56776e['where']=qs[_0x490e('0x2e')](_[_0x490e('0x36')](_0x398874[_0x490e('0x2d')],_0x166053[_0x490e('0x2e')]),_0x508adb);if(_0x398874[_0x490e('0x2d')][_0x490e('0x37')]){_0x56776e[_0x490e('0x38')]=_['merge'](_0x56776e['where'],{'$or':_[_0x490e('0x2b')](_0x508adb,function(_0x327d5f){if(_0x327d5f[_0x490e('0x39')]!==_0x490e('0x3a')){var _0x18d7d9={};_0x18d7d9[_0x327d5f[_0x490e('0x24')]]={'$like':'%'+_0x398874[_0x490e('0x2d')]['filter']+'%'};return _0x18d7d9;}})});}_0x56776e=_['merge']({},_0x56776e,_0x398874[_0x490e('0x3b')]);var _0x36e5c5={'where':_0x56776e[_0x490e('0x38')]};return db[_0x490e('0x27')][_0x490e('0x1b')](_0x36e5c5)[_0x490e('0x20')](function(_0x43bdfa){_0x6af997[_0x490e('0x1b')]=_0x43bdfa;if(_0x398874[_0x490e('0x2d')][_0x490e('0x3c')]){_0x56776e['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x490e('0x3d')](_0x56776e);})['then'](function(_0x3da319){_0x6af997[_0x490e('0x3e')]=_0x3da319;return _0x6af997;})[_0x490e('0x20')](respondWithFilteredResult(_0x2156df,_0x56776e))[_0x490e('0x3f')](handleError(_0x2156df,null));};exports[_0x490e('0x40')]=function(_0x2004d5,_0x25ab32){var _0x38e693={'raw':![],'where':{'id':_0x2004d5['params']['id']}},_0xd1aba2={};_0xd1aba2[_0x490e('0x2a')]=_[_0x490e('0x2c')](db[_0x490e('0x27')][_0x490e('0x28')]);_0xd1aba2[_0x490e('0x2d')]=_['keys'](_0x2004d5[_0x490e('0x2d')]);_0xd1aba2['filters']=_[_0x490e('0x2f')](_0xd1aba2['model'],_0xd1aba2['query']);_0x38e693['attributes']=_['intersection'](_0xd1aba2[_0x490e('0x2a')],qs[_0x490e('0x31')](_0x2004d5[_0x490e('0x2d')][_0x490e('0x31')]));_0x38e693[_0x490e('0x30')]=_0x38e693['attributes'][_0x490e('0x32')]?_0x38e693[_0x490e('0x30')]:_0xd1aba2['model'];if(_0x2004d5['query'][_0x490e('0x3c')]){_0x38e693[_0x490e('0x41')]=[{'all':!![]}];}_0x38e693=_[_0x490e('0x42')]({},_0x38e693,_0x2004d5[_0x490e('0x3b')]);return db[_0x490e('0x27')][_0x490e('0x43')](_0x38e693)[_0x490e('0x20')](handleEntityNotFound(_0x25ab32,null))[_0x490e('0x20')](respondWithResult(_0x25ab32,null))[_0x490e('0x3f')](handleError(_0x25ab32,null));};exports[_0x490e('0x44')]=function(_0x2ad2fa,_0x2a9579){return db[_0x490e('0x27')][_0x490e('0x44')](_0x2ad2fa[_0x490e('0x45')],{})[_0x490e('0x20')](respondWithResult(_0x2a9579,0xc9))[_0x490e('0x3f')](handleError(_0x2a9579,null));};exports[_0x490e('0x1f')]=function(_0x1d00a7,_0x143f5e){if(_0x1d00a7['body']['id']){delete _0x1d00a7[_0x490e('0x45')]['id'];}return db[_0x490e('0x27')][_0x490e('0x43')]({'where':{'id':_0x1d00a7['params']['id']}})['then'](handleEntityNotFound(_0x143f5e,null))[_0x490e('0x20')](saveUpdates(_0x1d00a7['body'],null))[_0x490e('0x20')](respondWithResult(_0x143f5e,null))[_0x490e('0x3f')](handleError(_0x143f5e,null));};exports['destroy']=function(_0x1ecd48,_0xe4c4d){return db['IntegrationReport']['find']({'where':{'id':_0x1ecd48[_0x490e('0x46')]['id']}})[_0x490e('0x20')](handleEntityNotFound(_0xe4c4d,null))[_0x490e('0x20')](removeEntity(_0xe4c4d,null))[_0x490e('0x3f')](handleError(_0xe4c4d,null));};exports['describe']=function(_0x4c42a4,_0x29d8f2){return db[_0x490e('0x27')][_0x490e('0x47')]()['then'](respondWithResult(_0x29d8f2,null))[_0x490e('0x3f')](handleError(_0x29d8f2,null));}; \ No newline at end of file +var _0x46ef=['find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','IntegrationReport','includeAll','include','findAll','rows','catch','params'];(function(_0xf9b13c,_0x299539){var _0x226bf1=function(_0x21bb9e){while(--_0x21bb9e){_0xf9b13c['push'](_0xf9b13c['shift']());}};_0x226bf1(++_0x299539);}(_0x46ef,0xec));var _0xf46e=function(_0x39da73,_0x4a8395){_0x39da73=_0x39da73-0x0;var _0x461032=_0x46ef[_0x39da73];return _0x461032;};'use strict';var emlformat=require(_0xf46e('0x0'));var rimraf=require(_0xf46e('0x1'));var zipdir=require(_0xf46e('0x2'));var jsonpatch=require(_0xf46e('0x3'));var rp=require('request-promise');var moment=require(_0xf46e('0x4'));var BPromise=require(_0xf46e('0x5'));var Mustache=require(_0xf46e('0x6'));var util=require(_0xf46e('0x7'));var path=require(_0xf46e('0x8'));var sox=require(_0xf46e('0x9'));var csv=require(_0xf46e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf46e('0xb'));var squel=require(_0xf46e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf46e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf46e('0xa'));var querystring=require(_0xf46e('0xe'));var Papa=require('papaparse');var Redis=require(_0xf46e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf46e('0x10'));var as=require(_0xf46e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf46e('0x12'))(_0xf46e('0x13'));var utils=require(_0xf46e('0x14'));var config=require(_0xf46e('0x15'));var licenseUtil=require(_0xf46e('0x16'));var db=require(_0xf46e('0x17'))['db'];function respondWithStatusCode(_0x303b77,_0x464efc){_0x464efc=_0x464efc||0xcc;return function(_0x413eb4){if(_0x413eb4){return _0x303b77[_0xf46e('0x18')](_0x464efc);}return _0x303b77[_0xf46e('0x19')](_0x464efc)[_0xf46e('0x1a')]();};}function respondWithResult(_0x220825,_0x2bac06){_0x2bac06=_0x2bac06||0xc8;return function(_0x1c69af){if(_0x1c69af){return _0x220825[_0xf46e('0x19')](_0x2bac06)[_0xf46e('0x1b')](_0x1c69af);}};}function respondWithFilteredResult(_0x4c1371,_0x5db3d5){return function(_0x4779a9){if(_0x4779a9){var _0xb342c6=typeof _0x5db3d5[_0xf46e('0x1c')]===_0xf46e('0x1d')&&typeof _0x5db3d5[_0xf46e('0x1e')]==='undefined';var _0x1b2c0b=_0x4779a9[_0xf46e('0x1f')];var _0x11b3d9=_0xb342c6?0x0:_0x5db3d5[_0xf46e('0x1c')];var _0x358bed=_0xb342c6?_0x4779a9[_0xf46e('0x1f')]:_0x5db3d5[_0xf46e('0x1c')]+_0x5db3d5[_0xf46e('0x1e')];var _0x16ee96;if(_0x358bed>=_0x1b2c0b){_0x358bed=_0x1b2c0b;_0x16ee96=0xc8;}else{_0x16ee96=0xce;}_0x4c1371[_0xf46e('0x19')](_0x16ee96);return _0x4c1371[_0xf46e('0x20')](_0xf46e('0x21'),_0x11b3d9+'-'+_0x358bed+'/'+_0x1b2c0b)[_0xf46e('0x1b')](_0x4779a9);}return null;};}function patchUpdates(_0x7b729a){return function(_0x1d783d){try{jsonpatch['apply'](_0x1d783d,_0x7b729a,!![]);}catch(_0x2f8b6c){return BPromise[_0xf46e('0x22')](_0x2f8b6c);}return _0x1d783d[_0xf46e('0x23')]();};}function saveUpdates(_0x525e85,_0x483452){return function(_0x4a6ec1){if(_0x4a6ec1){return _0x4a6ec1[_0xf46e('0x24')](_0x525e85)[_0xf46e('0x25')](function(_0x50cc92){return _0x50cc92;});}return null;};}function removeEntity(_0x38f86a,_0x3f2ce2){return function(_0x9be020){if(_0x9be020){return _0x9be020['destroy']()['then'](function(){_0x38f86a[_0xf46e('0x19')](0xcc)[_0xf46e('0x1a')]();});}};}function handleEntityNotFound(_0x3d93a4,_0x5c1e6f){return function(_0x183fc7){if(!_0x183fc7){_0x3d93a4[_0xf46e('0x18')](0x194);}return _0x183fc7;};}function handleError(_0x276cc0,_0x585aed){_0x585aed=_0x585aed||0x1f4;return function(_0x1ec6a7){logger[_0xf46e('0x26')](_0x1ec6a7[_0xf46e('0x27')]);if(_0x1ec6a7[_0xf46e('0x28')]){delete _0x1ec6a7[_0xf46e('0x28')];}_0x276cc0[_0xf46e('0x19')](_0x585aed)[_0xf46e('0x29')](_0x1ec6a7);};}exports[_0xf46e('0x2a')]=function(_0x13d8df,_0x272c7f){var _0x1159c2={},_0x12844a={},_0x213d22={'count':0x0,'rows':[]};var _0x2cc439=_[_0xf46e('0x2b')](db['IntegrationReport'][_0xf46e('0x2c')],function(_0x43a215){return{'name':_0x43a215[_0xf46e('0x2d')],'type':_0x43a215[_0xf46e('0x2e')][_0xf46e('0x2f')]};});_0x12844a[_0xf46e('0x30')]=_[_0xf46e('0x2b')](_0x2cc439,'name');_0x12844a[_0xf46e('0x31')]=_[_0xf46e('0x32')](_0x13d8df[_0xf46e('0x31')]);_0x12844a[_0xf46e('0x33')]=_[_0xf46e('0x34')](_0x12844a[_0xf46e('0x30')],_0x12844a['query']);_0x1159c2['attributes']=_[_0xf46e('0x34')](_0x12844a[_0xf46e('0x30')],qs[_0xf46e('0x35')](_0x13d8df[_0xf46e('0x31')][_0xf46e('0x35')]));_0x1159c2[_0xf46e('0x36')]=_0x1159c2['attributes'][_0xf46e('0x37')]?_0x1159c2[_0xf46e('0x36')]:_0x12844a[_0xf46e('0x30')];if(!_0x13d8df[_0xf46e('0x31')][_0xf46e('0x38')](_0xf46e('0x39'))){_0x1159c2[_0xf46e('0x1e')]=qs[_0xf46e('0x1e')](_0x13d8df[_0xf46e('0x31')][_0xf46e('0x1e')]);_0x1159c2['offset']=qs[_0xf46e('0x1c')](_0x13d8df[_0xf46e('0x31')][_0xf46e('0x1c')]);}_0x1159c2[_0xf46e('0x3a')]=qs[_0xf46e('0x3b')](_0x13d8df['query']['sort']);_0x1159c2[_0xf46e('0x3c')]=qs[_0xf46e('0x33')](_[_0xf46e('0x3d')](_0x13d8df[_0xf46e('0x31')],_0x12844a[_0xf46e('0x33')]),_0x2cc439);if(_0x13d8df[_0xf46e('0x31')][_0xf46e('0x3e')]){_0x1159c2['where']=_['merge'](_0x1159c2[_0xf46e('0x3c')],{'$or':_[_0xf46e('0x2b')](_0x2cc439,function(_0x171e22){if(_0x171e22[_0xf46e('0x2e')]!=='VIRTUAL'){var _0x5e78ab={};_0x5e78ab[_0x171e22['name']]={'$like':'%'+_0x13d8df[_0xf46e('0x31')]['filter']+'%'};return _0x5e78ab;}})});}_0x1159c2=_[_0xf46e('0x3f')]({},_0x1159c2,_0x13d8df[_0xf46e('0x40')]);var _0x3ed463={'where':_0x1159c2[_0xf46e('0x3c')]};return db[_0xf46e('0x41')]['count'](_0x3ed463)[_0xf46e('0x25')](function(_0xc92ff1){_0x213d22[_0xf46e('0x1f')]=_0xc92ff1;if(_0x13d8df[_0xf46e('0x31')][_0xf46e('0x42')]){_0x1159c2[_0xf46e('0x43')]=[{'all':!![]}];}return db['IntegrationReport'][_0xf46e('0x44')](_0x1159c2);})[_0xf46e('0x25')](function(_0xa0a17c){_0x213d22[_0xf46e('0x45')]=_0xa0a17c;return _0x213d22;})[_0xf46e('0x25')](respondWithFilteredResult(_0x272c7f,_0x1159c2))[_0xf46e('0x46')](handleError(_0x272c7f,null));};exports['show']=function(_0x5796d4,_0x1c2bc4){var _0x462e16={'raw':![],'where':{'id':_0x5796d4[_0xf46e('0x47')]['id']}},_0x1ed250={};_0x1ed250[_0xf46e('0x30')]=_[_0xf46e('0x32')](db[_0xf46e('0x41')][_0xf46e('0x2c')]);_0x1ed250[_0xf46e('0x31')]=_['keys'](_0x5796d4['query']);_0x1ed250['filters']=_['intersection'](_0x1ed250['model'],_0x1ed250[_0xf46e('0x31')]);_0x462e16['attributes']=_[_0xf46e('0x34')](_0x1ed250[_0xf46e('0x30')],qs[_0xf46e('0x35')](_0x5796d4[_0xf46e('0x31')]['fields']));_0x462e16[_0xf46e('0x36')]=_0x462e16[_0xf46e('0x36')][_0xf46e('0x37')]?_0x462e16[_0xf46e('0x36')]:_0x1ed250[_0xf46e('0x30')];if(_0x5796d4[_0xf46e('0x31')][_0xf46e('0x42')]){_0x462e16[_0xf46e('0x43')]=[{'all':!![]}];}_0x462e16=_['merge']({},_0x462e16,_0x5796d4['options']);return db[_0xf46e('0x41')][_0xf46e('0x48')](_0x462e16)['then'](handleEntityNotFound(_0x1c2bc4,null))['then'](respondWithResult(_0x1c2bc4,null))[_0xf46e('0x46')](handleError(_0x1c2bc4,null));};exports[_0xf46e('0x49')]=function(_0x335abe,_0x1f4f82){return db[_0xf46e('0x41')]['create'](_0x335abe['body'],{})[_0xf46e('0x25')](respondWithResult(_0x1f4f82,0xc9))['catch'](handleError(_0x1f4f82,null));};exports['update']=function(_0x7ad33f,_0x26e69b){if(_0x7ad33f[_0xf46e('0x4a')]['id']){delete _0x7ad33f[_0xf46e('0x4a')]['id'];}return db[_0xf46e('0x41')]['find']({'where':{'id':_0x7ad33f[_0xf46e('0x47')]['id']}})['then'](handleEntityNotFound(_0x26e69b,null))[_0xf46e('0x25')](saveUpdates(_0x7ad33f[_0xf46e('0x4a')],null))[_0xf46e('0x25')](respondWithResult(_0x26e69b,null))[_0xf46e('0x46')](handleError(_0x26e69b,null));};exports[_0xf46e('0x4b')]=function(_0x5a4375,_0x3f959e){return db[_0xf46e('0x41')][_0xf46e('0x48')]({'where':{'id':_0x5a4375['params']['id']}})['then'](handleEntityNotFound(_0x3f959e,null))[_0xf46e('0x25')](removeEntity(_0x3f959e,null))[_0xf46e('0x46')](handleError(_0x3f959e,null));};exports[_0xf46e('0x4c')]=function(_0x3fe6c2,_0x4e2ca2){return db[_0xf46e('0x41')]['describe']()[_0xf46e('0x25')](respondWithResult(_0x4e2ca2,null))[_0xf46e('0x46')](handleError(_0x4e2ca2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index cd4c125..ba723ae 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 _0x0cdc=['exports','define','IntegrationReport','util','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes'];(function(_0x4c4a29,_0x4e83c7){var _0x48d2c4=function(_0x51045c){while(--_0x51045c){_0x4c4a29['push'](_0x4c4a29['shift']());}};_0x48d2c4(++_0x4e83c7);}(_0x0cdc,0x116));var _0xc0cd=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x0cdc[_0x363ef8];return _0x148822;};'use strict';var _=require('lodash');var util=require(_0xc0cd('0x0'));var logger=require('../../config/logger')(_0xc0cd('0x1'));var moment=require(_0xc0cd('0x2'));var BPromise=require(_0xc0cd('0x3'));var rp=require(_0xc0cd('0x4'));var fs=require('fs');var path=require(_0xc0cd('0x5'));var rimraf=require(_0xc0cd('0x6'));var config=require('../../config/environment');var attributes=require(_0xc0cd('0x7'));module[_0xc0cd('0x8')]=function(_0x319172,_0x38472d){return _0x319172[_0xc0cd('0x9')](_0xc0cd('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf44=['request-promise','path','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','../../config/logger','bluebird'];(function(_0x1d2790,_0x292fbd){var _0x2c538f=function(_0x489676){while(--_0x489676){_0x1d2790['push'](_0x1d2790['shift']());}};_0x2c538f(++_0x292fbd);}(_0xaf44,0xb1));var _0x4af4=function(_0x16b2ad,_0xa39ad3){_0x16b2ad=_0x16b2ad-0x0;var _0x56a5bd=_0xaf44[_0x16b2ad];return _0x56a5bd;};'use strict';var _=require(_0x4af4('0x0'));var util=require('util');var logger=require(_0x4af4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4af4('0x2'));var rp=require(_0x4af4('0x3'));var fs=require('fs');var path=require(_0x4af4('0x4'));var rimraf=require('rimraf');var config=require(_0x4af4('0x5'));var attributes=require(_0x4af4('0x6'));module['exports']=function(_0x3774fa,_0x4b0587){return _0x3774fa[_0x4af4('0x7')](_0x4af4('0x8'),attributes,{'tableName':_0x4af4('0x9'),'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 9d45f3d..2ada2ef 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 _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x416e14,_0x2be9be){var _0x19b7c6=function(_0x43f194){while(--_0x43f194){_0x416e14['push'](_0x416e14['shift']());}};_0x19b7c6(++_0x2be9be);}(_0x2542,0x169));var _0x2254=function(_0xf99a59,_0x115b65){_0xf99a59=_0xf99a59-0x0;var _0x1011c6=_0x2542[_0xf99a59];return _0x1011c6;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x5396fa,_0x322422){var _0x41d183=function(_0x51fbae){while(--_0x51fbae){_0x5396fa['push'](_0x5396fa['shift']());}};_0x41d183(++_0x322422);}(_0xba34,0x119));var _0x4ba3=function(_0x4b19a4,_0x473af3){_0x4b19a4=_0x4b19a4-0x0;var _0x4bf687=_0xba34[_0x4b19a4];return _0x4bf687;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0c58eb0..efb277b 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 _0xce22=['./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','create','post','/:id/sub_intervals/create_many','addIntervals','/:id','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4a79d3,_0x1e53c9){var _0x11c6d5=function(_0x2f4f3b){while(--_0x2f4f3b){_0x4a79d3['push'](_0x4a79d3['shift']());}};_0x11c6d5(++_0x1e53c9);}(_0xce22,0xea));var _0x2ce2=function(_0x3b9ffe,_0x4429e0){_0x3b9ffe=_0x3b9ffe-0x0;var _0x2cade0=_0xce22[_0x3b9ffe];return _0x2cade0;};'use strict';var multer=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var path=require(_0x2ce2('0x2'));var timeout=require(_0x2ce2('0x3'));var express=require(_0x2ce2('0x4'));var router=express['Router']();var fs_extra=require(_0x2ce2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2ce2('0x6'));var config=require(_0x2ce2('0x7'));var controller=require(_0x2ce2('0x8'));router[_0x2ce2('0x9')]('/',auth[_0x2ce2('0xa')](),controller[_0x2ce2('0xb')]);router[_0x2ce2('0x9')]('/:id',auth[_0x2ce2('0xa')](),controller[_0x2ce2('0xc')]);router[_0x2ce2('0x9')](_0x2ce2('0xd'),auth[_0x2ce2('0xa')](),controller[_0x2ce2('0xe')]);router['post']('/',auth[_0x2ce2('0xa')](),controller[_0x2ce2('0xf')]);router['post'](_0x2ce2('0xd'),auth[_0x2ce2('0xa')](),controller['addInterval']);router[_0x2ce2('0x10')](_0x2ce2('0x11'),auth[_0x2ce2('0xa')](),controller[_0x2ce2('0x12')]);router['put'](_0x2ce2('0x13'),auth[_0x2ce2('0xa')](),controller[_0x2ce2('0x14')]);router['delete'](_0x2ce2('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x2ce2('0x15')]=router; \ No newline at end of file +var _0x503a=['/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show'];(function(_0x36182a,_0x1a3495){var _0x381f31=function(_0x14abd0){while(--_0x14abd0){_0x36182a['push'](_0x36182a['shift']());}};_0x381f31(++_0x1a3495);}(_0x503a,0x19d));var _0xa503=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0x503a[_0x358fb5];return _0x4abfeb;};'use strict';var multer=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var path=require('path');var timeout=require(_0xa503('0x2'));var express=require('express');var router=express[_0xa503('0x3')]();var fs_extra=require(_0xa503('0x4'));var auth=require(_0xa503('0x5'));var interaction=require(_0xa503('0x6'));var config=require(_0xa503('0x7'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa503('0x8')]);router[_0xa503('0x9')]('/:id',auth[_0xa503('0xa')](),controller[_0xa503('0xb')]);router[_0xa503('0x9')](_0xa503('0xc'),auth[_0xa503('0xa')](),controller[_0xa503('0xd')]);router[_0xa503('0xe')]('/',auth['isAuthenticated'](),controller[_0xa503('0xf')]);router[_0xa503('0xe')](_0xa503('0xc'),auth['isAuthenticated'](),controller[_0xa503('0x10')]);router['post'](_0xa503('0x11'),auth['isAuthenticated'](),controller[_0xa503('0x12')]);router[_0xa503('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa503('0x14')]);router[_0xa503('0x15')](_0xa503('0x16'),auth[_0xa503('0xa')](),controller[_0xa503('0x17')]);module[_0xa503('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index fe6e6cb..5822e3c 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 _0x883c=['exports','STRING','sequelize'];(function(_0x23f61e,_0x2e0623){var _0x15a9c4=function(_0x485872){while(--_0x485872){_0x23f61e['push'](_0x23f61e['shift']());}};_0x15a9c4(++_0x2e0623);}(_0x883c,0x107));var _0xc883=function(_0x347c33,_0x4a00af){_0x347c33=_0x347c33-0x0;var _0x4660ee=_0x883c[_0x347c33];return _0x4660ee;};'use strict';var Sequelize=require(_0xc883('0x0'));module[_0xc883('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc883('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xf038=['sequelize','exports','STRING'];(function(_0x5092cc,_0x4ddeac){var _0x2107a8=function(_0x3181c8){while(--_0x3181c8){_0x5092cc['push'](_0x5092cc['shift']());}};_0x2107a8(++_0x4ddeac);}(_0xf038,0x174));var _0x8f03=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0xf038[_0x4ef734];return _0x33a7cb;};'use strict';var Sequelize=require(_0x8f03('0x0'));module[_0x8f03('0x1')]={'name':{'type':Sequelize[_0x8f03('0x2')]},'description':{'type':Sequelize[_0x8f03('0x2')]},'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 af454ce..3e145eb 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 _0x49d4=['nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','catch','addInterval','IntervalId','getIntervals','findOne','addIntervals','transaction','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','error','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x49d4,0xdd));var _0x449d=function(_0x3aea0a,_0x4fddb6){_0x3aea0a=_0x3aea0a-0x0;var _0x206825=_0x49d4[_0x3aea0a];return _0x206825;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x449d('0x0'));var jsonpatch=require(_0x449d('0x1'));var rp=require(_0x449d('0x2'));var moment=require(_0x449d('0x3'));var BPromise=require(_0x449d('0x4'));var Mustache=require(_0x449d('0x5'));var util=require(_0x449d('0x6'));var path=require(_0x449d('0x7'));var sox=require(_0x449d('0x8'));var csv=require('to-csv');var ejs=require(_0x449d('0x9'));var fs=require('fs');var fs_extra=require(_0x449d('0xa'));var _=require(_0x449d('0xb'));var squel=require(_0x449d('0xc'));var crypto=require('crypto');var jsforce=require(_0x449d('0xd'));var deskjs=require(_0x449d('0xe'));var toCsv=require(_0x449d('0xf'));var querystring=require(_0x449d('0x10'));var Papa=require(_0x449d('0x11'));var Redis=require(_0x449d('0x12'));var authService=require(_0x449d('0x13'));var qs=require(_0x449d('0x14'));var as=require(_0x449d('0x15'));var hardwareService=require(_0x449d('0x16'));var logger=require(_0x449d('0x17'))('api');var utils=require(_0x449d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x449d('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0x449d('0x1a'));function respondWithStatusCode(_0x12cec5,_0x1f58cf){_0x1f58cf=_0x1f58cf||0xcc;return function(_0x4d029a){if(_0x4d029a){return _0x12cec5[_0x449d('0x1b')](_0x1f58cf);}return _0x12cec5[_0x449d('0x1c')](_0x1f58cf)[_0x449d('0x1d')]();};}function respondWithResult(_0x238d75,_0x553670){_0x553670=_0x553670||0xc8;return function(_0x57ff19){if(_0x57ff19){return _0x238d75[_0x449d('0x1c')](_0x553670)[_0x449d('0x1e')](_0x57ff19);}};}function respondWithFilteredResult(_0x262d90,_0x1de2d3){return function(_0x4ff5a1){if(_0x4ff5a1){var _0x52c2b9=typeof _0x1de2d3[_0x449d('0x1f')]===_0x449d('0x20')&&typeof _0x1de2d3[_0x449d('0x21')]===_0x449d('0x20');var _0x1733a6=_0x4ff5a1[_0x449d('0x22')];var _0x5a4da6=_0x52c2b9?0x0:_0x1de2d3[_0x449d('0x1f')];var _0x43b269=_0x52c2b9?_0x4ff5a1[_0x449d('0x22')]:_0x1de2d3[_0x449d('0x1f')]+_0x1de2d3[_0x449d('0x21')];var _0x56327a;if(_0x43b269>=_0x1733a6){_0x43b269=_0x1733a6;_0x56327a=0xc8;}else{_0x56327a=0xce;}_0x262d90[_0x449d('0x1c')](_0x56327a);return _0x262d90[_0x449d('0x23')](_0x449d('0x24'),_0x5a4da6+'-'+_0x43b269+'/'+_0x1733a6)[_0x449d('0x1e')](_0x4ff5a1);}return null;};}function patchUpdates(_0x2d7c21){return function(_0x4794dc){try{jsonpatch[_0x449d('0x25')](_0x4794dc,_0x2d7c21,!![]);}catch(_0x24404d){return BPromise[_0x449d('0x26')](_0x24404d);}return _0x4794dc[_0x449d('0x27')]();};}function saveUpdates(_0xa09c2f,_0xbb0da2){return function(_0x5b3cbd){if(_0x5b3cbd){return _0x5b3cbd[_0x449d('0x28')](_0xa09c2f)[_0x449d('0x29')](function(_0xa98aa8){return _0xa98aa8;});}return null;};}function removeEntity(_0x435f8f,_0x1c4dd4){return function(_0x3378a7){if(_0x3378a7){return _0x3378a7['destroy']()['then'](function(){var _0x30e143=_0x3378a7[_0x449d('0x2a')]({'plain':!![]});var _0x12f7e6=_0x449d('0x2b');return db[_0x449d('0x2c')][_0x449d('0x2d')]({'where':{'type':_0x12f7e6,'resourceId':_0x30e143['id']}})[_0x449d('0x29')](function(){return _0x3378a7;});})[_0x449d('0x29')](function(){_0x435f8f['status'](0xcc)[_0x449d('0x1d')]();});}};}function handleEntityNotFound(_0x254047,_0x1962e6){return function(_0x53da41){if(!_0x53da41){_0x254047[_0x449d('0x1b')](0x194);}return _0x53da41;};}function handleError(_0x32cff7,_0x486225){_0x486225=_0x486225||0x1f4;return function(_0x531aed){logger[_0x449d('0x2e')](_0x531aed['stack']);if(_0x531aed[_0x449d('0x2f')]){delete _0x531aed[_0x449d('0x2f')];}_0x32cff7[_0x449d('0x1c')](_0x486225)[_0x449d('0x30')](_0x531aed);};}exports[_0x449d('0x31')]=function(_0x15ef30,_0x57cf02){var _0x85e7bb={},_0x462a35={},_0x3c4706={'count':0x0,'rows':[]};var _0x4358df=_[_0x449d('0x32')](db[_0x449d('0x33')][_0x449d('0x34')],function(_0xdb6697){return{'name':_0xdb6697[_0x449d('0x35')],'type':_0xdb6697['type'][_0x449d('0x36')]};});_0x462a35[_0x449d('0x37')]=_['map'](_0x4358df,_0x449d('0x2f'));_0x462a35[_0x449d('0x38')]=_[_0x449d('0x39')](_0x15ef30[_0x449d('0x38')]);_0x462a35[_0x449d('0x3a')]=_[_0x449d('0x3b')](_0x462a35[_0x449d('0x37')],_0x462a35[_0x449d('0x38')]);_0x85e7bb[_0x449d('0x3c')]=_[_0x449d('0x3b')](_0x462a35[_0x449d('0x37')],qs[_0x449d('0x3d')](_0x15ef30['query']['fields']));_0x85e7bb[_0x449d('0x3c')]=_0x85e7bb[_0x449d('0x3c')][_0x449d('0x3e')]?_0x85e7bb[_0x449d('0x3c')]:_0x462a35[_0x449d('0x37')];if(!_0x15ef30[_0x449d('0x38')][_0x449d('0x3f')](_0x449d('0x40'))){_0x85e7bb[_0x449d('0x21')]=qs[_0x449d('0x21')](_0x15ef30[_0x449d('0x38')][_0x449d('0x21')]);_0x85e7bb[_0x449d('0x1f')]=qs[_0x449d('0x1f')](_0x15ef30['query'][_0x449d('0x1f')]);}_0x85e7bb[_0x449d('0x41')]=qs[_0x449d('0x42')](_0x15ef30[_0x449d('0x38')][_0x449d('0x42')]);_0x85e7bb[_0x449d('0x43')]=qs[_0x449d('0x3a')](_[_0x449d('0x44')](_0x15ef30['query'],_0x462a35['filters']),_0x4358df);if(_0x15ef30['query'][_0x449d('0x45')]){_0x85e7bb[_0x449d('0x43')]=_['merge'](_0x85e7bb[_0x449d('0x43')],{'$or':_['map'](_0x4358df,function(_0x6cc8a1){if(_0x6cc8a1[_0x449d('0x46')]!==_0x449d('0x47')){var _0x3dc2da={};_0x3dc2da[_0x6cc8a1[_0x449d('0x2f')]]={'$like':'%'+_0x15ef30[_0x449d('0x38')][_0x449d('0x45')]+'%'};return _0x3dc2da;}})});}_0x85e7bb=_[_0x449d('0x48')]({},_0x85e7bb,_0x15ef30['options']);var _0x397c6e={'where':_0x85e7bb[_0x449d('0x43')]};return db[_0x449d('0x33')]['count'](_0x397c6e)['then'](function(_0x48a7d4){_0x3c4706[_0x449d('0x22')]=_0x48a7d4;if(_0x15ef30[_0x449d('0x38')][_0x449d('0x49')]){_0x85e7bb[_0x449d('0x4a')]=[{'all':!![]}];}return db['Interval'][_0x449d('0x4b')](_0x85e7bb);})[_0x449d('0x29')](function(_0x5340b5){_0x3c4706[_0x449d('0x4c')]=_0x5340b5;return _0x3c4706;})['then'](respondWithFilteredResult(_0x57cf02,_0x85e7bb))['catch'](handleError(_0x57cf02,null));};exports[_0x449d('0x4d')]=function(_0xdc6266,_0x9eccb1){var _0x1ffe8d={'raw':!![],'where':{'id':_0xdc6266[_0x449d('0x4e')]['id']}},_0x593f70={};_0x593f70[_0x449d('0x37')]=_[_0x449d('0x39')](db[_0x449d('0x33')][_0x449d('0x34')]);_0x593f70[_0x449d('0x38')]=_[_0x449d('0x39')](_0xdc6266[_0x449d('0x38')]);_0x593f70[_0x449d('0x3a')]=_[_0x449d('0x3b')](_0x593f70['model'],_0x593f70[_0x449d('0x38')]);_0x1ffe8d[_0x449d('0x3c')]=_[_0x449d('0x3b')](_0x593f70['model'],qs[_0x449d('0x3d')](_0xdc6266['query'][_0x449d('0x3d')]));_0x1ffe8d[_0x449d('0x3c')]=_0x1ffe8d['attributes'][_0x449d('0x3e')]?_0x1ffe8d['attributes']:_0x593f70[_0x449d('0x37')];if(_0xdc6266['query'][_0x449d('0x49')]){_0x1ffe8d['include']=[{'all':!![]}];}_0x1ffe8d=_[_0x449d('0x48')]({},_0x1ffe8d,_0xdc6266[_0x449d('0x4f')]);return db['Interval']['find'](_0x1ffe8d)[_0x449d('0x29')](handleEntityNotFound(_0x9eccb1,null))[_0x449d('0x29')](respondWithResult(_0x9eccb1,null))['catch'](handleError(_0x9eccb1,null));};exports[_0x449d('0x50')]=function(_0x312e18,_0x299dd8){return db[_0x449d('0x33')][_0x449d('0x50')](_0x312e18[_0x449d('0x51')],{})[_0x449d('0x29')](function(_0x4e4d60){var _0x3940d6=_0x312e18['user']['get']({'plain':!![]});if(!_0x3940d6)throw new Error(_0x449d('0x52'));if(_0x3940d6['role']===_0x449d('0x53')){var _0x31e667=_0x4e4d60[_0x449d('0x2a')]({'plain':!![]});var _0x5920a2=_0x449d('0x2b');return db[_0x449d('0x54')][_0x449d('0x55')]({'where':{'name':_0x5920a2,'userProfileId':_0x3940d6[_0x449d('0x56')]},'raw':!![]})['then'](function(_0x5041ac){if(_0x5041ac&&_0x5041ac[_0x449d('0x57')]===0x0){return db[_0x449d('0x2c')][_0x449d('0x50')]({'name':_0x31e667[_0x449d('0x2f')],'resourceId':_0x31e667['id'],'type':_0x5041ac[_0x449d('0x2f')],'sectionId':_0x5041ac['id']},{})[_0x449d('0x29')](function(){return _0x4e4d60;});}else{return _0x4e4d60;}})[_0x449d('0x58')](function(_0x38239b){logger[_0x449d('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38239b);throw _0x38239b;});}return _0x4e4d60;})[_0x449d('0x29')](respondWithResult(_0x299dd8,0xc9))[_0x449d('0x58')](handleError(_0x299dd8,null));};exports[_0x449d('0x28')]=function(_0x30034c,_0x10c810){if(_0x30034c['body']['id']){delete _0x30034c[_0x449d('0x51')]['id'];}return db[_0x449d('0x33')][_0x449d('0x55')]({'where':{'id':_0x30034c['params']['id']}})['then'](handleEntityNotFound(_0x10c810,null))[_0x449d('0x29')](saveUpdates(_0x30034c[_0x449d('0x51')],null))[_0x449d('0x29')](respondWithResult(_0x10c810,null))[_0x449d('0x58')](handleError(_0x10c810,null));};exports[_0x449d('0x2d')]=function(_0xd3c89c,_0x1e826d){return db[_0x449d('0x33')][_0x449d('0x55')]({'where':{'id':_0xd3c89c['params']['id']}})[_0x449d('0x29')](handleEntityNotFound(_0x1e826d,null))[_0x449d('0x29')](removeEntity(_0x1e826d,null))['catch'](handleError(_0x1e826d,null));};exports[_0x449d('0x59')]=function(_0x263f8c,_0x2d090f,_0x52704e){if(_0x263f8c[_0x449d('0x51')]['id']){delete _0x263f8c[_0x449d('0x51')]['id'];}return db[_0x449d('0x33')]['find']({'where':{'id':_0x263f8c[_0x449d('0x4e')]['id']}})[_0x449d('0x29')](handleEntityNotFound(_0x2d090f,null))[_0x449d('0x29')](function(_0x178666){if(_0x178666){_0x263f8c['body'][_0x449d('0x5a')]=_0x178666['id'];return db['Interval'][_0x449d('0x50')](_0x263f8c[_0x449d('0x51')]);}})['then'](respondWithResult(_0x2d090f,null))[_0x449d('0x58')](handleError(_0x2d090f,null));};exports[_0x449d('0x5b')]=function(_0x23e256,_0x37d519,_0x3c7b14){var _0x135eb3={};var _0x18954c={};var _0x461d62;var _0x593632;return db[_0x449d('0x33')][_0x449d('0x5c')]({'where':{'id':_0x23e256[_0x449d('0x4e')]['id']}})[_0x449d('0x29')](handleEntityNotFound(_0x37d519,null))[_0x449d('0x29')](function(_0x181080){if(_0x181080){_0x461d62=_0x181080;_0x18954c['model']=_[_0x449d('0x39')](db[_0x449d('0x33')][_0x449d('0x34')]);_0x18954c[_0x449d('0x38')]=_[_0x449d('0x39')](_0x23e256[_0x449d('0x38')]);_0x18954c['filters']=_[_0x449d('0x3b')](_0x18954c[_0x449d('0x37')],_0x18954c[_0x449d('0x38')]);_0x135eb3['attributes']=_['intersection'](_0x18954c[_0x449d('0x37')],qs[_0x449d('0x3d')](_0x23e256[_0x449d('0x38')][_0x449d('0x3d')]));_0x135eb3['attributes']=_0x135eb3[_0x449d('0x3c')][_0x449d('0x3e')]?_0x135eb3[_0x449d('0x3c')]:_0x18954c[_0x449d('0x37')];_0x135eb3[_0x449d('0x41')]=qs['sort'](_0x23e256[_0x449d('0x38')]['sort']);_0x135eb3[_0x449d('0x43')]=qs['filters'](_['pick'](_0x23e256[_0x449d('0x38')],_0x18954c[_0x449d('0x3a')]));if(_0x23e256[_0x449d('0x38')][_0x449d('0x45')]){_0x135eb3['where']=_[_0x449d('0x48')](_0x135eb3[_0x449d('0x43')],{'$or':_['map'](_0x135eb3['attributes'],function(_0x4f5997){var _0x215dfa={};_0x215dfa[_0x4f5997]={'$like':'%'+_0x23e256['query']['filter']+'%'};return _0x215dfa;})});}_0x135eb3=_[_0x449d('0x48')]({},_0x135eb3,_0x23e256[_0x449d('0x4f')]);return _0x461d62[_0x449d('0x5b')](_0x135eb3);}})[_0x449d('0x29')](function(_0x11a1da){if(_0x11a1da){_0x593632=_0x11a1da['length'];if(!_0x23e256[_0x449d('0x38')][_0x449d('0x3f')](_0x449d('0x40'))){_0x135eb3[_0x449d('0x21')]=qs[_0x449d('0x21')](_0x23e256['query'][_0x449d('0x21')]);_0x135eb3['offset']=qs[_0x449d('0x1f')](_0x23e256[_0x449d('0x38')]['offset']);}return _0x461d62[_0x449d('0x5b')](_0x135eb3);}})[_0x449d('0x29')](function(_0x253ce8){if(_0x253ce8){return _0x253ce8?{'count':_0x593632,'rows':_0x253ce8}:null;}})[_0x449d('0x29')](respondWithResult(_0x37d519,null))[_0x449d('0x58')](handleError(_0x37d519,null));};exports[_0x449d('0x5d')]=function(_0x3edea8,_0x16eef5,_0x352de4){return db[_0x449d('0x33')]['findOne']({'where':{'id':_0x3edea8[_0x449d('0x4e')]['id']}})[_0x449d('0x29')](handleEntityNotFound(_0x16eef5,null))['then'](function(_0x48c68c){if(_0x48c68c){return db['sequelize'][_0x449d('0x5e')](function(_0x5c1249){return db[_0x449d('0x33')]['destroy']({'where':{'IntervalId':_0x3edea8[_0x449d('0x4e')]['id']},'transaction':_0x5c1249})[_0x449d('0x29')](function(_0x136c78){var _0x29b2c3=_[_0x449d('0x32')](_0x3edea8['body'],function(_0x1f3340){delete _0x1f3340['id'];_0x1f3340[_0x449d('0x5a')]=_0x3edea8[_0x449d('0x4e')]['id'];return _0x1f3340;});return db[_0x449d('0x33')]['bulkCreate'](_0x29b2c3,{'transaction':_0x5c1249});});})[_0x449d('0x29')](function(){return db[_0x449d('0x33')][_0x449d('0x4b')]({'where':{'IntervalId':_0x3edea8[_0x449d('0x4e')]['id']}});});}})[_0x449d('0x29')](respondWithResult(_0x16eef5,null))[_0x449d('0x58')](handleError(_0x16eef5,null));}; \ No newline at end of file +var _0x8bc5=['ejs','fs-extra','crypto','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','end','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','Intervals','UserProfileResource','error','stack','name','index','Interval','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','filter','includeAll','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','order','pick','options','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x3d7365,_0x13ccfb){var _0x3d96ac=function(_0x24135e){while(--_0x24135e){_0x3d7365['push'](_0x3d7365['shift']());}};_0x3d96ac(++_0x13ccfb);}(_0x8bc5,0xa8));var _0x58bc=function(_0x3a52af,_0x178c52){_0x3a52af=_0x3a52af-0x0;var _0x171ef2=_0x8bc5[_0x3a52af];return _0x171ef2;};'use strict';var emlformat=require(_0x58bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58bc('0x1'));var jsonpatch=require(_0x58bc('0x2'));var rp=require(_0x58bc('0x3'));var moment=require(_0x58bc('0x4'));var BPromise=require(_0x58bc('0x5'));var Mustache=require(_0x58bc('0x6'));var util=require('util');var path=require(_0x58bc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58bc('0x8'));var fs=require('fs');var fs_extra=require(_0x58bc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x58bc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x58bc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x58bc('0xc'));var Papa=require(_0x58bc('0xd'));var Redis=require('ioredis');var authService=require(_0x58bc('0xe'));var qs=require(_0x58bc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58bc('0x10'));var logger=require(_0x58bc('0x11'))(_0x58bc('0x12'));var utils=require(_0x58bc('0x13'));var config=require(_0x58bc('0x14'));var licenseUtil=require(_0x58bc('0x15'));var db=require(_0x58bc('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x7312a2,_0x4bc21e){_0x4bc21e=_0x4bc21e||0xcc;return function(_0x2ff1){if(_0x2ff1){return _0x7312a2[_0x58bc('0x17')](_0x4bc21e);}return _0x7312a2[_0x58bc('0x18')](_0x4bc21e)[_0x58bc('0x19')]();};}function respondWithResult(_0xe7026b,_0x3fceb4){_0x3fceb4=_0x3fceb4||0xc8;return function(_0x1c7ee0){if(_0x1c7ee0){return _0xe7026b[_0x58bc('0x18')](_0x3fceb4)['json'](_0x1c7ee0);}};}function respondWithFilteredResult(_0x568cd7,_0x2faf5e){return function(_0x559d98){if(_0x559d98){var _0x5de648=typeof _0x2faf5e[_0x58bc('0x1a')]===_0x58bc('0x1b')&&typeof _0x2faf5e[_0x58bc('0x1c')]===_0x58bc('0x1b');var _0x4741c0=_0x559d98['count'];var _0x31261d=_0x5de648?0x0:_0x2faf5e[_0x58bc('0x1a')];var _0x511532=_0x5de648?_0x559d98['count']:_0x2faf5e['offset']+_0x2faf5e[_0x58bc('0x1c')];var _0x1b09a9;if(_0x511532>=_0x4741c0){_0x511532=_0x4741c0;_0x1b09a9=0xc8;}else{_0x1b09a9=0xce;}_0x568cd7[_0x58bc('0x18')](_0x1b09a9);return _0x568cd7[_0x58bc('0x1d')](_0x58bc('0x1e'),_0x31261d+'-'+_0x511532+'/'+_0x4741c0)['json'](_0x559d98);}return null;};}function patchUpdates(_0x353bde){return function(_0x2ff291){try{jsonpatch[_0x58bc('0x1f')](_0x2ff291,_0x353bde,!![]);}catch(_0x514826){return BPromise['reject'](_0x514826);}return _0x2ff291['save']();};}function saveUpdates(_0xcbc88f,_0x28615c){return function(_0x216a03){if(_0x216a03){return _0x216a03[_0x58bc('0x20')](_0xcbc88f)[_0x58bc('0x21')](function(_0x3cfb7f){return _0x3cfb7f;});}return null;};}function removeEntity(_0x1c9700,_0x27963d){return function(_0x45caae){if(_0x45caae){return _0x45caae[_0x58bc('0x22')]()[_0x58bc('0x21')](function(){var _0x473825=_0x45caae['get']({'plain':!![]});var _0x5bf446=_0x58bc('0x23');return db[_0x58bc('0x24')][_0x58bc('0x22')]({'where':{'type':_0x5bf446,'resourceId':_0x473825['id']}})[_0x58bc('0x21')](function(){return _0x45caae;});})['then'](function(){_0x1c9700[_0x58bc('0x18')](0xcc)[_0x58bc('0x19')]();});}};}function handleEntityNotFound(_0x17777f,_0x19833b){return function(_0x10f3e9){if(!_0x10f3e9){_0x17777f[_0x58bc('0x17')](0x194);}return _0x10f3e9;};}function handleError(_0x316795,_0x41d745){_0x41d745=_0x41d745||0x1f4;return function(_0x361046){logger[_0x58bc('0x25')](_0x361046[_0x58bc('0x26')]);if(_0x361046[_0x58bc('0x27')]){delete _0x361046[_0x58bc('0x27')];}_0x316795[_0x58bc('0x18')](_0x41d745)['send'](_0x361046);};}exports[_0x58bc('0x28')]=function(_0x5b52ef,_0x1b7a89){var _0x346c4d={},_0x3f6348={},_0x1fb759={'count':0x0,'rows':[]};var _0x1e792e=_['map'](db[_0x58bc('0x29')][_0x58bc('0x2a')],function(_0xf7bb28){return{'name':_0xf7bb28[_0x58bc('0x2b')],'type':_0xf7bb28['type'][_0x58bc('0x2c')]};});_0x3f6348[_0x58bc('0x2d')]=_[_0x58bc('0x2e')](_0x1e792e,'name');_0x3f6348[_0x58bc('0x2f')]=_[_0x58bc('0x30')](_0x5b52ef[_0x58bc('0x2f')]);_0x3f6348['filters']=_[_0x58bc('0x31')](_0x3f6348[_0x58bc('0x2d')],_0x3f6348[_0x58bc('0x2f')]);_0x346c4d[_0x58bc('0x32')]=_[_0x58bc('0x31')](_0x3f6348[_0x58bc('0x2d')],qs[_0x58bc('0x33')](_0x5b52ef[_0x58bc('0x2f')][_0x58bc('0x33')]));_0x346c4d[_0x58bc('0x32')]=_0x346c4d['attributes'][_0x58bc('0x34')]?_0x346c4d['attributes']:_0x3f6348[_0x58bc('0x2d')];if(!_0x5b52ef[_0x58bc('0x2f')][_0x58bc('0x35')](_0x58bc('0x36'))){_0x346c4d[_0x58bc('0x1c')]=qs['limit'](_0x5b52ef[_0x58bc('0x2f')][_0x58bc('0x1c')]);_0x346c4d[_0x58bc('0x1a')]=qs['offset'](_0x5b52ef['query'][_0x58bc('0x1a')]);}_0x346c4d['order']=qs['sort'](_0x5b52ef[_0x58bc('0x2f')][_0x58bc('0x37')]);_0x346c4d[_0x58bc('0x38')]=qs[_0x58bc('0x39')](_['pick'](_0x5b52ef[_0x58bc('0x2f')],_0x3f6348[_0x58bc('0x39')]),_0x1e792e);if(_0x5b52ef[_0x58bc('0x2f')]['filter']){_0x346c4d[_0x58bc('0x38')]=_[_0x58bc('0x3a')](_0x346c4d[_0x58bc('0x38')],{'$or':_[_0x58bc('0x2e')](_0x1e792e,function(_0x120b60){if(_0x120b60[_0x58bc('0x3b')]!=='VIRTUAL'){var _0x345e6f={};_0x345e6f[_0x120b60[_0x58bc('0x27')]]={'$like':'%'+_0x5b52ef['query'][_0x58bc('0x3c')]+'%'};return _0x345e6f;}})});}_0x346c4d=_['merge']({},_0x346c4d,_0x5b52ef['options']);var _0x2ea5a5={'where':_0x346c4d[_0x58bc('0x38')]};return db['Interval']['count'](_0x2ea5a5)['then'](function(_0x74bc3b){_0x1fb759['count']=_0x74bc3b;if(_0x5b52ef[_0x58bc('0x2f')][_0x58bc('0x3d')]){_0x346c4d[_0x58bc('0x3e')]=[{'all':!![]}];}return db['Interval'][_0x58bc('0x3f')](_0x346c4d);})['then'](function(_0x2c7374){_0x1fb759[_0x58bc('0x40')]=_0x2c7374;return _0x1fb759;})['then'](respondWithFilteredResult(_0x1b7a89,_0x346c4d))['catch'](handleError(_0x1b7a89,null));};exports[_0x58bc('0x41')]=function(_0x1c4672,_0x1ab200){var _0x4b6c1e={'raw':!![],'where':{'id':_0x1c4672[_0x58bc('0x42')]['id']}},_0x5afaaf={};_0x5afaaf[_0x58bc('0x2d')]=_[_0x58bc('0x30')](db[_0x58bc('0x29')][_0x58bc('0x2a')]);_0x5afaaf[_0x58bc('0x2f')]=_[_0x58bc('0x30')](_0x1c4672[_0x58bc('0x2f')]);_0x5afaaf[_0x58bc('0x39')]=_[_0x58bc('0x31')](_0x5afaaf[_0x58bc('0x2d')],_0x5afaaf[_0x58bc('0x2f')]);_0x4b6c1e['attributes']=_[_0x58bc('0x31')](_0x5afaaf['model'],qs[_0x58bc('0x33')](_0x1c4672[_0x58bc('0x2f')][_0x58bc('0x33')]));_0x4b6c1e['attributes']=_0x4b6c1e[_0x58bc('0x32')][_0x58bc('0x34')]?_0x4b6c1e[_0x58bc('0x32')]:_0x5afaaf[_0x58bc('0x2d')];if(_0x1c4672['query']['includeAll']){_0x4b6c1e['include']=[{'all':!![]}];}_0x4b6c1e=_[_0x58bc('0x3a')]({},_0x4b6c1e,_0x1c4672['options']);return db[_0x58bc('0x29')][_0x58bc('0x43')](_0x4b6c1e)[_0x58bc('0x21')](handleEntityNotFound(_0x1ab200,null))['then'](respondWithResult(_0x1ab200,null))[_0x58bc('0x44')](handleError(_0x1ab200,null));};exports[_0x58bc('0x45')]=function(_0x4d4b62,_0x28f7aa){return db[_0x58bc('0x29')][_0x58bc('0x45')](_0x4d4b62['body'],{})[_0x58bc('0x21')](function(_0x59e80f){var _0x4919de=_0x4d4b62[_0x58bc('0x46')][_0x58bc('0x47')]({'plain':!![]});if(!_0x4919de)throw new Error(_0x58bc('0x48'));if(_0x4919de['role']===_0x58bc('0x46')){var _0x82cb0a=_0x59e80f[_0x58bc('0x47')]({'plain':!![]});var _0xc8aa0b=_0x58bc('0x23');return db['UserProfileSection'][_0x58bc('0x43')]({'where':{'name':_0xc8aa0b,'userProfileId':_0x4919de[_0x58bc('0x49')]},'raw':!![]})[_0x58bc('0x21')](function(_0x2c45dc){if(_0x2c45dc&&_0x2c45dc[_0x58bc('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x82cb0a[_0x58bc('0x27')],'resourceId':_0x82cb0a['id'],'type':_0x2c45dc[_0x58bc('0x27')],'sectionId':_0x2c45dc['id']},{})['then'](function(){return _0x59e80f;});}else{return _0x59e80f;}})[_0x58bc('0x44')](function(_0x13d139){logger[_0x58bc('0x25')](_0x58bc('0x4b'),_0x13d139);throw _0x13d139;});}return _0x59e80f;})['then'](respondWithResult(_0x28f7aa,0xc9))[_0x58bc('0x44')](handleError(_0x28f7aa,null));};exports[_0x58bc('0x20')]=function(_0x447c0a,_0x2caddd){if(_0x447c0a[_0x58bc('0x4c')]['id']){delete _0x447c0a[_0x58bc('0x4c')]['id'];}return db[_0x58bc('0x29')][_0x58bc('0x43')]({'where':{'id':_0x447c0a['params']['id']}})[_0x58bc('0x21')](handleEntityNotFound(_0x2caddd,null))[_0x58bc('0x21')](saveUpdates(_0x447c0a[_0x58bc('0x4c')],null))['then'](respondWithResult(_0x2caddd,null))[_0x58bc('0x44')](handleError(_0x2caddd,null));};exports[_0x58bc('0x22')]=function(_0x3c9b44,_0x483243){return db['Interval']['find']({'where':{'id':_0x3c9b44[_0x58bc('0x42')]['id']}})[_0x58bc('0x21')](handleEntityNotFound(_0x483243,null))[_0x58bc('0x21')](removeEntity(_0x483243,null))[_0x58bc('0x44')](handleError(_0x483243,null));};exports[_0x58bc('0x4d')]=function(_0x4d59e4,_0x388d75,_0x1a5726){if(_0x4d59e4[_0x58bc('0x4c')]['id']){delete _0x4d59e4['body']['id'];}return db[_0x58bc('0x29')][_0x58bc('0x43')]({'where':{'id':_0x4d59e4[_0x58bc('0x42')]['id']}})[_0x58bc('0x21')](handleEntityNotFound(_0x388d75,null))[_0x58bc('0x21')](function(_0x336275){if(_0x336275){_0x4d59e4[_0x58bc('0x4c')][_0x58bc('0x4e')]=_0x336275['id'];return db[_0x58bc('0x29')][_0x58bc('0x45')](_0x4d59e4[_0x58bc('0x4c')]);}})[_0x58bc('0x21')](respondWithResult(_0x388d75,null))['catch'](handleError(_0x388d75,null));};exports[_0x58bc('0x4f')]=function(_0x4443cc,_0x4db0e1,_0xf52638){var _0x523ad4={};var _0x427111={};var _0x5ee09a;var _0xea6832;return db[_0x58bc('0x29')][_0x58bc('0x50')]({'where':{'id':_0x4443cc[_0x58bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x4db0e1,null))[_0x58bc('0x21')](function(_0x56d170){if(_0x56d170){_0x5ee09a=_0x56d170;_0x427111[_0x58bc('0x2d')]=_['keys'](db['Interval']['rawAttributes']);_0x427111[_0x58bc('0x2f')]=_[_0x58bc('0x30')](_0x4443cc['query']);_0x427111[_0x58bc('0x39')]=_[_0x58bc('0x31')](_0x427111[_0x58bc('0x2d')],_0x427111[_0x58bc('0x2f')]);_0x523ad4[_0x58bc('0x32')]=_['intersection'](_0x427111[_0x58bc('0x2d')],qs[_0x58bc('0x33')](_0x4443cc['query'][_0x58bc('0x33')]));_0x523ad4[_0x58bc('0x32')]=_0x523ad4[_0x58bc('0x32')][_0x58bc('0x34')]?_0x523ad4['attributes']:_0x427111[_0x58bc('0x2d')];_0x523ad4[_0x58bc('0x51')]=qs[_0x58bc('0x37')](_0x4443cc['query']['sort']);_0x523ad4['where']=qs[_0x58bc('0x39')](_[_0x58bc('0x52')](_0x4443cc[_0x58bc('0x2f')],_0x427111[_0x58bc('0x39')]));if(_0x4443cc[_0x58bc('0x2f')][_0x58bc('0x3c')]){_0x523ad4[_0x58bc('0x38')]=_[_0x58bc('0x3a')](_0x523ad4[_0x58bc('0x38')],{'$or':_['map'](_0x523ad4[_0x58bc('0x32')],function(_0x58946a){var _0x42d374={};_0x42d374[_0x58946a]={'$like':'%'+_0x4443cc[_0x58bc('0x2f')][_0x58bc('0x3c')]+'%'};return _0x42d374;})});}_0x523ad4=_['merge']({},_0x523ad4,_0x4443cc[_0x58bc('0x53')]);return _0x5ee09a[_0x58bc('0x4f')](_0x523ad4);}})['then'](function(_0xa67eda){if(_0xa67eda){_0xea6832=_0xa67eda[_0x58bc('0x34')];if(!_0x4443cc['query'][_0x58bc('0x35')](_0x58bc('0x36'))){_0x523ad4[_0x58bc('0x1c')]=qs[_0x58bc('0x1c')](_0x4443cc[_0x58bc('0x2f')]['limit']);_0x523ad4[_0x58bc('0x1a')]=qs['offset'](_0x4443cc['query'][_0x58bc('0x1a')]);}return _0x5ee09a[_0x58bc('0x4f')](_0x523ad4);}})[_0x58bc('0x21')](function(_0x4904d1){if(_0x4904d1){return _0x4904d1?{'count':_0xea6832,'rows':_0x4904d1}:null;}})[_0x58bc('0x21')](respondWithResult(_0x4db0e1,null))['catch'](handleError(_0x4db0e1,null));};exports[_0x58bc('0x54')]=function(_0x53f5f6,_0x3e803f,_0x5e1b3d){return db['Interval'][_0x58bc('0x50')]({'where':{'id':_0x53f5f6[_0x58bc('0x42')]['id']}})[_0x58bc('0x21')](handleEntityNotFound(_0x3e803f,null))[_0x58bc('0x21')](function(_0x2ef412){if(_0x2ef412){return db[_0x58bc('0x55')][_0x58bc('0x56')](function(_0x4c5bb1){return db[_0x58bc('0x29')][_0x58bc('0x22')]({'where':{'IntervalId':_0x53f5f6['params']['id']},'transaction':_0x4c5bb1})[_0x58bc('0x21')](function(_0x489ff0){var _0x23c088=_['map'](_0x53f5f6[_0x58bc('0x4c')],function(_0x441f5b){delete _0x441f5b['id'];_0x441f5b[_0x58bc('0x4e')]=_0x53f5f6[_0x58bc('0x42')]['id'];return _0x441f5b;});return db[_0x58bc('0x29')][_0x58bc('0x57')](_0x23c088,{'transaction':_0x4c5bb1});});})['then'](function(){return db[_0x58bc('0x29')][_0x58bc('0x3f')]({'where':{'IntervalId':_0x53f5f6['params']['id']}});});}})['then'](respondWithResult(_0x3e803f,null))[_0x58bc('0x44')](handleError(_0x3e803f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c71c525..bd78f61 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 _0x28b5=['./interval.attributes','exports','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1cc160,_0x2e8022){var _0x33cef9=function(_0x59c96d){while(--_0x59c96d){_0x1cc160['push'](_0x1cc160['shift']());}};_0x33cef9(++_0x2e8022);}(_0x28b5,0xad));var _0x528b=function(_0x46c512,_0x15f541){_0x46c512=_0x46c512-0x0;var _0x1532c3=_0x28b5[_0x46c512];return _0x1532c3;};'use strict';var _=require(_0x528b('0x0'));var util=require(_0x528b('0x1'));var logger=require(_0x528b('0x2'))('api');var moment=require(_0x528b('0x3'));var BPromise=require(_0x528b('0x4'));var rp=require(_0x528b('0x5'));var fs=require('fs');var path=require(_0x528b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x528b('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x528b('0x8')]=function(_0x4d83aa,_0x299c43){return _0x4d83aa['define'](_0x528b('0x9'),attributes,{'tableName':_0x528b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2050b1,_0x1de80b){extensions[_0x528b('0xb')](_0x4d83aa,_0x2050b1);},'afterBulkCreate':function(_0x1de22b,_0x36f705,_0x1f64d6){_0x1f64d6();extensions[_0x528b('0xb')](_0x4d83aa,_0x1de22b[0x0]);},'afterUpdate':function(_0xe115d,_0x2deff6){extensions[_0x528b('0xb')](_0x4d83aa,_0xe115d);},'afterDestroy':function(_0x1d17c0,_0x277a37){extensions[_0x528b('0xb')](_0x4d83aa,_0x1d17c0);}}});}; \ No newline at end of file +var _0x570a=['rimraf','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite','lodash','moment','bluebird','request-promise'];(function(_0x1a7692,_0x3e83f3){var _0x3e936f=function(_0x2eb966){while(--_0x2eb966){_0x1a7692['push'](_0x1a7692['shift']());}};_0x3e936f(++_0x3e83f3);}(_0x570a,0x11e));var _0xa570=function(_0x24f53a,_0x178e83){_0x24f53a=_0x24f53a-0x0;var _0x14fb31=_0x570a[_0x24f53a];return _0x14fb31;};'use strict';var _=require(_0xa570('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa570('0x1'));var BPromise=require(_0xa570('0x2'));var rp=require(_0xa570('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa570('0x4'));var config=require('../../config/environment');var attributes=require(_0xa570('0x5'));var extensions=require(_0xa570('0x6'));module['exports']=function(_0x17c965,_0x4e839f){return _0x17c965[_0xa570('0x7')]('Interval',attributes,{'tableName':_0xa570('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b7f29,_0x48fd70){extensions[_0xa570('0x9')](_0x17c965,_0x2b7f29);},'afterBulkCreate':function(_0x412330,_0x4a4682,_0x3151bc){_0x3151bc();extensions[_0xa570('0x9')](_0x17c965,_0x412330[0x0]);},'afterUpdate':function(_0x31a47d,_0x59735f){extensions['rewrite'](_0x17c965,_0x31a47d);},'afterDestroy':function(_0x89ace4,_0x51b7ed){extensions[_0xa570('0x9')](_0x17c965,_0x89ace4);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9baa5de..e710a48 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(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 a95996f..260cea7 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0x0b0e[_0x4254e7];return _0x5e0844;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x22becc,_0x43d4ae){var _0x90481c=function(_0x45dd6b){while(--_0x45dd6b){_0x22becc['push'](_0x22becc['shift']());}};_0x90481c(++_0x43d4ae);}(_0xdb28,0x106));var _0x8db2=function(_0x4dc67b,_0x39ee33){_0x4dc67b=_0x4dc67b-0x0;var _0x7bbbf1=_0xdb28[_0x4dc67b];return _0x7bbbf1;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 4861de9..ac8c313 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 _0xc7b7=['write','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','data','status','statusCode','json','parse','api.jira'];(function(_0x1c55a4,_0x56b3f4){var _0x13bee0=function(_0x58cb23){while(--_0x58cb23){_0x1c55a4['push'](_0x1c55a4['shift']());}};_0x13bee0(++_0x56b3f4);}(_0xc7b7,0x13e));var _0x7c7b=function(_0x4e707e,_0x208eb5){_0x4e707e=_0x4e707e-0x0;var _0x3d346e=_0xc7b7[_0x4e707e];return _0x3d346e;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x7c7b('0x0'))('api');var USERNAME='support';var PASSWORD=_0x7c7b('0x1');function openIssue(_0x28681e,_0xf8c994){var _0x4a3fef={'fields':{'project':{'key':_0x28681e[_0x7c7b('0x2')]||_0x7c7b('0x3')},'summary':(_0x28681e[_0x7c7b('0x4')]||_0x7c7b('0x5'))+_0x7c7b('0x6')+_0x28681e['ip'],'description':_0x28681e[_0x7c7b('0x7')]||JSON['stringify'](_0x28681e),'issuetype':{'name':_0x28681e['issuetype']||'Bug'}}};_0x4a3fef[_0x7c7b('0x8')][_0x7c7b('0x9')]=_0x28681e[_0x7c7b('0xa')];_0x4a3fef['fields'][_0x7c7b('0xb')]=_0x28681e[_0x7c7b('0xc')];_0x4a3fef[_0x7c7b('0x8')][_0x7c7b('0xd')]=_0x28681e[_0x7c7b('0xe')];_0x4a3fef['fields'][_0x7c7b('0xf')]=_0x28681e[_0x7c7b('0x10')];_0x4a3fef['fields'][_0x7c7b('0x11')]=_0x28681e['reason'];_0x4a3fef['fields']['customfield_10102']=_0x28681e['ip'];var _0x190187={'host':_0x7c7b('0x12'),'port':0x1bb,'path':_0x7c7b('0x13'),'method':_0x7c7b('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x7c7b('0x15'),'Authorization':_0x7c7b('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x7c7b('0x17')](_0x7c7b('0x18'))}};var _0xc16b1b=JSON[_0x7c7b('0x19')](_0x4a3fef);var _0x30bbd6=https[_0x7c7b('0x1a')](_0x190187,function(_0x2070c8){_0x2070c8[_0x7c7b('0x1b')]('utf8');var _0x1de97a='';_0x2070c8['on'](_0x7c7b('0x1c'),function(_0x586ce7){_0x1de97a+=_0x586ce7;});_0x2070c8['on']('end',function(){if(_0xf8c994){return _0xf8c994[_0x7c7b('0x1d')](_0x2070c8[_0x7c7b('0x1e')])[_0x7c7b('0x1f')](JSON[_0x7c7b('0x20')](_0x1de97a));}});});_0x30bbd6['on']('error',function(_0xf62dc0){if(_0xf8c994){return _0xf8c994[_0x7c7b('0x1d')](0x1f4)[_0x7c7b('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x7c7b('0x21')}]});}});_0x30bbd6[_0x7c7b('0x22')](_0xc16b1b);_0x30bbd6[_0x7c7b('0x23')]();}exports[_0x7c7b('0x24')]=openIssue;exports[_0x7c7b('0x25')]=function(_0x53acf7,_0x47cf07){_0x53acf7[_0x7c7b('0x26')]['ip']=_0x53acf7[_0x7c7b('0x27')][_0x7c7b('0x28')]||_0x53acf7[_0x7c7b('0x29')][_0x7c7b('0x2a')]||_0x53acf7[_0x7c7b('0x2b')][_0x7c7b('0x2a')]||_0x53acf7[_0x7c7b('0x29')][_0x7c7b('0x2b')][_0x7c7b('0x2a')];return openIssue(_0x53acf7[_0x7c7b('0x26')],_0x47cf07);}; \ No newline at end of file +var _0xef40=['bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket'];(function(_0x1326f7,_0x58a432){var _0x57ab10=function(_0x3f79b6){while(--_0x3f79b6){_0x1326f7['push'](_0x1326f7['shift']());}};_0x57ab10(++_0x58a432);}(_0xef40,0x66));var _0x0ef4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xef40[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require(_0x0ef4('0x0'));var https=require(_0x0ef4('0x1'));var logger=require(_0x0ef4('0x2'))(_0x0ef4('0x3'));var USERNAME=_0x0ef4('0x4');var PASSWORD=_0x0ef4('0x5');function openIssue(_0x3e4f57,_0x298305){var _0x330b2f={'fields':{'project':{'key':_0x3e4f57[_0x0ef4('0x6')]||'MOTGUI'},'summary':(_0x3e4f57[_0x0ef4('0x7')]||_0x0ef4('0x8'))+_0x0ef4('0x9')+_0x3e4f57['ip'],'description':_0x3e4f57[_0x0ef4('0xa')]||JSON[_0x0ef4('0xb')](_0x3e4f57),'issuetype':{'name':_0x3e4f57[_0x0ef4('0xc')]||'Bug'}}};_0x330b2f[_0x0ef4('0xd')][_0x0ef4('0xe')]=_0x3e4f57[_0x0ef4('0xf')];_0x330b2f['fields'][_0x0ef4('0x10')]=_0x3e4f57[_0x0ef4('0x11')];_0x330b2f['fields'][_0x0ef4('0x12')]=_0x3e4f57['newToken'];_0x330b2f[_0x0ef4('0xd')][_0x0ef4('0x13')]=_0x3e4f57[_0x0ef4('0x14')];_0x330b2f[_0x0ef4('0xd')][_0x0ef4('0x15')]=_0x3e4f57['reason'];_0x330b2f['fields'][_0x0ef4('0x16')]=_0x3e4f57['ip'];var _0x5eb747={'host':_0x0ef4('0x17'),'port':0x1bb,'path':_0x0ef4('0x18'),'method':_0x0ef4('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x0ef4('0x1a'),'Authorization':_0x0ef4('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0x0ef4('0x1c')](_0x0ef4('0x1d'))}};var _0xfd7a8f=JSON['stringify'](_0x330b2f);var _0x4ca235=https[_0x0ef4('0x1e')](_0x5eb747,function(_0x4a4f81){_0x4a4f81[_0x0ef4('0x1f')](_0x0ef4('0x20'));var _0x1fd81b='';_0x4a4f81['on'](_0x0ef4('0x21'),function(_0x34a1cb){_0x1fd81b+=_0x34a1cb;});_0x4a4f81['on'](_0x0ef4('0x22'),function(){if(_0x298305){return _0x298305[_0x0ef4('0x23')](_0x4a4f81[_0x0ef4('0x24')])[_0x0ef4('0x25')](JSON[_0x0ef4('0x26')](_0x1fd81b));}});});_0x4ca235['on'](_0x0ef4('0x27'),function(_0x45dc05){if(_0x298305){return _0x298305['status'](0x1f4)[_0x0ef4('0x25')]({'errors':[{'message':_0x0ef4('0x28'),'type':_0x0ef4('0x29')}]});}});_0x4ca235[_0x0ef4('0x2a')](_0xfd7a8f);_0x4ca235[_0x0ef4('0x22')]();}exports[_0x0ef4('0x2b')]=openIssue;exports[_0x0ef4('0x2c')]=function(_0x35cf72,_0x3f2c23){_0x35cf72[_0x0ef4('0x2d')]['ip']=_0x35cf72[_0x0ef4('0x2e')][_0x0ef4('0x2f')]||_0x35cf72[_0x0ef4('0x30')]['remoteAddress']||_0x35cf72['socket'][_0x0ef4('0x31')]||_0x35cf72[_0x0ef4('0x30')][_0x0ef4('0x32')][_0x0ef4('0x31')];return openIssue(_0x35cf72[_0x0ef4('0x2d')],_0x3f2c23);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ad83680..baf907a 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 _0x6f7a=['isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x1d2a6c,_0x4523a9){var _0x30e0c9=function(_0x32fb85){while(--_0x32fb85){_0x1d2a6c['push'](_0x1d2a6c['shift']());}};_0x30e0c9(++_0x4523a9);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x559938,_0x1a7313){_0x559938=_0x559938-0x0;var _0x418dc8=_0x6f7a[_0x559938];return _0x418dc8;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6f7('0x11')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);module[_0xa6f7('0x14')]=router; \ No newline at end of file +var _0xb903=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','isAuthenticated','describe','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3730ac,_0x98cfaf){var _0x47d8a8=function(_0x40b3d2){while(--_0x40b3d2){_0x3730ac['push'](_0x3730ac['shift']());}};_0x47d8a8(++_0x98cfaf);}(_0xb903,0x185));var _0x3b90=function(_0x2862eb,_0x3045bd){_0x2862eb=_0x2862eb-0x0;var _0x4bb630=_0xb903[_0x2862eb];return _0x4bb630;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/describe',auth[_0x3b90('0xc')](),controller[_0x3b90('0xd')]);router[_0x3b90('0xa')](_0x3b90('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3b90('0xe'),auth[_0x3b90('0xc')](),controller['update']);router[_0x3b90('0xf')](_0x3b90('0xe'),auth['isAuthenticated'](),controller[_0x3b90('0x10')]);module[_0x3b90('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8af267e..ef9e79d 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x3c0397,_0x2ccf06){_0x3c0397=_0x3c0397-0x0;var _0x41d357=_0x7a54[_0x3c0397];return _0x41d357;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x53c989,_0x441628){_0x53c989=_0x53c989-0x0;var _0x3d85ed=_0x7a54[_0x53c989];return _0x3d85ed;};'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 4602699..f012b69 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 _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../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','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','JscriptyAnswerReport','then','includeAll','findAll','rows','show'];(function(_0x244bdf,_0x4138c2){var _0x222159=function(_0xde36a7){while(--_0xde36a7){_0x244bdf['push'](_0x244bdf['shift']());}};_0x222159(++_0x4138c2);}(_0x4074,0xf0));var _0x4407=function(_0x397d70,_0x11db88){_0x397d70=_0x397d70-0x0;var _0x4425d7=_0x4074[_0x397d70];return _0x4425d7;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['JscriptyAnswerReport'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['JscriptyAnswerReport'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['JscriptyAnswerReport'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));}; \ No newline at end of file +var _0x0ec6=['../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','index','rawAttributes','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','options','JscriptyAnswerReport','then','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x4222c5,_0x212420){var _0x252e0b=function(_0x51d612){while(--_0x51d612){_0x4222c5['push'](_0x4222c5['shift']());}};_0x252e0b(++_0x212420);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x355fb4,_0x17bd9f){_0x355fb4=_0x355fb4-0x0;var _0x5ff780=_0x0ec6[_0x355fb4];return _0x5ff780;};'use strict';var emlformat=require(_0x60ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ec('0x1'));var rp=require(_0x60ec('0x2'));var moment=require(_0x60ec('0x3'));var BPromise=require(_0x60ec('0x4'));var Mustache=require(_0x60ec('0x5'));var util=require(_0x60ec('0x6'));var path=require(_0x60ec('0x7'));var sox=require('sox');var csv=require(_0x60ec('0x8'));var ejs=require(_0x60ec('0x9'));var fs=require('fs');var fs_extra=require(_0x60ec('0xa'));var _=require(_0x60ec('0xb'));var squel=require('squel');var crypto=require(_0x60ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60ec('0xd'));var toCsv=require(_0x60ec('0x8'));var querystring=require(_0x60ec('0xe'));var Papa=require(_0x60ec('0xf'));var Redis=require(_0x60ec('0x10'));var authService=require(_0x60ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60ec('0x12'));var logger=require(_0x60ec('0x13'))(_0x60ec('0x14'));var utils=require(_0x60ec('0x15'));var config=require(_0x60ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28cabb,_0x41621a){_0x41621a=_0x41621a||0xcc;return function(_0x103a72){if(_0x103a72){return _0x28cabb[_0x60ec('0x17')](_0x41621a);}return _0x28cabb[_0x60ec('0x18')](_0x41621a)['end']();};}function respondWithResult(_0x21af57,_0x456fb5){_0x456fb5=_0x456fb5||0xc8;return function(_0x22fdb1){if(_0x22fdb1){return _0x21af57[_0x60ec('0x18')](_0x456fb5)[_0x60ec('0x19')](_0x22fdb1);}};}function respondWithFilteredResult(_0x23298f,_0x1f7c76){return function(_0x19dd55){if(_0x19dd55){var _0x448553=typeof _0x1f7c76['offset']===_0x60ec('0x1a')&&typeof _0x1f7c76[_0x60ec('0x1b')]===_0x60ec('0x1a');var _0x155bdc=_0x19dd55[_0x60ec('0x1c')];var _0x222c38=_0x448553?0x0:_0x1f7c76[_0x60ec('0x1d')];var _0x13052c=_0x448553?_0x19dd55[_0x60ec('0x1c')]:_0x1f7c76[_0x60ec('0x1d')]+_0x1f7c76[_0x60ec('0x1b')];var _0x1bdc45;if(_0x13052c>=_0x155bdc){_0x13052c=_0x155bdc;_0x1bdc45=0xc8;}else{_0x1bdc45=0xce;}_0x23298f['status'](_0x1bdc45);return _0x23298f[_0x60ec('0x1e')](_0x60ec('0x1f'),_0x222c38+'-'+_0x13052c+'/'+_0x155bdc)[_0x60ec('0x19')](_0x19dd55);}return null;};}function patchUpdates(_0x278ae3){return function(_0x5cace8){try{jsonpatch[_0x60ec('0x20')](_0x5cace8,_0x278ae3,!![]);}catch(_0x3e152c){return BPromise[_0x60ec('0x21')](_0x3e152c);}return _0x5cace8[_0x60ec('0x22')]();};}function saveUpdates(_0x3ab7ef,_0x354f08){return function(_0x492dfa){if(_0x492dfa){return _0x492dfa['update'](_0x3ab7ef)['then'](function(_0x1476c6){return _0x1476c6;});}return null;};}function removeEntity(_0x1080c0,_0x1f0ce7){return function(_0x1fd96e){if(_0x1fd96e){return _0x1fd96e['destroy']()['then'](function(){_0x1080c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x317b9a,_0x474374){return function(_0x42d1c2){if(!_0x42d1c2){_0x317b9a[_0x60ec('0x17')](0x194);}return _0x42d1c2;};}function handleError(_0xd4ac40,_0x3d31b7){_0x3d31b7=_0x3d31b7||0x1f4;return function(_0x155c82){logger[_0x60ec('0x23')](_0x155c82[_0x60ec('0x24')]);if(_0x155c82['name']){delete _0x155c82[_0x60ec('0x25')];}_0xd4ac40[_0x60ec('0x18')](_0x3d31b7)[_0x60ec('0x26')](_0x155c82);};}exports[_0x60ec('0x27')]=function(_0xf3817d,_0x3423fb){var _0x1b912c={},_0x4440c7={},_0x24153c={'count':0x0,'rows':[]};var _0x42a5f2=_['map'](db['JscriptyAnswerReport'][_0x60ec('0x28')],function(_0x2df6ba){return{'name':_0x2df6ba['fieldName'],'type':_0x2df6ba['type'][_0x60ec('0x29')]};});_0x4440c7['model']=_[_0x60ec('0x2a')](_0x42a5f2,_0x60ec('0x25'));_0x4440c7[_0x60ec('0x2b')]=_[_0x60ec('0x2c')](_0xf3817d[_0x60ec('0x2b')]);_0x4440c7['filters']=_[_0x60ec('0x2d')](_0x4440c7[_0x60ec('0x2e')],_0x4440c7[_0x60ec('0x2b')]);_0x1b912c[_0x60ec('0x2f')]=_[_0x60ec('0x2d')](_0x4440c7[_0x60ec('0x2e')],qs['fields'](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x30')]));_0x1b912c['attributes']=_0x1b912c[_0x60ec('0x2f')][_0x60ec('0x31')]?_0x1b912c[_0x60ec('0x2f')]:_0x4440c7[_0x60ec('0x2e')];if(!_0xf3817d['query'][_0x60ec('0x32')](_0x60ec('0x33'))){_0x1b912c[_0x60ec('0x1b')]=qs[_0x60ec('0x1b')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x1b')]);_0x1b912c[_0x60ec('0x1d')]=qs[_0x60ec('0x1d')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x1d')]);}_0x1b912c[_0x60ec('0x34')]=qs[_0x60ec('0x35')](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x35')]);_0x1b912c[_0x60ec('0x36')]=qs[_0x60ec('0x37')](_[_0x60ec('0x38')](_0xf3817d['query'],_0x4440c7[_0x60ec('0x37')]),_0x42a5f2);if(_0xf3817d[_0x60ec('0x2b')]['filter']){_0x1b912c[_0x60ec('0x36')]=_['merge'](_0x1b912c[_0x60ec('0x36')],{'$or':_[_0x60ec('0x2a')](_0x42a5f2,function(_0x1b11fd){if(_0x1b11fd[_0x60ec('0x39')]!==_0x60ec('0x3a')){var _0x1bc7f8={};_0x1bc7f8[_0x1b11fd[_0x60ec('0x25')]]={'$like':'%'+_0xf3817d['query']['filter']+'%'};return _0x1bc7f8;}})});}_0x1b912c=_['merge']({},_0x1b912c,_0xf3817d[_0x60ec('0x3b')]);var _0x569b81={'where':_0x1b912c[_0x60ec('0x36')]};return db[_0x60ec('0x3c')]['count'](_0x569b81)[_0x60ec('0x3d')](function(_0x4fa000){_0x24153c['count']=_0x4fa000;if(_0xf3817d['query'][_0x60ec('0x3e')]){_0x1b912c[_0x60ec('0x3f')]=[{'all':!![]}];}return db[_0x60ec('0x3c')][_0x60ec('0x40')](_0x1b912c);})['then'](function(_0x3bb831){_0x24153c[_0x60ec('0x41')]=_0x3bb831;return _0x24153c;})[_0x60ec('0x3d')](respondWithFilteredResult(_0x3423fb,_0x1b912c))[_0x60ec('0x42')](handleError(_0x3423fb,null));};exports[_0x60ec('0x43')]=function(_0x3d3923,_0x355fe8){var _0x1e6662={'raw':!![],'where':{'id':_0x3d3923[_0x60ec('0x44')]['id']}},_0xf76d37={};_0xf76d37[_0x60ec('0x2e')]=_[_0x60ec('0x2c')](db[_0x60ec('0x3c')][_0x60ec('0x28')]);_0xf76d37['query']=_[_0x60ec('0x2c')](_0x3d3923[_0x60ec('0x2b')]);_0xf76d37['filters']=_[_0x60ec('0x2d')](_0xf76d37['model'],_0xf76d37[_0x60ec('0x2b')]);_0x1e6662[_0x60ec('0x2f')]=_[_0x60ec('0x2d')](_0xf76d37[_0x60ec('0x2e')],qs[_0x60ec('0x30')](_0x3d3923['query'][_0x60ec('0x30')]));_0x1e6662['attributes']=_0x1e6662[_0x60ec('0x2f')][_0x60ec('0x31')]?_0x1e6662[_0x60ec('0x2f')]:_0xf76d37[_0x60ec('0x2e')];if(_0x3d3923[_0x60ec('0x2b')]['includeAll']){_0x1e6662[_0x60ec('0x3f')]=[{'all':!![]}];}_0x1e6662=_['merge']({},_0x1e6662,_0x3d3923[_0x60ec('0x3b')]);return db[_0x60ec('0x3c')]['find'](_0x1e6662)['then'](handleEntityNotFound(_0x355fe8,null))[_0x60ec('0x3d')](respondWithResult(_0x355fe8,null))[_0x60ec('0x42')](handleError(_0x355fe8,null));};exports[_0x60ec('0x45')]=function(_0xc7face,_0x39bec5){return db[_0x60ec('0x3c')][_0x60ec('0x45')](_0xc7face[_0x60ec('0x46')],{})[_0x60ec('0x3d')](respondWithResult(_0x39bec5,0xc9))[_0x60ec('0x42')](handleError(_0x39bec5,null));};exports[_0x60ec('0x47')]=function(_0x3c10af,_0x43bfcf){if(_0x3c10af[_0x60ec('0x46')]['id']){delete _0x3c10af[_0x60ec('0x46')]['id'];}return db['JscriptyAnswerReport'][_0x60ec('0x48')]({'where':{'id':_0x3c10af[_0x60ec('0x44')]['id']}})[_0x60ec('0x3d')](handleEntityNotFound(_0x43bfcf,null))[_0x60ec('0x3d')](saveUpdates(_0x3c10af[_0x60ec('0x46')],null))['then'](respondWithResult(_0x43bfcf,null))[_0x60ec('0x42')](handleError(_0x43bfcf,null));};exports['destroy']=function(_0x3ce66e,_0x1265fa){return db['JscriptyAnswerReport'][_0x60ec('0x48')]({'where':{'id':_0x3ce66e[_0x60ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x1265fa,null))['then'](removeEntity(_0x1265fa,null))[_0x60ec('0x42')](handleError(_0x1265fa,null));};exports['describe']=function(_0x4a5c57,_0x1f290e){return db['JscriptyAnswerReport'][_0x60ec('0x49')]()[_0x60ec('0x3d')](respondWithResult(_0x1f290e,null))['catch'](handleError(_0x1f290e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ed32817..26d1287 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 _0x7eaa=['bluebird','path','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x491056,_0x393940){var _0x289e0c=function(_0x277c22){while(--_0x277c22){_0x491056['push'](_0x491056['shift']());}};_0x289e0c(++_0x393940);}(_0x7eaa,0x1a4));var _0xa7ea=function(_0x54093b,_0xa6bc01){_0x54093b=_0x54093b-0x0;var _0x47b0a6=_0x7eaa[_0x54093b];return _0x47b0a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa7ea('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7ea('0x1'));var rimraf=require('rimraf');var config=require(_0xa7ea('0x2'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa7ea('0x3')]=function(_0x602e0f,_0x5a485e){return _0x602e0f[_0xa7ea('0x4')](_0xa7ea('0x5'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4807=['path','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird'];(function(_0x272587,_0x4e5fb1){var _0x3c2ff6=function(_0x36b68d){while(--_0x36b68d){_0x272587['push'](_0x272587['shift']());}};_0x3c2ff6(++_0x4e5fb1);}(_0x4807,0x16d));var _0x7480=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4807[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x7480('0x0'));var util=require(_0x7480('0x1'));var logger=require('../../config/logger')(_0x7480('0x2'));var moment=require(_0x7480('0x3'));var BPromise=require(_0x7480('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7480('0x5'));var rimraf=require('rimraf');var config=require(_0x7480('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x7480('0x7')]=function(_0x2865dc,_0x39f5c4){return _0x2865dc['define'](_0x7480('0x8'),attributes,{'tableName':_0x7480('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 7ed3b40..7753adb 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 _0xee02=['jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x262f44,_0x3847ba){var _0x33b27c=function(_0x5db154){while(--_0x5db154){_0x262f44['push'](_0x262f44['shift']());}};_0x33b27c(++_0x3847ba);}(_0xee02,0x74));var _0x2ee0=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xee02[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require(_0x2ee0('0x0'));var util=require('util');var moment=require(_0x2ee0('0x1'));var BPromise=require(_0x2ee0('0x2'));var rs=require(_0x2ee0('0x3'));var fs=require('fs');var Redis=require(_0x2ee0('0x4'));var db=require(_0x2ee0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ee0('0x6'))(_0x2ee0('0x7'));var config=require(_0x2ee0('0x8'));var jayson=require(_0x2ee0('0x9'));var client=jayson[_0x2ee0('0xa')][_0x2ee0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cf52,_0x22a7c0,_0x498d48){return new BPromise(function(_0xcbf3cc,_0x3eae7c){return client[_0x2ee0('0xc')](_0x25cf52,_0x498d48)[_0x2ee0('0xd')](function(_0x54dddc){logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,'request\x20sent');logger[_0x2ee0('0x10')](_0x2ee0('0x11'),_0x22a7c0,_0x2ee0('0x12'),JSON[_0x2ee0('0x13')](_0x54dddc));if(_0x54dddc[_0x2ee0('0x14')]){if(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x15')]===0x1f4){logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);return _0x3eae7c(_0x54dddc['error']['message']);}logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc['error']['message']);return _0xcbf3cc(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);}else{logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,_0x2ee0('0x12'));_0xcbf3cc(_0x54dddc[_0x2ee0('0x17')][_0x2ee0('0x16')]);}})[_0x2ee0('0x18')](function(_0x359770){logger['error'](_0x2ee0('0xf'),_0x22a7c0,_0x359770);_0x3eae7c(_0x359770);});});} \ No newline at end of file +var _0x830b=['JscriptyAnswerReport,\x20%s,\x20%s','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x11e3fa,_0x230691){var _0x5a7bbd=function(_0xa2c21d){while(--_0xa2c21d){_0x11e3fa['push'](_0x11e3fa['shift']());}};_0x5a7bbd(++_0x230691);}(_0x830b,0xab));var _0xb830=function(_0x396a4e,_0x503865){_0x396a4e=_0x396a4e-0x0;var _0x1ff525=_0x830b[_0x396a4e];return _0x1ff525;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb830('0x0'));var BPromise=require('bluebird');var rs=require(_0xb830('0x1'));var fs=require('fs');var Redis=require(_0xb830('0x2'));var db=require(_0xb830('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb830('0x4'))(_0xb830('0x5'));var config=require(_0xb830('0x6'));var jayson=require(_0xb830('0x7'));var client=jayson[_0xb830('0x8')][_0xb830('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x943638,_0x350230,_0x2c634b){return new BPromise(function(_0x3b95ed,_0x2a5298){return client[_0xb830('0xa')](_0x943638,_0x2c634b)['then'](function(_0xe8545b){logger[_0xb830('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x350230,_0xb830('0xc'));logger[_0xb830('0xd')](_0xb830('0xe'),_0x350230,_0xb830('0xc'),JSON['stringify'](_0xe8545b));if(_0xe8545b[_0xb830('0xf')]){if(_0xe8545b[_0xb830('0xf')][_0xb830('0x10')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x350230,_0xe8545b['error'][_0xb830('0x11')]);return _0x2a5298(_0xe8545b[_0xb830('0xf')][_0xb830('0x11')]);}logger[_0xb830('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x350230,_0xe8545b[_0xb830('0xf')][_0xb830('0x11')]);return _0x3b95ed(_0xe8545b[_0xb830('0xf')][_0xb830('0x11')]);}else{logger[_0xb830('0xb')](_0xb830('0x12'),_0x350230,_0xb830('0xc'));_0x3b95ed(_0xe8545b[_0xb830('0x13')][_0xb830('0x11')]);}})[_0xb830('0x14')](function(_0x3d0846){logger[_0xb830('0xf')](_0xb830('0x12'),_0x350230,_0x3d0846);_0x2a5298(_0x3d0846);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 384e98b..a6f12f2 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 _0xe554=['connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptyProject.controller','index','get','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','put','update','destroy','multer','util'];(function(_0x57c596,_0x5e002d){var _0xf62fa1=function(_0x4cf320){while(--_0x4cf320){_0x57c596['push'](_0x57c596['shift']());}};_0xf62fa1(++_0x5e002d);}(_0xe554,0x82));var _0x4e55=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe554[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4e55('0x0'));var util=require(_0x4e55('0x1'));var path=require('path');var timeout=require(_0x4e55('0x2'));var express=require('express');var router=express[_0x4e55('0x3')]();var fs_extra=require(_0x4e55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e55('0x5'));var config=require('../../config/environment');var controller=require(_0x4e55('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e55('0x7')]);router[_0x4e55('0x8')](_0x4e55('0x9'),auth[_0x4e55('0xa')](),controller[_0x4e55('0xb')]);router[_0x4e55('0x8')]('/:id/sessions',auth[_0x4e55('0xa')](),controller[_0x4e55('0xc')]);router[_0x4e55('0x8')](_0x4e55('0xd'),auth[_0x4e55('0xa')](),controller[_0x4e55('0xe')]);router[_0x4e55('0x8')](_0x4e55('0xf'),auth['isAuthenticated'](),timeout('30s'),controller[_0x4e55('0x10')]);router[_0x4e55('0x11')]('/',auth[_0x4e55('0xa')](),controller['create']);router['post'](_0x4e55('0x12'),auth[_0x4e55('0xa')](),controller['clone']);router[_0x4e55('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4e55('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4e55('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0e74=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','/:id/answers','/:id/summary','getSummary','post','/:id/clone','clone','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e74,0x14b));var _0x40e7=function(_0x14ebc5,_0x5dd345){_0x14ebc5=_0x14ebc5-0x0;var _0x3c1832=_0x0e74[_0x14ebc5];return _0x3c1832;};'use strict';var multer=require(_0x40e7('0x0'));var util=require(_0x40e7('0x1'));var path=require(_0x40e7('0x2'));var timeout=require(_0x40e7('0x3'));var express=require(_0x40e7('0x4'));var router=express[_0x40e7('0x5')]();var fs_extra=require(_0x40e7('0x6'));var auth=require(_0x40e7('0x7'));var interaction=require(_0x40e7('0x8'));var config=require(_0x40e7('0x9'));var controller=require(_0x40e7('0xa'));router[_0x40e7('0xb')]('/',auth['isAuthenticated'](),controller[_0x40e7('0xc')]);router[_0x40e7('0xb')](_0x40e7('0xd'),auth[_0x40e7('0xe')](),controller[_0x40e7('0xf')]);router[_0x40e7('0xb')](_0x40e7('0x10'),auth['isAuthenticated'](),controller['getSessions']);router['get'](_0x40e7('0x11'),auth[_0x40e7('0xe')](),controller['getAnswers']);router[_0x40e7('0xb')](_0x40e7('0x12'),auth[_0x40e7('0xe')](),timeout('30s'),controller[_0x40e7('0x13')]);router[_0x40e7('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x40e7('0x14')](_0x40e7('0x15'),auth[_0x40e7('0xe')](),controller[_0x40e7('0x16')]);router[_0x40e7('0x17')](_0x40e7('0xd'),auth[_0x40e7('0xe')](),controller['update']);router['delete'](_0x40e7('0xd'),auth['isAuthenticated'](),controller[_0x40e7('0x18')]);module[_0x40e7('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 1d82e57..bd8c9f2 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 _0x8387=['long','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','lodash','exports','name','STRING','TEXT'];(function(_0x3d483a,_0xd7117c){var _0x4f7c1=function(_0x4d4c4a){while(--_0x4d4c4a){_0x3d483a['push'](_0x3d483a['shift']());}};_0x4f7c1(++_0xd7117c);}(_0x8387,0x1c2));var _0x7838=function(_0x305350,_0x58cd3c){_0x305350=_0x305350-0x0;var _0x1a1097=_0x8387[_0x305350];return _0x1a1097;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7838('0x0'));var util=require('util');module[_0x7838('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7838('0x2')},'description':{'type':Sequelize[_0x7838('0x3')]},'formData':{'type':Sequelize[_0x7838('0x4')](_0x7838('0x5')),'set':function(_0x3d24f2){if(_['isObjectLike'](_0x3d24f2)){this['setDataValue'](_0x7838('0x6'),JSON['stringify'](_0x3d24f2));}else if(_[_0x7838('0x7')](_0x3d24f2)){this[_0x7838('0x8')](_0x7838('0x6'),_0x3d24f2);}else{this['setDataValue'](_0x7838('0x6'),util[_0x7838('0x9')](_0x7838('0xa'),this[_0x7838('0xb')](_0x7838('0x2'))||'',this[_0x7838('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7838('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf618=['setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike'];(function(_0xc183a1,_0x26880b){var _0xd991f7=function(_0x359ee9){while(--_0x359ee9){_0xc183a1['push'](_0xc183a1['shift']());}};_0xd991f7(++_0x26880b);}(_0xf618,0x16d));var _0x8f61=function(_0x23c62c,_0x4cfae0){_0x23c62c=_0x23c62c-0x0;var _0x5b00f6=_0xf618[_0x23c62c];return _0x5b00f6;};'use strict';var Sequelize=require(_0x8f61('0x0'));var _=require(_0x8f61('0x1'));var util=require(_0x8f61('0x2'));module[_0x8f61('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x8f61('0x4')},'description':{'type':Sequelize[_0x8f61('0x5')]},'formData':{'type':Sequelize[_0x8f61('0x6')](_0x8f61('0x7')),'set':function(_0x551819){if(_[_0x8f61('0x8')](_0x551819)){this[_0x8f61('0x9')](_0x8f61('0xa'),JSON[_0x8f61('0xb')](_0x551819));}else if(_['isString'](_0x551819)){this[_0x8f61('0x9')](_0x8f61('0xa'),_0x551819);}else{this[_0x8f61('0x9')](_0x8f61('0xa'),util[_0x8f61('0xc')](_0x8f61('0xd'),this[_0x8f61('0xe')](_0x8f61('0x4'))||'',this[_0x8f61('0xe')](_0x8f61('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8f61('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9ca6d5d..0ae80b1 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 _0x143a=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','getSessions','JscriptySessionReport','order','pick','ProjectId','count','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x9c644b,_0x499eb5){var _0x3325c4=function(_0x454672){while(--_0x454672){_0x9c644b['push'](_0x9c644b['shift']());}};_0x3325c4(++_0x499eb5);}(_0x143a,0x1b9));var _0xa143=function(_0x1d8854,_0x5e1f17){_0x1d8854=_0x1d8854-0x0;var _0x58e454=_0x143a[_0x1d8854];return _0x58e454;};'use strict';var emlformat=require(_0xa143('0x0'));var rimraf=require(_0xa143('0x1'));var zipdir=require(_0xa143('0x2'));var jsonpatch=require(_0xa143('0x3'));var rp=require(_0xa143('0x4'));var moment=require('moment');var BPromise=require(_0xa143('0x5'));var Mustache=require('mustache');var util=require(_0xa143('0x6'));var path=require('path');var sox=require(_0xa143('0x7'));var csv=require(_0xa143('0x8'));var ejs=require(_0xa143('0x9'));var fs=require('fs');var fs_extra=require(_0xa143('0xa'));var _=require(_0xa143('0xb'));var squel=require(_0xa143('0xc'));var crypto=require(_0xa143('0xd'));var jsforce=require(_0xa143('0xe'));var deskjs=require(_0xa143('0xf'));var toCsv=require(_0xa143('0x8'));var querystring=require(_0xa143('0x10'));var Papa=require(_0xa143('0x11'));var Redis=require('ioredis');var authService=require(_0xa143('0x12'));var qs=require(_0xa143('0x13'));var as=require(_0xa143('0x14'));var hardwareService=require(_0xa143('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa143('0x16'));var config=require(_0xa143('0x17'));var licenseUtil=require(_0xa143('0x18'));var db=require(_0xa143('0x19'))['db'];function respondWithStatusCode(_0xc3cc21,_0x3a5c00){_0x3a5c00=_0x3a5c00||0xcc;return function(_0x226303){if(_0x226303){return _0xc3cc21[_0xa143('0x1a')](_0x3a5c00);}return _0xc3cc21[_0xa143('0x1b')](_0x3a5c00)[_0xa143('0x1c')]();};}function respondWithResult(_0x49807f,_0x1988fe){_0x1988fe=_0x1988fe||0xc8;return function(_0x29146e){if(_0x29146e){return _0x49807f[_0xa143('0x1b')](_0x1988fe)[_0xa143('0x1d')](_0x29146e);}};}function respondWithFilteredResult(_0x4318c1,_0x47d554){return function(_0x72f2c7){if(_0x72f2c7){var _0x3f2771=typeof _0x47d554[_0xa143('0x1e')]==='undefined'&&typeof _0x47d554['limit']===_0xa143('0x1f');var _0x3d7197=_0x72f2c7['count'];var _0x7b534e=_0x3f2771?0x0:_0x47d554[_0xa143('0x1e')];var _0x58343c=_0x3f2771?_0x72f2c7['count']:_0x47d554[_0xa143('0x1e')]+_0x47d554[_0xa143('0x20')];var _0xae3471;if(_0x58343c>=_0x3d7197){_0x58343c=_0x3d7197;_0xae3471=0xc8;}else{_0xae3471=0xce;}_0x4318c1['status'](_0xae3471);return _0x4318c1[_0xa143('0x21')]('Content-Range',_0x7b534e+'-'+_0x58343c+'/'+_0x3d7197)[_0xa143('0x1d')](_0x72f2c7);}return null;};}function patchUpdates(_0x25254a){return function(_0x27d8a8){try{jsonpatch[_0xa143('0x22')](_0x27d8a8,_0x25254a,!![]);}catch(_0x477e4d){return BPromise['reject'](_0x477e4d);}return _0x27d8a8[_0xa143('0x23')]();};}function saveUpdates(_0x3a1998,_0x51eb32){return function(_0x419024){if(_0x419024){return _0x419024[_0xa143('0x24')](_0x3a1998)['then'](function(_0xb90b5c){return _0xb90b5c;});}return null;};}function removeEntity(_0xbf7ac,_0x320f20){return function(_0x317b5f){if(_0x317b5f){return _0x317b5f[_0xa143('0x25')]()[_0xa143('0x26')](function(){var _0x26b7f1=_0x317b5f[_0xa143('0x27')]({'plain':!![]});var _0x2467ac=_0xa143('0x28');return db[_0xa143('0x29')]['destroy']({'where':{'type':_0x2467ac,'resourceId':_0x26b7f1['id']}})[_0xa143('0x26')](function(){return _0x317b5f;});})['then'](function(){_0xbf7ac[_0xa143('0x1b')](0xcc)[_0xa143('0x1c')]();});}};}function handleEntityNotFound(_0x422e04,_0x4fc21e){return function(_0x5b68e0){if(!_0x5b68e0){_0x422e04['sendStatus'](0x194);}return _0x5b68e0;};}function handleError(_0x533e13,_0x1fc193){_0x1fc193=_0x1fc193||0x1f4;return function(_0x571877){logger[_0xa143('0x2a')](_0x571877[_0xa143('0x2b')]);if(_0x571877[_0xa143('0x2c')]){delete _0x571877[_0xa143('0x2c')];}_0x533e13[_0xa143('0x1b')](_0x1fc193)['send'](_0x571877);};}exports[_0xa143('0x2d')]=function(_0x105396,_0x4b1505){var _0x4f1000={},_0x4c8da8={},_0x4363b6={'count':0x0,'rows':[]};var _0xd2b938=_[_0xa143('0x2e')](db[_0xa143('0x2f')][_0xa143('0x30')],function(_0x492677){return{'name':_0x492677[_0xa143('0x31')],'type':_0x492677[_0xa143('0x32')][_0xa143('0x33')]};});_0x4c8da8[_0xa143('0x34')]=_[_0xa143('0x2e')](_0xd2b938,'name');_0x4c8da8['query']=_[_0xa143('0x35')](_0x105396[_0xa143('0x36')]);_0x4c8da8[_0xa143('0x37')]=_[_0xa143('0x38')](_0x4c8da8['model'],_0x4c8da8[_0xa143('0x36')]);_0x4f1000['attributes']=_[_0xa143('0x38')](_0x4c8da8[_0xa143('0x34')],qs[_0xa143('0x39')](_0x105396[_0xa143('0x36')][_0xa143('0x39')]));_0x4f1000[_0xa143('0x3a')]=_0x4f1000['attributes']['length']?_0x4f1000['attributes']:_0x4c8da8['model'];if(!_0x105396[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x4f1000[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x105396[_0xa143('0x36')][_0xa143('0x20')]);_0x4f1000[_0xa143('0x1e')]=qs[_0xa143('0x1e')](_0x105396['query'][_0xa143('0x1e')]);}_0x4f1000['order']=qs[_0xa143('0x3d')](_0x105396[_0xa143('0x36')][_0xa143('0x3d')]);_0x4f1000[_0xa143('0x3e')]=qs[_0xa143('0x37')](_['pick'](_0x105396[_0xa143('0x36')],_0x4c8da8[_0xa143('0x37')]),_0xd2b938);if(_0x105396[_0xa143('0x36')][_0xa143('0x3f')]){_0x4f1000[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x4f1000['where'],{'$or':_[_0xa143('0x2e')](_0xd2b938,function(_0x4a6057){if(_0x4a6057[_0xa143('0x32')]!==_0xa143('0x41')){var _0x30c4a2={};_0x30c4a2[_0x4a6057[_0xa143('0x2c')]]={'$like':'%'+_0x105396['query'][_0xa143('0x3f')]+'%'};return _0x30c4a2;}})});}_0x4f1000=_['merge']({},_0x4f1000,_0x105396[_0xa143('0x42')]);var _0x37178b={'where':_0x4f1000[_0xa143('0x3e')]};return db[_0xa143('0x2f')]['count'](_0x37178b)[_0xa143('0x26')](function(_0x5e2f11){_0x4363b6['count']=_0x5e2f11;if(_0x105396[_0xa143('0x36')][_0xa143('0x43')]){_0x4f1000[_0xa143('0x44')]=[{'all':!![]}];}return db[_0xa143('0x2f')][_0xa143('0x45')](_0x4f1000);})['then'](function(_0x9f650f){_0x4363b6[_0xa143('0x46')]=_0x9f650f;return _0x4363b6;})[_0xa143('0x26')](respondWithFilteredResult(_0x4b1505,_0x4f1000))['catch'](handleError(_0x4b1505,null));};exports[_0xa143('0x47')]=function(_0x4e5901,_0x1f0bd9){var _0x23e732={'raw':![],'where':{'id':_0x4e5901[_0xa143('0x48')]['id']}},_0x2a8828={};_0x2a8828[_0xa143('0x34')]=_[_0xa143('0x35')](db['JscriptyProject'][_0xa143('0x30')]);_0x2a8828[_0xa143('0x36')]=_[_0xa143('0x35')](_0x4e5901['query']);_0x2a8828[_0xa143('0x37')]=_['intersection'](_0x2a8828[_0xa143('0x34')],_0x2a8828[_0xa143('0x36')]);_0x23e732[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x2a8828[_0xa143('0x34')],qs['fields'](_0x4e5901[_0xa143('0x36')]['fields']));_0x23e732[_0xa143('0x3a')]=_0x23e732['attributes'][_0xa143('0x49')]?_0x23e732[_0xa143('0x3a')]:_0x2a8828[_0xa143('0x34')];if(_0x4e5901[_0xa143('0x36')][_0xa143('0x43')]){_0x23e732['include']=[{'all':!![]}];}_0x23e732=_[_0xa143('0x40')]({},_0x23e732,_0x4e5901[_0xa143('0x42')]);return db[_0xa143('0x2f')][_0xa143('0x4a')](_0x23e732)[_0xa143('0x26')](handleEntityNotFound(_0x1f0bd9,null))[_0xa143('0x26')](respondWithResult(_0x1f0bd9,null))['catch'](handleError(_0x1f0bd9,null));};exports[_0xa143('0x4b')]=function(_0x5f5b1b,_0x340392){return db[_0xa143('0x2f')][_0xa143('0x4b')](_0x5f5b1b[_0xa143('0x4c')],{})['then'](function(_0x18a4cf){var _0x27369f=_0x5f5b1b[_0xa143('0x4d')][_0xa143('0x27')]({'plain':!![]});if(!_0x27369f)throw new Error(_0xa143('0x4e'));if(_0x27369f['role']==='user'){var _0xc7db60=_0x18a4cf['get']({'plain':!![]});var _0x1bc17f=_0xa143('0x28');return db['UserProfileSection'][_0xa143('0x4a')]({'where':{'name':_0x1bc17f,'userProfileId':_0x27369f['userProfileId']},'raw':!![]})[_0xa143('0x26')](function(_0x65b782){if(_0x65b782&&_0x65b782[_0xa143('0x4f')]===0x0){return db[_0xa143('0x29')][_0xa143('0x4b')]({'name':_0xc7db60[_0xa143('0x2c')],'resourceId':_0xc7db60['id'],'type':_0x65b782['name'],'sectionId':_0x65b782['id']},{})[_0xa143('0x26')](function(){return _0x18a4cf;});}else{return _0x18a4cf;}})[_0xa143('0x50')](function(_0x48b43b){logger[_0xa143('0x2a')](_0xa143('0x51'),_0x48b43b);throw _0x48b43b;});}return _0x18a4cf;})[_0xa143('0x26')](respondWithResult(_0x340392,0xc9))[_0xa143('0x50')](handleError(_0x340392,null));};exports[_0xa143('0x52')]=function(_0x110e2a,_0x1d71c0){var _0x2728cf={'where':{'id':_0x110e2a[_0xa143('0x48')]['id']}},_0x5ae19e={};_0x5ae19e[_0xa143('0x34')]=_[_0xa143('0x35')](db[_0xa143('0x2f')]['rawAttributes']);_0x2728cf[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x5ae19e[_0xa143('0x34')],qs[_0xa143('0x39')](_0x110e2a[_0xa143('0x36')][_0xa143('0x39')]));_0x2728cf['attributes']=_0x2728cf[_0xa143('0x3a')]['length']?_0x2728cf[_0xa143('0x3a')]:_0x5ae19e[_0xa143('0x34')];if(_0x110e2a[_0xa143('0x36')][_0xa143('0x43')]){_0x2728cf[_0xa143('0x44')]=[{'all':!![]}];}_0x2728cf=_[_0xa143('0x40')]({},_0x2728cf,_0x110e2a[_0xa143('0x42')]);return db[_0xa143('0x2f')][_0xa143('0x4a')](_0x2728cf)['then'](handleEntityNotFound(_0x1d71c0,null))[_0xa143('0x26')](function(_0xa2610d){if(_0xa2610d){var _0x566871=_0xa2610d[_0xa143('0x27')]({'plain':!![]});_0x566871=qs[_0xa143('0x53')](_0x566871,['id',_0xa143('0x54'),_0xa143('0x55')]);_0x110e2a[_0xa143('0x4c')]=_[_0xa143('0x53')](_0x110e2a[_0xa143('0x4c')],['id',_0xa143('0x54'),_0xa143('0x55')]);return db['JscriptyProject'][_0xa143('0x4b')](_[_0xa143('0x40')](_0x566871,_0x110e2a[_0xa143('0x4c')]),{'include':_0x110e2a[_0xa143('0x36')][_0xa143('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x2eb472){var _0x1ccb8c=_0x110e2a[_0xa143('0x4d')][_0xa143('0x27')]({'plain':!![]});if(!_0x1ccb8c)throw new Error(_0xa143('0x4e'));if(_0x1ccb8c[_0xa143('0x56')]===_0xa143('0x4d')){var _0x4229f6=_0x2eb472[_0xa143('0x27')]({'plain':!![]});var _0x11b315='Projects';return db[_0xa143('0x57')][_0xa143('0x4a')]({'where':{'name':_0x11b315,'userProfileId':_0x1ccb8c['userProfileId']},'raw':!![]})[_0xa143('0x26')](function(_0xcf1c08){if(_0xcf1c08&&_0xcf1c08[_0xa143('0x4f')]===0x0){return db[_0xa143('0x29')][_0xa143('0x4b')]({'name':_0x4229f6['name'],'resourceId':_0x4229f6['id'],'type':_0xcf1c08[_0xa143('0x2c')],'sectionId':_0xcf1c08['id']},{})[_0xa143('0x26')](function(){return _0x2eb472;});}else{return _0x2eb472;}})['catch'](function(_0x431b90){logger[_0xa143('0x2a')](_0xa143('0x51'),_0x431b90);throw _0x431b90;});}return _0x2eb472;});}})['then'](respondWithResult(_0x1d71c0,0xc9))[_0xa143('0x50')](handleError(_0x1d71c0,null));};exports['update']=function(_0x1f6e78,_0x12dd6c){if(_0x1f6e78[_0xa143('0x4c')]['id']){delete _0x1f6e78[_0xa143('0x4c')]['id'];}return db[_0xa143('0x2f')][_0xa143('0x4a')]({'where':{'id':_0x1f6e78['params']['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x12dd6c,null))[_0xa143('0x26')](saveUpdates(_0x1f6e78['body'],null))[_0xa143('0x26')](respondWithResult(_0x12dd6c,null))[_0xa143('0x50')](handleError(_0x12dd6c,null));};exports[_0xa143('0x25')]=function(_0x117028,_0x1af5c0){return db[_0xa143('0x2f')]['find']({'where':{'id':_0x117028[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x1af5c0,null))[_0xa143('0x26')](removeEntity(_0x1af5c0,null))[_0xa143('0x50')](handleError(_0x1af5c0,null));};exports[_0xa143('0x58')]=function(_0x37ca1f,_0x51add7,_0xaed815){var _0x415f8f={'raw':!![],'where':{}};var _0x5cda88={};var _0xbdc66b={'count':0x0,'rows':[]};return db[_0xa143('0x2f')]['findOne']({'where':{'id':_0x37ca1f[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0x51add7,null))[_0xa143('0x26')](function(_0x1076b2){if(_0x1076b2){_0x5cda88[_0xa143('0x34')]=_[_0xa143('0x35')](db[_0xa143('0x59')][_0xa143('0x30')]);_0x5cda88[_0xa143('0x36')]=_[_0xa143('0x35')](_0x37ca1f[_0xa143('0x36')]);_0x5cda88['filters']=_['intersection'](_0x5cda88[_0xa143('0x34')],_0x5cda88[_0xa143('0x36')]);_0x415f8f[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x5cda88[_0xa143('0x34')],qs[_0xa143('0x39')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x39')]));_0x415f8f[_0xa143('0x3a')]=_0x415f8f['attributes']['length']?_0x415f8f['attributes']:_0x5cda88[_0xa143('0x34')];if(!_0x37ca1f[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x415f8f[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x20')]);_0x415f8f['offset']=qs['offset'](_0x37ca1f[_0xa143('0x36')][_0xa143('0x1e')]);}_0x415f8f[_0xa143('0x5a')]=qs[_0xa143('0x3d')](_0x37ca1f[_0xa143('0x36')][_0xa143('0x3d')]);_0x415f8f[_0xa143('0x3e')]=qs['filters'](_[_0xa143('0x5b')](_0x37ca1f['query'],_0x5cda88[_0xa143('0x37')]));_0x415f8f['where'][_0xa143('0x5c')]=_0x1076b2['id'];if(_0x37ca1f['query'][_0xa143('0x3f')]){_0x415f8f[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x415f8f[_0xa143('0x3e')],{'$or':_[_0xa143('0x2e')](_0x415f8f[_0xa143('0x3a')],function(_0x6443dd){var _0x406f9a={};_0x406f9a[_0x6443dd]={'$like':'%'+_0x37ca1f[_0xa143('0x36')]['filter']+'%'};return _0x406f9a;})});}_0x415f8f=_['merge']({},_0x415f8f,_0x37ca1f[_0xa143('0x42')]);return db[_0xa143('0x59')]['count']({'where':_0x415f8f[_0xa143('0x3e')]})[_0xa143('0x26')](function(_0x1c94b9){_0xbdc66b[_0xa143('0x5d')]=_0x1c94b9;if(_0x37ca1f[_0xa143('0x36')][_0xa143('0x43')]){_0x415f8f['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xa143('0x45')](_0x415f8f);})[_0xa143('0x26')](function(_0x46a627){_0xbdc66b[_0xa143('0x46')]=_0x46a627;return _0xbdc66b;});}})['then'](respondWithFilteredResult(_0x51add7,_0x415f8f))[_0xa143('0x50')](handleError(_0x51add7,null));};exports[_0xa143('0x5e')]=function(_0x536261,_0xe2dbc1,_0x5f15c3){var _0x2fed93={'raw':!![],'where':{}};var _0x4c9a69={};var _0x36f159={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa143('0x5f')]({'where':{'id':_0x536261[_0xa143('0x48')]['id']}})[_0xa143('0x26')](handleEntityNotFound(_0xe2dbc1,null))[_0xa143('0x26')](function(_0xf80dbd){if(_0xf80dbd){_0x4c9a69[_0xa143('0x34')]=_['keys'](db[_0xa143('0x60')]['rawAttributes']);_0x4c9a69[_0xa143('0x36')]=_[_0xa143('0x35')](_0x536261[_0xa143('0x36')]);_0x4c9a69[_0xa143('0x37')]=_[_0xa143('0x38')](_0x4c9a69[_0xa143('0x34')],_0x4c9a69[_0xa143('0x36')]);_0x2fed93[_0xa143('0x3a')]=_[_0xa143('0x38')](_0x4c9a69['model'],qs['fields'](_0x536261[_0xa143('0x36')]['fields']));_0x2fed93[_0xa143('0x3a')]=_0x2fed93[_0xa143('0x3a')][_0xa143('0x49')]?_0x2fed93[_0xa143('0x3a')]:_0x4c9a69[_0xa143('0x34')];if(!_0x536261[_0xa143('0x36')][_0xa143('0x3b')](_0xa143('0x3c'))){_0x2fed93[_0xa143('0x20')]=qs[_0xa143('0x20')](_0x536261[_0xa143('0x36')][_0xa143('0x20')]);_0x2fed93[_0xa143('0x1e')]=qs['offset'](_0x536261[_0xa143('0x36')][_0xa143('0x1e')]);}_0x2fed93[_0xa143('0x5a')]=qs[_0xa143('0x3d')](_0x536261[_0xa143('0x36')]['sort']);_0x2fed93[_0xa143('0x3e')]=qs[_0xa143('0x37')](_[_0xa143('0x5b')](_0x536261[_0xa143('0x36')],_0x4c9a69['filters']));_0x2fed93[_0xa143('0x3e')][_0xa143('0x5c')]=_0xf80dbd['id'];if(_0x536261[_0xa143('0x36')][_0xa143('0x3f')]){_0x2fed93[_0xa143('0x3e')]=_[_0xa143('0x40')](_0x2fed93[_0xa143('0x3e')],{'$or':_[_0xa143('0x2e')](_0x2fed93[_0xa143('0x3a')],function(_0x3c0a1e){var _0x4a99d6={};_0x4a99d6[_0x3c0a1e]={'$like':'%'+_0x536261['query']['filter']+'%'};return _0x4a99d6;})});}_0x2fed93=_['merge']({},_0x2fed93,_0x536261[_0xa143('0x42')]);return db[_0xa143('0x60')]['count']({'where':_0x2fed93[_0xa143('0x3e')]})[_0xa143('0x26')](function(_0xd672fe){_0x36f159[_0xa143('0x5d')]=_0xd672fe;if(_0x536261['query']['includeAll']){_0x2fed93['include']=[{'all':!![]}];}return db[_0xa143('0x60')][_0xa143('0x45')](_0x2fed93);})['then'](function(_0x3b8900){_0x36f159[_0xa143('0x46')]=_0x3b8900;return _0x36f159;});}})[_0xa143('0x26')](respondWithFilteredResult(_0xe2dbc1,_0x2fed93))[_0xa143('0x50')](handleError(_0xe2dbc1,null));};function char(_0x2d6916){return _0xa143('0x61')===typeof _0x2d6916?String[_0xa143('0x62')][_0xa143('0x22')](null,arguments):_0x2d6916;}function needsEncapsulation(_0x3f4ad2){return!!_0x3f4ad2&&(_0x3f4ad2[_0xa143('0x63')]()[_0xa143('0x64')](char(0xd))>=0x0||_0x3f4ad2[_0xa143('0x63')]()['indexOf'](char(0xa))>=0x0||_0x3f4ad2['toString']()[_0xa143('0x64')](char(0x2c))>=0x0||_0x3f4ad2[_0xa143('0x63')]()[_0xa143('0x64')](char(0x22))>=0x0);}function encapsulate(_0x5555ac){var _0x2a3d88=char(0x22),_0x189cc7='\x5c'+char(0x22),_0x4c1c04=_0x5555ac[_0xa143('0x63')]()[_0xa143('0x65')](new RegExp(_0x2a3d88,'g'),_0x189cc7);return _0x2a3d88+_0x4c1c04+_0x2a3d88;}exports[_0xa143('0x66')]=function(_0x4b49c5,_0x2c35ab,_0x8b535){var _0x2f56b2,_0x251887;var _0x333447={'where':{'ProjectId':_0x4b49c5[_0xa143('0x48')]['id']}};if(_0x4b49c5[_0xa143('0x36')]['startTime']){_0x333447[_0xa143('0x3e')][_0xa143('0x67')]=JSON[_0xa143('0x68')](_0x4b49c5[_0xa143('0x36')][_0xa143('0x69')]);}return db[_0xa143('0x59')][_0xa143('0x45')](_0x333447)[_0xa143('0x26')](handleEntityNotFound(_0x2c35ab,null))['then'](function(_0x602403){if(_0x602403){_0x2f56b2=_0x602403;return db[_0xa143('0x6a')][_0xa143('0x45')]({'where':{'SessionId':{'$in':_[_0xa143('0x2e')](_0x2f56b2,'id')},'ProjectId':_0x4b49c5['params']['id']},'order':_0xa143('0x6b')});}})[_0xa143('0x26')](handleEntityNotFound(_0x2c35ab,null))[_0xa143('0x26')](function(_0x3c01ed){if(_0x3c01ed){_0x251887=_0x3c01ed;var _0x235f9b={};for(var _0x483e80=0x0,_0x6e9fd1=_0x251887[_0xa143('0x49')];_0x483e80<_0x6e9fd1;_0x483e80++){if(!_0x235f9b[_0xa143('0x3b')](_0x251887[_0x483e80][_0xa143('0x6c')])){_0x235f9b[_0x251887[_0x483e80][_0xa143('0x6c')]]=needsEncapsulation(_0x251887[_0x483e80][_0xa143('0x6d')])?encapsulate(_0x251887[_0x483e80][_0xa143('0x6d')]):_0x251887[_0x483e80][_0xa143('0x6d')];}}var _0x3a38ef=[],_0x1b0798={};for(var _0xfdd855=0x0,_0x15ea8c=_0x2f56b2[_0xa143('0x49')];_0xfdd855<_0x15ea8c;_0xfdd855++){_0x1b0798={'ProjectId':_0x4b49c5['params']['id'],'SessionId':_0x2f56b2[_0xfdd855]['id'],'StartTime':moment(_0x2f56b2[_0xfdd855][_0xa143('0x67')])[_0xa143('0x6e')](_0xa143('0x6f'))};for(var _0x2825ba=0x0,_0x398b76=_0x251887[_0xa143('0x49')];_0x2825ba<_0x398b76;_0x2825ba++){if(_0x251887[_0x2825ba][_0xa143('0x70')]==_0x2f56b2[_0xfdd855]['id']&&_0x235f9b[_0xa143('0x3b')](_0x251887[_0x2825ba][_0xa143('0x6c')])){_0x1b0798[_0x235f9b[_0x251887[_0x2825ba][_0xa143('0x6c')]]]=_0x251887[_0x2825ba][_0xa143('0x71')];}}for(var _0x4a0d09 in _0x235f9b){if(!_0x1b0798[_0xa143('0x3b')](_0x235f9b[_0x4a0d09])){_0x1b0798[_0x235f9b[_0x4a0d09]]=null;}}_0x3a38ef['push'](_0x1b0798);}return _0x3a38ef;}})[_0xa143('0x26')](function(_0x25b2fe){if(!_[_0xa143('0x72')](_0x25b2fe)){var _0x104678=toCsv(_0x25b2fe);var _0x282114=Date[_0xa143('0x73')]();fs[_0xa143('0x74')](util['format'](_0xa143('0x75'),_0x4b49c5['params']['id'],_0x282114),_0x104678);_0x2c35ab[_0xa143('0x76')](_0xa143('0x77'),'attachment;\x20filename='+util[_0xa143('0x6e')](_0xa143('0x78'),_0x4b49c5[_0xa143('0x48')]['id'],_0x282114));_0x2c35ab[_0xa143('0x76')](_0xa143('0x79'),_0xa143('0x7a'));return _0x2c35ab[_0xa143('0x7b')](util[_0xa143('0x6e')](_0xa143('0x75'),_0x4b49c5[_0xa143('0x48')]['id'],_0x282114));}else{return _0x2c35ab[_0xa143('0x1a')](0xcc);}})[_0xa143('0x50')](handleError(_0x2c35ab,null));}; \ No newline at end of file +var _0xf34f=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyProject','include','findAll','catch','show','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','order','rows','JscriptyAnswerReport','ProjectId','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3bf1d9,_0x45314a){var _0x36ea8d=function(_0x1942cb){while(--_0x1942cb){_0x3bf1d9['push'](_0x3bf1d9['shift']());}};_0x36ea8d(++_0x45314a);}(_0xf34f,0x64));var _0xff34=function(_0x29a9fd,_0x13376b){_0x29a9fd=_0x29a9fd-0x0;var _0x53cfd7=_0xf34f[_0x29a9fd];return _0x53cfd7;};'use strict';var emlformat=require(_0xff34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff34('0x2'));var moment=require('moment');var BPromise=require(_0xff34('0x3'));var Mustache=require(_0xff34('0x4'));var util=require(_0xff34('0x5'));var path=require('path');var sox=require(_0xff34('0x6'));var csv=require('to-csv');var ejs=require(_0xff34('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff34('0x8'));var squel=require('squel');var crypto=require(_0xff34('0x9'));var jsforce=require(_0xff34('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff34('0xb'));var Papa=require(_0xff34('0xc'));var Redis=require(_0xff34('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xff34('0xe'));var as=require(_0xff34('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff34('0x10'))(_0xff34('0x11'));var utils=require(_0xff34('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xff34('0x13'));var db=require(_0xff34('0x14'))['db'];function respondWithStatusCode(_0x2e3d0a,_0x3fa22f){_0x3fa22f=_0x3fa22f||0xcc;return function(_0x39ecac){if(_0x39ecac){return _0x2e3d0a[_0xff34('0x15')](_0x3fa22f);}return _0x2e3d0a[_0xff34('0x16')](_0x3fa22f)[_0xff34('0x17')]();};}function respondWithResult(_0x3b0921,_0x275871){_0x275871=_0x275871||0xc8;return function(_0x2fe6b1){if(_0x2fe6b1){return _0x3b0921[_0xff34('0x16')](_0x275871)[_0xff34('0x18')](_0x2fe6b1);}};}function respondWithFilteredResult(_0x3a184e,_0x3bfe1c){return function(_0x11aac2){if(_0x11aac2){var _0x23023f=typeof _0x3bfe1c[_0xff34('0x19')]===_0xff34('0x1a')&&typeof _0x3bfe1c[_0xff34('0x1b')]==='undefined';var _0x95a2b0=_0x11aac2['count'];var _0x2fe34c=_0x23023f?0x0:_0x3bfe1c['offset'];var _0x44260f=_0x23023f?_0x11aac2[_0xff34('0x1c')]:_0x3bfe1c['offset']+_0x3bfe1c['limit'];var _0x1a3a6d;if(_0x44260f>=_0x95a2b0){_0x44260f=_0x95a2b0;_0x1a3a6d=0xc8;}else{_0x1a3a6d=0xce;}_0x3a184e[_0xff34('0x16')](_0x1a3a6d);return _0x3a184e[_0xff34('0x1d')](_0xff34('0x1e'),_0x2fe34c+'-'+_0x44260f+'/'+_0x95a2b0)[_0xff34('0x18')](_0x11aac2);}return null;};}function patchUpdates(_0x26998e){return function(_0x3fb8a9){try{jsonpatch[_0xff34('0x1f')](_0x3fb8a9,_0x26998e,!![]);}catch(_0x2b0891){return BPromise[_0xff34('0x20')](_0x2b0891);}return _0x3fb8a9[_0xff34('0x21')]();};}function saveUpdates(_0x1c76f6,_0x25eb54){return function(_0x244e8f){if(_0x244e8f){return _0x244e8f[_0xff34('0x22')](_0x1c76f6)[_0xff34('0x23')](function(_0x2a988d){return _0x2a988d;});}return null;};}function removeEntity(_0xebe57c,_0x40f14e){return function(_0x1bbcff){if(_0x1bbcff){return _0x1bbcff[_0xff34('0x24')]()['then'](function(){var _0x17391d=_0x1bbcff[_0xff34('0x25')]({'plain':!![]});var _0x66df01=_0xff34('0x26');return db[_0xff34('0x27')]['destroy']({'where':{'type':_0x66df01,'resourceId':_0x17391d['id']}})['then'](function(){return _0x1bbcff;});})[_0xff34('0x23')](function(){_0xebe57c[_0xff34('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x284696,_0x119c88){return function(_0x206dc3){if(!_0x206dc3){_0x284696['sendStatus'](0x194);}return _0x206dc3;};}function handleError(_0x20ca49,_0x52629f){_0x52629f=_0x52629f||0x1f4;return function(_0x3939fa){logger[_0xff34('0x28')](_0x3939fa[_0xff34('0x29')]);if(_0x3939fa['name']){delete _0x3939fa[_0xff34('0x2a')];}_0x20ca49[_0xff34('0x16')](_0x52629f)[_0xff34('0x2b')](_0x3939fa);};}exports['index']=function(_0x2acdfc,_0x140a50){var _0x2294f1={},_0x22613a={},_0x1050de={'count':0x0,'rows':[]};var _0x212097=_['map'](db['JscriptyProject'][_0xff34('0x2c')],function(_0x58b12e){return{'name':_0x58b12e[_0xff34('0x2d')],'type':_0x58b12e[_0xff34('0x2e')]['key']};});_0x22613a[_0xff34('0x2f')]=_[_0xff34('0x30')](_0x212097,_0xff34('0x2a'));_0x22613a[_0xff34('0x31')]=_[_0xff34('0x32')](_0x2acdfc[_0xff34('0x31')]);_0x22613a[_0xff34('0x33')]=_[_0xff34('0x34')](_0x22613a[_0xff34('0x2f')],_0x22613a['query']);_0x2294f1[_0xff34('0x35')]=_['intersection'](_0x22613a[_0xff34('0x2f')],qs[_0xff34('0x36')](_0x2acdfc['query']['fields']));_0x2294f1[_0xff34('0x35')]=_0x2294f1[_0xff34('0x35')][_0xff34('0x37')]?_0x2294f1[_0xff34('0x35')]:_0x22613a[_0xff34('0x2f')];if(!_0x2acdfc['query'][_0xff34('0x38')](_0xff34('0x39'))){_0x2294f1['limit']=qs[_0xff34('0x1b')](_0x2acdfc[_0xff34('0x31')]['limit']);_0x2294f1[_0xff34('0x19')]=qs['offset'](_0x2acdfc[_0xff34('0x31')][_0xff34('0x19')]);}_0x2294f1['order']=qs[_0xff34('0x3a')](_0x2acdfc[_0xff34('0x31')][_0xff34('0x3a')]);_0x2294f1[_0xff34('0x3b')]=qs[_0xff34('0x33')](_[_0xff34('0x3c')](_0x2acdfc[_0xff34('0x31')],_0x22613a['filters']),_0x212097);if(_0x2acdfc['query'][_0xff34('0x3d')]){_0x2294f1[_0xff34('0x3b')]=_['merge'](_0x2294f1[_0xff34('0x3b')],{'$or':_[_0xff34('0x30')](_0x212097,function(_0x248e7e){if(_0x248e7e[_0xff34('0x2e')]!==_0xff34('0x3e')){var _0x12a4ff={};_0x12a4ff[_0x248e7e[_0xff34('0x2a')]]={'$like':'%'+_0x2acdfc[_0xff34('0x31')][_0xff34('0x3d')]+'%'};return _0x12a4ff;}})});}_0x2294f1=_[_0xff34('0x3f')]({},_0x2294f1,_0x2acdfc[_0xff34('0x40')]);var _0x329146={'where':_0x2294f1[_0xff34('0x3b')]};return db[_0xff34('0x41')][_0xff34('0x1c')](_0x329146)[_0xff34('0x23')](function(_0x5e33e2){_0x1050de[_0xff34('0x1c')]=_0x5e33e2;if(_0x2acdfc[_0xff34('0x31')]['includeAll']){_0x2294f1[_0xff34('0x42')]=[{'all':!![]}];}return db[_0xff34('0x41')][_0xff34('0x43')](_0x2294f1);})[_0xff34('0x23')](function(_0x107c58){_0x1050de['rows']=_0x107c58;return _0x1050de;})['then'](respondWithFilteredResult(_0x140a50,_0x2294f1))[_0xff34('0x44')](handleError(_0x140a50,null));};exports[_0xff34('0x45')]=function(_0x5a1971,_0xc5f15a){var _0x236f65={'raw':![],'where':{'id':_0x5a1971[_0xff34('0x46')]['id']}},_0x44cf97={};_0x44cf97[_0xff34('0x2f')]=_['keys'](db['JscriptyProject'][_0xff34('0x2c')]);_0x44cf97['query']=_[_0xff34('0x32')](_0x5a1971['query']);_0x44cf97[_0xff34('0x33')]=_['intersection'](_0x44cf97[_0xff34('0x2f')],_0x44cf97['query']);_0x236f65[_0xff34('0x35')]=_[_0xff34('0x34')](_0x44cf97['model'],qs[_0xff34('0x36')](_0x5a1971[_0xff34('0x31')][_0xff34('0x36')]));_0x236f65[_0xff34('0x35')]=_0x236f65[_0xff34('0x35')][_0xff34('0x37')]?_0x236f65[_0xff34('0x35')]:_0x44cf97['model'];if(_0x5a1971[_0xff34('0x31')]['includeAll']){_0x236f65['include']=[{'all':!![]}];}_0x236f65=_['merge']({},_0x236f65,_0x5a1971[_0xff34('0x40')]);return db['JscriptyProject'][_0xff34('0x47')](_0x236f65)[_0xff34('0x23')](handleEntityNotFound(_0xc5f15a,null))[_0xff34('0x23')](respondWithResult(_0xc5f15a,null))[_0xff34('0x44')](handleError(_0xc5f15a,null));};exports['create']=function(_0x4b63c6,_0x366f66){return db[_0xff34('0x41')][_0xff34('0x48')](_0x4b63c6['body'],{})['then'](function(_0x584368){var _0x1f5389=_0x4b63c6[_0xff34('0x49')][_0xff34('0x25')]({'plain':!![]});if(!_0x1f5389)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5389[_0xff34('0x4a')]==='user'){var _0x1fee82=_0x584368['get']({'plain':!![]});var _0x2adbb9=_0xff34('0x26');return db[_0xff34('0x4b')]['find']({'where':{'name':_0x2adbb9,'userProfileId':_0x1f5389[_0xff34('0x4c')]},'raw':!![]})['then'](function(_0x40b4db){if(_0x40b4db&&_0x40b4db[_0xff34('0x4d')]===0x0){return db['UserProfileResource'][_0xff34('0x48')]({'name':_0x1fee82[_0xff34('0x2a')],'resourceId':_0x1fee82['id'],'type':_0x40b4db[_0xff34('0x2a')],'sectionId':_0x40b4db['id']},{})['then'](function(){return _0x584368;});}else{return _0x584368;}})[_0xff34('0x44')](function(_0x1e1c3d){logger['error'](_0xff34('0x4e'),_0x1e1c3d);throw _0x1e1c3d;});}return _0x584368;})[_0xff34('0x23')](respondWithResult(_0x366f66,0xc9))[_0xff34('0x44')](handleError(_0x366f66,null));};exports['clone']=function(_0x43ff87,_0x5cb422){var _0x12a658={'where':{'id':_0x43ff87[_0xff34('0x46')]['id']}},_0x31216a={};_0x31216a[_0xff34('0x2f')]=_['keys'](db[_0xff34('0x41')][_0xff34('0x2c')]);_0x12a658[_0xff34('0x35')]=_[_0xff34('0x34')](_0x31216a['model'],qs[_0xff34('0x36')](_0x43ff87[_0xff34('0x31')][_0xff34('0x36')]));_0x12a658['attributes']=_0x12a658['attributes']['length']?_0x12a658[_0xff34('0x35')]:_0x31216a['model'];if(_0x43ff87['query'][_0xff34('0x4f')]){_0x12a658[_0xff34('0x42')]=[{'all':!![]}];}_0x12a658=_[_0xff34('0x3f')]({},_0x12a658,_0x43ff87[_0xff34('0x40')]);return db['JscriptyProject'][_0xff34('0x47')](_0x12a658)[_0xff34('0x23')](handleEntityNotFound(_0x5cb422,null))['then'](function(_0xe505a6){if(_0xe505a6){var _0x2005a1=_0xe505a6[_0xff34('0x25')]({'plain':!![]});_0x2005a1=qs[_0xff34('0x50')](_0x2005a1,['id',_0xff34('0x51'),_0xff34('0x52')]);_0x43ff87[_0xff34('0x53')]=_[_0xff34('0x50')](_0x43ff87[_0xff34('0x53')],['id',_0xff34('0x51'),_0xff34('0x52')]);return db[_0xff34('0x41')][_0xff34('0x48')](_[_0xff34('0x3f')](_0x2005a1,_0x43ff87[_0xff34('0x53')]),{'include':_0x43ff87[_0xff34('0x31')][_0xff34('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x7a92db){var _0x552dc5=_0x43ff87['user'][_0xff34('0x25')]({'plain':!![]});if(!_0x552dc5)throw new Error(_0xff34('0x54'));if(_0x552dc5['role']==='user'){var _0x5d3c1e=_0x7a92db[_0xff34('0x25')]({'plain':!![]});var _0xcdc5c1=_0xff34('0x26');return db[_0xff34('0x4b')]['find']({'where':{'name':_0xcdc5c1,'userProfileId':_0x552dc5[_0xff34('0x4c')]},'raw':!![]})['then'](function(_0x58ac7e){if(_0x58ac7e&&_0x58ac7e['autoAssociation']===0x0){return db[_0xff34('0x27')]['create']({'name':_0x5d3c1e[_0xff34('0x2a')],'resourceId':_0x5d3c1e['id'],'type':_0x58ac7e[_0xff34('0x2a')],'sectionId':_0x58ac7e['id']},{})[_0xff34('0x23')](function(){return _0x7a92db;});}else{return _0x7a92db;}})[_0xff34('0x44')](function(_0x2ed6ec){logger[_0xff34('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ed6ec);throw _0x2ed6ec;});}return _0x7a92db;});}})[_0xff34('0x23')](respondWithResult(_0x5cb422,0xc9))[_0xff34('0x44')](handleError(_0x5cb422,null));};exports[_0xff34('0x22')]=function(_0x4475a3,_0x447f51){if(_0x4475a3['body']['id']){delete _0x4475a3[_0xff34('0x53')]['id'];}return db[_0xff34('0x41')][_0xff34('0x47')]({'where':{'id':_0x4475a3['params']['id']}})[_0xff34('0x23')](handleEntityNotFound(_0x447f51,null))[_0xff34('0x23')](saveUpdates(_0x4475a3[_0xff34('0x53')],null))['then'](respondWithResult(_0x447f51,null))[_0xff34('0x44')](handleError(_0x447f51,null));};exports[_0xff34('0x24')]=function(_0x248629,_0x811dab){return db['JscriptyProject'][_0xff34('0x47')]({'where':{'id':_0x248629[_0xff34('0x46')]['id']}})[_0xff34('0x23')](handleEntityNotFound(_0x811dab,null))['then'](removeEntity(_0x811dab,null))[_0xff34('0x44')](handleError(_0x811dab,null));};exports[_0xff34('0x55')]=function(_0x422b27,_0x35a525,_0x4b9846){var _0x327418={'raw':!![],'where':{}};var _0x2c2d89={};var _0x42032={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xff34('0x56')]({'where':{'id':_0x422b27['params']['id']}})[_0xff34('0x23')](handleEntityNotFound(_0x35a525,null))[_0xff34('0x23')](function(_0x598900){if(_0x598900){_0x2c2d89[_0xff34('0x2f')]=_[_0xff34('0x32')](db[_0xff34('0x57')]['rawAttributes']);_0x2c2d89[_0xff34('0x31')]=_[_0xff34('0x32')](_0x422b27[_0xff34('0x31')]);_0x2c2d89[_0xff34('0x33')]=_[_0xff34('0x34')](_0x2c2d89[_0xff34('0x2f')],_0x2c2d89[_0xff34('0x31')]);_0x327418['attributes']=_['intersection'](_0x2c2d89[_0xff34('0x2f')],qs[_0xff34('0x36')](_0x422b27[_0xff34('0x31')][_0xff34('0x36')]));_0x327418[_0xff34('0x35')]=_0x327418[_0xff34('0x35')][_0xff34('0x37')]?_0x327418[_0xff34('0x35')]:_0x2c2d89[_0xff34('0x2f')];if(!_0x422b27['query'][_0xff34('0x38')](_0xff34('0x39'))){_0x327418[_0xff34('0x1b')]=qs[_0xff34('0x1b')](_0x422b27[_0xff34('0x31')][_0xff34('0x1b')]);_0x327418[_0xff34('0x19')]=qs[_0xff34('0x19')](_0x422b27[_0xff34('0x31')]['offset']);}_0x327418[_0xff34('0x58')]=qs[_0xff34('0x3a')](_0x422b27['query'][_0xff34('0x3a')]);_0x327418[_0xff34('0x3b')]=qs[_0xff34('0x33')](_[_0xff34('0x3c')](_0x422b27['query'],_0x2c2d89[_0xff34('0x33')]));_0x327418[_0xff34('0x3b')]['ProjectId']=_0x598900['id'];if(_0x422b27['query'][_0xff34('0x3d')]){_0x327418[_0xff34('0x3b')]=_['merge'](_0x327418['where'],{'$or':_[_0xff34('0x30')](_0x327418['attributes'],function(_0x3f345c){var _0x49faa3={};_0x49faa3[_0x3f345c]={'$like':'%'+_0x422b27[_0xff34('0x31')]['filter']+'%'};return _0x49faa3;})});}_0x327418=_[_0xff34('0x3f')]({},_0x327418,_0x422b27[_0xff34('0x40')]);return db[_0xff34('0x57')]['count']({'where':_0x327418[_0xff34('0x3b')]})[_0xff34('0x23')](function(_0x34e25d){_0x42032[_0xff34('0x1c')]=_0x34e25d;if(_0x422b27[_0xff34('0x31')]['includeAll']){_0x327418[_0xff34('0x42')]=[{'all':!![]}];}return db[_0xff34('0x57')]['findAll'](_0x327418);})[_0xff34('0x23')](function(_0x9a441b){_0x42032[_0xff34('0x59')]=_0x9a441b;return _0x42032;});}})[_0xff34('0x23')](respondWithFilteredResult(_0x35a525,_0x327418))['catch'](handleError(_0x35a525,null));};exports['getAnswers']=function(_0x371aaf,_0x275f83,_0x108ac6){var _0x193601={'raw':!![],'where':{}};var _0x2d7321={};var _0x37d922={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xff34('0x56')]({'where':{'id':_0x371aaf[_0xff34('0x46')]['id']}})[_0xff34('0x23')](handleEntityNotFound(_0x275f83,null))[_0xff34('0x23')](function(_0x20bd87){if(_0x20bd87){_0x2d7321['model']=_[_0xff34('0x32')](db[_0xff34('0x5a')][_0xff34('0x2c')]);_0x2d7321['query']=_['keys'](_0x371aaf[_0xff34('0x31')]);_0x2d7321[_0xff34('0x33')]=_[_0xff34('0x34')](_0x2d7321['model'],_0x2d7321[_0xff34('0x31')]);_0x193601['attributes']=_[_0xff34('0x34')](_0x2d7321['model'],qs['fields'](_0x371aaf[_0xff34('0x31')][_0xff34('0x36')]));_0x193601[_0xff34('0x35')]=_0x193601[_0xff34('0x35')][_0xff34('0x37')]?_0x193601[_0xff34('0x35')]:_0x2d7321[_0xff34('0x2f')];if(!_0x371aaf[_0xff34('0x31')]['hasOwnProperty'](_0xff34('0x39'))){_0x193601['limit']=qs[_0xff34('0x1b')](_0x371aaf[_0xff34('0x31')][_0xff34('0x1b')]);_0x193601[_0xff34('0x19')]=qs[_0xff34('0x19')](_0x371aaf['query'][_0xff34('0x19')]);}_0x193601[_0xff34('0x58')]=qs[_0xff34('0x3a')](_0x371aaf[_0xff34('0x31')][_0xff34('0x3a')]);_0x193601[_0xff34('0x3b')]=qs['filters'](_[_0xff34('0x3c')](_0x371aaf[_0xff34('0x31')],_0x2d7321[_0xff34('0x33')]));_0x193601[_0xff34('0x3b')][_0xff34('0x5b')]=_0x20bd87['id'];if(_0x371aaf[_0xff34('0x31')][_0xff34('0x3d')]){_0x193601[_0xff34('0x3b')]=_[_0xff34('0x3f')](_0x193601[_0xff34('0x3b')],{'$or':_[_0xff34('0x30')](_0x193601[_0xff34('0x35')],function(_0x458844){var _0x22cb69={};_0x22cb69[_0x458844]={'$like':'%'+_0x371aaf[_0xff34('0x31')][_0xff34('0x3d')]+'%'};return _0x22cb69;})});}_0x193601=_[_0xff34('0x3f')]({},_0x193601,_0x371aaf[_0xff34('0x40')]);return db['JscriptyAnswerReport'][_0xff34('0x1c')]({'where':_0x193601['where']})[_0xff34('0x23')](function(_0x197191){_0x37d922[_0xff34('0x1c')]=_0x197191;if(_0x371aaf[_0xff34('0x31')][_0xff34('0x4f')]){_0x193601['include']=[{'all':!![]}];}return db[_0xff34('0x5a')][_0xff34('0x43')](_0x193601);})[_0xff34('0x23')](function(_0x5b88b8){_0x37d922[_0xff34('0x59')]=_0x5b88b8;return _0x37d922;});}})[_0xff34('0x23')](respondWithFilteredResult(_0x275f83,_0x193601))[_0xff34('0x44')](handleError(_0x275f83,null));};function char(_0xc332a){return'number'===typeof _0xc332a?String[_0xff34('0x5c')][_0xff34('0x1f')](null,arguments):_0xc332a;}function needsEncapsulation(_0x397a14){return!!_0x397a14&&(_0x397a14[_0xff34('0x5d')]()[_0xff34('0x5e')](char(0xd))>=0x0||_0x397a14['toString']()[_0xff34('0x5e')](char(0xa))>=0x0||_0x397a14['toString']()['indexOf'](char(0x2c))>=0x0||_0x397a14[_0xff34('0x5d')]()[_0xff34('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x3f7fc1){var _0x39f23e=char(0x22),_0x72f30b='\x5c'+char(0x22),_0x17c4a8=_0x3f7fc1[_0xff34('0x5d')]()[_0xff34('0x5f')](new RegExp(_0x39f23e,'g'),_0x72f30b);return _0x39f23e+_0x17c4a8+_0x39f23e;}exports[_0xff34('0x60')]=function(_0x4774ea,_0x16e425,_0x407576){var _0x1a2a4f,_0x5a7715;var _0x5b7031={'where':{'ProjectId':_0x4774ea['params']['id']}};if(_0x4774ea[_0xff34('0x31')][_0xff34('0x61')]){_0x5b7031[_0xff34('0x3b')][_0xff34('0x62')]=JSON[_0xff34('0x63')](_0x4774ea[_0xff34('0x31')]['startTime']);}return db[_0xff34('0x57')]['findAll'](_0x5b7031)[_0xff34('0x23')](handleEntityNotFound(_0x16e425,null))[_0xff34('0x23')](function(_0x2d718a){if(_0x2d718a){_0x1a2a4f=_0x2d718a;return db[_0xff34('0x64')][_0xff34('0x43')]({'where':{'SessionId':{'$in':_[_0xff34('0x30')](_0x1a2a4f,'id')},'ProjectId':_0x4774ea['params']['id']},'order':'-createdAt'});}})[_0xff34('0x23')](handleEntityNotFound(_0x16e425,null))[_0xff34('0x23')](function(_0x2f4aa9){if(_0x2f4aa9){_0x5a7715=_0x2f4aa9;var _0x4eb7d3={};for(var _0x1abc83=0x0,_0x23b84a=_0x5a7715[_0xff34('0x37')];_0x1abc83<_0x23b84a;_0x1abc83++){if(!_0x4eb7d3[_0xff34('0x38')](_0x5a7715[_0x1abc83][_0xff34('0x65')])){_0x4eb7d3[_0x5a7715[_0x1abc83][_0xff34('0x65')]]=needsEncapsulation(_0x5a7715[_0x1abc83][_0xff34('0x66')])?encapsulate(_0x5a7715[_0x1abc83][_0xff34('0x66')]):_0x5a7715[_0x1abc83][_0xff34('0x66')];}}var _0x327520=[],_0xe7bea4={};for(var _0x238b98=0x0,_0x3a9ceb=_0x1a2a4f[_0xff34('0x37')];_0x238b98<_0x3a9ceb;_0x238b98++){_0xe7bea4={'ProjectId':_0x4774ea[_0xff34('0x46')]['id'],'SessionId':_0x1a2a4f[_0x238b98]['id'],'StartTime':moment(_0x1a2a4f[_0x238b98][_0xff34('0x62')])['format'](_0xff34('0x67'))};for(var _0x416316=0x0,_0x436c60=_0x5a7715[_0xff34('0x37')];_0x416316<_0x436c60;_0x416316++){if(_0x5a7715[_0x416316]['SessionId']==_0x1a2a4f[_0x238b98]['id']&&_0x4eb7d3[_0xff34('0x38')](_0x5a7715[_0x416316][_0xff34('0x65')])){_0xe7bea4[_0x4eb7d3[_0x5a7715[_0x416316][_0xff34('0x65')]]]=_0x5a7715[_0x416316]['answer'];}}for(var _0x3edcd8 in _0x4eb7d3){if(!_0xe7bea4['hasOwnProperty'](_0x4eb7d3[_0x3edcd8])){_0xe7bea4[_0x4eb7d3[_0x3edcd8]]=null;}}_0x327520['push'](_0xe7bea4);}return _0x327520;}})[_0xff34('0x23')](function(_0x2665b5){if(!_[_0xff34('0x68')](_0x2665b5)){var _0x30a6fc=toCsv(_0x2665b5);var _0x425f30=Date[_0xff34('0x69')]();fs[_0xff34('0x6a')](util['format'](_0xff34('0x6b'),_0x4774ea[_0xff34('0x46')]['id'],_0x425f30),_0x30a6fc);_0x16e425[_0xff34('0x6c')](_0xff34('0x6d'),'attachment;\x20filename='+util[_0xff34('0x6e')](_0xff34('0x6f'),_0x4774ea[_0xff34('0x46')]['id'],_0x425f30));_0x16e425[_0xff34('0x6c')](_0xff34('0x70'),_0xff34('0x71'));return _0x16e425[_0xff34('0x72')](util[_0xff34('0x6e')](_0xff34('0x6b'),_0x4774ea[_0xff34('0x46')]['id'],_0x425f30));}else{return _0x16e425[_0xff34('0x15')](0xcc);}})[_0xff34('0x44')](handleError(_0x16e425,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 0d0b972..b7662d8 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 _0x6c32=['jscripty_projects','lodash','../../config/logger','moment','request-promise','path','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0xd8cc18,_0x32e28f){var _0x3d327=function(_0xb7b384){while(--_0xb7b384){_0xd8cc18['push'](_0xd8cc18['shift']());}};_0x3d327(++_0x32e28f);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var logger=require(_0x26c3('0x1'))('api');var moment=require(_0x26c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x26c3('0x3'));var fs=require('fs');var path=require(_0x26c3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26c3('0x5'));module[_0x26c3('0x6')]=function(_0x421941,_0x402393){return _0x421941[_0x26c3('0x7')](_0x26c3('0x8'),attributes,{'tableName':_0x26c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39a9=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define'];(function(_0x201dba,_0x42b200){var _0x192294=function(_0x235f4d){while(--_0x235f4d){_0x201dba['push'](_0x201dba['shift']());}};_0x192294(++_0x42b200);}(_0x39a9,0x1d0));var _0x939a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x39a9[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x939a('0x0'));var util=require(_0x939a('0x1'));var logger=require(_0x939a('0x2'))(_0x939a('0x3'));var moment=require(_0x939a('0x4'));var BPromise=require(_0x939a('0x5'));var rp=require(_0x939a('0x6'));var fs=require('fs');var path=require(_0x939a('0x7'));var rimraf=require(_0x939a('0x8'));var config=require(_0x939a('0x9'));var attributes=require(_0x939a('0xa'));module['exports']=function(_0x5793fe,_0xed3974){return _0x5793fe[_0x939a('0xb')](_0x939a('0xc'),attributes,{'tableName':_0x939a('0xd'),'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 ee80209..7017f48 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 _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x36519b,_0x379b00){_0x36519b=_0x36519b-0x0;var _0x3f99f0=_0xac4a[_0x36519b];return _0x3f99f0;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xac4a,0x13f));var _0xaac4=function(_0x50ea03,_0x111d6d){_0x50ea03=_0x50ea03-0x0;var _0x442b60=_0xac4a[_0x50ea03];return _0x442b60;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index b29f538..fd51778 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 _0x3597=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','post','create','update','delete','exports'];(function(_0x582ba1,_0x2565ff){var _0x3a19ef=function(_0x458593){while(--_0x458593){_0x582ba1['push'](_0x582ba1['shift']());}};_0x3a19ef(++_0x2565ff);}(_0x3597,0x169));var _0x7359=function(_0x3f7aeb,_0x126246){_0x3f7aeb=_0x3f7aeb-0x0;var _0x4b454c=_0x3597[_0x3f7aeb];return _0x4b454c;};'use strict';var multer=require(_0x7359('0x0'));var util=require(_0x7359('0x1'));var path=require(_0x7359('0x2'));var timeout=require(_0x7359('0x3'));var express=require(_0x7359('0x4'));var router=express[_0x7359('0x5')]();var fs_extra=require(_0x7359('0x6'));var auth=require(_0x7359('0x7'));var interaction=require(_0x7359('0x8'));var config=require(_0x7359('0x9'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x7359('0xa')](),controller[_0x7359('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7359('0xc')]);router['get'](_0x7359('0xd'),auth[_0x7359('0xa')](),controller['show']);router[_0x7359('0xe')]('/',auth[_0x7359('0xa')](),controller[_0x7359('0xf')]);router['put'](_0x7359('0xd'),auth[_0x7359('0xa')](),controller[_0x7359('0x10')]);router[_0x7359('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7359('0x12')]=router; \ No newline at end of file +var _0x5cd6=['express','Router','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','destroy','util','path'];(function(_0x513aca,_0x42ec3b){var _0xa6994=function(_0x3a704c){while(--_0x3a704c){_0x513aca['push'](_0x513aca['shift']());}};_0xa6994(++_0x42ec3b);}(_0x5cd6,0x185));var _0x65cd=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x5cd6[_0x4394b6];return _0x360244;};'use strict';var multer=require('multer');var util=require(_0x65cd('0x0'));var path=require(_0x65cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x65cd('0x2'));var router=express[_0x65cd('0x3')]();var fs_extra=require(_0x65cd('0x4'));var auth=require(_0x65cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x65cd('0x6'));router['get']('/',auth[_0x65cd('0x7')](),controller['index']);router[_0x65cd('0x8')](_0x65cd('0x9'),auth[_0x65cd('0x7')](),controller['describe']);router[_0x65cd('0x8')](_0x65cd('0xa'),auth[_0x65cd('0x7')](),controller['show']);router[_0x65cd('0xb')]('/',auth[_0x65cd('0x7')](),controller[_0x65cd('0xc')]);router[_0x65cd('0xd')](_0x65cd('0xa'),auth[_0x65cd('0x7')](),controller[_0x65cd('0xe')]);router[_0x65cd('0xf')](_0x65cd('0xa'),auth['isAuthenticated'](),controller[_0x65cd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index fba7ee1..db27b1a 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x3662c1,_0x2253c2){_0x3662c1=_0x3662c1-0x0;var _0x5cc2bf=_0x7a54[_0x3662c1];return _0x5cc2bf;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x1ad110,_0x51b5ff){_0x1ad110=_0x1ad110-0x0;var _0x10b7a6=_0x7a54[_0x1ad110];return _0x10b7a6;};'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 4ea22ff..7b62c31 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 _0x330e=['crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','intersection','attributes','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','create','body','find','params','describe','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x449110,_0x50f8f1){var _0x4688e2=function(_0x159f1e){while(--_0x159f1e){_0x449110['push'](_0x449110['shift']());}};_0x4688e2(++_0x50f8f1);}(_0x330e,0x149));var _0xe330=function(_0x6558ce,_0x5cf6eb){_0x6558ce=_0x6558ce-0x0;var _0x30909e=_0x330e[_0x6558ce];return _0x30909e;};'use strict';var emlformat=require(_0xe330('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe330('0x1'));var BPromise=require(_0xe330('0x2'));var Mustache=require(_0xe330('0x3'));var util=require(_0xe330('0x4'));var path=require(_0xe330('0x5'));var sox=require(_0xe330('0x6'));var csv=require(_0xe330('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe330('0x8'));var _=require(_0xe330('0x9'));var squel=require(_0xe330('0xa'));var crypto=require(_0xe330('0xb'));var jsforce=require(_0xe330('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe330('0x7'));var querystring=require(_0xe330('0xd'));var Papa=require('papaparse');var Redis=require(_0xe330('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe330('0xf'));var hardwareService=require(_0xe330('0x10'));var logger=require(_0xe330('0x11'))('api');var utils=require(_0xe330('0x12'));var config=require(_0xe330('0x13'));var licenseUtil=require(_0xe330('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x95294f,_0x47010d){_0x47010d=_0x47010d||0xcc;return function(_0x269510){if(_0x269510){return _0x95294f['sendStatus'](_0x47010d);}return _0x95294f[_0xe330('0x15')](_0x47010d)[_0xe330('0x16')]();};}function respondWithResult(_0x2e5e3f,_0x3a6d72){_0x3a6d72=_0x3a6d72||0xc8;return function(_0x1ecb4e){if(_0x1ecb4e){return _0x2e5e3f[_0xe330('0x15')](_0x3a6d72)[_0xe330('0x17')](_0x1ecb4e);}};}function respondWithFilteredResult(_0x4b5e15,_0x5a2514){return function(_0x5e3078){if(_0x5e3078){var _0xc6d388=typeof _0x5a2514[_0xe330('0x18')]==='undefined'&&typeof _0x5a2514[_0xe330('0x19')]==='undefined';var _0x392030=_0x5e3078['count'];var _0xf58bdf=_0xc6d388?0x0:_0x5a2514[_0xe330('0x18')];var _0x5d7201=_0xc6d388?_0x5e3078[_0xe330('0x1a')]:_0x5a2514[_0xe330('0x18')]+_0x5a2514[_0xe330('0x19')];var _0xa4662f;if(_0x5d7201>=_0x392030){_0x5d7201=_0x392030;_0xa4662f=0xc8;}else{_0xa4662f=0xce;}_0x4b5e15[_0xe330('0x15')](_0xa4662f);return _0x4b5e15['set'](_0xe330('0x1b'),_0xf58bdf+'-'+_0x5d7201+'/'+_0x392030)[_0xe330('0x17')](_0x5e3078);}return null;};}function patchUpdates(_0x4b39a5){return function(_0x5a58ae){try{jsonpatch[_0xe330('0x1c')](_0x5a58ae,_0x4b39a5,!![]);}catch(_0x5d01b4){return BPromise[_0xe330('0x1d')](_0x5d01b4);}return _0x5a58ae[_0xe330('0x1e')]();};}function saveUpdates(_0x3c37e2,_0x3e7d61){return function(_0x15d996){if(_0x15d996){return _0x15d996[_0xe330('0x1f')](_0x3c37e2)['then'](function(_0x1aa35d){return _0x1aa35d;});}return null;};}function removeEntity(_0x356b60,_0x261523){return function(_0x646db2){if(_0x646db2){return _0x646db2[_0xe330('0x20')]()[_0xe330('0x21')](function(){_0x356b60[_0xe330('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5f5a,_0x956c14){return function(_0x26adbd){if(!_0x26adbd){_0x1b5f5a[_0xe330('0x22')](0x194);}return _0x26adbd;};}function handleError(_0x32cbb5,_0x12da6c){_0x12da6c=_0x12da6c||0x1f4;return function(_0x205e0){logger[_0xe330('0x23')](_0x205e0['stack']);if(_0x205e0[_0xe330('0x24')]){delete _0x205e0[_0xe330('0x24')];}_0x32cbb5[_0xe330('0x15')](_0x12da6c)['send'](_0x205e0);};}exports[_0xe330('0x25')]=function(_0x4792eb,_0x4d9d20){var _0x36407e={},_0x36de3d={},_0x17a4ab={'count':0x0,'rows':[]};var _0x14e6dd=_[_0xe330('0x26')](db[_0xe330('0x27')][_0xe330('0x28')],function(_0x188a44){return{'name':_0x188a44[_0xe330('0x29')],'type':_0x188a44[_0xe330('0x2a')]['key']};});_0x36de3d[_0xe330('0x2b')]=_[_0xe330('0x26')](_0x14e6dd,'name');_0x36de3d[_0xe330('0x2c')]=_['keys'](_0x4792eb['query']);_0x36de3d['filters']=_[_0xe330('0x2d')](_0x36de3d[_0xe330('0x2b')],_0x36de3d[_0xe330('0x2c')]);_0x36407e['attributes']=_[_0xe330('0x2d')](_0x36de3d[_0xe330('0x2b')],qs['fields'](_0x4792eb[_0xe330('0x2c')]['fields']));_0x36407e[_0xe330('0x2e')]=_0x36407e[_0xe330('0x2e')][_0xe330('0x2f')]?_0x36407e[_0xe330('0x2e')]:_0x36de3d[_0xe330('0x2b')];if(!_0x4792eb[_0xe330('0x2c')]['hasOwnProperty'](_0xe330('0x30'))){_0x36407e[_0xe330('0x19')]=qs[_0xe330('0x19')](_0x4792eb['query'][_0xe330('0x19')]);_0x36407e[_0xe330('0x18')]=qs['offset'](_0x4792eb['query'][_0xe330('0x18')]);}_0x36407e[_0xe330('0x31')]=qs[_0xe330('0x32')](_0x4792eb[_0xe330('0x2c')][_0xe330('0x32')]);_0x36407e[_0xe330('0x33')]=qs['filters'](_['pick'](_0x4792eb[_0xe330('0x2c')],_0x36de3d[_0xe330('0x34')]),_0x14e6dd);if(_0x4792eb[_0xe330('0x2c')][_0xe330('0x35')]){_0x36407e[_0xe330('0x33')]=_['merge'](_0x36407e[_0xe330('0x33')],{'$or':_[_0xe330('0x26')](_0x14e6dd,function(_0x26232b){if(_0x26232b[_0xe330('0x2a')]!==_0xe330('0x36')){var _0x25fc59={};_0x25fc59[_0x26232b[_0xe330('0x24')]]={'$like':'%'+_0x4792eb['query'][_0xe330('0x35')]+'%'};return _0x25fc59;}})});}_0x36407e=_[_0xe330('0x37')]({},_0x36407e,_0x4792eb[_0xe330('0x38')]);var _0x1c80dc={'where':_0x36407e[_0xe330('0x33')]};return db[_0xe330('0x27')][_0xe330('0x1a')](_0x1c80dc)[_0xe330('0x21')](function(_0x4f212d){_0x17a4ab[_0xe330('0x1a')]=_0x4f212d;if(_0x4792eb[_0xe330('0x2c')][_0xe330('0x39')]){_0x36407e[_0xe330('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x36407e);})['then'](function(_0x3c32ca){_0x17a4ab[_0xe330('0x3b')]=_0x3c32ca;return _0x17a4ab;})[_0xe330('0x21')](respondWithFilteredResult(_0x4d9d20,_0x36407e))[_0xe330('0x3c')](handleError(_0x4d9d20,null));};exports[_0xe330('0x3d')]=function(_0x75aa07,_0x212701){var _0x2791d1={'raw':!![],'where':{'id':_0x75aa07['params']['id']}},_0x4caef9={};_0x4caef9[_0xe330('0x2b')]=_['keys'](db[_0xe330('0x27')]['rawAttributes']);_0x4caef9[_0xe330('0x2c')]=_[_0xe330('0x3e')](_0x75aa07[_0xe330('0x2c')]);_0x4caef9[_0xe330('0x34')]=_[_0xe330('0x2d')](_0x4caef9['model'],_0x4caef9[_0xe330('0x2c')]);_0x2791d1['attributes']=_['intersection'](_0x4caef9[_0xe330('0x2b')],qs['fields'](_0x75aa07[_0xe330('0x2c')]['fields']));_0x2791d1[_0xe330('0x2e')]=_0x2791d1[_0xe330('0x2e')]['length']?_0x2791d1[_0xe330('0x2e')]:_0x4caef9[_0xe330('0x2b')];if(_0x75aa07[_0xe330('0x2c')][_0xe330('0x39')]){_0x2791d1[_0xe330('0x3a')]=[{'all':!![]}];}_0x2791d1=_['merge']({},_0x2791d1,_0x75aa07['options']);return db[_0xe330('0x27')]['find'](_0x2791d1)[_0xe330('0x21')](handleEntityNotFound(_0x212701,null))[_0xe330('0x21')](respondWithResult(_0x212701,null))[_0xe330('0x3c')](handleError(_0x212701,null));};exports[_0xe330('0x3f')]=function(_0x2406a8,_0xd6f1ab){return db[_0xe330('0x27')][_0xe330('0x3f')](_0x2406a8[_0xe330('0x40')],{})['then'](respondWithResult(_0xd6f1ab,0xc9))['catch'](handleError(_0xd6f1ab,null));};exports[_0xe330('0x1f')]=function(_0xee6843,_0xbc5724){if(_0xee6843[_0xe330('0x40')]['id']){delete _0xee6843['body']['id'];}return db['JscriptyQuestionReport'][_0xe330('0x41')]({'where':{'id':_0xee6843[_0xe330('0x42')]['id']}})[_0xe330('0x21')](handleEntityNotFound(_0xbc5724,null))[_0xe330('0x21')](saveUpdates(_0xee6843[_0xe330('0x40')],null))[_0xe330('0x21')](respondWithResult(_0xbc5724,null))[_0xe330('0x3c')](handleError(_0xbc5724,null));};exports[_0xe330('0x20')]=function(_0x1b3d63,_0x4bb7c6){return db[_0xe330('0x27')][_0xe330('0x41')]({'where':{'id':_0x1b3d63['params']['id']}})[_0xe330('0x21')](handleEntityNotFound(_0x4bb7c6,null))[_0xe330('0x21')](removeEntity(_0x4bb7c6,null))['catch'](handleError(_0x4bb7c6,null));};exports[_0xe330('0x43')]=function(_0x4b4fbd,_0x5e38af){return db[_0xe330('0x27')][_0xe330('0x43')]()['then'](respondWithResult(_0x5e38af,null))[_0xe330('0x3c')](handleError(_0x5e38af,null));}; \ No newline at end of file +var _0x767b=['destroy','then','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x767b,0x124));var _0xb767=function(_0x22708b,_0x2bee57){_0x22708b=_0x22708b-0x0;var _0x3e0055=_0x767b[_0x22708b];return _0x3e0055;};'use strict';var emlformat=require(_0xb767('0x0'));var rimraf=require(_0xb767('0x1'));var zipdir=require(_0xb767('0x2'));var jsonpatch=require(_0xb767('0x3'));var rp=require(_0xb767('0x4'));var moment=require(_0xb767('0x5'));var BPromise=require(_0xb767('0x6'));var Mustache=require(_0xb767('0x7'));var util=require(_0xb767('0x8'));var path=require(_0xb767('0x9'));var sox=require(_0xb767('0xa'));var csv=require(_0xb767('0xb'));var ejs=require(_0xb767('0xc'));var fs=require('fs');var fs_extra=require(_0xb767('0xd'));var _=require(_0xb767('0xe'));var squel=require('squel');var crypto=require(_0xb767('0xf'));var jsforce=require(_0xb767('0x10'));var deskjs=require(_0xb767('0x11'));var toCsv=require(_0xb767('0xb'));var querystring=require(_0xb767('0x12'));var Papa=require(_0xb767('0x13'));var Redis=require(_0xb767('0x14'));var authService=require(_0xb767('0x15'));var qs=require(_0xb767('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb767('0x17'));var logger=require(_0xb767('0x18'))(_0xb767('0x19'));var utils=require(_0xb767('0x1a'));var config=require(_0xb767('0x1b'));var licenseUtil=require(_0xb767('0x1c'));var db=require(_0xb767('0x1d'))['db'];function respondWithStatusCode(_0x3105db,_0x254fcb){_0x254fcb=_0x254fcb||0xcc;return function(_0x55b272){if(_0x55b272){return _0x3105db[_0xb767('0x1e')](_0x254fcb);}return _0x3105db[_0xb767('0x1f')](_0x254fcb)[_0xb767('0x20')]();};}function respondWithResult(_0x5c6cf2,_0x184a88){_0x184a88=_0x184a88||0xc8;return function(_0x1c9a46){if(_0x1c9a46){return _0x5c6cf2['status'](_0x184a88)[_0xb767('0x21')](_0x1c9a46);}};}function respondWithFilteredResult(_0x1ce465,_0x26fd98){return function(_0x4db75b){if(_0x4db75b){var _0x583b95=typeof _0x26fd98[_0xb767('0x22')]===_0xb767('0x23')&&typeof _0x26fd98[_0xb767('0x24')]===_0xb767('0x23');var _0x32a96e=_0x4db75b[_0xb767('0x25')];var _0x5e55fd=_0x583b95?0x0:_0x26fd98['offset'];var _0x3db6d6=_0x583b95?_0x4db75b[_0xb767('0x25')]:_0x26fd98[_0xb767('0x22')]+_0x26fd98[_0xb767('0x24')];var _0x3a9fa6;if(_0x3db6d6>=_0x32a96e){_0x3db6d6=_0x32a96e;_0x3a9fa6=0xc8;}else{_0x3a9fa6=0xce;}_0x1ce465['status'](_0x3a9fa6);return _0x1ce465[_0xb767('0x26')](_0xb767('0x27'),_0x5e55fd+'-'+_0x3db6d6+'/'+_0x32a96e)[_0xb767('0x21')](_0x4db75b);}return null;};}function patchUpdates(_0x3fcfb1){return function(_0x17dae6){try{jsonpatch[_0xb767('0x28')](_0x17dae6,_0x3fcfb1,!![]);}catch(_0x8f649d){return BPromise[_0xb767('0x29')](_0x8f649d);}return _0x17dae6[_0xb767('0x2a')]();};}function saveUpdates(_0x4309fd,_0xddd998){return function(_0x292b15){if(_0x292b15){return _0x292b15[_0xb767('0x2b')](_0x4309fd)['then'](function(_0x407f56){return _0x407f56;});}return null;};}function removeEntity(_0xe4cc8d,_0x340a0b){return function(_0x7eb532){if(_0x7eb532){return _0x7eb532[_0xb767('0x2c')]()[_0xb767('0x2d')](function(){_0xe4cc8d['status'](0xcc)[_0xb767('0x20')]();});}};}function handleEntityNotFound(_0x5aea52,_0x1968ab){return function(_0x4abe68){if(!_0x4abe68){_0x5aea52[_0xb767('0x1e')](0x194);}return _0x4abe68;};}function handleError(_0x2b4c5c,_0x2e2b57){_0x2e2b57=_0x2e2b57||0x1f4;return function(_0x149cc8){logger[_0xb767('0x2e')](_0x149cc8[_0xb767('0x2f')]);if(_0x149cc8[_0xb767('0x30')]){delete _0x149cc8[_0xb767('0x30')];}_0x2b4c5c[_0xb767('0x1f')](_0x2e2b57)['send'](_0x149cc8);};}exports[_0xb767('0x31')]=function(_0x17bb91,_0x5d0731){var _0x2f0ad2={},_0x472832={},_0x196688={'count':0x0,'rows':[]};var _0x31cc0a=_[_0xb767('0x32')](db[_0xb767('0x33')][_0xb767('0x34')],function(_0x3d13b4){return{'name':_0x3d13b4[_0xb767('0x35')],'type':_0x3d13b4[_0xb767('0x36')][_0xb767('0x37')]};});_0x472832[_0xb767('0x38')]=_[_0xb767('0x32')](_0x31cc0a,_0xb767('0x30'));_0x472832[_0xb767('0x39')]=_[_0xb767('0x3a')](_0x17bb91[_0xb767('0x39')]);_0x472832['filters']=_[_0xb767('0x3b')](_0x472832[_0xb767('0x38')],_0x472832['query']);_0x2f0ad2[_0xb767('0x3c')]=_['intersection'](_0x472832[_0xb767('0x38')],qs[_0xb767('0x3d')](_0x17bb91[_0xb767('0x39')][_0xb767('0x3d')]));_0x2f0ad2[_0xb767('0x3c')]=_0x2f0ad2['attributes'][_0xb767('0x3e')]?_0x2f0ad2[_0xb767('0x3c')]:_0x472832['model'];if(!_0x17bb91[_0xb767('0x39')][_0xb767('0x3f')](_0xb767('0x40'))){_0x2f0ad2[_0xb767('0x24')]=qs[_0xb767('0x24')](_0x17bb91[_0xb767('0x39')][_0xb767('0x24')]);_0x2f0ad2['offset']=qs[_0xb767('0x22')](_0x17bb91['query'][_0xb767('0x22')]);}_0x2f0ad2[_0xb767('0x41')]=qs['sort'](_0x17bb91[_0xb767('0x39')]['sort']);_0x2f0ad2[_0xb767('0x42')]=qs[_0xb767('0x43')](_[_0xb767('0x44')](_0x17bb91[_0xb767('0x39')],_0x472832[_0xb767('0x43')]),_0x31cc0a);if(_0x17bb91['query']['filter']){_0x2f0ad2['where']=_[_0xb767('0x45')](_0x2f0ad2[_0xb767('0x42')],{'$or':_[_0xb767('0x32')](_0x31cc0a,function(_0xf018de){if(_0xf018de[_0xb767('0x36')]!==_0xb767('0x46')){var _0x1ae81b={};_0x1ae81b[_0xf018de[_0xb767('0x30')]]={'$like':'%'+_0x17bb91[_0xb767('0x39')][_0xb767('0x47')]+'%'};return _0x1ae81b;}})});}_0x2f0ad2=_['merge']({},_0x2f0ad2,_0x17bb91[_0xb767('0x48')]);var _0x21b8c2={'where':_0x2f0ad2[_0xb767('0x42')]};return db[_0xb767('0x33')][_0xb767('0x25')](_0x21b8c2)[_0xb767('0x2d')](function(_0x1d3575){_0x196688['count']=_0x1d3575;if(_0x17bb91[_0xb767('0x39')][_0xb767('0x49')]){_0x2f0ad2[_0xb767('0x4a')]=[{'all':!![]}];}return db[_0xb767('0x33')][_0xb767('0x4b')](_0x2f0ad2);})[_0xb767('0x2d')](function(_0x1cf2ed){_0x196688[_0xb767('0x4c')]=_0x1cf2ed;return _0x196688;})['then'](respondWithFilteredResult(_0x5d0731,_0x2f0ad2))[_0xb767('0x4d')](handleError(_0x5d0731,null));};exports[_0xb767('0x4e')]=function(_0x326cf0,_0x27c88b){var _0x2e5e75={'raw':!![],'where':{'id':_0x326cf0[_0xb767('0x4f')]['id']}},_0x1db008={};_0x1db008[_0xb767('0x38')]=_['keys'](db[_0xb767('0x33')]['rawAttributes']);_0x1db008[_0xb767('0x39')]=_[_0xb767('0x3a')](_0x326cf0[_0xb767('0x39')]);_0x1db008[_0xb767('0x43')]=_[_0xb767('0x3b')](_0x1db008[_0xb767('0x38')],_0x1db008['query']);_0x2e5e75[_0xb767('0x3c')]=_[_0xb767('0x3b')](_0x1db008[_0xb767('0x38')],qs[_0xb767('0x3d')](_0x326cf0['query'][_0xb767('0x3d')]));_0x2e5e75[_0xb767('0x3c')]=_0x2e5e75['attributes']['length']?_0x2e5e75[_0xb767('0x3c')]:_0x1db008[_0xb767('0x38')];if(_0x326cf0[_0xb767('0x39')][_0xb767('0x49')]){_0x2e5e75[_0xb767('0x4a')]=[{'all':!![]}];}_0x2e5e75=_['merge']({},_0x2e5e75,_0x326cf0[_0xb767('0x48')]);return db['JscriptyQuestionReport'][_0xb767('0x50')](_0x2e5e75)['then'](handleEntityNotFound(_0x27c88b,null))['then'](respondWithResult(_0x27c88b,null))[_0xb767('0x4d')](handleError(_0x27c88b,null));};exports[_0xb767('0x51')]=function(_0x5d8f95,_0x45a2a1){return db[_0xb767('0x33')][_0xb767('0x51')](_0x5d8f95['body'],{})[_0xb767('0x2d')](respondWithResult(_0x45a2a1,0xc9))[_0xb767('0x4d')](handleError(_0x45a2a1,null));};exports[_0xb767('0x2b')]=function(_0x7dc21a,_0x39be48){if(_0x7dc21a[_0xb767('0x52')]['id']){delete _0x7dc21a[_0xb767('0x52')]['id'];}return db['JscriptyQuestionReport'][_0xb767('0x50')]({'where':{'id':_0x7dc21a[_0xb767('0x4f')]['id']}})[_0xb767('0x2d')](handleEntityNotFound(_0x39be48,null))[_0xb767('0x2d')](saveUpdates(_0x7dc21a[_0xb767('0x52')],null))[_0xb767('0x2d')](respondWithResult(_0x39be48,null))[_0xb767('0x4d')](handleError(_0x39be48,null));};exports[_0xb767('0x2c')]=function(_0x1f08a1,_0x2d03ab){return db[_0xb767('0x33')][_0xb767('0x50')]({'where':{'id':_0x1f08a1[_0xb767('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2d03ab,null))[_0xb767('0x2d')](removeEntity(_0x2d03ab,null))[_0xb767('0x4d')](handleError(_0x2d03ab,null));};exports['describe']=function(_0x1beeae,_0x4fab77){return db[_0xb767('0x33')][_0xb767('0x53')]()['then'](respondWithResult(_0x4fab77,null))['catch'](handleError(_0x4fab77,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 9c583f3..96bd9cb 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 _0x7c80=['JscriptyQuestionReport','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7c80,0x90));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07c8('0x0'));var util=require(_0x07c8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x07c8('0x2'));var rp=require(_0x07c8('0x3'));var fs=require('fs');var path=require(_0x07c8('0x4'));var rimraf=require(_0x07c8('0x5'));var config=require(_0x07c8('0x6'));var attributes=require(_0x07c8('0x7'));module[_0x07c8('0x8')]=function(_0x2b1025,_0x323e14){return _0x2b1025[_0x07c8('0x9')](_0x07c8('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa77b=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1dd325,_0x2c3332){var _0x20cd46=function(_0x324b09){while(--_0x324b09){_0x1dd325['push'](_0x1dd325['shift']());}};_0x20cd46(++_0x2c3332);}(_0xa77b,0x1c2));var _0xba77=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0xa77b[_0x4e55a9];return _0x4a9b67;};'use strict';var _=require(_0xba77('0x0'));var util=require(_0xba77('0x1'));var logger=require(_0xba77('0x2'))(_0xba77('0x3'));var moment=require(_0xba77('0x4'));var BPromise=require('bluebird');var rp=require(_0xba77('0x5'));var fs=require('fs');var path=require(_0xba77('0x6'));var rimraf=require(_0xba77('0x7'));var config=require('../../config/environment');var attributes=require(_0xba77('0x8'));module[_0xba77('0x9')]=function(_0x30be85,_0x411252){return _0x30be85[_0xba77('0xa')](_0xba77('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 135fd6b..bd3abae 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 _0x97c5=['error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x221bfa,_0xb40d8){var _0x152ad4=function(_0x5bf433){while(--_0x5bf433){_0x221bfa['push'](_0x221bfa['shift']());}};_0x152ad4(++_0xb40d8);}(_0x97c5,0x96));var _0x597c=function(_0xe38b41,_0x2c780d){_0xe38b41=_0xe38b41-0x0;var _0x163a83=_0x97c5[_0xe38b41];return _0x163a83;};'use strict';var _=require('lodash');var util=require(_0x597c('0x0'));var moment=require(_0x597c('0x1'));var BPromise=require(_0x597c('0x2'));var rs=require(_0x597c('0x3'));var fs=require('fs');var Redis=require(_0x597c('0x4'));var db=require(_0x597c('0x5'))['db'];var utils=require(_0x597c('0x6'));var logger=require(_0x597c('0x7'))(_0x597c('0x8'));var config=require(_0x597c('0x9'));var jayson=require(_0x597c('0xa'));var client=jayson['client'][_0x597c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6780c8,_0x2eef71,_0x34a9d0){return new BPromise(function(_0x451e74,_0x5603aa){return client['request'](_0x6780c8,_0x34a9d0)[_0x597c('0xc')](function(_0x4bde5c){logger[_0x597c('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2eef71,_0x597c('0xe'));logger[_0x597c('0xf')](_0x597c('0x10'),_0x2eef71,_0x597c('0xe'),JSON[_0x597c('0x11')](_0x4bde5c));if(_0x4bde5c[_0x597c('0x12')]){if(_0x4bde5c['error'][_0x597c('0x13')]===0x1f4){logger[_0x597c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2eef71,_0x4bde5c['error'][_0x597c('0x14')]);return _0x5603aa(_0x4bde5c[_0x597c('0x12')][_0x597c('0x14')]);}logger['error'](_0x597c('0x15'),_0x2eef71,_0x4bde5c[_0x597c('0x12')][_0x597c('0x14')]);return _0x451e74(_0x4bde5c[_0x597c('0x12')][_0x597c('0x14')]);}else{logger['info'](_0x597c('0x15'),_0x2eef71,_0x597c('0xe'));_0x451e74(_0x4bde5c[_0x597c('0x16')][_0x597c('0x14')]);}})[_0x597c('0x17')](function(_0x5a80f1){logger[_0x597c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2eef71,_0x5a80f1);_0x5603aa(_0x5a80f1);});});} \ No newline at end of file +var _0x73d0=['jayson/promise','http','request','then','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x47677f,_0x28c987){var _0xde4698=function(_0x459d60){while(--_0x459d60){_0x47677f['push'](_0x47677f['shift']());}};_0xde4698(++_0x28c987);}(_0x73d0,0x75));var _0x073d=function(_0x3ab38b,_0x5de905){_0x3ab38b=_0x3ab38b-0x0;var _0x50461b=_0x73d0[_0x3ab38b];return _0x50461b;};'use strict';var _=require(_0x073d('0x0'));var util=require(_0x073d('0x1'));var moment=require('moment');var BPromise=require(_0x073d('0x2'));var rs=require(_0x073d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x073d('0x4'))['db'];var utils=require(_0x073d('0x5'));var logger=require(_0x073d('0x6'))(_0x073d('0x7'));var config=require(_0x073d('0x8'));var jayson=require(_0x073d('0x9'));var client=jayson['client'][_0x073d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c049e,_0x1752d2,_0x229bfd){return new BPromise(function(_0xab5321,_0x5c3bb0){return client[_0x073d('0xb')](_0x3c049e,_0x229bfd)[_0x073d('0xc')](function(_0x5c9dc7){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1752d2,_0x073d('0xd'));logger['debug'](_0x073d('0xe'),_0x1752d2,_0x073d('0xd'),JSON['stringify'](_0x5c9dc7));if(_0x5c9dc7[_0x073d('0xf')]){if(_0x5c9dc7[_0x073d('0xf')]['code']===0x1f4){logger[_0x073d('0xf')](_0x073d('0x10'),_0x1752d2,_0x5c9dc7[_0x073d('0xf')][_0x073d('0x11')]);return _0x5c3bb0(_0x5c9dc7[_0x073d('0xf')][_0x073d('0x11')]);}logger[_0x073d('0xf')](_0x073d('0x10'),_0x1752d2,_0x5c9dc7[_0x073d('0xf')][_0x073d('0x11')]);return _0xab5321(_0x5c9dc7[_0x073d('0xf')]['message']);}else{logger[_0x073d('0x12')](_0x073d('0x10'),_0x1752d2,_0x073d('0xd'));_0xab5321(_0x5c9dc7[_0x073d('0x13')][_0x073d('0x11')]);}})[_0x073d('0x14')](function(_0x178335){logger['error'](_0x073d('0x10'),_0x1752d2,_0x178335);_0x5c3bb0(_0x178335);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 58ef418..7dbd09d 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 _0x50fd=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put'];(function(_0x3e685d,_0xc69b0){var _0x340d60=function(_0x49f52a){while(--_0x49f52a){_0x3e685d['push'](_0x3e685d['shift']());}};_0x340d60(++_0xc69b0);}(_0x50fd,0xfe));var _0xd50f=function(_0x3f6125,_0x323bbf){_0x3f6125=_0x3f6125-0x0;var _0x3b1772=_0x50fd[_0x3f6125];return _0x3b1772;};'use strict';var multer=require('multer');var util=require(_0xd50f('0x0'));var path=require(_0xd50f('0x1'));var timeout=require(_0xd50f('0x2'));var express=require(_0xd50f('0x3'));var router=express[_0xd50f('0x4')]();var fs_extra=require(_0xd50f('0x5'));var auth=require(_0xd50f('0x6'));var interaction=require(_0xd50f('0x7'));var config=require(_0xd50f('0x8'));var controller=require(_0xd50f('0x9'));router[_0xd50f('0xa')]('/',auth[_0xd50f('0xb')](),controller[_0xd50f('0xc')]);router[_0xd50f('0xa')](_0xd50f('0xd'),auth['isAuthenticated'](),controller[_0xd50f('0xe')]);router[_0xd50f('0xa')](_0xd50f('0xf'),auth[_0xd50f('0xb')](),controller[_0xd50f('0x10')]);router[_0xd50f('0xa')](_0xd50f('0x11'),auth['isAuthenticated'](),controller[_0xd50f('0x12')]);router['post']('/',auth[_0xd50f('0xb')](),controller[_0xd50f('0x13')]);router[_0xd50f('0x14')]('/:id',auth[_0xd50f('0xb')](),controller[_0xd50f('0x15')]);router[_0xd50f('0x16')](_0xd50f('0xf'),auth[_0xd50f('0xb')](),controller[_0xd50f('0x17')]);module[_0xd50f('0x18')]=router; \ No newline at end of file +var _0x7481=['describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1a2257,_0x2e70c2){var _0x30e9d5=function(_0x232378){while(--_0x232378){_0x1a2257['push'](_0x1a2257['shift']());}};_0x30e9d5(++_0x2e70c2);}(_0x7481,0x15c));var _0x1748=function(_0x5a2bd6,_0x4bdd9a){_0x5a2bd6=_0x5a2bd6-0x0;var _0x32ab96=_0x7481[_0x5a2bd6];return _0x32ab96;};'use strict';var multer=require(_0x1748('0x0'));var util=require(_0x1748('0x1'));var path=require('path');var timeout=require(_0x1748('0x2'));var express=require(_0x1748('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1748('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1748('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x1748('0x6')]('/',auth[_0x1748('0x7')](),controller[_0x1748('0x8')]);router[_0x1748('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x1748('0x9')]);router[_0x1748('0x6')](_0x1748('0xa'),auth['isAuthenticated'](),controller[_0x1748('0xb')]);router[_0x1748('0x6')](_0x1748('0xc'),auth[_0x1748('0x7')](),controller[_0x1748('0xd')]);router[_0x1748('0xe')]('/',auth[_0x1748('0x7')](),controller[_0x1748('0xf')]);router[_0x1748('0x10')](_0x1748('0xa'),auth[_0x1748('0x7')](),controller[_0x1748('0x11')]);router[_0x1748('0x12')](_0x1748('0xa'),auth[_0x1748('0x7')](),controller[_0x1748('0x13')]);module[_0x1748('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 32a0bcc..fb52349 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 _0x27eb=['STRING','moment','sequelize','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x27eb,0xd0));var _0xb27e=function(_0x148f88,_0x318266){_0x148f88=_0x148f88-0x0;var _0x112d20=_0x27eb[_0x148f88];return _0x112d20;};'use strict';var moment=require(_0xb27e('0x0'));var Sequelize=require(_0xb27e('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2f685b){this[_0xb27e('0x2')](_0xb27e('0x3'),_0x2f685b);this['setDataValue'](_0xb27e('0x4'),moment()[_0xb27e('0x5')](_0xb27e('0x6')));}},'endtime':{'type':Sequelize[_0xb27e('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xb27e('0x8')]},'queue':{'type':Sequelize[_0xb27e('0x8')]},'uniqueid':{'type':Sequelize[_0xb27e('0x8')]},'calleridname':{'type':Sequelize[_0xb27e('0x8')]},'calleridnum':{'type':Sequelize[_0xb27e('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9d87=['DATE','setDataValue','starttime','endtime','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x4d747f,_0x45a74a){var _0x2ac7da=function(_0x49b466){while(--_0x49b466){_0x4d747f['push'](_0x4d747f['shift']());}};_0x2ac7da(++_0x45a74a);}(_0x9d87,0x102));var _0x79d8=function(_0x54bd2b,_0x4f9695){_0x54bd2b=_0x54bd2b-0x0;var _0x50676e=_0x9d87[_0x54bd2b];return _0x50676e;};'use strict';var moment=require(_0x79d8('0x0'));var Sequelize=require(_0x79d8('0x1'));module[_0x79d8('0x2')]={'starttime':{'type':Sequelize[_0x79d8('0x3')],'set':function(_0x9c152f){this[_0x79d8('0x4')](_0x79d8('0x5'),_0x9c152f);this[_0x79d8('0x4')](_0x79d8('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x79d8('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x79d8('0x7')]},'queue':{'type':Sequelize[_0x79d8('0x7')]},'uniqueid':{'type':Sequelize[_0x79d8('0x7')]},'calleridname':{'type':Sequelize[_0x79d8('0x7')]},'calleridnum':{'type':Sequelize[_0x79d8('0x7')]},'completed':{'type':Sequelize[_0x79d8('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index fa41e81..7921ae9 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 _0xd8f3=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','rows','catch','rawAttributes','includeAll','include','find','create','body','describe','findOne','params','JscriptyQuestionReport','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','name','send','index','map','JscriptySessionReport','type','key','model','query','keys','intersection','fields'];(function(_0x568f2f,_0x515440){var _0x1ff8c8=function(_0x1678f5){while(--_0x1678f5){_0x568f2f['push'](_0x568f2f['shift']());}};_0x1ff8c8(++_0x515440);}(_0xd8f3,0x141));var _0x3d8f=function(_0x255458,_0xf097f0){_0x255458=_0x255458-0x0;var _0x45bb37=_0xd8f3[_0x255458];return _0x45bb37;};'use strict';var emlformat=require(_0x3d8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d8f('0x1'));var jsonpatch=require(_0x3d8f('0x2'));var rp=require(_0x3d8f('0x3'));var moment=require(_0x3d8f('0x4'));var BPromise=require(_0x3d8f('0x5'));var Mustache=require('mustache');var util=require(_0x3d8f('0x6'));var path=require(_0x3d8f('0x7'));var sox=require('sox');var csv=require(_0x3d8f('0x8'));var ejs=require(_0x3d8f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d8f('0xa'));var jsforce=require(_0x3d8f('0xb'));var deskjs=require(_0x3d8f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3d8f('0xd'));var Redis=require(_0x3d8f('0xe'));var authService=require(_0x3d8f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d8f('0x10'));var hardwareService=require(_0x3d8f('0x11'));var logger=require('../../config/logger')(_0x3d8f('0x12'));var utils=require(_0x3d8f('0x13'));var config=require(_0x3d8f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d8f('0x15'))['db'];function respondWithStatusCode(_0x467191,_0x3c3070){_0x3c3070=_0x3c3070||0xcc;return function(_0x3f6517){if(_0x3f6517){return _0x467191[_0x3d8f('0x16')](_0x3c3070);}return _0x467191[_0x3d8f('0x17')](_0x3c3070)['end']();};}function respondWithResult(_0x4c84d4,_0x23aa4d){_0x23aa4d=_0x23aa4d||0xc8;return function(_0x1f01f8){if(_0x1f01f8){return _0x4c84d4['status'](_0x23aa4d)[_0x3d8f('0x18')](_0x1f01f8);}};}function respondWithFilteredResult(_0x4564de,_0x139297){return function(_0x290b68){if(_0x290b68){var _0x4bed63=typeof _0x139297[_0x3d8f('0x19')]===_0x3d8f('0x1a')&&typeof _0x139297[_0x3d8f('0x1b')]===_0x3d8f('0x1a');var _0x30fe03=_0x290b68[_0x3d8f('0x1c')];var _0x328bd5=_0x4bed63?0x0:_0x139297['offset'];var _0xf6bdac=_0x4bed63?_0x290b68['count']:_0x139297[_0x3d8f('0x19')]+_0x139297[_0x3d8f('0x1b')];var _0x3a20dc;if(_0xf6bdac>=_0x30fe03){_0xf6bdac=_0x30fe03;_0x3a20dc=0xc8;}else{_0x3a20dc=0xce;}_0x4564de[_0x3d8f('0x17')](_0x3a20dc);return _0x4564de['set'](_0x3d8f('0x1d'),_0x328bd5+'-'+_0xf6bdac+'/'+_0x30fe03)[_0x3d8f('0x18')](_0x290b68);}return null;};}function patchUpdates(_0x41ea6c){return function(_0x58a777){try{jsonpatch[_0x3d8f('0x1e')](_0x58a777,_0x41ea6c,!![]);}catch(_0x302fd7){return BPromise[_0x3d8f('0x1f')](_0x302fd7);}return _0x58a777[_0x3d8f('0x20')]();};}function saveUpdates(_0x1afecb,_0x718d8e){return function(_0x1e51b1){if(_0x1e51b1){return _0x1e51b1[_0x3d8f('0x21')](_0x1afecb)['then'](function(_0x235030){return _0x235030;});}return null;};}function removeEntity(_0x22e024,_0x1ef9d6){return function(_0x50d172){if(_0x50d172){return _0x50d172[_0x3d8f('0x22')]()[_0x3d8f('0x23')](function(){_0x22e024[_0x3d8f('0x17')](0xcc)[_0x3d8f('0x24')]();});}};}function handleEntityNotFound(_0x5d3ccf,_0x57e7fb){return function(_0x1c926d){if(!_0x1c926d){_0x5d3ccf[_0x3d8f('0x16')](0x194);}return _0x1c926d;};}function handleError(_0x3d1355,_0x33b690){_0x33b690=_0x33b690||0x1f4;return function(_0x367552){logger['error'](_0x367552['stack']);if(_0x367552[_0x3d8f('0x25')]){delete _0x367552[_0x3d8f('0x25')];}_0x3d1355[_0x3d8f('0x17')](_0x33b690)[_0x3d8f('0x26')](_0x367552);};}exports[_0x3d8f('0x27')]=function(_0x42f064,_0x41f011){var _0x52c3d2={},_0x34436d={},_0x5e396d={'count':0x0,'rows':[]};var _0x5cfec4=_[_0x3d8f('0x28')](db[_0x3d8f('0x29')]['rawAttributes'],function(_0x1a58d9){return{'name':_0x1a58d9['fieldName'],'type':_0x1a58d9[_0x3d8f('0x2a')][_0x3d8f('0x2b')]};});_0x34436d[_0x3d8f('0x2c')]=_[_0x3d8f('0x28')](_0x5cfec4,_0x3d8f('0x25'));_0x34436d[_0x3d8f('0x2d')]=_[_0x3d8f('0x2e')](_0x42f064['query']);_0x34436d['filters']=_['intersection'](_0x34436d['model'],_0x34436d[_0x3d8f('0x2d')]);_0x52c3d2['attributes']=_[_0x3d8f('0x2f')](_0x34436d['model'],qs[_0x3d8f('0x30')](_0x42f064[_0x3d8f('0x2d')][_0x3d8f('0x30')]));_0x52c3d2[_0x3d8f('0x31')]=_0x52c3d2['attributes'][_0x3d8f('0x32')]?_0x52c3d2[_0x3d8f('0x31')]:_0x34436d[_0x3d8f('0x2c')];if(!_0x42f064['query'][_0x3d8f('0x33')](_0x3d8f('0x34'))){_0x52c3d2[_0x3d8f('0x1b')]=qs['limit'](_0x42f064[_0x3d8f('0x2d')][_0x3d8f('0x1b')]);_0x52c3d2['offset']=qs[_0x3d8f('0x19')](_0x42f064[_0x3d8f('0x2d')][_0x3d8f('0x19')]);}_0x52c3d2[_0x3d8f('0x35')]=qs[_0x3d8f('0x36')](_0x42f064[_0x3d8f('0x2d')][_0x3d8f('0x36')]);_0x52c3d2[_0x3d8f('0x37')]=qs['filters'](_[_0x3d8f('0x38')](_0x42f064[_0x3d8f('0x2d')],_0x34436d[_0x3d8f('0x39')]),_0x5cfec4);if(_0x42f064['query'][_0x3d8f('0x3a')]){_0x52c3d2[_0x3d8f('0x37')]=_[_0x3d8f('0x3b')](_0x52c3d2[_0x3d8f('0x37')],{'$or':_[_0x3d8f('0x28')](_0x5cfec4,function(_0x7e84e){if(_0x7e84e[_0x3d8f('0x2a')]!=='VIRTUAL'){var _0x58f9e2={};_0x58f9e2[_0x7e84e[_0x3d8f('0x25')]]={'$like':'%'+_0x42f064['query']['filter']+'%'};return _0x58f9e2;}})});}_0x52c3d2=_[_0x3d8f('0x3b')]({},_0x52c3d2,_0x42f064[_0x3d8f('0x3c')]);var _0x10b659={'where':_0x52c3d2['where']};return db[_0x3d8f('0x29')][_0x3d8f('0x1c')](_0x10b659)[_0x3d8f('0x23')](function(_0x11133c){_0x5e396d[_0x3d8f('0x1c')]=_0x11133c;if(_0x42f064['query']['includeAll']){_0x52c3d2['include']=[{'all':!![]}];}return db[_0x3d8f('0x29')]['findAll'](_0x52c3d2);})['then'](function(_0x3e0fef){_0x5e396d[_0x3d8f('0x3d')]=_0x3e0fef;return _0x5e396d;})['then'](respondWithFilteredResult(_0x41f011,_0x52c3d2))[_0x3d8f('0x3e')](handleError(_0x41f011,null));};exports['show']=function(_0x2bc705,_0x3858c5){var _0x4a30ca={'raw':!![],'where':{'id':_0x2bc705['params']['id']}},_0x4196c6={};_0x4196c6['model']=_[_0x3d8f('0x2e')](db['JscriptySessionReport'][_0x3d8f('0x3f')]);_0x4196c6[_0x3d8f('0x2d')]=_['keys'](_0x2bc705[_0x3d8f('0x2d')]);_0x4196c6[_0x3d8f('0x39')]=_[_0x3d8f('0x2f')](_0x4196c6[_0x3d8f('0x2c')],_0x4196c6[_0x3d8f('0x2d')]);_0x4a30ca[_0x3d8f('0x31')]=_[_0x3d8f('0x2f')](_0x4196c6[_0x3d8f('0x2c')],qs['fields'](_0x2bc705['query']['fields']));_0x4a30ca[_0x3d8f('0x31')]=_0x4a30ca[_0x3d8f('0x31')]['length']?_0x4a30ca[_0x3d8f('0x31')]:_0x4196c6[_0x3d8f('0x2c')];if(_0x2bc705[_0x3d8f('0x2d')][_0x3d8f('0x40')]){_0x4a30ca[_0x3d8f('0x41')]=[{'all':!![]}];}_0x4a30ca=_['merge']({},_0x4a30ca,_0x2bc705[_0x3d8f('0x3c')]);return db[_0x3d8f('0x29')][_0x3d8f('0x42')](_0x4a30ca)[_0x3d8f('0x23')](handleEntityNotFound(_0x3858c5,null))[_0x3d8f('0x23')](respondWithResult(_0x3858c5,null))['catch'](handleError(_0x3858c5,null));};exports[_0x3d8f('0x43')]=function(_0x20c314,_0x4fdec5){return db[_0x3d8f('0x29')][_0x3d8f('0x43')](_0x20c314['body'],{})[_0x3d8f('0x23')](respondWithResult(_0x4fdec5,0xc9))[_0x3d8f('0x3e')](handleError(_0x4fdec5,null));};exports[_0x3d8f('0x21')]=function(_0x19b9b7,_0x2176f1){if(_0x19b9b7['body']['id']){delete _0x19b9b7[_0x3d8f('0x44')]['id'];}return db[_0x3d8f('0x29')][_0x3d8f('0x42')]({'where':{'id':_0x19b9b7['params']['id']}})[_0x3d8f('0x23')](handleEntityNotFound(_0x2176f1,null))[_0x3d8f('0x23')](saveUpdates(_0x19b9b7[_0x3d8f('0x44')],null))[_0x3d8f('0x23')](respondWithResult(_0x2176f1,null))[_0x3d8f('0x3e')](handleError(_0x2176f1,null));};exports[_0x3d8f('0x22')]=function(_0x1723e5,_0x4c22ce){return db[_0x3d8f('0x29')][_0x3d8f('0x42')]({'where':{'id':_0x1723e5['params']['id']}})['then'](handleEntityNotFound(_0x4c22ce,null))[_0x3d8f('0x23')](removeEntity(_0x4c22ce,null))[_0x3d8f('0x3e')](handleError(_0x4c22ce,null));};exports['describe']=function(_0x2a508d,_0x4d4bce){return db[_0x3d8f('0x29')][_0x3d8f('0x45')]()['then'](respondWithResult(_0x4d4bce,null))[_0x3d8f('0x3e')](handleError(_0x4d4bce,null));};exports['getQuestions']=function(_0x5d2133,_0x3b6908,_0x3ace4d){var _0x2840a3={'raw':!![],'where':{}};var _0x41aaf6={};var _0x489f15={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3d8f('0x46')]({'where':{'id':_0x5d2133[_0x3d8f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b6908,null))['then'](function(_0xc1520e){if(_0xc1520e){_0x41aaf6[_0x3d8f('0x2c')]=_[_0x3d8f('0x2e')](db['JscriptyQuestionReport'][_0x3d8f('0x3f')]);_0x41aaf6[_0x3d8f('0x2d')]=_[_0x3d8f('0x2e')](_0x5d2133[_0x3d8f('0x2d')]);_0x41aaf6['filters']=_[_0x3d8f('0x2f')](_0x41aaf6[_0x3d8f('0x2c')],_0x41aaf6[_0x3d8f('0x2d')]);_0x2840a3[_0x3d8f('0x31')]=_[_0x3d8f('0x2f')](_0x41aaf6[_0x3d8f('0x2c')],qs[_0x3d8f('0x30')](_0x5d2133[_0x3d8f('0x2d')]['fields']));_0x2840a3[_0x3d8f('0x31')]=_0x2840a3[_0x3d8f('0x31')][_0x3d8f('0x32')]?_0x2840a3[_0x3d8f('0x31')]:_0x41aaf6['model'];if(!_0x5d2133[_0x3d8f('0x2d')][_0x3d8f('0x33')](_0x3d8f('0x34'))){_0x2840a3[_0x3d8f('0x1b')]=qs[_0x3d8f('0x1b')](_0x5d2133['query'][_0x3d8f('0x1b')]);_0x2840a3[_0x3d8f('0x19')]=qs[_0x3d8f('0x19')](_0x5d2133[_0x3d8f('0x2d')][_0x3d8f('0x19')]);}_0x2840a3[_0x3d8f('0x35')]=qs['sort'](_0x5d2133['query'][_0x3d8f('0x36')]);_0x2840a3[_0x3d8f('0x37')]=qs[_0x3d8f('0x39')](_[_0x3d8f('0x38')](_0x5d2133[_0x3d8f('0x2d')],_0x41aaf6[_0x3d8f('0x39')]));_0x2840a3[_0x3d8f('0x37')]['SessionId']=_0xc1520e['id'];if(_0x5d2133[_0x3d8f('0x2d')][_0x3d8f('0x3a')]){_0x2840a3[_0x3d8f('0x37')]=_[_0x3d8f('0x3b')](_0x2840a3[_0x3d8f('0x37')],{'$or':_['map'](_0x2840a3[_0x3d8f('0x31')],function(_0x2c8799){var _0x4bd862={};_0x4bd862[_0x2c8799]={'$like':'%'+_0x5d2133[_0x3d8f('0x2d')]['filter']+'%'};return _0x4bd862;})});}_0x2840a3=_[_0x3d8f('0x3b')]({},_0x2840a3,_0x5d2133[_0x3d8f('0x3c')]);return db[_0x3d8f('0x48')][_0x3d8f('0x1c')]({'where':_0x2840a3[_0x3d8f('0x37')]})[_0x3d8f('0x23')](function(_0x20a091){_0x489f15[_0x3d8f('0x1c')]=_0x20a091;if(_0x5d2133[_0x3d8f('0x2d')][_0x3d8f('0x40')]){_0x2840a3[_0x3d8f('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3d8f('0x49')](_0x2840a3);})[_0x3d8f('0x23')](function(_0x4df34f){_0x489f15[_0x3d8f('0x3d')]=_0x4df34f;return _0x489f15;});}})[_0x3d8f('0x23')](respondWithFilteredResult(_0x3b6908,_0x2840a3))['catch'](handleError(_0x3b6908,null));}; \ No newline at end of file +var _0xb6a1=['end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','show','params','find','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0xb6a1,0x7c));var _0x1b6a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb6a1[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x1b6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6a('0x1'));var jsonpatch=require(_0x1b6a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1b6a('0x3'));var Mustache=require('mustache');var util=require(_0x1b6a('0x4'));var path=require(_0x1b6a('0x5'));var sox=require(_0x1b6a('0x6'));var csv=require(_0x1b6a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b6a('0x8'));var _=require(_0x1b6a('0x9'));var squel=require(_0x1b6a('0xa'));var crypto=require(_0x1b6a('0xb'));var jsforce=require(_0x1b6a('0xc'));var deskjs=require(_0x1b6a('0xd'));var toCsv=require(_0x1b6a('0x7'));var querystring=require(_0x1b6a('0xe'));var Papa=require(_0x1b6a('0xf'));var Redis=require(_0x1b6a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b6a('0x11'));var as=require(_0x1b6a('0x12'));var hardwareService=require(_0x1b6a('0x13'));var logger=require('../../config/logger')(_0x1b6a('0x14'));var utils=require(_0x1b6a('0x15'));var config=require(_0x1b6a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ae6d6,_0x3aedd5){_0x3aedd5=_0x3aedd5||0xcc;return function(_0x35255f){if(_0x35255f){return _0x3ae6d6[_0x1b6a('0x17')](_0x3aedd5);}return _0x3ae6d6[_0x1b6a('0x18')](_0x3aedd5)['end']();};}function respondWithResult(_0x3bc358,_0x356f2c){_0x356f2c=_0x356f2c||0xc8;return function(_0x4eeb82){if(_0x4eeb82){return _0x3bc358['status'](_0x356f2c)[_0x1b6a('0x19')](_0x4eeb82);}};}function respondWithFilteredResult(_0x411cd9,_0x2d7849){return function(_0x4ca168){if(_0x4ca168){var _0x3f60c7=typeof _0x2d7849[_0x1b6a('0x1a')]===_0x1b6a('0x1b')&&typeof _0x2d7849['limit']===_0x1b6a('0x1b');var _0x28edb2=_0x4ca168[_0x1b6a('0x1c')];var _0x3e4d98=_0x3f60c7?0x0:_0x2d7849[_0x1b6a('0x1a')];var _0x5b9361=_0x3f60c7?_0x4ca168[_0x1b6a('0x1c')]:_0x2d7849[_0x1b6a('0x1a')]+_0x2d7849[_0x1b6a('0x1d')];var _0x53f138;if(_0x5b9361>=_0x28edb2){_0x5b9361=_0x28edb2;_0x53f138=0xc8;}else{_0x53f138=0xce;}_0x411cd9[_0x1b6a('0x18')](_0x53f138);return _0x411cd9[_0x1b6a('0x1e')](_0x1b6a('0x1f'),_0x3e4d98+'-'+_0x5b9361+'/'+_0x28edb2)[_0x1b6a('0x19')](_0x4ca168);}return null;};}function patchUpdates(_0xa00432){return function(_0x5d80aa){try{jsonpatch[_0x1b6a('0x20')](_0x5d80aa,_0xa00432,!![]);}catch(_0x39204b){return BPromise[_0x1b6a('0x21')](_0x39204b);}return _0x5d80aa[_0x1b6a('0x22')]();};}function saveUpdates(_0x49634f,_0x36dfa6){return function(_0x2acf9a){if(_0x2acf9a){return _0x2acf9a[_0x1b6a('0x23')](_0x49634f)[_0x1b6a('0x24')](function(_0x562fc2){return _0x562fc2;});}return null;};}function removeEntity(_0x2a09b5,_0x201ab4){return function(_0x355e64){if(_0x355e64){return _0x355e64[_0x1b6a('0x25')]()['then'](function(){_0x2a09b5['status'](0xcc)[_0x1b6a('0x26')]();});}};}function handleEntityNotFound(_0x213d9a,_0x2b6213){return function(_0x236637){if(!_0x236637){_0x213d9a['sendStatus'](0x194);}return _0x236637;};}function handleError(_0x5d5d8b,_0x1d0d1f){_0x1d0d1f=_0x1d0d1f||0x1f4;return function(_0x226feb){logger[_0x1b6a('0x27')](_0x226feb[_0x1b6a('0x28')]);if(_0x226feb[_0x1b6a('0x29')]){delete _0x226feb[_0x1b6a('0x29')];}_0x5d5d8b[_0x1b6a('0x18')](_0x1d0d1f)[_0x1b6a('0x2a')](_0x226feb);};}exports[_0x1b6a('0x2b')]=function(_0x4d8e49,_0x589351){var _0x401376={},_0xa8c328={},_0x5dd738={'count':0x0,'rows':[]};var _0x4797b3=_['map'](db['JscriptySessionReport'][_0x1b6a('0x2c')],function(_0x5103b6){return{'name':_0x5103b6[_0x1b6a('0x2d')],'type':_0x5103b6[_0x1b6a('0x2e')][_0x1b6a('0x2f')]};});_0xa8c328[_0x1b6a('0x30')]=_[_0x1b6a('0x31')](_0x4797b3,_0x1b6a('0x29'));_0xa8c328[_0x1b6a('0x32')]=_[_0x1b6a('0x33')](_0x4d8e49[_0x1b6a('0x32')]);_0xa8c328[_0x1b6a('0x34')]=_[_0x1b6a('0x35')](_0xa8c328[_0x1b6a('0x30')],_0xa8c328[_0x1b6a('0x32')]);_0x401376[_0x1b6a('0x36')]=_[_0x1b6a('0x35')](_0xa8c328[_0x1b6a('0x30')],qs[_0x1b6a('0x37')](_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x37')]));_0x401376[_0x1b6a('0x36')]=_0x401376['attributes'][_0x1b6a('0x38')]?_0x401376[_0x1b6a('0x36')]:_0xa8c328[_0x1b6a('0x30')];if(!_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x39')]('nolimit')){_0x401376['limit']=qs[_0x1b6a('0x1d')](_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x1d')]);_0x401376[_0x1b6a('0x1a')]=qs[_0x1b6a('0x1a')](_0x4d8e49['query'][_0x1b6a('0x1a')]);}_0x401376[_0x1b6a('0x3a')]=qs[_0x1b6a('0x3b')](_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x3b')]);_0x401376['where']=qs[_0x1b6a('0x34')](_[_0x1b6a('0x3c')](_0x4d8e49[_0x1b6a('0x32')],_0xa8c328[_0x1b6a('0x34')]),_0x4797b3);if(_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x3d')]){_0x401376[_0x1b6a('0x3e')]=_[_0x1b6a('0x3f')](_0x401376[_0x1b6a('0x3e')],{'$or':_[_0x1b6a('0x31')](_0x4797b3,function(_0xd9aded){if(_0xd9aded['type']!==_0x1b6a('0x40')){var _0x316751={};_0x316751[_0xd9aded[_0x1b6a('0x29')]]={'$like':'%'+_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x3d')]+'%'};return _0x316751;}})});}_0x401376=_[_0x1b6a('0x3f')]({},_0x401376,_0x4d8e49[_0x1b6a('0x41')]);var _0x520cbb={'where':_0x401376[_0x1b6a('0x3e')]};return db[_0x1b6a('0x42')][_0x1b6a('0x1c')](_0x520cbb)['then'](function(_0x57257d){_0x5dd738['count']=_0x57257d;if(_0x4d8e49[_0x1b6a('0x32')][_0x1b6a('0x43')]){_0x401376[_0x1b6a('0x44')]=[{'all':!![]}];}return db[_0x1b6a('0x42')][_0x1b6a('0x45')](_0x401376);})['then'](function(_0xcb1225){_0x5dd738[_0x1b6a('0x46')]=_0xcb1225;return _0x5dd738;})[_0x1b6a('0x24')](respondWithFilteredResult(_0x589351,_0x401376))[_0x1b6a('0x47')](handleError(_0x589351,null));};exports[_0x1b6a('0x48')]=function(_0x15f572,_0x60d940){var _0x4c8ffb={'raw':!![],'where':{'id':_0x15f572[_0x1b6a('0x49')]['id']}},_0x5b007f={};_0x5b007f[_0x1b6a('0x30')]=_[_0x1b6a('0x33')](db[_0x1b6a('0x42')][_0x1b6a('0x2c')]);_0x5b007f['query']=_['keys'](_0x15f572[_0x1b6a('0x32')]);_0x5b007f[_0x1b6a('0x34')]=_[_0x1b6a('0x35')](_0x5b007f['model'],_0x5b007f[_0x1b6a('0x32')]);_0x4c8ffb[_0x1b6a('0x36')]=_['intersection'](_0x5b007f['model'],qs[_0x1b6a('0x37')](_0x15f572[_0x1b6a('0x32')][_0x1b6a('0x37')]));_0x4c8ffb[_0x1b6a('0x36')]=_0x4c8ffb['attributes'][_0x1b6a('0x38')]?_0x4c8ffb['attributes']:_0x5b007f[_0x1b6a('0x30')];if(_0x15f572[_0x1b6a('0x32')][_0x1b6a('0x43')]){_0x4c8ffb[_0x1b6a('0x44')]=[{'all':!![]}];}_0x4c8ffb=_[_0x1b6a('0x3f')]({},_0x4c8ffb,_0x15f572[_0x1b6a('0x41')]);return db[_0x1b6a('0x42')][_0x1b6a('0x4a')](_0x4c8ffb)[_0x1b6a('0x24')](handleEntityNotFound(_0x60d940,null))[_0x1b6a('0x24')](respondWithResult(_0x60d940,null))['catch'](handleError(_0x60d940,null));};exports['create']=function(_0x5b7969,_0xc90d55){return db[_0x1b6a('0x42')]['create'](_0x5b7969['body'],{})['then'](respondWithResult(_0xc90d55,0xc9))[_0x1b6a('0x47')](handleError(_0xc90d55,null));};exports['update']=function(_0x4538d6,_0x224d3c){if(_0x4538d6[_0x1b6a('0x4b')]['id']){delete _0x4538d6['body']['id'];}return db[_0x1b6a('0x42')]['find']({'where':{'id':_0x4538d6[_0x1b6a('0x49')]['id']}})[_0x1b6a('0x24')](handleEntityNotFound(_0x224d3c,null))[_0x1b6a('0x24')](saveUpdates(_0x4538d6[_0x1b6a('0x4b')],null))[_0x1b6a('0x24')](respondWithResult(_0x224d3c,null))[_0x1b6a('0x47')](handleError(_0x224d3c,null));};exports['destroy']=function(_0x5b680c,_0x253b05){return db[_0x1b6a('0x42')]['find']({'where':{'id':_0x5b680c[_0x1b6a('0x49')]['id']}})[_0x1b6a('0x24')](handleEntityNotFound(_0x253b05,null))[_0x1b6a('0x24')](removeEntity(_0x253b05,null))['catch'](handleError(_0x253b05,null));};exports[_0x1b6a('0x4c')]=function(_0x218958,_0x3255e8){return db['JscriptySessionReport'][_0x1b6a('0x4c')]()[_0x1b6a('0x24')](respondWithResult(_0x3255e8,null))[_0x1b6a('0x47')](handleError(_0x3255e8,null));};exports[_0x1b6a('0x4d')]=function(_0xdf52c8,_0x3860b8,_0x1b0c15){var _0x2e9f92={'raw':!![],'where':{}};var _0x39ec70={};var _0x518a87={'count':0x0,'rows':[]};return db[_0x1b6a('0x42')][_0x1b6a('0x4e')]({'where':{'id':_0xdf52c8['params']['id']}})['then'](handleEntityNotFound(_0x3860b8,null))[_0x1b6a('0x24')](function(_0x182fbe){if(_0x182fbe){_0x39ec70['model']=_[_0x1b6a('0x33')](db[_0x1b6a('0x4f')]['rawAttributes']);_0x39ec70['query']=_[_0x1b6a('0x33')](_0xdf52c8[_0x1b6a('0x32')]);_0x39ec70[_0x1b6a('0x34')]=_['intersection'](_0x39ec70['model'],_0x39ec70[_0x1b6a('0x32')]);_0x2e9f92[_0x1b6a('0x36')]=_[_0x1b6a('0x35')](_0x39ec70['model'],qs[_0x1b6a('0x37')](_0xdf52c8[_0x1b6a('0x32')][_0x1b6a('0x37')]));_0x2e9f92[_0x1b6a('0x36')]=_0x2e9f92[_0x1b6a('0x36')][_0x1b6a('0x38')]?_0x2e9f92[_0x1b6a('0x36')]:_0x39ec70[_0x1b6a('0x30')];if(!_0xdf52c8[_0x1b6a('0x32')][_0x1b6a('0x39')]('nolimit')){_0x2e9f92[_0x1b6a('0x1d')]=qs[_0x1b6a('0x1d')](_0xdf52c8['query'][_0x1b6a('0x1d')]);_0x2e9f92[_0x1b6a('0x1a')]=qs[_0x1b6a('0x1a')](_0xdf52c8[_0x1b6a('0x32')][_0x1b6a('0x1a')]);}_0x2e9f92[_0x1b6a('0x3a')]=qs[_0x1b6a('0x3b')](_0xdf52c8['query'][_0x1b6a('0x3b')]);_0x2e9f92[_0x1b6a('0x3e')]=qs[_0x1b6a('0x34')](_['pick'](_0xdf52c8[_0x1b6a('0x32')],_0x39ec70['filters']));_0x2e9f92[_0x1b6a('0x3e')][_0x1b6a('0x50')]=_0x182fbe['id'];if(_0xdf52c8[_0x1b6a('0x32')]['filter']){_0x2e9f92['where']=_[_0x1b6a('0x3f')](_0x2e9f92[_0x1b6a('0x3e')],{'$or':_['map'](_0x2e9f92[_0x1b6a('0x36')],function(_0x453afc){var _0x157661={};_0x157661[_0x453afc]={'$like':'%'+_0xdf52c8['query'][_0x1b6a('0x3d')]+'%'};return _0x157661;})});}_0x2e9f92=_['merge']({},_0x2e9f92,_0xdf52c8['options']);return db[_0x1b6a('0x4f')][_0x1b6a('0x1c')]({'where':_0x2e9f92[_0x1b6a('0x3e')]})['then'](function(_0x29efd2){_0x518a87[_0x1b6a('0x1c')]=_0x29efd2;if(_0xdf52c8[_0x1b6a('0x32')]['includeAll']){_0x2e9f92[_0x1b6a('0x44')]=[{'all':!![]}];}return db[_0x1b6a('0x4f')][_0x1b6a('0x45')](_0x2e9f92);})[_0x1b6a('0x24')](function(_0x34e88c){_0x518a87['rows']=_0x34e88c;return _0x518a87;});}})[_0x1b6a('0x24')](respondWithFilteredResult(_0x3860b8,_0x2e9f92))['catch'](handleError(_0x3860b8,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 63e2073..208238b 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 _0x187d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x26205a,_0x521147){var _0x452128=function(_0xf23e15){while(--_0xf23e15){_0x26205a['push'](_0x26205a['shift']());}};_0x452128(++_0x521147);}(_0x187d,0x93));var _0xd187=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x187d[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb091=['moment','request-promise','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','util','../../config/logger','api'];(function(_0xe4a401,_0x3d0e91){var _0x5ccdbb=function(_0xfc1bc2){while(--_0xfc1bc2){_0xe4a401['push'](_0xe4a401['shift']());}};_0x5ccdbb(++_0x3d0e91);}(_0xb091,0x16e));var _0x1b09=function(_0x57f2ad,_0x3bf4f3){_0x57f2ad=_0x57f2ad-0x0;var _0xa876cc=_0xb091[_0x57f2ad];return _0xa876cc;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index cff36fa..dbd70cf 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 _0x0424=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x0424,0x159));var _0x4042=function(_0x2cdf41,_0x4a277c){_0x2cdf41=_0x2cdf41-0x0;var _0x39a70e=_0x0424[_0x2cdf41];return _0x39a70e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});} \ No newline at end of file +var _0x7b84=['jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3d8d30,_0x5ed485){var _0x5a8693=function(_0x5ac418){while(--_0x5ac418){_0x3d8d30['push'](_0x3d8d30['shift']());}};_0x5a8693(++_0x5ed485);}(_0x7b84,0x17c));var _0x47b8=function(_0x2cdb60,_0x15eaa2){_0x2cdb60=_0x2cdb60-0x0;var _0x47746b=_0x7b84[_0x2cdb60];return _0x47746b;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 42994df..646c070 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 _0x2fda=['get','index','/:id','isAuthenticated','update','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x209477,_0x3f8511){var _0x138227=function(_0x4e173d){while(--_0x4e173d){_0x209477['push'](_0x209477['shift']());}};_0x138227(++_0x3f8511);}(_0x2fda,0x186));var _0xa2fd=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x2fda[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0xa2fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2fd('0x1'));var express=require(_0xa2fd('0x2'));var router=express[_0xa2fd('0x3')]();var fs_extra=require(_0xa2fd('0x4'));var auth=require(_0xa2fd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0xa2fd('0x6')]('/',controller[_0xa2fd('0x7')]);router['put'](_0xa2fd('0x8'),auth[_0xa2fd('0x9')](),controller[_0xa2fd('0xa')]);module['exports']=router; \ No newline at end of file +var _0x8375=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','put','/:id','update','exports','util','path'];(function(_0x4cffc7,_0x17e2f7){var _0x1c4303=function(_0x565b09){while(--_0x565b09){_0x4cffc7['push'](_0x4cffc7['shift']());}};_0x1c4303(++_0x17e2f7);}(_0x8375,0x132));var _0x5837=function(_0x5b2bee,_0x3c37a3){_0x5b2bee=_0x5b2bee-0x0;var _0x592fc2=_0x8375[_0x5b2bee];return _0x592fc2;};'use strict';var multer=require('multer');var util=require(_0x5837('0x0'));var path=require(_0x5837('0x1'));var timeout=require(_0x5837('0x2'));var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require('./license.controller');router[_0x5837('0x8')]('/',controller[_0x5837('0x9')]);router[_0x5837('0xa')](_0x5837('0xb'),auth['isAuthenticated'](),controller[_0x5837('0xc')]);module[_0x5837('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 741f9d2..b0fd77d 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 _0x7fcc=['TEXT','STRING','INTEGER','sequelize'];(function(_0x5ed432,_0x2c42f4){var _0x3bb6f8=function(_0x32f8dd){while(--_0x32f8dd){_0x5ed432['push'](_0x5ed432['shift']());}};_0x3bb6f8(++_0x2c42f4);}(_0x7fcc,0x163));var _0xc7fc=function(_0x1a0499,_0x31223a){_0x1a0499=_0x1a0499-0x0;var _0x24368c=_0x7fcc[_0x1a0499];return _0x24368c;};'use strict';var Sequelize=require(_0xc7fc('0x0'));module['exports']={'license':{'type':Sequelize[_0xc7fc('0x1')]},'data1':{'type':Sequelize[_0xc7fc('0x2')]},'data2':{'type':Sequelize[_0xc7fc('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xc7fc('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34a4=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x4474d5,_0x4e9c3a){var _0x141d03=function(_0x425f66){while(--_0x425f66){_0x4474d5['push'](_0x4474d5['shift']());}};_0x141d03(++_0x4e9c3a);}(_0x34a4,0xc8));var _0x434a=function(_0x33bee8,_0x47df8f){_0x33bee8=_0x33bee8-0x0;var _0x5959ab=_0x34a4[_0x33bee8];return _0x5959ab;};'use strict';var Sequelize=require(_0x434a('0x0'));module[_0x434a('0x1')]={'license':{'type':Sequelize[_0x434a('0x2')]},'data1':{'type':Sequelize[_0x434a('0x3')]},'data2':{'type':Sequelize[_0x434a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x434a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 5ccd58e..b902960 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 _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(_0x111e9c,_0x52ee27){var _0x512301=function(_0x2ede5c){while(--_0x2ede5c){_0x111e9c['push'](_0x111e9c['shift']());}};_0x512301(++_0x52ee27);}(_0x1261,0x144));var _0x1126=function(_0xb08125,_0x561acb){_0xb08125=_0xb08125-0x0;var _0x2ace23=_0x1261[_0xb08125];return _0x2ace23;};'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 +var _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x53d8d2,_0x1a2b14){var _0x500e5a=function(_0x39b022){while(--_0x39b022){_0x53d8d2['push'](_0x53d8d2['shift']());}};_0x500e5a(++_0x1a2b14);}(_0x1967,0x173));var _0x7196=function(_0x503b0a,_0x375848){_0x503b0a=_0x503b0a-0x0;var _0x31a335=_0x1967[_0x503b0a];return _0x31a335;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5a128af..b2da51a 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 _0x1991=['rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1991,0xb0));var _0x1199=function(_0x69df1e,_0x41709f){_0x69df1e=_0x69df1e-0x0;var _0x19d021=_0x1991[_0x69df1e];return _0x19d021;};'use strict';var _=require(_0x1199('0x0'));var util=require('util');var logger=require(_0x1199('0x1'))(_0x1199('0x2'));var moment=require(_0x1199('0x3'));var BPromise=require('bluebird');var rp=require(_0x1199('0x4'));var fs=require('fs');var path=require(_0x1199('0x5'));var rimraf=require(_0x1199('0x6'));var config=require(_0x1199('0x7'));var attributes=require(_0x1199('0x8'));module[_0x1199('0x9')]=function(_0x1f0c59,_0x44caed){return _0x1f0c59[_0x1199('0xa')](_0x1199('0xb'),attributes,{'tableName':_0x1199('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0960=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash'];(function(_0x3d2825,_0x429235){var _0x3fd769=function(_0x3102b4){while(--_0x3102b4){_0x3d2825['push'](_0x3d2825['shift']());}};_0x3fd769(++_0x429235);}(_0x0960,0xc2));var _0x0096=function(_0x483027,_0x5dddf8){_0x483027=_0x483027-0x0;var _0x19c6c4=_0x0960[_0x483027];return _0x19c6c4;};'use strict';var _=require(_0x0096('0x0'));var util=require(_0x0096('0x1'));var logger=require('../../config/logger')(_0x0096('0x2'));var moment=require(_0x0096('0x3'));var BPromise=require(_0x0096('0x4'));var rp=require(_0x0096('0x5'));var fs=require('fs');var path=require(_0x0096('0x6'));var rimraf=require(_0x0096('0x7'));var config=require(_0x0096('0x8'));var attributes=require(_0x0096('0x9'));module[_0x0096('0xa')]=function(_0x6ea572,_0x59b3cc){return _0x6ea572[_0x0096('0xb')]('License',attributes,{'tableName':_0x0096('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e4b0b89..84e1565 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 _0xc942=['code','License,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a11c8,_0xff7e58){var _0xa830e8=function(_0x13f588){while(--_0x13f588){_0x3a11c8['push'](_0x3a11c8['shift']());}};_0xa830e8(++_0xff7e58);}(_0xc942,0x10b));var _0x2c94=function(_0x85e7d1,_0x1a1871){_0x85e7d1=_0x85e7d1-0x0;var _0x3166e8=_0xc942[_0x85e7d1];return _0x3166e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2c94('0x0'));var BPromise=require(_0x2c94('0x1'));var rs=require(_0x2c94('0x2'));var fs=require('fs');var Redis=require(_0x2c94('0x3'));var db=require(_0x2c94('0x4'))['db'];var utils=require(_0x2c94('0x5'));var logger=require(_0x2c94('0x6'))(_0x2c94('0x7'));var config=require(_0x2c94('0x8'));var jayson=require(_0x2c94('0x9'));var client=jayson[_0x2c94('0xa')][_0x2c94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff842,_0xb77699,_0x31f660){return new BPromise(function(_0x30e00c,_0x545d99){return client[_0x2c94('0xc')](_0x3ff842,_0x31f660)[_0x2c94('0xd')](function(_0x51bd34){logger[_0x2c94('0xe')]('License,\x20%s,\x20%s',_0xb77699,_0x2c94('0xf'));logger['debug'](_0x2c94('0x10'),_0xb77699,_0x2c94('0xf'),JSON[_0x2c94('0x11')](_0x51bd34));if(_0x51bd34[_0x2c94('0x12')]){if(_0x51bd34['error'][_0x2c94('0x13')]===0x1f4){logger[_0x2c94('0x12')](_0x2c94('0x14'),_0xb77699,_0x51bd34[_0x2c94('0x12')][_0x2c94('0x15')]);return _0x545d99(_0x51bd34[_0x2c94('0x12')][_0x2c94('0x15')]);}logger[_0x2c94('0x12')](_0x2c94('0x14'),_0xb77699,_0x51bd34[_0x2c94('0x12')]['message']);return _0x30e00c(_0x51bd34[_0x2c94('0x12')][_0x2c94('0x15')]);}else{logger[_0x2c94('0xe')]('License,\x20%s,\x20%s',_0xb77699,'request\x20sent');_0x30e00c(_0x51bd34['result'][_0x2c94('0x15')]);}})['catch'](function(_0xd7b1f9){logger['error'](_0x2c94('0x14'),_0xb77699,_0xd7b1f9);_0x545d99(_0xd7b1f9);});});} \ No newline at end of file +var _0x2fe4=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0xfc7a95,_0x2c837c){var _0xea4b22=function(_0x4bc5aa){while(--_0x4bc5aa){_0xfc7a95['push'](_0xfc7a95['shift']());}};_0xea4b22(++_0x2c837c);}(_0x2fe4,0x183));var _0x42fe=function(_0x123b64,_0x1503a0){_0x123b64=_0x123b64-0x0;var _0x461e40=_0x2fe4[_0x123b64];return _0x461e40;};'use strict';var _=require(_0x42fe('0x0'));var util=require(_0x42fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x42fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x42fe('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x42fe('0x4'));var jayson=require(_0x42fe('0x5'));var client=jayson[_0x42fe('0x6')][_0x42fe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbefdfe,_0x5c0006,_0x2f913d){return new BPromise(function(_0x2c9250,_0x5f045d){return client['request'](_0xbefdfe,_0x2f913d)[_0x42fe('0x8')](function(_0x476502){logger[_0x42fe('0x9')](_0x42fe('0xa'),_0x5c0006,_0x42fe('0xb'));logger[_0x42fe('0xc')](_0x42fe('0xd'),_0x5c0006,'request\x20sent',JSON[_0x42fe('0xe')](_0x476502));if(_0x476502['error']){if(_0x476502[_0x42fe('0xf')][_0x42fe('0x10')]===0x1f4){logger['error'](_0x42fe('0xa'),_0x5c0006,_0x476502[_0x42fe('0xf')][_0x42fe('0x11')]);return _0x5f045d(_0x476502[_0x42fe('0xf')][_0x42fe('0x11')]);}logger['error']('License,\x20%s,\x20%s',_0x5c0006,_0x476502[_0x42fe('0xf')][_0x42fe('0x11')]);return _0x2c9250(_0x476502[_0x42fe('0xf')][_0x42fe('0x11')]);}else{logger['info'](_0x42fe('0xa'),_0x5c0006,_0x42fe('0xb'));_0x2c9250(_0x476502['result'][_0x42fe('0x11')]);}})['catch'](function(_0x361718){logger['error'](_0x42fe('0xa'),_0x5c0006,_0x361718);_0x5f045d(_0x361718);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 70372cd..8778720 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 _0x16f5=['/:id/interactions','getInteractions','/:id/applications','/:id/verify','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp'];(function(_0x411f71,_0x25895f){var _0x4eb0f4=function(_0x4760dd){while(--_0x4760dd){_0x411f71['push'](_0x411f71['shift']());}};_0x4eb0f4(++_0x25895f);}(_0x16f5,0x71));var _0x516f=function(_0x1f91ac,_0x5df449){_0x1f91ac=_0x1f91ac-0x0;var _0x195ecc=_0x16f5[_0x1f91ac];return _0x195ecc;};'use strict';var multer=require(_0x516f('0x0'));var util=require(_0x516f('0x1'));var path=require(_0x516f('0x2'));var timeout=require(_0x516f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x516f('0x4'));var auth=require(_0x516f('0x5'));var interaction=require(_0x516f('0x6'));var config=require(_0x516f('0x7'));var controller=require('./mailAccount.controller');router[_0x516f('0x8')]('/',auth[_0x516f('0x9')](),controller[_0x516f('0xa')]);router[_0x516f('0x8')]('/describe',auth[_0x516f('0x9')](),controller[_0x516f('0xb')]);router[_0x516f('0x8')](_0x516f('0xc'),auth[_0x516f('0x9')](),controller[_0x516f('0xd')]);router[_0x516f('0x8')](_0x516f('0xe'),auth[_0x516f('0x9')](),controller[_0x516f('0xf')]);router[_0x516f('0x8')](_0x516f('0x10'),auth[_0x516f('0x9')](),controller[_0x516f('0x11')]);router[_0x516f('0x8')](_0x516f('0x12'),auth[_0x516f('0x9')](),controller[_0x516f('0x13')]);router[_0x516f('0x8')](_0x516f('0x14'),auth[_0x516f('0x9')](),controller[_0x516f('0x15')]);router['get'](_0x516f('0x16'),auth[_0x516f('0x9')](),controller[_0x516f('0x17')]);router[_0x516f('0x8')](_0x516f('0x18'),auth['isAuthenticated'](),controller['getApplications']);router[_0x516f('0x8')]('/:id/messages',auth[_0x516f('0x9')](),controller['getMessages']);router[_0x516f('0x8')](_0x516f('0x19'),auth[_0x516f('0x9')](),controller['verifySmtp']);router[_0x516f('0x8')](_0x516f('0x1a'),auth[_0x516f('0x9')](),controller[_0x516f('0x1b')]);router['post'](_0x516f('0xe'),auth[_0x516f('0x9')](),controller['addDisposition']);router[_0x516f('0x1c')](_0x516f('0x10'),auth[_0x516f('0x9')](),controller[_0x516f('0x1d')]);router['post']('/',auth[_0x516f('0x9')](),controller['create']);router[_0x516f('0x1c')](_0x516f('0x12'),auth[_0x516f('0x9')](),controller[_0x516f('0x1e')]);router['post']('/:id/out_servers',auth[_0x516f('0x9')](),controller[_0x516f('0x1f')]);router[_0x516f('0x1c')](_0x516f('0x16'),auth[_0x516f('0x9')](),controller[_0x516f('0x20')]);router[_0x516f('0x1c')](_0x516f('0x18'),auth['isAuthenticated'](),controller[_0x516f('0x21')]);router['post'](_0x516f('0x22'),auth[_0x516f('0x9')](),controller[_0x516f('0x23')]);router['post'](_0x516f('0x1a'),auth[_0x516f('0x9')](),controller[_0x516f('0x24')]);router[_0x516f('0x25')](_0x516f('0xc'),auth[_0x516f('0x9')](),controller[_0x516f('0x26')]);router[_0x516f('0x27')](_0x516f('0xe'),auth[_0x516f('0x9')](),controller[_0x516f('0x28')]);router['delete']('/:id/canned_answers',auth[_0x516f('0x9')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0x516f('0x9')](),controller[_0x516f('0x29')]);router['delete'](_0x516f('0x14'),auth['isAuthenticated'](),controller[_0x516f('0x2a')]);router['delete'](_0x516f('0xc'),auth[_0x516f('0x9')](),controller[_0x516f('0x2b')]);router[_0x516f('0x27')](_0x516f('0x1a'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x516f('0x2c')]=router; \ No newline at end of file +var _0xe12e=['/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','/:id/out_servers','addApplications','/:id/send','send','addAgents','/:id','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages'];(function(_0x36de31,_0x142c61){var _0x3c40fb=function(_0x1948df){while(--_0x1948df){_0x36de31['push'](_0x36de31['shift']());}};_0x3c40fb(++_0x142c61);}(_0xe12e,0x1aa));var _0xee12=function(_0x5554ec,_0x546b76){_0x5554ec=_0x5554ec-0x0;var _0xab1661=_0xe12e[_0x5554ec];return _0xab1661;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee12('0x0'));var timeout=require(_0xee12('0x1'));var express=require(_0xee12('0x2'));var router=express[_0xee12('0x3')]();var fs_extra=require(_0xee12('0x4'));var auth=require(_0xee12('0x5'));var interaction=require(_0xee12('0x6'));var config=require('../../config/environment');var controller=require(_0xee12('0x7'));router[_0xee12('0x8')]('/',auth[_0xee12('0x9')](),controller[_0xee12('0xa')]);router[_0xee12('0x8')](_0xee12('0xb'),auth[_0xee12('0x9')](),controller[_0xee12('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xee12('0xd')]);router[_0xee12('0x8')](_0xee12('0xe'),auth[_0xee12('0x9')](),controller['getDispositions']);router[_0xee12('0x8')](_0xee12('0xf'),auth[_0xee12('0x9')](),controller[_0xee12('0x10')]);router[_0xee12('0x8')]('/:id/in_servers',auth[_0xee12('0x9')](),controller[_0xee12('0x11')]);router[_0xee12('0x8')]('/:id/out_servers',auth[_0xee12('0x9')](),controller[_0xee12('0x12')]);router[_0xee12('0x8')](_0xee12('0x13'),auth[_0xee12('0x9')](),controller[_0xee12('0x14')]);router[_0xee12('0x8')](_0xee12('0x15'),auth['isAuthenticated'](),controller[_0xee12('0x16')]);router[_0xee12('0x8')](_0xee12('0x17'),auth[_0xee12('0x9')](),controller['getMessages']);router['get'](_0xee12('0x18'),auth[_0xee12('0x9')](),controller['verifySmtp']);router[_0xee12('0x8')](_0xee12('0x19'),auth[_0xee12('0x9')](),controller[_0xee12('0x1a')]);router[_0xee12('0x1b')](_0xee12('0xe'),auth['isAuthenticated'](),controller[_0xee12('0x1c')]);router[_0xee12('0x1b')](_0xee12('0xf'),auth[_0xee12('0x9')](),controller[_0xee12('0x1d')]);router[_0xee12('0x1b')]('/',auth[_0xee12('0x9')](),controller[_0xee12('0x1e')]);router[_0xee12('0x1b')](_0xee12('0x1f'),auth[_0xee12('0x9')](),controller['addImap']);router[_0xee12('0x1b')](_0xee12('0x20'),auth[_0xee12('0x9')](),controller['addSmtp']);router['post']('/:id/interactions',auth[_0xee12('0x9')](),controller['addInteraction']);router[_0xee12('0x1b')](_0xee12('0x15'),auth[_0xee12('0x9')](),controller[_0xee12('0x21')]);router[_0xee12('0x1b')](_0xee12('0x22'),auth[_0xee12('0x9')](),controller[_0xee12('0x23')]);router[_0xee12('0x1b')](_0xee12('0x19'),auth[_0xee12('0x9')](),controller[_0xee12('0x24')]);router['put'](_0xee12('0x25'),auth[_0xee12('0x9')](),controller[_0xee12('0x26')]);router[_0xee12('0x27')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xee12('0x28')]);router['delete'](_0xee12('0xf'),auth[_0xee12('0x9')](),controller[_0xee12('0x29')]);router[_0xee12('0x27')]('/:id/in_servers',auth[_0xee12('0x9')](),controller['removeImap']);router['delete'](_0xee12('0x20'),auth[_0xee12('0x9')](),controller[_0xee12('0x2a')]);router[_0xee12('0x27')](_0xee12('0x25'),auth[_0xee12('0x9')](),controller[_0xee12('0x2b')]);router[_0xee12('0x27')](_0xee12('0x19'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xee12('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 433ed6d..ab9e1f7 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 _0x7f42=['Arial,Helvetica,sans-serif','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN'];(function(_0x175845,_0x63a011){var _0x5ae268=function(_0x270816){while(--_0x270816){_0x175845['push'](_0x175845['shift']());}};_0x5ae268(++_0x63a011);}(_0x7f42,0x1dd));var _0x27f4=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7f42[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'description':{'type':Sequelize[_0x27f4('0x1')]},'name':{'type':Sequelize[_0x27f4('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x27f4('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x27f4('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x27f4('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x27f4('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x27f4('0x5')],'defaultValue':function(){return _0x27f4('0x6');}},'notificationSound':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x27f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x27f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x27f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x27f4('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x27f4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x27f4('0x2')],'defaultValue':![],'comment':_0x27f4('0x9'),'set':function(_0x3b1d50){if(!_0x3b1d50)this[_0x27f4('0xa')](_0x27f4('0xb'),null);this[_0x27f4('0xa')]('mandatoryDisposition',_0x3b1d50);}}}; \ No newline at end of file +var _0x6f7f=['mandatoryDisposition','exports','STRING','BOOLEAN','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x51e616,_0x22d3a5){var _0x403840=function(_0x413ed4){while(--_0x413ed4){_0x51e616['push'](_0x51e616['shift']());}};_0x403840(++_0x22d3a5);}(_0x6f7f,0x177));var _0xf6f7=function(_0x140b06,_0x3663ff){_0x140b06=_0x140b06-0x0;var _0x1fd9fd=_0x6f7f[_0x140b06];return _0x1fd9fd;};'use strict';var Sequelize=require('sequelize');module[_0xf6f7('0x0')]={'description':{'type':Sequelize[_0xf6f7('0x1')]},'name':{'type':Sequelize[_0xf6f7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xf6f7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xf6f7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf6f7('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xf6f7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf6f7('0x1')],'allowNull':![],'defaultValue':_0xf6f7('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xf6f7('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf6f7('0x5');}},'notificationSound':{'type':Sequelize[_0xf6f7('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf6f7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf6f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf6f7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf6f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf6f7('0x6')],'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['BOOLEAN'],'defaultValue':![],'comment':_0xf6f7('0x7'),'set':function(_0x43082f){if(!_0x43082f)this[_0xf6f7('0x8')](_0xf6f7('0x9'),null);this[_0xf6f7('0x8')](_0xf6f7('0xa'),_0x43082f);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9adac20..8c7a259 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 _0x2a28=['html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','update','MailAccounts','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','params','length','body','describe','addDisposition','find','create','getDispositions','findOne','rawAttributes','hasOwnProperty','Disposition','removeDispositions','addAnswer','MailAccountId','CannedAnswer','removeAnswers','ids','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','List','Contacts','updatedAt','DESC','from','attachments','join','server/files/attachments','basename','auth','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','secure','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x3e9752,_0x325f4d){var _0x220a91=function(_0x3b0c96){while(--_0x3b0c96){_0x3e9752['push'](_0x3e9752['shift']());}};_0x220a91(++_0x325f4d);}(_0x2a28,0xb2));var _0x82a2=function(_0x17eb6e,_0x49c48f){_0x17eb6e=_0x17eb6e-0x0;var _0x11bd56=_0x2a28[_0x17eb6e];return _0x11bd56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82a2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82a2('0x1'));var rp=require(_0x82a2('0x2'));var moment=require(_0x82a2('0x3'));var BPromise=require(_0x82a2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x82a2('0x5'));var sox=require(_0x82a2('0x6'));var csv=require(_0x82a2('0x7'));var ejs=require(_0x82a2('0x8'));var fs=require('fs');var fs_extra=require(_0x82a2('0x9'));var _=require(_0x82a2('0xa'));var squel=require(_0x82a2('0xb'));var crypto=require('crypto');var jsforce=require(_0x82a2('0xc'));var deskjs=require(_0x82a2('0xd'));var toCsv=require(_0x82a2('0x7'));var querystring=require('querystring');var Papa=require(_0x82a2('0xe'));var htmlToText=require(_0x82a2('0xf'));var juice=require(_0x82a2('0x10'));var Redis=require(_0x82a2('0x11'));var authService=require(_0x82a2('0x12'));var qs=require(_0x82a2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82a2('0x14'));var utils=require('../../config/utils');var config=require(_0x82a2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x82a2('0x16'))['db'];config[_0x82a2('0x17')]=_[_0x82a2('0x18')](config[_0x82a2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x82a2('0x19'))(new Redis(config[_0x82a2('0x17')]));require(_0x82a2('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x82a2('0x1b')][_0x82a2('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x2c12d1,_0x53524f,_0xbe37e,_0x5a08b0){return new BPromise(function(_0x23e155,_0x50fa0e){var _0x20599d=_0x5a08b0||client;return _0x20599d['request'](_0x2c12d1,_0xbe37e)[_0x82a2('0x1d')](function(_0x3cfa49){logger[_0x82a2('0x1e')](_0x82a2('0x1f'),_0x53524f,'request\x20sent');logger[_0x82a2('0x20')](_0x82a2('0x21'),_0x53524f,_0x82a2('0x22'),JSON['stringify'](_0x3cfa49));if(_0x3cfa49[_0x82a2('0x23')]){if(_0x3cfa49['error']['code']===0x1f4){logger[_0x82a2('0x23')](_0x82a2('0x1f'),_0x53524f,_0x3cfa49['error'][_0x82a2('0x24')]);return _0x50fa0e(_0x3cfa49[_0x82a2('0x23')][_0x82a2('0x24')]);}logger[_0x82a2('0x23')](_0x82a2('0x1f'),_0x53524f,_0x3cfa49[_0x82a2('0x23')][_0x82a2('0x24')]);return _0x23e155(_0x3cfa49[_0x82a2('0x23')][_0x82a2('0x24')]);}else{logger[_0x82a2('0x1e')](_0x82a2('0x1f'),_0x53524f,'request\x20sent');_0x23e155(_0x3cfa49['result'][_0x82a2('0x24')]);}})[_0x82a2('0x25')](function(_0x437277){logger[_0x82a2('0x23')]('MailAccount,\x20%s,\x20%s',_0x53524f,_0x437277);_0x50fa0e(_0x437277);});});}function respondWithStatusCode(_0x47e350,_0x1b124b){_0x1b124b=_0x1b124b||0xcc;return function(_0x27eb4a){if(_0x27eb4a){return _0x47e350[_0x82a2('0x26')](_0x1b124b);}return _0x47e350[_0x82a2('0x27')](_0x1b124b)[_0x82a2('0x28')]();};}function respondWithResult(_0x46e565,_0x1cf5eb){_0x1cf5eb=_0x1cf5eb||0xc8;return function(_0x2924ca){if(_0x2924ca){return _0x46e565['status'](_0x1cf5eb)['json'](_0x2924ca);}};}function respondWithFilteredResult(_0x29a1c1,_0x3f15df){return function(_0x4c82cf){if(_0x4c82cf){var _0x33b23b=typeof _0x3f15df['offset']===_0x82a2('0x29')&&typeof _0x3f15df['limit']==='undefined';var _0x5bfa98=_0x4c82cf[_0x82a2('0x2a')];var _0x369a7a=_0x33b23b?0x0:_0x3f15df[_0x82a2('0x2b')];var _0x56d70a=_0x33b23b?_0x4c82cf[_0x82a2('0x2a')]:_0x3f15df[_0x82a2('0x2b')]+_0x3f15df[_0x82a2('0x2c')];var _0x3fa5cc;if(_0x56d70a>=_0x5bfa98){_0x56d70a=_0x5bfa98;_0x3fa5cc=0xc8;}else{_0x3fa5cc=0xce;}_0x29a1c1[_0x82a2('0x27')](_0x3fa5cc);return _0x29a1c1['set'](_0x82a2('0x2d'),_0x369a7a+'-'+_0x56d70a+'/'+_0x5bfa98)[_0x82a2('0x2e')](_0x4c82cf);}return null;};}function patchUpdates(_0x49bc5d){return function(_0x3a59ce){try{jsonpatch[_0x82a2('0x2f')](_0x3a59ce,_0x49bc5d,!![]);}catch(_0x513daf){return BPromise[_0x82a2('0x30')](_0x513daf);}return _0x3a59ce['save']();};}function saveUpdates(_0x595443,_0xf08f38){return function(_0x4eb974){if(_0x4eb974){return _0x4eb974[_0x82a2('0x31')](_0x595443)['then'](function(_0x436720){return _0x436720;});}return null;};}function removeEntity(_0x1df0dd,_0x28d885){return function(_0x572263){if(_0x572263){return _0x572263['destroy']()[_0x82a2('0x1d')](function(){var _0x592435=_0x572263['get']({'plain':!![]});var _0x9921dd=_0x82a2('0x32');return db['UserProfileResource'][_0x82a2('0x33')]({'where':{'type':_0x9921dd,'resourceId':_0x592435['id']}})['then'](function(){return _0x572263;});})[_0x82a2('0x1d')](function(){_0x1df0dd[_0x82a2('0x27')](0xcc)[_0x82a2('0x28')]();});}};}function handleEntityNotFound(_0x73fe3f,_0x98c03c){return function(_0x19f718){if(!_0x19f718){_0x73fe3f[_0x82a2('0x26')](0x194);}return _0x19f718;};}function handleError(_0x488418,_0x513646){_0x513646=_0x513646||0x1f4;return function(_0x220106){logger[_0x82a2('0x23')](_0x220106[_0x82a2('0x34')]);if(_0x220106['name']){delete _0x220106[_0x82a2('0x35')];}_0x488418['status'](_0x513646)[_0x82a2('0x36')](_0x220106);};}exports[_0x82a2('0x37')]=function(_0x1fd0cf,_0xfc5233){var _0x462b0f={'include':[{'model':db[_0x82a2('0x38')],'as':_0x82a2('0x39')},{'model':db[_0x82a2('0x3a')],'as':_0x82a2('0x3b')},{'model':db[_0x82a2('0x3c')],'as':_0x82a2('0x3d')}]},_0xe4e7ba={},_0x1aef19={'count':0x0,'rows':[]};var _0x512520=_[_0x82a2('0x3e')](db[_0x82a2('0x3f')]['rawAttributes'],function(_0x1fa90a){return{'name':_0x1fa90a[_0x82a2('0x40')],'type':_0x1fa90a[_0x82a2('0x41')][_0x82a2('0x42')]};});_0xe4e7ba['model']=_[_0x82a2('0x3e')](_0x512520,_0x82a2('0x35'));_0xe4e7ba[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x1fd0cf[_0x82a2('0x43')]);_0xe4e7ba['filters']=_[_0x82a2('0x45')](_0xe4e7ba[_0x82a2('0x46')],_0xe4e7ba['query']);_0x462b0f[_0x82a2('0x47')]=_['intersection'](_0xe4e7ba[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x1fd0cf['query']['fields']));_0x462b0f[_0x82a2('0x47')]=_0x462b0f[_0x82a2('0x47')]['length']?_0x462b0f[_0x82a2('0x47')]:_0xe4e7ba[_0x82a2('0x46')];if(!_0x1fd0cf[_0x82a2('0x43')]['hasOwnProperty'](_0x82a2('0x49'))){_0x462b0f['limit']=qs['limit'](_0x1fd0cf[_0x82a2('0x43')][_0x82a2('0x2c')]);_0x462b0f['offset']=qs[_0x82a2('0x2b')](_0x1fd0cf[_0x82a2('0x43')][_0x82a2('0x2b')]);}_0x462b0f[_0x82a2('0x4a')]=qs[_0x82a2('0x4b')](_0x1fd0cf['query'][_0x82a2('0x4b')]);_0x462b0f[_0x82a2('0x4c')]=qs[_0x82a2('0x4d')](_[_0x82a2('0x4e')](_0x1fd0cf['query'],_0xe4e7ba[_0x82a2('0x4d')]),_0x512520);if(_0x1fd0cf[_0x82a2('0x43')]['filter']){_0x462b0f[_0x82a2('0x4c')]=_[_0x82a2('0x4f')](_0x462b0f[_0x82a2('0x4c')],{'$or':_['map'](_0x512520,function(_0x1461e0){if(_0x1461e0[_0x82a2('0x41')]!=='VIRTUAL'){var _0x96f24={};_0x96f24[_0x1461e0['name']]={'$like':'%'+_0x1fd0cf['query'][_0x82a2('0x50')]+'%'};return _0x96f24;}})});}_0x462b0f=_[_0x82a2('0x4f')]({},_0x462b0f,_0x1fd0cf[_0x82a2('0x51')]);var _0x9a8b98={'where':_0x462b0f[_0x82a2('0x4c')]};return db[_0x82a2('0x3f')]['count'](_0x9a8b98)['then'](function(_0x3317a8){_0x1aef19[_0x82a2('0x2a')]=_0x3317a8;if(_0x1fd0cf[_0x82a2('0x43')][_0x82a2('0x52')]){_0x462b0f[_0x82a2('0x53')]=[{'all':!![]}];}return db[_0x82a2('0x3f')][_0x82a2('0x54')](_0x462b0f);})[_0x82a2('0x1d')](function(_0x1508ae){_0x1aef19[_0x82a2('0x55')]=_0x1508ae;return _0x1aef19;})['then'](respondWithFilteredResult(_0xfc5233,_0x462b0f))['catch'](handleError(_0xfc5233,null));};exports['show']=function(_0x3d2133,_0x240b8b){var _0x28e95e={'raw':![],'where':{'id':_0x3d2133[_0x82a2('0x56')]['id']},'include':[{'model':db[_0x82a2('0x38')],'as':_0x82a2('0x39')},{'model':db[_0x82a2('0x3a')],'as':_0x82a2('0x3b')},{'model':db[_0x82a2('0x3c')],'as':_0x82a2('0x3d')}]},_0x5d7bd6={};_0x5d7bd6[_0x82a2('0x46')]=_[_0x82a2('0x44')](db[_0x82a2('0x3f')]['rawAttributes']);_0x5d7bd6[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x3d2133[_0x82a2('0x43')]);_0x5d7bd6[_0x82a2('0x4d')]=_['intersection'](_0x5d7bd6[_0x82a2('0x46')],_0x5d7bd6['query']);_0x28e95e[_0x82a2('0x47')]=_[_0x82a2('0x45')](_0x5d7bd6[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x3d2133['query'][_0x82a2('0x48')]));_0x28e95e['attributes']=_0x28e95e[_0x82a2('0x47')][_0x82a2('0x57')]?_0x28e95e[_0x82a2('0x47')]:_0x5d7bd6[_0x82a2('0x46')];if(_0x3d2133['query'][_0x82a2('0x52')]){_0x28e95e[_0x82a2('0x53')]=[{'all':!![]}];}_0x28e95e=_[_0x82a2('0x4f')]({},_0x28e95e,_0x3d2133[_0x82a2('0x51')]);return db[_0x82a2('0x3f')]['find'](_0x28e95e)[_0x82a2('0x1d')](handleEntityNotFound(_0x240b8b,null))[_0x82a2('0x1d')](respondWithResult(_0x240b8b,null))['catch'](handleError(_0x240b8b,null));};exports['update']=function(_0x2f79bc,_0x5f1dcf){if(_0x2f79bc[_0x82a2('0x58')]['id']){delete _0x2f79bc[_0x82a2('0x58')]['id'];}return db[_0x82a2('0x3f')]['find']({'where':{'id':_0x2f79bc[_0x82a2('0x56')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x82a2('0x3a')],'as':_0x82a2('0x3b')},{'model':db[_0x82a2('0x3c')],'as':_0x82a2('0x3d')}]})[_0x82a2('0x1d')](handleEntityNotFound(_0x5f1dcf,null))['then'](saveUpdates(_0x2f79bc[_0x82a2('0x58')],null))[_0x82a2('0x1d')](function(_0x400923){if(_0x400923&&_0x2f79bc[_0x82a2('0x58')][_0x82a2('0x39')]){return db[_0x82a2('0x38')][_0x82a2('0x31')](_0x2f79bc[_0x82a2('0x58')][_0x82a2('0x39')],{'where':{'MailAccountId':_0x400923['id']}})[_0x82a2('0x1d')](function(){return _0x400923;});}return _0x400923;})[_0x82a2('0x1d')](function(_0x295f02){if(_0x295f02&&_0x2f79bc['body'][_0x82a2('0x3b')]){return db[_0x82a2('0x3a')]['update'](_0x2f79bc[_0x82a2('0x58')]['Smtp'],{'where':{'MailAccountId':_0x295f02['id']}})[_0x82a2('0x1d')](function(){return _0x295f02;});}return _0x295f02;})[_0x82a2('0x1d')](respondWithResult(_0x5f1dcf,null))[_0x82a2('0x25')](handleError(_0x5f1dcf,null));};exports[_0x82a2('0x59')]=function(_0x5f05a9,_0x37cff9){return db[_0x82a2('0x3f')][_0x82a2('0x59')]()[_0x82a2('0x1d')](respondWithResult(_0x37cff9,null))[_0x82a2('0x25')](handleError(_0x37cff9,null));};exports[_0x82a2('0x5a')]=function(_0x2da7d6,_0x30ef89,_0x54446d){if(_0x2da7d6[_0x82a2('0x58')]['id']){delete _0x2da7d6['body']['id'];}return db['MailAccount'][_0x82a2('0x5b')]({'where':{'id':_0x2da7d6[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x30ef89,null))[_0x82a2('0x1d')](function(_0x52506d){if(_0x52506d){_0x2da7d6[_0x82a2('0x58')]['MailAccountId']=_0x52506d['id'];return db['Disposition'][_0x82a2('0x5c')](_0x2da7d6[_0x82a2('0x58')]);}})[_0x82a2('0x1d')](respondWithResult(_0x30ef89,null))[_0x82a2('0x25')](handleError(_0x30ef89,null));};exports[_0x82a2('0x5d')]=function(_0x5bcb7d,_0x12df17,_0x481b58){var _0x28a26a={'raw':![],'where':{}};var _0x508389={};var _0x1853f3={'count':0x0,'rows':[]};return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x5bcb7d[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x12df17,null))[_0x82a2('0x1d')](function(_0x3d5e2d){if(_0x3d5e2d){_0x508389[_0x82a2('0x46')]=_[_0x82a2('0x44')](db['Disposition'][_0x82a2('0x5f')]);_0x508389[_0x82a2('0x43')]=_['keys'](_0x5bcb7d[_0x82a2('0x43')]);_0x508389[_0x82a2('0x4d')]=_['intersection'](_0x508389[_0x82a2('0x46')],_0x508389[_0x82a2('0x43')]);_0x28a26a[_0x82a2('0x47')]=_[_0x82a2('0x45')](_0x508389['model'],qs[_0x82a2('0x48')](_0x5bcb7d['query'][_0x82a2('0x48')]));_0x28a26a[_0x82a2('0x47')]=_0x28a26a['attributes'][_0x82a2('0x57')]?_0x28a26a[_0x82a2('0x47')]:_0x508389[_0x82a2('0x46')];if(!_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x60')](_0x82a2('0x49'))){_0x28a26a[_0x82a2('0x2c')]=qs[_0x82a2('0x2c')](_0x5bcb7d['query'][_0x82a2('0x2c')]);_0x28a26a[_0x82a2('0x2b')]=qs['offset'](_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x2b')]);}_0x28a26a['order']=qs[_0x82a2('0x4b')](_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x4b')]);_0x28a26a[_0x82a2('0x4c')]=qs[_0x82a2('0x4d')](_['pick'](_0x5bcb7d['query'],_0x508389['filters']));_0x28a26a[_0x82a2('0x4c')]['MailAccountId']=_0x3d5e2d['id'];if(_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x50')]){_0x28a26a[_0x82a2('0x4c')]=_[_0x82a2('0x4f')](_0x28a26a[_0x82a2('0x4c')],{'$or':_['map'](_0x28a26a['attributes'],function(_0xf2b03e){var _0x29df90={};_0x29df90[_0xf2b03e]={'$like':'%'+_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x50')]+'%'};return _0x29df90;})});}_0x28a26a=_[_0x82a2('0x4f')]({},_0x28a26a,_0x5bcb7d[_0x82a2('0x51')]);return db[_0x82a2('0x61')][_0x82a2('0x2a')]({'where':_0x28a26a[_0x82a2('0x4c')]})[_0x82a2('0x1d')](function(_0x1195ee){_0x1853f3[_0x82a2('0x2a')]=_0x1195ee;if(_0x5bcb7d[_0x82a2('0x43')][_0x82a2('0x52')]){_0x28a26a[_0x82a2('0x53')]=[{'all':!![]}];}return db[_0x82a2('0x61')]['findAll'](_0x28a26a);})[_0x82a2('0x1d')](function(_0x39c35b){_0x1853f3[_0x82a2('0x55')]=_0x39c35b;return _0x1853f3;});}})[_0x82a2('0x1d')](respondWithFilteredResult(_0x12df17,_0x28a26a))['catch'](handleError(_0x12df17,null));};exports[_0x82a2('0x62')]=function(_0x5a75d7,_0x50e3a5,_0x3fc713){return db['MailAccount'][_0x82a2('0x5b')]({'where':{'id':_0x5a75d7[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x50e3a5,null))[_0x82a2('0x1d')](function(_0x3bc3e5){if(_0x3bc3e5){return _0x3bc3e5[_0x82a2('0x62')](_0x5a75d7[_0x82a2('0x43')]['ids']);}})[_0x82a2('0x1d')](respondWithStatusCode(_0x50e3a5,null))[_0x82a2('0x25')](handleError(_0x50e3a5,null));};exports[_0x82a2('0x63')]=function(_0x4cc0a6,_0xb9450b,_0x32f842){if(_0x4cc0a6[_0x82a2('0x58')]['id']){delete _0x4cc0a6[_0x82a2('0x58')]['id'];}return db['MailAccount'][_0x82a2('0x5b')]({'where':{'id':_0x4cc0a6['params']['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0xb9450b,null))['then'](function(_0x3993b4){if(_0x3993b4){_0x4cc0a6['body'][_0x82a2('0x64')]=_0x3993b4['id'];return db[_0x82a2('0x65')]['create'](_0x4cc0a6[_0x82a2('0x58')]);}})[_0x82a2('0x1d')](respondWithResult(_0xb9450b,null))[_0x82a2('0x25')](handleError(_0xb9450b,null));};exports['getAnswers']=function(_0x328982,_0x469be5,_0x55333d){var _0x2e4a76={'raw':![],'where':{}};var _0x12e269={};var _0x531a46={'count':0x0,'rows':[]};return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x328982[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x469be5,null))[_0x82a2('0x1d')](function(_0x3ff537){if(_0x3ff537){_0x12e269[_0x82a2('0x46')]=_[_0x82a2('0x44')](db[_0x82a2('0x65')]['rawAttributes']);_0x12e269[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x328982[_0x82a2('0x43')]);_0x12e269['filters']=_[_0x82a2('0x45')](_0x12e269['model'],_0x12e269[_0x82a2('0x43')]);_0x2e4a76[_0x82a2('0x47')]=_[_0x82a2('0x45')](_0x12e269[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x328982[_0x82a2('0x43')][_0x82a2('0x48')]));_0x2e4a76[_0x82a2('0x47')]=_0x2e4a76[_0x82a2('0x47')][_0x82a2('0x57')]?_0x2e4a76['attributes']:_0x12e269['model'];if(!_0x328982[_0x82a2('0x43')][_0x82a2('0x60')](_0x82a2('0x49'))){_0x2e4a76['limit']=qs['limit'](_0x328982[_0x82a2('0x43')][_0x82a2('0x2c')]);_0x2e4a76['offset']=qs[_0x82a2('0x2b')](_0x328982[_0x82a2('0x43')][_0x82a2('0x2b')]);}_0x2e4a76[_0x82a2('0x4a')]=qs['sort'](_0x328982[_0x82a2('0x43')][_0x82a2('0x4b')]);_0x2e4a76[_0x82a2('0x4c')]=qs['filters'](_[_0x82a2('0x4e')](_0x328982[_0x82a2('0x43')],_0x12e269[_0x82a2('0x4d')]));_0x2e4a76[_0x82a2('0x4c')][_0x82a2('0x64')]=_0x3ff537['id'];if(_0x328982[_0x82a2('0x43')]['filter']){_0x2e4a76['where']=_['merge'](_0x2e4a76[_0x82a2('0x4c')],{'$or':_[_0x82a2('0x3e')](_0x2e4a76[_0x82a2('0x47')],function(_0x50ddbc){var _0x15ccca={};_0x15ccca[_0x50ddbc]={'$like':'%'+_0x328982[_0x82a2('0x43')][_0x82a2('0x50')]+'%'};return _0x15ccca;})});}_0x2e4a76=_['merge']({},_0x2e4a76,_0x328982[_0x82a2('0x51')]);return db[_0x82a2('0x65')][_0x82a2('0x2a')]({'where':_0x2e4a76[_0x82a2('0x4c')]})[_0x82a2('0x1d')](function(_0x128ea5){_0x531a46[_0x82a2('0x2a')]=_0x128ea5;if(_0x328982[_0x82a2('0x43')][_0x82a2('0x52')]){_0x2e4a76['include']=[{'all':!![]}];}return db[_0x82a2('0x65')][_0x82a2('0x54')](_0x2e4a76);})[_0x82a2('0x1d')](function(_0x43fb79){_0x531a46[_0x82a2('0x55')]=_0x43fb79;return _0x531a46;});}})[_0x82a2('0x1d')](respondWithFilteredResult(_0x469be5,_0x2e4a76))[_0x82a2('0x25')](handleError(_0x469be5,null));};exports['removeAnswers']=function(_0x1c18f9,_0x308ba3,_0x163227){return db[_0x82a2('0x3f')][_0x82a2('0x5b')]({'where':{'id':_0x1c18f9[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x308ba3,null))[_0x82a2('0x1d')](function(_0x211491){if(_0x211491){return _0x211491[_0x82a2('0x66')](_0x1c18f9[_0x82a2('0x43')][_0x82a2('0x67')]);}})[_0x82a2('0x1d')](respondWithStatusCode(_0x308ba3,null))[_0x82a2('0x25')](handleError(_0x308ba3,null));};exports[_0x82a2('0x5c')]=function(_0x2a942c,_0x2beaaa){var _0x14ae65={'name':_0x2a942c[_0x82a2('0x58')][_0x82a2('0x35')],'key':_0x2a942c[_0x82a2('0x58')]['key'],'email':_0x2a942c['body'][_0x82a2('0x68')],'ListId':_0x2a942c[_0x82a2('0x58')][_0x82a2('0x69')],'active':!_['isNil'](_0x2a942c[_0x82a2('0x58')]['active'])?_0x2a942c['body'][_0x82a2('0x6a')]:!![],'description':_0x2a942c[_0x82a2('0x58')][_0x82a2('0x6b')]||null,'Imap':{},'Smtp':{}};if(_[_0x82a2('0x6c')](_0x2a942c['body'][_0x82a2('0x6d')])){if(_0x2a942c[_0x82a2('0x58')][_0x82a2('0x6e')]){_0x14ae65[_0x82a2('0x39')][_0x82a2('0x6f')]=_0x14ae65['Smtp']['user']=_0x2a942c[_0x82a2('0x58')][_0x82a2('0x70')];_0x14ae65[_0x82a2('0x39')][_0x82a2('0x71')]=_0x14ae65[_0x82a2('0x3b')][_0x82a2('0x72')]=_0x2a942c[_0x82a2('0x58')][_0x82a2('0x73')];}else{_0x14ae65['Imap'][_0x82a2('0x74')]=_0x14ae65[_0x82a2('0x3b')][_0x82a2('0x74')]=![];}_0x14ae65[_0x82a2('0x39')][_0x82a2('0x75')]=_0x2a942c[_0x82a2('0x58')][_0x82a2('0x39')][_0x82a2('0x75')];_0x14ae65[_0x82a2('0x39')][_0x82a2('0x76')]=_0x2a942c[_0x82a2('0x58')][_0x82a2('0x39')][_0x82a2('0x76')];_0x14ae65['Smtp'][_0x82a2('0x75')]=_0x2a942c[_0x82a2('0x58')][_0x82a2('0x3b')][_0x82a2('0x75')];_0x14ae65[_0x82a2('0x3b')][_0x82a2('0x76')]=_0x2a942c['body'][_0x82a2('0x3b')][_0x82a2('0x76')];}else{_0x14ae65[_0x82a2('0x39')][_0x82a2('0x77')]=_0x14ae65['Smtp'][_0x82a2('0x77')]=_0x2a942c[_0x82a2('0x58')]['cservice'];_0x14ae65['Imap'][_0x82a2('0x6f')]=_0x14ae65[_0x82a2('0x3b')][_0x82a2('0x6f')]=_0x2a942c[_0x82a2('0x58')]['cuser'];_0x14ae65[_0x82a2('0x39')]['password']=_0x14ae65[_0x82a2('0x3b')][_0x82a2('0x72')]=_0x2a942c['body'][_0x82a2('0x73')];}return db[_0x82a2('0x3f')][_0x82a2('0x5c')](_0x14ae65,{'include':[{'model':db['MailServerOut'],'as':_0x82a2('0x3b')},{'model':db[_0x82a2('0x38')],'as':'Imap'}]})[_0x82a2('0x1d')](function(_0x3ac025){var _0x26b619=_0x2a942c[_0x82a2('0x6f')][_0x82a2('0x78')]({'plain':!![]});if(!_0x26b619)throw new Error(_0x82a2('0x79'));if(_0x26b619[_0x82a2('0x7a')]===_0x82a2('0x6f')){var _0x5501ed=_0x3ac025[_0x82a2('0x78')]({'plain':!![]});return db[_0x82a2('0x7b')]['find']({'where':{'name':_0x82a2('0x32'),'userProfileId':_0x26b619['userProfileId']},'raw':!![]})['then'](function(_0x1d2438){if(_0x1d2438&&_0x1d2438[_0x82a2('0x7c')]===0x0){return db[_0x82a2('0x7d')]['create']({'name':_0x5501ed[_0x82a2('0x35')],'resourceId':_0x5501ed['id'],'type':_0x1d2438['name'],'sectionId':_0x1d2438['id']},{})['then'](function(){return _0x3ac025;});}else{return _0x3ac025;}})['catch'](function(_0x187735){logger[_0x82a2('0x23')](_0x82a2('0x7e'),_0x187735);throw _0x187735;});}return _0x3ac025;})[_0x82a2('0x1d')](respondWithResult(_0x2beaaa,0xc9))[_0x82a2('0x25')](handleError(_0x2beaaa,null));};exports[_0x82a2('0x7f')]=function(_0x4993b8,_0x400844,_0x7d9e67){return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x4993b8[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x400844,null))[_0x82a2('0x1d')](function(_0x428fc5){if(_0x428fc5){return _0x428fc5[_0x82a2('0x7f')]();}return null;})[_0x82a2('0x1d')](respondWithResult(_0x400844,null))[_0x82a2('0x25')](handleError(_0x400844,null));};exports['addImap']=function(_0x345af4,_0x286968,_0x5f5c30){if(_0x345af4['body']['id']){delete _0x345af4[_0x82a2('0x58')]['id'];}return db[_0x82a2('0x3f')][_0x82a2('0x5b')]({'where':{'id':_0x345af4[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x286968,null))['then'](function(_0x4e840b){if(_0x4e840b){_0x345af4[_0x82a2('0x58')]['MailAccountId']=_0x4e840b['id'];return db['MailServerIn'][_0x82a2('0x5c')](_0x345af4['body']);}})[_0x82a2('0x1d')](respondWithResult(_0x286968,null))[_0x82a2('0x25')](handleError(_0x286968,null));};exports[_0x82a2('0x80')]=function(_0x5c4cea,_0x5b61c7,_0x2622e1){return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x5c4cea[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x5b61c7,null))[_0x82a2('0x1d')](function(_0x5b41a0){if(_0x5b41a0){return _0x5b41a0['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x5b61c7,null))['catch'](handleError(_0x5b61c7,null));};exports[_0x82a2('0x81')]=function(_0x285f90,_0x5c3081,_0x143198){return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x285f90[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x5c3081,null))['then'](function(_0x347314){if(_0x347314){return _0x347314[_0x82a2('0x81')]();}return null;})['then'](respondWithResult(_0x5c3081,null))[_0x82a2('0x25')](handleError(_0x5c3081,null));};exports[_0x82a2('0x82')]=function(_0x12d575,_0x18e3ba,_0xfaecd3){if(_0x12d575[_0x82a2('0x58')]['id']){delete _0x12d575[_0x82a2('0x58')]['id'];}return db['MailAccount'][_0x82a2('0x5b')]({'where':{'id':_0x12d575['params']['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x18e3ba,null))['then'](function(_0x4d60b7){if(_0x4d60b7){_0x12d575[_0x82a2('0x58')][_0x82a2('0x64')]=_0x4d60b7['id'];return db[_0x82a2('0x3a')][_0x82a2('0x5c')](_0x12d575[_0x82a2('0x58')]);}})[_0x82a2('0x1d')](respondWithResult(_0x18e3ba,null))['catch'](handleError(_0x18e3ba,null));};exports[_0x82a2('0x83')]=function(_0x405b4c,_0x29c530,_0x3e7ae7){return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x405b4c[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x29c530,null))['then'](function(_0x592905){if(_0x592905){return _0x592905['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x29c530,null))['catch'](handleError(_0x29c530,null));};exports[_0x82a2('0x84')]=function(_0x5b0022,_0x4d2132,_0x2ca70e){return db[_0x82a2('0x85')][_0x82a2('0x5b')]({'where':{'id':_0x5b0022['params']['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x4d2132,null))[_0x82a2('0x1d')](function(_0xd1d3e3){if(_0xd1d3e3){return _0xd1d3e3[_0x82a2('0x84')](_0x5b0022[_0x82a2('0x58')][_0x82a2('0x67')],_[_0x82a2('0x86')](_0x5b0022['body'],[_0x82a2('0x67'),'id'])||{});}})[_0x82a2('0x1d')](respondWithResult(_0x4d2132,null))[_0x82a2('0x25')](handleError(_0x4d2132,null));};exports[_0x82a2('0x87')]=function(_0x29b756,_0x1ee999,_0x4f55e6){var _0x27ee1f={'raw':![],'where':{}};var _0x5a88cc={};var _0x28f330={'count':0x0,'rows':[]};return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x29b756['params']['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x1ee999,null))[_0x82a2('0x1d')](function(_0x5453b8){if(_0x5453b8){_0x5a88cc['model']=_[_0x82a2('0x44')](db[_0x82a2('0x85')]['rawAttributes']);_0x5a88cc[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x29b756['query']);_0x5a88cc[_0x82a2('0x4d')]=_[_0x82a2('0x45')](_0x5a88cc['model'],_0x5a88cc[_0x82a2('0x43')]);_0x27ee1f[_0x82a2('0x47')]=_[_0x82a2('0x45')](_0x5a88cc[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x29b756[_0x82a2('0x43')][_0x82a2('0x48')]));_0x27ee1f[_0x82a2('0x47')]=_0x27ee1f['attributes'][_0x82a2('0x57')]?_0x27ee1f[_0x82a2('0x47')]:_0x5a88cc[_0x82a2('0x46')];if(!_0x29b756[_0x82a2('0x43')][_0x82a2('0x60')](_0x82a2('0x49'))){_0x27ee1f[_0x82a2('0x2c')]=qs[_0x82a2('0x2c')](_0x29b756[_0x82a2('0x43')]['limit']);_0x27ee1f[_0x82a2('0x2b')]=qs[_0x82a2('0x2b')](_0x29b756[_0x82a2('0x43')][_0x82a2('0x2b')]);}_0x27ee1f[_0x82a2('0x4a')]=qs[_0x82a2('0x4b')](_0x29b756[_0x82a2('0x43')][_0x82a2('0x4b')]);_0x27ee1f[_0x82a2('0x4c')]=qs['filters'](_['pick'](_0x29b756[_0x82a2('0x43')],_0x5a88cc[_0x82a2('0x4d')]));_0x27ee1f['where'][_0x82a2('0x64')]=_0x5453b8['id'];if(_0x29b756[_0x82a2('0x43')][_0x82a2('0x50')]){_0x27ee1f['where']=_[_0x82a2('0x4f')](_0x27ee1f[_0x82a2('0x4c')],{'$or':_[_0x82a2('0x3e')](_0x27ee1f[_0x82a2('0x47')],function(_0x34640c){var _0x309ba5={};_0x309ba5[_0x34640c]={'$like':'%'+_0x29b756['query']['filter']+'%'};return _0x309ba5;})});}_0x27ee1f=_['merge']({},_0x27ee1f,_0x29b756[_0x82a2('0x51')]);return db['MailInteraction'][_0x82a2('0x2a')]({'where':_0x27ee1f['where']})['then'](function(_0x1e4d4a){_0x28f330[_0x82a2('0x2a')]=_0x1e4d4a;if(_0x29b756[_0x82a2('0x43')]['includeAll']){_0x27ee1f[_0x82a2('0x53')]=[{'model':db[_0x82a2('0x88')],'as':_0x82a2('0x89'),'required':![]},{'model':db[_0x82a2('0x8a')],'as':_0x82a2('0x8b'),'attributes':[_0x82a2('0x35'),_0x82a2('0x8c'),_0x82a2('0x8d')],'required':![]},{'model':db['Tag'],'as':_0x82a2('0x8e'),'attributes':['id','name',_0x82a2('0x8f')],'where':_0x29b756[_0x82a2('0x43')][_0x82a2('0x90')]?{'id':_0x29b756['query'][_0x82a2('0x90')]}:undefined,'required':_0x29b756['query'][_0x82a2('0x90')]?!![]:![]}];}return db[_0x82a2('0x85')]['findAll'](_0x27ee1f);})[_0x82a2('0x1d')](function(_0x14ce81){_0x28f330[_0x82a2('0x55')]=_0x14ce81;return _0x28f330;});}})[_0x82a2('0x1d')](respondWithFilteredResult(_0x1ee999,_0x27ee1f))['catch'](handleError(_0x1ee999,null));};exports[_0x82a2('0x91')]=function(_0x11c3d7,_0x100dc5,_0x41b88c){return db['MailAccount']['findOne']({'where':{'id':_0x11c3d7[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x100dc5,null))[_0x82a2('0x1d')](function(_0x414c02){if(_0x414c02){return db[_0x82a2('0x92')][_0x82a2('0x93')](function(_0x211ad1){return db[_0x82a2('0x94')][_0x82a2('0x33')]({'where':{'MailAccountId':_0x11c3d7[_0x82a2('0x56')]['id']},'transaction':_0x211ad1})[_0x82a2('0x1d')](function(_0x2c23a5){var _0x4a8558=_[_0x82a2('0x3e')](_0x11c3d7['body'],function(_0x134219){_0x134219[_0x82a2('0x64')]=_0x11c3d7[_0x82a2('0x56')]['id'];return _0x134219;});return db['MailApplication'][_0x82a2('0x95')](_0x4a8558,{'transaction':_0x211ad1});});})['then'](function(){return db[_0x82a2('0x94')][_0x82a2('0x96')]({'where':{'MailAccountId':_0x11c3d7[_0x82a2('0x56')]['id']},'order':_0x82a2('0x97')});});}})['then'](respondWithResult(_0x100dc5,null))[_0x82a2('0x25')](handleError(_0x100dc5,null));};exports[_0x82a2('0x98')]=function(_0x914eda,_0x577603,_0x363c7d){var _0x490603={};var _0x1cc14d={};var _0x1b17b4;var _0x2bdb17;return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x914eda[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x577603,null))[_0x82a2('0x1d')](function(_0x7f145c){if(_0x7f145c){_0x1b17b4=_0x7f145c;_0x1cc14d[_0x82a2('0x46')]=_[_0x82a2('0x44')](db['MailApplication'][_0x82a2('0x5f')]);_0x1cc14d[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x914eda[_0x82a2('0x43')]);_0x1cc14d[_0x82a2('0x4d')]=_[_0x82a2('0x45')](_0x1cc14d[_0x82a2('0x46')],_0x1cc14d[_0x82a2('0x43')]);_0x490603[_0x82a2('0x47')]=_['intersection'](_0x1cc14d[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x914eda[_0x82a2('0x43')][_0x82a2('0x48')]));_0x490603[_0x82a2('0x47')]=_0x490603['attributes'][_0x82a2('0x57')]?_0x490603[_0x82a2('0x47')]:_0x1cc14d[_0x82a2('0x46')];_0x490603[_0x82a2('0x4a')]=qs[_0x82a2('0x4b')](_0x914eda['query']['sort']);_0x490603[_0x82a2('0x4c')]=qs['filters'](_[_0x82a2('0x4e')](_0x914eda[_0x82a2('0x43')],_0x1cc14d[_0x82a2('0x4d')]));if(_0x914eda['query'][_0x82a2('0x50')]){_0x490603[_0x82a2('0x4c')]=_[_0x82a2('0x4f')](_0x490603['where'],{'$or':_[_0x82a2('0x3e')](_0x490603[_0x82a2('0x47')],function(_0x5bfdaf){var _0x371b75={};_0x371b75[_0x5bfdaf]={'$like':'%'+_0x914eda[_0x82a2('0x43')][_0x82a2('0x50')]+'%'};return _0x371b75;})});}_0x490603=_[_0x82a2('0x4f')]({},_0x490603,_0x914eda[_0x82a2('0x51')]);return _0x1b17b4[_0x82a2('0x98')](_0x490603);}})[_0x82a2('0x1d')](function(_0x59b469){if(_0x59b469){_0x2bdb17=_0x59b469[_0x82a2('0x57')];if(!_0x914eda[_0x82a2('0x43')]['hasOwnProperty'](_0x82a2('0x49'))){_0x490603[_0x82a2('0x2c')]=qs[_0x82a2('0x2c')](_0x914eda[_0x82a2('0x43')][_0x82a2('0x2c')]);_0x490603[_0x82a2('0x2b')]=qs[_0x82a2('0x2b')](_0x914eda[_0x82a2('0x43')]['offset']);}return _0x1b17b4[_0x82a2('0x98')](_0x490603);}})[_0x82a2('0x1d')](function(_0x23ef7b){if(_0x23ef7b){return _0x23ef7b?{'count':_0x2bdb17,'rows':_0x23ef7b}:null;}})[_0x82a2('0x1d')](respondWithResult(_0x577603,null))['catch'](handleError(_0x577603,null));};exports[_0x82a2('0x99')]=function(_0x5edc37,_0x971356,_0x2e1d65){var _0x5c0605={'raw':!![],'where':{}};var _0x467d8c={};var _0x367737={'count':0x0,'rows':[]};return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x5edc37['params']['id']}})['then'](handleEntityNotFound(_0x971356,null))['then'](function(_0x1bed55){if(_0x1bed55){_0x467d8c['model']=_['keys'](db['MailMessage'][_0x82a2('0x5f')]);_0x467d8c[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x5edc37['query']);_0x467d8c[_0x82a2('0x4d')]=_[_0x82a2('0x45')](_0x467d8c[_0x82a2('0x46')],_0x467d8c[_0x82a2('0x43')]);_0x5c0605[_0x82a2('0x47')]=_['intersection'](_0x467d8c[_0x82a2('0x46')],qs[_0x82a2('0x48')](_0x5edc37[_0x82a2('0x43')]['fields']));_0x5c0605[_0x82a2('0x47')]=_0x5c0605['attributes'][_0x82a2('0x57')]?_0x5c0605['attributes']:_0x467d8c[_0x82a2('0x46')];if(!_0x5edc37[_0x82a2('0x43')][_0x82a2('0x60')](_0x82a2('0x49'))){_0x5c0605['limit']=qs[_0x82a2('0x2c')](_0x5edc37[_0x82a2('0x43')][_0x82a2('0x2c')]);_0x5c0605[_0x82a2('0x2b')]=qs[_0x82a2('0x2b')](_0x5edc37['query'][_0x82a2('0x2b')]);}_0x5c0605['order']=qs[_0x82a2('0x4b')](_0x5edc37['query']['sort']);_0x5c0605[_0x82a2('0x4c')]=qs['filters'](_[_0x82a2('0x4e')](_0x5edc37[_0x82a2('0x43')],_0x467d8c[_0x82a2('0x4d')]));_0x5c0605[_0x82a2('0x4c')][_0x82a2('0x64')]=_0x1bed55['id'];if(_0x5edc37['query'][_0x82a2('0x50')]){_0x5c0605[_0x82a2('0x4c')]=_[_0x82a2('0x4f')](_0x5c0605['where'],{'$or':_[_0x82a2('0x3e')](_0x5c0605['attributes'],function(_0x27787e){var _0x20e3be={};_0x20e3be[_0x27787e]={'$like':'%'+_0x5edc37[_0x82a2('0x43')][_0x82a2('0x50')]+'%'};return _0x20e3be;})});}if(_0x5edc37[_0x82a2('0x43')][_0x82a2('0x9a')]){var _0x5bffb4=_0x5edc37[_0x82a2('0x43')]['$gte'][_0x82a2('0x9b')](',');var _0x13b22e={};_0x13b22e[_0x5bffb4[0x0]]={'$gte':moment(_0x5bffb4[0x1])[_0x82a2('0x9c')](_0x82a2('0x9d'))};_0x5c0605[_0x82a2('0x4c')]=_['merge'](_0x5c0605[_0x82a2('0x4c')],_0x13b22e);}_0x5c0605=_[_0x82a2('0x4f')]({},_0x5c0605,_0x5edc37['options']);return db[_0x82a2('0x9e')][_0x82a2('0x2a')]({'where':_0x5c0605[_0x82a2('0x4c')]})[_0x82a2('0x1d')](function(_0x12a94f){_0x367737[_0x82a2('0x2a')]=_0x12a94f;if(_0x5edc37[_0x82a2('0x43')][_0x82a2('0x52')]){_0x5c0605[_0x82a2('0x53')]=[{'all':!![]}];}return db['MailMessage'][_0x82a2('0x54')](_0x5c0605);})[_0x82a2('0x1d')](function(_0x34fd66){if(_0x5edc37['query'][_0x82a2('0x9f')]===_0x82a2('0xa0')){for(var _0x5ab7c4=0x0;_0x5ab7c4<_0x34fd66[_0x82a2('0x57')];_0x5ab7c4++){_0x34fd66[_0x5ab7c4][_0x82a2('0x58')]=juice(_0x34fd66[_0x5ab7c4]['body']);}}_0x367737[_0x82a2('0x55')]=_0x34fd66;return _0x367737;});}})[_0x82a2('0x1d')](respondWithFilteredResult(_0x971356,_0x5c0605))[_0x82a2('0x25')](handleError(_0x971356,null));};exports[_0x82a2('0x36')]=function(_0x418f89,_0x133635,_0x4fa891){var _0x51c61f,_0x331c94={},_0x387b29;if(_0x418f89[_0x82a2('0x58')]['to']){_0x387b29=_0x418f89[_0x82a2('0x58')]['to'][_0x82a2('0x9b')](',')[0x0];}return db[_0x82a2('0x3f')][_0x82a2('0x5b')]({'where':{'id':_0x418f89['params']['id']},'include':[{'model':db['CmList'],'as':_0x82a2('0xa1'),'include':[{'model':db[_0x82a2('0x88')],'as':_0x82a2('0xa2'),'where':{'email':_0x387b29},'limit':0x1,'order':[[_0x82a2('0xa3'),_0x82a2('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0x82a2('0x3b'),'raw':!![]}]})['then'](handleEntityNotFound(_0x133635,null))[_0x82a2('0x1d')](function(_0x205d15){if(_0x205d15){_0x51c61f=_0x205d15;if(_0x205d15[_0x82a2('0x3b')]){if(_['isNil'](_0x418f89[_0x82a2('0x58')]['from'])){_0x418f89[_0x82a2('0x58')][_0x82a2('0xa5')]=util[_0x82a2('0x9c')]('%s\x20<%s>',_0x205d15[_0x82a2('0x35')],_0x205d15[_0x82a2('0x68')]||_0x205d15['Smtp'][_0x82a2('0x6f')]);}if(_0x418f89[_0x82a2('0x58')][_0x82a2('0xa6')]&&_0x418f89[_0x82a2('0x58')][_0x82a2('0xa6')][_0x82a2('0x57')]){for(var _0x4e3c3=0x0;_0x4e3c3<_0x418f89[_0x82a2('0x58')]['attachments'][_0x82a2('0x57')];_0x4e3c3+=0x1){_0x418f89['body']['attachments'][_0x4e3c3]={'filename':_0x418f89[_0x82a2('0x58')][_0x82a2('0xa6')][_0x4e3c3][_0x82a2('0x35')],'path':path[_0x82a2('0xa7')](config['root'],_0x82a2('0xa8'),_0x418f89[_0x82a2('0x58')][_0x82a2('0xa6')][_0x4e3c3][_0x82a2('0xa9')])};}}var _0x3d1eca={'tls':{'rejectUnauthorized':![]}};if(_[_0x82a2('0x6c')](_0x205d15[_0x82a2('0x3b')][_0x82a2('0x77')])){if(_0x205d15[_0x82a2('0x3b')][_0x82a2('0x74')]){_0x3d1eca[_0x82a2('0xaa')]={'user':_0x205d15[_0x82a2('0x3b')][_0x82a2('0x6f')],'pass':_0x205d15[_0x82a2('0x3b')][_0x82a2('0x72')]};}_0x3d1eca[_0x82a2('0x75')]=_0x205d15['Smtp']['host'];_0x3d1eca[_0x82a2('0x76')]=_0x205d15[_0x82a2('0x3b')]['port'];_0x3d1eca['secure']=_0x205d15[_0x82a2('0x3b')]['secure'];}else{_0x3d1eca['service']=_0x205d15['Smtp'][_0x82a2('0x77')];_0x3d1eca[_0x82a2('0xaa')]={'user':_0x205d15[_0x82a2('0x3b')][_0x82a2('0x6f')],'pass':_0x205d15[_0x82a2('0x3b')][_0x82a2('0x72')]};}return respondWithRpcPromise(_0x82a2('0xab'),_0x82a2('0xac'),{'account':_0x3d1eca,'message':_0x418f89[_0x82a2('0x58')]});}else{throw new Error(_0x82a2('0xad'));}}})[_0x82a2('0x1d')](function(_0x588c85){if(_0x588c85){_0x331c94=_0x588c85;if(_0x51c61f[_0x82a2('0xa1')]){if(_0x51c61f[_0x82a2('0xa1')][_0x82a2('0xa2')]['length']){return _0x51c61f['List'][_0x82a2('0xa2')][0x0];}else{return db[_0x82a2('0x88')][_0x82a2('0x5c')](_[_0x82a2('0x18')](_0x418f89['body'],{'firstName':_0x418f89[_0x82a2('0x58')]['to'],'email':_0x418f89[_0x82a2('0x58')]['to'],'phone':_0x418f89[_0x82a2('0x58')]['to'],'ListId':_0x51c61f[_0x82a2('0x69')]}));}}else{throw new Error(_0x82a2('0xad'));}}})[_0x82a2('0x1d')](function(_0x470d4e){if(_0x470d4e){var _0x27fae1={'UserId':_0x418f89[_0x82a2('0x6f')]['id'],'ContactId':_0x470d4e['id'],'MailAccountId':_0x51c61f['id'],'inReplyTo':_0x331c94[_0x82a2('0xae')],'to':_0x418f89[_0x82a2('0x58')][_0x82a2('0xa5')],'cc':_0x418f89[_0x82a2('0x58')]['cc'],'subject':_0x418f89['body'][_0x82a2('0xaf')],'attach':_0x418f89[_0x82a2('0x58')][_0x82a2('0xb0')],'firstMsgDirection':_0x82a2('0xb1'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x82a2('0xb1'),'Messages':[_[_0x82a2('0x4f')](_0x418f89[_0x82a2('0x58')],{'messageId':_0x331c94[_0x82a2('0xae')],'sentAt':moment()[_0x82a2('0x9c')](_0x82a2('0x9d')),'read':!![],'MailAccountId':_0x51c61f['id'],'UserId':_0x418f89['user']['id'],'ContactId':_0x470d4e['id']})]};if(_0x418f89['body']['Interaction']){_0x27fae1=_[_0x82a2('0x4f')](_0x27fae1,_0x418f89[_0x82a2('0x58')][_0x82a2('0xb2')]);}return db[_0x82a2('0x85')][_0x82a2('0x5c')](_0x27fae1,{'include':[{'model':db[_0x82a2('0x9e')],'as':_0x82a2('0xb3')}]});}})['then'](respondWithResult(_0x133635,null))[_0x82a2('0x25')](handleError(_0x133635,null));};exports[_0x82a2('0xb4')]=function(_0x4b3fc8,_0x1104d9,_0x3fc323){return db[_0x82a2('0x3f')]['find']({'where':{'id':_0x4b3fc8[_0x82a2('0x56')]['id']},'include':[{'model':db[_0x82a2('0x3a')],'as':'Smtp','raw':!![]}]})[_0x82a2('0x1d')](handleEntityNotFound(_0x1104d9,null))['then'](function(_0x551c89){if(_0x551c89&&_0x551c89['Smtp']){var _0xecc292={'id':_0x551c89['id'],'tls':{'rejectUnauthorized':![]}};if(_0x551c89['Smtp'][_0x82a2('0x77')]){_0xecc292[_0x82a2('0x77')]=_0x551c89[_0x82a2('0x3b')][_0x82a2('0x77')];}else{_0xecc292[_0x82a2('0x75')]=_0x551c89['Smtp'][_0x82a2('0x75')];_0xecc292[_0x82a2('0x76')]=_0x551c89['Smtp']['port'];_0xecc292[_0x82a2('0xb5')]=_0x551c89[_0x82a2('0x3b')][_0x82a2('0xb5')];}if(_0x551c89[_0x82a2('0x3b')][_0x82a2('0x74')]){_0xecc292[_0x82a2('0xaa')]={'user':_0x551c89[_0x82a2('0x3b')][_0x82a2('0x6f')],'pass':_0x551c89[_0x82a2('0x3b')]['pass']};}return respondWithRpcPromise(_0x82a2('0xb6'),_0x82a2('0xb4'),{'account':_0xecc292});}})['then'](respondWithResult(_0x1104d9,null))[_0x82a2('0x25')](handleError(_0x1104d9,null));};exports[_0x82a2('0x33')]=function(_0x5332b5,_0xf90712){return db['MailAccount'][_0x82a2('0x5b')]({'where':{'id':_0x5332b5[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0xf90712,null))[_0x82a2('0x1d')](function(_0xc7444f){if(_0xc7444f&&_0xc7444f[_0x82a2('0x77')]){throw new db['Sequelize'][(_0x82a2('0xb7'))](_0x82a2('0xb8'));}return _0xc7444f;})[_0x82a2('0x1d')](removeEntity(_0xf90712,null))[_0x82a2('0x25')](handleError(_0xf90712,null));};exports[_0x82a2('0xb9')]=function(_0x43c7f9,_0x49abe2,_0x4a8944){return db[_0x82a2('0x3f')]['find']({'where':{'id':_0x43c7f9[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x49abe2,null))[_0x82a2('0x1d')](function(_0x23ef43){if(_0x23ef43){return _0x23ef43[_0x82a2('0xb9')](_0x43c7f9[_0x82a2('0x58')][_0x82a2('0x67')],_[_0x82a2('0x86')](_0x43c7f9['body'],[_0x82a2('0x67'),'id'])||{})[_0x82a2('0xba')](function(_0x391c60){for(var _0x3b2011=0x0;_0x3b2011<_0x43c7f9[_0x82a2('0x58')]['ids']['length'];_0x3b2011+=0x1){socket['emit'](_0x82a2('0xbb'),{'UserId':Number(_0x43c7f9['body'][_0x82a2('0x67')][_0x3b2011]),'MailAccountId':Number(_0x43c7f9[_0x82a2('0x56')]['id'])});}return _0x391c60;});}})[_0x82a2('0x1d')](respondWithResult(_0x49abe2,null))[_0x82a2('0x25')](handleError(_0x49abe2,null));};exports[_0x82a2('0xbc')]=function(_0x4bad1b,_0xe41535,_0x3f4886){return db['MailAccount']['find']({'where':{'id':_0x4bad1b[_0x82a2('0x56')]['id']}})['then'](handleEntityNotFound(_0xe41535,null))['then'](function(_0x4bbe91){if(_0x4bbe91){return _0x4bbe91[_0x82a2('0xbc')](_0x4bad1b[_0x82a2('0x43')][_0x82a2('0x67')])[_0x82a2('0x1d')](function(){if(_[_0x82a2('0xbd')](_0x4bad1b[_0x82a2('0x43')][_0x82a2('0x67')])){for(var _0x4aa639=0x0;_0x4aa639<_0x4bad1b[_0x82a2('0x43')][_0x82a2('0x67')][_0x82a2('0x57')];_0x4aa639+=0x1){socket[_0x82a2('0xbe')](_0x82a2('0xbf'),{'UserId':Number(_0x4bad1b[_0x82a2('0x43')][_0x82a2('0x67')][_0x4aa639]),'MailAccountId':Number(_0x4bad1b['params']['id'])});}}else{socket[_0x82a2('0xbe')](_0x82a2('0xbf'),{'UserId':Number(_0x4bad1b['query'][_0x82a2('0x67')]),'MailAccountId':Number(_0x4bad1b['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe41535,null))[_0x82a2('0x25')](handleError(_0xe41535,null));};exports['getAgents']=function(_0x47eedb,_0x30bf7a,_0x502b68){var _0x17e69d={};var _0x94958e={};var _0x49d817;var _0x19091f;return db[_0x82a2('0x3f')][_0x82a2('0x5e')]({'where':{'id':_0x47eedb[_0x82a2('0x56')]['id']}})[_0x82a2('0x1d')](handleEntityNotFound(_0x30bf7a,null))[_0x82a2('0x1d')](function(_0xada777){if(_0xada777){_0x49d817=_0xada777;_0x94958e[_0x82a2('0x46')]=_[_0x82a2('0x44')](db[_0x82a2('0x8a')][_0x82a2('0x5f')]);_0x94958e[_0x82a2('0x43')]=_[_0x82a2('0x44')](_0x47eedb[_0x82a2('0x43')]);_0x94958e[_0x82a2('0x4d')]=_[_0x82a2('0x45')](_0x94958e[_0x82a2('0x46')],_0x94958e[_0x82a2('0x43')]);_0x17e69d[_0x82a2('0x47')]=_['intersection'](_0x94958e[_0x82a2('0x46')],qs['fields'](_0x47eedb[_0x82a2('0x43')][_0x82a2('0x48')]));_0x17e69d[_0x82a2('0x47')]=_0x17e69d['attributes'][_0x82a2('0x57')]?_0x17e69d[_0x82a2('0x47')]:_0x94958e[_0x82a2('0x46')];_0x17e69d[_0x82a2('0x4a')]=qs['sort'](_0x47eedb[_0x82a2('0x43')][_0x82a2('0x4b')]);_0x17e69d['where']=qs[_0x82a2('0x4d')](_[_0x82a2('0x4e')](_0x47eedb[_0x82a2('0x43')],_0x94958e[_0x82a2('0x4d')]));if(_0x47eedb[_0x82a2('0x43')]['filter']){_0x17e69d['where']=_[_0x82a2('0x4f')](_0x17e69d['where'],{'$or':_[_0x82a2('0x3e')](_0x17e69d[_0x82a2('0x47')],function(_0x1e7229){var _0x375e9e={};_0x375e9e[_0x1e7229]={'$like':'%'+_0x47eedb[_0x82a2('0x43')][_0x82a2('0x50')]+'%'};return _0x375e9e;})});}_0x17e69d=_['merge']({},_0x17e69d,_0x47eedb['options']);return _0x49d817[_0x82a2('0xc0')](_0x17e69d);}})['then'](function(_0x556cd1){if(_0x556cd1){_0x19091f=_0x556cd1[_0x82a2('0x57')];if(!_0x47eedb[_0x82a2('0x43')][_0x82a2('0x60')](_0x82a2('0x49'))){_0x17e69d[_0x82a2('0x2c')]=qs[_0x82a2('0x2c')](_0x47eedb[_0x82a2('0x43')][_0x82a2('0x2c')]);_0x17e69d[_0x82a2('0x2b')]=qs[_0x82a2('0x2b')](_0x47eedb[_0x82a2('0x43')][_0x82a2('0x2b')]);}return _0x49d817[_0x82a2('0xc0')](_0x17e69d);}})['then'](function(_0x21b3f6){if(_0x21b3f6){return _0x21b3f6?{'count':_0x19091f,'rows':_0x21b3f6}:null;}})[_0x82a2('0x1d')](respondWithResult(_0x30bf7a,null))[_0x82a2('0x25')](handleError(_0x30bf7a,null));}; \ No newline at end of file +var _0x4176=['secure','List\x20not\x20found','subject','attach','out','messageId','Interaction','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','nolimit','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','Tags','tag','addApplications','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','CmContact','Contacts','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth'];(function(_0x27da4d,_0x455b43){var _0x4d08fb=function(_0x136c79){while(--_0x136c79){_0x27da4d['push'](_0x27da4d['shift']());}};_0x4d08fb(++_0x455b43);}(_0x4176,0x19e));var _0x6417=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x4176[_0xbb091];return _0x467a04;};'use strict';var emlformat=require(_0x6417('0x0'));var rimraf=require(_0x6417('0x1'));var zipdir=require(_0x6417('0x2'));var jsonpatch=require(_0x6417('0x3'));var rp=require(_0x6417('0x4'));var moment=require(_0x6417('0x5'));var BPromise=require(_0x6417('0x6'));var Mustache=require(_0x6417('0x7'));var util=require(_0x6417('0x8'));var path=require(_0x6417('0x9'));var sox=require(_0x6417('0xa'));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(_0x6417('0xb'));var crypto=require(_0x6417('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6417('0xd'));var toCsv=require(_0x6417('0xe'));var querystring=require('querystring');var Papa=require(_0x6417('0xf'));var htmlToText=require(_0x6417('0x10'));var juice=require('juice');var Redis=require(_0x6417('0x11'));var authService=require(_0x6417('0x12'));var qs=require(_0x6417('0x13'));var as=require(_0x6417('0x14'));var hardwareService=require(_0x6417('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6417('0x16'));var config=require(_0x6417('0x17'));var licenseUtil=require(_0x6417('0x18'));var db=require(_0x6417('0x19'))['db'];config[_0x6417('0x1a')]=_[_0x6417('0x1b')](config[_0x6417('0x1a')],{'host':_0x6417('0x1c'),'port':0x18eb});var socket=require(_0x6417('0x1d'))(new Redis(config['redis']));require(_0x6417('0x1e'))[_0x6417('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6417('0x20')][_0x6417('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x1b16ec,_0xdc3d37,_0x2d3156,_0x31efd0){return new BPromise(function(_0x1f0e78,_0x284ac1){var _0x22800d=_0x31efd0||client;return _0x22800d['request'](_0x1b16ec,_0x2d3156)[_0x6417('0x22')](function(_0xe67b99){logger[_0x6417('0x23')]('MailAccount,\x20%s,\x20%s',_0xdc3d37,'request\x20sent');logger[_0x6417('0x24')](_0x6417('0x25'),_0xdc3d37,_0x6417('0x26'),JSON['stringify'](_0xe67b99));if(_0xe67b99['error']){if(_0xe67b99[_0x6417('0x27')][_0x6417('0x28')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0xdc3d37,_0xe67b99[_0x6417('0x27')][_0x6417('0x29')]);return _0x284ac1(_0xe67b99['error']['message']);}logger[_0x6417('0x27')](_0x6417('0x2a'),_0xdc3d37,_0xe67b99[_0x6417('0x27')]['message']);return _0x1f0e78(_0xe67b99[_0x6417('0x27')][_0x6417('0x29')]);}else{logger[_0x6417('0x23')](_0x6417('0x2a'),_0xdc3d37,'request\x20sent');_0x1f0e78(_0xe67b99[_0x6417('0x2b')][_0x6417('0x29')]);}})[_0x6417('0x2c')](function(_0x46b5e6){logger[_0x6417('0x27')](_0x6417('0x2a'),_0xdc3d37,_0x46b5e6);_0x284ac1(_0x46b5e6);});});}function respondWithStatusCode(_0x36291d,_0x5c6eea){_0x5c6eea=_0x5c6eea||0xcc;return function(_0x723f51){if(_0x723f51){return _0x36291d[_0x6417('0x2d')](_0x5c6eea);}return _0x36291d[_0x6417('0x2e')](_0x5c6eea)[_0x6417('0x2f')]();};}function respondWithResult(_0x3a33a7,_0x5c3655){_0x5c3655=_0x5c3655||0xc8;return function(_0x39a045){if(_0x39a045){return _0x3a33a7['status'](_0x5c3655)[_0x6417('0x30')](_0x39a045);}};}function respondWithFilteredResult(_0x45bb13,_0x1bed76){return function(_0xdbd332){if(_0xdbd332){var _0x3cb2b2=typeof _0x1bed76['offset']===_0x6417('0x31')&&typeof _0x1bed76[_0x6417('0x32')]===_0x6417('0x31');var _0x2dd5ad=_0xdbd332[_0x6417('0x33')];var _0x487322=_0x3cb2b2?0x0:_0x1bed76[_0x6417('0x34')];var _0x3d07a8=_0x3cb2b2?_0xdbd332['count']:_0x1bed76[_0x6417('0x34')]+_0x1bed76[_0x6417('0x32')];var _0x749351;if(_0x3d07a8>=_0x2dd5ad){_0x3d07a8=_0x2dd5ad;_0x749351=0xc8;}else{_0x749351=0xce;}_0x45bb13[_0x6417('0x2e')](_0x749351);return _0x45bb13[_0x6417('0x35')](_0x6417('0x36'),_0x487322+'-'+_0x3d07a8+'/'+_0x2dd5ad)['json'](_0xdbd332);}return null;};}function patchUpdates(_0x289b8c){return function(_0x4a6f09){try{jsonpatch[_0x6417('0x37')](_0x4a6f09,_0x289b8c,!![]);}catch(_0x33cfba){return BPromise[_0x6417('0x38')](_0x33cfba);}return _0x4a6f09[_0x6417('0x39')]();};}function saveUpdates(_0x25cbfc,_0x5804ef){return function(_0x4ef202){if(_0x4ef202){return _0x4ef202[_0x6417('0x3a')](_0x25cbfc)[_0x6417('0x22')](function(_0x3892ff){return _0x3892ff;});}return null;};}function removeEntity(_0x566a0b,_0xcd12ae){return function(_0x1f7cb6){if(_0x1f7cb6){return _0x1f7cb6[_0x6417('0x3b')]()[_0x6417('0x22')](function(){var _0x1556a6=_0x1f7cb6[_0x6417('0x3c')]({'plain':!![]});var _0x2b908d=_0x6417('0x3d');return db[_0x6417('0x3e')][_0x6417('0x3b')]({'where':{'type':_0x2b908d,'resourceId':_0x1556a6['id']}})['then'](function(){return _0x1f7cb6;});})[_0x6417('0x22')](function(){_0x566a0b[_0x6417('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x909ed6,_0x19acf1){return function(_0x15e574){if(!_0x15e574){_0x909ed6[_0x6417('0x2d')](0x194);}return _0x15e574;};}function handleError(_0x50d0f0,_0x5a7b6a){_0x5a7b6a=_0x5a7b6a||0x1f4;return function(_0x353126){logger[_0x6417('0x27')](_0x353126[_0x6417('0x3f')]);if(_0x353126['name']){delete _0x353126[_0x6417('0x40')];}_0x50d0f0[_0x6417('0x2e')](_0x5a7b6a)[_0x6417('0x41')](_0x353126);};}exports[_0x6417('0x42')]=function(_0x409a0e,_0x4b5b21){var _0x179ced={'include':[{'model':db[_0x6417('0x43')],'as':_0x6417('0x44')},{'model':db[_0x6417('0x45')],'as':_0x6417('0x46')},{'model':db[_0x6417('0x47')],'as':_0x6417('0x48')}]},_0x1bc616={},_0x503c72={'count':0x0,'rows':[]};var _0x154fa0=_['map'](db[_0x6417('0x49')][_0x6417('0x4a')],function(_0x51a4b6){return{'name':_0x51a4b6[_0x6417('0x4b')],'type':_0x51a4b6[_0x6417('0x4c')][_0x6417('0x4d')]};});_0x1bc616[_0x6417('0x4e')]=_[_0x6417('0x4f')](_0x154fa0,_0x6417('0x40'));_0x1bc616[_0x6417('0x50')]=_[_0x6417('0x51')](_0x409a0e[_0x6417('0x50')]);_0x1bc616[_0x6417('0x52')]=_[_0x6417('0x53')](_0x1bc616[_0x6417('0x4e')],_0x1bc616[_0x6417('0x50')]);_0x179ced['attributes']=_['intersection'](_0x1bc616[_0x6417('0x4e')],qs[_0x6417('0x54')](_0x409a0e['query'][_0x6417('0x54')]));_0x179ced[_0x6417('0x55')]=_0x179ced[_0x6417('0x55')][_0x6417('0x56')]?_0x179ced[_0x6417('0x55')]:_0x1bc616[_0x6417('0x4e')];if(!_0x409a0e['query'][_0x6417('0x57')]('nolimit')){_0x179ced[_0x6417('0x32')]=qs['limit'](_0x409a0e['query'][_0x6417('0x32')]);_0x179ced[_0x6417('0x34')]=qs['offset'](_0x409a0e[_0x6417('0x50')][_0x6417('0x34')]);}_0x179ced[_0x6417('0x58')]=qs['sort'](_0x409a0e[_0x6417('0x50')][_0x6417('0x59')]);_0x179ced[_0x6417('0x5a')]=qs['filters'](_[_0x6417('0x5b')](_0x409a0e[_0x6417('0x50')],_0x1bc616[_0x6417('0x52')]),_0x154fa0);if(_0x409a0e[_0x6417('0x50')][_0x6417('0x5c')]){_0x179ced[_0x6417('0x5a')]=_[_0x6417('0x5d')](_0x179ced[_0x6417('0x5a')],{'$or':_['map'](_0x154fa0,function(_0x2508e3){if(_0x2508e3['type']!==_0x6417('0x5e')){var _0x565885={};_0x565885[_0x2508e3[_0x6417('0x40')]]={'$like':'%'+_0x409a0e[_0x6417('0x50')][_0x6417('0x5c')]+'%'};return _0x565885;}})});}_0x179ced=_['merge']({},_0x179ced,_0x409a0e[_0x6417('0x5f')]);var _0x5f59be={'where':_0x179ced['where']};return db[_0x6417('0x49')][_0x6417('0x33')](_0x5f59be)[_0x6417('0x22')](function(_0x1504a3){_0x503c72[_0x6417('0x33')]=_0x1504a3;if(_0x409a0e[_0x6417('0x50')][_0x6417('0x60')]){_0x179ced[_0x6417('0x61')]=[{'all':!![]}];}return db[_0x6417('0x49')][_0x6417('0x62')](_0x179ced);})[_0x6417('0x22')](function(_0x476a70){_0x503c72[_0x6417('0x63')]=_0x476a70;return _0x503c72;})[_0x6417('0x22')](respondWithFilteredResult(_0x4b5b21,_0x179ced))[_0x6417('0x2c')](handleError(_0x4b5b21,null));};exports['show']=function(_0x3d2a21,_0x1110c6){var _0x1d6ddb={'raw':![],'where':{'id':_0x3d2a21[_0x6417('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x6417('0x44')},{'model':db[_0x6417('0x45')],'as':_0x6417('0x46')},{'model':db[_0x6417('0x47')],'as':'mandatoryDispositionPause'}]},_0x59a583={};_0x59a583['model']=_[_0x6417('0x51')](db[_0x6417('0x49')][_0x6417('0x4a')]);_0x59a583[_0x6417('0x50')]=_['keys'](_0x3d2a21['query']);_0x59a583[_0x6417('0x52')]=_[_0x6417('0x53')](_0x59a583[_0x6417('0x4e')],_0x59a583[_0x6417('0x50')]);_0x1d6ddb[_0x6417('0x55')]=_[_0x6417('0x53')](_0x59a583[_0x6417('0x4e')],qs[_0x6417('0x54')](_0x3d2a21[_0x6417('0x50')][_0x6417('0x54')]));_0x1d6ddb[_0x6417('0x55')]=_0x1d6ddb['attributes'][_0x6417('0x56')]?_0x1d6ddb[_0x6417('0x55')]:_0x59a583[_0x6417('0x4e')];if(_0x3d2a21[_0x6417('0x50')]['includeAll']){_0x1d6ddb[_0x6417('0x61')]=[{'all':!![]}];}_0x1d6ddb=_[_0x6417('0x5d')]({},_0x1d6ddb,_0x3d2a21[_0x6417('0x5f')]);return db['MailAccount'][_0x6417('0x65')](_0x1d6ddb)[_0x6417('0x22')](handleEntityNotFound(_0x1110c6,null))[_0x6417('0x22')](respondWithResult(_0x1110c6,null))['catch'](handleError(_0x1110c6,null));};exports[_0x6417('0x3a')]=function(_0x4f6a92,_0x25b3b8){if(_0x4f6a92['body']['id']){delete _0x4f6a92['body']['id'];}return db[_0x6417('0x49')]['find']({'where':{'id':_0x4f6a92[_0x6417('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x6417('0x44')},{'model':db[_0x6417('0x45')],'as':_0x6417('0x46')},{'model':db[_0x6417('0x47')],'as':_0x6417('0x48')}]})['then'](handleEntityNotFound(_0x25b3b8,null))[_0x6417('0x22')](saveUpdates(_0x4f6a92[_0x6417('0x66')],null))[_0x6417('0x22')](function(_0x4c5306){if(_0x4c5306&&_0x4f6a92['body']['Imap']){return db[_0x6417('0x43')][_0x6417('0x3a')](_0x4f6a92[_0x6417('0x66')][_0x6417('0x44')],{'where':{'MailAccountId':_0x4c5306['id']}})[_0x6417('0x22')](function(){return _0x4c5306;});}return _0x4c5306;})[_0x6417('0x22')](function(_0x53d50c){if(_0x53d50c&&_0x4f6a92[_0x6417('0x66')][_0x6417('0x46')]){return db[_0x6417('0x45')][_0x6417('0x3a')](_0x4f6a92[_0x6417('0x66')][_0x6417('0x46')],{'where':{'MailAccountId':_0x53d50c['id']}})[_0x6417('0x22')](function(){return _0x53d50c;});}return _0x53d50c;})[_0x6417('0x22')](respondWithResult(_0x25b3b8,null))[_0x6417('0x2c')](handleError(_0x25b3b8,null));};exports[_0x6417('0x67')]=function(_0x59af85,_0x11699e){return db[_0x6417('0x49')][_0x6417('0x67')]()[_0x6417('0x22')](respondWithResult(_0x11699e,null))[_0x6417('0x2c')](handleError(_0x11699e,null));};exports[_0x6417('0x68')]=function(_0x3cb23b,_0x24256d,_0x200a39){if(_0x3cb23b[_0x6417('0x66')]['id']){delete _0x3cb23b[_0x6417('0x66')]['id'];}return db[_0x6417('0x49')]['find']({'where':{'id':_0x3cb23b[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x24256d,null))[_0x6417('0x22')](function(_0x1a0b1b){if(_0x1a0b1b){_0x3cb23b[_0x6417('0x66')]['MailAccountId']=_0x1a0b1b['id'];return db[_0x6417('0x69')][_0x6417('0x6a')](_0x3cb23b[_0x6417('0x66')]);}})[_0x6417('0x22')](respondWithResult(_0x24256d,null))[_0x6417('0x2c')](handleError(_0x24256d,null));};exports[_0x6417('0x6b')]=function(_0x551394,_0x32c813,_0x3d99ea){var _0x4f5ad0={'raw':![],'where':{}};var _0xa2808={};var _0x53dc63={'count':0x0,'rows':[]};return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x551394[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x32c813,null))[_0x6417('0x22')](function(_0x295aa4){if(_0x295aa4){_0xa2808[_0x6417('0x4e')]=_['keys'](db['Disposition'][_0x6417('0x4a')]);_0xa2808[_0x6417('0x50')]=_[_0x6417('0x51')](_0x551394['query']);_0xa2808[_0x6417('0x52')]=_[_0x6417('0x53')](_0xa2808[_0x6417('0x4e')],_0xa2808[_0x6417('0x50')]);_0x4f5ad0['attributes']=_[_0x6417('0x53')](_0xa2808[_0x6417('0x4e')],qs[_0x6417('0x54')](_0x551394['query']['fields']));_0x4f5ad0[_0x6417('0x55')]=_0x4f5ad0[_0x6417('0x55')][_0x6417('0x56')]?_0x4f5ad0[_0x6417('0x55')]:_0xa2808[_0x6417('0x4e')];if(!_0x551394[_0x6417('0x50')]['hasOwnProperty'](_0x6417('0x6d'))){_0x4f5ad0[_0x6417('0x32')]=qs[_0x6417('0x32')](_0x551394[_0x6417('0x50')][_0x6417('0x32')]);_0x4f5ad0['offset']=qs[_0x6417('0x34')](_0x551394[_0x6417('0x50')][_0x6417('0x34')]);}_0x4f5ad0[_0x6417('0x58')]=qs[_0x6417('0x59')](_0x551394[_0x6417('0x50')][_0x6417('0x59')]);_0x4f5ad0[_0x6417('0x5a')]=qs[_0x6417('0x52')](_[_0x6417('0x5b')](_0x551394[_0x6417('0x50')],_0xa2808['filters']));_0x4f5ad0[_0x6417('0x5a')][_0x6417('0x6e')]=_0x295aa4['id'];if(_0x551394[_0x6417('0x50')][_0x6417('0x5c')]){_0x4f5ad0[_0x6417('0x5a')]=_['merge'](_0x4f5ad0[_0x6417('0x5a')],{'$or':_[_0x6417('0x4f')](_0x4f5ad0['attributes'],function(_0x5a24a9){var _0x529f9b={};_0x529f9b[_0x5a24a9]={'$like':'%'+_0x551394['query'][_0x6417('0x5c')]+'%'};return _0x529f9b;})});}_0x4f5ad0=_['merge']({},_0x4f5ad0,_0x551394[_0x6417('0x5f')]);return db[_0x6417('0x69')][_0x6417('0x33')]({'where':_0x4f5ad0['where']})[_0x6417('0x22')](function(_0x26ee82){_0x53dc63[_0x6417('0x33')]=_0x26ee82;if(_0x551394[_0x6417('0x50')][_0x6417('0x60')]){_0x4f5ad0[_0x6417('0x61')]=[{'all':!![]}];}return db[_0x6417('0x69')]['findAll'](_0x4f5ad0);})[_0x6417('0x22')](function(_0x3222d4){_0x53dc63[_0x6417('0x63')]=_0x3222d4;return _0x53dc63;});}})['then'](respondWithFilteredResult(_0x32c813,_0x4f5ad0))['catch'](handleError(_0x32c813,null));};exports[_0x6417('0x6f')]=function(_0x3afb35,_0x1082bb,_0x129185){return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x3afb35[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x1082bb,null))['then'](function(_0x25ef2f){if(_0x25ef2f){return _0x25ef2f['removeDispositions'](_0x3afb35['query'][_0x6417('0x70')]);}})[_0x6417('0x22')](respondWithStatusCode(_0x1082bb,null))[_0x6417('0x2c')](handleError(_0x1082bb,null));};exports[_0x6417('0x71')]=function(_0x14d84e,_0x198eee,_0xd1cc67){if(_0x14d84e[_0x6417('0x66')]['id']){delete _0x14d84e[_0x6417('0x66')]['id'];}return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x14d84e[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x198eee,null))['then'](function(_0x6c6082){if(_0x6c6082){_0x14d84e['body'][_0x6417('0x6e')]=_0x6c6082['id'];return db[_0x6417('0x72')]['create'](_0x14d84e[_0x6417('0x66')]);}})['then'](respondWithResult(_0x198eee,null))[_0x6417('0x2c')](handleError(_0x198eee,null));};exports['getAnswers']=function(_0x3f97c9,_0x38aa31,_0x506645){var _0x3a25c4={'raw':![],'where':{}};var _0x230c6b={};var _0x32b518={'count':0x0,'rows':[]};return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x3f97c9[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x38aa31,null))[_0x6417('0x22')](function(_0x2946d0){if(_0x2946d0){_0x230c6b[_0x6417('0x4e')]=_[_0x6417('0x51')](db['CannedAnswer'][_0x6417('0x4a')]);_0x230c6b['query']=_['keys'](_0x3f97c9[_0x6417('0x50')]);_0x230c6b[_0x6417('0x52')]=_[_0x6417('0x53')](_0x230c6b[_0x6417('0x4e')],_0x230c6b[_0x6417('0x50')]);_0x3a25c4[_0x6417('0x55')]=_[_0x6417('0x53')](_0x230c6b[_0x6417('0x4e')],qs[_0x6417('0x54')](_0x3f97c9[_0x6417('0x50')]['fields']));_0x3a25c4[_0x6417('0x55')]=_0x3a25c4['attributes'][_0x6417('0x56')]?_0x3a25c4[_0x6417('0x55')]:_0x230c6b[_0x6417('0x4e')];if(!_0x3f97c9[_0x6417('0x50')]['hasOwnProperty']('nolimit')){_0x3a25c4['limit']=qs[_0x6417('0x32')](_0x3f97c9[_0x6417('0x50')][_0x6417('0x32')]);_0x3a25c4['offset']=qs[_0x6417('0x34')](_0x3f97c9[_0x6417('0x50')][_0x6417('0x34')]);}_0x3a25c4['order']=qs[_0x6417('0x59')](_0x3f97c9[_0x6417('0x50')]['sort']);_0x3a25c4[_0x6417('0x5a')]=qs[_0x6417('0x52')](_[_0x6417('0x5b')](_0x3f97c9['query'],_0x230c6b[_0x6417('0x52')]));_0x3a25c4['where']['MailAccountId']=_0x2946d0['id'];if(_0x3f97c9[_0x6417('0x50')][_0x6417('0x5c')]){_0x3a25c4['where']=_[_0x6417('0x5d')](_0x3a25c4[_0x6417('0x5a')],{'$or':_['map'](_0x3a25c4[_0x6417('0x55')],function(_0x3a365b){var _0x316394={};_0x316394[_0x3a365b]={'$like':'%'+_0x3f97c9['query'][_0x6417('0x5c')]+'%'};return _0x316394;})});}_0x3a25c4=_[_0x6417('0x5d')]({},_0x3a25c4,_0x3f97c9[_0x6417('0x5f')]);return db[_0x6417('0x72')]['count']({'where':_0x3a25c4['where']})[_0x6417('0x22')](function(_0x3bf8e7){_0x32b518[_0x6417('0x33')]=_0x3bf8e7;if(_0x3f97c9[_0x6417('0x50')][_0x6417('0x60')]){_0x3a25c4['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x6417('0x62')](_0x3a25c4);})[_0x6417('0x22')](function(_0x1f67d6){_0x32b518[_0x6417('0x63')]=_0x1f67d6;return _0x32b518;});}})['then'](respondWithFilteredResult(_0x38aa31,_0x3a25c4))[_0x6417('0x2c')](handleError(_0x38aa31,null));};exports[_0x6417('0x73')]=function(_0x5038cf,_0x580433,_0x1bc371){return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x5038cf[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x580433,null))['then'](function(_0x19f749){if(_0x19f749){return _0x19f749[_0x6417('0x73')](_0x5038cf['query'][_0x6417('0x70')]);}})['then'](respondWithStatusCode(_0x580433,null))[_0x6417('0x2c')](handleError(_0x580433,null));};exports['create']=function(_0x3dfdc3,_0x1e373c){var _0x2df80b={'name':_0x3dfdc3['body'][_0x6417('0x40')],'key':_0x3dfdc3['body']['key'],'email':_0x3dfdc3[_0x6417('0x66')][_0x6417('0x74')],'ListId':_0x3dfdc3[_0x6417('0x66')][_0x6417('0x75')],'active':!_[_0x6417('0x76')](_0x3dfdc3[_0x6417('0x66')][_0x6417('0x77')])?_0x3dfdc3[_0x6417('0x66')][_0x6417('0x77')]:!![],'description':_0x3dfdc3[_0x6417('0x66')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3dfdc3[_0x6417('0x66')][_0x6417('0x78')])){if(_0x3dfdc3[_0x6417('0x66')][_0x6417('0x79')]){_0x2df80b[_0x6417('0x44')][_0x6417('0x7a')]=_0x2df80b[_0x6417('0x46')]['user']=_0x3dfdc3[_0x6417('0x66')]['cuser'];_0x2df80b[_0x6417('0x44')][_0x6417('0x7b')]=_0x2df80b['Smtp'][_0x6417('0x7c')]=_0x3dfdc3[_0x6417('0x66')][_0x6417('0x7d')];}else{_0x2df80b[_0x6417('0x44')][_0x6417('0x7e')]=_0x2df80b[_0x6417('0x46')][_0x6417('0x7e')]=![];}_0x2df80b[_0x6417('0x44')][_0x6417('0x7f')]=_0x3dfdc3[_0x6417('0x66')]['Imap'][_0x6417('0x7f')];_0x2df80b[_0x6417('0x44')]['port']=_0x3dfdc3[_0x6417('0x66')][_0x6417('0x44')][_0x6417('0x80')];_0x2df80b[_0x6417('0x46')][_0x6417('0x7f')]=_0x3dfdc3['body'][_0x6417('0x46')][_0x6417('0x7f')];_0x2df80b['Smtp']['port']=_0x3dfdc3['body'][_0x6417('0x46')][_0x6417('0x80')];}else{_0x2df80b[_0x6417('0x44')][_0x6417('0x81')]=_0x2df80b[_0x6417('0x46')]['service']=_0x3dfdc3[_0x6417('0x66')][_0x6417('0x78')];_0x2df80b[_0x6417('0x44')][_0x6417('0x7a')]=_0x2df80b[_0x6417('0x46')]['user']=_0x3dfdc3[_0x6417('0x66')][_0x6417('0x82')];_0x2df80b[_0x6417('0x44')][_0x6417('0x7b')]=_0x2df80b[_0x6417('0x46')][_0x6417('0x7c')]=_0x3dfdc3[_0x6417('0x66')][_0x6417('0x7d')];}return db[_0x6417('0x49')][_0x6417('0x6a')](_0x2df80b,{'include':[{'model':db['MailServerOut'],'as':_0x6417('0x46')},{'model':db[_0x6417('0x43')],'as':_0x6417('0x44')}]})['then'](function(_0x439cf6){var _0x28ea47=_0x3dfdc3[_0x6417('0x7a')][_0x6417('0x3c')]({'plain':!![]});if(!_0x28ea47)throw new Error(_0x6417('0x83'));if(_0x28ea47['role']===_0x6417('0x7a')){var _0x2739ad=_0x439cf6['get']({'plain':!![]});return db[_0x6417('0x84')]['find']({'where':{'name':_0x6417('0x3d'),'userProfileId':_0x28ea47[_0x6417('0x85')]},'raw':!![]})[_0x6417('0x22')](function(_0x317abc){if(_0x317abc&&_0x317abc[_0x6417('0x86')]===0x0){return db[_0x6417('0x3e')][_0x6417('0x6a')]({'name':_0x2739ad['name'],'resourceId':_0x2739ad['id'],'type':_0x317abc[_0x6417('0x40')],'sectionId':_0x317abc['id']},{})[_0x6417('0x22')](function(){return _0x439cf6;});}else{return _0x439cf6;}})[_0x6417('0x2c')](function(_0x42ce89){logger[_0x6417('0x27')](_0x6417('0x87'),_0x42ce89);throw _0x42ce89;});}return _0x439cf6;})[_0x6417('0x22')](respondWithResult(_0x1e373c,0xc9))[_0x6417('0x2c')](handleError(_0x1e373c,null));};exports[_0x6417('0x88')]=function(_0x2e59b0,_0x544a54,_0x2ea277){return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x2e59b0['params']['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x544a54,null))[_0x6417('0x22')](function(_0x5e11a9){if(_0x5e11a9){return _0x5e11a9[_0x6417('0x88')]();}return null;})['then'](respondWithResult(_0x544a54,null))[_0x6417('0x2c')](handleError(_0x544a54,null));};exports[_0x6417('0x89')]=function(_0x2da02f,_0x3c7f4d,_0x19b3f1){if(_0x2da02f[_0x6417('0x66')]['id']){delete _0x2da02f[_0x6417('0x66')]['id'];}return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x2da02f[_0x6417('0x64')]['id']}})['then'](handleEntityNotFound(_0x3c7f4d,null))[_0x6417('0x22')](function(_0x325dc9){if(_0x325dc9){_0x2da02f[_0x6417('0x66')]['MailAccountId']=_0x325dc9['id'];return db[_0x6417('0x43')]['create'](_0x2da02f[_0x6417('0x66')]);}})['then'](respondWithResult(_0x3c7f4d,null))['catch'](handleError(_0x3c7f4d,null));};exports[_0x6417('0x8a')]=function(_0x126e00,_0x625d77,_0x281abb){return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x126e00['params']['id']}})['then'](handleEntityNotFound(_0x625d77,null))[_0x6417('0x22')](function(_0x469b19){if(_0x469b19){return _0x469b19[_0x6417('0x8b')](null);}return null;})['then'](respondWithStatusCode(_0x625d77,null))['catch'](handleError(_0x625d77,null));};exports[_0x6417('0x8c')]=function(_0xcca270,_0x24ea81,_0x5cdf35){return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0xcca270[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x24ea81,null))[_0x6417('0x22')](function(_0x5986c7){if(_0x5986c7){return _0x5986c7[_0x6417('0x8c')]();}return null;})['then'](respondWithResult(_0x24ea81,null))[_0x6417('0x2c')](handleError(_0x24ea81,null));};exports[_0x6417('0x8d')]=function(_0x425121,_0x19bdb7,_0x408f4d){if(_0x425121[_0x6417('0x66')]['id']){delete _0x425121[_0x6417('0x66')]['id'];}return db['MailAccount'][_0x6417('0x65')]({'where':{'id':_0x425121[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x19bdb7,null))[_0x6417('0x22')](function(_0x2742ac){if(_0x2742ac){_0x425121[_0x6417('0x66')][_0x6417('0x6e')]=_0x2742ac['id'];return db['MailServerOut']['create'](_0x425121[_0x6417('0x66')]);}})['then'](respondWithResult(_0x19bdb7,null))[_0x6417('0x2c')](handleError(_0x19bdb7,null));};exports[_0x6417('0x8e')]=function(_0x33984d,_0xdaec1d,_0xc9645a){return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x33984d[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0xdaec1d,null))[_0x6417('0x22')](function(_0x2ba167){if(_0x2ba167){return _0x2ba167[_0x6417('0x8f')](null);}return null;})['then'](respondWithStatusCode(_0xdaec1d,null))[_0x6417('0x2c')](handleError(_0xdaec1d,null));};exports[_0x6417('0x90')]=function(_0x75250a,_0x44541d,_0x200019){return db[_0x6417('0x91')][_0x6417('0x65')]({'where':{'id':_0x75250a[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x44541d,null))['then'](function(_0x2c8de8){if(_0x2c8de8){return _0x2c8de8[_0x6417('0x90')](_0x75250a[_0x6417('0x66')][_0x6417('0x70')],_[_0x6417('0x92')](_0x75250a['body'],[_0x6417('0x70'),'id'])||{});}})[_0x6417('0x22')](respondWithResult(_0x44541d,null))[_0x6417('0x2c')](handleError(_0x44541d,null));};exports['getInteractions']=function(_0x120b31,_0x3daff0,_0x55e72c){var _0x130d8b={'raw':![],'where':{}};var _0x137002={};var _0x91ef16={'count':0x0,'rows':[]};return db[_0x6417('0x49')]['findOne']({'where':{'id':_0x120b31[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x3daff0,null))[_0x6417('0x22')](function(_0x38780d){if(_0x38780d){_0x137002[_0x6417('0x4e')]=_[_0x6417('0x51')](db[_0x6417('0x91')][_0x6417('0x4a')]);_0x137002[_0x6417('0x50')]=_['keys'](_0x120b31[_0x6417('0x50')]);_0x137002[_0x6417('0x52')]=_[_0x6417('0x53')](_0x137002[_0x6417('0x4e')],_0x137002['query']);_0x130d8b['attributes']=_[_0x6417('0x53')](_0x137002['model'],qs[_0x6417('0x54')](_0x120b31[_0x6417('0x50')]['fields']));_0x130d8b['attributes']=_0x130d8b[_0x6417('0x55')]['length']?_0x130d8b[_0x6417('0x55')]:_0x137002[_0x6417('0x4e')];if(!_0x120b31[_0x6417('0x50')]['hasOwnProperty'](_0x6417('0x6d'))){_0x130d8b['limit']=qs['limit'](_0x120b31[_0x6417('0x50')][_0x6417('0x32')]);_0x130d8b[_0x6417('0x34')]=qs[_0x6417('0x34')](_0x120b31[_0x6417('0x50')][_0x6417('0x34')]);}_0x130d8b[_0x6417('0x58')]=qs[_0x6417('0x59')](_0x120b31['query'][_0x6417('0x59')]);_0x130d8b[_0x6417('0x5a')]=qs['filters'](_['pick'](_0x120b31[_0x6417('0x50')],_0x137002[_0x6417('0x52')]));_0x130d8b[_0x6417('0x5a')]['MailAccountId']=_0x38780d['id'];if(_0x120b31['query'][_0x6417('0x5c')]){_0x130d8b[_0x6417('0x5a')]=_[_0x6417('0x5d')](_0x130d8b[_0x6417('0x5a')],{'$or':_['map'](_0x130d8b[_0x6417('0x55')],function(_0x3dcec2){var _0x3b2d12={};_0x3b2d12[_0x3dcec2]={'$like':'%'+_0x120b31[_0x6417('0x50')][_0x6417('0x5c')]+'%'};return _0x3b2d12;})});}_0x130d8b=_['merge']({},_0x130d8b,_0x120b31[_0x6417('0x5f')]);return db[_0x6417('0x91')]['count']({'where':_0x130d8b[_0x6417('0x5a')]})[_0x6417('0x22')](function(_0x5e9e94){_0x91ef16[_0x6417('0x33')]=_0x5e9e94;if(_0x120b31['query'][_0x6417('0x60')]){_0x130d8b['include']=[{'model':db['CmContact'],'as':_0x6417('0x93'),'required':![]},{'model':db[_0x6417('0x94')],'as':_0x6417('0x95'),'attributes':[_0x6417('0x40'),_0x6417('0x96'),_0x6417('0x97')],'required':![]},{'model':db['Tag'],'as':_0x6417('0x98'),'attributes':['id',_0x6417('0x40'),'color'],'where':_0x120b31['query'][_0x6417('0x99')]?{'id':_0x120b31[_0x6417('0x50')][_0x6417('0x99')]}:undefined,'required':_0x120b31[_0x6417('0x50')]['tag']?!![]:![]}];}return db[_0x6417('0x91')][_0x6417('0x62')](_0x130d8b);})[_0x6417('0x22')](function(_0x35e2bb){_0x91ef16[_0x6417('0x63')]=_0x35e2bb;return _0x91ef16;});}})[_0x6417('0x22')](respondWithFilteredResult(_0x3daff0,_0x130d8b))[_0x6417('0x2c')](handleError(_0x3daff0,null));};exports[_0x6417('0x9a')]=function(_0x49e2f2,_0x5bb550,_0x515862){return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x49e2f2['params']['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x5bb550,null))[_0x6417('0x22')](function(_0x209019){if(_0x209019){return db['sequelize']['transaction'](function(_0x1cbb5b){return db['MailApplication'][_0x6417('0x3b')]({'where':{'MailAccountId':_0x49e2f2[_0x6417('0x64')]['id']},'transaction':_0x1cbb5b})[_0x6417('0x22')](function(_0x1c4b65){var _0x2c78e6=_['map'](_0x49e2f2[_0x6417('0x66')],function(_0x39ad7d){_0x39ad7d[_0x6417('0x6e')]=_0x49e2f2[_0x6417('0x64')]['id'];return _0x39ad7d;});return db[_0x6417('0x9b')][_0x6417('0x9c')](_0x2c78e6,{'transaction':_0x1cbb5b});});})[_0x6417('0x22')](function(){return db[_0x6417('0x9b')][_0x6417('0x9d')]({'where':{'MailAccountId':_0x49e2f2['params']['id']},'order':_0x6417('0x9e')});});}})[_0x6417('0x22')](respondWithResult(_0x5bb550,null))['catch'](handleError(_0x5bb550,null));};exports['getApplications']=function(_0x5ef33e,_0x573cd5,_0x1d1acc){var _0x5abc98={};var _0x2e5644={};var _0x3cac9e;var _0x51d6dd;return db[_0x6417('0x49')]['findOne']({'where':{'id':_0x5ef33e['params']['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x573cd5,null))['then'](function(_0x495303){if(_0x495303){_0x3cac9e=_0x495303;_0x2e5644[_0x6417('0x4e')]=_[_0x6417('0x51')](db[_0x6417('0x9b')][_0x6417('0x4a')]);_0x2e5644[_0x6417('0x50')]=_[_0x6417('0x51')](_0x5ef33e['query']);_0x2e5644[_0x6417('0x52')]=_['intersection'](_0x2e5644[_0x6417('0x4e')],_0x2e5644[_0x6417('0x50')]);_0x5abc98[_0x6417('0x55')]=_[_0x6417('0x53')](_0x2e5644[_0x6417('0x4e')],qs[_0x6417('0x54')](_0x5ef33e['query'][_0x6417('0x54')]));_0x5abc98[_0x6417('0x55')]=_0x5abc98['attributes'][_0x6417('0x56')]?_0x5abc98['attributes']:_0x2e5644['model'];_0x5abc98[_0x6417('0x58')]=qs[_0x6417('0x59')](_0x5ef33e[_0x6417('0x50')][_0x6417('0x59')]);_0x5abc98[_0x6417('0x5a')]=qs[_0x6417('0x52')](_['pick'](_0x5ef33e[_0x6417('0x50')],_0x2e5644['filters']));if(_0x5ef33e[_0x6417('0x50')][_0x6417('0x5c')]){_0x5abc98['where']=_[_0x6417('0x5d')](_0x5abc98[_0x6417('0x5a')],{'$or':_['map'](_0x5abc98[_0x6417('0x55')],function(_0x3d2a57){var _0xcb2849={};_0xcb2849[_0x3d2a57]={'$like':'%'+_0x5ef33e['query']['filter']+'%'};return _0xcb2849;})});}_0x5abc98=_[_0x6417('0x5d')]({},_0x5abc98,_0x5ef33e[_0x6417('0x5f')]);return _0x3cac9e[_0x6417('0x9f')](_0x5abc98);}})[_0x6417('0x22')](function(_0x31079c){if(_0x31079c){_0x51d6dd=_0x31079c[_0x6417('0x56')];if(!_0x5ef33e[_0x6417('0x50')][_0x6417('0x57')](_0x6417('0x6d'))){_0x5abc98[_0x6417('0x32')]=qs[_0x6417('0x32')](_0x5ef33e[_0x6417('0x50')][_0x6417('0x32')]);_0x5abc98[_0x6417('0x34')]=qs['offset'](_0x5ef33e[_0x6417('0x50')][_0x6417('0x34')]);}return _0x3cac9e[_0x6417('0x9f')](_0x5abc98);}})['then'](function(_0x374e98){if(_0x374e98){return _0x374e98?{'count':_0x51d6dd,'rows':_0x374e98}:null;}})[_0x6417('0x22')](respondWithResult(_0x573cd5,null))[_0x6417('0x2c')](handleError(_0x573cd5,null));};exports[_0x6417('0xa0')]=function(_0x2bffd2,_0x4b3a34,_0x339017){var _0x2f00a5={'raw':!![],'where':{}};var _0x502d48={};var _0xfc476a={'count':0x0,'rows':[]};return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x2bffd2[_0x6417('0x64')]['id']}})['then'](handleEntityNotFound(_0x4b3a34,null))[_0x6417('0x22')](function(_0x28eccf){if(_0x28eccf){_0x502d48['model']=_[_0x6417('0x51')](db[_0x6417('0xa1')][_0x6417('0x4a')]);_0x502d48[_0x6417('0x50')]=_[_0x6417('0x51')](_0x2bffd2[_0x6417('0x50')]);_0x502d48[_0x6417('0x52')]=_[_0x6417('0x53')](_0x502d48['model'],_0x502d48[_0x6417('0x50')]);_0x2f00a5[_0x6417('0x55')]=_[_0x6417('0x53')](_0x502d48['model'],qs[_0x6417('0x54')](_0x2bffd2[_0x6417('0x50')][_0x6417('0x54')]));_0x2f00a5['attributes']=_0x2f00a5[_0x6417('0x55')][_0x6417('0x56')]?_0x2f00a5[_0x6417('0x55')]:_0x502d48['model'];if(!_0x2bffd2[_0x6417('0x50')][_0x6417('0x57')]('nolimit')){_0x2f00a5[_0x6417('0x32')]=qs['limit'](_0x2bffd2[_0x6417('0x50')][_0x6417('0x32')]);_0x2f00a5['offset']=qs['offset'](_0x2bffd2[_0x6417('0x50')][_0x6417('0x34')]);}_0x2f00a5[_0x6417('0x58')]=qs[_0x6417('0x59')](_0x2bffd2[_0x6417('0x50')][_0x6417('0x59')]);_0x2f00a5['where']=qs['filters'](_[_0x6417('0x5b')](_0x2bffd2['query'],_0x502d48[_0x6417('0x52')]));_0x2f00a5['where'][_0x6417('0x6e')]=_0x28eccf['id'];if(_0x2bffd2[_0x6417('0x50')]['filter']){_0x2f00a5[_0x6417('0x5a')]=_['merge'](_0x2f00a5[_0x6417('0x5a')],{'$or':_['map'](_0x2f00a5[_0x6417('0x55')],function(_0x46562f){var _0x5cb255={};_0x5cb255[_0x46562f]={'$like':'%'+_0x2bffd2[_0x6417('0x50')][_0x6417('0x5c')]+'%'};return _0x5cb255;})});}if(_0x2bffd2[_0x6417('0x50')][_0x6417('0xa2')]){var _0x49a17d=_0x2bffd2[_0x6417('0x50')][_0x6417('0xa2')]['split'](',');var _0x23eb9b={};_0x23eb9b[_0x49a17d[0x0]]={'$gte':moment(_0x49a17d[0x1])[_0x6417('0xa3')](_0x6417('0xa4'))};_0x2f00a5['where']=_['merge'](_0x2f00a5[_0x6417('0x5a')],_0x23eb9b);}_0x2f00a5=_[_0x6417('0x5d')]({},_0x2f00a5,_0x2bffd2[_0x6417('0x5f')]);return db[_0x6417('0xa1')]['count']({'where':_0x2f00a5['where']})['then'](function(_0x4250ae){_0xfc476a[_0x6417('0x33')]=_0x4250ae;if(_0x2bffd2[_0x6417('0x50')][_0x6417('0x60')]){_0x2f00a5[_0x6417('0x61')]=[{'all':!![]}];}return db[_0x6417('0xa1')]['findAll'](_0x2f00a5);})[_0x6417('0x22')](function(_0x20646d){if(_0x2bffd2['query'][_0x6417('0xa5')]===_0x6417('0xa6')){for(var _0x20848f=0x0;_0x20848f<_0x20646d['length'];_0x20848f++){_0x20646d[_0x20848f][_0x6417('0x66')]=juice(_0x20646d[_0x20848f][_0x6417('0x66')]);}}_0xfc476a['rows']=_0x20646d;return _0xfc476a;});}})[_0x6417('0x22')](respondWithFilteredResult(_0x4b3a34,_0x2f00a5))[_0x6417('0x2c')](handleError(_0x4b3a34,null));};exports[_0x6417('0x41')]=function(_0x5932c4,_0xade0a4,_0xcecbbb){var _0x22fb8e,_0x35bf28={},_0x1a7140;if(_0x5932c4['body']['to']){_0x1a7140=_0x5932c4[_0x6417('0x66')]['to'][_0x6417('0xa7')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x5932c4['params']['id']},'include':[{'model':db[_0x6417('0xa8')],'as':_0x6417('0xa9'),'include':[{'model':db[_0x6417('0xaa')],'as':_0x6417('0xab'),'where':{'email':_0x1a7140},'limit':0x1,'order':[['updatedAt',_0x6417('0xac')]]}]},{'model':db['MailServerOut'],'as':_0x6417('0x46'),'raw':!![]}]})[_0x6417('0x22')](handleEntityNotFound(_0xade0a4,null))[_0x6417('0x22')](function(_0x3cf4cf){if(_0x3cf4cf){_0x22fb8e=_0x3cf4cf;if(_0x3cf4cf[_0x6417('0x46')]){if(_['isNil'](_0x5932c4['body'][_0x6417('0xad')])){_0x5932c4[_0x6417('0x66')][_0x6417('0xad')]=util['format'](_0x6417('0xae'),_0x3cf4cf['name'],_0x3cf4cf[_0x6417('0x74')]||_0x3cf4cf['Smtp'][_0x6417('0x7a')]);}if(_0x5932c4[_0x6417('0x66')]['attachments']&&_0x5932c4[_0x6417('0x66')][_0x6417('0xaf')][_0x6417('0x56')]){for(var _0x5f8075=0x0;_0x5f8075<_0x5932c4[_0x6417('0x66')][_0x6417('0xaf')][_0x6417('0x56')];_0x5f8075+=0x1){_0x5932c4['body'][_0x6417('0xaf')][_0x5f8075]={'filename':_0x5932c4[_0x6417('0x66')][_0x6417('0xaf')][_0x5f8075][_0x6417('0x40')],'path':path[_0x6417('0xb0')](config[_0x6417('0xb1')],'server/files/attachments',_0x5932c4[_0x6417('0x66')][_0x6417('0xaf')][_0x5f8075][_0x6417('0xb2')])};}}var _0x26c423={'tls':{'rejectUnauthorized':![]}};if(_[_0x6417('0x76')](_0x3cf4cf['Smtp'][_0x6417('0x81')])){if(_0x3cf4cf[_0x6417('0x46')][_0x6417('0x7e')]){_0x26c423[_0x6417('0xb3')]={'user':_0x3cf4cf[_0x6417('0x46')][_0x6417('0x7a')],'pass':_0x3cf4cf[_0x6417('0x46')][_0x6417('0x7c')]};}_0x26c423[_0x6417('0x7f')]=_0x3cf4cf[_0x6417('0x46')][_0x6417('0x7f')];_0x26c423[_0x6417('0x80')]=_0x3cf4cf[_0x6417('0x46')][_0x6417('0x80')];_0x26c423[_0x6417('0xb4')]=_0x3cf4cf[_0x6417('0x46')][_0x6417('0xb4')];}else{_0x26c423[_0x6417('0x81')]=_0x3cf4cf['Smtp'][_0x6417('0x81')];_0x26c423[_0x6417('0xb3')]={'user':_0x3cf4cf[_0x6417('0x46')]['user'],'pass':_0x3cf4cf[_0x6417('0x46')][_0x6417('0x7c')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x26c423,'message':_0x5932c4['body']});}else{throw new Error(_0x6417('0xb5'));}}})['then'](function(_0x5b47e1){if(_0x5b47e1){_0x35bf28=_0x5b47e1;if(_0x22fb8e[_0x6417('0xa9')]){if(_0x22fb8e[_0x6417('0xa9')][_0x6417('0xab')][_0x6417('0x56')]){return _0x22fb8e[_0x6417('0xa9')][_0x6417('0xab')][0x0];}else{return db[_0x6417('0xaa')][_0x6417('0x6a')](_[_0x6417('0x1b')](_0x5932c4['body'],{'firstName':_0x5932c4[_0x6417('0x66')]['to'],'email':_0x5932c4[_0x6417('0x66')]['to'],'phone':_0x5932c4['body']['to'],'ListId':_0x22fb8e[_0x6417('0x75')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x7ac8e6){if(_0x7ac8e6){var _0x34afad={'UserId':_0x5932c4[_0x6417('0x7a')]['id'],'ContactId':_0x7ac8e6['id'],'MailAccountId':_0x22fb8e['id'],'inReplyTo':_0x35bf28['messageId'],'to':_0x5932c4['body'][_0x6417('0xad')],'cc':_0x5932c4[_0x6417('0x66')]['cc'],'subject':_0x5932c4[_0x6417('0x66')][_0x6417('0xb6')],'attach':_0x5932c4[_0x6417('0x66')][_0x6417('0xb7')],'firstMsgDirection':_0x6417('0xb8'),'lastMsgAt':moment()['format'](_0x6417('0xa4')),'lastMsgDirection':'out','Messages':[_[_0x6417('0x5d')](_0x5932c4[_0x6417('0x66')],{'messageId':_0x35bf28[_0x6417('0xb9')],'sentAt':moment()[_0x6417('0xa3')](_0x6417('0xa4')),'read':!![],'MailAccountId':_0x22fb8e['id'],'UserId':_0x5932c4['user']['id'],'ContactId':_0x7ac8e6['id']})]};if(_0x5932c4[_0x6417('0x66')][_0x6417('0xba')]){_0x34afad=_[_0x6417('0x5d')](_0x34afad,_0x5932c4[_0x6417('0x66')]['Interaction']);}return db['MailInteraction'][_0x6417('0x6a')](_0x34afad,{'include':[{'model':db[_0x6417('0xa1')],'as':'Messages'}]});}})[_0x6417('0x22')](respondWithResult(_0xade0a4,null))[_0x6417('0x2c')](handleError(_0xade0a4,null));};exports[_0x6417('0xbb')]=function(_0x28eb0f,_0x5bdc04,_0x4ed649){return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x28eb0f['params']['id']},'include':[{'model':db[_0x6417('0x45')],'as':_0x6417('0x46'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5bdc04,null))[_0x6417('0x22')](function(_0x3bcb4f){if(_0x3bcb4f&&_0x3bcb4f[_0x6417('0x46')]){var _0x4200b0={'id':_0x3bcb4f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3bcb4f[_0x6417('0x46')][_0x6417('0x81')]){_0x4200b0['service']=_0x3bcb4f['Smtp'][_0x6417('0x81')];}else{_0x4200b0[_0x6417('0x7f')]=_0x3bcb4f[_0x6417('0x46')][_0x6417('0x7f')];_0x4200b0[_0x6417('0x80')]=_0x3bcb4f[_0x6417('0x46')]['port'];_0x4200b0['secure']=_0x3bcb4f[_0x6417('0x46')][_0x6417('0xb4')];}if(_0x3bcb4f[_0x6417('0x46')]['authentication']){_0x4200b0[_0x6417('0xb3')]={'user':_0x3bcb4f['Smtp'][_0x6417('0x7a')],'pass':_0x3bcb4f['Smtp']['pass']};}return respondWithRpcPromise('VerifySmtp',_0x6417('0xbb'),{'account':_0x4200b0});}})[_0x6417('0x22')](respondWithResult(_0x5bdc04,null))[_0x6417('0x2c')](handleError(_0x5bdc04,null));};exports['destroy']=function(_0x25b619,_0x3c209e){return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x25b619[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x3c209e,null))[_0x6417('0x22')](function(_0x339139){if(_0x339139&&_0x339139[_0x6417('0x81')]){throw new db[(_0x6417('0xbc'))]['ValidationError'](_0x6417('0xbd'));}return _0x339139;})[_0x6417('0x22')](removeEntity(_0x3c209e,null))[_0x6417('0x2c')](handleError(_0x3c209e,null));};exports[_0x6417('0xbe')]=function(_0x32fc4c,_0x9047b2,_0x56a2a9){return db['MailAccount'][_0x6417('0x65')]({'where':{'id':_0x32fc4c[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x9047b2,null))[_0x6417('0x22')](function(_0x2b29fa){if(_0x2b29fa){return _0x2b29fa['addAgents'](_0x32fc4c['body'][_0x6417('0x70')],_[_0x6417('0x92')](_0x32fc4c[_0x6417('0x66')],[_0x6417('0x70'),'id'])||{})[_0x6417('0xbf')](function(_0x4eebca){for(var _0xabc128=0x0;_0xabc128<_0x32fc4c[_0x6417('0x66')][_0x6417('0x70')][_0x6417('0x56')];_0xabc128+=0x1){socket['emit'](_0x6417('0xc0'),{'UserId':Number(_0x32fc4c[_0x6417('0x66')][_0x6417('0x70')][_0xabc128]),'MailAccountId':Number(_0x32fc4c['params']['id'])});}return _0x4eebca;});}})[_0x6417('0x22')](respondWithResult(_0x9047b2,null))[_0x6417('0x2c')](handleError(_0x9047b2,null));};exports['removeAgents']=function(_0x1b2cde,_0x6659a3,_0x5d1ca9){return db[_0x6417('0x49')][_0x6417('0x65')]({'where':{'id':_0x1b2cde[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x6659a3,null))[_0x6417('0x22')](function(_0x19f960){if(_0x19f960){return _0x19f960[_0x6417('0xc1')](_0x1b2cde[_0x6417('0x50')]['ids'])[_0x6417('0x22')](function(){if(_[_0x6417('0xc2')](_0x1b2cde[_0x6417('0x50')][_0x6417('0x70')])){for(var _0x3992e3=0x0;_0x3992e3<_0x1b2cde[_0x6417('0x50')][_0x6417('0x70')][_0x6417('0x56')];_0x3992e3+=0x1){socket[_0x6417('0xc3')](_0x6417('0xc4'),{'UserId':Number(_0x1b2cde['query'][_0x6417('0x70')][_0x3992e3]),'MailAccountId':Number(_0x1b2cde['params']['id'])});}}else{socket[_0x6417('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x1b2cde['query'][_0x6417('0x70')]),'MailAccountId':Number(_0x1b2cde[_0x6417('0x64')]['id'])});}});}})[_0x6417('0x22')](respondWithStatusCode(_0x6659a3,null))[_0x6417('0x2c')](handleError(_0x6659a3,null));};exports[_0x6417('0xc5')]=function(_0x557dd3,_0x3c11ce,_0x3dbb0c){var _0x1cfda5={};var _0x3d396a={};var _0x2361b2;var _0x27ed71;return db[_0x6417('0x49')][_0x6417('0x6c')]({'where':{'id':_0x557dd3[_0x6417('0x64')]['id']}})[_0x6417('0x22')](handleEntityNotFound(_0x3c11ce,null))[_0x6417('0x22')](function(_0x88ce50){if(_0x88ce50){_0x2361b2=_0x88ce50;_0x3d396a['model']=_[_0x6417('0x51')](db[_0x6417('0x94')][_0x6417('0x4a')]);_0x3d396a[_0x6417('0x50')]=_[_0x6417('0x51')](_0x557dd3[_0x6417('0x50')]);_0x3d396a['filters']=_[_0x6417('0x53')](_0x3d396a[_0x6417('0x4e')],_0x3d396a['query']);_0x1cfda5['attributes']=_['intersection'](_0x3d396a['model'],qs[_0x6417('0x54')](_0x557dd3[_0x6417('0x50')][_0x6417('0x54')]));_0x1cfda5[_0x6417('0x55')]=_0x1cfda5[_0x6417('0x55')][_0x6417('0x56')]?_0x1cfda5[_0x6417('0x55')]:_0x3d396a['model'];_0x1cfda5[_0x6417('0x58')]=qs[_0x6417('0x59')](_0x557dd3['query'][_0x6417('0x59')]);_0x1cfda5[_0x6417('0x5a')]=qs[_0x6417('0x52')](_[_0x6417('0x5b')](_0x557dd3[_0x6417('0x50')],_0x3d396a['filters']));if(_0x557dd3['query'][_0x6417('0x5c')]){_0x1cfda5[_0x6417('0x5a')]=_[_0x6417('0x5d')](_0x1cfda5[_0x6417('0x5a')],{'$or':_[_0x6417('0x4f')](_0x1cfda5[_0x6417('0x55')],function(_0x25bc64){var _0x2901eb={};_0x2901eb[_0x25bc64]={'$like':'%'+_0x557dd3[_0x6417('0x50')][_0x6417('0x5c')]+'%'};return _0x2901eb;})});}_0x1cfda5=_[_0x6417('0x5d')]({},_0x1cfda5,_0x557dd3[_0x6417('0x5f')]);return _0x2361b2[_0x6417('0xc5')](_0x1cfda5);}})[_0x6417('0x22')](function(_0x1ede55){if(_0x1ede55){_0x27ed71=_0x1ede55[_0x6417('0x56')];if(!_0x557dd3['query'][_0x6417('0x57')](_0x6417('0x6d'))){_0x1cfda5[_0x6417('0x32')]=qs[_0x6417('0x32')](_0x557dd3[_0x6417('0x50')][_0x6417('0x32')]);_0x1cfda5[_0x6417('0x34')]=qs[_0x6417('0x34')](_0x557dd3[_0x6417('0x50')]['offset']);}return _0x2361b2[_0x6417('0xc5')](_0x1cfda5);}})[_0x6417('0x22')](function(_0xfe8b92){if(_0xfe8b92){return _0xfe8b92?{'count':_0x27ed71,'rows':_0xfe8b92}:null;}})[_0x6417('0x22')](respondWithResult(_0x3c11ce,null))[_0x6417('0x2c')](handleError(_0x3c11ce,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index de46bff..d39c4a0 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 _0xef17=['update','remove','emit','hook','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x1f8e08,_0xbbe868){var _0xaf2ea=function(_0x335c4f){while(--_0x335c4f){_0x1f8e08['push'](_0x1f8e08['shift']());}};_0xaf2ea(++_0xbbe868);}(_0xef17,0x136));var _0x7ef1=function(_0x30b1fe,_0x57768f){_0x30b1fe=_0x30b1fe-0x0;var _0x25c857=_0xef17[_0x30b1fe];return _0x25c857;};'use strict';var EventEmitter=require(_0x7ef1('0x0'));var MailAccount=require(_0x7ef1('0x1'))['db'][_0x7ef1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7ef1('0x3')](0x0);var events={'afterCreate':_0x7ef1('0x4'),'afterUpdate':_0x7ef1('0x5'),'afterDestroy':_0x7ef1('0x6')};function emitEvent(_0x19a10d){return function(_0x2daaa6,_0x538a0a,_0x1d2f83){MailAccountEvents['emit'](_0x19a10d+':'+_0x2daaa6['id'],_0x2daaa6);MailAccountEvents[_0x7ef1('0x7')](_0x19a10d,_0x2daaa6);_0x1d2f83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x7ef1('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x714c=['save','update','emit','hasOwnProperty','hook','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x55ac73,_0x355047){var _0x2904d0=function(_0x33e63f){while(--_0x33e63f){_0x55ac73['push'](_0x55ac73['shift']());}};_0x2904d0(++_0x355047);}(_0x714c,0x18d));var _0xc714=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x714c[_0x52085a];return _0x5afc1a;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc714('0x0'))['db'][_0xc714('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc714('0x2')](0x0);var events={'afterCreate':_0xc714('0x3'),'afterUpdate':_0xc714('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d1101){return function(_0x19f8fc,_0x541cdc,_0x4a1ce5){MailAccountEvents[_0xc714('0x5')](_0x3d1101+':'+_0x19f8fc['id'],_0x19f8fc);MailAccountEvents[_0xc714('0x5')](_0x3d1101,_0x19f8fc);_0x4a1ce5(null);};}for(var e in events){if(events[_0xc714('0x6')](e)){var event=events[e];MailAccount[_0xc714('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cbead47..6c675e1 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 _0xa12f=['./mailAccount.attributes','exports','define','mail_accounts','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0xa12f,0x122));var _0xfa12=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa12f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfa12('0x0'));var util=require(_0xfa12('0x1'));var logger=require(_0xfa12('0x2'))(_0xfa12('0x3'));var moment=require(_0xfa12('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa12('0x5'));var rimraf=require('rimraf');var config=require(_0xfa12('0x6'));var attributes=require(_0xfa12('0x7'));module[_0xfa12('0x8')]=function(_0x5dc2a4,_0x4aeb8c){return _0x5dc2a4[_0xfa12('0x9')]('MailAccount',attributes,{'tableName':_0xfa12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c51=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash'];(function(_0x1c877f,_0x3f060c){var _0x3fe5db=function(_0x54bb35){while(--_0x54bb35){_0x1c877f['push'](_0x1c877f['shift']());}};_0x3fe5db(++_0x3f060c);}(_0x1c51,0x194));var _0x11c5=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x1c51[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0x11c5('0x0'));var util=require(_0x11c5('0x1'));var logger=require(_0x11c5('0x2'))(_0x11c5('0x3'));var moment=require(_0x11c5('0x4'));var BPromise=require(_0x11c5('0x5'));var rp=require(_0x11c5('0x6'));var fs=require('fs');var path=require(_0x11c5('0x7'));var rimraf=require(_0x11c5('0x8'));var config=require(_0x11c5('0x9'));var attributes=require(_0x11c5('0xa'));module[_0x11c5('0xb')]=function(_0x55eb44,_0x216691){return _0x55eb44[_0x11c5('0xc')](_0x11c5('0xd'),attributes,{'tableName':_0x11c5('0xe'),'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 49d06c8..65db4f0 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 _0x9389=['User','name','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailAccount','findAll','raw','options','where','attributes','limit','include','model','map','catch','MailAccount','find','ShowMailAccount','body','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','close','*,*,*,*','length','defaults','from','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','attach','interaction','created','contact','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','UserId'];(function(_0x267242,_0x283420){var _0x5b9f8d=function(_0x53ac81){while(--_0x53ac81){_0x267242['push'](_0x267242['shift']());}};_0x5b9f8d(++_0x283420);}(_0x9389,0x6e));var _0x9938=function(_0x2e60e6,_0x563dda){_0x2e60e6=_0x2e60e6-0x0;var _0x4713bd=_0x9389[_0x2e60e6];return _0x4713bd;};'use strict';var _=require(_0x9938('0x0'));var util=require('util');var moment=require(_0x9938('0x1'));var BPromise=require('bluebird');var rs=require(_0x9938('0x2'));var fs=require('fs');var Redis=require(_0x9938('0x3'));var db=require(_0x9938('0x4'))['db'];var utils=require(_0x9938('0x5'));var logger=require(_0x9938('0x6'))(_0x9938('0x7'));var config=require(_0x9938('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9938('0x9')]['http']({'port':0x232c});config[_0x9938('0xa')]=_['defaults'](config['redis'],{'host':_0x9938('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9938('0xa')]));require('./mailAccount.socket')[_0x9938('0xc')](socket);function respondWithRpcPromise(_0x29019e,_0x5ace91,_0x27143b){return new BPromise(function(_0x3fa346,_0x34e9d1){return client[_0x9938('0xd')](_0x29019e,_0x27143b)[_0x9938('0xe')](function(_0x3bed72){logger[_0x9938('0xf')](_0x9938('0x10'),_0x5ace91,_0x9938('0x11'));logger[_0x9938('0x12')](_0x9938('0x13'),_0x5ace91,_0x9938('0x11'),JSON[_0x9938('0x14')](_0x3bed72));if(_0x3bed72[_0x9938('0x15')]){if(_0x3bed72[_0x9938('0x15')]['code']===0x1f4){logger[_0x9938('0x15')](_0x9938('0x10'),_0x5ace91,_0x3bed72[_0x9938('0x15')][_0x9938('0x16')]);return _0x34e9d1(_0x3bed72[_0x9938('0x15')][_0x9938('0x16')]);}logger[_0x9938('0x15')](_0x9938('0x10'),_0x5ace91,_0x3bed72['error'][_0x9938('0x16')]);return _0x3fa346(_0x3bed72[_0x9938('0x15')][_0x9938('0x16')]);}else{logger[_0x9938('0xf')]('MailAccount,\x20%s,\x20%s',_0x5ace91,_0x9938('0x11'));_0x3fa346(_0x3bed72[_0x9938('0x17')][_0x9938('0x16')]);}})['catch'](function(_0x556550){logger[_0x9938('0x15')](_0x9938('0x10'),_0x5ace91,_0x556550);_0x34e9d1(_0x556550);});});}exports[_0x9938('0x18')]=function(_0x2ca7d9){var _0x394171=this;return new Promise(function(_0x3ae5fd,_0x2672b1){return db['MailAccount'][_0x9938('0x19')]({'raw':_0x2ca7d9['options']?_0x2ca7d9['options'][_0x9938('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ca7d9[_0x9938('0x1b')]?_0x2ca7d9['options'][_0x9938('0x1c')]||null:null,'attributes':_0x2ca7d9[_0x9938('0x1b')]?_0x2ca7d9[_0x9938('0x1b')][_0x9938('0x1d')]||null:null,'limit':_0x2ca7d9[_0x9938('0x1b')]?_0x2ca7d9[_0x9938('0x1b')][_0x9938('0x1e')]||null:null,'include':_0x2ca7d9['options']?_0x2ca7d9[_0x9938('0x1b')][_0x9938('0x1f')]?_['map'](_0x2ca7d9[_0x9938('0x1b')][_0x9938('0x1f')],function(_0x1d4334){return{'model':db[_0x1d4334[_0x9938('0x20')]],'as':_0x1d4334['as'],'attributes':_0x1d4334[_0x9938('0x1d')],'include':_0x1d4334['include']?_[_0x9938('0x21')](_0x1d4334[_0x9938('0x1f')],function(_0xda264d){return{'model':db[_0xda264d[_0x9938('0x20')]],'as':_0xda264d['as'],'attributes':_0xda264d['attributes'],'include':_0xda264d['include']?_['map'](_0xda264d[_0x9938('0x1f')],function(_0x174617){return{'model':db[_0x174617[_0x9938('0x20')]],'as':_0x174617['as'],'attributes':_0x174617[_0x9938('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x551fe4){logger[_0x9938('0xf')](_0x9938('0x18'),_0x2ca7d9);logger[_0x9938('0x12')](_0x9938('0x18'),_0x2ca7d9,JSON['stringify'](_0x551fe4));_0x3ae5fd(_0x551fe4);})[_0x9938('0x22')](function(_0x24eb49){logger[_0x9938('0x15')](_0x9938('0x18'),_0x24eb49[_0x9938('0x16')],_0x2ca7d9);_0x2672b1(_0x394171[_0x9938('0x15')](0x1f4,_0x24eb49['message']));});});};exports['ShowMailAccount']=function(_0x5bda47){var _0x1d42ed=this;return new Promise(function(_0xec9667,_0x22bd6b){return db[_0x9938('0x23')][_0x9938('0x24')]({'raw':_0x5bda47[_0x9938('0x1b')]?_0x5bda47[_0x9938('0x1b')][_0x9938('0x1a')]===undefined?!![]:![]:!![],'where':_0x5bda47[_0x9938('0x1b')]?_0x5bda47['options'][_0x9938('0x1c')]||null:null,'attributes':_0x5bda47[_0x9938('0x1b')]?_0x5bda47[_0x9938('0x1b')][_0x9938('0x1d')]||null:null,'include':_0x5bda47[_0x9938('0x1b')]?_0x5bda47[_0x9938('0x1b')][_0x9938('0x1f')]?_[_0x9938('0x21')](_0x5bda47[_0x9938('0x1b')][_0x9938('0x1f')],function(_0x4f173b){return{'model':db[_0x4f173b['model']],'as':_0x4f173b['as'],'attributes':_0x4f173b[_0x9938('0x1d')],'include':_0x4f173b[_0x9938('0x1f')]?_['map'](_0x4f173b[_0x9938('0x1f')],function(_0xeca307){return{'model':db[_0xeca307[_0x9938('0x20')]],'as':_0xeca307['as'],'attributes':_0xeca307[_0x9938('0x1d')],'include':_0xeca307[_0x9938('0x1f')]?_[_0x9938('0x21')](_0xeca307[_0x9938('0x1f')],function(_0x427e30){return{'model':db[_0x427e30[_0x9938('0x20')]],'as':_0x427e30['as'],'attributes':_0x427e30[_0x9938('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9938('0xe')](function(_0x4116a8){logger[_0x9938('0xf')](_0x9938('0x25'),_0x5bda47);logger[_0x9938('0x12')](_0x9938('0x25'),_0x5bda47,JSON[_0x9938('0x14')](_0x4116a8));_0xec9667(_0x4116a8);})[_0x9938('0x22')](function(_0x523af7){logger[_0x9938('0x15')](_0x9938('0x25'),_0x523af7[_0x9938('0x16')],_0x5bda47);_0x22bd6b(_0x1d42ed['error'](0x1f4,_0x523af7[_0x9938('0x16')]));});});};exports['NotifyMailAccount']=function(_0x2b9e09){var _0x33ff3f=this;return new Promise(function(_0x1aeffe,_0x318c36){var _0x1f37fa={'body':_0x2b9e09[_0x9938('0x26')],'channel':'mail'};var _0x25d8b0=_['difference'](_['keys'](db[_0x9938('0x27')][_0x9938('0x28')]),[_0x9938('0x29'),_0x9938('0x2a'),_0x9938('0x2b'),_0x9938('0x2c')]);var _0x1b941d=![];if(_0x2b9e09[_0x9938('0x26')]['id']){delete _0x2b9e09[_0x9938('0x26')]['id'];}if(_['isNil'](_0x2b9e09[_0x9938('0x26')]['from'])){return _0x318c36(_0x33ff3f[_0x9938('0x15')](0x1f4,_0x9938('0x2d')));}if(_[_0x9938('0x2e')](_0x2b9e09[_0x9938('0x26')][_0x9938('0x26')])||_0x2b9e09[_0x9938('0x26')]['body']===''){return _0x318c36(_0x33ff3f['error'](0x1f4,_0x9938('0x2f')));}if(_[_0x9938('0x2e')](_0x2b9e09[_0x9938('0x26')][_0x9938('0x30')])){return _0x318c36(_0x33ff3f[_0x9938('0x15')](0x1f4,_0x9938('0x31')+_0x25d8b0));}if(!_[_0x9938('0x32')](_0x25d8b0,_0x2b9e09[_0x9938('0x26')][_0x9938('0x30')])){return _0x318c36(_0x33ff3f[_0x9938('0x15')](0x1f4,_0x9938('0x33')+_0x25d8b0));}var _0x162b82={};_0x162b82[_0x2b9e09[_0x9938('0x26')][_0x9938('0x30')]]=_0x2b9e09['body']['from'];return db[_0x9938('0x23')]['find']({'where':{'id':_0x2b9e09[_0x9938('0x34')]['id']},'include':[{'model':db[_0x9938('0x35')],'as':_0x9938('0x36'),'include':[{'model':db[_0x9938('0x27')],'as':_0x9938('0x37'),'where':_0x162b82,'limit':0x1,'order':[['updatedAt',_0x9938('0x38')]]}]},{'model':db[_0x9938('0x39')],'as':_0x9938('0x3a')},{'model':db[_0x9938('0x3b')],'as':_0x9938('0x3c')}]})[_0x9938('0xe')](function(_0x5db278){if(_0x5db278&&_0x5db278[_0x9938('0x36')]){var _0x5116a9=_0x5db278[_0x9938('0x3d')]({'plain':!![]});_0x1f37fa[_0x9938('0x34')]=_[_0x9938('0x3e')](_0x5116a9,['Applications',_0x9938('0x36')]);_0x1f37fa[_0x9938('0x3f')]=_0x5116a9['Applications'];_0x1f37fa[_0x9938('0x40')]=_0x5116a9[_0x9938('0x36')];_0x1f37fa[_0x9938('0x3f')]=_[_0x9938('0x41')](_0x1f37fa['applications'],[_0x9938('0x42')],[_0x9938('0x43')]);if(_0x1f37fa[_0x9938('0x34')]&&_0x1f37fa[_0x9938('0x34')][_0x9938('0x44')]){_0x1f37fa[_0x9938('0x3f')]['push']({'id':0x0,'priority':_0x1f37fa[_0x9938('0x3f')]['length']+0x1,'app':_0x9938('0x45'),'appdata':'autoclose','interval':_0x9938('0x46')});}if(_0x1f37fa[_0x9938('0x34')][_0x9938('0x3a')]){delete _0x1f37fa['account'][_0x9938('0x3a')];}if(_0x1f37fa[_0x9938('0x34')][_0x9938('0x36')]){delete _0x1f37fa[_0x9938('0x34')][_0x9938('0x36')];}if(_0x5116a9['List'][_0x9938('0x37')][_0x9938('0x47')]){return _0x5116a9[_0x9938('0x36')]['Contacts'][0x0];}var _0x3c6447=_[_0x9938('0x48')](_0x2b9e09['body'],{'firstName':_0x2b9e09['body'][_0x9938('0x49')],'ListId':_0x5116a9[_0x9938('0x2c')]});_0x3c6447[_0x2b9e09[_0x9938('0x26')][_0x9938('0x30')]]=_0x2b9e09[_0x9938('0x26')][_0x9938('0x49')];return db[_0x9938('0x27')][_0x9938('0x4a')](_0x3c6447);}else{throw new Error(_0x9938('0x4b'));}})[_0x9938('0xe')](function(_0x538c0d){_0x1f37fa['contact']=_0x538c0d;if(_0x538c0d){if(!_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x4c')]){_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['messageId']=rs[_0x9938('0x4d')]()+'\x20'+_0x2b9e09['body'][_0x9938('0x16')]['from'];}var _0x36bfb3={'ContactId':_0x538c0d['id'],'MailAccountId':_0x2b9e09[_0x9938('0x34')]['id'],'inReplyTo':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['messageId'],'to':_0x2b9e09['body'][_0x9938('0x16')][_0x9938('0x49')],'cc':_0x2b9e09[_0x9938('0x26')]['message']['cc'],'subject':_0x2b9e09['body']['message'][_0x9938('0x4e')],'attach':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['attach'],'lastMsgAt':moment()[_0x9938('0x4f')](_0x9938('0x50')),'lastMsgDirection':'in'};return db[_0x9938('0x51')][_0x9938('0x24')]({'where':{'closed':![],'MailAccountId':_0x2b9e09['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x9938('0x4c')],'where':{'messageId':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x52')]}}]})[_0x9938('0xe')](function(_0xc0eef8){if(_0xc0eef8){return[_0xc0eef8,![]];}return db[_0x9938('0x51')][_0x9938('0x4a')](_0x36bfb3)[_0x9938('0xe')](function(_0x119854){return[_0x119854,!![]];});});}else{throw new Error(_0x9938('0x53'));}})[_0x9938('0x54')](function(_0x44c24a,_0x47143c){if(_0x44c24a){_0x1b941d=_0x47143c;if(!_0x47143c){return _0x44c24a['update']({'inReplyTo':_0x2b9e09['body'][_0x9938('0x16')]['messageId'],'to':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x49')],'cc':_0x2b9e09['body'][_0x9938('0x16')]['cc'],'subject':_0x2b9e09[_0x9938('0x26')]['message'][_0x9938('0x4e')],'attach':_0x44c24a['attach']?_0x44c24a[_0x9938('0x55')]:_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x55')],'substatus':null,'substatusAt':moment()[_0x9938('0x4f')](_0x9938('0x50')),'lastMsgAt':moment()[_0x9938('0x4f')](_0x9938('0x50')),'lastMsgDirection':'in'});}else{return _0x44c24a;}}})[_0x9938('0xe')](function(_0x2ef85d){_0x1f37fa[_0x9938('0x56')]=_0x2ef85d[_0x9938('0x3d')]({'plain':!![]});_0x1f37fa[_0x9938('0x56')][_0x9938('0x57')]=_0x1b941d;return db['MailMessage'][_0x9938('0x4a')]({'body':_0x2b9e09[_0x9938('0x26')][_0x9938('0x26')],'MailAccountId':_0x2b9e09[_0x9938('0x34')]['id'],'MailInteractionId':_0x2ef85d['id'],'direction':'in','ContactId':_0x1f37fa[_0x9938('0x58')]['id'],'messageId':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['messageId'],'from':_0x2b9e09[_0x9938('0x26')]['message'][_0x9938('0x49')],'to':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['to'],'cc':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['cc'],'subject':_0x2b9e09['body'][_0x9938('0x16')]['subject'],'attach':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x55')],'Attachments':_0x2b9e09['body'][_0x9938('0x16')][_0x9938('0x59')],'originTo':_0x2b9e09['body'][_0x9938('0x16')][_0x9938('0x5a')],'originCc':_0x2b9e09['body'][_0x9938('0x16')][_0x9938('0x5b')],'bcc':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x5c')],'ChatWebsiteId':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')]['ChatWebsiteId']||null,'originChannel':_0x2b9e09[_0x9938('0x26')][_0x9938('0x16')][_0x9938('0x5d')]||_0x9938('0x5e'),'ChatOfflineMessageId':_0x2b9e09[_0x9938('0x26')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x9938('0x5f')],'as':_0x9938('0x60')}]});})[_0x9938('0xe')](function(_0x2d44e5){_0x1f37fa[_0x9938('0x16')]=_0x2d44e5;if(_0x1f37fa['interaction'][_0x9938('0x61')]){return db[_0x9938('0x62')][_0x9938('0x24')]({'attributes':['id',_0x9938('0x63')],'where':{'id':_0x1f37fa['interaction'][_0x9938('0x61')]}})[_0x9938('0xe')](function(_0x3605ff){if(_0x3605ff){_0x1f37fa[_0x9938('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9938('0x64'),'appdata':_0x3605ff[_0x9938('0x63')]+','+(_0x1f37fa[_0x9938('0x34')][_0x9938('0x65')]||0xa),'interval':_0x9938('0x46')});}return respondWithRpcPromise('Start',_0x9938('0x66'),_0x1f37fa);});}return respondWithRpcPromise(_0x9938('0x67'),_0x9938('0x66'),_0x1f37fa);})[_0x9938('0xe')](function(_0x5a984a){_0x1aeffe(_0x5a984a);})[_0x9938('0x22')](function(_0x14cab8){_0x318c36(_0x33ff3f[_0x9938('0x15')](0x1f4,_0x14cab8[_0x9938('0x16')]));});});}; \ No newline at end of file +var _0x0a7e=['model','then','debug','stringify','ShowMailAccount','MailAccount','find','NotifyMailAccount','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','MailServerOut','Smtp','List','get','account','omit','Applications','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','subject','interaction','created','contact','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x4b5376,_0x20df44){var _0x45621c=function(_0x4a0620){while(--_0x4a0620){_0x4b5376['push'](_0x4b5376['shift']());}};_0x45621c(++_0x20df44);}(_0x0a7e,0x130));var _0xe0a7=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0a7e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe0a7('0x0'));var util=require(_0xe0a7('0x1'));var moment=require(_0xe0a7('0x2'));var BPromise=require(_0xe0a7('0x3'));var rs=require(_0xe0a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0a7('0x5'))['db'];var utils=require(_0xe0a7('0x6'));var logger=require(_0xe0a7('0x7'))(_0xe0a7('0x8'));var config=require('../../config/environment');var jayson=require(_0xe0a7('0x9'));var client=jayson[_0xe0a7('0xa')][_0xe0a7('0xb')]({'port':0x232c});config[_0xe0a7('0xc')]=_['defaults'](config['redis'],{'host':_0xe0a7('0xd'),'port':0x18eb});var socket=require(_0xe0a7('0xe'))(new Redis(config[_0xe0a7('0xc')]));require(_0xe0a7('0xf'))[_0xe0a7('0x10')](socket);function respondWithRpcPromise(_0x58092e,_0x4cfbd9,_0x3c11d2){return new BPromise(function(_0x10285e,_0x2454a1){return client['request'](_0x58092e,_0x3c11d2)['then'](function(_0x233008){logger[_0xe0a7('0x11')]('MailAccount,\x20%s,\x20%s',_0x4cfbd9,_0xe0a7('0x12'));logger['debug'](_0xe0a7('0x13'),_0x4cfbd9,_0xe0a7('0x12'),JSON['stringify'](_0x233008));if(_0x233008[_0xe0a7('0x14')]){if(_0x233008[_0xe0a7('0x14')][_0xe0a7('0x15')]===0x1f4){logger[_0xe0a7('0x14')]('MailAccount,\x20%s,\x20%s',_0x4cfbd9,_0x233008[_0xe0a7('0x14')][_0xe0a7('0x16')]);return _0x2454a1(_0x233008[_0xe0a7('0x14')][_0xe0a7('0x16')]);}logger['error'](_0xe0a7('0x17'),_0x4cfbd9,_0x233008['error'][_0xe0a7('0x16')]);return _0x10285e(_0x233008[_0xe0a7('0x14')]['message']);}else{logger[_0xe0a7('0x11')](_0xe0a7('0x17'),_0x4cfbd9,_0xe0a7('0x12'));_0x10285e(_0x233008[_0xe0a7('0x18')]['message']);}})[_0xe0a7('0x19')](function(_0x4a8b32){logger[_0xe0a7('0x14')](_0xe0a7('0x17'),_0x4cfbd9,_0x4a8b32);_0x2454a1(_0x4a8b32);});});}exports[_0xe0a7('0x1a')]=function(_0x5752f2){var _0x583586=this;return new Promise(function(_0x4a1d78,_0x3ef4b7){return db['MailAccount'][_0xe0a7('0x1b')]({'raw':_0x5752f2[_0xe0a7('0x1c')]?_0x5752f2[_0xe0a7('0x1c')][_0xe0a7('0x1d')]===undefined?!![]:![]:!![],'where':_0x5752f2['options']?_0x5752f2[_0xe0a7('0x1c')][_0xe0a7('0x1e')]||null:null,'attributes':_0x5752f2[_0xe0a7('0x1c')]?_0x5752f2[_0xe0a7('0x1c')][_0xe0a7('0x1f')]||null:null,'limit':_0x5752f2[_0xe0a7('0x1c')]?_0x5752f2[_0xe0a7('0x1c')][_0xe0a7('0x20')]||null:null,'include':_0x5752f2[_0xe0a7('0x1c')]?_0x5752f2[_0xe0a7('0x1c')]['include']?_[_0xe0a7('0x21')](_0x5752f2[_0xe0a7('0x1c')][_0xe0a7('0x22')],function(_0x202f06){return{'model':db[_0x202f06[_0xe0a7('0x23')]],'as':_0x202f06['as'],'attributes':_0x202f06[_0xe0a7('0x1f')],'include':_0x202f06[_0xe0a7('0x22')]?_['map'](_0x202f06[_0xe0a7('0x22')],function(_0x4c9906){return{'model':db[_0x4c9906['model']],'as':_0x4c9906['as'],'attributes':_0x4c9906[_0xe0a7('0x1f')],'include':_0x4c9906['include']?_['map'](_0x4c9906[_0xe0a7('0x22')],function(_0x5c9c29){return{'model':db[_0x5c9c29['model']],'as':_0x5c9c29['as'],'attributes':_0x5c9c29[_0xe0a7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe0a7('0x24')](function(_0x19b04f){logger[_0xe0a7('0x11')](_0xe0a7('0x1a'),_0x5752f2);logger[_0xe0a7('0x25')](_0xe0a7('0x1a'),_0x5752f2,JSON[_0xe0a7('0x26')](_0x19b04f));_0x4a1d78(_0x19b04f);})[_0xe0a7('0x19')](function(_0x4c9e85){logger[_0xe0a7('0x14')](_0xe0a7('0x1a'),_0x4c9e85[_0xe0a7('0x16')],_0x5752f2);_0x3ef4b7(_0x583586['error'](0x1f4,_0x4c9e85['message']));});});};exports[_0xe0a7('0x27')]=function(_0x3feb00){var _0x22f889=this;return new Promise(function(_0x47c4e6,_0x3a2e07){return db[_0xe0a7('0x28')][_0xe0a7('0x29')]({'raw':_0x3feb00[_0xe0a7('0x1c')]?_0x3feb00[_0xe0a7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3feb00[_0xe0a7('0x1c')]?_0x3feb00[_0xe0a7('0x1c')][_0xe0a7('0x1e')]||null:null,'attributes':_0x3feb00[_0xe0a7('0x1c')]?_0x3feb00[_0xe0a7('0x1c')][_0xe0a7('0x1f')]||null:null,'include':_0x3feb00['options']?_0x3feb00[_0xe0a7('0x1c')][_0xe0a7('0x22')]?_[_0xe0a7('0x21')](_0x3feb00[_0xe0a7('0x1c')][_0xe0a7('0x22')],function(_0xd24b3b){return{'model':db[_0xd24b3b[_0xe0a7('0x23')]],'as':_0xd24b3b['as'],'attributes':_0xd24b3b[_0xe0a7('0x1f')],'include':_0xd24b3b['include']?_[_0xe0a7('0x21')](_0xd24b3b['include'],function(_0x390f6e){return{'model':db[_0x390f6e[_0xe0a7('0x23')]],'as':_0x390f6e['as'],'attributes':_0x390f6e[_0xe0a7('0x1f')],'include':_0x390f6e[_0xe0a7('0x22')]?_[_0xe0a7('0x21')](_0x390f6e[_0xe0a7('0x22')],function(_0x526858){return{'model':db[_0x526858['model']],'as':_0x526858['as'],'attributes':_0x526858[_0xe0a7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25daea){logger[_0xe0a7('0x11')](_0xe0a7('0x27'),_0x3feb00);logger['debug'](_0xe0a7('0x27'),_0x3feb00,JSON['stringify'](_0x25daea));_0x47c4e6(_0x25daea);})['catch'](function(_0x3ea598){logger[_0xe0a7('0x14')](_0xe0a7('0x27'),_0x3ea598[_0xe0a7('0x16')],_0x3feb00);_0x3a2e07(_0x22f889[_0xe0a7('0x14')](0x1f4,_0x3ea598['message']));});});};exports[_0xe0a7('0x2a')]=function(_0x548b37){var _0x389aff=this;return new Promise(function(_0x470600,_0x49e631){var _0xb542fb={'body':_0x548b37['body'],'channel':_0xe0a7('0x2b')};var _0x27c134=_[_0xe0a7('0x2c')](_['keys'](db[_0xe0a7('0x2d')][_0xe0a7('0x2e')]),[_0xe0a7('0x2f'),_0xe0a7('0x30'),_0xe0a7('0x31'),_0xe0a7('0x32')]);var _0x122376=![];if(_0x548b37[_0xe0a7('0x33')]['id']){delete _0x548b37[_0xe0a7('0x33')]['id'];}if(_['isNil'](_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x34')])){return _0x49e631(_0x389aff[_0xe0a7('0x14')](0x1f4,_0xe0a7('0x35')));}if(_[_0xe0a7('0x36')](_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x33')])||_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x33')]===''){return _0x49e631(_0x389aff[_0xe0a7('0x14')](0x1f4,_0xe0a7('0x37')));}if(_['isNil'](_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x38')])){return _0x49e631(_0x389aff[_0xe0a7('0x14')](0x1f4,_0xe0a7('0x39')+_0x27c134));}if(!_[_0xe0a7('0x3a')](_0x27c134,_0x548b37['body']['mapKey'])){return _0x49e631(_0x389aff['error'](0x1f4,_0xe0a7('0x3b')+_0x27c134));}var _0x191f34={};_0x191f34[_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x38')]]=_0x548b37[_0xe0a7('0x33')]['from'];return db[_0xe0a7('0x28')][_0xe0a7('0x29')]({'where':{'id':_0x548b37['account']['id']},'include':[{'model':db[_0xe0a7('0x3c')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe0a7('0x3d'),'where':_0x191f34,'limit':0x1,'order':[[_0xe0a7('0x30'),_0xe0a7('0x3e')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0xe0a7('0x3f')],'as':_0xe0a7('0x40')}]})['then'](function(_0x5746e){if(_0x5746e&&_0x5746e[_0xe0a7('0x41')]){var _0x557b5e=_0x5746e[_0xe0a7('0x42')]({'plain':!![]});_0xb542fb[_0xe0a7('0x43')]=_[_0xe0a7('0x44')](_0x557b5e,[_0xe0a7('0x45'),'List']);_0xb542fb[_0xe0a7('0x46')]=_0x557b5e[_0xe0a7('0x45')];_0xb542fb[_0xe0a7('0x47')]=_0x557b5e[_0xe0a7('0x41')];_0xb542fb['applications']=_[_0xe0a7('0x48')](_0xb542fb['applications'],[_0xe0a7('0x49')],['asc']);if(_0xb542fb[_0xe0a7('0x43')]&&_0xb542fb[_0xe0a7('0x43')][_0xe0a7('0x4a')]){_0xb542fb['applications'][_0xe0a7('0x4b')]({'id':0x0,'priority':_0xb542fb[_0xe0a7('0x46')][_0xe0a7('0x4c')]+0x1,'app':_0xe0a7('0x4d'),'appdata':_0xe0a7('0x4a'),'interval':_0xe0a7('0x4e')});}if(_0xb542fb[_0xe0a7('0x43')][_0xe0a7('0x45')]){delete _0xb542fb[_0xe0a7('0x43')]['Applications'];}if(_0xb542fb[_0xe0a7('0x43')][_0xe0a7('0x41')]){delete _0xb542fb[_0xe0a7('0x43')][_0xe0a7('0x41')];}if(_0x557b5e[_0xe0a7('0x41')]['Contacts']['length']){return _0x557b5e['List'][_0xe0a7('0x3d')][0x0];}var _0x37ef0b=_[_0xe0a7('0x4f')](_0x548b37[_0xe0a7('0x33')],{'firstName':_0x548b37['body'][_0xe0a7('0x34')],'ListId':_0x557b5e[_0xe0a7('0x32')]});_0x37ef0b[_0x548b37['body'][_0xe0a7('0x38')]]=_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x34')];return db['CmContact']['create'](_0x37ef0b);}else{throw new Error(_0xe0a7('0x50'));}})[_0xe0a7('0x24')](function(_0x14d8a9){_0xb542fb['contact']=_0x14d8a9;if(_0x14d8a9){if(!_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x51')]){_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')]['messageId']=rs[_0xe0a7('0x52')]()+'\x20'+_0x548b37['body'][_0xe0a7('0x16')][_0xe0a7('0x34')];}var _0x5ddbc0={'ContactId':_0x14d8a9['id'],'MailAccountId':_0x548b37[_0xe0a7('0x43')]['id'],'inReplyTo':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x51')],'to':_0x548b37['body']['message'][_0xe0a7('0x34')],'cc':_0x548b37['body']['message']['cc'],'subject':_0x548b37['body'][_0xe0a7('0x16')]['subject'],'attach':_0x548b37['body'][_0xe0a7('0x16')][_0xe0a7('0x53')],'lastMsgAt':moment()[_0xe0a7('0x54')](_0xe0a7('0x55')),'lastMsgDirection':'in'};return db[_0xe0a7('0x56')][_0xe0a7('0x29')]({'where':{'closed':![],'MailAccountId':_0x548b37[_0xe0a7('0x43')]['id']},'include':[{'model':db[_0xe0a7('0x57')],'as':_0xe0a7('0x58'),'attributes':[_0xe0a7('0x51')],'where':{'messageId':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x59')]}}]})[_0xe0a7('0x24')](function(_0x9418a3){if(_0x9418a3){return[_0x9418a3,![]];}return db['MailInteraction'][_0xe0a7('0x5a')](_0x5ddbc0)[_0xe0a7('0x24')](function(_0x12a406){return[_0x12a406,!![]];});});}else{throw new Error(_0xe0a7('0x5b'));}})[_0xe0a7('0x5c')](function(_0x13a5d1,_0x4f4b7a){if(_0x13a5d1){_0x122376=_0x4f4b7a;if(!_0x4f4b7a){return _0x13a5d1[_0xe0a7('0x5d')]({'inReplyTo':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x51')],'to':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')]['from'],'cc':_0x548b37['body'][_0xe0a7('0x16')]['cc'],'subject':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x5e')],'attach':_0x13a5d1[_0xe0a7('0x53')]?_0x13a5d1[_0xe0a7('0x53')]:_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')]['attach'],'substatus':null,'substatusAt':moment()[_0xe0a7('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x13a5d1;}}})['then'](function(_0x585ec9){_0xb542fb[_0xe0a7('0x5f')]=_0x585ec9[_0xe0a7('0x42')]({'plain':!![]});_0xb542fb['interaction'][_0xe0a7('0x60')]=_0x122376;return db[_0xe0a7('0x57')][_0xe0a7('0x5a')]({'body':_0x548b37['body'][_0xe0a7('0x33')],'MailAccountId':_0x548b37['account']['id'],'MailInteractionId':_0x585ec9['id'],'direction':'in','ContactId':_0xb542fb[_0xe0a7('0x61')]['id'],'messageId':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x51')],'from':_0x548b37[_0xe0a7('0x33')]['message']['from'],'to':_0x548b37['body'][_0xe0a7('0x16')]['to'],'cc':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')]['cc'],'subject':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x5e')],'attach':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x53')],'Attachments':_0x548b37[_0xe0a7('0x33')]['message'][_0xe0a7('0x62')],'originTo':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x63')],'originCc':_0x548b37[_0xe0a7('0x33')]['message']['originCc'],'bcc':_0x548b37[_0xe0a7('0x33')][_0xe0a7('0x16')][_0xe0a7('0x64')],'ChatWebsiteId':_0x548b37['body'][_0xe0a7('0x16')][_0xe0a7('0x65')]||null,'originChannel':_0x548b37[_0xe0a7('0x33')]['message'][_0xe0a7('0x66')]||_0xe0a7('0x67'),'ChatOfflineMessageId':_0x548b37['body']['message'][_0xe0a7('0x68')]||null},{'include':[{'model':db['Attachment'],'as':_0xe0a7('0x69')}]});})[_0xe0a7('0x24')](function(_0x79fddf){_0xb542fb['message']=_0x79fddf;if(_0xb542fb['interaction'][_0xe0a7('0x6a')]){return db[_0xe0a7('0x6b')][_0xe0a7('0x29')]({'attributes':['id',_0xe0a7('0x6c')],'where':{'id':_0xb542fb[_0xe0a7('0x5f')][_0xe0a7('0x6a')]}})[_0xe0a7('0x24')](function(_0x1153e3){if(_0x1153e3){_0xb542fb[_0xe0a7('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe0a7('0x6d'),'appdata':_0x1153e3[_0xe0a7('0x6c')]+','+(_0xb542fb[_0xe0a7('0x43')][_0xe0a7('0x6e')]||0xa),'interval':_0xe0a7('0x4e')});}return respondWithRpcPromise(_0xe0a7('0x6f'),_0xe0a7('0x70'),_0xb542fb);});}return respondWithRpcPromise(_0xe0a7('0x6f'),_0xe0a7('0x70'),_0xb542fb);})[_0xe0a7('0x24')](function(_0x4507aa){_0x470600(_0x4507aa);})[_0xe0a7('0x19')](function(_0xde2664){_0x49e631(_0x389aff[_0xe0a7('0x14')](0x1f4,_0xde2664['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 95b474f..d69ed45 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 _0x0e3b=['remove','register','mailAccount:','./mailAccount.events','save'];(function(_0x481ad2,_0x3184ba){var _0x506dd3=function(_0x55e05d){while(--_0x55e05d){_0x481ad2['push'](_0x481ad2['shift']());}};_0x506dd3(++_0x3184ba);}(_0x0e3b,0x125));var _0xb0e3=function(_0x506a4f,_0x188735){_0x506a4f=_0x506a4f-0x0;var _0x59ab1b=_0x0e3b[_0x506a4f];return _0x59ab1b;};'use strict';var MailAccountEvents=require(_0xb0e3('0x0'));var events=[_0xb0e3('0x1'),_0xb0e3('0x2'),'update'];function createListener(_0x20273f,_0x3cb9f7){return function(_0x218432){_0x3cb9f7['emit'](_0x20273f,_0x218432);};}function removeListener(_0x1be343,_0x34a883){return function(){MailAccountEvents['removeListener'](_0x1be343,_0x34a883);};}exports[_0xb0e3('0x3')]=function(_0x200de2){for(var _0xdb86ef=0x0,_0x3e1de0=events['length'];_0xdb86ef<_0x3e1de0;_0xdb86ef++){var _0x29af3a=events[_0xdb86ef];var _0x4a796f=createListener(_0xb0e3('0x4')+_0x29af3a,_0x200de2);MailAccountEvents['on'](_0x29af3a,_0x4a796f);}}; \ No newline at end of file +var _0x3a20=['save','update','register','mailAccount:'];(function(_0x5aabaf,_0x497eb0){var _0x54449e=function(_0x4fbe30){while(--_0x4fbe30){_0x5aabaf['push'](_0x5aabaf['shift']());}};_0x54449e(++_0x497eb0);}(_0x3a20,0xd0));var _0x03a2=function(_0x3052ac,_0x10bf53){_0x3052ac=_0x3052ac-0x0;var _0x56a388=_0x3a20[_0x3052ac];return _0x56a388;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x03a2('0x0'),'remove',_0x03a2('0x1')];function createListener(_0x546a49,_0xb8442){return function(_0x525720){_0xb8442['emit'](_0x546a49,_0x525720);};}function removeListener(_0x48afbd,_0x1bc8b4){return function(){MailAccountEvents['removeListener'](_0x48afbd,_0x1bc8b4);};}exports[_0x03a2('0x2')]=function(_0x1d066d){for(var _0x5c275d=0x0,_0x1f124f=events['length'];_0x5c275d<_0x1f124f;_0x5c275d++){var _0x1e43c1=events[_0x5c275d];var _0x1e1a86=createListener(_0x03a2('0x3')+_0x1e43c1,_0x1d066d);MailAccountEvents['on'](_0x1e43c1,_0x1e1a86);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3664638..f9e971f 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 _0x80be=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b9f03,_0x4f1574){var _0x445679=function(_0x424ba1){while(--_0x424ba1){_0x4b9f03['push'](_0x4b9f03['shift']());}};_0x445679(++_0x4f1574);}(_0x80be,0x9f));var _0xe80b=function(_0x2e1ed8,_0x311558){_0x2e1ed8=_0x2e1ed8-0x0;var _0x24b8c6=_0x80be[_0x2e1ed8];return _0x24b8c6;};'use strict';var multer=require(_0xe80b('0x0'));var util=require('util');var path=require(_0xe80b('0x1'));var timeout=require(_0xe80b('0x2'));var express=require(_0xe80b('0x3'));var router=express[_0xe80b('0x4')]();var fs_extra=require(_0xe80b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe80b('0x6'));var config=require(_0xe80b('0x7'));var controller=require(_0xe80b('0x8'));router[_0xe80b('0x9')](_0xe80b('0xa'),auth[_0xe80b('0xb')](),controller[_0xe80b('0xc')]);router['put'](_0xe80b('0xa'),auth['isAuthenticated'](),controller[_0xe80b('0xd')]);router[_0xe80b('0xe')](_0xe80b('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8e9d=['../../config/environment','./mailApplication.controller','/:id','isAuthenticated','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x8e9d,0x112));var _0xd8e9=function(_0x37628a,_0xa78202){_0x37628a=_0x37628a-0x0;var _0xdd7185=_0x8e9d[_0x37628a];return _0xdd7185;};'use strict';var multer=require(_0xd8e9('0x0'));var util=require('util');var path=require(_0xd8e9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8e9('0x2'));var router=express[_0xd8e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd8e9('0x4'));var interaction=require(_0xd8e9('0x5'));var config=require(_0xd8e9('0x6'));var controller=require(_0xd8e9('0x7'));router['get'](_0xd8e9('0x8'),auth[_0xd8e9('0x9')](),controller['show']);router[_0xd8e9('0xa')](_0xd8e9('0x8'),auth[_0xd8e9('0x9')](),controller[_0xd8e9('0xb')]);router[_0xd8e9('0xc')]('/:id',auth[_0xd8e9('0x9')](),controller['destroy']);module[_0xd8e9('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 141233a..1536098 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 _0x2017=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x10e766,_0x5bc623){var _0x3febc5=function(_0x2ed8cd){while(--_0x2ed8cd){_0x10e766['push'](_0x10e766['shift']());}};_0x3febc5(++_0x5bc623);}(_0x2017,0x123));var _0x7201=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0x2017[_0x4a9beb];return _0x2d4c58;};'use strict';var Sequelize=require(_0x7201('0x0'));module[_0x7201('0x1')]={'priority':{'type':Sequelize[_0x7201('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7201('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7201('0x4')]},'interval':{'type':Sequelize[_0x7201('0x4')],'defaultValue':_0x7201('0x5')}}; \ No newline at end of file +var _0x9734=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0x508371,_0x57832a){var _0x2a9960=function(_0x5ed097){while(--_0x5ed097){_0x508371['push'](_0x508371['shift']());}};_0x2a9960(++_0x57832a);}(_0x9734,0xe6));var _0x4973=function(_0x53e2ef,_0x33ea60){_0x53e2ef=_0x53e2ef-0x0;var _0x4e0fd8=_0x9734[_0x53e2ef];return _0x4e0fd8;};'use strict';var Sequelize=require(_0x4973('0x0'));module[_0x4973('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4973('0x2')],'allowNull':![],'defaultValue':_0x4973('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4973('0x2')]},'interval':{'type':Sequelize[_0x4973('0x2')],'defaultValue':_0x4973('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 28fd0f3..9bc57b1 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 _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(_0x5c89ef,_0x296c7e){var _0x517710=function(_0x4fd0e7){while(--_0x4fd0e7){_0x5c89ef['push'](_0x5c89ef['shift']());}};_0x517710(++_0x296c7e);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'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 +var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x584da8,_0x4944c4){var _0x4da924=function(_0x348f16){while(--_0x348f16){_0x584da8['push'](_0x584da8['shift']());}};_0x4da924(++_0x4944c4);}(_0x70e0,0x17b));var _0x070e=function(_0x2b9757,_0x4519c0){_0x2b9757=_0x2b9757-0x0;var _0xc06e5=_0x70e0[_0x2b9757];return _0xc06e5;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2cd8d95..f823088 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 _0xc84f=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0xc69a36,_0x5f4f14){var _0x576e72=function(_0x25fdca){while(--_0x25fdca){_0xc69a36['push'](_0xc69a36['shift']());}};_0x576e72(++_0x5f4f14);}(_0xc84f,0xf8));var _0xfc84=function(_0x1f8ebb,_0x213a6e){_0x1f8ebb=_0x1f8ebb-0x0;var _0x5e4c16=_0xc84f[_0x1f8ebb];return _0x5e4c16;};'use strict';var _=require(_0xfc84('0x0'));var util=require(_0xfc84('0x1'));var logger=require('../../config/logger')(_0xfc84('0x2'));var moment=require('moment');var BPromise=require(_0xfc84('0x3'));var rp=require(_0xfc84('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc84('0x5'));var config=require('../../config/environment');var attributes=require(_0xfc84('0x6'));module[_0xfc84('0x7')]=function(_0x1f5bfc,_0x16fc89){return _0x1f5bfc[_0xfc84('0x8')](_0xfc84('0x9'),attributes,{'tableName':_0xfc84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc84('0xb'),'collate':_0xfc84('0xc')});}; \ No newline at end of file +var _0x563f=['utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','utf8mb4'];(function(_0x4704b0,_0x4cf9dc){var _0xf6a7c5=function(_0x77ab39){while(--_0x77ab39){_0x4704b0['push'](_0x4704b0['shift']());}};_0xf6a7c5(++_0x4cf9dc);}(_0x563f,0x1f0));var _0xf563=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x563f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf563('0x2'));var BPromise=require(_0xf563('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf563('0x4'));var rimraf=require(_0xf563('0x5'));var config=require(_0xf563('0x6'));var attributes=require(_0xf563('0x7'));module[_0xf563('0x8')]=function(_0x2ea944,_0x1b7b99){return _0x2ea944['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf563('0x9'),'collate':_0xf563('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d76d5de..3c28deb 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 _0x9909=['../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','update','body','options','where','attributes','UpdateMailApplication','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x256e40,_0x6e651d){var _0x15a4a6=function(_0x1c8bbf){while(--_0x1c8bbf){_0x256e40['push'](_0x256e40['shift']());}};_0x15a4a6(++_0x6e651d);}(_0x9909,0x19d));var _0x9990=function(_0x13c583,_0x4d28d1){_0x13c583=_0x13c583-0x0;var _0x15ae45=_0x9909[_0x13c583];return _0x15ae45;};'use strict';var _=require(_0x9990('0x0'));var util=require(_0x9990('0x1'));var moment=require('moment');var BPromise=require(_0x9990('0x2'));var rs=require(_0x9990('0x3'));var fs=require('fs');var Redis=require(_0x9990('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9990('0x5'))(_0x9990('0x6'));var config=require(_0x9990('0x7'));var jayson=require(_0x9990('0x8'));var client=jayson[_0x9990('0x9')][_0x9990('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49d88d,_0x24d7ef,_0x2b256a){return new BPromise(function(_0x1c7cf7,_0x1bd304){return client[_0x9990('0xb')](_0x49d88d,_0x2b256a)[_0x9990('0xc')](function(_0xa27397){logger[_0x9990('0xd')](_0x9990('0xe'),_0x24d7ef,_0x9990('0xf'));logger[_0x9990('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x24d7ef,'request\x20sent',JSON[_0x9990('0x11')](_0xa27397));if(_0xa27397['error']){if(_0xa27397[_0x9990('0x12')]['code']===0x1f4){logger[_0x9990('0x12')]('MailApplication,\x20%s,\x20%s',_0x24d7ef,_0xa27397[_0x9990('0x12')]['message']);return _0x1bd304(_0xa27397[_0x9990('0x12')][_0x9990('0x13')]);}logger[_0x9990('0x12')](_0x9990('0xe'),_0x24d7ef,_0xa27397[_0x9990('0x12')][_0x9990('0x13')]);return _0x1c7cf7(_0xa27397['error']['message']);}else{logger[_0x9990('0xd')](_0x9990('0xe'),_0x24d7ef,_0x9990('0xf'));_0x1c7cf7(_0xa27397[_0x9990('0x14')][_0x9990('0x13')]);}})['catch'](function(_0x3a48df){logger['error']('MailApplication,\x20%s,\x20%s',_0x24d7ef,_0x3a48df);_0x1bd304(_0x3a48df);});});}exports['UpdateMailApplication']=function(_0x5a4905){var _0x3386f5=this;return new Promise(function(_0x164af8,_0x265874){return db['MailApplication'][_0x9990('0x15')](_0x5a4905[_0x9990('0x16')],{'raw':_0x5a4905[_0x9990('0x17')]?_0x5a4905[_0x9990('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a4905[_0x9990('0x17')]?_0x5a4905[_0x9990('0x17')][_0x9990('0x18')]||null:null,'attributes':_0x5a4905[_0x9990('0x17')]?_0x5a4905['options'][_0x9990('0x19')]||null:null,'limit':_0x5a4905[_0x9990('0x17')]?_0x5a4905[_0x9990('0x17')]['limit']||null:null})['then'](function(_0x23dd25){logger[_0x9990('0xd')](_0x9990('0x1a'),_0x5a4905);logger['debug']('UpdateMailApplication',_0x5a4905,JSON['stringify'](_0x23dd25));_0x164af8(_0x23dd25);})[_0x9990('0x1b')](function(_0x2869ff){logger[_0x9990('0x12')]('UpdateMailApplication',_0x2869ff[_0x9990('0x13')],_0x5a4905);_0x265874(_0x3386f5[_0x9990('0x12')](0x1f4,_0x2869ff[_0x9990('0x13')]));});});}; \ No newline at end of file +var _0xd212=['attributes','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','where'];(function(_0xa4d131,_0x30e214){var _0x42f9d3=function(_0x150078){while(--_0x150078){_0xa4d131['push'](_0xa4d131['shift']());}};_0x42f9d3(++_0x30e214);}(_0xd212,0x14b));var _0x2d21=function(_0x2a7812,_0x1ce83a){_0x2a7812=_0x2a7812-0x0;var _0x3e1342=_0xd212[_0x2a7812];return _0x3e1342;};'use strict';var _=require('lodash');var util=require(_0x2d21('0x0'));var moment=require(_0x2d21('0x1'));var BPromise=require(_0x2d21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d21('0x4'));var logger=require(_0x2d21('0x5'))(_0x2d21('0x6'));var config=require(_0x2d21('0x7'));var jayson=require(_0x2d21('0x8'));var client=jayson[_0x2d21('0x9')][_0x2d21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ac397,_0x234fb5,_0x4d0750){return new BPromise(function(_0x19b86d,_0x3111a2){return client['request'](_0x3ac397,_0x4d0750)[_0x2d21('0xb')](function(_0x200ef1){logger[_0x2d21('0xc')](_0x2d21('0xd'),_0x234fb5,'request\x20sent');logger[_0x2d21('0xe')](_0x2d21('0xf'),_0x234fb5,_0x2d21('0x10'),JSON[_0x2d21('0x11')](_0x200ef1));if(_0x200ef1[_0x2d21('0x12')]){if(_0x200ef1['error'][_0x2d21('0x13')]===0x1f4){logger['error'](_0x2d21('0xd'),_0x234fb5,_0x200ef1['error'][_0x2d21('0x14')]);return _0x3111a2(_0x200ef1[_0x2d21('0x12')][_0x2d21('0x14')]);}logger[_0x2d21('0x12')](_0x2d21('0xd'),_0x234fb5,_0x200ef1[_0x2d21('0x12')]['message']);return _0x19b86d(_0x200ef1[_0x2d21('0x12')][_0x2d21('0x14')]);}else{logger[_0x2d21('0xc')](_0x2d21('0xd'),_0x234fb5,_0x2d21('0x10'));_0x19b86d(_0x200ef1[_0x2d21('0x15')]['message']);}})[_0x2d21('0x16')](function(_0x484136){logger[_0x2d21('0x12')](_0x2d21('0xd'),_0x234fb5,_0x484136);_0x3111a2(_0x484136);});});}exports[_0x2d21('0x17')]=function(_0x444595){var _0x3aaa17=this;return new Promise(function(_0x16795d,_0x12520b){return db[_0x2d21('0x18')][_0x2d21('0x19')](_0x444595['body'],{'raw':_0x444595[_0x2d21('0x1a')]?_0x444595[_0x2d21('0x1a')][_0x2d21('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x444595[_0x2d21('0x1a')]?_0x444595['options'][_0x2d21('0x1c')]||null:null,'attributes':_0x444595['options']?_0x444595[_0x2d21('0x1a')][_0x2d21('0x1d')]||null:null,'limit':_0x444595[_0x2d21('0x1a')]?_0x444595['options']['limit']||null:null})['then'](function(_0x50edcf){logger[_0x2d21('0xc')](_0x2d21('0x17'),_0x444595);logger[_0x2d21('0xe')]('UpdateMailApplication',_0x444595,JSON[_0x2d21('0x11')](_0x50edcf));_0x16795d(_0x50edcf);})[_0x2d21('0x16')](function(_0x5a25e5){logger[_0x2d21('0x12')](_0x2d21('0x17'),_0x5a25e5['message'],_0x444595);_0x12520b(_0x3aaa17['error'](0x1f4,_0x5a25e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5e5291b..328a8c4 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 _0x965a=['download','post','create','addMessage','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x12497a,_0x6a91e9){var _0x399983=function(_0x38d005){while(--_0x38d005){_0x12497a['push'](_0x12497a['shift']());}};_0x399983(++_0x6a91e9);}(_0x965a,0xc4));var _0xa965=function(_0xbfaa6e,_0x29ebf4){_0xbfaa6e=_0xbfaa6e-0x0;var _0x932378=_0x965a[_0xbfaa6e];return _0x932378;};'use strict';var express=require(_0xa965('0x0'));var router=express[_0xa965('0x1')]();var auth=require(_0xa965('0x2'));var interaction=require(_0xa965('0x3'));var controller=require('./mailInteraction.controller');router[_0xa965('0x4')]('/',auth[_0xa965('0x5')](),controller[_0xa965('0x6')]);router['get'](_0xa965('0x7'),auth[_0xa965('0x5')](),controller[_0xa965('0x8')]);router['get'](_0xa965('0x9'),auth[_0xa965('0x5')](),controller[_0xa965('0xa')]);router[_0xa965('0x4')](_0xa965('0xb'),auth[_0xa965('0x5')](),controller[_0xa965('0xc')]);router[_0xa965('0x4')](_0xa965('0xd'),auth['isAuthenticated'](),controller[_0xa965('0xe')]);router[_0xa965('0xf')]('/',auth[_0xa965('0x5')](),controller[_0xa965('0x10')]);router['post']('/:id/messages',auth[_0xa965('0x5')](),controller[_0xa965('0x11')]);router[_0xa965('0xf')]('/:id/tags',auth[_0xa965('0x5')](),interaction['tracked'](_0xa965('0x12'),_0xa965('0x13')),controller[_0xa965('0x14')]);router[_0xa965('0x15')](_0xa965('0x9'),auth['isAuthenticated'](),interaction[_0xa965('0x16')](_0xa965('0x12'),_0xa965('0x17')),controller[_0xa965('0x18')]);router[_0xa965('0x19')](_0xa965('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xa965('0x12'),_0xa965('0x1a')),controller[_0xa965('0x1b')]);router[_0xa965('0x19')](_0xa965('0x1c'),auth[_0xa965('0x5')](),controller[_0xa965('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x4e68=['/:id/tags','tracked','mail','addTags','put','/:id','mailinteraction:update','delete','mailinteraction:destroy','destroy','exports','express','Router','./mailInteraction.controller','get','isAuthenticated','/describe','/:id/messages','getMessages','post','addMessage'];(function(_0x4d0146,_0x31f115){var _0x367086=function(_0x5e0599){while(--_0x5e0599){_0x4d0146['push'](_0x4d0146['shift']());}};_0x367086(++_0x31f115);}(_0x4e68,0x185));var _0x84e6=function(_0x2e93f4,_0x2a72b2){_0x2e93f4=_0x2e93f4-0x0;var _0x4ac9c0=_0x4e68[_0x2e93f4];return _0x4ac9c0;};'use strict';var express=require(_0x84e6('0x0'));var router=express[_0x84e6('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x84e6('0x2'));router[_0x84e6('0x3')]('/',auth[_0x84e6('0x4')](),controller['index']);router['get'](_0x84e6('0x5'),auth[_0x84e6('0x4')](),controller['describe']);router[_0x84e6('0x3')]('/:id',auth[_0x84e6('0x4')](),controller['show']);router[_0x84e6('0x3')](_0x84e6('0x6'),auth[_0x84e6('0x4')](),controller[_0x84e6('0x7')]);router[_0x84e6('0x3')]('/:id/download',auth[_0x84e6('0x4')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x84e6('0x8')](_0x84e6('0x6'),auth[_0x84e6('0x4')](),controller[_0x84e6('0x9')]);router[_0x84e6('0x8')](_0x84e6('0xa'),auth[_0x84e6('0x4')](),interaction[_0x84e6('0xb')](_0x84e6('0xc'),'mailinteraction:addtags'),controller[_0x84e6('0xd')]);router[_0x84e6('0xe')](_0x84e6('0xf'),auth['isAuthenticated'](),interaction[_0x84e6('0xb')](_0x84e6('0xc'),_0x84e6('0x10')),controller['update']);router[_0x84e6('0x11')](_0x84e6('0xf'),auth[_0x84e6('0x4')](),interaction[_0x84e6('0xb')](_0x84e6('0xc'),_0x84e6('0x12')),controller[_0x84e6('0x13')]);router[_0x84e6('0x11')](_0x84e6('0xa'),auth['isAuthenticated'](),controller['removeTags']);module[_0x84e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5c74f11..8e547c0 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 _0x3459=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','exports'];(function(_0x28678d,_0x54324f){var _0x1643e9=function(_0x873a6c){while(--_0x873a6c){_0x28678d['push'](_0x28678d['shift']());}};_0x1643e9(++_0x54324f);}(_0x3459,0x19c));var _0x9345=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3459[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x9345('0x0'));var iconv=require('iconv');module[_0x9345('0x1')]={'closed':{'type':Sequelize[_0x9345('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9345('0x3')]},'disposition':{'type':Sequelize[_0x9345('0x4')]},'secondDisposition':{'type':Sequelize[_0x9345('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x9345('0x4')]},'cc':{'type':Sequelize[_0x9345('0x5')](_0x9345('0x6'))},'subject':{'type':Sequelize[_0x9345('0x5')]()},'attach':{'type':Sequelize[_0x9345('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x9345('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x9345('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9345('0x7')]('in',_0x9345('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9345('0x7')]('in',_0x9345('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x97a1=['STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize','iconv','exports','DATE'];(function(_0x365945,_0x4b0c94){var _0x59953b=function(_0x51aa39){while(--_0x51aa39){_0x365945['push'](_0x365945['shift']());}};_0x59953b(++_0x4b0c94);}(_0x97a1,0x1b4));var _0x197a=function(_0x30490c,_0xc861e2){_0x30490c=_0x30490c-0x0;var _0x4cf7e0=_0x97a1[_0x30490c];return _0x4cf7e0;};'use strict';var Sequelize=require(_0x197a('0x0'));var iconv=require(_0x197a('0x1'));module[_0x197a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x197a('0x3')]},'disposition':{'type':Sequelize[_0x197a('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x197a('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x197a('0x4')]},'cc':{'type':Sequelize[_0x197a('0x5')](_0x197a('0x6'))},'subject':{'type':Sequelize[_0x197a('0x5')]()},'attach':{'type':Sequelize[_0x197a('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x197a('0x3')]},'substatus':{'type':Sequelize[_0x197a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x197a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x197a('0x8')]('in',_0x197a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x197a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2855f78..56b72de 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 _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x9d1c24,_0x30a055){var _0x5ba16a=function(_0x2dfe3e){while(--_0x2dfe3e){_0x9d1c24['push'](_0x9d1c24['shift']());}};_0x5ba16a(++_0x30a055);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0xdc06ca,_0x3950c5){var _0x4fea82=function(_0x40b470){while(--_0x40b470){_0xdc06ca['push'](_0xdc06ca['shift']());}};_0x4fea82(++_0x3950c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 740aada..b7702dd 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 _0x01a2=['setMaxListeners','save','update','getUsers','Users','map','then','setDataValue','unreadMessages','length','emit','catch','hook','events','MailInteraction','MailMessage'];(function(_0x2ce891,_0x259a3e){var _0x17f3a1=function(_0x21d57f){while(--_0x21d57f){_0x2ce891['push'](_0x2ce891['shift']());}};_0x17f3a1(++_0x259a3e);}(_0x01a2,0x18d));var _0x201a=function(_0x3a0976,_0x2f8f0d){_0x3a0976=_0x3a0976-0x0;var _0x5fa734=_0x01a2[_0x3a0976];return _0x5fa734;};'use strict';var EventEmitter=require(_0x201a('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x201a('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x201a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x201a('0x3')](0x0);var events={'afterCreate':_0x201a('0x4'),'afterUpdate':_0x201a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3c8b07){return function(_0x1ac593,_0x53470a,_0x519a37){_0x1ac593[_0x201a('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ec160){_0x1ac593['setDataValue'](_0x201a('0x7'),_0x3ec160[_0x201a('0x8')](function(_0x5c4241){return{'id':_0x5c4241['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1ac593['id'],'direction':'in','read':![]},'raw':!![]});})[_0x201a('0x9')](function(_0x1bc90b){_0x1ac593[_0x201a('0xa')](_0x201a('0xb'),_0x1bc90b[_0x201a('0xc')]);MailInteractionEvents[_0x201a('0xd')](_0x3c8b07+':'+_0x1ac593['id'],_0x1ac593);MailInteractionEvents[_0x201a('0xd')](_0x3c8b07,_0x1ac593);_0x519a37(null);})[_0x201a('0xe')](_0x519a37(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x201a('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x2461=['findAll','unreadMessages','length','emit','hook','events','MailInteraction','../../mysqldb','save','remove','then','setDataValue','map'];(function(_0x14f6fa,_0x44743d){var _0x2c62a5=function(_0x398da0){while(--_0x398da0){_0x14f6fa['push'](_0x14f6fa['shift']());}};_0x2c62a5(++_0x44743d);}(_0x2461,0x157));var _0x1246=function(_0x486807,_0x151606){_0x486807=_0x486807-0x0;var _0x24f522=_0x2461[_0x486807];return _0x24f522;};'use strict';var EventEmitter=require(_0x1246('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x1246('0x1')];var MailMessage=require(_0x1246('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1246('0x3'),'afterUpdate':'update','afterDestroy':_0x1246('0x4')};function emitEvent(_0x415582){return function(_0x34a37b,_0x30acbe,_0x5049f5){_0x34a37b['getUsers']({'attributes':['id'],'raw':!![]})[_0x1246('0x5')](function(_0x10bc47){_0x34a37b[_0x1246('0x6')]('Users',_0x10bc47[_0x1246('0x7')](function(_0x143e5b){return{'id':_0x143e5b['id']};}));return MailMessage[_0x1246('0x8')]({'where':{'MailInteractionId':_0x34a37b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1246('0x5')](function(_0x3353e7){_0x34a37b[_0x1246('0x6')](_0x1246('0x9'),_0x3353e7[_0x1246('0xa')]);MailInteractionEvents[_0x1246('0xb')](_0x415582+':'+_0x34a37b['id'],_0x34a37b);MailInteractionEvents[_0x1246('0xb')](_0x415582,_0x34a37b);_0x5049f5(null);})['catch'](_0x5049f5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x1246('0xc')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0c36639..a5856ac 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 _0xe698=['models','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','format'];(function(_0x484e22,_0x487e81){var _0x52ada2=function(_0x56237b){while(--_0x56237b){_0x484e22['push'](_0x484e22['shift']());}};_0x52ada2(++_0x487e81);}(_0xe698,0x14a));var _0x8e69=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe698[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8e69('0x2'));var BPromise=require(_0x8e69('0x3'));var rp=require(_0x8e69('0x4'));var fs=require('fs');var path=require(_0x8e69('0x5'));var rimraf=require(_0x8e69('0x6'));var config=require(_0x8e69('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x8e69('0x8')]=function(_0x2f1e32,_0x4c7c80){return _0x2f1e32[_0x8e69('0x9')]('MailInteraction',attributes,{'tableName':_0x8e69('0xa'),'paranoid':![],'indexes':[{'name':_0x8e69('0xb'),'fields':[_0x8e69('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4bda44,_0x3bcefa,_0x341fb8){if(_0x4bda44[_0x8e69('0xd')]){_0x4bda44[_0x8e69('0xe')]=moment()['format'](_0x8e69('0xf'));}if(_0x4bda44[_0x8e69('0x10')]){_0x4bda44[_0x8e69('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x341fb8(null,_0x3bcefa);},'beforeUpdate':function(_0x42e958,_0x129776,_0x22a237){if(_0x42e958[_0x8e69('0x12')](_0x8e69('0xd'))){_0x42e958[_0x8e69('0xe')]=_0x42e958[_0x8e69('0xd')]?moment()[_0x8e69('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x42e958[_0x8e69('0x12')]('closed')){_0x42e958[_0x8e69('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42e958[_0x8e69('0xd')]=null;_0x42e958[_0x8e69('0xe')]=null;}_0x22a237(null,_0x42e958);},'afterUpdate':function(_0x16417c,_0x56739e,_0x3c66e1){var _0x148545=_0x2f1e32[_0x8e69('0x14')];var _0x3870d0=_0x16417c['get']({'plain':!![]});if(_0x3870d0[_0x8e69('0x10')]){return _0x148545[_0x8e69('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3870d0['id']}})[_0x8e69('0x16')](function(){_0x3c66e1();})['catch'](function(_0xc6db04){_0x3c66e1(_0xc6db04);});}else{_0x3c66e1();}}},'charset':_0x8e69('0x17'),'collate':_0x8e69('0x18')});}; \ No newline at end of file +var _0x49a6=['request-promise','path','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models','get','then','utf8mb4','util','../../config/logger','api','moment'];(function(_0x35a7d7,_0x3fbed3){var _0xc2efed=function(_0x5d301e){while(--_0x5d301e){_0x35a7d7['push'](_0x35a7d7['shift']());}};_0xc2efed(++_0x3fbed3);}(_0x49a6,0xf9));var _0x649a=function(_0x561b3e,_0x263244){_0x561b3e=_0x561b3e-0x0;var _0x45bcfe=_0x49a6[_0x561b3e];return _0x45bcfe;};'use strict';var _=require('lodash');var util=require(_0x649a('0x0'));var logger=require(_0x649a('0x1'))(_0x649a('0x2'));var moment=require(_0x649a('0x3'));var BPromise=require('bluebird');var rp=require(_0x649a('0x4'));var fs=require('fs');var path=require(_0x649a('0x5'));var rimraf=require('rimraf');var config=require(_0x649a('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x649a('0x7')]=function(_0x2e2f29,_0x3346fc){return _0x2e2f29[_0x649a('0x8')]('MailInteraction',attributes,{'tableName':_0x649a('0x9'),'paranoid':![],'indexes':[{'name':_0x649a('0xa'),'fields':[_0x649a('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd21b05,_0x235423,_0x589018){if(_0xd21b05[_0x649a('0xc')]){_0xd21b05[_0x649a('0xd')]=moment()['format'](_0x649a('0xe'));}if(_0xd21b05[_0x649a('0xf')]){_0xd21b05['closedAt']=moment()[_0x649a('0x10')](_0x649a('0xe'));}_0x589018(null,_0x235423);},'beforeUpdate':function(_0x186ec2,_0x51fd40,_0x46a2d9){if(_0x186ec2[_0x649a('0x11')](_0x649a('0xc'))){_0x186ec2[_0x649a('0xd')]=_0x186ec2[_0x649a('0xc')]?moment()['format'](_0x649a('0xe')):null;}if(_0x186ec2[_0x649a('0x11')](_0x649a('0xf'))){_0x186ec2[_0x649a('0x12')]=moment()[_0x649a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x186ec2[_0x649a('0xc')]=null;_0x186ec2['substatusAt']=null;}_0x46a2d9(null,_0x186ec2);},'afterUpdate':function(_0x8c6ef5,_0x4bd7c3,_0x210eed){var _0x4c3185=_0x2e2f29[_0x649a('0x13')];var _0xbb4b51=_0x8c6ef5[_0x649a('0x14')]({'plain':!![]});if(_0xbb4b51['closed']){return _0x4c3185['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0xbb4b51['id']}})[_0x649a('0x15')](function(){_0x210eed();})['catch'](function(_0x312de5){_0x210eed(_0x312de5);});}else{_0x210eed();}}},'charset':_0x649a('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index a193cb9..79beaf2 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 _0xae75=['request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','then','catch','AddTagsToMailInteraction','find','addTags','ids','omit','info','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register'];(function(_0x18adeb,_0x40c796){var _0x2e676a=function(_0x33918c){while(--_0x33918c){_0x18adeb['push'](_0x18adeb['shift']());}};_0x2e676a(++_0x40c796);}(_0xae75,0xce));var _0x5ae7=function(_0x17fa92,_0x320158){_0x17fa92=_0x17fa92-0x0;var _0x521765=_0xae75[_0x17fa92];return _0x521765;};'use strict';var _=require(_0x5ae7('0x0'));var util=require(_0x5ae7('0x1'));var moment=require('moment');var BPromise=require(_0x5ae7('0x2'));var rs=require(_0x5ae7('0x3'));var fs=require('fs');var Redis=require(_0x5ae7('0x4'));var db=require(_0x5ae7('0x5'))['db'];var utils=require(_0x5ae7('0x6'));var logger=require(_0x5ae7('0x7'))(_0x5ae7('0x8'));var config=require(_0x5ae7('0x9'));var jayson=require(_0x5ae7('0xa'));var client=jayson[_0x5ae7('0xb')][_0x5ae7('0xc')]({'port':0x232a});config[_0x5ae7('0xd')]=_[_0x5ae7('0xe')](config[_0x5ae7('0xd')],{'host':_0x5ae7('0xf'),'port':0x18eb});var socket=require(_0x5ae7('0x10'))(new Redis(config['redis']));require(_0x5ae7('0x11'))[_0x5ae7('0x12')](socket);function respondWithRpcPromise(_0x4ec27f,_0x4bc365,_0x21c1f9){return new BPromise(function(_0x3748ae,_0x4cc191){return client[_0x5ae7('0x13')](_0x4ec27f,_0x21c1f9)['then'](function(_0x3a5fe6){logger['info'](_0x5ae7('0x14'),_0x4bc365,_0x5ae7('0x15'));logger[_0x5ae7('0x16')](_0x5ae7('0x17'),_0x4bc365,_0x5ae7('0x15'),JSON[_0x5ae7('0x18')](_0x3a5fe6));if(_0x3a5fe6['error']){if(_0x3a5fe6[_0x5ae7('0x19')][_0x5ae7('0x1a')]===0x1f4){logger['error'](_0x5ae7('0x14'),_0x4bc365,_0x3a5fe6[_0x5ae7('0x19')][_0x5ae7('0x1b')]);return _0x4cc191(_0x3a5fe6[_0x5ae7('0x19')][_0x5ae7('0x1b')]);}logger[_0x5ae7('0x19')](_0x5ae7('0x14'),_0x4bc365,_0x3a5fe6[_0x5ae7('0x19')]['message']);return _0x3748ae(_0x3a5fe6[_0x5ae7('0x19')]['message']);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x4bc365,_0x5ae7('0x15'));_0x3748ae(_0x3a5fe6['result']['message']);}})['catch'](function(_0x558b3e){logger[_0x5ae7('0x19')](_0x5ae7('0x14'),_0x4bc365,_0x558b3e);_0x4cc191(_0x558b3e);});});}exports[_0x5ae7('0x1c')]=function(_0x281b5c){var _0x5e82d1=this;return new Promise(function(_0x35a7a5,_0x3d2a70){return db[_0x5ae7('0x1d')][_0x5ae7('0x1e')](_0x281b5c[_0x5ae7('0x1f')],{'raw':_0x281b5c[_0x5ae7('0x20')]?_0x281b5c[_0x5ae7('0x20')][_0x5ae7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x281b5c[_0x5ae7('0x20')]?_0x281b5c[_0x5ae7('0x20')][_0x5ae7('0x22')]||null:null,'attributes':_0x281b5c[_0x5ae7('0x20')]?_0x281b5c[_0x5ae7('0x20')]['attributes']||null:null,'limit':_0x281b5c[_0x5ae7('0x20')]?_0x281b5c[_0x5ae7('0x20')][_0x5ae7('0x23')]||null:null})[_0x5ae7('0x24')](function(_0x2b0649){logger['info'](_0x5ae7('0x1c'),_0x281b5c);logger[_0x5ae7('0x16')](_0x5ae7('0x1c'),_0x281b5c,JSON[_0x5ae7('0x18')](_0x2b0649));_0x35a7a5(_0x2b0649);})[_0x5ae7('0x25')](function(_0x5320ec){logger[_0x5ae7('0x19')](_0x5ae7('0x1c'),_0x5320ec['message'],_0x281b5c);_0x3d2a70(_0x5e82d1[_0x5ae7('0x19')](0x1f4,_0x5320ec[_0x5ae7('0x1b')]));});});};exports[_0x5ae7('0x26')]=function(_0x3864fd){return new Promise(function(_0xacacea,_0x195958){return db[_0x5ae7('0x1d')][_0x5ae7('0x27')]({'where':_0x3864fd[_0x5ae7('0x20')]?_0x3864fd['options'][_0x5ae7('0x22')]||null:null})[_0x5ae7('0x24')](function(_0x2bfc70){if(_0x2bfc70){return _0x2bfc70[_0x5ae7('0x28')](_0x3864fd[_0x5ae7('0x1f')][_0x5ae7('0x29')],_[_0x5ae7('0x2a')](_0x3864fd['body'],['ids','id'])||{});}})['spread'](function(_0x38402f){logger[_0x5ae7('0x2b')](_0x5ae7('0x2c'),_0x3864fd);logger['debug'](_0x5ae7('0x2c'),_0x3864fd,JSON['stringify'](_0x38402f));_0xacacea(_0x38402f);})[_0x5ae7('0x25')](function(_0x1dc573){logger[_0x5ae7('0x19')](_0x5ae7('0x2c'),_0x1dc573[_0x5ae7('0x1b')],_0x3864fd);_0x195958(_this[_0x5ae7('0x19')](0x1f4,_0x1dc573[_0x5ae7('0x1b')]));});});}; \ No newline at end of file +var _0xea1c=['register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','ids','omit','spread','AddTags','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket'];(function(_0x3f3e05,_0x4eb11e){var _0xfd61d5=function(_0x3716d2){while(--_0x3716d2){_0x3f3e05['push'](_0x3f3e05['shift']());}};_0xfd61d5(++_0x4eb11e);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcea1('0x0'));var BPromise=require(_0xcea1('0x1'));var rs=require(_0xcea1('0x2'));var fs=require('fs');var Redis=require(_0xcea1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea1('0x4'));var logger=require(_0xcea1('0x5'))(_0xcea1('0x6'));var config=require(_0xcea1('0x7'));var jayson=require(_0xcea1('0x8'));var client=jayson[_0xcea1('0x9')][_0xcea1('0xa')]({'port':0x232a});config[_0xcea1('0xb')]=_[_0xcea1('0xc')](config[_0xcea1('0xb')],{'host':_0xcea1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcea1('0xb')]));require(_0xcea1('0xe'))[_0xcea1('0xf')](socket);function respondWithRpcPromise(_0x4b2863,_0x4613d4,_0x1a31de){return new BPromise(function(_0x1e9298,_0x4097ed){return client[_0xcea1('0x10')](_0x4b2863,_0x1a31de)[_0xcea1('0x11')](function(_0x3eb7a9){logger[_0xcea1('0x12')](_0xcea1('0x13'),_0x4613d4,_0xcea1('0x14'));logger[_0xcea1('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4613d4,_0xcea1('0x14'),JSON['stringify'](_0x3eb7a9));if(_0x3eb7a9[_0xcea1('0x16')]){if(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x17')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x4613d4,_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);return _0x4097ed(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);}logger[_0xcea1('0x16')](_0xcea1('0x13'),_0x4613d4,_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);return _0x1e9298(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);}else{logger[_0xcea1('0x12')]('MailInteraction,\x20%s,\x20%s',_0x4613d4,'request\x20sent');_0x1e9298(_0x3eb7a9[_0xcea1('0x19')][_0xcea1('0x18')]);}})['catch'](function(_0x5eaec4){logger[_0xcea1('0x16')](_0xcea1('0x13'),_0x4613d4,_0x5eaec4);_0x4097ed(_0x5eaec4);});});}exports[_0xcea1('0x1a')]=function(_0xf206ac){var _0x4af892=this;return new Promise(function(_0x43fd48,_0x808fd4){return db[_0xcea1('0x1b')][_0xcea1('0x1c')](_0xf206ac[_0xcea1('0x1d')],{'raw':_0xf206ac['options']?_0xf206ac[_0xcea1('0x1e')][_0xcea1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf206ac[_0xcea1('0x1e')]?_0xf206ac['options']['where']||null:null,'attributes':_0xf206ac[_0xcea1('0x1e')]?_0xf206ac[_0xcea1('0x1e')][_0xcea1('0x20')]||null:null,'limit':_0xf206ac[_0xcea1('0x1e')]?_0xf206ac[_0xcea1('0x1e')][_0xcea1('0x21')]||null:null})[_0xcea1('0x11')](function(_0x2fb482){logger['info']('UpdateMailInteraction',_0xf206ac);logger['debug']('UpdateMailInteraction',_0xf206ac,JSON['stringify'](_0x2fb482));_0x43fd48(_0x2fb482);})['catch'](function(_0x15e19b){logger[_0xcea1('0x16')](_0xcea1('0x1a'),_0x15e19b[_0xcea1('0x18')],_0xf206ac);_0x808fd4(_0x4af892[_0xcea1('0x16')](0x1f4,_0x15e19b['message']));});});};exports[_0xcea1('0x22')]=function(_0x163c1d){return new Promise(function(_0x834bb8,_0x36f9e1){return db[_0xcea1('0x1b')]['find']({'where':_0x163c1d[_0xcea1('0x1e')]?_0x163c1d[_0xcea1('0x1e')][_0xcea1('0x23')]||null:null})[_0xcea1('0x11')](function(_0x369646){if(_0x369646){return _0x369646[_0xcea1('0x24')](_0x163c1d[_0xcea1('0x1d')][_0xcea1('0x25')],_[_0xcea1('0x26')](_0x163c1d['body'],[_0xcea1('0x25'),'id'])||{});}})[_0xcea1('0x27')](function(_0x59a79d){logger['info'](_0xcea1('0x28'),_0x163c1d);logger[_0xcea1('0x15')](_0xcea1('0x28'),_0x163c1d,JSON['stringify'](_0x59a79d));_0x834bb8(_0x59a79d);})[_0xcea1('0x29')](function(_0x2a6d43){logger[_0xcea1('0x16')](_0xcea1('0x28'),_0x2a6d43[_0xcea1('0x18')],_0x163c1d);_0x36f9e1(_this['error'](0x1f4,_0x2a6d43['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b6527c3..d04e554 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 _0xdd85=['update','removeListener','length','mailInteraction:','./mailInteraction.events','remove'];(function(_0x14d278,_0xda110d){var _0x2cf6e7=function(_0x51959d){while(--_0x51959d){_0x14d278['push'](_0x14d278['shift']());}};_0x2cf6e7(++_0xda110d);}(_0xdd85,0xbe));var _0x5dd8=function(_0x7b4b9d,_0x563617){_0x7b4b9d=_0x7b4b9d-0x0;var _0x43138b=_0xdd85[_0x7b4b9d];return _0x43138b;};'use strict';var MailInteractionEvents=require(_0x5dd8('0x0'));var events=['save',_0x5dd8('0x1'),_0x5dd8('0x2')];function createListener(_0x3259d4,_0x485c00){return function(_0x4881f8){_0x485c00['emit'](_0x3259d4,_0x4881f8);};}function removeListener(_0x37a3dc,_0x56e0ff){return function(){MailInteractionEvents[_0x5dd8('0x3')](_0x37a3dc,_0x56e0ff);};}exports['register']=function(_0x4b56ad){for(var _0x4b90ee=0x0,_0x98d9eb=events[_0x5dd8('0x4')];_0x4b90ee<_0x98d9eb;_0x4b90ee++){var _0x33c14d=events[_0x4b90ee];var _0x262bfb=createListener(_0x5dd8('0x5')+_0x33c14d,_0x4b56ad);MailInteractionEvents['on'](_0x33c14d,_0x262bfb);}}; \ No newline at end of file +var _0x2672=['register','length','mailInteraction:','./mailInteraction.events','update','emit'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x2672,0x75));var _0x2267=function(_0x29ef9f,_0x1da7d7){_0x29ef9f=_0x29ef9f-0x0;var _0x4a0712=_0x2672[_0x29ef9f];return _0x4a0712;};'use strict';var MailInteractionEvents=require(_0x2267('0x0'));var events=['save','remove',_0x2267('0x1')];function createListener(_0x233c29,_0x42f662){return function(_0x42df7f){_0x42f662[_0x2267('0x2')](_0x233c29,_0x42df7f);};}function removeListener(_0x4163ac,_0x2f180c){return function(){MailInteractionEvents['removeListener'](_0x4163ac,_0x2f180c);};}exports[_0x2267('0x3')]=function(_0x36f9eb){for(var _0x559a4a=0x0,_0xaa37f0=events[_0x2267('0x4')];_0x559a4a<_0xaa37f0;_0x559a4a++){var _0x38860d=events[_0x559a4a];var _0x353e74=createListener(_0x2267('0x5')+_0x38860d,_0x36f9eb);MailInteractionEvents['on'](_0x38860d,_0x353e74);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 7cb6fe2..a5ec477 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 _0x0bd5=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept'];(function(_0x3d5e72,_0x3ab167){var _0x2230e4=function(_0x4ede86){while(--_0x4ede86){_0x3d5e72['push'](_0x3d5e72['shift']());}};_0x2230e4(++_0x3ab167);}(_0x0bd5,0x1d5));var _0x50bd=function(_0x4e99f5,_0x3dcf6e){_0x4e99f5=_0x4e99f5-0x0;var _0x378b7d=_0x0bd5[_0x4e99f5];return _0x378b7d;};'use strict';var multer=require(_0x50bd('0x0'));var util=require(_0x50bd('0x1'));var path=require(_0x50bd('0x2'));var timeout=require(_0x50bd('0x3'));var express=require(_0x50bd('0x4'));var router=express[_0x50bd('0x5')]();var fs_extra=require(_0x50bd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50bd('0x7'));var config=require(_0x50bd('0x8'));var controller=require('./mailMessage.controller');router[_0x50bd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bd('0x9')](_0x50bd('0xa'),auth[_0x50bd('0xb')](),controller[_0x50bd('0xc')]);router[_0x50bd('0x9')](_0x50bd('0xd'),auth[_0x50bd('0xb')](),controller[_0x50bd('0xe')]);router['get'](_0x50bd('0xf'),auth[_0x50bd('0xb')](),controller[_0x50bd('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x50bd('0x11')](_0x50bd('0x12'),_0x50bd('0x13')),controller[_0x50bd('0x14')]);router['put'](_0x50bd('0xd'),auth['isAuthenticated'](),controller[_0x50bd('0x15')]);router[_0x50bd('0x16')](_0x50bd('0x17'),auth[_0x50bd('0xb')](),controller['accept']);router[_0x50bd('0x16')](_0x50bd('0x18'),auth[_0x50bd('0xb')](),controller[_0x50bd('0x19')]);router[_0x50bd('0x1a')](_0x50bd('0xd'),auth[_0x50bd('0xb')](),controller[_0x50bd('0x1b')]);module[_0x50bd('0x1c')]=router; \ No newline at end of file +var _0x4631=['exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','mail','update','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3b6a68,_0x18cc1d){var _0x27726f=function(_0x526c41){while(--_0x526c41){_0x3b6a68['push'](_0x3b6a68['shift']());}};_0x27726f(++_0x18cc1d);}(_0x4631,0xb9));var _0x1463=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x4631[_0x1d1d09];return _0x8827e;};'use strict';var multer=require(_0x1463('0x0'));var util=require(_0x1463('0x1'));var path=require('path');var timeout=require(_0x1463('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1463('0x3'));var config=require(_0x1463('0x4'));var controller=require(_0x1463('0x5'));router[_0x1463('0x6')]('/',auth[_0x1463('0x7')](),controller[_0x1463('0x8')]);router[_0x1463('0x6')]('/describe',auth[_0x1463('0x7')](),controller[_0x1463('0x9')]);router[_0x1463('0x6')](_0x1463('0xa'),auth['isAuthenticated'](),controller[_0x1463('0xb')]);router[_0x1463('0x6')](_0x1463('0xc'),auth['isAuthenticated'](),controller[_0x1463('0xd')]);router['post']('/',auth[_0x1463('0x7')](),interaction['tracked'](_0x1463('0xe'),'mailmessage:create'),controller['create']);router['put'](_0x1463('0xa'),auth[_0x1463('0x7')](),controller[_0x1463('0xf')]);router[_0x1463('0x10')](_0x1463('0x11'),auth[_0x1463('0x7')](),controller[_0x1463('0x12')]);router[_0x1463('0x10')](_0x1463('0x13'),auth[_0x1463('0x7')](),controller[_0x1463('0x14')]);router[_0x1463('0x15')](_0x1463('0xa'),auth[_0x1463('0x7')](),controller['destroy']);module[_0x1463('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index ace1377..85a43dd 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 _0x78cb=['BOOLEAN','Email','sequelize','lodash','exports','TEXT','long','ENUM','out','STRING','DATE','INTEGER'];(function(_0x26d749,_0x36a6cb){var _0x447650=function(_0x5023c0){while(--_0x5023c0){_0x26d749['push'](_0x26d749['shift']());}};_0x447650(++_0x36a6cb);}(_0x78cb,0x9e));var _0xb78c=function(_0x223373,_0x200901){_0x223373=_0x223373-0x0;var _0xc9c340=_0x78cb[_0x223373];return _0xc9c340;};'use strict';var Sequelize=require(_0xb78c('0x0'));var _=require(_0xb78c('0x1'));module[_0xb78c('0x2')]={'body':{'type':Sequelize[_0xb78c('0x3')](_0xb78c('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb78c('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb78c('0x5')]('in',_0xb78c('0x6')),'defaultValue':_0xb78c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb78c('0x7')](0x1fe)},'from':{'type':Sequelize[_0xb78c('0x7')]},'to':{'type':Sequelize[_0xb78c('0x3')](_0xb78c('0x4'))},'cc':{'type':Sequelize[_0xb78c('0x3')](_0xb78c('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xb78c('0x4'))},'subject':{'type':Sequelize[_0xb78c('0x3')]},'sentAt':{'type':Sequelize[_0xb78c('0x8')]},'attach':{'type':Sequelize[_0xb78c('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb78c('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb78c('0x8')]},'originTo':{'type':Sequelize[_0xb78c('0x3')]('long')},'originCc':{'type':Sequelize[_0xb78c('0x3')]('long')},'originChannel':{'type':Sequelize[_0xb78c('0x5')](_0xb78c('0xb'),'Chat'),'defaultValue':_0xb78c('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x79a3=['INTEGER','Email','sequelize','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x79a3,0x1be));var _0x379a=function(_0x293bda,_0x1ba989){_0x293bda=_0x293bda-0x0;var _0xa64fe6=_0x79a3[_0x293bda];return _0xa64fe6;};'use strict';var Sequelize=require(_0x379a('0x0'));var _=require('lodash');module[_0x379a('0x1')]={'body':{'type':Sequelize['TEXT'](_0x379a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x379a('0x3')](_0x379a('0x4'))},'read':{'type':Sequelize[_0x379a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x379a('0x6')]('in',_0x379a('0x7')),'defaultValue':_0x379a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x379a('0x8')]},'to':{'type':Sequelize['TEXT'](_0x379a('0x2'))},'cc':{'type':Sequelize[_0x379a('0x3')](_0x379a('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x379a('0x2'))},'subject':{'type':Sequelize[_0x379a('0x3')]},'sentAt':{'type':Sequelize[_0x379a('0x9')]},'attach':{'type':Sequelize[_0x379a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x379a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x379a('0x9')]},'originTo':{'type':Sequelize[_0x379a('0x3')](_0x379a('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x379a('0x2'))},'originChannel':{'type':Sequelize[_0x379a('0x6')](_0x379a('0xb'),'Chat'),'defaultValue':_0x379a('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a7e0bda..9d909a0 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 _0xb41a=['MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','status','json','undefined','count','offset','limit','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','update','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','authentication','user','pass','auth','secure','attachments','root','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','agent','get','MailInteraction','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','email','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','contact','fullname','download','toString','join','server','files','message-%s.eml','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8d43d8,_0x5ade02){var _0x43ee78=function(_0x422244){while(--_0x422244){_0x8d43d8['push'](_0x8d43d8['shift']());}};_0x43ee78(++_0x5ade02);}(_0xb41a,0x1c5));var _0xab41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb41a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xab41('0x0'));var moment=require(_0xab41('0x1'));var BPromise=require(_0xab41('0x2'));var util=require(_0xab41('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xab41('0x4'));var Redis=require(_0xab41('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xab41('0x6'));var logger=require(_0xab41('0x7'))(_0xab41('0x8'));var interaction_log=require(_0xab41('0x7'))(_0xab41('0x9'));var config=require(_0xab41('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xab41('0xb')](config[_0xab41('0xc')],{'host':_0xab41('0xd'),'port':0x18eb});var socket=require(_0xab41('0xe'))(new Redis(config[_0xab41('0xc')]));require(_0xab41('0xf'))[_0xab41('0x10')](socket);var jayson=require(_0xab41('0x11'));var client=jayson[_0xab41('0x12')][_0xab41('0x13')]({'port':0x232c});var client9003=jayson[_0xab41('0x12')]['http']({'port':0x232b});var client9002=jayson[_0xab41('0x12')][_0xab41('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x465428,_0x1c850c,_0x239755,_0x538549){return new BPromise(function(_0x5ec2b4,_0x371bb9){var _0x422101=_0x538549||client;return _0x422101['request'](_0x465428,_0x239755)[_0xab41('0x14')](function(_0x6337fc){logger['info'](_0xab41('0x15'),_0x1c850c,_0xab41('0x16'));logger[_0xab41('0x17')](_0xab41('0x18'),_0x1c850c,_0xab41('0x16'),JSON['stringify'](_0x6337fc));if(_0x6337fc[_0xab41('0x19')]){if(_0x6337fc[_0xab41('0x19')][_0xab41('0x1a')]===0x1f4){logger['error'](_0xab41('0x15'),_0x1c850c,_0x6337fc[_0xab41('0x19')][_0xab41('0x1b')]);return _0x371bb9(_0x6337fc['error'][_0xab41('0x1b')]);}logger['error'](_0xab41('0x15'),_0x1c850c,_0x6337fc[_0xab41('0x19')][_0xab41('0x1b')]);return _0x5ec2b4(_0x6337fc[_0xab41('0x19')][_0xab41('0x1b')]);}else{logger[_0xab41('0x1c')]('MailMessage,\x20%s,\x20%s',_0x1c850c,_0xab41('0x16'));_0x5ec2b4(_0x6337fc['result']['message']);}})[_0xab41('0x1d')](function(_0x507cee){logger[_0xab41('0x19')](_0xab41('0x15'),_0x1c850c,_0x507cee);_0x371bb9(_0x507cee);});});}function respondWithResult(_0x244e5d,_0x59e86c){_0x59e86c=_0x59e86c||0xc8;return function(_0x55639d){if(_0x55639d){return _0x244e5d[_0xab41('0x1e')](_0x59e86c)[_0xab41('0x1f')](_0x55639d);}};}function respondWithFilteredResult(_0x590325,_0x4a7abf){return function(_0x545390){if(_0x545390){var _0x183471=typeof _0x4a7abf['offset']==='undefined'&&typeof _0x4a7abf['limit']===_0xab41('0x20');var _0x1bd7cb=_0x545390[_0xab41('0x21')];var _0x3584f5=_0x183471?0x0:_0x4a7abf['offset'];var _0x1b1a31=_0x183471?_0x545390[_0xab41('0x21')]:_0x4a7abf[_0xab41('0x22')]+_0x4a7abf[_0xab41('0x23')];var _0x13d258;if(_0x1b1a31>=_0x1bd7cb){_0x1b1a31=_0x1bd7cb;_0x13d258=0xc8;}else{_0x13d258=0xce;}_0x590325[_0xab41('0x1e')](_0x13d258);return _0x590325['set']('Content-Range',_0x3584f5+'-'+_0x1b1a31+'/'+_0x1bd7cb)[_0xab41('0x1f')](_0x545390);}return null;};}function saveUpdates(_0x59456a){return function(_0x26fb3c){if(_0x26fb3c){return _0x26fb3c['update'](_0x59456a)[_0xab41('0x14')](function(_0x483395){return _0x483395;});}return null;};}function removeEntity(_0x511706){return function(_0x1dac9b){if(_0x1dac9b){return _0x1dac9b[_0xab41('0x24')]()[_0xab41('0x14')](function(){_0x511706[_0xab41('0x1e')](0xcc)[_0xab41('0x25')]();});}};}function handleEntityNotFound(_0x455c06){return function(_0x10ad38){if(!_0x10ad38){_0x455c06[_0xab41('0x26')](0x194);}return _0x10ad38;};}function handleError(_0x3500f2,_0x321e9f){_0x321e9f=_0x321e9f||0x1f4;return function(_0xda8e0){logger[_0xab41('0x19')](_0xda8e0['stack']);if(_0xda8e0[_0xab41('0x27')]){delete _0xda8e0[_0xab41('0x27')];}_0x3500f2[_0xab41('0x1e')](_0x321e9f)[_0xab41('0x28')](_0xda8e0);};}exports[_0xab41('0x29')]=function(_0x3a68d8,_0x5014eb){var _0xb7aa01={},_0x1970a9={},_0x3baf18={'count':0x0,'rows':[]};var _0x2bdc84=_[_0xab41('0x2a')](db[_0xab41('0x2b')][_0xab41('0x2c')],function(_0x24bc76){return{'name':_0x24bc76[_0xab41('0x2d')],'type':_0x24bc76[_0xab41('0x2e')][_0xab41('0x2f')]};});_0x1970a9[_0xab41('0x30')]=_[_0xab41('0x2a')](_0x2bdc84,_0xab41('0x27'));_0x1970a9[_0xab41('0x31')]=_['keys'](_0x3a68d8[_0xab41('0x31')]);_0x1970a9[_0xab41('0x32')]=_[_0xab41('0x33')](_0x1970a9[_0xab41('0x30')],_0x1970a9[_0xab41('0x31')]);_0xb7aa01[_0xab41('0x34')]=_[_0xab41('0x33')](_0x1970a9[_0xab41('0x30')],qs['fields'](_0x3a68d8[_0xab41('0x31')][_0xab41('0x35')]));_0xb7aa01[_0xab41('0x34')]=_0xb7aa01['attributes'][_0xab41('0x36')]?_0xb7aa01['attributes']:_0x1970a9[_0xab41('0x30')];if(!_0x3a68d8[_0xab41('0x31')][_0xab41('0x37')]('nolimit')){_0xb7aa01[_0xab41('0x23')]=qs[_0xab41('0x23')](_0x3a68d8[_0xab41('0x31')][_0xab41('0x23')]);_0xb7aa01[_0xab41('0x22')]=qs['offset'](_0x3a68d8['query']['offset']);}_0xb7aa01[_0xab41('0x38')]=qs[_0xab41('0x39')](_0x3a68d8['query'][_0xab41('0x39')]);_0xb7aa01[_0xab41('0x3a')]=qs['filters'](_[_0xab41('0x3b')](_0x3a68d8['query'],_0x1970a9['filters']),_0x2bdc84);if(_0x3a68d8['query'][_0xab41('0x3c')]){_0xb7aa01[_0xab41('0x3a')]=_['merge'](_0xb7aa01[_0xab41('0x3a')],{'$or':_[_0xab41('0x2a')](_0x2bdc84,function(_0x33cd22){if(_0x33cd22[_0xab41('0x2e')]!=='VIRTUAL'){var _0x23ab51={};_0x23ab51[_0x33cd22[_0xab41('0x27')]]={'$like':'%'+_0x3a68d8[_0xab41('0x31')][_0xab41('0x3c')]+'%'};return _0x23ab51;}})});}_0xb7aa01=_[_0xab41('0x3d')]({},_0xb7aa01,_0x3a68d8[_0xab41('0x3e')]);var _0x2789a2={'where':_0xb7aa01[_0xab41('0x3a')]};return db['MailMessage'][_0xab41('0x21')](_0x2789a2)[_0xab41('0x14')](function(_0x34e605){_0x3baf18[_0xab41('0x21')]=_0x34e605;if(_0x3a68d8[_0xab41('0x31')][_0xab41('0x3f')]){_0xb7aa01[_0xab41('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0xab41('0x41')](_0xb7aa01);})['then'](function(_0x5739b1){_0x3baf18[_0xab41('0x42')]=_0x5739b1;return _0x3baf18;})['then'](respondWithFilteredResult(_0x5014eb,_0xb7aa01))[_0xab41('0x1d')](handleError(_0x5014eb,null));};exports[_0xab41('0x43')]=function(_0x13fe23,_0x2ebe18){var _0x593bf9={'raw':!![],'where':{'id':_0x13fe23[_0xab41('0x44')]['id']}},_0x363294={};_0x363294[_0xab41('0x30')]=_[_0xab41('0x45')](db[_0xab41('0x2b')][_0xab41('0x2c')]);_0x363294[_0xab41('0x31')]=_[_0xab41('0x45')](_0x13fe23[_0xab41('0x31')]);_0x363294[_0xab41('0x32')]=_[_0xab41('0x33')](_0x363294[_0xab41('0x30')],_0x363294['query']);_0x593bf9['attributes']=_[_0xab41('0x33')](_0x363294['model'],qs[_0xab41('0x35')](_0x13fe23[_0xab41('0x31')][_0xab41('0x35')]));_0x593bf9['attributes']=_0x593bf9[_0xab41('0x34')][_0xab41('0x36')]?_0x593bf9[_0xab41('0x34')]:_0x363294[_0xab41('0x30')];if(_0x13fe23['query'][_0xab41('0x3f')]){_0x593bf9[_0xab41('0x40')]=[{'all':!![]}];}_0x593bf9=_['merge']({},_0x593bf9,_0x13fe23['options']);return db[_0xab41('0x2b')][_0xab41('0x46')](_0x593bf9)[_0xab41('0x14')](handleEntityNotFound(_0x2ebe18,null))[_0xab41('0x14')](respondWithResult(_0x2ebe18,null))[_0xab41('0x1d')](handleError(_0x2ebe18,null));};exports[_0xab41('0x47')]=function(_0xd148b6,_0x2db826){if(_0xd148b6[_0xab41('0x48')]['id']){delete _0xd148b6[_0xab41('0x48')]['id'];}return db[_0xab41('0x2b')][_0xab41('0x46')]({'where':{'id':_0xd148b6[_0xab41('0x44')]['id']}})[_0xab41('0x14')](handleEntityNotFound(_0x2db826,null))[_0xab41('0x14')](saveUpdates(_0xd148b6[_0xab41('0x48')],null))['then'](respondWithResult(_0x2db826,null))[_0xab41('0x1d')](handleError(_0x2db826,null));};exports[_0xab41('0x24')]=function(_0x8d0cb,_0x254c8a){return db[_0xab41('0x2b')][_0xab41('0x46')]({'where':{'id':_0x8d0cb[_0xab41('0x44')]['id']}})[_0xab41('0x14')](handleEntityNotFound(_0x254c8a,null))[_0xab41('0x14')](removeEntity(_0x254c8a,null))[_0xab41('0x1d')](handleError(_0x254c8a,null));};exports[_0xab41('0x49')]=function(_0x460c04,_0x430682){return db[_0xab41('0x2b')]['describe']()['then'](respondWithResult(_0x430682,null))[_0xab41('0x1d')](handleError(_0x430682,null));};exports[_0xab41('0x4a')]=function(_0x516caf,_0x840d6f){return db[_0xab41('0x2b')][_0xab41('0x4a')](_0x516caf[_0xab41('0x48')])[_0xab41('0x14')](function(_0x56f53f){if(_0x56f53f){if(_0x56f53f[_0xab41('0x4b')]===_0xab41('0x4c')&&!_0x56f53f[_0xab41('0x4d')]){var _0x32c142,_0x3a44cb,_0xd82078;if(_0x516caf[_0xab41('0x48')]['to']){_0x3a44cb=_0x516caf[_0xab41('0x48')]['to'][_0xab41('0x4e')](',')[0x0];}return db['MailAccount'][_0xab41('0x4f')]({'where':{'id':_0x56f53f[_0xab41('0x50')]},'include':[{'model':db[_0xab41('0x51')],'as':_0xab41('0x52'),'include':[{'model':db[_0xab41('0x53')],'as':_0xab41('0x54'),'where':{'email':_0x3a44cb},'limit':0x1,'order':[['updatedAt',_0xab41('0x55')]]}]},{'model':db[_0xab41('0x56')],'as':_0xab41('0x57'),'raw':!![]}]})[_0xab41('0x14')](function(_0xaa952d){_0x32c142=_0xaa952d;if(_0x32c142&&_0x32c142[_0xab41('0x57')]){var _0x5973f7={'tls':{'rejectUnauthorized':![]}};if(_[_0xab41('0x58')](_0x32c142['Smtp'][_0xab41('0x59')])){_0x5973f7[_0xab41('0x5a')]=_0x32c142[_0xab41('0x57')]['host'];_0x5973f7[_0xab41('0x5b')]=_0x32c142['Smtp'][_0xab41('0x5b')];_0x5973f7['secure']=_0x32c142[_0xab41('0x57')]['secure'];if(_0x32c142[_0xab41('0x57')][_0xab41('0x5c')]){_0x5973f7['auth']={'user':_0x32c142['Smtp'][_0xab41('0x5d')],'pass':_0x32c142[_0xab41('0x57')][_0xab41('0x5e')]};}}else{_0x5973f7[_0xab41('0x59')]=_0x32c142[_0xab41('0x57')][_0xab41('0x59')];_0x5973f7[_0xab41('0x5f')]={'user':_0x32c142[_0xab41('0x57')]['user'],'pass':_0x32c142[_0xab41('0x57')][_0xab41('0x5e')]};_0x5973f7[_0xab41('0x60')]=_0x32c142[_0xab41('0x57')][_0xab41('0x60')];}if(_0x516caf[_0xab41('0x48')]['attachments']&&_0x516caf['body']['attachments'][_0xab41('0x36')]){for(var _0x26d01a=0x0;_0x26d01a<_0x516caf[_0xab41('0x48')][_0xab41('0x61')][_0xab41('0x36')];_0x26d01a+=0x1){_0x516caf[_0xab41('0x48')][_0xab41('0x61')][_0x26d01a]={'filename':_0x516caf[_0xab41('0x48')][_0xab41('0x61')][_0x26d01a][_0xab41('0x27')],'path':path['join'](config[_0xab41('0x62')],'server/files/attachments',_0x516caf[_0xab41('0x48')]['attachments'][_0x26d01a]['basename'])};}}_0xd82078={'account':_0x5973f7,'message':_0x516caf[_0xab41('0x48')]};return;}})[_0xab41('0x14')](function(){if(_0x32c142[_0xab41('0x52')]){if(_0x32c142['List'][_0xab41('0x54')]['length']){return _0x32c142[_0xab41('0x52')][_0xab41('0x54')][0x0];}else{return db[_0xab41('0x53')][_0xab41('0x4a')](_[_0xab41('0xb')](_0x516caf[_0xab41('0x48')],{'firstName':_0x516caf[_0xab41('0x48')]['to'],'email':_0x516caf[_0xab41('0x48')]['to'],'phone':_0x516caf[_0xab41('0x48')]['to'],'ListId':_0x32c142[_0xab41('0x63')]}));}}else{throw new Error(_0xab41('0x64'));}})[_0xab41('0x14')](function(){if(_0xd82078){return respondWithRpcPromise(_0xab41('0x65'),_0xab41('0x66'),_0xd82078,client9003)[_0xab41('0x14')](function(_0x3261a9){return _0x56f53f[_0xab41('0x47')]({'read':!![],'messageId':_0x3261a9[_0xab41('0x67')],'sentAt':moment()['format'](_0xab41('0x68'))});})['catch'](function(_0xaf0b40){logger[_0xab41('0x19')]('%s',JSON[_0xab41('0x69')](_0xaf0b40));return _0x56f53f;});}return _0x56f53f;});}return _0x56f53f;}})[_0xab41('0x14')](respondWithResult(_0x840d6f,0xc9))[_0xab41('0x1d')](handleError(_0x840d6f,null));};exports[_0xab41('0x6a')]=function(_0x5c3d35,_0x56d3ed){var _0x4cae33={'agent':{},'channel':_0xab41('0x6b')};if(_0x5c3d35[_0xab41('0x48')]['id']){delete _0x5c3d35['body']['id'];}_0x5c3d35[_0xab41('0x48')][_0xab41('0x6c')]=!![];_0x5c3d35[_0xab41('0x48')][_0xab41('0x6d')]=moment()['format'](_0xab41('0x68'));_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')]=_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')]||_0x5c3d35[_0xab41('0x5d')]['id'];_0x4cae33[_0xab41('0x6f')]['id']=_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')];return db[_0xab41('0x2b')][_0xab41('0x46')]({'where':{'id':_0x5c3d35[_0xab41('0x44')]['id'],'UserId':null}})[_0xab41('0x14')](handleEntityNotFound(_0x56d3ed,null))['then'](saveUpdates(_0x5c3d35[_0xab41('0x48')],null))[_0xab41('0x14')](function(_0x3f50b7){if(_0x3f50b7){_0x4cae33[_0xab41('0x1b')]=_0x3f50b7[_0xab41('0x70')]({'plain':!![]});return db[_0xab41('0x71')][_0xab41('0x46')]({'where':{'id':_0x3f50b7['MailInteractionId']}});}return null;})[_0xab41('0x14')](handleEntityNotFound(_0x56d3ed,null))['then'](function(_0xfc6221){if(_0xfc6221){return _0xfc6221['update']({'UserId':_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')],'read1stAt':_[_0xab41('0x58')](_0xfc6221[_0xab41('0x72')])?moment()[_0xab41('0x73')](_0xab41('0x68')):undefined});}return null;})[_0xab41('0x14')](function(_0x190567){if(_0x190567){_0x4cae33[_0xab41('0x74')]=_0x190567['get']({'plain':!![]});interaction_log[_0xab41('0x1c')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5c3d35[_0xab41('0x5d')]['id'],_0x5c3d35['user']['name'],_0x5c3d35[_0xab41('0x5d')][_0xab41('0x75')],_0x4cae33[_0xab41('0x74')]['id'],_0x5c3d35[_0xab41('0x48')]?JSON[_0xab41('0x69')](_0x5c3d35[_0xab41('0x48')]):_0xab41('0x76'));return respondWithRpcPromise(_0xab41('0x77'),_0xab41('0x78'),_0x4cae33);}return null;})[_0xab41('0x14')](function(_0x35c581){var _0x407e1e=_0xab41('0x79')+_0x35c581[_0xab41('0x1b')]['ContactId'];return db[_0xab41('0x7a')][_0xab41('0x31')](_0x407e1e,{'type':db[_0xab41('0x7b')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x5a61fd){return _0x5a61fd;});})[_0xab41('0x14')](function(_0x51fbe5){if(_0x51fbe5){_0x4cae33[_0xab41('0x1b')]['contact']=_0x51fbe5[0x0];if(!_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')])return;return db[_0xab41('0x7c')][_0xab41('0x46')]({'where':{'id':_0x5c3d35[_0xab41('0x48')][_0xab41('0x6e')],'role':'agent'},'attributes':['id',_0xab41('0x27'),'fullname',_0xab41('0x7d'),'internal'],'raw':!![]});}return null;})[_0xab41('0x14')](function(_0x4bb7d0){if(!_0x4bb7d0)return null;_0x4cae33[_0xab41('0x1b')][_0xab41('0x6f')]=_0x4bb7d0;return _0x4cae33;})[_0xab41('0x14')](function(_0xb2e2d0){if(_0xb2e2d0){if(_0x5c3d35[_0xab41('0x48')]['manual']){_0x4cae33[_0xab41('0x1b')][_0xab41('0x7e')]=util['format'](_0xab41('0x7f'),_0x5c3d35['user'][_0xab41('0x27')]);_0x4cae33[_0xab41('0x1b')][_0xab41('0x80')]=_0x4cae33['channel'];_0x4cae33[_0xab41('0x1b')][_0xab41('0x81')]=_0x4cae33[_0xab41('0x80')];_0x4cae33[_0xab41('0x1b')][_0xab41('0x82')]=_0xab41('0x6a');_0x4cae33[_0xab41('0x1b')]['body']=htmlToText[_0xab41('0x83')](_0x4cae33['message'][_0xab41('0x48')]);return respondWithRpcPromise(_0xab41('0x84'),'EventManager',{'event':_0xab41('0x85'),'message':_0x4cae33[_0xab41('0x1b')]},client9002)['then'](function(){return _0x4cae33;});}return _0x4cae33;}return null;})[_0xab41('0x14')](respondWithResult(_0x56d3ed,null))['catch'](handleError(_0x56d3ed,null));};exports[_0xab41('0x86')]=function(_0x51e338,_0x53c1a4){var _0x34e572={'agent':{},'channel':_0xab41('0x6b')};if(_0x51e338['body']['id']){delete _0x51e338['body']['id'];}_0x51e338[_0xab41('0x48')][_0xab41('0x6e')]=_0x51e338[_0xab41('0x48')][_0xab41('0x6e')]||_0x51e338[_0xab41('0x5d')]['id'];_0x34e572[_0xab41('0x6f')]['id']=_0x51e338['body'][_0xab41('0x6e')];return db['MailMessage'][_0xab41('0x46')]({'where':{'id':_0x51e338[_0xab41('0x44')]['id'],'UserId':null}})[_0xab41('0x14')](handleEntityNotFound(_0x53c1a4,null))[_0xab41('0x14')](function(_0xabf3e){if(_0xabf3e){_0x34e572[_0xab41('0x1b')]=_0xabf3e[_0xab41('0x70')]({'plain':!![]});return db[_0xab41('0x71')][_0xab41('0x46')]({'where':{'id':_0xabf3e['MailInteractionId']}});}return null;})[_0xab41('0x14')](handleEntityNotFound(_0x53c1a4,null))['then'](function(_0x5377ef){if(_0x5377ef){_0x34e572[_0xab41('0x74')]=_0x5377ef[_0xab41('0x70')]({'plain':!![]});interaction_log[_0xab41('0x1c')](_0xab41('0x87'),_0x51e338[_0xab41('0x5d')]['id'],_0x51e338[_0xab41('0x5d')][_0xab41('0x27')],_0x51e338[_0xab41('0x5d')][_0xab41('0x75')],_0x34e572[_0xab41('0x74')]['id'],_0x51e338[_0xab41('0x48')]?JSON[_0xab41('0x69')](_0x51e338['body']):'null');return respondWithRpcPromise('RejectMessage',_0xab41('0x88'),_0x34e572);}return null;})[_0xab41('0x14')](function(_0x339cdd){var _0xd90a31='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x339cdd['message']['ContactId'];return db['sequelize'][_0xab41('0x31')](_0xd90a31,{'type':db[_0xab41('0x7b')]['QueryTypes'][_0xab41('0x89')],'raw':!![]})[_0xab41('0x14')](function(_0x45c7b8){return _0x45c7b8;});})[_0xab41('0x14')](function(_0x362145){if(_0x362145){_0x34e572[_0xab41('0x1b')][_0xab41('0x8a')]=_0x362145[0x0];if(!_0x51e338[_0xab41('0x48')][_0xab41('0x6e')])return;return db[_0xab41('0x7c')][_0xab41('0x46')]({'where':{'id':_0x51e338[_0xab41('0x48')][_0xab41('0x6e')],'role':_0xab41('0x6f')},'attributes':['id',_0xab41('0x27'),_0xab41('0x8b'),_0xab41('0x7d'),'internal'],'raw':!![]});}return null;})[_0xab41('0x14')](function(_0x4bd307){if(!_0x4bd307)return null;_0x34e572[_0xab41('0x1b')][_0xab41('0x6f')]=_0x4bd307;return _0x34e572;})[_0xab41('0x14')](function(_0x1388ee){if(_0x1388ee){_0x1388ee[_0xab41('0x1b')][_0xab41('0x7e')]=util[_0xab41('0x73')](_0xab41('0x7f'),_0x51e338[_0xab41('0x5d')][_0xab41('0x27')]);_0x1388ee[_0xab41('0x1b')]['channel']=_0x34e572[_0xab41('0x80')];_0x1388ee[_0xab41('0x1b')][_0xab41('0x81')]=_0x34e572[_0xab41('0x80')];_0x1388ee[_0xab41('0x1b')][_0xab41('0x82')]=_0xab41('0x86');_0x1388ee['message'][_0xab41('0x48')]=htmlToText[_0xab41('0x83')](_0x34e572[_0xab41('0x1b')][_0xab41('0x48')]);respondWithRpcPromise(_0xab41('0x84'),_0xab41('0x84'),{'event':'rejectmessage','message':_0x1388ee[_0xab41('0x1b')]},client9002);return _0x34e572;}return null;})[_0xab41('0x14')](respondWithResult(_0x53c1a4,null))[_0xab41('0x1d')](handleError(_0x53c1a4,null));};exports[_0xab41('0x8c')]=function(_0x36075e,_0x5b4094){var _0x256d7d=moment()['unix']()[_0xab41('0x8d')]();var _0x4835a4=path[_0xab41('0x8e')](config[_0xab41('0x62')],_0xab41('0x8f'),_0xab41('0x90'),'tmp');var _0x52746d=path[_0xab41('0x8e')](config[_0xab41('0x62')],_0xab41('0x8f'),_0xab41('0x90'),'attachments');var _0x4803dd=util[_0xab41('0x73')](_0xab41('0x91'),_0x256d7d);return db[_0xab41('0x2b')][_0xab41('0x46')]({'where':{'id':_0x36075e[_0xab41('0x44')]['id']},'attributes':['id',_0xab41('0x48'),'from','to','cc','bcc',_0xab41('0x92'),'createdAt'],'include':_0x36075e['query'][_0xab41('0x61')]?[{'model':db[_0xab41('0x93')],'as':_0xab41('0x94')}]:undefined})[_0xab41('0x14')](handleEntityNotFound(_0x5b4094,null))[_0xab41('0x14')](function(_0x2ca84a){if(_0x2ca84a){var _0x25e2d1=_0x2ca84a;var _0x4d63f1={'from':_0x25e2d1['from'],'to':_0x25e2d1['to'],'subject':_0x25e2d1[_0xab41('0x92')],'html':_0x25e2d1[_0xab41('0x48')],'headers':{'Date':moment(_0x25e2d1[_0xab41('0x95')])[_0xab41('0x73')](_0xab41('0x96'))},'attachments':[]};if(_0x2ca84a['cc']){_0x4d63f1['headers']['Cc']=_0x2ca84a['cc'];}if(_0x2ca84a[_0xab41('0x97')]){_0x4d63f1[_0xab41('0x98')][_0xab41('0x99')]=_0x2ca84a[_0xab41('0x97')];}return new BPromise(function(_0x4fcd0f,_0x63461b){if(_0x2ca84a['Attachments']){for(var _0x487c8d=0x0;_0x487c8d<_0x2ca84a['Attachments']['length'];_0x487c8d++){var _0xfe990e=_0x2ca84a['Attachments'][_0x487c8d];var _0x28648c=path[_0xab41('0x8e')](_0x52746d,_0xfe990e['basename']);if(fs['existsSync'](_0x28648c)){_0x4d63f1[_0xab41('0x61')][_0xab41('0x9a')]({'name':_0xfe990e[_0xab41('0x27')],'contentType':_0xfe990e['type'],'data':fs[_0xab41('0x9b')](_0x28648c)});}}}emlformat[_0xab41('0x9c')](_0x4d63f1,function(_0x109cdc,_0x4ea10c){if(_0x109cdc)return _0x63461b(_0x109cdc);fs[_0xab41('0x9d')](path[_0xab41('0x8e')](_0x4835a4,_0x4803dd),_0x4ea10c);return _0x4fcd0f(_0x4ea10c);});});}})['then'](function(_0x21d1c8){if(_0x21d1c8){return _0x5b4094[_0xab41('0x8c')](path[_0xab41('0x8e')](_0x4835a4,_0x4803dd),_0x4803dd,function(_0x2103ce){if(!_0x2103ce)fs[_0xab41('0x9e')](path[_0xab41('0x8e')](_0x4835a4,_0x4803dd));});}})['catch'](handleError(_0x5b4094,null));}; \ No newline at end of file +var _0x81cf=['jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','limit','undefined','count','Content-Range','json','destroy','end','sendStatus','stack','index','MailMessage','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','update','find','body','params','describe','create','secret','split','MailAccount','findOne','MailAccountId','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','agent','get','read1stAt','interaction','[MAILMESSAGE: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','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','motionChannel','channel','accept','EventManager','reject','MailInteraction','MailInteractionId','null','RejectMessage','rejectMessage','event','fromString','rejectmessage','download','unix','toString','join','tmp','root','server','files','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailMessage.socket'];(function(_0x72c7ca,_0xdfcae7){var _0x59e818=function(_0x3e8856){while(--_0x3e8856){_0x72c7ca['push'](_0x72c7ca['shift']());}};_0x59e818(++_0xdfcae7);}(_0x81cf,0x1e0));var _0xf81c=function(_0x5755c0,_0x3db5d4){_0x5755c0=_0x5755c0-0x0;var _0x4245c6=_0x81cf[_0x5755c0];return _0x4245c6;};'use strict';var emlformat=require(_0xf81c('0x0'));var moment=require(_0xf81c('0x1'));var BPromise=require(_0xf81c('0x2'));var util=require(_0xf81c('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xf81c('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xf81c('0x5'));var qs=require(_0xf81c('0x6'));var logger=require(_0xf81c('0x7'))(_0xf81c('0x8'));var interaction_log=require(_0xf81c('0x7'))('mail-interactions');var config=require(_0xf81c('0x9'));var db=require(_0xf81c('0xa'))['db'];config['redis']=_[_0xf81c('0xb')](config[_0xf81c('0xc')],{'host':_0xf81c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf81c('0xc')]));require(_0xf81c('0xe'))['register'](socket);var jayson=require(_0xf81c('0xf'));var client=jayson['client'][_0xf81c('0x10')]({'port':0x232c});var client9003=jayson[_0xf81c('0x11')][_0xf81c('0x10')]({'port':0x232b});var client9002=jayson[_0xf81c('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab121,_0x509e0f,_0x505031,_0x56e228){return new BPromise(function(_0x64d2ca,_0x408abe){var _0x1bcd08=_0x56e228||client;return _0x1bcd08[_0xf81c('0x12')](_0x5ab121,_0x505031)[_0xf81c('0x13')](function(_0x27662c){logger[_0xf81c('0x14')](_0xf81c('0x15'),_0x509e0f,_0xf81c('0x16'));logger[_0xf81c('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x509e0f,_0xf81c('0x16'),JSON[_0xf81c('0x18')](_0x27662c));if(_0x27662c[_0xf81c('0x19')]){if(_0x27662c['error'][_0xf81c('0x1a')]===0x1f4){logger[_0xf81c('0x19')]('MailMessage,\x20%s,\x20%s',_0x509e0f,_0x27662c[_0xf81c('0x19')][_0xf81c('0x1b')]);return _0x408abe(_0x27662c['error'][_0xf81c('0x1b')]);}logger['error'](_0xf81c('0x15'),_0x509e0f,_0x27662c[_0xf81c('0x19')]['message']);return _0x64d2ca(_0x27662c[_0xf81c('0x19')][_0xf81c('0x1b')]);}else{logger[_0xf81c('0x14')](_0xf81c('0x15'),_0x509e0f,_0xf81c('0x16'));_0x64d2ca(_0x27662c[_0xf81c('0x1c')][_0xf81c('0x1b')]);}})[_0xf81c('0x1d')](function(_0x42bb98){logger['error']('MailMessage,\x20%s,\x20%s',_0x509e0f,_0x42bb98);_0x408abe(_0x42bb98);});});}function respondWithResult(_0x231557,_0x5728b7){_0x5728b7=_0x5728b7||0xc8;return function(_0xc3fc77){if(_0xc3fc77){return _0x231557[_0xf81c('0x1e')](_0x5728b7)['json'](_0xc3fc77);}};}function respondWithFilteredResult(_0x410d50,_0x220b55){return function(_0x22c828){if(_0x22c828){var _0x5b3ea0=typeof _0x220b55[_0xf81c('0x1f')]==='undefined'&&typeof _0x220b55[_0xf81c('0x20')]===_0xf81c('0x21');var _0x48ae5a=_0x22c828['count'];var _0x5ce162=_0x5b3ea0?0x0:_0x220b55['offset'];var _0x2d1087=_0x5b3ea0?_0x22c828[_0xf81c('0x22')]:_0x220b55['offset']+_0x220b55[_0xf81c('0x20')];var _0x42234d;if(_0x2d1087>=_0x48ae5a){_0x2d1087=_0x48ae5a;_0x42234d=0xc8;}else{_0x42234d=0xce;}_0x410d50[_0xf81c('0x1e')](_0x42234d);return _0x410d50['set'](_0xf81c('0x23'),_0x5ce162+'-'+_0x2d1087+'/'+_0x48ae5a)[_0xf81c('0x24')](_0x22c828);}return null;};}function saveUpdates(_0x31b8ec){return function(_0x5e6da8){if(_0x5e6da8){return _0x5e6da8['update'](_0x31b8ec)[_0xf81c('0x13')](function(_0x5161b9){return _0x5161b9;});}return null;};}function removeEntity(_0x5c11be){return function(_0x36e84f){if(_0x36e84f){return _0x36e84f[_0xf81c('0x25')]()['then'](function(){_0x5c11be[_0xf81c('0x1e')](0xcc)[_0xf81c('0x26')]();});}};}function handleEntityNotFound(_0x1183e6){return function(_0x394d08){if(!_0x394d08){_0x1183e6[_0xf81c('0x27')](0x194);}return _0x394d08;};}function handleError(_0xeb9384,_0x421e84){_0x421e84=_0x421e84||0x1f4;return function(_0x3a2bb8){logger['error'](_0x3a2bb8[_0xf81c('0x28')]);if(_0x3a2bb8['name']){delete _0x3a2bb8['name'];}_0xeb9384['status'](_0x421e84)['send'](_0x3a2bb8);};}exports[_0xf81c('0x29')]=function(_0x359dab,_0x302f84){var _0x5d10e9={},_0x46ebf1={},_0x826af7={'count':0x0,'rows':[]};var _0x36b121=_['map'](db[_0xf81c('0x2a')][_0xf81c('0x2b')],function(_0x490ba9){return{'name':_0x490ba9[_0xf81c('0x2c')],'type':_0x490ba9[_0xf81c('0x2d')][_0xf81c('0x2e')]};});_0x46ebf1[_0xf81c('0x2f')]=_[_0xf81c('0x30')](_0x36b121,_0xf81c('0x31'));_0x46ebf1['query']=_[_0xf81c('0x32')](_0x359dab[_0xf81c('0x33')]);_0x46ebf1[_0xf81c('0x34')]=_[_0xf81c('0x35')](_0x46ebf1['model'],_0x46ebf1['query']);_0x5d10e9[_0xf81c('0x36')]=_['intersection'](_0x46ebf1['model'],qs['fields'](_0x359dab[_0xf81c('0x33')][_0xf81c('0x37')]));_0x5d10e9[_0xf81c('0x36')]=_0x5d10e9[_0xf81c('0x36')][_0xf81c('0x38')]?_0x5d10e9[_0xf81c('0x36')]:_0x46ebf1[_0xf81c('0x2f')];if(!_0x359dab[_0xf81c('0x33')]['hasOwnProperty'](_0xf81c('0x39'))){_0x5d10e9[_0xf81c('0x20')]=qs[_0xf81c('0x20')](_0x359dab[_0xf81c('0x33')]['limit']);_0x5d10e9['offset']=qs[_0xf81c('0x1f')](_0x359dab['query'][_0xf81c('0x1f')]);}_0x5d10e9[_0xf81c('0x3a')]=qs[_0xf81c('0x3b')](_0x359dab[_0xf81c('0x33')]['sort']);_0x5d10e9[_0xf81c('0x3c')]=qs[_0xf81c('0x34')](_[_0xf81c('0x3d')](_0x359dab['query'],_0x46ebf1['filters']),_0x36b121);if(_0x359dab['query'][_0xf81c('0x3e')]){_0x5d10e9[_0xf81c('0x3c')]=_[_0xf81c('0x3f')](_0x5d10e9[_0xf81c('0x3c')],{'$or':_['map'](_0x36b121,function(_0x30417b){if(_0x30417b[_0xf81c('0x2d')]!==_0xf81c('0x40')){var _0x4f3eef={};_0x4f3eef[_0x30417b[_0xf81c('0x31')]]={'$like':'%'+_0x359dab[_0xf81c('0x33')][_0xf81c('0x3e')]+'%'};return _0x4f3eef;}})});}_0x5d10e9=_['merge']({},_0x5d10e9,_0x359dab['options']);var _0x5709bd={'where':_0x5d10e9[_0xf81c('0x3c')]};return db['MailMessage']['count'](_0x5709bd)[_0xf81c('0x13')](function(_0x4f9213){_0x826af7[_0xf81c('0x22')]=_0x4f9213;if(_0x359dab['query'][_0xf81c('0x41')]){_0x5d10e9[_0xf81c('0x42')]=[{'all':!![]}];}return db[_0xf81c('0x2a')]['findAll'](_0x5d10e9);})[_0xf81c('0x13')](function(_0x264efe){_0x826af7[_0xf81c('0x43')]=_0x264efe;return _0x826af7;})[_0xf81c('0x13')](respondWithFilteredResult(_0x302f84,_0x5d10e9))['catch'](handleError(_0x302f84,null));};exports[_0xf81c('0x44')]=function(_0xb8748f,_0x1d5724){var _0x421649={'raw':!![],'where':{'id':_0xb8748f['params']['id']}},_0x6774d6={};_0x6774d6[_0xf81c('0x2f')]=_[_0xf81c('0x32')](db[_0xf81c('0x2a')][_0xf81c('0x2b')]);_0x6774d6[_0xf81c('0x33')]=_[_0xf81c('0x32')](_0xb8748f[_0xf81c('0x33')]);_0x6774d6[_0xf81c('0x34')]=_[_0xf81c('0x35')](_0x6774d6[_0xf81c('0x2f')],_0x6774d6['query']);_0x421649[_0xf81c('0x36')]=_['intersection'](_0x6774d6[_0xf81c('0x2f')],qs['fields'](_0xb8748f[_0xf81c('0x33')]['fields']));_0x421649[_0xf81c('0x36')]=_0x421649[_0xf81c('0x36')][_0xf81c('0x38')]?_0x421649[_0xf81c('0x36')]:_0x6774d6[_0xf81c('0x2f')];if(_0xb8748f['query'][_0xf81c('0x41')]){_0x421649[_0xf81c('0x42')]=[{'all':!![]}];}_0x421649=_[_0xf81c('0x3f')]({},_0x421649,_0xb8748f['options']);return db['MailMessage']['find'](_0x421649)[_0xf81c('0x13')](handleEntityNotFound(_0x1d5724,null))[_0xf81c('0x13')](respondWithResult(_0x1d5724,null))[_0xf81c('0x1d')](handleError(_0x1d5724,null));};exports[_0xf81c('0x45')]=function(_0x27cbb8,_0x593311){if(_0x27cbb8['body']['id']){delete _0x27cbb8['body']['id'];}return db['MailMessage'][_0xf81c('0x46')]({'where':{'id':_0x27cbb8['params']['id']}})[_0xf81c('0x13')](handleEntityNotFound(_0x593311,null))[_0xf81c('0x13')](saveUpdates(_0x27cbb8[_0xf81c('0x47')],null))[_0xf81c('0x13')](respondWithResult(_0x593311,null))[_0xf81c('0x1d')](handleError(_0x593311,null));};exports[_0xf81c('0x25')]=function(_0x2cc042,_0x38289e){return db['MailMessage'][_0xf81c('0x46')]({'where':{'id':_0x2cc042[_0xf81c('0x48')]['id']}})[_0xf81c('0x13')](handleEntityNotFound(_0x38289e,null))[_0xf81c('0x13')](removeEntity(_0x38289e,null))['catch'](handleError(_0x38289e,null));};exports[_0xf81c('0x49')]=function(_0x2de8e6,_0x4e76d5){return db[_0xf81c('0x2a')]['describe']()[_0xf81c('0x13')](respondWithResult(_0x4e76d5,null))[_0xf81c('0x1d')](handleError(_0x4e76d5,null));};exports['create']=function(_0x35f003,_0x23e6cc){return db[_0xf81c('0x2a')][_0xf81c('0x4a')](_0x35f003[_0xf81c('0x47')])['then'](function(_0x57c717){if(_0x57c717){if(_0x57c717['direction']==='out'&&!_0x57c717[_0xf81c('0x4b')]){var _0x499c30,_0x5e0a20,_0x17a139;if(_0x35f003[_0xf81c('0x47')]['to']){_0x5e0a20=_0x35f003[_0xf81c('0x47')]['to'][_0xf81c('0x4c')](',')[0x0];}return db[_0xf81c('0x4d')][_0xf81c('0x4e')]({'where':{'id':_0x57c717[_0xf81c('0x4f')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf81c('0x50')],'as':_0xf81c('0x51'),'where':{'email':_0x5e0a20},'limit':0x1,'order':[[_0xf81c('0x52'),_0xf81c('0x53')]]}]},{'model':db[_0xf81c('0x54')],'as':_0xf81c('0x55'),'raw':!![]}]})[_0xf81c('0x13')](function(_0x8c6f3a){_0x499c30=_0x8c6f3a;if(_0x499c30&&_0x499c30['Smtp']){var _0x3527fb={'tls':{'rejectUnauthorized':![]}};if(_[_0xf81c('0x56')](_0x499c30['Smtp'][_0xf81c('0x57')])){_0x3527fb[_0xf81c('0x58')]=_0x499c30['Smtp'][_0xf81c('0x58')];_0x3527fb[_0xf81c('0x59')]=_0x499c30[_0xf81c('0x55')][_0xf81c('0x59')];_0x3527fb['secure']=_0x499c30[_0xf81c('0x55')][_0xf81c('0x5a')];if(_0x499c30[_0xf81c('0x55')][_0xf81c('0x5b')]){_0x3527fb[_0xf81c('0x5c')]={'user':_0x499c30['Smtp']['user'],'pass':_0x499c30[_0xf81c('0x55')][_0xf81c('0x5d')]};}}else{_0x3527fb[_0xf81c('0x57')]=_0x499c30[_0xf81c('0x55')][_0xf81c('0x57')];_0x3527fb[_0xf81c('0x5c')]={'user':_0x499c30[_0xf81c('0x55')][_0xf81c('0x5e')],'pass':_0x499c30[_0xf81c('0x55')][_0xf81c('0x5d')]};_0x3527fb[_0xf81c('0x5a')]=_0x499c30['Smtp'][_0xf81c('0x5a')];}if(_0x35f003[_0xf81c('0x47')][_0xf81c('0x5f')]&&_0x35f003[_0xf81c('0x47')][_0xf81c('0x5f')]['length']){for(var _0x43ccb0=0x0;_0x43ccb0<_0x35f003['body'][_0xf81c('0x5f')][_0xf81c('0x38')];_0x43ccb0+=0x1){_0x35f003[_0xf81c('0x47')][_0xf81c('0x5f')][_0x43ccb0]={'filename':_0x35f003['body'][_0xf81c('0x5f')][_0x43ccb0][_0xf81c('0x31')],'path':path['join'](config['root'],_0xf81c('0x60'),_0x35f003[_0xf81c('0x47')]['attachments'][_0x43ccb0][_0xf81c('0x61')])};}}_0x17a139={'account':_0x3527fb,'message':_0x35f003[_0xf81c('0x47')]};return;}})[_0xf81c('0x13')](function(){if(_0x499c30['List']){if(_0x499c30[_0xf81c('0x62')][_0xf81c('0x51')][_0xf81c('0x38')]){return _0x499c30[_0xf81c('0x62')][_0xf81c('0x51')][0x0];}else{return db['CmContact'][_0xf81c('0x4a')](_[_0xf81c('0xb')](_0x35f003['body'],{'firstName':_0x35f003[_0xf81c('0x47')]['to'],'email':_0x35f003['body']['to'],'phone':_0x35f003[_0xf81c('0x47')]['to'],'ListId':_0x499c30[_0xf81c('0x63')]}));}}else{throw new Error(_0xf81c('0x64'));}})['then'](function(){if(_0x17a139){return respondWithRpcPromise(_0xf81c('0x65'),_0xf81c('0x66'),_0x17a139,client9003)[_0xf81c('0x13')](function(_0x235834){return _0x57c717[_0xf81c('0x45')]({'read':!![],'messageId':_0x235834[_0xf81c('0x67')],'sentAt':moment()[_0xf81c('0x68')](_0xf81c('0x69'))});})[_0xf81c('0x1d')](function(_0xfcf8af){logger[_0xf81c('0x19')]('%s',JSON['stringify'](_0xfcf8af));return _0x57c717;});}return _0x57c717;});}return _0x57c717;}})[_0xf81c('0x13')](respondWithResult(_0x23e6cc,0xc9))[_0xf81c('0x1d')](handleError(_0x23e6cc,null));};exports['accept']=function(_0x15591f,_0x170ef7){var _0x465ef1={'agent':{},'channel':_0xf81c('0x6a')};if(_0x15591f[_0xf81c('0x47')]['id']){delete _0x15591f[_0xf81c('0x47')]['id'];}_0x15591f[_0xf81c('0x47')][_0xf81c('0x6b')]=!![];_0x15591f['body'][_0xf81c('0x6c')]=moment()[_0xf81c('0x68')](_0xf81c('0x69'));_0x15591f[_0xf81c('0x47')]['UserId']=_0x15591f['body'][_0xf81c('0x6d')]||_0x15591f[_0xf81c('0x5e')]['id'];_0x465ef1[_0xf81c('0x6e')]['id']=_0x15591f['body']['UserId'];return db['MailMessage'][_0xf81c('0x46')]({'where':{'id':_0x15591f[_0xf81c('0x48')]['id'],'UserId':null}})[_0xf81c('0x13')](handleEntityNotFound(_0x170ef7,null))[_0xf81c('0x13')](saveUpdates(_0x15591f[_0xf81c('0x47')],null))[_0xf81c('0x13')](function(_0x2842c6){if(_0x2842c6){_0x465ef1[_0xf81c('0x1b')]=_0x2842c6[_0xf81c('0x6f')]({'plain':!![]});return db['MailInteraction'][_0xf81c('0x46')]({'where':{'id':_0x2842c6['MailInteractionId']}});}return null;})[_0xf81c('0x13')](handleEntityNotFound(_0x170ef7,null))[_0xf81c('0x13')](function(_0x14c223){if(_0x14c223){return _0x14c223[_0xf81c('0x45')]({'UserId':_0x15591f['body'][_0xf81c('0x6d')],'read1stAt':_[_0xf81c('0x56')](_0x14c223[_0xf81c('0x70')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf81c('0x13')](function(_0x203c79){if(_0x203c79){_0x465ef1[_0xf81c('0x71')]=_0x203c79[_0xf81c('0x6f')]({'plain':!![]});interaction_log[_0xf81c('0x14')](_0xf81c('0x72'),_0x15591f[_0xf81c('0x5e')]['id'],_0x15591f[_0xf81c('0x5e')]['name'],_0x15591f['user'][_0xf81c('0x73')],_0x465ef1['interaction']['id'],_0x15591f[_0xf81c('0x47')]?JSON[_0xf81c('0x18')](_0x15591f[_0xf81c('0x47')]):'null');return respondWithRpcPromise(_0xf81c('0x74'),_0xf81c('0x75'),_0x465ef1);}return null;})[_0xf81c('0x13')](function(_0x227a16){var _0x28ac2e=_0xf81c('0x76')+_0x227a16[_0xf81c('0x1b')][_0xf81c('0x77')];return db[_0xf81c('0x78')][_0xf81c('0x33')](_0x28ac2e,{'type':db[_0xf81c('0x79')][_0xf81c('0x7a')][_0xf81c('0x7b')],'raw':!![]})[_0xf81c('0x13')](function(_0x5d8c83){return _0x5d8c83;});})['then'](function(_0x305c25){if(_0x305c25){_0x465ef1[_0xf81c('0x1b')][_0xf81c('0x7c')]=_0x305c25[0x0];if(!_0x15591f[_0xf81c('0x47')]['UserId'])return;return db[_0xf81c('0x7d')]['find']({'where':{'id':_0x15591f[_0xf81c('0x47')]['UserId'],'role':_0xf81c('0x6e')},'attributes':['id','name',_0xf81c('0x7e'),_0xf81c('0x7f'),_0xf81c('0x80')],'raw':!![]});}return null;})['then'](function(_0x26f3cd){if(!_0x26f3cd)return null;_0x465ef1[_0xf81c('0x1b')][_0xf81c('0x6e')]=_0x26f3cd;return _0x465ef1;})[_0xf81c('0x13')](function(_0x51017e){if(_0x51017e){if(_0x15591f[_0xf81c('0x47')][_0xf81c('0x81')]){_0x465ef1[_0xf81c('0x1b')]['interface']=util[_0xf81c('0x68')](_0xf81c('0x82'),_0x15591f['user']['name']);_0x465ef1['message']['channel']=_0x465ef1['channel'];_0x465ef1[_0xf81c('0x1b')][_0xf81c('0x83')]=_0x465ef1[_0xf81c('0x84')];_0x465ef1[_0xf81c('0x1b')]['event']=_0xf81c('0x85');_0x465ef1['message'][_0xf81c('0x47')]=htmlToText['fromString'](_0x465ef1[_0xf81c('0x1b')][_0xf81c('0x47')]);return respondWithRpcPromise(_0xf81c('0x86'),_0xf81c('0x86'),{'event':'acceptmessage','message':_0x465ef1[_0xf81c('0x1b')]},client9002)[_0xf81c('0x13')](function(){return _0x465ef1;});}return _0x465ef1;}return null;})[_0xf81c('0x13')](respondWithResult(_0x170ef7,null))['catch'](handleError(_0x170ef7,null));};exports[_0xf81c('0x87')]=function(_0x4de3c2,_0x2f6f04){var _0x5d417f={'agent':{},'channel':_0xf81c('0x6a')};if(_0x4de3c2[_0xf81c('0x47')]['id']){delete _0x4de3c2[_0xf81c('0x47')]['id'];}_0x4de3c2['body'][_0xf81c('0x6d')]=_0x4de3c2[_0xf81c('0x47')][_0xf81c('0x6d')]||_0x4de3c2[_0xf81c('0x5e')]['id'];_0x5d417f[_0xf81c('0x6e')]['id']=_0x4de3c2['body'][_0xf81c('0x6d')];return db[_0xf81c('0x2a')][_0xf81c('0x46')]({'where':{'id':_0x4de3c2['params']['id'],'UserId':null}})[_0xf81c('0x13')](handleEntityNotFound(_0x2f6f04,null))['then'](function(_0x2bb94e){if(_0x2bb94e){_0x5d417f[_0xf81c('0x1b')]=_0x2bb94e[_0xf81c('0x6f')]({'plain':!![]});return db[_0xf81c('0x88')]['find']({'where':{'id':_0x2bb94e[_0xf81c('0x89')]}});}return null;})[_0xf81c('0x13')](handleEntityNotFound(_0x2f6f04,null))[_0xf81c('0x13')](function(_0x44ee4a){if(_0x44ee4a){_0x5d417f[_0xf81c('0x71')]=_0x44ee4a[_0xf81c('0x6f')]({'plain':!![]});interaction_log[_0xf81c('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4de3c2[_0xf81c('0x5e')]['id'],_0x4de3c2[_0xf81c('0x5e')][_0xf81c('0x31')],_0x4de3c2['user']['role'],_0x5d417f[_0xf81c('0x71')]['id'],_0x4de3c2[_0xf81c('0x47')]?JSON['stringify'](_0x4de3c2[_0xf81c('0x47')]):_0xf81c('0x8a'));return respondWithRpcPromise(_0xf81c('0x8b'),_0xf81c('0x8c'),_0x5d417f);}return null;})[_0xf81c('0x13')](function(_0x29bef0){var _0x3beae4=_0xf81c('0x76')+_0x29bef0[_0xf81c('0x1b')][_0xf81c('0x77')];return db[_0xf81c('0x78')][_0xf81c('0x33')](_0x3beae4,{'type':db[_0xf81c('0x79')][_0xf81c('0x7a')][_0xf81c('0x7b')],'raw':!![]})[_0xf81c('0x13')](function(_0x1991c4){return _0x1991c4;});})[_0xf81c('0x13')](function(_0x518109){if(_0x518109){_0x5d417f[_0xf81c('0x1b')][_0xf81c('0x7c')]=_0x518109[0x0];if(!_0x4de3c2[_0xf81c('0x47')][_0xf81c('0x6d')])return;return db[_0xf81c('0x7d')][_0xf81c('0x46')]({'where':{'id':_0x4de3c2['body'][_0xf81c('0x6d')],'role':_0xf81c('0x6e')},'attributes':['id',_0xf81c('0x31'),_0xf81c('0x7e'),'email',_0xf81c('0x80')],'raw':!![]});}return null;})[_0xf81c('0x13')](function(_0x2213e5){if(!_0x2213e5)return null;_0x5d417f['message'][_0xf81c('0x6e')]=_0x2213e5;return _0x5d417f;})[_0xf81c('0x13')](function(_0x5aba75){if(_0x5aba75){_0x5aba75['message']['interface']=util[_0xf81c('0x68')]('SIP/%s',_0x4de3c2[_0xf81c('0x5e')][_0xf81c('0x31')]);_0x5aba75[_0xf81c('0x1b')][_0xf81c('0x84')]=_0x5d417f['channel'];_0x5aba75[_0xf81c('0x1b')][_0xf81c('0x83')]=_0x5d417f['channel'];_0x5aba75[_0xf81c('0x1b')][_0xf81c('0x8d')]=_0xf81c('0x87');_0x5aba75[_0xf81c('0x1b')]['body']=htmlToText[_0xf81c('0x8e')](_0x5d417f[_0xf81c('0x1b')][_0xf81c('0x47')]);respondWithRpcPromise(_0xf81c('0x86'),_0xf81c('0x86'),{'event':_0xf81c('0x8f'),'message':_0x5aba75['message']},client9002);return _0x5d417f;}return null;})[_0xf81c('0x13')](respondWithResult(_0x2f6f04,null))[_0xf81c('0x1d')](handleError(_0x2f6f04,null));};exports[_0xf81c('0x90')]=function(_0x3b591a,_0x3a1067){var _0x396124=moment()[_0xf81c('0x91')]()[_0xf81c('0x92')]();var _0x91f5a4=path[_0xf81c('0x93')](config['root'],'server','files',_0xf81c('0x94'));var _0x14af33=path[_0xf81c('0x93')](config[_0xf81c('0x95')],_0xf81c('0x96'),_0xf81c('0x97'),'attachments');var _0x289050=util[_0xf81c('0x68')]('message-%s.eml',_0x396124);return db[_0xf81c('0x2a')][_0xf81c('0x46')]({'where':{'id':_0x3b591a[_0xf81c('0x48')]['id']},'attributes':['id',_0xf81c('0x47'),_0xf81c('0x98'),'to','cc',_0xf81c('0x99'),_0xf81c('0x9a'),_0xf81c('0x9b')],'include':_0x3b591a[_0xf81c('0x33')]['attachments']?[{'model':db[_0xf81c('0x9c')],'as':_0xf81c('0x9d')}]:undefined})[_0xf81c('0x13')](handleEntityNotFound(_0x3a1067,null))[_0xf81c('0x13')](function(_0xd76c23){if(_0xd76c23){var _0x401e45=_0xd76c23;var _0x33b3aa={'from':_0x401e45[_0xf81c('0x98')],'to':_0x401e45['to'],'subject':_0x401e45[_0xf81c('0x9a')],'html':_0x401e45['body'],'headers':{'Date':moment(_0x401e45[_0xf81c('0x9b')])['format'](_0xf81c('0x9e'))},'attachments':[]};if(_0xd76c23['cc']){_0x33b3aa[_0xf81c('0x9f')]['Cc']=_0xd76c23['cc'];}if(_0xd76c23[_0xf81c('0x99')]){_0x33b3aa[_0xf81c('0x9f')][_0xf81c('0xa0')]=_0xd76c23[_0xf81c('0x99')];}return new BPromise(function(_0x28f9b5,_0xb8c5e){if(_0xd76c23[_0xf81c('0x9d')]){for(var _0x476285=0x0;_0x476285<_0xd76c23['Attachments'][_0xf81c('0x38')];_0x476285++){var _0x440840=_0xd76c23[_0xf81c('0x9d')][_0x476285];var _0x10b51a=path[_0xf81c('0x93')](_0x14af33,_0x440840['basename']);if(fs[_0xf81c('0xa1')](_0x10b51a)){_0x33b3aa['attachments'][_0xf81c('0xa2')]({'name':_0x440840[_0xf81c('0x31')],'contentType':_0x440840['type'],'data':fs[_0xf81c('0xa3')](_0x10b51a)});}}}emlformat['build'](_0x33b3aa,function(_0x384e60,_0x3d520b){if(_0x384e60)return _0xb8c5e(_0x384e60);fs['writeFileSync'](path[_0xf81c('0x93')](_0x91f5a4,_0x289050),_0x3d520b);return _0x28f9b5(_0x3d520b);});});}})['then'](function(_0x8815b0){if(_0x8815b0){return _0x3a1067[_0xf81c('0x90')](path[_0xf81c('0x93')](_0x91f5a4,_0x289050),_0x289050,function(_0x4d9049){if(!_0x4d9049)fs[_0xf81c('0xa4')](path['join'](_0x91f5a4,_0x289050));});}})[_0xf81c('0x1d')](handleError(_0x3a1067,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 27cee1c..226668f 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 _0xcfb5=['events','../../mysqldb','MailMessage','setMaxListeners','save','emit','hook','exports'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xcfb5,0x1d8));var _0x5cfb=function(_0x19797e,_0x513ccd){_0x19797e=_0x19797e-0x0;var _0x46e9c4=_0xcfb5[_0x19797e];return _0x46e9c4;};'use strict';var EventEmitter=require(_0x5cfb('0x0'));var MailMessage=require(_0x5cfb('0x1'))['db'][_0x5cfb('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5cfb('0x3')](0x0);var events={'afterCreate':_0x5cfb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2155be){return function(_0x2c647d,_0x3a09d2,_0x5d7691){MailMessageEvents[_0x5cfb('0x5')](_0x2155be+':'+_0x2c647d['id'],_0x2c647d);MailMessageEvents[_0x5cfb('0x5')](_0x2155be,_0x2c647d);_0x5d7691(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5cfb('0x6')](e,emitEvent(event));}}module[_0x5cfb('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x260b=['emit','hasOwnProperty','MailMessage','setMaxListeners','update'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x260b,0x1d3));var _0xb260=function(_0x335d51,_0x4f48a1){_0x335d51=_0x335d51-0x0;var _0x54e66d=_0x260b[_0x335d51];return _0x54e66d;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xb260('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb260('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb260('0x2'),'afterDestroy':'remove'};function emitEvent(_0x50e8ed){return function(_0x5177cb,_0x177330,_0x4b054e){MailMessageEvents[_0xb260('0x3')](_0x50e8ed+':'+_0x5177cb['id'],_0x5177cb);MailMessageEvents[_0xb260('0x3')](_0x50e8ed,_0x5177cb);_0x4b054e(null);};}for(var e in events){if(events[_0xb260('0x4')](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 27f606f..b4c7a9d 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 _0xa723=['exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','toLowerCase','direction','out','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','util','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xa723,0x177));var _0x3a72=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa723[_0x5447fd];return _0x15b28a;};'use strict';var _=require('lodash');var util=require(_0x3a72('0x0'));var logger=require('../../config/logger')(_0x3a72('0x1'));var moment=require('moment');var BPromise=require(_0x3a72('0x2'));var rp=require(_0x3a72('0x3'));var htmlToText=require(_0x3a72('0x4'));var fs=require('fs');var path=require(_0x3a72('0x5'));var rimraf=require(_0x3a72('0x6'));var config=require(_0x3a72('0x7'));var attributes=require(_0x3a72('0x8'));module[_0x3a72('0x9')]=function(_0x59a0e9,_0x56664d){return _0x59a0e9[_0x3a72('0xa')](_0x3a72('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x3a72('0xc'),'fields':[_0x3a72('0xc')]},{'name':_0x3a72('0xd'),'fields':[_0x3a72('0xe'),_0x3a72('0xf')],'type':_0x3a72('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x588b49,_0x185785,_0x3b3991){if(_0x588b49[_0x3a72('0x11')]){_0x588b49[_0x3a72('0xe')]=htmlToText[_0x3a72('0x12')](_0x588b49[_0x3a72('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3b3991(null,_0x185785);},'afterCreate':function(_0x275b20,_0x4331e3,_0x160fa8){var _0x455ffc=_0x59a0e9[_0x3a72('0x13')];var _0x2fed75=_0x275b20['get']({'plain':!![]});if(_0x2fed75['direction'][_0x3a72('0x14')]()==='in'||_0x2fed75[_0x3a72('0x15')][_0x3a72('0x14')]()===_0x3a72('0x16')&&!_0x2fed75['secret']&&!_[_0x3a72('0x17')](_0x2fed75[_0x3a72('0x18')])){_0x455ffc['MailInteraction'][_0x3a72('0x19')]({'where':{'id':_0x2fed75[_0x3a72('0x1a')]}})[_0x3a72('0x1b')](function(_0x265937){if(_0x265937){_0x265937[_0x3a72('0x1c')]({'lastMsgAt':_0x2fed75[_0x3a72('0x1d')],'lastMsgDirection':_0x2fed75[_0x3a72('0x15')][_0x3a72('0x14')]()});}})['catch'](function(_0x532ea8){console[_0x3a72('0x1e')](_0x532ea8);});}_0x160fa8();}},'charset':'utf8mb4','collate':_0x3a72('0x1f')});}; \ No newline at end of file +var _0x6586=['isNil','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6586,0x102));var _0x6658=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x6586[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x6658('0x0'));var logger=require(_0x6658('0x1'))(_0x6658('0x2'));var moment=require('moment');var BPromise=require(_0x6658('0x3'));var rp=require(_0x6658('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x6658('0x5'));var config=require('../../config/environment');var attributes=require(_0x6658('0x6'));module['exports']=function(_0x2d8d19,_0x317f10){return _0x2d8d19[_0x6658('0x7')](_0x6658('0x8'),attributes,{'tableName':_0x6658('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x6658('0xa'),'fields':[_0x6658('0xb'),_0x6658('0xc')],'type':_0x6658('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x508822,_0x345b31,_0x464774){if(_0x508822[_0x6658('0xe')]){_0x508822[_0x6658('0xb')]=htmlToText[_0x6658('0xf')](_0x508822[_0x6658('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x464774(null,_0x345b31);},'afterCreate':function(_0x224f39,_0x35b5a2,_0x4d6279){var _0x56da2c=_0x2d8d19[_0x6658('0x10')];var _0x1fda4e=_0x224f39[_0x6658('0x11')]({'plain':!![]});if(_0x1fda4e[_0x6658('0x12')][_0x6658('0x13')]()==='in'||_0x1fda4e['direction'][_0x6658('0x13')]()==='out'&&!_0x1fda4e[_0x6658('0x14')]&&!_[_0x6658('0x15')](_0x1fda4e['UserId'])){_0x56da2c[_0x6658('0x16')][_0x6658('0x17')]({'where':{'id':_0x1fda4e[_0x6658('0x18')]}})['then'](function(_0x4a90f8){if(_0x4a90f8){_0x4a90f8[_0x6658('0x19')]({'lastMsgAt':_0x1fda4e[_0x6658('0x1a')],'lastMsgDirection':_0x1fda4e[_0x6658('0x12')]['toLowerCase']()});}})[_0x6658('0x1b')](function(_0x297733){console[_0x6658('0x1c')](_0x297733);});}_0x4d6279();}},'charset':_0x6658('0x1d'),'collate':_0x6658('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0a579d1..d83d77e 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 _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xb9be[_0x4f5108];return _0x2d56ca;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file +var _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5c3408,_0xea4a58){var _0x7cb217=function(_0x3df30c){while(--_0x3df30c){_0x5c3408['push'](_0x5c3408['shift']());}};_0x7cb217(++_0xea4a58);}(_0x63a5,0x18e));var _0x563a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x63a5[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index cd553e9..161fc22 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 _0x01d3=['removeListener','length','mailMessage:','remove','update','emit'];(function(_0x7a22ea,_0x178835){var _0x105259=function(_0x47d8fa){while(--_0x47d8fa){_0x7a22ea['push'](_0x7a22ea['shift']());}};_0x105259(++_0x178835);}(_0x01d3,0xdb));var _0x301d=function(_0x41f023,_0x256f0c){_0x41f023=_0x41f023-0x0;var _0x3d8bd5=_0x01d3[_0x41f023];return _0x3d8bd5;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x301d('0x0'),_0x301d('0x1')];function createListener(_0xc33ac5,_0x5912f4){return function(_0x33a51f){_0x5912f4[_0x301d('0x2')](_0xc33ac5,_0x33a51f);};}function removeListener(_0x2602ed,_0x11ba0e){return function(){MailMessageEvents[_0x301d('0x3')](_0x2602ed,_0x11ba0e);};}exports['register']=function(_0x44f428){for(var _0x3b1992=0x0,_0x859328=events[_0x301d('0x4')];_0x3b1992<_0x859328;_0x3b1992++){var _0x12b21b=events[_0x3b1992];var _0x49a253=createListener(_0x301d('0x5')+_0x12b21b,_0x44f428);MailMessageEvents['on'](_0x12b21b,_0x49a253);}}; \ No newline at end of file +var _0xdd64=['mailMessage:','./mailMessage.events','save','remove','update','emit','register'];(function(_0x5a729d,_0x535e0e){var _0x3a2e1e=function(_0x5da049){while(--_0x5da049){_0x5a729d['push'](_0x5a729d['shift']());}};_0x3a2e1e(++_0x535e0e);}(_0xdd64,0xd3));var _0x4dd6=function(_0x479123,_0x284349){_0x479123=_0x479123-0x0;var _0x47576b=_0xdd64[_0x479123];return _0x47576b;};'use strict';var MailMessageEvents=require(_0x4dd6('0x0'));var events=[_0x4dd6('0x1'),_0x4dd6('0x2'),_0x4dd6('0x3')];function createListener(_0x4d8fc2,_0x3e7851){return function(_0x55317f){_0x3e7851[_0x4dd6('0x4')](_0x4d8fc2,_0x55317f);};}function removeListener(_0x341644,_0x19aff6){return function(){MailMessageEvents['removeListener'](_0x341644,_0x19aff6);};}exports[_0x4dd6('0x5')]=function(_0x118ec2){for(var _0x33f99d=0x0,_0x51f2b3=events['length'];_0x33f99d<_0x51f2b3;_0x33f99d++){var _0x32b759=events[_0x33f99d];var _0x2efc76=createListener(_0x4dd6('0x6')+_0x32b759,_0x118ec2);MailMessageEvents['on'](_0x32b759,_0x2efc76);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 2426cc8..68e2405 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 _0xd398=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','util','path','connect-timeout','express','Router'];(function(_0x5b6ca0,_0x1ff5d7){var _0x5a1b34=function(_0x479adc){while(--_0x479adc){_0x5b6ca0['push'](_0x5b6ca0['shift']());}};_0x5a1b34(++_0x1ff5d7);}(_0xd398,0x109));var _0x8d39=function(_0x3a9b9b,_0x301972){_0x3a9b9b=_0x3a9b9b-0x0;var _0x4cb478=_0xd398[_0x3a9b9b];return _0x4cb478;};'use strict';var multer=require('multer');var util=require(_0x8d39('0x0'));var path=require(_0x8d39('0x1'));var timeout=require(_0x8d39('0x2'));var express=require(_0x8d39('0x3'));var router=express[_0x8d39('0x4')]();var fs_extra=require(_0x8d39('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d39('0x6'));var config=require(_0x8d39('0x7'));var controller=require('./mailQueue.controller');router[_0x8d39('0x8')]('/',auth[_0x8d39('0x9')](),controller[_0x8d39('0xa')]);router[_0x8d39('0x8')]('/describe',auth[_0x8d39('0x9')](),controller[_0x8d39('0xb')]);router[_0x8d39('0x8')](_0x8d39('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8d39('0x8')](_0x8d39('0xd'),auth[_0x8d39('0x9')](),controller[_0x8d39('0xe')]);router[_0x8d39('0x8')](_0x8d39('0xf'),auth[_0x8d39('0x9')](),controller['getTeams']);router[_0x8d39('0x8')](_0x8d39('0x10'),auth[_0x8d39('0x9')](),controller[_0x8d39('0x11')]);router['post']('/',auth[_0x8d39('0x9')](),controller[_0x8d39('0x12')]);router[_0x8d39('0x13')](_0x8d39('0xf'),auth[_0x8d39('0x9')](),controller[_0x8d39('0x14')]);router[_0x8d39('0x13')](_0x8d39('0x10'),auth[_0x8d39('0x9')](),controller[_0x8d39('0x15')]);router[_0x8d39('0x16')]('/:id',auth[_0x8d39('0x9')](),controller[_0x8d39('0x17')]);router[_0x8d39('0x18')](_0x8d39('0xc'),auth[_0x8d39('0x9')](),controller['destroy']);router[_0x8d39('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8d39('0x19')]);router[_0x8d39('0x18')](_0x8d39('0x10'),auth[_0x8d39('0x9')](),controller[_0x8d39('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x246a=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','delete'];(function(_0x2bc90b,_0x144082){var _0x43a776=function(_0x3c53dd){while(--_0x3c53dd){_0x2bc90b['push'](_0x2bc90b['shift']());}};_0x43a776(++_0x144082);}(_0x246a,0x137));var _0xa246=function(_0x22125c,_0x42f93a){_0x22125c=_0x22125c-0x0;var _0x22db6b=_0x246a[_0x22125c];return _0x22db6b;};'use strict';var multer=require(_0xa246('0x0'));var util=require(_0xa246('0x1'));var path=require(_0xa246('0x2'));var timeout=require(_0xa246('0x3'));var express=require(_0xa246('0x4'));var router=express['Router']();var fs_extra=require(_0xa246('0x5'));var auth=require(_0xa246('0x6'));var interaction=require(_0xa246('0x7'));var config=require(_0xa246('0x8'));var controller=require('./mailQueue.controller');router[_0xa246('0x9')]('/',auth[_0xa246('0xa')](),controller[_0xa246('0xb')]);router[_0xa246('0x9')](_0xa246('0xc'),auth[_0xa246('0xa')](),controller['describe']);router['get'](_0xa246('0xd'),auth[_0xa246('0xa')](),controller['show']);router[_0xa246('0x9')](_0xa246('0xe'),auth[_0xa246('0xa')](),controller[_0xa246('0xf')]);router[_0xa246('0x9')](_0xa246('0x10'),auth[_0xa246('0xa')](),controller[_0xa246('0x11')]);router[_0xa246('0x9')](_0xa246('0x12'),auth[_0xa246('0xa')](),controller[_0xa246('0x13')]);router['post']('/',auth[_0xa246('0xa')](),controller[_0xa246('0x14')]);router[_0xa246('0x15')](_0xa246('0x10'),auth[_0xa246('0xa')](),controller[_0xa246('0x16')]);router[_0xa246('0x15')]('/:id/users',auth[_0xa246('0xa')](),controller[_0xa246('0x17')]);router['put'](_0xa246('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa246('0x18')](_0xa246('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xa246('0x18')](_0xa246('0x10'),auth[_0xa246('0xa')](),controller[_0xa246('0x19')]);router[_0xa246('0x18')](_0xa246('0x12'),auth[_0xa246('0xa')](),controller[_0xa246('0x1a')]);module[_0xa246('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 67b027b..d83e1c6 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 _0xe6b2=['beepall','sequelize','STRING','INTEGER'];(function(_0x1ea953,_0x45da0b){var _0x13e686=function(_0x1fef7d){while(--_0x1fef7d){_0x1ea953['push'](_0x1ea953['shift']());}};_0x13e686(++_0x45da0b);}(_0xe6b2,0xe5));var _0x2e6b=function(_0x223889,_0x52eb10){_0x223889=_0x223889-0x0;var _0x7b59ae=_0xe6b2[_0x223889];return _0x7b59ae;};'use strict';var Sequelize=require(_0x2e6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e6b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2e6b('0x1')]},'timeout':{'type':Sequelize[_0x2e6b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x2e6b('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x08e6=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xadab2f,_0x124574){var _0x344893=function(_0x485251){while(--_0x485251){_0xadab2f['push'](_0xadab2f['shift']());}};_0x344893(++_0x124574);}(_0x08e6,0x15a));var _0x608e=function(_0x299bc3,_0x247914){_0x299bc3=_0x299bc3-0x0;var _0x38e7a6=_0x08e6[_0x299bc3];return _0x38e7a6;};'use strict';var Sequelize=require(_0x608e('0x0'));module[_0x608e('0x1')]={'name':{'type':Sequelize[_0x608e('0x2')],'unique':_0x608e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x608e('0x2')]},'timeout':{'type':Sequelize[_0x608e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x608e('0x5')](_0x608e('0x6'),'beepall',_0x608e('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 446921a..a9f6530 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 _0x142b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','MailQueues','end','error','name','send','index','map','MailQueue','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','user','get','UserProfileSection','autoAssociation','UserProfileResource','getMembers','findOne','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents'];(function(_0x5a36a4,_0x41101e){var _0x3553e9=function(_0x31755e){while(--_0x31755e){_0x5a36a4['push'](_0x5a36a4['shift']());}};_0x3553e9(++_0x41101e);}(_0x142b,0x10e));var _0xb142=function(_0x53c238,_0x14b8c0){_0x53c238=_0x53c238-0x0;var _0x25f53c=_0x142b[_0x53c238];return _0x25f53c;};'use strict';var emlformat=require(_0xb142('0x0'));var rimraf=require(_0xb142('0x1'));var zipdir=require(_0xb142('0x2'));var jsonpatch=require(_0xb142('0x3'));var rp=require(_0xb142('0x4'));var moment=require('moment');var BPromise=require(_0xb142('0x5'));var Mustache=require(_0xb142('0x6'));var util=require(_0xb142('0x7'));var path=require(_0xb142('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb142('0x9'));var jsforce=require(_0xb142('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb142('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb142('0xc'));var authService=require(_0xb142('0xd'));var qs=require(_0xb142('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb142('0xf'));var logger=require(_0xb142('0x10'))(_0xb142('0x11'));var utils=require('../../config/utils');var config=require(_0xb142('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xb142('0x13'))['db'];config[_0xb142('0x14')]=_[_0xb142('0x15')](config[_0xb142('0x14')],{'host':_0xb142('0x16'),'port':0x18eb});var socket=require(_0xb142('0x17'))(new Redis(config[_0xb142('0x14')]));require('./mailQueue.socket')[_0xb142('0x18')](socket);function respondWithStatusCode(_0x2e8e3c,_0x457945){_0x457945=_0x457945||0xcc;return function(_0x5cd126){if(_0x5cd126){return _0x2e8e3c['sendStatus'](_0x457945);}return _0x2e8e3c[_0xb142('0x19')](_0x457945)['end']();};}function respondWithResult(_0x49df23,_0x18fc62){_0x18fc62=_0x18fc62||0xc8;return function(_0x3012d8){if(_0x3012d8){return _0x49df23[_0xb142('0x19')](_0x18fc62)[_0xb142('0x1a')](_0x3012d8);}};}function respondWithFilteredResult(_0x579bce,_0x3f732f){return function(_0x260dbf){if(_0x260dbf){var _0x39fe76=typeof _0x3f732f['offset']===_0xb142('0x1b')&&typeof _0x3f732f[_0xb142('0x1c')]===_0xb142('0x1b');var _0x19a64d=_0x260dbf[_0xb142('0x1d')];var _0x3ccebe=_0x39fe76?0x0:_0x3f732f[_0xb142('0x1e')];var _0x462b45=_0x39fe76?_0x260dbf['count']:_0x3f732f[_0xb142('0x1e')]+_0x3f732f[_0xb142('0x1c')];var _0x18cae5;if(_0x462b45>=_0x19a64d){_0x462b45=_0x19a64d;_0x18cae5=0xc8;}else{_0x18cae5=0xce;}_0x579bce['status'](_0x18cae5);return _0x579bce[_0xb142('0x1f')](_0xb142('0x20'),_0x3ccebe+'-'+_0x462b45+'/'+_0x19a64d)[_0xb142('0x1a')](_0x260dbf);}return null;};}function patchUpdates(_0x4b5d55){return function(_0xcb0a22){try{jsonpatch[_0xb142('0x21')](_0xcb0a22,_0x4b5d55,!![]);}catch(_0x387c96){return BPromise[_0xb142('0x22')](_0x387c96);}return _0xcb0a22[_0xb142('0x23')]();};}function saveUpdates(_0x50094f,_0x38a68e){return function(_0x13193e){if(_0x13193e){return _0x13193e[_0xb142('0x24')](_0x50094f)[_0xb142('0x25')](function(_0x587250){return _0x587250;});}return null;};}function removeEntity(_0x3f02ac,_0x45fa72){return function(_0x3f6137){if(_0x3f6137){return _0x3f6137[_0xb142('0x26')]()[_0xb142('0x25')](function(){var _0x4725a2=_0x3f6137['get']({'plain':!![]});var _0x3bc169=_0xb142('0x27');return db['UserProfileResource'][_0xb142('0x26')]({'where':{'type':_0x3bc169,'resourceId':_0x4725a2['id']}})[_0xb142('0x25')](function(){return _0x3f6137;});})[_0xb142('0x25')](function(){_0x3f02ac[_0xb142('0x19')](0xcc)[_0xb142('0x28')]();});}};}function handleEntityNotFound(_0x2b47db,_0x54af32){return function(_0x595aaf){if(!_0x595aaf){_0x2b47db['sendStatus'](0x194);}return _0x595aaf;};}function handleError(_0x3bcfb7,_0x2b522c){_0x2b522c=_0x2b522c||0x1f4;return function(_0x22670b){logger[_0xb142('0x29')](_0x22670b['stack']);if(_0x22670b[_0xb142('0x2a')]){delete _0x22670b[_0xb142('0x2a')];}_0x3bcfb7[_0xb142('0x19')](_0x2b522c)[_0xb142('0x2b')](_0x22670b);};}exports[_0xb142('0x2c')]=function(_0x235833,_0x2645d8){var _0x414074={},_0x533de0={},_0x519c5f={'count':0x0,'rows':[]};var _0xe5dfe0=_[_0xb142('0x2d')](db[_0xb142('0x2e')]['rawAttributes'],function(_0x26d218){return{'name':_0x26d218['fieldName'],'type':_0x26d218[_0xb142('0x2f')]['key']};});_0x533de0['model']=_['map'](_0xe5dfe0,_0xb142('0x2a'));_0x533de0[_0xb142('0x30')]=_[_0xb142('0x31')](_0x235833[_0xb142('0x30')]);_0x533de0[_0xb142('0x32')]=_[_0xb142('0x33')](_0x533de0['model'],_0x533de0[_0xb142('0x30')]);_0x414074[_0xb142('0x34')]=_[_0xb142('0x33')](_0x533de0[_0xb142('0x35')],qs[_0xb142('0x36')](_0x235833[_0xb142('0x30')][_0xb142('0x36')]));_0x414074[_0xb142('0x34')]=_0x414074[_0xb142('0x34')]['length']?_0x414074[_0xb142('0x34')]:_0x533de0[_0xb142('0x35')];if(!_0x235833[_0xb142('0x30')][_0xb142('0x37')](_0xb142('0x38'))){_0x414074[_0xb142('0x1c')]=qs['limit'](_0x235833[_0xb142('0x30')]['limit']);_0x414074[_0xb142('0x1e')]=qs[_0xb142('0x1e')](_0x235833[_0xb142('0x30')][_0xb142('0x1e')]);}_0x414074['order']=qs[_0xb142('0x39')](_0x235833['query'][_0xb142('0x39')]);_0x414074[_0xb142('0x3a')]=qs[_0xb142('0x32')](_[_0xb142('0x3b')](_0x235833['query'],_0x533de0['filters']),_0xe5dfe0);if(_0x235833[_0xb142('0x30')][_0xb142('0x3c')]){_0x414074['where']=_['merge'](_0x414074[_0xb142('0x3a')],{'$or':_['map'](_0xe5dfe0,function(_0x34933c){if(_0x34933c[_0xb142('0x2f')]!==_0xb142('0x3d')){var _0x213b25={};_0x213b25[_0x34933c[_0xb142('0x2a')]]={'$like':'%'+_0x235833[_0xb142('0x30')][_0xb142('0x3c')]+'%'};return _0x213b25;}})});}_0x414074=_['merge']({},_0x414074,_0x235833[_0xb142('0x3e')]);var _0x4d9279={'where':_0x414074['where']};return db['MailQueue']['count'](_0x4d9279)['then'](function(_0x155f37){_0x519c5f[_0xb142('0x1d')]=_0x155f37;if(_0x235833['query'][_0xb142('0x3f')]){_0x414074['include']=[{'all':!![]}];}return db[_0xb142('0x2e')][_0xb142('0x40')](_0x414074);})[_0xb142('0x25')](function(_0x5164c0){_0x519c5f[_0xb142('0x41')]=_0x5164c0;return _0x519c5f;})[_0xb142('0x25')](respondWithFilteredResult(_0x2645d8,_0x414074))[_0xb142('0x42')](handleError(_0x2645d8,null));};exports[_0xb142('0x43')]=function(_0x1c99c9,_0x169a47){var _0x44eec4={'raw':!![],'where':{'id':_0x1c99c9[_0xb142('0x44')]['id']}},_0x440f00={};_0x440f00['model']=_['keys'](db['MailQueue'][_0xb142('0x45')]);_0x440f00[_0xb142('0x30')]=_[_0xb142('0x31')](_0x1c99c9[_0xb142('0x30')]);_0x440f00['filters']=_[_0xb142('0x33')](_0x440f00[_0xb142('0x35')],_0x440f00[_0xb142('0x30')]);_0x44eec4[_0xb142('0x34')]=_[_0xb142('0x33')](_0x440f00[_0xb142('0x35')],qs['fields'](_0x1c99c9[_0xb142('0x30')]['fields']));_0x44eec4[_0xb142('0x34')]=_0x44eec4[_0xb142('0x34')][_0xb142('0x46')]?_0x44eec4[_0xb142('0x34')]:_0x440f00[_0xb142('0x35')];if(_0x1c99c9[_0xb142('0x30')][_0xb142('0x3f')]){_0x44eec4['include']=[{'all':!![]}];}_0x44eec4=_[_0xb142('0x47')]({},_0x44eec4,_0x1c99c9['options']);return db[_0xb142('0x2e')][_0xb142('0x48')](_0x44eec4)[_0xb142('0x25')](handleEntityNotFound(_0x169a47,null))[_0xb142('0x25')](respondWithResult(_0x169a47,null))[_0xb142('0x42')](handleError(_0x169a47,null));};exports[_0xb142('0x49')]=function(_0x2c4608,_0x52fe){return db['MailQueue'][_0xb142('0x49')](_0x2c4608[_0xb142('0x4a')],{})[_0xb142('0x25')](function(_0x112940){var _0x2898f2=_0x2c4608[_0xb142('0x4b')][_0xb142('0x4c')]({'plain':!![]});if(!_0x2898f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2898f2['role']===_0xb142('0x4b')){var _0x401548=_0x112940['get']({'plain':!![]});var _0x433c61=_0xb142('0x27');return db[_0xb142('0x4d')][_0xb142('0x48')]({'where':{'name':_0x433c61,'userProfileId':_0x2898f2['userProfileId']},'raw':!![]})[_0xb142('0x25')](function(_0x1842f2){if(_0x1842f2&&_0x1842f2[_0xb142('0x4e')]===0x0){return db[_0xb142('0x4f')]['create']({'name':_0x401548[_0xb142('0x2a')],'resourceId':_0x401548['id'],'type':_0x1842f2[_0xb142('0x2a')],'sectionId':_0x1842f2['id']},{})[_0xb142('0x25')](function(){return _0x112940;});}else{return _0x112940;}})[_0xb142('0x42')](function(_0x27f7d9){logger[_0xb142('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f7d9);throw _0x27f7d9;});}return _0x112940;})['then'](respondWithResult(_0x52fe,0xc9))[_0xb142('0x42')](handleError(_0x52fe,null));};exports[_0xb142('0x24')]=function(_0xb240c7,_0x3f059d){if(_0xb240c7[_0xb142('0x4a')]['id']){delete _0xb240c7['body']['id'];}return db[_0xb142('0x2e')]['find']({'where':{'id':_0xb240c7['params']['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x3f059d,null))[_0xb142('0x25')](saveUpdates(_0xb240c7[_0xb142('0x4a')],null))[_0xb142('0x25')](respondWithResult(_0x3f059d,null))[_0xb142('0x42')](handleError(_0x3f059d,null));};exports[_0xb142('0x26')]=function(_0x924d1c,_0x3cdfa4){return db[_0xb142('0x2e')][_0xb142('0x48')]({'where':{'id':_0x924d1c[_0xb142('0x44')]['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x3cdfa4,null))['then'](removeEntity(_0x3cdfa4,null))[_0xb142('0x42')](handleError(_0x3cdfa4,null));};exports['describe']=function(_0x1fd601,_0x3bedc5){return db[_0xb142('0x2e')]['describe']()[_0xb142('0x25')](respondWithResult(_0x3bedc5,null))[_0xb142('0x42')](handleError(_0x3bedc5,null));};exports[_0xb142('0x50')]=function(_0x1fcfd5,_0xe8f0b3,_0x104802){var _0x12dd35={'raw':!![],'where':{}},_0x5ce745={},_0x334e25;return db[_0xb142('0x2e')][_0xb142('0x51')]({'where':{'id':_0x1fcfd5['params']['id']}})['then'](handleEntityNotFound(_0xe8f0b3,null))['then'](function(_0x232146){if(_0x232146){_0x334e25=_0x232146[_0xb142('0x4c')]({'plain':!![]});_0x5ce745[_0xb142('0x35')]=_['keys'](db[_0xb142('0x52')][_0xb142('0x45')]);_0x5ce745[_0xb142('0x30')]=_[_0xb142('0x31')](_0x1fcfd5[_0xb142('0x30')]);_0x5ce745['filters']=_[_0xb142('0x33')](_0x5ce745[_0xb142('0x35')],_0x5ce745['query']);_0x12dd35[_0xb142('0x34')]=_[_0xb142('0x33')](_0x5ce745[_0xb142('0x35')],qs[_0xb142('0x36')](_0x1fcfd5[_0xb142('0x30')][_0xb142('0x36')]));_0x12dd35[_0xb142('0x34')]=_0x12dd35[_0xb142('0x34')][_0xb142('0x46')]?_0x12dd35[_0xb142('0x34')]:_0x5ce745[_0xb142('0x35')];if(!_0x1fcfd5[_0xb142('0x30')][_0xb142('0x37')](_0xb142('0x38'))){_0x12dd35[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x1fcfd5[_0xb142('0x30')][_0xb142('0x1c')]);_0x12dd35[_0xb142('0x1e')]=qs[_0xb142('0x1e')](_0x1fcfd5['query'][_0xb142('0x1e')]);}_0x12dd35[_0xb142('0x53')]=qs[_0xb142('0x39')](_0x1fcfd5[_0xb142('0x30')][_0xb142('0x39')]);_0x12dd35[_0xb142('0x3a')]=qs[_0xb142('0x32')](_[_0xb142('0x3b')](_0x1fcfd5[_0xb142('0x30')],_0x5ce745['filters']));_0x12dd35['where'][_0xb142('0x54')]=_0x232146['id'];if(_0x1fcfd5[_0xb142('0x30')]['filter']){_0x12dd35['where']=_[_0xb142('0x47')](_0x12dd35['where'],{'$or':_['map'](_0x12dd35['attributes'],function(_0xa954fc){var _0x150499={};_0x150499[_0xa954fc]={'$like':'%'+_0x1fcfd5['query'][_0xb142('0x3c')]+'%'};return _0x150499;})});}_0x12dd35=_['merge']({},_0x12dd35,_0x1fcfd5['options']);return db[_0xb142('0x52')][_0xb142('0x40')](_0x12dd35);}})['then'](function(_0x4e5e95){if(_0x4e5e95){return db[_0xb142('0x55')][_0xb142('0x56')]({'where':{'id':_[_0xb142('0x2d')](_0x4e5e95,_0xb142('0x57')),'role':'agent'},'attributes':['id','name',_0xb142('0x58'),_0xb142('0x59'),_0xb142('0x5a')]});}})[_0xb142('0x25')](function(_0x398bd1){if(_0x398bd1){return{'count':_0x398bd1[_0xb142('0x1d')],'rows':_[_0xb142('0x2d')](_0x398bd1[_0xb142('0x41')],function(_0x3bfb83){return{'membername':_0x3bfb83[_0xb142('0x2a')],'UserId':_0x3bfb83['id'],'queue_name':_0x334e25[_0xb142('0x2a')],'MailQueueId':_0x334e25['id'],'interface':util[_0xb142('0x5b')](_0xb142('0x5c'),_0xb142('0x5d'),_0x3bfb83[_0xb142('0x2a')]),'penalty':0x0,'paused':_0x3bfb83[_0xb142('0x58')],'createdAt':_0x3bfb83[_0xb142('0x5a')],'updatedAt':_0x3bfb83[_0xb142('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xe8f0b3,_0x12dd35))['catch'](handleError(_0xe8f0b3,null));};exports[_0xb142('0x5e')]=function(_0x19ae67,_0x362198,_0x3d0fe7){var _0x55902d={};var _0x3f4e18={};var _0x1debe0;var _0x5242b4;return db['MailQueue']['findOne']({'where':{'id':_0x19ae67[_0xb142('0x44')]['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x362198,null))[_0xb142('0x25')](function(_0x8691d7){if(_0x8691d7){_0x1debe0=_0x8691d7;_0x3f4e18[_0xb142('0x35')]=_[_0xb142('0x31')](db[_0xb142('0x5f')]['rawAttributes']);_0x3f4e18['query']=_[_0xb142('0x31')](_0x19ae67['query']);_0x3f4e18[_0xb142('0x32')]=_['intersection'](_0x3f4e18[_0xb142('0x35')],_0x3f4e18[_0xb142('0x30')]);_0x55902d['attributes']=_[_0xb142('0x33')](_0x3f4e18['model'],qs[_0xb142('0x36')](_0x19ae67['query']['fields']));_0x55902d['attributes']=_0x55902d[_0xb142('0x34')][_0xb142('0x46')]?_0x55902d[_0xb142('0x34')]:_0x3f4e18[_0xb142('0x35')];_0x55902d[_0xb142('0x53')]=qs[_0xb142('0x39')](_0x19ae67[_0xb142('0x30')]['sort']);_0x55902d[_0xb142('0x3a')]=qs[_0xb142('0x32')](_[_0xb142('0x3b')](_0x19ae67[_0xb142('0x30')],_0x3f4e18[_0xb142('0x32')]));if(_0x19ae67[_0xb142('0x30')][_0xb142('0x3c')]){_0x55902d[_0xb142('0x3a')]=_['merge'](_0x55902d[_0xb142('0x3a')],{'$or':_[_0xb142('0x2d')](_0x55902d[_0xb142('0x34')],function(_0x36fa97){var _0xba7f02={};_0xba7f02[_0x36fa97]={'$like':'%'+_0x19ae67[_0xb142('0x30')][_0xb142('0x3c')]+'%'};return _0xba7f02;})});}_0x55902d=_[_0xb142('0x47')]({},_0x55902d,_0x19ae67[_0xb142('0x3e')]);return _0x1debe0[_0xb142('0x5e')](_0x55902d);}})[_0xb142('0x25')](function(_0x2c7bcf){if(_0x2c7bcf){_0x5242b4=_0x2c7bcf['length'];if(!_0x19ae67['query'][_0xb142('0x37')](_0xb142('0x38'))){_0x55902d[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x19ae67[_0xb142('0x30')][_0xb142('0x1c')]);_0x55902d[_0xb142('0x1e')]=qs[_0xb142('0x1e')](_0x19ae67[_0xb142('0x30')][_0xb142('0x1e')]);}return _0x1debe0['getTeams'](_0x55902d);}})['then'](function(_0x5c508c){if(_0x5c508c){return _0x5c508c?{'count':_0x5242b4,'rows':_0x5c508c}:null;}})[_0xb142('0x25')](respondWithResult(_0x362198,null))[_0xb142('0x42')](handleError(_0x362198,null));};exports[_0xb142('0x60')]=function(_0x238004,_0x25b138,_0x360471){var _0x284a2f=_0x238004[_0xb142('0x4a')][_0xb142('0x61')];return db[_0xb142('0x5f')]['findAll']({'where':{'id':_0x284a2f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb142('0x2a'),'online',_0xb142('0x62'),_0xb142('0x63')],'raw':!![]}]})[_0xb142('0x25')](function(_0xd5cdea){if(_0xd5cdea){var _0x502fb5=_[_0xb142('0x64')](_0xd5cdea,function(_0x51dca6){var _0x1a8346=_0x51dca6[_0xb142('0x4c')]({'plain':!![]});return _0x1a8346[_0xb142('0x65')];});return db[_0xb142('0x2e')][_0xb142('0x48')]({'where':{'id':_0x238004[_0xb142('0x44')]['id']}})[_0xb142('0x25')](function(_0x4c501f){return db['sequelize'][_0xb142('0x66')](function(_0x642c91){return _0x4c501f['addTeams'](_0x284a2f,{'transaction':_0x642c91})['then'](function(){return BPromise[_0xb142('0x67')](_0x502fb5,function(_0x35eb51){return db[_0xb142('0x52')][_0xb142('0x68')]({'where':{'UserId':_0x35eb51['id'],'MailQueueId':_0x238004[_0xb142('0x44')]['id']},'transaction':_0x642c91});});})[_0xb142('0x25')](function(){_0x502fb5['forEach'](function(_0x1ad086){socket[_0xb142('0x69')](_0xb142('0x6a'),{'UserId':_0x1ad086['id'],'MailQueueId':_0x4c501f['id']});});});});});}})[_0xb142('0x25')](respondWithStatusCode(_0x25b138,null))[_0xb142('0x42')](handleError(_0x25b138,null));};exports[_0xb142('0x6b')]=function(_0x5e1166,_0x558f06,_0x1ada71){return db[_0xb142('0x5f')][_0xb142('0x40')]({'where':{'id':_0x5e1166[_0xb142('0x30')][_0xb142('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb142('0x25')](handleEntityNotFound(_0x558f06,null))[_0xb142('0x25')](function(_0x48ac4c){var _0x162134=_[_0xb142('0x2d')](_0x48ac4c,'id');var _0x2214a4=[];var _0x214f98=[];var _0x26ffbc=squel['select']();_0x26ffbc[_0xb142('0x6c')](_0xb142('0x6d'))[_0xb142('0x6e')](_0xb142('0x6f'),'tq')[_0xb142('0x70')](_0xb142('0x71'),'ut',_0xb142('0x72'))[_0xb142('0x3a')](_0xb142('0x73'),_0x5e1166['params']['id']);for(var _0x554bd3=0x0;_0x554bd3<_0x48ac4c['length'];_0x554bd3+=0x1){let _0x1ba260=_0x48ac4c[_0x554bd3];for(var _0x1bb7bd=0x0;_0x1bb7bd<_0x1ba260[_0xb142('0x65')][_0xb142('0x46')];_0x1bb7bd+=0x1){let _0x378a9f=_0x1ba260['Agents'][_0x1bb7bd];var _0x472d61=_0x26ffbc[_0xb142('0x74')]();_0x472d61[_0xb142('0x3a')](_0xb142('0x75'),_0x378a9f['id']);_0x214f98[_0xb142('0x76')](db['sequelize'][_0xb142('0x30')](_0x472d61[_0xb142('0x77')](),{'type':db[_0xb142('0x78')][_0xb142('0x79')][_0xb142('0x7a')]})['then'](function(_0x36a972){if(_0x36a972[_0xb142('0x46')]===0x1){return _0x378a9f['id'];}else{var _0x36e3f4=_['every'](_[_0xb142('0x2d')](_0x36a972,_0xb142('0x7b')),function(_0x562b1c){return _['includes'](_0x162134,_0x562b1c);});if(_0x36e3f4){return _0x378a9f['id'];}}}));}}return BPromise[_0xb142('0x7c')](_0x214f98)['then'](function(_0x57061c){_0x2214a4=_(_0x2214a4)[_0xb142('0x7d')](_0x57061c)['compact']()[_0xb142('0x7e')]();return db[_0xb142('0x2e')][_0xb142('0x48')]({'where':{'id':_0x5e1166[_0xb142('0x44')]['id']}})[_0xb142('0x25')](function(_0x5b3118){return db['sequelize'][_0xb142('0x66')](function(_0x235abc){return _0x5b3118['removeTeams'](_0x5e1166[_0xb142('0x30')]['ids'],{'transaction':_0x235abc})[_0xb142('0x25')](function(){if(!_[_0xb142('0x7f')](_0x2214a4)){return _0x5b3118[_0xb142('0x80')](_0x2214a4,{'transaction':_0x235abc});}})[_0xb142('0x25')](function(){_0x2214a4['forEach'](function(_0x29187a){socket[_0xb142('0x69')](_0xb142('0x81'),{'UserId':_0x29187a,'MailQueueId':_0x5b3118['id']});});});});});});})['then'](respondWithStatusCode(_0x558f06,null))[_0xb142('0x42')](handleError(_0x558f06,null));};exports['addAgents']=function(_0x25d381,_0x4a8dfc,_0x2b4327){return db['MailQueue'][_0xb142('0x48')]({'where':{'id':_0x25d381['params']['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x4a8dfc,null))[_0xb142('0x25')](function(_0x549a21){if(_0x549a21){return _0x549a21[_0xb142('0x82')](_0x25d381[_0xb142('0x4a')][_0xb142('0x61')],_[_0xb142('0x83')](_0x25d381['body'],['ids','id'])||{})[_0xb142('0x84')](function(_0x5e4adb){for(var _0x39f344=0x0;_0x39f344<_0x25d381[_0xb142('0x4a')]['ids']['length'];_0x39f344+=0x1){socket[_0xb142('0x69')]('userMailQueue:save',{'UserId':Number(_0x25d381['body']['ids'][_0x39f344]),'MailQueueId':Number(_0x25d381[_0xb142('0x44')]['id'])});}return _0x5e4adb;});}})[_0xb142('0x25')](respondWithResult(_0x4a8dfc,null))['catch'](handleError(_0x4a8dfc,null));};exports[_0xb142('0x80')]=function(_0x34ad50,_0x4fdeb0,_0x5e040a){return db[_0xb142('0x2e')][_0xb142('0x48')]({'where':{'id':_0x34ad50[_0xb142('0x44')]['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x4fdeb0,null))[_0xb142('0x25')](function(_0x17cbe5){if(_0x17cbe5){return _0x17cbe5[_0xb142('0x80')](_0x34ad50[_0xb142('0x30')]['ids'])[_0xb142('0x25')](function(){if(_[_0xb142('0x85')](_0x34ad50[_0xb142('0x30')][_0xb142('0x61')])){for(var _0x28a4aa=0x0;_0x28a4aa<_0x34ad50[_0xb142('0x30')][_0xb142('0x61')]['length'];_0x28a4aa+=0x1){socket[_0xb142('0x69')](_0xb142('0x81'),{'UserId':Number(_0x34ad50[_0xb142('0x30')][_0xb142('0x61')][_0x28a4aa]),'MailQueueId':Number(_0x34ad50[_0xb142('0x44')]['id'])});}}else{socket[_0xb142('0x69')]('userMailQueue:remove',{'UserId':Number(_0x34ad50['query'][_0xb142('0x61')]),'MailQueueId':Number(_0x34ad50[_0xb142('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x4fdeb0,null))[_0xb142('0x42')](handleError(_0x4fdeb0,null));};exports[_0xb142('0x86')]=function(_0x57bdf1,_0x3e168e,_0x3c29ee){var _0x20ca3a={};var _0x3ff679={};var _0x3fe10c;var _0x24df08;return db[_0xb142('0x2e')][_0xb142('0x51')]({'where':{'id':_0x57bdf1[_0xb142('0x44')]['id']}})[_0xb142('0x25')](handleEntityNotFound(_0x3e168e,null))[_0xb142('0x25')](function(_0x55cba5){if(_0x55cba5){_0x3fe10c=_0x55cba5;_0x3ff679['model']=_[_0xb142('0x31')](db[_0xb142('0x55')][_0xb142('0x45')]);_0x3ff679[_0xb142('0x30')]=_[_0xb142('0x31')](_0x57bdf1[_0xb142('0x30')]);_0x3ff679[_0xb142('0x32')]=_[_0xb142('0x33')](_0x3ff679[_0xb142('0x35')],_0x3ff679[_0xb142('0x30')]);_0x20ca3a['attributes']=_[_0xb142('0x33')](_0x3ff679['model'],qs[_0xb142('0x36')](_0x57bdf1['query'][_0xb142('0x36')]));_0x20ca3a[_0xb142('0x34')]=_0x20ca3a[_0xb142('0x34')][_0xb142('0x46')]?_0x20ca3a[_0xb142('0x34')]:_0x3ff679[_0xb142('0x35')];_0x20ca3a['order']=qs[_0xb142('0x39')](_0x57bdf1[_0xb142('0x30')][_0xb142('0x39')]);_0x20ca3a[_0xb142('0x3a')]=qs['filters'](_[_0xb142('0x3b')](_0x57bdf1[_0xb142('0x30')],_0x3ff679['filters']));if(_0x57bdf1[_0xb142('0x30')][_0xb142('0x3c')]){_0x20ca3a[_0xb142('0x3a')]=_[_0xb142('0x47')](_0x20ca3a[_0xb142('0x3a')],{'$or':_['map'](_0x20ca3a[_0xb142('0x34')],function(_0x388752){var _0x47a633={};_0x47a633[_0x388752]={'$like':'%'+_0x57bdf1[_0xb142('0x30')][_0xb142('0x3c')]+'%'};return _0x47a633;})});}_0x20ca3a=_['merge']({},_0x20ca3a,_0x57bdf1[_0xb142('0x3e')]);return _0x3fe10c[_0xb142('0x86')](_0x20ca3a);}})[_0xb142('0x25')](function(_0x3f5729){if(_0x3f5729){_0x24df08=_0x3f5729[_0xb142('0x46')];if(!_0x57bdf1[_0xb142('0x30')][_0xb142('0x37')](_0xb142('0x38'))){_0x20ca3a[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x57bdf1['query'][_0xb142('0x1c')]);_0x20ca3a['offset']=qs[_0xb142('0x1e')](_0x57bdf1['query'][_0xb142('0x1e')]);}return _0x3fe10c[_0xb142('0x86')](_0x20ca3a);}})[_0xb142('0x25')](function(_0x1ff26a){if(_0x1ff26a){return _0x1ff26a?{'count':_0x24df08,'rows':_0x1ff26a}:null;}})[_0xb142('0x25')](respondWithResult(_0x3e168e,null))['catch'](handleError(_0x3e168e,null));}; \ No newline at end of file +var _0xcdc2=['ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','removeTeams','isEmpty','forEach','userMailQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','query','model','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserMailQueue','nolimit','MailQueueId','User','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','order'];(function(_0x40769f,_0x4d516d){var _0x469d2b=function(_0x26cbf5){while(--_0x26cbf5){_0x40769f['push'](_0x40769f['shift']());}};_0x469d2b(++_0x4d516d);}(_0xcdc2,0x13d));var _0x2cdc=function(_0x37f89b,_0x24c973){_0x37f89b=_0x37f89b-0x0;var _0x45172e=_0xcdc2[_0x37f89b];return _0x45172e;};'use strict';var emlformat=require(_0x2cdc('0x0'));var rimraf=require(_0x2cdc('0x1'));var zipdir=require(_0x2cdc('0x2'));var jsonpatch=require(_0x2cdc('0x3'));var rp=require(_0x2cdc('0x4'));var moment=require(_0x2cdc('0x5'));var BPromise=require(_0x2cdc('0x6'));var Mustache=require(_0x2cdc('0x7'));var util=require('util');var path=require(_0x2cdc('0x8'));var sox=require(_0x2cdc('0x9'));var csv=require(_0x2cdc('0xa'));var ejs=require(_0x2cdc('0xb'));var fs=require('fs');var fs_extra=require(_0x2cdc('0xc'));var _=require(_0x2cdc('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2cdc('0xe'));var deskjs=require(_0x2cdc('0xf'));var toCsv=require(_0x2cdc('0xa'));var querystring=require(_0x2cdc('0x10'));var Papa=require('papaparse');var Redis=require(_0x2cdc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cdc('0x12'));var hardwareService=require(_0x2cdc('0x13'));var logger=require(_0x2cdc('0x14'))(_0x2cdc('0x15'));var utils=require('../../config/utils');var config=require(_0x2cdc('0x16'));var licenseUtil=require(_0x2cdc('0x17'));var db=require('../../mysqldb')['db'];config[_0x2cdc('0x18')]=_[_0x2cdc('0x19')](config[_0x2cdc('0x18')],{'host':_0x2cdc('0x1a'),'port':0x18eb});var socket=require(_0x2cdc('0x1b'))(new Redis(config[_0x2cdc('0x18')]));require(_0x2cdc('0x1c'))[_0x2cdc('0x1d')](socket);function respondWithStatusCode(_0x459f93,_0x577b46){_0x577b46=_0x577b46||0xcc;return function(_0x53e3a2){if(_0x53e3a2){return _0x459f93[_0x2cdc('0x1e')](_0x577b46);}return _0x459f93[_0x2cdc('0x1f')](_0x577b46)[_0x2cdc('0x20')]();};}function respondWithResult(_0x5dbc26,_0x19079a){_0x19079a=_0x19079a||0xc8;return function(_0x3a2d6e){if(_0x3a2d6e){return _0x5dbc26['status'](_0x19079a)[_0x2cdc('0x21')](_0x3a2d6e);}};}function respondWithFilteredResult(_0x2bfa10,_0x14f86f){return function(_0x576a65){if(_0x576a65){var _0x4acc6b=typeof _0x14f86f['offset']===_0x2cdc('0x22')&&typeof _0x14f86f['limit']===_0x2cdc('0x22');var _0xc28f48=_0x576a65['count'];var _0xfb1626=_0x4acc6b?0x0:_0x14f86f['offset'];var _0x3e82f5=_0x4acc6b?_0x576a65[_0x2cdc('0x23')]:_0x14f86f[_0x2cdc('0x24')]+_0x14f86f['limit'];var _0x45047c;if(_0x3e82f5>=_0xc28f48){_0x3e82f5=_0xc28f48;_0x45047c=0xc8;}else{_0x45047c=0xce;}_0x2bfa10[_0x2cdc('0x1f')](_0x45047c);return _0x2bfa10[_0x2cdc('0x25')](_0x2cdc('0x26'),_0xfb1626+'-'+_0x3e82f5+'/'+_0xc28f48)['json'](_0x576a65);}return null;};}function patchUpdates(_0x3bcbf5){return function(_0x217709){try{jsonpatch[_0x2cdc('0x27')](_0x217709,_0x3bcbf5,!![]);}catch(_0x404b05){return BPromise[_0x2cdc('0x28')](_0x404b05);}return _0x217709['save']();};}function saveUpdates(_0x2bb3b7,_0x4ba120){return function(_0x25ecc3){if(_0x25ecc3){return _0x25ecc3[_0x2cdc('0x29')](_0x2bb3b7)['then'](function(_0x3b5ff3){return _0x3b5ff3;});}return null;};}function removeEntity(_0x14166d,_0x1398be){return function(_0x5237e1){if(_0x5237e1){return _0x5237e1[_0x2cdc('0x2a')]()[_0x2cdc('0x2b')](function(){var _0x2d8377=_0x5237e1['get']({'plain':!![]});var _0x36d11e='MailQueues';return db['UserProfileResource'][_0x2cdc('0x2a')]({'where':{'type':_0x36d11e,'resourceId':_0x2d8377['id']}})[_0x2cdc('0x2b')](function(){return _0x5237e1;});})['then'](function(){_0x14166d[_0x2cdc('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28820b,_0x1a9e56){return function(_0x33f6bc){if(!_0x33f6bc){_0x28820b[_0x2cdc('0x1e')](0x194);}return _0x33f6bc;};}function handleError(_0x42a577,_0x58f22b){_0x58f22b=_0x58f22b||0x1f4;return function(_0x110159){logger[_0x2cdc('0x2c')](_0x110159[_0x2cdc('0x2d')]);if(_0x110159['name']){delete _0x110159[_0x2cdc('0x2e')];}_0x42a577[_0x2cdc('0x1f')](_0x58f22b)[_0x2cdc('0x2f')](_0x110159);};}exports[_0x2cdc('0x30')]=function(_0x1c8e4d,_0x3bf801){var _0x3023bc={},_0x72cd8d={},_0x18fde7={'count':0x0,'rows':[]};var _0x26fcdb=_[_0x2cdc('0x31')](db[_0x2cdc('0x32')][_0x2cdc('0x33')],function(_0x339479){return{'name':_0x339479[_0x2cdc('0x34')],'type':_0x339479[_0x2cdc('0x35')]['key']};});_0x72cd8d['model']=_[_0x2cdc('0x31')](_0x26fcdb,'name');_0x72cd8d[_0x2cdc('0x36')]=_['keys'](_0x1c8e4d[_0x2cdc('0x36')]);_0x72cd8d['filters']=_['intersection'](_0x72cd8d[_0x2cdc('0x37')],_0x72cd8d[_0x2cdc('0x36')]);_0x3023bc['attributes']=_[_0x2cdc('0x38')](_0x72cd8d[_0x2cdc('0x37')],qs[_0x2cdc('0x39')](_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x39')]));_0x3023bc['attributes']=_0x3023bc[_0x2cdc('0x3a')][_0x2cdc('0x3b')]?_0x3023bc[_0x2cdc('0x3a')]:_0x72cd8d['model'];if(!_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x3c')]('nolimit')){_0x3023bc[_0x2cdc('0x3d')]=qs[_0x2cdc('0x3d')](_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x3d')]);_0x3023bc['offset']=qs[_0x2cdc('0x24')](_0x1c8e4d['query'][_0x2cdc('0x24')]);}_0x3023bc['order']=qs['sort'](_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x3e')]);_0x3023bc[_0x2cdc('0x3f')]=qs[_0x2cdc('0x40')](_[_0x2cdc('0x41')](_0x1c8e4d[_0x2cdc('0x36')],_0x72cd8d[_0x2cdc('0x40')]),_0x26fcdb);if(_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x42')]){_0x3023bc[_0x2cdc('0x3f')]=_['merge'](_0x3023bc[_0x2cdc('0x3f')],{'$or':_[_0x2cdc('0x31')](_0x26fcdb,function(_0x5e45c1){if(_0x5e45c1[_0x2cdc('0x35')]!==_0x2cdc('0x43')){var _0x21172f={};_0x21172f[_0x5e45c1['name']]={'$like':'%'+_0x1c8e4d['query'][_0x2cdc('0x42')]+'%'};return _0x21172f;}})});}_0x3023bc=_[_0x2cdc('0x44')]({},_0x3023bc,_0x1c8e4d[_0x2cdc('0x45')]);var _0x20087b={'where':_0x3023bc['where']};return db['MailQueue'][_0x2cdc('0x23')](_0x20087b)[_0x2cdc('0x2b')](function(_0x2c23ff){_0x18fde7[_0x2cdc('0x23')]=_0x2c23ff;if(_0x1c8e4d[_0x2cdc('0x36')][_0x2cdc('0x46')]){_0x3023bc[_0x2cdc('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0x2cdc('0x48')](_0x3023bc);})['then'](function(_0x211020){_0x18fde7['rows']=_0x211020;return _0x18fde7;})[_0x2cdc('0x2b')](respondWithFilteredResult(_0x3bf801,_0x3023bc))['catch'](handleError(_0x3bf801,null));};exports[_0x2cdc('0x49')]=function(_0x300dd1,_0xb9e3b2){var _0x1cf0cc={'raw':!![],'where':{'id':_0x300dd1['params']['id']}},_0x497fad={};_0x497fad[_0x2cdc('0x37')]=_['keys'](db['MailQueue']['rawAttributes']);_0x497fad['query']=_[_0x2cdc('0x4a')](_0x300dd1[_0x2cdc('0x36')]);_0x497fad[_0x2cdc('0x40')]=_['intersection'](_0x497fad[_0x2cdc('0x37')],_0x497fad[_0x2cdc('0x36')]);_0x1cf0cc[_0x2cdc('0x3a')]=_['intersection'](_0x497fad[_0x2cdc('0x37')],qs[_0x2cdc('0x39')](_0x300dd1[_0x2cdc('0x36')][_0x2cdc('0x39')]));_0x1cf0cc['attributes']=_0x1cf0cc[_0x2cdc('0x3a')][_0x2cdc('0x3b')]?_0x1cf0cc[_0x2cdc('0x3a')]:_0x497fad['model'];if(_0x300dd1[_0x2cdc('0x36')][_0x2cdc('0x46')]){_0x1cf0cc[_0x2cdc('0x47')]=[{'all':!![]}];}_0x1cf0cc=_['merge']({},_0x1cf0cc,_0x300dd1[_0x2cdc('0x45')]);return db[_0x2cdc('0x32')][_0x2cdc('0x4b')](_0x1cf0cc)[_0x2cdc('0x2b')](handleEntityNotFound(_0xb9e3b2,null))['then'](respondWithResult(_0xb9e3b2,null))['catch'](handleError(_0xb9e3b2,null));};exports[_0x2cdc('0x4c')]=function(_0x38acbe,_0x393d08){return db['MailQueue']['create'](_0x38acbe[_0x2cdc('0x4d')],{})[_0x2cdc('0x2b')](function(_0x7f4dd8){var _0x6d8b58=_0x38acbe[_0x2cdc('0x4e')][_0x2cdc('0x4f')]({'plain':!![]});if(!_0x6d8b58)throw new Error(_0x2cdc('0x50'));if(_0x6d8b58[_0x2cdc('0x51')]===_0x2cdc('0x4e')){var _0x184646=_0x7f4dd8[_0x2cdc('0x4f')]({'plain':!![]});var _0x52d735='MailQueues';return db[_0x2cdc('0x52')]['find']({'where':{'name':_0x52d735,'userProfileId':_0x6d8b58['userProfileId']},'raw':!![]})[_0x2cdc('0x2b')](function(_0x72cc55){if(_0x72cc55&&_0x72cc55[_0x2cdc('0x53')]===0x0){return db['UserProfileResource'][_0x2cdc('0x4c')]({'name':_0x184646[_0x2cdc('0x2e')],'resourceId':_0x184646['id'],'type':_0x72cc55['name'],'sectionId':_0x72cc55['id']},{})['then'](function(){return _0x7f4dd8;});}else{return _0x7f4dd8;}})[_0x2cdc('0x54')](function(_0xc87654){logger['error'](_0x2cdc('0x55'),_0xc87654);throw _0xc87654;});}return _0x7f4dd8;})[_0x2cdc('0x2b')](respondWithResult(_0x393d08,0xc9))[_0x2cdc('0x54')](handleError(_0x393d08,null));};exports[_0x2cdc('0x29')]=function(_0x12ee2e,_0x54648c){if(_0x12ee2e[_0x2cdc('0x4d')]['id']){delete _0x12ee2e['body']['id'];}return db[_0x2cdc('0x32')][_0x2cdc('0x4b')]({'where':{'id':_0x12ee2e[_0x2cdc('0x56')]['id']}})[_0x2cdc('0x2b')](handleEntityNotFound(_0x54648c,null))['then'](saveUpdates(_0x12ee2e[_0x2cdc('0x4d')],null))['then'](respondWithResult(_0x54648c,null))[_0x2cdc('0x54')](handleError(_0x54648c,null));};exports['destroy']=function(_0x2472fc,_0x3c9c90){return db['MailQueue'][_0x2cdc('0x4b')]({'where':{'id':_0x2472fc[_0x2cdc('0x56')]['id']}})['then'](handleEntityNotFound(_0x3c9c90,null))[_0x2cdc('0x2b')](removeEntity(_0x3c9c90,null))[_0x2cdc('0x54')](handleError(_0x3c9c90,null));};exports[_0x2cdc('0x57')]=function(_0x4a3324,_0x470f24){return db[_0x2cdc('0x32')][_0x2cdc('0x57')]()[_0x2cdc('0x2b')](respondWithResult(_0x470f24,null))[_0x2cdc('0x54')](handleError(_0x470f24,null));};exports['getMembers']=function(_0x3de469,_0x369c49,_0xb66bf2){var _0x1f773a={'raw':!![],'where':{}},_0x2104b1={},_0x27adda;return db[_0x2cdc('0x32')]['findOne']({'where':{'id':_0x3de469[_0x2cdc('0x56')]['id']}})[_0x2cdc('0x2b')](handleEntityNotFound(_0x369c49,null))[_0x2cdc('0x2b')](function(_0x3b9202){if(_0x3b9202){_0x27adda=_0x3b9202[_0x2cdc('0x4f')]({'plain':!![]});_0x2104b1['model']=_[_0x2cdc('0x4a')](db[_0x2cdc('0x58')][_0x2cdc('0x33')]);_0x2104b1[_0x2cdc('0x36')]=_[_0x2cdc('0x4a')](_0x3de469[_0x2cdc('0x36')]);_0x2104b1[_0x2cdc('0x40')]=_[_0x2cdc('0x38')](_0x2104b1['model'],_0x2104b1[_0x2cdc('0x36')]);_0x1f773a[_0x2cdc('0x3a')]=_[_0x2cdc('0x38')](_0x2104b1[_0x2cdc('0x37')],qs['fields'](_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x39')]));_0x1f773a[_0x2cdc('0x3a')]=_0x1f773a['attributes'][_0x2cdc('0x3b')]?_0x1f773a[_0x2cdc('0x3a')]:_0x2104b1[_0x2cdc('0x37')];if(!_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x3c')](_0x2cdc('0x59'))){_0x1f773a[_0x2cdc('0x3d')]=qs[_0x2cdc('0x3d')](_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x3d')]);_0x1f773a[_0x2cdc('0x24')]=qs[_0x2cdc('0x24')](_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x24')]);}_0x1f773a['order']=qs[_0x2cdc('0x3e')](_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x3e')]);_0x1f773a['where']=qs[_0x2cdc('0x40')](_[_0x2cdc('0x41')](_0x3de469[_0x2cdc('0x36')],_0x2104b1[_0x2cdc('0x40')]));_0x1f773a[_0x2cdc('0x3f')][_0x2cdc('0x5a')]=_0x3b9202['id'];if(_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x42')]){_0x1f773a[_0x2cdc('0x3f')]=_['merge'](_0x1f773a['where'],{'$or':_[_0x2cdc('0x31')](_0x1f773a[_0x2cdc('0x3a')],function(_0x2f03fa){var _0x42b168={};_0x42b168[_0x2f03fa]={'$like':'%'+_0x3de469[_0x2cdc('0x36')][_0x2cdc('0x42')]+'%'};return _0x42b168;})});}_0x1f773a=_[_0x2cdc('0x44')]({},_0x1f773a,_0x3de469[_0x2cdc('0x45')]);return db[_0x2cdc('0x58')][_0x2cdc('0x48')](_0x1f773a);}})[_0x2cdc('0x2b')](function(_0x437855){if(_0x437855){return db[_0x2cdc('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x437855,'UserId'),'role':_0x2cdc('0x5c')},'attributes':['id',_0x2cdc('0x2e'),_0x2cdc('0x5d'),_0x2cdc('0x5e'),_0x2cdc('0x5f')]});}})[_0x2cdc('0x2b')](function(_0x40f156){if(_0x40f156){return{'count':_0x40f156[_0x2cdc('0x23')],'rows':_[_0x2cdc('0x31')](_0x40f156['rows'],function(_0x2b7073){return{'membername':_0x2b7073[_0x2cdc('0x2e')],'UserId':_0x2b7073['id'],'queue_name':_0x27adda[_0x2cdc('0x2e')],'MailQueueId':_0x27adda['id'],'interface':util[_0x2cdc('0x60')](_0x2cdc('0x61'),_0x2cdc('0x62'),_0x2b7073['name']),'penalty':0x0,'paused':_0x2b7073[_0x2cdc('0x5d')],'createdAt':_0x2b7073[_0x2cdc('0x5f')],'updatedAt':_0x2b7073['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2cdc('0x2b')](respondWithFilteredResult(_0x369c49,_0x1f773a))[_0x2cdc('0x54')](handleError(_0x369c49,null));};exports[_0x2cdc('0x63')]=function(_0x37d918,_0x2b8e3b,_0x4265c0){var _0x477a10={};var _0xbba317={};var _0x47bd33;var _0x24dc2c;return db[_0x2cdc('0x32')][_0x2cdc('0x64')]({'where':{'id':_0x37d918[_0x2cdc('0x56')]['id']}})[_0x2cdc('0x2b')](handleEntityNotFound(_0x2b8e3b,null))['then'](function(_0x2fa7d3){if(_0x2fa7d3){_0x47bd33=_0x2fa7d3;_0xbba317[_0x2cdc('0x37')]=_[_0x2cdc('0x4a')](db[_0x2cdc('0x65')][_0x2cdc('0x33')]);_0xbba317[_0x2cdc('0x36')]=_[_0x2cdc('0x4a')](_0x37d918[_0x2cdc('0x36')]);_0xbba317[_0x2cdc('0x40')]=_[_0x2cdc('0x38')](_0xbba317[_0x2cdc('0x37')],_0xbba317['query']);_0x477a10[_0x2cdc('0x3a')]=_['intersection'](_0xbba317[_0x2cdc('0x37')],qs['fields'](_0x37d918[_0x2cdc('0x36')][_0x2cdc('0x39')]));_0x477a10['attributes']=_0x477a10['attributes'][_0x2cdc('0x3b')]?_0x477a10[_0x2cdc('0x3a')]:_0xbba317[_0x2cdc('0x37')];_0x477a10[_0x2cdc('0x66')]=qs[_0x2cdc('0x3e')](_0x37d918['query'][_0x2cdc('0x3e')]);_0x477a10[_0x2cdc('0x3f')]=qs['filters'](_[_0x2cdc('0x41')](_0x37d918[_0x2cdc('0x36')],_0xbba317[_0x2cdc('0x40')]));if(_0x37d918['query'][_0x2cdc('0x42')]){_0x477a10[_0x2cdc('0x3f')]=_[_0x2cdc('0x44')](_0x477a10['where'],{'$or':_[_0x2cdc('0x31')](_0x477a10[_0x2cdc('0x3a')],function(_0x3cae4e){var _0x159454={};_0x159454[_0x3cae4e]={'$like':'%'+_0x37d918['query'][_0x2cdc('0x42')]+'%'};return _0x159454;})});}_0x477a10=_[_0x2cdc('0x44')]({},_0x477a10,_0x37d918['options']);return _0x47bd33[_0x2cdc('0x63')](_0x477a10);}})[_0x2cdc('0x2b')](function(_0x2a99c2){if(_0x2a99c2){_0x24dc2c=_0x2a99c2[_0x2cdc('0x3b')];if(!_0x37d918[_0x2cdc('0x36')][_0x2cdc('0x3c')](_0x2cdc('0x59'))){_0x477a10[_0x2cdc('0x3d')]=qs['limit'](_0x37d918[_0x2cdc('0x36')][_0x2cdc('0x3d')]);_0x477a10['offset']=qs[_0x2cdc('0x24')](_0x37d918['query'][_0x2cdc('0x24')]);}return _0x47bd33[_0x2cdc('0x63')](_0x477a10);}})[_0x2cdc('0x2b')](function(_0x43dd49){if(_0x43dd49){return _0x43dd49?{'count':_0x24dc2c,'rows':_0x43dd49}:null;}})[_0x2cdc('0x2b')](respondWithResult(_0x2b8e3b,null))[_0x2cdc('0x54')](handleError(_0x2b8e3b,null));};exports['addTeams']=function(_0x581de0,_0x49656a,_0x2b18fb){var _0x3498c8=_0x581de0[_0x2cdc('0x4d')][_0x2cdc('0x67')];return db[_0x2cdc('0x65')][_0x2cdc('0x48')]({'where':{'id':_0x3498c8},'attributes':['id'],'include':[{'model':db[_0x2cdc('0x5b')],'as':_0x2cdc('0x68'),'attributes':['id','name',_0x2cdc('0x69'),_0x2cdc('0x6a'),_0x2cdc('0x6b')],'raw':!![]}]})[_0x2cdc('0x2b')](function(_0x13a65f){if(_0x13a65f){var _0x490554=_[_0x2cdc('0x6c')](_0x13a65f,function(_0x3bc51a){var _0x2de8cd=_0x3bc51a[_0x2cdc('0x4f')]({'plain':!![]});return _0x2de8cd[_0x2cdc('0x68')];});return db[_0x2cdc('0x32')][_0x2cdc('0x4b')]({'where':{'id':_0x581de0[_0x2cdc('0x56')]['id']}})[_0x2cdc('0x2b')](function(_0x5cc5c7){return db[_0x2cdc('0x6d')][_0x2cdc('0x6e')](function(_0x39ff9d){return _0x5cc5c7['addTeams'](_0x3498c8,{'transaction':_0x39ff9d})['then'](function(){return BPromise[_0x2cdc('0x6f')](_0x490554,function(_0x32e089){return db[_0x2cdc('0x58')][_0x2cdc('0x70')]({'where':{'UserId':_0x32e089['id'],'MailQueueId':_0x581de0[_0x2cdc('0x56')]['id']},'transaction':_0x39ff9d});});})['then'](function(){_0x490554['forEach'](function(_0x18e352){socket[_0x2cdc('0x71')](_0x2cdc('0x72'),{'UserId':_0x18e352['id'],'MailQueueId':_0x5cc5c7['id']});});});});});}})[_0x2cdc('0x2b')](respondWithStatusCode(_0x49656a,null))[_0x2cdc('0x54')](handleError(_0x49656a,null));};exports['removeTeams']=function(_0x30c3fb,_0x3f544f,_0x142ed6){return db[_0x2cdc('0x65')][_0x2cdc('0x48')]({'where':{'id':_0x30c3fb['query'][_0x2cdc('0x67')]},'attributes':['id'],'include':[{'model':db[_0x2cdc('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2cdc('0x2b')](handleEntityNotFound(_0x3f544f,null))['then'](function(_0x5ee58a){var _0x14e980=_[_0x2cdc('0x31')](_0x5ee58a,'id');var _0x76de8a=[];var _0x548f58=[];var _0x3cc2d7=squel[_0x2cdc('0x73')]();_0x3cc2d7[_0x2cdc('0x74')](_0x2cdc('0x75'))[_0x2cdc('0x76')](_0x2cdc('0x77'),'tq')[_0x2cdc('0x78')]('user_has_teams','ut',_0x2cdc('0x79'))[_0x2cdc('0x3f')](_0x2cdc('0x7a'),_0x30c3fb['params']['id']);for(var _0x1f2b78=0x0;_0x1f2b78<_0x5ee58a[_0x2cdc('0x3b')];_0x1f2b78+=0x1){let _0x18d921=_0x5ee58a[_0x1f2b78];for(var _0x2b1528=0x0;_0x2b1528<_0x18d921[_0x2cdc('0x68')][_0x2cdc('0x3b')];_0x2b1528+=0x1){let _0x2e464e=_0x18d921['Agents'][_0x2b1528];var _0x44b881=_0x3cc2d7[_0x2cdc('0x7b')]();_0x44b881[_0x2cdc('0x3f')](_0x2cdc('0x7c'),_0x2e464e['id']);_0x548f58['push'](db['sequelize'][_0x2cdc('0x36')](_0x44b881[_0x2cdc('0x7d')](),{'type':db[_0x2cdc('0x6d')][_0x2cdc('0x7e')][_0x2cdc('0x7f')]})['then'](function(_0x1d831e){if(_0x1d831e[_0x2cdc('0x3b')]===0x1){return _0x2e464e['id'];}else{var _0x45d33a=_[_0x2cdc('0x80')](_[_0x2cdc('0x31')](_0x1d831e,'TeamId'),function(_0x2e8898){return _[_0x2cdc('0x81')](_0x14e980,_0x2e8898);});if(_0x45d33a){return _0x2e464e['id'];}}}));}}return BPromise[_0x2cdc('0x82')](_0x548f58)[_0x2cdc('0x2b')](function(_0x32e582){_0x76de8a=_(_0x76de8a)[_0x2cdc('0x83')](_0x32e582)['compact']()['value']();return db[_0x2cdc('0x32')][_0x2cdc('0x4b')]({'where':{'id':_0x30c3fb[_0x2cdc('0x56')]['id']}})['then'](function(_0x336ec1){return db[_0x2cdc('0x6d')][_0x2cdc('0x6e')](function(_0x2abb8a){return _0x336ec1[_0x2cdc('0x84')](_0x30c3fb[_0x2cdc('0x36')][_0x2cdc('0x67')],{'transaction':_0x2abb8a})[_0x2cdc('0x2b')](function(){if(!_[_0x2cdc('0x85')](_0x76de8a)){return _0x336ec1['removeAgents'](_0x76de8a,{'transaction':_0x2abb8a});}})[_0x2cdc('0x2b')](function(){_0x76de8a[_0x2cdc('0x86')](function(_0x44bc8a){socket[_0x2cdc('0x71')](_0x2cdc('0x87'),{'UserId':_0x44bc8a,'MailQueueId':_0x336ec1['id']});});});});});});})[_0x2cdc('0x2b')](respondWithStatusCode(_0x3f544f,null))[_0x2cdc('0x54')](handleError(_0x3f544f,null));};exports[_0x2cdc('0x88')]=function(_0x7a904c,_0x367ac8,_0x2188cd){return db[_0x2cdc('0x32')][_0x2cdc('0x4b')]({'where':{'id':_0x7a904c[_0x2cdc('0x56')]['id']}})[_0x2cdc('0x2b')](handleEntityNotFound(_0x367ac8,null))[_0x2cdc('0x2b')](function(_0x4f0b46){if(_0x4f0b46){return _0x4f0b46[_0x2cdc('0x88')](_0x7a904c[_0x2cdc('0x4d')][_0x2cdc('0x67')],_['omit'](_0x7a904c[_0x2cdc('0x4d')],[_0x2cdc('0x67'),'id'])||{})[_0x2cdc('0x89')](function(_0x164358){for(var _0x523dc7=0x0;_0x523dc7<_0x7a904c[_0x2cdc('0x4d')][_0x2cdc('0x67')][_0x2cdc('0x3b')];_0x523dc7+=0x1){socket[_0x2cdc('0x71')](_0x2cdc('0x72'),{'UserId':Number(_0x7a904c[_0x2cdc('0x4d')][_0x2cdc('0x67')][_0x523dc7]),'MailQueueId':Number(_0x7a904c[_0x2cdc('0x56')]['id'])});}return _0x164358;});}})['then'](respondWithResult(_0x367ac8,null))[_0x2cdc('0x54')](handleError(_0x367ac8,null));};exports['removeAgents']=function(_0x4ba1d1,_0x40ea3d,_0x10f292){return db[_0x2cdc('0x32')][_0x2cdc('0x4b')]({'where':{'id':_0x4ba1d1['params']['id']}})['then'](handleEntityNotFound(_0x40ea3d,null))[_0x2cdc('0x2b')](function(_0x3856ae){if(_0x3856ae){return _0x3856ae[_0x2cdc('0x8a')](_0x4ba1d1['query'][_0x2cdc('0x67')])[_0x2cdc('0x2b')](function(){if(_['isArray'](_0x4ba1d1[_0x2cdc('0x36')][_0x2cdc('0x67')])){for(var _0x4470fc=0x0;_0x4470fc<_0x4ba1d1['query'][_0x2cdc('0x67')]['length'];_0x4470fc+=0x1){socket[_0x2cdc('0x71')]('userMailQueue:remove',{'UserId':Number(_0x4ba1d1[_0x2cdc('0x36')][_0x2cdc('0x67')][_0x4470fc]),'MailQueueId':Number(_0x4ba1d1[_0x2cdc('0x56')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4ba1d1[_0x2cdc('0x36')][_0x2cdc('0x67')]),'MailQueueId':Number(_0x4ba1d1[_0x2cdc('0x56')]['id'])});}});}})[_0x2cdc('0x2b')](respondWithStatusCode(_0x40ea3d,null))[_0x2cdc('0x54')](handleError(_0x40ea3d,null));};exports[_0x2cdc('0x8b')]=function(_0x1b89e6,_0x1481dc,_0x42f8a2){var _0x15ad26={};var _0x346a5b={};var _0xd06f5b;var _0x1a95d2;return db['MailQueue'][_0x2cdc('0x64')]({'where':{'id':_0x1b89e6['params']['id']}})[_0x2cdc('0x2b')](handleEntityNotFound(_0x1481dc,null))['then'](function(_0x4ac45e){if(_0x4ac45e){_0xd06f5b=_0x4ac45e;_0x346a5b[_0x2cdc('0x37')]=_[_0x2cdc('0x4a')](db[_0x2cdc('0x5b')][_0x2cdc('0x33')]);_0x346a5b[_0x2cdc('0x36')]=_[_0x2cdc('0x4a')](_0x1b89e6[_0x2cdc('0x36')]);_0x346a5b[_0x2cdc('0x40')]=_[_0x2cdc('0x38')](_0x346a5b[_0x2cdc('0x37')],_0x346a5b[_0x2cdc('0x36')]);_0x15ad26[_0x2cdc('0x3a')]=_[_0x2cdc('0x38')](_0x346a5b[_0x2cdc('0x37')],qs[_0x2cdc('0x39')](_0x1b89e6['query'][_0x2cdc('0x39')]));_0x15ad26[_0x2cdc('0x3a')]=_0x15ad26[_0x2cdc('0x3a')]['length']?_0x15ad26[_0x2cdc('0x3a')]:_0x346a5b[_0x2cdc('0x37')];_0x15ad26['order']=qs[_0x2cdc('0x3e')](_0x1b89e6[_0x2cdc('0x36')][_0x2cdc('0x3e')]);_0x15ad26[_0x2cdc('0x3f')]=qs[_0x2cdc('0x40')](_[_0x2cdc('0x41')](_0x1b89e6[_0x2cdc('0x36')],_0x346a5b['filters']));if(_0x1b89e6[_0x2cdc('0x36')][_0x2cdc('0x42')]){_0x15ad26['where']=_[_0x2cdc('0x44')](_0x15ad26[_0x2cdc('0x3f')],{'$or':_['map'](_0x15ad26[_0x2cdc('0x3a')],function(_0x1cc02c){var _0x11ae34={};_0x11ae34[_0x1cc02c]={'$like':'%'+_0x1b89e6[_0x2cdc('0x36')][_0x2cdc('0x42')]+'%'};return _0x11ae34;})});}_0x15ad26=_[_0x2cdc('0x44')]({},_0x15ad26,_0x1b89e6[_0x2cdc('0x45')]);return _0xd06f5b[_0x2cdc('0x8b')](_0x15ad26);}})[_0x2cdc('0x2b')](function(_0x2fcd21){if(_0x2fcd21){_0x1a95d2=_0x2fcd21[_0x2cdc('0x3b')];if(!_0x1b89e6[_0x2cdc('0x36')][_0x2cdc('0x3c')](_0x2cdc('0x59'))){_0x15ad26[_0x2cdc('0x3d')]=qs['limit'](_0x1b89e6['query'][_0x2cdc('0x3d')]);_0x15ad26[_0x2cdc('0x24')]=qs[_0x2cdc('0x24')](_0x1b89e6[_0x2cdc('0x36')][_0x2cdc('0x24')]);}return _0xd06f5b[_0x2cdc('0x8b')](_0x15ad26);}})[_0x2cdc('0x2b')](function(_0x4411f1){if(_0x4411f1){return _0x4411f1?{'count':_0x1a95d2,'rows':_0x4411f1}:null;}})[_0x2cdc('0x2b')](respondWithResult(_0x1481dc,null))[_0x2cdc('0x54')](handleError(_0x1481dc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ec4da48..ae7aa73 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 _0x8710=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x8710,0xfc));var _0x0871=function(_0x17856f,_0x4887bf){_0x17856f=_0x17856f-0x0;var _0x35ac69=_0x8710[_0x17856f];return _0x35ac69;};'use strict';var EventEmitter=require(_0x0871('0x0'));var MailQueue=require(_0x0871('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0871('0x2')](0x0);var events={'afterCreate':_0x0871('0x3'),'afterUpdate':_0x0871('0x4'),'afterDestroy':_0x0871('0x5')};function emitEvent(_0x29e37f){return function(_0x146f2c,_0x12da4f,_0x17c4fd){MailQueueEvents['emit'](_0x29e37f+':'+_0x146f2c['id'],_0x146f2c);MailQueueEvents[_0x0871('0x6')](_0x29e37f,_0x146f2c);_0x17c4fd(null);};}for(var e in events){if(events[_0x0871('0x7')](e)){var event=events[e];MailQueue[_0x0871('0x8')](e,emitEvent(event));}}module[_0x0871('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x310d=['exports','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0x310d,0x1f1));var _0xd310=function(_0x259d21,_0x3d8c0d){_0x259d21=_0x259d21-0x0;var _0x3bee08=_0x310d[_0x259d21];return _0x3bee08;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd310('0x0'))['db'][_0xd310('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd310('0x2')](0x0);var events={'afterCreate':_0xd310('0x3'),'afterUpdate':'update','afterDestroy':_0xd310('0x4')};function emitEvent(_0x10fe7f){return function(_0x5a79bc,_0x5480ab,_0x1ea94b){MailQueueEvents[_0xd310('0x5')](_0x10fe7f+':'+_0x5a79bc['id'],_0x5a79bc);MailQueueEvents['emit'](_0x10fe7f,_0x5a79bc);_0x1ea94b(null);};}for(var e in events){if(events[_0xd310('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xd310('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 32c1ded..2de4c9c 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 _0x0abe=['MailQueue','mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0abe,0x92));var _0xe0ab=function(_0x919746,_0x554d92){_0x919746=_0x919746-0x0;var _0x574fe5=_0x0abe[_0x919746];return _0x574fe5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe0ab('0x0'))(_0xe0ab('0x1'));var moment=require(_0xe0ab('0x2'));var BPromise=require(_0xe0ab('0x3'));var rp=require(_0xe0ab('0x4'));var fs=require('fs');var path=require(_0xe0ab('0x5'));var rimraf=require(_0xe0ab('0x6'));var config=require(_0xe0ab('0x7'));var attributes=require(_0xe0ab('0x8'));module[_0xe0ab('0x9')]=function(_0x7e2986,_0x33dbde){return _0x7e2986['define'](_0xe0ab('0xa'),attributes,{'tableName':_0xe0ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c42=['../../config/logger','api','bluebird','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util'];(function(_0x2673b0,_0x2577fa){var _0x1ae1ce=function(_0xebb76d){while(--_0xebb76d){_0x2673b0['push'](_0x2673b0['shift']());}};_0x1ae1ce(++_0x2577fa);}(_0x9c42,0x14e));var _0x29c4=function(_0x2ef644,_0x2ab0ff){_0x2ef644=_0x2ef644-0x0;var _0x11f00e=_0x9c42[_0x2ef644];return _0x11f00e;};'use strict';var _=require(_0x29c4('0x0'));var util=require(_0x29c4('0x1'));var logger=require(_0x29c4('0x2'))(_0x29c4('0x3'));var moment=require('moment');var BPromise=require(_0x29c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29c4('0x5'));var config=require(_0x29c4('0x6'));var attributes=require(_0x29c4('0x7'));module[_0x29c4('0x8')]=function(_0x3fa458,_0x12b33f){return _0x3fa458[_0x29c4('0x9')](_0x29c4('0xa'),attributes,{'tableName':_0x29c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 19ea46a..4317b7e 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 _0x1393=['debug','stringify','error','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','util','moment','bluebird','ioredis','../../mysqldb','client','defaults','redis','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3c4f9b,_0x445248){var _0x3ea13f=function(_0x415b79){while(--_0x415b79){_0x3c4f9b['push'](_0x3c4f9b['shift']());}};_0x3ea13f(++_0x445248);}(_0x1393,0x92));var _0x3139=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1393[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x3139('0x0'));var moment=require(_0x3139('0x1'));var BPromise=require(_0x3139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3139('0x3'));var db=require(_0x3139('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3139('0x5')]['http']({'port':0x232a});config['redis']=_[_0x3139('0x6')](config[_0x3139('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3139('0x8'))(new Redis(config[_0x3139('0x7')]));require(_0x3139('0x9'))['register'](socket);function respondWithRpcPromise(_0x58fdd9,_0x12abdb,_0x19c295){return new BPromise(function(_0x32954d,_0x4bb191){return client['request'](_0x58fdd9,_0x19c295)[_0x3139('0xa')](function(_0x558b89){logger[_0x3139('0xb')](_0x3139('0xc'),_0x12abdb,_0x3139('0xd'));logger[_0x3139('0xe')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x12abdb,_0x3139('0xd'),JSON[_0x3139('0xf')](_0x558b89));if(_0x558b89[_0x3139('0x10')]){if(_0x558b89[_0x3139('0x10')]['code']===0x1f4){logger[_0x3139('0x10')](_0x3139('0xc'),_0x12abdb,_0x558b89['error'][_0x3139('0x11')]);return _0x4bb191(_0x558b89[_0x3139('0x10')][_0x3139('0x11')]);}logger[_0x3139('0x10')](_0x3139('0xc'),_0x12abdb,_0x558b89[_0x3139('0x10')]['message']);return _0x32954d(_0x558b89[_0x3139('0x10')][_0x3139('0x11')]);}else{logger['info'](_0x3139('0xc'),_0x12abdb,_0x3139('0xd'));_0x32954d(_0x558b89['result']['message']);}})[_0x3139('0x12')](function(_0x28e246){logger['error'](_0x3139('0xc'),_0x12abdb,_0x28e246);_0x4bb191(_0x28e246);});});}exports[_0x3139('0x13')]=function(_0x2e28ec){var _0x488c6d=this;return new Promise(function(_0x2b938c,_0x3d6b4d){return db[_0x3139('0x14')][_0x3139('0x15')]({'raw':_0x2e28ec[_0x3139('0x16')]?_0x2e28ec[_0x3139('0x16')][_0x3139('0x17')]===undefined?!![]:![]:!![],'where':_0x2e28ec[_0x3139('0x16')]?_0x2e28ec['options'][_0x3139('0x18')]||null:null,'attributes':_0x2e28ec[_0x3139('0x16')]?_0x2e28ec['options'][_0x3139('0x19')]||null:null,'limit':_0x2e28ec[_0x3139('0x16')]?_0x2e28ec[_0x3139('0x16')][_0x3139('0x1a')]||null:null,'include':_0x2e28ec['options']?_0x2e28ec[_0x3139('0x16')][_0x3139('0x1b')]?_[_0x3139('0x1c')](_0x2e28ec[_0x3139('0x16')][_0x3139('0x1b')],function(_0x46840c){return{'model':db[_0x46840c['model']],'as':_0x46840c['as'],'attributes':_0x46840c[_0x3139('0x19')],'include':_0x46840c['include']?_['map'](_0x46840c['include'],function(_0x4b22d7){return{'model':db[_0x4b22d7[_0x3139('0x1d')]],'as':_0x4b22d7['as'],'attributes':_0x4b22d7[_0x3139('0x19')],'include':_0x4b22d7[_0x3139('0x1b')]?_[_0x3139('0x1c')](_0x4b22d7[_0x3139('0x1b')],function(_0x5cd9d7){return{'model':db[_0x5cd9d7[_0x3139('0x1d')]],'as':_0x5cd9d7['as'],'attributes':_0x5cd9d7[_0x3139('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3139('0xa')](function(_0x168b03){logger['info']('GetMailQueue',_0x2e28ec);logger[_0x3139('0xe')](_0x3139('0x13'),_0x2e28ec,JSON[_0x3139('0xf')](_0x168b03));_0x2b938c(_0x168b03);})[_0x3139('0x12')](function(_0x4c4d03){logger[_0x3139('0x10')](_0x3139('0x13'),_0x4c4d03[_0x3139('0x11')],_0x2e28ec);_0x3d6b4d(_0x488c6d['error'](0x1f4,_0x4c4d03['message']));});});};exports[_0x3139('0x1e')]=function(_0x5b3779){var _0x2d61c4=this;return new Promise(function(_0x12a3c0,_0x54b0da){return db[_0x3139('0x14')][_0x3139('0x1f')]({'raw':_0x5b3779[_0x3139('0x16')]?_0x5b3779[_0x3139('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5b3779['options']?_0x5b3779[_0x3139('0x16')]['where']||null:null,'attributes':_0x5b3779['options']?_0x5b3779[_0x3139('0x16')]['attributes']||null:null,'include':_0x5b3779[_0x3139('0x16')]?_0x5b3779[_0x3139('0x16')][_0x3139('0x1b')]?_[_0x3139('0x1c')](_0x5b3779[_0x3139('0x16')]['include'],function(_0x667e7b){return{'model':db[_0x667e7b['model']],'as':_0x667e7b['as'],'attributes':_0x667e7b['attributes'],'include':_0x667e7b[_0x3139('0x1b')]?_[_0x3139('0x1c')](_0x667e7b[_0x3139('0x1b')],function(_0x103ce5){return{'model':db[_0x103ce5['model']],'as':_0x103ce5['as'],'attributes':_0x103ce5['attributes'],'include':_0x103ce5[_0x3139('0x1b')]?_[_0x3139('0x1c')](_0x103ce5[_0x3139('0x1b')],function(_0x3b2132){return{'model':db[_0x3b2132['model']],'as':_0x3b2132['as'],'attributes':_0x3b2132[_0x3139('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3139('0xa')](function(_0x1565cd){logger['info'](_0x3139('0x1e'),_0x5b3779);logger[_0x3139('0xe')]('ShowMailQueue',_0x5b3779,JSON[_0x3139('0xf')](_0x1565cd));_0x12a3c0(_0x1565cd);})['catch'](function(_0x2ce36b){logger['error']('ShowMailQueue',_0x2ce36b['message'],_0x5b3779);_0x54b0da(_0x2d61c4[_0x3139('0x10')](0x1f4,_0x2ce36b['message']));});});}; \ No newline at end of file +var _0x884b=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x884b,0x99));var _0xb884=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x884b[_0x4d0df6];return _0x4e2615;};'use strict';var _=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var moment=require(_0xb884('0x2'));var BPromise=require(_0xb884('0x3'));var rs=require(_0xb884('0x4'));var fs=require('fs');var Redis=require(_0xb884('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb884('0x6'));var logger=require('../../config/logger')(_0xb884('0x7'));var config=require(_0xb884('0x8'));var jayson=require(_0xb884('0x9'));var client=jayson[_0xb884('0xa')][_0xb884('0xb')]({'port':0x232a});config['redis']=_[_0xb884('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb884('0xd')]));require(_0xb884('0xe'))[_0xb884('0xf')](socket);function respondWithRpcPromise(_0x23266f,_0x589c93,_0x118031){return new BPromise(function(_0x298960,_0x1426fc){return client['request'](_0x23266f,_0x118031)[_0xb884('0x10')](function(_0x3dfb10){logger[_0xb884('0x11')](_0xb884('0x12'),_0x589c93,'request\x20sent');logger[_0xb884('0x13')](_0xb884('0x14'),_0x589c93,_0xb884('0x15'),JSON[_0xb884('0x16')](_0x3dfb10));if(_0x3dfb10[_0xb884('0x17')]){if(_0x3dfb10[_0xb884('0x17')]['code']===0x1f4){logger[_0xb884('0x17')](_0xb884('0x12'),_0x589c93,_0x3dfb10[_0xb884('0x17')]['message']);return _0x1426fc(_0x3dfb10[_0xb884('0x17')][_0xb884('0x18')]);}logger['error'](_0xb884('0x12'),_0x589c93,_0x3dfb10[_0xb884('0x17')][_0xb884('0x18')]);return _0x298960(_0x3dfb10[_0xb884('0x17')]['message']);}else{logger[_0xb884('0x11')]('MailQueue,\x20%s,\x20%s',_0x589c93,_0xb884('0x15'));_0x298960(_0x3dfb10[_0xb884('0x19')]['message']);}})[_0xb884('0x1a')](function(_0xcda715){logger[_0xb884('0x17')](_0xb884('0x12'),_0x589c93,_0xcda715);_0x1426fc(_0xcda715);});});}exports[_0xb884('0x1b')]=function(_0x5d3d4b){var _0x22fc3e=this;return new Promise(function(_0xd0e751,_0x236063){return db[_0xb884('0x1c')][_0xb884('0x1d')]({'raw':_0x5d3d4b[_0xb884('0x1e')]?_0x5d3d4b[_0xb884('0x1e')][_0xb884('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d3d4b[_0xb884('0x1e')]?_0x5d3d4b[_0xb884('0x1e')][_0xb884('0x20')]||null:null,'attributes':_0x5d3d4b['options']?_0x5d3d4b['options'][_0xb884('0x21')]||null:null,'limit':_0x5d3d4b['options']?_0x5d3d4b[_0xb884('0x1e')][_0xb884('0x22')]||null:null,'include':_0x5d3d4b['options']?_0x5d3d4b['options'][_0xb884('0x23')]?_[_0xb884('0x24')](_0x5d3d4b[_0xb884('0x1e')][_0xb884('0x23')],function(_0x2533f5){return{'model':db[_0x2533f5[_0xb884('0x25')]],'as':_0x2533f5['as'],'attributes':_0x2533f5['attributes'],'include':_0x2533f5[_0xb884('0x23')]?_[_0xb884('0x24')](_0x2533f5[_0xb884('0x23')],function(_0x4e392b){return{'model':db[_0x4e392b[_0xb884('0x25')]],'as':_0x4e392b['as'],'attributes':_0x4e392b[_0xb884('0x21')],'include':_0x4e392b[_0xb884('0x23')]?_[_0xb884('0x24')](_0x4e392b[_0xb884('0x23')],function(_0x506586){return{'model':db[_0x506586[_0xb884('0x25')]],'as':_0x506586['as'],'attributes':_0x506586[_0xb884('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb884('0x10')](function(_0x2f44a8){logger[_0xb884('0x11')](_0xb884('0x1b'),_0x5d3d4b);logger[_0xb884('0x13')]('GetMailQueue',_0x5d3d4b,JSON[_0xb884('0x16')](_0x2f44a8));_0xd0e751(_0x2f44a8);})['catch'](function(_0x59c07f){logger['error'](_0xb884('0x1b'),_0x59c07f[_0xb884('0x18')],_0x5d3d4b);_0x236063(_0x22fc3e[_0xb884('0x17')](0x1f4,_0x59c07f['message']));});});};exports[_0xb884('0x26')]=function(_0x36d968){var _0x570e58=this;return new Promise(function(_0xcaaa70,_0x2d0c0d){return db[_0xb884('0x1c')][_0xb884('0x27')]({'raw':_0x36d968[_0xb884('0x1e')]?_0x36d968['options'][_0xb884('0x1f')]===undefined?!![]:![]:!![],'where':_0x36d968[_0xb884('0x1e')]?_0x36d968['options']['where']||null:null,'attributes':_0x36d968[_0xb884('0x1e')]?_0x36d968[_0xb884('0x1e')][_0xb884('0x21')]||null:null,'include':_0x36d968['options']?_0x36d968[_0xb884('0x1e')][_0xb884('0x23')]?_['map'](_0x36d968[_0xb884('0x1e')][_0xb884('0x23')],function(_0x26aeaa){return{'model':db[_0x26aeaa[_0xb884('0x25')]],'as':_0x26aeaa['as'],'attributes':_0x26aeaa[_0xb884('0x21')],'include':_0x26aeaa[_0xb884('0x23')]?_[_0xb884('0x24')](_0x26aeaa[_0xb884('0x23')],function(_0x426a94){return{'model':db[_0x426a94[_0xb884('0x25')]],'as':_0x426a94['as'],'attributes':_0x426a94[_0xb884('0x21')],'include':_0x426a94[_0xb884('0x23')]?_[_0xb884('0x24')](_0x426a94[_0xb884('0x23')],function(_0x231774){return{'model':db[_0x231774[_0xb884('0x25')]],'as':_0x231774['as'],'attributes':_0x231774[_0xb884('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb884('0x10')](function(_0x5be697){logger[_0xb884('0x11')]('ShowMailQueue',_0x36d968);logger[_0xb884('0x13')]('ShowMailQueue',_0x36d968,JSON[_0xb884('0x16')](_0x5be697));_0xcaaa70(_0x5be697);})[_0xb884('0x1a')](function(_0x320826){logger[_0xb884('0x17')](_0xb884('0x26'),_0x320826[_0xb884('0x18')],_0x36d968);_0x2d0c0d(_0x570e58[_0xb884('0x17')](0x1f4,_0x320826[_0xb884('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 847a773..55255d0 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 _0x98e5=['./mailQueue.events','remove','update','emit','register','length','mailQueue:'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x98e5,0xa1));var _0x598e=function(_0x456fdd,_0x2547f3){_0x456fdd=_0x456fdd-0x0;var _0x30d1d8=_0x98e5[_0x456fdd];return _0x30d1d8;};'use strict';var MailQueueEvents=require(_0x598e('0x0'));var events=['save',_0x598e('0x1'),_0x598e('0x2')];function createListener(_0x163621,_0xdb55fe){return function(_0x41628d){_0xdb55fe[_0x598e('0x3')](_0x163621,_0x41628d);};}function removeListener(_0x2d9ade,_0x3bbde3){return function(){MailQueueEvents['removeListener'](_0x2d9ade,_0x3bbde3);};}exports[_0x598e('0x4')]=function(_0x596865){for(var _0x4b6bd7=0x0,_0x5820e6=events[_0x598e('0x5')];_0x4b6bd7<_0x5820e6;_0x4b6bd7++){var _0x5b9455=events[_0x4b6bd7];var _0x1e149e=createListener(_0x598e('0x6')+_0x5b9455,_0x596865);MailQueueEvents['on'](_0x5b9455,_0x1e149e);}}; \ No newline at end of file +var _0x57ff=['length','./mailQueue.events','save','update','emit','register'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x57ff,0x127));var _0xf57f=function(_0x45a1d7,_0x1ed7ff){_0x45a1d7=_0x45a1d7-0x0;var _0xe3a15d=_0x57ff[_0x45a1d7];return _0xe3a15d;};'use strict';var MailQueueEvents=require(_0xf57f('0x0'));var events=[_0xf57f('0x1'),'remove',_0xf57f('0x2')];function createListener(_0x33ac3d,_0x3f6b1f){return function(_0x4c5923){_0x3f6b1f[_0xf57f('0x3')](_0x33ac3d,_0x4c5923);};}function removeListener(_0x4a4e64,_0x252be3){return function(){MailQueueEvents['removeListener'](_0x4a4e64,_0x252be3);};}exports[_0xf57f('0x4')]=function(_0x1e9f4d){for(var _0x2e3a81=0x0,_0x59d9db=events[_0xf57f('0x5')];_0x2e3a81<_0x59d9db;_0x2e3a81++){var _0x4e3354=events[_0x2e3a81];var _0x31afea=createListener('mailQueue:'+_0x4e3354,_0x1e9f4d);MailQueueEvents['on'](_0x4e3354,_0x31afea);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ad001b3..5e08e03 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 _0xbe0d=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x5821ca,_0x1988ef){var _0x51e098=function(_0x5d43f2){while(--_0x5d43f2){_0x5821ca['push'](_0x5821ca['shift']());}};_0x51e098(++_0x1988ef);}(_0xbe0d,0x12a));var _0xdbe0=function(_0x32b30c,_0x4c5567){_0x32b30c=_0x32b30c-0x0;var _0x59bc79=_0xbe0d[_0x32b30c];return _0x59bc79;};'use strict';var multer=require(_0xdbe0('0x0'));var util=require(_0xdbe0('0x1'));var path=require(_0xdbe0('0x2'));var timeout=require(_0xdbe0('0x3'));var express=require(_0xdbe0('0x4'));var router=express[_0xdbe0('0x5')]();var fs_extra=require(_0xdbe0('0x6'));var auth=require(_0xdbe0('0x7'));var interaction=require(_0xdbe0('0x8'));var config=require('../../config/environment');var controller=require(_0xdbe0('0x9'));router[_0xdbe0('0xa')]('/',auth[_0xdbe0('0xb')](),controller[_0xdbe0('0xc')]);router[_0xdbe0('0xa')](_0xdbe0('0xd'),auth[_0xdbe0('0xb')](),controller['describe']);router[_0xdbe0('0xa')](_0xdbe0('0xe'),auth[_0xdbe0('0xb')](),controller[_0xdbe0('0xf')]);router[_0xdbe0('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdbe0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xdbe0('0x12')]);router[_0xdbe0('0x13')](_0xdbe0('0xe'),auth[_0xdbe0('0xb')](),controller[_0xdbe0('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5887=['update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x535add,_0x37b7f4){var _0x23261f=function(_0xc677ab){while(--_0xc677ab){_0x535add['push'](_0x535add['shift']());}};_0x23261f(++_0x37b7f4);}(_0x5887,0x113));var _0x7588=function(_0x177c0f,_0x324360){_0x177c0f=_0x177c0f-0x0;var _0x1f4d28=_0x5887[_0x177c0f];return _0x1f4d28;};'use strict';var multer=require('multer');var util=require(_0x7588('0x0'));var path=require(_0x7588('0x1'));var timeout=require(_0x7588('0x2'));var express=require(_0x7588('0x3'));var router=express[_0x7588('0x4')]();var fs_extra=require(_0x7588('0x5'));var auth=require(_0x7588('0x6'));var interaction=require(_0x7588('0x7'));var config=require(_0x7588('0x8'));var controller=require(_0x7588('0x9'));router['get']('/',auth[_0x7588('0xa')](),controller[_0x7588('0xb')]);router[_0x7588('0xc')](_0x7588('0xd'),auth[_0x7588('0xa')](),controller[_0x7588('0xe')]);router[_0x7588('0xc')](_0x7588('0xf'),auth[_0x7588('0xa')](),controller['show']);router[_0x7588('0x10')]('/',auth['isAuthenticated'](),controller[_0x7588('0x11')]);router[_0x7588('0x12')](_0x7588('0xf'),auth[_0x7588('0xa')](),controller[_0x7588('0x13')]);router[_0x7588('0x14')]('/:id',auth[_0x7588('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 861697b..5c25023 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 _0xb573=['DATE','moment','exports','STRING'];(function(_0x6d64a1,_0x55c168){var _0x57c102=function(_0x4ec495){while(--_0x4ec495){_0x6d64a1['push'](_0x6d64a1['shift']());}};_0x57c102(++_0x55c168);}(_0xb573,0x101));var _0x3b57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb573[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3b57('0x0'));var Sequelize=require('sequelize');module[_0x3b57('0x1')]={'uniqueid':{'type':Sequelize[_0x3b57('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3b57('0x3')]},'leaveAt':{'type':Sequelize[_0x3b57('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3b57('0x2')]}}; \ No newline at end of file +var _0x1d07=['DATE','moment','sequelize','exports','STRING'];(function(_0x54aff6,_0xc4c096){var _0x487a36=function(_0x332e3a){while(--_0x332e3a){_0x54aff6['push'](_0x54aff6['shift']());}};_0x487a36(++_0xc4c096);}(_0x1d07,0x1e6));var _0x71d0=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1d07[_0x46698a];return _0x356db0;};'use strict';var moment=require(_0x71d0('0x0'));var Sequelize=require(_0x71d0('0x1'));module[_0x71d0('0x2')]={'uniqueid':{'type':Sequelize[_0x71d0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x71d0('0x3')]},'joinAt':{'type':Sequelize[_0x71d0('0x4')]},'leaveAt':{'type':Sequelize[_0x71d0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x71d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index beea9ac..8dc8fce 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 _0xfcf0=['nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xfcf0,0x138));var _0x0fcf=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xfcf0[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));};exports[_0x0fcf('0x49')]=function(_0x389d71,_0x3a473c){return db[_0x0fcf('0x2b')][_0x0fcf('0x49')]()[_0x0fcf('0x24')](respondWithResult(_0x3a473c,null))[_0x0fcf('0x42')](handleError(_0x3a473c,null));}; \ No newline at end of file +var _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x3e1730,_0x2fd216){var _0xc4eb48=function(_0x476c40){while(--_0x476c40){_0x3e1730['push'](_0x3e1730['shift']());}};_0xc4eb48(++_0x2fd216);}(_0xbff5,0x1bc));var _0x5bff=function(_0x529ce3,_0x28f47d){_0x529ce3=_0x529ce3-0x0;var _0x3119a8=_0xbff5[_0x529ce3];return _0x3119a8;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ca744b4..1423c5f 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 _0xf1bc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0x422d07,_0x3cd355){var _0x58e061=function(_0x5e3085){while(--_0x5e3085){_0x422d07['push'](_0x422d07['shift']());}};_0x58e061(++_0x3cd355);}(_0xf1bc,0x117));var _0xcf1b=function(_0x3551db,_0x248460){_0x3551db=_0x3551db-0x0;var _0x87d33a=_0xf1bc[_0x3551db];return _0x87d33a;};'use strict';var _=require('lodash');var util=require(_0xcf1b('0x0'));var logger=require(_0xcf1b('0x1'))(_0xcf1b('0x2'));var moment=require(_0xcf1b('0x3'));var BPromise=require(_0xcf1b('0x4'));var rp=require(_0xcf1b('0x5'));var fs=require('fs');var path=require(_0xcf1b('0x6'));var rimraf=require(_0xcf1b('0x7'));var config=require(_0xcf1b('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xcf1b('0x9')]=function(_0x2aa562,_0x1b4636){return _0x2aa562[_0xcf1b('0xa')](_0xcf1b('0xb'),attributes,{'tableName':_0xcf1b('0xc'),'paranoid':![],'indexes':[{'name':_0xcf1b('0xd'),'fields':[_0xcf1b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b27=['api','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x43ff6d,_0x1e6695){var _0x7fd481=function(_0x49263b){while(--_0x49263b){_0x43ff6d['push'](_0x43ff6d['shift']());}};_0x7fd481(++_0x1e6695);}(_0x7b27,0xbe));var _0x77b2=function(_0x47f780,_0x45e82c){_0x47f780=_0x47f780-0x0;var _0x53a627=_0x7b27[_0x47f780];return _0x53a627;};'use strict';var _=require(_0x77b2('0x0'));var util=require(_0x77b2('0x1'));var logger=require('../../config/logger')(_0x77b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x77b2('0x3'));var fs=require('fs');var path=require(_0x77b2('0x4'));var rimraf=require(_0x77b2('0x5'));var config=require(_0x77b2('0x6'));var attributes=require(_0x77b2('0x7'));module[_0x77b2('0x8')]=function(_0xcbfa0c,_0x15806c){return _0xcbfa0c['define'](_0x77b2('0x9'),attributes,{'tableName':_0x77b2('0xa'),'paranoid':![],'indexes':[{'name':_0x77b2('0xb'),'fields':[_0x77b2('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 7631e6f..2e962b0 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x4633eb,_0x1165fa){var _0x5ffac3=function(_0xde35a1){while(--_0xde35a1){_0x4633eb['push'](_0x4633eb['shift']());}};_0x5ffac3(++_0x1165fa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ecf20,_0x354e7c){var _0x5374d5=function(_0x3cd8dc){while(--_0x3cd8dc){_0x4ecf20['push'](_0x4ecf20['shift']());}};_0x5374d5(++_0x354e7c);}(_0x326f,0xd1));var _0xf326=function(_0x1ce434,_0x4a265f){_0x1ce434=_0x1ce434-0x0;var _0x4f6b41=_0x326f[_0x1ce434];return _0x4f6b41;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 7c33bf4..a8604f8 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1d9187,_0x494ad6){var _0x25d4b0=function(_0x59a1a1){while(--_0x59a1a1){_0x1d9187['push'](_0x1d9187['shift']());}};_0x25d4b0(++_0x494ad6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x64a811,_0x4887b7){var _0x3d8099=function(_0x3cb2b0){while(--_0x3cb2b0){_0x64a811['push'](_0x64a811['shift']());}};_0x3d8099(++_0x4887b7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 06068a8..2ab6333 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 _0x4522=['STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x15040f,_0x4e9377){var _0x479933=function(_0x3afa5f){while(--_0x3afa5f){_0x15040f['push'](_0x15040f['shift']());}};_0x479933(++_0x4e9377);}(_0x4522,0x1a0));var _0x2452=function(_0x33517b,_0x11c5f0){_0x33517b=_0x33517b-0x0;var _0x5ad09c=_0x4522[_0x33517b];return _0x5ad09c;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x2452('0x0')]},'host':{'type':Sequelize[_0x2452('0x0')]},'authentication':{'type':Sequelize[_0x2452('0x1')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2452('0x0')]},'port':{'type':Sequelize[_0x2452('0x2')]},'tls':{'type':Sequelize[_0x2452('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2452('0x0')],'defaultValue':_0x2452('0x3')},'connTimeout':{'type':Sequelize[_0x2452('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2452('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file +var _0xcf66=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xde38f9,_0x20e19a){var _0x36f6b9=function(_0x52843b){while(--_0x52843b){_0xde38f9['push'](_0xde38f9['shift']());}};_0x36f6b9(++_0x20e19a);}(_0xcf66,0x71));var _0x6cf6=function(_0x3f9a15,_0x5ec036){_0x3f9a15=_0x3f9a15-0x0;var _0x45b1fd=_0xcf66[_0x3f9a15];return _0x45b1fd;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'description':{'type':Sequelize[_0x6cf6('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6cf6('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6cf6('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x6cf6('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 3905441..8639bbc 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 _0xf882=['api','moment','request-promise','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util'];(function(_0x178f27,_0x26e5b0){var _0x1bef17=function(_0x32cf4d){while(--_0x32cf4d){_0x178f27['push'](_0x178f27['shift']());}};_0x1bef17(++_0x26e5b0);}(_0xf882,0xb3));var _0x2f88=function(_0xd7d4e7,_0x62e41a){_0xd7d4e7=_0xd7d4e7-0x0;var _0x83ed78=_0xf882[_0xd7d4e7];return _0x83ed78;};'use strict';var _=require('lodash');var util=require(_0x2f88('0x0'));var logger=require('../../config/logger')(_0x2f88('0x1'));var moment=require(_0x2f88('0x2'));var BPromise=require('bluebird');var rp=require(_0x2f88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f88('0x4'));var attributes=require(_0x2f88('0x5'));module[_0x2f88('0x6')]=function(_0x1a6f02,_0x3031de){return _0x1a6f02[_0x2f88('0x7')](_0x2f88('0x8'),attributes,{'tableName':_0x2f88('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb660=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x1de839,_0x6da3e){var _0xaaf1a5=function(_0x469f7e){while(--_0x469f7e){_0x1de839['push'](_0x1de839['shift']());}};_0xaaf1a5(++_0x6da3e);}(_0xb660,0xa5));var _0x0b66=function(_0x44303a,_0x52df10){_0x44303a=_0x44303a-0x0;var _0x50af17=_0xb660[_0x44303a];return _0x50af17;};'use strict';var _=require(_0x0b66('0x0'));var util=require(_0x0b66('0x1'));var logger=require(_0x0b66('0x2'))(_0x0b66('0x3'));var moment=require(_0x0b66('0x4'));var BPromise=require(_0x0b66('0x5'));var rp=require(_0x0b66('0x6'));var fs=require('fs');var path=require(_0x0b66('0x7'));var rimraf=require(_0x0b66('0x8'));var config=require(_0x0b66('0x9'));var attributes=require(_0x0b66('0xa'));module[_0x0b66('0xb')]=function(_0x3f18eb,_0x507f30){return _0x3f18eb['define'](_0x0b66('0xc'),attributes,{'tableName':_0x0b66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index c2f2f39..cc1e564 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 _0x4679=['MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','map','model','attributes','then','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x1fa469,_0x5e19b1){var _0x22cc36=function(_0x4939bb){while(--_0x4939bb){_0x1fa469['push'](_0x1fa469['shift']());}};_0x22cc36(++_0x5e19b1);}(_0x4679,0xb0));var _0x9467=function(_0x233c4e,_0x367986){_0x233c4e=_0x233c4e-0x0;var _0xb74775=_0x4679[_0x233c4e];return _0xb74775;};'use strict';var _=require(_0x9467('0x0'));var util=require('util');var moment=require(_0x9467('0x1'));var BPromise=require(_0x9467('0x2'));var rs=require(_0x9467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9467('0x4'))['db'];var utils=require(_0x9467('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9467('0x6'));var client=jayson[_0x9467('0x7')][_0x9467('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fa23c,_0x5456ba,_0x426744){return new BPromise(function(_0x4a5b90,_0x30a4db){return client[_0x9467('0x9')](_0x4fa23c,_0x426744)['then'](function(_0x4d2ed8){logger['info'](_0x9467('0xa'),_0x5456ba,'request\x20sent');logger['debug'](_0x9467('0xb'),_0x5456ba,_0x9467('0xc'),JSON[_0x9467('0xd')](_0x4d2ed8));if(_0x4d2ed8[_0x9467('0xe')]){if(_0x4d2ed8[_0x9467('0xe')][_0x9467('0xf')]===0x1f4){logger[_0x9467('0xe')](_0x9467('0xa'),_0x5456ba,_0x4d2ed8['error']['message']);return _0x30a4db(_0x4d2ed8['error'][_0x9467('0x10')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x5456ba,_0x4d2ed8[_0x9467('0xe')][_0x9467('0x10')]);return _0x4a5b90(_0x4d2ed8[_0x9467('0xe')][_0x9467('0x10')]);}else{logger[_0x9467('0x11')](_0x9467('0xa'),_0x5456ba,_0x9467('0xc'));_0x4a5b90(_0x4d2ed8['result'][_0x9467('0x10')]);}})['catch'](function(_0x58852b){logger[_0x9467('0xe')](_0x9467('0xa'),_0x5456ba,_0x58852b);_0x30a4db(_0x58852b);});});}exports[_0x9467('0x12')]=function(_0x356303){var _0x4db670=this;return new Promise(function(_0xe5db99,_0xcc4923){return db[_0x9467('0x13')][_0x9467('0x14')]({'raw':_0x356303[_0x9467('0x15')]?_0x356303[_0x9467('0x15')][_0x9467('0x16')]===undefined?!![]:![]:!![],'where':_0x356303[_0x9467('0x15')]?_0x356303['options']['where']||null:null,'attributes':_0x356303['options']?_0x356303[_0x9467('0x15')]['attributes']||null:null,'limit':_0x356303['options']?_0x356303[_0x9467('0x15')][_0x9467('0x17')]||null:null,'include':_0x356303[_0x9467('0x15')]?_0x356303[_0x9467('0x15')][_0x9467('0x18')]?_[_0x9467('0x19')](_0x356303[_0x9467('0x15')][_0x9467('0x18')],function(_0x15d62c){return{'model':db[_0x15d62c[_0x9467('0x1a')]],'as':_0x15d62c['as'],'attributes':_0x15d62c[_0x9467('0x1b')],'include':_0x15d62c['include']?_['map'](_0x15d62c['include'],function(_0x1e1865){return{'model':db[_0x1e1865[_0x9467('0x1a')]],'as':_0x1e1865['as'],'attributes':_0x1e1865['attributes'],'include':_0x1e1865[_0x9467('0x18')]?_[_0x9467('0x19')](_0x1e1865['include'],function(_0x5c2824){return{'model':db[_0x5c2824[_0x9467('0x1a')]],'as':_0x5c2824['as'],'attributes':_0x5c2824[_0x9467('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9467('0x1c')](function(_0x13a0e2){logger[_0x9467('0x11')](_0x9467('0x12'),_0x356303);logger[_0x9467('0x1d')](_0x9467('0x12'),_0x356303,JSON[_0x9467('0xd')](_0x13a0e2));_0xe5db99(_0x13a0e2);})[_0x9467('0x1e')](function(_0xae63e5){logger['error']('GetMailServerIn',_0xae63e5['message'],_0x356303);_0xcc4923(_0x4db670[_0x9467('0xe')](0x1f4,_0xae63e5[_0x9467('0x10')]));});});}; \ No newline at end of file +var _0x8144=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','map','include','attributes','model','catch'];(function(_0x2c33e5,_0x39e007){var _0x2af012=function(_0x2d6677){while(--_0x2d6677){_0x2c33e5['push'](_0x2c33e5['shift']());}};_0x2af012(++_0x39e007);}(_0x8144,0xf5));var _0x4814=function(_0x29e266,_0x33f4e0){_0x29e266=_0x29e266-0x0;var _0x53b867=_0x8144[_0x29e266];return _0x53b867;};'use strict';var _=require(_0x4814('0x0'));var util=require(_0x4814('0x1'));var moment=require('moment');var BPromise=require(_0x4814('0x2'));var rs=require(_0x4814('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4814('0x4'))['db'];var utils=require(_0x4814('0x5'));var logger=require(_0x4814('0x6'))(_0x4814('0x7'));var config=require(_0x4814('0x8'));var jayson=require(_0x4814('0x9'));var client=jayson[_0x4814('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32b862,_0x2bd5fb,_0x4a73b6){return new BPromise(function(_0x3f362f,_0x5e56f3){return client[_0x4814('0xb')](_0x32b862,_0x4a73b6)[_0x4814('0xc')](function(_0x2ca443){logger[_0x4814('0xd')](_0x4814('0xe'),_0x2bd5fb,_0x4814('0xf'));logger[_0x4814('0x10')](_0x4814('0x11'),_0x2bd5fb,_0x4814('0xf'),JSON[_0x4814('0x12')](_0x2ca443));if(_0x2ca443[_0x4814('0x13')]){if(_0x2ca443[_0x4814('0x13')][_0x4814('0x14')]===0x1f4){logger[_0x4814('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2bd5fb,_0x2ca443[_0x4814('0x13')][_0x4814('0x15')]);return _0x5e56f3(_0x2ca443[_0x4814('0x13')]['message']);}logger[_0x4814('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2bd5fb,_0x2ca443[_0x4814('0x13')][_0x4814('0x15')]);return _0x3f362f(_0x2ca443[_0x4814('0x13')][_0x4814('0x15')]);}else{logger[_0x4814('0xd')]('MailServerIn,\x20%s,\x20%s',_0x2bd5fb,'request\x20sent');_0x3f362f(_0x2ca443[_0x4814('0x16')][_0x4814('0x15')]);}})['catch'](function(_0x42bbd8){logger[_0x4814('0x13')]('MailServerIn,\x20%s,\x20%s',_0x2bd5fb,_0x42bbd8);_0x5e56f3(_0x42bbd8);});});}exports[_0x4814('0x17')]=function(_0x1b998d){var _0x3dc816=this;return new Promise(function(_0x11bff3,_0x4c9703){return db[_0x4814('0x18')][_0x4814('0x19')]({'raw':_0x1b998d[_0x4814('0x1a')]?_0x1b998d[_0x4814('0x1a')][_0x4814('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b998d[_0x4814('0x1a')]?_0x1b998d[_0x4814('0x1a')][_0x4814('0x1c')]||null:null,'attributes':_0x1b998d['options']?_0x1b998d[_0x4814('0x1a')]['attributes']||null:null,'limit':_0x1b998d['options']?_0x1b998d['options'][_0x4814('0x1d')]||null:null,'include':_0x1b998d[_0x4814('0x1a')]?_0x1b998d[_0x4814('0x1a')]['include']?_[_0x4814('0x1e')](_0x1b998d[_0x4814('0x1a')][_0x4814('0x1f')],function(_0x183d7b){return{'model':db[_0x183d7b['model']],'as':_0x183d7b['as'],'attributes':_0x183d7b[_0x4814('0x20')],'include':_0x183d7b[_0x4814('0x1f')]?_['map'](_0x183d7b[_0x4814('0x1f')],function(_0x50b10f){return{'model':db[_0x50b10f[_0x4814('0x21')]],'as':_0x50b10f['as'],'attributes':_0x50b10f[_0x4814('0x20')],'include':_0x50b10f[_0x4814('0x1f')]?_[_0x4814('0x1e')](_0x50b10f[_0x4814('0x1f')],function(_0x145055){return{'model':db[_0x145055[_0x4814('0x21')]],'as':_0x145055['as'],'attributes':_0x145055[_0x4814('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4814('0xc')](function(_0x4ec6ec){logger['info'](_0x4814('0x17'),_0x1b998d);logger[_0x4814('0x10')](_0x4814('0x17'),_0x1b998d,JSON[_0x4814('0x12')](_0x4ec6ec));_0x11bff3(_0x4ec6ec);})[_0x4814('0x22')](function(_0x23c6b5){logger[_0x4814('0x13')]('GetMailServerIn',_0x23c6b5[_0x4814('0x15')],_0x1b998d);_0x4c9703(_0x3dc816[_0x4814('0x13')](0x1f4,_0x23c6b5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0bf0d0f..3fd1088 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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_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('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(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_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('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 06f87dd..bd5898c 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 _0xd283=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x1a4a87,_0x481733){var _0x4d2c85=function(_0x2fda8d){while(--_0x2fda8d){_0x1a4a87['push'](_0x1a4a87['shift']());}};_0x4d2c85(++_0x481733);}(_0xd283,0xf7));var _0x3d28=function(_0x351147,_0x93341){_0x351147=_0x351147-0x0;var _0x37c8c6=_0xd283[_0x351147];return _0x37c8c6;};'use strict';var Sequelize=require(_0x3d28('0x0'));module[_0x3d28('0x1')]={'description':{'type':Sequelize[_0x3d28('0x2')]},'host':{'type':Sequelize[_0x3d28('0x2')]},'user':{'type':Sequelize[_0x3d28('0x2')]},'pass':{'type':Sequelize[_0x3d28('0x2')]},'port':{'type':Sequelize[_0x3d28('0x3')]},'secure':{'type':Sequelize[_0x3d28('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3d28('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7bd5=['BOOLEAN','sequelize','STRING'];(function(_0x261bec,_0x165fbc){var _0x505046=function(_0x593173){while(--_0x593173){_0x261bec['push'](_0x261bec['shift']());}};_0x505046(++_0x165fbc);}(_0x7bd5,0x8e));var _0x57bd=function(_0x27e9eb,_0x2e11f1){_0x27e9eb=_0x27e9eb-0x0;var _0x5aa017=_0x7bd5[_0x27e9eb];return _0x5aa017;};'use strict';var Sequelize=require(_0x57bd('0x0'));module['exports']={'description':{'type':Sequelize[_0x57bd('0x1')]},'host':{'type':Sequelize[_0x57bd('0x1')]},'user':{'type':Sequelize[_0x57bd('0x1')]},'pass':{'type':Sequelize[_0x57bd('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x57bd('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x57bd('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7fdb07f..d11db7e 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 _0xff9a=['fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','rows','show','body','catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','MailServerOut','rawAttributes'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xff9a,0x1cf));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xaff9('0x0'));var rimraf=require(_0xaff9('0x1'));var zipdir=require(_0xaff9('0x2'));var jsonpatch=require(_0xaff9('0x3'));var rp=require('request-promise');var moment=require(_0xaff9('0x4'));var BPromise=require(_0xaff9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaff9('0x6'));var sox=require(_0xaff9('0x7'));var csv=require(_0xaff9('0x8'));var ejs=require(_0xaff9('0x9'));var fs=require('fs');var fs_extra=require(_0xaff9('0xa'));var _=require(_0xaff9('0xb'));var squel=require(_0xaff9('0xc'));var crypto=require(_0xaff9('0xd'));var jsforce=require(_0xaff9('0xe'));var deskjs=require(_0xaff9('0xf'));var toCsv=require(_0xaff9('0x8'));var querystring=require(_0xaff9('0x10'));var Papa=require(_0xaff9('0x11'));var Redis=require(_0xaff9('0x12'));var authService=require(_0xaff9('0x13'));var qs=require(_0xaff9('0x14'));var as=require(_0xaff9('0x15'));var hardwareService=require(_0xaff9('0x16'));var logger=require(_0xaff9('0x17'))(_0xaff9('0x18'));var utils=require(_0xaff9('0x19'));var config=require(_0xaff9('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10cc54,_0x3ca581){_0x3ca581=_0x3ca581||0xcc;return function(_0x397d41){if(_0x397d41){return _0x10cc54['sendStatus'](_0x3ca581);}return _0x10cc54[_0xaff9('0x1b')](_0x3ca581)[_0xaff9('0x1c')]();};}function respondWithResult(_0x342de9,_0x146546){_0x146546=_0x146546||0xc8;return function(_0x2bae42){if(_0x2bae42){return _0x342de9[_0xaff9('0x1b')](_0x146546)[_0xaff9('0x1d')](_0x2bae42);}};}function respondWithFilteredResult(_0x1b7110,_0x995139){return function(_0x1cca4a){if(_0x1cca4a){var _0x26057e=typeof _0x995139['offset']===_0xaff9('0x1e')&&typeof _0x995139[_0xaff9('0x1f')]==='undefined';var _0x263a88=_0x1cca4a[_0xaff9('0x20')];var _0x348314=_0x26057e?0x0:_0x995139[_0xaff9('0x21')];var _0x7e54ec=_0x26057e?_0x1cca4a[_0xaff9('0x20')]:_0x995139[_0xaff9('0x21')]+_0x995139['limit'];var _0x10dc59;if(_0x7e54ec>=_0x263a88){_0x7e54ec=_0x263a88;_0x10dc59=0xc8;}else{_0x10dc59=0xce;}_0x1b7110[_0xaff9('0x1b')](_0x10dc59);return _0x1b7110[_0xaff9('0x22')](_0xaff9('0x23'),_0x348314+'-'+_0x7e54ec+'/'+_0x263a88)[_0xaff9('0x1d')](_0x1cca4a);}return null;};}function patchUpdates(_0x4329cd){return function(_0x16df97){try{jsonpatch[_0xaff9('0x24')](_0x16df97,_0x4329cd,!![]);}catch(_0x8f74ac){return BPromise['reject'](_0x8f74ac);}return _0x16df97[_0xaff9('0x25')]();};}function saveUpdates(_0x25ebc5,_0x48886b){return function(_0x34844c){if(_0x34844c){return _0x34844c['update'](_0x25ebc5)[_0xaff9('0x26')](function(_0x123ef0){return _0x123ef0;});}return null;};}function removeEntity(_0x4d37be,_0x5ac400){return function(_0x57eb79){if(_0x57eb79){return _0x57eb79[_0xaff9('0x27')]()[_0xaff9('0x26')](function(){_0x4d37be[_0xaff9('0x1b')](0xcc)[_0xaff9('0x1c')]();});}};}function handleEntityNotFound(_0x1a29e5,_0x42bea3){return function(_0x59754d){if(!_0x59754d){_0x1a29e5[_0xaff9('0x28')](0x194);}return _0x59754d;};}function handleError(_0x11c222,_0x3035b6){_0x3035b6=_0x3035b6||0x1f4;return function(_0x128141){logger[_0xaff9('0x29')](_0x128141[_0xaff9('0x2a')]);if(_0x128141[_0xaff9('0x2b')]){delete _0x128141['name'];}_0x11c222[_0xaff9('0x1b')](_0x3035b6)[_0xaff9('0x2c')](_0x128141);};}exports[_0xaff9('0x2d')]=function(_0x5d1079,_0x9fc478){var _0xc0197f={},_0xce589a={},_0x481b73={'count':0x0,'rows':[]};var _0x194aa3=_['map'](db[_0xaff9('0x2e')][_0xaff9('0x2f')],function(_0x31e337){return{'name':_0x31e337[_0xaff9('0x30')],'type':_0x31e337[_0xaff9('0x31')]['key']};});_0xce589a[_0xaff9('0x32')]=_[_0xaff9('0x33')](_0x194aa3,_0xaff9('0x2b'));_0xce589a['query']=_[_0xaff9('0x34')](_0x5d1079[_0xaff9('0x35')]);_0xce589a[_0xaff9('0x36')]=_['intersection'](_0xce589a[_0xaff9('0x32')],_0xce589a[_0xaff9('0x35')]);_0xc0197f[_0xaff9('0x37')]=_[_0xaff9('0x38')](_0xce589a[_0xaff9('0x32')],qs[_0xaff9('0x39')](_0x5d1079[_0xaff9('0x35')][_0xaff9('0x39')]));_0xc0197f[_0xaff9('0x37')]=_0xc0197f[_0xaff9('0x37')][_0xaff9('0x3a')]?_0xc0197f[_0xaff9('0x37')]:_0xce589a[_0xaff9('0x32')];if(!_0x5d1079['query']['hasOwnProperty']('nolimit')){_0xc0197f[_0xaff9('0x1f')]=qs[_0xaff9('0x1f')](_0x5d1079['query'][_0xaff9('0x1f')]);_0xc0197f[_0xaff9('0x21')]=qs[_0xaff9('0x21')](_0x5d1079[_0xaff9('0x35')][_0xaff9('0x21')]);}_0xc0197f[_0xaff9('0x3b')]=qs[_0xaff9('0x3c')](_0x5d1079[_0xaff9('0x35')][_0xaff9('0x3c')]);_0xc0197f[_0xaff9('0x3d')]=qs[_0xaff9('0x36')](_['pick'](_0x5d1079[_0xaff9('0x35')],_0xce589a[_0xaff9('0x36')]),_0x194aa3);if(_0x5d1079[_0xaff9('0x35')][_0xaff9('0x3e')]){_0xc0197f['where']=_[_0xaff9('0x3f')](_0xc0197f[_0xaff9('0x3d')],{'$or':_[_0xaff9('0x33')](_0x194aa3,function(_0x20a2b9){if(_0x20a2b9[_0xaff9('0x31')]!==_0xaff9('0x40')){var _0x364a1d={};_0x364a1d[_0x20a2b9[_0xaff9('0x2b')]]={'$like':'%'+_0x5d1079[_0xaff9('0x35')][_0xaff9('0x3e')]+'%'};return _0x364a1d;}})});}_0xc0197f=_[_0xaff9('0x3f')]({},_0xc0197f,_0x5d1079[_0xaff9('0x41')]);var _0x113fac={'where':_0xc0197f[_0xaff9('0x3d')]};return db[_0xaff9('0x2e')][_0xaff9('0x20')](_0x113fac)[_0xaff9('0x26')](function(_0x29b0d6){_0x481b73['count']=_0x29b0d6;if(_0x5d1079[_0xaff9('0x35')]['includeAll']){_0xc0197f[_0xaff9('0x42')]=[{'all':!![]}];}return db[_0xaff9('0x2e')]['findAll'](_0xc0197f);})['then'](function(_0x59bb6d){_0x481b73[_0xaff9('0x43')]=_0x59bb6d;return _0x481b73;})[_0xaff9('0x26')](respondWithFilteredResult(_0x9fc478,_0xc0197f))['catch'](handleError(_0x9fc478,null));};exports[_0xaff9('0x44')]=function(_0x1f2f4c,_0x2fc8a5){var _0x26b3c7={'raw':!![],'where':{'id':_0x1f2f4c['params']['id']}},_0x4557d4={};_0x4557d4[_0xaff9('0x32')]=_[_0xaff9('0x34')](db[_0xaff9('0x2e')]['rawAttributes']);_0x4557d4['query']=_[_0xaff9('0x34')](_0x1f2f4c[_0xaff9('0x35')]);_0x4557d4[_0xaff9('0x36')]=_[_0xaff9('0x38')](_0x4557d4['model'],_0x4557d4[_0xaff9('0x35')]);_0x26b3c7[_0xaff9('0x37')]=_[_0xaff9('0x38')](_0x4557d4[_0xaff9('0x32')],qs['fields'](_0x1f2f4c['query'][_0xaff9('0x39')]));_0x26b3c7['attributes']=_0x26b3c7[_0xaff9('0x37')][_0xaff9('0x3a')]?_0x26b3c7[_0xaff9('0x37')]:_0x4557d4[_0xaff9('0x32')];if(_0x1f2f4c[_0xaff9('0x35')]['includeAll']){_0x26b3c7[_0xaff9('0x42')]=[{'all':!![]}];}_0x26b3c7=_[_0xaff9('0x3f')]({},_0x26b3c7,_0x1f2f4c['options']);return db[_0xaff9('0x2e')]['find'](_0x26b3c7)['then'](handleEntityNotFound(_0x2fc8a5,null))[_0xaff9('0x26')](respondWithResult(_0x2fc8a5,null))['catch'](handleError(_0x2fc8a5,null));};exports['create']=function(_0x253a2f,_0x39cfdb){return db['MailServerOut']['create'](_0x253a2f[_0xaff9('0x45')],{})[_0xaff9('0x26')](respondWithResult(_0x39cfdb,0xc9))[_0xaff9('0x46')](handleError(_0x39cfdb,null));};exports['update']=function(_0x578dbe,_0x22dd88){if(_0x578dbe[_0xaff9('0x45')]['id']){delete _0x578dbe[_0xaff9('0x45')]['id'];}return db[_0xaff9('0x2e')][_0xaff9('0x47')]({'where':{'id':_0x578dbe[_0xaff9('0x48')]['id']}})['then'](handleEntityNotFound(_0x22dd88,null))[_0xaff9('0x26')](saveUpdates(_0x578dbe[_0xaff9('0x45')],null))[_0xaff9('0x26')](respondWithResult(_0x22dd88,null))[_0xaff9('0x46')](handleError(_0x22dd88,null));};exports[_0xaff9('0x27')]=function(_0x72fdfc,_0x1645b2){return db['MailServerOut']['find']({'where':{'id':_0x72fdfc[_0xaff9('0x48')]['id']}})[_0xaff9('0x26')](handleEntityNotFound(_0x1645b2,null))[_0xaff9('0x26')](removeEntity(_0x1645b2,null))['catch'](handleError(_0x1645b2,null));}; \ No newline at end of file +var _0xb552=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3a5a3f,_0x25b9bd){var _0x416aa3=function(_0x21c611){while(--_0x21c611){_0x3a5a3f['push'](_0x3a5a3f['shift']());}};_0x416aa3(++_0x25b9bd);}(_0xb552,0x149));var _0x2b55=function(_0x526016,_0x686763){_0x526016=_0x526016-0x0;var _0x1553f7=_0xb552[_0x526016];return _0x1553f7;};'use strict';var emlformat=require(_0x2b55('0x0'));var rimraf=require(_0x2b55('0x1'));var zipdir=require(_0x2b55('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b55('0x3'));var BPromise=require(_0x2b55('0x4'));var Mustache=require(_0x2b55('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2b55('0x6'));var ejs=require(_0x2b55('0x7'));var fs=require('fs');var fs_extra=require(_0x2b55('0x8'));var _=require(_0x2b55('0x9'));var squel=require(_0x2b55('0xa'));var crypto=require(_0x2b55('0xb'));var jsforce=require(_0x2b55('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2b55('0x6'));var querystring=require(_0x2b55('0xd'));var Papa=require(_0x2b55('0xe'));var Redis=require(_0x2b55('0xf'));var authService=require(_0x2b55('0x10'));var qs=require(_0x2b55('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b55('0x12'));var logger=require('../../config/logger')(_0x2b55('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b55('0x14'))['db'];function respondWithStatusCode(_0xac3f76,_0x9e00ef){_0x9e00ef=_0x9e00ef||0xcc;return function(_0x3d5b4c){if(_0x3d5b4c){return _0xac3f76[_0x2b55('0x15')](_0x9e00ef);}return _0xac3f76[_0x2b55('0x16')](_0x9e00ef)[_0x2b55('0x17')]();};}function respondWithResult(_0x305cbd,_0x33d739){_0x33d739=_0x33d739||0xc8;return function(_0x1a1cd1){if(_0x1a1cd1){return _0x305cbd[_0x2b55('0x16')](_0x33d739)[_0x2b55('0x18')](_0x1a1cd1);}};}function respondWithFilteredResult(_0x130334,_0x2bbd6a){return function(_0x3d4938){if(_0x3d4938){var _0x55a009=typeof _0x2bbd6a[_0x2b55('0x19')]===_0x2b55('0x1a')&&typeof _0x2bbd6a[_0x2b55('0x1b')]==='undefined';var _0x56e669=_0x3d4938[_0x2b55('0x1c')];var _0x3f6cb4=_0x55a009?0x0:_0x2bbd6a[_0x2b55('0x19')];var _0x39b703=_0x55a009?_0x3d4938[_0x2b55('0x1c')]:_0x2bbd6a[_0x2b55('0x19')]+_0x2bbd6a[_0x2b55('0x1b')];var _0x3d1fa4;if(_0x39b703>=_0x56e669){_0x39b703=_0x56e669;_0x3d1fa4=0xc8;}else{_0x3d1fa4=0xce;}_0x130334[_0x2b55('0x16')](_0x3d1fa4);return _0x130334[_0x2b55('0x1d')]('Content-Range',_0x3f6cb4+'-'+_0x39b703+'/'+_0x56e669)[_0x2b55('0x18')](_0x3d4938);}return null;};}function patchUpdates(_0x49deae){return function(_0x3d4d8c){try{jsonpatch[_0x2b55('0x1e')](_0x3d4d8c,_0x49deae,!![]);}catch(_0x4b1b7a){return BPromise[_0x2b55('0x1f')](_0x4b1b7a);}return _0x3d4d8c['save']();};}function saveUpdates(_0x27ba49,_0x159627){return function(_0x8575a7){if(_0x8575a7){return _0x8575a7[_0x2b55('0x20')](_0x27ba49)[_0x2b55('0x21')](function(_0x28d65f){return _0x28d65f;});}return null;};}function removeEntity(_0x5f2fbd,_0x4ab964){return function(_0x182ef9){if(_0x182ef9){return _0x182ef9[_0x2b55('0x22')]()[_0x2b55('0x21')](function(){_0x5f2fbd[_0x2b55('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eaf58,_0x1ef050){return function(_0xebb8f4){if(!_0xebb8f4){_0x2eaf58[_0x2b55('0x15')](0x194);}return _0xebb8f4;};}function handleError(_0x4b69bb,_0x3980c7){_0x3980c7=_0x3980c7||0x1f4;return function(_0xb4a6eb){logger['error'](_0xb4a6eb[_0x2b55('0x23')]);if(_0xb4a6eb[_0x2b55('0x24')]){delete _0xb4a6eb[_0x2b55('0x24')];}_0x4b69bb['status'](_0x3980c7)['send'](_0xb4a6eb);};}exports[_0x2b55('0x25')]=function(_0x3e8fde,_0x20978f){var _0x4cce9a={},_0x5c975a={},_0x4c42a2={'count':0x0,'rows':[]};var _0x59986a=_['map'](db[_0x2b55('0x26')][_0x2b55('0x27')],function(_0x55b086){return{'name':_0x55b086[_0x2b55('0x28')],'type':_0x55b086[_0x2b55('0x29')][_0x2b55('0x2a')]};});_0x5c975a[_0x2b55('0x2b')]=_[_0x2b55('0x2c')](_0x59986a,'name');_0x5c975a[_0x2b55('0x2d')]=_[_0x2b55('0x2e')](_0x3e8fde[_0x2b55('0x2d')]);_0x5c975a['filters']=_[_0x2b55('0x2f')](_0x5c975a[_0x2b55('0x2b')],_0x5c975a['query']);_0x4cce9a[_0x2b55('0x30')]=_[_0x2b55('0x2f')](_0x5c975a['model'],qs[_0x2b55('0x31')](_0x3e8fde[_0x2b55('0x2d')]['fields']));_0x4cce9a[_0x2b55('0x30')]=_0x4cce9a[_0x2b55('0x30')][_0x2b55('0x32')]?_0x4cce9a[_0x2b55('0x30')]:_0x5c975a[_0x2b55('0x2b')];if(!_0x3e8fde['query']['hasOwnProperty'](_0x2b55('0x33'))){_0x4cce9a[_0x2b55('0x1b')]=qs[_0x2b55('0x1b')](_0x3e8fde[_0x2b55('0x2d')][_0x2b55('0x1b')]);_0x4cce9a[_0x2b55('0x19')]=qs[_0x2b55('0x19')](_0x3e8fde[_0x2b55('0x2d')][_0x2b55('0x19')]);}_0x4cce9a[_0x2b55('0x34')]=qs[_0x2b55('0x35')](_0x3e8fde[_0x2b55('0x2d')][_0x2b55('0x35')]);_0x4cce9a[_0x2b55('0x36')]=qs['filters'](_[_0x2b55('0x37')](_0x3e8fde[_0x2b55('0x2d')],_0x5c975a[_0x2b55('0x38')]),_0x59986a);if(_0x3e8fde[_0x2b55('0x2d')][_0x2b55('0x39')]){_0x4cce9a[_0x2b55('0x36')]=_['merge'](_0x4cce9a['where'],{'$or':_[_0x2b55('0x2c')](_0x59986a,function(_0x19a9fe){if(_0x19a9fe[_0x2b55('0x29')]!=='VIRTUAL'){var _0x3971bf={};_0x3971bf[_0x19a9fe[_0x2b55('0x24')]]={'$like':'%'+_0x3e8fde[_0x2b55('0x2d')][_0x2b55('0x39')]+'%'};return _0x3971bf;}})});}_0x4cce9a=_['merge']({},_0x4cce9a,_0x3e8fde[_0x2b55('0x3a')]);var _0x3b0eb6={'where':_0x4cce9a[_0x2b55('0x36')]};return db[_0x2b55('0x26')][_0x2b55('0x1c')](_0x3b0eb6)[_0x2b55('0x21')](function(_0x194794){_0x4c42a2[_0x2b55('0x1c')]=_0x194794;if(_0x3e8fde['query'][_0x2b55('0x3b')]){_0x4cce9a[_0x2b55('0x3c')]=[{'all':!![]}];}return db[_0x2b55('0x26')][_0x2b55('0x3d')](_0x4cce9a);})[_0x2b55('0x21')](function(_0x27ce4b){_0x4c42a2['rows']=_0x27ce4b;return _0x4c42a2;})[_0x2b55('0x21')](respondWithFilteredResult(_0x20978f,_0x4cce9a))['catch'](handleError(_0x20978f,null));};exports['show']=function(_0x4555e2,_0x3cad64){var _0x3cf294={'raw':!![],'where':{'id':_0x4555e2['params']['id']}},_0x1370de={};_0x1370de['model']=_[_0x2b55('0x2e')](db[_0x2b55('0x26')]['rawAttributes']);_0x1370de[_0x2b55('0x2d')]=_[_0x2b55('0x2e')](_0x4555e2[_0x2b55('0x2d')]);_0x1370de[_0x2b55('0x38')]=_['intersection'](_0x1370de['model'],_0x1370de[_0x2b55('0x2d')]);_0x3cf294['attributes']=_[_0x2b55('0x2f')](_0x1370de[_0x2b55('0x2b')],qs['fields'](_0x4555e2['query'][_0x2b55('0x31')]));_0x3cf294['attributes']=_0x3cf294['attributes'][_0x2b55('0x32')]?_0x3cf294['attributes']:_0x1370de[_0x2b55('0x2b')];if(_0x4555e2[_0x2b55('0x2d')][_0x2b55('0x3b')]){_0x3cf294[_0x2b55('0x3c')]=[{'all':!![]}];}_0x3cf294=_[_0x2b55('0x3e')]({},_0x3cf294,_0x4555e2[_0x2b55('0x3a')]);return db[_0x2b55('0x26')][_0x2b55('0x3f')](_0x3cf294)[_0x2b55('0x21')](handleEntityNotFound(_0x3cad64,null))[_0x2b55('0x21')](respondWithResult(_0x3cad64,null))[_0x2b55('0x40')](handleError(_0x3cad64,null));};exports[_0x2b55('0x41')]=function(_0x383825,_0x1f1921){return db[_0x2b55('0x26')]['create'](_0x383825[_0x2b55('0x42')],{})['then'](respondWithResult(_0x1f1921,0xc9))[_0x2b55('0x40')](handleError(_0x1f1921,null));};exports[_0x2b55('0x20')]=function(_0xb41ba8,_0x5209ba){if(_0xb41ba8[_0x2b55('0x42')]['id']){delete _0xb41ba8[_0x2b55('0x42')]['id'];}return db['MailServerOut'][_0x2b55('0x3f')]({'where':{'id':_0xb41ba8[_0x2b55('0x43')]['id']}})[_0x2b55('0x21')](handleEntityNotFound(_0x5209ba,null))[_0x2b55('0x21')](saveUpdates(_0xb41ba8[_0x2b55('0x42')],null))[_0x2b55('0x21')](respondWithResult(_0x5209ba,null))['catch'](handleError(_0x5209ba,null));};exports['destroy']=function(_0x2dfb38,_0x3975fb){return db[_0x2b55('0x26')][_0x2b55('0x3f')]({'where':{'id':_0x2dfb38[_0x2b55('0x43')]['id']}})[_0x2b55('0x21')](handleEntityNotFound(_0x3975fb,null))[_0x2b55('0x21')](removeEntity(_0x3975fb,null))[_0x2b55('0x40')](handleError(_0x3975fb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6d43529..2595087 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 _0x066e=['define','MailServerOut','lodash','util','api','bluebird','./mailServerOut.attributes','exports'];(function(_0x46d224,_0x1bec71){var _0x2a3267=function(_0x16f26d){while(--_0x16f26d){_0x46d224['push'](_0x46d224['shift']());}};_0x2a3267(++_0x1bec71);}(_0x066e,0xea));var _0xe066=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x066e[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xe066('0x0'));var util=require(_0xe066('0x1'));var logger=require('../../config/logger')(_0xe066('0x2'));var moment=require('moment');var BPromise=require(_0xe066('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe066('0x4'));module[_0xe066('0x5')]=function(_0x3afad8,_0x4fc8ce){return _0x3afad8[_0xe066('0x6')](_0xe066('0x7'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7422=['util','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','mail_servers_out'];(function(_0x300522,_0x4562b4){var _0x536ff5=function(_0x3158b4){while(--_0x3158b4){_0x300522['push'](_0x300522['shift']());}};_0x536ff5(++_0x4562b4);}(_0x7422,0x195));var _0x2742=function(_0xebd46,_0x575bab){_0xebd46=_0xebd46-0x0;var _0x36c9b0=_0x7422[_0xebd46];return _0x36c9b0;};'use strict';var _=require('lodash');var util=require(_0x2742('0x0'));var logger=require(_0x2742('0x1'))(_0x2742('0x2'));var moment=require(_0x2742('0x3'));var BPromise=require(_0x2742('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2742('0x5'));var attributes=require('./mailServerOut.attributes');module[_0x2742('0x6')]=function(_0x1991e8,_0xbf9ce0){return _0x1991e8[_0x2742('0x7')]('MailServerOut',attributes,{'tableName':_0x2742('0x8'),'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 f2fba25..e6797c2 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x38a379,_0x401ef8){var _0x3fac20=function(_0x1ef9cf){while(--_0x1ef9cf){_0x38a379['push'](_0x38a379['shift']());}};_0x3fac20(++_0x401ef8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x291276,_0x5870a5){var _0x459a79=function(_0x5f295e){while(--_0x5f295e){_0x291276['push'](_0x291276['shift']());}};_0x459a79(++_0x5870a5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 61e2690..ef829d4 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 _0x1aef=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1aef,0x161));var _0xf1ae=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x1aef[_0xbb091];return _0x467a04;};'use strict';var multer=require('multer');var util=require(_0xf1ae('0x0'));var path=require(_0xf1ae('0x1'));var timeout=require(_0xf1ae('0x2'));var express=require(_0xf1ae('0x3'));var router=express[_0xf1ae('0x4')]();var fs_extra=require(_0xf1ae('0x5'));var auth=require(_0xf1ae('0x6'));var interaction=require(_0xf1ae('0x7'));var config=require('../../config/environment');var controller=require(_0xf1ae('0x8'));router[_0xf1ae('0x9')]('/',auth[_0xf1ae('0xa')](),controller[_0xf1ae('0xb')]);router['get'](_0xf1ae('0xc'),auth[_0xf1ae('0xa')](),controller[_0xf1ae('0xd')]);router[_0xf1ae('0x9')]('/:id',auth[_0xf1ae('0xa')](),controller[_0xf1ae('0xe')]);router[_0xf1ae('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf1ae('0x10')](_0xf1ae('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xf1ae('0x12')](_0xf1ae('0x11'),auth[_0xf1ae('0xa')](),controller[_0xf1ae('0x13')]);module[_0xf1ae('0x14')]=router; \ No newline at end of file +var _0x4912=['/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get'];(function(_0x3a3343,_0x4fea3c){var _0x3865dd=function(_0x5b9656){while(--_0x5b9656){_0x3a3343['push'](_0x3a3343['shift']());}};_0x3865dd(++_0x4fea3c);}(_0x4912,0x89));var _0x2491=function(_0x590aa0,_0x32c650){_0x590aa0=_0x590aa0-0x0;var _0x1c460c=_0x4912[_0x590aa0];return _0x1c460c;};'use strict';var multer=require(_0x2491('0x0'));var util=require(_0x2491('0x1'));var path=require(_0x2491('0x2'));var timeout=require(_0x2491('0x3'));var express=require(_0x2491('0x4'));var router=express[_0x2491('0x5')]();var fs_extra=require(_0x2491('0x6'));var auth=require(_0x2491('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2491('0x8')]);router[_0x2491('0x9')](_0x2491('0xa'),auth[_0x2491('0xb')](),controller[_0x2491('0xc')]);router[_0x2491('0x9')]('/:id',auth[_0x2491('0xb')](),controller[_0x2491('0xd')]);router[_0x2491('0xe')]('/',auth[_0x2491('0xb')](),controller[_0x2491('0xf')]);router[_0x2491('0x10')]('/:id',auth[_0x2491('0xb')](),controller[_0x2491('0x11')]);router[_0x2491('0x12')](_0x2491('0x13'),auth[_0x2491('0xb')](),controller[_0x2491('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index dd6cffa..d0bc68e 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 _0xda19=['STRING','exports'];(function(_0x1467f6,_0x2f4765){var _0x3ec173=function(_0xd26909){while(--_0xd26909){_0x1467f6['push'](_0x1467f6['shift']());}};_0x3ec173(++_0x2f4765);}(_0xda19,0xd5));var _0x9da1=function(_0x2147d9,_0xa2d349){_0x2147d9=_0x2147d9-0x0;var _0x1570aa=_0xda19[_0x2147d9];return _0x1570aa;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]}}; \ No newline at end of file +var _0x3831=['STRING','name','sequelize'];(function(_0x459a67,_0x4db06f){var _0x33e2ac=function(_0x3fed74){while(--_0x3fed74){_0x459a67['push'](_0x459a67['shift']());}};_0x33e2ac(++_0x4db06f);}(_0x3831,0x14c));var _0x1383=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x3831[_0x212a37];return _0x5d0bf9;};'use strict';var Sequelize=require(_0x1383('0x0'));module['exports']={'name':{'type':Sequelize[_0x1383('0x1')],'unique':_0x1383('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1383('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index e44bd6f..480aec3 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 _0xe9a8=['Content-Range','apply','reject','save','destroy','then','stack','name','index','map','MailSubstatus','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set'];(function(_0x3536b3,_0x10872b){var _0x127a38=function(_0x406d06){while(--_0x406d06){_0x3536b3['push'](_0x3536b3['shift']());}};_0x127a38(++_0x10872b);}(_0xe9a8,0x14e));var _0x8e9a=function(_0x36ceef,_0x5d166e){_0x36ceef=_0x36ceef-0x0;var _0x1cf645=_0xe9a8[_0x36ceef];return _0x1cf645;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e9a('0x0'));var zipdir=require(_0x8e9a('0x1'));var jsonpatch=require(_0x8e9a('0x2'));var rp=require('request-promise');var moment=require(_0x8e9a('0x3'));var BPromise=require(_0x8e9a('0x4'));var Mustache=require(_0x8e9a('0x5'));var util=require(_0x8e9a('0x6'));var path=require(_0x8e9a('0x7'));var sox=require(_0x8e9a('0x8'));var csv=require(_0x8e9a('0x9'));var ejs=require(_0x8e9a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e9a('0xb'));var squel=require(_0x8e9a('0xc'));var crypto=require(_0x8e9a('0xd'));var jsforce=require(_0x8e9a('0xe'));var deskjs=require(_0x8e9a('0xf'));var toCsv=require(_0x8e9a('0x9'));var querystring=require('querystring');var Papa=require(_0x8e9a('0x10'));var Redis=require(_0x8e9a('0x11'));var authService=require(_0x8e9a('0x12'));var qs=require(_0x8e9a('0x13'));var as=require(_0x8e9a('0x14'));var hardwareService=require(_0x8e9a('0x15'));var logger=require(_0x8e9a('0x16'))(_0x8e9a('0x17'));var utils=require(_0x8e9a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8e9a('0x19'));var db=require(_0x8e9a('0x1a'))['db'];function respondWithStatusCode(_0x61ca65,_0x47f5a3){_0x47f5a3=_0x47f5a3||0xcc;return function(_0x461bc5){if(_0x461bc5){return _0x61ca65[_0x8e9a('0x1b')](_0x47f5a3);}return _0x61ca65['status'](_0x47f5a3)[_0x8e9a('0x1c')]();};}function respondWithResult(_0x5edc52,_0x564852){_0x564852=_0x564852||0xc8;return function(_0x461a96){if(_0x461a96){return _0x5edc52[_0x8e9a('0x1d')](_0x564852)[_0x8e9a('0x1e')](_0x461a96);}};}function respondWithFilteredResult(_0x46b60a,_0x5167a1){return function(_0x1d5491){if(_0x1d5491){var _0x48be3f=typeof _0x5167a1['offset']==='undefined'&&typeof _0x5167a1[_0x8e9a('0x1f')]===_0x8e9a('0x20');var _0x4ccaf2=_0x1d5491[_0x8e9a('0x21')];var _0x15b2c0=_0x48be3f?0x0:_0x5167a1[_0x8e9a('0x22')];var _0x5f231d=_0x48be3f?_0x1d5491[_0x8e9a('0x21')]:_0x5167a1[_0x8e9a('0x22')]+_0x5167a1['limit'];var _0x48d36d;if(_0x5f231d>=_0x4ccaf2){_0x5f231d=_0x4ccaf2;_0x48d36d=0xc8;}else{_0x48d36d=0xce;}_0x46b60a[_0x8e9a('0x1d')](_0x48d36d);return _0x46b60a[_0x8e9a('0x23')](_0x8e9a('0x24'),_0x15b2c0+'-'+_0x5f231d+'/'+_0x4ccaf2)['json'](_0x1d5491);}return null;};}function patchUpdates(_0x3598c6){return function(_0x2cda9b){try{jsonpatch[_0x8e9a('0x25')](_0x2cda9b,_0x3598c6,!![]);}catch(_0x247c9f){return BPromise[_0x8e9a('0x26')](_0x247c9f);}return _0x2cda9b[_0x8e9a('0x27')]();};}function saveUpdates(_0xe33ace,_0x3dbb42){return function(_0x595521){if(_0x595521){return _0x595521['update'](_0xe33ace)['then'](function(_0x4ff1f8){return _0x4ff1f8;});}return null;};}function removeEntity(_0x1e5b0f,_0x6d26b1){return function(_0x326d0b){if(_0x326d0b){return _0x326d0b[_0x8e9a('0x28')]()[_0x8e9a('0x29')](function(){_0x1e5b0f[_0x8e9a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x290eff,_0x30895e){return function(_0x5b03de){if(!_0x5b03de){_0x290eff[_0x8e9a('0x1b')](0x194);}return _0x5b03de;};}function handleError(_0x48dfa3,_0x1e4c54){_0x1e4c54=_0x1e4c54||0x1f4;return function(_0x1eee35){logger['error'](_0x1eee35[_0x8e9a('0x2a')]);if(_0x1eee35[_0x8e9a('0x2b')]){delete _0x1eee35['name'];}_0x48dfa3[_0x8e9a('0x1d')](_0x1e4c54)['send'](_0x1eee35);};}exports[_0x8e9a('0x2c')]=function(_0xc34a55,_0x10d980){var _0x55292b={},_0x144928={},_0x355319={'count':0x0,'rows':[]};var _0x1d8e6b=_[_0x8e9a('0x2d')](db[_0x8e9a('0x2e')][_0x8e9a('0x2f')],function(_0x5094e3){return{'name':_0x5094e3['fieldName'],'type':_0x5094e3['type']['key']};});_0x144928[_0x8e9a('0x30')]=_[_0x8e9a('0x2d')](_0x1d8e6b,'name');_0x144928[_0x8e9a('0x31')]=_['keys'](_0xc34a55['query']);_0x144928['filters']=_['intersection'](_0x144928['model'],_0x144928['query']);_0x55292b[_0x8e9a('0x32')]=_[_0x8e9a('0x33')](_0x144928[_0x8e9a('0x30')],qs[_0x8e9a('0x34')](_0xc34a55[_0x8e9a('0x31')][_0x8e9a('0x34')]));_0x55292b[_0x8e9a('0x32')]=_0x55292b[_0x8e9a('0x32')][_0x8e9a('0x35')]?_0x55292b[_0x8e9a('0x32')]:_0x144928[_0x8e9a('0x30')];if(!_0xc34a55[_0x8e9a('0x31')][_0x8e9a('0x36')](_0x8e9a('0x37'))){_0x55292b[_0x8e9a('0x1f')]=qs[_0x8e9a('0x1f')](_0xc34a55[_0x8e9a('0x31')]['limit']);_0x55292b['offset']=qs[_0x8e9a('0x22')](_0xc34a55['query']['offset']);}_0x55292b['order']=qs['sort'](_0xc34a55[_0x8e9a('0x31')][_0x8e9a('0x38')]);_0x55292b[_0x8e9a('0x39')]=qs[_0x8e9a('0x3a')](_['pick'](_0xc34a55['query'],_0x144928[_0x8e9a('0x3a')]),_0x1d8e6b);if(_0xc34a55[_0x8e9a('0x31')]['filter']){_0x55292b[_0x8e9a('0x39')]=_[_0x8e9a('0x3b')](_0x55292b['where'],{'$or':_[_0x8e9a('0x2d')](_0x1d8e6b,function(_0x5da35c){if(_0x5da35c[_0x8e9a('0x3c')]!==_0x8e9a('0x3d')){var _0x17984a={};_0x17984a[_0x5da35c[_0x8e9a('0x2b')]]={'$like':'%'+_0xc34a55[_0x8e9a('0x31')]['filter']+'%'};return _0x17984a;}})});}_0x55292b=_[_0x8e9a('0x3b')]({},_0x55292b,_0xc34a55['options']);var _0x26ac12={'where':_0x55292b[_0x8e9a('0x39')]};return db[_0x8e9a('0x2e')][_0x8e9a('0x21')](_0x26ac12)[_0x8e9a('0x29')](function(_0x399f37){_0x355319[_0x8e9a('0x21')]=_0x399f37;if(_0xc34a55['query'][_0x8e9a('0x3e')]){_0x55292b[_0x8e9a('0x3f')]=[{'all':!![]}];}return db[_0x8e9a('0x2e')][_0x8e9a('0x40')](_0x55292b);})[_0x8e9a('0x29')](function(_0x3fdea9){_0x355319[_0x8e9a('0x41')]=_0x3fdea9;return _0x355319;})['then'](respondWithFilteredResult(_0x10d980,_0x55292b))[_0x8e9a('0x42')](handleError(_0x10d980,null));};exports['show']=function(_0x4125a0,_0x5db36a){var _0xbd5244={'raw':!![],'where':{'id':_0x4125a0[_0x8e9a('0x43')]['id']}},_0x2691f9={};_0x2691f9[_0x8e9a('0x30')]=_[_0x8e9a('0x44')](db['MailSubstatus'][_0x8e9a('0x2f')]);_0x2691f9[_0x8e9a('0x31')]=_[_0x8e9a('0x44')](_0x4125a0[_0x8e9a('0x31')]);_0x2691f9[_0x8e9a('0x3a')]=_[_0x8e9a('0x33')](_0x2691f9[_0x8e9a('0x30')],_0x2691f9[_0x8e9a('0x31')]);_0xbd5244[_0x8e9a('0x32')]=_[_0x8e9a('0x33')](_0x2691f9[_0x8e9a('0x30')],qs['fields'](_0x4125a0[_0x8e9a('0x31')]['fields']));_0xbd5244[_0x8e9a('0x32')]=_0xbd5244[_0x8e9a('0x32')][_0x8e9a('0x35')]?_0xbd5244[_0x8e9a('0x32')]:_0x2691f9[_0x8e9a('0x30')];if(_0x4125a0[_0x8e9a('0x31')]['includeAll']){_0xbd5244['include']=[{'all':!![]}];}_0xbd5244=_[_0x8e9a('0x3b')]({},_0xbd5244,_0x4125a0['options']);return db[_0x8e9a('0x2e')][_0x8e9a('0x45')](_0xbd5244)[_0x8e9a('0x29')](handleEntityNotFound(_0x5db36a,null))['then'](respondWithResult(_0x5db36a,null))['catch'](handleError(_0x5db36a,null));};exports[_0x8e9a('0x46')]=function(_0x7adcc1,_0x49ccf8){return db[_0x8e9a('0x2e')][_0x8e9a('0x46')](_0x7adcc1[_0x8e9a('0x47')],{})[_0x8e9a('0x29')](respondWithResult(_0x49ccf8,0xc9))[_0x8e9a('0x42')](handleError(_0x49ccf8,null));};exports[_0x8e9a('0x48')]=function(_0x91ff25,_0x5b44a8){if(_0x91ff25['body']['id']){delete _0x91ff25[_0x8e9a('0x47')]['id'];}return db['MailSubstatus'][_0x8e9a('0x45')]({'where':{'id':_0x91ff25[_0x8e9a('0x43')]['id']}})[_0x8e9a('0x29')](handleEntityNotFound(_0x5b44a8,null))[_0x8e9a('0x29')](saveUpdates(_0x91ff25[_0x8e9a('0x47')],null))[_0x8e9a('0x29')](respondWithResult(_0x5b44a8,null))[_0x8e9a('0x42')](handleError(_0x5b44a8,null));};exports[_0x8e9a('0x28')]=function(_0xe914d2,_0x2d58e3){return db[_0x8e9a('0x2e')]['find']({'where':{'id':_0xe914d2[_0x8e9a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d58e3,null))[_0x8e9a('0x29')](removeEntity(_0x2d58e3,null))[_0x8e9a('0x42')](handleError(_0x2d58e3,null));};exports[_0x8e9a('0x49')]=function(_0x4a096f,_0x91ca9b){return db[_0x8e9a('0x2e')]['describe']()['then'](respondWithResult(_0x91ca9b,null))[_0x8e9a('0x42')](handleError(_0x91ca9b,null));}; \ No newline at end of file +var _0xcb39=['set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','MailSubstatus','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x50f298,_0x15ec50){var _0xa1ab2=function(_0x4d1f34){while(--_0x4d1f34){_0x50f298['push'](_0x50f298['shift']());}};_0xa1ab2(++_0x15ec50);}(_0xcb39,0x1b8));var _0x9cb3=function(_0x316c1c,_0x446eaa){_0x316c1c=_0x316c1c-0x0;var _0x48e472=_0xcb39[_0x316c1c];return _0x48e472;};'use strict';var emlformat=require(_0x9cb3('0x0'));var rimraf=require(_0x9cb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cb3('0x2'));var rp=require(_0x9cb3('0x3'));var moment=require(_0x9cb3('0x4'));var BPromise=require(_0x9cb3('0x5'));var Mustache=require(_0x9cb3('0x6'));var util=require(_0x9cb3('0x7'));var path=require(_0x9cb3('0x8'));var sox=require(_0x9cb3('0x9'));var csv=require(_0x9cb3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cb3('0xb'));var _=require(_0x9cb3('0xc'));var squel=require(_0x9cb3('0xd'));var crypto=require('crypto');var jsforce=require(_0x9cb3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cb3('0xf'));var Redis=require(_0x9cb3('0x10'));var authService=require(_0x9cb3('0x11'));var qs=require(_0x9cb3('0x12'));var as=require(_0x9cb3('0x13'));var hardwareService=require(_0x9cb3('0x14'));var logger=require(_0x9cb3('0x15'))(_0x9cb3('0x16'));var utils=require(_0x9cb3('0x17'));var config=require(_0x9cb3('0x18'));var licenseUtil=require(_0x9cb3('0x19'));var db=require(_0x9cb3('0x1a'))['db'];function respondWithStatusCode(_0x36940b,_0x4565ee){_0x4565ee=_0x4565ee||0xcc;return function(_0x120f0a){if(_0x120f0a){return _0x36940b[_0x9cb3('0x1b')](_0x4565ee);}return _0x36940b[_0x9cb3('0x1c')](_0x4565ee)[_0x9cb3('0x1d')]();};}function respondWithResult(_0x35052b,_0x457e5c){_0x457e5c=_0x457e5c||0xc8;return function(_0x1a1bd0){if(_0x1a1bd0){return _0x35052b[_0x9cb3('0x1c')](_0x457e5c)['json'](_0x1a1bd0);}};}function respondWithFilteredResult(_0x5a71e7,_0x55f3dd){return function(_0x223277){if(_0x223277){var _0x4a9b44=typeof _0x55f3dd[_0x9cb3('0x1e')]==='undefined'&&typeof _0x55f3dd['limit']===_0x9cb3('0x1f');var _0x50c9aa=_0x223277[_0x9cb3('0x20')];var _0x3f9767=_0x4a9b44?0x0:_0x55f3dd[_0x9cb3('0x1e')];var _0x41d6b5=_0x4a9b44?_0x223277[_0x9cb3('0x20')]:_0x55f3dd[_0x9cb3('0x1e')]+_0x55f3dd[_0x9cb3('0x21')];var _0x31de02;if(_0x41d6b5>=_0x50c9aa){_0x41d6b5=_0x50c9aa;_0x31de02=0xc8;}else{_0x31de02=0xce;}_0x5a71e7[_0x9cb3('0x1c')](_0x31de02);return _0x5a71e7[_0x9cb3('0x22')](_0x9cb3('0x23'),_0x3f9767+'-'+_0x41d6b5+'/'+_0x50c9aa)[_0x9cb3('0x24')](_0x223277);}return null;};}function patchUpdates(_0x2ec660){return function(_0x5406c2){try{jsonpatch['apply'](_0x5406c2,_0x2ec660,!![]);}catch(_0x25965f){return BPromise[_0x9cb3('0x25')](_0x25965f);}return _0x5406c2[_0x9cb3('0x26')]();};}function saveUpdates(_0x430d77,_0x3adf5c){return function(_0x4ae732){if(_0x4ae732){return _0x4ae732[_0x9cb3('0x27')](_0x430d77)[_0x9cb3('0x28')](function(_0x40265a){return _0x40265a;});}return null;};}function removeEntity(_0x2f9a72,_0x551281){return function(_0x2f83b6){if(_0x2f83b6){return _0x2f83b6[_0x9cb3('0x29')]()[_0x9cb3('0x28')](function(){_0x2f9a72[_0x9cb3('0x1c')](0xcc)[_0x9cb3('0x1d')]();});}};}function handleEntityNotFound(_0x204971,_0x4290c0){return function(_0x4a037e){if(!_0x4a037e){_0x204971[_0x9cb3('0x1b')](0x194);}return _0x4a037e;};}function handleError(_0x1656e8,_0x3a7487){_0x3a7487=_0x3a7487||0x1f4;return function(_0x368ec7){logger[_0x9cb3('0x2a')](_0x368ec7[_0x9cb3('0x2b')]);if(_0x368ec7[_0x9cb3('0x2c')]){delete _0x368ec7[_0x9cb3('0x2c')];}_0x1656e8[_0x9cb3('0x1c')](_0x3a7487)[_0x9cb3('0x2d')](_0x368ec7);};}exports['index']=function(_0x162fb4,_0x5680ac){var _0x49ba96={},_0x2fe269={},_0x490f97={'count':0x0,'rows':[]};var _0x2fa3f6=_[_0x9cb3('0x2e')](db['MailSubstatus']['rawAttributes'],function(_0x47aaf0){return{'name':_0x47aaf0[_0x9cb3('0x2f')],'type':_0x47aaf0[_0x9cb3('0x30')][_0x9cb3('0x31')]};});_0x2fe269['model']=_['map'](_0x2fa3f6,_0x9cb3('0x2c'));_0x2fe269['query']=_['keys'](_0x162fb4[_0x9cb3('0x32')]);_0x2fe269[_0x9cb3('0x33')]=_[_0x9cb3('0x34')](_0x2fe269[_0x9cb3('0x35')],_0x2fe269[_0x9cb3('0x32')]);_0x49ba96[_0x9cb3('0x36')]=_[_0x9cb3('0x34')](_0x2fe269[_0x9cb3('0x35')],qs['fields'](_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x37')]));_0x49ba96[_0x9cb3('0x36')]=_0x49ba96[_0x9cb3('0x36')][_0x9cb3('0x38')]?_0x49ba96[_0x9cb3('0x36')]:_0x2fe269[_0x9cb3('0x35')];if(!_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x39')]('nolimit')){_0x49ba96[_0x9cb3('0x21')]=qs[_0x9cb3('0x21')](_0x162fb4['query'][_0x9cb3('0x21')]);_0x49ba96[_0x9cb3('0x1e')]=qs[_0x9cb3('0x1e')](_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x1e')]);}_0x49ba96[_0x9cb3('0x3a')]=qs['sort'](_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x3b')]);_0x49ba96['where']=qs[_0x9cb3('0x33')](_['pick'](_0x162fb4[_0x9cb3('0x32')],_0x2fe269[_0x9cb3('0x33')]),_0x2fa3f6);if(_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x3c')]){_0x49ba96[_0x9cb3('0x3d')]=_[_0x9cb3('0x3e')](_0x49ba96['where'],{'$or':_[_0x9cb3('0x2e')](_0x2fa3f6,function(_0x343975){if(_0x343975['type']!==_0x9cb3('0x3f')){var _0x3d8deb={};_0x3d8deb[_0x343975[_0x9cb3('0x2c')]]={'$like':'%'+_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x3c')]+'%'};return _0x3d8deb;}})});}_0x49ba96=_[_0x9cb3('0x3e')]({},_0x49ba96,_0x162fb4[_0x9cb3('0x40')]);var _0x74aebc={'where':_0x49ba96[_0x9cb3('0x3d')]};return db['MailSubstatus']['count'](_0x74aebc)[_0x9cb3('0x28')](function(_0x26360a){_0x490f97[_0x9cb3('0x20')]=_0x26360a;if(_0x162fb4[_0x9cb3('0x32')][_0x9cb3('0x41')]){_0x49ba96['include']=[{'all':!![]}];}return db[_0x9cb3('0x42')][_0x9cb3('0x43')](_0x49ba96);})[_0x9cb3('0x28')](function(_0x370095){_0x490f97[_0x9cb3('0x44')]=_0x370095;return _0x490f97;})[_0x9cb3('0x28')](respondWithFilteredResult(_0x5680ac,_0x49ba96))[_0x9cb3('0x45')](handleError(_0x5680ac,null));};exports[_0x9cb3('0x46')]=function(_0x3ffbc9,_0x12fd03){var _0x42a542={'raw':!![],'where':{'id':_0x3ffbc9[_0x9cb3('0x47')]['id']}},_0x377c44={};_0x377c44[_0x9cb3('0x35')]=_[_0x9cb3('0x48')](db[_0x9cb3('0x42')][_0x9cb3('0x49')]);_0x377c44[_0x9cb3('0x32')]=_[_0x9cb3('0x48')](_0x3ffbc9[_0x9cb3('0x32')]);_0x377c44[_0x9cb3('0x33')]=_[_0x9cb3('0x34')](_0x377c44[_0x9cb3('0x35')],_0x377c44[_0x9cb3('0x32')]);_0x42a542[_0x9cb3('0x36')]=_['intersection'](_0x377c44[_0x9cb3('0x35')],qs[_0x9cb3('0x37')](_0x3ffbc9[_0x9cb3('0x32')][_0x9cb3('0x37')]));_0x42a542[_0x9cb3('0x36')]=_0x42a542['attributes'][_0x9cb3('0x38')]?_0x42a542[_0x9cb3('0x36')]:_0x377c44['model'];if(_0x3ffbc9[_0x9cb3('0x32')]['includeAll']){_0x42a542[_0x9cb3('0x4a')]=[{'all':!![]}];}_0x42a542=_[_0x9cb3('0x3e')]({},_0x42a542,_0x3ffbc9[_0x9cb3('0x40')]);return db[_0x9cb3('0x42')][_0x9cb3('0x4b')](_0x42a542)[_0x9cb3('0x28')](handleEntityNotFound(_0x12fd03,null))[_0x9cb3('0x28')](respondWithResult(_0x12fd03,null))[_0x9cb3('0x45')](handleError(_0x12fd03,null));};exports['create']=function(_0x457d8c,_0x28fe31){return db[_0x9cb3('0x42')][_0x9cb3('0x4c')](_0x457d8c['body'],{})[_0x9cb3('0x28')](respondWithResult(_0x28fe31,0xc9))[_0x9cb3('0x45')](handleError(_0x28fe31,null));};exports[_0x9cb3('0x27')]=function(_0xad06d2,_0x55ebf4){if(_0xad06d2[_0x9cb3('0x4d')]['id']){delete _0xad06d2[_0x9cb3('0x4d')]['id'];}return db[_0x9cb3('0x42')][_0x9cb3('0x4b')]({'where':{'id':_0xad06d2[_0x9cb3('0x47')]['id']}})[_0x9cb3('0x28')](handleEntityNotFound(_0x55ebf4,null))[_0x9cb3('0x28')](saveUpdates(_0xad06d2[_0x9cb3('0x4d')],null))[_0x9cb3('0x28')](respondWithResult(_0x55ebf4,null))[_0x9cb3('0x45')](handleError(_0x55ebf4,null));};exports['destroy']=function(_0x3f2c4c,_0x275b95){return db[_0x9cb3('0x42')][_0x9cb3('0x4b')]({'where':{'id':_0x3f2c4c['params']['id']}})[_0x9cb3('0x28')](handleEntityNotFound(_0x275b95,null))[_0x9cb3('0x28')](removeEntity(_0x275b95,null))[_0x9cb3('0x45')](handleError(_0x275b95,null));};exports[_0x9cb3('0x4e')]=function(_0x2fd8d1,_0x5088f9){return db[_0x9cb3('0x42')][_0x9cb3('0x4e')]()['then'](respondWithResult(_0x5088f9,null))['catch'](handleError(_0x5088f9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c1fb872..3605ce2 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 _0xff00=['path','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','lodash','util','bluebird'];(function(_0xaeab25,_0x4ef61f){var _0x52ad50=function(_0x56e4bf){while(--_0x56e4bf){_0xaeab25['push'](_0xaeab25['shift']());}};_0x52ad50(++_0x4ef61f);}(_0xff00,0xf5));var _0x0ff0=function(_0x3946e4,_0x5d5250){_0x3946e4=_0x3946e4-0x0;var _0xac217c=_0xff00[_0x3946e4];return _0xac217c;};'use strict';var _=require(_0x0ff0('0x0'));var util=require(_0x0ff0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ff0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ff0('0x3'));var rimraf=require('rimraf');var config=require(_0x0ff0('0x4'));var attributes=require(_0x0ff0('0x5'));module['exports']=function(_0x2799da,_0x45e848){return _0x2799da[_0x0ff0('0x6')](_0x0ff0('0x7'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6e9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util','../../config/logger'];(function(_0x35e0d2,_0x32dac4){var _0x3549be=function(_0xb5a42c){while(--_0xb5a42c){_0x35e0d2['push'](_0x35e0d2['shift']());}};_0x3549be(++_0x32dac4);}(_0xa6e9,0x193));var _0x9a6e=function(_0x2412db,_0x54598b){_0x2412db=_0x2412db-0x0;var _0x2eb77e=_0xa6e9[_0x2412db];return _0x2eb77e;};'use strict';var _=require(_0x9a6e('0x0'));var util=require(_0x9a6e('0x1'));var logger=require(_0x9a6e('0x2'))(_0x9a6e('0x3'));var moment=require(_0x9a6e('0x4'));var BPromise=require(_0x9a6e('0x5'));var rp=require(_0x9a6e('0x6'));var fs=require('fs');var path=require(_0x9a6e('0x7'));var rimraf=require(_0x9a6e('0x8'));var config=require(_0x9a6e('0x9'));var attributes=require(_0x9a6e('0xa'));module[_0x9a6e('0xb')]=function(_0x3227d3,_0x384d90){return _0x3227d3[_0x9a6e('0xc')](_0x9a6e('0xd'),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 61d0c48..f7fb377 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 _0xede7=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x4c0b23,_0x474c1c){var _0x3a06f0=function(_0x340837){while(--_0x340837){_0x4c0b23['push'](_0x4c0b23['shift']());}};_0x3a06f0(++_0x474c1c);}(_0xede7,0x11e));var _0x7ede=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0xede7[_0x418549];return _0x288826;};'use strict';var _=require(_0x7ede('0x0'));var util=require(_0x7ede('0x1'));var moment=require(_0x7ede('0x2'));var BPromise=require(_0x7ede('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ede('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ede('0x5'));var logger=require(_0x7ede('0x6'))(_0x7ede('0x7'));var config=require(_0x7ede('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7ede('0x9')][_0x7ede('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5d01,_0x48aec2,_0x52164a){return new BPromise(function(_0x547fd0,_0x2c8e58){return client[_0x7ede('0xb')](_0x2a5d01,_0x52164a)[_0x7ede('0xc')](function(_0x4c1bf9){logger[_0x7ede('0xd')](_0x7ede('0xe'),_0x48aec2,'request\x20sent');logger[_0x7ede('0xf')](_0x7ede('0x10'),_0x48aec2,'request\x20sent',JSON[_0x7ede('0x11')](_0x4c1bf9));if(_0x4c1bf9[_0x7ede('0x12')]){if(_0x4c1bf9[_0x7ede('0x12')]['code']===0x1f4){logger['error'](_0x7ede('0xe'),_0x48aec2,_0x4c1bf9['error'][_0x7ede('0x13')]);return _0x2c8e58(_0x4c1bf9[_0x7ede('0x12')][_0x7ede('0x13')]);}logger[_0x7ede('0x12')](_0x7ede('0xe'),_0x48aec2,_0x4c1bf9[_0x7ede('0x12')][_0x7ede('0x13')]);return _0x547fd0(_0x4c1bf9[_0x7ede('0x12')][_0x7ede('0x13')]);}else{logger[_0x7ede('0xd')](_0x7ede('0xe'),_0x48aec2,_0x7ede('0x14'));_0x547fd0(_0x4c1bf9['result'][_0x7ede('0x13')]);}})[_0x7ede('0x15')](function(_0x1a0ba8){logger[_0x7ede('0x12')](_0x7ede('0xe'),_0x48aec2,_0x1a0ba8);_0x2c8e58(_0x1a0ba8);});});} \ No newline at end of file +var _0x7a62=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x3952a2,_0x243d79){var _0x31e143=function(_0x26e0bc){while(--_0x26e0bc){_0x3952a2['push'](_0x3952a2['shift']());}};_0x31e143(++_0x243d79);}(_0x7a62,0xb7));var _0x27a6=function(_0x99f54e,_0xd67e08){_0x99f54e=_0x99f54e-0x0;var _0x2ecc30=_0x7a62[_0x99f54e];return _0x2ecc30;};'use strict';var _=require('lodash');var util=require(_0x27a6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x27a6('0x1'));var fs=require('fs');var Redis=require(_0x27a6('0x2'));var db=require(_0x27a6('0x3'))['db'];var utils=require(_0x27a6('0x4'));var logger=require(_0x27a6('0x5'))('rpc');var config=require(_0x27a6('0x6'));var jayson=require(_0x27a6('0x7'));var client=jayson[_0x27a6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5acb6f,_0x5c9c9b,_0x47de7b){return new BPromise(function(_0x24edd5,_0x45868f){return client[_0x27a6('0x9')](_0x5acb6f,_0x47de7b)[_0x27a6('0xa')](function(_0x5948be){logger[_0x27a6('0xb')](_0x27a6('0xc'),_0x5c9c9b,_0x27a6('0xd'));logger[_0x27a6('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5c9c9b,'request\x20sent',JSON['stringify'](_0x5948be));if(_0x5948be[_0x27a6('0xf')]){if(_0x5948be['error'][_0x27a6('0x10')]===0x1f4){logger[_0x27a6('0xf')](_0x27a6('0xc'),_0x5c9c9b,_0x5948be[_0x27a6('0xf')][_0x27a6('0x11')]);return _0x45868f(_0x5948be['error'][_0x27a6('0x11')]);}logger[_0x27a6('0xf')](_0x27a6('0xc'),_0x5c9c9b,_0x5948be[_0x27a6('0xf')][_0x27a6('0x11')]);return _0x24edd5(_0x5948be[_0x27a6('0xf')]['message']);}else{logger['info'](_0x27a6('0xc'),_0x5c9c9b,_0x27a6('0xd'));_0x24edd5(_0x5948be[_0x27a6('0x12')][_0x27a6('0x11')]);}})[_0x27a6('0x13')](function(_0x1b3d36){logger['error'](_0x27a6('0xc'),_0x5c9c9b,_0x1b3d36);_0x45868f(_0x1b3d36);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 58b598a..2775ecd 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 _0x3d7e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x58b56d,_0x25fc6a){var _0x3dc8db=function(_0x1cd52e){while(--_0x1cd52e){_0x58b56d['push'](_0x58b56d['shift']());}};_0x3dc8db(++_0x25fc6a);}(_0x3d7e,0x10d));var _0xe3d7=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x3d7e[_0x2a0738];return _0x159679;};'use strict';var multer=require(_0xe3d7('0x0'));var util=require(_0xe3d7('0x1'));var path=require(_0xe3d7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3d7('0x3'));var router=express['Router']();var fs_extra=require(_0xe3d7('0x4'));var auth=require(_0xe3d7('0x5'));var interaction=require(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var controller=require('./mailTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe3d7('0x8')]);router['get']('/describe',auth[_0xe3d7('0x9')](),controller[_0xe3d7('0xa')]);router[_0xe3d7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe3d7('0xc')]);router[_0xe3d7('0xd')]('/',auth[_0xe3d7('0x9')](),controller[_0xe3d7('0xe')]);router[_0xe3d7('0xf')](_0xe3d7('0x10'),auth[_0xe3d7('0x9')](),controller[_0xe3d7('0x11')]);router[_0xe3d7('0x12')](_0xe3d7('0x10'),auth[_0xe3d7('0x9')](),controller[_0xe3d7('0x13')]);module[_0xe3d7('0x14')]=router; \ No newline at end of file +var _0xa2f0=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x2485d1,_0x362137){var _0x530af4=function(_0x4ae80c){while(--_0x4ae80c){_0x2485d1['push'](_0x2485d1['shift']());}};_0x530af4(++_0x362137);}(_0xa2f0,0x1de));var _0x0a2f=function(_0x1302a7,_0x1349ab){_0x1302a7=_0x1302a7-0x0;var _0x10f9e9=_0xa2f0[_0x1302a7];return _0x10f9e9;};'use strict';var multer=require('multer');var util=require(_0x0a2f('0x0'));var path=require(_0x0a2f('0x1'));var timeout=require(_0x0a2f('0x2'));var express=require(_0x0a2f('0x3'));var router=express['Router']();var fs_extra=require(_0x0a2f('0x4'));var auth=require(_0x0a2f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0a2f('0x6'));var controller=require(_0x0a2f('0x7'));router[_0x0a2f('0x8')]('/',auth[_0x0a2f('0x9')](),controller[_0x0a2f('0xa')]);router[_0x0a2f('0x8')](_0x0a2f('0xb'),auth[_0x0a2f('0x9')](),controller['describe']);router[_0x0a2f('0x8')](_0x0a2f('0xc'),auth[_0x0a2f('0x9')](),controller[_0x0a2f('0xd')]);router[_0x0a2f('0xe')]('/',auth[_0x0a2f('0x9')](),controller['create']);router[_0x0a2f('0xf')](_0x0a2f('0xc'),auth[_0x0a2f('0x9')](),controller[_0x0a2f('0x10')]);router[_0x0a2f('0x11')](_0x0a2f('0xc'),auth[_0x0a2f('0x9')](),controller[_0x0a2f('0x12')]);module[_0x0a2f('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 2410861..c4284e4 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3c87fc,_0x4d23d4){var _0x13abe6=function(_0x4ded5a){while(--_0x4ded5a){_0x3c87fc['push'](_0x3c87fc['shift']());}};_0x13abe6(++_0x4d23d4);}(_0xaa88,0x137));var _0x8aa8=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0xaa88[_0x114d1f];return _0x5b91d4;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xe043e6,_0xd2f4ed){var _0x6755d5=function(_0x58066c){while(--_0x58066c){_0xe043e6['push'](_0xe043e6['shift']());}};_0x6755d5(++_0xd2f4ed);}(_0x008c,0x188));var _0xc008=function(_0x2e9c6d,_0xbecdb4){_0x2e9c6d=_0x2e9c6d-0x0;var _0x139a4f=_0x008c[_0x2e9c6d];return _0x139a4f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index d145f2f..bf25015 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 _0x5177=['json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','keys','intersection','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x1029f9,_0x15d0d7){var _0x570775=function(_0x4297ce){while(--_0x4297ce){_0x1029f9['push'](_0x1029f9['shift']());}};_0x570775(++_0x15d0d7);}(_0x5177,0x1ab));var _0x7517=function(_0x497487,_0x47c4be){_0x497487=_0x497487-0x0;var _0x1d9e84=_0x5177[_0x497487];return _0x1d9e84;};'use strict';var emlformat=require(_0x7517('0x0'));var rimraf=require(_0x7517('0x1'));var zipdir=require(_0x7517('0x2'));var jsonpatch=require(_0x7517('0x3'));var rp=require(_0x7517('0x4'));var moment=require(_0x7517('0x5'));var BPromise=require(_0x7517('0x6'));var Mustache=require(_0x7517('0x7'));var util=require(_0x7517('0x8'));var path=require('path');var sox=require(_0x7517('0x9'));var csv=require(_0x7517('0xa'));var ejs=require(_0x7517('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7517('0xc'));var squel=require(_0x7517('0xd'));var crypto=require(_0x7517('0xe'));var jsforce=require(_0x7517('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7517('0xa'));var querystring=require(_0x7517('0x10'));var Papa=require(_0x7517('0x11'));var Redis=require(_0x7517('0x12'));var authService=require(_0x7517('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7517('0x14'));var hardwareService=require(_0x7517('0x15'));var logger=require(_0x7517('0x16'))(_0x7517('0x17'));var utils=require(_0x7517('0x18'));var config=require(_0x7517('0x19'));var licenseUtil=require(_0x7517('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x585235,_0x30700c){_0x30700c=_0x30700c||0xcc;return function(_0x22a242){if(_0x22a242){return _0x585235[_0x7517('0x1b')](_0x30700c);}return _0x585235['status'](_0x30700c)[_0x7517('0x1c')]();};}function respondWithResult(_0x252878,_0xe8a1dc){_0xe8a1dc=_0xe8a1dc||0xc8;return function(_0x2d915e){if(_0x2d915e){return _0x252878['status'](_0xe8a1dc)[_0x7517('0x1d')](_0x2d915e);}};}function respondWithFilteredResult(_0x1377c4,_0x5ace0a){return function(_0x4ae668){if(_0x4ae668){var _0x3b9d2f=typeof _0x5ace0a[_0x7517('0x1e')]==='undefined'&&typeof _0x5ace0a[_0x7517('0x1f')]===_0x7517('0x20');var _0x394d9d=_0x4ae668[_0x7517('0x21')];var _0x2127e4=_0x3b9d2f?0x0:_0x5ace0a[_0x7517('0x1e')];var _0x5d5671=_0x3b9d2f?_0x4ae668['count']:_0x5ace0a[_0x7517('0x1e')]+_0x5ace0a[_0x7517('0x1f')];var _0x46cd83;if(_0x5d5671>=_0x394d9d){_0x5d5671=_0x394d9d;_0x46cd83=0xc8;}else{_0x46cd83=0xce;}_0x1377c4[_0x7517('0x22')](_0x46cd83);return _0x1377c4[_0x7517('0x23')]('Content-Range',_0x2127e4+'-'+_0x5d5671+'/'+_0x394d9d)[_0x7517('0x1d')](_0x4ae668);}return null;};}function patchUpdates(_0x250d04){return function(_0x71706a){try{jsonpatch[_0x7517('0x24')](_0x71706a,_0x250d04,!![]);}catch(_0x490d19){return BPromise[_0x7517('0x25')](_0x490d19);}return _0x71706a[_0x7517('0x26')]();};}function saveUpdates(_0x3cbd94,_0x378429){return function(_0x2bef92){if(_0x2bef92){return _0x2bef92[_0x7517('0x27')](_0x3cbd94)[_0x7517('0x28')](function(_0x263db7){return _0x263db7;});}return null;};}function removeEntity(_0x2d6efa,_0x56c2c3){return function(_0xc11c98){if(_0xc11c98){return _0xc11c98[_0x7517('0x29')]()[_0x7517('0x28')](function(){_0x2d6efa[_0x7517('0x22')](0xcc)[_0x7517('0x1c')]();});}};}function handleEntityNotFound(_0xa5ea7,_0x49523f){return function(_0x396e41){if(!_0x396e41){_0xa5ea7[_0x7517('0x1b')](0x194);}return _0x396e41;};}function handleError(_0x765b7,_0xa70fc0){_0xa70fc0=_0xa70fc0||0x1f4;return function(_0x1e2e63){logger[_0x7517('0x2a')](_0x1e2e63[_0x7517('0x2b')]);if(_0x1e2e63['name']){delete _0x1e2e63[_0x7517('0x2c')];}_0x765b7['status'](_0xa70fc0)[_0x7517('0x2d')](_0x1e2e63);};}exports[_0x7517('0x2e')]=function(_0x5c46c6,_0x65c2b9){var _0x1e6adb={},_0xbc0eb9={},_0x4e9431={'count':0x0,'rows':[]};var _0x1a2e5a=_[_0x7517('0x2f')](db[_0x7517('0x30')][_0x7517('0x31')],function(_0x22cad0){return{'name':_0x22cad0[_0x7517('0x32')],'type':_0x22cad0[_0x7517('0x33')][_0x7517('0x34')]};});_0xbc0eb9[_0x7517('0x35')]=_['map'](_0x1a2e5a,_0x7517('0x2c'));_0xbc0eb9[_0x7517('0x36')]=_['keys'](_0x5c46c6[_0x7517('0x36')]);_0xbc0eb9[_0x7517('0x37')]=_['intersection'](_0xbc0eb9[_0x7517('0x35')],_0xbc0eb9[_0x7517('0x36')]);_0x1e6adb[_0x7517('0x38')]=_['intersection'](_0xbc0eb9[_0x7517('0x35')],qs[_0x7517('0x39')](_0x5c46c6[_0x7517('0x36')][_0x7517('0x39')]));_0x1e6adb[_0x7517('0x38')]=_0x1e6adb[_0x7517('0x38')]['length']?_0x1e6adb['attributes']:_0xbc0eb9[_0x7517('0x35')];if(!_0x5c46c6[_0x7517('0x36')][_0x7517('0x3a')]('nolimit')){_0x1e6adb[_0x7517('0x1f')]=qs[_0x7517('0x1f')](_0x5c46c6[_0x7517('0x36')][_0x7517('0x1f')]);_0x1e6adb['offset']=qs[_0x7517('0x1e')](_0x5c46c6[_0x7517('0x36')][_0x7517('0x1e')]);}_0x1e6adb[_0x7517('0x3b')]=qs[_0x7517('0x3c')](_0x5c46c6[_0x7517('0x36')]['sort']);_0x1e6adb[_0x7517('0x3d')]=qs[_0x7517('0x37')](_[_0x7517('0x3e')](_0x5c46c6[_0x7517('0x36')],_0xbc0eb9[_0x7517('0x37')]),_0x1a2e5a);if(_0x5c46c6[_0x7517('0x36')][_0x7517('0x3f')]){_0x1e6adb[_0x7517('0x3d')]=_['merge'](_0x1e6adb[_0x7517('0x3d')],{'$or':_[_0x7517('0x2f')](_0x1a2e5a,function(_0x3ab053){if(_0x3ab053[_0x7517('0x33')]!==_0x7517('0x40')){var _0x21d2ab={};_0x21d2ab[_0x3ab053['name']]={'$like':'%'+_0x5c46c6[_0x7517('0x36')][_0x7517('0x3f')]+'%'};return _0x21d2ab;}})});}_0x1e6adb=_[_0x7517('0x41')]({},_0x1e6adb,_0x5c46c6[_0x7517('0x42')]);var _0x18c198={'where':_0x1e6adb[_0x7517('0x3d')]};return db[_0x7517('0x30')][_0x7517('0x21')](_0x18c198)[_0x7517('0x28')](function(_0x1bc88a){_0x4e9431['count']=_0x1bc88a;if(_0x5c46c6['query'][_0x7517('0x43')]){_0x1e6adb['include']=[{'all':!![]}];}return db[_0x7517('0x30')]['findAll'](_0x1e6adb);})[_0x7517('0x28')](function(_0x1aa6d2){_0x4e9431[_0x7517('0x44')]=_0x1aa6d2;return _0x4e9431;})['then'](respondWithFilteredResult(_0x65c2b9,_0x1e6adb))[_0x7517('0x45')](handleError(_0x65c2b9,null));};exports['show']=function(_0x463a8d,_0x476eb5){var _0xb77f27={'raw':!![],'where':{'id':_0x463a8d[_0x7517('0x46')]['id']}},_0x3c05d4={};_0x3c05d4['model']=_[_0x7517('0x47')](db['MailTransferReport'][_0x7517('0x31')]);_0x3c05d4[_0x7517('0x36')]=_[_0x7517('0x47')](_0x463a8d[_0x7517('0x36')]);_0x3c05d4[_0x7517('0x37')]=_['intersection'](_0x3c05d4[_0x7517('0x35')],_0x3c05d4['query']);_0xb77f27[_0x7517('0x38')]=_[_0x7517('0x48')](_0x3c05d4[_0x7517('0x35')],qs[_0x7517('0x39')](_0x463a8d['query'][_0x7517('0x39')]));_0xb77f27[_0x7517('0x38')]=_0xb77f27[_0x7517('0x38')]['length']?_0xb77f27[_0x7517('0x38')]:_0x3c05d4[_0x7517('0x35')];if(_0x463a8d['query'][_0x7517('0x43')]){_0xb77f27['include']=[{'all':!![]}];}_0xb77f27=_[_0x7517('0x41')]({},_0xb77f27,_0x463a8d[_0x7517('0x42')]);return db[_0x7517('0x30')]['find'](_0xb77f27)[_0x7517('0x28')](handleEntityNotFound(_0x476eb5,null))[_0x7517('0x28')](respondWithResult(_0x476eb5,null))['catch'](handleError(_0x476eb5,null));};exports['create']=function(_0xcb1a37,_0x36ba4d){return db['MailTransferReport']['create'](_0xcb1a37[_0x7517('0x49')],{})[_0x7517('0x28')](respondWithResult(_0x36ba4d,0xc9))[_0x7517('0x45')](handleError(_0x36ba4d,null));};exports[_0x7517('0x27')]=function(_0x3280ce,_0x4dffcd){if(_0x3280ce[_0x7517('0x49')]['id']){delete _0x3280ce[_0x7517('0x49')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x3280ce[_0x7517('0x46')]['id']}})[_0x7517('0x28')](handleEntityNotFound(_0x4dffcd,null))['then'](saveUpdates(_0x3280ce[_0x7517('0x49')],null))[_0x7517('0x28')](respondWithResult(_0x4dffcd,null))[_0x7517('0x45')](handleError(_0x4dffcd,null));};exports[_0x7517('0x29')]=function(_0x1670f2,_0x5ce5d4){return db['MailTransferReport'][_0x7517('0x4a')]({'where':{'id':_0x1670f2[_0x7517('0x46')]['id']}})[_0x7517('0x28')](handleEntityNotFound(_0x5ce5d4,null))[_0x7517('0x28')](removeEntity(_0x5ce5d4,null))['catch'](handleError(_0x5ce5d4,null));};exports[_0x7517('0x4b')]=function(_0x1e4bc2,_0x22704c){return db[_0x7517('0x30')][_0x7517('0x4b')]()[_0x7517('0x28')](respondWithResult(_0x22704c,null))[_0x7517('0x45')](handleError(_0x22704c,null));}; \ No newline at end of file +var _0xa978=['then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','where','filter','merge','options','includeAll','rows','catch','params','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','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','end','json','offset','undefined','count','set','Content-Range','apply','reject','update'];(function(_0x13a8cc,_0x45b4fc){var _0x31b53c=function(_0x3ea73b){while(--_0x3ea73b){_0x13a8cc['push'](_0x13a8cc['shift']());}};_0x31b53c(++_0x45b4fc);}(_0xa978,0x186));var _0x8a97=function(_0x391ca3,_0x2f2d8c){_0x391ca3=_0x391ca3-0x0;var _0x512931=_0xa978[_0x391ca3];return _0x512931;};'use strict';var emlformat=require(_0x8a97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a97('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a97('0x2'));var moment=require('moment');var BPromise=require(_0x8a97('0x3'));var Mustache=require(_0x8a97('0x4'));var util=require('util');var path=require(_0x8a97('0x5'));var sox=require(_0x8a97('0x6'));var csv=require(_0x8a97('0x7'));var ejs=require(_0x8a97('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a97('0x9'));var squel=require(_0x8a97('0xa'));var crypto=require(_0x8a97('0xb'));var jsforce=require(_0x8a97('0xc'));var deskjs=require(_0x8a97('0xd'));var toCsv=require(_0x8a97('0x7'));var querystring=require(_0x8a97('0xe'));var Papa=require(_0x8a97('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a97('0x10'));var as=require(_0x8a97('0x11'));var hardwareService=require(_0x8a97('0x12'));var logger=require(_0x8a97('0x13'))(_0x8a97('0x14'));var utils=require(_0x8a97('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8a97('0x16'));var db=require(_0x8a97('0x17'))['db'];function respondWithStatusCode(_0x24682d,_0x24b049){_0x24b049=_0x24b049||0xcc;return function(_0x1a0155){if(_0x1a0155){return _0x24682d[_0x8a97('0x18')](_0x24b049);}return _0x24682d[_0x8a97('0x19')](_0x24b049)[_0x8a97('0x1a')]();};}function respondWithResult(_0x5f4adc,_0x1b4042){_0x1b4042=_0x1b4042||0xc8;return function(_0x4c70cf){if(_0x4c70cf){return _0x5f4adc['status'](_0x1b4042)[_0x8a97('0x1b')](_0x4c70cf);}};}function respondWithFilteredResult(_0x38aa35,_0x471851){return function(_0x1eeeb6){if(_0x1eeeb6){var _0x407ebf=typeof _0x471851[_0x8a97('0x1c')]==='undefined'&&typeof _0x471851['limit']===_0x8a97('0x1d');var _0x591bc9=_0x1eeeb6[_0x8a97('0x1e')];var _0x3673ee=_0x407ebf?0x0:_0x471851[_0x8a97('0x1c')];var _0x48284c=_0x407ebf?_0x1eeeb6['count']:_0x471851[_0x8a97('0x1c')]+_0x471851['limit'];var _0x338078;if(_0x48284c>=_0x591bc9){_0x48284c=_0x591bc9;_0x338078=0xc8;}else{_0x338078=0xce;}_0x38aa35[_0x8a97('0x19')](_0x338078);return _0x38aa35[_0x8a97('0x1f')](_0x8a97('0x20'),_0x3673ee+'-'+_0x48284c+'/'+_0x591bc9)['json'](_0x1eeeb6);}return null;};}function patchUpdates(_0x2bbcdb){return function(_0x327af4){try{jsonpatch[_0x8a97('0x21')](_0x327af4,_0x2bbcdb,!![]);}catch(_0xba37bf){return BPromise[_0x8a97('0x22')](_0xba37bf);}return _0x327af4['save']();};}function saveUpdates(_0x430e67,_0x38593e){return function(_0x3eebfe){if(_0x3eebfe){return _0x3eebfe[_0x8a97('0x23')](_0x430e67)['then'](function(_0x9dc2c3){return _0x9dc2c3;});}return null;};}function removeEntity(_0x2aa6a2,_0x232f07){return function(_0x393242){if(_0x393242){return _0x393242['destroy']()[_0x8a97('0x24')](function(){_0x2aa6a2[_0x8a97('0x19')](0xcc)[_0x8a97('0x1a')]();});}};}function handleEntityNotFound(_0xf29f94,_0xd40a36){return function(_0x38a3e8){if(!_0x38a3e8){_0xf29f94['sendStatus'](0x194);}return _0x38a3e8;};}function handleError(_0x496843,_0x38580e){_0x38580e=_0x38580e||0x1f4;return function(_0x5359f3){logger[_0x8a97('0x25')](_0x5359f3[_0x8a97('0x26')]);if(_0x5359f3['name']){delete _0x5359f3[_0x8a97('0x27')];}_0x496843[_0x8a97('0x19')](_0x38580e)[_0x8a97('0x28')](_0x5359f3);};}exports[_0x8a97('0x29')]=function(_0x8ed3c,_0x229453){var _0xc7085d={},_0x45069b={},_0x396563={'count':0x0,'rows':[]};var _0x45a98a=_[_0x8a97('0x2a')](db[_0x8a97('0x2b')][_0x8a97('0x2c')],function(_0x3bfa90){return{'name':_0x3bfa90['fieldName'],'type':_0x3bfa90[_0x8a97('0x2d')][_0x8a97('0x2e')]};});_0x45069b['model']=_[_0x8a97('0x2a')](_0x45a98a,_0x8a97('0x27'));_0x45069b['query']=_[_0x8a97('0x2f')](_0x8ed3c[_0x8a97('0x30')]);_0x45069b[_0x8a97('0x31')]=_['intersection'](_0x45069b['model'],_0x45069b[_0x8a97('0x30')]);_0xc7085d['attributes']=_[_0x8a97('0x32')](_0x45069b[_0x8a97('0x33')],qs[_0x8a97('0x34')](_0x8ed3c[_0x8a97('0x30')]['fields']));_0xc7085d[_0x8a97('0x35')]=_0xc7085d[_0x8a97('0x35')][_0x8a97('0x36')]?_0xc7085d[_0x8a97('0x35')]:_0x45069b['model'];if(!_0x8ed3c[_0x8a97('0x30')][_0x8a97('0x37')]('nolimit')){_0xc7085d[_0x8a97('0x38')]=qs[_0x8a97('0x38')](_0x8ed3c[_0x8a97('0x30')][_0x8a97('0x38')]);_0xc7085d[_0x8a97('0x1c')]=qs[_0x8a97('0x1c')](_0x8ed3c[_0x8a97('0x30')]['offset']);}_0xc7085d[_0x8a97('0x39')]=qs['sort'](_0x8ed3c[_0x8a97('0x30')]['sort']);_0xc7085d[_0x8a97('0x3a')]=qs[_0x8a97('0x31')](_['pick'](_0x8ed3c[_0x8a97('0x30')],_0x45069b['filters']),_0x45a98a);if(_0x8ed3c[_0x8a97('0x30')][_0x8a97('0x3b')]){_0xc7085d[_0x8a97('0x3a')]=_['merge'](_0xc7085d[_0x8a97('0x3a')],{'$or':_[_0x8a97('0x2a')](_0x45a98a,function(_0x57db29){if(_0x57db29[_0x8a97('0x2d')]!=='VIRTUAL'){var _0x55f85c={};_0x55f85c[_0x57db29[_0x8a97('0x27')]]={'$like':'%'+_0x8ed3c[_0x8a97('0x30')]['filter']+'%'};return _0x55f85c;}})});}_0xc7085d=_[_0x8a97('0x3c')]({},_0xc7085d,_0x8ed3c[_0x8a97('0x3d')]);var _0x2bf232={'where':_0xc7085d[_0x8a97('0x3a')]};return db[_0x8a97('0x2b')][_0x8a97('0x1e')](_0x2bf232)[_0x8a97('0x24')](function(_0x2a4df5){_0x396563['count']=_0x2a4df5;if(_0x8ed3c[_0x8a97('0x30')][_0x8a97('0x3e')]){_0xc7085d['include']=[{'all':!![]}];}return db[_0x8a97('0x2b')]['findAll'](_0xc7085d);})[_0x8a97('0x24')](function(_0x10c043){_0x396563[_0x8a97('0x3f')]=_0x10c043;return _0x396563;})[_0x8a97('0x24')](respondWithFilteredResult(_0x229453,_0xc7085d))[_0x8a97('0x40')](handleError(_0x229453,null));};exports['show']=function(_0x5ed2a1,_0x215359){var _0xa627da={'raw':!![],'where':{'id':_0x5ed2a1[_0x8a97('0x41')]['id']}},_0x66c55e={};_0x66c55e['model']=_[_0x8a97('0x2f')](db[_0x8a97('0x2b')]['rawAttributes']);_0x66c55e[_0x8a97('0x30')]=_['keys'](_0x5ed2a1[_0x8a97('0x30')]);_0x66c55e[_0x8a97('0x31')]=_['intersection'](_0x66c55e[_0x8a97('0x33')],_0x66c55e['query']);_0xa627da[_0x8a97('0x35')]=_['intersection'](_0x66c55e[_0x8a97('0x33')],qs[_0x8a97('0x34')](_0x5ed2a1[_0x8a97('0x30')][_0x8a97('0x34')]));_0xa627da[_0x8a97('0x35')]=_0xa627da[_0x8a97('0x35')]['length']?_0xa627da[_0x8a97('0x35')]:_0x66c55e[_0x8a97('0x33')];if(_0x5ed2a1['query']['includeAll']){_0xa627da['include']=[{'all':!![]}];}_0xa627da=_['merge']({},_0xa627da,_0x5ed2a1[_0x8a97('0x3d')]);return db[_0x8a97('0x2b')][_0x8a97('0x42')](_0xa627da)[_0x8a97('0x24')](handleEntityNotFound(_0x215359,null))['then'](respondWithResult(_0x215359,null))[_0x8a97('0x40')](handleError(_0x215359,null));};exports[_0x8a97('0x43')]=function(_0xe43a8c,_0x5e3e33){return db[_0x8a97('0x2b')]['create'](_0xe43a8c[_0x8a97('0x44')],{})[_0x8a97('0x24')](respondWithResult(_0x5e3e33,0xc9))[_0x8a97('0x40')](handleError(_0x5e3e33,null));};exports[_0x8a97('0x23')]=function(_0x83cf2d,_0x5b6ce3){if(_0x83cf2d['body']['id']){delete _0x83cf2d[_0x8a97('0x44')]['id'];}return db[_0x8a97('0x2b')][_0x8a97('0x42')]({'where':{'id':_0x83cf2d[_0x8a97('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b6ce3,null))[_0x8a97('0x24')](saveUpdates(_0x83cf2d[_0x8a97('0x44')],null))[_0x8a97('0x24')](respondWithResult(_0x5b6ce3,null))[_0x8a97('0x40')](handleError(_0x5b6ce3,null));};exports[_0x8a97('0x45')]=function(_0x3594c3,_0x1c87ec){return db[_0x8a97('0x2b')][_0x8a97('0x42')]({'where':{'id':_0x3594c3[_0x8a97('0x41')]['id']}})[_0x8a97('0x24')](handleEntityNotFound(_0x1c87ec,null))[_0x8a97('0x24')](removeEntity(_0x1c87ec,null))[_0x8a97('0x40')](handleError(_0x1c87ec,null));};exports[_0x8a97('0x46')]=function(_0x1beb9e,_0x3ce780){return db['MailTransferReport'][_0x8a97('0x46')]()[_0x8a97('0x24')](respondWithResult(_0x3ce780,null))[_0x8a97('0x40')](handleError(_0x3ce780,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 57050f4..200dd00 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 _0xd6d2=['util','api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x2c84d0,_0x3cc171){var _0x1e253a=function(_0x261645){while(--_0x261645){_0x2c84d0['push'](_0x2c84d0['shift']());}};_0x1e253a(++_0x3cc171);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x5cb8d6,_0x35560d){_0x5cb8d6=_0x5cb8d6-0x0;var _0x1e035e=_0xd6d2[_0x5cb8d6];return _0x1e035e;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var logger=require('../../config/logger')(_0x2d6d('0x2'));var moment=require(_0x2d6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var attributes=require(_0x2d6d('0x7'));module['exports']=function(_0xfcdb1d,_0x132361){return _0xfcdb1d[_0x2d6d('0x8')](_0x2d6d('0x9'),attributes,{'tableName':_0x2d6d('0xa'),'paranoid':![],'indexes':[{'name':_0x2d6d('0xb'),'fields':[_0x2d6d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae4a=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0xae4a,0x68));var _0xaae4=function(_0x4ac94a,_0x33ab92){_0x4ac94a=_0x4ac94a-0x0;var _0x5760ab=_0xae4a[_0x4ac94a];return _0x5760ab;};'use strict';var _=require(_0xaae4('0x0'));var util=require(_0xaae4('0x1'));var logger=require('../../config/logger')(_0xaae4('0x2'));var moment=require(_0xaae4('0x3'));var BPromise=require('bluebird');var rp=require(_0xaae4('0x4'));var fs=require('fs');var path=require(_0xaae4('0x5'));var rimraf=require(_0xaae4('0x6'));var config=require(_0xaae4('0x7'));var attributes=require(_0xaae4('0x8'));module[_0xaae4('0x9')]=function(_0x36d48e,_0x454d54){return _0x36d48e[_0xaae4('0xa')](_0xaae4('0xb'),attributes,{'tableName':_0xaae4('0xc'),'paranoid':![],'indexes':[{'name':_0xaae4('0xd'),'fields':[_0xaae4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 25137dd..8abc3ac 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 _0xc358=['error','message','request\x20sent','result','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54318c,_0x51e8d3){var _0xd3b96b=function(_0x15a89b){while(--_0x15a89b){_0x54318c['push'](_0x54318c['shift']());}};_0xd3b96b(++_0x51e8d3);}(_0xc358,0x1f4));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8c35('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c35('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c35('0x2'))(_0x8c35('0x3'));var config=require(_0x8c35('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8c35('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18ef96,_0x16a961,_0x4a5fd0){return new BPromise(function(_0x516aa3,_0x4bc85c){return client['request'](_0x18ef96,_0x4a5fd0)[_0x8c35('0x6')](function(_0x547962){logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,'request\x20sent');logger[_0x8c35('0x9')](_0x8c35('0xa'),_0x16a961,'request\x20sent',JSON[_0x8c35('0xb')](_0x547962));if(_0x547962[_0x8c35('0xc')]){if(_0x547962[_0x8c35('0xc')]['code']===0x1f4){logger['error'](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x4bc85c(_0x547962[_0x8c35('0xc')][_0x8c35('0xd')]);}logger[_0x8c35('0xc')](_0x8c35('0x8'),_0x16a961,_0x547962[_0x8c35('0xc')]['message']);return _0x516aa3(_0x547962[_0x8c35('0xc')]['message']);}else{logger[_0x8c35('0x7')](_0x8c35('0x8'),_0x16a961,_0x8c35('0xe'));_0x516aa3(_0x547962[_0x8c35('0xf')]['message']);}})['catch'](function(_0x3ce542){logger['error'](_0x8c35('0x8'),_0x16a961,_0x3ce542);_0x4bc85c(_0x3ce542);});});} \ No newline at end of file +var _0x5df1=['rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x5df1,0x1f3));var _0x15df=function(_0x480cc4,_0x23c503){_0x480cc4=_0x480cc4-0x0;var _0x1bd681=_0x5df1[_0x480cc4];return _0x1bd681;};'use strict';var _=require(_0x15df('0x0'));var util=require(_0x15df('0x1'));var moment=require('moment');var BPromise=require(_0x15df('0x2'));var rs=require(_0x15df('0x3'));var fs=require('fs');var Redis=require(_0x15df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x15df('0x5'));var logger=require(_0x15df('0x6'))(_0x15df('0x7'));var config=require(_0x15df('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15df('0x9')][_0x15df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125712,_0x25246c,_0x5d688e){return new BPromise(function(_0x373c95,_0xac5d20){return client[_0x15df('0xb')](_0x125712,_0x5d688e)[_0x15df('0xc')](function(_0x9a4373){logger[_0x15df('0xd')](_0x15df('0xe'),_0x25246c,'request\x20sent');logger['debug'](_0x15df('0xf'),_0x25246c,_0x15df('0x10'),JSON[_0x15df('0x11')](_0x9a4373));if(_0x9a4373['error']){if(_0x9a4373['error'][_0x15df('0x12')]===0x1f4){logger[_0x15df('0x13')](_0x15df('0xe'),_0x25246c,_0x9a4373['error'][_0x15df('0x14')]);return _0xac5d20(_0x9a4373[_0x15df('0x13')]['message']);}logger[_0x15df('0x13')](_0x15df('0xe'),_0x25246c,_0x9a4373[_0x15df('0x13')][_0x15df('0x14')]);return _0x373c95(_0x9a4373[_0x15df('0x13')][_0x15df('0x14')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x25246c,_0x15df('0x10'));_0x373c95(_0x9a4373[_0x15df('0x15')][_0x15df('0x14')]);}})['catch'](function(_0x4eaee2){logger[_0x15df('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x25246c,_0x4eaee2);_0xac5d20(_0x4eaee2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6269484..dca9579 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 _0xbc76=['show','post','create','put','/:id','update','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe'];(function(_0xdefb0,_0x2b2508){var _0x5f39b3=function(_0x3f5a90){while(--_0x3f5a90){_0xdefb0['push'](_0xdefb0['shift']());}};_0x5f39b3(++_0x2b2508);}(_0xbc76,0x73));var _0x6bc7=function(_0x599f41,_0x129d6c){_0x599f41=_0x599f41-0x0;var _0xb59658=_0xbc76[_0x599f41];return _0xb59658;};'use strict';var multer=require(_0x6bc7('0x0'));var util=require(_0x6bc7('0x1'));var path=require(_0x6bc7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6bc7('0x3'));var interaction=require(_0x6bc7('0x4'));var config=require(_0x6bc7('0x5'));var controller=require(_0x6bc7('0x6'));router[_0x6bc7('0x7')]('/',auth[_0x6bc7('0x8')](),controller['index']);router['get'](_0x6bc7('0x9'),auth[_0x6bc7('0x8')](),controller[_0x6bc7('0xa')]);router[_0x6bc7('0x7')]('/:id',auth[_0x6bc7('0x8')](),controller[_0x6bc7('0xb')]);router[_0x6bc7('0xc')]('/',auth[_0x6bc7('0x8')](),controller[_0x6bc7('0xd')]);router[_0x6bc7('0xe')](_0x6bc7('0xf'),auth[_0x6bc7('0x8')](),controller[_0x6bc7('0x10')]);router['delete'](_0x6bc7('0xf'),auth[_0x6bc7('0x8')](),controller['destroy']);module[_0x6bc7('0x11')]=router; \ No newline at end of file +var _0x41bd=['isAuthenticated','get','describe','/:id','show','post','create','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0x41bd,0x170));var _0xd41b=function(_0x478734,_0x13b975){_0x478734=_0x478734-0x0;var _0x493c17=_0x41bd[_0x478734];return _0x493c17;};'use strict';var multer=require(_0xd41b('0x0'));var util=require(_0xd41b('0x1'));var path=require(_0xd41b('0x2'));var timeout=require(_0xd41b('0x3'));var express=require(_0xd41b('0x4'));var router=express[_0xd41b('0x5')]();var fs_extra=require(_0xd41b('0x6'));var auth=require(_0xd41b('0x7'));var interaction=require(_0xd41b('0x8'));var config=require(_0xd41b('0x9'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xd41b('0xa')](),controller['index']);router[_0xd41b('0xb')]('/describe',auth[_0xd41b('0xa')](),controller[_0xd41b('0xc')]);router[_0xd41b('0xb')](_0xd41b('0xd'),auth[_0xd41b('0xa')](),controller[_0xd41b('0xe')]);router[_0xd41b('0xf')]('/',auth[_0xd41b('0xa')](),controller[_0xd41b('0x10')]);router['put'](_0xd41b('0xd'),auth['isAuthenticated'](),controller[_0xd41b('0x11')]);router['delete'](_0xd41b('0xd'),auth[_0xd41b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c6d4ca5..14fb278 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 _0x2504=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x19f062,_0x2581ad){var _0x45af0c=function(_0x2b5909){while(--_0x2b5909){_0x19f062['push'](_0x19f062['shift']());}};_0x45af0c(++_0x2581ad);}(_0x2504,0xee));var _0x4250=function(_0x3ff745,_0x2c0382){_0x3ff745=_0x3ff745-0x0;var _0x3f2b32=_0x2504[_0x3ff745];return _0x3f2b32;};'use strict';var Sequelize=require(_0x4250('0x0'));var moment=require(_0x4250('0x1'));module[_0x4250('0x2')]={'channel':{'type':Sequelize[_0x4250('0x3')]},'membername':{'type':Sequelize[_0x4250('0x3')]},'interface':{'type':Sequelize[_0x4250('0x3')]},'type':{'type':Sequelize[_0x4250('0x3')],'defaultValue':_0x4250('0x4'),'comment':_0x4250('0x5')},'duration':{'type':Sequelize[_0x4250('0x6')]},'enterAt':{'type':Sequelize[_0x4250('0x7')]},'exitAt':{'type':Sequelize[_0x4250('0x7')],'set':function(_0x493da9){var _0x473cb8=moment(_0x493da9);var _0x4e177e=moment(this['getDataValue'](_0x4250('0x8')));var _0x477312=_0x473cb8[_0x4250('0x9')](_0x4e177e,_0x4250('0xa'));this[_0x4250('0xb')]('exitAt',_0x493da9);this[_0x4250('0xb')]('duration',_0x477312||null);}},'data1':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x4250('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xe')},'data5':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xf')},'role':{'type':Sequelize[_0x4250('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x4250('0x3')]}}; \ No newline at end of file +var _0x1159=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','talk:[start]'];(function(_0xefc497,_0x297122){var _0x3c2f0d=function(_0x5b4b49){while(--_0x5b4b49){_0xefc497['push'](_0xefc497['shift']());}};_0x3c2f0d(++_0x297122);}(_0x1159,0xf3));var _0x9115=function(_0x24d72f,_0x575396){_0x24d72f=_0x24d72f-0x0;var _0x2b3a06=_0x1159[_0x24d72f];return _0x2b3a06;};'use strict';var Sequelize=require(_0x9115('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x9115('0x1')]},'membername':{'type':Sequelize[_0x9115('0x1')]},'interface':{'type':Sequelize[_0x9115('0x1')]},'type':{'type':Sequelize[_0x9115('0x1')],'defaultValue':_0x9115('0x2'),'comment':_0x9115('0x3')},'duration':{'type':Sequelize[_0x9115('0x4')]},'enterAt':{'type':Sequelize[_0x9115('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4a23ba){var _0x3fd395=moment(_0x4a23ba);var _0x22bf7f=moment(this[_0x9115('0x6')](_0x9115('0x7')));var _0x1f69c2=_0x3fd395[_0x9115('0x8')](_0x22bf7f,'seconds');this[_0x9115('0x9')](_0x9115('0xa'),_0x4a23ba);this['setDataValue']('duration',_0x1f69c2||null);}},'data1':{'type':Sequelize[_0x9115('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9115('0x1')],'comment':_0x9115('0xb')},'data3':{'type':Sequelize[_0x9115('0x1')],'comment':_0x9115('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0x9115('0xd')},'data5':{'type':Sequelize[_0x9115('0x1')],'comment':_0x9115('0xe')},'role':{'type':Sequelize[_0x9115('0x1')]},'internal':{'type':Sequelize[_0x9115('0x4')]},'uniqueid':{'type':Sequelize[_0x9115('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c20a20d..f5ce142 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 _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(_0x3a6ff9,_0x4ae96f){var _0x48467e=function(_0x5f4375){while(--_0x5f4375){_0x3a6ff9['push'](_0x3a6ff9['shift']());}};_0x48467e(++_0x4ae96f);}(_0x008c,0x188));var _0xc008=function(_0x316ad3,_0x24e897){_0x316ad3=_0x316ad3-0x0;var _0x1d81e0=_0x008c[_0x316ad3];return _0x1d81e0;};'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 +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x53f8be,_0x164e56){var _0x25c6db=function(_0x59c55e){while(--_0x59c55e){_0x53f8be['push'](_0x53f8be['shift']());}};_0x25c6db(++_0x164e56);}(_0x3e74,0x175));var _0x43e7=function(_0x3612b9,_0x37493c){_0x3612b9=_0x3612b9-0x0;var _0x442f20=_0x3e74[_0x3612b9];return _0x442f20;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c58d511..255b769 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 _0xcafa=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./memberReport.attributes','define','MemberReport','report_member','membername_interface','interface'];(function(_0x2d5678,_0xdfb48f){var _0x4ad11a=function(_0x474ad3){while(--_0x474ad3){_0x2d5678['push'](_0x2d5678['shift']());}};_0x4ad11a(++_0xdfb48f);}(_0xcafa,0x8f));var _0xacaf=function(_0x12dfcf,_0x153223){_0x12dfcf=_0x12dfcf-0x0;var _0x445a6d=_0xcafa[_0x12dfcf];return _0x445a6d;};'use strict';var _=require(_0xacaf('0x0'));var util=require(_0xacaf('0x1'));var logger=require(_0xacaf('0x2'))('api');var moment=require('moment');var BPromise=require(_0xacaf('0x3'));var rp=require(_0xacaf('0x4'));var fs=require('fs');var path=require(_0xacaf('0x5'));var rimraf=require(_0xacaf('0x6'));var config=require('../../config/environment');var attributes=require(_0xacaf('0x7'));module['exports']=function(_0x185dde,_0xf7f82a){return _0x185dde[_0xacaf('0x8')](_0xacaf('0x9'),attributes,{'tableName':_0xacaf('0xa'),'paranoid':![],'indexes':[{'name':_0xacaf('0xb'),'fields':['membername',_0xacaf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3d5=['path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','interface','util','request-promise'];(function(_0x275621,_0x524302){var _0x2ad056=function(_0x1e962f){while(--_0x1e962f){_0x275621['push'](_0x275621['shift']());}};_0x2ad056(++_0x524302);}(_0xc3d5,0x16f));var _0x5c3d=function(_0x3cb2f8,_0x270216){_0x3cb2f8=_0x3cb2f8-0x0;var _0x31ac17=_0xc3d5[_0x3cb2f8];return _0x31ac17;};'use strict';var _=require('lodash');var util=require(_0x5c3d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c3d('0x1'));var fs=require('fs');var path=require(_0x5c3d('0x2'));var rimraf=require('rimraf');var config=require(_0x5c3d('0x3'));var attributes=require(_0x5c3d('0x4'));module[_0x5c3d('0x5')]=function(_0x5df26c,_0x4cb74e){return _0x5df26c[_0x5c3d('0x6')](_0x5c3d('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x5c3d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 61d48ba..4f2c03a 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 _0x37c5=['include','map','model','then','catch','create','body','raw','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetMemberReport','MemberReport','options','where','attributes','limit'];(function(_0x365308,_0x580610){var _0x37fd1c=function(_0x49ad11){while(--_0x49ad11){_0x365308['push'](_0x365308['shift']());}};_0x37fd1c(++_0x580610);}(_0x37c5,0xa7));var _0x537c=function(_0xaa8f54,_0x3a37fe){_0xaa8f54=_0xaa8f54-0x0;var _0xe9004f=_0x37c5[_0xaa8f54];return _0xe9004f;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var moment=require(_0x537c('0x1'));var BPromise=require(_0x537c('0x2'));var rs=require(_0x537c('0x3'));var fs=require('fs');var Redis=require(_0x537c('0x4'));var db=require(_0x537c('0x5'))['db'];var utils=require(_0x537c('0x6'));var logger=require(_0x537c('0x7'))(_0x537c('0x8'));var config=require(_0x537c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x537c('0xa')][_0x537c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x336920,_0x57666f,_0x36bf4a){return new BPromise(function(_0x67f986,_0x32b9c7){return client[_0x537c('0xc')](_0x336920,_0x36bf4a)['then'](function(_0x2c2f06){logger[_0x537c('0xd')](_0x537c('0xe'),_0x57666f,'request\x20sent');logger[_0x537c('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x57666f,'request\x20sent',JSON[_0x537c('0x10')](_0x2c2f06));if(_0x2c2f06['error']){if(_0x2c2f06[_0x537c('0x11')][_0x537c('0x12')]===0x1f4){logger[_0x537c('0x11')](_0x537c('0xe'),_0x57666f,_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);return _0x32b9c7(_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);}logger[_0x537c('0x11')]('MemberReport,\x20%s,\x20%s',_0x57666f,_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);return _0x67f986(_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);}else{logger[_0x537c('0xd')](_0x537c('0xe'),_0x57666f,_0x537c('0x14'));_0x67f986(_0x2c2f06[_0x537c('0x15')][_0x537c('0x13')]);}})['catch'](function(_0x3ae729){logger['error']('MemberReport,\x20%s,\x20%s',_0x57666f,_0x3ae729);_0x32b9c7(_0x3ae729);});});}exports[_0x537c('0x16')]=function(_0x237be8){var _0x2a890e=this;return new Promise(function(_0x5f3776,_0x28b410){return db[_0x537c('0x17')]['findAll']({'raw':_0x237be8['options']?_0x237be8[_0x537c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x237be8['options']?_0x237be8[_0x537c('0x18')][_0x537c('0x19')]||null:null,'attributes':_0x237be8['options']?_0x237be8[_0x537c('0x18')][_0x537c('0x1a')]||null:null,'limit':_0x237be8['options']?_0x237be8['options'][_0x537c('0x1b')]||null:null,'include':_0x237be8['options']?_0x237be8['options'][_0x537c('0x1c')]?_[_0x537c('0x1d')](_0x237be8[_0x537c('0x18')][_0x537c('0x1c')],function(_0x3698bc){return{'model':db[_0x3698bc[_0x537c('0x1e')]],'as':_0x3698bc['as'],'attributes':_0x3698bc['attributes'],'include':_0x3698bc[_0x537c('0x1c')]?_[_0x537c('0x1d')](_0x3698bc[_0x537c('0x1c')],function(_0xcd7d47){return{'model':db[_0xcd7d47[_0x537c('0x1e')]],'as':_0xcd7d47['as'],'attributes':_0xcd7d47['attributes'],'include':_0xcd7d47['include']?_['map'](_0xcd7d47[_0x537c('0x1c')],function(_0x1fa0ca){return{'model':db[_0x1fa0ca['model']],'as':_0x1fa0ca['as'],'attributes':_0x1fa0ca[_0x537c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x537c('0x1f')](function(_0x1b9ff2){logger['info']('GetMemberReport',_0x237be8);logger[_0x537c('0xf')](_0x537c('0x16'),_0x237be8,JSON[_0x537c('0x10')](_0x1b9ff2));_0x5f3776(_0x1b9ff2);})[_0x537c('0x20')](function(_0x49d60b){logger['error'](_0x537c('0x16'),_0x49d60b[_0x537c('0x13')],_0x237be8);_0x28b410(_0x2a890e['error'](0x1f4,_0x49d60b['message']));});});};exports['CreateMemberReport']=function(_0x49138c){var _0x254996=this;return new Promise(function(_0x433968,_0x3aa9d6){return db['MemberReport'][_0x537c('0x21')](_0x49138c[_0x537c('0x22')],{'raw':_0x49138c[_0x537c('0x18')]?_0x49138c['options'][_0x537c('0x23')]===undefined?!![]:![]:!![]})[_0x537c('0x1f')](function(_0x2aa360){logger['info']('CreateMemberReport',_0x49138c);logger[_0x537c('0xf')](_0x537c('0x24'),_0x49138c,JSON[_0x537c('0x10')](_0x2aa360));_0x433968(_0x2aa360);})[_0x537c('0x20')](function(_0x3e599f){logger[_0x537c('0x11')](_0x537c('0x24'),_0x3e599f[_0x537c('0x13')],_0x49138c);_0x3aa9d6(_0x254996['error'](0x1f4,_0x3e599f['message']));});});};exports[_0x537c('0x25')]=function(_0x46263d){var _0x4c8233=this;return new Promise(function(_0x36d769,_0xf7a818){return db[_0x537c('0x17')][_0x537c('0x26')](_0x46263d[_0x537c('0x22')],{'raw':_0x46263d['options']?_0x46263d[_0x537c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46263d['options']?_0x46263d['options']['where']||null:null,'attributes':_0x46263d[_0x537c('0x18')]?_0x46263d[_0x537c('0x18')][_0x537c('0x1a')]||null:null,'limit':_0x46263d[_0x537c('0x18')]?_0x46263d[_0x537c('0x18')][_0x537c('0x1b')]||null:null})[_0x537c('0x1f')](function(_0xcbc993){logger[_0x537c('0xd')](_0x537c('0x25'),_0x46263d);logger[_0x537c('0xf')](_0x537c('0x25'),_0x46263d,JSON[_0x537c('0x10')](_0xcbc993));_0x36d769(_0xcbc993);})[_0x537c('0x20')](function(_0x5494d3){logger[_0x537c('0x11')]('UpdateMemberReport',_0x5494d3[_0x537c('0x13')],_0x46263d);_0xf7a818(_0x4c8233[_0x537c('0x11')](0x1f4,_0x5494d3['message']));});});}; \ No newline at end of file +var _0x8819=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','model','include','then','CreateMemberReport','create','body','UpdateMemberReport','update'];(function(_0x7cb86c,_0x4d8f03){var _0x443668=function(_0x3aceb8){while(--_0x3aceb8){_0x7cb86c['push'](_0x7cb86c['shift']());}};_0x443668(++_0x4d8f03);}(_0x8819,0x94));var _0x9881=function(_0x283751,_0x4e8391){_0x283751=_0x283751-0x0;var _0x2ac95b=_0x8819[_0x283751];return _0x2ac95b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9881('0x0'));var BPromise=require(_0x9881('0x1'));var rs=require(_0x9881('0x2'));var fs=require('fs');var Redis=require(_0x9881('0x3'));var db=require(_0x9881('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9881('0x5'))(_0x9881('0x6'));var config=require(_0x9881('0x7'));var jayson=require(_0x9881('0x8'));var client=jayson[_0x9881('0x9')][_0x9881('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1d45,_0x353966,_0x4a6471){return new BPromise(function(_0x530547,_0x15c0f8){return client['request'](_0x5f1d45,_0x4a6471)['then'](function(_0x4034f5){logger['info'](_0x9881('0xb'),_0x353966,_0x9881('0xc'));logger[_0x9881('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x353966,_0x9881('0xc'),JSON[_0x9881('0xe')](_0x4034f5));if(_0x4034f5[_0x9881('0xf')]){if(_0x4034f5[_0x9881('0xf')]['code']===0x1f4){logger[_0x9881('0xf')](_0x9881('0xb'),_0x353966,_0x4034f5['error'][_0x9881('0x10')]);return _0x15c0f8(_0x4034f5['error']['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x353966,_0x4034f5[_0x9881('0xf')][_0x9881('0x10')]);return _0x530547(_0x4034f5[_0x9881('0xf')][_0x9881('0x10')]);}else{logger[_0x9881('0x11')](_0x9881('0xb'),_0x353966,'request\x20sent');_0x530547(_0x4034f5[_0x9881('0x12')][_0x9881('0x10')]);}})[_0x9881('0x13')](function(_0x47975d){logger['error']('MemberReport,\x20%s,\x20%s',_0x353966,_0x47975d);_0x15c0f8(_0x47975d);});});}exports[_0x9881('0x14')]=function(_0x4c3493){var _0x620a9a=this;return new Promise(function(_0x5a9848,_0x59ff56){return db[_0x9881('0x15')][_0x9881('0x16')]({'raw':_0x4c3493[_0x9881('0x17')]?_0x4c3493[_0x9881('0x17')][_0x9881('0x18')]===undefined?!![]:![]:!![],'where':_0x4c3493[_0x9881('0x17')]?_0x4c3493[_0x9881('0x17')][_0x9881('0x19')]||null:null,'attributes':_0x4c3493[_0x9881('0x17')]?_0x4c3493[_0x9881('0x17')][_0x9881('0x1a')]||null:null,'limit':_0x4c3493[_0x9881('0x17')]?_0x4c3493[_0x9881('0x17')][_0x9881('0x1b')]||null:null,'include':_0x4c3493[_0x9881('0x17')]?_0x4c3493['options']['include']?_[_0x9881('0x1c')](_0x4c3493['options']['include'],function(_0x1ba558){return{'model':db[_0x1ba558[_0x9881('0x1d')]],'as':_0x1ba558['as'],'attributes':_0x1ba558['attributes'],'include':_0x1ba558['include']?_[_0x9881('0x1c')](_0x1ba558['include'],function(_0x2bddc1){return{'model':db[_0x2bddc1[_0x9881('0x1d')]],'as':_0x2bddc1['as'],'attributes':_0x2bddc1[_0x9881('0x1a')],'include':_0x2bddc1[_0x9881('0x1e')]?_[_0x9881('0x1c')](_0x2bddc1[_0x9881('0x1e')],function(_0x2f6b7c){return{'model':db[_0x2f6b7c[_0x9881('0x1d')]],'as':_0x2f6b7c['as'],'attributes':_0x2f6b7c[_0x9881('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9881('0x1f')](function(_0x900eae){logger[_0x9881('0x11')](_0x9881('0x14'),_0x4c3493);logger['debug'](_0x9881('0x14'),_0x4c3493,JSON[_0x9881('0xe')](_0x900eae));_0x5a9848(_0x900eae);})['catch'](function(_0x236979){logger[_0x9881('0xf')]('GetMemberReport',_0x236979[_0x9881('0x10')],_0x4c3493);_0x59ff56(_0x620a9a[_0x9881('0xf')](0x1f4,_0x236979[_0x9881('0x10')]));});});};exports[_0x9881('0x20')]=function(_0x3567dc){var _0x383ff0=this;return new Promise(function(_0x225a4c,_0x2d2b65){return db['MemberReport'][_0x9881('0x21')](_0x3567dc[_0x9881('0x22')],{'raw':_0x3567dc[_0x9881('0x17')]?_0x3567dc[_0x9881('0x17')][_0x9881('0x18')]===undefined?!![]:![]:!![]})[_0x9881('0x1f')](function(_0x495ee0){logger[_0x9881('0x11')](_0x9881('0x20'),_0x3567dc);logger['debug'](_0x9881('0x20'),_0x3567dc,JSON[_0x9881('0xe')](_0x495ee0));_0x225a4c(_0x495ee0);})[_0x9881('0x13')](function(_0x101e6e){logger[_0x9881('0xf')]('CreateMemberReport',_0x101e6e[_0x9881('0x10')],_0x3567dc);_0x2d2b65(_0x383ff0[_0x9881('0xf')](0x1f4,_0x101e6e[_0x9881('0x10')]));});});};exports[_0x9881('0x23')]=function(_0x2ffca7){var _0x28abfc=this;return new Promise(function(_0x2028fc,_0x250987){return db[_0x9881('0x15')][_0x9881('0x24')](_0x2ffca7[_0x9881('0x22')],{'raw':_0x2ffca7[_0x9881('0x17')]?_0x2ffca7[_0x9881('0x17')][_0x9881('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ffca7[_0x9881('0x17')]?_0x2ffca7[_0x9881('0x17')]['where']||null:null,'attributes':_0x2ffca7[_0x9881('0x17')]?_0x2ffca7['options'][_0x9881('0x1a')]||null:null,'limit':_0x2ffca7['options']?_0x2ffca7[_0x9881('0x17')][_0x9881('0x1b')]||null:null})['then'](function(_0xdb4936){logger['info'](_0x9881('0x23'),_0x2ffca7);logger[_0x9881('0xd')](_0x9881('0x23'),_0x2ffca7,JSON[_0x9881('0xe')](_0xdb4936));_0x2028fc(_0xdb4936);})['catch'](function(_0x2b2a0b){logger[_0x9881('0xf')](_0x9881('0x23'),_0x2b2a0b[_0x9881('0x10')],_0x2ffca7);_0x250987(_0x28abfc[_0x9881('0xf')](0x1f4,_0x2b2a0b[_0x9881('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 9400c3b..da936d7 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 _0x35f9=['index','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0x35f9,0x1df));var _0x935f=function(_0x5d5b63,_0x50137d){_0x5d5b63=_0x5d5b63-0x0;var _0x30908d=_0x35f9[_0x5d5b63];return _0x30908d;};'use strict';var multer=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var path=require(_0x935f('0x2'));var timeout=require(_0x935f('0x3'));var express=require('express');var router=express[_0x935f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var controller=require('./migration.controller');router['get']('/',controller[_0x935f('0x7')]);module[_0x935f('0x8')]=router; \ No newline at end of file +var _0x692a=['exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x20a49c,_0x40f164){var _0xe01a7a=function(_0x18b57a){while(--_0x18b57a){_0x20a49c['push'](_0x20a49c['shift']());}};_0xe01a7a(++_0x40f164);}(_0x692a,0x12a));var _0xa692=function(_0x386f78,_0x71e34c){_0x386f78=_0x386f78-0x0;var _0x3a3fbf=_0x692a[_0x386f78];return _0x3a3fbf;};'use strict';var multer=require(_0xa692('0x0'));var util=require(_0xa692('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa692('0x2'));var router=express[_0xa692('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa692('0x4'));var config=require(_0xa692('0x5'));var controller=require(_0xa692('0x6'));router[_0xa692('0x7')]('/',controller['index']);module[_0xa692('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b4c7a42..59afb30 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 _0xb868=['sequelize','exports','version'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xb868,0xc3));var _0x8b86=function(_0x98044c,_0x317684){_0x98044c=_0x98044c-0x0;var _0x377c6a=_0xb868[_0x98044c];return _0x377c6a;};'use strict';var Sequelize=require(_0x8b86('0x0'));module[_0x8b86('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x8b86('0x2')}}; \ No newline at end of file +var _0x5106=['STRING','version','sequelize'];(function(_0x26bf7a,_0x4eda9c){var _0x5af0d3=function(_0x204c81){while(--_0x204c81){_0x26bf7a['push'](_0x26bf7a['shift']());}};_0x5af0d3(++_0x4eda9c);}(_0x5106,0x83));var _0x6510=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5106[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6510('0x0'));module['exports']={'version':{'type':Sequelize[_0x6510('0x1')],'unique':_0x6510('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1076866..b6c4ef4 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 _0x03f4=['filters','pick','filter','merge','VIRTUAL','name','Migration','findAll','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','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','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x5cc960,_0xcf70f){var _0x53d349=function(_0x473769){while(--_0x473769){_0x5cc960['push'](_0x5cc960['shift']());}};_0x53d349(++_0xcf70f);}(_0x03f4,0xc9));var _0x403f=function(_0x397ac8,_0x5ac743){_0x397ac8=_0x397ac8-0x0;var _0x5c5bb2=_0x03f4[_0x397ac8];return _0x5c5bb2;};'use strict';var emlformat=require(_0x403f('0x0'));var rimraf=require(_0x403f('0x1'));var zipdir=require(_0x403f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x403f('0x3'));var moment=require(_0x403f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x403f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x403f('0x6'));var csv=require('to-csv');var ejs=require(_0x403f('0x7'));var fs=require('fs');var fs_extra=require(_0x403f('0x8'));var _=require(_0x403f('0x9'));var squel=require(_0x403f('0xa'));var crypto=require(_0x403f('0xb'));var jsforce=require(_0x403f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x403f('0xd'));var Papa=require(_0x403f('0xe'));var Redis=require(_0x403f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x403f('0x10'));var as=require(_0x403f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x403f('0x12'))(_0x403f('0x13'));var utils=require(_0x403f('0x14'));var config=require(_0x403f('0x15'));var licenseUtil=require(_0x403f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68dcaa,_0x109929){_0x109929=_0x109929||0xcc;return function(_0x355cbe){if(_0x355cbe){return _0x68dcaa[_0x403f('0x17')](_0x109929);}return _0x68dcaa[_0x403f('0x18')](_0x109929)[_0x403f('0x19')]();};}function respondWithResult(_0x1ece4f,_0x522a49){_0x522a49=_0x522a49||0xc8;return function(_0xc73458){if(_0xc73458){return _0x1ece4f[_0x403f('0x18')](_0x522a49)[_0x403f('0x1a')](_0xc73458);}};}function respondWithFilteredResult(_0x5a4e51,_0x9cf2d0){return function(_0x347c6b){if(_0x347c6b){var _0x4b766=typeof _0x9cf2d0['offset']==='undefined'&&typeof _0x9cf2d0[_0x403f('0x1b')]==='undefined';var _0xb08d59=_0x347c6b[_0x403f('0x1c')];var _0x5a480f=_0x4b766?0x0:_0x9cf2d0[_0x403f('0x1d')];var _0x55fac9=_0x4b766?_0x347c6b[_0x403f('0x1c')]:_0x9cf2d0[_0x403f('0x1d')]+_0x9cf2d0[_0x403f('0x1b')];var _0x481202;if(_0x55fac9>=_0xb08d59){_0x55fac9=_0xb08d59;_0x481202=0xc8;}else{_0x481202=0xce;}_0x5a4e51[_0x403f('0x18')](_0x481202);return _0x5a4e51[_0x403f('0x1e')](_0x403f('0x1f'),_0x5a480f+'-'+_0x55fac9+'/'+_0xb08d59)['json'](_0x347c6b);}return null;};}function patchUpdates(_0xa1fbae){return function(_0x5336b8){try{jsonpatch[_0x403f('0x20')](_0x5336b8,_0xa1fbae,!![]);}catch(_0xcd8942){return BPromise['reject'](_0xcd8942);}return _0x5336b8[_0x403f('0x21')]();};}function saveUpdates(_0x336712,_0x111b17){return function(_0xcd184b){if(_0xcd184b){return _0xcd184b[_0x403f('0x22')](_0x336712)[_0x403f('0x23')](function(_0x3575b6){return _0x3575b6;});}return null;};}function removeEntity(_0x2a83ab,_0x54cc48){return function(_0x5f2b5c){if(_0x5f2b5c){return _0x5f2b5c[_0x403f('0x24')]()[_0x403f('0x23')](function(){_0x2a83ab['status'](0xcc)[_0x403f('0x19')]();});}};}function handleEntityNotFound(_0x36c410,_0x2fd05e){return function(_0x2ad005){if(!_0x2ad005){_0x36c410['sendStatus'](0x194);}return _0x2ad005;};}function handleError(_0x4b69d4,_0x5e101b){_0x5e101b=_0x5e101b||0x1f4;return function(_0xe7000){logger[_0x403f('0x25')](_0xe7000['stack']);if(_0xe7000['name']){delete _0xe7000['name'];}_0x4b69d4[_0x403f('0x18')](_0x5e101b)[_0x403f('0x26')](_0xe7000);};}exports['index']=function(_0x4c7f24,_0x2dc2a7){var _0x260a56={},_0x3016a6={},_0x56886a={'count':0x0,'rows':[]};var _0x5088bd=_[_0x403f('0x27')](db['Migration'][_0x403f('0x28')],function(_0xe91d88){return{'name':_0xe91d88[_0x403f('0x29')],'type':_0xe91d88[_0x403f('0x2a')][_0x403f('0x2b')]};});_0x3016a6[_0x403f('0x2c')]=_[_0x403f('0x27')](_0x5088bd,'name');_0x3016a6[_0x403f('0x2d')]=_[_0x403f('0x2e')](_0x4c7f24[_0x403f('0x2d')]);_0x3016a6['filters']=_['intersection'](_0x3016a6[_0x403f('0x2c')],_0x3016a6[_0x403f('0x2d')]);_0x260a56[_0x403f('0x2f')]=_[_0x403f('0x30')](_0x3016a6['model'],qs[_0x403f('0x31')](_0x4c7f24[_0x403f('0x2d')][_0x403f('0x31')]));_0x260a56[_0x403f('0x2f')]=_0x260a56[_0x403f('0x2f')][_0x403f('0x32')]?_0x260a56[_0x403f('0x2f')]:_0x3016a6['model'];if(!_0x4c7f24[_0x403f('0x2d')][_0x403f('0x33')]('nolimit')){_0x260a56['limit']=qs['limit'](_0x4c7f24[_0x403f('0x2d')][_0x403f('0x1b')]);_0x260a56['offset']=qs[_0x403f('0x1d')](_0x4c7f24[_0x403f('0x2d')][_0x403f('0x1d')]);}_0x260a56[_0x403f('0x34')]=qs[_0x403f('0x35')](_0x4c7f24[_0x403f('0x2d')][_0x403f('0x35')]);_0x260a56[_0x403f('0x36')]=qs[_0x403f('0x37')](_[_0x403f('0x38')](_0x4c7f24[_0x403f('0x2d')],_0x3016a6[_0x403f('0x37')]),_0x5088bd);if(_0x4c7f24[_0x403f('0x2d')][_0x403f('0x39')]){_0x260a56[_0x403f('0x36')]=_[_0x403f('0x3a')](_0x260a56['where'],{'$or':_[_0x403f('0x27')](_0x5088bd,function(_0x86bcbb){if(_0x86bcbb['type']!==_0x403f('0x3b')){var _0x3c5f68={};_0x3c5f68[_0x86bcbb[_0x403f('0x3c')]]={'$like':'%'+_0x4c7f24[_0x403f('0x2d')]['filter']+'%'};return _0x3c5f68;}})});}_0x260a56=_[_0x403f('0x3a')]({},_0x260a56,_0x4c7f24['options']);var _0x394696={'where':_0x260a56[_0x403f('0x36')]};return db[_0x403f('0x3d')]['count'](_0x394696)[_0x403f('0x23')](function(_0x5405f9){_0x56886a['count']=_0x5405f9;if(_0x4c7f24[_0x403f('0x2d')]['includeAll']){_0x260a56['include']=[{'all':!![]}];}return db['Migration'][_0x403f('0x3e')](_0x260a56);})[_0x403f('0x23')](function(_0x3be853){_0x56886a['rows']=_0x3be853;return _0x56886a;})[_0x403f('0x23')](respondWithFilteredResult(_0x2dc2a7,_0x260a56))[_0x403f('0x3f')](handleError(_0x2dc2a7,null));}; \ No newline at end of file +var _0xac1e=['error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','Migration','includeAll','include','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x4b9b5f,_0x31684c){var _0x5452d9=function(_0x387acf){while(--_0x387acf){_0x4b9b5f['push'](_0x4b9b5f['shift']());}};_0x5452d9(++_0x31684c);}(_0xac1e,0x9e));var _0xeac1=function(_0x331827,_0x1096b5){_0x331827=_0x331827-0x0;var _0x38a5fe=_0xac1e[_0x331827];return _0x38a5fe;};'use strict';var emlformat=require(_0xeac1('0x0'));var rimraf=require(_0xeac1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeac1('0x2'));var rp=require(_0xeac1('0x3'));var moment=require(_0xeac1('0x4'));var BPromise=require(_0xeac1('0x5'));var Mustache=require(_0xeac1('0x6'));var util=require(_0xeac1('0x7'));var path=require('path');var sox=require(_0xeac1('0x8'));var csv=require('to-csv');var ejs=require(_0xeac1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeac1('0xa'));var squel=require(_0xeac1('0xb'));var crypto=require(_0xeac1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeac1('0xd'));var toCsv=require(_0xeac1('0xe'));var querystring=require('querystring');var Papa=require(_0xeac1('0xf'));var Redis=require('ioredis');var authService=require(_0xeac1('0x10'));var qs=require(_0xeac1('0x11'));var as=require(_0xeac1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeac1('0x13'))('api');var utils=require(_0xeac1('0x14'));var config=require(_0xeac1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeac1('0x16'))['db'];function respondWithStatusCode(_0x16b60b,_0x3b1d1e){_0x3b1d1e=_0x3b1d1e||0xcc;return function(_0x29b0c8){if(_0x29b0c8){return _0x16b60b[_0xeac1('0x17')](_0x3b1d1e);}return _0x16b60b[_0xeac1('0x18')](_0x3b1d1e)[_0xeac1('0x19')]();};}function respondWithResult(_0x22b7e9,_0x3b9cec){_0x3b9cec=_0x3b9cec||0xc8;return function(_0x18afe7){if(_0x18afe7){return _0x22b7e9['status'](_0x3b9cec)[_0xeac1('0x1a')](_0x18afe7);}};}function respondWithFilteredResult(_0x2084c3,_0x223e07){return function(_0x579b8e){if(_0x579b8e){var _0x3fa1e1=typeof _0x223e07['offset']===_0xeac1('0x1b')&&typeof _0x223e07[_0xeac1('0x1c')]===_0xeac1('0x1b');var _0x4f2bf9=_0x579b8e[_0xeac1('0x1d')];var _0x25c266=_0x3fa1e1?0x0:_0x223e07[_0xeac1('0x1e')];var _0xeef2d0=_0x3fa1e1?_0x579b8e[_0xeac1('0x1d')]:_0x223e07[_0xeac1('0x1e')]+_0x223e07[_0xeac1('0x1c')];var _0x23b5e7;if(_0xeef2d0>=_0x4f2bf9){_0xeef2d0=_0x4f2bf9;_0x23b5e7=0xc8;}else{_0x23b5e7=0xce;}_0x2084c3[_0xeac1('0x18')](_0x23b5e7);return _0x2084c3[_0xeac1('0x1f')]('Content-Range',_0x25c266+'-'+_0xeef2d0+'/'+_0x4f2bf9)['json'](_0x579b8e);}return null;};}function patchUpdates(_0x5e04c3){return function(_0x168af0){try{jsonpatch[_0xeac1('0x20')](_0x168af0,_0x5e04c3,!![]);}catch(_0x1c8692){return BPromise[_0xeac1('0x21')](_0x1c8692);}return _0x168af0[_0xeac1('0x22')]();};}function saveUpdates(_0x395514,_0x189dbb){return function(_0x16202b){if(_0x16202b){return _0x16202b[_0xeac1('0x23')](_0x395514)['then'](function(_0x60306d){return _0x60306d;});}return null;};}function removeEntity(_0x19c482,_0x269693){return function(_0x31b9b6){if(_0x31b9b6){return _0x31b9b6['destroy']()[_0xeac1('0x24')](function(){_0x19c482[_0xeac1('0x18')](0xcc)[_0xeac1('0x19')]();});}};}function handleEntityNotFound(_0x580bf4,_0x2939d5){return function(_0x5111b9){if(!_0x5111b9){_0x580bf4[_0xeac1('0x17')](0x194);}return _0x5111b9;};}function handleError(_0x366e8c,_0x2b882e){_0x2b882e=_0x2b882e||0x1f4;return function(_0x1b6d16){logger[_0xeac1('0x25')](_0x1b6d16[_0xeac1('0x26')]);if(_0x1b6d16['name']){delete _0x1b6d16[_0xeac1('0x27')];}_0x366e8c[_0xeac1('0x18')](_0x2b882e)[_0xeac1('0x28')](_0x1b6d16);};}exports['index']=function(_0x394ee8,_0x4ac833){var _0x1dba65={},_0x3cbc25={},_0x2a3c05={'count':0x0,'rows':[]};var _0xc0687c=_[_0xeac1('0x29')](db['Migration'][_0xeac1('0x2a')],function(_0x3ff9f9){return{'name':_0x3ff9f9[_0xeac1('0x2b')],'type':_0x3ff9f9[_0xeac1('0x2c')][_0xeac1('0x2d')]};});_0x3cbc25[_0xeac1('0x2e')]=_[_0xeac1('0x29')](_0xc0687c,_0xeac1('0x27'));_0x3cbc25['query']=_[_0xeac1('0x2f')](_0x394ee8[_0xeac1('0x30')]);_0x3cbc25['filters']=_[_0xeac1('0x31')](_0x3cbc25[_0xeac1('0x2e')],_0x3cbc25[_0xeac1('0x30')]);_0x1dba65[_0xeac1('0x32')]=_['intersection'](_0x3cbc25['model'],qs[_0xeac1('0x33')](_0x394ee8[_0xeac1('0x30')][_0xeac1('0x33')]));_0x1dba65[_0xeac1('0x32')]=_0x1dba65[_0xeac1('0x32')][_0xeac1('0x34')]?_0x1dba65[_0xeac1('0x32')]:_0x3cbc25[_0xeac1('0x2e')];if(!_0x394ee8[_0xeac1('0x30')][_0xeac1('0x35')](_0xeac1('0x36'))){_0x1dba65[_0xeac1('0x1c')]=qs[_0xeac1('0x1c')](_0x394ee8['query'][_0xeac1('0x1c')]);_0x1dba65[_0xeac1('0x1e')]=qs['offset'](_0x394ee8['query']['offset']);}_0x1dba65['order']=qs['sort'](_0x394ee8[_0xeac1('0x30')][_0xeac1('0x37')]);_0x1dba65[_0xeac1('0x38')]=qs[_0xeac1('0x39')](_['pick'](_0x394ee8[_0xeac1('0x30')],_0x3cbc25[_0xeac1('0x39')]),_0xc0687c);if(_0x394ee8[_0xeac1('0x30')][_0xeac1('0x3a')]){_0x1dba65['where']=_['merge'](_0x1dba65['where'],{'$or':_[_0xeac1('0x29')](_0xc0687c,function(_0x2782bc){if(_0x2782bc[_0xeac1('0x2c')]!=='VIRTUAL'){var _0x224e64={};_0x224e64[_0x2782bc[_0xeac1('0x27')]]={'$like':'%'+_0x394ee8[_0xeac1('0x30')]['filter']+'%'};return _0x224e64;}})});}_0x1dba65=_[_0xeac1('0x3b')]({},_0x1dba65,_0x394ee8[_0xeac1('0x3c')]);var _0x2714af={'where':_0x1dba65[_0xeac1('0x38')]};return db[_0xeac1('0x3d')]['count'](_0x2714af)[_0xeac1('0x24')](function(_0x5a578c){_0x2a3c05[_0xeac1('0x1d')]=_0x5a578c;if(_0x394ee8[_0xeac1('0x30')][_0xeac1('0x3e')]){_0x1dba65[_0xeac1('0x3f')]=[{'all':!![]}];}return db['Migration'][_0xeac1('0x40')](_0x1dba65);})[_0xeac1('0x24')](function(_0x47162f){_0x2a3c05['rows']=_0x47162f;return _0x2a3c05;})[_0xeac1('0x24')](respondWithFilteredResult(_0x4ac833,_0x1dba65))['catch'](handleError(_0x4ac833,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 43bacac..d34ae49 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 _0x414b=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x21c40d,_0x23945d){var _0x2e9d4f=function(_0x6ed2dd){while(--_0x6ed2dd){_0x21c40d['push'](_0x21c40d['shift']());}};_0x2e9d4f(++_0x23945d);}(_0x414b,0x103));var _0xb414=function(_0x1208ca,_0x4dae2c){_0x1208ca=_0x1208ca-0x0;var _0xa5ca35=_0x414b[_0x1208ca];return _0xa5ca35;};'use strict';var _=require(_0xb414('0x0'));var util=require(_0xb414('0x1'));var logger=require(_0xb414('0x2'))('api');var moment=require(_0xb414('0x3'));var BPromise=require(_0xb414('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb414('0x5'));var rimraf=require(_0xb414('0x6'));var config=require(_0xb414('0x7'));var attributes=require(_0xb414('0x8'));module[_0xb414('0x9')]=function(_0x31b864,_0x2e6b4e){return _0x31b864[_0xb414('0xa')](_0xb414('0xb'),attributes,{'tableName':_0xb414('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0299=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0299,0x1b0));var _0x9029=function(_0x2698a8,_0x551f2d){_0x2698a8=_0x2698a8-0x0;var _0x56138d=_0x0299[_0x2698a8];return _0x56138d;};'use strict';var _=require(_0x9029('0x0'));var util=require('util');var logger=require(_0x9029('0x1'))(_0x9029('0x2'));var moment=require('moment');var BPromise=require(_0x9029('0x3'));var rp=require(_0x9029('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9029('0x5'));var config=require(_0x9029('0x6'));var attributes=require(_0x9029('0x7'));module[_0x9029('0x8')]=function(_0x5a1b0a,_0x5cc90e){return _0x5a1b0a[_0x9029('0x9')](_0x9029('0xa'),attributes,{'tableName':_0x9029('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index efbf9fd..3fc3d6f 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 _0xdeb7=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x13196a,_0xd26415){var _0x37f274=function(_0x1da490){while(--_0x1da490){_0x13196a['push'](_0x13196a['shift']());}};_0x37f274(++_0xd26415);}(_0xdeb7,0x77));var _0x7deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var moment=require(_0x7deb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7deb('0x3'));var fs=require('fs');var Redis=require(_0x7deb('0x4'));var db=require(_0x7deb('0x5'))['db'];var utils=require(_0x7deb('0x6'));var logger=require(_0x7deb('0x7'))('rpc');var config=require(_0x7deb('0x8'));var jayson=require(_0x7deb('0x9'));var client=jayson[_0x7deb('0xa')][_0x7deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d4de9,_0x1a5058,_0x4e3d14){return new BPromise(function(_0xfa72b7,_0x366e44){return client[_0x7deb('0xc')](_0x1d4de9,_0x4e3d14)[_0x7deb('0xd')](function(_0x5bdde4){logger[_0x7deb('0xe')]('Migration,\x20%s,\x20%s',_0x1a5058,'request\x20sent');logger[_0x7deb('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x1a5058,_0x7deb('0x10'),JSON[_0x7deb('0x11')](_0x5bdde4));if(_0x5bdde4[_0x7deb('0x12')]){if(_0x5bdde4['error'][_0x7deb('0x13')]===0x1f4){logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')]['message']);return _0x366e44(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);return _0xfa72b7(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}else{logger[_0x7deb('0xe')](_0x7deb('0x14'),_0x1a5058,_0x7deb('0x10'));_0xfa72b7(_0x5bdde4[_0x7deb('0x16')][_0x7deb('0x15')]);}})[_0x7deb('0x17')](function(_0xbe8e2a){logger['error'](_0x7deb('0x14'),_0x1a5058,_0xbe8e2a);_0x366e44(_0xbe8e2a);});});} \ No newline at end of file +var _0x3b75=['http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0x3b75,0xdc));var _0x53b7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x3b75[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 447f728..36808f8 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 _0xe5a6=['../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5a114f,_0xaf51f5){var _0x5af324=function(_0x51c5e1){while(--_0x51c5e1){_0x5a114f['push'](_0x5a114f['shift']());}};_0x5af324(++_0xaf51f5);}(_0xe5a6,0x104));var _0x6e5a=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0xe5a6[_0x1b1365];return _0x5edfd8;};'use strict';var multer=require(_0x6e5a('0x0'));var util=require(_0x6e5a('0x1'));var path=require(_0x6e5a('0x2'));var timeout=require(_0x6e5a('0x3'));var express=require(_0x6e5a('0x4'));var router=express[_0x6e5a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6e5a('0x6'));var interaction=require(_0x6e5a('0x7'));var config=require('../../config/environment');var controller=require(_0x6e5a('0x8'));router[_0x6e5a('0x9')]('/',auth[_0x6e5a('0xa')](),controller[_0x6e5a('0xb')]);router[_0x6e5a('0x9')](_0x6e5a('0xc'),auth[_0x6e5a('0xa')](),controller[_0x6e5a('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6e5a('0xe')]('/:id',auth[_0x6e5a('0xa')](),controller[_0x6e5a('0xf')]);router[_0x6e5a('0x10')](_0x6e5a('0xc'),auth['isAuthenticated'](),controller[_0x6e5a('0x11')]);module[_0x6e5a('0x12')]=router; \ No newline at end of file +var _0x151b=['express','Router','../../components/auth/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5baa73,_0x6b9597){var _0x2745de=function(_0x58f609){while(--_0x58f609){_0x5baa73['push'](_0x5baa73['shift']());}};_0x2745de(++_0x6b9597);}(_0x151b,0x152));var _0xb151=function(_0x4483d2,_0x29a99b){_0x4483d2=_0x4483d2-0x0;var _0x47b79e=_0x151b[_0x4483d2];return _0x47b79e;};'use strict';var multer=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var path=require(_0xb151('0x2'));var timeout=require(_0xb151('0x3'));var express=require(_0xb151('0x4'));var router=express[_0xb151('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb151('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb151('0x7'));var controller=require(_0xb151('0x8'));router[_0xb151('0x9')]('/',auth['isAuthenticated'](),controller[_0xb151('0xa')]);router[_0xb151('0x9')]('/:id',auth[_0xb151('0xb')](),controller[_0xb151('0xc')]);router['post']('/',auth[_0xb151('0xb')](),controller[_0xb151('0xd')]);router['put'](_0xb151('0xe'),auth[_0xb151('0xb')](),controller[_0xb151('0xf')]);router[_0xb151('0x10')](_0xb151('0xe'),auth['isAuthenticated'](),controller[_0xb151('0x11')]);module[_0xb151('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 42c52d3..4eb8ce1 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 _0x7f73=['localnet','externip','stun','turn','STRING','exports','ENUM'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x7f73,0x178));var _0x37f7=function(_0xd3c771,_0x356210){_0xd3c771=_0xd3c771-0x0;var _0xdbb5ff=_0x7f73[_0xd3c771];return _0xdbb5ff;};'use strict';var Sequelize=require('sequelize');module[_0x37f7('0x0')]={'type':{'type':Sequelize[_0x37f7('0x1')](_0x37f7('0x2'),_0x37f7('0x3'),_0x37f7('0x4'),_0x37f7('0x5'))},'value':{'type':Sequelize[_0x37f7('0x6')]},'username':{'type':Sequelize[_0x37f7('0x6')]},'password':{'type':Sequelize[_0x37f7('0x6')]}}; \ No newline at end of file +var _0xa713=['externip','stun','turn','STRING','exports','ENUM','localnet'];(function(_0x5bd352,_0x581651){var _0x3539b1=function(_0x423942){while(--_0x423942){_0x5bd352['push'](_0x5bd352['shift']());}};_0x3539b1(++_0x581651);}(_0xa713,0x66));var _0x3a71=function(_0x26c968,_0x2d0c2d){_0x26c968=_0x26c968-0x0;var _0x2edb6a=_0xa713[_0x26c968];return _0x2edb6a;};'use strict';var Sequelize=require('sequelize');module[_0x3a71('0x0')]={'type':{'type':Sequelize[_0x3a71('0x1')](_0x3a71('0x2'),_0x3a71('0x3'),_0x3a71('0x4'),_0x3a71('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3a71('0x6')]},'password':{'type':Sequelize[_0x3a71('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 40c0ad7..3e141f3 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 _0x7af2=['server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','Network','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','params','keys','include','find','create','sequelize','transaction','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','Reload','res_stun_monitor.so','TURN','writeFileSync'];(function(_0x424ec3,_0x340cb0){var _0x506783=function(_0x18b0aa){while(--_0x18b0aa){_0x424ec3['push'](_0x424ec3['shift']());}};_0x506783(++_0x340cb0);}(_0x7af2,0x1b5));var _0x27af=function(_0x4df840,_0x3cd8b8){_0x4df840=_0x4df840-0x0;var _0x3df0ac=_0x7af2[_0x4df840];return _0x3df0ac;};'use strict';var emlformat=require(_0x27af('0x0'));var rimraf=require(_0x27af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require(_0x27af('0x4'));var BPromise=require(_0x27af('0x5'));var Mustache=require(_0x27af('0x6'));var util=require(_0x27af('0x7'));var path=require(_0x27af('0x8'));var sox=require(_0x27af('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27af('0xa'));var _=require(_0x27af('0xb'));var squel=require(_0x27af('0xc'));var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require(_0x27af('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x27af('0x11'));var authService=require(_0x27af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27af('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x27af('0x14'));var utils=require(_0x27af('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x27af('0x16'));var db=require(_0x27af('0x17'))['db'];var jayson=require(_0x27af('0x18'));var client=jayson[_0x27af('0x19')][_0x27af('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5458ed,_0x3434de,_0x21368d,_0x284d58){return new BPromise(function(_0x4bc647,_0x4cc65b){var _0x54a8f4=_0x284d58||client;return _0x54a8f4[_0x27af('0x1b')](_0x5458ed,_0x21368d)[_0x27af('0x1c')](function(_0x2761fe){logger[_0x27af('0x1d')](_0x27af('0x1e'),_0x3434de,_0x27af('0x1f'));logger[_0x27af('0x20')](_0x27af('0x21'),_0x3434de,_0x27af('0x1f'),JSON[_0x27af('0x22')](_0x2761fe));if(_0x2761fe[_0x27af('0x23')]){if(_0x2761fe[_0x27af('0x23')][_0x27af('0x24')]===0x1f4){logger[_0x27af('0x23')](_0x27af('0x1e'),_0x3434de,_0x2761fe[_0x27af('0x23')]['message']);return _0x4cc65b(_0x2761fe[_0x27af('0x23')][_0x27af('0x25')]);}logger[_0x27af('0x23')](_0x27af('0x1e'),_0x3434de,_0x2761fe[_0x27af('0x23')]['message']);return _0x4bc647(_0x2761fe[_0x27af('0x23')][_0x27af('0x25')]);}else{logger[_0x27af('0x1d')](_0x27af('0x1e'),_0x3434de,_0x27af('0x1f'));_0x4bc647(_0x2761fe['result']['message']);}})[_0x27af('0x26')](function(_0x38dd63){logger[_0x27af('0x23')]('Network,\x20%s,\x20%s',_0x3434de,_0x38dd63);_0x4cc65b(_0x38dd63);});});}function respondWithStatusCode(_0x4fc3d5,_0x19e5bf){_0x19e5bf=_0x19e5bf||0xcc;return function(_0x40ee42){if(_0x40ee42){return _0x4fc3d5[_0x27af('0x27')](_0x19e5bf);}return _0x4fc3d5[_0x27af('0x28')](_0x19e5bf)[_0x27af('0x29')]();};}function respondWithResult(_0x32d541,_0xf81d4b){_0xf81d4b=_0xf81d4b||0xc8;return function(_0x10c4aa){if(_0x10c4aa){return _0x32d541['status'](_0xf81d4b)[_0x27af('0x2a')](_0x10c4aa);}};}function respondWithFilteredResult(_0x51ec8d,_0x55ecb6){return function(_0x3bff4b){if(_0x3bff4b){var _0x1fd995=typeof _0x55ecb6[_0x27af('0x2b')]===_0x27af('0x2c')&&typeof _0x55ecb6[_0x27af('0x2d')]==='undefined';var _0x3cd36e=_0x3bff4b[_0x27af('0x2e')];var _0x1e71f5=_0x1fd995?0x0:_0x55ecb6[_0x27af('0x2b')];var _0x44eabf=_0x1fd995?_0x3bff4b['count']:_0x55ecb6[_0x27af('0x2b')]+_0x55ecb6['limit'];var _0x1b941a;if(_0x44eabf>=_0x3cd36e){_0x44eabf=_0x3cd36e;_0x1b941a=0xc8;}else{_0x1b941a=0xce;}_0x51ec8d['status'](_0x1b941a);return _0x51ec8d[_0x27af('0x2f')](_0x27af('0x30'),_0x1e71f5+'-'+_0x44eabf+'/'+_0x3cd36e)[_0x27af('0x2a')](_0x3bff4b);}return null;};}function patchUpdates(_0x4504bf){return function(_0x47c77d){try{jsonpatch[_0x27af('0x31')](_0x47c77d,_0x4504bf,!![]);}catch(_0x894526){return BPromise['reject'](_0x894526);}return _0x47c77d[_0x27af('0x32')]();};}function saveUpdates(_0x165f7d,_0x3342ed){return function(_0x2bbc48){if(_0x2bbc48){return _0x2bbc48[_0x27af('0x33')](_0x165f7d)[_0x27af('0x1c')](function(_0x20e8da){return _0x20e8da;});}return null;};}function removeEntity(_0x47b4ec,_0x4174d1){return function(_0x5af378){if(_0x5af378){return _0x5af378[_0x27af('0x34')]()['then'](function(){_0x47b4ec['status'](0xcc)[_0x27af('0x29')]();});}};}function handleEntityNotFound(_0x488eac,_0x417505){return function(_0x4de9e9){if(!_0x4de9e9){_0x488eac['sendStatus'](0x194);}return _0x4de9e9;};}function handleError(_0xc15d25,_0x4d7f1f){_0x4d7f1f=_0x4d7f1f||0x1f4;return function(_0xe5808c){logger[_0x27af('0x23')](_0xe5808c[_0x27af('0x35')]);if(_0xe5808c[_0x27af('0x36')]){delete _0xe5808c[_0x27af('0x36')];}_0xc15d25['status'](_0x4d7f1f)[_0x27af('0x37')](_0xe5808c);};}exports['index']=function(_0x20affa,_0x4595fd){var _0x1be3bc={},_0x3b589b={},_0x15bb25={'count':0x0,'rows':[]};var _0x916af4=_[_0x27af('0x38')](db[_0x27af('0x39')][_0x27af('0x3a')],function(_0x5b0497){return{'name':_0x5b0497[_0x27af('0x3b')],'type':_0x5b0497['type'][_0x27af('0x3c')]};});_0x3b589b[_0x27af('0x3d')]=_[_0x27af('0x38')](_0x916af4,'name');_0x3b589b[_0x27af('0x3e')]=_['keys'](_0x20affa['query']);_0x3b589b[_0x27af('0x3f')]=_[_0x27af('0x40')](_0x3b589b[_0x27af('0x3d')],_0x3b589b[_0x27af('0x3e')]);_0x1be3bc[_0x27af('0x41')]=_[_0x27af('0x40')](_0x3b589b[_0x27af('0x3d')],qs[_0x27af('0x42')](_0x20affa[_0x27af('0x3e')]['fields']));_0x1be3bc[_0x27af('0x41')]=_0x1be3bc[_0x27af('0x41')][_0x27af('0x43')]?_0x1be3bc['attributes']:_0x3b589b['model'];if(!_0x20affa[_0x27af('0x3e')][_0x27af('0x44')]('nolimit')){_0x1be3bc[_0x27af('0x2d')]=qs['limit'](_0x20affa[_0x27af('0x3e')][_0x27af('0x2d')]);_0x1be3bc[_0x27af('0x2b')]=qs[_0x27af('0x2b')](_0x20affa[_0x27af('0x3e')][_0x27af('0x2b')]);}_0x1be3bc['order']=qs['sort'](_0x20affa[_0x27af('0x3e')][_0x27af('0x45')]);_0x1be3bc['where']=qs['filters'](_[_0x27af('0x46')](_0x20affa[_0x27af('0x3e')],_0x3b589b['filters']),_0x916af4);if(_0x20affa[_0x27af('0x3e')][_0x27af('0x47')]){_0x1be3bc['where']=_[_0x27af('0x48')](_0x1be3bc[_0x27af('0x49')],{'$or':_[_0x27af('0x38')](_0x916af4,function(_0x282645){if(_0x282645[_0x27af('0x4a')]!==_0x27af('0x4b')){var _0x5254df={};_0x5254df[_0x282645['name']]={'$like':'%'+_0x20affa[_0x27af('0x3e')]['filter']+'%'};return _0x5254df;}})});}_0x1be3bc=_[_0x27af('0x48')]({},_0x1be3bc,_0x20affa[_0x27af('0x4c')]);var _0x5aad86={'where':_0x1be3bc[_0x27af('0x49')]};return db['Network'][_0x27af('0x2e')](_0x5aad86)[_0x27af('0x1c')](function(_0x1f745d){_0x15bb25[_0x27af('0x2e')]=_0x1f745d;if(_0x20affa[_0x27af('0x3e')][_0x27af('0x4d')]){_0x1be3bc['include']=[{'all':!![]}];}return db[_0x27af('0x39')][_0x27af('0x4e')](_0x1be3bc);})[_0x27af('0x1c')](function(_0x39288d){_0x15bb25['rows']=_0x39288d;return _0x15bb25;})[_0x27af('0x1c')](respondWithFilteredResult(_0x4595fd,_0x1be3bc))[_0x27af('0x26')](handleError(_0x4595fd,null));};exports['show']=function(_0x1e93e4,_0x3364a4){var _0x2d6e3f={'raw':!![],'where':{'id':_0x1e93e4[_0x27af('0x4f')]['id']}},_0x1315e7={};_0x1315e7[_0x27af('0x3d')]=_['keys'](db['Network'][_0x27af('0x3a')]);_0x1315e7[_0x27af('0x3e')]=_[_0x27af('0x50')](_0x1e93e4['query']);_0x1315e7[_0x27af('0x3f')]=_['intersection'](_0x1315e7['model'],_0x1315e7['query']);_0x2d6e3f[_0x27af('0x41')]=_[_0x27af('0x40')](_0x1315e7[_0x27af('0x3d')],qs[_0x27af('0x42')](_0x1e93e4['query']['fields']));_0x2d6e3f['attributes']=_0x2d6e3f[_0x27af('0x41')]['length']?_0x2d6e3f[_0x27af('0x41')]:_0x1315e7[_0x27af('0x3d')];if(_0x1e93e4['query']['includeAll']){_0x2d6e3f[_0x27af('0x51')]=[{'all':!![]}];}_0x2d6e3f=_['merge']({},_0x2d6e3f,_0x1e93e4[_0x27af('0x4c')]);return db[_0x27af('0x39')][_0x27af('0x52')](_0x2d6e3f)[_0x27af('0x1c')](handleEntityNotFound(_0x3364a4,null))[_0x27af('0x1c')](respondWithResult(_0x3364a4,null))[_0x27af('0x26')](handleError(_0x3364a4,null));};exports[_0x27af('0x53')]=function(_0x4a7219,_0x4f923f,_0x38c7de){var _0x241455;return db[_0x27af('0x54')][_0x27af('0x55')](function(_0x569185){return db['Network'][_0x27af('0x53')](_0x4a7219[_0x27af('0x56')],{'raw':!![]})[_0x27af('0x1c')](function(_0x337236){_0x241455=_0x337236;return db[_0x27af('0x39')][_0x27af('0x4e')]({'where':{'type':_0x4a7219[_0x27af('0x56')][_0x27af('0x4a')]},'raw':!![]});})[_0x27af('0x1c')](function(_0x333988){if(_0x241455[_0x27af('0x4a')][_0x27af('0x57')]()=='STUN'){var _0x6aeada=fs[_0x27af('0x58')](path[_0x27af('0x59')](config[_0x27af('0x5a')],_0x27af('0x5b')),_0x27af('0x5c'));var _0x257a0c=ejs[_0x27af('0x5d')](_0x6aeada,{'networks':_0x333988||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x257a0c);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x53'),{'module':_0x27af('0x5f')});}else if(_0x241455['type'][_0x27af('0x57')]()==_0x27af('0x60')){var _0x233fd2=fs[_0x27af('0x58')](path[_0x27af('0x59')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x350a5f=ejs[_0x27af('0x5d')](_0x233fd2,{'networks':_0x333988||[]});fs[_0x27af('0x61')]('/etc/asterisk/turn_xcally.conf',_0x350a5f);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x53'),{'module':_0x27af('0x5f')});}else{var _0x1b1ee8=fs['readFileSync'](path[_0x27af('0x59')](config[_0x27af('0x5a')],_0x27af('0x62')),_0x27af('0x5c'));var _0x15a2fd=ejs['render'](_0x1b1ee8,{'networks':_0x333988||[]});fs['writeFileSync'](util['format'](_0x27af('0x63'),_0x4a7219[_0x27af('0x56')][_0x27af('0x4a')][_0x27af('0x64')]()),_0x15a2fd);return respondWithRpcPromise(_0x27af('0x5e'),'create',{'module':'chan_sip.so'});}return null;})[_0x27af('0x1c')](function(){return _0x241455;});})[_0x27af('0x1c')](respondWithResult(_0x4f923f,0xc9))['catch'](handleError(_0x4f923f,null));};exports['update']=function(_0x5b8f09,_0x5d6ea4,_0x374437){var _0x3e7a33;return db[_0x27af('0x54')]['transaction'](function(_0x5adced){return db['Network']['find']({'where':{'id':_0x5b8f09[_0x27af('0x4f')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x5d6ea4,null))[_0x27af('0x1c')](saveUpdates(_0x5b8f09['body'],null))[_0x27af('0x1c')](function(_0x34843c){if(_0x34843c){_0x3e7a33=_0x34843c;return db[_0x27af('0x39')][_0x27af('0x4e')]({'where':{'type':_0x3e7a33[_0x27af('0x4a')]},'raw':!![]});}return null;})[_0x27af('0x1c')](function(_0x4a5eb9){if(_0x3e7a33[_0x27af('0x4a')]['toUpperCase']()==_0x27af('0x65')){var _0x5187ba=fs[_0x27af('0x58')](path['join'](config[_0x27af('0x5a')],_0x27af('0x5b')),_0x27af('0x5c'));var _0x4a0339=ejs[_0x27af('0x5d')](_0x5187ba,{'networks':_0x4a5eb9||[]});fs['writeFileSync'](_0x27af('0x66'),_0x4a0339);return respondWithRpcPromise('Reload',_0x27af('0x33'),{'module':_0x27af('0x5f')});}else if(_0x3e7a33['type'][_0x27af('0x57')]()==_0x27af('0x60')){var _0x16e98b=fs['readFileSync'](path[_0x27af('0x59')](config[_0x27af('0x5a')],_0x27af('0x67')),_0x27af('0x5c'));var _0x22266c=ejs['render'](_0x16e98b,{'networks':_0x4a5eb9||[]});fs[_0x27af('0x61')](_0x27af('0x68'),_0x22266c);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x33'),{'module':_0x27af('0x5f')});}else{var _0x12a151=fs[_0x27af('0x58')](path['join'](config['root'],_0x27af('0x62')),_0x27af('0x5c'));var _0x3ca3b2=ejs[_0x27af('0x5d')](_0x12a151,{'networks':_0x4a5eb9||[]});fs[_0x27af('0x61')](util[_0x27af('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x5b8f09[_0x27af('0x56')][_0x27af('0x4a')][_0x27af('0x64')]()),_0x3ca3b2);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x33'),{'module':_0x27af('0x6a')});}return null;})[_0x27af('0x1c')](function(_0x34323f){if(_0x34323f){return _0x3e7a33;}return null;});})[_0x27af('0x1c')](respondWithResult(_0x5d6ea4,null))[_0x27af('0x26')](handleError(_0x5d6ea4,null));};exports[_0x27af('0x34')]=function(_0x29852e,_0x29acf2,_0x17d89f){var _0x3c8890;return db['Network'][_0x27af('0x52')]({'where':{'id':_0x29852e['params']['id']}})['then'](function(_0x22270d){_0x3c8890=_0x22270d;return _0x22270d;})[_0x27af('0x1c')](handleEntityNotFound(_0x29acf2,null))['then'](removeEntity(_0x29acf2,null))[_0x27af('0x1c')](function(){if(_0x3c8890){return db['Network']['findAll']({'where':{'type':_0x3c8890[_0x27af('0x4a')]},'raw':!![]});}})['then'](function(_0x55f4fe){if(_0x3c8890[_0x27af('0x4a')][_0x27af('0x57')]()==_0x27af('0x65')){var _0x474ee2=fs['readFileSync'](path[_0x27af('0x59')](config[_0x27af('0x5a')],_0x27af('0x5b')),_0x27af('0x5c'));var _0x5ea4c4=ejs[_0x27af('0x5d')](_0x474ee2,{'networks':_0x55f4fe||[]});fs[_0x27af('0x61')](_0x27af('0x66'),_0x5ea4c4);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x34'),{'module':_0x27af('0x5f')});}else if(_0x3c8890['type'][_0x27af('0x57')]()==_0x27af('0x60')){var _0x21afb3=fs[_0x27af('0x58')](path['join'](config[_0x27af('0x5a')],_0x27af('0x67')),_0x27af('0x5c'));var _0x505034=ejs[_0x27af('0x5d')](_0x21afb3,{'networks':_0x55f4fe||[]});fs[_0x27af('0x61')](_0x27af('0x68'),_0x505034);return respondWithRpcPromise('Reload',_0x27af('0x34'),{'module':'res_stun_monitor.so'});}else{var _0x306db3=fs[_0x27af('0x58')](path[_0x27af('0x59')](config['root'],_0x27af('0x62')),'utf8');var _0x232aa9=ejs['render'](_0x306db3,{'networks':_0x55f4fe||[]});fs[_0x27af('0x61')](util[_0x27af('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x29852e[_0x27af('0x56')][_0x27af('0x4a')]['toLowerCase']()),_0x232aa9);return respondWithRpcPromise(_0x27af('0x5e'),_0x27af('0x34'),{'module':_0x27af('0x6a')});}return null;})[_0x27af('0x26')](handleError(_0x29acf2,null));}; \ No newline at end of file +var _0xc3b2=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','transaction','create','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','readFileSync','eml-format','zip-dir','moment','bluebird'];(function(_0x868707,_0x1739d3){var _0x743bc2=function(_0x7a4110){while(--_0x7a4110){_0x868707['push'](_0x868707['shift']());}};_0x743bc2(++_0x1739d3);}(_0xc3b2,0x67));var _0x2c3b=function(_0x47372e,_0x153987){_0x47372e=_0x47372e-0x0;var _0x1f136a=_0xc3b2[_0x47372e];return _0x1f136a;};'use strict';var emlformat=require(_0x2c3b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c3b('0x2'));var BPromise=require(_0x2c3b('0x3'));var Mustache=require(_0x2c3b('0x4'));var util=require(_0x2c3b('0x5'));var path=require(_0x2c3b('0x6'));var sox=require(_0x2c3b('0x7'));var csv=require(_0x2c3b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c3b('0x9'));var _=require(_0x2c3b('0xa'));var squel=require(_0x2c3b('0xb'));var crypto=require(_0x2c3b('0xc'));var jsforce=require(_0x2c3b('0xd'));var deskjs=require(_0x2c3b('0xe'));var toCsv=require(_0x2c3b('0x8'));var querystring=require('querystring');var Papa=require(_0x2c3b('0xf'));var Redis=require(_0x2c3b('0x10'));var authService=require(_0x2c3b('0x11'));var qs=require(_0x2c3b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c3b('0x13'));var logger=require(_0x2c3b('0x14'))(_0x2c3b('0x15'));var utils=require(_0x2c3b('0x16'));var config=require(_0x2c3b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c3b('0x18'))['db'];var jayson=require(_0x2c3b('0x19'));var client=jayson[_0x2c3b('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8136,_0x200745,_0x25877f,_0x559778){return new BPromise(function(_0xfdbf2d,_0x1622d7){var _0x3bae14=_0x559778||client;return _0x3bae14['request'](_0x4c8136,_0x25877f)[_0x2c3b('0x1b')](function(_0x433567){logger[_0x2c3b('0x1c')](_0x2c3b('0x1d'),_0x200745,_0x2c3b('0x1e'));logger[_0x2c3b('0x1f')](_0x2c3b('0x20'),_0x200745,_0x2c3b('0x1e'),JSON[_0x2c3b('0x21')](_0x433567));if(_0x433567[_0x2c3b('0x22')]){if(_0x433567[_0x2c3b('0x22')][_0x2c3b('0x23')]===0x1f4){logger[_0x2c3b('0x22')]('Network,\x20%s,\x20%s',_0x200745,_0x433567[_0x2c3b('0x22')][_0x2c3b('0x24')]);return _0x1622d7(_0x433567[_0x2c3b('0x22')][_0x2c3b('0x24')]);}logger['error'](_0x2c3b('0x1d'),_0x200745,_0x433567['error'][_0x2c3b('0x24')]);return _0xfdbf2d(_0x433567[_0x2c3b('0x22')][_0x2c3b('0x24')]);}else{logger[_0x2c3b('0x1c')](_0x2c3b('0x1d'),_0x200745,'request\x20sent');_0xfdbf2d(_0x433567[_0x2c3b('0x25')][_0x2c3b('0x24')]);}})['catch'](function(_0x45af32){logger[_0x2c3b('0x22')](_0x2c3b('0x1d'),_0x200745,_0x45af32);_0x1622d7(_0x45af32);});});}function respondWithStatusCode(_0x299acf,_0x3fe489){_0x3fe489=_0x3fe489||0xcc;return function(_0xf2c25e){if(_0xf2c25e){return _0x299acf[_0x2c3b('0x26')](_0x3fe489);}return _0x299acf['status'](_0x3fe489)[_0x2c3b('0x27')]();};}function respondWithResult(_0x941b20,_0x4a30c5){_0x4a30c5=_0x4a30c5||0xc8;return function(_0x340763){if(_0x340763){return _0x941b20[_0x2c3b('0x28')](_0x4a30c5)[_0x2c3b('0x29')](_0x340763);}};}function respondWithFilteredResult(_0x53f251,_0x48682e){return function(_0x7780bc){if(_0x7780bc){var _0x81af52=typeof _0x48682e[_0x2c3b('0x2a')]===_0x2c3b('0x2b')&&typeof _0x48682e[_0x2c3b('0x2c')]===_0x2c3b('0x2b');var _0x3fa5e7=_0x7780bc[_0x2c3b('0x2d')];var _0x31da5c=_0x81af52?0x0:_0x48682e['offset'];var _0x2ee177=_0x81af52?_0x7780bc[_0x2c3b('0x2d')]:_0x48682e[_0x2c3b('0x2a')]+_0x48682e[_0x2c3b('0x2c')];var _0x275146;if(_0x2ee177>=_0x3fa5e7){_0x2ee177=_0x3fa5e7;_0x275146=0xc8;}else{_0x275146=0xce;}_0x53f251[_0x2c3b('0x28')](_0x275146);return _0x53f251[_0x2c3b('0x2e')](_0x2c3b('0x2f'),_0x31da5c+'-'+_0x2ee177+'/'+_0x3fa5e7)[_0x2c3b('0x29')](_0x7780bc);}return null;};}function patchUpdates(_0x4b323c){return function(_0x48a9ab){try{jsonpatch[_0x2c3b('0x30')](_0x48a9ab,_0x4b323c,!![]);}catch(_0x1efd0e){return BPromise['reject'](_0x1efd0e);}return _0x48a9ab[_0x2c3b('0x31')]();};}function saveUpdates(_0x3675f1,_0xe8819){return function(_0x41f2c7){if(_0x41f2c7){return _0x41f2c7[_0x2c3b('0x32')](_0x3675f1)[_0x2c3b('0x1b')](function(_0x149551){return _0x149551;});}return null;};}function removeEntity(_0x47b3ce,_0x26ee72){return function(_0x2c2604){if(_0x2c2604){return _0x2c2604[_0x2c3b('0x33')]()['then'](function(){_0x47b3ce[_0x2c3b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed013,_0x57f69e){return function(_0x1c045e){if(!_0x1c045e){_0x3ed013[_0x2c3b('0x26')](0x194);}return _0x1c045e;};}function handleError(_0xfef6f7,_0x5850d2){_0x5850d2=_0x5850d2||0x1f4;return function(_0x4e68b6){logger[_0x2c3b('0x22')](_0x4e68b6[_0x2c3b('0x34')]);if(_0x4e68b6[_0x2c3b('0x35')]){delete _0x4e68b6['name'];}_0xfef6f7[_0x2c3b('0x28')](_0x5850d2)['send'](_0x4e68b6);};}exports[_0x2c3b('0x36')]=function(_0x38b46c,_0x71300b){var _0x194316={},_0x146a09={},_0x55423f={'count':0x0,'rows':[]};var _0x58df39=_[_0x2c3b('0x37')](db[_0x2c3b('0x38')][_0x2c3b('0x39')],function(_0x322309){return{'name':_0x322309[_0x2c3b('0x3a')],'type':_0x322309[_0x2c3b('0x3b')][_0x2c3b('0x3c')]};});_0x146a09[_0x2c3b('0x3d')]=_[_0x2c3b('0x37')](_0x58df39,'name');_0x146a09[_0x2c3b('0x3e')]=_['keys'](_0x38b46c[_0x2c3b('0x3e')]);_0x146a09[_0x2c3b('0x3f')]=_[_0x2c3b('0x40')](_0x146a09[_0x2c3b('0x3d')],_0x146a09[_0x2c3b('0x3e')]);_0x194316['attributes']=_['intersection'](_0x146a09['model'],qs[_0x2c3b('0x41')](_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x41')]));_0x194316[_0x2c3b('0x42')]=_0x194316['attributes'][_0x2c3b('0x43')]?_0x194316[_0x2c3b('0x42')]:_0x146a09[_0x2c3b('0x3d')];if(!_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x44')](_0x2c3b('0x45'))){_0x194316[_0x2c3b('0x2c')]=qs['limit'](_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x2c')]);_0x194316['offset']=qs[_0x2c3b('0x2a')](_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x2a')]);}_0x194316[_0x2c3b('0x46')]=qs[_0x2c3b('0x47')](_0x38b46c['query'][_0x2c3b('0x47')]);_0x194316[_0x2c3b('0x48')]=qs['filters'](_['pick'](_0x38b46c[_0x2c3b('0x3e')],_0x146a09[_0x2c3b('0x3f')]),_0x58df39);if(_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x49')]){_0x194316[_0x2c3b('0x48')]=_[_0x2c3b('0x4a')](_0x194316['where'],{'$or':_[_0x2c3b('0x37')](_0x58df39,function(_0xcc66e2){if(_0xcc66e2[_0x2c3b('0x3b')]!==_0x2c3b('0x4b')){var _0x3c0602={};_0x3c0602[_0xcc66e2[_0x2c3b('0x35')]]={'$like':'%'+_0x38b46c[_0x2c3b('0x3e')]['filter']+'%'};return _0x3c0602;}})});}_0x194316=_[_0x2c3b('0x4a')]({},_0x194316,_0x38b46c[_0x2c3b('0x4c')]);var _0x19e27d={'where':_0x194316[_0x2c3b('0x48')]};return db['Network'][_0x2c3b('0x2d')](_0x19e27d)[_0x2c3b('0x1b')](function(_0x4ca1af){_0x55423f[_0x2c3b('0x2d')]=_0x4ca1af;if(_0x38b46c[_0x2c3b('0x3e')][_0x2c3b('0x4d')]){_0x194316[_0x2c3b('0x4e')]=[{'all':!![]}];}return db[_0x2c3b('0x38')][_0x2c3b('0x4f')](_0x194316);})[_0x2c3b('0x1b')](function(_0x219beb){_0x55423f[_0x2c3b('0x50')]=_0x219beb;return _0x55423f;})[_0x2c3b('0x1b')](respondWithFilteredResult(_0x71300b,_0x194316))[_0x2c3b('0x51')](handleError(_0x71300b,null));};exports['show']=function(_0x30966f,_0x2c090b){var _0x6a673a={'raw':!![],'where':{'id':_0x30966f['params']['id']}},_0x198717={};_0x198717['model']=_['keys'](db[_0x2c3b('0x38')][_0x2c3b('0x39')]);_0x198717['query']=_['keys'](_0x30966f[_0x2c3b('0x3e')]);_0x198717[_0x2c3b('0x3f')]=_['intersection'](_0x198717['model'],_0x198717[_0x2c3b('0x3e')]);_0x6a673a[_0x2c3b('0x42')]=_['intersection'](_0x198717['model'],qs[_0x2c3b('0x41')](_0x30966f[_0x2c3b('0x3e')][_0x2c3b('0x41')]));_0x6a673a[_0x2c3b('0x42')]=_0x6a673a[_0x2c3b('0x42')][_0x2c3b('0x43')]?_0x6a673a[_0x2c3b('0x42')]:_0x198717['model'];if(_0x30966f[_0x2c3b('0x3e')][_0x2c3b('0x4d')]){_0x6a673a['include']=[{'all':!![]}];}_0x6a673a=_[_0x2c3b('0x4a')]({},_0x6a673a,_0x30966f[_0x2c3b('0x4c')]);return db['Network'][_0x2c3b('0x52')](_0x6a673a)[_0x2c3b('0x1b')](handleEntityNotFound(_0x2c090b,null))['then'](respondWithResult(_0x2c090b,null))[_0x2c3b('0x51')](handleError(_0x2c090b,null));};exports['create']=function(_0x58a171,_0x574e7e,_0x1483c5){var _0x337bed;return db['sequelize'][_0x2c3b('0x53')](function(_0x19cf78){return db[_0x2c3b('0x38')][_0x2c3b('0x54')](_0x58a171[_0x2c3b('0x55')],{'raw':!![]})[_0x2c3b('0x1b')](function(_0x17cc7e){_0x337bed=_0x17cc7e;return db[_0x2c3b('0x38')]['findAll']({'where':{'type':_0x58a171[_0x2c3b('0x55')]['type']},'raw':!![]});})[_0x2c3b('0x1b')](function(_0x530f6a){if(_0x337bed['type'][_0x2c3b('0x56')]()==_0x2c3b('0x57')){var _0x92f28b=fs['readFileSync'](path['join'](config[_0x2c3b('0x58')],_0x2c3b('0x59')),_0x2c3b('0x5a'));var _0x173a3e=ejs[_0x2c3b('0x5b')](_0x92f28b,{'networks':_0x530f6a||[]});fs['writeFileSync'](_0x2c3b('0x5c'),_0x173a3e);return respondWithRpcPromise(_0x2c3b('0x5d'),_0x2c3b('0x54'),{'module':'res_stun_monitor.so'});}else if(_0x337bed[_0x2c3b('0x3b')][_0x2c3b('0x56')]()==_0x2c3b('0x5e')){var _0x161164=fs['readFileSync'](path[_0x2c3b('0x5f')](config[_0x2c3b('0x58')],_0x2c3b('0x60')),_0x2c3b('0x5a'));var _0x5c1820=ejs['render'](_0x161164,{'networks':_0x530f6a||[]});fs[_0x2c3b('0x61')](_0x2c3b('0x62'),_0x5c1820);return respondWithRpcPromise(_0x2c3b('0x5d'),_0x2c3b('0x54'),{'module':_0x2c3b('0x63')});}else{var _0x130b4b=fs['readFileSync'](path[_0x2c3b('0x5f')](config[_0x2c3b('0x58')],_0x2c3b('0x64')),_0x2c3b('0x5a'));var _0x4b965b=ejs[_0x2c3b('0x5b')](_0x130b4b,{'networks':_0x530f6a||[]});fs[_0x2c3b('0x61')](util[_0x2c3b('0x65')](_0x2c3b('0x66'),_0x58a171[_0x2c3b('0x55')]['type'][_0x2c3b('0x67')]()),_0x4b965b);return respondWithRpcPromise(_0x2c3b('0x5d'),'create',{'module':_0x2c3b('0x68')});}return null;})[_0x2c3b('0x1b')](function(){return _0x337bed;});})[_0x2c3b('0x1b')](respondWithResult(_0x574e7e,0xc9))[_0x2c3b('0x51')](handleError(_0x574e7e,null));};exports[_0x2c3b('0x32')]=function(_0x3e7a3e,_0x3f18e8,_0x201965){var _0xc61d36;return db['sequelize'][_0x2c3b('0x53')](function(_0x53a31){return db[_0x2c3b('0x38')][_0x2c3b('0x52')]({'where':{'id':_0x3e7a3e[_0x2c3b('0x69')]['id']}})[_0x2c3b('0x1b')](handleEntityNotFound(_0x3f18e8,null))[_0x2c3b('0x1b')](saveUpdates(_0x3e7a3e[_0x2c3b('0x55')],null))[_0x2c3b('0x1b')](function(_0x2588b2){if(_0x2588b2){_0xc61d36=_0x2588b2;return db[_0x2c3b('0x38')][_0x2c3b('0x4f')]({'where':{'type':_0xc61d36[_0x2c3b('0x3b')]},'raw':!![]});}return null;})[_0x2c3b('0x1b')](function(_0x5f2d10){if(_0xc61d36[_0x2c3b('0x3b')][_0x2c3b('0x56')]()==_0x2c3b('0x57')){var _0x50ca8a=fs[_0x2c3b('0x6a')](path['join'](config[_0x2c3b('0x58')],'server/files/templates/stun_multiple.ejs'),_0x2c3b('0x5a'));var _0x21f26c=ejs['render'](_0x50ca8a,{'networks':_0x5f2d10||[]});fs[_0x2c3b('0x61')](_0x2c3b('0x5c'),_0x21f26c);return respondWithRpcPromise(_0x2c3b('0x5d'),_0x2c3b('0x32'),{'module':_0x2c3b('0x63')});}else if(_0xc61d36[_0x2c3b('0x3b')][_0x2c3b('0x56')]()==_0x2c3b('0x5e')){var _0x1fa4f1=fs[_0x2c3b('0x6a')](path[_0x2c3b('0x5f')](config['root'],_0x2c3b('0x60')),_0x2c3b('0x5a'));var _0x582320=ejs[_0x2c3b('0x5b')](_0x1fa4f1,{'networks':_0x5f2d10||[]});fs['writeFileSync'](_0x2c3b('0x62'),_0x582320);return respondWithRpcPromise('Reload',_0x2c3b('0x32'),{'module':_0x2c3b('0x63')});}else{var _0x239471=fs[_0x2c3b('0x6a')](path['join'](config[_0x2c3b('0x58')],_0x2c3b('0x64')),_0x2c3b('0x5a'));var _0x2686a1=ejs[_0x2c3b('0x5b')](_0x239471,{'networks':_0x5f2d10||[]});fs[_0x2c3b('0x61')](util[_0x2c3b('0x65')](_0x2c3b('0x66'),_0x3e7a3e[_0x2c3b('0x55')][_0x2c3b('0x3b')][_0x2c3b('0x67')]()),_0x2686a1);return respondWithRpcPromise('Reload',_0x2c3b('0x32'),{'module':_0x2c3b('0x68')});}return null;})[_0x2c3b('0x1b')](function(_0x617d98){if(_0x617d98){return _0xc61d36;}return null;});})['then'](respondWithResult(_0x3f18e8,null))['catch'](handleError(_0x3f18e8,null));};exports[_0x2c3b('0x33')]=function(_0x3526d2,_0x206b78,_0x934947){var _0x424945;return db[_0x2c3b('0x38')][_0x2c3b('0x52')]({'where':{'id':_0x3526d2[_0x2c3b('0x69')]['id']}})[_0x2c3b('0x1b')](function(_0x3281d7){_0x424945=_0x3281d7;return _0x3281d7;})[_0x2c3b('0x1b')](handleEntityNotFound(_0x206b78,null))['then'](removeEntity(_0x206b78,null))[_0x2c3b('0x1b')](function(){if(_0x424945){return db[_0x2c3b('0x38')]['findAll']({'where':{'type':_0x424945['type']},'raw':!![]});}})[_0x2c3b('0x1b')](function(_0x5216de){if(_0x424945[_0x2c3b('0x3b')]['toUpperCase']()==_0x2c3b('0x57')){var _0x4b6948=fs[_0x2c3b('0x6a')](path[_0x2c3b('0x5f')](config[_0x2c3b('0x58')],'server/files/templates/stun_multiple.ejs'),_0x2c3b('0x5a'));var _0x2e4f0d=ejs['render'](_0x4b6948,{'networks':_0x5216de||[]});fs['writeFileSync'](_0x2c3b('0x5c'),_0x2e4f0d);return respondWithRpcPromise('Reload',_0x2c3b('0x33'),{'module':_0x2c3b('0x63')});}else if(_0x424945['type'][_0x2c3b('0x56')]()==_0x2c3b('0x5e')){var _0x4c8930=fs['readFileSync'](path[_0x2c3b('0x5f')](config[_0x2c3b('0x58')],_0x2c3b('0x60')),_0x2c3b('0x5a'));var _0x5490d3=ejs[_0x2c3b('0x5b')](_0x4c8930,{'networks':_0x5216de||[]});fs['writeFileSync'](_0x2c3b('0x62'),_0x5490d3);return respondWithRpcPromise('Reload','destroy',{'module':_0x2c3b('0x63')});}else{var _0x503346=fs[_0x2c3b('0x6a')](path[_0x2c3b('0x5f')](config[_0x2c3b('0x58')],'server/files/templates/network.ejs'),_0x2c3b('0x5a'));var _0x503c8c=ejs['render'](_0x503346,{'networks':_0x5216de||[]});fs[_0x2c3b('0x61')](util[_0x2c3b('0x65')](_0x2c3b('0x66'),_0x3526d2['body'][_0x2c3b('0x3b')][_0x2c3b('0x67')]()),_0x503c8c);return respondWithRpcPromise(_0x2c3b('0x5d'),_0x2c3b('0x33'),{'module':_0x2c3b('0x68')});}return null;})[_0x2c3b('0x51')](handleError(_0x206b78,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e330152..4dde489 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 _0x0427=['api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger'];(function(_0x57b4cc,_0x2ae50e){var _0x45ba9d=function(_0x4ab1b1){while(--_0x4ab1b1){_0x57b4cc['push'](_0x57b4cc['shift']());}};_0x45ba9d(++_0x2ae50e);}(_0x0427,0x137));var _0x7042=function(_0x4df3c8,_0x2e2bb2){_0x4df3c8=_0x4df3c8-0x0;var _0x14376f=_0x0427[_0x4df3c8];return _0x14376f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7042('0x0'))(_0x7042('0x1'));var moment=require('moment');var BPromise=require(_0x7042('0x2'));var rp=require(_0x7042('0x3'));var fs=require('fs');var path=require(_0x7042('0x4'));var rimraf=require(_0x7042('0x5'));var config=require(_0x7042('0x6'));var attributes=require(_0x7042('0x7'));module[_0x7042('0x8')]=function(_0x53ab81,_0x37a35b){return _0x53ab81[_0x7042('0x9')](_0x7042('0xa'),attributes,{'tableName':_0x7042('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x657b=['api','moment','request-promise','path','../../config/environment','./network.attributes','exports','Network','lodash','util','../../config/logger'];(function(_0x1cbe71,_0x2c6a3d){var _0x5a01aa=function(_0x13f525){while(--_0x13f525){_0x1cbe71['push'](_0x1cbe71['shift']());}};_0x5a01aa(++_0x2c6a3d);}(_0x657b,0x131));var _0xb657=function(_0x1b5b37,_0x3da7e1){_0x1b5b37=_0x1b5b37-0x0;var _0x21fb01=_0x657b[_0x1b5b37];return _0x21fb01;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require('bluebird');var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module[_0xb657('0x9')]=function(_0x25738d,_0x446b17){return _0x25738d['define'](_0xb657('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 651d38e..1eaff13 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6bcd8b,_0x5bde7f){var _0x1436b2=function(_0x2f377a){while(--_0x2f377a){_0x6bcd8b['push'](_0x6bcd8b['shift']());}};_0x1436b2(++_0x5bde7f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x16098a,_0x892b81){var _0x62e254=function(_0x21653f){while(--_0x21653f){_0x16098a['push'](_0x16098a['shift']());}};_0x62e254(++_0x892b81);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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 b2a0b06..1824aab 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 _0xb56f=['isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','/:id/send','send','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','index'];(function(_0x55eec7,_0x3080fb){var _0x44f13b=function(_0x566847){while(--_0x566847){_0x55eec7['push'](_0x55eec7['shift']());}};_0x44f13b(++_0x3080fb);}(_0xb56f,0x139));var _0xfb56=function(_0x5d7045,_0x1e31cc){_0x5d7045=_0x5d7045-0x0;var _0x3c1497=_0xb56f[_0x5d7045];return _0x3c1497;};'use strict';var multer=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var path=require(_0xfb56('0x2'));var timeout=require(_0xfb56('0x3'));var express=require(_0xfb56('0x4'));var router=express[_0xfb56('0x5')]();var fs_extra=require(_0xfb56('0x6'));var auth=require(_0xfb56('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb56('0x8'));router[_0xfb56('0x9')]('/',auth['isAuthenticated'](),controller[_0xfb56('0xa')]);router[_0xfb56('0x9')]('/describe',auth[_0xfb56('0xb')](),controller['describe']);router[_0xfb56('0x9')]('/:id',auth[_0xfb56('0xb')](),controller['show']);router['get'](_0xfb56('0xc'),auth[_0xfb56('0xb')](),controller[_0xfb56('0xd')]);router['get'](_0xfb56('0xe'),auth[_0xfb56('0xb')](),controller[_0xfb56('0xf')]);router['get'](_0xfb56('0x10'),auth['isAuthenticated'](),controller[_0xfb56('0x11')]);router[_0xfb56('0x9')](_0xfb56('0x12'),auth['isAuthenticated'](),controller[_0xfb56('0x13')]);router[_0xfb56('0x9')]('/:id/users',auth[_0xfb56('0xb')](),controller['getAgents']);router[_0xfb56('0x14')]('/',auth['isAuthenticated'](),controller[_0xfb56('0x15')]);router[_0xfb56('0x14')](_0xfb56('0xc'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x16')]);router[_0xfb56('0x14')]('/:id/canned_answers',auth[_0xfb56('0xb')](),controller[_0xfb56('0x17')]);router[_0xfb56('0x14')](_0xfb56('0x18'),controller['notify']);router[_0xfb56('0x14')](_0xfb56('0x10'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x19')]);router[_0xfb56('0x14')](_0xfb56('0x1a'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x1b')]);router[_0xfb56('0x14')](_0xfb56('0x1c'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x1d')]);router['put'](_0xfb56('0x1e'),auth['isAuthenticated'](),controller[_0xfb56('0x1f')]);router[_0xfb56('0x20')](_0xfb56('0x1e'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x21')]);router[_0xfb56('0x20')](_0xfb56('0xc'),auth[_0xfb56('0xb')](),controller['removeDispositions']);router[_0xfb56('0x20')]('/:id/canned_answers',auth[_0xfb56('0xb')](),controller[_0xfb56('0x22')]);router[_0xfb56('0x20')](_0xfb56('0x1a'),auth[_0xfb56('0xb')](),controller[_0xfb56('0x23')]);module['exports']=router; \ No newline at end of file +var _0xd507=['/:id/send','send','put','/:id','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents'];(function(_0x431962,_0x6bd92c){var _0x186cb7=function(_0x362573){while(--_0x362573){_0x431962['push'](_0x431962['shift']());}};_0x186cb7(++_0x6bd92c);}(_0xd507,0x14b));var _0x7d50=function(_0x31f872,_0x23e213){_0x31f872=_0x31f872-0x0;var _0x388c29=_0xd507[_0x31f872];return _0x388c29;};'use strict';var multer=require(_0x7d50('0x0'));var util=require(_0x7d50('0x1'));var path=require(_0x7d50('0x2'));var timeout=require(_0x7d50('0x3'));var express=require(_0x7d50('0x4'));var router=express['Router']();var fs_extra=require(_0x7d50('0x5'));var auth=require(_0x7d50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7d50('0x7'));var controller=require(_0x7d50('0x8'));router[_0x7d50('0x9')]('/',auth[_0x7d50('0xa')](),controller[_0x7d50('0xb')]);router[_0x7d50('0x9')](_0x7d50('0xc'),auth[_0x7d50('0xa')](),controller[_0x7d50('0xd')]);router[_0x7d50('0x9')]('/:id',auth[_0x7d50('0xa')](),controller[_0x7d50('0xe')]);router[_0x7d50('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7d50('0xf')]);router[_0x7d50('0x9')](_0x7d50('0x10'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x11')]);router[_0x7d50('0x9')](_0x7d50('0x12'),auth[_0x7d50('0xa')](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x7d50('0xa')](),controller[_0x7d50('0x13')]);router['get'](_0x7d50('0x14'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x15')]);router[_0x7d50('0x16')]('/',auth[_0x7d50('0xa')](),controller['create']);router['post']('/:id/dispositions',auth[_0x7d50('0xa')](),controller[_0x7d50('0x17')]);router[_0x7d50('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7d50('0x18')]);router[_0x7d50('0x16')](_0x7d50('0x19'),controller[_0x7d50('0x1a')]);router[_0x7d50('0x16')](_0x7d50('0x12'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x1b')]);router[_0x7d50('0x16')](_0x7d50('0x14'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x1c')]);router['post'](_0x7d50('0x1d'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x1e')]);router[_0x7d50('0x1f')](_0x7d50('0x20'),auth[_0x7d50('0xa')](),controller['update']);router[_0x7d50('0x21')]('/:id',auth[_0x7d50('0xa')](),controller[_0x7d50('0x22')]);router[_0x7d50('0x21')](_0x7d50('0x23'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x24')]);router[_0x7d50('0x21')](_0x7d50('0x10'),auth[_0x7d50('0xa')](),controller[_0x7d50('0x25')]);router[_0x7d50('0x21')]('/:id/users',auth[_0x7d50('0xa')](),controller[_0x7d50('0x26')]);module[_0x7d50('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 7ec71b3..0b6455d 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 _0x4d39=['randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x49d280,_0x33d68f){var _0x25274a=function(_0x8ace90){while(--_0x8ace90){_0x49d280['push'](_0x49d280['shift']());}};_0x25274a(++_0x33d68f);}(_0x4d39,0x186));var _0x94d3=function(_0x1663c2,_0x41682e){_0x1663c2=_0x1663c2-0x0;var _0x404b48=_0x4d39[_0x1663c2];return _0x404b48;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x94d3('0x0'));module[_0x94d3('0x1')]={'name':{'type':Sequelize[_0x94d3('0x2')],'unique':_0x94d3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x94d3('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x94d3('0x4')]();}},'replyUri':{'type':Sequelize[_0x94d3('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x94d3('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x94d3('0x5');}},'notificationSound':{'type':Sequelize[_0x94d3('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x94d3('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x94d3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x94d3('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x94d3('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x94d3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94d3('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x94d3('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x94d3('0x6')],'defaultValue':![],'comment':_0x94d3('0x9'),'set':function(_0x2a93b3){if(!_0x2a93b3)this[_0x94d3('0xa')](_0x94d3('0xb'),null);this[_0x94d3('0xa')](_0x94d3('0xc'),_0x2a93b3);}}}; \ No newline at end of file +var _0x3d66=['mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x59e50f,_0x57ead7){var _0x5a2fcc=function(_0x445952){while(--_0x445952){_0x59e50f['push'](_0x59e50f['shift']());}};_0x5a2fcc(++_0x57ead7);}(_0x3d66,0xb1));var _0x63d6=function(_0x368828,_0x4d86eb){_0x368828=_0x368828-0x0;var _0x28e8c=_0x3d66[_0x368828];return _0x28e8c;};'use strict';var Sequelize=require(_0x63d6('0x0'));var rs=require(_0x63d6('0x1'));module['exports']={'name':{'type':Sequelize[_0x63d6('0x2')],'unique':_0x63d6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x63d6('0x2')]},'token':{'type':Sequelize[_0x63d6('0x2')],'defaultValue':function(){return rs[_0x63d6('0x4')]();}},'replyUri':{'type':Sequelize[_0x63d6('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x63d6('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x63d6('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x63d6('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x63d6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x63d6('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x63d6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x63d6('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x63d6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x63d6('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x63d6('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49aaed){if(!_0x49aaed)this[_0x63d6('0x9')](_0x63d6('0xa'),null);this[_0x63d6('0x9')]('mandatoryDisposition',_0x49aaed);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 6b6b085..630567d 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 _0xd2fa=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','order','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','openchannel','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','OpenchannelApplication','applications','Applications','list','orderBy','priority','asc','account','Contacts','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','addApplications','sequelize','bulkCreate','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd2fa,0x161));var _0xad2f=function(_0x3cc2e5,_0x2b5d21){_0x3cc2e5=_0x3cc2e5-0x0;var _0x58680b=_0xd2fa[_0x3cc2e5];return _0x58680b;};'use strict';var emlformat=require(_0xad2f('0x0'));var rimraf=require(_0xad2f('0x1'));var zipdir=require(_0xad2f('0x2'));var jsonpatch=require(_0xad2f('0x3'));var rp=require(_0xad2f('0x4'));var moment=require(_0xad2f('0x5'));var BPromise=require(_0xad2f('0x6'));var Mustache=require(_0xad2f('0x7'));var util=require(_0xad2f('0x8'));var path=require(_0xad2f('0x9'));var sox=require('sox');var csv=require(_0xad2f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad2f('0xb'));var _=require('lodash');var squel=require(_0xad2f('0xc'));var crypto=require(_0xad2f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xad2f('0xe'));var toCsv=require(_0xad2f('0xa'));var querystring=require(_0xad2f('0xf'));var Papa=require(_0xad2f('0x10'));var Redis=require(_0xad2f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad2f('0x12'));var logger=require(_0xad2f('0x13'))(_0xad2f('0x14'));var utils=require(_0xad2f('0x15'));var config=require(_0xad2f('0x16'));var licenseUtil=require(_0xad2f('0x17'));var db=require(_0xad2f('0x18'))['db'];config['redis']=_[_0xad2f('0x19')](config[_0xad2f('0x1a')],{'host':_0xad2f('0x1b'),'port':0x18eb});var socket=require(_0xad2f('0x1c'))(new Redis(config[_0xad2f('0x1a')]));require(_0xad2f('0x1d'))['register'](socket);var jayson=require(_0xad2f('0x1e'));var client=jayson[_0xad2f('0x1f')][_0xad2f('0x20')]({'port':0x232c});var client9002=jayson[_0xad2f('0x1f')][_0xad2f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4ffb04,_0x2e8add,_0x10c05c,_0x225236){return new BPromise(function(_0x1699b7,_0x431b16){var _0x13b252=_0x225236||client;return _0x13b252['request'](_0x4ffb04,_0x10c05c)['then'](function(_0x322fc7){logger[_0xad2f('0x21')](_0xad2f('0x22'),_0x2e8add,_0xad2f('0x23'));logger[_0xad2f('0x24')](_0xad2f('0x25'),_0x2e8add,_0xad2f('0x23'),JSON[_0xad2f('0x26')](_0x322fc7));if(_0x322fc7[_0xad2f('0x27')]){if(_0x322fc7[_0xad2f('0x27')][_0xad2f('0x28')]===0x1f4){logger[_0xad2f('0x27')](_0xad2f('0x22'),_0x2e8add,_0x322fc7[_0xad2f('0x27')][_0xad2f('0x29')]);return _0x431b16(_0x322fc7[_0xad2f('0x27')][_0xad2f('0x29')]);}logger['error'](_0xad2f('0x22'),_0x2e8add,_0x322fc7[_0xad2f('0x27')]['message']);return _0x1699b7(_0x322fc7[_0xad2f('0x27')]['message']);}else{logger['info'](_0xad2f('0x22'),_0x2e8add,'request\x20sent');_0x1699b7(_0x322fc7[_0xad2f('0x2a')][_0xad2f('0x29')]);}})[_0xad2f('0x2b')](function(_0x2c7a0a){logger[_0xad2f('0x27')](_0xad2f('0x22'),_0x2e8add,_0x2c7a0a);_0x431b16(_0x2c7a0a);});});}function respondWithStatusCode(_0x5be28e,_0x59360e){_0x59360e=_0x59360e||0xcc;return function(_0x368a0b){if(_0x368a0b){return _0x5be28e[_0xad2f('0x2c')](_0x59360e);}return _0x5be28e[_0xad2f('0x2d')](_0x59360e)[_0xad2f('0x2e')]();};}function respondWithResult(_0x28cf67,_0x84b8c2){_0x84b8c2=_0x84b8c2||0xc8;return function(_0xf6b685){if(_0xf6b685){return _0x28cf67[_0xad2f('0x2d')](_0x84b8c2)[_0xad2f('0x2f')](_0xf6b685);}};}function respondWithFilteredResult(_0x49b506,_0x4edf18){return function(_0x192fcf){if(_0x192fcf){var _0x34035e=typeof _0x4edf18[_0xad2f('0x30')]===_0xad2f('0x31')&&typeof _0x4edf18[_0xad2f('0x32')]===_0xad2f('0x31');var _0x33fac2=_0x192fcf[_0xad2f('0x33')];var _0x44b150=_0x34035e?0x0:_0x4edf18[_0xad2f('0x30')];var _0x433c86=_0x34035e?_0x192fcf[_0xad2f('0x33')]:_0x4edf18[_0xad2f('0x30')]+_0x4edf18[_0xad2f('0x32')];var _0x6baa15;if(_0x433c86>=_0x33fac2){_0x433c86=_0x33fac2;_0x6baa15=0xc8;}else{_0x6baa15=0xce;}_0x49b506[_0xad2f('0x2d')](_0x6baa15);return _0x49b506[_0xad2f('0x34')](_0xad2f('0x35'),_0x44b150+'-'+_0x433c86+'/'+_0x33fac2)[_0xad2f('0x2f')](_0x192fcf);}return null;};}function patchUpdates(_0x224802){return function(_0x4d846c){try{jsonpatch['apply'](_0x4d846c,_0x224802,!![]);}catch(_0x38fb0e){return BPromise[_0xad2f('0x36')](_0x38fb0e);}return _0x4d846c['save']();};}function saveUpdates(_0x51f719,_0x555a5b){return function(_0x498569){if(_0x498569){return _0x498569[_0xad2f('0x37')](_0x51f719)[_0xad2f('0x38')](function(_0x1b8011){return _0x1b8011;});}return null;};}function removeEntity(_0x362a2e,_0x432b1d){return function(_0x46e66e){if(_0x46e66e){return _0x46e66e[_0xad2f('0x39')]()[_0xad2f('0x38')](function(){var _0x2f2a44=_0x46e66e[_0xad2f('0x3a')]({'plain':!![]});var _0x39628c='OpenchannelAccounts';return db[_0xad2f('0x3b')][_0xad2f('0x39')]({'where':{'type':_0x39628c,'resourceId':_0x2f2a44['id']}})[_0xad2f('0x38')](function(){return _0x46e66e;});})[_0xad2f('0x38')](function(){_0x362a2e[_0xad2f('0x2d')](0xcc)[_0xad2f('0x2e')]();});}};}function handleEntityNotFound(_0x3603d1,_0x2ef101){return function(_0x260087){if(!_0x260087){_0x3603d1[_0xad2f('0x2c')](0x194);}return _0x260087;};}function handleError(_0x3f5f2d,_0x3c982d){_0x3c982d=_0x3c982d||0x1f4;return function(_0x415185){logger[_0xad2f('0x27')](_0x415185[_0xad2f('0x3c')]);if(_0x415185[_0xad2f('0x3d')]){delete _0x415185[_0xad2f('0x3d')];}_0x3f5f2d[_0xad2f('0x2d')](_0x3c982d)[_0xad2f('0x3e')](_0x415185);};}exports[_0xad2f('0x3f')]=function(_0x1a035e,_0x577de3){var _0x3d92af={'include':[{'model':db[_0xad2f('0x40')],'as':_0xad2f('0x41')}]},_0xe67608={},_0x590f3c={'count':0x0,'rows':[]};var _0x28afef=_[_0xad2f('0x42')](db['OpenchannelAccount'][_0xad2f('0x43')],function(_0x3c7ac3){return{'name':_0x3c7ac3[_0xad2f('0x44')],'type':_0x3c7ac3[_0xad2f('0x45')][_0xad2f('0x46')]};});_0xe67608[_0xad2f('0x47')]=_[_0xad2f('0x42')](_0x28afef,'name');_0xe67608[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x1a035e[_0xad2f('0x48')]);_0xe67608['filters']=_[_0xad2f('0x4a')](_0xe67608['model'],_0xe67608[_0xad2f('0x48')]);_0x3d92af[_0xad2f('0x4b')]=_[_0xad2f('0x4a')](_0xe67608[_0xad2f('0x47')],qs[_0xad2f('0x4c')](_0x1a035e[_0xad2f('0x48')][_0xad2f('0x4c')]));_0x3d92af[_0xad2f('0x4b')]=_0x3d92af[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0x3d92af[_0xad2f('0x4b')]:_0xe67608[_0xad2f('0x47')];if(!_0x1a035e['query'][_0xad2f('0x4e')]('nolimit')){_0x3d92af[_0xad2f('0x32')]=qs[_0xad2f('0x32')](_0x1a035e[_0xad2f('0x48')][_0xad2f('0x32')]);_0x3d92af[_0xad2f('0x30')]=qs[_0xad2f('0x30')](_0x1a035e[_0xad2f('0x48')][_0xad2f('0x30')]);}_0x3d92af['order']=qs[_0xad2f('0x4f')](_0x1a035e[_0xad2f('0x48')][_0xad2f('0x4f')]);_0x3d92af[_0xad2f('0x50')]=qs[_0xad2f('0x51')](_[_0xad2f('0x52')](_0x1a035e[_0xad2f('0x48')],_0xe67608[_0xad2f('0x51')]),_0x28afef);if(_0x1a035e[_0xad2f('0x48')]['filter']){_0x3d92af[_0xad2f('0x50')]=_[_0xad2f('0x53')](_0x3d92af[_0xad2f('0x50')],{'$or':_['map'](_0x28afef,function(_0x81bf73){if(_0x81bf73['type']!==_0xad2f('0x54')){var _0x5a350c={};_0x5a350c[_0x81bf73[_0xad2f('0x3d')]]={'$like':'%'+_0x1a035e[_0xad2f('0x48')][_0xad2f('0x55')]+'%'};return _0x5a350c;}})});}_0x3d92af=_[_0xad2f('0x53')]({},_0x3d92af,_0x1a035e[_0xad2f('0x56')]);var _0x266960={'where':_0x3d92af[_0xad2f('0x50')]};return db[_0xad2f('0x57')][_0xad2f('0x33')](_0x266960)['then'](function(_0x460cb3){_0x590f3c[_0xad2f('0x33')]=_0x460cb3;if(_0x1a035e[_0xad2f('0x48')][_0xad2f('0x58')]){_0x3d92af[_0xad2f('0x59')]=[{'all':!![]}];}return db[_0xad2f('0x57')]['findAll'](_0x3d92af);})[_0xad2f('0x38')](function(_0x4710aa){_0x590f3c[_0xad2f('0x5a')]=_0x4710aa;return _0x590f3c;})[_0xad2f('0x38')](respondWithFilteredResult(_0x577de3,_0x3d92af))['catch'](handleError(_0x577de3,null));};exports[_0xad2f('0x5b')]=function(_0x491f68,_0x518a5c){var _0x27f60e={'raw':![],'where':{'id':_0x491f68[_0xad2f('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xad2f('0x41')}]},_0x170d8f={};_0x170d8f[_0xad2f('0x47')]=_[_0xad2f('0x49')](db[_0xad2f('0x57')][_0xad2f('0x43')]);_0x170d8f[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x491f68[_0xad2f('0x48')]);_0x170d8f[_0xad2f('0x51')]=_['intersection'](_0x170d8f['model'],_0x170d8f['query']);_0x27f60e[_0xad2f('0x4b')]=_[_0xad2f('0x4a')](_0x170d8f[_0xad2f('0x47')],qs['fields'](_0x491f68[_0xad2f('0x48')]['fields']));_0x27f60e[_0xad2f('0x4b')]=_0x27f60e[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0x27f60e[_0xad2f('0x4b')]:_0x170d8f[_0xad2f('0x47')];if(_0x491f68[_0xad2f('0x48')][_0xad2f('0x58')]){_0x27f60e['include']=[{'all':!![]}];}_0x27f60e=_[_0xad2f('0x53')]({},_0x27f60e,_0x491f68[_0xad2f('0x56')]);return db[_0xad2f('0x57')][_0xad2f('0x5d')](_0x27f60e)[_0xad2f('0x38')](handleEntityNotFound(_0x518a5c,null))[_0xad2f('0x38')](respondWithResult(_0x518a5c,null))['catch'](handleError(_0x518a5c,null));};exports['create']=function(_0x359f5a,_0x5467c4){return db[_0xad2f('0x57')]['create'](_0x359f5a[_0xad2f('0x5e')],{})['then'](function(_0x458a8c){var _0xd614c1=_0x359f5a[_0xad2f('0x5f')]['get']({'plain':!![]});if(!_0xd614c1)throw new Error(_0xad2f('0x60'));if(_0xd614c1[_0xad2f('0x61')]==='user'){var _0x3ba882=_0x458a8c[_0xad2f('0x3a')]({'plain':!![]});var _0x2f6a2d=_0xad2f('0x62');return db[_0xad2f('0x63')][_0xad2f('0x5d')]({'where':{'name':_0x2f6a2d,'userProfileId':_0xd614c1[_0xad2f('0x64')]},'raw':!![]})[_0xad2f('0x38')](function(_0xac5853){if(_0xac5853&&_0xac5853[_0xad2f('0x65')]===0x0){return db[_0xad2f('0x3b')][_0xad2f('0x66')]({'name':_0x3ba882['name'],'resourceId':_0x3ba882['id'],'type':_0xac5853[_0xad2f('0x3d')],'sectionId':_0xac5853['id']},{})[_0xad2f('0x38')](function(){return _0x458a8c;});}else{return _0x458a8c;}})[_0xad2f('0x2b')](function(_0x1fe60e){logger[_0xad2f('0x27')](_0xad2f('0x67'),_0x1fe60e);throw _0x1fe60e;});}return _0x458a8c;})[_0xad2f('0x38')](respondWithResult(_0x5467c4,0xc9))[_0xad2f('0x2b')](handleError(_0x5467c4,null));};exports[_0xad2f('0x37')]=function(_0x2d9510,_0x18a5d7){if(_0x2d9510['body']['id']){delete _0x2d9510[_0xad2f('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x2d9510[_0xad2f('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xad2f('0x41')}]})['then'](handleEntityNotFound(_0x18a5d7,null))[_0xad2f('0x38')](saveUpdates(_0x2d9510[_0xad2f('0x5e')],null))[_0xad2f('0x38')](respondWithResult(_0x18a5d7,null))[_0xad2f('0x2b')](handleError(_0x18a5d7,null));};exports['destroy']=function(_0x1e834d,_0x38a3d3){return db[_0xad2f('0x57')][_0xad2f('0x5d')]({'where':{'id':_0x1e834d[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x38a3d3,null))[_0xad2f('0x38')](removeEntity(_0x38a3d3,null))[_0xad2f('0x2b')](handleError(_0x38a3d3,null));};exports[_0xad2f('0x68')]=function(_0x3c68bc,_0x3c43cc){return db[_0xad2f('0x57')][_0xad2f('0x68')]()[_0xad2f('0x38')](respondWithResult(_0x3c43cc,null))['catch'](handleError(_0x3c43cc,null));};exports[_0xad2f('0x69')]=function(_0x3426cc,_0x24b328,_0x10e3e3){if(_0x3426cc[_0xad2f('0x5e')]['id']){delete _0x3426cc['body']['id'];}return db[_0xad2f('0x57')][_0xad2f('0x5d')]({'where':{'id':_0x3426cc[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x24b328,null))[_0xad2f('0x38')](function(_0x4ddb73){if(_0x4ddb73){_0x3426cc['body'][_0xad2f('0x6a')]=_0x4ddb73['id'];return db[_0xad2f('0x6b')]['create'](_0x3426cc[_0xad2f('0x5e')]);}})[_0xad2f('0x38')](respondWithResult(_0x24b328,null))[_0xad2f('0x2b')](handleError(_0x24b328,null));};exports[_0xad2f('0x6c')]=function(_0x2ef5cc,_0x654e48,_0x177011){var _0xe49d8c={'raw':![],'where':{}};var _0x56774c={};var _0x1678bd={'count':0x0,'rows':[]};return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x2ef5cc['params']['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x654e48,null))[_0xad2f('0x38')](function(_0xf2ba21){if(_0xf2ba21){_0x56774c[_0xad2f('0x47')]=_[_0xad2f('0x49')](db[_0xad2f('0x6b')][_0xad2f('0x43')]);_0x56774c[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x2ef5cc[_0xad2f('0x48')]);_0x56774c[_0xad2f('0x51')]=_[_0xad2f('0x4a')](_0x56774c[_0xad2f('0x47')],_0x56774c[_0xad2f('0x48')]);_0xe49d8c['attributes']=_[_0xad2f('0x4a')](_0x56774c['model'],qs[_0xad2f('0x4c')](_0x2ef5cc['query'][_0xad2f('0x4c')]));_0xe49d8c[_0xad2f('0x4b')]=_0xe49d8c[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0xe49d8c[_0xad2f('0x4b')]:_0x56774c['model'];if(!_0x2ef5cc[_0xad2f('0x48')][_0xad2f('0x4e')](_0xad2f('0x6e'))){_0xe49d8c[_0xad2f('0x32')]=qs[_0xad2f('0x32')](_0x2ef5cc[_0xad2f('0x48')]['limit']);_0xe49d8c['offset']=qs[_0xad2f('0x30')](_0x2ef5cc[_0xad2f('0x48')][_0xad2f('0x30')]);}_0xe49d8c[_0xad2f('0x6f')]=qs[_0xad2f('0x4f')](_0x2ef5cc[_0xad2f('0x48')][_0xad2f('0x4f')]);_0xe49d8c['where']=qs[_0xad2f('0x51')](_['pick'](_0x2ef5cc[_0xad2f('0x48')],_0x56774c[_0xad2f('0x51')]));_0xe49d8c[_0xad2f('0x50')][_0xad2f('0x6a')]=_0xf2ba21['id'];if(_0x2ef5cc[_0xad2f('0x48')]['filter']){_0xe49d8c[_0xad2f('0x50')]=_['merge'](_0xe49d8c[_0xad2f('0x50')],{'$or':_[_0xad2f('0x42')](_0xe49d8c[_0xad2f('0x4b')],function(_0x3dc8ab){var _0x95117={};_0x95117[_0x3dc8ab]={'$like':'%'+_0x2ef5cc[_0xad2f('0x48')][_0xad2f('0x55')]+'%'};return _0x95117;})});}_0xe49d8c=_[_0xad2f('0x53')]({},_0xe49d8c,_0x2ef5cc[_0xad2f('0x56')]);return db['Disposition'][_0xad2f('0x33')]({'where':_0xe49d8c['where']})[_0xad2f('0x38')](function(_0x5be5d1){_0x1678bd[_0xad2f('0x33')]=_0x5be5d1;if(_0x2ef5cc[_0xad2f('0x48')][_0xad2f('0x58')]){_0xe49d8c[_0xad2f('0x59')]=[{'all':!![]}];}return db[_0xad2f('0x6b')][_0xad2f('0x70')](_0xe49d8c);})[_0xad2f('0x38')](function(_0x42d69b){_0x1678bd[_0xad2f('0x5a')]=_0x42d69b;return _0x1678bd;});}})['then'](respondWithFilteredResult(_0x654e48,_0xe49d8c))[_0xad2f('0x2b')](handleError(_0x654e48,null));};exports[_0xad2f('0x71')]=function(_0x18e931,_0x380b96,_0x4e1e98){return db[_0xad2f('0x57')][_0xad2f('0x5d')]({'where':{'id':_0x18e931[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x380b96,null))['then'](function(_0xdd7bd8){if(_0xdd7bd8){return _0xdd7bd8[_0xad2f('0x71')](_0x18e931[_0xad2f('0x48')]['ids']);}})[_0xad2f('0x38')](respondWithStatusCode(_0x380b96,null))[_0xad2f('0x2b')](handleError(_0x380b96,null));};exports[_0xad2f('0x72')]=function(_0x42cdc0,_0xa5cb7b,_0x4e4806){if(_0x42cdc0[_0xad2f('0x5e')]['id']){delete _0x42cdc0[_0xad2f('0x5e')]['id'];}return db[_0xad2f('0x57')][_0xad2f('0x5d')]({'where':{'id':_0x42cdc0[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0xa5cb7b,null))['then'](function(_0x4639bf){if(_0x4639bf){_0x42cdc0[_0xad2f('0x5e')][_0xad2f('0x6a')]=_0x4639bf['id'];return db[_0xad2f('0x73')]['create'](_0x42cdc0[_0xad2f('0x5e')]);}})[_0xad2f('0x38')](respondWithResult(_0xa5cb7b,null))['catch'](handleError(_0xa5cb7b,null));};exports[_0xad2f('0x74')]=function(_0x4bc589,_0x11b4e3,_0x245fd3){var _0x5031f2={'raw':![],'where':{}};var _0x4ea6f9={};var _0xa5d39c={'count':0x0,'rows':[]};return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x4bc589[_0xad2f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x11b4e3,null))[_0xad2f('0x38')](function(_0x2c62ab){if(_0x2c62ab){_0x4ea6f9[_0xad2f('0x47')]=_['keys'](db[_0xad2f('0x73')]['rawAttributes']);_0x4ea6f9[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x4bc589[_0xad2f('0x48')]);_0x4ea6f9[_0xad2f('0x51')]=_['intersection'](_0x4ea6f9['model'],_0x4ea6f9[_0xad2f('0x48')]);_0x5031f2[_0xad2f('0x4b')]=_['intersection'](_0x4ea6f9[_0xad2f('0x47')],qs['fields'](_0x4bc589[_0xad2f('0x48')][_0xad2f('0x4c')]));_0x5031f2[_0xad2f('0x4b')]=_0x5031f2[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0x5031f2[_0xad2f('0x4b')]:_0x4ea6f9[_0xad2f('0x47')];if(!_0x4bc589['query'][_0xad2f('0x4e')](_0xad2f('0x6e'))){_0x5031f2['limit']=qs['limit'](_0x4bc589[_0xad2f('0x48')]['limit']);_0x5031f2[_0xad2f('0x30')]=qs[_0xad2f('0x30')](_0x4bc589[_0xad2f('0x48')][_0xad2f('0x30')]);}_0x5031f2[_0xad2f('0x6f')]=qs[_0xad2f('0x4f')](_0x4bc589[_0xad2f('0x48')]['sort']);_0x5031f2[_0xad2f('0x50')]=qs['filters'](_[_0xad2f('0x52')](_0x4bc589[_0xad2f('0x48')],_0x4ea6f9[_0xad2f('0x51')]));_0x5031f2[_0xad2f('0x50')]['OpenchannelAccountId']=_0x2c62ab['id'];if(_0x4bc589['query'][_0xad2f('0x55')]){_0x5031f2[_0xad2f('0x50')]=_[_0xad2f('0x53')](_0x5031f2['where'],{'$or':_[_0xad2f('0x42')](_0x5031f2[_0xad2f('0x4b')],function(_0x34cd44){var _0x1a7af5={};_0x1a7af5[_0x34cd44]={'$like':'%'+_0x4bc589[_0xad2f('0x48')][_0xad2f('0x55')]+'%'};return _0x1a7af5;})});}_0x5031f2=_[_0xad2f('0x53')]({},_0x5031f2,_0x4bc589['options']);return db['CannedAnswer']['count']({'where':_0x5031f2['where']})['then'](function(_0xdcaea4){_0xa5d39c['count']=_0xdcaea4;if(_0x4bc589[_0xad2f('0x48')]['includeAll']){_0x5031f2['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5031f2);})[_0xad2f('0x38')](function(_0x1210b2){_0xa5d39c[_0xad2f('0x5a')]=_0x1210b2;return _0xa5d39c;});}})[_0xad2f('0x38')](respondWithFilteredResult(_0x11b4e3,_0x5031f2))['catch'](handleError(_0x11b4e3,null));};exports['removeAnswers']=function(_0x57ce59,_0x371a17,_0x1f5dac){return db[_0xad2f('0x57')]['find']({'where':{'id':_0x57ce59['params']['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x371a17,null))[_0xad2f('0x38')](function(_0x1eff4a){if(_0x1eff4a){return _0x1eff4a[_0xad2f('0x75')](_0x57ce59[_0xad2f('0x48')][_0xad2f('0x76')]);}})[_0xad2f('0x38')](respondWithStatusCode(_0x371a17,null))['catch'](handleError(_0x371a17,null));};exports['notify']=function(_0x48aa6b,_0x21db9b,_0x581dd7){var _0xf0c9bc={'body':_0x48aa6b[_0xad2f('0x5e')],'channel':_0xad2f('0x77')};var _0x26875d=[];var _0x5a305c=[];var _0x1b525f={};var _0x2bb9db=![];return db[_0xad2f('0x78')][_0xad2f('0x68')]()['then'](function(_0x1572e5){if(!_0x1572e5){throw new db[(_0xad2f('0x79'))]['ValidationError'](_0xad2f('0x7a'));}_0x26875d=_['difference'](_[_0xad2f('0x49')](_0x1572e5),[_0xad2f('0x7b'),'updatedAt']);_0x5a305c=_[_0xad2f('0x7c')](_[_0xad2f('0x49')](_0x1572e5),[_0xad2f('0x7b'),_0xad2f('0x7d'),'CompanyId',_0xad2f('0x7e')]);if(_0x48aa6b['body']['id']){delete _0x48aa6b[_0xad2f('0x5e')]['id'];}if(_[_0xad2f('0x7f')](_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x80')])){throw new db[(_0xad2f('0x79'))][(_0xad2f('0x81'))](_0xad2f('0x82'));}if(_['isNil'](_0x48aa6b['body'][_0xad2f('0x5e')])||_0x48aa6b[_0xad2f('0x5e')]['body']===''){throw new db[(_0xad2f('0x79'))][(_0xad2f('0x81'))](_0xad2f('0x83'));}if(_[_0xad2f('0x7f')](_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x84')])){throw new db['Sequelize'][(_0xad2f('0x81'))](_0xad2f('0x85')+_0x5a305c);}if(!_[_0xad2f('0x86')](_0x5a305c,_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x84')])){throw new db[(_0xad2f('0x79'))][(_0xad2f('0x81'))](_0xad2f('0x87')+_0x5a305c);}_0x1b525f[_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x84')]]=_0x48aa6b[_0xad2f('0x5e')]['from'];})[_0xad2f('0x38')](function(){return db['OpenchannelAccount'][_0xad2f('0x5d')]({'where':{'id':_0x48aa6b['params']['id']},'include':[{'model':db['CmList'],'as':_0xad2f('0x88'),'include':[{'model':db[_0xad2f('0x78')],'as':'Contacts','where':_0x1b525f,'limit':0x1,'order':[[_0xad2f('0x7d'),_0xad2f('0x89')]]}]},{'model':db[_0xad2f('0x8a')],'as':'Applications'}]});})[_0xad2f('0x38')](handleEntityNotFound(_0x21db9b,null))[_0xad2f('0x38')](function(_0x319362){if(_0x319362&&_0x319362[_0xad2f('0x88')]){_0xf0c9bc['account']=_0x319362;_0xf0c9bc[_0xad2f('0x8b')]=_0x319362[_0xad2f('0x8c')];_0xf0c9bc[_0xad2f('0x8d')]=_0x319362[_0xad2f('0x88')];_0xf0c9bc[_0xad2f('0x8b')]=_[_0xad2f('0x8e')](_0xf0c9bc[_0xad2f('0x8b')],[_0xad2f('0x8f')],[_0xad2f('0x90')]);if(_0xf0c9bc['account'][_0xad2f('0x8c')]){delete _0xf0c9bc[_0xad2f('0x91')][_0xad2f('0x8c')];}if(_0xf0c9bc[_0xad2f('0x91')]['List']&&_0xf0c9bc[_0xad2f('0x91')][_0xad2f('0x88')]['Contacts'][_0xad2f('0x4d')]){return _0xf0c9bc[_0xad2f('0x91')]['List'][_0xad2f('0x92')][0x0];}var _0x28ad7e=_['defaults'](_0x48aa6b['body'],{'firstName':_0x48aa6b['body'][_0xad2f('0x80')],'ListId':_0x319362[_0xad2f('0x7e')]});_0x28ad7e[_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x84')]]=_0x48aa6b['body'][_0xad2f('0x80')];return db['CmContact'][_0xad2f('0x66')](_0x28ad7e,{'fields':_0x26875d,'raw':!![]});}})['then'](handleEntityNotFound(_0x21db9b,null))[_0xad2f('0x38')](function(_0x3c7d6a){_0xf0c9bc['contact']=_0x3c7d6a;if(_0x3c7d6a){var _0x3d8194={'ContactId':_0x3c7d6a['id'],'OpenchannelAccountId':_0x48aa6b[_0xad2f('0x5c')]['id'],'from':(_0x3c7d6a[_0xad2f('0x93')]||'')+'\x20'+(_0x3c7d6a[_0xad2f('0x94')]||'')};var _0x101ab6={'OpenchannelAccountId':_0x48aa6b['params']['id'],'closed':![]};if(_0x48aa6b[_0xad2f('0x5e')]['threadId']){_0x101ab6[_0xad2f('0x95')]=_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x95')];return db['OpenchannelInteraction'][_0xad2f('0x5d')]({'where':_0x101ab6})['then'](function(_0x3d6c2c){if(_0x3d6c2c){return[_0x3d6c2c,![]];}_0x3d8194[_0xad2f('0x95')]=_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x95')];_0x3d8194[_0xad2f('0x96')]=_0x48aa6b[_0xad2f('0x5e')]['externalUrl'];return db[_0xad2f('0x97')][_0xad2f('0x66')](_0x3d8194)[_0xad2f('0x38')](function(_0x14d94c){return[_0x14d94c,!![]];});});}else{_0x101ab6['threadId']=null;}_0x101ab6[_0xad2f('0x98')]=_0x3c7d6a['id'];return db[_0xad2f('0x97')][_0xad2f('0x5d')]({'where':_0x101ab6})[_0xad2f('0x38')](function(_0x1ece7c){if(_0x1ece7c){return[_0x1ece7c,![]];}return db['OpenchannelInteraction'][_0xad2f('0x66')](_0x3d8194)[_0xad2f('0x38')](function(_0x214d24){return[_0x214d24,!![]];});});}})[_0xad2f('0x99')](function(_0x582a22,_0x4b8f44){if(_0x582a22){_0x2bb9db=_0x4b8f44;if(!_0x4b8f44){var _0x85ae50={'from':(_0xf0c9bc[_0xad2f('0x9a')][_0xad2f('0x93')]||'')+'\x20'+(_0xf0c9bc[_0xad2f('0x9a')][_0xad2f('0x94')]||'')};if(_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x95')]&&_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x9b')]&&_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x95')]!=_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x9b')]){_0x85ae50[_0xad2f('0x95')]=_0x48aa6b['body'][_0xad2f('0x9b')];}return _0x582a22[_0xad2f('0x37')](_0x85ae50);}else{return _0x582a22;}}})[_0xad2f('0x38')](function(_0x366cb5){_0xf0c9bc[_0xad2f('0x9c')]=_0x366cb5[_0xad2f('0x3a')]({'plain':!![]});_0xf0c9bc[_0xad2f('0x9c')][_0xad2f('0x9d')]=_0x2bb9db;if(_0xf0c9bc[_0xad2f('0x9c')][_0xad2f('0x9d')]){if(_0xf0c9bc[_0xad2f('0x91')]['autoclose']){_0xf0c9bc[_0xad2f('0x8b')][_0xad2f('0x9e')]({'id':0x0,'priority':_0xf0c9bc[_0xad2f('0x8b')][_0xad2f('0x4d')]+0x1,'app':_0xad2f('0x9f'),'appdata':'unmanaged','interval':_0xad2f('0xa0')});}}return db[_0xad2f('0xa1')][_0xad2f('0x66')]({'body':_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0x5e')],'OpenchannelAccountId':_0x48aa6b[_0xad2f('0x5c')]['id'],'OpenchannelInteractionId':_0x366cb5['id'],'direction':'in','ContactId':_0xf0c9bc[_0xad2f('0x9a')]['id'],'AttachmentId':_0x48aa6b[_0xad2f('0x5e')][_0xad2f('0xa2')]});})[_0xad2f('0x38')](function(_0x12d5b5){_0xf0c9bc[_0xad2f('0x29')]=_0x12d5b5;if(_0xf0c9bc[_0xad2f('0x9c')][_0xad2f('0xa3')]){return db[_0xad2f('0xa4')][_0xad2f('0x5d')]({'attributes':['id','name'],'where':{'id':_0xf0c9bc[_0xad2f('0x9c')][_0xad2f('0xa3')]}})[_0xad2f('0x38')](function(_0x39d70b){if(_0x39d70b){_0xf0c9bc['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xad2f('0xa5'),'appdata':_0x39d70b[_0xad2f('0x3d')]+','+(_0xf0c9bc[_0xad2f('0x91')][_0xad2f('0xa6')]||0xa),'interval':'*,*,*,*'});_0xf0c9bc[_0xad2f('0xa7')]=![];}return respondWithRpcPromise('Start',_0xad2f('0xa8'),_0xf0c9bc);});}return respondWithRpcPromise(_0xad2f('0xa9'),_0xad2f('0xa8'),_0xf0c9bc);})[_0xad2f('0x38')](function(_0xbe5f16){respondWithRpcPromise(_0xad2f('0xaa'),_0xad2f('0xaa'),{'event':_0xad2f('0xab'),'message':_0xbe5f16},client9002);return _0xbe5f16;})[_0xad2f('0x38')](respondWithResult(_0x21db9b,null))[_0xad2f('0x2b')](handleError(_0x21db9b,null));};exports[_0xad2f('0xac')]=function(_0x2c0eba,_0x7e974c,_0x205eb8){return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x2c0eba[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x7e974c,null))[_0xad2f('0x38')](function(_0x2c8b91){if(_0x2c8b91){return db[_0xad2f('0xad')]['transaction'](function(_0x349120){return db['OpenchannelApplication'][_0xad2f('0x39')]({'where':{'OpenchannelAccountId':_0x2c0eba[_0xad2f('0x5c')]['id']},'transaction':_0x349120})['then'](function(_0x5af333){var _0x198eb4=_[_0xad2f('0x42')](_0x2c0eba[_0xad2f('0x5e')],function(_0x24232f){_0x24232f['OpenchannelAccountId']=_0x2c0eba['params']['id'];return _0x24232f;});return db[_0xad2f('0x8a')][_0xad2f('0xae')](_0x198eb4,{'transaction':_0x349120});});})[_0xad2f('0x38')](function(){return db[_0xad2f('0x8a')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2c0eba['params']['id']},'order':_0xad2f('0x8f')});});}})[_0xad2f('0x38')](respondWithResult(_0x7e974c,null))[_0xad2f('0x2b')](handleError(_0x7e974c,null));};exports[_0xad2f('0xaf')]=function(_0x291418,_0x4b0e33,_0x2dd4a4){var _0x524e74={};var _0x360c4e={};var _0x2d475c;var _0x48ed3e;return db[_0xad2f('0x57')]['findOne']({'where':{'id':_0x291418['params']['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x4b0e33,null))['then'](function(_0x2eecc6){if(_0x2eecc6){_0x2d475c=_0x2eecc6;_0x360c4e['model']=_[_0xad2f('0x49')](db[_0xad2f('0x8a')][_0xad2f('0x43')]);_0x360c4e[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x291418[_0xad2f('0x48')]);_0x360c4e[_0xad2f('0x51')]=_[_0xad2f('0x4a')](_0x360c4e['model'],_0x360c4e[_0xad2f('0x48')]);_0x524e74[_0xad2f('0x4b')]=_['intersection'](_0x360c4e[_0xad2f('0x47')],qs[_0xad2f('0x4c')](_0x291418[_0xad2f('0x48')][_0xad2f('0x4c')]));_0x524e74[_0xad2f('0x4b')]=_0x524e74[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0x524e74['attributes']:_0x360c4e['model'];_0x524e74[_0xad2f('0x6f')]=qs[_0xad2f('0x4f')](_0x291418[_0xad2f('0x48')][_0xad2f('0x4f')]);_0x524e74[_0xad2f('0x50')]=qs[_0xad2f('0x51')](_[_0xad2f('0x52')](_0x291418[_0xad2f('0x48')],_0x360c4e[_0xad2f('0x51')]));if(_0x291418[_0xad2f('0x48')]['filter']){_0x524e74['where']=_[_0xad2f('0x53')](_0x524e74[_0xad2f('0x50')],{'$or':_[_0xad2f('0x42')](_0x524e74[_0xad2f('0x4b')],function(_0x4659a6){var _0x5bb811={};_0x5bb811[_0x4659a6]={'$like':'%'+_0x291418['query'][_0xad2f('0x55')]+'%'};return _0x5bb811;})});}_0x524e74=_[_0xad2f('0x53')]({},_0x524e74,_0x291418[_0xad2f('0x56')]);return _0x2d475c[_0xad2f('0xaf')](_0x524e74);}})[_0xad2f('0x38')](function(_0x3c4fa2){if(_0x3c4fa2){_0x48ed3e=_0x3c4fa2[_0xad2f('0x4d')];if(!_0x291418[_0xad2f('0x48')][_0xad2f('0x4e')](_0xad2f('0x6e'))){_0x524e74[_0xad2f('0x32')]=qs[_0xad2f('0x32')](_0x291418['query'][_0xad2f('0x32')]);_0x524e74[_0xad2f('0x30')]=qs[_0xad2f('0x30')](_0x291418[_0xad2f('0x48')][_0xad2f('0x30')]);}return _0x2d475c[_0xad2f('0xaf')](_0x524e74);}})[_0xad2f('0x38')](function(_0x3bfb35){if(_0x3bfb35){return _0x3bfb35?{'count':_0x48ed3e,'rows':_0x3bfb35}:null;}})['then'](respondWithResult(_0x4b0e33,null))['catch'](handleError(_0x4b0e33,null));};exports[_0xad2f('0xb0')]=function(_0x27f6eb,_0x182f0b,_0x42d01d){var _0x384ea8={'raw':![],'where':{}};var _0x516899={};var _0x24f5c5={'count':0x0,'rows':[]};return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x27f6eb[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x182f0b,null))[_0xad2f('0x38')](function(_0x4694f2){if(_0x4694f2){_0x516899[_0xad2f('0x47')]=_['keys'](db['OpenchannelInteraction'][_0xad2f('0x43')]);_0x516899[_0xad2f('0x48')]=_[_0xad2f('0x49')](_0x27f6eb[_0xad2f('0x48')]);_0x516899[_0xad2f('0x51')]=_[_0xad2f('0x4a')](_0x516899[_0xad2f('0x47')],_0x516899[_0xad2f('0x48')]);_0x384ea8[_0xad2f('0x4b')]=_[_0xad2f('0x4a')](_0x516899[_0xad2f('0x47')],qs['fields'](_0x27f6eb[_0xad2f('0x48')]['fields']));_0x384ea8[_0xad2f('0x4b')]=_0x384ea8[_0xad2f('0x4b')][_0xad2f('0x4d')]?_0x384ea8[_0xad2f('0x4b')]:_0x516899[_0xad2f('0x47')];if(!_0x27f6eb['query'][_0xad2f('0x4e')]('nolimit')){_0x384ea8[_0xad2f('0x32')]=qs[_0xad2f('0x32')](_0x27f6eb[_0xad2f('0x48')][_0xad2f('0x32')]);_0x384ea8[_0xad2f('0x30')]=qs[_0xad2f('0x30')](_0x27f6eb[_0xad2f('0x48')][_0xad2f('0x30')]);}_0x384ea8[_0xad2f('0x6f')]=qs[_0xad2f('0x4f')](_0x27f6eb[_0xad2f('0x48')]['sort']);_0x384ea8['where']=qs[_0xad2f('0x51')](_[_0xad2f('0x52')](_0x27f6eb[_0xad2f('0x48')],_0x516899[_0xad2f('0x51')]));_0x384ea8[_0xad2f('0x50')][_0xad2f('0x6a')]=_0x4694f2['id'];if(_0x27f6eb[_0xad2f('0x48')][_0xad2f('0x55')]){_0x384ea8[_0xad2f('0x50')]=_[_0xad2f('0x53')](_0x384ea8['where'],{'$or':_[_0xad2f('0x42')](_0x384ea8['attributes'],function(_0x479bf7){var _0x536c46={};_0x536c46[_0x479bf7]={'$like':'%'+_0x27f6eb['query'][_0xad2f('0x55')]+'%'};return _0x536c46;})});}_0x384ea8=_[_0xad2f('0x53')]({},_0x384ea8,_0x27f6eb['options']);return db[_0xad2f('0x97')][_0xad2f('0x33')]({'where':_0x384ea8[_0xad2f('0x50')]})[_0xad2f('0x38')](function(_0x7485d1){_0x24f5c5[_0xad2f('0x33')]=_0x7485d1;if(_0x27f6eb[_0xad2f('0x48')][_0xad2f('0x58')]){_0x384ea8[_0xad2f('0x59')]=[{'model':db[_0xad2f('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xad2f('0xb1'),'attributes':['name',_0xad2f('0xb2'),_0xad2f('0xb3')],'required':![]},{'model':db[_0xad2f('0xb4')],'as':_0xad2f('0xb5'),'attributes':['id',_0xad2f('0x3d'),_0xad2f('0xb6')],'where':_0x27f6eb['query'][_0xad2f('0xb7')]?{'id':_0x27f6eb[_0xad2f('0x48')]['tag']}:undefined,'required':_0x27f6eb[_0xad2f('0x48')]['tag']?!![]:![]}];}return db[_0xad2f('0x97')]['findAll'](_0x384ea8);})[_0xad2f('0x38')](function(_0x3a4503){_0x24f5c5[_0xad2f('0x5a')]=_0x3a4503;return _0x24f5c5;});}})['then'](respondWithFilteredResult(_0x182f0b,_0x384ea8))['catch'](handleError(_0x182f0b,null));};exports[_0xad2f('0xb8')]=function(_0x8d3554,_0x130f4a,_0x25b50f){return db['OpenchannelAccount'][_0xad2f('0x5d')]({'where':{'id':_0x8d3554[_0xad2f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x130f4a,null))[_0xad2f('0x38')](function(_0x52043b){if(_0x52043b){return _0x52043b[_0xad2f('0xb8')](_0x8d3554[_0xad2f('0x5e')][_0xad2f('0x76')],_[_0xad2f('0xb9')](_0x8d3554['body'],[_0xad2f('0x76'),'id'])||{})[_0xad2f('0x99')](function(_0x528caa){for(var _0x2ad79f=0x0;_0x2ad79f<_0x8d3554['body']['ids']['length'];_0x2ad79f+=0x1){socket['emit'](_0xad2f('0xba'),{'UserId':Number(_0x8d3554[_0xad2f('0x5e')]['ids'][_0x2ad79f]),'OpenchannelAccountId':Number(_0x8d3554[_0xad2f('0x5c')]['id'])});}return _0x528caa;});}})[_0xad2f('0x38')](respondWithResult(_0x130f4a,null))[_0xad2f('0x2b')](handleError(_0x130f4a,null));};exports[_0xad2f('0xbb')]=function(_0x122671,_0x271a62,_0x43d72d){return db[_0xad2f('0x57')][_0xad2f('0x5d')]({'where':{'id':_0x122671[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x271a62,null))[_0xad2f('0x38')](function(_0x20c350){if(_0x20c350){return _0x20c350['removeAgents'](_0x122671[_0xad2f('0x48')][_0xad2f('0x76')])[_0xad2f('0x38')](function(){if(_['isArray'](_0x122671['query'][_0xad2f('0x76')])){for(var _0x54451e=0x0;_0x54451e<_0x122671[_0xad2f('0x48')][_0xad2f('0x76')]['length'];_0x54451e+=0x1){socket[_0xad2f('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x122671[_0xad2f('0x48')][_0xad2f('0x76')][_0x54451e]),'OpenchannelAccountId':Number(_0x122671[_0xad2f('0x5c')]['id'])});}}else{socket[_0xad2f('0xbc')](_0xad2f('0xbd'),{'UserId':Number(_0x122671[_0xad2f('0x48')]['ids']),'OpenchannelAccountId':Number(_0x122671['params']['id'])});}});}})['then'](respondWithStatusCode(_0x271a62,null))[_0xad2f('0x2b')](handleError(_0x271a62,null));};exports['getAgents']=function(_0x39696d,_0x329d60,_0x24df98){var _0xf81313={};var _0x5f4c01={};var _0x33149e;var _0x343086;return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x39696d[_0xad2f('0x5c')]['id']}})[_0xad2f('0x38')](handleEntityNotFound(_0x329d60,null))[_0xad2f('0x38')](function(_0x175475){if(_0x175475){_0x33149e=_0x175475;_0x5f4c01[_0xad2f('0x47')]=_[_0xad2f('0x49')](db['User'][_0xad2f('0x43')]);_0x5f4c01['query']=_['keys'](_0x39696d[_0xad2f('0x48')]);_0x5f4c01['filters']=_[_0xad2f('0x4a')](_0x5f4c01['model'],_0x5f4c01['query']);_0xf81313[_0xad2f('0x4b')]=_[_0xad2f('0x4a')](_0x5f4c01[_0xad2f('0x47')],qs[_0xad2f('0x4c')](_0x39696d['query'][_0xad2f('0x4c')]));_0xf81313['attributes']=_0xf81313[_0xad2f('0x4b')]['length']?_0xf81313[_0xad2f('0x4b')]:_0x5f4c01[_0xad2f('0x47')];_0xf81313[_0xad2f('0x6f')]=qs[_0xad2f('0x4f')](_0x39696d[_0xad2f('0x48')]['sort']);_0xf81313[_0xad2f('0x50')]=qs[_0xad2f('0x51')](_[_0xad2f('0x52')](_0x39696d[_0xad2f('0x48')],_0x5f4c01[_0xad2f('0x51')]));if(_0x39696d['query'][_0xad2f('0x55')]){_0xf81313['where']=_[_0xad2f('0x53')](_0xf81313['where'],{'$or':_[_0xad2f('0x42')](_0xf81313['attributes'],function(_0x1a790a){var _0x3cccfa={};_0x3cccfa[_0x1a790a]={'$like':'%'+_0x39696d[_0xad2f('0x48')][_0xad2f('0x55')]+'%'};return _0x3cccfa;})});}_0xf81313=_[_0xad2f('0x53')]({},_0xf81313,_0x39696d[_0xad2f('0x56')]);return _0x33149e[_0xad2f('0xbe')](_0xf81313);}})[_0xad2f('0x38')](function(_0x4fec3d){if(_0x4fec3d){_0x343086=_0x4fec3d[_0xad2f('0x4d')];if(!_0x39696d[_0xad2f('0x48')][_0xad2f('0x4e')](_0xad2f('0x6e'))){_0xf81313['limit']=qs[_0xad2f('0x32')](_0x39696d[_0xad2f('0x48')][_0xad2f('0x32')]);_0xf81313['offset']=qs[_0xad2f('0x30')](_0x39696d[_0xad2f('0x48')][_0xad2f('0x30')]);}return _0x33149e[_0xad2f('0xbe')](_0xf81313);}})[_0xad2f('0x38')](function(_0x4251ee){if(_0x4251ee){return _0x4251ee?{'count':_0x343086,'rows':_0x4251ee}:null;}})[_0xad2f('0x38')](respondWithResult(_0x329d60,null))[_0xad2f('0x2b')](handleError(_0x329d60,null));};exports[_0xad2f('0x3e')]=function(_0x1f38d4,_0x3c5193,_0x4f9768){var _0x152030,_0x42af1f,_0x2d7393;if(_[_0xad2f('0x7f')](_0x1f38d4[_0xad2f('0x5e')][_0xad2f('0x5e')])||_0x1f38d4['body'][_0xad2f('0x5e')]===''){throw new db['Sequelize'][(_0xad2f('0x81'))](_0xad2f('0x83'));}if(_[_0xad2f('0x7f')](_0x1f38d4[_0xad2f('0x5e')]['to'])){}_0x152030=_0x1f38d4[_0xad2f('0x5e')]['to'];return db[_0xad2f('0x57')][_0xad2f('0x6d')]({'where':{'id':_0x1f38d4[_0xad2f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c5193,null))[_0xad2f('0x38')](function(_0x2bad07){if(_0x2bad07){return db['OpenchannelAccount']['find']({'where':{'id':_0x2bad07['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xad2f('0x78')],'as':_0xad2f('0x92'),'where':{[_0x2bad07['mapKey']]:_0x152030},'limit':0x1,'order':[['updatedAt',_0xad2f('0x89')]]}]}]})['then'](handleEntityNotFound(_0x3c5193,null))[_0xad2f('0x38')](function(_0x3c582a){if(_0x3c582a&&_0x3c582a['List']){_0x42af1f=_0x3c582a[_0xad2f('0x3a')]({'plain':!![]});if(_0x42af1f[_0xad2f('0x88')]&&_0x42af1f[_0xad2f('0x88')]['Contacts'][_0xad2f('0x4d')]){return _0x42af1f[_0xad2f('0x88')][_0xad2f('0x92')][0x0];}return db['CmContact'][_0xad2f('0x66')](_[_0xad2f('0x19')](_0x1f38d4[_0xad2f('0x5e')],{'firstName':_0x152030,[_0x3c582a[_0xad2f('0x84')]]:_0x152030,'phone':_0x152030,'ListId':_0x42af1f[_0xad2f('0x7e')]}));}})[_0xad2f('0x38')](handleEntityNotFound(_0x3c5193,null))[_0xad2f('0x38')](function(_0x500239){if(_0x500239){_0x2d7393=_0x500239;return db[_0xad2f('0x97')]['find']({'where':{'ContactId':_0x2d7393['id'],'closed':![],'OpenchannelAccountId':_0x42af1f['id']}})['then'](function(_0x5b9e71){if(_0x5b9e71){return[_0x5b9e71,![]];}return db[_0xad2f('0x97')][_0xad2f('0x66')]({'UserId':_0x1f38d4[_0xad2f('0x5f')]['id'],'ContactId':_0x2d7393['id'],'OpenchannelAccountId':_0x42af1f['id'],'lastMsgDirection':_0xad2f('0xbf'),'Messages':[_[_0xad2f('0x53')](_0x1f38d4[_0xad2f('0x5e')],{'read':![],'body':_0x1f38d4[_0xad2f('0x5e')][_0xad2f('0x5e')],'OpenchannelAccountId':_0x42af1f['id'],'UserId':_0x1f38d4[_0xad2f('0x5f')]['id'],'ContactId':_0x2d7393['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xad2f('0xc0')}]})[_0xad2f('0x38')](function(_0x1be2a6){return[_0x1be2a6,!![]];});});}})[_0xad2f('0x99')](function(_0x475156,_0x5d26a9){if(_0x5d26a9){return _0x475156;}return db[_0xad2f('0xa1')][_0xad2f('0x66')](_[_0xad2f('0x53')](_0x1f38d4[_0xad2f('0x5e')],{'read':![],'body':_0x1f38d4[_0xad2f('0x5e')][_0xad2f('0x5e')],'OpenchannelAccountId':_0x42af1f['id'],'OpenchannelInteractionId':_0x475156['id'],'UserId':_0x1f38d4[_0xad2f('0x5f')]['id'],'ContactId':_0x2d7393['id']}))[_0xad2f('0x38')](function(_0x4326d1){_0x475156[_0xad2f('0xc1')][_0xad2f('0xc0')]=[];_0x475156['dataValues']['Messages'][_0xad2f('0x9e')](_0x4326d1[_0xad2f('0xc1')]);return _0x475156;});});}})[_0xad2f('0x38')](respondWithResult(_0x3c5193,null))[_0xad2f('0x2b')](handleError(_0x3c5193,null));}; \ No newline at end of file +var _0x0bc6=['OpenchannelAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','Disposition','getDispositions','findOne','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','applications','orderBy','asc','account','ListId','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','destroy','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','OpenchannelAccounts','UserProfileResource','end','name','send','Pause','mandatoryDispositionPause','map'];(function(_0x523c25,_0x5e33e7){var _0x222c8c=function(_0xfaa0d9){while(--_0xfaa0d9){_0x523c25['push'](_0x523c25['shift']());}};_0x222c8c(++_0x5e33e7);}(_0x0bc6,0x1e7));var _0x60bc=function(_0x1ccac2,_0x1accaf){_0x1ccac2=_0x1ccac2-0x0;var _0x3a8c4c=_0x0bc6[_0x1ccac2];return _0x3a8c4c;};'use strict';var emlformat=require(_0x60bc('0x0'));var rimraf=require(_0x60bc('0x1'));var zipdir=require(_0x60bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60bc('0x3'));var moment=require(_0x60bc('0x4'));var BPromise=require(_0x60bc('0x5'));var Mustache=require(_0x60bc('0x6'));var util=require('util');var path=require(_0x60bc('0x7'));var sox=require(_0x60bc('0x8'));var csv=require(_0x60bc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60bc('0xa'));var _=require(_0x60bc('0xb'));var squel=require(_0x60bc('0xc'));var crypto=require('crypto');var jsforce=require(_0x60bc('0xd'));var deskjs=require(_0x60bc('0xe'));var toCsv=require(_0x60bc('0x9'));var querystring=require(_0x60bc('0xf'));var Papa=require(_0x60bc('0x10'));var Redis=require('ioredis');var authService=require(_0x60bc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60bc('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x60bc('0x13'));var config=require(_0x60bc('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x60bc('0x15'))['db'];config['redis']=_[_0x60bc('0x16')](config[_0x60bc('0x17')],{'host':_0x60bc('0x18'),'port':0x18eb});var socket=require(_0x60bc('0x19'))(new Redis(config[_0x60bc('0x17')]));require('./openchannelAccount.socket')[_0x60bc('0x1a')](socket);var jayson=require(_0x60bc('0x1b'));var client=jayson[_0x60bc('0x1c')][_0x60bc('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x60bc('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x320581,_0x18c7d3,_0x4e0ba2,_0x427069){return new BPromise(function(_0x48b152,_0xdd80fb){var _0x5630cc=_0x427069||client;return _0x5630cc[_0x60bc('0x1e')](_0x320581,_0x4e0ba2)[_0x60bc('0x1f')](function(_0x35c564){logger[_0x60bc('0x20')](_0x60bc('0x21'),_0x18c7d3,_0x60bc('0x22'));logger[_0x60bc('0x23')](_0x60bc('0x24'),_0x18c7d3,_0x60bc('0x22'),JSON['stringify'](_0x35c564));if(_0x35c564['error']){if(_0x35c564['error']['code']===0x1f4){logger['error'](_0x60bc('0x21'),_0x18c7d3,_0x35c564[_0x60bc('0x25')][_0x60bc('0x26')]);return _0xdd80fb(_0x35c564[_0x60bc('0x25')][_0x60bc('0x26')]);}logger[_0x60bc('0x25')](_0x60bc('0x21'),_0x18c7d3,_0x35c564[_0x60bc('0x25')][_0x60bc('0x26')]);return _0x48b152(_0x35c564[_0x60bc('0x25')]['message']);}else{logger[_0x60bc('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x18c7d3,'request\x20sent');_0x48b152(_0x35c564['result'][_0x60bc('0x26')]);}})[_0x60bc('0x27')](function(_0x479163){logger[_0x60bc('0x25')](_0x60bc('0x21'),_0x18c7d3,_0x479163);_0xdd80fb(_0x479163);});});}function respondWithStatusCode(_0x49cf1b,_0x3b62cc){_0x3b62cc=_0x3b62cc||0xcc;return function(_0x59209c){if(_0x59209c){return _0x49cf1b[_0x60bc('0x28')](_0x3b62cc);}return _0x49cf1b['status'](_0x3b62cc)['end']();};}function respondWithResult(_0xf0c4a3,_0x281175){_0x281175=_0x281175||0xc8;return function(_0x35cea4){if(_0x35cea4){return _0xf0c4a3[_0x60bc('0x29')](_0x281175)[_0x60bc('0x2a')](_0x35cea4);}};}function respondWithFilteredResult(_0x5129e8,_0x5387d7){return function(_0x32c0d5){if(_0x32c0d5){var _0x1dbff0=typeof _0x5387d7[_0x60bc('0x2b')]===_0x60bc('0x2c')&&typeof _0x5387d7[_0x60bc('0x2d')]===_0x60bc('0x2c');var _0x243794=_0x32c0d5[_0x60bc('0x2e')];var _0x21ec8f=_0x1dbff0?0x0:_0x5387d7[_0x60bc('0x2b')];var _0x8034c=_0x1dbff0?_0x32c0d5[_0x60bc('0x2e')]:_0x5387d7[_0x60bc('0x2b')]+_0x5387d7[_0x60bc('0x2d')];var _0x2a4962;if(_0x8034c>=_0x243794){_0x8034c=_0x243794;_0x2a4962=0xc8;}else{_0x2a4962=0xce;}_0x5129e8['status'](_0x2a4962);return _0x5129e8[_0x60bc('0x2f')](_0x60bc('0x30'),_0x21ec8f+'-'+_0x8034c+'/'+_0x243794)[_0x60bc('0x2a')](_0x32c0d5);}return null;};}function patchUpdates(_0x5750be){return function(_0x2177ed){try{jsonpatch[_0x60bc('0x31')](_0x2177ed,_0x5750be,!![]);}catch(_0x254a92){return BPromise[_0x60bc('0x32')](_0x254a92);}return _0x2177ed[_0x60bc('0x33')]();};}function saveUpdates(_0xf8a05e,_0x2d2fc0){return function(_0x5d3c93){if(_0x5d3c93){return _0x5d3c93[_0x60bc('0x34')](_0xf8a05e)[_0x60bc('0x1f')](function(_0x317aba){return _0x317aba;});}return null;};}function removeEntity(_0x5e0b6d,_0x128cd4){return function(_0x5b679a){if(_0x5b679a){return _0x5b679a['destroy']()[_0x60bc('0x1f')](function(){var _0x34872c=_0x5b679a[_0x60bc('0x35')]({'plain':!![]});var _0x597ba0=_0x60bc('0x36');return db[_0x60bc('0x37')]['destroy']({'where':{'type':_0x597ba0,'resourceId':_0x34872c['id']}})[_0x60bc('0x1f')](function(){return _0x5b679a;});})['then'](function(){_0x5e0b6d[_0x60bc('0x29')](0xcc)[_0x60bc('0x38')]();});}};}function handleEntityNotFound(_0x546edb,_0x59d0df){return function(_0xaefe2d){if(!_0xaefe2d){_0x546edb[_0x60bc('0x28')](0x194);}return _0xaefe2d;};}function handleError(_0x3bce43,_0x3b2418){_0x3b2418=_0x3b2418||0x1f4;return function(_0x15b18b){logger[_0x60bc('0x25')](_0x15b18b['stack']);if(_0x15b18b['name']){delete _0x15b18b[_0x60bc('0x39')];}_0x3bce43[_0x60bc('0x29')](_0x3b2418)[_0x60bc('0x3a')](_0x15b18b);};}exports['index']=function(_0x307617,_0x416fc0){var _0x502e85={'include':[{'model':db[_0x60bc('0x3b')],'as':_0x60bc('0x3c')}]},_0x1e0992={},_0x12deae={'count':0x0,'rows':[]};var _0x30d26d=_[_0x60bc('0x3d')](db[_0x60bc('0x3e')][_0x60bc('0x3f')],function(_0x290b49){return{'name':_0x290b49['fieldName'],'type':_0x290b49[_0x60bc('0x40')][_0x60bc('0x41')]};});_0x1e0992[_0x60bc('0x42')]=_['map'](_0x30d26d,'name');_0x1e0992['query']=_[_0x60bc('0x43')](_0x307617[_0x60bc('0x44')]);_0x1e0992[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x1e0992[_0x60bc('0x42')],_0x1e0992[_0x60bc('0x44')]);_0x502e85[_0x60bc('0x47')]=_[_0x60bc('0x46')](_0x1e0992['model'],qs[_0x60bc('0x48')](_0x307617[_0x60bc('0x44')][_0x60bc('0x48')]));_0x502e85[_0x60bc('0x47')]=_0x502e85[_0x60bc('0x47')][_0x60bc('0x49')]?_0x502e85[_0x60bc('0x47')]:_0x1e0992[_0x60bc('0x42')];if(!_0x307617[_0x60bc('0x44')][_0x60bc('0x4a')](_0x60bc('0x4b'))){_0x502e85['limit']=qs['limit'](_0x307617[_0x60bc('0x44')][_0x60bc('0x2d')]);_0x502e85['offset']=qs[_0x60bc('0x2b')](_0x307617[_0x60bc('0x44')]['offset']);}_0x502e85[_0x60bc('0x4c')]=qs[_0x60bc('0x4d')](_0x307617[_0x60bc('0x44')][_0x60bc('0x4d')]);_0x502e85[_0x60bc('0x4e')]=qs[_0x60bc('0x45')](_[_0x60bc('0x4f')](_0x307617['query'],_0x1e0992[_0x60bc('0x45')]),_0x30d26d);if(_0x307617[_0x60bc('0x44')][_0x60bc('0x50')]){_0x502e85[_0x60bc('0x4e')]=_[_0x60bc('0x51')](_0x502e85[_0x60bc('0x4e')],{'$or':_['map'](_0x30d26d,function(_0x4b5231){if(_0x4b5231[_0x60bc('0x40')]!==_0x60bc('0x52')){var _0x596f87={};_0x596f87[_0x4b5231['name']]={'$like':'%'+_0x307617[_0x60bc('0x44')][_0x60bc('0x50')]+'%'};return _0x596f87;}})});}_0x502e85=_[_0x60bc('0x51')]({},_0x502e85,_0x307617[_0x60bc('0x53')]);var _0x464903={'where':_0x502e85[_0x60bc('0x4e')]};return db['OpenchannelAccount'][_0x60bc('0x2e')](_0x464903)[_0x60bc('0x1f')](function(_0x5903b5){_0x12deae[_0x60bc('0x2e')]=_0x5903b5;if(_0x307617[_0x60bc('0x44')][_0x60bc('0x54')]){_0x502e85[_0x60bc('0x55')]=[{'all':!![]}];}return db[_0x60bc('0x3e')][_0x60bc('0x56')](_0x502e85);})[_0x60bc('0x1f')](function(_0x5b61a0){_0x12deae[_0x60bc('0x57')]=_0x5b61a0;return _0x12deae;})[_0x60bc('0x1f')](respondWithFilteredResult(_0x416fc0,_0x502e85))[_0x60bc('0x27')](handleError(_0x416fc0,null));};exports[_0x60bc('0x58')]=function(_0x532883,_0x24b233){var _0x1c55cc={'raw':![],'where':{'id':_0x532883[_0x60bc('0x59')]['id']},'include':[{'model':db[_0x60bc('0x3b')],'as':_0x60bc('0x3c')}]},_0x51d9f7={};_0x51d9f7[_0x60bc('0x42')]=_[_0x60bc('0x43')](db[_0x60bc('0x3e')]['rawAttributes']);_0x51d9f7[_0x60bc('0x44')]=_[_0x60bc('0x43')](_0x532883['query']);_0x51d9f7[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x51d9f7[_0x60bc('0x42')],_0x51d9f7['query']);_0x1c55cc[_0x60bc('0x47')]=_['intersection'](_0x51d9f7[_0x60bc('0x42')],qs[_0x60bc('0x48')](_0x532883[_0x60bc('0x44')][_0x60bc('0x48')]));_0x1c55cc[_0x60bc('0x47')]=_0x1c55cc['attributes'][_0x60bc('0x49')]?_0x1c55cc[_0x60bc('0x47')]:_0x51d9f7[_0x60bc('0x42')];if(_0x532883[_0x60bc('0x44')]['includeAll']){_0x1c55cc[_0x60bc('0x55')]=[{'all':!![]}];}_0x1c55cc=_[_0x60bc('0x51')]({},_0x1c55cc,_0x532883[_0x60bc('0x53')]);return db['OpenchannelAccount']['find'](_0x1c55cc)['then'](handleEntityNotFound(_0x24b233,null))[_0x60bc('0x1f')](respondWithResult(_0x24b233,null))[_0x60bc('0x27')](handleError(_0x24b233,null));};exports[_0x60bc('0x5a')]=function(_0x372cee,_0xd5ee78){return db[_0x60bc('0x3e')]['create'](_0x372cee['body'],{})[_0x60bc('0x1f')](function(_0x2c47aa){var _0x3c5847=_0x372cee['user']['get']({'plain':!![]});if(!_0x3c5847)throw new Error(_0x60bc('0x5b'));if(_0x3c5847['role']===_0x60bc('0x5c')){var _0x52ba1a=_0x2c47aa[_0x60bc('0x35')]({'plain':!![]});var _0x2cb897=_0x60bc('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x2cb897,'userProfileId':_0x3c5847['userProfileId']},'raw':!![]})[_0x60bc('0x1f')](function(_0x360497){if(_0x360497&&_0x360497['autoAssociation']===0x0){return db[_0x60bc('0x37')][_0x60bc('0x5a')]({'name':_0x52ba1a[_0x60bc('0x39')],'resourceId':_0x52ba1a['id'],'type':_0x360497['name'],'sectionId':_0x360497['id']},{})['then'](function(){return _0x2c47aa;});}else{return _0x2c47aa;}})[_0x60bc('0x27')](function(_0x5e3d06){logger[_0x60bc('0x25')](_0x60bc('0x5d'),_0x5e3d06);throw _0x5e3d06;});}return _0x2c47aa;})[_0x60bc('0x1f')](respondWithResult(_0xd5ee78,0xc9))['catch'](handleError(_0xd5ee78,null));};exports[_0x60bc('0x34')]=function(_0x3654b5,_0x3f2c66){if(_0x3654b5[_0x60bc('0x5e')]['id']){delete _0x3654b5[_0x60bc('0x5e')]['id'];}return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x3654b5[_0x60bc('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x60bc('0x3c')}]})[_0x60bc('0x1f')](handleEntityNotFound(_0x3f2c66,null))[_0x60bc('0x1f')](saveUpdates(_0x3654b5['body'],null))[_0x60bc('0x1f')](respondWithResult(_0x3f2c66,null))[_0x60bc('0x27')](handleError(_0x3f2c66,null));};exports['destroy']=function(_0x2e211c,_0x52dbe9){return db[_0x60bc('0x3e')]['find']({'where':{'id':_0x2e211c[_0x60bc('0x59')]['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x52dbe9,null))[_0x60bc('0x1f')](removeEntity(_0x52dbe9,null))[_0x60bc('0x27')](handleError(_0x52dbe9,null));};exports[_0x60bc('0x60')]=function(_0x3f11a2,_0x4f239c){return db[_0x60bc('0x3e')][_0x60bc('0x60')]()['then'](respondWithResult(_0x4f239c,null))['catch'](handleError(_0x4f239c,null));};exports['addDisposition']=function(_0x306e5a,_0x126cb9,_0x257b14){if(_0x306e5a['body']['id']){delete _0x306e5a[_0x60bc('0x5e')]['id'];}return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x306e5a[_0x60bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x126cb9,null))['then'](function(_0xce64b7){if(_0xce64b7){_0x306e5a[_0x60bc('0x5e')]['OpenchannelAccountId']=_0xce64b7['id'];return db[_0x60bc('0x61')][_0x60bc('0x5a')](_0x306e5a[_0x60bc('0x5e')]);}})[_0x60bc('0x1f')](respondWithResult(_0x126cb9,null))[_0x60bc('0x27')](handleError(_0x126cb9,null));};exports[_0x60bc('0x62')]=function(_0x4d881f,_0x40383c,_0x4f98d5){var _0x229550={'raw':![],'where':{}};var _0x185409={};var _0x534f12={'count':0x0,'rows':[]};return db[_0x60bc('0x3e')][_0x60bc('0x63')]({'where':{'id':_0x4d881f['params']['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x40383c,null))[_0x60bc('0x1f')](function(_0x152409){if(_0x152409){_0x185409[_0x60bc('0x42')]=_[_0x60bc('0x43')](db[_0x60bc('0x61')][_0x60bc('0x3f')]);_0x185409[_0x60bc('0x44')]=_['keys'](_0x4d881f[_0x60bc('0x44')]);_0x185409['filters']=_[_0x60bc('0x46')](_0x185409[_0x60bc('0x42')],_0x185409[_0x60bc('0x44')]);_0x229550['attributes']=_[_0x60bc('0x46')](_0x185409[_0x60bc('0x42')],qs[_0x60bc('0x48')](_0x4d881f[_0x60bc('0x44')][_0x60bc('0x48')]));_0x229550[_0x60bc('0x47')]=_0x229550[_0x60bc('0x47')]['length']?_0x229550[_0x60bc('0x47')]:_0x185409[_0x60bc('0x42')];if(!_0x4d881f[_0x60bc('0x44')]['hasOwnProperty'](_0x60bc('0x4b'))){_0x229550[_0x60bc('0x2d')]=qs[_0x60bc('0x2d')](_0x4d881f[_0x60bc('0x44')][_0x60bc('0x2d')]);_0x229550[_0x60bc('0x2b')]=qs['offset'](_0x4d881f[_0x60bc('0x44')][_0x60bc('0x2b')]);}_0x229550[_0x60bc('0x4c')]=qs['sort'](_0x4d881f[_0x60bc('0x44')][_0x60bc('0x4d')]);_0x229550[_0x60bc('0x4e')]=qs[_0x60bc('0x45')](_[_0x60bc('0x4f')](_0x4d881f[_0x60bc('0x44')],_0x185409[_0x60bc('0x45')]));_0x229550[_0x60bc('0x4e')]['OpenchannelAccountId']=_0x152409['id'];if(_0x4d881f[_0x60bc('0x44')]['filter']){_0x229550[_0x60bc('0x4e')]=_[_0x60bc('0x51')](_0x229550[_0x60bc('0x4e')],{'$or':_[_0x60bc('0x3d')](_0x229550[_0x60bc('0x47')],function(_0xf2a5b1){var _0x50e206={};_0x50e206[_0xf2a5b1]={'$like':'%'+_0x4d881f[_0x60bc('0x44')]['filter']+'%'};return _0x50e206;})});}_0x229550=_['merge']({},_0x229550,_0x4d881f[_0x60bc('0x53')]);return db[_0x60bc('0x61')][_0x60bc('0x2e')]({'where':_0x229550[_0x60bc('0x4e')]})[_0x60bc('0x1f')](function(_0x38a3ed){_0x534f12[_0x60bc('0x2e')]=_0x38a3ed;if(_0x4d881f[_0x60bc('0x44')][_0x60bc('0x54')]){_0x229550['include']=[{'all':!![]}];}return db[_0x60bc('0x61')][_0x60bc('0x56')](_0x229550);})[_0x60bc('0x1f')](function(_0x5254b0){_0x534f12[_0x60bc('0x57')]=_0x5254b0;return _0x534f12;});}})['then'](respondWithFilteredResult(_0x40383c,_0x229550))[_0x60bc('0x27')](handleError(_0x40383c,null));};exports[_0x60bc('0x64')]=function(_0x19ed3d,_0x1f2126,_0x19a28a){return db[_0x60bc('0x3e')]['find']({'where':{'id':_0x19ed3d[_0x60bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f2126,null))[_0x60bc('0x1f')](function(_0x5a2564){if(_0x5a2564){return _0x5a2564[_0x60bc('0x64')](_0x19ed3d[_0x60bc('0x44')]['ids']);}})[_0x60bc('0x1f')](respondWithStatusCode(_0x1f2126,null))[_0x60bc('0x27')](handleError(_0x1f2126,null));};exports[_0x60bc('0x65')]=function(_0x241c98,_0x344249,_0x29f11d){if(_0x241c98['body']['id']){delete _0x241c98[_0x60bc('0x5e')]['id'];}return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x241c98[_0x60bc('0x59')]['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x344249,null))[_0x60bc('0x1f')](function(_0x1d520a){if(_0x1d520a){_0x241c98['body'][_0x60bc('0x66')]=_0x1d520a['id'];return db[_0x60bc('0x67')][_0x60bc('0x5a')](_0x241c98[_0x60bc('0x5e')]);}})[_0x60bc('0x1f')](respondWithResult(_0x344249,null))[_0x60bc('0x27')](handleError(_0x344249,null));};exports[_0x60bc('0x68')]=function(_0x44a44d,_0x293c52,_0x457bf6){var _0x1a04ae={'raw':![],'where':{}};var _0x5135af={};var _0x29e5bc={'count':0x0,'rows':[]};return db[_0x60bc('0x3e')][_0x60bc('0x63')]({'where':{'id':_0x44a44d['params']['id']}})['then'](handleEntityNotFound(_0x293c52,null))[_0x60bc('0x1f')](function(_0xb771a6){if(_0xb771a6){_0x5135af[_0x60bc('0x42')]=_[_0x60bc('0x43')](db[_0x60bc('0x67')][_0x60bc('0x3f')]);_0x5135af[_0x60bc('0x44')]=_[_0x60bc('0x43')](_0x44a44d[_0x60bc('0x44')]);_0x5135af[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x5135af[_0x60bc('0x42')],_0x5135af[_0x60bc('0x44')]);_0x1a04ae[_0x60bc('0x47')]=_[_0x60bc('0x46')](_0x5135af[_0x60bc('0x42')],qs[_0x60bc('0x48')](_0x44a44d[_0x60bc('0x44')][_0x60bc('0x48')]));_0x1a04ae[_0x60bc('0x47')]=_0x1a04ae[_0x60bc('0x47')]['length']?_0x1a04ae[_0x60bc('0x47')]:_0x5135af[_0x60bc('0x42')];if(!_0x44a44d[_0x60bc('0x44')][_0x60bc('0x4a')](_0x60bc('0x4b'))){_0x1a04ae[_0x60bc('0x2d')]=qs[_0x60bc('0x2d')](_0x44a44d[_0x60bc('0x44')]['limit']);_0x1a04ae[_0x60bc('0x2b')]=qs['offset'](_0x44a44d[_0x60bc('0x44')]['offset']);}_0x1a04ae['order']=qs['sort'](_0x44a44d['query']['sort']);_0x1a04ae[_0x60bc('0x4e')]=qs[_0x60bc('0x45')](_[_0x60bc('0x4f')](_0x44a44d['query'],_0x5135af['filters']));_0x1a04ae[_0x60bc('0x4e')]['OpenchannelAccountId']=_0xb771a6['id'];if(_0x44a44d['query']['filter']){_0x1a04ae[_0x60bc('0x4e')]=_[_0x60bc('0x51')](_0x1a04ae[_0x60bc('0x4e')],{'$or':_[_0x60bc('0x3d')](_0x1a04ae[_0x60bc('0x47')],function(_0x3dba78){var _0x2cb867={};_0x2cb867[_0x3dba78]={'$like':'%'+_0x44a44d['query'][_0x60bc('0x50')]+'%'};return _0x2cb867;})});}_0x1a04ae=_[_0x60bc('0x51')]({},_0x1a04ae,_0x44a44d[_0x60bc('0x53')]);return db[_0x60bc('0x67')][_0x60bc('0x2e')]({'where':_0x1a04ae[_0x60bc('0x4e')]})[_0x60bc('0x1f')](function(_0x3e36f7){_0x29e5bc[_0x60bc('0x2e')]=_0x3e36f7;if(_0x44a44d[_0x60bc('0x44')][_0x60bc('0x54')]){_0x1a04ae['include']=[{'all':!![]}];}return db[_0x60bc('0x67')]['findAll'](_0x1a04ae);})['then'](function(_0x9bed52){_0x29e5bc[_0x60bc('0x57')]=_0x9bed52;return _0x29e5bc;});}})['then'](respondWithFilteredResult(_0x293c52,_0x1a04ae))['catch'](handleError(_0x293c52,null));};exports[_0x60bc('0x69')]=function(_0x38c4d1,_0x1448e4,_0x77c0ee){return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x38c4d1['params']['id']}})['then'](handleEntityNotFound(_0x1448e4,null))[_0x60bc('0x1f')](function(_0x495922){if(_0x495922){return _0x495922[_0x60bc('0x69')](_0x38c4d1[_0x60bc('0x44')][_0x60bc('0x6a')]);}})['then'](respondWithStatusCode(_0x1448e4,null))[_0x60bc('0x27')](handleError(_0x1448e4,null));};exports[_0x60bc('0x6b')]=function(_0x3a7d7e,_0x44b741,_0x4837a7){var _0x550751={'body':_0x3a7d7e[_0x60bc('0x5e')],'channel':_0x60bc('0x6c')};var _0x23425e=[];var _0x5e0e15=[];var _0x45c2e3={};var _0x41ffcb=![];return db[_0x60bc('0x6d')]['describe']()[_0x60bc('0x1f')](function(_0x1de165){if(!_0x1de165){throw new db[(_0x60bc('0x6e'))][(_0x60bc('0x6f'))](_0x60bc('0x70'));}_0x23425e=_[_0x60bc('0x71')](_[_0x60bc('0x43')](_0x1de165),[_0x60bc('0x72'),_0x60bc('0x73')]);_0x5e0e15=_[_0x60bc('0x71')](_[_0x60bc('0x43')](_0x1de165),[_0x60bc('0x72'),_0x60bc('0x73'),'CompanyId','ListId']);if(_0x3a7d7e[_0x60bc('0x5e')]['id']){delete _0x3a7d7e[_0x60bc('0x5e')]['id'];}if(_[_0x60bc('0x74')](_0x3a7d7e['body'][_0x60bc('0x75')])){throw new db[(_0x60bc('0x6e'))][(_0x60bc('0x6f'))]('from\x20is\x20mandatory');}if(_[_0x60bc('0x74')](_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x5e')])||_0x3a7d7e['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x60bc('0x74')](_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x76')])){throw new db[(_0x60bc('0x6e'))][(_0x60bc('0x6f'))](_0x60bc('0x77')+_0x5e0e15);}if(!_[_0x60bc('0x78')](_0x5e0e15,_0x3a7d7e['body'][_0x60bc('0x76')])){throw new db[(_0x60bc('0x6e'))]['ValidationError'](_0x60bc('0x79')+_0x5e0e15);}_0x45c2e3[_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x76')]]=_0x3a7d7e['body'][_0x60bc('0x75')];})[_0x60bc('0x1f')](function(){return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x3a7d7e[_0x60bc('0x59')]['id']},'include':[{'model':db[_0x60bc('0x7a')],'as':_0x60bc('0x7b'),'include':[{'model':db[_0x60bc('0x6d')],'as':_0x60bc('0x7c'),'where':_0x45c2e3,'limit':0x1,'order':[[_0x60bc('0x73'),_0x60bc('0x7d')]]}]},{'model':db['OpenchannelApplication'],'as':_0x60bc('0x7e')}]});})[_0x60bc('0x1f')](handleEntityNotFound(_0x44b741,null))[_0x60bc('0x1f')](function(_0x47ccbe){if(_0x47ccbe&&_0x47ccbe['List']){_0x550751['account']=_0x47ccbe;_0x550751['applications']=_0x47ccbe[_0x60bc('0x7e')];_0x550751['list']=_0x47ccbe[_0x60bc('0x7b')];_0x550751[_0x60bc('0x7f')]=_[_0x60bc('0x80')](_0x550751[_0x60bc('0x7f')],['priority'],[_0x60bc('0x81')]);if(_0x550751[_0x60bc('0x82')][_0x60bc('0x7e')]){delete _0x550751[_0x60bc('0x82')]['Applications'];}if(_0x550751[_0x60bc('0x82')]['List']&&_0x550751[_0x60bc('0x82')]['List'][_0x60bc('0x7c')]['length']){return _0x550751[_0x60bc('0x82')]['List']['Contacts'][0x0];}var _0x2c55f6=_[_0x60bc('0x16')](_0x3a7d7e[_0x60bc('0x5e')],{'firstName':_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x75')],'ListId':_0x47ccbe[_0x60bc('0x83')]});_0x2c55f6[_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x76')]]=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x75')];return db[_0x60bc('0x6d')][_0x60bc('0x5a')](_0x2c55f6,{'fields':_0x23425e,'raw':!![]});}})[_0x60bc('0x1f')](handleEntityNotFound(_0x44b741,null))[_0x60bc('0x1f')](function(_0x2ce026){_0x550751[_0x60bc('0x84')]=_0x2ce026;if(_0x2ce026){var _0x2ffc4d={'ContactId':_0x2ce026['id'],'OpenchannelAccountId':_0x3a7d7e['params']['id'],'from':(_0x2ce026[_0x60bc('0x85')]||'')+'\x20'+(_0x2ce026[_0x60bc('0x86')]||'')};var _0xbe648e={'OpenchannelAccountId':_0x3a7d7e['params']['id'],'closed':![]};if(_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x87')]){_0xbe648e[_0x60bc('0x87')]=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x87')];return db['OpenchannelInteraction'][_0x60bc('0x5f')]({'where':_0xbe648e})['then'](function(_0x4bd0bb){if(_0x4bd0bb){return[_0x4bd0bb,![]];}_0x2ffc4d[_0x60bc('0x87')]=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x87')];_0x2ffc4d['externalUrl']=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x88')];return db[_0x60bc('0x89')][_0x60bc('0x5a')](_0x2ffc4d)[_0x60bc('0x1f')](function(_0x10b8d9){return[_0x10b8d9,!![]];});});}else{_0xbe648e[_0x60bc('0x87')]=null;}_0xbe648e[_0x60bc('0x8a')]=_0x2ce026['id'];return db[_0x60bc('0x89')][_0x60bc('0x5f')]({'where':_0xbe648e})[_0x60bc('0x1f')](function(_0x2ecbc1){if(_0x2ecbc1){return[_0x2ecbc1,![]];}return db[_0x60bc('0x89')][_0x60bc('0x5a')](_0x2ffc4d)[_0x60bc('0x1f')](function(_0x4db75a){return[_0x4db75a,!![]];});});}})[_0x60bc('0x8b')](function(_0xc57e41,_0x53c780){if(_0xc57e41){_0x41ffcb=_0x53c780;if(!_0x53c780){var _0x4849ca={'from':(_0x550751['contact'][_0x60bc('0x85')]||'')+'\x20'+(_0x550751[_0x60bc('0x84')]['lastName']||'')};if(_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x87')]&&_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x8c')]&&_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x87')]!=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x8c')]){_0x4849ca[_0x60bc('0x87')]=_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x8c')];}return _0xc57e41[_0x60bc('0x34')](_0x4849ca);}else{return _0xc57e41;}}})[_0x60bc('0x1f')](function(_0x23bccf){_0x550751[_0x60bc('0x8d')]=_0x23bccf['get']({'plain':!![]});_0x550751[_0x60bc('0x8d')]['created']=_0x41ffcb;if(_0x550751['interaction'][_0x60bc('0x8e')]){if(_0x550751['account'][_0x60bc('0x8f')]){_0x550751[_0x60bc('0x7f')][_0x60bc('0x90')]({'id':0x0,'priority':_0x550751['applications'][_0x60bc('0x49')]+0x1,'app':'close','appdata':_0x60bc('0x91'),'interval':_0x60bc('0x92')});}}return db[_0x60bc('0x93')][_0x60bc('0x5a')]({'body':_0x3a7d7e[_0x60bc('0x5e')]['body'],'OpenchannelAccountId':_0x3a7d7e[_0x60bc('0x59')]['id'],'OpenchannelInteractionId':_0x23bccf['id'],'direction':'in','ContactId':_0x550751[_0x60bc('0x84')]['id'],'AttachmentId':_0x3a7d7e[_0x60bc('0x5e')][_0x60bc('0x94')]});})[_0x60bc('0x1f')](function(_0x4ea8ab){_0x550751[_0x60bc('0x26')]=_0x4ea8ab;if(_0x550751['interaction'][_0x60bc('0x95')]){return db['User'][_0x60bc('0x5f')]({'attributes':['id',_0x60bc('0x39')],'where':{'id':_0x550751[_0x60bc('0x8d')][_0x60bc('0x95')]}})['then'](function(_0x278bd9){if(_0x278bd9){_0x550751[_0x60bc('0x7f')][_0x60bc('0x96')]({'id':0x0,'priority':0x0,'app':_0x60bc('0x97'),'appdata':_0x278bd9['name']+','+(_0x550751['account'][_0x60bc('0x98')]||0xa),'interval':'*,*,*,*'});_0x550751[_0x60bc('0x99')]=![];}return respondWithRpcPromise('Start',_0x60bc('0x9a'),_0x550751);});}return respondWithRpcPromise('Start',_0x60bc('0x9a'),_0x550751);})['then'](function(_0x963a84){respondWithRpcPromise(_0x60bc('0x9b'),_0x60bc('0x9b'),{'event':_0x60bc('0x6b'),'message':_0x963a84},client9002);return _0x963a84;})[_0x60bc('0x1f')](respondWithResult(_0x44b741,null))[_0x60bc('0x27')](handleError(_0x44b741,null));};exports[_0x60bc('0x9c')]=function(_0x36fa5b,_0x5142fb,_0xc5be74){return db['OpenchannelAccount'][_0x60bc('0x63')]({'where':{'id':_0x36fa5b[_0x60bc('0x59')]['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x5142fb,null))[_0x60bc('0x1f')](function(_0xe99985){if(_0xe99985){return db[_0x60bc('0x9d')][_0x60bc('0x9e')](function(_0x3c5094){return db[_0x60bc('0x9f')][_0x60bc('0xa0')]({'where':{'OpenchannelAccountId':_0x36fa5b[_0x60bc('0x59')]['id']},'transaction':_0x3c5094})[_0x60bc('0x1f')](function(_0x3921f4){var _0x362c73=_[_0x60bc('0x3d')](_0x36fa5b['body'],function(_0xcb6d20){_0xcb6d20['OpenchannelAccountId']=_0x36fa5b[_0x60bc('0x59')]['id'];return _0xcb6d20;});return db[_0x60bc('0x9f')][_0x60bc('0xa1')](_0x362c73,{'transaction':_0x3c5094});});})[_0x60bc('0x1f')](function(){return db[_0x60bc('0x9f')][_0x60bc('0xa2')]({'where':{'OpenchannelAccountId':_0x36fa5b[_0x60bc('0x59')]['id']},'order':'priority'});});}})[_0x60bc('0x1f')](respondWithResult(_0x5142fb,null))[_0x60bc('0x27')](handleError(_0x5142fb,null));};exports[_0x60bc('0xa3')]=function(_0x2d92d3,_0x4506b5,_0x98511d){var _0x380ec7={};var _0x380a7a={};var _0xcc616e;var _0x24ee9a;return db[_0x60bc('0x3e')][_0x60bc('0x63')]({'where':{'id':_0x2d92d3[_0x60bc('0x59')]['id']}})['then'](handleEntityNotFound(_0x4506b5,null))[_0x60bc('0x1f')](function(_0x1a4045){if(_0x1a4045){_0xcc616e=_0x1a4045;_0x380a7a[_0x60bc('0x42')]=_['keys'](db[_0x60bc('0x9f')]['rawAttributes']);_0x380a7a[_0x60bc('0x44')]=_[_0x60bc('0x43')](_0x2d92d3[_0x60bc('0x44')]);_0x380a7a[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x380a7a[_0x60bc('0x42')],_0x380a7a[_0x60bc('0x44')]);_0x380ec7['attributes']=_[_0x60bc('0x46')](_0x380a7a[_0x60bc('0x42')],qs[_0x60bc('0x48')](_0x2d92d3[_0x60bc('0x44')][_0x60bc('0x48')]));_0x380ec7[_0x60bc('0x47')]=_0x380ec7[_0x60bc('0x47')][_0x60bc('0x49')]?_0x380ec7['attributes']:_0x380a7a[_0x60bc('0x42')];_0x380ec7['order']=qs[_0x60bc('0x4d')](_0x2d92d3[_0x60bc('0x44')][_0x60bc('0x4d')]);_0x380ec7['where']=qs['filters'](_['pick'](_0x2d92d3['query'],_0x380a7a['filters']));if(_0x2d92d3[_0x60bc('0x44')][_0x60bc('0x50')]){_0x380ec7[_0x60bc('0x4e')]=_[_0x60bc('0x51')](_0x380ec7[_0x60bc('0x4e')],{'$or':_[_0x60bc('0x3d')](_0x380ec7[_0x60bc('0x47')],function(_0x112684){var _0x373bd3={};_0x373bd3[_0x112684]={'$like':'%'+_0x2d92d3['query'][_0x60bc('0x50')]+'%'};return _0x373bd3;})});}_0x380ec7=_[_0x60bc('0x51')]({},_0x380ec7,_0x2d92d3[_0x60bc('0x53')]);return _0xcc616e[_0x60bc('0xa3')](_0x380ec7);}})[_0x60bc('0x1f')](function(_0x1e38bb){if(_0x1e38bb){_0x24ee9a=_0x1e38bb[_0x60bc('0x49')];if(!_0x2d92d3[_0x60bc('0x44')][_0x60bc('0x4a')](_0x60bc('0x4b'))){_0x380ec7[_0x60bc('0x2d')]=qs[_0x60bc('0x2d')](_0x2d92d3[_0x60bc('0x44')][_0x60bc('0x2d')]);_0x380ec7[_0x60bc('0x2b')]=qs[_0x60bc('0x2b')](_0x2d92d3['query'][_0x60bc('0x2b')]);}return _0xcc616e[_0x60bc('0xa3')](_0x380ec7);}})[_0x60bc('0x1f')](function(_0xdfe6c2){if(_0xdfe6c2){return _0xdfe6c2?{'count':_0x24ee9a,'rows':_0xdfe6c2}:null;}})['then'](respondWithResult(_0x4506b5,null))[_0x60bc('0x27')](handleError(_0x4506b5,null));};exports[_0x60bc('0xa4')]=function(_0x265d74,_0x275aff,_0x39f05e){var _0x3f6206={'raw':![],'where':{}};var _0x4679fe={};var _0x94a4c5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x60bc('0x63')]({'where':{'id':_0x265d74['params']['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x275aff,null))[_0x60bc('0x1f')](function(_0x1a058a){if(_0x1a058a){_0x4679fe[_0x60bc('0x42')]=_['keys'](db[_0x60bc('0x89')][_0x60bc('0x3f')]);_0x4679fe['query']=_[_0x60bc('0x43')](_0x265d74[_0x60bc('0x44')]);_0x4679fe[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x4679fe['model'],_0x4679fe[_0x60bc('0x44')]);_0x3f6206['attributes']=_[_0x60bc('0x46')](_0x4679fe['model'],qs[_0x60bc('0x48')](_0x265d74[_0x60bc('0x44')][_0x60bc('0x48')]));_0x3f6206['attributes']=_0x3f6206[_0x60bc('0x47')][_0x60bc('0x49')]?_0x3f6206['attributes']:_0x4679fe[_0x60bc('0x42')];if(!_0x265d74[_0x60bc('0x44')][_0x60bc('0x4a')](_0x60bc('0x4b'))){_0x3f6206[_0x60bc('0x2d')]=qs[_0x60bc('0x2d')](_0x265d74[_0x60bc('0x44')][_0x60bc('0x2d')]);_0x3f6206['offset']=qs['offset'](_0x265d74[_0x60bc('0x44')]['offset']);}_0x3f6206[_0x60bc('0x4c')]=qs[_0x60bc('0x4d')](_0x265d74['query']['sort']);_0x3f6206[_0x60bc('0x4e')]=qs[_0x60bc('0x45')](_[_0x60bc('0x4f')](_0x265d74[_0x60bc('0x44')],_0x4679fe['filters']));_0x3f6206[_0x60bc('0x4e')]['OpenchannelAccountId']=_0x1a058a['id'];if(_0x265d74[_0x60bc('0x44')][_0x60bc('0x50')]){_0x3f6206[_0x60bc('0x4e')]=_['merge'](_0x3f6206[_0x60bc('0x4e')],{'$or':_[_0x60bc('0x3d')](_0x3f6206['attributes'],function(_0x1ee66f){var _0x156f2d={};_0x156f2d[_0x1ee66f]={'$like':'%'+_0x265d74[_0x60bc('0x44')][_0x60bc('0x50')]+'%'};return _0x156f2d;})});}_0x3f6206=_[_0x60bc('0x51')]({},_0x3f6206,_0x265d74[_0x60bc('0x53')]);return db[_0x60bc('0x89')][_0x60bc('0x2e')]({'where':_0x3f6206[_0x60bc('0x4e')]})['then'](function(_0x2b6ad9){_0x94a4c5['count']=_0x2b6ad9;if(_0x265d74['query'][_0x60bc('0x54')]){_0x3f6206[_0x60bc('0x55')]=[{'model':db['CmContact'],'as':_0x60bc('0xa5'),'required':![]},{'model':db[_0x60bc('0xa6')],'as':'Owner','attributes':[_0x60bc('0x39'),_0x60bc('0xa7'),_0x60bc('0xa8')],'required':![]},{'model':db[_0x60bc('0xa9')],'as':_0x60bc('0xaa'),'attributes':['id',_0x60bc('0x39'),'color'],'where':_0x265d74[_0x60bc('0x44')][_0x60bc('0xab')]?{'id':_0x265d74[_0x60bc('0x44')][_0x60bc('0xab')]}:undefined,'required':_0x265d74[_0x60bc('0x44')]['tag']?!![]:![]}];}return db[_0x60bc('0x89')][_0x60bc('0x56')](_0x3f6206);})[_0x60bc('0x1f')](function(_0xf0fe5d){_0x94a4c5[_0x60bc('0x57')]=_0xf0fe5d;return _0x94a4c5;});}})['then'](respondWithFilteredResult(_0x275aff,_0x3f6206))[_0x60bc('0x27')](handleError(_0x275aff,null));};exports['addAgents']=function(_0x339a7c,_0x485000,_0x39175b){return db['OpenchannelAccount'][_0x60bc('0x5f')]({'where':{'id':_0x339a7c[_0x60bc('0x59')]['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x485000,null))[_0x60bc('0x1f')](function(_0x1c0361){if(_0x1c0361){return _0x1c0361[_0x60bc('0xac')](_0x339a7c['body']['ids'],_[_0x60bc('0xad')](_0x339a7c[_0x60bc('0x5e')],['ids','id'])||{})[_0x60bc('0x8b')](function(_0x4d7fd8){for(var _0x2e180d=0x0;_0x2e180d<_0x339a7c[_0x60bc('0x5e')][_0x60bc('0x6a')][_0x60bc('0x49')];_0x2e180d+=0x1){socket[_0x60bc('0xae')](_0x60bc('0xaf'),{'UserId':Number(_0x339a7c['body'][_0x60bc('0x6a')][_0x2e180d]),'OpenchannelAccountId':Number(_0x339a7c[_0x60bc('0x59')]['id'])});}return _0x4d7fd8;});}})[_0x60bc('0x1f')](respondWithResult(_0x485000,null))[_0x60bc('0x27')](handleError(_0x485000,null));};exports['removeAgents']=function(_0x2ae75f,_0x142a35,_0x1dd4ae){return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x2ae75f[_0x60bc('0x59')]['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x142a35,null))[_0x60bc('0x1f')](function(_0xbed6e8){if(_0xbed6e8){return _0xbed6e8[_0x60bc('0xb0')](_0x2ae75f[_0x60bc('0x44')][_0x60bc('0x6a')])['then'](function(){if(_[_0x60bc('0xb1')](_0x2ae75f[_0x60bc('0x44')]['ids'])){for(var _0x591b74=0x0;_0x591b74<_0x2ae75f['query'][_0x60bc('0x6a')][_0x60bc('0x49')];_0x591b74+=0x1){socket[_0x60bc('0xae')](_0x60bc('0xb2'),{'UserId':Number(_0x2ae75f[_0x60bc('0x44')][_0x60bc('0x6a')][_0x591b74]),'OpenchannelAccountId':Number(_0x2ae75f[_0x60bc('0x59')]['id'])});}}else{socket[_0x60bc('0xae')](_0x60bc('0xb2'),{'UserId':Number(_0x2ae75f[_0x60bc('0x44')]['ids']),'OpenchannelAccountId':Number(_0x2ae75f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x142a35,null))[_0x60bc('0x27')](handleError(_0x142a35,null));};exports[_0x60bc('0xb3')]=function(_0x1cbdf8,_0x1440f5,_0x40ff53){var _0x1682e8={};var _0x389618={};var _0x1973e4;var _0x3ace38;return db['OpenchannelAccount'][_0x60bc('0x63')]({'where':{'id':_0x1cbdf8['params']['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x1440f5,null))[_0x60bc('0x1f')](function(_0x15cbf2){if(_0x15cbf2){_0x1973e4=_0x15cbf2;_0x389618[_0x60bc('0x42')]=_['keys'](db[_0x60bc('0xa6')]['rawAttributes']);_0x389618['query']=_['keys'](_0x1cbdf8[_0x60bc('0x44')]);_0x389618[_0x60bc('0x45')]=_[_0x60bc('0x46')](_0x389618[_0x60bc('0x42')],_0x389618[_0x60bc('0x44')]);_0x1682e8[_0x60bc('0x47')]=_[_0x60bc('0x46')](_0x389618[_0x60bc('0x42')],qs[_0x60bc('0x48')](_0x1cbdf8[_0x60bc('0x44')]['fields']));_0x1682e8[_0x60bc('0x47')]=_0x1682e8['attributes']['length']?_0x1682e8[_0x60bc('0x47')]:_0x389618[_0x60bc('0x42')];_0x1682e8[_0x60bc('0x4c')]=qs['sort'](_0x1cbdf8[_0x60bc('0x44')][_0x60bc('0x4d')]);_0x1682e8[_0x60bc('0x4e')]=qs[_0x60bc('0x45')](_[_0x60bc('0x4f')](_0x1cbdf8[_0x60bc('0x44')],_0x389618[_0x60bc('0x45')]));if(_0x1cbdf8[_0x60bc('0x44')][_0x60bc('0x50')]){_0x1682e8['where']=_['merge'](_0x1682e8['where'],{'$or':_[_0x60bc('0x3d')](_0x1682e8[_0x60bc('0x47')],function(_0x23ccf4){var _0x5f2b45={};_0x5f2b45[_0x23ccf4]={'$like':'%'+_0x1cbdf8['query'][_0x60bc('0x50')]+'%'};return _0x5f2b45;})});}_0x1682e8=_[_0x60bc('0x51')]({},_0x1682e8,_0x1cbdf8[_0x60bc('0x53')]);return _0x1973e4[_0x60bc('0xb3')](_0x1682e8);}})[_0x60bc('0x1f')](function(_0x3ce184){if(_0x3ce184){_0x3ace38=_0x3ce184['length'];if(!_0x1cbdf8[_0x60bc('0x44')]['hasOwnProperty'](_0x60bc('0x4b'))){_0x1682e8[_0x60bc('0x2d')]=qs[_0x60bc('0x2d')](_0x1cbdf8['query'][_0x60bc('0x2d')]);_0x1682e8[_0x60bc('0x2b')]=qs['offset'](_0x1cbdf8[_0x60bc('0x44')]['offset']);}return _0x1973e4[_0x60bc('0xb3')](_0x1682e8);}})[_0x60bc('0x1f')](function(_0x2f1dd1){if(_0x2f1dd1){return _0x2f1dd1?{'count':_0x3ace38,'rows':_0x2f1dd1}:null;}})[_0x60bc('0x1f')](respondWithResult(_0x1440f5,null))[_0x60bc('0x27')](handleError(_0x1440f5,null));};exports[_0x60bc('0x3a')]=function(_0x2e51ec,_0x168d8a,_0x6ac9c4){var _0x13819b,_0x13b059,_0x57373c;if(_[_0x60bc('0x74')](_0x2e51ec[_0x60bc('0x5e')][_0x60bc('0x5e')])||_0x2e51ec['body']['body']===''){throw new db['Sequelize'][(_0x60bc('0x6f'))](_0x60bc('0xb4'));}if(_[_0x60bc('0x74')](_0x2e51ec[_0x60bc('0x5e')]['to'])){}_0x13819b=_0x2e51ec[_0x60bc('0x5e')]['to'];return db['OpenchannelAccount'][_0x60bc('0x63')]({'where':{'id':_0x2e51ec['params']['id']}})[_0x60bc('0x1f')](handleEntityNotFound(_0x168d8a,null))[_0x60bc('0x1f')](function(_0x21a221){if(_0x21a221){return db[_0x60bc('0x3e')][_0x60bc('0x5f')]({'where':{'id':_0x21a221['id']},'include':[{'model':db[_0x60bc('0x7a')],'as':_0x60bc('0x7b'),'include':[{'model':db['CmContact'],'as':_0x60bc('0x7c'),'where':{[_0x21a221[_0x60bc('0x76')]]:_0x13819b},'limit':0x1,'order':[[_0x60bc('0x73'),_0x60bc('0x7d')]]}]}]})[_0x60bc('0x1f')](handleEntityNotFound(_0x168d8a,null))[_0x60bc('0x1f')](function(_0x55c4cc){if(_0x55c4cc&&_0x55c4cc['List']){_0x13b059=_0x55c4cc[_0x60bc('0x35')]({'plain':!![]});if(_0x13b059[_0x60bc('0x7b')]&&_0x13b059[_0x60bc('0x7b')][_0x60bc('0x7c')][_0x60bc('0x49')]){return _0x13b059[_0x60bc('0x7b')][_0x60bc('0x7c')][0x0];}return db[_0x60bc('0x6d')]['create'](_[_0x60bc('0x16')](_0x2e51ec['body'],{'firstName':_0x13819b,[_0x55c4cc['mapKey']]:_0x13819b,'phone':_0x13819b,'ListId':_0x13b059[_0x60bc('0x83')]}));}})[_0x60bc('0x1f')](handleEntityNotFound(_0x168d8a,null))[_0x60bc('0x1f')](function(_0x487f56){if(_0x487f56){_0x57373c=_0x487f56;return db[_0x60bc('0x89')][_0x60bc('0x5f')]({'where':{'ContactId':_0x57373c['id'],'closed':![],'OpenchannelAccountId':_0x13b059['id']}})[_0x60bc('0x1f')](function(_0x53f891){if(_0x53f891){return[_0x53f891,![]];}return db[_0x60bc('0x89')][_0x60bc('0x5a')]({'UserId':_0x2e51ec['user']['id'],'ContactId':_0x57373c['id'],'OpenchannelAccountId':_0x13b059['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x2e51ec[_0x60bc('0x5e')],{'read':![],'body':_0x2e51ec[_0x60bc('0x5e')][_0x60bc('0x5e')],'OpenchannelAccountId':_0x13b059['id'],'UserId':_0x2e51ec[_0x60bc('0x5c')]['id'],'ContactId':_0x57373c['id']})]},{'include':[{'model':db[_0x60bc('0x93')],'as':_0x60bc('0xb5')}]})[_0x60bc('0x1f')](function(_0x8527ea){return[_0x8527ea,!![]];});});}})[_0x60bc('0x8b')](function(_0x484973,_0x397e1f){if(_0x397e1f){return _0x484973;}return db[_0x60bc('0x93')][_0x60bc('0x5a')](_[_0x60bc('0x51')](_0x2e51ec[_0x60bc('0x5e')],{'read':![],'body':_0x2e51ec[_0x60bc('0x5e')]['body'],'OpenchannelAccountId':_0x13b059['id'],'OpenchannelInteractionId':_0x484973['id'],'UserId':_0x2e51ec[_0x60bc('0x5c')]['id'],'ContactId':_0x57373c['id']}))[_0x60bc('0x1f')](function(_0x3177cb){_0x484973[_0x60bc('0xb6')][_0x60bc('0xb5')]=[];_0x484973[_0x60bc('0xb6')][_0x60bc('0xb5')][_0x60bc('0x90')](_0x3177cb['dataValues']);return _0x484973;});});}})[_0x60bc('0x1f')](respondWithResult(_0x168d8a,null))[_0x60bc('0x27')](handleError(_0x168d8a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 67bb0ba..6d7fa6c 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 _0xb821=['OpenchannelAccount','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x35b3d0,_0x230b9f){var _0x4c60d4=function(_0x22d375){while(--_0x22d375){_0x35b3d0['push'](_0x35b3d0['shift']());}};_0x4c60d4(++_0x230b9f);}(_0xb821,0xa7));var _0x1b82=function(_0x264e4c,_0xcbbef8){_0x264e4c=_0x264e4c-0x0;var _0xeef26a=_0xb821[_0x264e4c];return _0xeef26a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x1b82('0x0'))['db'][_0x1b82('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b82('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4b1809){return function(_0x3b1d14,_0x1403ab,_0x3fadf0){OpenchannelAccountEvents[_0x1b82('0x3')](_0x4b1809+':'+_0x3b1d14['id'],_0x3b1d14);OpenchannelAccountEvents['emit'](_0x4b1809,_0x3b1d14);_0x3fadf0(null);};}for(var e in events){if(events[_0x1b82('0x4')](e)){var event=events[e];OpenchannelAccount[_0x1b82('0x5')](e,emitEvent(event));}}module[_0x1b82('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xe5b5=['hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2b9ad8,_0x3022b1){var _0x3bc61e=function(_0x7b4d3){while(--_0x7b4d3){_0x2b9ad8['push'](_0x2b9ad8['shift']());}};_0x3bc61e(++_0x3022b1);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xe5b5[_0x8ba19a];return _0x2bd8b4;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var OpenchannelAccount=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];OpenchannelAccount[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f493b19..9f7336f 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(_0x4142be,_0x4617bc){var _0x5f0401=function(_0xdf2d0b){while(--_0xdf2d0b){_0x4142be['push'](_0x4142be['shift']());}};_0x5f0401(++_0x4617bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x6a42f6,_0x55b912){var _0x40cbc3=function(_0x4d8143){while(--_0x4d8143){_0x6a42f6['push'](_0x6a42f6['shift']());}};_0x40cbc3(++_0x55b912);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 9a9eace..bd03642 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 _0xbee3=['./openchannelAccount.socket','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0xef7945,_0x42298a){var _0x29d9ac=function(_0xb2cde6){while(--_0xb2cde6){_0xef7945['push'](_0xef7945['shift']());}};_0x29d9ac(++_0x42298a);}(_0xbee3,0xd5));var _0x3bee=function(_0x73e822,_0x4eb998){_0x73e822=_0x73e822-0x0;var _0x52bc3c=_0xbee3[_0x73e822];return _0x52bc3c;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3bee('0x1'));var fs=require('fs');var Redis=require(_0x3bee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var config=require('../../config/environment');var jayson=require(_0x3bee('0x6'));var client=jayson[_0x3bee('0x7')]['http']({'port':0x232a});config[_0x3bee('0x8')]=_[_0x3bee('0x9')](config[_0x3bee('0x8')],{'host':_0x3bee('0xa'),'port':0x18eb});var socket=require(_0x3bee('0xb'))(new Redis(config[_0x3bee('0x8')]));require(_0x3bee('0xc'))['register'](socket);function respondWithRpcPromise(_0x34cd74,_0x3c7964,_0x6cd504){return new BPromise(function(_0x280dcf,_0x356fef){return client[_0x3bee('0xd')](_0x34cd74,_0x6cd504)['then'](function(_0x32c0b){logger['info'](_0x3bee('0xe'),_0x3c7964,_0x3bee('0xf'));logger[_0x3bee('0x10')](_0x3bee('0x11'),_0x3c7964,_0x3bee('0xf'),JSON[_0x3bee('0x12')](_0x32c0b));if(_0x32c0b[_0x3bee('0x13')]){if(_0x32c0b['error'][_0x3bee('0x14')]===0x1f4){logger[_0x3bee('0x13')](_0x3bee('0xe'),_0x3c7964,_0x32c0b[_0x3bee('0x13')][_0x3bee('0x15')]);return _0x356fef(_0x32c0b['error']['message']);}logger[_0x3bee('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x3c7964,_0x32c0b[_0x3bee('0x13')][_0x3bee('0x15')]);return _0x280dcf(_0x32c0b['error']['message']);}else{logger[_0x3bee('0x16')](_0x3bee('0xe'),_0x3c7964,_0x3bee('0xf'));_0x280dcf(_0x32c0b[_0x3bee('0x17')]['message']);}})[_0x3bee('0x18')](function(_0x43f5d3){logger[_0x3bee('0x13')](_0x3bee('0xe'),_0x3c7964,_0x43f5d3);_0x356fef(_0x43f5d3);});});} \ No newline at end of file +var _0x536f=['redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf536('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf536('0x1'));var db=require(_0xf536('0x2'))['db'];var utils=require(_0xf536('0x3'));var logger=require(_0xf536('0x4'))('rpc');var config=require(_0xf536('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf536('0x6')][_0xf536('0x7')]({'port':0x232a});config[_0xf536('0x8')]=_['defaults'](config['redis'],{'host':_0xf536('0x9'),'port':0x18eb});var socket=require(_0xf536('0xa'))(new Redis(config[_0xf536('0x8')]));require(_0xf536('0xb'))['register'](socket);function respondWithRpcPromise(_0x4e7088,_0xbfbdfc,_0x1e0ebc){return new BPromise(function(_0x550a82,_0x4868bd){return client[_0xf536('0xc')](_0x4e7088,_0x1e0ebc)[_0xf536('0xd')](function(_0x16c1ae){logger[_0xf536('0xe')](_0xf536('0xf'),_0xbfbdfc,'request\x20sent');logger[_0xf536('0x10')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xbfbdfc,_0xf536('0x11'),JSON[_0xf536('0x12')](_0x16c1ae));if(_0x16c1ae[_0xf536('0x13')]){if(_0x16c1ae[_0xf536('0x13')][_0xf536('0x14')]===0x1f4){logger[_0xf536('0x13')](_0xf536('0xf'),_0xbfbdfc,_0x16c1ae[_0xf536('0x13')][_0xf536('0x15')]);return _0x4868bd(_0x16c1ae[_0xf536('0x13')][_0xf536('0x15')]);}logger[_0xf536('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0xbfbdfc,_0x16c1ae[_0xf536('0x13')]['message']);return _0x550a82(_0x16c1ae[_0xf536('0x13')]['message']);}else{logger[_0xf536('0xe')](_0xf536('0xf'),_0xbfbdfc,_0xf536('0x11'));_0x550a82(_0x16c1ae[_0xf536('0x16')][_0xf536('0x15')]);}})[_0xf536('0x17')](function(_0x271e4d){logger[_0xf536('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0xbfbdfc,_0x271e4d);_0x4868bd(_0x271e4d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 18b83c4..c37fedc 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 _0xe189=['update','removeListener','register','length','./openchannelAccount.events'];(function(_0xbb6e60,_0x124c23){var _0x3f7d9a=function(_0x28d6ac){while(--_0x28d6ac){_0xbb6e60['push'](_0xbb6e60['shift']());}};_0x3f7d9a(++_0x124c23);}(_0xe189,0x194));var _0x9e18=function(_0x452124,_0x350402){_0x452124=_0x452124-0x0;var _0x5903ad=_0xe189[_0x452124];return _0x5903ad;};'use strict';var OpenchannelAccountEvents=require(_0x9e18('0x0'));var events=['save','remove',_0x9e18('0x1')];function createListener(_0x2bc037,_0x22eac1){return function(_0x30a009){_0x22eac1['emit'](_0x2bc037,_0x30a009);};}function removeListener(_0x49b0f7,_0x1c652d){return function(){OpenchannelAccountEvents[_0x9e18('0x2')](_0x49b0f7,_0x1c652d);};}exports[_0x9e18('0x3')]=function(_0x53d7c9){for(var _0x3e6881=0x0,_0x5e6097=events[_0x9e18('0x4')];_0x3e6881<_0x5e6097;_0x3e6881++){var _0x2e4691=events[_0x3e6881];var _0x4656a4=createListener('openchannelAccount:'+_0x2e4691,_0x53d7c9);OpenchannelAccountEvents['on'](_0x2e4691,_0x4656a4);}}; \ No newline at end of file +var _0xc576=['./openchannelAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc576,0x1ea));var _0x6c57=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xc576[_0x3e8cae];return _0x45c4d6;};'use strict';var OpenchannelAccountEvents=require(_0x6c57('0x0'));var events=[_0x6c57('0x1'),_0x6c57('0x2'),_0x6c57('0x3')];function createListener(_0x187b99,_0x48e354){return function(_0x4fc60a){_0x48e354[_0x6c57('0x4')](_0x187b99,_0x4fc60a);};}function removeListener(_0x4e5df7,_0x31ab9f){return function(){OpenchannelAccountEvents[_0x6c57('0x5')](_0x4e5df7,_0x31ab9f);};}exports['register']=function(_0xa6e0c4){for(var _0x5e81a6=0x0,_0x95550a=events[_0x6c57('0x6')];_0x5e81a6<_0x95550a;_0x5e81a6++){var _0x599efc=events[_0x5e81a6];var _0x1b707a=createListener('openchannelAccount:'+_0x599efc,_0xa6e0c4);OpenchannelAccountEvents['on'](_0x599efc,_0x1b707a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 2d33cbc..dcf392f 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 _0x8f94=['../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa4048a,_0x1bb4dc){var _0x202f74=function(_0x49825a){while(--_0x49825a){_0xa4048a['push'](_0xa4048a['shift']());}};_0x202f74(++_0x1bb4dc);}(_0x8f94,0x9c));var _0x48f9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8f94[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x48f9('0x0'));var util=require('util');var path=require(_0x48f9('0x1'));var timeout=require(_0x48f9('0x2'));var express=require(_0x48f9('0x3'));var router=express[_0x48f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48f9('0x5'));var interaction=require(_0x48f9('0x6'));var config=require('../../config/environment');var controller=require(_0x48f9('0x7'));router[_0x48f9('0x8')]('/',auth[_0x48f9('0x9')](),controller['index']);router[_0x48f9('0x8')](_0x48f9('0xa'),auth[_0x48f9('0x9')](),controller[_0x48f9('0xb')]);router[_0x48f9('0xc')]('/',auth[_0x48f9('0x9')](),controller[_0x48f9('0xd')]);router[_0x48f9('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x48f9('0xf')](_0x48f9('0xa'),auth[_0x48f9('0x9')](),controller[_0x48f9('0x10')]);module[_0x48f9('0x11')]=router; \ No newline at end of file +var _0x472b=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x2c4aef,_0x116fe2){var _0x3deaed=function(_0x131052){while(--_0x131052){_0x2c4aef['push'](_0x2c4aef['shift']());}};_0x3deaed(++_0x116fe2);}(_0x472b,0x73));var _0xb472=function(_0x49176f,_0x50369a){_0x49176f=_0x49176f-0x0;var _0xc49084=_0x472b[_0x49176f];return _0xc49084;};'use strict';var multer=require(_0xb472('0x0'));var util=require(_0xb472('0x1'));var path=require(_0xb472('0x2'));var timeout=require('connect-timeout');var express=require(_0xb472('0x3'));var router=express[_0xb472('0x4')]();var fs_extra=require(_0xb472('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb472('0x6'));var config=require(_0xb472('0x7'));var controller=require(_0xb472('0x8'));router[_0xb472('0x9')]('/',auth[_0xb472('0xa')](),controller['index']);router[_0xb472('0x9')](_0xb472('0xb'),auth[_0xb472('0xa')](),controller[_0xb472('0xc')]);router[_0xb472('0xd')]('/',auth[_0xb472('0xa')](),controller[_0xb472('0xe')]);router[_0xb472('0xf')](_0xb472('0xb'),auth[_0xb472('0xa')](),controller[_0xb472('0x10')]);router[_0xb472('0x11')](_0xb472('0xb'),auth[_0xb472('0xa')](),controller[_0xb472('0x12')]);module[_0xb472('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9c546c5..8db1923 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 _0x0867=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x0867,0xfe));var _0x7086=function(_0x249912,_0x17f301){_0x249912=_0x249912-0x0;var _0x1861b9=_0x0867[_0x249912];return _0x1861b9;};'use strict';var Sequelize=require(_0x7086('0x0'));module[_0x7086('0x1')]={'priority':{'type':Sequelize[_0x7086('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7086('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7086('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7086('0x4')}}; \ No newline at end of file +var _0x2029=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x3d98bb,_0xb0f206){var _0xd62fa3=function(_0x49ba39){while(--_0x49ba39){_0x3d98bb['push'](_0x3d98bb['shift']());}};_0xd62fa3(++_0xb0f206);}(_0x2029,0x95));var _0x9202=function(_0x4ecdb3,_0x3e20f1){_0x4ecdb3=_0x4ecdb3-0x0;var _0x1a17dc=_0x2029[_0x4ecdb3];return _0x1a17dc;};'use strict';var Sequelize=require('sequelize');module[_0x9202('0x0')]={'priority':{'type':Sequelize[_0x9202('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9202('0x2')],'allowNull':![],'defaultValue':_0x9202('0x3')},'appdata':{'type':Sequelize[_0x9202('0x4')]()},'description':{'type':Sequelize[_0x9202('0x2')]},'interval':{'type':Sequelize[_0x9202('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 224d067..33ca5e5 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 _0x791a=['offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','catch','show','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x2d3ef7,_0x2fb595){var _0x25b7e4=function(_0xe09595){while(--_0xe09595){_0x2d3ef7['push'](_0x2d3ef7['shift']());}};_0x25b7e4(++_0x2fb595);}(_0x791a,0xfb));var _0xa791=function(_0x5ac2a7,_0xd5134c){_0x5ac2a7=_0x5ac2a7-0x0;var _0x10a217=_0x791a[_0x5ac2a7];return _0x10a217;};'use strict';var emlformat=require(_0xa791('0x0'));var rimraf=require(_0xa791('0x1'));var zipdir=require(_0xa791('0x2'));var jsonpatch=require(_0xa791('0x3'));var rp=require(_0xa791('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa791('0x5'));var path=require(_0xa791('0x6'));var sox=require(_0xa791('0x7'));var csv=require(_0xa791('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa791('0x9'));var squel=require(_0xa791('0xa'));var crypto=require(_0xa791('0xb'));var jsforce=require(_0xa791('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa791('0x8'));var querystring=require(_0xa791('0xd'));var Papa=require(_0xa791('0xe'));var Redis=require('ioredis');var authService=require(_0xa791('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa791('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xa791('0x11'));var config=require(_0xa791('0x12'));var licenseUtil=require(_0xa791('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59e42d,_0x42723d){_0x42723d=_0x42723d||0xcc;return function(_0x28504c){if(_0x28504c){return _0x59e42d[_0xa791('0x14')](_0x42723d);}return _0x59e42d['status'](_0x42723d)['end']();};}function respondWithResult(_0x8f368d,_0x28383f){_0x28383f=_0x28383f||0xc8;return function(_0xac85d7){if(_0xac85d7){return _0x8f368d['status'](_0x28383f)['json'](_0xac85d7);}};}function respondWithFilteredResult(_0x52336a,_0x345488){return function(_0x938edb){if(_0x938edb){var _0x4ac9a8=typeof _0x345488[_0xa791('0x15')]===_0xa791('0x16')&&typeof _0x345488[_0xa791('0x17')]==='undefined';var _0x5e2c15=_0x938edb[_0xa791('0x18')];var _0x7a525e=_0x4ac9a8?0x0:_0x345488[_0xa791('0x15')];var _0x32db7f=_0x4ac9a8?_0x938edb[_0xa791('0x18')]:_0x345488['offset']+_0x345488[_0xa791('0x17')];var _0x1548a3;if(_0x32db7f>=_0x5e2c15){_0x32db7f=_0x5e2c15;_0x1548a3=0xc8;}else{_0x1548a3=0xce;}_0x52336a[_0xa791('0x19')](_0x1548a3);return _0x52336a[_0xa791('0x1a')](_0xa791('0x1b'),_0x7a525e+'-'+_0x32db7f+'/'+_0x5e2c15)['json'](_0x938edb);}return null;};}function patchUpdates(_0x2b5437){return function(_0x21a060){try{jsonpatch[_0xa791('0x1c')](_0x21a060,_0x2b5437,!![]);}catch(_0x1ac9bb){return BPromise[_0xa791('0x1d')](_0x1ac9bb);}return _0x21a060[_0xa791('0x1e')]();};}function saveUpdates(_0x28a9d8,_0x3e72c7){return function(_0x183f7c){if(_0x183f7c){return _0x183f7c['update'](_0x28a9d8)[_0xa791('0x1f')](function(_0x12f7f3){return _0x12f7f3;});}return null;};}function removeEntity(_0x4d898a,_0x2070fc){return function(_0x36fddf){if(_0x36fddf){return _0x36fddf[_0xa791('0x20')]()[_0xa791('0x1f')](function(){_0x4d898a['status'](0xcc)[_0xa791('0x21')]();});}};}function handleEntityNotFound(_0x526e6f,_0x4fd780){return function(_0x2b9e20){if(!_0x2b9e20){_0x526e6f[_0xa791('0x14')](0x194);}return _0x2b9e20;};}function handleError(_0x50b089,_0x1f3104){_0x1f3104=_0x1f3104||0x1f4;return function(_0x351cc4){logger[_0xa791('0x22')](_0x351cc4[_0xa791('0x23')]);if(_0x351cc4[_0xa791('0x24')]){delete _0x351cc4[_0xa791('0x24')];}_0x50b089[_0xa791('0x19')](_0x1f3104)[_0xa791('0x25')](_0x351cc4);};}exports[_0xa791('0x26')]=function(_0x5c6ca6,_0x33200c){var _0x57a32a={},_0x49d09e={},_0x1831c3={'count':0x0,'rows':[]};var _0x2c8dca=_[_0xa791('0x27')](db[_0xa791('0x28')][_0xa791('0x29')],function(_0x368b53){return{'name':_0x368b53[_0xa791('0x2a')],'type':_0x368b53[_0xa791('0x2b')][_0xa791('0x2c')]};});_0x49d09e[_0xa791('0x2d')]=_[_0xa791('0x27')](_0x2c8dca,_0xa791('0x24'));_0x49d09e['query']=_[_0xa791('0x2e')](_0x5c6ca6['query']);_0x49d09e[_0xa791('0x2f')]=_['intersection'](_0x49d09e[_0xa791('0x2d')],_0x49d09e[_0xa791('0x30')]);_0x57a32a[_0xa791('0x31')]=_[_0xa791('0x32')](_0x49d09e['model'],qs['fields'](_0x5c6ca6[_0xa791('0x30')][_0xa791('0x33')]));_0x57a32a[_0xa791('0x31')]=_0x57a32a[_0xa791('0x31')][_0xa791('0x34')]?_0x57a32a['attributes']:_0x49d09e[_0xa791('0x2d')];if(!_0x5c6ca6[_0xa791('0x30')][_0xa791('0x35')](_0xa791('0x36'))){_0x57a32a[_0xa791('0x17')]=qs['limit'](_0x5c6ca6['query'][_0xa791('0x17')]);_0x57a32a[_0xa791('0x15')]=qs[_0xa791('0x15')](_0x5c6ca6[_0xa791('0x30')][_0xa791('0x15')]);}_0x57a32a['order']=qs[_0xa791('0x37')](_0x5c6ca6[_0xa791('0x30')][_0xa791('0x37')]);_0x57a32a[_0xa791('0x38')]=qs[_0xa791('0x2f')](_['pick'](_0x5c6ca6['query'],_0x49d09e[_0xa791('0x2f')]),_0x2c8dca);if(_0x5c6ca6[_0xa791('0x30')][_0xa791('0x39')]){_0x57a32a[_0xa791('0x38')]=_[_0xa791('0x3a')](_0x57a32a[_0xa791('0x38')],{'$or':_[_0xa791('0x27')](_0x2c8dca,function(_0x1936ec){if(_0x1936ec[_0xa791('0x2b')]!=='VIRTUAL'){var _0x2dbdf4={};_0x2dbdf4[_0x1936ec[_0xa791('0x24')]]={'$like':'%'+_0x5c6ca6[_0xa791('0x30')]['filter']+'%'};return _0x2dbdf4;}})});}_0x57a32a=_[_0xa791('0x3a')]({},_0x57a32a,_0x5c6ca6[_0xa791('0x3b')]);var _0x1c8630={'where':_0x57a32a['where']};return db['OpenchannelApplication'][_0xa791('0x18')](_0x1c8630)[_0xa791('0x1f')](function(_0x290d94){_0x1831c3[_0xa791('0x18')]=_0x290d94;if(_0x5c6ca6['query'][_0xa791('0x3c')]){_0x57a32a['include']=[{'all':!![]}];}return db[_0xa791('0x28')][_0xa791('0x3d')](_0x57a32a);})[_0xa791('0x1f')](function(_0x3182e8){_0x1831c3['rows']=_0x3182e8;return _0x1831c3;})[_0xa791('0x1f')](respondWithFilteredResult(_0x33200c,_0x57a32a))[_0xa791('0x3e')](handleError(_0x33200c,null));};exports[_0xa791('0x3f')]=function(_0x78e2d,_0x4d6124){var _0xe73f50={'raw':!![],'where':{'id':_0x78e2d['params']['id']}},_0x10ab60={};_0x10ab60[_0xa791('0x2d')]=_[_0xa791('0x2e')](db[_0xa791('0x28')][_0xa791('0x29')]);_0x10ab60[_0xa791('0x30')]=_[_0xa791('0x2e')](_0x78e2d[_0xa791('0x30')]);_0x10ab60[_0xa791('0x2f')]=_[_0xa791('0x32')](_0x10ab60[_0xa791('0x2d')],_0x10ab60[_0xa791('0x30')]);_0xe73f50[_0xa791('0x31')]=_[_0xa791('0x32')](_0x10ab60['model'],qs[_0xa791('0x33')](_0x78e2d[_0xa791('0x30')][_0xa791('0x33')]));_0xe73f50[_0xa791('0x31')]=_0xe73f50[_0xa791('0x31')][_0xa791('0x34')]?_0xe73f50[_0xa791('0x31')]:_0x10ab60[_0xa791('0x2d')];if(_0x78e2d[_0xa791('0x30')]['includeAll']){_0xe73f50['include']=[{'all':!![]}];}_0xe73f50=_[_0xa791('0x3a')]({},_0xe73f50,_0x78e2d[_0xa791('0x3b')]);return db[_0xa791('0x28')][_0xa791('0x40')](_0xe73f50)[_0xa791('0x1f')](handleEntityNotFound(_0x4d6124,null))[_0xa791('0x1f')](respondWithResult(_0x4d6124,null))[_0xa791('0x3e')](handleError(_0x4d6124,null));};exports[_0xa791('0x41')]=function(_0x40de50,_0x35798a){return db['OpenchannelApplication'][_0xa791('0x41')](_0x40de50[_0xa791('0x42')],{})['then'](respondWithResult(_0x35798a,0xc9))[_0xa791('0x3e')](handleError(_0x35798a,null));};exports[_0xa791('0x43')]=function(_0x2d93d2,_0xab7e09){if(_0x2d93d2['body']['id']){delete _0x2d93d2[_0xa791('0x42')]['id'];}return db[_0xa791('0x28')][_0xa791('0x40')]({'where':{'id':_0x2d93d2['params']['id']}})['then'](handleEntityNotFound(_0xab7e09,null))[_0xa791('0x1f')](saveUpdates(_0x2d93d2[_0xa791('0x42')],null))['then'](respondWithResult(_0xab7e09,null))['catch'](handleError(_0xab7e09,null));};exports['destroy']=function(_0x52b022,_0x23d2fc){return db[_0xa791('0x28')][_0xa791('0x40')]({'where':{'id':_0x52b022['params']['id']}})['then'](handleEntityNotFound(_0x23d2fc,null))[_0xa791('0x1f')](removeEntity(_0x23d2fc,null))[_0xa791('0x3e')](handleError(_0x23d2fc,null));}; \ No newline at end of file +var _0xb82d=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','index','OpenchannelApplication','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb82d,0x165));var _0xdb82=function(_0x1332c1,_0x1e1044){_0x1332c1=_0x1332c1-0x0;var _0x707ac0=_0xb82d[_0x1332c1];return _0x707ac0;};'use strict';var emlformat=require(_0xdb82('0x0'));var rimraf=require(_0xdb82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb82('0x2'));var rp=require(_0xdb82('0x3'));var moment=require(_0xdb82('0x4'));var BPromise=require(_0xdb82('0x5'));var Mustache=require('mustache');var util=require(_0xdb82('0x6'));var path=require(_0xdb82('0x7'));var sox=require(_0xdb82('0x8'));var csv=require(_0xdb82('0x9'));var ejs=require(_0xdb82('0xa'));var fs=require('fs');var fs_extra=require(_0xdb82('0xb'));var _=require(_0xdb82('0xc'));var squel=require(_0xdb82('0xd'));var crypto=require(_0xdb82('0xe'));var jsforce=require(_0xdb82('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdb82('0x9'));var querystring=require(_0xdb82('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdb82('0x11'));var qs=require(_0xdb82('0x12'));var as=require(_0xdb82('0x13'));var hardwareService=require(_0xdb82('0x14'));var logger=require('../../config/logger')(_0xdb82('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdb82('0x16'));var db=require(_0xdb82('0x17'))['db'];function respondWithStatusCode(_0x13e0c5,_0x83e62b){_0x83e62b=_0x83e62b||0xcc;return function(_0x4d9a52){if(_0x4d9a52){return _0x13e0c5[_0xdb82('0x18')](_0x83e62b);}return _0x13e0c5['status'](_0x83e62b)[_0xdb82('0x19')]();};}function respondWithResult(_0x20dea2,_0x1e2a33){_0x1e2a33=_0x1e2a33||0xc8;return function(_0x4d15bb){if(_0x4d15bb){return _0x20dea2[_0xdb82('0x1a')](_0x1e2a33)[_0xdb82('0x1b')](_0x4d15bb);}};}function respondWithFilteredResult(_0x146a37,_0x21def9){return function(_0x42f9eb){if(_0x42f9eb){var _0x5acc19=typeof _0x21def9['offset']===_0xdb82('0x1c')&&typeof _0x21def9[_0xdb82('0x1d')]===_0xdb82('0x1c');var _0x2e842c=_0x42f9eb['count'];var _0x3458c7=_0x5acc19?0x0:_0x21def9['offset'];var _0x4061ba=_0x5acc19?_0x42f9eb[_0xdb82('0x1e')]:_0x21def9[_0xdb82('0x1f')]+_0x21def9['limit'];var _0x5d5ff7;if(_0x4061ba>=_0x2e842c){_0x4061ba=_0x2e842c;_0x5d5ff7=0xc8;}else{_0x5d5ff7=0xce;}_0x146a37['status'](_0x5d5ff7);return _0x146a37[_0xdb82('0x20')](_0xdb82('0x21'),_0x3458c7+'-'+_0x4061ba+'/'+_0x2e842c)['json'](_0x42f9eb);}return null;};}function patchUpdates(_0x2c24fb){return function(_0x19adea){try{jsonpatch['apply'](_0x19adea,_0x2c24fb,!![]);}catch(_0x48a0c6){return BPromise[_0xdb82('0x22')](_0x48a0c6);}return _0x19adea[_0xdb82('0x23')]();};}function saveUpdates(_0x52fba8,_0x32be2b){return function(_0x5bd2d1){if(_0x5bd2d1){return _0x5bd2d1[_0xdb82('0x24')](_0x52fba8)['then'](function(_0xe569f8){return _0xe569f8;});}return null;};}function removeEntity(_0x184c7e,_0x22bb49){return function(_0x304f56){if(_0x304f56){return _0x304f56[_0xdb82('0x25')]()[_0xdb82('0x26')](function(){_0x184c7e['status'](0xcc)[_0xdb82('0x19')]();});}};}function handleEntityNotFound(_0xfa5820,_0x56be10){return function(_0x1a2d92){if(!_0x1a2d92){_0xfa5820['sendStatus'](0x194);}return _0x1a2d92;};}function handleError(_0x3675cc,_0x1000e6){_0x1000e6=_0x1000e6||0x1f4;return function(_0x470da9){logger['error'](_0x470da9[_0xdb82('0x27')]);if(_0x470da9[_0xdb82('0x28')]){delete _0x470da9[_0xdb82('0x28')];}_0x3675cc[_0xdb82('0x1a')](_0x1000e6)['send'](_0x470da9);};}exports[_0xdb82('0x29')]=function(_0x416b0b,_0x234313){var _0x242f06={},_0x4321b5={},_0xc01757={'count':0x0,'rows':[]};var _0x11c531=_['map'](db[_0xdb82('0x2a')][_0xdb82('0x2b')],function(_0x59ca97){return{'name':_0x59ca97['fieldName'],'type':_0x59ca97[_0xdb82('0x2c')][_0xdb82('0x2d')]};});_0x4321b5[_0xdb82('0x2e')]=_[_0xdb82('0x2f')](_0x11c531,_0xdb82('0x28'));_0x4321b5['query']=_[_0xdb82('0x30')](_0x416b0b[_0xdb82('0x31')]);_0x4321b5[_0xdb82('0x32')]=_[_0xdb82('0x33')](_0x4321b5['model'],_0x4321b5[_0xdb82('0x31')]);_0x242f06[_0xdb82('0x34')]=_['intersection'](_0x4321b5[_0xdb82('0x2e')],qs['fields'](_0x416b0b[_0xdb82('0x31')][_0xdb82('0x35')]));_0x242f06['attributes']=_0x242f06['attributes'][_0xdb82('0x36')]?_0x242f06[_0xdb82('0x34')]:_0x4321b5['model'];if(!_0x416b0b['query']['hasOwnProperty']('nolimit')){_0x242f06[_0xdb82('0x1d')]=qs['limit'](_0x416b0b[_0xdb82('0x31')]['limit']);_0x242f06[_0xdb82('0x1f')]=qs[_0xdb82('0x1f')](_0x416b0b[_0xdb82('0x31')]['offset']);}_0x242f06[_0xdb82('0x37')]=qs[_0xdb82('0x38')](_0x416b0b['query'][_0xdb82('0x38')]);_0x242f06[_0xdb82('0x39')]=qs[_0xdb82('0x32')](_[_0xdb82('0x3a')](_0x416b0b[_0xdb82('0x31')],_0x4321b5[_0xdb82('0x32')]),_0x11c531);if(_0x416b0b['query'][_0xdb82('0x3b')]){_0x242f06[_0xdb82('0x39')]=_[_0xdb82('0x3c')](_0x242f06[_0xdb82('0x39')],{'$or':_[_0xdb82('0x2f')](_0x11c531,function(_0x309550){if(_0x309550[_0xdb82('0x2c')]!==_0xdb82('0x3d')){var _0x254a95={};_0x254a95[_0x309550['name']]={'$like':'%'+_0x416b0b[_0xdb82('0x31')][_0xdb82('0x3b')]+'%'};return _0x254a95;}})});}_0x242f06=_[_0xdb82('0x3c')]({},_0x242f06,_0x416b0b[_0xdb82('0x3e')]);var _0x20570e={'where':_0x242f06['where']};return db[_0xdb82('0x2a')][_0xdb82('0x1e')](_0x20570e)[_0xdb82('0x26')](function(_0x15d103){_0xc01757[_0xdb82('0x1e')]=_0x15d103;if(_0x416b0b[_0xdb82('0x31')]['includeAll']){_0x242f06['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xdb82('0x3f')](_0x242f06);})[_0xdb82('0x26')](function(_0x5a8bd6){_0xc01757[_0xdb82('0x40')]=_0x5a8bd6;return _0xc01757;})['then'](respondWithFilteredResult(_0x234313,_0x242f06))['catch'](handleError(_0x234313,null));};exports[_0xdb82('0x41')]=function(_0x456850,_0x34bff4){var _0x1d8542={'raw':!![],'where':{'id':_0x456850[_0xdb82('0x42')]['id']}},_0x54d0c4={};_0x54d0c4[_0xdb82('0x2e')]=_['keys'](db['OpenchannelApplication'][_0xdb82('0x2b')]);_0x54d0c4[_0xdb82('0x31')]=_[_0xdb82('0x30')](_0x456850[_0xdb82('0x31')]);_0x54d0c4[_0xdb82('0x32')]=_[_0xdb82('0x33')](_0x54d0c4[_0xdb82('0x2e')],_0x54d0c4[_0xdb82('0x31')]);_0x1d8542[_0xdb82('0x34')]=_[_0xdb82('0x33')](_0x54d0c4[_0xdb82('0x2e')],qs[_0xdb82('0x35')](_0x456850[_0xdb82('0x31')][_0xdb82('0x35')]));_0x1d8542[_0xdb82('0x34')]=_0x1d8542[_0xdb82('0x34')][_0xdb82('0x36')]?_0x1d8542[_0xdb82('0x34')]:_0x54d0c4[_0xdb82('0x2e')];if(_0x456850['query'][_0xdb82('0x43')]){_0x1d8542[_0xdb82('0x44')]=[{'all':!![]}];}_0x1d8542=_[_0xdb82('0x3c')]({},_0x1d8542,_0x456850[_0xdb82('0x3e')]);return db[_0xdb82('0x2a')][_0xdb82('0x45')](_0x1d8542)[_0xdb82('0x26')](handleEntityNotFound(_0x34bff4,null))[_0xdb82('0x26')](respondWithResult(_0x34bff4,null))[_0xdb82('0x46')](handleError(_0x34bff4,null));};exports[_0xdb82('0x47')]=function(_0x2cd74d,_0x253390){return db[_0xdb82('0x2a')][_0xdb82('0x47')](_0x2cd74d[_0xdb82('0x48')],{})['then'](respondWithResult(_0x253390,0xc9))[_0xdb82('0x46')](handleError(_0x253390,null));};exports['update']=function(_0x51bc2e,_0x1078b4){if(_0x51bc2e[_0xdb82('0x48')]['id']){delete _0x51bc2e['body']['id'];}return db[_0xdb82('0x2a')][_0xdb82('0x45')]({'where':{'id':_0x51bc2e[_0xdb82('0x42')]['id']}})[_0xdb82('0x26')](handleEntityNotFound(_0x1078b4,null))[_0xdb82('0x26')](saveUpdates(_0x51bc2e[_0xdb82('0x48')],null))[_0xdb82('0x26')](respondWithResult(_0x1078b4,null))[_0xdb82('0x46')](handleError(_0x1078b4,null));};exports[_0xdb82('0x25')]=function(_0x52878a,_0x5351a5){return db['OpenchannelApplication']['find']({'where':{'id':_0x52878a[_0xdb82('0x42')]['id']}})[_0xdb82('0x26')](handleEntityNotFound(_0x5351a5,null))[_0xdb82('0x26')](removeEntity(_0x5351a5,null))[_0xdb82('0x46')](handleError(_0x5351a5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 39cb00c..33af2e9 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 _0x88f3=['bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88f3,0xa5));var _0x388f=function(_0x51b67b,_0x37cee1){_0x51b67b=_0x51b67b-0x0;var _0x1bd59e=_0x88f3[_0x51b67b];return _0x1bd59e;};'use strict';var _=require(_0x388f('0x0'));var util=require(_0x388f('0x1'));var logger=require('../../config/logger')(_0x388f('0x2'));var moment=require(_0x388f('0x3'));var BPromise=require(_0x388f('0x4'));var rp=require(_0x388f('0x5'));var fs=require('fs');var path=require(_0x388f('0x6'));var rimraf=require(_0x388f('0x7'));var config=require(_0x388f('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x388f('0x9')]=function(_0x31ef1e,_0xdeb865){return _0x31ef1e['define'](_0x388f('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x388f('0xb'),'collate':_0x388f('0xc')});}; \ No newline at end of file +var _0xe244=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','exports','define'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xe244,0xcc));var _0x4e24=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe244[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4e24('0x0'))('api');var moment=require(_0x4e24('0x1'));var BPromise=require(_0x4e24('0x2'));var rp=require(_0x4e24('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x4e24('0x4')]=function(_0x570c16,_0x5665c2){return _0x570c16[_0x4e24('0x5')](_0x4e24('0x6'),attributes,{'tableName':_0x4e24('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e24('0x8'),'collate':_0x4e24('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d867c57..ffbddfc 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 _0x1441=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','limit','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x4a8fb0,_0x8c4c35){var _0x31c144=function(_0x578e8e){while(--_0x578e8e){_0x4a8fb0['push'](_0x4a8fb0['shift']());}};_0x31c144(++_0x8c4c35);}(_0x1441,0xca));var _0x1144=function(_0x280146,_0x45c87d){_0x280146=_0x280146-0x0;var _0x5ede73=_0x1441[_0x280146];return _0x5ede73;};'use strict';var _=require('lodash');var util=require(_0x1144('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1144('0x1'));var fs=require('fs');var Redis=require(_0x1144('0x2'));var db=require(_0x1144('0x3'))['db'];var utils=require(_0x1144('0x4'));var logger=require(_0x1144('0x5'))('rpc');var config=require(_0x1144('0x6'));var jayson=require(_0x1144('0x7'));var client=jayson[_0x1144('0x8')][_0x1144('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379405,_0x41a72d,_0x540bf0){return new BPromise(function(_0x5eea3c,_0x3987e6){return client['request'](_0x379405,_0x540bf0)[_0x1144('0xa')](function(_0xcce1f1){logger[_0x1144('0xb')](_0x1144('0xc'),_0x41a72d,_0x1144('0xd'));logger['debug'](_0x1144('0xe'),_0x41a72d,'request\x20sent',JSON[_0x1144('0xf')](_0xcce1f1));if(_0xcce1f1[_0x1144('0x10')]){if(_0xcce1f1[_0x1144('0x10')]['code']===0x1f4){logger['error'](_0x1144('0xc'),_0x41a72d,_0xcce1f1['error'][_0x1144('0x11')]);return _0x3987e6(_0xcce1f1[_0x1144('0x10')][_0x1144('0x11')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x41a72d,_0xcce1f1[_0x1144('0x10')][_0x1144('0x11')]);return _0x5eea3c(_0xcce1f1[_0x1144('0x10')][_0x1144('0x11')]);}else{logger[_0x1144('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x41a72d,_0x1144('0xd'));_0x5eea3c(_0xcce1f1[_0x1144('0x12')]['message']);}})['catch'](function(_0x4a5a5c){logger[_0x1144('0x10')](_0x1144('0xc'),_0x41a72d,_0x4a5a5c);_0x3987e6(_0x4a5a5c);});});}exports[_0x1144('0x13')]=function(_0x291201){var _0x45097b=this;return new Promise(function(_0x2cb076,_0x538774){return db[_0x1144('0x14')]['update'](_0x291201[_0x1144('0x15')],{'raw':_0x291201['options']?_0x291201[_0x1144('0x16')][_0x1144('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291201['options']?_0x291201[_0x1144('0x16')][_0x1144('0x18')]||null:null,'attributes':_0x291201[_0x1144('0x16')]?_0x291201[_0x1144('0x16')]['attributes']||null:null,'limit':_0x291201[_0x1144('0x16')]?_0x291201[_0x1144('0x16')][_0x1144('0x19')]||null:null})[_0x1144('0xa')](function(_0x17ca9e){logger[_0x1144('0xb')](_0x1144('0x13'),_0x291201);logger['debug'](_0x1144('0x13'),_0x291201,JSON[_0x1144('0xf')](_0x17ca9e));_0x2cb076(_0x17ca9e);})[_0x1144('0x1a')](function(_0x40c5a9){logger[_0x1144('0x10')]('UpdateOpenchannelApplication',_0x40c5a9[_0x1144('0x11')],_0x291201);_0x538774(_0x45097b[_0x1144('0x10')](0x1f4,_0x40c5a9[_0x1144('0x11')]));});});}; \ No newline at end of file +var _0x1b45=['OpenchannelApplication,\x20%s,\x20%s','message','result','body','options','raw','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x1b45,0x96));var _0x51b4=function(_0x291b93,_0x44b715){_0x291b93=_0x291b93-0x0;var _0x4183c8=_0x1b45[_0x291b93];return _0x4183c8;};'use strict';var _=require(_0x51b4('0x0'));var util=require(_0x51b4('0x1'));var moment=require(_0x51b4('0x2'));var BPromise=require(_0x51b4('0x3'));var rs=require(_0x51b4('0x4'));var fs=require('fs');var Redis=require(_0x51b4('0x5'));var db=require(_0x51b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x51b4('0x7'))('rpc');var config=require(_0x51b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x51b4('0x9')][_0x51b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43ba9f,_0x489864,_0x3d1d06){return new BPromise(function(_0x13c2df,_0x3f2693){return client[_0x51b4('0xb')](_0x43ba9f,_0x3d1d06)[_0x51b4('0xc')](function(_0x1fbe02){logger[_0x51b4('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x489864,_0x51b4('0xe'));logger['debug'](_0x51b4('0xf'),_0x489864,_0x51b4('0xe'),JSON[_0x51b4('0x10')](_0x1fbe02));if(_0x1fbe02['error']){if(_0x1fbe02[_0x51b4('0x11')]['code']===0x1f4){logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);return _0x3f2693(_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);}logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x1fbe02['error'][_0x51b4('0x13')]);return _0x13c2df(_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);}else{logger[_0x51b4('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x489864,'request\x20sent');_0x13c2df(_0x1fbe02[_0x51b4('0x14')][_0x51b4('0x13')]);}})['catch'](function(_0x3ce994){logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x3ce994);_0x3f2693(_0x3ce994);});});}exports['UpdateOpenchannelApplication']=function(_0x52ae6d){var _0x3a0fd9=this;return new Promise(function(_0x5ba63c,_0x22e78a){return db['OpenchannelApplication']['update'](_0x52ae6d[_0x51b4('0x15')],{'raw':_0x52ae6d[_0x51b4('0x16')]?_0x52ae6d['options'][_0x51b4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ae6d['options']?_0x52ae6d[_0x51b4('0x16')]['where']||null:null,'attributes':_0x52ae6d[_0x51b4('0x16')]?_0x52ae6d['options'][_0x51b4('0x18')]||null:null,'limit':_0x52ae6d['options']?_0x52ae6d['options'][_0x51b4('0x19')]||null:null})[_0x51b4('0xc')](function(_0x42abef){logger['info'](_0x51b4('0x1a'),_0x52ae6d);logger['debug'](_0x51b4('0x1a'),_0x52ae6d,JSON['stringify'](_0x42abef));_0x5ba63c(_0x42abef);})[_0x51b4('0x1b')](function(_0x5c05d1){logger[_0x51b4('0x11')](_0x51b4('0x1a'),_0x5c05d1['message'],_0x52ae6d);_0x22e78a(_0x3a0fd9['error'](0x1f4,_0x5c05d1['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 336eb18..c22ae36 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 _0x3c0a=['tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','update','delete','/:id','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x3c0a,0x14a));var _0xa3c0=function(_0x162305,_0x3f9a6c){_0x162305=_0x162305-0x0;var _0x3ca68f=_0x3c0a[_0x162305];return _0x3ca68f;};'use strict';var multer=require(_0xa3c0('0x0'));var util=require(_0xa3c0('0x1'));var path=require(_0xa3c0('0x2'));var timeout=require(_0xa3c0('0x3'));var express=require(_0xa3c0('0x4'));var router=express[_0xa3c0('0x5')]();var fs_extra=require(_0xa3c0('0x6'));var auth=require(_0xa3c0('0x7'));var interaction=require(_0xa3c0('0x8'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xa3c0('0x9')]('/',auth[_0xa3c0('0xa')](),controller[_0xa3c0('0xb')]);router[_0xa3c0('0x9')](_0xa3c0('0xc'),auth[_0xa3c0('0xa')](),controller[_0xa3c0('0xd')]);router['get']('/:id',auth[_0xa3c0('0xa')](),controller[_0xa3c0('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa3c0('0xf')]);router[_0xa3c0('0x9')](_0xa3c0('0x10'),auth['isAuthenticated'](),controller[_0xa3c0('0x11')]);router[_0xa3c0('0x12')]('/',auth['isAuthenticated'](),controller[_0xa3c0('0x13')]);router[_0xa3c0('0x12')]('/:id/messages',auth[_0xa3c0('0xa')](),controller[_0xa3c0('0x14')]);router[_0xa3c0('0x12')](_0xa3c0('0x15'),auth[_0xa3c0('0xa')](),interaction[_0xa3c0('0x16')](_0xa3c0('0x17'),_0xa3c0('0x18')),controller['addTags']);router['put']('/:id',auth[_0xa3c0('0xa')](),interaction['tracked'](_0xa3c0('0x17'),_0xa3c0('0x19')),controller[_0xa3c0('0x1a')]);router[_0xa3c0('0x1b')](_0xa3c0('0x1c'),auth[_0xa3c0('0xa')](),interaction[_0xa3c0('0x16')](_0xa3c0('0x17'),'openchannelinteraction:destroy'),controller[_0xa3c0('0x1d')]);router[_0xa3c0('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa3c0('0x1e')]);module[_0xa3c0('0x1f')]=router; \ No newline at end of file +var _0x4a30=['/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','/:id','show','getMessages','download','/:id/messages','addMessage'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x4a30,0xb3));var _0x04a3=function(_0x348466,_0x1f5b03){_0x348466=_0x348466-0x0;var _0x372478=_0x4a30[_0x348466];return _0x372478;};'use strict';var multer=require(_0x04a3('0x0'));var util=require(_0x04a3('0x1'));var path=require(_0x04a3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x04a3('0x3')]();var fs_extra=require(_0x04a3('0x4'));var auth=require(_0x04a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x04a3('0x6'));var controller=require(_0x04a3('0x7'));router[_0x04a3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x04a3('0x8')](_0x04a3('0x9'),auth[_0x04a3('0xa')](),controller['describe']);router[_0x04a3('0x8')](_0x04a3('0xb'),auth[_0x04a3('0xa')](),controller[_0x04a3('0xc')]);router[_0x04a3('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x04a3('0xd')]);router[_0x04a3('0x8')]('/:id/download',auth[_0x04a3('0xa')](),controller[_0x04a3('0xe')]);router['post']('/',auth[_0x04a3('0xa')](),controller['create']);router['post'](_0x04a3('0xf'),auth[_0x04a3('0xa')](),controller[_0x04a3('0x10')]);router['post'](_0x04a3('0x11'),auth[_0x04a3('0xa')](),interaction[_0x04a3('0x12')]('openchannel',_0x04a3('0x13')),controller[_0x04a3('0x14')]);router[_0x04a3('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x04a3('0x12')](_0x04a3('0x16'),_0x04a3('0x17')),controller[_0x04a3('0x18')]);router['delete'](_0x04a3('0xb'),auth[_0x04a3('0xa')](),interaction[_0x04a3('0x12')]('openchannel',_0x04a3('0x19')),controller[_0x04a3('0x1a')]);router['delete'](_0x04a3('0x11'),auth[_0x04a3('0xa')](),controller['removeTags']);module[_0x04a3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 242f69e..c6e72c7 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 _0xb26e=['ENUM','out','BOOLEAN','sequelize','STRING','DATE'];(function(_0x501035,_0x3c1742){var _0x4dd166=function(_0x2679d3){while(--_0x2679d3){_0x501035['push'](_0x501035['shift']());}};_0x4dd166(++_0x3c1742);}(_0xb26e,0x11d));var _0xeb26=function(_0x36b5be,_0x25cbb9){_0x36b5be=_0x36b5be-0x0;var _0x186b09=_0xb26e[_0x36b5be];return _0x186b09;};'use strict';var Sequelize=require(_0xeb26('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb26('0x1')]},'secondDisposition':{'type':Sequelize[_0xeb26('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xeb26('0x1')]},'read1stAt':{'type':Sequelize[_0xeb26('0x2')]},'threadId':{'type':Sequelize[_0xeb26('0x1')]},'externalUrl':{'type':Sequelize[_0xeb26('0x1')]},'lastMsgAt':{'type':Sequelize[_0xeb26('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xeb26('0x3')]('in',_0xeb26('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xeb26('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0xeb26('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x87df=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x2edfb7,_0x2e5887){var _0xe81fa2=function(_0x39434f){while(--_0x39434f){_0x2edfb7['push'](_0x2edfb7['shift']());}};_0xe81fa2(++_0x2e5887);}(_0x87df,0x167));var _0xf87d=function(_0x147e56,_0x2efae8){_0x147e56=_0x147e56-0x0;var _0x40c49c=_0x87df[_0x147e56];return _0x40c49c;};'use strict';var Sequelize=require(_0xf87d('0x0'));module[_0xf87d('0x1')]={'closed':{'type':Sequelize[_0xf87d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf87d('0x3')]},'disposition':{'type':Sequelize[_0xf87d('0x4')]},'secondDisposition':{'type':Sequelize[_0xf87d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf87d('0x4')]},'note':{'type':Sequelize[_0xf87d('0x4')]},'read1stAt':{'type':Sequelize[_0xf87d('0x3')]},'threadId':{'type':Sequelize[_0xf87d('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf87d('0x5')]('in',_0xf87d('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xf87d('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 931dd96..d2e4fd9 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 _0xf530=['push','catch','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','find','unreadMessages','value','`\x20>\x200','Contact','operator','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','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','start','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','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','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','show','params','includeAll','include','create','describe','OpenchannelMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','setTags','omit','color','unix','server','files','tmp','join','root','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','direction','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','stack','name','Users','fullname','TagIds','split','forEach','Tags'];(function(_0x49a544,_0x1f292c){var _0x531b78=function(_0x3231b3){while(--_0x3231b3){_0x49a544['push'](_0x49a544['shift']());}};_0x531b78(++_0x1f292c);}(_0xf530,0x19f));var _0x0f53=function(_0x128e43,_0x437e16){_0x128e43=_0x128e43-0x0;var _0x5477d6=_0xf530[_0x128e43];return _0x5477d6;};'use strict';var emlformat=require(_0x0f53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f53('0x1'));var jsonpatch=require(_0x0f53('0x2'));var rp=require(_0x0f53('0x3'));var moment=require(_0x0f53('0x4'));var BPromise=require(_0x0f53('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f53('0x6'));var sox=require(_0x0f53('0x7'));var csv=require(_0x0f53('0x8'));var ejs=require(_0x0f53('0x9'));var fs=require('fs');var fs_extra=require(_0x0f53('0xa'));var _=require(_0x0f53('0xb'));var squel=require(_0x0f53('0xc'));var crypto=require(_0x0f53('0xd'));var jsforce=require(_0x0f53('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f53('0x8'));var querystring=require(_0x0f53('0xf'));var Papa=require(_0x0f53('0x10'));var Redis=require(_0x0f53('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0f53('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x0f53('0x13'));var logger=require('../../config/logger')(_0x0f53('0x14'));var utils=require(_0x0f53('0x15'));var config=require(_0x0f53('0x16'));var licenseUtil=require(_0x0f53('0x17'));var db=require('../../mysqldb')['db'];config[_0x0f53('0x18')]=_[_0x0f53('0x19')](config[_0x0f53('0x18')],{'host':_0x0f53('0x1a'),'port':0x18eb});var socket=require(_0x0f53('0x1b'))(new Redis(config[_0x0f53('0x18')]));require(_0x0f53('0x1c'))['register'](socket);function respondWithStatusCode(_0xdea233,_0x2115fb){_0x2115fb=_0x2115fb||0xcc;return function(_0x7388d2){if(_0x7388d2){return _0xdea233[_0x0f53('0x1d')](_0x2115fb);}return _0xdea233[_0x0f53('0x1e')](_0x2115fb)['end']();};}function respondWithResult(_0x3dacac,_0xf01e90){_0xf01e90=_0xf01e90||0xc8;return function(_0xd73f0){if(_0xd73f0){return _0x3dacac[_0x0f53('0x1e')](_0xf01e90)[_0x0f53('0x1f')](_0xd73f0);}};}function respondWithFilteredResult(_0x5ec528,_0xedf493){return function(_0x33fa97){if(_0x33fa97){var _0x38147b=typeof _0xedf493[_0x0f53('0x20')]===_0x0f53('0x21')&&typeof _0xedf493[_0x0f53('0x22')]===_0x0f53('0x21');var _0x24527a=_0x33fa97[_0x0f53('0x23')];var _0x472366=_0x38147b?0x0:_0xedf493['offset'];var _0x27ebe5=_0x38147b?_0x33fa97[_0x0f53('0x23')]:_0xedf493[_0x0f53('0x20')]+_0xedf493[_0x0f53('0x22')];var _0x21cefd;if(_0x27ebe5>=_0x24527a){_0x27ebe5=_0x24527a;_0x21cefd=0xc8;}else{_0x21cefd=0xce;}_0x5ec528[_0x0f53('0x1e')](_0x21cefd);return _0x5ec528[_0x0f53('0x24')]('Content-Range',_0x472366+'-'+_0x27ebe5+'/'+_0x24527a)['json'](_0x33fa97);}return null;};}function patchUpdates(_0x5f05a6){return function(_0xe93489){try{jsonpatch[_0x0f53('0x25')](_0xe93489,_0x5f05a6,!![]);}catch(_0x2df1d3){return BPromise['reject'](_0x2df1d3);}return _0xe93489[_0x0f53('0x26')]();};}function saveUpdates(_0x40e598,_0x154109){return function(_0x37e382){if(_0x37e382){return _0x37e382[_0x0f53('0x27')](_0x40e598)[_0x0f53('0x28')](function(_0x3a96fc){return _0x3a96fc;});}return null;};}function removeEntity(_0x2e25ca,_0x17a220){return function(_0x31506f){if(_0x31506f){return _0x31506f[_0x0f53('0x29')]()[_0x0f53('0x28')](function(){_0x2e25ca['status'](0xcc)[_0x0f53('0x2a')]();});}};}function handleEntityNotFound(_0x4ce8c,_0x335dae){return function(_0x2dfde6){if(!_0x2dfde6){_0x4ce8c[_0x0f53('0x1d')](0x194);}return _0x2dfde6;};}function handleError(_0x293268,_0x9abba9){_0x9abba9=_0x9abba9||0x1f4;return function(_0x4dca8e){logger['error'](_0x4dca8e[_0x0f53('0x2b')]);if(_0x4dca8e['name']){delete _0x4dca8e[_0x0f53('0x2c')];}_0x293268[_0x0f53('0x1e')](_0x9abba9)['send'](_0x4dca8e);};}function getInteractionUsers(_0x4da63a,_0x5162cd){return new BPromise(function(_0xd7441e,_0x191a91){try{if(_0x5162cd[_0x4da63a['id']]){_0x4da63a[_0x0f53('0x2d')]=_['map'](_0x5162cd[_0x4da63a['id']],function(_0x2948f1){return{'id':_0x2948f1['id'],'fullname':_0x2948f1[_0x0f53('0x2e')]};});}}catch(_0x125685){_0x191a91(_0x125685);}_0xd7441e(_0x4da63a);});}function getInteractionTags(_0x5726e8,_0x46fc22){return new BPromise(function(_0x2be602,_0xaffb99){try{if(_0x5726e8[_0x0f53('0x2f')]){_0x5726e8['Tags']=[];_0x5726e8[_0x0f53('0x2f')][_0x0f53('0x30')](',')[_0x0f53('0x31')](function(_0xecf97e){_0x5726e8[_0x0f53('0x32')][_0x0f53('0x33')](_0x46fc22[_0xecf97e]);});}delete _0x5726e8['TagIds'];}catch(_0xf7f3fc){_0xaffb99(_0xf7f3fc);}_0x2be602(_0x5726e8);});}function updateOpenchannelInteraction(_0x40697a,_0x2de1e0,_0xcdaa32){return new BPromise(function(_0x31b1d9,_0x4e74d3){return getInteractionUsers(_0x40697a,_0xcdaa32)[_0x0f53('0x28')](function(_0x229a45){return getInteractionTags(_0x229a45,_0x2de1e0);})[_0x0f53('0x28')](function(_0x1da4c5){_0x31b1d9(_0x1da4c5);})[_0x0f53('0x34')](function(_0x1b101e){_0x4e74d3(_0x1b101e);});});}exports[_0x0f53('0x35')]=function(_0x241c32,_0x50bd49){var _0xd246e1={},_0x7e683f={},_0x4e0bb1={'count':0x0,'rows':[]};var _0x20eeec=_[_0x0f53('0x36')](db[_0x0f53('0x37')][_0x0f53('0x38')],function(_0x1dd682){return{'name':_0x1dd682[_0x0f53('0x39')],'type':_0x1dd682[_0x0f53('0x3a')]['key']};});_0x7e683f[_0x0f53('0x3b')]=_[_0x0f53('0x36')](_0x20eeec,_0x0f53('0x2c'));_0x7e683f[_0x0f53('0x3c')]=_[_0x0f53('0x3d')](_0x241c32[_0x0f53('0x3c')]);_0x7e683f['filters']=_['intersection'](_0x7e683f['model'],_0x7e683f[_0x0f53('0x3c')]);_0xd246e1[_0x0f53('0x3e')]=_[_0x0f53('0x3f')](_0x7e683f[_0x0f53('0x3b')],qs[_0x0f53('0x40')](_0x241c32['query'][_0x0f53('0x40')]));_0xd246e1[_0x0f53('0x3e')]=_0xd246e1[_0x0f53('0x3e')][_0x0f53('0x41')]?_0xd246e1[_0x0f53('0x3e')]:_0x7e683f['model'];if(!_0x241c32[_0x0f53('0x3c')][_0x0f53('0x42')](_0x0f53('0x43'))){_0xd246e1[_0x0f53('0x22')]=qs['limit'](_0x241c32[_0x0f53('0x3c')][_0x0f53('0x22')]);_0xd246e1[_0x0f53('0x20')]=qs[_0x0f53('0x20')](_0x241c32[_0x0f53('0x3c')][_0x0f53('0x20')]);}_0xd246e1[_0x0f53('0x44')]=qs[_0x0f53('0x45')](_0x241c32['query'][_0x0f53('0x45')]);_0xd246e1[_0x0f53('0x46')]=qs[_0x0f53('0x47')](_[_0x0f53('0x48')](_0x241c32[_0x0f53('0x3c')],_0x7e683f[_0x0f53('0x47')]),_0x20eeec);var _0x32a2d3=[];var _0x37ca22=squel[_0x0f53('0x49')]()[_0x0f53('0x4a')]('id')[_0x0f53('0x4a')](_0x0f53('0x2c'))['field']('color')[_0x0f53('0x4b')](_0x0f53('0x4c'));var _0x6039b3=squel['select']()[_0x0f53('0x4a')](_0x0f53('0x4d'))['field']('u.fullname')[_0x0f53('0x4a')]('ui.OpenchannelInteractionId')['from']('user_has_openchannel_interactions','ui')[_0x0f53('0x4e')]('users','u',_0x0f53('0x4f'));var _0x503747=squel[_0x0f53('0x49')]()[_0x0f53('0x4b')](_0x0f53('0x50'),'i')[_0x0f53('0x4e')](_0x0f53('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0f53('0x4e')](_0x0f53('0x52'),'o','o.id\x20=\x20i.UserId')[_0x0f53('0x4e')](_0x0f53('0x53'),'a',_0x0f53('0x54'))['left_join'](_0x0f53('0x55'),'me',_0x0f53('0x56'))[_0x0f53('0x4e')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x0f53('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x15c1df=squel[_0x0f53('0x57')]();var _0x1f8795=[];var _0x398afc=squel['expr']();var _0x4eada3;if(_0x241c32['query']['search']){_0x4eada3=as[_0x0f53('0x58')](_0x241c32[_0x0f53('0x3c')][_0x0f53('0x59')]);var _0x2aa3a6=_0x4eada3['sqlOperator'];for(var _0x534a9b=0x0;_0x534a9b<_0x4eada3[_0x0f53('0x5a')][_0x0f53('0x41')];_0x534a9b++){var _0x4ea85f=_0x4eada3['conditions'][_0x534a9b];var _0x412ab9='i';var _0x2ffa0a=_[_0x0f53('0x5b')](_0x20eeec,[_0x0f53('0x2c'),_0x4ea85f[_0x0f53('0x4a')]]);if(!_0x2ffa0a){switch(_0x4ea85f['field']){case _0x0f53('0x5c'):if(_0x4ea85f[_0x0f53('0x5d')]==0x1){_0x503747['having']('`'+_0x4ea85f[_0x0f53('0x4a')]+'`\x20=\x200');}else{_0x503747['having']('`'+_0x4ea85f[_0x0f53('0x4a')]+_0x0f53('0x5e'));}break;case _0x0f53('0x5f'):if(_0x4ea85f[_0x0f53('0x60')]==='$substring'){if(_0x4ea85f[_0x0f53('0x5d')][_0x0f53('0x30')]('\x20')['length']>0x1){_0x15c1df[_0x2aa3a6](_0x0f53('0x61'),qs['getFullTextValue'](_0x4ea85f[_0x0f53('0x5d')]),null);}else{var _0x3faf55='%'+_0x4ea85f[_0x0f53('0x5d')]+'%';_0x15c1df[_0x2aa3a6](_0x0f53('0x62'),_0x3faf55,_0x3faf55,_0x3faf55);}}else{_0x2ffa0a=_[_0x0f53('0x5b')](_0x20eeec,[_0x0f53('0x2c'),_0x0f53('0x63')]);_0x4ea85f[_0x0f53('0x4a')]='ContactId';_0x2b06ca=as[_0x0f53('0x64')](_0x412ab9,_0x2ffa0a[_0x0f53('0x3a')],_0x4ea85f);_0x15c1df[_0x2aa3a6](_0x2b06ca[_0x0f53('0x65')],_0x2b06ca[_0x0f53('0x5d')]['start'],_0x2b06ca[_0x0f53('0x5d')][_0x0f53('0x2a')]);}break;case'Tag':var _0x30e083=_0x4ea85f['value'][_0x0f53('0x30')](',')[_0x0f53('0x36')](function(_0x299030){return Number(_0x299030);});_0x30e083['forEach'](function(_0x35c73e){_0x398afc['or'](_0x0f53('0x66'),'%,'+_0x35c73e+',%');});_0x1f8795=_[_0x0f53('0x67')](_0x1f8795,_0x30e083);break;case _0x0f53('0x68'):if(_0x4ea85f[_0x0f53('0x60')]===_0x0f53('0x69')){_0x15c1df[_0x2aa3a6](_0x0f53('0x6a'),'%'+_0x4ea85f[_0x0f53('0x5d')]+'%',null);}else{_0x2ffa0a=_[_0x0f53('0x5b')](_0x20eeec,['name',_0x0f53('0x6b')]);_0x4ea85f[_0x0f53('0x4a')]='UserId';_0x2b06ca=as['buildExpression'](_0x412ab9,_0x2ffa0a[_0x0f53('0x3a')],_0x4ea85f);_0x15c1df[_0x2aa3a6](_0x2b06ca[_0x0f53('0x65')],_0x2b06ca['value']['start'],_0x2b06ca['value']['end']);}break;case _0x0f53('0x6c'):_0x2b06ca=as['buildExpression']('me',null,_0x4ea85f);_0x15c1df[_0x2aa3a6](_0x2b06ca[_0x0f53('0x65')],_0x2b06ca[_0x0f53('0x5d')]['start'],_0x2b06ca[_0x0f53('0x5d')][_0x0f53('0x2a')]);break;}}else{var _0x2b06ca=as['buildExpression'](_0x412ab9,_0x2ffa0a[_0x0f53('0x3a')],_0x4ea85f);_0x15c1df[_0x2aa3a6](_0x2b06ca[_0x0f53('0x65')],_0x2b06ca['value'][_0x0f53('0x6d')],_0x2b06ca['value'][_0x0f53('0x2a')]);}}}else{var _0x524963=_(_0x241c32[_0x0f53('0x3c')])[_0x0f53('0x3d')]()[_0x0f53('0x36')](function(_0x22c715){return _[_0x0f53('0x6e')](_0x20eeec,[_0x0f53('0x2c'),_0x22c715])?_0x22c715:undefined;})[_0x0f53('0x6f')]()[_0x0f53('0x5d')]();if(!_[_0x0f53('0x70')](_0x524963)){_0x524963[_0x0f53('0x31')](function(_0x14d418){if(_0x14d418===_0x0f53('0x71')){_0x503747[_0x0f53('0x46')](_0x0f53('0x72'),[]['concat'](_0x241c32['query'][_0x14d418]));}else if(_0x14d418===_0x0f53('0x73')){var _0xc28caf=JSON[_0x0f53('0x74')](_0x241c32[_0x0f53('0x3c')][_0x14d418])[_0x0f53('0x75')];var _0x5bf70a=JSON['parse'](_0x241c32[_0x0f53('0x3c')][_0x14d418])[_0x0f53('0x76')];_0x503747['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc28caf,_0x5bf70a);}else{if(_0x241c32[_0x0f53('0x3c')][_0x14d418]===_0x0f53('0x77')){_0x503747[_0x0f53('0x46')]('i.'+_0x14d418+'\x20IS\x20NULL');}else{_0x503747[_0x0f53('0x46')]('i.'+_0x14d418+_0x0f53('0x78'),_0x241c32[_0x0f53('0x3c')][_0x14d418]);}}});}if(_0x241c32[_0x0f53('0x3c')][_0x0f53('0x79')]){if(_0x241c32['query'][_0x0f53('0x79')]==0x1){_0x503747[_0x0f53('0x7a')]('`unreadMessages`\x20=\x200');}else{_0x503747[_0x0f53('0x7a')](_0x0f53('0x7b'));}}if(_0x241c32[_0x0f53('0x3c')][_0x0f53('0x7c')]){_0x1f8795=_[_0x0f53('0x7d')](_0x241c32[_0x0f53('0x3c')][_0x0f53('0x7c')])?_0x241c32['query'][_0x0f53('0x7c')]:new Array(_0x241c32['query'][_0x0f53('0x7c')]);_0x1f8795[_0x0f53('0x31')](function(_0x46f256){_0x398afc['or'](_0x0f53('0x66'),'%,'+_0x46f256+',%');});}if(_0x241c32[_0x0f53('0x3c')][_0x0f53('0x7e')]){var _0x158328=_0x241c32[_0x0f53('0x3c')][_0x0f53('0x7e')][_0x0f53('0x7f')]('\x5c','\x5c\x5c')[_0x0f53('0x7f')](/'/g,'\x27\x27');if(qs[_0x0f53('0x80')](_0x158328)){_0x15c1df['or']('i.id\x20LIKE\x20?',_0x158328+'%');}else{_0x15c1df['or'](_0x0f53('0x81'),qs[_0x0f53('0x82')](_0x158328))['or'](_0x0f53('0x83'),_0x158328+'%')['or'](_0x0f53('0x84'),_0x158328+'%');}}}_0x503747[_0x0f53('0x46')](_0x15c1df);_0x503747[_0x0f53('0x85')](_0x0f53('0x86'));var _0x491a2e={'type':db['Sequelize'][_0x0f53('0x87')][_0x0f53('0x88')],'raw':!![]};var _0x4b8256=_0x503747[_0x0f53('0x89')]();_0x4b8256['field']('i.id');_0x4b8256[_0x0f53('0x4a')](_0x0f53('0x8a'),_0x0f53('0x5c'));if(_0xd246e1[_0x0f53('0x44')]){_0xd246e1[_0x0f53('0x44')][_0x0f53('0x31')](function(_0x126902){var _0x292961=_0x126902[0x0]===_0x0f53('0x8b')?_0x126902[0x0]:'i.'+_0x126902[0x0];_0x503747[_0x0f53('0x44')](_0x292961,_0x126902[0x1]===_0x0f53('0x8c')?![]:!![]);});}if(!_[_0x0f53('0x70')](_0x1f8795)){_0x503747['having'](_0x398afc);_0x4b8256[_0x0f53('0x46')]('t.id\x20IN\x20?',_0x1f8795);}BPromise[_0x0f53('0x8d')]()['then'](function(){if(!_0x4eada3){if(_0x241c32[_0x0f53('0x3c')][_0x0f53('0x71')])return;_0x4b8256[_0x0f53('0x46')](_0x0f53('0x8e'));_0x503747[_0x0f53('0x46')](_0x0f53('0x8e'));return;}if(_0x241c32['user'][_0x0f53('0x8f')]!=='agent')return;return _0x241c32[_0x0f53('0x90')][_0x0f53('0x91')]({'attributes':['id'],'raw':!![]})[_0x0f53('0x28')](function(_0x11f490){if(_[_0x0f53('0x70')](_0x11f490)){_0x4b8256['where'](_0x0f53('0x92'));_0x503747[_0x0f53('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4b8256['where']('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x11f490,'id'));_0x503747['where'](_0x0f53('0x72'),_[_0x0f53('0x36')](_0x11f490,'id'));}});})['then'](function(){if(_0x241c32[_0x0f53('0x90')]['role']===_0x0f53('0x93')&&!_0x4eada3&&!_0x241c32[_0x0f53('0x3c')][_0x0f53('0x71')])return[];return db[_0x0f53('0x94')][_0x0f53('0x3c')](_0x4b8256[_0x0f53('0x95')](),_0x491a2e);})[_0x0f53('0x28')](function(_0x4434c2){_0x4e0bb1[_0x0f53('0x23')]=_0x4434c2['length'];if(_0x4e0bb1[_0x0f53('0x23')]===0x0)return[];return db[_0x0f53('0x94')][_0x0f53('0x3c')](_0x37ca22[_0x0f53('0x95')](),_0x491a2e)[_0x0f53('0x28')](function(_0x3977bb){_0x32a2d3=_[_0x0f53('0x96')](_0x3977bb,'id');_0x491a2e=_[_0x0f53('0x97')](_0x491a2e,{'model':db[_0x0f53('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x241c32[_0x0f53('0x3c')][_0x0f53('0x40')]){_0xd246e1[_0x0f53('0x3e')][_0x0f53('0x31')](function(_0x59b121){_0x503747[_0x0f53('0x4a')]('i.'+_0x59b121);});}else{_0x503747[_0x0f53('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0f53('0x5c'));_0x503747[_0x0f53('0x4a')](_0x0f53('0x98'),_0x0f53('0x99'));_0x503747[_0x0f53('0x4a')](_0x0f53('0x9a'),_0x0f53('0x9b'));_0x503747['field'](_0x0f53('0x9c'),_0x0f53('0x8b'));_0x503747[_0x0f53('0x4a')](_0x0f53('0x9d'));_0x503747['field'](_0x0f53('0x9e'),_0x0f53('0x9f'));_0x503747['field'](_0x0f53('0xa0'),'Contact.lastName');_0x503747[_0x0f53('0x4a')]('c.email',_0x0f53('0xa1'));_0x503747[_0x0f53('0x4a')](_0x0f53('0xa2'),_0x0f53('0xa3'));_0x503747[_0x0f53('0x4a')]('c.mobile',_0x0f53('0xa4'));_0x503747[_0x0f53('0x4a')](_0x0f53('0xa5'),'Contact.fax');_0x503747[_0x0f53('0x4a')](_0x0f53('0xa6'),_0x0f53('0xa7'));_0x503747[_0x0f53('0x4a')](_0x0f53('0xa8'),_0x0f53('0xa9'));_0x503747[_0x0f53('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0f53('0x2f'));}if(_0xd246e1['limit'])_0x503747[_0x0f53('0x22')](_0xd246e1['limit']);if(_0xd246e1[_0x0f53('0x20')])_0x503747[_0x0f53('0x20')](_0xd246e1[_0x0f53('0x20')]);return db['sequelize'][_0x0f53('0x3c')](_0x503747[_0x0f53('0x95')](),_0x491a2e);})[_0x0f53('0x28')](function(_0x5a89b8){if(_0x5a89b8[_0x0f53('0x41')]>0x0)_0x6039b3[_0x0f53('0x46')](_0x0f53('0xaa'),_['map'](_0x5a89b8,'id'));return db[_0x0f53('0x94')][_0x0f53('0x3c')](_0x6039b3['toString'](),_0x491a2e)['then'](function(_0x2a5664){var _0x179d6c=_['groupBy'](_0x2a5664,_0x0f53('0xab'));var _0x2c3c31=[];_0x5a89b8[_0x0f53('0x31')](function(_0x21bdd6){_0x2c3c31[_0x0f53('0x33')](updateOpenchannelInteraction(_0x21bdd6,_0x32a2d3,_0x179d6c));});return BPromise[_0x0f53('0xac')](_0x2c3c31);});});})['then'](function(_0x1af037){_0x4e0bb1['rows']=_0x1af037;return _0x4e0bb1;})[_0x0f53('0x28')](respondWithFilteredResult(_0x50bd49,_0xd246e1))[_0x0f53('0x34')](handleError(_0x50bd49,null));};exports[_0x0f53('0xad')]=function(_0x5373ff,_0x2dbcd4){var _0x228ae9={};if(_0x5373ff['query'][_0x0f53('0x3a')]&&_0x5373ff[_0x0f53('0x3c')]['type']===_0x0f53('0x4b')){_0x228ae9[_0x0f53('0x4b')]=_0x5373ff['params']['id'];}else{_0x228ae9['id']=_0x5373ff[_0x0f53('0xae')]['id'];}var _0x95fdd={'raw':![],'where':_0x228ae9},_0x11c1ac={};_0x11c1ac['model']=_[_0x0f53('0x3d')](db[_0x0f53('0x37')]['rawAttributes']);_0x11c1ac[_0x0f53('0x3c')]=_[_0x0f53('0x3d')](_0x5373ff[_0x0f53('0x3c')]);_0x11c1ac[_0x0f53('0x47')]=_[_0x0f53('0x3f')](_0x11c1ac[_0x0f53('0x3b')],_0x11c1ac[_0x0f53('0x3c')]);_0x95fdd['attributes']=_[_0x0f53('0x3f')](_0x11c1ac[_0x0f53('0x3b')],qs[_0x0f53('0x40')](_0x5373ff[_0x0f53('0x3c')][_0x0f53('0x40')]));_0x95fdd[_0x0f53('0x3e')]=_0x95fdd[_0x0f53('0x3e')][_0x0f53('0x41')]?_0x95fdd[_0x0f53('0x3e')]:_0x11c1ac[_0x0f53('0x3b')];if(_0x5373ff[_0x0f53('0x3c')][_0x0f53('0xaf')]){_0x95fdd[_0x0f53('0xb0')]=[{'all':!![]}];}_0x95fdd=_['merge']({},_0x95fdd,_0x5373ff['options']);return db[_0x0f53('0x37')][_0x0f53('0x5b')](_0x95fdd)[_0x0f53('0x28')](handleEntityNotFound(_0x2dbcd4,null))[_0x0f53('0x28')](respondWithResult(_0x2dbcd4,null))['catch'](handleError(_0x2dbcd4,null));};exports[_0x0f53('0xb1')]=function(_0x5cad34,_0x5a38f1){return db[_0x0f53('0x37')][_0x0f53('0xb1')](_0x5cad34[_0x0f53('0x6c')],{})[_0x0f53('0x28')](respondWithResult(_0x5a38f1,0xc9))[_0x0f53('0x34')](handleError(_0x5a38f1,null));};exports[_0x0f53('0x27')]=function(_0x25deb0,_0x119d52){if(_0x25deb0[_0x0f53('0x6c')]['id']){delete _0x25deb0[_0x0f53('0x6c')]['id'];}return db[_0x0f53('0x37')]['find']({'where':{'id':_0x25deb0[_0x0f53('0xae')]['id']}})[_0x0f53('0x28')](handleEntityNotFound(_0x119d52,null))['then'](saveUpdates(_0x25deb0[_0x0f53('0x6c')],null))[_0x0f53('0x28')](respondWithResult(_0x119d52,null))[_0x0f53('0x34')](handleError(_0x119d52,null));};exports['destroy']=function(_0x281fc9,_0x333201){return db[_0x0f53('0x37')]['find']({'where':{'id':_0x281fc9[_0x0f53('0xae')]['id']}})[_0x0f53('0x28')](handleEntityNotFound(_0x333201,null))[_0x0f53('0x28')](removeEntity(_0x333201,null))[_0x0f53('0x34')](handleError(_0x333201,null));};exports[_0x0f53('0xb2')]=function(_0x220706,_0x3b278e){return db[_0x0f53('0x37')]['describe']()['then'](respondWithResult(_0x3b278e,null))[_0x0f53('0x34')](handleError(_0x3b278e,null));};exports['addMessage']=function(_0x564590,_0x1f251e,_0x2ada13){return db[_0x0f53('0xb3')][_0x0f53('0x5b')]({'where':{'id':_0x564590[_0x0f53('0xae')]['id']}})[_0x0f53('0x28')](handleEntityNotFound(_0x1f251e,null))[_0x0f53('0x28')](function(_0x4917d3){if(_0x4917d3){return _0x4917d3['addMessage'](_0x564590[_0x0f53('0x6c')]['ids'],_['omit'](_0x564590[_0x0f53('0x6c')],[_0x0f53('0xb4'),'id'])||{});}})[_0x0f53('0x28')](respondWithResult(_0x1f251e,null))[_0x0f53('0x34')](handleError(_0x1f251e,null));};exports[_0x0f53('0xb5')]=function(_0x314453,_0x507263,_0x4bb713){var _0x28ef6d={'raw':![],'where':{}};var _0x2b051e={};var _0x552453={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x314453[_0x0f53('0xae')]['id']}})[_0x0f53('0x28')](handleEntityNotFound(_0x507263,null))[_0x0f53('0x28')](function(_0x4ee95f){if(_0x4ee95f){_0x2b051e['model']=_['keys'](db[_0x0f53('0xb3')][_0x0f53('0x38')]);_0x2b051e[_0x0f53('0x3c')]=_[_0x0f53('0x3d')](_0x314453['query']);_0x2b051e[_0x0f53('0x47')]=_[_0x0f53('0x3f')](_0x2b051e[_0x0f53('0x3b')],_0x2b051e['query']);_0x28ef6d['attributes']=_[_0x0f53('0x3f')](_0x2b051e[_0x0f53('0x3b')],qs[_0x0f53('0x40')](_0x314453[_0x0f53('0x3c')][_0x0f53('0x40')]));_0x28ef6d[_0x0f53('0x3e')]=_0x28ef6d['attributes'][_0x0f53('0x41')]?_0x28ef6d[_0x0f53('0x3e')]:_0x2b051e[_0x0f53('0x3b')];if(!_0x314453[_0x0f53('0x3c')][_0x0f53('0x42')](_0x0f53('0x43'))){_0x28ef6d['limit']=qs[_0x0f53('0x22')](_0x314453[_0x0f53('0x3c')][_0x0f53('0x22')]);_0x28ef6d[_0x0f53('0x20')]=qs[_0x0f53('0x20')](_0x314453['query'][_0x0f53('0x20')]);}_0x28ef6d[_0x0f53('0x44')]=qs[_0x0f53('0x45')](_0x314453[_0x0f53('0x3c')][_0x0f53('0x45')]);_0x28ef6d['where']=qs[_0x0f53('0x47')](_[_0x0f53('0x48')](_0x314453['query'],_0x2b051e[_0x0f53('0x47')]));_0x28ef6d[_0x0f53('0x46')]['OpenchannelInteractionId']=_0x4ee95f['id'];if(_0x314453[_0x0f53('0x3c')][_0x0f53('0x7e')]){_0x28ef6d[_0x0f53('0x46')]=_['merge'](_0x28ef6d[_0x0f53('0x46')],{'$or':_[_0x0f53('0x36')](_0x28ef6d[_0x0f53('0x3e')],function(_0x397f75){var _0xe4a3d7={};_0xe4a3d7[_0x397f75]={'$like':'%'+_0x314453[_0x0f53('0x3c')][_0x0f53('0x7e')]+'%'};return _0xe4a3d7;})});}if(_0x314453[_0x0f53('0x3c')][_0x0f53('0x75')]){var _0x2cb335=_0x314453[_0x0f53('0x3c')][_0x0f53('0x75')]['split'](',');var _0x12ee0b={};_0x12ee0b[_0x2cb335[0x0]]={'$gte':moment(_0x2cb335[0x1])[_0x0f53('0xb6')](_0x0f53('0xb7'))};_0x28ef6d['where']=_[_0x0f53('0x97')](_0x28ef6d['where'],_0x12ee0b);}_0x28ef6d=_[_0x0f53('0x97')]({},_0x28ef6d,_0x314453[_0x0f53('0xb8')]);return db['OpenchannelMessage'][_0x0f53('0x23')]({'where':_0x28ef6d[_0x0f53('0x46')]})[_0x0f53('0x28')](function(_0x1411ee){_0x552453[_0x0f53('0x23')]=_0x1411ee;if(_0x314453[_0x0f53('0x3c')][_0x0f53('0xaf')]){_0x28ef6d[_0x0f53('0xb0')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x0f53('0xb9')](_0x28ef6d);})['then'](function(_0x42c60b){_0x552453[_0x0f53('0xba')]=_0x42c60b;return _0x552453;});}})['then'](respondWithFilteredResult(_0x507263,_0x28ef6d))['catch'](handleError(_0x507263,null));};exports['addTags']=function(_0x35d3d7,_0x616edc,_0x9c67b8){return db[_0x0f53('0x37')][_0x0f53('0x5b')]({'where':{'id':_0x35d3d7[_0x0f53('0xae')]['id']}})[_0x0f53('0x28')](handleEntityNotFound(_0x616edc,null))[_0x0f53('0x28')](function(_0x122bba){if(_0x122bba){return _0x122bba[_0x0f53('0xbb')](_0x35d3d7['body'][_0x0f53('0xb4')],_[_0x0f53('0xbc')](_0x35d3d7[_0x0f53('0x6c')],[_0x0f53('0xb4'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0f53('0x2c'),_0x0f53('0xbd')],'where':{'id':_0x35d3d7[_0x0f53('0x6c')][_0x0f53('0xb4')]}});})[_0x0f53('0x28')](function(_0x2cd635){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x35d3d7[_0x0f53('0xae')]['id']),'tags':_0x2cd635||[]});return{'id':Number(_0x35d3d7['params']['id']),'tags':_0x2cd635||[]};});}})[_0x0f53('0x28')](respondWithResult(_0x616edc,null))[_0x0f53('0x34')](handleError(_0x616edc,null));};exports['removeTags']=function(_0x5ba501,_0x5a1a32,_0xd72c41){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5ba501[_0x0f53('0xae')]['id']}})['then'](handleEntityNotFound(_0x5a1a32,null))[_0x0f53('0x28')](function(_0x4d8d7b){if(_0x4d8d7b){return _0x4d8d7b['removeTags'](_0x5ba501['query'][_0x0f53('0xb4')]);}})[_0x0f53('0x28')](respondWithStatusCode(_0x5a1a32,null))[_0x0f53('0x34')](handleError(_0x5a1a32,null));};exports['download']=function(_0x512c5a,_0x4ddb42){var _0x414612=moment()[_0x0f53('0xbe')]()[_0x0f53('0x95')]();var _0x13c3c2=path['join'](config['root'],_0x0f53('0xbf'),_0x0f53('0xc0'),_0x0f53('0xc1'));var _0x2d79d2=path[_0x0f53('0xc2')](config[_0x0f53('0xc3')],_0x0f53('0xbf'),_0x0f53('0xc0'),'attachments');var _0x5ddca6=path[_0x0f53('0xc2')](_0x13c3c2,_0x414612);var _0x3a8243=util[_0x0f53('0xb6')](_0x0f53('0xc4'),_0x512c5a[_0x0f53('0xae')]['id'],_0x414612);var _0x2b9e23=path['join'](_0x13c3c2,_0x3a8243);var _0x39fa89=[];_0x39fa89[_0x0f53('0x33')]({'model':db[_0x0f53('0x68')],'as':'User','attributes':['id',_0x0f53('0x2e')],'raw':!![]});_0x39fa89[_0x0f53('0x33')]({'model':db[_0x0f53('0xc5')],'as':_0x0f53('0x5f'),'attributes':['id',_0x0f53('0xc6'),_0x0f53('0xc7')],'raw':!![]});if(_0x512c5a[_0x0f53('0x3c')][_0x0f53('0xc8')]){_0x39fa89[_0x0f53('0x33')]({'model':db[_0x0f53('0xc9')],'as':_0x0f53('0xc9'),'raw':!![]});}var _0x1f4df1=[{'model':db[_0x0f53('0xb3')],'as':_0x0f53('0xca'),'attributes':['id',_0x0f53('0x6c'),'createdAt','direction',_0x0f53('0xcb'),_0x0f53('0x79')],'include':_0x39fa89}];_0x1f4df1[_0x0f53('0x33')]({'model':db[_0x0f53('0xcc')],'as':'Account','attributes':['id',_0x0f53('0x2c')]});_0x1f4df1[_0x0f53('0x33')]({'model':db[_0x0f53('0x68')],'as':_0x0f53('0xcd'),'attributes':['id','fullname']});return db[_0x0f53('0x37')][_0x0f53('0x5b')]({'where':{'id':_0x512c5a['params']['id']},'include':_0x1f4df1})[_0x0f53('0x28')](handleEntityNotFound(_0x4ddb42,null))[_0x0f53('0x28')](function(_0x531a80){if(_0x531a80){var _0x250736=_0x531a80[_0x0f53('0xce')]({'plain':!![]});fs[_0x0f53('0xcf')](_0x5ddca6);var _0x3134fd={'channel':_0x0f53('0xd0'),'account':_0x250736[_0x0f53('0xd1')]['name'],'agent':_0x250736[_0x0f53('0xcd')]?_0x250736[_0x0f53('0xcd')][_0x0f53('0x2e')]:_0x0f53('0xd2'),'createdAt':moment(_0x250736['createdAt'])[_0x0f53('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0f53('0x95')](),'closedAt':_0x250736[_0x0f53('0xd3')]?moment(_0x250736[_0x0f53('0xd4')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x0f53('0x95')]():'','disposition':_0x250736[_0x0f53('0xd5')],'visibility':_0x250736[_0x0f53('0xd6')]?_0x0f53('0xd7'):_0x0f53('0xd8'),'messages':_(_0x250736[_0x0f53('0xca')])[_0x0f53('0x7e')]({'secret':![]})[_0x0f53('0x36')](function(_0x25fc02){if(_0x25fc02[_0x0f53('0xc9')]){var _0x46c56a=path[_0x0f53('0xc2')](_0x2d79d2,_0x25fc02[_0x0f53('0xc9')][_0x0f53('0xd9')]);if(fs[_0x0f53('0xda')](_0x46c56a)){fs['createReadStream'](_0x46c56a)[_0x0f53('0xdb')](fs[_0x0f53('0xdc')](path[_0x0f53('0xc2')](_0x5ddca6,_0x25fc02[_0x0f53('0xc9')]['basename'])));}}return{'date':moment(_0x25fc02[_0x0f53('0x73')])[_0x0f53('0xb6')](_0x0f53('0xb7'))['toString'](),'sender':_0x25fc02[_0x0f53('0xdd')]===_0x0f53('0xde')?_0x25fc02[_0x0f53('0x68')]?_0x25fc02[_0x0f53('0x68')][_0x0f53('0x2e')]:'System':_0x25fc02[_0x0f53('0x5f')][_0x0f53('0xc6')]+(_0x25fc02[_0x0f53('0x5f')][_0x0f53('0xc7')]?'\x20'+_0x25fc02[_0x0f53('0x5f')][_0x0f53('0xc7')]:''),'body':_0x25fc02[_0x0f53('0xc9')]?_0x25fc02[_0x0f53('0xc9')][_0x0f53('0xd9')]:_0x25fc02[_0x0f53('0x6c')],'direction':_0x25fc02[_0x0f53('0xdd')]==='out'?'A':'C','secret':_0x25fc02[_0x0f53('0xcb')],'read':_0x25fc02[_0x0f53('0x79')],'attachment':_0x25fc02[_0x0f53('0xc9')]};})[_0x0f53('0x5d')]()};return ejs[_0x0f53('0xdf')](path['join'](config[_0x0f53('0xc3')],_0x0f53('0xbf'),_0x0f53('0xe0'),_0x0f53('0xe1')),{'interaction':_0x3134fd})[_0x0f53('0x28')](function(_0x24faee){var _0x1c6f2d=path[_0x0f53('0xc2')](_0x5ddca6,_0x0f53('0xe2')+_0x250736['id']+'-'+_0x414612+_0x0f53('0xe3'));var _0x302b93={'path':_0x1c6f2d,'channel':_0x0f53('0xd0'),'interactionId':_0x250736['id']};return pdf[_0x0f53('0xe4')](_0x24faee,_0x302b93);})[_0x0f53('0x28')](function(){return new BPromise(function(_0x1a384c,_0x10e05f){zipdir(_0x5ddca6,{'saveTo':_0x2b9e23},function(_0x1dfac5,_0x182f30){if(_0x1dfac5)return _0x10e05f(_0x1dfac5);return _0x1a384c(_0x182f30);});})['then'](function(){return new BPromise(function(_0x283ea3,_0x29fa1d){rimraf(_0x5ddca6,function(_0x263122){if(_0x263122)_0x29fa1d(_0x263122);return _0x283ea3();});});})[_0x0f53('0x28')](function(){return _0x4ddb42[_0x0f53('0xe5')](_0x2b9e23,_0x3a8243,function(_0x3a51f9){if(_0x3a51f9){console[_0x0f53('0xe6')](_0x0f53('0xe7'),_0x3a51f9);}else{fs[_0x0f53('0xe8')](_0x2b9e23);}});});});}else{return _0x4ddb42[_0x0f53('0x1d')](0xc8);}})[_0x0f53('0x34')](handleError(_0x4ddb42,null));}; \ No newline at end of file +var _0x0c1d=['closed','closedAt','format','Public','Private','basename','existsSync','createReadStream','out','Contact','renderFile','root','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','conditions','find','having','operator','value','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','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','keys','some','compact','isEmpty','concat','parse','$gte','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)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','Tag','emit','openchannelInteractionTags:save','removeTags','join','files','server','attachments','User','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','Owner','get','mkdirSync','Openchannel','createdAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c1d,0x101));var _0xd0c1=function(_0x1f31cc,_0x37fcf6){_0x1f31cc=_0x1f31cc-0x0;var _0x298fa0=_0x0c1d[_0x1f31cc];return _0x298fa0;};'use strict';var emlformat=require(_0xd0c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0c1('0x1'));var jsonpatch=require(_0xd0c1('0x2'));var rp=require(_0xd0c1('0x3'));var moment=require(_0xd0c1('0x4'));var BPromise=require(_0xd0c1('0x5'));var Mustache=require(_0xd0c1('0x6'));var util=require('util');var path=require(_0xd0c1('0x7'));var sox=require('sox');var csv=require(_0xd0c1('0x8'));var ejs=require(_0xd0c1('0x9'));var fs=require('fs');var fs_extra=require(_0xd0c1('0xa'));var _=require(_0xd0c1('0xb'));var squel=require('squel');var crypto=require(_0xd0c1('0xc'));var jsforce=require(_0xd0c1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd0c1('0xe'));var Papa=require(_0xd0c1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd0c1('0x10'));var as=require(_0xd0c1('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xd0c1('0x12'));var logger=require(_0xd0c1('0x13'))(_0xd0c1('0x14'));var utils=require(_0xd0c1('0x15'));var config=require(_0xd0c1('0x16'));var licenseUtil=require(_0xd0c1('0x17'));var db=require(_0xd0c1('0x18'))['db'];config['redis']=_[_0xd0c1('0x19')](config[_0xd0c1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0c1('0x1b'))(new Redis(config[_0xd0c1('0x1a')]));require(_0xd0c1('0x1c'))[_0xd0c1('0x1d')](socket);function respondWithStatusCode(_0x5ae29d,_0x2415e1){_0x2415e1=_0x2415e1||0xcc;return function(_0x303734){if(_0x303734){return _0x5ae29d[_0xd0c1('0x1e')](_0x2415e1);}return _0x5ae29d[_0xd0c1('0x1f')](_0x2415e1)[_0xd0c1('0x20')]();};}function respondWithResult(_0x5a4af7,_0xec44f){_0xec44f=_0xec44f||0xc8;return function(_0x1a64c1){if(_0x1a64c1){return _0x5a4af7[_0xd0c1('0x1f')](_0xec44f)[_0xd0c1('0x21')](_0x1a64c1);}};}function respondWithFilteredResult(_0x2c3a71,_0x325198){return function(_0x49c797){if(_0x49c797){var _0x304fab=typeof _0x325198[_0xd0c1('0x22')]==='undefined'&&typeof _0x325198[_0xd0c1('0x23')]===_0xd0c1('0x24');var _0x544f66=_0x49c797[_0xd0c1('0x25')];var _0x16ea1f=_0x304fab?0x0:_0x325198[_0xd0c1('0x22')];var _0x3aef39=_0x304fab?_0x49c797[_0xd0c1('0x25')]:_0x325198[_0xd0c1('0x22')]+_0x325198[_0xd0c1('0x23')];var _0x374dd4;if(_0x3aef39>=_0x544f66){_0x3aef39=_0x544f66;_0x374dd4=0xc8;}else{_0x374dd4=0xce;}_0x2c3a71[_0xd0c1('0x1f')](_0x374dd4);return _0x2c3a71[_0xd0c1('0x26')]('Content-Range',_0x16ea1f+'-'+_0x3aef39+'/'+_0x544f66)[_0xd0c1('0x21')](_0x49c797);}return null;};}function patchUpdates(_0x3819fa){return function(_0x41cfe1){try{jsonpatch['apply'](_0x41cfe1,_0x3819fa,!![]);}catch(_0xfe9727){return BPromise['reject'](_0xfe9727);}return _0x41cfe1[_0xd0c1('0x27')]();};}function saveUpdates(_0x1fc274,_0x449e2a){return function(_0x3d93f3){if(_0x3d93f3){return _0x3d93f3[_0xd0c1('0x28')](_0x1fc274)[_0xd0c1('0x29')](function(_0x29752d){return _0x29752d;});}return null;};}function removeEntity(_0x3e55b4,_0x461389){return function(_0x425e9a){if(_0x425e9a){return _0x425e9a[_0xd0c1('0x2a')]()[_0xd0c1('0x29')](function(){_0x3e55b4[_0xd0c1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296785,_0x521e21){return function(_0x2f1c0c){if(!_0x2f1c0c){_0x296785['sendStatus'](0x194);}return _0x2f1c0c;};}function handleError(_0x4c8aa1,_0x3010fd){_0x3010fd=_0x3010fd||0x1f4;return function(_0x2c9e9a){logger[_0xd0c1('0x2b')](_0x2c9e9a[_0xd0c1('0x2c')]);if(_0x2c9e9a[_0xd0c1('0x2d')]){delete _0x2c9e9a[_0xd0c1('0x2d')];}_0x4c8aa1[_0xd0c1('0x1f')](_0x3010fd)[_0xd0c1('0x2e')](_0x2c9e9a);};}function getInteractionUsers(_0xc63f5f,_0x456fa0){return new BPromise(function(_0x130ec0,_0x4074bd){try{if(_0x456fa0[_0xc63f5f['id']]){_0xc63f5f[_0xd0c1('0x2f')]=_[_0xd0c1('0x30')](_0x456fa0[_0xc63f5f['id']],function(_0x453b7b){return{'id':_0x453b7b['id'],'fullname':_0x453b7b['fullname']};});}}catch(_0x3ac618){_0x4074bd(_0x3ac618);}_0x130ec0(_0xc63f5f);});}function getInteractionTags(_0x30abd6,_0x34418b){return new BPromise(function(_0x3a67aa,_0x3b90f2){try{if(_0x30abd6[_0xd0c1('0x31')]){_0x30abd6[_0xd0c1('0x32')]=[];_0x30abd6[_0xd0c1('0x31')][_0xd0c1('0x33')](',')[_0xd0c1('0x34')](function(_0x57421f){_0x30abd6[_0xd0c1('0x32')][_0xd0c1('0x35')](_0x34418b[_0x57421f]);});}delete _0x30abd6[_0xd0c1('0x31')];}catch(_0x4d3f74){_0x3b90f2(_0x4d3f74);}_0x3a67aa(_0x30abd6);});}function updateOpenchannelInteraction(_0x908a8b,_0x1cbd3a,_0xc9d196){return new BPromise(function(_0x208920,_0x557df8){return getInteractionUsers(_0x908a8b,_0xc9d196)[_0xd0c1('0x29')](function(_0x32743b){return getInteractionTags(_0x32743b,_0x1cbd3a);})[_0xd0c1('0x29')](function(_0x301f4c){_0x208920(_0x301f4c);})[_0xd0c1('0x36')](function(_0x505013){_0x557df8(_0x505013);});});}exports[_0xd0c1('0x37')]=function(_0x44b6bf,_0xe72a28){var _0x3922c0={},_0x294dd0={},_0x404454={'count':0x0,'rows':[]};var _0x38f4cd=_[_0xd0c1('0x30')](db['OpenchannelInteraction'][_0xd0c1('0x38')],function(_0x2eeb08){return{'name':_0x2eeb08[_0xd0c1('0x39')],'type':_0x2eeb08[_0xd0c1('0x3a')][_0xd0c1('0x3b')]};});_0x294dd0['model']=_[_0xd0c1('0x30')](_0x38f4cd,_0xd0c1('0x2d'));_0x294dd0[_0xd0c1('0x3c')]=_['keys'](_0x44b6bf[_0xd0c1('0x3c')]);_0x294dd0['filters']=_[_0xd0c1('0x3d')](_0x294dd0[_0xd0c1('0x3e')],_0x294dd0[_0xd0c1('0x3c')]);_0x3922c0[_0xd0c1('0x3f')]=_[_0xd0c1('0x3d')](_0x294dd0[_0xd0c1('0x3e')],qs[_0xd0c1('0x40')](_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x40')]));_0x3922c0[_0xd0c1('0x3f')]=_0x3922c0[_0xd0c1('0x3f')]['length']?_0x3922c0['attributes']:_0x294dd0['model'];if(!_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x41')](_0xd0c1('0x42'))){_0x3922c0[_0xd0c1('0x23')]=qs['limit'](_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x23')]);_0x3922c0[_0xd0c1('0x22')]=qs['offset'](_0x44b6bf['query'][_0xd0c1('0x22')]);}_0x3922c0[_0xd0c1('0x43')]=qs[_0xd0c1('0x44')](_0x44b6bf['query'][_0xd0c1('0x44')]);_0x3922c0[_0xd0c1('0x45')]=qs[_0xd0c1('0x46')](_[_0xd0c1('0x47')](_0x44b6bf[_0xd0c1('0x3c')],_0x294dd0[_0xd0c1('0x46')]),_0x38f4cd);var _0x21ece4=[];var _0x3d13e6=squel['select']()['field']('id')[_0xd0c1('0x48')]('name')[_0xd0c1('0x48')](_0xd0c1('0x49'))[_0xd0c1('0x4a')](_0xd0c1('0x4b'));var _0x4545a5=squel[_0xd0c1('0x4c')]()[_0xd0c1('0x48')]('u.id')[_0xd0c1('0x48')]('u.fullname')[_0xd0c1('0x48')](_0xd0c1('0x4d'))[_0xd0c1('0x4a')]('user_has_openchannel_interactions','ui')[_0xd0c1('0x4e')](_0xd0c1('0x4f'),'u',_0xd0c1('0x50'));var _0x12b609=squel[_0xd0c1('0x4c')]()[_0xd0c1('0x4a')](_0xd0c1('0x51'),'i')[_0xd0c1('0x4e')](_0xd0c1('0x52'),'c',_0xd0c1('0x53'))[_0xd0c1('0x4e')](_0xd0c1('0x4f'),'o',_0xd0c1('0x54'))[_0xd0c1('0x4e')](_0xd0c1('0x55'),'a',_0xd0c1('0x56'))[_0xd0c1('0x4e')](_0xd0c1('0x57'),'me',_0xd0c1('0x58'))[_0xd0c1('0x4e')](_0xd0c1('0x59'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xd0c1('0x4e')](_0xd0c1('0x4b'),'t',_0xd0c1('0x5a'));var _0x3be620=squel['expr']();var _0x49bf73=[];var _0x3aac7f=squel[_0xd0c1('0x5b')]();var _0x5ef343;if(_0x44b6bf[_0xd0c1('0x3c')]['search']){_0x5ef343=as['parseSearch'](_0x44b6bf['query'][_0xd0c1('0x5c')]);var _0x588eb6=_0x5ef343[_0xd0c1('0x5d')];for(var _0xd0adc6=0x0;_0xd0adc6<_0x5ef343['conditions'][_0xd0c1('0x5e')];_0xd0adc6++){var _0x5445f7=_0x5ef343[_0xd0c1('0x5f')][_0xd0adc6];var _0x19ac7e='i';var _0x241579=_[_0xd0c1('0x60')](_0x38f4cd,['name',_0x5445f7[_0xd0c1('0x48')]]);if(!_0x241579){switch(_0x5445f7[_0xd0c1('0x48')]){case'unreadMessages':if(_0x5445f7['value']==0x1){_0x12b609[_0xd0c1('0x61')]('`'+_0x5445f7[_0xd0c1('0x48')]+'`\x20=\x200');}else{_0x12b609[_0xd0c1('0x61')]('`'+_0x5445f7[_0xd0c1('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x5445f7[_0xd0c1('0x62')]==='$substring'){if(_0x5445f7[_0xd0c1('0x63')]['split']('\x20')[_0xd0c1('0x5e')]>0x1){_0x3be620[_0x588eb6](_0xd0c1('0x64'),qs[_0xd0c1('0x65')](_0x5445f7[_0xd0c1('0x63')]),null);}else{var _0x2424b7='%'+_0x5445f7[_0xd0c1('0x63')]+'%';_0x3be620[_0x588eb6](_0xd0c1('0x66'),_0x2424b7,_0x2424b7,_0x2424b7);}}else{_0x241579=_['find'](_0x38f4cd,['name',_0xd0c1('0x67')]);_0x5445f7[_0xd0c1('0x48')]=_0xd0c1('0x67');_0x1e0b50=as['buildExpression'](_0x19ac7e,_0x241579['type'],_0x5445f7);_0x3be620[_0x588eb6](_0x1e0b50[_0xd0c1('0x68')],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x69')],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x20')]);}break;case'Tag':var _0x5caf75=_0x5445f7[_0xd0c1('0x63')][_0xd0c1('0x33')](',')[_0xd0c1('0x30')](function(_0x366071){return Number(_0x366071);});_0x5caf75[_0xd0c1('0x34')](function(_0x2c1e8a){_0x3aac7f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c1e8a+',%');});_0x49bf73=_[_0xd0c1('0x6a')](_0x49bf73,_0x5caf75);break;case'User':if(_0x5445f7[_0xd0c1('0x62')]===_0xd0c1('0x6b')){_0x3be620[_0x588eb6](_0xd0c1('0x6c'),'%'+_0x5445f7[_0xd0c1('0x63')]+'%',null);}else{_0x241579=_[_0xd0c1('0x60')](_0x38f4cd,['name',_0xd0c1('0x6d')]);_0x5445f7['field']=_0xd0c1('0x6d');_0x1e0b50=as['buildExpression'](_0x19ac7e,_0x241579['type'],_0x5445f7);_0x3be620[_0x588eb6](_0x1e0b50[_0xd0c1('0x68')],_0x1e0b50[_0xd0c1('0x63')]['start'],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x20')]);}break;case _0xd0c1('0x6e'):_0x1e0b50=as[_0xd0c1('0x6f')]('me',null,_0x5445f7);_0x3be620[_0x588eb6](_0x1e0b50['text'],_0x1e0b50['value'][_0xd0c1('0x69')],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x20')]);break;}}else{var _0x1e0b50=as['buildExpression'](_0x19ac7e,_0x241579[_0xd0c1('0x3a')],_0x5445f7);_0x3be620[_0x588eb6](_0x1e0b50['text'],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x69')],_0x1e0b50[_0xd0c1('0x63')][_0xd0c1('0x20')]);}}}else{var _0x5eddf1=_(_0x44b6bf[_0xd0c1('0x3c')])[_0xd0c1('0x70')]()[_0xd0c1('0x30')](function(_0x9f37b7){return _[_0xd0c1('0x71')](_0x38f4cd,[_0xd0c1('0x2d'),_0x9f37b7])?_0x9f37b7:undefined;})[_0xd0c1('0x72')]()[_0xd0c1('0x63')]();if(!_[_0xd0c1('0x73')](_0x5eddf1)){_0x5eddf1['forEach'](function(_0x3a15d8){if(_0x3a15d8==='OpenchannelAccountId'){_0x12b609['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xd0c1('0x74')](_0x44b6bf[_0xd0c1('0x3c')][_0x3a15d8]));}else if(_0x3a15d8==='createdAt'){var _0x122db5=JSON[_0xd0c1('0x75')](_0x44b6bf[_0xd0c1('0x3c')][_0x3a15d8])[_0xd0c1('0x76')];var _0x4587e2=JSON[_0xd0c1('0x75')](_0x44b6bf[_0xd0c1('0x3c')][_0x3a15d8])['$lte'];_0x12b609['where'](_0xd0c1('0x77'),_0x122db5,_0x4587e2);}else{if(_0x44b6bf[_0xd0c1('0x3c')][_0x3a15d8]===_0xd0c1('0x78')){_0x12b609['where']('i.'+_0x3a15d8+_0xd0c1('0x79'));}else{_0x12b609['where']('i.'+_0x3a15d8+_0xd0c1('0x7a'),_0x44b6bf[_0xd0c1('0x3c')][_0x3a15d8]);}}});}if(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x7b')]){if(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x7b')]==0x1){_0x12b609[_0xd0c1('0x61')](_0xd0c1('0x7c'));}else{_0x12b609[_0xd0c1('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x44b6bf['query'][_0xd0c1('0x7d')]){_0x49bf73=_[_0xd0c1('0x7e')](_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x7d')])?_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x7d')]:new Array(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x7d')]);_0x49bf73[_0xd0c1('0x34')](function(_0x1a83b7){_0x3aac7f['or'](_0xd0c1('0x7f'),'%,'+_0x1a83b7+',%');});}if(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x80')]){var _0x2ed738=_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x80')][_0xd0c1('0x81')]('\x5c','\x5c\x5c')[_0xd0c1('0x81')](/'/g,'\x27\x27');if(qs[_0xd0c1('0x82')](_0x2ed738)){_0x3be620['or'](_0xd0c1('0x83'),_0x2ed738+'%');}else{_0x3be620['or'](_0xd0c1('0x84'),qs[_0xd0c1('0x65')](_0x2ed738))['or'](_0xd0c1('0x85'),_0x2ed738+'%')['or'](_0xd0c1('0x86'),_0x2ed738+'%');}}}_0x12b609[_0xd0c1('0x45')](_0x3be620);_0x12b609[_0xd0c1('0x87')](_0xd0c1('0x88'));var _0x400656={'type':db[_0xd0c1('0x89')][_0xd0c1('0x8a')][_0xd0c1('0x8b')],'raw':!![]};var _0x57535c=_0x12b609['clone']();_0x57535c[_0xd0c1('0x48')](_0xd0c1('0x88'));_0x57535c[_0xd0c1('0x48')](_0xd0c1('0x8c'),_0xd0c1('0x8d'));if(_0x3922c0[_0xd0c1('0x43')]){_0x3922c0['order'][_0xd0c1('0x34')](function(_0x3b1b64){var _0x49d2af=_0x3b1b64[0x0]==='contactName'?_0x3b1b64[0x0]:'i.'+_0x3b1b64[0x0];_0x12b609['order'](_0x49d2af,_0x3b1b64[0x1]===_0xd0c1('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x49bf73)){_0x12b609[_0xd0c1('0x61')](_0x3aac7f);_0x57535c['where'](_0xd0c1('0x8f'),_0x49bf73);}BPromise[_0xd0c1('0x90')]()['then'](function(){if(!_0x5ef343){if(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x91')])return;_0x57535c[_0xd0c1('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x12b609['where'](_0xd0c1('0x92'));return;}if(_0x44b6bf[_0xd0c1('0x93')]['role']!==_0xd0c1('0x94'))return;return _0x44b6bf[_0xd0c1('0x93')][_0xd0c1('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2ddeb0){if(_[_0xd0c1('0x73')](_0x2ddeb0)){_0x57535c[_0xd0c1('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x12b609[_0xd0c1('0x45')](_0xd0c1('0x96'));}else{_0x57535c[_0xd0c1('0x45')](_0xd0c1('0x97'),_[_0xd0c1('0x30')](_0x2ddeb0,'id'));_0x12b609[_0xd0c1('0x45')](_0xd0c1('0x97'),_[_0xd0c1('0x30')](_0x2ddeb0,'id'));}});})['then'](function(){if(_0x44b6bf['user'][_0xd0c1('0x98')]==='agent'&&!_0x5ef343&&!_0x44b6bf['query'][_0xd0c1('0x91')])return[];return db[_0xd0c1('0x99')][_0xd0c1('0x3c')](_0x57535c[_0xd0c1('0x9a')](),_0x400656);})[_0xd0c1('0x29')](function(_0x3d1717){_0x404454['count']=_0x3d1717[_0xd0c1('0x5e')];if(_0x404454[_0xd0c1('0x25')]===0x0)return[];return db[_0xd0c1('0x99')][_0xd0c1('0x3c')](_0x3d13e6[_0xd0c1('0x9a')](),_0x400656)[_0xd0c1('0x29')](function(_0x1c7ad6){_0x21ece4=_[_0xd0c1('0x9b')](_0x1c7ad6,'id');_0x400656=_[_0xd0c1('0x9c')](_0x400656,{'model':db[_0xd0c1('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44b6bf[_0xd0c1('0x3c')][_0xd0c1('0x40')]){_0x3922c0[_0xd0c1('0x3f')][_0xd0c1('0x34')](function(_0x4f74cd){_0x12b609[_0xd0c1('0x48')]('i.'+_0x4f74cd);});}else{_0x12b609['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd0c1('0x8d'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0x9e'),_0xd0c1('0x9f'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xa0'),_0xd0c1('0xa1'));_0x12b609[_0xd0c1('0x48')]('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',_0xd0c1('0xa2'));_0x12b609['field'](_0xd0c1('0xa3'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xa4'),_0xd0c1('0xa5'));_0x12b609['field'](_0xd0c1('0xa6'),_0xd0c1('0xa7'));_0x12b609['field'](_0xd0c1('0xa8'),_0xd0c1('0xa9'));_0x12b609['field']('c.phone','Contact.phone');_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xaa'),_0xd0c1('0xab'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xac'),'Contact.fax');_0x12b609['field']('o.fullname',_0xd0c1('0xad'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xae'),_0xd0c1('0xaf'));_0x12b609[_0xd0c1('0x48')](_0xd0c1('0xb0'),_0xd0c1('0x31'));}if(_0x3922c0[_0xd0c1('0x23')])_0x12b609[_0xd0c1('0x23')](_0x3922c0[_0xd0c1('0x23')]);if(_0x3922c0['offset'])_0x12b609[_0xd0c1('0x22')](_0x3922c0[_0xd0c1('0x22')]);return db[_0xd0c1('0x99')][_0xd0c1('0x3c')](_0x12b609[_0xd0c1('0x9a')](),_0x400656);})[_0xd0c1('0x29')](function(_0x2cae87){if(_0x2cae87[_0xd0c1('0x5e')]>0x0)_0x4545a5[_0xd0c1('0x45')](_0xd0c1('0xb1'),_['map'](_0x2cae87,'id'));return db['sequelize'][_0xd0c1('0x3c')](_0x4545a5[_0xd0c1('0x9a')](),_0x400656)['then'](function(_0x1211c3){var _0x1efd76=_[_0xd0c1('0xb2')](_0x1211c3,_0xd0c1('0xb3'));var _0x460e99=[];_0x2cae87[_0xd0c1('0x34')](function(_0x32c9c7){_0x460e99[_0xd0c1('0x35')](updateOpenchannelInteraction(_0x32c9c7,_0x21ece4,_0x1efd76));});return BPromise[_0xd0c1('0xb4')](_0x460e99);});});})[_0xd0c1('0x29')](function(_0x3aac49){_0x404454['rows']=_0x3aac49;return _0x404454;})['then'](respondWithFilteredResult(_0xe72a28,_0x3922c0))[_0xd0c1('0x36')](handleError(_0xe72a28,null));};exports['show']=function(_0x2e8833,_0x3e4e75){var _0x33e943={};if(_0x2e8833['query'][_0xd0c1('0x3a')]&&_0x2e8833['query'][_0xd0c1('0x3a')]===_0xd0c1('0x4a')){_0x33e943[_0xd0c1('0x4a')]=_0x2e8833[_0xd0c1('0xb5')]['id'];}else{_0x33e943['id']=_0x2e8833[_0xd0c1('0xb5')]['id'];}var _0x3b8875={'raw':![],'where':_0x33e943},_0x4488b1={};_0x4488b1[_0xd0c1('0x3e')]=_[_0xd0c1('0x70')](db['OpenchannelInteraction'][_0xd0c1('0x38')]);_0x4488b1[_0xd0c1('0x3c')]=_['keys'](_0x2e8833['query']);_0x4488b1['filters']=_['intersection'](_0x4488b1['model'],_0x4488b1[_0xd0c1('0x3c')]);_0x3b8875[_0xd0c1('0x3f')]=_[_0xd0c1('0x3d')](_0x4488b1[_0xd0c1('0x3e')],qs['fields'](_0x2e8833['query'][_0xd0c1('0x40')]));_0x3b8875['attributes']=_0x3b8875[_0xd0c1('0x3f')][_0xd0c1('0x5e')]?_0x3b8875[_0xd0c1('0x3f')]:_0x4488b1[_0xd0c1('0x3e')];if(_0x2e8833[_0xd0c1('0x3c')][_0xd0c1('0xb6')]){_0x3b8875[_0xd0c1('0xb7')]=[{'all':!![]}];}_0x3b8875=_[_0xd0c1('0x9c')]({},_0x3b8875,_0x2e8833[_0xd0c1('0xb8')]);return db[_0xd0c1('0x9d')][_0xd0c1('0x60')](_0x3b8875)[_0xd0c1('0x29')](handleEntityNotFound(_0x3e4e75,null))[_0xd0c1('0x29')](respondWithResult(_0x3e4e75,null))[_0xd0c1('0x36')](handleError(_0x3e4e75,null));};exports['create']=function(_0x340b48,_0x274a67){return db[_0xd0c1('0x9d')][_0xd0c1('0xb9')](_0x340b48[_0xd0c1('0x6e')],{})[_0xd0c1('0x29')](respondWithResult(_0x274a67,0xc9))[_0xd0c1('0x36')](handleError(_0x274a67,null));};exports[_0xd0c1('0x28')]=function(_0x51dc2a,_0x105324){if(_0x51dc2a[_0xd0c1('0x6e')]['id']){delete _0x51dc2a[_0xd0c1('0x6e')]['id'];}return db['OpenchannelInteraction'][_0xd0c1('0x60')]({'where':{'id':_0x51dc2a[_0xd0c1('0xb5')]['id']}})[_0xd0c1('0x29')](handleEntityNotFound(_0x105324,null))[_0xd0c1('0x29')](saveUpdates(_0x51dc2a[_0xd0c1('0x6e')],null))['then'](respondWithResult(_0x105324,null))[_0xd0c1('0x36')](handleError(_0x105324,null));};exports[_0xd0c1('0x2a')]=function(_0x435bf8,_0x34a8ed){return db['OpenchannelInteraction'][_0xd0c1('0x60')]({'where':{'id':_0x435bf8[_0xd0c1('0xb5')]['id']}})['then'](handleEntityNotFound(_0x34a8ed,null))[_0xd0c1('0x29')](removeEntity(_0x34a8ed,null))[_0xd0c1('0x36')](handleError(_0x34a8ed,null));};exports[_0xd0c1('0xba')]=function(_0x118493,_0x568a5e){return db[_0xd0c1('0x9d')][_0xd0c1('0xba')]()[_0xd0c1('0x29')](respondWithResult(_0x568a5e,null))[_0xd0c1('0x36')](handleError(_0x568a5e,null));};exports[_0xd0c1('0xbb')]=function(_0x72927e,_0x4b77dc,_0x1ec54e){return db[_0xd0c1('0xbc')]['find']({'where':{'id':_0x72927e[_0xd0c1('0xb5')]['id']}})[_0xd0c1('0x29')](handleEntityNotFound(_0x4b77dc,null))['then'](function(_0x3a46bd){if(_0x3a46bd){return _0x3a46bd[_0xd0c1('0xbb')](_0x72927e['body'][_0xd0c1('0xbd')],_['omit'](_0x72927e['body'],[_0xd0c1('0xbd'),'id'])||{});}})[_0xd0c1('0x29')](respondWithResult(_0x4b77dc,null))[_0xd0c1('0x36')](handleError(_0x4b77dc,null));};exports[_0xd0c1('0xbe')]=function(_0x9928de,_0x131d95,_0x364590){var _0x2e504d={'raw':![],'where':{}};var _0x1c69a7={};var _0x34a095={'count':0x0,'rows':[]};return db[_0xd0c1('0x9d')][_0xd0c1('0xbf')]({'where':{'id':_0x9928de[_0xd0c1('0xb5')]['id']}})[_0xd0c1('0x29')](handleEntityNotFound(_0x131d95,null))[_0xd0c1('0x29')](function(_0xc3784c){if(_0xc3784c){_0x1c69a7['model']=_[_0xd0c1('0x70')](db[_0xd0c1('0xbc')][_0xd0c1('0x38')]);_0x1c69a7['query']=_['keys'](_0x9928de[_0xd0c1('0x3c')]);_0x1c69a7[_0xd0c1('0x46')]=_['intersection'](_0x1c69a7[_0xd0c1('0x3e')],_0x1c69a7['query']);_0x2e504d[_0xd0c1('0x3f')]=_['intersection'](_0x1c69a7[_0xd0c1('0x3e')],qs[_0xd0c1('0x40')](_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x40')]));_0x2e504d['attributes']=_0x2e504d[_0xd0c1('0x3f')][_0xd0c1('0x5e')]?_0x2e504d['attributes']:_0x1c69a7[_0xd0c1('0x3e')];if(!_0x9928de[_0xd0c1('0x3c')]['hasOwnProperty']('nolimit')){_0x2e504d[_0xd0c1('0x23')]=qs['limit'](_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x23')]);_0x2e504d[_0xd0c1('0x22')]=qs[_0xd0c1('0x22')](_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x22')]);}_0x2e504d[_0xd0c1('0x43')]=qs[_0xd0c1('0x44')](_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x44')]);_0x2e504d[_0xd0c1('0x45')]=qs['filters'](_[_0xd0c1('0x47')](_0x9928de[_0xd0c1('0x3c')],_0x1c69a7[_0xd0c1('0x46')]));_0x2e504d[_0xd0c1('0x45')]['OpenchannelInteractionId']=_0xc3784c['id'];if(_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x80')]){_0x2e504d['where']=_[_0xd0c1('0x9c')](_0x2e504d[_0xd0c1('0x45')],{'$or':_[_0xd0c1('0x30')](_0x2e504d[_0xd0c1('0x3f')],function(_0xed59fe){var _0x41c606={};_0x41c606[_0xed59fe]={'$like':'%'+_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x80')]+'%'};return _0x41c606;})});}if(_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0x76')]){var _0x4012f8=_0x9928de[_0xd0c1('0x3c')]['$gte'][_0xd0c1('0x33')](',');var _0x23538d={};_0x23538d[_0x4012f8[0x0]]={'$gte':moment(_0x4012f8[0x1])['format'](_0xd0c1('0xc0'))};_0x2e504d[_0xd0c1('0x45')]=_[_0xd0c1('0x9c')](_0x2e504d['where'],_0x23538d);}_0x2e504d=_[_0xd0c1('0x9c')]({},_0x2e504d,_0x9928de[_0xd0c1('0xb8')]);return db['OpenchannelMessage']['count']({'where':_0x2e504d[_0xd0c1('0x45')]})['then'](function(_0x35d6a0){_0x34a095[_0xd0c1('0x25')]=_0x35d6a0;if(_0x9928de[_0xd0c1('0x3c')][_0xd0c1('0xb6')]){_0x2e504d[_0xd0c1('0xb7')]=[{'all':!![]}];}return db[_0xd0c1('0xbc')][_0xd0c1('0xc1')](_0x2e504d);})[_0xd0c1('0x29')](function(_0x427ef2){_0x34a095['rows']=_0x427ef2;return _0x34a095;});}})[_0xd0c1('0x29')](respondWithFilteredResult(_0x131d95,_0x2e504d))[_0xd0c1('0x36')](handleError(_0x131d95,null));};exports[_0xd0c1('0xc2')]=function(_0x3706b9,_0x1ff026,_0x32c85f){return db[_0xd0c1('0x9d')][_0xd0c1('0x60')]({'where':{'id':_0x3706b9[_0xd0c1('0xb5')]['id']}})[_0xd0c1('0x29')](handleEntityNotFound(_0x1ff026,null))[_0xd0c1('0x29')](function(_0x270c88){if(_0x270c88){return _0x270c88[_0xd0c1('0xc3')](_0x3706b9[_0xd0c1('0x6e')][_0xd0c1('0xbd')],_[_0xd0c1('0xc4')](_0x3706b9[_0xd0c1('0x6e')],[_0xd0c1('0xbd'),'id'])||{})['spread'](function(){return db[_0xd0c1('0xc5')][_0xd0c1('0xc1')]({'attributes':['id','name',_0xd0c1('0x49')],'where':{'id':_0x3706b9[_0xd0c1('0x6e')][_0xd0c1('0xbd')]}});})[_0xd0c1('0x29')](function(_0x420561){socket[_0xd0c1('0xc6')](_0xd0c1('0xc7'),{'id':Number(_0x3706b9['params']['id']),'tags':_0x420561||[]});return{'id':Number(_0x3706b9[_0xd0c1('0xb5')]['id']),'tags':_0x420561||[]};});}})[_0xd0c1('0x29')](respondWithResult(_0x1ff026,null))[_0xd0c1('0x36')](handleError(_0x1ff026,null));};exports[_0xd0c1('0xc8')]=function(_0x29e98f,_0x37e568,_0x5835f4){return db[_0xd0c1('0x9d')][_0xd0c1('0x60')]({'where':{'id':_0x29e98f[_0xd0c1('0xb5')]['id']}})['then'](handleEntityNotFound(_0x37e568,null))[_0xd0c1('0x29')](function(_0x49c5d5){if(_0x49c5d5){return _0x49c5d5[_0xd0c1('0xc8')](_0x29e98f[_0xd0c1('0x3c')][_0xd0c1('0xbd')]);}})[_0xd0c1('0x29')](respondWithStatusCode(_0x37e568,null))[_0xd0c1('0x36')](handleError(_0x37e568,null));};exports['download']=function(_0x123cab,_0x187169){var _0x292aa5=moment()['unix']()[_0xd0c1('0x9a')]();var _0x490734=path[_0xd0c1('0xc9')](config['root'],'server',_0xd0c1('0xca'),'tmp');var _0x2aa20b=path['join'](config['root'],_0xd0c1('0xcb'),_0xd0c1('0xca'),_0xd0c1('0xcc'));var _0x397fa7=path[_0xd0c1('0xc9')](_0x490734,_0x292aa5);var _0x2797f4=util['format']('transcript-%d-%s.zip',_0x123cab[_0xd0c1('0xb5')]['id'],_0x292aa5);var _0x205e60=path[_0xd0c1('0xc9')](_0x490734,_0x2797f4);var _0x41f255=[];_0x41f255[_0xd0c1('0x35')]({'model':db[_0xd0c1('0xcd')],'as':_0xd0c1('0xcd'),'attributes':['id',_0xd0c1('0xce')],'raw':!![]});_0x41f255[_0xd0c1('0x35')]({'model':db[_0xd0c1('0xcf')],'as':'Contact','attributes':['id',_0xd0c1('0xd0'),_0xd0c1('0xd1')],'raw':!![]});if(_0x123cab[_0xd0c1('0x3c')][_0xd0c1('0xcc')]){_0x41f255[_0xd0c1('0x35')]({'model':db['Attachment'],'as':_0xd0c1('0xd2'),'raw':!![]});}var _0x24665f=[{'model':db['OpenchannelMessage'],'as':_0xd0c1('0xd3'),'attributes':['id',_0xd0c1('0x6e'),'createdAt',_0xd0c1('0xd4'),_0xd0c1('0xd5'),_0xd0c1('0x7b')],'include':_0x41f255}];_0x24665f[_0xd0c1('0x35')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xd0c1('0x2d')]});_0x24665f[_0xd0c1('0x35')]({'model':db[_0xd0c1('0xcd')],'as':_0xd0c1('0xd6'),'attributes':['id',_0xd0c1('0xce')]});return db[_0xd0c1('0x9d')]['find']({'where':{'id':_0x123cab['params']['id']},'include':_0x24665f})[_0xd0c1('0x29')](handleEntityNotFound(_0x187169,null))['then'](function(_0x184735){if(_0x184735){var _0x1d8ff6=_0x184735[_0xd0c1('0xd7')]({'plain':!![]});fs[_0xd0c1('0xd8')](_0x397fa7);var _0xf18fd={'channel':_0xd0c1('0xd9'),'account':_0x1d8ff6['Account'][_0xd0c1('0x2d')],'agent':_0x1d8ff6[_0xd0c1('0xd6')]?_0x1d8ff6['Owner'][_0xd0c1('0xce')]:'N.A.','createdAt':moment(_0x1d8ff6[_0xd0c1('0xda')])['format'](_0xd0c1('0xc0'))[_0xd0c1('0x9a')](),'closedAt':_0x1d8ff6[_0xd0c1('0xdb')]?moment(_0x1d8ff6[_0xd0c1('0xdc')])[_0xd0c1('0xdd')](_0xd0c1('0xc0'))[_0xd0c1('0x9a')]():'','disposition':_0x1d8ff6['disposition'],'visibility':_0x1d8ff6['threadId']?_0xd0c1('0xde'):_0xd0c1('0xdf'),'messages':_(_0x1d8ff6[_0xd0c1('0xd3')])['filter']({'secret':![]})[_0xd0c1('0x30')](function(_0x1d44b7){if(_0x1d44b7['Attachment']){var _0x475628=path[_0xd0c1('0xc9')](_0x2aa20b,_0x1d44b7[_0xd0c1('0xd2')][_0xd0c1('0xe0')]);if(fs[_0xd0c1('0xe1')](_0x475628)){fs[_0xd0c1('0xe2')](_0x475628)['pipe'](fs['createWriteStream'](path[_0xd0c1('0xc9')](_0x397fa7,_0x1d44b7['Attachment'][_0xd0c1('0xe0')])));}}return{'date':moment(_0x1d44b7[_0xd0c1('0xda')])['format'](_0xd0c1('0xc0'))[_0xd0c1('0x9a')](),'sender':_0x1d44b7[_0xd0c1('0xd4')]===_0xd0c1('0xe3')?_0x1d44b7[_0xd0c1('0xcd')]?_0x1d44b7[_0xd0c1('0xcd')][_0xd0c1('0xce')]:'System':_0x1d44b7[_0xd0c1('0xe4')][_0xd0c1('0xd0')]+(_0x1d44b7['Contact'][_0xd0c1('0xd1')]?'\x20'+_0x1d44b7[_0xd0c1('0xe4')]['lastName']:''),'body':_0x1d44b7['Attachment']?_0x1d44b7[_0xd0c1('0xd2')]['basename']:_0x1d44b7[_0xd0c1('0x6e')],'direction':_0x1d44b7[_0xd0c1('0xd4')]==='out'?'A':'C','secret':_0x1d44b7[_0xd0c1('0xd5')],'read':_0x1d44b7['read'],'attachment':_0x1d44b7[_0xd0c1('0xd2')]};})[_0xd0c1('0x63')]()};return ejs[_0xd0c1('0xe5')](path[_0xd0c1('0xc9')](config[_0xd0c1('0xe6')],'server','views',_0xd0c1('0xe7')),{'interaction':_0xf18fd})[_0xd0c1('0x29')](function(_0x5e52e5){var _0x476c1d=path[_0xd0c1('0xc9')](_0x397fa7,_0xd0c1('0xe8')+_0x1d8ff6['id']+'-'+_0x292aa5+'.pdf');var _0x45517e={'path':_0x476c1d,'channel':_0xd0c1('0xd9'),'interactionId':_0x1d8ff6['id']};return pdf[_0xd0c1('0xe9')](_0x5e52e5,_0x45517e);})[_0xd0c1('0x29')](function(){return new BPromise(function(_0xbc4cbe,_0x4b8a89){zipdir(_0x397fa7,{'saveTo':_0x205e60},function(_0x186177,_0x1debe4){if(_0x186177)return _0x4b8a89(_0x186177);return _0xbc4cbe(_0x1debe4);});})[_0xd0c1('0x29')](function(){return new BPromise(function(_0x549208,_0x3753c2){rimraf(_0x397fa7,function(_0x8717b){if(_0x8717b)_0x3753c2(_0x8717b);return _0x549208();});});})['then'](function(){return _0x187169[_0xd0c1('0xea')](_0x205e60,_0x2797f4,function(_0x2b424a){if(_0x2b424a){console[_0xd0c1('0xeb')](_0xd0c1('0xec'),_0x2b424a);}else{fs[_0xd0c1('0xed')](_0x205e60);}});});});}else{return _0x187169[_0xd0c1('0x1e')](0xc8);}})[_0xd0c1('0x36')](handleError(_0x187169,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2e2186f..d3453e1 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 _0xaf98=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xaf98,0x1ce));var _0x8af9=function(_0x15bb6c,_0xf1f832){_0x15bb6c=_0x15bb6c-0x0;var _0x5157c0=_0xaf98[_0x15bb6c];return _0x5157c0;};'use strict';var EventEmitter=require(_0x8af9('0x0'));var OpenchannelInteraction=require(_0x8af9('0x1'))['db'][_0x8af9('0x2')];var OpenchannelMessage=require(_0x8af9('0x1'))['db'][_0x8af9('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8af9('0x4')](0x0);var events={'afterCreate':_0x8af9('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x120932){return function(_0x591c87,_0x3de0bb,_0x1f8471){_0x591c87[_0x8af9('0x6')]({'attributes':['id'],'raw':!![]})[_0x8af9('0x7')](function(_0xcbf13c){_0x591c87['setDataValue'](_0x8af9('0x8'),_0xcbf13c[_0x8af9('0x9')](function(_0x277b96){return{'id':_0x277b96['id']};}));return OpenchannelMessage[_0x8af9('0xa')]({'where':{'OpenchannelInteractionId':_0x591c87['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3ae6bd){_0x591c87[_0x8af9('0xb')](_0x8af9('0xc'),_0x3ae6bd[_0x8af9('0xd')]);OpenchannelInteractionEvents[_0x8af9('0xe')](_0x120932+':'+_0x591c87['id'],_0x591c87);OpenchannelInteractionEvents[_0x8af9('0xe')](_0x120932,_0x591c87);_0x1f8471(null);})['catch'](_0x1f8471(null));};}for(var e in events){if(events[_0x8af9('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x8af9('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7cbc=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','then','setDataValue','Users'];(function(_0x242741,_0xa60ed7){var _0x5bebb2=function(_0x34b21f){while(--_0x34b21f){_0x242741['push'](_0x242741['shift']());}};_0x5bebb2(++_0xa60ed7);}(_0x7cbc,0x99));var _0xc7cb=function(_0x3850b9,_0x3c4d4b){_0x3850b9=_0x3850b9-0x0;var _0x421359=_0x7cbc[_0x3850b9];return _0x421359;};'use strict';var EventEmitter=require(_0xc7cb('0x0'));var OpenchannelInteraction=require(_0xc7cb('0x1'))['db'][_0xc7cb('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xc7cb('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc7cb('0x4')](0x0);var events={'afterCreate':_0xc7cb('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x750a9b){return function(_0x2112df,_0x490da0,_0x4ee114){_0x2112df['getUsers']({'attributes':['id'],'raw':!![]})[_0xc7cb('0x6')](function(_0x38e926){_0x2112df[_0xc7cb('0x7')](_0xc7cb('0x8'),_0x38e926[_0xc7cb('0x9')](function(_0x37a114){return{'id':_0x37a114['id']};}));return OpenchannelMessage[_0xc7cb('0xa')]({'where':{'OpenchannelInteractionId':_0x2112df['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4fc0a3){_0x2112df['setDataValue'](_0xc7cb('0xb'),_0x4fc0a3[_0xc7cb('0xc')]);OpenchannelInteractionEvents[_0xc7cb('0xd')](_0x750a9b+':'+_0x2112df['id'],_0x2112df);OpenchannelInteractionEvents[_0xc7cb('0xd')](_0x750a9b,_0x2112df);_0x4ee114(null);})[_0xc7cb('0xe')](_0x4ee114(null));};}for(var e in events){if(events[_0xc7cb('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xc7cb('0x10')](e,emitEvent(event));}}module[_0xc7cb('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 9c5d4ee..ffc7eb7 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 _0x9175=['path','rimraf','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise'];(function(_0x31b88d,_0x188759){var _0x20be1f=function(_0x27edfb){while(--_0x27edfb){_0x31b88d['push'](_0x31b88d['shift']());}};_0x20be1f(++_0x188759);}(_0x9175,0x14f));var _0x5917=function(_0x3fb95f,_0x22cb7e){_0x3fb95f=_0x3fb95f-0x0;var _0x30a8bc=_0x9175[_0x3fb95f];return _0x30a8bc;};'use strict';var _=require('lodash');var util=require(_0x5917('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5917('0x1'));var BPromise=require('bluebird');var rp=require(_0x5917('0x2'));var fs=require('fs');var path=require(_0x5917('0x3'));var rimraf=require(_0x5917('0x4'));var config=require('../../config/environment');var attributes=require(_0x5917('0x5'));module[_0x5917('0x6')]=function(_0x2ee53c,_0x76a2b8){return _0x2ee53c['define']('OpenchannelInteraction',attributes,{'tableName':_0x5917('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5917('0x8'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x29965a,_0x3409f5,_0x4a4e17){if(_0x29965a[_0x5917('0x9')]('closed')){_0x29965a[_0x5917('0xa')]=moment()[_0x5917('0xb')](_0x5917('0xc'));}_0x4a4e17(null,_0x29965a);}}});}; \ No newline at end of file +var _0xf780=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x29b024,_0x4a8ed8){var _0x434c4b=function(_0x5510ca){while(--_0x5510ca){_0x29b024['push'](_0x29b024['shift']());}};_0x434c4b(++_0x4a8ed8);}(_0xf780,0x17f));var _0x0f78=function(_0x2d7902,_0x5827ff){_0x2d7902=_0x2d7902-0x0;var _0x22595e=_0xf780[_0x2d7902];return _0x22595e;};'use strict';var _=require(_0x0f78('0x0'));var util=require('util');var logger=require(_0x0f78('0x1'))(_0x0f78('0x2'));var moment=require('moment');var BPromise=require(_0x0f78('0x3'));var rp=require(_0x0f78('0x4'));var fs=require('fs');var path=require(_0x0f78('0x5'));var rimraf=require(_0x0f78('0x6'));var config=require(_0x0f78('0x7'));var attributes=require(_0x0f78('0x8'));module[_0x0f78('0x9')]=function(_0x351cce,_0x5d3047){return _0x351cce[_0x0f78('0xa')](_0x0f78('0xb'),attributes,{'tableName':_0x0f78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f78('0xd'),'collate':_0x0f78('0xe'),'hooks':{'beforeUpdate':function(_0x279635,_0x4b398b,_0x14e96a){if(_0x279635[_0x0f78('0xf')](_0x0f78('0x10'))){_0x279635[_0x0f78('0x11')]=moment()[_0x0f78('0x12')](_0x0f78('0x13'));}_0x14e96a(null,_0x279635);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index dd2786a..b112adf 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 _0x7cce=['register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','find','omit','ids','stringify','catch','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x11efc5,_0x23b34b){var _0x4caa0a=function(_0x2f40b9){while(--_0x2f40b9){_0x11efc5['push'](_0x11efc5['shift']());}};_0x4caa0a(++_0x23b34b);}(_0x7cce,0x18a));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7cc('0x0'));var util=require(_0xe7cc('0x1'));var moment=require(_0xe7cc('0x2'));var BPromise=require(_0xe7cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7cc('0x4'));var db=require(_0xe7cc('0x5'))['db'];var utils=require(_0xe7cc('0x6'));var logger=require(_0xe7cc('0x7'))(_0xe7cc('0x8'));var config=require(_0xe7cc('0x9'));var jayson=require(_0xe7cc('0xa'));var client=jayson[_0xe7cc('0xb')]['http']({'port':0x232a});config[_0xe7cc('0xc')]=_[_0xe7cc('0xd')](config[_0xe7cc('0xc')],{'host':_0xe7cc('0xe'),'port':0x18eb});var socket=require(_0xe7cc('0xf'))(new Redis(config[_0xe7cc('0xc')]));require('./openchannelInteraction.socket')[_0xe7cc('0x10')](socket);function respondWithRpcPromise(_0x3b0f19,_0x13c234,_0x30019b){return new BPromise(function(_0x53d92f,_0x4b5423){return client[_0xe7cc('0x11')](_0x3b0f19,_0x30019b)[_0xe7cc('0x12')](function(_0x1bf686){logger['info'](_0xe7cc('0x13'),_0x13c234,'request\x20sent');logger[_0xe7cc('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x13c234,_0xe7cc('0x15'),JSON['stringify'](_0x1bf686));if(_0x1bf686['error']){if(_0x1bf686['error'][_0xe7cc('0x16')]===0x1f4){logger[_0xe7cc('0x17')](_0xe7cc('0x13'),_0x13c234,_0x1bf686[_0xe7cc('0x17')][_0xe7cc('0x18')]);return _0x4b5423(_0x1bf686[_0xe7cc('0x17')][_0xe7cc('0x18')]);}logger[_0xe7cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x13c234,_0x1bf686[_0xe7cc('0x17')][_0xe7cc('0x18')]);return _0x53d92f(_0x1bf686[_0xe7cc('0x17')][_0xe7cc('0x18')]);}else{logger[_0xe7cc('0x19')](_0xe7cc('0x13'),_0x13c234,_0xe7cc('0x15'));_0x53d92f(_0x1bf686['result'][_0xe7cc('0x18')]);}})['catch'](function(_0x1fe491){logger[_0xe7cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x13c234,_0x1fe491);_0x4b5423(_0x1fe491);});});}exports[_0xe7cc('0x1a')]=function(_0x3dca3f){var _0xe1e9c9=this;return new Promise(function(_0x33886f,_0x2271bc){return db[_0xe7cc('0x1b')][_0xe7cc('0x1c')](_0x3dca3f[_0xe7cc('0x1d')],{'raw':_0x3dca3f[_0xe7cc('0x1e')]?_0x3dca3f[_0xe7cc('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dca3f[_0xe7cc('0x1e')]?_0x3dca3f[_0xe7cc('0x1e')][_0xe7cc('0x1f')]||null:null,'attributes':_0x3dca3f[_0xe7cc('0x1e')]?_0x3dca3f[_0xe7cc('0x1e')][_0xe7cc('0x20')]||null:null,'limit':_0x3dca3f[_0xe7cc('0x1e')]?_0x3dca3f[_0xe7cc('0x1e')][_0xe7cc('0x21')]||null:null})['then'](function(_0x1994ac){logger[_0xe7cc('0x19')]('UpdateOpenchannelInteraction',_0x3dca3f);logger[_0xe7cc('0x14')](_0xe7cc('0x1a'),_0x3dca3f,JSON['stringify'](_0x1994ac));_0x33886f(_0x1994ac);})['catch'](function(_0x408c07){logger[_0xe7cc('0x17')](_0xe7cc('0x1a'),_0x408c07[_0xe7cc('0x18')],_0x3dca3f);_0x2271bc(_0xe1e9c9[_0xe7cc('0x17')](0x1f4,_0x408c07[_0xe7cc('0x18')]));});});};exports[_0xe7cc('0x22')]=function(_0x1ed160){return new Promise(function(_0x33133f,_0x48da4b){return db[_0xe7cc('0x1b')][_0xe7cc('0x23')]({'where':_0x1ed160[_0xe7cc('0x1e')]?_0x1ed160[_0xe7cc('0x1e')][_0xe7cc('0x1f')]||null:null})['then'](function(_0x3fe14b){if(_0x3fe14b){return _0x3fe14b['addTags'](_0x1ed160[_0xe7cc('0x1d')]['ids'],_[_0xe7cc('0x24')](_0x1ed160['body'],[_0xe7cc('0x25'),'id'])||{});}})['spread'](function(_0x42b893){logger[_0xe7cc('0x19')]('AddTags',_0x1ed160);logger[_0xe7cc('0x14')]('AddTags',_0x1ed160,JSON[_0xe7cc('0x26')](_0x42b893));_0x33133f(_0x42b893);})[_0xe7cc('0x27')](function(_0x4897c9){logger['error'](_0xe7cc('0x28'),_0x4897c9[_0xe7cc('0x18')],_0x1ed160);_0x48da4b(_this['error'](0x1f4,_0x4897c9[_0xe7cc('0x18')]));});});}; \ No newline at end of file +var _0x1b33=['message','result','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4e3692,_0x1d845b){var _0x2b1f61=function(_0x2507c7){while(--_0x2507c7){_0x4e3692['push'](_0x4e3692['shift']());}};_0x2b1f61(++_0x1d845b);}(_0x1b33,0x1b6));var _0x31b3=function(_0x5533b9,_0x4e4fda){_0x5533b9=_0x5533b9-0x0;var _0x3f0335=_0x1b33[_0x5533b9];return _0x3f0335;};'use strict';var _=require(_0x31b3('0x0'));var util=require(_0x31b3('0x1'));var moment=require(_0x31b3('0x2'));var BPromise=require(_0x31b3('0x3'));var rs=require(_0x31b3('0x4'));var fs=require('fs');var Redis=require(_0x31b3('0x5'));var db=require(_0x31b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b3('0x7'))(_0x31b3('0x8'));var config=require(_0x31b3('0x9'));var jayson=require(_0x31b3('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x31b3('0xb')]=_[_0x31b3('0xc')](config[_0x31b3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x31b3('0xd'))(new Redis(config['redis']));require(_0x31b3('0xe'))[_0x31b3('0xf')](socket);function respondWithRpcPromise(_0x8a0845,_0x4b945d,_0x5c63d8){return new BPromise(function(_0x5aad02,_0x389e0a){return client[_0x31b3('0x10')](_0x8a0845,_0x5c63d8)[_0x31b3('0x11')](function(_0x579d4f){logger[_0x31b3('0x12')](_0x31b3('0x13'),_0x4b945d,_0x31b3('0x14'));logger[_0x31b3('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x4b945d,_0x31b3('0x14'),JSON[_0x31b3('0x16')](_0x579d4f));if(_0x579d4f['error']){if(_0x579d4f[_0x31b3('0x17')]['code']===0x1f4){logger[_0x31b3('0x17')](_0x31b3('0x13'),_0x4b945d,_0x579d4f[_0x31b3('0x17')][_0x31b3('0x18')]);return _0x389e0a(_0x579d4f[_0x31b3('0x17')]['message']);}logger[_0x31b3('0x17')](_0x31b3('0x13'),_0x4b945d,_0x579d4f[_0x31b3('0x17')][_0x31b3('0x18')]);return _0x5aad02(_0x579d4f['error'][_0x31b3('0x18')]);}else{logger[_0x31b3('0x12')](_0x31b3('0x13'),_0x4b945d,_0x31b3('0x14'));_0x5aad02(_0x579d4f[_0x31b3('0x19')][_0x31b3('0x18')]);}})[_0x31b3('0x1a')](function(_0x11ab6d){logger[_0x31b3('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4b945d,_0x11ab6d);_0x389e0a(_0x11ab6d);});});}exports['UpdateOpenchannelInteraction']=function(_0x2461b6){var _0x3c8f2f=this;return new Promise(function(_0x1dda4b,_0x18b525){return db[_0x31b3('0x1b')][_0x31b3('0x1c')](_0x2461b6[_0x31b3('0x1d')],{'raw':_0x2461b6[_0x31b3('0x1e')]?_0x2461b6[_0x31b3('0x1e')][_0x31b3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2461b6['options']?_0x2461b6[_0x31b3('0x1e')][_0x31b3('0x20')]||null:null,'attributes':_0x2461b6[_0x31b3('0x1e')]?_0x2461b6['options'][_0x31b3('0x21')]||null:null,'limit':_0x2461b6[_0x31b3('0x1e')]?_0x2461b6[_0x31b3('0x1e')]['limit']||null:null})[_0x31b3('0x11')](function(_0x5b860e){logger[_0x31b3('0x12')](_0x31b3('0x22'),_0x2461b6);logger[_0x31b3('0x15')](_0x31b3('0x22'),_0x2461b6,JSON['stringify'](_0x5b860e));_0x1dda4b(_0x5b860e);})[_0x31b3('0x1a')](function(_0x43dd5e){logger[_0x31b3('0x17')](_0x31b3('0x22'),_0x43dd5e[_0x31b3('0x18')],_0x2461b6);_0x18b525(_0x3c8f2f[_0x31b3('0x17')](0x1f4,_0x43dd5e[_0x31b3('0x18')]));});});};exports[_0x31b3('0x23')]=function(_0x2fd2e4){return new Promise(function(_0x4f4b0f,_0x3d3567){return db['OpenchannelInteraction'][_0x31b3('0x24')]({'where':_0x2fd2e4[_0x31b3('0x1e')]?_0x2fd2e4[_0x31b3('0x1e')][_0x31b3('0x20')]||null:null})[_0x31b3('0x11')](function(_0x5a048a){if(_0x5a048a){return _0x5a048a[_0x31b3('0x25')](_0x2fd2e4['body']['ids'],_[_0x31b3('0x26')](_0x2fd2e4[_0x31b3('0x1d')],[_0x31b3('0x27'),'id'])||{});}})[_0x31b3('0x28')](function(_0x1513eb){logger[_0x31b3('0x12')](_0x31b3('0x29'),_0x2fd2e4);logger[_0x31b3('0x15')](_0x31b3('0x29'),_0x2fd2e4,JSON[_0x31b3('0x16')](_0x1513eb));_0x4f4b0f(_0x1513eb);})['catch'](function(_0x2abba8){logger[_0x31b3('0x17')](_0x31b3('0x29'),_0x2abba8[_0x31b3('0x18')],_0x2fd2e4);_0x3d3567(_this[_0x31b3('0x17')](0x1f4,_0x2abba8[_0x31b3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 1a4a89b..780d44a 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 _0x1a26=['update','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5b6d96,_0x5cc396){var _0x454410=function(_0x37827e){while(--_0x37827e){_0x5b6d96['push'](_0x5b6d96['shift']());}};_0x454410(++_0x5cc396);}(_0x1a26,0xa5));var _0x61a2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1a26[_0x13d07a];return _0x5ee0ee;};'use strict';var OpenchannelInteractionEvents=require(_0x61a2('0x0'));var events=[_0x61a2('0x1'),_0x61a2('0x2'),_0x61a2('0x3')];function createListener(_0x3140f9,_0x580ba5){return function(_0x1fec00){_0x580ba5['emit'](_0x3140f9,_0x1fec00);};}function removeListener(_0x30aac3,_0x391ff4){return function(){OpenchannelInteractionEvents['removeListener'](_0x30aac3,_0x391ff4);};}exports[_0x61a2('0x4')]=function(_0x537855){for(var _0x486e10=0x0,_0x4f5c5a=events[_0x61a2('0x5')];_0x486e10<_0x4f5c5a;_0x486e10++){var _0x3a1b80=events[_0x486e10];var _0x361da9=createListener(_0x61a2('0x6')+_0x3a1b80,_0x537855);OpenchannelInteractionEvents['on'](_0x3a1b80,_0x361da9);}}; \ No newline at end of file +var _0x973f=['remove','update','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x29115e,_0x14ffb0){var _0x5b7a77=function(_0x14a3bd){while(--_0x14a3bd){_0x29115e['push'](_0x29115e['shift']());}};_0x5b7a77(++_0x14ffb0);}(_0x973f,0x117));var _0xf973=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x973f[_0x1b2ff7];return _0x31656a;};'use strict';var OpenchannelInteractionEvents=require(_0xf973('0x0'));var events=['save',_0xf973('0x1'),_0xf973('0x2')];function createListener(_0x43d925,_0x5f5a65){return function(_0x30056a){_0x5f5a65[_0xf973('0x3')](_0x43d925,_0x30056a);};}function removeListener(_0x3cd084,_0x2154c5){return function(){OpenchannelInteractionEvents[_0xf973('0x4')](_0x3cd084,_0x2154c5);};}exports[_0xf973('0x5')]=function(_0x350a29){for(var _0xc848cd=0x0,_0x234b60=events[_0xf973('0x6')];_0xc848cd<_0x234b60;_0xc848cd++){var _0x18403f=events[_0xc848cd];var _0x131210=createListener('openchannelInteraction:'+_0x18403f,_0x350a29);OpenchannelInteractionEvents['on'](_0x18403f,_0x131210);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 2561f3b..730b7e6 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5ed769,_0x2e56f2){_0x5ed769=_0x5ed769-0x0;var _0x39fe7d=_0x70e0[_0x5ed769];return _0x39fe7d;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x3fcd6f,_0x35a695){var _0x27e163=function(_0x4b3281){while(--_0x4b3281){_0x3fcd6f['push'](_0x3fcd6f['shift']());}};_0x27e163(++_0x35a695);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a498a,_0x5e47f8){_0x3a498a=_0x3a498a-0x0;var _0x7943c4=_0xedd9[_0x3a498a];return _0x7943c4;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 34a554f..17f6f02 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 _0xd8b0=['exports','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_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')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0d8b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0d8b('0x3')]('in',_0x0d8b('0x4')),'defaultValue':_0x0d8b('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0d8b('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x19e1=['out','DATE','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19e1,0x163));var _0x119e=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x19e1[_0x725a4c];return _0x37b2cc;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'body':{'type':Sequelize[_0x119e('0x2')](_0x119e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x119e('0x4')]('in',_0x119e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x119e('0x6')]},'providerName':{'type':Sequelize[_0x119e('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 18a108f..1595da1 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 _0x67b1=['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','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','name','send','index','map','OpenchannelMessage','fieldName','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','length','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','read','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','EventManager','acceptmessage','null','RejectMessage','interface','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x11272b,_0x2a4616){var _0x1edd7d=function(_0x5cb68d){while(--_0x5cb68d){_0x11272b['push'](_0x11272b['shift']());}};_0x1edd7d(++_0x2a4616);}(_0x67b1,0xfd));var _0x167b=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x67b1[_0x46ec32];return _0x338f60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x167b('0x0'));var zipdir=require(_0x167b('0x1'));var jsonpatch=require(_0x167b('0x2'));var rp=require(_0x167b('0x3'));var moment=require('moment');var BPromise=require(_0x167b('0x4'));var Mustache=require(_0x167b('0x5'));var util=require(_0x167b('0x6'));var path=require(_0x167b('0x7'));var sox=require(_0x167b('0x8'));var csv=require(_0x167b('0x9'));var ejs=require(_0x167b('0xa'));var fs=require('fs');var fs_extra=require(_0x167b('0xb'));var _=require(_0x167b('0xc'));var squel=require(_0x167b('0xd'));var crypto=require(_0x167b('0xe'));var jsforce=require(_0x167b('0xf'));var deskjs=require(_0x167b('0x10'));var toCsv=require(_0x167b('0x9'));var querystring=require(_0x167b('0x11'));var Papa=require(_0x167b('0x12'));var Redis=require(_0x167b('0x13'));var authService=require(_0x167b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x167b('0x15'));var hardwareService=require(_0x167b('0x16'));var logger=require(_0x167b('0x17'))(_0x167b('0x18'));var utils=require(_0x167b('0x19'));var config=require(_0x167b('0x1a'));var licenseUtil=require(_0x167b('0x1b'));var db=require('../../mysqldb')['db'];config[_0x167b('0x1c')]=_[_0x167b('0x1d')](config[_0x167b('0x1c')],{'host':_0x167b('0x1e'),'port':0x18eb});var socket=require(_0x167b('0x1f'))(new Redis(config[_0x167b('0x1c')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x167b('0x20'));var client=jayson[_0x167b('0x21')][_0x167b('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e8710,_0x21ed38,_0x1ee15e,_0xb40970){return new BPromise(function(_0x3003b0,_0x615a0f){var _0x3652dc=_0xb40970||client;return _0x3652dc['request'](_0x1e8710,_0x1ee15e)[_0x167b('0x23')](function(_0x69619f){logger['info'](_0x167b('0x24'),_0x21ed38,'request\x20sent');logger[_0x167b('0x25')](_0x167b('0x26'),_0x21ed38,'request\x20sent',JSON['stringify'](_0x69619f));if(_0x69619f[_0x167b('0x27')]){if(_0x69619f[_0x167b('0x27')][_0x167b('0x28')]===0x1f4){logger[_0x167b('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x21ed38,_0x69619f['error'][_0x167b('0x29')]);return _0x615a0f(_0x69619f[_0x167b('0x27')][_0x167b('0x29')]);}logger[_0x167b('0x27')](_0x167b('0x24'),_0x21ed38,_0x69619f['error'][_0x167b('0x29')]);return _0x3003b0(_0x69619f['error']['message']);}else{logger[_0x167b('0x2a')](_0x167b('0x24'),_0x21ed38,_0x167b('0x2b'));_0x3003b0(_0x69619f[_0x167b('0x2c')][_0x167b('0x29')]);}})[_0x167b('0x2d')](function(_0x1c66c3){logger[_0x167b('0x27')](_0x167b('0x24'),_0x21ed38,_0x1c66c3);_0x615a0f(_0x1c66c3);});});}function respondWithStatusCode(_0x6c0ba2,_0x30c071){_0x30c071=_0x30c071||0xcc;return function(_0x4eacf6){if(_0x4eacf6){return _0x6c0ba2[_0x167b('0x2e')](_0x30c071);}return _0x6c0ba2[_0x167b('0x2f')](_0x30c071)[_0x167b('0x30')]();};}function respondWithResult(_0x26104b,_0x19882c){_0x19882c=_0x19882c||0xc8;return function(_0x180d91){if(_0x180d91){return _0x26104b[_0x167b('0x2f')](_0x19882c)[_0x167b('0x31')](_0x180d91);}};}function respondWithFilteredResult(_0x749b0c,_0x1e303f){return function(_0x425b15){if(_0x425b15){var _0x328ec9=typeof _0x1e303f[_0x167b('0x32')]===_0x167b('0x33')&&typeof _0x1e303f[_0x167b('0x34')]===_0x167b('0x33');var _0x5b4cfd=_0x425b15[_0x167b('0x35')];var _0x182ecc=_0x328ec9?0x0:_0x1e303f[_0x167b('0x32')];var _0x935caa=_0x328ec9?_0x425b15[_0x167b('0x35')]:_0x1e303f['offset']+_0x1e303f[_0x167b('0x34')];var _0x5e5e92;if(_0x935caa>=_0x5b4cfd){_0x935caa=_0x5b4cfd;_0x5e5e92=0xc8;}else{_0x5e5e92=0xce;}_0x749b0c[_0x167b('0x2f')](_0x5e5e92);return _0x749b0c['set'](_0x167b('0x36'),_0x182ecc+'-'+_0x935caa+'/'+_0x5b4cfd)['json'](_0x425b15);}return null;};}function patchUpdates(_0x579e98){return function(_0x40fe30){try{jsonpatch[_0x167b('0x37')](_0x40fe30,_0x579e98,!![]);}catch(_0x4c5aff){return BPromise[_0x167b('0x38')](_0x4c5aff);}return _0x40fe30[_0x167b('0x39')]();};}function saveUpdates(_0x25c6c5,_0x3cbd55){return function(_0x36b0f7){if(_0x36b0f7){return _0x36b0f7['update'](_0x25c6c5)[_0x167b('0x23')](function(_0xef3ffb){return _0xef3ffb;});}return null;};}function removeEntity(_0x29c441,_0x463d2d){return function(_0x3271af){if(_0x3271af){return _0x3271af[_0x167b('0x3a')]()[_0x167b('0x23')](function(){_0x29c441[_0x167b('0x2f')](0xcc)[_0x167b('0x30')]();});}};}function handleEntityNotFound(_0x15ac12,_0x4077b9){return function(_0x1761b7){if(!_0x1761b7){_0x15ac12[_0x167b('0x2e')](0x194);}return _0x1761b7;};}function handleError(_0x25062f,_0x1779e1){_0x1779e1=_0x1779e1||0x1f4;return function(_0x24b539){logger[_0x167b('0x27')](_0x24b539['stack']);if(_0x24b539[_0x167b('0x3b')]){delete _0x24b539[_0x167b('0x3b')];}_0x25062f[_0x167b('0x2f')](_0x1779e1)[_0x167b('0x3c')](_0x24b539);};}exports[_0x167b('0x3d')]=function(_0x5a7da3,_0x48e0ab){var _0xa9e470={},_0x5cdd5e={},_0x2e1885={'count':0x0,'rows':[]};var _0x2decec=_[_0x167b('0x3e')](db[_0x167b('0x3f')]['rawAttributes'],function(_0x3985da){return{'name':_0x3985da[_0x167b('0x40')],'type':_0x3985da[_0x167b('0x41')]['key']};});_0x5cdd5e['model']=_[_0x167b('0x3e')](_0x2decec,_0x167b('0x3b'));_0x5cdd5e['query']=_['keys'](_0x5a7da3[_0x167b('0x42')]);_0x5cdd5e['filters']=_[_0x167b('0x43')](_0x5cdd5e[_0x167b('0x44')],_0x5cdd5e['query']);_0xa9e470[_0x167b('0x45')]=_[_0x167b('0x43')](_0x5cdd5e[_0x167b('0x44')],qs[_0x167b('0x46')](_0x5a7da3[_0x167b('0x42')][_0x167b('0x46')]));_0xa9e470[_0x167b('0x45')]=_0xa9e470['attributes']['length']?_0xa9e470[_0x167b('0x45')]:_0x5cdd5e[_0x167b('0x44')];if(!_0x5a7da3['query'][_0x167b('0x47')](_0x167b('0x48'))){_0xa9e470[_0x167b('0x34')]=qs[_0x167b('0x34')](_0x5a7da3[_0x167b('0x42')][_0x167b('0x34')]);_0xa9e470['offset']=qs[_0x167b('0x32')](_0x5a7da3[_0x167b('0x42')][_0x167b('0x32')]);}_0xa9e470[_0x167b('0x49')]=qs[_0x167b('0x4a')](_0x5a7da3[_0x167b('0x42')]['sort']);_0xa9e470[_0x167b('0x4b')]=qs[_0x167b('0x4c')](_[_0x167b('0x4d')](_0x5a7da3['query'],_0x5cdd5e[_0x167b('0x4c')]),_0x2decec);if(_0x5a7da3[_0x167b('0x42')][_0x167b('0x4e')]){_0xa9e470['where']=_['merge'](_0xa9e470[_0x167b('0x4b')],{'$or':_[_0x167b('0x3e')](_0x2decec,function(_0x7bbe3){if(_0x7bbe3[_0x167b('0x41')]!==_0x167b('0x4f')){var _0x978189={};_0x978189[_0x7bbe3[_0x167b('0x3b')]]={'$like':'%'+_0x5a7da3[_0x167b('0x42')][_0x167b('0x4e')]+'%'};return _0x978189;}})});}_0xa9e470=_[_0x167b('0x50')]({},_0xa9e470,_0x5a7da3[_0x167b('0x51')]);var _0x574c3f={'where':_0xa9e470['where']};return db[_0x167b('0x3f')]['count'](_0x574c3f)[_0x167b('0x23')](function(_0x5bd191){_0x2e1885[_0x167b('0x35')]=_0x5bd191;if(_0x5a7da3['query'][_0x167b('0x52')]){_0xa9e470[_0x167b('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x167b('0x54')](_0xa9e470);})[_0x167b('0x23')](function(_0x1b7a61){_0x2e1885[_0x167b('0x55')]=_0x1b7a61;return _0x2e1885;})[_0x167b('0x23')](respondWithFilteredResult(_0x48e0ab,_0xa9e470))[_0x167b('0x2d')](handleError(_0x48e0ab,null));};exports[_0x167b('0x56')]=function(_0x26dfcb,_0x556163){var _0x475789={'raw':!![],'where':{'id':_0x26dfcb['params']['id']}},_0x182299={};_0x182299[_0x167b('0x44')]=_[_0x167b('0x57')](db[_0x167b('0x3f')][_0x167b('0x58')]);_0x182299[_0x167b('0x42')]=_[_0x167b('0x57')](_0x26dfcb[_0x167b('0x42')]);_0x182299['filters']=_['intersection'](_0x182299['model'],_0x182299[_0x167b('0x42')]);_0x475789[_0x167b('0x45')]=_[_0x167b('0x43')](_0x182299[_0x167b('0x44')],qs[_0x167b('0x46')](_0x26dfcb[_0x167b('0x42')]['fields']));_0x475789[_0x167b('0x45')]=_0x475789[_0x167b('0x45')][_0x167b('0x59')]?_0x475789[_0x167b('0x45')]:_0x182299['model'];if(_0x26dfcb['query'][_0x167b('0x52')]){_0x475789[_0x167b('0x53')]=[{'all':!![]}];}_0x475789=_[_0x167b('0x50')]({},_0x475789,_0x26dfcb[_0x167b('0x51')]);return db[_0x167b('0x3f')][_0x167b('0x5a')](_0x475789)[_0x167b('0x23')](handleEntityNotFound(_0x556163,null))[_0x167b('0x23')](respondWithResult(_0x556163,null))[_0x167b('0x2d')](handleError(_0x556163,null));};exports[_0x167b('0x5b')]=function(_0x1b1078,_0x8f8c83){return db[_0x167b('0x3f')][_0x167b('0x5b')](_0x1b1078[_0x167b('0x5c')],{})[_0x167b('0x23')](respondWithResult(_0x8f8c83,0xc9))[_0x167b('0x2d')](handleError(_0x8f8c83,null));};exports[_0x167b('0x5d')]=function(_0x573326,_0x529078){if(_0x573326[_0x167b('0x5c')]['id']){delete _0x573326[_0x167b('0x5c')]['id'];}return db[_0x167b('0x3f')]['find']({'where':{'id':_0x573326[_0x167b('0x5e')]['id']}})['then'](handleEntityNotFound(_0x529078,null))[_0x167b('0x23')](saveUpdates(_0x573326[_0x167b('0x5c')],null))[_0x167b('0x23')](respondWithResult(_0x529078,null))[_0x167b('0x2d')](handleError(_0x529078,null));};exports[_0x167b('0x3a')]=function(_0x4b6da8,_0x183c67){return db[_0x167b('0x3f')][_0x167b('0x5a')]({'where':{'id':_0x4b6da8[_0x167b('0x5e')]['id']}})[_0x167b('0x23')](handleEntityNotFound(_0x183c67,null))['then'](removeEntity(_0x183c67,null))[_0x167b('0x2d')](handleError(_0x183c67,null));};exports['describe']=function(_0x5961d0,_0x3df4b0){return db[_0x167b('0x3f')][_0x167b('0x5f')]()[_0x167b('0x23')](respondWithResult(_0x3df4b0,null))[_0x167b('0x2d')](handleError(_0x3df4b0,null));};var interaction_log=require(_0x167b('0x17'))(_0x167b('0x60'));exports[_0x167b('0x61')]=function(_0x3664d2,_0x540116,_0x1adb91){var _0x4769d7={'agent':{},'channel':_0x167b('0x62')};if(_0x3664d2[_0x167b('0x5c')]['id']){delete _0x3664d2[_0x167b('0x5c')]['id'];}_0x3664d2[_0x167b('0x5c')][_0x167b('0x63')]=!![];_0x3664d2[_0x167b('0x5c')]['readAt']=moment()[_0x167b('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')]=_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')]||_0x3664d2[_0x167b('0x66')]['id'];_0x4769d7[_0x167b('0x67')]['id']=_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')];return db[_0x167b('0x3f')][_0x167b('0x5a')]({'where':{'id':_0x3664d2['params']['id'],'UserId':null}})[_0x167b('0x23')](handleEntityNotFound(_0x540116,null))['then'](saveUpdates(_0x3664d2['body'],null))['then'](function(_0x4c43c6){if(_0x4c43c6){_0x4769d7[_0x167b('0x29')]=_0x4c43c6[_0x167b('0x68')]({'plain':!![]});return db[_0x167b('0x69')][_0x167b('0x5a')]({'where':{'id':_0x4c43c6[_0x167b('0x6a')]}});}return null;})[_0x167b('0x23')](handleEntityNotFound(_0x540116,null))[_0x167b('0x23')](function(_0x3022a8){if(_0x3022a8){return _0x3022a8[_0x167b('0x5d')]({'UserId':_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')],'read1stAt':_[_0x167b('0x6b')](_0x3022a8[_0x167b('0x6c')])?moment()[_0x167b('0x64')](_0x167b('0x6d')):undefined});}return null;})[_0x167b('0x23')](function(_0x722bb3){if(_0x722bb3){_0x4769d7[_0x167b('0x6e')]=_0x722bb3[_0x167b('0x68')]({'plain':!![]});interaction_log[_0x167b('0x2a')](_0x167b('0x6f'),_0x3664d2[_0x167b('0x66')]['id'],_0x3664d2[_0x167b('0x66')]['name'],_0x3664d2[_0x167b('0x66')][_0x167b('0x70')],_0x4769d7['interaction']['id'],_0x3664d2['body']?JSON['stringify'](_0x3664d2[_0x167b('0x5c')]):'null');return respondWithRpcPromise('AcceptMessage',_0x167b('0x71'),_0x4769d7);}return null;})[_0x167b('0x23')](function(_0x3bccbe){var _0x29703d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3bccbe[_0x167b('0x29')][_0x167b('0x72')];return db[_0x167b('0x73')][_0x167b('0x42')](_0x29703d,{'type':db['Sequelize'][_0x167b('0x74')][_0x167b('0x75')],'raw':!![]})[_0x167b('0x23')](function(_0x4214c0){return _0x4214c0;});})[_0x167b('0x23')](function(_0x4c6f47){if(_0x4c6f47){_0x4769d7[_0x167b('0x29')][_0x167b('0x76')]=_0x4c6f47[0x0];if(!_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')])return;return db[_0x167b('0x77')]['find']({'where':{'id':_0x3664d2[_0x167b('0x5c')][_0x167b('0x65')],'role':'agent'},'attributes':['id',_0x167b('0x3b'),_0x167b('0x78'),_0x167b('0x79'),'internal'],'raw':!![]});}return null;})[_0x167b('0x23')](function(_0x4ff089){if(!_0x4ff089)return null;_0x4769d7['message'][_0x167b('0x67')]=_0x4ff089;return _0x4769d7;})[_0x167b('0x23')](function(_0x15e844){if(_0x15e844){if(_0x3664d2[_0x167b('0x5c')][_0x167b('0x7a')]){_0x4769d7[_0x167b('0x29')]['interface']=util['format'](_0x167b('0x7b'),_0x3664d2[_0x167b('0x66')][_0x167b('0x3b')]);_0x4769d7[_0x167b('0x29')][_0x167b('0x7c')]=_0x4769d7[_0x167b('0x7c')];_0x4769d7[_0x167b('0x29')]['motionChannel']=_0x4769d7[_0x167b('0x7c')];_0x4769d7['message']['event']=_0x167b('0x61');return respondWithRpcPromise(_0x167b('0x7d'),_0x167b('0x7d'),{'event':_0x167b('0x7e'),'message':_0x4769d7['message']},client9002)[_0x167b('0x23')](function(){return _0x4769d7;});}return _0x4769d7;}return null;})[_0x167b('0x23')](respondWithResult(_0x540116,null))[_0x167b('0x2d')](handleError(_0x540116,null));};var interaction_log=require('../../config/logger')(_0x167b('0x60'));exports['reject']=function(_0x1cfb4a,_0xf7b94c,_0x52e6c0){var _0xa038e={'agent':{},'channel':_0x167b('0x62')};if(_0x1cfb4a['body']['id']){delete _0x1cfb4a['body']['id'];}_0x1cfb4a[_0x167b('0x5c')][_0x167b('0x65')]=_0x1cfb4a[_0x167b('0x5c')][_0x167b('0x65')]||_0x1cfb4a[_0x167b('0x66')]['id'];_0xa038e[_0x167b('0x67')]['id']=_0x1cfb4a['body'][_0x167b('0x65')];return db['OpenchannelMessage'][_0x167b('0x5a')]({'where':{'id':_0x1cfb4a[_0x167b('0x5e')]['id'],'UserId':null}})[_0x167b('0x23')](handleEntityNotFound(_0xf7b94c,null))[_0x167b('0x23')](function(_0x692e21){if(_0x692e21){_0xa038e[_0x167b('0x29')]=_0x692e21[_0x167b('0x68')]({'plain':!![]});return db['OpenchannelInteraction'][_0x167b('0x5a')]({'where':{'id':_0x692e21[_0x167b('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0xf7b94c,null))['then'](function(_0x468d31){if(_0x468d31){_0xa038e[_0x167b('0x6e')]=_0x468d31['get']({'plain':!![]});interaction_log[_0x167b('0x2a')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1cfb4a[_0x167b('0x66')]['id'],_0x1cfb4a[_0x167b('0x66')][_0x167b('0x3b')],_0x1cfb4a['user'][_0x167b('0x70')],_0xa038e['interaction']['id'],_0x1cfb4a[_0x167b('0x5c')]?JSON['stringify'](_0x1cfb4a[_0x167b('0x5c')]):_0x167b('0x7f'));return respondWithRpcPromise(_0x167b('0x80'),'rejectMessage',_0xa038e);}return null;})['then'](function(_0x590099){var _0x298ad2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x590099['message'][_0x167b('0x72')];return db[_0x167b('0x73')][_0x167b('0x42')](_0x298ad2,{'type':db['Sequelize'][_0x167b('0x74')][_0x167b('0x75')],'raw':!![]})[_0x167b('0x23')](function(_0x208d00){return _0x208d00;});})[_0x167b('0x23')](function(_0x3de80e){if(_0x3de80e){_0xa038e['message']['contact']=_0x3de80e[0x0];if(!_0x1cfb4a['body'][_0x167b('0x65')])return;return db[_0x167b('0x77')][_0x167b('0x5a')]({'where':{'id':_0x1cfb4a['body']['UserId'],'role':_0x167b('0x67')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x167b('0x23')](function(_0x1fbf34){if(!_0x1fbf34)return null;_0xa038e[_0x167b('0x29')]['agent']=_0x1fbf34;return _0xa038e;})[_0x167b('0x23')](function(_0xf78e27){if(_0xf78e27){_0xf78e27[_0x167b('0x29')][_0x167b('0x81')]=util[_0x167b('0x64')]('SIP/%s',_0x1cfb4a[_0x167b('0x66')][_0x167b('0x3b')]);_0xf78e27[_0x167b('0x29')][_0x167b('0x7c')]=_0xa038e['channel'];_0xf78e27[_0x167b('0x29')]['motionChannel']=_0xa038e[_0x167b('0x7c')];_0xf78e27['message'][_0x167b('0x82')]=_0x167b('0x38');respondWithRpcPromise(_0x167b('0x7d'),'EventManager',{'event':_0x167b('0x83'),'message':_0xf78e27[_0x167b('0x29')]},client9002);return _0xa038e;}return null;})['then'](respondWithResult(_0xf7b94c,null))[_0x167b('0x2d')](handleError(_0xf7b94c,null));}; \ No newline at end of file +var _0xeb82=['result','catch','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','OpenchannelMessage','count','include','findAll','rows','includeAll','find','body','params','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','SIP/%s','user','channel','motionChannel','event','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','Sequelize','internal','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0xeb82,0xdb));var _0x2eb8=function(_0x401e69,_0x2e9e44){_0x401e69=_0x401e69-0x0;var _0x32f999=_0xeb82[_0x401e69];return _0x32f999;};'use strict';var emlformat=require(_0x2eb8('0x0'));var rimraf=require(_0x2eb8('0x1'));var zipdir=require(_0x2eb8('0x2'));var jsonpatch=require(_0x2eb8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2eb8('0x4'));var Mustache=require(_0x2eb8('0x5'));var util=require(_0x2eb8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2eb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2eb8('0x8'));var squel=require(_0x2eb8('0x9'));var crypto=require(_0x2eb8('0xa'));var jsforce=require(_0x2eb8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2eb8('0x7'));var querystring=require(_0x2eb8('0xc'));var Papa=require('papaparse');var Redis=require(_0x2eb8('0xd'));var authService=require(_0x2eb8('0xe'));var qs=require(_0x2eb8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eb8('0x10'));var logger=require(_0x2eb8('0x11'))(_0x2eb8('0x12'));var utils=require(_0x2eb8('0x13'));var config=require(_0x2eb8('0x14'));var licenseUtil=require(_0x2eb8('0x15'));var db=require(_0x2eb8('0x16'))['db'];config[_0x2eb8('0x17')]=_[_0x2eb8('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2eb8('0x19'))(new Redis(config[_0x2eb8('0x17')]));require(_0x2eb8('0x1a'))[_0x2eb8('0x1b')](socket);var jayson=require(_0x2eb8('0x1c'));var client=jayson[_0x2eb8('0x1d')][_0x2eb8('0x1e')]({'port':0x232c});var client9002=jayson[_0x2eb8('0x1d')][_0x2eb8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1ec20d,_0x1fee82,_0x5494b5,_0x3dab97){return new BPromise(function(_0xffb44f,_0x5a124e){var _0x4cfc07=_0x3dab97||client;return _0x4cfc07[_0x2eb8('0x1f')](_0x1ec20d,_0x5494b5)[_0x2eb8('0x20')](function(_0x239fcd){logger[_0x2eb8('0x21')](_0x2eb8('0x22'),_0x1fee82,_0x2eb8('0x23'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1fee82,_0x2eb8('0x23'),JSON['stringify'](_0x239fcd));if(_0x239fcd[_0x2eb8('0x24')]){if(_0x239fcd[_0x2eb8('0x24')][_0x2eb8('0x25')]===0x1f4){logger[_0x2eb8('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x1fee82,_0x239fcd[_0x2eb8('0x24')][_0x2eb8('0x26')]);return _0x5a124e(_0x239fcd[_0x2eb8('0x24')][_0x2eb8('0x26')]);}logger[_0x2eb8('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x1fee82,_0x239fcd[_0x2eb8('0x24')][_0x2eb8('0x26')]);return _0xffb44f(_0x239fcd['error'][_0x2eb8('0x26')]);}else{logger[_0x2eb8('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x1fee82,_0x2eb8('0x23'));_0xffb44f(_0x239fcd[_0x2eb8('0x27')]['message']);}})[_0x2eb8('0x28')](function(_0x13160e){logger['error'](_0x2eb8('0x22'),_0x1fee82,_0x13160e);_0x5a124e(_0x13160e);});});}function respondWithStatusCode(_0x198a7a,_0x31c735){_0x31c735=_0x31c735||0xcc;return function(_0x3a26fd){if(_0x3a26fd){return _0x198a7a[_0x2eb8('0x29')](_0x31c735);}return _0x198a7a[_0x2eb8('0x2a')](_0x31c735)['end']();};}function respondWithResult(_0x25a5ac,_0x1b00aa){_0x1b00aa=_0x1b00aa||0xc8;return function(_0x3d3358){if(_0x3d3358){return _0x25a5ac[_0x2eb8('0x2a')](_0x1b00aa)[_0x2eb8('0x2b')](_0x3d3358);}};}function respondWithFilteredResult(_0x18a6ce,_0x5446ed){return function(_0x7fc83b){if(_0x7fc83b){var _0x405d71=typeof _0x5446ed['offset']===_0x2eb8('0x2c')&&typeof _0x5446ed['limit']==='undefined';var _0x3f27fe=_0x7fc83b['count'];var _0x1b6f20=_0x405d71?0x0:_0x5446ed[_0x2eb8('0x2d')];var _0x14889f=_0x405d71?_0x7fc83b['count']:_0x5446ed['offset']+_0x5446ed[_0x2eb8('0x2e')];var _0x27f047;if(_0x14889f>=_0x3f27fe){_0x14889f=_0x3f27fe;_0x27f047=0xc8;}else{_0x27f047=0xce;}_0x18a6ce['status'](_0x27f047);return _0x18a6ce[_0x2eb8('0x2f')](_0x2eb8('0x30'),_0x1b6f20+'-'+_0x14889f+'/'+_0x3f27fe)[_0x2eb8('0x2b')](_0x7fc83b);}return null;};}function patchUpdates(_0x3a2a62){return function(_0x3186bb){try{jsonpatch[_0x2eb8('0x31')](_0x3186bb,_0x3a2a62,!![]);}catch(_0x396bcf){return BPromise[_0x2eb8('0x32')](_0x396bcf);}return _0x3186bb[_0x2eb8('0x33')]();};}function saveUpdates(_0xbcd4e3,_0x641775){return function(_0x105a63){if(_0x105a63){return _0x105a63[_0x2eb8('0x34')](_0xbcd4e3)['then'](function(_0x4eadf3){return _0x4eadf3;});}return null;};}function removeEntity(_0x30511e,_0x29059b){return function(_0x57f427){if(_0x57f427){return _0x57f427[_0x2eb8('0x35')]()['then'](function(){_0x30511e[_0x2eb8('0x2a')](0xcc)[_0x2eb8('0x36')]();});}};}function handleEntityNotFound(_0x186d44,_0x455db1){return function(_0x1f6ab4){if(!_0x1f6ab4){_0x186d44['sendStatus'](0x194);}return _0x1f6ab4;};}function handleError(_0x2f1050,_0x2da4c8){_0x2da4c8=_0x2da4c8||0x1f4;return function(_0x25786a){logger['error'](_0x25786a[_0x2eb8('0x37')]);if(_0x25786a['name']){delete _0x25786a[_0x2eb8('0x38')];}_0x2f1050[_0x2eb8('0x2a')](_0x2da4c8)['send'](_0x25786a);};}exports[_0x2eb8('0x39')]=function(_0x290627,_0x2325f1){var _0x5e56d2={},_0xd3f93c={},_0x423ea6={'count':0x0,'rows':[]};var _0x3f237e=_[_0x2eb8('0x3a')](db['OpenchannelMessage'][_0x2eb8('0x3b')],function(_0x1a51b6){return{'name':_0x1a51b6[_0x2eb8('0x3c')],'type':_0x1a51b6[_0x2eb8('0x3d')][_0x2eb8('0x3e')]};});_0xd3f93c['model']=_[_0x2eb8('0x3a')](_0x3f237e,_0x2eb8('0x38'));_0xd3f93c['query']=_[_0x2eb8('0x3f')](_0x290627[_0x2eb8('0x40')]);_0xd3f93c[_0x2eb8('0x41')]=_[_0x2eb8('0x42')](_0xd3f93c[_0x2eb8('0x43')],_0xd3f93c[_0x2eb8('0x40')]);_0x5e56d2[_0x2eb8('0x44')]=_['intersection'](_0xd3f93c[_0x2eb8('0x43')],qs[_0x2eb8('0x45')](_0x290627[_0x2eb8('0x40')][_0x2eb8('0x45')]));_0x5e56d2[_0x2eb8('0x44')]=_0x5e56d2['attributes'][_0x2eb8('0x46')]?_0x5e56d2[_0x2eb8('0x44')]:_0xd3f93c[_0x2eb8('0x43')];if(!_0x290627['query'][_0x2eb8('0x47')]('nolimit')){_0x5e56d2[_0x2eb8('0x2e')]=qs[_0x2eb8('0x2e')](_0x290627['query'][_0x2eb8('0x2e')]);_0x5e56d2[_0x2eb8('0x2d')]=qs[_0x2eb8('0x2d')](_0x290627[_0x2eb8('0x40')][_0x2eb8('0x2d')]);}_0x5e56d2[_0x2eb8('0x48')]=qs[_0x2eb8('0x49')](_0x290627['query'][_0x2eb8('0x49')]);_0x5e56d2[_0x2eb8('0x4a')]=qs[_0x2eb8('0x41')](_['pick'](_0x290627[_0x2eb8('0x40')],_0xd3f93c[_0x2eb8('0x41')]),_0x3f237e);if(_0x290627[_0x2eb8('0x40')][_0x2eb8('0x4b')]){_0x5e56d2[_0x2eb8('0x4a')]=_[_0x2eb8('0x4c')](_0x5e56d2[_0x2eb8('0x4a')],{'$or':_['map'](_0x3f237e,function(_0x560119){if(_0x560119['type']!=='VIRTUAL'){var _0x398ffe={};_0x398ffe[_0x560119[_0x2eb8('0x38')]]={'$like':'%'+_0x290627[_0x2eb8('0x40')][_0x2eb8('0x4b')]+'%'};return _0x398ffe;}})});}_0x5e56d2=_[_0x2eb8('0x4c')]({},_0x5e56d2,_0x290627[_0x2eb8('0x4d')]);var _0x190be6={'where':_0x5e56d2[_0x2eb8('0x4a')]};return db[_0x2eb8('0x4e')][_0x2eb8('0x4f')](_0x190be6)['then'](function(_0x33a3c5){_0x423ea6[_0x2eb8('0x4f')]=_0x33a3c5;if(_0x290627[_0x2eb8('0x40')]['includeAll']){_0x5e56d2[_0x2eb8('0x50')]=[{'all':!![]}];}return db[_0x2eb8('0x4e')][_0x2eb8('0x51')](_0x5e56d2);})[_0x2eb8('0x20')](function(_0x193ad7){_0x423ea6[_0x2eb8('0x52')]=_0x193ad7;return _0x423ea6;})[_0x2eb8('0x20')](respondWithFilteredResult(_0x2325f1,_0x5e56d2))['catch'](handleError(_0x2325f1,null));};exports['show']=function(_0x374c49,_0x7cef07){var _0x4a5940={'raw':!![],'where':{'id':_0x374c49['params']['id']}},_0x51013c={};_0x51013c['model']=_[_0x2eb8('0x3f')](db[_0x2eb8('0x4e')][_0x2eb8('0x3b')]);_0x51013c[_0x2eb8('0x40')]=_[_0x2eb8('0x3f')](_0x374c49[_0x2eb8('0x40')]);_0x51013c[_0x2eb8('0x41')]=_[_0x2eb8('0x42')](_0x51013c[_0x2eb8('0x43')],_0x51013c[_0x2eb8('0x40')]);_0x4a5940['attributes']=_['intersection'](_0x51013c['model'],qs[_0x2eb8('0x45')](_0x374c49[_0x2eb8('0x40')]['fields']));_0x4a5940[_0x2eb8('0x44')]=_0x4a5940[_0x2eb8('0x44')][_0x2eb8('0x46')]?_0x4a5940[_0x2eb8('0x44')]:_0x51013c['model'];if(_0x374c49['query'][_0x2eb8('0x53')]){_0x4a5940['include']=[{'all':!![]}];}_0x4a5940=_[_0x2eb8('0x4c')]({},_0x4a5940,_0x374c49[_0x2eb8('0x4d')]);return db[_0x2eb8('0x4e')][_0x2eb8('0x54')](_0x4a5940)[_0x2eb8('0x20')](handleEntityNotFound(_0x7cef07,null))[_0x2eb8('0x20')](respondWithResult(_0x7cef07,null))['catch'](handleError(_0x7cef07,null));};exports['create']=function(_0x442ae6,_0x1ace1a){return db[_0x2eb8('0x4e')]['create'](_0x442ae6[_0x2eb8('0x55')],{})[_0x2eb8('0x20')](respondWithResult(_0x1ace1a,0xc9))[_0x2eb8('0x28')](handleError(_0x1ace1a,null));};exports[_0x2eb8('0x34')]=function(_0x46393a,_0xaabe15){if(_0x46393a['body']['id']){delete _0x46393a['body']['id'];}return db[_0x2eb8('0x4e')][_0x2eb8('0x54')]({'where':{'id':_0x46393a[_0x2eb8('0x56')]['id']}})[_0x2eb8('0x20')](handleEntityNotFound(_0xaabe15,null))[_0x2eb8('0x20')](saveUpdates(_0x46393a[_0x2eb8('0x55')],null))[_0x2eb8('0x20')](respondWithResult(_0xaabe15,null))[_0x2eb8('0x28')](handleError(_0xaabe15,null));};exports[_0x2eb8('0x35')]=function(_0x11ea1b,_0x37549d){return db[_0x2eb8('0x4e')][_0x2eb8('0x54')]({'where':{'id':_0x11ea1b[_0x2eb8('0x56')]['id']}})['then'](handleEntityNotFound(_0x37549d,null))['then'](removeEntity(_0x37549d,null))['catch'](handleError(_0x37549d,null));};exports[_0x2eb8('0x57')]=function(_0x1c9adc,_0x19cb3e){return db[_0x2eb8('0x4e')][_0x2eb8('0x57')]()['then'](respondWithResult(_0x19cb3e,null))[_0x2eb8('0x28')](handleError(_0x19cb3e,null));};var interaction_log=require(_0x2eb8('0x11'))(_0x2eb8('0x58'));exports[_0x2eb8('0x59')]=function(_0x3e83f1,_0x2c6639,_0x15d95b){var _0x230b6e={'agent':{},'channel':'openchannel'};if(_0x3e83f1[_0x2eb8('0x55')]['id']){delete _0x3e83f1['body']['id'];}_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x5a')]=!![];_0x3e83f1[_0x2eb8('0x55')]['readAt']=moment()[_0x2eb8('0x5b')](_0x2eb8('0x5c'));_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x5d')]=_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x5d')]||_0x3e83f1['user']['id'];_0x230b6e['agent']['id']=_0x3e83f1['body'][_0x2eb8('0x5d')];return db[_0x2eb8('0x4e')]['find']({'where':{'id':_0x3e83f1['params']['id'],'UserId':null}})[_0x2eb8('0x20')](handleEntityNotFound(_0x2c6639,null))[_0x2eb8('0x20')](saveUpdates(_0x3e83f1[_0x2eb8('0x55')],null))['then'](function(_0x2390a9){if(_0x2390a9){_0x230b6e[_0x2eb8('0x26')]=_0x2390a9['get']({'plain':!![]});return db[_0x2eb8('0x5e')][_0x2eb8('0x54')]({'where':{'id':_0x2390a9[_0x2eb8('0x5f')]}});}return null;})[_0x2eb8('0x20')](handleEntityNotFound(_0x2c6639,null))[_0x2eb8('0x20')](function(_0x55c07b){if(_0x55c07b){return _0x55c07b[_0x2eb8('0x34')]({'UserId':_0x3e83f1[_0x2eb8('0x55')]['UserId'],'read1stAt':_[_0x2eb8('0x60')](_0x55c07b[_0x2eb8('0x61')])?moment()['format'](_0x2eb8('0x5c')):undefined});}return null;})['then'](function(_0x4bec52){if(_0x4bec52){_0x230b6e['interaction']=_0x4bec52[_0x2eb8('0x62')]({'plain':!![]});interaction_log['info'](_0x2eb8('0x63'),_0x3e83f1['user']['id'],_0x3e83f1['user'][_0x2eb8('0x38')],_0x3e83f1['user'][_0x2eb8('0x64')],_0x230b6e[_0x2eb8('0x65')]['id'],_0x3e83f1[_0x2eb8('0x55')]?JSON['stringify'](_0x3e83f1[_0x2eb8('0x55')]):_0x2eb8('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x230b6e);}return null;})[_0x2eb8('0x20')](function(_0x2e1fdd){var _0x2af024=_0x2eb8('0x67')+_0x2e1fdd[_0x2eb8('0x26')][_0x2eb8('0x68')];return db[_0x2eb8('0x69')]['query'](_0x2af024,{'type':db['Sequelize'][_0x2eb8('0x6a')][_0x2eb8('0x6b')],'raw':!![]})[_0x2eb8('0x20')](function(_0x9cb50d){return _0x9cb50d;});})[_0x2eb8('0x20')](function(_0x5be7a3){if(_0x5be7a3){_0x230b6e[_0x2eb8('0x26')][_0x2eb8('0x6c')]=_0x5be7a3[0x0];if(!_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x5d')])return;return db[_0x2eb8('0x6d')][_0x2eb8('0x54')]({'where':{'id':_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x5d')],'role':_0x2eb8('0x6e')},'attributes':['id',_0x2eb8('0x38'),_0x2eb8('0x6f'),_0x2eb8('0x70'),'internal'],'raw':!![]});}return null;})[_0x2eb8('0x20')](function(_0x6731c9){if(!_0x6731c9)return null;_0x230b6e[_0x2eb8('0x26')]['agent']=_0x6731c9;return _0x230b6e;})['then'](function(_0x2d4d71){if(_0x2d4d71){if(_0x3e83f1[_0x2eb8('0x55')][_0x2eb8('0x71')]){_0x230b6e[_0x2eb8('0x26')]['interface']=util[_0x2eb8('0x5b')](_0x2eb8('0x72'),_0x3e83f1[_0x2eb8('0x73')]['name']);_0x230b6e['message'][_0x2eb8('0x74')]=_0x230b6e['channel'];_0x230b6e[_0x2eb8('0x26')][_0x2eb8('0x75')]=_0x230b6e[_0x2eb8('0x74')];_0x230b6e[_0x2eb8('0x26')][_0x2eb8('0x76')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x2eb8('0x77'),'message':_0x230b6e[_0x2eb8('0x26')]},client9002)[_0x2eb8('0x20')](function(){return _0x230b6e;});}return _0x230b6e;}return null;})[_0x2eb8('0x20')](respondWithResult(_0x2c6639,null))['catch'](handleError(_0x2c6639,null));};var interaction_log=require(_0x2eb8('0x11'))(_0x2eb8('0x58'));exports[_0x2eb8('0x32')]=function(_0x2a80c7,_0x56c2df,_0x233f44){var _0x43a027={'agent':{},'channel':_0x2eb8('0x78')};if(_0x2a80c7[_0x2eb8('0x55')]['id']){delete _0x2a80c7[_0x2eb8('0x55')]['id'];}_0x2a80c7[_0x2eb8('0x55')][_0x2eb8('0x5d')]=_0x2a80c7['body'][_0x2eb8('0x5d')]||_0x2a80c7[_0x2eb8('0x73')]['id'];_0x43a027[_0x2eb8('0x6e')]['id']=_0x2a80c7[_0x2eb8('0x55')][_0x2eb8('0x5d')];return db[_0x2eb8('0x4e')]['find']({'where':{'id':_0x2a80c7[_0x2eb8('0x56')]['id'],'UserId':null}})[_0x2eb8('0x20')](handleEntityNotFound(_0x56c2df,null))[_0x2eb8('0x20')](function(_0x4739e3){if(_0x4739e3){_0x43a027[_0x2eb8('0x26')]=_0x4739e3[_0x2eb8('0x62')]({'plain':!![]});return db[_0x2eb8('0x5e')][_0x2eb8('0x54')]({'where':{'id':_0x4739e3['OpenchannelInteractionId']}});}return null;})[_0x2eb8('0x20')](handleEntityNotFound(_0x56c2df,null))[_0x2eb8('0x20')](function(_0x3b2202){if(_0x3b2202){_0x43a027[_0x2eb8('0x65')]=_0x3b2202[_0x2eb8('0x62')]({'plain':!![]});interaction_log[_0x2eb8('0x21')](_0x2eb8('0x79'),_0x2a80c7[_0x2eb8('0x73')]['id'],_0x2a80c7[_0x2eb8('0x73')][_0x2eb8('0x38')],_0x2a80c7['user'][_0x2eb8('0x64')],_0x43a027[_0x2eb8('0x65')]['id'],_0x2a80c7['body']?JSON[_0x2eb8('0x7a')](_0x2a80c7[_0x2eb8('0x55')]):_0x2eb8('0x66'));return respondWithRpcPromise(_0x2eb8('0x7b'),_0x2eb8('0x7c'),_0x43a027);}return null;})[_0x2eb8('0x20')](function(_0x598320){var _0x34615c=_0x2eb8('0x67')+_0x598320['message'][_0x2eb8('0x68')];return db['sequelize'][_0x2eb8('0x40')](_0x34615c,{'type':db[_0x2eb8('0x7d')][_0x2eb8('0x6a')][_0x2eb8('0x6b')],'raw':!![]})['then'](function(_0x3192aa){return _0x3192aa;});})[_0x2eb8('0x20')](function(_0x931cd6){if(_0x931cd6){_0x43a027[_0x2eb8('0x26')][_0x2eb8('0x6c')]=_0x931cd6[0x0];if(!_0x2a80c7[_0x2eb8('0x55')][_0x2eb8('0x5d')])return;return db['User']['find']({'where':{'id':_0x2a80c7[_0x2eb8('0x55')][_0x2eb8('0x5d')],'role':_0x2eb8('0x6e')},'attributes':['id','name',_0x2eb8('0x6f'),_0x2eb8('0x70'),_0x2eb8('0x7e')],'raw':!![]});}return null;})[_0x2eb8('0x20')](function(_0xaa3e4e){if(!_0xaa3e4e)return null;_0x43a027[_0x2eb8('0x26')][_0x2eb8('0x6e')]=_0xaa3e4e;return _0x43a027;})[_0x2eb8('0x20')](function(_0x334f92){if(_0x334f92){_0x334f92['message']['interface']=util['format'](_0x2eb8('0x72'),_0x2a80c7['user'][_0x2eb8('0x38')]);_0x334f92[_0x2eb8('0x26')][_0x2eb8('0x74')]=_0x43a027['channel'];_0x334f92['message'][_0x2eb8('0x75')]=_0x43a027[_0x2eb8('0x74')];_0x334f92[_0x2eb8('0x26')][_0x2eb8('0x76')]=_0x2eb8('0x32');respondWithRpcPromise(_0x2eb8('0x7f'),_0x2eb8('0x7f'),{'event':_0x2eb8('0x80'),'message':_0x334f92[_0x2eb8('0x26')]},client9002);return _0x43a027;}return null;})[_0x2eb8('0x20')](respondWithResult(_0x56c2df,null))[_0x2eb8('0x28')](handleError(_0x56c2df,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 7ceb4b0..5bf771a 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 _0xe8a4=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x38c6b5,_0x3a506b){var _0x48cc04=function(_0x18f331){while(--_0x18f331){_0x38c6b5['push'](_0x38c6b5['shift']());}};_0x48cc04(++_0x3a506b);}(_0xe8a4,0x15d));var _0x4e8a=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe8a4[_0x40bffc];return _0x3007e9;};'use strict';var EventEmitter=require(_0x4e8a('0x0'));var OpenchannelMessage=require(_0x4e8a('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4e8a('0x2')](0x0);var events={'afterCreate':_0x4e8a('0x3'),'afterUpdate':_0x4e8a('0x4'),'afterDestroy':_0x4e8a('0x5')};function emitEvent(_0x4d61d){return function(_0x347afe,_0x5078a9,_0x501c89){OpenchannelMessageEvents[_0x4e8a('0x6')](_0x4d61d+':'+_0x347afe['id'],_0x347afe);OpenchannelMessageEvents['emit'](_0x4d61d,_0x347afe);_0x501c89(null);};}for(var e in events){if(events[_0x4e8a('0x7')](e)){var event=events[e];OpenchannelMessage[_0x4e8a('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x27e8=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2b68fc,_0x10362e){var _0x2e3490=function(_0x13052e){while(--_0x13052e){_0x2b68fc['push'](_0x2b68fc['shift']());}};_0x2e3490(++_0x10362e);}(_0x27e8,0x10d));var _0x827e=function(_0xe19c1d,_0x2ff4df){_0xe19c1d=_0xe19c1d-0x0;var _0x4585d5=_0x27e8[_0xe19c1d];return _0x4585d5;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x827e('0x0'))['db'][_0x827e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x827e('0x2')](0x0);var events={'afterCreate':_0x827e('0x3'),'afterUpdate':_0x827e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x310e57){return function(_0x5eb0fe,_0x484225,_0x19c627){OpenchannelMessageEvents['emit'](_0x310e57+':'+_0x5eb0fe['id'],_0x5eb0fe);OpenchannelMessageEvents[_0x827e('0x5')](_0x310e57,_0x5eb0fe);_0x19c627(null);};}for(var e in events){if(events[_0x827e('0x6')](e)){var event=events[e];OpenchannelMessage[_0x827e('0x7')](e,emitEvent(event));}}module[_0x827e('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3eb311f..a5b9ce1 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 _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0xa3e97,_0x354bcc){var _0x57de72=function(_0x169f7a){while(--_0x169f7a){_0xa3e97['push'](_0xa3e97['shift']());}};_0x57de72(++_0x354bcc);}(_0x5c3c,0x132));var _0xc5c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5c3c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});}; \ No newline at end of file +var _0xb10b=['OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','method','GET','POST','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then'];(function(_0x4fab75,_0x22380e){var _0x2fe625=function(_0x362d80){while(--_0x362d80){_0x4fab75['push'](_0x4fab75['shift']());}};_0x2fe625(++_0x22380e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a148f,_0x114dfa){_0x5a148f=_0x5a148f-0x0;var _0x5af2d4=_0xb10b[_0x5a148f];return _0x5af2d4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd')],'type':_0xbb10('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2353ef,_0x1ce33e,_0x229887){var _0xa3adc8=_0x481979['models'];var _0x4e47f8=_0x2353ef[_0xbb10('0xf')]({'plain':!![]});if(_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()==='in'||_0x4e47f8['direction'][_0xbb10('0x11')]()==='out'&&!_0x4e47f8[_0xbb10('0x12')]&&!_[_0xbb10('0x13')](_0x4e47f8[_0xbb10('0x14')])){_0xa3adc8[_0xbb10('0x15')][_0xbb10('0x16')]({'where':{'id':_0x4e47f8[_0xbb10('0x17')]}})['then'](function(_0x26e021){if(_0x26e021){_0x26e021[_0xbb10('0x18')]({'lastMsgAt':_0x4e47f8[_0xbb10('0x19')],'lastMsgDirection':_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()});}})[_0xbb10('0x1a')](function(_0x24a57b){console[_0xbb10('0x1b')](_0x24a57b);});}if(_0x4e47f8[_0xbb10('0x10')]===_0xbb10('0x1c')&&!_0x4e47f8['secret']){var _0x2eca0f;_0xa3adc8[_0xbb10('0x1d')][_0xbb10('0x1e')]()[_0xbb10('0x1f')](function(_0x378da8){return _0xa3adc8[_0xbb10('0x20')][_0xbb10('0x21')]({'where':{'id':_0x4e47f8[_0xbb10('0x22')]},'include':[{'model':_0xa3adc8[_0xbb10('0x15')],'as':_0xbb10('0x23'),'where':{'id':_0x4e47f8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xa3adc8[_0xbb10('0x1d')],'as':_0xbb10('0x24'),'attributes':_[_0xbb10('0x25')](_0x378da8)}]}]});})[_0xbb10('0x1f')](function(_0xdf237d){_0x2eca0f=_0xdf237d[_0xbb10('0xf')]({'plain':!![]});if(_0x2eca0f&&_0x2eca0f['replyUri']){logger[_0xbb10('0x26')](_0xbb10('0x27'),'afterCreate',util['format'](_0xbb10('0x28'),_0x4e47f8['id'],_0x2eca0f[_0xbb10('0x29')]));if(_0x2eca0f[_0xbb10('0x23')]&&_0x2eca0f[_0xbb10('0x23')][_0xbb10('0x2a')]){_0x4e47f8[_0xbb10('0x2b')]=_[_0xbb10('0x2c')](_0x2eca0f[_0xbb10('0x23')][0x0],_0xbb10('0x24'));_0x4e47f8[_0xbb10('0x24')]=_0x2eca0f[_0xbb10('0x23')][0x0][_0xbb10('0x24')];}var _0x1ce33e={'method':'POST','uri':encodeURI(_0x2eca0f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1ce33e[_0xbb10('0x2d')]){case _0xbb10('0x2e'):_0x1ce33e['qs']=_0x4e47f8;break;case _0xbb10('0x2f'):_0x1ce33e['body']=_0x4e47f8;break;}return rp(_0x1ce33e)[_0xbb10('0x1f')](function(_0x24d586){logger[_0xbb10('0x26')](_0xbb10('0x27'),_0xbb10('0x30'),util[_0xbb10('0x31')](_0xbb10('0x32'),_0x4e47f8['id'],_0x2eca0f['replyUri']));if(_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]&&_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]!=_0x4e47f8[_0xbb10('0x2b')][_0xbb10('0x33')]){return _0xa3adc8['OpenchannelInteraction'][_0xbb10('0x18')]({'threadId':_0x24d586['body'][_0xbb10('0x33')]},{'logging':!![],'where':{'id':_0x4e47f8['Interaction']['id']}});}else{return;}})[_0xbb10('0x1f')](function(){return _0x2353ef[_0xbb10('0x18')]({'read':!![]});})[_0xbb10('0x1a')](function(_0x491db4){logger['error'](_0xbb10('0x27'),_0xbb10('0x30'),util['inspect'](_0x491db4,{'showHidden':![],'depth':null}));_0x229887();});}else{_0x229887();}})[_0xbb10('0x34')](function(){_0x229887();});}else{_0x229887();}}},'charset':_0xbb10('0x35'),'collate':_0xbb10('0x36')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9da986d..ef9f6f9 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45b781,_0x47aff3){var _0x347bf9=function(_0x583020){while(--_0x583020){_0x45b781['push'](_0x45b781['shift']());}};_0x347bf9(++_0x47aff3);}(_0x1261,0x144));var _0x1126=function(_0x42b030,_0x252cb6){_0x42b030=_0x42b030-0x0;var _0x112303=_0x1261[_0x42b030];return _0x112303;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x34b6f5,_0x2f4dc7){var _0x27d4ae=function(_0x14865d){while(--_0x14865d){_0x34b6f5['push'](_0x34b6f5['shift']());}};_0x27d4ae(++_0x2f4dc7);}(_0x7a54,0x106));var _0x47a5=function(_0x2fa19f,_0x4d0ef5){_0x2fa19f=_0x2fa19f-0x0;var _0x315e31=_0x7a54[_0x2fa19f];return _0x315e31;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1338cec..8354d84 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 _0xa899=['remove','emit','removeListener','register','length','./openchannelMessage.events','save'];(function(_0x364e4a,_0x3def28){var _0x30afbe=function(_0x2c152d){while(--_0x2c152d){_0x364e4a['push'](_0x364e4a['shift']());}};_0x30afbe(++_0x3def28);}(_0xa899,0x155));var _0x9a89=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0xa899[_0x2c18a8];return _0x1e009a;};'use strict';var OpenchannelMessageEvents=require(_0x9a89('0x0'));var events=[_0x9a89('0x1'),_0x9a89('0x2'),'update'];function createListener(_0x1a3132,_0x4ef4a8){return function(_0x2bc02a){_0x4ef4a8[_0x9a89('0x3')](_0x1a3132,_0x2bc02a);};}function removeListener(_0x405c47,_0x15c431){return function(){OpenchannelMessageEvents[_0x9a89('0x4')](_0x405c47,_0x15c431);};}exports[_0x9a89('0x5')]=function(_0x126099){for(var _0x413d15=0x0,_0x10fe5e=events[_0x9a89('0x6')];_0x413d15<_0x10fe5e;_0x413d15++){var _0x5e5454=events[_0x413d15];var _0x5ab174=createListener('openchannelMessage:'+_0x5e5454,_0x126099);OpenchannelMessageEvents['on'](_0x5e5454,_0x5ab174);}}; \ No newline at end of file +var _0xf483=['length','openchannelMessage:','save','update','emit'];(function(_0x5dc713,_0x4e90cf){var _0x5fc2d2=function(_0x1b0dfa){while(--_0x1b0dfa){_0x5dc713['push'](_0x5dc713['shift']());}};_0x5fc2d2(++_0x4e90cf);}(_0xf483,0xf2));var _0x3f48=function(_0x1911bc,_0x10c83e){_0x1911bc=_0x1911bc-0x0;var _0x51ec6c=_0xf483[_0x1911bc];return _0x51ec6c;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x3f48('0x0'),'remove',_0x3f48('0x1')];function createListener(_0x1a8c22,_0x2f4d00){return function(_0x413bf0){_0x2f4d00[_0x3f48('0x2')](_0x1a8c22,_0x413bf0);};}function removeListener(_0x312d9c,_0x5deb61){return function(){OpenchannelMessageEvents['removeListener'](_0x312d9c,_0x5deb61);};}exports['register']=function(_0x1a3447){for(var _0x16905e=0x0,_0x524a4f=events[_0x3f48('0x3')];_0x16905e<_0x524a4f;_0x16905e++){var _0x2f1ca5=events[_0x16905e];var _0x1746fd=createListener(_0x3f48('0x4')+_0x2f1ca5,_0x1a3447);OpenchannelMessageEvents['on'](_0x2f1ca5,_0x1746fd);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5dbdc1d..54db93f 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 _0x4693=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','/describe','describe','get','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x4693,0xc6));var _0x3469=function(_0x468cd2,_0x58d09e){_0x468cd2=_0x468cd2-0x0;var _0x4ecb10=_0x4693[_0x468cd2];return _0x4ecb10;};'use strict';var multer=require(_0x3469('0x0'));var util=require('util');var path=require(_0x3469('0x1'));var timeout=require(_0x3469('0x2'));var express=require(_0x3469('0x3'));var router=express[_0x3469('0x4')]();var fs_extra=require(_0x3469('0x5'));var auth=require(_0x3469('0x6'));var interaction=require(_0x3469('0x7'));var config=require(_0x3469('0x8'));var controller=require(_0x3469('0x9'));router['get']('/',auth[_0x3469('0xa')](),controller['index']);router['get'](_0x3469('0xb'),auth[_0x3469('0xa')](),controller[_0x3469('0xc')]);router[_0x3469('0xd')](_0x3469('0xe'),auth[_0x3469('0xa')](),controller['show']);router[_0x3469('0xd')](_0x3469('0xf'),auth[_0x3469('0xa')](),controller[_0x3469('0x10')]);router['get'](_0x3469('0x11'),auth[_0x3469('0xa')](),controller[_0x3469('0x12')]);router[_0x3469('0xd')]('/:id/users',auth[_0x3469('0xa')](),controller[_0x3469('0x13')]);router[_0x3469('0x14')]('/',auth['isAuthenticated'](),controller[_0x3469('0x15')]);router[_0x3469('0x14')](_0x3469('0x11'),auth[_0x3469('0xa')](),controller[_0x3469('0x16')]);router[_0x3469('0x14')](_0x3469('0x17'),auth['isAuthenticated'](),controller[_0x3469('0x18')]);router['put'](_0x3469('0xe'),auth[_0x3469('0xa')](),controller['update']);router[_0x3469('0x19')]('/:id',auth[_0x3469('0xa')](),controller[_0x3469('0x1a')]);router[_0x3469('0x19')](_0x3469('0x11'),auth[_0x3469('0xa')](),controller[_0x3469('0x1b')]);router[_0x3469('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3469('0x1c')]=router; \ No newline at end of file +var _0xe36b=['update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe36b,0xde));var _0xbe36=function(_0x2ec734,_0x166a97){_0x2ec734=_0x2ec734-0x0;var _0x21530d=_0xe36b[_0x2ec734];return _0x21530d;};'use strict';var multer=require(_0xbe36('0x0'));var util=require(_0xbe36('0x1'));var path=require(_0xbe36('0x2'));var timeout=require(_0xbe36('0x3'));var express=require('express');var router=express[_0xbe36('0x4')]();var fs_extra=require(_0xbe36('0x5'));var auth=require(_0xbe36('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0xbe36('0x7')]('/',auth[_0xbe36('0x8')](),controller[_0xbe36('0x9')]);router[_0xbe36('0x7')](_0xbe36('0xa'),auth[_0xbe36('0x8')](),controller['describe']);router['get'](_0xbe36('0xb'),auth[_0xbe36('0x8')](),controller[_0xbe36('0xc')]);router[_0xbe36('0x7')](_0xbe36('0xd'),auth[_0xbe36('0x8')](),controller[_0xbe36('0xe')]);router['get'](_0xbe36('0xf'),auth[_0xbe36('0x8')](),controller['getTeams']);router[_0xbe36('0x7')](_0xbe36('0x10'),auth[_0xbe36('0x8')](),controller[_0xbe36('0x11')]);router[_0xbe36('0x12')]('/',auth[_0xbe36('0x8')](),controller[_0xbe36('0x13')]);router[_0xbe36('0x12')]('/:id/teams',auth[_0xbe36('0x8')](),controller[_0xbe36('0x14')]);router[_0xbe36('0x12')](_0xbe36('0x10'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0xbe36('0x8')](),controller[_0xbe36('0x15')]);router['delete'](_0xbe36('0xb'),auth[_0xbe36('0x8')](),controller[_0xbe36('0x16')]);router[_0xbe36('0x17')](_0xbe36('0xf'),auth[_0xbe36('0x8')](),controller[_0xbe36('0x18')]);router[_0xbe36('0x17')]('/:id/users',auth[_0xbe36('0x8')](),controller[_0xbe36('0x19')]);module[_0xbe36('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 773bffa..b8e2b77 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 _0x9634=['beepall','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2aa863,_0x4b4e06){var _0x2338e1=function(_0x113e6b){while(--_0x113e6b){_0x2aa863['push'](_0x2aa863['shift']());}};_0x2338e1(++_0x4b4e06);}(_0x9634,0x14a));var _0x4963=function(_0x56f9a5,_0x35ee59){_0x56f9a5=_0x56f9a5-0x0;var _0x287df8=_0x9634[_0x56f9a5];return _0x287df8;};'use strict';var Sequelize=require(_0x4963('0x0'));module['exports']={'name':{'type':Sequelize[_0x4963('0x1')],'unique':_0x4963('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4963('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4963('0x4')](_0x4963('0x5'),_0x4963('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xfb02=['ENUM','rrmemory','beepall','roundrobin','sequelize','name','STRING','INTEGER'];(function(_0x51d177,_0x4288b9){var _0xbf010e=function(_0x5704c0){while(--_0x5704c0){_0x51d177['push'](_0x51d177['shift']());}};_0xbf010e(++_0x4288b9);}(_0xfb02,0x7c));var _0x2fb0=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0xfb02[_0x36a3d1];return _0x821ef4;};'use strict';var Sequelize=require(_0x2fb0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2fb0('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fb0('0x2')]},'timeout':{'type':Sequelize[_0x2fb0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2fb0('0x4')](_0x2fb0('0x5'),_0x2fb0('0x6'),_0x2fb0('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index b00f09f..7e2839f 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 _0x5bae=['removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','value','isEmpty','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','OpenchannelQueues','end','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','nolimit','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','%s/%s','SIP','findOne','Team','getTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit'];(function(_0x20a8f3,_0x5ed5e5){var _0x4a8e64=function(_0x127fb0){while(--_0x127fb0){_0x20a8f3['push'](_0x20a8f3['shift']());}};_0x4a8e64(++_0x5ed5e5);}(_0x5bae,0xa6));var _0xe5ba=function(_0x5b1c80,_0x88f6c3){_0x5b1c80=_0x5b1c80-0x0;var _0xc45c71=_0x5bae[_0x5b1c80];return _0xc45c71;};'use strict';var emlformat=require(_0xe5ba('0x0'));var rimraf=require(_0xe5ba('0x1'));var zipdir=require(_0xe5ba('0x2'));var jsonpatch=require(_0xe5ba('0x3'));var rp=require(_0xe5ba('0x4'));var moment=require(_0xe5ba('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe5ba('0x6'));var util=require(_0xe5ba('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe5ba('0x8'));var ejs=require(_0xe5ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe5ba('0xa'));var _=require(_0xe5ba('0xb'));var squel=require(_0xe5ba('0xc'));var crypto=require(_0xe5ba('0xd'));var jsforce=require(_0xe5ba('0xe'));var deskjs=require(_0xe5ba('0xf'));var toCsv=require(_0xe5ba('0x8'));var querystring=require(_0xe5ba('0x10'));var Papa=require(_0xe5ba('0x11'));var Redis=require(_0xe5ba('0x12'));var authService=require(_0xe5ba('0x13'));var qs=require(_0xe5ba('0x14'));var as=require(_0xe5ba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5ba('0x16'))('api');var utils=require(_0xe5ba('0x17'));var config=require(_0xe5ba('0x18'));var licenseUtil=require(_0xe5ba('0x19'));var db=require('../../mysqldb')['db'];config[_0xe5ba('0x1a')]=_['defaults'](config[_0xe5ba('0x1a')],{'host':_0xe5ba('0x1b'),'port':0x18eb});var socket=require(_0xe5ba('0x1c'))(new Redis(config[_0xe5ba('0x1a')]));require(_0xe5ba('0x1d'))[_0xe5ba('0x1e')](socket);function respondWithStatusCode(_0xa788e4,_0x2487b5){_0x2487b5=_0x2487b5||0xcc;return function(_0x137eb7){if(_0x137eb7){return _0xa788e4[_0xe5ba('0x1f')](_0x2487b5);}return _0xa788e4[_0xe5ba('0x20')](_0x2487b5)['end']();};}function respondWithResult(_0x50b264,_0x48cd3d){_0x48cd3d=_0x48cd3d||0xc8;return function(_0x3d1c75){if(_0x3d1c75){return _0x50b264['status'](_0x48cd3d)[_0xe5ba('0x21')](_0x3d1c75);}};}function respondWithFilteredResult(_0x20a3d1,_0x3409da){return function(_0x31446c){if(_0x31446c){var _0x5e5af1=typeof _0x3409da[_0xe5ba('0x22')]===_0xe5ba('0x23')&&typeof _0x3409da[_0xe5ba('0x24')]===_0xe5ba('0x23');var _0x24ffa0=_0x31446c['count'];var _0x1561d9=_0x5e5af1?0x0:_0x3409da[_0xe5ba('0x22')];var _0xe19448=_0x5e5af1?_0x31446c[_0xe5ba('0x25')]:_0x3409da[_0xe5ba('0x22')]+_0x3409da[_0xe5ba('0x24')];var _0x5c1541;if(_0xe19448>=_0x24ffa0){_0xe19448=_0x24ffa0;_0x5c1541=0xc8;}else{_0x5c1541=0xce;}_0x20a3d1[_0xe5ba('0x20')](_0x5c1541);return _0x20a3d1[_0xe5ba('0x26')](_0xe5ba('0x27'),_0x1561d9+'-'+_0xe19448+'/'+_0x24ffa0)[_0xe5ba('0x21')](_0x31446c);}return null;};}function patchUpdates(_0x237d73){return function(_0x221199){try{jsonpatch[_0xe5ba('0x28')](_0x221199,_0x237d73,!![]);}catch(_0x2f68b6){return BPromise[_0xe5ba('0x29')](_0x2f68b6);}return _0x221199['save']();};}function saveUpdates(_0x204b87,_0x122900){return function(_0x332f08){if(_0x332f08){return _0x332f08[_0xe5ba('0x2a')](_0x204b87)[_0xe5ba('0x2b')](function(_0x180f62){return _0x180f62;});}return null;};}function removeEntity(_0x59b006,_0x110b10){return function(_0x49f7e6){if(_0x49f7e6){return _0x49f7e6[_0xe5ba('0x2c')]()[_0xe5ba('0x2b')](function(){var _0x36a1d0=_0x49f7e6['get']({'plain':!![]});var _0xa0ae54=_0xe5ba('0x2d');return db['UserProfileResource'][_0xe5ba('0x2c')]({'where':{'type':_0xa0ae54,'resourceId':_0x36a1d0['id']}})[_0xe5ba('0x2b')](function(){return _0x49f7e6;});})[_0xe5ba('0x2b')](function(){_0x59b006[_0xe5ba('0x20')](0xcc)[_0xe5ba('0x2e')]();});}};}function handleEntityNotFound(_0x29c821,_0x29f01f){return function(_0x34c754){if(!_0x34c754){_0x29c821[_0xe5ba('0x1f')](0x194);}return _0x34c754;};}function handleError(_0x1a8bad,_0x11c10d){_0x11c10d=_0x11c10d||0x1f4;return function(_0x2887e5){logger[_0xe5ba('0x2f')](_0x2887e5['stack']);if(_0x2887e5[_0xe5ba('0x30')]){delete _0x2887e5[_0xe5ba('0x30')];}_0x1a8bad[_0xe5ba('0x20')](_0x11c10d)[_0xe5ba('0x31')](_0x2887e5);};}exports[_0xe5ba('0x32')]=function(_0x54c33e,_0x175368){var _0x25ea71={},_0x348563={},_0x58dde7={'count':0x0,'rows':[]};var _0x877181=_[_0xe5ba('0x33')](db[_0xe5ba('0x34')][_0xe5ba('0x35')],function(_0x25cfbb){return{'name':_0x25cfbb[_0xe5ba('0x36')],'type':_0x25cfbb['type']['key']};});_0x348563[_0xe5ba('0x37')]=_['map'](_0x877181,'name');_0x348563['query']=_[_0xe5ba('0x38')](_0x54c33e[_0xe5ba('0x39')]);_0x348563[_0xe5ba('0x3a')]=_['intersection'](_0x348563['model'],_0x348563['query']);_0x25ea71[_0xe5ba('0x3b')]=_[_0xe5ba('0x3c')](_0x348563['model'],qs[_0xe5ba('0x3d')](_0x54c33e[_0xe5ba('0x39')][_0xe5ba('0x3d')]));_0x25ea71['attributes']=_0x25ea71[_0xe5ba('0x3b')][_0xe5ba('0x3e')]?_0x25ea71[_0xe5ba('0x3b')]:_0x348563['model'];if(!_0x54c33e[_0xe5ba('0x39')][_0xe5ba('0x3f')]('nolimit')){_0x25ea71['limit']=qs[_0xe5ba('0x24')](_0x54c33e['query'][_0xe5ba('0x24')]);_0x25ea71[_0xe5ba('0x22')]=qs[_0xe5ba('0x22')](_0x54c33e['query']['offset']);}_0x25ea71[_0xe5ba('0x40')]=qs[_0xe5ba('0x41')](_0x54c33e[_0xe5ba('0x39')][_0xe5ba('0x41')]);_0x25ea71['where']=qs[_0xe5ba('0x3a')](_[_0xe5ba('0x42')](_0x54c33e[_0xe5ba('0x39')],_0x348563[_0xe5ba('0x3a')]),_0x877181);if(_0x54c33e['query'][_0xe5ba('0x43')]){_0x25ea71[_0xe5ba('0x44')]=_[_0xe5ba('0x45')](_0x25ea71['where'],{'$or':_[_0xe5ba('0x33')](_0x877181,function(_0x477a56){if(_0x477a56['type']!==_0xe5ba('0x46')){var _0x52b468={};_0x52b468[_0x477a56['name']]={'$like':'%'+_0x54c33e['query'][_0xe5ba('0x43')]+'%'};return _0x52b468;}})});}_0x25ea71=_['merge']({},_0x25ea71,_0x54c33e['options']);var _0x5a1326={'where':_0x25ea71[_0xe5ba('0x44')]};return db['OpenchannelQueue'][_0xe5ba('0x25')](_0x5a1326)[_0xe5ba('0x2b')](function(_0x5cad90){_0x58dde7[_0xe5ba('0x25')]=_0x5cad90;if(_0x54c33e[_0xe5ba('0x39')][_0xe5ba('0x47')]){_0x25ea71[_0xe5ba('0x48')]=[{'all':!![]}];}return db[_0xe5ba('0x34')][_0xe5ba('0x49')](_0x25ea71);})[_0xe5ba('0x2b')](function(_0x103f09){_0x58dde7['rows']=_0x103f09;return _0x58dde7;})[_0xe5ba('0x2b')](respondWithFilteredResult(_0x175368,_0x25ea71))[_0xe5ba('0x4a')](handleError(_0x175368,null));};exports[_0xe5ba('0x4b')]=function(_0x5b7701,_0x3f72a7){var _0x1a9db0={'raw':!![],'where':{'id':_0x5b7701[_0xe5ba('0x4c')]['id']}},_0x2f4f99={};_0x2f4f99['model']=_[_0xe5ba('0x38')](db['OpenchannelQueue'][_0xe5ba('0x35')]);_0x2f4f99[_0xe5ba('0x39')]=_[_0xe5ba('0x38')](_0x5b7701[_0xe5ba('0x39')]);_0x2f4f99[_0xe5ba('0x3a')]=_[_0xe5ba('0x3c')](_0x2f4f99[_0xe5ba('0x37')],_0x2f4f99[_0xe5ba('0x39')]);_0x1a9db0[_0xe5ba('0x3b')]=_[_0xe5ba('0x3c')](_0x2f4f99[_0xe5ba('0x37')],qs['fields'](_0x5b7701[_0xe5ba('0x39')]['fields']));_0x1a9db0[_0xe5ba('0x3b')]=_0x1a9db0['attributes'][_0xe5ba('0x3e')]?_0x1a9db0[_0xe5ba('0x3b')]:_0x2f4f99[_0xe5ba('0x37')];if(_0x5b7701[_0xe5ba('0x39')][_0xe5ba('0x47')]){_0x1a9db0[_0xe5ba('0x48')]=[{'all':!![]}];}_0x1a9db0=_[_0xe5ba('0x45')]({},_0x1a9db0,_0x5b7701[_0xe5ba('0x4d')]);return db[_0xe5ba('0x34')]['find'](_0x1a9db0)['then'](handleEntityNotFound(_0x3f72a7,null))['then'](respondWithResult(_0x3f72a7,null))[_0xe5ba('0x4a')](handleError(_0x3f72a7,null));};exports[_0xe5ba('0x4e')]=function(_0x3f16e4,_0x15355d){return db[_0xe5ba('0x34')]['create'](_0x3f16e4[_0xe5ba('0x4f')],{})[_0xe5ba('0x2b')](function(_0x16a5a9){var _0xbfb4a7=_0x3f16e4[_0xe5ba('0x50')]['get']({'plain':!![]});if(!_0xbfb4a7)throw new Error(_0xe5ba('0x51'));if(_0xbfb4a7[_0xe5ba('0x52')]===_0xe5ba('0x50')){var _0x13281b=_0x16a5a9[_0xe5ba('0x53')]({'plain':!![]});var _0x1900cd=_0xe5ba('0x2d');return db[_0xe5ba('0x54')][_0xe5ba('0x55')]({'where':{'name':_0x1900cd,'userProfileId':_0xbfb4a7[_0xe5ba('0x56')]},'raw':!![]})[_0xe5ba('0x2b')](function(_0x489fa3){if(_0x489fa3&&_0x489fa3[_0xe5ba('0x57')]===0x0){return db[_0xe5ba('0x58')]['create']({'name':_0x13281b[_0xe5ba('0x30')],'resourceId':_0x13281b['id'],'type':_0x489fa3[_0xe5ba('0x30')],'sectionId':_0x489fa3['id']},{})[_0xe5ba('0x2b')](function(){return _0x16a5a9;});}else{return _0x16a5a9;}})['catch'](function(_0x3aff53){logger[_0xe5ba('0x2f')](_0xe5ba('0x59'),_0x3aff53);throw _0x3aff53;});}return _0x16a5a9;})[_0xe5ba('0x2b')](respondWithResult(_0x15355d,0xc9))['catch'](handleError(_0x15355d,null));};exports[_0xe5ba('0x2a')]=function(_0x4710a1,_0x38cf95){if(_0x4710a1[_0xe5ba('0x4f')]['id']){delete _0x4710a1[_0xe5ba('0x4f')]['id'];}return db[_0xe5ba('0x34')][_0xe5ba('0x55')]({'where':{'id':_0x4710a1[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x38cf95,null))['then'](saveUpdates(_0x4710a1[_0xe5ba('0x4f')],null))['then'](respondWithResult(_0x38cf95,null))[_0xe5ba('0x4a')](handleError(_0x38cf95,null));};exports[_0xe5ba('0x2c')]=function(_0x3bb6f9,_0x354294){return db[_0xe5ba('0x34')][_0xe5ba('0x55')]({'where':{'id':_0x3bb6f9['params']['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x354294,null))[_0xe5ba('0x2b')](removeEntity(_0x354294,null))[_0xe5ba('0x4a')](handleError(_0x354294,null));};exports[_0xe5ba('0x5a')]=function(_0xfe7529,_0x5e05e1){return db[_0xe5ba('0x34')][_0xe5ba('0x5a')]()[_0xe5ba('0x2b')](respondWithResult(_0x5e05e1,null))[_0xe5ba('0x4a')](handleError(_0x5e05e1,null));};exports[_0xe5ba('0x5b')]=function(_0x3d9ded,_0x3bb66b,_0x342550){var _0x311e07={'raw':!![],'where':{}},_0xce2ce4={},_0x3fed88;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3d9ded[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x3bb66b,null))[_0xe5ba('0x2b')](function(_0x7575dd){if(_0x7575dd){_0x3fed88=_0x7575dd[_0xe5ba('0x53')]({'plain':!![]});_0xce2ce4[_0xe5ba('0x37')]=_['keys'](db[_0xe5ba('0x5c')]['rawAttributes']);_0xce2ce4['query']=_[_0xe5ba('0x38')](_0x3d9ded[_0xe5ba('0x39')]);_0xce2ce4[_0xe5ba('0x3a')]=_[_0xe5ba('0x3c')](_0xce2ce4[_0xe5ba('0x37')],_0xce2ce4[_0xe5ba('0x39')]);_0x311e07[_0xe5ba('0x3b')]=_[_0xe5ba('0x3c')](_0xce2ce4[_0xe5ba('0x37')],qs[_0xe5ba('0x3d')](_0x3d9ded[_0xe5ba('0x39')][_0xe5ba('0x3d')]));_0x311e07[_0xe5ba('0x3b')]=_0x311e07[_0xe5ba('0x3b')]['length']?_0x311e07[_0xe5ba('0x3b')]:_0xce2ce4[_0xe5ba('0x37')];if(!_0x3d9ded['query'][_0xe5ba('0x3f')](_0xe5ba('0x5d'))){_0x311e07[_0xe5ba('0x24')]=qs['limit'](_0x3d9ded[_0xe5ba('0x39')][_0xe5ba('0x24')]);_0x311e07[_0xe5ba('0x22')]=qs['offset'](_0x3d9ded[_0xe5ba('0x39')]['offset']);}_0x311e07[_0xe5ba('0x40')]=qs[_0xe5ba('0x41')](_0x3d9ded[_0xe5ba('0x39')][_0xe5ba('0x41')]);_0x311e07[_0xe5ba('0x44')]=qs[_0xe5ba('0x3a')](_['pick'](_0x3d9ded[_0xe5ba('0x39')],_0xce2ce4[_0xe5ba('0x3a')]));_0x311e07[_0xe5ba('0x44')][_0xe5ba('0x5e')]=_0x7575dd['id'];if(_0x3d9ded[_0xe5ba('0x39')]['filter']){_0x311e07['where']=_['merge'](_0x311e07['where'],{'$or':_['map'](_0x311e07[_0xe5ba('0x3b')],function(_0x4348a0){var _0x55782d={};_0x55782d[_0x4348a0]={'$like':'%'+_0x3d9ded[_0xe5ba('0x39')][_0xe5ba('0x43')]+'%'};return _0x55782d;})});}_0x311e07=_[_0xe5ba('0x45')]({},_0x311e07,_0x3d9ded[_0xe5ba('0x4d')]);return db['UserOpenchannelQueue']['findAll'](_0x311e07);}})[_0xe5ba('0x2b')](function(_0x49b7ba){if(_0x49b7ba){return db['User'][_0xe5ba('0x5f')]({'where':{'id':_[_0xe5ba('0x33')](_0x49b7ba,_0xe5ba('0x60')),'role':_0xe5ba('0x61')},'attributes':['id',_0xe5ba('0x30'),_0xe5ba('0x62'),_0xe5ba('0x63'),'createdAt']});}})[_0xe5ba('0x2b')](function(_0x2c23e0){if(_0x2c23e0){return{'count':_0x2c23e0[_0xe5ba('0x25')],'rows':_[_0xe5ba('0x33')](_0x2c23e0['rows'],function(_0x18444f){return{'membername':_0x18444f['name'],'UserId':_0x18444f['id'],'queue_name':_0x3fed88[_0xe5ba('0x30')],'OpenchannelQueueId':_0x3fed88['id'],'interface':util['format'](_0xe5ba('0x64'),_0xe5ba('0x65'),_0x18444f[_0xe5ba('0x30')]),'penalty':0x0,'paused':_0x18444f[_0xe5ba('0x62')],'createdAt':_0x18444f['createdAt'],'updatedAt':_0x18444f[_0xe5ba('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5ba('0x2b')](respondWithFilteredResult(_0x3bb66b,_0x311e07))[_0xe5ba('0x4a')](handleError(_0x3bb66b,null));};exports['getTeams']=function(_0x1d6dd0,_0x20795f,_0x4400eb){var _0x5d5082={};var _0x4c90cf={};var _0x1b8838;var _0x1002e1;return db[_0xe5ba('0x34')][_0xe5ba('0x66')]({'where':{'id':_0x1d6dd0[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x20795f,null))['then'](function(_0x10e2cf){if(_0x10e2cf){_0x1b8838=_0x10e2cf;_0x4c90cf[_0xe5ba('0x37')]=_['keys'](db[_0xe5ba('0x67')]['rawAttributes']);_0x4c90cf[_0xe5ba('0x39')]=_['keys'](_0x1d6dd0[_0xe5ba('0x39')]);_0x4c90cf[_0xe5ba('0x3a')]=_[_0xe5ba('0x3c')](_0x4c90cf[_0xe5ba('0x37')],_0x4c90cf[_0xe5ba('0x39')]);_0x5d5082[_0xe5ba('0x3b')]=_[_0xe5ba('0x3c')](_0x4c90cf[_0xe5ba('0x37')],qs[_0xe5ba('0x3d')](_0x1d6dd0[_0xe5ba('0x39')][_0xe5ba('0x3d')]));_0x5d5082[_0xe5ba('0x3b')]=_0x5d5082[_0xe5ba('0x3b')][_0xe5ba('0x3e')]?_0x5d5082[_0xe5ba('0x3b')]:_0x4c90cf[_0xe5ba('0x37')];_0x5d5082[_0xe5ba('0x40')]=qs[_0xe5ba('0x41')](_0x1d6dd0['query']['sort']);_0x5d5082[_0xe5ba('0x44')]=qs[_0xe5ba('0x3a')](_[_0xe5ba('0x42')](_0x1d6dd0['query'],_0x4c90cf[_0xe5ba('0x3a')]));if(_0x1d6dd0['query'][_0xe5ba('0x43')]){_0x5d5082[_0xe5ba('0x44')]=_[_0xe5ba('0x45')](_0x5d5082[_0xe5ba('0x44')],{'$or':_[_0xe5ba('0x33')](_0x5d5082[_0xe5ba('0x3b')],function(_0x21bd13){var _0x94ed59={};_0x94ed59[_0x21bd13]={'$like':'%'+_0x1d6dd0[_0xe5ba('0x39')][_0xe5ba('0x43')]+'%'};return _0x94ed59;})});}_0x5d5082=_['merge']({},_0x5d5082,_0x1d6dd0[_0xe5ba('0x4d')]);return _0x1b8838[_0xe5ba('0x68')](_0x5d5082);}})[_0xe5ba('0x2b')](function(_0x35dd53){if(_0x35dd53){_0x1002e1=_0x35dd53[_0xe5ba('0x3e')];if(!_0x1d6dd0[_0xe5ba('0x39')][_0xe5ba('0x3f')]('nolimit')){_0x5d5082[_0xe5ba('0x24')]=qs[_0xe5ba('0x24')](_0x1d6dd0[_0xe5ba('0x39')][_0xe5ba('0x24')]);_0x5d5082[_0xe5ba('0x22')]=qs['offset'](_0x1d6dd0[_0xe5ba('0x39')][_0xe5ba('0x22')]);}return _0x1b8838['getTeams'](_0x5d5082);}})[_0xe5ba('0x2b')](function(_0x2b2705){if(_0x2b2705){return _0x2b2705?{'count':_0x1002e1,'rows':_0x2b2705}:null;}})[_0xe5ba('0x2b')](respondWithResult(_0x20795f,null))[_0xe5ba('0x4a')](handleError(_0x20795f,null));};exports['addTeams']=function(_0x245057,_0x438047,_0x7996cd){var _0x90731c=_0x245057[_0xe5ba('0x4f')][_0xe5ba('0x69')];return db[_0xe5ba('0x67')][_0xe5ba('0x49')]({'where':{'id':_0x90731c},'attributes':['id'],'include':[{'model':db[_0xe5ba('0x6a')],'as':_0xe5ba('0x6b'),'attributes':['id',_0xe5ba('0x30'),'online',_0xe5ba('0x6c'),_0xe5ba('0x6d')],'raw':!![]}]})[_0xe5ba('0x2b')](function(_0x3f4d89){if(_0x3f4d89){var _0x79e2c2=_[_0xe5ba('0x6e')](_0x3f4d89,function(_0xe95c16){var _0x8cbef0=_0xe95c16['get']({'plain':!![]});return _0x8cbef0['Agents'];});return db[_0xe5ba('0x34')][_0xe5ba('0x55')]({'where':{'id':_0x245057[_0xe5ba('0x4c')]['id']}})['then'](function(_0x3b1ac2){return db[_0xe5ba('0x6f')][_0xe5ba('0x70')](function(_0x30ac66){return _0x3b1ac2[_0xe5ba('0x71')](_0x90731c,{'transaction':_0x30ac66})[_0xe5ba('0x2b')](function(){return BPromise[_0xe5ba('0x72')](_0x79e2c2,function(_0x438478){return db[_0xe5ba('0x5c')][_0xe5ba('0x73')]({'where':{'UserId':_0x438478['id'],'OpenchannelQueueId':_0x245057['params']['id']},'transaction':_0x30ac66});});})[_0xe5ba('0x2b')](function(){_0x79e2c2[_0xe5ba('0x74')](function(_0x455acd){socket[_0xe5ba('0x75')]('userOpenchannelQueue:save',{'UserId':_0x455acd['id'],'OpenchannelQueueId':_0x3b1ac2['id']});});});});});}})[_0xe5ba('0x2b')](respondWithStatusCode(_0x438047,null))[_0xe5ba('0x4a')](handleError(_0x438047,null));};exports[_0xe5ba('0x76')]=function(_0x56cfa9,_0x22adc0,_0xf722ec){return db[_0xe5ba('0x67')][_0xe5ba('0x49')]({'where':{'id':_0x56cfa9[_0xe5ba('0x39')][_0xe5ba('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe5ba('0x2b')](handleEntityNotFound(_0x22adc0,null))[_0xe5ba('0x2b')](function(_0x18545f){var _0x1910cc=_['map'](_0x18545f,'id');var _0x2ec48f=[];var _0x134c4a=[];var _0x49de11=squel[_0xe5ba('0x77')]();_0x49de11[_0xe5ba('0x78')](_0xe5ba('0x79'))[_0xe5ba('0x7a')](_0xe5ba('0x7b'),'tq')[_0xe5ba('0x7c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe5ba('0x44')](_0xe5ba('0x7d'),_0x56cfa9[_0xe5ba('0x4c')]['id']);for(var _0x3b0b9d=0x0;_0x3b0b9d<_0x18545f[_0xe5ba('0x3e')];_0x3b0b9d+=0x1){let _0x186496=_0x18545f[_0x3b0b9d];for(var _0x1013d0=0x0;_0x1013d0<_0x186496[_0xe5ba('0x6b')][_0xe5ba('0x3e')];_0x1013d0+=0x1){let _0x38c9db=_0x186496[_0xe5ba('0x6b')][_0x1013d0];var _0x51777c=_0x49de11[_0xe5ba('0x7e')]();_0x51777c[_0xe5ba('0x44')](_0xe5ba('0x7f'),_0x38c9db['id']);_0x134c4a['push'](db['sequelize'][_0xe5ba('0x39')](_0x51777c[_0xe5ba('0x80')](),{'type':db['sequelize'][_0xe5ba('0x81')]['SELECT']})[_0xe5ba('0x2b')](function(_0x12ca87){if(_0x12ca87['length']===0x1){return _0x38c9db['id'];}else{var _0x3c13dc=_[_0xe5ba('0x82')](_['map'](_0x12ca87,_0xe5ba('0x83')),function(_0x16dc36){return _['includes'](_0x1910cc,_0x16dc36);});if(_0x3c13dc){return _0x38c9db['id'];}}}));}}return BPromise['all'](_0x134c4a)[_0xe5ba('0x2b')](function(_0x6b9463){_0x2ec48f=_(_0x2ec48f)['union'](_0x6b9463)['compact']()[_0xe5ba('0x84')]();return db[_0xe5ba('0x34')][_0xe5ba('0x55')]({'where':{'id':_0x56cfa9['params']['id']}})[_0xe5ba('0x2b')](function(_0x235c24){return db['sequelize']['transaction'](function(_0x2dfa13){return _0x235c24['removeTeams'](_0x56cfa9[_0xe5ba('0x39')][_0xe5ba('0x69')],{'transaction':_0x2dfa13})[_0xe5ba('0x2b')](function(){if(!_[_0xe5ba('0x85')](_0x2ec48f)){return _0x235c24['removeAgents'](_0x2ec48f,{'transaction':_0x2dfa13});}})['then'](function(){_0x2ec48f[_0xe5ba('0x74')](function(_0x49859c){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x49859c,'OpenchannelQueueId':_0x235c24['id']});});});});});});})[_0xe5ba('0x2b')](respondWithStatusCode(_0x22adc0,null))['catch'](handleError(_0x22adc0,null));};exports[_0xe5ba('0x86')]=function(_0x2360a0,_0x2fad50,_0x26ec9d){return db['OpenchannelQueue'][_0xe5ba('0x55')]({'where':{'id':_0x2360a0[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x2fad50,null))[_0xe5ba('0x2b')](function(_0x155835){if(_0x155835){return _0x155835[_0xe5ba('0x86')](_0x2360a0[_0xe5ba('0x4f')][_0xe5ba('0x69')],_[_0xe5ba('0x87')](_0x2360a0[_0xe5ba('0x4f')],[_0xe5ba('0x69'),'id'])||{})[_0xe5ba('0x88')](function(_0x5bd97e){for(var _0x520979=0x0;_0x520979<_0x2360a0[_0xe5ba('0x4f')][_0xe5ba('0x69')][_0xe5ba('0x3e')];_0x520979+=0x1){socket[_0xe5ba('0x75')](_0xe5ba('0x89'),{'UserId':Number(_0x2360a0[_0xe5ba('0x4f')][_0xe5ba('0x69')][_0x520979]),'OpenchannelQueueId':Number(_0x2360a0['params']['id'])});}return _0x5bd97e;});}})[_0xe5ba('0x2b')](respondWithResult(_0x2fad50,null))['catch'](handleError(_0x2fad50,null));};exports[_0xe5ba('0x8a')]=function(_0x40b422,_0x2af1f5,_0x53c554){return db['OpenchannelQueue'][_0xe5ba('0x55')]({'where':{'id':_0x40b422[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x2af1f5,null))[_0xe5ba('0x2b')](function(_0x203389){if(_0x203389){return _0x203389[_0xe5ba('0x8a')](_0x40b422[_0xe5ba('0x39')]['ids'])[_0xe5ba('0x2b')](function(){if(_[_0xe5ba('0x8b')](_0x40b422[_0xe5ba('0x39')][_0xe5ba('0x69')])){for(var _0x443ebb=0x0;_0x443ebb<_0x40b422[_0xe5ba('0x39')][_0xe5ba('0x69')][_0xe5ba('0x3e')];_0x443ebb+=0x1){socket['emit'](_0xe5ba('0x8c'),{'UserId':Number(_0x40b422[_0xe5ba('0x39')][_0xe5ba('0x69')][_0x443ebb]),'OpenchannelQueueId':Number(_0x40b422['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x40b422[_0xe5ba('0x39')][_0xe5ba('0x69')]),'OpenchannelQueueId':Number(_0x40b422[_0xe5ba('0x4c')]['id'])});}});}})[_0xe5ba('0x2b')](respondWithStatusCode(_0x2af1f5,null))[_0xe5ba('0x4a')](handleError(_0x2af1f5,null));};exports[_0xe5ba('0x8d')]=function(_0x463ac1,_0x5de865,_0x297184){var _0x249505={};var _0x49bd41={};var _0x45d817;var _0x5da30b;return db['OpenchannelQueue'][_0xe5ba('0x66')]({'where':{'id':_0x463ac1[_0xe5ba('0x4c')]['id']}})[_0xe5ba('0x2b')](handleEntityNotFound(_0x5de865,null))['then'](function(_0x23256e){if(_0x23256e){_0x45d817=_0x23256e;_0x49bd41[_0xe5ba('0x37')]=_['keys'](db[_0xe5ba('0x6a')][_0xe5ba('0x35')]);_0x49bd41[_0xe5ba('0x39')]=_[_0xe5ba('0x38')](_0x463ac1[_0xe5ba('0x39')]);_0x49bd41[_0xe5ba('0x3a')]=_[_0xe5ba('0x3c')](_0x49bd41[_0xe5ba('0x37')],_0x49bd41[_0xe5ba('0x39')]);_0x249505[_0xe5ba('0x3b')]=_[_0xe5ba('0x3c')](_0x49bd41[_0xe5ba('0x37')],qs[_0xe5ba('0x3d')](_0x463ac1['query'][_0xe5ba('0x3d')]));_0x249505[_0xe5ba('0x3b')]=_0x249505[_0xe5ba('0x3b')]['length']?_0x249505[_0xe5ba('0x3b')]:_0x49bd41[_0xe5ba('0x37')];_0x249505['order']=qs[_0xe5ba('0x41')](_0x463ac1[_0xe5ba('0x39')][_0xe5ba('0x41')]);_0x249505[_0xe5ba('0x44')]=qs['filters'](_[_0xe5ba('0x42')](_0x463ac1[_0xe5ba('0x39')],_0x49bd41['filters']));if(_0x463ac1['query'][_0xe5ba('0x43')]){_0x249505[_0xe5ba('0x44')]=_[_0xe5ba('0x45')](_0x249505[_0xe5ba('0x44')],{'$or':_['map'](_0x249505[_0xe5ba('0x3b')],function(_0x4616a0){var _0x44e200={};_0x44e200[_0x4616a0]={'$like':'%'+_0x463ac1['query'][_0xe5ba('0x43')]+'%'};return _0x44e200;})});}_0x249505=_[_0xe5ba('0x45')]({},_0x249505,_0x463ac1['options']);return _0x45d817[_0xe5ba('0x8d')](_0x249505);}})[_0xe5ba('0x2b')](function(_0x1fa846){if(_0x1fa846){_0x5da30b=_0x1fa846[_0xe5ba('0x3e')];if(!_0x463ac1[_0xe5ba('0x39')][_0xe5ba('0x3f')](_0xe5ba('0x5d'))){_0x249505[_0xe5ba('0x24')]=qs[_0xe5ba('0x24')](_0x463ac1[_0xe5ba('0x39')]['limit']);_0x249505['offset']=qs[_0xe5ba('0x22')](_0x463ac1[_0xe5ba('0x39')][_0xe5ba('0x22')]);}return _0x45d817[_0xe5ba('0x8d')](_0x249505);}})[_0xe5ba('0x2b')](function(_0x5bee27){if(_0x5bee27){return _0x5bee27?{'count':_0x5da30b,'rows':_0x5bee27}:null;}})[_0xe5ba('0x2b')](respondWithResult(_0x5de865,null))[_0xe5ba('0x4a')](handleError(_0x5de865,null));}; \ No newline at end of file +var _0xd720=['then','get','OpenchannelQueues','UserProfileResource','error','stack','name','map','OpenchannelQueue','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd720,0x17d));var _0x0d72=function(_0x32c1de,_0x319a95){_0x32c1de=_0x32c1de-0x0;var _0x1e01d8=_0xd720[_0x32c1de];return _0x1e01d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d72('0x0'));var zipdir=require(_0x0d72('0x1'));var jsonpatch=require(_0x0d72('0x2'));var rp=require(_0x0d72('0x3'));var moment=require(_0x0d72('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d72('0x5'));var util=require('util');var path=require(_0x0d72('0x6'));var sox=require(_0x0d72('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d72('0x8'));var _=require(_0x0d72('0x9'));var squel=require(_0x0d72('0xa'));var crypto=require(_0x0d72('0xb'));var jsforce=require(_0x0d72('0xc'));var deskjs=require(_0x0d72('0xd'));var toCsv=require(_0x0d72('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0d72('0xf'));var qs=require(_0x0d72('0x10'));var as=require(_0x0d72('0x11'));var hardwareService=require(_0x0d72('0x12'));var logger=require(_0x0d72('0x13'))(_0x0d72('0x14'));var utils=require(_0x0d72('0x15'));var config=require(_0x0d72('0x16'));var licenseUtil=require(_0x0d72('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0d72('0x18')](config[_0x0d72('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d72('0x1a'))(new Redis(config[_0x0d72('0x19')]));require(_0x0d72('0x1b'))[_0x0d72('0x1c')](socket);function respondWithStatusCode(_0x126e35,_0x3e6da1){_0x3e6da1=_0x3e6da1||0xcc;return function(_0x2faa7a){if(_0x2faa7a){return _0x126e35[_0x0d72('0x1d')](_0x3e6da1);}return _0x126e35['status'](_0x3e6da1)[_0x0d72('0x1e')]();};}function respondWithResult(_0x50305a,_0x39fffb){_0x39fffb=_0x39fffb||0xc8;return function(_0x5ead1e){if(_0x5ead1e){return _0x50305a[_0x0d72('0x1f')](_0x39fffb)['json'](_0x5ead1e);}};}function respondWithFilteredResult(_0x3b55ac,_0x22fbf3){return function(_0x1f7d5d){if(_0x1f7d5d){var _0x218662=typeof _0x22fbf3[_0x0d72('0x20')]===_0x0d72('0x21')&&typeof _0x22fbf3[_0x0d72('0x22')]==='undefined';var _0x30614c=_0x1f7d5d[_0x0d72('0x23')];var _0x421fce=_0x218662?0x0:_0x22fbf3[_0x0d72('0x20')];var _0x5b9aa8=_0x218662?_0x1f7d5d['count']:_0x22fbf3[_0x0d72('0x20')]+_0x22fbf3['limit'];var _0x4a4472;if(_0x5b9aa8>=_0x30614c){_0x5b9aa8=_0x30614c;_0x4a4472=0xc8;}else{_0x4a4472=0xce;}_0x3b55ac[_0x0d72('0x1f')](_0x4a4472);return _0x3b55ac['set'](_0x0d72('0x24'),_0x421fce+'-'+_0x5b9aa8+'/'+_0x30614c)['json'](_0x1f7d5d);}return null;};}function patchUpdates(_0x5be1fe){return function(_0x2ccaeb){try{jsonpatch[_0x0d72('0x25')](_0x2ccaeb,_0x5be1fe,!![]);}catch(_0x3803ea){return BPromise[_0x0d72('0x26')](_0x3803ea);}return _0x2ccaeb[_0x0d72('0x27')]();};}function saveUpdates(_0x52b3ae,_0x310a6a){return function(_0x263336){if(_0x263336){return _0x263336[_0x0d72('0x28')](_0x52b3ae)['then'](function(_0x214672){return _0x214672;});}return null;};}function removeEntity(_0x3febb3,_0xe8a759){return function(_0xe0d52e){if(_0xe0d52e){return _0xe0d52e[_0x0d72('0x29')]()[_0x0d72('0x2a')](function(){var _0x4e2c0b=_0xe0d52e[_0x0d72('0x2b')]({'plain':!![]});var _0x108263=_0x0d72('0x2c');return db[_0x0d72('0x2d')][_0x0d72('0x29')]({'where':{'type':_0x108263,'resourceId':_0x4e2c0b['id']}})[_0x0d72('0x2a')](function(){return _0xe0d52e;});})['then'](function(){_0x3febb3[_0x0d72('0x1f')](0xcc)[_0x0d72('0x1e')]();});}};}function handleEntityNotFound(_0x257bdd,_0x199d92){return function(_0x517302){if(!_0x517302){_0x257bdd['sendStatus'](0x194);}return _0x517302;};}function handleError(_0xf7763c,_0x246b0f){_0x246b0f=_0x246b0f||0x1f4;return function(_0x4d7770){logger[_0x0d72('0x2e')](_0x4d7770[_0x0d72('0x2f')]);if(_0x4d7770[_0x0d72('0x30')]){delete _0x4d7770[_0x0d72('0x30')];}_0xf7763c[_0x0d72('0x1f')](_0x246b0f)['send'](_0x4d7770);};}exports['index']=function(_0x1c4969,_0x3cfc2c){var _0x388590={},_0x4d0171={},_0x394602={'count':0x0,'rows':[]};var _0x4afd9c=_[_0x0d72('0x31')](db[_0x0d72('0x32')]['rawAttributes'],function(_0x1f18f5){return{'name':_0x1f18f5[_0x0d72('0x33')],'type':_0x1f18f5[_0x0d72('0x34')][_0x0d72('0x35')]};});_0x4d0171['model']=_['map'](_0x4afd9c,_0x0d72('0x30'));_0x4d0171[_0x0d72('0x36')]=_[_0x0d72('0x37')](_0x1c4969[_0x0d72('0x36')]);_0x4d0171[_0x0d72('0x38')]=_[_0x0d72('0x39')](_0x4d0171['model'],_0x4d0171[_0x0d72('0x36')]);_0x388590['attributes']=_[_0x0d72('0x39')](_0x4d0171[_0x0d72('0x3a')],qs[_0x0d72('0x3b')](_0x1c4969['query']['fields']));_0x388590[_0x0d72('0x3c')]=_0x388590[_0x0d72('0x3c')][_0x0d72('0x3d')]?_0x388590['attributes']:_0x4d0171[_0x0d72('0x3a')];if(!_0x1c4969['query'][_0x0d72('0x3e')](_0x0d72('0x3f'))){_0x388590[_0x0d72('0x22')]=qs['limit'](_0x1c4969[_0x0d72('0x36')]['limit']);_0x388590[_0x0d72('0x20')]=qs['offset'](_0x1c4969[_0x0d72('0x36')][_0x0d72('0x20')]);}_0x388590[_0x0d72('0x40')]=qs[_0x0d72('0x41')](_0x1c4969[_0x0d72('0x36')][_0x0d72('0x41')]);_0x388590['where']=qs[_0x0d72('0x38')](_['pick'](_0x1c4969[_0x0d72('0x36')],_0x4d0171[_0x0d72('0x38')]),_0x4afd9c);if(_0x1c4969[_0x0d72('0x36')][_0x0d72('0x42')]){_0x388590[_0x0d72('0x43')]=_[_0x0d72('0x44')](_0x388590[_0x0d72('0x43')],{'$or':_[_0x0d72('0x31')](_0x4afd9c,function(_0x47599e){if(_0x47599e[_0x0d72('0x34')]!==_0x0d72('0x45')){var _0x115f7f={};_0x115f7f[_0x47599e[_0x0d72('0x30')]]={'$like':'%'+_0x1c4969['query']['filter']+'%'};return _0x115f7f;}})});}_0x388590=_[_0x0d72('0x44')]({},_0x388590,_0x1c4969[_0x0d72('0x46')]);var _0x4abb62={'where':_0x388590['where']};return db['OpenchannelQueue'][_0x0d72('0x23')](_0x4abb62)[_0x0d72('0x2a')](function(_0x35ac1f){_0x394602['count']=_0x35ac1f;if(_0x1c4969[_0x0d72('0x36')][_0x0d72('0x47')]){_0x388590['include']=[{'all':!![]}];}return db[_0x0d72('0x32')]['findAll'](_0x388590);})[_0x0d72('0x2a')](function(_0x396b76){_0x394602[_0x0d72('0x48')]=_0x396b76;return _0x394602;})['then'](respondWithFilteredResult(_0x3cfc2c,_0x388590))[_0x0d72('0x49')](handleError(_0x3cfc2c,null));};exports[_0x0d72('0x4a')]=function(_0x49be9d,_0x5b5b5f){var _0x58148b={'raw':!![],'where':{'id':_0x49be9d[_0x0d72('0x4b')]['id']}},_0x49e0d2={};_0x49e0d2[_0x0d72('0x3a')]=_['keys'](db[_0x0d72('0x32')][_0x0d72('0x4c')]);_0x49e0d2['query']=_['keys'](_0x49be9d[_0x0d72('0x36')]);_0x49e0d2['filters']=_['intersection'](_0x49e0d2[_0x0d72('0x3a')],_0x49e0d2[_0x0d72('0x36')]);_0x58148b[_0x0d72('0x3c')]=_[_0x0d72('0x39')](_0x49e0d2[_0x0d72('0x3a')],qs['fields'](_0x49be9d[_0x0d72('0x36')][_0x0d72('0x3b')]));_0x58148b[_0x0d72('0x3c')]=_0x58148b[_0x0d72('0x3c')][_0x0d72('0x3d')]?_0x58148b['attributes']:_0x49e0d2[_0x0d72('0x3a')];if(_0x49be9d[_0x0d72('0x36')][_0x0d72('0x47')]){_0x58148b[_0x0d72('0x4d')]=[{'all':!![]}];}_0x58148b=_[_0x0d72('0x44')]({},_0x58148b,_0x49be9d[_0x0d72('0x46')]);return db[_0x0d72('0x32')][_0x0d72('0x4e')](_0x58148b)['then'](handleEntityNotFound(_0x5b5b5f,null))[_0x0d72('0x2a')](respondWithResult(_0x5b5b5f,null))['catch'](handleError(_0x5b5b5f,null));};exports[_0x0d72('0x4f')]=function(_0x5d782c,_0x57f511){return db[_0x0d72('0x32')][_0x0d72('0x4f')](_0x5d782c[_0x0d72('0x50')],{})[_0x0d72('0x2a')](function(_0x450f1d){var _0xc1cf33=_0x5d782c[_0x0d72('0x51')][_0x0d72('0x2b')]({'plain':!![]});if(!_0xc1cf33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc1cf33['role']===_0x0d72('0x51')){var _0x11807a=_0x450f1d[_0x0d72('0x2b')]({'plain':!![]});var _0x413605=_0x0d72('0x2c');return db[_0x0d72('0x52')][_0x0d72('0x4e')]({'where':{'name':_0x413605,'userProfileId':_0xc1cf33[_0x0d72('0x53')]},'raw':!![]})['then'](function(_0x40bed5){if(_0x40bed5&&_0x40bed5[_0x0d72('0x54')]===0x0){return db['UserProfileResource'][_0x0d72('0x4f')]({'name':_0x11807a[_0x0d72('0x30')],'resourceId':_0x11807a['id'],'type':_0x40bed5[_0x0d72('0x30')],'sectionId':_0x40bed5['id']},{})['then'](function(){return _0x450f1d;});}else{return _0x450f1d;}})[_0x0d72('0x49')](function(_0x1adef8){logger[_0x0d72('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1adef8);throw _0x1adef8;});}return _0x450f1d;})[_0x0d72('0x2a')](respondWithResult(_0x57f511,0xc9))[_0x0d72('0x49')](handleError(_0x57f511,null));};exports[_0x0d72('0x28')]=function(_0x464c81,_0x7264d4){if(_0x464c81['body']['id']){delete _0x464c81['body']['id'];}return db[_0x0d72('0x32')][_0x0d72('0x4e')]({'where':{'id':_0x464c81[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](handleEntityNotFound(_0x7264d4,null))[_0x0d72('0x2a')](saveUpdates(_0x464c81[_0x0d72('0x50')],null))[_0x0d72('0x2a')](respondWithResult(_0x7264d4,null))[_0x0d72('0x49')](handleError(_0x7264d4,null));};exports[_0x0d72('0x29')]=function(_0x499ac8,_0x56b8c1){return db[_0x0d72('0x32')]['find']({'where':{'id':_0x499ac8[_0x0d72('0x4b')]['id']}})['then'](handleEntityNotFound(_0x56b8c1,null))[_0x0d72('0x2a')](removeEntity(_0x56b8c1,null))['catch'](handleError(_0x56b8c1,null));};exports['describe']=function(_0x171799,_0x37cf40){return db[_0x0d72('0x32')][_0x0d72('0x55')]()[_0x0d72('0x2a')](respondWithResult(_0x37cf40,null))[_0x0d72('0x49')](handleError(_0x37cf40,null));};exports[_0x0d72('0x56')]=function(_0xdebaf8,_0x59ecdc,_0x90d4ff){var _0x21ca79={'raw':!![],'where':{}},_0x291592={},_0xfa12a1;return db['OpenchannelQueue'][_0x0d72('0x57')]({'where':{'id':_0xdebaf8[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](handleEntityNotFound(_0x59ecdc,null))['then'](function(_0x5d5f28){if(_0x5d5f28){_0xfa12a1=_0x5d5f28[_0x0d72('0x2b')]({'plain':!![]});_0x291592[_0x0d72('0x3a')]=_[_0x0d72('0x37')](db[_0x0d72('0x58')][_0x0d72('0x4c')]);_0x291592[_0x0d72('0x36')]=_[_0x0d72('0x37')](_0xdebaf8['query']);_0x291592[_0x0d72('0x38')]=_['intersection'](_0x291592[_0x0d72('0x3a')],_0x291592[_0x0d72('0x36')]);_0x21ca79[_0x0d72('0x3c')]=_[_0x0d72('0x39')](_0x291592[_0x0d72('0x3a')],qs[_0x0d72('0x3b')](_0xdebaf8[_0x0d72('0x36')][_0x0d72('0x3b')]));_0x21ca79[_0x0d72('0x3c')]=_0x21ca79[_0x0d72('0x3c')][_0x0d72('0x3d')]?_0x21ca79[_0x0d72('0x3c')]:_0x291592['model'];if(!_0xdebaf8['query'][_0x0d72('0x3e')]('nolimit')){_0x21ca79[_0x0d72('0x22')]=qs[_0x0d72('0x22')](_0xdebaf8['query'][_0x0d72('0x22')]);_0x21ca79[_0x0d72('0x20')]=qs[_0x0d72('0x20')](_0xdebaf8[_0x0d72('0x36')]['offset']);}_0x21ca79[_0x0d72('0x40')]=qs['sort'](_0xdebaf8[_0x0d72('0x36')]['sort']);_0x21ca79[_0x0d72('0x43')]=qs[_0x0d72('0x38')](_['pick'](_0xdebaf8[_0x0d72('0x36')],_0x291592[_0x0d72('0x38')]));_0x21ca79['where'][_0x0d72('0x59')]=_0x5d5f28['id'];if(_0xdebaf8[_0x0d72('0x36')][_0x0d72('0x42')]){_0x21ca79[_0x0d72('0x43')]=_[_0x0d72('0x44')](_0x21ca79['where'],{'$or':_[_0x0d72('0x31')](_0x21ca79[_0x0d72('0x3c')],function(_0x49b73c){var _0x2b8016={};_0x2b8016[_0x49b73c]={'$like':'%'+_0xdebaf8[_0x0d72('0x36')][_0x0d72('0x42')]+'%'};return _0x2b8016;})});}_0x21ca79=_[_0x0d72('0x44')]({},_0x21ca79,_0xdebaf8[_0x0d72('0x46')]);return db[_0x0d72('0x58')][_0x0d72('0x5a')](_0x21ca79);}})[_0x0d72('0x2a')](function(_0x4b7019){if(_0x4b7019){return db[_0x0d72('0x5b')][_0x0d72('0x5c')]({'where':{'id':_['map'](_0x4b7019,_0x0d72('0x5d')),'role':_0x0d72('0x5e')},'attributes':['id','name',_0x0d72('0x5f'),_0x0d72('0x60'),_0x0d72('0x61')]});}})[_0x0d72('0x2a')](function(_0x2cc2b7){if(_0x2cc2b7){return{'count':_0x2cc2b7['count'],'rows':_['map'](_0x2cc2b7[_0x0d72('0x48')],function(_0x1d1cce){return{'membername':_0x1d1cce['name'],'UserId':_0x1d1cce['id'],'queue_name':_0xfa12a1[_0x0d72('0x30')],'OpenchannelQueueId':_0xfa12a1['id'],'interface':util['format']('%s/%s',_0x0d72('0x62'),_0x1d1cce[_0x0d72('0x30')]),'penalty':0x0,'paused':_0x1d1cce[_0x0d72('0x5f')],'createdAt':_0x1d1cce['createdAt'],'updatedAt':_0x1d1cce[_0x0d72('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x59ecdc,_0x21ca79))['catch'](handleError(_0x59ecdc,null));};exports[_0x0d72('0x63')]=function(_0x457f85,_0x4804a3,_0x1a99db){var _0x2b3a79={};var _0x11ce9a={};var _0x27f232;var _0x18b09d;return db[_0x0d72('0x32')][_0x0d72('0x57')]({'where':{'id':_0x457f85[_0x0d72('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4804a3,null))[_0x0d72('0x2a')](function(_0x2a0234){if(_0x2a0234){_0x27f232=_0x2a0234;_0x11ce9a[_0x0d72('0x3a')]=_['keys'](db[_0x0d72('0x64')]['rawAttributes']);_0x11ce9a[_0x0d72('0x36')]=_[_0x0d72('0x37')](_0x457f85[_0x0d72('0x36')]);_0x11ce9a[_0x0d72('0x38')]=_[_0x0d72('0x39')](_0x11ce9a['model'],_0x11ce9a['query']);_0x2b3a79['attributes']=_[_0x0d72('0x39')](_0x11ce9a['model'],qs[_0x0d72('0x3b')](_0x457f85['query'][_0x0d72('0x3b')]));_0x2b3a79['attributes']=_0x2b3a79[_0x0d72('0x3c')]['length']?_0x2b3a79[_0x0d72('0x3c')]:_0x11ce9a[_0x0d72('0x3a')];_0x2b3a79[_0x0d72('0x40')]=qs[_0x0d72('0x41')](_0x457f85[_0x0d72('0x36')]['sort']);_0x2b3a79['where']=qs[_0x0d72('0x38')](_[_0x0d72('0x65')](_0x457f85[_0x0d72('0x36')],_0x11ce9a['filters']));if(_0x457f85[_0x0d72('0x36')][_0x0d72('0x42')]){_0x2b3a79[_0x0d72('0x43')]=_[_0x0d72('0x44')](_0x2b3a79[_0x0d72('0x43')],{'$or':_[_0x0d72('0x31')](_0x2b3a79[_0x0d72('0x3c')],function(_0x1e7e83){var _0x52197a={};_0x52197a[_0x1e7e83]={'$like':'%'+_0x457f85['query'][_0x0d72('0x42')]+'%'};return _0x52197a;})});}_0x2b3a79=_['merge']({},_0x2b3a79,_0x457f85[_0x0d72('0x46')]);return _0x27f232[_0x0d72('0x63')](_0x2b3a79);}})[_0x0d72('0x2a')](function(_0x372b56){if(_0x372b56){_0x18b09d=_0x372b56['length'];if(!_0x457f85[_0x0d72('0x36')][_0x0d72('0x3e')](_0x0d72('0x3f'))){_0x2b3a79[_0x0d72('0x22')]=qs[_0x0d72('0x22')](_0x457f85[_0x0d72('0x36')]['limit']);_0x2b3a79[_0x0d72('0x20')]=qs[_0x0d72('0x20')](_0x457f85['query'][_0x0d72('0x20')]);}return _0x27f232[_0x0d72('0x63')](_0x2b3a79);}})[_0x0d72('0x2a')](function(_0x4c6021){if(_0x4c6021){return _0x4c6021?{'count':_0x18b09d,'rows':_0x4c6021}:null;}})[_0x0d72('0x2a')](respondWithResult(_0x4804a3,null))[_0x0d72('0x49')](handleError(_0x4804a3,null));};exports[_0x0d72('0x66')]=function(_0x2842cf,_0x472a3a,_0x320382){var _0x5d4d87=_0x2842cf[_0x0d72('0x50')][_0x0d72('0x67')];return db[_0x0d72('0x64')]['findAll']({'where':{'id':_0x5d4d87},'attributes':['id'],'include':[{'model':db[_0x0d72('0x5b')],'as':_0x0d72('0x68'),'attributes':['id',_0x0d72('0x30'),_0x0d72('0x69'),_0x0d72('0x6a'),_0x0d72('0x6b')],'raw':!![]}]})[_0x0d72('0x2a')](function(_0x468a20){if(_0x468a20){var _0x26ceee=_[_0x0d72('0x6c')](_0x468a20,function(_0x38fc78){var _0x122365=_0x38fc78[_0x0d72('0x2b')]({'plain':!![]});return _0x122365['Agents'];});return db[_0x0d72('0x32')][_0x0d72('0x4e')]({'where':{'id':_0x2842cf[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](function(_0x4fd1bc){return db[_0x0d72('0x6d')][_0x0d72('0x6e')](function(_0xc1dfc0){return _0x4fd1bc[_0x0d72('0x66')](_0x5d4d87,{'transaction':_0xc1dfc0})['then'](function(){return BPromise[_0x0d72('0x6f')](_0x26ceee,function(_0x4d641e){return db[_0x0d72('0x58')][_0x0d72('0x70')]({'where':{'UserId':_0x4d641e['id'],'OpenchannelQueueId':_0x2842cf[_0x0d72('0x4b')]['id']},'transaction':_0xc1dfc0});});})[_0x0d72('0x2a')](function(){_0x26ceee[_0x0d72('0x71')](function(_0x1b1563){socket[_0x0d72('0x72')]('userOpenchannelQueue:save',{'UserId':_0x1b1563['id'],'OpenchannelQueueId':_0x4fd1bc['id']});});});});});}})[_0x0d72('0x2a')](respondWithStatusCode(_0x472a3a,null))[_0x0d72('0x49')](handleError(_0x472a3a,null));};exports[_0x0d72('0x73')]=function(_0x2d2eec,_0x2930c6,_0x2f8167){return db[_0x0d72('0x64')]['findAll']({'where':{'id':_0x2d2eec[_0x0d72('0x36')][_0x0d72('0x67')]},'attributes':['id'],'include':[{'model':db[_0x0d72('0x5b')],'as':_0x0d72('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2930c6,null))[_0x0d72('0x2a')](function(_0x41d81c){var _0x952803=_[_0x0d72('0x31')](_0x41d81c,'id');var _0x36fb4c=[];var _0x501cd6=[];var _0x4c9214=squel[_0x0d72('0x74')]();_0x4c9214['field'](_0x0d72('0x75'))['from']('team_has_openchannel_queues','tq')[_0x0d72('0x76')](_0x0d72('0x77'),'ut',_0x0d72('0x78'))['where'](_0x0d72('0x79'),_0x2d2eec[_0x0d72('0x4b')]['id']);for(var _0x2e3aec=0x0;_0x2e3aec<_0x41d81c[_0x0d72('0x3d')];_0x2e3aec+=0x1){let _0x8a0cd4=_0x41d81c[_0x2e3aec];for(var _0x3cfb40=0x0;_0x3cfb40<_0x8a0cd4[_0x0d72('0x68')]['length'];_0x3cfb40+=0x1){let _0x25d13b=_0x8a0cd4[_0x0d72('0x68')][_0x3cfb40];var _0x5f4442=_0x4c9214[_0x0d72('0x7a')]();_0x5f4442[_0x0d72('0x43')](_0x0d72('0x7b'),_0x25d13b['id']);_0x501cd6[_0x0d72('0x7c')](db[_0x0d72('0x6d')][_0x0d72('0x36')](_0x5f4442['toString'](),{'type':db[_0x0d72('0x6d')][_0x0d72('0x7d')][_0x0d72('0x7e')]})[_0x0d72('0x2a')](function(_0x460015){if(_0x460015[_0x0d72('0x3d')]===0x1){return _0x25d13b['id'];}else{var _0x440dc0=_[_0x0d72('0x7f')](_[_0x0d72('0x31')](_0x460015,_0x0d72('0x80')),function(_0xd1f029){return _[_0x0d72('0x81')](_0x952803,_0xd1f029);});if(_0x440dc0){return _0x25d13b['id'];}}}));}}return BPromise[_0x0d72('0x82')](_0x501cd6)['then'](function(_0x36f812){_0x36fb4c=_(_0x36fb4c)[_0x0d72('0x83')](_0x36f812)[_0x0d72('0x84')]()[_0x0d72('0x85')]();return db[_0x0d72('0x32')][_0x0d72('0x4e')]({'where':{'id':_0x2d2eec[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](function(_0x1b6585){return db['sequelize'][_0x0d72('0x6e')](function(_0x31d9f9){return _0x1b6585[_0x0d72('0x73')](_0x2d2eec[_0x0d72('0x36')][_0x0d72('0x67')],{'transaction':_0x31d9f9})[_0x0d72('0x2a')](function(){if(!_['isEmpty'](_0x36fb4c)){return _0x1b6585[_0x0d72('0x86')](_0x36fb4c,{'transaction':_0x31d9f9});}})[_0x0d72('0x2a')](function(){_0x36fb4c[_0x0d72('0x71')](function(_0x4ba13e){socket[_0x0d72('0x72')](_0x0d72('0x87'),{'UserId':_0x4ba13e,'OpenchannelQueueId':_0x1b6585['id']});});});});});});})[_0x0d72('0x2a')](respondWithStatusCode(_0x2930c6,null))[_0x0d72('0x49')](handleError(_0x2930c6,null));};exports[_0x0d72('0x88')]=function(_0x1df5a2,_0x3607b7,_0xaa7b0f){return db[_0x0d72('0x32')][_0x0d72('0x4e')]({'where':{'id':_0x1df5a2[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](handleEntityNotFound(_0x3607b7,null))[_0x0d72('0x2a')](function(_0x8b0838){if(_0x8b0838){return _0x8b0838[_0x0d72('0x88')](_0x1df5a2[_0x0d72('0x50')][_0x0d72('0x67')],_[_0x0d72('0x89')](_0x1df5a2[_0x0d72('0x50')],[_0x0d72('0x67'),'id'])||{})[_0x0d72('0x8a')](function(_0x26b932){for(var _0x3f3c6d=0x0;_0x3f3c6d<_0x1df5a2[_0x0d72('0x50')][_0x0d72('0x67')]['length'];_0x3f3c6d+=0x1){socket[_0x0d72('0x72')]('userOpenchannelQueue:save',{'UserId':Number(_0x1df5a2['body']['ids'][_0x3f3c6d]),'OpenchannelQueueId':Number(_0x1df5a2[_0x0d72('0x4b')]['id'])});}return _0x26b932;});}})[_0x0d72('0x2a')](respondWithResult(_0x3607b7,null))[_0x0d72('0x49')](handleError(_0x3607b7,null));};exports[_0x0d72('0x86')]=function(_0x6a196,_0x29dff6,_0x78978f){return db[_0x0d72('0x32')][_0x0d72('0x4e')]({'where':{'id':_0x6a196[_0x0d72('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29dff6,null))[_0x0d72('0x2a')](function(_0x2c8164){if(_0x2c8164){return _0x2c8164[_0x0d72('0x86')](_0x6a196[_0x0d72('0x36')]['ids'])['then'](function(){if(_[_0x0d72('0x8b')](_0x6a196[_0x0d72('0x36')][_0x0d72('0x67')])){for(var _0x403bee=0x0;_0x403bee<_0x6a196[_0x0d72('0x36')]['ids']['length'];_0x403bee+=0x1){socket[_0x0d72('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x6a196['query'][_0x0d72('0x67')][_0x403bee]),'OpenchannelQueueId':Number(_0x6a196[_0x0d72('0x4b')]['id'])});}}else{socket[_0x0d72('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x6a196[_0x0d72('0x36')][_0x0d72('0x67')]),'OpenchannelQueueId':Number(_0x6a196[_0x0d72('0x4b')]['id'])});}});}})[_0x0d72('0x2a')](respondWithStatusCode(_0x29dff6,null))['catch'](handleError(_0x29dff6,null));};exports[_0x0d72('0x8c')]=function(_0x298211,_0x3ac686,_0x39fc9c){var _0x32ea53={};var _0x53367e={};var _0xff625f;var _0x20b619;return db[_0x0d72('0x32')][_0x0d72('0x57')]({'where':{'id':_0x298211[_0x0d72('0x4b')]['id']}})[_0x0d72('0x2a')](handleEntityNotFound(_0x3ac686,null))[_0x0d72('0x2a')](function(_0xc8f3b1){if(_0xc8f3b1){_0xff625f=_0xc8f3b1;_0x53367e[_0x0d72('0x3a')]=_[_0x0d72('0x37')](db[_0x0d72('0x5b')][_0x0d72('0x4c')]);_0x53367e[_0x0d72('0x36')]=_[_0x0d72('0x37')](_0x298211[_0x0d72('0x36')]);_0x53367e[_0x0d72('0x38')]=_[_0x0d72('0x39')](_0x53367e[_0x0d72('0x3a')],_0x53367e['query']);_0x32ea53[_0x0d72('0x3c')]=_['intersection'](_0x53367e[_0x0d72('0x3a')],qs[_0x0d72('0x3b')](_0x298211['query']['fields']));_0x32ea53[_0x0d72('0x3c')]=_0x32ea53['attributes'][_0x0d72('0x3d')]?_0x32ea53['attributes']:_0x53367e[_0x0d72('0x3a')];_0x32ea53['order']=qs[_0x0d72('0x41')](_0x298211['query'][_0x0d72('0x41')]);_0x32ea53[_0x0d72('0x43')]=qs[_0x0d72('0x38')](_[_0x0d72('0x65')](_0x298211[_0x0d72('0x36')],_0x53367e[_0x0d72('0x38')]));if(_0x298211[_0x0d72('0x36')][_0x0d72('0x42')]){_0x32ea53[_0x0d72('0x43')]=_[_0x0d72('0x44')](_0x32ea53['where'],{'$or':_['map'](_0x32ea53[_0x0d72('0x3c')],function(_0x35443d){var _0x4ba97c={};_0x4ba97c[_0x35443d]={'$like':'%'+_0x298211['query']['filter']+'%'};return _0x4ba97c;})});}_0x32ea53=_[_0x0d72('0x44')]({},_0x32ea53,_0x298211[_0x0d72('0x46')]);return _0xff625f[_0x0d72('0x8c')](_0x32ea53);}})[_0x0d72('0x2a')](function(_0x7b1345){if(_0x7b1345){_0x20b619=_0x7b1345[_0x0d72('0x3d')];if(!_0x298211[_0x0d72('0x36')]['hasOwnProperty'](_0x0d72('0x3f'))){_0x32ea53[_0x0d72('0x22')]=qs[_0x0d72('0x22')](_0x298211[_0x0d72('0x36')][_0x0d72('0x22')]);_0x32ea53[_0x0d72('0x20')]=qs[_0x0d72('0x20')](_0x298211[_0x0d72('0x36')][_0x0d72('0x20')]);}return _0xff625f[_0x0d72('0x8c')](_0x32ea53);}})[_0x0d72('0x2a')](function(_0x3e5491){if(_0x3e5491){return _0x3e5491?{'count':_0x20b619,'rows':_0x3e5491}:null;}})[_0x0d72('0x2a')](respondWithResult(_0x3ac686,null))[_0x0d72('0x49')](handleError(_0x3ac686,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 57ae612..d178760 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 _0xe2d2=['update','emit','hook','exports','events','setMaxListeners','save'];(function(_0x245253,_0x2226d3){var _0x4128fa=function(_0x1fb383){while(--_0x1fb383){_0x245253['push'](_0x245253['shift']());}};_0x4128fa(++_0x2226d3);}(_0xe2d2,0x1bd));var _0x2e2d=function(_0x35d372,_0x326e9f){_0x35d372=_0x35d372-0x0;var _0x15de21=_0xe2d2[_0x35d372];return _0x15de21;};'use strict';var EventEmitter=require(_0x2e2d('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2e2d('0x1')](0x0);var events={'afterCreate':_0x2e2d('0x2'),'afterUpdate':_0x2e2d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54be1b){return function(_0x336d06,_0x446142,_0x44bddd){OpenchannelQueueEvents['emit'](_0x54be1b+':'+_0x336d06['id'],_0x336d06);OpenchannelQueueEvents[_0x2e2d('0x4')](_0x54be1b,_0x336d06);_0x44bddd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x2e2d('0x5')](e,emitEvent(event));}}module[_0x2e2d('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x44eb=['events','../../mysqldb','OpenchannelQueue','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x11698c,_0x5949fa){var _0x14d2bd=function(_0x4d5cb0){while(--_0x4d5cb0){_0x11698c['push'](_0x11698c['shift']());}};_0x14d2bd(++_0x5949fa);}(_0x44eb,0x14d));var _0xb44e=function(_0xdb5423,_0x10b500){_0xdb5423=_0xdb5423-0x0;var _0x3beb17=_0x44eb[_0xdb5423];return _0x3beb17;};'use strict';var EventEmitter=require(_0xb44e('0x0'));var OpenchannelQueue=require(_0xb44e('0x1'))['db'][_0xb44e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb44e('0x3'),'afterUpdate':_0xb44e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x962eed){return function(_0x19a92b,_0x8af2da,_0x43e88e){OpenchannelQueueEvents['emit'](_0x962eed+':'+_0x19a92b['id'],_0x19a92b);OpenchannelQueueEvents[_0xb44e('0x5')](_0x962eed,_0x19a92b);_0x43e88e(null);};}for(var e in events){if(events[_0xb44e('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb44e('0x7')](e,emitEvent(event));}}module[_0xb44e('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index afb1eb2..212ec47 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 _0x6342=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','api','bluebird','request-promise'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x6342,0xee));var _0x2634=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0x6342[_0x374954];return _0x42073e;};'use strict';var _=require('lodash');var util=require(_0x2634('0x0'));var logger=require('../../config/logger')(_0x2634('0x1'));var moment=require('moment');var BPromise=require(_0x2634('0x2'));var rp=require(_0x2634('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2634('0x4'));var config=require(_0x2634('0x5'));var attributes=require(_0x2634('0x6'));module[_0x2634('0x7')]=function(_0x3c39c8,_0x8754b2){return _0x3c39c8[_0x2634('0x8')](_0x2634('0x9'),attributes,{'tableName':_0x2634('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aea=['request-promise','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x440daa,_0x220dd4){var _0x21903a=function(_0x5e65ef){while(--_0x5e65ef){_0x440daa['push'](_0x440daa['shift']());}};_0x21903a(++_0x220dd4);}(_0x1aea,0xdf));var _0xa1ae=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x1aea[_0x1fb7d1];return _0x2480d8;};'use strict';var _=require(_0xa1ae('0x0'));var util=require('util');var logger=require(_0xa1ae('0x1'))(_0xa1ae('0x2'));var moment=require(_0xa1ae('0x3'));var BPromise=require(_0xa1ae('0x4'));var rp=require(_0xa1ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa1ae('0x6'));var attributes=require(_0xa1ae('0x7'));module[_0xa1ae('0x8')]=function(_0x1c9069,_0x474ae6){return _0x1c9069[_0xa1ae('0x9')](_0xa1ae('0xa'),attributes,{'tableName':_0xa1ae('0xb'),'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 2a42b9a..23e7f1c 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 _0x542c=['result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','then','stringify','ShowOpenchannelQueue','find','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x3e3936,_0x24c3a6){var _0x10be4e=function(_0x271a5d){while(--_0x271a5d){_0x3e3936['push'](_0x3e3936['shift']());}};_0x10be4e(++_0x24c3a6);}(_0x542c,0x148));var _0xc542=function(_0x5f3936,_0x168ce5){_0x5f3936=_0x5f3936-0x0;var _0x22a242=_0x542c[_0x5f3936];return _0x22a242;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc542('0x0'));var rs=require(_0xc542('0x1'));var fs=require('fs');var Redis=require(_0xc542('0x2'));var db=require(_0xc542('0x3'))['db'];var utils=require(_0xc542('0x4'));var logger=require(_0xc542('0x5'))('rpc');var config=require(_0xc542('0x6'));var jayson=require(_0xc542('0x7'));var client=jayson[_0xc542('0x8')][_0xc542('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc542('0xa'),'port':0x18eb});var socket=require(_0xc542('0xb'))(new Redis(config[_0xc542('0xc')]));require(_0xc542('0xd'))[_0xc542('0xe')](socket);function respondWithRpcPromise(_0x44a49d,_0x591b8e,_0x12dad2){return new BPromise(function(_0x5b885b,_0x51bbc9){return client[_0xc542('0xf')](_0x44a49d,_0x12dad2)['then'](function(_0x1bbeed){logger['info'](_0xc542('0x10'),_0x591b8e,_0xc542('0x11'));logger[_0xc542('0x12')](_0xc542('0x13'),_0x591b8e,_0xc542('0x11'),JSON['stringify'](_0x1bbeed));if(_0x1bbeed[_0xc542('0x14')]){if(_0x1bbeed['error']['code']===0x1f4){logger[_0xc542('0x14')](_0xc542('0x10'),_0x591b8e,_0x1bbeed['error']['message']);return _0x51bbc9(_0x1bbeed['error'][_0xc542('0x15')]);}logger[_0xc542('0x14')](_0xc542('0x10'),_0x591b8e,_0x1bbeed['error'][_0xc542('0x15')]);return _0x5b885b(_0x1bbeed[_0xc542('0x14')]['message']);}else{logger[_0xc542('0x16')](_0xc542('0x10'),_0x591b8e,_0xc542('0x11'));_0x5b885b(_0x1bbeed[_0xc542('0x17')]['message']);}})[_0xc542('0x18')](function(_0x2fb852){logger[_0xc542('0x14')](_0xc542('0x10'),_0x591b8e,_0x2fb852);_0x51bbc9(_0x2fb852);});});}exports[_0xc542('0x19')]=function(_0x388565){var _0x215d61=this;return new Promise(function(_0x3c470a,_0x1b431b){return db[_0xc542('0x1a')][_0xc542('0x1b')]({'raw':_0x388565['options']?_0x388565[_0xc542('0x1c')][_0xc542('0x1d')]===undefined?!![]:![]:!![],'where':_0x388565['options']?_0x388565[_0xc542('0x1c')][_0xc542('0x1e')]||null:null,'attributes':_0x388565['options']?_0x388565[_0xc542('0x1c')][_0xc542('0x1f')]||null:null,'limit':_0x388565[_0xc542('0x1c')]?_0x388565[_0xc542('0x1c')]['limit']||null:null,'include':_0x388565[_0xc542('0x1c')]?_0x388565['options'][_0xc542('0x20')]?_[_0xc542('0x21')](_0x388565[_0xc542('0x1c')]['include'],function(_0x3687fd){return{'model':db[_0x3687fd['model']],'as':_0x3687fd['as'],'attributes':_0x3687fd['attributes'],'include':_0x3687fd[_0xc542('0x20')]?_[_0xc542('0x21')](_0x3687fd[_0xc542('0x20')],function(_0x12eb0b){return{'model':db[_0x12eb0b[_0xc542('0x22')]],'as':_0x12eb0b['as'],'attributes':_0x12eb0b[_0xc542('0x1f')],'include':_0x12eb0b[_0xc542('0x20')]?_[_0xc542('0x21')](_0x12eb0b[_0xc542('0x20')],function(_0x578e7b){return{'model':db[_0x578e7b[_0xc542('0x22')]],'as':_0x578e7b['as'],'attributes':_0x578e7b[_0xc542('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc542('0x23')](function(_0x143f1c){logger[_0xc542('0x16')]('GetOpenchannelQueue',_0x388565);logger['debug'](_0xc542('0x19'),_0x388565,JSON[_0xc542('0x24')](_0x143f1c));_0x3c470a(_0x143f1c);})[_0xc542('0x18')](function(_0x98e495){logger[_0xc542('0x14')]('GetOpenchannelQueue',_0x98e495['message'],_0x388565);_0x1b431b(_0x215d61[_0xc542('0x14')](0x1f4,_0x98e495[_0xc542('0x15')]));});});};exports[_0xc542('0x25')]=function(_0x1eb59b){var _0x5b2f9d=this;return new Promise(function(_0x2c190c,_0x45f6ca){return db[_0xc542('0x1a')][_0xc542('0x26')]({'raw':_0x1eb59b[_0xc542('0x1c')]?_0x1eb59b[_0xc542('0x1c')][_0xc542('0x1d')]===undefined?!![]:![]:!![],'where':_0x1eb59b[_0xc542('0x1c')]?_0x1eb59b[_0xc542('0x1c')]['where']||null:null,'attributes':_0x1eb59b[_0xc542('0x1c')]?_0x1eb59b[_0xc542('0x1c')][_0xc542('0x1f')]||null:null,'include':_0x1eb59b['options']?_0x1eb59b['options'][_0xc542('0x20')]?_[_0xc542('0x21')](_0x1eb59b[_0xc542('0x1c')]['include'],function(_0x309dff){return{'model':db[_0x309dff[_0xc542('0x22')]],'as':_0x309dff['as'],'attributes':_0x309dff['attributes'],'include':_0x309dff[_0xc542('0x20')]?_[_0xc542('0x21')](_0x309dff[_0xc542('0x20')],function(_0x4e4215){return{'model':db[_0x4e4215[_0xc542('0x22')]],'as':_0x4e4215['as'],'attributes':_0x4e4215[_0xc542('0x1f')],'include':_0x4e4215[_0xc542('0x20')]?_['map'](_0x4e4215[_0xc542('0x20')],function(_0x161613){return{'model':db[_0x161613['model']],'as':_0x161613['as'],'attributes':_0x161613[_0xc542('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc542('0x23')](function(_0x11d1e5){logger['info']('ShowOpenchannelQueue',_0x1eb59b);logger[_0xc542('0x12')](_0xc542('0x25'),_0x1eb59b,JSON[_0xc542('0x24')](_0x11d1e5));_0x2c190c(_0x11d1e5);})[_0xc542('0x18')](function(_0x49f1d1){logger[_0xc542('0x14')](_0xc542('0x25'),_0x49f1d1['message'],_0x1eb59b);_0x45f6ca(_0x5b2f9d[_0xc542('0x14')](0x1f4,_0x49f1d1['message']));});});}; \ No newline at end of file +var _0x66a3=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','model','include','map','debug','OpenchannelQueue','find','raw'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x66a3,0x197));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x366a('0x0'));var moment=require(_0x366a('0x1'));var BPromise=require('bluebird');var rs=require(_0x366a('0x2'));var fs=require('fs');var Redis=require(_0x366a('0x3'));var db=require(_0x366a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x366a('0x5'));var config=require(_0x366a('0x6'));var jayson=require(_0x366a('0x7'));var client=jayson['client'][_0x366a('0x8')]({'port':0x232a});config[_0x366a('0x9')]=_[_0x366a('0xa')](config[_0x366a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x366a('0xb'))(new Redis(config['redis']));require(_0x366a('0xc'))[_0x366a('0xd')](socket);function respondWithRpcPromise(_0xdcf713,_0x167005,_0x1a2afd){return new BPromise(function(_0x39aafc,_0x41cbaa){return client[_0x366a('0xe')](_0xdcf713,_0x1a2afd)[_0x366a('0xf')](function(_0x535214){logger[_0x366a('0x10')](_0x366a('0x11'),_0x167005,'request\x20sent');logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x167005,'request\x20sent',JSON[_0x366a('0x12')](_0x535214));if(_0x535214['error']){if(_0x535214[_0x366a('0x13')]['code']===0x1f4){logger['error'](_0x366a('0x11'),_0x167005,_0x535214[_0x366a('0x13')][_0x366a('0x14')]);return _0x41cbaa(_0x535214['error'][_0x366a('0x14')]);}logger[_0x366a('0x13')](_0x366a('0x11'),_0x167005,_0x535214[_0x366a('0x13')][_0x366a('0x14')]);return _0x39aafc(_0x535214[_0x366a('0x13')][_0x366a('0x14')]);}else{logger[_0x366a('0x10')](_0x366a('0x11'),_0x167005,_0x366a('0x15'));_0x39aafc(_0x535214[_0x366a('0x16')][_0x366a('0x14')]);}})[_0x366a('0x17')](function(_0x477c8b){logger[_0x366a('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x167005,_0x477c8b);_0x41cbaa(_0x477c8b);});});}exports[_0x366a('0x18')]=function(_0x9b7f47){var _0x3d7f0b=this;return new Promise(function(_0x367ac6,_0x344913){return db['OpenchannelQueue'][_0x366a('0x19')]({'raw':_0x9b7f47['options']?_0x9b7f47[_0x366a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x9b7f47[_0x366a('0x1a')]?_0x9b7f47[_0x366a('0x1a')][_0x366a('0x1b')]||null:null,'attributes':_0x9b7f47[_0x366a('0x1a')]?_0x9b7f47[_0x366a('0x1a')][_0x366a('0x1c')]||null:null,'limit':_0x9b7f47[_0x366a('0x1a')]?_0x9b7f47[_0x366a('0x1a')][_0x366a('0x1d')]||null:null,'include':_0x9b7f47['options']?_0x9b7f47[_0x366a('0x1a')]['include']?_['map'](_0x9b7f47[_0x366a('0x1a')]['include'],function(_0x5612a5){return{'model':db[_0x5612a5[_0x366a('0x1e')]],'as':_0x5612a5['as'],'attributes':_0x5612a5['attributes'],'include':_0x5612a5[_0x366a('0x1f')]?_[_0x366a('0x20')](_0x5612a5[_0x366a('0x1f')],function(_0x423235){return{'model':db[_0x423235[_0x366a('0x1e')]],'as':_0x423235['as'],'attributes':_0x423235['attributes'],'include':_0x423235[_0x366a('0x1f')]?_[_0x366a('0x20')](_0x423235[_0x366a('0x1f')],function(_0x193398){return{'model':db[_0x193398['model']],'as':_0x193398['as'],'attributes':_0x193398[_0x366a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x366a('0xf')](function(_0x3a6132){logger[_0x366a('0x10')](_0x366a('0x18'),_0x9b7f47);logger[_0x366a('0x21')](_0x366a('0x18'),_0x9b7f47,JSON[_0x366a('0x12')](_0x3a6132));_0x367ac6(_0x3a6132);})['catch'](function(_0x4767a9){logger[_0x366a('0x13')](_0x366a('0x18'),_0x4767a9[_0x366a('0x14')],_0x9b7f47);_0x344913(_0x3d7f0b[_0x366a('0x13')](0x1f4,_0x4767a9[_0x366a('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x32da9e){var _0xc8b44a=this;return new Promise(function(_0x393f50,_0x18d45f){return db[_0x366a('0x22')][_0x366a('0x23')]({'raw':_0x32da9e[_0x366a('0x1a')]?_0x32da9e[_0x366a('0x1a')][_0x366a('0x24')]===undefined?!![]:![]:!![],'where':_0x32da9e[_0x366a('0x1a')]?_0x32da9e['options'][_0x366a('0x1b')]||null:null,'attributes':_0x32da9e['options']?_0x32da9e['options'][_0x366a('0x1c')]||null:null,'include':_0x32da9e[_0x366a('0x1a')]?_0x32da9e[_0x366a('0x1a')][_0x366a('0x1f')]?_['map'](_0x32da9e['options'][_0x366a('0x1f')],function(_0x591a33){return{'model':db[_0x591a33['model']],'as':_0x591a33['as'],'attributes':_0x591a33[_0x366a('0x1c')],'include':_0x591a33[_0x366a('0x1f')]?_[_0x366a('0x20')](_0x591a33[_0x366a('0x1f')],function(_0x252cd1){return{'model':db[_0x252cd1[_0x366a('0x1e')]],'as':_0x252cd1['as'],'attributes':_0x252cd1[_0x366a('0x1c')],'include':_0x252cd1[_0x366a('0x1f')]?_[_0x366a('0x20')](_0x252cd1[_0x366a('0x1f')],function(_0x3dabb6){return{'model':db[_0x3dabb6['model']],'as':_0x3dabb6['as'],'attributes':_0x3dabb6[_0x366a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17c12c){logger['info']('ShowOpenchannelQueue',_0x32da9e);logger[_0x366a('0x21')]('ShowOpenchannelQueue',_0x32da9e,JSON[_0x366a('0x12')](_0x17c12c));_0x393f50(_0x17c12c);})[_0x366a('0x17')](function(_0x2c21e0){logger['error']('ShowOpenchannelQueue',_0x2c21e0['message'],_0x32da9e);_0x18d45f(_0xc8b44a[_0x366a('0x13')](0x1f4,_0x2c21e0[_0x366a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e7bddf9..e80a1d2 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 _0xfb9c=['removeListener','register','length','openchannelQueue:','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb9c,0xb2));var _0xcfb9=function(_0x51168f,_0x27f5ae){_0x51168f=_0x51168f-0x0;var _0x276ee6=_0xfb9c[_0x51168f];return _0x276ee6;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xcfb9('0x0'),'remove','update'];function createListener(_0xb2b6a5,_0x16cc77){return function(_0x17666){_0x16cc77[_0xcfb9('0x1')](_0xb2b6a5,_0x17666);};}function removeListener(_0x2ace15,_0x1b01c5){return function(){OpenchannelQueueEvents[_0xcfb9('0x2')](_0x2ace15,_0x1b01c5);};}exports[_0xcfb9('0x3')]=function(_0x5c23d9){for(var _0x55e5f2=0x0,_0x21df34=events[_0xcfb9('0x4')];_0x55e5f2<_0x21df34;_0x55e5f2++){var _0x20cda9=events[_0x55e5f2];var _0xa51fe0=createListener(_0xcfb9('0x5')+_0x20cda9,_0x5c23d9);OpenchannelQueueEvents['on'](_0x20cda9,_0xa51fe0);}}; \ No newline at end of file +var _0x8a29=['removeListener','register','openchannelQueue:','./openchannelQueue.events','remove','update','emit'];(function(_0x3cf32b,_0x1a9d49){var _0x4dff87=function(_0x5aeefc){while(--_0x5aeefc){_0x3cf32b['push'](_0x3cf32b['shift']());}};_0x4dff87(++_0x1a9d49);}(_0x8a29,0x15a));var _0x98a2=function(_0x2f9304,_0xd457ef){_0x2f9304=_0x2f9304-0x0;var _0x3ffdd3=_0x8a29[_0x2f9304];return _0x3ffdd3;};'use strict';var OpenchannelQueueEvents=require(_0x98a2('0x0'));var events=['save',_0x98a2('0x1'),_0x98a2('0x2')];function createListener(_0x548c90,_0x309dcb){return function(_0x33f67c){_0x309dcb[_0x98a2('0x3')](_0x548c90,_0x33f67c);};}function removeListener(_0x17a366,_0x1e361c){return function(){OpenchannelQueueEvents[_0x98a2('0x4')](_0x17a366,_0x1e361c);};}exports[_0x98a2('0x5')]=function(_0x239f2b){for(var _0x3618a0=0x0,_0x596729=events['length'];_0x3618a0<_0x596729;_0x3618a0++){var _0x1eaf39=events[_0x3618a0];var _0xdabf74=createListener(_0x98a2('0x6')+_0x1eaf39,_0x239f2b);OpenchannelQueueEvents['on'](_0x1eaf39,_0xdabf74);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 090baf7..6c0e67c 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 _0xaa9c=['./openchannelQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x20a1b0,_0x18fe84){var _0x321e14=function(_0x69fdf6){while(--_0x69fdf6){_0x20a1b0['push'](_0x20a1b0['shift']());}};_0x321e14(++_0x18fe84);}(_0xaa9c,0x160));var _0xcaa9=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xaa9c[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var path=require(_0xcaa9('0x2'));var timeout=require('connect-timeout');var express=require(_0xcaa9('0x3'));var router=express[_0xcaa9('0x4')]();var fs_extra=require(_0xcaa9('0x5'));var auth=require(_0xcaa9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcaa9('0x7'));var controller=require(_0xcaa9('0x8'));router[_0xcaa9('0x9')]('/',auth[_0xcaa9('0xa')](),controller[_0xcaa9('0xb')]);router[_0xcaa9('0x9')]('/describe',auth[_0xcaa9('0xa')](),controller[_0xcaa9('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcaa9('0xd')]);router[_0xcaa9('0xe')]('/',auth['isAuthenticated'](),controller[_0xcaa9('0xf')]);router[_0xcaa9('0x10')](_0xcaa9('0x11'),auth[_0xcaa9('0xa')](),controller['update']);router['delete'](_0xcaa9('0x11'),auth[_0xcaa9('0xa')](),controller[_0xcaa9('0x12')]);module[_0xcaa9('0x13')]=router; \ No newline at end of file +var _0x3f98=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x519d5a,_0x573c67){var _0xc7270f=function(_0x2ad5a3){while(--_0x2ad5a3){_0x519d5a['push'](_0x519d5a['shift']());}};_0xc7270f(++_0x573c67);}(_0x3f98,0xbe));var _0x83f9=function(_0x1186c3,_0x5c292b){_0x1186c3=_0x1186c3-0x0;var _0x3f6b87=_0x3f98[_0x1186c3];return _0x3f6b87;};'use strict';var multer=require(_0x83f9('0x0'));var util=require('util');var path=require(_0x83f9('0x1'));var timeout=require(_0x83f9('0x2'));var express=require('express');var router=express[_0x83f9('0x3')]();var fs_extra=require(_0x83f9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x83f9('0x5'));var config=require('../../config/environment');var controller=require(_0x83f9('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x83f9('0x7')]);router[_0x83f9('0x8')](_0x83f9('0x9'),auth['isAuthenticated'](),controller[_0x83f9('0xa')]);router[_0x83f9('0x8')](_0x83f9('0xb'),auth[_0x83f9('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x83f9('0xd')]);router[_0x83f9('0xe')](_0x83f9('0xb'),auth[_0x83f9('0xc')](),controller[_0x83f9('0xf')]);router[_0x83f9('0x10')](_0x83f9('0xb'),auth[_0x83f9('0xc')](),controller[_0x83f9('0x11')]);module[_0x83f9('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c1962ad..c72e2cd 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 _0xf613=['STRING','DATE','moment','sequelize','exports'];(function(_0x160e0e,_0x3e4cee){var _0x512232=function(_0x2c006c){while(--_0x2c006c){_0x160e0e['push'](_0x160e0e['shift']());}};_0x512232(++_0x3e4cee);}(_0xf613,0x70));var _0x3f61=function(_0x3c5a33,_0x1090de){_0x3c5a33=_0x3c5a33-0x0;var _0x190505=_0xf613[_0x3c5a33];return _0x190505;};'use strict';var moment=require(_0x3f61('0x0'));var Sequelize=require(_0x3f61('0x1'));module[_0x3f61('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3f61('0x3')]},'joinAt':{'type':Sequelize[_0x3f61('0x4')]},'leaveAt':{'type':Sequelize[_0x3f61('0x4')]},'acceptAt':{'type':Sequelize[_0x3f61('0x4')]},'exitAt':{'type':Sequelize[_0x3f61('0x4')]},'reason':{'type':Sequelize[_0x3f61('0x3')]}}; \ No newline at end of file +var _0x5100=['sequelize','STRING','DATE','moment'];(function(_0x13f092,_0x2c737d){var _0x1e4b6f=function(_0x2be09b){while(--_0x2be09b){_0x13f092['push'](_0x13f092['shift']());}};_0x1e4b6f(++_0x2c737d);}(_0x5100,0x1bf));var _0x0510=function(_0x2215c2,_0xc39a17){_0x2215c2=_0x2215c2-0x0;var _0x40ba4f=_0x5100[_0x2215c2];return _0x40ba4f;};'use strict';var moment=require(_0x0510('0x0'));var Sequelize=require(_0x0510('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0510('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0510('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0510('0x3')]},'exitAt':{'type':Sequelize[_0x0510('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 cf24a9d..766a06f 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 _0x23c7=['rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','destroy','then','end','name','send','map'];(function(_0xf78031,_0x27c1d5){var _0xed5c94=function(_0x240e46){while(--_0x240e46){_0xf78031['push'](_0xf78031['shift']());}};_0xed5c94(++_0x27c1d5);}(_0x23c7,0x6e));var _0x723c=function(_0x2bf58a,_0x3c7d59){_0x2bf58a=_0x2bf58a-0x0;var _0x264912=_0x23c7[_0x2bf58a];return _0x264912;};'use strict';var emlformat=require(_0x723c('0x0'));var rimraf=require(_0x723c('0x1'));var zipdir=require(_0x723c('0x2'));var jsonpatch=require(_0x723c('0x3'));var rp=require(_0x723c('0x4'));var moment=require(_0x723c('0x5'));var BPromise=require(_0x723c('0x6'));var Mustache=require(_0x723c('0x7'));var util=require(_0x723c('0x8'));var path=require(_0x723c('0x9'));var sox=require(_0x723c('0xa'));var csv=require(_0x723c('0xb'));var ejs=require(_0x723c('0xc'));var fs=require('fs');var fs_extra=require(_0x723c('0xd'));var _=require('lodash');var squel=require(_0x723c('0xe'));var crypto=require(_0x723c('0xf'));var jsforce=require(_0x723c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x723c('0xb'));var querystring=require(_0x723c('0x11'));var Papa=require(_0x723c('0x12'));var Redis=require(_0x723c('0x13'));var authService=require(_0x723c('0x14'));var qs=require(_0x723c('0x15'));var as=require(_0x723c('0x16'));var hardwareService=require(_0x723c('0x17'));var logger=require(_0x723c('0x18'))(_0x723c('0x19'));var utils=require(_0x723c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x723c('0x1b'));var db=require(_0x723c('0x1c'))['db'];function respondWithStatusCode(_0x1cc9dc,_0x4018b0){_0x4018b0=_0x4018b0||0xcc;return function(_0x267b9c){if(_0x267b9c){return _0x1cc9dc[_0x723c('0x1d')](_0x4018b0);}return _0x1cc9dc['status'](_0x4018b0)['end']();};}function respondWithResult(_0x423797,_0x7ddc60){_0x7ddc60=_0x7ddc60||0xc8;return function(_0xc27c87){if(_0xc27c87){return _0x423797['status'](_0x7ddc60)[_0x723c('0x1e')](_0xc27c87);}};}function respondWithFilteredResult(_0x1361ed,_0x41dc5f){return function(_0x11039b){if(_0x11039b){var _0x1671d4=typeof _0x41dc5f[_0x723c('0x1f')]===_0x723c('0x20')&&typeof _0x41dc5f[_0x723c('0x21')]===_0x723c('0x20');var _0x336d2e=_0x11039b[_0x723c('0x22')];var _0x56ad42=_0x1671d4?0x0:_0x41dc5f[_0x723c('0x1f')];var _0x17a22a=_0x1671d4?_0x11039b[_0x723c('0x22')]:_0x41dc5f[_0x723c('0x1f')]+_0x41dc5f[_0x723c('0x21')];var _0x1f059b;if(_0x17a22a>=_0x336d2e){_0x17a22a=_0x336d2e;_0x1f059b=0xc8;}else{_0x1f059b=0xce;}_0x1361ed[_0x723c('0x23')](_0x1f059b);return _0x1361ed['set'](_0x723c('0x24'),_0x56ad42+'-'+_0x17a22a+'/'+_0x336d2e)[_0x723c('0x1e')](_0x11039b);}return null;};}function patchUpdates(_0x25fe96){return function(_0x140dce){try{jsonpatch[_0x723c('0x25')](_0x140dce,_0x25fe96,!![]);}catch(_0x4784f0){return BPromise[_0x723c('0x26')](_0x4784f0);}return _0x140dce['save']();};}function saveUpdates(_0x4d9ba3,_0x34098e){return function(_0x3ecf23){if(_0x3ecf23){return _0x3ecf23[_0x723c('0x27')](_0x4d9ba3)['then'](function(_0x53e40e){return _0x53e40e;});}return null;};}function removeEntity(_0x3d70ea,_0x4da11a){return function(_0x7eb2b3){if(_0x7eb2b3){return _0x7eb2b3[_0x723c('0x28')]()[_0x723c('0x29')](function(){_0x3d70ea[_0x723c('0x23')](0xcc)[_0x723c('0x2a')]();});}};}function handleEntityNotFound(_0x698dff,_0x21625d){return function(_0x9850d9){if(!_0x9850d9){_0x698dff['sendStatus'](0x194);}return _0x9850d9;};}function handleError(_0x5493b1,_0xb9503e){_0xb9503e=_0xb9503e||0x1f4;return function(_0x138883){logger['error'](_0x138883['stack']);if(_0x138883[_0x723c('0x2b')]){delete _0x138883[_0x723c('0x2b')];}_0x5493b1[_0x723c('0x23')](_0xb9503e)[_0x723c('0x2c')](_0x138883);};}exports['index']=function(_0x1f14b2,_0x5bc7e2){var _0x5a2b10={},_0xc24da0={},_0x29b667={'count':0x0,'rows':[]};var _0x6890ba=_[_0x723c('0x2d')](db['OpenchannelQueueReport'][_0x723c('0x2e')],function(_0x35c661){return{'name':_0x35c661[_0x723c('0x2f')],'type':_0x35c661['type'][_0x723c('0x30')]};});_0xc24da0[_0x723c('0x31')]=_[_0x723c('0x2d')](_0x6890ba,_0x723c('0x2b'));_0xc24da0[_0x723c('0x32')]=_['keys'](_0x1f14b2[_0x723c('0x32')]);_0xc24da0[_0x723c('0x33')]=_[_0x723c('0x34')](_0xc24da0['model'],_0xc24da0[_0x723c('0x32')]);_0x5a2b10[_0x723c('0x35')]=_[_0x723c('0x34')](_0xc24da0[_0x723c('0x31')],qs[_0x723c('0x36')](_0x1f14b2['query'][_0x723c('0x36')]));_0x5a2b10[_0x723c('0x35')]=_0x5a2b10['attributes']['length']?_0x5a2b10[_0x723c('0x35')]:_0xc24da0[_0x723c('0x31')];if(!_0x1f14b2['query'][_0x723c('0x37')](_0x723c('0x38'))){_0x5a2b10[_0x723c('0x21')]=qs[_0x723c('0x21')](_0x1f14b2[_0x723c('0x32')][_0x723c('0x21')]);_0x5a2b10[_0x723c('0x1f')]=qs[_0x723c('0x1f')](_0x1f14b2[_0x723c('0x32')][_0x723c('0x1f')]);}_0x5a2b10[_0x723c('0x39')]=qs[_0x723c('0x3a')](_0x1f14b2[_0x723c('0x32')][_0x723c('0x3a')]);_0x5a2b10[_0x723c('0x3b')]=qs['filters'](_[_0x723c('0x3c')](_0x1f14b2['query'],_0xc24da0[_0x723c('0x33')]),_0x6890ba);if(_0x1f14b2['query'][_0x723c('0x3d')]){_0x5a2b10['where']=_[_0x723c('0x3e')](_0x5a2b10[_0x723c('0x3b')],{'$or':_[_0x723c('0x2d')](_0x6890ba,function(_0xb94f91){if(_0xb94f91[_0x723c('0x3f')]!=='VIRTUAL'){var _0x3c696c={};_0x3c696c[_0xb94f91['name']]={'$like':'%'+_0x1f14b2[_0x723c('0x32')][_0x723c('0x3d')]+'%'};return _0x3c696c;}})});}_0x5a2b10=_[_0x723c('0x3e')]({},_0x5a2b10,_0x1f14b2[_0x723c('0x40')]);var _0x52454d={'where':_0x5a2b10[_0x723c('0x3b')]};return db[_0x723c('0x41')]['count'](_0x52454d)[_0x723c('0x29')](function(_0x32029f){_0x29b667['count']=_0x32029f;if(_0x1f14b2['query'][_0x723c('0x42')]){_0x5a2b10[_0x723c('0x43')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x723c('0x44')](_0x5a2b10);})['then'](function(_0x4ee02f){_0x29b667[_0x723c('0x45')]=_0x4ee02f;return _0x29b667;})['then'](respondWithFilteredResult(_0x5bc7e2,_0x5a2b10))[_0x723c('0x46')](handleError(_0x5bc7e2,null));};exports[_0x723c('0x47')]=function(_0x5b9512,_0x30716e){var _0x544725={'raw':!![],'where':{'id':_0x5b9512[_0x723c('0x48')]['id']}},_0x49a721={};_0x49a721[_0x723c('0x31')]=_[_0x723c('0x49')](db[_0x723c('0x41')][_0x723c('0x2e')]);_0x49a721[_0x723c('0x32')]=_[_0x723c('0x49')](_0x5b9512[_0x723c('0x32')]);_0x49a721[_0x723c('0x33')]=_[_0x723c('0x34')](_0x49a721[_0x723c('0x31')],_0x49a721[_0x723c('0x32')]);_0x544725['attributes']=_[_0x723c('0x34')](_0x49a721[_0x723c('0x31')],qs['fields'](_0x5b9512['query']['fields']));_0x544725[_0x723c('0x35')]=_0x544725[_0x723c('0x35')]['length']?_0x544725['attributes']:_0x49a721[_0x723c('0x31')];if(_0x5b9512[_0x723c('0x32')][_0x723c('0x42')]){_0x544725[_0x723c('0x43')]=[{'all':!![]}];}_0x544725=_[_0x723c('0x3e')]({},_0x544725,_0x5b9512[_0x723c('0x40')]);return db[_0x723c('0x41')][_0x723c('0x4a')](_0x544725)[_0x723c('0x29')](handleEntityNotFound(_0x30716e,null))[_0x723c('0x29')](respondWithResult(_0x30716e,null))['catch'](handleError(_0x30716e,null));};exports[_0x723c('0x4b')]=function(_0x2505b9,_0x439433){return db[_0x723c('0x41')][_0x723c('0x4b')](_0x2505b9[_0x723c('0x4c')],{})[_0x723c('0x29')](respondWithResult(_0x439433,0xc9))[_0x723c('0x46')](handleError(_0x439433,null));};exports[_0x723c('0x27')]=function(_0x5cfd93,_0x2ae38f){if(_0x5cfd93[_0x723c('0x4c')]['id']){delete _0x5cfd93['body']['id'];}return db[_0x723c('0x41')][_0x723c('0x4a')]({'where':{'id':_0x5cfd93['params']['id']}})['then'](handleEntityNotFound(_0x2ae38f,null))[_0x723c('0x29')](saveUpdates(_0x5cfd93[_0x723c('0x4c')],null))[_0x723c('0x29')](respondWithResult(_0x2ae38f,null))[_0x723c('0x46')](handleError(_0x2ae38f,null));};exports['destroy']=function(_0x5b696b,_0x40f530){return db[_0x723c('0x41')][_0x723c('0x4a')]({'where':{'id':_0x5b696b[_0x723c('0x48')]['id']}})[_0x723c('0x29')](handleEntityNotFound(_0x40f530,null))[_0x723c('0x29')](removeEntity(_0x40f530,null))[_0x723c('0x46')](handleError(_0x40f530,null));};exports[_0x723c('0x4d')]=function(_0x41963c,_0x5310f2){return db[_0x723c('0x41')][_0x723c('0x4d')]()[_0x723c('0x29')](respondWithResult(_0x5310f2,null))[_0x723c('0x46')](handleError(_0x5310f2,null));}; \ No newline at end of file +var _0xceeb=['../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0xceeb,0x1ed));var _0xbcee=function(_0x434741,_0x5c83ed){_0x434741=_0x434741-0x0;var _0x11efff=_0xceeb[_0x434741];return _0x11efff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbcee('0x0'));var jsonpatch=require(_0xbcee('0x1'));var rp=require('request-promise');var moment=require(_0xbcee('0x2'));var BPromise=require(_0xbcee('0x3'));var Mustache=require('mustache');var util=require(_0xbcee('0x4'));var path=require(_0xbcee('0x5'));var sox=require('sox');var csv=require(_0xbcee('0x6'));var ejs=require(_0xbcee('0x7'));var fs=require('fs');var fs_extra=require(_0xbcee('0x8'));var _=require('lodash');var squel=require(_0xbcee('0x9'));var crypto=require(_0xbcee('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcee('0x6'));var querystring=require(_0xbcee('0xb'));var Papa=require(_0xbcee('0xc'));var Redis=require(_0xbcee('0xd'));var authService=require(_0xbcee('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbcee('0xf'));var hardwareService=require(_0xbcee('0x10'));var logger=require(_0xbcee('0x11'))('api');var utils=require(_0xbcee('0x12'));var config=require(_0xbcee('0x13'));var licenseUtil=require(_0xbcee('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac517,_0x290767){_0x290767=_0x290767||0xcc;return function(_0x43a768){if(_0x43a768){return _0x3ac517['sendStatus'](_0x290767);}return _0x3ac517[_0xbcee('0x15')](_0x290767)[_0xbcee('0x16')]();};}function respondWithResult(_0x4cee1c,_0x229d81){_0x229d81=_0x229d81||0xc8;return function(_0x2a7e07){if(_0x2a7e07){return _0x4cee1c['status'](_0x229d81)['json'](_0x2a7e07);}};}function respondWithFilteredResult(_0x2e6154,_0x2a1f5e){return function(_0x47e2b0){if(_0x47e2b0){var _0x34f3f1=typeof _0x2a1f5e[_0xbcee('0x17')]===_0xbcee('0x18')&&typeof _0x2a1f5e[_0xbcee('0x19')]==='undefined';var _0x4cdaa3=_0x47e2b0['count'];var _0x55a0fb=_0x34f3f1?0x0:_0x2a1f5e['offset'];var _0x4859e6=_0x34f3f1?_0x47e2b0[_0xbcee('0x1a')]:_0x2a1f5e[_0xbcee('0x17')]+_0x2a1f5e[_0xbcee('0x19')];var _0x4b77b9;if(_0x4859e6>=_0x4cdaa3){_0x4859e6=_0x4cdaa3;_0x4b77b9=0xc8;}else{_0x4b77b9=0xce;}_0x2e6154[_0xbcee('0x15')](_0x4b77b9);return _0x2e6154[_0xbcee('0x1b')](_0xbcee('0x1c'),_0x55a0fb+'-'+_0x4859e6+'/'+_0x4cdaa3)[_0xbcee('0x1d')](_0x47e2b0);}return null;};}function patchUpdates(_0xca37ef){return function(_0x78e4fe){try{jsonpatch[_0xbcee('0x1e')](_0x78e4fe,_0xca37ef,!![]);}catch(_0x5b50aa){return BPromise[_0xbcee('0x1f')](_0x5b50aa);}return _0x78e4fe[_0xbcee('0x20')]();};}function saveUpdates(_0x21c5a3,_0x1f3f8a){return function(_0x281c34){if(_0x281c34){return _0x281c34[_0xbcee('0x21')](_0x21c5a3)[_0xbcee('0x22')](function(_0x29c861){return _0x29c861;});}return null;};}function removeEntity(_0x3e90b6,_0x1cc18f){return function(_0x1f3f5d){if(_0x1f3f5d){return _0x1f3f5d[_0xbcee('0x23')]()[_0xbcee('0x22')](function(){_0x3e90b6[_0xbcee('0x15')](0xcc)[_0xbcee('0x16')]();});}};}function handleEntityNotFound(_0xdc4d71,_0x26ec58){return function(_0x1d035b){if(!_0x1d035b){_0xdc4d71['sendStatus'](0x194);}return _0x1d035b;};}function handleError(_0xce693e,_0x394e8){_0x394e8=_0x394e8||0x1f4;return function(_0x45089e){logger[_0xbcee('0x24')](_0x45089e['stack']);if(_0x45089e[_0xbcee('0x25')]){delete _0x45089e[_0xbcee('0x25')];}_0xce693e[_0xbcee('0x15')](_0x394e8)[_0xbcee('0x26')](_0x45089e);};}exports[_0xbcee('0x27')]=function(_0x467fd0,_0x332e23){var _0x37d212={},_0x2565b2={},_0xb480b9={'count':0x0,'rows':[]};var _0x3b4cf2=_[_0xbcee('0x28')](db[_0xbcee('0x29')][_0xbcee('0x2a')],function(_0x58dddf){return{'name':_0x58dddf[_0xbcee('0x2b')],'type':_0x58dddf[_0xbcee('0x2c')][_0xbcee('0x2d')]};});_0x2565b2['model']=_[_0xbcee('0x28')](_0x3b4cf2,_0xbcee('0x25'));_0x2565b2[_0xbcee('0x2e')]=_[_0xbcee('0x2f')](_0x467fd0[_0xbcee('0x2e')]);_0x2565b2[_0xbcee('0x30')]=_[_0xbcee('0x31')](_0x2565b2[_0xbcee('0x32')],_0x2565b2[_0xbcee('0x2e')]);_0x37d212['attributes']=_[_0xbcee('0x31')](_0x2565b2[_0xbcee('0x32')],qs[_0xbcee('0x33')](_0x467fd0[_0xbcee('0x2e')]['fields']));_0x37d212[_0xbcee('0x34')]=_0x37d212[_0xbcee('0x34')]['length']?_0x37d212[_0xbcee('0x34')]:_0x2565b2[_0xbcee('0x32')];if(!_0x467fd0['query'][_0xbcee('0x35')](_0xbcee('0x36'))){_0x37d212[_0xbcee('0x19')]=qs['limit'](_0x467fd0[_0xbcee('0x2e')][_0xbcee('0x19')]);_0x37d212[_0xbcee('0x17')]=qs[_0xbcee('0x17')](_0x467fd0[_0xbcee('0x2e')][_0xbcee('0x17')]);}_0x37d212[_0xbcee('0x37')]=qs[_0xbcee('0x38')](_0x467fd0[_0xbcee('0x2e')]['sort']);_0x37d212[_0xbcee('0x39')]=qs[_0xbcee('0x30')](_[_0xbcee('0x3a')](_0x467fd0[_0xbcee('0x2e')],_0x2565b2['filters']),_0x3b4cf2);if(_0x467fd0[_0xbcee('0x2e')][_0xbcee('0x3b')]){_0x37d212['where']=_[_0xbcee('0x3c')](_0x37d212[_0xbcee('0x39')],{'$or':_[_0xbcee('0x28')](_0x3b4cf2,function(_0x3276d7){if(_0x3276d7[_0xbcee('0x2c')]!=='VIRTUAL'){var _0x438f70={};_0x438f70[_0x3276d7[_0xbcee('0x25')]]={'$like':'%'+_0x467fd0[_0xbcee('0x2e')]['filter']+'%'};return _0x438f70;}})});}_0x37d212=_[_0xbcee('0x3c')]({},_0x37d212,_0x467fd0[_0xbcee('0x3d')]);var _0x2b28bd={'where':_0x37d212['where']};return db[_0xbcee('0x29')]['count'](_0x2b28bd)[_0xbcee('0x22')](function(_0x13eace){_0xb480b9[_0xbcee('0x1a')]=_0x13eace;if(_0x467fd0['query']['includeAll']){_0x37d212[_0xbcee('0x3e')]=[{'all':!![]}];}return db[_0xbcee('0x29')]['findAll'](_0x37d212);})['then'](function(_0x259857){_0xb480b9[_0xbcee('0x3f')]=_0x259857;return _0xb480b9;})[_0xbcee('0x22')](respondWithFilteredResult(_0x332e23,_0x37d212))[_0xbcee('0x40')](handleError(_0x332e23,null));};exports[_0xbcee('0x41')]=function(_0x367357,_0x3efced){var _0x5cb8f2={'raw':!![],'where':{'id':_0x367357[_0xbcee('0x42')]['id']}},_0x214fe4={};_0x214fe4[_0xbcee('0x32')]=_[_0xbcee('0x2f')](db[_0xbcee('0x29')]['rawAttributes']);_0x214fe4[_0xbcee('0x2e')]=_[_0xbcee('0x2f')](_0x367357[_0xbcee('0x2e')]);_0x214fe4[_0xbcee('0x30')]=_[_0xbcee('0x31')](_0x214fe4[_0xbcee('0x32')],_0x214fe4[_0xbcee('0x2e')]);_0x5cb8f2[_0xbcee('0x34')]=_[_0xbcee('0x31')](_0x214fe4[_0xbcee('0x32')],qs[_0xbcee('0x33')](_0x367357['query'][_0xbcee('0x33')]));_0x5cb8f2['attributes']=_0x5cb8f2[_0xbcee('0x34')][_0xbcee('0x43')]?_0x5cb8f2[_0xbcee('0x34')]:_0x214fe4[_0xbcee('0x32')];if(_0x367357[_0xbcee('0x2e')][_0xbcee('0x44')]){_0x5cb8f2['include']=[{'all':!![]}];}_0x5cb8f2=_[_0xbcee('0x3c')]({},_0x5cb8f2,_0x367357[_0xbcee('0x3d')]);return db[_0xbcee('0x29')][_0xbcee('0x45')](_0x5cb8f2)[_0xbcee('0x22')](handleEntityNotFound(_0x3efced,null))['then'](respondWithResult(_0x3efced,null))['catch'](handleError(_0x3efced,null));};exports[_0xbcee('0x46')]=function(_0x5a896e,_0x4c73f4){return db[_0xbcee('0x29')][_0xbcee('0x46')](_0x5a896e['body'],{})[_0xbcee('0x22')](respondWithResult(_0x4c73f4,0xc9))[_0xbcee('0x40')](handleError(_0x4c73f4,null));};exports['update']=function(_0x51cf9e,_0x4f65dc){if(_0x51cf9e[_0xbcee('0x47')]['id']){delete _0x51cf9e[_0xbcee('0x47')]['id'];}return db[_0xbcee('0x29')][_0xbcee('0x45')]({'where':{'id':_0x51cf9e[_0xbcee('0x42')]['id']}})[_0xbcee('0x22')](handleEntityNotFound(_0x4f65dc,null))[_0xbcee('0x22')](saveUpdates(_0x51cf9e[_0xbcee('0x47')],null))['then'](respondWithResult(_0x4f65dc,null))[_0xbcee('0x40')](handleError(_0x4f65dc,null));};exports['destroy']=function(_0x58de88,_0x14df50){return db[_0xbcee('0x29')]['find']({'where':{'id':_0x58de88['params']['id']}})['then'](handleEntityNotFound(_0x14df50,null))['then'](removeEntity(_0x14df50,null))[_0xbcee('0x40')](handleError(_0x14df50,null));};exports[_0xbcee('0x48')]=function(_0x530487,_0x2e35c0){return db[_0xbcee('0x29')][_0xbcee('0x48')]()[_0xbcee('0x22')](respondWithResult(_0x2e35c0,null))['catch'](handleError(_0x2e35c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index caa001b..3e8ee5c 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1a8c41,_0xc1691c){var _0x12749d=function(_0x26af5f){while(--_0x26af5f){_0x1a8c41['push'](_0x1a8c41['shift']());}};_0x12749d(++_0xc1691c);}(_0x5fc3,0xa8));var _0x35fc=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x5fc3[_0xf10840];return _0x1fdf7e;};'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')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x4d901b,_0xf27eb8){var _0x704e25=function(_0x21069b){while(--_0x21069b){_0x4d901b['push'](_0x4d901b['shift']());}};_0x704e25(++_0xf27eb8);}(_0xe14b,0x93));var _0xbe14=function(_0x3a6e2d,_0x5228c5){_0x3a6e2d=_0x3a6e2d-0x0;var _0x247385=_0xe14b[_0x3a6e2d];return _0x247385;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 196a5f9..9bff2cb 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 _0x32b6=['stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent'];(function(_0x5b4e73,_0x207dc8){var _0x134468=function(_0x432a3c){while(--_0x432a3c){_0x5b4e73['push'](_0x5b4e73['shift']());}};_0x134468(++_0x207dc8);}(_0x32b6,0x1d1));var _0x632b=function(_0x5c1009,_0x1365bf){_0x5c1009=_0x5c1009-0x0;var _0x3945f6=_0x32b6[_0x5c1009];return _0x3945f6;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x116f62){logger['info']('CreateOpenchannelQueueReport',_0x3bb27f);logger[_0x632b('0xd')]('CreateOpenchannelQueueReport',_0x3bb27f,JSON[_0x632b('0xf')](_0x116f62));_0x51c894(_0x116f62);})[_0x632b('0x1b')](function(_0x2a6833){logger['error'](_0x632b('0x15'),_0x2a6833[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472['error'](0x1f4,_0x2a6833[_0x632b('0x13')]));});});};exports[_0x632b('0x1c')]=function(_0x30ffb9){var _0x1e448c=this;return new Promise(function(_0x45d017,_0x183c5c){return db['OpenchannelQueueReport']['update'](_0x30ffb9[_0x632b('0x18')],{'raw':_0x30ffb9['options']?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30ffb9['options']?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1d')]||null:null,'attributes':_0x30ffb9[_0x632b('0x19')]?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1e')]||null:null,'limit':_0x30ffb9[_0x632b('0x19')]?_0x30ffb9[_0x632b('0x19')][_0x632b('0x1f')]||null:null})[_0x632b('0xc')](function(_0x4f8410){logger[_0x632b('0x14')](_0x632b('0x1c'),_0x30ffb9);logger[_0x632b('0xd')](_0x632b('0x1c'),_0x30ffb9,JSON[_0x632b('0xf')](_0x4f8410));_0x45d017(_0x4f8410);})[_0x632b('0x1b')](function(_0x3c5dc9){logger[_0x632b('0x10')](_0x632b('0x1c'),_0x3c5dc9[_0x632b('0x13')],_0x30ffb9);_0x183c5c(_0x1e448c[_0x632b('0x10')](0x1f4,_0x3c5dc9[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0xd5fc=['rpc','jayson/promise','http','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','create','body','options','CreateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd5fc,0xae));var _0xcd5f=function(_0x2b4522,_0x3d0d11){_0x2b4522=_0x2b4522-0x0;var _0xe9afbf=_0xd5fc[_0x2b4522];return _0xe9afbf;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var Redis=require(_0xcd5f('0x2'));var db=require(_0xcd5f('0x3'))['db'];var utils=require(_0xcd5f('0x4'));var logger=require(_0xcd5f('0x5'))(_0xcd5f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd5f('0x7'));var client=jayson['client'][_0xcd5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x159b3f,_0x5af696,_0x58d65d){return new BPromise(function(_0x4e668e,_0x102ce9){return client['request'](_0x159b3f,_0x58d65d)[_0xcd5f('0x9')](function(_0x3e63d4){logger['info'](_0xcd5f('0xa'),_0x5af696,'request\x20sent');logger[_0xcd5f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x5af696,_0xcd5f('0xc'),JSON[_0xcd5f('0xd')](_0x3e63d4));if(_0x3e63d4[_0xcd5f('0xe')]){if(_0x3e63d4[_0xcd5f('0xe')]['code']===0x1f4){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x102ce9(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x3e63d4['error'][_0xcd5f('0xf')]);return _0x4e668e(_0x3e63d4[_0xcd5f('0xe')][_0xcd5f('0xf')]);}else{logger[_0xcd5f('0x10')](_0xcd5f('0xa'),_0x5af696,_0xcd5f('0xc'));_0x4e668e(_0x3e63d4[_0xcd5f('0x11')]['message']);}})[_0xcd5f('0x12')](function(_0x33ab1a){logger[_0xcd5f('0xe')](_0xcd5f('0xa'),_0x5af696,_0x33ab1a);_0x102ce9(_0x33ab1a);});});}exports['CreateOpenchannelQueueReport']=function(_0x1a4cb6){var _0x56a874=this;return new Promise(function(_0xb23761,_0x36c60c){return db['OpenchannelQueueReport'][_0xcd5f('0x13')](_0x1a4cb6[_0xcd5f('0x14')],{'raw':_0x1a4cb6['options']?_0x1a4cb6[_0xcd5f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xcd5f('0x9')](function(_0x5c3c9f){logger['info'](_0xcd5f('0x16'),_0x1a4cb6);logger['debug']('CreateOpenchannelQueueReport',_0x1a4cb6,JSON['stringify'](_0x5c3c9f));_0xb23761(_0x5c3c9f);})[_0xcd5f('0x12')](function(_0x5c03b9){logger[_0xcd5f('0xe')](_0xcd5f('0x16'),_0x5c03b9[_0xcd5f('0xf')],_0x1a4cb6);_0x36c60c(_0x56a874[_0xcd5f('0xe')](0x1f4,_0x5c03b9[_0xcd5f('0xf')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x388290){var _0x41015c=this;return new Promise(function(_0x4dc7ab,_0xba8e2e){return db[_0xcd5f('0x17')][_0xcd5f('0x18')](_0x388290[_0xcd5f('0x14')],{'raw':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x1a')]||null:null,'attributes':_0x388290[_0xcd5f('0x15')]?_0x388290[_0xcd5f('0x15')][_0xcd5f('0x1b')]||null:null,'limit':_0x388290[_0xcd5f('0x15')]?_0x388290['options'][_0xcd5f('0x1c')]||null:null})[_0xcd5f('0x9')](function(_0x561414){logger[_0xcd5f('0x10')]('UpdateOpenchannelQueueReport',_0x388290);logger[_0xcd5f('0xb')](_0xcd5f('0x1d'),_0x388290,JSON[_0xcd5f('0xd')](_0x561414));_0x4dc7ab(_0x561414);})[_0xcd5f('0x12')](function(_0xb56143){logger[_0xcd5f('0xe')]('UpdateOpenchannelQueueReport',_0xb56143['message'],_0x388290);_0xba8e2e(_0x41015c[_0xcd5f('0xe')](0x1f4,_0xb56143[_0xcd5f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index c1e8b92..95061ee 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 _0xfb0b=['isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe'];(function(_0x13c397,_0x595922){var _0x15fd12=function(_0x5adf93){while(--_0x5adf93){_0x13c397['push'](_0x13c397['shift']());}};_0x15fd12(++_0x595922);}(_0xfb0b,0x127));var _0xbfb0=function(_0x43dcf3,_0x493619){_0x43dcf3=_0x43dcf3-0x0;var _0x270908=_0xfb0b[_0x43dcf3];return _0x270908;};'use strict';var multer=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var path=require(_0xbfb0('0x2'));var timeout=require(_0xbfb0('0x3'));var express=require(_0xbfb0('0x4'));var router=express[_0xbfb0('0x5')]();var fs_extra=require(_0xbfb0('0x6'));var auth=require(_0xbfb0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbfb0('0x8'));var controller=require(_0xbfb0('0x9'));router[_0xbfb0('0xa')]('/',auth['isAuthenticated'](),controller[_0xbfb0('0xb')]);router[_0xbfb0('0xa')](_0xbfb0('0xc'),auth[_0xbfb0('0xd')](),controller[_0xbfb0('0xe')]);router['get'](_0xbfb0('0xf'),auth[_0xbfb0('0xd')](),controller[_0xbfb0('0x10')]);router[_0xbfb0('0x11')]('/',auth[_0xbfb0('0xd')](),controller['create']);router[_0xbfb0('0x12')](_0xbfb0('0xf'),auth[_0xbfb0('0xd')](),controller[_0xbfb0('0x13')]);router[_0xbfb0('0x14')](_0xbfb0('0xf'),auth[_0xbfb0('0xd')](),controller[_0xbfb0('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7736=['describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x7736,0x134));var _0x6773=function(_0xd62cba,_0x619c56){_0xd62cba=_0xd62cba-0x0;var _0x572f22=_0x7736[_0xd62cba];return _0x572f22;};'use strict';var multer=require(_0x6773('0x0'));var util=require('util');var path=require(_0x6773('0x1'));var timeout=require(_0x6773('0x2'));var express=require(_0x6773('0x3'));var router=express['Router']();var fs_extra=require(_0x6773('0x4'));var auth=require(_0x6773('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6773('0x6'));var controller=require(_0x6773('0x7'));router[_0x6773('0x8')]('/',auth[_0x6773('0x9')](),controller[_0x6773('0xa')]);router[_0x6773('0x8')](_0x6773('0xb'),auth['isAuthenticated'](),controller[_0x6773('0xc')]);router[_0x6773('0x8')](_0x6773('0xd'),auth['isAuthenticated'](),controller[_0x6773('0xe')]);router[_0x6773('0xf')]('/',auth[_0x6773('0x9')](),controller[_0x6773('0x10')]);router['put'](_0x6773('0xd'),auth[_0x6773('0x9')](),controller[_0x6773('0x11')]);router[_0x6773('0x12')](_0x6773('0xd'),auth[_0x6773('0x9')](),controller['destroy']);module[_0x6773('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d3075c3..924cc03 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x38c014,_0x165d74){var _0x25fc0c=function(_0x1df78d){while(--_0x1df78d){_0x38c014['push'](_0x38c014['shift']());}};_0x25fc0c(++_0x165d74);}(_0xedd9,0xfc));var _0x9edd=function(_0x1e241f,_0x435afa){_0x1e241f=_0x1e241f-0x0;var _0x1f2ff1=_0xedd9[_0x1e241f];return _0x1f2ff1;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x50176e,_0xef6119){var _0x44906e=function(_0x525a7d){while(--_0x525a7d){_0x50176e['push'](_0x50176e['shift']());}};_0x44906e(++_0xef6119);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6a839f9..41eacd2 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 _0xab61=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xab61,0x1c9));var _0x1ab6=function(_0x1ef7d3,_0x52ca06){_0x1ef7d3=_0x1ef7d3-0x0;var _0x125d48=_0xab61[_0x1ef7d3];return _0x125d48;};'use strict';var emlformat=require(_0x1ab6('0x0'));var rimraf=require(_0x1ab6('0x1'));var zipdir=require(_0x1ab6('0x2'));var jsonpatch=require(_0x1ab6('0x3'));var rp=require(_0x1ab6('0x4'));var moment=require(_0x1ab6('0x5'));var BPromise=require(_0x1ab6('0x6'));var Mustache=require(_0x1ab6('0x7'));var util=require('util');var path=require(_0x1ab6('0x8'));var sox=require(_0x1ab6('0x9'));var csv=require('to-csv');var ejs=require(_0x1ab6('0xa'));var fs=require('fs');var fs_extra=require(_0x1ab6('0xb'));var _=require('lodash');var squel=require(_0x1ab6('0xc'));var crypto=require(_0x1ab6('0xd'));var jsforce=require(_0x1ab6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1ab6('0xf'));var querystring=require(_0x1ab6('0x10'));var Papa=require(_0x1ab6('0x11'));var Redis=require(_0x1ab6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1ab6('0x13'));var as=require(_0x1ab6('0x14'));var hardwareService=require(_0x1ab6('0x15'));var logger=require(_0x1ab6('0x16'))(_0x1ab6('0x17'));var utils=require(_0x1ab6('0x18'));var config=require(_0x1ab6('0x19'));var licenseUtil=require(_0x1ab6('0x1a'));var db=require(_0x1ab6('0x1b'))['db'];function respondWithStatusCode(_0x426148,_0x4cc2ae){_0x4cc2ae=_0x4cc2ae||0xcc;return function(_0x17a23c){if(_0x17a23c){return _0x426148[_0x1ab6('0x1c')](_0x4cc2ae);}return _0x426148['status'](_0x4cc2ae)[_0x1ab6('0x1d')]();};}function respondWithResult(_0x1e122f,_0x4beba4){_0x4beba4=_0x4beba4||0xc8;return function(_0x52a948){if(_0x52a948){return _0x1e122f[_0x1ab6('0x1e')](_0x4beba4)[_0x1ab6('0x1f')](_0x52a948);}};}function respondWithFilteredResult(_0x4188fe,_0x5a68e2){return function(_0x459ac4){if(_0x459ac4){var _0x17aa11=typeof _0x5a68e2[_0x1ab6('0x20')]===_0x1ab6('0x21')&&typeof _0x5a68e2[_0x1ab6('0x22')]===_0x1ab6('0x21');var _0x5a030b=_0x459ac4[_0x1ab6('0x23')];var _0x4acc17=_0x17aa11?0x0:_0x5a68e2[_0x1ab6('0x20')];var _0x127b3c=_0x17aa11?_0x459ac4[_0x1ab6('0x23')]:_0x5a68e2[_0x1ab6('0x20')]+_0x5a68e2[_0x1ab6('0x22')];var _0x24b5c0;if(_0x127b3c>=_0x5a030b){_0x127b3c=_0x5a030b;_0x24b5c0=0xc8;}else{_0x24b5c0=0xce;}_0x4188fe['status'](_0x24b5c0);return _0x4188fe[_0x1ab6('0x24')](_0x1ab6('0x25'),_0x4acc17+'-'+_0x127b3c+'/'+_0x5a030b)[_0x1ab6('0x1f')](_0x459ac4);}return null;};}function patchUpdates(_0x262a87){return function(_0x310800){try{jsonpatch[_0x1ab6('0x26')](_0x310800,_0x262a87,!![]);}catch(_0x18d6c9){return BPromise[_0x1ab6('0x27')](_0x18d6c9);}return _0x310800[_0x1ab6('0x28')]();};}function saveUpdates(_0x3e405b,_0x23accd){return function(_0x5510ad){if(_0x5510ad){return _0x5510ad['update'](_0x3e405b)[_0x1ab6('0x29')](function(_0x20869a){return _0x20869a;});}return null;};}function removeEntity(_0x162b96,_0x1ce1e6){return function(_0x33814d){if(_0x33814d){return _0x33814d[_0x1ab6('0x2a')]()['then'](function(){_0x162b96[_0x1ab6('0x1e')](0xcc)[_0x1ab6('0x1d')]();});}};}function handleEntityNotFound(_0x497e37,_0x21a35d){return function(_0x550e3a){if(!_0x550e3a){_0x497e37[_0x1ab6('0x1c')](0x194);}return _0x550e3a;};}function handleError(_0x289aa6,_0xa5d327){_0xa5d327=_0xa5d327||0x1f4;return function(_0x52a4eb){logger[_0x1ab6('0x2b')](_0x52a4eb[_0x1ab6('0x2c')]);if(_0x52a4eb[_0x1ab6('0x2d')]){delete _0x52a4eb[_0x1ab6('0x2d')];}_0x289aa6[_0x1ab6('0x1e')](_0xa5d327)['send'](_0x52a4eb);};}exports['index']=function(_0x4d2d9f,_0x4c4881){var _0x21cb02={},_0x11002d={},_0x3b1cf6={'count':0x0,'rows':[]};var _0x4910ee=_['map'](db[_0x1ab6('0x2e')][_0x1ab6('0x2f')],function(_0x2a39a9){return{'name':_0x2a39a9[_0x1ab6('0x30')],'type':_0x2a39a9[_0x1ab6('0x31')][_0x1ab6('0x32')]};});_0x11002d[_0x1ab6('0x33')]=_['map'](_0x4910ee,'name');_0x11002d[_0x1ab6('0x34')]=_[_0x1ab6('0x35')](_0x4d2d9f[_0x1ab6('0x34')]);_0x11002d['filters']=_[_0x1ab6('0x36')](_0x11002d['model'],_0x11002d['query']);_0x21cb02[_0x1ab6('0x37')]=_[_0x1ab6('0x36')](_0x11002d[_0x1ab6('0x33')],qs[_0x1ab6('0x38')](_0x4d2d9f['query'][_0x1ab6('0x38')]));_0x21cb02['attributes']=_0x21cb02[_0x1ab6('0x37')]['length']?_0x21cb02[_0x1ab6('0x37')]:_0x11002d[_0x1ab6('0x33')];if(!_0x4d2d9f[_0x1ab6('0x34')][_0x1ab6('0x39')](_0x1ab6('0x3a'))){_0x21cb02[_0x1ab6('0x22')]=qs[_0x1ab6('0x22')](_0x4d2d9f['query']['limit']);_0x21cb02[_0x1ab6('0x20')]=qs[_0x1ab6('0x20')](_0x4d2d9f['query'][_0x1ab6('0x20')]);}_0x21cb02['order']=qs[_0x1ab6('0x3b')](_0x4d2d9f[_0x1ab6('0x34')][_0x1ab6('0x3b')]);_0x21cb02['where']=qs['filters'](_['pick'](_0x4d2d9f['query'],_0x11002d[_0x1ab6('0x3c')]),_0x4910ee);if(_0x4d2d9f['query'][_0x1ab6('0x3d')]){_0x21cb02[_0x1ab6('0x3e')]=_[_0x1ab6('0x3f')](_0x21cb02[_0x1ab6('0x3e')],{'$or':_[_0x1ab6('0x40')](_0x4910ee,function(_0x5dc3b2){if(_0x5dc3b2[_0x1ab6('0x31')]!==_0x1ab6('0x41')){var _0x49cd47={};_0x49cd47[_0x5dc3b2['name']]={'$like':'%'+_0x4d2d9f[_0x1ab6('0x34')][_0x1ab6('0x3d')]+'%'};return _0x49cd47;}})});}_0x21cb02=_[_0x1ab6('0x3f')]({},_0x21cb02,_0x4d2d9f[_0x1ab6('0x42')]);var _0x5e92f3={'where':_0x21cb02['where']};return db[_0x1ab6('0x2e')][_0x1ab6('0x23')](_0x5e92f3)['then'](function(_0x1d58f1){_0x3b1cf6[_0x1ab6('0x23')]=_0x1d58f1;if(_0x4d2d9f[_0x1ab6('0x34')][_0x1ab6('0x43')]){_0x21cb02[_0x1ab6('0x44')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1ab6('0x45')](_0x21cb02);})[_0x1ab6('0x29')](function(_0x4e62cc){_0x3b1cf6[_0x1ab6('0x46')]=_0x4e62cc;return _0x3b1cf6;})[_0x1ab6('0x29')](respondWithFilteredResult(_0x4c4881,_0x21cb02))[_0x1ab6('0x47')](handleError(_0x4c4881,null));};exports[_0x1ab6('0x48')]=function(_0x56c19f,_0x3bad14){var _0x2e84b2={'raw':!![],'where':{'id':_0x56c19f[_0x1ab6('0x49')]['id']}},_0x360d02={};_0x360d02['model']=_[_0x1ab6('0x35')](db[_0x1ab6('0x2e')]['rawAttributes']);_0x360d02[_0x1ab6('0x34')]=_['keys'](_0x56c19f['query']);_0x360d02[_0x1ab6('0x3c')]=_[_0x1ab6('0x36')](_0x360d02[_0x1ab6('0x33')],_0x360d02[_0x1ab6('0x34')]);_0x2e84b2[_0x1ab6('0x37')]=_['intersection'](_0x360d02[_0x1ab6('0x33')],qs[_0x1ab6('0x38')](_0x56c19f['query']['fields']));_0x2e84b2[_0x1ab6('0x37')]=_0x2e84b2[_0x1ab6('0x37')][_0x1ab6('0x4a')]?_0x2e84b2['attributes']:_0x360d02[_0x1ab6('0x33')];if(_0x56c19f['query'][_0x1ab6('0x43')]){_0x2e84b2[_0x1ab6('0x44')]=[{'all':!![]}];}_0x2e84b2=_[_0x1ab6('0x3f')]({},_0x2e84b2,_0x56c19f['options']);return db[_0x1ab6('0x2e')]['find'](_0x2e84b2)[_0x1ab6('0x29')](handleEntityNotFound(_0x3bad14,null))[_0x1ab6('0x29')](respondWithResult(_0x3bad14,null))[_0x1ab6('0x47')](handleError(_0x3bad14,null));};exports[_0x1ab6('0x4b')]=function(_0x2fea37,_0x42b214){return db['OpenchannelTransferReport']['create'](_0x2fea37[_0x1ab6('0x4c')],{})[_0x1ab6('0x29')](respondWithResult(_0x42b214,0xc9))['catch'](handleError(_0x42b214,null));};exports[_0x1ab6('0x4d')]=function(_0x285a7c,_0x5be074){if(_0x285a7c['body']['id']){delete _0x285a7c[_0x1ab6('0x4c')]['id'];}return db[_0x1ab6('0x2e')][_0x1ab6('0x4e')]({'where':{'id':_0x285a7c[_0x1ab6('0x49')]['id']}})[_0x1ab6('0x29')](handleEntityNotFound(_0x5be074,null))[_0x1ab6('0x29')](saveUpdates(_0x285a7c['body'],null))[_0x1ab6('0x29')](respondWithResult(_0x5be074,null))[_0x1ab6('0x47')](handleError(_0x5be074,null));};exports['destroy']=function(_0x2b856b,_0xc94e59){return db[_0x1ab6('0x2e')]['find']({'where':{'id':_0x2b856b[_0x1ab6('0x49')]['id']}})[_0x1ab6('0x29')](handleEntityNotFound(_0xc94e59,null))['then'](removeEntity(_0xc94e59,null))[_0x1ab6('0x47')](handleError(_0xc94e59,null));};exports[_0x1ab6('0x4f')]=function(_0x516b30,_0x2e19dd){return db[_0x1ab6('0x2e')]['describe']()['then'](respondWithResult(_0x2e19dd,null))['catch'](handleError(_0x2e19dd,null));}; \ No newline at end of file +var _0x59b0=['nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0xcbb8db,_0x1f0a12){var _0x2fdcac=function(_0x2eedc9){while(--_0x2eedc9){_0xcbb8db['push'](_0xcbb8db['shift']());}};_0x2fdcac(++_0x1f0a12);}(_0x59b0,0x188));var _0x059b=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0x59b0[_0xab2afb];return _0x25262b;};'use strict';var emlformat=require(_0x059b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x059b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x059b('0x2'));var moment=require(_0x059b('0x3'));var BPromise=require(_0x059b('0x4'));var Mustache=require(_0x059b('0x5'));var util=require('util');var path=require(_0x059b('0x6'));var sox=require('sox');var csv=require(_0x059b('0x7'));var ejs=require(_0x059b('0x8'));var fs=require('fs');var fs_extra=require(_0x059b('0x9'));var _=require(_0x059b('0xa'));var squel=require(_0x059b('0xb'));var crypto=require(_0x059b('0xc'));var jsforce=require(_0x059b('0xd'));var deskjs=require(_0x059b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x059b('0xf'));var Papa=require('papaparse');var Redis=require(_0x059b('0x10'));var authService=require(_0x059b('0x11'));var qs=require(_0x059b('0x12'));var as=require(_0x059b('0x13'));var hardwareService=require(_0x059b('0x14'));var logger=require('../../config/logger')(_0x059b('0x15'));var utils=require(_0x059b('0x16'));var config=require(_0x059b('0x17'));var licenseUtil=require(_0x059b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x212127,_0x11772b){_0x11772b=_0x11772b||0xcc;return function(_0x19a2b3){if(_0x19a2b3){return _0x212127[_0x059b('0x19')](_0x11772b);}return _0x212127[_0x059b('0x1a')](_0x11772b)[_0x059b('0x1b')]();};}function respondWithResult(_0x1ec36a,_0x4178d6){_0x4178d6=_0x4178d6||0xc8;return function(_0x1d0adb){if(_0x1d0adb){return _0x1ec36a[_0x059b('0x1a')](_0x4178d6)[_0x059b('0x1c')](_0x1d0adb);}};}function respondWithFilteredResult(_0x2a15c0,_0x1ff1f6){return function(_0x9b1ef1){if(_0x9b1ef1){var _0x2412ea=typeof _0x1ff1f6[_0x059b('0x1d')]==='undefined'&&typeof _0x1ff1f6[_0x059b('0x1e')]===_0x059b('0x1f');var _0x413608=_0x9b1ef1[_0x059b('0x20')];var _0x385469=_0x2412ea?0x0:_0x1ff1f6[_0x059b('0x1d')];var _0x3f6214=_0x2412ea?_0x9b1ef1[_0x059b('0x20')]:_0x1ff1f6['offset']+_0x1ff1f6[_0x059b('0x1e')];var _0x52f9c7;if(_0x3f6214>=_0x413608){_0x3f6214=_0x413608;_0x52f9c7=0xc8;}else{_0x52f9c7=0xce;}_0x2a15c0[_0x059b('0x1a')](_0x52f9c7);return _0x2a15c0[_0x059b('0x21')](_0x059b('0x22'),_0x385469+'-'+_0x3f6214+'/'+_0x413608)[_0x059b('0x1c')](_0x9b1ef1);}return null;};}function patchUpdates(_0x46e29b){return function(_0x1fa70c){try{jsonpatch['apply'](_0x1fa70c,_0x46e29b,!![]);}catch(_0x4f605c){return BPromise['reject'](_0x4f605c);}return _0x1fa70c[_0x059b('0x23')]();};}function saveUpdates(_0x139311,_0x180a9c){return function(_0x2fa49f){if(_0x2fa49f){return _0x2fa49f[_0x059b('0x24')](_0x139311)[_0x059b('0x25')](function(_0x8cf704){return _0x8cf704;});}return null;};}function removeEntity(_0xef5093,_0x1742cb){return function(_0xa48f85){if(_0xa48f85){return _0xa48f85[_0x059b('0x26')]()[_0x059b('0x25')](function(){_0xef5093['status'](0xcc)[_0x059b('0x1b')]();});}};}function handleEntityNotFound(_0x8ec08b,_0x5d395a){return function(_0x26884c){if(!_0x26884c){_0x8ec08b[_0x059b('0x19')](0x194);}return _0x26884c;};}function handleError(_0xb249a0,_0x4e13e6){_0x4e13e6=_0x4e13e6||0x1f4;return function(_0xc0fd7d){logger['error'](_0xc0fd7d[_0x059b('0x27')]);if(_0xc0fd7d['name']){delete _0xc0fd7d[_0x059b('0x28')];}_0xb249a0[_0x059b('0x1a')](_0x4e13e6)[_0x059b('0x29')](_0xc0fd7d);};}exports[_0x059b('0x2a')]=function(_0x3c0f7d,_0x119fd7){var _0x454736={},_0x58fa20={},_0x15291d={'count':0x0,'rows':[]};var _0x3b26ad=_[_0x059b('0x2b')](db[_0x059b('0x2c')][_0x059b('0x2d')],function(_0x4e40a){return{'name':_0x4e40a[_0x059b('0x2e')],'type':_0x4e40a[_0x059b('0x2f')][_0x059b('0x30')]};});_0x58fa20[_0x059b('0x31')]=_[_0x059b('0x2b')](_0x3b26ad,_0x059b('0x28'));_0x58fa20[_0x059b('0x32')]=_[_0x059b('0x33')](_0x3c0f7d[_0x059b('0x32')]);_0x58fa20[_0x059b('0x34')]=_[_0x059b('0x35')](_0x58fa20[_0x059b('0x31')],_0x58fa20[_0x059b('0x32')]);_0x454736['attributes']=_[_0x059b('0x35')](_0x58fa20['model'],qs[_0x059b('0x36')](_0x3c0f7d['query'][_0x059b('0x36')]));_0x454736[_0x059b('0x37')]=_0x454736['attributes'][_0x059b('0x38')]?_0x454736[_0x059b('0x37')]:_0x58fa20['model'];if(!_0x3c0f7d[_0x059b('0x32')][_0x059b('0x39')](_0x059b('0x3a'))){_0x454736[_0x059b('0x1e')]=qs[_0x059b('0x1e')](_0x3c0f7d[_0x059b('0x32')][_0x059b('0x1e')]);_0x454736[_0x059b('0x1d')]=qs['offset'](_0x3c0f7d[_0x059b('0x32')][_0x059b('0x1d')]);}_0x454736[_0x059b('0x3b')]=qs[_0x059b('0x3c')](_0x3c0f7d[_0x059b('0x32')][_0x059b('0x3c')]);_0x454736['where']=qs['filters'](_['pick'](_0x3c0f7d[_0x059b('0x32')],_0x58fa20['filters']),_0x3b26ad);if(_0x3c0f7d[_0x059b('0x32')][_0x059b('0x3d')]){_0x454736['where']=_[_0x059b('0x3e')](_0x454736[_0x059b('0x3f')],{'$or':_['map'](_0x3b26ad,function(_0x5dc2fd){if(_0x5dc2fd[_0x059b('0x2f')]!==_0x059b('0x40')){var _0x100c40={};_0x100c40[_0x5dc2fd[_0x059b('0x28')]]={'$like':'%'+_0x3c0f7d['query'][_0x059b('0x3d')]+'%'};return _0x100c40;}})});}_0x454736=_[_0x059b('0x3e')]({},_0x454736,_0x3c0f7d['options']);var _0x38d56d={'where':_0x454736[_0x059b('0x3f')]};return db[_0x059b('0x2c')]['count'](_0x38d56d)[_0x059b('0x25')](function(_0x47a9ba){_0x15291d[_0x059b('0x20')]=_0x47a9ba;if(_0x3c0f7d[_0x059b('0x32')][_0x059b('0x41')]){_0x454736['include']=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x454736);})['then'](function(_0x191747){_0x15291d[_0x059b('0x42')]=_0x191747;return _0x15291d;})[_0x059b('0x25')](respondWithFilteredResult(_0x119fd7,_0x454736))[_0x059b('0x43')](handleError(_0x119fd7,null));};exports[_0x059b('0x44')]=function(_0x3177aa,_0x5443d1){var _0x4ff03f={'raw':!![],'where':{'id':_0x3177aa[_0x059b('0x45')]['id']}},_0x69f475={};_0x69f475[_0x059b('0x31')]=_[_0x059b('0x33')](db[_0x059b('0x2c')][_0x059b('0x2d')]);_0x69f475[_0x059b('0x32')]=_[_0x059b('0x33')](_0x3177aa[_0x059b('0x32')]);_0x69f475['filters']=_[_0x059b('0x35')](_0x69f475[_0x059b('0x31')],_0x69f475[_0x059b('0x32')]);_0x4ff03f[_0x059b('0x37')]=_[_0x059b('0x35')](_0x69f475[_0x059b('0x31')],qs[_0x059b('0x36')](_0x3177aa[_0x059b('0x32')]['fields']));_0x4ff03f[_0x059b('0x37')]=_0x4ff03f[_0x059b('0x37')][_0x059b('0x38')]?_0x4ff03f[_0x059b('0x37')]:_0x69f475['model'];if(_0x3177aa['query'][_0x059b('0x41')]){_0x4ff03f[_0x059b('0x46')]=[{'all':!![]}];}_0x4ff03f=_[_0x059b('0x3e')]({},_0x4ff03f,_0x3177aa['options']);return db[_0x059b('0x2c')][_0x059b('0x47')](_0x4ff03f)[_0x059b('0x25')](handleEntityNotFound(_0x5443d1,null))['then'](respondWithResult(_0x5443d1,null))['catch'](handleError(_0x5443d1,null));};exports[_0x059b('0x48')]=function(_0xfa2b93,_0x83e8bc){return db[_0x059b('0x2c')]['create'](_0xfa2b93[_0x059b('0x49')],{})[_0x059b('0x25')](respondWithResult(_0x83e8bc,0xc9))['catch'](handleError(_0x83e8bc,null));};exports['update']=function(_0x41ca99,_0x239cda){if(_0x41ca99[_0x059b('0x49')]['id']){delete _0x41ca99[_0x059b('0x49')]['id'];}return db[_0x059b('0x2c')][_0x059b('0x47')]({'where':{'id':_0x41ca99['params']['id']}})['then'](handleEntityNotFound(_0x239cda,null))[_0x059b('0x25')](saveUpdates(_0x41ca99['body'],null))['then'](respondWithResult(_0x239cda,null))['catch'](handleError(_0x239cda,null));};exports[_0x059b('0x26')]=function(_0x44dc20,_0x10887a){return db[_0x059b('0x2c')][_0x059b('0x47')]({'where':{'id':_0x44dc20[_0x059b('0x45')]['id']}})[_0x059b('0x25')](handleEntityNotFound(_0x10887a,null))['then'](removeEntity(_0x10887a,null))[_0x059b('0x43')](handleError(_0x10887a,null));};exports[_0x059b('0x4a')]=function(_0x10ec9d,_0x39435f){return db[_0x059b('0x2c')][_0x059b('0x4a')]()[_0x059b('0x25')](respondWithResult(_0x39435f,null))[_0x059b('0x43')](handleError(_0x39435f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 90ebfc7..560f70a 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 _0xcd76=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xcd76,0x1e7));var _0x6cd7=function(_0x5952e1,_0x512eda){_0x5952e1=_0x5952e1-0x0;var _0x1ef652=_0xcd76[_0x5952e1];return _0x1ef652;};'use strict';var _=require(_0x6cd7('0x0'));var util=require(_0x6cd7('0x1'));var logger=require(_0x6cd7('0x2'))(_0x6cd7('0x3'));var moment=require(_0x6cd7('0x4'));var BPromise=require('bluebird');var rp=require(_0x6cd7('0x5'));var fs=require('fs');var path=require(_0x6cd7('0x6'));var rimraf=require(_0x6cd7('0x7'));var config=require(_0x6cd7('0x8'));var attributes=require(_0x6cd7('0x9'));module[_0x6cd7('0xa')]=function(_0x19dff5,_0x28429f){return _0x19dff5['define'](_0x6cd7('0xb'),attributes,{'tableName':_0x6cd7('0xc'),'paranoid':![],'indexes':[{'name':_0x6cd7('0xd'),'fields':[_0x6cd7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb449=['moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xb449,0x8c));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require(_0x9b44('0x2'))('api');var moment=require(_0x9b44('0x3'));var BPromise=require(_0x9b44('0x4'));var rp=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require('rimraf');var config=require(_0x9b44('0x7'));var attributes=require(_0x9b44('0x8'));module['exports']=function(_0x1c65a8,_0x52663e){return _0x1c65a8[_0x9b44('0x9')](_0x9b44('0xa'),attributes,{'tableName':_0x9b44('0xb'),'paranoid':![],'indexes':[{'name':_0x9b44('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 229af56..e77416a 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 _0x9d92=['info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d92,0xdf));var _0x29d9=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x9d92[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29d9('0x1'));var rs=require(_0x29d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d9('0x3'))['db'];var utils=require(_0x29d9('0x4'));var logger=require(_0x29d9('0x5'))(_0x29d9('0x6'));var config=require(_0x29d9('0x7'));var jayson=require(_0x29d9('0x8'));var client=jayson[_0x29d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209595,_0x2f6ac2,_0x392265){return new BPromise(function(_0x5aeb53,_0x26cd90){return client[_0x29d9('0xa')](_0x209595,_0x392265)[_0x29d9('0xb')](function(_0x55b0a5){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2f6ac2,'request\x20sent');logger[_0x29d9('0xc')](_0x29d9('0xd'),_0x2f6ac2,_0x29d9('0xe'),JSON['stringify'](_0x55b0a5));if(_0x55b0a5[_0x29d9('0xf')]){if(_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x10')]===0x1f4){logger[_0x29d9('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')]['message']);return _0x26cd90(_0x55b0a5['error']['message']);}logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x12')]);return _0x5aeb53(_0x55b0a5['error'][_0x29d9('0x12')]);}else{logger[_0x29d9('0x13')](_0x29d9('0x11'),_0x2f6ac2,_0x29d9('0xe'));_0x5aeb53(_0x55b0a5[_0x29d9('0x14')][_0x29d9('0x12')]);}})[_0x29d9('0x15')](function(_0x327c5f){logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x327c5f);_0x26cd90(_0x327c5f);});});} \ No newline at end of file +var _0x0bde=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var moment=require(_0xe0bd('0x1'));var BPromise=require(_0xe0bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8892,_0x29faee,_0x1b75c1){return new BPromise(function(_0xf790d6,_0x54d27f){return client[_0xe0bd('0xb')](_0x1c8892,_0x1b75c1)[_0xe0bd('0xc')](function(_0x12a5f1){logger['info'](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));logger['debug'](_0xe0bd('0xf'),_0x29faee,'request\x20sent',JSON[_0xe0bd('0x10')](_0x12a5f1));if(_0x12a5f1[_0xe0bd('0x11')]){if(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x12')]===0x1f4){logger[_0xe0bd('0x11')](_0xe0bd('0xd'),_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0x54d27f(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0xf790d6(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}else{logger[_0xe0bd('0x14')](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));_0xf790d6(_0x12a5f1[_0xe0bd('0x15')][_0xe0bd('0x13')]);}})[_0xe0bd('0x16')](function(_0x4ea791){logger['error'](_0xe0bd('0xd'),_0x29faee,_0x4ea791);_0x54d27f(_0x4ea791);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index f6618da..e1ba07f 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 _0x7f8b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','/:id','post','create','delete','destroy','exports','multer'];(function(_0x5d99be,_0x13ac4c){var _0x22a468=function(_0x12a3db){while(--_0x12a3db){_0x5d99be['push'](_0x5d99be['shift']());}};_0x22a468(++_0x13ac4c);}(_0x7f8b,0x1ca));var _0xb7f8=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x7f8b[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0xb7f8('0x0'));var util=require(_0xb7f8('0x1'));var path=require(_0xb7f8('0x2'));var timeout=require(_0xb7f8('0x3'));var express=require('express');var router=express[_0xb7f8('0x4')]();var fs_extra=require(_0xb7f8('0x5'));var auth=require(_0xb7f8('0x6'));var interaction=require(_0xb7f8('0x7'));var config=require(_0xb7f8('0x8'));var controller=require(_0xb7f8('0x9'));router['get']('/',auth[_0xb7f8('0xa')](),controller['index']);router['get'](_0xb7f8('0xb'),auth[_0xb7f8('0xa')](),controller['show']);router[_0xb7f8('0xc')]('/',auth[_0xb7f8('0xa')](),controller[_0xb7f8('0xd')]);router['put'](_0xb7f8('0xb'),auth[_0xb7f8('0xa')](),controller['update']);router[_0xb7f8('0xe')](_0xb7f8('0xb'),auth[_0xb7f8('0xa')](),controller[_0xb7f8('0xf')]);module[_0xb7f8('0x10')]=router; \ No newline at end of file +var _0x905b=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x905b,0x87));var _0xb905=function(_0x342de1,_0x387350){_0x342de1=_0x342de1-0x0;var _0x2ae59b=_0x905b[_0x342de1];return _0x2ae59b;};'use strict';var multer=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var path=require(_0xb905('0x2'));var timeout=require(_0xb905('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb905('0x4'));var auth=require(_0xb905('0x5'));var interaction=require(_0xb905('0x6'));var config=require(_0xb905('0x7'));var controller=require('./pause.controller');router[_0xb905('0x8')]('/',auth[_0xb905('0x9')](),controller['index']);router['get']('/:id',auth[_0xb905('0x9')](),controller[_0xb905('0xa')]);router[_0xb905('0xb')]('/',auth[_0xb905('0x9')](),controller[_0xb905('0xc')]);router[_0xb905('0xd')](_0xb905('0xe'),auth[_0xb905('0x9')](),controller['update']);router[_0xb905('0xf')](_0xb905('0xe'),auth[_0xb905('0x9')](),controller['destroy']);module[_0xb905('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 4d6af8c..631ded1 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 _0x98e5=['exports','STRING'];(function(_0x1b43df,_0x1a7abe){var _0x4776ca=function(_0x3f9bec){while(--_0x3f9bec){_0x1b43df['push'](_0x1b43df['shift']());}};_0x4776ca(++_0x1a7abe);}(_0x98e5,0x13a));var _0x598e=function(_0x4e8f63,_0x783de9){_0x4e8f63=_0x4e8f63-0x0;var _0x2a129f=_0x98e5[_0x4e8f63];return _0x2a129f;};'use strict';var Sequelize=require('sequelize');module[_0x598e('0x0')]={'name':{'type':Sequelize[_0x598e('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x598e('0x1')]}}; \ No newline at end of file +var _0x06b8=['exports','STRING','sequelize'];(function(_0x191abb,_0x5eecf8){var _0x43792f=function(_0x2b73ec){while(--_0x2b73ec){_0x191abb['push'](_0x191abb['shift']());}};_0x43792f(++_0x5eecf8);}(_0x06b8,0x1d3));var _0x806b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x06b8[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x806b('0x0'));module[_0x806b('0x1')]={'name':{'type':Sequelize[_0x806b('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x806b('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 68ff389..7e3ffa8 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 _0x1af3=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','Pauses','UserProfileResource','then','stack','name','send','map','Pause','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2529e5,_0xd20438){var _0x1c6429=function(_0x6e2025){while(--_0x6e2025){_0x2529e5['push'](_0x2529e5['shift']());}};_0x1c6429(++_0xd20438);}(_0x1af3,0x145));var _0x31af=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1af3[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31af('0x3'));var moment=require(_0x31af('0x4'));var BPromise=require(_0x31af('0x5'));var Mustache=require('mustache');var util=require(_0x31af('0x6'));var path=require(_0x31af('0x7'));var sox=require(_0x31af('0x8'));var csv=require(_0x31af('0x9'));var ejs=require(_0x31af('0xa'));var fs=require('fs');var fs_extra=require(_0x31af('0xb'));var _=require(_0x31af('0xc'));var squel=require(_0x31af('0xd'));var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x31af('0x10'));var Papa=require(_0x31af('0x11'));var Redis=require(_0x31af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x31af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31af('0x14'));var logger=require('../../config/logger')(_0x31af('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x31af('0x16'));var db=require(_0x31af('0x17'))['db'];function respondWithStatusCode(_0x38fa43,_0x20c66f){_0x20c66f=_0x20c66f||0xcc;return function(_0x1a8fb6){if(_0x1a8fb6){return _0x38fa43[_0x31af('0x18')](_0x20c66f);}return _0x38fa43[_0x31af('0x19')](_0x20c66f)[_0x31af('0x1a')]();};}function respondWithResult(_0x15cf46,_0x2e2dd3){_0x2e2dd3=_0x2e2dd3||0xc8;return function(_0x134c99){if(_0x134c99){return _0x15cf46[_0x31af('0x19')](_0x2e2dd3)[_0x31af('0x1b')](_0x134c99);}};}function respondWithFilteredResult(_0x58e0be,_0x145f94){return function(_0x463b40){if(_0x463b40){var _0x335507=typeof _0x145f94[_0x31af('0x1c')]===_0x31af('0x1d')&&typeof _0x145f94['limit']===_0x31af('0x1d');var _0x25e6fe=_0x463b40[_0x31af('0x1e')];var _0x56805f=_0x335507?0x0:_0x145f94[_0x31af('0x1c')];var _0x3d508d=_0x335507?_0x463b40[_0x31af('0x1e')]:_0x145f94[_0x31af('0x1c')]+_0x145f94[_0x31af('0x1f')];var _0x56f6c1;if(_0x3d508d>=_0x25e6fe){_0x3d508d=_0x25e6fe;_0x56f6c1=0xc8;}else{_0x56f6c1=0xce;}_0x58e0be[_0x31af('0x19')](_0x56f6c1);return _0x58e0be['set'](_0x31af('0x20'),_0x56805f+'-'+_0x3d508d+'/'+_0x25e6fe)['json'](_0x463b40);}return null;};}function patchUpdates(_0xe909f3){return function(_0x4964d5){try{jsonpatch[_0x31af('0x21')](_0x4964d5,_0xe909f3,!![]);}catch(_0x194843){return BPromise[_0x31af('0x22')](_0x194843);}return _0x4964d5[_0x31af('0x23')]();};}function saveUpdates(_0x24a5c7,_0x27abb1){return function(_0x48d431){if(_0x48d431){return _0x48d431[_0x31af('0x24')](_0x24a5c7)['then'](function(_0xea3d18){return _0xea3d18;});}return null;};}function removeEntity(_0x416037,_0xd35ed0){return function(_0x4a0277){if(_0x4a0277){return _0x4a0277[_0x31af('0x25')]()['then'](function(){var _0x4e3afc=_0x4a0277['get']({'plain':!![]});var _0x592707=_0x31af('0x26');return db[_0x31af('0x27')][_0x31af('0x25')]({'where':{'type':_0x592707,'resourceId':_0x4e3afc['id']}})['then'](function(){return _0x4a0277;});})[_0x31af('0x28')](function(){_0x416037[_0x31af('0x19')](0xcc)[_0x31af('0x1a')]();});}};}function handleEntityNotFound(_0x230458,_0x5b2836){return function(_0x4ee3ec){if(!_0x4ee3ec){_0x230458[_0x31af('0x18')](0x194);}return _0x4ee3ec;};}function handleError(_0x13c15f,_0x36bec9){_0x36bec9=_0x36bec9||0x1f4;return function(_0x4988ef){logger['error'](_0x4988ef[_0x31af('0x29')]);if(_0x4988ef[_0x31af('0x2a')]){delete _0x4988ef[_0x31af('0x2a')];}_0x13c15f['status'](_0x36bec9)[_0x31af('0x2b')](_0x4988ef);};}exports['index']=function(_0x108a4d,_0xe69302){var _0x18c7c9={},_0x5178cc={},_0x6682eb={'count':0x0,'rows':[]};var _0x370d9e=_[_0x31af('0x2c')](db[_0x31af('0x2d')]['rawAttributes'],function(_0x480b2b){return{'name':_0x480b2b[_0x31af('0x2e')],'type':_0x480b2b[_0x31af('0x2f')][_0x31af('0x30')]};});_0x5178cc[_0x31af('0x31')]=_[_0x31af('0x2c')](_0x370d9e,_0x31af('0x2a'));_0x5178cc[_0x31af('0x32')]=_[_0x31af('0x33')](_0x108a4d[_0x31af('0x32')]);_0x5178cc[_0x31af('0x34')]=_[_0x31af('0x35')](_0x5178cc[_0x31af('0x31')],_0x5178cc['query']);_0x18c7c9[_0x31af('0x36')]=_['intersection'](_0x5178cc['model'],qs[_0x31af('0x37')](_0x108a4d[_0x31af('0x32')]['fields']));_0x18c7c9['attributes']=_0x18c7c9['attributes'][_0x31af('0x38')]?_0x18c7c9['attributes']:_0x5178cc[_0x31af('0x31')];if(!_0x108a4d[_0x31af('0x32')]['hasOwnProperty'](_0x31af('0x39'))){_0x18c7c9[_0x31af('0x1f')]=qs[_0x31af('0x1f')](_0x108a4d['query'][_0x31af('0x1f')]);_0x18c7c9[_0x31af('0x1c')]=qs[_0x31af('0x1c')](_0x108a4d['query']['offset']);}_0x18c7c9[_0x31af('0x3a')]=qs[_0x31af('0x3b')](_0x108a4d[_0x31af('0x32')][_0x31af('0x3b')]);_0x18c7c9[_0x31af('0x3c')]=qs[_0x31af('0x34')](_[_0x31af('0x3d')](_0x108a4d['query'],_0x5178cc[_0x31af('0x34')]),_0x370d9e);if(_0x108a4d[_0x31af('0x32')][_0x31af('0x3e')]){_0x18c7c9[_0x31af('0x3c')]=_[_0x31af('0x3f')](_0x18c7c9[_0x31af('0x3c')],{'$or':_['map'](_0x370d9e,function(_0x34ba3f){if(_0x34ba3f[_0x31af('0x2f')]!=='VIRTUAL'){var _0x41a479={};_0x41a479[_0x34ba3f[_0x31af('0x2a')]]={'$like':'%'+_0x108a4d[_0x31af('0x32')][_0x31af('0x3e')]+'%'};return _0x41a479;}})});}_0x18c7c9=_[_0x31af('0x3f')]({},_0x18c7c9,_0x108a4d[_0x31af('0x40')]);var _0xb6cfc2={'where':_0x18c7c9[_0x31af('0x3c')]};return db[_0x31af('0x2d')][_0x31af('0x1e')](_0xb6cfc2)[_0x31af('0x28')](function(_0x23d47e){_0x6682eb[_0x31af('0x1e')]=_0x23d47e;if(_0x108a4d['query'][_0x31af('0x41')]){_0x18c7c9[_0x31af('0x42')]=[{'all':!![]}];}return db[_0x31af('0x2d')][_0x31af('0x43')](_0x18c7c9);})[_0x31af('0x28')](function(_0x5db4ac){_0x6682eb[_0x31af('0x44')]=_0x5db4ac;return _0x6682eb;})[_0x31af('0x28')](respondWithFilteredResult(_0xe69302,_0x18c7c9))[_0x31af('0x45')](handleError(_0xe69302,null));};exports[_0x31af('0x46')]=function(_0x44634a,_0x4cfd06){var _0x53ac0c={'raw':!![],'where':{'id':_0x44634a[_0x31af('0x47')]['id']}},_0x37ac17={};_0x37ac17['model']=_[_0x31af('0x33')](db[_0x31af('0x2d')][_0x31af('0x48')]);_0x37ac17[_0x31af('0x32')]=_['keys'](_0x44634a[_0x31af('0x32')]);_0x37ac17[_0x31af('0x34')]=_['intersection'](_0x37ac17[_0x31af('0x31')],_0x37ac17['query']);_0x53ac0c['attributes']=_[_0x31af('0x35')](_0x37ac17[_0x31af('0x31')],qs[_0x31af('0x37')](_0x44634a[_0x31af('0x32')][_0x31af('0x37')]));_0x53ac0c[_0x31af('0x36')]=_0x53ac0c[_0x31af('0x36')]['length']?_0x53ac0c[_0x31af('0x36')]:_0x37ac17[_0x31af('0x31')];if(_0x44634a[_0x31af('0x32')][_0x31af('0x41')]){_0x53ac0c[_0x31af('0x42')]=[{'all':!![]}];}_0x53ac0c=_[_0x31af('0x3f')]({},_0x53ac0c,_0x44634a[_0x31af('0x40')]);return db[_0x31af('0x2d')][_0x31af('0x49')](_0x53ac0c)['then'](handleEntityNotFound(_0x4cfd06,null))[_0x31af('0x28')](respondWithResult(_0x4cfd06,null))[_0x31af('0x45')](handleError(_0x4cfd06,null));};exports[_0x31af('0x4a')]=function(_0x259b56,_0x33e267){return db[_0x31af('0x2d')]['create'](_0x259b56[_0x31af('0x4b')],{})['then'](function(_0x2adb34){var _0x4a5b9d=_0x259b56[_0x31af('0x4c')][_0x31af('0x4d')]({'plain':!![]});if(!_0x4a5b9d)throw new Error(_0x31af('0x4e'));if(_0x4a5b9d[_0x31af('0x4f')]==='user'){var _0x3ea6c2=_0x2adb34[_0x31af('0x4d')]({'plain':!![]});var _0x38bbdb=_0x31af('0x26');return db[_0x31af('0x50')][_0x31af('0x49')]({'where':{'name':_0x38bbdb,'userProfileId':_0x4a5b9d[_0x31af('0x51')]},'raw':!![]})[_0x31af('0x28')](function(_0x5bdf93){if(_0x5bdf93&&_0x5bdf93[_0x31af('0x52')]===0x0){return db[_0x31af('0x27')][_0x31af('0x4a')]({'name':_0x3ea6c2['name'],'resourceId':_0x3ea6c2['id'],'type':_0x5bdf93[_0x31af('0x2a')],'sectionId':_0x5bdf93['id']},{})[_0x31af('0x28')](function(){return _0x2adb34;});}else{return _0x2adb34;}})[_0x31af('0x45')](function(_0x229d8b){logger[_0x31af('0x53')](_0x31af('0x54'),_0x229d8b);throw _0x229d8b;});}return _0x2adb34;})['then'](respondWithResult(_0x33e267,0xc9))['catch'](handleError(_0x33e267,null));};exports['update']=function(_0x5f5834,_0x4c4dff){if(_0x5f5834[_0x31af('0x4b')]['id']){delete _0x5f5834[_0x31af('0x4b')]['id'];}return db[_0x31af('0x2d')][_0x31af('0x49')]({'where':{'id':_0x5f5834[_0x31af('0x47')]['id']}})[_0x31af('0x28')](handleEntityNotFound(_0x4c4dff,null))['then'](saveUpdates(_0x5f5834[_0x31af('0x4b')],null))[_0x31af('0x28')](respondWithResult(_0x4c4dff,null))[_0x31af('0x45')](handleError(_0x4c4dff,null));};exports[_0x31af('0x25')]=function(_0x34eced,_0x298cf8){return db['Pause'][_0x31af('0x49')]({'where':{'id':_0x34eced[_0x31af('0x47')]['id']}})['then'](handleEntityNotFound(_0x298cf8,null))[_0x31af('0x28')](removeEntity(_0x298cf8,null))['catch'](handleError(_0x298cf8,null));}; \ No newline at end of file +var _0x2a05=['Pauses','name','send','map','Pause','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','type','VIRTUAL','options','rows','params','rawAttributes','length','includeAll','include','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get'];(function(_0x5e0cc5,_0x6c3840){var _0x3e0b4f=function(_0x20cad2){while(--_0x20cad2){_0x5e0cc5['push'](_0x5e0cc5['shift']());}};_0x3e0b4f(++_0x6c3840);}(_0x2a05,0x74));var _0x52a0=function(_0x171fd1,_0x588092){_0x171fd1=_0x171fd1-0x0;var _0x3c0f17=_0x2a05[_0x171fd1];return _0x3c0f17;};'use strict';var emlformat=require(_0x52a0('0x0'));var rimraf=require(_0x52a0('0x1'));var zipdir=require(_0x52a0('0x2'));var jsonpatch=require(_0x52a0('0x3'));var rp=require(_0x52a0('0x4'));var moment=require(_0x52a0('0x5'));var BPromise=require(_0x52a0('0x6'));var Mustache=require(_0x52a0('0x7'));var util=require('util');var path=require(_0x52a0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x52a0('0x9'));var fs=require('fs');var fs_extra=require(_0x52a0('0xa'));var _=require(_0x52a0('0xb'));var squel=require('squel');var crypto=require(_0x52a0('0xc'));var jsforce=require(_0x52a0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x52a0('0xe'));var Papa=require('papaparse');var Redis=require(_0x52a0('0xf'));var authService=require(_0x52a0('0x10'));var qs=require(_0x52a0('0x11'));var as=require(_0x52a0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52a0('0x13'))('api');var utils=require(_0x52a0('0x14'));var config=require(_0x52a0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x52a0('0x16'))['db'];function respondWithStatusCode(_0x329f72,_0x7fc4b1){_0x7fc4b1=_0x7fc4b1||0xcc;return function(_0x3549d8){if(_0x3549d8){return _0x329f72[_0x52a0('0x17')](_0x7fc4b1);}return _0x329f72[_0x52a0('0x18')](_0x7fc4b1)[_0x52a0('0x19')]();};}function respondWithResult(_0x5868e4,_0x27fe6b){_0x27fe6b=_0x27fe6b||0xc8;return function(_0x96c517){if(_0x96c517){return _0x5868e4['status'](_0x27fe6b)[_0x52a0('0x1a')](_0x96c517);}};}function respondWithFilteredResult(_0x386788,_0x2e95e2){return function(_0x5b09ae){if(_0x5b09ae){var _0xac0e25=typeof _0x2e95e2['offset']==='undefined'&&typeof _0x2e95e2[_0x52a0('0x1b')]==='undefined';var _0x5ce0a6=_0x5b09ae[_0x52a0('0x1c')];var _0x3e9fd4=_0xac0e25?0x0:_0x2e95e2[_0x52a0('0x1d')];var _0x358be5=_0xac0e25?_0x5b09ae['count']:_0x2e95e2['offset']+_0x2e95e2[_0x52a0('0x1b')];var _0x33c540;if(_0x358be5>=_0x5ce0a6){_0x358be5=_0x5ce0a6;_0x33c540=0xc8;}else{_0x33c540=0xce;}_0x386788[_0x52a0('0x18')](_0x33c540);return _0x386788[_0x52a0('0x1e')](_0x52a0('0x1f'),_0x3e9fd4+'-'+_0x358be5+'/'+_0x5ce0a6)['json'](_0x5b09ae);}return null;};}function patchUpdates(_0x19f434){return function(_0x3aee21){try{jsonpatch['apply'](_0x3aee21,_0x19f434,!![]);}catch(_0x2695f9){return BPromise[_0x52a0('0x20')](_0x2695f9);}return _0x3aee21[_0x52a0('0x21')]();};}function saveUpdates(_0x488eba,_0x330ad5){return function(_0x291a3f){if(_0x291a3f){return _0x291a3f[_0x52a0('0x22')](_0x488eba)[_0x52a0('0x23')](function(_0x1a1037){return _0x1a1037;});}return null;};}function removeEntity(_0x4d3cf8,_0x14a26e){return function(_0x4672e4){if(_0x4672e4){return _0x4672e4[_0x52a0('0x24')]()[_0x52a0('0x23')](function(){var _0x4ccb38=_0x4672e4[_0x52a0('0x25')]({'plain':!![]});var _0x5ef053=_0x52a0('0x26');return db['UserProfileResource'][_0x52a0('0x24')]({'where':{'type':_0x5ef053,'resourceId':_0x4ccb38['id']}})[_0x52a0('0x23')](function(){return _0x4672e4;});})['then'](function(){_0x4d3cf8[_0x52a0('0x18')](0xcc)[_0x52a0('0x19')]();});}};}function handleEntityNotFound(_0x45e4c7,_0x24c8ef){return function(_0x4fb8b8){if(!_0x4fb8b8){_0x45e4c7[_0x52a0('0x17')](0x194);}return _0x4fb8b8;};}function handleError(_0x5d0db5,_0x45adae){_0x45adae=_0x45adae||0x1f4;return function(_0x50a10a){logger['error'](_0x50a10a['stack']);if(_0x50a10a['name']){delete _0x50a10a[_0x52a0('0x27')];}_0x5d0db5[_0x52a0('0x18')](_0x45adae)[_0x52a0('0x28')](_0x50a10a);};}exports['index']=function(_0x106ca1,_0x4db833){var _0xc46413={},_0x4dea5c={},_0x14a1bf={'count':0x0,'rows':[]};var _0x5a5a5c=_[_0x52a0('0x29')](db[_0x52a0('0x2a')]['rawAttributes'],function(_0x2e8e38){return{'name':_0x2e8e38[_0x52a0('0x2b')],'type':_0x2e8e38['type'][_0x52a0('0x2c')]};});_0x4dea5c[_0x52a0('0x2d')]=_[_0x52a0('0x29')](_0x5a5a5c,'name');_0x4dea5c[_0x52a0('0x2e')]=_[_0x52a0('0x2f')](_0x106ca1[_0x52a0('0x2e')]);_0x4dea5c[_0x52a0('0x30')]=_[_0x52a0('0x31')](_0x4dea5c[_0x52a0('0x2d')],_0x4dea5c[_0x52a0('0x2e')]);_0xc46413[_0x52a0('0x32')]=_['intersection'](_0x4dea5c[_0x52a0('0x2d')],qs[_0x52a0('0x33')](_0x106ca1['query'][_0x52a0('0x33')]));_0xc46413['attributes']=_0xc46413[_0x52a0('0x32')]['length']?_0xc46413['attributes']:_0x4dea5c[_0x52a0('0x2d')];if(!_0x106ca1[_0x52a0('0x2e')][_0x52a0('0x34')]('nolimit')){_0xc46413['limit']=qs['limit'](_0x106ca1[_0x52a0('0x2e')]['limit']);_0xc46413['offset']=qs[_0x52a0('0x1d')](_0x106ca1[_0x52a0('0x2e')][_0x52a0('0x1d')]);}_0xc46413[_0x52a0('0x35')]=qs[_0x52a0('0x36')](_0x106ca1[_0x52a0('0x2e')][_0x52a0('0x36')]);_0xc46413['where']=qs[_0x52a0('0x30')](_['pick'](_0x106ca1[_0x52a0('0x2e')],_0x4dea5c[_0x52a0('0x30')]),_0x5a5a5c);if(_0x106ca1['query']['filter']){_0xc46413[_0x52a0('0x37')]=_['merge'](_0xc46413[_0x52a0('0x37')],{'$or':_[_0x52a0('0x29')](_0x5a5a5c,function(_0x394acb){if(_0x394acb[_0x52a0('0x38')]!==_0x52a0('0x39')){var _0xba4c34={};_0xba4c34[_0x394acb[_0x52a0('0x27')]]={'$like':'%'+_0x106ca1[_0x52a0('0x2e')]['filter']+'%'};return _0xba4c34;}})});}_0xc46413=_['merge']({},_0xc46413,_0x106ca1[_0x52a0('0x3a')]);var _0x50d707={'where':_0xc46413[_0x52a0('0x37')]};return db[_0x52a0('0x2a')][_0x52a0('0x1c')](_0x50d707)['then'](function(_0xfd3be3){_0x14a1bf['count']=_0xfd3be3;if(_0x106ca1[_0x52a0('0x2e')]['includeAll']){_0xc46413['include']=[{'all':!![]}];}return db[_0x52a0('0x2a')]['findAll'](_0xc46413);})['then'](function(_0x45ef00){_0x14a1bf[_0x52a0('0x3b')]=_0x45ef00;return _0x14a1bf;})[_0x52a0('0x23')](respondWithFilteredResult(_0x4db833,_0xc46413))['catch'](handleError(_0x4db833,null));};exports['show']=function(_0x457337,_0x175a9c){var _0x444c37={'raw':!![],'where':{'id':_0x457337[_0x52a0('0x3c')]['id']}},_0x1fd8a1={};_0x1fd8a1[_0x52a0('0x2d')]=_[_0x52a0('0x2f')](db[_0x52a0('0x2a')][_0x52a0('0x3d')]);_0x1fd8a1[_0x52a0('0x2e')]=_[_0x52a0('0x2f')](_0x457337[_0x52a0('0x2e')]);_0x1fd8a1[_0x52a0('0x30')]=_[_0x52a0('0x31')](_0x1fd8a1['model'],_0x1fd8a1[_0x52a0('0x2e')]);_0x444c37[_0x52a0('0x32')]=_[_0x52a0('0x31')](_0x1fd8a1[_0x52a0('0x2d')],qs['fields'](_0x457337[_0x52a0('0x2e')][_0x52a0('0x33')]));_0x444c37['attributes']=_0x444c37[_0x52a0('0x32')][_0x52a0('0x3e')]?_0x444c37[_0x52a0('0x32')]:_0x1fd8a1['model'];if(_0x457337[_0x52a0('0x2e')][_0x52a0('0x3f')]){_0x444c37[_0x52a0('0x40')]=[{'all':!![]}];}_0x444c37=_[_0x52a0('0x41')]({},_0x444c37,_0x457337['options']);return db['Pause'][_0x52a0('0x42')](_0x444c37)[_0x52a0('0x23')](handleEntityNotFound(_0x175a9c,null))[_0x52a0('0x23')](respondWithResult(_0x175a9c,null))['catch'](handleError(_0x175a9c,null));};exports[_0x52a0('0x43')]=function(_0x13030e,_0x233e46){return db[_0x52a0('0x2a')][_0x52a0('0x43')](_0x13030e['body'],{})[_0x52a0('0x23')](function(_0x35da2f){var _0x4ee44b=_0x13030e['user'][_0x52a0('0x25')]({'plain':!![]});if(!_0x4ee44b)throw new Error(_0x52a0('0x44'));if(_0x4ee44b['role']===_0x52a0('0x45')){var _0x1a5768=_0x35da2f[_0x52a0('0x25')]({'plain':!![]});var _0x1b08ff=_0x52a0('0x26');return db[_0x52a0('0x46')][_0x52a0('0x42')]({'where':{'name':_0x1b08ff,'userProfileId':_0x4ee44b[_0x52a0('0x47')]},'raw':!![]})['then'](function(_0x2bd490){if(_0x2bd490&&_0x2bd490[_0x52a0('0x48')]===0x0){return db[_0x52a0('0x49')][_0x52a0('0x43')]({'name':_0x1a5768[_0x52a0('0x27')],'resourceId':_0x1a5768['id'],'type':_0x2bd490[_0x52a0('0x27')],'sectionId':_0x2bd490['id']},{})[_0x52a0('0x23')](function(){return _0x35da2f;});}else{return _0x35da2f;}})['catch'](function(_0x26be37){logger[_0x52a0('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26be37);throw _0x26be37;});}return _0x35da2f;})['then'](respondWithResult(_0x233e46,0xc9))[_0x52a0('0x4b')](handleError(_0x233e46,null));};exports[_0x52a0('0x22')]=function(_0x49d2fe,_0x591ae8){if(_0x49d2fe[_0x52a0('0x4c')]['id']){delete _0x49d2fe[_0x52a0('0x4c')]['id'];}return db[_0x52a0('0x2a')]['find']({'where':{'id':_0x49d2fe[_0x52a0('0x3c')]['id']}})[_0x52a0('0x23')](handleEntityNotFound(_0x591ae8,null))[_0x52a0('0x23')](saveUpdates(_0x49d2fe[_0x52a0('0x4c')],null))['then'](respondWithResult(_0x591ae8,null))[_0x52a0('0x4b')](handleError(_0x591ae8,null));};exports[_0x52a0('0x24')]=function(_0x41e589,_0x14b4d3){return db['Pause'][_0x52a0('0x42')]({'where':{'id':_0x41e589[_0x52a0('0x3c')]['id']}})[_0x52a0('0x23')](handleEntityNotFound(_0x14b4d3,null))[_0x52a0('0x23')](removeEntity(_0x14b4d3,null))[_0x52a0('0x4b')](handleError(_0x14b4d3,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index a924545..27f0b14 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48b4f9,_0xbbe897){_0x48b4f9=_0x48b4f9-0x0;var _0x30dda9=_0x7fbe[_0x48b4f9];return _0x30dda9;};'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 +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x8f1893,_0x57b537){var _0x589fe7=function(_0x3fa3e6){while(--_0x3fa3e6){_0x8f1893['push'](_0x8f1893['shift']());}};_0x589fe7(++_0x57b537);}(_0xe14b,0x93));var _0xbe14=function(_0x4b58ba,_0x571b0a){_0x4b58ba=_0x4b58ba-0x0;var _0x605286=_0xe14b[_0x4b58ba];return _0x605286;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 5b6bfa9..a2948fd 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x19c4e9,_0x3fb0d8){var _0x1bc3de=function(_0x53069d){while(--_0x53069d){_0x19c4e9['push'](_0x19c4e9['shift']());}};_0x1bc3de(++_0x3fb0d8);}(_0x7a54,0x106));var _0x47a5=function(_0x20517a,_0x5278f6){_0x20517a=_0x20517a-0x0;var _0x50cb5f=_0x7a54[_0x20517a];return _0x50cb5f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0xa60546,_0x4f0675){var _0x275384=function(_0x16426b){while(--_0x16426b){_0xa60546['push'](_0xa60546['shift']());}};_0x275384(++_0x4f0675);}(_0xb10b,0x12a));var _0xbb10=function(_0x549d16,_0x4d069a){_0x549d16=_0x549d16-0x0;var _0x344ccc=_0xb10b[_0x549d16];return _0x344ccc;};'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 9f107c0..e0e0cce 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 _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xac9d,0x14d));var _0xdac9=function(_0x504dc3,_0x547139){_0x504dc3=_0x504dc3-0x0;var _0x2d352c=_0xac9d[_0x504dc3];return _0x2d352c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x032e=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id'];(function(_0x439e33,_0x189e27){var _0x21b67b=function(_0xa1d536){while(--_0xa1d536){_0x439e33['push'](_0x439e33['shift']());}};_0x21b67b(++_0x189e27);}(_0x032e,0x124));var _0xe032=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x032e[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0x8')](_0xe032('0xf'),auth[_0xe032('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xe032('0x10')]({'destination':function(_0x1ce2ae,_0x13c126,_0x42e2ba){_0x42e2ba(null,path[_0xe032('0x11')](config[_0xe032('0x12')],_0xe032('0x13')));},'filename':function(_0x5bcb5b,_0x646979,_0x266d71){_0x646979[_0xe032('0x14')]=_0x646979[_0xe032('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x266d71(null,util[_0xe032('0x15')](_0xe032('0x16'),path[_0xe032('0x17')](_0x646979[_0xe032('0x14')],path[_0xe032('0x18')](_0x646979[_0xe032('0x14')])),Date[_0xe032('0x19')](),path['extname'](_0x646979[_0xe032('0x14')])));}})});router[_0xe032('0x1a')]('/',upload[_0xe032('0x1b')](_0xe032('0x1c')),controller[_0xe032('0x1d')]);router[_0xe032('0x1a')]('/webhook',controller[_0xe032('0x1e')]);router[_0xe032('0x1f')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe032('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ed310cf..6fad4b8 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 _0xbaef=['ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x2f6dfe,_0x115dab){var _0x5e5c9c=function(_0x502840){while(--_0x502840){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5e5c9c(++_0x115dab);}(_0xbaef,0x1ca));var _0xfbae=function(_0x14eafa,_0x1f47c7){_0x14eafa=_0x14eafa-0x0;var _0x20cbd3=_0xbaef[_0x14eafa];return _0x20cbd3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfbae('0x0')]},'type':{'type':Sequelize[_0xfbae('0x1')]('html',_0xfbae('0x2'))},'description':{'type':Sequelize[_0xfbae('0x3')]},'version':{'type':Sequelize[_0xfbae('0x3')]},'path':{'type':Sequelize[_0xfbae('0x0')],'comment':_0xfbae('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfbae('0x5')},'sidebar':{'type':Sequelize[_0xfbae('0x1')](_0xfbae('0x6'),'agentOnly',_0xfbae('0x7'),'never'),'defaultValue':_0xfbae('0x7'),'comment':_0xfbae('0x8')},'icon':{'type':Sequelize[_0xfbae('0x0')]},'adminUrl':{'type':Sequelize[_0xfbae('0x0')]},'agentUrl':{'type':Sequelize[_0xfbae('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xfbae('0x0')]}}; \ No newline at end of file +var _0x810d=['STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','TEXT'];(function(_0x10e9a1,_0xe11582){var _0x4f9091=function(_0x2e7427){while(--_0x2e7427){_0x10e9a1['push'](_0x10e9a1['shift']());}};_0x4f9091(++_0xe11582);}(_0x810d,0x19d));var _0xd810=function(_0x29a816,_0x13ca87){_0x29a816=_0x29a816-0x0;var _0xa0dd0=_0x810d[_0x29a816];return _0xa0dd0;};'use strict';var Sequelize=require(_0xd810('0x0'));module[_0xd810('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd810('0x2')]('html',_0xd810('0x3'))},'description':{'type':Sequelize[_0xd810('0x4')]},'version':{'type':Sequelize[_0xd810('0x4')]},'path':{'type':Sequelize[_0xd810('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xd810('0x6')],'defaultValue':0x0,'comment':_0xd810('0x7')},'sidebar':{'type':Sequelize[_0xd810('0x2')]('adminOnly','agentOnly','always',_0xd810('0x8')),'defaultValue':_0xd810('0x9'),'comment':_0xd810('0xa')},'icon':{'type':Sequelize[_0xd810('0x5')]},'adminUrl':{'type':Sequelize[_0xd810('0x5')]},'agentUrl':{'type':Sequelize[_0xd810('0x5')]},'scriptName':{'type':Sequelize['STRING']},'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 1f1c8bb..b01e1ff 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 _0x3c86=['./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','Plugins','UserProfileResource','destroy','error','name','send','index','Plugin','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','keys','includeAll','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','attachments/**/*','finalize','close','existsSync','Sequelize','Plugin\x20not\x20found','info','Temporary\x20file\x20removed','catch','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','download','statusCode','webhookPost','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','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x58da8d,_0x462e9d){var _0x549771=function(_0x79c9e1){while(--_0x79c9e1){_0x58da8d['push'](_0x58da8d['shift']());}};_0x549771(++_0x462e9d);}(_0x3c86,0x132));var _0x63c8=function(_0xaf6f65,_0x435df0){_0xaf6f65=_0xaf6f65-0x0;var _0x42e071=_0x3c86[_0xaf6f65];return _0x42e071;};'use strict';var emlformat=require(_0x63c8('0x0'));var rimraf=require(_0x63c8('0x1'));var zipdir=require(_0x63c8('0x2'));var jsonpatch=require(_0x63c8('0x3'));var rp=require(_0x63c8('0x4'));var moment=require(_0x63c8('0x5'));var BPromise=require(_0x63c8('0x6'));var Mustache=require('mustache');var util=require(_0x63c8('0x7'));var path=require(_0x63c8('0x8'));var sox=require(_0x63c8('0x9'));var csv=require(_0x63c8('0xa'));var ejs=require(_0x63c8('0xb'));var fs=require('fs');var fs_extra=require(_0x63c8('0xc'));var _=require(_0x63c8('0xd'));var squel=require(_0x63c8('0xe'));var crypto=require(_0x63c8('0xf'));var jsforce=require(_0x63c8('0x10'));var deskjs=require(_0x63c8('0x11'));var toCsv=require(_0x63c8('0xa'));var querystring=require('querystring');var Papa=require(_0x63c8('0x12'));var extract=require(_0x63c8('0x13'));var rimraf=require(_0x63c8('0x1'));var archiver=require(_0x63c8('0x14'));var Redis=require(_0x63c8('0x15'));var authService=require(_0x63c8('0x16'));var qs=require(_0x63c8('0x17'));var as=require(_0x63c8('0x18'));var hardwareService=require(_0x63c8('0x19'));var logger=require(_0x63c8('0x1a'))(_0x63c8('0x1b'));var utils=require(_0x63c8('0x1c'));var config=require(_0x63c8('0x1d'));var licenseUtil=require(_0x63c8('0x1e'));var db=require(_0x63c8('0x1f'))['db'];config[_0x63c8('0x20')]=_[_0x63c8('0x21')](config[_0x63c8('0x20')],{'host':_0x63c8('0x22'),'port':0x18eb});var socket=require(_0x63c8('0x23'))(new Redis(config[_0x63c8('0x20')]));require(_0x63c8('0x24'))[_0x63c8('0x25')](socket);function respondWithStatusCode(_0x157df7,_0x1a3ba0){_0x1a3ba0=_0x1a3ba0||0xcc;return function(_0x53d0bc){if(_0x53d0bc){return _0x157df7[_0x63c8('0x26')](_0x1a3ba0);}return _0x157df7[_0x63c8('0x27')](_0x1a3ba0)[_0x63c8('0x28')]();};}function respondWithResult(_0x1c464b,_0x432364){_0x432364=_0x432364||0xc8;return function(_0x492ab5){if(_0x492ab5){return _0x1c464b['status'](_0x432364)[_0x63c8('0x29')](_0x492ab5);}};}function respondWithFilteredResult(_0x29cea3,_0x150822){return function(_0x2f4ce7){if(_0x2f4ce7){var _0x4768fb=typeof _0x150822[_0x63c8('0x2a')]===_0x63c8('0x2b')&&typeof _0x150822[_0x63c8('0x2c')]===_0x63c8('0x2b');var _0x20844d=_0x2f4ce7[_0x63c8('0x2d')];var _0x58ce48=_0x4768fb?0x0:_0x150822[_0x63c8('0x2a')];var _0x343f00=_0x4768fb?_0x2f4ce7[_0x63c8('0x2d')]:_0x150822[_0x63c8('0x2a')]+_0x150822[_0x63c8('0x2c')];var _0x5f0b87;if(_0x343f00>=_0x20844d){_0x343f00=_0x20844d;_0x5f0b87=0xc8;}else{_0x5f0b87=0xce;}_0x29cea3[_0x63c8('0x27')](_0x5f0b87);return _0x29cea3[_0x63c8('0x2e')](_0x63c8('0x2f'),_0x58ce48+'-'+_0x343f00+'/'+_0x20844d)[_0x63c8('0x29')](_0x2f4ce7);}return null;};}function patchUpdates(_0x2bebcc){return function(_0x5451ba){try{jsonpatch[_0x63c8('0x30')](_0x5451ba,_0x2bebcc,!![]);}catch(_0x45a527){return BPromise[_0x63c8('0x31')](_0x45a527);}return _0x5451ba[_0x63c8('0x32')]();};}function saveUpdates(_0x190464,_0x2703c5){return function(_0x50d05f){if(_0x50d05f){return _0x50d05f['update'](_0x190464)[_0x63c8('0x33')](function(_0x1918a7){return _0x1918a7;});}return null;};}function removeEntity(_0x3065e3,_0x4c281d){return function(_0x20a6b0){if(_0x20a6b0){return _0x20a6b0['destroy']()[_0x63c8('0x33')](function(){var _0x638d30=_0x20a6b0[_0x63c8('0x34')]({'plain':!![]});var _0x1cc977=_0x63c8('0x35');return db[_0x63c8('0x36')][_0x63c8('0x37')]({'where':{'type':_0x1cc977,'resourceId':_0x638d30['id']}})[_0x63c8('0x33')](function(){return _0x20a6b0;});})[_0x63c8('0x33')](function(){_0x3065e3[_0x63c8('0x27')](0xcc)[_0x63c8('0x28')]();});}};}function handleEntityNotFound(_0x2bed71,_0x515610){return function(_0x1e38bb){if(!_0x1e38bb){_0x2bed71['sendStatus'](0x194);}return _0x1e38bb;};}function handleError(_0x1e63f3,_0x386856){_0x386856=_0x386856||0x1f4;return function(_0x4c8d31){logger[_0x63c8('0x38')](_0x4c8d31['stack']);if(_0x4c8d31[_0x63c8('0x39')]){delete _0x4c8d31[_0x63c8('0x39')];}_0x1e63f3[_0x63c8('0x27')](_0x386856)[_0x63c8('0x3a')](_0x4c8d31);};}exports[_0x63c8('0x3b')]=function(_0x1379ea,_0x7b1cc6){var _0x4a0e27={},_0x337478={},_0x26464f={'count':0x0,'rows':[]};var _0x4308b8=_['map'](db[_0x63c8('0x3c')][_0x63c8('0x3d')],function(_0x57cb5a){return{'name':_0x57cb5a['fieldName'],'type':_0x57cb5a[_0x63c8('0x3e')][_0x63c8('0x3f')]};});_0x337478[_0x63c8('0x40')]=_[_0x63c8('0x41')](_0x4308b8,_0x63c8('0x39'));_0x337478['query']=_['keys'](_0x1379ea[_0x63c8('0x42')]);_0x337478[_0x63c8('0x43')]=_[_0x63c8('0x44')](_0x337478[_0x63c8('0x40')],_0x337478['query']);_0x4a0e27[_0x63c8('0x45')]=_[_0x63c8('0x44')](_0x337478[_0x63c8('0x40')],qs['fields'](_0x1379ea[_0x63c8('0x42')][_0x63c8('0x46')]));_0x4a0e27[_0x63c8('0x45')]=_0x4a0e27['attributes'][_0x63c8('0x47')]?_0x4a0e27['attributes']:_0x337478[_0x63c8('0x40')];if(!_0x1379ea['query'][_0x63c8('0x48')](_0x63c8('0x49'))){_0x4a0e27[_0x63c8('0x2c')]=qs['limit'](_0x1379ea['query']['limit']);_0x4a0e27['offset']=qs[_0x63c8('0x2a')](_0x1379ea[_0x63c8('0x42')][_0x63c8('0x2a')]);}_0x4a0e27[_0x63c8('0x4a')]=qs['sort'](_0x1379ea[_0x63c8('0x42')][_0x63c8('0x4b')]);_0x4a0e27[_0x63c8('0x4c')]=qs[_0x63c8('0x43')](_[_0x63c8('0x4d')](_0x1379ea[_0x63c8('0x42')],_0x337478['filters']),_0x4308b8);if(_0x1379ea['query']['filter']){_0x4a0e27[_0x63c8('0x4c')]=_[_0x63c8('0x4e')](_0x4a0e27[_0x63c8('0x4c')],{'$or':_[_0x63c8('0x41')](_0x4308b8,function(_0x2d543d){if(_0x2d543d['type']!==_0x63c8('0x4f')){var _0x2d852c={};_0x2d852c[_0x2d543d[_0x63c8('0x39')]]={'$like':'%'+_0x1379ea[_0x63c8('0x42')][_0x63c8('0x50')]+'%'};return _0x2d852c;}})});}_0x4a0e27=_['merge']({},_0x4a0e27,_0x1379ea[_0x63c8('0x51')]);var _0x4d7db8={'where':_0x4a0e27[_0x63c8('0x4c')]};return db[_0x63c8('0x3c')]['count'](_0x4d7db8)['then'](function(_0x3f1a02){_0x26464f[_0x63c8('0x2d')]=_0x3f1a02;if(_0x1379ea[_0x63c8('0x42')]['includeAll']){_0x4a0e27[_0x63c8('0x52')]=[{'all':!![]}];}return db['Plugin'][_0x63c8('0x53')](_0x4a0e27);})['then'](function(_0x498853){_0x26464f['rows']=_0x498853;return _0x26464f;})[_0x63c8('0x33')](respondWithFilteredResult(_0x7b1cc6,_0x4a0e27))['catch'](handleError(_0x7b1cc6,null));};exports[_0x63c8('0x54')]=function(_0x46d645,_0x123efb){var _0x3d1247={'raw':!![],'where':{'id':_0x46d645[_0x63c8('0x55')]['id']}},_0xc5a08e={};_0xc5a08e[_0x63c8('0x40')]=_[_0x63c8('0x56')](db['Plugin']['rawAttributes']);_0xc5a08e[_0x63c8('0x42')]=_[_0x63c8('0x56')](_0x46d645['query']);_0xc5a08e['filters']=_[_0x63c8('0x44')](_0xc5a08e['model'],_0xc5a08e[_0x63c8('0x42')]);_0x3d1247[_0x63c8('0x45')]=_[_0x63c8('0x44')](_0xc5a08e['model'],qs['fields'](_0x46d645[_0x63c8('0x42')][_0x63c8('0x46')]));_0x3d1247[_0x63c8('0x45')]=_0x3d1247['attributes']['length']?_0x3d1247[_0x63c8('0x45')]:_0xc5a08e[_0x63c8('0x40')];if(_0x46d645[_0x63c8('0x42')][_0x63c8('0x57')]){_0x3d1247['include']=[{'all':!![]}];}_0x3d1247=_[_0x63c8('0x4e')]({},_0x3d1247,_0x46d645[_0x63c8('0x51')]);return db['Plugin'][_0x63c8('0x58')](_0x3d1247)['then'](handleEntityNotFound(_0x123efb,null))[_0x63c8('0x33')](respondWithResult(_0x123efb,null))['catch'](handleError(_0x123efb,null));};exports['download']=function(_0x26db46,_0x1e03d3,_0x8be454){return db[_0x63c8('0x3c')][_0x63c8('0x58')]({'where':{'id':_0x26db46['params']['id']},'attributes':[_0x63c8('0x39'),_0x63c8('0x8')],'raw':!![]})[_0x63c8('0x33')](handleEntityNotFound(_0x1e03d3,null))['then'](function(_0x9887fe){if(_0x9887fe){var _0x11d8a3=path[_0x63c8('0x59')](config[_0x63c8('0x5a')],_0x63c8('0x5b'),util[_0x63c8('0x5c')](_0x63c8('0x5d'),path[_0x63c8('0x5e')](_0x9887fe[_0x63c8('0x8')])));var _0x4b16a2=fs[_0x63c8('0x5f')](_0x11d8a3);var _0x1287c8=archiver('zip',{'zlib':{'level':0x9}});_0x1287c8['on'](_0x63c8('0x60'),function(_0x78f089){if(_0x78f089['code']===_0x63c8('0x61')){logger['error'](_0x78f089);}else{throw new db['Sequelize'][(_0x63c8('0x62'))](_0x63c8('0x63'));}});_0x1287c8['on'](_0x63c8('0x38'),function(_0x17999d){throw new db['Sequelize'][(_0x63c8('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1287c8['pipe'](_0x4b16a2);_0x1287c8['glob'](_0x63c8('0x64'),{'cwd':path['join'](config[_0x63c8('0x5a')],_0x63c8('0x5b'),path[_0x63c8('0x65')](_0x9887fe[_0x63c8('0x8')])),'ignore':[path['join'](path[_0x63c8('0x5e')](_0x9887fe[_0x63c8('0x8')]),'node_modules/**/*'),path[_0x63c8('0x59')](path[_0x63c8('0x5e')](_0x9887fe[_0x63c8('0x8')]),_0x63c8('0x66'))],'nodir':!![]})[_0x63c8('0x67')]();_0x4b16a2['on'](_0x63c8('0x68'),function(){if(!fs[_0x63c8('0x69')](_0x11d8a3)){throw new db[(_0x63c8('0x6a'))][(_0x63c8('0x62'))](_0x63c8('0x6b'));}return _0x1e03d3['download'](_0x11d8a3,util[_0x63c8('0x5c')](_0x63c8('0x5d'),path[_0x63c8('0x5e')](_0x9887fe['path'])),function(_0x1ad78b){if(_0x1ad78b){throw new db[(_0x63c8('0x6a'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x11d8a3);logger[_0x63c8('0x6c')]('Download\x20completed');logger[_0x63c8('0x6c')](_0x63c8('0x6d'));});});}return null;})[_0x63c8('0x6e')](handleError(_0x1e03d3,null));};exports[_0x63c8('0x6f')]=function(_0x2a62fe,_0x3e3f88,_0x1a8f5d){var _0x4ba5b5=path[_0x63c8('0x5e')](_0x2a62fe[_0x63c8('0x70')][_0x63c8('0x71')],path[_0x63c8('0x72')](_0x2a62fe[_0x63c8('0x70')][_0x63c8('0x71')]));var _0x154e16=path[_0x63c8('0x59')](config[_0x63c8('0x5a')],_0x63c8('0x5b'),_0x2a62fe[_0x63c8('0x70')]['filename']);var _0x1f6245=path['join'](config[_0x63c8('0x5a')],'server/files/plugins',_0x4ba5b5);logger['info'](_0x63c8('0x73'),_0x154e16);logger[_0x63c8('0x6c')]('Plugin\x20upload\x20destination:\x20%s',_0x1f6245);try{fs['chmodSync'](_0x154e16,parseInt(_0x63c8('0x74'),0x8));extract(_0x154e16,{'dir':_0x1f6245},function(_0x45c8e5){if(_0x45c8e5){logger[_0x63c8('0x38')](_0x45c8e5);handleError(_0x45c8e5,!![]);};var _0x482190=fs[_0x63c8('0x75')](_0x1f6245);if(_0x482190[_0x63c8('0x47')]>0x1){removeReferences(_0x154e16,_0x1f6245);logger[_0x63c8('0x38')](_0x63c8('0x76'));return _0x1a8f5d(new Error('Invalid\x20plugin\x20structure'));}var _0x1f1ea6=fs['lstatSync'](path[_0x63c8('0x59')](_0x1f6245,_0x482190[0x0]));if(_0x1f1ea6[_0x63c8('0x77')]()){removeReferences(_0x154e16,_0x1f6245);logger[_0x63c8('0x38')](_0x63c8('0x76'));return _0x1a8f5d(new Error(_0x63c8('0x76')));}if(_0x1f1ea6['isDirectory']()){var _0x576f8f=fs[_0x63c8('0x75')](path[_0x63c8('0x59')](_0x1f6245,_0x482190[0x0]));if(_0x576f8f[_0x63c8('0x47')]===0x0){removeReferences(_0x154e16,_0x1f6245);logger['error'](_0x63c8('0x76'));return _0x1a8f5d(new Error('Invalid\x20plugin\x20structure'));}var _0x60a7d6=_0x576f8f['some'](function(_0x4b5924){return _0x4b5924==='manifest.json';});if(!_0x60a7d6){return _0x1a8f5d(new Error(_0x63c8('0x78')));}var _0x724670=fs[_0x63c8('0x79')](path[_0x63c8('0x59')](_0x1f6245,_0x482190[0x0],_0x63c8('0x7a')));var _0x543992=JSON['parse'](_0x724670);if(_0x63c8('0x2b')==typeof _0x543992['name']){return _0x1a8f5d(new Error(_0x63c8('0x7b')));}if(_0x63c8('0x2b')==typeof _0x543992[_0x63c8('0x3e')]){return _0x1a8f5d(new Error(_0x63c8('0x7c')));}if(_0x63c8('0x2b')==typeof _0x543992['version']){return _0x1a8f5d(new Error(_0x63c8('0x7d')));}if(_0x63c8('0x2b')==typeof _0x543992[_0x63c8('0x7e')]){return _0x1a8f5d(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x543992[_0x63c8('0x3e')]===_0x63c8('0x7f')){if('undefined'==typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')]){return _0x1a8f5d(new Error(_0x63c8('0x81')));}if(_0x63c8('0x2b')==typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')][_0x63c8('0x82')]&&_0x63c8('0x2b')==typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')][_0x63c8('0x83')]){return _0x1a8f5d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x543992[_0x63c8('0x3e')]===_0x63c8('0x84')){if(_0x63c8('0x2b')==typeof _0x543992['parameters'][_0x63c8('0x85')]){return _0x1a8f5d(new Error(_0x63c8('0x86')));}if(_0x63c8('0x2b')==typeof _0x543992[_0x63c8('0x7e')]['scriptPath']){return _0x1a8f5d(new Error(_0x63c8('0x87')));}}else{return _0x1a8f5d(new Error(_0x63c8('0x88')));}var _0xc96d0c=_0x543992[_0x63c8('0x39')];var _0x26520c=_0x543992['description'];var _0x5fbfab=_0x543992['type'];var _0x17f11e=_0x543992['sidebar']?_0x543992[_0x63c8('0x89')]:_0x63c8('0x8a');var _0x19625b=_0x543992['icon']?_0x543992[_0x63c8('0x8b')]:_0x63c8('0x8c');var _0x41a362='';var _0x3a4ee6='';var _0x4d4c89='';var _0x418c1a='';var _0x33b369=_0x543992[_0x63c8('0x8d')];if(_0x5fbfab===_0x63c8('0x7f')){if('undefined'!=typeof _0x543992[_0x63c8('0x7e')]['views'][_0x63c8('0x82')]){var _0x4416e2=_0x543992[_0x63c8('0x7e')]['views'][_0x63c8('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4416e2)){_0x41a362=path[_0x63c8('0x59')](_0x63c8('0x8e'),_0x4ba5b5,_0x482190[0x0],_0x4416e2);}else{_0x41a362=_0x4416e2;}}else{logger[_0x63c8('0x6c')](_0x63c8('0x8f'));}if(_0x63c8('0x2b')!=typeof _0x543992['parameters'][_0x63c8('0x80')][_0x63c8('0x83')]){var _0x448d78=_0x543992[_0x63c8('0x7e')][_0x63c8('0x80')][_0x63c8('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x63c8('0x90')](_0x448d78)){_0x3a4ee6=path[_0x63c8('0x59')](_0x63c8('0x8e'),_0x4ba5b5,_0x482190[0x0],_0x448d78);}else{_0x3a4ee6=_0x448d78;}}else{logger[_0x63c8('0x6c')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5fbfab===_0x63c8('0x84')){_0x4d4c89=_0x543992['parameters'][_0x63c8('0x85')];_0x418c1a=_0x543992[_0x63c8('0x7e')]['scriptPath'];if('undefined'!=typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')]){if(_0x63c8('0x2b')!=typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')][_0x63c8('0x82')]){var _0x4416e2=_0x543992['parameters'][_0x63c8('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x63c8('0x90')](_0x4416e2)){_0x41a362=path[_0x63c8('0x59')](_0x63c8('0x8e'),_0x4ba5b5,_0x482190[0x0],_0x4416e2);}else{_0x41a362=_0x4416e2;}}if(_0x63c8('0x2b')!=typeof _0x543992[_0x63c8('0x7e')][_0x63c8('0x80')]['agent']){var _0x448d78=_0x543992['parameters'][_0x63c8('0x80')][_0x63c8('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x63c8('0x90')](_0x448d78)){_0x3a4ee6=path[_0x63c8('0x59')](_0x63c8('0x8e'),_0x4ba5b5,_0x482190[0x0],_0x448d78);}else{_0x3a4ee6=_0x448d78;}}}}var _0x554e0a={'name':_0xc96d0c,'description':_0x26520c,'path':path['join'](_0x4ba5b5,_0x482190[0x0]),'type':_0x5fbfab,'sidebar':_0x17f11e,'icon':_0x19625b,'adminUrl':_0x41a362,'agentUrl':_0x3a4ee6,'scriptName':_0x4d4c89,'scriptPath':_0x418c1a,'version':_0x33b369};removeReferences(_0x154e16,null);return db['Plugin']['create'](_0x554e0a)[_0x63c8('0x33')](function(_0x531802){var _0x581859={'role':_0x2a62fe[_0x63c8('0x91')][_0x63c8('0x92')],'userProfileId':_0x2a62fe[_0x63c8('0x91')][_0x63c8('0x93')]};if(!_0x581859)throw new Error(_0x63c8('0x94'));if(_0x581859[_0x63c8('0x92')]===_0x63c8('0x95')){var _0x22aaaf=_0x531802[_0x63c8('0x34')]({'plain':!![]});return db[_0x63c8('0x96')][_0x63c8('0x58')]({'where':{'name':'Plugins','userProfileId':_0x581859[_0x63c8('0x93')]},'raw':!![]})[_0x63c8('0x33')](function(_0x16a0e1){if(_0x16a0e1&&_0x16a0e1[_0x63c8('0x97')]===0x0){return db[_0x63c8('0x36')]['create']({'name':_0x22aaaf[_0x63c8('0x39')],'resourceId':_0x22aaaf['id'],'type':_0x16a0e1['name'],'sectionId':_0x16a0e1['id']},{})[_0x63c8('0x33')](function(){return _0x531802;});}else{return _0x531802;}})[_0x63c8('0x6e')](function(_0xb58bac){logger[_0x63c8('0x38')](_0x63c8('0x98'),_0xb58bac);throw _0xb58bac;});}return _0x531802;})[_0x63c8('0x33')](respondWithResult(_0x3e3f88,null))[_0x63c8('0x6e')](handleError(_0x3e3f88,null));}});}catch(_0x4f24fa){_0x3e3f88[_0x63c8('0x27')](0x1f4)[_0x63c8('0x3a')](_0x4f24fa);}};function removeReferences(_0xd3dcb1,_0x43e7a4){try{if(_0xd3dcb1){fs['unlinkSync'](_0xd3dcb1);logger[_0x63c8('0x6c')](_0x63c8('0x99'));}if(_0x43e7a4){rimraf(_0x43e7a4,function(){});logger[_0x63c8('0x6c')]('Extracted\x20folder\x20removed');}}catch(_0x57e5af){logger[_0x63c8('0x38')](_0x57e5af);}}exports[_0x63c8('0x9a')]=function(_0x47ee50,_0x50365f,_0x247a8a){return db[_0x63c8('0x3c')][_0x63c8('0x58')]({'where':{'id':_0x47ee50['params']['id']}})[_0x63c8('0x33')](handleEntityNotFound(_0x50365f,null))['then'](saveUpdates(_0x47ee50[_0x63c8('0x91')],null))[_0x63c8('0x33')](respondWithResult(_0x50365f,null))[_0x63c8('0x6e')](handleError(_0x50365f,null));};exports['delete']=function(_0xbb0527,_0x23e739,_0x4f74f2){return db[_0x63c8('0x3c')][_0x63c8('0x58')]({'where':{'id':_0xbb0527[_0x63c8('0x55')]['id']}})['then'](function(_0x5d1ee7){if(_0x5d1ee7){return _0x5d1ee7[_0x63c8('0x37')]();}})['then'](function(_0x6dcfe4){rimraf(path['join'](config[_0x63c8('0x5a')],'server/files/plugins',path[_0x63c8('0x65')](_0x6dcfe4[_0x63c8('0x8')])),function(){});return _0x6dcfe4;})['then'](handleEntityNotFound(_0x23e739,null))['then'](respondWithStatusCode(_0x23e739,null))[_0x63c8('0x6e')](handleError(_0x23e739,null));};exports[_0x63c8('0x9b')]=function(_0x571492,_0x2d5555,_0x35eb6c){return BPromise[_0x63c8('0x9c')]()['then'](function(){if(!_0x571492[_0x63c8('0x42')][_0x63c8('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x571492[_0x63c8('0x42')][_0x63c8('0x9d')]){throw new Error(_0x63c8('0x9e'));}var _0x5be8a6=_0x571492[_0x63c8('0x42')][_0x63c8('0x9f')]?_0x571492[_0x63c8('0x42')][_0x63c8('0x9f')]+':'+_0x571492['query']['port']:_0x63c8('0xa0')+_0x571492['query']['port'];var _0x94eaec=_0x571492[_0x63c8('0x42')][_0x63c8('0x29')]?_0x571492['query']['json']:!![];var _0x2b3d5a=_0x571492[_0x63c8('0x42')][_0x63c8('0xa1')]?_0x571492[_0x63c8('0x42')][_0x63c8('0xa1')]:null;var _0xff2788={'method':_0x571492[_0x63c8('0xa2')],'uri':util[_0x63c8('0x5c')](_0x63c8('0xa3'),_0x5be8a6,_0x571492[_0x63c8('0x42')][_0x63c8('0x8')]),'json':_0x94eaec,'resolveWithFullResponse':!![],'encoding':_0x2b3d5a,'qs':_0x571492[_0x63c8('0x42')]};if(_0x571492[_0x63c8('0xa4')]){_0xff2788[_0x63c8('0xa4')]=_0x571492[_0x63c8('0xa4')];if(_0xff2788['headers']['content-length']){delete _0xff2788['headers'][_0x63c8('0xa5')];}}if(_0xff2788[_0x63c8('0xa4')][_0x63c8('0xa6')]){delete _0xff2788[_0x63c8('0xa4')]['content-type'];}return rp(_0xff2788);})[_0x63c8('0x33')](function(_0x5e23b2){if(_0x5e23b2){_0x2d5555[_0x63c8('0x2e')](_0x5e23b2[_0x63c8('0xa4')]);logger[_0x63c8('0x6c')](_0x5e23b2['body']);if(_[_0x63c8('0xa7')](_0x571492[_0x63c8('0x42')][_0x63c8('0x8')],_0x63c8('0xa8'))&&_0x5e23b2[_0x63c8('0xa9')]==0x1f4){return _0x2d5555['sendStatus'](_0x5e23b2[_0x63c8('0xa9')]);}else{return _0x2d5555[_0x63c8('0x27')](_0x5e23b2[_0x63c8('0xa9')])['send'](_0x5e23b2[_0x63c8('0x91')]);}}else{return _0x2d5555[_0x63c8('0x26')](0xc8);}})['catch'](handleError(_0x2d5555,null));};exports[_0x63c8('0xaa')]=function(_0x441d5b,_0x564d35,_0x3c1e35){return BPromise['resolve']()[_0x63c8('0x33')](function(){if(!_0x441d5b['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x441d5b['query'][_0x63c8('0x9d')]){throw new Error(_0x63c8('0x9e'));}var _0x535471=_0x441d5b[_0x63c8('0x42')][_0x63c8('0x9f')]?_0x441d5b[_0x63c8('0x42')][_0x63c8('0x9f')]+':'+_0x441d5b[_0x63c8('0x42')][_0x63c8('0x9d')]:_0x63c8('0xa0')+_0x441d5b[_0x63c8('0x42')]['port'];var _0x1d2cae=_0x441d5b[_0x63c8('0x42')]['json']?_0x441d5b['query'][_0x63c8('0x29')]:!![];var _0x1e297a=_0x441d5b[_0x63c8('0x42')][_0x63c8('0xa1')]?_0x441d5b[_0x63c8('0x42')][_0x63c8('0xa1')]:null;var _0x3f3bfe={'method':_0x441d5b[_0x63c8('0xa2')],'uri':util[_0x63c8('0x5c')](_0x63c8('0xa3'),_0x535471,_0x441d5b['query'][_0x63c8('0x8')]),'json':_0x1d2cae,'resolveWithFullResponse':!![],'encoding':_0x1e297a,'body':_0x441d5b['body']};if(_0x441d5b[_0x63c8('0xa4')]){_0x3f3bfe[_0x63c8('0xa4')]=_0x441d5b[_0x63c8('0xa4')];if(_0x3f3bfe['headers']['content-length']){delete _0x3f3bfe[_0x63c8('0xa4')][_0x63c8('0xa5')];}}if(_0x3f3bfe[_0x63c8('0xa4')][_0x63c8('0xa6')]){delete _0x3f3bfe[_0x63c8('0xa4')][_0x63c8('0xa6')];}return rp(_0x3f3bfe);})['then'](function(_0x348588){if(_0x348588){_0x564d35[_0x63c8('0x2e')](_0x348588[_0x63c8('0xa4')]);logger[_0x63c8('0x6c')](_0x348588['body']);return _0x564d35[_0x63c8('0x27')](_0x348588[_0x63c8('0xa9')])['send'](_0x348588['body']);}else{return _0x564d35['sendStatus'](0xc8);}})[_0x63c8('0x6e')](handleError(_0x564d35,null));}; \ No newline at end of file +var _0xe207=['parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','scriptName','description','sidebar','always','icon','icon-apps','Warning:\x20admin\x20view\x20not\x20specified','plugins','script','scriptPath','test','agent','create','body','role','userProfileId','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','encoding','%s%s','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','download','find','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0xc3ee4e,_0x1b23f4){var _0x4eedba=function(_0x3f9eca){while(--_0x3f9eca){_0xc3ee4e['push'](_0xc3ee4e['shift']());}};_0x4eedba(++_0x1b23f4);}(_0xe207,0xd7));var _0x7e20=function(_0x32d354,_0x31c9e5){_0x32d354=_0x32d354-0x0;var _0x38f830=_0xe207[_0x32d354];return _0x38f830;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7e20('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e20('0x1'));var moment=require('moment');var BPromise=require(_0x7e20('0x2'));var Mustache=require(_0x7e20('0x3'));var util=require('util');var path=require('path');var sox=require(_0x7e20('0x4'));var csv=require(_0x7e20('0x5'));var ejs=require(_0x7e20('0x6'));var fs=require('fs');var fs_extra=require(_0x7e20('0x7'));var _=require(_0x7e20('0x8'));var squel=require('squel');var crypto=require(_0x7e20('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e20('0x5'));var querystring=require(_0x7e20('0xa'));var Papa=require(_0x7e20('0xb'));var extract=require(_0x7e20('0xc'));var rimraf=require(_0x7e20('0xd'));var archiver=require(_0x7e20('0xe'));var Redis=require('ioredis');var authService=require(_0x7e20('0xf'));var qs=require(_0x7e20('0x10'));var as=require(_0x7e20('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e20('0x12'))(_0x7e20('0x13'));var utils=require(_0x7e20('0x14'));var config=require(_0x7e20('0x15'));var licenseUtil=require(_0x7e20('0x16'));var db=require(_0x7e20('0x17'))['db'];config[_0x7e20('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e20('0x19'))(new Redis(config[_0x7e20('0x18')]));require(_0x7e20('0x1a'))[_0x7e20('0x1b')](socket);function respondWithStatusCode(_0x132ee1,_0x317a3e){_0x317a3e=_0x317a3e||0xcc;return function(_0x8d0a29){if(_0x8d0a29){return _0x132ee1[_0x7e20('0x1c')](_0x317a3e);}return _0x132ee1[_0x7e20('0x1d')](_0x317a3e)[_0x7e20('0x1e')]();};}function respondWithResult(_0x20d6b4,_0x16fa79){_0x16fa79=_0x16fa79||0xc8;return function(_0x414d3a){if(_0x414d3a){return _0x20d6b4['status'](_0x16fa79)[_0x7e20('0x1f')](_0x414d3a);}};}function respondWithFilteredResult(_0x4a4f05,_0x279bcb){return function(_0x607d00){if(_0x607d00){var _0x1fad8e=typeof _0x279bcb[_0x7e20('0x20')]===_0x7e20('0x21')&&typeof _0x279bcb[_0x7e20('0x22')]===_0x7e20('0x21');var _0x5d89ef=_0x607d00[_0x7e20('0x23')];var _0x17f406=_0x1fad8e?0x0:_0x279bcb[_0x7e20('0x20')];var _0x32fcf2=_0x1fad8e?_0x607d00[_0x7e20('0x23')]:_0x279bcb[_0x7e20('0x20')]+_0x279bcb[_0x7e20('0x22')];var _0x237c1d;if(_0x32fcf2>=_0x5d89ef){_0x32fcf2=_0x5d89ef;_0x237c1d=0xc8;}else{_0x237c1d=0xce;}_0x4a4f05[_0x7e20('0x1d')](_0x237c1d);return _0x4a4f05[_0x7e20('0x24')](_0x7e20('0x25'),_0x17f406+'-'+_0x32fcf2+'/'+_0x5d89ef)['json'](_0x607d00);}return null;};}function patchUpdates(_0x252837){return function(_0x3eaff4){try{jsonpatch[_0x7e20('0x26')](_0x3eaff4,_0x252837,!![]);}catch(_0x5b1dfb){return BPromise['reject'](_0x5b1dfb);}return _0x3eaff4[_0x7e20('0x27')]();};}function saveUpdates(_0x3a434d,_0x42237d){return function(_0x4a6ef0){if(_0x4a6ef0){return _0x4a6ef0[_0x7e20('0x28')](_0x3a434d)[_0x7e20('0x29')](function(_0x5a8e2a){return _0x5a8e2a;});}return null;};}function removeEntity(_0x1da80f,_0x4c01ca){return function(_0x44d8d6){if(_0x44d8d6){return _0x44d8d6['destroy']()[_0x7e20('0x29')](function(){var _0x171e65=_0x44d8d6[_0x7e20('0x2a')]({'plain':!![]});var _0x206cdc='Plugins';return db[_0x7e20('0x2b')][_0x7e20('0x2c')]({'where':{'type':_0x206cdc,'resourceId':_0x171e65['id']}})[_0x7e20('0x29')](function(){return _0x44d8d6;});})[_0x7e20('0x29')](function(){_0x1da80f[_0x7e20('0x1d')](0xcc)[_0x7e20('0x1e')]();});}};}function handleEntityNotFound(_0x5c4a0c,_0x5f24ba){return function(_0x15fd82){if(!_0x15fd82){_0x5c4a0c[_0x7e20('0x1c')](0x194);}return _0x15fd82;};}function handleError(_0xd84b7b,_0xfae259){_0xfae259=_0xfae259||0x1f4;return function(_0xde41f7){logger[_0x7e20('0x2d')](_0xde41f7[_0x7e20('0x2e')]);if(_0xde41f7[_0x7e20('0x2f')]){delete _0xde41f7['name'];}_0xd84b7b[_0x7e20('0x1d')](_0xfae259)[_0x7e20('0x30')](_0xde41f7);};}exports[_0x7e20('0x31')]=function(_0x10bd08,_0xab01b2){var _0x434482={},_0x33c954={},_0x5f3054={'count':0x0,'rows':[]};var _0x3efb20=_[_0x7e20('0x32')](db[_0x7e20('0x33')][_0x7e20('0x34')],function(_0x57313d){return{'name':_0x57313d[_0x7e20('0x35')],'type':_0x57313d[_0x7e20('0x36')][_0x7e20('0x37')]};});_0x33c954[_0x7e20('0x38')]=_[_0x7e20('0x32')](_0x3efb20,_0x7e20('0x2f'));_0x33c954[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x10bd08[_0x7e20('0x39')]);_0x33c954['filters']=_['intersection'](_0x33c954['model'],_0x33c954[_0x7e20('0x39')]);_0x434482[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x33c954[_0x7e20('0x38')],qs['fields'](_0x10bd08[_0x7e20('0x39')][_0x7e20('0x3d')]));_0x434482[_0x7e20('0x3b')]=_0x434482['attributes'][_0x7e20('0x3e')]?_0x434482[_0x7e20('0x3b')]:_0x33c954[_0x7e20('0x38')];if(!_0x10bd08[_0x7e20('0x39')][_0x7e20('0x3f')]('nolimit')){_0x434482['limit']=qs[_0x7e20('0x22')](_0x10bd08[_0x7e20('0x39')][_0x7e20('0x22')]);_0x434482[_0x7e20('0x20')]=qs[_0x7e20('0x20')](_0x10bd08[_0x7e20('0x39')][_0x7e20('0x20')]);}_0x434482[_0x7e20('0x40')]=qs[_0x7e20('0x41')](_0x10bd08[_0x7e20('0x39')]['sort']);_0x434482['where']=qs[_0x7e20('0x42')](_[_0x7e20('0x43')](_0x10bd08[_0x7e20('0x39')],_0x33c954[_0x7e20('0x42')]),_0x3efb20);if(_0x10bd08['query'][_0x7e20('0x44')]){_0x434482[_0x7e20('0x45')]=_[_0x7e20('0x46')](_0x434482[_0x7e20('0x45')],{'$or':_[_0x7e20('0x32')](_0x3efb20,function(_0x541741){if(_0x541741['type']!==_0x7e20('0x47')){var _0x4111dd={};_0x4111dd[_0x541741[_0x7e20('0x2f')]]={'$like':'%'+_0x10bd08[_0x7e20('0x39')][_0x7e20('0x44')]+'%'};return _0x4111dd;}})});}_0x434482=_[_0x7e20('0x46')]({},_0x434482,_0x10bd08['options']);var _0x2f227f={'where':_0x434482[_0x7e20('0x45')]};return db[_0x7e20('0x33')][_0x7e20('0x23')](_0x2f227f)['then'](function(_0xa63294){_0x5f3054[_0x7e20('0x23')]=_0xa63294;if(_0x10bd08[_0x7e20('0x39')][_0x7e20('0x48')]){_0x434482[_0x7e20('0x49')]=[{'all':!![]}];}return db[_0x7e20('0x33')][_0x7e20('0x4a')](_0x434482);})['then'](function(_0x51ee65){_0x5f3054[_0x7e20('0x4b')]=_0x51ee65;return _0x5f3054;})['then'](respondWithFilteredResult(_0xab01b2,_0x434482))[_0x7e20('0x4c')](handleError(_0xab01b2,null));};exports[_0x7e20('0x4d')]=function(_0x217f76,_0x647cb8){var _0x354a47={'raw':!![],'where':{'id':_0x217f76[_0x7e20('0x4e')]['id']}},_0x2a6060={};_0x2a6060['model']=_[_0x7e20('0x3a')](db[_0x7e20('0x33')]['rawAttributes']);_0x2a6060[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x217f76[_0x7e20('0x39')]);_0x2a6060[_0x7e20('0x42')]=_['intersection'](_0x2a6060[_0x7e20('0x38')],_0x2a6060['query']);_0x354a47[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x2a6060[_0x7e20('0x38')],qs[_0x7e20('0x3d')](_0x217f76[_0x7e20('0x39')][_0x7e20('0x3d')]));_0x354a47[_0x7e20('0x3b')]=_0x354a47['attributes'][_0x7e20('0x3e')]?_0x354a47[_0x7e20('0x3b')]:_0x2a6060[_0x7e20('0x38')];if(_0x217f76['query'][_0x7e20('0x48')]){_0x354a47['include']=[{'all':!![]}];}_0x354a47=_[_0x7e20('0x46')]({},_0x354a47,_0x217f76[_0x7e20('0x4f')]);return db[_0x7e20('0x33')]['find'](_0x354a47)[_0x7e20('0x29')](handleEntityNotFound(_0x647cb8,null))[_0x7e20('0x29')](respondWithResult(_0x647cb8,null))['catch'](handleError(_0x647cb8,null));};exports[_0x7e20('0x50')]=function(_0x4c1138,_0x5ea331,_0x38c6fd){return db[_0x7e20('0x33')][_0x7e20('0x51')]({'where':{'id':_0x4c1138[_0x7e20('0x4e')]['id']},'attributes':[_0x7e20('0x2f'),_0x7e20('0x52')],'raw':!![]})[_0x7e20('0x29')](handleEntityNotFound(_0x5ea331,null))[_0x7e20('0x29')](function(_0x46cb24){if(_0x46cb24){var _0x529a25=path[_0x7e20('0x53')](config[_0x7e20('0x54')],_0x7e20('0x55'),util[_0x7e20('0x56')](_0x7e20('0x57'),path[_0x7e20('0x58')](_0x46cb24[_0x7e20('0x52')])));var _0x362f76=fs[_0x7e20('0x59')](_0x529a25);var _0x470019=archiver('zip',{'zlib':{'level':0x9}});_0x470019['on'](_0x7e20('0x5a'),function(_0x2f6498){if(_0x2f6498[_0x7e20('0x5b')]===_0x7e20('0x5c')){logger[_0x7e20('0x2d')](_0x2f6498);}else{throw new db[(_0x7e20('0x5d'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x470019['on'](_0x7e20('0x2d'),function(_0x108c0f){throw new db['Sequelize'][(_0x7e20('0x5e'))](_0x7e20('0x5f'));});_0x470019[_0x7e20('0x60')](_0x362f76);_0x470019[_0x7e20('0x61')](_0x7e20('0x62'),{'cwd':path[_0x7e20('0x53')](config[_0x7e20('0x54')],_0x7e20('0x55'),path[_0x7e20('0x63')](_0x46cb24['path'])),'ignore':[path[_0x7e20('0x53')](path[_0x7e20('0x58')](_0x46cb24[_0x7e20('0x52')]),_0x7e20('0x64')),path[_0x7e20('0x53')](path['basename'](_0x46cb24[_0x7e20('0x52')]),_0x7e20('0x65'))],'nodir':!![]})['finalize']();_0x362f76['on'](_0x7e20('0x66'),function(){if(!fs['existsSync'](_0x529a25)){throw new db[(_0x7e20('0x5d'))]['Error'](_0x7e20('0x67'));}return _0x5ea331['download'](_0x529a25,util[_0x7e20('0x56')](_0x7e20('0x57'),path[_0x7e20('0x58')](_0x46cb24[_0x7e20('0x52')])),function(_0x4f8b81){if(_0x4f8b81){throw new db[(_0x7e20('0x5d'))]['Error'](_0x7e20('0x68'));}fs[_0x7e20('0x69')](_0x529a25);logger[_0x7e20('0x6a')](_0x7e20('0x6b'));logger[_0x7e20('0x6a')](_0x7e20('0x6c'));});});}return null;})[_0x7e20('0x4c')](handleError(_0x5ea331,null));};exports[_0x7e20('0x6d')]=function(_0x5bfc8a,_0x35859e,_0xfd4a8f){var _0x4768e4=path[_0x7e20('0x58')](_0x5bfc8a[_0x7e20('0x6e')][_0x7e20('0x6f')],path[_0x7e20('0x70')](_0x5bfc8a[_0x7e20('0x6e')][_0x7e20('0x6f')]));var _0x1b9da8=path['join'](config['root'],_0x7e20('0x55'),_0x5bfc8a[_0x7e20('0x6e')]['filename']);var _0x2732c4=path['join'](config[_0x7e20('0x54')],_0x7e20('0x55'),_0x4768e4);logger[_0x7e20('0x6a')](_0x7e20('0x71'),_0x1b9da8);logger['info'](_0x7e20('0x72'),_0x2732c4);try{fs[_0x7e20('0x73')](_0x1b9da8,parseInt(_0x7e20('0x74'),0x8));extract(_0x1b9da8,{'dir':_0x2732c4},function(_0x446d4d){if(_0x446d4d){logger['error'](_0x446d4d);handleError(_0x446d4d,!![]);};var _0x53e6cc=fs[_0x7e20('0x75')](_0x2732c4);if(_0x53e6cc[_0x7e20('0x3e')]>0x1){removeReferences(_0x1b9da8,_0x2732c4);logger['error'](_0x7e20('0x76'));return _0xfd4a8f(new Error(_0x7e20('0x76')));}var _0x1d85d0=fs[_0x7e20('0x77')](path[_0x7e20('0x53')](_0x2732c4,_0x53e6cc[0x0]));if(_0x1d85d0[_0x7e20('0x78')]()){removeReferences(_0x1b9da8,_0x2732c4);logger[_0x7e20('0x2d')](_0x7e20('0x76'));return _0xfd4a8f(new Error(_0x7e20('0x76')));}if(_0x1d85d0[_0x7e20('0x79')]()){var _0x2313c5=fs[_0x7e20('0x75')](path[_0x7e20('0x53')](_0x2732c4,_0x53e6cc[0x0]));if(_0x2313c5[_0x7e20('0x3e')]===0x0){removeReferences(_0x1b9da8,_0x2732c4);logger['error'](_0x7e20('0x76'));return _0xfd4a8f(new Error('Invalid\x20plugin\x20structure'));}var _0x5762e7=_0x2313c5[_0x7e20('0x7a')](function(_0x2d03ae){return _0x2d03ae===_0x7e20('0x7b');});if(!_0x5762e7){return _0xfd4a8f(new Error(_0x7e20('0x7c')));}var _0x1018aa=fs[_0x7e20('0x7d')](path['join'](_0x2732c4,_0x53e6cc[0x0],'manifest.json'));var _0x30f6e0=JSON['parse'](_0x1018aa);if('undefined'==typeof _0x30f6e0['name']){return _0xfd4a8f(new Error(_0x7e20('0x7e')));}if('undefined'==typeof _0x30f6e0[_0x7e20('0x36')]){return _0xfd4a8f(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x7e20('0x21')==typeof _0x30f6e0[_0x7e20('0x7f')]){return _0xfd4a8f(new Error(_0x7e20('0x80')));}if(_0x7e20('0x21')==typeof _0x30f6e0[_0x7e20('0x81')]){return _0xfd4a8f(new Error(_0x7e20('0x82')));}if(_0x30f6e0[_0x7e20('0x36')]===_0x7e20('0x83')){if(_0x7e20('0x21')==typeof _0x30f6e0['parameters'][_0x7e20('0x84')]){return _0xfd4a8f(new Error(_0x7e20('0x85')));}if(_0x7e20('0x21')==typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')][_0x7e20('0x86')]&&_0x7e20('0x21')==typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')]['agent']){return _0xfd4a8f(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x30f6e0[_0x7e20('0x36')]==='script'){if('undefined'==typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x87')]){return _0xfd4a8f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x30f6e0['parameters']['scriptPath']){return _0xfd4a8f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xfd4a8f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x30dae4=_0x30f6e0[_0x7e20('0x2f')];var _0x477f13=_0x30f6e0[_0x7e20('0x88')];var _0x547b27=_0x30f6e0[_0x7e20('0x36')];var _0x48de1f=_0x30f6e0[_0x7e20('0x89')]?_0x30f6e0['sidebar']:_0x7e20('0x8a');var _0x2d4df2=_0x30f6e0[_0x7e20('0x8b')]?_0x30f6e0[_0x7e20('0x8b')]:_0x7e20('0x8c');var _0x311923='';var _0x171e5c='';var _0x263a2f='';var _0x30218e='';var _0x52344b=_0x30f6e0['version'];if(_0x547b27===_0x7e20('0x83')){if('undefined'!=typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')][_0x7e20('0x86')]){var _0x261f6c=_0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x261f6c)){_0x311923=path['join']('plugins',_0x4768e4,_0x53e6cc[0x0],_0x261f6c);}else{_0x311923=_0x261f6c;}}else{logger[_0x7e20('0x6a')](_0x7e20('0x8d'));}if(_0x7e20('0x21')!=typeof _0x30f6e0[_0x7e20('0x81')]['views']['agent']){var _0x48d0ac=_0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x48d0ac)){_0x171e5c=path[_0x7e20('0x53')](_0x7e20('0x8e'),_0x4768e4,_0x53e6cc[0x0],_0x48d0ac);}else{_0x171e5c=_0x48d0ac;}}else{logger[_0x7e20('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x547b27===_0x7e20('0x8f')){_0x263a2f=_0x30f6e0[_0x7e20('0x81')][_0x7e20('0x87')];_0x30218e=_0x30f6e0[_0x7e20('0x81')][_0x7e20('0x90')];if(_0x7e20('0x21')!=typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')]){if(_0x7e20('0x21')!=typeof _0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')][_0x7e20('0x86')]){var _0x261f6c=_0x30f6e0[_0x7e20('0x81')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7e20('0x91')](_0x261f6c)){_0x311923=path[_0x7e20('0x53')](_0x7e20('0x8e'),_0x4768e4,_0x53e6cc[0x0],_0x261f6c);}else{_0x311923=_0x261f6c;}}if(_0x7e20('0x21')!=typeof _0x30f6e0[_0x7e20('0x81')]['views'][_0x7e20('0x92')]){var _0x48d0ac=_0x30f6e0[_0x7e20('0x81')][_0x7e20('0x84')][_0x7e20('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x7e20('0x91')](_0x48d0ac)){_0x171e5c=path[_0x7e20('0x53')](_0x7e20('0x8e'),_0x4768e4,_0x53e6cc[0x0],_0x48d0ac);}else{_0x171e5c=_0x48d0ac;}}}}var _0x1efae0={'name':_0x30dae4,'description':_0x477f13,'path':path[_0x7e20('0x53')](_0x4768e4,_0x53e6cc[0x0]),'type':_0x547b27,'sidebar':_0x48de1f,'icon':_0x2d4df2,'adminUrl':_0x311923,'agentUrl':_0x171e5c,'scriptName':_0x263a2f,'scriptPath':_0x30218e,'version':_0x52344b};removeReferences(_0x1b9da8,null);return db[_0x7e20('0x33')][_0x7e20('0x93')](_0x1efae0)['then'](function(_0x4485fd){var _0x279efd={'role':_0x5bfc8a[_0x7e20('0x94')][_0x7e20('0x95')],'userProfileId':_0x5bfc8a[_0x7e20('0x94')][_0x7e20('0x96')]};if(!_0x279efd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x279efd[_0x7e20('0x95')]==='user'){var _0x493324=_0x4485fd[_0x7e20('0x2a')]({'plain':!![]});return db[_0x7e20('0x97')]['find']({'where':{'name':_0x7e20('0x98'),'userProfileId':_0x279efd['userProfileId']},'raw':!![]})[_0x7e20('0x29')](function(_0x47302c){if(_0x47302c&&_0x47302c['autoAssociation']===0x0){return db[_0x7e20('0x2b')]['create']({'name':_0x493324[_0x7e20('0x2f')],'resourceId':_0x493324['id'],'type':_0x47302c['name'],'sectionId':_0x47302c['id']},{})['then'](function(){return _0x4485fd;});}else{return _0x4485fd;}})[_0x7e20('0x4c')](function(_0x4f8af8){logger[_0x7e20('0x2d')](_0x7e20('0x99'),_0x4f8af8);throw _0x4f8af8;});}return _0x4485fd;})['then'](respondWithResult(_0x35859e,null))[_0x7e20('0x4c')](handleError(_0x35859e,null));}});}catch(_0x531416){_0x35859e[_0x7e20('0x1d')](0x1f4)[_0x7e20('0x30')](_0x531416);}};function removeReferences(_0x553702,_0x509147){try{if(_0x553702){fs[_0x7e20('0x69')](_0x553702);logger[_0x7e20('0x6a')](_0x7e20('0x9a'));}if(_0x509147){rimraf(_0x509147,function(){});logger['info'](_0x7e20('0x9b'));}}catch(_0x203a7b){logger[_0x7e20('0x2d')](_0x203a7b);}}exports[_0x7e20('0x28')]=function(_0xc814ea,_0x55fece,_0x3d1ea2){return db[_0x7e20('0x33')][_0x7e20('0x51')]({'where':{'id':_0xc814ea['params']['id']}})[_0x7e20('0x29')](handleEntityNotFound(_0x55fece,null))[_0x7e20('0x29')](saveUpdates(_0xc814ea['body'],null))['then'](respondWithResult(_0x55fece,null))['catch'](handleError(_0x55fece,null));};exports[_0x7e20('0x9c')]=function(_0x326017,_0x5395c9,_0xb1f6cf){return db[_0x7e20('0x33')][_0x7e20('0x51')]({'where':{'id':_0x326017[_0x7e20('0x4e')]['id']}})[_0x7e20('0x29')](function(_0xdcbeb6){if(_0xdcbeb6){return _0xdcbeb6[_0x7e20('0x2c')]();}})[_0x7e20('0x29')](function(_0x315b05){rimraf(path[_0x7e20('0x53')](config[_0x7e20('0x54')],_0x7e20('0x55'),path['dirname'](_0x315b05[_0x7e20('0x52')])),function(){});return _0x315b05;})[_0x7e20('0x29')](handleEntityNotFound(_0x5395c9,null))['then'](respondWithStatusCode(_0x5395c9,null))['catch'](handleError(_0x5395c9,null));};exports[_0x7e20('0x9d')]=function(_0xbb0e3f,_0x44185b,_0x3e7713){return BPromise[_0x7e20('0x9e')]()[_0x7e20('0x29')](function(){if(!_0xbb0e3f[_0x7e20('0x39')]['path']){throw new Error(_0x7e20('0x9f'));}if(!_0xbb0e3f[_0x7e20('0x39')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x357fd6=_0xbb0e3f[_0x7e20('0x39')]['hostname']?_0xbb0e3f[_0x7e20('0x39')][_0x7e20('0xa0')]+':'+_0xbb0e3f['query'][_0x7e20('0xa1')]:_0x7e20('0xa2')+_0xbb0e3f[_0x7e20('0x39')][_0x7e20('0xa1')];var _0x4f0b94=_0xbb0e3f['query'][_0x7e20('0x1f')]?_0xbb0e3f[_0x7e20('0x39')][_0x7e20('0x1f')]:!![];var _0x542f87=_0xbb0e3f[_0x7e20('0x39')]['encoding']?_0xbb0e3f[_0x7e20('0x39')]['encoding']:null;var _0x52e62f={'method':_0xbb0e3f[_0x7e20('0xa3')],'uri':util[_0x7e20('0x56')]('%s%s',_0x357fd6,_0xbb0e3f[_0x7e20('0x39')][_0x7e20('0x52')]),'json':_0x4f0b94,'resolveWithFullResponse':!![],'encoding':_0x542f87,'qs':_0xbb0e3f[_0x7e20('0x39')]};if(_0xbb0e3f[_0x7e20('0xa4')]){_0x52e62f[_0x7e20('0xa4')]=_0xbb0e3f[_0x7e20('0xa4')];if(_0x52e62f[_0x7e20('0xa4')][_0x7e20('0xa5')]){delete _0x52e62f['headers']['content-length'];}}if(_0x52e62f[_0x7e20('0xa4')][_0x7e20('0xa6')]){delete _0x52e62f[_0x7e20('0xa4')][_0x7e20('0xa6')];}return rp(_0x52e62f);})[_0x7e20('0x29')](function(_0x5b6916){if(_0x5b6916){_0x44185b[_0x7e20('0x24')](_0x5b6916[_0x7e20('0xa4')]);logger['info'](_0x5b6916['body']);if(_[_0x7e20('0xa7')](_0xbb0e3f['query'][_0x7e20('0x52')],'download')&&_0x5b6916['statusCode']==0x1f4){return _0x44185b[_0x7e20('0x1c')](_0x5b6916[_0x7e20('0xa8')]);}else{return _0x44185b[_0x7e20('0x1d')](_0x5b6916[_0x7e20('0xa8')])['send'](_0x5b6916[_0x7e20('0x94')]);}}else{return _0x44185b[_0x7e20('0x1c')](0xc8);}})[_0x7e20('0x4c')](handleError(_0x44185b,null));};exports[_0x7e20('0xa9')]=function(_0x491c44,_0x5b0958,_0x62121){return BPromise[_0x7e20('0x9e')]()[_0x7e20('0x29')](function(){if(!_0x491c44[_0x7e20('0x39')][_0x7e20('0x52')]){throw new Error(_0x7e20('0x9f'));}if(!_0x491c44[_0x7e20('0x39')][_0x7e20('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x240258=_0x491c44['query'][_0x7e20('0xa0')]?_0x491c44['query']['hostname']+':'+_0x491c44[_0x7e20('0x39')][_0x7e20('0xa1')]:'http://localhost:'+_0x491c44[_0x7e20('0x39')]['port'];var _0x57ee02=_0x491c44[_0x7e20('0x39')][_0x7e20('0x1f')]?_0x491c44['query'][_0x7e20('0x1f')]:!![];var _0x4d7c23=_0x491c44[_0x7e20('0x39')][_0x7e20('0xaa')]?_0x491c44[_0x7e20('0x39')][_0x7e20('0xaa')]:null;var _0x267f04={'method':_0x491c44['method'],'uri':util[_0x7e20('0x56')](_0x7e20('0xab'),_0x240258,_0x491c44['query'][_0x7e20('0x52')]),'json':_0x57ee02,'resolveWithFullResponse':!![],'encoding':_0x4d7c23,'body':_0x491c44['body']};if(_0x491c44[_0x7e20('0xa4')]){_0x267f04[_0x7e20('0xa4')]=_0x491c44['headers'];if(_0x267f04[_0x7e20('0xa4')]['content-length']){delete _0x267f04[_0x7e20('0xa4')][_0x7e20('0xa5')];}}if(_0x267f04[_0x7e20('0xa4')][_0x7e20('0xa6')]){delete _0x267f04['headers'][_0x7e20('0xa6')];}return rp(_0x267f04);})[_0x7e20('0x29')](function(_0x240c34){if(_0x240c34){_0x5b0958[_0x7e20('0x24')](_0x240c34[_0x7e20('0xa4')]);logger[_0x7e20('0x6a')](_0x240c34[_0x7e20('0x94')]);return _0x5b0958[_0x7e20('0x1d')](_0x240c34[_0x7e20('0xa8')])[_0x7e20('0x30')](_0x240c34[_0x7e20('0x94')]);}else{return _0x5b0958[_0x7e20('0x1c')](0xc8);}})[_0x7e20('0x4c')](handleError(_0x5b0958,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 117bb23..194ceb2 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 _0x9973=['Plugin','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xe29881,_0x3b8c5e){var _0x36d87d=function(_0x573084){while(--_0x573084){_0xe29881['push'](_0xe29881['shift']());}};_0x36d87d(++_0x3b8c5e);}(_0x9973,0x157));var _0x3997=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9973[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x3997('0x0'))['db'][_0x3997('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3997('0x2'),'afterUpdate':_0x3997('0x3'),'afterDestroy':_0x3997('0x4')};function emitEvent(_0x36e0bc){return function(_0x873171,_0x30c504,_0x300493){PluginEvents['emit'](_0x36e0bc+':'+_0x873171['id'],_0x873171);PluginEvents['emit'](_0x36e0bc,_0x873171);_0x300493(null);};}for(var e in events){if(events[_0x3997('0x5')](e)){var event=events[e];Plugin[_0x3997('0x6')](e,emitEvent(event));}}module[_0x3997('0x7')]=PluginEvents; \ No newline at end of file +var _0x36bb=['events','../../mysqldb','Plugin','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x312b6a,_0x4d0deb){var _0x4407da=function(_0x95e0bf){while(--_0x95e0bf){_0x312b6a['push'](_0x312b6a['shift']());}};_0x4407da(++_0x4d0deb);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb36b('0x0'));var Plugin=require(_0xb36b('0x1'))['db'][_0xb36b('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb36b('0x3'),'afterUpdate':_0xb36b('0x4'),'afterDestroy':_0xb36b('0x5')};function emitEvent(_0x4003b8){return function(_0x311671,_0x3d57d7,_0x2bcc68){PluginEvents[_0xb36b('0x6')](_0x4003b8+':'+_0x311671['id'],_0x311671);PluginEvents[_0xb36b('0x6')](_0x4003b8,_0x311671);_0x2bcc68(null);};}for(var e in events){if(events[_0xb36b('0x7')](e)){var event=events[e];Plugin[_0xb36b('0x8')](e,emitEvent(event));}}module[_0xb36b('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 68a1c5e..53e9637 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 _0x998b=['exports','Plugin','plugins','lodash','api','moment','bluebird','request-promise','../../config/environment','./plugin.attributes'];(function(_0x408980,_0x1d5b71){var _0xd147ea=function(_0x4d7a51){while(--_0x4d7a51){_0x408980['push'](_0x408980['shift']());}};_0xd147ea(++_0x1d5b71);}(_0x998b,0x99));var _0xb998=function(_0x3fba69,_0x557c31){_0x3fba69=_0x3fba69-0x0;var _0x562064=_0x998b[_0x3fba69];return _0x562064;};'use strict';var _=require(_0xb998('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb998('0x1'));var moment=require(_0xb998('0x2'));var BPromise=require(_0xb998('0x3'));var rp=require(_0xb998('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb998('0x5'));var attributes=require(_0xb998('0x6'));module[_0xb998('0x7')]=function(_0x8152e9,_0x19e553){return _0x8152e9['define'](_0xb998('0x8'),attributes,{'tableName':_0xb998('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f19=['Plugin','plugins','util','api','request-promise','path','../../config/environment','./plugin.attributes','define'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x9f19,0x17c));var _0x99f1=function(_0x29eda8,_0x1fdceb){_0x29eda8=_0x29eda8-0x0;var _0xcb236a=_0x9f19[_0x29eda8];return _0xcb236a;};'use strict';var _=require('lodash');var util=require(_0x99f1('0x0'));var logger=require('../../config/logger')(_0x99f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99f1('0x2'));var fs=require('fs');var path=require(_0x99f1('0x3'));var rimraf=require('rimraf');var config=require(_0x99f1('0x4'));var attributes=require(_0x99f1('0x5'));module['exports']=function(_0xbd7457,_0x2fd7b3){return _0xbd7457[_0x99f1('0x6')](_0x99f1('0x7'),attributes,{'tableName':_0x99f1('0x8'),'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 b74c75c..87185a7 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 _0x7aab=['catch','CreatePlugin','Plugin','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x7aab,0x15c));var _0xb7aa=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7aab[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xb7aa('0x0'));var util=require(_0xb7aa('0x1'));var moment=require(_0xb7aa('0x2'));var BPromise=require(_0xb7aa('0x3'));var rs=require(_0xb7aa('0x4'));var fs=require('fs');var Redis=require(_0xb7aa('0x5'));var db=require(_0xb7aa('0x6'))['db'];var utils=require(_0xb7aa('0x7'));var logger=require(_0xb7aa('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb7aa('0x9')][_0xb7aa('0xa')]({'port':0x232a});config[_0xb7aa('0xb')]=_[_0xb7aa('0xc')](config[_0xb7aa('0xb')],{'host':_0xb7aa('0xd'),'port':0x18eb});var socket=require(_0xb7aa('0xe'))(new Redis(config[_0xb7aa('0xb')]));require('./plugin.socket')[_0xb7aa('0xf')](socket);function respondWithRpcPromise(_0x2eff8e,_0x18c121,_0x2dcdad){return new BPromise(function(_0x1fe3e4,_0xb75ace){return client[_0xb7aa('0x10')](_0x2eff8e,_0x2dcdad)[_0xb7aa('0x11')](function(_0x332775){logger[_0xb7aa('0x12')](_0xb7aa('0x13'),_0x18c121,'request\x20sent');logger['debug'](_0xb7aa('0x14'),_0x18c121,'request\x20sent',JSON['stringify'](_0x332775));if(_0x332775[_0xb7aa('0x15')]){if(_0x332775[_0xb7aa('0x15')][_0xb7aa('0x16')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x18c121,_0x332775[_0xb7aa('0x15')][_0xb7aa('0x17')]);return _0xb75ace(_0x332775['error'][_0xb7aa('0x17')]);}logger[_0xb7aa('0x15')]('Plugin,\x20%s,\x20%s',_0x18c121,_0x332775[_0xb7aa('0x15')][_0xb7aa('0x17')]);return _0x1fe3e4(_0x332775[_0xb7aa('0x15')][_0xb7aa('0x17')]);}else{logger[_0xb7aa('0x12')](_0xb7aa('0x13'),_0x18c121,'request\x20sent');_0x1fe3e4(_0x332775['result']['message']);}})[_0xb7aa('0x18')](function(_0x4d5f02){logger['error']('Plugin,\x20%s,\x20%s',_0x18c121,_0x4d5f02);_0xb75ace(_0x4d5f02);});});}exports[_0xb7aa('0x19')]=function(_0x2f7e9b){var _0xf44579=this;return new Promise(function(_0xab50c9,_0x182a74){return db[_0xb7aa('0x1a')][_0xb7aa('0x1b')](_0x2f7e9b[_0xb7aa('0x1c')],{'raw':_0x2f7e9b['options']?_0x2f7e9b[_0xb7aa('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xb7aa('0x11')](function(_0x26478f){logger['info'](_0xb7aa('0x19'),_0x2f7e9b);logger['debug'](_0xb7aa('0x19'),_0x2f7e9b,JSON[_0xb7aa('0x1e')](_0x26478f));_0xab50c9(_0x26478f);})['catch'](function(_0x1add7d){logger[_0xb7aa('0x15')](_0xb7aa('0x19'),_0x1add7d[_0xb7aa('0x17')],_0x2f7e9b);_0x182a74(_0xf44579[_0xb7aa('0x15')](0x1f4,_0x1add7d[_0xb7aa('0x17')]));});});}; \ No newline at end of file +var _0xdc1b=['then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','create','body','options','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request'];(function(_0x52c6f5,_0x17171b){var _0x4cd3fe=function(_0x5d502e){while(--_0x5d502e){_0x52c6f5['push'](_0x52c6f5['shift']());}};_0x4cd3fe(++_0x17171b);}(_0xdc1b,0x1f0));var _0xbdc1=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xdc1b[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require(_0xbdc1('0x0'));var util=require(_0xbdc1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbdc1('0x2'));var fs=require('fs');var Redis=require(_0xbdc1('0x3'));var db=require(_0xbdc1('0x4'))['db'];var utils=require(_0xbdc1('0x5'));var logger=require('../../config/logger')(_0xbdc1('0x6'));var config=require('../../config/environment');var jayson=require(_0xbdc1('0x7'));var client=jayson['client'][_0xbdc1('0x8')]({'port':0x232a});config['redis']=_[_0xbdc1('0x9')](config[_0xbdc1('0xa')],{'host':_0xbdc1('0xb'),'port':0x18eb});var socket=require(_0xbdc1('0xc'))(new Redis(config[_0xbdc1('0xa')]));require(_0xbdc1('0xd'))[_0xbdc1('0xe')](socket);function respondWithRpcPromise(_0x15700a,_0x507805,_0x25e132){return new BPromise(function(_0x2e2472,_0x1f5f35){return client[_0xbdc1('0xf')](_0x15700a,_0x25e132)[_0xbdc1('0x10')](function(_0x17c939){logger['info']('Plugin,\x20%s,\x20%s',_0x507805,_0xbdc1('0x11'));logger[_0xbdc1('0x12')](_0xbdc1('0x13'),_0x507805,_0xbdc1('0x11'),JSON[_0xbdc1('0x14')](_0x17c939));if(_0x17c939[_0xbdc1('0x15')]){if(_0x17c939['error'][_0xbdc1('0x16')]===0x1f4){logger['error'](_0xbdc1('0x17'),_0x507805,_0x17c939['error'][_0xbdc1('0x18')]);return _0x1f5f35(_0x17c939[_0xbdc1('0x15')][_0xbdc1('0x18')]);}logger[_0xbdc1('0x15')](_0xbdc1('0x17'),_0x507805,_0x17c939[_0xbdc1('0x15')][_0xbdc1('0x18')]);return _0x2e2472(_0x17c939[_0xbdc1('0x15')][_0xbdc1('0x18')]);}else{logger['info'](_0xbdc1('0x17'),_0x507805,_0xbdc1('0x11'));_0x2e2472(_0x17c939[_0xbdc1('0x19')][_0xbdc1('0x18')]);}})['catch'](function(_0x2c4037){logger['error'](_0xbdc1('0x17'),_0x507805,_0x2c4037);_0x1f5f35(_0x2c4037);});});}exports[_0xbdc1('0x1a')]=function(_0x29a635){var _0xc3e11b=this;return new Promise(function(_0x413d8c,_0x570617){return db[_0xbdc1('0x1b')][_0xbdc1('0x1c')](_0x29a635[_0xbdc1('0x1d')],{'raw':_0x29a635[_0xbdc1('0x1e')]?_0x29a635[_0xbdc1('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x177752){logger['info']('CreatePlugin',_0x29a635);logger[_0xbdc1('0x12')]('CreatePlugin',_0x29a635,JSON[_0xbdc1('0x14')](_0x177752));_0x413d8c(_0x177752);})[_0xbdc1('0x1f')](function(_0x14cbc3){logger[_0xbdc1('0x15')]('CreatePlugin',_0x14cbc3[_0xbdc1('0x18')],_0x29a635);_0x570617(_0xc3e11b['error'](0x1f4,_0x14cbc3[_0xbdc1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 23b3b8a..34ef445 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 _0x7a65=['length','plugin:','./plugin.events','save','remove','update','removeListener','register'];(function(_0x3cd20e,_0xc160d){var _0x2aab28=function(_0x3162da){while(--_0x3162da){_0x3cd20e['push'](_0x3cd20e['shift']());}};_0x2aab28(++_0xc160d);}(_0x7a65,0x6a));var _0x57a6=function(_0x7ee5f2,_0x306501){_0x7ee5f2=_0x7ee5f2-0x0;var _0x107dfd=_0x7a65[_0x7ee5f2];return _0x107dfd;};'use strict';var PluginEvents=require(_0x57a6('0x0'));var events=[_0x57a6('0x1'),_0x57a6('0x2'),_0x57a6('0x3')];function createListener(_0xef9873,_0x5bedfa){return function(_0x167c2a){_0x5bedfa['emit'](_0xef9873,_0x167c2a);};}function removeListener(_0x28b285,_0x2e3a9a){return function(){PluginEvents[_0x57a6('0x4')](_0x28b285,_0x2e3a9a);};}exports[_0x57a6('0x5')]=function(_0xf5b9aa){for(var _0x33309c=0x0,_0x2bf611=events[_0x57a6('0x6')];_0x33309c<_0x2bf611;_0x33309c++){var _0x421f08=events[_0x33309c];var _0x4080ae=createListener(_0x57a6('0x7')+_0x421f08,_0xf5b9aa);PluginEvents['on'](_0x421f08,_0x4080ae);}}; \ No newline at end of file +var _0x5058=['save','remove','update','emit','removeListener','length','plugin:'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x5058,0x165));var _0x8505=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x5058[_0x2d2ca2];return _0x48489d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x8505('0x0'),_0x8505('0x1'),_0x8505('0x2')];function createListener(_0x1f740e,_0x51c6c5){return function(_0x67107e){_0x51c6c5[_0x8505('0x3')](_0x1f740e,_0x67107e);};}function removeListener(_0x46dbc0,_0x15881d){return function(){PluginEvents[_0x8505('0x4')](_0x46dbc0,_0x15881d);};}exports['register']=function(_0x41786b){for(var _0x545699=0x0,_0x26e29a=events[_0x8505('0x5')];_0x545699<_0x26e29a;_0x545699++){var _0x32d587=events[_0x545699];var _0x20b4b0=createListener(_0x8505('0x6')+_0x32d587,_0x41786b);PluginEvents['on'](_0x32d587,_0x20b4b0);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9f50c0c..d88ad01 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(_0x3918cf,_0x3e8e61){var _0x5745da=function(_0x40b270){while(--_0x40b270){_0x3918cf['push'](_0x3918cf['shift']());}};_0x5745da(++_0x3e8e61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x180422,_0x2b2d0a){var _0x27650c=function(_0x5f1b24){while(--_0x5f1b24){_0x180422['push'](_0x180422['shift']());}};_0x27650c(++_0x2b2d0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 0cfd8ed..56c06ab 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 _0xd404=['stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','api','path','exec','bluebird','sendStatus','json','name','status','send','npm\x20install','info','error','index','list','then','express','motion2','length','catch','show','describe','params','body','join','script','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x5c4475,_0x5212de){var _0x5e97e5=function(_0x2257fa){while(--_0x2257fa){_0x5c4475['push'](_0x5c4475['shift']());}};_0x5e97e5(++_0x5212de);}(_0xd404,0x15b));var _0x4d40=function(_0x3d90fe,_0x5e85a8){_0x3d90fe=_0x3d90fe-0x0;var _0x4adb9d=_0xd404[_0x3d90fe];return _0x4adb9d;};'use strict';var _=require(_0x4d40('0x0'));var pm2=require(_0x4d40('0x1'));var logger=require('../../config/logger')(_0x4d40('0x2'));var path=require(_0x4d40('0x3'));var exec=require('child_process')[_0x4d40('0x4')];var BPromise=require(_0x4d40('0x5'));function handleEntityNotFound(_0xba821,_0x8bde12){return function(_0xbfb4c6){if(!_0xbfb4c6){_0xba821[_0x4d40('0x6')](0x194);;}return _0xbfb4c6;};}function respondWithResult(_0xc2a9db,_0x24a237){_0x24a237=_0x24a237||0xc8;return function(_0x2e4bd8){if(_0x2e4bd8){return _0xc2a9db['status'](_0x24a237)[_0x4d40('0x7')](_0x2e4bd8);}return null;};}function handleError(_0x116941,_0x5a23a2){_0x5a23a2=_0x5a23a2||0x1f4;return function(_0x3bf81a){logger['error'](_0x3bf81a['stack']);if(_0x3bf81a[_0x4d40('0x8')]){delete _0x3bf81a[_0x4d40('0x8')];}_0x116941[_0x4d40('0x9')](_0x5a23a2)[_0x4d40('0xa')](_0x3bf81a);};}function execChildProcess(){return new BPromise(function(_0x1d00cf,_0x357abf){exec(_0x4d40('0xb'),function(_0x2eab7a,_0x1e18bc,_0x3f5c29){logger[_0x4d40('0xc')](_0x1e18bc);logger[_0x4d40('0xc')](_0x3f5c29);if(_0x2eab7a){logger[_0x4d40('0xd')](_0x2eab7a);return _0x357abf(_0x2eab7a);}return _0x1d00cf(_0x1e18bc);});});}exports[_0x4d40('0xe')]=function(_0x5162f9,_0xa644d2){return pm2[_0x4d40('0xf')]()[_0x4d40('0x10')](function(_0x2083bd){if(_0x2083bd){var _0x477a91=_['reject'](_0x2083bd,function(_0x23de7b){return _0x23de7b[_0x4d40('0x8')]===_0x4d40('0x11')||_0x23de7b[_0x4d40('0x8')]===_0x4d40('0x12');});return{'rows':_0x477a91,'count':_0x477a91[_0x4d40('0x13')]};}return null;})[_0x4d40('0x10')](respondWithResult(_0xa644d2,null))[_0x4d40('0x14')](handleError(_0xa644d2,null));};exports[_0x4d40('0x15')]=function(_0x4b5d23,_0x535989){return pm2[_0x4d40('0x16')](_0x4b5d23[_0x4d40('0x17')]['id'])['then'](respondWithResult(_0x535989,null))[_0x4d40('0x10')](handleEntityNotFound(_0x535989,null))[_0x4d40('0x14')](handleError(_0x535989,null));};exports['create']=function(_0x36d031,_0x5a77e0){if(_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')]&&_0x36d031['body']['script']){var _0x375ce0=path[_0x4d40('0x19')](__dirname,'../../files/plugins',_0x36d031[_0x4d40('0x18')][_0x4d40('0x1a')]);var _0x30f058=process['cwd']();process[_0x4d40('0x1b')](path[_0x4d40('0x1c')](_0x375ce0));return execChildProcess()[_0x4d40('0x10')](function(_0x5ca0a0){process['chdir'](_0x30f058);return pm2[_0x4d40('0x1d')]({'name':_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')],'script':_0x375ce0});})[_0x4d40('0x10')](function(_0x4677c9){pm2['dump']();return _0x4677c9[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a77e0,0xc9))[_0x4d40('0x14')](handleError(_0x5a77e0,null));}else{return _0x5a77e0['status'](0x1f4)['send']({'message':_0x4d40('0x1e')});}};exports[_0x4d40('0x1f')]=function(_0x3fa83e,_0x3ad1d7){if(_0x3fa83e[_0x4d40('0x18')]['id']){delete _0x3fa83e[_0x4d40('0x18')]['id'];}var _0x105635={'online':_0x4d40('0x20'),'stopped':_0x4d40('0x21')};if(_0x105635[_0x4d40('0x22')](_0x3fa83e[_0x4d40('0x18')]['status'])){return pm2[_0x105635[_0x3fa83e['body']['status']]](_0x3fa83e[_0x4d40('0x17')]['id'])[_0x4d40('0x10')](respondWithResult(_0x3ad1d7,0xc8))[_0x4d40('0x14')](handleError(_0x3ad1d7,null));}else{return _0x3ad1d7[_0x4d40('0x9')](0x1f4)['send']({'message':_0x4d40('0x23')});}};exports[_0x4d40('0x24')]=function(_0x429da9,_0x5a6aff){if(_0x429da9[_0x4d40('0x18')]['id']){delete _0x429da9[_0x4d40('0x18')]['id'];}if(_0x429da9[_0x4d40('0x17')]['id']){return pm2[_0x4d40('0x25')](_0x429da9[_0x4d40('0x17')]['id'])['then'](function(_0x2f4b22){pm2['dump']();return _0x2f4b22[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a6aff,null))[_0x4d40('0x14')](handleError(_0x5a6aff,null));}else{return _0x5a6aff[_0x4d40('0x9')](0x1f4)[_0x4d40('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x48cdea,_0x553c17){var _0x472693=function(_0x55cf59){while(--_0x55cf59){_0x48cdea['push'](_0x48cdea['shift']());}};_0x472693(++_0x553c17);}(_0x2750,0x13b));var _0x0275=function(_0x8b69ee,_0x44cda6){_0x8b69ee=_0x8b69ee-0x0;var _0x4cbc03=_0x2750[_0x8b69ee];return _0x4cbc03;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 99dd3ab..d33b348 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 _0x5232=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x5c93ec,_0x19e357){var _0x9fe90f=function(_0x151f02){while(--_0x151f02){_0x5c93ec['push'](_0x5c93ec['shift']());}};_0x9fe90f(++_0x19e357);}(_0x5232,0x1c9));var _0x2523=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x5232[_0x40bffc];return _0x3007e9;};'use strict';var express=require(_0x2523('0x0'));var router=express[_0x2523('0x1')]();var auth=require(_0x2523('0x2'));var controller=require(_0x2523('0x3'));router[_0x2523('0x4')]('/queues',auth['isAuthenticated'](),controller[_0x2523('0x5')]);module[_0x2523('0x6')]=router; \ No newline at end of file +var _0x6075=['express','../../components/auth/service','./realtime.controller','/queues','isAuthenticated','getQueues','exports'];(function(_0x4b558b,_0x2d22c6){var _0x1b96f1=function(_0x3e3922){while(--_0x3e3922){_0x4b558b['push'](_0x4b558b['shift']());}};_0x1b96f1(++_0x2d22c6);}(_0x6075,0x126));var _0x5607=function(_0x4e837a,_0x4ead83){_0x4e837a=_0x4e837a-0x0;var _0x207389=_0x6075[_0x4e837a];return _0x207389;};'use strict';var express=require(_0x5607('0x0'));var router=express['Router']();var auth=require(_0x5607('0x1'));var controller=require(_0x5607('0x2'));router['get'](_0x5607('0x3'),auth[_0x5607('0x4')](),controller[_0x5607('0x5')]);module[_0x5607('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 2d3c042..359f953 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 _0x814b=['Queue','map','rawAttributes','fieldName','type','getOptions','role','user','userProfileId','outbound','QueueCampaigns','startCase','Queues','UserProfile','getResources','format','result','waiting','talking','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','available','paused','find','merge','pick','getAgents','online','getMembers','length','agents','Pause','findAll','QueueId','User','UserId','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','limit','undefined','count','set','json','error','stack','name','status','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','then','query','Invalid\x20channel','channel'];(function(_0x37f7da,_0x45bdf4){var _0xf759fb=function(_0x2865e8){while(--_0x2865e8){_0x37f7da['push'](_0x37f7da['shift']());}};_0xf759fb(++_0x45bdf4);}(_0x814b,0x1a2));var _0xb814=function(_0x36bf46,_0x3d8db9){_0x36bf46=_0x36bf46-0x0;var _0x1d0a72=_0x814b[_0x36bf46];return _0x1d0a72;};'use strict';var util=require(_0xb814('0x0'));var _=require(_0xb814('0x1'));var jayson=require(_0xb814('0x2'));var qs=require(_0xb814('0x3'));var logger=require(_0xb814('0x4'))(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var client=jayson[_0xb814('0x6')][_0xb814('0x7')]({'port':0x232a});var routingClient=jayson[_0xb814('0x6')][_0xb814('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x44931c,_0x322a70){return function(_0x53e507){if(_0x53e507){var _0x3b0829=typeof _0x322a70[_0xb814('0x8')]==='undefined'&&typeof _0x322a70[_0xb814('0x9')]===_0xb814('0xa');var _0x186d5a=_0x53e507[_0xb814('0xb')];var _0x1fea33=_0x3b0829?0x0:_0x322a70[_0xb814('0x8')];var _0x1086f8=_0x3b0829?_0x53e507[_0xb814('0xb')]:_0x322a70[_0xb814('0x8')]+_0x322a70[_0xb814('0x9')];var _0x10e4a6;if(_0x1086f8>=_0x186d5a){_0x1086f8=_0x186d5a;_0x10e4a6=0xc8;}else{_0x10e4a6=0xce;}_0x44931c['status'](_0x10e4a6);return _0x44931c[_0xb814('0xc')]('Content-Range',_0x1fea33+'-'+_0x1086f8+'/'+_0x186d5a)[_0xb814('0xd')](_0x53e507);}return null;};}function handleError(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0x1f4;return function(_0x2cc46b){logger[_0xb814('0xe')](_0x2cc46b[_0xb814('0xf')]);if(_0x2cc46b[_0xb814('0x10')]){delete _0x2cc46b[_0xb814('0x10')];}_0x15d6ef[_0xb814('0x11')](_0x35b10d)[_0xb814('0x12')](_0x2cc46b);};}exports[_0xb814('0x13')]=function(_0x44fb96,_0x17f5bd){var _0x39bfcf=[_0xb814('0x14'),_0xb814('0x15'),_0xb814('0x16'),_0xb814('0x17'),_0xb814('0x18'),_0xb814('0x19'),_0xb814('0x1a')];var _0x48c9df={'count':0x0,'rows':[]},_0x168a48={},_0x55ba16;Promise[_0xb814('0x1b')]()[_0xb814('0x1c')](function(){if(_0x44fb96['query']['channel']){if(!_['includes'](_0x39bfcf,_0x44fb96[_0xb814('0x1d')]['channel']['toLowerCase']()))throw new Error(_0xb814('0x1e'));_0x55ba16=_0x44fb96[_0xb814('0x1d')][_0xb814('0x1f')]['toLowerCase']();}var _0xf5b8aa=_['startCase'](_0x55ba16)+_0xb814('0x20');var _0x1808a3=_[_0xb814('0x21')](db[_0xf5b8aa][_0xb814('0x22')],function(_0x27352e){return{'name':_0x27352e[_0xb814('0x23')],'type':_0x27352e[_0xb814('0x24')]['key']};});_0x168a48=qs[_0xb814('0x25')](_0x1808a3,_0x44fb96);if(_0x44fb96['user'][_0xb814('0x26')]===_0xb814('0x27')){var _0x31c7ec={'params':{'id':_0x44fb96[_0xb814('0x27')][_0xb814('0x28')]},'query':{'section':_0x55ba16===_0xb814('0x1a')&&_0x44fb96[_0xb814('0x1d')]['type']===_0xb814('0x29')?_0xb814('0x2a'):_[_0xb814('0x2b')](_0x55ba16)+_0xb814('0x2c'),'type':_0x44fb96[_0xb814('0x1d')][_0xb814('0x24')],'nolimit':!![],'sort':_0xb814('0x10'),'filter':_0x44fb96[_0xb814('0x1d')]['filter']}};return db[_0xb814('0x2d')][_0xb814('0x2e')](_0x31c7ec);}return db[_0xf5b8aa]['findAndCountAll'](_0x168a48);})[_0xb814('0x1c')](function(_0x37d24d){_0x48c9df[_0xb814('0xb')]=_0x37d24d['count'];var _0x20577b=_0x55ba16===_0xb814('0x1a')?client:routingClient;return _0x20577b['request'](_[_0xb814('0x2b')](_0x55ba16)+'Queues',_0x44fb96)[_0xb814('0x1c')](function(_0x5f3e9b){if(_0x5f3e9b['error'])throw new Error(util[_0xb814('0x2f')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x55ba16));var _0x2431e2=_0x5f3e9b[_0xb814('0x30')];var _0x2b91bd=['loggedIn','available',_0xb814('0x31'),_0xb814('0x32'),'paused'];if(_0x55ba16===_0xb814('0x1a')&&_0x44fb96[_0xb814('0x1d')][_0xb814('0x24')]===_0xb814('0x29')){_0x2b91bd[_0xb814('0x33')](_0xb814('0x34'),_0xb814('0x35'),'message',_0xb814('0x36'),_0xb814('0x37'),_0xb814('0x38'),_0xb814('0x39'),_0xb814('0x3a'),'erlangCalls',_0xb814('0x3b'),'erlangAbandonmentRate',_0xb814('0x3c'),_0xb814('0x3d'),_0xb814('0x3e'),'dialPredictiveIntervalMinThreshold',_0xb814('0x3f'),_0xb814('0x40'),'predictiveIntervalAnsweredCalls',_0xb814('0x41'),_0xb814('0x42'),_0xb814('0x43'),_0xb814('0x44'));}var _0xd77d96=_0x37d24d[_0xb814('0x45')]['map'](function(_0xa6ce87){var _0x4e4684=_0xa6ce87[_0xb814('0x46')]({'plain':!![]});_0x4e4684['paused']=0x0;_0x4e4684[_0xb814('0x47')]=0x0;_0x4e4684['loggedIn']=0x0;_0x4e4684[_0xb814('0x48')]=0x0;_0x4e4684[_0xb814('0x49')]=0x0;_0x4e4684['waiting']=0x0;if(_0x55ba16==='voice'){_0x4e4684['talking']=0x0;if(_0x44fb96['query'][_0xb814('0x24')]===_0xb814('0x29')){_0x4e4684[_0xb814('0x34')]=0x0;_0x4e4684[_0xb814('0x35')]=0x0;}}_0x4e4684['agents']=[];var _0x47d782=_[_0xb814('0x4a')](_0x2431e2['rows'],['id',_0x4e4684['id']]);if(_0x47d782)_[_0xb814('0x4b')](_0x4e4684,_[_0xb814('0x4c')](_0x47d782,_0x2b91bd));if(_0x55ba16===_0xb814('0x1a')){return _0xa6ce87[_0xb814('0x4d')]({'attributes':['id',_0xb814('0x10'),_0xb814('0x4e')],'joinTableAttributes':[],'raw':!![]})[_0xb814('0x1c')](function(_0x28b2b4){return _0xa6ce87[_0xb814('0x4f')]({'raw':!![]})['then'](function(_0x544d36){for(var _0x5d26be=0x0;_0x5d26be<_0x28b2b4[_0xb814('0x50')];_0x5d26be++){var _0x5ba0bc=_[_0xb814('0x4a')](_0x544d36,['UserId',_0x28b2b4[_0x5d26be]['id']]);var _0x411723={'id':_0x28b2b4[_0x5d26be]['id'],'name':_0x28b2b4[_0x5d26be][_0xb814('0x10')],'online':Boolean(_0x28b2b4[_0x5d26be][_0xb814('0x4e')]),'paused':_0x5ba0bc?Boolean(_0x5ba0bc[_0xb814('0x49')]):![]};if(_0x411723['online'])_0x4e4684[_0xb814('0x47')]++;if(_0x411723[_0xb814('0x49')])_0x4e4684[_0xb814('0x49')]++;_0x4e4684[_0xb814('0x51')][_0xb814('0x33')](_0x411723);}return _0x4e4684;});});}else{var _0x450a08='User'+_[_0xb814('0x2b')](_0x55ba16)+_0xb814('0x20');var _0x9ffd73=_0x55ba16+_0xb814('0x52');return db[_0x450a08][_0xb814('0x53')]({'where':{[_[_0xb814('0x2b')](_0x55ba16)+_0xb814('0x54')]:_0xa6ce87['id']},'raw':!![]})['then'](function(_0x4a5e84){return db[_0xb814('0x55')][_0xb814('0x53')]({'attributes':['id',_0xb814('0x10'),_0xb814('0x4e'),_0x9ffd73],'where':{'id':_[_0xb814('0x21')](_0x4a5e84,_0xb814('0x56')),'role':_0xb814('0x57')},'raw':!![]});})[_0xb814('0x1c')](function(_0x2eb9b6){for(var _0x344198=0x0;_0x344198<_0x2eb9b6[_0xb814('0x50')];_0x344198++){var _0x5c7a49={'id':_0x2eb9b6[_0x344198]['id'],'name':_0x2eb9b6[_0x344198][_0xb814('0x10')],'online':Boolean(_0x2eb9b6[_0x344198][_0xb814('0x4e')]),'paused':Boolean(_0x2eb9b6[_0x344198][_0x9ffd73])};if(_0x5c7a49['online'])_0x4e4684[_0xb814('0x47')]++;if(_0x5c7a49['paused'])_0x4e4684[_0xb814('0x49')]++;_0x4e4684[_0xb814('0x51')][_0xb814('0x33')](_0x5c7a49);}return _0x4e4684;});}});return Promise[_0xb814('0x58')](_0xd77d96);});})[_0xb814('0x1c')](function(_0x4096d4){_0x48c9df[_0xb814('0x45')]=_0x4096d4;return _0x48c9df;})[_0xb814('0x1c')](respondWithFilteredResult(_0x17f5bd,_0x168a48))[_0xb814('0x59')](handleError(_0x17f5bd,null));}; \ No newline at end of file +var _0x326f=['Queues','UserProfile','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','paused','loggedInDb','loggedIn','find','pick','getAgents','online','getMembers','length','UserId','agents','push','Pause','findAll','QueueId','agent','all','catch','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','set','json','stack','name','status','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','then','query','channel','toLowerCase','Invalid\x20channel','Queue','fieldName','key','getOptions','user','role','type','outbound','QueueCampaigns','startCase'];(function(_0x3d1d0d,_0x549b78){var _0x2bda97=function(_0x4ba92b){while(--_0x4ba92b){_0x3d1d0d['push'](_0x3d1d0d['shift']());}};_0x2bda97(++_0x549b78);}(_0x326f,0xd1));var _0xf326=function(_0xc82b23,_0x411ea4){_0xc82b23=_0xc82b23-0x0;var _0x11c286=_0x326f[_0xc82b23];return _0x11c286;};'use strict';var util=require(_0xf326('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require(_0xf326('0x1'));var logger=require(_0xf326('0x2'))(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var client=jayson[_0xf326('0x5')][_0xf326('0x6')]({'port':0x232a});var routingClient=jayson[_0xf326('0x5')][_0xf326('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1b5a56,_0x3ace29){return function(_0x4c2249){if(_0x4c2249){var _0x3c254d=typeof _0x3ace29[_0xf326('0x7')]===_0xf326('0x8')&&typeof _0x3ace29[_0xf326('0x9')]==='undefined';var _0x4c206c=_0x4c2249['count'];var _0x3bacf2=_0x3c254d?0x0:_0x3ace29[_0xf326('0x7')];var _0x163416=_0x3c254d?_0x4c2249[_0xf326('0xa')]:_0x3ace29[_0xf326('0x7')]+_0x3ace29['limit'];var _0x136e2d;if(_0x163416>=_0x4c206c){_0x163416=_0x4c206c;_0x136e2d=0xc8;}else{_0x136e2d=0xce;}_0x1b5a56['status'](_0x136e2d);return _0x1b5a56[_0xf326('0xb')]('Content-Range',_0x3bacf2+'-'+_0x163416+'/'+_0x4c206c)[_0xf326('0xc')](_0x4c2249);}return null;};}function handleError(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0x1f4;return function(_0x9ed463){logger['error'](_0x9ed463[_0xf326('0xd')]);if(_0x9ed463[_0xf326('0xe')]){delete _0x9ed463[_0xf326('0xe')];}_0x518ab5[_0xf326('0xf')](_0x3162f9)['send'](_0x9ed463);};}exports[_0xf326('0x10')]=function(_0x5204ee,_0x54bd1a){var _0xdf21d9=[_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x14'),_0xf326('0x15'),_0xf326('0x16'),_0xf326('0x17')];var _0x5a682a={'count':0x0,'rows':[]},_0x3ad7da={},_0x453100;Promise[_0xf326('0x18')]()[_0xf326('0x19')](function(){if(_0x5204ee[_0xf326('0x1a')][_0xf326('0x1b')]){if(!_['includes'](_0xdf21d9,_0x5204ee['query']['channel'][_0xf326('0x1c')]()))throw new Error(_0xf326('0x1d'));_0x453100=_0x5204ee['query']['channel'][_0xf326('0x1c')]();}var _0x4dfa76=_['startCase'](_0x453100)+_0xf326('0x1e');var _0x18ead3=_['map'](db[_0x4dfa76]['rawAttributes'],function(_0x19b8ba){return{'name':_0x19b8ba[_0xf326('0x1f')],'type':_0x19b8ba['type'][_0xf326('0x20')]};});_0x3ad7da=qs[_0xf326('0x21')](_0x18ead3,_0x5204ee);if(_0x5204ee[_0xf326('0x22')][_0xf326('0x23')]===_0xf326('0x22')){var _0x2049ec={'params':{'id':_0x5204ee['user']['userProfileId']},'query':{'section':_0x453100==='voice'&&_0x5204ee[_0xf326('0x1a')][_0xf326('0x24')]===_0xf326('0x25')?_0xf326('0x26'):_[_0xf326('0x27')](_0x453100)+_0xf326('0x28'),'type':_0x5204ee['query'][_0xf326('0x24')],'nolimit':!![],'sort':_0xf326('0xe'),'filter':_0x5204ee[_0xf326('0x1a')]['filter']}};return db[_0xf326('0x29')]['getResources'](_0x2049ec);}return db[_0x4dfa76]['findAndCountAll'](_0x3ad7da);})[_0xf326('0x19')](function(_0x1ae23a){_0x5a682a[_0xf326('0xa')]=_0x1ae23a['count'];var _0xc115d9=_0x453100===_0xf326('0x17')?client:routingClient;return _0xc115d9['request'](_[_0xf326('0x27')](_0x453100)+_0xf326('0x28'),_0x5204ee)[_0xf326('0x19')](function(_0x18d110){if(_0x18d110[_0xf326('0x2a')])throw new Error(util[_0xf326('0x2b')](_0xf326('0x2c'),_0x453100));var _0x39a1e2=_0x18d110[_0xf326('0x2d')];var _0x349a03=['loggedIn',_0xf326('0x2e'),_0xf326('0x2f'),_0xf326('0x30'),'paused'];if(_0x453100===_0xf326('0x17')&&_0x5204ee[_0xf326('0x1a')][_0xf326('0x24')]==='outbound'){_0x349a03['push'](_0xf326('0x31'),_0xf326('0x32'),_0xf326('0x33'),_0xf326('0x34'),_0xf326('0x35'),_0xf326('0x36'),_0xf326('0x37'),_0xf326('0x38'),'erlangCalls',_0xf326('0x39'),_0xf326('0x3a'),'erlangBusyFactor',_0xf326('0x3b'),'dialPredictiveIntervalMaxThreshold',_0xf326('0x3c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0xf326('0x3d'),'predictiveIntervalDroppedCallsTimeout',_0xf326('0x3e'),'predictiveIntervalAvgHoldtime',_0xf326('0x3f'));}var _0x409260=_0x1ae23a[_0xf326('0x40')]['map'](function(_0x3dcc7e){var _0x4095e6=_0x3dcc7e['get']({'plain':!![]});_0x4095e6[_0xf326('0x41')]=0x0;_0x4095e6[_0xf326('0x42')]=0x0;_0x4095e6[_0xf326('0x43')]=0x0;_0x4095e6[_0xf326('0x2e')]=0x0;_0x4095e6['paused']=0x0;_0x4095e6[_0xf326('0x2f')]=0x0;if(_0x453100===_0xf326('0x17')){_0x4095e6[_0xf326('0x30')]=0x0;if(_0x5204ee[_0xf326('0x1a')][_0xf326('0x24')]==='outbound'){_0x4095e6[_0xf326('0x31')]=0x0;_0x4095e6[_0xf326('0x32')]=0x0;}}_0x4095e6['agents']=[];var _0x4dd361=_[_0xf326('0x44')](_0x39a1e2['rows'],['id',_0x4095e6['id']]);if(_0x4dd361)_['merge'](_0x4095e6,_[_0xf326('0x45')](_0x4dd361,_0x349a03));if(_0x453100==='voice'){return _0x3dcc7e[_0xf326('0x46')]({'attributes':['id',_0xf326('0xe'),_0xf326('0x47')],'joinTableAttributes':[],'raw':!![]})[_0xf326('0x19')](function(_0x49112d){return _0x3dcc7e[_0xf326('0x48')]({'raw':!![]})[_0xf326('0x19')](function(_0x347e7b){for(var _0x365627=0x0;_0x365627<_0x49112d[_0xf326('0x49')];_0x365627++){var _0x28f857=_[_0xf326('0x44')](_0x347e7b,[_0xf326('0x4a'),_0x49112d[_0x365627]['id']]);var _0x31283b={'id':_0x49112d[_0x365627]['id'],'name':_0x49112d[_0x365627][_0xf326('0xe')],'online':Boolean(_0x49112d[_0x365627][_0xf326('0x47')]),'paused':_0x28f857?Boolean(_0x28f857[_0xf326('0x41')]):![]};if(_0x31283b['online'])_0x4095e6[_0xf326('0x42')]++;if(_0x31283b[_0xf326('0x41')])_0x4095e6[_0xf326('0x41')]++;_0x4095e6[_0xf326('0x4b')][_0xf326('0x4c')](_0x31283b);}return _0x4095e6;});});}else{var _0x1a2d0d='User'+_[_0xf326('0x27')](_0x453100)+_0xf326('0x1e');var _0x53435c=_0x453100+_0xf326('0x4d');return db[_0x1a2d0d][_0xf326('0x4e')]({'where':{[_[_0xf326('0x27')](_0x453100)+_0xf326('0x4f')]:_0x3dcc7e['id']},'raw':!![]})[_0xf326('0x19')](function(_0x55361f){return db['User'][_0xf326('0x4e')]({'attributes':['id',_0xf326('0xe'),'online',_0x53435c],'where':{'id':_['map'](_0x55361f,_0xf326('0x4a')),'role':_0xf326('0x50')},'raw':!![]});})[_0xf326('0x19')](function(_0x5b3705){for(var _0x301e65=0x0;_0x301e65<_0x5b3705[_0xf326('0x49')];_0x301e65++){var _0x2180d6={'id':_0x5b3705[_0x301e65]['id'],'name':_0x5b3705[_0x301e65][_0xf326('0xe')],'online':Boolean(_0x5b3705[_0x301e65][_0xf326('0x47')]),'paused':Boolean(_0x5b3705[_0x301e65][_0x53435c])};if(_0x2180d6[_0xf326('0x47')])_0x4095e6[_0xf326('0x42')]++;if(_0x2180d6[_0xf326('0x41')])_0x4095e6[_0xf326('0x41')]++;_0x4095e6[_0xf326('0x4b')][_0xf326('0x4c')](_0x2180d6);}return _0x4095e6;});}});return Promise[_0xf326('0x51')](_0x409260);});})[_0xf326('0x19')](function(_0x395b1e){_0x5a682a[_0xf326('0x40')]=_0x395b1e;return _0x5a682a;})['then'](respondWithFilteredResult(_0x54bd1a,_0x3ad7da))[_0xf326('0x52')](handleError(_0x54bd1a,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index b82610e..91cb015 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x44f649,_0x469e3f){var _0x168ac5=function(_0x2139fc){while(--_0x2139fc){_0x44f649['push'](_0x44f649['shift']());}};_0x168ac5(++_0x469e3f);}(_0x70e0,0x17b));var _0x070e=function(_0x4b0172,_0x45ac2d){_0x4b0172=_0x4b0172-0x0;var _0x3ce080=_0x70e0[_0x4b0172];return _0x3ce080;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1dd784,_0xad874c){var _0x311f9f=function(_0x3f278a){while(--_0x3f278a){_0x1dd784['push'](_0x1dd784['shift']());}};_0x311f9f(++_0xad874c);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 3d44933..ad5a43d 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 _0x933c=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x1e3872,_0xaceee8){var _0x5178c8=function(_0x134387){while(--_0x134387){_0x1e3872['push'](_0x1e3872['shift']());}};_0x5178c8(++_0xaceee8);}(_0x933c,0x99));var _0xc933=function(_0x3f1ae8,_0x1b29ea){_0x3f1ae8=_0x3f1ae8-0x0;var _0x2bec06=_0x933c[_0x3f1ae8];return _0x2bec06;};'use strict';var Sequelize=require(_0xc933('0x0'));module[_0xc933('0x1')]={'state':{'type':Sequelize[_0xc933('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc933('0x3')]},'scheduledat':{'type':Sequelize[_0xc933('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc933('0x4')]},'ringtime':{'type':Sequelize[_0xc933('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc933('0x3')]},'campaigntype':{'type':Sequelize[_0xc933('0x3')]},'membername':{'type':Sequelize[_0xc933('0x3')]}}; \ No newline at end of file +var _0x02ca=['INTEGER','STRING','DATE','sequelize'];(function(_0x21a026,_0x32ee79){var _0x4359e5=function(_0x57e240){while(--_0x57e240){_0x21a026['push'](_0x21a026['shift']());}};_0x4359e5(++_0x32ee79);}(_0x02ca,0x97));var _0xa02c=function(_0x3a9f86,_0x1b3497){_0x3a9f86=_0x3a9f86-0x0;var _0x1e2763=_0x02ca[_0x3a9f86];return _0x1e2763;};'use strict';var Sequelize=require(_0xa02c('0x0'));module['exports']={'state':{'type':Sequelize[_0xa02c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa02c('0x2')]},'scheduledat':{'type':Sequelize[_0xa02c('0x3')]},'uniqueid':{'type':Sequelize[_0xa02c('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa02c('0x3')]},'ringtime':{'type':Sequelize[_0xa02c('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa02c('0x2')]},'campaigntype':{'type':Sequelize[_0xa02c('0x2')]},'membername':{'type':Sequelize[_0xa02c('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 51f3cb6..841f221 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 _0x0a53=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview'];(function(_0x43a12f,_0x3d0108){var _0x36994d=function(_0x4723f5){while(--_0x4723f5){_0x43a12f['push'](_0x43a12f['shift']());}};_0x36994d(++_0x3d0108);}(_0x0a53,0xdd));var _0x30a5=function(_0x3df5e0,_0x1a0a53){_0x3df5e0=_0x3df5e0-0x0;var _0x494b26=_0x0a53[_0x3df5e0];return _0x494b26;};'use strict';var _=require(_0x30a5('0x0'));var util=require(_0x30a5('0x1'));var logger=require('../../config/logger')(_0x30a5('0x2'));var moment=require(_0x30a5('0x3'));var BPromise=require(_0x30a5('0x4'));var rp=require(_0x30a5('0x5'));var fs=require('fs');var path=require(_0x30a5('0x6'));var rimraf=require(_0x30a5('0x7'));var config=require(_0x30a5('0x8'));var attributes=require(_0x30a5('0x9'));module[_0x30a5('0xa')]=function(_0x17a46e,_0x510186){return _0x17a46e['define'](_0x30a5('0xb'),attributes,{'tableName':_0x30a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ded=['moment','bluebird','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','util','../../config/logger','api'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0x9ded,0x1ca));var _0xd9de=function(_0x52756e,_0x1dfa40){_0x52756e=_0x52756e-0x0;var _0x20255c=_0x9ded[_0x52756e];return _0x20255c;};'use strict';var _=require(_0xd9de('0x0'));var util=require(_0xd9de('0x1'));var logger=require(_0xd9de('0x2'))(_0xd9de('0x3'));var moment=require(_0xd9de('0x4'));var BPromise=require(_0xd9de('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9de('0x6'));var rimraf=require('rimraf');var config=require(_0xd9de('0x7'));var attributes=require(_0xd9de('0x8'));module[_0xd9de('0x9')]=function(_0x493b51,_0x1b8125){return _0x493b51['define'](_0xd9de('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 67b76d0..6c730d9 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 _0xae13=['options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ReportAgentPreview','create','body'];(function(_0x5d8502,_0x3a7146){var _0x58804c=function(_0x4cbd38){while(--_0x4cbd38){_0x5d8502['push'](_0x5d8502['shift']());}};_0x58804c(++_0x3a7146);}(_0xae13,0x1d3));var _0x3ae1=function(_0x5a18d4,_0xd119b4){_0x5a18d4=_0x5a18d4-0x0;var _0x843a23=_0xae13[_0x5a18d4];return _0x843a23;};'use strict';var _=require(_0x3ae1('0x0'));var util=require(_0x3ae1('0x1'));var moment=require(_0x3ae1('0x2'));var BPromise=require(_0x3ae1('0x3'));var rs=require(_0x3ae1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ae1('0x5'))['db'];var utils=require(_0x3ae1('0x6'));var logger=require('../../config/logger')(_0x3ae1('0x7'));var config=require(_0x3ae1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ae1('0x9')][_0x3ae1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x409be9,_0x184a1f,_0x450291){return new BPromise(function(_0x121820,_0x5b45a6){return client[_0x3ae1('0xb')](_0x409be9,_0x450291)[_0x3ae1('0xc')](function(_0x32976e){logger[_0x3ae1('0xd')](_0x3ae1('0xe'),_0x184a1f,_0x3ae1('0xf'));logger[_0x3ae1('0x10')](_0x3ae1('0x11'),_0x184a1f,_0x3ae1('0xf'),JSON[_0x3ae1('0x12')](_0x32976e));if(_0x32976e['error']){if(_0x32976e[_0x3ae1('0x13')]['code']===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x184a1f,_0x32976e[_0x3ae1('0x13')][_0x3ae1('0x14')]);return _0x5b45a6(_0x32976e[_0x3ae1('0x13')][_0x3ae1('0x14')]);}logger[_0x3ae1('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x184a1f,_0x32976e[_0x3ae1('0x13')][_0x3ae1('0x14')]);return _0x121820(_0x32976e[_0x3ae1('0x13')]['message']);}else{logger[_0x3ae1('0xd')](_0x3ae1('0xe'),_0x184a1f,'request\x20sent');_0x121820(_0x32976e[_0x3ae1('0x15')][_0x3ae1('0x14')]);}})[_0x3ae1('0x16')](function(_0x7973a2){logger[_0x3ae1('0x13')](_0x3ae1('0xe'),_0x184a1f,_0x7973a2);_0x5b45a6(_0x7973a2);});});}exports['CreateReportAgentPreview']=function(_0x20f528){var _0x518a34=this;return new Promise(function(_0x29da6a,_0x42be4e){return db[_0x3ae1('0x17')][_0x3ae1('0x18')](_0x20f528[_0x3ae1('0x19')],{'raw':_0x20f528[_0x3ae1('0x1a')]?_0x20f528[_0x3ae1('0x1a')][_0x3ae1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x26341e){logger[_0x3ae1('0xd')]('CreateReportAgentPreview',_0x20f528);logger['debug']('CreateReportAgentPreview',_0x20f528,JSON[_0x3ae1('0x12')](_0x26341e));_0x29da6a(_0x26341e);})['catch'](function(_0x494239){logger['error'](_0x3ae1('0x1c'),_0x494239[_0x3ae1('0x14')],_0x20f528);_0x42be4e(_0x518a34['error'](0x1f4,_0x494239[_0x3ae1('0x14')]));});});}; \ No newline at end of file +var _0xc048=['info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','ReportAgentPreview','body','options','CreateReportAgentPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x27e400,_0x55a6a1){var _0xbb78b9=function(_0x35ff28){while(--_0x35ff28){_0x27e400['push'](_0x27e400['shift']());}};_0xbb78b9(++_0x55a6a1);}(_0xc048,0x102));var _0x8c04=function(_0x4d8df2,_0x5a4256){_0x4d8df2=_0x4d8df2-0x0;var _0x451292=_0xc048[_0x4d8df2];return _0x451292;};'use strict';var _=require('lodash');var util=require(_0x8c04('0x0'));var moment=require(_0x8c04('0x1'));var BPromise=require(_0x8c04('0x2'));var rs=require(_0x8c04('0x3'));var fs=require('fs');var Redis=require(_0x8c04('0x4'));var db=require(_0x8c04('0x5'))['db'];var utils=require(_0x8c04('0x6'));var logger=require(_0x8c04('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c04('0x8'));var client=jayson['client'][_0x8c04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bbcd2,_0x55e468,_0x4ab771){return new BPromise(function(_0x175d4a,_0x7fed9d){return client[_0x8c04('0xa')](_0x4bbcd2,_0x4ab771)[_0x8c04('0xb')](function(_0x792389){logger[_0x8c04('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x55e468,_0x8c04('0xd'));logger[_0x8c04('0xe')](_0x8c04('0xf'),_0x55e468,'request\x20sent',JSON[_0x8c04('0x10')](_0x792389));if(_0x792389[_0x8c04('0x11')]){if(_0x792389[_0x8c04('0x11')][_0x8c04('0x12')]===0x1f4){logger[_0x8c04('0x11')](_0x8c04('0x13'),_0x55e468,_0x792389[_0x8c04('0x11')][_0x8c04('0x14')]);return _0x7fed9d(_0x792389[_0x8c04('0x11')][_0x8c04('0x14')]);}logger[_0x8c04('0x11')](_0x8c04('0x13'),_0x55e468,_0x792389[_0x8c04('0x11')]['message']);return _0x175d4a(_0x792389[_0x8c04('0x11')]['message']);}else{logger[_0x8c04('0xc')](_0x8c04('0x13'),_0x55e468,'request\x20sent');_0x175d4a(_0x792389[_0x8c04('0x15')]['message']);}})[_0x8c04('0x16')](function(_0x3b931c){logger[_0x8c04('0x11')](_0x8c04('0x13'),_0x55e468,_0x3b931c);_0x7fed9d(_0x3b931c);});});}exports['CreateReportAgentPreview']=function(_0x4d649f){var _0x34222d=this;return new Promise(function(_0x4c514e,_0x7b5fe){return db[_0x8c04('0x17')]['create'](_0x4d649f[_0x8c04('0x18')],{'raw':_0x4d649f['options']?_0x4d649f[_0x8c04('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8c04('0xb')](function(_0x1ab043){logger[_0x8c04('0xc')](_0x8c04('0x1a'),_0x4d649f);logger[_0x8c04('0xe')](_0x8c04('0x1a'),_0x4d649f,JSON[_0x8c04('0x10')](_0x1ab043));_0x4c514e(_0x1ab043);})[_0x8c04('0x16')](function(_0x3e99fa){logger[_0x8c04('0x11')](_0x8c04('0x1a'),_0x3e99fa[_0x8c04('0x14')],_0x4d649f);_0x7b5fe(_0x34222d[_0x8c04('0x11')](0x1f4,_0x3e99fa[_0x8c04('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index daa1441..d6328ba 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 _0x979e=['/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','multer','util','express','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','mailQueues','mailAccounts','/sms/queues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues'];(function(_0x26d22c,_0x3623f2){var _0x39fd9a=function(_0x3a164e){while(--_0x3a164e){_0x26d22c['push'](_0x26d22c['shift']());}};_0x39fd9a(++_0x3623f2);}(_0x979e,0x17a));var _0xe979=function(_0x30f3c1,_0x16183c){_0x30f3c1=_0x30f3c1-0x0;var _0x4f62a8=_0x979e[_0x30f3c1];return _0x4f62a8;};'use strict';var multer=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var path=require('path');var express=require(_0xe979('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe979('0x3'));router[_0xe979('0x4')](_0xe979('0x5'),auth[_0xe979('0x6')](),controller[_0xe979('0x7')]);router[_0xe979('0x4')](_0xe979('0x8'),auth[_0xe979('0x6')](),controller[_0xe979('0x9')]);router[_0xe979('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xe979('0x6')](),controller[_0xe979('0xa')]);router['get']('/voice/queues',auth[_0xe979('0x6')](),controller[_0xe979('0xb')]);router[_0xe979('0x4')]('/chat/queues',auth[_0xe979('0x6')](),controller[_0xe979('0xc')]);router[_0xe979('0x4')]('/mail/queues',auth[_0xe979('0x6')](),controller[_0xe979('0xd')]);router[_0xe979('0x4')]('/mail/accounts',auth[_0xe979('0x6')](),controller[_0xe979('0xe')]);router[_0xe979('0x4')]('/openchannel/queues',auth[_0xe979('0x6')](),controller['openchannelQueues']);router[_0xe979('0x4')](_0xe979('0xf'),auth['isAuthenticated'](),controller[_0xe979('0x10')]);router[_0xe979('0x4')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xe979('0x11')]);router[_0xe979('0x4')](_0xe979('0x12'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xe979('0x4')](_0xe979('0x13'),auth[_0xe979('0x6')](),controller[_0xe979('0x14')]);router[_0xe979('0x4')]('/voice/queues/channels',auth[_0xe979('0x6')](),controller[_0xe979('0x15')]);router['get'](_0xe979('0x16'),auth[_0xe979('0x6')](),controller[_0xe979('0x17')]);router[_0xe979('0x4')](_0xe979('0x18'),auth[_0xe979('0x6')](),controller[_0xe979('0x19')]);router[_0xe979('0x4')](_0xe979('0x1a'),auth[_0xe979('0x6')](),controller[_0xe979('0x1b')]);router[_0xe979('0x4')]('/voice/queues/:id',auth[_0xe979('0x6')](),controller['showVoiceQueues']);router[_0xe979('0x1c')]('/voice/queues/:id',auth[_0xe979('0x6')](),controller[_0xe979('0x1d')]);router['get'](_0xe979('0x1e'),auth[_0xe979('0x6')](),controller[_0xe979('0x1f')]);router[_0xe979('0x4')](_0xe979('0x20'),auth['isAuthenticated'](),controller[_0xe979('0x21')]);router[_0xe979('0x4')](_0xe979('0x22'),auth[_0xe979('0x6')](),controller[_0xe979('0x23')]);router[_0xe979('0x1c')](_0xe979('0x24'),auth[_0xe979('0x6')](),controller['agentCapacity']);router[_0xe979('0x4')](_0xe979('0x25'),auth[_0xe979('0x6')](),controller['telephones']);router[_0xe979('0x4')](_0xe979('0x26'),auth['isAuthenticated'](),controller[_0xe979('0x27')]);router[_0xe979('0x4')](_0xe979('0x28'),auth[_0xe979('0x6')](),controller[_0xe979('0x29')]);router[_0xe979('0x4')](_0xe979('0x2a'),auth[_0xe979('0x6')](),controller['faxAccounts']);router[_0xe979('0x4')](_0xe979('0x2b'),auth[_0xe979('0x6')](),controller[_0xe979('0x2c')]);router[_0xe979('0x4')](_0xe979('0x2d'),auth[_0xe979('0x6')](),controller[_0xe979('0x2e')]);router['get'](_0xe979('0x2f'),auth[_0xe979('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0xe979('0x4')](_0xe979('0x30'),auth[_0xe979('0x6')](),controller[_0xe979('0x31')]);router[_0xe979('0x4')](_0xe979('0x32'),auth[_0xe979('0x6')](),controller[_0xe979('0x33')]);router[_0xe979('0x4')]('/whatsapp/queues/waitinginteractions',auth[_0xe979('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0xe979('0x4')](_0xe979('0x34'),auth[_0xe979('0x6')](),controller[_0xe979('0x35')]);router['post'](_0xe979('0x36'),auth['isAuthenticated'](),controller[_0xe979('0x37')]('mail'));router[_0xe979('0x4')](_0xe979('0x38'),auth[_0xe979('0x6')](),controller[_0xe979('0x39')]);router[_0xe979('0x3a')](_0xe979('0x3b'),auth[_0xe979('0x6')](),controller[_0xe979('0x37')](_0xe979('0x3c')));router['get'](_0xe979('0x3d'),auth['isAuthenticated'](),controller[_0xe979('0x3e')]);router[_0xe979('0x3a')]('/fax/queues/:id/notify',auth[_0xe979('0x6')](),controller[_0xe979('0x37')](_0xe979('0x3f')));router[_0xe979('0x4')](_0xe979('0x40'),auth[_0xe979('0x6')](),controller[_0xe979('0x41')]);router[_0xe979('0x3a')]('/openchannel/queues/:id/notify',auth[_0xe979('0x6')](),controller['queueNotify']('openchannel'));router['get'](_0xe979('0x42'),auth[_0xe979('0x6')](),controller[_0xe979('0x43')]);router[_0xe979('0x3a')](_0xe979('0x44'),auth[_0xe979('0x6')](),controller[_0xe979('0x37')]('sms'));router[_0xe979('0x3a')](_0xe979('0x45'),auth[_0xe979('0x6')](),controller[_0xe979('0x37')]('whatsapp'));router['get'](_0xe979('0x46'),auth[_0xe979('0x6')](),controller[_0xe979('0x47')]);router[_0xe979('0x4')](_0xe979('0x48'),auth['isAuthenticated'](),controller[_0xe979('0x49')]);router[_0xe979('0x3a')](_0xe979('0x4a'),auth['isAuthenticated'](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x6158=['/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','trunks'];(function(_0x409ad2,_0x5129c1){var _0x595b5f=function(_0x592974){while(--_0x592974){_0x409ad2['push'](_0x409ad2['shift']());}};_0x595b5f(++_0x5129c1);}(_0x6158,0x162));var _0x8615=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6158[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8615('0x0'));var path=require(_0x8615('0x1'));var express=require(_0x8615('0x2'));var router=express[_0x8615('0x3')]();var auth=require(_0x8615('0x4'));var controller=require('./rpc.controller');router[_0x8615('0x5')](_0x8615('0x6'),auth[_0x8615('0x7')](),controller[_0x8615('0x8')]);router['get'](_0x8615('0x9'),auth[_0x8615('0x7')](),controller[_0x8615('0xa')]);router[_0x8615('0x5')](_0x8615('0xb'),auth['isAuthenticated'](),controller[_0x8615('0xc')]);router[_0x8615('0x5')](_0x8615('0xd'),auth[_0x8615('0x7')](),controller[_0x8615('0xe')]);router['get'](_0x8615('0xf'),auth[_0x8615('0x7')](),controller[_0x8615('0x10')]);router[_0x8615('0x5')](_0x8615('0x11'),auth[_0x8615('0x7')](),controller[_0x8615('0x12')]);router['get'](_0x8615('0x13'),auth[_0x8615('0x7')](),controller[_0x8615('0x14')]);router[_0x8615('0x5')]('/openchannel/queues',auth[_0x8615('0x7')](),controller['openchannelQueues']);router[_0x8615('0x5')](_0x8615('0x15'),auth['isAuthenticated'](),controller[_0x8615('0x16')]);router['get'](_0x8615('0x17'),auth[_0x8615('0x7')](),controller['whatsappQueues']);router[_0x8615('0x5')](_0x8615('0x18'),auth['isAuthenticated'](),controller[_0x8615('0x19')]);router['get'](_0x8615('0x1a'),auth[_0x8615('0x7')](),controller[_0x8615('0x1b')]);router[_0x8615('0x5')]('/voice/queues/channels',auth[_0x8615('0x7')](),controller[_0x8615('0x1c')]);router[_0x8615('0x5')](_0x8615('0x1d'),auth[_0x8615('0x7')](),controller['voiceQueuesChannel']);router[_0x8615('0x5')](_0x8615('0x1e'),auth['isAuthenticated'](),controller[_0x8615('0x1f')]);router[_0x8615('0x5')](_0x8615('0x20'),auth[_0x8615('0x7')](),controller[_0x8615('0x21')]);router[_0x8615('0x5')](_0x8615('0x22'),auth[_0x8615('0x7')](),controller['showVoiceQueues']);router['put'](_0x8615('0x22'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get'](_0x8615('0x23'),auth[_0x8615('0x7')](),controller[_0x8615('0x24')]);router[_0x8615('0x5')](_0x8615('0x25'),auth[_0x8615('0x7')](),controller[_0x8615('0x26')]);router[_0x8615('0x5')](_0x8615('0x27'),auth[_0x8615('0x7')](),controller[_0x8615('0x28')]);router[_0x8615('0x29')](_0x8615('0x2a'),auth[_0x8615('0x7')](),controller['agentCapacity']);router[_0x8615('0x5')](_0x8615('0x2b'),auth[_0x8615('0x7')](),controller[_0x8615('0x2c')]);router[_0x8615('0x5')]('/trunks',auth[_0x8615('0x7')](),controller[_0x8615('0x2d')]);router[_0x8615('0x5')](_0x8615('0x2e'),auth[_0x8615('0x7')](),controller[_0x8615('0x2f')]);router[_0x8615('0x5')](_0x8615('0x30'),auth[_0x8615('0x7')](),controller['faxAccounts']);router['get'](_0x8615('0x31'),auth[_0x8615('0x7')](),controller[_0x8615('0x32')]);router[_0x8615('0x5')](_0x8615('0x33'),auth[_0x8615('0x7')](),controller[_0x8615('0x34')]);router['get'](_0x8615('0x35'),auth[_0x8615('0x7')](),controller[_0x8615('0x36')]);router[_0x8615('0x5')](_0x8615('0x37'),auth[_0x8615('0x7')](),controller[_0x8615('0x38')]);router['get'](_0x8615('0x39'),auth[_0x8615('0x7')](),controller[_0x8615('0x3a')]);router['get'](_0x8615('0x3b'),auth[_0x8615('0x7')](),controller[_0x8615('0x3c')]);router[_0x8615('0x5')](_0x8615('0x3d'),auth['isAuthenticated'](),controller[_0x8615('0x3e')]);router['post'](_0x8615('0x3f'),auth[_0x8615('0x7')](),controller[_0x8615('0x40')](_0x8615('0x41')));router[_0x8615('0x5')](_0x8615('0x42'),auth['isAuthenticated'](),controller[_0x8615('0x43')]);router[_0x8615('0x44')](_0x8615('0x45'),auth[_0x8615('0x7')](),controller[_0x8615('0x40')]('chat'));router[_0x8615('0x5')]('/chat/queues/:id',auth[_0x8615('0x7')](),controller[_0x8615('0x46')]);router[_0x8615('0x44')](_0x8615('0x47'),auth[_0x8615('0x7')](),controller[_0x8615('0x40')](_0x8615('0x48')));router[_0x8615('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x8615('0x44')]('/openchannel/queues/:id/notify',auth[_0x8615('0x7')](),controller[_0x8615('0x40')]('openchannel'));router[_0x8615('0x5')](_0x8615('0x49'),auth[_0x8615('0x7')](),controller[_0x8615('0x4a')]);router['post']('/sms/queues/:id/notify',auth[_0x8615('0x7')](),controller['queueNotify'](_0x8615('0x4b')));router[_0x8615('0x44')]('/whatsapp/queues/:id/notify',auth[_0x8615('0x7')](),controller[_0x8615('0x40')](_0x8615('0x4c')));router[_0x8615('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x8615('0x4d')]);router[_0x8615('0x5')](_0x8615('0x4e'),auth[_0x8615('0x7')](),controller[_0x8615('0x4f')]);router['post']('/agents/:id/notify',auth[_0x8615('0x7')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a598177..115b3e1 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 _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x14a9b5,_0x20b0ab){var _0x1a9723=function(_0x5cb5ea){while(--_0x5cb5ea){_0x14a9b5['push'](_0x14a9b5['shift']());}};_0x1a9723(++_0x20b0ab);}(_0x814b,0x1a2));var _0xb814=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x814b[_0x4a095e];return _0x10ef73;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));}; \ No newline at end of file +var _0xda19=['rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','TransferReport','moment','lodash','../../mysqldb','api','client','http','then','error','code','message','status','json','name','send','isNil'];(function(_0x373d0b,_0xba5e11){var _0x35af47=function(_0x1045ef){while(--_0x1045ef){_0x373d0b['push'](_0x373d0b['shift']());}};_0x35af47(++_0xba5e11);}(_0xda19,0xd5));var _0x9da1=function(_0x275621,_0x524302){_0x275621=_0x275621-0x0;var _0x2ad056=_0xda19[_0x275621];return _0x2ad056;};'use strict';var BPromise=require('bluebird');var moment=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));var util=require('util');var db=require(_0x9da1('0x2'))['db'];var logger=require('../../config/logger')(_0x9da1('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232a});var mailClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232b});var routingClient=jayson[_0x9da1('0x4')][_0x9da1('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){var _0x55f66b=_0x1c24e6?_0x1c24e6:amiClient;return _0x55f66b['request'](_0x23e4f7,_0x2c3cdd)[_0x9da1('0x6')](function(_0x493d0b){if(_0x493d0b[_0x9da1('0x7')]){if(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x8')]===0x1f4){return _0x47df89(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}return _0x5e2d18(_0x493d0b[_0x9da1('0x7')][_0x9da1('0x9')]);}else{_0x5e2d18(_0x493d0b['result']);}})['catch'](function(_0x3114f7){_0x47df89(_0x3114f7);});});}function respondWithResult(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xc8;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0xa')](_0x4735c7)[_0x9da1('0xb')](_0x1d93f8);}return _0x596b6b['sendStatus'](0x194);};}function handleError(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0x1f4;return function(_0x4d17e1){logger[_0x9da1('0x7')](_0x4d17e1['stack']);if(_0x4d17e1[_0x9da1('0xc')]){delete _0x4d17e1[_0x9da1('0xc')];}_0x2837e3[_0x9da1('0xa')](_0x535a13)[_0x9da1('0xd')](_0x4d17e1);};}function findById(_0x7f1a64){return function(_0x514d8e){if(!_[_0x9da1('0xe')](_0x7f1a64)&&!_[_0x9da1('0xe')](_0x514d8e)&&!_[_0x9da1('0xe')](_0x514d8e[_0x9da1('0xf')])){return _[_0x9da1('0x10')](_0x514d8e[_0x9da1('0xf')],function(_0x497676){return _0x497676['id']==_0x7f1a64;});}return null;};}exports['voiceChannels']=function(_0x17205d,_0x8da712){return respondWithRpcPromise(_0x9da1('0x11'),_0x17205d[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x8da712,null))[_0x9da1('0x13')](handleError(_0x8da712,null));};exports[_0x9da1('0x14')]=function(_0x47e5cf,_0x1a459c){return respondWithRpcPromise(_0x9da1('0x15'),_[_0x9da1('0x16')](_0x47e5cf[_0x9da1('0x12')],_0x47e5cf[_0x9da1('0x17')]))['then'](respondWithResult(_0x1a459c,null))['catch'](handleError(_0x1a459c,null));};exports[_0x9da1('0x18')]=function(_0x3e6f85,_0x16ee0c){return respondWithRpcPromise(_0x9da1('0x19'),_[_0x9da1('0x16')](_0x3e6f85[_0x9da1('0x12')],_0x3e6f85['params']))[_0x9da1('0x6')](respondWithResult(_0x16ee0c,null))[_0x9da1('0x13')](handleError(_0x16ee0c,null));};exports['voiceQueues']=function(_0x45fcce,_0x3f5680){return respondWithRpcPromise('VoiceQueues',_0x45fcce[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x3f5680,null))['catch'](handleError(_0x3f5680,null));};exports[_0x9da1('0x1a')]=function(_0x1d6af5,_0x55cd3d){return respondWithRpcPromise('VoiceQueues',_0x1d6af5[_0x9da1('0x12')])[_0x9da1('0x6')](findById(_0x1d6af5['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x55cd3d,null))['catch'](handleError(_0x55cd3d,null));};exports['updateVoiceQueue']=function(_0x5a59c2,_0x31b826){return respondWithRpcPromise(_0x9da1('0x1b'),_[_0x9da1('0x16')](_0x5a59c2[_0x9da1('0x1c')],_0x5a59c2[_0x9da1('0x17')]))['then'](respondWithResult(_0x31b826,null))[_0x9da1('0x13')](handleError(_0x31b826,null));};exports['voiceQueuesPreview']=function(_0x1feae0,_0x235ced){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x9da1('0x16')](_0x1feae0[_0x9da1('0x12')],_0x1feae0['params']))[_0x9da1('0x6')](respondWithResult(_0x235ced,null))[_0x9da1('0x13')](handleError(_0x235ced,null));};exports[_0x9da1('0x1d')]=function(_0x2b2b48,_0x581e9f){return respondWithRpcPromise('VoiceQueuesChannels',_0x2b2b48[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x581e9f,null))[_0x9da1('0x13')](handleError(_0x581e9f,null));};exports[_0x9da1('0x1e')]=function(_0x193273,_0x559645){return respondWithRpcPromise(_0x9da1('0x1f'),_[_0x9da1('0x16')](_0x193273[_0x9da1('0x12')],_0x193273[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x559645,null))[_0x9da1('0x13')](handleError(_0x559645,null));};exports['voiceQueuesChannelHangup']=function(_0xa43301,_0x5af570){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9da1('0x16')](_0xa43301['query'],_0xa43301[_0x9da1('0x17')]))[_0x9da1('0x6')](respondWithResult(_0x5af570,null))[_0x9da1('0x13')](handleError(_0x5af570,null));};exports[_0x9da1('0x20')]=function(_0x98b294,_0x5efa40){return respondWithRpcPromise(_0x9da1('0x21'),_[_0x9da1('0x16')](_0x98b294['query'],_0x98b294[_0x9da1('0x17')]))['then'](respondWithResult(_0x5efa40,null))[_0x9da1('0x13')](handleError(_0x5efa40,null));};exports['outbound']=function(_0x5eaa7e,_0x1ce0f8){return respondWithRpcPromise('Outbound',_0x5eaa7e[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x1ce0f8,null))['catch'](handleError(_0x1ce0f8,null));};exports[_0x9da1('0x22')]=function(_0x1b750f,_0x390457){return respondWithRpcPromise(_0x9da1('0x23'),_0x1b750f['query'])[_0x9da1('0x6')](respondWithResult(_0x390457,null))['catch'](handleError(_0x390457,null));};exports[_0x9da1('0x24')]=function(_0x4bdaf1,_0x26e8d3){var _0x46c176;return respondWithRpcPromise('Agents',_0x4bdaf1[_0x9da1('0x12')])[_0x9da1('0x6')](function(_0x394acf){_0x46c176=_0x394acf;return respondWithRpcPromise('Agents',_0x4bdaf1['query'],routingClient);})['then'](function(_0x27e78c){return _['merge']({},_0x27e78c,_0x46c176);})[_0x9da1('0x6')](respondWithResult(_0x26e8d3,null))[_0x9da1('0x13')](handleError(_0x26e8d3,null));};exports[_0x9da1('0x25')]=function(_0x43c064,_0x54f188){if(_0x43c064[_0x9da1('0x1c')]&&_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')]&&_0x43c064[_0x9da1('0x27')]&&_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]){for(var _0x28e0b2 in _0x43c064['body'][_0x9da1('0x26')]){if(_0x43c064['body'][_0x9da1('0x26')]['hasOwnProperty'](_0x28e0b2)){db[_0x9da1('0x28')][_0x9da1('0x29')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'type':_0x9da1('0x2a'),'exitAt':null,'uniqueid':_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2]&&_0x43c064['body'][_0x9da1('0x26')][_0x28e0b2][_0x9da1('0x2b')]?{'$notIn':_0x43c064['body']['interaction'][_0x28e0b2]}:{'$ne':null}}})[_0x9da1('0x6')](function(_0x3f3688){var _0x15bb24=moment()[_0x9da1('0x2c')](_0x9da1('0x2d'));for(var _0x15578d=0x0,_0x2d7003=_0x3f3688[_0x9da1('0x2b')];_0x15578d<_0x2d7003;_0x15578d+=0x1){_0x3f3688[_0x15578d]['updateAttributes']({'exitAt':_0x15bb24});}});for(var _0xd7fb0a=0x0;_0xd7fb0a<_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2]['length'];_0xd7fb0a+=0x1){db[_0x9da1('0x28')][_0x9da1('0x2e')]({'where':{'channel':_0x28e0b2,'membername':_0x43c064[_0x9da1('0x27')]['name'],'type':_0x9da1('0x2a'),'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a],'exitAt':null},'defaults':{'channel':_0x28e0b2,'membername':_0x43c064['user'][_0x9da1('0xc')],'interface':_['isNil'](_0x43c064['user'][_0x9da1('0x2f')])?util[_0x9da1('0x2c')]('SIP/%s',_0x43c064[_0x9da1('0x27')][_0x9da1('0xc')]):_0x43c064['user'][_0x9da1('0x2f')],'type':_0x9da1('0x2a'),'enterAt':moment()[_0x9da1('0x2c')](_0x9da1('0x2d')),'role':_0x9da1('0x30'),'internal':_0x43c064[_0x9da1('0x27')][_0x9da1('0x31')],'uniqueid':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x26')][_0x28e0b2][_0xd7fb0a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x43c064[_0x9da1('0x17')]['id'],'capacity':_0x43c064[_0x9da1('0x1c')][_0x9da1('0x32')]},routingClient)[_0x9da1('0x6')](respondWithResult(_0x54f188,null))['catch'](handleError(_0x54f188,null));};exports['telephones']=function(_0xf36078,_0x6ca1ac){return respondWithRpcPromise(_0x9da1('0x33'),_0xf36078[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x6ca1ac,null))[_0x9da1('0x13')](handleError(_0x6ca1ac,null));};exports[_0x9da1('0x34')]=function(_0x1b1148,_0x34327e){return respondWithRpcPromise(_0x9da1('0x35'),_0x1b1148[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x34327e,null))[_0x9da1('0x13')](handleError(_0x34327e,null));};exports[_0x9da1('0x36')]=function(_0x4c99e8,_0x26ecdb){return respondWithRpcPromise(_0x9da1('0x37'),_0x4c99e8['query'])[_0x9da1('0x6')](respondWithResult(_0x26ecdb,null))['catch'](handleError(_0x26ecdb,null));};exports[_0x9da1('0x38')]=function(_0x4f4980,_0x5df0d8){return respondWithRpcPromise(_0x9da1('0x39'),_0x4f4980[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5df0d8,null))[_0x9da1('0x13')](handleError(_0x5df0d8,null));};exports[_0x9da1('0x3a')]=function(_0x2787e1,_0x343b05){return respondWithRpcPromise(_0x9da1('0x39'),_0x2787e1[_0x9da1('0x12')],routingClient)['then'](findById(_0x2787e1[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x343b05,null))[_0x9da1('0x13')](handleError(_0x343b05,null));};exports[_0x9da1('0x3b')]=function(_0x2aae1b,_0x4607a9){return respondWithRpcPromise(_0x9da1('0x3c'),_0x2aae1b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x4607a9,null))[_0x9da1('0x13')](handleError(_0x4607a9,null));};exports['showMailQueues']=function(_0xdaa51b,_0x374a1a){return respondWithRpcPromise('MailQueues',_0xdaa51b[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0xdaa51b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x374a1a,null))[_0x9da1('0x13')](handleError(_0x374a1a,null));};exports[_0x9da1('0x3d')]=function(_0x3081d7,_0x5d9ac7){return respondWithRpcPromise(_0x9da1('0x3e'),_0x3081d7[_0x9da1('0x12')],mailClient)[_0x9da1('0x6')](respondWithResult(_0x5d9ac7,null))[_0x9da1('0x13')](handleError(_0x5d9ac7,null));};exports['openchannelQueues']=function(_0x1a9df0,_0x5c236e){return respondWithRpcPromise(_0x9da1('0x3f'),_0x1a9df0[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x5c236e,null))[_0x9da1('0x13')](handleError(_0x5c236e,null));};exports[_0x9da1('0x40')]=function(_0x4445e2,_0x5e262c){return respondWithRpcPromise('OpenchannelQueues',_0x4445e2[_0x9da1('0x12')],routingClient)['then'](findById(_0x4445e2['params']['id']))['then'](respondWithResult(_0x5e262c,null))[_0x9da1('0x13')](handleError(_0x5e262c,null));};exports['smsQueues']=function(_0x1ee86e,_0x558602){return respondWithRpcPromise(_0x9da1('0x41'),_0x1ee86e[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x558602,null))[_0x9da1('0x13')](handleError(_0x558602,null));};exports[_0x9da1('0x42')]=function(_0x575a9b,_0x1a91c8){return respondWithRpcPromise(_0x9da1('0x41'),_0x575a9b['query'],routingClient)['then'](findById(_0x575a9b[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x1a91c8,null))[_0x9da1('0x13')](handleError(_0x1a91c8,null));};exports[_0x9da1('0x43')]=function(_0x236b01,_0x44d7fe){return respondWithRpcPromise('WhatsappQueues',_0x236b01[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x44d7fe,null))['catch'](handleError(_0x44d7fe,null));};exports[_0x9da1('0x44')]=function(_0x41717a,_0x2e4ea4){return respondWithRpcPromise(_0x9da1('0x45'),_0x41717a[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x41717a[_0x9da1('0x17')]['id']))[_0x9da1('0x6')](respondWithResult(_0x2e4ea4,null))[_0x9da1('0x13')](handleError(_0x2e4ea4,null));};exports['faxQueues']=function(_0x41283e,_0xbd54e){return respondWithRpcPromise(_0x9da1('0x46'),_0x41283e[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0xbd54e,null))['catch'](handleError(_0xbd54e,null));};exports[_0x9da1('0x47')]=function(_0x13fadd,_0x419f78){return respondWithRpcPromise(_0x9da1('0x46'),_0x13fadd[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](findById(_0x13fadd['params']['id']))[_0x9da1('0x6')](respondWithResult(_0x419f78,null))['catch'](handleError(_0x419f78,null));};exports[_0x9da1('0x48')]=function(_0x5b6d9f,_0x7cfa7e){return respondWithRpcPromise(_0x9da1('0x49'),_0x5b6d9f[_0x9da1('0x12')])[_0x9da1('0x6')](respondWithResult(_0x7cfa7e,null))['catch'](handleError(_0x7cfa7e,null));};exports['chatQueuesWaitingInteractions']=function(_0x4c832f,_0x73a2fc){return respondWithRpcPromise(_0x9da1('0x4a'),_0x4c832f[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x73a2fc,null))['catch'](handleError(_0x73a2fc,null));};exports['mailQueuesWaitingInteractions']=function(_0x35b782,_0x327bb4){return respondWithRpcPromise(_0x9da1('0x4b'),_0x35b782['query'],routingClient)['then'](respondWithResult(_0x327bb4,null))[_0x9da1('0x13')](handleError(_0x327bb4,null));};exports[_0x9da1('0x4c')]=function(_0x114093,_0x57f20c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x114093[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x57f20c,null))[_0x9da1('0x13')](handleError(_0x57f20c,null));};exports[_0x9da1('0x4d')]=function(_0x3cfe64,_0x5daa11){return respondWithRpcPromise(_0x9da1('0x4e'),_0x3cfe64[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](function(_0x1f0369){if(_0x3cfe64['query'][_0x9da1('0x4f')]!==undefined){var _0x244987=_(_0x1f0369[_0x9da1('0xf')])['filter']([_0x3cfe64[_0x9da1('0x12')][_0x9da1('0x4f')],_0x3cfe64[_0x9da1('0x17')]['id']])['map'](_0x9da1('0x50'))[_0x9da1('0x51')]()['value']();return _0x1f0369[_0x9da1('0xf')]['filter'](function(_0x247710){return _0x244987['indexOf'](_0x247710[_0x9da1('0x50')])>-0x1;});}else{return _0x1f0369[_0x9da1('0xf')][_0x9da1('0x52')](function(_0x2d3541){return _0x2d3541[_0x9da1('0x50')]===parseInt(_0x3cfe64[_0x9da1('0x17')]['id']);});}})[_0x9da1('0x6')](respondWithResult(_0x5daa11,null))[_0x9da1('0x13')](handleError(_0x5daa11,null));};exports[_0x9da1('0x53')]=function(_0x457b45,_0x323cae){return respondWithRpcPromise(_0x9da1('0x54'),_0x457b45[_0x9da1('0x12')],routingClient)['then'](respondWithResult(_0x323cae,null))[_0x9da1('0x13')](handleError(_0x323cae,null));};exports[_0x9da1('0x55')]=function(_0x27cec6,_0x890b14){return respondWithRpcPromise(_0x9da1('0x56'),_0x27cec6['query'],routingClient)[_0x9da1('0x6')](respondWithResult(_0x890b14,null))[_0x9da1('0x13')](handleError(_0x890b14,null));};exports['faxQueuesWaitingInteractions']=function(_0x4a4cda,_0x84f8d8){return respondWithRpcPromise(_0x9da1('0x57'),_0x4a4cda[_0x9da1('0x12')],routingClient)[_0x9da1('0x6')](respondWithResult(_0x84f8d8,null))[_0x9da1('0x13')](handleError(_0x84f8d8,null));};exports[_0x9da1('0x58')]=function(_0x1e5b52){return function(_0x1eaaeb,_0x29c4e8){var _0x1d02ff,_0x21748e;var _0x48341a=_[_0x9da1('0x59')](_0x1e5b52);var _0x49a95c=_0x1e5b52===_0x9da1('0x5a')?_0x9da1('0x5b'):_0x9da1('0x5c');return db[_0x48341a+_0x9da1('0x5d')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x1eaaeb['params']['id']}})[_0x9da1('0x6')](function(_0x354c5a){if(_['isNil'](_0x354c5a)){throw new Error(_0x48341a+_0x9da1('0x5f'));}_0x1d02ff=_0x354c5a;return db[_0x48341a+'Message'][_0x9da1('0x5e')]({'where':{'id':_0x1eaaeb['body'][_0x9da1('0x60')]},'include':[{'model':db[_0x48341a+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x48341a+_0x49a95c],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0x3e331a){if(_[_0x9da1('0xe')](_0x3e331a)){throw new Error(_0x48341a+_0x9da1('0x62'));}_0x21748e=_0x3e331a;return _0x3e331a[_0x9da1('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0xbd3a16={'uniqueid':_0x1e5b52+'.'+_0x21748e['id']+'.'+_0x21748e[_0x9da1('0x61')]['id'],'FromUserId':_0x1eaaeb['user']['id'],'type':_0x9da1('0x64')};_0xbd3a16[_0x48341a+_0x9da1('0x65')]=_0x21748e['id'];_0xbd3a16[_0x48341a+_0x9da1('0x66')]=_0x21748e[_0x9da1('0x61')]['id'];_0xbd3a16[_0x9da1('0x67')+_0x48341a+_0x49a95c+'Id']=_0x21748e[_0x9da1('0x5c')]['id'];_0xbd3a16['To'+_0x48341a+'QueueId']=_0x1d02ff['id'];return db[_0x48341a+'TransferReport'][_0x9da1('0x68')](_0xbd3a16);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x1e5b52,'interaction':_0x21748e['Interaction'],'message':_0x21748e,'account':_0x21748e[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x64'),'appdata':_0x1d02ff[_0x9da1('0xc')]+','+(_0x21748e[_0x9da1('0x5c')][_0x9da1('0x6a')]||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})[_0x9da1('0x6')](respondWithResult(_0x29c4e8,null))['catch'](handleError(_0x29c4e8,null));};};exports[_0x9da1('0x6c')]=function(_0x18fbc9,_0x5a64fd){var _0x56af13,_0x392d19;if(_['isNil'](_0x18fbc9['body'][_0x9da1('0x6d')])){throw new Error(_0x9da1('0x6e'));}var _0x3f9010=_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x6d')];var _0x30065d=_[_0x9da1('0x59')](_0x3f9010);var _0x39afa7=_0x3f9010==='chat'?'Website':_0x9da1('0x5c');return db[_0x9da1('0x6f')][_0x9da1('0x5e')]({'raw':!![],'where':{'id':_0x18fbc9[_0x9da1('0x17')]['id'],'role':_0x9da1('0x30')}})[_0x9da1('0x6')](function(_0x20a71f){if(_[_0x9da1('0xe')](_0x20a71f)){throw new Error('Agent\x20not\x20found');}_0x56af13=_0x20a71f;return db[_0x30065d+_0x9da1('0x70')]['findOne']({'where':{'id':_0x18fbc9[_0x9da1('0x1c')][_0x9da1('0x60')]},'include':[{'model':db[_0x30065d+_0x9da1('0x61')],'as':_0x9da1('0x61')},{'model':db[_0x30065d+_0x39afa7],'as':_0x9da1('0x5c')}]});})[_0x9da1('0x6')](function(_0xe59156){if(_['isNil'](_0xe59156)){throw new Error(_0x30065d+_0x9da1('0x62'));}_0x392d19=_0xe59156;return _0xe59156['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x9da1('0x6')](function(){var _0x35322c={'uniqueid':_0x3f9010+'.'+_0x392d19['id']+'.'+_0x392d19[_0x9da1('0x61')]['id'],'FromUserId':_0x18fbc9[_0x9da1('0x27')]['id'],'type':'queue','ToUserId':_0x56af13['id']};_0x35322c[_0x30065d+_0x9da1('0x65')]=_0x392d19['id'];_0x35322c[_0x30065d+_0x9da1('0x66')]=_0x392d19[_0x9da1('0x61')]['id'];_0x35322c[_0x9da1('0x67')+_0x30065d+_0x39afa7+'Id']=_0x392d19[_0x9da1('0x5c')]['id'];return db[_0x30065d+_0x9da1('0x71')][_0x9da1('0x68')](_0x35322c);})[_0x9da1('0x6')](function(){return respondWithRpcPromise(_0x9da1('0x69'),{'channel':_0x3f9010,'interaction':_0x392d19[_0x9da1('0x61')],'message':_0x392d19,'account':_0x392d19[_0x9da1('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9da1('0x30'),'appdata':_0x56af13[_0x9da1('0xc')]+','+(_0x392d19[_0x9da1('0x5c')]['agentTransferTimeout']||0x12c),'interval':_0x9da1('0x6b')}]},routingClient);})['then'](respondWithResult(_0x5a64fd,null))[_0x9da1('0x13')](handleError(_0x5a64fd,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 2ffa050..e5ba942 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 _0x8693=['put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run'];(function(_0x4d6e30,_0x4dd049){var _0x2fa20e=function(_0x6ca3b8){while(--_0x6ca3b8){_0x4d6e30['push'](_0x4d6e30['shift']());}};_0x2fa20e(++_0x4dd049);}(_0x8693,0xf1));var _0x3869=function(_0x320bb8,_0x590289){_0x320bb8=_0x320bb8-0x0;var _0x381578=_0x8693[_0x320bb8];return _0x381578;};'use strict';var multer=require(_0x3869('0x0'));var util=require(_0x3869('0x1'));var path=require(_0x3869('0x2'));var timeout=require(_0x3869('0x3'));var express=require('express');var router=express[_0x3869('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3869('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3869('0x6'));var controller=require(_0x3869('0x7'));router[_0x3869('0x8')]('/',auth[_0x3869('0x9')](),controller[_0x3869('0xa')]);router['get'](_0x3869('0xb'),auth[_0x3869('0x9')](),controller['show']);router[_0x3869('0x8')](_0x3869('0xc'),auth['isAuthenticated'](),controller[_0x3869('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3869('0xe')](_0x3869('0xb'),auth[_0x3869('0x9')](),controller[_0x3869('0xf')]);router[_0x3869('0x10')](_0x3869('0xb'),auth[_0x3869('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8ff9=['Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','isAuthenticated','get','/:id','show','/:id/run','run','post','put','update','delete','exports','multer','connect-timeout','express'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8ff9,0x95));var _0x98ff=function(_0x5e2498,_0x1297f0){_0x5e2498=_0x5e2498-0x0;var _0xc0c7fb=_0x8ff9[_0x5e2498];return _0xc0c7fb;};'use strict';var multer=require(_0x98ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x98ff('0x1'));var express=require(_0x98ff('0x2'));var router=express[_0x98ff('0x3')]();var fs_extra=require(_0x98ff('0x4'));var auth=require(_0x98ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x98ff('0x6'));var controller=require(_0x98ff('0x7'));router['get']('/',auth[_0x98ff('0x8')](),controller['index']);router[_0x98ff('0x9')](_0x98ff('0xa'),auth['isAuthenticated'](),controller[_0x98ff('0xb')]);router['get'](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0xd')]);router[_0x98ff('0xe')]('/',auth[_0x98ff('0x8')](),controller['create']);router[_0x98ff('0xf')](_0x98ff('0xa'),auth[_0x98ff('0x8')](),controller[_0x98ff('0x10')]);router[_0x98ff('0x11')](_0x98ff('0xa'),auth[_0x98ff('0x8')](),controller['destroy']);module[_0x98ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d830597..417b7f0 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 _0x3f0d=['quarters','months','weeks','days','hours','ENUM','csv','pdf','custom','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','years'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x3f0d,0x14b));var _0xd3f0=function(_0x32c8b2,_0x1cef36){_0x32c8b2=_0x32c8b2-0x0;var _0x2cfbfd=_0x3f0d[_0x32c8b2];return _0x2cfbfd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd3f0('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xd3f0('0x0')]},'active':{'type':Sequelize[_0xd3f0('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd3f0('0x0')],'allowNull':![],'defaultValue':_0xd3f0('0x2')},'startAt':{'type':Sequelize[_0xd3f0('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd3f0('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xd3f0('0x4'),_0xd3f0('0x5'),_0xd3f0('0x6'),_0xd3f0('0x7'),_0xd3f0('0x8'),_0xd3f0('0x9'),'minutes'),'allowNull':![],'defaultValue':_0xd3f0('0x8')},'output':{'type':Sequelize[_0xd3f0('0xa')](_0xd3f0('0xb'),_0xd3f0('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0xd3f0('0xb')},'type':{'type':Sequelize['ENUM'](_0xd3f0('0xd'),'default'),'allowNull':![],'defaultValue':_0xd3f0('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xd3f0('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xd3f0('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xaea1=['INTEGER','ENUM','years','quarters','months','hours','csv','pdf','xlsx','custom','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x2a293a,_0x354c96){var _0x59fd9f=function(_0xa9096f){while(--_0xa9096f){_0x2a293a['push'](_0x2a293a['shift']());}};_0x59fd9f(++_0x354c96);}(_0xaea1,0xf9));var _0x1aea=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaea1[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x1aea('0x0'));module[_0x1aea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1aea('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1aea('0x3')],'allowNull':![],'defaultValue':_0x1aea('0x4')},'startAt':{'type':Sequelize[_0x1aea('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1aea('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1aea('0x7')](_0x1aea('0x8'),_0x1aea('0x9'),_0x1aea('0xa'),'weeks','days',_0x1aea('0xb'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x1aea('0xc'),_0x1aea('0xd'),_0x1aea('0xe')),'allowNull':![],'defaultValue':_0x1aea('0xc')},'type':{'type':Sequelize[_0x1aea('0x7')](_0x1aea('0xf'),'default'),'allowNull':![],'defaultValue':_0x1aea('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x1aea('0x3')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x1aea('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x1aea('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0734e48..e7235b8 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 _0x4543=['../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','reject','save','update','get','Scheduler','UserProfileResource','then','sendStatus','stack','name','send','index','map','Schedule','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','keys','find','catch','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils'];(function(_0xb8c51c,_0x265b2e){var _0x16fa97=function(_0x2f3872){while(--_0x2f3872){_0xb8c51c['push'](_0xb8c51c['shift']());}};_0x16fa97(++_0x265b2e);}(_0x4543,0x130));var _0x3454=function(_0x2f8504,_0x588466){_0x2f8504=_0x2f8504-0x0;var _0x250ac1=_0x4543[_0x2f8504];return _0x250ac1;};'use strict';var emlformat=require(_0x3454('0x0'));var rimraf=require(_0x3454('0x1'));var zipdir=require(_0x3454('0x2'));var jsonpatch=require(_0x3454('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3454('0x4'));var Mustache=require(_0x3454('0x5'));var util=require(_0x3454('0x6'));var path=require(_0x3454('0x7'));var sox=require(_0x3454('0x8'));var csv=require(_0x3454('0x9'));var ejs=require(_0x3454('0xa'));var fs=require('fs');var fs_extra=require(_0x3454('0xb'));var _=require(_0x3454('0xc'));var squel=require(_0x3454('0xd'));var crypto=require(_0x3454('0xe'));var jsforce=require(_0x3454('0xf'));var deskjs=require(_0x3454('0x10'));var toCsv=require(_0x3454('0x9'));var querystring=require(_0x3454('0x11'));var Papa=require(_0x3454('0x12'));var Redis=require(_0x3454('0x13'));var authService=require(_0x3454('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3454('0x15'));var logger=require('../../config/logger')(_0x3454('0x16'));var utils=require(_0x3454('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3454('0x18'));var db=require(_0x3454('0x19'))['db'];function respondWithStatusCode(_0x348fb6,_0x125b44){_0x125b44=_0x125b44||0xcc;return function(_0x719059){if(_0x719059){return _0x348fb6['sendStatus'](_0x125b44);}return _0x348fb6[_0x3454('0x1a')](_0x125b44)[_0x3454('0x1b')]();};}function respondWithResult(_0x164fb7,_0x4c009b){_0x4c009b=_0x4c009b||0xc8;return function(_0x5d2953){if(_0x5d2953){return _0x164fb7[_0x3454('0x1a')](_0x4c009b)[_0x3454('0x1c')](_0x5d2953);}};}function respondWithFilteredResult(_0x32adec,_0x3bf103){return function(_0x44faf6){if(_0x44faf6){var _0x3c1166=typeof _0x3bf103['offset']===_0x3454('0x1d')&&typeof _0x3bf103[_0x3454('0x1e')]===_0x3454('0x1d');var _0x47d66c=_0x44faf6[_0x3454('0x1f')];var _0xa15323=_0x3c1166?0x0:_0x3bf103[_0x3454('0x20')];var _0xe63c14=_0x3c1166?_0x44faf6[_0x3454('0x1f')]:_0x3bf103[_0x3454('0x20')]+_0x3bf103[_0x3454('0x1e')];var _0x10a825;if(_0xe63c14>=_0x47d66c){_0xe63c14=_0x47d66c;_0x10a825=0xc8;}else{_0x10a825=0xce;}_0x32adec[_0x3454('0x1a')](_0x10a825);return _0x32adec[_0x3454('0x21')]('Content-Range',_0xa15323+'-'+_0xe63c14+'/'+_0x47d66c)[_0x3454('0x1c')](_0x44faf6);}return null;};}function patchUpdates(_0x131532){return function(_0x2d4fd5){try{jsonpatch['apply'](_0x2d4fd5,_0x131532,!![]);}catch(_0x18e3b2){return BPromise[_0x3454('0x22')](_0x18e3b2);}return _0x2d4fd5[_0x3454('0x23')]();};}function saveUpdates(_0x391de4,_0x1c1d35){return function(_0x1a7429){if(_0x1a7429){return _0x1a7429[_0x3454('0x24')](_0x391de4)['then'](function(_0x5713f1){return _0x5713f1;});}return null;};}function removeEntity(_0x98e019,_0x50264f){return function(_0x332f88){if(_0x332f88){return _0x332f88['destroy']()['then'](function(){var _0x43a611=_0x332f88[_0x3454('0x25')]({'plain':!![]});var _0x9132c=_0x3454('0x26');return db[_0x3454('0x27')]['destroy']({'where':{'type':_0x9132c,'resourceId':_0x43a611['id']}})[_0x3454('0x28')](function(){return _0x332f88;});})[_0x3454('0x28')](function(){_0x98e019[_0x3454('0x1a')](0xcc)[_0x3454('0x1b')]();});}};}function handleEntityNotFound(_0x55f317,_0x3cb102){return function(_0x39b55d){if(!_0x39b55d){_0x55f317[_0x3454('0x29')](0x194);}return _0x39b55d;};}function handleError(_0x16310e,_0x18cde5){_0x18cde5=_0x18cde5||0x1f4;return function(_0x391790){logger['error'](_0x391790[_0x3454('0x2a')]);if(_0x391790[_0x3454('0x2b')]){delete _0x391790[_0x3454('0x2b')];}_0x16310e[_0x3454('0x1a')](_0x18cde5)[_0x3454('0x2c')](_0x391790);};}exports[_0x3454('0x2d')]=function(_0x571aad,_0x2a044e){var _0x3a51c0={},_0x21d760={},_0x2ba760={'count':0x0,'rows':[]};var _0x35a6f6=_[_0x3454('0x2e')](db[_0x3454('0x2f')][_0x3454('0x30')],function(_0x43c29d){return{'name':_0x43c29d['fieldName'],'type':_0x43c29d['type'][_0x3454('0x31')]};});_0x21d760[_0x3454('0x32')]=_[_0x3454('0x2e')](_0x35a6f6,'name');_0x21d760[_0x3454('0x33')]=_['keys'](_0x571aad[_0x3454('0x33')]);_0x21d760[_0x3454('0x34')]=_[_0x3454('0x35')](_0x21d760[_0x3454('0x32')],_0x21d760['query']);_0x3a51c0['attributes']=_[_0x3454('0x35')](_0x21d760[_0x3454('0x32')],qs['fields'](_0x571aad['query'][_0x3454('0x36')]));_0x3a51c0['attributes']=_0x3a51c0[_0x3454('0x37')][_0x3454('0x38')]?_0x3a51c0[_0x3454('0x37')]:_0x21d760[_0x3454('0x32')];if(!_0x571aad[_0x3454('0x33')]['hasOwnProperty'](_0x3454('0x39'))){_0x3a51c0[_0x3454('0x1e')]=qs[_0x3454('0x1e')](_0x571aad[_0x3454('0x33')][_0x3454('0x1e')]);_0x3a51c0[_0x3454('0x20')]=qs['offset'](_0x571aad[_0x3454('0x33')][_0x3454('0x20')]);}_0x3a51c0[_0x3454('0x3a')]=qs[_0x3454('0x3b')](_0x571aad[_0x3454('0x33')][_0x3454('0x3b')]);_0x3a51c0[_0x3454('0x3c')]=qs[_0x3454('0x34')](_['pick'](_0x571aad[_0x3454('0x33')],_0x21d760['filters']),_0x35a6f6);if(_0x571aad[_0x3454('0x33')][_0x3454('0x3d')]){_0x3a51c0[_0x3454('0x3c')]=_[_0x3454('0x3e')](_0x3a51c0[_0x3454('0x3c')],{'$or':_[_0x3454('0x2e')](_0x35a6f6,function(_0x1f30ef){if(_0x1f30ef[_0x3454('0x3f')]!=='VIRTUAL'){var _0x47eec5={};_0x47eec5[_0x1f30ef[_0x3454('0x2b')]]={'$like':'%'+_0x571aad[_0x3454('0x33')][_0x3454('0x3d')]+'%'};return _0x47eec5;}})});}_0x3a51c0=_[_0x3454('0x3e')]({},_0x3a51c0,_0x571aad[_0x3454('0x40')]);var _0x5233ea={'where':_0x3a51c0[_0x3454('0x3c')]};return db[_0x3454('0x2f')][_0x3454('0x1f')](_0x5233ea)['then'](function(_0x330631){_0x2ba760[_0x3454('0x1f')]=_0x330631;if(_0x571aad[_0x3454('0x33')][_0x3454('0x41')]){_0x3a51c0[_0x3454('0x42')]=[{'all':!![]}];}return db[_0x3454('0x2f')][_0x3454('0x43')](_0x3a51c0);})[_0x3454('0x28')](function(_0x4e734d){_0x2ba760['rows']=_0x4e734d;return _0x2ba760;})[_0x3454('0x28')](respondWithFilteredResult(_0x2a044e,_0x3a51c0))['catch'](handleError(_0x2a044e,null));};exports['show']=function(_0x2f128c,_0x19c15a){var _0x2e9880={'raw':![],'where':{'id':_0x2f128c['params']['id']}},_0x463967={};_0x463967[_0x3454('0x32')]=_[_0x3454('0x44')](db[_0x3454('0x2f')][_0x3454('0x30')]);_0x463967['query']=_[_0x3454('0x44')](_0x2f128c[_0x3454('0x33')]);_0x463967[_0x3454('0x34')]=_[_0x3454('0x35')](_0x463967[_0x3454('0x32')],_0x463967[_0x3454('0x33')]);_0x2e9880[_0x3454('0x37')]=_['intersection'](_0x463967[_0x3454('0x32')],qs['fields'](_0x2f128c['query'][_0x3454('0x36')]));_0x2e9880['attributes']=_0x2e9880['attributes'][_0x3454('0x38')]?_0x2e9880[_0x3454('0x37')]:_0x463967['model'];if(_0x2f128c[_0x3454('0x33')]['includeAll']){_0x2e9880['include']=[{'all':!![]}];}_0x2e9880=_['merge']({},_0x2e9880,_0x2f128c['options']);return db['Schedule'][_0x3454('0x45')](_0x2e9880)[_0x3454('0x28')](handleEntityNotFound(_0x19c15a,null))[_0x3454('0x28')](respondWithResult(_0x19c15a,null))[_0x3454('0x46')](handleError(_0x19c15a,null));};exports[_0x3454('0x47')]=function(_0x1e4141,_0x28daaa){return db[_0x3454('0x2f')][_0x3454('0x47')](_0x1e4141[_0x3454('0x48')],{})['then'](function(_0x22f7a6){var _0x30a56d=_0x1e4141[_0x3454('0x49')][_0x3454('0x25')]({'plain':!![]});if(!_0x30a56d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30a56d[_0x3454('0x4a')]==='user'){var _0x4bcd04=_0x22f7a6[_0x3454('0x25')]({'plain':!![]});var _0x189a8c=_0x3454('0x26');return db[_0x3454('0x4b')][_0x3454('0x45')]({'where':{'name':_0x189a8c,'userProfileId':_0x30a56d['userProfileId']},'raw':!![]})[_0x3454('0x28')](function(_0xa4b1ba){if(_0xa4b1ba&&_0xa4b1ba['autoAssociation']===0x0){return db[_0x3454('0x27')][_0x3454('0x47')]({'name':_0x4bcd04['name'],'resourceId':_0x4bcd04['id'],'type':_0xa4b1ba[_0x3454('0x2b')],'sectionId':_0xa4b1ba['id']},{})['then'](function(){return _0x22f7a6;});}else{return _0x22f7a6;}})[_0x3454('0x46')](function(_0x4d10fb){logger[_0x3454('0x4c')](_0x3454('0x4d'),_0x4d10fb);throw _0x4d10fb;});}return _0x22f7a6;})[_0x3454('0x28')](respondWithResult(_0x28daaa,0xc9))['catch'](handleError(_0x28daaa,null));};exports[_0x3454('0x24')]=function(_0x11fd15,_0x24064c){if(_0x11fd15[_0x3454('0x48')]['id']){delete _0x11fd15['body']['id'];}return db['Schedule'][_0x3454('0x45')]({'where':{'id':_0x11fd15[_0x3454('0x4e')]['id']}})[_0x3454('0x28')](handleEntityNotFound(_0x24064c,null))['then'](saveUpdates(_0x11fd15['body'],null))[_0x3454('0x28')](respondWithResult(_0x24064c,null))[_0x3454('0x46')](handleError(_0x24064c,null));};exports[_0x3454('0x4f')]=function(_0x46a899,_0x252e6b){return db[_0x3454('0x2f')][_0x3454('0x45')]({'where':{'id':_0x46a899[_0x3454('0x4e')]['id']}})[_0x3454('0x28')](handleEntityNotFound(_0x252e6b,null))['then'](removeEntity(_0x252e6b,null))[_0x3454('0x46')](handleError(_0x252e6b,null));};exports[_0x3454('0x50')]=function(_0x38b2a8,_0x19d706,_0x40e705){var _0x36b27b=require(_0x3454('0x51'));return db['Schedule'][_0x3454('0x45')]({'where':{'id':_0x38b2a8[_0x3454('0x4e')]['id']},'raw':!![]})[_0x3454('0x28')](handleEntityNotFound(_0x19d706,null))[_0x3454('0x28')](function(){_0x36b27b['run'](_0x38b2a8[_0x3454('0x4e')]['id']);})[_0x3454('0x28')](respondWithStatusCode(_0x19d706,null))[_0x3454('0x46')](handleError(_0x19d706,null));}; \ No newline at end of file +var _0xac7e=['params','keys','includeAll','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Scheduler','UserProfileSection','update','find','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','UserProfileResource','destroy','error','name','index','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','Schedule','findAll','rows','catch','show'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xac7e,0x14f));var _0xeac7=function(_0x298f3c,_0x4f34a8){_0x298f3c=_0x298f3c-0x0;var _0x11ec1a=_0xac7e[_0x298f3c];return _0x11ec1a;};'use strict';var emlformat=require(_0xeac7('0x0'));var rimraf=require(_0xeac7('0x1'));var zipdir=require(_0xeac7('0x2'));var jsonpatch=require(_0xeac7('0x3'));var rp=require(_0xeac7('0x4'));var moment=require(_0xeac7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeac7('0x6'));var util=require(_0xeac7('0x7'));var path=require('path');var sox=require(_0xeac7('0x8'));var csv=require('to-csv');var ejs=require(_0xeac7('0x9'));var fs=require('fs');var fs_extra=require(_0xeac7('0xa'));var _=require('lodash');var squel=require(_0xeac7('0xb'));var crypto=require(_0xeac7('0xc'));var jsforce=require(_0xeac7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeac7('0xe'));var querystring=require('querystring');var Papa=require(_0xeac7('0xf'));var Redis=require(_0xeac7('0x10'));var authService=require(_0xeac7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeac7('0x12'));var hardwareService=require(_0xeac7('0x13'));var logger=require(_0xeac7('0x14'))(_0xeac7('0x15'));var utils=require(_0xeac7('0x16'));var config=require(_0xeac7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xeac7('0x18'))['db'];function respondWithStatusCode(_0x12ba32,_0x12d16c){_0x12d16c=_0x12d16c||0xcc;return function(_0x2fd0ad){if(_0x2fd0ad){return _0x12ba32['sendStatus'](_0x12d16c);}return _0x12ba32[_0xeac7('0x19')](_0x12d16c)[_0xeac7('0x1a')]();};}function respondWithResult(_0x20ecec,_0x20b153){_0x20b153=_0x20b153||0xc8;return function(_0xffae89){if(_0xffae89){return _0x20ecec[_0xeac7('0x19')](_0x20b153)[_0xeac7('0x1b')](_0xffae89);}};}function respondWithFilteredResult(_0x31139d,_0x4bb189){return function(_0x1612c4){if(_0x1612c4){var _0x3d38bc=typeof _0x4bb189['offset']===_0xeac7('0x1c')&&typeof _0x4bb189[_0xeac7('0x1d')]===_0xeac7('0x1c');var _0x4d9da4=_0x1612c4[_0xeac7('0x1e')];var _0x11bd6d=_0x3d38bc?0x0:_0x4bb189[_0xeac7('0x1f')];var _0x1981fe=_0x3d38bc?_0x1612c4[_0xeac7('0x1e')]:_0x4bb189[_0xeac7('0x1f')]+_0x4bb189[_0xeac7('0x1d')];var _0x377d09;if(_0x1981fe>=_0x4d9da4){_0x1981fe=_0x4d9da4;_0x377d09=0xc8;}else{_0x377d09=0xce;}_0x31139d[_0xeac7('0x19')](_0x377d09);return _0x31139d[_0xeac7('0x20')](_0xeac7('0x21'),_0x11bd6d+'-'+_0x1981fe+'/'+_0x4d9da4)['json'](_0x1612c4);}return null;};}function patchUpdates(_0x40a0d3){return function(_0x2b291d){try{jsonpatch['apply'](_0x2b291d,_0x40a0d3,!![]);}catch(_0x2dd696){return BPromise[_0xeac7('0x22')](_0x2dd696);}return _0x2b291d[_0xeac7('0x23')]();};}function saveUpdates(_0x389ab8,_0x5a9b63){return function(_0x24007e){if(_0x24007e){return _0x24007e['update'](_0x389ab8)[_0xeac7('0x24')](function(_0x522d0a){return _0x522d0a;});}return null;};}function removeEntity(_0x48fc19,_0x359ae4){return function(_0x2add67){if(_0x2add67){return _0x2add67['destroy']()[_0xeac7('0x24')](function(){var _0x2c8299=_0x2add67['get']({'plain':!![]});var _0x1f1ad5='Scheduler';return db[_0xeac7('0x25')][_0xeac7('0x26')]({'where':{'type':_0x1f1ad5,'resourceId':_0x2c8299['id']}})[_0xeac7('0x24')](function(){return _0x2add67;});})[_0xeac7('0x24')](function(){_0x48fc19[_0xeac7('0x19')](0xcc)[_0xeac7('0x1a')]();});}};}function handleEntityNotFound(_0x40c6b5,_0x1509c4){return function(_0x46fb29){if(!_0x46fb29){_0x40c6b5['sendStatus'](0x194);}return _0x46fb29;};}function handleError(_0xdfe60,_0x53193d){_0x53193d=_0x53193d||0x1f4;return function(_0x20f162){logger[_0xeac7('0x27')](_0x20f162['stack']);if(_0x20f162['name']){delete _0x20f162[_0xeac7('0x28')];}_0xdfe60[_0xeac7('0x19')](_0x53193d)['send'](_0x20f162);};}exports[_0xeac7('0x29')]=function(_0x48b9cb,_0x5f1788){var _0x59e523={},_0x31cedc={},_0x2fdfb5={'count':0x0,'rows':[]};var _0x15a003=_[_0xeac7('0x2a')](db['Schedule'][_0xeac7('0x2b')],function(_0x340777){return{'name':_0x340777['fieldName'],'type':_0x340777[_0xeac7('0x2c')]['key']};});_0x31cedc['model']=_[_0xeac7('0x2a')](_0x15a003,_0xeac7('0x28'));_0x31cedc['query']=_['keys'](_0x48b9cb[_0xeac7('0x2d')]);_0x31cedc[_0xeac7('0x2e')]=_[_0xeac7('0x2f')](_0x31cedc[_0xeac7('0x30')],_0x31cedc[_0xeac7('0x2d')]);_0x59e523[_0xeac7('0x31')]=_['intersection'](_0x31cedc[_0xeac7('0x30')],qs[_0xeac7('0x32')](_0x48b9cb[_0xeac7('0x2d')][_0xeac7('0x32')]));_0x59e523[_0xeac7('0x31')]=_0x59e523[_0xeac7('0x31')][_0xeac7('0x33')]?_0x59e523[_0xeac7('0x31')]:_0x31cedc[_0xeac7('0x30')];if(!_0x48b9cb[_0xeac7('0x2d')][_0xeac7('0x34')]('nolimit')){_0x59e523['limit']=qs[_0xeac7('0x1d')](_0x48b9cb[_0xeac7('0x2d')][_0xeac7('0x1d')]);_0x59e523['offset']=qs['offset'](_0x48b9cb['query'][_0xeac7('0x1f')]);}_0x59e523[_0xeac7('0x35')]=qs['sort'](_0x48b9cb[_0xeac7('0x2d')]['sort']);_0x59e523[_0xeac7('0x36')]=qs[_0xeac7('0x2e')](_[_0xeac7('0x37')](_0x48b9cb[_0xeac7('0x2d')],_0x31cedc[_0xeac7('0x2e')]),_0x15a003);if(_0x48b9cb[_0xeac7('0x2d')]['filter']){_0x59e523[_0xeac7('0x36')]=_[_0xeac7('0x38')](_0x59e523[_0xeac7('0x36')],{'$or':_['map'](_0x15a003,function(_0x5cd738){if(_0x5cd738[_0xeac7('0x2c')]!==_0xeac7('0x39')){var _0x2191cc={};_0x2191cc[_0x5cd738[_0xeac7('0x28')]]={'$like':'%'+_0x48b9cb['query'][_0xeac7('0x3a')]+'%'};return _0x2191cc;}})});}_0x59e523=_[_0xeac7('0x38')]({},_0x59e523,_0x48b9cb[_0xeac7('0x3b')]);var _0x5cad7b={'where':_0x59e523[_0xeac7('0x36')]};return db[_0xeac7('0x3c')][_0xeac7('0x1e')](_0x5cad7b)['then'](function(_0x581eac){_0x2fdfb5['count']=_0x581eac;if(_0x48b9cb[_0xeac7('0x2d')]['includeAll']){_0x59e523['include']=[{'all':!![]}];}return db['Schedule'][_0xeac7('0x3d')](_0x59e523);})[_0xeac7('0x24')](function(_0x4d46f0){_0x2fdfb5[_0xeac7('0x3e')]=_0x4d46f0;return _0x2fdfb5;})[_0xeac7('0x24')](respondWithFilteredResult(_0x5f1788,_0x59e523))[_0xeac7('0x3f')](handleError(_0x5f1788,null));};exports[_0xeac7('0x40')]=function(_0x4cb8da,_0x1da990){var _0x44c5a2={'raw':![],'where':{'id':_0x4cb8da[_0xeac7('0x41')]['id']}},_0x31bef4={};_0x31bef4[_0xeac7('0x30')]=_[_0xeac7('0x42')](db[_0xeac7('0x3c')][_0xeac7('0x2b')]);_0x31bef4[_0xeac7('0x2d')]=_['keys'](_0x4cb8da[_0xeac7('0x2d')]);_0x31bef4[_0xeac7('0x2e')]=_[_0xeac7('0x2f')](_0x31bef4[_0xeac7('0x30')],_0x31bef4[_0xeac7('0x2d')]);_0x44c5a2['attributes']=_['intersection'](_0x31bef4[_0xeac7('0x30')],qs['fields'](_0x4cb8da[_0xeac7('0x2d')][_0xeac7('0x32')]));_0x44c5a2[_0xeac7('0x31')]=_0x44c5a2['attributes'][_0xeac7('0x33')]?_0x44c5a2['attributes']:_0x31bef4['model'];if(_0x4cb8da[_0xeac7('0x2d')][_0xeac7('0x43')]){_0x44c5a2[_0xeac7('0x44')]=[{'all':!![]}];}_0x44c5a2=_[_0xeac7('0x38')]({},_0x44c5a2,_0x4cb8da[_0xeac7('0x3b')]);return db['Schedule']['find'](_0x44c5a2)['then'](handleEntityNotFound(_0x1da990,null))[_0xeac7('0x24')](respondWithResult(_0x1da990,null))[_0xeac7('0x3f')](handleError(_0x1da990,null));};exports['create']=function(_0x1fc708,_0x72d354){return db[_0xeac7('0x3c')][_0xeac7('0x45')](_0x1fc708[_0xeac7('0x46')],{})[_0xeac7('0x24')](function(_0x49db4b){var _0x368e5b=_0x1fc708['user'][_0xeac7('0x47')]({'plain':!![]});if(!_0x368e5b)throw new Error(_0xeac7('0x48'));if(_0x368e5b['role']===_0xeac7('0x49')){var _0x5152af=_0x49db4b['get']({'plain':!![]});var _0x3485b9=_0xeac7('0x4a');return db[_0xeac7('0x4b')]['find']({'where':{'name':_0x3485b9,'userProfileId':_0x368e5b['userProfileId']},'raw':!![]})[_0xeac7('0x24')](function(_0x3219fb){if(_0x3219fb&&_0x3219fb['autoAssociation']===0x0){return db[_0xeac7('0x25')][_0xeac7('0x45')]({'name':_0x5152af[_0xeac7('0x28')],'resourceId':_0x5152af['id'],'type':_0x3219fb['name'],'sectionId':_0x3219fb['id']},{})[_0xeac7('0x24')](function(){return _0x49db4b;});}else{return _0x49db4b;}})[_0xeac7('0x3f')](function(_0x24ebd4){logger[_0xeac7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24ebd4);throw _0x24ebd4;});}return _0x49db4b;})[_0xeac7('0x24')](respondWithResult(_0x72d354,0xc9))[_0xeac7('0x3f')](handleError(_0x72d354,null));};exports[_0xeac7('0x4c')]=function(_0x1dff38,_0x310544){if(_0x1dff38[_0xeac7('0x46')]['id']){delete _0x1dff38['body']['id'];}return db[_0xeac7('0x3c')]['find']({'where':{'id':_0x1dff38[_0xeac7('0x41')]['id']}})[_0xeac7('0x24')](handleEntityNotFound(_0x310544,null))[_0xeac7('0x24')](saveUpdates(_0x1dff38[_0xeac7('0x46')],null))[_0xeac7('0x24')](respondWithResult(_0x310544,null))['catch'](handleError(_0x310544,null));};exports[_0xeac7('0x26')]=function(_0x350660,_0x16b4dd){return db['Schedule'][_0xeac7('0x4d')]({'where':{'id':_0x350660[_0xeac7('0x41')]['id']}})[_0xeac7('0x24')](handleEntityNotFound(_0x16b4dd,null))['then'](removeEntity(_0x16b4dd,null))[_0xeac7('0x3f')](handleError(_0x16b4dd,null));};exports[_0xeac7('0x4e')]=function(_0x5783aa,_0x1dcaab,_0x1811c4){var _0x5061b3=require(_0xeac7('0x4f'));return db[_0xeac7('0x3c')]['find']({'where':{'id':_0x5783aa[_0xeac7('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1dcaab,null))[_0xeac7('0x24')](function(){_0x5061b3[_0xeac7('0x4e')](_0x5783aa[_0xeac7('0x41')]['id']);})[_0xeac7('0x24')](respondWithStatusCode(_0x1dcaab,null))[_0xeac7('0x3f')](handleError(_0x1dcaab,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index dda39b5..6f94d8d 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 _0xbec6=['path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36631d,_0x2786bf){var _0x410666=function(_0x14e77c){while(--_0x14e77c){_0x36631d['push'](_0x36631d['shift']());}};_0x410666(++_0x2786bf);}(_0xbec6,0x69));var _0x6bec=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xbec6[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0x6bec('0x0'));var util=require(_0x6bec('0x1'));var logger=require(_0x6bec('0x2'))(_0x6bec('0x3'));var moment=require(_0x6bec('0x4'));var BPromise=require(_0x6bec('0x5'));var rp=require(_0x6bec('0x6'));var fs=require('fs');var path=require(_0x6bec('0x7'));var rimraf=require(_0x6bec('0x8'));var config=require(_0x6bec('0x9'));var attributes=require(_0x6bec('0xa'));module[_0x6bec('0xb')]=function(_0x403dcf,_0x490412){return _0x403dcf['define'](_0x6bec('0xc'),attributes,{'tableName':_0x6bec('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0681=['tools_schedules','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule'];(function(_0x184681,_0x29846f){var _0x41bf68=function(_0x38aedb){while(--_0x38aedb){_0x184681['push'](_0x184681['shift']());}};_0x41bf68(++_0x29846f);}(_0x0681,0xd9));var _0x1068=function(_0x4689af,_0x4c3cb8){_0x4689af=_0x4689af-0x0;var _0x43ce74=_0x0681[_0x4689af];return _0x43ce74;};'use strict';var _=require(_0x1068('0x0'));var util=require('util');var logger=require(_0x1068('0x1'))(_0x1068('0x2'));var moment=require(_0x1068('0x3'));var BPromise=require('bluebird');var rp=require(_0x1068('0x4'));var fs=require('fs');var path=require(_0x1068('0x5'));var rimraf=require(_0x1068('0x6'));var config=require('../../config/environment');var attributes=require(_0x1068('0x7'));module[_0x1068('0x8')]=function(_0xd3067d,_0x219592){return _0xd3067d[_0x1068('0x9')](_0x1068('0xa'),attributes,{'tableName':_0x1068('0xb'),'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 7db2429..9344002 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 _0xbe6c=['../../config/environment','client','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd37f1c,_0x7548c5){var _0x273cb9=function(_0x67b4d9){while(--_0x67b4d9){_0xd37f1c['push'](_0xd37f1c['shift']());}};_0x273cb9(++_0x7548c5);}(_0xbe6c,0x77));var _0xcbe6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xbe6c[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0xcbe6('0x0'));var moment=require(_0xcbe6('0x1'));var BPromise=require('bluebird');var rs=require(_0xcbe6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbe6('0x3'))['db'];var utils=require(_0xcbe6('0x4'));var logger=require(_0xcbe6('0x5'))(_0xcbe6('0x6'));var config=require(_0xcbe6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcbe6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1edfbd,_0x265be1,_0x1c817d){return new BPromise(function(_0x18fd3b,_0x36866d){return client[_0xcbe6('0x9')](_0x1edfbd,_0x1c817d)[_0xcbe6('0xa')](function(_0x24cd5f){logger[_0xcbe6('0xb')]('Schedule,\x20%s,\x20%s',_0x265be1,_0xcbe6('0xc'));logger[_0xcbe6('0xd')](_0xcbe6('0xe'),_0x265be1,_0xcbe6('0xc'),JSON[_0xcbe6('0xf')](_0x24cd5f));if(_0x24cd5f[_0xcbe6('0x10')]){if(_0x24cd5f['error'][_0xcbe6('0x11')]===0x1f4){logger[_0xcbe6('0x10')](_0xcbe6('0x12'),_0x265be1,_0x24cd5f[_0xcbe6('0x10')]['message']);return _0x36866d(_0x24cd5f[_0xcbe6('0x10')][_0xcbe6('0x13')]);}logger[_0xcbe6('0x10')](_0xcbe6('0x12'),_0x265be1,_0x24cd5f[_0xcbe6('0x10')][_0xcbe6('0x13')]);return _0x18fd3b(_0x24cd5f['error'][_0xcbe6('0x13')]);}else{logger[_0xcbe6('0xb')](_0xcbe6('0x12'),_0x265be1,_0xcbe6('0xc'));_0x18fd3b(_0x24cd5f[_0xcbe6('0x14')][_0xcbe6('0x13')]);}})['catch'](function(_0x3ec899){logger['error'](_0xcbe6('0x12'),_0x265be1,_0x3ec899);_0x36866d(_0x3ec899);});});} \ No newline at end of file +var _0x61a3=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x3a0c6b,_0x41ae2a){var _0x56f4fc=function(_0x1ecbe7){while(--_0x1ecbe7){_0x3a0c6b['push'](_0x3a0c6b['shift']());}};_0x56f4fc(++_0x41ae2a);}(_0x61a3,0xbf));var _0x361a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61a3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x361a('0x0'));var util=require('util');var moment=require(_0x361a('0x1'));var BPromise=require(_0x361a('0x2'));var rs=require(_0x361a('0x3'));var fs=require('fs');var Redis=require(_0x361a('0x4'));var db=require(_0x361a('0x5'))['db'];var utils=require(_0x361a('0x6'));var logger=require(_0x361a('0x7'))(_0x361a('0x8'));var config=require(_0x361a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x361a('0xa')][_0x361a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5269c6,_0x33d47e,_0xe91438){return new BPromise(function(_0x1a6ee9,_0x1d02a0){return client['request'](_0x5269c6,_0xe91438)[_0x361a('0xc')](function(_0x8c82d1){logger[_0x361a('0xd')](_0x361a('0xe'),_0x33d47e,_0x361a('0xf'));logger[_0x361a('0x10')](_0x361a('0x11'),_0x33d47e,_0x361a('0xf'),JSON[_0x361a('0x12')](_0x8c82d1));if(_0x8c82d1[_0x361a('0x13')]){if(_0x8c82d1[_0x361a('0x13')][_0x361a('0x14')]===0x1f4){logger[_0x361a('0x13')]('Schedule,\x20%s,\x20%s',_0x33d47e,_0x8c82d1[_0x361a('0x13')][_0x361a('0x15')]);return _0x1d02a0(_0x8c82d1[_0x361a('0x13')][_0x361a('0x15')]);}logger[_0x361a('0x13')](_0x361a('0xe'),_0x33d47e,_0x8c82d1[_0x361a('0x13')]['message']);return _0x1a6ee9(_0x8c82d1[_0x361a('0x13')]['message']);}else{logger[_0x361a('0xd')]('Schedule,\x20%s,\x20%s',_0x33d47e,_0x361a('0xf'));_0x1a6ee9(_0x8c82d1['result'][_0x361a('0x15')]);}})[_0x361a('0x16')](function(_0x3ab765){logger[_0x361a('0x13')](_0x361a('0xe'),_0x33d47e,_0x3ab765);_0x1d02a0(_0x3ab765);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 6dec2bf..d65387e 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 _0xd2bc=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id/download','download','post','create'];(function(_0x2f956b,_0x3caa5b){var _0x3b0e28=function(_0x46605e){while(--_0x46605e){_0x2f956b['push'](_0x2f956b['shift']());}};_0x3b0e28(++_0x3caa5b);}(_0xd2bc,0xf8));var _0xcd2b=function(_0x3d66ea,_0x3a3303){_0x3d66ea=_0x3d66ea-0x0;var _0x5a0d34=_0xd2bc[_0x3d66ea];return _0x5a0d34;};'use strict';var multer=require(_0xcd2b('0x0'));var util=require(_0xcd2b('0x1'));var path=require('path');var timeout=require(_0xcd2b('0x2'));var express=require(_0xcd2b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd2b('0x4'));var interaction=require(_0xcd2b('0x5'));var config=require(_0xcd2b('0x6'));var controller=require(_0xcd2b('0x7'));router[_0xcd2b('0x8')]('/',auth[_0xcd2b('0x9')](),controller[_0xcd2b('0xa')]);router['get'](_0xcd2b('0xb'),auth[_0xcd2b('0x9')](),controller['describe']);router[_0xcd2b('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcd2b('0x8')](_0xcd2b('0xc'),auth[_0xcd2b('0x9')](),controller[_0xcd2b('0xd')]);router[_0xcd2b('0xe')]('/',auth['isAuthenticated'](),controller[_0xcd2b('0xf')]);router[_0xcd2b('0x10')](_0xcd2b('0x11'),auth[_0xcd2b('0x9')](),controller[_0xcd2b('0x12')]);router[_0xcd2b('0x13')](_0xcd2b('0x11'),auth[_0xcd2b('0x9')](),controller[_0xcd2b('0x14')]);module[_0xcd2b('0x15')]=router; \ No newline at end of file +var _0x87fa=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','put','update','/:id','destroy','multer','util','connect-timeout','express','fs-extra'];(function(_0x3da1c2,_0x340cef){var _0xd93bbe=function(_0x4e4255){while(--_0x4e4255){_0x3da1c2['push'](_0x3da1c2['shift']());}};_0xd93bbe(++_0x340cef);}(_0x87fa,0x151));var _0xa87f=function(_0x2a5bb0,_0x5988ec){_0x2a5bb0=_0x2a5bb0-0x0;var _0x42748d=_0x87fa[_0x2a5bb0];return _0x42748d;};'use strict';var multer=require(_0xa87f('0x0'));var util=require(_0xa87f('0x1'));var path=require('path');var timeout=require(_0xa87f('0x2'));var express=require(_0xa87f('0x3'));var router=express['Router']();var fs_extra=require(_0xa87f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa87f('0x5'));var config=require(_0xa87f('0x6'));var controller=require('./screenRecording.controller');router[_0xa87f('0x7')]('/',auth[_0xa87f('0x8')](),controller[_0xa87f('0x9')]);router[_0xa87f('0x7')](_0xa87f('0xa'),auth[_0xa87f('0x8')](),controller[_0xa87f('0xb')]);router[_0xa87f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa87f('0x7')](_0xa87f('0xc'),auth['isAuthenticated'](),controller[_0xa87f('0xd')]);router[_0xa87f('0xe')]('/',auth[_0xa87f('0x8')](),controller['create']);router[_0xa87f('0xf')]('/:id',auth[_0xa87f('0x8')](),controller[_0xa87f('0x10')]);router['delete'](_0xa87f('0x11'),auth['isAuthenticated'](),controller[_0xa87f('0x12')]);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 84f7556..87f9951 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 _0x4f7b=['MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format'];(function(_0x43bd2e,_0x20da65){var _0x35c7de=function(_0x57746d){while(--_0x57746d){_0x43bd2e['push'](_0x43bd2e['shift']());}};_0x35c7de(++_0x20da65);}(_0x4f7b,0x13e));var _0xb4f7=function(_0xbfbc51,_0x418c30){_0xbfbc51=_0xbfbc51-0x0;var _0x43a5ac=_0x4f7b[_0xbfbc51];return _0x43a5ac;};'use strict';var Sequelize=require(_0xb4f7('0x0'));var moment=require(_0xb4f7('0x1'));var path=require(_0xb4f7('0x2'));var config=require(_0xb4f7('0x3'));module['exports']={'format':{'type':Sequelize[_0xb4f7('0x4')],'get':function(){return this[_0xb4f7('0x5')](_0xb4f7('0x6'))?path[_0xb4f7('0x7')](this[_0xb4f7('0x5')](_0xb4f7('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb4f7('0x8')]},'channel':{'type':Sequelize[_0xb4f7('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x27872e){var _0x5e7b94=_0x27872e[_0xb4f7('0x9')](/\\/g,'/');this[_0xb4f7('0xa')](_0xb4f7('0x6'),_0x5e7b94);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb4f7('0xb')],'set':function(_0x5af41f){this[_0xb4f7('0xa')](_0xb4f7('0xc'),moment()[_0xb4f7('0xd')](_0x5af41f,'ms'));this['setDataValue'](_0xb4f7('0xe'),moment());this[_0xb4f7('0xa')](_0xb4f7('0xf'),_0x5af41f);}},'startedAt':{'type':Sequelize[_0xb4f7('0x10')],'get':function(){return moment(this[_0xb4f7('0x5')](_0xb4f7('0xc')))[_0xb4f7('0x11')](_0xb4f7('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xb4f7('0x10')],'get':function(){return moment(this[_0xb4f7('0x5')](_0xb4f7('0xe')))[_0xb4f7('0x11')](_0xb4f7('0x12'))[_0xb4f7('0x13')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb4f7('0x5')]('createdAt'))[_0xb4f7('0x11')](_0xb4f7('0x12'))[_0xb4f7('0x13')]();}},'updatedAt':{'type':Sequelize[_0xb4f7('0x10')],'get':function(){return moment(this[_0xb4f7('0x5')](_0xb4f7('0x14')))[_0xb4f7('0x11')](_0xb4f7('0x12'))[_0xb4f7('0x13')]();}}}; \ No newline at end of file +var _0x8710=['moment','../../config/environment','exports','VIRTUAL','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','getDataValue','createdAt','updatedAt','sequelize'];(function(_0x41a59d,_0x3447bd){var _0x53157e=function(_0x523f2d){while(--_0x523f2d){_0x41a59d['push'](_0x41a59d['shift']());}};_0x53157e(++_0x3447bd);}(_0x8710,0x68));var _0x0871=function(_0x36834b,_0x54b2da){_0x36834b=_0x36834b-0x0;var _0x3b0466=_0x8710[_0x36834b];return _0x3b0466;};'use strict';var Sequelize=require(_0x0871('0x0'));var moment=require(_0x0871('0x1'));var path=require('path');var config=require(_0x0871('0x2'));module[_0x0871('0x3')]={'format':{'type':Sequelize[_0x0871('0x4')],'get':function(){return this['getDataValue'](_0x0871('0x5'))?path[_0x0871('0x6')](this['getDataValue'](_0x0871('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0871('0x7')]},'value':{'type':Sequelize[_0x0871('0x7')],'set':function(_0x18b47f){var _0x846dd7=_0x18b47f[_0x0871('0x8')](/\\/g,'/');this[_0x0871('0x9')]('value',_0x846dd7);}},'rating':{'type':Sequelize[_0x0871('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0871('0xa')],'set':function(_0x5e9ef){this[_0x0871('0x9')](_0x0871('0xb'),moment()['subtract'](_0x5e9ef,'ms'));this[_0x0871('0x9')](_0x0871('0xc'),moment());this[_0x0871('0x9')](_0x0871('0xd'),_0x5e9ef);}},'startedAt':{'type':Sequelize[_0x0871('0xe')],'get':function(){return moment(this['getDataValue'](_0x0871('0xb')))[_0x0871('0xf')](_0x0871('0x10'))[_0x0871('0x11')]();}},'closedAt':{'type':Sequelize[_0x0871('0xe')],'get':function(){return moment(this[_0x0871('0x12')](_0x0871('0xc')))[_0x0871('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x0871('0xe')],'get':function(){return moment(this[_0x0871('0x12')](_0x0871('0x13')))[_0x0871('0xf')](_0x0871('0x10'))[_0x0871('0x11')]();}},'updatedAt':{'type':Sequelize[_0x0871('0xe')],'get':function(){return moment(this[_0x0871('0x12')](_0x0871('0x14')))['format'](_0x0871('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index e6e81a4..bf81b8b 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 _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x3e59cb,_0x2eb01d){var _0x3f435e=function(_0x2bdb62){while(--_0x2bdb62){_0x3e59cb['push'](_0x3e59cb['shift']());}};_0x3f435e(++_0x2eb01d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3f20ed,_0x222ff2){_0x3f20ed=_0x3f20ed-0x0;var _0x4c6f76=_0xdc97[_0x3f20ed];return _0x4c6f76;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file +var _0x3e74=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','decryptFile','secrets','server/files/screen_recordings','Sequelize','ValidationError','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','existsSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x5cb142,_0x27c379){var _0x4e4ab8=function(_0x58edb0){while(--_0x58edb0){_0x5cb142['push'](_0x5cb142['shift']());}};_0x4e4ab8(++_0x27c379);}(_0x3e74,0x175));var _0x43e7=function(_0x420049,_0x431f2e){_0x420049=_0x420049-0x0;var _0x338740=_0x3e74[_0x420049];return _0x338740;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_[_0x43e7('0x27')](_0x50f9f5,'name'),[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0xb1fc63[_0x43e7('0x30')]);_0x4690a6[_0x43e7('0x32')]=_['intersection'](_0x4690a6[_0x43e7('0x2d')],_0x4690a6[_0x43e7('0x30')]);_0x33a1a5[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x4690a6['model'],qs['fields'](_0xb1fc63['query'][_0x43e7('0x35')]));_0x33a1a5[_0x43e7('0x33')]=_0x33a1a5[_0x43e7('0x33')][_0x43e7('0x36')]?_0x33a1a5[_0x43e7('0x33')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63['query']['hasOwnProperty']('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5[_0x43e7('0x19')]=qs['offset'](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x19')]);}_0x33a1a5[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x38')]);_0x33a1a5[_0x43e7('0x39')]=qs['filters'](_['pick'](_0xb1fc63['query'],_0x4690a6[_0x43e7('0x32')]),_0x50f9f5);if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x39')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x2ffd43){if(_0x2ffd43['type']!==_0x43e7('0x3c')){var _0x2b0ffe={};_0x2b0ffe[_0x2ffd43['name']]={'$like':'%'+_0xb1fc63[_0x43e7('0x30')]['filter']+'%'};return _0x2b0ffe;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63[_0x43e7('0x3d')]);var _0x1c6f45={'where':_0x33a1a5[_0x43e7('0x39')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x1c6f45)['then'](function(_0x574a93){_0x45b675[_0x43e7('0x1a')]=_0x574a93;if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x33a1a5[_0x43e7('0x3f')]=[{'all':!![]}];}return db[_0x43e7('0x28')]['findAll'](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4227c4){_0x45b675['rows']=_0x4227c4;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x40')]=function(_0x504101,_0x3d81ae){var _0x3b4235={'raw':![],'where':{'id':_0x504101[_0x43e7('0x41')]['id']}},_0x3a5807={};_0x3a5807['model']=_['keys'](db[_0x43e7('0x28')][_0x43e7('0x29')]);_0x3a5807[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x504101['query']);_0x3a5807['filters']=_['intersection'](_0x3a5807[_0x43e7('0x2d')],_0x3a5807['query']);_0x3b4235[_0x43e7('0x33')]=_['intersection'](_0x3a5807['model'],qs[_0x43e7('0x35')](_0x504101['query'][_0x43e7('0x35')]));_0x3b4235[_0x43e7('0x33')]=_0x3b4235[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3b4235['attributes']:_0x3a5807[_0x43e7('0x2d')];if(_0x504101[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x3b4235[_0x43e7('0x3f')]=[{'all':!![]}];}_0x3b4235=_[_0x43e7('0x3b')]({},_0x3b4235,_0x504101[_0x43e7('0x3d')]);return db['ScreenRecording']['find'](_0x3b4235)[_0x43e7('0x21')](handleEntityNotFound(_0x3d81ae,null))[_0x43e7('0x21')](respondWithResult(_0x3d81ae,null))[_0x43e7('0x42')](handleError(_0x3d81ae,null));};exports['create']=function(_0x5c1c18,_0x56489b){return db[_0x43e7('0x28')][_0x43e7('0x43')](_0x5c1c18['body'],{})[_0x43e7('0x21')](respondWithResult(_0x56489b,0xc9))[_0x43e7('0x42')](handleError(_0x56489b,null));};exports[_0x43e7('0x20')]=function(_0x560329,_0x593155){if(_0x560329['body']['id']){delete _0x560329['body']['id'];}delete _0x560329[_0x43e7('0x44')][_0x43e7('0x45')];delete _0x560329['body'][_0x43e7('0x46')];delete _0x560329[_0x43e7('0x44')][_0x43e7('0x47')];delete _0x560329[_0x43e7('0x44')]['value'];return db[_0x43e7('0x28')]['find']({'where':{'id':_0x560329['params']['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x593155,null))[_0x43e7('0x21')](saveUpdates(_0x560329[_0x43e7('0x44')],null))[_0x43e7('0x21')](respondWithResult(_0x593155,null))[_0x43e7('0x42')](handleError(_0x593155,null));};exports[_0x43e7('0x48')]=function(_0x1cd87c,_0x256ddd){return db[_0x43e7('0x28')][_0x43e7('0x48')]()['then'](respondWithResult(_0x256ddd,null))[_0x43e7('0x42')](handleError(_0x256ddd,null));};exports[_0x43e7('0x49')]=function(_0x499c03,_0x39e3ca,_0x4e6f6d){var _0x35b799=require(_0x43e7('0x4a'));var _0x34e2ec=![];var _0x1f561f={};if(_0x499c03[_0x43e7('0x30')]['type']&&_0x499c03['query'][_0x43e7('0x2b')]===_0x43e7('0x4b')){_0x1f561f[_0x43e7('0x4b')]=_0x499c03[_0x43e7('0x41')]['id'];}else{_0x1f561f['id']=_0x499c03[_0x43e7('0x41')]['id'];}return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':_0x1f561f,'attributes':['id',_0x43e7('0x4d')],'raw':!![]})[_0x43e7('0x21')](handleEntityNotFound(_0x39e3ca,null))[_0x43e7('0x21')](function(_0x312306){if(_0x312306){var _0x4ace49=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],'server/files/screen_recordings',_0x312306[_0x43e7('0x4d')]);var _0x220bf2=util[_0x43e7('0x2f')]('%s.cypher',_0x4ace49);if(fs['existsSync'](_0x220bf2)){_0x34e2ec=!![];return _0x35b799[_0x43e7('0x50')](_0x220bf2,_0x4ace49,config[_0x43e7('0x51')]['recording'])[_0x43e7('0x21')](function(){return _0x312306;});}return _0x312306;}})['then'](function(_0x49a6ce){if(_0x49a6ce){var _0x1fa3f6=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],_0x43e7('0x52'),_0x49a6ce[_0x43e7('0x4d')]);if(!fs['existsSync'](_0x1fa3f6)){throw new db[(_0x43e7('0x53'))][(_0x43e7('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x49a6ce[_0x43e7('0x55')]){return _0x39e3ca[_0x43e7('0x49')](_0x1fa3f6,_0x49a6ce[_0x43e7('0x55')]+path['extname'](_0x1fa3f6),function(){if(_0x34e2ec){fs['unlink'](_0x1fa3f6);}});}else{return _0x39e3ca['download'](_0x1fa3f6,function(_0x2ada55){if(_0x34e2ec){fs[_0x43e7('0x56')](_0x1fa3f6);}});}}})[_0x43e7('0x42')](function(_0x3a6404){if(_0x3a6404['message']==='ScreenRecording\x20not\x20found'){_0x39e3ca[_0x43e7('0x1b')](0x194)[_0x43e7('0x25')](_0x43e7('0x57'));}else{return handleError(_0x39e3ca,null);}});};exports[_0x43e7('0x22')]=function(_0x5ea0db,_0x4438c0){return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':{'id':_0x5ea0db[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](function(_0xd41e79){if(_[_0x43e7('0x58')](_0xd41e79)){throw new ReferenceError(_0x43e7('0x59'));}return _0xd41e79;})[_0x43e7('0x21')](function(_0x381208){var _0x252f00=path['join'](config['root'],_0x43e7('0x52'),_0x381208['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x252f00);if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs['existsSync'](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}_0x252f00=_0x252f00+_0x43e7('0x5d');if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs[_0x43e7('0x5e')](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}return _0x381208;})[_0x43e7('0x21')](function(_0x40d0c0){if(!_0x40d0c0)throw new InternalError();return _0x40d0c0[_0x43e7('0x22')]();})['then'](function(){_0x4438c0['status'](0xcc)[_0x43e7('0x15')]();})['catch'](handleError(_0x4438c0,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d334e0e..aafd1fc 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 _0x921f=['define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x921f,0x184));var _0xf921=function(_0x2270b9,_0x228728){_0x2270b9=_0x2270b9-0x0;var _0x532b66=_0x921f[_0x2270b9];return _0x532b66;};'use strict';var _=require(_0xf921('0x0'));var util=require('util');var logger=require(_0xf921('0x1'))(_0xf921('0x2'));var moment=require('moment');var BPromise=require(_0xf921('0x3'));var rp=require(_0xf921('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf921('0x5'));var config=require(_0xf921('0x6'));var attributes=require(_0xf921('0x7'));module['exports']=function(_0x3d9599,_0x10f3cc){return _0x3d9599[_0xf921('0x8')](_0xf921('0x9'),attributes,{'tableName':_0xf921('0xa'),'paranoid':![],'indexes':[{'name':_0xf921('0xb'),'fields':[_0xf921('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e26=['moment','bluebird','path','rimraf','../../config/environment','interactionid','lodash','util','api'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x2e26,0x114));var _0x62e2=function(_0x4d54ec,_0x38c4d5){_0x4d54ec=_0x4d54ec-0x0;var _0x12d301=_0x2e26[_0x4d54ec];return _0x12d301;};'use strict';var _=require(_0x62e2('0x0'));var util=require(_0x62e2('0x1'));var logger=require('../../config/logger')(_0x62e2('0x2'));var moment=require(_0x62e2('0x3'));var BPromise=require(_0x62e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62e2('0x5'));var rimraf=require(_0x62e2('0x6'));var config=require(_0x62e2('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x1ddb9d,_0x4811d8){return _0x1ddb9d['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x62e2('0x8'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8faa499..ab97c4e 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 _0x46e8=['client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x46e8,0x143));var _0x846e=function(_0x31e449,_0x703fce){_0x31e449=_0x31e449-0x0;var _0x2f08e4=_0x46e8[_0x31e449];return _0x2f08e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x846e('0x0'));var BPromise=require(_0x846e('0x1'));var rs=require(_0x846e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x846e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x846e('0x4'));var config=require(_0x846e('0x5'));var jayson=require(_0x846e('0x6'));var client=jayson[_0x846e('0x7')][_0x846e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33b3f8,_0x1ce621,_0x198d49){return new BPromise(function(_0x589375,_0x7a7e9e){return client[_0x846e('0x9')](_0x33b3f8,_0x198d49)[_0x846e('0xa')](function(_0x35a52c){logger['info'](_0x846e('0xb'),_0x1ce621,_0x846e('0xc'));logger[_0x846e('0xd')](_0x846e('0xe'),_0x1ce621,_0x846e('0xc'),JSON[_0x846e('0xf')](_0x35a52c));if(_0x35a52c['error']){if(_0x35a52c[_0x846e('0x10')][_0x846e('0x11')]===0x1f4){logger[_0x846e('0x10')](_0x846e('0xb'),_0x1ce621,_0x35a52c[_0x846e('0x10')][_0x846e('0x12')]);return _0x7a7e9e(_0x35a52c['error'][_0x846e('0x12')]);}logger[_0x846e('0x10')](_0x846e('0xb'),_0x1ce621,_0x35a52c[_0x846e('0x10')]['message']);return _0x589375(_0x35a52c[_0x846e('0x10')]['message']);}else{logger[_0x846e('0x13')](_0x846e('0xb'),_0x1ce621,_0x846e('0xc'));_0x589375(_0x35a52c[_0x846e('0x14')][_0x846e('0x12')]);}})[_0x846e('0x15')](function(_0x21bbc0){logger[_0x846e('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x1ce621,_0x21bbc0);_0x7a7e9e(_0x21bbc0);});});} \ No newline at end of file +var _0x53ab=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3baac6,_0x110fa3){var _0x5afa0c=function(_0x37a7c5){while(--_0x37a7c5){_0x3baac6['push'](_0x3baac6['shift']());}};_0x5afa0c(++_0x110fa3);}(_0x53ab,0x1b4));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb53a('0x0'));var util=require(_0xb53a('0x1'));var moment=require(_0xb53a('0x2'));var BPromise=require(_0xb53a('0x3'));var rs=require(_0xb53a('0x4'));var fs=require('fs');var Redis=require(_0xb53a('0x5'));var db=require(_0xb53a('0x6'))['db'];var utils=require(_0xb53a('0x7'));var logger=require(_0xb53a('0x8'))('rpc');var config=require(_0xb53a('0x9'));var jayson=require(_0xb53a('0xa'));var client=jayson['client'][_0xb53a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d87e7,_0x3e766b,_0x54515b){return new BPromise(function(_0x23b63e,_0x428372){return client['request'](_0x3d87e7,_0x54515b)[_0xb53a('0xc')](function(_0x1e92a1){logger[_0xb53a('0xd')](_0xb53a('0xe'),_0x3e766b,_0xb53a('0xf'));logger[_0xb53a('0x10')](_0xb53a('0x11'),_0x3e766b,'request\x20sent',JSON[_0xb53a('0x12')](_0x1e92a1));if(_0x1e92a1[_0xb53a('0x13')]){if(_0x1e92a1[_0xb53a('0x13')]['code']===0x1f4){logger[_0xb53a('0x13')](_0xb53a('0xe'),_0x3e766b,_0x1e92a1['error']['message']);return _0x428372(_0x1e92a1[_0xb53a('0x13')][_0xb53a('0x14')]);}logger['error'](_0xb53a('0xe'),_0x3e766b,_0x1e92a1[_0xb53a('0x13')][_0xb53a('0x14')]);return _0x23b63e(_0x1e92a1['error'][_0xb53a('0x14')]);}else{logger[_0xb53a('0xd')](_0xb53a('0xe'),_0x3e766b,_0xb53a('0xf'));_0x23b63e(_0x1e92a1[_0xb53a('0x15')][_0xb53a('0x14')]);}})[_0xb53a('0x16')](function(_0x927fde){logger['error'](_0xb53a('0xe'),_0x3e766b,_0x927fde);_0x428372(_0x927fde);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2fc4e22..37cc43f 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 _0xb549=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','post','single','file','addLogo','join','logologin','extname','originalname','addLogoLogin','preferred','addPreferred','addFavicon','put','update','util','path','connect-timeout','express','fs-extra'];(function(_0xbce61,_0x34b3eb){var _0xcbef5f=function(_0x55173f){while(--_0x55173f){_0xbce61['push'](_0xbce61['shift']());}};_0xcbef5f(++_0x34b3eb);}(_0xb549,0x12f));var _0x9b54=function(_0x85fa55,_0x48a1d3){_0x85fa55=_0x85fa55-0x0;var _0x67c1f6=_0xb549[_0x85fa55];return _0x67c1f6;};'use strict';var multer=require('multer');var util=require(_0x9b54('0x0'));var path=require(_0x9b54('0x1'));var timeout=require(_0x9b54('0x2'));var express=require(_0x9b54('0x3'));var router=express['Router']();var fs_extra=require(_0x9b54('0x4'));var auth=require(_0x9b54('0x5'));var interaction=require(_0x9b54('0x6'));var config=require(_0x9b54('0x7'));var controller=require('./setting.controller');router[_0x9b54('0x8')]('/',auth[_0x9b54('0x9')](),controller[_0x9b54('0xa')]);router['get'](_0x9b54('0xb'),controller[_0x9b54('0xc')]);router[_0x9b54('0x8')](_0x9b54('0xd'),controller['show']);router[_0x9b54('0x8')](_0x9b54('0xe'),controller[_0x9b54('0xf')]);router[_0x9b54('0x8')](_0x9b54('0x10'),controller[_0x9b54('0x11')]);router[_0x9b54('0x8')](_0x9b54('0x12'),controller[_0x9b54('0x13')]);router[_0x9b54('0x8')](_0x9b54('0x14'),controller[_0x9b54('0x15')]);router['get'](_0x9b54('0x16'),controller[_0x9b54('0x17')]);var upload=multer({'storage':multer[_0x9b54('0x18')]({'destination':function(_0x101dc8,_0x529f8c,_0xde5bf7){_0xde5bf7(null,path['join'](config[_0x9b54('0x19')],_0x9b54('0x1a')));},'filename':function(_0x19ce07,_0x5d7522,_0x333c1e){_0x333c1e(null,util[_0x9b54('0x1b')](_0x9b54('0x1c'),_0x9b54('0x1d'),path['extname'](_0x5d7522['originalname'])));}})});router[_0x9b54('0x1e')](_0x9b54('0xe'),upload[_0x9b54('0x1f')](_0x9b54('0x20')),controller[_0x9b54('0x21')]);var upload=multer({'storage':multer[_0x9b54('0x18')]({'destination':function(_0x2fecd0,_0x50df11,_0x39432b){_0x39432b(null,path[_0x9b54('0x22')](config['root'],_0x9b54('0x1a')));},'filename':function(_0x5eb388,_0x547ad3,_0x2218c7){_0x2218c7(null,util[_0x9b54('0x1b')](_0x9b54('0x1c'),_0x9b54('0x23'),path[_0x9b54('0x24')](_0x547ad3[_0x9b54('0x25')])));}})});router[_0x9b54('0x1e')]('/:id/logo_login',upload[_0x9b54('0x1f')](_0x9b54('0x20')),controller[_0x9b54('0x26')]);var upload=multer({'storage':multer[_0x9b54('0x18')]({'destination':function(_0x354e57,_0x2cd792,_0x4324f0){_0x4324f0(null,path[_0x9b54('0x22')](config['root'],_0x9b54('0x1a')));},'filename':function(_0x5ac516,_0x2233af,_0x5331a0){_0x5331a0(null,util[_0x9b54('0x1b')](_0x9b54('0x1c'),_0x9b54('0x27'),path[_0x9b54('0x24')](_0x2233af['originalname'])));}})});router['post'](_0x9b54('0x14'),upload['single'](_0x9b54('0x20')),controller[_0x9b54('0x28')]);var upload=multer({'storage':multer[_0x9b54('0x18')]({'destination':function(_0x1d999a,_0x38d2fb,_0x1ffc33){_0x1ffc33(null,path['join'](config['root'],_0x9b54('0x1a')));},'filename':function(_0xa43929,_0x4a232b,_0x53fe6b){_0x53fe6b(null,util['format'](_0x9b54('0x1c'),'favicon',path[_0x9b54('0x24')](_0x4a232b[_0x9b54('0x25')])));}})});router[_0x9b54('0x1e')](_0x9b54('0x16'),upload['single']('file'),controller[_0x9b54('0x29')]);router[_0x9b54('0x2a')](_0x9b54('0xd'),auth[_0x9b54('0x9')](),controller[_0x9b54('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x52ca=['gdpr','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','logologin','file','addLogoLogin','preferred','/:id/preferred','favicon','/:id/favicon','addFavicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr'];(function(_0x55a171,_0x2f5c86){var _0xf019e4=function(_0x5018dc){while(--_0x5018dc){_0x55a171['push'](_0x55a171['shift']());}};_0xf019e4(++_0x2f5c86);}(_0x52ca,0x6d));var _0xa52c=function(_0x1a7069,_0x219121){_0x1a7069=_0x1a7069-0x0;var _0x58b6ce=_0x52ca[_0x1a7069];return _0x58b6ce;};'use strict';var multer=require(_0xa52c('0x0'));var util=require(_0xa52c('0x1'));var path=require(_0xa52c('0x2'));var timeout=require(_0xa52c('0x3'));var express=require(_0xa52c('0x4'));var router=express[_0xa52c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa52c('0x6'));var controller=require(_0xa52c('0x7'));router[_0xa52c('0x8')]('/',auth[_0xa52c('0x9')](),controller['index']);router[_0xa52c('0x8')](_0xa52c('0xa'),controller[_0xa52c('0xb')]);router[_0xa52c('0x8')]('/:id',controller['show']);router['get'](_0xa52c('0xc'),controller[_0xa52c('0xd')]);router[_0xa52c('0x8')](_0xa52c('0xe'),controller[_0xa52c('0xf')]);router[_0xa52c('0x8')](_0xa52c('0x10'),controller[_0xa52c('0x11')]);router[_0xa52c('0x8')]('/:id/preferred',controller[_0xa52c('0x12')]);router[_0xa52c('0x8')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0xa52c('0x13')]({'destination':function(_0xf0b510,_0x17974e,_0x109ce8){_0x109ce8(null,path[_0xa52c('0x14')](config[_0xa52c('0x15')],_0xa52c('0x16')));},'filename':function(_0x45f18d,_0x194b53,_0x5c133b){_0x5c133b(null,util[_0xa52c('0x17')](_0xa52c('0x18'),_0xa52c('0x19'),path[_0xa52c('0x1a')](_0x194b53[_0xa52c('0x1b')])));}})});router[_0xa52c('0x1c')]('/:id/logo',upload[_0xa52c('0x1d')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37b89d,_0x16c741,_0x74b48c){_0x74b48c(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x3dad52,_0x146b5c,_0x14d715){_0x14d715(null,util[_0xa52c('0x17')](_0xa52c('0x18'),_0xa52c('0x1e'),path[_0xa52c('0x1a')](_0x146b5c[_0xa52c('0x1b')])));}})});router[_0xa52c('0x1c')]('/:id/logo_login',upload[_0xa52c('0x1d')](_0xa52c('0x1f')),controller[_0xa52c('0x20')]);var upload=multer({'storage':multer[_0xa52c('0x13')]({'destination':function(_0x53937e,_0x2a32ef,_0x2eb852){_0x2eb852(null,path['join'](config[_0xa52c('0x15')],_0xa52c('0x16')));},'filename':function(_0x66b673,_0x4bd93b,_0x198307){_0x198307(null,util[_0xa52c('0x17')](_0xa52c('0x18'),_0xa52c('0x21'),path['extname'](_0x4bd93b[_0xa52c('0x1b')])));}})});router['post'](_0xa52c('0x22'),upload[_0xa52c('0x1d')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xa52c('0x13')]({'destination':function(_0x2881ae,_0x5d4492,_0x242155){_0x242155(null,path[_0xa52c('0x14')](config[_0xa52c('0x15')],_0xa52c('0x16')));},'filename':function(_0x19a34e,_0x353bfa,_0x2f6429){_0x2f6429(null,util[_0xa52c('0x17')]('%s%s',_0xa52c('0x23'),path[_0xa52c('0x1a')](_0x353bfa[_0xa52c('0x1b')])));}})});router[_0xa52c('0x1c')](_0xa52c('0x24'),upload[_0xa52c('0x1d')](_0xa52c('0x1f')),controller[_0xa52c('0x25')]);router[_0xa52c('0x26')](_0xa52c('0x27'),auth[_0xa52c('0x9')](),controller[_0xa52c('0x28')]);module[_0xa52c('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 6116ba4..876cff8 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(_0x48b641,_0x222c4b){var _0x45a63b=function(_0x49d174){while(--_0x49d174){_0x48b641['push'](_0x48b641['shift']());}};_0x45a63b(++_0x222c4b);}(_0x7a54,0x106));var _0x47a5=function(_0x9575d1,_0x4600bb){_0x9575d1=_0x9575d1-0x0;var _0x52be59=_0x7a54[_0x9575d1];return _0x52be59;};'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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdb28,0x106));var _0x8db2=function(_0x294969,_0x93bb49){_0x294969=_0x294969-0x0;var _0x4975fe=_0xdb28[_0x294969];return _0x4975fe;};'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 f8bf194..4b27afd 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 _0xfdc5=['keys','merge','update','body','find','file','logo','filename','addLogoLogin','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultLoginLogo','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','download','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../mysqldb','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','limit','count','Content-Range','apply','reject','save','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params'];(function(_0x28ccd4,_0x83c4c){var _0x220be4=function(_0x2669db){while(--_0x2669db){_0x28ccd4['push'](_0x28ccd4['shift']());}};_0x220be4(++_0x83c4c);}(_0xfdc5,0xa8));var _0x5fdc=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xfdc5[_0x4bc65f];return _0x44f85f;};'use strict';var emlformat=require(_0x5fdc('0x0'));var rimraf=require(_0x5fdc('0x1'));var zipdir=require(_0x5fdc('0x2'));var jsonpatch=require(_0x5fdc('0x3'));var rp=require(_0x5fdc('0x4'));var moment=require(_0x5fdc('0x5'));var BPromise=require(_0x5fdc('0x6'));var Mustache=require('mustache');var util=require(_0x5fdc('0x7'));var path=require('path');var sox=require(_0x5fdc('0x8'));var csv=require(_0x5fdc('0x9'));var ejs=require(_0x5fdc('0xa'));var fs=require('fs');var fs_extra=require(_0x5fdc('0xb'));var _=require(_0x5fdc('0xc'));var squel=require(_0x5fdc('0xd'));var crypto=require(_0x5fdc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5fdc('0xf'));var toCsv=require(_0x5fdc('0x9'));var querystring=require(_0x5fdc('0x10'));var Papa=require(_0x5fdc('0x11'));var Redis=require(_0x5fdc('0x12'));var authService=require(_0x5fdc('0x13'));var qs=require(_0x5fdc('0x14'));var as=require(_0x5fdc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fdc('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5fdc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fdc('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5fdc('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58ce74,_0x22d93d,_0x338412,_0x10da90){return new BPromise(function(_0x185901,_0x5aa2dd){var _0x19ed02=_0x10da90||client;return _0x19ed02[_0x5fdc('0x1a')](_0x58ce74,_0x338412)[_0x5fdc('0x1b')](function(_0x1f98df){logger[_0x5fdc('0x1c')](_0x5fdc('0x1d'),_0x22d93d,_0x5fdc('0x1e'));logger[_0x5fdc('0x1f')](_0x5fdc('0x20'),_0x22d93d,'request\x20sent',JSON[_0x5fdc('0x21')](_0x1f98df));if(_0x1f98df[_0x5fdc('0x22')]){if(_0x1f98df[_0x5fdc('0x22')][_0x5fdc('0x23')]===0x1f4){logger[_0x5fdc('0x22')](_0x5fdc('0x1d'),_0x22d93d,_0x1f98df[_0x5fdc('0x22')][_0x5fdc('0x24')]);return _0x5aa2dd(_0x1f98df[_0x5fdc('0x22')][_0x5fdc('0x24')]);}logger[_0x5fdc('0x22')](_0x5fdc('0x1d'),_0x22d93d,_0x1f98df[_0x5fdc('0x22')][_0x5fdc('0x24')]);return _0x185901(_0x1f98df[_0x5fdc('0x22')][_0x5fdc('0x24')]);}else{logger[_0x5fdc('0x1c')](_0x5fdc('0x1d'),_0x22d93d,_0x5fdc('0x1e'));_0x185901(_0x1f98df[_0x5fdc('0x25')]['message']);}})[_0x5fdc('0x26')](function(_0x436498){logger[_0x5fdc('0x22')]('Setting,\x20%s,\x20%s',_0x22d93d,_0x436498);_0x5aa2dd(_0x436498);});});}function respondWithStatusCode(_0x21ca1e,_0x1eb793){_0x1eb793=_0x1eb793||0xcc;return function(_0x88f48){if(_0x88f48){return _0x21ca1e[_0x5fdc('0x27')](_0x1eb793);}return _0x21ca1e[_0x5fdc('0x28')](_0x1eb793)['end']();};}function respondWithResult(_0x247755,_0x2e7c84){_0x2e7c84=_0x2e7c84||0xc8;return function(_0x4bb882){if(_0x4bb882){return _0x247755['status'](_0x2e7c84)[_0x5fdc('0x29')](_0x4bb882);}};}function respondWithFilteredResult(_0x24aea2,_0x44b856){return function(_0x25ea49){if(_0x25ea49){var _0x491a1c=typeof _0x44b856['offset']==='undefined'&&typeof _0x44b856[_0x5fdc('0x2a')]==='undefined';var _0xc31c71=_0x25ea49['count'];var _0x5eee24=_0x491a1c?0x0:_0x44b856['offset'];var _0x411b11=_0x491a1c?_0x25ea49[_0x5fdc('0x2b')]:_0x44b856['offset']+_0x44b856[_0x5fdc('0x2a')];var _0x2e8f1c;if(_0x411b11>=_0xc31c71){_0x411b11=_0xc31c71;_0x2e8f1c=0xc8;}else{_0x2e8f1c=0xce;}_0x24aea2['status'](_0x2e8f1c);return _0x24aea2['set'](_0x5fdc('0x2c'),_0x5eee24+'-'+_0x411b11+'/'+_0xc31c71)[_0x5fdc('0x29')](_0x25ea49);}return null;};}function patchUpdates(_0x389375){return function(_0x1bfc19){try{jsonpatch[_0x5fdc('0x2d')](_0x1bfc19,_0x389375,!![]);}catch(_0x152110){return BPromise[_0x5fdc('0x2e')](_0x152110);}return _0x1bfc19[_0x5fdc('0x2f')]();};}function saveUpdates(_0x58876d,_0x32cea0){return function(_0x287580){if(_0x287580){return _0x287580['update'](_0x58876d)['then'](function(_0x4dd641){return _0x4dd641;});}return null;};}function removeEntity(_0x72cca6,_0x37bd5c){return function(_0x2c4a0e){if(_0x2c4a0e){return _0x2c4a0e[_0x5fdc('0x30')]()[_0x5fdc('0x1b')](function(){_0x72cca6[_0x5fdc('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275667,_0x36bee0){return function(_0x5e5873){if(!_0x5e5873){_0x275667[_0x5fdc('0x27')](0x194);}return _0x5e5873;};}function handleError(_0xdb2e43,_0x3a1350){_0x3a1350=_0x3a1350||0x1f4;return function(_0x34f72e){logger[_0x5fdc('0x22')](_0x34f72e[_0x5fdc('0x31')]);if(_0x34f72e[_0x5fdc('0x32')]){delete _0x34f72e['name'];}_0xdb2e43['status'](_0x3a1350)['send'](_0x34f72e);};}exports[_0x5fdc('0x33')]=function(_0x3face8,_0x2d7c88){var _0xc3998={},_0x28eef9={},_0x24a52e={'count':0x0,'rows':[]};var _0xf8a43f=_[_0x5fdc('0x34')](db[_0x5fdc('0x35')][_0x5fdc('0x36')],function(_0x38169f){return{'name':_0x38169f[_0x5fdc('0x37')],'type':_0x38169f[_0x5fdc('0x38')][_0x5fdc('0x39')]};});_0x28eef9['model']=_[_0x5fdc('0x34')](_0xf8a43f,'name');_0x28eef9['query']=_['keys'](_0x3face8[_0x5fdc('0x3a')]);_0x28eef9[_0x5fdc('0x3b')]=_[_0x5fdc('0x3c')](_0x28eef9[_0x5fdc('0x3d')],_0x28eef9[_0x5fdc('0x3a')]);_0xc3998[_0x5fdc('0x3e')]=_[_0x5fdc('0x3c')](_0x28eef9[_0x5fdc('0x3d')],qs[_0x5fdc('0x3f')](_0x3face8[_0x5fdc('0x3a')][_0x5fdc('0x3f')]));_0xc3998[_0x5fdc('0x3e')]=_0xc3998[_0x5fdc('0x3e')][_0x5fdc('0x40')]?_0xc3998[_0x5fdc('0x3e')]:_0x28eef9[_0x5fdc('0x3d')];if(!_0x3face8[_0x5fdc('0x3a')][_0x5fdc('0x41')](_0x5fdc('0x42'))){_0xc3998['limit']=qs['limit'](_0x3face8[_0x5fdc('0x3a')][_0x5fdc('0x2a')]);_0xc3998[_0x5fdc('0x43')]=qs[_0x5fdc('0x43')](_0x3face8['query'][_0x5fdc('0x43')]);}_0xc3998[_0x5fdc('0x44')]=qs[_0x5fdc('0x45')](_0x3face8['query'][_0x5fdc('0x45')]);_0xc3998[_0x5fdc('0x46')]=qs[_0x5fdc('0x3b')](_[_0x5fdc('0x47')](_0x3face8['query'],_0x28eef9['filters']),_0xf8a43f);if(_0x3face8[_0x5fdc('0x3a')][_0x5fdc('0x48')]){_0xc3998[_0x5fdc('0x46')]=_['merge'](_0xc3998[_0x5fdc('0x46')],{'$or':_[_0x5fdc('0x34')](_0xf8a43f,function(_0x48ac12){if(_0x48ac12['type']!=='VIRTUAL'){var _0x172e12={};_0x172e12[_0x48ac12[_0x5fdc('0x32')]]={'$like':'%'+_0x3face8['query'][_0x5fdc('0x48')]+'%'};return _0x172e12;}})});}_0xc3998=_['merge']({},_0xc3998,_0x3face8[_0x5fdc('0x49')]);var _0x5bdbe7={'where':_0xc3998[_0x5fdc('0x46')]};return db['Setting'][_0x5fdc('0x2b')](_0x5bdbe7)[_0x5fdc('0x1b')](function(_0x4fe5ca){_0x24a52e['count']=_0x4fe5ca;if(_0x3face8[_0x5fdc('0x3a')][_0x5fdc('0x4a')]){_0xc3998[_0x5fdc('0x4b')]=[{'all':!![]}];}return db[_0x5fdc('0x35')][_0x5fdc('0x4c')](_0xc3998);})[_0x5fdc('0x1b')](function(_0xc78cc6){_0x24a52e[_0x5fdc('0x4d')]=_0xc78cc6;return _0x24a52e;})[_0x5fdc('0x1b')](respondWithFilteredResult(_0x2d7c88,_0xc3998))[_0x5fdc('0x26')](handleError(_0x2d7c88,null));};exports[_0x5fdc('0x4e')]=function(_0x273545,_0x626bb){var _0x9c18eb={'raw':![],'where':{'id':_0x273545[_0x5fdc('0x4f')]['id']}},_0x2111f2={};_0x2111f2['model']=_[_0x5fdc('0x50')](db[_0x5fdc('0x35')][_0x5fdc('0x36')]);_0x2111f2[_0x5fdc('0x3a')]=_[_0x5fdc('0x50')](_0x273545[_0x5fdc('0x3a')]);_0x2111f2[_0x5fdc('0x3b')]=_[_0x5fdc('0x3c')](_0x2111f2[_0x5fdc('0x3d')],_0x2111f2['query']);_0x9c18eb[_0x5fdc('0x3e')]=_[_0x5fdc('0x3c')](_0x2111f2[_0x5fdc('0x3d')],qs[_0x5fdc('0x3f')](_0x273545[_0x5fdc('0x3a')][_0x5fdc('0x3f')]));_0x9c18eb[_0x5fdc('0x3e')]=_0x9c18eb[_0x5fdc('0x3e')][_0x5fdc('0x40')]?_0x9c18eb[_0x5fdc('0x3e')]:_0x2111f2[_0x5fdc('0x3d')];if(_0x273545[_0x5fdc('0x3a')][_0x5fdc('0x4a')]){_0x9c18eb['include']=[{'all':!![]}];}_0x9c18eb=_[_0x5fdc('0x51')]({},_0x9c18eb,_0x273545[_0x5fdc('0x49')]);return db['Setting']['find'](_0x9c18eb)[_0x5fdc('0x1b')](handleEntityNotFound(_0x626bb,null))[_0x5fdc('0x1b')](respondWithResult(_0x626bb,null))[_0x5fdc('0x26')](handleError(_0x626bb,null));};exports[_0x5fdc('0x52')]=function(_0x508fde,_0x478455){if(_0x508fde[_0x5fdc('0x53')]['id']){delete _0x508fde[_0x5fdc('0x53')]['id'];}return db[_0x5fdc('0x35')][_0x5fdc('0x54')]({'where':{'id':_0x508fde['params']['id']}})['then'](handleEntityNotFound(_0x478455,null))[_0x5fdc('0x1b')](saveUpdates(_0x508fde[_0x5fdc('0x53')],null))[_0x5fdc('0x1b')](respondWithResult(_0x478455,null))['catch'](handleError(_0x478455,null));};exports['addLogo']=function(_0x21157e,_0x44611c,_0x424054){if(_0x21157e[_0x5fdc('0x55')]&&_0x21157e['file']['filename']){_0x21157e[_0x5fdc('0x53')][_0x5fdc('0x56')]=_0x21157e[_0x5fdc('0x55')][_0x5fdc('0x57')];}return db[_0x5fdc('0x35')][_0x5fdc('0x54')]({'where':{'id':_0x21157e[_0x5fdc('0x4f')]['id']}})[_0x5fdc('0x1b')](handleEntityNotFound(_0x44611c,null))[_0x5fdc('0x1b')](saveUpdates(_0x21157e[_0x5fdc('0x53')],null))[_0x5fdc('0x1b')](respondWithResult(_0x44611c,null))['catch'](handleError(_0x44611c,null));};exports[_0x5fdc('0x58')]=function(_0x4fb04a,_0x4a1f71,_0x419582){if(_0x4fb04a['file']&&_0x4fb04a[_0x5fdc('0x55')][_0x5fdc('0x57')]){_0x4fb04a[_0x5fdc('0x53')]['loginLogo']=_0x4fb04a[_0x5fdc('0x55')][_0x5fdc('0x57')];}return db['Setting'][_0x5fdc('0x54')]({'where':{'id':_0x4fb04a['params']['id']}})[_0x5fdc('0x1b')](handleEntityNotFound(_0x4a1f71,null))[_0x5fdc('0x1b')](saveUpdates(_0x4fb04a[_0x5fdc('0x53')],null))[_0x5fdc('0x1b')](respondWithResult(_0x4a1f71,null))[_0x5fdc('0x26')](handleError(_0x4a1f71,null));};var utilLicense=require(_0x5fdc('0x59'));exports['getLogo']=function(_0x19f341,_0x36bffb,_0x32f0e9){var _0x5bee40=_0x5fdc('0x5a');var _0x12d431={'custom':![]};return utilLicense[_0x5fdc('0x5b')]()[_0x5fdc('0x1b')](function(_0x213874){if(_0x213874){_0x12d431=_0x213874;}return db['Setting'][_0x5fdc('0x54')]({'where':{'id':_0x19f341[_0x5fdc('0x4f')]['id']},'attributes':[_0x5fdc('0x56'),_0x5fdc('0x5c'),_0x5fdc('0x5d'),_0x5fdc('0x5e'),_0x5fdc('0x5f'),'defaultLoginLogo',_0x5fdc('0x60'),_0x5fdc('0x61')],'raw':!![]});})[_0x5fdc('0x1b')](handleEntityNotFound(_0x36bffb,null))['then'](function(_0x53bc0e){if(_0x53bc0e){var _0x1f1852=_0x53bc0e[_0x5fdc('0x56')]&&fs[_0x5fdc('0x62')](path['join'](config[_0x5fdc('0x63')],_0x5bee40,_[_0x5fdc('0x64')](_0x53bc0e[_0x5fdc('0x56')])))?path[_0x5fdc('0x65')](config['root'],_0x5bee40,_[_0x5fdc('0x64')](_0x53bc0e[_0x5fdc('0x56')])):path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x5bee40,_[_0x5fdc('0x64')](_0x5fdc('0x66')));var _0x4c3d00=_0x5fdc('0x67')+_[_0x5fdc('0x68')](_0x5fdc('0x56'));if(_0x53bc0e[_0x4c3d00]||!_0x12d431[_0x5fdc('0x69')]){_0x1f1852=path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x5bee40,_['toLower'](_0x5fdc('0x66')));}if(!fs[_0x5fdc('0x62')](_0x1f1852)){throw new db[(_0x5fdc('0x6a'))][(_0x5fdc('0x6b'))](_['upperFirst'](_0x5fdc('0x56'))+_0x5fdc('0x6c'));}return _0x36bffb['download'](_0x1f1852);}})[_0x5fdc('0x26')](handleError(_0x36bffb,null));};var utilLicense=require('../../config/license/util');exports[_0x5fdc('0x6d')]=function(_0x32d22d,_0x4ecfdc,_0x3af181){var _0x17f9f0=_0x5fdc('0x5a');var _0xdc305d={'custom':![]};return utilLicense[_0x5fdc('0x5b')]()[_0x5fdc('0x1b')](function(_0x1a8df1){if(_0x1a8df1){_0xdc305d=_0x1a8df1;}return db[_0x5fdc('0x35')][_0x5fdc('0x54')]({'where':{'id':_0x32d22d[_0x5fdc('0x4f')]['id']},'attributes':[_0x5fdc('0x56'),_0x5fdc('0x5c'),_0x5fdc('0x5d'),'favicon',_0x5fdc('0x5f'),_0x5fdc('0x6e'),_0x5fdc('0x60'),'defaultFavicon'],'raw':!![]});})[_0x5fdc('0x1b')](handleEntityNotFound(_0x4ecfdc,null))[_0x5fdc('0x1b')](function(_0x5c677f){if(_0x5c677f){var _0x3f70d2=_0x5c677f[_0x5fdc('0x5c')]&&fs[_0x5fdc('0x62')](path['join'](config[_0x5fdc('0x63')],_0x17f9f0,_[_0x5fdc('0x64')](_0x5c677f[_0x5fdc('0x5c')])))?path['join'](config[_0x5fdc('0x63')],_0x17f9f0,_['toLower'](_0x5c677f['loginLogo'])):path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x17f9f0,_[_0x5fdc('0x64')]('default_loginLogo.svg'));var _0x4e9d71=_0x5fdc('0x67')+_['upperFirst'](_0x5fdc('0x5c'));if(_0x5c677f[_0x4e9d71]||!_0xdc305d['custom']){_0x3f70d2=path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x17f9f0,_[_0x5fdc('0x64')](_0x5fdc('0x6f')));}if(!fs[_0x5fdc('0x62')](_0x3f70d2)){throw new db[(_0x5fdc('0x6a'))]['ValidationError'](_[_0x5fdc('0x68')](_0x5fdc('0x5c'))+_0x5fdc('0x6c'));}return _0x4ecfdc['download'](_0x3f70d2);}})[_0x5fdc('0x26')](handleError(_0x4ecfdc,null));};exports[_0x5fdc('0x70')]=function(_0x340504,_0x5b9584){return db[_0x5fdc('0x35')][_0x5fdc('0x54')]({'where':{'id':_0x340504[_0x5fdc('0x4f')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5b9584,null))[_0x5fdc('0x26')](handleError(_0x5b9584,null));};exports[_0x5fdc('0x71')]=function(_0x2db696,_0x1411e3,_0x5a27e6){if(_0x2db696['file']&&_0x2db696['file'][_0x5fdc('0x57')]){_0x2db696[_0x5fdc('0x53')][_0x5fdc('0x5d')]=_0x2db696[_0x5fdc('0x55')][_0x5fdc('0x57')];}return db[_0x5fdc('0x35')]['find']({'where':{'id':_0x2db696[_0x5fdc('0x4f')]['id']}})[_0x5fdc('0x1b')](handleEntityNotFound(_0x1411e3,null))[_0x5fdc('0x1b')](saveUpdates(_0x2db696[_0x5fdc('0x53')],null))[_0x5fdc('0x1b')](respondWithResult(_0x1411e3,null))['catch'](handleError(_0x1411e3,null));};var utilLicense=require('../../config/license/util');exports[_0x5fdc('0x72')]=function(_0xb73ef2,_0xd33931,_0x58d9cc){var _0x2a117e=_0x5fdc('0x5a');var _0x2b1cba={'custom':![]};return utilLicense['getLicense']()[_0x5fdc('0x1b')](function(_0xb49659){if(_0xb49659){_0x2b1cba=_0xb49659;}return db[_0x5fdc('0x35')]['find']({'where':{'id':_0xb73ef2['params']['id']},'attributes':[_0x5fdc('0x56'),'loginLogo','preferred',_0x5fdc('0x5e'),_0x5fdc('0x5f'),'defaultLoginLogo','defaultPreferred',_0x5fdc('0x61')],'raw':!![]});})[_0x5fdc('0x1b')](handleEntityNotFound(_0xd33931,null))[_0x5fdc('0x1b')](function(_0x445f5f){if(_0x445f5f){var _0x47f2ff=_0x445f5f[_0x5fdc('0x5d')]&&fs[_0x5fdc('0x62')](path[_0x5fdc('0x65')](config['root'],_0x2a117e,_['toLower'](_0x445f5f[_0x5fdc('0x5d')])))?path[_0x5fdc('0x65')](config['root'],_0x2a117e,_['toLower'](_0x445f5f[_0x5fdc('0x5d')])):path['join'](config[_0x5fdc('0x63')],_0x2a117e,_[_0x5fdc('0x64')]('default_preferred.png'));var _0x10b31f=_0x5fdc('0x67')+_[_0x5fdc('0x68')](_0x5fdc('0x5d'));if(_0x445f5f[_0x10b31f]||!_0x2b1cba[_0x5fdc('0x69')]||!_0x2b1cba[_0x5fdc('0x5d')]){_0x47f2ff=path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x2a117e,_[_0x5fdc('0x64')](_0x5fdc('0x73')));}if(!fs[_0x5fdc('0x62')](_0x47f2ff)){throw new db[(_0x5fdc('0x6a'))][(_0x5fdc('0x6b'))](_[_0x5fdc('0x68')](_0x5fdc('0x5d'))+'\x20not\x20found');}return _0xd33931[_0x5fdc('0x74')](_0x47f2ff);}})[_0x5fdc('0x26')](handleError(_0xd33931,null));};exports[_0x5fdc('0x75')]=function(_0x2d50ec,_0xfb9444,_0x92979d){if(_0x2d50ec[_0x5fdc('0x55')]&&_0x2d50ec[_0x5fdc('0x55')][_0x5fdc('0x57')]){_0x2d50ec[_0x5fdc('0x53')][_0x5fdc('0x5e')]=_0x2d50ec[_0x5fdc('0x55')][_0x5fdc('0x57')];}return db['Setting'][_0x5fdc('0x54')]({'where':{'id':_0x2d50ec['params']['id']}})['then'](handleEntityNotFound(_0xfb9444,null))[_0x5fdc('0x1b')](saveUpdates(_0x2d50ec[_0x5fdc('0x53')],null))[_0x5fdc('0x1b')](respondWithResult(_0xfb9444,null))['catch'](handleError(_0xfb9444,null));};var utilLicense=require(_0x5fdc('0x59'));exports['getFavicon']=function(_0x746c42,_0x1ae480,_0x4ba49c){var _0x271a84=_0x5fdc('0x5a');var _0x406b3a={'custom':![]};return utilLicense[_0x5fdc('0x5b')]()['then'](function(_0x3a946d){if(_0x3a946d){_0x406b3a=_0x3a946d;}return db['Setting']['find']({'where':{'id':_0x746c42['params']['id']},'attributes':[_0x5fdc('0x56'),'loginLogo',_0x5fdc('0x5d'),_0x5fdc('0x5e'),_0x5fdc('0x5f'),_0x5fdc('0x6e'),'defaultPreferred',_0x5fdc('0x61')],'raw':!![]});})[_0x5fdc('0x1b')](handleEntityNotFound(_0x1ae480,null))[_0x5fdc('0x1b')](function(_0x483352){if(_0x483352){var _0x37c7dd=_0x483352[_0x5fdc('0x5e')]&&fs[_0x5fdc('0x62')](path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x271a84,_[_0x5fdc('0x64')](_0x483352[_0x5fdc('0x5e')])))?path[_0x5fdc('0x65')](config[_0x5fdc('0x63')],_0x271a84,_[_0x5fdc('0x64')](_0x483352[_0x5fdc('0x5e')])):path[_0x5fdc('0x65')](config['root'],_0x271a84,_[_0x5fdc('0x64')](_0x5fdc('0x76')));var _0x3a198e='default'+_[_0x5fdc('0x68')](_0x5fdc('0x5e'));if(_0x483352[_0x3a198e]||!_0x406b3a['custom']){_0x37c7dd=path['join'](config['root'],_0x271a84,_[_0x5fdc('0x64')](_0x5fdc('0x76')));}if(!fs[_0x5fdc('0x62')](_0x37c7dd)){throw new db[(_0x5fdc('0x6a'))][(_0x5fdc('0x6b'))](_[_0x5fdc('0x68')]('favicon')+'\x20not\x20found');}return _0x1ae480['download'](_0x37c7dd);}})['catch'](handleError(_0x1ae480,null));};exports[_0x5fdc('0x77')]=function(_0x167af2,_0x11bef1){var _0x43e30f={'offset':moment()[_0x5fdc('0x78')]()};_0x43e30f[_0x5fdc('0x79')]=moment()[_0x5fdc('0x78')](_0x43e30f[_0x5fdc('0x43')])[_0x5fdc('0x7a')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x11bef1[_0x5fdc('0x28')](0xc8)[_0x5fdc('0x7b')](_0x43e30f);}; \ No newline at end of file +var _0xef01=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','destroy','stack','name','send','index','map','Setting','fieldName','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','rows','show','fields','body','find','params','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','join','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','request-promise','moment','mustache','util'];(function(_0x104775,_0x2626f2){var _0x1e4868=function(_0x191763){while(--_0x191763){_0x104775['push'](_0x104775['shift']());}};_0x1e4868(++_0x2626f2);}(_0xef01,0x1d8));var _0x1ef0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xef01[_0x4565bf];return _0x5610ba;};'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(_0x1ef0('0x0'));var moment=require(_0x1ef0('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1ef0('0x2'));var util=require(_0x1ef0('0x3'));var path=require(_0x1ef0('0x4'));var sox=require(_0x1ef0('0x5'));var csv=require(_0x1ef0('0x6'));var ejs=require(_0x1ef0('0x7'));var fs=require('fs');var fs_extra=require(_0x1ef0('0x8'));var _=require(_0x1ef0('0x9'));var squel=require(_0x1ef0('0xa'));var crypto=require(_0x1ef0('0xb'));var jsforce=require(_0x1ef0('0xc'));var deskjs=require(_0x1ef0('0xd'));var toCsv=require(_0x1ef0('0x6'));var querystring=require(_0x1ef0('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ef0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ef0('0x10'));var hardwareService=require(_0x1ef0('0x11'));var logger=require(_0x1ef0('0x12'))(_0x1ef0('0x13'));var utils=require(_0x1ef0('0x14'));var config=require(_0x1ef0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ef0('0x16'))['db'];var jayson=require(_0x1ef0('0x17'));var client=jayson[_0x1ef0('0x18')][_0x1ef0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x32453c,_0x40cd95,_0x28b67e,_0xbf472){return new BPromise(function(_0x47a2ad,_0x3aa437){var _0x3bd93e=_0xbf472||client;return _0x3bd93e[_0x1ef0('0x1a')](_0x32453c,_0x28b67e)[_0x1ef0('0x1b')](function(_0x393a6e){logger['info']('Setting,\x20%s,\x20%s',_0x40cd95,'request\x20sent');logger['debug'](_0x1ef0('0x1c'),_0x40cd95,_0x1ef0('0x1d'),JSON[_0x1ef0('0x1e')](_0x393a6e));if(_0x393a6e[_0x1ef0('0x1f')]){if(_0x393a6e[_0x1ef0('0x1f')]['code']===0x1f4){logger['error'](_0x1ef0('0x20'),_0x40cd95,_0x393a6e[_0x1ef0('0x1f')][_0x1ef0('0x21')]);return _0x3aa437(_0x393a6e[_0x1ef0('0x1f')]['message']);}logger[_0x1ef0('0x1f')](_0x1ef0('0x20'),_0x40cd95,_0x393a6e[_0x1ef0('0x1f')][_0x1ef0('0x21')]);return _0x47a2ad(_0x393a6e[_0x1ef0('0x1f')][_0x1ef0('0x21')]);}else{logger['info'](_0x1ef0('0x20'),_0x40cd95,'request\x20sent');_0x47a2ad(_0x393a6e[_0x1ef0('0x22')][_0x1ef0('0x21')]);}})[_0x1ef0('0x23')](function(_0x563901){logger[_0x1ef0('0x1f')](_0x1ef0('0x20'),_0x40cd95,_0x563901);_0x3aa437(_0x563901);});});}function respondWithStatusCode(_0x34f42a,_0x193704){_0x193704=_0x193704||0xcc;return function(_0x36584c){if(_0x36584c){return _0x34f42a[_0x1ef0('0x24')](_0x193704);}return _0x34f42a[_0x1ef0('0x25')](_0x193704)[_0x1ef0('0x26')]();};}function respondWithResult(_0x54b65d,_0x45364c){_0x45364c=_0x45364c||0xc8;return function(_0x2c141f){if(_0x2c141f){return _0x54b65d[_0x1ef0('0x25')](_0x45364c)[_0x1ef0('0x27')](_0x2c141f);}};}function respondWithFilteredResult(_0x1fc022,_0x165006){return function(_0x5df503){if(_0x5df503){var _0x1829d3=typeof _0x165006[_0x1ef0('0x28')]==='undefined'&&typeof _0x165006[_0x1ef0('0x29')]===_0x1ef0('0x2a');var _0x3f1e33=_0x5df503['count'];var _0x32cd6f=_0x1829d3?0x0:_0x165006[_0x1ef0('0x28')];var _0x5a21a2=_0x1829d3?_0x5df503['count']:_0x165006[_0x1ef0('0x28')]+_0x165006[_0x1ef0('0x29')];var _0x554bce;if(_0x5a21a2>=_0x3f1e33){_0x5a21a2=_0x3f1e33;_0x554bce=0xc8;}else{_0x554bce=0xce;}_0x1fc022[_0x1ef0('0x25')](_0x554bce);return _0x1fc022[_0x1ef0('0x2b')](_0x1ef0('0x2c'),_0x32cd6f+'-'+_0x5a21a2+'/'+_0x3f1e33)['json'](_0x5df503);}return null;};}function patchUpdates(_0x59cb77){return function(_0x1d2cdb){try{jsonpatch['apply'](_0x1d2cdb,_0x59cb77,!![]);}catch(_0x24bb3f){return BPromise['reject'](_0x24bb3f);}return _0x1d2cdb['save']();};}function saveUpdates(_0x1d7e6a,_0x2f92f6){return function(_0x156c3b){if(_0x156c3b){return _0x156c3b[_0x1ef0('0x2d')](_0x1d7e6a)['then'](function(_0x134326){return _0x134326;});}return null;};}function removeEntity(_0x8e1d9c,_0x51cf99){return function(_0x5c69dc){if(_0x5c69dc){return _0x5c69dc[_0x1ef0('0x2e')]()[_0x1ef0('0x1b')](function(){_0x8e1d9c[_0x1ef0('0x25')](0xcc)[_0x1ef0('0x26')]();});}};}function handleEntityNotFound(_0x559ab1,_0x522cf4){return function(_0x55dab8){if(!_0x55dab8){_0x559ab1['sendStatus'](0x194);}return _0x55dab8;};}function handleError(_0x7679d9,_0x330259){_0x330259=_0x330259||0x1f4;return function(_0x1e6aa6){logger['error'](_0x1e6aa6[_0x1ef0('0x2f')]);if(_0x1e6aa6[_0x1ef0('0x30')]){delete _0x1e6aa6[_0x1ef0('0x30')];}_0x7679d9[_0x1ef0('0x25')](_0x330259)[_0x1ef0('0x31')](_0x1e6aa6);};}exports[_0x1ef0('0x32')]=function(_0x126425,_0x349eac){var _0x5e5991={},_0x442532={},_0x1370f4={'count':0x0,'rows':[]};var _0x26a8a1=_[_0x1ef0('0x33')](db[_0x1ef0('0x34')]['rawAttributes'],function(_0x449480){return{'name':_0x449480[_0x1ef0('0x35')],'type':_0x449480['type'][_0x1ef0('0x36')]};});_0x442532[_0x1ef0('0x37')]=_[_0x1ef0('0x33')](_0x26a8a1,_0x1ef0('0x30'));_0x442532['query']=_[_0x1ef0('0x38')](_0x126425[_0x1ef0('0x39')]);_0x442532[_0x1ef0('0x3a')]=_[_0x1ef0('0x3b')](_0x442532[_0x1ef0('0x37')],_0x442532[_0x1ef0('0x39')]);_0x5e5991[_0x1ef0('0x3c')]=_[_0x1ef0('0x3b')](_0x442532['model'],qs['fields'](_0x126425[_0x1ef0('0x39')]['fields']));_0x5e5991[_0x1ef0('0x3c')]=_0x5e5991[_0x1ef0('0x3c')][_0x1ef0('0x3d')]?_0x5e5991[_0x1ef0('0x3c')]:_0x442532[_0x1ef0('0x37')];if(!_0x126425[_0x1ef0('0x39')]['hasOwnProperty'](_0x1ef0('0x3e'))){_0x5e5991[_0x1ef0('0x29')]=qs['limit'](_0x126425[_0x1ef0('0x39')]['limit']);_0x5e5991[_0x1ef0('0x28')]=qs[_0x1ef0('0x28')](_0x126425['query'][_0x1ef0('0x28')]);}_0x5e5991[_0x1ef0('0x3f')]=qs[_0x1ef0('0x40')](_0x126425['query'][_0x1ef0('0x40')]);_0x5e5991[_0x1ef0('0x41')]=qs['filters'](_['pick'](_0x126425[_0x1ef0('0x39')],_0x442532[_0x1ef0('0x3a')]),_0x26a8a1);if(_0x126425[_0x1ef0('0x39')][_0x1ef0('0x42')]){_0x5e5991['where']=_[_0x1ef0('0x43')](_0x5e5991[_0x1ef0('0x41')],{'$or':_[_0x1ef0('0x33')](_0x26a8a1,function(_0x317c2b){if(_0x317c2b['type']!==_0x1ef0('0x44')){var _0x4732b8={};_0x4732b8[_0x317c2b[_0x1ef0('0x30')]]={'$like':'%'+_0x126425[_0x1ef0('0x39')][_0x1ef0('0x42')]+'%'};return _0x4732b8;}})});}_0x5e5991=_['merge']({},_0x5e5991,_0x126425['options']);var _0x27c522={'where':_0x5e5991[_0x1ef0('0x41')]};return db['Setting'][_0x1ef0('0x45')](_0x27c522)[_0x1ef0('0x1b')](function(_0x4dc45b){_0x1370f4[_0x1ef0('0x45')]=_0x4dc45b;if(_0x126425[_0x1ef0('0x39')][_0x1ef0('0x46')]){_0x5e5991[_0x1ef0('0x47')]=[{'all':!![]}];}return db[_0x1ef0('0x34')]['findAll'](_0x5e5991);})[_0x1ef0('0x1b')](function(_0x4142c6){_0x1370f4[_0x1ef0('0x48')]=_0x4142c6;return _0x1370f4;})[_0x1ef0('0x1b')](respondWithFilteredResult(_0x349eac,_0x5e5991))[_0x1ef0('0x23')](handleError(_0x349eac,null));};exports[_0x1ef0('0x49')]=function(_0x55ee63,_0x557a6c){var _0x37c861={'raw':![],'where':{'id':_0x55ee63['params']['id']}},_0x3d88c3={};_0x3d88c3[_0x1ef0('0x37')]=_[_0x1ef0('0x38')](db[_0x1ef0('0x34')]['rawAttributes']);_0x3d88c3['query']=_[_0x1ef0('0x38')](_0x55ee63[_0x1ef0('0x39')]);_0x3d88c3[_0x1ef0('0x3a')]=_[_0x1ef0('0x3b')](_0x3d88c3[_0x1ef0('0x37')],_0x3d88c3[_0x1ef0('0x39')]);_0x37c861['attributes']=_[_0x1ef0('0x3b')](_0x3d88c3['model'],qs[_0x1ef0('0x4a')](_0x55ee63[_0x1ef0('0x39')][_0x1ef0('0x4a')]));_0x37c861[_0x1ef0('0x3c')]=_0x37c861['attributes']['length']?_0x37c861['attributes']:_0x3d88c3[_0x1ef0('0x37')];if(_0x55ee63[_0x1ef0('0x39')][_0x1ef0('0x46')]){_0x37c861[_0x1ef0('0x47')]=[{'all':!![]}];}_0x37c861=_[_0x1ef0('0x43')]({},_0x37c861,_0x55ee63['options']);return db[_0x1ef0('0x34')]['find'](_0x37c861)[_0x1ef0('0x1b')](handleEntityNotFound(_0x557a6c,null))['then'](respondWithResult(_0x557a6c,null))['catch'](handleError(_0x557a6c,null));};exports['update']=function(_0x4529a4,_0x109809){if(_0x4529a4['body']['id']){delete _0x4529a4[_0x1ef0('0x4b')]['id'];}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x4529a4[_0x1ef0('0x4d')]['id']}})[_0x1ef0('0x1b')](handleEntityNotFound(_0x109809,null))['then'](saveUpdates(_0x4529a4[_0x1ef0('0x4b')],null))[_0x1ef0('0x1b')](respondWithResult(_0x109809,null))[_0x1ef0('0x23')](handleError(_0x109809,null));};exports[_0x1ef0('0x4e')]=function(_0xe86e3d,_0x38e503,_0x46a1bc){if(_0xe86e3d['file']&&_0xe86e3d[_0x1ef0('0x4f')][_0x1ef0('0x50')]){_0xe86e3d['body']['logo']=_0xe86e3d[_0x1ef0('0x4f')]['filename'];}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0xe86e3d[_0x1ef0('0x4d')]['id']}})[_0x1ef0('0x1b')](handleEntityNotFound(_0x38e503,null))['then'](saveUpdates(_0xe86e3d[_0x1ef0('0x4b')],null))[_0x1ef0('0x1b')](respondWithResult(_0x38e503,null))['catch'](handleError(_0x38e503,null));};exports[_0x1ef0('0x51')]=function(_0x1496fd,_0x513a06,_0x50403f){if(_0x1496fd[_0x1ef0('0x4f')]&&_0x1496fd['file']['filename']){_0x1496fd[_0x1ef0('0x4b')][_0x1ef0('0x52')]=_0x1496fd['file'][_0x1ef0('0x50')];}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x1496fd[_0x1ef0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x513a06,null))[_0x1ef0('0x1b')](saveUpdates(_0x1496fd['body'],null))[_0x1ef0('0x1b')](respondWithResult(_0x513a06,null))[_0x1ef0('0x23')](handleError(_0x513a06,null));};var utilLicense=require(_0x1ef0('0x53'));exports[_0x1ef0('0x54')]=function(_0x4dce2f,_0x5e707e,_0x5ddec9){var _0x2f1294=_0x1ef0('0x55');var _0x5dfe44={'custom':![]};return utilLicense[_0x1ef0('0x56')]()[_0x1ef0('0x1b')](function(_0x36583b){if(_0x36583b){_0x5dfe44=_0x36583b;}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x4dce2f[_0x1ef0('0x4d')]['id']},'attributes':[_0x1ef0('0x57'),_0x1ef0('0x52'),_0x1ef0('0x58'),_0x1ef0('0x59'),_0x1ef0('0x5a'),_0x1ef0('0x5b'),_0x1ef0('0x5c'),_0x1ef0('0x5d')],'raw':!![]});})[_0x1ef0('0x1b')](handleEntityNotFound(_0x5e707e,null))['then'](function(_0x4add85){if(_0x4add85){var _0x1d3c19=_0x4add85['logo']&&fs[_0x1ef0('0x5e')](path['join'](config[_0x1ef0('0x5f')],_0x2f1294,_['toLower'](_0x4add85['logo'])))?path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x2f1294,_[_0x1ef0('0x61')](_0x4add85['logo'])):path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x2f1294,_['toLower']('default_logo.svg'));var _0xf2d5fa=_0x1ef0('0x62')+_[_0x1ef0('0x63')](_0x1ef0('0x57'));if(_0x4add85[_0xf2d5fa]||!_0x5dfe44[_0x1ef0('0x64')]){_0x1d3c19=path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x2f1294,_['toLower'](_0x1ef0('0x65')));}if(!fs['existsSync'](_0x1d3c19)){throw new db[(_0x1ef0('0x66'))][(_0x1ef0('0x67'))](_['upperFirst']('logo')+_0x1ef0('0x68'));}return _0x5e707e[_0x1ef0('0x69')](_0x1d3c19);}})[_0x1ef0('0x23')](handleError(_0x5e707e,null));};var utilLicense=require(_0x1ef0('0x53'));exports[_0x1ef0('0x6a')]=function(_0x4ab093,_0x2e388e,_0x31865b){var _0x1ee0b7=_0x1ef0('0x55');var _0x780957={'custom':![]};return utilLicense[_0x1ef0('0x56')]()[_0x1ef0('0x1b')](function(_0x569cfb){if(_0x569cfb){_0x780957=_0x569cfb;}return db['Setting'][_0x1ef0('0x4c')]({'where':{'id':_0x4ab093[_0x1ef0('0x4d')]['id']},'attributes':[_0x1ef0('0x57'),'loginLogo',_0x1ef0('0x58'),_0x1ef0('0x59'),_0x1ef0('0x5a'),'defaultLoginLogo',_0x1ef0('0x5c'),_0x1ef0('0x5d')],'raw':!![]});})[_0x1ef0('0x1b')](handleEntityNotFound(_0x2e388e,null))['then'](function(_0x13b631){if(_0x13b631){var _0x1e3bae=_0x13b631[_0x1ef0('0x52')]&&fs[_0x1ef0('0x5e')](path['join'](config[_0x1ef0('0x5f')],_0x1ee0b7,_[_0x1ef0('0x61')](_0x13b631[_0x1ef0('0x52')])))?path['join'](config['root'],_0x1ee0b7,_['toLower'](_0x13b631[_0x1ef0('0x52')])):path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x1ee0b7,_[_0x1ef0('0x61')](_0x1ef0('0x6b')));var _0x1dde25=_0x1ef0('0x62')+_[_0x1ef0('0x63')](_0x1ef0('0x52'));if(_0x13b631[_0x1dde25]||!_0x780957[_0x1ef0('0x64')]){_0x1e3bae=path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x1ee0b7,_[_0x1ef0('0x61')](_0x1ef0('0x6b')));}if(!fs[_0x1ef0('0x5e')](_0x1e3bae)){throw new db[(_0x1ef0('0x66'))][(_0x1ef0('0x67'))](_[_0x1ef0('0x63')](_0x1ef0('0x52'))+'\x20not\x20found');}return _0x2e388e['download'](_0x1e3bae);}})[_0x1ef0('0x23')](handleError(_0x2e388e,null));};exports[_0x1ef0('0x6c')]=function(_0x5e6cb3,_0x41cd63){return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x5e6cb3['params']['id']},'attributes':[_0x1ef0('0x6d')]})['then'](respondWithResult(_0x41cd63,null))['catch'](handleError(_0x41cd63,null));};exports[_0x1ef0('0x6e')]=function(_0xf221e9,_0x379d61,_0x48a186){if(_0xf221e9[_0x1ef0('0x4f')]&&_0xf221e9[_0x1ef0('0x4f')][_0x1ef0('0x50')]){_0xf221e9[_0x1ef0('0x4b')][_0x1ef0('0x58')]=_0xf221e9['file'][_0x1ef0('0x50')];}return db['Setting'][_0x1ef0('0x4c')]({'where':{'id':_0xf221e9[_0x1ef0('0x4d')]['id']}})[_0x1ef0('0x1b')](handleEntityNotFound(_0x379d61,null))[_0x1ef0('0x1b')](saveUpdates(_0xf221e9[_0x1ef0('0x4b')],null))['then'](respondWithResult(_0x379d61,null))[_0x1ef0('0x23')](handleError(_0x379d61,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x3b9cda,_0x2e1a2d,_0x1d6d07){var _0x5631af='server/files/images/logos';var _0xfe5958={'custom':![]};return utilLicense[_0x1ef0('0x56')]()[_0x1ef0('0x1b')](function(_0x248905){if(_0x248905){_0xfe5958=_0x248905;}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x3b9cda[_0x1ef0('0x4d')]['id']},'attributes':[_0x1ef0('0x57'),_0x1ef0('0x52'),_0x1ef0('0x58'),_0x1ef0('0x59'),_0x1ef0('0x5a'),_0x1ef0('0x5b'),_0x1ef0('0x5c'),'defaultFavicon'],'raw':!![]});})[_0x1ef0('0x1b')](handleEntityNotFound(_0x2e1a2d,null))[_0x1ef0('0x1b')](function(_0x5c2a9c){if(_0x5c2a9c){var _0x2b732d=_0x5c2a9c[_0x1ef0('0x58')]&&fs[_0x1ef0('0x5e')](path[_0x1ef0('0x60')](config['root'],_0x5631af,_['toLower'](_0x5c2a9c[_0x1ef0('0x58')])))?path[_0x1ef0('0x60')](config['root'],_0x5631af,_[_0x1ef0('0x61')](_0x5c2a9c['preferred'])):path[_0x1ef0('0x60')](config['root'],_0x5631af,_['toLower']('default_preferred.png'));var _0x27ecf2=_0x1ef0('0x62')+_['upperFirst'](_0x1ef0('0x58'));if(_0x5c2a9c[_0x27ecf2]||!_0xfe5958[_0x1ef0('0x64')]||!_0xfe5958[_0x1ef0('0x58')]){_0x2b732d=path['join'](config[_0x1ef0('0x5f')],_0x5631af,_[_0x1ef0('0x61')](_0x1ef0('0x6f')));}if(!fs[_0x1ef0('0x5e')](_0x2b732d)){throw new db[(_0x1ef0('0x66'))]['ValidationError'](_[_0x1ef0('0x63')](_0x1ef0('0x58'))+_0x1ef0('0x68'));}return _0x2e1a2d['download'](_0x2b732d);}})[_0x1ef0('0x23')](handleError(_0x2e1a2d,null));};exports[_0x1ef0('0x70')]=function(_0xd4b355,_0xe0c917,_0x2410a7){if(_0xd4b355['file']&&_0xd4b355[_0x1ef0('0x4f')]['filename']){_0xd4b355[_0x1ef0('0x4b')][_0x1ef0('0x59')]=_0xd4b355[_0x1ef0('0x4f')][_0x1ef0('0x50')];}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0xd4b355['params']['id']}})[_0x1ef0('0x1b')](handleEntityNotFound(_0xe0c917,null))[_0x1ef0('0x1b')](saveUpdates(_0xd4b355[_0x1ef0('0x4b')],null))[_0x1ef0('0x1b')](respondWithResult(_0xe0c917,null))[_0x1ef0('0x23')](handleError(_0xe0c917,null));};var utilLicense=require(_0x1ef0('0x53'));exports[_0x1ef0('0x71')]=function(_0x347202,_0x4d0b8c,_0x677f5a){var _0x19ae4c=_0x1ef0('0x55');var _0x1b6d88={'custom':![]};return utilLicense[_0x1ef0('0x56')]()[_0x1ef0('0x1b')](function(_0x412f2e){if(_0x412f2e){_0x1b6d88=_0x412f2e;}return db[_0x1ef0('0x34')][_0x1ef0('0x4c')]({'where':{'id':_0x347202[_0x1ef0('0x4d')]['id']},'attributes':[_0x1ef0('0x57'),'loginLogo',_0x1ef0('0x58'),'favicon','defaultLogo',_0x1ef0('0x5b'),'defaultPreferred',_0x1ef0('0x5d')],'raw':!![]});})[_0x1ef0('0x1b')](handleEntityNotFound(_0x4d0b8c,null))[_0x1ef0('0x1b')](function(_0x5a4624){if(_0x5a4624){var _0x194b69=_0x5a4624[_0x1ef0('0x59')]&&fs[_0x1ef0('0x5e')](path[_0x1ef0('0x60')](config['root'],_0x19ae4c,_['toLower'](_0x5a4624[_0x1ef0('0x59')])))?path[_0x1ef0('0x60')](config['root'],_0x19ae4c,_[_0x1ef0('0x61')](_0x5a4624[_0x1ef0('0x59')])):path['join'](config[_0x1ef0('0x5f')],_0x19ae4c,_[_0x1ef0('0x61')]('default_favicon.ico'));var _0x3ed2f7='default'+_[_0x1ef0('0x63')](_0x1ef0('0x59'));if(_0x5a4624[_0x3ed2f7]||!_0x1b6d88[_0x1ef0('0x64')]){_0x194b69=path[_0x1ef0('0x60')](config[_0x1ef0('0x5f')],_0x19ae4c,_['toLower'](_0x1ef0('0x72')));}if(!fs['existsSync'](_0x194b69)){throw new db['Sequelize'][(_0x1ef0('0x67'))](_[_0x1ef0('0x63')]('favicon')+'\x20not\x20found');}return _0x4d0b8c['download'](_0x194b69);}})[_0x1ef0('0x23')](handleError(_0x4d0b8c,null));};exports[_0x1ef0('0x73')]=function(_0x3cd73c,_0x115607){var _0x59ffca={'offset':moment()[_0x1ef0('0x74')]()};_0x59ffca['now']=moment()['utcOffset'](_0x59ffca[_0x1ef0('0x28')])[_0x1ef0('0x75')](_0x1ef0('0x76'));return _0x115607[_0x1ef0('0x25')](0xc8)[_0x1ef0('0x31')](_0x59ffca);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index fdd52f5..e4c2fe0 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x55ca,0x126));var _0xa55c=function(_0x458c52,_0x5e3fb4){_0x458c52=_0x458c52-0x0;var _0x43f43b=_0x55ca[_0x458c52];return _0x43f43b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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':'settings','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 52f9ed1..6613be4 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 _0xe389=['attributes','include','map','model','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','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','ShowSetting','Setting','find','options','raw'];(function(_0x2498b5,_0x514ddb){var _0x5c48d8=function(_0xee9bb5){while(--_0xee9bb5){_0x2498b5['push'](_0x2498b5['shift']());}};_0x5c48d8(++_0x514ddb);}(_0xe389,0x8e));var _0x9e38=function(_0x35b848,_0x402dbb){_0x35b848=_0x35b848-0x0;var _0x174d57=_0xe389[_0x35b848];return _0x174d57;};'use strict';var _=require(_0x9e38('0x0'));var util=require(_0x9e38('0x1'));var moment=require(_0x9e38('0x2'));var BPromise=require(_0x9e38('0x3'));var rs=require(_0x9e38('0x4'));var fs=require('fs');var Redis=require(_0x9e38('0x5'));var db=require(_0x9e38('0x6'))['db'];var utils=require(_0x9e38('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e38('0x8'));var jayson=require(_0x9e38('0x9'));var client=jayson[_0x9e38('0xa')][_0x9e38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3247fb,_0x1ce02b,_0x11281a){return new BPromise(function(_0x53463d,_0x26a64a){return client[_0x9e38('0xc')](_0x3247fb,_0x11281a)['then'](function(_0x55e540){logger['info'](_0x9e38('0xd'),_0x1ce02b,_0x9e38('0xe'));logger[_0x9e38('0xf')](_0x9e38('0x10'),_0x1ce02b,_0x9e38('0xe'),JSON[_0x9e38('0x11')](_0x55e540));if(_0x55e540[_0x9e38('0x12')]){if(_0x55e540[_0x9e38('0x12')][_0x9e38('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x1ce02b,_0x55e540[_0x9e38('0x12')]['message']);return _0x26a64a(_0x55e540[_0x9e38('0x12')][_0x9e38('0x14')]);}logger[_0x9e38('0x12')](_0x9e38('0xd'),_0x1ce02b,_0x55e540[_0x9e38('0x12')][_0x9e38('0x14')]);return _0x53463d(_0x55e540[_0x9e38('0x12')]['message']);}else{logger[_0x9e38('0x15')](_0x9e38('0xd'),_0x1ce02b,_0x9e38('0xe'));_0x53463d(_0x55e540[_0x9e38('0x16')]['message']);}})['catch'](function(_0x39eb28){logger[_0x9e38('0x12')](_0x9e38('0xd'),_0x1ce02b,_0x39eb28);_0x26a64a(_0x39eb28);});});}exports[_0x9e38('0x17')]=function(_0x156c4d){var _0x49ebba=this;return new Promise(function(_0x4bafd8,_0x5aa52d){return db[_0x9e38('0x18')][_0x9e38('0x19')]({'raw':_0x156c4d[_0x9e38('0x1a')]?_0x156c4d['options'][_0x9e38('0x1b')]===undefined?!![]:![]:!![],'where':_0x156c4d[_0x9e38('0x1a')]?_0x156c4d['options']['where']||null:null,'attributes':_0x156c4d[_0x9e38('0x1a')]?_0x156c4d[_0x9e38('0x1a')][_0x9e38('0x1c')]||null:null,'include':_0x156c4d[_0x9e38('0x1a')]?_0x156c4d[_0x9e38('0x1a')][_0x9e38('0x1d')]?_[_0x9e38('0x1e')](_0x156c4d['options'][_0x9e38('0x1d')],function(_0xc6d193){return{'model':db[_0xc6d193[_0x9e38('0x1f')]],'as':_0xc6d193['as'],'attributes':_0xc6d193[_0x9e38('0x1c')],'include':_0xc6d193[_0x9e38('0x1d')]?_[_0x9e38('0x1e')](_0xc6d193[_0x9e38('0x1d')],function(_0x5784b9){return{'model':db[_0x5784b9['model']],'as':_0x5784b9['as'],'attributes':_0x5784b9[_0x9e38('0x1c')],'include':_0x5784b9[_0x9e38('0x1d')]?_[_0x9e38('0x1e')](_0x5784b9[_0x9e38('0x1d')],function(_0x39d657){return{'model':db[_0x39d657[_0x9e38('0x1f')]],'as':_0x39d657['as'],'attributes':_0x39d657[_0x9e38('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9e38('0x20')](function(_0xefdecb){logger[_0x9e38('0x15')](_0x9e38('0x17'),_0x156c4d);logger[_0x9e38('0xf')](_0x9e38('0x17'),_0x156c4d,JSON[_0x9e38('0x11')](_0xefdecb));_0x4bafd8(_0xefdecb);})[_0x9e38('0x21')](function(_0x22055d){logger[_0x9e38('0x12')](_0x9e38('0x17'),_0x22055d[_0x9e38('0x14')],_0x156c4d);_0x5aa52d(_0x49ebba[_0x9e38('0x12')](0x1f4,_0x22055d['message']));});});}; \ No newline at end of file +var _0xe1a4=['map','model','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','find','options','where','attributes','include'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe1a4,0x1f2));var _0x4e1a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe1a4[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x4e1a('0x0'));var util=require(_0x4e1a('0x1'));var moment=require(_0x4e1a('0x2'));var BPromise=require(_0x4e1a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e1a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e1a('0x5'));var logger=require(_0x4e1a('0x6'))(_0x4e1a('0x7'));var config=require(_0x4e1a('0x8'));var jayson=require(_0x4e1a('0x9'));var client=jayson[_0x4e1a('0xa')][_0x4e1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x459036,_0x2fff4b,_0x21b2f7){return new BPromise(function(_0x274504,_0x132443){return client[_0x4e1a('0xc')](_0x459036,_0x21b2f7)[_0x4e1a('0xd')](function(_0x276e38){logger[_0x4e1a('0xe')]('Setting,\x20%s,\x20%s',_0x2fff4b,_0x4e1a('0xf'));logger[_0x4e1a('0x10')](_0x4e1a('0x11'),_0x2fff4b,_0x4e1a('0xf'),JSON['stringify'](_0x276e38));if(_0x276e38[_0x4e1a('0x12')]){if(_0x276e38[_0x4e1a('0x12')][_0x4e1a('0x13')]===0x1f4){logger['error'](_0x4e1a('0x14'),_0x2fff4b,_0x276e38[_0x4e1a('0x12')][_0x4e1a('0x15')]);return _0x132443(_0x276e38[_0x4e1a('0x12')][_0x4e1a('0x15')]);}logger[_0x4e1a('0x12')]('Setting,\x20%s,\x20%s',_0x2fff4b,_0x276e38[_0x4e1a('0x12')][_0x4e1a('0x15')]);return _0x274504(_0x276e38[_0x4e1a('0x12')][_0x4e1a('0x15')]);}else{logger[_0x4e1a('0xe')]('Setting,\x20%s,\x20%s',_0x2fff4b,_0x4e1a('0xf'));_0x274504(_0x276e38[_0x4e1a('0x16')]['message']);}})['catch'](function(_0x54f05a){logger[_0x4e1a('0x12')]('Setting,\x20%s,\x20%s',_0x2fff4b,_0x54f05a);_0x132443(_0x54f05a);});});}exports[_0x4e1a('0x17')]=function(_0x1f45d5){var _0x3468c4=this;return new Promise(function(_0xb5fd0d,_0x4796b0){return db[_0x4e1a('0x18')][_0x4e1a('0x19')]({'raw':_0x1f45d5[_0x4e1a('0x1a')]?_0x1f45d5[_0x4e1a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f45d5['options']?_0x1f45d5[_0x4e1a('0x1a')][_0x4e1a('0x1b')]||null:null,'attributes':_0x1f45d5['options']?_0x1f45d5['options'][_0x4e1a('0x1c')]||null:null,'include':_0x1f45d5[_0x4e1a('0x1a')]?_0x1f45d5[_0x4e1a('0x1a')][_0x4e1a('0x1d')]?_[_0x4e1a('0x1e')](_0x1f45d5[_0x4e1a('0x1a')][_0x4e1a('0x1d')],function(_0x93c4d0){return{'model':db[_0x93c4d0[_0x4e1a('0x1f')]],'as':_0x93c4d0['as'],'attributes':_0x93c4d0[_0x4e1a('0x1c')],'include':_0x93c4d0[_0x4e1a('0x1d')]?_['map'](_0x93c4d0['include'],function(_0x207432){return{'model':db[_0x207432[_0x4e1a('0x1f')]],'as':_0x207432['as'],'attributes':_0x207432[_0x4e1a('0x1c')],'include':_0x207432[_0x4e1a('0x1d')]?_[_0x4e1a('0x1e')](_0x207432[_0x4e1a('0x1d')],function(_0x3abc41){return{'model':db[_0x3abc41['model']],'as':_0x3abc41['as'],'attributes':_0x3abc41[_0x4e1a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4e1a('0xd')](function(_0x580eb8){logger[_0x4e1a('0xe')]('ShowSetting',_0x1f45d5);logger[_0x4e1a('0x10')]('ShowSetting',_0x1f45d5,JSON[_0x4e1a('0x20')](_0x580eb8));_0xb5fd0d(_0x580eb8);})['catch'](function(_0x8b1f04){logger[_0x4e1a('0x12')](_0x4e1a('0x17'),_0x8b1f04[_0x4e1a('0x15')],_0x1f45d5);_0x4796b0(_0x3468c4['error'](0x1f4,_0x8b1f04[_0x4e1a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e4d437d..1384c69 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(_0xdb3547,_0x52d32b){var _0x718b9d=function(_0x1681ee){while(--_0x1681ee){_0xdb3547['push'](_0xdb3547['shift']());}};_0x718b9d(++_0x52d32b);}(_0x6aa7,0x178));var _0x76aa=function(_0x297570,_0x175bce){_0x297570=_0x297570-0x0;var _0x2c9f87=_0x6aa7[_0x297570];return _0x2c9f87;};'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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf494,0x1c6));var _0x4f49=function(_0x2d608d,_0x5746dd){_0x2d608d=_0x2d608d-0x0;var _0x323097=_0xf494[_0x2d608d];return _0x323097;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ddfe151..cbd09fe 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 _0x087e=['BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM'];(function(_0x3980c7,_0x5765f3){var _0x320139=function(_0xc2a268){while(--_0xc2a268){_0x3980c7['push'](_0x3980c7['shift']());}};_0x320139(++_0x5765f3);}(_0x087e,0xaa));var _0xe087=function(_0x333936,_0x46708f){_0x333936=_0x333936-0x0;var _0x572f25=_0x087e[_0x333936];return _0x572f25;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe087('0x0'));module['exports']={'name':{'type':Sequelize[_0xe087('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe087('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe087('0x1')],'defaultValue':function(){return rs[_0xe087('0x2')]();}},'phone':{'type':Sequelize[_0xe087('0x1')]},'type':{'type':Sequelize['ENUM'](_0xe087('0x3'),_0xe087('0x4'),_0xe087('0x5'),_0xe087('0x6'),_0xe087('0x7'),_0xe087('0x8'),_0xe087('0x9'),_0xe087('0xa'),_0xe087('0xb'),_0xe087('0xc'))},'accountSid':{'type':Sequelize[_0xe087('0x1')]},'authId':{'type':Sequelize[_0xe087('0x1')]},'authToken':{'type':Sequelize[_0xe087('0x1')]},'smsMethod':{'type':Sequelize[_0xe087('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe087('0x1')]},'applicationId':{'type':Sequelize[_0xe087('0x1')]},'accountId':{'type':Sequelize[_0xe087('0x1')]},'senderString':{'type':Sequelize[_0xe087('0x1')]},'deliveryReport':{'type':Sequelize[_0xe087('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xe087('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe087('0xf')],'defaultValue':function(){return _0xe087('0x10');}},'notificationSound':{'type':Sequelize[_0xe087('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe087('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe087('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe087('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe087('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe087('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe087('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe087('0x13'),'set':function(_0x2114a3){if(!_0x2114a3)this[_0xe087('0x14')](_0xe087('0x15'),null);this[_0xe087('0x14')](_0xe087('0x16'),_0x2114a3);}}}; \ No newline at end of file +var _0x9d53=['twilio','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','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','sequelize','randomstring','exports','STRING','generate','ENUM'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9d53,0x120));var _0x39d5=function(_0x11081e,_0x424edd){_0x11081e=_0x11081e-0x0;var _0x559138=_0x9d53[_0x11081e];return _0x559138;};'use strict';var Sequelize=require(_0x39d5('0x0'));var rs=require(_0x39d5('0x1'));module[_0x39d5('0x2')]={'name':{'type':Sequelize[_0x39d5('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x39d5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x39d5('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x39d5('0x4')]();}},'phone':{'type':Sequelize[_0x39d5('0x3')]},'type':{'type':Sequelize[_0x39d5('0x5')](_0x39d5('0x6'),'skebby',_0x39d5('0x7'),_0x39d5('0x8'),_0x39d5('0x9'),_0x39d5('0xa'),'bandwidth',_0x39d5('0xb'),_0x39d5('0xc'),_0x39d5('0xd'))},'accountSid':{'type':Sequelize[_0x39d5('0x3')]},'authId':{'type':Sequelize[_0x39d5('0x3')]},'authToken':{'type':Sequelize[_0x39d5('0x3')]},'smsMethod':{'type':Sequelize[_0x39d5('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x39d5('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x39d5('0x3')]},'accountId':{'type':Sequelize[_0x39d5('0x3')]},'senderString':{'type':Sequelize[_0x39d5('0x3')]},'deliveryReport':{'type':Sequelize[_0x39d5('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x39d5('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x39d5('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x39d5('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x39d5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x39d5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x39d5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x39d5('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x39d5('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x39d5('0xe')],'defaultValue':![],'comment':_0x39d5('0x12'),'set':function(_0x5280c1){if(!_0x5280c1)this[_0x39d5('0x13')](_0x39d5('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x5280c1);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index cbef07d..f5bca81 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 _0xd5fb=['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','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','Disposition','findOne','SmsAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','orderBy','Applications','priority','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','Body','messageId','sender','text','message_id','plivo','Text','infobip','results','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','Contacts','contact','SmsInteraction','spread','applications','push','close','unmanaged','created','SmsMessage','ContactId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','skebby','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','clickatell','intelepeer','redif','DELIVERED','inspect','groupName','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x5554f3,_0x490882){var _0x3c4d1a=function(_0x356693){while(--_0x356693){_0x5554f3['push'](_0x5554f3['shift']());}};_0x3c4d1a(++_0x490882);}(_0xd5fb,0x1bb));var _0xbd5f=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xd5fb[_0x1147ab];return _0x55cb5a;};'use strict';var emlformat=require(_0xbd5f('0x0'));var rimraf=require(_0xbd5f('0x1'));var zipdir=require(_0xbd5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd5f('0x3'));var moment=require(_0xbd5f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbd5f('0x5'));var util=require('util');var path=require(_0xbd5f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd5f('0x7'));var fs=require('fs');var fs_extra=require(_0xbd5f('0x8'));var _=require('lodash');var squel=require(_0xbd5f('0x9'));var crypto=require(_0xbd5f('0xa'));var jsforce=require(_0xbd5f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbd5f('0xc'));var querystring=require(_0xbd5f('0xd'));var Papa=require(_0xbd5f('0xe'));var Redis=require(_0xbd5f('0xf'));var authService=require(_0xbd5f('0x10'));var qs=require(_0xbd5f('0x11'));var as=require(_0xbd5f('0x12'));var hardwareService=require(_0xbd5f('0x13'));var logger=require(_0xbd5f('0x14'))('api');var utils=require(_0xbd5f('0x15'));var config=require(_0xbd5f('0x16'));var licenseUtil=require(_0xbd5f('0x17'));var db=require(_0xbd5f('0x18'))['db'];config[_0xbd5f('0x19')]=_[_0xbd5f('0x1a')](config[_0xbd5f('0x19')],{'host':_0xbd5f('0x1b'),'port':0x18eb});var socket=require(_0xbd5f('0x1c'))(new Redis(config['redis']));require(_0xbd5f('0x1d'))[_0xbd5f('0x1e')](socket);var jayson=require(_0xbd5f('0x1f'));var client=jayson[_0xbd5f('0x20')][_0xbd5f('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2df0df,_0x3b8713,_0x5eadc2,_0xe698a7){return new BPromise(function(_0x53a747,_0x12ea3d){var _0x61bc45=_0xe698a7||client;return _0x61bc45['request'](_0x2df0df,_0x5eadc2)[_0xbd5f('0x22')](function(_0xc4e3a5){logger['info'](_0xbd5f('0x23'),_0x3b8713,_0xbd5f('0x24'));logger[_0xbd5f('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3b8713,_0xbd5f('0x24'),JSON[_0xbd5f('0x26')](_0xc4e3a5));if(_0xc4e3a5[_0xbd5f('0x27')]){if(_0xc4e3a5[_0xbd5f('0x27')][_0xbd5f('0x28')]===0x1f4){logger[_0xbd5f('0x27')](_0xbd5f('0x23'),_0x3b8713,_0xc4e3a5['error'][_0xbd5f('0x29')]);return _0x12ea3d(_0xc4e3a5['error'][_0xbd5f('0x29')]);}logger['error'](_0xbd5f('0x23'),_0x3b8713,_0xc4e3a5[_0xbd5f('0x27')]['message']);return _0x53a747(_0xc4e3a5['error'][_0xbd5f('0x29')]);}else{logger[_0xbd5f('0x2a')](_0xbd5f('0x23'),_0x3b8713,_0xbd5f('0x24'));_0x53a747(_0xc4e3a5[_0xbd5f('0x2b')][_0xbd5f('0x29')]);}})[_0xbd5f('0x2c')](function(_0x45638c){logger[_0xbd5f('0x27')]('SmsAccount,\x20%s,\x20%s',_0x3b8713,_0x45638c);_0x12ea3d(_0x45638c);});});}function respondWithStatusCode(_0x21897f,_0x28dd5b){_0x28dd5b=_0x28dd5b||0xcc;return function(_0x20e729){if(_0x20e729){return _0x21897f[_0xbd5f('0x2d')](_0x28dd5b);}return _0x21897f[_0xbd5f('0x2e')](_0x28dd5b)[_0xbd5f('0x2f')]();};}function respondWithResult(_0x19464c,_0x298290){_0x298290=_0x298290||0xc8;return function(_0xd85895){if(_0xd85895){return _0x19464c[_0xbd5f('0x2e')](_0x298290)[_0xbd5f('0x30')](_0xd85895);}};}function respondWithFilteredResult(_0x199d3e,_0x9bc37b){return function(_0x254d4b){if(_0x254d4b){var _0x4f9ef9=typeof _0x9bc37b[_0xbd5f('0x31')]===_0xbd5f('0x32')&&typeof _0x9bc37b[_0xbd5f('0x33')]==='undefined';var _0x43e2c6=_0x254d4b[_0xbd5f('0x34')];var _0x227f87=_0x4f9ef9?0x0:_0x9bc37b[_0xbd5f('0x31')];var _0xe475ac=_0x4f9ef9?_0x254d4b[_0xbd5f('0x34')]:_0x9bc37b[_0xbd5f('0x31')]+_0x9bc37b[_0xbd5f('0x33')];var _0x99ad0b;if(_0xe475ac>=_0x43e2c6){_0xe475ac=_0x43e2c6;_0x99ad0b=0xc8;}else{_0x99ad0b=0xce;}_0x199d3e[_0xbd5f('0x2e')](_0x99ad0b);return _0x199d3e[_0xbd5f('0x35')](_0xbd5f('0x36'),_0x227f87+'-'+_0xe475ac+'/'+_0x43e2c6)['json'](_0x254d4b);}return null;};}function patchUpdates(_0x298b39){return function(_0x59f48f){try{jsonpatch[_0xbd5f('0x37')](_0x59f48f,_0x298b39,!![]);}catch(_0x17d198){return BPromise[_0xbd5f('0x38')](_0x17d198);}return _0x59f48f[_0xbd5f('0x39')]();};}function saveUpdates(_0x5e562e,_0x1d9c6d){return function(_0x181d51){if(_0x181d51){return _0x181d51[_0xbd5f('0x3a')](_0x5e562e)[_0xbd5f('0x22')](function(_0x5c669c){return _0x5c669c;});}return null;};}function removeEntity(_0x4ceea8,_0x552648){return function(_0x53bf0a){if(_0x53bf0a){return _0x53bf0a[_0xbd5f('0x3b')]()[_0xbd5f('0x22')](function(){var _0x2e5324=_0x53bf0a[_0xbd5f('0x3c')]({'plain':!![]});var _0x1172f2=_0xbd5f('0x3d');return db[_0xbd5f('0x3e')][_0xbd5f('0x3b')]({'where':{'type':_0x1172f2,'resourceId':_0x2e5324['id']}})[_0xbd5f('0x22')](function(){return _0x53bf0a;});})[_0xbd5f('0x22')](function(){_0x4ceea8[_0xbd5f('0x2e')](0xcc)[_0xbd5f('0x2f')]();});}};}function handleEntityNotFound(_0x1c3a2e,_0x2325a1){return function(_0x4850e9){if(!_0x4850e9){_0x1c3a2e['sendStatus'](0x194);}return _0x4850e9;};}function handleError(_0x38438e,_0x2d1074){_0x2d1074=_0x2d1074||0x1f4;return function(_0x24a1f9){logger[_0xbd5f('0x27')](_0x24a1f9[_0xbd5f('0x3f')]);if(_0x24a1f9[_0xbd5f('0x40')]){delete _0x24a1f9['name'];}_0x38438e['status'](_0x2d1074)[_0xbd5f('0x41')](_0x24a1f9);};}exports[_0xbd5f('0x42')]=function(_0x27e8a5,_0x35425a){var _0xaa5a48={'include':[{'model':db[_0xbd5f('0x43')],'as':_0xbd5f('0x44')}]},_0x2e2b02={},_0x25c9af={'count':0x0,'rows':[]};var _0x3feeb2=_[_0xbd5f('0x45')](db[_0xbd5f('0x46')][_0xbd5f('0x47')],function(_0x464995){return{'name':_0x464995[_0xbd5f('0x48')],'type':_0x464995[_0xbd5f('0x49')][_0xbd5f('0x4a')]};});_0x2e2b02['model']=_[_0xbd5f('0x45')](_0x3feeb2,'name');_0x2e2b02[_0xbd5f('0x4b')]=_['keys'](_0x27e8a5[_0xbd5f('0x4b')]);_0x2e2b02['filters']=_[_0xbd5f('0x4c')](_0x2e2b02['model'],_0x2e2b02[_0xbd5f('0x4b')]);_0xaa5a48['attributes']=_[_0xbd5f('0x4c')](_0x2e2b02[_0xbd5f('0x4d')],qs[_0xbd5f('0x4e')](_0x27e8a5[_0xbd5f('0x4b')]['fields']));_0xaa5a48['attributes']=_0xaa5a48[_0xbd5f('0x4f')]['length']?_0xaa5a48[_0xbd5f('0x4f')]:_0x2e2b02[_0xbd5f('0x4d')];if(!_0x27e8a5['query'][_0xbd5f('0x50')](_0xbd5f('0x51'))){_0xaa5a48[_0xbd5f('0x33')]=qs[_0xbd5f('0x33')](_0x27e8a5[_0xbd5f('0x4b')]['limit']);_0xaa5a48[_0xbd5f('0x31')]=qs['offset'](_0x27e8a5['query']['offset']);}_0xaa5a48[_0xbd5f('0x52')]=qs['sort'](_0x27e8a5[_0xbd5f('0x4b')][_0xbd5f('0x53')]);_0xaa5a48[_0xbd5f('0x54')]=qs[_0xbd5f('0x55')](_[_0xbd5f('0x56')](_0x27e8a5[_0xbd5f('0x4b')],_0x2e2b02[_0xbd5f('0x55')]),_0x3feeb2);if(_0x27e8a5['query']['filter']){_0xaa5a48[_0xbd5f('0x54')]=_['merge'](_0xaa5a48[_0xbd5f('0x54')],{'$or':_['map'](_0x3feeb2,function(_0x35ea9c){if(_0x35ea9c[_0xbd5f('0x49')]!==_0xbd5f('0x57')){var _0x184f03={};_0x184f03[_0x35ea9c[_0xbd5f('0x40')]]={'$like':'%'+_0x27e8a5[_0xbd5f('0x4b')][_0xbd5f('0x58')]+'%'};return _0x184f03;}})});}_0xaa5a48=_[_0xbd5f('0x59')]({},_0xaa5a48,_0x27e8a5[_0xbd5f('0x5a')]);var _0x54d214={'where':_0xaa5a48[_0xbd5f('0x54')]};return db['SmsAccount'][_0xbd5f('0x34')](_0x54d214)[_0xbd5f('0x22')](function(_0x3bfac4){_0x25c9af[_0xbd5f('0x34')]=_0x3bfac4;if(_0x27e8a5[_0xbd5f('0x4b')][_0xbd5f('0x5b')]){_0xaa5a48[_0xbd5f('0x5c')]=[{'all':!![]}];}return db[_0xbd5f('0x46')][_0xbd5f('0x5d')](_0xaa5a48);})[_0xbd5f('0x22')](function(_0x4a3c48){_0x25c9af['rows']=_0x4a3c48;return _0x25c9af;})['then'](respondWithFilteredResult(_0x35425a,_0xaa5a48))[_0xbd5f('0x2c')](handleError(_0x35425a,null));};exports[_0xbd5f('0x5e')]=function(_0x53bb96,_0x3eaa4c){var _0x30a209={'raw':![],'where':{'id':_0x53bb96[_0xbd5f('0x5f')]['id']},'include':[{'model':db[_0xbd5f('0x43')],'as':_0xbd5f('0x44')}]},_0x24b21c={};_0x24b21c[_0xbd5f('0x4d')]=_[_0xbd5f('0x60')](db[_0xbd5f('0x46')][_0xbd5f('0x47')]);_0x24b21c[_0xbd5f('0x4b')]=_['keys'](_0x53bb96[_0xbd5f('0x4b')]);_0x24b21c['filters']=_['intersection'](_0x24b21c[_0xbd5f('0x4d')],_0x24b21c['query']);_0x30a209[_0xbd5f('0x4f')]=_['intersection'](_0x24b21c[_0xbd5f('0x4d')],qs[_0xbd5f('0x4e')](_0x53bb96[_0xbd5f('0x4b')][_0xbd5f('0x4e')]));_0x30a209[_0xbd5f('0x4f')]=_0x30a209[_0xbd5f('0x4f')][_0xbd5f('0x61')]?_0x30a209[_0xbd5f('0x4f')]:_0x24b21c[_0xbd5f('0x4d')];if(_0x53bb96[_0xbd5f('0x4b')][_0xbd5f('0x5b')]){_0x30a209['include']=[{'all':!![]}];}_0x30a209=_[_0xbd5f('0x59')]({},_0x30a209,_0x53bb96[_0xbd5f('0x5a')]);return db[_0xbd5f('0x46')]['find'](_0x30a209)[_0xbd5f('0x22')](handleEntityNotFound(_0x3eaa4c,null))[_0xbd5f('0x22')](respondWithResult(_0x3eaa4c,null))[_0xbd5f('0x2c')](handleError(_0x3eaa4c,null));};exports[_0xbd5f('0x62')]=function(_0xb9494a,_0x4c20aa){return db[_0xbd5f('0x46')]['create'](_0xb9494a['body'],{})[_0xbd5f('0x22')](function(_0x422dff){var _0x597c72=_0xb9494a[_0xbd5f('0x63')][_0xbd5f('0x3c')]({'plain':!![]});if(!_0x597c72)throw new Error(_0xbd5f('0x64'));if(_0x597c72['role']===_0xbd5f('0x63')){var _0x27d9d0=_0x422dff[_0xbd5f('0x3c')]({'plain':!![]});var _0x3ddf34=_0xbd5f('0x3d');return db[_0xbd5f('0x65')]['find']({'where':{'name':_0x3ddf34,'userProfileId':_0x597c72[_0xbd5f('0x66')]},'raw':!![]})['then'](function(_0xb8f6b7){if(_0xb8f6b7&&_0xb8f6b7[_0xbd5f('0x67')]===0x0){return db[_0xbd5f('0x3e')]['create']({'name':_0x27d9d0[_0xbd5f('0x40')],'resourceId':_0x27d9d0['id'],'type':_0xb8f6b7[_0xbd5f('0x40')],'sectionId':_0xb8f6b7['id']},{})[_0xbd5f('0x22')](function(){return _0x422dff;});}else{return _0x422dff;}})[_0xbd5f('0x2c')](function(_0x96a36a){logger['error'](_0xbd5f('0x68'),_0x96a36a);throw _0x96a36a;});}return _0x422dff;})['then'](respondWithResult(_0x4c20aa,0xc9))[_0xbd5f('0x2c')](handleError(_0x4c20aa,null));};exports['update']=function(_0x899d19,_0x307d3b){if(_0x899d19[_0xbd5f('0x69')]['id']){delete _0x899d19[_0xbd5f('0x69')]['id'];}return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x899d19[_0xbd5f('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0xbd5f('0x44')}]})[_0xbd5f('0x22')](handleEntityNotFound(_0x307d3b,null))['then'](saveUpdates(_0x899d19['body'],null))[_0xbd5f('0x22')](respondWithResult(_0x307d3b,null))['catch'](handleError(_0x307d3b,null));};exports['destroy']=function(_0x43adf0,_0x8b903d){return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x43adf0[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x8b903d,null))[_0xbd5f('0x22')](removeEntity(_0x8b903d,null))[_0xbd5f('0x2c')](handleError(_0x8b903d,null));};exports[_0xbd5f('0x6b')]=function(_0x5a87b5,_0x5d844b){return db['SmsAccount']['describe']()[_0xbd5f('0x22')](respondWithResult(_0x5d844b,null))[_0xbd5f('0x2c')](handleError(_0x5d844b,null));};exports['addDisposition']=function(_0x4e66a9,_0x4cc667,_0x369e43){if(_0x4e66a9[_0xbd5f('0x69')]['id']){delete _0x4e66a9[_0xbd5f('0x69')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4e66a9['params']['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x4cc667,null))['then'](function(_0x19db7e){if(_0x19db7e){_0x4e66a9[_0xbd5f('0x69')]['SmsAccountId']=_0x19db7e['id'];return db[_0xbd5f('0x6c')][_0xbd5f('0x62')](_0x4e66a9[_0xbd5f('0x69')]);}})[_0xbd5f('0x22')](respondWithResult(_0x4cc667,null))[_0xbd5f('0x2c')](handleError(_0x4cc667,null));};exports['getDispositions']=function(_0x350e63,_0x278525,_0x42b4bb){var _0x55c72f={'raw':![],'where':{}};var _0x272a67={};var _0x13855b={'count':0x0,'rows':[]};return db['SmsAccount'][_0xbd5f('0x6d')]({'where':{'id':_0x350e63[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x278525,null))[_0xbd5f('0x22')](function(_0x3c4acb){if(_0x3c4acb){_0x272a67[_0xbd5f('0x4d')]=_[_0xbd5f('0x60')](db['Disposition']['rawAttributes']);_0x272a67[_0xbd5f('0x4b')]=_[_0xbd5f('0x60')](_0x350e63['query']);_0x272a67[_0xbd5f('0x55')]=_['intersection'](_0x272a67[_0xbd5f('0x4d')],_0x272a67[_0xbd5f('0x4b')]);_0x55c72f[_0xbd5f('0x4f')]=_['intersection'](_0x272a67[_0xbd5f('0x4d')],qs[_0xbd5f('0x4e')](_0x350e63[_0xbd5f('0x4b')][_0xbd5f('0x4e')]));_0x55c72f[_0xbd5f('0x4f')]=_0x55c72f[_0xbd5f('0x4f')][_0xbd5f('0x61')]?_0x55c72f['attributes']:_0x272a67[_0xbd5f('0x4d')];if(!_0x350e63[_0xbd5f('0x4b')][_0xbd5f('0x50')](_0xbd5f('0x51'))){_0x55c72f[_0xbd5f('0x33')]=qs['limit'](_0x350e63[_0xbd5f('0x4b')]['limit']);_0x55c72f[_0xbd5f('0x31')]=qs[_0xbd5f('0x31')](_0x350e63[_0xbd5f('0x4b')][_0xbd5f('0x31')]);}_0x55c72f[_0xbd5f('0x52')]=qs[_0xbd5f('0x53')](_0x350e63['query']['sort']);_0x55c72f[_0xbd5f('0x54')]=qs['filters'](_[_0xbd5f('0x56')](_0x350e63[_0xbd5f('0x4b')],_0x272a67[_0xbd5f('0x55')]));_0x55c72f[_0xbd5f('0x54')][_0xbd5f('0x6e')]=_0x3c4acb['id'];if(_0x350e63[_0xbd5f('0x4b')][_0xbd5f('0x58')]){_0x55c72f[_0xbd5f('0x54')]=_[_0xbd5f('0x59')](_0x55c72f['where'],{'$or':_['map'](_0x55c72f[_0xbd5f('0x4f')],function(_0x480607){var _0xc6fa6a={};_0xc6fa6a[_0x480607]={'$like':'%'+_0x350e63['query'][_0xbd5f('0x58')]+'%'};return _0xc6fa6a;})});}_0x55c72f=_['merge']({},_0x55c72f,_0x350e63[_0xbd5f('0x5a')]);return db[_0xbd5f('0x6c')]['count']({'where':_0x55c72f[_0xbd5f('0x54')]})[_0xbd5f('0x22')](function(_0x51100f){_0x13855b[_0xbd5f('0x34')]=_0x51100f;if(_0x350e63['query'][_0xbd5f('0x5b')]){_0x55c72f['include']=[{'all':!![]}];}return db[_0xbd5f('0x6c')][_0xbd5f('0x5d')](_0x55c72f);})[_0xbd5f('0x22')](function(_0x1ef914){_0x13855b[_0xbd5f('0x6f')]=_0x1ef914;return _0x13855b;});}})['then'](respondWithFilteredResult(_0x278525,_0x55c72f))[_0xbd5f('0x2c')](handleError(_0x278525,null));};exports[_0xbd5f('0x70')]=function(_0x3fb143,_0xe43a0,_0x1287c6){return db['SmsAccount'][_0xbd5f('0x6a')]({'where':{'id':_0x3fb143[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0xe43a0,null))[_0xbd5f('0x22')](function(_0x4c9121){if(_0x4c9121){return _0x4c9121[_0xbd5f('0x70')](_0x3fb143[_0xbd5f('0x4b')][_0xbd5f('0x71')]);}})[_0xbd5f('0x22')](respondWithStatusCode(_0xe43a0,null))[_0xbd5f('0x2c')](handleError(_0xe43a0,null));};exports[_0xbd5f('0x72')]=function(_0x37e2e0,_0x53c1e0,_0x3bec4c){if(_0x37e2e0[_0xbd5f('0x69')]['id']){delete _0x37e2e0[_0xbd5f('0x69')]['id'];}return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x37e2e0[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x53c1e0,null))[_0xbd5f('0x22')](function(_0x13d6ca){if(_0x13d6ca){_0x37e2e0[_0xbd5f('0x69')]['SmsAccountId']=_0x13d6ca['id'];return db[_0xbd5f('0x73')][_0xbd5f('0x62')](_0x37e2e0[_0xbd5f('0x69')]);}})['then'](respondWithResult(_0x53c1e0,null))['catch'](handleError(_0x53c1e0,null));};exports['getAnswers']=function(_0x182be4,_0x3113e3,_0x3fbaf4){var _0x5b72da={'raw':![],'where':{}};var _0x121921={};var _0x1415cd={'count':0x0,'rows':[]};return db[_0xbd5f('0x46')]['findOne']({'where':{'id':_0x182be4['params']['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x3113e3,null))[_0xbd5f('0x22')](function(_0x72cd2){if(_0x72cd2){_0x121921['model']=_[_0xbd5f('0x60')](db['CannedAnswer'][_0xbd5f('0x47')]);_0x121921[_0xbd5f('0x4b')]=_['keys'](_0x182be4[_0xbd5f('0x4b')]);_0x121921['filters']=_['intersection'](_0x121921['model'],_0x121921[_0xbd5f('0x4b')]);_0x5b72da[_0xbd5f('0x4f')]=_[_0xbd5f('0x4c')](_0x121921[_0xbd5f('0x4d')],qs['fields'](_0x182be4[_0xbd5f('0x4b')][_0xbd5f('0x4e')]));_0x5b72da['attributes']=_0x5b72da[_0xbd5f('0x4f')][_0xbd5f('0x61')]?_0x5b72da[_0xbd5f('0x4f')]:_0x121921['model'];if(!_0x182be4[_0xbd5f('0x4b')][_0xbd5f('0x50')](_0xbd5f('0x51'))){_0x5b72da[_0xbd5f('0x33')]=qs[_0xbd5f('0x33')](_0x182be4[_0xbd5f('0x4b')]['limit']);_0x5b72da[_0xbd5f('0x31')]=qs[_0xbd5f('0x31')](_0x182be4['query'][_0xbd5f('0x31')]);}_0x5b72da[_0xbd5f('0x52')]=qs[_0xbd5f('0x53')](_0x182be4['query'][_0xbd5f('0x53')]);_0x5b72da[_0xbd5f('0x54')]=qs[_0xbd5f('0x55')](_[_0xbd5f('0x56')](_0x182be4[_0xbd5f('0x4b')],_0x121921['filters']));_0x5b72da[_0xbd5f('0x54')][_0xbd5f('0x6e')]=_0x72cd2['id'];if(_0x182be4[_0xbd5f('0x4b')][_0xbd5f('0x58')]){_0x5b72da['where']=_['merge'](_0x5b72da['where'],{'$or':_[_0xbd5f('0x45')](_0x5b72da[_0xbd5f('0x4f')],function(_0x396fac){var _0x2dba87={};_0x2dba87[_0x396fac]={'$like':'%'+_0x182be4[_0xbd5f('0x4b')][_0xbd5f('0x58')]+'%'};return _0x2dba87;})});}_0x5b72da=_['merge']({},_0x5b72da,_0x182be4[_0xbd5f('0x5a')]);return db[_0xbd5f('0x73')]['count']({'where':_0x5b72da[_0xbd5f('0x54')]})['then'](function(_0x3537e8){_0x1415cd[_0xbd5f('0x34')]=_0x3537e8;if(_0x182be4[_0xbd5f('0x4b')]['includeAll']){_0x5b72da[_0xbd5f('0x5c')]=[{'all':!![]}];}return db[_0xbd5f('0x73')][_0xbd5f('0x5d')](_0x5b72da);})[_0xbd5f('0x22')](function(_0xad34f9){_0x1415cd['rows']=_0xad34f9;return _0x1415cd;});}})[_0xbd5f('0x22')](respondWithFilteredResult(_0x3113e3,_0x5b72da))['catch'](handleError(_0x3113e3,null));};exports[_0xbd5f('0x74')]=function(_0x3962dd,_0x2e957b,_0x3694b7){return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x3962dd['params']['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x2e957b,null))['then'](function(_0x551ea3){if(_0x551ea3){return _0x551ea3['removeAnswers'](_0x3962dd[_0xbd5f('0x4b')][_0xbd5f('0x71')]);}})[_0xbd5f('0x22')](respondWithStatusCode(_0x2e957b,null))[_0xbd5f('0x2c')](handleError(_0x2e957b,null));};exports[_0xbd5f('0x75')]=function(_0x265f91,_0x3bbf1e,_0x3f7d2d){var _0x42a2b7={'channel':_0xbd5f('0x76')};var _0x4c6bec=[];var _0x41876a=[];var _0x3b6616={};return db[_0xbd5f('0x46')]['find']({'where':{'id':_0x265f91['params']['id']},'include':[{'model':db[_0xbd5f('0x77')],'as':'Applications'}]})[_0xbd5f('0x22')](handleEntityNotFound(_0x3bbf1e,null))['then'](function(_0x4ecfa6){_0x42a2b7['account']=_0x4ecfa6;_0x42a2b7['applications']=_[_0xbd5f('0x78')](_0x4ecfa6[_0xbd5f('0x79')],[_0xbd5f('0x7a')],['asc']);if(_0x42a2b7[_0xbd5f('0x7b')][_0xbd5f('0x79')]){delete _0x42a2b7[_0xbd5f('0x7b')]['Applications'];}return db[_0xbd5f('0x7c')][_0xbd5f('0x6b')]();})[_0xbd5f('0x22')](function(_0x4dce34){if(!_0x4dce34){throw new db[(_0xbd5f('0x7d'))][(_0xbd5f('0x7e'))](_0xbd5f('0x7f'));}_0x4c6bec=_['difference'](_[_0xbd5f('0x60')](_0x4dce34),[_0xbd5f('0x80'),_0xbd5f('0x81')]);_0x41876a=_[_0xbd5f('0x82')](_['keys'](_0x4dce34),['createdAt',_0xbd5f('0x81'),_0xbd5f('0x83'),'ListId']);_0x42a2b7[_0xbd5f('0x69')]={'mapKey':_0xbd5f('0x84')};if(_0x42a2b7['account'][_0xbd5f('0x49')]){switch(_0x42a2b7[_0xbd5f('0x7b')][_0xbd5f('0x49')]){case _0xbd5f('0x85'):_0x42a2b7['body'][_0xbd5f('0x86')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x87')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x88')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')]['MessageSid'];break;case'skebby':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')]='+'+_0x265f91['body'][_0xbd5f('0x8a')];_0x42a2b7['body'][_0xbd5f('0x69')]=_0x265f91['body'][_0xbd5f('0x8b')];break;case'connectel':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x86')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x29')];break;case'clicksend':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x86')];_0x42a2b7['body'][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x69')];_0x42a2b7['body'][_0xbd5f('0x89')]=_0x265f91['body'][_0xbd5f('0x8c')];break;case _0xbd5f('0x8d'):_0x42a2b7[_0xbd5f('0x69')]['from']=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x87')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91['body'][_0xbd5f('0x8e')];_0x42a2b7['body'][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')]['MessageUUID'];break;case _0xbd5f('0x8f'):_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')]='+'+_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x90')][0x0][_0xbd5f('0x86')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x90')][0x0][_0xbd5f('0x8b')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x90')][0x0][_0xbd5f('0x89')];break;case'csc':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')]=_0x265f91[_0xbd5f('0x69')]['originatingAddress'];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x91')][_0xbd5f('0x29')];break;case'clickatell':_0x42a2b7['body'][_0xbd5f('0x86')]=_0x265f91['body'][_0xbd5f('0x92')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x8b')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x93')];break;case _0xbd5f('0x94'):_0x42a2b7['body'][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')][0x0][_0xbd5f('0x29')]['id'];_0x42a2b7['body'][_0xbd5f('0x86')]=_0x265f91['body'][0x0]['message'][_0xbd5f('0x86')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][0x0][_0xbd5f('0x29')][_0xbd5f('0x8b')];break;case'intelepeer':_0x42a2b7['body'][_0xbd5f('0x86')]=_0x265f91[_0xbd5f('0x69')]['from'];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x69')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x29')];_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x89')]=_0x265f91[_0xbd5f('0x69')][_0xbd5f('0x95')];break;}}if(_0x42a2b7[_0xbd5f('0x69')]['id']){delete _0x42a2b7['body']['id'];}if(_[_0xbd5f('0x96')](_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')])){throw new db['Sequelize']['ValidationError'](_0xbd5f('0x97'));}if(_['isNil'](_0x42a2b7[_0xbd5f('0x69')]['body'])||_0x42a2b7['body']['body']===''){throw new db['Sequelize'][(_0xbd5f('0x7e'))](_0xbd5f('0x98'));}if(_['isNil'](_0x42a2b7[_0xbd5f('0x69')]['mapKey'])){throw new db['Sequelize'][(_0xbd5f('0x7e'))](_0xbd5f('0x99')+_0x41876a);}if(!_['includes'](_0x41876a,_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x9a')])){throw new db['Sequelize'][(_0xbd5f('0x7e'))](_0xbd5f('0x9b')+_0x41876a);}_0x3b6616[_0x42a2b7['body']['mapKey']]=_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')];return db[_0xbd5f('0x9c')]['find']({'where':{'id':_0x42a2b7[_0xbd5f('0x7b')][_0xbd5f('0x9d')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3b6616,'limit':0x1,'order':[[_0xbd5f('0x81'),_0xbd5f('0x9e')]]}]});})[_0xbd5f('0x22')](handleEntityNotFound(_0x3bbf1e,null))[_0xbd5f('0x22')](function(_0xdf5f60){if(_0xdf5f60){_0x42a2b7['list']=_['omit'](_0xdf5f60,[_0xbd5f('0x9f')]);if(_0xdf5f60[_0xbd5f('0x9f')]['length']){return _0xdf5f60[_0xbd5f('0x9f')][0x0];}var _0x1b4d04=_[_0xbd5f('0x1a')](_0x42a2b7[_0xbd5f('0x69')],{'firstName':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x86')],'ListId':_0xdf5f60['id']});_0x1b4d04[_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x9a')]]=_0x42a2b7[_0xbd5f('0x69')]['from'];return db[_0xbd5f('0x7c')][_0xbd5f('0x62')](_0x1b4d04,{'fields':_0x4c6bec,'raw':!![]});}})['then'](handleEntityNotFound(_0x3bbf1e,null))[_0xbd5f('0x22')](function(_0x100735){if(_0x100735){_0x42a2b7[_0xbd5f('0xa0')]=_0x100735;var _0x41f7e7={'ContactId':_0x100735['id'],'phone':_0x42a2b7['body'][_0xbd5f('0x86')],'SmsAccountId':_0x265f91[_0xbd5f('0x5f')]['id']};var _0x143fc6={'ContactId':_0x100735['id'],'SmsAccountId':_0x265f91[_0xbd5f('0x5f')]['id'],'closed':![]};return db[_0xbd5f('0xa1')][_0xbd5f('0x6a')]({'where':_0x143fc6})[_0xbd5f('0x22')](function(_0x2a5da1){if(_0x2a5da1){return[_0x2a5da1,![]];}return db[_0xbd5f('0xa1')][_0xbd5f('0x62')](_0x41f7e7)[_0xbd5f('0x22')](function(_0x481107){return[_0x481107,!![]];});});}})[_0xbd5f('0xa2')](function(_0x3cd679,_0x2f53e2){_0x42a2b7['interaction']=_0x3cd679['get']({'plain':!![]});_0x42a2b7['interaction']['created']=![];if(_0x2f53e2){if(_0x42a2b7['account']['autoclose']){_0x42a2b7[_0xbd5f('0xa3')][_0xbd5f('0xa4')]({'id':0x0,'priority':_0x42a2b7[_0xbd5f('0xa3')][_0xbd5f('0x61')]+0x1,'app':_0xbd5f('0xa5'),'appdata':_0xbd5f('0xa6'),'interval':'*,*,*,*'});}_0x42a2b7['interaction'][_0xbd5f('0xa7')]=!![];}return db[_0xbd5f('0xa8')][_0xbd5f('0x62')]({'phone':_0x42a2b7['body'][_0xbd5f('0x86')],'messageId':_0x42a2b7[_0xbd5f('0x69')][_0xbd5f('0x89')],'body':_0x42a2b7['body'][_0xbd5f('0x69')],'SmsAccountId':_0x265f91['params']['id'],'SmsInteractionId':_0x3cd679['id'],'direction':'in','ContactId':_0x3cd679[_0xbd5f('0xa9')],'AttachmentId':_0x42a2b7[_0xbd5f('0x69')]['AttachmentId']});})[_0xbd5f('0x22')](function(_0x13e592){_0x42a2b7[_0xbd5f('0x29')]=_0x13e592;if(_0x42a2b7[_0xbd5f('0xaa')][_0xbd5f('0xab')]){return db[_0xbd5f('0xac')][_0xbd5f('0x6a')]({'attributes':['id','name'],'where':{'id':_0x42a2b7['interaction'][_0xbd5f('0xab')]}})[_0xbd5f('0x22')](function(_0x435bbe){if(_0x435bbe){_0x42a2b7[_0xbd5f('0xa3')][_0xbd5f('0xad')]({'id':0x0,'priority':0x0,'app':_0xbd5f('0xae'),'appdata':_0x435bbe[_0xbd5f('0x40')]+','+(_0x42a2b7['account'][_0xbd5f('0xaf')]||0xa),'interval':_0xbd5f('0xb0')});}return respondWithRpcPromise('Start','startRouting',_0x42a2b7);});}return respondWithRpcPromise('Start',_0xbd5f('0xb1'),_0x42a2b7);})['then'](function(_0x2b9d94){if(_0x2b9d94){var _0x18c495=0xc8;var _0x49fc4d='receiveMessage';logger[_0xbd5f('0x2a')](_0xbd5f('0xb2'),_0x49fc4d,_0x18c495,_0xbd5f('0xb3'));logger['debug'](_0xbd5f('0xb4'),_0x49fc4d,_0x18c495,_0xbd5f('0xb3'),JSON[_0xbd5f('0x26')](_0x2b9d94));if(_0x42a2b7[_0xbd5f('0x7b')][_0xbd5f('0x49')]==='twilio'){return _0x3bbf1e[_0xbd5f('0x2e')](_0x18c495)[_0xbd5f('0x35')](_0xbd5f('0xb5'),_0xbd5f('0xb6'))['send'](_0xbd5f('0xb7'));}else{return _0x3bbf1e['status'](_0x18c495)[_0xbd5f('0x30')](_0x2b9d94);}}})[_0xbd5f('0x2c')](handleError(_0x3bbf1e,null));};exports[_0xbd5f('0xb8')]=function(_0x95d774,_0x49bb13,_0x4d7209){return db['SmsAccount'][_0xbd5f('0x6d')]({'where':{'id':_0x95d774[_0xbd5f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x49bb13,null))['then'](function(_0x3ca55f){if(_0x3ca55f){return db[_0xbd5f('0xb9')][_0xbd5f('0xba')](function(_0xb616e6){return db[_0xbd5f('0x77')][_0xbd5f('0x3b')]({'where':{'SmsAccountId':_0x95d774[_0xbd5f('0x5f')]['id']},'transaction':_0xb616e6})[_0xbd5f('0x22')](function(_0x42a021){var _0x5cc6fd=_['map'](_0x95d774[_0xbd5f('0x69')],function(_0x44233f){_0x44233f[_0xbd5f('0x6e')]=_0x95d774[_0xbd5f('0x5f')]['id'];return _0x44233f;});return db[_0xbd5f('0x77')]['bulkCreate'](_0x5cc6fd,{'transaction':_0xb616e6});});})['then'](function(){return db[_0xbd5f('0x77')][_0xbd5f('0xbb')]({'where':{'SmsAccountId':_0x95d774[_0xbd5f('0x5f')]['id']},'order':_0xbd5f('0x7a')});});}})['then'](respondWithResult(_0x49bb13,null))[_0xbd5f('0x2c')](handleError(_0x49bb13,null));};exports[_0xbd5f('0xbc')]=function(_0x52c5dc,_0x2a830e,_0x3bfe46){var _0x476104={};var _0x216b81={};var _0x52e6cd;var _0x65b09a;return db['SmsAccount'][_0xbd5f('0x6d')]({'where':{'id':_0x52c5dc[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x2a830e,null))[_0xbd5f('0x22')](function(_0x553bb4){if(_0x553bb4){_0x52e6cd=_0x553bb4;_0x216b81[_0xbd5f('0x4d')]=_[_0xbd5f('0x60')](db[_0xbd5f('0x77')][_0xbd5f('0x47')]);_0x216b81[_0xbd5f('0x4b')]=_[_0xbd5f('0x60')](_0x52c5dc[_0xbd5f('0x4b')]);_0x216b81[_0xbd5f('0x55')]=_[_0xbd5f('0x4c')](_0x216b81[_0xbd5f('0x4d')],_0x216b81[_0xbd5f('0x4b')]);_0x476104[_0xbd5f('0x4f')]=_[_0xbd5f('0x4c')](_0x216b81[_0xbd5f('0x4d')],qs[_0xbd5f('0x4e')](_0x52c5dc[_0xbd5f('0x4b')]['fields']));_0x476104['attributes']=_0x476104['attributes'][_0xbd5f('0x61')]?_0x476104[_0xbd5f('0x4f')]:_0x216b81[_0xbd5f('0x4d')];_0x476104['order']=qs['sort'](_0x52c5dc[_0xbd5f('0x4b')]['sort']);_0x476104[_0xbd5f('0x54')]=qs[_0xbd5f('0x55')](_[_0xbd5f('0x56')](_0x52c5dc[_0xbd5f('0x4b')],_0x216b81[_0xbd5f('0x55')]));if(_0x52c5dc[_0xbd5f('0x4b')][_0xbd5f('0x58')]){_0x476104[_0xbd5f('0x54')]=_[_0xbd5f('0x59')](_0x476104['where'],{'$or':_[_0xbd5f('0x45')](_0x476104[_0xbd5f('0x4f')],function(_0x42a107){var _0x3f4cd3={};_0x3f4cd3[_0x42a107]={'$like':'%'+_0x52c5dc[_0xbd5f('0x4b')][_0xbd5f('0x58')]+'%'};return _0x3f4cd3;})});}_0x476104=_[_0xbd5f('0x59')]({},_0x476104,_0x52c5dc[_0xbd5f('0x5a')]);return _0x52e6cd[_0xbd5f('0xbc')](_0x476104);}})[_0xbd5f('0x22')](function(_0x15bfb1){if(_0x15bfb1){_0x65b09a=_0x15bfb1[_0xbd5f('0x61')];if(!_0x52c5dc[_0xbd5f('0x4b')][_0xbd5f('0x50')]('nolimit')){_0x476104[_0xbd5f('0x33')]=qs[_0xbd5f('0x33')](_0x52c5dc[_0xbd5f('0x4b')][_0xbd5f('0x33')]);_0x476104[_0xbd5f('0x31')]=qs[_0xbd5f('0x31')](_0x52c5dc[_0xbd5f('0x4b')][_0xbd5f('0x31')]);}return _0x52e6cd[_0xbd5f('0xbc')](_0x476104);}})[_0xbd5f('0x22')](function(_0x38f599){if(_0x38f599){return _0x38f599?{'count':_0x65b09a,'rows':_0x38f599}:null;}})[_0xbd5f('0x22')](respondWithResult(_0x2a830e,null))['catch'](handleError(_0x2a830e,null));};exports[_0xbd5f('0xbd')]=function(_0x4f493c,_0x809e2f,_0x5c39ff){var _0x45043c={'raw':![],'where':{}};var _0x5c99c2={};var _0x232668={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4f493c[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x809e2f,null))[_0xbd5f('0x22')](function(_0x3d510d){if(_0x3d510d){_0x5c99c2[_0xbd5f('0x4d')]=_[_0xbd5f('0x60')](db['SmsInteraction'][_0xbd5f('0x47')]);_0x5c99c2[_0xbd5f('0x4b')]=_[_0xbd5f('0x60')](_0x4f493c[_0xbd5f('0x4b')]);_0x5c99c2['filters']=_[_0xbd5f('0x4c')](_0x5c99c2[_0xbd5f('0x4d')],_0x5c99c2[_0xbd5f('0x4b')]);_0x45043c[_0xbd5f('0x4f')]=_['intersection'](_0x5c99c2[_0xbd5f('0x4d')],qs['fields'](_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x4e')]));_0x45043c['attributes']=_0x45043c['attributes'][_0xbd5f('0x61')]?_0x45043c[_0xbd5f('0x4f')]:_0x5c99c2['model'];if(!_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x50')](_0xbd5f('0x51'))){_0x45043c['limit']=qs[_0xbd5f('0x33')](_0x4f493c[_0xbd5f('0x4b')]['limit']);_0x45043c[_0xbd5f('0x31')]=qs[_0xbd5f('0x31')](_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x31')]);}_0x45043c[_0xbd5f('0x52')]=qs['sort'](_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x53')]);_0x45043c[_0xbd5f('0x54')]=qs[_0xbd5f('0x55')](_['pick'](_0x4f493c['query'],_0x5c99c2[_0xbd5f('0x55')]));_0x45043c[_0xbd5f('0x54')][_0xbd5f('0x6e')]=_0x3d510d['id'];if(_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x58')]){_0x45043c[_0xbd5f('0x54')]=_[_0xbd5f('0x59')](_0x45043c[_0xbd5f('0x54')],{'$or':_[_0xbd5f('0x45')](_0x45043c[_0xbd5f('0x4f')],function(_0x4a2462){var _0x24dfa7={};_0x24dfa7[_0x4a2462]={'$like':'%'+_0x4f493c[_0xbd5f('0x4b')]['filter']+'%'};return _0x24dfa7;})});}_0x45043c=_[_0xbd5f('0x59')]({},_0x45043c,_0x4f493c['options']);return db[_0xbd5f('0xa1')]['count']({'where':_0x45043c[_0xbd5f('0x54')]})['then'](function(_0x1a369a){_0x232668[_0xbd5f('0x34')]=_0x1a369a;if(_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0x5b')]){_0x45043c[_0xbd5f('0x5c')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xbd5f('0xac')],'as':_0xbd5f('0xbe'),'attributes':[_0xbd5f('0x40'),_0xbd5f('0xbf'),_0xbd5f('0xc0')],'required':![]},{'model':db[_0xbd5f('0xc1')],'as':_0xbd5f('0xc2'),'attributes':['id',_0xbd5f('0x40'),_0xbd5f('0xc3')],'where':_0x4f493c[_0xbd5f('0x4b')][_0xbd5f('0xc4')]?{'id':_0x4f493c['query']['tag']}:undefined,'required':_0x4f493c[_0xbd5f('0x4b')]['tag']?!![]:![]}];}return db[_0xbd5f('0xa1')]['findAll'](_0x45043c);})[_0xbd5f('0x22')](function(_0x1ece0f){_0x232668[_0xbd5f('0x6f')]=_0x1ece0f;return _0x232668;});}})[_0xbd5f('0x22')](respondWithFilteredResult(_0x809e2f,_0x45043c))[_0xbd5f('0x2c')](handleError(_0x809e2f,null));};exports[_0xbd5f('0x41')]=function(_0xd9ad79,_0x248c29,_0x9cf16a){var _0xc41bb5,_0x307952,_0x5636b6;if(_[_0xbd5f('0x96')](_0xd9ad79[_0xbd5f('0x69')][_0xbd5f('0x69')])||_0xd9ad79['body'][_0xbd5f('0x69')]===''){throw new db[(_0xbd5f('0x7d'))]['ValidationError'](_0xbd5f('0x98'));}if(_[_0xbd5f('0x96')](_0xd9ad79[_0xbd5f('0x69')]['to'])){throw new db[(_0xbd5f('0x7d'))][(_0xbd5f('0x7e'))](_0xbd5f('0xc5'));}_0xc41bb5=_0xd9ad79[_0xbd5f('0x69')]['to'];return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0xd9ad79[_0xbd5f('0x5f')]['id']},'include':[{'model':db[_0xbd5f('0x9c')],'as':_0xbd5f('0xc6'),'include':[{'model':db[_0xbd5f('0x7c')],'as':_0xbd5f('0x9f'),'where':{'mobile':_0xc41bb5},'limit':0x1,'order':[[_0xbd5f('0x81'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x248c29,null))[_0xbd5f('0x22')](function(_0x3954da){if(_0x3954da&&_0x3954da[_0xbd5f('0xc6')]){_0x307952=_0x3954da[_0xbd5f('0x3c')]({'plain':!![]});if(_0x307952[_0xbd5f('0xc6')]&&_0x307952[_0xbd5f('0xc6')][_0xbd5f('0x9f')]['length']){return _0x307952[_0xbd5f('0xc6')][_0xbd5f('0x9f')][0x0];}return db[_0xbd5f('0x7c')][_0xbd5f('0x62')](_['defaults'](_0xd9ad79[_0xbd5f('0x69')],{'firstName':_0xc41bb5,'mobile':_0xc41bb5,'phone':_0xc41bb5,'ListId':_0x307952[_0xbd5f('0x9d')]}));}})[_0xbd5f('0x22')](handleEntityNotFound(_0x248c29,null))[_0xbd5f('0x22')](function(_0x4df7c5){if(_0x4df7c5){_0x5636b6=_0x4df7c5;return db[_0xbd5f('0xa1')][_0xbd5f('0x6a')]({'where':{'ContactId':_0x5636b6['id'],'closed':![],'SmsAccountId':_0x307952['id']}})[_0xbd5f('0x22')](function(_0x50ca67){if(_0x50ca67){return[_0x50ca67,![]];}return db['SmsInteraction'][_0xbd5f('0x62')]({'UserId':_0xd9ad79['user']['id'],'ContactId':_0x5636b6['id'],'SmsAccountId':_0x307952['id'],'phone':_0xc41bb5,'firstMsgDirection':_0xbd5f('0xc7'),'Messages':[_[_0xbd5f('0x59')](_0xd9ad79[_0xbd5f('0x69')],{'read':![],'body':_0xd9ad79[_0xbd5f('0x69')][_0xbd5f('0x69')],'phone':_0xc41bb5,'SmsAccountId':_0x307952['id'],'UserId':_0xd9ad79['user']['id'],'ContactId':_0x5636b6['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xbd5f('0x22')](function(_0x4518d0){return[_0x4518d0,!![]];});});}})[_0xbd5f('0xa2')](function(_0x5bfe93,_0x4f915d){if(_0x4f915d){return _0x5bfe93;}return db[_0xbd5f('0xa8')]['create'](_['merge'](_0xd9ad79[_0xbd5f('0x69')],{'read':![],'body':_0xd9ad79[_0xbd5f('0x69')][_0xbd5f('0x69')],'phone':_0xc41bb5,'SmsAccountId':_0x307952['id'],'SmsInteractionId':_0x5bfe93['id'],'UserId':_0xd9ad79['user']['id'],'ContactId':_0x5636b6['id']}))[_0xbd5f('0x22')](function(_0x2419a8){_0x5bfe93[_0xbd5f('0xc8')]['Messages']=[];_0x5bfe93[_0xbd5f('0xc8')]['Messages'][_0xbd5f('0xa4')](_0x2419a8[_0xbd5f('0xc8')]);return _0x5bfe93;});})['then'](respondWithResult(_0x248c29,null))[_0xbd5f('0x2c')](handleError(_0x248c29,null));};exports['status']=function(_0x59b8be,_0x3a694b,_0x1d01f5){if(_0x59b8be[_0xbd5f('0x69')]['id']){delete _0x59b8be[_0xbd5f('0x69')]['id'];}var _0x9c646c,_0x5b441a,_0x2252ca;return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x59b8be[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x3a694b,null))[_0xbd5f('0x22')](function(_0x583e0a){if(_0x583e0a){_0x2252ca=_0x583e0a;logger['debug'](_0xbd5f('0xb2'),_0xbd5f('0x2e'),'received\x20delivery\x20report\x20from',_0x583e0a[_0xbd5f('0x49')],util['inspect'](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));switch(_0x583e0a['type']){case _0xbd5f('0xc9'):if(_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xca')]&&_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x2e')]){_0x5b441a=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x2e')];return db[_0xbd5f('0xa8')]['find']({'where':{'messageId':_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xca')]}});}break;case _0xbd5f('0xcb'):if(_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xcc')]&&_0x59b8be[_0xbd5f('0x69')]['statusInt']){_0x5b441a=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xcd')];return db[_0xbd5f('0xa8')][_0xbd5f('0x6a')]({'where':{'messageId':_0x59b8be['body'][_0xbd5f('0xcc')]}});}break;case _0xbd5f('0xce'):if(_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x8c')]&&_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xcf')]){_0x5b441a=_0x59b8be['body'][_0xbd5f('0xcf')];return db['SmsMessage'][_0xbd5f('0x6a')]({'where':{'messageId':_0x59b8be['body'][_0xbd5f('0x8c')]}});}break;case _0xbd5f('0x8f'):var _0x49b596=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x90')][0x0];if(_0x49b596[_0xbd5f('0x89')]&&_0x49b596['status']['groupName']==='DELIVERED'){_0x5b441a=_0x49b596[_0xbd5f('0x2e')]['groupName'];return db[_0xbd5f('0xa8')][_0xbd5f('0x6a')]({'where':{'messageId':_0x49b596[_0xbd5f('0x89')]}});}break;case _0xbd5f('0xd0'):if(_0x59b8be[_0xbd5f('0x69')]['messageId']&&_0x59b8be['body']['status']){_0x5b441a=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x2e')];return db[_0xbd5f('0xa8')][_0xbd5f('0x6a')]({'where':{'messageId':_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x89')]}});}break;case _0xbd5f('0x94'):if(_0x59b8be[_0xbd5f('0x69')][0x0][_0xbd5f('0x29')]['id']){_0x5b441a=_0x59b8be[_0xbd5f('0x69')][0x0][_0xbd5f('0x49')];return db[_0xbd5f('0xa8')][_0xbd5f('0x6a')]({'where':{'messageId':_0x59b8be['body'][0x0]['message']['id']}});}break;case _0xbd5f('0xd1'):if(_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xd2')]&&_0x59b8be['body'][_0xbd5f('0x2e')]){_0x5b441a=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x2e')];return db[_0xbd5f('0xa8')][_0xbd5f('0x6a')]({'where':{'messageId':_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0xd2')]}});}break;}}})[_0xbd5f('0x22')](handleEntityNotFound(_0x3a694b,null))['then'](function(_0x45225c){if(_0x45225c){_0x9c646c=_0x45225c;switch(_0x2252ca[_0xbd5f('0x49')]){case _0xbd5f('0xc9'):if(_0x5b441a===_0xbd5f('0xd3')){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger[_0xbd5f('0x27')](_0xbd5f('0xb2'),'status',_0xbd5f('0xc9'),util[_0xbd5f('0xd4')](_0x59b8be['body'],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0xcb'):if(_0x5b441a==='1'){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger[_0xbd5f('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xbd5f('0xc9'),util[_0xbd5f('0xd4')](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0xce'):if(!_0x59b8be[_0xbd5f('0x69')]['error_code']&&_0x5b441a>=0xc8&&_0x5b441a<=0xce){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger[_0xbd5f('0x27')](_0xbd5f('0xb2'),'status',_0xbd5f('0xce'),util[_0xbd5f('0xd4')](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0x8f'):var _0x251ec1=_0x59b8be[_0xbd5f('0x69')][_0xbd5f('0x90')][0x0];if(_0x251ec1[_0xbd5f('0x2e')][_0xbd5f('0xd5')]==='DELIVERED'){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbd5f('0x2e'),_0xbd5f('0x8f'),util[_0xbd5f('0xd4')](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0xd0'):if(_0x5b441a==_0xbd5f('0xd6')||_0x5b441a=='RECEIVED_BY_RECIPIENT'){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger[_0xbd5f('0x27')](_0xbd5f('0xb2'),_0xbd5f('0x2e'),'clickatell',util['inspect'](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0x94'):if(_0x5b441a==_0xbd5f('0xd7')){return _0x9c646c['update']({'read':!![]});}else{logger['error'](_0xbd5f('0xb2'),_0xbd5f('0x2e'),'bandwidth',util[_0xbd5f('0xd4')](_0x59b8be[_0xbd5f('0x69')],{'showHidden':![],'depth':null}));}break;case _0xbd5f('0xd1'):if(_0x5b441a==='DELIVRD'||_0x5b441a===_0xbd5f('0xd8')){return _0x9c646c[_0xbd5f('0x3a')]({'read':!![]});}else{logger[_0xbd5f('0x27')](_0xbd5f('0xb2'),_0xbd5f('0x2e'),_0xbd5f('0xd1'),util[_0xbd5f('0xd4')](_0x59b8be['body'],{'showHidden':![],'depth':null}));}break;}return _0x9c646c;}})[_0xbd5f('0x22')](respondWithResult(_0x3a694b,null))[_0xbd5f('0x2c')](handleError(_0x3a694b,null));};exports[_0xbd5f('0xd9')]=function(_0x179792,_0x1b4392,_0x13f5e4){var _0x1705b2,_0x563ebf,_0x2b9180;return db['SmsAccount'][_0xbd5f('0x6a')]({'where':{'id':_0x179792[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x1b4392,null))['then'](function(_0x133589){if(_0x133589){_0x2b9180=_0x133589;logger['debug'](_0xbd5f('0xb2'),_0xbd5f('0x2e'),_0xbd5f('0xda'),_0x133589[_0xbd5f('0x49')],util['inspect'](_0x179792[_0xbd5f('0x4b')],{'showHidden':![],'depth':null}));switch(_0x133589[_0xbd5f('0x49')]){case _0xbd5f('0xdb'):if(_0x179792['query'][_0xbd5f('0xdc')]&&_0x179792[_0xbd5f('0x4b')][_0xbd5f('0xdd')]){_0x563ebf=_0x179792[_0xbd5f('0x4b')]['state'];return db[_0xbd5f('0xa8')]['find']({'where':{'messageId':_0x179792['query'][_0xbd5f('0xdc')]}});}break;}}})[_0xbd5f('0x22')](handleEntityNotFound(_0x1b4392,null))[_0xbd5f('0x22')](function(_0x388f15){if(_0x388f15){_0x1705b2=_0x388f15;switch(_0x2b9180['type']){case _0xbd5f('0xdb'):if(_0x563ebf==='2'||_0x563ebf==='6'){return _0x1705b2[_0xbd5f('0x3a')]({'read':!![]});}else{logger['error'](_0xbd5f('0xb2'),_0xbd5f('0x2e'),_0xbd5f('0xdb'),util[_0xbd5f('0xd4')](_0x179792['query'],{'showHidden':![],'depth':null}));};break;}return _0x1705b2;}})[_0xbd5f('0x22')](respondWithResult(_0x1b4392,null))[_0xbd5f('0x2c')](handleError(_0x1b4392,null));};exports[_0xbd5f('0xde')]=function(_0x1d9a8d,_0x3ff809,_0x1a09fb){return db[_0xbd5f('0x46')]['find']({'where':{'id':_0x1d9a8d[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x3ff809,null))['then'](function(_0x8891d){if(_0x8891d){return _0x8891d[_0xbd5f('0xde')](_0x1d9a8d['body'][_0xbd5f('0x71')],_[_0xbd5f('0xdf')](_0x1d9a8d[_0xbd5f('0x69')],['ids','id'])||{})['spread'](function(_0xfe534d){for(var _0x4e53a6=0x0;_0x4e53a6<_0x1d9a8d[_0xbd5f('0x69')][_0xbd5f('0x71')]['length'];_0x4e53a6+=0x1){socket[_0xbd5f('0xe0')](_0xbd5f('0xe1'),{'UserId':Number(_0x1d9a8d[_0xbd5f('0x69')]['ids'][_0x4e53a6]),'SmsAccountId':Number(_0x1d9a8d[_0xbd5f('0x5f')]['id'])});}return _0xfe534d;});}})[_0xbd5f('0x22')](respondWithResult(_0x3ff809,null))[_0xbd5f('0x2c')](handleError(_0x3ff809,null));};exports[_0xbd5f('0xe2')]=function(_0x2c57c8,_0x433de2,_0x42bfba){return db[_0xbd5f('0x46')][_0xbd5f('0x6a')]({'where':{'id':_0x2c57c8[_0xbd5f('0x5f')]['id']}})[_0xbd5f('0x22')](handleEntityNotFound(_0x433de2,null))[_0xbd5f('0x22')](function(_0x209003){if(_0x209003){return _0x209003['removeAgents'](_0x2c57c8[_0xbd5f('0x4b')]['ids'])['then'](function(){if(_['isArray'](_0x2c57c8['query']['ids'])){for(var _0x2a0fa9=0x0;_0x2a0fa9<_0x2c57c8['query'][_0xbd5f('0x71')][_0xbd5f('0x61')];_0x2a0fa9+=0x1){socket[_0xbd5f('0xe0')](_0xbd5f('0xe3'),{'UserId':Number(_0x2c57c8[_0xbd5f('0x4b')][_0xbd5f('0x71')][_0x2a0fa9]),'SmsAccountId':Number(_0x2c57c8['params']['id'])});}}else{socket[_0xbd5f('0xe0')](_0xbd5f('0xe3'),{'UserId':Number(_0x2c57c8[_0xbd5f('0x4b')]['ids']),'SmsAccountId':Number(_0x2c57c8[_0xbd5f('0x5f')]['id'])});}});}})[_0xbd5f('0x22')](respondWithStatusCode(_0x433de2,null))[_0xbd5f('0x2c')](handleError(_0x433de2,null));};exports[_0xbd5f('0xe4')]=function(_0x9a6cf5,_0x4456ad,_0x21fbea){var _0x5be0b2={};var _0x10bee8={};var _0x5ab99f;var _0x2f85c9;return db[_0xbd5f('0x46')][_0xbd5f('0x6d')]({'where':{'id':_0x9a6cf5['params']['id']}})['then'](handleEntityNotFound(_0x4456ad,null))[_0xbd5f('0x22')](function(_0x3081d7){if(_0x3081d7){_0x5ab99f=_0x3081d7;_0x10bee8[_0xbd5f('0x4d')]=_[_0xbd5f('0x60')](db['User'][_0xbd5f('0x47')]);_0x10bee8[_0xbd5f('0x4b')]=_[_0xbd5f('0x60')](_0x9a6cf5[_0xbd5f('0x4b')]);_0x10bee8[_0xbd5f('0x55')]=_[_0xbd5f('0x4c')](_0x10bee8[_0xbd5f('0x4d')],_0x10bee8[_0xbd5f('0x4b')]);_0x5be0b2[_0xbd5f('0x4f')]=_[_0xbd5f('0x4c')](_0x10bee8[_0xbd5f('0x4d')],qs[_0xbd5f('0x4e')](_0x9a6cf5[_0xbd5f('0x4b')][_0xbd5f('0x4e')]));_0x5be0b2[_0xbd5f('0x4f')]=_0x5be0b2['attributes'][_0xbd5f('0x61')]?_0x5be0b2['attributes']:_0x10bee8[_0xbd5f('0x4d')];_0x5be0b2[_0xbd5f('0x52')]=qs[_0xbd5f('0x53')](_0x9a6cf5[_0xbd5f('0x4b')][_0xbd5f('0x53')]);_0x5be0b2[_0xbd5f('0x54')]=qs['filters'](_[_0xbd5f('0x56')](_0x9a6cf5['query'],_0x10bee8[_0xbd5f('0x55')]));if(_0x9a6cf5['query'][_0xbd5f('0x58')]){_0x5be0b2[_0xbd5f('0x54')]=_[_0xbd5f('0x59')](_0x5be0b2[_0xbd5f('0x54')],{'$or':_[_0xbd5f('0x45')](_0x5be0b2['attributes'],function(_0x5e777){var _0x1dd3a7={};_0x1dd3a7[_0x5e777]={'$like':'%'+_0x9a6cf5[_0xbd5f('0x4b')][_0xbd5f('0x58')]+'%'};return _0x1dd3a7;})});}_0x5be0b2=_['merge']({},_0x5be0b2,_0x9a6cf5[_0xbd5f('0x5a')]);return _0x5ab99f['getAgents'](_0x5be0b2);}})[_0xbd5f('0x22')](function(_0xf14601){if(_0xf14601){_0x2f85c9=_0xf14601['length'];if(!_0x9a6cf5['query'][_0xbd5f('0x50')](_0xbd5f('0x51'))){_0x5be0b2[_0xbd5f('0x33')]=qs[_0xbd5f('0x33')](_0x9a6cf5[_0xbd5f('0x4b')][_0xbd5f('0x33')]);_0x5be0b2[_0xbd5f('0x31')]=qs[_0xbd5f('0x31')](_0x9a6cf5[_0xbd5f('0x4b')][_0xbd5f('0x31')]);}return _0x5ab99f[_0xbd5f('0xe4')](_0x5be0b2);}})[_0xbd5f('0x22')](function(_0x11f8d8){if(_0x11f8d8){return _0x11f8d8?{'count':_0x2f85c9,'rows':_0x11f8d8}:null;}})[_0xbd5f('0x22')](respondWithResult(_0x4456ad,null))[_0xbd5f('0x2c')](handleError(_0x4456ad,null));}; \ No newline at end of file +var _0x39aa=['from','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','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','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','tag','List','updatedAt','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','SmsAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','catch','update','body','params','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','twilio','From','messageId','MessageSid','skebby'];(function(_0x13f1e8,_0x1ae894){var _0x95f64d=function(_0x4f74f5){while(--_0x4f74f5){_0x13f1e8['push'](_0x13f1e8['shift']());}};_0x95f64d(++_0x1ae894);}(_0x39aa,0x149));var _0xa39a=function(_0x342548,_0x31c72e){_0x342548=_0x342548-0x0;var _0x107140=_0x39aa[_0x342548];return _0x107140;};'use strict';var emlformat=require(_0xa39a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa39a('0x1'));var jsonpatch=require(_0xa39a('0x2'));var rp=require(_0xa39a('0x3'));var moment=require('moment');var BPromise=require(_0xa39a('0x4'));var Mustache=require('mustache');var util=require(_0xa39a('0x5'));var path=require(_0xa39a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa39a('0x7'));var fs=require('fs');var fs_extra=require(_0xa39a('0x8'));var _=require(_0xa39a('0x9'));var squel=require('squel');var crypto=require(_0xa39a('0xa'));var jsforce=require(_0xa39a('0xb'));var deskjs=require(_0xa39a('0xc'));var toCsv=require(_0xa39a('0xd'));var querystring=require(_0xa39a('0xe'));var Papa=require(_0xa39a('0xf'));var Redis=require(_0xa39a('0x10'));var authService=require(_0xa39a('0x11'));var qs=require(_0xa39a('0x12'));var as=require(_0xa39a('0x13'));var hardwareService=require(_0xa39a('0x14'));var logger=require(_0xa39a('0x15'))(_0xa39a('0x16'));var utils=require(_0xa39a('0x17'));var config=require(_0xa39a('0x18'));var licenseUtil=require(_0xa39a('0x19'));var db=require('../../mysqldb')['db'];config[_0xa39a('0x1a')]=_[_0xa39a('0x1b')](config[_0xa39a('0x1a')],{'host':_0xa39a('0x1c'),'port':0x18eb});var socket=require(_0xa39a('0x1d'))(new Redis(config['redis']));require(_0xa39a('0x1e'))[_0xa39a('0x1f')](socket);var jayson=require(_0xa39a('0x20'));var client=jayson[_0xa39a('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1bbb28,_0x555572,_0x47e38c,_0x10457d){return new BPromise(function(_0x5186ff,_0x3e61c1){var _0x3c205f=_0x10457d||client;return _0x3c205f[_0xa39a('0x22')](_0x1bbb28,_0x47e38c)[_0xa39a('0x23')](function(_0x484ff3){logger['info']('SmsAccount,\x20%s,\x20%s',_0x555572,_0xa39a('0x24'));logger[_0xa39a('0x25')](_0xa39a('0x26'),_0x555572,'request\x20sent',JSON['stringify'](_0x484ff3));if(_0x484ff3[_0xa39a('0x27')]){if(_0x484ff3[_0xa39a('0x27')]['code']===0x1f4){logger[_0xa39a('0x27')](_0xa39a('0x28'),_0x555572,_0x484ff3[_0xa39a('0x27')][_0xa39a('0x29')]);return _0x3e61c1(_0x484ff3[_0xa39a('0x27')][_0xa39a('0x29')]);}logger['error'](_0xa39a('0x28'),_0x555572,_0x484ff3['error'][_0xa39a('0x29')]);return _0x5186ff(_0x484ff3[_0xa39a('0x27')]['message']);}else{logger[_0xa39a('0x2a')](_0xa39a('0x28'),_0x555572,'request\x20sent');_0x5186ff(_0x484ff3[_0xa39a('0x2b')][_0xa39a('0x29')]);}})['catch'](function(_0x2da8c0){logger[_0xa39a('0x27')]('SmsAccount,\x20%s,\x20%s',_0x555572,_0x2da8c0);_0x3e61c1(_0x2da8c0);});});}function respondWithStatusCode(_0x10eac5,_0x18cef6){_0x18cef6=_0x18cef6||0xcc;return function(_0x20bfba){if(_0x20bfba){return _0x10eac5[_0xa39a('0x2c')](_0x18cef6);}return _0x10eac5['status'](_0x18cef6)[_0xa39a('0x2d')]();};}function respondWithResult(_0x1e3d9d,_0x513ab4){_0x513ab4=_0x513ab4||0xc8;return function(_0x355b08){if(_0x355b08){return _0x1e3d9d[_0xa39a('0x2e')](_0x513ab4)[_0xa39a('0x2f')](_0x355b08);}};}function respondWithFilteredResult(_0x4f24e9,_0x150468){return function(_0x2b58e6){if(_0x2b58e6){var _0x2dc9b0=typeof _0x150468[_0xa39a('0x30')]===_0xa39a('0x31')&&typeof _0x150468['limit']==='undefined';var _0x37ba46=_0x2b58e6[_0xa39a('0x32')];var _0xcfee99=_0x2dc9b0?0x0:_0x150468[_0xa39a('0x30')];var _0x5ab9b2=_0x2dc9b0?_0x2b58e6[_0xa39a('0x32')]:_0x150468[_0xa39a('0x30')]+_0x150468[_0xa39a('0x33')];var _0x34b677;if(_0x5ab9b2>=_0x37ba46){_0x5ab9b2=_0x37ba46;_0x34b677=0xc8;}else{_0x34b677=0xce;}_0x4f24e9[_0xa39a('0x2e')](_0x34b677);return _0x4f24e9[_0xa39a('0x34')](_0xa39a('0x35'),_0xcfee99+'-'+_0x5ab9b2+'/'+_0x37ba46)[_0xa39a('0x2f')](_0x2b58e6);}return null;};}function patchUpdates(_0x28ab93){return function(_0x2b467f){try{jsonpatch[_0xa39a('0x36')](_0x2b467f,_0x28ab93,!![]);}catch(_0x5bf2b9){return BPromise[_0xa39a('0x37')](_0x5bf2b9);}return _0x2b467f[_0xa39a('0x38')]();};}function saveUpdates(_0x5a3d6d,_0x195fe1){return function(_0x3f0b66){if(_0x3f0b66){return _0x3f0b66['update'](_0x5a3d6d)[_0xa39a('0x23')](function(_0x5d2e5f){return _0x5d2e5f;});}return null;};}function removeEntity(_0x234a8a,_0x268cf8){return function(_0x160f6e){if(_0x160f6e){return _0x160f6e[_0xa39a('0x39')]()[_0xa39a('0x23')](function(){var _0x524fbc=_0x160f6e[_0xa39a('0x3a')]({'plain':!![]});var _0x4bc5f3=_0xa39a('0x3b');return db[_0xa39a('0x3c')]['destroy']({'where':{'type':_0x4bc5f3,'resourceId':_0x524fbc['id']}})[_0xa39a('0x23')](function(){return _0x160f6e;});})[_0xa39a('0x23')](function(){_0x234a8a[_0xa39a('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54465b,_0x12f38a){return function(_0x49ece7){if(!_0x49ece7){_0x54465b['sendStatus'](0x194);}return _0x49ece7;};}function handleError(_0x52d850,_0x530856){_0x530856=_0x530856||0x1f4;return function(_0xa5ab14){logger[_0xa39a('0x27')](_0xa5ab14[_0xa39a('0x3d')]);if(_0xa5ab14[_0xa39a('0x3e')]){delete _0xa5ab14[_0xa39a('0x3e')];}_0x52d850[_0xa39a('0x2e')](_0x530856)[_0xa39a('0x3f')](_0xa5ab14);};}exports[_0xa39a('0x40')]=function(_0x190da9,_0xd2c8a1){var _0x3ffbf2={'include':[{'model':db['Pause'],'as':_0xa39a('0x41')}]},_0x3e8903={},_0x105804={'count':0x0,'rows':[]};var _0x15af21=_[_0xa39a('0x42')](db[_0xa39a('0x43')][_0xa39a('0x44')],function(_0x1aa4d3){return{'name':_0x1aa4d3[_0xa39a('0x45')],'type':_0x1aa4d3[_0xa39a('0x46')][_0xa39a('0x47')]};});_0x3e8903[_0xa39a('0x48')]=_[_0xa39a('0x42')](_0x15af21,_0xa39a('0x3e'));_0x3e8903[_0xa39a('0x49')]=_[_0xa39a('0x4a')](_0x190da9['query']);_0x3e8903['filters']=_[_0xa39a('0x4b')](_0x3e8903['model'],_0x3e8903['query']);_0x3ffbf2[_0xa39a('0x4c')]=_[_0xa39a('0x4b')](_0x3e8903[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0x190da9['query']['fields']));_0x3ffbf2['attributes']=_0x3ffbf2[_0xa39a('0x4c')]['length']?_0x3ffbf2[_0xa39a('0x4c')]:_0x3e8903[_0xa39a('0x48')];if(!_0x190da9[_0xa39a('0x49')][_0xa39a('0x4e')]('nolimit')){_0x3ffbf2[_0xa39a('0x33')]=qs[_0xa39a('0x33')](_0x190da9[_0xa39a('0x49')][_0xa39a('0x33')]);_0x3ffbf2[_0xa39a('0x30')]=qs[_0xa39a('0x30')](_0x190da9[_0xa39a('0x49')][_0xa39a('0x30')]);}_0x3ffbf2[_0xa39a('0x4f')]=qs[_0xa39a('0x50')](_0x190da9['query'][_0xa39a('0x50')]);_0x3ffbf2[_0xa39a('0x51')]=qs[_0xa39a('0x52')](_[_0xa39a('0x53')](_0x190da9[_0xa39a('0x49')],_0x3e8903[_0xa39a('0x52')]),_0x15af21);if(_0x190da9[_0xa39a('0x49')][_0xa39a('0x54')]){_0x3ffbf2['where']=_[_0xa39a('0x55')](_0x3ffbf2[_0xa39a('0x51')],{'$or':_[_0xa39a('0x42')](_0x15af21,function(_0x87f367){if(_0x87f367[_0xa39a('0x46')]!==_0xa39a('0x56')){var _0x298a79={};_0x298a79[_0x87f367[_0xa39a('0x3e')]]={'$like':'%'+_0x190da9[_0xa39a('0x49')][_0xa39a('0x54')]+'%'};return _0x298a79;}})});}_0x3ffbf2=_[_0xa39a('0x55')]({},_0x3ffbf2,_0x190da9[_0xa39a('0x57')]);var _0xa3b353={'where':_0x3ffbf2['where']};return db[_0xa39a('0x43')]['count'](_0xa3b353)[_0xa39a('0x23')](function(_0x34d104){_0x105804['count']=_0x34d104;if(_0x190da9[_0xa39a('0x49')]['includeAll']){_0x3ffbf2[_0xa39a('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0xa39a('0x59')](_0x3ffbf2);})[_0xa39a('0x23')](function(_0x39e7b6){_0x105804[_0xa39a('0x5a')]=_0x39e7b6;return _0x105804;})[_0xa39a('0x23')](respondWithFilteredResult(_0xd2c8a1,_0x3ffbf2))['catch'](handleError(_0xd2c8a1,null));};exports[_0xa39a('0x5b')]=function(_0xb36d04,_0x5e1c92){var _0x182624={'raw':![],'where':{'id':_0xb36d04['params']['id']},'include':[{'model':db['Pause'],'as':_0xa39a('0x41')}]},_0x44929b={};_0x44929b[_0xa39a('0x48')]=_['keys'](db[_0xa39a('0x43')][_0xa39a('0x44')]);_0x44929b['query']=_[_0xa39a('0x4a')](_0xb36d04[_0xa39a('0x49')]);_0x44929b[_0xa39a('0x52')]=_['intersection'](_0x44929b[_0xa39a('0x48')],_0x44929b['query']);_0x182624[_0xa39a('0x4c')]=_['intersection'](_0x44929b[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0xb36d04[_0xa39a('0x49')][_0xa39a('0x4d')]));_0x182624['attributes']=_0x182624[_0xa39a('0x4c')][_0xa39a('0x5c')]?_0x182624[_0xa39a('0x4c')]:_0x44929b['model'];if(_0xb36d04[_0xa39a('0x49')]['includeAll']){_0x182624[_0xa39a('0x58')]=[{'all':!![]}];}_0x182624=_['merge']({},_0x182624,_0xb36d04[_0xa39a('0x57')]);return db[_0xa39a('0x43')]['find'](_0x182624)[_0xa39a('0x23')](handleEntityNotFound(_0x5e1c92,null))[_0xa39a('0x23')](respondWithResult(_0x5e1c92,null))['catch'](handleError(_0x5e1c92,null));};exports['create']=function(_0x286f72,_0x16f325){return db[_0xa39a('0x43')][_0xa39a('0x5d')](_0x286f72['body'],{})[_0xa39a('0x23')](function(_0x569708){var _0x1991d6=_0x286f72['user'][_0xa39a('0x3a')]({'plain':!![]});if(!_0x1991d6)throw new Error(_0xa39a('0x5e'));if(_0x1991d6['role']===_0xa39a('0x5f')){var _0x215d56=_0x569708[_0xa39a('0x3a')]({'plain':!![]});var _0x3deb58=_0xa39a('0x3b');return db[_0xa39a('0x60')][_0xa39a('0x61')]({'where':{'name':_0x3deb58,'userProfileId':_0x1991d6[_0xa39a('0x62')]},'raw':!![]})[_0xa39a('0x23')](function(_0x47d351){if(_0x47d351&&_0x47d351['autoAssociation']===0x0){return db['UserProfileResource'][_0xa39a('0x5d')]({'name':_0x215d56[_0xa39a('0x3e')],'resourceId':_0x215d56['id'],'type':_0x47d351[_0xa39a('0x3e')],'sectionId':_0x47d351['id']},{})['then'](function(){return _0x569708;});}else{return _0x569708;}})[_0xa39a('0x63')](function(_0x52a43b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52a43b);throw _0x52a43b;});}return _0x569708;})[_0xa39a('0x23')](respondWithResult(_0x16f325,0xc9))[_0xa39a('0x63')](handleError(_0x16f325,null));};exports[_0xa39a('0x64')]=function(_0x31dbd7,_0x4c542b){if(_0x31dbd7[_0xa39a('0x65')]['id']){delete _0x31dbd7[_0xa39a('0x65')]['id'];}return db[_0xa39a('0x43')][_0xa39a('0x61')]({'where':{'id':_0x31dbd7[_0xa39a('0x66')]['id']},'include':[{'model':db[_0xa39a('0x67')],'as':_0xa39a('0x41')}]})[_0xa39a('0x23')](handleEntityNotFound(_0x4c542b,null))['then'](saveUpdates(_0x31dbd7[_0xa39a('0x65')],null))[_0xa39a('0x23')](respondWithResult(_0x4c542b,null))[_0xa39a('0x63')](handleError(_0x4c542b,null));};exports[_0xa39a('0x39')]=function(_0x13d12f,_0x10872b){return db['SmsAccount'][_0xa39a('0x61')]({'where':{'id':_0x13d12f[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x10872b,null))[_0xa39a('0x23')](removeEntity(_0x10872b,null))[_0xa39a('0x63')](handleError(_0x10872b,null));};exports[_0xa39a('0x68')]=function(_0x2c0dfa,_0x1c4d7d){return db[_0xa39a('0x43')]['describe']()[_0xa39a('0x23')](respondWithResult(_0x1c4d7d,null))[_0xa39a('0x63')](handleError(_0x1c4d7d,null));};exports[_0xa39a('0x69')]=function(_0x3e3d65,_0x4cc1f8,_0x5af31b){if(_0x3e3d65['body']['id']){delete _0x3e3d65[_0xa39a('0x65')]['id'];}return db['SmsAccount'][_0xa39a('0x61')]({'where':{'id':_0x3e3d65[_0xa39a('0x66')]['id']}})['then'](handleEntityNotFound(_0x4cc1f8,null))[_0xa39a('0x23')](function(_0x21de88){if(_0x21de88){_0x3e3d65[_0xa39a('0x65')][_0xa39a('0x6a')]=_0x21de88['id'];return db[_0xa39a('0x6b')]['create'](_0x3e3d65[_0xa39a('0x65')]);}})[_0xa39a('0x23')](respondWithResult(_0x4cc1f8,null))[_0xa39a('0x63')](handleError(_0x4cc1f8,null));};exports[_0xa39a('0x6c')]=function(_0x504e79,_0x444c79,_0x2e526e){var _0x5c16be={'raw':![],'where':{}};var _0x855d9c={};var _0x1dd84d={'count':0x0,'rows':[]};return db[_0xa39a('0x43')][_0xa39a('0x6d')]({'where':{'id':_0x504e79[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x444c79,null))[_0xa39a('0x23')](function(_0xf80493){if(_0xf80493){_0x855d9c[_0xa39a('0x48')]=_[_0xa39a('0x4a')](db['Disposition'][_0xa39a('0x44')]);_0x855d9c[_0xa39a('0x49')]=_['keys'](_0x504e79[_0xa39a('0x49')]);_0x855d9c[_0xa39a('0x52')]=_[_0xa39a('0x4b')](_0x855d9c[_0xa39a('0x48')],_0x855d9c['query']);_0x5c16be[_0xa39a('0x4c')]=_[_0xa39a('0x4b')](_0x855d9c[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0x504e79[_0xa39a('0x49')][_0xa39a('0x4d')]));_0x5c16be[_0xa39a('0x4c')]=_0x5c16be['attributes'][_0xa39a('0x5c')]?_0x5c16be[_0xa39a('0x4c')]:_0x855d9c[_0xa39a('0x48')];if(!_0x504e79[_0xa39a('0x49')][_0xa39a('0x4e')]('nolimit')){_0x5c16be[_0xa39a('0x33')]=qs['limit'](_0x504e79['query']['limit']);_0x5c16be[_0xa39a('0x30')]=qs['offset'](_0x504e79['query'][_0xa39a('0x30')]);}_0x5c16be['order']=qs[_0xa39a('0x50')](_0x504e79[_0xa39a('0x49')][_0xa39a('0x50')]);_0x5c16be[_0xa39a('0x51')]=qs['filters'](_[_0xa39a('0x53')](_0x504e79[_0xa39a('0x49')],_0x855d9c['filters']));_0x5c16be[_0xa39a('0x51')][_0xa39a('0x6a')]=_0xf80493['id'];if(_0x504e79[_0xa39a('0x49')][_0xa39a('0x54')]){_0x5c16be[_0xa39a('0x51')]=_[_0xa39a('0x55')](_0x5c16be[_0xa39a('0x51')],{'$or':_[_0xa39a('0x42')](_0x5c16be[_0xa39a('0x4c')],function(_0x39032c){var _0x5d57e2={};_0x5d57e2[_0x39032c]={'$like':'%'+_0x504e79[_0xa39a('0x49')][_0xa39a('0x54')]+'%'};return _0x5d57e2;})});}_0x5c16be=_['merge']({},_0x5c16be,_0x504e79[_0xa39a('0x57')]);return db['Disposition'][_0xa39a('0x32')]({'where':_0x5c16be[_0xa39a('0x51')]})[_0xa39a('0x23')](function(_0x10c396){_0x1dd84d['count']=_0x10c396;if(_0x504e79[_0xa39a('0x49')][_0xa39a('0x6e')]){_0x5c16be[_0xa39a('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xa39a('0x59')](_0x5c16be);})['then'](function(_0x225d6b){_0x1dd84d['rows']=_0x225d6b;return _0x1dd84d;});}})[_0xa39a('0x23')](respondWithFilteredResult(_0x444c79,_0x5c16be))[_0xa39a('0x63')](handleError(_0x444c79,null));};exports[_0xa39a('0x6f')]=function(_0x5def8d,_0x3ea868,_0x3541cb){return db[_0xa39a('0x43')][_0xa39a('0x61')]({'where':{'id':_0x5def8d[_0xa39a('0x66')]['id']}})['then'](handleEntityNotFound(_0x3ea868,null))[_0xa39a('0x23')](function(_0x343c6f){if(_0x343c6f){return _0x343c6f[_0xa39a('0x6f')](_0x5def8d['query'][_0xa39a('0x70')]);}})['then'](respondWithStatusCode(_0x3ea868,null))[_0xa39a('0x63')](handleError(_0x3ea868,null));};exports['addAnswer']=function(_0x49cf74,_0x28241b,_0x3f4daa){if(_0x49cf74[_0xa39a('0x65')]['id']){delete _0x49cf74['body']['id'];}return db[_0xa39a('0x43')]['find']({'where':{'id':_0x49cf74[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x28241b,null))[_0xa39a('0x23')](function(_0x2f00f8){if(_0x2f00f8){_0x49cf74[_0xa39a('0x65')][_0xa39a('0x6a')]=_0x2f00f8['id'];return db[_0xa39a('0x71')]['create'](_0x49cf74[_0xa39a('0x65')]);}})[_0xa39a('0x23')](respondWithResult(_0x28241b,null))[_0xa39a('0x63')](handleError(_0x28241b,null));};exports[_0xa39a('0x72')]=function(_0x488b2e,_0x29951d,_0x35d157){var _0x56ac95={'raw':![],'where':{}};var _0x3e9625={};var _0x2aad9e={'count':0x0,'rows':[]};return db[_0xa39a('0x43')]['findOne']({'where':{'id':_0x488b2e['params']['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x29951d,null))[_0xa39a('0x23')](function(_0x25b734){if(_0x25b734){_0x3e9625['model']=_[_0xa39a('0x4a')](db[_0xa39a('0x71')][_0xa39a('0x44')]);_0x3e9625['query']=_[_0xa39a('0x4a')](_0x488b2e[_0xa39a('0x49')]);_0x3e9625['filters']=_[_0xa39a('0x4b')](_0x3e9625[_0xa39a('0x48')],_0x3e9625[_0xa39a('0x49')]);_0x56ac95[_0xa39a('0x4c')]=_[_0xa39a('0x4b')](_0x3e9625[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0x488b2e[_0xa39a('0x49')][_0xa39a('0x4d')]));_0x56ac95[_0xa39a('0x4c')]=_0x56ac95[_0xa39a('0x4c')][_0xa39a('0x5c')]?_0x56ac95[_0xa39a('0x4c')]:_0x3e9625[_0xa39a('0x48')];if(!_0x488b2e[_0xa39a('0x49')][_0xa39a('0x4e')](_0xa39a('0x73'))){_0x56ac95[_0xa39a('0x33')]=qs['limit'](_0x488b2e[_0xa39a('0x49')]['limit']);_0x56ac95[_0xa39a('0x30')]=qs[_0xa39a('0x30')](_0x488b2e[_0xa39a('0x49')][_0xa39a('0x30')]);}_0x56ac95[_0xa39a('0x4f')]=qs[_0xa39a('0x50')](_0x488b2e[_0xa39a('0x49')][_0xa39a('0x50')]);_0x56ac95[_0xa39a('0x51')]=qs[_0xa39a('0x52')](_[_0xa39a('0x53')](_0x488b2e[_0xa39a('0x49')],_0x3e9625[_0xa39a('0x52')]));_0x56ac95['where'][_0xa39a('0x6a')]=_0x25b734['id'];if(_0x488b2e['query'][_0xa39a('0x54')]){_0x56ac95['where']=_[_0xa39a('0x55')](_0x56ac95[_0xa39a('0x51')],{'$or':_['map'](_0x56ac95[_0xa39a('0x4c')],function(_0x4a1921){var _0x17b49c={};_0x17b49c[_0x4a1921]={'$like':'%'+_0x488b2e[_0xa39a('0x49')][_0xa39a('0x54')]+'%'};return _0x17b49c;})});}_0x56ac95=_[_0xa39a('0x55')]({},_0x56ac95,_0x488b2e[_0xa39a('0x57')]);return db[_0xa39a('0x71')][_0xa39a('0x32')]({'where':_0x56ac95[_0xa39a('0x51')]})[_0xa39a('0x23')](function(_0x21cff5){_0x2aad9e[_0xa39a('0x32')]=_0x21cff5;if(_0x488b2e[_0xa39a('0x49')][_0xa39a('0x6e')]){_0x56ac95[_0xa39a('0x58')]=[{'all':!![]}];}return db[_0xa39a('0x71')][_0xa39a('0x59')](_0x56ac95);})[_0xa39a('0x23')](function(_0x290872){_0x2aad9e[_0xa39a('0x5a')]=_0x290872;return _0x2aad9e;});}})[_0xa39a('0x23')](respondWithFilteredResult(_0x29951d,_0x56ac95))[_0xa39a('0x63')](handleError(_0x29951d,null));};exports[_0xa39a('0x74')]=function(_0x19448f,_0x579eb5,_0x33e596){return db['SmsAccount'][_0xa39a('0x61')]({'where':{'id':_0x19448f['params']['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x579eb5,null))['then'](function(_0x1616b3){if(_0x1616b3){return _0x1616b3[_0xa39a('0x74')](_0x19448f[_0xa39a('0x49')][_0xa39a('0x70')]);}})[_0xa39a('0x23')](respondWithStatusCode(_0x579eb5,null))['catch'](handleError(_0x579eb5,null));};exports[_0xa39a('0x75')]=function(_0x2dc987,_0x275d5f,_0x24e8ba){var _0x105b83={'channel':_0xa39a('0x76')};var _0x3ae159=[];var _0x226127=[];var _0x4a713e={};return db[_0xa39a('0x43')][_0xa39a('0x61')]({'where':{'id':_0x2dc987[_0xa39a('0x66')]['id']},'include':[{'model':db[_0xa39a('0x77')],'as':_0xa39a('0x78')}]})[_0xa39a('0x23')](handleEntityNotFound(_0x275d5f,null))['then'](function(_0x5b6766){_0x105b83[_0xa39a('0x79')]=_0x5b6766;_0x105b83[_0xa39a('0x7a')]=_['orderBy'](_0x5b6766['Applications'],[_0xa39a('0x7b')],[_0xa39a('0x7c')]);if(_0x105b83[_0xa39a('0x79')][_0xa39a('0x78')]){delete _0x105b83['account'][_0xa39a('0x78')];}return db[_0xa39a('0x7d')]['describe']();})[_0xa39a('0x23')](function(_0x12ffbb){if(!_0x12ffbb){throw new db[(_0xa39a('0x7e'))][(_0xa39a('0x7f'))](_0xa39a('0x80'));}_0x3ae159=_[_0xa39a('0x81')](_[_0xa39a('0x4a')](_0x12ffbb),[_0xa39a('0x82'),'updatedAt']);_0x226127=_['difference'](_[_0xa39a('0x4a')](_0x12ffbb),['createdAt','updatedAt',_0xa39a('0x83'),'ListId']);_0x105b83[_0xa39a('0x65')]={'mapKey':'mobile'};if(_0x105b83[_0xa39a('0x79')][_0xa39a('0x46')]){switch(_0x105b83[_0xa39a('0x79')][_0xa39a('0x46')]){case _0xa39a('0x84'):_0x105b83[_0xa39a('0x65')]['from']=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x85')];_0x105b83['body'][_0xa39a('0x65')]=_0x2dc987['body']['Body'];_0x105b83[_0xa39a('0x65')][_0xa39a('0x86')]=_0x2dc987['body'][_0xa39a('0x87')];break;case _0xa39a('0x88'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]='+'+_0x2dc987[_0xa39a('0x65')][_0xa39a('0x8a')];_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x8b')];break;case _0xa39a('0x8c'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x89')];_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')]=_0x2dc987['body'][_0xa39a('0x29')];break;case _0xa39a('0x8d'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987['body']['from'];_0x105b83['body'][_0xa39a('0x65')]=_0x2dc987[_0xa39a('0x65')]['body'];_0x105b83['body'][_0xa39a('0x86')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x8e')];break;case'plivo':_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x85')];_0x105b83[_0xa39a('0x65')]['body']=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x8f')];_0x105b83[_0xa39a('0x65')]['messageId']=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x90')];break;case _0xa39a('0x91'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]='+'+_0x2dc987['body'][_0xa39a('0x92')][0x0]['from'];_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x92')][0x0][_0xa39a('0x8b')];_0x105b83[_0xa39a('0x65')]['messageId']=_0x2dc987['body'][_0xa39a('0x92')][0x0][_0xa39a('0x86')];break;case _0xa39a('0x93'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x94')];_0x105b83['body'][_0xa39a('0x65')]=_0x2dc987['body'][_0xa39a('0x95')][_0xa39a('0x29')];break;case _0xa39a('0x96'):_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x97')];_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')]=_0x2dc987['body'][_0xa39a('0x8b')];_0x105b83['body']['messageId']=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x98')];break;case _0xa39a('0x99'):_0x105b83[_0xa39a('0x65')]['messageId']=_0x2dc987[_0xa39a('0x65')][0x0]['message']['id'];_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')]=_0x2dc987['body'][0x0][_0xa39a('0x29')][_0xa39a('0x89')];_0x105b83[_0xa39a('0x65')]['body']=_0x2dc987[_0xa39a('0x65')][0x0][_0xa39a('0x29')]['text'];break;case _0xa39a('0x9a'):_0x105b83['body'][_0xa39a('0x89')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x89')];_0x105b83[_0xa39a('0x65')]['body']=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x29')];_0x105b83['body'][_0xa39a('0x86')]=_0x2dc987[_0xa39a('0x65')][_0xa39a('0x9b')];break;}}if(_0x105b83[_0xa39a('0x65')]['id']){delete _0x105b83[_0xa39a('0x65')]['id'];}if(_[_0xa39a('0x9c')](_0x105b83['body'][_0xa39a('0x89')])){throw new db[(_0xa39a('0x7e'))][(_0xa39a('0x7f'))](_0xa39a('0x9d'));}if(_[_0xa39a('0x9c')](_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')])||_0x105b83[_0xa39a('0x65')][_0xa39a('0x65')]===''){throw new db[(_0xa39a('0x7e'))][(_0xa39a('0x7f'))](_0xa39a('0x9e'));}if(_[_0xa39a('0x9c')](_0x105b83[_0xa39a('0x65')][_0xa39a('0x9f')])){throw new db[(_0xa39a('0x7e'))]['ValidationError'](_0xa39a('0xa0')+_0x226127);}if(!_[_0xa39a('0xa1')](_0x226127,_0x105b83['body']['mapKey'])){throw new db[(_0xa39a('0x7e'))][(_0xa39a('0x7f'))](_0xa39a('0xa2')+_0x226127);}_0x4a713e[_0x105b83[_0xa39a('0x65')][_0xa39a('0x9f')]]=_0x105b83['body']['from'];return db[_0xa39a('0xa3')][_0xa39a('0x61')]({'where':{'id':_0x105b83[_0xa39a('0x79')][_0xa39a('0xa4')]},'include':[{'model':db[_0xa39a('0x7d')],'as':_0xa39a('0xa5'),'where':_0x4a713e,'limit':0x1,'order':[['updatedAt',_0xa39a('0xa6')]]}]});})[_0xa39a('0x23')](handleEntityNotFound(_0x275d5f,null))['then'](function(_0x39e006){if(_0x39e006){_0x105b83[_0xa39a('0xa7')]=_[_0xa39a('0xa8')](_0x39e006,[_0xa39a('0xa5')]);if(_0x39e006[_0xa39a('0xa5')][_0xa39a('0x5c')]){return _0x39e006[_0xa39a('0xa5')][0x0];}var _0x107534=_[_0xa39a('0x1b')](_0x105b83['body'],{'firstName':_0x105b83[_0xa39a('0x65')]['from'],'ListId':_0x39e006['id']});_0x107534[_0x105b83[_0xa39a('0x65')][_0xa39a('0x9f')]]=_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')];return db['CmContact']['create'](_0x107534,{'fields':_0x3ae159,'raw':!![]});}})[_0xa39a('0x23')](handleEntityNotFound(_0x275d5f,null))[_0xa39a('0x23')](function(_0xbd85d3){if(_0xbd85d3){_0x105b83[_0xa39a('0xa9')]=_0xbd85d3;var _0x5d702f={'ContactId':_0xbd85d3['id'],'phone':_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')],'SmsAccountId':_0x2dc987['params']['id']};var _0x3ccc5e={'ContactId':_0xbd85d3['id'],'SmsAccountId':_0x2dc987[_0xa39a('0x66')]['id'],'closed':![]};return db[_0xa39a('0xaa')][_0xa39a('0x61')]({'where':_0x3ccc5e})[_0xa39a('0x23')](function(_0x3a7d74){if(_0x3a7d74){return[_0x3a7d74,![]];}return db[_0xa39a('0xaa')][_0xa39a('0x5d')](_0x5d702f)[_0xa39a('0x23')](function(_0x393d60){return[_0x393d60,!![]];});});}})[_0xa39a('0xab')](function(_0x206703,_0x244660){_0x105b83[_0xa39a('0xac')]=_0x206703[_0xa39a('0x3a')]({'plain':!![]});_0x105b83[_0xa39a('0xac')][_0xa39a('0xad')]=![];if(_0x244660){if(_0x105b83['account'][_0xa39a('0xae')]){_0x105b83[_0xa39a('0x7a')][_0xa39a('0xaf')]({'id':0x0,'priority':_0x105b83['applications']['length']+0x1,'app':_0xa39a('0xb0'),'appdata':_0xa39a('0xb1'),'interval':_0xa39a('0xb2')});}_0x105b83[_0xa39a('0xac')][_0xa39a('0xad')]=!![];}return db['SmsMessage'][_0xa39a('0x5d')]({'phone':_0x105b83[_0xa39a('0x65')][_0xa39a('0x89')],'messageId':_0x105b83[_0xa39a('0x65')][_0xa39a('0x86')],'body':_0x105b83['body'][_0xa39a('0x65')],'SmsAccountId':_0x2dc987[_0xa39a('0x66')]['id'],'SmsInteractionId':_0x206703['id'],'direction':'in','ContactId':_0x206703[_0xa39a('0xb3')],'AttachmentId':_0x105b83[_0xa39a('0x65')][_0xa39a('0xb4')]});})[_0xa39a('0x23')](function(_0x45c7b5){_0x105b83[_0xa39a('0x29')]=_0x45c7b5;if(_0x105b83[_0xa39a('0xac')][_0xa39a('0xb5')]){return db['User'][_0xa39a('0x61')]({'attributes':['id',_0xa39a('0x3e')],'where':{'id':_0x105b83[_0xa39a('0xac')][_0xa39a('0xb5')]}})[_0xa39a('0x23')](function(_0x245c7f){if(_0x245c7f){_0x105b83['applications'][_0xa39a('0xb6')]({'id':0x0,'priority':0x0,'app':_0xa39a('0xb7'),'appdata':_0x245c7f[_0xa39a('0x3e')]+','+(_0x105b83[_0xa39a('0x79')]['waitForTheAssignedAgent']||0xa),'interval':_0xa39a('0xb2')});}return respondWithRpcPromise(_0xa39a('0xb8'),'startRouting',_0x105b83);});}return respondWithRpcPromise(_0xa39a('0xb8'),_0xa39a('0xb9'),_0x105b83);})[_0xa39a('0x23')](function(_0x5c0f77){if(_0x5c0f77){var _0xfc88e5=0xc8;var _0x1783cd=_0xa39a('0xba');logger[_0xa39a('0x2a')](_0xa39a('0x26'),_0x1783cd,_0xfc88e5,_0xa39a('0xbb'));logger[_0xa39a('0x25')](_0xa39a('0xbc'),_0x1783cd,_0xfc88e5,_0xa39a('0xbb'),JSON[_0xa39a('0xbd')](_0x5c0f77));if(_0x105b83[_0xa39a('0x79')][_0xa39a('0x46')]==='twilio'){return _0x275d5f[_0xa39a('0x2e')](_0xfc88e5)[_0xa39a('0x34')]('Content-Type',_0xa39a('0xbe'))['send'](_0xa39a('0xbf'));}else{return _0x275d5f['status'](_0xfc88e5)[_0xa39a('0x2f')](_0x5c0f77);}}})['catch'](handleError(_0x275d5f,null));};exports['addApplications']=function(_0x67cec2,_0x440bc0,_0x4650ba){return db[_0xa39a('0x43')][_0xa39a('0x6d')]({'where':{'id':_0x67cec2['params']['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x440bc0,null))[_0xa39a('0x23')](function(_0x5aea14){if(_0x5aea14){return db[_0xa39a('0xc0')]['transaction'](function(_0x4a6f22){return db[_0xa39a('0x77')][_0xa39a('0x39')]({'where':{'SmsAccountId':_0x67cec2[_0xa39a('0x66')]['id']},'transaction':_0x4a6f22})[_0xa39a('0x23')](function(_0x1c4639){var _0x153759=_[_0xa39a('0x42')](_0x67cec2[_0xa39a('0x65')],function(_0x5995c7){_0x5995c7[_0xa39a('0x6a')]=_0x67cec2[_0xa39a('0x66')]['id'];return _0x5995c7;});return db[_0xa39a('0x77')][_0xa39a('0xc1')](_0x153759,{'transaction':_0x4a6f22});});})[_0xa39a('0x23')](function(){return db['SmsApplication'][_0xa39a('0xc2')]({'where':{'SmsAccountId':_0x67cec2[_0xa39a('0x66')]['id']},'order':_0xa39a('0x7b')});});}})['then'](respondWithResult(_0x440bc0,null))[_0xa39a('0x63')](handleError(_0x440bc0,null));};exports[_0xa39a('0xc3')]=function(_0xd6baf3,_0xc4b796,_0x2e21ec){var _0x1b2068={};var _0x3f0023={};var _0x30c94d;var _0x1ad4d1;return db[_0xa39a('0x43')][_0xa39a('0x6d')]({'where':{'id':_0xd6baf3[_0xa39a('0x66')]['id']}})['then'](handleEntityNotFound(_0xc4b796,null))[_0xa39a('0x23')](function(_0x3ebc94){if(_0x3ebc94){_0x30c94d=_0x3ebc94;_0x3f0023[_0xa39a('0x48')]=_[_0xa39a('0x4a')](db[_0xa39a('0x77')]['rawAttributes']);_0x3f0023['query']=_[_0xa39a('0x4a')](_0xd6baf3[_0xa39a('0x49')]);_0x3f0023[_0xa39a('0x52')]=_['intersection'](_0x3f0023[_0xa39a('0x48')],_0x3f0023[_0xa39a('0x49')]);_0x1b2068[_0xa39a('0x4c')]=_['intersection'](_0x3f0023[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0xd6baf3[_0xa39a('0x49')][_0xa39a('0x4d')]));_0x1b2068[_0xa39a('0x4c')]=_0x1b2068['attributes'][_0xa39a('0x5c')]?_0x1b2068['attributes']:_0x3f0023['model'];_0x1b2068[_0xa39a('0x4f')]=qs['sort'](_0xd6baf3[_0xa39a('0x49')]['sort']);_0x1b2068[_0xa39a('0x51')]=qs[_0xa39a('0x52')](_[_0xa39a('0x53')](_0xd6baf3[_0xa39a('0x49')],_0x3f0023[_0xa39a('0x52')]));if(_0xd6baf3['query']['filter']){_0x1b2068['where']=_[_0xa39a('0x55')](_0x1b2068['where'],{'$or':_[_0xa39a('0x42')](_0x1b2068[_0xa39a('0x4c')],function(_0x1cbc94){var _0x506a18={};_0x506a18[_0x1cbc94]={'$like':'%'+_0xd6baf3[_0xa39a('0x49')][_0xa39a('0x54')]+'%'};return _0x506a18;})});}_0x1b2068=_[_0xa39a('0x55')]({},_0x1b2068,_0xd6baf3[_0xa39a('0x57')]);return _0x30c94d[_0xa39a('0xc3')](_0x1b2068);}})[_0xa39a('0x23')](function(_0x1433c8){if(_0x1433c8){_0x1ad4d1=_0x1433c8[_0xa39a('0x5c')];if(!_0xd6baf3['query']['hasOwnProperty'](_0xa39a('0x73'))){_0x1b2068['limit']=qs[_0xa39a('0x33')](_0xd6baf3['query']['limit']);_0x1b2068[_0xa39a('0x30')]=qs[_0xa39a('0x30')](_0xd6baf3['query']['offset']);}return _0x30c94d[_0xa39a('0xc3')](_0x1b2068);}})[_0xa39a('0x23')](function(_0x40f81c){if(_0x40f81c){return _0x40f81c?{'count':_0x1ad4d1,'rows':_0x40f81c}:null;}})[_0xa39a('0x23')](respondWithResult(_0xc4b796,null))[_0xa39a('0x63')](handleError(_0xc4b796,null));};exports[_0xa39a('0xc4')]=function(_0x1587d6,_0x1afd5a,_0x2cd9c1){var _0x124a69={'raw':![],'where':{}};var _0x3e9316={};var _0x45f83a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa39a('0x6d')]({'where':{'id':_0x1587d6['params']['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x1afd5a,null))['then'](function(_0x50c8ef){if(_0x50c8ef){_0x3e9316['model']=_['keys'](db[_0xa39a('0xaa')][_0xa39a('0x44')]);_0x3e9316[_0xa39a('0x49')]=_[_0xa39a('0x4a')](_0x1587d6[_0xa39a('0x49')]);_0x3e9316['filters']=_[_0xa39a('0x4b')](_0x3e9316[_0xa39a('0x48')],_0x3e9316[_0xa39a('0x49')]);_0x124a69[_0xa39a('0x4c')]=_[_0xa39a('0x4b')](_0x3e9316['model'],qs[_0xa39a('0x4d')](_0x1587d6[_0xa39a('0x49')][_0xa39a('0x4d')]));_0x124a69[_0xa39a('0x4c')]=_0x124a69[_0xa39a('0x4c')][_0xa39a('0x5c')]?_0x124a69[_0xa39a('0x4c')]:_0x3e9316[_0xa39a('0x48')];if(!_0x1587d6[_0xa39a('0x49')][_0xa39a('0x4e')](_0xa39a('0x73'))){_0x124a69[_0xa39a('0x33')]=qs[_0xa39a('0x33')](_0x1587d6[_0xa39a('0x49')][_0xa39a('0x33')]);_0x124a69[_0xa39a('0x30')]=qs[_0xa39a('0x30')](_0x1587d6[_0xa39a('0x49')]['offset']);}_0x124a69[_0xa39a('0x4f')]=qs[_0xa39a('0x50')](_0x1587d6[_0xa39a('0x49')][_0xa39a('0x50')]);_0x124a69[_0xa39a('0x51')]=qs[_0xa39a('0x52')](_['pick'](_0x1587d6[_0xa39a('0x49')],_0x3e9316[_0xa39a('0x52')]));_0x124a69[_0xa39a('0x51')][_0xa39a('0x6a')]=_0x50c8ef['id'];if(_0x1587d6[_0xa39a('0x49')][_0xa39a('0x54')]){_0x124a69['where']=_[_0xa39a('0x55')](_0x124a69[_0xa39a('0x51')],{'$or':_[_0xa39a('0x42')](_0x124a69[_0xa39a('0x4c')],function(_0x18556e){var _0x479a15={};_0x479a15[_0x18556e]={'$like':'%'+_0x1587d6[_0xa39a('0x49')][_0xa39a('0x54')]+'%'};return _0x479a15;})});}_0x124a69=_[_0xa39a('0x55')]({},_0x124a69,_0x1587d6['options']);return db[_0xa39a('0xaa')][_0xa39a('0x32')]({'where':_0x124a69['where']})[_0xa39a('0x23')](function(_0x3b0567){_0x45f83a[_0xa39a('0x32')]=_0x3b0567;if(_0x1587d6['query'][_0xa39a('0x6e')]){_0x124a69[_0xa39a('0x58')]=[{'model':db[_0xa39a('0x7d')],'as':_0xa39a('0xc5'),'required':![]},{'model':db[_0xa39a('0xc6')],'as':_0xa39a('0xc7'),'attributes':['name',_0xa39a('0xc8'),_0xa39a('0xc9')],'required':![]},{'model':db['Tag'],'as':_0xa39a('0xca'),'attributes':['id',_0xa39a('0x3e'),'color'],'where':_0x1587d6['query'][_0xa39a('0xcb')]?{'id':_0x1587d6[_0xa39a('0x49')][_0xa39a('0xcb')]}:undefined,'required':_0x1587d6[_0xa39a('0x49')][_0xa39a('0xcb')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x124a69);})['then'](function(_0x386fff){_0x45f83a[_0xa39a('0x5a')]=_0x386fff;return _0x45f83a;});}})[_0xa39a('0x23')](respondWithFilteredResult(_0x1afd5a,_0x124a69))[_0xa39a('0x63')](handleError(_0x1afd5a,null));};exports['send']=function(_0x486d17,_0x59bf85,_0x15bad6){var _0x156028,_0x537eab,_0x498e6e;if(_['isNil'](_0x486d17[_0xa39a('0x65')]['body'])||_0x486d17[_0xa39a('0x65')]['body']===''){throw new db[(_0xa39a('0x7e'))][(_0xa39a('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa39a('0x9c')](_0x486d17[_0xa39a('0x65')]['to'])){throw new db[(_0xa39a('0x7e'))]['ValidationError']('to\x20is\x20mandatory');}_0x156028=_0x486d17[_0xa39a('0x65')]['to'];return db[_0xa39a('0x43')][_0xa39a('0x61')]({'where':{'id':_0x486d17[_0xa39a('0x66')]['id']},'include':[{'model':db[_0xa39a('0xa3')],'as':_0xa39a('0xcc'),'include':[{'model':db[_0xa39a('0x7d')],'as':_0xa39a('0xa5'),'where':{'mobile':_0x156028},'limit':0x1,'order':[[_0xa39a('0xcd'),_0xa39a('0xa6')]]}]}]})[_0xa39a('0x23')](handleEntityNotFound(_0x59bf85,null))[_0xa39a('0x23')](function(_0x1ac03a){if(_0x1ac03a&&_0x1ac03a[_0xa39a('0xcc')]){_0x537eab=_0x1ac03a[_0xa39a('0x3a')]({'plain':!![]});if(_0x537eab[_0xa39a('0xcc')]&&_0x537eab['List']['Contacts']['length']){return _0x537eab['List']['Contacts'][0x0];}return db[_0xa39a('0x7d')][_0xa39a('0x5d')](_['defaults'](_0x486d17[_0xa39a('0x65')],{'firstName':_0x156028,'mobile':_0x156028,'phone':_0x156028,'ListId':_0x537eab[_0xa39a('0xa4')]}));}})[_0xa39a('0x23')](handleEntityNotFound(_0x59bf85,null))[_0xa39a('0x23')](function(_0x1f9521){if(_0x1f9521){_0x498e6e=_0x1f9521;return db[_0xa39a('0xaa')]['find']({'where':{'ContactId':_0x498e6e['id'],'closed':![],'SmsAccountId':_0x537eab['id']}})['then'](function(_0x448f93){if(_0x448f93){return[_0x448f93,![]];}return db['SmsInteraction'][_0xa39a('0x5d')]({'UserId':_0x486d17[_0xa39a('0x5f')]['id'],'ContactId':_0x498e6e['id'],'SmsAccountId':_0x537eab['id'],'phone':_0x156028,'firstMsgDirection':_0xa39a('0xce'),'Messages':[_[_0xa39a('0x55')](_0x486d17['body'],{'read':![],'body':_0x486d17[_0xa39a('0x65')][_0xa39a('0x65')],'phone':_0x156028,'SmsAccountId':_0x537eab['id'],'UserId':_0x486d17[_0xa39a('0x5f')]['id'],'ContactId':_0x498e6e['id']})]},{'include':[{'model':db[_0xa39a('0xcf')],'as':_0xa39a('0xd0')}]})[_0xa39a('0x23')](function(_0x58b7b4){return[_0x58b7b4,!![]];});});}})[_0xa39a('0xab')](function(_0x33fdc5,_0x1369be){if(_0x1369be){return _0x33fdc5;}return db[_0xa39a('0xcf')][_0xa39a('0x5d')](_[_0xa39a('0x55')](_0x486d17[_0xa39a('0x65')],{'read':![],'body':_0x486d17[_0xa39a('0x65')][_0xa39a('0x65')],'phone':_0x156028,'SmsAccountId':_0x537eab['id'],'SmsInteractionId':_0x33fdc5['id'],'UserId':_0x486d17[_0xa39a('0x5f')]['id'],'ContactId':_0x498e6e['id']}))[_0xa39a('0x23')](function(_0x128a0e){_0x33fdc5[_0xa39a('0xd1')]['Messages']=[];_0x33fdc5['dataValues'][_0xa39a('0xd0')]['push'](_0x128a0e[_0xa39a('0xd1')]);return _0x33fdc5;});})[_0xa39a('0x23')](respondWithResult(_0x59bf85,null))[_0xa39a('0x63')](handleError(_0x59bf85,null));};exports[_0xa39a('0x2e')]=function(_0x3c4f12,_0x2d4953,_0x39a275){if(_0x3c4f12[_0xa39a('0x65')]['id']){delete _0x3c4f12[_0xa39a('0x65')]['id'];}var _0x456e4b,_0x7e9ec5,_0x5d06e7;return db['SmsAccount'][_0xa39a('0x61')]({'where':{'id':_0x3c4f12['params']['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x2d4953,null))[_0xa39a('0x23')](function(_0x5e927c){if(_0x5e927c){_0x5d06e7=_0x5e927c;logger[_0xa39a('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa39a('0xd2'),_0x5e927c[_0xa39a('0x46')],util[_0xa39a('0xd3')](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));switch(_0x5e927c[_0xa39a('0x46')]){case'skebby':if(_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xd4')]&&_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x2e')]){_0x7e9ec5=_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x2e')];return db[_0xa39a('0xcf')]['find']({'where':{'messageId':_0x3c4f12[_0xa39a('0x65')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xd5')]&&_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xd6')]){_0x7e9ec5=_0x3c4f12[_0xa39a('0x65')]['statusInt'];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xd5')]}});}break;case _0xa39a('0x8d'):if(_0x3c4f12[_0xa39a('0x65')]['message_id']&&_0x3c4f12[_0xa39a('0x65')]['status_code']){_0x7e9ec5=_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xd7')];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x8e')]}});}break;case _0xa39a('0x91'):var _0x378819=_0x3c4f12[_0xa39a('0x65')]['results'][0x0];if(_0x378819[_0xa39a('0x86')]&&_0x378819['status']['groupName']===_0xa39a('0xd8')){_0x7e9ec5=_0x378819[_0xa39a('0x2e')]['groupName'];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x378819['messageId']}});}break;case _0xa39a('0x96'):if(_0x3c4f12[_0xa39a('0x65')]['messageId']&&_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x2e')]){_0x7e9ec5=_0x3c4f12['body'][_0xa39a('0x2e')];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x3c4f12['body'][_0xa39a('0x86')]}});}break;case _0xa39a('0x99'):if(_0x3c4f12[_0xa39a('0x65')][0x0][_0xa39a('0x29')]['id']){_0x7e9ec5=_0x3c4f12[_0xa39a('0x65')][0x0][_0xa39a('0x46')];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x3c4f12['body'][0x0]['message']['id']}});}break;case _0xa39a('0x9a'):if(_0x3c4f12['body'][_0xa39a('0xd9')]&&_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x2e')]){_0x7e9ec5=_0x3c4f12['body'][_0xa39a('0x2e')];return db[_0xa39a('0xcf')][_0xa39a('0x61')]({'where':{'messageId':_0x3c4f12[_0xa39a('0x65')]['redif']}});}break;}}})[_0xa39a('0x23')](handleEntityNotFound(_0x2d4953,null))[_0xa39a('0x23')](function(_0x187901){if(_0x187901){_0x456e4b=_0x187901;switch(_0x5d06e7[_0xa39a('0x46')]){case _0xa39a('0x88'):if(_0x7e9ec5===_0xa39a('0xd8')){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),'skebby',util[_0xa39a('0xd3')](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa39a('0x8c'):if(_0x7e9ec5==='1'){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),'skebby',util[_0xa39a('0xd3')](_0x3c4f12['body'],{'showHidden':![],'depth':null}));}break;case _0xa39a('0x8d'):if(!_0x3c4f12[_0xa39a('0x65')][_0xa39a('0xda')]&&_0x7e9ec5>=0xc8&&_0x7e9ec5<=0xce){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),_0xa39a('0x8d'),util[_0xa39a('0xd3')](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1d6ec0=_0x3c4f12[_0xa39a('0x65')][_0xa39a('0x92')][0x0];if(_0x1d6ec0[_0xa39a('0x2e')][_0xa39a('0xdb')]===_0xa39a('0xd8')){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),_0xa39a('0x91'),util[_0xa39a('0xd3')](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x7e9ec5==_0xa39a('0xdc')||_0x7e9ec5==_0xa39a('0xdd')){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger['error'](_0xa39a('0x26'),_0xa39a('0x2e'),_0xa39a('0x96'),util[_0xa39a('0xd3')](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa39a('0x99'):if(_0x7e9ec5==_0xa39a('0xde')){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),'bandwidth',util['inspect'](_0x3c4f12[_0xa39a('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa39a('0x9a'):if(_0x7e9ec5===_0xa39a('0xdf')||_0x7e9ec5==='ACCEPTD'){return _0x456e4b[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),_0xa39a('0x9a'),util['inspect'](_0x3c4f12['body'],{'showHidden':![],'depth':null}));}break;}return _0x456e4b;}})['then'](respondWithResult(_0x2d4953,null))[_0xa39a('0x63')](handleError(_0x2d4953,null));};exports[_0xa39a('0xe0')]=function(_0x4b7bc7,_0x3cf886,_0x45c0bc){var _0x4ab748,_0x4aa2fd,_0x459d0e;return db[_0xa39a('0x43')][_0xa39a('0x61')]({'where':{'id':_0x4b7bc7[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x3cf886,null))[_0xa39a('0x23')](function(_0x4a9f2b){if(_0x4a9f2b){_0x459d0e=_0x4a9f2b;logger[_0xa39a('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa39a('0x2e'),_0xa39a('0xd2'),_0x4a9f2b[_0xa39a('0x46')],util[_0xa39a('0xd3')](_0x4b7bc7[_0xa39a('0x49')],{'showHidden':![],'depth':null}));switch(_0x4a9f2b['type']){case'csc':if(_0x4b7bc7['query'][_0xa39a('0xe1')]&&_0x4b7bc7[_0xa39a('0x49')][_0xa39a('0xe2')]){_0x4aa2fd=_0x4b7bc7[_0xa39a('0x49')][_0xa39a('0xe2')];return db[_0xa39a('0xcf')]['find']({'where':{'messageId':_0x4b7bc7[_0xa39a('0x49')][_0xa39a('0xe1')]}});}break;}}})[_0xa39a('0x23')](handleEntityNotFound(_0x3cf886,null))[_0xa39a('0x23')](function(_0x79468c){if(_0x79468c){_0x4ab748=_0x79468c;switch(_0x459d0e['type']){case _0xa39a('0x93'):if(_0x4aa2fd==='2'||_0x4aa2fd==='6'){return _0x4ab748[_0xa39a('0x64')]({'read':!![]});}else{logger[_0xa39a('0x27')](_0xa39a('0x26'),_0xa39a('0x2e'),_0xa39a('0x93'),util[_0xa39a('0xd3')](_0x4b7bc7[_0xa39a('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x4ab748;}})['then'](respondWithResult(_0x3cf886,null))[_0xa39a('0x63')](handleError(_0x3cf886,null));};exports['addAgents']=function(_0x32421c,_0x4565a1,_0x36f423){return db[_0xa39a('0x43')]['find']({'where':{'id':_0x32421c[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x4565a1,null))[_0xa39a('0x23')](function(_0x19b4d4){if(_0x19b4d4){return _0x19b4d4[_0xa39a('0xe3')](_0x32421c['body'][_0xa39a('0x70')],_[_0xa39a('0xa8')](_0x32421c[_0xa39a('0x65')],['ids','id'])||{})['spread'](function(_0x257bee){for(var _0x533b2d=0x0;_0x533b2d<_0x32421c[_0xa39a('0x65')]['ids'][_0xa39a('0x5c')];_0x533b2d+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x32421c[_0xa39a('0x65')][_0xa39a('0x70')][_0x533b2d]),'SmsAccountId':Number(_0x32421c['params']['id'])});}return _0x257bee;});}})[_0xa39a('0x23')](respondWithResult(_0x4565a1,null))[_0xa39a('0x63')](handleError(_0x4565a1,null));};exports['removeAgents']=function(_0x4180aa,_0x123846,_0x531bfe){return db[_0xa39a('0x43')]['find']({'where':{'id':_0x4180aa[_0xa39a('0x66')]['id']}})['then'](handleEntityNotFound(_0x123846,null))[_0xa39a('0x23')](function(_0x27474a){if(_0x27474a){return _0x27474a[_0xa39a('0xe4')](_0x4180aa[_0xa39a('0x49')]['ids'])[_0xa39a('0x23')](function(){if(_[_0xa39a('0xe5')](_0x4180aa[_0xa39a('0x49')][_0xa39a('0x70')])){for(var _0x4749e1=0x0;_0x4749e1<_0x4180aa[_0xa39a('0x49')][_0xa39a('0x70')][_0xa39a('0x5c')];_0x4749e1+=0x1){socket[_0xa39a('0xe6')](_0xa39a('0xe7'),{'UserId':Number(_0x4180aa[_0xa39a('0x49')][_0xa39a('0x70')][_0x4749e1]),'SmsAccountId':Number(_0x4180aa[_0xa39a('0x66')]['id'])});}}else{socket['emit'](_0xa39a('0xe7'),{'UserId':Number(_0x4180aa[_0xa39a('0x49')][_0xa39a('0x70')]),'SmsAccountId':Number(_0x4180aa[_0xa39a('0x66')]['id'])});}});}})[_0xa39a('0x23')](respondWithStatusCode(_0x123846,null))[_0xa39a('0x63')](handleError(_0x123846,null));};exports[_0xa39a('0xe8')]=function(_0x3c4451,_0x5ded4c,_0x15f5d5){var _0x170f57={};var _0x51055e={};var _0x489b7a;var _0x3069a4;return db[_0xa39a('0x43')][_0xa39a('0x6d')]({'where':{'id':_0x3c4451[_0xa39a('0x66')]['id']}})[_0xa39a('0x23')](handleEntityNotFound(_0x5ded4c,null))[_0xa39a('0x23')](function(_0x1cca48){if(_0x1cca48){_0x489b7a=_0x1cca48;_0x51055e[_0xa39a('0x48')]=_[_0xa39a('0x4a')](db[_0xa39a('0xc6')][_0xa39a('0x44')]);_0x51055e['query']=_[_0xa39a('0x4a')](_0x3c4451[_0xa39a('0x49')]);_0x51055e[_0xa39a('0x52')]=_['intersection'](_0x51055e[_0xa39a('0x48')],_0x51055e[_0xa39a('0x49')]);_0x170f57['attributes']=_[_0xa39a('0x4b')](_0x51055e[_0xa39a('0x48')],qs[_0xa39a('0x4d')](_0x3c4451[_0xa39a('0x49')]['fields']));_0x170f57['attributes']=_0x170f57[_0xa39a('0x4c')][_0xa39a('0x5c')]?_0x170f57[_0xa39a('0x4c')]:_0x51055e['model'];_0x170f57[_0xa39a('0x4f')]=qs[_0xa39a('0x50')](_0x3c4451['query'][_0xa39a('0x50')]);_0x170f57[_0xa39a('0x51')]=qs['filters'](_[_0xa39a('0x53')](_0x3c4451[_0xa39a('0x49')],_0x51055e[_0xa39a('0x52')]));if(_0x3c4451[_0xa39a('0x49')][_0xa39a('0x54')]){_0x170f57[_0xa39a('0x51')]=_['merge'](_0x170f57[_0xa39a('0x51')],{'$or':_[_0xa39a('0x42')](_0x170f57[_0xa39a('0x4c')],function(_0x314ce7){var _0x53624b={};_0x53624b[_0x314ce7]={'$like':'%'+_0x3c4451['query'][_0xa39a('0x54')]+'%'};return _0x53624b;})});}_0x170f57=_[_0xa39a('0x55')]({},_0x170f57,_0x3c4451['options']);return _0x489b7a[_0xa39a('0xe8')](_0x170f57);}})['then'](function(_0x2621ba){if(_0x2621ba){_0x3069a4=_0x2621ba[_0xa39a('0x5c')];if(!_0x3c4451[_0xa39a('0x49')][_0xa39a('0x4e')]('nolimit')){_0x170f57[_0xa39a('0x33')]=qs['limit'](_0x3c4451[_0xa39a('0x49')][_0xa39a('0x33')]);_0x170f57['offset']=qs[_0xa39a('0x30')](_0x3c4451['query'][_0xa39a('0x30')]);}return _0x489b7a[_0xa39a('0xe8')](_0x170f57);}})[_0xa39a('0x23')](function(_0x53f2fc){if(_0x53f2fc){return _0x53f2fc?{'count':_0x3069a4,'rows':_0x53f2fc}:null;}})[_0xa39a('0x23')](respondWithResult(_0x5ded4c,null))[_0xa39a('0x63')](handleError(_0x5ded4c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index d939bfa..9eb9475 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 _0x5a15=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x5a15,0x17b));var _0x55a1=function(_0x3afaa3,_0x2728f0){_0x3afaa3=_0x3afaa3-0x0;var _0x57ae78=_0x5a15[_0x3afaa3];return _0x57ae78;};'use strict';var EventEmitter=require(_0x55a1('0x0'));var SmsAccount=require(_0x55a1('0x1'))['db'][_0x55a1('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x55a1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x55a1('0x4'),'afterDestroy':_0x55a1('0x5')};function emitEvent(_0xebd0ea){return function(_0x379fae,_0x35fd5a,_0x59dab5){SmsAccountEvents[_0x55a1('0x6')](_0xebd0ea+':'+_0x379fae['id'],_0x379fae);SmsAccountEvents['emit'](_0xebd0ea,_0x379fae);_0x59dab5(null);};}for(var e in events){if(events[_0x55a1('0x7')](e)){var event=events[e];SmsAccount[_0x55a1('0x8')](e,emitEvent(event));}}module[_0x55a1('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xc14c=['events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4e7c99,_0x512064){var _0x1d2c60=function(_0x5e2a28){while(--_0x5e2a28){_0x4e7c99['push'](_0x4e7c99['shift']());}};_0x1d2c60(++_0x512064);}(_0xc14c,0x1e6));var _0xcc14=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc14c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xcc14('0x0'));var SmsAccount=require(_0xcc14('0x1'))['db'][_0xcc14('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xcc14('0x3')](0x0);var events={'afterCreate':_0xcc14('0x4'),'afterUpdate':'update','afterDestroy':_0xcc14('0x5')};function emitEvent(_0x5c16df){return function(_0x26abca,_0x524198,_0x51d5f9){SmsAccountEvents[_0xcc14('0x6')](_0x5c16df+':'+_0x26abca['id'],_0x26abca);SmsAccountEvents[_0xcc14('0x6')](_0x5c16df,_0x26abca);_0x51d5f9(null);};}for(var e in events){if(events[_0xcc14('0x7')](e)){var event=events[e];SmsAccount[_0xcc14('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6055967..0dcd0f1 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 _0xa126=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsAccount','sms_accounts','../../config/logger','api'];(function(_0x533b09,_0x4d0203){var _0x3f6f6d=function(_0x2408d){while(--_0x2408d){_0x533b09['push'](_0x533b09['shift']());}};_0x3f6f6d(++_0x4d0203);}(_0xa126,0x1d2));var _0x6a12=function(_0x535c12,_0x55fc02){_0x535c12=_0x535c12-0x0;var _0x5a9f6f=_0xa126[_0x535c12];return _0x5a9f6f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a12('0x0'))(_0x6a12('0x1'));var moment=require(_0x6a12('0x2'));var BPromise=require(_0x6a12('0x3'));var rp=require(_0x6a12('0x4'));var fs=require('fs');var path=require(_0x6a12('0x5'));var rimraf=require(_0x6a12('0x6'));var config=require(_0x6a12('0x7'));var attributes=require('./smsAccount.attributes');module[_0x6a12('0x8')]=function(_0x905329,_0x55f112){return _0x905329[_0x6a12('0x9')](_0x6a12('0xa'),attributes,{'tableName':_0x6a12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9831=['define','sms_accounts','lodash','bluebird','rimraf','./smsAccount.attributes','exports'];(function(_0x3c8009,_0x45b032){var _0x9b032f=function(_0x23579f){while(--_0x23579f){_0x3c8009['push'](_0x3c8009['shift']());}};_0x9b032f(++_0x45b032);}(_0x9831,0x13d));var _0x1983=function(_0x58c6e2,_0xa7848b){_0x58c6e2=_0x58c6e2-0x0;var _0x46b779=_0x9831[_0x58c6e2];return _0x46b779;};'use strict';var _=require(_0x1983('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1983('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1983('0x2'));var config=require('../../config/environment');var attributes=require(_0x1983('0x3'));module[_0x1983('0x4')]=function(_0xed8533,_0x3d4a60){return _0xed8533[_0x1983('0x5')]('SmsAccount',attributes,{'tableName':_0x1983('0x6'),'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 074508f..ab2ceda 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 _0x32f7=['error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x32f7,0x182));var _0x732f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x732f('0x0'));var util=require(_0x732f('0x1'));var moment=require(_0x732f('0x2'));var BPromise=require(_0x732f('0x3'));var rs=require(_0x732f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x732f('0x5'))(_0x732f('0x6'));var config=require(_0x732f('0x7'));var jayson=require(_0x732f('0x8'));var client=jayson[_0x732f('0x9')][_0x732f('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x732f('0xb')],{'host':_0x732f('0xc'),'port':0x18eb});var socket=require(_0x732f('0xd'))(new Redis(config[_0x732f('0xb')]));require(_0x732f('0xe'))['register'](socket);function respondWithRpcPromise(_0x38069f,_0x1eb8ff,_0x3b8ab9){return new BPromise(function(_0xdd60df,_0x8d0f31){return client[_0x732f('0xf')](_0x38069f,_0x3b8ab9)[_0x732f('0x10')](function(_0x2c6db7){logger[_0x732f('0x11')]('SmsAccount,\x20%s,\x20%s',_0x1eb8ff,_0x732f('0x12'));logger[_0x732f('0x13')](_0x732f('0x14'),_0x1eb8ff,_0x732f('0x12'),JSON['stringify'](_0x2c6db7));if(_0x2c6db7[_0x732f('0x15')]){if(_0x2c6db7['error'][_0x732f('0x16')]===0x1f4){logger[_0x732f('0x15')]('SmsAccount,\x20%s,\x20%s',_0x1eb8ff,_0x2c6db7[_0x732f('0x15')][_0x732f('0x17')]);return _0x8d0f31(_0x2c6db7['error'][_0x732f('0x17')]);}logger[_0x732f('0x15')](_0x732f('0x18'),_0x1eb8ff,_0x2c6db7[_0x732f('0x15')][_0x732f('0x17')]);return _0xdd60df(_0x2c6db7[_0x732f('0x15')][_0x732f('0x17')]);}else{logger[_0x732f('0x11')](_0x732f('0x18'),_0x1eb8ff,'request\x20sent');_0xdd60df(_0x2c6db7[_0x732f('0x19')][_0x732f('0x17')]);}})[_0x732f('0x1a')](function(_0x47fb71){logger[_0x732f('0x15')]('SmsAccount,\x20%s,\x20%s',_0x1eb8ff,_0x47fb71);_0x8d0f31(_0x47fb71);});});}exports[_0x732f('0x1b')]=function(_0x6c32e0){var _0x17a5d4=this;return new Promise(function(_0x5331f9,_0x1221f2){return db[_0x732f('0x1c')][_0x732f('0x1d')]({'raw':_0x6c32e0[_0x732f('0x1e')]?_0x6c32e0['options']['raw']===undefined?!![]:![]:!![],'where':_0x6c32e0[_0x732f('0x1e')]?_0x6c32e0[_0x732f('0x1e')][_0x732f('0x1f')]||null:null,'attributes':_0x6c32e0[_0x732f('0x1e')]?_0x6c32e0['options'][_0x732f('0x20')]||null:null,'include':_0x6c32e0['options']?_0x6c32e0[_0x732f('0x1e')][_0x732f('0x21')]?_[_0x732f('0x22')](_0x6c32e0['options']['include'],function(_0x494404){return{'model':db[_0x494404[_0x732f('0x23')]],'as':_0x494404['as'],'attributes':_0x494404['attributes'],'include':_0x494404[_0x732f('0x21')]?_[_0x732f('0x22')](_0x494404['include'],function(_0x52062e){return{'model':db[_0x52062e[_0x732f('0x23')]],'as':_0x52062e['as'],'attributes':_0x52062e['attributes'],'include':_0x52062e['include']?_[_0x732f('0x22')](_0x52062e[_0x732f('0x21')],function(_0x2ab8c0){return{'model':db[_0x2ab8c0[_0x732f('0x23')]],'as':_0x2ab8c0['as'],'attributes':_0x2ab8c0[_0x732f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x732f('0x10')](function(_0x3796df){logger['info'](_0x732f('0x1b'),_0x6c32e0);logger[_0x732f('0x13')](_0x732f('0x1b'),_0x6c32e0,JSON[_0x732f('0x24')](_0x3796df));_0x5331f9(_0x3796df);})['catch'](function(_0x2fa1a1){logger[_0x732f('0x15')]('ShowSmsAccount',_0x2fa1a1[_0x732f('0x17')],_0x6c32e0);_0x1221f2(_0x17a5d4['error'](0x1f4,_0x2fa1a1[_0x732f('0x17')]));});});}; \ No newline at end of file +var _0x9aaf=['info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then'];(function(_0x2ca9f1,_0xff9bd3){var _0x73f4a7=function(_0x26d4a8){while(--_0x26d4a8){_0x2ca9f1['push'](_0x2ca9f1['shift']());}};_0x73f4a7(++_0xff9bd3);}(_0x9aaf,0x116));var _0xf9aa=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x9aaf[_0x178f52];return _0x556f99;};'use strict';var _=require(_0xf9aa('0x0'));var util=require('util');var moment=require(_0xf9aa('0x1'));var BPromise=require(_0xf9aa('0x2'));var rs=require(_0xf9aa('0x3'));var fs=require('fs');var Redis=require(_0xf9aa('0x4'));var db=require(_0xf9aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9aa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf9aa('0x7'));var client=jayson[_0xf9aa('0x8')][_0xf9aa('0x9')]({'port':0x232a});config['redis']=_[_0xf9aa('0xa')](config[_0xf9aa('0xb')],{'host':_0xf9aa('0xc'),'port':0x18eb});var socket=require(_0xf9aa('0xd'))(new Redis(config[_0xf9aa('0xb')]));require(_0xf9aa('0xe'))[_0xf9aa('0xf')](socket);function respondWithRpcPromise(_0x29b5d1,_0x301e08,_0x265d38){return new BPromise(function(_0x560330,_0x36c736){return client[_0xf9aa('0x10')](_0x29b5d1,_0x265d38)[_0xf9aa('0x11')](function(_0x1865c1){logger[_0xf9aa('0x12')](_0xf9aa('0x13'),_0x301e08,'request\x20sent');logger['debug'](_0xf9aa('0x14'),_0x301e08,'request\x20sent',JSON[_0xf9aa('0x15')](_0x1865c1));if(_0x1865c1[_0xf9aa('0x16')]){if(_0x1865c1[_0xf9aa('0x16')][_0xf9aa('0x17')]===0x1f4){logger['error'](_0xf9aa('0x13'),_0x301e08,_0x1865c1['error']['message']);return _0x36c736(_0x1865c1['error'][_0xf9aa('0x18')]);}logger[_0xf9aa('0x16')](_0xf9aa('0x13'),_0x301e08,_0x1865c1['error']['message']);return _0x560330(_0x1865c1['error'][_0xf9aa('0x18')]);}else{logger[_0xf9aa('0x12')](_0xf9aa('0x13'),_0x301e08,'request\x20sent');_0x560330(_0x1865c1['result'][_0xf9aa('0x18')]);}})['catch'](function(_0x5351ce){logger[_0xf9aa('0x16')](_0xf9aa('0x13'),_0x301e08,_0x5351ce);_0x36c736(_0x5351ce);});});}exports[_0xf9aa('0x19')]=function(_0x21ccab){var _0x1f558b=this;return new Promise(function(_0x5e8d55,_0x3e6e59){return db[_0xf9aa('0x1a')][_0xf9aa('0x1b')]({'raw':_0x21ccab[_0xf9aa('0x1c')]?_0x21ccab[_0xf9aa('0x1c')][_0xf9aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x21ccab[_0xf9aa('0x1c')]?_0x21ccab[_0xf9aa('0x1c')][_0xf9aa('0x1e')]||null:null,'attributes':_0x21ccab[_0xf9aa('0x1c')]?_0x21ccab['options']['attributes']||null:null,'include':_0x21ccab[_0xf9aa('0x1c')]?_0x21ccab[_0xf9aa('0x1c')][_0xf9aa('0x1f')]?_[_0xf9aa('0x20')](_0x21ccab[_0xf9aa('0x1c')][_0xf9aa('0x1f')],function(_0x518e2d){return{'model':db[_0x518e2d[_0xf9aa('0x21')]],'as':_0x518e2d['as'],'attributes':_0x518e2d['attributes'],'include':_0x518e2d[_0xf9aa('0x1f')]?_[_0xf9aa('0x20')](_0x518e2d['include'],function(_0x54b97b){return{'model':db[_0x54b97b['model']],'as':_0x54b97b['as'],'attributes':_0x54b97b[_0xf9aa('0x22')],'include':_0x54b97b[_0xf9aa('0x1f')]?_[_0xf9aa('0x20')](_0x54b97b[_0xf9aa('0x1f')],function(_0x25c690){return{'model':db[_0x25c690[_0xf9aa('0x21')]],'as':_0x25c690['as'],'attributes':_0x25c690['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30c1f6){logger[_0xf9aa('0x12')](_0xf9aa('0x19'),_0x21ccab);logger[_0xf9aa('0x23')](_0xf9aa('0x19'),_0x21ccab,JSON['stringify'](_0x30c1f6));_0x5e8d55(_0x30c1f6);})[_0xf9aa('0x24')](function(_0x4fddd8){logger[_0xf9aa('0x16')](_0xf9aa('0x19'),_0x4fddd8[_0xf9aa('0x18')],_0x21ccab);_0x3e6e59(_0x1f558b['error'](0x1f4,_0x4fddd8[_0xf9aa('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 55c88a0..5b456b0 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 2967324..24ecbdd 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0xfa0652,_0x757680){var _0x13b16a=function(_0x31ac6c){while(--_0x31ac6c){_0xfa0652['push'](_0xfa0652['shift']());}};_0x13b16a(++_0x757680);}(_0x008c,0x188));var _0xc008=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x008c[_0x19b84f];return _0x18067b;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _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(_0xa5d79c,_0x5eef1e){var _0x444875=function(_0x3ebe85){while(--_0x3ebe85){_0xa5d79c['push'](_0xa5d79c['shift']());}};_0x444875(++_0x5eef1e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2bad97,_0x14832c){_0x2bad97=_0x2bad97-0x0;var _0xa7ec73=_0xedd9[_0x2bad97];return _0xa7ec73;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index bf81355..feaa15d 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 _0xad35=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x226649,_0x51cf76){var _0x270b07=function(_0x553294){while(--_0x553294){_0x226649['push'](_0x226649['shift']());}};_0x270b07(++_0x51cf76);}(_0xad35,0xca));var _0x5ad3=function(_0x242995,_0x282deb){_0x242995=_0x242995-0x0;var _0x26af9b=_0xad35[_0x242995];return _0x26af9b;};'use strict';var Sequelize=require(_0x5ad3('0x0'));module[_0x5ad3('0x1')]={'priority':{'type':Sequelize[_0x5ad3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5ad3('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5ad3('0x3')]},'interval':{'type':Sequelize[_0x5ad3('0x3')],'defaultValue':_0x5ad3('0x4')}}; \ No newline at end of file +var _0xa9a4=['STRING','noop','*,*,*,*','sequelize'];(function(_0x320f79,_0x213f9b){var _0x3f0985=function(_0x53ba37){while(--_0x53ba37){_0x320f79['push'](_0x320f79['shift']());}};_0x3f0985(++_0x213f9b);}(_0xa9a4,0x173));var _0x4a9a=function(_0x35f477,_0x57d8c8){_0x35f477=_0x35f477-0x0;var _0x42a657=_0xa9a4[_0x35f477];return _0x42a657;};'use strict';var Sequelize=require(_0x4a9a('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4a9a('0x1')],'allowNull':![],'defaultValue':_0x4a9a('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4a9a('0x1')]},'interval':{'type':Sequelize[_0x4a9a('0x1')],'defaultValue':_0x4a9a('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 60cf5fe..12f44c1 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 _0x94d2=['SmsApplication','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','catch','params','length','includeAll','options','find','create','body','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','send','index','map'];(function(_0x50bccf,_0x2be599){var _0x4e4417=function(_0x341830){while(--_0x341830){_0x50bccf['push'](_0x50bccf['shift']());}};_0x4e4417(++_0x2be599);}(_0x94d2,0x17b));var _0x294d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x94d2[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x294d('0x0'));var rp=require(_0x294d('0x1'));var moment=require(_0x294d('0x2'));var BPromise=require(_0x294d('0x3'));var Mustache=require(_0x294d('0x4'));var util=require(_0x294d('0x5'));var path=require(_0x294d('0x6'));var sox=require('sox');var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require(_0x294d('0xa'));var crypto=require(_0x294d('0xb'));var jsforce=require(_0x294d('0xc'));var deskjs=require(_0x294d('0xd'));var toCsv=require(_0x294d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require(_0x294d('0x12'))(_0x294d('0x13'));var utils=require(_0x294d('0x14'));var config=require(_0x294d('0x15'));var licenseUtil=require(_0x294d('0x16'));var db=require(_0x294d('0x17'))['db'];function respondWithStatusCode(_0x384de2,_0x2af98a){_0x2af98a=_0x2af98a||0xcc;return function(_0x5393f4){if(_0x5393f4){return _0x384de2[_0x294d('0x18')](_0x2af98a);}return _0x384de2[_0x294d('0x19')](_0x2af98a)[_0x294d('0x1a')]();};}function respondWithResult(_0x6a4d7d,_0x30a152){_0x30a152=_0x30a152||0xc8;return function(_0x361f12){if(_0x361f12){return _0x6a4d7d[_0x294d('0x19')](_0x30a152)['json'](_0x361f12);}};}function respondWithFilteredResult(_0x545b41,_0x178b5f){return function(_0x428539){if(_0x428539){var _0x30fa01=typeof _0x178b5f['offset']===_0x294d('0x1b')&&typeof _0x178b5f[_0x294d('0x1c')]===_0x294d('0x1b');var _0x1f9618=_0x428539[_0x294d('0x1d')];var _0x301718=_0x30fa01?0x0:_0x178b5f[_0x294d('0x1e')];var _0x272309=_0x30fa01?_0x428539['count']:_0x178b5f[_0x294d('0x1e')]+_0x178b5f[_0x294d('0x1c')];var _0x1bdea2;if(_0x272309>=_0x1f9618){_0x272309=_0x1f9618;_0x1bdea2=0xc8;}else{_0x1bdea2=0xce;}_0x545b41['status'](_0x1bdea2);return _0x545b41[_0x294d('0x1f')]('Content-Range',_0x301718+'-'+_0x272309+'/'+_0x1f9618)[_0x294d('0x20')](_0x428539);}return null;};}function patchUpdates(_0x4d61da){return function(_0x4c026a){try{jsonpatch[_0x294d('0x21')](_0x4c026a,_0x4d61da,!![]);}catch(_0x23ca33){return BPromise['reject'](_0x23ca33);}return _0x4c026a[_0x294d('0x22')]();};}function saveUpdates(_0x4338aa,_0x331a7b){return function(_0x16f5ba){if(_0x16f5ba){return _0x16f5ba[_0x294d('0x23')](_0x4338aa)[_0x294d('0x24')](function(_0x4409a8){return _0x4409a8;});}return null;};}function removeEntity(_0x4a19c3,_0x83ceac){return function(_0x4a35b2){if(_0x4a35b2){return _0x4a35b2['destroy']()[_0x294d('0x24')](function(){_0x4a19c3[_0x294d('0x19')](0xcc)[_0x294d('0x1a')]();});}};}function handleEntityNotFound(_0x2784dc,_0x1781d1){return function(_0x57345b){if(!_0x57345b){_0x2784dc[_0x294d('0x18')](0x194);}return _0x57345b;};}function handleError(_0x19295b,_0x28cd87){_0x28cd87=_0x28cd87||0x1f4;return function(_0xde1152){logger[_0x294d('0x25')](_0xde1152['stack']);if(_0xde1152['name']){delete _0xde1152['name'];}_0x19295b[_0x294d('0x19')](_0x28cd87)[_0x294d('0x26')](_0xde1152);};}exports[_0x294d('0x27')]=function(_0x2b67f5,_0x42a702){var _0x4b4299={},_0x226953={},_0x373404={'count':0x0,'rows':[]};var _0xa3e2be=_[_0x294d('0x28')](db[_0x294d('0x29')][_0x294d('0x2a')],function(_0x3fe1f0){return{'name':_0x3fe1f0['fieldName'],'type':_0x3fe1f0[_0x294d('0x2b')][_0x294d('0x2c')]};});_0x226953[_0x294d('0x2d')]=_['map'](_0xa3e2be,_0x294d('0x2e'));_0x226953[_0x294d('0x2f')]=_[_0x294d('0x30')](_0x2b67f5['query']);_0x226953[_0x294d('0x31')]=_['intersection'](_0x226953[_0x294d('0x2d')],_0x226953[_0x294d('0x2f')]);_0x4b4299[_0x294d('0x32')]=_[_0x294d('0x33')](_0x226953[_0x294d('0x2d')],qs[_0x294d('0x34')](_0x2b67f5[_0x294d('0x2f')][_0x294d('0x34')]));_0x4b4299[_0x294d('0x32')]=_0x4b4299[_0x294d('0x32')]['length']?_0x4b4299[_0x294d('0x32')]:_0x226953[_0x294d('0x2d')];if(!_0x2b67f5[_0x294d('0x2f')][_0x294d('0x35')](_0x294d('0x36'))){_0x4b4299[_0x294d('0x1c')]=qs[_0x294d('0x1c')](_0x2b67f5[_0x294d('0x2f')][_0x294d('0x1c')]);_0x4b4299[_0x294d('0x1e')]=qs[_0x294d('0x1e')](_0x2b67f5[_0x294d('0x2f')][_0x294d('0x1e')]);}_0x4b4299[_0x294d('0x37')]=qs['sort'](_0x2b67f5[_0x294d('0x2f')][_0x294d('0x38')]);_0x4b4299[_0x294d('0x39')]=qs[_0x294d('0x31')](_[_0x294d('0x3a')](_0x2b67f5[_0x294d('0x2f')],_0x226953['filters']),_0xa3e2be);if(_0x2b67f5[_0x294d('0x2f')][_0x294d('0x3b')]){_0x4b4299[_0x294d('0x39')]=_[_0x294d('0x3c')](_0x4b4299['where'],{'$or':_[_0x294d('0x28')](_0xa3e2be,function(_0x2a028e){if(_0x2a028e[_0x294d('0x2b')]!=='VIRTUAL'){var _0xe39e4={};_0xe39e4[_0x2a028e['name']]={'$like':'%'+_0x2b67f5[_0x294d('0x2f')][_0x294d('0x3b')]+'%'};return _0xe39e4;}})});}_0x4b4299=_[_0x294d('0x3c')]({},_0x4b4299,_0x2b67f5['options']);var _0x2068cc={'where':_0x4b4299[_0x294d('0x39')]};return db[_0x294d('0x29')]['count'](_0x2068cc)[_0x294d('0x24')](function(_0x4697a2){_0x373404[_0x294d('0x1d')]=_0x4697a2;if(_0x2b67f5[_0x294d('0x2f')]['includeAll']){_0x4b4299['include']=[{'all':!![]}];}return db[_0x294d('0x29')]['findAll'](_0x4b4299);})['then'](function(_0x28e0be){_0x373404['rows']=_0x28e0be;return _0x373404;})[_0x294d('0x24')](respondWithFilteredResult(_0x42a702,_0x4b4299))[_0x294d('0x3d')](handleError(_0x42a702,null));};exports['show']=function(_0x29eee4,_0x39478a){var _0x4d5b70={'raw':!![],'where':{'id':_0x29eee4[_0x294d('0x3e')]['id']}},_0x52226e={};_0x52226e['model']=_['keys'](db[_0x294d('0x29')][_0x294d('0x2a')]);_0x52226e[_0x294d('0x2f')]=_[_0x294d('0x30')](_0x29eee4[_0x294d('0x2f')]);_0x52226e[_0x294d('0x31')]=_['intersection'](_0x52226e[_0x294d('0x2d')],_0x52226e['query']);_0x4d5b70[_0x294d('0x32')]=_[_0x294d('0x33')](_0x52226e[_0x294d('0x2d')],qs[_0x294d('0x34')](_0x29eee4[_0x294d('0x2f')][_0x294d('0x34')]));_0x4d5b70[_0x294d('0x32')]=_0x4d5b70[_0x294d('0x32')][_0x294d('0x3f')]?_0x4d5b70[_0x294d('0x32')]:_0x52226e[_0x294d('0x2d')];if(_0x29eee4['query'][_0x294d('0x40')]){_0x4d5b70['include']=[{'all':!![]}];}_0x4d5b70=_[_0x294d('0x3c')]({},_0x4d5b70,_0x29eee4[_0x294d('0x41')]);return db[_0x294d('0x29')][_0x294d('0x42')](_0x4d5b70)['then'](handleEntityNotFound(_0x39478a,null))[_0x294d('0x24')](respondWithResult(_0x39478a,null))[_0x294d('0x3d')](handleError(_0x39478a,null));};exports[_0x294d('0x43')]=function(_0x226e57,_0xe9b576){return db['SmsApplication']['create'](_0x226e57[_0x294d('0x44')],{})[_0x294d('0x24')](respondWithResult(_0xe9b576,0xc9))[_0x294d('0x3d')](handleError(_0xe9b576,null));};exports[_0x294d('0x23')]=function(_0x238a25,_0x4432d5){if(_0x238a25['body']['id']){delete _0x238a25[_0x294d('0x44')]['id'];}return db[_0x294d('0x29')][_0x294d('0x42')]({'where':{'id':_0x238a25['params']['id']}})[_0x294d('0x24')](handleEntityNotFound(_0x4432d5,null))[_0x294d('0x24')](saveUpdates(_0x238a25[_0x294d('0x44')],null))[_0x294d('0x24')](respondWithResult(_0x4432d5,null))[_0x294d('0x3d')](handleError(_0x4432d5,null));};exports[_0x294d('0x45')]=function(_0x40f090,_0x146dd0){return db[_0x294d('0x29')][_0x294d('0x42')]({'where':{'id':_0x40f090['params']['id']}})['then'](handleEntityNotFound(_0x146dd0,null))[_0x294d('0x24')](removeEntity(_0x146dd0,null))[_0x294d('0x3d')](handleError(_0x146dd0,null));}; \ No newline at end of file +var _0xe743=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','reject','save','update','then','end','error','stack','name','index','map','SmsApplication','type','key','model','query'];(function(_0x5b4736,_0x54a755){var _0x18b272=function(_0x328fb7){while(--_0x328fb7){_0x5b4736['push'](_0x5b4736['shift']());}};_0x18b272(++_0x54a755);}(_0xe743,0xfe));var _0x3e74=function(_0x444473,_0x4ad07d){_0x444473=_0x444473-0x0;var _0x206743=_0xe743[_0x444473];return _0x206743;};'use strict';var emlformat=require(_0x3e74('0x0'));var rimraf=require(_0x3e74('0x1'));var zipdir=require(_0x3e74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e74('0x3'));var BPromise=require(_0x3e74('0x4'));var Mustache=require(_0x3e74('0x5'));var util=require('util');var path=require(_0x3e74('0x6'));var sox=require(_0x3e74('0x7'));var csv=require(_0x3e74('0x8'));var ejs=require(_0x3e74('0x9'));var fs=require('fs');var fs_extra=require(_0x3e74('0xa'));var _=require(_0x3e74('0xb'));var squel=require(_0x3e74('0xc'));var crypto=require('crypto');var jsforce=require(_0x3e74('0xd'));var deskjs=require(_0x3e74('0xe'));var toCsv=require(_0x3e74('0x8'));var querystring=require(_0x3e74('0xf'));var Papa=require(_0x3e74('0x10'));var Redis=require(_0x3e74('0x11'));var authService=require(_0x3e74('0x12'));var qs=require(_0x3e74('0x13'));var as=require(_0x3e74('0x14'));var hardwareService=require(_0x3e74('0x15'));var logger=require('../../config/logger')(_0x3e74('0x16'));var utils=require(_0x3e74('0x17'));var config=require(_0x3e74('0x18'));var licenseUtil=require(_0x3e74('0x19'));var db=require(_0x3e74('0x1a'))['db'];function respondWithStatusCode(_0x4ad51b,_0x426918){_0x426918=_0x426918||0xcc;return function(_0x389387){if(_0x389387){return _0x4ad51b[_0x3e74('0x1b')](_0x426918);}return _0x4ad51b[_0x3e74('0x1c')](_0x426918)['end']();};}function respondWithResult(_0x2b65ff,_0x100212){_0x100212=_0x100212||0xc8;return function(_0x1f0069){if(_0x1f0069){return _0x2b65ff[_0x3e74('0x1c')](_0x100212)[_0x3e74('0x1d')](_0x1f0069);}};}function respondWithFilteredResult(_0x1d2845,_0x5abadc){return function(_0x380275){if(_0x380275){var _0x30d5e9=typeof _0x5abadc['offset']===_0x3e74('0x1e')&&typeof _0x5abadc['limit']==='undefined';var _0x436bcb=_0x380275[_0x3e74('0x1f')];var _0x4beb2d=_0x30d5e9?0x0:_0x5abadc[_0x3e74('0x20')];var _0x536068=_0x30d5e9?_0x380275[_0x3e74('0x1f')]:_0x5abadc[_0x3e74('0x20')]+_0x5abadc[_0x3e74('0x21')];var _0x28d8da;if(_0x536068>=_0x436bcb){_0x536068=_0x436bcb;_0x28d8da=0xc8;}else{_0x28d8da=0xce;}_0x1d2845[_0x3e74('0x1c')](_0x28d8da);return _0x1d2845[_0x3e74('0x22')]('Content-Range',_0x4beb2d+'-'+_0x536068+'/'+_0x436bcb)[_0x3e74('0x1d')](_0x380275);}return null;};}function patchUpdates(_0x13ff33){return function(_0x1e2b60){try{jsonpatch['apply'](_0x1e2b60,_0x13ff33,!![]);}catch(_0x295f7f){return BPromise[_0x3e74('0x23')](_0x295f7f);}return _0x1e2b60[_0x3e74('0x24')]();};}function saveUpdates(_0x125335,_0x347b6c){return function(_0x202eeb){if(_0x202eeb){return _0x202eeb[_0x3e74('0x25')](_0x125335)[_0x3e74('0x26')](function(_0x9684e2){return _0x9684e2;});}return null;};}function removeEntity(_0x390c36,_0x47bd68){return function(_0x234020){if(_0x234020){return _0x234020['destroy']()[_0x3e74('0x26')](function(){_0x390c36[_0x3e74('0x1c')](0xcc)[_0x3e74('0x27')]();});}};}function handleEntityNotFound(_0x1f21eb,_0x3adfcd){return function(_0x39847e){if(!_0x39847e){_0x1f21eb[_0x3e74('0x1b')](0x194);}return _0x39847e;};}function handleError(_0x4c9b21,_0x48c436){_0x48c436=_0x48c436||0x1f4;return function(_0x50700c){logger[_0x3e74('0x28')](_0x50700c[_0x3e74('0x29')]);if(_0x50700c[_0x3e74('0x2a')]){delete _0x50700c[_0x3e74('0x2a')];}_0x4c9b21[_0x3e74('0x1c')](_0x48c436)['send'](_0x50700c);};}exports[_0x3e74('0x2b')]=function(_0x137754,_0x89a749){var _0x514f29={},_0x3f0460={},_0x19442b={'count':0x0,'rows':[]};var _0x320913=_[_0x3e74('0x2c')](db[_0x3e74('0x2d')]['rawAttributes'],function(_0x4cf178){return{'name':_0x4cf178['fieldName'],'type':_0x4cf178[_0x3e74('0x2e')][_0x3e74('0x2f')]};});_0x3f0460[_0x3e74('0x30')]=_[_0x3e74('0x2c')](_0x320913,_0x3e74('0x2a'));_0x3f0460[_0x3e74('0x31')]=_['keys'](_0x137754[_0x3e74('0x31')]);_0x3f0460[_0x3e74('0x32')]=_[_0x3e74('0x33')](_0x3f0460[_0x3e74('0x30')],_0x3f0460[_0x3e74('0x31')]);_0x514f29[_0x3e74('0x34')]=_['intersection'](_0x3f0460['model'],qs[_0x3e74('0x35')](_0x137754['query'][_0x3e74('0x35')]));_0x514f29[_0x3e74('0x34')]=_0x514f29['attributes'][_0x3e74('0x36')]?_0x514f29[_0x3e74('0x34')]:_0x3f0460['model'];if(!_0x137754[_0x3e74('0x31')][_0x3e74('0x37')](_0x3e74('0x38'))){_0x514f29['limit']=qs[_0x3e74('0x21')](_0x137754[_0x3e74('0x31')][_0x3e74('0x21')]);_0x514f29['offset']=qs[_0x3e74('0x20')](_0x137754[_0x3e74('0x31')]['offset']);}_0x514f29[_0x3e74('0x39')]=qs[_0x3e74('0x3a')](_0x137754['query'][_0x3e74('0x3a')]);_0x514f29['where']=qs[_0x3e74('0x32')](_[_0x3e74('0x3b')](_0x137754['query'],_0x3f0460['filters']),_0x320913);if(_0x137754['query'][_0x3e74('0x3c')]){_0x514f29[_0x3e74('0x3d')]=_[_0x3e74('0x3e')](_0x514f29[_0x3e74('0x3d')],{'$or':_['map'](_0x320913,function(_0x1a12c5){if(_0x1a12c5[_0x3e74('0x2e')]!==_0x3e74('0x3f')){var _0x4c3d5a={};_0x4c3d5a[_0x1a12c5[_0x3e74('0x2a')]]={'$like':'%'+_0x137754[_0x3e74('0x31')]['filter']+'%'};return _0x4c3d5a;}})});}_0x514f29=_['merge']({},_0x514f29,_0x137754[_0x3e74('0x40')]);var _0x3385d3={'where':_0x514f29[_0x3e74('0x3d')]};return db['SmsApplication'][_0x3e74('0x1f')](_0x3385d3)[_0x3e74('0x26')](function(_0x35d569){_0x19442b[_0x3e74('0x1f')]=_0x35d569;if(_0x137754['query']['includeAll']){_0x514f29[_0x3e74('0x41')]=[{'all':!![]}];}return db[_0x3e74('0x2d')][_0x3e74('0x42')](_0x514f29);})[_0x3e74('0x26')](function(_0xeca1f1){_0x19442b[_0x3e74('0x43')]=_0xeca1f1;return _0x19442b;})[_0x3e74('0x26')](respondWithFilteredResult(_0x89a749,_0x514f29))[_0x3e74('0x44')](handleError(_0x89a749,null));};exports[_0x3e74('0x45')]=function(_0x1ec7e6,_0x1816a5){var _0x5b75ca={'raw':!![],'where':{'id':_0x1ec7e6[_0x3e74('0x46')]['id']}},_0x54d05d={};_0x54d05d[_0x3e74('0x30')]=_[_0x3e74('0x47')](db[_0x3e74('0x2d')]['rawAttributes']);_0x54d05d['query']=_[_0x3e74('0x47')](_0x1ec7e6['query']);_0x54d05d[_0x3e74('0x32')]=_[_0x3e74('0x33')](_0x54d05d[_0x3e74('0x30')],_0x54d05d[_0x3e74('0x31')]);_0x5b75ca['attributes']=_[_0x3e74('0x33')](_0x54d05d[_0x3e74('0x30')],qs[_0x3e74('0x35')](_0x1ec7e6[_0x3e74('0x31')][_0x3e74('0x35')]));_0x5b75ca[_0x3e74('0x34')]=_0x5b75ca['attributes'][_0x3e74('0x36')]?_0x5b75ca[_0x3e74('0x34')]:_0x54d05d[_0x3e74('0x30')];if(_0x1ec7e6[_0x3e74('0x31')]['includeAll']){_0x5b75ca[_0x3e74('0x41')]=[{'all':!![]}];}_0x5b75ca=_['merge']({},_0x5b75ca,_0x1ec7e6[_0x3e74('0x40')]);return db['SmsApplication'][_0x3e74('0x48')](_0x5b75ca)[_0x3e74('0x26')](handleEntityNotFound(_0x1816a5,null))[_0x3e74('0x26')](respondWithResult(_0x1816a5,null))[_0x3e74('0x44')](handleError(_0x1816a5,null));};exports[_0x3e74('0x49')]=function(_0x270102,_0x370283){return db[_0x3e74('0x2d')][_0x3e74('0x49')](_0x270102[_0x3e74('0x4a')],{})[_0x3e74('0x26')](respondWithResult(_0x370283,0xc9))[_0x3e74('0x44')](handleError(_0x370283,null));};exports['update']=function(_0x179cf7,_0x1d765a){if(_0x179cf7[_0x3e74('0x4a')]['id']){delete _0x179cf7[_0x3e74('0x4a')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x179cf7[_0x3e74('0x46')]['id']}})[_0x3e74('0x26')](handleEntityNotFound(_0x1d765a,null))[_0x3e74('0x26')](saveUpdates(_0x179cf7[_0x3e74('0x4a')],null))[_0x3e74('0x26')](respondWithResult(_0x1d765a,null))['catch'](handleError(_0x1d765a,null));};exports[_0x3e74('0x4b')]=function(_0x100714,_0x2ea4a9){return db['SmsApplication'][_0x3e74('0x48')]({'where':{'id':_0x100714['params']['id']}})[_0x3e74('0x26')](handleEntityNotFound(_0x2ea4a9,null))[_0x3e74('0x26')](removeEntity(_0x2ea4a9,null))[_0x3e74('0x44')](handleError(_0x2ea4a9,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e94e899..6433971 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 _0xea2b=['moment','bluebird','request-promise','path','rimraf','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x318f46,_0x3ed5a9){var _0x125f88=function(_0x388844){while(--_0x388844){_0x318f46['push'](_0x318f46['shift']());}};_0x125f88(++_0x3ed5a9);}(_0xea2b,0x1de));var _0xbea2=function(_0x58155c,_0x3cb9d5){_0x58155c=_0x58155c-0x0;var _0x5bc1cb=_0xea2b[_0x58155c];return _0x5bc1cb;};'use strict';var _=require(_0xbea2('0x0'));var util=require(_0xbea2('0x1'));var logger=require(_0xbea2('0x2'))('api');var moment=require(_0xbea2('0x3'));var BPromise=require(_0xbea2('0x4'));var rp=require(_0xbea2('0x5'));var fs=require('fs');var path=require(_0xbea2('0x6'));var rimraf=require(_0xbea2('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xbea2('0x8')]=function(_0x5f37d2,_0x20927a){return _0x5f37d2[_0xbea2('0x9')](_0xbea2('0xa'),attributes,{'tableName':_0xbea2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbea2('0xc')});}; \ No newline at end of file +var _0x06c5=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash'];(function(_0x3d85dc,_0x34f0fd){var _0x105efd=function(_0x25333b){while(--_0x25333b){_0x3d85dc['push'](_0x3d85dc['shift']());}};_0x105efd(++_0x34f0fd);}(_0x06c5,0x19f));var _0x506c=function(_0x11b249,_0x30b0ac){_0x11b249=_0x11b249-0x0;var _0x104f59=_0x06c5[_0x11b249];return _0x104f59;};'use strict';var _=require(_0x506c('0x0'));var util=require(_0x506c('0x1'));var logger=require(_0x506c('0x2'))(_0x506c('0x3'));var moment=require(_0x506c('0x4'));var BPromise=require(_0x506c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x506c('0x6'));var rimraf=require('rimraf');var config=require(_0x506c('0x7'));var attributes=require('./smsApplication.attributes');module[_0x506c('0x8')]=function(_0x1c5311,_0x5c7e2d){return _0x1c5311[_0x506c('0x9')](_0x506c('0xa'),attributes,{'tableName':_0x506c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x506c('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 509c0e2..618f0e2 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 _0x4efb=['then','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x41816c,_0x389010){var _0x482fd6=function(_0x1e102f){while(--_0x1e102f){_0x41816c['push'](_0x41816c['shift']());}};_0x482fd6(++_0x389010);}(_0x4efb,0xfa));var _0xb4ef=function(_0x4dbf45,_0x30ad2b){_0x4dbf45=_0x4dbf45-0x0;var _0x4e4f7a=_0x4efb[_0x4dbf45];return _0x4e4f7a;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var moment=require(_0xb4ef('0x1'));var BPromise=require(_0xb4ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4ef('0x4'));var logger=require(_0xb4ef('0x5'))('rpc');var config=require(_0xb4ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb4ef('0x7')][_0xb4ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x446019,_0x32bf0e,_0x863531){return new BPromise(function(_0x4cbb88,_0x1a1a33){return client[_0xb4ef('0x9')](_0x446019,_0x863531)[_0xb4ef('0xa')](function(_0x19d132){logger[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x32bf0e,'request\x20sent');logger[_0xb4ef('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x32bf0e,_0xb4ef('0xe'),JSON[_0xb4ef('0xf')](_0x19d132));if(_0x19d132[_0xb4ef('0x10')]){if(_0x19d132['error'][_0xb4ef('0x11')]===0x1f4){logger[_0xb4ef('0x10')](_0xb4ef('0xc'),_0x32bf0e,_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);return _0x1a1a33(_0x19d132[_0xb4ef('0x10')]['message']);}logger[_0xb4ef('0x10')]('SmsApplication,\x20%s,\x20%s',_0x32bf0e,_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);return _0x4cbb88(_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);}else{logger[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x32bf0e,_0xb4ef('0xe'));_0x4cbb88(_0x19d132['result'][_0xb4ef('0x12')]);}})[_0xb4ef('0x13')](function(_0x3cb21e){logger[_0xb4ef('0x10')](_0xb4ef('0xc'),_0x32bf0e,_0x3cb21e);_0x1a1a33(_0x3cb21e);});});} \ No newline at end of file +var _0xa908=['http','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa908,0x1c3));var _0x8a90=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0xa908[_0x40f991];return _0x38eca2;};'use strict';var _=require(_0x8a90('0x0'));var util=require('util');var moment=require(_0x8a90('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a90('0x2'));var fs=require('fs');var Redis=require(_0x8a90('0x3'));var db=require(_0x8a90('0x4'))['db'];var utils=require(_0x8a90('0x5'));var logger=require(_0x8a90('0x6'))('rpc');var config=require(_0x8a90('0x7'));var jayson=require(_0x8a90('0x8'));var client=jayson['client'][_0x8a90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dc8f9,_0x12d376,_0x3faf88){return new BPromise(function(_0x20f8bf,_0x200f95){return client['request'](_0x1dc8f9,_0x3faf88)[_0x8a90('0xa')](function(_0x485401){logger[_0x8a90('0xb')]('SmsApplication,\x20%s,\x20%s',_0x12d376,_0x8a90('0xc'));logger[_0x8a90('0xd')](_0x8a90('0xe'),_0x12d376,_0x8a90('0xc'),JSON[_0x8a90('0xf')](_0x485401));if(_0x485401[_0x8a90('0x10')]){if(_0x485401[_0x8a90('0x10')]['code']===0x1f4){logger['error'](_0x8a90('0x11'),_0x12d376,_0x485401[_0x8a90('0x10')][_0x8a90('0x12')]);return _0x200f95(_0x485401['error'][_0x8a90('0x12')]);}logger[_0x8a90('0x10')](_0x8a90('0x11'),_0x12d376,_0x485401['error'][_0x8a90('0x12')]);return _0x20f8bf(_0x485401[_0x8a90('0x10')]['message']);}else{logger[_0x8a90('0xb')](_0x8a90('0x11'),_0x12d376,_0x8a90('0xc'));_0x20f8bf(_0x485401[_0x8a90('0x13')]['message']);}})['catch'](function(_0x14db82){logger[_0x8a90('0x10')](_0x8a90('0x11'),_0x12d376,_0x14db82);_0x200f95(_0x14db82);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 493e14a..d030428 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 _0x8f4c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x55f65e,_0x489851){var _0x2cae8c=function(_0x32e5a6){while(--_0x32e5a6){_0x55f65e['push'](_0x55f65e['shift']());}};_0x2cae8c(++_0x489851);}(_0x8f4c,0x113));var _0xc8f4=function(_0x3fddf3,_0x36ce44){_0x3fddf3=_0x3fddf3-0x0;var _0x15650d=_0x8f4c[_0x3fddf3];return _0x15650d;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./smsInteraction.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0x9')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router['get'](_0xc8f4('0xf'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x9')]('/:id/download',auth[_0xc8f4('0xd')](),controller['download']);router[_0xc8f4('0x11')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x12')]);router[_0xc8f4('0x11')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller[_0xc8f4('0x13')]);router[_0xc8f4('0x11')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),'smsinteraction:addtags'),controller[_0xc8f4('0x17')]);router[_0xc8f4('0x18')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')]('sms',_0xc8f4('0x19')),controller['update']);router['delete'](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),_0xc8f4('0x1a')),controller[_0xc8f4('0x1b')]);router[_0xc8f4('0x1c')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1d')]);module[_0xc8f4('0x1e')]=router; \ No newline at end of file +var _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0xa8a57e,_0x27295c){var _0x53244c=function(_0x1b333d){while(--_0x1b333d){_0xa8a57e['push'](_0xa8a57e['shift']());}};_0x53244c(++_0x27295c);}(_0x80ed,0x11c));var _0xd80e=function(_0x2a15ae,_0x2a792f){_0x2a15ae=_0x2a15ae-0x0;var _0x5377d6=_0x80ed[_0x2a15ae];return _0x5377d6;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 853c8c4..2f6c3ca 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 _0xf52f=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0xf52f,0x113));var _0xff52=function(_0x2e288c,_0x5442d6){_0x2e288c=_0x2e288c-0x0;var _0x507d40=_0xf52f[_0x2e288c];return _0x507d40;};'use strict';var Sequelize=require(_0xff52('0x0'));var moment=require(_0xff52('0x1'));module[_0xff52('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xff52('0x3')]},'disposition':{'type':Sequelize[_0xff52('0x4')]},'secondDisposition':{'type':Sequelize[_0xff52('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xff52('0x4')]},'phone':{'type':Sequelize[_0xff52('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xff52('0x5')]('in',_0xff52('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xff52('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xff52('0x5')]('in',_0xff52('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xff52('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x6bdc=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x50b30c,_0x2b2177){var _0x3e22f2=function(_0x5bd6b2){while(--_0x5bd6b2){_0x50b30c['push'](_0x50b30c['shift']());}};_0x3e22f2(++_0x2b2177);}(_0x6bdc,0x14e));var _0xc6bd=function(_0xa99417,_0x5d5bcf){_0xa99417=_0xa99417-0x0;var _0x220d30=_0x6bdc[_0xa99417];return _0x220d30;};'use strict';var Sequelize=require(_0xc6bd('0x0'));var moment=require(_0xc6bd('0x1'));module[_0xc6bd('0x2')]={'closed':{'type':Sequelize[_0xc6bd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc6bd('0x4')]},'disposition':{'type':Sequelize[_0xc6bd('0x5')]},'secondDisposition':{'type':Sequelize[_0xc6bd('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc6bd('0x5')]},'note':{'type':Sequelize[_0xc6bd('0x5')]},'phone':{'type':Sequelize[_0xc6bd('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc6bd('0x6')]('in',_0xc6bd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc6bd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc6bd('0x6')]('in',_0xc6bd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc6bd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 37c298f..de3796c 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 _0xa4ec=['Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','keys','some','isEmpty','where','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','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?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','SmsAccountId','sequelize','toString','merge','SmsInteraction','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','rows','show','includeAll','include','options','create','describe','SmsMessage','ids','omit','findOne','params','addTags','setTags','spread','findAll','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','System','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send'];(function(_0x2b6124,_0x4d25f2){var _0x44c3f4=function(_0x11075c){while(--_0x11075c){_0x2b6124['push'](_0x2b6124['shift']());}};_0x44c3f4(++_0x4d25f2);}(_0xa4ec,0x193));var _0xca4e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa4ec[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0xca4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca4e('0x1'));var jsonpatch=require(_0xca4e('0x2'));var rp=require(_0xca4e('0x3'));var moment=require(_0xca4e('0x4'));var BPromise=require(_0xca4e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca4e('0x6'));var sox=require(_0xca4e('0x7'));var csv=require(_0xca4e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca4e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xca4e('0xa'));var jsforce=require(_0xca4e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xca4e('0x8'));var querystring=require(_0xca4e('0xc'));var Papa=require(_0xca4e('0xd'));var Redis=require(_0xca4e('0xe'));var authService=require(_0xca4e('0xf'));var qs=require(_0xca4e('0x10'));var as=require(_0xca4e('0x11'));var pdf=require(_0xca4e('0x12'));var hardwareService=require(_0xca4e('0x13'));var logger=require(_0xca4e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xca4e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xca4e('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xca4e('0x17'),'port':0x18eb});var socket=require(_0xca4e('0x18'))(new Redis(config['redis']));require(_0xca4e('0x19'))[_0xca4e('0x1a')](socket);function respondWithStatusCode(_0x5791c8,_0x41f58b){_0x41f58b=_0x41f58b||0xcc;return function(_0x1bc84b){if(_0x1bc84b){return _0x5791c8['sendStatus'](_0x41f58b);}return _0x5791c8[_0xca4e('0x1b')](_0x41f58b)[_0xca4e('0x1c')]();};}function respondWithResult(_0x227b4d,_0x7385c0){_0x7385c0=_0x7385c0||0xc8;return function(_0xb166a1){if(_0xb166a1){return _0x227b4d[_0xca4e('0x1b')](_0x7385c0)['json'](_0xb166a1);}};}function respondWithFilteredResult(_0x43b9aa,_0x15ce5b){return function(_0x36aa48){if(_0x36aa48){var _0xd7726b=typeof _0x15ce5b[_0xca4e('0x1d')]===_0xca4e('0x1e')&&typeof _0x15ce5b['limit']===_0xca4e('0x1e');var _0x103a82=_0x36aa48[_0xca4e('0x1f')];var _0x3a46e5=_0xd7726b?0x0:_0x15ce5b[_0xca4e('0x1d')];var _0x4842f4=_0xd7726b?_0x36aa48[_0xca4e('0x1f')]:_0x15ce5b[_0xca4e('0x1d')]+_0x15ce5b[_0xca4e('0x20')];var _0x47dfce;if(_0x4842f4>=_0x103a82){_0x4842f4=_0x103a82;_0x47dfce=0xc8;}else{_0x47dfce=0xce;}_0x43b9aa['status'](_0x47dfce);return _0x43b9aa['set'](_0xca4e('0x21'),_0x3a46e5+'-'+_0x4842f4+'/'+_0x103a82)[_0xca4e('0x22')](_0x36aa48);}return null;};}function patchUpdates(_0x398748){return function(_0x3a2ecf){try{jsonpatch['apply'](_0x3a2ecf,_0x398748,!![]);}catch(_0x83c408){return BPromise[_0xca4e('0x23')](_0x83c408);}return _0x3a2ecf[_0xca4e('0x24')]();};}function saveUpdates(_0x216dcd,_0x122c34){return function(_0x2a39eb){if(_0x2a39eb){return _0x2a39eb[_0xca4e('0x25')](_0x216dcd)['then'](function(_0x4bdfad){return _0x4bdfad;});}return null;};}function removeEntity(_0x58210e,_0x462e20){return function(_0x27ff8d){if(_0x27ff8d){return _0x27ff8d[_0xca4e('0x26')]()[_0xca4e('0x27')](function(){_0x58210e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1baa07,_0x2b8695){return function(_0x3c2d8b){if(!_0x3c2d8b){_0x1baa07[_0xca4e('0x28')](0x194);}return _0x3c2d8b;};}function handleError(_0x5934e9,_0xe76f60){_0xe76f60=_0xe76f60||0x1f4;return function(_0x5bea99){logger[_0xca4e('0x29')](_0x5bea99[_0xca4e('0x2a')]);if(_0x5bea99['name']){delete _0x5bea99[_0xca4e('0x2b')];}_0x5934e9[_0xca4e('0x1b')](_0xe76f60)[_0xca4e('0x2c')](_0x5bea99);};}function getInteractionUsers(_0x446973,_0x2f5809){return new BPromise(function(_0x16a33d,_0x11bfa4){try{if(_0x2f5809[_0x446973['id']]){_0x446973[_0xca4e('0x2d')]=_[_0xca4e('0x2e')](_0x2f5809[_0x446973['id']],function(_0x31ed7d){return{'id':_0x31ed7d['id'],'fullname':_0x31ed7d[_0xca4e('0x2f')]};});}}catch(_0x3d9c01){_0x11bfa4(_0x3d9c01);}_0x16a33d(_0x446973);});}function getInteractionTags(_0x1afe20,_0x1ad0d6){return new BPromise(function(_0x26666d,_0x1f3dda){try{if(_0x1afe20[_0xca4e('0x30')]){_0x1afe20[_0xca4e('0x31')]=[];_0x1afe20[_0xca4e('0x30')][_0xca4e('0x32')](',')[_0xca4e('0x33')](function(_0x272070){_0x1afe20[_0xca4e('0x31')][_0xca4e('0x34')](_0x1ad0d6[_0x272070]);});}delete _0x1afe20[_0xca4e('0x30')];}catch(_0xffc55f){_0x1f3dda(_0xffc55f);}_0x26666d(_0x1afe20);});}function updateSmsInteraction(_0x55835f,_0x55c342,_0x439054){return new BPromise(function(_0xffbbcf,_0x451ffb){return getInteractionUsers(_0x55835f,_0x439054)['then'](function(_0x2dc90e){return getInteractionTags(_0x2dc90e,_0x55c342);})[_0xca4e('0x27')](function(_0x23fbad){_0xffbbcf(_0x23fbad);})[_0xca4e('0x35')](function(_0x4523e1){_0x451ffb(_0x4523e1);});});}exports[_0xca4e('0x36')]=function(_0x2d0e29,_0xdd9f27){var _0x2322dd={},_0x1be241={},_0x22b652={'count':0x0,'rows':[]};var _0x48dde0=_['map'](db['SmsInteraction'][_0xca4e('0x37')],function(_0x4cbf18){return{'name':_0x4cbf18[_0xca4e('0x38')],'type':_0x4cbf18[_0xca4e('0x39')]['key']};});_0x1be241[_0xca4e('0x3a')]=_[_0xca4e('0x2e')](_0x48dde0,_0xca4e('0x2b'));_0x1be241[_0xca4e('0x3b')]=_['keys'](_0x2d0e29['query']);_0x1be241[_0xca4e('0x3c')]=_['intersection'](_0x1be241[_0xca4e('0x3a')],_0x1be241['query']);_0x2322dd[_0xca4e('0x3d')]=_[_0xca4e('0x3e')](_0x1be241[_0xca4e('0x3a')],qs[_0xca4e('0x3f')](_0x2d0e29[_0xca4e('0x3b')]['fields']));_0x2322dd[_0xca4e('0x3d')]=_0x2322dd[_0xca4e('0x3d')][_0xca4e('0x40')]?_0x2322dd[_0xca4e('0x3d')]:_0x1be241[_0xca4e('0x3a')];if(!_0x2d0e29['query'][_0xca4e('0x41')](_0xca4e('0x42'))){_0x2322dd['limit']=qs[_0xca4e('0x20')](_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x20')]);_0x2322dd[_0xca4e('0x1d')]=qs[_0xca4e('0x1d')](_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x1d')]);}_0x2322dd[_0xca4e('0x43')]=qs[_0xca4e('0x44')](_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x44')]);_0x2322dd['where']=qs['filters'](_[_0xca4e('0x45')](_0x2d0e29[_0xca4e('0x3b')],_0x1be241[_0xca4e('0x3c')]),_0x48dde0);var _0x4e0f55=[];var _0x48b359=squel['select']()[_0xca4e('0x46')]('id')[_0xca4e('0x46')](_0xca4e('0x2b'))[_0xca4e('0x46')](_0xca4e('0x47'))[_0xca4e('0x48')](_0xca4e('0x49'));var _0x309f6d=squel['select']()[_0xca4e('0x46')](_0xca4e('0x4a'))[_0xca4e('0x46')](_0xca4e('0x4b'))[_0xca4e('0x46')](_0xca4e('0x4c'))[_0xca4e('0x48')](_0xca4e('0x4d'),'ui')[_0xca4e('0x4e')](_0xca4e('0x4f'),'u',_0xca4e('0x50'));var _0x5c6d3c=squel[_0xca4e('0x51')]()[_0xca4e('0x48')](_0xca4e('0x52'),'i')[_0xca4e('0x4e')]('cm_contacts','c',_0xca4e('0x53'))[_0xca4e('0x4e')](_0xca4e('0x4f'),'o','o.id\x20=\x20i.UserId')[_0xca4e('0x4e')](_0xca4e('0x54'),'a',_0xca4e('0x55'))[_0xca4e('0x4e')](_0xca4e('0x56'),'me',_0xca4e('0x57'))[_0xca4e('0x4e')](_0xca4e('0x58'),'it',_0xca4e('0x59'))[_0xca4e('0x4e')](_0xca4e('0x49'),'t','t.id\x20=\x20it.TagId');var _0x324066=squel[_0xca4e('0x5a')]();var _0x3ac309=[];var _0x5ecdd7=squel[_0xca4e('0x5a')]();var _0x160728;if(_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x5b')]){_0x160728=as['parseSearch'](_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x5b')]);var _0x2086f1=_0x160728[_0xca4e('0x5c')];for(var _0x4f7ecd=0x0;_0x4f7ecd<_0x160728[_0xca4e('0x5d')][_0xca4e('0x40')];_0x4f7ecd++){var _0x5d468d=_0x160728['conditions'][_0x4f7ecd];var _0x11cba1='i';var _0x37472e=_[_0xca4e('0x5e')](_0x48dde0,[_0xca4e('0x2b'),_0x5d468d['field']]);if(!_0x37472e){switch(_0x5d468d['field']){case'unreadMessages':if(_0x5d468d[_0xca4e('0x5f')]==0x1){_0x5c6d3c[_0xca4e('0x60')]('`'+_0x5d468d['field']+_0xca4e('0x61'));}else{_0x5c6d3c['having']('`'+_0x5d468d[_0xca4e('0x46')]+_0xca4e('0x62'));}break;case'Contact':if(_0x5d468d[_0xca4e('0x63')]===_0xca4e('0x64')){if(_0x5d468d[_0xca4e('0x5f')][_0xca4e('0x32')]('\x20')[_0xca4e('0x40')]>0x1){_0x324066[_0x2086f1](_0xca4e('0x65'),qs[_0xca4e('0x66')](_0x5d468d[_0xca4e('0x5f')]),null);}else{var _0x656d10='%'+_0x5d468d[_0xca4e('0x5f')]+'%';_0x324066[_0x2086f1](_0xca4e('0x67'),_0x656d10,_0x656d10,_0x656d10);}}else{_0x37472e=_[_0xca4e('0x5e')](_0x48dde0,[_0xca4e('0x2b'),_0xca4e('0x68')]);_0x5d468d[_0xca4e('0x46')]='ContactId';_0x546a58=as[_0xca4e('0x69')](_0x11cba1,_0x37472e[_0xca4e('0x39')],_0x5d468d);_0x324066[_0x2086f1](_0x546a58[_0xca4e('0x6a')],_0x546a58[_0xca4e('0x5f')][_0xca4e('0x6b')],_0x546a58[_0xca4e('0x5f')][_0xca4e('0x1c')]);}break;case _0xca4e('0x6c'):var _0x298c31=_0x5d468d['value'][_0xca4e('0x32')](',')[_0xca4e('0x2e')](function(_0x1f38ef){return Number(_0x1f38ef);});_0x298c31['forEach'](function(_0x491e4f){_0x5ecdd7['or'](_0xca4e('0x6d'),'%,'+_0x491e4f+',%');});_0x3ac309=_[_0xca4e('0x6e')](_0x3ac309,_0x298c31);break;case _0xca4e('0x6f'):if(_0x5d468d[_0xca4e('0x63')]===_0xca4e('0x64')){_0x324066[_0x2086f1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5d468d['value']+'%',null);}else{_0x37472e=_[_0xca4e('0x5e')](_0x48dde0,[_0xca4e('0x2b'),_0xca4e('0x70')]);_0x5d468d[_0xca4e('0x46')]=_0xca4e('0x70');_0x546a58=as[_0xca4e('0x69')](_0x11cba1,_0x37472e[_0xca4e('0x39')],_0x5d468d);_0x324066[_0x2086f1](_0x546a58['text'],_0x546a58[_0xca4e('0x5f')][_0xca4e('0x6b')],_0x546a58[_0xca4e('0x5f')][_0xca4e('0x1c')]);}break;case _0xca4e('0x71'):_0x546a58=as['buildExpression']('me',null,_0x5d468d);_0x324066[_0x2086f1](_0x546a58[_0xca4e('0x6a')],_0x546a58[_0xca4e('0x5f')]['start'],_0x546a58[_0xca4e('0x5f')]['end']);break;}}else{var _0x546a58=as['buildExpression'](_0x11cba1,_0x37472e[_0xca4e('0x39')],_0x5d468d);_0x324066[_0x2086f1](_0x546a58[_0xca4e('0x6a')],_0x546a58[_0xca4e('0x5f')][_0xca4e('0x6b')],_0x546a58['value']['end']);}}}else{var _0x1e1d69=_(_0x2d0e29[_0xca4e('0x3b')])[_0xca4e('0x72')]()[_0xca4e('0x2e')](function(_0xcde92e){return _[_0xca4e('0x73')](_0x48dde0,[_0xca4e('0x2b'),_0xcde92e])?_0xcde92e:undefined;})['compact']()[_0xca4e('0x5f')]();if(!_[_0xca4e('0x74')](_0x1e1d69)){_0x1e1d69[_0xca4e('0x33')](function(_0x25fcec){if(_0x25fcec==='SmsAccountId'){_0x5c6d3c[_0xca4e('0x75')]('i.SmsAccountId\x20IN\x20?',[][_0xca4e('0x76')](_0x2d0e29[_0xca4e('0x3b')][_0x25fcec]));}else if(_0x25fcec==='createdAt'){var _0x27119a=JSON[_0xca4e('0x77')](_0x2d0e29[_0xca4e('0x3b')][_0x25fcec])[_0xca4e('0x78')];var _0x5cb787=JSON[_0xca4e('0x77')](_0x2d0e29['query'][_0x25fcec])[_0xca4e('0x79')];_0x5c6d3c['where'](_0xca4e('0x7a'),_0x27119a,_0x5cb787);}else{if(_0x2d0e29['query'][_0x25fcec]==='null'){_0x5c6d3c[_0xca4e('0x75')]('i.'+_0x25fcec+'\x20IS\x20NULL');}else{_0x5c6d3c['where']('i.'+_0x25fcec+_0xca4e('0x7b'),_0x2d0e29[_0xca4e('0x3b')][_0x25fcec]);}}});}if(_0x2d0e29['query']['read']){if(_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x7c')]==0x1){_0x5c6d3c[_0xca4e('0x60')](_0xca4e('0x7d'));}else{_0x5c6d3c[_0xca4e('0x60')](_0xca4e('0x7e'));}}if(_0x2d0e29[_0xca4e('0x3b')]['tag']){_0x3ac309=_['isArray'](_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x7f')])?_0x2d0e29['query'][_0xca4e('0x7f')]:new Array(_0x2d0e29[_0xca4e('0x3b')]['tag']);_0x3ac309[_0xca4e('0x33')](function(_0x30d6cb){_0x5ecdd7['or'](_0xca4e('0x6d'),'%,'+_0x30d6cb+',%');});}if(_0x2d0e29['query'][_0xca4e('0x80')]){var _0x31f23c=_0x2d0e29[_0xca4e('0x3b')][_0xca4e('0x80')][_0xca4e('0x81')]('\x5c','\x5c\x5c')[_0xca4e('0x81')](/'/g,'\x27\x27');if(qs[_0xca4e('0x82')](_0x31f23c)){_0x324066['or']('i.id\x20LIKE\x20?',_0x31f23c+'%')['or'](_0xca4e('0x83'),_0x31f23c+'%');}else{_0x324066['or'](_0xca4e('0x84'),qs[_0xca4e('0x66')](_0x31f23c))['or'](_0xca4e('0x85'),_0x31f23c+'%');}}}_0x5c6d3c[_0xca4e('0x75')](_0x324066);_0x5c6d3c['group'](_0xca4e('0x86'));var _0x2ccdc5={'type':db['Sequelize'][_0xca4e('0x87')][_0xca4e('0x88')],'raw':!![]};var _0x4d3cbb=_0x5c6d3c[_0xca4e('0x89')]();_0x4d3cbb[_0xca4e('0x46')](_0xca4e('0x86'));_0x4d3cbb[_0xca4e('0x46')](_0xca4e('0x8a'),_0xca4e('0x8b'));if(_0x2322dd[_0xca4e('0x43')]){_0x2322dd[_0xca4e('0x43')][_0xca4e('0x33')](function(_0x88dc2e){var _0x1132de=_0x88dc2e[0x0]===_0xca4e('0x8c')?_0x88dc2e[0x0]:'i.'+_0x88dc2e[0x0];_0x5c6d3c[_0xca4e('0x43')](_0x1132de,_0x88dc2e[0x1]===_0xca4e('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x3ac309)){_0x5c6d3c[_0xca4e('0x60')](_0x5ecdd7);_0x4d3cbb['where']('t.id\x20IN\x20?',_0x3ac309);}BPromise['resolve']()[_0xca4e('0x27')](function(){if(!_0x160728){if(_0x2d0e29[_0xca4e('0x3b')]['SmsAccountId'])return;_0x4d3cbb[_0xca4e('0x75')](_0xca4e('0x8e'));_0x5c6d3c[_0xca4e('0x75')](_0xca4e('0x8e'));return;}if(_0x2d0e29[_0xca4e('0x8f')][_0xca4e('0x90')]!==_0xca4e('0x91'))return;return _0x2d0e29[_0xca4e('0x8f')][_0xca4e('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x148de7){if(_['isEmpty'](_0x148de7)){_0x4d3cbb[_0xca4e('0x75')](_0xca4e('0x93'));_0x5c6d3c[_0xca4e('0x75')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x4d3cbb[_0xca4e('0x75')]('i.SmsAccountId\x20IN\x20?',_[_0xca4e('0x2e')](_0x148de7,'id'));_0x5c6d3c[_0xca4e('0x75')](_0xca4e('0x94'),_[_0xca4e('0x2e')](_0x148de7,'id'));}});})[_0xca4e('0x27')](function(){if(_0x2d0e29[_0xca4e('0x8f')][_0xca4e('0x90')]===_0xca4e('0x91')&&!_0x160728&&!_0x2d0e29['query'][_0xca4e('0x95')])return[];return db[_0xca4e('0x96')][_0xca4e('0x3b')](_0x4d3cbb[_0xca4e('0x97')](),_0x2ccdc5);})[_0xca4e('0x27')](function(_0xe01d8c){_0x22b652[_0xca4e('0x1f')]=_0xe01d8c[_0xca4e('0x40')];if(_0x22b652['count']===0x0)return[];return db[_0xca4e('0x96')][_0xca4e('0x3b')](_0x48b359[_0xca4e('0x97')](),_0x2ccdc5)[_0xca4e('0x27')](function(_0x134103){_0x4e0f55=_['keyBy'](_0x134103,'id');_0x2ccdc5=_[_0xca4e('0x98')](_0x2ccdc5,{'model':db[_0xca4e('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2d0e29[_0xca4e('0x3b')]['fields']){_0x2322dd[_0xca4e('0x3d')][_0xca4e('0x33')](function(_0x34d414){_0x5c6d3c[_0xca4e('0x46')]('i.'+_0x34d414);});}else{_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0x8a'),'unreadMessages');_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0x9a'),'Account.key');_0x5c6d3c[_0xca4e('0x46')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5c6d3c['field'](_0xca4e('0x9b'),'contactName');_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0x9c'));_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0x9d'),_0xca4e('0x9e'));_0x5c6d3c['field'](_0xca4e('0x9f'),_0xca4e('0xa0'));_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0xa1'),_0xca4e('0xa2'));_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0xa3'),_0xca4e('0xa4'));_0x5c6d3c['field'](_0xca4e('0xa5'),_0xca4e('0xa6'));_0x5c6d3c[_0xca4e('0x46')]('c.fax',_0xca4e('0xa7'));_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0xa8'),_0xca4e('0xa9'));_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0xaa'),'Owner.internal');_0x5c6d3c[_0xca4e('0x46')](_0xca4e('0xab'),_0xca4e('0x30'));}if(_0x2322dd[_0xca4e('0x20')])_0x5c6d3c[_0xca4e('0x20')](_0x2322dd[_0xca4e('0x20')]);if(_0x2322dd[_0xca4e('0x1d')])_0x5c6d3c['offset'](_0x2322dd['offset']);return db[_0xca4e('0x96')][_0xca4e('0x3b')](_0x5c6d3c[_0xca4e('0x97')](),_0x2ccdc5);})[_0xca4e('0x27')](function(_0x36fe23){if(_0x36fe23['length']>0x0)_0x309f6d['where'](_0xca4e('0xac'),_['map'](_0x36fe23,'id'));return db[_0xca4e('0x96')][_0xca4e('0x3b')](_0x309f6d['toString'](),_0x2ccdc5)[_0xca4e('0x27')](function(_0x3ce43f){var _0x3b0413=_['groupBy'](_0x3ce43f,_0xca4e('0xad'));var _0x4da075=[];_0x36fe23[_0xca4e('0x33')](function(_0x45d129){_0x4da075[_0xca4e('0x34')](updateSmsInteraction(_0x45d129,_0x4e0f55,_0x3b0413));});return BPromise['all'](_0x4da075);});});})[_0xca4e('0x27')](function(_0xa990ca){_0x22b652[_0xca4e('0xae')]=_0xa990ca;return _0x22b652;})[_0xca4e('0x27')](respondWithFilteredResult(_0xdd9f27,_0x2322dd))[_0xca4e('0x35')](handleError(_0xdd9f27,null));};exports[_0xca4e('0xaf')]=function(_0x2eb5d8,_0x28d523){var _0xed88d3={'raw':![],'where':{'id':_0x2eb5d8['params']['id']}},_0x507eae={};_0x507eae[_0xca4e('0x3a')]=_['keys'](db[_0xca4e('0x99')]['rawAttributes']);_0x507eae[_0xca4e('0x3b')]=_['keys'](_0x2eb5d8['query']);_0x507eae['filters']=_['intersection'](_0x507eae[_0xca4e('0x3a')],_0x507eae['query']);_0xed88d3[_0xca4e('0x3d')]=_['intersection'](_0x507eae['model'],qs[_0xca4e('0x3f')](_0x2eb5d8['query'][_0xca4e('0x3f')]));_0xed88d3['attributes']=_0xed88d3[_0xca4e('0x3d')][_0xca4e('0x40')]?_0xed88d3[_0xca4e('0x3d')]:_0x507eae[_0xca4e('0x3a')];if(_0x2eb5d8['query'][_0xca4e('0xb0')]){_0xed88d3[_0xca4e('0xb1')]=[{'all':!![]}];}_0xed88d3=_[_0xca4e('0x98')]({},_0xed88d3,_0x2eb5d8[_0xca4e('0xb2')]);return db['SmsInteraction'][_0xca4e('0x5e')](_0xed88d3)[_0xca4e('0x27')](handleEntityNotFound(_0x28d523,null))[_0xca4e('0x27')](respondWithResult(_0x28d523,null))['catch'](handleError(_0x28d523,null));};exports[_0xca4e('0xb3')]=function(_0xfad39,_0x210fbe){return db[_0xca4e('0x99')][_0xca4e('0xb3')](_0xfad39['body'],{})[_0xca4e('0x27')](respondWithResult(_0x210fbe,0xc9))[_0xca4e('0x35')](handleError(_0x210fbe,null));};exports[_0xca4e('0x25')]=function(_0x472e80,_0x23953c){if(_0x472e80['body']['id']){delete _0x472e80['body']['id'];}return db[_0xca4e('0x99')][_0xca4e('0x5e')]({'where':{'id':_0x472e80['params']['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x23953c,null))['then'](saveUpdates(_0x472e80['body'],null))[_0xca4e('0x27')](respondWithResult(_0x23953c,null))['catch'](handleError(_0x23953c,null));};exports[_0xca4e('0x26')]=function(_0x5b3522,_0x3381d2){return db['SmsInteraction']['find']({'where':{'id':_0x5b3522['params']['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x3381d2,null))[_0xca4e('0x27')](removeEntity(_0x3381d2,null))[_0xca4e('0x35')](handleError(_0x3381d2,null));};exports['describe']=function(_0xf20579,_0x296aaa){return db[_0xca4e('0x99')][_0xca4e('0xb4')]()[_0xca4e('0x27')](respondWithResult(_0x296aaa,null))[_0xca4e('0x35')](handleError(_0x296aaa,null));};exports['addMessage']=function(_0x4a7de5,_0x289484,_0x492213){return db[_0xca4e('0xb5')][_0xca4e('0x5e')]({'where':{'id':_0x4a7de5['params']['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x289484,null))[_0xca4e('0x27')](function(_0x3978c5){if(_0x3978c5){return _0x3978c5['addMessage'](_0x4a7de5[_0xca4e('0x71')][_0xca4e('0xb6')],_[_0xca4e('0xb7')](_0x4a7de5['body'],['ids','id'])||{});}})[_0xca4e('0x27')](respondWithResult(_0x289484,null))[_0xca4e('0x35')](handleError(_0x289484,null));};exports['getMessages']=function(_0xe95893,_0x548354,_0x4e296b){var _0xd80250={'raw':![],'where':{}};var _0xffbf0e={};var _0x263b25={'count':0x0,'rows':[]};return db[_0xca4e('0x99')][_0xca4e('0xb8')]({'where':{'id':_0xe95893[_0xca4e('0xb9')]['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x548354,null))['then'](function(_0x5bc8ae){if(_0x5bc8ae){_0xffbf0e[_0xca4e('0x3a')]=_[_0xca4e('0x72')](db[_0xca4e('0xb5')]['rawAttributes']);_0xffbf0e[_0xca4e('0x3b')]=_[_0xca4e('0x72')](_0xe95893[_0xca4e('0x3b')]);_0xffbf0e[_0xca4e('0x3c')]=_['intersection'](_0xffbf0e[_0xca4e('0x3a')],_0xffbf0e[_0xca4e('0x3b')]);_0xd80250[_0xca4e('0x3d')]=_['intersection'](_0xffbf0e['model'],qs[_0xca4e('0x3f')](_0xe95893[_0xca4e('0x3b')][_0xca4e('0x3f')]));_0xd80250[_0xca4e('0x3d')]=_0xd80250[_0xca4e('0x3d')]['length']?_0xd80250[_0xca4e('0x3d')]:_0xffbf0e['model'];if(!_0xe95893[_0xca4e('0x3b')][_0xca4e('0x41')](_0xca4e('0x42'))){_0xd80250[_0xca4e('0x20')]=qs[_0xca4e('0x20')](_0xe95893[_0xca4e('0x3b')]['limit']);_0xd80250[_0xca4e('0x1d')]=qs[_0xca4e('0x1d')](_0xe95893['query']['offset']);}_0xd80250[_0xca4e('0x43')]=qs[_0xca4e('0x44')](_0xe95893[_0xca4e('0x3b')]['sort']);_0xd80250[_0xca4e('0x75')]=qs['filters'](_[_0xca4e('0x45')](_0xe95893[_0xca4e('0x3b')],_0xffbf0e['filters']));_0xd80250[_0xca4e('0x75')][_0xca4e('0xad')]=_0x5bc8ae['id'];if(_0xe95893[_0xca4e('0x3b')]['filter']){_0xd80250['where']=_[_0xca4e('0x98')](_0xd80250['where'],{'$or':_[_0xca4e('0x2e')](_0xd80250[_0xca4e('0x3d')],function(_0x38357e){var _0x344fae={};_0x344fae[_0x38357e]={'$like':'%'+_0xe95893[_0xca4e('0x3b')][_0xca4e('0x80')]+'%'};return _0x344fae;})});}if(_0xe95893['query'][_0xca4e('0x78')]){var _0x214270=_0xe95893[_0xca4e('0x3b')][_0xca4e('0x78')][_0xca4e('0x32')](',');var _0x306353={};_0x306353[_0x214270[0x0]]={'$gte':moment(_0x214270[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xd80250['where']=_[_0xca4e('0x98')](_0xd80250['where'],_0x306353);}_0xd80250=_[_0xca4e('0x98')]({},_0xd80250,_0xe95893[_0xca4e('0xb2')]);return db[_0xca4e('0xb5')]['count']({'where':_0xd80250[_0xca4e('0x75')]})[_0xca4e('0x27')](function(_0x243271){_0x263b25[_0xca4e('0x1f')]=_0x243271;if(_0xe95893[_0xca4e('0x3b')][_0xca4e('0xb0')]){_0xd80250[_0xca4e('0xb1')]=[{'all':!![]}];}return db[_0xca4e('0xb5')]['findAll'](_0xd80250);})[_0xca4e('0x27')](function(_0x380fb2){_0x263b25[_0xca4e('0xae')]=_0x380fb2;return _0x263b25;});}})[_0xca4e('0x27')](respondWithFilteredResult(_0x548354,_0xd80250))[_0xca4e('0x35')](handleError(_0x548354,null));};exports[_0xca4e('0xba')]=function(_0x45b2d6,_0x1a5f98,_0xd82b10){return db[_0xca4e('0x99')][_0xca4e('0x5e')]({'where':{'id':_0x45b2d6['params']['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x1a5f98,null))[_0xca4e('0x27')](function(_0x305b0b){if(_0x305b0b){return _0x305b0b[_0xca4e('0xbb')](_0x45b2d6[_0xca4e('0x71')][_0xca4e('0xb6')],_['omit'](_0x45b2d6[_0xca4e('0x71')],[_0xca4e('0xb6'),'id'])||{})[_0xca4e('0xbc')](function(){return db['Tag'][_0xca4e('0xbd')]({'attributes':['id',_0xca4e('0x2b'),'color'],'where':{'id':_0x45b2d6[_0xca4e('0x71')][_0xca4e('0xb6')]}});})[_0xca4e('0x27')](function(_0x3355d4){socket['emit'](_0xca4e('0xbe'),{'id':Number(_0x45b2d6['params']['id']),'tags':_0x3355d4||[]});return{'id':Number(_0x45b2d6[_0xca4e('0xb9')]['id']),'tags':_0x3355d4||[]};});}})[_0xca4e('0x27')](respondWithResult(_0x1a5f98,null))[_0xca4e('0x35')](handleError(_0x1a5f98,null));};exports['removeTags']=function(_0x3339bb,_0x35a5e7,_0x2196ab){return db['SmsInteraction']['find']({'where':{'id':_0x3339bb[_0xca4e('0xb9')]['id']}})[_0xca4e('0x27')](handleEntityNotFound(_0x35a5e7,null))[_0xca4e('0x27')](function(_0x59a0d5){if(_0x59a0d5){return _0x59a0d5[_0xca4e('0xbf')](_0x3339bb[_0xca4e('0x3b')][_0xca4e('0xb6')]);}})['then'](respondWithStatusCode(_0x35a5e7,null))[_0xca4e('0x35')](handleError(_0x35a5e7,null));};exports[_0xca4e('0xc0')]=function(_0x395eff,_0x1b48ca){var _0x5b5906=moment()[_0xca4e('0xc1')]()[_0xca4e('0x97')]();var _0x3db78b=path[_0xca4e('0xc2')](config[_0xca4e('0xc3')],_0xca4e('0xc4'),_0xca4e('0xc5'),'tmp');var _0xad9a66=path[_0xca4e('0xc2')](config[_0xca4e('0xc3')],_0xca4e('0xc4'),_0xca4e('0xc5'),'attachments');var _0x21b14f=path['join'](_0x3db78b,_0x5b5906);var _0x315a23=util[_0xca4e('0xc6')](_0xca4e('0xc7'),_0x395eff['params']['id'],_0x5b5906);var _0x59661f=path[_0xca4e('0xc2')](_0x3db78b,_0x315a23);var _0x3ade3b=[];_0x3ade3b[_0xca4e('0x34')]({'model':db['User'],'as':_0xca4e('0x6f'),'attributes':['id',_0xca4e('0x2f')],'raw':!![]});_0x3ade3b[_0xca4e('0x34')]({'model':db[_0xca4e('0xc8')],'as':_0xca4e('0xc9'),'attributes':['id',_0xca4e('0xca'),_0xca4e('0xcb')],'raw':!![]});var _0x35d3b5=[{'model':db[_0xca4e('0xb5')],'as':_0xca4e('0xcc'),'attributes':['id',_0xca4e('0x71'),_0xca4e('0xcd'),_0xca4e('0xce'),_0xca4e('0xcf'),'read'],'include':_0x3ade3b}];_0x35d3b5[_0xca4e('0x34')]({'model':db[_0xca4e('0xd0')],'as':_0xca4e('0xd1'),'attributes':['id',_0xca4e('0x2b')]});_0x35d3b5[_0xca4e('0x34')]({'model':db[_0xca4e('0x6f')],'as':_0xca4e('0xd2'),'attributes':['id',_0xca4e('0x2f')]});return db[_0xca4e('0x99')][_0xca4e('0x5e')]({'where':{'id':_0x395eff[_0xca4e('0xb9')]['id']},'include':_0x35d3b5})[_0xca4e('0x27')](handleEntityNotFound(_0x1b48ca,null))[_0xca4e('0x27')](function(_0x75fd3f){if(_0x75fd3f){var _0x58ba02=_0x75fd3f[_0xca4e('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x21b14f);var _0x4a43db={'channel':'Sms','account':_0x58ba02[_0xca4e('0xd1')][_0xca4e('0x2b')],'agent':_0x58ba02[_0xca4e('0xd2')]?_0x58ba02['Owner'][_0xca4e('0x2f')]:_0xca4e('0xd4'),'createdAt':moment(_0x58ba02[_0xca4e('0xcd')])[_0xca4e('0xc6')](_0xca4e('0xd5'))[_0xca4e('0x97')](),'closedAt':_0x58ba02['closed']?moment(_0x58ba02[_0xca4e('0xd6')])[_0xca4e('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca4e('0x97')]():'','disposition':_0x58ba02['disposition'],'messages':_(_0x58ba02['Messages'])[_0xca4e('0x80')]({'secret':![]})[_0xca4e('0x2e')](function(_0x482cce){return{'date':moment(_0x482cce[_0xca4e('0xcd')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x482cce[_0xca4e('0xce')]===_0xca4e('0xd7')?_0x482cce['User']?_0x482cce['User'][_0xca4e('0x2f')]:_0xca4e('0xd8'):_0x482cce[_0xca4e('0xc9')][_0xca4e('0xca')]+(_0x482cce[_0xca4e('0xc9')]['lastName']?'\x20'+_0x482cce[_0xca4e('0xc9')][_0xca4e('0xcb')]:''),'body':_0x482cce[_0xca4e('0x71')],'direction':_0x482cce['direction']===_0xca4e('0xd7')?'A':'C','secret':_0x482cce['secret'],'read':_0x482cce[_0xca4e('0x7c')]};})[_0xca4e('0x5f')]()};return ejs['renderFile'](path['join'](config[_0xca4e('0xc3')],'server','views',_0xca4e('0xd9')),{'interaction':_0x4a43db})[_0xca4e('0x27')](function(_0x2a20c2){var _0x41f46c=path[_0xca4e('0xc2')](_0x21b14f,_0xca4e('0xda')+_0x58ba02['id']+'-'+_0x5b5906+_0xca4e('0xdb'));var _0x37fb4c={'path':_0x41f46c,'channel':_0xca4e('0xdc'),'interactionId':_0x58ba02['id']};return pdf[_0xca4e('0xdd')](_0x2a20c2,_0x37fb4c);})['then'](function(){return new BPromise(function(_0x408b1f,_0x361fc3){zipdir(_0x21b14f,{'saveTo':_0x59661f},function(_0x5383c4,_0x3213ed){if(_0x5383c4)return _0x361fc3(_0x5383c4);return _0x408b1f(_0x3213ed);});})[_0xca4e('0x27')](function(){return new BPromise(function(_0x44f8eb,_0xe5afad){rimraf(_0x21b14f,function(_0x4e430f){if(_0x4e430f)_0xe5afad(_0x4e430f);return _0x44f8eb();});});})['then'](function(){return _0x1b48ca[_0xca4e('0xc0')](_0x59661f,_0x315a23,function(_0x239e0f){if(_0x239e0f){console[_0xca4e('0xde')](_0xca4e('0xdf'),_0x239e0f);}else{fs['unlinkSync'](_0x59661f);}});});});}else{return _0x1b48ca['sendStatus'](0xc8);}})['catch'](handleError(_0x1b48ca,null));}; \ No newline at end of file +var _0x07b8=['to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','Users','TagIds','Tags','forEach','push','catch','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','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','sms_messages','expr','parseSearch','search','sqlOperator','conditions','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','unreadMessages','contactName','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','length','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','SmsInteraction','includeAll','include','options','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Messages','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','direction','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x07b8,0x1d4));var _0x807b=function(_0x4b3880,_0x3ffd5b){_0x4b3880=_0x4b3880-0x0;var _0x43fb91=_0x07b8[_0x4b3880];return _0x43fb91;};'use strict';var emlformat=require(_0x807b('0x0'));var rimraf=require(_0x807b('0x1'));var zipdir=require(_0x807b('0x2'));var jsonpatch=require(_0x807b('0x3'));var rp=require(_0x807b('0x4'));var moment=require(_0x807b('0x5'));var BPromise=require(_0x807b('0x6'));var Mustache=require(_0x807b('0x7'));var util=require('util');var path=require(_0x807b('0x8'));var sox=require(_0x807b('0x9'));var csv=require(_0x807b('0xa'));var ejs=require(_0x807b('0xb'));var fs=require('fs');var fs_extra=require(_0x807b('0xc'));var _=require('lodash');var squel=require(_0x807b('0xd'));var crypto=require(_0x807b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x807b('0xf'));var toCsv=require(_0x807b('0xa'));var querystring=require(_0x807b('0x10'));var Papa=require(_0x807b('0x11'));var Redis=require('ioredis');var authService=require(_0x807b('0x12'));var qs=require(_0x807b('0x13'));var as=require(_0x807b('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x807b('0x15'));var logger=require(_0x807b('0x16'))(_0x807b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x807b('0x18'));var db=require('../../mysqldb')['db'];config[_0x807b('0x19')]=_[_0x807b('0x1a')](config['redis'],{'host':_0x807b('0x1b'),'port':0x18eb});var socket=require(_0x807b('0x1c'))(new Redis(config[_0x807b('0x19')]));require('./smsInteraction.socket')[_0x807b('0x1d')](socket);function respondWithStatusCode(_0x489469,_0x3c8930){_0x3c8930=_0x3c8930||0xcc;return function(_0x49d7e5){if(_0x49d7e5){return _0x489469[_0x807b('0x1e')](_0x3c8930);}return _0x489469['status'](_0x3c8930)['end']();};}function respondWithResult(_0x21a6a5,_0x311850){_0x311850=_0x311850||0xc8;return function(_0x3aa8d5){if(_0x3aa8d5){return _0x21a6a5['status'](_0x311850)[_0x807b('0x1f')](_0x3aa8d5);}};}function respondWithFilteredResult(_0x160f67,_0x18785d){return function(_0x5050db){if(_0x5050db){var _0x12fd34=typeof _0x18785d[_0x807b('0x20')]===_0x807b('0x21')&&typeof _0x18785d[_0x807b('0x22')]==='undefined';var _0x16d798=_0x5050db[_0x807b('0x23')];var _0x4a8956=_0x12fd34?0x0:_0x18785d['offset'];var _0x3f6f06=_0x12fd34?_0x5050db['count']:_0x18785d[_0x807b('0x20')]+_0x18785d[_0x807b('0x22')];var _0x3f4e08;if(_0x3f6f06>=_0x16d798){_0x3f6f06=_0x16d798;_0x3f4e08=0xc8;}else{_0x3f4e08=0xce;}_0x160f67[_0x807b('0x24')](_0x3f4e08);return _0x160f67[_0x807b('0x25')](_0x807b('0x26'),_0x4a8956+'-'+_0x3f6f06+'/'+_0x16d798)[_0x807b('0x1f')](_0x5050db);}return null;};}function patchUpdates(_0x54912a){return function(_0x4fc52c){try{jsonpatch['apply'](_0x4fc52c,_0x54912a,!![]);}catch(_0x50313e){return BPromise[_0x807b('0x27')](_0x50313e);}return _0x4fc52c[_0x807b('0x28')]();};}function saveUpdates(_0x1cabe6,_0x309faf){return function(_0x3581e3){if(_0x3581e3){return _0x3581e3[_0x807b('0x29')](_0x1cabe6)[_0x807b('0x2a')](function(_0x5c001f){return _0x5c001f;});}return null;};}function removeEntity(_0x332e85,_0x440d9c){return function(_0x430ae0){if(_0x430ae0){return _0x430ae0[_0x807b('0x2b')]()['then'](function(){_0x332e85[_0x807b('0x24')](0xcc)[_0x807b('0x2c')]();});}};}function handleEntityNotFound(_0x593262,_0x332463){return function(_0x18c699){if(!_0x18c699){_0x593262['sendStatus'](0x194);}return _0x18c699;};}function handleError(_0xd9c21c,_0x46279e){_0x46279e=_0x46279e||0x1f4;return function(_0x38fe6e){logger[_0x807b('0x2d')](_0x38fe6e[_0x807b('0x2e')]);if(_0x38fe6e[_0x807b('0x2f')]){delete _0x38fe6e[_0x807b('0x2f')];}_0xd9c21c['status'](_0x46279e)['send'](_0x38fe6e);};}function getInteractionUsers(_0x129de2,_0x5e5603){return new BPromise(function(_0x3256b0,_0x348a5b){try{if(_0x5e5603[_0x129de2['id']]){_0x129de2[_0x807b('0x30')]=_['map'](_0x5e5603[_0x129de2['id']],function(_0x313e76){return{'id':_0x313e76['id'],'fullname':_0x313e76['fullname']};});}}catch(_0x1e04b5){_0x348a5b(_0x1e04b5);}_0x3256b0(_0x129de2);});}function getInteractionTags(_0x258657,_0x25b694){return new BPromise(function(_0x5e391d,_0x368956){try{if(_0x258657[_0x807b('0x31')]){_0x258657[_0x807b('0x32')]=[];_0x258657[_0x807b('0x31')]['split'](',')[_0x807b('0x33')](function(_0x8b2f07){_0x258657[_0x807b('0x32')][_0x807b('0x34')](_0x25b694[_0x8b2f07]);});}delete _0x258657[_0x807b('0x31')];}catch(_0x215c27){_0x368956(_0x215c27);}_0x5e391d(_0x258657);});}function updateSmsInteraction(_0x44a839,_0x478d2a,_0xc9072d){return new BPromise(function(_0x4bba5c,_0x1ae32e){return getInteractionUsers(_0x44a839,_0xc9072d)[_0x807b('0x2a')](function(_0x54f02c){return getInteractionTags(_0x54f02c,_0x478d2a);})[_0x807b('0x2a')](function(_0x5b909d){_0x4bba5c(_0x5b909d);})[_0x807b('0x35')](function(_0x333dca){_0x1ae32e(_0x333dca);});});}exports[_0x807b('0x36')]=function(_0x1835b1,_0x1583cd){var _0x3c2849={},_0x59a3eb={},_0x397b55={'count':0x0,'rows':[]};var _0x438b22=_[_0x807b('0x37')](db['SmsInteraction'][_0x807b('0x38')],function(_0x460dfc){return{'name':_0x460dfc['fieldName'],'type':_0x460dfc[_0x807b('0x39')][_0x807b('0x3a')]};});_0x59a3eb[_0x807b('0x3b')]=_[_0x807b('0x37')](_0x438b22,_0x807b('0x2f'));_0x59a3eb[_0x807b('0x3c')]=_[_0x807b('0x3d')](_0x1835b1['query']);_0x59a3eb['filters']=_[_0x807b('0x3e')](_0x59a3eb[_0x807b('0x3b')],_0x59a3eb[_0x807b('0x3c')]);_0x3c2849['attributes']=_['intersection'](_0x59a3eb[_0x807b('0x3b')],qs[_0x807b('0x3f')](_0x1835b1[_0x807b('0x3c')][_0x807b('0x3f')]));_0x3c2849['attributes']=_0x3c2849[_0x807b('0x40')]['length']?_0x3c2849[_0x807b('0x40')]:_0x59a3eb['model'];if(!_0x1835b1['query'][_0x807b('0x41')](_0x807b('0x42'))){_0x3c2849[_0x807b('0x22')]=qs[_0x807b('0x22')](_0x1835b1[_0x807b('0x3c')][_0x807b('0x22')]);_0x3c2849[_0x807b('0x20')]=qs['offset'](_0x1835b1[_0x807b('0x3c')][_0x807b('0x20')]);}_0x3c2849[_0x807b('0x43')]=qs[_0x807b('0x44')](_0x1835b1[_0x807b('0x3c')][_0x807b('0x44')]);_0x3c2849[_0x807b('0x45')]=qs[_0x807b('0x46')](_[_0x807b('0x47')](_0x1835b1[_0x807b('0x3c')],_0x59a3eb[_0x807b('0x46')]),_0x438b22);var _0x2c4248=[];var _0x436be7=squel[_0x807b('0x48')]()['field']('id')[_0x807b('0x49')](_0x807b('0x2f'))['field'](_0x807b('0x4a'))['from'](_0x807b('0x4b'));var _0x3e79e7=squel[_0x807b('0x48')]()['field'](_0x807b('0x4c'))[_0x807b('0x49')]('u.fullname')[_0x807b('0x49')](_0x807b('0x4d'))[_0x807b('0x4e')](_0x807b('0x4f'),'ui')[_0x807b('0x50')](_0x807b('0x51'),'u',_0x807b('0x52'));var _0x17f354=squel['select']()[_0x807b('0x4e')](_0x807b('0x53'),'i')[_0x807b('0x50')](_0x807b('0x54'),'c',_0x807b('0x55'))['left_join'](_0x807b('0x51'),'o',_0x807b('0x56'))['left_join'](_0x807b('0x57'),'a','a.id\x20=\x20i.SmsAccountId')[_0x807b('0x50')](_0x807b('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x807b('0x50')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x807b('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x56aff1=squel[_0x807b('0x59')]();var _0x155330=[];var _0x37972e=squel[_0x807b('0x59')]();var _0x479d7f;if(_0x1835b1[_0x807b('0x3c')]['search']){_0x479d7f=as[_0x807b('0x5a')](_0x1835b1[_0x807b('0x3c')][_0x807b('0x5b')]);var _0xacc492=_0x479d7f[_0x807b('0x5c')];for(var _0x3ca60f=0x0;_0x3ca60f<_0x479d7f[_0x807b('0x5d')]['length'];_0x3ca60f++){var _0x4c774d=_0x479d7f['conditions'][_0x3ca60f];var _0x4ffd7d='i';var _0x800bd=_['find'](_0x438b22,[_0x807b('0x2f'),_0x4c774d[_0x807b('0x49')]]);if(!_0x800bd){switch(_0x4c774d[_0x807b('0x49')]){case'unreadMessages':if(_0x4c774d['value']==0x1){_0x17f354[_0x807b('0x5e')]('`'+_0x4c774d['field']+'`\x20=\x200');}else{_0x17f354['having']('`'+_0x4c774d[_0x807b('0x49')]+_0x807b('0x5f'));}break;case _0x807b('0x60'):if(_0x4c774d[_0x807b('0x61')]==='$substring'){if(_0x4c774d['value'][_0x807b('0x62')]('\x20')['length']>0x1){_0x56aff1[_0xacc492](_0x807b('0x63'),qs[_0x807b('0x64')](_0x4c774d[_0x807b('0x65')]),null);}else{var _0x1e21e4='%'+_0x4c774d[_0x807b('0x65')]+'%';_0x56aff1[_0xacc492](_0x807b('0x66'),_0x1e21e4,_0x1e21e4,_0x1e21e4);}}else{_0x800bd=_[_0x807b('0x67')](_0x438b22,[_0x807b('0x2f'),_0x807b('0x68')]);_0x4c774d[_0x807b('0x49')]='ContactId';_0x7849c4=as[_0x807b('0x69')](_0x4ffd7d,_0x800bd[_0x807b('0x39')],_0x4c774d);_0x56aff1[_0xacc492](_0x7849c4[_0x807b('0x6a')],_0x7849c4['value']['start'],_0x7849c4['value'][_0x807b('0x2c')]);}break;case _0x807b('0x6b'):var _0x592155=_0x4c774d[_0x807b('0x65')][_0x807b('0x62')](',')[_0x807b('0x37')](function(_0x3a388a){return Number(_0x3a388a);});_0x592155[_0x807b('0x33')](function(_0x1714b1){_0x37972e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1714b1+',%');});_0x155330=_[_0x807b('0x6c')](_0x155330,_0x592155);break;case _0x807b('0x6d'):if(_0x4c774d[_0x807b('0x61')]===_0x807b('0x6e')){_0x56aff1[_0xacc492](_0x807b('0x6f'),'%'+_0x4c774d['value']+'%',null);}else{_0x800bd=_['find'](_0x438b22,[_0x807b('0x2f'),_0x807b('0x70')]);_0x4c774d[_0x807b('0x49')]=_0x807b('0x70');_0x7849c4=as[_0x807b('0x69')](_0x4ffd7d,_0x800bd[_0x807b('0x39')],_0x4c774d);_0x56aff1[_0xacc492](_0x7849c4['text'],_0x7849c4[_0x807b('0x65')]['start'],_0x7849c4['value'][_0x807b('0x2c')]);}break;case'body':_0x7849c4=as[_0x807b('0x69')]('me',null,_0x4c774d);_0x56aff1[_0xacc492](_0x7849c4[_0x807b('0x6a')],_0x7849c4['value'][_0x807b('0x71')],_0x7849c4['value'][_0x807b('0x2c')]);break;}}else{var _0x7849c4=as['buildExpression'](_0x4ffd7d,_0x800bd[_0x807b('0x39')],_0x4c774d);_0x56aff1[_0xacc492](_0x7849c4[_0x807b('0x6a')],_0x7849c4[_0x807b('0x65')][_0x807b('0x71')],_0x7849c4[_0x807b('0x65')][_0x807b('0x2c')]);}}}else{var _0x16349a=_(_0x1835b1[_0x807b('0x3c')])[_0x807b('0x3d')]()[_0x807b('0x37')](function(_0x41cfe7){return _[_0x807b('0x72')](_0x438b22,[_0x807b('0x2f'),_0x41cfe7])?_0x41cfe7:undefined;})[_0x807b('0x73')]()[_0x807b('0x65')]();if(!_[_0x807b('0x74')](_0x16349a)){_0x16349a[_0x807b('0x33')](function(_0x2f77f7){if(_0x2f77f7===_0x807b('0x75')){_0x17f354['where'](_0x807b('0x76'),[][_0x807b('0x77')](_0x1835b1[_0x807b('0x3c')][_0x2f77f7]));}else if(_0x2f77f7===_0x807b('0x78')){var _0x11e2ff=JSON[_0x807b('0x79')](_0x1835b1[_0x807b('0x3c')][_0x2f77f7])[_0x807b('0x7a')];var _0x277177=JSON[_0x807b('0x79')](_0x1835b1[_0x807b('0x3c')][_0x2f77f7])[_0x807b('0x7b')];_0x17f354[_0x807b('0x45')](_0x807b('0x7c'),_0x11e2ff,_0x277177);}else{if(_0x1835b1[_0x807b('0x3c')][_0x2f77f7]===_0x807b('0x7d')){_0x17f354[_0x807b('0x45')]('i.'+_0x2f77f7+_0x807b('0x7e'));}else{_0x17f354['where']('i.'+_0x2f77f7+'\x20=\x20?',_0x1835b1[_0x807b('0x3c')][_0x2f77f7]);}}});}if(_0x1835b1[_0x807b('0x3c')][_0x807b('0x7f')]){if(_0x1835b1['query']['read']==0x1){_0x17f354[_0x807b('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x17f354[_0x807b('0x5e')](_0x807b('0x80'));}}if(_0x1835b1[_0x807b('0x3c')][_0x807b('0x81')]){_0x155330=_['isArray'](_0x1835b1[_0x807b('0x3c')][_0x807b('0x81')])?_0x1835b1['query']['tag']:new Array(_0x1835b1[_0x807b('0x3c')]['tag']);_0x155330[_0x807b('0x33')](function(_0x227c80){_0x37972e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x227c80+',%');});}if(_0x1835b1[_0x807b('0x3c')][_0x807b('0x82')]){var _0x133664=_0x1835b1['query'][_0x807b('0x82')]['replace']('\x5c','\x5c\x5c')[_0x807b('0x83')](/'/g,'\x27\x27');if(qs[_0x807b('0x84')](_0x133664)){_0x56aff1['or'](_0x807b('0x85'),_0x133664+'%')['or'](_0x807b('0x86'),_0x133664+'%');}else{_0x56aff1['or'](_0x807b('0x87'),qs['getFullTextValue'](_0x133664))['or'](_0x807b('0x88'),_0x133664+'%');}}}_0x17f354[_0x807b('0x45')](_0x56aff1);_0x17f354[_0x807b('0x89')]('i.id');var _0x12f255={'type':db[_0x807b('0x8a')]['QueryTypes'][_0x807b('0x8b')],'raw':!![]};var _0x545607=_0x17f354[_0x807b('0x8c')]();_0x545607[_0x807b('0x49')](_0x807b('0x8d'));_0x545607[_0x807b('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x807b('0x8e'));if(_0x3c2849[_0x807b('0x43')]){_0x3c2849[_0x807b('0x43')][_0x807b('0x33')](function(_0x2080bd){var _0x3e010c=_0x2080bd[0x0]===_0x807b('0x8f')?_0x2080bd[0x0]:'i.'+_0x2080bd[0x0];_0x17f354[_0x807b('0x43')](_0x3e010c,_0x2080bd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x807b('0x74')](_0x155330)){_0x17f354[_0x807b('0x5e')](_0x37972e);_0x545607[_0x807b('0x45')]('t.id\x20IN\x20?',_0x155330);}BPromise[_0x807b('0x90')]()['then'](function(){if(!_0x479d7f){if(_0x1835b1['query']['SmsAccountId'])return;_0x545607['where'](_0x807b('0x91'));_0x17f354[_0x807b('0x45')](_0x807b('0x91'));return;}if(_0x1835b1[_0x807b('0x92')][_0x807b('0x93')]!==_0x807b('0x94'))return;return _0x1835b1[_0x807b('0x92')][_0x807b('0x95')]({'attributes':['id'],'raw':!![]})[_0x807b('0x2a')](function(_0x1f5bb1){if(_[_0x807b('0x74')](_0x1f5bb1)){_0x545607[_0x807b('0x45')](_0x807b('0x96'));_0x17f354[_0x807b('0x45')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x545607[_0x807b('0x45')](_0x807b('0x76'),_[_0x807b('0x37')](_0x1f5bb1,'id'));_0x17f354['where'](_0x807b('0x76'),_[_0x807b('0x37')](_0x1f5bb1,'id'));}});})[_0x807b('0x2a')](function(){if(_0x1835b1[_0x807b('0x92')][_0x807b('0x93')]===_0x807b('0x94')&&!_0x479d7f&&!_0x1835b1[_0x807b('0x3c')][_0x807b('0x75')])return[];return db[_0x807b('0x97')]['query'](_0x545607[_0x807b('0x98')](),_0x12f255);})[_0x807b('0x2a')](function(_0x1e417d){_0x397b55['count']=_0x1e417d[_0x807b('0x99')];if(_0x397b55[_0x807b('0x23')]===0x0)return[];return db[_0x807b('0x97')]['query'](_0x436be7[_0x807b('0x98')](),_0x12f255)[_0x807b('0x2a')](function(_0x44e2f1){_0x2c4248=_[_0x807b('0x9a')](_0x44e2f1,'id');_0x12f255=_[_0x807b('0x9b')](_0x12f255,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1835b1['query'][_0x807b('0x3f')]){_0x3c2849['attributes'][_0x807b('0x33')](function(_0x58384e){_0x17f354[_0x807b('0x49')]('i.'+_0x58384e);});}else{_0x17f354['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x807b('0x8e'));_0x17f354[_0x807b('0x49')](_0x807b('0x9c'),_0x807b('0x9d'));_0x17f354[_0x807b('0x49')](_0x807b('0x9e'),_0x807b('0x9f'));_0x17f354[_0x807b('0x49')](_0x807b('0xa0'),_0x807b('0x8f'));_0x17f354[_0x807b('0x49')](_0x807b('0xa1'));_0x17f354['field']('c.firstName',_0x807b('0xa2'));_0x17f354['field'](_0x807b('0xa3'),_0x807b('0xa4'));_0x17f354[_0x807b('0x49')](_0x807b('0xa5'),_0x807b('0xa6'));_0x17f354[_0x807b('0x49')](_0x807b('0xa7'),'Contact.phone');_0x17f354[_0x807b('0x49')]('c.mobile',_0x807b('0xa8'));_0x17f354[_0x807b('0x49')](_0x807b('0xa9'),_0x807b('0xaa'));_0x17f354['field'](_0x807b('0xab'),_0x807b('0xac'));_0x17f354[_0x807b('0x49')](_0x807b('0xad'),_0x807b('0xae'));_0x17f354['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x807b('0x31'));}if(_0x3c2849['limit'])_0x17f354['limit'](_0x3c2849['limit']);if(_0x3c2849[_0x807b('0x20')])_0x17f354[_0x807b('0x20')](_0x3c2849[_0x807b('0x20')]);return db[_0x807b('0x97')]['query'](_0x17f354[_0x807b('0x98')](),_0x12f255);})[_0x807b('0x2a')](function(_0x20be2b){if(_0x20be2b[_0x807b('0x99')]>0x0)_0x3e79e7['where'](_0x807b('0xaf'),_[_0x807b('0x37')](_0x20be2b,'id'));return db[_0x807b('0x97')][_0x807b('0x3c')](_0x3e79e7['toString'](),_0x12f255)['then'](function(_0x50d546){var _0x52fb67=_[_0x807b('0xb0')](_0x50d546,_0x807b('0xb1'));var _0x5221ea=[];_0x20be2b[_0x807b('0x33')](function(_0x150cf1){_0x5221ea[_0x807b('0x34')](updateSmsInteraction(_0x150cf1,_0x2c4248,_0x52fb67));});return BPromise['all'](_0x5221ea);});});})[_0x807b('0x2a')](function(_0x543b08){_0x397b55[_0x807b('0xb2')]=_0x543b08;return _0x397b55;})[_0x807b('0x2a')](respondWithFilteredResult(_0x1583cd,_0x3c2849))[_0x807b('0x35')](handleError(_0x1583cd,null));};exports[_0x807b('0xb3')]=function(_0x6876c0,_0x3050e7){var _0x404ffb={'raw':![],'where':{'id':_0x6876c0[_0x807b('0xb4')]['id']}},_0x3e4efe={};_0x3e4efe[_0x807b('0x3b')]=_[_0x807b('0x3d')](db[_0x807b('0xb5')][_0x807b('0x38')]);_0x3e4efe[_0x807b('0x3c')]=_[_0x807b('0x3d')](_0x6876c0[_0x807b('0x3c')]);_0x3e4efe['filters']=_[_0x807b('0x3e')](_0x3e4efe[_0x807b('0x3b')],_0x3e4efe[_0x807b('0x3c')]);_0x404ffb['attributes']=_[_0x807b('0x3e')](_0x3e4efe['model'],qs[_0x807b('0x3f')](_0x6876c0[_0x807b('0x3c')]['fields']));_0x404ffb['attributes']=_0x404ffb[_0x807b('0x40')]['length']?_0x404ffb['attributes']:_0x3e4efe[_0x807b('0x3b')];if(_0x6876c0['query'][_0x807b('0xb6')]){_0x404ffb[_0x807b('0xb7')]=[{'all':!![]}];}_0x404ffb=_[_0x807b('0x9b')]({},_0x404ffb,_0x6876c0[_0x807b('0xb8')]);return db['SmsInteraction'][_0x807b('0x67')](_0x404ffb)[_0x807b('0x2a')](handleEntityNotFound(_0x3050e7,null))['then'](respondWithResult(_0x3050e7,null))[_0x807b('0x35')](handleError(_0x3050e7,null));};exports[_0x807b('0xb9')]=function(_0x2f0b3c,_0x778ec3){return db['SmsInteraction'][_0x807b('0xb9')](_0x2f0b3c[_0x807b('0xba')],{})[_0x807b('0x2a')](respondWithResult(_0x778ec3,0xc9))['catch'](handleError(_0x778ec3,null));};exports['update']=function(_0x21168d,_0x250365){if(_0x21168d['body']['id']){delete _0x21168d['body']['id'];}return db[_0x807b('0xb5')][_0x807b('0x67')]({'where':{'id':_0x21168d[_0x807b('0xb4')]['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x250365,null))['then'](saveUpdates(_0x21168d['body'],null))[_0x807b('0x2a')](respondWithResult(_0x250365,null))[_0x807b('0x35')](handleError(_0x250365,null));};exports[_0x807b('0x2b')]=function(_0x24f382,_0x31ae82){return db[_0x807b('0xb5')][_0x807b('0x67')]({'where':{'id':_0x24f382['params']['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x31ae82,null))[_0x807b('0x2a')](removeEntity(_0x31ae82,null))[_0x807b('0x35')](handleError(_0x31ae82,null));};exports[_0x807b('0xbb')]=function(_0x54caa9,_0x50d5b3){return db['SmsInteraction'][_0x807b('0xbb')]()[_0x807b('0x2a')](respondWithResult(_0x50d5b3,null))[_0x807b('0x35')](handleError(_0x50d5b3,null));};exports[_0x807b('0xbc')]=function(_0x5ea613,_0x252ae4,_0x597433){return db[_0x807b('0xbd')][_0x807b('0x67')]({'where':{'id':_0x5ea613[_0x807b('0xb4')]['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x252ae4,null))['then'](function(_0x474644){if(_0x474644){return _0x474644[_0x807b('0xbc')](_0x5ea613[_0x807b('0xba')][_0x807b('0xbe')],_[_0x807b('0xbf')](_0x5ea613[_0x807b('0xba')],[_0x807b('0xbe'),'id'])||{});}})[_0x807b('0x2a')](respondWithResult(_0x252ae4,null))[_0x807b('0x35')](handleError(_0x252ae4,null));};exports[_0x807b('0xc0')]=function(_0x107c39,_0x2666ca,_0x3cc4a1){var _0x2446aa={'raw':![],'where':{}};var _0x3c1f0f={};var _0x442203={'count':0x0,'rows':[]};return db[_0x807b('0xb5')][_0x807b('0xc1')]({'where':{'id':_0x107c39[_0x807b('0xb4')]['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x2666ca,null))[_0x807b('0x2a')](function(_0x364a25){if(_0x364a25){_0x3c1f0f[_0x807b('0x3b')]=_['keys'](db[_0x807b('0xbd')][_0x807b('0x38')]);_0x3c1f0f[_0x807b('0x3c')]=_[_0x807b('0x3d')](_0x107c39[_0x807b('0x3c')]);_0x3c1f0f[_0x807b('0x46')]=_[_0x807b('0x3e')](_0x3c1f0f['model'],_0x3c1f0f[_0x807b('0x3c')]);_0x2446aa[_0x807b('0x40')]=_['intersection'](_0x3c1f0f['model'],qs[_0x807b('0x3f')](_0x107c39[_0x807b('0x3c')]['fields']));_0x2446aa[_0x807b('0x40')]=_0x2446aa[_0x807b('0x40')][_0x807b('0x99')]?_0x2446aa[_0x807b('0x40')]:_0x3c1f0f[_0x807b('0x3b')];if(!_0x107c39[_0x807b('0x3c')][_0x807b('0x41')](_0x807b('0x42'))){_0x2446aa['limit']=qs['limit'](_0x107c39['query'][_0x807b('0x22')]);_0x2446aa[_0x807b('0x20')]=qs[_0x807b('0x20')](_0x107c39['query'][_0x807b('0x20')]);}_0x2446aa[_0x807b('0x43')]=qs[_0x807b('0x44')](_0x107c39[_0x807b('0x3c')][_0x807b('0x44')]);_0x2446aa[_0x807b('0x45')]=qs[_0x807b('0x46')](_[_0x807b('0x47')](_0x107c39[_0x807b('0x3c')],_0x3c1f0f[_0x807b('0x46')]));_0x2446aa[_0x807b('0x45')]['SmsInteractionId']=_0x364a25['id'];if(_0x107c39[_0x807b('0x3c')][_0x807b('0x82')]){_0x2446aa[_0x807b('0x45')]=_[_0x807b('0x9b')](_0x2446aa[_0x807b('0x45')],{'$or':_[_0x807b('0x37')](_0x2446aa[_0x807b('0x40')],function(_0x4b9b3b){var _0x387ba1={};_0x387ba1[_0x4b9b3b]={'$like':'%'+_0x107c39[_0x807b('0x3c')]['filter']+'%'};return _0x387ba1;})});}if(_0x107c39[_0x807b('0x3c')][_0x807b('0x7a')]){var _0x174a42=_0x107c39[_0x807b('0x3c')]['$gte'][_0x807b('0x62')](',');var _0x46d5ce={};_0x46d5ce[_0x174a42[0x0]]={'$gte':moment(_0x174a42[0x1])[_0x807b('0xc2')](_0x807b('0xc3'))};_0x2446aa[_0x807b('0x45')]=_[_0x807b('0x9b')](_0x2446aa['where'],_0x46d5ce);}_0x2446aa=_[_0x807b('0x9b')]({},_0x2446aa,_0x107c39[_0x807b('0xb8')]);return db[_0x807b('0xbd')]['count']({'where':_0x2446aa[_0x807b('0x45')]})[_0x807b('0x2a')](function(_0x1172d9){_0x442203[_0x807b('0x23')]=_0x1172d9;if(_0x107c39[_0x807b('0x3c')][_0x807b('0xb6')]){_0x2446aa['include']=[{'all':!![]}];}return db[_0x807b('0xbd')][_0x807b('0xc4')](_0x2446aa);})[_0x807b('0x2a')](function(_0xb7c713){_0x442203[_0x807b('0xb2')]=_0xb7c713;return _0x442203;});}})['then'](respondWithFilteredResult(_0x2666ca,_0x2446aa))[_0x807b('0x35')](handleError(_0x2666ca,null));};exports[_0x807b('0xc5')]=function(_0x3ad0ee,_0x72edf6,_0x3285a3){return db[_0x807b('0xb5')][_0x807b('0x67')]({'where':{'id':_0x3ad0ee['params']['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x72edf6,null))['then'](function(_0x53f3c3){if(_0x53f3c3){return _0x53f3c3[_0x807b('0xc6')](_0x3ad0ee['body'][_0x807b('0xbe')],_[_0x807b('0xbf')](_0x3ad0ee[_0x807b('0xba')],[_0x807b('0xbe'),'id'])||{})[_0x807b('0xc7')](function(){return db['Tag'][_0x807b('0xc4')]({'attributes':['id',_0x807b('0x2f'),_0x807b('0x4a')],'where':{'id':_0x3ad0ee[_0x807b('0xba')]['ids']}});})[_0x807b('0x2a')](function(_0x567579){socket[_0x807b('0xc8')](_0x807b('0xc9'),{'id':Number(_0x3ad0ee['params']['id']),'tags':_0x567579||[]});return{'id':Number(_0x3ad0ee[_0x807b('0xb4')]['id']),'tags':_0x567579||[]};});}})[_0x807b('0x2a')](respondWithResult(_0x72edf6,null))[_0x807b('0x35')](handleError(_0x72edf6,null));};exports[_0x807b('0xca')]=function(_0x2bf131,_0x23e814,_0x3c8a88){return db[_0x807b('0xb5')][_0x807b('0x67')]({'where':{'id':_0x2bf131[_0x807b('0xb4')]['id']}})[_0x807b('0x2a')](handleEntityNotFound(_0x23e814,null))['then'](function(_0x539222){if(_0x539222){return _0x539222[_0x807b('0xca')](_0x2bf131[_0x807b('0x3c')][_0x807b('0xbe')]);}})[_0x807b('0x2a')](respondWithStatusCode(_0x23e814,null))['catch'](handleError(_0x23e814,null));};exports[_0x807b('0xcb')]=function(_0x15cbc6,_0xb23f3){var _0xe26501=moment()[_0x807b('0xcc')]()[_0x807b('0x98')]();var _0x4acb93=path[_0x807b('0xcd')](config[_0x807b('0xce')],_0x807b('0xcf'),_0x807b('0xd0'),_0x807b('0xd1'));var _0x1f92ee=path[_0x807b('0xcd')](config[_0x807b('0xce')],_0x807b('0xcf'),_0x807b('0xd0'),_0x807b('0xd2'));var _0x3d9c64=path['join'](_0x4acb93,_0xe26501);var _0xee9756=util['format'](_0x807b('0xd3'),_0x15cbc6[_0x807b('0xb4')]['id'],_0xe26501);var _0x356127=path[_0x807b('0xcd')](_0x4acb93,_0xee9756);var _0x1e9b4a=[];_0x1e9b4a['push']({'model':db[_0x807b('0x6d')],'as':_0x807b('0x6d'),'attributes':['id',_0x807b('0xd4')],'raw':!![]});_0x1e9b4a[_0x807b('0x34')]({'model':db[_0x807b('0xd5')],'as':_0x807b('0x60'),'attributes':['id',_0x807b('0xd6'),_0x807b('0xd7')],'raw':!![]});var _0x2c8c92=[{'model':db[_0x807b('0xbd')],'as':_0x807b('0xd8'),'attributes':['id',_0x807b('0xba'),_0x807b('0x78'),'direction','secret',_0x807b('0x7f')],'include':_0x1e9b4a}];_0x2c8c92[_0x807b('0x34')]({'model':db[_0x807b('0xd9')],'as':_0x807b('0xda'),'attributes':['id',_0x807b('0x2f')]});_0x2c8c92['push']({'model':db['User'],'as':_0x807b('0xdb'),'attributes':['id','fullname']});return db[_0x807b('0xb5')][_0x807b('0x67')]({'where':{'id':_0x15cbc6[_0x807b('0xb4')]['id']},'include':_0x2c8c92})[_0x807b('0x2a')](handleEntityNotFound(_0xb23f3,null))[_0x807b('0x2a')](function(_0x2f073f){if(_0x2f073f){var _0x59b1cf=_0x2f073f[_0x807b('0xdc')]({'plain':!![]});fs[_0x807b('0xdd')](_0x3d9c64);var _0xb5cc07={'channel':'Sms','account':_0x59b1cf[_0x807b('0xda')][_0x807b('0x2f')],'agent':_0x59b1cf[_0x807b('0xdb')]?_0x59b1cf[_0x807b('0xdb')][_0x807b('0xd4')]:_0x807b('0xde'),'createdAt':moment(_0x59b1cf[_0x807b('0x78')])['format'](_0x807b('0xc3'))[_0x807b('0x98')](),'closedAt':_0x59b1cf[_0x807b('0xdf')]?moment(_0x59b1cf[_0x807b('0xe0')])[_0x807b('0xc2')](_0x807b('0xc3'))['toString']():'','disposition':_0x59b1cf['disposition'],'messages':_(_0x59b1cf[_0x807b('0xd8')])[_0x807b('0x82')]({'secret':![]})[_0x807b('0x37')](function(_0x1cbcb0){return{'date':moment(_0x1cbcb0['createdAt'])[_0x807b('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x807b('0x98')](),'sender':_0x1cbcb0[_0x807b('0xe1')]===_0x807b('0xe2')?_0x1cbcb0[_0x807b('0x6d')]?_0x1cbcb0[_0x807b('0x6d')]['fullname']:_0x807b('0xe3'):_0x1cbcb0['Contact']['firstName']+(_0x1cbcb0[_0x807b('0x60')][_0x807b('0xd7')]?'\x20'+_0x1cbcb0['Contact'][_0x807b('0xd7')]:''),'body':_0x1cbcb0[_0x807b('0xba')],'direction':_0x1cbcb0['direction']==='out'?'A':'C','secret':_0x1cbcb0[_0x807b('0xe4')],'read':_0x1cbcb0['read']};})[_0x807b('0x65')]()};return ejs[_0x807b('0xe5')](path[_0x807b('0xcd')](config['root'],_0x807b('0xcf'),_0x807b('0xe6'),_0x807b('0xe7')),{'interaction':_0xb5cc07})[_0x807b('0x2a')](function(_0x501c6e){var _0x15b857=path['join'](_0x3d9c64,_0x807b('0xe8')+_0x59b1cf['id']+'-'+_0xe26501+_0x807b('0xe9'));var _0xce97d9={'path':_0x15b857,'channel':_0x807b('0xea'),'interactionId':_0x59b1cf['id']};return pdf[_0x807b('0xeb')](_0x501c6e,_0xce97d9);})['then'](function(){return new BPromise(function(_0x495cdf,_0x49314c){zipdir(_0x3d9c64,{'saveTo':_0x356127},function(_0x10e9b6,_0x436262){if(_0x10e9b6)return _0x49314c(_0x10e9b6);return _0x495cdf(_0x436262);});})[_0x807b('0x2a')](function(){return new BPromise(function(_0x62f3a7,_0x51109a){rimraf(_0x3d9c64,function(_0x4024ca){if(_0x4024ca)_0x51109a(_0x4024ca);return _0x62f3a7();});});})[_0x807b('0x2a')](function(){return _0xb23f3[_0x807b('0xcb')](_0x356127,_0xee9756,function(_0x2ca0d4){if(_0x2ca0d4){console[_0x807b('0xec')](_0x807b('0xed'),_0x2ca0d4);}else{fs[_0x807b('0xee')](_0x356127);}});});});}else{return _0xb23f3[_0x807b('0x1e')](0xc8);}})['catch'](handleError(_0xb23f3,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 59081a7..3c11f3b 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 _0x6343=['then','map','findAll','setDataValue','emit','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','remove'];(function(_0x53bbf3,_0x10987d){var _0x240cb0=function(_0xeebbf8){while(--_0xeebbf8){_0x53bbf3['push'](_0x53bbf3['shift']());}};_0x240cb0(++_0x10987d);}(_0x6343,0x168));var _0x3634=function(_0x139711,_0x2aaa21){_0x139711=_0x139711-0x0;var _0x56f446=_0x6343[_0x139711];return _0x56f446;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3634('0x0')];var SmsMessage=require(_0x3634('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3634('0x2')};function emitEvent(_0x420510){return function(_0x57c5e4,_0x247964,_0x388c18){_0x57c5e4['getUsers']({'attributes':['id'],'raw':!![]})[_0x3634('0x3')](function(_0xd40513){_0x57c5e4['setDataValue']('Users',_0xd40513[_0x3634('0x4')](function(_0x1bcdb2){return{'id':_0x1bcdb2['id']};}));return SmsMessage[_0x3634('0x5')]({'where':{'SmsInteractionId':_0x57c5e4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3634('0x3')](function(_0x2e8e8b){_0x57c5e4[_0x3634('0x6')]('unreadMessages',_0x2e8e8b['length']);SmsInteractionEvents[_0x3634('0x7')](_0x420510+':'+_0x57c5e4['id'],_0x57c5e4);SmsInteractionEvents[_0x3634('0x7')](_0x420510,_0x57c5e4);_0x388c18(null);})['catch'](_0x388c18(null));};}for(var e in events){if(events[_0x3634('0x8')](e)){var event=events[e];SmsInteraction[_0x3634('0x9')](e,emitEvent(event));}}module[_0x3634('0xa')]=SmsInteractionEvents; \ No newline at end of file +var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x2eaff4,_0x4852b7){var _0x278c7a=function(_0x9a80f6){while(--_0x9a80f6){_0x2eaff4['push'](_0x2eaff4['shift']());}};_0x278c7a(++_0x4852b7);}(_0xdb28,0x106));var _0x8db2=function(_0x55cd77,_0x24b9e2){_0x55cd77=_0x55cd77-0x0;var _0x5bf937=_0xdb28[_0x55cd77];return _0x5bf937;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index aa9112d..0b415ed 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 _0x8cce=['sms_interactions','closed','closedAt','format','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','SmsInteraction'];(function(_0x4fab0d,_0x92c4e3){var _0x48734d=function(_0x2fb13b){while(--_0x2fb13b){_0x4fab0d['push'](_0x4fab0d['shift']());}};_0x48734d(++_0x92c4e3);}(_0x8cce,0xb8));var _0xe8cc=function(_0x58698b,_0xce05e3){_0x58698b=_0x58698b-0x0;var _0x4e3015=_0x8cce[_0x58698b];return _0x4e3015;};'use strict';var _=require(_0xe8cc('0x0'));var util=require(_0xe8cc('0x1'));var logger=require(_0xe8cc('0x2'))(_0xe8cc('0x3'));var moment=require('moment');var BPromise=require(_0xe8cc('0x4'));var rp=require(_0xe8cc('0x5'));var fs=require('fs');var path=require(_0xe8cc('0x6'));var rimraf=require('rimraf');var config=require(_0xe8cc('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xe8cc('0x8')]=function(_0x5717a4,_0x52d775){return _0x5717a4[_0xe8cc('0x9')](_0xe8cc('0xa'),attributes,{'tableName':_0xe8cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x501deb,_0xfd9639,_0x73a617){if(_0x501deb['changed'](_0xe8cc('0xc'))){_0x501deb[_0xe8cc('0xd')]=moment()[_0xe8cc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x73a617(null,_0x501deb);}}});}; \ No newline at end of file +var _0xeee4=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash'];(function(_0x2314bf,_0x4cb514){var _0x43e187=function(_0x325818){while(--_0x325818){_0x2314bf['push'](_0x2314bf['shift']());}};_0x43e187(++_0x4cb514);}(_0xeee4,0x1c1));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4eee('0x0'));var util=require(_0x4eee('0x1'));var logger=require(_0x4eee('0x2'))(_0x4eee('0x3'));var moment=require(_0x4eee('0x4'));var BPromise=require(_0x4eee('0x5'));var rp=require(_0x4eee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4eee('0x7'));var config=require(_0x4eee('0x8'));var attributes=require(_0x4eee('0x9'));module['exports']=function(_0x3bde40,_0x13dc3c){return _0x3bde40['define'](_0x4eee('0xa'),attributes,{'tableName':_0x4eee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45af7,_0x3b0a8a,_0x3ef525){if(_0x45af7[_0x4eee('0xc')](_0x4eee('0xd'))){_0x45af7[_0x4eee('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3ef525(null,_0x45af7);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 57cc86f..fdb07f0 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 _0x1e7c=['result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x1e7c,0x91));var _0xc1e7=function(_0x13eb68,_0x58416c){_0x13eb68=_0x13eb68-0x0;var _0x3de659=_0x1e7c[_0x13eb68];return _0x3de659;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc1e7('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1e7('0x1'));var db=require(_0xc1e7('0x2'))['db'];var utils=require(_0xc1e7('0x3'));var logger=require(_0xc1e7('0x4'))(_0xc1e7('0x5'));var config=require('../../config/environment');var jayson=require(_0xc1e7('0x6'));var client=jayson[_0xc1e7('0x7')][_0xc1e7('0x8')]({'port':0x232a});config[_0xc1e7('0x9')]=_[_0xc1e7('0xa')](config[_0xc1e7('0x9')],{'host':_0xc1e7('0xb'),'port':0x18eb});var socket=require(_0xc1e7('0xc'))(new Redis(config[_0xc1e7('0x9')]));require(_0xc1e7('0xd'))['register'](socket);function respondWithRpcPromise(_0x40b26d,_0x26cc89,_0x303b01){return new BPromise(function(_0x4f5ab4,_0x3b9318){return client['request'](_0x40b26d,_0x303b01)[_0xc1e7('0xe')](function(_0x419f84){logger['info'](_0xc1e7('0xf'),_0x26cc89,_0xc1e7('0x10'));logger[_0xc1e7('0x11')](_0xc1e7('0x12'),_0x26cc89,_0xc1e7('0x10'),JSON['stringify'](_0x419f84));if(_0x419f84[_0xc1e7('0x13')]){if(_0x419f84[_0xc1e7('0x13')][_0xc1e7('0x14')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x26cc89,_0x419f84[_0xc1e7('0x13')][_0xc1e7('0x15')]);return _0x3b9318(_0x419f84['error'][_0xc1e7('0x15')]);}logger[_0xc1e7('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x26cc89,_0x419f84[_0xc1e7('0x13')][_0xc1e7('0x15')]);return _0x4f5ab4(_0x419f84[_0xc1e7('0x13')][_0xc1e7('0x15')]);}else{logger[_0xc1e7('0x16')](_0xc1e7('0xf'),_0x26cc89,_0xc1e7('0x10'));_0x4f5ab4(_0x419f84[_0xc1e7('0x17')][_0xc1e7('0x15')]);}})[_0xc1e7('0x18')](function(_0x3ba429){logger[_0xc1e7('0x13')](_0xc1e7('0xf'),_0x26cc89,_0x3ba429);_0x3b9318(_0x3ba429);});});}exports[_0xc1e7('0x19')]=function(_0x43e5a7){var _0x55df27=this;return new Promise(function(_0x30d9cf,_0x36ebf0){return db[_0xc1e7('0x1a')][_0xc1e7('0x1b')](_0x43e5a7[_0xc1e7('0x1c')],{'raw':_0x43e5a7[_0xc1e7('0x1d')]?_0x43e5a7[_0xc1e7('0x1d')][_0xc1e7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e5a7['options']?_0x43e5a7[_0xc1e7('0x1d')][_0xc1e7('0x1f')]||null:null,'attributes':_0x43e5a7[_0xc1e7('0x1d')]?_0x43e5a7[_0xc1e7('0x1d')][_0xc1e7('0x20')]||null:null,'limit':_0x43e5a7[_0xc1e7('0x1d')]?_0x43e5a7[_0xc1e7('0x1d')][_0xc1e7('0x21')]||null:null})['then'](function(_0x3080f8){logger[_0xc1e7('0x16')](_0xc1e7('0x19'),_0x43e5a7);logger[_0xc1e7('0x11')](_0xc1e7('0x19'),_0x43e5a7,JSON[_0xc1e7('0x22')](_0x3080f8));_0x30d9cf(_0x3080f8);})['catch'](function(_0x5330a4){logger[_0xc1e7('0x13')](_0xc1e7('0x19'),_0x5330a4[_0xc1e7('0x15')],_0x43e5a7);_0x36ebf0(_0x55df27[_0xc1e7('0x13')](0x1f4,_0x5330a4['message']));});});};exports[_0xc1e7('0x23')]=function(_0x51221e){return new Promise(function(_0x24174b,_0x38973b){return db[_0xc1e7('0x1a')][_0xc1e7('0x24')]({'where':_0x51221e['options']?_0x51221e['options']['where']||null:null})[_0xc1e7('0xe')](function(_0x3e2951){if(_0x3e2951){return _0x3e2951[_0xc1e7('0x25')](_0x51221e['body'][_0xc1e7('0x26')],_[_0xc1e7('0x27')](_0x51221e[_0xc1e7('0x1c')],[_0xc1e7('0x26'),'id'])||{});}})[_0xc1e7('0x28')](function(_0x3cd26d){logger['info'](_0xc1e7('0x29'),_0x51221e);logger[_0xc1e7('0x11')]('AddTags',_0x51221e,JSON[_0xc1e7('0x22')](_0x3cd26d));_0x24174b(_0x3cd26d);})['catch'](function(_0x255d12){logger[_0xc1e7('0x13')](_0xc1e7('0x29'),_0x255d12[_0xc1e7('0x15')],_0x51221e);_0x38973b(_this[_0xc1e7('0x13')](0x1f4,_0x255d12['message']));});});}; \ No newline at end of file +var _0xd765=['message','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','find','addTags','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd765,0x87));var _0x5d76=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd765[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5d76('0x0'));var util=require('util');var moment=require(_0x5d76('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d76('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d76('0x3'))['db'];var utils=require(_0x5d76('0x4'));var logger=require(_0x5d76('0x5'))(_0x5d76('0x6'));var config=require(_0x5d76('0x7'));var jayson=require(_0x5d76('0x8'));var client=jayson[_0x5d76('0x9')][_0x5d76('0xa')]({'port':0x232a});config[_0x5d76('0xb')]=_[_0x5d76('0xc')](config['redis'],{'host':_0x5d76('0xd'),'port':0x18eb});var socket=require(_0x5d76('0xe'))(new Redis(config[_0x5d76('0xb')]));require('./smsInteraction.socket')[_0x5d76('0xf')](socket);function respondWithRpcPromise(_0x3a8271,_0x54ec75,_0x363089){return new BPromise(function(_0x284f03,_0x3e5345){return client[_0x5d76('0x10')](_0x3a8271,_0x363089)[_0x5d76('0x11')](function(_0x3ccbef){logger[_0x5d76('0x12')](_0x5d76('0x13'),_0x54ec75,_0x5d76('0x14'));logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x54ec75,_0x5d76('0x14'),JSON[_0x5d76('0x17')](_0x3ccbef));if(_0x3ccbef['error']){if(_0x3ccbef[_0x5d76('0x18')]['code']===0x1f4){logger[_0x5d76('0x18')](_0x5d76('0x13'),_0x54ec75,_0x3ccbef[_0x5d76('0x18')][_0x5d76('0x19')]);return _0x3e5345(_0x3ccbef[_0x5d76('0x18')][_0x5d76('0x19')]);}logger[_0x5d76('0x18')](_0x5d76('0x13'),_0x54ec75,_0x3ccbef[_0x5d76('0x18')][_0x5d76('0x19')]);return _0x284f03(_0x3ccbef[_0x5d76('0x18')]['message']);}else{logger[_0x5d76('0x12')](_0x5d76('0x13'),_0x54ec75,_0x5d76('0x14'));_0x284f03(_0x3ccbef['result'][_0x5d76('0x19')]);}})['catch'](function(_0x28a239){logger[_0x5d76('0x18')](_0x5d76('0x13'),_0x54ec75,_0x28a239);_0x3e5345(_0x28a239);});});}exports[_0x5d76('0x1a')]=function(_0x57f85c){var _0xb12ac7=this;return new Promise(function(_0x58abb7,_0x15be60){return db[_0x5d76('0x1b')]['update'](_0x57f85c[_0x5d76('0x1c')],{'raw':_0x57f85c[_0x5d76('0x1d')]?_0x57f85c[_0x5d76('0x1d')][_0x5d76('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57f85c[_0x5d76('0x1d')]?_0x57f85c['options'][_0x5d76('0x1f')]||null:null,'attributes':_0x57f85c[_0x5d76('0x1d')]?_0x57f85c[_0x5d76('0x1d')][_0x5d76('0x20')]||null:null,'limit':_0x57f85c['options']?_0x57f85c['options'][_0x5d76('0x21')]||null:null})[_0x5d76('0x11')](function(_0x1bb2d7){logger['info'](_0x5d76('0x1a'),_0x57f85c);logger[_0x5d76('0x15')](_0x5d76('0x1a'),_0x57f85c,JSON[_0x5d76('0x17')](_0x1bb2d7));_0x58abb7(_0x1bb2d7);})[_0x5d76('0x22')](function(_0x1b2c77){logger['error'](_0x5d76('0x1a'),_0x1b2c77[_0x5d76('0x19')],_0x57f85c);_0x15be60(_0xb12ac7[_0x5d76('0x18')](0x1f4,_0x1b2c77[_0x5d76('0x19')]));});});};exports[_0x5d76('0x23')]=function(_0x3467a5){return new Promise(function(_0x26d4f9,_0x31a2fc){return db[_0x5d76('0x1b')][_0x5d76('0x24')]({'where':_0x3467a5[_0x5d76('0x1d')]?_0x3467a5[_0x5d76('0x1d')][_0x5d76('0x1f')]||null:null})[_0x5d76('0x11')](function(_0x163d54){if(_0x163d54){return _0x163d54[_0x5d76('0x25')](_0x3467a5[_0x5d76('0x1c')]['ids'],_['omit'](_0x3467a5[_0x5d76('0x1c')],['ids','id'])||{});}})[_0x5d76('0x26')](function(_0x3b53d3){logger[_0x5d76('0x12')](_0x5d76('0x27'),_0x3467a5);logger[_0x5d76('0x15')]('AddTags',_0x3467a5,JSON[_0x5d76('0x17')](_0x3b53d3));_0x26d4f9(_0x3b53d3);})['catch'](function(_0x930cbb){logger[_0x5d76('0x18')](_0x5d76('0x27'),_0x930cbb[_0x5d76('0x19')],_0x3467a5);_0x31a2fc(_this[_0x5d76('0x18')](0x1f4,_0x930cbb['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 3c41dd2..3bac467 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 _0x534e=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','update'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x534e,0xed));var _0xe534=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x534e[_0x408d22];return _0x58effd;};'use strict';var SmsInteractionEvents=require(_0xe534('0x0'));var events=[_0xe534('0x1'),'remove',_0xe534('0x2')];function createListener(_0x5cb1fc,_0x2d9324){return function(_0x2c3369){_0x2d9324[_0xe534('0x3')](_0x5cb1fc,_0x2c3369);};}function removeListener(_0x236e6f,_0x50b848){return function(){SmsInteractionEvents[_0xe534('0x4')](_0x236e6f,_0x50b848);};}exports[_0xe534('0x5')]=function(_0x1393ad){for(var _0x5c3bb4=0x0,_0x4e6285=events[_0xe534('0x6')];_0x5c3bb4<_0x4e6285;_0x5c3bb4++){var _0x397d29=events[_0x5c3bb4];var _0x4b8b13=createListener(_0xe534('0x7')+_0x397d29,_0x1393ad);SmsInteractionEvents['on'](_0x397d29,_0x4b8b13);}}; \ No newline at end of file +var _0x4057=['remove','update','emit','removeListener','length','save'];(function(_0x151fd1,_0x2af56b){var _0x44b7d5=function(_0x33d08c){while(--_0x33d08c){_0x151fd1['push'](_0x151fd1['shift']());}};_0x44b7d5(++_0x2af56b);}(_0x4057,0x179));var _0x7405=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0x4057[_0x3794a0];return _0x5bdaba;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x7405('0x0'),_0x7405('0x1'),_0x7405('0x2')];function createListener(_0x2cf5c4,_0x3d83bf){return function(_0x22ab2d){_0x3d83bf[_0x7405('0x3')](_0x2cf5c4,_0x22ab2d);};}function removeListener(_0x21c960,_0x3d5bf2){return function(){SmsInteractionEvents[_0x7405('0x4')](_0x21c960,_0x3d5bf2);};}exports['register']=function(_0x1a4190){for(var _0x5f4664=0x0,_0x5dd230=events[_0x7405('0x5')];_0x5f4664<_0x5dd230;_0x5f4664++){var _0x240462=events[_0x5f4664];var _0x3b2de4=createListener('smsInteraction:'+_0x240462,_0x1a4190);SmsInteractionEvents['on'](_0x240462,_0x3b2de4);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5dfbccf..c9cf40e 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 _0x9215=['/:id','update','accept','put','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','describe','show','post','status'];(function(_0x4daf85,_0x599f4b){var _0x1e508e=function(_0x1ecb3f){while(--_0x1ecb3f){_0x4daf85['push'](_0x4daf85['shift']());}};_0x1e508e(++_0x599f4b);}(_0x9215,0x13f));var _0x5921=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9215[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x5921('0x0'));var util=require(_0x5921('0x1'));var path=require(_0x5921('0x2'));var timeout=require(_0x5921('0x3'));var express=require(_0x5921('0x4'));var router=express[_0x5921('0x5')]();var fs_extra=require(_0x5921('0x6'));var auth=require(_0x5921('0x7'));var interaction=require(_0x5921('0x8'));var config=require('../../config/environment');var controller=require(_0x5921('0x9'));router[_0x5921('0xa')]('/',auth[_0x5921('0xb')](),controller[_0x5921('0xc')]);router[_0x5921('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5921('0xd')]);router[_0x5921('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5921('0xe')]);router['post']('/',auth[_0x5921('0xb')](),interaction['tracked']('sms','smsmessage:create'),controller['create']);router[_0x5921('0xf')]('/:id/status',controller[_0x5921('0x10')]);router['put'](_0x5921('0x11'),auth[_0x5921('0xb')](),controller[_0x5921('0x12')]);router['put']('/:id/accept',auth[_0x5921('0xb')](),controller[_0x5921('0x13')]);router[_0x5921('0x14')](_0x5921('0x15'),auth[_0x5921('0xb')](),controller[_0x5921('0x16')]);router[_0x5921('0x17')](_0x5921('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x88a6=['put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','status'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x88a6,0x121));var _0x688a=function(_0x18fd0b,_0xe0f9ed){_0x18fd0b=_0x18fd0b-0x0;var _0x3b19a3=_0x88a6[_0x18fd0b];return _0x3b19a3;};'use strict';var multer=require('multer');var util=require(_0x688a('0x0'));var path=require(_0x688a('0x1'));var timeout=require('connect-timeout');var express=require(_0x688a('0x2'));var router=express[_0x688a('0x3')]();var fs_extra=require(_0x688a('0x4'));var auth=require(_0x688a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x688a('0x6'));router['get']('/',auth[_0x688a('0x7')](),controller[_0x688a('0x8')]);router[_0x688a('0x9')](_0x688a('0xa'),auth['isAuthenticated'](),controller[_0x688a('0xb')]);router[_0x688a('0x9')]('/:id',auth[_0x688a('0x7')](),controller[_0x688a('0xc')]);router[_0x688a('0xd')]('/',auth[_0x688a('0x7')](),interaction[_0x688a('0xe')](_0x688a('0xf'),_0x688a('0x10')),controller[_0x688a('0x11')]);router['post']('/:id/status',controller[_0x688a('0x12')]);router[_0x688a('0x13')](_0x688a('0x14'),auth[_0x688a('0x7')](),controller[_0x688a('0x15')]);router['put'](_0x688a('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x688a('0x13')](_0x688a('0x17'),auth['isAuthenticated'](),controller[_0x688a('0x18')]);router[_0x688a('0x19')]('/:id',auth[_0x688a('0x7')](),controller[_0x688a('0x1a')]);module[_0x688a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index f0a5ad0..e16a26a 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 _0xe676=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x273d71,_0x11c3a4){var _0x264e15=function(_0x4344c3){while(--_0x4344c3){_0x273d71['push'](_0x273d71['shift']());}};_0x264e15(++_0x11c3a4);}(_0xe676,0x14f));var _0x6e67=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xe676[_0x1fd675];return _0x16b554;};'use strict';var Sequelize=require(_0x6e67('0x0'));module['exports']={'body':{'type':Sequelize[_0x6e67('0x1')](_0x6e67('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6e67('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6e67('0x4')),'defaultValue':_0x6e67('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6e67('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6e67('0x5')]},'readAt':{'type':Sequelize[_0x6e67('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6e67('0x5')]},'providerResponse':{'type':Sequelize[_0x6e67('0x1')]}}; \ No newline at end of file +var _0x556b=['exports','TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x82f6aa,_0xc6acd1){var _0x3ff4d0=function(_0x33c15f){while(--_0x33c15f){_0x82f6aa['push'](_0x82f6aa['shift']());}};_0x3ff4d0(++_0xc6acd1);}(_0x556b,0x1d7));var _0xb556=function(_0x2a68ba,_0x6d62d7){_0x2a68ba=_0x2a68ba-0x0;var _0x46d006=_0x556b[_0x2a68ba];return _0x46d006;};'use strict';var Sequelize=require(_0xb556('0x0'));module[_0xb556('0x1')]={'body':{'type':Sequelize[_0xb556('0x2')](_0xb556('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb556('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb556('0x5')),'defaultValue':_0xb556('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb556('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb556('0x6')]},'readAt':{'type':Sequelize[_0xb556('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1058f08..d7b96b5 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 _0xbc87=['SmsInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SIP/%s','motionChannel','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x2764f7,_0x41dcea){_0x2764f7=_0x2764f7-0x0;var _0x3cef7d=_0xbc87[_0x2764f7];return _0x3cef7d;};'use strict';var emlformat=require(_0x7bc8('0x0'));var rimraf=require(_0x7bc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bc8('0x2'));var rp=require(_0x7bc8('0x3'));var moment=require(_0x7bc8('0x4'));var BPromise=require(_0x7bc8('0x5'));var Mustache=require('mustache');var util=require(_0x7bc8('0x6'));var path=require(_0x7bc8('0x7'));var sox=require(_0x7bc8('0x8'));var csv=require(_0x7bc8('0x9'));var ejs=require(_0x7bc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7bc8('0xb'));var crypto=require(_0x7bc8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7bc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7bc8('0xe'));var Papa=require(_0x7bc8('0xf'));var Redis=require('ioredis');var authService=require(_0x7bc8('0x10'));var qs=require(_0x7bc8('0x11'));var as=require(_0x7bc8('0x12'));var hardwareService=require(_0x7bc8('0x13'));var logger=require(_0x7bc8('0x14'))('api');var utils=require(_0x7bc8('0x15'));var config=require(_0x7bc8('0x16'));var licenseUtil=require(_0x7bc8('0x17'));var db=require(_0x7bc8('0x18'))['db'];config[_0x7bc8('0x19')]=_[_0x7bc8('0x1a')](config[_0x7bc8('0x19')],{'host':_0x7bc8('0x1b'),'port':0x18eb});var socket=require(_0x7bc8('0x1c'))(new Redis(config[_0x7bc8('0x19')]));require(_0x7bc8('0x1d'))['register'](socket);var jayson=require(_0x7bc8('0x1e'));var client=jayson[_0x7bc8('0x1f')][_0x7bc8('0x20')]({'port':0x232c});var client9002=jayson[_0x7bc8('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3db956,_0x53be05,_0x249bd2,_0x56a3f3){return new BPromise(function(_0x400e47,_0x97622c){var _0x2afec4=_0x56a3f3||client;return _0x2afec4['request'](_0x3db956,_0x249bd2)[_0x7bc8('0x21')](function(_0x1f2fb9){logger[_0x7bc8('0x22')](_0x7bc8('0x23'),_0x53be05,_0x7bc8('0x24'));logger[_0x7bc8('0x25')](_0x7bc8('0x26'),_0x53be05,_0x7bc8('0x24'),JSON['stringify'](_0x1f2fb9));if(_0x1f2fb9[_0x7bc8('0x27')]){if(_0x1f2fb9['error'][_0x7bc8('0x28')]===0x1f4){logger[_0x7bc8('0x27')](_0x7bc8('0x23'),_0x53be05,_0x1f2fb9[_0x7bc8('0x27')][_0x7bc8('0x29')]);return _0x97622c(_0x1f2fb9[_0x7bc8('0x27')]['message']);}logger[_0x7bc8('0x27')](_0x7bc8('0x23'),_0x53be05,_0x1f2fb9[_0x7bc8('0x27')][_0x7bc8('0x29')]);return _0x400e47(_0x1f2fb9[_0x7bc8('0x27')][_0x7bc8('0x29')]);}else{logger[_0x7bc8('0x22')](_0x7bc8('0x23'),_0x53be05,_0x7bc8('0x24'));_0x400e47(_0x1f2fb9[_0x7bc8('0x2a')][_0x7bc8('0x29')]);}})['catch'](function(_0x3ef138){logger[_0x7bc8('0x27')](_0x7bc8('0x23'),_0x53be05,_0x3ef138);_0x97622c(_0x3ef138);});});}function respondWithStatusCode(_0x369550,_0x54eb23){_0x54eb23=_0x54eb23||0xcc;return function(_0x4a11e4){if(_0x4a11e4){return _0x369550['sendStatus'](_0x54eb23);}return _0x369550[_0x7bc8('0x2b')](_0x54eb23)[_0x7bc8('0x2c')]();};}function respondWithResult(_0x157b66,_0x2f519c){_0x2f519c=_0x2f519c||0xc8;return function(_0x4954b5){if(_0x4954b5){return _0x157b66[_0x7bc8('0x2b')](_0x2f519c)[_0x7bc8('0x2d')](_0x4954b5);}};}function respondWithFilteredResult(_0x212515,_0x4efeec){return function(_0x17baec){if(_0x17baec){var _0x5a4c5c=typeof _0x4efeec[_0x7bc8('0x2e')]===_0x7bc8('0x2f')&&typeof _0x4efeec[_0x7bc8('0x30')]===_0x7bc8('0x2f');var _0xe8418c=_0x17baec[_0x7bc8('0x31')];var _0x1540b5=_0x5a4c5c?0x0:_0x4efeec[_0x7bc8('0x2e')];var _0xd7d333=_0x5a4c5c?_0x17baec[_0x7bc8('0x31')]:_0x4efeec[_0x7bc8('0x2e')]+_0x4efeec[_0x7bc8('0x30')];var _0x9a0af1;if(_0xd7d333>=_0xe8418c){_0xd7d333=_0xe8418c;_0x9a0af1=0xc8;}else{_0x9a0af1=0xce;}_0x212515[_0x7bc8('0x2b')](_0x9a0af1);return _0x212515['set'](_0x7bc8('0x32'),_0x1540b5+'-'+_0xd7d333+'/'+_0xe8418c)[_0x7bc8('0x2d')](_0x17baec);}return null;};}function patchUpdates(_0x29c709){return function(_0x4f6311){try{jsonpatch[_0x7bc8('0x33')](_0x4f6311,_0x29c709,!![]);}catch(_0x4f697a){return BPromise[_0x7bc8('0x34')](_0x4f697a);}return _0x4f6311['save']();};}function saveUpdates(_0x27a65f,_0x189440){return function(_0x362c76){if(_0x362c76){return _0x362c76[_0x7bc8('0x35')](_0x27a65f)[_0x7bc8('0x21')](function(_0x54bc04){return _0x54bc04;});}return null;};}function removeEntity(_0x981f0d,_0x1b2ed1){return function(_0x569a6b){if(_0x569a6b){return _0x569a6b[_0x7bc8('0x36')]()[_0x7bc8('0x21')](function(){_0x981f0d[_0x7bc8('0x2b')](0xcc)[_0x7bc8('0x2c')]();});}};}function handleEntityNotFound(_0x3c8196,_0x380a27){return function(_0x1d5c0d){if(!_0x1d5c0d){_0x3c8196[_0x7bc8('0x37')](0x194);}return _0x1d5c0d;};}function handleError(_0x2acc65,_0x16b5eb){_0x16b5eb=_0x16b5eb||0x1f4;return function(_0x2299e7){logger['error'](_0x2299e7[_0x7bc8('0x38')]);if(_0x2299e7[_0x7bc8('0x39')]){delete _0x2299e7[_0x7bc8('0x39')];}_0x2acc65[_0x7bc8('0x2b')](_0x16b5eb)[_0x7bc8('0x3a')](_0x2299e7);};}exports[_0x7bc8('0x3b')]=function(_0x1ee56d,_0x188721){var _0x10a3a6={},_0x3b1eba={},_0x115a25={'count':0x0,'rows':[]};var _0x22aea0=_[_0x7bc8('0x3c')](db[_0x7bc8('0x3d')][_0x7bc8('0x3e')],function(_0x44ac29){return{'name':_0x44ac29['fieldName'],'type':_0x44ac29['type'][_0x7bc8('0x3f')]};});_0x3b1eba[_0x7bc8('0x40')]=_[_0x7bc8('0x3c')](_0x22aea0,_0x7bc8('0x39'));_0x3b1eba[_0x7bc8('0x41')]=_['keys'](_0x1ee56d[_0x7bc8('0x41')]);_0x3b1eba[_0x7bc8('0x42')]=_[_0x7bc8('0x43')](_0x3b1eba[_0x7bc8('0x40')],_0x3b1eba[_0x7bc8('0x41')]);_0x10a3a6[_0x7bc8('0x44')]=_[_0x7bc8('0x43')](_0x3b1eba['model'],qs['fields'](_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x45')]));_0x10a3a6[_0x7bc8('0x44')]=_0x10a3a6['attributes'][_0x7bc8('0x46')]?_0x10a3a6[_0x7bc8('0x44')]:_0x3b1eba['model'];if(!_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x47')](_0x7bc8('0x48'))){_0x10a3a6[_0x7bc8('0x30')]=qs[_0x7bc8('0x30')](_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x30')]);_0x10a3a6['offset']=qs[_0x7bc8('0x2e')](_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x2e')]);}_0x10a3a6[_0x7bc8('0x49')]=qs[_0x7bc8('0x4a')](_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x4a')]);_0x10a3a6[_0x7bc8('0x4b')]=qs[_0x7bc8('0x42')](_[_0x7bc8('0x4c')](_0x1ee56d[_0x7bc8('0x41')],_0x3b1eba[_0x7bc8('0x42')]),_0x22aea0);if(_0x1ee56d['query'][_0x7bc8('0x4d')]){_0x10a3a6[_0x7bc8('0x4b')]=_['merge'](_0x10a3a6['where'],{'$or':_[_0x7bc8('0x3c')](_0x22aea0,function(_0x3fca68){if(_0x3fca68[_0x7bc8('0x4e')]!==_0x7bc8('0x4f')){var _0x3bac17={};_0x3bac17[_0x3fca68[_0x7bc8('0x39')]]={'$like':'%'+_0x1ee56d[_0x7bc8('0x41')][_0x7bc8('0x4d')]+'%'};return _0x3bac17;}})});}_0x10a3a6=_[_0x7bc8('0x50')]({},_0x10a3a6,_0x1ee56d[_0x7bc8('0x51')]);var _0x536357={'where':_0x10a3a6[_0x7bc8('0x4b')]};return db[_0x7bc8('0x3d')]['count'](_0x536357)[_0x7bc8('0x21')](function(_0x467ebe){_0x115a25[_0x7bc8('0x31')]=_0x467ebe;if(_0x1ee56d['query'][_0x7bc8('0x52')]){_0x10a3a6[_0x7bc8('0x53')]=[{'all':!![]}];}return db[_0x7bc8('0x3d')][_0x7bc8('0x54')](_0x10a3a6);})[_0x7bc8('0x21')](function(_0x4bb673){_0x115a25[_0x7bc8('0x55')]=_0x4bb673;return _0x115a25;})[_0x7bc8('0x21')](respondWithFilteredResult(_0x188721,_0x10a3a6))[_0x7bc8('0x56')](handleError(_0x188721,null));};exports['show']=function(_0x52d093,_0x8fbe67){var _0x314af0={'raw':!![],'where':{'id':_0x52d093[_0x7bc8('0x57')]['id']}},_0x356789={};_0x356789[_0x7bc8('0x40')]=_['keys'](db[_0x7bc8('0x3d')][_0x7bc8('0x3e')]);_0x356789[_0x7bc8('0x41')]=_[_0x7bc8('0x58')](_0x52d093[_0x7bc8('0x41')]);_0x356789[_0x7bc8('0x42')]=_['intersection'](_0x356789['model'],_0x356789['query']);_0x314af0[_0x7bc8('0x44')]=_[_0x7bc8('0x43')](_0x356789[_0x7bc8('0x40')],qs[_0x7bc8('0x45')](_0x52d093['query'][_0x7bc8('0x45')]));_0x314af0[_0x7bc8('0x44')]=_0x314af0[_0x7bc8('0x44')][_0x7bc8('0x46')]?_0x314af0[_0x7bc8('0x44')]:_0x356789[_0x7bc8('0x40')];if(_0x52d093[_0x7bc8('0x41')][_0x7bc8('0x52')]){_0x314af0[_0x7bc8('0x53')]=[{'all':!![]}];}_0x314af0=_[_0x7bc8('0x50')]({},_0x314af0,_0x52d093[_0x7bc8('0x51')]);return db[_0x7bc8('0x3d')]['find'](_0x314af0)[_0x7bc8('0x21')](handleEntityNotFound(_0x8fbe67,null))[_0x7bc8('0x21')](respondWithResult(_0x8fbe67,null))['catch'](handleError(_0x8fbe67,null));};exports['create']=function(_0x4c7166,_0x22e82f){return db[_0x7bc8('0x3d')][_0x7bc8('0x59')](_0x4c7166[_0x7bc8('0x5a')],{})[_0x7bc8('0x21')](respondWithResult(_0x22e82f,0xc9))[_0x7bc8('0x56')](handleError(_0x22e82f,null));};exports[_0x7bc8('0x35')]=function(_0x3a63a3,_0x1bbff3){if(_0x3a63a3[_0x7bc8('0x5a')]['id']){delete _0x3a63a3[_0x7bc8('0x5a')]['id'];}return db['SmsMessage'][_0x7bc8('0x5b')]({'where':{'id':_0x3a63a3[_0x7bc8('0x57')]['id']}})['then'](handleEntityNotFound(_0x1bbff3,null))[_0x7bc8('0x21')](saveUpdates(_0x3a63a3['body'],null))[_0x7bc8('0x21')](respondWithResult(_0x1bbff3,null))[_0x7bc8('0x56')](handleError(_0x1bbff3,null));};exports[_0x7bc8('0x36')]=function(_0x54511c,_0x3ddb75){return db[_0x7bc8('0x3d')][_0x7bc8('0x5b')]({'where':{'id':_0x54511c[_0x7bc8('0x57')]['id']}})[_0x7bc8('0x21')](handleEntityNotFound(_0x3ddb75,null))['then'](removeEntity(_0x3ddb75,null))[_0x7bc8('0x56')](handleError(_0x3ddb75,null));};exports[_0x7bc8('0x5c')]=function(_0x50cc22,_0x1fb856){return db[_0x7bc8('0x3d')][_0x7bc8('0x5c')]()['then'](respondWithResult(_0x1fb856,null))['catch'](handleError(_0x1fb856,null));};var interaction_log=require(_0x7bc8('0x14'))(_0x7bc8('0x5d'));exports[_0x7bc8('0x5e')]=function(_0x18c1ff,_0x5f51ef,_0x1df276){var _0xc7d5f6={'agent':{},'channel':_0x7bc8('0x5f')};if(_0x18c1ff[_0x7bc8('0x5a')]['id']){delete _0x18c1ff[_0x7bc8('0x5a')]['id'];}_0x18c1ff['body'][_0x7bc8('0x60')]=!![];_0x18c1ff[_0x7bc8('0x5a')][_0x7bc8('0x61')]=moment()['format'](_0x7bc8('0x62'));_0x18c1ff[_0x7bc8('0x5a')]['UserId']=_0x18c1ff[_0x7bc8('0x5a')][_0x7bc8('0x63')]||_0x18c1ff['user']['id'];_0xc7d5f6['agent']['id']=_0x18c1ff[_0x7bc8('0x5a')]['UserId'];return db['SmsMessage'][_0x7bc8('0x5b')]({'where':{'id':_0x18c1ff[_0x7bc8('0x57')]['id'],'UserId':null}})[_0x7bc8('0x21')](handleEntityNotFound(_0x5f51ef,null))[_0x7bc8('0x21')](saveUpdates(_0x18c1ff['body'],null))[_0x7bc8('0x21')](function(_0x2626c9){if(_0x2626c9){_0xc7d5f6['message']=_0x2626c9[_0x7bc8('0x64')]({'plain':!![]});return db[_0x7bc8('0x65')]['find']({'where':{'id':_0x2626c9['SmsInteractionId']}});}return null;})[_0x7bc8('0x21')](handleEntityNotFound(_0x5f51ef,null))[_0x7bc8('0x21')](function(_0x562433){if(_0x562433){return _0x562433[_0x7bc8('0x35')]({'UserId':_0x18c1ff[_0x7bc8('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x562433[_0x7bc8('0x66')])?moment()[_0x7bc8('0x67')](_0x7bc8('0x62')):undefined});}return null;})[_0x7bc8('0x21')](function(_0x267de7){if(_0x267de7){_0xc7d5f6[_0x7bc8('0x68')]=_0x267de7['get']({'plain':!![]});interaction_log[_0x7bc8('0x22')](_0x7bc8('0x69'),_0x18c1ff['user']['id'],_0x18c1ff['user'][_0x7bc8('0x39')],_0x18c1ff[_0x7bc8('0x6a')][_0x7bc8('0x6b')],_0xc7d5f6[_0x7bc8('0x68')]['id'],_0x18c1ff['body']?JSON[_0x7bc8('0x6c')](_0x18c1ff[_0x7bc8('0x5a')]):_0x7bc8('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x7bc8('0x6e'),_0xc7d5f6);}return null;})[_0x7bc8('0x21')](function(_0x4fcddf){var _0x5a3ad0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4fcddf[_0x7bc8('0x29')]['ContactId'];return db[_0x7bc8('0x6f')]['query'](_0x5a3ad0,{'type':db[_0x7bc8('0x70')][_0x7bc8('0x71')][_0x7bc8('0x72')],'raw':!![]})[_0x7bc8('0x21')](function(_0x3847e8){return _0x3847e8;});})[_0x7bc8('0x21')](function(_0x5a38d5){if(_0x5a38d5){_0xc7d5f6[_0x7bc8('0x29')][_0x7bc8('0x73')]=_0x5a38d5[0x0];if(!_0x18c1ff[_0x7bc8('0x5a')]['UserId'])return;return db[_0x7bc8('0x74')][_0x7bc8('0x5b')]({'where':{'id':_0x18c1ff[_0x7bc8('0x5a')][_0x7bc8('0x63')],'role':_0x7bc8('0x75')},'attributes':['id',_0x7bc8('0x39'),_0x7bc8('0x76'),_0x7bc8('0x77'),_0x7bc8('0x78')],'raw':!![]});}return null;})['then'](function(_0x55a36e){if(!_0x55a36e)return null;_0xc7d5f6[_0x7bc8('0x29')]['agent']=_0x55a36e;return _0xc7d5f6;})[_0x7bc8('0x21')](function(_0x1c290f){if(_0x1c290f){if(_0x18c1ff[_0x7bc8('0x5a')][_0x7bc8('0x79')]){_0xc7d5f6[_0x7bc8('0x29')][_0x7bc8('0x7a')]=util[_0x7bc8('0x67')]('SIP/%s',_0x18c1ff[_0x7bc8('0x6a')][_0x7bc8('0x39')]);_0xc7d5f6[_0x7bc8('0x29')][_0x7bc8('0x7b')]=_0xc7d5f6[_0x7bc8('0x7b')];_0xc7d5f6[_0x7bc8('0x29')]['motionChannel']=_0xc7d5f6[_0x7bc8('0x7b')];_0xc7d5f6[_0x7bc8('0x29')][_0x7bc8('0x7c')]='accept';return respondWithRpcPromise(_0x7bc8('0x7d'),_0x7bc8('0x7d'),{'event':_0x7bc8('0x7e'),'message':_0xc7d5f6[_0x7bc8('0x29')]},client9002)[_0x7bc8('0x21')](function(){return _0xc7d5f6;});}return _0xc7d5f6;}return null;})[_0x7bc8('0x21')](respondWithResult(_0x5f51ef,null))['catch'](handleError(_0x5f51ef,null));};var interaction_log=require(_0x7bc8('0x14'))(_0x7bc8('0x5d'));exports[_0x7bc8('0x34')]=function(_0x455011,_0x395334,_0x4a90f8){var _0x226e49={'agent':{},'channel':_0x7bc8('0x5f')};if(_0x455011[_0x7bc8('0x5a')]['id']){delete _0x455011[_0x7bc8('0x5a')]['id'];}_0x455011[_0x7bc8('0x5a')][_0x7bc8('0x63')]=_0x455011[_0x7bc8('0x5a')][_0x7bc8('0x63')]||_0x455011['user']['id'];_0x226e49['agent']['id']=_0x455011[_0x7bc8('0x5a')][_0x7bc8('0x63')];return db[_0x7bc8('0x3d')][_0x7bc8('0x5b')]({'where':{'id':_0x455011['params']['id'],'UserId':null}})[_0x7bc8('0x21')](handleEntityNotFound(_0x395334,null))[_0x7bc8('0x21')](function(_0x58ecc7){if(_0x58ecc7){_0x226e49[_0x7bc8('0x29')]=_0x58ecc7[_0x7bc8('0x64')]({'plain':!![]});return db[_0x7bc8('0x65')][_0x7bc8('0x5b')]({'where':{'id':_0x58ecc7[_0x7bc8('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x395334,null))[_0x7bc8('0x21')](function(_0x3b4bbe){if(_0x3b4bbe){_0x226e49[_0x7bc8('0x68')]=_0x3b4bbe[_0x7bc8('0x64')]({'plain':!![]});interaction_log[_0x7bc8('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x455011[_0x7bc8('0x6a')]['id'],_0x455011[_0x7bc8('0x6a')][_0x7bc8('0x39')],_0x455011[_0x7bc8('0x6a')][_0x7bc8('0x6b')],_0x226e49[_0x7bc8('0x68')]['id'],_0x455011[_0x7bc8('0x5a')]?JSON['stringify'](_0x455011[_0x7bc8('0x5a')]):_0x7bc8('0x6d'));return respondWithRpcPromise('RejectMessage',_0x7bc8('0x80'),_0x226e49);}return null;})[_0x7bc8('0x21')](function(_0x132f4f){var _0x1c8ba6=_0x7bc8('0x81')+_0x132f4f[_0x7bc8('0x29')]['ContactId'];return db[_0x7bc8('0x6f')]['query'](_0x1c8ba6,{'type':db['Sequelize']['QueryTypes'][_0x7bc8('0x72')],'raw':!![]})['then'](function(_0x92f89a){return _0x92f89a;});})['then'](function(_0xcfbd34){if(_0xcfbd34){_0x226e49[_0x7bc8('0x29')][_0x7bc8('0x73')]=_0xcfbd34[0x0];if(!_0x455011[_0x7bc8('0x5a')][_0x7bc8('0x63')])return;return db['User'][_0x7bc8('0x5b')]({'where':{'id':_0x455011['body'][_0x7bc8('0x63')],'role':_0x7bc8('0x75')},'attributes':['id',_0x7bc8('0x39'),_0x7bc8('0x76'),_0x7bc8('0x77'),_0x7bc8('0x78')],'raw':!![]});}return null;})[_0x7bc8('0x21')](function(_0x6a2bc9){if(!_0x6a2bc9)return null;_0x226e49[_0x7bc8('0x29')][_0x7bc8('0x75')]=_0x6a2bc9;return _0x226e49;})[_0x7bc8('0x21')](function(_0x23e23b){if(_0x23e23b){_0x23e23b[_0x7bc8('0x29')][_0x7bc8('0x7a')]=util[_0x7bc8('0x67')](_0x7bc8('0x82'),_0x455011[_0x7bc8('0x6a')][_0x7bc8('0x39')]);_0x23e23b[_0x7bc8('0x29')][_0x7bc8('0x7b')]=_0x226e49['channel'];_0x23e23b[_0x7bc8('0x29')][_0x7bc8('0x83')]=_0x226e49[_0x7bc8('0x7b')];_0x23e23b[_0x7bc8('0x29')][_0x7bc8('0x7c')]=_0x7bc8('0x34');respondWithRpcPromise(_0x7bc8('0x7d'),_0x7bc8('0x7d'),{'event':'rejectmessage','message':_0x23e23b[_0x7bc8('0x29')]},client9002);return _0x226e49;}return null;})[_0x7bc8('0x21')](respondWithResult(_0x395334,null))[_0x7bc8('0x56')](handleError(_0x395334,null));};exports['status']=function(_0x16b1f8,_0x57866d,_0x3ec2a5){if(_0x16b1f8[_0x7bc8('0x5a')]['id']){delete _0x16b1f8['body']['id'];}var _0x355827;return db[_0x7bc8('0x3d')][_0x7bc8('0x5b')]({'where':{'id':_0x16b1f8[_0x7bc8('0x57')]['id']}})[_0x7bc8('0x21')](handleEntityNotFound(_0x57866d,null))['then'](function(_0x5140b6){if(_0x5140b6){_0x355827=_0x5140b6;return db['SmsAccount'][_0x7bc8('0x5b')]({'where':{'id':_0x5140b6[_0x7bc8('0x84')]}});}})[_0x7bc8('0x21')](handleEntityNotFound(_0x57866d,null))[_0x7bc8('0x21')](function(_0x25d49e){if(_0x25d49e){logger[_0x7bc8('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bc8('0x2b'),_0x7bc8('0x85'),_0x25d49e[_0x7bc8('0x4e')],util[_0x7bc8('0x86')](_0x16b1f8[_0x7bc8('0x5a')],{'showHidden':![],'depth':null}));switch(_0x25d49e[_0x7bc8('0x4e')]){case _0x7bc8('0x87'):if(_0x16b1f8[_0x7bc8('0x5a')][_0x7bc8('0x88')]&&_0x16b1f8[_0x7bc8('0x5a')][_0x7bc8('0x88')]===_0x355827['messageId']){return _0x355827[_0x7bc8('0x35')]({'read':!![]});}else{logger[_0x7bc8('0x27')](_0x7bc8('0x89'),_0x7bc8('0x2b'),_0x7bc8('0x87'),util[_0x7bc8('0x86')](_0x16b1f8[_0x7bc8('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x16b1f8[_0x7bc8('0x5a')]['MessageUUID']&&_0x16b1f8['body'][_0x7bc8('0x8a')]===_0x355827['messageId']&&_[_0x7bc8('0x8b')]([_0x7bc8('0x8c'),_0x7bc8('0x8d')],_0x16b1f8[_0x7bc8('0x5a')][_0x7bc8('0x8e')])>=0x0){return _0x355827[_0x7bc8('0x35')]({'read':!![]});}else{logger[_0x7bc8('0x27')](_0x7bc8('0x89'),_0x7bc8('0x2b'),_0x7bc8('0x8f'),util[_0x7bc8('0x86')](_0x16b1f8[_0x7bc8('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7bc8('0x90'):var _0x37aee9=_0x16b1f8[_0x7bc8('0x5a')]['results'][0x0];if(_0x37aee9[_0x7bc8('0x2b')][_0x7bc8('0x91')]===_0x7bc8('0x92')){return _0x355827[_0x7bc8('0x35')]({'read':!![]});}else{logger[_0x7bc8('0x27')](_0x7bc8('0x89'),_0x7bc8('0x2b'),_0x7bc8('0x90'),util[_0x7bc8('0x86')](_0x16b1f8[_0x7bc8('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x355827;}})[_0x7bc8('0x21')](respondWithResult(_0x57866d,null))[_0x7bc8('0x56')](handleError(_0x57866d,null));}; \ No newline at end of file +var _0xd0ee=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','params','find','create','body','describe','../../config/logger','sms-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','format','SIP/%s','channel','event','accept','EventManager','acceptmessage','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','sequelize','interface','motionChannel','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','groupName','infobip','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xd0ee,0x19a));var _0xed0e=function(_0x14551d,_0x350b95){_0x14551d=_0x14551d-0x0;var _0x2b7055=_0xd0ee[_0x14551d];return _0x2b7055;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed0e('0x1'));var rp=require(_0xed0e('0x2'));var moment=require('moment');var BPromise=require(_0xed0e('0x3'));var Mustache=require(_0xed0e('0x4'));var util=require('util');var path=require(_0xed0e('0x5'));var sox=require(_0xed0e('0x6'));var csv=require(_0xed0e('0x7'));var ejs=require(_0xed0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xed0e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xed0e('0xa'));var toCsv=require(_0xed0e('0x7'));var querystring=require('querystring');var Papa=require(_0xed0e('0xb'));var Redis=require(_0xed0e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xed0e('0xd'));var as=require(_0xed0e('0xe'));var hardwareService=require(_0xed0e('0xf'));var logger=require('../../config/logger')(_0xed0e('0x10'));var utils=require(_0xed0e('0x11'));var config=require(_0xed0e('0x12'));var licenseUtil=require(_0xed0e('0x13'));var db=require(_0xed0e('0x14'))['db'];config['redis']=_[_0xed0e('0x15')](config[_0xed0e('0x16')],{'host':_0xed0e('0x17'),'port':0x18eb});var socket=require(_0xed0e('0x18'))(new Redis(config[_0xed0e('0x16')]));require('./smsMessage.socket')[_0xed0e('0x19')](socket);var jayson=require(_0xed0e('0x1a'));var client=jayson[_0xed0e('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xed0e('0x1b')][_0xed0e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x223598,_0x40da0e,_0x6932a7,_0x337dcd){return new BPromise(function(_0x5b6074,_0x7a91c){var _0x21b5f7=_0x337dcd||client;return _0x21b5f7[_0xed0e('0x1d')](_0x223598,_0x6932a7)[_0xed0e('0x1e')](function(_0x114e02){logger[_0xed0e('0x1f')](_0xed0e('0x20'),_0x40da0e,_0xed0e('0x21'));logger[_0xed0e('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x40da0e,_0xed0e('0x21'),JSON[_0xed0e('0x23')](_0x114e02));if(_0x114e02['error']){if(_0x114e02['error'][_0xed0e('0x24')]===0x1f4){logger[_0xed0e('0x25')]('SmsMessage,\x20%s,\x20%s',_0x40da0e,_0x114e02[_0xed0e('0x25')][_0xed0e('0x26')]);return _0x7a91c(_0x114e02[_0xed0e('0x25')]['message']);}logger[_0xed0e('0x25')]('SmsMessage,\x20%s,\x20%s',_0x40da0e,_0x114e02[_0xed0e('0x25')][_0xed0e('0x26')]);return _0x5b6074(_0x114e02[_0xed0e('0x25')][_0xed0e('0x26')]);}else{logger['info'](_0xed0e('0x20'),_0x40da0e,'request\x20sent');_0x5b6074(_0x114e02[_0xed0e('0x27')]['message']);}})[_0xed0e('0x28')](function(_0x358fe1){logger['error'](_0xed0e('0x20'),_0x40da0e,_0x358fe1);_0x7a91c(_0x358fe1);});});}function respondWithStatusCode(_0x84458a,_0x5b202e){_0x5b202e=_0x5b202e||0xcc;return function(_0x41a4c1){if(_0x41a4c1){return _0x84458a['sendStatus'](_0x5b202e);}return _0x84458a[_0xed0e('0x29')](_0x5b202e)['end']();};}function respondWithResult(_0x2cf5ac,_0x2d2385){_0x2d2385=_0x2d2385||0xc8;return function(_0x1407de){if(_0x1407de){return _0x2cf5ac[_0xed0e('0x29')](_0x2d2385)[_0xed0e('0x2a')](_0x1407de);}};}function respondWithFilteredResult(_0x4a3cff,_0x4c9a95){return function(_0x2ea96b){if(_0x2ea96b){var _0x5706d5=typeof _0x4c9a95[_0xed0e('0x2b')]===_0xed0e('0x2c')&&typeof _0x4c9a95['limit']===_0xed0e('0x2c');var _0x2c3ef3=_0x2ea96b[_0xed0e('0x2d')];var _0x510d50=_0x5706d5?0x0:_0x4c9a95[_0xed0e('0x2b')];var _0x11f463=_0x5706d5?_0x2ea96b[_0xed0e('0x2d')]:_0x4c9a95['offset']+_0x4c9a95['limit'];var _0x4fac2d;if(_0x11f463>=_0x2c3ef3){_0x11f463=_0x2c3ef3;_0x4fac2d=0xc8;}else{_0x4fac2d=0xce;}_0x4a3cff[_0xed0e('0x29')](_0x4fac2d);return _0x4a3cff[_0xed0e('0x2e')](_0xed0e('0x2f'),_0x510d50+'-'+_0x11f463+'/'+_0x2c3ef3)[_0xed0e('0x2a')](_0x2ea96b);}return null;};}function patchUpdates(_0x3f59ca){return function(_0x53e5bc){try{jsonpatch[_0xed0e('0x30')](_0x53e5bc,_0x3f59ca,!![]);}catch(_0x220175){return BPromise[_0xed0e('0x31')](_0x220175);}return _0x53e5bc[_0xed0e('0x32')]();};}function saveUpdates(_0x3e23b6,_0x486f88){return function(_0x5f2c07){if(_0x5f2c07){return _0x5f2c07[_0xed0e('0x33')](_0x3e23b6)[_0xed0e('0x1e')](function(_0x13e710){return _0x13e710;});}return null;};}function removeEntity(_0x42f984,_0x399daa){return function(_0x58a1ec){if(_0x58a1ec){return _0x58a1ec[_0xed0e('0x34')]()['then'](function(){_0x42f984['status'](0xcc)[_0xed0e('0x35')]();});}};}function handleEntityNotFound(_0x1b34f5,_0x29edb9){return function(_0x4b6f20){if(!_0x4b6f20){_0x1b34f5[_0xed0e('0x36')](0x194);}return _0x4b6f20;};}function handleError(_0x1d3cae,_0x5224f7){_0x5224f7=_0x5224f7||0x1f4;return function(_0x277569){logger[_0xed0e('0x25')](_0x277569[_0xed0e('0x37')]);if(_0x277569[_0xed0e('0x38')]){delete _0x277569[_0xed0e('0x38')];}_0x1d3cae['status'](_0x5224f7)['send'](_0x277569);};}exports[_0xed0e('0x39')]=function(_0x1a4e15,_0x27d159){var _0x1022f6={},_0x4846e1={},_0x3e2150={'count':0x0,'rows':[]};var _0x570623=_[_0xed0e('0x3a')](db[_0xed0e('0x3b')][_0xed0e('0x3c')],function(_0x2b771d){return{'name':_0x2b771d[_0xed0e('0x3d')],'type':_0x2b771d[_0xed0e('0x3e')]['key']};});_0x4846e1[_0xed0e('0x3f')]=_[_0xed0e('0x3a')](_0x570623,_0xed0e('0x38'));_0x4846e1['query']=_[_0xed0e('0x40')](_0x1a4e15[_0xed0e('0x41')]);_0x4846e1[_0xed0e('0x42')]=_[_0xed0e('0x43')](_0x4846e1[_0xed0e('0x3f')],_0x4846e1[_0xed0e('0x41')]);_0x1022f6[_0xed0e('0x44')]=_[_0xed0e('0x43')](_0x4846e1[_0xed0e('0x3f')],qs[_0xed0e('0x45')](_0x1a4e15[_0xed0e('0x41')]['fields']));_0x1022f6['attributes']=_0x1022f6[_0xed0e('0x44')][_0xed0e('0x46')]?_0x1022f6[_0xed0e('0x44')]:_0x4846e1[_0xed0e('0x3f')];if(!_0x1a4e15[_0xed0e('0x41')][_0xed0e('0x47')](_0xed0e('0x48'))){_0x1022f6['limit']=qs['limit'](_0x1a4e15['query'][_0xed0e('0x49')]);_0x1022f6[_0xed0e('0x2b')]=qs[_0xed0e('0x2b')](_0x1a4e15['query'][_0xed0e('0x2b')]);}_0x1022f6[_0xed0e('0x4a')]=qs['sort'](_0x1a4e15[_0xed0e('0x41')]['sort']);_0x1022f6[_0xed0e('0x4b')]=qs[_0xed0e('0x42')](_[_0xed0e('0x4c')](_0x1a4e15['query'],_0x4846e1['filters']),_0x570623);if(_0x1a4e15[_0xed0e('0x41')]['filter']){_0x1022f6['where']=_[_0xed0e('0x4d')](_0x1022f6[_0xed0e('0x4b')],{'$or':_[_0xed0e('0x3a')](_0x570623,function(_0x179873){if(_0x179873[_0xed0e('0x3e')]!==_0xed0e('0x4e')){var _0x86a781={};_0x86a781[_0x179873[_0xed0e('0x38')]]={'$like':'%'+_0x1a4e15[_0xed0e('0x41')][_0xed0e('0x4f')]+'%'};return _0x86a781;}})});}_0x1022f6=_[_0xed0e('0x4d')]({},_0x1022f6,_0x1a4e15[_0xed0e('0x50')]);var _0x5a04ba={'where':_0x1022f6['where']};return db[_0xed0e('0x3b')][_0xed0e('0x2d')](_0x5a04ba)[_0xed0e('0x1e')](function(_0x2fc7e3){_0x3e2150['count']=_0x2fc7e3;if(_0x1a4e15[_0xed0e('0x41')][_0xed0e('0x51')]){_0x1022f6[_0xed0e('0x52')]=[{'all':!![]}];}return db[_0xed0e('0x3b')]['findAll'](_0x1022f6);})[_0xed0e('0x1e')](function(_0x7e7878){_0x3e2150['rows']=_0x7e7878;return _0x3e2150;})[_0xed0e('0x1e')](respondWithFilteredResult(_0x27d159,_0x1022f6))[_0xed0e('0x28')](handleError(_0x27d159,null));};exports['show']=function(_0xf5dc20,_0x5cc833){var _0x34285f={'raw':!![],'where':{'id':_0xf5dc20[_0xed0e('0x53')]['id']}},_0x4542f3={};_0x4542f3[_0xed0e('0x3f')]=_[_0xed0e('0x40')](db[_0xed0e('0x3b')]['rawAttributes']);_0x4542f3[_0xed0e('0x41')]=_['keys'](_0xf5dc20[_0xed0e('0x41')]);_0x4542f3[_0xed0e('0x42')]=_[_0xed0e('0x43')](_0x4542f3[_0xed0e('0x3f')],_0x4542f3[_0xed0e('0x41')]);_0x34285f[_0xed0e('0x44')]=_[_0xed0e('0x43')](_0x4542f3[_0xed0e('0x3f')],qs[_0xed0e('0x45')](_0xf5dc20[_0xed0e('0x41')][_0xed0e('0x45')]));_0x34285f[_0xed0e('0x44')]=_0x34285f[_0xed0e('0x44')][_0xed0e('0x46')]?_0x34285f[_0xed0e('0x44')]:_0x4542f3[_0xed0e('0x3f')];if(_0xf5dc20[_0xed0e('0x41')][_0xed0e('0x51')]){_0x34285f[_0xed0e('0x52')]=[{'all':!![]}];}_0x34285f=_[_0xed0e('0x4d')]({},_0x34285f,_0xf5dc20[_0xed0e('0x50')]);return db[_0xed0e('0x3b')][_0xed0e('0x54')](_0x34285f)['then'](handleEntityNotFound(_0x5cc833,null))[_0xed0e('0x1e')](respondWithResult(_0x5cc833,null))[_0xed0e('0x28')](handleError(_0x5cc833,null));};exports[_0xed0e('0x55')]=function(_0x40ca35,_0x35fad0){return db['SmsMessage']['create'](_0x40ca35['body'],{})[_0xed0e('0x1e')](respondWithResult(_0x35fad0,0xc9))['catch'](handleError(_0x35fad0,null));};exports['update']=function(_0x82f089,_0x42545f){if(_0x82f089['body']['id']){delete _0x82f089[_0xed0e('0x56')]['id'];}return db[_0xed0e('0x3b')][_0xed0e('0x54')]({'where':{'id':_0x82f089[_0xed0e('0x53')]['id']}})['then'](handleEntityNotFound(_0x42545f,null))[_0xed0e('0x1e')](saveUpdates(_0x82f089['body'],null))[_0xed0e('0x1e')](respondWithResult(_0x42545f,null))[_0xed0e('0x28')](handleError(_0x42545f,null));};exports['destroy']=function(_0xe0723,_0x4b31e1){return db[_0xed0e('0x3b')]['find']({'where':{'id':_0xe0723[_0xed0e('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b31e1,null))[_0xed0e('0x1e')](removeEntity(_0x4b31e1,null))[_0xed0e('0x28')](handleError(_0x4b31e1,null));};exports[_0xed0e('0x57')]=function(_0x581d55,_0x12eab6){return db[_0xed0e('0x3b')][_0xed0e('0x57')]()[_0xed0e('0x1e')](respondWithResult(_0x12eab6,null))['catch'](handleError(_0x12eab6,null));};var interaction_log=require(_0xed0e('0x58'))(_0xed0e('0x59'));exports['accept']=function(_0x38a326,_0x21b593,_0x490bcd){var _0x106fc7={'agent':{},'channel':'sms'};if(_0x38a326[_0xed0e('0x56')]['id']){delete _0x38a326[_0xed0e('0x56')]['id'];}_0x38a326[_0xed0e('0x56')][_0xed0e('0x5a')]=!![];_0x38a326[_0xed0e('0x56')]['readAt']=moment()['format'](_0xed0e('0x5b'));_0x38a326[_0xed0e('0x56')][_0xed0e('0x5c')]=_0x38a326[_0xed0e('0x56')]['UserId']||_0x38a326['user']['id'];_0x106fc7[_0xed0e('0x5d')]['id']=_0x38a326[_0xed0e('0x56')][_0xed0e('0x5c')];return db['SmsMessage']['find']({'where':{'id':_0x38a326[_0xed0e('0x53')]['id'],'UserId':null}})[_0xed0e('0x1e')](handleEntityNotFound(_0x21b593,null))['then'](saveUpdates(_0x38a326['body'],null))[_0xed0e('0x1e')](function(_0x378664){if(_0x378664){_0x106fc7['message']=_0x378664[_0xed0e('0x5e')]({'plain':!![]});return db[_0xed0e('0x5f')][_0xed0e('0x54')]({'where':{'id':_0x378664['SmsInteractionId']}});}return null;})[_0xed0e('0x1e')](handleEntityNotFound(_0x21b593,null))['then'](function(_0x6fbb35){if(_0x6fbb35){return _0x6fbb35[_0xed0e('0x33')]({'UserId':_0x38a326[_0xed0e('0x56')][_0xed0e('0x5c')],'read1stAt':_[_0xed0e('0x60')](_0x6fbb35[_0xed0e('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xed0e('0x1e')](function(_0x1093fd){if(_0x1093fd){_0x106fc7[_0xed0e('0x62')]=_0x1093fd[_0xed0e('0x5e')]({'plain':!![]});interaction_log['info'](_0xed0e('0x63'),_0x38a326[_0xed0e('0x64')]['id'],_0x38a326[_0xed0e('0x64')][_0xed0e('0x38')],_0x38a326[_0xed0e('0x64')]['role'],_0x106fc7[_0xed0e('0x62')]['id'],_0x38a326[_0xed0e('0x56')]?JSON[_0xed0e('0x23')](_0x38a326['body']):_0xed0e('0x65'));return respondWithRpcPromise(_0xed0e('0x66'),_0xed0e('0x67'),_0x106fc7);}return null;})[_0xed0e('0x1e')](function(_0x369139){var _0x5db6fa=_0xed0e('0x68')+_0x369139[_0xed0e('0x26')]['ContactId'];return db['sequelize'][_0xed0e('0x41')](_0x5db6fa,{'type':db[_0xed0e('0x69')][_0xed0e('0x6a')][_0xed0e('0x6b')],'raw':!![]})[_0xed0e('0x1e')](function(_0x140c1c){return _0x140c1c;});})[_0xed0e('0x1e')](function(_0xb27ad7){if(_0xb27ad7){_0x106fc7['message'][_0xed0e('0x6c')]=_0xb27ad7[0x0];if(!_0x38a326[_0xed0e('0x56')][_0xed0e('0x5c')])return;return db[_0xed0e('0x6d')][_0xed0e('0x54')]({'where':{'id':_0x38a326[_0xed0e('0x56')][_0xed0e('0x5c')],'role':_0xed0e('0x5d')},'attributes':['id',_0xed0e('0x38'),_0xed0e('0x6e'),_0xed0e('0x6f'),_0xed0e('0x70')],'raw':!![]});}return null;})['then'](function(_0x46bdb2){if(!_0x46bdb2)return null;_0x106fc7[_0xed0e('0x26')][_0xed0e('0x5d')]=_0x46bdb2;return _0x106fc7;})[_0xed0e('0x1e')](function(_0x132a4a){if(_0x132a4a){if(_0x38a326[_0xed0e('0x56')][_0xed0e('0x71')]){_0x106fc7[_0xed0e('0x26')]['interface']=util[_0xed0e('0x72')](_0xed0e('0x73'),_0x38a326['user'][_0xed0e('0x38')]);_0x106fc7[_0xed0e('0x26')][_0xed0e('0x74')]=_0x106fc7['channel'];_0x106fc7[_0xed0e('0x26')]['motionChannel']=_0x106fc7['channel'];_0x106fc7[_0xed0e('0x26')][_0xed0e('0x75')]=_0xed0e('0x76');return respondWithRpcPromise(_0xed0e('0x77'),_0xed0e('0x77'),{'event':_0xed0e('0x78'),'message':_0x106fc7[_0xed0e('0x26')]},client9002)[_0xed0e('0x1e')](function(){return _0x106fc7;});}return _0x106fc7;}return null;})[_0xed0e('0x1e')](respondWithResult(_0x21b593,null))[_0xed0e('0x28')](handleError(_0x21b593,null));};var interaction_log=require(_0xed0e('0x58'))('sms-interactions');exports[_0xed0e('0x31')]=function(_0x524a0a,_0x5325ed,_0x844256){var _0x183d20={'agent':{},'channel':_0xed0e('0x79')};if(_0x524a0a[_0xed0e('0x56')]['id']){delete _0x524a0a[_0xed0e('0x56')]['id'];}_0x524a0a[_0xed0e('0x56')][_0xed0e('0x5c')]=_0x524a0a[_0xed0e('0x56')][_0xed0e('0x5c')]||_0x524a0a[_0xed0e('0x64')]['id'];_0x183d20[_0xed0e('0x5d')]['id']=_0x524a0a[_0xed0e('0x56')]['UserId'];return db[_0xed0e('0x3b')][_0xed0e('0x54')]({'where':{'id':_0x524a0a[_0xed0e('0x53')]['id'],'UserId':null}})[_0xed0e('0x1e')](handleEntityNotFound(_0x5325ed,null))[_0xed0e('0x1e')](function(_0x5cda7f){if(_0x5cda7f){_0x183d20[_0xed0e('0x26')]=_0x5cda7f[_0xed0e('0x5e')]({'plain':!![]});return db[_0xed0e('0x5f')]['find']({'where':{'id':_0x5cda7f[_0xed0e('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x5325ed,null))['then'](function(_0x14c0bb){if(_0x14c0bb){_0x183d20['interaction']=_0x14c0bb[_0xed0e('0x5e')]({'plain':!![]});interaction_log['info'](_0xed0e('0x7b'),_0x524a0a['user']['id'],_0x524a0a[_0xed0e('0x64')][_0xed0e('0x38')],_0x524a0a['user'][_0xed0e('0x7c')],_0x183d20[_0xed0e('0x62')]['id'],_0x524a0a[_0xed0e('0x56')]?JSON[_0xed0e('0x23')](_0x524a0a[_0xed0e('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xed0e('0x7d'),_0x183d20);}return null;})[_0xed0e('0x1e')](function(_0x3e787b){var _0x2a6207='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e787b['message'][_0xed0e('0x7e')];return db[_0xed0e('0x7f')][_0xed0e('0x41')](_0x2a6207,{'type':db[_0xed0e('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0xed0e('0x1e')](function(_0x47d330){return _0x47d330;});})[_0xed0e('0x1e')](function(_0x3aeb9e){if(_0x3aeb9e){_0x183d20[_0xed0e('0x26')][_0xed0e('0x6c')]=_0x3aeb9e[0x0];if(!_0x524a0a['body'][_0xed0e('0x5c')])return;return db[_0xed0e('0x6d')][_0xed0e('0x54')]({'where':{'id':_0x524a0a[_0xed0e('0x56')][_0xed0e('0x5c')],'role':'agent'},'attributes':['id','name','fullname',_0xed0e('0x6f'),_0xed0e('0x70')],'raw':!![]});}return null;})[_0xed0e('0x1e')](function(_0x1ec2c9){if(!_0x1ec2c9)return null;_0x183d20[_0xed0e('0x26')]['agent']=_0x1ec2c9;return _0x183d20;})[_0xed0e('0x1e')](function(_0x5b7bb5){if(_0x5b7bb5){_0x5b7bb5[_0xed0e('0x26')][_0xed0e('0x80')]=util[_0xed0e('0x72')](_0xed0e('0x73'),_0x524a0a['user'][_0xed0e('0x38')]);_0x5b7bb5['message'][_0xed0e('0x74')]=_0x183d20['channel'];_0x5b7bb5['message'][_0xed0e('0x81')]=_0x183d20[_0xed0e('0x74')];_0x5b7bb5[_0xed0e('0x26')][_0xed0e('0x75')]=_0xed0e('0x31');respondWithRpcPromise(_0xed0e('0x77'),_0xed0e('0x77'),{'event':'rejectmessage','message':_0x5b7bb5['message']},client9002);return _0x183d20;}return null;})[_0xed0e('0x1e')](respondWithResult(_0x5325ed,null))['catch'](handleError(_0x5325ed,null));};exports[_0xed0e('0x29')]=function(_0x3cdad8,_0x5ca7ad,_0x885e63){if(_0x3cdad8[_0xed0e('0x56')]['id']){delete _0x3cdad8[_0xed0e('0x56')]['id'];}var _0x46c53c;return db[_0xed0e('0x3b')][_0xed0e('0x54')]({'where':{'id':_0x3cdad8['params']['id']}})[_0xed0e('0x1e')](handleEntityNotFound(_0x5ca7ad,null))[_0xed0e('0x1e')](function(_0x13c712){if(_0x13c712){_0x46c53c=_0x13c712;return db['SmsAccount'][_0xed0e('0x54')]({'where':{'id':_0x13c712[_0xed0e('0x82')]}});}})['then'](handleEntityNotFound(_0x5ca7ad,null))[_0xed0e('0x1e')](function(_0x3f8e63){if(_0x3f8e63){logger[_0xed0e('0x22')](_0xed0e('0x83'),'status',_0xed0e('0x84'),_0x3f8e63[_0xed0e('0x3e')],util[_0xed0e('0x85')](_0x3cdad8['body'],{'showHidden':![],'depth':null}));switch(_0x3f8e63[_0xed0e('0x3e')]){case _0xed0e('0x86'):if(_0x3cdad8[_0xed0e('0x56')][_0xed0e('0x87')]&&_0x3cdad8[_0xed0e('0x56')][_0xed0e('0x87')]===_0x46c53c[_0xed0e('0x88')]){return _0x46c53c['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xed0e('0x29'),'twilio',util['inspect'](_0x3cdad8['body'],{'showHidden':![],'depth':null}));}break;case _0xed0e('0x89'):if(_0x3cdad8['body']['MessageUUID']&&_0x3cdad8[_0xed0e('0x56')][_0xed0e('0x8a')]===_0x46c53c[_0xed0e('0x88')]&&_[_0xed0e('0x8b')]([_0xed0e('0x8c'),_0xed0e('0x8d')],_0x3cdad8[_0xed0e('0x56')][_0xed0e('0x8e')])>=0x0){return _0x46c53c[_0xed0e('0x33')]({'read':!![]});}else{logger[_0xed0e('0x25')](_0xed0e('0x8f'),'status',_0xed0e('0x90'),util['inspect'](_0x3cdad8[_0xed0e('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x173533=_0x3cdad8[_0xed0e('0x56')]['results'][0x0];if(_0x173533['status'][_0xed0e('0x91')]==='DELIVERED'){return _0x46c53c[_0xed0e('0x33')]({'read':!![]});}else{logger['error'](_0xed0e('0x8f'),'status',_0xed0e('0x92'),util[_0xed0e('0x85')](_0x3cdad8['body'],{'showHidden':![],'depth':null}));}break;}return _0x46c53c;}})[_0xed0e('0x1e')](respondWithResult(_0x5ca7ad,null))[_0xed0e('0x28')](handleError(_0x5ca7ad,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d5a5791..1008e1a 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 _0xd056=['exports','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd056,0xd9));var _0x6d05=function(_0x7cd229,_0x137c22){_0x7cd229=_0x7cd229-0x0;var _0x709139=_0xd056[_0x7cd229];return _0x709139;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6d05('0x0')](0x0);var events={'afterCreate':_0x6d05('0x1'),'afterUpdate':_0x6d05('0x2'),'afterDestroy':_0x6d05('0x3')};function emitEvent(_0x523bd9){return function(_0x1b6e28,_0x55884d,_0x1d8c10){SmsMessageEvents[_0x6d05('0x4')](_0x523bd9+':'+_0x1b6e28['id'],_0x1b6e28);SmsMessageEvents[_0x6d05('0x4')](_0x523bd9,_0x1b6e28);_0x1d8c10(null);};}for(var e in events){if(events[_0x6d05('0x5')](e)){var event=events[e];SmsMessage[_0x6d05('0x6')](e,emitEvent(event));}}module[_0x6d05('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x2a33=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x402bb0,_0x28212e){var _0x21a649=function(_0x52609e){while(--_0x52609e){_0x402bb0['push'](_0x402bb0['shift']());}};_0x21a649(++_0x28212e);}(_0x2a33,0xaa));var _0x32a3=function(_0x31f404,_0x14894a){_0x31f404=_0x31f404-0x0;var _0x5560f0=_0x2a33[_0x31f404];return _0x5560f0;};'use strict';var EventEmitter=require(_0x32a3('0x0'));var SmsMessage=require(_0x32a3('0x1'))['db'][_0x32a3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x32a3('0x3')](0x0);var events={'afterCreate':_0x32a3('0x4'),'afterUpdate':_0x32a3('0x5'),'afterDestroy':_0x32a3('0x6')};function emitEvent(_0x1a2137){return function(_0x32fef9,_0x20f823,_0x55be49){SmsMessageEvents['emit'](_0x1a2137+':'+_0x32fef9['id'],_0x32fef9);SmsMessageEvents[_0x32a3('0x7')](_0x1a2137,_0x32fef9);_0x55be49(null);};}for(var e in events){if(events[_0x32a3('0x8')](e)){var event=events[e];SmsMessage[_0x32a3('0x9')](e,emitEvent(event));}}module[_0x32a3('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 5cba834..d59835b 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 _0x2c6a=['clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','infobip','Missing\x20parameters:\x20base_url','crypto','login','text','keys','sort','length','apiKey','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','applicationId','toString','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','direction','toLowerCase','secret','isNil','UserId','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','login?username=','username','GET','split','sms','POST','session_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','message_id'];(function(_0x9db74f,_0x1da16a){var _0x538967=function(_0x27c11b){while(--_0x27c11b){_0x9db74f['push'](_0x9db74f['shift']());}};_0x538967(++_0x1da16a);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var logger=require(_0xa2c6('0x2'))(_0xa2c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa2c6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2c6('0x5'));var config=require(_0xa2c6('0x6'));var attributes=require(_0xa2c6('0x7'));module[_0xa2c6('0x8')]=function(_0x569610,_0x5b71b2){return _0x569610[_0xa2c6('0x9')](_0xa2c6('0xa'),attributes,{'tableName':_0xa2c6('0xb'),'paranoid':![],'indexes':[{'name':_0xa2c6('0xc'),'fields':[_0xa2c6('0xc')]},{'name':_0xa2c6('0xd'),'fields':[_0xa2c6('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b1e75,_0x14100c,_0x2637b4){var _0x30269d=_0x569610['models'];var _0x965bb0=_0x2b1e75['get']({'plain':!![]});if(_0x965bb0[_0xa2c6('0xf')][_0xa2c6('0x10')]()==='in'||_0x965bb0[_0xa2c6('0xf')][_0xa2c6('0x10')]()==='out'&&!_0x965bb0[_0xa2c6('0x11')]&&!_[_0xa2c6('0x12')](_0x965bb0[_0xa2c6('0x13')])){_0x30269d['SmsInteraction'][_0xa2c6('0x14')]({'where':{'id':_0x965bb0[_0xa2c6('0x15')]}})[_0xa2c6('0x16')](function(_0x1bc1dc){if(_0x1bc1dc){_0x1bc1dc[_0xa2c6('0x17')]({'lastMsgAt':_0x965bb0['createdAt'],'lastMsgDirection':_0x965bb0[_0xa2c6('0xf')][_0xa2c6('0x10')]()});}})[_0xa2c6('0x18')](function(_0x354dff){console[_0xa2c6('0x19')](_0x354dff);});}if(_0x965bb0[_0xa2c6('0xf')]==='out'&&!_0x965bb0[_0xa2c6('0x11')]){var _0x4d49f8;_0x30269d[_0xa2c6('0x1a')][_0xa2c6('0x1b')]({'where':{'id':_0x965bb0[_0xa2c6('0x1c')]},'raw':!![]})[_0xa2c6('0x16')](function(_0x372ce3){_0x4d49f8=_0x372ce3;if(_0x4d49f8&&_0x4d49f8[_0xa2c6('0x1d')]){switch(_0x4d49f8[_0xa2c6('0x1d')]){case _0xa2c6('0x1e'):var _0x4c02cc=require(_0xa2c6('0x1e'));if(_0x4d49f8[_0xa2c6('0x1f')]&&_0x4d49f8[_0xa2c6('0x20')]&&_0x4d49f8[_0xa2c6('0x21')]){var _0x2a2fc9=new _0x4c02cc(_0x4d49f8['accountSid'],_0x4d49f8[_0xa2c6('0x20')]);_0x2a2fc9[_0xa2c6('0x22')]['create']({'body':_0x965bb0[_0xa2c6('0xe')],'to':_0x965bb0['phone'],'from':_0x4d49f8[_0xa2c6('0x21')],'statusCallback':_0x4d49f8[_0xa2c6('0x23')]+'/api/sms/messages/'+_0x965bb0['id']+_0xa2c6('0x24')+_0x4d49f8['token']})[_0xa2c6('0x16')](function(_0x168de7){if(_0x168de7[_0xa2c6('0x25')]){return _0x2b1e75[_0xa2c6('0x17')]({'messageId':_0x168de7[_0xa2c6('0x25')]});}})['catch'](function(_0x2ed646){logger['error'](_0xa2c6('0x26'),_0xa2c6('0x27'),'twilio',util[_0xa2c6('0x28')](_0x2ed646,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x1e'),_0xa2c6('0x29'));}break;case _0xa2c6('0x2a'):var _0x3892ca=_0xa2c6('0x2b');if(_0x4d49f8['username']&&_0x4d49f8[_0xa2c6('0x2c')]){var _0x46b082={'recipient':[_0x965bb0[_0xa2c6('0x21')]],'message':_0x965bb0[_0xa2c6('0xe')],'message_type':_0x4d49f8['smsMethod']};if(_0x4d49f8['smsMethod']&&_0x4d49f8['smsMethod']!=='SI'){_0x46b082['sender']=_0x4d49f8[_0xa2c6('0x21')];}var _0x323e04={'url':_0x3892ca+_0xa2c6('0x2d')+_0x4d49f8[_0xa2c6('0x2e')]+'&password='+_0x4d49f8[_0xa2c6('0x2c')],'method':_0xa2c6('0x2f')};rp(_0x323e04)[_0xa2c6('0x16')](function(_0x10e1d6){var _0x2c4996=_0x10e1d6[_0xa2c6('0x30')](';');var _0xea9d2d={'user_key':_0x2c4996[0x0],'session_key':_0x2c4996[0x1]};_0x323e04={'url':_0x3892ca+_0xa2c6('0x31'),'method':_0xa2c6('0x32'),'headers':{'user_key':_0xea9d2d['user_key'],'Session_key':_0xea9d2d[_0xa2c6('0x33')]},'json':!![],'body':_0x46b082};return rp(_0x323e04);})[_0xa2c6('0x16')](function(_0x1b8f5b){if(_0x1b8f5b['total_sent']>=0x1){var _0x3f8bd3={'messageId':_0x1b8f5b[_0xa2c6('0x34')]};if(_0x4d49f8['smsMethod']!=='GP'||!_0x4d49f8['deliveryReport']){_0x3f8bd3[_0xa2c6('0x35')]=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0x3f8bd3);}else{return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),'afterCreate',_0xa2c6('0x2a'),util[_0xa2c6('0x28')](_0x1b8f5b,{'showHidden':![],'depth':null}));}})[_0xa2c6('0x18')](function(_0x1bcabf){return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'skebby',util[_0xa2c6('0x28')](_0x1bcabf,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x2a'),_0xa2c6('0x36'));}break;case _0xa2c6('0x37'):if(_0x4d49f8['authToken']){var _0x56a94b={'recipient':_0x965bb0[_0xa2c6('0x21')],'message':_0x965bb0['body'],'sender':_0x4d49f8[_0xa2c6('0x38')]||_0x4d49f8['phone'],'authorization':_0x4d49f8[_0xa2c6('0x20')]};var _0x14100c={'method':'POST','uri':_0xa2c6('0x39'),'body':_0x56a94b,'json':!![]};rp(_0x14100c)[_0xa2c6('0x16')](function(_0x5a7db0){var _0x228fbd={'messageId':_0x5a7db0[_0xa2c6('0x3a')]};if(!_0x4d49f8[_0xa2c6('0x3b')]){_0x228fbd['read']=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0x228fbd);})['catch'](function(_0x5b0720){logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x37'),util[_0xa2c6('0x28')](_0x5b0720,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa2c6('0x37'),_0xa2c6('0x3c'));}break;case'clicksend':if(_0x4d49f8[_0xa2c6('0x2e')]&&_0x4d49f8['password']){var _0x56a94b={'messages':[{'source':'xCALLY\x20Motion','to':_0x965bb0[_0xa2c6('0x21')],'body':_0x965bb0[_0xa2c6('0xe')],'from':_0x4d49f8['senderString']||_0x4d49f8[_0xa2c6('0x21')]}]};var _0x35ceef=util[_0xa2c6('0x3d')](_0xa2c6('0x3e'),_0x4d49f8['username'],_0x4d49f8[_0xa2c6('0x2c')]);var _0x14100c={'method':_0xa2c6('0x32'),'uri':_0xa2c6('0x3f'),'body':_0x56a94b,'headers':{'Authorization':util[_0xa2c6('0x3d')]('Basic\x20%s',new Buffer(_0x35ceef)['toString'](_0xa2c6('0x40')))},'json':!![]};rp(_0x14100c)[_0xa2c6('0x16')](function(_0x28da23){if(_0x28da23[_0xa2c6('0x41')]>=0xc8&&_0x28da23[_0xa2c6('0x41')]<=0xce){if(_0x28da23[_0xa2c6('0x42')]&&_0x28da23[_0xa2c6('0x42')][_0xa2c6('0x43')]>0x0){var _0x413c2c=_['head'](_0x28da23['data'][_0xa2c6('0x22')]);var _0x4b5fc5={'messageId':_0x413c2c[_0xa2c6('0x44')]};if(!_0x4d49f8['deliveryReport']){_0x4b5fc5[_0xa2c6('0x35')]=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0x4b5fc5);}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x45'),util['inspect'](_0x28da23,{'showHidden':![],'depth':null}));}}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),'afterCreate','clickSend',util[_0xa2c6('0x28')](_0x28da23,{'showHidden':![],'depth':null}));}})['catch'](function(_0x723a25){logger[_0xa2c6('0x19')](_0xa2c6('0x26'),'afterCreate',_0xa2c6('0x45'),util[_0xa2c6('0x28')](_0x723a25,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xa2c6('0x46'):if(_0x4d49f8[_0xa2c6('0x47')]&&_0x4d49f8['authToken']){var _0x56a94b={'dst':_0x965bb0['phone'],'text':_0x965bb0[_0xa2c6('0xe')],'src':_0x4d49f8[_0xa2c6('0x38')]||_0x4d49f8['phone'],'url':_0x4d49f8[_0xa2c6('0x23')]+'/api/sms/messages/'+_0x965bb0['id']+_0xa2c6('0x24')+_0x4d49f8[_0xa2c6('0x48')]};var _0x35ceef=util[_0xa2c6('0x3d')](_0xa2c6('0x3e'),_0x4d49f8[_0xa2c6('0x47')],_0x4d49f8[_0xa2c6('0x20')]);var _0x14100c={'method':_0xa2c6('0x32'),'uri':util[_0xa2c6('0x3d')](_0xa2c6('0x49'),_0x4d49f8[_0xa2c6('0x47')]),'body':_0x56a94b,'headers':{'Authorization':util['format'](_0xa2c6('0x4a'),new Buffer(_0x35ceef)['toString'](_0xa2c6('0x40')))},'json':!![]};rp(_0x14100c)[_0xa2c6('0x16')](function(_0x30bf20){var _0x37d9ef={'messageId':_0x30bf20[_0xa2c6('0x4b')][0x0]};return _0x2b1e75['update'](_0x37d9ef);})['catch'](function(_0x9926e8){logger[_0xa2c6('0x19')](_0xa2c6('0x26'),'afterCreate',_0xa2c6('0x46'),util[_0xa2c6('0x28')](_0x9926e8,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x46'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x4d49f8[_0xa2c6('0x2e')]&&_0x4d49f8[_0xa2c6('0x2c')]){if(_0x4d49f8['baseUrl']){var _0xbce978={'method':'POST','uri':_0x4d49f8[_0xa2c6('0x4c')]+_0xa2c6('0x4d'),'body':{'username':_0x4d49f8[_0xa2c6('0x2e')],'password':_0x4d49f8[_0xa2c6('0x2c')]},'json':!![]};return rp(_0xbce978)[_0xa2c6('0x16')](function(_0x2bd566){var _0x5d2cf1={'method':'POST','uri':_0x4d49f8[_0xa2c6('0x4c')]+_0xa2c6('0x4e'),'body':{'messages':[{'from':_0x4d49f8[_0xa2c6('0x21')],'destinations':[{'to':_0x965bb0[_0xa2c6('0x21')]}],'text':_0x965bb0['body'],'notifyUrl':_0x4d49f8[_0xa2c6('0x23')]+_0xa2c6('0x4f')+_0x965bb0['id']+_0xa2c6('0x24')+_0x4d49f8['token'],'notifyContentType':_0xa2c6('0x50'),'callbackData':_0x4d49f8[_0xa2c6('0x21')]+';'+_0x965bb0[_0xa2c6('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2bd566['token']},'json':!![]};return rp(_0x5d2cf1)[_0xa2c6('0x16')](function(_0x48d99d){if(_0x48d99d[_0xa2c6('0x22')]){var _0x52852d={'messageId':_0x48d99d[_0xa2c6('0x22')][0x0][_0xa2c6('0xc')]};if(!_0x4d49f8[_0xa2c6('0x3b')]){_0x52852d[_0xa2c6('0x35')]=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0x52852d);}else{return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'infobip',util[_0xa2c6('0x28')](_0x48d99d,{'showHidden':![],'depth':null}));}});})[_0xa2c6('0x18')](function(_0x53bc4b){return logger[_0xa2c6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa2c6('0x27'),_0xa2c6('0x51'),util[_0xa2c6('0x28')](_0x53bc4b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa2c6('0x26'),'afterCreate',_0xa2c6('0x51'),_0xa2c6('0x52'));}}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5d1efe=require(_0xa2c6('0x53'));if(_0x4d49f8['apiKey']){var _0x24ce9c={};_0x24ce9c[_0xa2c6('0x54')]=_0x4d49f8[_0xa2c6('0x2e')];_0x24ce9c[_0xa2c6('0x21')]=_0x965bb0['phone'];_0x24ce9c['sender']=_0x4d49f8[_0xa2c6('0x21')];_0x24ce9c[_0xa2c6('0x55')]=_0x965bb0['body'];_0x24ce9c['timestamp']=+new Date();var _0x573c92='';var _0x4cd091='';var _0x3f838a=Object[_0xa2c6('0x56')](_0x24ce9c);_0x3f838a[_0xa2c6('0x57')]();for(var _0x4f426a=0x0;_0x4f426a<_0x3f838a[_0xa2c6('0x58')];_0x4f426a++){if(_0x573c92!=''){_0x573c92+='&';}_0x573c92+=_0x3f838a[_0x4f426a]+'='+encodeURIComponent(_0x24ce9c[_0x3f838a[_0x4f426a]]);_0x4cd091+=_0x24ce9c[_0x3f838a[_0x4f426a]];}_0x4cd091+=_0x4d49f8[_0xa2c6('0x59')];_0x4cd091=_0x5d1efe[_0xa2c6('0x5a')](_0xa2c6('0x5b'))[_0xa2c6('0x17')](_0x4cd091)['digest'](_0xa2c6('0x5c'));if(_0x573c92!==''){_0x573c92+='&';}_0x573c92+=_0xa2c6('0x5d')+_0x4cd091;var _0x323e04={'method':_0xa2c6('0x2f'),'uri':_0x4d49f8[_0xa2c6('0x4c')]+_0xa2c6('0x5e')+_0x573c92,'json':!![]};return rp(_0x323e04)[_0xa2c6('0x16')](function(_0x24c631){var _0x8c138b=Object[_0xa2c6('0x56')](_0x24c631);if(_0x24c631[_0x8c138b[0x0]][_0xa2c6('0x19')]&&parseInt(_0x24c631[_0x8c138b[0x0]][_0xa2c6('0x19')])===0x0){var _0x1a5f61={'messageId':_0x24c631[_0x8c138b[0x0]][_0xa2c6('0x5f')]};if(!_0x4d49f8[_0xa2c6('0x3b')]){_0x1a5f61[_0xa2c6('0x35')]=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0x1a5f61);}else{return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'csc',util[_0xa2c6('0x28')](_0x24c631[_0xa2c6('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xea5a47){return logger[_0xa2c6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa2c6('0x60'),util['inspect'](_0xea5a47,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x60'),_0xa2c6('0x61'));}break;case _0xa2c6('0x62'):if(_0x4d49f8[_0xa2c6('0x59')]){var _0x21232b={'method':_0xa2c6('0x32'),'uri':_0xa2c6('0x63'),'headers':{'Authorization':_0x4d49f8[_0xa2c6('0x59')]},'body':{'content':_0x965bb0[_0xa2c6('0xe')],'to':[_0x965bb0[_0xa2c6('0x21')]],'from':_0x4d49f8[_0xa2c6('0x21')],'binary':![],'clientMessageId':_0xa2c6('0x64'),'charset':_0xa2c6('0x65')},'json':!![]};rp(_0x21232b)[_0xa2c6('0x16')](function(_0x1e59ae){if(!_0x1e59ae[_0xa2c6('0x19')]){var _0xd58ad6={'messageId':_0x1e59ae[_0xa2c6('0x22')][0x0][_0xa2c6('0x66')]};if(!_0x4d49f8[_0xa2c6('0x3b')]){_0xd58ad6[_0xa2c6('0x35')]=!![];}return _0x2b1e75[_0xa2c6('0x17')](_0xd58ad6);}else{return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'clickatell',util[_0xa2c6('0x28')](_0x1e59ae[_0xa2c6('0x19')],{'showHidden':![],'depth':null}));}})[_0xa2c6('0x18')](function(_0x731b26){return logger['error'](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x62'),util[_0xa2c6('0x28')](_0x731b26,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'clickatell',_0xa2c6('0x61'));}break;case'bandwidth':if(_0x4d49f8[_0xa2c6('0x2e')]&&_0x4d49f8[_0xa2c6('0x2c')]){var _0x35ceef=util[_0xa2c6('0x3d')](_0xa2c6('0x3e'),_0x4d49f8[_0xa2c6('0x2e')],_0x4d49f8[_0xa2c6('0x2c')]);var _0x14100c={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4d49f8[_0xa2c6('0x67')]+_0xa2c6('0x68'),'body':{'to':[_0x965bb0[_0xa2c6('0x21')]],'text':_0x965bb0[_0xa2c6('0xe')],'from':_0x4d49f8[_0xa2c6('0x21')],'applicationId':_0x4d49f8[_0xa2c6('0x69')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x35ceef)[_0xa2c6('0x6a')](_0xa2c6('0x40')))},'json':!![]};rp(_0x14100c)[_0xa2c6('0x16')](function(_0x4f278b){if(_0x4f278b['id']){var _0x197772={'messageId':_0x4f278b['id']};return _0x2b1e75[_0xa2c6('0x17')](_0x197772);}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),_0xa2c6('0x6b'),util[_0xa2c6('0x28')](_0x4f278b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e82d5){logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'bandwidth',util[_0xa2c6('0x28')](_0x1e82d5,{'showHidden':![],'depth':null}));});}else{logger[_0xa2c6('0x19')](_0xa2c6('0x26'),'afterCreate',_0xa2c6('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x4d49f8[_0xa2c6('0x59')]){var _0x3e06ca={};var _0x323e04={'method':'POST','uri':_0xa2c6('0x6c'),'headers':{'Authorization':_0xa2c6('0x6d')+_0x4d49f8[_0xa2c6('0x59')],'Content-Type':'application/json'},'body':{'from':_0x4d49f8[_0xa2c6('0x21')],'to':_0x965bb0[_0xa2c6('0x21')],'text':_0x965bb0[_0xa2c6('0xe')]},'json':!![]};return rp(_0x323e04)[_0xa2c6('0x16')](function(_0x592dc9){if(_0x592dc9[_0xa2c6('0x6e')]==0xca){_0x3e06ca['message']=_0x592dc9;var _0x1b184e={'method':_0xa2c6('0x32'),'uri':_0xa2c6('0x6f'),'headers':{'Authorization':_0xa2c6('0x6d')+_0x4d49f8[_0xa2c6('0x59')],'Content-Type':_0xa2c6('0x50')},'body':{'refid':_0x3e06ca[_0xa2c6('0x70')][_0xa2c6('0x71')]},'json':!![]};return rp(_0x1b184e)[_0xa2c6('0x16')](function(_0x10ea19){_0x3e06ca[_0xa2c6('0x72')]=_0x10ea19;var _0x1515be={'messageId':_0x3e06ca[_0xa2c6('0x70')][_0xa2c6('0x71')],'read':!![]};return _0x2b1e75[_0xa2c6('0x17')](_0x1515be);});}else{return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'intelepeer',util[_0xa2c6('0x28')](_0x592dc9,{'showHidden':![],'depth':null}));}})[_0xa2c6('0x18')](function(_0x4c5ec8){return logger[_0xa2c6('0x19')](_0xa2c6('0x26'),_0xa2c6('0x27'),'intelepeer',util[_0xa2c6('0x28')](_0x4c5ec8,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0xa2c6('0x73')](function(){_0x2637b4();});}else{_0x2637b4();}}},'charset':_0xa2c6('0x74'),'collate':_0xa2c6('0x75')});}; \ No newline at end of file +var _0x1b32=['applicationId','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','createdAt','error','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','body','remote','/api/sms/messages/','token','sid','update','catch','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','smsMethod','sender','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','head','message_id','clickSend','plivo','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','csc','apiKey','login','sort','length','createHash','md5','digest','GET','/external/get/send.php?','keys','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x1b32,0x85));var _0x21b3=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x1b32[_0x432fca];return _0x3adba4;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var logger=require(_0x21b3('0x1'))(_0x21b3('0x2'));var moment=require(_0x21b3('0x3'));var BPromise=require(_0x21b3('0x4'));var rp=require(_0x21b3('0x5'));var fs=require('fs');var path=require(_0x21b3('0x6'));var rimraf=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var attributes=require(_0x21b3('0x9'));module[_0x21b3('0xa')]=function(_0x403803,_0x37859f){return _0x403803[_0x21b3('0xb')](_0x21b3('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x21b3('0xd'),'fields':['messageId']},{'name':'fti_sms_messages','fields':['body'],'type':_0x21b3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36b2a1,_0x56009d,_0x4aa0d7){var _0x253f2b=_0x403803[_0x21b3('0xf')];var _0x1cb0f7=_0x36b2a1['get']({'plain':!![]});if(_0x1cb0f7[_0x21b3('0x10')][_0x21b3('0x11')]()==='in'||_0x1cb0f7[_0x21b3('0x10')][_0x21b3('0x11')]()===_0x21b3('0x12')&&!_0x1cb0f7[_0x21b3('0x13')]&&!_[_0x21b3('0x14')](_0x1cb0f7[_0x21b3('0x15')])){_0x253f2b[_0x21b3('0x16')]['findOne']({'where':{'id':_0x1cb0f7[_0x21b3('0x17')]}})[_0x21b3('0x18')](function(_0x43bede){if(_0x43bede){_0x43bede['update']({'lastMsgAt':_0x1cb0f7[_0x21b3('0x19')],'lastMsgDirection':_0x1cb0f7['direction'][_0x21b3('0x11')]()});}})['catch'](function(_0x15662a){console[_0x21b3('0x1a')](_0x15662a);});}if(_0x1cb0f7[_0x21b3('0x10')]===_0x21b3('0x12')&&!_0x1cb0f7['secret']){var _0x3f7e7a;_0x253f2b['SmsAccount'][_0x21b3('0x1b')]({'where':{'id':_0x1cb0f7[_0x21b3('0x1c')]},'raw':!![]})[_0x21b3('0x18')](function(_0x21921b){_0x3f7e7a=_0x21921b;if(_0x3f7e7a&&_0x3f7e7a['type']){switch(_0x3f7e7a[_0x21b3('0x1d')]){case _0x21b3('0x1e'):var _0x3f4040=require('twilio');if(_0x3f7e7a[_0x21b3('0x1f')]&&_0x3f7e7a[_0x21b3('0x20')]&&_0x3f7e7a[_0x21b3('0x21')]){var _0x3fe141=new _0x3f4040(_0x3f7e7a[_0x21b3('0x1f')],_0x3f7e7a[_0x21b3('0x20')]);_0x3fe141[_0x21b3('0x22')]['create']({'body':_0x1cb0f7[_0x21b3('0x23')],'to':_0x1cb0f7['phone'],'from':_0x3f7e7a[_0x21b3('0x21')],'statusCallback':_0x3f7e7a[_0x21b3('0x24')]+_0x21b3('0x25')+_0x1cb0f7['id']+'/status?token='+_0x3f7e7a[_0x21b3('0x26')]})['then'](function(_0x3ee234){if(_0x3ee234[_0x21b3('0x27')]){return _0x36b2a1[_0x21b3('0x28')]({'messageId':_0x3ee234[_0x21b3('0x27')]});}})[_0x21b3('0x29')](function(_0x2e3221){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x21b3('0x1e'),util[_0x21b3('0x2a')](_0x2e3221,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),'twilio',_0x21b3('0x2d'));}break;case'skebby':var _0x16d012='https://api.skebby.it/API/v1.0/REST/';if(_0x3f7e7a[_0x21b3('0x2e')]&&_0x3f7e7a[_0x21b3('0x2f')]){var _0x81ee7e={'recipient':[_0x1cb0f7['phone']],'message':_0x1cb0f7[_0x21b3('0x23')],'message_type':_0x3f7e7a[_0x21b3('0x30')]};if(_0x3f7e7a[_0x21b3('0x30')]&&_0x3f7e7a[_0x21b3('0x30')]!=='SI'){_0x81ee7e[_0x21b3('0x31')]=_0x3f7e7a[_0x21b3('0x21')];}var _0x11c328={'url':_0x16d012+'login?username='+_0x3f7e7a['username']+_0x21b3('0x32')+_0x3f7e7a[_0x21b3('0x2f')],'method':'GET'};rp(_0x11c328)[_0x21b3('0x18')](function(_0xa04ac7){var _0x2ab523=_0xa04ac7[_0x21b3('0x33')](';');var _0x2fb826={'user_key':_0x2ab523[0x0],'session_key':_0x2ab523[0x1]};_0x11c328={'url':_0x16d012+_0x21b3('0x34'),'method':_0x21b3('0x35'),'headers':{'user_key':_0x2fb826[_0x21b3('0x36')],'Session_key':_0x2fb826[_0x21b3('0x37')]},'json':!![],'body':_0x81ee7e};return rp(_0x11c328);})['then'](function(_0x575db3){if(_0x575db3[_0x21b3('0x38')]>=0x1){var _0x569f76={'messageId':_0x575db3[_0x21b3('0x39')]};if(_0x3f7e7a[_0x21b3('0x30')]!=='GP'||!_0x3f7e7a['deliveryReport']){_0x569f76[_0x21b3('0x3a')]=!![];}return _0x36b2a1[_0x21b3('0x28')](_0x569f76);}else{return logger[_0x21b3('0x1a')](_0x21b3('0x2b'),'afterCreate',_0x21b3('0x3b'),util[_0x21b3('0x2a')](_0x575db3,{'showHidden':![],'depth':null}));}})[_0x21b3('0x29')](function(_0x118b9b){return logger['error'](_0x21b3('0x2b'),'afterCreate',_0x21b3('0x3b'),util[_0x21b3('0x2a')](_0x118b9b,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x3b'),_0x21b3('0x3c'));}break;case'connectel':if(_0x3f7e7a['authToken']){var _0x3029e3={'recipient':_0x1cb0f7[_0x21b3('0x21')],'message':_0x1cb0f7[_0x21b3('0x23')],'sender':_0x3f7e7a[_0x21b3('0x3d')]||_0x3f7e7a['phone'],'authorization':_0x3f7e7a[_0x21b3('0x20')]};var _0x56009d={'method':_0x21b3('0x35'),'uri':_0x21b3('0x3e'),'body':_0x3029e3,'json':!![]};rp(_0x56009d)[_0x21b3('0x18')](function(_0xb028ca){var _0xbb93cd={'messageId':_0xb028ca[_0x21b3('0x3f')]};if(!_0x3f7e7a[_0x21b3('0x40')]){_0xbb93cd[_0x21b3('0x3a')]=!![];}return _0x36b2a1[_0x21b3('0x28')](_0xbb93cd);})['catch'](function(_0x1942c0){logger[_0x21b3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),'connectel',util[_0x21b3('0x2a')](_0x1942c0,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x21b3('0x41'));}break;case _0x21b3('0x42'):if(_0x3f7e7a[_0x21b3('0x2e')]&&_0x3f7e7a[_0x21b3('0x2f')]){var _0x3029e3={'messages':[{'source':'xCALLY\x20Motion','to':_0x1cb0f7[_0x21b3('0x21')],'body':_0x1cb0f7[_0x21b3('0x23')],'from':_0x3f7e7a[_0x21b3('0x3d')]||_0x3f7e7a[_0x21b3('0x21')]}]};var _0x33b550=util[_0x21b3('0x43')](_0x21b3('0x44'),_0x3f7e7a['username'],_0x3f7e7a[_0x21b3('0x2f')]);var _0x56009d={'method':_0x21b3('0x35'),'uri':_0x21b3('0x45'),'body':_0x3029e3,'headers':{'Authorization':util[_0x21b3('0x43')](_0x21b3('0x46'),new Buffer(_0x33b550)['toString']('base64'))},'json':!![]};rp(_0x56009d)[_0x21b3('0x18')](function(_0x2daa24){if(_0x2daa24[_0x21b3('0x47')]>=0xc8&&_0x2daa24['http_code']<=0xce){if(_0x2daa24[_0x21b3('0x48')]&&_0x2daa24[_0x21b3('0x48')][_0x21b3('0x49')]>0x0){var _0x3c2982=_[_0x21b3('0x4a')](_0x2daa24[_0x21b3('0x48')]['messages']);var _0xe7867d={'messageId':_0x3c2982[_0x21b3('0x4b')]};if(!_0x3f7e7a[_0x21b3('0x40')]){_0xe7867d['read']=!![];}return _0x36b2a1['update'](_0xe7867d);}else{logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x4c'),util[_0x21b3('0x2a')](_0x2daa24,{'showHidden':![],'depth':null}));}}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x4c'),util[_0x21b3('0x2a')](_0x2daa24,{'showHidden':![],'depth':null}));}})['catch'](function(_0x542ef4){logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x4c'),util[_0x21b3('0x2a')](_0x542ef4,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x4c'),_0x21b3('0x3c'));}break;case _0x21b3('0x4d'):if(_0x3f7e7a['authId']&&_0x3f7e7a[_0x21b3('0x20')]){var _0x3029e3={'dst':_0x1cb0f7[_0x21b3('0x21')],'text':_0x1cb0f7[_0x21b3('0x23')],'src':_0x3f7e7a[_0x21b3('0x3d')]||_0x3f7e7a[_0x21b3('0x21')],'url':_0x3f7e7a[_0x21b3('0x24')]+_0x21b3('0x25')+_0x1cb0f7['id']+_0x21b3('0x4e')+_0x3f7e7a['token']};var _0x33b550=util[_0x21b3('0x43')](_0x21b3('0x44'),_0x3f7e7a[_0x21b3('0x4f')],_0x3f7e7a[_0x21b3('0x20')]);var _0x56009d={'method':'POST','uri':util[_0x21b3('0x43')](_0x21b3('0x50'),_0x3f7e7a[_0x21b3('0x4f')]),'body':_0x3029e3,'headers':{'Authorization':util[_0x21b3('0x43')](_0x21b3('0x46'),new Buffer(_0x33b550)[_0x21b3('0x51')]('base64'))},'json':!![]};rp(_0x56009d)['then'](function(_0x429a4a){var _0xc28070={'messageId':_0x429a4a[_0x21b3('0x52')][0x0]};return _0x36b2a1[_0x21b3('0x28')](_0xc28070);})['catch'](function(_0x3451de){logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),'plivo',util['inspect'](_0x3451de,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x4d'),_0x21b3('0x53'));}break;case _0x21b3('0x54'):if(_0x3f7e7a[_0x21b3('0x2e')]&&_0x3f7e7a['password']){if(_0x3f7e7a[_0x21b3('0x55')]){var _0x16c9df={'method':_0x21b3('0x35'),'uri':_0x3f7e7a[_0x21b3('0x55')]+_0x21b3('0x56'),'body':{'username':_0x3f7e7a['username'],'password':_0x3f7e7a['password']},'json':!![]};return rp(_0x16c9df)[_0x21b3('0x18')](function(_0xa7275a){var _0x866fe1={'method':_0x21b3('0x35'),'uri':_0x3f7e7a[_0x21b3('0x55')]+_0x21b3('0x57'),'body':{'messages':[{'from':_0x3f7e7a['phone'],'destinations':[{'to':_0x1cb0f7[_0x21b3('0x21')]}],'text':_0x1cb0f7[_0x21b3('0x23')],'notifyUrl':_0x3f7e7a['remote']+_0x21b3('0x25')+_0x1cb0f7['id']+'/status?token='+_0x3f7e7a[_0x21b3('0x26')],'notifyContentType':_0x21b3('0x58'),'callbackData':_0x3f7e7a[_0x21b3('0x21')]+';'+_0x1cb0f7[_0x21b3('0x23')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xa7275a[_0x21b3('0x26')]},'json':!![]};return rp(_0x866fe1)['then'](function(_0x293818){if(_0x293818[_0x21b3('0x22')]){var _0x3d285f={'messageId':_0x293818[_0x21b3('0x22')][0x0][_0x21b3('0xd')]};if(!_0x3f7e7a['deliveryReport']){_0x3d285f[_0x21b3('0x3a')]=!![];}return _0x36b2a1[_0x21b3('0x28')](_0x3d285f);}else{return logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x54'),util[_0x21b3('0x2a')](_0x293818,{'showHidden':![],'depth':null}));}});})[_0x21b3('0x29')](function(_0xb673ab){return logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x54'),util[_0x21b3('0x2a')](_0xb673ab,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),'infobip',_0x21b3('0x3c'));}break;case _0x21b3('0x59'):var _0x1b3c0f=require('crypto');if(_0x3f7e7a[_0x21b3('0x5a')]){var _0x3e2867={};_0x3e2867[_0x21b3('0x5b')]=_0x3f7e7a[_0x21b3('0x2e')];_0x3e2867[_0x21b3('0x21')]=_0x1cb0f7[_0x21b3('0x21')];_0x3e2867[_0x21b3('0x31')]=_0x3f7e7a['phone'];_0x3e2867['text']=_0x1cb0f7[_0x21b3('0x23')];_0x3e2867['timestamp']=+new Date();var _0x370955='';var _0x4ad865='';var _0x164d9f=Object['keys'](_0x3e2867);_0x164d9f[_0x21b3('0x5c')]();for(var _0x3fe8de=0x0;_0x3fe8de<_0x164d9f[_0x21b3('0x5d')];_0x3fe8de++){if(_0x370955!=''){_0x370955+='&';}_0x370955+=_0x164d9f[_0x3fe8de]+'='+encodeURIComponent(_0x3e2867[_0x164d9f[_0x3fe8de]]);_0x4ad865+=_0x3e2867[_0x164d9f[_0x3fe8de]];}_0x4ad865+=_0x3f7e7a[_0x21b3('0x5a')];_0x4ad865=_0x1b3c0f[_0x21b3('0x5e')](_0x21b3('0x5f'))[_0x21b3('0x28')](_0x4ad865)[_0x21b3('0x60')]('hex');if(_0x370955!==''){_0x370955+='&';}_0x370955+='signature='+_0x4ad865;var _0x11c328={'method':_0x21b3('0x61'),'uri':_0x3f7e7a['baseUrl']+_0x21b3('0x62')+_0x370955,'json':!![]};return rp(_0x11c328)[_0x21b3('0x18')](function(_0x41d9ab){var _0x177f49=Object[_0x21b3('0x63')](_0x41d9ab);if(_0x41d9ab[_0x177f49[0x0]]['error']&&parseInt(_0x41d9ab[_0x177f49[0x0]]['error'])===0x0){var _0x467043={'messageId':_0x41d9ab[_0x177f49[0x0]][_0x21b3('0x64')]};if(!_0x3f7e7a[_0x21b3('0x40')]){_0x467043['read']=!![];}return _0x36b2a1[_0x21b3('0x28')](_0x467043);}else{return logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x59'),util['inspect'](_0x41d9ab[_0x21b3('0x1a')],{'showHidden':![],'depth':null}));}})[_0x21b3('0x29')](function(_0x128833){return logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),'csc',util[_0x21b3('0x2a')](_0x128833,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0x21b3('0x65'):if(_0x3f7e7a[_0x21b3('0x5a')]){var _0x34bcc8={'method':_0x21b3('0x35'),'uri':_0x21b3('0x66'),'headers':{'Authorization':_0x3f7e7a[_0x21b3('0x5a')]},'body':{'content':_0x1cb0f7[_0x21b3('0x23')],'to':[_0x1cb0f7[_0x21b3('0x21')]],'from':_0x3f7e7a[_0x21b3('0x21')],'binary':![],'clientMessageId':_0x21b3('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x34bcc8)[_0x21b3('0x18')](function(_0x35c74e){if(!_0x35c74e[_0x21b3('0x1a')]){var _0x4ef2bd={'messageId':_0x35c74e[_0x21b3('0x22')][0x0]['apiMessageId']};if(!_0x3f7e7a[_0x21b3('0x40')]){_0x4ef2bd[_0x21b3('0x3a')]=!![];}return _0x36b2a1[_0x21b3('0x28')](_0x4ef2bd);}else{return logger[_0x21b3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),_0x21b3('0x65'),util['inspect'](_0x35c74e[_0x21b3('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x6782f3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x21b3('0x2a')](_0x6782f3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),_0x21b3('0x65'),_0x21b3('0x68'));}break;case _0x21b3('0x69'):if(_0x3f7e7a[_0x21b3('0x2e')]&&_0x3f7e7a[_0x21b3('0x2f')]){var _0x33b550=util['format']('%s:%s',_0x3f7e7a['username'],_0x3f7e7a[_0x21b3('0x2f')]);var _0x56009d={'method':_0x21b3('0x35'),'uri':_0x21b3('0x6a')+_0x3f7e7a[_0x21b3('0x6b')]+_0x21b3('0x6c'),'body':{'to':[_0x1cb0f7[_0x21b3('0x21')]],'text':_0x1cb0f7['body'],'from':_0x3f7e7a[_0x21b3('0x21')],'applicationId':_0x3f7e7a[_0x21b3('0x6d')]},'headers':{'Authorization':util[_0x21b3('0x43')](_0x21b3('0x46'),new Buffer(_0x33b550)[_0x21b3('0x51')](_0x21b3('0x6e')))},'json':!![]};rp(_0x56009d)[_0x21b3('0x18')](function(_0x40e06d){if(_0x40e06d['id']){var _0xa4aa05={'messageId':_0x40e06d['id']};return _0x36b2a1[_0x21b3('0x28')](_0xa4aa05);}else{logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),_0x21b3('0x69'),util['inspect'](_0x40e06d,{'showHidden':![],'depth':null}));}})[_0x21b3('0x29')](function(_0x43d747){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),_0x21b3('0x69'),util[_0x21b3('0x2a')](_0x43d747,{'showHidden':![],'depth':null}));});}else{logger[_0x21b3('0x1a')](_0x21b3('0x2b'),'afterCreate',_0x21b3('0x69'),_0x21b3('0x3c'));}break;case _0x21b3('0x6f'):if(_0x3f7e7a[_0x21b3('0x5a')]){var _0x295359={};var _0x11c328={'method':_0x21b3('0x35'),'uri':_0x21b3('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x3f7e7a['apiKey'],'Content-Type':_0x21b3('0x58')},'body':{'from':_0x3f7e7a[_0x21b3('0x21')],'to':_0x1cb0f7[_0x21b3('0x21')],'text':_0x1cb0f7[_0x21b3('0x23')]},'json':!![]};return rp(_0x11c328)[_0x21b3('0x18')](function(_0x285501){if(_0x285501[_0x21b3('0x71')]==0xca){_0x295359['message']=_0x285501;var _0x5895f2={'method':_0x21b3('0x35'),'uri':_0x21b3('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x3f7e7a[_0x21b3('0x5a')],'Content-Type':_0x21b3('0x58')},'body':{'refid':_0x295359[_0x21b3('0x73')][_0x21b3('0x74')]},'json':!![]};return rp(_0x5895f2)['then'](function(_0x3a5403){_0x295359[_0x21b3('0x75')]=_0x3a5403;var _0x33366a={'messageId':_0x295359[_0x21b3('0x73')][_0x21b3('0x74')],'read':!![]};return _0x36b2a1[_0x21b3('0x28')](_0x33366a);});}else{return logger['error'](_0x21b3('0x2b'),_0x21b3('0x2c'),'intelepeer',util['inspect'](_0x285501,{'showHidden':![],'depth':null}));}})[_0x21b3('0x29')](function(_0x559e98){return logger[_0x21b3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),_0x21b3('0x6f'),util[_0x21b3('0x2a')](_0x559e98,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21b3('0x2c'),_0x21b3('0x6f'),_0x21b3('0x76'));}break;}}})['finally'](function(){_0x4aa0d7();});}else{_0x4aa0d7();}}},'charset':_0x21b3('0x77'),'collate':_0x21b3('0x78')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ea55df1..6190376 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 _0xdc98=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x53be82,_0x567cd0){var _0x143def=function(_0x590be5){while(--_0x590be5){_0x53be82['push'](_0x53be82['shift']());}};_0x143def(++_0x567cd0);}(_0xdc98,0x9d));var _0x8dc9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xdc98[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x8dc9('0x0'));var util=require(_0x8dc9('0x1'));var moment=require(_0x8dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x8dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dc9('0x4'))['db'];var utils=require(_0x8dc9('0x5'));var logger=require('../../config/logger')(_0x8dc9('0x6'));var config=require('../../config/environment');var jayson=require(_0x8dc9('0x7'));var client=jayson['client'][_0x8dc9('0x8')]({'port':0x232a});config[_0x8dc9('0x9')]=_[_0x8dc9('0xa')](config[_0x8dc9('0x9')],{'host':_0x8dc9('0xb'),'port':0x18eb});var socket=require(_0x8dc9('0xc'))(new Redis(config['redis']));require(_0x8dc9('0xd'))[_0x8dc9('0xe')](socket);function respondWithRpcPromise(_0xdbce88,_0x469b77,_0x10e1eb){return new BPromise(function(_0x3fad88,_0x119ad4){return client[_0x8dc9('0xf')](_0xdbce88,_0x10e1eb)['then'](function(_0x1202e1){logger[_0x8dc9('0x10')](_0x8dc9('0x11'),_0x469b77,'request\x20sent');logger[_0x8dc9('0x12')](_0x8dc9('0x13'),_0x469b77,_0x8dc9('0x14'),JSON[_0x8dc9('0x15')](_0x1202e1));if(_0x1202e1['error']){if(_0x1202e1[_0x8dc9('0x16')]['code']===0x1f4){logger[_0x8dc9('0x16')](_0x8dc9('0x11'),_0x469b77,_0x1202e1[_0x8dc9('0x16')][_0x8dc9('0x17')]);return _0x119ad4(_0x1202e1['error'][_0x8dc9('0x17')]);}logger[_0x8dc9('0x16')](_0x8dc9('0x11'),_0x469b77,_0x1202e1[_0x8dc9('0x16')][_0x8dc9('0x17')]);return _0x3fad88(_0x1202e1[_0x8dc9('0x16')][_0x8dc9('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x469b77,_0x8dc9('0x14'));_0x3fad88(_0x1202e1[_0x8dc9('0x18')][_0x8dc9('0x17')]);}})[_0x8dc9('0x19')](function(_0x2f1f35){logger['error'](_0x8dc9('0x11'),_0x469b77,_0x2f1f35);_0x119ad4(_0x2f1f35);});});}exports[_0x8dc9('0x1a')]=function(_0x33e661){var _0x16656b=this;return new Promise(function(_0x5181f5,_0x1e715a){return db[_0x8dc9('0x1b')]['create'](_0x33e661[_0x8dc9('0x1c')],{'raw':_0x33e661[_0x8dc9('0x1d')]?_0x33e661[_0x8dc9('0x1d')][_0x8dc9('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1630c4){logger['info'](_0x8dc9('0x1a'),_0x33e661);logger[_0x8dc9('0x12')](_0x8dc9('0x1a'),_0x33e661,JSON['stringify'](_0x1630c4));_0x5181f5(_0x1630c4);})[_0x8dc9('0x19')](function(_0x1e87db){logger[_0x8dc9('0x16')]('CreateSmsMessage',_0x1e87db[_0x8dc9('0x17')],_0x33e661);_0x1e715a(_0x16656b[_0x8dc9('0x16')](0x1f4,_0x1e87db['message']));});});}; \ No newline at end of file +var _0x42cd=['defaults','redis','localhost','socket.io-emitter','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsMessage','SmsMessage','create','body','options','raw','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x42cd,0x127));var _0xd42c=function(_0x3f073f,_0x3acb8b){_0x3f073f=_0x3f073f-0x0;var _0x489dcc=_0x42cd[_0x3f073f];return _0x489dcc;};'use strict';var _=require(_0xd42c('0x0'));var util=require('util');var moment=require(_0xd42c('0x1'));var BPromise=require(_0xd42c('0x2'));var rs=require(_0xd42c('0x3'));var fs=require('fs');var Redis=require(_0xd42c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd42c('0x5'));var logger=require(_0xd42c('0x6'))(_0xd42c('0x7'));var config=require(_0xd42c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd42c('0x9')][_0xd42c('0xa')]({'port':0x232a});config['redis']=_[_0xd42c('0xb')](config[_0xd42c('0xc')],{'host':_0xd42c('0xd'),'port':0x18eb});var socket=require(_0xd42c('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd42c('0xf')](socket);function respondWithRpcPromise(_0x4061fe,_0x31cc97,_0x43205d){return new BPromise(function(_0x195f3c,_0x456f61){return client[_0xd42c('0x10')](_0x4061fe,_0x43205d)['then'](function(_0xc15b82){logger[_0xd42c('0x11')](_0xd42c('0x12'),_0x31cc97,_0xd42c('0x13'));logger[_0xd42c('0x14')](_0xd42c('0x15'),_0x31cc97,_0xd42c('0x13'),JSON[_0xd42c('0x16')](_0xc15b82));if(_0xc15b82[_0xd42c('0x17')]){if(_0xc15b82[_0xd42c('0x17')][_0xd42c('0x18')]===0x1f4){logger[_0xd42c('0x17')](_0xd42c('0x12'),_0x31cc97,_0xc15b82[_0xd42c('0x17')][_0xd42c('0x19')]);return _0x456f61(_0xc15b82[_0xd42c('0x17')][_0xd42c('0x19')]);}logger['error'](_0xd42c('0x12'),_0x31cc97,_0xc15b82[_0xd42c('0x17')]['message']);return _0x195f3c(_0xc15b82[_0xd42c('0x17')][_0xd42c('0x19')]);}else{logger[_0xd42c('0x11')](_0xd42c('0x12'),_0x31cc97,'request\x20sent');_0x195f3c(_0xc15b82['result']['message']);}})['catch'](function(_0x28f519){logger[_0xd42c('0x17')](_0xd42c('0x12'),_0x31cc97,_0x28f519);_0x456f61(_0x28f519);});});}exports[_0xd42c('0x1a')]=function(_0x54abae){var _0x5553be=this;return new Promise(function(_0x4f76a5,_0x193cad){return db[_0xd42c('0x1b')][_0xd42c('0x1c')](_0x54abae[_0xd42c('0x1d')],{'raw':_0x54abae[_0xd42c('0x1e')]?_0x54abae[_0xd42c('0x1e')][_0xd42c('0x1f')]===undefined?!![]:![]:!![]})[_0xd42c('0x20')](function(_0x143c3d){logger[_0xd42c('0x11')](_0xd42c('0x1a'),_0x54abae);logger[_0xd42c('0x14')](_0xd42c('0x1a'),_0x54abae,JSON[_0xd42c('0x16')](_0x143c3d));_0x4f76a5(_0x143c3d);})[_0xd42c('0x21')](function(_0x5e667b){logger[_0xd42c('0x17')]('CreateSmsMessage',_0x5e667b[_0xd42c('0x19')],_0x54abae);_0x193cad(_0x5553be['error'](0x1f4,_0x5e667b[_0xd42c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index a86fa14..bc6b4a5 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 _0x93d2=['update','emit','removeListener','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x555370,_0x2021af){var _0x337b84=function(_0x4c8021){while(--_0x4c8021){_0x555370['push'](_0x555370['shift']());}};_0x337b84(++_0x2021af);}(_0x93d2,0x1dd));var _0x293d=function(_0x49a27a,_0x5adf4d){_0x49a27a=_0x49a27a-0x0;var _0x59f396=_0x93d2[_0x49a27a];return _0x59f396;};'use strict';var SmsMessageEvents=require(_0x293d('0x0'));var events=[_0x293d('0x1'),_0x293d('0x2'),_0x293d('0x3')];function createListener(_0x53c91c,_0x2c0bbc){return function(_0x50f812){_0x2c0bbc[_0x293d('0x4')](_0x53c91c,_0x50f812);};}function removeListener(_0xc17249,_0x1c9b68){return function(){SmsMessageEvents[_0x293d('0x5')](_0xc17249,_0x1c9b68);};}exports['register']=function(_0x39bb7f){for(var _0x356338=0x0,_0x36ef8d=events[_0x293d('0x6')];_0x356338<_0x36ef8d;_0x356338++){var _0x54bd24=events[_0x356338];var _0xd6db07=createListener(_0x293d('0x7')+_0x54bd24,_0x39bb7f);SmsMessageEvents['on'](_0x54bd24,_0xd6db07);}}; \ No newline at end of file +var _0x58a9=['remove','update','removeListener','register','length','smsMessage:','save'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x58a9,0x8b));var _0x958a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58a9[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x958a('0x0'),_0x958a('0x1'),_0x958a('0x2')];function createListener(_0x353cb9,_0x5de797){return function(_0x2578ff){_0x5de797['emit'](_0x353cb9,_0x2578ff);};}function removeListener(_0x1c4e15,_0x4aa53c){return function(){SmsMessageEvents[_0x958a('0x3')](_0x1c4e15,_0x4aa53c);};}exports[_0x958a('0x4')]=function(_0x275eb0){for(var _0x40f7b5=0x0,_0x24f1ff=events[_0x958a('0x5')];_0x40f7b5<_0x24f1ff;_0x40f7b5++){var _0x10e542=events[_0x40f7b5];var _0x5812ac=createListener(_0x958a('0x6')+_0x10e542,_0x275eb0);SmsMessageEvents['on'](_0x10e542,_0x5812ac);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4479bec..bf2c3e9 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 _0x1719=['/:id/users','getAgents','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1719,0x1db));var _0x9171=function(_0x192960,_0x3059c3){_0x192960=_0x192960-0x0;var _0x4906f0=_0x1719[_0x192960];return _0x4906f0;};'use strict';var multer=require(_0x9171('0x0'));var util=require(_0x9171('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9171('0x2'));var router=express[_0x9171('0x3')]();var fs_extra=require(_0x9171('0x4'));var auth=require(_0x9171('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9171('0x6'));var controller=require('./smsQueue.controller');router[_0x9171('0x7')]('/',auth['isAuthenticated'](),controller[_0x9171('0x8')]);router['get'](_0x9171('0x9'),auth['isAuthenticated'](),controller[_0x9171('0xa')]);router[_0x9171('0x7')](_0x9171('0xb'),auth[_0x9171('0xc')](),controller[_0x9171('0xd')]);router[_0x9171('0x7')](_0x9171('0xe'),auth[_0x9171('0xc')](),controller[_0x9171('0xf')]);router[_0x9171('0x7')](_0x9171('0x10'),auth[_0x9171('0xc')](),controller[_0x9171('0x11')]);router[_0x9171('0x7')](_0x9171('0x12'),auth['isAuthenticated'](),controller[_0x9171('0x13')]);router['post']('/',auth[_0x9171('0xc')](),controller[_0x9171('0x14')]);router['post']('/:id/teams',auth[_0x9171('0xc')](),controller[_0x9171('0x15')]);router['post'](_0x9171('0x12'),auth[_0x9171('0xc')](),controller[_0x9171('0x16')]);router[_0x9171('0x17')](_0x9171('0xb'),auth[_0x9171('0xc')](),controller['update']);router[_0x9171('0x18')](_0x9171('0xb'),auth[_0x9171('0xc')](),controller[_0x9171('0x19')]);router[_0x9171('0x18')](_0x9171('0x10'),auth['isAuthenticated'](),controller[_0x9171('0x1a')]);router[_0x9171('0x18')](_0x9171('0x12'),auth[_0x9171('0xc')](),controller[_0x9171('0x1b')]);module[_0x9171('0x1c')]=router; \ No newline at end of file +var _0x4517=['/:id','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x230bb8,_0xa1718){var _0x16cb9a=function(_0x2848fe){while(--_0x2848fe){_0x230bb8['push'](_0x230bb8['shift']());}};_0x16cb9a(++_0xa1718);}(_0x4517,0x108));var _0x7451=function(_0x39e41e,_0x235b38){_0x39e41e=_0x39e41e-0x0;var _0x5e6fe3=_0x4517[_0x39e41e];return _0x5e6fe3;};'use strict';var multer=require(_0x7451('0x0'));var util=require(_0x7451('0x1'));var path=require(_0x7451('0x2'));var timeout=require(_0x7451('0x3'));var express=require(_0x7451('0x4'));var router=express[_0x7451('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7451('0x6'));var interaction=require(_0x7451('0x7'));var config=require(_0x7451('0x8'));var controller=require(_0x7451('0x9'));router['get']('/',auth[_0x7451('0xa')](),controller[_0x7451('0xb')]);router[_0x7451('0xc')](_0x7451('0xd'),auth[_0x7451('0xa')](),controller[_0x7451('0xe')]);router[_0x7451('0xc')](_0x7451('0xf'),auth[_0x7451('0xa')](),controller['show']);router[_0x7451('0xc')](_0x7451('0x10'),auth[_0x7451('0xa')](),controller[_0x7451('0x11')]);router['get'](_0x7451('0x12'),auth[_0x7451('0xa')](),controller[_0x7451('0x13')]);router[_0x7451('0xc')]('/:id/users',auth[_0x7451('0xa')](),controller['getAgents']);router[_0x7451('0x14')]('/',auth[_0x7451('0xa')](),controller[_0x7451('0x15')]);router[_0x7451('0x14')](_0x7451('0x12'),auth['isAuthenticated'](),controller[_0x7451('0x16')]);router[_0x7451('0x14')](_0x7451('0x17'),auth[_0x7451('0xa')](),controller[_0x7451('0x18')]);router['put'](_0x7451('0xf'),auth[_0x7451('0xa')](),controller[_0x7451('0x19')]);router[_0x7451('0x1a')]('/:id',auth[_0x7451('0xa')](),controller[_0x7451('0x1b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x7451('0x1c')]);router[_0x7451('0x1a')](_0x7451('0x17'),auth[_0x7451('0xa')](),controller[_0x7451('0x1d')]);module[_0x7451('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6efcac2..b71c0ec 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 _0xb880=['sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x58c9fd,_0x34100c){var _0x4284f9=function(_0xd0d1b7){while(--_0xd0d1b7){_0x58c9fd['push'](_0x58c9fd['shift']());}};_0x4284f9(++_0x34100c);}(_0xb880,0x1c0));var _0x0b88=function(_0x48e620,_0x3fe08f){_0x48e620=_0x48e620-0x0;var _0x5b0368=_0xb880[_0x48e620];return _0x5b0368;};'use strict';var Sequelize=require(_0x0b88('0x0'));module[_0x0b88('0x1')]={'name':{'type':Sequelize[_0x0b88('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b88('0x3')](_0x0b88('0x4'),_0x0b88('0x5'),_0x0b88('0x6'))}}; \ No newline at end of file +var _0x8718=['name','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x8718,0xfa));var _0x8871=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0x8718[_0x39cd3c];return _0x47a0ae;};'use strict';var Sequelize=require(_0x8871('0x0'));module['exports']={'name':{'type':Sequelize[_0x8871('0x1')],'unique':_0x8871('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8871('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8871('0x3'),_0x8871('0x4'),_0x8871('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 054b2ff..dd2f8ee 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 _0x419f=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','userProfileId','autoAssociation','body','getMembers','UserSmsQueue','rawAttributes','order','sort','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','nolimit','ids','Team','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','includes','all','union','value','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','SmsQueue','fieldName','type'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x419f,0x176));var _0xf419=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x419f[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xf419('0x0'));var rimraf=require(_0xf419('0x1'));var zipdir=require(_0xf419('0x2'));var jsonpatch=require(_0xf419('0x3'));var rp=require(_0xf419('0x4'));var moment=require(_0xf419('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf419('0x6'));var util=require('util');var path=require(_0xf419('0x7'));var sox=require(_0xf419('0x8'));var csv=require(_0xf419('0x9'));var ejs=require(_0xf419('0xa'));var fs=require('fs');var fs_extra=require(_0xf419('0xb'));var _=require(_0xf419('0xc'));var squel=require(_0xf419('0xd'));var crypto=require(_0xf419('0xe'));var jsforce=require(_0xf419('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf419('0x9'));var querystring=require(_0xf419('0x10'));var Papa=require('papaparse');var Redis=require(_0xf419('0x11'));var authService=require(_0xf419('0x12'));var qs=require(_0xf419('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf419('0x14'));var logger=require(_0xf419('0x15'))(_0xf419('0x16'));var utils=require(_0xf419('0x17'));var config=require(_0xf419('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf419('0x19')]=_[_0xf419('0x1a')](config[_0xf419('0x19')],{'host':_0xf419('0x1b'),'port':0x18eb});var socket=require(_0xf419('0x1c'))(new Redis(config['redis']));require(_0xf419('0x1d'))[_0xf419('0x1e')](socket);function respondWithStatusCode(_0x1db85d,_0x2fb4bb){_0x2fb4bb=_0x2fb4bb||0xcc;return function(_0x137005){if(_0x137005){return _0x1db85d[_0xf419('0x1f')](_0x2fb4bb);}return _0x1db85d['status'](_0x2fb4bb)[_0xf419('0x20')]();};}function respondWithResult(_0x44b6c4,_0x5c3cd1){_0x5c3cd1=_0x5c3cd1||0xc8;return function(_0x8f9eec){if(_0x8f9eec){return _0x44b6c4[_0xf419('0x21')](_0x5c3cd1)[_0xf419('0x22')](_0x8f9eec);}};}function respondWithFilteredResult(_0x4f77fb,_0x5a6db6){return function(_0x599492){if(_0x599492){var _0x44aad6=typeof _0x5a6db6['offset']===_0xf419('0x23')&&typeof _0x5a6db6[_0xf419('0x24')]===_0xf419('0x23');var _0x431142=_0x599492['count'];var _0x323bd4=_0x44aad6?0x0:_0x5a6db6['offset'];var _0x260bac=_0x44aad6?_0x599492[_0xf419('0x25')]:_0x5a6db6[_0xf419('0x26')]+_0x5a6db6['limit'];var _0x5de78f;if(_0x260bac>=_0x431142){_0x260bac=_0x431142;_0x5de78f=0xc8;}else{_0x5de78f=0xce;}_0x4f77fb[_0xf419('0x21')](_0x5de78f);return _0x4f77fb[_0xf419('0x27')](_0xf419('0x28'),_0x323bd4+'-'+_0x260bac+'/'+_0x431142)[_0xf419('0x22')](_0x599492);}return null;};}function patchUpdates(_0x47bac2){return function(_0x3146d2){try{jsonpatch[_0xf419('0x29')](_0x3146d2,_0x47bac2,!![]);}catch(_0x50d00b){return BPromise['reject'](_0x50d00b);}return _0x3146d2['save']();};}function saveUpdates(_0x2d2c19,_0xa70f96){return function(_0x1cf683){if(_0x1cf683){return _0x1cf683[_0xf419('0x2a')](_0x2d2c19)[_0xf419('0x2b')](function(_0x5aa688){return _0x5aa688;});}return null;};}function removeEntity(_0x39ebe5,_0x3fbaaa){return function(_0x50762a){if(_0x50762a){return _0x50762a[_0xf419('0x2c')]()['then'](function(){var _0x1bd979=_0x50762a[_0xf419('0x2d')]({'plain':!![]});var _0x330805='SmsQueues';return db[_0xf419('0x2e')][_0xf419('0x2c')]({'where':{'type':_0x330805,'resourceId':_0x1bd979['id']}})[_0xf419('0x2b')](function(){return _0x50762a;});})[_0xf419('0x2b')](function(){_0x39ebe5[_0xf419('0x21')](0xcc)[_0xf419('0x20')]();});}};}function handleEntityNotFound(_0x420461,_0x4f9ee5){return function(_0x925308){if(!_0x925308){_0x420461[_0xf419('0x1f')](0x194);}return _0x925308;};}function handleError(_0x3b12e9,_0x3b4fe3){_0x3b4fe3=_0x3b4fe3||0x1f4;return function(_0x5691ba){logger[_0xf419('0x2f')](_0x5691ba[_0xf419('0x30')]);if(_0x5691ba['name']){delete _0x5691ba[_0xf419('0x31')];}_0x3b12e9['status'](_0x3b4fe3)['send'](_0x5691ba);};}exports[_0xf419('0x32')]=function(_0x1e5961,_0x56aadb){var _0x18f23a={},_0x36ca1c={},_0x19e946={'count':0x0,'rows':[]};var _0x42ccad=_[_0xf419('0x33')](db[_0xf419('0x34')]['rawAttributes'],function(_0x29ecdc){return{'name':_0x29ecdc[_0xf419('0x35')],'type':_0x29ecdc[_0xf419('0x36')][_0xf419('0x37')]};});_0x36ca1c[_0xf419('0x38')]=_[_0xf419('0x33')](_0x42ccad,_0xf419('0x31'));_0x36ca1c[_0xf419('0x39')]=_[_0xf419('0x3a')](_0x1e5961['query']);_0x36ca1c[_0xf419('0x3b')]=_[_0xf419('0x3c')](_0x36ca1c[_0xf419('0x38')],_0x36ca1c['query']);_0x18f23a[_0xf419('0x3d')]=_[_0xf419('0x3c')](_0x36ca1c[_0xf419('0x38')],qs[_0xf419('0x3e')](_0x1e5961['query'][_0xf419('0x3e')]));_0x18f23a[_0xf419('0x3d')]=_0x18f23a[_0xf419('0x3d')][_0xf419('0x3f')]?_0x18f23a[_0xf419('0x3d')]:_0x36ca1c['model'];if(!_0x1e5961[_0xf419('0x39')][_0xf419('0x40')]('nolimit')){_0x18f23a[_0xf419('0x24')]=qs[_0xf419('0x24')](_0x1e5961[_0xf419('0x39')][_0xf419('0x24')]);_0x18f23a[_0xf419('0x26')]=qs[_0xf419('0x26')](_0x1e5961['query'][_0xf419('0x26')]);}_0x18f23a['order']=qs['sort'](_0x1e5961[_0xf419('0x39')]['sort']);_0x18f23a[_0xf419('0x41')]=qs['filters'](_[_0xf419('0x42')](_0x1e5961[_0xf419('0x39')],_0x36ca1c[_0xf419('0x3b')]),_0x42ccad);if(_0x1e5961[_0xf419('0x39')][_0xf419('0x43')]){_0x18f23a['where']=_[_0xf419('0x44')](_0x18f23a[_0xf419('0x41')],{'$or':_[_0xf419('0x33')](_0x42ccad,function(_0x276d77){if(_0x276d77[_0xf419('0x36')]!==_0xf419('0x45')){var _0x20edd0={};_0x20edd0[_0x276d77['name']]={'$like':'%'+_0x1e5961[_0xf419('0x39')][_0xf419('0x43')]+'%'};return _0x20edd0;}})});}_0x18f23a=_[_0xf419('0x44')]({},_0x18f23a,_0x1e5961[_0xf419('0x46')]);var _0x479d84={'where':_0x18f23a['where']};return db[_0xf419('0x34')][_0xf419('0x25')](_0x479d84)['then'](function(_0x47bba4){_0x19e946[_0xf419('0x25')]=_0x47bba4;if(_0x1e5961['query'][_0xf419('0x47')]){_0x18f23a['include']=[{'all':!![]}];}return db[_0xf419('0x34')][_0xf419('0x48')](_0x18f23a);})[_0xf419('0x2b')](function(_0x53784f){_0x19e946[_0xf419('0x49')]=_0x53784f;return _0x19e946;})[_0xf419('0x2b')](respondWithFilteredResult(_0x56aadb,_0x18f23a))[_0xf419('0x4a')](handleError(_0x56aadb,null));};exports[_0xf419('0x4b')]=function(_0x521d53,_0xf9cea7){var _0x256f37={'raw':!![],'where':{'id':_0x521d53[_0xf419('0x4c')]['id']}},_0x4f33f6={};_0x4f33f6['model']=_[_0xf419('0x3a')](db[_0xf419('0x34')]['rawAttributes']);_0x4f33f6['query']=_['keys'](_0x521d53[_0xf419('0x39')]);_0x4f33f6[_0xf419('0x3b')]=_[_0xf419('0x3c')](_0x4f33f6['model'],_0x4f33f6[_0xf419('0x39')]);_0x256f37[_0xf419('0x3d')]=_['intersection'](_0x4f33f6[_0xf419('0x38')],qs[_0xf419('0x3e')](_0x521d53[_0xf419('0x39')][_0xf419('0x3e')]));_0x256f37[_0xf419('0x3d')]=_0x256f37['attributes']['length']?_0x256f37[_0xf419('0x3d')]:_0x4f33f6[_0xf419('0x38')];if(_0x521d53['query']['includeAll']){_0x256f37['include']=[{'all':!![]}];}_0x256f37=_[_0xf419('0x44')]({},_0x256f37,_0x521d53['options']);return db[_0xf419('0x34')][_0xf419('0x4d')](_0x256f37)[_0xf419('0x2b')](handleEntityNotFound(_0xf9cea7,null))[_0xf419('0x2b')](respondWithResult(_0xf9cea7,null))[_0xf419('0x4a')](handleError(_0xf9cea7,null));};exports[_0xf419('0x4e')]=function(_0x296d31,_0x41597e){return db['SmsQueue'][_0xf419('0x4e')](_0x296d31['body'],{})['then'](function(_0x3a1793){var _0x1dfbc7=_0x296d31[_0xf419('0x4f')]['get']({'plain':!![]});if(!_0x1dfbc7)throw new Error(_0xf419('0x50'));if(_0x1dfbc7[_0xf419('0x51')]===_0xf419('0x4f')){var _0x7ac561=_0x3a1793[_0xf419('0x2d')]({'plain':!![]});var _0x4ad27a=_0xf419('0x52');return db['UserProfileSection']['find']({'where':{'name':_0x4ad27a,'userProfileId':_0x1dfbc7[_0xf419('0x53')]},'raw':!![]})['then'](function(_0x4c6718){if(_0x4c6718&&_0x4c6718[_0xf419('0x54')]===0x0){return db[_0xf419('0x2e')][_0xf419('0x4e')]({'name':_0x7ac561[_0xf419('0x31')],'resourceId':_0x7ac561['id'],'type':_0x4c6718['name'],'sectionId':_0x4c6718['id']},{})[_0xf419('0x2b')](function(){return _0x3a1793;});}else{return _0x3a1793;}})[_0xf419('0x4a')](function(_0x3b4c17){logger[_0xf419('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4c17);throw _0x3b4c17;});}return _0x3a1793;})[_0xf419('0x2b')](respondWithResult(_0x41597e,0xc9))[_0xf419('0x4a')](handleError(_0x41597e,null));};exports[_0xf419('0x2a')]=function(_0x34773d,_0x1d3756){if(_0x34773d['body']['id']){delete _0x34773d[_0xf419('0x55')]['id'];}return db[_0xf419('0x34')]['find']({'where':{'id':_0x34773d[_0xf419('0x4c')]['id']}})[_0xf419('0x2b')](handleEntityNotFound(_0x1d3756,null))[_0xf419('0x2b')](saveUpdates(_0x34773d[_0xf419('0x55')],null))[_0xf419('0x2b')](respondWithResult(_0x1d3756,null))['catch'](handleError(_0x1d3756,null));};exports[_0xf419('0x2c')]=function(_0x4ddc4d,_0x1ade5f){return db[_0xf419('0x34')]['find']({'where':{'id':_0x4ddc4d['params']['id']}})['then'](handleEntityNotFound(_0x1ade5f,null))['then'](removeEntity(_0x1ade5f,null))[_0xf419('0x4a')](handleError(_0x1ade5f,null));};exports['describe']=function(_0x2d08bf,_0x4ca9ae){return db[_0xf419('0x34')]['describe']()['then'](respondWithResult(_0x4ca9ae,null))[_0xf419('0x4a')](handleError(_0x4ca9ae,null));};exports[_0xf419('0x56')]=function(_0x64f1a,_0x39259e,_0x52723f){var _0x4bc200={'raw':!![],'where':{}},_0x78c99f={},_0x1fc18a;return db[_0xf419('0x34')]['findOne']({'where':{'id':_0x64f1a[_0xf419('0x4c')]['id']}})['then'](handleEntityNotFound(_0x39259e,null))[_0xf419('0x2b')](function(_0x104f1f){if(_0x104f1f){_0x1fc18a=_0x104f1f['get']({'plain':!![]});_0x78c99f['model']=_['keys'](db[_0xf419('0x57')][_0xf419('0x58')]);_0x78c99f[_0xf419('0x39')]=_[_0xf419('0x3a')](_0x64f1a['query']);_0x78c99f['filters']=_['intersection'](_0x78c99f['model'],_0x78c99f[_0xf419('0x39')]);_0x4bc200[_0xf419('0x3d')]=_[_0xf419('0x3c')](_0x78c99f['model'],qs[_0xf419('0x3e')](_0x64f1a[_0xf419('0x39')][_0xf419('0x3e')]));_0x4bc200['attributes']=_0x4bc200[_0xf419('0x3d')][_0xf419('0x3f')]?_0x4bc200[_0xf419('0x3d')]:_0x78c99f[_0xf419('0x38')];if(!_0x64f1a['query']['hasOwnProperty']('nolimit')){_0x4bc200[_0xf419('0x24')]=qs[_0xf419('0x24')](_0x64f1a[_0xf419('0x39')][_0xf419('0x24')]);_0x4bc200[_0xf419('0x26')]=qs['offset'](_0x64f1a[_0xf419('0x39')][_0xf419('0x26')]);}_0x4bc200[_0xf419('0x59')]=qs[_0xf419('0x5a')](_0x64f1a[_0xf419('0x39')][_0xf419('0x5a')]);_0x4bc200['where']=qs['filters'](_[_0xf419('0x42')](_0x64f1a['query'],_0x78c99f[_0xf419('0x3b')]));_0x4bc200[_0xf419('0x41')][_0xf419('0x5b')]=_0x104f1f['id'];if(_0x64f1a[_0xf419('0x39')][_0xf419('0x43')]){_0x4bc200['where']=_[_0xf419('0x44')](_0x4bc200[_0xf419('0x41')],{'$or':_[_0xf419('0x33')](_0x4bc200['attributes'],function(_0x41cf1f){var _0x23e815={};_0x23e815[_0x41cf1f]={'$like':'%'+_0x64f1a['query'][_0xf419('0x43')]+'%'};return _0x23e815;})});}_0x4bc200=_[_0xf419('0x44')]({},_0x4bc200,_0x64f1a[_0xf419('0x46')]);return db[_0xf419('0x57')][_0xf419('0x48')](_0x4bc200);}})[_0xf419('0x2b')](function(_0x3455db){if(_0x3455db){return db['User'][_0xf419('0x5c')]({'where':{'id':_[_0xf419('0x33')](_0x3455db,_0xf419('0x5d')),'role':_0xf419('0x5e')},'attributes':['id',_0xf419('0x31'),_0xf419('0x5f'),_0xf419('0x60'),'createdAt']});}})[_0xf419('0x2b')](function(_0x389662){if(_0x389662){return{'count':_0x389662[_0xf419('0x25')],'rows':_[_0xf419('0x33')](_0x389662[_0xf419('0x49')],function(_0x3ef8bd){return{'membername':_0x3ef8bd[_0xf419('0x31')],'UserId':_0x3ef8bd['id'],'queue_name':_0x1fc18a[_0xf419('0x31')],'SmsQueueId':_0x1fc18a['id'],'interface':util[_0xf419('0x61')](_0xf419('0x62'),_0xf419('0x63'),_0x3ef8bd[_0xf419('0x31')]),'penalty':0x0,'paused':_0x3ef8bd['smsPause'],'createdAt':_0x3ef8bd[_0xf419('0x64')],'updatedAt':_0x3ef8bd[_0xf419('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf419('0x2b')](respondWithFilteredResult(_0x39259e,_0x4bc200))[_0xf419('0x4a')](handleError(_0x39259e,null));};exports[_0xf419('0x65')]=function(_0x31d900,_0x377a24,_0x42b6da){var _0x1ba171={};var _0x33f561={};var _0x43b9ea;var _0x413ee6;return db[_0xf419('0x34')]['findOne']({'where':{'id':_0x31d900[_0xf419('0x4c')]['id']}})[_0xf419('0x2b')](handleEntityNotFound(_0x377a24,null))[_0xf419('0x2b')](function(_0xdd919f){if(_0xdd919f){_0x43b9ea=_0xdd919f;_0x33f561[_0xf419('0x38')]=_['keys'](db['Team'][_0xf419('0x58')]);_0x33f561['query']=_[_0xf419('0x3a')](_0x31d900[_0xf419('0x39')]);_0x33f561[_0xf419('0x3b')]=_[_0xf419('0x3c')](_0x33f561[_0xf419('0x38')],_0x33f561[_0xf419('0x39')]);_0x1ba171['attributes']=_[_0xf419('0x3c')](_0x33f561['model'],qs[_0xf419('0x3e')](_0x31d900['query'][_0xf419('0x3e')]));_0x1ba171[_0xf419('0x3d')]=_0x1ba171[_0xf419('0x3d')][_0xf419('0x3f')]?_0x1ba171['attributes']:_0x33f561['model'];_0x1ba171[_0xf419('0x59')]=qs[_0xf419('0x5a')](_0x31d900[_0xf419('0x39')][_0xf419('0x5a')]);_0x1ba171[_0xf419('0x41')]=qs[_0xf419('0x3b')](_[_0xf419('0x42')](_0x31d900[_0xf419('0x39')],_0x33f561['filters']));if(_0x31d900['query'][_0xf419('0x43')]){_0x1ba171[_0xf419('0x41')]=_['merge'](_0x1ba171[_0xf419('0x41')],{'$or':_[_0xf419('0x33')](_0x1ba171[_0xf419('0x3d')],function(_0x35c560){var _0x1e6afd={};_0x1e6afd[_0x35c560]={'$like':'%'+_0x31d900[_0xf419('0x39')]['filter']+'%'};return _0x1e6afd;})});}_0x1ba171=_[_0xf419('0x44')]({},_0x1ba171,_0x31d900[_0xf419('0x46')]);return _0x43b9ea['getTeams'](_0x1ba171);}})[_0xf419('0x2b')](function(_0x1a5eed){if(_0x1a5eed){_0x413ee6=_0x1a5eed[_0xf419('0x3f')];if(!_0x31d900[_0xf419('0x39')][_0xf419('0x40')](_0xf419('0x66'))){_0x1ba171[_0xf419('0x24')]=qs[_0xf419('0x24')](_0x31d900[_0xf419('0x39')][_0xf419('0x24')]);_0x1ba171[_0xf419('0x26')]=qs[_0xf419('0x26')](_0x31d900['query'][_0xf419('0x26')]);}return _0x43b9ea[_0xf419('0x65')](_0x1ba171);}})['then'](function(_0x488c51){if(_0x488c51){return _0x488c51?{'count':_0x413ee6,'rows':_0x488c51}:null;}})[_0xf419('0x2b')](respondWithResult(_0x377a24,null))['catch'](handleError(_0x377a24,null));};exports['addTeams']=function(_0x5a061b,_0xa77d7d,_0x3dd784){var _0x4724f4=_0x5a061b[_0xf419('0x55')][_0xf419('0x67')];return db[_0xf419('0x68')][_0xf419('0x48')]({'where':{'id':_0x4724f4},'attributes':['id'],'include':[{'model':db[_0xf419('0x69')],'as':_0xf419('0x6a'),'attributes':['id',_0xf419('0x31'),'online',_0xf419('0x6b'),_0xf419('0x6c')],'raw':!![]}]})[_0xf419('0x2b')](function(_0x16eb70){if(_0x16eb70){var _0x1eb2a3=_[_0xf419('0x6d')](_0x16eb70,function(_0x144260){var _0x40dfd9=_0x144260[_0xf419('0x2d')]({'plain':!![]});return _0x40dfd9['Agents'];});return db[_0xf419('0x34')][_0xf419('0x4d')]({'where':{'id':_0x5a061b[_0xf419('0x4c')]['id']}})['then'](function(_0x3d7054){return db[_0xf419('0x6e')][_0xf419('0x6f')](function(_0x124897){return _0x3d7054[_0xf419('0x70')](_0x4724f4,{'transaction':_0x124897})[_0xf419('0x2b')](function(){return BPromise[_0xf419('0x71')](_0x1eb2a3,function(_0x371a44){return db[_0xf419('0x57')][_0xf419('0x72')]({'where':{'UserId':_0x371a44['id'],'SmsQueueId':_0x5a061b[_0xf419('0x4c')]['id']},'transaction':_0x124897});});})[_0xf419('0x2b')](function(){_0x1eb2a3[_0xf419('0x73')](function(_0x4fdbef){socket[_0xf419('0x74')](_0xf419('0x75'),{'UserId':_0x4fdbef['id'],'SmsQueueId':_0x3d7054['id']});});});});});}})[_0xf419('0x2b')](respondWithStatusCode(_0xa77d7d,null))[_0xf419('0x4a')](handleError(_0xa77d7d,null));};exports[_0xf419('0x76')]=function(_0x5dede0,_0x32531c,_0x1a433c){return db['Team'][_0xf419('0x48')]({'where':{'id':_0x5dede0['query'][_0xf419('0x67')]},'attributes':['id'],'include':[{'model':db[_0xf419('0x69')],'as':_0xf419('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf419('0x2b')](handleEntityNotFound(_0x32531c,null))['then'](function(_0x5e2ead){var _0x2d4d88=_[_0xf419('0x33')](_0x5e2ead,'id');var _0x23d30a=[];var _0x12a65c=[];var _0x5c2681=squel[_0xf419('0x77')]();_0x5c2681[_0xf419('0x78')](_0xf419('0x79'))['from'](_0xf419('0x7a'),'tq')[_0xf419('0x7b')](_0xf419('0x7c'),'ut',_0xf419('0x7d'))['where']('SmsQueueId\x20=\x20?',_0x5dede0[_0xf419('0x4c')]['id']);for(var _0x2a0fb1=0x0;_0x2a0fb1<_0x5e2ead[_0xf419('0x3f')];_0x2a0fb1+=0x1){let _0x41343e=_0x5e2ead[_0x2a0fb1];for(var _0x47d391=0x0;_0x47d391<_0x41343e[_0xf419('0x6a')]['length'];_0x47d391+=0x1){let _0x443d5f=_0x41343e['Agents'][_0x47d391];var _0x4f6678=_0x5c2681[_0xf419('0x7e')]();_0x4f6678[_0xf419('0x41')]('ut.UserId\x20=\x20?',_0x443d5f['id']);_0x12a65c[_0xf419('0x7f')](db[_0xf419('0x6e')][_0xf419('0x39')](_0x4f6678[_0xf419('0x80')](),{'type':db['sequelize']['QueryTypes'][_0xf419('0x81')]})[_0xf419('0x2b')](function(_0x5c1b8d){if(_0x5c1b8d['length']===0x1){return _0x443d5f['id'];}else{var _0xb1186d=_[_0xf419('0x82')](_['map'](_0x5c1b8d,_0xf419('0x83')),function(_0x295f36){return _[_0xf419('0x84')](_0x2d4d88,_0x295f36);});if(_0xb1186d){return _0x443d5f['id'];}}}));}}return BPromise[_0xf419('0x85')](_0x12a65c)[_0xf419('0x2b')](function(_0xe01f96){_0x23d30a=_(_0x23d30a)[_0xf419('0x86')](_0xe01f96)['compact']()[_0xf419('0x87')]();return db[_0xf419('0x34')][_0xf419('0x4d')]({'where':{'id':_0x5dede0[_0xf419('0x4c')]['id']}})[_0xf419('0x2b')](function(_0x3cceec){return db[_0xf419('0x6e')]['transaction'](function(_0x41b77f){return _0x3cceec[_0xf419('0x76')](_0x5dede0[_0xf419('0x39')][_0xf419('0x67')],{'transaction':_0x41b77f})[_0xf419('0x2b')](function(){if(!_['isEmpty'](_0x23d30a)){return _0x3cceec[_0xf419('0x88')](_0x23d30a,{'transaction':_0x41b77f});}})[_0xf419('0x2b')](function(){_0x23d30a[_0xf419('0x73')](function(_0x17f813){socket[_0xf419('0x74')](_0xf419('0x89'),{'UserId':_0x17f813,'SmsQueueId':_0x3cceec['id']});});});});});});})[_0xf419('0x2b')](respondWithStatusCode(_0x32531c,null))[_0xf419('0x4a')](handleError(_0x32531c,null));};exports[_0xf419('0x8a')]=function(_0x5c4455,_0x355ad0,_0x704a54){return db[_0xf419('0x34')][_0xf419('0x4d')]({'where':{'id':_0x5c4455[_0xf419('0x4c')]['id']}})[_0xf419('0x2b')](handleEntityNotFound(_0x355ad0,null))[_0xf419('0x2b')](function(_0x5318da){if(_0x5318da){return _0x5318da[_0xf419('0x8a')](_0x5c4455['body'][_0xf419('0x67')],_[_0xf419('0x8b')](_0x5c4455['body'],[_0xf419('0x67'),'id'])||{})['spread'](function(_0x24cdb7){for(var _0x14029e=0x0;_0x14029e<_0x5c4455[_0xf419('0x55')][_0xf419('0x67')][_0xf419('0x3f')];_0x14029e+=0x1){socket[_0xf419('0x74')]('userSmsQueue:save',{'UserId':Number(_0x5c4455[_0xf419('0x55')]['ids'][_0x14029e]),'SmsQueueId':Number(_0x5c4455['params']['id'])});}return _0x24cdb7;});}})[_0xf419('0x2b')](respondWithResult(_0x355ad0,null))[_0xf419('0x4a')](handleError(_0x355ad0,null));};exports['removeAgents']=function(_0x15584c,_0x1c28bb,_0x1fd1e0){return db[_0xf419('0x34')][_0xf419('0x4d')]({'where':{'id':_0x15584c['params']['id']}})[_0xf419('0x2b')](handleEntityNotFound(_0x1c28bb,null))[_0xf419('0x2b')](function(_0x42fa9d){if(_0x42fa9d){return _0x42fa9d[_0xf419('0x88')](_0x15584c['query']['ids'])[_0xf419('0x2b')](function(){if(_[_0xf419('0x8c')](_0x15584c['query']['ids'])){for(var _0x381ded=0x0;_0x381ded<_0x15584c[_0xf419('0x39')][_0xf419('0x67')][_0xf419('0x3f')];_0x381ded+=0x1){socket[_0xf419('0x74')](_0xf419('0x89'),{'UserId':Number(_0x15584c[_0xf419('0x39')][_0xf419('0x67')][_0x381ded]),'SmsQueueId':Number(_0x15584c[_0xf419('0x4c')]['id'])});}}else{socket[_0xf419('0x74')](_0xf419('0x89'),{'UserId':Number(_0x15584c[_0xf419('0x39')][_0xf419('0x67')]),'SmsQueueId':Number(_0x15584c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1c28bb,null))[_0xf419('0x4a')](handleError(_0x1c28bb,null));};exports[_0xf419('0x8d')]=function(_0x2307fb,_0x3f9e98,_0x654580){var _0x59bbb9={};var _0x27364f={};var _0x33885f;var _0x47dbce;return db[_0xf419('0x34')][_0xf419('0x8e')]({'where':{'id':_0x2307fb[_0xf419('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f9e98,null))[_0xf419('0x2b')](function(_0x5ce532){if(_0x5ce532){_0x33885f=_0x5ce532;_0x27364f['model']=_['keys'](db[_0xf419('0x69')][_0xf419('0x58')]);_0x27364f['query']=_[_0xf419('0x3a')](_0x2307fb[_0xf419('0x39')]);_0x27364f[_0xf419('0x3b')]=_[_0xf419('0x3c')](_0x27364f[_0xf419('0x38')],_0x27364f[_0xf419('0x39')]);_0x59bbb9['attributes']=_[_0xf419('0x3c')](_0x27364f['model'],qs[_0xf419('0x3e')](_0x2307fb[_0xf419('0x39')][_0xf419('0x3e')]));_0x59bbb9[_0xf419('0x3d')]=_0x59bbb9[_0xf419('0x3d')][_0xf419('0x3f')]?_0x59bbb9['attributes']:_0x27364f[_0xf419('0x38')];_0x59bbb9[_0xf419('0x59')]=qs[_0xf419('0x5a')](_0x2307fb[_0xf419('0x39')][_0xf419('0x5a')]);_0x59bbb9[_0xf419('0x41')]=qs[_0xf419('0x3b')](_['pick'](_0x2307fb[_0xf419('0x39')],_0x27364f[_0xf419('0x3b')]));if(_0x2307fb[_0xf419('0x39')]['filter']){_0x59bbb9['where']=_[_0xf419('0x44')](_0x59bbb9[_0xf419('0x41')],{'$or':_[_0xf419('0x33')](_0x59bbb9['attributes'],function(_0x477da5){var _0x10e55f={};_0x10e55f[_0x477da5]={'$like':'%'+_0x2307fb['query']['filter']+'%'};return _0x10e55f;})});}_0x59bbb9=_[_0xf419('0x44')]({},_0x59bbb9,_0x2307fb[_0xf419('0x46')]);return _0x33885f[_0xf419('0x8d')](_0x59bbb9);}})[_0xf419('0x2b')](function(_0x37b19b){if(_0x37b19b){_0x47dbce=_0x37b19b[_0xf419('0x3f')];if(!_0x2307fb['query'][_0xf419('0x40')](_0xf419('0x66'))){_0x59bbb9[_0xf419('0x24')]=qs[_0xf419('0x24')](_0x2307fb[_0xf419('0x39')][_0xf419('0x24')]);_0x59bbb9[_0xf419('0x26')]=qs[_0xf419('0x26')](_0x2307fb[_0xf419('0x39')][_0xf419('0x26')]);}return _0x33885f['getAgents'](_0x59bbb9);}})[_0xf419('0x2b')](function(_0x10794d){if(_0x10794d){return _0x10794d?{'count':_0x47dbce,'rows':_0x10794d}:null;}})[_0xf419('0x2b')](respondWithResult(_0x3f9e98,null))[_0xf419('0x4a')](handleError(_0x3f9e98,null));}; \ No newline at end of file +var _0x2854=['interface','flatMap','sequelize','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','compact','transaction','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','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','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','status','error','name','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserSmsQueue','User','findAndCountAll','UserId','smsPause','%s/%s','createdAt','getTeams','addTeams','ids','Team','online'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2854,0xaa));var _0x4285=function(_0x1cdded,_0x3f57b1){_0x1cdded=_0x1cdded-0x0;var _0xd5f1e=_0x2854[_0x1cdded];return _0xd5f1e;};'use strict';var emlformat=require(_0x4285('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4285('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4285('0x2'));var moment=require(_0x4285('0x3'));var BPromise=require(_0x4285('0x4'));var Mustache=require(_0x4285('0x5'));var util=require(_0x4285('0x6'));var path=require(_0x4285('0x7'));var sox=require(_0x4285('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4285('0x9'));var squel=require(_0x4285('0xa'));var crypto=require(_0x4285('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4285('0xc'));var toCsv=require(_0x4285('0xd'));var querystring=require('querystring');var Papa=require(_0x4285('0xe'));var Redis=require(_0x4285('0xf'));var authService=require(_0x4285('0x10'));var qs=require(_0x4285('0x11'));var as=require(_0x4285('0x12'));var hardwareService=require(_0x4285('0x13'));var logger=require(_0x4285('0x14'))(_0x4285('0x15'));var utils=require('../../config/utils');var config=require(_0x4285('0x16'));var licenseUtil=require(_0x4285('0x17'));var db=require(_0x4285('0x18'))['db'];config[_0x4285('0x19')]=_['defaults'](config[_0x4285('0x19')],{'host':_0x4285('0x1a'),'port':0x18eb});var socket=require(_0x4285('0x1b'))(new Redis(config[_0x4285('0x19')]));require('./smsQueue.socket')[_0x4285('0x1c')](socket);function respondWithStatusCode(_0x27da4c,_0x448d4f){_0x448d4f=_0x448d4f||0xcc;return function(_0x2cbba6){if(_0x2cbba6){return _0x27da4c[_0x4285('0x1d')](_0x448d4f);}return _0x27da4c['status'](_0x448d4f)[_0x4285('0x1e')]();};}function respondWithResult(_0x52b05b,_0x1e85a4){_0x1e85a4=_0x1e85a4||0xc8;return function(_0x4b4bd3){if(_0x4b4bd3){return _0x52b05b['status'](_0x1e85a4)[_0x4285('0x1f')](_0x4b4bd3);}};}function respondWithFilteredResult(_0x1e0385,_0x1a00b4){return function(_0x148673){if(_0x148673){var _0x376e35=typeof _0x1a00b4[_0x4285('0x20')]==='undefined'&&typeof _0x1a00b4[_0x4285('0x21')]===_0x4285('0x22');var _0x2ee578=_0x148673[_0x4285('0x23')];var _0x619fdf=_0x376e35?0x0:_0x1a00b4[_0x4285('0x20')];var _0x1667ea=_0x376e35?_0x148673[_0x4285('0x23')]:_0x1a00b4[_0x4285('0x20')]+_0x1a00b4[_0x4285('0x21')];var _0x2b19fd;if(_0x1667ea>=_0x2ee578){_0x1667ea=_0x2ee578;_0x2b19fd=0xc8;}else{_0x2b19fd=0xce;}_0x1e0385['status'](_0x2b19fd);return _0x1e0385[_0x4285('0x24')](_0x4285('0x25'),_0x619fdf+'-'+_0x1667ea+'/'+_0x2ee578)[_0x4285('0x1f')](_0x148673);}return null;};}function patchUpdates(_0x4d2559){return function(_0x2cfc4e){try{jsonpatch[_0x4285('0x26')](_0x2cfc4e,_0x4d2559,!![]);}catch(_0x34e6df){return BPromise[_0x4285('0x27')](_0x34e6df);}return _0x2cfc4e[_0x4285('0x28')]();};}function saveUpdates(_0xec0ceb,_0x5a87fb){return function(_0x309a7a){if(_0x309a7a){return _0x309a7a[_0x4285('0x29')](_0xec0ceb)[_0x4285('0x2a')](function(_0x39af8c){return _0x39af8c;});}return null;};}function removeEntity(_0x239897,_0x5a8b2e){return function(_0x1fa890){if(_0x1fa890){return _0x1fa890[_0x4285('0x2b')]()['then'](function(){var _0x1a1759=_0x1fa890[_0x4285('0x2c')]({'plain':!![]});var _0x1cb4e3=_0x4285('0x2d');return db['UserProfileResource'][_0x4285('0x2b')]({'where':{'type':_0x1cb4e3,'resourceId':_0x1a1759['id']}})[_0x4285('0x2a')](function(){return _0x1fa890;});})[_0x4285('0x2a')](function(){_0x239897[_0x4285('0x2e')](0xcc)[_0x4285('0x1e')]();});}};}function handleEntityNotFound(_0x2b4c6e,_0x2d0651){return function(_0x5d45f2){if(!_0x5d45f2){_0x2b4c6e['sendStatus'](0x194);}return _0x5d45f2;};}function handleError(_0x937f99,_0x366c34){_0x366c34=_0x366c34||0x1f4;return function(_0xc72c77){logger[_0x4285('0x2f')](_0xc72c77['stack']);if(_0xc72c77[_0x4285('0x30')]){delete _0xc72c77[_0x4285('0x30')];}_0x937f99[_0x4285('0x2e')](_0x366c34)['send'](_0xc72c77);};}exports[_0x4285('0x31')]=function(_0x3b33bb,_0x265f55){var _0xda374f={},_0x45e303={},_0x545702={'count':0x0,'rows':[]};var _0x5d7b80=_['map'](db[_0x4285('0x32')][_0x4285('0x33')],function(_0x2a47a7){return{'name':_0x2a47a7[_0x4285('0x34')],'type':_0x2a47a7[_0x4285('0x35')][_0x4285('0x36')]};});_0x45e303[_0x4285('0x37')]=_[_0x4285('0x38')](_0x5d7b80,'name');_0x45e303['query']=_[_0x4285('0x39')](_0x3b33bb[_0x4285('0x3a')]);_0x45e303[_0x4285('0x3b')]=_[_0x4285('0x3c')](_0x45e303[_0x4285('0x37')],_0x45e303['query']);_0xda374f[_0x4285('0x3d')]=_[_0x4285('0x3c')](_0x45e303[_0x4285('0x37')],qs[_0x4285('0x3e')](_0x3b33bb[_0x4285('0x3a')][_0x4285('0x3e')]));_0xda374f[_0x4285('0x3d')]=_0xda374f[_0x4285('0x3d')]['length']?_0xda374f[_0x4285('0x3d')]:_0x45e303['model'];if(!_0x3b33bb[_0x4285('0x3a')][_0x4285('0x3f')](_0x4285('0x40'))){_0xda374f[_0x4285('0x21')]=qs[_0x4285('0x21')](_0x3b33bb[_0x4285('0x3a')]['limit']);_0xda374f['offset']=qs[_0x4285('0x20')](_0x3b33bb[_0x4285('0x3a')][_0x4285('0x20')]);}_0xda374f[_0x4285('0x41')]=qs[_0x4285('0x42')](_0x3b33bb['query'][_0x4285('0x42')]);_0xda374f[_0x4285('0x43')]=qs['filters'](_[_0x4285('0x44')](_0x3b33bb['query'],_0x45e303[_0x4285('0x3b')]),_0x5d7b80);if(_0x3b33bb['query'][_0x4285('0x45')]){_0xda374f['where']=_['merge'](_0xda374f['where'],{'$or':_[_0x4285('0x38')](_0x5d7b80,function(_0x50679d){if(_0x50679d[_0x4285('0x35')]!==_0x4285('0x46')){var _0x505e6e={};_0x505e6e[_0x50679d['name']]={'$like':'%'+_0x3b33bb[_0x4285('0x3a')][_0x4285('0x45')]+'%'};return _0x505e6e;}})});}_0xda374f=_['merge']({},_0xda374f,_0x3b33bb[_0x4285('0x47')]);var _0x1e77ec={'where':_0xda374f['where']};return db[_0x4285('0x32')][_0x4285('0x23')](_0x1e77ec)[_0x4285('0x2a')](function(_0x54e7e6){_0x545702[_0x4285('0x23')]=_0x54e7e6;if(_0x3b33bb[_0x4285('0x3a')][_0x4285('0x48')]){_0xda374f[_0x4285('0x49')]=[{'all':!![]}];}return db[_0x4285('0x32')][_0x4285('0x4a')](_0xda374f);})['then'](function(_0x457b5b){_0x545702[_0x4285('0x4b')]=_0x457b5b;return _0x545702;})[_0x4285('0x2a')](respondWithFilteredResult(_0x265f55,_0xda374f))['catch'](handleError(_0x265f55,null));};exports[_0x4285('0x4c')]=function(_0x1b702f,_0x2ef886){var _0xedab7b={'raw':!![],'where':{'id':_0x1b702f[_0x4285('0x4d')]['id']}},_0x255f3e={};_0x255f3e[_0x4285('0x37')]=_[_0x4285('0x39')](db[_0x4285('0x32')][_0x4285('0x33')]);_0x255f3e[_0x4285('0x3a')]=_[_0x4285('0x39')](_0x1b702f[_0x4285('0x3a')]);_0x255f3e[_0x4285('0x3b')]=_[_0x4285('0x3c')](_0x255f3e[_0x4285('0x37')],_0x255f3e[_0x4285('0x3a')]);_0xedab7b[_0x4285('0x3d')]=_[_0x4285('0x3c')](_0x255f3e['model'],qs[_0x4285('0x3e')](_0x1b702f['query'][_0x4285('0x3e')]));_0xedab7b[_0x4285('0x3d')]=_0xedab7b[_0x4285('0x3d')][_0x4285('0x4e')]?_0xedab7b['attributes']:_0x255f3e[_0x4285('0x37')];if(_0x1b702f['query']['includeAll']){_0xedab7b[_0x4285('0x49')]=[{'all':!![]}];}_0xedab7b=_[_0x4285('0x4f')]({},_0xedab7b,_0x1b702f[_0x4285('0x47')]);return db[_0x4285('0x32')][_0x4285('0x50')](_0xedab7b)['then'](handleEntityNotFound(_0x2ef886,null))[_0x4285('0x2a')](respondWithResult(_0x2ef886,null))[_0x4285('0x51')](handleError(_0x2ef886,null));};exports[_0x4285('0x52')]=function(_0x1f9b1b,_0x4ebe4d){return db['SmsQueue'][_0x4285('0x52')](_0x1f9b1b[_0x4285('0x53')],{})[_0x4285('0x2a')](function(_0x66e630){var _0xd996ad=_0x1f9b1b[_0x4285('0x54')][_0x4285('0x2c')]({'plain':!![]});if(!_0xd996ad)throw new Error(_0x4285('0x55'));if(_0xd996ad[_0x4285('0x56')]===_0x4285('0x54')){var _0x4eeeda=_0x66e630[_0x4285('0x2c')]({'plain':!![]});var _0x2e3dc2=_0x4285('0x2d');return db[_0x4285('0x57')][_0x4285('0x50')]({'where':{'name':_0x2e3dc2,'userProfileId':_0xd996ad[_0x4285('0x58')]},'raw':!![]})['then'](function(_0x17b142){if(_0x17b142&&_0x17b142[_0x4285('0x59')]===0x0){return db[_0x4285('0x5a')][_0x4285('0x52')]({'name':_0x4eeeda[_0x4285('0x30')],'resourceId':_0x4eeeda['id'],'type':_0x17b142[_0x4285('0x30')],'sectionId':_0x17b142['id']},{})[_0x4285('0x2a')](function(){return _0x66e630;});}else{return _0x66e630;}})[_0x4285('0x51')](function(_0x5c0843){logger[_0x4285('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c0843);throw _0x5c0843;});}return _0x66e630;})[_0x4285('0x2a')](respondWithResult(_0x4ebe4d,0xc9))['catch'](handleError(_0x4ebe4d,null));};exports[_0x4285('0x29')]=function(_0x5e9d96,_0x20278b){if(_0x5e9d96[_0x4285('0x53')]['id']){delete _0x5e9d96[_0x4285('0x53')]['id'];}return db[_0x4285('0x32')][_0x4285('0x50')]({'where':{'id':_0x5e9d96['params']['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x20278b,null))[_0x4285('0x2a')](saveUpdates(_0x5e9d96['body'],null))[_0x4285('0x2a')](respondWithResult(_0x20278b,null))[_0x4285('0x51')](handleError(_0x20278b,null));};exports[_0x4285('0x2b')]=function(_0x34c1dc,_0x29e45){return db[_0x4285('0x32')]['find']({'where':{'id':_0x34c1dc['params']['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x29e45,null))[_0x4285('0x2a')](removeEntity(_0x29e45,null))['catch'](handleError(_0x29e45,null));};exports[_0x4285('0x5b')]=function(_0xd56e04,_0x20b436){return db['SmsQueue']['describe']()[_0x4285('0x2a')](respondWithResult(_0x20b436,null))[_0x4285('0x51')](handleError(_0x20b436,null));};exports[_0x4285('0x5c')]=function(_0x46a0c5,_0x3f0354,_0x4d6945){var _0x2a621e={'raw':!![],'where':{}},_0x3df090={},_0x4062a8;return db[_0x4285('0x32')][_0x4285('0x5d')]({'where':{'id':_0x46a0c5[_0x4285('0x4d')]['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x3f0354,null))[_0x4285('0x2a')](function(_0x2bbed8){if(_0x2bbed8){_0x4062a8=_0x2bbed8[_0x4285('0x2c')]({'plain':!![]});_0x3df090[_0x4285('0x37')]=_[_0x4285('0x39')](db['UserSmsQueue'][_0x4285('0x33')]);_0x3df090[_0x4285('0x3a')]=_[_0x4285('0x39')](_0x46a0c5[_0x4285('0x3a')]);_0x3df090[_0x4285('0x3b')]=_['intersection'](_0x3df090[_0x4285('0x37')],_0x3df090['query']);_0x2a621e[_0x4285('0x3d')]=_[_0x4285('0x3c')](_0x3df090[_0x4285('0x37')],qs[_0x4285('0x3e')](_0x46a0c5[_0x4285('0x3a')][_0x4285('0x3e')]));_0x2a621e[_0x4285('0x3d')]=_0x2a621e[_0x4285('0x3d')][_0x4285('0x4e')]?_0x2a621e[_0x4285('0x3d')]:_0x3df090[_0x4285('0x37')];if(!_0x46a0c5[_0x4285('0x3a')][_0x4285('0x3f')]('nolimit')){_0x2a621e[_0x4285('0x21')]=qs['limit'](_0x46a0c5[_0x4285('0x3a')][_0x4285('0x21')]);_0x2a621e[_0x4285('0x20')]=qs[_0x4285('0x20')](_0x46a0c5[_0x4285('0x3a')][_0x4285('0x20')]);}_0x2a621e[_0x4285('0x41')]=qs[_0x4285('0x42')](_0x46a0c5['query'][_0x4285('0x42')]);_0x2a621e[_0x4285('0x43')]=qs['filters'](_['pick'](_0x46a0c5[_0x4285('0x3a')],_0x3df090[_0x4285('0x3b')]));_0x2a621e['where']['SmsQueueId']=_0x2bbed8['id'];if(_0x46a0c5[_0x4285('0x3a')][_0x4285('0x45')]){_0x2a621e['where']=_['merge'](_0x2a621e['where'],{'$or':_['map'](_0x2a621e['attributes'],function(_0x4e45af){var _0x583e4d={};_0x583e4d[_0x4e45af]={'$like':'%'+_0x46a0c5[_0x4285('0x3a')][_0x4285('0x45')]+'%'};return _0x583e4d;})});}_0x2a621e=_[_0x4285('0x4f')]({},_0x2a621e,_0x46a0c5[_0x4285('0x47')]);return db[_0x4285('0x5e')][_0x4285('0x4a')](_0x2a621e);}})['then'](function(_0x52b281){if(_0x52b281){return db[_0x4285('0x5f')][_0x4285('0x60')]({'where':{'id':_[_0x4285('0x38')](_0x52b281,_0x4285('0x61')),'role':'agent'},'attributes':['id','name',_0x4285('0x62'),'updatedAt','createdAt']});}})[_0x4285('0x2a')](function(_0x39fc4b){if(_0x39fc4b){return{'count':_0x39fc4b[_0x4285('0x23')],'rows':_[_0x4285('0x38')](_0x39fc4b['rows'],function(_0x1ee6de){return{'membername':_0x1ee6de['name'],'UserId':_0x1ee6de['id'],'queue_name':_0x4062a8[_0x4285('0x30')],'SmsQueueId':_0x4062a8['id'],'interface':util['format'](_0x4285('0x63'),'SIP',_0x1ee6de[_0x4285('0x30')]),'penalty':0x0,'paused':_0x1ee6de[_0x4285('0x62')],'createdAt':_0x1ee6de[_0x4285('0x64')],'updatedAt':_0x1ee6de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4285('0x2a')](respondWithFilteredResult(_0x3f0354,_0x2a621e))[_0x4285('0x51')](handleError(_0x3f0354,null));};exports[_0x4285('0x65')]=function(_0x32f3c1,_0x55ee3b,_0x8d0caa){var _0x17636b={};var _0x1a05ae={};var _0x32afb8;var _0x354776;return db['SmsQueue'][_0x4285('0x5d')]({'where':{'id':_0x32f3c1[_0x4285('0x4d')]['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x55ee3b,null))['then'](function(_0x2eec74){if(_0x2eec74){_0x32afb8=_0x2eec74;_0x1a05ae[_0x4285('0x37')]=_['keys'](db['Team'][_0x4285('0x33')]);_0x1a05ae[_0x4285('0x3a')]=_['keys'](_0x32f3c1[_0x4285('0x3a')]);_0x1a05ae[_0x4285('0x3b')]=_[_0x4285('0x3c')](_0x1a05ae['model'],_0x1a05ae[_0x4285('0x3a')]);_0x17636b[_0x4285('0x3d')]=_[_0x4285('0x3c')](_0x1a05ae[_0x4285('0x37')],qs['fields'](_0x32f3c1[_0x4285('0x3a')][_0x4285('0x3e')]));_0x17636b[_0x4285('0x3d')]=_0x17636b['attributes'][_0x4285('0x4e')]?_0x17636b[_0x4285('0x3d')]:_0x1a05ae[_0x4285('0x37')];_0x17636b['order']=qs['sort'](_0x32f3c1[_0x4285('0x3a')]['sort']);_0x17636b['where']=qs[_0x4285('0x3b')](_[_0x4285('0x44')](_0x32f3c1[_0x4285('0x3a')],_0x1a05ae[_0x4285('0x3b')]));if(_0x32f3c1[_0x4285('0x3a')][_0x4285('0x45')]){_0x17636b[_0x4285('0x43')]=_[_0x4285('0x4f')](_0x17636b[_0x4285('0x43')],{'$or':_[_0x4285('0x38')](_0x17636b[_0x4285('0x3d')],function(_0x680679){var _0x1ffb7c={};_0x1ffb7c[_0x680679]={'$like':'%'+_0x32f3c1[_0x4285('0x3a')][_0x4285('0x45')]+'%'};return _0x1ffb7c;})});}_0x17636b=_[_0x4285('0x4f')]({},_0x17636b,_0x32f3c1[_0x4285('0x47')]);return _0x32afb8['getTeams'](_0x17636b);}})[_0x4285('0x2a')](function(_0x16828f){if(_0x16828f){_0x354776=_0x16828f['length'];if(!_0x32f3c1[_0x4285('0x3a')][_0x4285('0x3f')](_0x4285('0x40'))){_0x17636b['limit']=qs['limit'](_0x32f3c1[_0x4285('0x3a')][_0x4285('0x21')]);_0x17636b[_0x4285('0x20')]=qs['offset'](_0x32f3c1['query'][_0x4285('0x20')]);}return _0x32afb8[_0x4285('0x65')](_0x17636b);}})[_0x4285('0x2a')](function(_0x58872a){if(_0x58872a){return _0x58872a?{'count':_0x354776,'rows':_0x58872a}:null;}})[_0x4285('0x2a')](respondWithResult(_0x55ee3b,null))[_0x4285('0x51')](handleError(_0x55ee3b,null));};exports[_0x4285('0x66')]=function(_0x2cc24f,_0x21e0a6,_0x2d456d){var _0x1098fa=_0x2cc24f[_0x4285('0x53')][_0x4285('0x67')];return db[_0x4285('0x68')][_0x4285('0x4a')]({'where':{'id':_0x1098fa},'attributes':['id'],'include':[{'model':db[_0x4285('0x5f')],'as':'Agents','attributes':['id',_0x4285('0x30'),_0x4285('0x69'),'voicePause',_0x4285('0x6a')],'raw':!![]}]})[_0x4285('0x2a')](function(_0x542f35){if(_0x542f35){var _0x13a152=_[_0x4285('0x6b')](_0x542f35,function(_0x5e4c66){var _0x2dd7a4=_0x5e4c66[_0x4285('0x2c')]({'plain':!![]});return _0x2dd7a4['Agents'];});return db[_0x4285('0x32')][_0x4285('0x50')]({'where':{'id':_0x2cc24f['params']['id']}})[_0x4285('0x2a')](function(_0x12a8e8){return db[_0x4285('0x6c')]['transaction'](function(_0x22f8ac){return _0x12a8e8['addTeams'](_0x1098fa,{'transaction':_0x22f8ac})[_0x4285('0x2a')](function(){return BPromise['each'](_0x13a152,function(_0x39205e){return db[_0x4285('0x5e')]['findOrCreate']({'where':{'UserId':_0x39205e['id'],'SmsQueueId':_0x2cc24f[_0x4285('0x4d')]['id']},'transaction':_0x22f8ac});});})[_0x4285('0x2a')](function(){_0x13a152[_0x4285('0x6d')](function(_0x196729){socket[_0x4285('0x6e')](_0x4285('0x6f'),{'UserId':_0x196729['id'],'SmsQueueId':_0x12a8e8['id']});});});});});}})[_0x4285('0x2a')](respondWithStatusCode(_0x21e0a6,null))[_0x4285('0x51')](handleError(_0x21e0a6,null));};exports[_0x4285('0x70')]=function(_0x67044d,_0x2e9a79,_0x4bc9f1){return db[_0x4285('0x68')]['findAll']({'where':{'id':_0x67044d[_0x4285('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4285('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4285('0x2a')](handleEntityNotFound(_0x2e9a79,null))[_0x4285('0x2a')](function(_0x3172f2){var _0x427eda=_[_0x4285('0x38')](_0x3172f2,'id');var _0x2ad3e8=[];var _0x13b941=[];var _0x85ece4=squel[_0x4285('0x71')]();_0x85ece4[_0x4285('0x72')](_0x4285('0x73'))[_0x4285('0x74')]('team_has_sms_queues','tq')[_0x4285('0x75')]('user_has_teams','ut',_0x4285('0x76'))[_0x4285('0x43')](_0x4285('0x77'),_0x67044d['params']['id']);for(var _0xe50373=0x0;_0xe50373<_0x3172f2[_0x4285('0x4e')];_0xe50373+=0x1){let _0x312ebf=_0x3172f2[_0xe50373];for(var _0x1b9431=0x0;_0x1b9431<_0x312ebf[_0x4285('0x78')][_0x4285('0x4e')];_0x1b9431+=0x1){let _0x17cf4d=_0x312ebf[_0x4285('0x78')][_0x1b9431];var _0x4fd4fc=_0x85ece4[_0x4285('0x79')]();_0x4fd4fc[_0x4285('0x43')](_0x4285('0x7a'),_0x17cf4d['id']);_0x13b941['push'](db[_0x4285('0x6c')][_0x4285('0x3a')](_0x4fd4fc[_0x4285('0x7b')](),{'type':db['sequelize'][_0x4285('0x7c')][_0x4285('0x7d')]})[_0x4285('0x2a')](function(_0x5014d9){if(_0x5014d9[_0x4285('0x4e')]===0x1){return _0x17cf4d['id'];}else{var _0x17fb91=_[_0x4285('0x7e')](_[_0x4285('0x38')](_0x5014d9,_0x4285('0x7f')),function(_0x493081){return _[_0x4285('0x80')](_0x427eda,_0x493081);});if(_0x17fb91){return _0x17cf4d['id'];}}}));}}return BPromise['all'](_0x13b941)['then'](function(_0x227dc9){_0x2ad3e8=_(_0x2ad3e8)['union'](_0x227dc9)[_0x4285('0x81')]()['value']();return db[_0x4285('0x32')]['find']({'where':{'id':_0x67044d[_0x4285('0x4d')]['id']}})[_0x4285('0x2a')](function(_0x113814){return db[_0x4285('0x6c')][_0x4285('0x82')](function(_0x36d0ab){return _0x113814[_0x4285('0x70')](_0x67044d['query'][_0x4285('0x67')],{'transaction':_0x36d0ab})[_0x4285('0x2a')](function(){if(!_['isEmpty'](_0x2ad3e8)){return _0x113814[_0x4285('0x83')](_0x2ad3e8,{'transaction':_0x36d0ab});}})[_0x4285('0x2a')](function(){_0x2ad3e8['forEach'](function(_0x5f576e){socket[_0x4285('0x6e')](_0x4285('0x84'),{'UserId':_0x5f576e,'SmsQueueId':_0x113814['id']});});});});});});})[_0x4285('0x2a')](respondWithStatusCode(_0x2e9a79,null))[_0x4285('0x51')](handleError(_0x2e9a79,null));};exports[_0x4285('0x85')]=function(_0x1812ee,_0x5215b4,_0xa60bbe){return db[_0x4285('0x32')][_0x4285('0x50')]({'where':{'id':_0x1812ee[_0x4285('0x4d')]['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x5215b4,null))[_0x4285('0x2a')](function(_0x1ac7a4){if(_0x1ac7a4){return _0x1ac7a4[_0x4285('0x85')](_0x1812ee[_0x4285('0x53')][_0x4285('0x67')],_[_0x4285('0x86')](_0x1812ee[_0x4285('0x53')],[_0x4285('0x67'),'id'])||{})[_0x4285('0x87')](function(_0x4195b3){for(var _0x23b208=0x0;_0x23b208<_0x1812ee['body'][_0x4285('0x67')][_0x4285('0x4e')];_0x23b208+=0x1){socket[_0x4285('0x6e')](_0x4285('0x6f'),{'UserId':Number(_0x1812ee[_0x4285('0x53')][_0x4285('0x67')][_0x23b208]),'SmsQueueId':Number(_0x1812ee[_0x4285('0x4d')]['id'])});}return _0x4195b3;});}})[_0x4285('0x2a')](respondWithResult(_0x5215b4,null))[_0x4285('0x51')](handleError(_0x5215b4,null));};exports[_0x4285('0x83')]=function(_0x38e3d4,_0x539801,_0x393602){return db[_0x4285('0x32')][_0x4285('0x50')]({'where':{'id':_0x38e3d4[_0x4285('0x4d')]['id']}})['then'](handleEntityNotFound(_0x539801,null))[_0x4285('0x2a')](function(_0x283ad5){if(_0x283ad5){return _0x283ad5['removeAgents'](_0x38e3d4[_0x4285('0x3a')][_0x4285('0x67')])['then'](function(){if(_[_0x4285('0x88')](_0x38e3d4[_0x4285('0x3a')][_0x4285('0x67')])){for(var _0x2bc457=0x0;_0x2bc457<_0x38e3d4[_0x4285('0x3a')][_0x4285('0x67')][_0x4285('0x4e')];_0x2bc457+=0x1){socket[_0x4285('0x6e')](_0x4285('0x84'),{'UserId':Number(_0x38e3d4['query'][_0x4285('0x67')][_0x2bc457]),'SmsQueueId':Number(_0x38e3d4[_0x4285('0x4d')]['id'])});}}else{socket[_0x4285('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x38e3d4[_0x4285('0x3a')]['ids']),'SmsQueueId':Number(_0x38e3d4[_0x4285('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x539801,null))[_0x4285('0x51')](handleError(_0x539801,null));};exports[_0x4285('0x89')]=function(_0x3e9d96,_0x325764,_0x434093){var _0x4091b8={};var _0x5c339c={};var _0x2e40be;var _0x1b8bf2;return db[_0x4285('0x32')]['findOne']({'where':{'id':_0x3e9d96['params']['id']}})[_0x4285('0x2a')](handleEntityNotFound(_0x325764,null))[_0x4285('0x2a')](function(_0x33bb05){if(_0x33bb05){_0x2e40be=_0x33bb05;_0x5c339c[_0x4285('0x37')]=_[_0x4285('0x39')](db[_0x4285('0x5f')][_0x4285('0x33')]);_0x5c339c[_0x4285('0x3a')]=_[_0x4285('0x39')](_0x3e9d96[_0x4285('0x3a')]);_0x5c339c['filters']=_[_0x4285('0x3c')](_0x5c339c['model'],_0x5c339c[_0x4285('0x3a')]);_0x4091b8[_0x4285('0x3d')]=_[_0x4285('0x3c')](_0x5c339c[_0x4285('0x37')],qs[_0x4285('0x3e')](_0x3e9d96[_0x4285('0x3a')][_0x4285('0x3e')]));_0x4091b8[_0x4285('0x3d')]=_0x4091b8[_0x4285('0x3d')]['length']?_0x4091b8[_0x4285('0x3d')]:_0x5c339c[_0x4285('0x37')];_0x4091b8[_0x4285('0x41')]=qs[_0x4285('0x42')](_0x3e9d96[_0x4285('0x3a')]['sort']);_0x4091b8[_0x4285('0x43')]=qs['filters'](_['pick'](_0x3e9d96[_0x4285('0x3a')],_0x5c339c[_0x4285('0x3b')]));if(_0x3e9d96[_0x4285('0x3a')]['filter']){_0x4091b8[_0x4285('0x43')]=_['merge'](_0x4091b8[_0x4285('0x43')],{'$or':_[_0x4285('0x38')](_0x4091b8[_0x4285('0x3d')],function(_0x927d61){var _0xfcbfe3={};_0xfcbfe3[_0x927d61]={'$like':'%'+_0x3e9d96['query'][_0x4285('0x45')]+'%'};return _0xfcbfe3;})});}_0x4091b8=_[_0x4285('0x4f')]({},_0x4091b8,_0x3e9d96['options']);return _0x2e40be[_0x4285('0x89')](_0x4091b8);}})[_0x4285('0x2a')](function(_0x4643fd){if(_0x4643fd){_0x1b8bf2=_0x4643fd[_0x4285('0x4e')];if(!_0x3e9d96[_0x4285('0x3a')][_0x4285('0x3f')](_0x4285('0x40'))){_0x4091b8['limit']=qs['limit'](_0x3e9d96[_0x4285('0x3a')]['limit']);_0x4091b8['offset']=qs[_0x4285('0x20')](_0x3e9d96[_0x4285('0x3a')][_0x4285('0x20')]);}return _0x2e40be['getAgents'](_0x4091b8);}})['then'](function(_0x41f8ed){if(_0x41f8ed){return _0x41f8ed?{'count':_0x1b8bf2,'rows':_0x41f8ed}:null;}})[_0x4285('0x2a')](respondWithResult(_0x325764,null))[_0x4285('0x51')](handleError(_0x325764,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 2aa9b49..38301f0 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 _0xc759=['update','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0xc759,0xf2));var _0x9c75=function(_0x5a6e9f,_0x32ca3a){_0x5a6e9f=_0x5a6e9f-0x0;var _0x3e07d2=_0xc759[_0x5a6e9f];return _0x3e07d2;};'use strict';var EventEmitter=require(_0x9c75('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9c75('0x1')](0x0);var events={'afterCreate':_0x9c75('0x2'),'afterUpdate':_0x9c75('0x3'),'afterDestroy':'remove'};function emitEvent(_0x445d1a){return function(_0x1efea0,_0x1cfbc3,_0x2ed65e){SmsQueueEvents['emit'](_0x445d1a+':'+_0x1efea0['id'],_0x1efea0);SmsQueueEvents[_0x9c75('0x4')](_0x445d1a,_0x1efea0);_0x2ed65e(null);};}for(var e in events){if(events[_0x9c75('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x9c75('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xa057=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x5c2577,_0x2b3916){var _0x35cf7a=function(_0x3cdff3){while(--_0x3cdff3){_0x5c2577['push'](_0x5c2577['shift']());}};_0x35cf7a(++_0x2b3916);}(_0xa057,0x12d));var _0x7a05=function(_0x63fee2,_0x2eb830){_0x63fee2=_0x63fee2-0x0;var _0x5b8d3f=_0xa057[_0x63fee2];return _0x5b8d3f;};'use strict';var EventEmitter=require(_0x7a05('0x0'));var SmsQueue=require(_0x7a05('0x1'))['db'][_0x7a05('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7a05('0x3')](0x0);var events={'afterCreate':_0x7a05('0x4'),'afterUpdate':_0x7a05('0x5'),'afterDestroy':_0x7a05('0x6')};function emitEvent(_0x373b66){return function(_0x27f411,_0x7f67ba,_0x2ff52b){SmsQueueEvents[_0x7a05('0x7')](_0x373b66+':'+_0x27f411['id'],_0x27f411);SmsQueueEvents[_0x7a05('0x7')](_0x373b66,_0x27f411);_0x2ff52b(null);};}for(var e in events){if(events[_0x7a05('0x8')](e)){var event=events[e];SmsQueue[_0x7a05('0x9')](e,emitEvent(event));}}module[_0x7a05('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index d5c16ad..3d79960 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 _0xa8d9=['../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x351529,_0x299184){var _0x1e2c3f=function(_0x408a41){while(--_0x408a41){_0x351529['push'](_0x351529['shift']());}};_0x1e2c3f(++_0x299184);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa8d9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var logger=require(_0x9a8d('0x2'))(_0x9a8d('0x3'));var moment=require(_0x9a8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a8d('0x5'));var fs=require('fs');var path=require(_0x9a8d('0x6'));var rimraf=require('rimraf');var config=require(_0x9a8d('0x7'));var attributes=require(_0x9a8d('0x8'));module[_0x9a8d('0x9')]=function(_0x107151,_0x22d107){return _0x107151['define'](_0x9a8d('0xa'),attributes,{'tableName':_0x9a8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eea=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7eea,0x66));var _0xa7ee=function(_0x50f48c,_0x130c05){_0x50f48c=_0x50f48c-0x0;var _0x3b69d4=_0x7eea[_0x50f48c];return _0x3b69d4;};'use strict';var _=require('lodash');var util=require(_0xa7ee('0x0'));var logger=require(_0xa7ee('0x1'))(_0xa7ee('0x2'));var moment=require(_0xa7ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7ee('0x4'));var fs=require('fs');var path=require(_0xa7ee('0x5'));var rimraf=require(_0xa7ee('0x6'));var config=require(_0xa7ee('0x7'));var attributes=require(_0xa7ee('0x8'));module[_0xa7ee('0x9')]=function(_0x42b7bb,_0x12f53b){return _0x42b7bb[_0xa7ee('0xa')](_0xa7ee('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 9159f0e..b851547 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 _0xe514=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowSmsQueue','find','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe514,0x18f));var _0x4e51=function(_0x213938,_0x1d2bd7){_0x213938=_0x213938-0x0;var _0x5e5e34=_0xe514[_0x213938];return _0x5e5e34;};'use strict';var _=require('lodash');var util=require(_0x4e51('0x0'));var moment=require(_0x4e51('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e51('0x2'));var fs=require('fs');var Redis=require(_0x4e51('0x3'));var db=require(_0x4e51('0x4'))['db'];var utils=require(_0x4e51('0x5'));var logger=require(_0x4e51('0x6'))('rpc');var config=require(_0x4e51('0x7'));var jayson=require(_0x4e51('0x8'));var client=jayson[_0x4e51('0x9')]['http']({'port':0x232a});config[_0x4e51('0xa')]=_[_0x4e51('0xb')](config['redis'],{'host':_0x4e51('0xc'),'port':0x18eb});var socket=require(_0x4e51('0xd'))(new Redis(config[_0x4e51('0xa')]));require(_0x4e51('0xe'))[_0x4e51('0xf')](socket);function respondWithRpcPromise(_0x2933f6,_0x159213,_0xc86b01){return new BPromise(function(_0x4fbb94,_0x649a6c){return client[_0x4e51('0x10')](_0x2933f6,_0xc86b01)[_0x4e51('0x11')](function(_0x5d6f0f){logger[_0x4e51('0x12')](_0x4e51('0x13'),_0x159213,'request\x20sent');logger[_0x4e51('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x159213,_0x4e51('0x15'),JSON[_0x4e51('0x16')](_0x5d6f0f));if(_0x5d6f0f[_0x4e51('0x17')]){if(_0x5d6f0f['error']['code']===0x1f4){logger[_0x4e51('0x17')](_0x4e51('0x13'),_0x159213,_0x5d6f0f[_0x4e51('0x17')][_0x4e51('0x18')]);return _0x649a6c(_0x5d6f0f[_0x4e51('0x17')][_0x4e51('0x18')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x159213,_0x5d6f0f[_0x4e51('0x17')][_0x4e51('0x18')]);return _0x4fbb94(_0x5d6f0f[_0x4e51('0x17')][_0x4e51('0x18')]);}else{logger[_0x4e51('0x12')](_0x4e51('0x13'),_0x159213,_0x4e51('0x15'));_0x4fbb94(_0x5d6f0f[_0x4e51('0x19')][_0x4e51('0x18')]);}})[_0x4e51('0x1a')](function(_0x541223){logger[_0x4e51('0x17')]('SmsQueue,\x20%s,\x20%s',_0x159213,_0x541223);_0x649a6c(_0x541223);});});}exports[_0x4e51('0x1b')]=function(_0x2f1877){var _0x3195a8=this;return new Promise(function(_0x395750,_0x422faa){return db[_0x4e51('0x1c')][_0x4e51('0x1d')]({'raw':_0x2f1877['options']?_0x2f1877[_0x4e51('0x1e')][_0x4e51('0x1f')]===undefined?!![]:![]:!![],'where':_0x2f1877[_0x4e51('0x1e')]?_0x2f1877[_0x4e51('0x1e')][_0x4e51('0x20')]||null:null,'attributes':_0x2f1877[_0x4e51('0x1e')]?_0x2f1877[_0x4e51('0x1e')]['attributes']||null:null,'limit':_0x2f1877[_0x4e51('0x1e')]?_0x2f1877['options'][_0x4e51('0x21')]||null:null,'include':_0x2f1877['options']?_0x2f1877[_0x4e51('0x1e')][_0x4e51('0x22')]?_[_0x4e51('0x23')](_0x2f1877[_0x4e51('0x1e')]['include'],function(_0x4430ae){return{'model':db[_0x4430ae[_0x4e51('0x24')]],'as':_0x4430ae['as'],'attributes':_0x4430ae[_0x4e51('0x25')],'include':_0x4430ae['include']?_[_0x4e51('0x23')](_0x4430ae[_0x4e51('0x22')],function(_0x204604){return{'model':db[_0x204604[_0x4e51('0x24')]],'as':_0x204604['as'],'attributes':_0x204604[_0x4e51('0x25')],'include':_0x204604[_0x4e51('0x22')]?_[_0x4e51('0x23')](_0x204604['include'],function(_0xb5d3d7){return{'model':db[_0xb5d3d7['model']],'as':_0xb5d3d7['as'],'attributes':_0xb5d3d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e51('0x11')](function(_0x54362e){logger['info'](_0x4e51('0x1b'),_0x2f1877);logger['debug']('GetSmsQueue',_0x2f1877,JSON[_0x4e51('0x16')](_0x54362e));_0x395750(_0x54362e);})[_0x4e51('0x1a')](function(_0x20c9ce){logger[_0x4e51('0x17')](_0x4e51('0x1b'),_0x20c9ce[_0x4e51('0x18')],_0x2f1877);_0x422faa(_0x3195a8['error'](0x1f4,_0x20c9ce[_0x4e51('0x18')]));});});};exports[_0x4e51('0x26')]=function(_0x41c1c1){var _0x35bf9f=this;return new Promise(function(_0x20fe24,_0x5efe25){return db[_0x4e51('0x1c')][_0x4e51('0x27')]({'raw':_0x41c1c1['options']?_0x41c1c1['options'][_0x4e51('0x1f')]===undefined?!![]:![]:!![],'where':_0x41c1c1[_0x4e51('0x1e')]?_0x41c1c1[_0x4e51('0x1e')]['where']||null:null,'attributes':_0x41c1c1[_0x4e51('0x1e')]?_0x41c1c1[_0x4e51('0x1e')][_0x4e51('0x25')]||null:null,'include':_0x41c1c1[_0x4e51('0x1e')]?_0x41c1c1[_0x4e51('0x1e')]['include']?_[_0x4e51('0x23')](_0x41c1c1[_0x4e51('0x1e')][_0x4e51('0x22')],function(_0x4f93c9){return{'model':db[_0x4f93c9[_0x4e51('0x24')]],'as':_0x4f93c9['as'],'attributes':_0x4f93c9[_0x4e51('0x25')],'include':_0x4f93c9[_0x4e51('0x22')]?_[_0x4e51('0x23')](_0x4f93c9[_0x4e51('0x22')],function(_0x1cd373){return{'model':db[_0x1cd373[_0x4e51('0x24')]],'as':_0x1cd373['as'],'attributes':_0x1cd373['attributes'],'include':_0x1cd373['include']?_[_0x4e51('0x23')](_0x1cd373[_0x4e51('0x22')],function(_0x111cf9){return{'model':db[_0x111cf9[_0x4e51('0x24')]],'as':_0x111cf9['as'],'attributes':_0x111cf9[_0x4e51('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4e51('0x11')](function(_0x1f41dc){logger[_0x4e51('0x12')](_0x4e51('0x26'),_0x41c1c1);logger[_0x4e51('0x14')](_0x4e51('0x26'),_0x41c1c1,JSON[_0x4e51('0x16')](_0x1f41dc));_0x20fe24(_0x1f41dc);})['catch'](function(_0x1c9e22){logger[_0x4e51('0x17')](_0x4e51('0x26'),_0x1c9e22[_0x4e51('0x18')],_0x41c1c1);_0x5efe25(_0x35bf9f[_0x4e51('0x17')](0x1f4,_0x1c9e22[_0x4e51('0x18')]));});});}; \ No newline at end of file +var _0xef1e=['../../config/environment','jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','info','GetSmsQueue','find','where','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ce4e3,_0x42cb9a){var _0x42248f=function(_0x22ab0f){while(--_0x22ab0f){_0x5ce4e3['push'](_0x5ce4e3['shift']());}};_0x42248f(++_0x42cb9a);}(_0xef1e,0xa0));var _0xeef1=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xef1e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xeef1('0x0'));var util=require(_0xeef1('0x1'));var moment=require('moment');var BPromise=require(_0xeef1('0x2'));var rs=require(_0xeef1('0x3'));var fs=require('fs');var Redis=require(_0xeef1('0x4'));var db=require(_0xeef1('0x5'))['db'];var utils=require(_0xeef1('0x6'));var logger=require(_0xeef1('0x7'))('rpc');var config=require(_0xeef1('0x8'));var jayson=require(_0xeef1('0x9'));var client=jayson[_0xeef1('0xa')][_0xeef1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeef1('0xc')],{'host':_0xeef1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeef1('0xc')]));require(_0xeef1('0xe'))[_0xeef1('0xf')](socket);function respondWithRpcPromise(_0x50b2d8,_0x5b52bb,_0x4b734c){return new BPromise(function(_0x359cf5,_0x5acc5f){return client[_0xeef1('0x10')](_0x50b2d8,_0x4b734c)[_0xeef1('0x11')](function(_0x305cf5){logger['info'](_0xeef1('0x12'),_0x5b52bb,_0xeef1('0x13'));logger[_0xeef1('0x14')](_0xeef1('0x15'),_0x5b52bb,_0xeef1('0x13'),JSON[_0xeef1('0x16')](_0x305cf5));if(_0x305cf5[_0xeef1('0x17')]){if(_0x305cf5[_0xeef1('0x17')][_0xeef1('0x18')]===0x1f4){logger[_0xeef1('0x17')](_0xeef1('0x12'),_0x5b52bb,_0x305cf5['error'][_0xeef1('0x19')]);return _0x5acc5f(_0x305cf5['error'][_0xeef1('0x19')]);}logger[_0xeef1('0x17')](_0xeef1('0x12'),_0x5b52bb,_0x305cf5[_0xeef1('0x17')][_0xeef1('0x19')]);return _0x359cf5(_0x305cf5['error'][_0xeef1('0x19')]);}else{logger['info'](_0xeef1('0x12'),_0x5b52bb,_0xeef1('0x13'));_0x359cf5(_0x305cf5[_0xeef1('0x1a')][_0xeef1('0x19')]);}})[_0xeef1('0x1b')](function(_0x580590){logger[_0xeef1('0x17')]('SmsQueue,\x20%s,\x20%s',_0x5b52bb,_0x580590);_0x5acc5f(_0x580590);});});}exports['GetSmsQueue']=function(_0x397b35){var _0x45d156=this;return new Promise(function(_0x298983,_0x582834){return db[_0xeef1('0x1c')][_0xeef1('0x1d')]({'raw':_0x397b35[_0xeef1('0x1e')]?_0x397b35['options'][_0xeef1('0x1f')]===undefined?!![]:![]:!![],'where':_0x397b35[_0xeef1('0x1e')]?_0x397b35[_0xeef1('0x1e')]['where']||null:null,'attributes':_0x397b35[_0xeef1('0x1e')]?_0x397b35[_0xeef1('0x1e')][_0xeef1('0x20')]||null:null,'limit':_0x397b35['options']?_0x397b35[_0xeef1('0x1e')][_0xeef1('0x21')]||null:null,'include':_0x397b35[_0xeef1('0x1e')]?_0x397b35[_0xeef1('0x1e')][_0xeef1('0x22')]?_[_0xeef1('0x23')](_0x397b35[_0xeef1('0x1e')][_0xeef1('0x22')],function(_0x16d82d){return{'model':db[_0x16d82d[_0xeef1('0x24')]],'as':_0x16d82d['as'],'attributes':_0x16d82d[_0xeef1('0x20')],'include':_0x16d82d[_0xeef1('0x22')]?_['map'](_0x16d82d[_0xeef1('0x22')],function(_0x33f238){return{'model':db[_0x33f238[_0xeef1('0x24')]],'as':_0x33f238['as'],'attributes':_0x33f238[_0xeef1('0x20')],'include':_0x33f238['include']?_[_0xeef1('0x23')](_0x33f238['include'],function(_0x4283be){return{'model':db[_0x4283be['model']],'as':_0x4283be['as'],'attributes':_0x4283be[_0xeef1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x11')](function(_0x4c0e3c){logger[_0xeef1('0x25')]('GetSmsQueue',_0x397b35);logger[_0xeef1('0x14')](_0xeef1('0x26'),_0x397b35,JSON[_0xeef1('0x16')](_0x4c0e3c));_0x298983(_0x4c0e3c);})['catch'](function(_0x34982f){logger[_0xeef1('0x17')](_0xeef1('0x26'),_0x34982f[_0xeef1('0x19')],_0x397b35);_0x582834(_0x45d156[_0xeef1('0x17')](0x1f4,_0x34982f[_0xeef1('0x19')]));});});};exports['ShowSmsQueue']=function(_0xe12d0c){var _0x18bf51=this;return new Promise(function(_0x24c129,_0x2fd3f1){return db['SmsQueue'][_0xeef1('0x27')]({'raw':_0xe12d0c[_0xeef1('0x1e')]?_0xe12d0c[_0xeef1('0x1e')][_0xeef1('0x1f')]===undefined?!![]:![]:!![],'where':_0xe12d0c[_0xeef1('0x1e')]?_0xe12d0c['options'][_0xeef1('0x28')]||null:null,'attributes':_0xe12d0c['options']?_0xe12d0c[_0xeef1('0x1e')][_0xeef1('0x20')]||null:null,'include':_0xe12d0c[_0xeef1('0x1e')]?_0xe12d0c['options']['include']?_[_0xeef1('0x23')](_0xe12d0c['options']['include'],function(_0x1a1e0f){return{'model':db[_0x1a1e0f[_0xeef1('0x24')]],'as':_0x1a1e0f['as'],'attributes':_0x1a1e0f[_0xeef1('0x20')],'include':_0x1a1e0f['include']?_[_0xeef1('0x23')](_0x1a1e0f[_0xeef1('0x22')],function(_0x4eeb96){return{'model':db[_0x4eeb96['model']],'as':_0x4eeb96['as'],'attributes':_0x4eeb96['attributes'],'include':_0x4eeb96[_0xeef1('0x22')]?_[_0xeef1('0x23')](_0x4eeb96[_0xeef1('0x22')],function(_0x4b6f35){return{'model':db[_0x4b6f35[_0xeef1('0x24')]],'as':_0x4b6f35['as'],'attributes':_0x4b6f35[_0xeef1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d100a){logger[_0xeef1('0x25')](_0xeef1('0x29'),_0xe12d0c);logger[_0xeef1('0x14')](_0xeef1('0x29'),_0xe12d0c,JSON[_0xeef1('0x16')](_0x3d100a));_0x24c129(_0x3d100a);})['catch'](function(_0x52acfb){logger['error'](_0xeef1('0x29'),_0x52acfb[_0xeef1('0x19')],_0xe12d0c);_0x2fd3f1(_0x18bf51['error'](0x1f4,_0x52acfb[_0xeef1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 4b82b6c..9206231 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 _0x1f1e=['register','length','smsQueue:','save','remove','update','emit','removeListener'];(function(_0x5e7f4e,_0x5ac1ec){var _0x22f78a=function(_0x4600f0){while(--_0x4600f0){_0x5e7f4e['push'](_0x5e7f4e['shift']());}};_0x22f78a(++_0x5ac1ec);}(_0x1f1e,0xd3));var _0xe1f1=function(_0x4a8713,_0x1e1393){_0x4a8713=_0x4a8713-0x0;var _0x40c8a5=_0x1f1e[_0x4a8713];return _0x40c8a5;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe1f1('0x0'),_0xe1f1('0x1'),_0xe1f1('0x2')];function createListener(_0x27cdc8,_0xfca7c8){return function(_0x52e736){_0xfca7c8[_0xe1f1('0x3')](_0x27cdc8,_0x52e736);};}function removeListener(_0xf8a1f0,_0x1adfac){return function(){SmsQueueEvents[_0xe1f1('0x4')](_0xf8a1f0,_0x1adfac);};}exports[_0xe1f1('0x5')]=function(_0x6e8e33){for(var _0x2321e1=0x0,_0x27f226=events[_0xe1f1('0x6')];_0x2321e1<_0x27f226;_0x2321e1++){var _0x1931fb=events[_0x2321e1];var _0x227844=createListener(_0xe1f1('0x7')+_0x1931fb,_0x6e8e33);SmsQueueEvents['on'](_0x1931fb,_0x227844);}}; \ No newline at end of file +var _0x6b14=['./smsQueue.events','save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x15f434,_0xead979){var _0x5a9629=function(_0x3f2e34){while(--_0x3f2e34){_0x15f434['push'](_0x15f434['shift']());}};_0x5a9629(++_0xead979);}(_0x6b14,0xb4));var _0x46b1=function(_0xb5b5b5,_0x30eb84){_0xb5b5b5=_0xb5b5b5-0x0;var _0x24f331=_0x6b14[_0xb5b5b5];return _0x24f331;};'use strict';var SmsQueueEvents=require(_0x46b1('0x0'));var events=[_0x46b1('0x1'),_0x46b1('0x2'),_0x46b1('0x3')];function createListener(_0x2f43cc,_0x455437){return function(_0x1ab473){_0x455437[_0x46b1('0x4')](_0x2f43cc,_0x1ab473);};}function removeListener(_0x105ab6,_0x3c15a3){return function(){SmsQueueEvents[_0x46b1('0x5')](_0x105ab6,_0x3c15a3);};}exports[_0x46b1('0x6')]=function(_0x34efe1){for(var _0x245815=0x0,_0x4a6bd5=events[_0x46b1('0x7')];_0x245815<_0x4a6bd5;_0x245815++){var _0x47e7f5=events[_0x245815];var _0x10a123=createListener(_0x46b1('0x8')+_0x47e7f5,_0x34efe1);SmsQueueEvents['on'](_0x47e7f5,_0x10a123);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 384089c..2817447 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 _0x4886=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/:id','show','post','create','put','delete'];(function(_0x2a8971,_0x38e53f){var _0x16911f=function(_0x8b96c3){while(--_0x8b96c3){_0x2a8971['push'](_0x2a8971['shift']());}};_0x16911f(++_0x38e53f);}(_0x4886,0x122));var _0x6488=function(_0xd3259d,_0x7bece6){_0xd3259d=_0xd3259d-0x0;var _0xefac6c=_0x4886[_0xd3259d];return _0xefac6c;};'use strict';var multer=require(_0x6488('0x0'));var util=require('util');var path=require(_0x6488('0x1'));var timeout=require(_0x6488('0x2'));var express=require(_0x6488('0x3'));var router=express['Router']();var fs_extra=require(_0x6488('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6488('0x5'));var config=require(_0x6488('0x6'));var controller=require(_0x6488('0x7'));router['get']('/',auth[_0x6488('0x8')](),controller['index']);router[_0x6488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6488('0x9')](_0x6488('0xa'),auth[_0x6488('0x8')](),controller[_0x6488('0xb')]);router[_0x6488('0xc')]('/',auth[_0x6488('0x8')](),controller[_0x6488('0xd')]);router[_0x6488('0xe')](_0x6488('0xa'),auth[_0x6488('0x8')](),controller['update']);router[_0x6488('0xf')](_0x6488('0xa'),auth['isAuthenticated'](),controller[_0x6488('0x10')]);module[_0x6488('0x11')]=router; \ No newline at end of file +var _0xea1c=['create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x134bfc,_0x144d5f){var _0x2f4dcc=function(_0x56cf22){while(--_0x56cf22){_0x134bfc['push'](_0x134bfc['shift']());}};_0x2f4dcc(++_0x144d5f);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcea1('0x0'));var timeout=require(_0xcea1('0x1'));var express=require(_0xcea1('0x2'));var router=express[_0xcea1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcea1('0x4'));var interaction=require(_0xcea1('0x5'));var config=require(_0xcea1('0x6'));var controller=require(_0xcea1('0x7'));router[_0xcea1('0x8')]('/',auth[_0xcea1('0x9')](),controller[_0xcea1('0xa')]);router[_0xcea1('0x8')](_0xcea1('0xb'),auth[_0xcea1('0x9')](),controller[_0xcea1('0xc')]);router['get'](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0xe')]);router['post']('/',auth[_0xcea1('0x9')](),controller[_0xcea1('0xf')]);router[_0xcea1('0x10')](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x11')]);router[_0xcea1('0x12')](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x13')]);module[_0xcea1('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a8235e7..5ca3031 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 _0x2ab6=['STRING','DATE','moment'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x2ab6,0xa7));var _0x62ab=function(_0x49f27c,_0x23bc8f){_0x49f27c=_0x49f27c-0x0;var _0x22b4c7=_0x2ab6[_0x49f27c];return _0x22b4c7;};'use strict';var moment=require(_0x62ab('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x62ab('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x62ab('0x1')]},'joinAt':{'type':Sequelize[_0x62ab('0x2')]},'leaveAt':{'type':Sequelize[_0x62ab('0x2')]},'acceptAt':{'type':Sequelize[_0x62ab('0x2')]},'exitAt':{'type':Sequelize[_0x62ab('0x2')]},'reason':{'type':Sequelize[_0x62ab('0x1')]}}; \ No newline at end of file +var _0x6cae=['moment','sequelize','STRING','DATE'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x6cae,0xf0));var _0xe6ca=function(_0x4d9f1c,_0x43f844){_0x4d9f1c=_0x4d9f1c-0x0;var _0x113393=_0x6cae[_0x4d9f1c];return _0x113393;};'use strict';var moment=require(_0xe6ca('0x0'));var Sequelize=require(_0xe6ca('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe6ca('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe6ca('0x2')]},'joinAt':{'type':Sequelize[_0xe6ca('0x3')]},'leaveAt':{'type':Sequelize[_0xe6ca('0x3')]},'acceptAt':{'type':Sequelize[_0xe6ca('0x3')]},'exitAt':{'type':Sequelize[_0xe6ca('0x3')]},'reason':{'type':Sequelize[_0xe6ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index fe63a93..2b8d716 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 _0x11df=['options','includeAll','catch','params','keys','fields','create','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsQueueReport','rawAttributes','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL'];(function(_0x9b771a,_0x7669b7){var _0x111a32=function(_0x231751){while(--_0x231751){_0x9b771a['push'](_0x9b771a['shift']());}};_0x111a32(++_0x7669b7);}(_0x11df,0x126));var _0xf11d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x11df[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf11d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf11d('0x1'));var rp=require(_0xf11d('0x2'));var moment=require('moment');var BPromise=require(_0xf11d('0x3'));var Mustache=require(_0xf11d('0x4'));var util=require(_0xf11d('0x5'));var path=require(_0xf11d('0x6'));var sox=require('sox');var csv=require(_0xf11d('0x7'));var ejs=require(_0xf11d('0x8'));var fs=require('fs');var fs_extra=require(_0xf11d('0x9'));var _=require(_0xf11d('0xa'));var squel=require(_0xf11d('0xb'));var crypto=require(_0xf11d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf11d('0xd'));var toCsv=require(_0xf11d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf11d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf11d('0xf'));var as=require(_0xf11d('0x10'));var hardwareService=require(_0xf11d('0x11'));var logger=require(_0xf11d('0x12'))(_0xf11d('0x13'));var utils=require(_0xf11d('0x14'));var config=require(_0xf11d('0x15'));var licenseUtil=require(_0xf11d('0x16'));var db=require(_0xf11d('0x17'))['db'];function respondWithStatusCode(_0x34f766,_0x8391b2){_0x8391b2=_0x8391b2||0xcc;return function(_0x550426){if(_0x550426){return _0x34f766[_0xf11d('0x18')](_0x8391b2);}return _0x34f766[_0xf11d('0x19')](_0x8391b2)[_0xf11d('0x1a')]();};}function respondWithResult(_0x21c3d9,_0xb19501){_0xb19501=_0xb19501||0xc8;return function(_0x5b0da5){if(_0x5b0da5){return _0x21c3d9[_0xf11d('0x19')](_0xb19501)[_0xf11d('0x1b')](_0x5b0da5);}};}function respondWithFilteredResult(_0x13775c,_0x41dcc9){return function(_0x42a6b0){if(_0x42a6b0){var _0xcab262=typeof _0x41dcc9[_0xf11d('0x1c')]===_0xf11d('0x1d')&&typeof _0x41dcc9[_0xf11d('0x1e')]===_0xf11d('0x1d');var _0xf9dd38=_0x42a6b0[_0xf11d('0x1f')];var _0x1bbe61=_0xcab262?0x0:_0x41dcc9[_0xf11d('0x1c')];var _0x12ec77=_0xcab262?_0x42a6b0[_0xf11d('0x1f')]:_0x41dcc9[_0xf11d('0x1c')]+_0x41dcc9[_0xf11d('0x1e')];var _0x51ee68;if(_0x12ec77>=_0xf9dd38){_0x12ec77=_0xf9dd38;_0x51ee68=0xc8;}else{_0x51ee68=0xce;}_0x13775c[_0xf11d('0x19')](_0x51ee68);return _0x13775c[_0xf11d('0x20')]('Content-Range',_0x1bbe61+'-'+_0x12ec77+'/'+_0xf9dd38)[_0xf11d('0x1b')](_0x42a6b0);}return null;};}function patchUpdates(_0x19114c){return function(_0x26fe9e){try{jsonpatch[_0xf11d('0x21')](_0x26fe9e,_0x19114c,!![]);}catch(_0x34cf87){return BPromise[_0xf11d('0x22')](_0x34cf87);}return _0x26fe9e[_0xf11d('0x23')]();};}function saveUpdates(_0x1a8dde,_0x2de586){return function(_0x3c6fe0){if(_0x3c6fe0){return _0x3c6fe0[_0xf11d('0x24')](_0x1a8dde)[_0xf11d('0x25')](function(_0x2ffc7d){return _0x2ffc7d;});}return null;};}function removeEntity(_0x1f494e,_0x257ea8){return function(_0x4df4e6){if(_0x4df4e6){return _0x4df4e6[_0xf11d('0x26')]()[_0xf11d('0x25')](function(){_0x1f494e[_0xf11d('0x19')](0xcc)[_0xf11d('0x1a')]();});}};}function handleEntityNotFound(_0xbe39a9,_0x46d6b6){return function(_0x43a374){if(!_0x43a374){_0xbe39a9[_0xf11d('0x18')](0x194);}return _0x43a374;};}function handleError(_0x56572f,_0x4a5ffd){_0x4a5ffd=_0x4a5ffd||0x1f4;return function(_0x21a935){logger[_0xf11d('0x27')](_0x21a935[_0xf11d('0x28')]);if(_0x21a935[_0xf11d('0x29')]){delete _0x21a935[_0xf11d('0x29')];}_0x56572f[_0xf11d('0x19')](_0x4a5ffd)[_0xf11d('0x2a')](_0x21a935);};}exports['index']=function(_0x151b66,_0x32465f){var _0x4e01b9={},_0x1c3201={},_0x579718={'count':0x0,'rows':[]};var _0xaabc06=_[_0xf11d('0x2b')](db[_0xf11d('0x2c')][_0xf11d('0x2d')],function(_0x31c3be){return{'name':_0x31c3be['fieldName'],'type':_0x31c3be['type'][_0xf11d('0x2e')]};});_0x1c3201[_0xf11d('0x2f')]=_[_0xf11d('0x2b')](_0xaabc06,_0xf11d('0x29'));_0x1c3201[_0xf11d('0x30')]=_['keys'](_0x151b66[_0xf11d('0x30')]);_0x1c3201['filters']=_[_0xf11d('0x31')](_0x1c3201[_0xf11d('0x2f')],_0x1c3201[_0xf11d('0x30')]);_0x4e01b9[_0xf11d('0x32')]=_['intersection'](_0x1c3201[_0xf11d('0x2f')],qs['fields'](_0x151b66['query']['fields']));_0x4e01b9[_0xf11d('0x32')]=_0x4e01b9[_0xf11d('0x32')][_0xf11d('0x33')]?_0x4e01b9[_0xf11d('0x32')]:_0x1c3201['model'];if(!_0x151b66['query'][_0xf11d('0x34')](_0xf11d('0x35'))){_0x4e01b9['limit']=qs[_0xf11d('0x1e')](_0x151b66[_0xf11d('0x30')][_0xf11d('0x1e')]);_0x4e01b9[_0xf11d('0x1c')]=qs['offset'](_0x151b66[_0xf11d('0x30')][_0xf11d('0x1c')]);}_0x4e01b9[_0xf11d('0x36')]=qs['sort'](_0x151b66[_0xf11d('0x30')][_0xf11d('0x37')]);_0x4e01b9['where']=qs['filters'](_[_0xf11d('0x38')](_0x151b66[_0xf11d('0x30')],_0x1c3201[_0xf11d('0x39')]),_0xaabc06);if(_0x151b66[_0xf11d('0x30')][_0xf11d('0x3a')]){_0x4e01b9[_0xf11d('0x3b')]=_['merge'](_0x4e01b9[_0xf11d('0x3b')],{'$or':_['map'](_0xaabc06,function(_0x15170f){if(_0x15170f['type']!==_0xf11d('0x3c')){var _0x44fa72={};_0x44fa72[_0x15170f[_0xf11d('0x29')]]={'$like':'%'+_0x151b66[_0xf11d('0x30')][_0xf11d('0x3a')]+'%'};return _0x44fa72;}})});}_0x4e01b9=_['merge']({},_0x4e01b9,_0x151b66[_0xf11d('0x3d')]);var _0x2ab5b5={'where':_0x4e01b9[_0xf11d('0x3b')]};return db['SmsQueueReport'][_0xf11d('0x1f')](_0x2ab5b5)[_0xf11d('0x25')](function(_0x5da08c){_0x579718[_0xf11d('0x1f')]=_0x5da08c;if(_0x151b66['query'][_0xf11d('0x3e')]){_0x4e01b9['include']=[{'all':!![]}];}return db[_0xf11d('0x2c')]['findAll'](_0x4e01b9);})['then'](function(_0x110aa8){_0x579718['rows']=_0x110aa8;return _0x579718;})[_0xf11d('0x25')](respondWithFilteredResult(_0x32465f,_0x4e01b9))[_0xf11d('0x3f')](handleError(_0x32465f,null));};exports['show']=function(_0xe1b3ff,_0x4cf6c5){var _0x2bfd1b={'raw':!![],'where':{'id':_0xe1b3ff[_0xf11d('0x40')]['id']}},_0x453d84={};_0x453d84['model']=_[_0xf11d('0x41')](db[_0xf11d('0x2c')]['rawAttributes']);_0x453d84[_0xf11d('0x30')]=_['keys'](_0xe1b3ff['query']);_0x453d84['filters']=_[_0xf11d('0x31')](_0x453d84['model'],_0x453d84['query']);_0x2bfd1b[_0xf11d('0x32')]=_[_0xf11d('0x31')](_0x453d84[_0xf11d('0x2f')],qs[_0xf11d('0x42')](_0xe1b3ff['query'][_0xf11d('0x42')]));_0x2bfd1b[_0xf11d('0x32')]=_0x2bfd1b[_0xf11d('0x32')]['length']?_0x2bfd1b[_0xf11d('0x32')]:_0x453d84[_0xf11d('0x2f')];if(_0xe1b3ff['query']['includeAll']){_0x2bfd1b['include']=[{'all':!![]}];}_0x2bfd1b=_['merge']({},_0x2bfd1b,_0xe1b3ff['options']);return db[_0xf11d('0x2c')]['find'](_0x2bfd1b)[_0xf11d('0x25')](handleEntityNotFound(_0x4cf6c5,null))[_0xf11d('0x25')](respondWithResult(_0x4cf6c5,null))[_0xf11d('0x3f')](handleError(_0x4cf6c5,null));};exports['create']=function(_0x154e6a,_0x473f3e){return db[_0xf11d('0x2c')][_0xf11d('0x43')](_0x154e6a[_0xf11d('0x44')],{})[_0xf11d('0x25')](respondWithResult(_0x473f3e,0xc9))[_0xf11d('0x3f')](handleError(_0x473f3e,null));};exports[_0xf11d('0x24')]=function(_0x367fea,_0x56d75a){if(_0x367fea[_0xf11d('0x44')]['id']){delete _0x367fea[_0xf11d('0x44')]['id'];}return db[_0xf11d('0x2c')]['find']({'where':{'id':_0x367fea[_0xf11d('0x40')]['id']}})[_0xf11d('0x25')](handleEntityNotFound(_0x56d75a,null))[_0xf11d('0x25')](saveUpdates(_0x367fea[_0xf11d('0x44')],null))['then'](respondWithResult(_0x56d75a,null))[_0xf11d('0x3f')](handleError(_0x56d75a,null));};exports['destroy']=function(_0xc7b9d4,_0x1b602a){return db['SmsQueueReport'][_0xf11d('0x45')]({'where':{'id':_0xc7b9d4[_0xf11d('0x40')]['id']}})[_0xf11d('0x25')](handleEntityNotFound(_0x1b602a,null))[_0xf11d('0x25')](removeEntity(_0x1b602a,null))['catch'](handleError(_0x1b602a,null));};exports['describe']=function(_0x30d5a7,_0xcda7a5){return db['SmsQueueReport'][_0xf11d('0x46')]()[_0xf11d('0x25')](respondWithResult(_0xcda7a5,null))[_0xf11d('0x3f')](handleError(_0xcda7a5,null));}; \ No newline at end of file +var _0x416b=['create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','catch','show','params','keys','include'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0x416b,0xec));var _0xb416=function(_0x101152,_0x397ab0){_0x101152=_0x101152-0x0;var _0xe1c465=_0x416b[_0x101152];return _0xe1c465;};'use strict';var emlformat=require(_0xb416('0x0'));var rimraf=require(_0xb416('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb416('0x2'));var rp=require(_0xb416('0x3'));var moment=require(_0xb416('0x4'));var BPromise=require(_0xb416('0x5'));var Mustache=require(_0xb416('0x6'));var util=require(_0xb416('0x7'));var path=require('path');var sox=require(_0xb416('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb416('0x9'));var _=require(_0xb416('0xa'));var squel=require(_0xb416('0xb'));var crypto=require(_0xb416('0xc'));var jsforce=require(_0xb416('0xd'));var deskjs=require(_0xb416('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb416('0xf'));var Papa=require(_0xb416('0x10'));var Redis=require(_0xb416('0x11'));var authService=require(_0xb416('0x12'));var qs=require(_0xb416('0x13'));var as=require(_0xb416('0x14'));var hardwareService=require(_0xb416('0x15'));var logger=require('../../config/logger')(_0xb416('0x16'));var utils=require(_0xb416('0x17'));var config=require(_0xb416('0x18'));var licenseUtil=require(_0xb416('0x19'));var db=require(_0xb416('0x1a'))['db'];function respondWithStatusCode(_0x1f4618,_0xfa3033){_0xfa3033=_0xfa3033||0xcc;return function(_0x4b10f9){if(_0x4b10f9){return _0x1f4618[_0xb416('0x1b')](_0xfa3033);}return _0x1f4618['status'](_0xfa3033)['end']();};}function respondWithResult(_0x55bfd5,_0x59f8f3){_0x59f8f3=_0x59f8f3||0xc8;return function(_0x5385c1){if(_0x5385c1){return _0x55bfd5[_0xb416('0x1c')](_0x59f8f3)['json'](_0x5385c1);}};}function respondWithFilteredResult(_0x5c48f1,_0x53ffcf){return function(_0x299002){if(_0x299002){var _0x1130be=typeof _0x53ffcf[_0xb416('0x1d')]===_0xb416('0x1e')&&typeof _0x53ffcf[_0xb416('0x1f')]===_0xb416('0x1e');var _0x4a2f06=_0x299002[_0xb416('0x20')];var _0x5246be=_0x1130be?0x0:_0x53ffcf[_0xb416('0x1d')];var _0x2da8cc=_0x1130be?_0x299002[_0xb416('0x20')]:_0x53ffcf[_0xb416('0x1d')]+_0x53ffcf['limit'];var _0x31cc57;if(_0x2da8cc>=_0x4a2f06){_0x2da8cc=_0x4a2f06;_0x31cc57=0xc8;}else{_0x31cc57=0xce;}_0x5c48f1['status'](_0x31cc57);return _0x5c48f1[_0xb416('0x21')]('Content-Range',_0x5246be+'-'+_0x2da8cc+'/'+_0x4a2f06)[_0xb416('0x22')](_0x299002);}return null;};}function patchUpdates(_0xafc5e1){return function(_0x50be9b){try{jsonpatch[_0xb416('0x23')](_0x50be9b,_0xafc5e1,!![]);}catch(_0x1d66cf){return BPromise[_0xb416('0x24')](_0x1d66cf);}return _0x50be9b[_0xb416('0x25')]();};}function saveUpdates(_0x406910,_0x3346e8){return function(_0x4792ab){if(_0x4792ab){return _0x4792ab['update'](_0x406910)[_0xb416('0x26')](function(_0x37655d){return _0x37655d;});}return null;};}function removeEntity(_0x3ee9ce,_0x2af008){return function(_0x3bdd1c){if(_0x3bdd1c){return _0x3bdd1c[_0xb416('0x27')]()[_0xb416('0x26')](function(){_0x3ee9ce[_0xb416('0x1c')](0xcc)[_0xb416('0x28')]();});}};}function handleEntityNotFound(_0x55815e,_0x730b97){return function(_0x28e7b7){if(!_0x28e7b7){_0x55815e['sendStatus'](0x194);}return _0x28e7b7;};}function handleError(_0x298c61,_0x491aad){_0x491aad=_0x491aad||0x1f4;return function(_0x82e0bb){logger[_0xb416('0x29')](_0x82e0bb[_0xb416('0x2a')]);if(_0x82e0bb[_0xb416('0x2b')]){delete _0x82e0bb[_0xb416('0x2b')];}_0x298c61['status'](_0x491aad)[_0xb416('0x2c')](_0x82e0bb);};}exports[_0xb416('0x2d')]=function(_0x2bb552,_0x35c748){var _0x2f6617={},_0x587f2a={},_0x149de8={'count':0x0,'rows':[]};var _0xc42406=_[_0xb416('0x2e')](db[_0xb416('0x2f')][_0xb416('0x30')],function(_0x3c0587){return{'name':_0x3c0587['fieldName'],'type':_0x3c0587[_0xb416('0x31')][_0xb416('0x32')]};});_0x587f2a[_0xb416('0x33')]=_[_0xb416('0x2e')](_0xc42406,_0xb416('0x2b'));_0x587f2a[_0xb416('0x34')]=_['keys'](_0x2bb552[_0xb416('0x34')]);_0x587f2a[_0xb416('0x35')]=_[_0xb416('0x36')](_0x587f2a[_0xb416('0x33')],_0x587f2a[_0xb416('0x34')]);_0x2f6617[_0xb416('0x37')]=_[_0xb416('0x36')](_0x587f2a['model'],qs[_0xb416('0x38')](_0x2bb552[_0xb416('0x34')][_0xb416('0x38')]));_0x2f6617[_0xb416('0x37')]=_0x2f6617['attributes'][_0xb416('0x39')]?_0x2f6617[_0xb416('0x37')]:_0x587f2a[_0xb416('0x33')];if(!_0x2bb552[_0xb416('0x34')][_0xb416('0x3a')]('nolimit')){_0x2f6617['limit']=qs[_0xb416('0x1f')](_0x2bb552[_0xb416('0x34')][_0xb416('0x1f')]);_0x2f6617[_0xb416('0x1d')]=qs[_0xb416('0x1d')](_0x2bb552[_0xb416('0x34')][_0xb416('0x1d')]);}_0x2f6617[_0xb416('0x3b')]=qs[_0xb416('0x3c')](_0x2bb552['query']['sort']);_0x2f6617[_0xb416('0x3d')]=qs[_0xb416('0x35')](_[_0xb416('0x3e')](_0x2bb552[_0xb416('0x34')],_0x587f2a[_0xb416('0x35')]),_0xc42406);if(_0x2bb552['query']['filter']){_0x2f6617['where']=_[_0xb416('0x3f')](_0x2f6617[_0xb416('0x3d')],{'$or':_[_0xb416('0x2e')](_0xc42406,function(_0x52f92d){if(_0x52f92d[_0xb416('0x31')]!=='VIRTUAL'){var _0x31bfef={};_0x31bfef[_0x52f92d['name']]={'$like':'%'+_0x2bb552['query'][_0xb416('0x40')]+'%'};return _0x31bfef;}})});}_0x2f6617=_[_0xb416('0x3f')]({},_0x2f6617,_0x2bb552[_0xb416('0x41')]);var _0x1f42d2={'where':_0x2f6617['where']};return db[_0xb416('0x2f')][_0xb416('0x20')](_0x1f42d2)[_0xb416('0x26')](function(_0x524552){_0x149de8['count']=_0x524552;if(_0x2bb552[_0xb416('0x34')][_0xb416('0x42')]){_0x2f6617['include']=[{'all':!![]}];}return db[_0xb416('0x2f')]['findAll'](_0x2f6617);})[_0xb416('0x26')](function(_0x5a9aa2){_0x149de8['rows']=_0x5a9aa2;return _0x149de8;})[_0xb416('0x26')](respondWithFilteredResult(_0x35c748,_0x2f6617))[_0xb416('0x43')](handleError(_0x35c748,null));};exports[_0xb416('0x44')]=function(_0x406ed4,_0x111f09){var _0xf59583={'raw':!![],'where':{'id':_0x406ed4[_0xb416('0x45')]['id']}},_0x17747e={};_0x17747e['model']=_[_0xb416('0x46')](db['SmsQueueReport']['rawAttributes']);_0x17747e[_0xb416('0x34')]=_['keys'](_0x406ed4[_0xb416('0x34')]);_0x17747e['filters']=_['intersection'](_0x17747e['model'],_0x17747e[_0xb416('0x34')]);_0xf59583['attributes']=_[_0xb416('0x36')](_0x17747e[_0xb416('0x33')],qs[_0xb416('0x38')](_0x406ed4['query'][_0xb416('0x38')]));_0xf59583[_0xb416('0x37')]=_0xf59583[_0xb416('0x37')]['length']?_0xf59583['attributes']:_0x17747e[_0xb416('0x33')];if(_0x406ed4[_0xb416('0x34')][_0xb416('0x42')]){_0xf59583[_0xb416('0x47')]=[{'all':!![]}];}_0xf59583=_['merge']({},_0xf59583,_0x406ed4['options']);return db['SmsQueueReport']['find'](_0xf59583)[_0xb416('0x26')](handleEntityNotFound(_0x111f09,null))['then'](respondWithResult(_0x111f09,null))[_0xb416('0x43')](handleError(_0x111f09,null));};exports[_0xb416('0x48')]=function(_0x1a29e3,_0x2d1e48){return db['SmsQueueReport'][_0xb416('0x48')](_0x1a29e3[_0xb416('0x49')],{})[_0xb416('0x26')](respondWithResult(_0x2d1e48,0xc9))['catch'](handleError(_0x2d1e48,null));};exports[_0xb416('0x4a')]=function(_0x2be3d8,_0x5854f5){if(_0x2be3d8[_0xb416('0x49')]['id']){delete _0x2be3d8['body']['id'];}return db[_0xb416('0x2f')][_0xb416('0x4b')]({'where':{'id':_0x2be3d8[_0xb416('0x45')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x5854f5,null))[_0xb416('0x26')](saveUpdates(_0x2be3d8['body'],null))[_0xb416('0x26')](respondWithResult(_0x5854f5,null))[_0xb416('0x43')](handleError(_0x5854f5,null));};exports['destroy']=function(_0x3c0e0b,_0x21967c){return db[_0xb416('0x2f')]['find']({'where':{'id':_0x3c0e0b[_0xb416('0x45')]['id']}})[_0xb416('0x26')](handleEntityNotFound(_0x21967c,null))[_0xb416('0x26')](removeEntity(_0x21967c,null))[_0xb416('0x43')](handleError(_0x21967c,null));};exports[_0xb416('0x4c')]=function(_0x256359,_0x4cc3d2){return db[_0xb416('0x2f')][_0xb416('0x4c')]()[_0xb416('0x26')](respondWithResult(_0x4cc3d2,null))[_0xb416('0x43')](handleError(_0x4cc3d2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d6efc03..26e86de 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x297941,_0x599682){var _0x3b3e96=function(_0x532f56){while(--_0x532f56){_0x297941['push'](_0x297941['shift']());}};_0x3b3e96(++_0x599682);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xb7e7[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1b475a,_0x5cfd71){var _0x2b6da6=function(_0x4f2c58){while(--_0x4f2c58){_0x1b475a['push'](_0x1b475a['shift']());}};_0x2b6da6(++_0x5cfd71);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8a16fec..3f76669 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 _0x4348=['options','raw','catch','UpdateSmsQueueReport','update','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4348,0xe0));var _0x8434=function(_0x2d0f03,_0x4ae6ae){_0x2d0f03=_0x2d0f03-0x0;var _0x5c15a1=_0x4348[_0x2d0f03];return _0x5c15a1;};'use strict';var _=require(_0x8434('0x0'));var util=require('util');var moment=require(_0x8434('0x1'));var BPromise=require('bluebird');var rs=require(_0x8434('0x2'));var fs=require('fs');var Redis=require(_0x8434('0x3'));var db=require(_0x8434('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8434('0x5'))(_0x8434('0x6'));var config=require(_0x8434('0x7'));var jayson=require(_0x8434('0x8'));var client=jayson['client'][_0x8434('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x97f0f3,_0x55e50a,_0x294439){return new BPromise(function(_0x2881d0,_0x138b35){return client[_0x8434('0xa')](_0x97f0f3,_0x294439)[_0x8434('0xb')](function(_0xe09468){logger[_0x8434('0xc')](_0x8434('0xd'),_0x55e50a,_0x8434('0xe'));logger[_0x8434('0xf')](_0x8434('0x10'),_0x55e50a,_0x8434('0xe'),JSON[_0x8434('0x11')](_0xe09468));if(_0xe09468[_0x8434('0x12')]){if(_0xe09468[_0x8434('0x12')]['code']===0x1f4){logger[_0x8434('0x12')](_0x8434('0xd'),_0x55e50a,_0xe09468[_0x8434('0x12')][_0x8434('0x13')]);return _0x138b35(_0xe09468[_0x8434('0x12')][_0x8434('0x13')]);}logger[_0x8434('0x12')](_0x8434('0xd'),_0x55e50a,_0xe09468[_0x8434('0x12')][_0x8434('0x13')]);return _0x2881d0(_0xe09468[_0x8434('0x12')][_0x8434('0x13')]);}else{logger[_0x8434('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x55e50a,'request\x20sent');_0x2881d0(_0xe09468['result'][_0x8434('0x13')]);}})['catch'](function(_0xedd2bc){logger[_0x8434('0x12')](_0x8434('0xd'),_0x55e50a,_0xedd2bc);_0x138b35(_0xedd2bc);});});}exports[_0x8434('0x14')]=function(_0x5edf7b){var _0xe3b469=this;return new Promise(function(_0x3cadb9,_0x19eed4){return db[_0x8434('0x15')][_0x8434('0x16')](_0x5edf7b[_0x8434('0x17')],{'raw':_0x5edf7b[_0x8434('0x18')]?_0x5edf7b[_0x8434('0x18')][_0x8434('0x19')]===undefined?!![]:![]:!![]})[_0x8434('0xb')](function(_0x5afaed){logger['info'](_0x8434('0x14'),_0x5edf7b);logger[_0x8434('0xf')](_0x8434('0x14'),_0x5edf7b,JSON[_0x8434('0x11')](_0x5afaed));_0x3cadb9(_0x5afaed);})[_0x8434('0x1a')](function(_0x349978){logger[_0x8434('0x12')](_0x8434('0x14'),_0x349978[_0x8434('0x13')],_0x5edf7b);_0x19eed4(_0xe3b469[_0x8434('0x12')](0x1f4,_0x349978[_0x8434('0x13')]));});});};exports[_0x8434('0x1b')]=function(_0x16f6ac){var _0x3a19ce=this;return new Promise(function(_0x4252c4,_0x192d53){return db['SmsQueueReport'][_0x8434('0x1c')](_0x16f6ac['body'],{'raw':_0x16f6ac['options']?_0x16f6ac[_0x8434('0x18')][_0x8434('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16f6ac[_0x8434('0x18')]?_0x16f6ac[_0x8434('0x18')]['where']||null:null,'attributes':_0x16f6ac[_0x8434('0x18')]?_0x16f6ac[_0x8434('0x18')][_0x8434('0x1d')]||null:null,'limit':_0x16f6ac['options']?_0x16f6ac[_0x8434('0x18')][_0x8434('0x1e')]||null:null})[_0x8434('0xb')](function(_0x2eedb3){logger[_0x8434('0xc')]('UpdateSmsQueueReport',_0x16f6ac);logger[_0x8434('0xf')](_0x8434('0x1b'),_0x16f6ac,JSON[_0x8434('0x11')](_0x2eedb3));_0x4252c4(_0x2eedb3);})[_0x8434('0x1a')](function(_0x2a14a5){logger[_0x8434('0x12')](_0x8434('0x1b'),_0x2a14a5[_0x8434('0x13')],_0x16f6ac);_0x192d53(_0x3a19ce[_0x8434('0x12')](0x1f4,_0x2a14a5[_0x8434('0x13')]));});});}; \ No newline at end of file +var _0x5d5c=['update','where','attributes','limit','UpdateSmsQueueReport','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','then'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5d5c,0x131));var _0xc5d5=function(_0x4efac8,_0x414290){_0x4efac8=_0x4efac8-0x0;var _0x2c7d5b=_0x5d5c[_0x4efac8];return _0x2c7d5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5d5('0x0'));var fs=require('fs');var Redis=require(_0xc5d5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5d5('0x2'));var logger=require('../../config/logger')(_0xc5d5('0x3'));var config=require(_0xc5d5('0x4'));var jayson=require(_0xc5d5('0x5'));var client=jayson[_0xc5d5('0x6')][_0xc5d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cf0d4,_0x1bc3cf,_0x58cc1d){return new BPromise(function(_0x4d5bb1,_0x33657a){return client['request'](_0x4cf0d4,_0x58cc1d)['then'](function(_0x1b771a){logger[_0xc5d5('0x8')](_0xc5d5('0x9'),_0x1bc3cf,_0xc5d5('0xa'));logger[_0xc5d5('0xb')](_0xc5d5('0xc'),_0x1bc3cf,'request\x20sent',JSON[_0xc5d5('0xd')](_0x1b771a));if(_0x1b771a[_0xc5d5('0xe')]){if(_0x1b771a[_0xc5d5('0xe')][_0xc5d5('0xf')]===0x1f4){logger[_0xc5d5('0xe')](_0xc5d5('0x9'),_0x1bc3cf,_0x1b771a[_0xc5d5('0xe')][_0xc5d5('0x10')]);return _0x33657a(_0x1b771a['error'][_0xc5d5('0x10')]);}logger[_0xc5d5('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x1bc3cf,_0x1b771a[_0xc5d5('0xe')][_0xc5d5('0x10')]);return _0x4d5bb1(_0x1b771a[_0xc5d5('0xe')][_0xc5d5('0x10')]);}else{logger['info'](_0xc5d5('0x9'),_0x1bc3cf,_0xc5d5('0xa'));_0x4d5bb1(_0x1b771a[_0xc5d5('0x11')]['message']);}})[_0xc5d5('0x12')](function(_0x4c8c43){logger['error'](_0xc5d5('0x9'),_0x1bc3cf,_0x4c8c43);_0x33657a(_0x4c8c43);});});}exports[_0xc5d5('0x13')]=function(_0x5c3de0){var _0x3a1d31=this;return new Promise(function(_0x48fdcc,_0x725ca6){return db['SmsQueueReport'][_0xc5d5('0x14')](_0x5c3de0[_0xc5d5('0x15')],{'raw':_0x5c3de0[_0xc5d5('0x16')]?_0x5c3de0[_0xc5d5('0x16')][_0xc5d5('0x17')]===undefined?!![]:![]:!![]})[_0xc5d5('0x18')](function(_0x21fb99){logger[_0xc5d5('0x8')](_0xc5d5('0x13'),_0x5c3de0);logger['debug']('CreateSmsQueueReport',_0x5c3de0,JSON['stringify'](_0x21fb99));_0x48fdcc(_0x21fb99);})[_0xc5d5('0x12')](function(_0x2a0300){logger[_0xc5d5('0xe')](_0xc5d5('0x13'),_0x2a0300['message'],_0x5c3de0);_0x725ca6(_0x3a1d31['error'](0x1f4,_0x2a0300[_0xc5d5('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x4756f5){var _0x3de0e2=this;return new Promise(function(_0x25d665,_0x527838){return db['SmsQueueReport'][_0xc5d5('0x19')](_0x4756f5['body'],{'raw':_0x4756f5[_0xc5d5('0x16')]?_0x4756f5[_0xc5d5('0x16')][_0xc5d5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4756f5['options']?_0x4756f5[_0xc5d5('0x16')][_0xc5d5('0x1a')]||null:null,'attributes':_0x4756f5[_0xc5d5('0x16')]?_0x4756f5[_0xc5d5('0x16')][_0xc5d5('0x1b')]||null:null,'limit':_0x4756f5[_0xc5d5('0x16')]?_0x4756f5[_0xc5d5('0x16')][_0xc5d5('0x1c')]||null:null})[_0xc5d5('0x18')](function(_0x5e53cc){logger[_0xc5d5('0x8')](_0xc5d5('0x1d'),_0x4756f5);logger['debug'](_0xc5d5('0x1d'),_0x4756f5,JSON[_0xc5d5('0xd')](_0x5e53cc));_0x25d665(_0x5e53cc);})['catch'](function(_0x330ed6){logger[_0xc5d5('0xe')](_0xc5d5('0x1d'),_0x330ed6['message'],_0x4756f5);_0x527838(_0x3de0e2[_0xc5d5('0xe')](0x1f4,_0x330ed6[_0xc5d5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 45c0d33..63b0986 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 _0x5c12=['./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x5c12,0x188));var _0x25c1=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x5c12[_0x37d0bc];return _0x170e60;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x25c1('0xc')]);router[_0x25c1('0xb')](_0x25c1('0xd'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);router['post']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xd'),auth[_0x25c1('0x9')](),controller['update']);router[_0x25c1('0x11')](_0x25c1('0xd'),auth['isAuthenticated'](),controller[_0x25c1('0x12')]);module[_0x25c1('0x13')]=router; \ No newline at end of file +var _0x032e=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x8bee69,_0x3c9bcb){var _0x32068f=function(_0x27da71){while(--_0x27da71){_0x8bee69['push'](_0x8bee69['shift']());}};_0x32068f(++_0x3c9bcb);}(_0x032e,0x124));var _0xe032=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x032e[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0xf')]('/',auth[_0xe032('0x9')](),controller['create']);router[_0xe032('0x10')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0x11')]);router[_0xe032('0x12')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller['destroy']);module[_0xe032('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 528f841..7b9219a 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x44af02,_0x42bd22){var _0x1405c9=function(_0x1c3426){while(--_0x1c3426){_0x44af02['push'](_0x44af02['shift']());}};_0x1405c9(++_0x42bd22);}(_0x34e8,0x12c));var _0x834e=function(_0x5da32f,_0x12b1e9){_0x5da32f=_0x5da32f-0x0;var _0x50830d=_0x34e8[_0x5da32f];return _0x50830d;};'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(_0x3d5e72,_0x3ab167){var _0x2230e4=function(_0x4ede86){while(--_0x4ede86){_0x3d5e72['push'](_0x3d5e72['shift']());}};_0x2230e4(++_0x3ab167);}(_0x54ef,0x112));var _0xf54e=function(_0x3825d4,_0x26cf42){_0x3825d4=_0x3825d4-0x0;var _0x362fa8=_0x54ef[_0x3825d4];return _0x362fa8;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9c1ed9d..bd1b388 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 _0x86ab=['options','SmsTransferReport','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','describe','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','undefined','limit','count','set','reject','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','attributes','intersection','fields','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x1df168,_0x4fc9b1){var _0x44f491=function(_0x523876){while(--_0x523876){_0x1df168['push'](_0x1df168['shift']());}};_0x44f491(++_0x4fc9b1);}(_0x86ab,0x171));var _0xb86a=function(_0xbe492e,_0x27b122){_0xbe492e=_0xbe492e-0x0;var _0x5174cf=_0x86ab[_0xbe492e];return _0x5174cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb86a('0x0'));var BPromise=require('bluebird');var Mustache=require(_0xb86a('0x1'));var util=require(_0xb86a('0x2'));var path=require(_0xb86a('0x3'));var sox=require(_0xb86a('0x4'));var csv=require(_0xb86a('0x5'));var ejs=require(_0xb86a('0x6'));var fs=require('fs');var fs_extra=require(_0xb86a('0x7'));var _=require(_0xb86a('0x8'));var squel=require(_0xb86a('0x9'));var crypto=require('crypto');var jsforce=require(_0xb86a('0xa'));var deskjs=require(_0xb86a('0xb'));var toCsv=require(_0xb86a('0x5'));var querystring=require(_0xb86a('0xc'));var Papa=require(_0xb86a('0xd'));var Redis=require(_0xb86a('0xe'));var authService=require(_0xb86a('0xf'));var qs=require(_0xb86a('0x10'));var as=require(_0xb86a('0x11'));var hardwareService=require(_0xb86a('0x12'));var logger=require(_0xb86a('0x13'))(_0xb86a('0x14'));var utils=require(_0xb86a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb86a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455efa,_0x323956){_0x323956=_0x323956||0xcc;return function(_0x4a6191){if(_0x4a6191){return _0x455efa[_0xb86a('0x17')](_0x323956);}return _0x455efa['status'](_0x323956)['end']();};}function respondWithResult(_0x4fc0fd,_0x4eed51){_0x4eed51=_0x4eed51||0xc8;return function(_0x1422ad){if(_0x1422ad){return _0x4fc0fd[_0xb86a('0x18')](_0x4eed51)['json'](_0x1422ad);}};}function respondWithFilteredResult(_0x42af92,_0x2a7e46){return function(_0x2886bb){if(_0x2886bb){var _0x4a7e39=typeof _0x2a7e46['offset']===_0xb86a('0x19')&&typeof _0x2a7e46[_0xb86a('0x1a')]==='undefined';var _0x5697c5=_0x2886bb[_0xb86a('0x1b')];var _0xa8d9b4=_0x4a7e39?0x0:_0x2a7e46['offset'];var _0x4813e2=_0x4a7e39?_0x2886bb['count']:_0x2a7e46['offset']+_0x2a7e46[_0xb86a('0x1a')];var _0x20a124;if(_0x4813e2>=_0x5697c5){_0x4813e2=_0x5697c5;_0x20a124=0xc8;}else{_0x20a124=0xce;}_0x42af92[_0xb86a('0x18')](_0x20a124);return _0x42af92[_0xb86a('0x1c')]('Content-Range',_0xa8d9b4+'-'+_0x4813e2+'/'+_0x5697c5)['json'](_0x2886bb);}return null;};}function patchUpdates(_0x22752b){return function(_0x3a61ef){try{jsonpatch['apply'](_0x3a61ef,_0x22752b,!![]);}catch(_0x378f96){return BPromise[_0xb86a('0x1d')](_0x378f96);}return _0x3a61ef['save']();};}function saveUpdates(_0x28dc27,_0x1b59ad){return function(_0x2cd8ac){if(_0x2cd8ac){return _0x2cd8ac[_0xb86a('0x1e')](_0x28dc27)[_0xb86a('0x1f')](function(_0x5b3597){return _0x5b3597;});}return null;};}function removeEntity(_0x11ac8d,_0x637fcb){return function(_0x2c8bce){if(_0x2c8bce){return _0x2c8bce[_0xb86a('0x20')]()[_0xb86a('0x1f')](function(){_0x11ac8d[_0xb86a('0x18')](0xcc)[_0xb86a('0x21')]();});}};}function handleEntityNotFound(_0x2fd70f,_0x17c7d5){return function(_0x5edaa8){if(!_0x5edaa8){_0x2fd70f[_0xb86a('0x17')](0x194);}return _0x5edaa8;};}function handleError(_0x287926,_0x3ed74d){_0x3ed74d=_0x3ed74d||0x1f4;return function(_0x14f753){logger[_0xb86a('0x22')](_0x14f753[_0xb86a('0x23')]);if(_0x14f753['name']){delete _0x14f753[_0xb86a('0x24')];}_0x287926[_0xb86a('0x18')](_0x3ed74d)[_0xb86a('0x25')](_0x14f753);};}exports['index']=function(_0x10f624,_0x2e5e09){var _0x2f756c={},_0x30ba10={},_0x28749b={'count':0x0,'rows':[]};var _0x289477=_['map'](db['SmsTransferReport'][_0xb86a('0x26')],function(_0x19d11c){return{'name':_0x19d11c[_0xb86a('0x27')],'type':_0x19d11c[_0xb86a('0x28')]['key']};});_0x30ba10[_0xb86a('0x29')]=_[_0xb86a('0x2a')](_0x289477,'name');_0x30ba10[_0xb86a('0x2b')]=_[_0xb86a('0x2c')](_0x10f624[_0xb86a('0x2b')]);_0x30ba10['filters']=_['intersection'](_0x30ba10[_0xb86a('0x29')],_0x30ba10[_0xb86a('0x2b')]);_0x2f756c[_0xb86a('0x2d')]=_[_0xb86a('0x2e')](_0x30ba10[_0xb86a('0x29')],qs[_0xb86a('0x2f')](_0x10f624['query']['fields']));_0x2f756c['attributes']=_0x2f756c[_0xb86a('0x2d')]['length']?_0x2f756c[_0xb86a('0x2d')]:_0x30ba10[_0xb86a('0x29')];if(!_0x10f624[_0xb86a('0x2b')]['hasOwnProperty']('nolimit')){_0x2f756c[_0xb86a('0x1a')]=qs['limit'](_0x10f624[_0xb86a('0x2b')][_0xb86a('0x1a')]);_0x2f756c['offset']=qs[_0xb86a('0x30')](_0x10f624[_0xb86a('0x2b')]['offset']);}_0x2f756c[_0xb86a('0x31')]=qs[_0xb86a('0x32')](_0x10f624[_0xb86a('0x2b')]['sort']);_0x2f756c[_0xb86a('0x33')]=qs[_0xb86a('0x34')](_[_0xb86a('0x35')](_0x10f624[_0xb86a('0x2b')],_0x30ba10[_0xb86a('0x34')]),_0x289477);if(_0x10f624[_0xb86a('0x2b')][_0xb86a('0x36')]){_0x2f756c[_0xb86a('0x33')]=_[_0xb86a('0x37')](_0x2f756c['where'],{'$or':_['map'](_0x289477,function(_0x151f79){if(_0x151f79[_0xb86a('0x28')]!==_0xb86a('0x38')){var _0x2bd5b0={};_0x2bd5b0[_0x151f79[_0xb86a('0x24')]]={'$like':'%'+_0x10f624['query'][_0xb86a('0x36')]+'%'};return _0x2bd5b0;}})});}_0x2f756c=_[_0xb86a('0x37')]({},_0x2f756c,_0x10f624[_0xb86a('0x39')]);var _0x206b1d={'where':_0x2f756c[_0xb86a('0x33')]};return db[_0xb86a('0x3a')]['count'](_0x206b1d)[_0xb86a('0x1f')](function(_0x39b18b){_0x28749b[_0xb86a('0x1b')]=_0x39b18b;if(_0x10f624[_0xb86a('0x2b')]['includeAll']){_0x2f756c[_0xb86a('0x3b')]=[{'all':!![]}];}return db[_0xb86a('0x3a')][_0xb86a('0x3c')](_0x2f756c);})[_0xb86a('0x1f')](function(_0x1b9981){_0x28749b[_0xb86a('0x3d')]=_0x1b9981;return _0x28749b;})[_0xb86a('0x1f')](respondWithFilteredResult(_0x2e5e09,_0x2f756c))['catch'](handleError(_0x2e5e09,null));};exports[_0xb86a('0x3e')]=function(_0x2ffd3c,_0x33e4e8){var _0x487bdd={'raw':!![],'where':{'id':_0x2ffd3c[_0xb86a('0x3f')]['id']}},_0x436309={};_0x436309['model']=_[_0xb86a('0x2c')](db[_0xb86a('0x3a')][_0xb86a('0x26')]);_0x436309['query']=_[_0xb86a('0x2c')](_0x2ffd3c[_0xb86a('0x2b')]);_0x436309[_0xb86a('0x34')]=_[_0xb86a('0x2e')](_0x436309['model'],_0x436309[_0xb86a('0x2b')]);_0x487bdd[_0xb86a('0x2d')]=_[_0xb86a('0x2e')](_0x436309['model'],qs[_0xb86a('0x2f')](_0x2ffd3c[_0xb86a('0x2b')][_0xb86a('0x2f')]));_0x487bdd[_0xb86a('0x2d')]=_0x487bdd[_0xb86a('0x2d')][_0xb86a('0x40')]?_0x487bdd[_0xb86a('0x2d')]:_0x436309[_0xb86a('0x29')];if(_0x2ffd3c['query'][_0xb86a('0x41')]){_0x487bdd['include']=[{'all':!![]}];}_0x487bdd=_[_0xb86a('0x37')]({},_0x487bdd,_0x2ffd3c['options']);return db['SmsTransferReport'][_0xb86a('0x42')](_0x487bdd)[_0xb86a('0x1f')](handleEntityNotFound(_0x33e4e8,null))['then'](respondWithResult(_0x33e4e8,null))[_0xb86a('0x43')](handleError(_0x33e4e8,null));};exports[_0xb86a('0x44')]=function(_0x1f4f1f,_0x3255db){return db['SmsTransferReport'][_0xb86a('0x44')](_0x1f4f1f[_0xb86a('0x45')],{})[_0xb86a('0x1f')](respondWithResult(_0x3255db,0xc9))[_0xb86a('0x43')](handleError(_0x3255db,null));};exports[_0xb86a('0x1e')]=function(_0x57071e,_0x3c06a4){if(_0x57071e['body']['id']){delete _0x57071e['body']['id'];}return db[_0xb86a('0x3a')]['find']({'where':{'id':_0x57071e[_0xb86a('0x3f')]['id']}})[_0xb86a('0x1f')](handleEntityNotFound(_0x3c06a4,null))[_0xb86a('0x1f')](saveUpdates(_0x57071e[_0xb86a('0x45')],null))[_0xb86a('0x1f')](respondWithResult(_0x3c06a4,null))['catch'](handleError(_0x3c06a4,null));};exports[_0xb86a('0x20')]=function(_0x56f677,_0x3b5d3d){return db[_0xb86a('0x3a')][_0xb86a('0x42')]({'where':{'id':_0x56f677['params']['id']}})['then'](handleEntityNotFound(_0x3b5d3d,null))['then'](removeEntity(_0x3b5d3d,null))[_0xb86a('0x43')](handleError(_0x3b5d3d,null));};exports[_0xb86a('0x46')]=function(_0x5a7367,_0x202cdb){return db[_0xb86a('0x3a')]['describe']()[_0xb86a('0x1f')](respondWithResult(_0x202cdb,null))[_0xb86a('0x43')](handleError(_0x202cdb,null));}; \ No newline at end of file +var _0x6ce1=['ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','destroy','end','error','stack','name','send','index','fieldName','type','key','model','keys','query','filters','attributes','fields','length','order','sort','where','pick','filter','merge','map','options','SmsTransferReport','findAll','rows','show','params','rawAttributes','intersection','includeAll','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x4246ef,_0x508804){var _0x20d87b=function(_0x1cdd34){while(--_0x1cdd34){_0x4246ef['push'](_0x4246ef['shift']());}};_0x20d87b(++_0x508804);}(_0x6ce1,0x122));var _0x16ce=function(_0x3e1764,_0xe60375){_0x3e1764=_0x3e1764-0x0;var _0x35af67=_0x6ce1[_0x3e1764];return _0x35af67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16ce('0x0'));var zipdir=require(_0x16ce('0x1'));var jsonpatch=require(_0x16ce('0x2'));var rp=require(_0x16ce('0x3'));var moment=require(_0x16ce('0x4'));var BPromise=require(_0x16ce('0x5'));var Mustache=require(_0x16ce('0x6'));var util=require(_0x16ce('0x7'));var path=require('path');var sox=require(_0x16ce('0x8'));var csv=require(_0x16ce('0x9'));var ejs=require(_0x16ce('0xa'));var fs=require('fs');var fs_extra=require(_0x16ce('0xb'));var _=require('lodash');var squel=require(_0x16ce('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x16ce('0xd'));var toCsv=require(_0x16ce('0x9'));var querystring=require(_0x16ce('0xe'));var Papa=require(_0x16ce('0xf'));var Redis=require('ioredis');var authService=require(_0x16ce('0x10'));var qs=require(_0x16ce('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16ce('0x12'));var logger=require(_0x16ce('0x13'))('api');var utils=require(_0x16ce('0x14'));var config=require(_0x16ce('0x15'));var licenseUtil=require(_0x16ce('0x16'));var db=require(_0x16ce('0x17'))['db'];function respondWithStatusCode(_0x191c3d,_0x1bcba8){_0x1bcba8=_0x1bcba8||0xcc;return function(_0x217cb1){if(_0x217cb1){return _0x191c3d[_0x16ce('0x18')](_0x1bcba8);}return _0x191c3d['status'](_0x1bcba8)['end']();};}function respondWithResult(_0xce4ab0,_0x1e4bb5){_0x1e4bb5=_0x1e4bb5||0xc8;return function(_0x17f483){if(_0x17f483){return _0xce4ab0[_0x16ce('0x19')](_0x1e4bb5)['json'](_0x17f483);}};}function respondWithFilteredResult(_0x349032,_0xdd3bf8){return function(_0x22e26d){if(_0x22e26d){var _0x151713=typeof _0xdd3bf8[_0x16ce('0x1a')]==='undefined'&&typeof _0xdd3bf8[_0x16ce('0x1b')]===_0x16ce('0x1c');var _0x1d5ec0=_0x22e26d[_0x16ce('0x1d')];var _0x218b32=_0x151713?0x0:_0xdd3bf8[_0x16ce('0x1a')];var _0xe766ac=_0x151713?_0x22e26d['count']:_0xdd3bf8[_0x16ce('0x1a')]+_0xdd3bf8[_0x16ce('0x1b')];var _0x311183;if(_0xe766ac>=_0x1d5ec0){_0xe766ac=_0x1d5ec0;_0x311183=0xc8;}else{_0x311183=0xce;}_0x349032[_0x16ce('0x19')](_0x311183);return _0x349032[_0x16ce('0x1e')]('Content-Range',_0x218b32+'-'+_0xe766ac+'/'+_0x1d5ec0)[_0x16ce('0x1f')](_0x22e26d);}return null;};}function patchUpdates(_0x4274e0){return function(_0x52e6c7){try{jsonpatch[_0x16ce('0x20')](_0x52e6c7,_0x4274e0,!![]);}catch(_0x1b7bdc){return BPromise['reject'](_0x1b7bdc);}return _0x52e6c7[_0x16ce('0x21')]();};}function saveUpdates(_0x485a08,_0x31169f){return function(_0x2ca306){if(_0x2ca306){return _0x2ca306[_0x16ce('0x22')](_0x485a08)[_0x16ce('0x23')](function(_0x2a0101){return _0x2a0101;});}return null;};}function removeEntity(_0x28f06b,_0x1fa3e6){return function(_0x3dc72d){if(_0x3dc72d){return _0x3dc72d[_0x16ce('0x24')]()[_0x16ce('0x23')](function(){_0x28f06b[_0x16ce('0x19')](0xcc)[_0x16ce('0x25')]();});}};}function handleEntityNotFound(_0x4374a4,_0x55ace7){return function(_0x5278be){if(!_0x5278be){_0x4374a4['sendStatus'](0x194);}return _0x5278be;};}function handleError(_0x4a6fa5,_0x9de598){_0x9de598=_0x9de598||0x1f4;return function(_0x3d3ac0){logger[_0x16ce('0x26')](_0x3d3ac0[_0x16ce('0x27')]);if(_0x3d3ac0[_0x16ce('0x28')]){delete _0x3d3ac0[_0x16ce('0x28')];}_0x4a6fa5[_0x16ce('0x19')](_0x9de598)[_0x16ce('0x29')](_0x3d3ac0);};}exports[_0x16ce('0x2a')]=function(_0x1b8653,_0x14f9b0){var _0x27b1e2={},_0x4577ca={},_0x2994c9={'count':0x0,'rows':[]};var _0xd66f94=_['map'](db['SmsTransferReport']['rawAttributes'],function(_0x757e25){return{'name':_0x757e25[_0x16ce('0x2b')],'type':_0x757e25[_0x16ce('0x2c')][_0x16ce('0x2d')]};});_0x4577ca[_0x16ce('0x2e')]=_['map'](_0xd66f94,_0x16ce('0x28'));_0x4577ca['query']=_[_0x16ce('0x2f')](_0x1b8653[_0x16ce('0x30')]);_0x4577ca[_0x16ce('0x31')]=_['intersection'](_0x4577ca[_0x16ce('0x2e')],_0x4577ca[_0x16ce('0x30')]);_0x27b1e2[_0x16ce('0x32')]=_['intersection'](_0x4577ca[_0x16ce('0x2e')],qs['fields'](_0x1b8653[_0x16ce('0x30')][_0x16ce('0x33')]));_0x27b1e2[_0x16ce('0x32')]=_0x27b1e2[_0x16ce('0x32')][_0x16ce('0x34')]?_0x27b1e2['attributes']:_0x4577ca[_0x16ce('0x2e')];if(!_0x1b8653['query']['hasOwnProperty']('nolimit')){_0x27b1e2['limit']=qs['limit'](_0x1b8653['query'][_0x16ce('0x1b')]);_0x27b1e2[_0x16ce('0x1a')]=qs[_0x16ce('0x1a')](_0x1b8653[_0x16ce('0x30')][_0x16ce('0x1a')]);}_0x27b1e2[_0x16ce('0x35')]=qs['sort'](_0x1b8653['query'][_0x16ce('0x36')]);_0x27b1e2[_0x16ce('0x37')]=qs[_0x16ce('0x31')](_[_0x16ce('0x38')](_0x1b8653[_0x16ce('0x30')],_0x4577ca[_0x16ce('0x31')]),_0xd66f94);if(_0x1b8653['query'][_0x16ce('0x39')]){_0x27b1e2[_0x16ce('0x37')]=_[_0x16ce('0x3a')](_0x27b1e2['where'],{'$or':_[_0x16ce('0x3b')](_0xd66f94,function(_0x3edba7){if(_0x3edba7[_0x16ce('0x2c')]!=='VIRTUAL'){var _0x1670f9={};_0x1670f9[_0x3edba7[_0x16ce('0x28')]]={'$like':'%'+_0x1b8653[_0x16ce('0x30')]['filter']+'%'};return _0x1670f9;}})});}_0x27b1e2=_['merge']({},_0x27b1e2,_0x1b8653[_0x16ce('0x3c')]);var _0x4875e5={'where':_0x27b1e2[_0x16ce('0x37')]};return db[_0x16ce('0x3d')][_0x16ce('0x1d')](_0x4875e5)['then'](function(_0x574ef1){_0x2994c9[_0x16ce('0x1d')]=_0x574ef1;if(_0x1b8653[_0x16ce('0x30')]['includeAll']){_0x27b1e2['include']=[{'all':!![]}];}return db[_0x16ce('0x3d')][_0x16ce('0x3e')](_0x27b1e2);})[_0x16ce('0x23')](function(_0x1ac643){_0x2994c9[_0x16ce('0x3f')]=_0x1ac643;return _0x2994c9;})[_0x16ce('0x23')](respondWithFilteredResult(_0x14f9b0,_0x27b1e2))['catch'](handleError(_0x14f9b0,null));};exports[_0x16ce('0x40')]=function(_0x3ed714,_0x4cf138){var _0x31b350={'raw':!![],'where':{'id':_0x3ed714[_0x16ce('0x41')]['id']}},_0x1d57df={};_0x1d57df['model']=_[_0x16ce('0x2f')](db[_0x16ce('0x3d')][_0x16ce('0x42')]);_0x1d57df['query']=_[_0x16ce('0x2f')](_0x3ed714[_0x16ce('0x30')]);_0x1d57df[_0x16ce('0x31')]=_[_0x16ce('0x43')](_0x1d57df[_0x16ce('0x2e')],_0x1d57df[_0x16ce('0x30')]);_0x31b350[_0x16ce('0x32')]=_[_0x16ce('0x43')](_0x1d57df[_0x16ce('0x2e')],qs[_0x16ce('0x33')](_0x3ed714['query'][_0x16ce('0x33')]));_0x31b350[_0x16ce('0x32')]=_0x31b350[_0x16ce('0x32')]['length']?_0x31b350[_0x16ce('0x32')]:_0x1d57df['model'];if(_0x3ed714['query'][_0x16ce('0x44')]){_0x31b350[_0x16ce('0x45')]=[{'all':!![]}];}_0x31b350=_[_0x16ce('0x3a')]({},_0x31b350,_0x3ed714['options']);return db[_0x16ce('0x3d')][_0x16ce('0x46')](_0x31b350)['then'](handleEntityNotFound(_0x4cf138,null))['then'](respondWithResult(_0x4cf138,null))[_0x16ce('0x47')](handleError(_0x4cf138,null));};exports[_0x16ce('0x48')]=function(_0x1de344,_0x58a96b){return db[_0x16ce('0x3d')]['create'](_0x1de344['body'],{})[_0x16ce('0x23')](respondWithResult(_0x58a96b,0xc9))[_0x16ce('0x47')](handleError(_0x58a96b,null));};exports['update']=function(_0x197f94,_0x4ae985){if(_0x197f94[_0x16ce('0x49')]['id']){delete _0x197f94[_0x16ce('0x49')]['id'];}return db['SmsTransferReport'][_0x16ce('0x46')]({'where':{'id':_0x197f94[_0x16ce('0x41')]['id']}})[_0x16ce('0x23')](handleEntityNotFound(_0x4ae985,null))[_0x16ce('0x23')](saveUpdates(_0x197f94[_0x16ce('0x49')],null))[_0x16ce('0x23')](respondWithResult(_0x4ae985,null))[_0x16ce('0x47')](handleError(_0x4ae985,null));};exports[_0x16ce('0x24')]=function(_0x22b439,_0x702150){return db[_0x16ce('0x3d')][_0x16ce('0x46')]({'where':{'id':_0x22b439[_0x16ce('0x41')]['id']}})[_0x16ce('0x23')](handleEntityNotFound(_0x702150,null))[_0x16ce('0x23')](removeEntity(_0x702150,null))['catch'](handleError(_0x702150,null));};exports[_0x16ce('0x4a')]=function(_0x5bc6b2,_0x5212c4){return db[_0x16ce('0x3d')]['describe']()['then'](respondWithResult(_0x5212c4,null))[_0x16ce('0x47')](handleError(_0x5212c4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b01c1c3..8b7eee0 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 _0x9da2=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer'];(function(_0x10534e,_0x1665c7){var _0x1a1268=function(_0x4cf7b7){while(--_0x4cf7b7){_0x10534e['push'](_0x10534e['shift']());}};_0x1a1268(++_0x1665c7);}(_0x9da2,0xf1));var _0x29da=function(_0x5cb12f,_0x2268ba){_0x5cb12f=_0x5cb12f-0x0;var _0x4bfa03=_0x9da2[_0x5cb12f];return _0x4bfa03;};'use strict';var _=require('lodash');var util=require(_0x29da('0x0'));var logger=require(_0x29da('0x1'))(_0x29da('0x2'));var moment=require(_0x29da('0x3'));var BPromise=require(_0x29da('0x4'));var rp=require(_0x29da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29da('0x6'));var config=require(_0x29da('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x29da('0x8')]=function(_0x3f13a1,_0x3844d0){return _0x3f13a1['define'](_0x29da('0x9'),attributes,{'tableName':_0x29da('0xa'),'paranoid':![],'indexes':[{'name':_0x29da('0xb'),'fields':[_0x29da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa2c=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x312b89,_0x3ed2c2){var _0x5c0d3e=function(_0x3fd0ae){while(--_0x3fd0ae){_0x312b89['push'](_0x312b89['shift']());}};_0x5c0d3e(++_0x3ed2c2);}(_0xaa2c,0x1a3));var _0xcaa2=function(_0x5e1636,_0x4ff69f){_0x5e1636=_0x5e1636-0x0;var _0x505ed2=_0xaa2c[_0x5e1636];return _0x505ed2;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require(_0xcaa2('0x2'))(_0xcaa2('0x3'));var moment=require(_0xcaa2('0x4'));var BPromise=require(_0xcaa2('0x5'));var rp=require(_0xcaa2('0x6'));var fs=require('fs');var path=require(_0xcaa2('0x7'));var rimraf=require('rimraf');var config=require(_0xcaa2('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x4128d7,_0x2258d6){return _0x4128d7[_0xcaa2('0x9')](_0xcaa2('0xa'),attributes,{'tableName':_0xcaa2('0xb'),'paranoid':![],'indexes':[{'name':_0xcaa2('0xc'),'fields':[_0xcaa2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7c22b5e..19e6605 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 _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2801cb,_0x2550a5){var _0x199895=function(_0x5e1989){while(--_0x5e1989){_0x2801cb['push'](_0x2801cb['shift']());}};_0x199895(++_0x2550a5);}(_0x0309,0x165));var _0x9030=function(_0x3764c2,_0x47dcfd){_0x3764c2=_0x3764c2-0x0;var _0x21b625=_0x0309[_0x3764c2];return _0x21b625;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file +var _0x23ea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','bluebird','randomstring'];(function(_0x8f0f46,_0x490486){var _0x2fe4c0=function(_0x465e9f){while(--_0x465e9f){_0x8f0f46['push'](_0x8f0f46['shift']());}};_0x2fe4c0(++_0x490486);}(_0x23ea,0xc3));var _0xa23e=function(_0x220d5b,_0x290a1f){_0x220d5b=_0x220d5b-0x0;var _0x54ce5f=_0x23ea[_0x220d5b];return _0x54ce5f;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var moment=require(_0xa23e('0x2'));var BPromise=require(_0xa23e('0x3'));var rs=require(_0xa23e('0x4'));var fs=require('fs');var Redis=require(_0xa23e('0x5'));var db=require(_0xa23e('0x6'))['db'];var utils=require(_0xa23e('0x7'));var logger=require(_0xa23e('0x8'))(_0xa23e('0x9'));var config=require(_0xa23e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa23e('0xb')][_0xa23e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5754df,_0x90bd9a,_0x28ac6c){return new BPromise(function(_0x1d2a99,_0x4e5680){return client['request'](_0x5754df,_0x28ac6c)[_0xa23e('0xd')](function(_0x138e45){logger[_0xa23e('0xe')](_0xa23e('0xf'),_0x90bd9a,'request\x20sent');logger['debug'](_0xa23e('0x10'),_0x90bd9a,_0xa23e('0x11'),JSON['stringify'](_0x138e45));if(_0x138e45[_0xa23e('0x12')]){if(_0x138e45[_0xa23e('0x12')]['code']===0x1f4){logger[_0xa23e('0x12')](_0xa23e('0xf'),_0x90bd9a,_0x138e45[_0xa23e('0x12')][_0xa23e('0x13')]);return _0x4e5680(_0x138e45['error'][_0xa23e('0x13')]);}logger[_0xa23e('0x12')](_0xa23e('0xf'),_0x90bd9a,_0x138e45['error'][_0xa23e('0x13')]);return _0x1d2a99(_0x138e45[_0xa23e('0x12')][_0xa23e('0x13')]);}else{logger[_0xa23e('0xe')](_0xa23e('0xf'),_0x90bd9a,_0xa23e('0x11'));_0x1d2a99(_0x138e45['result'][_0xa23e('0x13')]);}})['catch'](function(_0x371665){logger[_0xa23e('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x90bd9a,_0x371665);_0x4e5680(_0x371665);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index c56b4e3..1e5dfde 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 _0x7370=['extname','now','single','file','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','index','/:id','show','get','download','diskStorage','join','root','originalname','replace','format','basename'];(function(_0x10b400,_0x40baa2){var _0x2af0de=function(_0x4fb5ca){while(--_0x4fb5ca){_0x10b400['push'](_0x10b400['shift']());}};_0x2af0de(++_0x40baa2);}(_0x7370,0xbc));var _0x0737=function(_0x4791c6,_0x293adf){_0x4791c6=_0x4791c6-0x0;var _0x52b5d3=_0x7370[_0x4791c6];return _0x52b5d3;};'use strict';var multer=require(_0x0737('0x0'));var util=require(_0x0737('0x1'));var path=require(_0x0737('0x2'));var timeout=require('connect-timeout');var express=require(_0x0737('0x3'));var router=express[_0x0737('0x4')]();var fs_extra=require(_0x0737('0x5'));var auth=require(_0x0737('0x6'));var interaction=require(_0x0737('0x7'));var config=require('../../config/environment');var controller=require(_0x0737('0x8'));router['get']('/',auth[_0x0737('0x9')](),controller[_0x0737('0xa')]);router['get'](_0x0737('0xb'),auth[_0x0737('0x9')](),controller[_0x0737('0xc')]);router[_0x0737('0xd')]('/:id/download',auth[_0x0737('0x9')](),controller[_0x0737('0xe')]);var upload=multer({'storage':multer[_0x0737('0xf')]({'destination':function(_0x2cc950,_0x3aeed7,_0x373ee6){_0x373ee6(null,path[_0x0737('0x10')](config[_0x0737('0x11')],'server/files/sounds/original/'));},'filename':function(_0x4c0658,_0xdb391c,_0x1c2621){_0xdb391c['originalname']=_0xdb391c[_0x0737('0x12')][_0x0737('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1c2621(null,util[_0x0737('0x14')]('%s-%s%s',path[_0x0737('0x15')](_0xdb391c['originalname'],path[_0x0737('0x16')](_0xdb391c[_0x0737('0x12')])),Date[_0x0737('0x17')](),path[_0x0737('0x16')](_0xdb391c['originalname'])));}})});router['post']('/',upload[_0x0737('0x18')](_0x0737('0x19')),controller[_0x0737('0x1a')]);router[_0x0737('0x1b')](_0x0737('0xb'),auth[_0x0737('0x9')](),controller[_0x0737('0x1c')]);router[_0x0737('0x1d')](_0x0737('0xb'),auth[_0x0737('0x9')](),controller[_0x0737('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xe657=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','delete','exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xe657,0x105));var _0x7e65=function(_0x374d91,_0xd44ee0){_0x374d91=_0x374d91-0x0;var _0x3e9262=_0xe657[_0x374d91];return _0x3e9262;};'use strict';var multer=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e65('0x2')]();var fs_extra=require(_0x7e65('0x3'));var auth=require(_0x7e65('0x4'));var interaction=require(_0x7e65('0x5'));var config=require('../../config/environment');var controller=require(_0x7e65('0x6'));router['get']('/',auth[_0x7e65('0x7')](),controller[_0x7e65('0x8')]);router[_0x7e65('0x9')](_0x7e65('0xa'),auth['isAuthenticated'](),controller[_0x7e65('0xb')]);router['get'](_0x7e65('0xc'),auth[_0x7e65('0x7')](),controller[_0x7e65('0xd')]);var upload=multer({'storage':multer[_0x7e65('0xe')]({'destination':function(_0x3b3239,_0x14139b,_0x4a3b52){_0x4a3b52(null,path[_0x7e65('0xf')](config[_0x7e65('0x10')],'server/files/sounds/original/'));},'filename':function(_0x5ced2a,_0x51a660,_0x37f648){_0x51a660[_0x7e65('0x11')]=_0x51a660[_0x7e65('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37f648(null,util[_0x7e65('0x12')](_0x7e65('0x13'),path[_0x7e65('0x14')](_0x51a660[_0x7e65('0x11')],path[_0x7e65('0x15')](_0x51a660[_0x7e65('0x11')])),Date[_0x7e65('0x16')](),path[_0x7e65('0x15')](_0x51a660['originalname'])));}})});router[_0x7e65('0x17')]('/',upload[_0x7e65('0x18')](_0x7e65('0x19')),controller[_0x7e65('0x1a')]);router['put'](_0x7e65('0xa'),auth[_0x7e65('0x7')](),controller['update']);router['delete'](_0x7e65('0xa'),auth[_0x7e65('0x7')](),controller[_0x7e65('0x1b')]);module[_0x7e65('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9036704..f16d337 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 _0xe0fb=['exports','name','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0xe0fb,0x13a));var _0xbe0f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe0fb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xbe0f('0x0'));module[_0xbe0f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe0f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xbe0f('0x3')]},'display_name':{'type':Sequelize[_0xbe0f('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xbe0f('0x3')]},'original_duration':{'type':Sequelize[_0xbe0f('0x4')]},'original_sampleCount':{'type':Sequelize[_0xbe0f('0x5')]},'original_channelCount':{'type':Sequelize[_0xbe0f('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xbe0f('0x3')]},'converted_duration':{'type':Sequelize[_0xbe0f('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xbe0f('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xbe0f('0x6')]}}; \ No newline at end of file +var _0x71fc=['INTEGER','sequelize','exports','name','STRING','FLOAT','BIGINT'];(function(_0x152ee5,_0x4ff8c6){var _0x125d0e=function(_0x137079){while(--_0x137079){_0x152ee5['push'](_0x152ee5['shift']());}};_0x125d0e(++_0x4ff8c6);}(_0x71fc,0xda));var _0xc71f=function(_0x221416,_0x1b7dfc){_0x221416=_0x221416-0x0;var _0x189366=_0x71fc[_0x221416];return _0x189366;};'use strict';var Sequelize=require(_0xc71f('0x0'));module[_0xc71f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc71f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc71f('0x3')]},'display_name':{'type':Sequelize[_0xc71f('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xc71f('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xc71f('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc71f('0x5')]},'original_channelCount':{'type':Sequelize[_0xc71f('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc71f('0x6')]},'converted_format':{'type':Sequelize[_0xc71f('0x3')]},'converted_duration':{'type':Sequelize[_0xc71f('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xc71f('0x6')]},'converted_bitRate':{'type':Sequelize[_0xc71f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc71f('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index feec70f..af06633 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 _0x68fc=['file','originalname','basename','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','chmodSync','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','Sound','findAll','rows','show','params','includeAll','include','merge','find','catch','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x68fc,0x117));var _0xc68f=function(_0x5204ca,_0x40e30b){_0x5204ca=_0x5204ca-0x0;var _0x530afe=_0x68fc[_0x5204ca];return _0x530afe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc68f('0x0'));var zipdir=require(_0xc68f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc68f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc68f('0x3'));var util=require(_0xc68f('0x4'));var path=require(_0xc68f('0x5'));var sox=require(_0xc68f('0x6'));var csv=require('to-csv');var ejs=require(_0xc68f('0x7'));var fs=require('fs');var fs_extra=require(_0xc68f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc68f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc68f('0xe'));var as=require(_0xc68f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68f('0x10'))('api');var utils=require(_0xc68f('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc68f('0x12'));var db=require(_0xc68f('0x13'))['db'];function respondWithStatusCode(_0x19c09f,_0x212457){_0x212457=_0x212457||0xcc;return function(_0xc4a77){if(_0xc4a77){return _0x19c09f[_0xc68f('0x14')](_0x212457);}return _0x19c09f[_0xc68f('0x15')](_0x212457)[_0xc68f('0x16')]();};}function respondWithResult(_0x20455d,_0x4ee07c){_0x4ee07c=_0x4ee07c||0xc8;return function(_0x4fa9e4){if(_0x4fa9e4){return _0x20455d[_0xc68f('0x15')](_0x4ee07c)[_0xc68f('0x17')](_0x4fa9e4);}};}function respondWithFilteredResult(_0x11b20d,_0x544487){return function(_0x1ee4ba){if(_0x1ee4ba){var _0x4da3a1=typeof _0x544487['offset']===_0xc68f('0x18')&&typeof _0x544487[_0xc68f('0x19')]===_0xc68f('0x18');var _0xefeed=_0x1ee4ba[_0xc68f('0x1a')];var _0x142b70=_0x4da3a1?0x0:_0x544487[_0xc68f('0x1b')];var _0x3fa777=_0x4da3a1?_0x1ee4ba[_0xc68f('0x1a')]:_0x544487[_0xc68f('0x1b')]+_0x544487[_0xc68f('0x19')];var _0x561414;if(_0x3fa777>=_0xefeed){_0x3fa777=_0xefeed;_0x561414=0xc8;}else{_0x561414=0xce;}_0x11b20d[_0xc68f('0x15')](_0x561414);return _0x11b20d[_0xc68f('0x1c')](_0xc68f('0x1d'),_0x142b70+'-'+_0x3fa777+'/'+_0xefeed)[_0xc68f('0x17')](_0x1ee4ba);}return null;};}function patchUpdates(_0x1a558a){return function(_0x5c8020){try{jsonpatch[_0xc68f('0x1e')](_0x5c8020,_0x1a558a,!![]);}catch(_0xa84935){return BPromise[_0xc68f('0x1f')](_0xa84935);}return _0x5c8020[_0xc68f('0x20')]();};}function saveUpdates(_0x3861ca,_0x5c604d){return function(_0x19e985){if(_0x19e985){return _0x19e985[_0xc68f('0x21')](_0x3861ca)[_0xc68f('0x22')](function(_0x251c83){return _0x251c83;});}return null;};}function removeEntity(_0x4a5b0d,_0x4f286f){return function(_0x26a503){if(_0x26a503){return _0x26a503[_0xc68f('0x23')]()[_0xc68f('0x22')](function(){var _0x14f1e0=_0x26a503[_0xc68f('0x24')]({'plain':!![]});var _0x420380=_0xc68f('0x25');return db[_0xc68f('0x26')][_0xc68f('0x23')]({'where':{'type':_0x420380,'resourceId':_0x14f1e0['id']}})[_0xc68f('0x22')](function(){return _0x26a503;});})['then'](function(){_0x4a5b0d[_0xc68f('0x15')](0xcc)[_0xc68f('0x16')]();});}};}function handleEntityNotFound(_0x19717f,_0x423fa5){return function(_0x4fdb2c){if(!_0x4fdb2c){_0x19717f[_0xc68f('0x14')](0x194);}return _0x4fdb2c;};}function handleError(_0x5bd67d,_0x2d4d0e){_0x2d4d0e=_0x2d4d0e||0x1f4;return function(_0x54aaea){logger[_0xc68f('0x27')](_0x54aaea[_0xc68f('0x28')]);if(_0x54aaea['name']){delete _0x54aaea[_0xc68f('0x29')];}_0x5bd67d[_0xc68f('0x15')](_0x2d4d0e)[_0xc68f('0x2a')](_0x54aaea);};}exports['index']=function(_0x171e6b,_0x4a8c33){var _0x3ce663={},_0x186cfc={},_0x1b4037={'count':0x0,'rows':[]};var _0x223764=_[_0xc68f('0x2b')](db['Sound'][_0xc68f('0x2c')],function(_0x261b0e){return{'name':_0x261b0e[_0xc68f('0x2d')],'type':_0x261b0e[_0xc68f('0x2e')][_0xc68f('0x2f')]};});_0x186cfc[_0xc68f('0x30')]=_[_0xc68f('0x2b')](_0x223764,_0xc68f('0x29'));_0x186cfc[_0xc68f('0x31')]=_[_0xc68f('0x32')](_0x171e6b[_0xc68f('0x31')]);_0x186cfc[_0xc68f('0x33')]=_[_0xc68f('0x34')](_0x186cfc[_0xc68f('0x30')],_0x186cfc[_0xc68f('0x31')]);_0x3ce663[_0xc68f('0x35')]=_[_0xc68f('0x34')](_0x186cfc[_0xc68f('0x30')],qs[_0xc68f('0x36')](_0x171e6b[_0xc68f('0x31')][_0xc68f('0x36')]));_0x3ce663[_0xc68f('0x35')]=_0x3ce663[_0xc68f('0x35')][_0xc68f('0x37')]?_0x3ce663[_0xc68f('0x35')]:_0x186cfc[_0xc68f('0x30')];if(!_0x171e6b[_0xc68f('0x31')][_0xc68f('0x38')](_0xc68f('0x39'))){_0x3ce663[_0xc68f('0x19')]=qs[_0xc68f('0x19')](_0x171e6b[_0xc68f('0x31')][_0xc68f('0x19')]);_0x3ce663[_0xc68f('0x1b')]=qs[_0xc68f('0x1b')](_0x171e6b[_0xc68f('0x31')][_0xc68f('0x1b')]);}_0x3ce663['order']=qs[_0xc68f('0x3a')](_0x171e6b[_0xc68f('0x31')][_0xc68f('0x3a')]);_0x3ce663[_0xc68f('0x3b')]=qs[_0xc68f('0x33')](_[_0xc68f('0x3c')](_0x171e6b['query'],_0x186cfc[_0xc68f('0x33')]),_0x223764);if(_0x171e6b[_0xc68f('0x31')][_0xc68f('0x3d')]){_0x3ce663[_0xc68f('0x3b')]=_['merge'](_0x3ce663['where'],{'$or':_[_0xc68f('0x2b')](_0x223764,function(_0x44d113){if(_0x44d113[_0xc68f('0x2e')]!==_0xc68f('0x3e')){var _0x22914b={};_0x22914b[_0x44d113[_0xc68f('0x29')]]={'$like':'%'+_0x171e6b['query']['filter']+'%'};return _0x22914b;}})});}_0x3ce663=_['merge']({},_0x3ce663,_0x171e6b[_0xc68f('0x3f')]);var _0x590d31={'where':_0x3ce663[_0xc68f('0x3b')]};return db[_0xc68f('0x40')][_0xc68f('0x1a')](_0x590d31)[_0xc68f('0x22')](function(_0x2dc975){_0x1b4037[_0xc68f('0x1a')]=_0x2dc975;if(_0x171e6b[_0xc68f('0x31')]['includeAll']){_0x3ce663['include']=[{'all':!![]}];}return db[_0xc68f('0x40')][_0xc68f('0x41')](_0x3ce663);})[_0xc68f('0x22')](function(_0x2d86fa){_0x1b4037[_0xc68f('0x42')]=_0x2d86fa;return _0x1b4037;})[_0xc68f('0x22')](respondWithFilteredResult(_0x4a8c33,_0x3ce663))['catch'](handleError(_0x4a8c33,null));};exports[_0xc68f('0x43')]=function(_0x37202c,_0x112eb2){var _0x27b685={'raw':!![],'where':{'id':_0x37202c[_0xc68f('0x44')]['id']}},_0x4c6b48={};_0x4c6b48[_0xc68f('0x30')]=_['keys'](db[_0xc68f('0x40')][_0xc68f('0x2c')]);_0x4c6b48[_0xc68f('0x31')]=_['keys'](_0x37202c[_0xc68f('0x31')]);_0x4c6b48['filters']=_[_0xc68f('0x34')](_0x4c6b48['model'],_0x4c6b48[_0xc68f('0x31')]);_0x27b685[_0xc68f('0x35')]=_[_0xc68f('0x34')](_0x4c6b48[_0xc68f('0x30')],qs[_0xc68f('0x36')](_0x37202c[_0xc68f('0x31')][_0xc68f('0x36')]));_0x27b685['attributes']=_0x27b685[_0xc68f('0x35')][_0xc68f('0x37')]?_0x27b685[_0xc68f('0x35')]:_0x4c6b48[_0xc68f('0x30')];if(_0x37202c['query'][_0xc68f('0x45')]){_0x27b685[_0xc68f('0x46')]=[{'all':!![]}];}_0x27b685=_[_0xc68f('0x47')]({},_0x27b685,_0x37202c[_0xc68f('0x3f')]);return db['Sound'][_0xc68f('0x48')](_0x27b685)[_0xc68f('0x22')](handleEntityNotFound(_0x112eb2,null))['then'](respondWithResult(_0x112eb2,null))[_0xc68f('0x49')](handleError(_0x112eb2,null));};exports[_0xc68f('0x4a')]=function(_0x20dca0,_0x997213,_0x239f7c){return db[_0xc68f('0x40')][_0xc68f('0x48')]({'where':{'id':_0x20dca0[_0xc68f('0x44')]['id']},'attributes':['name',_0xc68f('0x4b'),_0xc68f('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x997213,null))[_0xc68f('0x22')](function(_0x4d2e15){if(_0x4d2e15){if(!fs[_0xc68f('0x4d')](path[_0xc68f('0x4e')](config[_0xc68f('0x4f')],_0xc68f('0x50'),_0x4d2e15[_0xc68f('0x4b')]+'.'+_0x4d2e15[_0xc68f('0x4c')]))){throw new db[(_0xc68f('0x51'))][(_0xc68f('0x52'))](_0xc68f('0x53'));}return _0x997213[_0xc68f('0x4a')](path['join'](config[_0xc68f('0x4f')],'server/files/sounds/converted',util['format'](_0xc68f('0x54'),_0x4d2e15['save_name'],_0x4d2e15['converted_format'])),util[_0xc68f('0x55')]('%s.%s',_0x4d2e15[_0xc68f('0x29')],_0x4d2e15[_0xc68f('0x4c')]));}return null;})[_0xc68f('0x49')](handleError(_0x997213,null));};exports[_0xc68f('0x56')]=function(_0x1052d2,_0x457ae6,_0x59eca3){var _0x5d8976={'name':path['basename'](_0x1052d2[_0xc68f('0x57')]['originalname'],path['extname'](_0x1052d2[_0xc68f('0x57')][_0xc68f('0x58')])),'save_name':path[_0xc68f('0x59')](_0x1052d2[_0xc68f('0x57')][_0xc68f('0x5a')],path[_0xc68f('0x5b')](_0x1052d2[_0xc68f('0x57')][_0xc68f('0x5a')])),'original_format':path[_0xc68f('0x5b')](_0x1052d2['file'][_0xc68f('0x58')])[_0xc68f('0x5c')](0x1),'converted_format':_0xc68f('0x5d')};var _0x5db183=path[_0xc68f('0x4e')](config[_0xc68f('0x4f')],_0xc68f('0x5e'),_0x1052d2['file']['filename']);var _0x3d95ed=path[_0xc68f('0x4e')](config[_0xc68f('0x4f')],_0xc68f('0x50'),util[_0xc68f('0x55')](_0xc68f('0x54'),path[_0xc68f('0x59')](_0x1052d2[_0xc68f('0x57')][_0xc68f('0x5a')],path[_0xc68f('0x5b')](_0x1052d2['file'][_0xc68f('0x5a')])),_0x5d8976[_0xc68f('0x4c')]));logger[_0xc68f('0x5f')](_0xc68f('0x60'),_0x5db183);logger[_0xc68f('0x5f')](_0xc68f('0x61'),_0x3d95ed);try{fs['chmodSync'](_0x5db183,parseInt(_0xc68f('0x62'),0x8));var _0x28a692=sox[_0xc68f('0x63')](_0x5db183,_0x3d95ed,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x28a692['on'](_0xc68f('0x27'),function(_0x2f309d){fs[_0xc68f('0x64')](_0x5db183);_0x457ae6['status'](0x1f4)['send'](_0x2f309d);});_0x28a692['on']('src',function(_0x344ef3){_0x5d8976['original_duration']=isNaN(_0x344ef3[_0xc68f('0x65')])?null:_0x344ef3[_0xc68f('0x65')]*0x3e8;_0x5d8976[_0xc68f('0x66')]=isNaN(_0x344ef3[_0xc68f('0x67')])?null:_0x344ef3[_0xc68f('0x67')];_0x5d8976[_0xc68f('0x68')]=isNaN(_0x344ef3[_0xc68f('0x69')])?null:_0x344ef3[_0xc68f('0x69')];_0x5d8976[_0xc68f('0x6a')]=isNaN(_0x344ef3[_0xc68f('0x6b')])?null:_0x344ef3[_0xc68f('0x6b')];_0x5d8976[_0xc68f('0x6c')]=isNaN(_0x344ef3[_0xc68f('0x6d')])?null:_0x344ef3[_0xc68f('0x6d')];});_0x28a692['on'](_0xc68f('0x6e'),function(_0xf9b1b3){_0x5d8976['converted_duration']=isNaN(_0xf9b1b3[_0xc68f('0x65')])?null:_0xf9b1b3[_0xc68f('0x65')]*0x3e8;_0x5d8976['converted_sampleCount']=isNaN(_0xf9b1b3['sampleCount'])?null:_0xf9b1b3[_0xc68f('0x67')];_0x5d8976['converted_channelCount']=isNaN(_0xf9b1b3['channelCount'])?null:_0xf9b1b3[_0xc68f('0x69')];_0x5d8976['converted_bitRate']=isNaN(_0xf9b1b3[_0xc68f('0x6b')])?null:_0xf9b1b3[_0xc68f('0x6b')];_0x5d8976['converted_sampleRate']=isNaN(_0xf9b1b3[_0xc68f('0x6d')])?null:_0xf9b1b3[_0xc68f('0x6d')];});_0x28a692['on'](_0xc68f('0x16'),function(){fs[_0xc68f('0x6f')](_0x3d95ed,parseInt(_0xc68f('0x62'),0x8));return db[_0xc68f('0x40')][_0xc68f('0x56')](_0x5d8976)[_0xc68f('0x22')](function(_0x3b13d4){var _0x270ebe={'role':_0x1052d2[_0xc68f('0x70')][_0xc68f('0x71')],'userProfileId':_0x1052d2[_0xc68f('0x70')][_0xc68f('0x72')]};if(!_0x270ebe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x270ebe[_0xc68f('0x71')]===_0xc68f('0x73')){var _0x4a259d=_0x3b13d4[_0xc68f('0x24')]({'plain':!![]});return db[_0xc68f('0x74')]['find']({'where':{'name':_0xc68f('0x25'),'userProfileId':_0x270ebe[_0xc68f('0x72')]},'raw':!![]})['then'](function(_0xa5cec1){if(_0xa5cec1&&_0xa5cec1[_0xc68f('0x75')]===0x0){return db[_0xc68f('0x26')][_0xc68f('0x56')]({'name':_0x4a259d[_0xc68f('0x29')],'resourceId':_0x4a259d['id'],'type':_0xa5cec1['name'],'sectionId':_0xa5cec1['id']},{})[_0xc68f('0x22')](function(){return _0x3b13d4;});}else{return _0x3b13d4;}})[_0xc68f('0x49')](function(_0xa5e884){logger['error'](_0xc68f('0x76'),_0xa5e884);throw _0xa5e884;});}return _0x3b13d4;})['then'](respondWithResult(_0x457ae6,null))[_0xc68f('0x49')](handleError(_0x457ae6,null));});_0x28a692['start']();}catch(_0x2cb64c){_0x457ae6[_0xc68f('0x15')](0x1f4)[_0xc68f('0x2a')](_0x2cb64c);}};exports[_0xc68f('0x21')]=function(_0x50f86b,_0x1bce60,_0x84851e){return db[_0xc68f('0x40')]['find']({'where':{'id':_0x50f86b[_0xc68f('0x44')]['id']}})['then'](handleEntityNotFound(_0x1bce60,null))[_0xc68f('0x22')](saveUpdates(_['pick'](_0x50f86b[_0xc68f('0x70')],[_0xc68f('0x29'),_0xc68f('0x77')]),null))[_0xc68f('0x22')](respondWithResult(_0x1bce60,null))[_0xc68f('0x49')](handleError(_0x1bce60,null));};exports[_0xc68f('0x78')]=function(_0x44a8b4,_0x39dd4c,_0x24dd48){return db[_0xc68f('0x40')][_0xc68f('0x48')]({'where':{'id':_0x44a8b4[_0xc68f('0x44')]['id']}})[_0xc68f('0x22')](function(_0x44d2ee){if(_0x44d2ee){return _0x44d2ee[_0xc68f('0x23')]();}})[_0xc68f('0x22')](function(_0x181a7c){var _0x5e1efd=path['join'](config[_0xc68f('0x4f')],_0xc68f('0x5e'),util[_0xc68f('0x55')](_0xc68f('0x54'),_0x181a7c[_0xc68f('0x4b')],_0x181a7c[_0xc68f('0x79')]));var _0xc401cd=path[_0xc68f('0x4e')](config[_0xc68f('0x4f')],_0xc68f('0x50'),util[_0xc68f('0x55')](_0xc68f('0x54'),_0x181a7c['save_name'],_0x181a7c['converted_format']));fs['unlinkSync'](_0x5e1efd);fs[_0xc68f('0x64')](_0xc401cd);return _0x181a7c;})[_0xc68f('0x22')](function(_0x1eef3d){if(_0x1eef3d){return _0x39dd4c['status'](0xcc)[_0xc68f('0x16')]();}})['then'](handleEntityNotFound(_0x39dd4c,null))['catch'](handleError(_0x39dd4c,null));}; \ No newline at end of file +var _0x21f5=['duration','sampleCount','original_channelCount','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','start','description','delete','server/files/sounds/original','original_format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','end','error','stack','send','index','map','Sound','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','length','find','catch','download','params','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','join','root','format','%s.%s','create','file','originalname','basename','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src'];(function(_0x572d8b,_0x15745b){var _0x2935e1=function(_0x466a59){while(--_0x466a59){_0x572d8b['push'](_0x572d8b['shift']());}};_0x2935e1(++_0x15745b);}(_0x21f5,0xfd));var _0x521f=function(_0xedb708,_0x596f87){_0xedb708=_0xedb708-0x0;var _0xa4de1a=_0x21f5[_0xedb708];return _0xa4de1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x521f('0x0'));var zipdir=require(_0x521f('0x1'));var jsonpatch=require(_0x521f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x521f('0x3'));var Mustache=require(_0x521f('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x521f('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x521f('0x6'));var crypto=require(_0x521f('0x7'));var jsforce=require(_0x521f('0x8'));var deskjs=require(_0x521f('0x9'));var toCsv=require(_0x521f('0x5'));var querystring=require(_0x521f('0xa'));var Papa=require(_0x521f('0xb'));var Redis=require(_0x521f('0xc'));var authService=require(_0x521f('0xd'));var qs=require(_0x521f('0xe'));var as=require(_0x521f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x521f('0x10'));var utils=require('../../config/utils');var config=require(_0x521f('0x11'));var licenseUtil=require(_0x521f('0x12'));var db=require(_0x521f('0x13'))['db'];function respondWithStatusCode(_0x16814f,_0x4a0f6e){_0x4a0f6e=_0x4a0f6e||0xcc;return function(_0x254966){if(_0x254966){return _0x16814f[_0x521f('0x14')](_0x4a0f6e);}return _0x16814f['status'](_0x4a0f6e)['end']();};}function respondWithResult(_0x68e3ab,_0xde0bab){_0xde0bab=_0xde0bab||0xc8;return function(_0x2a47ff){if(_0x2a47ff){return _0x68e3ab[_0x521f('0x15')](_0xde0bab)['json'](_0x2a47ff);}};}function respondWithFilteredResult(_0x12ef16,_0x543fd4){return function(_0x18a9bc){if(_0x18a9bc){var _0x18eb01=typeof _0x543fd4[_0x521f('0x16')]===_0x521f('0x17')&&typeof _0x543fd4[_0x521f('0x18')]==='undefined';var _0x197953=_0x18a9bc['count'];var _0x3aa69d=_0x18eb01?0x0:_0x543fd4[_0x521f('0x16')];var _0x2851f1=_0x18eb01?_0x18a9bc[_0x521f('0x19')]:_0x543fd4[_0x521f('0x16')]+_0x543fd4[_0x521f('0x18')];var _0x2752fe;if(_0x2851f1>=_0x197953){_0x2851f1=_0x197953;_0x2752fe=0xc8;}else{_0x2752fe=0xce;}_0x12ef16[_0x521f('0x15')](_0x2752fe);return _0x12ef16['set']('Content-Range',_0x3aa69d+'-'+_0x2851f1+'/'+_0x197953)['json'](_0x18a9bc);}return null;};}function patchUpdates(_0xaf10de){return function(_0x13aa6d){try{jsonpatch[_0x521f('0x1a')](_0x13aa6d,_0xaf10de,!![]);}catch(_0x4a7c6c){return BPromise[_0x521f('0x1b')](_0x4a7c6c);}return _0x13aa6d['save']();};}function saveUpdates(_0x11087e,_0x293112){return function(_0x424ea6){if(_0x424ea6){return _0x424ea6[_0x521f('0x1c')](_0x11087e)[_0x521f('0x1d')](function(_0x3f9c7a){return _0x3f9c7a;});}return null;};}function removeEntity(_0xc591d,_0x3a291a){return function(_0x4de40d){if(_0x4de40d){return _0x4de40d[_0x521f('0x1e')]()[_0x521f('0x1d')](function(){var _0x233339=_0x4de40d[_0x521f('0x1f')]({'plain':!![]});var _0x39b7d6=_0x521f('0x20');return db[_0x521f('0x21')]['destroy']({'where':{'type':_0x39b7d6,'resourceId':_0x233339['id']}})[_0x521f('0x1d')](function(){return _0x4de40d;});})[_0x521f('0x1d')](function(){_0xc591d['status'](0xcc)[_0x521f('0x22')]();});}};}function handleEntityNotFound(_0x5a9e3b,_0x181df5){return function(_0x1b98b8){if(!_0x1b98b8){_0x5a9e3b[_0x521f('0x14')](0x194);}return _0x1b98b8;};}function handleError(_0x3610b8,_0xf44e4){_0xf44e4=_0xf44e4||0x1f4;return function(_0x9158ea){logger[_0x521f('0x23')](_0x9158ea[_0x521f('0x24')]);if(_0x9158ea['name']){delete _0x9158ea['name'];}_0x3610b8[_0x521f('0x15')](_0xf44e4)[_0x521f('0x25')](_0x9158ea);};}exports[_0x521f('0x26')]=function(_0x1d42d9,_0x52834f){var _0x377f8c={},_0x4e900c={},_0x1ee7b7={'count':0x0,'rows':[]};var _0x5d6739=_[_0x521f('0x27')](db[_0x521f('0x28')][_0x521f('0x29')],function(_0x1fdd3c){return{'name':_0x1fdd3c['fieldName'],'type':_0x1fdd3c['type'][_0x521f('0x2a')]};});_0x4e900c[_0x521f('0x2b')]=_[_0x521f('0x27')](_0x5d6739,_0x521f('0x2c'));_0x4e900c[_0x521f('0x2d')]=_[_0x521f('0x2e')](_0x1d42d9[_0x521f('0x2d')]);_0x4e900c[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x4e900c[_0x521f('0x2b')],_0x4e900c[_0x521f('0x2d')]);_0x377f8c[_0x521f('0x31')]=_[_0x521f('0x30')](_0x4e900c[_0x521f('0x2b')],qs[_0x521f('0x32')](_0x1d42d9[_0x521f('0x2d')][_0x521f('0x32')]));_0x377f8c['attributes']=_0x377f8c[_0x521f('0x31')]['length']?_0x377f8c[_0x521f('0x31')]:_0x4e900c[_0x521f('0x2b')];if(!_0x1d42d9[_0x521f('0x2d')][_0x521f('0x33')]('nolimit')){_0x377f8c['limit']=qs[_0x521f('0x18')](_0x1d42d9[_0x521f('0x2d')][_0x521f('0x18')]);_0x377f8c[_0x521f('0x16')]=qs[_0x521f('0x16')](_0x1d42d9[_0x521f('0x2d')][_0x521f('0x16')]);}_0x377f8c[_0x521f('0x34')]=qs[_0x521f('0x35')](_0x1d42d9[_0x521f('0x2d')]['sort']);_0x377f8c[_0x521f('0x36')]=qs['filters'](_[_0x521f('0x37')](_0x1d42d9[_0x521f('0x2d')],_0x4e900c[_0x521f('0x2f')]),_0x5d6739);if(_0x1d42d9[_0x521f('0x2d')][_0x521f('0x38')]){_0x377f8c[_0x521f('0x36')]=_[_0x521f('0x39')](_0x377f8c[_0x521f('0x36')],{'$or':_['map'](_0x5d6739,function(_0x2da7a1){if(_0x2da7a1[_0x521f('0x3a')]!==_0x521f('0x3b')){var _0x54e04f={};_0x54e04f[_0x2da7a1['name']]={'$like':'%'+_0x1d42d9[_0x521f('0x2d')][_0x521f('0x38')]+'%'};return _0x54e04f;}})});}_0x377f8c=_[_0x521f('0x39')]({},_0x377f8c,_0x1d42d9[_0x521f('0x3c')]);var _0x53151b={'where':_0x377f8c[_0x521f('0x36')]};return db[_0x521f('0x28')][_0x521f('0x19')](_0x53151b)[_0x521f('0x1d')](function(_0x29bf23){_0x1ee7b7['count']=_0x29bf23;if(_0x1d42d9['query'][_0x521f('0x3d')]){_0x377f8c[_0x521f('0x3e')]=[{'all':!![]}];}return db[_0x521f('0x28')][_0x521f('0x3f')](_0x377f8c);})[_0x521f('0x1d')](function(_0x47b411){_0x1ee7b7[_0x521f('0x40')]=_0x47b411;return _0x1ee7b7;})[_0x521f('0x1d')](respondWithFilteredResult(_0x52834f,_0x377f8c))['catch'](handleError(_0x52834f,null));};exports['show']=function(_0x18aaf9,_0x3f0421){var _0x1b59d6={'raw':!![],'where':{'id':_0x18aaf9['params']['id']}},_0x24156f={};_0x24156f[_0x521f('0x2b')]=_[_0x521f('0x2e')](db[_0x521f('0x28')][_0x521f('0x29')]);_0x24156f['query']=_['keys'](_0x18aaf9['query']);_0x24156f[_0x521f('0x2f')]=_[_0x521f('0x30')](_0x24156f[_0x521f('0x2b')],_0x24156f[_0x521f('0x2d')]);_0x1b59d6[_0x521f('0x31')]=_[_0x521f('0x30')](_0x24156f[_0x521f('0x2b')],qs[_0x521f('0x32')](_0x18aaf9[_0x521f('0x2d')][_0x521f('0x32')]));_0x1b59d6[_0x521f('0x31')]=_0x1b59d6['attributes'][_0x521f('0x41')]?_0x1b59d6[_0x521f('0x31')]:_0x24156f[_0x521f('0x2b')];if(_0x18aaf9[_0x521f('0x2d')][_0x521f('0x3d')]){_0x1b59d6[_0x521f('0x3e')]=[{'all':!![]}];}_0x1b59d6=_[_0x521f('0x39')]({},_0x1b59d6,_0x18aaf9['options']);return db[_0x521f('0x28')][_0x521f('0x42')](_0x1b59d6)[_0x521f('0x1d')](handleEntityNotFound(_0x3f0421,null))[_0x521f('0x1d')](respondWithResult(_0x3f0421,null))[_0x521f('0x43')](handleError(_0x3f0421,null));};exports[_0x521f('0x44')]=function(_0x178165,_0xfb88dc,_0x9fe4c6){return db[_0x521f('0x28')]['find']({'where':{'id':_0x178165[_0x521f('0x45')]['id']},'attributes':['name',_0x521f('0x46'),_0x521f('0x47')],'raw':!![]})[_0x521f('0x1d')](handleEntityNotFound(_0xfb88dc,null))[_0x521f('0x1d')](function(_0x241562){if(_0x241562){if(!fs[_0x521f('0x48')](path['join'](config['root'],_0x521f('0x49'),_0x241562[_0x521f('0x46')]+'.'+_0x241562[_0x521f('0x47')]))){throw new db[(_0x521f('0x4a'))]['ValidationError'](_0x521f('0x4b'));}return _0xfb88dc[_0x521f('0x44')](path[_0x521f('0x4c')](config[_0x521f('0x4d')],_0x521f('0x49'),util[_0x521f('0x4e')]('%s.%s',_0x241562['save_name'],_0x241562[_0x521f('0x47')])),util[_0x521f('0x4e')](_0x521f('0x4f'),_0x241562[_0x521f('0x2c')],_0x241562[_0x521f('0x47')]));}return null;})[_0x521f('0x43')](handleError(_0xfb88dc,null));};exports[_0x521f('0x50')]=function(_0x120e6f,_0x25533,_0x4fa632){var _0x3ae6ee={'name':path['basename'](_0x120e6f[_0x521f('0x51')][_0x521f('0x52')],path['extname'](_0x120e6f[_0x521f('0x51')][_0x521f('0x52')])),'save_name':path[_0x521f('0x53')](_0x120e6f[_0x521f('0x51')]['filename'],path[_0x521f('0x54')](_0x120e6f[_0x521f('0x51')][_0x521f('0x55')])),'original_format':path[_0x521f('0x54')](_0x120e6f[_0x521f('0x51')]['originalname'])[_0x521f('0x56')](0x1),'converted_format':_0x521f('0x57')};var _0x163727=path['join'](config[_0x521f('0x4d')],'server/files/sounds/original',_0x120e6f['file'][_0x521f('0x55')]);var _0x29ae9c=path[_0x521f('0x4c')](config['root'],_0x521f('0x49'),util[_0x521f('0x4e')]('%s.%s',path[_0x521f('0x53')](_0x120e6f[_0x521f('0x51')][_0x521f('0x55')],path[_0x521f('0x54')](_0x120e6f['file']['filename'])),_0x3ae6ee[_0x521f('0x47')]));logger[_0x521f('0x58')](_0x521f('0x59'),_0x163727);logger[_0x521f('0x58')](_0x521f('0x5a'),_0x29ae9c);try{fs['chmodSync'](_0x163727,parseInt(_0x521f('0x5b'),0x8));var _0x51e9c3=sox[_0x521f('0x5c')](_0x163727,_0x29ae9c,{'sampleRate':0x1f40,'format':_0x521f('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x51e9c3['on'](_0x521f('0x23'),function(_0x173344){fs[_0x521f('0x5d')](_0x163727);_0x25533[_0x521f('0x15')](0x1f4)[_0x521f('0x25')](_0x173344);});_0x51e9c3['on'](_0x521f('0x5e'),function(_0x2b3c9c){_0x3ae6ee['original_duration']=isNaN(_0x2b3c9c[_0x521f('0x5f')])?null:_0x2b3c9c[_0x521f('0x5f')]*0x3e8;_0x3ae6ee['original_sampleCount']=isNaN(_0x2b3c9c[_0x521f('0x60')])?null:_0x2b3c9c[_0x521f('0x60')];_0x3ae6ee[_0x521f('0x61')]=isNaN(_0x2b3c9c['channelCount'])?null:_0x2b3c9c['channelCount'];_0x3ae6ee['original_bitRate']=isNaN(_0x2b3c9c[_0x521f('0x62')])?null:_0x2b3c9c[_0x521f('0x62')];_0x3ae6ee['original_sampleRate']=isNaN(_0x2b3c9c['sampleRate'])?null:_0x2b3c9c[_0x521f('0x63')];});_0x51e9c3['on']('dest',function(_0x4df109){_0x3ae6ee[_0x521f('0x64')]=isNaN(_0x4df109[_0x521f('0x5f')])?null:_0x4df109[_0x521f('0x5f')]*0x3e8;_0x3ae6ee[_0x521f('0x65')]=isNaN(_0x4df109[_0x521f('0x60')])?null:_0x4df109[_0x521f('0x60')];_0x3ae6ee[_0x521f('0x66')]=isNaN(_0x4df109[_0x521f('0x67')])?null:_0x4df109[_0x521f('0x67')];_0x3ae6ee[_0x521f('0x68')]=isNaN(_0x4df109[_0x521f('0x62')])?null:_0x4df109[_0x521f('0x62')];_0x3ae6ee['converted_sampleRate']=isNaN(_0x4df109[_0x521f('0x63')])?null:_0x4df109[_0x521f('0x63')];});_0x51e9c3['on'](_0x521f('0x22'),function(){fs[_0x521f('0x69')](_0x29ae9c,parseInt(_0x521f('0x5b'),0x8));return db[_0x521f('0x28')]['create'](_0x3ae6ee)[_0x521f('0x1d')](function(_0x446b02){var _0x15f186={'role':_0x120e6f[_0x521f('0x6a')]['role'],'userProfileId':_0x120e6f['body'][_0x521f('0x6b')]};if(!_0x15f186)throw new Error(_0x521f('0x6c'));if(_0x15f186['role']==='user'){var _0x6423f=_0x446b02['get']({'plain':!![]});return db[_0x521f('0x6d')]['find']({'where':{'name':_0x521f('0x20'),'userProfileId':_0x15f186['userProfileId']},'raw':!![]})['then'](function(_0x68a921){if(_0x68a921&&_0x68a921[_0x521f('0x6e')]===0x0){return db['UserProfileResource'][_0x521f('0x50')]({'name':_0x6423f[_0x521f('0x2c')],'resourceId':_0x6423f['id'],'type':_0x68a921[_0x521f('0x2c')],'sectionId':_0x68a921['id']},{})['then'](function(){return _0x446b02;});}else{return _0x446b02;}})[_0x521f('0x43')](function(_0x494e9e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x494e9e);throw _0x494e9e;});}return _0x446b02;})['then'](respondWithResult(_0x25533,null))[_0x521f('0x43')](handleError(_0x25533,null));});_0x51e9c3[_0x521f('0x6f')]();}catch(_0x4736f1){_0x25533['status'](0x1f4)[_0x521f('0x25')](_0x4736f1);}};exports[_0x521f('0x1c')]=function(_0x3088c0,_0x327b90,_0x3bbc3c){return db['Sound'][_0x521f('0x42')]({'where':{'id':_0x3088c0[_0x521f('0x45')]['id']}})['then'](handleEntityNotFound(_0x327b90,null))[_0x521f('0x1d')](saveUpdates(_[_0x521f('0x37')](_0x3088c0[_0x521f('0x6a')],['name',_0x521f('0x70')]),null))[_0x521f('0x1d')](respondWithResult(_0x327b90,null))[_0x521f('0x43')](handleError(_0x327b90,null));};exports[_0x521f('0x71')]=function(_0x52e19e,_0x1015af,_0x2ac22a){return db[_0x521f('0x28')]['find']({'where':{'id':_0x52e19e[_0x521f('0x45')]['id']}})[_0x521f('0x1d')](function(_0x36fc29){if(_0x36fc29){return _0x36fc29[_0x521f('0x1e')]();}})[_0x521f('0x1d')](function(_0x97bc){var _0x325260=path[_0x521f('0x4c')](config[_0x521f('0x4d')],_0x521f('0x72'),util['format'](_0x521f('0x4f'),_0x97bc['save_name'],_0x97bc[_0x521f('0x73')]));var _0x3cf920=path[_0x521f('0x4c')](config[_0x521f('0x4d')],_0x521f('0x49'),util[_0x521f('0x4e')]('%s.%s',_0x97bc[_0x521f('0x46')],_0x97bc[_0x521f('0x47')]));fs[_0x521f('0x5d')](_0x325260);fs[_0x521f('0x5d')](_0x3cf920);return _0x97bc;})[_0x521f('0x1d')](function(_0x494115){if(_0x494115){return _0x1015af[_0x521f('0x15')](0xcc)[_0x521f('0x22')]();}})[_0x521f('0x1d')](handleEntityNotFound(_0x1015af,null))[_0x521f('0x43')](handleError(_0x1015af,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1742e0d..d6f8b27 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 _0x7181=['request-promise','path','../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7181,0xa3));var _0x1718=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0x7181[_0x3cd133];return _0x2512c8;};'use strict';var _=require(_0x1718('0x0'));var util=require(_0x1718('0x1'));var logger=require(_0x1718('0x2'))(_0x1718('0x3'));var moment=require('moment');var BPromise=require(_0x1718('0x4'));var rp=require(_0x1718('0x5'));var fs=require('fs');var path=require(_0x1718('0x6'));var rimraf=require('rimraf');var config=require(_0x1718('0x7'));var attributes=require(_0x1718('0x8'));module[_0x1718('0x9')]=function(_0x28afb1,_0x2d0b3e){return _0x28afb1['define'](_0x1718('0xa'),attributes,{'tableName':_0x1718('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36f5=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds','../../config/logger'];(function(_0x36cd15,_0x1b84bc){var _0x461919=function(_0x3e7cc7){while(--_0x3e7cc7){_0x36cd15['push'](_0x36cd15['shift']());}};_0x461919(++_0x1b84bc);}(_0x36f5,0x1e3));var _0x536f=function(_0x34b3bf,_0x184fe3){_0x34b3bf=_0x34b3bf-0x0;var _0x559bd9=_0x36f5[_0x34b3bf];return _0x559bd9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x536f('0x0'))(_0x536f('0x1'));var moment=require(_0x536f('0x2'));var BPromise=require(_0x536f('0x3'));var rp=require(_0x536f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x536f('0x5'));var config=require(_0x536f('0x6'));var attributes=require(_0x536f('0x7'));module[_0x536f('0x8')]=function(_0x2f3540,_0x4d2041){return _0x2f3540[_0x536f('0x9')]('Sound',attributes,{'tableName':_0x536f('0xa'),'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 a96abe6..75ed102 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 _0x9805=['model','include','then','ShowSound','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','options','raw','where','attributes','map'];(function(_0x15675,_0x4fc821){var _0x52ef80=function(_0x28c046){while(--_0x28c046){_0x15675['push'](_0x15675['shift']());}};_0x52ef80(++_0x4fc821);}(_0x9805,0x84));var _0x5980=function(_0x347932,_0x2618cc){_0x347932=_0x347932-0x0;var _0x7a730c=_0x9805[_0x347932];return _0x7a730c;};'use strict';var _=require(_0x5980('0x0'));var util=require('util');var moment=require(_0x5980('0x1'));var BPromise=require(_0x5980('0x2'));var rs=require(_0x5980('0x3'));var fs=require('fs');var Redis=require(_0x5980('0x4'));var db=require(_0x5980('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require(_0x5980('0x8'));var client=jayson[_0x5980('0x9')][_0x5980('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f868f,_0x1726c5,_0x5db8a2){return new BPromise(function(_0x246b1b,_0x1c3a64){return client[_0x5980('0xb')](_0x1f868f,_0x5db8a2)['then'](function(_0x532427){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1726c5,_0x5980('0xe'));logger[_0x5980('0xf')](_0x5980('0x10'),_0x1726c5,_0x5980('0xe'),JSON[_0x5980('0x11')](_0x532427));if(_0x532427['error']){if(_0x532427[_0x5980('0x12')][_0x5980('0x13')]===0x1f4){logger[_0x5980('0x12')](_0x5980('0xd'),_0x1726c5,_0x532427['error']['message']);return _0x1c3a64(_0x532427[_0x5980('0x12')][_0x5980('0x14')]);}logger[_0x5980('0x12')](_0x5980('0xd'),_0x1726c5,_0x532427[_0x5980('0x12')]['message']);return _0x246b1b(_0x532427[_0x5980('0x12')][_0x5980('0x14')]);}else{logger[_0x5980('0xc')](_0x5980('0xd'),_0x1726c5,'request\x20sent');_0x246b1b(_0x532427[_0x5980('0x15')]['message']);}})['catch'](function(_0x44ad1b){logger[_0x5980('0x12')](_0x5980('0xd'),_0x1726c5,_0x44ad1b);_0x1c3a64(_0x44ad1b);});});}exports['ShowSound']=function(_0x4afb93){var _0xaffe7b=this;return new Promise(function(_0x5170d1,_0x108581){return db['Sound'][_0x5980('0x16')]({'raw':_0x4afb93[_0x5980('0x17')]?_0x4afb93['options'][_0x5980('0x18')]===undefined?!![]:![]:!![],'where':_0x4afb93[_0x5980('0x17')]?_0x4afb93['options'][_0x5980('0x19')]||null:null,'attributes':_0x4afb93['options']?_0x4afb93[_0x5980('0x17')][_0x5980('0x1a')]||null:null,'include':_0x4afb93[_0x5980('0x17')]?_0x4afb93['options']['include']?_[_0x5980('0x1b')](_0x4afb93[_0x5980('0x17')]['include'],function(_0x44aee0){return{'model':db[_0x44aee0[_0x5980('0x1c')]],'as':_0x44aee0['as'],'attributes':_0x44aee0['attributes'],'include':_0x44aee0[_0x5980('0x1d')]?_[_0x5980('0x1b')](_0x44aee0[_0x5980('0x1d')],function(_0x190ad1){return{'model':db[_0x190ad1['model']],'as':_0x190ad1['as'],'attributes':_0x190ad1[_0x5980('0x1a')],'include':_0x190ad1[_0x5980('0x1d')]?_[_0x5980('0x1b')](_0x190ad1['include'],function(_0x129b0f){return{'model':db[_0x129b0f[_0x5980('0x1c')]],'as':_0x129b0f['as'],'attributes':_0x129b0f['attributes']};}):[]};}):[]};}):[]:[]})[_0x5980('0x1e')](function(_0x369a02){logger['info'](_0x5980('0x1f'),_0x4afb93);logger[_0x5980('0xf')](_0x5980('0x1f'),_0x4afb93,JSON[_0x5980('0x11')](_0x369a02));_0x5170d1(_0x369a02);})['catch'](function(_0x49996d){logger['error'](_0x5980('0x1f'),_0x49996d[_0x5980('0x14')],_0x4afb93);_0x108581(_0xaffe7b[_0x5980('0x12')](0x1f4,_0x49996d[_0x5980('0x14')]));});});}; \ No newline at end of file +var _0x481b=['then','debug','ShowSound','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','code','error','message','Sound,\x20%s,\x20%s','result','catch','Sound','find','options','raw','where','attributes','include','map','model'];(function(_0x311e55,_0x31a1f6){var _0x42f3d7=function(_0x466a2d){while(--_0x466a2d){_0x311e55['push'](_0x311e55['shift']());}};_0x42f3d7(++_0x31a1f6);}(_0x481b,0xe4));var _0xb481=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x481b[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xb481('0x0'));var util=require(_0xb481('0x1'));var moment=require('moment');var BPromise=require(_0xb481('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb481('0x3'));var db=require(_0xb481('0x4'))['db'];var utils=require(_0xb481('0x5'));var logger=require(_0xb481('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb481('0x7'));var client=jayson[_0xb481('0x8')][_0xb481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e8c4e,_0x25a592,_0x12d219){return new BPromise(function(_0x356ffb,_0x2010a7){return client[_0xb481('0xa')](_0x1e8c4e,_0x12d219)['then'](function(_0x3c07eb){logger[_0xb481('0xb')]('Sound,\x20%s,\x20%s',_0x25a592,_0xb481('0xc'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x25a592,_0xb481('0xc'),JSON['stringify'](_0x3c07eb));if(_0x3c07eb['error']){if(_0x3c07eb['error'][_0xb481('0xd')]===0x1f4){logger[_0xb481('0xe')]('Sound,\x20%s,\x20%s',_0x25a592,_0x3c07eb[_0xb481('0xe')][_0xb481('0xf')]);return _0x2010a7(_0x3c07eb[_0xb481('0xe')][_0xb481('0xf')]);}logger[_0xb481('0xe')](_0xb481('0x10'),_0x25a592,_0x3c07eb['error']['message']);return _0x356ffb(_0x3c07eb[_0xb481('0xe')][_0xb481('0xf')]);}else{logger['info'](_0xb481('0x10'),_0x25a592,_0xb481('0xc'));_0x356ffb(_0x3c07eb[_0xb481('0x11')][_0xb481('0xf')]);}})[_0xb481('0x12')](function(_0x2e5429){logger['error']('Sound,\x20%s,\x20%s',_0x25a592,_0x2e5429);_0x2010a7(_0x2e5429);});});}exports['ShowSound']=function(_0x4d014d){var _0x5d7db5=this;return new Promise(function(_0x2741b5,_0x30cfbc){return db[_0xb481('0x13')][_0xb481('0x14')]({'raw':_0x4d014d[_0xb481('0x15')]?_0x4d014d[_0xb481('0x15')][_0xb481('0x16')]===undefined?!![]:![]:!![],'where':_0x4d014d['options']?_0x4d014d[_0xb481('0x15')][_0xb481('0x17')]||null:null,'attributes':_0x4d014d[_0xb481('0x15')]?_0x4d014d[_0xb481('0x15')][_0xb481('0x18')]||null:null,'include':_0x4d014d['options']?_0x4d014d[_0xb481('0x15')][_0xb481('0x19')]?_[_0xb481('0x1a')](_0x4d014d['options'][_0xb481('0x19')],function(_0x4c50c6){return{'model':db[_0x4c50c6[_0xb481('0x1b')]],'as':_0x4c50c6['as'],'attributes':_0x4c50c6[_0xb481('0x18')],'include':_0x4c50c6[_0xb481('0x19')]?_[_0xb481('0x1a')](_0x4c50c6[_0xb481('0x19')],function(_0x4aa776){return{'model':db[_0x4aa776[_0xb481('0x1b')]],'as':_0x4aa776['as'],'attributes':_0x4aa776[_0xb481('0x18')],'include':_0x4aa776[_0xb481('0x19')]?_[_0xb481('0x1a')](_0x4aa776['include'],function(_0x3a545a){return{'model':db[_0x3a545a[_0xb481('0x1b')]],'as':_0x3a545a['as'],'attributes':_0x3a545a[_0xb481('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb481('0x1c')](function(_0x27937c){logger[_0xb481('0xb')]('ShowSound',_0x4d014d);logger[_0xb481('0x1d')](_0xb481('0x1e'),_0x4d014d,JSON[_0xb481('0x1f')](_0x27937c));_0x2741b5(_0x27937c);})[_0xb481('0x12')](function(_0x5859ba){logger[_0xb481('0xe')]('ShowSound',_0x5859ba[_0xb481('0xf')],_0x4d014d);_0x30cfbc(_0x5d7db5[_0xb481('0xe')](0x1f4,_0x5859ba['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 7b98d43..2088a14 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46ba12,_0x30743e){var _0x2fa912=function(_0xd2b027){while(--_0xd2b027){_0x46ba12['push'](_0x46ba12['shift']());}};_0x2fa912(++_0x30743e);}(_0xb10b,0x12a));var _0xbb10=function(_0x29bfda,_0x30ad24){_0x29bfda=_0x29bfda-0x0;var _0x3f3db5=_0xb10b[_0x29bfda];return _0x3f3db5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x4fc2,0x111));var _0x24fc=function(_0x33a509,_0x10fd22){_0x33a509=_0x33a509-0x0;var _0x33606b=_0x4fc2[_0x33a509];return _0x33606b;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 98a5960..e9ca7f3 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 _0xa36d=['STRING','medium','out','TEXT','sequelize','exports'];(function(_0x15e785,_0x5c6fd8){var _0x5af6d9=function(_0x448002){while(--_0x448002){_0x15e785['push'](_0x15e785['shift']());}};_0x5af6d9(++_0x5c6fd8);}(_0xa36d,0xac));var _0xda36=function(_0x1deb9c,_0x6f1dfb){_0x1deb9c=_0x1deb9c-0x0;var _0xaa380d=_0xa36d[_0x1deb9c];return _0xaa380d;};'use strict';var Sequelize=require(_0xda36('0x0'));module[_0xda36('0x1')]={'uniqueid':{'type':Sequelize[_0xda36('0x2')]},'body':{'type':Sequelize['TEXT'](_0xda36('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xda36('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xda36('0x2')]},'providerResponse':{'type':Sequelize[_0xda36('0x5')]}}; \ No newline at end of file +var _0x006c=['out','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x333ddd,_0x463c1d){var _0x1b0a73=function(_0x10abf5){while(--_0x10abf5){_0x333ddd['push'](_0x333ddd['shift']());}};_0x1b0a73(++_0x463c1d);}(_0x006c,0x9c));var _0xc006=function(_0xd796a9,_0x2561a4){_0xd796a9=_0xd796a9-0x0;var _0x3b9040=_0x006c[_0xd796a9];return _0x3b9040;};'use strict';var Sequelize=require(_0xc006('0x0'));module[_0xc006('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xc006('0x2')](_0xc006('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc006('0x4')]('in',_0xc006('0x5')),'defaultValue':_0xc006('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc006('0x6')]},'providerResponse':{'type':Sequelize[_0xc006('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 1cd56de..e045336 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 _0x6817=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','index','map','SquareMessage'];(function(_0x21c525,_0x3c546d){var _0x5d51cf=function(_0x3e8d67){while(--_0x3e8d67){_0x21c525['push'](_0x21c525['shift']());}};_0x5d51cf(++_0x3c546d);}(_0x6817,0xf8));var _0x7681=function(_0x3860f0,_0x1ca086){_0x3860f0=_0x3860f0-0x0;var _0x20b36d=_0x6817[_0x3860f0];return _0x20b36d;};'use strict';var emlformat=require(_0x7681('0x0'));var rimraf=require(_0x7681('0x1'));var zipdir=require(_0x7681('0x2'));var jsonpatch=require(_0x7681('0x3'));var rp=require(_0x7681('0x4'));var moment=require(_0x7681('0x5'));var BPromise=require(_0x7681('0x6'));var Mustache=require(_0x7681('0x7'));var util=require(_0x7681('0x8'));var path=require(_0x7681('0x9'));var sox=require(_0x7681('0xa'));var csv=require(_0x7681('0xb'));var ejs=require(_0x7681('0xc'));var fs=require('fs');var fs_extra=require(_0x7681('0xd'));var _=require('lodash');var squel=require(_0x7681('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7681('0xf'));var toCsv=require(_0x7681('0xb'));var querystring=require('querystring');var Papa=require(_0x7681('0x10'));var Redis=require(_0x7681('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7681('0x12'));var as=require(_0x7681('0x13'));var hardwareService=require(_0x7681('0x14'));var logger=require(_0x7681('0x15'))('api');var utils=require(_0x7681('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7681('0x17'))['db'];function respondWithStatusCode(_0x131d3a,_0x2154af){_0x2154af=_0x2154af||0xcc;return function(_0x25cf8b){if(_0x25cf8b){return _0x131d3a[_0x7681('0x18')](_0x2154af);}return _0x131d3a['status'](_0x2154af)[_0x7681('0x19')]();};}function respondWithResult(_0x180988,_0x5aeff4){_0x5aeff4=_0x5aeff4||0xc8;return function(_0x4baacc){if(_0x4baacc){return _0x180988[_0x7681('0x1a')](_0x5aeff4)[_0x7681('0x1b')](_0x4baacc);}};}function respondWithFilteredResult(_0xcbde3a,_0x2134d1){return function(_0x176db6){if(_0x176db6){var _0x38f89a=typeof _0x2134d1[_0x7681('0x1c')]===_0x7681('0x1d')&&typeof _0x2134d1[_0x7681('0x1e')]===_0x7681('0x1d');var _0x2d9714=_0x176db6[_0x7681('0x1f')];var _0x36720e=_0x38f89a?0x0:_0x2134d1[_0x7681('0x1c')];var _0x1ca251=_0x38f89a?_0x176db6['count']:_0x2134d1[_0x7681('0x1c')]+_0x2134d1[_0x7681('0x1e')];var _0xc7bac7;if(_0x1ca251>=_0x2d9714){_0x1ca251=_0x2d9714;_0xc7bac7=0xc8;}else{_0xc7bac7=0xce;}_0xcbde3a[_0x7681('0x1a')](_0xc7bac7);return _0xcbde3a[_0x7681('0x20')]('Content-Range',_0x36720e+'-'+_0x1ca251+'/'+_0x2d9714)['json'](_0x176db6);}return null;};}function patchUpdates(_0xb541fc){return function(_0x1d35cd){try{jsonpatch[_0x7681('0x21')](_0x1d35cd,_0xb541fc,!![]);}catch(_0x29b7ec){return BPromise[_0x7681('0x22')](_0x29b7ec);}return _0x1d35cd['save']();};}function saveUpdates(_0x4fed1e,_0x5374b8){return function(_0x10897f){if(_0x10897f){return _0x10897f[_0x7681('0x23')](_0x4fed1e)[_0x7681('0x24')](function(_0x189b69){return _0x189b69;});}return null;};}function removeEntity(_0x2edb2f,_0x5e8291){return function(_0x5a9798){if(_0x5a9798){return _0x5a9798['destroy']()[_0x7681('0x24')](function(){_0x2edb2f[_0x7681('0x1a')](0xcc)[_0x7681('0x19')]();});}};}function handleEntityNotFound(_0x4f9f8d,_0x4f000d){return function(_0x43a870){if(!_0x43a870){_0x4f9f8d[_0x7681('0x18')](0x194);}return _0x43a870;};}function handleError(_0x409e8f,_0xe75ee1){_0xe75ee1=_0xe75ee1||0x1f4;return function(_0x425d8e){logger[_0x7681('0x25')](_0x425d8e[_0x7681('0x26')]);if(_0x425d8e['name']){delete _0x425d8e[_0x7681('0x27')];}_0x409e8f[_0x7681('0x1a')](_0xe75ee1)[_0x7681('0x28')](_0x425d8e);};}exports[_0x7681('0x29')]=function(_0x57001a,_0x3c40ff){var _0x36ac73={},_0x575ae3={},_0x2f1f86={'count':0x0,'rows':[]};var _0x1a0c0e=_[_0x7681('0x2a')](db[_0x7681('0x2b')]['rawAttributes'],function(_0x2993a3){return{'name':_0x2993a3[_0x7681('0x2c')],'type':_0x2993a3[_0x7681('0x2d')][_0x7681('0x2e')]};});_0x575ae3[_0x7681('0x2f')]=_['map'](_0x1a0c0e,'name');_0x575ae3['query']=_[_0x7681('0x30')](_0x57001a['query']);_0x575ae3[_0x7681('0x31')]=_[_0x7681('0x32')](_0x575ae3[_0x7681('0x2f')],_0x575ae3[_0x7681('0x33')]);_0x36ac73[_0x7681('0x34')]=_[_0x7681('0x32')](_0x575ae3[_0x7681('0x2f')],qs[_0x7681('0x35')](_0x57001a['query']['fields']));_0x36ac73['attributes']=_0x36ac73['attributes'][_0x7681('0x36')]?_0x36ac73[_0x7681('0x34')]:_0x575ae3['model'];if(!_0x57001a[_0x7681('0x33')]['hasOwnProperty'](_0x7681('0x37'))){_0x36ac73['limit']=qs[_0x7681('0x1e')](_0x57001a['query']['limit']);_0x36ac73[_0x7681('0x1c')]=qs[_0x7681('0x1c')](_0x57001a[_0x7681('0x33')][_0x7681('0x1c')]);}_0x36ac73[_0x7681('0x38')]=qs[_0x7681('0x39')](_0x57001a[_0x7681('0x33')][_0x7681('0x39')]);_0x36ac73['where']=qs[_0x7681('0x31')](_[_0x7681('0x3a')](_0x57001a['query'],_0x575ae3['filters']),_0x1a0c0e);if(_0x57001a['query']['filter']){_0x36ac73[_0x7681('0x3b')]=_[_0x7681('0x3c')](_0x36ac73[_0x7681('0x3b')],{'$or':_[_0x7681('0x2a')](_0x1a0c0e,function(_0x1951b4){if(_0x1951b4[_0x7681('0x2d')]!==_0x7681('0x3d')){var _0x5b7983={};_0x5b7983[_0x1951b4[_0x7681('0x27')]]={'$like':'%'+_0x57001a['query'][_0x7681('0x3e')]+'%'};return _0x5b7983;}})});}_0x36ac73=_[_0x7681('0x3c')]({},_0x36ac73,_0x57001a[_0x7681('0x3f')]);var _0x3ed3a1={'where':_0x36ac73[_0x7681('0x3b')]};return db[_0x7681('0x2b')]['count'](_0x3ed3a1)['then'](function(_0x192199){_0x2f1f86[_0x7681('0x1f')]=_0x192199;if(_0x57001a[_0x7681('0x33')][_0x7681('0x40')]){_0x36ac73['include']=[{'all':!![]}];}return db[_0x7681('0x2b')]['findAll'](_0x36ac73);})['then'](function(_0x15285d){_0x2f1f86[_0x7681('0x41')]=_0x15285d;return _0x2f1f86;})['then'](respondWithFilteredResult(_0x3c40ff,_0x36ac73))[_0x7681('0x42')](handleError(_0x3c40ff,null));};exports[_0x7681('0x43')]=function(_0x5cd0de,_0x9d3bfe){var _0x599963={'raw':!![],'where':{'id':_0x5cd0de[_0x7681('0x44')]['id']}},_0x4f6ea4={};_0x4f6ea4[_0x7681('0x2f')]=_[_0x7681('0x30')](db[_0x7681('0x2b')][_0x7681('0x45')]);_0x4f6ea4[_0x7681('0x33')]=_['keys'](_0x5cd0de['query']);_0x4f6ea4[_0x7681('0x31')]=_[_0x7681('0x32')](_0x4f6ea4['model'],_0x4f6ea4['query']);_0x599963[_0x7681('0x34')]=_['intersection'](_0x4f6ea4[_0x7681('0x2f')],qs[_0x7681('0x35')](_0x5cd0de[_0x7681('0x33')][_0x7681('0x35')]));_0x599963[_0x7681('0x34')]=_0x599963[_0x7681('0x34')][_0x7681('0x36')]?_0x599963[_0x7681('0x34')]:_0x4f6ea4[_0x7681('0x2f')];if(_0x5cd0de[_0x7681('0x33')][_0x7681('0x40')]){_0x599963['include']=[{'all':!![]}];}_0x599963=_[_0x7681('0x3c')]({},_0x599963,_0x5cd0de['options']);return db[_0x7681('0x2b')][_0x7681('0x46')](_0x599963)[_0x7681('0x24')](handleEntityNotFound(_0x9d3bfe,null))['then'](respondWithResult(_0x9d3bfe,null))['catch'](handleError(_0x9d3bfe,null));};exports[_0x7681('0x47')]=function(_0x3bca84,_0x10b49f){return db[_0x7681('0x2b')][_0x7681('0x47')](_0x3bca84[_0x7681('0x48')],{})['then'](respondWithResult(_0x10b49f,0xc9))[_0x7681('0x42')](handleError(_0x10b49f,null));};exports[_0x7681('0x23')]=function(_0x5f123d,_0xa39727){if(_0x5f123d[_0x7681('0x48')]['id']){delete _0x5f123d['body']['id'];}return db[_0x7681('0x2b')][_0x7681('0x46')]({'where':{'id':_0x5f123d[_0x7681('0x44')]['id']}})['then'](handleEntityNotFound(_0xa39727,null))[_0x7681('0x24')](saveUpdates(_0x5f123d['body'],null))[_0x7681('0x24')](respondWithResult(_0xa39727,null))['catch'](handleError(_0xa39727,null));};exports['destroy']=function(_0x581d77,_0x10c336){return db[_0x7681('0x2b')][_0x7681('0x46')]({'where':{'id':_0x581d77[_0x7681('0x44')]['id']}})[_0x7681('0x24')](handleEntityNotFound(_0x10c336,null))['then'](removeEntity(_0x10c336,null))['catch'](handleError(_0x10c336,null));}; \ No newline at end of file +var _0x530f=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','SquareMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x32e94b,_0x38c7a7){var _0x3b1567=function(_0x282670){while(--_0x282670){_0x32e94b['push'](_0x32e94b['shift']());}};_0x3b1567(++_0x38c7a7);}(_0x530f,0x167));var _0xf530=function(_0x19a206,_0x1d7556){_0x19a206=_0x19a206-0x0;var _0x7514ac=_0x530f[_0x19a206];return _0x7514ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf530('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf530('0x1'));var moment=require(_0xf530('0x2'));var BPromise=require(_0xf530('0x3'));var Mustache=require(_0xf530('0x4'));var util=require(_0xf530('0x5'));var path=require(_0xf530('0x6'));var sox=require(_0xf530('0x7'));var csv=require(_0xf530('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf530('0x9'));var _=require(_0xf530('0xa'));var squel=require(_0xf530('0xb'));var crypto=require('crypto');var jsforce=require(_0xf530('0xc'));var deskjs=require(_0xf530('0xd'));var toCsv=require(_0xf530('0x8'));var querystring=require(_0xf530('0xe'));var Papa=require(_0xf530('0xf'));var Redis=require(_0xf530('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf530('0x11'));var as=require(_0xf530('0x12'));var hardwareService=require(_0xf530('0x13'));var logger=require(_0xf530('0x14'))(_0xf530('0x15'));var utils=require(_0xf530('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf530('0x17'))['db'];function respondWithStatusCode(_0x194b1f,_0x27f552){_0x27f552=_0x27f552||0xcc;return function(_0x332ce2){if(_0x332ce2){return _0x194b1f[_0xf530('0x18')](_0x27f552);}return _0x194b1f['status'](_0x27f552)[_0xf530('0x19')]();};}function respondWithResult(_0x39865c,_0x3db836){_0x3db836=_0x3db836||0xc8;return function(_0x388a3c){if(_0x388a3c){return _0x39865c[_0xf530('0x1a')](_0x3db836)[_0xf530('0x1b')](_0x388a3c);}};}function respondWithFilteredResult(_0x22a47f,_0x36485d){return function(_0x4cbfc0){if(_0x4cbfc0){var _0x244fb8=typeof _0x36485d[_0xf530('0x1c')]==='undefined'&&typeof _0x36485d[_0xf530('0x1d')]===_0xf530('0x1e');var _0x4d9345=_0x4cbfc0[_0xf530('0x1f')];var _0x255bb3=_0x244fb8?0x0:_0x36485d[_0xf530('0x1c')];var _0x46f5ed=_0x244fb8?_0x4cbfc0['count']:_0x36485d[_0xf530('0x1c')]+_0x36485d[_0xf530('0x1d')];var _0x116a75;if(_0x46f5ed>=_0x4d9345){_0x46f5ed=_0x4d9345;_0x116a75=0xc8;}else{_0x116a75=0xce;}_0x22a47f[_0xf530('0x1a')](_0x116a75);return _0x22a47f[_0xf530('0x20')](_0xf530('0x21'),_0x255bb3+'-'+_0x46f5ed+'/'+_0x4d9345)['json'](_0x4cbfc0);}return null;};}function patchUpdates(_0x3f47ad){return function(_0x191e0e){try{jsonpatch[_0xf530('0x22')](_0x191e0e,_0x3f47ad,!![]);}catch(_0x22e53b){return BPromise[_0xf530('0x23')](_0x22e53b);}return _0x191e0e['save']();};}function saveUpdates(_0x4dbbaf,_0x5679ce){return function(_0x4375af){if(_0x4375af){return _0x4375af[_0xf530('0x24')](_0x4dbbaf)[_0xf530('0x25')](function(_0x41ade8){return _0x41ade8;});}return null;};}function removeEntity(_0x44625f,_0x4bb1b3){return function(_0x14eba3){if(_0x14eba3){return _0x14eba3[_0xf530('0x26')]()[_0xf530('0x25')](function(){_0x44625f[_0xf530('0x1a')](0xcc)[_0xf530('0x19')]();});}};}function handleEntityNotFound(_0x202fee,_0x254187){return function(_0x148ebe){if(!_0x148ebe){_0x202fee[_0xf530('0x18')](0x194);}return _0x148ebe;};}function handleError(_0x1f3c88,_0x1d14d0){_0x1d14d0=_0x1d14d0||0x1f4;return function(_0x594b74){logger[_0xf530('0x27')](_0x594b74[_0xf530('0x28')]);if(_0x594b74[_0xf530('0x29')]){delete _0x594b74['name'];}_0x1f3c88[_0xf530('0x1a')](_0x1d14d0)['send'](_0x594b74);};}exports['index']=function(_0x3108d,_0x3efab8){var _0x45ae40={},_0x5dea4d={},_0xf1c4f2={'count':0x0,'rows':[]};var _0x3f3480=_[_0xf530('0x2a')](db[_0xf530('0x2b')][_0xf530('0x2c')],function(_0xf9ca22){return{'name':_0xf9ca22[_0xf530('0x2d')],'type':_0xf9ca22[_0xf530('0x2e')][_0xf530('0x2f')]};});_0x5dea4d[_0xf530('0x30')]=_['map'](_0x3f3480,_0xf530('0x29'));_0x5dea4d['query']=_[_0xf530('0x31')](_0x3108d[_0xf530('0x32')]);_0x5dea4d['filters']=_['intersection'](_0x5dea4d['model'],_0x5dea4d[_0xf530('0x32')]);_0x45ae40[_0xf530('0x33')]=_[_0xf530('0x34')](_0x5dea4d[_0xf530('0x30')],qs['fields'](_0x3108d['query'][_0xf530('0x35')]));_0x45ae40[_0xf530('0x33')]=_0x45ae40[_0xf530('0x33')][_0xf530('0x36')]?_0x45ae40[_0xf530('0x33')]:_0x5dea4d[_0xf530('0x30')];if(!_0x3108d[_0xf530('0x32')]['hasOwnProperty'](_0xf530('0x37'))){_0x45ae40[_0xf530('0x1d')]=qs[_0xf530('0x1d')](_0x3108d[_0xf530('0x32')][_0xf530('0x1d')]);_0x45ae40['offset']=qs[_0xf530('0x1c')](_0x3108d['query'][_0xf530('0x1c')]);}_0x45ae40['order']=qs[_0xf530('0x38')](_0x3108d[_0xf530('0x32')][_0xf530('0x38')]);_0x45ae40[_0xf530('0x39')]=qs['filters'](_[_0xf530('0x3a')](_0x3108d['query'],_0x5dea4d['filters']),_0x3f3480);if(_0x3108d[_0xf530('0x32')][_0xf530('0x3b')]){_0x45ae40[_0xf530('0x39')]=_[_0xf530('0x3c')](_0x45ae40[_0xf530('0x39')],{'$or':_[_0xf530('0x2a')](_0x3f3480,function(_0x119da8){if(_0x119da8[_0xf530('0x2e')]!==_0xf530('0x3d')){var _0x1c777c={};_0x1c777c[_0x119da8[_0xf530('0x29')]]={'$like':'%'+_0x3108d[_0xf530('0x32')]['filter']+'%'};return _0x1c777c;}})});}_0x45ae40=_[_0xf530('0x3c')]({},_0x45ae40,_0x3108d[_0xf530('0x3e')]);var _0x419408={'where':_0x45ae40[_0xf530('0x39')]};return db[_0xf530('0x2b')][_0xf530('0x1f')](_0x419408)[_0xf530('0x25')](function(_0x549273){_0xf1c4f2['count']=_0x549273;if(_0x3108d['query'][_0xf530('0x3f')]){_0x45ae40[_0xf530('0x40')]=[{'all':!![]}];}return db[_0xf530('0x2b')][_0xf530('0x41')](_0x45ae40);})[_0xf530('0x25')](function(_0x4cb84f){_0xf1c4f2[_0xf530('0x42')]=_0x4cb84f;return _0xf1c4f2;})['then'](respondWithFilteredResult(_0x3efab8,_0x45ae40))[_0xf530('0x43')](handleError(_0x3efab8,null));};exports[_0xf530('0x44')]=function(_0x34ca67,_0x6fa58){var _0x154122={'raw':!![],'where':{'id':_0x34ca67[_0xf530('0x45')]['id']}},_0x5571e4={};_0x5571e4[_0xf530('0x30')]=_['keys'](db['SquareMessage'][_0xf530('0x2c')]);_0x5571e4[_0xf530('0x32')]=_['keys'](_0x34ca67[_0xf530('0x32')]);_0x5571e4['filters']=_[_0xf530('0x34')](_0x5571e4[_0xf530('0x30')],_0x5571e4[_0xf530('0x32')]);_0x154122['attributes']=_['intersection'](_0x5571e4[_0xf530('0x30')],qs['fields'](_0x34ca67[_0xf530('0x32')]['fields']));_0x154122[_0xf530('0x33')]=_0x154122[_0xf530('0x33')]['length']?_0x154122['attributes']:_0x5571e4['model'];if(_0x34ca67[_0xf530('0x32')]['includeAll']){_0x154122[_0xf530('0x40')]=[{'all':!![]}];}_0x154122=_[_0xf530('0x3c')]({},_0x154122,_0x34ca67[_0xf530('0x3e')]);return db[_0xf530('0x2b')][_0xf530('0x46')](_0x154122)[_0xf530('0x25')](handleEntityNotFound(_0x6fa58,null))[_0xf530('0x25')](respondWithResult(_0x6fa58,null))[_0xf530('0x43')](handleError(_0x6fa58,null));};exports[_0xf530('0x47')]=function(_0xb9707e,_0xc3f01e){return db[_0xf530('0x2b')][_0xf530('0x47')](_0xb9707e[_0xf530('0x48')],{})[_0xf530('0x25')](respondWithResult(_0xc3f01e,0xc9))[_0xf530('0x43')](handleError(_0xc3f01e,null));};exports[_0xf530('0x24')]=function(_0x73b6d9,_0x1d5b5e){if(_0x73b6d9[_0xf530('0x48')]['id']){delete _0x73b6d9[_0xf530('0x48')]['id'];}return db[_0xf530('0x2b')][_0xf530('0x46')]({'where':{'id':_0x73b6d9[_0xf530('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d5b5e,null))[_0xf530('0x25')](saveUpdates(_0x73b6d9[_0xf530('0x48')],null))[_0xf530('0x25')](respondWithResult(_0x1d5b5e,null))[_0xf530('0x43')](handleError(_0x1d5b5e,null));};exports[_0xf530('0x26')]=function(_0x484dca,_0x175131){return db[_0xf530('0x2b')]['find']({'where':{'id':_0x484dca[_0xf530('0x45')]['id']}})[_0xf530('0x25')](handleEntityNotFound(_0x175131,null))[_0xf530('0x25')](removeEntity(_0x175131,null))[_0xf530('0x43')](handleError(_0x175131,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4b1ed53..c8c02c3 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 _0x017d=['util','moment','bluebird','path','../../config/environment','./squareMessage.attributes','define','square_messages','lodash'];(function(_0x3cdaa9,_0x3f2b97){var _0x181ddb=function(_0x5b44b2){while(--_0x5b44b2){_0x3cdaa9['push'](_0x3cdaa9['shift']());}};_0x181ddb(++_0x3f2b97);}(_0x017d,0x194));var _0xd017=function(_0x2246d3,_0x3c83c3){_0x2246d3=_0x2246d3-0x0;var _0x4cc2e4=_0x017d[_0x2246d3];return _0x4cc2e4;};'use strict';var _=require(_0xd017('0x0'));var util=require(_0xd017('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd017('0x2'));var BPromise=require(_0xd017('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd017('0x4'));var rimraf=require('rimraf');var config=require(_0xd017('0x5'));var attributes=require(_0xd017('0x6'));module['exports']=function(_0x4aab9b,_0x5d55db){return _0x4aab9b[_0xd017('0x7')]('SquareMessage',attributes,{'tableName':_0xd017('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7d2=['rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages','lodash','util','../../config/logger','api','moment','path'];(function(_0x229b42,_0x323c51){var _0x51883c=function(_0x342b81){while(--_0x342b81){_0x229b42['push'](_0x229b42['shift']());}};_0x51883c(++_0x323c51);}(_0xe7d2,0xf7));var _0x2e7d=function(_0x348db0,_0x103906){_0x348db0=_0x348db0-0x0;var _0x405e55=_0xe7d2[_0x348db0];return _0x405e55;};'use strict';var _=require(_0x2e7d('0x0'));var util=require(_0x2e7d('0x1'));var logger=require(_0x2e7d('0x2'))(_0x2e7d('0x3'));var moment=require(_0x2e7d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e7d('0x5'));var rimraf=require(_0x2e7d('0x6'));var config=require(_0x2e7d('0x7'));var attributes=require(_0x2e7d('0x8'));module[_0x2e7d('0x9')]=function(_0x29839c,_0x28e757){return _0x29839c['define']('SquareMessage',attributes,{'tableName':_0x2e7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 247ea64..0e03781 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 _0x45be=['catch','CreateSquareMessage','SquareMessage','body','options','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','result'];(function(_0x1891df,_0x13f014){var _0x4547d6=function(_0x2b222e){while(--_0x2b222e){_0x1891df['push'](_0x1891df['shift']());}};_0x4547d6(++_0x13f014);}(_0x45be,0x18c));var _0xe45b=function(_0x5120e8,_0x123cab){_0x5120e8=_0x5120e8-0x0;var _0x271c2a=_0x45be[_0x5120e8];return _0x271c2a;};'use strict';var _=require('lodash');var util=require(_0xe45b('0x0'));var moment=require(_0xe45b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe45b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe45b('0x3'))['db'];var utils=require(_0xe45b('0x4'));var logger=require(_0xe45b('0x5'))('rpc');var config=require(_0xe45b('0x6'));var jayson=require(_0xe45b('0x7'));var client=jayson['client'][_0xe45b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x440830,_0x330b15,_0x8542d){return new BPromise(function(_0x45bd44,_0xf35329){return client[_0xe45b('0x9')](_0x440830,_0x8542d)[_0xe45b('0xa')](function(_0x1ad002){logger['info']('SquareMessage,\x20%s,\x20%s',_0x330b15,_0xe45b('0xb'));logger['debug'](_0xe45b('0xc'),_0x330b15,'request\x20sent',JSON[_0xe45b('0xd')](_0x1ad002));if(_0x1ad002[_0xe45b('0xe')]){if(_0x1ad002[_0xe45b('0xe')][_0xe45b('0xf')]===0x1f4){logger[_0xe45b('0xe')](_0xe45b('0x10'),_0x330b15,_0x1ad002[_0xe45b('0xe')][_0xe45b('0x11')]);return _0xf35329(_0x1ad002[_0xe45b('0xe')][_0xe45b('0x11')]);}logger[_0xe45b('0xe')](_0xe45b('0x10'),_0x330b15,_0x1ad002[_0xe45b('0xe')][_0xe45b('0x11')]);return _0x45bd44(_0x1ad002['error']['message']);}else{logger[_0xe45b('0x12')](_0xe45b('0x10'),_0x330b15,_0xe45b('0xb'));_0x45bd44(_0x1ad002[_0xe45b('0x13')]['message']);}})[_0xe45b('0x14')](function(_0x21afd8){logger[_0xe45b('0xe')](_0xe45b('0x10'),_0x330b15,_0x21afd8);_0xf35329(_0x21afd8);});});}exports[_0xe45b('0x15')]=function(_0x4d0e4a){var _0x512082=this;return new Promise(function(_0x36590a,_0x77a8a4){return db[_0xe45b('0x16')]['create'](_0x4d0e4a[_0xe45b('0x17')],{'raw':_0x4d0e4a[_0xe45b('0x18')]?_0x4d0e4a[_0xe45b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe45b('0xa')](function(_0x497294){logger['info'](_0xe45b('0x15'),_0x4d0e4a);logger[_0xe45b('0x19')](_0xe45b('0x15'),_0x4d0e4a,JSON[_0xe45b('0xd')](_0x497294));_0x36590a(_0x497294);})[_0xe45b('0x14')](function(_0x12e07a){logger[_0xe45b('0xe')](_0xe45b('0x15'),_0x12e07a[_0xe45b('0x11')],_0x4d0e4a);_0x77a8a4(_0x512082[_0xe45b('0xe')](0x1f4,_0x12e07a[_0xe45b('0x11')]));});});}; \ No newline at end of file +var _0x058a=['stringify','error','code','message','info','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2fa1c3,_0xee20db){var _0x12161e=function(_0x16c048){while(--_0x16c048){_0x2fa1c3['push'](_0x2fa1c3['shift']());}};_0x12161e(++_0xee20db);}(_0x058a,0xc0));var _0xa058=function(_0x1ba373,_0xda4d21){_0x1ba373=_0x1ba373-0x0;var _0x4e0681=_0x058a[_0x1ba373];return _0x4e0681;};'use strict';var _=require(_0xa058('0x0'));var util=require(_0xa058('0x1'));var moment=require(_0xa058('0x2'));var BPromise=require(_0xa058('0x3'));var rs=require(_0xa058('0x4'));var fs=require('fs');var Redis=require(_0xa058('0x5'));var db=require(_0xa058('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa058('0x7'));var config=require('../../config/environment');var jayson=require(_0xa058('0x8'));var client=jayson[_0xa058('0x9')][_0xa058('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x585f9f,_0x433359,_0x21f038){return new BPromise(function(_0x114c2e,_0x373a93){return client[_0xa058('0xb')](_0x585f9f,_0x21f038)[_0xa058('0xc')](function(_0x5b8e8c){logger['info'](_0xa058('0xd'),_0x433359,_0xa058('0xe'));logger[_0xa058('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x433359,'request\x20sent',JSON[_0xa058('0x10')](_0x5b8e8c));if(_0x5b8e8c[_0xa058('0x11')]){if(_0x5b8e8c[_0xa058('0x11')][_0xa058('0x12')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x433359,_0x5b8e8c[_0xa058('0x11')][_0xa058('0x13')]);return _0x373a93(_0x5b8e8c[_0xa058('0x11')][_0xa058('0x13')]);}logger['error'](_0xa058('0xd'),_0x433359,_0x5b8e8c['error']['message']);return _0x114c2e(_0x5b8e8c[_0xa058('0x11')]['message']);}else{logger[_0xa058('0x14')](_0xa058('0xd'),_0x433359,_0xa058('0xe'));_0x114c2e(_0x5b8e8c['result'][_0xa058('0x13')]);}})['catch'](function(_0xd2f45){logger[_0xa058('0x11')]('SquareMessage,\x20%s,\x20%s',_0x433359,_0xd2f45);_0x373a93(_0xd2f45);});});}exports[_0xa058('0x15')]=function(_0x8c47d){var _0x1b0441=this;return new Promise(function(_0x1073c4,_0x2cb1d4){return db[_0xa058('0x16')][_0xa058('0x17')](_0x8c47d[_0xa058('0x18')],{'raw':_0x8c47d[_0xa058('0x19')]?_0x8c47d['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x9d644d){logger[_0xa058('0x14')]('CreateSquareMessage',_0x8c47d);logger[_0xa058('0xf')](_0xa058('0x15'),_0x8c47d,JSON[_0xa058('0x10')](_0x9d644d));_0x1073c4(_0x9d644d);})['catch'](function(_0xdf70fb){logger['error'](_0xa058('0x15'),_0xdf70fb[_0xa058('0x13')],_0x8c47d);_0x2cb1d4(_0x1b0441[_0xa058('0x11')](0x1f4,_0xdf70fb[_0xa058('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3524c2b..f7e8547 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 _0x1e5c=['destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','put','update','delete'];(function(_0x3a56ed,_0x5ee0e1){var _0x201f0b=function(_0x905e70){while(--_0x905e70){_0x3a56ed['push'](_0x3a56ed['shift']());}};_0x201f0b(++_0x5ee0e1);}(_0x1e5c,0x6f));var _0xc1e5=function(_0x59d167,_0x1dac97){_0x59d167=_0x59d167-0x0;var _0x4a2fb7=_0x1e5c[_0x59d167];return _0x4a2fb7;};'use strict';var multer=require(_0xc1e5('0x0'));var util=require(_0xc1e5('0x1'));var path=require(_0xc1e5('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1e5('0x3'));var router=express['Router']();var fs_extra=require(_0xc1e5('0x4'));var auth=require(_0xc1e5('0x5'));var interaction=require(_0xc1e5('0x6'));var config=require(_0xc1e5('0x7'));var controller=require(_0xc1e5('0x8'));router[_0xc1e5('0x9')]('/',auth[_0xc1e5('0xa')](),controller[_0xc1e5('0xb')]);router[_0xc1e5('0x9')](_0xc1e5('0xc'),auth['isAuthenticated'](),controller[_0xc1e5('0xd')]);router['get']('/:id/test',auth[_0xc1e5('0xa')](),timeout(_0xc1e5('0xe')),controller[_0xc1e5('0xf')]);router[_0xc1e5('0x10')]('/',auth[_0xc1e5('0xa')](),controller[_0xc1e5('0x11')]);router[_0xc1e5('0x12')](_0xc1e5('0xc'),auth['isAuthenticated'](),controller[_0xc1e5('0x13')]);router[_0xc1e5('0x14')](_0xc1e5('0xc'),auth[_0xc1e5('0xa')](),controller[_0xc1e5('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6cfa=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','index','/:id','isAuthenticated','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x312a65,_0x203742){var _0x27a4af=function(_0x36e81d){while(--_0x36e81d){_0x312a65['push'](_0x312a65['shift']());}};_0x27a4af(++_0x203742);}(_0x6cfa,0x1e1));var _0xa6cf=function(_0x331ade,_0x149e32){_0x331ade=_0x331ade-0x0;var _0x495b12=_0x6cfa[_0x331ade];return _0x495b12;};'use strict';var multer=require(_0xa6cf('0x0'));var util=require('util');var path=require(_0xa6cf('0x1'));var timeout=require(_0xa6cf('0x2'));var express=require('express');var router=express[_0xa6cf('0x3')]();var fs_extra=require(_0xa6cf('0x4'));var auth=require(_0xa6cf('0x5'));var interaction=require(_0xa6cf('0x6'));var config=require('../../config/environment');var controller=require(_0xa6cf('0x7'));router[_0xa6cf('0x8')]('/',auth['isAuthenticated'](),controller[_0xa6cf('0x9')]);router[_0xa6cf('0x8')](_0xa6cf('0xa'),auth[_0xa6cf('0xb')](),controller['show']);router[_0xa6cf('0x8')](_0xa6cf('0xc'),auth[_0xa6cf('0xb')](),timeout(_0xa6cf('0xd')),controller[_0xa6cf('0xe')]);router[_0xa6cf('0xf')]('/',auth['isAuthenticated'](),controller[_0xa6cf('0x10')]);router[_0xa6cf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa6cf('0x12')]);router[_0xa6cf('0x13')](_0xa6cf('0xa'),auth[_0xa6cf('0xb')](),controller[_0xa6cf('0x14')]);module[_0xa6cf('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 1705164..abd2e81 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 _0x9ba8=['STRING'];(function(_0x25f487,_0x34cb75){var _0x37cb6a=function(_0x199189){while(--_0x199189){_0x25f487['push'](_0x25f487['shift']());}};_0x37cb6a(++_0x34cb75);}(_0x9ba8,0x153));var _0x89ba=function(_0xe2cbd3,_0x678694){_0xe2cbd3=_0xe2cbd3-0x0;var _0x5155e3=_0x9ba8[_0xe2cbd3];return _0x5155e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x89ba('0x0')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x89ba('0x0')]}}; \ No newline at end of file +var _0xa135=['sequelize','STRING'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xa135,0x1b8));var _0x5a13=function(_0x59a17a,_0x308304){_0x59a17a=_0x59a17a-0x0;var _0x4584ad=_0xa135[_0x59a17a];return _0x4584ad;};'use strict';var Sequelize=require(_0x5a13('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x5a13('0x1')]},'description':{'type':Sequelize[_0x5a13('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 37a5992..6cbd929 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 _0x1659=['show','params','keys','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','openSync','closeSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','ODBC','UserProfileResource','destroy','sendStatus','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch'];(function(_0x5de2ca,_0x403903){var _0x49e746=function(_0xfd9068){while(--_0xfd9068){_0x5de2ca['push'](_0x5de2ca['shift']());}};_0x49e746(++_0x403903);}(_0x1659,0x112));var _0x9165=function(_0x33e9c7,_0x4cb48e){_0x33e9c7=_0x33e9c7-0x0;var _0x14bdb3=_0x1659[_0x33e9c7];return _0x14bdb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9165('0x0'));var jsonpatch=require(_0x9165('0x1'));var rp=require(_0x9165('0x2'));var moment=require(_0x9165('0x3'));var BPromise=require(_0x9165('0x4'));var Mustache=require(_0x9165('0x5'));var util=require('util');var path=require(_0x9165('0x6'));var sox=require(_0x9165('0x7'));var csv=require(_0x9165('0x8'));var ejs=require(_0x9165('0x9'));var fs=require('fs');var fs_extra=require(_0x9165('0xa'));var _=require(_0x9165('0xb'));var squel=require(_0x9165('0xc'));var crypto=require(_0x9165('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9165('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9165('0xe'));var qs=require(_0x9165('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9165('0x10'));var logger=require(_0x9165('0x11'))(_0x9165('0x12'));var utils=require(_0x9165('0x13'));var config=require(_0x9165('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9165('0x15'))['db'];function respondWithStatusCode(_0x37969f,_0x58b8d3){_0x58b8d3=_0x58b8d3||0xcc;return function(_0x315196){if(_0x315196){return _0x37969f['sendStatus'](_0x58b8d3);}return _0x37969f[_0x9165('0x16')](_0x58b8d3)[_0x9165('0x17')]();};}function respondWithResult(_0x46e116,_0x42ad96){_0x42ad96=_0x42ad96||0xc8;return function(_0x51f1d9){if(_0x51f1d9){return _0x46e116[_0x9165('0x16')](_0x42ad96)[_0x9165('0x18')](_0x51f1d9);}};}function respondWithFilteredResult(_0x5f4088,_0x13ef41){return function(_0x406e5b){if(_0x406e5b){var _0x469a48=typeof _0x13ef41[_0x9165('0x19')]===_0x9165('0x1a')&&typeof _0x13ef41[_0x9165('0x1b')]===_0x9165('0x1a');var _0x563b05=_0x406e5b['count'];var _0x52d8b7=_0x469a48?0x0:_0x13ef41['offset'];var _0x350c2b=_0x469a48?_0x406e5b[_0x9165('0x1c')]:_0x13ef41[_0x9165('0x19')]+_0x13ef41[_0x9165('0x1b')];var _0x361a54;if(_0x350c2b>=_0x563b05){_0x350c2b=_0x563b05;_0x361a54=0xc8;}else{_0x361a54=0xce;}_0x5f4088[_0x9165('0x16')](_0x361a54);return _0x5f4088[_0x9165('0x1d')](_0x9165('0x1e'),_0x52d8b7+'-'+_0x350c2b+'/'+_0x563b05)[_0x9165('0x18')](_0x406e5b);}return null;};}function patchUpdates(_0xba2e50){return function(_0x2707f4){try{jsonpatch[_0x9165('0x1f')](_0x2707f4,_0xba2e50,!![]);}catch(_0x25f2d8){return BPromise['reject'](_0x25f2d8);}return _0x2707f4[_0x9165('0x20')]();};}function saveUpdates(_0x3800a5,_0x30600f){return function(_0xd46b6a){if(_0xd46b6a){return _0xd46b6a['update'](_0x3800a5)[_0x9165('0x21')](function(_0x1a2c19){return _0x1a2c19;});}return null;};}function removeEntity(_0x513eb7,_0x315588){return function(_0xea9647){if(_0xea9647){return _0xea9647['destroy']()[_0x9165('0x21')](function(){var _0x4dfe73=_0xea9647[_0x9165('0x22')]({'plain':!![]});var _0x1469bf=_0x9165('0x23');return db[_0x9165('0x24')][_0x9165('0x25')]({'where':{'type':_0x1469bf,'resourceId':_0x4dfe73['id']}})[_0x9165('0x21')](function(){return _0xea9647;});})[_0x9165('0x21')](function(){_0x513eb7[_0x9165('0x16')](0xcc)[_0x9165('0x17')]();});}};}function handleEntityNotFound(_0x45e5f3,_0x5329c3){return function(_0x1df769){if(!_0x1df769){_0x45e5f3[_0x9165('0x26')](0x194);}return _0x1df769;};}function handleError(_0x112bbf,_0x4ce5c9){_0x4ce5c9=_0x4ce5c9||0x1f4;return function(_0x446b83){logger['error'](_0x446b83['stack']);if(_0x446b83[_0x9165('0x27')]){delete _0x446b83[_0x9165('0x27')];}_0x112bbf[_0x9165('0x16')](_0x4ce5c9)[_0x9165('0x28')](_0x446b83);};}exports[_0x9165('0x29')]=function(_0x43e3fb,_0xc0f56){var _0x13a8a7={},_0x1000b6={},_0x6fa76c={'count':0x0,'rows':[]};var _0x54d133=_[_0x9165('0x2a')](db[_0x9165('0x2b')][_0x9165('0x2c')],function(_0x49dc0a){return{'name':_0x49dc0a[_0x9165('0x2d')],'type':_0x49dc0a[_0x9165('0x2e')][_0x9165('0x2f')]};});_0x1000b6[_0x9165('0x30')]=_[_0x9165('0x2a')](_0x54d133,_0x9165('0x27'));_0x1000b6[_0x9165('0x31')]=_['keys'](_0x43e3fb['query']);_0x1000b6[_0x9165('0x32')]=_['intersection'](_0x1000b6[_0x9165('0x30')],_0x1000b6[_0x9165('0x31')]);_0x13a8a7[_0x9165('0x33')]=_[_0x9165('0x34')](_0x1000b6['model'],qs[_0x9165('0x35')](_0x43e3fb[_0x9165('0x31')][_0x9165('0x35')]));_0x13a8a7[_0x9165('0x33')]=_0x13a8a7[_0x9165('0x33')]['length']?_0x13a8a7[_0x9165('0x33')]:_0x1000b6[_0x9165('0x30')];if(!_0x43e3fb['query'][_0x9165('0x36')](_0x9165('0x37'))){_0x13a8a7[_0x9165('0x1b')]=qs[_0x9165('0x1b')](_0x43e3fb[_0x9165('0x31')][_0x9165('0x1b')]);_0x13a8a7[_0x9165('0x19')]=qs[_0x9165('0x19')](_0x43e3fb[_0x9165('0x31')][_0x9165('0x19')]);}_0x13a8a7[_0x9165('0x38')]=qs[_0x9165('0x39')](_0x43e3fb['query']['sort']);_0x13a8a7[_0x9165('0x3a')]=qs[_0x9165('0x32')](_['pick'](_0x43e3fb[_0x9165('0x31')],_0x1000b6[_0x9165('0x32')]),_0x54d133);if(_0x43e3fb[_0x9165('0x31')]['filter']){_0x13a8a7[_0x9165('0x3a')]=_[_0x9165('0x3b')](_0x13a8a7[_0x9165('0x3a')],{'$or':_[_0x9165('0x2a')](_0x54d133,function(_0x4e80c1){if(_0x4e80c1[_0x9165('0x2e')]!==_0x9165('0x3c')){var _0x222eef={};_0x222eef[_0x4e80c1[_0x9165('0x27')]]={'$like':'%'+_0x43e3fb[_0x9165('0x31')][_0x9165('0x3d')]+'%'};return _0x222eef;}})});}_0x13a8a7=_['merge']({},_0x13a8a7,_0x43e3fb['options']);var _0x346a9f={'where':_0x13a8a7[_0x9165('0x3a')]};return db[_0x9165('0x2b')][_0x9165('0x1c')](_0x346a9f)[_0x9165('0x21')](function(_0x316152){_0x6fa76c[_0x9165('0x1c')]=_0x316152;if(_0x43e3fb[_0x9165('0x31')][_0x9165('0x3e')]){_0x13a8a7[_0x9165('0x3f')]=[{'all':!![]}];}return db[_0x9165('0x2b')]['findAll'](_0x13a8a7);})[_0x9165('0x21')](function(_0x2816da){_0x6fa76c[_0x9165('0x40')]=_0x2816da;return _0x6fa76c;})[_0x9165('0x21')](respondWithFilteredResult(_0xc0f56,_0x13a8a7))[_0x9165('0x41')](handleError(_0xc0f56,null));};exports[_0x9165('0x42')]=function(_0x4ccb8c,_0x4b3885){var _0x14cc78={'raw':!![],'where':{'id':_0x4ccb8c[_0x9165('0x43')]['id']}},_0x5a905e={};_0x5a905e[_0x9165('0x30')]=_[_0x9165('0x44')](db[_0x9165('0x2b')][_0x9165('0x2c')]);_0x5a905e[_0x9165('0x31')]=_[_0x9165('0x44')](_0x4ccb8c[_0x9165('0x31')]);_0x5a905e[_0x9165('0x32')]=_[_0x9165('0x34')](_0x5a905e[_0x9165('0x30')],_0x5a905e[_0x9165('0x31')]);_0x14cc78[_0x9165('0x33')]=_[_0x9165('0x34')](_0x5a905e['model'],qs[_0x9165('0x35')](_0x4ccb8c['query']['fields']));_0x14cc78[_0x9165('0x33')]=_0x14cc78[_0x9165('0x33')][_0x9165('0x45')]?_0x14cc78[_0x9165('0x33')]:_0x5a905e[_0x9165('0x30')];if(_0x4ccb8c[_0x9165('0x31')][_0x9165('0x3e')]){_0x14cc78[_0x9165('0x3f')]=[{'all':!![]}];}_0x14cc78=_[_0x9165('0x3b')]({},_0x14cc78,_0x4ccb8c[_0x9165('0x46')]);return db[_0x9165('0x2b')]['find'](_0x14cc78)[_0x9165('0x21')](handleEntityNotFound(_0x4b3885,null))[_0x9165('0x21')](respondWithResult(_0x4b3885,null))[_0x9165('0x41')](handleError(_0x4b3885,null));};exports[_0x9165('0x47')]=function(_0x551c17,_0x184576){return db[_0x9165('0x2b')]['create'](_0x551c17[_0x9165('0x48')],{})['then'](function(_0xfd4f62){var _0x4408ad=_0x551c17[_0x9165('0x49')][_0x9165('0x22')]({'plain':!![]});if(!_0x4408ad)throw new Error(_0x9165('0x4a'));if(_0x4408ad['role']===_0x9165('0x49')){var _0x48ec64=_0xfd4f62[_0x9165('0x22')]({'plain':!![]});var _0x1785a8='ODBC';return db[_0x9165('0x4b')][_0x9165('0x4c')]({'where':{'name':_0x1785a8,'userProfileId':_0x4408ad[_0x9165('0x4d')]},'raw':!![]})[_0x9165('0x21')](function(_0x4938d9){if(_0x4938d9&&_0x4938d9[_0x9165('0x4e')]===0x0){return db['UserProfileResource'][_0x9165('0x47')]({'name':_0x48ec64[_0x9165('0x27')],'resourceId':_0x48ec64['id'],'type':_0x4938d9['name'],'sectionId':_0x4938d9['id']},{})[_0x9165('0x21')](function(){return _0xfd4f62;});}else{return _0xfd4f62;}})[_0x9165('0x41')](function(_0x1525d8){logger['error'](_0x9165('0x4f'),_0x1525d8);throw _0x1525d8;});}return _0xfd4f62;})[_0x9165('0x21')](respondWithResult(_0x184576,0xc9))[_0x9165('0x41')](handleError(_0x184576,null));};exports[_0x9165('0x50')]=function(_0x2ac55d,_0x37df13){if(_0x2ac55d['body']['id']){delete _0x2ac55d[_0x9165('0x48')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x2ac55d[_0x9165('0x43')]['id']}})[_0x9165('0x21')](handleEntityNotFound(_0x37df13,null))[_0x9165('0x21')](saveUpdates(_0x2ac55d['body'],null))[_0x9165('0x21')](respondWithResult(_0x37df13,null))['catch'](handleError(_0x37df13,null));};exports[_0x9165('0x25')]=function(_0x113d8f,_0x57868f){return db[_0x9165('0x2b')][_0x9165('0x4c')]({'where':{'id':_0x113d8f['params']['id']}})[_0x9165('0x21')](handleEntityNotFound(_0x57868f,null))[_0x9165('0x21')](removeEntity(_0x57868f,null))[_0x9165('0x41')](handleError(_0x57868f,null));};exports[_0x9165('0x51')]=function(_0x55eb6b,_0x2af06d,_0x56f3fe){var _0x3d1a17;return db[_0x9165('0x2b')][_0x9165('0x4c')]({'where':{'id':_0x55eb6b[_0x9165('0x43')]['id']},'attributes':['id',_0x9165('0x52')]})[_0x9165('0x21')](handleEntityNotFound(_0x2af06d,null))[_0x9165('0x21')](function(_0x2beaef){if(_0x2beaef){var _0x17bef8=require('odbc')();_0x17bef8[_0x9165('0x53')](_0x2beaef[_0x9165('0x52')]);_0x17bef8[_0x9165('0x54')]();return _0x2beaef;}})[_0x9165('0x21')](respondWithResult(_0x2af06d,null))[_0x9165('0x41')](handleError(_0x2af06d,null));}; \ No newline at end of file +var _0x133c=['update','params','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','ODBC','UserProfileResource','end','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0x133c,0x10a));var _0xc133=function(_0x452709,_0x342eca){_0x452709=_0x452709-0x0;var _0x10fe82=_0x133c[_0x452709];return _0x10fe82;};'use strict';var emlformat=require(_0xc133('0x0'));var rimraf=require(_0xc133('0x1'));var zipdir=require(_0xc133('0x2'));var jsonpatch=require(_0xc133('0x3'));var rp=require('request-promise');var moment=require(_0xc133('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc133('0x5'));var util=require(_0xc133('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc133('0x7'));var ejs=require(_0xc133('0x8'));var fs=require('fs');var fs_extra=require(_0xc133('0x9'));var _=require(_0xc133('0xa'));var squel=require('squel');var crypto=require(_0xc133('0xb'));var jsforce=require(_0xc133('0xc'));var deskjs=require(_0xc133('0xd'));var toCsv=require(_0xc133('0x7'));var querystring=require('querystring');var Papa=require(_0xc133('0xe'));var Redis=require(_0xc133('0xf'));var authService=require(_0xc133('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc133('0x11'));var hardwareService=require(_0xc133('0x12'));var logger=require('../../config/logger')(_0xc133('0x13'));var utils=require(_0xc133('0x14'));var config=require(_0xc133('0x15'));var licenseUtil=require(_0xc133('0x16'));var db=require(_0xc133('0x17'))['db'];function respondWithStatusCode(_0x54f0cb,_0x5dad76){_0x5dad76=_0x5dad76||0xcc;return function(_0x16ada6){if(_0x16ada6){return _0x54f0cb[_0xc133('0x18')](_0x5dad76);}return _0x54f0cb['status'](_0x5dad76)['end']();};}function respondWithResult(_0x4f85c1,_0x2a5b49){_0x2a5b49=_0x2a5b49||0xc8;return function(_0x8e359d){if(_0x8e359d){return _0x4f85c1[_0xc133('0x19')](_0x2a5b49)[_0xc133('0x1a')](_0x8e359d);}};}function respondWithFilteredResult(_0x4310c1,_0x568ee4){return function(_0x4f4389){if(_0x4f4389){var _0x460566=typeof _0x568ee4[_0xc133('0x1b')]===_0xc133('0x1c')&&typeof _0x568ee4['limit']===_0xc133('0x1c');var _0x3a28=_0x4f4389[_0xc133('0x1d')];var _0x4f4c17=_0x460566?0x0:_0x568ee4[_0xc133('0x1b')];var _0x52cc82=_0x460566?_0x4f4389[_0xc133('0x1d')]:_0x568ee4['offset']+_0x568ee4[_0xc133('0x1e')];var _0xe7a8fc;if(_0x52cc82>=_0x3a28){_0x52cc82=_0x3a28;_0xe7a8fc=0xc8;}else{_0xe7a8fc=0xce;}_0x4310c1[_0xc133('0x19')](_0xe7a8fc);return _0x4310c1[_0xc133('0x1f')](_0xc133('0x20'),_0x4f4c17+'-'+_0x52cc82+'/'+_0x3a28)['json'](_0x4f4389);}return null;};}function patchUpdates(_0x985b5){return function(_0xc61824){try{jsonpatch['apply'](_0xc61824,_0x985b5,!![]);}catch(_0x4fc885){return BPromise[_0xc133('0x21')](_0x4fc885);}return _0xc61824[_0xc133('0x22')]();};}function saveUpdates(_0x2b7c6d,_0x4a2e90){return function(_0x1f5c77){if(_0x1f5c77){return _0x1f5c77['update'](_0x2b7c6d)['then'](function(_0x7f6c97){return _0x7f6c97;});}return null;};}function removeEntity(_0x5efac6,_0x31ab9c){return function(_0xdb433f){if(_0xdb433f){return _0xdb433f[_0xc133('0x23')]()[_0xc133('0x24')](function(){var _0x256b4f=_0xdb433f['get']({'plain':!![]});var _0x243571=_0xc133('0x25');return db[_0xc133('0x26')]['destroy']({'where':{'type':_0x243571,'resourceId':_0x256b4f['id']}})['then'](function(){return _0xdb433f;});})[_0xc133('0x24')](function(){_0x5efac6[_0xc133('0x19')](0xcc)[_0xc133('0x27')]();});}};}function handleEntityNotFound(_0xee8b3d,_0x286aa5){return function(_0x13fec4){if(!_0x13fec4){_0xee8b3d['sendStatus'](0x194);}return _0x13fec4;};}function handleError(_0x1bab20,_0x4de232){_0x4de232=_0x4de232||0x1f4;return function(_0x8e0ed3){logger['error'](_0x8e0ed3[_0xc133('0x28')]);if(_0x8e0ed3['name']){delete _0x8e0ed3[_0xc133('0x29')];}_0x1bab20['status'](_0x4de232)[_0xc133('0x2a')](_0x8e0ed3);};}exports[_0xc133('0x2b')]=function(_0x5b379e,_0x16402a){var _0x7af42b={},_0x2f962c={},_0x3f5d24={'count':0x0,'rows':[]};var _0x65a3d8=_[_0xc133('0x2c')](db[_0xc133('0x2d')][_0xc133('0x2e')],function(_0x3fb4fb){return{'name':_0x3fb4fb['fieldName'],'type':_0x3fb4fb[_0xc133('0x2f')][_0xc133('0x30')]};});_0x2f962c[_0xc133('0x31')]=_['map'](_0x65a3d8,_0xc133('0x29'));_0x2f962c['query']=_[_0xc133('0x32')](_0x5b379e[_0xc133('0x33')]);_0x2f962c['filters']=_['intersection'](_0x2f962c[_0xc133('0x31')],_0x2f962c['query']);_0x7af42b[_0xc133('0x34')]=_[_0xc133('0x35')](_0x2f962c[_0xc133('0x31')],qs[_0xc133('0x36')](_0x5b379e[_0xc133('0x33')][_0xc133('0x36')]));_0x7af42b['attributes']=_0x7af42b[_0xc133('0x34')]['length']?_0x7af42b[_0xc133('0x34')]:_0x2f962c[_0xc133('0x31')];if(!_0x5b379e[_0xc133('0x33')]['hasOwnProperty'](_0xc133('0x37'))){_0x7af42b[_0xc133('0x1e')]=qs[_0xc133('0x1e')](_0x5b379e[_0xc133('0x33')][_0xc133('0x1e')]);_0x7af42b[_0xc133('0x1b')]=qs[_0xc133('0x1b')](_0x5b379e[_0xc133('0x33')][_0xc133('0x1b')]);}_0x7af42b[_0xc133('0x38')]=qs[_0xc133('0x39')](_0x5b379e[_0xc133('0x33')][_0xc133('0x39')]);_0x7af42b[_0xc133('0x3a')]=qs[_0xc133('0x3b')](_['pick'](_0x5b379e['query'],_0x2f962c['filters']),_0x65a3d8);if(_0x5b379e[_0xc133('0x33')][_0xc133('0x3c')]){_0x7af42b[_0xc133('0x3a')]=_[_0xc133('0x3d')](_0x7af42b[_0xc133('0x3a')],{'$or':_[_0xc133('0x2c')](_0x65a3d8,function(_0xf941d2){if(_0xf941d2[_0xc133('0x2f')]!==_0xc133('0x3e')){var _0x5ed782={};_0x5ed782[_0xf941d2['name']]={'$like':'%'+_0x5b379e[_0xc133('0x33')][_0xc133('0x3c')]+'%'};return _0x5ed782;}})});}_0x7af42b=_[_0xc133('0x3d')]({},_0x7af42b,_0x5b379e[_0xc133('0x3f')]);var _0x5be437={'where':_0x7af42b['where']};return db['SquareOdbc'][_0xc133('0x1d')](_0x5be437)['then'](function(_0xa571dd){_0x3f5d24[_0xc133('0x1d')]=_0xa571dd;if(_0x5b379e['query'][_0xc133('0x40')]){_0x7af42b[_0xc133('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0xc133('0x42')](_0x7af42b);})[_0xc133('0x24')](function(_0x38ee49){_0x3f5d24[_0xc133('0x43')]=_0x38ee49;return _0x3f5d24;})[_0xc133('0x24')](respondWithFilteredResult(_0x16402a,_0x7af42b))[_0xc133('0x44')](handleError(_0x16402a,null));};exports[_0xc133('0x45')]=function(_0x5c5629,_0xb048f3){var _0x585ac1={'raw':!![],'where':{'id':_0x5c5629['params']['id']}},_0x36e3b4={};_0x36e3b4['model']=_[_0xc133('0x32')](db[_0xc133('0x2d')][_0xc133('0x2e')]);_0x36e3b4[_0xc133('0x33')]=_[_0xc133('0x32')](_0x5c5629[_0xc133('0x33')]);_0x36e3b4[_0xc133('0x3b')]=_[_0xc133('0x35')](_0x36e3b4[_0xc133('0x31')],_0x36e3b4[_0xc133('0x33')]);_0x585ac1[_0xc133('0x34')]=_[_0xc133('0x35')](_0x36e3b4[_0xc133('0x31')],qs[_0xc133('0x36')](_0x5c5629[_0xc133('0x33')][_0xc133('0x36')]));_0x585ac1[_0xc133('0x34')]=_0x585ac1[_0xc133('0x34')][_0xc133('0x46')]?_0x585ac1[_0xc133('0x34')]:_0x36e3b4[_0xc133('0x31')];if(_0x5c5629[_0xc133('0x33')][_0xc133('0x40')]){_0x585ac1[_0xc133('0x41')]=[{'all':!![]}];}_0x585ac1=_[_0xc133('0x3d')]({},_0x585ac1,_0x5c5629[_0xc133('0x3f')]);return db['SquareOdbc'][_0xc133('0x47')](_0x585ac1)[_0xc133('0x24')](handleEntityNotFound(_0xb048f3,null))[_0xc133('0x24')](respondWithResult(_0xb048f3,null))[_0xc133('0x44')](handleError(_0xb048f3,null));};exports['create']=function(_0x26d787,_0x63fd33){return db[_0xc133('0x2d')][_0xc133('0x48')](_0x26d787[_0xc133('0x49')],{})[_0xc133('0x24')](function(_0x2d2377){var _0x12afb0=_0x26d787[_0xc133('0x4a')][_0xc133('0x4b')]({'plain':!![]});if(!_0x12afb0)throw new Error(_0xc133('0x4c'));if(_0x12afb0[_0xc133('0x4d')]===_0xc133('0x4a')){var _0x32c6b6=_0x2d2377[_0xc133('0x4b')]({'plain':!![]});var _0x431d64=_0xc133('0x25');return db[_0xc133('0x4e')][_0xc133('0x47')]({'where':{'name':_0x431d64,'userProfileId':_0x12afb0['userProfileId']},'raw':!![]})[_0xc133('0x24')](function(_0x3b3c0e){if(_0x3b3c0e&&_0x3b3c0e[_0xc133('0x4f')]===0x0){return db[_0xc133('0x26')][_0xc133('0x48')]({'name':_0x32c6b6['name'],'resourceId':_0x32c6b6['id'],'type':_0x3b3c0e[_0xc133('0x29')],'sectionId':_0x3b3c0e['id']},{})[_0xc133('0x24')](function(){return _0x2d2377;});}else{return _0x2d2377;}})['catch'](function(_0x386601){logger[_0xc133('0x50')](_0xc133('0x51'),_0x386601);throw _0x386601;});}return _0x2d2377;})[_0xc133('0x24')](respondWithResult(_0x63fd33,0xc9))[_0xc133('0x44')](handleError(_0x63fd33,null));};exports[_0xc133('0x52')]=function(_0x3488ac,_0xaedc36){if(_0x3488ac['body']['id']){delete _0x3488ac[_0xc133('0x49')]['id'];}return db[_0xc133('0x2d')]['find']({'where':{'id':_0x3488ac[_0xc133('0x53')]['id']}})[_0xc133('0x24')](handleEntityNotFound(_0xaedc36,null))[_0xc133('0x24')](saveUpdates(_0x3488ac[_0xc133('0x49')],null))[_0xc133('0x24')](respondWithResult(_0xaedc36,null))[_0xc133('0x44')](handleError(_0xaedc36,null));};exports['destroy']=function(_0x2a58c3,_0x543251){return db[_0xc133('0x2d')][_0xc133('0x47')]({'where':{'id':_0x2a58c3[_0xc133('0x53')]['id']}})[_0xc133('0x24')](handleEntityNotFound(_0x543251,null))[_0xc133('0x24')](removeEntity(_0x543251,null))[_0xc133('0x44')](handleError(_0x543251,null));};exports['test']=function(_0x34f469,_0x273ab6,_0x170f05){var _0xfc0253;return db[_0xc133('0x2d')][_0xc133('0x47')]({'where':{'id':_0x34f469[_0xc133('0x53')]['id']},'attributes':['id',_0xc133('0x54')]})[_0xc133('0x24')](handleEntityNotFound(_0x273ab6,null))[_0xc133('0x24')](function(_0x18d77b){if(_0x18d77b){var _0x59e88a=require('odbc')();_0x59e88a[_0xc133('0x55')](_0x18d77b[_0xc133('0x54')]);_0x59e88a[_0xc133('0x56')]();return _0x18d77b;}})[_0xc133('0x24')](respondWithResult(_0x273ab6,null))[_0xc133('0x44')](handleError(_0x273ab6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 1122ca2..0a1febf 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 _0x92e4=['rimraf','exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x92e4,0x88));var _0x492e=function(_0x345902,_0x26aec3){_0x345902=_0x345902-0x0;var _0x3552d0=_0x92e4[_0x345902];return _0x3552d0;};'use strict';var _=require(_0x492e('0x0'));var util=require(_0x492e('0x1'));var logger=require(_0x492e('0x2'))(_0x492e('0x3'));var moment=require(_0x492e('0x4'));var BPromise=require(_0x492e('0x5'));var rp=require(_0x492e('0x6'));var fs=require('fs');var path=require(_0x492e('0x7'));var rimraf=require(_0x492e('0x8'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x492e('0x9')]=function(_0x137ad2,_0x87828b){return _0x137ad2[_0x492e('0xa')](_0x492e('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02af=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x02af,0x1b7));var _0xf02a=function(_0x2f7713,_0x383cdb){_0x2f7713=_0x2f7713-0x0;var _0x4036a7=_0x02af[_0x2f7713];return _0x4036a7;};'use strict';var _=require('lodash');var util=require(_0xf02a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf02a('0x1'));var BPromise=require(_0xf02a('0x2'));var rp=require(_0xf02a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf02a('0x4'));var config=require(_0xf02a('0x5'));var attributes=require(_0xf02a('0x6'));module[_0xf02a('0x7')]=function(_0x27ecec,_0x53fad4){return _0x27ecec[_0xf02a('0x8')](_0xf02a('0x9'),attributes,{'tableName':_0xf02a('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 1630354..ba0d5c2 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 _0x0fd0=['raw','where','attributes','include','model','map','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options'];(function(_0x11abdc,_0x4ca702){var _0x5d5494=function(_0x3ae27b){while(--_0x3ae27b){_0x11abdc['push'](_0x11abdc['shift']());}};_0x5d5494(++_0x4ca702);}(_0x0fd0,0x1a0));var _0x00fd=function(_0x1f102c,_0x104478){_0x1f102c=_0x1f102c-0x0;var _0x5cd779=_0x0fd0[_0x1f102c];return _0x5cd779;};'use strict';var _=require(_0x00fd('0x0'));var util=require(_0x00fd('0x1'));var moment=require(_0x00fd('0x2'));var BPromise=require(_0x00fd('0x3'));var rs=require(_0x00fd('0x4'));var fs=require('fs');var Redis=require(_0x00fd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x00fd('0x6'));var logger=require('../../config/logger')(_0x00fd('0x7'));var config=require(_0x00fd('0x8'));var jayson=require(_0x00fd('0x9'));var client=jayson[_0x00fd('0xa')][_0x00fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18e5d1,_0x17a448,_0x4e4888){return new BPromise(function(_0x3156f2,_0x501d1d){return client[_0x00fd('0xc')](_0x18e5d1,_0x4e4888)['then'](function(_0x1c5db2){logger[_0x00fd('0xd')](_0x00fd('0xe'),_0x17a448,_0x00fd('0xf'));logger['debug'](_0x00fd('0x10'),_0x17a448,'request\x20sent',JSON[_0x00fd('0x11')](_0x1c5db2));if(_0x1c5db2[_0x00fd('0x12')]){if(_0x1c5db2['error'][_0x00fd('0x13')]===0x1f4){logger[_0x00fd('0x12')](_0x00fd('0xe'),_0x17a448,_0x1c5db2[_0x00fd('0x12')][_0x00fd('0x14')]);return _0x501d1d(_0x1c5db2['error']['message']);}logger[_0x00fd('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x17a448,_0x1c5db2[_0x00fd('0x12')][_0x00fd('0x14')]);return _0x3156f2(_0x1c5db2[_0x00fd('0x12')][_0x00fd('0x14')]);}else{logger['info'](_0x00fd('0xe'),_0x17a448,_0x00fd('0xf'));_0x3156f2(_0x1c5db2[_0x00fd('0x15')]['message']);}})[_0x00fd('0x16')](function(_0x21459f){logger[_0x00fd('0x12')](_0x00fd('0xe'),_0x17a448,_0x21459f);_0x501d1d(_0x21459f);});});}exports[_0x00fd('0x17')]=function(_0xcf1c0b){var _0x109650=this;return new Promise(function(_0x1a0248,_0x21d82e){return db[_0x00fd('0x18')]['find']({'raw':_0xcf1c0b[_0x00fd('0x19')]?_0xcf1c0b[_0x00fd('0x19')][_0x00fd('0x1a')]===undefined?!![]:![]:!![],'where':_0xcf1c0b['options']?_0xcf1c0b['options'][_0x00fd('0x1b')]||null:null,'attributes':_0xcf1c0b[_0x00fd('0x19')]?_0xcf1c0b[_0x00fd('0x19')][_0x00fd('0x1c')]||null:null,'include':_0xcf1c0b[_0x00fd('0x19')]?_0xcf1c0b[_0x00fd('0x19')]['include']?_['map'](_0xcf1c0b[_0x00fd('0x19')][_0x00fd('0x1d')],function(_0x23f186){return{'model':db[_0x23f186[_0x00fd('0x1e')]],'as':_0x23f186['as'],'attributes':_0x23f186['attributes'],'include':_0x23f186['include']?_[_0x00fd('0x1f')](_0x23f186[_0x00fd('0x1d')],function(_0x174283){return{'model':db[_0x174283[_0x00fd('0x1e')]],'as':_0x174283['as'],'attributes':_0x174283[_0x00fd('0x1c')],'include':_0x174283[_0x00fd('0x1d')]?_[_0x00fd('0x1f')](_0x174283[_0x00fd('0x1d')],function(_0x4b1196){return{'model':db[_0x4b1196[_0x00fd('0x1e')]],'as':_0x4b1196['as'],'attributes':_0x4b1196['attributes']};}):[]};}):[]};}):[]:[]})[_0x00fd('0x20')](function(_0x4d758f){logger[_0x00fd('0xd')](_0x00fd('0x17'),_0xcf1c0b);logger[_0x00fd('0x21')](_0x00fd('0x17'),_0xcf1c0b,JSON[_0x00fd('0x11')](_0x4d758f));_0x1a0248(_0x4d758f);})[_0x00fd('0x16')](function(_0x2ef248){logger['error']('ShowSquareOdbc',_0x2ef248[_0x00fd('0x14')],_0xcf1c0b);_0x21d82e(_0x109650[_0x00fd('0x12')](0x1f4,_0x2ef248['message']));});});}; \ No newline at end of file +var _0x2785=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','find','options','where','map','include','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2785,0x15c));var _0x5278=function(_0x5ad568,_0x3651cb){_0x5ad568=_0x5ad568-0x0;var _0x54097d=_0x2785[_0x5ad568];return _0x54097d;};'use strict';var _=require(_0x5278('0x0'));var util=require(_0x5278('0x1'));var moment=require(_0x5278('0x2'));var BPromise=require(_0x5278('0x3'));var rs=require(_0x5278('0x4'));var fs=require('fs');var Redis=require(_0x5278('0x5'));var db=require(_0x5278('0x6'))['db'];var utils=require(_0x5278('0x7'));var logger=require(_0x5278('0x8'))(_0x5278('0x9'));var config=require(_0x5278('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5278('0xb')][_0x5278('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34caaa,_0x584fda,_0x31da84){return new BPromise(function(_0x5e4900,_0x153c65){return client[_0x5278('0xd')](_0x34caaa,_0x31da84)[_0x5278('0xe')](function(_0x58027b){logger[_0x5278('0xf')](_0x5278('0x10'),_0x584fda,_0x5278('0x11'));logger[_0x5278('0x12')](_0x5278('0x13'),_0x584fda,'request\x20sent',JSON['stringify'](_0x58027b));if(_0x58027b[_0x5278('0x14')]){if(_0x58027b[_0x5278('0x14')][_0x5278('0x15')]===0x1f4){logger[_0x5278('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x584fda,_0x58027b['error'][_0x5278('0x16')]);return _0x153c65(_0x58027b['error']['message']);}logger['error'](_0x5278('0x10'),_0x584fda,_0x58027b[_0x5278('0x14')]['message']);return _0x5e4900(_0x58027b['error'][_0x5278('0x16')]);}else{logger[_0x5278('0xf')](_0x5278('0x10'),_0x584fda,_0x5278('0x11'));_0x5e4900(_0x58027b[_0x5278('0x17')][_0x5278('0x16')]);}})[_0x5278('0x18')](function(_0x1634a8){logger[_0x5278('0x14')](_0x5278('0x10'),_0x584fda,_0x1634a8);_0x153c65(_0x1634a8);});});}exports[_0x5278('0x19')]=function(_0x5c6d85){var _0x38379e=this;return new Promise(function(_0x580b72,_0x2b82de){return db['SquareOdbc'][_0x5278('0x1a')]({'raw':_0x5c6d85[_0x5278('0x1b')]?_0x5c6d85[_0x5278('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5c6d85['options']?_0x5c6d85[_0x5278('0x1b')][_0x5278('0x1c')]||null:null,'attributes':_0x5c6d85[_0x5278('0x1b')]?_0x5c6d85[_0x5278('0x1b')]['attributes']||null:null,'include':_0x5c6d85[_0x5278('0x1b')]?_0x5c6d85[_0x5278('0x1b')]['include']?_[_0x5278('0x1d')](_0x5c6d85[_0x5278('0x1b')][_0x5278('0x1e')],function(_0x114722){return{'model':db[_0x114722['model']],'as':_0x114722['as'],'attributes':_0x114722[_0x5278('0x1f')],'include':_0x114722[_0x5278('0x1e')]?_['map'](_0x114722[_0x5278('0x1e')],function(_0x1c544b){return{'model':db[_0x1c544b[_0x5278('0x20')]],'as':_0x1c544b['as'],'attributes':_0x1c544b[_0x5278('0x1f')],'include':_0x1c544b[_0x5278('0x1e')]?_[_0x5278('0x1d')](_0x1c544b[_0x5278('0x1e')],function(_0x11856b){return{'model':db[_0x11856b[_0x5278('0x20')]],'as':_0x11856b['as'],'attributes':_0x11856b[_0x5278('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x457519){logger[_0x5278('0xf')](_0x5278('0x19'),_0x5c6d85);logger[_0x5278('0x12')](_0x5278('0x19'),_0x5c6d85,JSON['stringify'](_0x457519));_0x580b72(_0x457519);})[_0x5278('0x18')](function(_0x3fafa5){logger[_0x5278('0x14')]('ShowSquareOdbc',_0x3fafa5['message'],_0x5c6d85);_0x2b82de(_0x38379e['error'](0x1f4,_0x3fafa5[_0x5278('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index bc8ae97..ecf71f6 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 _0xf9f4=['../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','post','create','/:id/users','addUsers','put','update','delete','destroy','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf9f4,0x70));var _0x4f9f=function(_0xc44324,_0x3251b8){_0xc44324=_0xc44324-0x0;var _0x17f3df=_0xf9f4[_0xc44324];return _0x17f3df;};'use strict';var multer=require(_0x4f9f('0x0'));var util=require('util');var path=require(_0x4f9f('0x1'));var timeout=require(_0x4f9f('0x2'));var express=require(_0x4f9f('0x3'));var router=express[_0x4f9f('0x4')]();var fs_extra=require(_0x4f9f('0x5'));var auth=require(_0x4f9f('0x6'));var interaction=require(_0x4f9f('0x7'));var config=require(_0x4f9f('0x8'));var controller=require(_0x4f9f('0x9'));router[_0x4f9f('0xa')]('/',auth[_0x4f9f('0xb')](),controller['index']);router['get'](_0x4f9f('0xc'),auth['isAuthenticated'](),controller[_0x4f9f('0xd')]);router['get']('/:id/users',auth[_0x4f9f('0xb')](),controller['getUsers']);router[_0x4f9f('0xe')]('/',auth[_0x4f9f('0xb')](),controller[_0x4f9f('0xf')]);router['post'](_0x4f9f('0x10'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x11')]);router[_0x4f9f('0x12')](_0x4f9f('0xc'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x13')]);router[_0x4f9f('0x14')](_0x4f9f('0xc'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x15')]);router['delete'](_0x4f9f('0x10'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x16')]);module[_0x4f9f('0x17')]=router; \ No newline at end of file +var _0x4f9a=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','getUsers','post','create','/:id/users','addUsers','put','/:id','update','delete'];(function(_0x575333,_0x5d65be){var _0x48b3c7=function(_0x41abf1){while(--_0x41abf1){_0x575333['push'](_0x575333['shift']());}};_0x48b3c7(++_0x5d65be);}(_0x4f9a,0xd1));var _0xa4f9=function(_0x4ed77b,_0x4a96b5){_0x4ed77b=_0x4ed77b-0x0;var _0x411f72=_0x4f9a[_0x4ed77b];return _0x411f72;};'use strict';var multer=require('multer');var util=require(_0xa4f9('0x0'));var path=require(_0xa4f9('0x1'));var timeout=require(_0xa4f9('0x2'));var express=require(_0xa4f9('0x3'));var router=express['Router']();var fs_extra=require(_0xa4f9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa4f9('0x5'));var config=require(_0xa4f9('0x6'));var controller=require(_0xa4f9('0x7'));router[_0xa4f9('0x8')]('/',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xa')]);router[_0xa4f9('0x8')]('/:id',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xb')]);router[_0xa4f9('0x8')]('/:id/users',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xc')]);router[_0xa4f9('0xd')]('/',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xe')]);router[_0xa4f9('0xd')](_0xa4f9('0xf'),auth[_0xa4f9('0x9')](),controller[_0xa4f9('0x10')]);router[_0xa4f9('0x11')](_0xa4f9('0x12'),auth['isAuthenticated'](),controller[_0xa4f9('0x13')]);router[_0xa4f9('0x14')](_0xa4f9('0x12'),auth['isAuthenticated'](),controller[_0xa4f9('0x15')]);router[_0xa4f9('0x14')](_0xa4f9('0xf'),auth[_0xa4f9('0x9')](),controller['removeUsers']);module[_0xa4f9('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 6a6a55f..be6032b 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 _0x3210=['BLOB','long','preproduction','toString','utf8','production','DATE','sequelize','STRING','name','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3210,0x19e));var _0x0321=function(_0x33385a,_0x130c0c){_0x33385a=_0x33385a-0x0;var _0x235611=_0x3210[_0x33385a];return _0x235611;};'use strict';var Sequelize=require(_0x0321('0x0'));module['exports']={'name':{'type':Sequelize[_0x0321('0x1')],'unique':_0x0321('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x0321('0x3')]},'preproduction':{'type':Sequelize[_0x0321('0x4')](_0x0321('0x5')),'get':function(){if(this['getDataValue'](_0x0321('0x6'))){return this['getDataValue'](_0x0321('0x6'))[_0x0321('0x7')](_0x0321('0x8'));}}},'production':{'type':Sequelize[_0x0321('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x0321('0x9'))){return this['getDataValue'](_0x0321('0x9'))[_0x0321('0x7')](_0x0321('0x8'));}}},'savedAt':{'type':Sequelize[_0x0321('0xa')]},'publishedAt':{'type':Sequelize[_0x0321('0xa')]}}; \ No newline at end of file +var _0xa2d0=['name','TEXT','BLOB','long','getDataValue','toString','production','utf8','DATE','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2d0,0x77));var _0x0a2d=function(_0x69c037,_0x431438){_0x69c037=_0x69c037-0x0;var _0x57e8de=_0xa2d0[_0x69c037];return _0x57e8de;};'use strict';var Sequelize=require(_0x0a2d('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a2d('0x1')],'unique':_0x0a2d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x0a2d('0x1')]},'notes':{'type':Sequelize[_0x0a2d('0x3')]},'preproduction':{'type':Sequelize[_0x0a2d('0x4')](_0x0a2d('0x5')),'get':function(){if(this[_0x0a2d('0x6')]('preproduction')){return this['getDataValue']('preproduction')[_0x0a2d('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x0a2d('0x6')]('production')){return this[_0x0a2d('0x6')](_0x0a2d('0x8'))['toString'](_0x0a2d('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x0a2d('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 5bddf7d..cbb70b5 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 _0xd656=['UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','SquareProject','includeAll','findAll','rows','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','omit','removeUsers','ids','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','SquareProjects'];(function(_0x23a47d,_0x11ce76){var _0x2a1f3d=function(_0x225946){while(--_0x225946){_0x23a47d['push'](_0x23a47d['shift']());}};_0x2a1f3d(++_0x11ce76);}(_0xd656,0xfe));var _0x6d65=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd656[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x6d65('0x0'));var rimraf=require(_0x6d65('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6d65('0x2'));var moment=require('moment');var BPromise=require(_0x6d65('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6d65('0x4'));var sox=require(_0x6d65('0x5'));var csv=require(_0x6d65('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d65('0x7'));var _=require(_0x6d65('0x8'));var squel=require(_0x6d65('0x9'));var crypto=require(_0x6d65('0xa'));var jsforce=require(_0x6d65('0xb'));var deskjs=require(_0x6d65('0xc'));var toCsv=require(_0x6d65('0x6'));var querystring=require(_0x6d65('0xd'));var Papa=require(_0x6d65('0xe'));var Redis=require('ioredis');var authService=require(_0x6d65('0xf'));var qs=require(_0x6d65('0x10'));var as=require(_0x6d65('0x11'));var hardwareService=require(_0x6d65('0x12'));var logger=require('../../config/logger')(_0x6d65('0x13'));var utils=require(_0x6d65('0x14'));var config=require(_0x6d65('0x15'));var licenseUtil=require(_0x6d65('0x16'));var db=require(_0x6d65('0x17'))['db'];config[_0x6d65('0x18')]=_['defaults'](config[_0x6d65('0x18')],{'host':_0x6d65('0x19'),'port':0x18eb});var socket=require(_0x6d65('0x1a'))(new Redis(config['redis']));require(_0x6d65('0x1b'))[_0x6d65('0x1c')](socket);function respondWithStatusCode(_0x4fe371,_0x4c1308){_0x4c1308=_0x4c1308||0xcc;return function(_0x95f8e1){if(_0x95f8e1){return _0x4fe371[_0x6d65('0x1d')](_0x4c1308);}return _0x4fe371[_0x6d65('0x1e')](_0x4c1308)['end']();};}function respondWithResult(_0x11d7de,_0x6abb5e){_0x6abb5e=_0x6abb5e||0xc8;return function(_0x236792){if(_0x236792){return _0x11d7de[_0x6d65('0x1e')](_0x6abb5e)[_0x6d65('0x1f')](_0x236792);}};}function respondWithFilteredResult(_0x30b923,_0x84da77){return function(_0x2f44a1){if(_0x2f44a1){var _0x21e856=typeof _0x84da77[_0x6d65('0x20')]==='undefined'&&typeof _0x84da77['limit']===_0x6d65('0x21');var _0x54f92c=_0x2f44a1[_0x6d65('0x22')];var _0x4550cc=_0x21e856?0x0:_0x84da77[_0x6d65('0x20')];var _0x290bc2=_0x21e856?_0x2f44a1[_0x6d65('0x22')]:_0x84da77[_0x6d65('0x20')]+_0x84da77[_0x6d65('0x23')];var _0x515a0f;if(_0x290bc2>=_0x54f92c){_0x290bc2=_0x54f92c;_0x515a0f=0xc8;}else{_0x515a0f=0xce;}_0x30b923[_0x6d65('0x1e')](_0x515a0f);return _0x30b923[_0x6d65('0x24')](_0x6d65('0x25'),_0x4550cc+'-'+_0x290bc2+'/'+_0x54f92c)['json'](_0x2f44a1);}return null;};}function patchUpdates(_0x3a6769){return function(_0x2bf116){try{jsonpatch['apply'](_0x2bf116,_0x3a6769,!![]);}catch(_0x314044){return BPromise['reject'](_0x314044);}return _0x2bf116[_0x6d65('0x26')]();};}function saveUpdates(_0x23ea49,_0x46a797){return function(_0x39c29d){if(_0x39c29d){return _0x39c29d[_0x6d65('0x27')](_0x23ea49)[_0x6d65('0x28')](function(_0xee91f2){return _0xee91f2;});}return null;};}function removeEntity(_0x58a378,_0x43d091){return function(_0x7d892a){if(_0x7d892a){return _0x7d892a[_0x6d65('0x29')]()[_0x6d65('0x28')](function(){var _0xd3dbba=_0x7d892a['get']({'plain':!![]});var _0x755f7a=_0x6d65('0x2a');return db[_0x6d65('0x2b')][_0x6d65('0x29')]({'where':{'type':_0x755f7a,'resourceId':_0xd3dbba['id']}})[_0x6d65('0x28')](function(){return _0x7d892a;});})['then'](function(){_0x58a378['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a7c18,_0x2853b8){return function(_0x5a8e04){if(!_0x5a8e04){_0x4a7c18[_0x6d65('0x1d')](0x194);}return _0x5a8e04;};}function handleError(_0x6333af,_0x366b48){_0x366b48=_0x366b48||0x1f4;return function(_0x2fad4a){logger[_0x6d65('0x2c')](_0x2fad4a[_0x6d65('0x2d')]);if(_0x2fad4a[_0x6d65('0x2e')]){delete _0x2fad4a[_0x6d65('0x2e')];}_0x6333af[_0x6d65('0x1e')](_0x366b48)[_0x6d65('0x2f')](_0x2fad4a);};}exports[_0x6d65('0x30')]=function(_0x2e9fb9,_0x52667c){var _0x53b2e0={},_0x27ec93={},_0x56f48b={'count':0x0,'rows':[]};var _0x35ceb6=_[_0x6d65('0x31')](db['SquareProject'][_0x6d65('0x32')],function(_0x40226b){return{'name':_0x40226b[_0x6d65('0x33')],'type':_0x40226b[_0x6d65('0x34')][_0x6d65('0x35')]};});_0x27ec93[_0x6d65('0x36')]=_['map'](_0x35ceb6,'name');_0x27ec93[_0x6d65('0x37')]=_['keys'](_0x2e9fb9[_0x6d65('0x37')]);_0x27ec93[_0x6d65('0x38')]=_[_0x6d65('0x39')](_0x27ec93[_0x6d65('0x36')],_0x27ec93['query']);_0x53b2e0[_0x6d65('0x3a')]=_[_0x6d65('0x39')](_0x27ec93['model'],qs['fields'](_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x3b')]));_0x53b2e0['attributes']=_0x53b2e0['attributes'][_0x6d65('0x3c')]?_0x53b2e0[_0x6d65('0x3a')]:_0x27ec93[_0x6d65('0x36')];if(!_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x3d')]('nolimit')){_0x53b2e0[_0x6d65('0x23')]=qs[_0x6d65('0x23')](_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x23')]);_0x53b2e0[_0x6d65('0x20')]=qs[_0x6d65('0x20')](_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x20')]);}_0x53b2e0[_0x6d65('0x3e')]=qs[_0x6d65('0x3f')](_0x2e9fb9[_0x6d65('0x37')]['sort']);_0x53b2e0['where']=qs[_0x6d65('0x38')](_[_0x6d65('0x40')](_0x2e9fb9[_0x6d65('0x37')],_0x27ec93[_0x6d65('0x38')]),_0x35ceb6);if(_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x41')]){_0x53b2e0['where']=_['merge'](_0x53b2e0[_0x6d65('0x42')],{'$or':_[_0x6d65('0x31')](_0x35ceb6,function(_0x4b3953){if(_0x4b3953[_0x6d65('0x34')]!==_0x6d65('0x43')){var _0x39151b={};_0x39151b[_0x4b3953[_0x6d65('0x2e')]]={'$like':'%'+_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x41')]+'%'};return _0x39151b;}})});}_0x53b2e0=_[_0x6d65('0x44')]({},_0x53b2e0,_0x2e9fb9[_0x6d65('0x45')]);var _0x16b117={'where':_0x53b2e0[_0x6d65('0x42')]};return db[_0x6d65('0x46')][_0x6d65('0x22')](_0x16b117)[_0x6d65('0x28')](function(_0xaa759b){_0x56f48b[_0x6d65('0x22')]=_0xaa759b;if(_0x2e9fb9[_0x6d65('0x37')][_0x6d65('0x47')]){_0x53b2e0['include']=[{'all':!![]}];}return db['SquareProject'][_0x6d65('0x48')](_0x53b2e0);})['then'](function(_0x51ea54){_0x56f48b[_0x6d65('0x49')]=_0x51ea54;return _0x56f48b;})[_0x6d65('0x28')](respondWithFilteredResult(_0x52667c,_0x53b2e0))['catch'](handleError(_0x52667c,null));};exports['show']=function(_0x3af92d,_0x395703){var _0x122fa4={'raw':![],'where':{'id':_0x3af92d['params']['id']}},_0x5d7f08={};_0x5d7f08[_0x6d65('0x36')]=_[_0x6d65('0x4a')](db[_0x6d65('0x46')][_0x6d65('0x32')]);_0x5d7f08[_0x6d65('0x37')]=_[_0x6d65('0x4a')](_0x3af92d[_0x6d65('0x37')]);_0x5d7f08[_0x6d65('0x38')]=_['intersection'](_0x5d7f08[_0x6d65('0x36')],_0x5d7f08[_0x6d65('0x37')]);_0x122fa4[_0x6d65('0x3a')]=_[_0x6d65('0x39')](_0x5d7f08[_0x6d65('0x36')],qs[_0x6d65('0x3b')](_0x3af92d[_0x6d65('0x37')][_0x6d65('0x3b')]));_0x122fa4[_0x6d65('0x3a')]=_0x122fa4[_0x6d65('0x3a')][_0x6d65('0x3c')]?_0x122fa4['attributes']:_0x5d7f08[_0x6d65('0x36')];if(_0x3af92d[_0x6d65('0x37')]['includeAll']){_0x122fa4[_0x6d65('0x4b')]=[{'all':!![]}];}_0x122fa4=_['merge']({},_0x122fa4,_0x3af92d['options']);return db[_0x6d65('0x46')][_0x6d65('0x4c')](_0x122fa4)['then'](handleEntityNotFound(_0x395703,null))['then'](respondWithResult(_0x395703,null))['catch'](handleError(_0x395703,null));};exports['create']=function(_0x37b542,_0x19defd){return db[_0x6d65('0x46')][_0x6d65('0x4d')](_0x37b542[_0x6d65('0x4e')],{})['then'](function(_0x48fcc0){var _0x4c2fc3=_0x37b542[_0x6d65('0x4f')][_0x6d65('0x50')]({'plain':!![]});if(!_0x4c2fc3)throw new Error(_0x6d65('0x51'));if(_0x4c2fc3[_0x6d65('0x52')]==='user'){var _0xba2aab=_0x48fcc0[_0x6d65('0x50')]({'plain':!![]});var _0x5bad67=_0x6d65('0x2a');return db[_0x6d65('0x53')][_0x6d65('0x4c')]({'where':{'name':_0x5bad67,'userProfileId':_0x4c2fc3['userProfileId']},'raw':!![]})['then'](function(_0x5d024b){if(_0x5d024b&&_0x5d024b[_0x6d65('0x54')]===0x0){return db[_0x6d65('0x2b')]['create']({'name':_0xba2aab[_0x6d65('0x2e')],'resourceId':_0xba2aab['id'],'type':_0x5d024b[_0x6d65('0x2e')],'sectionId':_0x5d024b['id']},{})[_0x6d65('0x28')](function(){return _0x48fcc0;});}else{return _0x48fcc0;}})[_0x6d65('0x55')](function(_0x5801ba){logger[_0x6d65('0x2c')](_0x6d65('0x56'),_0x5801ba);throw _0x5801ba;});}return _0x48fcc0;})[_0x6d65('0x28')](respondWithResult(_0x19defd,0xc9))['catch'](handleError(_0x19defd,null));};exports['update']=function(_0x3dc97b,_0x9adbdb){if(_0x3dc97b[_0x6d65('0x4e')]['id']){delete _0x3dc97b[_0x6d65('0x4e')]['id'];}return db[_0x6d65('0x46')][_0x6d65('0x4c')]({'where':{'id':_0x3dc97b['params']['id']}})['then'](handleEntityNotFound(_0x9adbdb,null))[_0x6d65('0x28')](saveUpdates(_0x3dc97b['body'],null))['then'](respondWithResult(_0x9adbdb,null))[_0x6d65('0x55')](handleError(_0x9adbdb,null));};exports[_0x6d65('0x29')]=function(_0x3d1a14,_0x42a8bd){return db[_0x6d65('0x46')][_0x6d65('0x4c')]({'where':{'id':_0x3d1a14[_0x6d65('0x57')]['id']}})['then'](handleEntityNotFound(_0x42a8bd,null))['then'](removeEntity(_0x42a8bd,null))['catch'](handleError(_0x42a8bd,null));};exports[_0x6d65('0x58')]=function(_0x54d92e,_0x32b587,_0x138d9d){return db[_0x6d65('0x46')][_0x6d65('0x4c')]({'where':{'id':_0x54d92e[_0x6d65('0x57')]['id']}})['then'](handleEntityNotFound(_0x32b587,null))[_0x6d65('0x28')](function(_0x5ca896){if(_0x5ca896){return _0x5ca896[_0x6d65('0x58')](_0x54d92e[_0x6d65('0x4e')]['ids'],_[_0x6d65('0x59')](_0x54d92e[_0x6d65('0x4e')],['ids','id'])||{});}})[_0x6d65('0x28')](respondWithResult(_0x32b587,null))[_0x6d65('0x55')](handleError(_0x32b587,null));};exports[_0x6d65('0x5a')]=function(_0x142f0a,_0x2f7653,_0x281f1b){return db[_0x6d65('0x46')][_0x6d65('0x4c')]({'where':{'id':_0x142f0a['params']['id']}})[_0x6d65('0x28')](handleEntityNotFound(_0x2f7653,null))[_0x6d65('0x28')](function(_0x3df7e0){if(_0x3df7e0){return _0x3df7e0['removeUsers'](_0x142f0a['query'][_0x6d65('0x5b')])[_0x6d65('0x28')](function(){if(_[_0x6d65('0x5c')](_0x142f0a['query'][_0x6d65('0x5b')])){for(var _0x216b29=0x0;_0x216b29<_0x142f0a[_0x6d65('0x37')][_0x6d65('0x5b')][_0x6d65('0x3c')];_0x216b29+=0x1){socket[_0x6d65('0x5d')](_0x6d65('0x5e'),{'UserId':Number(_0x142f0a[_0x6d65('0x37')][_0x6d65('0x5b')][_0x216b29]),'SquareProjectId':Number(_0x142f0a['params']['id'])});}}else{socket[_0x6d65('0x5d')](_0x6d65('0x5e'),{'UserId':Number(_0x142f0a[_0x6d65('0x37')]['ids']),'SquareProjectId':Number(_0x142f0a[_0x6d65('0x57')]['id'])});}});}})[_0x6d65('0x28')](respondWithStatusCode(_0x2f7653,null))[_0x6d65('0x55')](handleError(_0x2f7653,null));};exports[_0x6d65('0x5f')]=function(_0x2aba23,_0x23d595,_0x4bced2){var _0x3d0eb7={};var _0x118f6a={};var _0x4b338d;var _0x38e513;return db[_0x6d65('0x46')][_0x6d65('0x60')]({'where':{'id':_0x2aba23[_0x6d65('0x57')]['id']}})['then'](handleEntityNotFound(_0x23d595,null))[_0x6d65('0x28')](function(_0x30b416){if(_0x30b416){_0x4b338d=_0x30b416;_0x118f6a['model']=_[_0x6d65('0x4a')](db[_0x6d65('0x61')][_0x6d65('0x32')]);_0x118f6a['query']=_['keys'](_0x2aba23[_0x6d65('0x37')]);_0x118f6a['filters']=_['intersection'](_0x118f6a[_0x6d65('0x36')],_0x118f6a['query']);_0x3d0eb7[_0x6d65('0x3a')]=_['intersection'](_0x118f6a[_0x6d65('0x36')],qs[_0x6d65('0x3b')](_0x2aba23[_0x6d65('0x37')][_0x6d65('0x3b')]));_0x3d0eb7[_0x6d65('0x3a')]=_0x3d0eb7['attributes'][_0x6d65('0x3c')]?_0x3d0eb7[_0x6d65('0x3a')]:_0x118f6a['model'];_0x3d0eb7[_0x6d65('0x3e')]=qs[_0x6d65('0x3f')](_0x2aba23[_0x6d65('0x37')][_0x6d65('0x3f')]);_0x3d0eb7[_0x6d65('0x42')]=qs[_0x6d65('0x38')](_['pick'](_0x2aba23[_0x6d65('0x37')],_0x118f6a[_0x6d65('0x38')]));if(_0x2aba23[_0x6d65('0x37')][_0x6d65('0x41')]){_0x3d0eb7[_0x6d65('0x42')]=_['merge'](_0x3d0eb7[_0x6d65('0x42')],{'$or':_[_0x6d65('0x31')](_0x3d0eb7[_0x6d65('0x3a')],function(_0x160543){var _0x18c304={};_0x18c304[_0x160543]={'$like':'%'+_0x2aba23['query']['filter']+'%'};return _0x18c304;})});}_0x3d0eb7=_[_0x6d65('0x44')]({},_0x3d0eb7,_0x2aba23[_0x6d65('0x45')]);return _0x4b338d[_0x6d65('0x5f')](_0x3d0eb7);}})[_0x6d65('0x28')](function(_0x2a6ae1){if(_0x2a6ae1){_0x38e513=_0x2a6ae1[_0x6d65('0x3c')];if(!_0x2aba23[_0x6d65('0x37')][_0x6d65('0x3d')](_0x6d65('0x62'))){_0x3d0eb7[_0x6d65('0x23')]=qs[_0x6d65('0x23')](_0x2aba23[_0x6d65('0x37')][_0x6d65('0x23')]);_0x3d0eb7[_0x6d65('0x20')]=qs[_0x6d65('0x20')](_0x2aba23[_0x6d65('0x37')][_0x6d65('0x20')]);}return _0x4b338d[_0x6d65('0x5f')](_0x3d0eb7);}})[_0x6d65('0x28')](function(_0xc0eb23){if(_0xc0eb23){return _0xc0eb23?{'count':_0x38e513,'rows':_0xc0eb23}:null;}})['then'](respondWithResult(_0x23d595,null))[_0x6d65('0x55')](handleError(_0x23d595,null));}; \ No newline at end of file +var _0x5962=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./squareProject.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x2ebbd7,_0x3b2167){var _0x2c4c6d=function(_0x41fcad){while(--_0x41fcad){_0x2ebbd7['push'](_0x2ebbd7['shift']());}};_0x2c4c6d(++_0x3b2167);}(_0x5962,0x16f));var _0x2596=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x5962[_0x342700];return _0x53406f;};'use strict';var emlformat=require(_0x2596('0x0'));var rimraf=require(_0x2596('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2596('0x2'));var rp=require(_0x2596('0x3'));var moment=require('moment');var BPromise=require(_0x2596('0x4'));var Mustache=require(_0x2596('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2596('0x6'));var csv=require(_0x2596('0x7'));var ejs=require(_0x2596('0x8'));var fs=require('fs');var fs_extra=require(_0x2596('0x9'));var _=require('lodash');var squel=require(_0x2596('0xa'));var crypto=require(_0x2596('0xb'));var jsforce=require(_0x2596('0xc'));var deskjs=require(_0x2596('0xd'));var toCsv=require(_0x2596('0x7'));var querystring=require(_0x2596('0xe'));var Papa=require(_0x2596('0xf'));var Redis=require(_0x2596('0x10'));var authService=require(_0x2596('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2596('0x12'));var hardwareService=require(_0x2596('0x13'));var logger=require(_0x2596('0x14'))(_0x2596('0x15'));var utils=require('../../config/utils');var config=require(_0x2596('0x16'));var licenseUtil=require(_0x2596('0x17'));var db=require('../../mysqldb')['db'];config[_0x2596('0x18')]=_[_0x2596('0x19')](config[_0x2596('0x18')],{'host':_0x2596('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2596('0x1b'))[_0x2596('0x1c')](socket);function respondWithStatusCode(_0xde7e60,_0x12e8e4){_0x12e8e4=_0x12e8e4||0xcc;return function(_0x81671a){if(_0x81671a){return _0xde7e60['sendStatus'](_0x12e8e4);}return _0xde7e60[_0x2596('0x1d')](_0x12e8e4)['end']();};}function respondWithResult(_0x68377,_0x480b33){_0x480b33=_0x480b33||0xc8;return function(_0x3bdd79){if(_0x3bdd79){return _0x68377[_0x2596('0x1d')](_0x480b33)['json'](_0x3bdd79);}};}function respondWithFilteredResult(_0x3f74aa,_0x3ab2ec){return function(_0xf1e0d0){if(_0xf1e0d0){var _0x570371=typeof _0x3ab2ec['offset']==='undefined'&&typeof _0x3ab2ec['limit']===_0x2596('0x1e');var _0x688532=_0xf1e0d0[_0x2596('0x1f')];var _0x39aa06=_0x570371?0x0:_0x3ab2ec[_0x2596('0x20')];var _0x5d36fb=_0x570371?_0xf1e0d0[_0x2596('0x1f')]:_0x3ab2ec[_0x2596('0x20')]+_0x3ab2ec[_0x2596('0x21')];var _0x4a5613;if(_0x5d36fb>=_0x688532){_0x5d36fb=_0x688532;_0x4a5613=0xc8;}else{_0x4a5613=0xce;}_0x3f74aa[_0x2596('0x1d')](_0x4a5613);return _0x3f74aa[_0x2596('0x22')](_0x2596('0x23'),_0x39aa06+'-'+_0x5d36fb+'/'+_0x688532)[_0x2596('0x24')](_0xf1e0d0);}return null;};}function patchUpdates(_0xb211c9){return function(_0x45a333){try{jsonpatch[_0x2596('0x25')](_0x45a333,_0xb211c9,!![]);}catch(_0x2cb9a7){return BPromise[_0x2596('0x26')](_0x2cb9a7);}return _0x45a333[_0x2596('0x27')]();};}function saveUpdates(_0x3b013d,_0x20e54e){return function(_0xe32550){if(_0xe32550){return _0xe32550[_0x2596('0x28')](_0x3b013d)[_0x2596('0x29')](function(_0x3080c1){return _0x3080c1;});}return null;};}function removeEntity(_0x3caee2,_0xb11986){return function(_0x176bc3){if(_0x176bc3){return _0x176bc3[_0x2596('0x2a')]()[_0x2596('0x29')](function(){var _0x5647ca=_0x176bc3[_0x2596('0x2b')]({'plain':!![]});var _0x222ae6=_0x2596('0x2c');return db[_0x2596('0x2d')][_0x2596('0x2a')]({'where':{'type':_0x222ae6,'resourceId':_0x5647ca['id']}})[_0x2596('0x29')](function(){return _0x176bc3;});})[_0x2596('0x29')](function(){_0x3caee2[_0x2596('0x1d')](0xcc)[_0x2596('0x2e')]();});}};}function handleEntityNotFound(_0x3b55ac,_0x82fe47){return function(_0x49a5dd){if(!_0x49a5dd){_0x3b55ac[_0x2596('0x2f')](0x194);}return _0x49a5dd;};}function handleError(_0x4aa577,_0x566878){_0x566878=_0x566878||0x1f4;return function(_0x2f8dba){logger[_0x2596('0x30')](_0x2f8dba[_0x2596('0x31')]);if(_0x2f8dba['name']){delete _0x2f8dba[_0x2596('0x32')];}_0x4aa577['status'](_0x566878)[_0x2596('0x33')](_0x2f8dba);};}exports[_0x2596('0x34')]=function(_0x56adfb,_0x133fe9){var _0x33d443={},_0x1652a8={},_0x3a3cd0={'count':0x0,'rows':[]};var _0x1249bf=_[_0x2596('0x35')](db[_0x2596('0x36')][_0x2596('0x37')],function(_0x205b57){return{'name':_0x205b57[_0x2596('0x38')],'type':_0x205b57[_0x2596('0x39')]['key']};});_0x1652a8[_0x2596('0x3a')]=_['map'](_0x1249bf,_0x2596('0x32'));_0x1652a8['query']=_[_0x2596('0x3b')](_0x56adfb[_0x2596('0x3c')]);_0x1652a8[_0x2596('0x3d')]=_[_0x2596('0x3e')](_0x1652a8[_0x2596('0x3a')],_0x1652a8[_0x2596('0x3c')]);_0x33d443[_0x2596('0x3f')]=_[_0x2596('0x3e')](_0x1652a8[_0x2596('0x3a')],qs[_0x2596('0x40')](_0x56adfb['query'][_0x2596('0x40')]));_0x33d443[_0x2596('0x3f')]=_0x33d443['attributes'][_0x2596('0x41')]?_0x33d443[_0x2596('0x3f')]:_0x1652a8['model'];if(!_0x56adfb[_0x2596('0x3c')][_0x2596('0x42')]('nolimit')){_0x33d443[_0x2596('0x21')]=qs[_0x2596('0x21')](_0x56adfb[_0x2596('0x3c')]['limit']);_0x33d443[_0x2596('0x20')]=qs[_0x2596('0x20')](_0x56adfb[_0x2596('0x3c')][_0x2596('0x20')]);}_0x33d443[_0x2596('0x43')]=qs[_0x2596('0x44')](_0x56adfb['query'][_0x2596('0x44')]);_0x33d443[_0x2596('0x45')]=qs[_0x2596('0x3d')](_[_0x2596('0x46')](_0x56adfb[_0x2596('0x3c')],_0x1652a8[_0x2596('0x3d')]),_0x1249bf);if(_0x56adfb[_0x2596('0x3c')][_0x2596('0x47')]){_0x33d443['where']=_['merge'](_0x33d443[_0x2596('0x45')],{'$or':_[_0x2596('0x35')](_0x1249bf,function(_0x422cb7){if(_0x422cb7[_0x2596('0x39')]!==_0x2596('0x48')){var _0x274d55={};_0x274d55[_0x422cb7[_0x2596('0x32')]]={'$like':'%'+_0x56adfb[_0x2596('0x3c')][_0x2596('0x47')]+'%'};return _0x274d55;}})});}_0x33d443=_[_0x2596('0x49')]({},_0x33d443,_0x56adfb[_0x2596('0x4a')]);var _0x1bf74f={'where':_0x33d443[_0x2596('0x45')]};return db[_0x2596('0x36')]['count'](_0x1bf74f)[_0x2596('0x29')](function(_0x3bffb9){_0x3a3cd0['count']=_0x3bffb9;if(_0x56adfb[_0x2596('0x3c')][_0x2596('0x4b')]){_0x33d443[_0x2596('0x4c')]=[{'all':!![]}];}return db[_0x2596('0x36')]['findAll'](_0x33d443);})[_0x2596('0x29')](function(_0x487ac9){_0x3a3cd0['rows']=_0x487ac9;return _0x3a3cd0;})[_0x2596('0x29')](respondWithFilteredResult(_0x133fe9,_0x33d443))[_0x2596('0x4d')](handleError(_0x133fe9,null));};exports[_0x2596('0x4e')]=function(_0x3e60d2,_0x2a7ba4){var _0x4ba648={'raw':![],'where':{'id':_0x3e60d2[_0x2596('0x4f')]['id']}},_0x219884={};_0x219884[_0x2596('0x3a')]=_[_0x2596('0x3b')](db['SquareProject'][_0x2596('0x37')]);_0x219884[_0x2596('0x3c')]=_[_0x2596('0x3b')](_0x3e60d2['query']);_0x219884[_0x2596('0x3d')]=_[_0x2596('0x3e')](_0x219884['model'],_0x219884['query']);_0x4ba648[_0x2596('0x3f')]=_[_0x2596('0x3e')](_0x219884[_0x2596('0x3a')],qs['fields'](_0x3e60d2[_0x2596('0x3c')][_0x2596('0x40')]));_0x4ba648[_0x2596('0x3f')]=_0x4ba648[_0x2596('0x3f')][_0x2596('0x41')]?_0x4ba648[_0x2596('0x3f')]:_0x219884[_0x2596('0x3a')];if(_0x3e60d2[_0x2596('0x3c')][_0x2596('0x4b')]){_0x4ba648['include']=[{'all':!![]}];}_0x4ba648=_[_0x2596('0x49')]({},_0x4ba648,_0x3e60d2[_0x2596('0x4a')]);return db[_0x2596('0x36')][_0x2596('0x50')](_0x4ba648)[_0x2596('0x29')](handleEntityNotFound(_0x2a7ba4,null))[_0x2596('0x29')](respondWithResult(_0x2a7ba4,null))[_0x2596('0x4d')](handleError(_0x2a7ba4,null));};exports[_0x2596('0x51')]=function(_0x14a8d2,_0xecbdd9){return db[_0x2596('0x36')]['create'](_0x14a8d2[_0x2596('0x52')],{})['then'](function(_0x4543a2){var _0xcb124=_0x14a8d2[_0x2596('0x53')][_0x2596('0x2b')]({'plain':!![]});if(!_0xcb124)throw new Error(_0x2596('0x54'));if(_0xcb124['role']===_0x2596('0x53')){var _0x4507eb=_0x4543a2[_0x2596('0x2b')]({'plain':!![]});var _0x5cf32a='SquareProjects';return db['UserProfileSection'][_0x2596('0x50')]({'where':{'name':_0x5cf32a,'userProfileId':_0xcb124['userProfileId']},'raw':!![]})['then'](function(_0x23beff){if(_0x23beff&&_0x23beff['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4507eb[_0x2596('0x32')],'resourceId':_0x4507eb['id'],'type':_0x23beff[_0x2596('0x32')],'sectionId':_0x23beff['id']},{})[_0x2596('0x29')](function(){return _0x4543a2;});}else{return _0x4543a2;}})[_0x2596('0x4d')](function(_0x495d08){logger[_0x2596('0x30')](_0x2596('0x55'),_0x495d08);throw _0x495d08;});}return _0x4543a2;})[_0x2596('0x29')](respondWithResult(_0xecbdd9,0xc9))['catch'](handleError(_0xecbdd9,null));};exports[_0x2596('0x28')]=function(_0x576a55,_0x37738c){if(_0x576a55[_0x2596('0x52')]['id']){delete _0x576a55[_0x2596('0x52')]['id'];}return db[_0x2596('0x36')][_0x2596('0x50')]({'where':{'id':_0x576a55[_0x2596('0x4f')]['id']}})[_0x2596('0x29')](handleEntityNotFound(_0x37738c,null))[_0x2596('0x29')](saveUpdates(_0x576a55[_0x2596('0x52')],null))[_0x2596('0x29')](respondWithResult(_0x37738c,null))[_0x2596('0x4d')](handleError(_0x37738c,null));};exports[_0x2596('0x2a')]=function(_0x28bbca,_0x54ef81){return db[_0x2596('0x36')]['find']({'where':{'id':_0x28bbca[_0x2596('0x4f')]['id']}})[_0x2596('0x29')](handleEntityNotFound(_0x54ef81,null))[_0x2596('0x29')](removeEntity(_0x54ef81,null))[_0x2596('0x4d')](handleError(_0x54ef81,null));};exports[_0x2596('0x56')]=function(_0x24dc37,_0x15f6b3,_0x37cd17){return db[_0x2596('0x36')]['find']({'where':{'id':_0x24dc37['params']['id']}})[_0x2596('0x29')](handleEntityNotFound(_0x15f6b3,null))[_0x2596('0x29')](function(_0x4c6720){if(_0x4c6720){return _0x4c6720['addUsers'](_0x24dc37[_0x2596('0x52')][_0x2596('0x57')],_['omit'](_0x24dc37[_0x2596('0x52')],['ids','id'])||{});}})['then'](respondWithResult(_0x15f6b3,null))['catch'](handleError(_0x15f6b3,null));};exports[_0x2596('0x58')]=function(_0x49f43a,_0x48f869,_0x4c021c){return db[_0x2596('0x36')][_0x2596('0x50')]({'where':{'id':_0x49f43a['params']['id']}})[_0x2596('0x29')](handleEntityNotFound(_0x48f869,null))['then'](function(_0x2bdee0){if(_0x2bdee0){return _0x2bdee0['removeUsers'](_0x49f43a[_0x2596('0x3c')][_0x2596('0x57')])[_0x2596('0x29')](function(){if(_[_0x2596('0x59')](_0x49f43a[_0x2596('0x3c')][_0x2596('0x57')])){for(var _0x5ea0ff=0x0;_0x5ea0ff<_0x49f43a[_0x2596('0x3c')][_0x2596('0x57')][_0x2596('0x41')];_0x5ea0ff+=0x1){socket[_0x2596('0x5a')](_0x2596('0x5b'),{'UserId':Number(_0x49f43a[_0x2596('0x3c')][_0x2596('0x57')][_0x5ea0ff]),'SquareProjectId':Number(_0x49f43a[_0x2596('0x4f')]['id'])});}}else{socket['emit'](_0x2596('0x5b'),{'UserId':Number(_0x49f43a['query'][_0x2596('0x57')]),'SquareProjectId':Number(_0x49f43a[_0x2596('0x4f')]['id'])});}});}})[_0x2596('0x29')](respondWithStatusCode(_0x48f869,null))[_0x2596('0x4d')](handleError(_0x48f869,null));};exports[_0x2596('0x5c')]=function(_0x20af85,_0x285cf7,_0x461618){var _0x17b42b={};var _0x3962e7={};var _0x20c847;var _0x95cead;return db[_0x2596('0x36')][_0x2596('0x5d')]({'where':{'id':_0x20af85[_0x2596('0x4f')]['id']}})[_0x2596('0x29')](handleEntityNotFound(_0x285cf7,null))[_0x2596('0x29')](function(_0x214054){if(_0x214054){_0x20c847=_0x214054;_0x3962e7['model']=_[_0x2596('0x3b')](db[_0x2596('0x5e')][_0x2596('0x37')]);_0x3962e7[_0x2596('0x3c')]=_[_0x2596('0x3b')](_0x20af85[_0x2596('0x3c')]);_0x3962e7['filters']=_[_0x2596('0x3e')](_0x3962e7[_0x2596('0x3a')],_0x3962e7[_0x2596('0x3c')]);_0x17b42b['attributes']=_[_0x2596('0x3e')](_0x3962e7[_0x2596('0x3a')],qs[_0x2596('0x40')](_0x20af85['query'][_0x2596('0x40')]));_0x17b42b[_0x2596('0x3f')]=_0x17b42b[_0x2596('0x3f')][_0x2596('0x41')]?_0x17b42b[_0x2596('0x3f')]:_0x3962e7[_0x2596('0x3a')];_0x17b42b[_0x2596('0x43')]=qs['sort'](_0x20af85[_0x2596('0x3c')][_0x2596('0x44')]);_0x17b42b[_0x2596('0x45')]=qs[_0x2596('0x3d')](_[_0x2596('0x46')](_0x20af85[_0x2596('0x3c')],_0x3962e7['filters']));if(_0x20af85[_0x2596('0x3c')][_0x2596('0x47')]){_0x17b42b['where']=_[_0x2596('0x49')](_0x17b42b[_0x2596('0x45')],{'$or':_['map'](_0x17b42b['attributes'],function(_0x589b15){var _0x59ab0b={};_0x59ab0b[_0x589b15]={'$like':'%'+_0x20af85[_0x2596('0x3c')][_0x2596('0x47')]+'%'};return _0x59ab0b;})});}_0x17b42b=_[_0x2596('0x49')]({},_0x17b42b,_0x20af85[_0x2596('0x4a')]);return _0x20c847[_0x2596('0x5c')](_0x17b42b);}})[_0x2596('0x29')](function(_0x57656b){if(_0x57656b){_0x95cead=_0x57656b['length'];if(!_0x20af85[_0x2596('0x3c')][_0x2596('0x42')]('nolimit')){_0x17b42b[_0x2596('0x21')]=qs[_0x2596('0x21')](_0x20af85[_0x2596('0x3c')][_0x2596('0x21')]);_0x17b42b[_0x2596('0x20')]=qs[_0x2596('0x20')](_0x20af85[_0x2596('0x3c')][_0x2596('0x20')]);}return _0x20c847['getUsers'](_0x17b42b);}})['then'](function(_0x521eeb){if(_0x521eeb){return _0x521eeb?{'count':_0x95cead,'rows':_0x521eeb}:null;}})[_0x2596('0x29')](respondWithResult(_0x285cf7,null))[_0x2596('0x4d')](handleError(_0x285cf7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9c583ad..a8e6871 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 _0xf84f=['hasOwnProperty','hook','exports','setMaxListeners','save','update','remove','emit'];(function(_0xdf4058,_0x3d913d){var _0x141888=function(_0x52b935){while(--_0x52b935){_0xdf4058['push'](_0xdf4058['shift']());}};_0x141888(++_0x3d913d);}(_0xf84f,0x163));var _0xff84=function(_0x2dc0c2,_0x4cf56c){_0x2dc0c2=_0x2dc0c2-0x0;var _0x1ac585=_0xf84f[_0x2dc0c2];return _0x1ac585;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xff84('0x0')](0x0);var events={'afterCreate':_0xff84('0x1'),'afterUpdate':_0xff84('0x2'),'afterDestroy':_0xff84('0x3')};function emitEvent(_0x9db731){return function(_0x496f5c,_0x5deed9,_0x271c84){SquareProjectEvents['emit'](_0x9db731+':'+_0x496f5c['id'],_0x496f5c);SquareProjectEvents[_0xff84('0x4')](_0x9db731,_0x496f5c);_0x271c84(null);};}for(var e in events){if(events[_0xff84('0x5')](e)){var event=events[e];SquareProject[_0xff84('0x6')](e,emitEvent(event));}}module[_0xff84('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x3428=['hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','emit'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x3428,0x13a));var _0x8342=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x3428[_0x82129b];return _0x2ae5dc;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x8342('0x0'))['db'][_0x8342('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8342('0x2')](0x0);var events={'afterCreate':_0x8342('0x3'),'afterUpdate':_0x8342('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e3a4f){return function(_0x539fcf,_0x545079,_0x281b44){SquareProjectEvents[_0x8342('0x5')](_0x2e3a4f+':'+_0x539fcf['id'],_0x539fcf);SquareProjectEvents[_0x8342('0x5')](_0x2e3a4f,_0x539fcf);_0x281b44(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8342('0x6')](e,emitEvent(event));}}module[_0x8342('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index de40459..0577769 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 _0x60bc=['SquareProject','square_projects','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./squareProject.attributes','exports'];(function(_0x1bfc4c,_0x13383e){var _0x141d23=function(_0x15a68c){while(--_0x15a68c){_0x1bfc4c['push'](_0x1bfc4c['shift']());}};_0x141d23(++_0x13383e);}(_0x60bc,0x14b));var _0xc60b=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x60bc[_0x4b4277];return _0x1ff405;};'use strict';var _=require(_0xc60b('0x0'));var util=require(_0xc60b('0x1'));var logger=require(_0xc60b('0x2'))(_0xc60b('0x3'));var moment=require(_0xc60b('0x4'));var BPromise=require(_0xc60b('0x5'));var rp=require(_0xc60b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc60b('0x7'));module[_0xc60b('0x8')]=function(_0x5bfa1e,_0x2a712d){return _0x5bfa1e['define'](_0xc60b('0x9'),attributes,{'tableName':_0xc60b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10e6c9,_0x3c1c58,_0x16b59a){if(_0x10e6c9[_0xc60b('0xb')]('preproduction')){_0x10e6c9[_0xc60b('0xc')]=moment()['format'](_0xc60b('0xd'));}if(_0x10e6c9['changed'](_0xc60b('0xe'))){_0x10e6c9[_0xc60b('0xf')]=moment()[_0xc60b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x16b59a(null,_0x10e6c9);}}});}; \ No newline at end of file +var _0x76b5=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','SquareProject','square_projects'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x76b5,0xc1));var _0x576b=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0x76b5[_0x2d398b];return _0x5d8b9d;};'use strict';var _=require(_0x576b('0x0'));var util=require('util');var logger=require(_0x576b('0x1'))(_0x576b('0x2'));var moment=require(_0x576b('0x3'));var BPromise=require(_0x576b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x576b('0x5'));var config=require(_0x576b('0x6'));var attributes=require('./squareProject.attributes');module[_0x576b('0x7')]=function(_0x4ad429,_0x5e9527){return _0x4ad429[_0x576b('0x8')](_0x576b('0x9'),attributes,{'tableName':_0x576b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34365d,_0xd01d43,_0x3539ee){if(_0x34365d['changed']('preproduction')){_0x34365d[_0x576b('0xb')]=moment()[_0x576b('0xc')](_0x576b('0xd'));}if(_0x34365d[_0x576b('0xe')](_0x576b('0xf'))){_0x34365d[_0x576b('0x10')]=moment()['format'](_0x576b('0xd'));}_0x3539ee(null,_0x34365d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 31cd288..c387ae3 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 _0x1e98=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','map','attributes','model','lodash','util','moment','bluebird','ioredis'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x1e98,0x73));var _0x81e9=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x1e98[_0x135a1c];return _0x295c98;};'use strict';var _=require(_0x81e9('0x0'));var util=require(_0x81e9('0x1'));var moment=require(_0x81e9('0x2'));var BPromise=require(_0x81e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81e9('0x4'));var db=require(_0x81e9('0x5'))['db'];var utils=require(_0x81e9('0x6'));var logger=require('../../config/logger')(_0x81e9('0x7'));var config=require(_0x81e9('0x8'));var jayson=require(_0x81e9('0x9'));var client=jayson[_0x81e9('0xa')][_0x81e9('0xb')]({'port':0x232a});config[_0x81e9('0xc')]=_[_0x81e9('0xd')](config['redis'],{'host':_0x81e9('0xe'),'port':0x18eb});var socket=require(_0x81e9('0xf'))(new Redis(config[_0x81e9('0xc')]));require(_0x81e9('0x10'))[_0x81e9('0x11')](socket);function respondWithRpcPromise(_0x4115c8,_0x1a8bca,_0xea61a3){return new BPromise(function(_0x2e9878,_0xdb242c){return client['request'](_0x4115c8,_0xea61a3)[_0x81e9('0x12')](function(_0x193a74){logger[_0x81e9('0x13')](_0x81e9('0x14'),_0x1a8bca,'request\x20sent');logger[_0x81e9('0x15')](_0x81e9('0x16'),_0x1a8bca,_0x81e9('0x17'),JSON[_0x81e9('0x18')](_0x193a74));if(_0x193a74[_0x81e9('0x19')]){if(_0x193a74[_0x81e9('0x19')][_0x81e9('0x1a')]===0x1f4){logger[_0x81e9('0x19')]('SquareProject,\x20%s,\x20%s',_0x1a8bca,_0x193a74['error'][_0x81e9('0x1b')]);return _0xdb242c(_0x193a74[_0x81e9('0x19')]['message']);}logger[_0x81e9('0x19')](_0x81e9('0x14'),_0x1a8bca,_0x193a74[_0x81e9('0x19')][_0x81e9('0x1b')]);return _0x2e9878(_0x193a74['error'][_0x81e9('0x1b')]);}else{logger[_0x81e9('0x13')]('SquareProject,\x20%s,\x20%s',_0x1a8bca,_0x81e9('0x17'));_0x2e9878(_0x193a74[_0x81e9('0x1c')][_0x81e9('0x1b')]);}})[_0x81e9('0x1d')](function(_0x2a790f){logger[_0x81e9('0x19')](_0x81e9('0x14'),_0x1a8bca,_0x2a790f);_0xdb242c(_0x2a790f);});});}exports[_0x81e9('0x1e')]=function(_0x4d959f){var _0x47441a=this;return new Promise(function(_0x1d5a1b,_0x393789){return db[_0x81e9('0x1f')][_0x81e9('0x20')]({'raw':_0x4d959f[_0x81e9('0x21')]?_0x4d959f[_0x81e9('0x21')][_0x81e9('0x22')]===undefined?!![]:![]:!![],'where':_0x4d959f['options']?_0x4d959f[_0x81e9('0x21')][_0x81e9('0x23')]||null:null,'attributes':_0x4d959f['options']?_0x4d959f[_0x81e9('0x21')]['attributes']||null:null,'include':_0x4d959f[_0x81e9('0x21')]?_0x4d959f[_0x81e9('0x21')][_0x81e9('0x24')]?_[_0x81e9('0x25')](_0x4d959f['options']['include'],function(_0x357cce){return{'model':db[_0x357cce['model']],'as':_0x357cce['as'],'attributes':_0x357cce[_0x81e9('0x26')],'include':_0x357cce[_0x81e9('0x24')]?_[_0x81e9('0x25')](_0x357cce[_0x81e9('0x24')],function(_0x41c1be){return{'model':db[_0x41c1be[_0x81e9('0x27')]],'as':_0x41c1be['as'],'attributes':_0x41c1be[_0x81e9('0x26')],'include':_0x41c1be[_0x81e9('0x24')]?_[_0x81e9('0x25')](_0x41c1be[_0x81e9('0x24')],function(_0xb376cd){return{'model':db[_0xb376cd[_0x81e9('0x27')]],'as':_0xb376cd['as'],'attributes':_0xb376cd[_0x81e9('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1336ba){logger[_0x81e9('0x13')](_0x81e9('0x1e'),_0x4d959f);logger[_0x81e9('0x15')]('ShowSquareProject',_0x4d959f,JSON['stringify'](_0x1336ba));_0x1d5a1b(_0x1336ba);})[_0x81e9('0x1d')](function(_0x473ab3){logger[_0x81e9('0x19')](_0x81e9('0x1e'),_0x473ab3['message'],_0x4d959f);_0x393789(_0x47441a[_0x81e9('0x19')](0x1f4,_0x473ab3[_0x81e9('0x1b')]));});});}; \ No newline at end of file +var _0x1899=['request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','find','options','raw','where','include','map','attributes','model','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','defaults','socket.io-emitter','redis','register'];(function(_0x6c4c28,_0x4a963b){var _0x582d08=function(_0x26b310){while(--_0x26b310){_0x6c4c28['push'](_0x6c4c28['shift']());}};_0x582d08(++_0x4a963b);}(_0x1899,0x7b));var _0x9189=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x1899[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x9189('0x0'));var util=require(_0x9189('0x1'));var moment=require('moment');var BPromise=require(_0x9189('0x2'));var rs=require(_0x9189('0x3'));var fs=require('fs');var Redis=require(_0x9189('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9189('0x5'))(_0x9189('0x6'));var config=require('../../config/environment');var jayson=require(_0x9189('0x7'));var client=jayson['client'][_0x9189('0x8')]({'port':0x232a});config['redis']=_[_0x9189('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9189('0xa'))(new Redis(config[_0x9189('0xb')]));require('./squareProject.socket')[_0x9189('0xc')](socket);function respondWithRpcPromise(_0x2ba1af,_0x1e0a30,_0x1cf310){return new BPromise(function(_0x48336d,_0x2c06f7){return client[_0x9189('0xd')](_0x2ba1af,_0x1cf310)[_0x9189('0xe')](function(_0x1d6910){logger[_0x9189('0xf')](_0x9189('0x10'),_0x1e0a30,_0x9189('0x11'));logger[_0x9189('0x12')](_0x9189('0x13'),_0x1e0a30,_0x9189('0x11'),JSON['stringify'](_0x1d6910));if(_0x1d6910['error']){if(_0x1d6910[_0x9189('0x14')][_0x9189('0x15')]===0x1f4){logger['error'](_0x9189('0x10'),_0x1e0a30,_0x1d6910[_0x9189('0x14')][_0x9189('0x16')]);return _0x2c06f7(_0x1d6910[_0x9189('0x14')][_0x9189('0x16')]);}logger[_0x9189('0x14')](_0x9189('0x10'),_0x1e0a30,_0x1d6910[_0x9189('0x14')][_0x9189('0x16')]);return _0x48336d(_0x1d6910[_0x9189('0x14')]['message']);}else{logger[_0x9189('0xf')](_0x9189('0x10'),_0x1e0a30,_0x9189('0x11'));_0x48336d(_0x1d6910[_0x9189('0x17')]['message']);}})[_0x9189('0x18')](function(_0x5ca468){logger[_0x9189('0x14')]('SquareProject,\x20%s,\x20%s',_0x1e0a30,_0x5ca468);_0x2c06f7(_0x5ca468);});});}exports[_0x9189('0x19')]=function(_0x4b8ba1){var _0x2b8d46=this;return new Promise(function(_0x42ae14,_0x184bf1){return db['SquareProject'][_0x9189('0x1a')]({'raw':_0x4b8ba1[_0x9189('0x1b')]?_0x4b8ba1['options'][_0x9189('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b8ba1['options']?_0x4b8ba1['options'][_0x9189('0x1d')]||null:null,'attributes':_0x4b8ba1[_0x9189('0x1b')]?_0x4b8ba1[_0x9189('0x1b')]['attributes']||null:null,'include':_0x4b8ba1[_0x9189('0x1b')]?_0x4b8ba1['options'][_0x9189('0x1e')]?_[_0x9189('0x1f')](_0x4b8ba1['options'][_0x9189('0x1e')],function(_0x375673){return{'model':db[_0x375673['model']],'as':_0x375673['as'],'attributes':_0x375673[_0x9189('0x20')],'include':_0x375673['include']?_[_0x9189('0x1f')](_0x375673[_0x9189('0x1e')],function(_0x3c0ceb){return{'model':db[_0x3c0ceb[_0x9189('0x21')]],'as':_0x3c0ceb['as'],'attributes':_0x3c0ceb[_0x9189('0x20')],'include':_0x3c0ceb['include']?_[_0x9189('0x1f')](_0x3c0ceb[_0x9189('0x1e')],function(_0x1e92a9){return{'model':db[_0x1e92a9[_0x9189('0x21')]],'as':_0x1e92a9['as'],'attributes':_0x1e92a9[_0x9189('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9189('0xe')](function(_0x2ef5a9){logger['info'](_0x9189('0x19'),_0x4b8ba1);logger[_0x9189('0x12')](_0x9189('0x19'),_0x4b8ba1,JSON['stringify'](_0x2ef5a9));_0x42ae14(_0x2ef5a9);})[_0x9189('0x18')](function(_0x27d642){logger[_0x9189('0x14')](_0x9189('0x19'),_0x27d642['message'],_0x4b8ba1);_0x184bf1(_0x2b8d46[_0x9189('0x14')](0x1f4,_0x27d642[_0x9189('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 6552897..21e6277 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 _0xb4c8=['./squareProject.events','save','update','removeListener','length','squareProject:'];(function(_0x1a34b6,_0x7c0bfd){var _0x5870b6=function(_0x7a66ab){while(--_0x7a66ab){_0x1a34b6['push'](_0x1a34b6['shift']());}};_0x5870b6(++_0x7c0bfd);}(_0xb4c8,0xde));var _0x8b4c=function(_0x43b40c,_0x380617){_0x43b40c=_0x43b40c-0x0;var _0x2600c4=_0xb4c8[_0x43b40c];return _0x2600c4;};'use strict';var SquareProjectEvents=require(_0x8b4c('0x0'));var events=[_0x8b4c('0x1'),'remove',_0x8b4c('0x2')];function createListener(_0x5999cb,_0x9e7740){return function(_0x5da846){_0x9e7740['emit'](_0x5999cb,_0x5da846);};}function removeListener(_0x39433d,_0x747147){return function(){SquareProjectEvents[_0x8b4c('0x3')](_0x39433d,_0x747147);};}exports['register']=function(_0x2c8bc4){for(var _0xcc3250=0x0,_0xcfb89e=events[_0x8b4c('0x4')];_0xcc3250<_0xcfb89e;_0xcc3250++){var _0x2f3226=events[_0xcc3250];var _0xb43a68=createListener(_0x8b4c('0x5')+_0x2f3226,_0x2c8bc4);SquareProjectEvents['on'](_0x2f3226,_0xb43a68);}}; \ No newline at end of file +var _0x9660=['./squareProject.events','save','update','removeListener','length','squareProject:'];(function(_0x29631a,_0x4050fa){var _0x116d29=function(_0x568561){while(--_0x568561){_0x29631a['push'](_0x29631a['shift']());}};_0x116d29(++_0x4050fa);}(_0x9660,0x162));var _0x0966=function(_0x2d0849,_0x3a091b){_0x2d0849=_0x2d0849-0x0;var _0x4b21f4=_0x9660[_0x2d0849];return _0x4b21f4;};'use strict';var SquareProjectEvents=require(_0x0966('0x0'));var events=[_0x0966('0x1'),'remove',_0x0966('0x2')];function createListener(_0x233a4b,_0x39f9a4){return function(_0x371ae3){_0x39f9a4['emit'](_0x233a4b,_0x371ae3);};}function removeListener(_0x4dc2b9,_0x720ca4){return function(){SquareProjectEvents[_0x0966('0x3')](_0x4dc2b9,_0x720ca4);};}exports['register']=function(_0x11df18){for(var _0x2c9de1=0x0,_0x2b4926=events[_0x0966('0x4')];_0x2c9de1<_0x2b4926;_0x2c9de1++){var _0x5f32f2=events[_0x2c9de1];var _0x4e2de3=createListener(_0x0966('0x5')+_0x5f32f2,_0x11df18);SquareProjectEvents['on'](_0x5f32f2,_0x4e2de3);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 1d3f64e..dfcdfb6 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x0295,0x1f0));var _0x5029=function(_0x54bfa9,_0x424d55){_0x54bfa9=_0x54bfa9-0x0;var _0x160e13=_0x0295[_0x54bfa9];return _0x160e13;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x226370,_0x1a783d){var _0x4564e0=function(_0x3a211a){while(--_0x3a211a){_0x226370['push'](_0x226370['shift']());}};_0x4564e0(++_0x1a783d);}(_0xabce,0x103));var _0xeabc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xabce[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f746da7..de1b33f 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['lastIndexOf','sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x41daf4,_0x348752){var _0x3a3991=function(_0x26ed0f){while(--_0x26ed0f){_0x41daf4['push'](_0x41daf4['shift']());}};_0x3a3991(++_0x348752);}(_0x7217,0x19e));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'callerid':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'extension':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7721('0x1')]},'projectName':{'type':Sequelize[_0x7721('0x1')]},'saveName':{'type':Sequelize[_0x7721('0x1')]},'filename':{'type':Sequelize[_0x7721('0x1')]},'savePath':{'type':Sequelize[_0x7721('0x1')]},'format':{'type':Sequelize[_0x7721('0x2')],'get':function(){var _0x18ab6b='';var _0x21f680=this[_0x7721('0x3')](_0x7721('0x4'));if(_0x21f680){_0x18ab6b=_0x21f680[_0x7721('0x5')](_0x21f680[_0x7721('0x6')]('.'));}return _0x18ab6b;}}}; \ No newline at end of file +var _0xdc97=['savePath','substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xdc97,0x13b));var _0x7dc9=function(_0x54a27a,_0x14a4df){_0x54a27a=_0x54a27a-0x0;var _0x46fc76=_0xdc97[_0x54a27a];return _0x46fc76;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'uniqueid':{'type':Sequelize[_0x7dc9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7dc9('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7dc9('0x2')]},'priority':{'type':Sequelize[_0x7dc9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7dc9('0x2')]},'projectName':{'type':Sequelize[_0x7dc9('0x2')]},'saveName':{'type':Sequelize[_0x7dc9('0x2')]},'filename':{'type':Sequelize[_0x7dc9('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7dc9('0x3')],'get':function(){var _0x4f91c7='';var _0x4b3229=this[_0x7dc9('0x4')](_0x7dc9('0x5'));if(_0x4b3229){_0x4f91c7=_0x4b3229[_0x7dc9('0x6')](_0x4b3229[_0x7dc9('0x7')]('.'));}return _0x4f91c7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c458ee6..2c206f3 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 _0xc0ae=['destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','SquareRecording','includeAll','include','findAll','rows','show','params','merge','catch','create','body','find','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../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','apply','reject','save','update','then'];(function(_0x569f1b,_0x28f4ae){var _0x56981f=function(_0x32dd9a){while(--_0x32dd9a){_0x569f1b['push'](_0x569f1b['shift']());}};_0x56981f(++_0x28f4ae);}(_0xc0ae,0xf9));var _0xec0a=function(_0x4f0d23,_0x518e4e){_0x4f0d23=_0x4f0d23-0x0;var _0x48a016=_0xc0ae[_0x4f0d23];return _0x48a016;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec0a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec0a('0x1'));var rp=require('request-promise');var moment=require(_0xec0a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec0a('0x3'));var util=require(_0xec0a('0x4'));var path=require(_0xec0a('0x5'));var sox=require(_0xec0a('0x6'));var csv=require(_0xec0a('0x7'));var ejs=require(_0xec0a('0x8'));var fs=require('fs');var fs_extra=require(_0xec0a('0x9'));var _=require(_0xec0a('0xa'));var squel=require(_0xec0a('0xb'));var crypto=require(_0xec0a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xec0a('0xd'));var toCsv=require(_0xec0a('0x7'));var querystring=require(_0xec0a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec0a('0xf'));var as=require(_0xec0a('0x10'));var hardwareService=require(_0xec0a('0x11'));var logger=require(_0xec0a('0x12'))(_0xec0a('0x13'));var utils=require(_0xec0a('0x14'));var config=require(_0xec0a('0x15'));var licenseUtil=require(_0xec0a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26b926,_0x24f4e5){_0x24f4e5=_0x24f4e5||0xcc;return function(_0x5c51e4){if(_0x5c51e4){return _0x26b926[_0xec0a('0x17')](_0x24f4e5);}return _0x26b926[_0xec0a('0x18')](_0x24f4e5)[_0xec0a('0x19')]();};}function respondWithResult(_0x234d0b,_0x2dc112){_0x2dc112=_0x2dc112||0xc8;return function(_0x3c039b){if(_0x3c039b){return _0x234d0b['status'](_0x2dc112)[_0xec0a('0x1a')](_0x3c039b);}};}function respondWithFilteredResult(_0x4fe327,_0x58407c){return function(_0x1de9ea){if(_0x1de9ea){var _0x291f8c=typeof _0x58407c[_0xec0a('0x1b')]===_0xec0a('0x1c')&&typeof _0x58407c[_0xec0a('0x1d')]==='undefined';var _0x2d5d1c=_0x1de9ea['count'];var _0x21b090=_0x291f8c?0x0:_0x58407c[_0xec0a('0x1b')];var _0x388b6f=_0x291f8c?_0x1de9ea[_0xec0a('0x1e')]:_0x58407c['offset']+_0x58407c[_0xec0a('0x1d')];var _0x2f7845;if(_0x388b6f>=_0x2d5d1c){_0x388b6f=_0x2d5d1c;_0x2f7845=0xc8;}else{_0x2f7845=0xce;}_0x4fe327[_0xec0a('0x18')](_0x2f7845);return _0x4fe327['set']('Content-Range',_0x21b090+'-'+_0x388b6f+'/'+_0x2d5d1c)['json'](_0x1de9ea);}return null;};}function patchUpdates(_0x5a2b42){return function(_0x1832e0){try{jsonpatch[_0xec0a('0x1f')](_0x1832e0,_0x5a2b42,!![]);}catch(_0x4c455f){return BPromise[_0xec0a('0x20')](_0x4c455f);}return _0x1832e0[_0xec0a('0x21')]();};}function saveUpdates(_0x3d3587,_0x1dd541){return function(_0x1219fd){if(_0x1219fd){return _0x1219fd[_0xec0a('0x22')](_0x3d3587)[_0xec0a('0x23')](function(_0x11f96d){return _0x11f96d;});}return null;};}function removeEntity(_0x5bb3b2,_0x5738c6){return function(_0x298cef){if(_0x298cef){return _0x298cef[_0xec0a('0x24')]()[_0xec0a('0x23')](function(){_0x5bb3b2[_0xec0a('0x18')](0xcc)[_0xec0a('0x19')]();});}};}function handleEntityNotFound(_0x32d09e,_0x235480){return function(_0x4bdad6){if(!_0x4bdad6){_0x32d09e['sendStatus'](0x194);}return _0x4bdad6;};}function handleError(_0x30c788,_0x4888c9){_0x4888c9=_0x4888c9||0x1f4;return function(_0x417831){logger[_0xec0a('0x25')](_0x417831[_0xec0a('0x26')]);if(_0x417831[_0xec0a('0x27')]){delete _0x417831[_0xec0a('0x27')];}_0x30c788[_0xec0a('0x18')](_0x4888c9)[_0xec0a('0x28')](_0x417831);};}exports[_0xec0a('0x29')]=function(_0x1b13a7,_0x5d1b8e){var _0xd1d7a0={},_0x29ed3a={},_0x2d1103={'count':0x0,'rows':[]};var _0x59bb9c=_['map'](db['SquareRecording'][_0xec0a('0x2a')],function(_0x2ac74a){return{'name':_0x2ac74a[_0xec0a('0x2b')],'type':_0x2ac74a[_0xec0a('0x2c')][_0xec0a('0x2d')]};});_0x29ed3a[_0xec0a('0x2e')]=_[_0xec0a('0x2f')](_0x59bb9c,_0xec0a('0x27'));_0x29ed3a[_0xec0a('0x30')]=_[_0xec0a('0x31')](_0x1b13a7[_0xec0a('0x30')]);_0x29ed3a[_0xec0a('0x32')]=_[_0xec0a('0x33')](_0x29ed3a[_0xec0a('0x2e')],_0x29ed3a[_0xec0a('0x30')]);_0xd1d7a0[_0xec0a('0x34')]=_[_0xec0a('0x33')](_0x29ed3a[_0xec0a('0x2e')],qs[_0xec0a('0x35')](_0x1b13a7[_0xec0a('0x30')]['fields']));_0xd1d7a0[_0xec0a('0x34')]=_0xd1d7a0['attributes'][_0xec0a('0x36')]?_0xd1d7a0[_0xec0a('0x34')]:_0x29ed3a['model'];if(!_0x1b13a7['query']['hasOwnProperty'](_0xec0a('0x37'))){_0xd1d7a0['limit']=qs[_0xec0a('0x1d')](_0x1b13a7[_0xec0a('0x30')][_0xec0a('0x1d')]);_0xd1d7a0[_0xec0a('0x1b')]=qs[_0xec0a('0x1b')](_0x1b13a7[_0xec0a('0x30')]['offset']);}_0xd1d7a0[_0xec0a('0x38')]=qs[_0xec0a('0x39')](_0x1b13a7['query'][_0xec0a('0x39')]);_0xd1d7a0['where']=qs['filters'](_['pick'](_0x1b13a7[_0xec0a('0x30')],_0x29ed3a[_0xec0a('0x32')]),_0x59bb9c);if(_0x1b13a7[_0xec0a('0x30')]['filter']){_0xd1d7a0[_0xec0a('0x3a')]=_['merge'](_0xd1d7a0[_0xec0a('0x3a')],{'$or':_[_0xec0a('0x2f')](_0x59bb9c,function(_0x2a59f1){if(_0x2a59f1[_0xec0a('0x2c')]!=='VIRTUAL'){var _0x498c20={};_0x498c20[_0x2a59f1['name']]={'$like':'%'+_0x1b13a7[_0xec0a('0x30')][_0xec0a('0x3b')]+'%'};return _0x498c20;}})});}_0xd1d7a0=_['merge']({},_0xd1d7a0,_0x1b13a7['options']);var _0x2448e7={'where':_0xd1d7a0['where']};return db[_0xec0a('0x3c')][_0xec0a('0x1e')](_0x2448e7)[_0xec0a('0x23')](function(_0x47ab08){_0x2d1103[_0xec0a('0x1e')]=_0x47ab08;if(_0x1b13a7['query'][_0xec0a('0x3d')]){_0xd1d7a0[_0xec0a('0x3e')]=[{'all':!![]}];}return db[_0xec0a('0x3c')][_0xec0a('0x3f')](_0xd1d7a0);})[_0xec0a('0x23')](function(_0x3291ac){_0x2d1103[_0xec0a('0x40')]=_0x3291ac;return _0x2d1103;})[_0xec0a('0x23')](respondWithFilteredResult(_0x5d1b8e,_0xd1d7a0))['catch'](handleError(_0x5d1b8e,null));};exports[_0xec0a('0x41')]=function(_0x3f6cbd,_0x38fdd8){var _0x2e3248={'raw':!![],'where':{'id':_0x3f6cbd[_0xec0a('0x42')]['id']}},_0x5605b0={};_0x5605b0['model']=_[_0xec0a('0x31')](db['SquareRecording']['rawAttributes']);_0x5605b0[_0xec0a('0x30')]=_[_0xec0a('0x31')](_0x3f6cbd[_0xec0a('0x30')]);_0x5605b0[_0xec0a('0x32')]=_['intersection'](_0x5605b0[_0xec0a('0x2e')],_0x5605b0['query']);_0x2e3248[_0xec0a('0x34')]=_['intersection'](_0x5605b0['model'],qs['fields'](_0x3f6cbd[_0xec0a('0x30')][_0xec0a('0x35')]));_0x2e3248[_0xec0a('0x34')]=_0x2e3248[_0xec0a('0x34')][_0xec0a('0x36')]?_0x2e3248['attributes']:_0x5605b0['model'];if(_0x3f6cbd[_0xec0a('0x30')][_0xec0a('0x3d')]){_0x2e3248[_0xec0a('0x3e')]=[{'all':!![]}];}_0x2e3248=_[_0xec0a('0x43')]({},_0x2e3248,_0x3f6cbd['options']);return db['SquareRecording']['find'](_0x2e3248)[_0xec0a('0x23')](handleEntityNotFound(_0x38fdd8,null))['then'](respondWithResult(_0x38fdd8,null))[_0xec0a('0x44')](handleError(_0x38fdd8,null));};exports['create']=function(_0x55b347,_0xefab79){return db[_0xec0a('0x3c')][_0xec0a('0x45')](_0x55b347['body'],{})['then'](respondWithResult(_0xefab79,0xc9))['catch'](handleError(_0xefab79,null));};exports['update']=function(_0x27fe9a,_0x2aaf03){if(_0x27fe9a['body']['id']){delete _0x27fe9a[_0xec0a('0x46')]['id'];}return db[_0xec0a('0x3c')][_0xec0a('0x47')]({'where':{'id':_0x27fe9a['params']['id']}})['then'](handleEntityNotFound(_0x2aaf03,null))['then'](saveUpdates(_0x27fe9a['body'],null))['then'](respondWithResult(_0x2aaf03,null))['catch'](handleError(_0x2aaf03,null));};exports[_0xec0a('0x48')]=function(_0x45da1d,_0x12fa40,_0x3cb002){var _0x1c3454=require(_0xec0a('0x49'));var _0x417e5d=![];var _0x9d1ed0={};if(_0x45da1d[_0xec0a('0x30')]['type']&&_0x45da1d[_0xec0a('0x30')][_0xec0a('0x2c')]===_0xec0a('0x4a')){_0x9d1ed0[_0xec0a('0x4a')]=_0x45da1d[_0xec0a('0x42')]['id'];}else{_0x9d1ed0['id']=_0x45da1d[_0xec0a('0x42')]['id'];}return db[_0xec0a('0x3c')][_0xec0a('0x47')]({'where':_0x9d1ed0,'attributes':['id',_0xec0a('0x4b'),'filename'],'raw':!![]})[_0xec0a('0x23')](handleEntityNotFound(_0x12fa40,null))[_0xec0a('0x23')](function(_0x1de6bf){if(_0x1de6bf){var _0x555278=_0x1de6bf[_0xec0a('0x4b')];var _0xb6198b=util[_0xec0a('0x4c')](_0xec0a('0x4d'),_0x555278);if(fs[_0xec0a('0x4e')](_0xb6198b)){_0x417e5d=!![];return _0x1c3454['decryptFile'](_0xb6198b,_0x555278,config[_0xec0a('0x4f')][_0xec0a('0x50')])[_0xec0a('0x23')](function(){return _0x1de6bf;});}return _0x1de6bf;}})[_0xec0a('0x23')](function(_0x5499c8){if(_0x5499c8){var _0x357233=_0x5499c8[_0xec0a('0x4b')];if(!fs['existsSync'](_0x357233)){throw new db['Sequelize'][(_0xec0a('0x51'))](_0xec0a('0x52'));}if(_0x5499c8[_0xec0a('0x53')]){return _0x12fa40[_0xec0a('0x48')](_0x357233,_0x5499c8[_0xec0a('0x53')]+path['extname'](_0x357233),function(){if(_0x417e5d){fs['unlink'](_0x357233);}});}else{return _0x12fa40[_0xec0a('0x48')](_0x357233,function(_0x134a55){if(_0x417e5d){fs[_0xec0a('0x54')](_0x357233);}});}}})[_0xec0a('0x44')](function(_0x1d4a47){if(_0x1d4a47[_0xec0a('0x55')]===_0xec0a('0x52')){_0x12fa40[_0xec0a('0x18')](0x194)['send'](_0xec0a('0x56'));}else{return handleError(_0x12fa40,null);}});};exports[_0xec0a('0x24')]=function(_0x3aeca7,_0x3fe571){return db[_0xec0a('0x3c')][_0xec0a('0x47')]({'where':{'id':_0x3aeca7[_0xec0a('0x42')]['id']}})['then'](function(_0x36d039){if(_[_0xec0a('0x57')](_0x36d039)){throw new ReferenceError(_0xec0a('0x58'));}return _0x36d039;})[_0xec0a('0x23')](function(_0x2e01ec){var _0x4bdd71=_0x2e01ec[_0xec0a('0x4b')];logger['info'](_0xec0a('0x59'),_0x4bdd71);if(!_[_0xec0a('0x57')](_0x2e01ec[_0xec0a('0x4b')])&&fs['existsSync'](_0x4bdd71)){logger[_0xec0a('0x5a')](_0xec0a('0x5b')+_0x4bdd71+_0xec0a('0x5c'));fs['unlinkSync'](_0x4bdd71);}_0x4bdd71=_0x4bdd71+_0xec0a('0x5d');if(!_[_0xec0a('0x57')](_0x2e01ec['savePath'])&&fs[_0xec0a('0x4e')](_0x4bdd71)){logger[_0xec0a('0x5a')](_0xec0a('0x5b')+_0x4bdd71+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xec0a('0x5e')](_0x4bdd71);}return _0x2e01ec;})[_0xec0a('0x23')](function(_0x26b436){if(!_0x26b436)throw new InternalError();return _0x26b436[_0xec0a('0x24')]();})['then'](function(){_0x3fe571[_0xec0a('0x18')](0xcc)[_0xec0a('0x19')]();})[_0xec0a('0x44')](handleError(_0x3fe571,null));}; \ No newline at end of file +var _0xe2cb=['desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','download','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0xe2cb,0x11a));var _0xbe2c=function(_0x3b667f,_0x4144af){_0x3b667f=_0x3b667f-0x0;var _0x2aa31b=_0xe2cb[_0x3b667f];return _0x2aa31b;};'use strict';var emlformat=require(_0xbe2c('0x0'));var rimraf=require(_0xbe2c('0x1'));var zipdir=require(_0xbe2c('0x2'));var jsonpatch=require(_0xbe2c('0x3'));var rp=require('request-promise');var moment=require(_0xbe2c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbe2c('0x5'));var util=require(_0xbe2c('0x6'));var path=require(_0xbe2c('0x7'));var sox=require(_0xbe2c('0x8'));var csv=require('to-csv');var ejs=require(_0xbe2c('0x9'));var fs=require('fs');var fs_extra=require(_0xbe2c('0xa'));var _=require(_0xbe2c('0xb'));var squel=require(_0xbe2c('0xc'));var crypto=require(_0xbe2c('0xd'));var jsforce=require(_0xbe2c('0xe'));var deskjs=require(_0xbe2c('0xf'));var toCsv=require(_0xbe2c('0x10'));var querystring=require('querystring');var Papa=require(_0xbe2c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe2c('0x12'));var hardwareService=require(_0xbe2c('0x13'));var logger=require(_0xbe2c('0x14'))('api');var utils=require(_0xbe2c('0x15'));var config=require(_0xbe2c('0x16'));var licenseUtil=require(_0xbe2c('0x17'));var db=require(_0xbe2c('0x18'))['db'];function respondWithStatusCode(_0x1cafdd,_0x187cb3){_0x187cb3=_0x187cb3||0xcc;return function(_0x3afedd){if(_0x3afedd){return _0x1cafdd[_0xbe2c('0x19')](_0x187cb3);}return _0x1cafdd[_0xbe2c('0x1a')](_0x187cb3)[_0xbe2c('0x1b')]();};}function respondWithResult(_0x435e69,_0xc6d059){_0xc6d059=_0xc6d059||0xc8;return function(_0x4be7e1){if(_0x4be7e1){return _0x435e69[_0xbe2c('0x1a')](_0xc6d059)[_0xbe2c('0x1c')](_0x4be7e1);}};}function respondWithFilteredResult(_0x25619c,_0x2fe52a){return function(_0x33c0ad){if(_0x33c0ad){var _0x15f69f=typeof _0x2fe52a[_0xbe2c('0x1d')]==='undefined'&&typeof _0x2fe52a[_0xbe2c('0x1e')]===_0xbe2c('0x1f');var _0x2d7d4e=_0x33c0ad[_0xbe2c('0x20')];var _0x288ee2=_0x15f69f?0x0:_0x2fe52a[_0xbe2c('0x1d')];var _0x173919=_0x15f69f?_0x33c0ad[_0xbe2c('0x20')]:_0x2fe52a[_0xbe2c('0x1d')]+_0x2fe52a[_0xbe2c('0x1e')];var _0x2b8fda;if(_0x173919>=_0x2d7d4e){_0x173919=_0x2d7d4e;_0x2b8fda=0xc8;}else{_0x2b8fda=0xce;}_0x25619c[_0xbe2c('0x1a')](_0x2b8fda);return _0x25619c[_0xbe2c('0x21')](_0xbe2c('0x22'),_0x288ee2+'-'+_0x173919+'/'+_0x2d7d4e)[_0xbe2c('0x1c')](_0x33c0ad);}return null;};}function patchUpdates(_0x54f102){return function(_0x28a78d){try{jsonpatch['apply'](_0x28a78d,_0x54f102,!![]);}catch(_0x4aab1d){return BPromise[_0xbe2c('0x23')](_0x4aab1d);}return _0x28a78d['save']();};}function saveUpdates(_0x5ce046,_0x58e623){return function(_0x7b1995){if(_0x7b1995){return _0x7b1995[_0xbe2c('0x24')](_0x5ce046)[_0xbe2c('0x25')](function(_0x24f69b){return _0x24f69b;});}return null;};}function removeEntity(_0x4d5398,_0xc8424f){return function(_0x3a5f78){if(_0x3a5f78){return _0x3a5f78[_0xbe2c('0x26')]()[_0xbe2c('0x25')](function(){_0x4d5398['status'](0xcc)[_0xbe2c('0x1b')]();});}};}function handleEntityNotFound(_0x1804fc,_0x3bd470){return function(_0x343f78){if(!_0x343f78){_0x1804fc['sendStatus'](0x194);}return _0x343f78;};}function handleError(_0x320ca6,_0x39b287){_0x39b287=_0x39b287||0x1f4;return function(_0x424c46){logger[_0xbe2c('0x27')](_0x424c46[_0xbe2c('0x28')]);if(_0x424c46[_0xbe2c('0x29')]){delete _0x424c46[_0xbe2c('0x29')];}_0x320ca6[_0xbe2c('0x1a')](_0x39b287)[_0xbe2c('0x2a')](_0x424c46);};}exports['index']=function(_0x39db59,_0x4ab468){var _0x1e5783={},_0x761cd4={},_0xb4a400={'count':0x0,'rows':[]};var _0x7619ce=_['map'](db[_0xbe2c('0x2b')][_0xbe2c('0x2c')],function(_0x2783c5){return{'name':_0x2783c5[_0xbe2c('0x2d')],'type':_0x2783c5[_0xbe2c('0x2e')][_0xbe2c('0x2f')]};});_0x761cd4['model']=_[_0xbe2c('0x30')](_0x7619ce,_0xbe2c('0x29'));_0x761cd4[_0xbe2c('0x31')]=_['keys'](_0x39db59[_0xbe2c('0x31')]);_0x761cd4[_0xbe2c('0x32')]=_['intersection'](_0x761cd4[_0xbe2c('0x33')],_0x761cd4[_0xbe2c('0x31')]);_0x1e5783[_0xbe2c('0x34')]=_[_0xbe2c('0x35')](_0x761cd4[_0xbe2c('0x33')],qs[_0xbe2c('0x36')](_0x39db59['query']['fields']));_0x1e5783['attributes']=_0x1e5783[_0xbe2c('0x34')][_0xbe2c('0x37')]?_0x1e5783[_0xbe2c('0x34')]:_0x761cd4[_0xbe2c('0x33')];if(!_0x39db59[_0xbe2c('0x31')]['hasOwnProperty'](_0xbe2c('0x38'))){_0x1e5783[_0xbe2c('0x1e')]=qs[_0xbe2c('0x1e')](_0x39db59['query'][_0xbe2c('0x1e')]);_0x1e5783['offset']=qs[_0xbe2c('0x1d')](_0x39db59['query']['offset']);}_0x1e5783[_0xbe2c('0x39')]=qs[_0xbe2c('0x3a')](_0x39db59['query'][_0xbe2c('0x3a')]);_0x1e5783[_0xbe2c('0x3b')]=qs['filters'](_[_0xbe2c('0x3c')](_0x39db59['query'],_0x761cd4[_0xbe2c('0x32')]),_0x7619ce);if(_0x39db59['query'][_0xbe2c('0x3d')]){_0x1e5783[_0xbe2c('0x3b')]=_[_0xbe2c('0x3e')](_0x1e5783['where'],{'$or':_[_0xbe2c('0x30')](_0x7619ce,function(_0x48aa46){if(_0x48aa46[_0xbe2c('0x2e')]!==_0xbe2c('0x3f')){var _0x14ddae={};_0x14ddae[_0x48aa46[_0xbe2c('0x29')]]={'$like':'%'+_0x39db59[_0xbe2c('0x31')][_0xbe2c('0x3d')]+'%'};return _0x14ddae;}})});}_0x1e5783=_['merge']({},_0x1e5783,_0x39db59['options']);var _0xab65cd={'where':_0x1e5783[_0xbe2c('0x3b')]};return db['SquareRecording'][_0xbe2c('0x20')](_0xab65cd)[_0xbe2c('0x25')](function(_0x5299eb){_0xb4a400['count']=_0x5299eb;if(_0x39db59['query'][_0xbe2c('0x40')]){_0x1e5783[_0xbe2c('0x41')]=[{'all':!![]}];}return db[_0xbe2c('0x2b')][_0xbe2c('0x42')](_0x1e5783);})[_0xbe2c('0x25')](function(_0x23d95d){_0xb4a400[_0xbe2c('0x43')]=_0x23d95d;return _0xb4a400;})['then'](respondWithFilteredResult(_0x4ab468,_0x1e5783))[_0xbe2c('0x44')](handleError(_0x4ab468,null));};exports[_0xbe2c('0x45')]=function(_0x4260bb,_0x1b4206){var _0x12324d={'raw':!![],'where':{'id':_0x4260bb['params']['id']}},_0x3f75b2={};_0x3f75b2[_0xbe2c('0x33')]=_[_0xbe2c('0x46')](db[_0xbe2c('0x2b')][_0xbe2c('0x2c')]);_0x3f75b2['query']=_[_0xbe2c('0x46')](_0x4260bb[_0xbe2c('0x31')]);_0x3f75b2['filters']=_[_0xbe2c('0x35')](_0x3f75b2[_0xbe2c('0x33')],_0x3f75b2[_0xbe2c('0x31')]);_0x12324d[_0xbe2c('0x34')]=_[_0xbe2c('0x35')](_0x3f75b2[_0xbe2c('0x33')],qs[_0xbe2c('0x36')](_0x4260bb[_0xbe2c('0x31')][_0xbe2c('0x36')]));_0x12324d[_0xbe2c('0x34')]=_0x12324d[_0xbe2c('0x34')][_0xbe2c('0x37')]?_0x12324d['attributes']:_0x3f75b2[_0xbe2c('0x33')];if(_0x4260bb[_0xbe2c('0x31')]['includeAll']){_0x12324d[_0xbe2c('0x41')]=[{'all':!![]}];}_0x12324d=_['merge']({},_0x12324d,_0x4260bb[_0xbe2c('0x47')]);return db['SquareRecording'][_0xbe2c('0x48')](_0x12324d)[_0xbe2c('0x25')](handleEntityNotFound(_0x1b4206,null))[_0xbe2c('0x25')](respondWithResult(_0x1b4206,null))[_0xbe2c('0x44')](handleError(_0x1b4206,null));};exports[_0xbe2c('0x49')]=function(_0x538467,_0x43a72d){return db['SquareRecording'][_0xbe2c('0x49')](_0x538467[_0xbe2c('0x4a')],{})[_0xbe2c('0x25')](respondWithResult(_0x43a72d,0xc9))[_0xbe2c('0x44')](handleError(_0x43a72d,null));};exports['update']=function(_0x20ef16,_0x290265){if(_0x20ef16[_0xbe2c('0x4a')]['id']){delete _0x20ef16[_0xbe2c('0x4a')]['id'];}return db[_0xbe2c('0x2b')][_0xbe2c('0x48')]({'where':{'id':_0x20ef16[_0xbe2c('0x4b')]['id']}})[_0xbe2c('0x25')](handleEntityNotFound(_0x290265,null))[_0xbe2c('0x25')](saveUpdates(_0x20ef16['body'],null))[_0xbe2c('0x25')](respondWithResult(_0x290265,null))[_0xbe2c('0x44')](handleError(_0x290265,null));};exports[_0xbe2c('0x4c')]=function(_0x5eee29,_0x56ab74,_0x6897b7){var _0x206a55=require('../../components/encryptor');var _0x292bd0=![];var _0x46e07b={};if(_0x5eee29[_0xbe2c('0x31')][_0xbe2c('0x2e')]&&_0x5eee29[_0xbe2c('0x31')]['type']===_0xbe2c('0x4d')){_0x46e07b['uniqueid']=_0x5eee29['params']['id'];}else{_0x46e07b['id']=_0x5eee29[_0xbe2c('0x4b')]['id'];}return db[_0xbe2c('0x2b')][_0xbe2c('0x48')]({'where':_0x46e07b,'attributes':['id',_0xbe2c('0x4e'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x56ab74,null))['then'](function(_0x28e6db){if(_0x28e6db){var _0x599372=_0x28e6db['savePath'];var _0x3cc5a7=util[_0xbe2c('0x4f')](_0xbe2c('0x50'),_0x599372);if(fs[_0xbe2c('0x51')](_0x3cc5a7)){_0x292bd0=!![];return _0x206a55[_0xbe2c('0x52')](_0x3cc5a7,_0x599372,config[_0xbe2c('0x53')][_0xbe2c('0x54')])[_0xbe2c('0x25')](function(){return _0x28e6db;});}return _0x28e6db;}})[_0xbe2c('0x25')](function(_0x323754){if(_0x323754){var _0x17f9c8=_0x323754[_0xbe2c('0x4e')];if(!fs[_0xbe2c('0x51')](_0x17f9c8)){throw new db[(_0xbe2c('0x55'))][(_0xbe2c('0x56'))](_0xbe2c('0x57'));}if(_0x323754[_0xbe2c('0x58')]){return _0x56ab74[_0xbe2c('0x4c')](_0x17f9c8,_0x323754[_0xbe2c('0x58')]+path[_0xbe2c('0x59')](_0x17f9c8),function(){if(_0x292bd0){fs[_0xbe2c('0x5a')](_0x17f9c8);}});}else{return _0x56ab74[_0xbe2c('0x4c')](_0x17f9c8,function(_0x80bd00){if(_0x292bd0){fs['unlink'](_0x17f9c8);}});}}})[_0xbe2c('0x44')](function(_0x13d7ec){if(_0x13d7ec[_0xbe2c('0x5b')]===_0xbe2c('0x57')){_0x56ab74['status'](0x194)[_0xbe2c('0x2a')](_0xbe2c('0x5c'));}else{return handleError(_0x56ab74,null);}});};exports[_0xbe2c('0x26')]=function(_0x325644,_0x1fec7a){return db[_0xbe2c('0x2b')]['find']({'where':{'id':_0x325644[_0xbe2c('0x4b')]['id']}})['then'](function(_0x158001){if(_[_0xbe2c('0x5d')](_0x158001)){throw new ReferenceError('Entity\x20not\x20found');}return _0x158001;})[_0xbe2c('0x25')](function(_0x66eb4d){var _0x31ee9d=_0x66eb4d['savePath'];logger[_0xbe2c('0x5e')](_0xbe2c('0x5f'),_0x31ee9d);if(!_[_0xbe2c('0x5d')](_0x66eb4d['savePath'])&&fs[_0xbe2c('0x51')](_0x31ee9d)){logger[_0xbe2c('0x5e')](_0xbe2c('0x60')+_0x31ee9d+_0xbe2c('0x61'));fs[_0xbe2c('0x62')](_0x31ee9d);}_0x31ee9d=_0x31ee9d+'.cypher';if(!_[_0xbe2c('0x5d')](_0x66eb4d['savePath'])&&fs[_0xbe2c('0x51')](_0x31ee9d)){logger[_0xbe2c('0x5e')](_0xbe2c('0x60')+_0x31ee9d+_0xbe2c('0x61'));fs[_0xbe2c('0x62')](_0x31ee9d);}return _0x66eb4d;})[_0xbe2c('0x25')](function(_0x498e45){if(!_0x498e45)throw new InternalError();return _0x498e45[_0xbe2c('0x26')]();})[_0xbe2c('0x25')](function(){_0x1fec7a[_0xbe2c('0x1a')](0xcc)[_0xbe2c('0x1b')]();})[_0xbe2c('0x44')](handleError(_0x1fec7a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 95f198a..dafb3cc 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 _0x078a=['SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0xee578e,_0x43e5c8){var _0x400bd0=function(_0x325d80){while(--_0x325d80){_0xee578e['push'](_0xee578e['shift']());}};_0x400bd0(++_0x43e5c8);}(_0x078a,0x12d));var _0xa078=function(_0x42a11b,_0x442474){_0x42a11b=_0x42a11b-0x0;var _0x3a73a7=_0x078a[_0x42a11b];return _0x3a73a7;};'use strict';var _=require(_0xa078('0x0'));var util=require(_0xa078('0x1'));var logger=require(_0xa078('0x2'))(_0xa078('0x3'));var moment=require(_0xa078('0x4'));var BPromise=require(_0xa078('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa078('0x6'));var rimraf=require(_0xa078('0x7'));var config=require(_0xa078('0x8'));var attributes=require('./squareRecording.attributes');module[_0xa078('0x9')]=function(_0x4a65f2,_0x453616){return _0x4a65f2[_0xa078('0xa')](_0xa078('0xb'),attributes,{'tableName':_0xa078('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf954=['api','moment','bluebird','request-promise','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x10c70c,_0x5b2603){var _0x3b32bf=function(_0x2c6c7f){while(--_0x2c6c7f){_0x10c70c['push'](_0x10c70c['shift']());}};_0x3b32bf(++_0x5b2603);}(_0xf954,0x10e));var _0x4f95=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xf954[_0xd511d];return _0x3f148e;};'use strict';var _=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var logger=require(_0x4f95('0x2'))(_0x4f95('0x3'));var moment=require(_0x4f95('0x4'));var BPromise=require(_0x4f95('0x5'));var rp=require(_0x4f95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f95('0x7'));var attributes=require(_0x4f95('0x8'));module[_0x4f95('0x9')]=function(_0x3ca6c3,_0x5c68f3){return _0x3ca6c3[_0x4f95('0xa')](_0x4f95('0xb'),attributes,{'tableName':_0x4f95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 173223f..586abf2 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 _0xabb2=['rpc','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x8a539a,_0xf00daf){var _0x54dccd=function(_0x9fdbd1){while(--_0x9fdbd1){_0x8a539a['push'](_0x8a539a['shift']());}};_0x54dccd(++_0xf00daf);}(_0xabb2,0xeb));var _0x2abb=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0xabb2[_0x2ffc46];return _0x1eda8f;};'use strict';var _=require(_0x2abb('0x0'));var util=require(_0x2abb('0x1'));var moment=require(_0x2abb('0x2'));var BPromise=require(_0x2abb('0x3'));var rs=require(_0x2abb('0x4'));var fs=require('fs');var Redis=require(_0x2abb('0x5'));var db=require(_0x2abb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2abb('0x7'))(_0x2abb('0x8'));var config=require('../../config/environment');var jayson=require(_0x2abb('0x9'));var client=jayson['client'][_0x2abb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d700a,_0x4bf779,_0xfa9985){return new BPromise(function(_0x218970,_0x3d8e68){return client[_0x2abb('0xb')](_0x2d700a,_0xfa9985)['then'](function(_0x2d294f){logger['info']('SquareRecording,\x20%s,\x20%s',_0x4bf779,_0x2abb('0xc'));logger[_0x2abb('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4bf779,_0x2abb('0xc'),JSON[_0x2abb('0xe')](_0x2d294f));if(_0x2d294f[_0x2abb('0xf')]){if(_0x2d294f[_0x2abb('0xf')][_0x2abb('0x10')]===0x1f4){logger[_0x2abb('0xf')](_0x2abb('0x11'),_0x4bf779,_0x2d294f[_0x2abb('0xf')][_0x2abb('0x12')]);return _0x3d8e68(_0x2d294f[_0x2abb('0xf')][_0x2abb('0x12')]);}logger['error'](_0x2abb('0x11'),_0x4bf779,_0x2d294f['error'][_0x2abb('0x12')]);return _0x218970(_0x2d294f[_0x2abb('0xf')][_0x2abb('0x12')]);}else{logger[_0x2abb('0x13')]('SquareRecording,\x20%s,\x20%s',_0x4bf779,'request\x20sent');_0x218970(_0x2d294f[_0x2abb('0x14')][_0x2abb('0x12')]);}})[_0x2abb('0x15')](function(_0x2f99fb){logger[_0x2abb('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4bf779,_0x2f99fb);_0x3d8e68(_0x2f99fb);});});}exports[_0x2abb('0x16')]=function(_0x2a1781){var _0x3e18dd=this;return new Promise(function(_0x447efc,_0x2f304e){return db[_0x2abb('0x17')]['create'](_0x2a1781[_0x2abb('0x18')],{'raw':_0x2a1781[_0x2abb('0x19')]?_0x2a1781[_0x2abb('0x19')][_0x2abb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xee3dfa){logger[_0x2abb('0x13')](_0x2abb('0x16'),_0x2a1781);logger['debug'](_0x2abb('0x16'),_0x2a1781,JSON[_0x2abb('0xe')](_0xee3dfa));_0x447efc(_0xee3dfa);})[_0x2abb('0x15')](function(_0x7b19f6){logger[_0x2abb('0xf')](_0x2abb('0x16'),_0x7b19f6[_0x2abb('0x12')],_0x2a1781);_0x2f304e(_0x3e18dd['error'](0x1f4,_0x7b19f6['message']));});});}; \ No newline at end of file +var _0x83ed=['catch','CreateSquareRecording','options','raw','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','info'];(function(_0x1a8344,_0x328d26){var _0x9e0a15=function(_0x4ddc85){while(--_0x4ddc85){_0x1a8344['push'](_0x1a8344['shift']());}};_0x9e0a15(++_0x328d26);}(_0x83ed,0xea));var _0xd83e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x83ed[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0xd83e('0x0'));var util=require('util');var moment=require(_0xd83e('0x1'));var BPromise=require('bluebird');var rs=require(_0xd83e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd83e('0x3'));var logger=require(_0xd83e('0x4'))('rpc');var config=require(_0xd83e('0x5'));var jayson=require(_0xd83e('0x6'));var client=jayson[_0xd83e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a3aef,_0x360c77,_0x3f8bd4){return new BPromise(function(_0x2f0732,_0x3e59c2){return client[_0xd83e('0x8')](_0x1a3aef,_0x3f8bd4)[_0xd83e('0x9')](function(_0x170935){logger['info']('SquareRecording,\x20%s,\x20%s',_0x360c77,_0xd83e('0xa'));logger[_0xd83e('0xb')](_0xd83e('0xc'),_0x360c77,_0xd83e('0xa'),JSON[_0xd83e('0xd')](_0x170935));if(_0x170935['error']){if(_0x170935[_0xd83e('0xe')][_0xd83e('0xf')]===0x1f4){logger[_0xd83e('0xe')](_0xd83e('0x10'),_0x360c77,_0x170935[_0xd83e('0xe')][_0xd83e('0x11')]);return _0x3e59c2(_0x170935[_0xd83e('0xe')]['message']);}logger['error'](_0xd83e('0x10'),_0x360c77,_0x170935['error'][_0xd83e('0x11')]);return _0x2f0732(_0x170935[_0xd83e('0xe')][_0xd83e('0x11')]);}else{logger[_0xd83e('0x12')]('SquareRecording,\x20%s,\x20%s',_0x360c77,'request\x20sent');_0x2f0732(_0x170935['result']['message']);}})[_0xd83e('0x13')](function(_0x5aaec7){logger['error'](_0xd83e('0x10'),_0x360c77,_0x5aaec7);_0x3e59c2(_0x5aaec7);});});}exports[_0xd83e('0x14')]=function(_0xc4887b){var _0x983504=this;return new Promise(function(_0x16eeb1,_0x2caa0b){return db['SquareRecording']['create'](_0xc4887b['body'],{'raw':_0xc4887b[_0xd83e('0x15')]?_0xc4887b['options'][_0xd83e('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac01f){logger[_0xd83e('0x12')](_0xd83e('0x14'),_0xc4887b);logger[_0xd83e('0xb')](_0xd83e('0x14'),_0xc4887b,JSON[_0xd83e('0xd')](_0x2ac01f));_0x16eeb1(_0x2ac01f);})[_0xd83e('0x13')](function(_0x502ce6){logger[_0xd83e('0xe')]('CreateSquareRecording',_0x502ce6[_0xd83e('0x11')],_0xc4887b);_0x2caa0b(_0x983504['error'](0x1f4,_0x502ce6[_0xd83e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 354d308..9d90b8a 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(_0x5d6429,_0x5355ba){var _0x5b8a62=function(_0x24a736){while(--_0x24a736){_0x5d6429['push'](_0x5d6429['shift']());}};_0x5b8a62(++_0x5355ba);}(_0xe706,0xa3));var _0x6e70=function(_0x2fe15c,_0x48713a){_0x2fe15c=_0x2fe15c-0x0;var _0x26ec58=_0xe706[_0x2fe15c];return _0x26ec58;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2683c0,_0x1274fd){var _0xb0bb40=function(_0x42ace6){while(--_0x42ace6){_0x2683c0['push'](_0x2683c0['shift']());}};_0xb0bb40(++_0x1274fd);}(_0xb10b,0x12a));var _0xbb10=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0xb10b[_0x466a1a];return _0x577165;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 90e7dcc..87b0689 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 _0xbc20=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x33a5ee,_0x5329f0){var _0x4029ef=function(_0x606bf0){while(--_0x606bf0){_0x33a5ee['push'](_0x33a5ee['shift']());}};_0x4029ef(++_0x5329f0);}(_0xbc20,0x1c7));var _0x0bc2=function(_0x3cf58d,_0x394240){_0x3cf58d=_0x3cf58d-0x0;var _0x284a3f=_0xbc20[_0x3cf58d];return _0x284a3f;};'use strict';var Sequelize=require(_0x0bc2('0x0'));module[_0x0bc2('0x1')]={'network':{'type':Sequelize[_0x0bc2('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0bc2('0x2')]},'channel':{'type':Sequelize[_0x0bc2('0x2')]},'language':{'type':Sequelize[_0x0bc2('0x2')]},'type':{'type':Sequelize[_0x0bc2('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x0bc2('0x2')]},'callerid':{'type':Sequelize[_0x0bc2('0x2')]},'calleridname':{'type':Sequelize[_0x0bc2('0x2')]},'callingpres':{'type':Sequelize[_0x0bc2('0x2')]},'callingani2':{'type':Sequelize[_0x0bc2('0x2')]},'callington':{'type':Sequelize[_0x0bc2('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x0bc2('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0bc2('0x2')]},'extension':{'type':Sequelize[_0x0bc2('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0bc2('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0bc2('0x2')]},'project_name':{'type':Sequelize[_0x0bc2('0x2')]},'joinAt':{'type':Sequelize[_0x0bc2('0x3')]},'leaveAt':{'type':Sequelize[_0x0bc2('0x3')]},'bot':{'type':Sequelize[_0x0bc2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xed01=['DATE','sequelize','exports','STRING'];(function(_0x2f7306,_0x30dfc7){var _0x579459=function(_0x37c393){while(--_0x37c393){_0x2f7306['push'](_0x2f7306['shift']());}};_0x579459(++_0x30dfc7);}(_0xed01,0x1d1));var _0x1ed0=function(_0x5ecbbc,_0x2541f5){_0x5ecbbc=_0x5ecbbc-0x0;var _0x219a19=_0xed01[_0x5ecbbc];return _0x219a19;};'use strict';var Sequelize=require(_0x1ed0('0x0'));module[_0x1ed0('0x1')]={'network':{'type':Sequelize[_0x1ed0('0x2')]},'network_script':{'type':Sequelize[_0x1ed0('0x2')]},'request':{'type':Sequelize[_0x1ed0('0x2')]},'channel':{'type':Sequelize[_0x1ed0('0x2')]},'language':{'type':Sequelize[_0x1ed0('0x2')]},'type':{'type':Sequelize[_0x1ed0('0x2')]},'uniqueid':{'type':Sequelize[_0x1ed0('0x2')]},'version':{'type':Sequelize[_0x1ed0('0x2')]},'callerid':{'type':Sequelize[_0x1ed0('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x1ed0('0x2')]},'callingani2':{'type':Sequelize[_0x1ed0('0x2')]},'callington':{'type':Sequelize[_0x1ed0('0x2')]},'callingtns':{'type':Sequelize[_0x1ed0('0x2')]},'dnid':{'type':Sequelize[_0x1ed0('0x2')]},'rdnis':{'type':Sequelize[_0x1ed0('0x2')]},'context':{'type':Sequelize[_0x1ed0('0x2')]},'extension':{'type':Sequelize[_0x1ed0('0x2')]},'priority':{'type':Sequelize[_0x1ed0('0x2')]},'enhanced':{'type':Sequelize[_0x1ed0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x1ed0('0x2')]},'project_name':{'type':Sequelize[_0x1ed0('0x2')]},'joinAt':{'type':Sequelize[_0x1ed0('0x3')]},'leaveAt':{'type':Sequelize[_0x1ed0('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index ecb2869..b2ca4f9 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 _0xf9bb=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x40daf2,_0x3d9e86){var _0x3a12e3=function(_0x44ec5c){while(--_0x44ec5c){_0x40daf2['push'](_0x40daf2['shift']());}};_0x3a12e3(++_0x3d9e86);}(_0xf9bb,0x7b));var _0xbf9b=function(_0x567751,_0x4287c3){_0x567751=_0x567751-0x0;var _0x21a84c=_0xf9bb[_0x567751];return _0x21a84c;};'use strict';var emlformat=require(_0xbf9b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf9b('0x1'));var rp=require(_0xbf9b('0x2'));var moment=require(_0xbf9b('0x3'));var BPromise=require(_0xbf9b('0x4'));var Mustache=require(_0xbf9b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbf9b('0x6'));var csv=require(_0xbf9b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf9b('0x8'));var _=require(_0xbf9b('0x9'));var squel=require(_0xbf9b('0xa'));var crypto=require('crypto');var jsforce=require(_0xbf9b('0xb'));var deskjs=require(_0xbf9b('0xc'));var toCsv=require(_0xbf9b('0x7'));var querystring=require(_0xbf9b('0xd'));var Papa=require(_0xbf9b('0xe'));var Redis=require(_0xbf9b('0xf'));var authService=require(_0xbf9b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbf9b('0x11'));var hardwareService=require(_0xbf9b('0x12'));var logger=require('../../config/logger')(_0xbf9b('0x13'));var utils=require(_0xbf9b('0x14'));var config=require(_0xbf9b('0x15'));var licenseUtil=require(_0xbf9b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x208d3f,_0x5f20be){_0x5f20be=_0x5f20be||0xcc;return function(_0x4e1d4a){if(_0x4e1d4a){return _0x208d3f[_0xbf9b('0x17')](_0x5f20be);}return _0x208d3f[_0xbf9b('0x18')](_0x5f20be)[_0xbf9b('0x19')]();};}function respondWithResult(_0x4055bf,_0x4bb531){_0x4bb531=_0x4bb531||0xc8;return function(_0x21b1a7){if(_0x21b1a7){return _0x4055bf[_0xbf9b('0x18')](_0x4bb531)[_0xbf9b('0x1a')](_0x21b1a7);}};}function respondWithFilteredResult(_0x1575ea,_0x2b262c){return function(_0x46e665){if(_0x46e665){var _0x4b1171=typeof _0x2b262c[_0xbf9b('0x1b')]===_0xbf9b('0x1c')&&typeof _0x2b262c[_0xbf9b('0x1d')]==='undefined';var _0x1b27e8=_0x46e665[_0xbf9b('0x1e')];var _0x176863=_0x4b1171?0x0:_0x2b262c[_0xbf9b('0x1b')];var _0x25db29=_0x4b1171?_0x46e665[_0xbf9b('0x1e')]:_0x2b262c[_0xbf9b('0x1b')]+_0x2b262c[_0xbf9b('0x1d')];var _0x27eaa;if(_0x25db29>=_0x1b27e8){_0x25db29=_0x1b27e8;_0x27eaa=0xc8;}else{_0x27eaa=0xce;}_0x1575ea[_0xbf9b('0x18')](_0x27eaa);return _0x1575ea[_0xbf9b('0x1f')](_0xbf9b('0x20'),_0x176863+'-'+_0x25db29+'/'+_0x1b27e8)[_0xbf9b('0x1a')](_0x46e665);}return null;};}function patchUpdates(_0x2e1468){return function(_0x46830e){try{jsonpatch[_0xbf9b('0x21')](_0x46830e,_0x2e1468,!![]);}catch(_0x57f79b){return BPromise['reject'](_0x57f79b);}return _0x46830e['save']();};}function saveUpdates(_0x2b0045,_0x50736e){return function(_0x4c3b47){if(_0x4c3b47){return _0x4c3b47[_0xbf9b('0x22')](_0x2b0045)[_0xbf9b('0x23')](function(_0x2a4a8a){return _0x2a4a8a;});}return null;};}function removeEntity(_0x18f3aa,_0x5a4c3d){return function(_0x344d9d){if(_0x344d9d){return _0x344d9d[_0xbf9b('0x24')]()['then'](function(){_0x18f3aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59c47f,_0x9d0b58){return function(_0x28ed50){if(!_0x28ed50){_0x59c47f[_0xbf9b('0x17')](0x194);}return _0x28ed50;};}function handleError(_0x1bb7e3,_0x17a5d9){_0x17a5d9=_0x17a5d9||0x1f4;return function(_0x2aa82e){logger['error'](_0x2aa82e[_0xbf9b('0x25')]);if(_0x2aa82e[_0xbf9b('0x26')]){delete _0x2aa82e['name'];}_0x1bb7e3[_0xbf9b('0x18')](_0x17a5d9)['send'](_0x2aa82e);};}exports[_0xbf9b('0x27')]=function(_0x32d568,_0x44b0d6){var _0x1ebc1b={},_0x471ee6={},_0x559f7a={'count':0x0,'rows':[]};var _0x3fd9ae=_[_0xbf9b('0x28')](db['SquareReport'][_0xbf9b('0x29')],function(_0x1b2ebc){return{'name':_0x1b2ebc[_0xbf9b('0x2a')],'type':_0x1b2ebc[_0xbf9b('0x2b')][_0xbf9b('0x2c')]};});_0x471ee6[_0xbf9b('0x2d')]=_[_0xbf9b('0x28')](_0x3fd9ae,_0xbf9b('0x26'));_0x471ee6[_0xbf9b('0x2e')]=_[_0xbf9b('0x2f')](_0x32d568[_0xbf9b('0x2e')]);_0x471ee6[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x471ee6['model'],_0x471ee6[_0xbf9b('0x2e')]);_0x1ebc1b[_0xbf9b('0x32')]=_[_0xbf9b('0x31')](_0x471ee6[_0xbf9b('0x2d')],qs[_0xbf9b('0x33')](_0x32d568[_0xbf9b('0x2e')][_0xbf9b('0x33')]));_0x1ebc1b[_0xbf9b('0x32')]=_0x1ebc1b['attributes'][_0xbf9b('0x34')]?_0x1ebc1b[_0xbf9b('0x32')]:_0x471ee6[_0xbf9b('0x2d')];if(!_0x32d568[_0xbf9b('0x2e')]['hasOwnProperty']('nolimit')){_0x1ebc1b['limit']=qs['limit'](_0x32d568['query']['limit']);_0x1ebc1b['offset']=qs[_0xbf9b('0x1b')](_0x32d568[_0xbf9b('0x2e')]['offset']);}_0x1ebc1b[_0xbf9b('0x35')]=qs[_0xbf9b('0x36')](_0x32d568[_0xbf9b('0x2e')]['sort']);_0x1ebc1b[_0xbf9b('0x37')]=qs[_0xbf9b('0x30')](_[_0xbf9b('0x38')](_0x32d568[_0xbf9b('0x2e')],_0x471ee6[_0xbf9b('0x30')]),_0x3fd9ae);if(_0x32d568['query'][_0xbf9b('0x39')]){_0x1ebc1b['where']=_[_0xbf9b('0x3a')](_0x1ebc1b[_0xbf9b('0x37')],{'$or':_[_0xbf9b('0x28')](_0x3fd9ae,function(_0x2cf497){if(_0x2cf497[_0xbf9b('0x2b')]!==_0xbf9b('0x3b')){var _0x1a0eac={};_0x1a0eac[_0x2cf497[_0xbf9b('0x26')]]={'$like':'%'+_0x32d568[_0xbf9b('0x2e')][_0xbf9b('0x39')]+'%'};return _0x1a0eac;}})});}_0x1ebc1b=_['merge']({},_0x1ebc1b,_0x32d568[_0xbf9b('0x3c')]);var _0x3ad856={'where':_0x1ebc1b['where']};return db[_0xbf9b('0x3d')]['count'](_0x3ad856)[_0xbf9b('0x23')](function(_0x3ddc71){_0x559f7a[_0xbf9b('0x1e')]=_0x3ddc71;if(_0x32d568[_0xbf9b('0x2e')][_0xbf9b('0x3e')]){_0x1ebc1b[_0xbf9b('0x3f')]=[{'all':!![]}];}return db[_0xbf9b('0x3d')][_0xbf9b('0x40')](_0x1ebc1b);})[_0xbf9b('0x23')](function(_0x3165be){_0x559f7a[_0xbf9b('0x41')]=_0x3165be;return _0x559f7a;})[_0xbf9b('0x23')](respondWithFilteredResult(_0x44b0d6,_0x1ebc1b))[_0xbf9b('0x42')](handleError(_0x44b0d6,null));};exports[_0xbf9b('0x43')]=function(_0x2939e5,_0x4f00bd){var _0x1097ae={'raw':!![],'where':{'id':_0x2939e5[_0xbf9b('0x44')]['id']}},_0x35c476={};_0x35c476[_0xbf9b('0x2d')]=_[_0xbf9b('0x2f')](db[_0xbf9b('0x3d')][_0xbf9b('0x29')]);_0x35c476[_0xbf9b('0x2e')]=_[_0xbf9b('0x2f')](_0x2939e5[_0xbf9b('0x2e')]);_0x35c476[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x35c476['model'],_0x35c476[_0xbf9b('0x2e')]);_0x1097ae[_0xbf9b('0x32')]=_['intersection'](_0x35c476[_0xbf9b('0x2d')],qs[_0xbf9b('0x33')](_0x2939e5[_0xbf9b('0x2e')][_0xbf9b('0x33')]));_0x1097ae['attributes']=_0x1097ae['attributes'][_0xbf9b('0x34')]?_0x1097ae[_0xbf9b('0x32')]:_0x35c476['model'];if(_0x2939e5[_0xbf9b('0x2e')]['includeAll']){_0x1097ae[_0xbf9b('0x3f')]=[{'all':!![]}];}_0x1097ae=_[_0xbf9b('0x3a')]({},_0x1097ae,_0x2939e5[_0xbf9b('0x3c')]);return db['SquareReport'][_0xbf9b('0x45')](_0x1097ae)[_0xbf9b('0x23')](handleEntityNotFound(_0x4f00bd,null))[_0xbf9b('0x23')](respondWithResult(_0x4f00bd,null))[_0xbf9b('0x42')](handleError(_0x4f00bd,null));};exports['create']=function(_0x3d9278,_0x2a1f31){return db[_0xbf9b('0x3d')][_0xbf9b('0x46')](_0x3d9278[_0xbf9b('0x47')],{})[_0xbf9b('0x23')](respondWithResult(_0x2a1f31,0xc9))['catch'](handleError(_0x2a1f31,null));};exports['update']=function(_0x460a3a,_0x509e5b){if(_0x460a3a[_0xbf9b('0x47')]['id']){delete _0x460a3a[_0xbf9b('0x47')]['id'];}return db[_0xbf9b('0x3d')]['find']({'where':{'id':_0x460a3a['params']['id']}})[_0xbf9b('0x23')](handleEntityNotFound(_0x509e5b,null))[_0xbf9b('0x23')](saveUpdates(_0x460a3a[_0xbf9b('0x47')],null))['then'](respondWithResult(_0x509e5b,null))[_0xbf9b('0x42')](handleError(_0x509e5b,null));};exports[_0xbf9b('0x24')]=function(_0x324f7d,_0x4d922e){return db[_0xbf9b('0x3d')]['find']({'where':{'id':_0x324f7d['params']['id']}})[_0xbf9b('0x23')](handleEntityNotFound(_0x4d922e,null))['then'](removeEntity(_0x4d922e,null))['catch'](handleError(_0x4d922e,null));};exports[_0xbf9b('0x48')]=function(_0xfe33f1,_0x54221f){return db[_0xbf9b('0x3d')][_0xbf9b('0x48')]()[_0xbf9b('0x23')](respondWithResult(_0x54221f,null))[_0xbf9b('0x42')](handleError(_0x54221f,null));}; \ No newline at end of file +var _0x6ff5=['pick','merge','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','stack','name','send','index','map','SquareReport','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x315d51,_0x1bff90){var _0x53e275=function(_0x5a1510){while(--_0x5a1510){_0x315d51['push'](_0x315d51['shift']());}};_0x53e275(++_0x1bff90);}(_0x6ff5,0xff));var _0x56ff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ff5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56ff('0x0'));var zipdir=require(_0x56ff('0x1'));var jsonpatch=require(_0x56ff('0x2'));var rp=require(_0x56ff('0x3'));var moment=require(_0x56ff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x56ff('0x5'));var util=require(_0x56ff('0x6'));var path=require(_0x56ff('0x7'));var sox=require(_0x56ff('0x8'));var csv=require(_0x56ff('0x9'));var ejs=require(_0x56ff('0xa'));var fs=require('fs');var fs_extra=require(_0x56ff('0xb'));var _=require(_0x56ff('0xc'));var squel=require(_0x56ff('0xd'));var crypto=require(_0x56ff('0xe'));var jsforce=require(_0x56ff('0xf'));var deskjs=require(_0x56ff('0x10'));var toCsv=require(_0x56ff('0x9'));var querystring=require(_0x56ff('0x11'));var Papa=require(_0x56ff('0x12'));var Redis=require(_0x56ff('0x13'));var authService=require(_0x56ff('0x14'));var qs=require(_0x56ff('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56ff('0x16'));var logger=require(_0x56ff('0x17'))(_0x56ff('0x18'));var utils=require(_0x56ff('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x56ff('0x1a'));var db=require(_0x56ff('0x1b'))['db'];function respondWithStatusCode(_0x2d9434,_0x4ae3b2){_0x4ae3b2=_0x4ae3b2||0xcc;return function(_0x4805c2){if(_0x4805c2){return _0x2d9434[_0x56ff('0x1c')](_0x4ae3b2);}return _0x2d9434[_0x56ff('0x1d')](_0x4ae3b2)[_0x56ff('0x1e')]();};}function respondWithResult(_0x738f01,_0x5e84ee){_0x5e84ee=_0x5e84ee||0xc8;return function(_0x47eef0){if(_0x47eef0){return _0x738f01['status'](_0x5e84ee)[_0x56ff('0x1f')](_0x47eef0);}};}function respondWithFilteredResult(_0x10250d,_0x423387){return function(_0x4de990){if(_0x4de990){var _0x24c9b4=typeof _0x423387[_0x56ff('0x20')]===_0x56ff('0x21')&&typeof _0x423387[_0x56ff('0x22')]===_0x56ff('0x21');var _0x377c71=_0x4de990[_0x56ff('0x23')];var _0x135271=_0x24c9b4?0x0:_0x423387['offset'];var _0x4445ff=_0x24c9b4?_0x4de990[_0x56ff('0x23')]:_0x423387[_0x56ff('0x20')]+_0x423387['limit'];var _0x2d13b8;if(_0x4445ff>=_0x377c71){_0x4445ff=_0x377c71;_0x2d13b8=0xc8;}else{_0x2d13b8=0xce;}_0x10250d[_0x56ff('0x1d')](_0x2d13b8);return _0x10250d[_0x56ff('0x24')](_0x56ff('0x25'),_0x135271+'-'+_0x4445ff+'/'+_0x377c71)[_0x56ff('0x1f')](_0x4de990);}return null;};}function patchUpdates(_0x52b4fd){return function(_0x2629d7){try{jsonpatch['apply'](_0x2629d7,_0x52b4fd,!![]);}catch(_0x534085){return BPromise[_0x56ff('0x26')](_0x534085);}return _0x2629d7[_0x56ff('0x27')]();};}function saveUpdates(_0x502c34,_0x7c4c99){return function(_0x5a3c04){if(_0x5a3c04){return _0x5a3c04[_0x56ff('0x28')](_0x502c34)['then'](function(_0x52e642){return _0x52e642;});}return null;};}function removeEntity(_0x51e6b6,_0x2bcc12){return function(_0x161d5b){if(_0x161d5b){return _0x161d5b['destroy']()['then'](function(){_0x51e6b6[_0x56ff('0x1d')](0xcc)[_0x56ff('0x1e')]();});}};}function handleEntityNotFound(_0x4de941,_0x563503){return function(_0x39b5af){if(!_0x39b5af){_0x4de941[_0x56ff('0x1c')](0x194);}return _0x39b5af;};}function handleError(_0x10b757,_0x8e4749){_0x8e4749=_0x8e4749||0x1f4;return function(_0x1edbf5){logger['error'](_0x1edbf5[_0x56ff('0x29')]);if(_0x1edbf5[_0x56ff('0x2a')]){delete _0x1edbf5['name'];}_0x10b757[_0x56ff('0x1d')](_0x8e4749)[_0x56ff('0x2b')](_0x1edbf5);};}exports[_0x56ff('0x2c')]=function(_0x495719,_0x24e82c){var _0x446242={},_0x2b3d88={},_0x266250={'count':0x0,'rows':[]};var _0x2a5758=_[_0x56ff('0x2d')](db[_0x56ff('0x2e')]['rawAttributes'],function(_0x8aef64){return{'name':_0x8aef64['fieldName'],'type':_0x8aef64[_0x56ff('0x2f')][_0x56ff('0x30')]};});_0x2b3d88[_0x56ff('0x31')]=_['map'](_0x2a5758,_0x56ff('0x2a'));_0x2b3d88[_0x56ff('0x32')]=_[_0x56ff('0x33')](_0x495719[_0x56ff('0x32')]);_0x2b3d88['filters']=_[_0x56ff('0x34')](_0x2b3d88[_0x56ff('0x31')],_0x2b3d88['query']);_0x446242[_0x56ff('0x35')]=_[_0x56ff('0x34')](_0x2b3d88[_0x56ff('0x31')],qs['fields'](_0x495719[_0x56ff('0x32')][_0x56ff('0x36')]));_0x446242[_0x56ff('0x35')]=_0x446242[_0x56ff('0x35')][_0x56ff('0x37')]?_0x446242[_0x56ff('0x35')]:_0x2b3d88[_0x56ff('0x31')];if(!_0x495719[_0x56ff('0x32')][_0x56ff('0x38')](_0x56ff('0x39'))){_0x446242[_0x56ff('0x22')]=qs[_0x56ff('0x22')](_0x495719[_0x56ff('0x32')][_0x56ff('0x22')]);_0x446242[_0x56ff('0x20')]=qs['offset'](_0x495719[_0x56ff('0x32')]['offset']);}_0x446242['order']=qs[_0x56ff('0x3a')](_0x495719[_0x56ff('0x32')][_0x56ff('0x3a')]);_0x446242[_0x56ff('0x3b')]=qs[_0x56ff('0x3c')](_[_0x56ff('0x3d')](_0x495719[_0x56ff('0x32')],_0x2b3d88[_0x56ff('0x3c')]),_0x2a5758);if(_0x495719['query']['filter']){_0x446242[_0x56ff('0x3b')]=_[_0x56ff('0x3e')](_0x446242[_0x56ff('0x3b')],{'$or':_[_0x56ff('0x2d')](_0x2a5758,function(_0x2dee8a){if(_0x2dee8a['type']!==_0x56ff('0x3f')){var _0x1cb1d1={};_0x1cb1d1[_0x2dee8a['name']]={'$like':'%'+_0x495719[_0x56ff('0x32')][_0x56ff('0x40')]+'%'};return _0x1cb1d1;}})});}_0x446242=_[_0x56ff('0x3e')]({},_0x446242,_0x495719[_0x56ff('0x41')]);var _0x3d3fb5={'where':_0x446242[_0x56ff('0x3b')]};return db[_0x56ff('0x2e')][_0x56ff('0x23')](_0x3d3fb5)[_0x56ff('0x42')](function(_0xd60ca0){_0x266250[_0x56ff('0x23')]=_0xd60ca0;if(_0x495719[_0x56ff('0x32')][_0x56ff('0x43')]){_0x446242[_0x56ff('0x44')]=[{'all':!![]}];}return db[_0x56ff('0x2e')]['findAll'](_0x446242);})[_0x56ff('0x42')](function(_0xd6c096){_0x266250[_0x56ff('0x45')]=_0xd6c096;return _0x266250;})['then'](respondWithFilteredResult(_0x24e82c,_0x446242))[_0x56ff('0x46')](handleError(_0x24e82c,null));};exports[_0x56ff('0x47')]=function(_0x523b33,_0xdf8e3b){var _0x15e41f={'raw':!![],'where':{'id':_0x523b33[_0x56ff('0x48')]['id']}},_0x13099e={};_0x13099e[_0x56ff('0x31')]=_['keys'](db[_0x56ff('0x2e')][_0x56ff('0x49')]);_0x13099e[_0x56ff('0x32')]=_['keys'](_0x523b33[_0x56ff('0x32')]);_0x13099e[_0x56ff('0x3c')]=_['intersection'](_0x13099e['model'],_0x13099e[_0x56ff('0x32')]);_0x15e41f[_0x56ff('0x35')]=_['intersection'](_0x13099e[_0x56ff('0x31')],qs[_0x56ff('0x36')](_0x523b33[_0x56ff('0x32')][_0x56ff('0x36')]));_0x15e41f[_0x56ff('0x35')]=_0x15e41f[_0x56ff('0x35')][_0x56ff('0x37')]?_0x15e41f[_0x56ff('0x35')]:_0x13099e[_0x56ff('0x31')];if(_0x523b33[_0x56ff('0x32')][_0x56ff('0x43')]){_0x15e41f[_0x56ff('0x44')]=[{'all':!![]}];}_0x15e41f=_[_0x56ff('0x3e')]({},_0x15e41f,_0x523b33[_0x56ff('0x41')]);return db[_0x56ff('0x2e')][_0x56ff('0x4a')](_0x15e41f)[_0x56ff('0x42')](handleEntityNotFound(_0xdf8e3b,null))[_0x56ff('0x42')](respondWithResult(_0xdf8e3b,null))[_0x56ff('0x46')](handleError(_0xdf8e3b,null));};exports[_0x56ff('0x4b')]=function(_0x16bc93,_0xfaf006){return db['SquareReport'][_0x56ff('0x4b')](_0x16bc93[_0x56ff('0x4c')],{})[_0x56ff('0x42')](respondWithResult(_0xfaf006,0xc9))['catch'](handleError(_0xfaf006,null));};exports[_0x56ff('0x28')]=function(_0x1a8b4c,_0x2b7f09){if(_0x1a8b4c[_0x56ff('0x4c')]['id']){delete _0x1a8b4c[_0x56ff('0x4c')]['id'];}return db[_0x56ff('0x2e')][_0x56ff('0x4a')]({'where':{'id':_0x1a8b4c[_0x56ff('0x48')]['id']}})[_0x56ff('0x42')](handleEntityNotFound(_0x2b7f09,null))[_0x56ff('0x42')](saveUpdates(_0x1a8b4c[_0x56ff('0x4c')],null))[_0x56ff('0x42')](respondWithResult(_0x2b7f09,null))[_0x56ff('0x46')](handleError(_0x2b7f09,null));};exports[_0x56ff('0x4d')]=function(_0x39e709,_0x31fcec){return db[_0x56ff('0x2e')][_0x56ff('0x4a')]({'where':{'id':_0x39e709[_0x56ff('0x48')]['id']}})[_0x56ff('0x42')](handleEntityNotFound(_0x31fcec,null))['then'](removeEntity(_0x31fcec,null))[_0x56ff('0x46')](handleError(_0x31fcec,null));};exports[_0x56ff('0x4e')]=function(_0x3f8685,_0x3672c2){return db[_0x56ff('0x2e')][_0x56ff('0x4e')]()[_0x56ff('0x42')](respondWithResult(_0x3672c2,null))[_0x56ff('0x46')](handleError(_0x3672c2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b1dad4f..8c27f28 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 _0x7c8b=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','SquareReport','report_square','uid_pname','project_name'];(function(_0x20581e,_0x587acd){var _0x1e82af=function(_0x46ccf8){while(--_0x46ccf8){_0x20581e['push'](_0x20581e['shift']());}};_0x1e82af(++_0x587acd);}(_0x7c8b,0x1e1));var _0xb7c8=function(_0x59bd38,_0x4422a5){_0x59bd38=_0x59bd38-0x0;var _0x3ded44=_0x7c8b[_0x59bd38];return _0x3ded44;};'use strict';var _=require(_0xb7c8('0x0'));var util=require(_0xb7c8('0x1'));var logger=require(_0xb7c8('0x2'))(_0xb7c8('0x3'));var moment=require(_0xb7c8('0x4'));var BPromise=require(_0xb7c8('0x5'));var rp=require(_0xb7c8('0x6'));var fs=require('fs');var path=require(_0xb7c8('0x7'));var rimraf=require('rimraf');var config=require(_0xb7c8('0x8'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x1cd5f5,_0x2612e9){return _0x1cd5f5[_0xb7c8('0x9')](_0xb7c8('0xa'),attributes,{'tableName':_0xb7c8('0xb'),'paranoid':![],'indexes':[{'name':_0xb7c8('0xc'),'fields':['uniqueid',_0xb7c8('0xd')]},{'name':'leaveAt','fields':[_0xb7c8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbca9=['request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','leaveAt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b9989,_0x2cf715){var _0xe45bbe=function(_0x196625){while(--_0x196625){_0x5b9989['push'](_0x5b9989['shift']());}};_0xe45bbe(++_0x2cf715);}(_0xbca9,0x90));var _0x9bca=function(_0x5bf20a,_0x63375d){_0x5bf20a=_0x5bf20a-0x0;var _0x1a0362=_0xbca9[_0x5bf20a];return _0x1a0362;};'use strict';var _=require(_0x9bca('0x0'));var util=require(_0x9bca('0x1'));var logger=require(_0x9bca('0x2'))(_0x9bca('0x3'));var moment=require(_0x9bca('0x4'));var BPromise=require(_0x9bca('0x5'));var rp=require(_0x9bca('0x6'));var fs=require('fs');var path=require(_0x9bca('0x7'));var rimraf=require(_0x9bca('0x8'));var config=require('../../config/environment');var attributes=require(_0x9bca('0x9'));module[_0x9bca('0xa')]=function(_0x3f3171,_0xafae72){return _0x3f3171[_0x9bca('0xb')](_0x9bca('0xc'),attributes,{'tableName':_0x9bca('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0x9bca('0xe'),'fields':[_0x9bca('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 ccfe7d3..7ee1960 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 _0x8169=['options','raw','debug','CreateSquareReport','UpdateSquareReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','SquareReport','create','body'];(function(_0x133838,_0x5f19a7){var _0x3a5239=function(_0x3e177b){while(--_0x3e177b){_0x133838['push'](_0x133838['shift']());}};_0x3a5239(++_0x5f19a7);}(_0x8169,0x1a8));var _0x9816=function(_0x1ff4e5,_0x5520ca){_0x1ff4e5=_0x1ff4e5-0x0;var _0x1e4352=_0x8169[_0x1ff4e5];return _0x1e4352;};'use strict';var _=require(_0x9816('0x0'));var util=require(_0x9816('0x1'));var moment=require(_0x9816('0x2'));var BPromise=require(_0x9816('0x3'));var rs=require(_0x9816('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9816('0x5'));var logger=require(_0x9816('0x6'))(_0x9816('0x7'));var config=require(_0x9816('0x8'));var jayson=require(_0x9816('0x9'));var client=jayson[_0x9816('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3afa98,_0x406998,_0x1e71fa){return new BPromise(function(_0x38c3b8,_0x26f308){return client[_0x9816('0xb')](_0x3afa98,_0x1e71fa)[_0x9816('0xc')](function(_0x290387){logger[_0x9816('0xd')](_0x9816('0xe'),_0x406998,'request\x20sent');logger['debug'](_0x9816('0xf'),_0x406998,_0x9816('0x10'),JSON[_0x9816('0x11')](_0x290387));if(_0x290387[_0x9816('0x12')]){if(_0x290387[_0x9816('0x12')]['code']===0x1f4){logger[_0x9816('0x12')](_0x9816('0xe'),_0x406998,_0x290387['error'][_0x9816('0x13')]);return _0x26f308(_0x290387[_0x9816('0x12')][_0x9816('0x13')]);}logger[_0x9816('0x12')](_0x9816('0xe'),_0x406998,_0x290387[_0x9816('0x12')][_0x9816('0x13')]);return _0x38c3b8(_0x290387[_0x9816('0x12')][_0x9816('0x13')]);}else{logger[_0x9816('0xd')](_0x9816('0xe'),_0x406998,_0x9816('0x10'));_0x38c3b8(_0x290387['result']['message']);}})[_0x9816('0x14')](function(_0x3da27f){logger['error'](_0x9816('0xe'),_0x406998,_0x3da27f);_0x26f308(_0x3da27f);});});}exports['CreateSquareReport']=function(_0x442b78){var _0x415c81=this;return new Promise(function(_0x11fa31,_0x4b6bb9){return db[_0x9816('0x15')][_0x9816('0x16')](_0x442b78[_0x9816('0x17')],{'raw':_0x442b78[_0x9816('0x18')]?_0x442b78['options'][_0x9816('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f42b1){logger[_0x9816('0xd')]('CreateSquareReport',_0x442b78);logger[_0x9816('0x1a')](_0x9816('0x1b'),_0x442b78,JSON[_0x9816('0x11')](_0x4f42b1));_0x11fa31(_0x4f42b1);})[_0x9816('0x14')](function(_0x1bc26f){logger[_0x9816('0x12')](_0x9816('0x1b'),_0x1bc26f[_0x9816('0x13')],_0x442b78);_0x4b6bb9(_0x415c81[_0x9816('0x12')](0x1f4,_0x1bc26f[_0x9816('0x13')]));});});};exports[_0x9816('0x1c')]=function(_0x3bddbb){var _0x453b61=this;return new Promise(function(_0x35d87b,_0x2f0395){return db[_0x9816('0x15')]['update'](_0x3bddbb[_0x9816('0x17')],{'raw':_0x3bddbb[_0x9816('0x18')]?_0x3bddbb['options'][_0x9816('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bddbb[_0x9816('0x18')]?_0x3bddbb[_0x9816('0x18')][_0x9816('0x1d')]||null:null,'attributes':_0x3bddbb['options']?_0x3bddbb[_0x9816('0x18')][_0x9816('0x1e')]||null:null,'limit':_0x3bddbb[_0x9816('0x18')]?_0x3bddbb[_0x9816('0x18')][_0x9816('0x1f')]||null:null})[_0x9816('0xc')](function(_0x69c0db){logger['info'](_0x9816('0x1c'),_0x3bddbb);logger['debug']('UpdateSquareReport',_0x3bddbb,JSON[_0x9816('0x11')](_0x69c0db));_0x35d87b(_0x69c0db);})['catch'](function(_0x2dfaf3){logger['error']('UpdateSquareReport',_0x2dfaf3[_0x9816('0x13')],_0x3bddbb);_0x2f0395(_0x453b61[_0x9816('0x12')](0x1f4,_0x2dfaf3['message']));});});}; \ No newline at end of file +var _0xbbd6=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','SquareReport','create','body','raw','CreateSquareReport','stringify','UpdateSquareReport','options','attributes','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x4269f9,_0x1ba69){var _0x4d8cec=function(_0x31fcd4){while(--_0x31fcd4){_0x4269f9['push'](_0x4269f9['shift']());}};_0x4d8cec(++_0x1ba69);}(_0xbbd6,0x1d5));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bbd('0x0'));var util=require('util');var moment=require(_0x6bbd('0x1'));var BPromise=require(_0x6bbd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bbd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bbd('0x4'));var logger=require(_0x6bbd('0x5'))(_0x6bbd('0x6'));var config=require('../../config/environment');var jayson=require(_0x6bbd('0x7'));var client=jayson['client'][_0x6bbd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d4172,_0x206289,_0x495078){return new BPromise(function(_0x276b88,_0x2e9b40){return client[_0x6bbd('0x9')](_0x4d4172,_0x495078)[_0x6bbd('0xa')](function(_0x1cd88c){logger['info'](_0x6bbd('0xb'),_0x206289,_0x6bbd('0xc'));logger[_0x6bbd('0xd')](_0x6bbd('0xe'),_0x206289,'request\x20sent',JSON['stringify'](_0x1cd88c));if(_0x1cd88c['error']){if(_0x1cd88c[_0x6bbd('0xf')][_0x6bbd('0x10')]===0x1f4){logger[_0x6bbd('0xf')](_0x6bbd('0xb'),_0x206289,_0x1cd88c[_0x6bbd('0xf')][_0x6bbd('0x11')]);return _0x2e9b40(_0x1cd88c[_0x6bbd('0xf')][_0x6bbd('0x11')]);}logger[_0x6bbd('0xf')](_0x6bbd('0xb'),_0x206289,_0x1cd88c[_0x6bbd('0xf')][_0x6bbd('0x11')]);return _0x276b88(_0x1cd88c[_0x6bbd('0xf')][_0x6bbd('0x11')]);}else{logger[_0x6bbd('0x12')](_0x6bbd('0xb'),_0x206289,_0x6bbd('0xc'));_0x276b88(_0x1cd88c['result'][_0x6bbd('0x11')]);}})[_0x6bbd('0x13')](function(_0x412536){logger[_0x6bbd('0xf')](_0x6bbd('0xb'),_0x206289,_0x412536);_0x2e9b40(_0x412536);});});}exports['CreateSquareReport']=function(_0x367c71){var _0x282d35=this;return new Promise(function(_0x391654,_0x300d04){return db[_0x6bbd('0x14')][_0x6bbd('0x15')](_0x367c71[_0x6bbd('0x16')],{'raw':_0x367c71['options']?_0x367c71['options'][_0x6bbd('0x17')]===undefined?!![]:![]:!![]})[_0x6bbd('0xa')](function(_0x5b33c1){logger[_0x6bbd('0x12')](_0x6bbd('0x18'),_0x367c71);logger[_0x6bbd('0xd')](_0x6bbd('0x18'),_0x367c71,JSON[_0x6bbd('0x19')](_0x5b33c1));_0x391654(_0x5b33c1);})[_0x6bbd('0x13')](function(_0x56776b){logger[_0x6bbd('0xf')](_0x6bbd('0x18'),_0x56776b[_0x6bbd('0x11')],_0x367c71);_0x300d04(_0x282d35[_0x6bbd('0xf')](0x1f4,_0x56776b[_0x6bbd('0x11')]));});});};exports[_0x6bbd('0x1a')]=function(_0x3dcf9b){var _0x375fb8=this;return new Promise(function(_0x5c45de,_0x992389){return db[_0x6bbd('0x14')]['update'](_0x3dcf9b[_0x6bbd('0x16')],{'raw':_0x3dcf9b[_0x6bbd('0x1b')]?_0x3dcf9b[_0x6bbd('0x1b')][_0x6bbd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dcf9b[_0x6bbd('0x1b')]?_0x3dcf9b[_0x6bbd('0x1b')]['where']||null:null,'attributes':_0x3dcf9b['options']?_0x3dcf9b[_0x6bbd('0x1b')][_0x6bbd('0x1c')]||null:null,'limit':_0x3dcf9b[_0x6bbd('0x1b')]?_0x3dcf9b[_0x6bbd('0x1b')][_0x6bbd('0x1d')]||null:null})[_0x6bbd('0xa')](function(_0x43fe15){logger[_0x6bbd('0x12')](_0x6bbd('0x1a'),_0x3dcf9b);logger['debug'](_0x6bbd('0x1a'),_0x3dcf9b,JSON[_0x6bbd('0x19')](_0x43fe15));_0x5c45de(_0x43fe15);})['catch'](function(_0x565592){logger[_0x6bbd('0xf')]('UpdateSquareReport',_0x565592['message'],_0x3dcf9b);_0x992389(_0x375fb8[_0x6bbd('0xf')](0x1f4,_0x565592[_0x6bbd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0481447..bdbfaaf 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 _0xc0a9=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x527852,_0x12d535){var _0x219516=function(_0x3c83f4){while(--_0x3c83f4){_0x527852['push'](_0x527852['shift']());}};_0x219516(++_0x12d535);}(_0xc0a9,0x1a4));var _0x9c0a=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0xc0a9[_0x566bdf];return _0x331215;};'use strict';var multer=require(_0x9c0a('0x0'));var util=require(_0x9c0a('0x1'));var path=require(_0x9c0a('0x2'));var timeout=require(_0x9c0a('0x3'));var express=require(_0x9c0a('0x4'));var router=express[_0x9c0a('0x5')]();var fs_extra=require(_0x9c0a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c0a('0x7'));router['get']('/',auth[_0x9c0a('0x8')](),controller[_0x9c0a('0x9')]);router[_0x9c0a('0xa')](_0x9c0a('0xb'),auth[_0x9c0a('0x8')](),controller[_0x9c0a('0xc')]);router[_0x9c0a('0xa')](_0x9c0a('0xd'),auth[_0x9c0a('0x8')](),controller[_0x9c0a('0xe')]);router[_0x9c0a('0xf')]('/',auth[_0x9c0a('0x8')](),controller[_0x9c0a('0x10')]);router[_0x9c0a('0x11')]('/:id',auth[_0x9c0a('0x8')](),controller[_0x9c0a('0x12')]);router[_0x9c0a('0x13')](_0x9c0a('0xd'),auth[_0x9c0a('0x8')](),controller[_0x9c0a('0x14')]);module[_0x9c0a('0x15')]=router; \ No newline at end of file +var _0x4488=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x48ae83,_0x66e6ae){var _0x3fa9b3=function(_0x377939){while(--_0x377939){_0x48ae83['push'](_0x48ae83['shift']());}};_0x3fa9b3(++_0x66e6ae);}(_0x4488,0x8a));var _0x8448=function(_0x1ffaa6,_0x3874c8){_0x1ffaa6=_0x1ffaa6-0x0;var _0x3d3985=_0x4488[_0x1ffaa6];return _0x3d3985;};'use strict';var multer=require(_0x8448('0x0'));var util=require(_0x8448('0x1'));var path=require(_0x8448('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8448('0x3'));var auth=require(_0x8448('0x4'));var interaction=require(_0x8448('0x5'));var config=require(_0x8448('0x6'));var controller=require(_0x8448('0x7'));router[_0x8448('0x8')]('/',auth[_0x8448('0x9')](),controller[_0x8448('0xa')]);router[_0x8448('0x8')](_0x8448('0xb'),auth[_0x8448('0x9')](),controller[_0x8448('0xc')]);router[_0x8448('0x8')](_0x8448('0xd'),auth['isAuthenticated'](),controller[_0x8448('0xe')]);router[_0x8448('0xf')]('/',auth[_0x8448('0x9')](),controller[_0x8448('0x10')]);router[_0x8448('0x11')](_0x8448('0xd'),auth[_0x8448('0x9')](),controller[_0x8448('0x12')]);router[_0x8448('0x13')](_0x8448('0xd'),auth[_0x8448('0x9')](),controller['destroy']);module[_0x8448('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5b58332..3f134b1 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 _0x1cb2=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb2,0xaf));var _0x21cb=function(_0x24273e,_0x32f476){_0x24273e=_0x24273e-0x0;var _0x1f0b3f=_0x1cb2[_0x24273e];return _0x1f0b3f;};'use strict';var Sequelize=require('sequelize');module[_0x21cb('0x0')]={'uniqueid':{'type':Sequelize[_0x21cb('0x1')]},'node':{'type':Sequelize[_0x21cb('0x1')]},'application':{'type':Sequelize[_0x21cb('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x21cb('0x1')]},'callerid':{'type':Sequelize[_0x21cb('0x1')]}}; \ No newline at end of file +var _0x84be=['STRING','TEXT','sequelize','exports'];(function(_0x9d3ffd,_0x271378){var _0x17d217=function(_0x1313ea){while(--_0x1313ea){_0x9d3ffd['push'](_0x9d3ffd['shift']());}};_0x17d217(++_0x271378);}(_0x84be,0x1ee));var _0xe84b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x84be[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xe84b('0x0'));module[_0xe84b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xe84b('0x2')]},'application':{'type':Sequelize[_0xe84b('0x2')]},'data':{'type':Sequelize[_0xe84b('0x3')]},'project_name':{'type':Sequelize[_0xe84b('0x2')]},'callerid':{'type':Sequelize[_0xe84b('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 488805e..b31e9a4 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 _0xdc9d=['where','merge','VIRTUAL','filter','include','rows','catch','fields','includeAll','options','find','create','body','params','describe','rimraf','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','pick'];(function(_0x4ca12c,_0x4e9e2d){var _0x5dffd1=function(_0x52d23b){while(--_0x52d23b){_0x4ca12c['push'](_0x4ca12c['shift']());}};_0x5dffd1(++_0x4e9e2d);}(_0xdc9d,0x1eb));var _0xddc9=function(_0xaddbed,_0x5b1b01){_0xaddbed=_0xaddbed-0x0;var _0x1e3d20=_0xdc9d[_0xaddbed];return _0x1e3d20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xddc9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xddc9('0x2'));var util=require(_0xddc9('0x3'));var path=require('path');var sox=require(_0xddc9('0x4'));var csv=require(_0xddc9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddc9('0x6'));var _=require(_0xddc9('0x7'));var squel=require(_0xddc9('0x8'));var crypto=require(_0xddc9('0x9'));var jsforce=require(_0xddc9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xddc9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddc9('0xc'));var qs=require(_0xddc9('0xd'));var as=require(_0xddc9('0xe'));var hardwareService=require(_0xddc9('0xf'));var logger=require(_0xddc9('0x10'))(_0xddc9('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xddc9('0x12'))['db'];function respondWithStatusCode(_0x2a1e13,_0x5ef040){_0x5ef040=_0x5ef040||0xcc;return function(_0x43c7c5){if(_0x43c7c5){return _0x2a1e13['sendStatus'](_0x5ef040);}return _0x2a1e13[_0xddc9('0x13')](_0x5ef040)[_0xddc9('0x14')]();};}function respondWithResult(_0x4490f2,_0x15ecdd){_0x15ecdd=_0x15ecdd||0xc8;return function(_0x5f017f){if(_0x5f017f){return _0x4490f2['status'](_0x15ecdd)['json'](_0x5f017f);}};}function respondWithFilteredResult(_0x2c9026,_0x5cdec3){return function(_0x2cda7b){if(_0x2cda7b){var _0x50c516=typeof _0x5cdec3[_0xddc9('0x15')]===_0xddc9('0x16')&&typeof _0x5cdec3[_0xddc9('0x17')]===_0xddc9('0x16');var _0x561a21=_0x2cda7b[_0xddc9('0x18')];var _0x24b96e=_0x50c516?0x0:_0x5cdec3[_0xddc9('0x15')];var _0x1608fc=_0x50c516?_0x2cda7b[_0xddc9('0x18')]:_0x5cdec3[_0xddc9('0x15')]+_0x5cdec3[_0xddc9('0x17')];var _0x19955e;if(_0x1608fc>=_0x561a21){_0x1608fc=_0x561a21;_0x19955e=0xc8;}else{_0x19955e=0xce;}_0x2c9026[_0xddc9('0x13')](_0x19955e);return _0x2c9026[_0xddc9('0x19')](_0xddc9('0x1a'),_0x24b96e+'-'+_0x1608fc+'/'+_0x561a21)[_0xddc9('0x1b')](_0x2cda7b);}return null;};}function patchUpdates(_0x266e65){return function(_0x598ad0){try{jsonpatch[_0xddc9('0x1c')](_0x598ad0,_0x266e65,!![]);}catch(_0x3c0990){return BPromise[_0xddc9('0x1d')](_0x3c0990);}return _0x598ad0['save']();};}function saveUpdates(_0x52e829,_0x1c2867){return function(_0x157636){if(_0x157636){return _0x157636[_0xddc9('0x1e')](_0x52e829)[_0xddc9('0x1f')](function(_0x3af686){return _0x3af686;});}return null;};}function removeEntity(_0x561b3b,_0xfa096c){return function(_0x6a9203){if(_0x6a9203){return _0x6a9203['destroy']()[_0xddc9('0x1f')](function(){_0x561b3b['status'](0xcc)[_0xddc9('0x14')]();});}};}function handleEntityNotFound(_0x3d6f49,_0x535cfa){return function(_0x4a646b){if(!_0x4a646b){_0x3d6f49[_0xddc9('0x20')](0x194);}return _0x4a646b;};}function handleError(_0xde6dd,_0xebc3cc){_0xebc3cc=_0xebc3cc||0x1f4;return function(_0x1d0261){logger[_0xddc9('0x21')](_0x1d0261[_0xddc9('0x22')]);if(_0x1d0261[_0xddc9('0x23')]){delete _0x1d0261[_0xddc9('0x23')];}_0xde6dd[_0xddc9('0x13')](_0xebc3cc)[_0xddc9('0x24')](_0x1d0261);};}exports[_0xddc9('0x25')]=function(_0x35e574,_0x2a5396){var _0x1836b2={},_0x2e7198={},_0x4f3b19={'count':0x0,'rows':[]};var _0xd61e0=_[_0xddc9('0x26')](db[_0xddc9('0x27')][_0xddc9('0x28')],function(_0x1d615d){return{'name':_0x1d615d[_0xddc9('0x29')],'type':_0x1d615d[_0xddc9('0x2a')][_0xddc9('0x2b')]};});_0x2e7198[_0xddc9('0x2c')]=_[_0xddc9('0x26')](_0xd61e0,_0xddc9('0x23'));_0x2e7198[_0xddc9('0x2d')]=_[_0xddc9('0x2e')](_0x35e574['query']);_0x2e7198[_0xddc9('0x2f')]=_[_0xddc9('0x30')](_0x2e7198[_0xddc9('0x2c')],_0x2e7198['query']);_0x1836b2[_0xddc9('0x31')]=_[_0xddc9('0x30')](_0x2e7198[_0xddc9('0x2c')],qs['fields'](_0x35e574[_0xddc9('0x2d')]['fields']));_0x1836b2[_0xddc9('0x31')]=_0x1836b2[_0xddc9('0x31')][_0xddc9('0x32')]?_0x1836b2[_0xddc9('0x31')]:_0x2e7198[_0xddc9('0x2c')];if(!_0x35e574[_0xddc9('0x2d')]['hasOwnProperty']('nolimit')){_0x1836b2[_0xddc9('0x17')]=qs[_0xddc9('0x17')](_0x35e574[_0xddc9('0x2d')][_0xddc9('0x17')]);_0x1836b2['offset']=qs[_0xddc9('0x15')](_0x35e574[_0xddc9('0x2d')][_0xddc9('0x15')]);}_0x1836b2['order']=qs[_0xddc9('0x33')](_0x35e574[_0xddc9('0x2d')]['sort']);_0x1836b2['where']=qs[_0xddc9('0x2f')](_[_0xddc9('0x34')](_0x35e574[_0xddc9('0x2d')],_0x2e7198[_0xddc9('0x2f')]),_0xd61e0);if(_0x35e574['query']['filter']){_0x1836b2[_0xddc9('0x35')]=_[_0xddc9('0x36')](_0x1836b2[_0xddc9('0x35')],{'$or':_[_0xddc9('0x26')](_0xd61e0,function(_0x1b74f6){if(_0x1b74f6['type']!==_0xddc9('0x37')){var _0x4b8aa5={};_0x4b8aa5[_0x1b74f6[_0xddc9('0x23')]]={'$like':'%'+_0x35e574[_0xddc9('0x2d')][_0xddc9('0x38')]+'%'};return _0x4b8aa5;}})});}_0x1836b2=_[_0xddc9('0x36')]({},_0x1836b2,_0x35e574['options']);var _0x3505ce={'where':_0x1836b2[_0xddc9('0x35')]};return db[_0xddc9('0x27')]['count'](_0x3505ce)['then'](function(_0xdc3cfc){_0x4f3b19[_0xddc9('0x18')]=_0xdc3cfc;if(_0x35e574[_0xddc9('0x2d')]['includeAll']){_0x1836b2[_0xddc9('0x39')]=[{'all':!![]}];}return db[_0xddc9('0x27')]['findAll'](_0x1836b2);})['then'](function(_0x2440e3){_0x4f3b19[_0xddc9('0x3a')]=_0x2440e3;return _0x4f3b19;})[_0xddc9('0x1f')](respondWithFilteredResult(_0x2a5396,_0x1836b2))[_0xddc9('0x3b')](handleError(_0x2a5396,null));};exports['show']=function(_0x4ce6c1,_0x1637ce){var _0x1bfbea={'raw':!![],'where':{'id':_0x4ce6c1['params']['id']}},_0x3af43d={};_0x3af43d['model']=_[_0xddc9('0x2e')](db[_0xddc9('0x27')]['rawAttributes']);_0x3af43d['query']=_['keys'](_0x4ce6c1[_0xddc9('0x2d')]);_0x3af43d['filters']=_['intersection'](_0x3af43d[_0xddc9('0x2c')],_0x3af43d[_0xddc9('0x2d')]);_0x1bfbea[_0xddc9('0x31')]=_['intersection'](_0x3af43d[_0xddc9('0x2c')],qs['fields'](_0x4ce6c1[_0xddc9('0x2d')][_0xddc9('0x3c')]));_0x1bfbea[_0xddc9('0x31')]=_0x1bfbea[_0xddc9('0x31')]['length']?_0x1bfbea[_0xddc9('0x31')]:_0x3af43d[_0xddc9('0x2c')];if(_0x4ce6c1[_0xddc9('0x2d')][_0xddc9('0x3d')]){_0x1bfbea[_0xddc9('0x39')]=[{'all':!![]}];}_0x1bfbea=_[_0xddc9('0x36')]({},_0x1bfbea,_0x4ce6c1[_0xddc9('0x3e')]);return db[_0xddc9('0x27')][_0xddc9('0x3f')](_0x1bfbea)[_0xddc9('0x1f')](handleEntityNotFound(_0x1637ce,null))[_0xddc9('0x1f')](respondWithResult(_0x1637ce,null))['catch'](handleError(_0x1637ce,null));};exports['create']=function(_0x5fe400,_0x3b78b0){return db[_0xddc9('0x27')][_0xddc9('0x40')](_0x5fe400['body'],{})['then'](respondWithResult(_0x3b78b0,0xc9))[_0xddc9('0x3b')](handleError(_0x3b78b0,null));};exports['update']=function(_0x457077,_0x9d419c){if(_0x457077['body']['id']){delete _0x457077[_0xddc9('0x41')]['id'];}return db['SquareDetailsReport'][_0xddc9('0x3f')]({'where':{'id':_0x457077[_0xddc9('0x42')]['id']}})[_0xddc9('0x1f')](handleEntityNotFound(_0x9d419c,null))[_0xddc9('0x1f')](saveUpdates(_0x457077[_0xddc9('0x41')],null))[_0xddc9('0x1f')](respondWithResult(_0x9d419c,null))[_0xddc9('0x3b')](handleError(_0x9d419c,null));};exports['destroy']=function(_0x2168e9,_0x50e8c6){return db[_0xddc9('0x27')][_0xddc9('0x3f')]({'where':{'id':_0x2168e9[_0xddc9('0x42')]['id']}})['then'](handleEntityNotFound(_0x50e8c6,null))['then'](removeEntity(_0x50e8c6,null))[_0xddc9('0x3b')](handleError(_0x50e8c6,null));};exports[_0xddc9('0x43')]=function(_0x13035f,_0xe3ac8f){return db[_0xddc9('0x27')]['describe']()[_0xddc9('0x1f')](respondWithResult(_0xe3ac8f,null))['catch'](handleError(_0xe3ac8f,null));}; \ No newline at end of file +var _0x3854=['filter','where','VIRTUAL','merge','includeAll','include','show','keys','find','update','body','params','catch','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick'];(function(_0x4217a9,_0x37ac1a){var _0x4480ce=function(_0x20f224){while(--_0x20f224){_0x4217a9['push'](_0x4217a9['shift']());}};_0x4480ce(++_0x37ac1a);}(_0x3854,0x12a));var _0x4385=function(_0x4aafab,_0x4a714c){_0x4aafab=_0x4aafab-0x0;var _0x1e4e00=_0x3854[_0x4aafab];return _0x1e4e00;};'use strict';var emlformat=require(_0x4385('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4385('0x1'));var jsonpatch=require(_0x4385('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4385('0x3'));var Mustache=require(_0x4385('0x4'));var util=require(_0x4385('0x5'));var path=require(_0x4385('0x6'));var sox=require(_0x4385('0x7'));var csv=require(_0x4385('0x8'));var ejs=require(_0x4385('0x9'));var fs=require('fs');var fs_extra=require(_0x4385('0xa'));var _=require(_0x4385('0xb'));var squel=require(_0x4385('0xc'));var crypto=require('crypto');var jsforce=require(_0x4385('0xd'));var deskjs=require(_0x4385('0xe'));var toCsv=require(_0x4385('0x8'));var querystring=require(_0x4385('0xf'));var Papa=require(_0x4385('0x10'));var Redis=require(_0x4385('0x11'));var authService=require(_0x4385('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4385('0x13'));var logger=require(_0x4385('0x14'))('api');var utils=require(_0x4385('0x15'));var config=require(_0x4385('0x16'));var licenseUtil=require(_0x4385('0x17'));var db=require(_0x4385('0x18'))['db'];function respondWithStatusCode(_0x2a880e,_0x49161e){_0x49161e=_0x49161e||0xcc;return function(_0x12fe45){if(_0x12fe45){return _0x2a880e['sendStatus'](_0x49161e);}return _0x2a880e[_0x4385('0x19')](_0x49161e)[_0x4385('0x1a')]();};}function respondWithResult(_0x46936a,_0x23970e){_0x23970e=_0x23970e||0xc8;return function(_0x596037){if(_0x596037){return _0x46936a[_0x4385('0x19')](_0x23970e)[_0x4385('0x1b')](_0x596037);}};}function respondWithFilteredResult(_0x3b80ad,_0x4c01ef){return function(_0x589c99){if(_0x589c99){var _0x379ee1=typeof _0x4c01ef[_0x4385('0x1c')]===_0x4385('0x1d')&&typeof _0x4c01ef[_0x4385('0x1e')]===_0x4385('0x1d');var _0x7357d8=_0x589c99['count'];var _0xd18357=_0x379ee1?0x0:_0x4c01ef[_0x4385('0x1c')];var _0x4dac12=_0x379ee1?_0x589c99[_0x4385('0x1f')]:_0x4c01ef[_0x4385('0x1c')]+_0x4c01ef[_0x4385('0x1e')];var _0x32010e;if(_0x4dac12>=_0x7357d8){_0x4dac12=_0x7357d8;_0x32010e=0xc8;}else{_0x32010e=0xce;}_0x3b80ad['status'](_0x32010e);return _0x3b80ad[_0x4385('0x20')](_0x4385('0x21'),_0xd18357+'-'+_0x4dac12+'/'+_0x7357d8)[_0x4385('0x1b')](_0x589c99);}return null;};}function patchUpdates(_0x26403f){return function(_0xeaf617){try{jsonpatch[_0x4385('0x22')](_0xeaf617,_0x26403f,!![]);}catch(_0xbc4e29){return BPromise['reject'](_0xbc4e29);}return _0xeaf617['save']();};}function saveUpdates(_0x4dcd21,_0x21559d){return function(_0x3e9b1e){if(_0x3e9b1e){return _0x3e9b1e['update'](_0x4dcd21)[_0x4385('0x23')](function(_0xe3d141){return _0xe3d141;});}return null;};}function removeEntity(_0x1d4141,_0x21892f){return function(_0x3cee24){if(_0x3cee24){return _0x3cee24[_0x4385('0x24')]()[_0x4385('0x23')](function(){_0x1d4141[_0x4385('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e87d2,_0x346e92){return function(_0x4a9d93){if(!_0x4a9d93){_0x3e87d2[_0x4385('0x25')](0x194);}return _0x4a9d93;};}function handleError(_0xc3715,_0x3a86b9){_0x3a86b9=_0x3a86b9||0x1f4;return function(_0x34299c){logger['error'](_0x34299c[_0x4385('0x26')]);if(_0x34299c[_0x4385('0x27')]){delete _0x34299c[_0x4385('0x27')];}_0xc3715[_0x4385('0x19')](_0x3a86b9)[_0x4385('0x28')](_0x34299c);};}exports['index']=function(_0x504645,_0x2bbe32){var _0x59b2d6={},_0x139396={},_0x2ee806={'count':0x0,'rows':[]};var _0x21b122=_[_0x4385('0x29')](db[_0x4385('0x2a')][_0x4385('0x2b')],function(_0x1a2677){return{'name':_0x1a2677[_0x4385('0x2c')],'type':_0x1a2677[_0x4385('0x2d')][_0x4385('0x2e')]};});_0x139396[_0x4385('0x2f')]=_[_0x4385('0x29')](_0x21b122,'name');_0x139396['query']=_['keys'](_0x504645[_0x4385('0x30')]);_0x139396[_0x4385('0x31')]=_[_0x4385('0x32')](_0x139396[_0x4385('0x2f')],_0x139396[_0x4385('0x30')]);_0x59b2d6[_0x4385('0x33')]=_[_0x4385('0x32')](_0x139396[_0x4385('0x2f')],qs['fields'](_0x504645[_0x4385('0x30')][_0x4385('0x34')]));_0x59b2d6[_0x4385('0x33')]=_0x59b2d6['attributes'][_0x4385('0x35')]?_0x59b2d6[_0x4385('0x33')]:_0x139396['model'];if(!_0x504645[_0x4385('0x30')][_0x4385('0x36')]('nolimit')){_0x59b2d6[_0x4385('0x1e')]=qs[_0x4385('0x1e')](_0x504645[_0x4385('0x30')][_0x4385('0x1e')]);_0x59b2d6[_0x4385('0x1c')]=qs[_0x4385('0x1c')](_0x504645[_0x4385('0x30')][_0x4385('0x1c')]);}_0x59b2d6['order']=qs[_0x4385('0x37')](_0x504645[_0x4385('0x30')][_0x4385('0x37')]);_0x59b2d6['where']=qs[_0x4385('0x31')](_[_0x4385('0x38')](_0x504645[_0x4385('0x30')],_0x139396['filters']),_0x21b122);if(_0x504645['query'][_0x4385('0x39')]){_0x59b2d6[_0x4385('0x3a')]=_['merge'](_0x59b2d6[_0x4385('0x3a')],{'$or':_[_0x4385('0x29')](_0x21b122,function(_0x10506c){if(_0x10506c['type']!==_0x4385('0x3b')){var _0x560819={};_0x560819[_0x10506c[_0x4385('0x27')]]={'$like':'%'+_0x504645['query'][_0x4385('0x39')]+'%'};return _0x560819;}})});}_0x59b2d6=_[_0x4385('0x3c')]({},_0x59b2d6,_0x504645['options']);var _0x5eb1af={'where':_0x59b2d6['where']};return db[_0x4385('0x2a')][_0x4385('0x1f')](_0x5eb1af)[_0x4385('0x23')](function(_0x172375){_0x2ee806['count']=_0x172375;if(_0x504645[_0x4385('0x30')][_0x4385('0x3d')]){_0x59b2d6[_0x4385('0x3e')]=[{'all':!![]}];}return db[_0x4385('0x2a')]['findAll'](_0x59b2d6);})[_0x4385('0x23')](function(_0x1c0997){_0x2ee806['rows']=_0x1c0997;return _0x2ee806;})['then'](respondWithFilteredResult(_0x2bbe32,_0x59b2d6))['catch'](handleError(_0x2bbe32,null));};exports[_0x4385('0x3f')]=function(_0x2d4ac5,_0x5e8a62){var _0x2afaf8={'raw':!![],'where':{'id':_0x2d4ac5['params']['id']}},_0x39ad0a={};_0x39ad0a[_0x4385('0x2f')]=_[_0x4385('0x40')](db[_0x4385('0x2a')]['rawAttributes']);_0x39ad0a[_0x4385('0x30')]=_['keys'](_0x2d4ac5[_0x4385('0x30')]);_0x39ad0a[_0x4385('0x31')]=_[_0x4385('0x32')](_0x39ad0a[_0x4385('0x2f')],_0x39ad0a[_0x4385('0x30')]);_0x2afaf8[_0x4385('0x33')]=_[_0x4385('0x32')](_0x39ad0a['model'],qs[_0x4385('0x34')](_0x2d4ac5[_0x4385('0x30')][_0x4385('0x34')]));_0x2afaf8['attributes']=_0x2afaf8[_0x4385('0x33')]['length']?_0x2afaf8[_0x4385('0x33')]:_0x39ad0a['model'];if(_0x2d4ac5[_0x4385('0x30')][_0x4385('0x3d')]){_0x2afaf8[_0x4385('0x3e')]=[{'all':!![]}];}_0x2afaf8=_['merge']({},_0x2afaf8,_0x2d4ac5['options']);return db[_0x4385('0x2a')][_0x4385('0x41')](_0x2afaf8)[_0x4385('0x23')](handleEntityNotFound(_0x5e8a62,null))['then'](respondWithResult(_0x5e8a62,null))['catch'](handleError(_0x5e8a62,null));};exports['create']=function(_0x2674c9,_0x324791){return db['SquareDetailsReport']['create'](_0x2674c9['body'],{})[_0x4385('0x23')](respondWithResult(_0x324791,0xc9))['catch'](handleError(_0x324791,null));};exports[_0x4385('0x42')]=function(_0x44324a,_0x30c2b6){if(_0x44324a[_0x4385('0x43')]['id']){delete _0x44324a[_0x4385('0x43')]['id'];}return db[_0x4385('0x2a')]['find']({'where':{'id':_0x44324a[_0x4385('0x44')]['id']}})[_0x4385('0x23')](handleEntityNotFound(_0x30c2b6,null))[_0x4385('0x23')](saveUpdates(_0x44324a[_0x4385('0x43')],null))[_0x4385('0x23')](respondWithResult(_0x30c2b6,null))['catch'](handleError(_0x30c2b6,null));};exports[_0x4385('0x24')]=function(_0x451eaf,_0x11d3c9){return db[_0x4385('0x2a')]['find']({'where':{'id':_0x451eaf[_0x4385('0x44')]['id']}})[_0x4385('0x23')](handleEntityNotFound(_0x11d3c9,null))['then'](removeEntity(_0x11d3c9,null))[_0x4385('0x45')](handleError(_0x11d3c9,null));};exports[_0x4385('0x46')]=function(_0x415f6c,_0x13a934){return db[_0x4385('0x2a')]['describe']()[_0x4385('0x23')](respondWithResult(_0x13a934,null))[_0x4385('0x45')](handleError(_0x13a934,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 775a4ed..419b806 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 _0xbce6=['request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0xbce6,0xc7));var _0x6bce=function(_0x4ab074,_0x1e5c9d){_0x4ab074=_0x4ab074-0x0;var _0xf897c8=_0xbce6[_0x4ab074];return _0xf897c8;};'use strict';var _=require(_0x6bce('0x0'));var util=require(_0x6bce('0x1'));var logger=require(_0x6bce('0x2'))(_0x6bce('0x3'));var moment=require(_0x6bce('0x4'));var BPromise=require('bluebird');var rp=require(_0x6bce('0x5'));var fs=require('fs');var path=require(_0x6bce('0x6'));var rimraf=require(_0x6bce('0x7'));var config=require('../../config/environment');var attributes=require(_0x6bce('0x8'));module[_0x6bce('0x9')]=function(_0x6768a2,_0x154316){return _0x6768a2[_0x6bce('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x6bce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdced=['define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0xdced,0x1bc));var _0xddce=function(_0x168583,_0x562155){_0x168583=_0x168583-0x0;var _0x4b0df2=_0xdced[_0x168583];return _0x4b0df2;};'use strict';var _=require(_0xddce('0x0'));var util=require(_0xddce('0x1'));var logger=require(_0xddce('0x2'))(_0xddce('0x3'));var moment=require(_0xddce('0x4'));var BPromise=require(_0xddce('0x5'));var rp=require(_0xddce('0x6'));var fs=require('fs');var path=require(_0xddce('0x7'));var rimraf=require('rimraf');var config=require(_0xddce('0x8'));var attributes=require(_0xddce('0x9'));module[_0xddce('0xa')]=function(_0x511223,_0x3f1dba){return _0x511223[_0xddce('0xb')](_0xddce('0xc'),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 0e8d904..e5d6078 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 _0xb78e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','lodash','util'];(function(_0x1557f9,_0x4e95be){var _0xdd5b01=function(_0x5d1945){while(--_0x5d1945){_0x1557f9['push'](_0x1557f9['shift']());}};_0xdd5b01(++_0x4e95be);}(_0xb78e,0x1c9));var _0xeb78=function(_0x1cb251,_0x23f6d3){_0x1cb251=_0x1cb251-0x0;var _0x1b836d=_0xb78e[_0x1cb251];return _0x1b836d;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});}exports[_0xeb78('0x17')]=function(_0x92e410){var _0x576802=this;return new Promise(function(_0x45176e,_0xb97756){return db[_0xeb78('0x18')]['create'](_0x92e410[_0xeb78('0x19')],{'raw':_0x92e410[_0xeb78('0x1a')]?_0x92e410['options']['raw']===undefined?!![]:![]:!![]})[_0xeb78('0xc')](function(_0x106c5d){logger[_0xeb78('0xd')](_0xeb78('0x17'),_0x92e410);logger[_0xeb78('0x10')](_0xeb78('0x17'),_0x92e410,JSON[_0xeb78('0x12')](_0x106c5d));_0x45176e(_0x106c5d);})[_0xeb78('0x16')](function(_0x18f08d){logger['error']('CreateSquareDetailsReport',_0x18f08d['message'],_0x92e410);_0xb97756(_0x576802['error'](0x1f4,_0x18f08d[_0xeb78('0x15')]));});});}; \ No newline at end of file +var _0x8caf=['../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x31ddba,_0x40d024){var _0x33ad94=function(_0x4120ac){while(--_0x4120ac){_0x31ddba['push'](_0x31ddba['shift']());}};_0x33ad94(++_0x40d024);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x25446b,_0x5d05aa){_0x25446b=_0x25446b-0x0;var _0x11409e=_0x8caf[_0x25446b];return _0x11409e;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x562eea,_0x773b9f,_0x3abd58){return new BPromise(function(_0x3a91d3,_0x31300c){return client['request'](_0x562eea,_0x3abd58)['then'](function(_0x3a9674){logger['info'](_0xf8ca('0xc'),_0x773b9f,_0xf8ca('0xd'));logger[_0xf8ca('0xe')](_0xf8ca('0xf'),_0x773b9f,'request\x20sent',JSON[_0xf8ca('0x10')](_0x3a9674));if(_0x3a9674[_0xf8ca('0x11')]){if(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x12')]===0x1f4){logger['error'](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')]['message']);return _0x31300c(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);return _0x3a91d3(_0x3a9674[_0xf8ca('0x11')][_0xf8ca('0x13')]);}else{logger[_0xf8ca('0x14')](_0xf8ca('0xc'),_0x773b9f,'request\x20sent');_0x3a91d3(_0x3a9674[_0xf8ca('0x15')][_0xf8ca('0x13')]);}})[_0xf8ca('0x16')](function(_0x12e8f0){logger[_0xf8ca('0x11')](_0xf8ca('0xc'),_0x773b9f,_0x12e8f0);_0x31300c(_0x12e8f0);});});}exports[_0xf8ca('0x17')]=function(_0x127119){var _0x50e805=this;return new Promise(function(_0x237f44,_0x3b5400){return db[_0xf8ca('0x18')][_0xf8ca('0x19')](_0x127119['body'],{'raw':_0x127119[_0xf8ca('0x1a')]?_0x127119[_0xf8ca('0x1a')][_0xf8ca('0x1b')]===undefined?!![]:![]:!![]})[_0xf8ca('0x1c')](function(_0x18e8da){logger[_0xf8ca('0x14')]('CreateSquareDetailsReport',_0x127119);logger[_0xf8ca('0xe')]('CreateSquareDetailsReport',_0x127119,JSON[_0xf8ca('0x10')](_0x18e8da));_0x237f44(_0x18e8da);})[_0xf8ca('0x16')](function(_0x179a48){logger[_0xf8ca('0x11')](_0xf8ca('0x17'),_0x179a48[_0xf8ca('0x13')],_0x127119);_0x3b5400(_0x50e805['error'](0x1f4,_0x179a48['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a732d08..b5822d4 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 _0x05cc=['../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated','exports','express','Router'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x05cc,0x18e));var _0xc05c=function(_0x4fd7d3,_0x20a50c){_0x4fd7d3=_0x4fd7d3-0x0;var _0x2a136d=_0x05cc[_0x4fd7d3];return _0x2a136d;};'use strict';var express=require(_0xc05c('0x0'));var router=express[_0xc05c('0x1')]();var auth=require(_0xc05c('0x2'));var controller=require(_0xc05c('0x3'));router[_0xc05c('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc05c('0x4')](_0xc05c('0x5'),auth[_0xc05c('0x6')](),controller['killProcess']);module[_0xc05c('0x7')]=router; \ No newline at end of file +var _0xf7b7=['killProcess','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x4672bb,_0x20cfd4){var _0x5360cb=function(_0x39e3f1){while(--_0x39e3f1){_0x4672bb['push'](_0x4672bb['shift']());}};_0x5360cb(++_0x20cfd4);}(_0xf7b7,0x103));var _0x7f7b=function(_0x51f97b,_0x3bde09){_0x51f97b=_0x51f97b-0x0;var _0x56d153=_0xf7b7[_0x51f97b];return _0x56d153;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x7f7b('0x0'));var controller=require(_0x7f7b('0x1'));router[_0x7f7b('0x2')]('/',auth[_0x7f7b('0x3')](),controller['index']);router[_0x7f7b('0x2')](_0x7f7b('0x4'),auth[_0x7f7b('0x3')](),controller[_0x7f7b('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6630963..4959cc2 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 _0xb8c4=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','getAllData','json','status','killProcess','components/import/cm','format'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0xb8c4,0x13f));var _0x4b8c=function(_0x9686e3,_0x205f24){_0x9686e3=_0x9686e3-0x0;var _0x4d6220=_0xb8c4[_0x9686e3];return _0x4d6220;};'use strict';var info=require(_0x4b8c('0x0'));var exec=require(_0x4b8c('0x1'))[_0x4b8c('0x2')];var logger=require(_0x4b8c('0x3'))(_0x4b8c('0x4'));var util=require('util');var BPromise=require(_0x4b8c('0x5'));var _=require('lodash');function handleError(_0x3861bc,_0x5b1a45,_0x4ff454){_0x5b1a45=_0x5b1a45||0x1f4;return function(_0x373df4){logger[_0x4b8c('0x6')](_0x4b8c('0x7'),_0x4ff454,_0x5b1a45,util[_0x4b8c('0x8')](_0x373df4,{'showHidden':![],'depth':null}));delete _0x373df4['name'];_0x3861bc['status'](_0x5b1a45)[_0x4b8c('0x9')](_0x373df4);};}exports[_0x4b8c('0xa')]=function(_0x5aa0c0,_0x33c97c){return info[_0x4b8c('0xb')]()['then'](function(_0x598e1f){return _0x33c97c['status'](0xc8)[_0x4b8c('0xc')](_0x598e1f);})['catch'](function(_0x1f403a){return _0x33c97c[_0x4b8c('0xd')](0x1f4)['json'](_0x1f403a);});};exports[_0x4b8c('0xe')]=function(_0x511980,_0xe6bcec){var _0x3321ce=[_0x4b8c('0xf')];return new BPromise(function(_0x219e4a,_0x43975a){return exec(util[_0x4b8c('0x10')](_0x4b8c('0x11'),_0x511980[_0x4b8c('0x12')][_0x4b8c('0x13')]),function(_0x1d9f45,_0x38b268,_0x3752d5){if(_0x1d9f45){return _0x43975a(_0x1d9f45);}return _0x219e4a(_0x38b268);});})[_0x4b8c('0x14')](function(_0x250bb8){var _0x59f9a8=![];var _0x110e8e=_0x250bb8[_0x4b8c('0x15')](/\n/);for(var _0x151755=0x0,_0x13f5fc=_0x3321ce['length'];_0x151755<_0x13f5fc,_0x59f9a8===![];_0x151755+=0x1){if(_0x250bb8[_0x4b8c('0x16')](_0x3321ce[_0x151755])>=0x0){_0x59f9a8=!![];}}if(!_0x59f9a8){throw new Error(util[_0x4b8c('0x10')](_0x4b8c('0x17'),_0x511980[_0x4b8c('0x12')]['pid']));}process[_0x4b8c('0x18')](_0x511980[_0x4b8c('0x12')][_0x4b8c('0x13')],_0x4b8c('0x19'));return _0xe6bcec['status'](0xc8)[_0x4b8c('0xc')]({'message':util[_0x4b8c('0x10')](_0x4b8c('0x1a'),_0x511980[_0x4b8c('0x12')][_0x4b8c('0x13')])});})[_0x4b8c('0x1b')](handleError(_0xe6bcec,null,_0x4b8c('0xe')));}; \ No newline at end of file +var _0x59e1=['exec','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x59e1,0x81));var _0x159e=function(_0xec363e,_0x171f9b){_0xec363e=_0xec363e-0x0;var _0x47641b=_0x59e1[_0xec363e];return _0x47641b;};'use strict';var info=require('systeminformation');var exec=require(_0x159e('0x0'))[_0x159e('0x1')];var logger=require('../../config/logger')(_0x159e('0x2'));var util=require(_0x159e('0x3'));var BPromise=require('bluebird');var _=require(_0x159e('0x4'));function handleError(_0x22e21b,_0x4486b8,_0x435c66){_0x4486b8=_0x4486b8||0x1f4;return function(_0x363ca0){logger['error'](_0x159e('0x5'),_0x435c66,_0x4486b8,util[_0x159e('0x6')](_0x363ca0,{'showHidden':![],'depth':null}));delete _0x363ca0[_0x159e('0x7')];_0x22e21b[_0x159e('0x8')](_0x4486b8)[_0x159e('0x9')](_0x363ca0);};}exports[_0x159e('0xa')]=function(_0x525363,_0x73bb6c){return info[_0x159e('0xb')]()[_0x159e('0xc')](function(_0x585c63){return _0x73bb6c['status'](0xc8)[_0x159e('0xd')](_0x585c63);})[_0x159e('0xe')](function(_0x28cce5){return _0x73bb6c['status'](0x1f4)[_0x159e('0xd')](_0x28cce5);});};exports['killProcess']=function(_0x1bc4df,_0x51e9f6){var _0x47a825=['components/import/cm'];return new BPromise(function(_0x5b75b3,_0x1048e3){return exec(util[_0x159e('0xf')](_0x159e('0x10'),_0x1bc4df[_0x159e('0x11')][_0x159e('0x12')]),function(_0x18616c,_0xb2efb2,_0x21d7fa){if(_0x18616c){return _0x1048e3(_0x18616c);}return _0x5b75b3(_0xb2efb2);});})[_0x159e('0xc')](function(_0x3b1e13){var _0x1f55f2=![];var _0x14d3b7=_0x3b1e13['split'](/\n/);for(var _0x37ec03=0x0,_0x385eef=_0x47a825[_0x159e('0x13')];_0x37ec03<_0x385eef,_0x1f55f2===![];_0x37ec03+=0x1){if(_0x3b1e13[_0x159e('0x14')](_0x47a825[_0x37ec03])>=0x0){_0x1f55f2=!![];}}if(!_0x1f55f2){throw new Error(util[_0x159e('0xf')](_0x159e('0x15'),_0x1bc4df[_0x159e('0x11')][_0x159e('0x12')]));}process[_0x159e('0x16')](_0x1bc4df[_0x159e('0x11')][_0x159e('0x12')],_0x159e('0x17'));return _0x51e9f6[_0x159e('0x8')](0xc8)[_0x159e('0xd')]({'message':util[_0x159e('0xf')](_0x159e('0x18'),_0x1bc4df['params'][_0x159e('0x12')])});})['catch'](handleError(_0x51e9f6,null,_0x159e('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 85fcd9a..fc6b927 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 _0x0f42=['isAuthenticated','create','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./tag.controller','get','index'];(function(_0x234051,_0xcc582f){var _0x24e238=function(_0x2cb3f1){while(--_0x2cb3f1){_0x234051['push'](_0x234051['shift']());}};_0x24e238(++_0xcc582f);}(_0x0f42,0x126));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var path=require(_0x20f4('0x2'));var timeout=require(_0x20f4('0x3'));var express=require('express');var router=express[_0x20f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x20f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20f4('0x6'));var controller=require(_0x20f4('0x7'));router[_0x20f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x20f4('0x9')]);router[_0x20f4('0x8')]('/:id',auth[_0x20f4('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x20f4('0xb')]);router['put'](_0x20f4('0xc'),auth[_0x20f4('0xa')](),controller[_0x20f4('0xd')]);router[_0x20f4('0xe')]('/:id',auth[_0x20f4('0xa')](),controller['destroy']);module[_0x20f4('0xf')]=router; \ No newline at end of file +var _0x0fda=['post','create','update','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','index','/:id','isAuthenticated'];(function(_0xfcac95,_0x4489bc){var _0x551734=function(_0xf94561){while(--_0xf94561){_0xfcac95['push'](_0xfcac95['shift']());}};_0x551734(++_0x4489bc);}(_0x0fda,0x96));var _0xa0fd=function(_0x2a80f7,_0x226f6a){_0x2a80f7=_0x2a80f7-0x0;var _0x359c51=_0x0fda[_0x2a80f7];return _0x359c51;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa0fd('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0fd('0x1')]();var fs_extra=require(_0xa0fd('0x2'));var auth=require(_0xa0fd('0x3'));var interaction=require(_0xa0fd('0x4'));var config=require('../../config/environment');var controller=require(_0xa0fd('0x5'));router[_0xa0fd('0x6')]('/',auth['isAuthenticated'](),controller[_0xa0fd('0x7')]);router[_0xa0fd('0x6')](_0xa0fd('0x8'),auth[_0xa0fd('0x9')](),controller['show']);router[_0xa0fd('0xa')]('/',auth[_0xa0fd('0x9')](),controller[_0xa0fd('0xb')]);router['put'](_0xa0fd('0x8'),auth[_0xa0fd('0x9')](),controller[_0xa0fd('0xc')]);router[_0xa0fd('0xd')]('/:id',auth[_0xa0fd('0x9')](),controller[_0xa0fd('0xe')]);module[_0xa0fd('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2f8cb11..52e7e99 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 _0xf45e=['#0091EA','sequelize','STRING'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0xf45e,0x115));var _0xef45=function(_0x383bde,_0x3296e4){_0x383bde=_0x383bde-0x0;var _0x131a49=_0xf45e[_0x383bde];return _0x131a49;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'name':{'type':Sequelize[_0xef45('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xef45('0x1')],'defaultValue':_0xef45('0x2')},'description':{'type':Sequelize[_0xef45('0x1')]}}; \ No newline at end of file +var _0x1399=['exports','name','#0091EA','STRING','sequelize'];(function(_0x253608,_0x573f0d){var _0x247b61=function(_0x41aff2){while(--_0x41aff2){_0x253608['push'](_0x253608['shift']());}};_0x247b61(++_0x573f0d);}(_0x1399,0x16c));var _0x9139=function(_0xa26e2c,_0x1ffb98){_0xa26e2c=_0xa26e2c-0x0;var _0x524b0e=_0x1399[_0xa26e2c];return _0x524b0e;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9139('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x9139('0x3')},'description':{'type':Sequelize[_0x9139('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d52b966..6f7ba0e 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 _0xf403=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','index','Tag','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0xbb20d1,_0x1a4a77){var _0x21be88=function(_0xfab837){while(--_0xfab837){_0xbb20d1['push'](_0xbb20d1['shift']());}};_0x21be88(++_0x1a4a77);}(_0xf403,0x1d3));var _0x3f40=function(_0x24412a,_0x5cf3d5){_0x24412a=_0x24412a-0x0;var _0x14fdae=_0xf403[_0x24412a];return _0x14fdae;};'use strict';var emlformat=require(_0x3f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f40('0x1'));var jsonpatch=require(_0x3f40('0x2'));var rp=require(_0x3f40('0x3'));var moment=require(_0x3f40('0x4'));var BPromise=require(_0x3f40('0x5'));var Mustache=require(_0x3f40('0x6'));var util=require(_0x3f40('0x7'));var path=require(_0x3f40('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f40('0x9'));var fs=require('fs');var fs_extra=require(_0x3f40('0xa'));var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var licenseUtil=require(_0x3f40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332635,_0x509c02){_0x509c02=_0x509c02||0xcc;return function(_0x116460){if(_0x116460){return _0x332635[_0x3f40('0x17')](_0x509c02);}return _0x332635[_0x3f40('0x18')](_0x509c02)[_0x3f40('0x19')]();};}function respondWithResult(_0x569c6e,_0x2b2bfe){_0x2b2bfe=_0x2b2bfe||0xc8;return function(_0x308e97){if(_0x308e97){return _0x569c6e[_0x3f40('0x18')](_0x2b2bfe)[_0x3f40('0x1a')](_0x308e97);}};}function respondWithFilteredResult(_0x232241,_0x4e28b9){return function(_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=typeof _0x4e28b9['offset']==='undefined'&&typeof _0x4e28b9['limit']===_0x3f40('0x1b');var _0x13b950=_0x2e51ed[_0x3f40('0x1c')];var _0x131e55=_0x3d11c9?0x0:_0x4e28b9[_0x3f40('0x1d')];var _0x5b4ebc=_0x3d11c9?_0x2e51ed[_0x3f40('0x1c')]:_0x4e28b9[_0x3f40('0x1d')]+_0x4e28b9[_0x3f40('0x1e')];var _0x29405a;if(_0x5b4ebc>=_0x13b950){_0x5b4ebc=_0x13b950;_0x29405a=0xc8;}else{_0x29405a=0xce;}_0x232241[_0x3f40('0x18')](_0x29405a);return _0x232241['set'](_0x3f40('0x1f'),_0x131e55+'-'+_0x5b4ebc+'/'+_0x13b950)['json'](_0x2e51ed);}return null;};}function patchUpdates(_0x12aabf){return function(_0x32b945){try{jsonpatch[_0x3f40('0x20')](_0x32b945,_0x12aabf,!![]);}catch(_0x113293){return BPromise[_0x3f40('0x21')](_0x113293);}return _0x32b945['save']();};}function saveUpdates(_0x27f5a5,_0x379b4e){return function(_0x117823){if(_0x117823){return _0x117823[_0x3f40('0x22')](_0x27f5a5)[_0x3f40('0x23')](function(_0xa1f39d){return _0xa1f39d;});}return null;};}function removeEntity(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(_0x59eb32){return _0x59eb32[_0x3f40('0x24')]()['then'](function(){var _0x2bc437=_0x59eb32['get']({'plain':!![]});var _0x37b47e='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x37b47e,'resourceId':_0x2bc437['id']}})[_0x3f40('0x23')](function(){return _0x59eb32;});})[_0x3f40('0x23')](function(){_0x4e1f47[_0x3f40('0x18')](0xcc)[_0x3f40('0x19')]();});}};}function handleEntityNotFound(_0x5b1079,_0x300665){return function(_0x47ec1c){if(!_0x47ec1c){_0x5b1079[_0x3f40('0x17')](0x194);}return _0x47ec1c;};}function handleError(_0xbaf5d4,_0xbd4333){_0xbd4333=_0xbd4333||0x1f4;return function(_0x5e0f25){logger[_0x3f40('0x25')](_0x5e0f25['stack']);if(_0x5e0f25[_0x3f40('0x26')]){delete _0x5e0f25['name'];}_0xbaf5d4['status'](_0xbd4333)[_0x3f40('0x27')](_0x5e0f25);};}exports[_0x3f40('0x28')]=function(_0x14fdfd,_0xb23186){var _0x357396={},_0x1056d0={},_0x40cd76={'count':0x0,'rows':[]};var _0xe70e64=_['map'](db[_0x3f40('0x29')][_0x3f40('0x2a')],function(_0x18dbb3){return{'name':_0x18dbb3[_0x3f40('0x2b')],'type':_0x18dbb3[_0x3f40('0x2c')]['key']};});_0x1056d0[_0x3f40('0x2d')]=_[_0x3f40('0x2e')](_0xe70e64,_0x3f40('0x26'));_0x1056d0['query']=_[_0x3f40('0x2f')](_0x14fdfd[_0x3f40('0x30')]);_0x1056d0[_0x3f40('0x31')]=_[_0x3f40('0x32')](_0x1056d0[_0x3f40('0x2d')],_0x1056d0[_0x3f40('0x30')]);_0x357396[_0x3f40('0x33')]=_[_0x3f40('0x32')](_0x1056d0[_0x3f40('0x2d')],qs[_0x3f40('0x34')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x34')]));_0x357396[_0x3f40('0x33')]=_0x357396[_0x3f40('0x33')][_0x3f40('0x35')]?_0x357396[_0x3f40('0x33')]:_0x1056d0[_0x3f40('0x2d')];if(!_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x36')](_0x3f40('0x37'))){_0x357396[_0x3f40('0x1e')]=qs[_0x3f40('0x1e')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x1e')]);_0x357396[_0x3f40('0x1d')]=qs[_0x3f40('0x1d')](_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x1d')]);}_0x357396[_0x3f40('0x38')]=qs[_0x3f40('0x39')](_0x14fdfd['query']['sort']);_0x357396[_0x3f40('0x3a')]=qs[_0x3f40('0x31')](_[_0x3f40('0x3b')](_0x14fdfd[_0x3f40('0x30')],_0x1056d0[_0x3f40('0x31')]),_0xe70e64);if(_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x3c')]){_0x357396['where']=_[_0x3f40('0x3d')](_0x357396['where'],{'$or':_[_0x3f40('0x2e')](_0xe70e64,function(_0x3bec11){if(_0x3bec11[_0x3f40('0x2c')]!=='VIRTUAL'){var _0x37a83d={};_0x37a83d[_0x3bec11[_0x3f40('0x26')]]={'$like':'%'+_0x14fdfd['query'][_0x3f40('0x3c')]+'%'};return _0x37a83d;}})});}_0x357396=_[_0x3f40('0x3d')]({},_0x357396,_0x14fdfd['options']);var _0x192839={'where':_0x357396['where']};return db[_0x3f40('0x29')]['count'](_0x192839)['then'](function(_0x8e89a){_0x40cd76['count']=_0x8e89a;if(_0x14fdfd[_0x3f40('0x30')][_0x3f40('0x3e')]){_0x357396[_0x3f40('0x3f')]=[{'all':!![]}];}return db[_0x3f40('0x29')]['findAll'](_0x357396);})[_0x3f40('0x23')](function(_0x5b0eaa){_0x40cd76[_0x3f40('0x40')]=_0x5b0eaa;return _0x40cd76;})[_0x3f40('0x23')](respondWithFilteredResult(_0xb23186,_0x357396))[_0x3f40('0x41')](handleError(_0xb23186,null));};exports['show']=function(_0x4a198d,_0x21ba95){var _0xfddbd9={'raw':!![],'where':{'id':_0x4a198d[_0x3f40('0x42')]['id']}},_0x41bd93={};_0x41bd93[_0x3f40('0x2d')]=_[_0x3f40('0x2f')](db[_0x3f40('0x29')][_0x3f40('0x2a')]);_0x41bd93['query']=_[_0x3f40('0x2f')](_0x4a198d['query']);_0x41bd93['filters']=_[_0x3f40('0x32')](_0x41bd93[_0x3f40('0x2d')],_0x41bd93[_0x3f40('0x30')]);_0xfddbd9[_0x3f40('0x33')]=_[_0x3f40('0x32')](_0x41bd93[_0x3f40('0x2d')],qs[_0x3f40('0x34')](_0x4a198d[_0x3f40('0x30')][_0x3f40('0x34')]));_0xfddbd9[_0x3f40('0x33')]=_0xfddbd9[_0x3f40('0x33')][_0x3f40('0x35')]?_0xfddbd9[_0x3f40('0x33')]:_0x41bd93[_0x3f40('0x2d')];if(_0x4a198d['query'][_0x3f40('0x3e')]){_0xfddbd9['include']=[{'all':!![]}];}_0xfddbd9=_[_0x3f40('0x3d')]({},_0xfddbd9,_0x4a198d[_0x3f40('0x43')]);return db['Tag'][_0x3f40('0x44')](_0xfddbd9)[_0x3f40('0x23')](handleEntityNotFound(_0x21ba95,null))[_0x3f40('0x23')](respondWithResult(_0x21ba95,null))[_0x3f40('0x41')](handleError(_0x21ba95,null));};exports[_0x3f40('0x45')]=function(_0x268ae4,_0x851bfc){return db[_0x3f40('0x29')][_0x3f40('0x45')](_0x268ae4[_0x3f40('0x46')],{})[_0x3f40('0x23')](function(_0x364773){var _0x1cfe4f=_0x268ae4[_0x3f40('0x47')][_0x3f40('0x48')]({'plain':!![]});if(!_0x1cfe4f)throw new Error(_0x3f40('0x49'));if(_0x1cfe4f[_0x3f40('0x4a')]===_0x3f40('0x47')){var _0x32bd05=_0x364773[_0x3f40('0x48')]({'plain':!![]});var _0xca7210='Tags';return db[_0x3f40('0x4b')][_0x3f40('0x44')]({'where':{'name':_0xca7210,'userProfileId':_0x1cfe4f[_0x3f40('0x4c')]},'raw':!![]})[_0x3f40('0x23')](function(_0x3bfb89){if(_0x3bfb89&&_0x3bfb89['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32bd05[_0x3f40('0x26')],'resourceId':_0x32bd05['id'],'type':_0x3bfb89[_0x3f40('0x26')],'sectionId':_0x3bfb89['id']},{})['then'](function(){return _0x364773;});}else{return _0x364773;}})[_0x3f40('0x41')](function(_0x1e0af6){logger['error'](_0x3f40('0x4d'),_0x1e0af6);throw _0x1e0af6;});}return _0x364773;})['then'](respondWithResult(_0x851bfc,0xc9))[_0x3f40('0x41')](handleError(_0x851bfc,null));};exports[_0x3f40('0x22')]=function(_0x24ae66,_0x3a39c6){if(_0x24ae66[_0x3f40('0x46')]['id']){delete _0x24ae66[_0x3f40('0x46')]['id'];}return db[_0x3f40('0x29')][_0x3f40('0x44')]({'where':{'id':_0x24ae66[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x3a39c6,null))[_0x3f40('0x23')](saveUpdates(_0x24ae66[_0x3f40('0x46')],null))[_0x3f40('0x23')](respondWithResult(_0x3a39c6,null))['catch'](handleError(_0x3a39c6,null));};exports[_0x3f40('0x24')]=function(_0x22beb7,_0x1c94a1){return db[_0x3f40('0x29')][_0x3f40('0x44')]({'where':{'id':_0x22beb7['params']['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x1c94a1,null))[_0x3f40('0x23')](removeEntity(_0x1c94a1,null))[_0x3f40('0x41')](handleError(_0x1c94a1,null));}; \ No newline at end of file +var _0x222f=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x1965f8,_0x4f8f54){var _0x42ca21=function(_0x582863){while(--_0x582863){_0x1965f8['push'](_0x1965f8['shift']());}};_0x42ca21(++_0x4f8f54);}(_0x222f,0x1a4));var _0xf222=function(_0x102b9f,_0x661060){_0x102b9f=_0x102b9f-0x0;var _0x42c57d=_0x222f[_0x102b9f];return _0x42c57d;};'use strict';var emlformat=require(_0xf222('0x0'));var rimraf=require(_0xf222('0x1'));var zipdir=require(_0xf222('0x2'));var jsonpatch=require(_0xf222('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf222('0x4'));var Mustache=require(_0xf222('0x5'));var util=require(_0xf222('0x6'));var path=require(_0xf222('0x7'));var sox=require('sox');var csv=require(_0xf222('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf222('0x9'));var _=require(_0xf222('0xa'));var squel=require('squel');var crypto=require(_0xf222('0xb'));var jsforce=require(_0xf222('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf222('0x8'));var querystring=require(_0xf222('0xd'));var Papa=require(_0xf222('0xe'));var Redis=require(_0xf222('0xf'));var authService=require(_0xf222('0x10'));var qs=require(_0xf222('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf222('0x12'));var logger=require(_0xf222('0x13'))(_0xf222('0x14'));var utils=require(_0xf222('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf222('0x16'));var db=require(_0xf222('0x17'))['db'];function respondWithStatusCode(_0x2a6965,_0x3d3d29){_0x3d3d29=_0x3d3d29||0xcc;return function(_0x12f968){if(_0x12f968){return _0x2a6965[_0xf222('0x18')](_0x3d3d29);}return _0x2a6965[_0xf222('0x19')](_0x3d3d29)[_0xf222('0x1a')]();};}function respondWithResult(_0x52a003,_0x5b8f97){_0x5b8f97=_0x5b8f97||0xc8;return function(_0x1feb86){if(_0x1feb86){return _0x52a003[_0xf222('0x19')](_0x5b8f97)['json'](_0x1feb86);}};}function respondWithFilteredResult(_0x39be58,_0x43d35b){return function(_0x464f3e){if(_0x464f3e){var _0x4392a0=typeof _0x43d35b[_0xf222('0x1b')]===_0xf222('0x1c')&&typeof _0x43d35b[_0xf222('0x1d')]==='undefined';var _0x1efa9f=_0x464f3e[_0xf222('0x1e')];var _0x8783ab=_0x4392a0?0x0:_0x43d35b[_0xf222('0x1b')];var _0x12a2e4=_0x4392a0?_0x464f3e[_0xf222('0x1e')]:_0x43d35b[_0xf222('0x1b')]+_0x43d35b['limit'];var _0xf26a16;if(_0x12a2e4>=_0x1efa9f){_0x12a2e4=_0x1efa9f;_0xf26a16=0xc8;}else{_0xf26a16=0xce;}_0x39be58[_0xf222('0x19')](_0xf26a16);return _0x39be58[_0xf222('0x1f')](_0xf222('0x20'),_0x8783ab+'-'+_0x12a2e4+'/'+_0x1efa9f)['json'](_0x464f3e);}return null;};}function patchUpdates(_0x5cd899){return function(_0x398ff4){try{jsonpatch[_0xf222('0x21')](_0x398ff4,_0x5cd899,!![]);}catch(_0x201cf0){return BPromise[_0xf222('0x22')](_0x201cf0);}return _0x398ff4[_0xf222('0x23')]();};}function saveUpdates(_0x151a89,_0x51b872){return function(_0x176b20){if(_0x176b20){return _0x176b20[_0xf222('0x24')](_0x151a89)[_0xf222('0x25')](function(_0x12d443){return _0x12d443;});}return null;};}function removeEntity(_0x2c48ce,_0x2d18ab){return function(_0x4616de){if(_0x4616de){return _0x4616de[_0xf222('0x26')]()['then'](function(){var _0x145e2e=_0x4616de[_0xf222('0x27')]({'plain':!![]});var _0x1883c1=_0xf222('0x28');return db[_0xf222('0x29')][_0xf222('0x26')]({'where':{'type':_0x1883c1,'resourceId':_0x145e2e['id']}})[_0xf222('0x25')](function(){return _0x4616de;});})[_0xf222('0x25')](function(){_0x2c48ce[_0xf222('0x19')](0xcc)[_0xf222('0x1a')]();});}};}function handleEntityNotFound(_0x2a8310,_0x501f8e){return function(_0x14b2b1){if(!_0x14b2b1){_0x2a8310[_0xf222('0x18')](0x194);}return _0x14b2b1;};}function handleError(_0x3d5508,_0x2f04bf){_0x2f04bf=_0x2f04bf||0x1f4;return function(_0xe41039){logger[_0xf222('0x2a')](_0xe41039[_0xf222('0x2b')]);if(_0xe41039[_0xf222('0x2c')]){delete _0xe41039[_0xf222('0x2c')];}_0x3d5508['status'](_0x2f04bf)[_0xf222('0x2d')](_0xe41039);};}exports[_0xf222('0x2e')]=function(_0x3ffc30,_0x53a382){var _0x3ccc9e={},_0x5d5963={},_0x40c7e7={'count':0x0,'rows':[]};var _0x27a8cc=_[_0xf222('0x2f')](db[_0xf222('0x30')][_0xf222('0x31')],function(_0x152d79){return{'name':_0x152d79[_0xf222('0x32')],'type':_0x152d79['type']['key']};});_0x5d5963[_0xf222('0x33')]=_[_0xf222('0x2f')](_0x27a8cc,_0xf222('0x2c'));_0x5d5963[_0xf222('0x34')]=_[_0xf222('0x35')](_0x3ffc30[_0xf222('0x34')]);_0x5d5963['filters']=_[_0xf222('0x36')](_0x5d5963[_0xf222('0x33')],_0x5d5963[_0xf222('0x34')]);_0x3ccc9e['attributes']=_[_0xf222('0x36')](_0x5d5963[_0xf222('0x33')],qs[_0xf222('0x37')](_0x3ffc30['query'][_0xf222('0x37')]));_0x3ccc9e[_0xf222('0x38')]=_0x3ccc9e[_0xf222('0x38')]['length']?_0x3ccc9e[_0xf222('0x38')]:_0x5d5963[_0xf222('0x33')];if(!_0x3ffc30[_0xf222('0x34')][_0xf222('0x39')](_0xf222('0x3a'))){_0x3ccc9e['limit']=qs[_0xf222('0x1d')](_0x3ffc30['query'][_0xf222('0x1d')]);_0x3ccc9e[_0xf222('0x1b')]=qs[_0xf222('0x1b')](_0x3ffc30['query'][_0xf222('0x1b')]);}_0x3ccc9e[_0xf222('0x3b')]=qs['sort'](_0x3ffc30[_0xf222('0x34')]['sort']);_0x3ccc9e[_0xf222('0x3c')]=qs[_0xf222('0x3d')](_[_0xf222('0x3e')](_0x3ffc30['query'],_0x5d5963[_0xf222('0x3d')]),_0x27a8cc);if(_0x3ffc30[_0xf222('0x34')][_0xf222('0x3f')]){_0x3ccc9e[_0xf222('0x3c')]=_[_0xf222('0x40')](_0x3ccc9e[_0xf222('0x3c')],{'$or':_['map'](_0x27a8cc,function(_0x1ae1d4){if(_0x1ae1d4[_0xf222('0x41')]!=='VIRTUAL'){var _0x49cad2={};_0x49cad2[_0x1ae1d4[_0xf222('0x2c')]]={'$like':'%'+_0x3ffc30['query'][_0xf222('0x3f')]+'%'};return _0x49cad2;}})});}_0x3ccc9e=_[_0xf222('0x40')]({},_0x3ccc9e,_0x3ffc30[_0xf222('0x42')]);var _0xc16fcb={'where':_0x3ccc9e['where']};return db['Tag'][_0xf222('0x1e')](_0xc16fcb)['then'](function(_0x522a9e){_0x40c7e7[_0xf222('0x1e')]=_0x522a9e;if(_0x3ffc30[_0xf222('0x34')][_0xf222('0x43')]){_0x3ccc9e[_0xf222('0x44')]=[{'all':!![]}];}return db[_0xf222('0x30')][_0xf222('0x45')](_0x3ccc9e);})['then'](function(_0xf829ae){_0x40c7e7[_0xf222('0x46')]=_0xf829ae;return _0x40c7e7;})['then'](respondWithFilteredResult(_0x53a382,_0x3ccc9e))[_0xf222('0x47')](handleError(_0x53a382,null));};exports[_0xf222('0x48')]=function(_0x56a5f0,_0x19cb67){var _0x51ed52={'raw':!![],'where':{'id':_0x56a5f0[_0xf222('0x49')]['id']}},_0x149589={};_0x149589[_0xf222('0x33')]=_[_0xf222('0x35')](db[_0xf222('0x30')][_0xf222('0x31')]);_0x149589[_0xf222('0x34')]=_[_0xf222('0x35')](_0x56a5f0[_0xf222('0x34')]);_0x149589[_0xf222('0x3d')]=_[_0xf222('0x36')](_0x149589['model'],_0x149589['query']);_0x51ed52['attributes']=_[_0xf222('0x36')](_0x149589[_0xf222('0x33')],qs[_0xf222('0x37')](_0x56a5f0[_0xf222('0x34')]['fields']));_0x51ed52[_0xf222('0x38')]=_0x51ed52[_0xf222('0x38')][_0xf222('0x4a')]?_0x51ed52[_0xf222('0x38')]:_0x149589['model'];if(_0x56a5f0[_0xf222('0x34')][_0xf222('0x43')]){_0x51ed52[_0xf222('0x44')]=[{'all':!![]}];}_0x51ed52=_[_0xf222('0x40')]({},_0x51ed52,_0x56a5f0[_0xf222('0x42')]);return db[_0xf222('0x30')][_0xf222('0x4b')](_0x51ed52)[_0xf222('0x25')](handleEntityNotFound(_0x19cb67,null))[_0xf222('0x25')](respondWithResult(_0x19cb67,null))[_0xf222('0x47')](handleError(_0x19cb67,null));};exports['create']=function(_0x5d0d70,_0x193762){return db['Tag'][_0xf222('0x4c')](_0x5d0d70['body'],{})[_0xf222('0x25')](function(_0x4e9083){var _0x2d8a04=_0x5d0d70[_0xf222('0x4d')][_0xf222('0x27')]({'plain':!![]});if(!_0x2d8a04)throw new Error(_0xf222('0x4e'));if(_0x2d8a04['role']===_0xf222('0x4d')){var _0x34fd50=_0x4e9083[_0xf222('0x27')]({'plain':!![]});var _0x2dc8d2=_0xf222('0x28');return db[_0xf222('0x4f')][_0xf222('0x4b')]({'where':{'name':_0x2dc8d2,'userProfileId':_0x2d8a04[_0xf222('0x50')]},'raw':!![]})[_0xf222('0x25')](function(_0x8e620){if(_0x8e620&&_0x8e620[_0xf222('0x51')]===0x0){return db[_0xf222('0x29')]['create']({'name':_0x34fd50['name'],'resourceId':_0x34fd50['id'],'type':_0x8e620[_0xf222('0x2c')],'sectionId':_0x8e620['id']},{})[_0xf222('0x25')](function(){return _0x4e9083;});}else{return _0x4e9083;}})[_0xf222('0x47')](function(_0xfb75f0){logger[_0xf222('0x2a')](_0xf222('0x52'),_0xfb75f0);throw _0xfb75f0;});}return _0x4e9083;})[_0xf222('0x25')](respondWithResult(_0x193762,0xc9))[_0xf222('0x47')](handleError(_0x193762,null));};exports[_0xf222('0x24')]=function(_0x1e680a,_0x19d859){if(_0x1e680a['body']['id']){delete _0x1e680a['body']['id'];}return db[_0xf222('0x30')][_0xf222('0x4b')]({'where':{'id':_0x1e680a[_0xf222('0x49')]['id']}})[_0xf222('0x25')](handleEntityNotFound(_0x19d859,null))[_0xf222('0x25')](saveUpdates(_0x1e680a[_0xf222('0x53')],null))[_0xf222('0x25')](respondWithResult(_0x19d859,null))[_0xf222('0x47')](handleError(_0x19d859,null));};exports[_0xf222('0x26')]=function(_0x1c4da4,_0x32ec77){return db[_0xf222('0x30')][_0xf222('0x4b')]({'where':{'id':_0x1c4da4[_0xf222('0x49')]['id']}})['then'](handleEntityNotFound(_0x32ec77,null))[_0xf222('0x25')](removeEntity(_0x32ec77,null))['catch'](handleError(_0x32ec77,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ab2ff2a..8545fd0 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 _0x475a=['path','define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x545197,_0x2bd647){var _0x4b746c=function(_0x16db2e){while(--_0x16db2e){_0x545197['push'](_0x545197['shift']());}};_0x4b746c(++_0x2bd647);}(_0x475a,0x14e));var _0xa475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x475a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa475('0x0'));var util=require(_0xa475('0x1'));var logger=require(_0xa475('0x2'))(_0xa475('0x3'));var moment=require('moment');var BPromise=require(_0xa475('0x4'));var rp=require(_0xa475('0x5'));var fs=require('fs');var path=require(_0xa475('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x5dcb0e,_0x5cf38a){return _0x5dcb0e[_0xa475('0x7')](_0xa475('0x8'),attributes,{'tableName':_0xa475('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb67d=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb67d,0x1ef));var _0xdb67=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb67d[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xdb67('0x0'));var util=require(_0xdb67('0x1'));var logger=require(_0xdb67('0x2'))(_0xdb67('0x3'));var moment=require(_0xdb67('0x4'));var BPromise=require(_0xdb67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb67('0x6'));var rimraf=require(_0xdb67('0x7'));var config=require(_0xdb67('0x8'));var attributes=require(_0xdb67('0x9'));module[_0xdb67('0xa')]=function(_0x166334,_0x5761f7){return _0x166334[_0xdb67('0xb')](_0xdb67('0xc'),attributes,{'tableName':_0xdb67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 717a6b8..015e2b7 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 _0x8d9b=['rpc','../../config/environment','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});} \ No newline at end of file +var _0x2494=['../../config/utils','../../config/environment','client','http','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d97b4,_0x40a28e){var _0x5220b6=function(_0x397693){while(--_0x397693){_0x1d97b4['push'](_0x1d97b4['shift']());}};_0x5220b6(++_0x40a28e);}(_0x2494,0x82));var _0x4249=function(_0x4d4199,_0x5f2810){_0x4d4199=_0x4d4199-0x0;var _0x4dda18=_0x2494[_0x4d4199];return _0x4dda18;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 0518221..f5dbfd0 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 9e74747..1bb7f17 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 _0xbaf0=['name','exports','STRING'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xb1e825,_0x1066e1){var _0x4fc8c2=function(_0x35cd4b){while(--_0x35cd4b){_0xb1e825['push'](_0xb1e825['shift']());}};_0x4fc8c2(++_0x1066e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b120e0f..12987a6 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 _0x5bd4=['Fax','Whatsapp','penalty','QueueId','Voice','defaults','TeamVoiceQueue','findOrCreate','Queue:save','User','voicePause','interface','upsert','isNil','format','SIP/%s','all','parse','TeamVoicePrefix','length','UserVoicePrefix','VoicePrefixId','spread','Openchannel','sequelize','UserVoiceQueueRt','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','Teams','UserProfileResource','stack','name','map','Team','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','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','channel','isValidChannel','ValidationError','Queue','options','capitalize','toLowerCase','Queues','addQueues','Sequelize','Unknown\x20channel','add','ids','removeQueues','findOne','remove','addAgents','Chat','Mail','Sms'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x5bd4,0x12c));var _0x45bd=function(_0x3fbfe2,_0x53c026){_0x3fbfe2=_0x3fbfe2-0x0;var _0x16dde9=_0x5bd4[_0x3fbfe2];return _0x16dde9;};'use strict';var emlformat=require(_0x45bd('0x0'));var rimraf=require(_0x45bd('0x1'));var zipdir=require(_0x45bd('0x2'));var jsonpatch=require(_0x45bd('0x3'));var rp=require(_0x45bd('0x4'));var moment=require(_0x45bd('0x5'));var BPromise=require(_0x45bd('0x6'));var Mustache=require(_0x45bd('0x7'));var util=require('util');var path=require(_0x45bd('0x8'));var sox=require(_0x45bd('0x9'));var csv=require(_0x45bd('0xa'));var ejs=require(_0x45bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x45bd('0xc'));var crypto=require(_0x45bd('0xd'));var jsforce=require(_0x45bd('0xe'));var deskjs=require(_0x45bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x45bd('0x10'));var Papa=require(_0x45bd('0x11'));var Redis=require(_0x45bd('0x12'));var authService=require(_0x45bd('0x13'));var qs=require(_0x45bd('0x14'));var as=require(_0x45bd('0x15'));var hardwareService=require(_0x45bd('0x16'));var logger=require(_0x45bd('0x17'))(_0x45bd('0x18'));var utils=require(_0x45bd('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x45bd('0x1a'));var db=require('../../mysqldb')['db'];config[_0x45bd('0x1b')]=_['defaults'](config[_0x45bd('0x1b')],{'host':_0x45bd('0x1c'),'port':0x18eb});var socket=require(_0x45bd('0x1d'))(new Redis(config[_0x45bd('0x1b')]));require(_0x45bd('0x1e'))[_0x45bd('0x1f')](socket);function respondWithStatusCode(_0x7f1bc5,_0x222b6d){_0x222b6d=_0x222b6d||0xcc;return function(_0x497665){if(_0x497665){return _0x7f1bc5[_0x45bd('0x20')](_0x222b6d);}return _0x7f1bc5[_0x45bd('0x21')](_0x222b6d)[_0x45bd('0x22')]();};}function respondWithResult(_0x240851,_0x5ef39e){_0x5ef39e=_0x5ef39e||0xc8;return function(_0x1e40e7){if(_0x1e40e7){return _0x240851['status'](_0x5ef39e)[_0x45bd('0x23')](_0x1e40e7);}};}function respondWithFilteredResult(_0x3d5a36,_0x59b296){return function(_0x32425d){if(_0x32425d){var _0x46505f=typeof _0x59b296[_0x45bd('0x24')]===_0x45bd('0x25')&&typeof _0x59b296[_0x45bd('0x26')]==='undefined';var _0x226168=_0x32425d['count'];var _0x4ab599=_0x46505f?0x0:_0x59b296[_0x45bd('0x24')];var _0x307ae0=_0x46505f?_0x32425d[_0x45bd('0x27')]:_0x59b296['offset']+_0x59b296['limit'];var _0x5e3d34;if(_0x307ae0>=_0x226168){_0x307ae0=_0x226168;_0x5e3d34=0xc8;}else{_0x5e3d34=0xce;}_0x3d5a36['status'](_0x5e3d34);return _0x3d5a36[_0x45bd('0x28')]('Content-Range',_0x4ab599+'-'+_0x307ae0+'/'+_0x226168)[_0x45bd('0x23')](_0x32425d);}return null;};}function patchUpdates(_0x2cbb46){return function(_0x498b3e){try{jsonpatch[_0x45bd('0x29')](_0x498b3e,_0x2cbb46,!![]);}catch(_0xf48e7){return BPromise['reject'](_0xf48e7);}return _0x498b3e[_0x45bd('0x2a')]();};}function saveUpdates(_0x45a47f,_0x264424){return function(_0x42e071){if(_0x42e071){return _0x42e071[_0x45bd('0x2b')](_0x45a47f)[_0x45bd('0x2c')](function(_0x488335){return _0x488335;});}return null;};}function removeEntity(_0x25c66d,_0x5e4c59){return function(_0x3cfd41){if(_0x3cfd41){return _0x3cfd41[_0x45bd('0x2d')]()['then'](function(){var _0x38dc7d=_0x3cfd41['get']({'plain':!![]});var _0x48b2ca=_0x45bd('0x2e');return db[_0x45bd('0x2f')][_0x45bd('0x2d')]({'where':{'type':_0x48b2ca,'resourceId':_0x38dc7d['id']}})['then'](function(){return _0x3cfd41;});})[_0x45bd('0x2c')](function(){_0x25c66d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c979,_0x4e3134){return function(_0x30e510){if(!_0x30e510){_0x16c979[_0x45bd('0x20')](0x194);}return _0x30e510;};}function handleError(_0x2bba5b,_0x2defcf){_0x2defcf=_0x2defcf||0x1f4;return function(_0x40a5b9){logger['error'](_0x40a5b9[_0x45bd('0x30')]);if(_0x40a5b9[_0x45bd('0x31')]){delete _0x40a5b9[_0x45bd('0x31')];}_0x2bba5b[_0x45bd('0x21')](_0x2defcf)['send'](_0x40a5b9);};}exports['index']=function(_0x49d79a,_0x5864b0){var _0x8dd8c1={},_0x4600ef={},_0xd9febe={'count':0x0,'rows':[]};var _0x45e64c=_[_0x45bd('0x32')](db[_0x45bd('0x33')]['rawAttributes'],function(_0x480c2f){return{'name':_0x480c2f['fieldName'],'type':_0x480c2f[_0x45bd('0x34')][_0x45bd('0x35')]};});_0x4600ef[_0x45bd('0x36')]=_[_0x45bd('0x32')](_0x45e64c,'name');_0x4600ef['query']=_[_0x45bd('0x37')](_0x49d79a[_0x45bd('0x38')]);_0x4600ef[_0x45bd('0x39')]=_[_0x45bd('0x3a')](_0x4600ef[_0x45bd('0x36')],_0x4600ef[_0x45bd('0x38')]);_0x8dd8c1['attributes']=_[_0x45bd('0x3a')](_0x4600ef[_0x45bd('0x36')],qs['fields'](_0x49d79a[_0x45bd('0x38')]['fields']));_0x8dd8c1[_0x45bd('0x3b')]=_0x8dd8c1['attributes']['length']?_0x8dd8c1[_0x45bd('0x3b')]:_0x4600ef[_0x45bd('0x36')];if(!_0x49d79a['query'][_0x45bd('0x3c')](_0x45bd('0x3d'))){_0x8dd8c1[_0x45bd('0x26')]=qs[_0x45bd('0x26')](_0x49d79a[_0x45bd('0x38')][_0x45bd('0x26')]);_0x8dd8c1[_0x45bd('0x24')]=qs[_0x45bd('0x24')](_0x49d79a['query'][_0x45bd('0x24')]);}_0x8dd8c1[_0x45bd('0x3e')]=qs[_0x45bd('0x3f')](_0x49d79a[_0x45bd('0x38')]['sort']);_0x8dd8c1[_0x45bd('0x40')]=qs[_0x45bd('0x39')](_[_0x45bd('0x41')](_0x49d79a[_0x45bd('0x38')],_0x4600ef[_0x45bd('0x39')]),_0x45e64c);if(_0x49d79a['query'][_0x45bd('0x42')]){_0x8dd8c1[_0x45bd('0x40')]=_[_0x45bd('0x43')](_0x8dd8c1['where'],{'$or':_[_0x45bd('0x32')](_0x45e64c,function(_0xc0336b){if(_0xc0336b[_0x45bd('0x34')]!=='VIRTUAL'){var _0x25c96c={};_0x25c96c[_0xc0336b['name']]={'$like':'%'+_0x49d79a[_0x45bd('0x38')][_0x45bd('0x42')]+'%'};return _0x25c96c;}})});}_0x8dd8c1=_[_0x45bd('0x43')]({},_0x8dd8c1,_0x49d79a['options']);var _0x4ec379={'where':_0x8dd8c1[_0x45bd('0x40')]};return db[_0x45bd('0x33')][_0x45bd('0x27')](_0x4ec379)[_0x45bd('0x2c')](function(_0x9317b1){_0xd9febe[_0x45bd('0x27')]=_0x9317b1;if(_0x49d79a[_0x45bd('0x38')][_0x45bd('0x44')]){_0x8dd8c1[_0x45bd('0x45')]=[{'all':!![]}];}return db[_0x45bd('0x33')][_0x45bd('0x46')](_0x8dd8c1);})[_0x45bd('0x2c')](function(_0x35436b){_0xd9febe[_0x45bd('0x47')]=_0x35436b;return _0xd9febe;})['then'](respondWithFilteredResult(_0x5864b0,_0x8dd8c1))[_0x45bd('0x48')](handleError(_0x5864b0,null));};exports[_0x45bd('0x49')]=function(_0x354426,_0x459a3d){var _0x4f16f6={'raw':![],'where':{'id':_0x354426[_0x45bd('0x4a')]['id']}},_0x5333cf={};_0x5333cf[_0x45bd('0x36')]=_['keys'](db[_0x45bd('0x33')][_0x45bd('0x4b')]);_0x5333cf[_0x45bd('0x38')]=_[_0x45bd('0x37')](_0x354426[_0x45bd('0x38')]);_0x5333cf[_0x45bd('0x39')]=_[_0x45bd('0x3a')](_0x5333cf[_0x45bd('0x36')],_0x5333cf[_0x45bd('0x38')]);_0x4f16f6[_0x45bd('0x3b')]=_[_0x45bd('0x3a')](_0x5333cf['model'],qs[_0x45bd('0x4c')](_0x354426[_0x45bd('0x38')][_0x45bd('0x4c')]));_0x4f16f6[_0x45bd('0x3b')]=_0x4f16f6['attributes']['length']?_0x4f16f6['attributes']:_0x5333cf['model'];if(_0x354426[_0x45bd('0x38')][_0x45bd('0x44')]){_0x4f16f6[_0x45bd('0x45')]=[{'all':!![]}];}_0x4f16f6=_[_0x45bd('0x43')]({},_0x4f16f6,_0x354426['options']);return db['Team'][_0x45bd('0x4d')](_0x4f16f6)['then'](handleEntityNotFound(_0x459a3d,null))[_0x45bd('0x2c')](respondWithResult(_0x459a3d,null))[_0x45bd('0x48')](handleError(_0x459a3d,null));};exports[_0x45bd('0x4e')]=function(_0x1ef93b,_0x493bef){return db[_0x45bd('0x33')][_0x45bd('0x4e')](_0x1ef93b[_0x45bd('0x4f')],{})['then'](function(_0x54b9e4){var _0x4896ec=_0x1ef93b[_0x45bd('0x50')]['get']({'plain':!![]});if(!_0x4896ec)throw new Error(_0x45bd('0x51'));if(_0x4896ec[_0x45bd('0x52')]===_0x45bd('0x50')){var _0xa3681c=_0x54b9e4['get']({'plain':!![]});var _0x7a075e='Teams';return db[_0x45bd('0x53')][_0x45bd('0x4d')]({'where':{'name':_0x7a075e,'userProfileId':_0x4896ec[_0x45bd('0x54')]},'raw':!![]})[_0x45bd('0x2c')](function(_0x3d92a8){if(_0x3d92a8&&_0x3d92a8[_0x45bd('0x55')]===0x0){return db[_0x45bd('0x2f')][_0x45bd('0x4e')]({'name':_0xa3681c['name'],'resourceId':_0xa3681c['id'],'type':_0x3d92a8[_0x45bd('0x31')],'sectionId':_0x3d92a8['id']},{})[_0x45bd('0x2c')](function(){return _0x54b9e4;});}else{return _0x54b9e4;}})[_0x45bd('0x48')](function(_0x344017){logger['error'](_0x45bd('0x56'),_0x344017);throw _0x344017;});}return _0x54b9e4;})[_0x45bd('0x2c')](respondWithResult(_0x493bef,0xc9))['catch'](handleError(_0x493bef,null));};exports[_0x45bd('0x2b')]=function(_0x5ce45d,_0x1c3507){if(_0x5ce45d[_0x45bd('0x4f')]['id']){delete _0x5ce45d['body']['id'];}return db['Team'][_0x45bd('0x4d')]({'where':{'id':_0x5ce45d[_0x45bd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c3507,null))[_0x45bd('0x2c')](saveUpdates(_0x5ce45d[_0x45bd('0x4f')],null))[_0x45bd('0x2c')](respondWithResult(_0x1c3507,null))[_0x45bd('0x48')](handleError(_0x1c3507,null));};exports[_0x45bd('0x2d')]=function(_0x28f676,_0x53088b){return db[_0x45bd('0x33')][_0x45bd('0x4d')]({'where':{'id':_0x28f676[_0x45bd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53088b,null))[_0x45bd('0x2c')](removeEntity(_0x53088b,null))[_0x45bd('0x48')](handleError(_0x53088b,null));};exports[_0x45bd('0x57')]=function(_0x3be1a7,_0x323d97,_0x356f67){return db[_0x45bd('0x33')]['findOne']({'where':{'id':_0x3be1a7['params']['id']}})['then'](handleEntityNotFound(_0x323d97,null))[_0x45bd('0x2c')](function(_0x49491a){if(!_0x3be1a7[_0x45bd('0x38')][_0x45bd('0x58')]||!utils[_0x45bd('0x59')](_0x3be1a7['query']['channel'])){throw new db['Sequelize'][(_0x45bd('0x5a'))]('Unknown\x20channel');}var _0x13c780={};var _0x574b7d={};_0x574b7d['model']=_[_0x45bd('0x37')](db[_['capitalize'](_0x3be1a7['query'][_0x45bd('0x58')]['toLowerCase']())+_0x45bd('0x5b')]['rawAttributes']);_0x574b7d['query']=_[_0x45bd('0x37')](_0x3be1a7[_0x45bd('0x38')]);_0x574b7d[_0x45bd('0x39')]=_['intersection'](_0x574b7d[_0x45bd('0x36')],_0x574b7d['query']);_0x13c780[_0x45bd('0x3b')]=_[_0x45bd('0x3a')](_0x574b7d[_0x45bd('0x36')],qs[_0x45bd('0x4c')](_0x3be1a7['query'][_0x45bd('0x4c')]));_0x13c780[_0x45bd('0x3b')]=_0x13c780[_0x45bd('0x3b')]['length']?_0x13c780[_0x45bd('0x3b')]:_0x574b7d[_0x45bd('0x36')];_0x13c780[_0x45bd('0x26')]=qs[_0x45bd('0x26')](_0x3be1a7[_0x45bd('0x38')][_0x45bd('0x26')]);_0x13c780[_0x45bd('0x24')]=qs['offset'](_0x3be1a7[_0x45bd('0x38')][_0x45bd('0x24')]);_0x13c780['order']=qs[_0x45bd('0x3f')](_0x3be1a7['query'][_0x45bd('0x3f')]);_0x13c780[_0x45bd('0x40')]=qs[_0x45bd('0x39')](_[_0x45bd('0x41')](_0x3be1a7['query'],_0x574b7d[_0x45bd('0x39')]));_0x13c780=_[_0x45bd('0x43')]({},_0x13c780,_0x3be1a7[_0x45bd('0x5c')]);return _0x49491a['get'+_[_0x45bd('0x5d')](_0x3be1a7[_0x45bd('0x38')][_0x45bd('0x58')][_0x45bd('0x5e')]())+_0x45bd('0x5f')](_0x13c780);})[_0x45bd('0x2c')](respondWithResult(_0x323d97,null))['catch'](handleError(_0x323d97,null));};exports[_0x45bd('0x60')]=function(_0x2dc8ca,_0xb35920,_0x3ceb02){return db[_0x45bd('0x33')]['findOne']({'where':{'id':_0x2dc8ca[_0x45bd('0x4a')]['id']}})[_0x45bd('0x2c')](function(_0xe1500b){if(_0xe1500b){if(!_0x2dc8ca[_0x45bd('0x4f')]['channel']||!utils['isValidChannel'](_0x2dc8ca[_0x45bd('0x4f')][_0x45bd('0x58')])){throw new db[(_0x45bd('0x61'))][(_0x45bd('0x5a'))](_0x45bd('0x62'));}return _0xe1500b[_0x45bd('0x63')+_[_0x45bd('0x5d')](_0x2dc8ca[_0x45bd('0x4f')][_0x45bd('0x58')][_0x45bd('0x5e')]())+_0x45bd('0x5f')](_0x2dc8ca[_0x45bd('0x4f')][_0x45bd('0x64')]);}return null;})[_0x45bd('0x2c')](handleEntityNotFound(_0xb35920,null))[_0x45bd('0x2c')](respondWithStatusCode(_0xb35920,null))[_0x45bd('0x48')](handleError(_0xb35920,null));};exports[_0x45bd('0x65')]=function(_0x71ff35,_0x232348,_0x46ea07){return db['Team'][_0x45bd('0x66')]({'where':{'id':_0x71ff35[_0x45bd('0x4a')]['id']}})['then'](function(_0x1a965b){if(_0x1a965b){if(!_0x71ff35[_0x45bd('0x38')]['channel']||!utils[_0x45bd('0x59')](_0x71ff35[_0x45bd('0x38')][_0x45bd('0x58')])){throw new db[(_0x45bd('0x61'))][(_0x45bd('0x5a'))](_0x45bd('0x62'));}return _0x1a965b[_0x45bd('0x67')+_[_0x45bd('0x5d')](_0x71ff35[_0x45bd('0x38')][_0x45bd('0x58')]['toLowerCase']())+'Queues'](_0x71ff35['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x232348,null))[_0x45bd('0x2c')](respondWithStatusCode(_0x232348,null))[_0x45bd('0x48')](handleError(_0x232348,null));};exports[_0x45bd('0x68')]=function(_0x535faf,_0x1a5911){return db[_0x45bd('0x33')][_0x45bd('0x4d')]({'where':{'id':_0x535faf[_0x45bd('0x4a')]['id']}})[_0x45bd('0x2c')](handleEntityNotFound(_0x1a5911,null))[_0x45bd('0x2c')](function(_0x255dad){if(_0x255dad){var _0x16f7ac=['Voice',_0x45bd('0x69'),_0x45bd('0x6a'),_0x45bd('0x6b'),_0x45bd('0x6c'),'Openchannel',_0x45bd('0x6d')];return db['sequelize']['transaction'](function(_0x10a5db){var _0x1ee095=_[_0x45bd('0x32')](_0x16f7ac,function(_0x4acafd){var _0x4ce467={'attributes':['id','name']};if(_0x4acafd==='Voice'){_0x4ce467['through']={'attributes':[_0x45bd('0x6e')]};}return _0x255dad['get'+_0x4acafd+_0x45bd('0x5f')](_0x4ce467)[_0x45bd('0x2c')](function(_0x6b8a99){var _0x2b0ef3=_['map'](_0x6b8a99,function(_0x38010f){var _0x29904c=_[_0x45bd('0x32')](_0x535faf[_0x45bd('0x4f')][_0x45bd('0x64')],function(_0x36ca12){var _0x5d14c5={'where':{'UserId':_0x36ca12,[_0x4acafd+_0x45bd('0x6f')]:_0x38010f['id']},'transaction':_0x10a5db};if(_0x4acafd===_0x45bd('0x70')){_0x5d14c5[_0x45bd('0x71')]={'penalty':_0x38010f[_0x45bd('0x72')]['penalty']};}return db['User'+_0x4acafd+_0x45bd('0x5b')][_0x45bd('0x73')](_0x5d14c5)['then'](function(){socket['emit'](_0x45bd('0x50')+_0x4acafd+_0x45bd('0x74'),{'UserId':_0x36ca12,[_0x4acafd+_0x45bd('0x6f')]:_0x38010f['id']});if(_0x4acafd!==_0x45bd('0x70'))return;return db[_0x45bd('0x75')]['findAll']({'where':{'id':_0x535faf[_0x45bd('0x4f')][_0x45bd('0x64')],'online':0x1},'attributes':['id','name','online',_0x45bd('0x76'),_0x45bd('0x77')],'raw':!![]})[_0x45bd('0x2c')](function(_0x2be092){var _0x24d038=_[_0x45bd('0x32')](_0x2be092,function(_0x10885e){return db['UserVoiceQueueRt'][_0x45bd('0x78')]({'membername':_0x10885e[_0x45bd('0x31')],'UserId':_0x10885e['id'],'queue_name':_0x38010f[_0x45bd('0x31')],'VoiceQueueId':_0x38010f['id'],'interface':_[_0x45bd('0x79')](_0x10885e[_0x45bd('0x77')])?util[_0x45bd('0x7a')](_0x45bd('0x7b'),_0x10885e[_0x45bd('0x31')]):_0x10885e[_0x45bd('0x77')],'paused':_0x10885e['voicePause']||![],'penalty':_0x38010f['TeamVoiceQueue']['penalty']},{'transaction':_0x10a5db});});return Promise[_0x45bd('0x7c')](_0x24d038);});});});return Promise['all'](_0x29904c);});return Promise['all'](_0x2b0ef3);})[_0x45bd('0x2c')](function(){var _0x543fa1=JSON[_0x45bd('0x7d')]('['+_0x535faf[_0x45bd('0x4f')][_0x45bd('0x64')]+']');db[_0x45bd('0x7e')][_0x45bd('0x66')]({'where':{'teamId':_0x535faf['params']['id']}})[_0x45bd('0x2c')](function(_0x3b0675){if(_0x3b0675){for(var _0x1ed8c8=0x0;_0x1ed8c8<_0x543fa1[_0x45bd('0x7f')];_0x1ed8c8++){var _0x3898e9=_0x543fa1[_0x1ed8c8];db[_0x45bd('0x80')][_0x45bd('0x78')]({'UserId':_0x3898e9,'VoicePrefixId':_0x3b0675[_0x45bd('0x81')]});}}});});});return Promise['all'](_0x1ee095)[_0x45bd('0x2c')](function(){return _0x255dad['addAgents'](_0x535faf[_0x45bd('0x4f')][_0x45bd('0x64')],{'transaction':_0x10a5db})[_0x45bd('0x82')](function(_0x5d1ba0){return _0x5d1ba0;});});});}})[_0x45bd('0x2c')](respondWithResult(_0x1a5911,null))[_0x45bd('0x48')](handleError(_0x1a5911,null));};exports['removeAgents']=function(_0x48b135,_0x4e739d){return db[_0x45bd('0x33')]['find']({'where':{'id':_0x48b135['params']['id']}})['then'](handleEntityNotFound(_0x4e739d,null))[_0x45bd('0x2c')](function(_0x410b2e){if(_0x410b2e){var _0x5aceb2=[_0x45bd('0x70'),_0x45bd('0x69'),_0x45bd('0x6a'),_0x45bd('0x6b'),_0x45bd('0x6c'),_0x45bd('0x83'),_0x45bd('0x6d')];return db[_0x45bd('0x84')]['transaction'](function(_0x3cf5a9){var _0x116892=_[_0x45bd('0x32')](_0x5aceb2,function(_0x1b1bde){var _0x2c2939={'attributes':['id',_0x45bd('0x31')]};return _0x410b2e['get'+_0x1b1bde+_0x45bd('0x5f')](_0x2c2939)['then'](function(_0x64e6fb){var _0x3aa1cf=_['map'](_0x64e6fb,function(_0x8b1c){return _0x8b1c['removeAgents'](_0x48b135[_0x45bd('0x38')][_0x45bd('0x64')],{'transaction':_0x3cf5a9})[_0x45bd('0x2c')](function(){var _0x3defb4=JSON['parse']('['+_0x48b135[_0x45bd('0x38')][_0x45bd('0x64')]+']');var _0x40732e=_[_0x45bd('0x32')](_0x3defb4,function(_0x51aee2){socket['emit'](_0x45bd('0x50')+_0x1b1bde+'Queue:remove',{'UserId':Number(_0x51aee2),[_0x1b1bde+_0x45bd('0x6f')]:_0x8b1c['id']});if(_0x1b1bde!==_0x45bd('0x70'))return;return db[_0x45bd('0x85')][_0x45bd('0x2d')]({'where':{'VoiceQueueId':_0x8b1c['id'],'UserId':_0x51aee2},'transaction':_0x3cf5a9});});return Promise[_0x45bd('0x7c')](_0x40732e);});});return Promise[_0x45bd('0x7c')](_0x3aa1cf);});});return Promise[_0x45bd('0x7c')](_0x116892)[_0x45bd('0x2c')](function(){return _0x410b2e[_0x45bd('0x86')](_0x48b135[_0x45bd('0x38')][_0x45bd('0x64')],{'transaction':_0x3cf5a9});})[_0x45bd('0x2c')](function(){var _0x293cda=JSON['parse']('['+_0x48b135[_0x45bd('0x38')][_0x45bd('0x64')]+']');db['TeamVoicePrefix'][_0x45bd('0x66')]({'where':{'teamId':_0x48b135[_0x45bd('0x4a')]['id']}})[_0x45bd('0x2c')](function(_0x648f6){if(_0x648f6){for(var _0x3aa50f=0x0;_0x3aa50f<_0x293cda['length'];_0x3aa50f++){var _0x568761=_0x293cda[_0x3aa50f];db['UserVoicePrefix'][_0x45bd('0x2d')]({'where':{'UserId':_0x568761,'VoicePrefixId':_0x648f6[_0x45bd('0x81')]}});}}});});});}})['then'](respondWithStatusCode(_0x4e739d,null))[_0x45bd('0x48')](handleError(_0x4e739d,null));};exports['getAgents']=function(_0x335f31,_0x2269c2,_0x23f05d){var _0x460ac6={};var _0x3f8cb1={};var _0x353cd3;var _0x9c60a6;return db[_0x45bd('0x33')][_0x45bd('0x66')]({'where':{'id':_0x335f31[_0x45bd('0x4a')]['id']}})[_0x45bd('0x2c')](handleEntityNotFound(_0x2269c2,null))[_0x45bd('0x2c')](function(_0x548d23){if(_0x548d23){_0x353cd3=_0x548d23;_0x3f8cb1[_0x45bd('0x36')]=_['keys'](db[_0x45bd('0x75')]['rawAttributes']);_0x3f8cb1['query']=_[_0x45bd('0x37')](_0x335f31[_0x45bd('0x38')]);_0x3f8cb1[_0x45bd('0x39')]=_['intersection'](_0x3f8cb1[_0x45bd('0x36')],_0x3f8cb1['query']);_0x460ac6[_0x45bd('0x3b')]=_[_0x45bd('0x3a')](_0x3f8cb1[_0x45bd('0x36')],qs[_0x45bd('0x4c')](_0x335f31[_0x45bd('0x38')]['fields']));_0x460ac6['attributes']=_0x460ac6[_0x45bd('0x3b')]['length']?_0x460ac6[_0x45bd('0x3b')]:_0x3f8cb1[_0x45bd('0x36')];_0x460ac6[_0x45bd('0x3e')]=qs[_0x45bd('0x3f')](_0x335f31[_0x45bd('0x38')][_0x45bd('0x3f')]);_0x460ac6[_0x45bd('0x40')]=qs[_0x45bd('0x39')](_[_0x45bd('0x41')](_0x335f31['query'],_0x3f8cb1[_0x45bd('0x39')]));if(_0x335f31[_0x45bd('0x38')][_0x45bd('0x42')]){_0x460ac6[_0x45bd('0x40')]=_[_0x45bd('0x43')](_0x460ac6[_0x45bd('0x40')],{'$or':_['map'](_0x460ac6[_0x45bd('0x3b')],function(_0xe7cfdc){var _0x4d3b5e={};_0x4d3b5e[_0xe7cfdc]={'$like':'%'+_0x335f31[_0x45bd('0x38')][_0x45bd('0x42')]+'%'};return _0x4d3b5e;})});}_0x460ac6=_[_0x45bd('0x43')]({},_0x460ac6,_0x335f31[_0x45bd('0x5c')]);return _0x353cd3[_0x45bd('0x87')](_0x460ac6);}})[_0x45bd('0x2c')](function(_0x4bf2f5){if(_0x4bf2f5){_0x9c60a6=_0x4bf2f5['length'];if(!_0x335f31[_0x45bd('0x38')]['hasOwnProperty']('nolimit')){_0x460ac6[_0x45bd('0x26')]=qs[_0x45bd('0x26')](_0x335f31[_0x45bd('0x38')][_0x45bd('0x26')]);_0x460ac6[_0x45bd('0x24')]=qs[_0x45bd('0x24')](_0x335f31['query'][_0x45bd('0x24')]);}return _0x353cd3[_0x45bd('0x87')](_0x460ac6);}})[_0x45bd('0x2c')](function(_0x38532e){if(_0x38532e){return _0x38532e?{'count':_0x9c60a6,'rows':_0x38532e}:null;}})['then'](respondWithResult(_0x2269c2,null))['catch'](handleError(_0x2269c2,null));}; \ No newline at end of file +var _0x4f73=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','then','Teams','UserProfileResource','destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','type','options','where','Team','includeAll','include','findAll','rows','show','find','catch','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','update','params','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','findOne','Sequelize','add','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','upsert','isNil','interface','format','SIP/%s','all','parse','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Queue:remove','UserVoiceQueueRt','TeamVoicePrefix','getAgents','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4f73,0x74));var _0x34f7=function(_0x53210a,_0x4a49f1){_0x53210a=_0x53210a-0x0;var _0x82411c=_0x4f73[_0x53210a];return _0x82411c;};'use strict';var emlformat=require(_0x34f7('0x0'));var rimraf=require(_0x34f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34f7('0x2'));var Mustache=require(_0x34f7('0x3'));var util=require(_0x34f7('0x4'));var path=require(_0x34f7('0x5'));var sox=require(_0x34f7('0x6'));var csv=require(_0x34f7('0x7'));var ejs=require(_0x34f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34f7('0x9'));var squel=require(_0x34f7('0xa'));var crypto=require(_0x34f7('0xb'));var jsforce=require(_0x34f7('0xc'));var deskjs=require(_0x34f7('0xd'));var toCsv=require(_0x34f7('0x7'));var querystring=require(_0x34f7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x34f7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34f7('0x10'));var logger=require(_0x34f7('0x11'))(_0x34f7('0x12'));var utils=require('../../config/utils');var config=require(_0x34f7('0x13'));var licenseUtil=require(_0x34f7('0x14'));var db=require(_0x34f7('0x15'))['db'];config['redis']=_['defaults'](config[_0x34f7('0x16')],{'host':_0x34f7('0x17'),'port':0x18eb});var socket=require(_0x34f7('0x18'))(new Redis(config[_0x34f7('0x16')]));require(_0x34f7('0x19'))[_0x34f7('0x1a')](socket);function respondWithStatusCode(_0x410fc8,_0x403ff2){_0x403ff2=_0x403ff2||0xcc;return function(_0x5e81e8){if(_0x5e81e8){return _0x410fc8[_0x34f7('0x1b')](_0x403ff2);}return _0x410fc8[_0x34f7('0x1c')](_0x403ff2)[_0x34f7('0x1d')]();};}function respondWithResult(_0x39a580,_0x2ee598){_0x2ee598=_0x2ee598||0xc8;return function(_0xf4a33f){if(_0xf4a33f){return _0x39a580[_0x34f7('0x1c')](_0x2ee598)[_0x34f7('0x1e')](_0xf4a33f);}};}function respondWithFilteredResult(_0x1bf087,_0xfd494c){return function(_0x4620f4){if(_0x4620f4){var _0x3f60d3=typeof _0xfd494c[_0x34f7('0x1f')]===_0x34f7('0x20')&&typeof _0xfd494c[_0x34f7('0x21')]===_0x34f7('0x20');var _0x29874d=_0x4620f4[_0x34f7('0x22')];var _0x52e331=_0x3f60d3?0x0:_0xfd494c[_0x34f7('0x1f')];var _0x132ee5=_0x3f60d3?_0x4620f4[_0x34f7('0x22')]:_0xfd494c[_0x34f7('0x1f')]+_0xfd494c[_0x34f7('0x21')];var _0x30db28;if(_0x132ee5>=_0x29874d){_0x132ee5=_0x29874d;_0x30db28=0xc8;}else{_0x30db28=0xce;}_0x1bf087[_0x34f7('0x1c')](_0x30db28);return _0x1bf087['set']('Content-Range',_0x52e331+'-'+_0x132ee5+'/'+_0x29874d)['json'](_0x4620f4);}return null;};}function patchUpdates(_0x1fbe49){return function(_0x62f2a8){try{jsonpatch[_0x34f7('0x23')](_0x62f2a8,_0x1fbe49,!![]);}catch(_0x333aee){return BPromise[_0x34f7('0x24')](_0x333aee);}return _0x62f2a8['save']();};}function saveUpdates(_0x475d8d,_0x253f7d){return function(_0x5b597f){if(_0x5b597f){return _0x5b597f['update'](_0x475d8d)[_0x34f7('0x25')](function(_0x2018c0){return _0x2018c0;});}return null;};}function removeEntity(_0x53583e,_0xdb6c92){return function(_0x3d6cd4){if(_0x3d6cd4){return _0x3d6cd4['destroy']()[_0x34f7('0x25')](function(){var _0x1618c9=_0x3d6cd4['get']({'plain':!![]});var _0x582f81=_0x34f7('0x26');return db[_0x34f7('0x27')][_0x34f7('0x28')]({'where':{'type':_0x582f81,'resourceId':_0x1618c9['id']}})['then'](function(){return _0x3d6cd4;});})[_0x34f7('0x25')](function(){_0x53583e[_0x34f7('0x1c')](0xcc)[_0x34f7('0x1d')]();});}};}function handleEntityNotFound(_0x298a2d,_0x3ef9b4){return function(_0x32abba){if(!_0x32abba){_0x298a2d[_0x34f7('0x1b')](0x194);}return _0x32abba;};}function handleError(_0x488f11,_0x147c8f){_0x147c8f=_0x147c8f||0x1f4;return function(_0x24dd31){logger[_0x34f7('0x29')](_0x24dd31['stack']);if(_0x24dd31[_0x34f7('0x2a')]){delete _0x24dd31[_0x34f7('0x2a')];}_0x488f11[_0x34f7('0x1c')](_0x147c8f)['send'](_0x24dd31);};}exports[_0x34f7('0x2b')]=function(_0x1ab60e,_0x3c6718){var _0xc2a277={},_0x5d0b55={},_0x2cd77e={'count':0x0,'rows':[]};var _0x42acea=_['map'](db['Team'][_0x34f7('0x2c')],function(_0x46e50e){return{'name':_0x46e50e[_0x34f7('0x2d')],'type':_0x46e50e['type'][_0x34f7('0x2e')]};});_0x5d0b55[_0x34f7('0x2f')]=_[_0x34f7('0x30')](_0x42acea,_0x34f7('0x2a'));_0x5d0b55[_0x34f7('0x31')]=_[_0x34f7('0x32')](_0x1ab60e[_0x34f7('0x31')]);_0x5d0b55[_0x34f7('0x33')]=_[_0x34f7('0x34')](_0x5d0b55['model'],_0x5d0b55[_0x34f7('0x31')]);_0xc2a277[_0x34f7('0x35')]=_[_0x34f7('0x34')](_0x5d0b55[_0x34f7('0x2f')],qs[_0x34f7('0x36')](_0x1ab60e[_0x34f7('0x31')][_0x34f7('0x36')]));_0xc2a277['attributes']=_0xc2a277[_0x34f7('0x35')][_0x34f7('0x37')]?_0xc2a277[_0x34f7('0x35')]:_0x5d0b55['model'];if(!_0x1ab60e[_0x34f7('0x31')]['hasOwnProperty'](_0x34f7('0x38'))){_0xc2a277[_0x34f7('0x21')]=qs[_0x34f7('0x21')](_0x1ab60e[_0x34f7('0x31')][_0x34f7('0x21')]);_0xc2a277[_0x34f7('0x1f')]=qs[_0x34f7('0x1f')](_0x1ab60e['query'][_0x34f7('0x1f')]);}_0xc2a277[_0x34f7('0x39')]=qs[_0x34f7('0x3a')](_0x1ab60e[_0x34f7('0x31')]['sort']);_0xc2a277['where']=qs['filters'](_[_0x34f7('0x3b')](_0x1ab60e[_0x34f7('0x31')],_0x5d0b55[_0x34f7('0x33')]),_0x42acea);if(_0x1ab60e['query'][_0x34f7('0x3c')]){_0xc2a277['where']=_[_0x34f7('0x3d')](_0xc2a277['where'],{'$or':_[_0x34f7('0x30')](_0x42acea,function(_0x156224){if(_0x156224[_0x34f7('0x3e')]!=='VIRTUAL'){var _0x57f361={};_0x57f361[_0x156224[_0x34f7('0x2a')]]={'$like':'%'+_0x1ab60e[_0x34f7('0x31')][_0x34f7('0x3c')]+'%'};return _0x57f361;}})});}_0xc2a277=_[_0x34f7('0x3d')]({},_0xc2a277,_0x1ab60e[_0x34f7('0x3f')]);var _0x4cf5b7={'where':_0xc2a277[_0x34f7('0x40')]};return db[_0x34f7('0x41')][_0x34f7('0x22')](_0x4cf5b7)[_0x34f7('0x25')](function(_0x1d739e){_0x2cd77e[_0x34f7('0x22')]=_0x1d739e;if(_0x1ab60e[_0x34f7('0x31')][_0x34f7('0x42')]){_0xc2a277[_0x34f7('0x43')]=[{'all':!![]}];}return db[_0x34f7('0x41')][_0x34f7('0x44')](_0xc2a277);})['then'](function(_0x1e68e3){_0x2cd77e[_0x34f7('0x45')]=_0x1e68e3;return _0x2cd77e;})[_0x34f7('0x25')](respondWithFilteredResult(_0x3c6718,_0xc2a277))['catch'](handleError(_0x3c6718,null));};exports[_0x34f7('0x46')]=function(_0x28d9cd,_0x113119){var _0x2baefe={'raw':![],'where':{'id':_0x28d9cd['params']['id']}},_0x11f73e={};_0x11f73e['model']=_[_0x34f7('0x32')](db['Team'][_0x34f7('0x2c')]);_0x11f73e[_0x34f7('0x31')]=_['keys'](_0x28d9cd['query']);_0x11f73e[_0x34f7('0x33')]=_[_0x34f7('0x34')](_0x11f73e[_0x34f7('0x2f')],_0x11f73e[_0x34f7('0x31')]);_0x2baefe[_0x34f7('0x35')]=_[_0x34f7('0x34')](_0x11f73e[_0x34f7('0x2f')],qs['fields'](_0x28d9cd[_0x34f7('0x31')][_0x34f7('0x36')]));_0x2baefe['attributes']=_0x2baefe[_0x34f7('0x35')][_0x34f7('0x37')]?_0x2baefe[_0x34f7('0x35')]:_0x11f73e['model'];if(_0x28d9cd[_0x34f7('0x31')][_0x34f7('0x42')]){_0x2baefe['include']=[{'all':!![]}];}_0x2baefe=_[_0x34f7('0x3d')]({},_0x2baefe,_0x28d9cd[_0x34f7('0x3f')]);return db[_0x34f7('0x41')][_0x34f7('0x47')](_0x2baefe)[_0x34f7('0x25')](handleEntityNotFound(_0x113119,null))['then'](respondWithResult(_0x113119,null))[_0x34f7('0x48')](handleError(_0x113119,null));};exports[_0x34f7('0x49')]=function(_0x178660,_0x1bef87){return db['Team'][_0x34f7('0x49')](_0x178660[_0x34f7('0x4a')],{})[_0x34f7('0x25')](function(_0x371a3c){var _0x14da16=_0x178660['user'][_0x34f7('0x4b')]({'plain':!![]});if(!_0x14da16)throw new Error(_0x34f7('0x4c'));if(_0x14da16[_0x34f7('0x4d')]===_0x34f7('0x4e')){var _0x747dc=_0x371a3c[_0x34f7('0x4b')]({'plain':!![]});var _0x527fd5=_0x34f7('0x26');return db[_0x34f7('0x4f')][_0x34f7('0x47')]({'where':{'name':_0x527fd5,'userProfileId':_0x14da16[_0x34f7('0x50')]},'raw':!![]})[_0x34f7('0x25')](function(_0x3ac429){if(_0x3ac429&&_0x3ac429[_0x34f7('0x51')]===0x0){return db[_0x34f7('0x27')][_0x34f7('0x49')]({'name':_0x747dc['name'],'resourceId':_0x747dc['id'],'type':_0x3ac429[_0x34f7('0x2a')],'sectionId':_0x3ac429['id']},{})[_0x34f7('0x25')](function(){return _0x371a3c;});}else{return _0x371a3c;}})[_0x34f7('0x48')](function(_0x4f1c46){logger[_0x34f7('0x29')](_0x34f7('0x52'),_0x4f1c46);throw _0x4f1c46;});}return _0x371a3c;})[_0x34f7('0x25')](respondWithResult(_0x1bef87,0xc9))[_0x34f7('0x48')](handleError(_0x1bef87,null));};exports[_0x34f7('0x53')]=function(_0xca716f,_0x273e3d){if(_0xca716f[_0x34f7('0x4a')]['id']){delete _0xca716f['body']['id'];}return db[_0x34f7('0x41')][_0x34f7('0x47')]({'where':{'id':_0xca716f[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](handleEntityNotFound(_0x273e3d,null))[_0x34f7('0x25')](saveUpdates(_0xca716f[_0x34f7('0x4a')],null))[_0x34f7('0x25')](respondWithResult(_0x273e3d,null))[_0x34f7('0x48')](handleError(_0x273e3d,null));};exports[_0x34f7('0x28')]=function(_0x55f19a,_0x2f671e){return db[_0x34f7('0x41')]['find']({'where':{'id':_0x55f19a[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](handleEntityNotFound(_0x2f671e,null))[_0x34f7('0x25')](removeEntity(_0x2f671e,null))[_0x34f7('0x48')](handleError(_0x2f671e,null));};exports['getQueues']=function(_0x24d715,_0xffecaf,_0x495913){return db['Team']['findOne']({'where':{'id':_0x24d715[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](handleEntityNotFound(_0xffecaf,null))[_0x34f7('0x25')](function(_0x12388f){if(!_0x24d715[_0x34f7('0x31')][_0x34f7('0x55')]||!utils[_0x34f7('0x56')](_0x24d715[_0x34f7('0x31')]['channel'])){throw new db['Sequelize'][(_0x34f7('0x57'))](_0x34f7('0x58'));}var _0x2c443f={};var _0x4e79ad={};_0x4e79ad['model']=_[_0x34f7('0x32')](db[_[_0x34f7('0x59')](_0x24d715[_0x34f7('0x31')][_0x34f7('0x55')][_0x34f7('0x5a')]())+_0x34f7('0x5b')][_0x34f7('0x2c')]);_0x4e79ad['query']=_[_0x34f7('0x32')](_0x24d715['query']);_0x4e79ad[_0x34f7('0x33')]=_[_0x34f7('0x34')](_0x4e79ad[_0x34f7('0x2f')],_0x4e79ad[_0x34f7('0x31')]);_0x2c443f[_0x34f7('0x35')]=_[_0x34f7('0x34')](_0x4e79ad['model'],qs[_0x34f7('0x36')](_0x24d715[_0x34f7('0x31')][_0x34f7('0x36')]));_0x2c443f[_0x34f7('0x35')]=_0x2c443f['attributes'][_0x34f7('0x37')]?_0x2c443f[_0x34f7('0x35')]:_0x4e79ad[_0x34f7('0x2f')];_0x2c443f['limit']=qs['limit'](_0x24d715[_0x34f7('0x31')]['limit']);_0x2c443f[_0x34f7('0x1f')]=qs[_0x34f7('0x1f')](_0x24d715[_0x34f7('0x31')][_0x34f7('0x1f')]);_0x2c443f[_0x34f7('0x39')]=qs[_0x34f7('0x3a')](_0x24d715['query'][_0x34f7('0x3a')]);_0x2c443f[_0x34f7('0x40')]=qs[_0x34f7('0x33')](_[_0x34f7('0x3b')](_0x24d715['query'],_0x4e79ad[_0x34f7('0x33')]));_0x2c443f=_['merge']({},_0x2c443f,_0x24d715['options']);return _0x12388f[_0x34f7('0x4b')+_['capitalize'](_0x24d715[_0x34f7('0x31')][_0x34f7('0x55')]['toLowerCase']())+_0x34f7('0x5c')](_0x2c443f);})[_0x34f7('0x25')](respondWithResult(_0xffecaf,null))[_0x34f7('0x48')](handleError(_0xffecaf,null));};exports[_0x34f7('0x5d')]=function(_0x450d17,_0x37d5df,_0x135c2d){return db['Team'][_0x34f7('0x5e')]({'where':{'id':_0x450d17[_0x34f7('0x54')]['id']}})['then'](function(_0x4f16a3){if(_0x4f16a3){if(!_0x450d17[_0x34f7('0x4a')]['channel']||!utils[_0x34f7('0x56')](_0x450d17[_0x34f7('0x4a')][_0x34f7('0x55')])){throw new db[(_0x34f7('0x5f'))][(_0x34f7('0x57'))](_0x34f7('0x58'));}return _0x4f16a3[_0x34f7('0x60')+_[_0x34f7('0x59')](_0x450d17['body'][_0x34f7('0x55')]['toLowerCase']())+_0x34f7('0x5c')](_0x450d17[_0x34f7('0x4a')]['ids']);}return null;})[_0x34f7('0x25')](handleEntityNotFound(_0x37d5df,null))[_0x34f7('0x25')](respondWithStatusCode(_0x37d5df,null))[_0x34f7('0x48')](handleError(_0x37d5df,null));};exports['removeQueues']=function(_0xf9d59d,_0x1e9dde,_0x501888){return db['Team']['findOne']({'where':{'id':_0xf9d59d[_0x34f7('0x54')]['id']}})['then'](function(_0x4edef4){if(_0x4edef4){if(!_0xf9d59d[_0x34f7('0x31')][_0x34f7('0x55')]||!utils['isValidChannel'](_0xf9d59d[_0x34f7('0x31')][_0x34f7('0x55')])){throw new db[(_0x34f7('0x5f'))][(_0x34f7('0x57'))]('Unknown\x20channel');}return _0x4edef4['remove'+_[_0x34f7('0x59')](_0xf9d59d[_0x34f7('0x31')][_0x34f7('0x55')]['toLowerCase']())+'Queues'](_0xf9d59d[_0x34f7('0x31')][_0x34f7('0x61')]);}return null;})[_0x34f7('0x25')](handleEntityNotFound(_0x1e9dde,null))['then'](respondWithStatusCode(_0x1e9dde,null))[_0x34f7('0x48')](handleError(_0x1e9dde,null));};exports[_0x34f7('0x62')]=function(_0x3c20a6,_0x1b2fbc){return db[_0x34f7('0x41')][_0x34f7('0x47')]({'where':{'id':_0x3c20a6[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](handleEntityNotFound(_0x1b2fbc,null))['then'](function(_0x29fb7c){if(_0x29fb7c){var _0x148bc6=[_0x34f7('0x63'),_0x34f7('0x64'),_0x34f7('0x65'),_0x34f7('0x66'),_0x34f7('0x67'),_0x34f7('0x68'),_0x34f7('0x69')];return db[_0x34f7('0x6a')][_0x34f7('0x6b')](function(_0x34baf4){var _0x39f64d=_[_0x34f7('0x30')](_0x148bc6,function(_0x501424){var _0x41113a={'attributes':['id',_0x34f7('0x2a')]};if(_0x501424===_0x34f7('0x63')){_0x41113a[_0x34f7('0x6c')]={'attributes':[_0x34f7('0x6d')]};}return _0x29fb7c[_0x34f7('0x4b')+_0x501424+_0x34f7('0x5c')](_0x41113a)['then'](function(_0x11a7e1){var _0x34f8ee=_[_0x34f7('0x30')](_0x11a7e1,function(_0x9cde91){var _0x7f56a3=_[_0x34f7('0x30')](_0x3c20a6[_0x34f7('0x4a')][_0x34f7('0x61')],function(_0x3a6181){var _0x59c7af={'where':{'UserId':_0x3a6181,[_0x501424+_0x34f7('0x6e')]:_0x9cde91['id']},'transaction':_0x34baf4};if(_0x501424==='Voice'){_0x59c7af[_0x34f7('0x6f')]={'penalty':_0x9cde91[_0x34f7('0x70')][_0x34f7('0x6d')]};}return db[_0x34f7('0x71')+_0x501424+'Queue'][_0x34f7('0x72')](_0x59c7af)[_0x34f7('0x25')](function(){socket[_0x34f7('0x73')]('user'+_0x501424+'Queue:save',{'UserId':_0x3a6181,[_0x501424+_0x34f7('0x6e')]:_0x9cde91['id']});if(_0x501424!==_0x34f7('0x63'))return;return db[_0x34f7('0x71')]['findAll']({'where':{'id':_0x3c20a6[_0x34f7('0x4a')]['ids'],'online':0x1},'attributes':['id',_0x34f7('0x2a'),_0x34f7('0x74'),_0x34f7('0x75'),'interface'],'raw':!![]})[_0x34f7('0x25')](function(_0x14dbf2){var _0x43de8c=_['map'](_0x14dbf2,function(_0x3c74a4){return db['UserVoiceQueueRt'][_0x34f7('0x76')]({'membername':_0x3c74a4[_0x34f7('0x2a')],'UserId':_0x3c74a4['id'],'queue_name':_0x9cde91[_0x34f7('0x2a')],'VoiceQueueId':_0x9cde91['id'],'interface':_[_0x34f7('0x77')](_0x3c74a4[_0x34f7('0x78')])?util[_0x34f7('0x79')](_0x34f7('0x7a'),_0x3c74a4['name']):_0x3c74a4[_0x34f7('0x78')],'paused':_0x3c74a4[_0x34f7('0x75')]||![],'penalty':_0x9cde91[_0x34f7('0x70')]['penalty']},{'transaction':_0x34baf4});});return Promise[_0x34f7('0x7b')](_0x43de8c);});});});return Promise[_0x34f7('0x7b')](_0x7f56a3);});return Promise[_0x34f7('0x7b')](_0x34f8ee);})[_0x34f7('0x25')](function(){var _0x25a5a9=JSON[_0x34f7('0x7c')]('['+_0x3c20a6[_0x34f7('0x4a')][_0x34f7('0x61')]+']');db['TeamVoicePrefix'][_0x34f7('0x5e')]({'where':{'teamId':_0x3c20a6[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](function(_0x5cb379){if(_0x5cb379){for(var _0xd87305=0x0;_0xd87305<_0x25a5a9[_0x34f7('0x37')];_0xd87305++){var _0x3aeec7=_0x25a5a9[_0xd87305];db[_0x34f7('0x7d')]['upsert']({'UserId':_0x3aeec7,'VoicePrefixId':_0x5cb379[_0x34f7('0x7e')]});}}});});});return Promise['all'](_0x39f64d)[_0x34f7('0x25')](function(){return _0x29fb7c['addAgents'](_0x3c20a6[_0x34f7('0x4a')][_0x34f7('0x61')],{'transaction':_0x34baf4})[_0x34f7('0x7f')](function(_0x1211cc){return _0x1211cc;});});});}})['then'](respondWithResult(_0x1b2fbc,null))[_0x34f7('0x48')](handleError(_0x1b2fbc,null));};exports[_0x34f7('0x80')]=function(_0x47da66,_0x3f870a){return db[_0x34f7('0x41')][_0x34f7('0x47')]({'where':{'id':_0x47da66[_0x34f7('0x54')]['id']}})['then'](handleEntityNotFound(_0x3f870a,null))[_0x34f7('0x25')](function(_0xc29d1c){if(_0xc29d1c){var _0x10d3c3=[_0x34f7('0x63'),'Chat','Mail',_0x34f7('0x66'),'Fax',_0x34f7('0x68'),_0x34f7('0x69')];return db[_0x34f7('0x6a')][_0x34f7('0x6b')](function(_0x25ad15){var _0x5eb5d6=_[_0x34f7('0x30')](_0x10d3c3,function(_0x292d47){var _0x360d49={'attributes':['id','name']};return _0xc29d1c['get'+_0x292d47+_0x34f7('0x5c')](_0x360d49)[_0x34f7('0x25')](function(_0x5eb232){var _0x1c1819=_['map'](_0x5eb232,function(_0x64de20){return _0x64de20[_0x34f7('0x80')](_0x47da66[_0x34f7('0x31')][_0x34f7('0x61')],{'transaction':_0x25ad15})[_0x34f7('0x25')](function(){var _0x328147=JSON[_0x34f7('0x7c')]('['+_0x47da66[_0x34f7('0x31')][_0x34f7('0x61')]+']');var _0x23ca9b=_['map'](_0x328147,function(_0x41cb10){socket[_0x34f7('0x73')](_0x34f7('0x4e')+_0x292d47+_0x34f7('0x81'),{'UserId':Number(_0x41cb10),[_0x292d47+_0x34f7('0x6e')]:_0x64de20['id']});if(_0x292d47!==_0x34f7('0x63'))return;return db[_0x34f7('0x82')][_0x34f7('0x28')]({'where':{'VoiceQueueId':_0x64de20['id'],'UserId':_0x41cb10},'transaction':_0x25ad15});});return Promise[_0x34f7('0x7b')](_0x23ca9b);});});return Promise[_0x34f7('0x7b')](_0x1c1819);});});return Promise[_0x34f7('0x7b')](_0x5eb5d6)['then'](function(){return _0xc29d1c[_0x34f7('0x80')](_0x47da66[_0x34f7('0x31')]['ids'],{'transaction':_0x25ad15});})[_0x34f7('0x25')](function(){var _0x257374=JSON['parse']('['+_0x47da66[_0x34f7('0x31')][_0x34f7('0x61')]+']');db[_0x34f7('0x83')][_0x34f7('0x5e')]({'where':{'teamId':_0x47da66[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](function(_0x56229b){if(_0x56229b){for(var _0x15d36a=0x0;_0x15d36a<_0x257374[_0x34f7('0x37')];_0x15d36a++){var _0x33f4c4=_0x257374[_0x15d36a];db['UserVoicePrefix'][_0x34f7('0x28')]({'where':{'UserId':_0x33f4c4,'VoicePrefixId':_0x56229b['VoicePrefixId']}});}}});});});}})[_0x34f7('0x25')](respondWithStatusCode(_0x3f870a,null))[_0x34f7('0x48')](handleError(_0x3f870a,null));};exports[_0x34f7('0x84')]=function(_0xc9d499,_0x24918c,_0xa14a60){var _0x56c9cd={};var _0x35bad={};var _0x4b5af3;var _0x144c3f;return db[_0x34f7('0x41')][_0x34f7('0x5e')]({'where':{'id':_0xc9d499[_0x34f7('0x54')]['id']}})[_0x34f7('0x25')](handleEntityNotFound(_0x24918c,null))['then'](function(_0x12b841){if(_0x12b841){_0x4b5af3=_0x12b841;_0x35bad['model']=_['keys'](db['User'][_0x34f7('0x2c')]);_0x35bad[_0x34f7('0x31')]=_['keys'](_0xc9d499['query']);_0x35bad[_0x34f7('0x33')]=_[_0x34f7('0x34')](_0x35bad[_0x34f7('0x2f')],_0x35bad['query']);_0x56c9cd[_0x34f7('0x35')]=_[_0x34f7('0x34')](_0x35bad[_0x34f7('0x2f')],qs[_0x34f7('0x36')](_0xc9d499[_0x34f7('0x31')][_0x34f7('0x36')]));_0x56c9cd[_0x34f7('0x35')]=_0x56c9cd[_0x34f7('0x35')][_0x34f7('0x37')]?_0x56c9cd[_0x34f7('0x35')]:_0x35bad[_0x34f7('0x2f')];_0x56c9cd[_0x34f7('0x39')]=qs[_0x34f7('0x3a')](_0xc9d499['query'][_0x34f7('0x3a')]);_0x56c9cd['where']=qs[_0x34f7('0x33')](_[_0x34f7('0x3b')](_0xc9d499[_0x34f7('0x31')],_0x35bad['filters']));if(_0xc9d499[_0x34f7('0x31')][_0x34f7('0x3c')]){_0x56c9cd['where']=_['merge'](_0x56c9cd[_0x34f7('0x40')],{'$or':_[_0x34f7('0x30')](_0x56c9cd['attributes'],function(_0x35d635){var _0x5af331={};_0x5af331[_0x35d635]={'$like':'%'+_0xc9d499[_0x34f7('0x31')][_0x34f7('0x3c')]+'%'};return _0x5af331;})});}_0x56c9cd=_[_0x34f7('0x3d')]({},_0x56c9cd,_0xc9d499[_0x34f7('0x3f')]);return _0x4b5af3[_0x34f7('0x84')](_0x56c9cd);}})[_0x34f7('0x25')](function(_0xaa8fd8){if(_0xaa8fd8){_0x144c3f=_0xaa8fd8['length'];if(!_0xc9d499[_0x34f7('0x31')]['hasOwnProperty'](_0x34f7('0x38'))){_0x56c9cd[_0x34f7('0x21')]=qs[_0x34f7('0x21')](_0xc9d499[_0x34f7('0x31')][_0x34f7('0x21')]);_0x56c9cd[_0x34f7('0x1f')]=qs[_0x34f7('0x1f')](_0xc9d499['query']['offset']);}return _0x4b5af3['getAgents'](_0x56c9cd);}})[_0x34f7('0x25')](function(_0x44af13){if(_0x44af13){return _0x44af13?{'count':_0x144c3f,'rows':_0x44af13}:null;}})[_0x34f7('0x25')](respondWithResult(_0x24918c,null))[_0x34f7('0x48')](handleError(_0x24918c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0547c91..140e43e 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 _0xdd53=['update','emit','hasOwnProperty','exports','events','Team','setMaxListeners','save'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xdd53,0xcc));var _0x3dd5=function(_0x4b4f0f,_0x3a734f){_0x4b4f0f=_0x4b4f0f-0x0;var _0x5269f4=_0xdd53[_0x4b4f0f];return _0x5269f4;};'use strict';var EventEmitter=require(_0x3dd5('0x0'));var Team=require('../../mysqldb')['db'][_0x3dd5('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x3dd5('0x2')](0x0);var events={'afterCreate':_0x3dd5('0x3'),'afterUpdate':_0x3dd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x26ac69){return function(_0x1f21a2,_0x2ee11d,_0x371f14){TeamEvents[_0x3dd5('0x5')](_0x26ac69+':'+_0x1f21a2['id'],_0x1f21a2);TeamEvents['emit'](_0x26ac69,_0x1f21a2);_0x371f14(null);};}for(var e in events){if(events[_0x3dd5('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x3dd5('0x7')]=TeamEvents; \ No newline at end of file +var _0x29b0=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xbe4931,_0x4152f8){var _0x3342f0=function(_0x2c0376){while(--_0x2c0376){_0xbe4931['push'](_0xbe4931['shift']());}};_0x3342f0(++_0x4152f8);}(_0x29b0,0x8b));var _0x029b=function(_0x53fe41,_0xfd7e0d){_0x53fe41=_0x53fe41-0x0;var _0x4d7d13=_0x29b0[_0x53fe41];return _0x4d7d13;};'use strict';var EventEmitter=require('events');var Team=require(_0x029b('0x0'))['db'][_0x029b('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x029b('0x2')](0x0);var events={'afterCreate':_0x029b('0x3'),'afterUpdate':_0x029b('0x4'),'afterDestroy':_0x029b('0x5')};function emitEvent(_0x289a6c){return function(_0x31c1b9,_0x3d4e0f,_0x659fb5){TeamEvents[_0x029b('0x6')](_0x289a6c+':'+_0x31c1b9['id'],_0x31c1b9);TeamEvents[_0x029b('0x6')](_0x289a6c,_0x31c1b9);_0x659fb5(null);};}for(var e in events){if(events[_0x029b('0x7')](e)){var event=events[e];Team[_0x029b('0x8')](e,emitEvent(event));}}module[_0x029b('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0d85bcb..0405a87 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 _0xcee8=['../../config/environment','./team.attributes','exports','define','Team','teams','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcee8,0xc9));var _0x8cee=function(_0x58afec,_0x44aef1){_0x58afec=_0x58afec-0x0;var _0x3a4265=_0xcee8[_0x58afec];return _0x3a4265;};'use strict';var _=require(_0x8cee('0x0'));var util=require('util');var logger=require(_0x8cee('0x1'))(_0x8cee('0x2'));var moment=require(_0x8cee('0x3'));var BPromise=require(_0x8cee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cee('0x5'));var rimraf=require(_0x8cee('0x6'));var config=require(_0x8cee('0x7'));var attributes=require(_0x8cee('0x8'));module[_0x8cee('0x9')]=function(_0x2ddc22,_0x35db75){return _0x2ddc22[_0x8cee('0xa')](_0x8cee('0xb'),attributes,{'tableName':_0x8cee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd68=['rimraf','../../config/environment','Team','teams','lodash','../../config/logger','api','bluebird'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xdd68,0xa4));var _0x8dd6=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0xdd68[_0x4c7b20];return _0x4872bd;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var logger=require(_0x8dd6('0x1'))(_0x8dd6('0x2'));var moment=require('moment');var BPromise=require(_0x8dd6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8dd6('0x4'));var config=require(_0x8dd6('0x5'));var attributes=require('./team.attributes');module['exports']=function(_0x54a666,_0x3a94c6){return _0x54a666['define'](_0x8dd6('0x6'),attributes,{'tableName':_0x8dd6('0x7'),'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 9a8a91c..93f47a2 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 _0x87cc=['lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','Team,\x20%s,\x20%s','error','message','result','catch'];(function(_0x51d958,_0x51c6fe){var _0x61874b=function(_0x49eeb9){while(--_0x49eeb9){_0x51d958['push'](_0x51d958['shift']());}};_0x61874b(++_0x51c6fe);}(_0x87cc,0x138));var _0xc87c=function(_0x249618,_0x56506e){_0x249618=_0x249618-0x0;var _0x1fccd8=_0x87cc[_0x249618];return _0x1fccd8;};'use strict';var _=require(_0xc87c('0x0'));var util=require(_0xc87c('0x1'));var moment=require(_0xc87c('0x2'));var BPromise=require(_0xc87c('0x3'));var rs=require(_0xc87c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc87c('0x5'));var config=require('../../config/environment');var jayson=require(_0xc87c('0x6'));var client=jayson[_0xc87c('0x7')][_0xc87c('0x8')]({'port':0x232a});config[_0xc87c('0x9')]=_[_0xc87c('0xa')](config[_0xc87c('0x9')],{'host':_0xc87c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc87c('0x9')]));require(_0xc87c('0xc'))[_0xc87c('0xd')](socket);function respondWithRpcPromise(_0x4ffcf6,_0x41df40,_0x1fd6de){return new BPromise(function(_0xcff871,_0x2a85a4){return client[_0xc87c('0xe')](_0x4ffcf6,_0x1fd6de)[_0xc87c('0xf')](function(_0x1f9b47){logger[_0xc87c('0x10')]('Team,\x20%s,\x20%s',_0x41df40,'request\x20sent');logger[_0xc87c('0x11')](_0xc87c('0x12'),_0x41df40,_0xc87c('0x13'),JSON[_0xc87c('0x14')](_0x1f9b47));if(_0x1f9b47['error']){if(_0x1f9b47['error']['code']===0x1f4){logger['error'](_0xc87c('0x15'),_0x41df40,_0x1f9b47['error']['message']);return _0x2a85a4(_0x1f9b47[_0xc87c('0x16')]['message']);}logger[_0xc87c('0x16')](_0xc87c('0x15'),_0x41df40,_0x1f9b47[_0xc87c('0x16')]['message']);return _0xcff871(_0x1f9b47[_0xc87c('0x16')][_0xc87c('0x17')]);}else{logger['info'](_0xc87c('0x15'),_0x41df40,_0xc87c('0x13'));_0xcff871(_0x1f9b47[_0xc87c('0x18')][_0xc87c('0x17')]);}})[_0xc87c('0x19')](function(_0xcf96da){logger[_0xc87c('0x16')](_0xc87c('0x15'),_0x41df40,_0xcf96da);_0x2a85a4(_0xcf96da);});});} \ No newline at end of file +var _0x3fea=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3fea,0x1bc));var _0xa3fe=function(_0x1fc3f1,_0x19f789){_0x1fc3f1=_0x1fc3f1-0x0;var _0x4c6b75=_0x3fea[_0x1fc3f1];return _0x4c6b75;};'use strict';var _=require(_0xa3fe('0x0'));var util=require(_0xa3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3fe('0x2'));var fs=require('fs');var Redis=require(_0xa3fe('0x3'));var db=require(_0xa3fe('0x4'))['db'];var utils=require(_0xa3fe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa3fe('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3fe('0x7')][_0xa3fe('0x8')]({'port':0x232a});config[_0xa3fe('0x9')]=_[_0xa3fe('0xa')](config[_0xa3fe('0x9')],{'host':_0xa3fe('0xb'),'port':0x18eb});var socket=require(_0xa3fe('0xc'))(new Redis(config['redis']));require(_0xa3fe('0xd'))[_0xa3fe('0xe')](socket);function respondWithRpcPromise(_0x23af2f,_0x10b2de,_0x1cd3c4){return new BPromise(function(_0x528b87,_0x217cdc){return client[_0xa3fe('0xf')](_0x23af2f,_0x1cd3c4)['then'](function(_0x1b38bd){logger[_0xa3fe('0x10')](_0xa3fe('0x11'),_0x10b2de,'request\x20sent');logger[_0xa3fe('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x10b2de,_0xa3fe('0x13'),JSON['stringify'](_0x1b38bd));if(_0x1b38bd[_0xa3fe('0x14')]){if(_0x1b38bd['error'][_0xa3fe('0x15')]===0x1f4){logger[_0xa3fe('0x14')](_0xa3fe('0x11'),_0x10b2de,_0x1b38bd['error'][_0xa3fe('0x16')]);return _0x217cdc(_0x1b38bd[_0xa3fe('0x14')]['message']);}logger[_0xa3fe('0x14')](_0xa3fe('0x11'),_0x10b2de,_0x1b38bd['error'][_0xa3fe('0x16')]);return _0x528b87(_0x1b38bd[_0xa3fe('0x14')][_0xa3fe('0x16')]);}else{logger[_0xa3fe('0x10')](_0xa3fe('0x11'),_0x10b2de,_0xa3fe('0x13'));_0x528b87(_0x1b38bd[_0xa3fe('0x17')][_0xa3fe('0x16')]);}})[_0xa3fe('0x18')](function(_0x425e2a){logger[_0xa3fe('0x14')](_0xa3fe('0x11'),_0x10b2de,_0x425e2a);_0x217cdc(_0x425e2a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f1b1ea6..f2ad340 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 _0x39aa=['team:','./team.events','save','update','emit','length'];(function(_0x5ada5a,_0x3ee217){var _0x2bf9ed=function(_0x201fb8){while(--_0x201fb8){_0x5ada5a['push'](_0x5ada5a['shift']());}};_0x2bf9ed(++_0x3ee217);}(_0x39aa,0x11b));var _0xa39a=function(_0x527dc5,_0x1de7e7){_0x527dc5=_0x527dc5-0x0;var _0x216de9=_0x39aa[_0x527dc5];return _0x216de9;};'use strict';var TeamEvents=require(_0xa39a('0x0'));var events=[_0xa39a('0x1'),'remove',_0xa39a('0x2')];function createListener(_0x443cb7,_0x248dac){return function(_0x155fe9){_0x248dac[_0xa39a('0x3')](_0x443cb7,_0x155fe9);};}function removeListener(_0x42be13,_0x5ec240){return function(){TeamEvents['removeListener'](_0x42be13,_0x5ec240);};}exports['register']=function(_0x3dba2c){for(var _0x911d67=0x0,_0x2ab0fe=events[_0xa39a('0x4')];_0x911d67<_0x2ab0fe;_0x911d67++){var _0xfd86fe=events[_0x911d67];var _0x1106eb=createListener(_0xa39a('0x5')+_0xfd86fe,_0x3dba2c);TeamEvents['on'](_0xfd86fe,_0x1106eb);}}; \ No newline at end of file +var _0x1120=['./team.events','save','remove','emit','removeListener','register','length','team:'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x1120,0x140));var _0x0112=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1120[_0x34bf97];return _0x292719;};'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 c593b5e..656790a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x48571f,_0x4c86f4){var _0x495a93=function(_0x4928b7){while(--_0x4928b7){_0x48571f['push'](_0x48571f['shift']());}};_0x495a93(++_0x4c86f4);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f921b,_0x24807a){var _0x5d431c=function(_0x13fbb0){while(--_0x13fbb0){_0x4f921b['push'](_0x4f921b['shift']());}};_0x5d431c(++_0x24807a);}(_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/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5929a70..409ac14 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 _0x3bc8=['INTEGER','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x2e2a10,_0x55f9f5){_0x2e2a10=_0x2e2a10-0x0;var _0x5ad6cd=_0x3bc8[_0x2e2a10];return _0x5ad6cd;};'use strict';var Sequelize=require('sequelize');module[_0x83bc('0x0')]={'TeamId':{'type':Sequelize[_0x83bc('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x83bc('0x1')]}}; \ No newline at end of file +var _0x22fb=['INTEGER'];(function(_0x5e877c,_0x241912){var _0x4664cd=function(_0x26a90e){while(--_0x26a90e){_0x5e877c['push'](_0x5e877c['shift']());}};_0x4664cd(++_0x241912);}(_0x22fb,0x192));var _0xb22f=function(_0x14a928,_0x5ef752){_0x14a928=_0x14a928-0x0;var _0x1a75b6=_0x22fb[_0x14a928];return _0x1a75b6;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0xb22f('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2a3e3f5..7babd2c 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 _0xb09d=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x8c69be,_0x1cd59c){var _0x1f2b7e=function(_0x16651e){while(--_0x16651e){_0x8c69be['push'](_0x8c69be['shift']());}};_0x1f2b7e(++_0x1cd59c);}(_0xb09d,0xed));var _0xdb09=function(_0x3a8eda,_0x15c0f2){_0x3a8eda=_0x3a8eda-0x0;var _0x4f4565=_0xb09d[_0x3a8eda];return _0x4f4565;};'use strict';var _=require(_0xdb09('0x0'));var util=require(_0xdb09('0x1'));var logger=require(_0xdb09('0x2'))(_0xdb09('0x3'));var moment=require(_0xdb09('0x4'));var BPromise=require(_0xdb09('0x5'));var rp=require(_0xdb09('0x6'));var fs=require('fs');var path=require(_0xdb09('0x7'));var rimraf=require('rimraf');var config=require(_0xdb09('0x8'));var attributes=require(_0xdb09('0x9'));module[_0xdb09('0xa')]=function(_0xd2e98f,_0x181d74){return _0xd2e98f[_0xdb09('0xb')](_0xdb09('0xc'),attributes,{'tableName':_0xdb09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e5e=['define','team_has_voice_prefixes','lodash','util','api','moment','bluebird','path','../../config/environment','./teamVoicePrefix.attributes'];(function(_0xaaeced,_0x28aefc){var _0x2c7ff3=function(_0x5ad9f8){while(--_0x5ad9f8){_0xaaeced['push'](_0xaaeced['shift']());}};_0x2c7ff3(++_0x28aefc);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x9e5e[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xe9e5('0x0'));var util=require(_0xe9e5('0x1'));var logger=require('../../config/logger')(_0xe9e5('0x2'));var moment=require(_0xe9e5('0x3'));var BPromise=require(_0xe9e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9e5('0x5'));var rimraf=require('rimraf');var config=require(_0xe9e5('0x6'));var attributes=require(_0xe9e5('0x7'));module['exports']=function(_0x5c09f0,_0xf4d974){return _0x5c09f0[_0xe9e5('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0xe9e5('0x9'),'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 d74ca98..069886c 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 _0xe890=['request\x20sent','stringify','error','code','message','TeamVoicePrefix,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','debug'];(function(_0x16f52d,_0x21a696){var _0x3c278c=function(_0x5458bb){while(--_0x5458bb){_0x16f52d['push'](_0x16f52d['shift']());}};_0x3c278c(++_0x21a696);}(_0xe890,0x85));var _0x0e89=function(_0x3fb49,_0x516bbc){_0x3fb49=_0x3fb49-0x0;var _0x43f19c=_0xe890[_0x3fb49];return _0x43f19c;};'use strict';var _=require(_0x0e89('0x0'));var util=require(_0x0e89('0x1'));var moment=require(_0x0e89('0x2'));var BPromise=require(_0x0e89('0x3'));var rs=require(_0x0e89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e89('0x5'))['db'];var utils=require(_0x0e89('0x6'));var logger=require(_0x0e89('0x7'))(_0x0e89('0x8'));var config=require(_0x0e89('0x9'));var jayson=require(_0x0e89('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1977bd,_0x32a03d,_0x664b71){return new BPromise(function(_0x131586,_0x45820f){return client['request'](_0x1977bd,_0x664b71)[_0x0e89('0xb')](function(_0x49b1a1){logger[_0x0e89('0xc')]('TeamVoicePrefix,\x20%s,\x20%s',_0x32a03d,'request\x20sent');logger[_0x0e89('0xd')]('TeamVoicePrefix,\x20%s,\x20%s,\x20%s',_0x32a03d,_0x0e89('0xe'),JSON[_0x0e89('0xf')](_0x49b1a1));if(_0x49b1a1[_0x0e89('0x10')]){if(_0x49b1a1['error'][_0x0e89('0x11')]===0x1f4){logger['error']('TeamVoicePrefix,\x20%s,\x20%s',_0x32a03d,_0x49b1a1[_0x0e89('0x10')]['message']);return _0x45820f(_0x49b1a1[_0x0e89('0x10')][_0x0e89('0x12')]);}logger['error'](_0x0e89('0x13'),_0x32a03d,_0x49b1a1[_0x0e89('0x10')][_0x0e89('0x12')]);return _0x131586(_0x49b1a1[_0x0e89('0x10')]['message']);}else{logger[_0x0e89('0xc')](_0x0e89('0x13'),_0x32a03d,_0x0e89('0xe'));_0x131586(_0x49b1a1[_0x0e89('0x14')]['message']);}})['catch'](function(_0x5dc91f){logger[_0x0e89('0x10')](_0x0e89('0x13'),_0x32a03d,_0x5dc91f);_0x45820f(_0x5dc91f);});});} \ No newline at end of file +var _0x4edd=['TeamVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','TeamVoicePrefix,\x20%s,\x20%s'];(function(_0x1419f9,_0x4df6ab){var _0xdc2a6e=function(_0x13f1ca){while(--_0x13f1ca){_0x1419f9['push'](_0x1419f9['shift']());}};_0xdc2a6e(++_0x4df6ab);}(_0x4edd,0x92));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var moment=require(_0xd4ed('0x2'));var BPromise=require(_0xd4ed('0x3'));var rs=require(_0xd4ed('0x4'));var fs=require('fs');var Redis=require(_0xd4ed('0x5'));var db=require(_0xd4ed('0x6'))['db'];var utils=require(_0xd4ed('0x7'));var logger=require(_0xd4ed('0x8'))(_0xd4ed('0x9'));var config=require('../../config/environment');var jayson=require(_0xd4ed('0xa'));var client=jayson['client'][_0xd4ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e3751,_0x1aa566,_0x5f2c51){return new BPromise(function(_0x1f3ea3,_0x6a98ab){return client['request'](_0x4e3751,_0x5f2c51)[_0xd4ed('0xc')](function(_0x57a2af){logger[_0xd4ed('0xd')](_0xd4ed('0xe'),_0x1aa566,'request\x20sent');logger['debug'](_0xd4ed('0xf'),_0x1aa566,'request\x20sent',JSON[_0xd4ed('0x10')](_0x57a2af));if(_0x57a2af['error']){if(_0x57a2af[_0xd4ed('0x11')][_0xd4ed('0x12')]===0x1f4){logger[_0xd4ed('0x11')]('TeamVoicePrefix,\x20%s,\x20%s',_0x1aa566,_0x57a2af[_0xd4ed('0x11')]['message']);return _0x6a98ab(_0x57a2af[_0xd4ed('0x11')]['message']);}logger['error'](_0xd4ed('0xe'),_0x1aa566,_0x57a2af[_0xd4ed('0x11')][_0xd4ed('0x13')]);return _0x1f3ea3(_0x57a2af[_0xd4ed('0x11')]['message']);}else{logger[_0xd4ed('0xd')](_0xd4ed('0xe'),_0x1aa566,_0xd4ed('0x14'));_0x1f3ea3(_0x57a2af[_0xd4ed('0x15')][_0xd4ed('0x13')]);}})[_0xd4ed('0x16')](function(_0x742fec){logger[_0xd4ed('0x11')]('TeamVoicePrefix,\x20%s,\x20%s',_0x1aa566,_0x742fec);_0x6a98ab(_0x742fec);});});} \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 9aa01b0..e15ccde 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(_0x443bc5,_0x501372){var _0x2f3502=function(_0x2f9b8e){while(--_0x2f9b8e){_0x443bc5['push'](_0x443bc5['shift']());}};_0x2f3502(++_0x501372);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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(_0x314079,_0x2b98a0){var _0x423351=function(_0x501dcc){while(--_0x501dcc){_0x314079['push'](_0x314079['shift']());}};_0x423351(++_0x2b98a0);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c40f540..2e4aa84 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 _0xd3f1=['exports','INTEGER'];(function(_0x43ca7b,_0x291b8c){var _0x4606bd=function(_0xfbdb0e){while(--_0xfbdb0e){_0x43ca7b['push'](_0x43ca7b['shift']());}};_0x4606bd(++_0x291b8c);}(_0xd3f1,0x1ba));var _0x1d3f=function(_0x4db3f7,_0x47952c){_0x4db3f7=_0x4db3f7-0x0;var _0x3f8a76=_0xd3f1[_0x4db3f7];return _0x3f8a76;};'use strict';var Sequelize=require('sequelize');module[_0x1d3f('0x0')]={'penalty':{'type':Sequelize[_0x1d3f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x692a=['exports','sequelize'];(function(_0x29f3dd,_0x564f97){var _0x24b45a=function(_0x1b7eb2){while(--_0x1b7eb2){_0x29f3dd['push'](_0x29f3dd['shift']());}};_0x24b45a(++_0x564f97);}(_0x692a,0x171));var _0xa692=function(_0x4cb183,_0x3258be){_0x4cb183=_0x4cb183-0x0;var _0x460efc=_0x692a[_0x4cb183];return _0x460efc;};'use strict';var Sequelize=require(_0xa692('0x0'));module[_0xa692('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 2d072b4..7803d16 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 _0x0f3c=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','util','bluebird'];(function(_0x41ae4f,_0x20e57f){var _0x18a5a1=function(_0x122c83){while(--_0x122c83){_0x41ae4f['push'](_0x41ae4f['shift']());}};_0x18a5a1(++_0x20e57f);}(_0x0f3c,0x189));var _0xc0f3=function(_0x5b5f2d,_0x57d847){_0x5b5f2d=_0x5b5f2d-0x0;var _0x7a1c6e=_0x0f3c[_0x5b5f2d];return _0x7a1c6e;};'use strict';var _=require(_0xc0f3('0x0'));var util=require(_0xc0f3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc0f3('0x2'));var rp=require(_0xc0f3('0x3'));var fs=require('fs');var path=require(_0xc0f3('0x4'));var rimraf=require(_0xc0f3('0x5'));var config=require(_0xc0f3('0x6'));var attributes=require(_0xc0f3('0x7'));module[_0xc0f3('0x8')]=function(_0x256643,_0x4b76a0){return _0x256643[_0xc0f3('0x9')](_0xc0f3('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2392=['exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x3f20b3,_0x4382b5){var _0x4fd697=function(_0x5708aa){while(--_0x5708aa){_0x3f20b3['push'](_0x3f20b3['shift']());}};_0x4fd697(++_0x4382b5);}(_0x2392,0xd0));var _0x2239=function(_0x59d8d6,_0x4a8b75){_0x59d8d6=_0x59d8d6-0x0;var _0x19c450=_0x2392[_0x59d8d6];return _0x19c450;};'use strict';var _=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var logger=require('../../config/logger')(_0x2239('0x2'));var moment=require(_0x2239('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2239('0x4'));var rimraf=require(_0x2239('0x5'));var config=require(_0x2239('0x6'));var attributes=require(_0x2239('0x7'));module[_0x2239('0x8')]=function(_0x2cefd6,_0x37833e){return _0x2cefd6[_0x2239('0x9')](_0x2239('0xa'),attributes,{'tableName':_0x2239('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 bc1272c..0646220 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 _0x9a5c=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34a8da,_0x964c60){var _0x3453b1=function(_0xf66dce){while(--_0xf66dce){_0x34a8da['push'](_0x34a8da['shift']());}};_0x3453b1(++_0x964c60);}(_0x9a5c,0x184));var _0xc9a5=function(_0x5e65be,_0x52edd9){_0x5e65be=_0x5e65be-0x0;var _0xdee59d=_0x9a5c[_0x5e65be];return _0xdee59d;};'use strict';var _=require(_0xc9a5('0x0'));var util=require(_0xc9a5('0x1'));var moment=require('moment');var BPromise=require(_0xc9a5('0x2'));var rs=require(_0xc9a5('0x3'));var fs=require('fs');var Redis=require(_0xc9a5('0x4'));var db=require(_0xc9a5('0x5'))['db'];var utils=require(_0xc9a5('0x6'));var logger=require(_0xc9a5('0x7'))('rpc');var config=require(_0xc9a5('0x8'));var jayson=require(_0xc9a5('0x9'));var client=jayson[_0xc9a5('0xa')][_0xc9a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x249670,_0x226c08,_0x5136ea){return new BPromise(function(_0x5b26fe,_0x25d49e){return client['request'](_0x249670,_0x5136ea)[_0xc9a5('0xc')](function(_0x55eb56){logger[_0xc9a5('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x226c08,_0xc9a5('0xe'));logger[_0xc9a5('0xf')](_0xc9a5('0x10'),_0x226c08,_0xc9a5('0xe'),JSON[_0xc9a5('0x11')](_0x55eb56));if(_0x55eb56[_0xc9a5('0x12')]){if(_0x55eb56[_0xc9a5('0x12')]['code']===0x1f4){logger[_0xc9a5('0x12')](_0xc9a5('0x13'),_0x226c08,_0x55eb56[_0xc9a5('0x12')][_0xc9a5('0x14')]);return _0x25d49e(_0x55eb56[_0xc9a5('0x12')][_0xc9a5('0x14')]);}logger[_0xc9a5('0x12')](_0xc9a5('0x13'),_0x226c08,_0x55eb56[_0xc9a5('0x12')][_0xc9a5('0x14')]);return _0x5b26fe(_0x55eb56[_0xc9a5('0x12')][_0xc9a5('0x14')]);}else{logger[_0xc9a5('0xd')](_0xc9a5('0x13'),_0x226c08,_0xc9a5('0xe'));_0x5b26fe(_0x55eb56['result']['message']);}})[_0xc9a5('0x15')](function(_0x2746bb){logger[_0xc9a5('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x226c08,_0x2746bb);_0x25d49e(_0x2746bb);});});} \ No newline at end of file +var _0x22fb=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2c7e54,_0x5010d1){var _0x44056b=function(_0x1cbd24){while(--_0x1cbd24){_0x2c7e54['push'](_0x2c7e54['shift']());}};_0x44056b(++_0x5010d1);}(_0x22fb,0x192));var _0xb22f=function(_0x42a07d,_0x358ba4){_0x42a07d=_0x42a07d-0x0;var _0x1803fc=_0x22fb[_0x42a07d];return _0x1803fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 123c333..be1bb01 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 _0x1fcc=['post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x44c44b,_0x57e40d){var _0xb29ca8=function(_0x1fea49){while(--_0x1fea49){_0x44c44b['push'](_0x44c44b['shift']());}};_0xb29ca8(++_0x57e40d);}(_0x1fcc,0x125));var _0xc1fc=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x1fcc[_0x4df6f9];return _0x4b1a73;};'use strict';var multer=require(_0xc1fc('0x0'));var util=require(_0xc1fc('0x1'));var path=require('path');var timeout=require(_0xc1fc('0x2'));var express=require(_0xc1fc('0x3'));var router=express[_0xc1fc('0x4')]();var fs_extra=require(_0xc1fc('0x5'));var auth=require(_0xc1fc('0x6'));var interaction=require(_0xc1fc('0x7'));var config=require(_0xc1fc('0x8'));var controller=require('./template.controller');router[_0xc1fc('0x9')]('/',auth[_0xc1fc('0xa')](),controller[_0xc1fc('0xb')]);router['get'](_0xc1fc('0xc'),auth[_0xc1fc('0xa')](),controller['show']);router[_0xc1fc('0xd')]('/',auth[_0xc1fc('0xa')](),controller['create']);router[_0xc1fc('0xe')]('/:id',auth[_0xc1fc('0xa')](),controller[_0xc1fc('0xf')]);router['delete'](_0xc1fc('0xc'),auth[_0xc1fc('0xa')](),controller[_0xc1fc('0x10')]);module[_0xc1fc('0x11')]=router; \ No newline at end of file +var _0xb90a=['get','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','multer','util','connect-timeout','../../config/environment','./template.controller','index'];(function(_0x2e4e99,_0x2e55ab){var _0x47b515=function(_0xb2a2f){while(--_0xb2a2f){_0x2e4e99['push'](_0x2e4e99['shift']());}};_0x47b515(++_0x2e55ab);}(_0xb90a,0x12a));var _0xab90=function(_0x8c540d,_0x1eed5b){_0x8c540d=_0x8c540d-0x0;var _0x22ed75=_0xb90a[_0x8c540d];return _0x22ed75;};'use strict';var multer=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var path=require('path');var timeout=require(_0xab90('0x2'));var express=require('express');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(_0xab90('0x3'));var controller=require(_0xab90('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xab90('0x5')]);router[_0xab90('0x6')](_0xab90('0x7'),auth['isAuthenticated'](),controller[_0xab90('0x8')]);router[_0xab90('0x9')]('/',auth[_0xab90('0xa')](),controller[_0xab90('0xb')]);router[_0xab90('0xc')](_0xab90('0x7'),auth[_0xab90('0xa')](),controller[_0xab90('0xd')]);router['delete'](_0xab90('0x7'),auth[_0xab90('0xa')](),controller[_0xab90('0xe')]);module[_0xab90('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index e369a4c..a6585b0 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 _0xec68=['STRING','TEXT','sequelize'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xec68,0x19d));var _0x8ec6=function(_0x3d9825,_0x474d51){_0x3d9825=_0x3d9825-0x0;var _0x4018a6=_0xec68[_0x3d9825];return _0x4018a6;};'use strict';var Sequelize=require(_0x8ec6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ec6('0x1')]},'html':{'type':Sequelize[_0x8ec6('0x2')]}}; \ No newline at end of file +var _0xacf7=['sequelize','exports','STRING','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xacf7,0xb8));var _0x7acf=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xacf7[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7acf('0x0'));module[_0x7acf('0x1')]={'name':{'type':Sequelize[_0x7acf('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x7acf('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 896ebd8..0384958 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 _0xb4c0=['key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','save','update','then','destroy','get','Templates','UserProfileResource','name','map','Template','rawAttributes','fieldName','type'];(function(_0x14c9e3,_0x4c7bd5){var _0x514c33=function(_0x2e40f3){while(--_0x2e40f3){_0x14c9e3['push'](_0x14c9e3['shift']());}};_0x514c33(++_0x4c7bd5);}(_0xb4c0,0x71));var _0x0b4c=function(_0x180dda,_0x577ad9){_0x180dda=_0x180dda-0x0;var _0x5d003c=_0xb4c0[_0x180dda];return _0x5d003c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b4c('0x0'));var zipdir=require(_0x0b4c('0x1'));var jsonpatch=require(_0x0b4c('0x2'));var rp=require(_0x0b4c('0x3'));var moment=require(_0x0b4c('0x4'));var BPromise=require(_0x0b4c('0x5'));var Mustache=require(_0x0b4c('0x6'));var util=require('util');var path=require(_0x0b4c('0x7'));var sox=require('sox');var csv=require(_0x0b4c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b4c('0x9'));var _=require(_0x0b4c('0xa'));var squel=require('squel');var crypto=require(_0x0b4c('0xb'));var jsforce=require(_0x0b4c('0xc'));var deskjs=require(_0x0b4c('0xd'));var toCsv=require(_0x0b4c('0x8'));var querystring=require(_0x0b4c('0xe'));var Papa=require(_0x0b4c('0xf'));var Redis=require(_0x0b4c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b4c('0x11'));var as=require(_0x0b4c('0x12'));var hardwareService=require(_0x0b4c('0x13'));var logger=require(_0x0b4c('0x14'))(_0x0b4c('0x15'));var utils=require(_0x0b4c('0x16'));var config=require(_0x0b4c('0x17'));var licenseUtil=require(_0x0b4c('0x18'));var db=require(_0x0b4c('0x19'))['db'];function respondWithStatusCode(_0x218b86,_0x109c89){_0x109c89=_0x109c89||0xcc;return function(_0x108b28){if(_0x108b28){return _0x218b86[_0x0b4c('0x1a')](_0x109c89);}return _0x218b86[_0x0b4c('0x1b')](_0x109c89)[_0x0b4c('0x1c')]();};}function respondWithResult(_0x456ff5,_0x5dcaeb){_0x5dcaeb=_0x5dcaeb||0xc8;return function(_0x338c5c){if(_0x338c5c){return _0x456ff5[_0x0b4c('0x1b')](_0x5dcaeb)['json'](_0x338c5c);}};}function respondWithFilteredResult(_0x662d67,_0x539df2){return function(_0x22b0d9){if(_0x22b0d9){var _0x37ac58=typeof _0x539df2[_0x0b4c('0x1d')]==='undefined'&&typeof _0x539df2[_0x0b4c('0x1e')]===_0x0b4c('0x1f');var _0x19168c=_0x22b0d9['count'];var _0x513b86=_0x37ac58?0x0:_0x539df2[_0x0b4c('0x1d')];var _0x1fa474=_0x37ac58?_0x22b0d9['count']:_0x539df2[_0x0b4c('0x1d')]+_0x539df2['limit'];var _0x437a55;if(_0x1fa474>=_0x19168c){_0x1fa474=_0x19168c;_0x437a55=0xc8;}else{_0x437a55=0xce;}_0x662d67[_0x0b4c('0x1b')](_0x437a55);return _0x662d67['set']('Content-Range',_0x513b86+'-'+_0x1fa474+'/'+_0x19168c)['json'](_0x22b0d9);}return null;};}function patchUpdates(_0x394beb){return function(_0x1b7795){try{jsonpatch['apply'](_0x1b7795,_0x394beb,!![]);}catch(_0x4acced){return BPromise['reject'](_0x4acced);}return _0x1b7795[_0x0b4c('0x20')]();};}function saveUpdates(_0xf5331,_0x25973c){return function(_0x39cb5a){if(_0x39cb5a){return _0x39cb5a[_0x0b4c('0x21')](_0xf5331)[_0x0b4c('0x22')](function(_0x444cb7){return _0x444cb7;});}return null;};}function removeEntity(_0x2c450d,_0x2feff6){return function(_0x4c98a4){if(_0x4c98a4){return _0x4c98a4[_0x0b4c('0x23')]()['then'](function(){var _0x437f2d=_0x4c98a4[_0x0b4c('0x24')]({'plain':!![]});var _0x2aa3bc=_0x0b4c('0x25');return db[_0x0b4c('0x26')][_0x0b4c('0x23')]({'where':{'type':_0x2aa3bc,'resourceId':_0x437f2d['id']}})['then'](function(){return _0x4c98a4;});})['then'](function(){_0x2c450d[_0x0b4c('0x1b')](0xcc)[_0x0b4c('0x1c')]();});}};}function handleEntityNotFound(_0x1ccc05,_0x4025a7){return function(_0x5e61ba){if(!_0x5e61ba){_0x1ccc05[_0x0b4c('0x1a')](0x194);}return _0x5e61ba;};}function handleError(_0x3c2896,_0x1f9dd6){_0x1f9dd6=_0x1f9dd6||0x1f4;return function(_0x1eb71e){logger['error'](_0x1eb71e['stack']);if(_0x1eb71e['name']){delete _0x1eb71e[_0x0b4c('0x27')];}_0x3c2896[_0x0b4c('0x1b')](_0x1f9dd6)['send'](_0x1eb71e);};}exports['index']=function(_0x27a713,_0x15ffb6){var _0x559b5e={},_0x53a206={},_0x3d105d={'count':0x0,'rows':[]};var _0x2c6958=_[_0x0b4c('0x28')](db[_0x0b4c('0x29')][_0x0b4c('0x2a')],function(_0x1bee18){return{'name':_0x1bee18[_0x0b4c('0x2b')],'type':_0x1bee18[_0x0b4c('0x2c')][_0x0b4c('0x2d')]};});_0x53a206['model']=_[_0x0b4c('0x28')](_0x2c6958,'name');_0x53a206[_0x0b4c('0x2e')]=_[_0x0b4c('0x2f')](_0x27a713[_0x0b4c('0x2e')]);_0x53a206[_0x0b4c('0x30')]=_['intersection'](_0x53a206[_0x0b4c('0x31')],_0x53a206['query']);_0x559b5e[_0x0b4c('0x32')]=_[_0x0b4c('0x33')](_0x53a206[_0x0b4c('0x31')],qs['fields'](_0x27a713[_0x0b4c('0x2e')]['fields']));_0x559b5e['attributes']=_0x559b5e['attributes'][_0x0b4c('0x34')]?_0x559b5e[_0x0b4c('0x32')]:_0x53a206[_0x0b4c('0x31')];if(!_0x27a713[_0x0b4c('0x2e')][_0x0b4c('0x35')](_0x0b4c('0x36'))){_0x559b5e[_0x0b4c('0x1e')]=qs[_0x0b4c('0x1e')](_0x27a713[_0x0b4c('0x2e')][_0x0b4c('0x1e')]);_0x559b5e[_0x0b4c('0x1d')]=qs['offset'](_0x27a713['query'][_0x0b4c('0x1d')]);}_0x559b5e[_0x0b4c('0x37')]=qs[_0x0b4c('0x38')](_0x27a713[_0x0b4c('0x2e')][_0x0b4c('0x38')]);_0x559b5e[_0x0b4c('0x39')]=qs[_0x0b4c('0x30')](_[_0x0b4c('0x3a')](_0x27a713[_0x0b4c('0x2e')],_0x53a206[_0x0b4c('0x30')]),_0x2c6958);if(_0x27a713[_0x0b4c('0x2e')][_0x0b4c('0x3b')]){_0x559b5e[_0x0b4c('0x39')]=_[_0x0b4c('0x3c')](_0x559b5e[_0x0b4c('0x39')],{'$or':_['map'](_0x2c6958,function(_0x13ce9e){if(_0x13ce9e[_0x0b4c('0x2c')]!==_0x0b4c('0x3d')){var _0x2df958={};_0x2df958[_0x13ce9e[_0x0b4c('0x27')]]={'$like':'%'+_0x27a713[_0x0b4c('0x2e')][_0x0b4c('0x3b')]+'%'};return _0x2df958;}})});}_0x559b5e=_[_0x0b4c('0x3c')]({},_0x559b5e,_0x27a713[_0x0b4c('0x3e')]);var _0x2d793b={'where':_0x559b5e['where']};return db[_0x0b4c('0x29')]['count'](_0x2d793b)['then'](function(_0x452951){_0x3d105d['count']=_0x452951;if(_0x27a713['query']['includeAll']){_0x559b5e[_0x0b4c('0x3f')]=[{'all':!![]}];}return db['Template'][_0x0b4c('0x40')](_0x559b5e);})[_0x0b4c('0x22')](function(_0x12c936){_0x3d105d[_0x0b4c('0x41')]=_0x12c936;return _0x3d105d;})[_0x0b4c('0x22')](respondWithFilteredResult(_0x15ffb6,_0x559b5e))[_0x0b4c('0x42')](handleError(_0x15ffb6,null));};exports[_0x0b4c('0x43')]=function(_0x11d4a0,_0x1dd25f){var _0x7d8383={'raw':!![],'where':{'id':_0x11d4a0[_0x0b4c('0x44')]['id']}},_0x3774a8={};_0x3774a8[_0x0b4c('0x31')]=_[_0x0b4c('0x2f')](db[_0x0b4c('0x29')][_0x0b4c('0x2a')]);_0x3774a8[_0x0b4c('0x2e')]=_[_0x0b4c('0x2f')](_0x11d4a0[_0x0b4c('0x2e')]);_0x3774a8[_0x0b4c('0x30')]=_[_0x0b4c('0x33')](_0x3774a8[_0x0b4c('0x31')],_0x3774a8[_0x0b4c('0x2e')]);_0x7d8383[_0x0b4c('0x32')]=_[_0x0b4c('0x33')](_0x3774a8[_0x0b4c('0x31')],qs[_0x0b4c('0x45')](_0x11d4a0[_0x0b4c('0x2e')]['fields']));_0x7d8383[_0x0b4c('0x32')]=_0x7d8383[_0x0b4c('0x32')][_0x0b4c('0x34')]?_0x7d8383[_0x0b4c('0x32')]:_0x3774a8['model'];if(_0x11d4a0[_0x0b4c('0x2e')][_0x0b4c('0x46')]){_0x7d8383['include']=[{'all':!![]}];}_0x7d8383=_[_0x0b4c('0x3c')]({},_0x7d8383,_0x11d4a0[_0x0b4c('0x3e')]);return db['Template'][_0x0b4c('0x47')](_0x7d8383)[_0x0b4c('0x22')](handleEntityNotFound(_0x1dd25f,null))[_0x0b4c('0x22')](respondWithResult(_0x1dd25f,null))[_0x0b4c('0x42')](handleError(_0x1dd25f,null));};exports[_0x0b4c('0x48')]=function(_0x1cfeda,_0x14c0f2){return db[_0x0b4c('0x29')][_0x0b4c('0x48')](_0x1cfeda[_0x0b4c('0x49')],{})['then'](function(_0x4b3e33){var _0x4be732=_0x1cfeda['user'][_0x0b4c('0x24')]({'plain':!![]});if(!_0x4be732)throw new Error(_0x0b4c('0x4a'));if(_0x4be732['role']===_0x0b4c('0x4b')){var _0x6a77ab=_0x4b3e33[_0x0b4c('0x24')]({'plain':!![]});var _0x5a9b37=_0x0b4c('0x25');return db[_0x0b4c('0x4c')][_0x0b4c('0x47')]({'where':{'name':_0x5a9b37,'userProfileId':_0x4be732[_0x0b4c('0x4d')]},'raw':!![]})[_0x0b4c('0x22')](function(_0x1615b4){if(_0x1615b4&&_0x1615b4['autoAssociation']===0x0){return db[_0x0b4c('0x26')][_0x0b4c('0x48')]({'name':_0x6a77ab['name'],'resourceId':_0x6a77ab['id'],'type':_0x1615b4['name'],'sectionId':_0x1615b4['id']},{})[_0x0b4c('0x22')](function(){return _0x4b3e33;});}else{return _0x4b3e33;}})[_0x0b4c('0x42')](function(_0x5d7054){logger['error'](_0x0b4c('0x4e'),_0x5d7054);throw _0x5d7054;});}return _0x4b3e33;})['then'](respondWithResult(_0x14c0f2,0xc9))[_0x0b4c('0x42')](handleError(_0x14c0f2,null));};exports[_0x0b4c('0x21')]=function(_0x1bc2a3,_0x43cd86){if(_0x1bc2a3['body']['id']){delete _0x1bc2a3[_0x0b4c('0x49')]['id'];}return db[_0x0b4c('0x29')][_0x0b4c('0x47')]({'where':{'id':_0x1bc2a3['params']['id']}})[_0x0b4c('0x22')](handleEntityNotFound(_0x43cd86,null))[_0x0b4c('0x22')](saveUpdates(_0x1bc2a3[_0x0b4c('0x49')],null))[_0x0b4c('0x22')](respondWithResult(_0x43cd86,null))[_0x0b4c('0x42')](handleError(_0x43cd86,null));};exports[_0x0b4c('0x23')]=function(_0x5564af,_0x3b8637){return db['Template'][_0x0b4c('0x47')]({'where':{'id':_0x5564af[_0x0b4c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b8637,null))[_0x0b4c('0x22')](removeEntity(_0x3b8637,null))['catch'](handleError(_0x3b8637,null));}; \ No newline at end of file +var _0xe8de=['filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','then','get','error','stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filters'];(function(_0xc6e10d,_0x1c5d45){var _0x2c6978=function(_0x15a21f){while(--_0x15a21f){_0xc6e10d['push'](_0xc6e10d['shift']());}};_0x2c6978(++_0x1c5d45);}(_0xe8de,0x1bb));var _0xee8d=function(_0x43d6c5,_0x258429){_0x43d6c5=_0x43d6c5-0x0;var _0x20a869=_0xe8de[_0x43d6c5];return _0x20a869;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee8d('0x0'));var jsonpatch=require(_0xee8d('0x1'));var rp=require(_0xee8d('0x2'));var moment=require(_0xee8d('0x3'));var BPromise=require(_0xee8d('0x4'));var Mustache=require(_0xee8d('0x5'));var util=require(_0xee8d('0x6'));var path=require('path');var sox=require(_0xee8d('0x7'));var csv=require(_0xee8d('0x8'));var ejs=require(_0xee8d('0x9'));var fs=require('fs');var fs_extra=require(_0xee8d('0xa'));var _=require(_0xee8d('0xb'));var squel=require(_0xee8d('0xc'));var crypto=require('crypto');var jsforce=require(_0xee8d('0xd'));var deskjs=require(_0xee8d('0xe'));var toCsv=require(_0xee8d('0x8'));var querystring=require('querystring');var Papa=require(_0xee8d('0xf'));var Redis=require(_0xee8d('0x10'));var authService=require(_0xee8d('0x11'));var qs=require(_0xee8d('0x12'));var as=require(_0xee8d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee8d('0x14'))(_0xee8d('0x15'));var utils=require(_0xee8d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xee8d('0x17'));var db=require(_0xee8d('0x18'))['db'];function respondWithStatusCode(_0x36643e,_0x464cba){_0x464cba=_0x464cba||0xcc;return function(_0x316082){if(_0x316082){return _0x36643e[_0xee8d('0x19')](_0x464cba);}return _0x36643e[_0xee8d('0x1a')](_0x464cba)['end']();};}function respondWithResult(_0x115dd5,_0x374778){_0x374778=_0x374778||0xc8;return function(_0x17e488){if(_0x17e488){return _0x115dd5[_0xee8d('0x1a')](_0x374778)[_0xee8d('0x1b')](_0x17e488);}};}function respondWithFilteredResult(_0x59c6ce,_0x50705c){return function(_0x31ee04){if(_0x31ee04){var _0x42a772=typeof _0x50705c[_0xee8d('0x1c')]==='undefined'&&typeof _0x50705c[_0xee8d('0x1d')]===_0xee8d('0x1e');var _0x542fa1=_0x31ee04[_0xee8d('0x1f')];var _0x2bd66b=_0x42a772?0x0:_0x50705c[_0xee8d('0x1c')];var _0x378818=_0x42a772?_0x31ee04[_0xee8d('0x1f')]:_0x50705c[_0xee8d('0x1c')]+_0x50705c['limit'];var _0x2f88e0;if(_0x378818>=_0x542fa1){_0x378818=_0x542fa1;_0x2f88e0=0xc8;}else{_0x2f88e0=0xce;}_0x59c6ce[_0xee8d('0x1a')](_0x2f88e0);return _0x59c6ce['set'](_0xee8d('0x20'),_0x2bd66b+'-'+_0x378818+'/'+_0x542fa1)[_0xee8d('0x1b')](_0x31ee04);}return null;};}function patchUpdates(_0x3077f8){return function(_0x19bdf3){try{jsonpatch[_0xee8d('0x21')](_0x19bdf3,_0x3077f8,!![]);}catch(_0x45fe31){return BPromise['reject'](_0x45fe31);}return _0x19bdf3[_0xee8d('0x22')]();};}function saveUpdates(_0x5a4585,_0x42da9c){return function(_0x400340){if(_0x400340){return _0x400340[_0xee8d('0x23')](_0x5a4585)['then'](function(_0x1d515f){return _0x1d515f;});}return null;};}function removeEntity(_0x2eed5f,_0x5afa1f){return function(_0x4f0679){if(_0x4f0679){return _0x4f0679[_0xee8d('0x24')]()[_0xee8d('0x25')](function(){var _0x5a1d03=_0x4f0679[_0xee8d('0x26')]({'plain':!![]});var _0x2da3d3='Templates';return db['UserProfileResource'][_0xee8d('0x24')]({'where':{'type':_0x2da3d3,'resourceId':_0x5a1d03['id']}})[_0xee8d('0x25')](function(){return _0x4f0679;});})['then'](function(){_0x2eed5f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x620444,_0x22a821){return function(_0x3afe61){if(!_0x3afe61){_0x620444[_0xee8d('0x19')](0x194);}return _0x3afe61;};}function handleError(_0x519c48,_0x4b2315){_0x4b2315=_0x4b2315||0x1f4;return function(_0x39d829){logger[_0xee8d('0x27')](_0x39d829[_0xee8d('0x28')]);if(_0x39d829['name']){delete _0x39d829[_0xee8d('0x29')];}_0x519c48[_0xee8d('0x1a')](_0x4b2315)[_0xee8d('0x2a')](_0x39d829);};}exports['index']=function(_0x4bfe43,_0x577b8f){var _0x48fb13={},_0x1692b2={},_0x229cdb={'count':0x0,'rows':[]};var _0x27cf10=_['map'](db[_0xee8d('0x2b')][_0xee8d('0x2c')],function(_0xaf95bf){return{'name':_0xaf95bf[_0xee8d('0x2d')],'type':_0xaf95bf[_0xee8d('0x2e')][_0xee8d('0x2f')]};});_0x1692b2[_0xee8d('0x30')]=_[_0xee8d('0x31')](_0x27cf10,_0xee8d('0x29'));_0x1692b2['query']=_['keys'](_0x4bfe43['query']);_0x1692b2['filters']=_[_0xee8d('0x32')](_0x1692b2[_0xee8d('0x30')],_0x1692b2['query']);_0x48fb13[_0xee8d('0x33')]=_['intersection'](_0x1692b2[_0xee8d('0x30')],qs[_0xee8d('0x34')](_0x4bfe43['query'][_0xee8d('0x34')]));_0x48fb13[_0xee8d('0x33')]=_0x48fb13[_0xee8d('0x33')][_0xee8d('0x35')]?_0x48fb13[_0xee8d('0x33')]:_0x1692b2[_0xee8d('0x30')];if(!_0x4bfe43[_0xee8d('0x36')][_0xee8d('0x37')](_0xee8d('0x38'))){_0x48fb13[_0xee8d('0x1d')]=qs[_0xee8d('0x1d')](_0x4bfe43[_0xee8d('0x36')]['limit']);_0x48fb13[_0xee8d('0x1c')]=qs[_0xee8d('0x1c')](_0x4bfe43[_0xee8d('0x36')][_0xee8d('0x1c')]);}_0x48fb13[_0xee8d('0x39')]=qs[_0xee8d('0x3a')](_0x4bfe43[_0xee8d('0x36')][_0xee8d('0x3a')]);_0x48fb13['where']=qs['filters'](_[_0xee8d('0x3b')](_0x4bfe43[_0xee8d('0x36')],_0x1692b2[_0xee8d('0x3c')]),_0x27cf10);if(_0x4bfe43['query'][_0xee8d('0x3d')]){_0x48fb13['where']=_[_0xee8d('0x3e')](_0x48fb13[_0xee8d('0x3f')],{'$or':_['map'](_0x27cf10,function(_0x3096af){if(_0x3096af[_0xee8d('0x2e')]!==_0xee8d('0x40')){var _0x12e3eb={};_0x12e3eb[_0x3096af[_0xee8d('0x29')]]={'$like':'%'+_0x4bfe43[_0xee8d('0x36')][_0xee8d('0x3d')]+'%'};return _0x12e3eb;}})});}_0x48fb13=_[_0xee8d('0x3e')]({},_0x48fb13,_0x4bfe43[_0xee8d('0x41')]);var _0x4cf9c4={'where':_0x48fb13[_0xee8d('0x3f')]};return db[_0xee8d('0x2b')][_0xee8d('0x1f')](_0x4cf9c4)[_0xee8d('0x25')](function(_0x54d02f){_0x229cdb[_0xee8d('0x1f')]=_0x54d02f;if(_0x4bfe43[_0xee8d('0x36')][_0xee8d('0x42')]){_0x48fb13[_0xee8d('0x43')]=[{'all':!![]}];}return db[_0xee8d('0x2b')]['findAll'](_0x48fb13);})[_0xee8d('0x25')](function(_0x3370c){_0x229cdb[_0xee8d('0x44')]=_0x3370c;return _0x229cdb;})[_0xee8d('0x25')](respondWithFilteredResult(_0x577b8f,_0x48fb13))[_0xee8d('0x45')](handleError(_0x577b8f,null));};exports['show']=function(_0x73e38,_0x225f81){var _0x1c51d7={'raw':!![],'where':{'id':_0x73e38['params']['id']}},_0x5c9c6c={};_0x5c9c6c[_0xee8d('0x30')]=_[_0xee8d('0x46')](db[_0xee8d('0x2b')]['rawAttributes']);_0x5c9c6c['query']=_[_0xee8d('0x46')](_0x73e38[_0xee8d('0x36')]);_0x5c9c6c[_0xee8d('0x3c')]=_['intersection'](_0x5c9c6c['model'],_0x5c9c6c['query']);_0x1c51d7['attributes']=_[_0xee8d('0x32')](_0x5c9c6c[_0xee8d('0x30')],qs[_0xee8d('0x34')](_0x73e38['query'][_0xee8d('0x34')]));_0x1c51d7[_0xee8d('0x33')]=_0x1c51d7[_0xee8d('0x33')][_0xee8d('0x35')]?_0x1c51d7['attributes']:_0x5c9c6c[_0xee8d('0x30')];if(_0x73e38[_0xee8d('0x36')][_0xee8d('0x42')]){_0x1c51d7[_0xee8d('0x43')]=[{'all':!![]}];}_0x1c51d7=_['merge']({},_0x1c51d7,_0x73e38[_0xee8d('0x41')]);return db[_0xee8d('0x2b')][_0xee8d('0x47')](_0x1c51d7)[_0xee8d('0x25')](handleEntityNotFound(_0x225f81,null))[_0xee8d('0x25')](respondWithResult(_0x225f81,null))['catch'](handleError(_0x225f81,null));};exports[_0xee8d('0x48')]=function(_0x51c9e0,_0x4b38e3){return db[_0xee8d('0x2b')]['create'](_0x51c9e0[_0xee8d('0x49')],{})[_0xee8d('0x25')](function(_0xc4f334){var _0xf08f25=_0x51c9e0['user']['get']({'plain':!![]});if(!_0xf08f25)throw new Error(_0xee8d('0x4a'));if(_0xf08f25[_0xee8d('0x4b')]===_0xee8d('0x4c')){var _0x115988=_0xc4f334[_0xee8d('0x26')]({'plain':!![]});var _0x30f0a5=_0xee8d('0x4d');return db[_0xee8d('0x4e')][_0xee8d('0x47')]({'where':{'name':_0x30f0a5,'userProfileId':_0xf08f25[_0xee8d('0x4f')]},'raw':!![]})[_0xee8d('0x25')](function(_0x569ba9){if(_0x569ba9&&_0x569ba9[_0xee8d('0x50')]===0x0){return db[_0xee8d('0x51')]['create']({'name':_0x115988['name'],'resourceId':_0x115988['id'],'type':_0x569ba9[_0xee8d('0x29')],'sectionId':_0x569ba9['id']},{})[_0xee8d('0x25')](function(){return _0xc4f334;});}else{return _0xc4f334;}})[_0xee8d('0x45')](function(_0x453a42){logger[_0xee8d('0x27')](_0xee8d('0x52'),_0x453a42);throw _0x453a42;});}return _0xc4f334;})[_0xee8d('0x25')](respondWithResult(_0x4b38e3,0xc9))[_0xee8d('0x45')](handleError(_0x4b38e3,null));};exports[_0xee8d('0x23')]=function(_0x3fd253,_0x2ce99a){if(_0x3fd253['body']['id']){delete _0x3fd253[_0xee8d('0x49')]['id'];}return db[_0xee8d('0x2b')][_0xee8d('0x47')]({'where':{'id':_0x3fd253[_0xee8d('0x53')]['id']}})[_0xee8d('0x25')](handleEntityNotFound(_0x2ce99a,null))['then'](saveUpdates(_0x3fd253['body'],null))[_0xee8d('0x25')](respondWithResult(_0x2ce99a,null))[_0xee8d('0x45')](handleError(_0x2ce99a,null));};exports[_0xee8d('0x24')]=function(_0x620cfd,_0x48134c){return db[_0xee8d('0x2b')]['find']({'where':{'id':_0x620cfd['params']['id']}})[_0xee8d('0x25')](handleEntityNotFound(_0x48134c,null))[_0xee8d('0x25')](removeEntity(_0x48134c,null))[_0xee8d('0x45')](handleError(_0x48134c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 8d4dd1b..0d9b3c2 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 _0x629b=['bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x32300f,_0x37aa5b){var _0x17adbd=function(_0x57e5ea){while(--_0x57e5ea){_0x32300f['push'](_0x32300f['shift']());}};_0x17adbd(++_0x37aa5b);}(_0x629b,0x19f));var _0xb629=function(_0x2e7adb,_0x30da27){_0x2e7adb=_0x2e7adb-0x0;var _0x44afff=_0x629b[_0x2e7adb];return _0x44afff;};'use strict';var _=require(_0xb629('0x0'));var util=require(_0xb629('0x1'));var logger=require(_0xb629('0x2'))(_0xb629('0x3'));var moment=require(_0xb629('0x4'));var BPromise=require(_0xb629('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb629('0x6'));var rimraf=require(_0xb629('0x7'));var config=require(_0xb629('0x8'));var attributes=require(_0xb629('0x9'));module[_0xb629('0xa')]=function(_0x2830a5,_0xfacd9){return _0x2830a5[_0xb629('0xb')](_0xb629('0xc'),attributes,{'tableName':_0xb629('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9204=['rimraf','../../config/environment','./template.attributes','define','Template','lodash','../../config/logger','request-promise'];(function(_0x11c43e,_0x1572ac){var _0x5e1073=function(_0x53fd4b){while(--_0x53fd4b){_0x11c43e['push'](_0x11c43e['shift']());}};_0x5e1073(++_0x1572ac);}(_0x9204,0x13d));var _0x4920=function(_0x237128,_0x2ba5bd){_0x237128=_0x237128-0x0;var _0x598f3a=_0x9204[_0x237128];return _0x598f3a;};'use strict';var _=require(_0x4920('0x0'));var util=require('util');var logger=require(_0x4920('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4920('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4920('0x3'));var config=require(_0x4920('0x4'));var attributes=require(_0x4920('0x5'));module['exports']=function(_0x839a54,_0x2a6426){return _0x839a54[_0x4920('0x6')](_0x4920('0x7'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index b4a6a1b..ad63c5e 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 _0xa1f5=['model','debug','catch','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include'];(function(_0x4c8e58,_0x15ad79){var _0x570afd=function(_0x5194e9){while(--_0x5194e9){_0x4c8e58['push'](_0x4c8e58['shift']());}};_0x570afd(++_0x15ad79);}(_0xa1f5,0xce));var _0x5a1f=function(_0x45f4ec,_0xe6ec82){_0x45f4ec=_0x45f4ec-0x0;var _0x1cbee7=_0xa1f5[_0x45f4ec];return _0x1cbee7;};'use strict';var _=require(_0x5a1f('0x0'));var util=require('util');var moment=require(_0x5a1f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a1f('0x2'));var db=require(_0x5a1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a1f('0x4'));var config=require(_0x5a1f('0x5'));var jayson=require(_0x5a1f('0x6'));var client=jayson['client'][_0x5a1f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16c7bb,_0x2e539e,_0x326e66){return new BPromise(function(_0x288056,_0x14f543){return client[_0x5a1f('0x8')](_0x16c7bb,_0x326e66)[_0x5a1f('0x9')](function(_0x3f475f){logger['info'](_0x5a1f('0xa'),_0x2e539e,_0x5a1f('0xb'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x2e539e,'request\x20sent',JSON[_0x5a1f('0xc')](_0x3f475f));if(_0x3f475f['error']){if(_0x3f475f[_0x5a1f('0xd')][_0x5a1f('0xe')]===0x1f4){logger[_0x5a1f('0xd')]('Template,\x20%s,\x20%s',_0x2e539e,_0x3f475f[_0x5a1f('0xd')][_0x5a1f('0xf')]);return _0x14f543(_0x3f475f['error'][_0x5a1f('0xf')]);}logger[_0x5a1f('0xd')](_0x5a1f('0xa'),_0x2e539e,_0x3f475f[_0x5a1f('0xd')][_0x5a1f('0xf')]);return _0x288056(_0x3f475f[_0x5a1f('0xd')]['message']);}else{logger[_0x5a1f('0x10')]('Template,\x20%s,\x20%s',_0x2e539e,_0x5a1f('0xb'));_0x288056(_0x3f475f['result'][_0x5a1f('0xf')]);}})['catch'](function(_0x235d15){logger[_0x5a1f('0xd')](_0x5a1f('0xa'),_0x2e539e,_0x235d15);_0x14f543(_0x235d15);});});}exports[_0x5a1f('0x11')]=function(_0x2eacd1){var _0x3c958b=this;return new Promise(function(_0x2adda7,_0x1ec6bf){return db[_0x5a1f('0x12')][_0x5a1f('0x13')]({'raw':_0x2eacd1[_0x5a1f('0x14')]?_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x15')]===undefined?!![]:![]:!![],'where':_0x2eacd1[_0x5a1f('0x14')]?_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x16')]||null:null,'attributes':_0x2eacd1['options']?_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x17')]||null:null,'limit':_0x2eacd1[_0x5a1f('0x14')]?_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x18')]||null:null,'include':_0x2eacd1[_0x5a1f('0x14')]?_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x19')]?_['map'](_0x2eacd1[_0x5a1f('0x14')][_0x5a1f('0x19')],function(_0x2b2cb0){return{'model':db[_0x2b2cb0['model']],'as':_0x2b2cb0['as'],'attributes':_0x2b2cb0['attributes'],'include':_0x2b2cb0[_0x5a1f('0x19')]?_['map'](_0x2b2cb0['include'],function(_0x468d85){return{'model':db[_0x468d85[_0x5a1f('0x1a')]],'as':_0x468d85['as'],'attributes':_0x468d85[_0x5a1f('0x17')],'include':_0x468d85[_0x5a1f('0x19')]?_['map'](_0x468d85['include'],function(_0x5963a3){return{'model':db[_0x5963a3[_0x5a1f('0x1a')]],'as':_0x5963a3['as'],'attributes':_0x5963a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a1f('0x9')](function(_0x116348){logger[_0x5a1f('0x10')](_0x5a1f('0x11'),_0x2eacd1);logger[_0x5a1f('0x1b')](_0x5a1f('0x11'),_0x2eacd1,JSON['stringify'](_0x116348));_0x2adda7(_0x116348);})[_0x5a1f('0x1c')](function(_0x5c63f0){logger[_0x5a1f('0xd')](_0x5a1f('0x11'),_0x5c63f0[_0x5a1f('0xf')],_0x2eacd1);_0x1ec6bf(_0x3c958b['error'](0x1f4,_0x5c63f0['message']));});});}; \ No newline at end of file +var _0xd5c6=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd5c6,0x76));var _0x6d5c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd5c6[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6d5c('0x0'));var util=require(_0x6d5c('0x1'));var moment=require(_0x6d5c('0x2'));var BPromise=require(_0x6d5c('0x3'));var rs=require(_0x6d5c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d5c('0x5'))['db'];var utils=require(_0x6d5c('0x6'));var logger=require(_0x6d5c('0x7'))(_0x6d5c('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d5c('0x9'));var client=jayson[_0x6d5c('0xa')][_0x6d5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a006d,_0x21a82d,_0x32aff9){return new BPromise(function(_0xac9502,_0x3901cd){return client[_0x6d5c('0xc')](_0x8a006d,_0x32aff9)[_0x6d5c('0xd')](function(_0x45b8cd){logger[_0x6d5c('0xe')](_0x6d5c('0xf'),_0x21a82d,'request\x20sent');logger[_0x6d5c('0x10')](_0x6d5c('0x11'),_0x21a82d,_0x6d5c('0x12'),JSON[_0x6d5c('0x13')](_0x45b8cd));if(_0x45b8cd[_0x6d5c('0x14')]){if(_0x45b8cd['error'][_0x6d5c('0x15')]===0x1f4){logger['error'](_0x6d5c('0xf'),_0x21a82d,_0x45b8cd['error'][_0x6d5c('0x16')]);return _0x3901cd(_0x45b8cd[_0x6d5c('0x14')][_0x6d5c('0x16')]);}logger[_0x6d5c('0x14')](_0x6d5c('0xf'),_0x21a82d,_0x45b8cd[_0x6d5c('0x14')][_0x6d5c('0x16')]);return _0xac9502(_0x45b8cd[_0x6d5c('0x14')][_0x6d5c('0x16')]);}else{logger[_0x6d5c('0xe')]('Template,\x20%s,\x20%s',_0x21a82d,_0x6d5c('0x12'));_0xac9502(_0x45b8cd[_0x6d5c('0x17')][_0x6d5c('0x16')]);}})[_0x6d5c('0x18')](function(_0x45240e){logger['error'](_0x6d5c('0xf'),_0x21a82d,_0x45240e);_0x3901cd(_0x45240e);});});}exports[_0x6d5c('0x19')]=function(_0x32a40a){var _0xad898b=this;return new Promise(function(_0x3eb53c,_0x4f45ea){return db[_0x6d5c('0x1a')][_0x6d5c('0x1b')]({'raw':_0x32a40a[_0x6d5c('0x1c')]?_0x32a40a[_0x6d5c('0x1c')][_0x6d5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x32a40a[_0x6d5c('0x1c')]?_0x32a40a['options'][_0x6d5c('0x1e')]||null:null,'attributes':_0x32a40a[_0x6d5c('0x1c')]?_0x32a40a['options'][_0x6d5c('0x1f')]||null:null,'limit':_0x32a40a[_0x6d5c('0x1c')]?_0x32a40a['options']['limit']||null:null,'include':_0x32a40a[_0x6d5c('0x1c')]?_0x32a40a['options'][_0x6d5c('0x20')]?_[_0x6d5c('0x21')](_0x32a40a['options'][_0x6d5c('0x20')],function(_0xa77de2){return{'model':db[_0xa77de2[_0x6d5c('0x22')]],'as':_0xa77de2['as'],'attributes':_0xa77de2[_0x6d5c('0x1f')],'include':_0xa77de2[_0x6d5c('0x20')]?_['map'](_0xa77de2[_0x6d5c('0x20')],function(_0x54cfc5){return{'model':db[_0x54cfc5[_0x6d5c('0x22')]],'as':_0x54cfc5['as'],'attributes':_0x54cfc5[_0x6d5c('0x1f')],'include':_0x54cfc5[_0x6d5c('0x20')]?_['map'](_0x54cfc5[_0x6d5c('0x20')],function(_0x1aa91b){return{'model':db[_0x1aa91b[_0x6d5c('0x22')]],'as':_0x1aa91b['as'],'attributes':_0x1aa91b[_0x6d5c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x542080){logger[_0x6d5c('0xe')](_0x6d5c('0x19'),_0x32a40a);logger[_0x6d5c('0x10')]('GetTemplate',_0x32a40a,JSON[_0x6d5c('0x13')](_0x542080));_0x3eb53c(_0x542080);})['catch'](function(_0x57fb2e){logger[_0x6d5c('0x14')](_0x6d5c('0x19'),_0x57fb2e[_0x6d5c('0x16')],_0x32a40a);_0x4f45ea(_0xad898b[_0x6d5c('0x14')](0x1f4,_0x57fb2e['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e1d11a4..0480d87 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 _0x076c=['getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0x076c,0x112));var _0xc076=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0x076c[_0xd21fe7];return _0x14d570;};'use strict';var multer=require(_0xc076('0x0'));var util=require(_0xc076('0x1'));var path=require('path');var timeout=require(_0xc076('0x2'));var express=require('express');var router=express[_0xc076('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc076('0x4'));var config=require('../../config/environment');var controller=require(_0xc076('0x5'));router[_0xc076('0x6')]('/',auth[_0xc076('0x7')](),controller[_0xc076('0x8')]);router['get'](_0xc076('0x9'),auth['isAuthenticated'](),controller[_0xc076('0xa')]);router['get'](_0xc076('0xb'),auth[_0xc076('0x7')](),controller[_0xc076('0xc')]);router[_0xc076('0x6')](_0xc076('0xd'),auth['isAuthenticated'](),controller[_0xc076('0xe')]);router['get'](_0xc076('0xf'),auth[_0xc076('0x7')](),controller[_0xc076('0x10')]);router[_0xc076('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc076('0x11')](_0xc076('0xb'),auth[_0xc076('0x7')](),controller[_0xc076('0x12')]);router[_0xc076('0x11')](_0xc076('0xd'),auth[_0xc076('0x7')](),controller[_0xc076('0x13')]);router['post'](_0xc076('0xf'),auth[_0xc076('0x7')](),controller[_0xc076('0x14')]);router[_0xc076('0x15')](_0xc076('0x9'),auth['isAuthenticated'](),controller[_0xc076('0x16')]);router[_0xc076('0x17')]('/:id',auth[_0xc076('0x7')](),controller[_0xc076('0x18')]);module[_0xc076('0x19')]=router; \ No newline at end of file +var _0xc71c=['addAllCondition','addAnyCondition','/:id/actions','put','update','delete','exports','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','post'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xc71c,0xfe));var _0xcc71=function(_0xe91eb,_0x1ccbf4){_0xe91eb=_0xe91eb-0x0;var _0x2d78e6=_0xc71c[_0xe91eb];return _0x2d78e6;};'use strict';var multer=require('multer');var util=require(_0xcc71('0x0'));var path=require(_0xcc71('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc71('0x2'));var router=express[_0xcc71('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcc71('0x4'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xcc71('0x5')]('/',auth[_0xcc71('0x6')](),controller['index']);router[_0xcc71('0x5')](_0xcc71('0x7'),auth[_0xcc71('0x6')](),controller['show']);router[_0xcc71('0x5')](_0xcc71('0x8'),auth[_0xcc71('0x6')](),controller[_0xcc71('0x9')]);router[_0xcc71('0x5')](_0xcc71('0xa'),auth[_0xcc71('0x6')](),controller['getAnyConditions']);router[_0xcc71('0x5')]('/:id/actions',auth[_0xcc71('0x6')](),controller['getActions']);router['post']('/',auth[_0xcc71('0x6')](),controller['create']);router[_0xcc71('0xb')](_0xcc71('0x8'),auth[_0xcc71('0x6')](),controller[_0xcc71('0xc')]);router[_0xcc71('0xb')](_0xcc71('0xa'),auth[_0xcc71('0x6')](),controller[_0xcc71('0xd')]);router[_0xcc71('0xb')](_0xcc71('0xe'),auth[_0xcc71('0x6')](),controller['addAction']);router[_0xcc71('0xf')]('/:id',auth[_0xcc71('0x6')](),controller[_0xcc71('0x10')]);router[_0xcc71('0x11')](_0xcc71('0x7'),auth[_0xcc71('0x6')](),controller['destroy']);module[_0xcc71('0x12')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 6e82800..014c2a2 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 _0x5c48=['STRING','BOOLEAN','sequelize','exports'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x5c48,0x172));var _0x85c4=function(_0x16ce85,_0x222657){_0x16ce85=_0x16ce85-0x0;var _0x43188e=_0x5c48[_0x16ce85];return _0x43188e;};'use strict';var Sequelize=require(_0x85c4('0x0'));module[_0x85c4('0x1')]={'name':{'type':Sequelize[_0x85c4('0x2')]},'channel':{'type':Sequelize[_0x85c4('0x2')]},'description':{'type':Sequelize[_0x85c4('0x2')]},'status':{'type':Sequelize[_0x85c4('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3b70=['sequelize','STRING','BOOLEAN'];(function(_0x234921,_0xcb83e9){var _0x3781df=function(_0x1e6c09){while(--_0x1e6c09){_0x234921['push'](_0x234921['shift']());}};_0x3781df(++_0xcb83e9);}(_0x3b70,0x1bf));var _0x03b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b70[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x03b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x03b7('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x03b7('0x1')]},'status':{'type':Sequelize[_0x03b7('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 4d79898..d5df482 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 _0x1804=['stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','include','findAll','rows','show','params','keys','intersection','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Condition','addAnyCondition','TriggerAnyId','findOne','nolimit','getAllConditions','getAnyConditions','order','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../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','destroy','get','UserProfileResource','then','sendStatus'];(function(_0x406d41,_0x407ea3){var _0x173924=function(_0x267d9b){while(--_0x267d9b){_0x406d41['push'](_0x406d41['shift']());}};_0x173924(++_0x407ea3);}(_0x1804,0xee));var _0x4180=function(_0x5bbd97,_0x304212){_0x5bbd97=_0x5bbd97-0x0;var _0x27e738=_0x1804[_0x5bbd97];return _0x27e738;};'use strict';var emlformat=require(_0x4180('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4180('0x1'));var jsonpatch=require(_0x4180('0x2'));var rp=require(_0x4180('0x3'));var moment=require(_0x4180('0x4'));var BPromise=require(_0x4180('0x5'));var Mustache=require('mustache');var util=require(_0x4180('0x6'));var path=require(_0x4180('0x7'));var sox=require(_0x4180('0x8'));var csv=require(_0x4180('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4180('0xa'));var _=require(_0x4180('0xb'));var squel=require('squel');var crypto=require(_0x4180('0xc'));var jsforce=require(_0x4180('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4180('0x9'));var querystring=require('querystring');var Papa=require(_0x4180('0xe'));var Redis=require(_0x4180('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4180('0x10'));var hardwareService=require(_0x4180('0x11'));var logger=require('../../config/logger')(_0x4180('0x12'));var utils=require('../../config/utils');var config=require(_0x4180('0x13'));var licenseUtil=require(_0x4180('0x14'));var db=require(_0x4180('0x15'))['db'];function respondWithStatusCode(_0x2d310b,_0x179a92){_0x179a92=_0x179a92||0xcc;return function(_0x3cea30){if(_0x3cea30){return _0x2d310b['sendStatus'](_0x179a92);}return _0x2d310b[_0x4180('0x16')](_0x179a92)[_0x4180('0x17')]();};}function respondWithResult(_0x2b2dbe,_0x379e55){_0x379e55=_0x379e55||0xc8;return function(_0xf48667){if(_0xf48667){return _0x2b2dbe['status'](_0x379e55)[_0x4180('0x18')](_0xf48667);}};}function respondWithFilteredResult(_0xbb4941,_0x30fde6){return function(_0x59e091){if(_0x59e091){var _0x3204c4=typeof _0x30fde6[_0x4180('0x19')]===_0x4180('0x1a')&&typeof _0x30fde6[_0x4180('0x1b')]===_0x4180('0x1a');var _0x5bfea0=_0x59e091[_0x4180('0x1c')];var _0x39c4c9=_0x3204c4?0x0:_0x30fde6[_0x4180('0x19')];var _0x1d0f64=_0x3204c4?_0x59e091['count']:_0x30fde6['offset']+_0x30fde6[_0x4180('0x1b')];var _0x439271;if(_0x1d0f64>=_0x5bfea0){_0x1d0f64=_0x5bfea0;_0x439271=0xc8;}else{_0x439271=0xce;}_0xbb4941[_0x4180('0x16')](_0x439271);return _0xbb4941[_0x4180('0x1d')](_0x4180('0x1e'),_0x39c4c9+'-'+_0x1d0f64+'/'+_0x5bfea0)[_0x4180('0x18')](_0x59e091);}return null;};}function patchUpdates(_0x2e3824){return function(_0x293258){try{jsonpatch['apply'](_0x293258,_0x2e3824,!![]);}catch(_0x1a20f9){return BPromise[_0x4180('0x1f')](_0x1a20f9);}return _0x293258[_0x4180('0x20')]();};}function saveUpdates(_0x14e148,_0x3b2fc9){return function(_0x451f7e){if(_0x451f7e){return _0x451f7e['update'](_0x14e148)['then'](function(_0x422d76){return _0x422d76;});}return null;};}function removeEntity(_0x381071,_0x2fcf97){return function(_0x45db4c){if(_0x45db4c){return _0x45db4c[_0x4180('0x21')]()['then'](function(){var _0x3c5816=_0x45db4c[_0x4180('0x22')]({'plain':!![]});var _0x42d198='Triggers';return db[_0x4180('0x23')]['destroy']({'where':{'type':_0x42d198,'resourceId':_0x3c5816['id']}})[_0x4180('0x24')](function(){return _0x45db4c;});})[_0x4180('0x24')](function(){_0x381071[_0x4180('0x16')](0xcc)[_0x4180('0x17')]();});}};}function handleEntityNotFound(_0x42ed52,_0x19101d){return function(_0x2d3540){if(!_0x2d3540){_0x42ed52[_0x4180('0x25')](0x194);}return _0x2d3540;};}function handleError(_0xe69820,_0x122d0c){_0x122d0c=_0x122d0c||0x1f4;return function(_0x4c7d2a){logger['error'](_0x4c7d2a[_0x4180('0x26')]);if(_0x4c7d2a[_0x4180('0x27')]){delete _0x4c7d2a[_0x4180('0x27')];}_0xe69820[_0x4180('0x16')](_0x122d0c)[_0x4180('0x28')](_0x4c7d2a);};}exports['index']=function(_0x485ac1,_0xe73f6b){var _0x4ca655={},_0x362951={},_0x292a4c={'count':0x0,'rows':[]};var _0x85fed0=_[_0x4180('0x29')](db['Trigger'][_0x4180('0x2a')],function(_0x1afc2a){return{'name':_0x1afc2a[_0x4180('0x2b')],'type':_0x1afc2a[_0x4180('0x2c')][_0x4180('0x2d')]};});_0x362951[_0x4180('0x2e')]=_[_0x4180('0x29')](_0x85fed0,'name');_0x362951['query']=_['keys'](_0x485ac1[_0x4180('0x2f')]);_0x362951[_0x4180('0x30')]=_['intersection'](_0x362951[_0x4180('0x2e')],_0x362951[_0x4180('0x2f')]);_0x4ca655['attributes']=_['intersection'](_0x362951[_0x4180('0x2e')],qs[_0x4180('0x31')](_0x485ac1[_0x4180('0x2f')][_0x4180('0x31')]));_0x4ca655['attributes']=_0x4ca655[_0x4180('0x32')][_0x4180('0x33')]?_0x4ca655[_0x4180('0x32')]:_0x362951['model'];if(!_0x485ac1[_0x4180('0x2f')][_0x4180('0x34')]('nolimit')){_0x4ca655[_0x4180('0x1b')]=qs[_0x4180('0x1b')](_0x485ac1[_0x4180('0x2f')][_0x4180('0x1b')]);_0x4ca655[_0x4180('0x19')]=qs[_0x4180('0x19')](_0x485ac1['query'][_0x4180('0x19')]);}_0x4ca655['order']=qs[_0x4180('0x35')](_0x485ac1[_0x4180('0x2f')]['sort']);_0x4ca655[_0x4180('0x36')]=qs[_0x4180('0x30')](_[_0x4180('0x37')](_0x485ac1[_0x4180('0x2f')],_0x362951[_0x4180('0x30')]),_0x85fed0);if(_0x485ac1[_0x4180('0x2f')][_0x4180('0x38')]){_0x4ca655[_0x4180('0x36')]=_[_0x4180('0x39')](_0x4ca655[_0x4180('0x36')],{'$or':_[_0x4180('0x29')](_0x85fed0,function(_0x28f303){if(_0x28f303[_0x4180('0x2c')]!==_0x4180('0x3a')){var _0x52fdda={};_0x52fdda[_0x28f303['name']]={'$like':'%'+_0x485ac1['query'][_0x4180('0x38')]+'%'};return _0x52fdda;}})});}_0x4ca655=_['merge']({},_0x4ca655,_0x485ac1[_0x4180('0x3b')]);var _0x169ff1={'where':_0x4ca655[_0x4180('0x36')]};return db[_0x4180('0x3c')]['count'](_0x169ff1)[_0x4180('0x24')](function(_0x80e611){_0x292a4c[_0x4180('0x1c')]=_0x80e611;if(_0x485ac1[_0x4180('0x2f')]['includeAll']){_0x4ca655[_0x4180('0x3d')]=[{'all':!![]}];}return db[_0x4180('0x3c')][_0x4180('0x3e')](_0x4ca655);})['then'](function(_0x1512c7){_0x292a4c[_0x4180('0x3f')]=_0x1512c7;return _0x292a4c;})[_0x4180('0x24')](respondWithFilteredResult(_0xe73f6b,_0x4ca655))['catch'](handleError(_0xe73f6b,null));};exports[_0x4180('0x40')]=function(_0x5089be,_0x1d19a4){var _0x588316={'raw':![],'where':{'id':_0x5089be[_0x4180('0x41')]['id']}},_0x142858={};_0x142858[_0x4180('0x2e')]=_[_0x4180('0x42')](db[_0x4180('0x3c')]['rawAttributes']);_0x142858[_0x4180('0x2f')]=_['keys'](_0x5089be[_0x4180('0x2f')]);_0x142858[_0x4180('0x30')]=_[_0x4180('0x43')](_0x142858[_0x4180('0x2e')],_0x142858[_0x4180('0x2f')]);_0x588316[_0x4180('0x32')]=_['intersection'](_0x142858[_0x4180('0x2e')],qs[_0x4180('0x31')](_0x5089be['query'][_0x4180('0x31')]));_0x588316[_0x4180('0x32')]=_0x588316[_0x4180('0x32')]['length']?_0x588316['attributes']:_0x142858[_0x4180('0x2e')];if(_0x5089be[_0x4180('0x2f')][_0x4180('0x44')]){_0x588316[_0x4180('0x3d')]=[{'all':!![]}];}_0x588316=_[_0x4180('0x39')]({},_0x588316,_0x5089be[_0x4180('0x3b')]);return db[_0x4180('0x3c')][_0x4180('0x45')](_0x588316)[_0x4180('0x24')](handleEntityNotFound(_0x1d19a4,null))[_0x4180('0x24')](respondWithResult(_0x1d19a4,null))[_0x4180('0x46')](handleError(_0x1d19a4,null));};exports[_0x4180('0x47')]=function(_0x500636,_0x1b5982){return db[_0x4180('0x3c')]['create'](_0x500636[_0x4180('0x48')],{})[_0x4180('0x24')](function(_0x11b48a){var _0x1bb3a7=_0x500636[_0x4180('0x49')]['get']({'plain':!![]});if(!_0x1bb3a7)throw new Error(_0x4180('0x4a'));if(_0x1bb3a7[_0x4180('0x4b')]===_0x4180('0x49')){var _0x11089d=_0x11b48a[_0x4180('0x22')]({'plain':!![]});var _0x38cc3d=_0x4180('0x4c');return db[_0x4180('0x4d')][_0x4180('0x45')]({'where':{'name':_0x38cc3d,'userProfileId':_0x1bb3a7['userProfileId']},'raw':!![]})['then'](function(_0x49e04d){if(_0x49e04d&&_0x49e04d['autoAssociation']===0x0){return db[_0x4180('0x23')]['create']({'name':_0x11089d[_0x4180('0x27')],'resourceId':_0x11089d['id'],'type':_0x49e04d[_0x4180('0x27')],'sectionId':_0x49e04d['id']},{})['then'](function(){return _0x11b48a;});}else{return _0x11b48a;}})[_0x4180('0x46')](function(_0x304051){logger[_0x4180('0x4e')](_0x4180('0x4f'),_0x304051);throw _0x304051;});}return _0x11b48a;})['then'](respondWithResult(_0x1b5982,0xc9))['catch'](handleError(_0x1b5982,null));};exports[_0x4180('0x50')]=function(_0x2845f9,_0x5cf07a){if(_0x2845f9[_0x4180('0x48')]['id']){delete _0x2845f9[_0x4180('0x48')]['id'];}return db[_0x4180('0x3c')][_0x4180('0x45')]({'where':{'id':_0x2845f9[_0x4180('0x41')]['id']}})['then'](handleEntityNotFound(_0x5cf07a,null))['then'](saveUpdates(_0x2845f9['body'],null))[_0x4180('0x24')](respondWithResult(_0x5cf07a,null))['catch'](handleError(_0x5cf07a,null));};exports[_0x4180('0x21')]=function(_0x426112,_0x3d32a0){return db[_0x4180('0x3c')]['find']({'where':{'id':_0x426112[_0x4180('0x41')]['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x3d32a0,null))[_0x4180('0x24')](removeEntity(_0x3d32a0,null))[_0x4180('0x46')](handleError(_0x3d32a0,null));};exports['addAllCondition']=function(_0x1fd5d9,_0x398931,_0x25ee06){if(_0x1fd5d9['body']['id']){delete _0x1fd5d9[_0x4180('0x48')]['id'];}return db[_0x4180('0x3c')][_0x4180('0x45')]({'where':{'id':_0x1fd5d9[_0x4180('0x41')]['id']}})['then'](handleEntityNotFound(_0x398931,null))[_0x4180('0x24')](function(_0x20e5eb){if(_0x20e5eb){_0x1fd5d9['body']['TriggerAllId']=_0x20e5eb['id'];return db[_0x4180('0x51')]['create'](_0x1fd5d9[_0x4180('0x48')]);}})[_0x4180('0x24')](respondWithResult(_0x398931,null))['catch'](handleError(_0x398931,null));};exports[_0x4180('0x52')]=function(_0x16c02f,_0x9e8c0f,_0x242d58){if(_0x16c02f[_0x4180('0x48')]['id']){delete _0x16c02f[_0x4180('0x48')]['id'];}return db[_0x4180('0x3c')][_0x4180('0x45')]({'where':{'id':_0x16c02f[_0x4180('0x41')]['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x9e8c0f,null))[_0x4180('0x24')](function(_0x25ff13){if(_0x25ff13){_0x16c02f[_0x4180('0x48')][_0x4180('0x53')]=_0x25ff13['id'];return db['Condition']['create'](_0x16c02f[_0x4180('0x48')]);}})[_0x4180('0x24')](respondWithResult(_0x9e8c0f,null))['catch'](handleError(_0x9e8c0f,null));};exports['getAllConditions']=function(_0x10234d,_0x773120,_0x55cec0){var _0x155383={};var _0x347f1b={};var _0x207b8a;var _0x4299de;return db[_0x4180('0x3c')][_0x4180('0x54')]({'where':{'id':_0x10234d[_0x4180('0x41')]['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x773120,null))['then'](function(_0xced1c1){if(_0xced1c1){_0x207b8a=_0xced1c1;_0x347f1b[_0x4180('0x2e')]=_['keys'](db[_0x4180('0x51')]['rawAttributes']);_0x347f1b['query']=_[_0x4180('0x42')](_0x10234d[_0x4180('0x2f')]);_0x347f1b['filters']=_[_0x4180('0x43')](_0x347f1b[_0x4180('0x2e')],_0x347f1b[_0x4180('0x2f')]);_0x155383['attributes']=_['intersection'](_0x347f1b['model'],qs[_0x4180('0x31')](_0x10234d[_0x4180('0x2f')][_0x4180('0x31')]));_0x155383[_0x4180('0x32')]=_0x155383[_0x4180('0x32')][_0x4180('0x33')]?_0x155383[_0x4180('0x32')]:_0x347f1b[_0x4180('0x2e')];_0x155383['order']=qs[_0x4180('0x35')](_0x10234d[_0x4180('0x2f')][_0x4180('0x35')]);_0x155383[_0x4180('0x36')]=qs['filters'](_['pick'](_0x10234d[_0x4180('0x2f')],_0x347f1b[_0x4180('0x30')]));if(_0x10234d[_0x4180('0x2f')][_0x4180('0x38')]){_0x155383[_0x4180('0x36')]=_[_0x4180('0x39')](_0x155383[_0x4180('0x36')],{'$or':_[_0x4180('0x29')](_0x155383['attributes'],function(_0x466d3a){var _0x5d9291={};_0x5d9291[_0x466d3a]={'$like':'%'+_0x10234d['query']['filter']+'%'};return _0x5d9291;})});}_0x155383=_[_0x4180('0x39')]({},_0x155383,_0x10234d[_0x4180('0x3b')]);return _0x207b8a['getAllConditions'](_0x155383);}})[_0x4180('0x24')](function(_0x16b9c6){if(_0x16b9c6){_0x4299de=_0x16b9c6[_0x4180('0x33')];if(!_0x10234d[_0x4180('0x2f')]['hasOwnProperty'](_0x4180('0x55'))){_0x155383[_0x4180('0x1b')]=qs[_0x4180('0x1b')](_0x10234d[_0x4180('0x2f')][_0x4180('0x1b')]);_0x155383[_0x4180('0x19')]=qs[_0x4180('0x19')](_0x10234d[_0x4180('0x2f')][_0x4180('0x19')]);}return _0x207b8a[_0x4180('0x56')](_0x155383);}})['then'](function(_0x27c15f){if(_0x27c15f){return _0x27c15f?{'count':_0x4299de,'rows':_0x27c15f}:null;}})['then'](respondWithResult(_0x773120,null))['catch'](handleError(_0x773120,null));};exports[_0x4180('0x57')]=function(_0x32bc56,_0x20576f,_0x1cdb99){var _0x21a363={};var _0x26e019={};var _0x57c06f;var _0x2f7357;return db[_0x4180('0x3c')][_0x4180('0x54')]({'where':{'id':_0x32bc56[_0x4180('0x41')]['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x20576f,null))[_0x4180('0x24')](function(_0x54b4af){if(_0x54b4af){_0x57c06f=_0x54b4af;_0x26e019[_0x4180('0x2e')]=_[_0x4180('0x42')](db[_0x4180('0x51')][_0x4180('0x2a')]);_0x26e019[_0x4180('0x2f')]=_[_0x4180('0x42')](_0x32bc56[_0x4180('0x2f')]);_0x26e019[_0x4180('0x30')]=_[_0x4180('0x43')](_0x26e019[_0x4180('0x2e')],_0x26e019['query']);_0x21a363[_0x4180('0x32')]=_[_0x4180('0x43')](_0x26e019[_0x4180('0x2e')],qs[_0x4180('0x31')](_0x32bc56[_0x4180('0x2f')][_0x4180('0x31')]));_0x21a363[_0x4180('0x32')]=_0x21a363[_0x4180('0x32')][_0x4180('0x33')]?_0x21a363[_0x4180('0x32')]:_0x26e019['model'];_0x21a363[_0x4180('0x58')]=qs['sort'](_0x32bc56[_0x4180('0x2f')][_0x4180('0x35')]);_0x21a363[_0x4180('0x36')]=qs[_0x4180('0x30')](_[_0x4180('0x37')](_0x32bc56[_0x4180('0x2f')],_0x26e019[_0x4180('0x30')]));if(_0x32bc56[_0x4180('0x2f')][_0x4180('0x38')]){_0x21a363[_0x4180('0x36')]=_['merge'](_0x21a363[_0x4180('0x36')],{'$or':_[_0x4180('0x29')](_0x21a363['attributes'],function(_0x44a9e8){var _0xfa9a15={};_0xfa9a15[_0x44a9e8]={'$like':'%'+_0x32bc56[_0x4180('0x2f')][_0x4180('0x38')]+'%'};return _0xfa9a15;})});}_0x21a363=_[_0x4180('0x39')]({},_0x21a363,_0x32bc56[_0x4180('0x3b')]);return _0x57c06f[_0x4180('0x57')](_0x21a363);}})['then'](function(_0x115c08){if(_0x115c08){_0x2f7357=_0x115c08[_0x4180('0x33')];if(!_0x32bc56[_0x4180('0x2f')][_0x4180('0x34')](_0x4180('0x55'))){_0x21a363[_0x4180('0x1b')]=qs['limit'](_0x32bc56['query'][_0x4180('0x1b')]);_0x21a363[_0x4180('0x19')]=qs[_0x4180('0x19')](_0x32bc56[_0x4180('0x2f')][_0x4180('0x19')]);}return _0x57c06f[_0x4180('0x57')](_0x21a363);}})[_0x4180('0x24')](function(_0x401fa2){if(_0x401fa2){return _0x401fa2?{'count':_0x2f7357,'rows':_0x401fa2}:null;}})['then'](respondWithResult(_0x20576f,null))[_0x4180('0x46')](handleError(_0x20576f,null));};exports[_0x4180('0x59')]=function(_0x3492f1,_0x16e0af,_0x3f5b9b){if(_0x3492f1['body']['id']){delete _0x3492f1[_0x4180('0x48')]['id'];}return db[_0x4180('0x3c')]['find']({'where':{'id':_0x3492f1[_0x4180('0x41')]['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x16e0af,null))[_0x4180('0x24')](function(_0x26a066){if(_0x26a066){_0x3492f1[_0x4180('0x48')]['TriggerId']=_0x26a066['id'];return db[_0x4180('0x5a')][_0x4180('0x47')](_0x3492f1[_0x4180('0x48')]);}})['then'](respondWithResult(_0x16e0af,null))[_0x4180('0x46')](handleError(_0x16e0af,null));};exports['getActions']=function(_0x10267c,_0x370b65,_0x215d43){var _0x5d19cb={};var _0x39dc23={};var _0x5061f9;var _0x157945;return db[_0x4180('0x3c')]['findOne']({'where':{'id':_0x10267c['params']['id']}})[_0x4180('0x24')](handleEntityNotFound(_0x370b65,null))[_0x4180('0x24')](function(_0x167a38){if(_0x167a38){_0x5061f9=_0x167a38;_0x39dc23[_0x4180('0x2e')]=_[_0x4180('0x42')](db[_0x4180('0x5a')]['rawAttributes']);_0x39dc23[_0x4180('0x2f')]=_[_0x4180('0x42')](_0x10267c[_0x4180('0x2f')]);_0x39dc23['filters']=_[_0x4180('0x43')](_0x39dc23['model'],_0x39dc23[_0x4180('0x2f')]);_0x5d19cb[_0x4180('0x32')]=_[_0x4180('0x43')](_0x39dc23[_0x4180('0x2e')],qs['fields'](_0x10267c[_0x4180('0x2f')][_0x4180('0x31')]));_0x5d19cb[_0x4180('0x32')]=_0x5d19cb['attributes'][_0x4180('0x33')]?_0x5d19cb[_0x4180('0x32')]:_0x39dc23['model'];_0x5d19cb[_0x4180('0x58')]=qs[_0x4180('0x35')](_0x10267c[_0x4180('0x2f')]['sort']);_0x5d19cb[_0x4180('0x36')]=qs[_0x4180('0x30')](_[_0x4180('0x37')](_0x10267c[_0x4180('0x2f')],_0x39dc23[_0x4180('0x30')]));if(_0x10267c['query'][_0x4180('0x38')]){_0x5d19cb[_0x4180('0x36')]=_[_0x4180('0x39')](_0x5d19cb[_0x4180('0x36')],{'$or':_[_0x4180('0x29')](_0x5d19cb[_0x4180('0x32')],function(_0x41d952){var _0x2385b1={};_0x2385b1[_0x41d952]={'$like':'%'+_0x10267c[_0x4180('0x2f')]['filter']+'%'};return _0x2385b1;})});}_0x5d19cb=_[_0x4180('0x39')]({},_0x5d19cb,_0x10267c[_0x4180('0x3b')]);return _0x5061f9['getActions'](_0x5d19cb);}})[_0x4180('0x24')](function(_0x1a7de3){if(_0x1a7de3){_0x157945=_0x1a7de3[_0x4180('0x33')];if(!_0x10267c[_0x4180('0x2f')][_0x4180('0x34')](_0x4180('0x55'))){_0x5d19cb[_0x4180('0x1b')]=qs['limit'](_0x10267c[_0x4180('0x2f')]['limit']);_0x5d19cb[_0x4180('0x19')]=qs[_0x4180('0x19')](_0x10267c[_0x4180('0x2f')][_0x4180('0x19')]);}return _0x5061f9[_0x4180('0x5b')](_0x5d19cb);}})[_0x4180('0x24')](function(_0xfd0bec){if(_0xfd0bec){return _0xfd0bec?{'count':_0x157945,'rows':_0xfd0bec}:null;}})['then'](respondWithResult(_0x370b65,null))[_0x4180('0x46')](handleError(_0x370b65,null));}; \ No newline at end of file +var _0x3b17=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','Trigger','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','addAnyCondition','Condition','getAllConditions','findOne','order','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x58235f,_0x5e3186){var _0x461ccc=function(_0x3c4409){while(--_0x3c4409){_0x58235f['push'](_0x58235f['shift']());}};_0x461ccc(++_0x5e3186);}(_0x3b17,0x10c));var _0x73b1=function(_0x4206b1,_0x31f831){_0x4206b1=_0x4206b1-0x0;var _0x1fe223=_0x3b17[_0x4206b1];return _0x1fe223;};'use strict';var emlformat=require(_0x73b1('0x0'));var rimraf=require(_0x73b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73b1('0x2'));var rp=require(_0x73b1('0x3'));var moment=require(_0x73b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73b1('0x5'));var util=require(_0x73b1('0x6'));var path=require('path');var sox=require(_0x73b1('0x7'));var csv=require(_0x73b1('0x8'));var ejs=require(_0x73b1('0x9'));var fs=require('fs');var fs_extra=require(_0x73b1('0xa'));var _=require(_0x73b1('0xb'));var squel=require(_0x73b1('0xc'));var crypto=require(_0x73b1('0xd'));var jsforce=require(_0x73b1('0xe'));var deskjs=require(_0x73b1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x73b1('0x10'));var Papa=require('papaparse');var Redis=require(_0x73b1('0x11'));var authService=require(_0x73b1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73b1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73b1('0x14'));var config=require(_0x73b1('0x15'));var licenseUtil=require(_0x73b1('0x16'));var db=require(_0x73b1('0x17'))['db'];function respondWithStatusCode(_0x6b3028,_0x59461a){_0x59461a=_0x59461a||0xcc;return function(_0x85bace){if(_0x85bace){return _0x6b3028[_0x73b1('0x18')](_0x59461a);}return _0x6b3028[_0x73b1('0x19')](_0x59461a)[_0x73b1('0x1a')]();};}function respondWithResult(_0x52a42e,_0x476da9){_0x476da9=_0x476da9||0xc8;return function(_0xf7468){if(_0xf7468){return _0x52a42e['status'](_0x476da9)[_0x73b1('0x1b')](_0xf7468);}};}function respondWithFilteredResult(_0x990795,_0x1a982f){return function(_0xa76e27){if(_0xa76e27){var _0xb965a1=typeof _0x1a982f[_0x73b1('0x1c')]==='undefined'&&typeof _0x1a982f[_0x73b1('0x1d')]===_0x73b1('0x1e');var _0x4d73d3=_0xa76e27[_0x73b1('0x1f')];var _0x3b53b8=_0xb965a1?0x0:_0x1a982f['offset'];var _0x1c3efc=_0xb965a1?_0xa76e27[_0x73b1('0x1f')]:_0x1a982f[_0x73b1('0x1c')]+_0x1a982f['limit'];var _0xd4c217;if(_0x1c3efc>=_0x4d73d3){_0x1c3efc=_0x4d73d3;_0xd4c217=0xc8;}else{_0xd4c217=0xce;}_0x990795[_0x73b1('0x19')](_0xd4c217);return _0x990795[_0x73b1('0x20')]('Content-Range',_0x3b53b8+'-'+_0x1c3efc+'/'+_0x4d73d3)[_0x73b1('0x1b')](_0xa76e27);}return null;};}function patchUpdates(_0x40862f){return function(_0x5edbc9){try{jsonpatch[_0x73b1('0x21')](_0x5edbc9,_0x40862f,!![]);}catch(_0x3b436f){return BPromise[_0x73b1('0x22')](_0x3b436f);}return _0x5edbc9[_0x73b1('0x23')]();};}function saveUpdates(_0x3449c7,_0xf09a84){return function(_0x5dc692){if(_0x5dc692){return _0x5dc692[_0x73b1('0x24')](_0x3449c7)['then'](function(_0x383672){return _0x383672;});}return null;};}function removeEntity(_0x4e704b,_0x497a9d){return function(_0x56803d){if(_0x56803d){return _0x56803d['destroy']()[_0x73b1('0x25')](function(){var _0x260fd3=_0x56803d[_0x73b1('0x26')]({'plain':!![]});var _0xb7cd33='Triggers';return db[_0x73b1('0x27')][_0x73b1('0x28')]({'where':{'type':_0xb7cd33,'resourceId':_0x260fd3['id']}})[_0x73b1('0x25')](function(){return _0x56803d;});})[_0x73b1('0x25')](function(){_0x4e704b[_0x73b1('0x19')](0xcc)[_0x73b1('0x1a')]();});}};}function handleEntityNotFound(_0x5c24cf,_0x27e6f1){return function(_0x50b8d4){if(!_0x50b8d4){_0x5c24cf[_0x73b1('0x18')](0x194);}return _0x50b8d4;};}function handleError(_0x2cd776,_0x23b76f){_0x23b76f=_0x23b76f||0x1f4;return function(_0x3276ce){logger[_0x73b1('0x29')](_0x3276ce['stack']);if(_0x3276ce[_0x73b1('0x2a')]){delete _0x3276ce[_0x73b1('0x2a')];}_0x2cd776[_0x73b1('0x19')](_0x23b76f)[_0x73b1('0x2b')](_0x3276ce);};}exports[_0x73b1('0x2c')]=function(_0x2cce44,_0x489a75){var _0x396945={},_0x594f23={},_0x202d7b={'count':0x0,'rows':[]};var _0x38fe90=_[_0x73b1('0x2d')](db[_0x73b1('0x2e')][_0x73b1('0x2f')],function(_0x7be85e){return{'name':_0x7be85e[_0x73b1('0x30')],'type':_0x7be85e[_0x73b1('0x31')]['key']};});_0x594f23['model']=_[_0x73b1('0x2d')](_0x38fe90,_0x73b1('0x2a'));_0x594f23[_0x73b1('0x32')]=_[_0x73b1('0x33')](_0x2cce44[_0x73b1('0x32')]);_0x594f23[_0x73b1('0x34')]=_[_0x73b1('0x35')](_0x594f23['model'],_0x594f23[_0x73b1('0x32')]);_0x396945[_0x73b1('0x36')]=_[_0x73b1('0x35')](_0x594f23[_0x73b1('0x37')],qs[_0x73b1('0x38')](_0x2cce44[_0x73b1('0x32')][_0x73b1('0x38')]));_0x396945[_0x73b1('0x36')]=_0x396945[_0x73b1('0x36')][_0x73b1('0x39')]?_0x396945['attributes']:_0x594f23[_0x73b1('0x37')];if(!_0x2cce44[_0x73b1('0x32')]['hasOwnProperty'](_0x73b1('0x3a'))){_0x396945[_0x73b1('0x1d')]=qs[_0x73b1('0x1d')](_0x2cce44[_0x73b1('0x32')][_0x73b1('0x1d')]);_0x396945['offset']=qs[_0x73b1('0x1c')](_0x2cce44[_0x73b1('0x32')][_0x73b1('0x1c')]);}_0x396945['order']=qs[_0x73b1('0x3b')](_0x2cce44[_0x73b1('0x32')]['sort']);_0x396945[_0x73b1('0x3c')]=qs[_0x73b1('0x34')](_[_0x73b1('0x3d')](_0x2cce44[_0x73b1('0x32')],_0x594f23[_0x73b1('0x34')]),_0x38fe90);if(_0x2cce44['query'][_0x73b1('0x3e')]){_0x396945[_0x73b1('0x3c')]=_[_0x73b1('0x3f')](_0x396945['where'],{'$or':_[_0x73b1('0x2d')](_0x38fe90,function(_0xae5570){if(_0xae5570[_0x73b1('0x31')]!=='VIRTUAL'){var _0x439a6c={};_0x439a6c[_0xae5570[_0x73b1('0x2a')]]={'$like':'%'+_0x2cce44[_0x73b1('0x32')][_0x73b1('0x3e')]+'%'};return _0x439a6c;}})});}_0x396945=_[_0x73b1('0x3f')]({},_0x396945,_0x2cce44[_0x73b1('0x40')]);var _0x4f73b3={'where':_0x396945[_0x73b1('0x3c')]};return db[_0x73b1('0x2e')][_0x73b1('0x1f')](_0x4f73b3)[_0x73b1('0x25')](function(_0x237ab1){_0x202d7b[_0x73b1('0x1f')]=_0x237ab1;if(_0x2cce44['query'][_0x73b1('0x41')]){_0x396945[_0x73b1('0x42')]=[{'all':!![]}];}return db[_0x73b1('0x2e')][_0x73b1('0x43')](_0x396945);})['then'](function(_0x187f28){_0x202d7b['rows']=_0x187f28;return _0x202d7b;})[_0x73b1('0x25')](respondWithFilteredResult(_0x489a75,_0x396945))['catch'](handleError(_0x489a75,null));};exports['show']=function(_0x1df20f,_0x36d28b){var _0x48d293={'raw':![],'where':{'id':_0x1df20f[_0x73b1('0x44')]['id']}},_0x2d0cfa={};_0x2d0cfa[_0x73b1('0x37')]=_['keys'](db['Trigger'][_0x73b1('0x2f')]);_0x2d0cfa[_0x73b1('0x32')]=_[_0x73b1('0x33')](_0x1df20f[_0x73b1('0x32')]);_0x2d0cfa[_0x73b1('0x34')]=_['intersection'](_0x2d0cfa[_0x73b1('0x37')],_0x2d0cfa[_0x73b1('0x32')]);_0x48d293['attributes']=_[_0x73b1('0x35')](_0x2d0cfa['model'],qs[_0x73b1('0x38')](_0x1df20f['query'][_0x73b1('0x38')]));_0x48d293[_0x73b1('0x36')]=_0x48d293[_0x73b1('0x36')][_0x73b1('0x39')]?_0x48d293[_0x73b1('0x36')]:_0x2d0cfa[_0x73b1('0x37')];if(_0x1df20f[_0x73b1('0x32')][_0x73b1('0x41')]){_0x48d293[_0x73b1('0x42')]=[{'all':!![]}];}_0x48d293=_[_0x73b1('0x3f')]({},_0x48d293,_0x1df20f['options']);return db[_0x73b1('0x2e')]['find'](_0x48d293)[_0x73b1('0x25')](handleEntityNotFound(_0x36d28b,null))['then'](respondWithResult(_0x36d28b,null))[_0x73b1('0x45')](handleError(_0x36d28b,null));};exports[_0x73b1('0x46')]=function(_0x36dacc,_0x56510f){return db[_0x73b1('0x2e')][_0x73b1('0x46')](_0x36dacc['body'],{})['then'](function(_0xc9e087){var _0x349f1e=_0x36dacc[_0x73b1('0x47')]['get']({'plain':!![]});if(!_0x349f1e)throw new Error(_0x73b1('0x48'));if(_0x349f1e[_0x73b1('0x49')]===_0x73b1('0x47')){var _0x9fec2=_0xc9e087['get']({'plain':!![]});var _0x46d0f7=_0x73b1('0x4a');return db[_0x73b1('0x4b')][_0x73b1('0x4c')]({'where':{'name':_0x46d0f7,'userProfileId':_0x349f1e[_0x73b1('0x4d')]},'raw':!![]})[_0x73b1('0x25')](function(_0x5a6f22){if(_0x5a6f22&&_0x5a6f22['autoAssociation']===0x0){return db['UserProfileResource'][_0x73b1('0x46')]({'name':_0x9fec2[_0x73b1('0x2a')],'resourceId':_0x9fec2['id'],'type':_0x5a6f22[_0x73b1('0x2a')],'sectionId':_0x5a6f22['id']},{})[_0x73b1('0x25')](function(){return _0xc9e087;});}else{return _0xc9e087;}})['catch'](function(_0x59243e){logger[_0x73b1('0x29')](_0x73b1('0x4e'),_0x59243e);throw _0x59243e;});}return _0xc9e087;})[_0x73b1('0x25')](respondWithResult(_0x56510f,0xc9))[_0x73b1('0x45')](handleError(_0x56510f,null));};exports['update']=function(_0x35147a,_0x321ace){if(_0x35147a[_0x73b1('0x4f')]['id']){delete _0x35147a[_0x73b1('0x4f')]['id'];}return db[_0x73b1('0x2e')][_0x73b1('0x4c')]({'where':{'id':_0x35147a['params']['id']}})[_0x73b1('0x25')](handleEntityNotFound(_0x321ace,null))[_0x73b1('0x25')](saveUpdates(_0x35147a[_0x73b1('0x4f')],null))[_0x73b1('0x25')](respondWithResult(_0x321ace,null))['catch'](handleError(_0x321ace,null));};exports['destroy']=function(_0x2a0129,_0x377620){return db[_0x73b1('0x2e')][_0x73b1('0x4c')]({'where':{'id':_0x2a0129[_0x73b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x377620,null))[_0x73b1('0x25')](removeEntity(_0x377620,null))['catch'](handleError(_0x377620,null));};exports[_0x73b1('0x50')]=function(_0xf4751d,_0x456141,_0x541304){if(_0xf4751d[_0x73b1('0x4f')]['id']){delete _0xf4751d['body']['id'];}return db['Trigger'][_0x73b1('0x4c')]({'where':{'id':_0xf4751d[_0x73b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x456141,null))[_0x73b1('0x25')](function(_0x31bc46){if(_0x31bc46){_0xf4751d[_0x73b1('0x4f')][_0x73b1('0x51')]=_0x31bc46['id'];return db['Condition'][_0x73b1('0x46')](_0xf4751d[_0x73b1('0x4f')]);}})['then'](respondWithResult(_0x456141,null))['catch'](handleError(_0x456141,null));};exports[_0x73b1('0x52')]=function(_0x3e3ecf,_0x290cb6,_0x2a2843){if(_0x3e3ecf[_0x73b1('0x4f')]['id']){delete _0x3e3ecf[_0x73b1('0x4f')]['id'];}return db[_0x73b1('0x2e')][_0x73b1('0x4c')]({'where':{'id':_0x3e3ecf[_0x73b1('0x44')]['id']}})[_0x73b1('0x25')](handleEntityNotFound(_0x290cb6,null))[_0x73b1('0x25')](function(_0x712f54){if(_0x712f54){_0x3e3ecf['body']['TriggerAnyId']=_0x712f54['id'];return db[_0x73b1('0x53')]['create'](_0x3e3ecf[_0x73b1('0x4f')]);}})[_0x73b1('0x25')](respondWithResult(_0x290cb6,null))['catch'](handleError(_0x290cb6,null));};exports[_0x73b1('0x54')]=function(_0x2e0a0b,_0x362ea5,_0x37857c){var _0xd836c0={};var _0x3a108f={};var _0x4d4b15;var _0x69c99d;return db['Trigger'][_0x73b1('0x55')]({'where':{'id':_0x2e0a0b[_0x73b1('0x44')]['id']}})[_0x73b1('0x25')](handleEntityNotFound(_0x362ea5,null))['then'](function(_0x3551ce){if(_0x3551ce){_0x4d4b15=_0x3551ce;_0x3a108f[_0x73b1('0x37')]=_[_0x73b1('0x33')](db['Condition']['rawAttributes']);_0x3a108f['query']=_['keys'](_0x2e0a0b[_0x73b1('0x32')]);_0x3a108f[_0x73b1('0x34')]=_[_0x73b1('0x35')](_0x3a108f[_0x73b1('0x37')],_0x3a108f[_0x73b1('0x32')]);_0xd836c0[_0x73b1('0x36')]=_[_0x73b1('0x35')](_0x3a108f['model'],qs[_0x73b1('0x38')](_0x2e0a0b[_0x73b1('0x32')]['fields']));_0xd836c0[_0x73b1('0x36')]=_0xd836c0[_0x73b1('0x36')][_0x73b1('0x39')]?_0xd836c0[_0x73b1('0x36')]:_0x3a108f['model'];_0xd836c0[_0x73b1('0x56')]=qs[_0x73b1('0x3b')](_0x2e0a0b[_0x73b1('0x32')][_0x73b1('0x3b')]);_0xd836c0[_0x73b1('0x3c')]=qs[_0x73b1('0x34')](_['pick'](_0x2e0a0b[_0x73b1('0x32')],_0x3a108f[_0x73b1('0x34')]));if(_0x2e0a0b[_0x73b1('0x32')][_0x73b1('0x3e')]){_0xd836c0[_0x73b1('0x3c')]=_[_0x73b1('0x3f')](_0xd836c0[_0x73b1('0x3c')],{'$or':_[_0x73b1('0x2d')](_0xd836c0[_0x73b1('0x36')],function(_0x355a12){var _0x4f271a={};_0x4f271a[_0x355a12]={'$like':'%'+_0x2e0a0b['query'][_0x73b1('0x3e')]+'%'};return _0x4f271a;})});}_0xd836c0=_[_0x73b1('0x3f')]({},_0xd836c0,_0x2e0a0b['options']);return _0x4d4b15[_0x73b1('0x54')](_0xd836c0);}})[_0x73b1('0x25')](function(_0x5bc991){if(_0x5bc991){_0x69c99d=_0x5bc991['length'];if(!_0x2e0a0b[_0x73b1('0x32')][_0x73b1('0x57')]('nolimit')){_0xd836c0[_0x73b1('0x1d')]=qs[_0x73b1('0x1d')](_0x2e0a0b[_0x73b1('0x32')][_0x73b1('0x1d')]);_0xd836c0[_0x73b1('0x1c')]=qs[_0x73b1('0x1c')](_0x2e0a0b['query'][_0x73b1('0x1c')]);}return _0x4d4b15[_0x73b1('0x54')](_0xd836c0);}})[_0x73b1('0x25')](function(_0xbe2e03){if(_0xbe2e03){return _0xbe2e03?{'count':_0x69c99d,'rows':_0xbe2e03}:null;}})['then'](respondWithResult(_0x362ea5,null))[_0x73b1('0x45')](handleError(_0x362ea5,null));};exports['getAnyConditions']=function(_0x1897b8,_0xfdf8b8,_0x5475d8){var _0x2bd7ff={};var _0x3c0743={};var _0x1ac901;var _0x2f90cf;return db[_0x73b1('0x2e')][_0x73b1('0x55')]({'where':{'id':_0x1897b8[_0x73b1('0x44')]['id']}})[_0x73b1('0x25')](handleEntityNotFound(_0xfdf8b8,null))[_0x73b1('0x25')](function(_0x40ca61){if(_0x40ca61){_0x1ac901=_0x40ca61;_0x3c0743[_0x73b1('0x37')]=_['keys'](db['Condition'][_0x73b1('0x2f')]);_0x3c0743[_0x73b1('0x32')]=_[_0x73b1('0x33')](_0x1897b8[_0x73b1('0x32')]);_0x3c0743[_0x73b1('0x34')]=_[_0x73b1('0x35')](_0x3c0743[_0x73b1('0x37')],_0x3c0743['query']);_0x2bd7ff[_0x73b1('0x36')]=_[_0x73b1('0x35')](_0x3c0743[_0x73b1('0x37')],qs['fields'](_0x1897b8[_0x73b1('0x32')][_0x73b1('0x38')]));_0x2bd7ff[_0x73b1('0x36')]=_0x2bd7ff[_0x73b1('0x36')][_0x73b1('0x39')]?_0x2bd7ff[_0x73b1('0x36')]:_0x3c0743['model'];_0x2bd7ff[_0x73b1('0x56')]=qs[_0x73b1('0x3b')](_0x1897b8[_0x73b1('0x32')]['sort']);_0x2bd7ff[_0x73b1('0x3c')]=qs[_0x73b1('0x34')](_['pick'](_0x1897b8['query'],_0x3c0743[_0x73b1('0x34')]));if(_0x1897b8[_0x73b1('0x32')][_0x73b1('0x3e')]){_0x2bd7ff[_0x73b1('0x3c')]=_[_0x73b1('0x3f')](_0x2bd7ff[_0x73b1('0x3c')],{'$or':_[_0x73b1('0x2d')](_0x2bd7ff[_0x73b1('0x36')],function(_0x30b63a){var _0x6c6f6d={};_0x6c6f6d[_0x30b63a]={'$like':'%'+_0x1897b8['query'][_0x73b1('0x3e')]+'%'};return _0x6c6f6d;})});}_0x2bd7ff=_[_0x73b1('0x3f')]({},_0x2bd7ff,_0x1897b8[_0x73b1('0x40')]);return _0x1ac901['getAnyConditions'](_0x2bd7ff);}})[_0x73b1('0x25')](function(_0x2f0f8e){if(_0x2f0f8e){_0x2f90cf=_0x2f0f8e['length'];if(!_0x1897b8['query']['hasOwnProperty'](_0x73b1('0x3a'))){_0x2bd7ff['limit']=qs['limit'](_0x1897b8[_0x73b1('0x32')][_0x73b1('0x1d')]);_0x2bd7ff['offset']=qs[_0x73b1('0x1c')](_0x1897b8[_0x73b1('0x32')][_0x73b1('0x1c')]);}return _0x1ac901[_0x73b1('0x58')](_0x2bd7ff);}})[_0x73b1('0x25')](function(_0x502803){if(_0x502803){return _0x502803?{'count':_0x2f90cf,'rows':_0x502803}:null;}})[_0x73b1('0x25')](respondWithResult(_0xfdf8b8,null))['catch'](handleError(_0xfdf8b8,null));};exports[_0x73b1('0x59')]=function(_0x1c2e93,_0x1976dc,_0x40d3b9){if(_0x1c2e93[_0x73b1('0x4f')]['id']){delete _0x1c2e93[_0x73b1('0x4f')]['id'];}return db[_0x73b1('0x2e')]['find']({'where':{'id':_0x1c2e93['params']['id']}})['then'](handleEntityNotFound(_0x1976dc,null))[_0x73b1('0x25')](function(_0x5eb6d8){if(_0x5eb6d8){_0x1c2e93[_0x73b1('0x4f')][_0x73b1('0x5a')]=_0x5eb6d8['id'];return db[_0x73b1('0x5b')][_0x73b1('0x46')](_0x1c2e93['body']);}})[_0x73b1('0x25')](respondWithResult(_0x1976dc,null))['catch'](handleError(_0x1976dc,null));};exports['getActions']=function(_0x256920,_0x23abd1,_0x2c5a5a){var _0x15d91d={};var _0x2b3d9a={};var _0x4731b7;var _0x58a644;return db[_0x73b1('0x2e')][_0x73b1('0x55')]({'where':{'id':_0x256920['params']['id']}})[_0x73b1('0x25')](handleEntityNotFound(_0x23abd1,null))[_0x73b1('0x25')](function(_0x26bbab){if(_0x26bbab){_0x4731b7=_0x26bbab;_0x2b3d9a[_0x73b1('0x37')]=_[_0x73b1('0x33')](db[_0x73b1('0x5b')][_0x73b1('0x2f')]);_0x2b3d9a[_0x73b1('0x32')]=_[_0x73b1('0x33')](_0x256920[_0x73b1('0x32')]);_0x2b3d9a[_0x73b1('0x34')]=_['intersection'](_0x2b3d9a[_0x73b1('0x37')],_0x2b3d9a[_0x73b1('0x32')]);_0x15d91d[_0x73b1('0x36')]=_['intersection'](_0x2b3d9a[_0x73b1('0x37')],qs[_0x73b1('0x38')](_0x256920[_0x73b1('0x32')]['fields']));_0x15d91d[_0x73b1('0x36')]=_0x15d91d[_0x73b1('0x36')][_0x73b1('0x39')]?_0x15d91d[_0x73b1('0x36')]:_0x2b3d9a[_0x73b1('0x37')];_0x15d91d[_0x73b1('0x56')]=qs[_0x73b1('0x3b')](_0x256920[_0x73b1('0x32')][_0x73b1('0x3b')]);_0x15d91d[_0x73b1('0x3c')]=qs[_0x73b1('0x34')](_['pick'](_0x256920[_0x73b1('0x32')],_0x2b3d9a[_0x73b1('0x34')]));if(_0x256920[_0x73b1('0x32')][_0x73b1('0x3e')]){_0x15d91d[_0x73b1('0x3c')]=_[_0x73b1('0x3f')](_0x15d91d['where'],{'$or':_[_0x73b1('0x2d')](_0x15d91d[_0x73b1('0x36')],function(_0x39f0b9){var _0x2582c0={};_0x2582c0[_0x39f0b9]={'$like':'%'+_0x256920['query']['filter']+'%'};return _0x2582c0;})});}_0x15d91d=_['merge']({},_0x15d91d,_0x256920[_0x73b1('0x40')]);return _0x4731b7['getActions'](_0x15d91d);}})[_0x73b1('0x25')](function(_0x5b5e6f){if(_0x5b5e6f){_0x58a644=_0x5b5e6f[_0x73b1('0x39')];if(!_0x256920['query']['hasOwnProperty'](_0x73b1('0x3a'))){_0x15d91d[_0x73b1('0x1d')]=qs[_0x73b1('0x1d')](_0x256920['query'][_0x73b1('0x1d')]);_0x15d91d[_0x73b1('0x1c')]=qs[_0x73b1('0x1c')](_0x256920['query'][_0x73b1('0x1c')]);}return _0x4731b7[_0x73b1('0x5c')](_0x15d91d);}})['then'](function(_0x2dd3f7){if(_0x2dd3f7){return _0x2dd3f7?{'count':_0x58a644,'rows':_0x2dd3f7}:null;}})[_0x73b1('0x25')](respondWithResult(_0x23abd1,null))[_0x73b1('0x45')](handleError(_0x23abd1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 90c19b2..370e98c 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 _0x6a88=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','lodash'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x6a88,0xa9));var _0x86a8=function(_0x26a74d,_0x37ecfc){_0x26a74d=_0x26a74d-0x0;var _0xcbb1a3=_0x6a88[_0x26a74d];return _0xcbb1a3;};'use strict';var _=require(_0x86a8('0x0'));var util=require(_0x86a8('0x1'));var logger=require(_0x86a8('0x2'))(_0x86a8('0x3'));var moment=require(_0x86a8('0x4'));var BPromise=require(_0x86a8('0x5'));var rp=require(_0x86a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86a8('0x7'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x86a8('0x8')]=function(_0x29a32a,_0x4b4eb7){return _0x29a32a[_0x86a8('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x692c=['Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x2348a1,_0x155eb5){var _0x429a2e=function(_0x3aa354){while(--_0x3aa354){_0x2348a1['push'](_0x2348a1['shift']());}};_0x429a2e(++_0x155eb5);}(_0x692c,0x6a));var _0xc692=function(_0x187fd3,_0x5005d0){_0x187fd3=_0x187fd3-0x0;var _0x1721d8=_0x692c[_0x187fd3];return _0x1721d8;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var logger=require(_0xc692('0x2'))(_0xc692('0x3'));var moment=require(_0xc692('0x4'));var BPromise=require(_0xc692('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc692('0x6'));var rimraf=require(_0xc692('0x7'));var config=require(_0xc692('0x8'));var attributes=require(_0xc692('0x9'));module[_0xc692('0xa')]=function(_0x1b54a9,_0x4f8759){return _0x1b54a9['define'](_0xc692('0xb'),attributes,{'tableName':_0xc692('0xc'),'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 4419951..9d9a8a3 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 _0xae2c=['info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','map','include','model','ShowTrigger','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xae2c,0x1f0));var _0xcae2=function(_0x363da9,_0x552a5e){_0x363da9=_0x363da9-0x0;var _0x14ae3d=_0xae2c[_0x363da9];return _0x14ae3d;};'use strict';var _=require(_0xcae2('0x0'));var util=require(_0xcae2('0x1'));var moment=require(_0xcae2('0x2'));var BPromise=require(_0xcae2('0x3'));var rs=require(_0xcae2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcae2('0x5'));var logger=require(_0xcae2('0x6'))(_0xcae2('0x7'));var config=require(_0xcae2('0x8'));var jayson=require(_0xcae2('0x9'));var client=jayson[_0xcae2('0xa')][_0xcae2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x68b8d9,_0x5127bd,_0x141861){return new BPromise(function(_0x1cee9c,_0x131387){return client[_0xcae2('0xc')](_0x68b8d9,_0x141861)[_0xcae2('0xd')](function(_0x4e0750){logger[_0xcae2('0xe')](_0xcae2('0xf'),_0x5127bd,'request\x20sent');logger[_0xcae2('0x10')](_0xcae2('0x11'),_0x5127bd,'request\x20sent',JSON[_0xcae2('0x12')](_0x4e0750));if(_0x4e0750[_0xcae2('0x13')]){if(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x14')]===0x1f4){logger[_0xcae2('0x13')](_0xcae2('0xf'),_0x5127bd,_0x4e0750['error']['message']);return _0x131387(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);}logger['error'](_0xcae2('0xf'),_0x5127bd,_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);return _0x1cee9c(_0x4e0750[_0xcae2('0x13')][_0xcae2('0x15')]);}else{logger['info'](_0xcae2('0xf'),_0x5127bd,'request\x20sent');_0x1cee9c(_0x4e0750['result'][_0xcae2('0x15')]);}})[_0xcae2('0x16')](function(_0x367f2d){logger[_0xcae2('0x13')](_0xcae2('0xf'),_0x5127bd,_0x367f2d);_0x131387(_0x367f2d);});});}exports[_0xcae2('0x17')]=function(_0x4ef3d0){var _0xeab6d1=this;return new Promise(function(_0x2a3904,_0x348e50){return db[_0xcae2('0x18')]['findAll']({'raw':_0x4ef3d0['options']?_0x4ef3d0[_0xcae2('0x19')][_0xcae2('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ef3d0[_0xcae2('0x19')]?_0x4ef3d0['options'][_0xcae2('0x1b')]||null:null,'attributes':_0x4ef3d0[_0xcae2('0x19')]?_0x4ef3d0['options'][_0xcae2('0x1c')]||null:null,'limit':_0x4ef3d0[_0xcae2('0x19')]?_0x4ef3d0['options'][_0xcae2('0x1d')]||null:null,'include':_0x4ef3d0[_0xcae2('0x19')]?_0x4ef3d0[_0xcae2('0x19')]['include']?_[_0xcae2('0x1e')](_0x4ef3d0[_0xcae2('0x19')][_0xcae2('0x1f')],function(_0x570011){return{'model':db[_0x570011['model']],'as':_0x570011['as'],'attributes':_0x570011[_0xcae2('0x1c')],'include':_0x570011[_0xcae2('0x1f')]?_[_0xcae2('0x1e')](_0x570011[_0xcae2('0x1f')],function(_0x1beab6){return{'model':db[_0x1beab6['model']],'as':_0x1beab6['as'],'attributes':_0x1beab6['attributes'],'include':_0x1beab6[_0xcae2('0x1f')]?_[_0xcae2('0x1e')](_0x1beab6[_0xcae2('0x1f')],function(_0x5c116a){return{'model':db[_0x5c116a[_0xcae2('0x20')]],'as':_0x5c116a['as'],'attributes':_0x5c116a[_0xcae2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcae2('0xd')](function(_0x2e9798){logger['info']('GetTrigger',_0x4ef3d0);logger[_0xcae2('0x10')](_0xcae2('0x17'),_0x4ef3d0,JSON[_0xcae2('0x12')](_0x2e9798));_0x2a3904(_0x2e9798);})['catch'](function(_0x10b5ce){logger['error']('GetTrigger',_0x10b5ce[_0xcae2('0x15')],_0x4ef3d0);_0x348e50(_0xeab6d1[_0xcae2('0x13')](0x1f4,_0x10b5ce[_0xcae2('0x15')]));});});};exports['ShowTrigger']=function(_0x9ede19){var _0x2e7a97=this;return new Promise(function(_0x8f2949,_0x4e3385){return db[_0xcae2('0x18')]['find']({'raw':_0x9ede19['options']?_0x9ede19[_0xcae2('0x19')][_0xcae2('0x1a')]===undefined?!![]:![]:!![],'where':_0x9ede19[_0xcae2('0x19')]?_0x9ede19[_0xcae2('0x19')]['where']||null:null,'attributes':_0x9ede19[_0xcae2('0x19')]?_0x9ede19['options']['attributes']||null:null,'include':_0x9ede19[_0xcae2('0x19')]?_0x9ede19[_0xcae2('0x19')][_0xcae2('0x1f')]?_[_0xcae2('0x1e')](_0x9ede19[_0xcae2('0x19')]['include'],function(_0x116f28){return{'model':db[_0x116f28['model']],'as':_0x116f28['as'],'attributes':_0x116f28[_0xcae2('0x1c')],'include':_0x116f28[_0xcae2('0x1f')]?_[_0xcae2('0x1e')](_0x116f28[_0xcae2('0x1f')],function(_0x5dc829){return{'model':db[_0x5dc829['model']],'as':_0x5dc829['as'],'attributes':_0x5dc829[_0xcae2('0x1c')],'include':_0x5dc829['include']?_[_0xcae2('0x1e')](_0x5dc829[_0xcae2('0x1f')],function(_0x46b34e){return{'model':db[_0x46b34e['model']],'as':_0x46b34e['as'],'attributes':_0x46b34e[_0xcae2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a619e){logger[_0xcae2('0xe')](_0xcae2('0x21'),_0x9ede19);logger['debug'](_0xcae2('0x21'),_0x9ede19,JSON[_0xcae2('0x12')](_0x2a619e));_0x8f2949(_0x2a619e);})['catch'](function(_0x7d41ca){logger[_0xcae2('0x13')](_0xcae2('0x21'),_0x7d41ca[_0xcae2('0x15')],_0x9ede19);_0x4e3385(_0x2e7a97[_0xcae2('0x13')](0x1f4,_0x7d41ca['message']));});});}; \ No newline at end of file +var _0x4d96=['then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','stringify','find','ShowTrigger','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2449fe,_0x4aa316){var _0x331449=function(_0x256bd6){while(--_0x256bd6){_0x2449fe['push'](_0x2449fe['shift']());}};_0x331449(++_0x4aa316);}(_0x4d96,0x141));var _0x64d9=function(_0x198f22,_0x41a279){_0x198f22=_0x198f22-0x0;var _0x43e2fe=_0x4d96[_0x198f22];return _0x43e2fe;};'use strict';var _=require(_0x64d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x64d9('0x1'));var rs=require(_0x64d9('0x2'));var fs=require('fs');var Redis=require(_0x64d9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x64d9('0x4'));var logger=require(_0x64d9('0x5'))(_0x64d9('0x6'));var config=require(_0x64d9('0x7'));var jayson=require(_0x64d9('0x8'));var client=jayson[_0x64d9('0x9')][_0x64d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93366,_0x2641f9,_0x560680){return new BPromise(function(_0x23b4d7,_0x1936c6){return client[_0x64d9('0xb')](_0x93366,_0x560680)[_0x64d9('0xc')](function(_0x49ac36){logger[_0x64d9('0xd')](_0x64d9('0xe'),_0x2641f9,_0x64d9('0xf'));logger[_0x64d9('0x10')](_0x64d9('0x11'),_0x2641f9,_0x64d9('0xf'),JSON['stringify'](_0x49ac36));if(_0x49ac36['error']){if(_0x49ac36[_0x64d9('0x12')][_0x64d9('0x13')]===0x1f4){logger[_0x64d9('0x12')]('Trigger,\x20%s,\x20%s',_0x2641f9,_0x49ac36[_0x64d9('0x12')]['message']);return _0x1936c6(_0x49ac36[_0x64d9('0x12')][_0x64d9('0x14')]);}logger['error'](_0x64d9('0xe'),_0x2641f9,_0x49ac36[_0x64d9('0x12')][_0x64d9('0x14')]);return _0x23b4d7(_0x49ac36['error']['message']);}else{logger[_0x64d9('0xd')]('Trigger,\x20%s,\x20%s',_0x2641f9,_0x64d9('0xf'));_0x23b4d7(_0x49ac36[_0x64d9('0x15')]['message']);}})[_0x64d9('0x16')](function(_0x26c0d5){logger[_0x64d9('0x12')](_0x64d9('0xe'),_0x2641f9,_0x26c0d5);_0x1936c6(_0x26c0d5);});});}exports['GetTrigger']=function(_0xb55f6a){var _0x1bbab1=this;return new Promise(function(_0x58d2a6,_0xb77975){return db[_0x64d9('0x17')][_0x64d9('0x18')]({'raw':_0xb55f6a[_0x64d9('0x19')]?_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1a')]===undefined?!![]:![]:!![],'where':_0xb55f6a[_0x64d9('0x19')]?_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1b')]||null:null,'attributes':_0xb55f6a[_0x64d9('0x19')]?_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1c')]||null:null,'limit':_0xb55f6a['options']?_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1d')]||null:null,'include':_0xb55f6a[_0x64d9('0x19')]?_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1e')]?_[_0x64d9('0x1f')](_0xb55f6a[_0x64d9('0x19')][_0x64d9('0x1e')],function(_0x75e331){return{'model':db[_0x75e331[_0x64d9('0x20')]],'as':_0x75e331['as'],'attributes':_0x75e331[_0x64d9('0x1c')],'include':_0x75e331['include']?_[_0x64d9('0x1f')](_0x75e331[_0x64d9('0x1e')],function(_0x5f2133){return{'model':db[_0x5f2133['model']],'as':_0x5f2133['as'],'attributes':_0x5f2133[_0x64d9('0x1c')],'include':_0x5f2133[_0x64d9('0x1e')]?_[_0x64d9('0x1f')](_0x5f2133[_0x64d9('0x1e')],function(_0x1be6d9){return{'model':db[_0x1be6d9[_0x64d9('0x20')]],'as':_0x1be6d9['as'],'attributes':_0x1be6d9[_0x64d9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64d9('0xc')](function(_0x2e3edd){logger[_0x64d9('0xd')](_0x64d9('0x21'),_0xb55f6a);logger[_0x64d9('0x10')](_0x64d9('0x21'),_0xb55f6a,JSON[_0x64d9('0x22')](_0x2e3edd));_0x58d2a6(_0x2e3edd);})[_0x64d9('0x16')](function(_0x40e599){logger[_0x64d9('0x12')](_0x64d9('0x21'),_0x40e599['message'],_0xb55f6a);_0xb77975(_0x1bbab1[_0x64d9('0x12')](0x1f4,_0x40e599[_0x64d9('0x14')]));});});};exports['ShowTrigger']=function(_0x46d1ee){var _0x346d07=this;return new Promise(function(_0x304426,_0x29521f){return db['Trigger'][_0x64d9('0x23')]({'raw':_0x46d1ee[_0x64d9('0x19')]?_0x46d1ee[_0x64d9('0x19')][_0x64d9('0x1a')]===undefined?!![]:![]:!![],'where':_0x46d1ee[_0x64d9('0x19')]?_0x46d1ee[_0x64d9('0x19')][_0x64d9('0x1b')]||null:null,'attributes':_0x46d1ee['options']?_0x46d1ee['options'][_0x64d9('0x1c')]||null:null,'include':_0x46d1ee[_0x64d9('0x19')]?_0x46d1ee[_0x64d9('0x19')][_0x64d9('0x1e')]?_['map'](_0x46d1ee[_0x64d9('0x19')]['include'],function(_0x16b434){return{'model':db[_0x16b434[_0x64d9('0x20')]],'as':_0x16b434['as'],'attributes':_0x16b434[_0x64d9('0x1c')],'include':_0x16b434['include']?_[_0x64d9('0x1f')](_0x16b434['include'],function(_0x4573b2){return{'model':db[_0x4573b2[_0x64d9('0x20')]],'as':_0x4573b2['as'],'attributes':_0x4573b2[_0x64d9('0x1c')],'include':_0x4573b2[_0x64d9('0x1e')]?_[_0x64d9('0x1f')](_0x4573b2['include'],function(_0x521793){return{'model':db[_0x521793['model']],'as':_0x521793['as'],'attributes':_0x521793[_0x64d9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64d9('0xc')](function(_0x57e949){logger[_0x64d9('0xd')]('ShowTrigger',_0x46d1ee);logger[_0x64d9('0x10')](_0x64d9('0x24'),_0x46d1ee,JSON[_0x64d9('0x22')](_0x57e949));_0x304426(_0x57e949);})[_0x64d9('0x16')](function(_0x5ea2b0){logger[_0x64d9('0x12')](_0x64d9('0x24'),_0x5ea2b0[_0x64d9('0x14')],_0x46d1ee);_0x29521f(_0x346d07[_0x64d9('0x12')](0x1f4,_0x5ea2b0[_0x64d9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index afb23e3..b90f3b2 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 _0x66a6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x66a6,0x17b));var _0x666a=function(_0x9a57d3,_0xc6453c){_0x9a57d3=_0x9a57d3-0x0;var _0x45ec2d=_0x66a6[_0x9a57d3];return _0x45ec2d;};'use strict';var multer=require(_0x666a('0x0'));var util=require('util');var path=require(_0x666a('0x1'));var timeout=require(_0x666a('0x2'));var express=require(_0x666a('0x3'));var router=express[_0x666a('0x4')]();var fs_extra=require(_0x666a('0x5'));var auth=require(_0x666a('0x6'));var interaction=require(_0x666a('0x7'));var config=require(_0x666a('0x8'));var controller=require(_0x666a('0x9'));router[_0x666a('0xa')]('/',auth[_0x666a('0xb')](),controller[_0x666a('0xc')]);router[_0x666a('0xa')](_0x666a('0xd'),auth[_0x666a('0xb')](),controller[_0x666a('0xe')]);router[_0x666a('0xf')](_0x666a('0x10'),auth[_0x666a('0xb')](),controller[_0x666a('0x11')]);router[_0x666a('0xf')]('/',auth[_0x666a('0xb')](),controller[_0x666a('0x12')]);router[_0x666a('0x13')]('/:id',auth[_0x666a('0xb')](),controller[_0x666a('0x14')]);router[_0x666a('0x15')](_0x666a('0xd'),auth[_0x666a('0xb')](),controller[_0x666a('0x16')]);module[_0x666a('0x17')]=router; \ No newline at end of file +var _0xeaab=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','/:id','show','post','/:id/clone','create','put','destroy','multer','util','path'];(function(_0x2dd599,_0x56426f){var _0x2b8001=function(_0x4c6dab){while(--_0x4c6dab){_0x2dd599['push'](_0x2dd599['shift']());}};_0x2b8001(++_0x56426f);}(_0xeaab,0x1b2));var _0xbeaa=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xeaab[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xbeaa('0x0'));var util=require(_0xbeaa('0x1'));var path=require(_0xbeaa('0x2'));var timeout=require(_0xbeaa('0x3'));var express=require(_0xbeaa('0x4'));var router=express[_0xbeaa('0x5')]();var fs_extra=require(_0xbeaa('0x6'));var auth=require(_0xbeaa('0x7'));var interaction=require(_0xbeaa('0x8'));var config=require('../../config/environment');var controller=require(_0xbeaa('0x9'));router['get']('/',auth[_0xbeaa('0xa')](),controller[_0xbeaa('0xb')]);router['get'](_0xbeaa('0xc'),auth[_0xbeaa('0xa')](),controller[_0xbeaa('0xd')]);router[_0xbeaa('0xe')](_0xbeaa('0xf'),auth[_0xbeaa('0xa')](),controller['clone']);router[_0xbeaa('0xe')]('/',auth['isAuthenticated'](),controller[_0xbeaa('0x10')]);router[_0xbeaa('0x11')](_0xbeaa('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbeaa('0xc'),auth[_0xbeaa('0xa')](),controller[_0xbeaa('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 1110dab..0c67608 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 _0x83d3=['setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uas','pai','fingerprint','certificate','active','passive','update','update,nonat','BOOLEAN','exports','STRING','ENUM','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x200af4,_0x8416e8){var _0x3831b6=function(_0xf139c0){while(--_0xf139c0){_0x200af4['push'](_0x200af4['shift']());}};_0x3831b6(++_0x8416e8);}(_0x83d3,0x1ca));var _0x383d=function(_0x5555c6,_0x3b388f){_0x5555c6=_0x5555c6-0x0;var _0x5e8dc5=_0x83d3[_0x5555c6];return _0x5e8dc5;};'use strict';var Sequelize=require('sequelize');module[_0x383d('0x0')]={'name':{'type':Sequelize[_0x383d('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x383d('0x2')]('friend','user',_0x383d('0x3')),'allowNull':![],'defaultValue':_0x383d('0x4')},'context':{'type':Sequelize[_0x383d('0x1')],'allowNull':![],'defaultValue':_0x383d('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0x383d('0x6'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x383d('0x7'),_0x383d('0x8'),_0x383d('0x9'),_0x383d('0xa'),_0x383d('0xb'))},'deny':{'type':Sequelize[_0x383d('0x1')]},'permit':{'type':Sequelize[_0x383d('0x1')]},'secret':{'type':Sequelize[_0x383d('0x1')]},'md5secret':{'type':Sequelize[_0x383d('0x1')]},'remotesecret':{'type':Sequelize[_0x383d('0x1')]},'transport':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'udp','set':function(_0x170481){this[_0x383d('0xc')](_0x383d('0xd'),_0x170481?_0x170481[_0x383d('0xe')](','):null);},'get':function(){return this[_0x383d('0xf')]('transport')?this['getDataValue'](_0x383d('0xd'))['split'](','):null;},'comment':_0x383d('0x10')},'dtmfmode':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x11'),_0x383d('0x12'),_0x383d('0x13'),'inband',_0x383d('0x14')),'defaultValue':_0x383d('0x11')},'directmedia':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no',_0x383d('0x16'),'update',_0x383d('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x383d('0x1')]},'nat':{'type':Sequelize[_0x383d('0x1')],'defaultValue':_0x383d('0x18'),'set':function(_0x1d5b89){this[_0x383d('0xc')](_0x383d('0x19'),_0x1d5b89?_0x1d5b89[_0x383d('0xe')](','):null);},'get':function(){return this[_0x383d('0xf')](_0x383d('0x19'))?this['getDataValue'](_0x383d('0x19'))[_0x383d('0x1a')](','):null;},'comment':_0x383d('0x1b')},'callgroup':{'type':Sequelize[_0x383d('0x1')]},'namedcallgroup':{'type':Sequelize[_0x383d('0x1')]},'pickupgroup':{'type':Sequelize[_0x383d('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x383d('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x383d('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x383d('0x1')],'defaultValue':_0x383d('0x1c')},'allow':{'type':Sequelize[_0x383d('0x1')],'allowNull':![],'defaultValue':_0x383d('0x1d'),'set':function(_0x5a9b0b){this['setDataValue']('allow',_0x5a9b0b?_0x5a9b0b[_0x383d('0xe')](';'):_0x383d('0x1d'));},'get':function(){return this[_0x383d('0xf')](_0x383d('0x1e'))?this[_0x383d('0xf')]('allow')[_0x383d('0x1a')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x383d('0x1')],'defaultValue':_0x383d('0x1f'),'set':function(_0x4ba1d6){this[_0x383d('0xc')]('insecure',_0x4ba1d6?_0x4ba1d6[_0x383d('0xe')](','):null);},'get':function(){return this[_0x383d('0xf')](_0x383d('0x20'))?this[_0x383d('0xf')]('insecure')['split'](','):null;},'comment':_0x383d('0x21')},'trustrpid':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no','never')},'promiscredir':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'accountcode':{'type':Sequelize[_0x383d('0x22')](0xb)},'setvar':{'type':Sequelize[_0x383d('0x1')]},'callerid':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no'),'defaultValue':_0x383d('0x15')},'busylevel':{'type':Sequelize[_0x383d('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x383d('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x383d('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no',_0x383d('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x383d('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'mailbox':{'type':Sequelize[_0x383d('0x1')]},'session_timers':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x24'),_0x383d('0x25'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x383d('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x383d('0x2')]('uac',_0x383d('0x26')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x383d('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x383d('0x1')]},'fromuser':{'type':Sequelize[_0x383d('0x1')]},'port':{'type':Sequelize[_0x383d('0x22')](0x5)},'qualify':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no'),'defaultValue':_0x383d('0x15')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x383d('0x1')]},'defaultuser':{'type':Sequelize[_0x383d('0x1')]},'rtptimeout':{'type':Sequelize[_0x383d('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x383d('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x383d('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x383d('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x383d('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x383d('0x22')](0xb)},'timerb':{'type':Sequelize[_0x383d('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x383d('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x383d('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x383d('0x1')]},'maxforwards':{'type':Sequelize[_0x383d('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'icesupport':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no',_0x383d('0x28'),_0x383d('0x29'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x383d('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x383d('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x383d('0x1')]},'dtlssetup':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x2a'),_0x383d('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x383d('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x383d('0x1')]},'recordofffeature':{'type':Sequelize[_0x383d('0x1')]},'call_limit':{'type':Sequelize[_0x383d('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x383d('0x15'),'no')},'vmexten':{'type':Sequelize[_0x383d('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x383d('0x1')]},'description':{'type':Sequelize[_0x383d('0x1')]},'host':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x383d('0x2')](_0x383d('0x15'),'no',_0x383d('0x16'),_0x383d('0x2c'),_0x383d('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x383d('0x1')]},'otherFields':{'type':Sequelize[_0x383d('0x1')]},'active':{'type':Sequelize[_0x383d('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x9abc=['yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','join','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','peer','friend','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info'];(function(_0xbd8083,_0x4a7ca3){var _0x59c022=function(_0x351d92){while(--_0x351d92){_0xbd8083['push'](_0xbd8083['shift']());}};_0x59c022(++_0x4a7ca3);}(_0x9abc,0x116));var _0xc9ab=function(_0x3b4dd0,_0x2552c5){_0x3b4dd0=_0x3b4dd0-0x0;var _0x51e2b5=_0x9abc[_0x3b4dd0];return _0x51e2b5;};'use strict';var Sequelize=require(_0xc9ab('0x0'));module[_0xc9ab('0x1')]={'name':{'type':Sequelize[_0xc9ab('0x2')],'allowNull':![],'unique':_0xc9ab('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user',_0xc9ab('0x4')),'allowNull':![],'defaultValue':_0xc9ab('0x5')},'context':{'type':Sequelize[_0xc9ab('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x7'),'ALLOWED_PASSED_SCREEN',_0xc9ab('0x8'),_0xc9ab('0x9'),_0xc9ab('0xa'),_0xc9ab('0xb'),_0xc9ab('0xc'),_0xc9ab('0xd'))},'deny':{'type':Sequelize[_0xc9ab('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xc9ab('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xc9ab('0x2')]},'transport':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':_0xc9ab('0xe'),'set':function(_0x5145a0){this[_0xc9ab('0xf')]('transport',_0x5145a0?_0x5145a0['join'](','):null);},'get':function(){return this[_0xc9ab('0x10')](_0xc9ab('0x11'))?this['getDataValue']('transport')[_0xc9ab('0x12')](','):null;},'comment':_0xc9ab('0x13')},'dtmfmode':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x14'),_0xc9ab('0x15'),'shortinfo','inband','auto'),'defaultValue':_0xc9ab('0x14')},'directmedia':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no','nonat',_0xc9ab('0x17'),_0xc9ab('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc9ab('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc9ab('0x2')]},'directmediadeny':{'type':Sequelize[_0xc9ab('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xc9ab('0x19'),'set':function(_0x489283){this[_0xc9ab('0xf')](_0xc9ab('0x1a'),_0x489283?_0x489283['join'](','):null);},'get':function(){return this[_0xc9ab('0x10')](_0xc9ab('0x1a'))?this[_0xc9ab('0x10')](_0xc9ab('0x1a'))[_0xc9ab('0x12')](','):null;},'comment':_0xc9ab('0x1b')},'callgroup':{'type':Sequelize[_0xc9ab('0x2')]},'namedcallgroup':{'type':Sequelize[_0xc9ab('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xc9ab('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc9ab('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xc9ab('0x2')],'allowNull':![],'defaultValue':_0xc9ab('0x1c'),'set':function(_0x599c38){this['setDataValue'](_0xc9ab('0x1d'),_0x599c38?_0x599c38[_0xc9ab('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xc9ab('0x10')](_0xc9ab('0x1d'))?this[_0xc9ab('0x10')](_0xc9ab('0x1d'))[_0xc9ab('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xc9ab('0x6')]('yes','no')},'insecure':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':_0xc9ab('0x1f'),'set':function(_0x1e1d03){this['setDataValue'](_0xc9ab('0x20'),_0x1e1d03?_0x1e1d03[_0xc9ab('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0xc9ab('0x20'))?this[_0xc9ab('0x10')]('insecure')[_0xc9ab('0x12')](','):null;},'comment':_0xc9ab('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0xc9ab('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc9ab('0x16'),'no',_0xc9ab('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0xc9ab('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xc9ab('0x16'),'no')},'accountcode':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'setvar':{'type':Sequelize[_0xc9ab('0x2')]},'callerid':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':_0xc9ab('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no'),'defaultValue':_0xc9ab('0x16')},'busylevel':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xc9ab('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xc9ab('0x6')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xc9ab('0x2')]},'template':{'type':Sequelize[_0xc9ab('0x2')]},'videosupport':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no',_0xc9ab('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x26'),'refuse','originate')},'session_expires':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x27'),_0xc9ab('0x28')),'defaultValue':_0xc9ab('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xc9ab('0x2')]},'regexten':{'type':Sequelize[_0xc9ab('0x2')]},'fromdomain':{'type':Sequelize[_0xc9ab('0x2')]},'fromuser':{'type':Sequelize[_0xc9ab('0x2')]},'port':{'type':Sequelize[_0xc9ab('0x23')](0x5)},'qualify':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no'),'defaultValue':_0xc9ab('0x16')},'keepalive':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xc9ab('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no',_0xc9ab('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc9ab('0x2')]},'callbackextension':{'type':Sequelize[_0xc9ab('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc9ab('0x2')]},'contactacl':{'type':Sequelize[_0xc9ab('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xc9ab('0x2')]},'use_q850_reason':{'type':Sequelize[_0xc9ab('0x2')]},'maxforwards':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'encryption':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no',_0xc9ab('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xc9ab('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc9ab('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xc9ab('0x2')]},'dtlscipher':{'type':Sequelize[_0xc9ab('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x2b'),_0xc9ab('0x2c'),_0xc9ab('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc9ab('0x2')]},'usereqphone':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc9ab('0x2')]},'recordofffeature':{'type':Sequelize[_0xc9ab('0x2')]},'call_limit':{'type':Sequelize[_0xc9ab('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no')},'vmexten':{'type':Sequelize[_0xc9ab('0x2')]},'mohinterpret':{'type':Sequelize[_0xc9ab('0x2')]},'mohsuggest':{'type':Sequelize[_0xc9ab('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc9ab('0x2')]},'host':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':_0xc9ab('0x2e')},'canreinvite':{'type':Sequelize[_0xc9ab('0x6')](_0xc9ab('0x16'),'no',_0xc9ab('0x2f'),'update',_0xc9ab('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xc9ab('0x2')]},'active':{'type':Sequelize[_0xc9ab('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc9ab('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 63266b3..09e0ff4 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x454ffc,_0x1293df){var _0x232075=function(_0xcc2ec7){while(--_0xcc2ec7){_0x454ffc['push'](_0x454ffc['shift']());}};_0x232075(++_0x1293df);}(_0xe14d,0x1ee));var _0xde14=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xe14d[_0x18cd5b];return _0x5eaa52;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file +var _0x008c=['update','destroy','get','Trunks','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Trunk','findAll','show','params','includeAll','include','options','clone','find','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','server/files/templates/trunk.ejs','join','/etc/asterisk/sip_xcally_registers.conf','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','jayson/promise','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x6d1c65,_0x22df6e){var _0x1e96b4=function(_0xc1aac4){while(--_0xc1aac4){_0x6d1c65['push'](_0x6d1c65['shift']());}};_0x1e96b4(++_0x22df6e);}(_0x008c,0x188));var _0xc008=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0x008c[_0x5958d2];return _0x2a4809;};'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'];var jayson=require(_0xc008('0x18'));var client=jayson[_0xc008('0x19')][_0xc008('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x593f7a,_0x560e28,_0x33f44c,_0x50c1ab){return new BPromise(function(_0x25e13f,_0x4584e1){var _0x2073ef=_0x50c1ab||client;return _0x2073ef[_0xc008('0x1b')](_0x593f7a,_0x33f44c)[_0xc008('0x1c')](function(_0x5ee00b){logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));logger[_0xc008('0x1e')](_0xc008('0x1f'),_0x560e28,_0xc008('0x1d'),JSON['stringify'](_0x5ee00b));if(_0x5ee00b['error']){if(_0x5ee00b['error']['code']===0x1f4){logger[_0xc008('0x20')](_0xc008('0x21'),_0x560e28,_0x5ee00b['error'][_0xc008('0x22')]);return _0x4584e1(_0x5ee00b['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x560e28,_0x5ee00b[_0xc008('0x20')]['message']);return _0x25e13f(_0x5ee00b['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));_0x25e13f(_0x5ee00b[_0xc008('0x23')][_0xc008('0x22')]);}})[_0xc008('0x24')](function(_0x11cc75){logger[_0xc008('0x20')]('Trunk,\x20%s,\x20%s',_0x560e28,_0x11cc75);_0x4584e1(_0x11cc75);});});}function respondWithStatusCode(_0x459fd9,_0x5c85f2){_0x5c85f2=_0x5c85f2||0xcc;return function(_0x58a6ea){if(_0x58a6ea){return _0x459fd9[_0xc008('0x25')](_0x5c85f2);}return _0x459fd9[_0xc008('0x26')](_0x5c85f2)[_0xc008('0x27')]();};}function respondWithResult(_0x3cb28c,_0x5410f5){_0x5410f5=_0x5410f5||0xc8;return function(_0x48582b){if(_0x48582b){return _0x3cb28c['status'](_0x5410f5)[_0xc008('0x28')](_0x48582b);}};}function respondWithFilteredResult(_0x15dade,_0x92c582){return function(_0x2e31c2){if(_0x2e31c2){var _0x5bebd9=typeof _0x92c582['offset']==='undefined'&&typeof _0x92c582['limit']==='undefined';var _0x3865c0=_0x2e31c2[_0xc008('0x29')];var _0x25eae4=_0x5bebd9?0x0:_0x92c582['offset'];var _0x24c14c=_0x5bebd9?_0x2e31c2[_0xc008('0x29')]:_0x92c582[_0xc008('0x2a')]+_0x92c582[_0xc008('0x2b')];var _0x4c5dec;if(_0x24c14c>=_0x3865c0){_0x24c14c=_0x3865c0;_0x4c5dec=0xc8;}else{_0x4c5dec=0xce;}_0x15dade[_0xc008('0x26')](_0x4c5dec);return _0x15dade[_0xc008('0x2c')]('Content-Range',_0x25eae4+'-'+_0x24c14c+'/'+_0x3865c0)['json'](_0x2e31c2);}return null;};}function patchUpdates(_0x539766){return function(_0x1032b2){try{jsonpatch[_0xc008('0x2d')](_0x1032b2,_0x539766,!![]);}catch(_0xf831f2){return BPromise[_0xc008('0x2e')](_0xf831f2);}return _0x1032b2[_0xc008('0x2f')]();};}function saveUpdates(_0xceebc3,_0x294f97){return function(_0x22d8e8){if(_0x22d8e8){return _0x22d8e8[_0xc008('0x30')](_0xceebc3)[_0xc008('0x1c')](function(_0x2f4b6b){return _0x2f4b6b;});}return null;};}function removeEntity(_0x1ac7c8,_0x596ee8){return function(_0x334a09){if(_0x334a09){return _0x334a09[_0xc008('0x31')]()['then'](function(){var _0xaf4b84=_0x334a09[_0xc008('0x32')]({'plain':!![]});var _0x383be7=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x31')]({'where':{'type':_0x383be7,'resourceId':_0xaf4b84['id']}})[_0xc008('0x1c')](function(){return _0x334a09;});})[_0xc008('0x1c')](function(){_0x1ac7c8[_0xc008('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415b87,_0x389a40){return function(_0x459df4){if(!_0x459df4){_0x415b87[_0xc008('0x25')](0x194);}return _0x459df4;};}function handleError(_0x40002f,_0x315562){_0x315562=_0x315562||0x1f4;return function(_0x1667a0){logger['error'](_0x1667a0[_0xc008('0x35')]);if(_0x1667a0[_0xc008('0x36')]){delete _0x1667a0['name'];}_0x40002f[_0xc008('0x26')](_0x315562)[_0xc008('0x37')](_0x1667a0);};}exports['index']=function(_0x263473,_0x2e4ae1){var _0x280e9b={},_0x55ff48={},_0x53b353={'count':0x0,'rows':[]};var _0x478810=_[_0xc008('0x38')](db['Trunk'][_0xc008('0x39')],function(_0x3884dd){return{'name':_0x3884dd[_0xc008('0x3a')],'type':_0x3884dd[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x55ff48[_0xc008('0x3d')]=_[_0xc008('0x38')](_0x478810,_0xc008('0x36'));_0x55ff48[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x263473[_0xc008('0x3e')]);_0x55ff48[_0xc008('0x40')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],_0x55ff48['query']);_0x280e9b[_0xc008('0x42')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x263473['query'][_0xc008('0x43')]));_0x280e9b[_0xc008('0x42')]=_0x280e9b[_0xc008('0x42')][_0xc008('0x44')]?_0x280e9b[_0xc008('0x42')]:_0x55ff48['model'];if(!_0x263473[_0xc008('0x3e')][_0xc008('0x45')](_0xc008('0x46'))){_0x280e9b[_0xc008('0x2b')]=qs[_0xc008('0x2b')](_0x263473['query'][_0xc008('0x2b')]);_0x280e9b[_0xc008('0x2a')]=qs[_0xc008('0x2a')](_0x263473[_0xc008('0x3e')]['offset']);}_0x280e9b[_0xc008('0x47')]=qs[_0xc008('0x48')](_0x263473[_0xc008('0x3e')]['sort']);_0x280e9b[_0xc008('0x49')]=qs['filters'](_[_0xc008('0x4a')](_0x263473['query'],_0x55ff48[_0xc008('0x40')]),_0x478810);if(_0x263473[_0xc008('0x3e')]['filter']){_0x280e9b[_0xc008('0x49')]=_[_0xc008('0x4b')](_0x280e9b[_0xc008('0x49')],{'$or':_['map'](_0x478810,function(_0x1cec64){if(_0x1cec64[_0xc008('0x3b')]!==_0xc008('0x4c')){var _0x44fc5d={};_0x44fc5d[_0x1cec64[_0xc008('0x36')]]={'$like':'%'+_0x263473[_0xc008('0x3e')]['filter']+'%'};return _0x44fc5d;}})});}_0x280e9b=_['merge']({},_0x280e9b,_0x263473['options']);var _0x4552ed={'where':_0x280e9b[_0xc008('0x49')]};return db[_0xc008('0x4d')][_0xc008('0x29')](_0x4552ed)[_0xc008('0x1c')](function(_0x24f6a4){_0x53b353[_0xc008('0x29')]=_0x24f6a4;if(_0x263473[_0xc008('0x3e')]['includeAll']){_0x280e9b['include']=[{'all':!![]}];}return db['Trunk'][_0xc008('0x4e')](_0x280e9b);})[_0xc008('0x1c')](function(_0x158eae){_0x53b353['rows']=_0x158eae;return _0x53b353;})[_0xc008('0x1c')](respondWithFilteredResult(_0x2e4ae1,_0x280e9b))[_0xc008('0x24')](handleError(_0x2e4ae1,null));};exports[_0xc008('0x4f')]=function(_0x1c2c50,_0x4981b4){var _0x56e4ac={'raw':![],'where':{'id':_0x1c2c50[_0xc008('0x50')]['id']}},_0x17ec90={};_0x17ec90[_0xc008('0x3d')]=_[_0xc008('0x3f')](db['Trunk']['rawAttributes']);_0x17ec90[_0xc008('0x3e')]=_['keys'](_0x1c2c50[_0xc008('0x3e')]);_0x17ec90[_0xc008('0x40')]=_[_0xc008('0x41')](_0x17ec90['model'],_0x17ec90[_0xc008('0x3e')]);_0x56e4ac[_0xc008('0x42')]=_[_0xc008('0x41')](_0x17ec90[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x1c2c50['query'][_0xc008('0x43')]));_0x56e4ac[_0xc008('0x42')]=_0x56e4ac['attributes'][_0xc008('0x44')]?_0x56e4ac[_0xc008('0x42')]:_0x17ec90['model'];if(_0x1c2c50['query'][_0xc008('0x51')]){_0x56e4ac[_0xc008('0x52')]=[{'all':!![]}];}_0x56e4ac=_[_0xc008('0x4b')]({},_0x56e4ac,_0x1c2c50[_0xc008('0x53')]);return db[_0xc008('0x4d')]['find'](_0x56e4ac)['then'](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1c')](respondWithResult(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports[_0xc008('0x54')]=function(_0x25d351,_0xf94fcb){var _0x2f1105={'where':{'id':_0x25d351[_0xc008('0x50')]['id']}},_0x44f42d={};_0x44f42d['model']=_[_0xc008('0x3f')](db[_0xc008('0x4d')][_0xc008('0x39')]);_0x2f1105[_0xc008('0x42')]=_[_0xc008('0x41')](_0x44f42d['model'],qs[_0xc008('0x43')](_0x25d351['query']['fields']));_0x2f1105['attributes']=_0x2f1105[_0xc008('0x42')][_0xc008('0x44')]?_0x2f1105[_0xc008('0x42')]:_0x44f42d['model'];if(_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]){_0x2f1105[_0xc008('0x52')]=[{'all':!![]}];}_0x2f1105=_['merge']({},_0x2f1105,_0x25d351[_0xc008('0x53')]);return db[_0xc008('0x4d')][_0xc008('0x55')](_0x2f1105)[_0xc008('0x1c')](handleEntityNotFound(_0xf94fcb,null))['then'](function(_0x4022dd){if(_0x4022dd){var _0x4eaa6d=_0x4022dd[_0xc008('0x32')]({'plain':!![]});_0x4eaa6d=qs[_0xc008('0x56')](_0x4eaa6d,['id',_0xc008('0x57'),_0xc008('0x58')]);_0x25d351[_0xc008('0x59')]=_[_0xc008('0x56')](_0x25d351['body'],['id',_0xc008('0x57'),'updatedAt']);return db['Trunk'][_0xc008('0x5a')](_[_0xc008('0x4b')](_0x4eaa6d,_0x25d351['body']),{'include':_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]?[{'all':!![]}]:undefined})[_0xc008('0x1c')](function(_0x4517c0){var _0x21ee6d=_0x25d351[_0xc008('0x5b')][_0xc008('0x32')]({'plain':!![]});if(!_0x21ee6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ee6d[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x3bfb15=_0x4517c0[_0xc008('0x32')]({'plain':!![]});var _0xb3ca0f=_0xc008('0x33');return db[_0xc008('0x5d')][_0xc008('0x55')]({'where':{'name':_0xb3ca0f,'userProfileId':_0x21ee6d[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x1bef66){if(_0x1bef66&&_0x1bef66[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x3bfb15['name'],'resourceId':_0x3bfb15['id'],'type':_0x1bef66[_0xc008('0x36')],'sectionId':_0x1bef66['id']},{})[_0xc008('0x1c')](function(){return _0x4517c0;});}else{return _0x4517c0;}})[_0xc008('0x24')](function(_0x566dea){logger[_0xc008('0x20')](_0xc008('0x60'),_0x566dea);throw _0x566dea;});}return _0x4517c0;});}})['then'](respondWithResult(_0xf94fcb,0xc9))['catch'](handleError(_0xf94fcb,null));};exports[_0xc008('0x5a')]=function(_0x2a4c2b,_0x7bad14,_0x39083c){var _0x1a2ce7;return db[_0xc008('0x4d')][_0xc008('0x5a')](_0x2a4c2b[_0xc008('0x59')],{'raw':!![]})[_0xc008('0x1c')](function(_0x1b059b){_0x1a2ce7=_0x1b059b;return db[_0xc008('0x4d')]['findAll']({'raw':!![]});})[_0xc008('0x1c')](function(_0x25a52b){var _0xfdb5e3=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],'server/files/templates/trunk.ejs'),_0xc008('0x63'));var _0x46fa7b=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x64')),_0xc008('0x63'));var _0x553f5c=ejs[_0xc008('0x65')](_0xfdb5e3,{'trunks':_0x25a52b||[]});fs['writeFileSync'](_0xc008('0x66'),_0x553f5c);if(_0x1a2ce7[_0xc008('0x67')]){var _0x23012c=ejs[_0xc008('0x65')](_0x46fa7b,{'trunks':_0x25a52b||[]});fs[_0xc008('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x23012c);}})[_0xc008('0x1c')](function(){return respondWithRpcPromise(_0xc008('0x69'),'create',{'module':_0xc008('0x6a')});})['then'](function(){var _0x278cbe=_0x2a4c2b['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x278cbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278cbe[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x33d8e4=_0x1a2ce7[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x55')]({'where':{'name':_0xc008('0x33'),'userProfileId':_0x278cbe[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x321500){if(_0x321500&&_0x321500[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x33d8e4['name'],'resourceId':_0x33d8e4['id'],'type':_0x321500[_0xc008('0x36')],'sectionId':_0x321500['id']},{})['then'](function(){return _0x1a2ce7;});}else{return _0x1a2ce7;}})['catch'](function(_0x4c84da){logger[_0xc008('0x20')](_0xc008('0x60'),_0x4c84da);throw _0x4c84da;});}return _0x1a2ce7;})[_0xc008('0x1c')](respondWithResult(_0x7bad14,0xc9))[_0xc008('0x24')](handleError(_0x7bad14,null));};exports[_0xc008('0x30')]=function(_0x2e9646,_0x23ef42,_0x519328){var _0x127bdf;return db['Trunk'][_0xc008('0x55')]({'where':{'id':_0x2e9646[_0xc008('0x50')]['id']}})[_0xc008('0x1c')](handleEntityNotFound(_0x23ef42,null))[_0xc008('0x1c')](saveUpdates(_0x2e9646[_0xc008('0x59')],null))[_0xc008('0x1c')](function(_0x23d4ff){if(_0x23d4ff){_0x127bdf=_0x23d4ff;return db[_0xc008('0x4d')][_0xc008('0x4e')]({'raw':!![]});}})[_0xc008('0x1c')](function(_0x334ed8){if(_0x334ed8){var _0x1dd9fe=fs['readFileSync'](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x572d93=fs[_0xc008('0x61')](path[_0xc008('0x6c')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3fc44f=ejs[_0xc008('0x65')](_0x1dd9fe,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x66'),_0x3fc44f);var _0x1101b8=ejs[_0xc008('0x65')](_0x572d93,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x6d'),_0x1101b8);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x30'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc644fe){if(_0xc644fe){return _0x127bdf;}})[_0xc008('0x1c')](respondWithResult(_0x23ef42,null))[_0xc008('0x24')](handleError(_0x23ef42,null));};exports[_0xc008('0x31')]=function(_0x2b94b2,_0x37fc2c,_0x4b434f){var _0x5794fe;return db[_0xc008('0x4d')][_0xc008('0x55')]({'where':{'id':_0x2b94b2[_0xc008('0x50')]['id']}})['then'](handleEntityNotFound(_0x37fc2c,null))['then'](removeEntity(_0x37fc2c,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x276de2){var _0x52bf60=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x5bc8b0=fs['readFileSync'](path[_0xc008('0x6c')](config['root'],_0xc008('0x64')),_0xc008('0x63'));var _0x544519=ejs[_0xc008('0x65')](_0x52bf60,{'trunks':_0x276de2});var _0x4db90b=ejs['render'](_0x5bc8b0,{'trunks':_0x276de2});fs[_0xc008('0x68')](_0xc008('0x66'),_0x544519);fs['writeFileSync'](_0xc008('0x6d'),_0x4db90b);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x31'),{'module':'chan_sip.so'});})[_0xc008('0x24')](handleError(_0x37fc2c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0afbfab..996e495 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 _0x0b0b=['path','rimraf','../../config/environment','./trunk.attributes','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b0b,0x102));var _0xb0b0=function(_0x354e4f,_0x5a7d62){_0x354e4f=_0x354e4f-0x0;var _0x2585ba=_0x0b0b[_0x354e4f];return _0x2585ba;};'use strict';var _=require(_0xb0b0('0x0'));var util=require('util');var logger=require(_0xb0b0('0x1'))(_0xb0b0('0x2'));var moment=require(_0xb0b0('0x3'));var BPromise=require(_0xb0b0('0x4'));var rp=require(_0xb0b0('0x5'));var fs=require('fs');var path=require(_0xb0b0('0x6'));var rimraf=require(_0xb0b0('0x7'));var config=require(_0xb0b0('0x8'));var attributes=require(_0xb0b0('0x9'));module['exports']=function(_0x18e678,_0x3616cf){return _0x18e678[_0xb0b0('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x229d=['../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','util','../../config/logger','api','moment','request-promise','path'];(function(_0x385557,_0x35d5c7){var _0x5e1d71=function(_0x5e2f60){while(--_0x5e2f60){_0x385557['push'](_0x385557['shift']());}};_0x5e1d71(++_0x35d5c7);}(_0x229d,0xec));var _0xd229=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x229d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xd229('0x0'));var logger=require(_0xd229('0x1'))(_0xd229('0x2'));var moment=require(_0xd229('0x3'));var BPromise=require('bluebird');var rp=require(_0xd229('0x4'));var fs=require('fs');var path=require(_0xd229('0x5'));var rimraf=require('rimraf');var config=require(_0xd229('0x6'));var attributes=require(_0xd229('0x7'));module[_0xd229('0x8')]=function(_0x4ac79b,_0x523503){return _0x4ac79b['define'](_0xd229('0x9'),attributes,{'tableName':_0xd229('0xa'),'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 e09e20f..23a9708 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 _0x30ca=['jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowTrunk','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x30ca,0x16a));var _0xa30c=function(_0x111256,_0x114397){_0x111256=_0x111256-0x0;var _0x2ab653=_0x30ca[_0x111256];return _0x2ab653;};'use strict';var _=require(_0xa30c('0x0'));var util=require('util');var moment=require(_0xa30c('0x1'));var BPromise=require(_0xa30c('0x2'));var rs=require(_0xa30c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa30c('0x4'))['db'];var utils=require(_0xa30c('0x5'));var logger=require('../../config/logger')(_0xa30c('0x6'));var config=require(_0xa30c('0x7'));var jayson=require(_0xa30c('0x8'));var client=jayson[_0xa30c('0x9')][_0xa30c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x186e30,_0x1c6447,_0x291db7){return new BPromise(function(_0x3e753b,_0x1d9b41){return client[_0xa30c('0xb')](_0x186e30,_0x291db7)['then'](function(_0x370f8d){logger[_0xa30c('0xc')](_0xa30c('0xd'),_0x1c6447,_0xa30c('0xe'));logger[_0xa30c('0xf')](_0xa30c('0x10'),_0x1c6447,_0xa30c('0xe'),JSON[_0xa30c('0x11')](_0x370f8d));if(_0x370f8d[_0xa30c('0x12')]){if(_0x370f8d[_0xa30c('0x12')][_0xa30c('0x13')]===0x1f4){logger[_0xa30c('0x12')]('Trunk,\x20%s,\x20%s',_0x1c6447,_0x370f8d[_0xa30c('0x12')][_0xa30c('0x14')]);return _0x1d9b41(_0x370f8d[_0xa30c('0x12')][_0xa30c('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1c6447,_0x370f8d[_0xa30c('0x12')][_0xa30c('0x14')]);return _0x3e753b(_0x370f8d[_0xa30c('0x12')][_0xa30c('0x14')]);}else{logger[_0xa30c('0xc')](_0xa30c('0xd'),_0x1c6447,_0xa30c('0xe'));_0x3e753b(_0x370f8d[_0xa30c('0x15')]['message']);}})[_0xa30c('0x16')](function(_0x2e46e4){logger[_0xa30c('0x12')](_0xa30c('0xd'),_0x1c6447,_0x2e46e4);_0x1d9b41(_0x2e46e4);});});}exports[_0xa30c('0x17')]=function(_0x2ecd00){var _0x15064a=this;return new Promise(function(_0x3e76dc,_0x319f75){return db[_0xa30c('0x18')][_0xa30c('0x19')]({'raw':_0x2ecd00['options']?_0x2ecd00[_0xa30c('0x1a')][_0xa30c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ecd00[_0xa30c('0x1a')]?_0x2ecd00['options'][_0xa30c('0x1c')]||null:null,'attributes':_0x2ecd00[_0xa30c('0x1a')]?_0x2ecd00[_0xa30c('0x1a')][_0xa30c('0x1d')]||null:null,'limit':_0x2ecd00['options']?_0x2ecd00[_0xa30c('0x1a')][_0xa30c('0x1e')]||null:null,'include':_0x2ecd00[_0xa30c('0x1a')]?_0x2ecd00[_0xa30c('0x1a')][_0xa30c('0x1f')]?_[_0xa30c('0x20')](_0x2ecd00[_0xa30c('0x1a')][_0xa30c('0x1f')],function(_0x1de831){return{'model':db[_0x1de831['model']],'as':_0x1de831['as'],'attributes':_0x1de831[_0xa30c('0x1d')],'include':_0x1de831[_0xa30c('0x1f')]?_[_0xa30c('0x20')](_0x1de831[_0xa30c('0x1f')],function(_0x221dc5){return{'model':db[_0x221dc5[_0xa30c('0x21')]],'as':_0x221dc5['as'],'attributes':_0x221dc5['attributes'],'include':_0x221dc5[_0xa30c('0x1f')]?_[_0xa30c('0x20')](_0x221dc5[_0xa30c('0x1f')],function(_0x5d16fa){return{'model':db[_0x5d16fa['model']],'as':_0x5d16fa['as'],'attributes':_0x5d16fa[_0xa30c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa30c('0x22')](function(_0x55601c){logger[_0xa30c('0xc')](_0xa30c('0x17'),_0x2ecd00);logger['debug'](_0xa30c('0x17'),_0x2ecd00,JSON[_0xa30c('0x11')](_0x55601c));_0x3e76dc(_0x55601c);})[_0xa30c('0x16')](function(_0x11310c){logger[_0xa30c('0x12')](_0xa30c('0x17'),_0x11310c[_0xa30c('0x14')],_0x2ecd00);_0x319f75(_0x15064a[_0xa30c('0x12')](0x1f4,_0x11310c[_0xa30c('0x14')]));});});};exports[_0xa30c('0x23')]=function(_0x4fe976){var _0x3858cf=this;return new Promise(function(_0x483dad,_0x111b17){return db['Trunk'][_0xa30c('0x24')]({'raw':_0x4fe976[_0xa30c('0x1a')]?_0x4fe976['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fe976[_0xa30c('0x1a')]?_0x4fe976[_0xa30c('0x1a')][_0xa30c('0x1c')]||null:null,'attributes':_0x4fe976[_0xa30c('0x1a')]?_0x4fe976[_0xa30c('0x1a')]['attributes']||null:null,'include':_0x4fe976[_0xa30c('0x1a')]?_0x4fe976[_0xa30c('0x1a')][_0xa30c('0x1f')]?_[_0xa30c('0x20')](_0x4fe976[_0xa30c('0x1a')]['include'],function(_0x535097){return{'model':db[_0x535097['model']],'as':_0x535097['as'],'attributes':_0x535097[_0xa30c('0x1d')],'include':_0x535097[_0xa30c('0x1f')]?_[_0xa30c('0x20')](_0x535097[_0xa30c('0x1f')],function(_0x5b0992){return{'model':db[_0x5b0992['model']],'as':_0x5b0992['as'],'attributes':_0x5b0992[_0xa30c('0x1d')],'include':_0x5b0992['include']?_['map'](_0x5b0992[_0xa30c('0x1f')],function(_0x275d7c){return{'model':db[_0x275d7c[_0xa30c('0x21')]],'as':_0x275d7c['as'],'attributes':_0x275d7c[_0xa30c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9b7f){logger[_0xa30c('0xc')](_0xa30c('0x23'),_0x4fe976);logger[_0xa30c('0xf')]('ShowTrunk',_0x4fe976,JSON[_0xa30c('0x11')](_0x1f9b7f));_0x483dad(_0x1f9b7f);})['catch'](function(_0x3b22c2){logger[_0xa30c('0x12')](_0xa30c('0x23'),_0x3b22c2['message'],_0x4fe976);_0x111b17(_0x3858cf['error'](0x1f4,_0x3b22c2[_0xa30c('0x14')]));});});}; \ No newline at end of file +var _0x3955=['Trunk','options','raw','limit','include','model','attributes','map','GetTrunk','debug','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2e53cf,_0x235819){var _0x571496=function(_0x57f484){while(--_0x57f484){_0x2e53cf['push'](_0x2e53cf['shift']());}};_0x571496(++_0x235819);}(_0x3955,0x12c));var _0x5395=function(_0x53099a,_0x5e8ad3){_0x53099a=_0x53099a-0x0;var _0x2ac24c=_0x3955[_0x53099a];return _0x2ac24c;};'use strict';var _=require(_0x5395('0x0'));var util=require(_0x5395('0x1'));var moment=require(_0x5395('0x2'));var BPromise=require('bluebird');var rs=require(_0x5395('0x3'));var fs=require('fs');var Redis=require(_0x5395('0x4'));var db=require(_0x5395('0x5'))['db'];var utils=require(_0x5395('0x6'));var logger=require(_0x5395('0x7'))(_0x5395('0x8'));var config=require('../../config/environment');var jayson=require(_0x5395('0x9'));var client=jayson[_0x5395('0xa')][_0x5395('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489c90,_0x5c6a19,_0x4e385b){return new BPromise(function(_0xe45899,_0x4cc2b0){return client[_0x5395('0xc')](_0x489c90,_0x4e385b)[_0x5395('0xd')](function(_0xe1d277){logger[_0x5395('0xe')](_0x5395('0xf'),_0x5c6a19,_0x5395('0x10'));logger['debug'](_0x5395('0x11'),_0x5c6a19,_0x5395('0x10'),JSON[_0x5395('0x12')](_0xe1d277));if(_0xe1d277['error']){if(_0xe1d277[_0x5395('0x13')][_0x5395('0x14')]===0x1f4){logger[_0x5395('0x13')](_0x5395('0xf'),_0x5c6a19,_0xe1d277[_0x5395('0x13')][_0x5395('0x15')]);return _0x4cc2b0(_0xe1d277[_0x5395('0x13')][_0x5395('0x15')]);}logger[_0x5395('0x13')](_0x5395('0xf'),_0x5c6a19,_0xe1d277[_0x5395('0x13')][_0x5395('0x15')]);return _0xe45899(_0xe1d277['error'][_0x5395('0x15')]);}else{logger[_0x5395('0xe')](_0x5395('0xf'),_0x5c6a19,'request\x20sent');_0xe45899(_0xe1d277[_0x5395('0x16')][_0x5395('0x15')]);}})[_0x5395('0x17')](function(_0xf172ae){logger['error'](_0x5395('0xf'),_0x5c6a19,_0xf172ae);_0x4cc2b0(_0xf172ae);});});}exports['GetTrunk']=function(_0x4fb15e){var _0x1cbaba=this;return new Promise(function(_0x567817,_0x327a5c){return db[_0x5395('0x18')]['findAll']({'raw':_0x4fb15e['options']?_0x4fb15e[_0x5395('0x19')][_0x5395('0x1a')]===undefined?!![]:![]:!![],'where':_0x4fb15e[_0x5395('0x19')]?_0x4fb15e['options']['where']||null:null,'attributes':_0x4fb15e[_0x5395('0x19')]?_0x4fb15e['options']['attributes']||null:null,'limit':_0x4fb15e['options']?_0x4fb15e[_0x5395('0x19')][_0x5395('0x1b')]||null:null,'include':_0x4fb15e['options']?_0x4fb15e['options'][_0x5395('0x1c')]?_['map'](_0x4fb15e['options']['include'],function(_0xf2c64f){return{'model':db[_0xf2c64f[_0x5395('0x1d')]],'as':_0xf2c64f['as'],'attributes':_0xf2c64f[_0x5395('0x1e')],'include':_0xf2c64f[_0x5395('0x1c')]?_[_0x5395('0x1f')](_0xf2c64f[_0x5395('0x1c')],function(_0x2268a9){return{'model':db[_0x2268a9[_0x5395('0x1d')]],'as':_0x2268a9['as'],'attributes':_0x2268a9[_0x5395('0x1e')],'include':_0x2268a9[_0x5395('0x1c')]?_[_0x5395('0x1f')](_0x2268a9[_0x5395('0x1c')],function(_0x410dcb){return{'model':db[_0x410dcb['model']],'as':_0x410dcb['as'],'attributes':_0x410dcb[_0x5395('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5395('0xd')](function(_0x4ebc2b){logger[_0x5395('0xe')](_0x5395('0x20'),_0x4fb15e);logger[_0x5395('0x21')]('GetTrunk',_0x4fb15e,JSON[_0x5395('0x12')](_0x4ebc2b));_0x567817(_0x4ebc2b);})[_0x5395('0x17')](function(_0x4f6fb9){logger[_0x5395('0x13')](_0x5395('0x20'),_0x4f6fb9['message'],_0x4fb15e);_0x327a5c(_0x1cbaba[_0x5395('0x13')](0x1f4,_0x4f6fb9[_0x5395('0x15')]));});});};exports['ShowTrunk']=function(_0x3b942e){var _0x48e1da=this;return new Promise(function(_0x9bab66,_0x57964b){return db['Trunk'][_0x5395('0x22')]({'raw':_0x3b942e[_0x5395('0x19')]?_0x3b942e[_0x5395('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3b942e[_0x5395('0x19')]?_0x3b942e[_0x5395('0x19')]['where']||null:null,'attributes':_0x3b942e[_0x5395('0x19')]?_0x3b942e[_0x5395('0x19')]['attributes']||null:null,'include':_0x3b942e[_0x5395('0x19')]?_0x3b942e[_0x5395('0x19')][_0x5395('0x1c')]?_[_0x5395('0x1f')](_0x3b942e[_0x5395('0x19')]['include'],function(_0x2c3faa){return{'model':db[_0x2c3faa[_0x5395('0x1d')]],'as':_0x2c3faa['as'],'attributes':_0x2c3faa[_0x5395('0x1e')],'include':_0x2c3faa[_0x5395('0x1c')]?_[_0x5395('0x1f')](_0x2c3faa[_0x5395('0x1c')],function(_0x3d851a){return{'model':db[_0x3d851a[_0x5395('0x1d')]],'as':_0x3d851a['as'],'attributes':_0x3d851a[_0x5395('0x1e')],'include':_0x3d851a[_0x5395('0x1c')]?_['map'](_0x3d851a[_0x5395('0x1c')],function(_0x14f7bc){return{'model':db[_0x14f7bc[_0x5395('0x1d')]],'as':_0x14f7bc['as'],'attributes':_0x14f7bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x5395('0xd')](function(_0x2f99ce){logger[_0x5395('0xe')](_0x5395('0x23'),_0x3b942e);logger['debug'](_0x5395('0x23'),_0x3b942e,JSON['stringify'](_0x2f99ce));_0x9bab66(_0x2f99ce);})[_0x5395('0x17')](function(_0x1310d4){logger[_0x5395('0x13')](_0x5395('0x23'),_0x1310d4[_0x5395('0x15')],_0x3b942e);_0x57964b(_0x48e1da['error'](0x1f4,_0x1310d4['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 49286e0..6856cca 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 _0x30d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/: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','/:id/api_key','post','addContacts','create','/create_many','addQueues','diskStorage','join','server/files/images/','format','%s-%s','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','/:id','update','changePassword','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x542798,_0x33a985){var _0x1efd62=function(_0x4f2dc4){while(--_0x4f2dc4){_0x542798['push'](_0x542798['shift']());}};_0x1efd62(++_0x33a985);}(_0x30d4,0x1c7));var _0x430d=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x30d4[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x430d('0x0'));var util=require('util');var path=require(_0x430d('0x1'));var timeout=require(_0x430d('0x2'));var express=require(_0x430d('0x3'));var router=express['Router']();var fs_extra=require(_0x430d('0x4'));var auth=require(_0x430d('0x5'));var interaction=require(_0x430d('0x6'));var config=require(_0x430d('0x7'));var controller=require('./user.controller');router[_0x430d('0x8')]('/',auth[_0x430d('0x9')](),controller[_0x430d('0xa')]);router[_0x430d('0x8')](_0x430d('0xb'),auth['isAuthenticated'](),controller[_0x430d('0xc')]);router[_0x430d('0x8')](_0x430d('0xd'),auth[_0x430d('0x9')](),controller[_0x430d('0xe')]);router[_0x430d('0x8')](_0x430d('0xf'),auth[_0x430d('0x9')](),controller[_0x430d('0x10')]);router[_0x430d('0x8')]('/:id',auth[_0x430d('0x9')](),controller[_0x430d('0x11')]);router[_0x430d('0x8')](_0x430d('0x12'),controller[_0x430d('0x13')]);router['get'](_0x430d('0x14'),auth[_0x430d('0x9')](),controller[_0x430d('0x15')]);router['get'](_0x430d('0x16'),auth[_0x430d('0x9')](),controller[_0x430d('0x17')]);router[_0x430d('0x8')](_0x430d('0x18'),auth[_0x430d('0x9')](),controller['getQueues']);router[_0x430d('0x8')]('/:id/queues_rt',auth[_0x430d('0x9')](),controller[_0x430d('0x19')]);router[_0x430d('0x8')](_0x430d('0x1a'),auth[_0x430d('0x9')](),controller[_0x430d('0x1b')]);router['get'](_0x430d('0x1c'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x430d('0x8')](_0x430d('0x1d'),auth['isAuthenticated'](),controller[_0x430d('0x1e')]);router[_0x430d('0x8')]('/:id/chat/interactions',auth[_0x430d('0x9')](),controller[_0x430d('0x1f')]);router[_0x430d('0x8')]('/:id/openchannel/interactions',auth[_0x430d('0x9')](),controller['getOpenchannelInteractions']);router[_0x430d('0x8')](_0x430d('0x20'),auth[_0x430d('0x9')](),controller[_0x430d('0x21')]);router[_0x430d('0x8')](_0x430d('0x22'),auth[_0x430d('0x9')](),controller['getSmsInteractions']);router[_0x430d('0x8')](_0x430d('0x23'),auth[_0x430d('0x9')](),controller[_0x430d('0x24')]);router[_0x430d('0x8')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x430d('0x8')]('/:id/teams',auth[_0x430d('0x9')](),controller[_0x430d('0x25')]);router[_0x430d('0x8')](_0x430d('0x26'),auth['isAuthenticated'](),controller[_0x430d('0x27')]);router[_0x430d('0x8')](_0x430d('0x28'),auth[_0x430d('0x9')](),controller[_0x430d('0x29')]);router['get'](_0x430d('0x2a'),auth[_0x430d('0x9')](),controller[_0x430d('0x2b')]);router[_0x430d('0x8')](_0x430d('0x2c'),auth[_0x430d('0x9')](),controller[_0x430d('0x2d')]);router['get'](_0x430d('0x2e'),auth[_0x430d('0x9')](),controller[_0x430d('0x2f')]);router[_0x430d('0x8')](_0x430d('0x30'),auth[_0x430d('0x9')](),controller[_0x430d('0x31')]);router[_0x430d('0x8')](_0x430d('0x32'),auth[_0x430d('0x9')](),controller['getSmsAccounts']);router[_0x430d('0x8')](_0x430d('0x33'),auth['isAuthenticated'](),controller[_0x430d('0x34')]);router[_0x430d('0x8')](_0x430d('0x35'),auth[_0x430d('0x9')](),controller[_0x430d('0x36')]);router[_0x430d('0x8')](_0x430d('0x37'),auth[_0x430d('0x9')](),controller['getSquareProjects']);router[_0x430d('0x8')](_0x430d('0x38'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x430d('0x8')](_0x430d('0x39'),auth[_0x430d('0x9')](),controller['getApiKey']);router[_0x430d('0x3a')](_0x430d('0x16'),auth[_0x430d('0x9')](),controller[_0x430d('0x3b')]);router[_0x430d('0x3a')]('/',auth[_0x430d('0x9')](),controller[_0x430d('0x3c')]);router[_0x430d('0x3a')](_0x430d('0x3d'),auth[_0x430d('0x9')](),controller['bulkCreate']);router[_0x430d('0x3a')](_0x430d('0x18'),auth[_0x430d('0x9')](),controller[_0x430d('0x3e')]);var upload=multer({'storage':multer[_0x430d('0x3f')]({'destination':function(_0x34cb30,_0x13a7d8,_0x17288a){_0x17288a(null,path[_0x430d('0x40')](config['root'],_0x430d('0x41')));},'filename':function(_0x587628,_0x4b9079,_0x3a436e){_0x3a436e(null,util[_0x430d('0x42')](_0x430d('0x43'),Date['now'](),_0x4b9079['originalname']));}})});router['post']('/:id/avatar',upload[_0x430d('0x44')](_0x430d('0x45')),controller[_0x430d('0x46')]);router[_0x430d('0x3a')](_0x430d('0x47'),auth['isAuthenticated'](),controller['login']);router[_0x430d('0x3a')](_0x430d('0x48'),auth['isAuthenticated'](),controller[_0x430d('0x49')]);router['post'](_0x430d('0x4a'),auth[_0x430d('0x9')](),controller[_0x430d('0x4b')]);router[_0x430d('0x3a')](_0x430d('0x4c'),auth[_0x430d('0x9')](),controller[_0x430d('0x4d')]);router[_0x430d('0x3a')](_0x430d('0x4e'),auth[_0x430d('0x9')](),controller[_0x430d('0x4f')]);router[_0x430d('0x3a')](_0x430d('0x50'),auth[_0x430d('0x9')](),controller[_0x430d('0x51')]);router[_0x430d('0x3a')](_0x430d('0x52'),auth[_0x430d('0x9')](),controller[_0x430d('0x53')]);router[_0x430d('0x3a')](_0x430d('0x54'),auth[_0x430d('0x9')](),controller['addFaxInteractions']);router[_0x430d('0x3a')](_0x430d('0x55'),auth[_0x430d('0x9')](),controller[_0x430d('0x56')]);router['post'](_0x430d('0x57'),auth[_0x430d('0x9')](),controller[_0x430d('0x58')]);router['post']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x430d('0x59')]);router[_0x430d('0x3a')](_0x430d('0x2c'),auth[_0x430d('0x9')](),controller[_0x430d('0x5a')]);router['post']('/:id/mail_accounts',auth[_0x430d('0x9')](),controller[_0x430d('0x5b')]);router[_0x430d('0x3a')]('/:id/openchannel_accounts',auth[_0x430d('0x9')](),controller['addOpenchannelAccounts']);router[_0x430d('0x3a')]('/:id/sms_accounts',auth[_0x430d('0x9')](),controller[_0x430d('0x5c')]);router[_0x430d('0x3a')](_0x430d('0x33'),auth[_0x430d('0x9')](),controller[_0x430d('0x5d')]);router[_0x430d('0x3a')](_0x430d('0x35'),auth[_0x430d('0x9')](),controller[_0x430d('0x5e')]);router[_0x430d('0x3a')](_0x430d('0x37'),auth[_0x430d('0x9')](),controller[_0x430d('0x5f')]);router['post'](_0x430d('0x39'),auth['isAuthenticated'](),controller[_0x430d('0x60')]);router['put'](_0x430d('0x61'),auth[_0x430d('0x9')](),controller[_0x430d('0x62')]);router['put']('/:id/password',auth[_0x430d('0x9')](),controller[_0x430d('0x63')]);router[_0x430d('0x64')](_0x430d('0x18'),auth[_0x430d('0x9')](),controller[_0x430d('0x65')]);router[_0x430d('0x64')](_0x430d('0x4e'),auth['isAuthenticated'](),controller[_0x430d('0x66')]);router[_0x430d('0x64')](_0x430d('0x61'),auth[_0x430d('0x9')](),controller[_0x430d('0x67')]);router['delete'](_0x430d('0x50'),auth[_0x430d('0x9')](),controller['removeChatInteractions']);router[_0x430d('0x64')](_0x430d('0x52'),auth['isAuthenticated'](),controller[_0x430d('0x68')]);router[_0x430d('0x64')]('/:id/fax_interactions',auth[_0x430d('0x9')](),controller[_0x430d('0x69')]);router[_0x430d('0x64')](_0x430d('0x55'),auth[_0x430d('0x9')](),controller['removeSmsInteractions']);router[_0x430d('0x64')](_0x430d('0x57'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x430d('0x64')](_0x430d('0x6a'),auth[_0x430d('0x9')](),controller[_0x430d('0x6b')]);router[_0x430d('0x64')](_0x430d('0x2c'),auth[_0x430d('0x9')](),controller['removeFaxAccounts']);router[_0x430d('0x64')](_0x430d('0x2e'),auth[_0x430d('0x9')](),controller[_0x430d('0x6c')]);router[_0x430d('0x64')](_0x430d('0x30'),auth[_0x430d('0x9')](),controller[_0x430d('0x6d')]);router[_0x430d('0x64')](_0x430d('0x32'),auth[_0x430d('0x9')](),controller[_0x430d('0x6e')]);router[_0x430d('0x64')]('/:id/chat_websites',auth[_0x430d('0x9')](),controller['removeChatWebsites']);router[_0x430d('0x64')](_0x430d('0x35'),auth['isAuthenticated'](),controller[_0x430d('0x6f')]);router[_0x430d('0x64')](_0x430d('0x37'),auth[_0x430d('0x9')](),controller[_0x430d('0x70')]);router['delete'](_0x430d('0x39'),auth[_0x430d('0x9')](),controller[_0x430d('0x71')]);module[_0x430d('0x72')]=router; \ No newline at end of file +var _0xcc3c=['addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','update','put','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeSquareProjects','removeApiKey','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcc3c,0x16f));var _0xccc3=function(_0x3d3187,_0x1ce6c0){_0x3d3187=_0x3d3187-0x0;var _0x40cfd7=_0xcc3c[_0x3d3187];return _0x40cfd7;};'use strict';var multer=require(_0xccc3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xccc3('0x1'));var express=require(_0xccc3('0x2'));var router=express['Router']();var fs_extra=require(_0xccc3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xccc3('0x4'));var config=require(_0xccc3('0x5'));var controller=require(_0xccc3('0x6'));router[_0xccc3('0x7')]('/',auth['isAuthenticated'](),controller[_0xccc3('0x8')]);router[_0xccc3('0x7')](_0xccc3('0x9'),auth['isAuthenticated'](),controller[_0xccc3('0xa')]);router[_0xccc3('0x7')](_0xccc3('0xb'),auth[_0xccc3('0xc')](),controller[_0xccc3('0xd')]);router['get'](_0xccc3('0xe'),auth['isAuthenticated'](),controller[_0xccc3('0xf')]);router[_0xccc3('0x7')](_0xccc3('0x10'),auth[_0xccc3('0xc')](),controller['show']);router['get'](_0xccc3('0x11'),controller[_0xccc3('0x12')]);router['get'](_0xccc3('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0xccc3('0x7')](_0xccc3('0x14'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x15')]);router[_0xccc3('0x7')](_0xccc3('0x16'),auth[_0xccc3('0xc')](),controller['getQueues']);router[_0xccc3('0x7')](_0xccc3('0x17'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x18')]);router[_0xccc3('0x7')](_0xccc3('0x19'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x1a')]);router[_0xccc3('0x7')]('/:id/recordings',auth[_0xccc3('0xc')](),controller[_0xccc3('0x1b')]);router[_0xccc3('0x7')](_0xccc3('0x1c'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xccc3('0x7')]('/:id/chat/interactions',auth[_0xccc3('0xc')](),controller[_0xccc3('0x1d')]);router['get']('/:id/openchannel/interactions',auth[_0xccc3('0xc')](),controller[_0xccc3('0x1e')]);router[_0xccc3('0x7')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0xccc3('0x1f')]);router['get'](_0xccc3('0x20'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x21')]);router[_0xccc3('0x7')](_0xccc3('0x22'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x23')]);router[_0xccc3('0x7')](_0xccc3('0x24'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0xccc3('0x7')](_0xccc3('0x25'),auth[_0xccc3('0xc')](),controller['getTeams']);router[_0xccc3('0x7')](_0xccc3('0x26'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x27')]);router[_0xccc3('0x7')]('/:id/agents',auth[_0xccc3('0xc')](),controller[_0xccc3('0x28')]);router[_0xccc3('0x7')](_0xccc3('0x29'),auth[_0xccc3('0xc')](),controller['getVoicePrefixes']);router['get'](_0xccc3('0x2a'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x2b')]);router[_0xccc3('0x7')]('/:id/mail_accounts',auth[_0xccc3('0xc')](),controller[_0xccc3('0x2c')]);router[_0xccc3('0x7')](_0xccc3('0x2d'),auth['isAuthenticated'](),controller[_0xccc3('0x2e')]);router[_0xccc3('0x7')]('/:id/sms_accounts',auth[_0xccc3('0xc')](),controller[_0xccc3('0x2f')]);router[_0xccc3('0x7')](_0xccc3('0x30'),auth[_0xccc3('0xc')](),controller['getChatWebsites']);router[_0xccc3('0x7')](_0xccc3('0x31'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x32')]);router[_0xccc3('0x7')](_0xccc3('0x33'),auth['isAuthenticated'](),controller[_0xccc3('0x34')]);router[_0xccc3('0x7')](_0xccc3('0x35'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x36')]);router['get']('/:id/api_key',auth[_0xccc3('0xc')](),controller[_0xccc3('0x37')]);router[_0xccc3('0x38')]('/:id/contacts',auth[_0xccc3('0xc')](),controller['addContacts']);router[_0xccc3('0x38')]('/',auth[_0xccc3('0xc')](),controller[_0xccc3('0x39')]);router[_0xccc3('0x38')](_0xccc3('0x3a'),auth[_0xccc3('0xc')](),controller['bulkCreate']);router[_0xccc3('0x38')](_0xccc3('0x16'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x3b')]);var upload=multer({'storage':multer[_0xccc3('0x3c')]({'destination':function(_0x591aea,_0x3aad7d,_0x5839de){_0x5839de(null,path[_0xccc3('0x3d')](config[_0xccc3('0x3e')],_0xccc3('0x3f')));},'filename':function(_0x126379,_0x194ed2,_0x3bc358){_0x3bc358(null,util['format'](_0xccc3('0x40'),Date['now'](),_0x194ed2[_0xccc3('0x41')]));}})});router['post'](_0xccc3('0x11'),upload[_0xccc3('0x42')](_0xccc3('0x43')),controller[_0xccc3('0x44')]);router[_0xccc3('0x38')](_0xccc3('0x45'),auth['isAuthenticated'](),controller[_0xccc3('0x46')]);router['post'](_0xccc3('0x47'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x48')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller['pause']);router[_0xccc3('0x38')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xccc3('0x49')]);router[_0xccc3('0x38')](_0xccc3('0x25'),auth[_0xccc3('0xc')](),controller['addTeams']);router[_0xccc3('0x38')](_0xccc3('0x4a'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x4b')]);router[_0xccc3('0x38')](_0xccc3('0x4c'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x4d')]);router[_0xccc3('0x38')](_0xccc3('0x4e'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x4f')]);router[_0xccc3('0x38')](_0xccc3('0x50'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x51')]);router[_0xccc3('0x38')]('/:id/openchannel_interactions',auth[_0xccc3('0xc')](),controller[_0xccc3('0x52')]);router[_0xccc3('0x38')](_0xccc3('0x53'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x54')]);router[_0xccc3('0x38')]('/:id/fax_accounts',auth[_0xccc3('0xc')](),controller[_0xccc3('0x55')]);router[_0xccc3('0x38')](_0xccc3('0x56'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x57')]);router['post'](_0xccc3('0x2d'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x58')]);router[_0xccc3('0x38')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xccc3('0x59')]);router[_0xccc3('0x38')](_0xccc3('0x30'),auth[_0xccc3('0xc')](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0xccc3('0xc')](),controller[_0xccc3('0x5a')]);router[_0xccc3('0x38')](_0xccc3('0x33'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x5b')]);router[_0xccc3('0x38')](_0xccc3('0x5c'),auth['isAuthenticated'](),controller[_0xccc3('0x5d')]);router['put'](_0xccc3('0x10'),auth['isAuthenticated'](),controller[_0xccc3('0x5e')]);router[_0xccc3('0x5f')]('/:id/password',auth[_0xccc3('0xc')](),controller['changePassword']);router['delete'](_0xccc3('0x16'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x60')]);router[_0xccc3('0x61')](_0xccc3('0x25'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x62')]);router['delete']('/:id',auth[_0xccc3('0xc')](),controller[_0xccc3('0x63')]);router[_0xccc3('0x61')](_0xccc3('0x4a'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x64')]);router['delete'](_0xccc3('0x4c'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x65')]);router['delete'](_0xccc3('0x4e'),auth[_0xccc3('0xc')](),controller['removeFaxInteractions']);router['delete'](_0xccc3('0x50'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x66')]);router[_0xccc3('0x61')](_0xccc3('0x67'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x68')]);router['delete'](_0xccc3('0x53'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x69')]);router['delete'](_0xccc3('0x2a'),auth[_0xccc3('0xc')](),controller['removeFaxAccounts']);router[_0xccc3('0x61')](_0xccc3('0x56'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x6a')]);router[_0xccc3('0x61')](_0xccc3('0x2d'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x6b')]);router['delete'](_0xccc3('0x6c'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x6d')]);router[_0xccc3('0x61')](_0xccc3('0x30'),auth[_0xccc3('0xc')](),controller['removeChatWebsites']);router['delete']('/:id/whatsapp_accounts',auth[_0xccc3('0xc')](),controller['removeWhatsappAccounts']);router[_0xccc3('0x61')](_0xccc3('0x33'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x6e')]);router['delete'](_0xccc3('0x5c'),auth[_0xccc3('0xc')](),controller[_0xccc3('0x6f')]);module[_0xccc3('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index df8abca..1750ec3 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 _0x9206=['util','lodash','exports','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','INTEGER','accountcode','callerid','format','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment'];(function(_0x1f9f27,_0xe2d87b){var _0x183185=function(_0x1f2908){while(--_0x1f2908){_0x1f9f27['push'](_0x1f9f27['shift']());}};_0x183185(++_0xe2d87b);}(_0x9206,0x176));var _0x6920=function(_0x2d1ce2,_0x2461f5){_0x2d1ce2=_0x2d1ce2-0x0;var _0x29bfa0=_0x9206[_0x2d1ce2];return _0x29bfa0;};'use strict';var Sequelize=require(_0x6920('0x0'));var moment=require(_0x6920('0x1'));var util=require(_0x6920('0x2'));var _=require(_0x6920('0x3'));module[_0x6920('0x4')]={'name':{'type':Sequelize[_0x6920('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5774fa){this[_0x6920('0x6')](_0x6920('0x7'),_0x5774fa);this['setDataValue']('defaultuser',_0x5774fa);},'comment':_0x6920('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x21fb21){this[_0x6920('0x6')](_0x6920('0x9'),_0x21fb21);this[_0x6920('0x6')]('callerid',util['format'](_0x6920('0xa'),_0x21fb21,this[_0x6920('0xb')](_0x6920('0xc'))));}},'alias':{'type':Sequelize[_0x6920('0x5')]},'email':{'type':Sequelize[_0x6920('0x5')],'allowNull':![],'unique':_0x6920('0xd'),'validate':{'isEmail':!![]},'set':function(_0x31711e){if(_0x31711e){this[_0x6920('0x6')](_0x6920('0xd'),_0x31711e[_0x6920('0xe')]());}}},'role':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x10'),_0x6920('0x11'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x6920('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6920('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':![],'unique':_0x6920('0xc'),'set':function(_0x18140a){this[_0x6920('0x6')](_0x6920('0xc'),_0x18140a);this['setDataValue'](_0x6920('0x13'),_0x18140a);this[_0x6920('0x6')](_0x6920('0x14'),util[_0x6920('0x15')](_0x6920('0xa'),this[_0x6920('0xb')](_0x6920('0x9')),_0x18140a));}},'salt':{'type':Sequelize[_0x6920('0x5')]},'phone':{'type':Sequelize[_0x6920('0x5')]},'mobile':{'type':Sequelize[_0x6920('0x5')]},'address':{'type':Sequelize[_0x6920('0x5')]},'zipcode':{'type':Sequelize[_0x6920('0x5')]},'userpic':{'type':Sequelize[_0x6920('0x5')]},'city':{'type':Sequelize[_0x6920('0x5')]},'country':{'type':Sequelize[_0x6920('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6920('0x16')]},'voicePause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6920('0x5')],'defaultValue':_0x6920('0x18')},'lastPauseAt':{'type':Sequelize[_0x6920('0x16')]},'chatCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x6920('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![],'defaultValue':_0x6920('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x6920('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x1a'),_0x6920('0x11'),_0x6920('0x1b')),'allowNull':!![],'defaultValue':_0x6920('0x1a')},'context':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x6920('0xf')]('ALLOWED_NOT_SCREENED',_0x6920('0x1c'),'ALLOWED_FAILED_SCREEN',_0x6920('0x1d'),_0x6920('0x1e'),'PROHIB_PASSED_SCREEN',_0x6920('0x1f'),_0x6920('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6920('0x21'),'set':function(_0x641825){this[_0x6920('0x6')](_0x6920('0x22'),_0x641825?_0x641825[_0x6920('0x23')](','):null);},'get':function(){return this[_0x6920('0xb')](_0x6920('0x22'))?this['getDataValue'](_0x6920('0x22'))['split'](','):null;},'comment':_0x6920('0x24')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x6920('0x25'),_0x6920('0x26'),_0x6920('0x27'),_0x6920('0x28')),'allowNull':!![],'defaultValue':_0x6920('0x29')},'directmedia':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no',_0x6920('0x2b'),_0x6920('0x2c'),_0x6920('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6920('0x2e'),'set':function(_0x3fe190){this[_0x6920('0x6')]('nat',_0x3fe190?_0x3fe190[_0x6920('0x23')](','):null);},'get':function(){return this[_0x6920('0xb')](_0x6920('0x2f'))?this[_0x6920('0xb')]('nat')[_0x6920('0x30')](','):null;},'comment':_0x6920('0x31')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x6920('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x6920('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6920('0x5')]},'disallow':{'type':Sequelize[_0x6920('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6920('0x32'),'set':function(_0x1f0c5f){this[_0x6920('0x6')](_0x6920('0x33'),_0x1f0c5f?_0x1f0c5f[_0x6920('0x23')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x6920('0xb')]('allow')['split'](';'):null;},'comment':_0x6920('0x34')},'autoframing':{'type':Sequelize[_0x6920('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![],'set':function(_0x4bb5e5){this[_0x6920('0x6')](_0x6920('0x35'),_0x4bb5e5?_0x4bb5e5[_0x6920('0x23')](','):null);},'get':function(){return this[_0x6920('0xb')](_0x6920('0x35'))?this['getDataValue']('insecure')[_0x6920('0x30')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6920('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6920('0x36')},'amaflags':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x6920('0x2a')},'busylevel':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x6920('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x6920('0x2a'),'no',_0x6920('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x38'),_0x6920('0x39'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x3a'),_0x6920('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6920('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x6920('0x2a')},'keepalive':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6920('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6920('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no',_0x6920('0x3c'),_0x6920('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6920('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x6920('0x3e'),_0x6920('0x3f'),_0x6920('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6920('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no',_0x6920('0x2b'),_0x6920('0x2c'),_0x6920('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x6920('0x16')]},'passwordResetAt':{'type':Sequelize[_0x6920('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x6920('0x42')]},'showWebBar':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0,'set':function(_0xdee444){this[_0x6920('0x6')](_0x6920('0x43'),_0xdee444);var _0x5291bf=this[_0x6920('0x44')]({'plain':!![]});switch(_0xdee444){case 0x0:case 0x1:var _0x5c34c2=_0x5291bf[_0x6920('0x22')]?_[_0x6920('0x45')](_0x5291bf[_0x6920('0x22')])?_0x5291bf[_0x6920('0x22')]['join']():_0x5291bf[_0x6920('0x22')]:_0x6920('0x21');if(_0x5c34c2===_0x6920('0x46')){_0x5c34c2=_0x6920('0x21');}this[_0x6920('0x6')](_0x6920('0x22'),_0x5c34c2);this['setDataValue'](_0x6920('0x47'),'no');this[_0x6920('0x6')]('avpf',null);this[_0x6920('0x6')](_0x6920('0x48'),null);this[_0x6920('0x6')](_0x6920('0x49'),null);this[_0x6920('0x6')](_0x6920('0x4a'),null);this[_0x6920('0x6')](_0x6920('0x4b'),null);this[_0x6920('0x6')](_0x6920('0x4c'),null);this[_0x6920('0x6')](_0x6920('0x4d'),null);this[_0x6920('0x6')](_0x6920('0x4e'),null);this['setDataValue'](_0x6920('0x4f'),'no');break;case 0x2:this[_0x6920('0x6')](_0x6920('0x22'),'wss');this[_0x6920('0x6')](_0x6920('0x47'),_0x6920('0x2a'));this[_0x6920('0x6')](_0x6920('0x50'),'yes');this[_0x6920('0x6')](_0x6920('0x48'),_0x6920('0x2a'));this['setDataValue'](_0x6920('0x49'),'yes');this['setDataValue'](_0x6920('0x4a'),'yes');this[_0x6920('0x6')](_0x6920('0x4b'),'no');this['setDataValue']('dtlssetup',_0x6920('0x40'));this[_0x6920('0x6')](_0x6920('0x4d'),_0x5291bf[_0x6920('0x4d')]||_0x6920('0x51'));this[_0x6920('0x6')](_0x6920('0x4e'),_0x5291bf[_0x6920('0x4e')]||_0x6920('0x52'));this[_0x6920('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x6920('0x42')],'set':function(_0xcdea7){this['setDataValue'](_0x6920('0x53'),_0xcdea7?_0xcdea7['join'](','):[]);},'get':function(){return this[_0x6920('0xb')](_0x6920('0x53'))?_[_0x6920('0x54')](this[_0x6920('0xb')](_0x6920('0x53'))['split'](','),function(_0x568ca4){return parseInt(_0x568ca4,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x6920('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6920('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6920('0xf')](_0x6920('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6920('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6920('0x55')],'get':function(){return this['getDataValue'](_0x6920('0x56'))?this[_0x6920('0xb')](_0x6920('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x6920('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x6920('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![],'set':function(_0x2000c0){if(typeof _0x2000c0===_0x6920('0x57')){var _0x2ac4c6=_0x2000c0==='1'?!![]:_0x2000c0==='0'?![]:_0x2000c0==='true'?!![]:_0x2000c0===_0x6920('0x58')?![]:![];this[_0x6920('0x6')]('screenrecording',_0x2ac4c6);}else{this[_0x6920('0x6')](_0x6920('0x59'),_0x2000c0);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3267fd){this['setDataValue'](_0x6920('0x5a'),_0x3267fd);if(_0x3267fd===!![]){this[_0x6920('0x6')](_0x6920('0x5b'),moment());this[_0x6920('0x6')](_0x6920('0x5c'),0x0);}else{this[_0x6920('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x6920('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6920('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6920('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6920('0x12')](0x5)[_0x6920('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6920('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9b09=['false','screenrecording','blocked','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','defaultuser','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','local','INTEGER','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','auto','rfc2833','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','yes','\x22\x22\x20<>','accept','refuse','originate','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','wss','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b09,0x1ad));var _0x99b0=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x9b09[_0x40927b];return _0x2635e8;};'use strict';var Sequelize=require(_0x99b0('0x0'));var moment=require(_0x99b0('0x1'));var util=require('util');var _=require(_0x99b0('0x2'));module[_0x99b0('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x99b0('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x51e286){this[_0x99b0('0x5')]('name',_0x51e286);this[_0x99b0('0x5')](_0x99b0('0x6'),_0x51e286);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x99b0('0x7')],'allowNull':![],'set':function(_0x220c95){this['setDataValue'](_0x99b0('0x8'),_0x220c95);this[_0x99b0('0x5')](_0x99b0('0x9'),util[_0x99b0('0xa')](_0x99b0('0xb'),_0x220c95,this['getDataValue'](_0x99b0('0xc'))));}},'alias':{'type':Sequelize[_0x99b0('0x7')]},'email':{'type':Sequelize[_0x99b0('0x7')],'allowNull':![],'unique':_0x99b0('0xd'),'validate':{'isEmail':!![]},'set':function(_0xff8662){if(_0xff8662){this['setDataValue'](_0x99b0('0xd'),_0xff8662[_0x99b0('0xe')]());}}},'role':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x10'),_0x99b0('0x11'),_0x99b0('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x99b0('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x99b0('0x13')},'internal':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x5bba73){this[_0x99b0('0x5')](_0x99b0('0xc'),_0x5bba73);this[_0x99b0('0x5')]('accountcode',_0x5bba73);this['setDataValue']('callerid',util[_0x99b0('0xa')](_0x99b0('0xb'),this['getDataValue'](_0x99b0('0x8')),_0x5bba73));}},'salt':{'type':Sequelize[_0x99b0('0x7')]},'phone':{'type':Sequelize[_0x99b0('0x7')]},'mobile':{'type':Sequelize[_0x99b0('0x7')]},'address':{'type':Sequelize[_0x99b0('0x7')]},'zipcode':{'type':Sequelize[_0x99b0('0x7')]},'userpic':{'type':Sequelize[_0x99b0('0x7')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x99b0('0x7')]},'online':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x99b0('0x16')]},'voicePause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x99b0('0x7')],'defaultValue':_0x99b0('0x17')},'lastPauseAt':{'type':Sequelize[_0x99b0('0x16')]},'chatCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x99b0('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x99b0('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'defaultValue':_0x99b0('0x18')},'ipaddr':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0x99b0('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x99b0('0x19'),_0x99b0('0x11'),'peer'),'allowNull':!![],'defaultValue':_0x99b0('0x19')},'context':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'defaultValue':_0x99b0('0x1a')},'callingpres':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x1b'),_0x99b0('0x1c'),_0x99b0('0x1d'),_0x99b0('0x1e'),_0x99b0('0x1f'),'PROHIB_PASSED_SCREEN',_0x99b0('0x20'),_0x99b0('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'defaultValue':_0x99b0('0x22'),'set':function(_0x4426a3){this[_0x99b0('0x5')](_0x99b0('0x23'),_0x4426a3?_0x4426a3[_0x99b0('0x24')](','):null);},'get':function(){return this[_0x99b0('0x25')](_0x99b0('0x23'))?this['getDataValue'](_0x99b0('0x23'))['split'](','):null;},'comment':_0x99b0('0x26')},'dtmfmode':{'type':Sequelize[_0x99b0('0xf')]('rfc2833',_0x99b0('0x27'),'shortinfo','inband',_0x99b0('0x28')),'allowNull':!![],'defaultValue':_0x99b0('0x29')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x99b0('0x2a'),_0x99b0('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x99b0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'defaultValue':_0x99b0('0x2c'),'set':function(_0x2c251a){this['setDataValue'](_0x99b0('0x2d'),_0x2c251a?_0x2c251a['join'](','):null);},'get':function(){return this[_0x99b0('0x25')]('nat')?this[_0x99b0('0x25')](_0x99b0('0x2d'))[_0x99b0('0x2e')](','):null;},'comment':_0x99b0('0x2f')},'callgroup':{'type':Sequelize[_0x99b0('0x7')]},'namedcallgroup':{'type':Sequelize[_0x99b0('0x7')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x99b0('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x99b0('0x7')]},'disallow':{'type':Sequelize[_0x99b0('0x7')],'allowNull':![],'defaultValue':_0x99b0('0x30')},'allow':{'type':Sequelize[_0x99b0('0x7')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xace47b){this['setDataValue']('allow',_0xace47b?_0xace47b[_0x99b0('0x24')](';'):_0x99b0('0x31'));},'get':function(){return this[_0x99b0('0x25')]('allow')?this['getDataValue'](_0x99b0('0x32'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'set':function(_0x46ee42){this['setDataValue'](_0x99b0('0x33'),_0x46ee42?_0x46ee42['join'](','):null);},'get':function(){return this[_0x99b0('0x25')](_0x99b0('0x33'))?this[_0x99b0('0x25')](_0x99b0('0x33'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x99b0('0xf')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![],'defaultValue':_0x99b0('0x35')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x99b0('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x99b0('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x99b0('0x34'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x36'),_0x99b0('0x37'),_0x99b0('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x99b0('0xf')]('uac',_0x99b0('0x39')),'allowNull':!![],'defaultValue':_0x99b0('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':_0x99b0('0x34')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x99b0('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x99b0('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x99b0('0x34'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x99b0('0xf')]('yes','no','fingerprint',_0x99b0('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x3b'),_0x99b0('0x3c'),_0x99b0('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x99b0('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x99b0('0xf')]('yes','no',_0x99b0('0x2a'),_0x99b0('0x2b'),_0x99b0('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x99b0('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0x99b0('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x99b0('0x3f')]},'showWebBar':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0,'set':function(_0x4a09ff){this[_0x99b0('0x5')](_0x99b0('0x40'),_0x4a09ff);var _0x2f2839=this['get']({'plain':!![]});switch(_0x4a09ff){case 0x0:case 0x1:var _0x19edf9=_0x2f2839[_0x99b0('0x23')]?_['isArray'](_0x2f2839[_0x99b0('0x23')])?_0x2f2839[_0x99b0('0x23')][_0x99b0('0x24')]():_0x2f2839['transport']:'udp';if(_0x19edf9===_0x99b0('0x41')){_0x19edf9=_0x99b0('0x22');}this[_0x99b0('0x5')](_0x99b0('0x23'),_0x19edf9);this[_0x99b0('0x5')]('encryption','no');this[_0x99b0('0x5')]('avpf',null);this[_0x99b0('0x5')]('force_avp',null);this[_0x99b0('0x5')](_0x99b0('0x42'),null);this[_0x99b0('0x5')]('dtlsenable',null);this[_0x99b0('0x5')](_0x99b0('0x43'),null);this[_0x99b0('0x5')](_0x99b0('0x44'),null);this[_0x99b0('0x5')](_0x99b0('0x45'),null);this[_0x99b0('0x5')](_0x99b0('0x46'),null);this[_0x99b0('0x5')](_0x99b0('0x47'),'no');break;case 0x2:this['setDataValue'](_0x99b0('0x23'),_0x99b0('0x41'));this[_0x99b0('0x5')](_0x99b0('0x48'),'yes');this[_0x99b0('0x5')]('avpf','yes');this[_0x99b0('0x5')]('force_avp',_0x99b0('0x34'));this[_0x99b0('0x5')](_0x99b0('0x42'),'yes');this[_0x99b0('0x5')](_0x99b0('0x49'),'yes');this[_0x99b0('0x5')](_0x99b0('0x43'),'no');this[_0x99b0('0x5')]('dtlssetup',_0x99b0('0x3d'));this[_0x99b0('0x5')](_0x99b0('0x45'),_0x2f2839['dtlscertfile']||_0x99b0('0x4a'));this[_0x99b0('0x5')]('dtlsprivatekey',_0x2f2839[_0x99b0('0x46')]||_0x99b0('0x4b'));this['setDataValue'](_0x99b0('0x47'),_0x99b0('0x34'));break;default:}}},'permissions':{'type':Sequelize[_0x99b0('0x3f')],'set':function(_0x1ac3cc){this[_0x99b0('0x5')](_0x99b0('0x4c'),_0x1ac3cc?_0x1ac3cc[_0x99b0('0x24')](','):[]);},'get':function(){return this[_0x99b0('0x25')](_0x99b0('0x4c'))?_[_0x99b0('0x4d')](this[_0x99b0('0x25')]('permissions')['split'](','),function(_0x446d63){return parseInt(_0x446d63,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x99b0('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x99b0('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0x99b0('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x99b0('0xf')](_0x99b0('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x99b0('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x99b0('0x25')](_0x99b0('0x4e'))?this[_0x99b0('0x25')](_0x99b0('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x99b0('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x99b0('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![],'set':function(_0x3f30e1){if(typeof _0x3f30e1===_0x99b0('0x4f')){var _0xe9c094=_0x3f30e1==='1'?!![]:_0x3f30e1==='0'?![]:_0x3f30e1===_0x99b0('0x50')?!![]:_0x3f30e1===_0x99b0('0x51')?![]:![];this[_0x99b0('0x5')](_0x99b0('0x52'),_0xe9c094);}else{this[_0x99b0('0x5')](_0x99b0('0x52'),_0x3f30e1);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x298e57){this[_0x99b0('0x5')](_0x99b0('0x53'),_0x298e57);if(_0x298e57===!![]){this[_0x99b0('0x5')]('blockedAt',moment());this[_0x99b0('0x5')]('loginAttempts',0x0);}else{this[_0x99b0('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x99b0('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x99b0('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x99b0('0x14')](0x5)[_0x99b0('0x54')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x99b0('0x15')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index cd488f4..0374171 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 _0x1691=['removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notILike','$overlap','$contains','$contained','$any','CmHopper','Contact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','inbound','flatten','lower','col','toString','substring','uniqBy','orderBy','request','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','voiceStatus','charAt','slice','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','socket.io-emitter','redis','register','defaults','localhost','http','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','destroy','get','role','admin','telephone','filter','map','value','includes','find','name','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','key','password','salt','getOptions','where','query','includeAll','push','User','findAll','rows','openTabs','true','length','chat','dataValues','sms','fax','whatsapp','all','model','differenceBy','keys','filters','intersection','fields','attributes','include','merge','options','openchannel','mail','body','params','describe','addContacts','ids','internal','findById','max','min_internal','isNil','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','mailbox','VoiceMail','fullname','email','agent','permissions','101','113','110','104','106','107','108','109','100','111','114','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','Telephones','autoAssociation','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','sort','pick','getContacts','hasOwnProperty','CmList','Tags','color','tag','nolimit','getQueues','Unknown\x20channel','order','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','concat','isMiddleware','resolve','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','getTeams','Team','omit','Voice','getChatQueues','Chat','getMailQueues','setDataValue','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Fax','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts'];(function(_0x5c65ee,_0x57b017){var _0x4b8689=function(_0x57dc88){while(--_0x57dc88){_0x5c65ee['push'](_0x5c65ee['shift']());}};_0x4b8689(++_0x57b017);}(_0x1691,0x1ed));var _0x1169=function(_0x5045b5,_0x2840eb){_0x5045b5=_0x5045b5-0x0;var _0x564757=_0x1691[_0x5045b5];return _0x564757;};'use strict';var moment=require(_0x1169('0x0'));var BPromise=require(_0x1169('0x1'));var util=require('util');var path=require(_0x1169('0x2'));var fs=require('fs');var _=require(_0x1169('0x3'));var squel=require(_0x1169('0x4'));var jayson=require(_0x1169('0x5'));var Redis=require(_0x1169('0x6'));var authService=require(_0x1169('0x7'));var qs=require(_0x1169('0x8'));var logger=require(_0x1169('0x9'))('api');var utils=require(_0x1169('0xa'));var config=require('../../config/environment');var licenseUtil=require(_0x1169('0xb'));var db=require('../../mysqldb')['db'];var socket=require(_0x1169('0xc'))(new Redis(config[_0x1169('0xd')]));require('./user.socket')[_0x1169('0xe')](socket);config[_0x1169('0xd')]=_[_0x1169('0xf')](config[_0x1169('0xd')],{'host':_0x1169('0x10'),'port':0x18eb});var client=jayson['client'][_0x1169('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2123c6,_0x4ad82c,_0x15d032,_0x4c6abe){return new BPromise(function(_0x185f97,_0x35c0cc){var _0x51839d=_0x4c6abe||client;return _0x51839d['request'](_0x2123c6,_0x15d032)['then'](function(_0x1a9f2b){logger['info'](_0x1169('0x12'),_0x4ad82c,_0x1169('0x13'));logger['debug'](_0x1169('0x14'),_0x4ad82c,_0x1169('0x13'),JSON[_0x1169('0x15')](_0x1a9f2b));if(_0x1a9f2b[_0x1169('0x16')]){if(_0x1a9f2b['error']['code']===0x1f4){logger[_0x1169('0x16')](_0x1169('0x12'),_0x4ad82c,_0x1a9f2b[_0x1169('0x16')][_0x1169('0x17')]);return _0x35c0cc(_0x1a9f2b[_0x1169('0x16')][_0x1169('0x17')]);}logger[_0x1169('0x16')](_0x1169('0x12'),_0x4ad82c,_0x1a9f2b['error'][_0x1169('0x17')]);return _0x185f97(_0x1a9f2b['error'][_0x1169('0x17')]);}else{logger['info']('User,\x20%s,\x20%s',_0x4ad82c,_0x1169('0x13'));_0x185f97(_0x1a9f2b['result']['message']);}})[_0x1169('0x18')](function(_0x560b4c){logger[_0x1169('0x16')](_0x1169('0x12'),_0x4ad82c,_0x560b4c);_0x35c0cc(_0x560b4c);});});}function respondWithStatusCode(_0x45473b,_0x1b6af6){_0x1b6af6=_0x1b6af6||0xcc;return function(_0x4362bb){if(_0x4362bb){return _0x45473b[_0x1169('0x19')](_0x1b6af6);}return _0x45473b[_0x1169('0x1a')](_0x1b6af6)[_0x1169('0x1b')]();};}function respondWithResult(_0x594ac4,_0x1ddc10){_0x1ddc10=_0x1ddc10||0xc8;return function(_0x157691){if(_0x157691){return _0x594ac4[_0x1169('0x1a')](_0x1ddc10)[_0x1169('0x1c')](_0x157691);}};}function respondWithFilteredResult(_0x21e826,_0x51040d){return function(_0x54a8ab){if(_0x54a8ab){var _0x3d7ae8=typeof _0x51040d['offset']===_0x1169('0x1d')&&typeof _0x51040d[_0x1169('0x1e')]==='undefined';var _0x49afe4=_0x54a8ab[_0x1169('0x1f')];var _0x27e54b=_0x3d7ae8?0x0:_0x51040d[_0x1169('0x20')];var _0x4d694e=_0x3d7ae8?_0x54a8ab[_0x1169('0x1f')]:_0x51040d[_0x1169('0x20')]+_0x51040d['limit'];var _0x4edcac;if(_0x4d694e>=_0x49afe4){_0x4d694e=_0x49afe4;_0x4edcac=0xc8;}else{_0x4edcac=0xce;}_0x21e826['status'](_0x4edcac);return _0x21e826['set'](_0x1169('0x21'),_0x27e54b+'-'+_0x4d694e+'/'+_0x49afe4)[_0x1169('0x1c')](_0x54a8ab);}return null;};}function saveUpdates(_0x316bc4){return function(_0x209438){if(_0x209438){return _0x209438[_0x1169('0x22')](_0x316bc4)[_0x1169('0x23')](function(_0x254e0c){return _0x254e0c;});}return null;};}function removeEntity(_0x562b44){return function(_0x4dc1b2){if(_0x4dc1b2){return _0x4dc1b2[_0x1169('0x24')]()[_0x1169('0x23')](function(){var _0x23f6a7=_0x4dc1b2[_0x1169('0x25')]({'plain':!![]});if(_0x23f6a7[_0x1169('0x26')]===_0x1169('0x27'))return;var _0x2dae81=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':_0x1169('0x28'),'ignore':![]}];var _0x1e4823=_(_0x2dae81)[_0x1169('0x29')]('ignore')[_0x1169('0x2a')](_0x1169('0x2b'))[_0x1169('0x2b')]();if(_[_0x1169('0x2c')](_0x1e4823,_0x23f6a7[_0x1169('0x26')])){return;}var _0xd5414=_[_0x1169('0x2d')](_0x2dae81,[_0x1169('0x2b'),_0x23f6a7[_0x1169('0x26')]])[_0x1169('0x2e')];return db[_0x1169('0x2f')]['destroy']({'where':{'type':_0xd5414,'resourceId':_0x23f6a7['id']}})['then'](function(){return _0x4dc1b2;});})[_0x1169('0x23')](function(){_0x562b44['status'](0xcc)[_0x1169('0x1b')]();});}};}function handleEntityNotFound(_0x348abb){return function(_0x2a0df4){if(!_0x2a0df4){_0x348abb[_0x1169('0x19')](0x194);}return _0x2a0df4;};}function handleError(_0x11b63e,_0x537ea0){_0x537ea0=_0x537ea0||0x1f4;return function(_0x1af9fc){logger['error'](_0x1af9fc[_0x1169('0x30')]);if(_0x1af9fc['name']){delete _0x1af9fc[_0x1169('0x2e')];}_0x11b63e[_0x1169('0x1a')](_0x537ea0)[_0x1169('0x31')](_0x1af9fc);};}exports[_0x1169('0x32')]=function(_0x56592d,_0x2daecc){var _0x3b0d5f={},_0x3436a0={'count':0x0,'rows':[]};var _0x4a0bea=_(db['User'][_0x1169('0x33')])[_0x1169('0x2a')](function(_0xb5b441){return{'name':_0xb5b441[_0x1169('0x34')],'type':_0xb5b441[_0x1169('0x35')][_0x1169('0x36')]};})['filter'](function(_0x40ffa4){return!_['includes']([_0x1169('0x37'),_0x1169('0x38')],_0x40ffa4['name']);})[_0x1169('0x2b')]();_0x3b0d5f=qs[_0x1169('0x39')](_0x4a0bea,_0x56592d);var _0x390d55={'where':_0x3b0d5f[_0x1169('0x3a')]};return db['User'][_0x1169('0x1f')](_0x390d55)[_0x1169('0x23')](function(_0x4ed58a){_0x3436a0['count']=_0x4ed58a;if(_0x56592d[_0x1169('0x3b')][_0x1169('0x3c')]){_0x3b0d5f['include']=[{'all':!![]}];}if(!_['includes'](_0x3b0d5f['attributes'],'id')){_0x3b0d5f['attributes'][_0x1169('0x3d')]('id');}return db[_0x1169('0x3e')][_0x1169('0x3f')](_0x3b0d5f);})[_0x1169('0x23')](function(_0x2ea766){_0x3436a0[_0x1169('0x40')]=_0x2ea766;if(_0x56592d[_0x1169('0x3b')][_0x1169('0x41')]===_0x1169('0x42')){var _0x2e7d6b=[];for(var _0xbc8661=0x0;_0xbc8661<_0x3436a0[_0x1169('0x40')][_0x1169('0x43')];_0xbc8661++){_0x2e7d6b['push'](get_open_tabs(_0x1169('0x44'),_0x3436a0[_0x1169('0x40')][_0xbc8661][_0x1169('0x45')]));_0x2e7d6b[_0x1169('0x3d')](get_open_tabs(_0x1169('0x46'),_0x3436a0['rows'][_0xbc8661]['dataValues']));_0x2e7d6b[_0x1169('0x3d')](get_open_tabs(_0x1169('0x47'),_0x3436a0[_0x1169('0x40')][_0xbc8661][_0x1169('0x45')]));_0x2e7d6b[_0x1169('0x3d')](get_open_tabs('mail',_0x3436a0['rows'][_0xbc8661][_0x1169('0x45')]));_0x2e7d6b['push'](get_open_tabs('openchannel',_0x3436a0[_0x1169('0x40')][_0xbc8661][_0x1169('0x45')]));_0x2e7d6b['push'](get_open_tabs(_0x1169('0x48'),_0x3436a0['rows'][_0xbc8661][_0x1169('0x45')]));}return BPromise[_0x1169('0x49')](_0x2e7d6b)['then'](function(_0x1ca725){return _0x3436a0;});}else{return _0x3436a0;}})[_0x1169('0x23')](respondWithFilteredResult(_0x2daecc,_0x3b0d5f))[_0x1169('0x18')](handleError(_0x2daecc,null));};exports['show']=function(_0x448a8e,_0x3c2725){var _0x2de50c={'raw':![],'where':{'id':_0x448a8e['params']['id']}},_0x114f17={};_0x114f17[_0x1169('0x4a')]=_[_0x1169('0x4b')](_[_0x1169('0x4c')](db[_0x1169('0x3e')][_0x1169('0x33')]),[_0x1169('0x37'),_0x1169('0x38')]);_0x114f17[_0x1169('0x3b')]=_[_0x1169('0x4c')](_0x448a8e[_0x1169('0x3b')]);_0x114f17[_0x1169('0x4d')]=_['intersection'](_0x114f17[_0x1169('0x4a')],_0x114f17[_0x1169('0x3b')]);_0x2de50c['attributes']=_[_0x1169('0x4e')](_0x114f17[_0x1169('0x4a')],qs[_0x1169('0x4f')](_0x448a8e[_0x1169('0x3b')][_0x1169('0x4f')]));_0x2de50c[_0x1169('0x50')]=_0x2de50c[_0x1169('0x50')][_0x1169('0x43')]?_0x2de50c[_0x1169('0x50')]:_0x114f17[_0x1169('0x4a')];if(_0x448a8e[_0x1169('0x3b')]['includeAll']){_0x2de50c[_0x1169('0x51')]=[{'all':!![]}];}_0x2de50c=_[_0x1169('0x52')]({},_0x2de50c,_0x448a8e[_0x1169('0x53')]);if(!_[_0x1169('0x2c')](_0x2de50c[_0x1169('0x50')],'id')){_0x2de50c[_0x1169('0x50')][_0x1169('0x3d')]('id');}return db[_0x1169('0x3e')][_0x1169('0x2d')](_0x2de50c)[_0x1169('0x23')](handleEntityNotFound(_0x3c2725,null))['then'](function(_0x5250fa){var _0x2e9419=[];values=_0x5250fa;if(_0x448a8e[_0x1169('0x3b')][_0x1169('0x41')]===_0x1169('0x42')){_0x2e9419[_0x1169('0x3d')](get_open_tabs('chat',_0x5250fa[_0x1169('0x45')]));_0x2e9419[_0x1169('0x3d')](get_open_tabs(_0x1169('0x46'),_0x5250fa[_0x1169('0x45')]));_0x2e9419[_0x1169('0x3d')](get_open_tabs(_0x1169('0x54'),_0x5250fa[_0x1169('0x45')]));_0x2e9419[_0x1169('0x3d')](get_open_tabs('whatsapp',_0x5250fa[_0x1169('0x45')]));_0x2e9419[_0x1169('0x3d')](get_open_tabs('fax',_0x5250fa['dataValues']));_0x2e9419[_0x1169('0x3d')](get_open_tabs(_0x1169('0x55'),_0x5250fa[_0x1169('0x45')]));return BPromise['all'](_0x2e9419);}else{return values;}})[_0x1169('0x23')](function(_0x19e50c){return values;})['then'](respondWithResult(_0x3c2725,null))[_0x1169('0x18')](handleError(_0x3c2725,null));};exports[_0x1169('0x22')]=function(_0x3b9b3d,_0x8fadc8){if(_0x3b9b3d[_0x1169('0x56')]['id']){delete _0x3b9b3d[_0x1169('0x56')]['id'];}delete _0x3b9b3d[_0x1169('0x56')]['role'];return db['User'][_0x1169('0x2d')]({'where':{'id':_0x3b9b3d[_0x1169('0x57')]['id']}})[_0x1169('0x23')](handleEntityNotFound(_0x8fadc8,null))[_0x1169('0x23')](saveUpdates(_0x3b9b3d[_0x1169('0x56')],null))[_0x1169('0x23')](respondWithResult(_0x8fadc8,null))[_0x1169('0x18')](handleError(_0x8fadc8,null));};exports[_0x1169('0x58')]=function(_0x5c2437,_0x1f6ad4){return db['User'][_0x1169('0x58')]()[_0x1169('0x23')](respondWithResult(_0x1f6ad4,null))[_0x1169('0x18')](handleError(_0x1f6ad4,null));};exports['addContacts']=function(_0x53bad3,_0x2cf9b7){return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0x53bad3[_0x1169('0x57')]['id']}})[_0x1169('0x23')](handleEntityNotFound(_0x2cf9b7,null))[_0x1169('0x23')](function(_0x4737f6){if(_0x4737f6){return _0x4737f6[_0x1169('0x59')](_0x53bad3[_0x1169('0x56')][_0x1169('0x5a')],_['omit'](_0x53bad3[_0x1169('0x56')],[_0x1169('0x5a'),'id'])||{});}})[_0x1169('0x23')](respondWithResult(_0x2cf9b7,null))[_0x1169('0x18')](handleError(_0x2cf9b7,null));};function validateUser(_0x5d2d08){return new BPromise(function(_0x5726da,_0x22b7ca){if(_0x5d2d08[_0x1169('0x5b')])return _0x5726da(_0x5d2d08);return db['Setting'][_0x1169('0x5c')](0x1)[_0x1169('0x23')](function(_0x2c36ac){if(_0x2c36ac['securePassword'])authService['validatePasswordPattern'](_0x5d2d08[_0x1169('0x37')]);db[_0x1169('0x3e')][_0x1169('0x5d')](_0x1169('0x5b'))[_0x1169('0x23')](function(_0x1ae7a5){if(_['isNil'](_0x1ae7a5)){_0x5d2d08['internal']=_0x2c36ac[_0x1169('0x5e')]||0x1;return;}if(_[_0x1169('0x5f')](_0x2c36ac['min_internal'])||_0x2c36ac[_0x1169('0x5e')]===_0x1ae7a5){_0x5d2d08[_0x1169('0x5b')]=_0x1ae7a5+0x1;return;}if(_0x2c36ac['min_internal']>_0x1ae7a5){_0x5d2d08[_0x1169('0x5b')]=_0x2c36ac[_0x1169('0x5e')];return;}return db[_0x1169('0x60')][_0x1169('0x3b')](_0x1169('0x61'),{'type':db[_0x1169('0x60')][_0x1169('0x62')]['SELECT']})['then'](function(_0x59cbec){if(_0x59cbec&&_0x59cbec[_0x1169('0x43')]){for(var _0x413414=0x0,_0x149ce7=_0x59cbec[_0x1169('0x43')];_0x413414<_0x149ce7&&_[_0x1169('0x5f')](_0x5d2d08[_0x1169('0x5b')]);_0x413414++){if(_0x2c36ac['min_internal']<=_0x59cbec[_0x413414][_0x1169('0x63')]){_0x5d2d08[_0x1169('0x5b')]=_0x59cbec[_0x413414]['from'];}else if(_0x2c36ac[_0x1169('0x5e')]>_0x59cbec[_0x413414][_0x1169('0x63')]&&_0x2c36ac[_0x1169('0x5e')]<=_0x59cbec[_0x413414]['to']){_0x5d2d08[_0x1169('0x5b')]=_0x2c36ac[_0x1169('0x5e')];}}}if(_[_0x1169('0x5f')](_0x5d2d08['internal'])){_0x5d2d08[_0x1169('0x5b')]=_0x1ae7a5+0x1;}return _0x5726da(_0x5d2d08);});});})[_0x1169('0x18')](function(_0x45ee81){_0x22b7ca(_0x45ee81);});});}function updateUser(_0x5825e2){return new BPromise(function(_0x25c334,_0x4eb6ef){try{if(_0x5825e2['voicemail']){_0x5825e2[_0x1169('0x64')]=_0x5825e2[_0x1169('0x5b')];_0x5825e2[_0x1169('0x65')]={'mailbox':_0x5825e2['internal'],'password':_0x5825e2[_0x1169('0x37')],'fullname':_0x5825e2[_0x1169('0x66')],'email':_0x5825e2[_0x1169('0x67')]};}if(_0x5825e2[_0x1169('0x26')]===_0x1169('0x68')){if(!_0x5825e2[_0x1169('0x69')])_0x5825e2['permissions']=[_0x1169('0x6a'),'102','103',_0x1169('0x6b'),_0x1169('0x6c'),_0x1169('0x6d'),'105',_0x1169('0x6e'),_0x1169('0x6f'),_0x1169('0x70'),_0x1169('0x71'),_0x1169('0x72'),_0x1169('0x73'),_0x1169('0x74'),'115'];}_0x25c334(_0x5825e2);}catch(_0xbeb11c){_0x4eb6ef(_0xbeb11c);}});}exports[_0x1169('0x75')]=function(_0xb2a5dc,_0x704347){if(_0xb2a5dc[_0x1169('0x76')][_0x1169('0x26')]===_0x1169('0x68'))throw new Error(_0x1169('0x77'));if(_0xb2a5dc[_0x1169('0x56')][_0x1169('0x26')]===_0x1169('0x76')&&_0xb2a5dc[_0x1169('0x76')][_0x1169('0x26')]!==_0x1169('0x27')){throw new Error(_0x1169('0x78'));}if(_0xb2a5dc[_0x1169('0x56')]['role']===_0x1169('0x27')&&_0xb2a5dc[_0x1169('0x76')][_0x1169('0x26')]!==_0x1169('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x1169('0x79')]([_0xb2a5dc[_0x1169('0x56')]])[_0x1169('0x23')](function(){return validateUser(_0xb2a5dc[_0x1169('0x56')]);})['then'](function(_0x35818e){return updateUser(_0x35818e)[_0x1169('0x23')](function(_0x10847e){if(_0x10847e[_0x1169('0x26')]==='admin'){_0x10847e[_0x1169('0x7a')]=_0xb2a5dc['user'][_0x1169('0x7a')];delete _0x10847e[_0x1169('0x7b')];}return _0x10847e;});})[_0x1169('0x23')](function(_0x19438e){return db[_0x1169('0x3e')][_0x1169('0x75')](_0x19438e,{'include':[{'model':db[_0x1169('0x65')],'as':_0x1169('0x65')}]});})[_0x1169('0x23')](function(_0x2ca39f){if(_0xb2a5dc['body'][_0x1169('0x26')]===_0x1169('0x76'))return _0x2ca39f;if(_0xb2a5dc[_0x1169('0x76')][_0x1169('0x26')]!==_0x1169('0x76'))return _0x2ca39f;return db[_0x1169('0x7c')][_0x1169('0x2d')]({'where':{'name':_0x2ca39f[_0x1169('0x26')]===_0x1169('0x68')?_0x1169('0x7d'):_0x1169('0x7e'),'userProfileId':_0xb2a5dc[_0x1169('0x76')][_0x1169('0x7b')]},'raw':!![]})[_0x1169('0x23')](function(_0x13c330){if(!_0x13c330||_0x13c330[_0x1169('0x7f')]!=0x0)return _0x2ca39f;return db[_0x1169('0x2f')]['create']({'name':_0x2ca39f['name'],'resourceId':_0x2ca39f['id'],'type':_0x13c330[_0x1169('0x2e')],'sectionId':_0x13c330['id']},{})[_0x1169('0x23')](function(){return _0x2ca39f;});})[_0x1169('0x18')](function(_0x3b0913){logger[_0x1169('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b0913);throw _0x3b0913;});})[_0x1169('0x23')](respondWithResult(_0x704347,0xc9))['catch'](handleError(_0x704347,null));};exports['bulkCreate']=function(_0x2f9fbc,_0x1e98ee){var _0x2eb8b5=_0x2f9fbc['body'];var _0x436429=[];if(_0x2f9fbc[_0x1169('0x76')][_0x1169('0x26')]===_0x1169('0x68'))throw new Error('Unauthorized');if(_[_0x1169('0x80')](_0x2eb8b5,[_0x1169('0x26'),_0x1169('0x76')])&&_0x2f9fbc['user'][_0x1169('0x26')]!=='admin'){throw new Error(_0x1169('0x78'));}if(_[_0x1169('0x80')](_0x2eb8b5,['role','admin'])&&_0x2f9fbc[_0x1169('0x76')]['role']!==_0x1169('0x27')){throw new Error(_0x1169('0x81'));}return licenseUtil[_0x1169('0x79')](_0x2eb8b5)['then'](function(){return validateUser(_0x2eb8b5[0x0]);})[_0x1169('0x23')](function(){for(var _0x3d8d97=0x1;_0x3d8d97<_0x2eb8b5[_0x1169('0x43')];_0x3d8d97++){var _0x43bc1d=_0x2eb8b5[_0x3d8d97-0x1]['internal'];if(!_0x2eb8b5[_0x3d8d97][_0x1169('0x5b')])_0x2eb8b5[_0x3d8d97]['internal']=_0x43bc1d+0x1;_0x436429[_0x1169('0x3d')](validateUser(_0x2eb8b5[_0x3d8d97]));}return BPromise[_0x1169('0x49')](_0x436429);})[_0x1169('0x23')](function(){_0x436429=[];for(var _0x72f3fa=0x0;_0x72f3fa<_0x2eb8b5['length'];_0x72f3fa++){_0x436429['push'](updateUser(_0x2eb8b5[_0x72f3fa]));}return BPromise[_0x1169('0x49')](_0x436429);})[_0x1169('0x23')](function(){return BPromise[_0x1169('0x82')](_0x2eb8b5,function(_0x2f8ad5){return db[_0x1169('0x3e')][_0x1169('0x75')](_0x2f8ad5,{'include':[{'model':db[_0x1169('0x65')],'as':_0x1169('0x65')}]})['then'](function(_0x44a688){_0x2f8ad5['id']=_0x44a688['id'];return _0x2f8ad5;});});})[_0x1169('0x23')](function(_0x424db4){if(_0x2f9fbc[_0x1169('0x56')][_0x1169('0x26')]===_0x1169('0x76'))return _0x424db4;if(_0x2f9fbc[_0x1169('0x76')][_0x1169('0x26')]!==_0x1169('0x76'))return _0x424db4;var _0x131d83=_[_0x1169('0x80')](_0x424db4,function(_0x25e418){return _0x25e418[_0x1169('0x26')]==='agent'||_0x25e418[_0x1169('0x26')]===_0x1169('0x28');});if(!_0x131d83)return _0x424db4;return db[_0x1169('0x7c')][_0x1169('0x3f')]({'where':{'name':{'$or':[_0x1169('0x7d'),_0x1169('0x7e')]},'userProfileId':_0x2f9fbc['user'][_0x1169('0x7b')]},'raw':!![]})[_0x1169('0x23')](function(_0x2dba5f){if(_[_0x1169('0x83')](_0x2dba5f)||!_['some'](_0x2dba5f,[_0x1169('0x7f'),0x0]))return _0x424db4;_0x436429=[];var _0x4c0c41=_(_0x2dba5f)[_0x1169('0x2a')](function(_0x11dbab){if(_0x11dbab['autoAssociation']===0x1)return;return _0x11dbab[_0x1169('0x2e')]===_0x1169('0x7d')?_0x1169('0x68'):_0x1169('0x28');})[_0x1169('0x84')]()[_0x1169('0x2b')]();for(var _0x1380c8=0x0;_0x1380c8<_0x424db4[_0x1169('0x43')];_0x1380c8++){if(!_['includes'](_0x4c0c41,_0x424db4[_0x1380c8][_0x1169('0x26')]))return;var _0x5290a0=_0x424db4[_0x1380c8][_0x1169('0x26')]===_0x1169('0x68')?_0x1169('0x7d'):_0x1169('0x7e');_0x436429[_0x1169('0x3d')](db[_0x1169('0x2f')][_0x1169('0x75')]({'name':_0x424db4[_0x1380c8]['name'],'resourceId':_0x424db4[_0x1380c8]['id'],'type':_0x5290a0,'sectionId':_['find'](_0x2dba5f,[_0x1169('0x2e'),_0x5290a0])['id']},{}));}return BPromise[_0x1169('0x49')](_0x436429);});})[_0x1169('0x23')](respondWithResult(_0x1e98ee,0xc9))[_0x1169('0x18')](handleError(_0x1e98ee,null));};exports[_0x1169('0x85')]=function(_0x643c9e,_0x31c2cf){if(_0x643c9e[_0x1169('0x56')]['id']){delete _0x643c9e['body']['id'];}return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0x643c9e[_0x1169('0x57')]['id']}})[_0x1169('0x23')](function(_0x519356){if(!_0x519356)return null;if(_0x519356['id']===_0x643c9e[_0x1169('0x76')]['id']){if(!_0x643c9e['body'][_0x1169('0x86')]||!_0x643c9e[_0x1169('0x56')][_0x1169('0x87')]){throw new db[(_0x1169('0x88'))]['ValidationError'](_0x1169('0x89'));}if(!_0x519356[_0x1169('0x8a')](_0x643c9e['body']['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x1169('0x8b'));}if(_0x643c9e['body'][_0x1169('0x86')]===_0x643c9e['body'][_0x1169('0x87')]){throw new db[(_0x1169('0x88'))][(_0x1169('0x8c'))](_0x1169('0x8d'));}}else if(_0x643c9e[_0x1169('0x76')][_0x1169('0x26')]===_0x1169('0x27')){if(!_0x643c9e['body'][_0x1169('0x87')]){throw new db[(_0x1169('0x88'))][(_0x1169('0x8c'))](_0x1169('0x8e'));}}else if(_0x643c9e['user'][_0x1169('0x26')]===_0x1169('0x76')){if(!_0x643c9e[_0x1169('0x56')][_0x1169('0x87')]){throw new db[(_0x1169('0x88'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x519356['role']!==_0x1169('0x68')){throw new db[(_0x1169('0x88'))][(_0x1169('0x8c'))]('Unauthorized');}}else{throw new db[(_0x1169('0x88'))][(_0x1169('0x8c'))]('Unauthorized');}return _0x519356;})[_0x1169('0x23')](handleEntityNotFound(_0x31c2cf,null))[_0x1169('0x23')](function(_0x1d8982){return db[_0x1169('0x8f')][_0x1169('0x90')]({'attributes':['id','securePassword',_0x1169('0x91'),_0x1169('0x92')]})[_0x1169('0x23')](function(_0x464656){if(_0x464656[_0x1169('0x93')])authService[_0x1169('0x94')](_0x643c9e[_0x1169('0x56')][_0x1169('0x87')]);if(!_0x464656[_0x1169('0x91')]||!_0x1d8982[_0x1169('0x95')])return _0x1d8982;authService[_0x1169('0x96')](_0x643c9e[_0x1169('0x56')][_0x1169('0x87')],_0x1d8982['previousPasswords'],_0x464656[_0x1169('0x92')]);return _0x1d8982;})[_0x1169('0x23')](saveUpdates({'password':_0x643c9e[_0x1169('0x56')][_0x1169('0x87')],'passwordResetAt':_0x643c9e[_0x1169('0x76')]['id']==_0x643c9e[_0x1169('0x57')]['id']?moment():null,'previousPasswords':authService[_0x1169('0x97')](_0x643c9e[_0x1169('0x56')]['newPassword'],_0x1d8982[_0x1169('0x95')])},null));})[_0x1169('0x23')](respondWithResult(_0x31c2cf,null))[_0x1169('0x18')](handleError(_0x31c2cf,null));};exports[_0x1169('0x98')]=function(_0x4a3584,_0x18f190){var _0x438089=_0x4a3584[_0x1169('0x56')][_0x1169('0x99')];return db['User'][_0x1169('0x2d')]({'where':{'id':_0x4a3584['params']['id']},'attributes':['id',_0x1169('0x2e'),_0x1169('0x26'),_0x1169('0x9a'),_0x1169('0x9b'),_0x1169('0x9c'),_0x1169('0x9d')]})[_0x1169('0x23')](handleEntityNotFound(_0x18f190,null))[_0x1169('0x23')](function(_0x67525a){if(_0x67525a){if(!utils[_0x1169('0x9e')](_0x438089)){throw new db[(_0x1169('0x88'))][(_0x1169('0x8c'))]('Unknown\x20channel');}return _0x67525a[_0x1169('0x9f')+_[_0x1169('0xa0')](_0x438089[_0x1169('0xa1')]())+_0x1169('0xa2')](_0x4a3584[_0x1169('0x56')]['ids'],{'penalty':_0x4a3584['body'][_0x1169('0xa3')]||0x0})[_0x1169('0xa4')](function(_0xae13ec){for(var _0x2abb3e=0x0;_0x2abb3e<_0x4a3584[_0x1169('0x56')][_0x1169('0x5a')][_0x1169('0x43')];_0x2abb3e+=0x1){var _0x784f9={'UserId':Number(_0x4a3584[_0x1169('0x57')]['id'])};_0x784f9[_[_0x1169('0xa0')](_0x438089[_0x1169('0xa1')]())+_0x1169('0xa5')]=Number(_0x4a3584[_0x1169('0x56')][_0x1169('0x5a')][_0x2abb3e]);socket[_0x1169('0xa6')]('user'+_[_0x1169('0xa0')](_0x438089[_0x1169('0xa1')]())+'Queue:save',_0x784f9);}return _0xae13ec;})['then'](function(){if(_0x438089===_0x1169('0xa7')){return db[_0x1169('0xa8')]['findAll']({'where':{'id':_0x4a3584[_0x1169('0x56')][_0x1169('0x5a')]||[]},'raw':!![],'attributes':['id',_0x1169('0x2e')]});}})[_0x1169('0x23')](function(_0x576509){var _0x2ccf16=_0x67525a[_0x1169('0x25')]({'plain':!![]});var _0x34572b=[];if(_0x438089===_0x1169('0xa7')&&_0x2ccf16[_0x1169('0x26')]==='agent'&&_0x2ccf16[_0x1169('0x9a')]){for(var _0x48dd9d=0x0;_0x48dd9d<_0x576509['length'];_0x48dd9d+=0x1){_0x34572b[_0x1169('0x3d')]({'membername':_0x2ccf16[_0x1169('0x2e')],'UserId':_0x2ccf16['id'],'queue_name':_0x576509[_0x48dd9d]['name'],'VoiceQueueId':_0x576509[_0x48dd9d]['id'],'interface':_['isNil'](_0x2ccf16[_0x1169('0x9d')])?util[_0x1169('0xa9')]('SIP/%s',_0x2ccf16[_0x1169('0x2e')]):_0x2ccf16[_0x1169('0x9d')],'paused':_0x2ccf16[_0x1169('0x9c')]||![],'penalty':_0x4a3584[_0x1169('0x56')][_0x1169('0xa3')]||0x0});}return BPromise['each'](_0x34572b,function(_0x391414){return db[_0x1169('0xaa')][_0x1169('0xab')](_0x391414);});}return _0x67525a;});}})[_0x1169('0x23')](respondWithStatusCode(_0x18f190,null))[_0x1169('0x18')](handleError(_0x18f190,null));};exports['removeQueues']=function(_0x24d704,_0x50ca9f){var _0x28ad4d;return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0x24d704[_0x1169('0x57')]['id']},'attributes':['id',_0x1169('0x2e'),_0x1169('0x26')]})[_0x1169('0x23')](handleEntityNotFound(_0x50ca9f,null))[_0x1169('0x23')](function(_0x72c9ba){if(_0x72c9ba){_0x28ad4d=_0x72c9ba;if(!_0x24d704[_0x1169('0x3b')][_0x1169('0x99')]||!utils[_0x1169('0x9e')](_0x24d704['query']['channel'])){throw new db[(_0x1169('0x88'))]['ValidationError']('Unknown\x20channel');}return _0x72c9ba['remove'+_[_0x1169('0xa0')](_0x24d704['query'][_0x1169('0x99')][_0x1169('0xa1')]())+'Queues'](_0x24d704[_0x1169('0x3b')]['ids']);}})[_0x1169('0x23')](function(_0x2e9caf){if(_['isArray'](_0x24d704[_0x1169('0x3b')]['ids'])){for(var _0x21e6cf=0x0;_0x21e6cf<_0x24d704['query'][_0x1169('0x5a')][_0x1169('0x43')];_0x21e6cf+=0x1){var _0x5a2978={'UserId':Number(_0x24d704[_0x1169('0x57')]['id'])};_0x5a2978[_[_0x1169('0xa0')](_0x24d704['query'][_0x1169('0x99')][_0x1169('0xa1')]())+'QueueId']=Number(_0x24d704[_0x1169('0x3b')][_0x1169('0x5a')][_0x21e6cf]);socket[_0x1169('0xa6')](_0x1169('0x76')+_[_0x1169('0xa0')](_0x24d704[_0x1169('0x3b')]['channel'][_0x1169('0xa1')]())+_0x1169('0xac'),_0x5a2978);}}else{var _0x5a2978={'UserId':Number(_0x24d704[_0x1169('0x57')]['id'])};_0x5a2978[_[_0x1169('0xa0')](_0x24d704['query'][_0x1169('0x99')]['toLowerCase']())+_0x1169('0xa5')]=Number(_0x24d704[_0x1169('0x3b')][_0x1169('0x5a')]);socket[_0x1169('0xa6')]('user'+_[_0x1169('0xa0')](_0x24d704[_0x1169('0x3b')][_0x1169('0x99')]['toLowerCase']())+_0x1169('0xac'),_0x5a2978);}return _0x2e9caf;})['then'](function(){if(_0x24d704['query'][_0x1169('0x99')]===_0x1169('0xa7')){return db['UserVoiceQueueRt'][_0x1169('0x24')]({'where':{'UserId':_0x24d704[_0x1169('0x57')]['id'],'VoiceQueueId':_0x24d704[_0x1169('0x3b')]['ids']},'individualHooks':!![]})[_0x1169('0x23')](function(){return _0x28ad4d;});}return _0x28ad4d;})[_0x1169('0x23')](respondWithStatusCode(_0x50ca9f,null))[_0x1169('0x18')](handleError(_0x50ca9f,null));};exports[_0x1169('0xad')]=function(_0xb37f4f,_0x2a1897){_0xb37f4f[_0x1169('0x56')][_0x1169('0xae')]=_0xb37f4f[_0x1169('0xaf')][_0x1169('0xb0')];return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0xb37f4f[_0x1169('0x57')]['id']}})[_0x1169('0x23')](handleEntityNotFound(_0x2a1897,null))[_0x1169('0x23')](saveUpdates(_0xb37f4f[_0x1169('0x56')],null))[_0x1169('0x23')](respondWithResult(_0x2a1897,null))[_0x1169('0x18')](handleError(_0x2a1897,null));};exports[_0x1169('0xb1')]=function(_0x422eda,_0x309c66){var _0x54d980=path[_0x1169('0xb2')](config[_0x1169('0xb3')],'server/files/images/logos/default_profile.png');return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0x422eda[_0x1169('0x57')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x1169('0x23')](handleEntityNotFound(_0x309c66,null))[_0x1169('0x23')](function(_0x4f22a5){if(_0x4f22a5){if(_[_0x1169('0x5f')](_0x4f22a5['userpic'])){return _0x309c66['download'](_0x54d980);}else{if(!fs[_0x1169('0xb4')](path[_0x1169('0xb2')](config[_0x1169('0xb3')],_0x1169('0xb5'),_0x4f22a5[_0x1169('0xae')]))){return _0x309c66[_0x1169('0xb6')](_0x54d980);}return _0x309c66[_0x1169('0xb6')](path[_0x1169('0xb2')](config[_0x1169('0xb3')],'server/files/images/',_0x4f22a5[_0x1169('0xae')]));}}})[_0x1169('0x18')](handleError(_0x309c66,null));};exports[_0x1169('0xb7')]=function(_0x294ecc,_0x4ff4db){return db[_0x1169('0x3e')][_0x1169('0x2d')]({'where':{'id':_0x294ecc[_0x1169('0x57')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4ff4db,null))[_0x1169('0x23')](function(_0x9afb88){var _0x4d7622=[];values=_0x9afb88[_0x1169('0x45')];_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x44'),_0x9afb88[_0x1169('0x45')]));_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x46'),_0x9afb88[_0x1169('0x45')]));_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x54'),_0x9afb88[_0x1169('0x45')]));_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x48'),_0x9afb88['dataValues']));_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x47'),_0x9afb88[_0x1169('0x45')]));_0x4d7622[_0x1169('0x3d')](get_open_tabs(_0x1169('0x55'),_0x9afb88['dataValues']));return BPromise[_0x1169('0x49')](_0x4d7622);})[_0x1169('0x23')](function(_0x344d14){var _0x38dcb2=[];if(_0x344d14){for(var _0x40a19d=0x0;_0x40a19d=_0x4c8614){_0x4319a0=_0x4c8614;_0x108876=0xc8;}else{_0x108876=0xce;}_0x40250e[_0xa9ae('0x1d')](_0x108876);return _0x40250e[_0xa9ae('0x23')](_0xa9ae('0x24'),_0x52e3bd+'-'+_0x4319a0+'/'+_0x4c8614)[_0xa9ae('0x1e')](_0x1b9bb5);}return null;};}function saveUpdates(_0x40bd19){return function(_0x114d0e){if(_0x114d0e){return _0x114d0e[_0xa9ae('0x25')](_0x40bd19)[_0xa9ae('0x11')](function(_0x5eb06e){return _0x5eb06e;});}return null;};}function removeEntity(_0x2bc3c7){return function(_0x4ef30f){if(_0x4ef30f){return _0x4ef30f[_0xa9ae('0x26')]()[_0xa9ae('0x11')](function(){var _0x3b8423=_0x4ef30f[_0xa9ae('0x27')]({'plain':!![]});if(_0x3b8423['role']===_0xa9ae('0x28'))return;var _0x87a43=[{'name':'Users','value':'user','ignore':!![]},{'name':_0xa9ae('0x29'),'value':_0xa9ae('0x2a'),'ignore':![]},{'name':_0xa9ae('0x2b'),'value':_0xa9ae('0x2c'),'ignore':![]}];var _0x344a7f=_(_0x87a43)['filter'](_0xa9ae('0x2d'))[_0xa9ae('0x2e')](_0xa9ae('0x2f'))[_0xa9ae('0x2f')]();if(_['includes'](_0x344a7f,_0x3b8423['role'])){return;}var _0x4a657c=_[_0xa9ae('0x30')](_0x87a43,[_0xa9ae('0x2f'),_0x3b8423[_0xa9ae('0x31')]])[_0xa9ae('0x32')];return db['UserProfileResource'][_0xa9ae('0x26')]({'where':{'type':_0x4a657c,'resourceId':_0x3b8423['id']}})[_0xa9ae('0x11')](function(){return _0x4ef30f;});})['then'](function(){_0x2bc3c7[_0xa9ae('0x1d')](0xcc)[_0xa9ae('0x33')]();});}};}function handleEntityNotFound(_0x182c40){return function(_0x2435bd){if(!_0x2435bd){_0x182c40[_0xa9ae('0x1c')](0x194);}return _0x2435bd;};}function handleError(_0x373ba0,_0x294b15){_0x294b15=_0x294b15||0x1f4;return function(_0x47c6e7){logger[_0xa9ae('0x17')](_0x47c6e7[_0xa9ae('0x34')]);if(_0x47c6e7[_0xa9ae('0x32')]){delete _0x47c6e7[_0xa9ae('0x32')];}_0x373ba0['status'](_0x294b15)[_0xa9ae('0x35')](_0x47c6e7);};}exports[_0xa9ae('0x36')]=function(_0x3339fb,_0x1ab92c){var _0xb82ad1={},_0x456485={'count':0x0,'rows':[]};var _0x27134f=_(db[_0xa9ae('0x37')][_0xa9ae('0x38')])['map'](function(_0x25bd7e){return{'name':_0x25bd7e[_0xa9ae('0x39')],'type':_0x25bd7e['type'][_0xa9ae('0x3a')]};})[_0xa9ae('0x3b')](function(_0x4265f8){return!_['includes']([_0xa9ae('0x3c'),_0xa9ae('0x3d')],_0x4265f8[_0xa9ae('0x32')]);})[_0xa9ae('0x2f')]();_0xb82ad1=qs[_0xa9ae('0x3e')](_0x27134f,_0x3339fb);var _0x51bf2a={'where':_0xb82ad1[_0xa9ae('0x3f')]};return db[_0xa9ae('0x37')]['count'](_0x51bf2a)['then'](function(_0x4ebe20){_0x456485[_0xa9ae('0x22')]=_0x4ebe20;if(_0x3339fb[_0xa9ae('0x40')]['includeAll']){_0xb82ad1[_0xa9ae('0x41')]=[{'all':!![]}];}if(!_[_0xa9ae('0x42')](_0xb82ad1[_0xa9ae('0x43')],'id')){_0xb82ad1['attributes'][_0xa9ae('0x44')]('id');}return db['User'][_0xa9ae('0x45')](_0xb82ad1);})[_0xa9ae('0x11')](function(_0x1e53b7){_0x456485[_0xa9ae('0x46')]=_0x1e53b7;if(_0x3339fb[_0xa9ae('0x40')]['openTabs']===_0xa9ae('0x47')){var _0x361914=[];for(var _0x175ee7=0x0;_0x175ee7<_0x456485[_0xa9ae('0x46')][_0xa9ae('0x48')];_0x175ee7++){_0x361914[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x49'),_0x456485[_0xa9ae('0x46')][_0x175ee7][_0xa9ae('0x4a')]));_0x361914[_0xa9ae('0x44')](get_open_tabs('sms',_0x456485[_0xa9ae('0x46')][_0x175ee7][_0xa9ae('0x4a')]));_0x361914[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4b'),_0x456485[_0xa9ae('0x46')][_0x175ee7][_0xa9ae('0x4a')]));_0x361914[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4c'),_0x456485['rows'][_0x175ee7]['dataValues']));_0x361914[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4d'),_0x456485[_0xa9ae('0x46')][_0x175ee7][_0xa9ae('0x4a')]));_0x361914[_0xa9ae('0x44')](get_open_tabs('whatsapp',_0x456485[_0xa9ae('0x46')][_0x175ee7][_0xa9ae('0x4a')]));}return BPromise[_0xa9ae('0x4e')](_0x361914)[_0xa9ae('0x11')](function(_0x286b94){return _0x456485;});}else{return _0x456485;}})[_0xa9ae('0x11')](respondWithFilteredResult(_0x1ab92c,_0xb82ad1))[_0xa9ae('0x1b')](handleError(_0x1ab92c,null));};exports[_0xa9ae('0x4f')]=function(_0x34632c,_0x2efa6a){var _0x345b6={'raw':![],'where':{'id':_0x34632c[_0xa9ae('0x50')]['id']}},_0x4a60c6={};_0x4a60c6[_0xa9ae('0x51')]=_[_0xa9ae('0x52')](_[_0xa9ae('0x53')](db[_0xa9ae('0x37')][_0xa9ae('0x38')]),[_0xa9ae('0x3c'),_0xa9ae('0x3d')]);_0x4a60c6[_0xa9ae('0x40')]=_[_0xa9ae('0x53')](_0x34632c['query']);_0x4a60c6[_0xa9ae('0x54')]=_[_0xa9ae('0x55')](_0x4a60c6[_0xa9ae('0x51')],_0x4a60c6['query']);_0x345b6[_0xa9ae('0x43')]=_[_0xa9ae('0x55')](_0x4a60c6[_0xa9ae('0x51')],qs[_0xa9ae('0x56')](_0x34632c['query'][_0xa9ae('0x56')]));_0x345b6[_0xa9ae('0x43')]=_0x345b6[_0xa9ae('0x43')][_0xa9ae('0x48')]?_0x345b6[_0xa9ae('0x43')]:_0x4a60c6[_0xa9ae('0x51')];if(_0x34632c['query']['includeAll']){_0x345b6[_0xa9ae('0x41')]=[{'all':!![]}];}_0x345b6=_[_0xa9ae('0x57')]({},_0x345b6,_0x34632c[_0xa9ae('0x58')]);if(!_[_0xa9ae('0x42')](_0x345b6[_0xa9ae('0x43')],'id')){_0x345b6[_0xa9ae('0x43')][_0xa9ae('0x44')]('id');}return db[_0xa9ae('0x37')][_0xa9ae('0x30')](_0x345b6)[_0xa9ae('0x11')](handleEntityNotFound(_0x2efa6a,null))['then'](function(_0x5e7e83){var _0x1a7bbc=[];values=_0x5e7e83;if(_0x34632c[_0xa9ae('0x40')][_0xa9ae('0x59')]===_0xa9ae('0x47')){_0x1a7bbc[_0xa9ae('0x44')](get_open_tabs('chat',_0x5e7e83[_0xa9ae('0x4a')]));_0x1a7bbc['push'](get_open_tabs(_0xa9ae('0x5a'),_0x5e7e83['dataValues']));_0x1a7bbc['push'](get_open_tabs(_0xa9ae('0x4d'),_0x5e7e83[_0xa9ae('0x4a')]));_0x1a7bbc[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x5b'),_0x5e7e83[_0xa9ae('0x4a')]));_0x1a7bbc['push'](get_open_tabs(_0xa9ae('0x4b'),_0x5e7e83[_0xa9ae('0x4a')]));_0x1a7bbc[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4c'),_0x5e7e83[_0xa9ae('0x4a')]));return BPromise['all'](_0x1a7bbc);}else{return values;}})[_0xa9ae('0x11')](function(_0x20dffe){return values;})[_0xa9ae('0x11')](respondWithResult(_0x2efa6a,null))[_0xa9ae('0x1b')](handleError(_0x2efa6a,null));};exports[_0xa9ae('0x25')]=function(_0x4a2a32,_0x10d732){if(_0x4a2a32[_0xa9ae('0x5c')]['id']){delete _0x4a2a32[_0xa9ae('0x5c')]['id'];}delete _0x4a2a32['body']['role'];return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x4a2a32['params']['id']}})['then'](handleEntityNotFound(_0x10d732,null))[_0xa9ae('0x11')](saveUpdates(_0x4a2a32[_0xa9ae('0x5c')],null))['then'](respondWithResult(_0x10d732,null))['catch'](handleError(_0x10d732,null));};exports[_0xa9ae('0x5d')]=function(_0xc46d6f,_0x4157bf){return db['User'][_0xa9ae('0x5d')]()[_0xa9ae('0x11')](respondWithResult(_0x4157bf,null))[_0xa9ae('0x1b')](handleError(_0x4157bf,null));};exports[_0xa9ae('0x5e')]=function(_0x1af19e,_0x40aa53){return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x1af19e[_0xa9ae('0x50')]['id']}})[_0xa9ae('0x11')](handleEntityNotFound(_0x40aa53,null))[_0xa9ae('0x11')](function(_0x3da1c3){if(_0x3da1c3){return _0x3da1c3[_0xa9ae('0x5e')](_0x1af19e[_0xa9ae('0x5c')][_0xa9ae('0x5f')],_[_0xa9ae('0x60')](_0x1af19e[_0xa9ae('0x5c')],[_0xa9ae('0x5f'),'id'])||{});}})[_0xa9ae('0x11')](respondWithResult(_0x40aa53,null))['catch'](handleError(_0x40aa53,null));};function validateUser(_0x22ffa5){return new BPromise(function(_0x592eee,_0xa64d1f){if(_0x22ffa5[_0xa9ae('0x61')])return _0x592eee(_0x22ffa5);return db[_0xa9ae('0x62')][_0xa9ae('0x63')](0x1)[_0xa9ae('0x11')](function(_0x34bc09){if(_0x34bc09['securePassword'])authService[_0xa9ae('0x64')](_0x22ffa5[_0xa9ae('0x3c')]);db[_0xa9ae('0x37')][_0xa9ae('0x65')](_0xa9ae('0x61'))[_0xa9ae('0x11')](function(_0x5c4427){if(_['isNil'](_0x5c4427)){_0x22ffa5[_0xa9ae('0x61')]=_0x34bc09[_0xa9ae('0x66')]||0x1;return;}if(_[_0xa9ae('0x67')](_0x34bc09['min_internal'])||_0x34bc09[_0xa9ae('0x66')]===_0x5c4427){_0x22ffa5[_0xa9ae('0x61')]=_0x5c4427+0x1;return;}if(_0x34bc09['min_internal']>_0x5c4427){_0x22ffa5[_0xa9ae('0x61')]=_0x34bc09['min_internal'];return;}return db['sequelize'][_0xa9ae('0x40')](_0xa9ae('0x68'),{'type':db['sequelize'][_0xa9ae('0x69')][_0xa9ae('0x6a')]})[_0xa9ae('0x11')](function(_0x4b8228){if(_0x4b8228&&_0x4b8228[_0xa9ae('0x48')]){for(var _0x14beba=0x0,_0x47660c=_0x4b8228[_0xa9ae('0x48')];_0x14beba<_0x47660c&&_[_0xa9ae('0x67')](_0x22ffa5[_0xa9ae('0x61')]);_0x14beba++){if(_0x34bc09[_0xa9ae('0x66')]<=_0x4b8228[_0x14beba]['from']){_0x22ffa5[_0xa9ae('0x61')]=_0x4b8228[_0x14beba][_0xa9ae('0x6b')];}else if(_0x34bc09[_0xa9ae('0x66')]>_0x4b8228[_0x14beba]['from']&&_0x34bc09[_0xa9ae('0x66')]<=_0x4b8228[_0x14beba]['to']){_0x22ffa5[_0xa9ae('0x61')]=_0x34bc09[_0xa9ae('0x66')];}}}if(_[_0xa9ae('0x67')](_0x22ffa5[_0xa9ae('0x61')])){_0x22ffa5[_0xa9ae('0x61')]=_0x5c4427+0x1;}return _0x592eee(_0x22ffa5);});});})[_0xa9ae('0x1b')](function(_0x1ed20d){_0xa64d1f(_0x1ed20d);});});}function updateUser(_0x165800){return new BPromise(function(_0x1731ba,_0x43933c){try{if(_0x165800[_0xa9ae('0x6c')]){_0x165800[_0xa9ae('0x6d')]=_0x165800['internal'];_0x165800[_0xa9ae('0x6e')]={'mailbox':_0x165800[_0xa9ae('0x61')],'password':_0x165800[_0xa9ae('0x3c')],'fullname':_0x165800[_0xa9ae('0x6f')],'email':_0x165800[_0xa9ae('0x70')]};}if(_0x165800[_0xa9ae('0x31')]===_0xa9ae('0x2a')){if(!_0x165800[_0xa9ae('0x71')])_0x165800['permissions']=[_0xa9ae('0x72'),_0xa9ae('0x73'),_0xa9ae('0x74'),'113','110',_0xa9ae('0x75'),_0xa9ae('0x76'),_0xa9ae('0x77'),_0xa9ae('0x78'),_0xa9ae('0x79'),_0xa9ae('0x7a'),_0xa9ae('0x7b'),'111',_0xa9ae('0x7c'),'115'];}_0x1731ba(_0x165800);}catch(_0x464897){_0x43933c(_0x464897);}});}exports['create']=function(_0x527c06,_0x5e5710){if(_0x527c06[_0xa9ae('0x7d')]['role']==='agent')throw new Error(_0xa9ae('0x7e'));if(_0x527c06['body'][_0xa9ae('0x31')]==='user'&&_0x527c06[_0xa9ae('0x7d')][_0xa9ae('0x31')]!==_0xa9ae('0x28')){throw new Error(_0xa9ae('0x7f'));}if(_0x527c06[_0xa9ae('0x5c')]['role']===_0xa9ae('0x28')&&_0x527c06[_0xa9ae('0x7d')]['role']!=='admin'){throw new Error(_0xa9ae('0x80'));}return licenseUtil['checkUserLimits']([_0x527c06[_0xa9ae('0x5c')]])['then'](function(){return validateUser(_0x527c06[_0xa9ae('0x5c')]);})[_0xa9ae('0x11')](function(_0x439899){return updateUser(_0x439899)[_0xa9ae('0x11')](function(_0x526e9d){if(_0x526e9d[_0xa9ae('0x31')]==='admin'){_0x526e9d[_0xa9ae('0x81')]=_0x527c06[_0xa9ae('0x7d')][_0xa9ae('0x81')];delete _0x526e9d[_0xa9ae('0x82')];}return _0x526e9d;});})[_0xa9ae('0x11')](function(_0x5e0da4){return db['User'][_0xa9ae('0x83')](_0x5e0da4,{'include':[{'model':db['VoiceMail'],'as':_0xa9ae('0x6e')}]});})[_0xa9ae('0x11')](function(_0x3990be){if(_0x527c06[_0xa9ae('0x5c')][_0xa9ae('0x31')]===_0xa9ae('0x7d'))return _0x3990be;if(_0x527c06[_0xa9ae('0x7d')][_0xa9ae('0x31')]!==_0xa9ae('0x7d'))return _0x3990be;return db[_0xa9ae('0x84')][_0xa9ae('0x30')]({'where':{'name':_0x3990be[_0xa9ae('0x31')]===_0xa9ae('0x2a')?_0xa9ae('0x29'):_0xa9ae('0x2b'),'userProfileId':_0x527c06[_0xa9ae('0x7d')][_0xa9ae('0x82')]},'raw':!![]})[_0xa9ae('0x11')](function(_0x23eaf8){if(!_0x23eaf8||_0x23eaf8[_0xa9ae('0x85')]!=0x0)return _0x3990be;return db[_0xa9ae('0x86')]['create']({'name':_0x3990be[_0xa9ae('0x32')],'resourceId':_0x3990be['id'],'type':_0x23eaf8[_0xa9ae('0x32')],'sectionId':_0x23eaf8['id']},{})[_0xa9ae('0x11')](function(){return _0x3990be;});})[_0xa9ae('0x1b')](function(_0xb685ab){logger['error'](_0xa9ae('0x87'),_0xb685ab);throw _0xb685ab;});})[_0xa9ae('0x11')](respondWithResult(_0x5e5710,0xc9))[_0xa9ae('0x1b')](handleError(_0x5e5710,null));};exports[_0xa9ae('0x88')]=function(_0x287c70,_0x2444c5){var _0x4c66ba=_0x287c70['body'];var _0x5b9f4e=[];if(_0x287c70['user'][_0xa9ae('0x31')]===_0xa9ae('0x2a'))throw new Error(_0xa9ae('0x7e'));if(_[_0xa9ae('0x89')](_0x4c66ba,[_0xa9ae('0x31'),_0xa9ae('0x7d')])&&_0x287c70[_0xa9ae('0x7d')]['role']!==_0xa9ae('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4c66ba,[_0xa9ae('0x31'),_0xa9ae('0x28')])&&_0x287c70['user'][_0xa9ae('0x31')]!==_0xa9ae('0x28')){throw new Error(_0xa9ae('0x8a'));}return licenseUtil['checkUserLimits'](_0x4c66ba)[_0xa9ae('0x11')](function(){return validateUser(_0x4c66ba[0x0]);})[_0xa9ae('0x11')](function(){for(var _0x5326c9=0x1;_0x5326c9<_0x4c66ba[_0xa9ae('0x48')];_0x5326c9++){var _0x3828fe=_0x4c66ba[_0x5326c9-0x1]['internal'];if(!_0x4c66ba[_0x5326c9][_0xa9ae('0x61')])_0x4c66ba[_0x5326c9][_0xa9ae('0x61')]=_0x3828fe+0x1;_0x5b9f4e[_0xa9ae('0x44')](validateUser(_0x4c66ba[_0x5326c9]));}return BPromise[_0xa9ae('0x4e')](_0x5b9f4e);})[_0xa9ae('0x11')](function(){_0x5b9f4e=[];for(var _0xb94ca1=0x0;_0xb94ca1<_0x4c66ba['length'];_0xb94ca1++){_0x5b9f4e[_0xa9ae('0x44')](updateUser(_0x4c66ba[_0xb94ca1]));}return BPromise['all'](_0x5b9f4e);})[_0xa9ae('0x11')](function(){return BPromise[_0xa9ae('0x8b')](_0x4c66ba,function(_0xb2148a){return db['User'][_0xa9ae('0x83')](_0xb2148a,{'include':[{'model':db[_0xa9ae('0x6e')],'as':_0xa9ae('0x6e')}]})[_0xa9ae('0x11')](function(_0x5ba185){_0xb2148a['id']=_0x5ba185['id'];return _0xb2148a;});});})[_0xa9ae('0x11')](function(_0x55c2c6){if(_0x287c70[_0xa9ae('0x5c')][_0xa9ae('0x31')]===_0xa9ae('0x7d'))return _0x55c2c6;if(_0x287c70[_0xa9ae('0x7d')][_0xa9ae('0x31')]!==_0xa9ae('0x7d'))return _0x55c2c6;var _0x5a0361=_['some'](_0x55c2c6,function(_0x112047){return _0x112047[_0xa9ae('0x31')]==='agent'||_0x112047[_0xa9ae('0x31')]==='telephone';});if(!_0x5a0361)return _0x55c2c6;return db[_0xa9ae('0x84')][_0xa9ae('0x45')]({'where':{'name':{'$or':['Agents',_0xa9ae('0x2b')]},'userProfileId':_0x287c70[_0xa9ae('0x7d')][_0xa9ae('0x82')]},'raw':!![]})['then'](function(_0x906b73){if(_['isEmpty'](_0x906b73)||!_[_0xa9ae('0x89')](_0x906b73,[_0xa9ae('0x85'),0x0]))return _0x55c2c6;_0x5b9f4e=[];var _0x41ad31=_(_0x906b73)[_0xa9ae('0x2e')](function(_0x511e36){if(_0x511e36[_0xa9ae('0x85')]===0x1)return;return _0x511e36[_0xa9ae('0x32')]===_0xa9ae('0x29')?_0xa9ae('0x2a'):'telephone';})[_0xa9ae('0x8c')]()[_0xa9ae('0x2f')]();for(var _0x399be9=0x0;_0x399be9<_0x55c2c6[_0xa9ae('0x48')];_0x399be9++){if(!_[_0xa9ae('0x42')](_0x41ad31,_0x55c2c6[_0x399be9][_0xa9ae('0x31')]))return;var _0x61f6c5=_0x55c2c6[_0x399be9][_0xa9ae('0x31')]===_0xa9ae('0x2a')?_0xa9ae('0x29'):_0xa9ae('0x2b');_0x5b9f4e['push'](db[_0xa9ae('0x86')][_0xa9ae('0x83')]({'name':_0x55c2c6[_0x399be9]['name'],'resourceId':_0x55c2c6[_0x399be9]['id'],'type':_0x61f6c5,'sectionId':_[_0xa9ae('0x30')](_0x906b73,[_0xa9ae('0x32'),_0x61f6c5])['id']},{}));}return BPromise[_0xa9ae('0x4e')](_0x5b9f4e);});})[_0xa9ae('0x11')](respondWithResult(_0x2444c5,0xc9))[_0xa9ae('0x1b')](handleError(_0x2444c5,null));};exports['changePassword']=function(_0x39a0ff,_0x391a51){if(_0x39a0ff[_0xa9ae('0x5c')]['id']){delete _0x39a0ff['body']['id'];}return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x39a0ff[_0xa9ae('0x50')]['id']}})[_0xa9ae('0x11')](function(_0x5d3418){if(!_0x5d3418)return null;if(_0x5d3418['id']===_0x39a0ff[_0xa9ae('0x7d')]['id']){if(!_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8d')]||!_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')]){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x91'));}if(!_0x5d3418[_0xa9ae('0x92')](_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8d')])){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x93'));}if(_0x39a0ff['body'][_0xa9ae('0x8d')]===_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')]){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x94'));}}else if(_0x39a0ff[_0xa9ae('0x7d')][_0xa9ae('0x31')]===_0xa9ae('0x28')){if(!_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')]){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x95'));}}else if(_0x39a0ff['user'][_0xa9ae('0x31')]==='user'){if(!_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')]){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x95'));}if(_0x5d3418[_0xa9ae('0x31')]!==_0xa9ae('0x2a')){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0x7e'));}}else{throw new db[(_0xa9ae('0x8f'))]['ValidationError']('Unauthorized');}return _0x5d3418;})[_0xa9ae('0x11')](handleEntityNotFound(_0x391a51,null))[_0xa9ae('0x11')](function(_0x77517f){return db[_0xa9ae('0x62')]['findOne']({'attributes':['id',_0xa9ae('0x96'),'enforcePasswordHistory',_0xa9ae('0x97')]})[_0xa9ae('0x11')](function(_0x264a11){if(_0x264a11[_0xa9ae('0x96')])authService['validatePasswordPattern'](_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')]);if(!_0x264a11['enforcePasswordHistory']||!_0x77517f['previousPasswords'])return _0x77517f;authService[_0xa9ae('0x98')](_0x39a0ff[_0xa9ae('0x5c')][_0xa9ae('0x8e')],_0x77517f[_0xa9ae('0x99')],_0x264a11[_0xa9ae('0x97')]);return _0x77517f;})[_0xa9ae('0x11')](saveUpdates({'password':_0x39a0ff['body'][_0xa9ae('0x8e')],'passwordResetAt':_0x39a0ff['user']['id']==_0x39a0ff['params']['id']?moment():null,'previousPasswords':authService[_0xa9ae('0x9a')](_0x39a0ff[_0xa9ae('0x5c')]['newPassword'],_0x77517f[_0xa9ae('0x99')])},null));})[_0xa9ae('0x11')](respondWithResult(_0x391a51,null))[_0xa9ae('0x1b')](handleError(_0x391a51,null));};exports[_0xa9ae('0x9b')]=function(_0x2b651f,_0x27b236){var _0x36ac5f=_0x2b651f[_0xa9ae('0x5c')]['channel'];return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x2b651f[_0xa9ae('0x50')]['id']},'attributes':['id',_0xa9ae('0x32'),_0xa9ae('0x31'),_0xa9ae('0x9c'),_0xa9ae('0x9d'),_0xa9ae('0x9e'),_0xa9ae('0x9f')]})[_0xa9ae('0x11')](handleEntityNotFound(_0x27b236,null))[_0xa9ae('0x11')](function(_0x522180){if(_0x522180){if(!utils[_0xa9ae('0xa0')](_0x36ac5f)){throw new db[(_0xa9ae('0x8f'))]['ValidationError'](_0xa9ae('0xa1'));}return _0x522180[_0xa9ae('0xa2')+_[_0xa9ae('0xa3')](_0x36ac5f[_0xa9ae('0xa4')]())+_0xa9ae('0xa5')](_0x2b651f[_0xa9ae('0x5c')][_0xa9ae('0x5f')],{'penalty':_0x2b651f[_0xa9ae('0x5c')][_0xa9ae('0xa6')]||0x0})['spread'](function(_0x2b2998){for(var _0x5cb8ea=0x0;_0x5cb8ea<_0x2b651f['body'][_0xa9ae('0x5f')][_0xa9ae('0x48')];_0x5cb8ea+=0x1){var _0x446999={'UserId':Number(_0x2b651f[_0xa9ae('0x50')]['id'])};_0x446999[_['capitalize'](_0x36ac5f[_0xa9ae('0xa4')]())+_0xa9ae('0xa7')]=Number(_0x2b651f[_0xa9ae('0x5c')][_0xa9ae('0x5f')][_0x5cb8ea]);socket[_0xa9ae('0xa8')](_0xa9ae('0x7d')+_[_0xa9ae('0xa3')](_0x36ac5f['toLowerCase']())+_0xa9ae('0xa9'),_0x446999);}return _0x2b2998;})['then'](function(){if(_0x36ac5f===_0xa9ae('0xaa')){return db[_0xa9ae('0xab')][_0xa9ae('0x45')]({'where':{'id':_0x2b651f[_0xa9ae('0x5c')]['ids']||[]},'raw':!![],'attributes':['id',_0xa9ae('0x32')]});}})[_0xa9ae('0x11')](function(_0x175a3d){var _0x2d8e5d=_0x522180[_0xa9ae('0x27')]({'plain':!![]});var _0x4947e7=[];if(_0x36ac5f===_0xa9ae('0xaa')&&_0x2d8e5d[_0xa9ae('0x31')]===_0xa9ae('0x2a')&&_0x2d8e5d[_0xa9ae('0x9c')]){for(var _0xd69fb2=0x0;_0xd69fb2<_0x175a3d[_0xa9ae('0x48')];_0xd69fb2+=0x1){_0x4947e7['push']({'membername':_0x2d8e5d[_0xa9ae('0x32')],'UserId':_0x2d8e5d['id'],'queue_name':_0x175a3d[_0xd69fb2]['name'],'VoiceQueueId':_0x175a3d[_0xd69fb2]['id'],'interface':_[_0xa9ae('0x67')](_0x2d8e5d[_0xa9ae('0x9f')])?util[_0xa9ae('0xac')](_0xa9ae('0xad'),_0x2d8e5d[_0xa9ae('0x32')]):_0x2d8e5d[_0xa9ae('0x9f')],'paused':_0x2d8e5d[_0xa9ae('0x9e')]||![],'penalty':_0x2b651f[_0xa9ae('0x5c')][_0xa9ae('0xa6')]||0x0});}return BPromise[_0xa9ae('0x8b')](_0x4947e7,function(_0x1dc167){return db[_0xa9ae('0xae')][_0xa9ae('0xaf')](_0x1dc167);});}return _0x522180;});}})[_0xa9ae('0x11')](respondWithStatusCode(_0x27b236,null))['catch'](handleError(_0x27b236,null));};exports['removeQueues']=function(_0x42dead,_0x23271b){var _0x614159;return db[_0xa9ae('0x37')]['find']({'where':{'id':_0x42dead['params']['id']},'attributes':['id',_0xa9ae('0x32'),'role']})['then'](handleEntityNotFound(_0x23271b,null))[_0xa9ae('0x11')](function(_0x40feac){if(_0x40feac){_0x614159=_0x40feac;if(!_0x42dead[_0xa9ae('0x40')][_0xa9ae('0xb0')]||!utils['isValidChannel'](_0x42dead['query'][_0xa9ae('0xb0')])){throw new db[(_0xa9ae('0x8f'))][(_0xa9ae('0x90'))](_0xa9ae('0xa1'));}return _0x40feac[_0xa9ae('0xb1')+_[_0xa9ae('0xa3')](_0x42dead[_0xa9ae('0x40')]['channel']['toLowerCase']())+_0xa9ae('0xa5')](_0x42dead[_0xa9ae('0x40')]['ids']);}})[_0xa9ae('0x11')](function(_0x25c5a9){if(_[_0xa9ae('0xb2')](_0x42dead[_0xa9ae('0x40')][_0xa9ae('0x5f')])){for(var _0x19d5c7=0x0;_0x19d5c7<_0x42dead[_0xa9ae('0x40')][_0xa9ae('0x5f')]['length'];_0x19d5c7+=0x1){var _0x33237a={'UserId':Number(_0x42dead['params']['id'])};_0x33237a[_[_0xa9ae('0xa3')](_0x42dead[_0xa9ae('0x40')][_0xa9ae('0xb0')][_0xa9ae('0xa4')]())+_0xa9ae('0xa7')]=Number(_0x42dead[_0xa9ae('0x40')][_0xa9ae('0x5f')][_0x19d5c7]);socket[_0xa9ae('0xa8')](_0xa9ae('0x7d')+_[_0xa9ae('0xa3')](_0x42dead[_0xa9ae('0x40')][_0xa9ae('0xb0')][_0xa9ae('0xa4')]())+'Queue:remove',_0x33237a);}}else{var _0x33237a={'UserId':Number(_0x42dead[_0xa9ae('0x50')]['id'])};_0x33237a[_[_0xa9ae('0xa3')](_0x42dead[_0xa9ae('0x40')][_0xa9ae('0xb0')][_0xa9ae('0xa4')]())+_0xa9ae('0xa7')]=Number(_0x42dead[_0xa9ae('0x40')][_0xa9ae('0x5f')]);socket[_0xa9ae('0xa8')](_0xa9ae('0x7d')+_[_0xa9ae('0xa3')](_0x42dead[_0xa9ae('0x40')]['channel'][_0xa9ae('0xa4')]())+_0xa9ae('0xb3'),_0x33237a);}return _0x25c5a9;})[_0xa9ae('0x11')](function(){if(_0x42dead[_0xa9ae('0x40')]['channel']===_0xa9ae('0xaa')){return db[_0xa9ae('0xae')][_0xa9ae('0x26')]({'where':{'UserId':_0x42dead[_0xa9ae('0x50')]['id'],'VoiceQueueId':_0x42dead['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x614159;});}return _0x614159;})['then'](respondWithStatusCode(_0x23271b,null))[_0xa9ae('0x1b')](handleError(_0x23271b,null));};exports[_0xa9ae('0xb4')]=function(_0x371228,_0x2143e3){_0x371228[_0xa9ae('0x5c')][_0xa9ae('0xb5')]=_0x371228[_0xa9ae('0xb6')][_0xa9ae('0xb7')];return db['User'][_0xa9ae('0x30')]({'where':{'id':_0x371228[_0xa9ae('0x50')]['id']}})['then'](handleEntityNotFound(_0x2143e3,null))[_0xa9ae('0x11')](saveUpdates(_0x371228[_0xa9ae('0x5c')],null))[_0xa9ae('0x11')](respondWithResult(_0x2143e3,null))[_0xa9ae('0x1b')](handleError(_0x2143e3,null));};exports[_0xa9ae('0xb8')]=function(_0x1bab06,_0x1f7806){var _0xa2f698=path[_0xa9ae('0xb9')](config[_0xa9ae('0xba')],_0xa9ae('0xbb'));return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x1bab06[_0xa9ae('0x50')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xa9ae('0x11')](handleEntityNotFound(_0x1f7806,null))[_0xa9ae('0x11')](function(_0x315ae7){if(_0x315ae7){if(_[_0xa9ae('0x67')](_0x315ae7[_0xa9ae('0xb5')])){return _0x1f7806[_0xa9ae('0xbc')](_0xa2f698);}else{if(!fs[_0xa9ae('0xbd')](path[_0xa9ae('0xb9')](config[_0xa9ae('0xba')],'server/files/images/',_0x315ae7['userpic']))){return _0x1f7806[_0xa9ae('0xbc')](_0xa2f698);}return _0x1f7806[_0xa9ae('0xbc')](path[_0xa9ae('0xb9')](config[_0xa9ae('0xba')],_0xa9ae('0xbe'),_0x315ae7['userpic']));}}})[_0xa9ae('0x1b')](handleError(_0x1f7806,null));};exports[_0xa9ae('0xbf')]=function(_0x5141cb,_0x5248a1){return db[_0xa9ae('0x37')][_0xa9ae('0x30')]({'where':{'id':_0x5141cb[_0xa9ae('0x50')]['id']},'attributes':['id']})[_0xa9ae('0x11')](handleEntityNotFound(_0x5248a1,null))[_0xa9ae('0x11')](function(_0x29092f){var _0x4a9719=[];values=_0x29092f[_0xa9ae('0x4a')];_0x4a9719['push'](get_open_tabs('chat',_0x29092f[_0xa9ae('0x4a')]));_0x4a9719[_0xa9ae('0x44')](get_open_tabs('sms',_0x29092f[_0xa9ae('0x4a')]));_0x4a9719[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4d'),_0x29092f[_0xa9ae('0x4a')]));_0x4a9719['push'](get_open_tabs(_0xa9ae('0x5b'),_0x29092f['dataValues']));_0x4a9719['push'](get_open_tabs(_0xa9ae('0x4b'),_0x29092f[_0xa9ae('0x4a')]));_0x4a9719[_0xa9ae('0x44')](get_open_tabs(_0xa9ae('0x4c'),_0x29092f[_0xa9ae('0x4a')]));return BPromise[_0xa9ae('0x4e')](_0x4a9719);})[_0xa9ae('0x11')](function(_0x41eb9b){var _0x1d1494=[];if(_0x41eb9b){for(var _0x5ed46b=0x0;_0x5ed46b=_0x441f9d[_0xc14c('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xc14c('0x11')](function(){if(_0x14aab9){return db['UserVoiceQueueRt'][_0xc14c('0x49')]({'where':{'membername':_0x14aab9[_0xc14c('0x28')]},'individualHooks':!![]});}})[_0xc14c('0x11')](function(){if(_0x14aab9){return _0x14aab9[_0xc14c('0x52')]({'raw':!![]});}})[_0xc14c('0x11')](function(_0x431770){if(_0x14aab9){if(_0x431770){var _0x33c227=[];_0x2177cc=_0x431770;if(_0x2177cc['length']){for(var _0x1b6b66=0x0;_0x1b6b66<_0x2177cc[_0xc14c('0x4a')];_0x1b6b66++){_0x33c227['push'](db[_0xc14c('0x2a')]['upsert']({'membername':_0x14aab9[_0xc14c('0x28')],'UserId':_0x14aab9['id'],'queue_name':_0x2177cc[_0x1b6b66][_0xc14c('0x28')],'VoiceQueueId':_0x2177cc[_0x1b6b66]['id'],'interface':_0x100e58,'paused':_0x14aab9[_0xc14c('0x53')]||![],'penalty':_0x2177cc[_0x1b6b66][_0xc14c('0x54')]||0x0}));}return BPromise[_0xc14c('0x47')](_0x33c227);}}}})[_0xc14c('0x11')](function(){if(_0x14aab9){return db[_0xc14c('0x2b')][_0xc14c('0x1a')]({'where':{'membername':_0x14aab9[_0xc14c('0x28')],'exitAt':null}});}})[_0xc14c('0x11')](function(_0x520e17){if(_0x14aab9){if(_0x520e17&&_0x520e17[_0xc14c('0x4a')]){var _0xc8d68=[];_0x520e17[_0xc14c('0x31')](function(_0xe20a21){_0xc8d68['push'](_0xe20a21['update']({'exitAt':moment()[_0xc14c('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc14c('0x47')](_0xc8d68);}}})[_0xc14c('0x11')](function(_0x5e9a58){if(_0x14aab9){var _0x4ee545=[];var _0xef8937=[];var _0x209be8=utils[_0xc14c('0x30')]();var _0x7ce21e={'membername':_0x14aab9['name'],'interface':_0x100e58,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x14aab9['role'],'internal':_0x14aab9[_0xc14c('0x29')]};_0x209be8[_0xc14c('0x31')](function(_0x1533ae){_0x4ee545['push'](_[_0xc14c('0x55')]({'channel':_0x1533ae,'type':_0xc14c('0x56'),'data1':_0xc14c('0x57'),'data2':_0x100e58},_0x7ce21e));if(_0x14aab9[_0xc14c('0x53')]){_0xef8937[_0xc14c('0x46')](_[_0xc14c('0x55')]({'channel':_0x1533ae,'type':'PAUSE','data1':_0xc14c('0x58')},_0x7ce21e));}});return db[_0xc14c('0x2b')][_0xc14c('0x59')](_0x4ee545[_0xc14c('0x5a')](_0xef8937),{'individualHooks':!![]});}})['then'](function(){if(_0x14aab9){return _0x14aab9[_0xc14c('0x38')]({'online':!![],'lastLoginAt':moment()[_0xc14c('0x2d')](_0xc14c('0x2e')),'voicePause':_0x14aab9[_0xc14c('0x53')]||![],'mailPause':_0x14aab9[_0xc14c('0x53')]||![],'chatPause':_0x14aab9[_0xc14c('0x53')]||![],'faxPause':_0x14aab9[_0xc14c('0x53')]||![],'smsPause':_0x14aab9['loginInPause']||![],'openchannelPause':_0x14aab9[_0xc14c('0x53')]||![],'pauseType':_0x14aab9['loginInPause']?_0xc14c('0x58'):null,'lastPauseAt':moment()[_0xc14c('0x2d')](_0xc14c('0x2e')),'interface':_0x100e58});}})[_0xc14c('0x11')](function(_0x290c12){_0x13485d(_0x290c12);})[_0xc14c('0x18')](function(_0x3c8422){_0x14c434(_0x51a855[_0xc14c('0x15')](0x1f4,_0x3c8422[_0xc14c('0x17')]));});});}; \ No newline at end of file +var _0x1171=['count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','callysquare','merge','LOGININPAUSE','concat','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','User','findAll','options','attributes','limit','include','map','model','debug','stringify','ShowUser','find','raw','where','then','name','role','internal','UserVoiceQueueRt','update','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','format','interface','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','MemberReport','system','chat','fax','sms','openchannel','set','%s%s','Pause','all','LogoutUser','findOne','destroy','forEach','mobile','phone','loginInPause','SIP/%s'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x1171,0xc9));var _0x1117=function(_0x1dc0b9,_0x43ffca){_0x1dc0b9=_0x1dc0b9-0x0;var _0x20013a=_0x1171[_0x1dc0b9];return _0x20013a;};'use strict';var _=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var moment=require('moment');var BPromise=require(_0x1117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1117('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1117('0x4'));var config=require(_0x1117('0x5'));var jayson=require(_0x1117('0x6'));var client=jayson['client'][_0x1117('0x7')]({'port':0x232a});config[_0x1117('0x8')]=_[_0x1117('0x9')](config[_0x1117('0x8')],{'host':_0x1117('0xa'),'port':0x18eb});var socket=require(_0x1117('0xb'))(new Redis(config[_0x1117('0x8')]));require(_0x1117('0xc'))[_0x1117('0xd')](socket);function respondWithRpcPromise(_0x252357,_0x2363cc,_0x48ba19){return new BPromise(function(_0x5a8ac5,_0x2ab991){return client[_0x1117('0xe')](_0x252357,_0x48ba19)['then'](function(_0x200d0e){logger[_0x1117('0xf')](_0x1117('0x10'),_0x2363cc,_0x1117('0x11'));logger['debug'](_0x1117('0x12'),_0x2363cc,_0x1117('0x11'),JSON['stringify'](_0x200d0e));if(_0x200d0e[_0x1117('0x13')]){if(_0x200d0e[_0x1117('0x13')][_0x1117('0x14')]===0x1f4){logger[_0x1117('0x13')](_0x1117('0x10'),_0x2363cc,_0x200d0e[_0x1117('0x13')][_0x1117('0x15')]);return _0x2ab991(_0x200d0e[_0x1117('0x13')][_0x1117('0x15')]);}logger[_0x1117('0x13')]('User,\x20%s,\x20%s',_0x2363cc,_0x200d0e[_0x1117('0x13')][_0x1117('0x15')]);return _0x5a8ac5(_0x200d0e[_0x1117('0x13')][_0x1117('0x15')]);}else{logger[_0x1117('0xf')](_0x1117('0x10'),_0x2363cc,_0x1117('0x11'));_0x5a8ac5(_0x200d0e[_0x1117('0x16')][_0x1117('0x15')]);}})[_0x1117('0x17')](function(_0x4576e9){logger[_0x1117('0x13')](_0x1117('0x10'),_0x2363cc,_0x4576e9);_0x2ab991(_0x4576e9);});});}exports[_0x1117('0x18')]=function(_0x47c280){var _0x1c23f2=this;return new Promise(function(_0x4164bc,_0x50bc94){return db[_0x1117('0x19')][_0x1117('0x1a')]({'raw':_0x47c280[_0x1117('0x1b')]?_0x47c280[_0x1117('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x47c280[_0x1117('0x1b')]?_0x47c280[_0x1117('0x1b')]['where']||null:null,'attributes':_0x47c280[_0x1117('0x1b')]?_0x47c280[_0x1117('0x1b')][_0x1117('0x1c')]||null:null,'limit':_0x47c280['options']?_0x47c280['options'][_0x1117('0x1d')]||null:null,'include':_0x47c280['options']?_0x47c280[_0x1117('0x1b')][_0x1117('0x1e')]?_[_0x1117('0x1f')](_0x47c280[_0x1117('0x1b')][_0x1117('0x1e')],function(_0x4b2fa3){return{'model':db[_0x4b2fa3[_0x1117('0x20')]],'as':_0x4b2fa3['as'],'attributes':_0x4b2fa3[_0x1117('0x1c')],'include':_0x4b2fa3[_0x1117('0x1e')]?_[_0x1117('0x1f')](_0x4b2fa3[_0x1117('0x1e')],function(_0x44dc20){return{'model':db[_0x44dc20[_0x1117('0x20')]],'as':_0x44dc20['as'],'attributes':_0x44dc20[_0x1117('0x1c')],'include':_0x44dc20[_0x1117('0x1e')]?_[_0x1117('0x1f')](_0x44dc20['include'],function(_0x2d0cb8){return{'model':db[_0x2d0cb8[_0x1117('0x20')]],'as':_0x2d0cb8['as'],'attributes':_0x2d0cb8[_0x1117('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa1075a){logger['info'](_0x1117('0x18'),_0x47c280);logger[_0x1117('0x21')]('GetUser',_0x47c280,JSON[_0x1117('0x22')](_0xa1075a));_0x4164bc(_0xa1075a);})[_0x1117('0x17')](function(_0x35d109){logger[_0x1117('0x13')](_0x1117('0x18'),_0x35d109[_0x1117('0x15')],_0x47c280);_0x50bc94(_0x1c23f2[_0x1117('0x13')](0x1f4,_0x35d109[_0x1117('0x15')]));});});};exports[_0x1117('0x23')]=function(_0x98bb8c){var _0x25eb51=this;return new Promise(function(_0x5a51a2,_0x4c1b32){return db[_0x1117('0x19')][_0x1117('0x24')]({'raw':_0x98bb8c[_0x1117('0x1b')]?_0x98bb8c[_0x1117('0x1b')][_0x1117('0x25')]===undefined?!![]:![]:!![],'where':_0x98bb8c['options']?_0x98bb8c[_0x1117('0x1b')][_0x1117('0x26')]||null:null,'attributes':_0x98bb8c[_0x1117('0x1b')]?_0x98bb8c[_0x1117('0x1b')][_0x1117('0x1c')]||null:null,'include':_0x98bb8c['options']?_0x98bb8c[_0x1117('0x1b')]['include']?_[_0x1117('0x1f')](_0x98bb8c['options'][_0x1117('0x1e')],function(_0x44e165){return{'model':db[_0x44e165[_0x1117('0x20')]],'as':_0x44e165['as'],'attributes':_0x44e165[_0x1117('0x1c')],'include':_0x44e165[_0x1117('0x1e')]?_['map'](_0x44e165[_0x1117('0x1e')],function(_0x443cb0){return{'model':db[_0x443cb0[_0x1117('0x20')]],'as':_0x443cb0['as'],'attributes':_0x443cb0[_0x1117('0x1c')],'include':_0x443cb0['include']?_[_0x1117('0x1f')](_0x443cb0['include'],function(_0x22d736){return{'model':db[_0x22d736[_0x1117('0x20')]],'as':_0x22d736['as'],'attributes':_0x22d736['attributes']};}):[]};}):[]};}):[]:[]})[_0x1117('0x27')](function(_0x1479df){logger['info'](_0x1117('0x23'),_0x98bb8c);logger[_0x1117('0x21')](_0x1117('0x23'),_0x98bb8c,JSON[_0x1117('0x22')](_0x1479df));_0x5a51a2(_0x1479df);})[_0x1117('0x17')](function(_0x6ab6b7){logger[_0x1117('0x13')](_0x1117('0x23'),_0x6ab6b7[_0x1117('0x15')],_0x98bb8c);_0x4c1b32(_0x25eb51[_0x1117('0x13')](0x1f4,_0x6ab6b7[_0x1117('0x15')]));});});};exports['PauseUser']=function(_0x54d7db){var _0x112f01=this;return new Promise(function(_0x331206,_0x247f0e){var _0x5c1d57;return db[_0x1117('0x19')][_0x1117('0x24')]({'where':_0x54d7db['options'][_0x1117('0x26')]||{},'attributes':['id',_0x1117('0x28'),_0x1117('0x29'),_0x1117('0x2a'),'interface']})[_0x1117('0x27')](function(_0x44b9a0){if(_0x44b9a0){_0x5c1d57=_0x44b9a0;return db[_0x1117('0x2b')][_0x1117('0x2c')]({'paused':0x1},{'where':{'UserId':_0x5c1d57['id']},'individualHooks':!![]});}})[_0x1117('0x27')](function(){if(_0x5c1d57){return db['MemberReport'][_0x1117('0x1a')]({'where':{'membername':_0x5c1d57[_0x1117('0x28')],'type':_0x1117('0x2d'),'exitAt':null}});}})[_0x1117('0x27')](function(_0x2e482){if(_0x5c1d57){if(_0x2e482&&_0x2e482[_0x1117('0x2e')]){var _0x49c4c8=moment()['format'](_0x1117('0x2f'));for(var _0xeb0493=0x0,_0x5306c8=_0x2e482[_0x1117('0x2e')];_0xeb0493<_0x5306c8;_0xeb0493++){_0x2e482[_0xeb0493][_0x1117('0x30')]({'exitAt':_0x49c4c8});}}}})['then'](function(){if(_0x5c1d57){var _0x804b32=[];var _0xbe61c0=utils[_0x1117('0x31')]();_0xbe61c0['forEach'](function(_0x3f45ec){_0x804b32[_0x1117('0x32')]({'channel':_0x3f45ec,'membername':_0x5c1d57[_0x1117('0x28')],'interface':_['isNil'](_0x5c1d57['interface'])?util[_0x1117('0x33')]('SIP/%s',_0x5c1d57['name']):_0x5c1d57[_0x1117('0x34')],'type':_0x1117('0x2d'),'enterAt':moment()['format'](_0x1117('0x2f')),'data1':_0x54d7db[_0x1117('0x35')][_0x1117('0x36')]||'DEFAULT\x20PAUSE','role':_0x5c1d57[_0x1117('0x29')],'internal':_0x5c1d57['internal'],'uniqueid':_0x54d7db[_0x1117('0x35')][_0x1117('0x37')]||null});});return db['MemberReport'][_0x1117('0x38')](_0x804b32,{'individualHooks':!![]});}})[_0x1117('0x27')](function(){if(_0x5c1d57){return _0x5c1d57[_0x1117('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x54d7db['body']['type']||_0x1117('0x39'),'lastPauseAt':moment()[_0x1117('0x33')](_0x1117('0x2f'))});}})[_0x1117('0x27')](function(_0x5525e9){_0x331206(_0x5525e9);})[_0x1117('0x17')](function(_0x4e1a13){_0x247f0e(_0x112f01[_0x1117('0x13')](0x1f4,_0x4e1a13[_0x1117('0x15')]));});});};exports[_0x1117('0x3a')]=function(_0x5c1e7e){var _0x165d1b=this;return new Promise(function(_0x31a9f7,_0x4612a9){var _0x5eac56;return db[_0x1117('0x19')]['findOne']({'where':_0x5c1e7e[_0x1117('0x1b')][_0x1117('0x26')]||{},'attributes':['id',_0x1117('0x28')]})[_0x1117('0x27')](function(_0x183f8b){if(_0x183f8b){_0x5eac56=_0x183f8b;if(_0x5c1e7e['body'][_0x1117('0x3b')]&&!utils[_0x1117('0x3c')](_0x5c1e7e[_0x1117('0x35')][_0x1117('0x3b')])){throw new Error(_0x1117('0x3d'));}switch(_0x5c1e7e['body']['channel']){case _0x1117('0x3e'):return db[_0x1117('0x2b')][_0x1117('0x2c')]({'paused':0x0},{'where':{'UserId':_0x5eac56['id']}})[_0x1117('0x27')](function(){return db[_0x1117('0x3f')]['find']({'where':{'channel':_0x5c1e7e[_0x1117('0x35')][_0x1117('0x3b')],'membername':_0x5eac56[_0x1117('0x28')],'type':_0x1117('0x2d'),'exitAt':null}});})[_0x1117('0x27')](function(_0x972e07){if(_0x972e07){return _0x972e07[_0x1117('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1117('0x40')},{'individualHooks':!![]});}return null;})[_0x1117('0x27')](function(){return _0x5eac56[_0x1117('0x2c')]({'voicePause':![]});});case'mail':case _0x1117('0x41'):case _0x1117('0x42'):case _0x1117('0x43'):case _0x1117('0x44'):case'whatsapp':return db['MemberReport'][_0x1117('0x24')]({'where':{'channel':_0x5c1e7e[_0x1117('0x35')][_0x1117('0x3b')],'membername':_0x5eac56[_0x1117('0x28')],'type':_0x1117('0x2d'),'exitAt':null}})['then'](function(_0x2c7489){return _0x2c7489[_0x1117('0x2c')]({'exitAt':moment()[_0x1117('0x33')](_0x1117('0x2f')),'data2':_0x1117('0x40')},{'individualHooks':!![]});})['then'](function(){var _0x28abac={};_[_0x1117('0x45')](_0x28abac,util[_0x1117('0x33')](_0x1117('0x46'),_0x5c1e7e[_0x1117('0x35')][_0x1117('0x3b')],_0x1117('0x47')),![]);return _0x5eac56[_0x1117('0x2c')](_0x28abac);});default:return db[_0x1117('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x5eac56['id']}})[_0x1117('0x27')](function(){return db[_0x1117('0x3f')]['findAll']({'where':{'membername':_0x5eac56['name'],'type':'PAUSE','exitAt':null}});})[_0x1117('0x27')](function(_0x57bca5){var _0x5e021b=[];_0x57bca5['forEach'](function(_0x39922e){_0x5e021b['push'](_0x39922e[_0x1117('0x2c')]({'exitAt':moment()[_0x1117('0x33')](_0x1117('0x2f')),'data2':'system'}));});return BPromise[_0x1117('0x48')](_0x5e021b);})[_0x1117('0x27')](function(){return _0x5eac56[_0x1117('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x1117('0x27')](function(_0x3309d1){_0x31a9f7(_0x3309d1);})[_0x1117('0x17')](function(_0x575d71){_0x4612a9(_0x165d1b[_0x1117('0x13')](0x1f4,_0x575d71['message']));});});};exports[_0x1117('0x49')]=function(_0x5d6c35){var _0x3d9a53=this;return new Promise(function(_0x51b719,_0x17147d){var _0x3ec8b6;return db[_0x1117('0x19')][_0x1117('0x4a')]({'where':_0x5d6c35[_0x1117('0x1b')]['where']||{},'attributes':['id','name']})[_0x1117('0x27')](function(_0x427750){if(_0x427750){_0x3ec8b6=_0x427750;return db[_0x1117('0x2b')][_0x1117('0x4b')]({'where':{'membername':_0x3ec8b6['name']},'individualHooks':!![]});}})[_0x1117('0x27')](function(){if(_0x3ec8b6){return db[_0x1117('0x3f')][_0x1117('0x1a')]({'where':{'membername':_0x3ec8b6['name'],'exitAt':null}});}})[_0x1117('0x27')](function(_0x2477c0){if(_0x3ec8b6){if(_0x2477c0&&_0x2477c0[_0x1117('0x2e')]){var _0x12cca1=[];_0x2477c0[_0x1117('0x4c')](function(_0x35e9ac){_0x12cca1[_0x1117('0x32')](_0x35e9ac[_0x1117('0x2c')]({'exitAt':moment()[_0x1117('0x33')](_0x1117('0x2f'))}));});return BPromise[_0x1117('0x48')](_0x12cca1);}}})[_0x1117('0x27')](function(){if(_0x3ec8b6){return _0x3ec8b6['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x1117('0x27')](function(_0x27aae1){_0x51b719(_0x27aae1);})[_0x1117('0x17')](function(_0x8f875e){_0x17147d(_0x3d9a53[_0x1117('0x13')](0x1f4,_0x8f875e['message']));});});};exports['LoginUser']=function(_0x575595){var _0x40e879=this;return new Promise(function(_0x344a6c,_0x154b5b){var _0x17f67e;var _0x565b23;var _0x2cf31b;var _0x11e619;return db['User'][_0x1117('0x4a')]({'where':_0x575595[_0x1117('0x1b')][_0x1117('0x26')]||{},'attributes':['id',_0x1117('0x28'),'role',_0x1117('0x4d'),_0x1117('0x4e'),_0x1117('0x2a'),_0x1117('0x4f'),_0x1117('0x34')]})[_0x1117('0x27')](function(_0x1111eb){if(_0x1111eb){_0x17f67e=_0x1111eb;_0x11e619=_0x575595[_0x1117('0x35')][_0x1117('0x34')]?_0x575595['body'][_0x1117('0x34')]:util[_0x1117('0x33')](_0x1117('0x50'),_0x17f67e[_0x1117('0x28')]);return db[_0x1117('0x19')][_0x1117('0x51')]({'where':{'role':_0x1117('0x52'),'online':!![],'id':{'$ne':_0x17f67e['id']}}});}})['then'](function(_0x2eac5c){if(_0x2eac5c){_0x2cf31b=_0x2eac5c;return require(_0x1117('0x53'))[_0x1117('0x54')]();}})[_0x1117('0x27')](function(_0x5e38a4){if(_0x5e38a4&&_0x5e38a4['agents']&&_0x2cf31b>=_0x5e38a4[_0x1117('0x55')]){throw new Error(_0x1117('0x56'));}})[_0x1117('0x27')](function(){if(_0x17f67e){return db[_0x1117('0x2b')]['destroy']({'where':{'membername':_0x17f67e['name']},'individualHooks':!![]});}})['then'](function(){if(_0x17f67e){return _0x17f67e[_0x1117('0x57')]({'raw':!![]});}})[_0x1117('0x27')](function(_0x4e6a49){if(_0x17f67e){if(_0x4e6a49){var _0x94d2ba=[];_0x565b23=_0x4e6a49;if(_0x565b23[_0x1117('0x2e')]){for(var _0x15ba7b=0x0;_0x15ba7b<_0x565b23[_0x1117('0x2e')];_0x15ba7b++){_0x94d2ba[_0x1117('0x32')](db[_0x1117('0x2b')][_0x1117('0x58')]({'membername':_0x17f67e[_0x1117('0x28')],'UserId':_0x17f67e['id'],'queue_name':_0x565b23[_0x15ba7b][_0x1117('0x28')],'VoiceQueueId':_0x565b23[_0x15ba7b]['id'],'interface':_0x11e619,'paused':_0x17f67e[_0x1117('0x4f')]||![],'penalty':_0x565b23[_0x15ba7b][_0x1117('0x59')]||0x0}));}return BPromise[_0x1117('0x48')](_0x94d2ba);}}}})[_0x1117('0x27')](function(){if(_0x17f67e){return db[_0x1117('0x3f')][_0x1117('0x1a')]({'where':{'membername':_0x17f67e['name'],'exitAt':null}});}})['then'](function(_0x2a8748){if(_0x17f67e){if(_0x2a8748&&_0x2a8748[_0x1117('0x2e')]){var _0x14c567=[];_0x2a8748[_0x1117('0x4c')](function(_0x518ea6){_0x14c567['push'](_0x518ea6[_0x1117('0x2c')]({'exitAt':moment()['format'](_0x1117('0x2f'))}));});return BPromise['all'](_0x14c567);}}})[_0x1117('0x27')](function(_0x279e21){if(_0x17f67e){var _0x4e9dd4=[];var _0x226b3f=[];var _0x5d0f0e=utils[_0x1117('0x31')]();var _0x59065f={'membername':_0x17f67e[_0x1117('0x28')],'interface':_0x11e619,'enterAt':moment()['format'](_0x1117('0x2f')),'role':_0x17f67e[_0x1117('0x29')],'internal':_0x17f67e[_0x1117('0x2a')]};_0x5d0f0e['forEach'](function(_0x32f9ec){_0x4e9dd4['push'](_['merge']({'channel':_0x32f9ec,'type':'LOGIN','data1':_0x1117('0x5a'),'data2':_0x11e619},_0x59065f));if(_0x17f67e[_0x1117('0x4f')]){_0x226b3f[_0x1117('0x32')](_[_0x1117('0x5b')]({'channel':_0x32f9ec,'type':_0x1117('0x2d'),'data1':_0x1117('0x5c')},_0x59065f));}});return db[_0x1117('0x3f')]['bulkCreate'](_0x4e9dd4[_0x1117('0x5d')](_0x226b3f),{'individualHooks':!![]});}})[_0x1117('0x27')](function(){if(_0x17f67e){return _0x17f67e[_0x1117('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x1117('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x17f67e['loginInPause']||![],'mailPause':_0x17f67e['loginInPause']||![],'chatPause':_0x17f67e[_0x1117('0x4f')]||![],'faxPause':_0x17f67e[_0x1117('0x4f')]||![],'smsPause':_0x17f67e[_0x1117('0x4f')]||![],'openchannelPause':_0x17f67e[_0x1117('0x4f')]||![],'pauseType':_0x17f67e[_0x1117('0x4f')]?_0x1117('0x5c'):null,'lastPauseAt':moment()[_0x1117('0x33')](_0x1117('0x2f')),'interface':_0x11e619});}})[_0x1117('0x27')](function(_0x137951){_0x344a6c(_0x137951);})[_0x1117('0x17')](function(_0xa87cdf){_0x154b5b(_0x40e879[_0x1117('0x13')](0x1f4,_0xa87cdf[_0x1117('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b3b1a27..877cf2f 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 _0xcdf6=['length','user:','./user.events','save','update','emit','removeListener','register'];(function(_0x14645c,_0x1b8f44){var _0x4b0207=function(_0x4392fd){while(--_0x4392fd){_0x14645c['push'](_0x14645c['shift']());}};_0x4b0207(++_0x1b8f44);}(_0xcdf6,0x1d2));var _0x6cdf=function(_0x325ba2,_0x2ddf7e){_0x325ba2=_0x325ba2-0x0;var _0x291739=_0xcdf6[_0x325ba2];return _0x291739;};'use strict';var UserEvents=require(_0x6cdf('0x0'));var events=[_0x6cdf('0x1'),'remove',_0x6cdf('0x2')];function createListener(_0x4fde14,_0x4dad4e){return function(_0x45a410){_0x4dad4e[_0x6cdf('0x3')](_0x4fde14,_0x45a410);};}function removeListener(_0x5bb18b,_0x30d4a8){return function(){UserEvents[_0x6cdf('0x4')](_0x5bb18b,_0x30d4a8);};}exports[_0x6cdf('0x5')]=function(_0x552431){for(var _0x549cbb=0x0,_0x222b43=events[_0x6cdf('0x6')];_0x549cbb<_0x222b43;_0x549cbb++){var _0x2911d4=events[_0x549cbb];var _0x1477d9=createListener(_0x6cdf('0x7')+_0x2911d4,_0x552431);UserEvents['on'](_0x2911d4,_0x1477d9);}}; \ No newline at end of file +var _0xaf5d=['update','emit','removeListener','length','user:','./user.events','save'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xaf5d,0x98));var _0xdaf5=function(_0x4cb9c5,_0x113bd5){_0x4cb9c5=_0x4cb9c5-0x0;var _0x22162f=_0xaf5d[_0x4cb9c5];return _0x22162f;};'use strict';var UserEvents=require(_0xdaf5('0x0'));var events=[_0xdaf5('0x1'),'remove',_0xdaf5('0x2')];function createListener(_0x5c3260,_0x417cc3){return function(_0x4cac1d){_0x417cc3[_0xdaf5('0x3')](_0x5c3260,_0x4cac1d);};}function removeListener(_0x496ce5,_0x6ae993){return function(){UserEvents[_0xdaf5('0x4')](_0x496ce5,_0x6ae993);};}exports['register']=function(_0x155f4c){for(var _0x5e0900=0x0,_0x1e837b=events[_0xdaf5('0x5')];_0x5e0900<_0x1e837b;_0x5e0900++){var _0x556764=events[_0x5e0900];var _0x5219d0=createListener(_0xdaf5('0x6')+_0x556764,_0x155f4c);UserEvents['on'](_0x556764,_0x5219d0);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 45a7173..92d6908 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13ec15,_0x2f5f99){var _0x2d1685=function(_0x42c3c2){while(--_0x42c3c2){_0x13ec15['push'](_0x13ec15['shift']());}};_0x2d1685(++_0x2f5f99);}(_0xe706,0xa3));var _0x6e70=function(_0x36daf3,_0x2ea0dd){_0x36daf3=_0x36daf3-0x0;var _0x3e4e26=_0xe706[_0x36daf3];return _0x3e4e26;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c58c3,_0x20319c){var _0x48062d=function(_0x54de00){while(--_0x54de00){_0x5c58c3['push'](_0x5c58c3['shift']());}};_0x48062d(++_0x20319c);}(_0x70e0,0x17b));var _0x070e=function(_0x2c338b,_0x26ff6d){_0x2c338b=_0x2c338b-0x0;var _0xa12f3c=_0x70e0[_0x2c338b];return _0xa12f3c;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 7ba2513..e6de531 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 _0x9d3f=['exports','INTEGER','sequelize'];(function(_0x3cbc00,_0x563224){var _0x45dfd1=function(_0x538f61){while(--_0x538f61){_0x3cbc00['push'](_0x3cbc00['shift']());}};_0x45dfd1(++_0x563224);}(_0x9d3f,0x1b8));var _0xf9d3=function(_0x4b8b95,_0x5162be){_0x4b8b95=_0x4b8b95-0x0;var _0x55e228=_0x9d3f[_0x4b8b95];return _0x55e228;};'use strict';var Sequelize=require(_0xf9d3('0x0'));module[_0xf9d3('0x1')]={'penalty':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x87a7=['INTEGER','sequelize'];(function(_0x572711,_0x3772ed){var _0x2a9446=function(_0x1be87a){while(--_0x1be87a){_0x572711['push'](_0x572711['shift']());}};_0x2a9446(++_0x3772ed);}(_0x87a7,0x1c3));var _0x787a=function(_0x5691f2,_0x7cad2){_0x5691f2=_0x5691f2-0x0;var _0x213e4f=_0x87a7[_0x5691f2];return _0x213e4f;};'use strict';var Sequelize=require(_0x787a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x787a('0x1')],'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 7f53eaf..53a9e21 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 _0xca12=['exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xca12,0x1d2));var _0x2ca1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xca12[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x2ca1('0x0'));var util=require('util');var logger=require(_0x2ca1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2ca1('0x2'));var rp=require(_0x2ca1('0x3'));var fs=require('fs');var path=require(_0x2ca1('0x4'));var rimraf=require('rimraf');var config=require(_0x2ca1('0x5'));var attributes=require(_0x2ca1('0x6'));module[_0x2ca1('0x7')]=function(_0x1afc1a,_0x4ebe1a){return _0x1afc1a[_0x2ca1('0x8')](_0x2ca1('0x9'),attributes,{'tableName':_0x2ca1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b4a=['rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x331fb9,_0x55983d){var _0x306b88=function(_0x2b6a15){while(--_0x2b6a15){_0x331fb9['push'](_0x331fb9['shift']());}};_0x306b88(++_0x55983d);}(_0x8b4a,0x185));var _0xa8b4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8b4a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xa8b4('0x0'));var util=require(_0xa8b4('0x1'));var logger=require(_0xa8b4('0x2'))(_0xa8b4('0x3'));var moment=require(_0xa8b4('0x4'));var BPromise=require('bluebird');var rp=require(_0xa8b4('0x5'));var fs=require('fs');var path=require(_0xa8b4('0x6'));var rimraf=require(_0xa8b4('0x7'));var config=require(_0xa8b4('0x8'));var attributes=require(_0xa8b4('0x9'));module[_0xa8b4('0xa')]=function(_0x31e841,_0x14942f){return _0x31e841['define']('UserChatQueue',attributes,{'tableName':_0xa8b4('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 bec5f99..d87cdae 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 _0xb518=['http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','UserChatQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5837c3,_0x43f169){var _0xc354ec=function(_0x4019a9){while(--_0x4019a9){_0x5837c3['push'](_0x5837c3['shift']());}};_0xc354ec(++_0x43f169);}(_0xb518,0x1c3));var _0x8b51=function(_0x31e2cd,_0x4c05ba){_0x31e2cd=_0x31e2cd-0x0;var _0x48af4e=_0xb518[_0x31e2cd];return _0x48af4e;};'use strict';var _=require(_0x8b51('0x0'));var util=require('util');var moment=require(_0x8b51('0x1'));var BPromise=require(_0x8b51('0x2'));var rs=require(_0x8b51('0x3'));var fs=require('fs');var Redis=require(_0x8b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b51('0x5'))('rpc');var config=require(_0x8b51('0x6'));var jayson=require(_0x8b51('0x7'));var client=jayson[_0x8b51('0x8')][_0x8b51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x538b8,_0x332b4c,_0x449f2f){return new BPromise(function(_0x396e19,_0x3a64bf){return client[_0x8b51('0xa')](_0x538b8,_0x449f2f)[_0x8b51('0xb')](function(_0x311cdb){logger[_0x8b51('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x332b4c,_0x8b51('0xd'));logger[_0x8b51('0xe')](_0x8b51('0xf'),_0x332b4c,'request\x20sent',JSON['stringify'](_0x311cdb));if(_0x311cdb[_0x8b51('0x10')]){if(_0x311cdb[_0x8b51('0x10')]['code']===0x1f4){logger[_0x8b51('0x10')](_0x8b51('0x11'),_0x332b4c,_0x311cdb['error'][_0x8b51('0x12')]);return _0x3a64bf(_0x311cdb['error'][_0x8b51('0x12')]);}logger[_0x8b51('0x10')](_0x8b51('0x11'),_0x332b4c,_0x311cdb['error'][_0x8b51('0x12')]);return _0x396e19(_0x311cdb[_0x8b51('0x10')][_0x8b51('0x12')]);}else{logger[_0x8b51('0xc')](_0x8b51('0x11'),_0x332b4c,_0x8b51('0xd'));_0x396e19(_0x311cdb[_0x8b51('0x13')]['message']);}})['catch'](function(_0x1dea06){logger[_0x8b51('0x10')](_0x8b51('0x11'),_0x332b4c,_0x1dea06);_0x3a64bf(_0x1dea06);});});} \ No newline at end of file +var _0x4a85=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x57f736,_0x58fb95){var _0x343479=function(_0x49d67e){while(--_0x49d67e){_0x57f736['push'](_0x57f736['shift']());}};_0x343479(++_0x58fb95);}(_0x4a85,0xcc));var _0x54a8=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4a85[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x54a8('0x0'));var util=require(_0x54a8('0x1'));var moment=require(_0x54a8('0x2'));var BPromise=require(_0x54a8('0x3'));var rs=require(_0x54a8('0x4'));var fs=require('fs');var Redis=require(_0x54a8('0x5'));var db=require(_0x54a8('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54a8('0x7'));var config=require(_0x54a8('0x8'));var jayson=require(_0x54a8('0x9'));var client=jayson[_0x54a8('0xa')][_0x54a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ef2a,_0x265470,_0x4eb326){return new BPromise(function(_0x3894e1,_0x3d8124){return client[_0x54a8('0xc')](_0x47ef2a,_0x4eb326)[_0x54a8('0xd')](function(_0x365ff3){logger[_0x54a8('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x265470,_0x54a8('0xf'));logger[_0x54a8('0x10')](_0x54a8('0x11'),_0x265470,'request\x20sent',JSON['stringify'](_0x365ff3));if(_0x365ff3[_0x54a8('0x12')]){if(_0x365ff3[_0x54a8('0x12')][_0x54a8('0x13')]===0x1f4){logger[_0x54a8('0x12')](_0x54a8('0x14'),_0x265470,_0x365ff3['error'][_0x54a8('0x15')]);return _0x3d8124(_0x365ff3[_0x54a8('0x12')][_0x54a8('0x15')]);}logger['error'](_0x54a8('0x14'),_0x265470,_0x365ff3[_0x54a8('0x12')][_0x54a8('0x15')]);return _0x3894e1(_0x365ff3['error'][_0x54a8('0x15')]);}else{logger[_0x54a8('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x265470,_0x54a8('0xf'));_0x3894e1(_0x365ff3['result'][_0x54a8('0x15')]);}})['catch'](function(_0x341e13){logger[_0x54a8('0x12')](_0x54a8('0x14'),_0x265470,_0x341e13);_0x3d8124(_0x341e13);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7200414..955b8f0 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x223c82,_0x10a540){var _0x3cbc3b=function(_0x39751d){while(--_0x39751d){_0x223c82['push'](_0x223c82['shift']());}};_0x3cbc3b(++_0x10a540);}(_0xe706,0xa3));var _0x6e70=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe706[_0x4801a0];return _0x338e26;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4b3977,_0x13ba23){var _0x998680=function(_0x433a8f){while(--_0x433a8f){_0x4b3977['push'](_0x4b3977['shift']());}};_0x998680(++_0x13ba23);}(_0x70e0,0x17b));var _0x070e=function(_0x9558c9,_0xa85a6d){_0x9558c9=_0x9558c9-0x0;var _0x4ccfd5=_0x70e0[_0x9558c9];return _0x4ccfd5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 634ac08..4a2f0f8 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 _0xdbb0=['exports','INTEGER','STRING','sequelize'];(function(_0x13bc6c,_0x36e236){var _0x5417b6=function(_0x250708){while(--_0x250708){_0x13bc6c['push'](_0x13bc6c['shift']());}};_0x5417b6(++_0x36e236);}(_0xdbb0,0x1db));var _0x0dbb=function(_0x1d161b,_0x47ea5c){_0x1d161b=_0x1d161b-0x0;var _0x1ad29c=_0xdbb0[_0x1d161b];return _0x1ad29c;};'use strict';var Sequelize=require(_0x0dbb('0x0'));module[_0x0dbb('0x1')]={'penalty':{'type':Sequelize[_0x0dbb('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0dbb('0x3')]}}; \ No newline at end of file +var _0x373d=['sequelize','exports','INTEGER'];(function(_0x3402da,_0x4c3654){var _0x1acf5f=function(_0x17148b){while(--_0x17148b){_0x3402da['push'](_0x3402da['shift']());}};_0x1acf5f(++_0x4c3654);}(_0x373d,0x14d));var _0xd373=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0x373d[_0x58e389];return _0x1437df;};'use strict';var Sequelize=require(_0xd373('0x0'));module[_0xd373('0x1')]={'penalty':{'type':Sequelize[_0xd373('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index eab8af6..75f0664 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 _0x5f75=['api','moment','bluebird','request-promise','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x4ec332,_0xb1d52){var _0x2be102=function(_0x3a0a51){while(--_0x3a0a51){_0x4ec332['push'](_0x4ec332['shift']());}};_0x2be102(++_0xb1d52);}(_0x5f75,0x111));var _0x55f7=function(_0x21d1eb,_0x56f664){_0x21d1eb=_0x21d1eb-0x0;var _0x4cb8cd=_0x5f75[_0x21d1eb];return _0x4cb8cd;};'use strict';var _=require(_0x55f7('0x0'));var util=require(_0x55f7('0x1'));var logger=require(_0x55f7('0x2'))(_0x55f7('0x3'));var moment=require(_0x55f7('0x4'));var BPromise=require(_0x55f7('0x5'));var rp=require(_0x55f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55f7('0x7'));var config=require('../../config/environment');var attributes=require(_0x55f7('0x8'));module[_0x55f7('0x9')]=function(_0x23f0ce,_0x4fb74e){return _0x23f0ce['define'](_0x55f7('0xa'),attributes,{'tableName':_0x55f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf923=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x424a73,_0x31d9e5){var _0x4be052=function(_0x4e396a){while(--_0x4e396a){_0x424a73['push'](_0x424a73['shift']());}};_0x4be052(++_0x31d9e5);}(_0xf923,0x181));var _0x3f92=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xf923[_0x2440fe];return _0x5cf734;};'use strict';var _=require(_0x3f92('0x0'));var util=require('util');var logger=require(_0x3f92('0x1'))('api');var moment=require(_0x3f92('0x2'));var BPromise=require(_0x3f92('0x3'));var rp=require(_0x3f92('0x4'));var fs=require('fs');var path=require(_0x3f92('0x5'));var rimraf=require(_0x3f92('0x6'));var config=require(_0x3f92('0x7'));var attributes=require(_0x3f92('0x8'));module['exports']=function(_0x56c474,_0x5a42e1){return _0x56c474['define'](_0x3f92('0x9'),attributes,{'tableName':_0x3f92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 15ca174..4029d95 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 _0xc9a9=['request\x20sent','stringify','error','message','UserFaxQueue,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x423f7d,_0x21b5c0){var _0x30a759=function(_0x406045){while(--_0x406045){_0x423f7d['push'](_0x423f7d['shift']());}};_0x30a759(++_0x21b5c0);}(_0xc9a9,0x1a7));var _0x9c9a=function(_0x349408,_0x1c7a13){_0x349408=_0x349408-0x0;var _0x486bf4=_0xc9a9[_0x349408];return _0x486bf4;};'use strict';var _=require('lodash');var util=require(_0x9c9a('0x0'));var moment=require(_0x9c9a('0x1'));var BPromise=require(_0x9c9a('0x2'));var rs=require(_0x9c9a('0x3'));var fs=require('fs');var Redis=require(_0x9c9a('0x4'));var db=require(_0x9c9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c9a('0x6'))(_0x9c9a('0x7'));var config=require(_0x9c9a('0x8'));var jayson=require(_0x9c9a('0x9'));var client=jayson[_0x9c9a('0xa')][_0x9c9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cf91a,_0x4205f2,_0x33ea42){return new BPromise(function(_0x535f96,_0x37b57d){return client[_0x9c9a('0xc')](_0x2cf91a,_0x33ea42)[_0x9c9a('0xd')](function(_0x44438e){logger[_0x9c9a('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4205f2,'request\x20sent');logger[_0x9c9a('0xf')](_0x9c9a('0x10'),_0x4205f2,_0x9c9a('0x11'),JSON[_0x9c9a('0x12')](_0x44438e));if(_0x44438e[_0x9c9a('0x13')]){if(_0x44438e['error']['code']===0x1f4){logger[_0x9c9a('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x4205f2,_0x44438e[_0x9c9a('0x13')][_0x9c9a('0x14')]);return _0x37b57d(_0x44438e['error']['message']);}logger['error'](_0x9c9a('0x15'),_0x4205f2,_0x44438e[_0x9c9a('0x13')][_0x9c9a('0x14')]);return _0x535f96(_0x44438e[_0x9c9a('0x13')]['message']);}else{logger['info'](_0x9c9a('0x15'),_0x4205f2,_0x9c9a('0x11'));_0x535f96(_0x44438e['result'][_0x9c9a('0x14')]);}})['catch'](function(_0x553b1d){logger[_0x9c9a('0x13')](_0x9c9a('0x15'),_0x4205f2,_0x553b1d);_0x37b57d(_0x553b1d);});});} \ No newline at end of file +var _0x228c=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x228c,0x154));var _0xc228=function(_0xff730f,_0x520461){_0xff730f=_0xff730f-0x0;var _0x50c2a1=_0x228c[_0xff730f];return _0x50c2a1;};'use strict';var _=require('lodash');var util=require(_0xc228('0x0'));var moment=require('moment');var BPromise=require(_0xc228('0x1'));var rs=require(_0xc228('0x2'));var fs=require('fs');var Redis=require(_0xc228('0x3'));var db=require(_0xc228('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc228('0x5'))(_0xc228('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc228('0x7')][_0xc228('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32f45b,_0x144419,_0xb8bc56){return new BPromise(function(_0x42ad55,_0x40f2ea){return client[_0xc228('0x9')](_0x32f45b,_0xb8bc56)['then'](function(_0x2febb9){logger[_0xc228('0xa')](_0xc228('0xb'),_0x144419,_0xc228('0xc'));logger['debug'](_0xc228('0xd'),_0x144419,_0xc228('0xc'),JSON[_0xc228('0xe')](_0x2febb9));if(_0x2febb9[_0xc228('0xf')]){if(_0x2febb9[_0xc228('0xf')][_0xc228('0x10')]===0x1f4){logger[_0xc228('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x144419,_0x2febb9[_0xc228('0xf')]['message']);return _0x40f2ea(_0x2febb9[_0xc228('0xf')]['message']);}logger['error'](_0xc228('0xb'),_0x144419,_0x2febb9[_0xc228('0xf')][_0xc228('0x11')]);return _0x42ad55(_0x2febb9['error'][_0xc228('0x11')]);}else{logger[_0xc228('0xa')](_0xc228('0xb'),_0x144419,'request\x20sent');_0x42ad55(_0x2febb9['result']['message']);}})[_0xc228('0x12')](function(_0x3aed70){logger[_0xc228('0xf')](_0xc228('0xb'),_0x144419,_0x3aed70);_0x40f2ea(_0x3aed70);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 08db859..55f2e3e 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(_0x2ca44d,_0x171921){var _0x339f56=function(_0x5c2db4){while(--_0x5c2db4){_0x2ca44d['push'](_0x2ca44d['shift']());}};_0x339f56(++_0x171921);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x40d770,_0x12c132){var _0x504d6e=function(_0x4f5973){while(--_0x4f5973){_0x40d770['push'](_0x40d770['shift']());}};_0x504d6e(++_0x12c132);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 912457b..2a4e679 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 _0x66e2=['exports','sequelize'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x66e2,0x105));var _0x266e=function(_0x251f85,_0x2be404){_0x251f85=_0x251f85-0x0;var _0x307b74=_0x66e2[_0x251f85];return _0x307b74;};'use strict';var Sequelize=require(_0x266e('0x0'));module[_0x266e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x698e=['INTEGER','sequelize','exports'];(function(_0x459a08,_0x1acc9c){var _0x232e37=function(_0xb5520){while(--_0xb5520){_0x459a08['push'](_0x459a08['shift']());}};_0x232e37(++_0x1acc9c);}(_0x698e,0x130));var _0xe698=function(_0x507f5b,_0x38931f){_0x507f5b=_0x507f5b-0x0;var _0x351da0=_0x698e[_0x507f5b];return _0x351da0;};'use strict';var Sequelize=require(_0xe698('0x0'));module[_0xe698('0x1')]={'penalty':{'type':Sequelize[_0xe698('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 458a01d..ba92ec5 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 _0xe69e=['path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x593a37,_0x20ac5b){var _0x4bde96=function(_0x236f2d){while(--_0x236f2d){_0x593a37['push'](_0x593a37['shift']());}};_0x4bde96(++_0x20ac5b);}(_0xe69e,0x71));var _0xee69=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0xe69e[_0x1d3577];return _0x277d9a;};'use strict';var _=require(_0xee69('0x0'));var util=require(_0xee69('0x1'));var logger=require(_0xee69('0x2'))(_0xee69('0x3'));var moment=require(_0xee69('0x4'));var BPromise=require(_0xee69('0x5'));var rp=require(_0xee69('0x6'));var fs=require('fs');var path=require(_0xee69('0x7'));var rimraf=require(_0xee69('0x8'));var config=require(_0xee69('0x9'));var attributes=require(_0xee69('0xa'));module[_0xee69('0xb')]=function(_0x40a6c7,_0x8a9ae0){return _0x40a6c7[_0xee69('0xc')](_0xee69('0xd'),attributes,{'tableName':_0xee69('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d76=['path','rimraf','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x5d76,0x96));var _0x65d7=function(_0x108851,_0x2523a6){_0x108851=_0x108851-0x0;var _0x470a29=_0x5d76[_0x108851];return _0x470a29;};'use strict';var _=require(_0x65d7('0x0'));var util=require(_0x65d7('0x1'));var logger=require('../../config/logger')(_0x65d7('0x2'));var moment=require(_0x65d7('0x3'));var BPromise=require(_0x65d7('0x4'));var rp=require(_0x65d7('0x5'));var fs=require('fs');var path=require(_0x65d7('0x6'));var rimraf=require(_0x65d7('0x7'));var config=require('../../config/environment');var attributes=require(_0x65d7('0x8'));module['exports']=function(_0x3b21ee,_0x3ad0d2){return _0x3b21ee[_0x65d7('0x9')](_0x65d7('0xa'),attributes,{'tableName':_0x65d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 5153a61..946ca45 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2a7c7e,_0x509ba5){_0x2a7c7e=_0x2a7c7e-0x0;var _0x66c932=_0x1cb9[_0x2a7c7e];return _0x66c932;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x205624,_0x5a276c){var _0x129c79=function(_0x38800f){while(--_0x38800f){_0x205624['push'](_0x205624['shift']());}};_0x129c79(++_0x5a276c);}(_0x8ef6,0xf2));var _0x68ef=function(_0xdefc89,_0x50fc57){_0xdefc89=_0xdefc89-0x0;var _0x76be7b=_0x8ef6[_0xdefc89];return _0x76be7b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 551da1c..92e3d82 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 _0xc18a=['Router','fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout'];(function(_0x222a23,_0x2c0c18){var _0xa2f1a2=function(_0x37e859){while(--_0x37e859){_0x222a23['push'](_0x222a23['shift']());}};_0xa2f1a2(++_0x2c0c18);}(_0xc18a,0xc8));var _0xac18=function(_0x138b50,_0x3d4057){_0x138b50=_0x138b50-0x0;var _0x3e33d5=_0xc18a[_0x138b50];return _0x3e33d5;};'use strict';var multer=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var path=require(_0xac18('0x2'));var timeout=require(_0xac18('0x3'));var express=require('express');var router=express[_0xac18('0x4')]();var fs_extra=require(_0xac18('0x5'));var auth=require(_0xac18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xac18('0x7'));var controller=require('./userNotification.controller');router[_0xac18('0x8')]('/',auth[_0xac18('0x9')](),controller[_0xac18('0xa')]);module[_0xac18('0xb')]=router; \ No newline at end of file +var _0x08fd=['exports','multer','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','sendUserNotification'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x08fd,0xbe));var _0xd08f=function(_0xbdf0c4,_0x5f38ea){_0xbdf0c4=_0xbdf0c4-0x0;var _0x4c3def=_0x08fd[_0xbdf0c4];return _0x4c3def;};'use strict';var multer=require(_0xd08f('0x0'));var util=require('util');var path=require(_0xd08f('0x1'));var timeout=require(_0xd08f('0x2'));var express=require(_0xd08f('0x3'));var router=express[_0xd08f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd08f('0x5'));var controller=require('./userNotification.controller');router['post']('/',auth[_0xd08f('0x6')](),controller[_0xd08f('0x7')]);module[_0xd08f('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index fba0646..1211dd6 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 _0xcdc9=['TEXT','exports'];(function(_0x52b2a6,_0x1f39fd){var _0x30c16f=function(_0x1b5fca){while(--_0x1b5fca){_0x52b2a6['push'](_0x52b2a6['shift']());}};_0x30c16f(++_0x1f39fd);}(_0xcdc9,0x13f));var _0x9cdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdc9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9cdc('0x0')]={'body':{'type':Sequelize[_0x9cdc('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x9cdc('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x5446=['TEXT','BOOLEAN','sequelize','STRING'];(function(_0x4d449b,_0x5c9514){var _0x445b5a=function(_0x4abd4a){while(--_0x4abd4a){_0x4d449b['push'](_0x4d449b['shift']());}};_0x445b5a(++_0x5c9514);}(_0x5446,0x172));var _0x6544=function(_0x5a09f0,_0x12efba){_0x5a09f0=_0x5a09f0-0x0;var _0x360966=_0x5446[_0x5a09f0];return _0x360966;};'use strict';var Sequelize=require(_0x6544('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x6544('0x1')]},'recipientsId':{'type':Sequelize[_0x6544('0x2')]},'recipientsDescription':{'type':Sequelize[_0x6544('0x1')]},'beep':{'type':Sequelize[_0x6544('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 44f0993..da83a87 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 _0xe634=['undefined','count','set','json','apply','save','update','destroy','then','stack','name','hasOwnProperty','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','end','status','offset','limit'];(function(_0x293e7a,_0x1792a2){var _0xb78342=function(_0x833afe){while(--_0x833afe){_0x293e7a['push'](_0x293e7a['shift']());}};_0xb78342(++_0x1792a2);}(_0xe634,0xad));var _0x4e63=function(_0x3a09c8,_0x11e5a4){_0x3a09c8=_0x3a09c8-0x0;var _0x528837=_0xe634[_0x3a09c8];return _0x528837;};'use strict';var emlformat=require(_0x4e63('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e63('0x1'));var jsonpatch=require(_0x4e63('0x2'));var rp=require(_0x4e63('0x3'));var moment=require(_0x4e63('0x4'));var BPromise=require(_0x4e63('0x5'));var Mustache=require(_0x4e63('0x6'));var util=require('util');var path=require(_0x4e63('0x7'));var sox=require('sox');var csv=require(_0x4e63('0x8'));var ejs=require(_0x4e63('0x9'));var fs=require('fs');var fs_extra=require(_0x4e63('0xa'));var _=require('lodash');var squel=require(_0x4e63('0xb'));var crypto=require(_0x4e63('0xc'));var jsforce=require(_0x4e63('0xd'));var deskjs=require(_0x4e63('0xe'));var toCsv=require(_0x4e63('0x8'));var querystring=require(_0x4e63('0xf'));var Papa=require(_0x4e63('0x10'));var Redis=require(_0x4e63('0x11'));var authService=require(_0x4e63('0x12'));var qs=require(_0x4e63('0x13'));var as=require(_0x4e63('0x14'));var hardwareService=require(_0x4e63('0x15'));var logger=require(_0x4e63('0x16'))(_0x4e63('0x17'));var utils=require(_0x4e63('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4e63('0x19'));var db=require(_0x4e63('0x1a'))['db'];config[_0x4e63('0x1b')]=_[_0x4e63('0x1c')](config[_0x4e63('0x1b')],{'host':_0x4e63('0x1d'),'port':0x18eb});var socket=require(_0x4e63('0x1e'))(new Redis(config['redis']));require(_0x4e63('0x1f'))['register'](socket);function respondWithStatusCode(_0x5e8ccc,_0x4a782d){_0x4a782d=_0x4a782d||0xcc;return function(_0x138628){if(_0x138628){return _0x5e8ccc[_0x4e63('0x20')](_0x4a782d);}return _0x5e8ccc['status'](_0x4a782d)[_0x4e63('0x21')]();};}function respondWithResult(_0x1ff9e9,_0xf1b221){_0xf1b221=_0xf1b221||0xc8;return function(_0x2c6a44){if(_0x2c6a44){return _0x1ff9e9[_0x4e63('0x22')](_0xf1b221)['json'](_0x2c6a44);}};}function respondWithFilteredResult(_0x4d6bc7,_0x596ddc){return function(_0x11ebff){if(_0x11ebff){var _0x9d8e4e=typeof _0x596ddc[_0x4e63('0x23')]==='undefined'&&typeof _0x596ddc[_0x4e63('0x24')]===_0x4e63('0x25');var _0x99318d=_0x11ebff[_0x4e63('0x26')];var _0x5dd155=_0x9d8e4e?0x0:_0x596ddc['offset'];var _0x230d0f=_0x9d8e4e?_0x11ebff[_0x4e63('0x26')]:_0x596ddc[_0x4e63('0x23')]+_0x596ddc[_0x4e63('0x24')];var _0x5ab675;if(_0x230d0f>=_0x99318d){_0x230d0f=_0x99318d;_0x5ab675=0xc8;}else{_0x5ab675=0xce;}_0x4d6bc7[_0x4e63('0x22')](_0x5ab675);return _0x4d6bc7[_0x4e63('0x27')]('Content-Range',_0x5dd155+'-'+_0x230d0f+'/'+_0x99318d)[_0x4e63('0x28')](_0x11ebff);}return null;};}function patchUpdates(_0x4fb35e){return function(_0x324c5f){try{jsonpatch[_0x4e63('0x29')](_0x324c5f,_0x4fb35e,!![]);}catch(_0x2aa092){return BPromise['reject'](_0x2aa092);}return _0x324c5f[_0x4e63('0x2a')]();};}function saveUpdates(_0x4b27fa,_0x23b226){return function(_0x194ff1){if(_0x194ff1){return _0x194ff1[_0x4e63('0x2b')](_0x4b27fa)['then'](function(_0x535ef5){return _0x535ef5;});}return null;};}function removeEntity(_0x3baf5a,_0x1aee79){return function(_0x474bc1){if(_0x474bc1){return _0x474bc1[_0x4e63('0x2c')]()[_0x4e63('0x2d')](function(){_0x3baf5a['status'](0xcc)[_0x4e63('0x21')]();});}};}function handleEntityNotFound(_0xfdafae,_0x3a5dd6){return function(_0x4d439d){if(!_0x4d439d){_0xfdafae[_0x4e63('0x20')](0x194);}return _0x4d439d;};}function handleError(_0x3c139f,_0x40bf4b){_0x40bf4b=_0x40bf4b||0x1f4;return function(_0x23f115){logger['error'](_0x23f115[_0x4e63('0x2e')]);if(_0x23f115[_0x4e63('0x2f')]){delete _0x23f115[_0x4e63('0x2f')];}_0x3c139f[_0x4e63('0x22')](_0x40bf4b)['send'](_0x23f115);};}exports['sendUserNotification']=function(_0x4cb167,_0x5ad117,_0x1affe4){if(!_0x4cb167['body'][_0x4e63('0x30')]('text')&&!_0x4cb167[_0x4e63('0x31')]['hasOwnProperty'](_0x4e63('0x32'))){throw new db[(_0x4e63('0x33'))]['ValidationError'](_0x4e63('0x34'));}else{if(_0x4cb167[_0x4e63('0x31')][_0x4e63('0x30')](_0x4e63('0x32'))&&!_0x4cb167[_0x4e63('0x31')][_0x4e63('0x30')]('view')){throw new db[(_0x4e63('0x33'))][(_0x4e63('0x35'))](_0x4e63('0x36'));}if(!_0x4cb167[_0x4e63('0x31')][_0x4e63('0x30')](_0x4e63('0x37'))){throw new db[(_0x4e63('0x33'))][(_0x4e63('0x35'))](_0x4e63('0x38'));}else{try{var _0x5212b2=JSON[_0x4e63('0x39')](_0x4cb167[_0x4e63('0x31')][_0x4e63('0x37')]);}catch(_0x4dae55){logger[_0x4e63('0x3a')](_0x4dae55);throw new db[(_0x4e63('0x33'))][(_0x4e63('0x35'))](_0x4e63('0x3b'));}var _0x5c6bb5=[_0x4e63('0x3c'),'faxqueue',_0x4e63('0x3d'),_0x4e63('0x3e'),_0x4e63('0x3f'),_0x4e63('0x40'),'whatsappqueue',_0x4e63('0x41'),_0x4e63('0x42')];if(_[_0x4e63('0x43')](_0x5212b2,function(_0x3e3dff){return!_[_0x4e63('0x44')](_0x5c6bb5,_0x3e3dff[_0x4e63('0x45')][_0x4e63('0x46')]());})){throw new db[(_0x4e63('0x33'))]['ValidationError'](_0x4e63('0x47'));}}}var _0x794c15={};_0x794c15['senderName']=_0x4cb167[_0x4e63('0x31')]['hasOwnProperty'](_0x4e63('0x48'))?_0x4cb167[_0x4e63('0x31')][_0x4e63('0x48')]:_0x4cb167[_0x4e63('0x42')][_0x4e63('0x49')];_0x794c15['recipientsDescription']=_[_0x4e63('0x4a')](_0x4cb167[_0x4e63('0x31')][_0x4e63('0x4b')])?null:_0x4cb167['body'][_0x4e63('0x4b')];_0x794c15[_0x4e63('0x4c')]=_0x4cb167[_0x4e63('0x31')][_0x4e63('0x4c')]||![];_0x794c15[_0x4e63('0x4d')]=_0x4cb167['user']['id'];return getContent(_0x4cb167[_0x4e63('0x31')])[_0x4e63('0x2d')](function(_0x303e1b){_0x794c15[_0x4e63('0x31')]=_0x303e1b;return getRecipients(_0x5212b2);})[_0x4e63('0x2d')](function(_0x172ac1){_0x794c15[_0x4e63('0x4e')]=_[_0x4e63('0x4f')](_0x172ac1)['join'](',');return db[_0x4e63('0x50')][_0x4e63('0x51')](function(_0x27400d){return db[_0x4e63('0x52')][_0x4e63('0x53')](_0x794c15,{'raw':!![],'transaction':_0x27400d})[_0x4e63('0x2d')](function(_0x1e9b4b){var _0x34e620={'sender':_0x794c15[_0x4e63('0x48')],'description':_0x794c15[_0x4e63('0x4b')],'content':_0x794c15[_0x4e63('0x31')],'beep':_0x794c15[_0x4e63('0x4c')]};_0x172ac1[_0x4e63('0x54')](function(_0x504975){_0x34e620[_0x4e63('0x55')]=_0x504975;socket[_0x4e63('0x56')](_0x4e63('0x57'),_0x34e620);});return _0x1e9b4b;});});})[_0x4e63('0x2d')](respondWithResult(_0x5ad117,0xc9))[_0x4e63('0x58')](handleError(_0x5ad117,null));};function getContent(_0x40ce54){return new BPromise(function(_0x5c5975,_0x5c1cf0){if(_0x40ce54[_0x4e63('0x59')]){_0x5c5975(_0x40ce54[_0x4e63('0x59')]);return;}return db['Template'][_0x4e63('0x5a')]({'attributes':[_0x4e63('0x5b')],'where':{'id':_0x40ce54['TemplateId']},'raw':!![]})['then'](function(_0x57b0dd){if(!_0x57b0dd)throw new db[(_0x4e63('0x33'))]['ValidationError'](_0x4e63('0x5c'));var _0x1a2ebf=Mustache['render'](_0x57b0dd['html'],_0x40ce54[_0x4e63('0x5d')]);_0x5c5975(_0x1a2ebf);})['catch'](function(_0x58cd82){_0x5c1cf0(_0x58cd82);});});}function getRecipients(_0x108ed9){return new BPromise(function(_0x2e6b71,_0x29377b){var _0x286f76=[];var _0x251dfa=[];_0x108ed9[_0x4e63('0x54')](function(_0x463e46){var _0x5661cf=_[_0x4e63('0x5e')](_0x463e46[_0x4e63('0x45')][_0x4e63('0x46')]());if(_0x5661cf===_0x4e63('0x5f')){_0x286f76=_[_0x4e63('0x60')](_0x286f76,_0x463e46[_0x4e63('0x61')]);}else{if(_[_0x4e63('0x44')](_0x5661cf,_0x4e63('0x62')))_0x5661cf=_0x5661cf['replace'](_0x4e63('0x62'),_0x4e63('0x63'));_0x463e46[_0x4e63('0x61')]['forEach'](function(_0x45404f){_0x251dfa[_0x4e63('0x64')](getAgents(_0x5661cf,_0x45404f));});}});return BPromise[_0x4e63('0x65')](_0x251dfa)[_0x4e63('0x2d')](function(_0x48b468){_0x286f76=_[_0x4e63('0x60')](_0x286f76,_[_0x4e63('0x66')](_0x48b468));_0x2e6b71(_0x286f76);})[_0x4e63('0x58')](function(_0x10cf2f){_0x29377b(_0x10cf2f);});});}function getAgents(_0x25dded,_0xfd8f13){return new BPromise(function(_0x47425c,_0x26bf25){return db[_0x25dded][_0x4e63('0x5a')]({'where':{'id':_0xfd8f13}})[_0x4e63('0x2d')](function(_0x4f0419){return _0x4f0419[_0x4e63('0x67')]({'attributes':['id'],'raw':!![]})[_0x4e63('0x2d')](function(_0x43ee4f){var _0xa06ff4=_[_0x4e63('0x68')](_0x43ee4f,'id');_0x47425c(_0xa06ff4);});})[_0x4e63('0x58')](function(_0x22e10c){_0x26bf25(_0x22e10c);});});} \ No newline at end of file +var _0x2165=['apply','reject','update','then','destroy','stack','name','send','sendUserNotification','hasOwnProperty','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','union','ids','queue','replace','Queue','push','flatten','findOne','getAgents','map','eml-format','zip-dir','request-promise','moment','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x326a2a,_0x4303a4){var _0x1e8f5f=function(_0x3ccc5a){while(--_0x3ccc5a){_0x326a2a['push'](_0x326a2a['shift']());}};_0x1e8f5f(++_0x4303a4);}(_0x2165,0x1d0));var _0x5216=function(_0x2dca8c,_0x5583f5){_0x2dca8c=_0x2dca8c-0x0;var _0x1db10c=_0x2165[_0x2dca8c];return _0x1db10c;};'use strict';var emlformat=require(_0x5216('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5216('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5216('0x2'));var moment=require(_0x5216('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5216('0x4'));var path=require('path');var sox=require(_0x5216('0x5'));var csv=require('to-csv');var ejs=require(_0x5216('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5216('0x7'));var squel=require('squel');var crypto=require(_0x5216('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5216('0x9'));var toCsv=require(_0x5216('0xa'));var querystring=require(_0x5216('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5216('0xc'));var as=require(_0x5216('0xd'));var hardwareService=require(_0x5216('0xe'));var logger=require('../../config/logger')(_0x5216('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5216('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5216('0x11')](config[_0x5216('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x5216('0x13'))(new Redis(config[_0x5216('0x12')]));require(_0x5216('0x14'))[_0x5216('0x15')](socket);function respondWithStatusCode(_0x1c8222,_0x284ca1){_0x284ca1=_0x284ca1||0xcc;return function(_0x3db4e5){if(_0x3db4e5){return _0x1c8222[_0x5216('0x16')](_0x284ca1);}return _0x1c8222[_0x5216('0x17')](_0x284ca1)[_0x5216('0x18')]();};}function respondWithResult(_0x4a7382,_0x12fbff){_0x12fbff=_0x12fbff||0xc8;return function(_0x57b2ed){if(_0x57b2ed){return _0x4a7382[_0x5216('0x17')](_0x12fbff)[_0x5216('0x19')](_0x57b2ed);}};}function respondWithFilteredResult(_0x53c837,_0x1f4cac){return function(_0x2b1ee5){if(_0x2b1ee5){var _0xac0a9f=typeof _0x1f4cac[_0x5216('0x1a')]===_0x5216('0x1b')&&typeof _0x1f4cac[_0x5216('0x1c')]===_0x5216('0x1b');var _0x40679e=_0x2b1ee5[_0x5216('0x1d')];var _0x56e98e=_0xac0a9f?0x0:_0x1f4cac['offset'];var _0x5640fa=_0xac0a9f?_0x2b1ee5[_0x5216('0x1d')]:_0x1f4cac[_0x5216('0x1a')]+_0x1f4cac[_0x5216('0x1c')];var _0x1b4ba8;if(_0x5640fa>=_0x40679e){_0x5640fa=_0x40679e;_0x1b4ba8=0xc8;}else{_0x1b4ba8=0xce;}_0x53c837[_0x5216('0x17')](_0x1b4ba8);return _0x53c837['set'](_0x5216('0x1e'),_0x56e98e+'-'+_0x5640fa+'/'+_0x40679e)[_0x5216('0x19')](_0x2b1ee5);}return null;};}function patchUpdates(_0x3dd7b1){return function(_0x40603b){try{jsonpatch[_0x5216('0x1f')](_0x40603b,_0x3dd7b1,!![]);}catch(_0x1f01bb){return BPromise[_0x5216('0x20')](_0x1f01bb);}return _0x40603b['save']();};}function saveUpdates(_0x570e1c,_0x35ea48){return function(_0x195c30){if(_0x195c30){return _0x195c30[_0x5216('0x21')](_0x570e1c)[_0x5216('0x22')](function(_0x561981){return _0x561981;});}return null;};}function removeEntity(_0x1b50a1,_0x7d9953){return function(_0x3abcfa){if(_0x3abcfa){return _0x3abcfa[_0x5216('0x23')]()[_0x5216('0x22')](function(){_0x1b50a1[_0x5216('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aaf2d,_0x51f639){return function(_0xf75be5){if(!_0xf75be5){_0x3aaf2d['sendStatus'](0x194);}return _0xf75be5;};}function handleError(_0x138c3d,_0x237163){_0x237163=_0x237163||0x1f4;return function(_0x41c778){logger['error'](_0x41c778[_0x5216('0x24')]);if(_0x41c778[_0x5216('0x25')]){delete _0x41c778['name'];}_0x138c3d[_0x5216('0x17')](_0x237163)[_0x5216('0x26')](_0x41c778);};}exports[_0x5216('0x27')]=function(_0x3e61d7,_0x6e99c3,_0x139825){if(!_0x3e61d7['body'][_0x5216('0x28')]('text')&&!_0x3e61d7[_0x5216('0x29')][_0x5216('0x28')](_0x5216('0x2a'))){throw new db[(_0x5216('0x2b'))]['ValidationError'](_0x5216('0x2c'));}else{if(_0x3e61d7[_0x5216('0x29')]['hasOwnProperty'](_0x5216('0x2a'))&&!_0x3e61d7[_0x5216('0x29')][_0x5216('0x28')]('view')){throw new db[(_0x5216('0x2b'))][(_0x5216('0x2d'))](_0x5216('0x2e'));}if(!_0x3e61d7[_0x5216('0x29')][_0x5216('0x28')]('recipients')){throw new db[(_0x5216('0x2b'))][(_0x5216('0x2d'))](_0x5216('0x2f'));}else{try{var _0x54f14e=JSON['parse'](_0x3e61d7[_0x5216('0x29')][_0x5216('0x30')]);}catch(_0x3e32b8){logger[_0x5216('0x31')](_0x3e32b8);throw new db[(_0x5216('0x2b'))][(_0x5216('0x2d'))](_0x5216('0x32'));}var _0x58c9c2=[_0x5216('0x33'),_0x5216('0x34'),_0x5216('0x35'),_0x5216('0x36'),_0x5216('0x37'),_0x5216('0x38'),_0x5216('0x39'),_0x5216('0x3a'),'user'];if(_[_0x5216('0x3b')](_0x54f14e,function(_0x3ddd18){return!_[_0x5216('0x3c')](_0x58c9c2,_0x3ddd18[_0x5216('0x3d')][_0x5216('0x3e')]());})){throw new db[(_0x5216('0x2b'))][(_0x5216('0x2d'))](_0x5216('0x3f'));}}}var _0x5141b3={};_0x5141b3['senderName']=_0x3e61d7[_0x5216('0x29')]['hasOwnProperty'](_0x5216('0x40'))?_0x3e61d7[_0x5216('0x29')][_0x5216('0x40')]:_0x3e61d7[_0x5216('0x41')]['fullname'];_0x5141b3[_0x5216('0x42')]=_[_0x5216('0x43')](_0x3e61d7[_0x5216('0x29')][_0x5216('0x42')])?null:_0x3e61d7['body']['recipientsDescription'];_0x5141b3[_0x5216('0x44')]=_0x3e61d7[_0x5216('0x29')][_0x5216('0x44')]||![];_0x5141b3[_0x5216('0x45')]=_0x3e61d7[_0x5216('0x41')]['id'];return getContent(_0x3e61d7[_0x5216('0x29')])['then'](function(_0x134617){_0x5141b3[_0x5216('0x29')]=_0x134617;return getRecipients(_0x54f14e);})[_0x5216('0x22')](function(_0x408eb9){_0x5141b3[_0x5216('0x46')]=_[_0x5216('0x47')](_0x408eb9)[_0x5216('0x48')](',');return db[_0x5216('0x49')][_0x5216('0x4a')](function(_0x4f0db3){return db[_0x5216('0x4b')][_0x5216('0x4c')](_0x5141b3,{'raw':!![],'transaction':_0x4f0db3})[_0x5216('0x22')](function(_0x511495){var _0xd6c730={'sender':_0x5141b3[_0x5216('0x40')],'description':_0x5141b3[_0x5216('0x42')],'content':_0x5141b3['body'],'beep':_0x5141b3[_0x5216('0x44')]};_0x408eb9[_0x5216('0x4d')](function(_0x3ae2fe){_0xd6c730[_0x5216('0x4e')]=_0x3ae2fe;socket[_0x5216('0x4f')](_0x5216('0x50'),_0xd6c730);});return _0x511495;});});})['then'](respondWithResult(_0x6e99c3,0xc9))[_0x5216('0x51')](handleError(_0x6e99c3,null));};function getContent(_0x334eea){return new BPromise(function(_0x51db58,_0x360e7c){if(_0x334eea[_0x5216('0x52')]){_0x51db58(_0x334eea[_0x5216('0x52')]);return;}return db[_0x5216('0x53')]['findOne']({'attributes':[_0x5216('0x54')],'where':{'id':_0x334eea[_0x5216('0x2a')]},'raw':!![]})[_0x5216('0x22')](function(_0x3eec3a){if(!_0x3eec3a)throw new db[(_0x5216('0x2b'))][(_0x5216('0x2d'))](_0x5216('0x55'));var _0x21ff03=Mustache[_0x5216('0x56')](_0x3eec3a[_0x5216('0x54')],_0x334eea[_0x5216('0x57')]);_0x51db58(_0x21ff03);})[_0x5216('0x51')](function(_0x1065a1){_0x360e7c(_0x1065a1);});});}function getRecipients(_0x16f14e){return new BPromise(function(_0x323e9f,_0x3d46de){var _0x42d708=[];var _0x3fc0eb=[];_0x16f14e['forEach'](function(_0xa91aca){var _0x337cdf=_[_0x5216('0x58')](_0xa91aca['model'][_0x5216('0x3e')]());if(_0x337cdf==='User'){_0x42d708=_[_0x5216('0x59')](_0x42d708,_0xa91aca[_0x5216('0x5a')]);}else{if(_[_0x5216('0x3c')](_0x337cdf,_0x5216('0x5b')))_0x337cdf=_0x337cdf[_0x5216('0x5c')](_0x5216('0x5b'),_0x5216('0x5d'));_0xa91aca[_0x5216('0x5a')][_0x5216('0x4d')](function(_0x221064){_0x3fc0eb[_0x5216('0x5e')](getAgents(_0x337cdf,_0x221064));});}});return BPromise['all'](_0x3fc0eb)[_0x5216('0x22')](function(_0x1902c3){_0x42d708=_[_0x5216('0x59')](_0x42d708,_[_0x5216('0x5f')](_0x1902c3));_0x323e9f(_0x42d708);})[_0x5216('0x51')](function(_0x5d8f5a){_0x3d46de(_0x5d8f5a);});});}function getAgents(_0x34097c,_0x5015cd){return new BPromise(function(_0x4bead5,_0x319b5d){return db[_0x34097c][_0x5216('0x60')]({'where':{'id':_0x5015cd}})[_0x5216('0x22')](function(_0x41cd89){return _0x41cd89[_0x5216('0x61')]({'attributes':['id'],'raw':!![]})[_0x5216('0x22')](function(_0x132900){var _0x2f3ea0=_[_0x5216('0x62')](_0x132900,'id');_0x4bead5(_0x2f3ea0);});})[_0x5216('0x51')](function(_0x478cd0){_0x319b5d(_0x478cd0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3c29b23..d90d745 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 _0xa2ca=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','emit'];(function(_0xe0dee2,_0x35d2a8){var _0x568ed0=function(_0x3b1644){while(--_0x3b1644){_0xe0dee2['push'](_0xe0dee2['shift']());}};_0x568ed0(++_0x35d2a8);}(_0xa2ca,0x1e8));var _0xaa2c=function(_0x53fb12,_0x327dd0){_0x53fb12=_0x53fb12-0x0;var _0x1ee597=_0xa2ca[_0x53fb12];return _0x1ee597;};'use strict';var EventEmitter=require(_0xaa2c('0x0'));var UserNotification=require(_0xaa2c('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xaa2c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x567bdd){return function(_0x16d99d,_0x2c599b,_0x2ef6f2){UserNotificationEvents[_0xaa2c('0x3')](_0x567bdd+':'+_0x16d99d['id'],_0x16d99d);UserNotificationEvents[_0xaa2c('0x3')](_0x567bdd,_0x16d99d);_0x2ef6f2(null);};}for(var e in events){if(events[_0xaa2c('0x4')](e)){var event=events[e];UserNotification[_0xaa2c('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x07d4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x14d4d0,_0x3d2ce7){var _0x23d65e=function(_0x1f8b3a){while(--_0x1f8b3a){_0x14d4d0['push'](_0x14d4d0['shift']());}};_0x23d65e(++_0x3d2ce7);}(_0x07d4,0x17c));var _0x407d=function(_0x1a0d5f,_0x2dde4b){_0x1a0d5f=_0x1a0d5f-0x0;var _0x59d671=_0x07d4[_0x1a0d5f];return _0x59d671;};'use strict';var EventEmitter=require(_0x407d('0x0'));var UserNotification=require(_0x407d('0x1'))['db'][_0x407d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x407d('0x3')](0x0);var events={'afterCreate':_0x407d('0x4'),'afterUpdate':_0x407d('0x5'),'afterDestroy':_0x407d('0x6')};function emitEvent(_0x54eecb){return function(_0x51c437,_0x3f0942,_0x4fe2eb){UserNotificationEvents['emit'](_0x54eecb+':'+_0x51c437['id'],_0x51c437);UserNotificationEvents[_0x407d('0x7')](_0x54eecb,_0x51c437);_0x4fe2eb(null);};}for(var e in events){if(events[_0x407d('0x8')](e)){var event=events[e];UserNotification[_0x407d('0x9')](e,emitEvent(event));}}module[_0x407d('0xa')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 2bf8ff2..a30ebeb 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 _0x8ae0=['api','moment','bluebird','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1104e8,_0x528452){var _0x35a064=function(_0x492f2b){while(--_0x492f2b){_0x1104e8['push'](_0x1104e8['shift']());}};_0x35a064(++_0x528452);}(_0x8ae0,0x169));var _0x08ae=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8ae0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x08ae('0x0'));var util=require(_0x08ae('0x1'));var logger=require(_0x08ae('0x2'))(_0x08ae('0x3'));var moment=require(_0x08ae('0x4'));var BPromise=require(_0x08ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x08ae('0x6'));var config=require(_0x08ae('0x7'));var attributes=require('./userNotification.attributes');module[_0x08ae('0x8')]=function(_0x5c0c76,_0xc9aa99){return _0x5c0c76[_0x08ae('0x9')](_0x08ae('0xa'),attributes,{'tableName':_0x08ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x08ae('0xc'),'collate':_0x08ae('0xd')});}; \ No newline at end of file +var _0x7eaf=['../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4fe264,_0xe7d9e0){var _0x22c7c9=function(_0x1ea76c){while(--_0x1ea76c){_0x4fe264['push'](_0x4fe264['shift']());}};_0x22c7c9(++_0xe7d9e0);}(_0x7eaf,0x11b));var _0xf7ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eaf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf7ea('0x0'));var util=require(_0xf7ea('0x1'));var logger=require(_0xf7ea('0x2'))('api');var moment=require(_0xf7ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7ea('0x5'));var attributes=require('./userNotification.attributes');module[_0xf7ea('0x6')]=function(_0x877565,_0x1095ba){return _0x877565[_0xf7ea('0x7')](_0xf7ea('0x8'),attributes,{'tableName':_0xf7ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7ea('0xa'),'collate':_0xf7ea('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1336948..c24ca10 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 _0x7cb6=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x152ad0,_0x58e3e1){var _0x40a126=function(_0x27523c){while(--_0x27523c){_0x152ad0['push'](_0x152ad0['shift']());}};_0x40a126(++_0x58e3e1);}(_0x7cb6,0x6b));var _0x67cb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7cb6[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x67cb('0x0'));var util=require(_0x67cb('0x1'));var moment=require('moment');var BPromise=require(_0x67cb('0x2'));var rs=require(_0x67cb('0x3'));var fs=require('fs');var Redis=require(_0x67cb('0x4'));var db=require(_0x67cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67cb('0x6'))(_0x67cb('0x7'));var config=require(_0x67cb('0x8'));var jayson=require(_0x67cb('0x9'));var client=jayson[_0x67cb('0xa')][_0x67cb('0xb')]({'port':0x232a});config[_0x67cb('0xc')]=_[_0x67cb('0xd')](config[_0x67cb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67cb('0xc')]));require('./userNotification.socket')[_0x67cb('0xe')](socket);function respondWithRpcPromise(_0x1b8552,_0x547e21,_0x2113b5){return new BPromise(function(_0x3775fc,_0x46a4c6){return client[_0x67cb('0xf')](_0x1b8552,_0x2113b5)[_0x67cb('0x10')](function(_0x40e355){logger[_0x67cb('0x11')]('UserNotification,\x20%s,\x20%s',_0x547e21,_0x67cb('0x12'));logger[_0x67cb('0x13')](_0x67cb('0x14'),_0x547e21,_0x67cb('0x12'),JSON[_0x67cb('0x15')](_0x40e355));if(_0x40e355[_0x67cb('0x16')]){if(_0x40e355['error'][_0x67cb('0x17')]===0x1f4){logger[_0x67cb('0x16')](_0x67cb('0x18'),_0x547e21,_0x40e355[_0x67cb('0x16')][_0x67cb('0x19')]);return _0x46a4c6(_0x40e355[_0x67cb('0x16')][_0x67cb('0x19')]);}logger['error'](_0x67cb('0x18'),_0x547e21,_0x40e355['error'][_0x67cb('0x19')]);return _0x3775fc(_0x40e355[_0x67cb('0x16')]['message']);}else{logger[_0x67cb('0x11')](_0x67cb('0x18'),_0x547e21,_0x67cb('0x12'));_0x3775fc(_0x40e355[_0x67cb('0x1a')][_0x67cb('0x19')]);}})[_0x67cb('0x1b')](function(_0x3fae7f){logger['error'](_0x67cb('0x18'),_0x547e21,_0x3fae7f);_0x46a4c6(_0x3fae7f);});});} \ No newline at end of file +var _0x97d8=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x517082,_0xc70ef9){var _0x560118=function(_0xff3513){while(--_0xff3513){_0x517082['push'](_0x517082['shift']());}};_0x560118(++_0xc70ef9);}(_0x97d8,0x191));var _0x897d=function(_0x19dd4a,_0x43176d){_0x19dd4a=_0x19dd4a-0x0;var _0x8a97a8=_0x97d8[_0x19dd4a];return _0x8a97a8;};'use strict';var _=require('lodash');var util=require(_0x897d('0x0'));var moment=require(_0x897d('0x1'));var BPromise=require(_0x897d('0x2'));var rs=require(_0x897d('0x3'));var fs=require('fs');var Redis=require(_0x897d('0x4'));var db=require(_0x897d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x897d('0x6'))(_0x897d('0x7'));var config=require(_0x897d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x897d('0x9')]['http']({'port':0x232a});config[_0x897d('0xa')]=_[_0x897d('0xb')](config[_0x897d('0xa')],{'host':_0x897d('0xc'),'port':0x18eb});var socket=require(_0x897d('0xd'))(new Redis(config[_0x897d('0xa')]));require('./userNotification.socket')[_0x897d('0xe')](socket);function respondWithRpcPromise(_0x2349c3,_0x536290,_0x31f065){return new BPromise(function(_0x2facb0,_0x162439){return client[_0x897d('0xf')](_0x2349c3,_0x31f065)[_0x897d('0x10')](function(_0x398166){logger[_0x897d('0x11')](_0x897d('0x12'),_0x536290,_0x897d('0x13'));logger[_0x897d('0x14')](_0x897d('0x15'),_0x536290,_0x897d('0x13'),JSON['stringify'](_0x398166));if(_0x398166[_0x897d('0x16')]){if(_0x398166[_0x897d('0x16')][_0x897d('0x17')]===0x1f4){logger['error'](_0x897d('0x12'),_0x536290,_0x398166[_0x897d('0x16')][_0x897d('0x18')]);return _0x162439(_0x398166[_0x897d('0x16')]['message']);}logger[_0x897d('0x16')](_0x897d('0x12'),_0x536290,_0x398166[_0x897d('0x16')][_0x897d('0x18')]);return _0x2facb0(_0x398166[_0x897d('0x16')][_0x897d('0x18')]);}else{logger[_0x897d('0x11')]('UserNotification,\x20%s,\x20%s',_0x536290,_0x897d('0x13'));_0x2facb0(_0x398166[_0x897d('0x19')][_0x897d('0x18')]);}})[_0x897d('0x1a')](function(_0x261313){logger[_0x897d('0x16')](_0x897d('0x12'),_0x536290,_0x261313);_0x162439(_0x261313);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 1338098..3fd5e09 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 _0xb19d=['save','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xb19d,0x127));var _0xdb19=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0xb19d[_0x595604];return _0x1466f3;};'use strict';var UserNotificationEvents=require(_0xdb19('0x0'));var events=[_0xdb19('0x1'),'remove',_0xdb19('0x2')];function createListener(_0x1f6dea,_0x251c48){return function(_0x2c93f1){_0x251c48[_0xdb19('0x3')](_0x1f6dea,_0x2c93f1);};}function removeListener(_0x2a8e6e,_0x1e2ca7){return function(){UserNotificationEvents[_0xdb19('0x4')](_0x2a8e6e,_0x1e2ca7);};}exports[_0xdb19('0x5')]=function(_0x30df73){for(var _0x5992c2=0x0,_0x309c5c=events[_0xdb19('0x6')];_0x5992c2<_0x309c5c;_0x5992c2++){var _0x3ccc96=events[_0x5992c2];var _0x2aea62=createListener(_0xdb19('0x7')+_0x3ccc96,_0x30df73);UserNotificationEvents['on'](_0x3ccc96,_0x2aea62);}}; \ No newline at end of file +var _0x716a=['remove','update','removeListener','userNotification:','save'];(function(_0x13c5e6,_0x596d3a){var _0x2eca1b=function(_0x4e946f){while(--_0x4e946f){_0x13c5e6['push'](_0x13c5e6['shift']());}};_0x2eca1b(++_0x596d3a);}(_0x716a,0xdb));var _0xa716=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x716a[_0x3eb713];return _0x1d7128;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xa716('0x0'),_0xa716('0x1'),_0xa716('0x2')];function createListener(_0x7767ee,_0x2cc6aa){return function(_0x20f606){_0x2cc6aa['emit'](_0x7767ee,_0x20f606);};}function removeListener(_0x53a053,_0x48ea82){return function(){UserNotificationEvents[_0xa716('0x3')](_0x53a053,_0x48ea82);};}exports['register']=function(_0x25cc6c){for(var _0x4534f5=0x0,_0x30bfb3=events['length'];_0x4534f5<_0x30bfb3;_0x4534f5++){var _0x4b8799=events[_0x4534f5];var _0x4ba74c=createListener(_0xa716('0x4')+_0x4b8799,_0x25cc6c);UserNotificationEvents['on'](_0x4b8799,_0x4ba74c);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index faaaf04..495b7f2 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x32c1af,_0x1ea3b9){var _0x4bcf8c=function(_0x5d19eb){while(--_0x5d19eb){_0x32c1af['push'](_0x32c1af['shift']());}};_0x4bcf8c(++_0x1ea3b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xcb91[_0x51c819];return _0x15c5d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2ab787,_0x42567c){var _0x38d1a8=function(_0x15770e){while(--_0x15770e){_0x2ab787['push'](_0x2ab787['shift']());}};_0x38d1a8(++_0x42567c);}(_0x70e0,0x17b));var _0x070e=function(_0x451be4,_0x517db7){_0x451be4=_0x451be4-0x0;var _0x9d4613=_0x70e0[_0x451be4];return _0x9d4613;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 134b9b7..ba30a6b 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 _0x569d=['exports','INTEGER','sequelize'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x569d,0x12b));var _0xd569=function(_0x11e90b,_0x3ec29a){_0x11e90b=_0x11e90b-0x0;var _0x31452e=_0x569d[_0x11e90b];return _0x31452e;};'use strict';var Sequelize=require(_0xd569('0x0'));module[_0xd569('0x1')]={'penalty':{'type':Sequelize[_0xd569('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf88e=['INTEGER','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf88e,0xd0));var _0xef88=function(_0x50aa04,_0x13ec6d){_0x50aa04=_0x50aa04-0x0;var _0x4fe89e=_0xf88e[_0x50aa04];return _0x4fe89e;};'use strict';var Sequelize=require(_0xef88('0x0'));module[_0xef88('0x1')]={'penalty':{'type':Sequelize[_0xef88('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7d06a2a..5c5d595 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 _0xc9a2=['UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc9a2,0xde));var _0x2c9a=function(_0x30059a,_0x32f146){_0x30059a=_0x30059a-0x0;var _0x22bbc1=_0xc9a2[_0x30059a];return _0x22bbc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c9a('0x0'))('api');var moment=require(_0x2c9a('0x1'));var BPromise=require('bluebird');var rp=require(_0x2c9a('0x2'));var fs=require('fs');var path=require(_0x2c9a('0x3'));var rimraf=require(_0x2c9a('0x4'));var config=require(_0x2c9a('0x5'));var attributes=require(_0x2c9a('0x6'));module['exports']=function(_0x4581dd,_0x4886ea){return _0x4581dd[_0x2c9a('0x7')](_0x2c9a('0x8'),attributes,{'tableName':_0x2c9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24af=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x2c856c,_0x1eeaa6){var _0xa9d840=function(_0x1576e3){while(--_0x1576e3){_0x2c856c['push'](_0x2c856c['shift']());}};_0xa9d840(++_0x1eeaa6);}(_0x24af,0x1f2));var _0xf24a=function(_0x549ffa,_0x4011d9){_0x549ffa=_0x549ffa-0x0;var _0x378324=_0x24af[_0x549ffa];return _0x378324;};'use strict';var _=require(_0xf24a('0x0'));var util=require(_0xf24a('0x1'));var logger=require('../../config/logger')(_0xf24a('0x2'));var moment=require(_0xf24a('0x3'));var BPromise=require(_0xf24a('0x4'));var rp=require(_0xf24a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf24a('0x6'));var config=require(_0xf24a('0x7'));var attributes=require(_0xf24a('0x8'));module[_0xf24a('0x9')]=function(_0x45ea06,_0x337ef5){return _0x45ea06[_0xf24a('0xa')](_0xf24a('0xb'),attributes,{'tableName':_0xf24a('0xc'),'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 39179e0..75f019a 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 _0xb92a=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x16907f,_0x19c4a1){var _0xdb824=function(_0xfadb73){while(--_0xfadb73){_0x16907f['push'](_0x16907f['shift']());}};_0xdb824(++_0x19c4a1);}(_0xb92a,0xc5));var _0xab92=function(_0x29def0,_0x26b168){_0x29def0=_0x29def0-0x0;var _0x450eae=_0xb92a[_0x29def0];return _0x450eae;};'use strict';var _=require(_0xab92('0x0'));var util=require(_0xab92('0x1'));var moment=require(_0xab92('0x2'));var BPromise=require(_0xab92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab92('0x4'))['db'];var utils=require(_0xab92('0x5'));var logger=require('../../config/logger')(_0xab92('0x6'));var config=require('../../config/environment');var jayson=require(_0xab92('0x7'));var client=jayson[_0xab92('0x8')][_0xab92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482120,_0x1b7343,_0x530605){return new BPromise(function(_0x539ce5,_0x4af618){return client[_0xab92('0xa')](_0x482120,_0x530605)[_0xab92('0xb')](function(_0x4bd998){logger[_0xab92('0xc')](_0xab92('0xd'),_0x1b7343,_0xab92('0xe'));logger[_0xab92('0xf')](_0xab92('0x10'),_0x1b7343,_0xab92('0xe'),JSON[_0xab92('0x11')](_0x4bd998));if(_0x4bd998[_0xab92('0x12')]){if(_0x4bd998['error'][_0xab92('0x13')]===0x1f4){logger[_0xab92('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b7343,_0x4bd998[_0xab92('0x12')][_0xab92('0x14')]);return _0x4af618(_0x4bd998['error']['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1b7343,_0x4bd998[_0xab92('0x12')]['message']);return _0x539ce5(_0x4bd998[_0xab92('0x12')][_0xab92('0x14')]);}else{logger[_0xab92('0xc')](_0xab92('0xd'),_0x1b7343,_0xab92('0xe'));_0x539ce5(_0x4bd998[_0xab92('0x15')][_0xab92('0x14')]);}})[_0xab92('0x16')](function(_0x27d90d){logger[_0xab92('0x12')](_0xab92('0xd'),_0x1b7343,_0x27d90d);_0x4af618(_0x27d90d);});});} \ No newline at end of file +var _0x520f=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x17ee51,_0x4d0452){var _0x2ccb12=function(_0x4e899a){while(--_0x4e899a){_0x17ee51['push'](_0x17ee51['shift']());}};_0x2ccb12(++_0x4d0452);}(_0x520f,0x158));var _0xf520=function(_0x117a06,_0x3860e4){_0x117a06=_0x117a06-0x0;var _0x53bfc2=_0x520f[_0x117a06];return _0x53bfc2;};'use strict';var _=require('lodash');var util=require(_0xf520('0x0'));var moment=require(_0xf520('0x1'));var BPromise=require('bluebird');var rs=require(_0xf520('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf520('0x3'))['db'];var utils=require(_0xf520('0x4'));var logger=require(_0xf520('0x5'))(_0xf520('0x6'));var config=require('../../config/environment');var jayson=require(_0xf520('0x7'));var client=jayson[_0xf520('0x8')][_0xf520('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17d19a,_0x333f49,_0x5478b4){return new BPromise(function(_0x3b4ec0,_0x5423ec){return client[_0xf520('0xa')](_0x17d19a,_0x5478b4)[_0xf520('0xb')](function(_0x2c928e){logger[_0xf520('0xc')](_0xf520('0xd'),_0x333f49,_0xf520('0xe'));logger[_0xf520('0xf')](_0xf520('0x10'),_0x333f49,_0xf520('0xe'),JSON[_0xf520('0x11')](_0x2c928e));if(_0x2c928e[_0xf520('0x12')]){if(_0x2c928e[_0xf520('0x12')][_0xf520('0x13')]===0x1f4){logger[_0xf520('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x333f49,_0x2c928e[_0xf520('0x12')]['message']);return _0x5423ec(_0x2c928e[_0xf520('0x12')][_0xf520('0x14')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x333f49,_0x2c928e[_0xf520('0x12')][_0xf520('0x14')]);return _0x3b4ec0(_0x2c928e[_0xf520('0x12')]['message']);}else{logger['info'](_0xf520('0xd'),_0x333f49,_0xf520('0xe'));_0x3b4ec0(_0x2c928e[_0xf520('0x15')]['message']);}})[_0xf520('0x16')](function(_0x5a3443){logger[_0xf520('0x12')](_0xf520('0xd'),_0x333f49,_0x5a3443);_0x5423ec(_0x5a3443);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 96cbffb..e713199 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 _0xd14b=['/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','put','delete','destroy','removeResources','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x3bbf58,_0x49882a){var _0x59d4bc=function(_0x303266){while(--_0x303266){_0x3bbf58['push'](_0x3bbf58['shift']());}};_0x59d4bc(++_0x49882a);}(_0xd14b,0x1d7));var _0xbd14=function(_0x2cfbcf,_0x2cf96f){_0x2cfbcf=_0x2cfbcf-0x0;var _0x41fc13=_0xd14b[_0x2cfbcf];return _0x41fc13;};'use strict';var multer=require(_0xbd14('0x0'));var util=require(_0xbd14('0x1'));var path=require(_0xbd14('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd14('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbd14('0x4'));var config=require(_0xbd14('0x5'));var controller=require(_0xbd14('0x6'));router[_0xbd14('0x7')]('/',auth[_0xbd14('0x8')](),controller['index']);router[_0xbd14('0x7')]('/describe',auth[_0xbd14('0x8')](),controller['describe']);router[_0xbd14('0x7')](_0xbd14('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xbd14('0x7')](_0xbd14('0xa'),auth['isAuthenticated'](),controller[_0xbd14('0xb')]);router[_0xbd14('0x7')](_0xbd14('0xc'),auth[_0xbd14('0x8')](),controller[_0xbd14('0xd')]);router[_0xbd14('0xe')]('/',auth[_0xbd14('0x8')](),controller[_0xbd14('0xf')]);router['post']('/:id/clone',auth[_0xbd14('0x8')](),controller[_0xbd14('0x10')]);router['post'](_0xbd14('0xa'),auth[_0xbd14('0x8')](),controller[_0xbd14('0x11')]);router[_0xbd14('0xe')](_0xbd14('0xc'),auth[_0xbd14('0x8')](),controller[_0xbd14('0x12')]);router[_0xbd14('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbd14('0x14')](_0xbd14('0x9'),auth['isAuthenticated'](),controller[_0xbd14('0x15')]);router[_0xbd14('0x14')](_0xbd14('0xa'),auth[_0xbd14('0x8')](),controller['removeSections']);router['delete'](_0xbd14('0xc'),auth['isAuthenticated'](),controller[_0xbd14('0x16')]);module[_0xbd14('0x17')]=router; \ No newline at end of file +var _0xb205=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeResources','exports','multer'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xb205,0x1bf));var _0x5b20=function(_0x2ea377,_0x3ed66d){_0x2ea377=_0x2ea377-0x0;var _0x24244a=_0xb205[_0x2ea377];return _0x24244a;};'use strict';var multer=require(_0x5b20('0x0'));var util=require('util');var path=require(_0x5b20('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b20('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5b20('0x3'));var interaction=require(_0x5b20('0x4'));var config=require(_0x5b20('0x5'));var controller=require(_0x5b20('0x6'));router[_0x5b20('0x7')]('/',auth[_0x5b20('0x8')](),controller[_0x5b20('0x9')]);router[_0x5b20('0x7')](_0x5b20('0xa'),auth[_0x5b20('0x8')](),controller['describe']);router[_0x5b20('0x7')](_0x5b20('0xb'),auth[_0x5b20('0x8')](),controller[_0x5b20('0xc')]);router[_0x5b20('0x7')](_0x5b20('0xd'),auth[_0x5b20('0x8')](),controller[_0x5b20('0xe')]);router[_0x5b20('0x7')](_0x5b20('0xf'),auth[_0x5b20('0x8')](),controller['getResources']);router[_0x5b20('0x10')]('/',auth[_0x5b20('0x8')](),controller[_0x5b20('0x11')]);router[_0x5b20('0x10')](_0x5b20('0x12'),auth[_0x5b20('0x8')](),controller[_0x5b20('0x13')]);router[_0x5b20('0x10')](_0x5b20('0xd'),auth[_0x5b20('0x8')](),controller[_0x5b20('0x14')]);router[_0x5b20('0x10')](_0x5b20('0xf'),auth[_0x5b20('0x8')](),controller[_0x5b20('0x15')]);router[_0x5b20('0x16')](_0x5b20('0xb'),auth['isAuthenticated'](),controller[_0x5b20('0x17')]);router[_0x5b20('0x18')](_0x5b20('0xb'),auth['isAuthenticated'](),controller[_0x5b20('0x19')]);router['delete'](_0x5b20('0xd'),auth[_0x5b20('0x8')](),controller['removeSections']);router[_0x5b20('0x18')]('/:id/resources',auth[_0x5b20('0x8')](),controller[_0x5b20('0x1a')]);module[_0x5b20('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 9751ff7..0d99c3c 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 _0xdecb=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x54c516,_0x420575){var _0x2583c0=function(_0x4171e4){while(--_0x4171e4){_0x54c516['push'](_0x54c516['shift']());}};_0x2583c0(++_0x420575);}(_0xdecb,0xe9));var _0xbdec=function(_0x47ddd9,_0x344fa1){_0x47ddd9=_0x47ddd9-0x0;var _0x3ec8eb=_0xdecb[_0x47ddd9];return _0x3ec8eb;};'use strict';var Sequelize=require(_0xbdec('0x0'));module[_0xbdec('0x1')]={'name':{'type':Sequelize[_0xbdec('0x2')],'allowNull':![],'unique':_0xbdec('0x3')},'crudPermissions':{'type':Sequelize[_0xbdec('0x2')],'set':function(_0x4d442c){this[_0xbdec('0x4')](_0xbdec('0x5'),_0x4d442c?_0x4d442c[_0xbdec('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xbdec('0x5'))?this[_0xbdec('0x7')]('crudPermissions')[_0xbdec('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbdec('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xbdec('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x754f=['BOOLEAN','exports','STRING','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x195290,_0x3958a5){var _0x28c1b3=function(_0x338e94){while(--_0x338e94){_0x195290['push'](_0x195290['shift']());}};_0x28c1b3(++_0x3958a5);}(_0x754f,0x1f1));var _0xf754=function(_0x161e86,_0x34ab23){_0x161e86=_0x161e86-0x0;var _0x55f7af=_0x754f[_0x161e86];return _0x55f7af;};'use strict';var Sequelize=require('sequelize');module[_0xf754('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xf754('0x1')],'set':function(_0x23c60b){this[_0xf754('0x2')]('crudPermissions',_0x23c60b?_0x23c60b[_0xf754('0x3')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xf754('0x4')](_0xf754('0x5'))[_0xf754('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf754('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf754('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf754('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf754('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf754('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf754('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf754('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1e130f2..abe55f9 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 _0x2c16=['ids','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','count','includeAll','include','rows','catch','show','params','keys','find','create','body','clone','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','describe','addSections','Resources','push','removeSections','getSections','findAll','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources'];(function(_0x337565,_0x3198ec){var _0x197ff3=function(_0x3b9e8b){while(--_0x3b9e8b){_0x337565['push'](_0x337565['shift']());}};_0x197ff3(++_0x3198ec);}(_0x2c16,0xf0));var _0x62c1=function(_0x39c75c,_0x16a1b4){_0x39c75c=_0x39c75c-0x0;var _0x51da6d=_0x2c16[_0x39c75c];return _0x51da6d;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62c1('0x3'));var moment=require(_0x62c1('0x4'));var BPromise=require(_0x62c1('0x5'));var Mustache=require(_0x62c1('0x6'));var util=require(_0x62c1('0x7'));var path=require(_0x62c1('0x8'));var sox=require(_0x62c1('0x9'));var csv=require(_0x62c1('0xa'));var ejs=require(_0x62c1('0xb'));var fs=require('fs');var fs_extra=require(_0x62c1('0xc'));var _=require('lodash');var squel=require(_0x62c1('0xd'));var crypto=require(_0x62c1('0xe'));var jsforce=require(_0x62c1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x62c1('0xa'));var querystring=require('querystring');var Papa=require(_0x62c1('0x10'));var Redis=require(_0x62c1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62c1('0x13'));var logger=require(_0x62c1('0x14'))(_0x62c1('0x15'));var utils=require(_0x62c1('0x16'));var config=require(_0x62c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x62c1('0x18')]=_[_0x62c1('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x62c1('0x1a'))(new Redis(config[_0x62c1('0x18')]));require('./userProfile.socket')[_0x62c1('0x1b')](socket);function respondWithStatusCode(_0x45357f,_0x202cec){_0x202cec=_0x202cec||0xcc;return function(_0x164cef){if(_0x164cef){return _0x45357f[_0x62c1('0x1c')](_0x202cec);}return _0x45357f['status'](_0x202cec)[_0x62c1('0x1d')]();};}function respondWithResult(_0x54199e,_0x1e077d){_0x1e077d=_0x1e077d||0xc8;return function(_0x28bd4b){if(_0x28bd4b){return _0x54199e[_0x62c1('0x1e')](_0x1e077d)[_0x62c1('0x1f')](_0x28bd4b);}};}function respondWithFilteredResult(_0xeb9fbb,_0x87c13c){return function(_0x45a551){if(_0x45a551){var _0x34baa2=typeof _0x87c13c[_0x62c1('0x20')]===_0x62c1('0x21')&&typeof _0x87c13c[_0x62c1('0x22')]===_0x62c1('0x21');var _0x474f67=_0x45a551['count'];var _0x426618=_0x34baa2?0x0:_0x87c13c[_0x62c1('0x20')];var _0x484725=_0x34baa2?_0x45a551['count']:_0x87c13c[_0x62c1('0x20')]+_0x87c13c['limit'];var _0x4c0261;if(_0x484725>=_0x474f67){_0x484725=_0x474f67;_0x4c0261=0xc8;}else{_0x4c0261=0xce;}_0xeb9fbb['status'](_0x4c0261);return _0xeb9fbb[_0x62c1('0x23')](_0x62c1('0x24'),_0x426618+'-'+_0x484725+'/'+_0x474f67)[_0x62c1('0x1f')](_0x45a551);}return null;};}function patchUpdates(_0x116cdd){return function(_0x1cc803){try{jsonpatch[_0x62c1('0x25')](_0x1cc803,_0x116cdd,!![]);}catch(_0x39d2db){return BPromise[_0x62c1('0x26')](_0x39d2db);}return _0x1cc803[_0x62c1('0x27')]();};}function saveUpdates(_0x383088,_0x5e05f5){return function(_0x379113){if(_0x379113){return _0x379113[_0x62c1('0x28')](_0x383088)['then'](function(_0x2f2a8b){return _0x2f2a8b;});}return null;};}function removeEntity(_0x4963b5,_0x151fba){return function(_0x3cd49c){if(_0x3cd49c){return _0x3cd49c[_0x62c1('0x29')]()['then'](function(){_0x4963b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56e9ad,_0x426b03){return function(_0x4224e0){if(!_0x4224e0){_0x56e9ad[_0x62c1('0x1c')](0x194);}return _0x4224e0;};}function handleError(_0x515546,_0x778f88){_0x778f88=_0x778f88||0x1f4;return function(_0x397c74){logger[_0x62c1('0x2a')](_0x397c74[_0x62c1('0x2b')]);if(_0x397c74['name']){delete _0x397c74[_0x62c1('0x2c')];}_0x515546[_0x62c1('0x1e')](_0x778f88)[_0x62c1('0x2d')](_0x397c74);};}exports[_0x62c1('0x2e')]=function(_0x126bd3,_0x44c6bb){var _0x390dbf={},_0x4e597f={},_0x55cd76={'count':0x0,'rows':[]};var _0x343bba=_['map'](db[_0x62c1('0x2f')][_0x62c1('0x30')],function(_0x1eedf1){return{'name':_0x1eedf1[_0x62c1('0x31')],'type':_0x1eedf1[_0x62c1('0x32')][_0x62c1('0x33')]};});_0x4e597f[_0x62c1('0x34')]=_[_0x62c1('0x35')](_0x343bba,_0x62c1('0x2c'));_0x4e597f['query']=_['keys'](_0x126bd3['query']);_0x4e597f['filters']=_[_0x62c1('0x36')](_0x4e597f[_0x62c1('0x34')],_0x4e597f[_0x62c1('0x37')]);_0x390dbf[_0x62c1('0x38')]=_['intersection'](_0x4e597f[_0x62c1('0x34')],qs[_0x62c1('0x39')](_0x126bd3['query']['fields']));_0x390dbf['attributes']=_0x390dbf['attributes'][_0x62c1('0x3a')]?_0x390dbf[_0x62c1('0x38')]:_0x4e597f[_0x62c1('0x34')];if(!_0x126bd3[_0x62c1('0x37')][_0x62c1('0x3b')](_0x62c1('0x3c'))){_0x390dbf['limit']=qs[_0x62c1('0x22')](_0x126bd3['query'][_0x62c1('0x22')]);_0x390dbf['offset']=qs['offset'](_0x126bd3[_0x62c1('0x37')][_0x62c1('0x20')]);}_0x390dbf[_0x62c1('0x3d')]=qs[_0x62c1('0x3e')](_0x126bd3[_0x62c1('0x37')][_0x62c1('0x3e')]);_0x390dbf['where']=qs[_0x62c1('0x3f')](_[_0x62c1('0x40')](_0x126bd3[_0x62c1('0x37')],_0x4e597f[_0x62c1('0x3f')]),_0x343bba);if(_0x126bd3['query'][_0x62c1('0x41')]){_0x390dbf[_0x62c1('0x42')]=_[_0x62c1('0x43')](_0x390dbf[_0x62c1('0x42')],{'$or':_[_0x62c1('0x35')](_0x343bba,function(_0x5ebd24){if(_0x5ebd24[_0x62c1('0x32')]!==_0x62c1('0x44')){var _0x1a6243={};_0x1a6243[_0x5ebd24[_0x62c1('0x2c')]]={'$like':'%'+_0x126bd3[_0x62c1('0x37')][_0x62c1('0x41')]+'%'};return _0x1a6243;}})});}_0x390dbf=_[_0x62c1('0x43')]({},_0x390dbf,_0x126bd3[_0x62c1('0x45')]);var _0xd61582={'where':_0x390dbf[_0x62c1('0x42')]};return db['UserProfile']['count'](_0xd61582)[_0x62c1('0x46')](function(_0x5a4af9){_0x55cd76[_0x62c1('0x47')]=_0x5a4af9;if(_0x126bd3[_0x62c1('0x37')][_0x62c1('0x48')]){_0x390dbf[_0x62c1('0x49')]=[{'all':!![]}];}return db[_0x62c1('0x2f')]['findAll'](_0x390dbf);})['then'](function(_0x5730ea){_0x55cd76[_0x62c1('0x4a')]=_0x5730ea;return _0x55cd76;})[_0x62c1('0x46')](respondWithFilteredResult(_0x44c6bb,_0x390dbf))[_0x62c1('0x4b')](handleError(_0x44c6bb,null));};exports[_0x62c1('0x4c')]=function(_0x1c9c00,_0x5569b0){var _0x3b74a9={'raw':![],'where':{'id':_0x1c9c00[_0x62c1('0x4d')]['id']}},_0x110f74={};_0x110f74[_0x62c1('0x34')]=_[_0x62c1('0x4e')](db[_0x62c1('0x2f')][_0x62c1('0x30')]);_0x110f74[_0x62c1('0x37')]=_[_0x62c1('0x4e')](_0x1c9c00[_0x62c1('0x37')]);_0x110f74[_0x62c1('0x3f')]=_[_0x62c1('0x36')](_0x110f74['model'],_0x110f74[_0x62c1('0x37')]);_0x3b74a9['attributes']=_[_0x62c1('0x36')](_0x110f74[_0x62c1('0x34')],qs[_0x62c1('0x39')](_0x1c9c00[_0x62c1('0x37')][_0x62c1('0x39')]));_0x3b74a9['attributes']=_0x3b74a9[_0x62c1('0x38')]['length']?_0x3b74a9[_0x62c1('0x38')]:_0x110f74['model'];if(_0x1c9c00['query'][_0x62c1('0x48')]){_0x3b74a9[_0x62c1('0x49')]=[{'all':!![]}];}_0x3b74a9=_[_0x62c1('0x43')]({},_0x3b74a9,_0x1c9c00['options']);return db[_0x62c1('0x2f')][_0x62c1('0x4f')](_0x3b74a9)['then'](handleEntityNotFound(_0x5569b0,null))[_0x62c1('0x46')](respondWithResult(_0x5569b0,null))[_0x62c1('0x4b')](handleError(_0x5569b0,null));};exports[_0x62c1('0x50')]=function(_0x54fe04,_0x5137de){return db[_0x62c1('0x2f')][_0x62c1('0x50')](_0x54fe04[_0x62c1('0x51')],{})[_0x62c1('0x46')](respondWithResult(_0x5137de,0xc9))['catch'](handleError(_0x5137de,null));};exports[_0x62c1('0x52')]=function(_0x375088,_0x1fd5de){var _0x17004a={'where':{'id':_0x375088[_0x62c1('0x4d')]['id']}},_0x15fc21={};_0x15fc21['model']=_[_0x62c1('0x4e')](db[_0x62c1('0x2f')][_0x62c1('0x30')]);_0x17004a['attributes']=_[_0x62c1('0x36')](_0x15fc21['model'],qs[_0x62c1('0x39')](_0x375088[_0x62c1('0x37')]['fields']));_0x17004a[_0x62c1('0x38')]=_0x17004a['attributes'][_0x62c1('0x3a')]?_0x17004a['attributes']:_0x15fc21[_0x62c1('0x34')];if(_0x375088['query'][_0x62c1('0x48')]){_0x17004a[_0x62c1('0x49')]=[{'all':!![]}];}_0x17004a=_[_0x62c1('0x43')]({},_0x17004a,_0x375088['options']);return db[_0x62c1('0x2f')][_0x62c1('0x4f')](_0x17004a)[_0x62c1('0x46')](handleEntityNotFound(_0x1fd5de,null))[_0x62c1('0x46')](function(_0x55da2e){if(_0x55da2e){var _0x1b503b=_0x55da2e['get']({'plain':!![]});_0x1b503b=qs[_0x62c1('0x53')](_0x1b503b,['id',_0x62c1('0x54'),'updatedAt',_0x62c1('0x55')]);_0x375088['body']=_[_0x62c1('0x53')](_0x375088[_0x62c1('0x51')],['id',_0x62c1('0x54'),_0x62c1('0x56')]);return db[_0x62c1('0x57')][_0x62c1('0x58')](function(_0x3f6267){return db[_0x62c1('0x2f')]['create'](_[_0x62c1('0x43')](_0x1b503b,_0x375088['body']),{'include':_0x375088[_0x62c1('0x37')][_0x62c1('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x3f6267})[_0x62c1('0x46')](function(_0x322013){var _0x37350e=_0x322013[_0x62c1('0x59')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x375088[_0x62c1('0x4d')]['id']},'raw':!![]})[_0x62c1('0x46')](function(_0x568368){if(_0x568368){return BPromise[_0x62c1('0x5a')](_0x568368,function(_0x1b5f2d){return new BPromise(function(_0x3c79d6,_0x279db8){if(_0x1b5f2d['autoAssociation']===null||_0x1b5f2d[_0x62c1('0x5b')]===0x1)_0x3c79d6(null);return db[_0x62c1('0x5c')]['findAll']({'where':{'sectionId':_0x1b5f2d['id']},'raw':!![]})[_0x62c1('0x46')](function(_0x212388){var _0x2762d=_[_0x62c1('0x35')](_0x212388,function(_0x2db50a){return qs[_0x62c1('0x53')](_0x2db50a,['id','createdAt',_0x62c1('0x56'),_0x62c1('0x5d')]);});_0x3c79d6(_0x2762d);})['catch'](function(_0x45b03a){_0x279db8(_0x45b03a);});})[_0x62c1('0x46')](function(_0x46cec4){var _0xca5924=qs[_0x62c1('0x53')](_0x1b5f2d,['id','createdAt',_0x62c1('0x56')]);_0xca5924[_0x62c1('0x5e')]=_0x37350e['id'];if(_0x46cec4)_0xca5924['Resources']=_0x46cec4;return _0xca5924;})[_0x62c1('0x46')](function(_0x2dd21d){return db[_0x62c1('0x5f')][_0x62c1('0x50')](_0x2dd21d,{'include':[{'model':db[_0x62c1('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x3f6267});});})[_0x62c1('0x46')](function(){return _0x37350e;});}});});});}})[_0x62c1('0x46')](respondWithResult(_0x1fd5de,0xc9))[_0x62c1('0x4b')](handleError(_0x1fd5de,null));};exports[_0x62c1('0x28')]=function(_0x4f209c,_0x2e6f87){if(_0x4f209c[_0x62c1('0x51')]['id']){delete _0x4f209c[_0x62c1('0x51')]['id'];}return db[_0x62c1('0x2f')][_0x62c1('0x4f')]({'where':{'id':_0x4f209c['params']['id']}})[_0x62c1('0x46')](handleEntityNotFound(_0x2e6f87,null))[_0x62c1('0x46')](saveUpdates(_0x4f209c[_0x62c1('0x51')],null))[_0x62c1('0x46')](respondWithResult(_0x2e6f87,null))[_0x62c1('0x4b')](handleError(_0x2e6f87,null));};exports[_0x62c1('0x29')]=function(_0x2f9daf,_0x43d816){return db[_0x62c1('0x2f')]['find']({'where':{'id':_0x2f9daf[_0x62c1('0x4d')]['id']}})[_0x62c1('0x46')](handleEntityNotFound(_0x43d816,null))[_0x62c1('0x46')](removeEntity(_0x43d816,null))[_0x62c1('0x4b')](handleError(_0x43d816,null));};exports[_0x62c1('0x60')]=function(_0x5bc1b3,_0x5a9c6f){return db['UserProfile'][_0x62c1('0x60')]()[_0x62c1('0x46')](respondWithResult(_0x5a9c6f,null))[_0x62c1('0x4b')](handleError(_0x5a9c6f,null));};exports[_0x62c1('0x61')]=function(_0x53961c,_0xef9f44){var _0x1c2874=_0x53961c[_0x62c1('0x51')];return db['UserProfile'][_0x62c1('0x4f')]({'where':{'id':_0x53961c[_0x62c1('0x4d')]['id']}})[_0x62c1('0x46')](handleEntityNotFound(_0xef9f44,null))[_0x62c1('0x46')](function(_0x31d3f1){if(_0x31d3f1){return db[_0x62c1('0x57')][_0x62c1('0x58')](function(_0x200ee1){return db[_0x62c1('0x5f')][_0x62c1('0x29')]({'where':{'userProfileId':_0x53961c['params']['id'],'sectionId':_[_0x62c1('0x35')](_0x1c2874,function(_0x82c8f0){return _0x82c8f0[_0x62c1('0x5d')];})},'transaction':_0x200ee1})['then'](function(){var _0x1cfd1b=_[_0x62c1('0x35')](_0x1c2874,function(_0x431a36){_0x431a36[_0x62c1('0x5e')]=_0x53961c[_0x62c1('0x4d')]['id'];return _0x431a36;});var _0x13ce1d=[];return BPromise[_0x62c1('0x5a')](_0x1cfd1b,function(_0x522772){return db[_0x62c1('0x5f')][_0x62c1('0x50')](_0x522772,{'include':[{'model':db[_0x62c1('0x5c')],'as':_0x62c1('0x62')}],'raw':!![],'transaction':_0x200ee1})[_0x62c1('0x46')](function(_0x423b0e){_0x13ce1d[_0x62c1('0x63')](_0x423b0e['get']({'plain':!![]}));});})[_0x62c1('0x46')](function(){return _0x13ce1d;});});});}})[_0x62c1('0x46')](function(_0x51bd7b){return _0x51bd7b;})[_0x62c1('0x46')](respondWithResult(_0xef9f44,null))[_0x62c1('0x4b')](handleError(_0xef9f44,null));};exports[_0x62c1('0x64')]=function(_0x5b517e,_0xce103a){var _0xcc92ad;return db['UserProfile'][_0x62c1('0x4f')]({'where':{'id':_0x5b517e[_0x62c1('0x4d')]['id']},'attributes':['id',_0x62c1('0x2c')]})['then'](handleEntityNotFound(_0xce103a,null))['then'](function(_0x270aa4){if(_0x270aa4){_0xcc92ad=_0x270aa4;return db[_0x62c1('0x5f')][_0x62c1('0x29')]({'where':{'userProfileId':_0x5b517e[_0x62c1('0x4d')]['id'],'sectionId':_0x5b517e['query']['ids']}});}})['then'](function(){return _0xcc92ad;})[_0x62c1('0x46')](respondWithStatusCode(_0xce103a,null))[_0x62c1('0x4b')](handleError(_0xce103a,null));};exports[_0x62c1('0x65')]=function(_0x4dc908,_0x16566c){var _0x20e0e5=[];var _0x549e5c=[];return db[_0x62c1('0x5f')][_0x62c1('0x66')]({'where':{'userProfileId':_0x4dc908[_0x62c1('0x4d')]['id']},'raw':!![]})[_0x62c1('0x46')](function(_0x158edb){_0x20e0e5=_[_0x62c1('0x41')](_0x158edb,function(_0x5c985d){return _0x5c985d[_0x62c1('0x67')]===0x1||_[_0x62c1('0x68')]([0x3eb,0x709],_0x5c985d['sectionId']);});if(!_[_0x62c1('0x69')](_0x20e0e5)){return _[_0x62c1('0x35')](_0x20e0e5,function(_0x4af27f){return _0x4af27f[_0x62c1('0x5d')];});}else{return;}})[_0x62c1('0x46')](function(_0x165d07){if(_0x165d07)_0x549e5c=_0x165d07;if(_[_0x62c1('0x68')](_0x549e5c,0x64)){var _0x310dae=_[_0x62c1('0x4f')](_0x20e0e5,{'sectionId':0x64});return hasDefaultDashboard(_0x310dae)[_0x62c1('0x46')](function(_0x1d9b66){return _[_0x62c1('0x35')](_0x20e0e5,function(_0x5be035){if(_0x5be035['sectionId']===0x64){_0x5be035['subsections']=_0x1d9b66;}return _0x5be035;});});}else{return;}})[_0x62c1('0x46')](function(_0x398cba){if(_0x398cba)_0x20e0e5=_0x398cba;if(_[_0x62c1('0x68')](_0x549e5c,0x3eb)){var _0x8e482a=_[_0x62c1('0x4f')](_0x20e0e5,{'sectionId':0x3eb});return getCustomDashboards(_0x8e482a)[_0x62c1('0x46')](function(_0x21e71b){return _[_0x62c1('0x35')](_0x20e0e5,function(_0x14d24f){if(_0x8e482a[_0x62c1('0x67')]){if(_0x14d24f['sectionId']===0x3eb){_0x14d24f[_0x62c1('0x6a')]=_0x21e71b;}}else{if(_0x14d24f[_0x62c1('0x5d')]===0x64){_0x14d24f['subsections']=_0x21e71b;}}return _0x14d24f;});});}else{return;}})[_0x62c1('0x46')](function(_0x143ff6){if(_0x143ff6)_0x20e0e5=_0x143ff6;if(_[_0x62c1('0x68')](_0x549e5c,0x709)){var _0x5da3d9=_[_0x62c1('0x4f')](_0x20e0e5,{'sectionId':0x709});return getPlugins(_0x5da3d9)[_0x62c1('0x46')](function(_0x2d185d){if(_0x5da3d9[_0x62c1('0x67')]){return _[_0x62c1('0x35')](_0x20e0e5,function(_0xdc8786){if(_0xdc8786[_0x62c1('0x5d')]===0x709){_0xdc8786[_0x62c1('0x6a')]=_0x2d185d;}return _0xdc8786;});}else{var _0x20db34={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2d185d};var _0x111505=_[_0x62c1('0x35')](_0x20e0e5);_0x111505[_0x62c1('0x63')](_0x20db34);return _0x111505;}});}else{return;}})[_0x62c1('0x46')](function(_0x525dfd){if(_0x525dfd)_0x20e0e5=_0x525dfd;return _[_0x62c1('0x41')](_0x20e0e5,[_0x62c1('0x67'),0x1]);})['then'](respondWithResult(_0x16566c,null))['catch'](handleError(_0x16566c,null));};function hasDefaultDashboard(_0x1a1eb1){var _0x505d54=[0x65];return new BPromise(function(_0x261bb6,_0x160d9d){try{if(_0x1a1eb1[_0x62c1('0x5b')]){_0x261bb6(_0x505d54);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x1a1eb1['id']},'raw':!![]})[_0x62c1('0x46')](function(_0x5bb288){_0x5bb288?_0x261bb6(_0x505d54):_0x261bb6();});}}catch(_0x1f3df6){_0x160d9d(_0x1f3df6);}});}function getCustomDashboards(_0x217df3){var _0x3a799f=[];return new BPromise(function(_0x2c5856,_0xc0500a){try{if(_0x217df3[_0x62c1('0x5b')]){return db[_0x62c1('0x6b')][_0x62c1('0x66')]({'raw':!![]})['then'](function(_0x14b717){_0x14b717[_0x62c1('0x6c')](function(_0x4cb7fa){_0x3a799f[_0x62c1('0x63')](_0x4cb7fa['id']+0x1869f);});_0x2c5856(_0x3a799f);});}else{return db[_0x62c1('0x5c')][_0x62c1('0x66')]({'where':{'sectionId':_0x217df3['id']},'raw':!![]})['then'](function(_0x45fd00){_0x45fd00['forEach'](function(_0x1ce0dc){_0x3a799f[_0x62c1('0x63')](_0x1ce0dc[_0x62c1('0x6d')]+0x1869f);});_0x2c5856(_0x3a799f);});}}catch(_0x830094){_0xc0500a(_0x830094);}});}function getPlugins(_0x39729b){var _0x3bce8e=[];return new BPromise(function(_0x52a46c,_0x42b154){try{if(_0x39729b[_0x62c1('0x5b')]){return db[_0x62c1('0x6e')][_0x62c1('0x66')]({'raw':!![]})[_0x62c1('0x46')](function(_0x4eeeef){_0x4eeeef[_0x62c1('0x6c')](function(_0xdb0085){_0x3bce8e[_0x62c1('0x63')](_0xdb0085['id']+0x15b38);});_0x52a46c(_0x3bce8e);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x39729b['id']},'raw':!![]})[_0x62c1('0x46')](function(_0x548d4c){_0x548d4c[_0x62c1('0x6c')](function(_0x598fd3){_0x3bce8e[_0x62c1('0x63')](_0x598fd3['resourceId']+0x15b38);});_0x52a46c(_0x3bce8e);});}}catch(_0x4fbded){_0x42b154(_0x4fbded);}});}exports[_0x62c1('0x6f')]=function(_0x19f26a,_0x3c0eba){return db[_0x62c1('0x2f')][_0x62c1('0x4f')]({'where':{'id':_0x19f26a[_0x62c1('0x4d')]['id']}})[_0x62c1('0x46')](handleEntityNotFound(_0x3c0eba,null))[_0x62c1('0x46')](function(_0x4af21f){if(_0x4af21f){return db['sequelize'][_0x62c1('0x58')](function(_0x3e316c){return db['UserProfileSection'][_0x62c1('0x66')]({'where':{'userProfileId':_0x19f26a[_0x62c1('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xb85647){if(_0xb85647){return db[_0x62c1('0x5f')]['destroy']({'where':{'userProfileId':_0x19f26a[_0x62c1('0x4d')]['id'],'id':_[_0x62c1('0x35')](_0xb85647,function(_0x4ed2b4){return _0x4ed2b4['id'];})},'transaction':_0x3e316c});}})['then'](function(_0x12ca5b){var _0x3795d0=_[_0x62c1('0x35')](_0x19f26a[_0x62c1('0x51')],function(_0x30a137){_0x30a137['userProfileId']=_0x19f26a[_0x62c1('0x4d')]['id'];return _0x30a137;});return db[_0x62c1('0x5f')]['bulkCreate'](_0x3795d0,{'raw':!![],'transaction':_0x3e316c});})[_0x62c1('0x46')](function(_0x5052c5){var _0x4e9e44=_[_0x62c1('0x41')](_[_0x62c1('0x35')](_0x5052c5,function(_0x14f2e2){return _0x14f2e2['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4e9e44){return db[_0x62c1('0x5f')][_0x62c1('0x66')]({'where':{'userProfileId':_0x19f26a['params']['id'],'sectionId':_[_0x62c1('0x35')](_0x4e9e44,function(_0x41d587){return _0x41d587[_0x62c1('0x5d')];})},'attributes':['id',_0x62c1('0x5d')],'raw':!![]})['then'](function(_0xb9c0e0){var _0x4ccac5=_[_0x62c1('0x35')](_0x19f26a[_0x62c1('0x51')],function(_0x51b421){_0x51b421[_0x62c1('0x5e')]=_0x19f26a[_0x62c1('0x4d')]['id'];return _0x51b421;});return db[_0x62c1('0x5c')][_0x62c1('0x70')](_0x4ccac5,{'raw':!![],'transaction':_0x3e316c});});}})['catch'](handleError(_0x3c0eba,null));});}})[_0x62c1('0x46')](function(_0x19c3b9){var _0x1b1f3b=_[_0x62c1('0x35')](_0x19c3b9,function(_0x5c4a87){return _0x5c4a87[_0x62c1('0x59')]({'plain':!![]});});})[_0x62c1('0x46')](respondWithResult(_0x3c0eba,null))[_0x62c1('0x4b')](handleError(_0x3c0eba,null));};exports[_0x62c1('0x71')]=function(_0x1d2806,_0x32aff9,_0x29c366){return db[_0x62c1('0x2f')][_0x62c1('0x4f')]({'where':{'id':_0x1d2806[_0x62c1('0x4d')]['id']}})[_0x62c1('0x46')](handleEntityNotFound(_0x32aff9,null))['then'](function(_0x576a40){if(_0x576a40){return _0x576a40[_0x62c1('0x71')](_0x1d2806[_0x62c1('0x37')][_0x62c1('0x72')]);}})['then'](respondWithStatusCode(_0x32aff9,null))[_0x62c1('0x4b')](handleError(_0x32aff9,null));};exports[_0x62c1('0x73')]=function(_0x4c3c17,_0x21b7d1){var _0x4f6ff3={};if(!_0x4c3c17['query'][_0x62c1('0x74')])throw new Error('Missing\x20section\x20parameter');if(!_0x4c3c17[_0x62c1('0x37')]['hasOwnProperty']('nolimit')){_0x4f6ff3['limit']=qs[_0x62c1('0x22')](_0x4c3c17[_0x62c1('0x37')][_0x62c1('0x22')]);_0x4f6ff3[_0x62c1('0x20')]=qs[_0x62c1('0x20')](_0x4c3c17['query'][_0x62c1('0x20')]);}return db[_0x62c1('0x2f')][_0x62c1('0x4f')]({'where':{'id':_0x4c3c17['params']['id']}})[_0x62c1('0x46')](function(_0x665c17){if(!_0x665c17)throw new Error(_0x62c1('0x75')+_0x4c3c17[_0x62c1('0x4d')]['id']);return db['UserProfile'][_0x62c1('0x73')](_0x4c3c17);})['then'](respondWithFilteredResult(_0x21b7d1,_0x4f6ff3))[_0x62c1('0x4b')](handleError(_0x21b7d1,null));}; \ No newline at end of file +var _0x1280=['intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','get','omit','createdAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','sequelize','destroy','push','removeSections','getSections','enabled','includes','sectionId','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','send','map','UserProfile','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0x1280,0xac));var _0x0128=function(_0x2dd22e,_0xec41fe){_0x2dd22e=_0x2dd22e-0x0;var _0x257b01=_0x1280[_0x2dd22e];return _0x257b01;};'use strict';var emlformat=require(_0x0128('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0128('0x1'));var jsonpatch=require(_0x0128('0x2'));var rp=require(_0x0128('0x3'));var moment=require(_0x0128('0x4'));var BPromise=require(_0x0128('0x5'));var Mustache=require(_0x0128('0x6'));var util=require('util');var path=require(_0x0128('0x7'));var sox=require(_0x0128('0x8'));var csv=require(_0x0128('0x9'));var ejs=require(_0x0128('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0128('0xb'));var crypto=require(_0x0128('0xc'));var jsforce=require(_0x0128('0xd'));var deskjs=require(_0x0128('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0128('0x14'));var utils=require(_0x0128('0x15'));var config=require(_0x0128('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0128('0x17'))['db'];config['redis']=_[_0x0128('0x18')](config['redis'],{'host':_0x0128('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0128('0x1a')]));require('./userProfile.socket')[_0x0128('0x1b')](socket);function respondWithStatusCode(_0xdd7b60,_0x3f6a3c){_0x3f6a3c=_0x3f6a3c||0xcc;return function(_0x5a42eb){if(_0x5a42eb){return _0xdd7b60[_0x0128('0x1c')](_0x3f6a3c);}return _0xdd7b60[_0x0128('0x1d')](_0x3f6a3c)['end']();};}function respondWithResult(_0x46a5fd,_0x40ff84){_0x40ff84=_0x40ff84||0xc8;return function(_0x3300d4){if(_0x3300d4){return _0x46a5fd[_0x0128('0x1d')](_0x40ff84)[_0x0128('0x1e')](_0x3300d4);}};}function respondWithFilteredResult(_0x300554,_0x5bdc3e){return function(_0x2524b1){if(_0x2524b1){var _0x18a955=typeof _0x5bdc3e[_0x0128('0x1f')]===_0x0128('0x20')&&typeof _0x5bdc3e[_0x0128('0x21')]===_0x0128('0x20');var _0x5a8a8f=_0x2524b1[_0x0128('0x22')];var _0x2da481=_0x18a955?0x0:_0x5bdc3e['offset'];var _0x4ad121=_0x18a955?_0x2524b1[_0x0128('0x22')]:_0x5bdc3e[_0x0128('0x1f')]+_0x5bdc3e[_0x0128('0x21')];var _0x17949a;if(_0x4ad121>=_0x5a8a8f){_0x4ad121=_0x5a8a8f;_0x17949a=0xc8;}else{_0x17949a=0xce;}_0x300554[_0x0128('0x1d')](_0x17949a);return _0x300554[_0x0128('0x23')](_0x0128('0x24'),_0x2da481+'-'+_0x4ad121+'/'+_0x5a8a8f)[_0x0128('0x1e')](_0x2524b1);}return null;};}function patchUpdates(_0x544f5c){return function(_0x50f0d5){try{jsonpatch[_0x0128('0x25')](_0x50f0d5,_0x544f5c,!![]);}catch(_0x5c21e3){return BPromise[_0x0128('0x26')](_0x5c21e3);}return _0x50f0d5[_0x0128('0x27')]();};}function saveUpdates(_0x22f70c,_0x47d79d){return function(_0x135b8b){if(_0x135b8b){return _0x135b8b['update'](_0x22f70c)[_0x0128('0x28')](function(_0x1dc125){return _0x1dc125;});}return null;};}function removeEntity(_0x4190e2,_0x415073){return function(_0x4b0f88){if(_0x4b0f88){return _0x4b0f88['destroy']()[_0x0128('0x28')](function(){_0x4190e2[_0x0128('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1819,_0x976553){return function(_0x4ee634){if(!_0x4ee634){_0x2b1819[_0x0128('0x1c')](0x194);}return _0x4ee634;};}function handleError(_0x1e98a2,_0x2822ff){_0x2822ff=_0x2822ff||0x1f4;return function(_0x555b25){logger['error'](_0x555b25[_0x0128('0x29')]);if(_0x555b25['name']){delete _0x555b25['name'];}_0x1e98a2['status'](_0x2822ff)[_0x0128('0x2a')](_0x555b25);};}exports['index']=function(_0x4449b9,_0x2b9f40){var _0x345023={},_0x41f198={},_0x5a021f={'count':0x0,'rows':[]};var _0x24dad5=_[_0x0128('0x2b')](db[_0x0128('0x2c')][_0x0128('0x2d')],function(_0x59d8da){return{'name':_0x59d8da[_0x0128('0x2e')],'type':_0x59d8da[_0x0128('0x2f')][_0x0128('0x30')]};});_0x41f198[_0x0128('0x31')]=_[_0x0128('0x2b')](_0x24dad5,_0x0128('0x32'));_0x41f198[_0x0128('0x33')]=_['keys'](_0x4449b9['query']);_0x41f198['filters']=_[_0x0128('0x34')](_0x41f198[_0x0128('0x31')],_0x41f198[_0x0128('0x33')]);_0x345023['attributes']=_[_0x0128('0x34')](_0x41f198['model'],qs[_0x0128('0x35')](_0x4449b9[_0x0128('0x33')][_0x0128('0x35')]));_0x345023[_0x0128('0x36')]=_0x345023['attributes']['length']?_0x345023[_0x0128('0x36')]:_0x41f198[_0x0128('0x31')];if(!_0x4449b9[_0x0128('0x33')][_0x0128('0x37')]('nolimit')){_0x345023['limit']=qs[_0x0128('0x21')](_0x4449b9[_0x0128('0x33')][_0x0128('0x21')]);_0x345023[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x4449b9['query'][_0x0128('0x1f')]);}_0x345023[_0x0128('0x38')]=qs[_0x0128('0x39')](_0x4449b9['query']['sort']);_0x345023[_0x0128('0x3a')]=qs[_0x0128('0x3b')](_[_0x0128('0x3c')](_0x4449b9[_0x0128('0x33')],_0x41f198[_0x0128('0x3b')]),_0x24dad5);if(_0x4449b9['query'][_0x0128('0x3d')]){_0x345023[_0x0128('0x3a')]=_['merge'](_0x345023[_0x0128('0x3a')],{'$or':_[_0x0128('0x2b')](_0x24dad5,function(_0x53484b){if(_0x53484b[_0x0128('0x2f')]!=='VIRTUAL'){var _0x1fe8c8={};_0x1fe8c8[_0x53484b[_0x0128('0x32')]]={'$like':'%'+_0x4449b9[_0x0128('0x33')][_0x0128('0x3d')]+'%'};return _0x1fe8c8;}})});}_0x345023=_[_0x0128('0x3e')]({},_0x345023,_0x4449b9[_0x0128('0x3f')]);var _0x5bf361={'where':_0x345023['where']};return db[_0x0128('0x2c')]['count'](_0x5bf361)['then'](function(_0x2b9c3b){_0x5a021f['count']=_0x2b9c3b;if(_0x4449b9[_0x0128('0x33')][_0x0128('0x40')]){_0x345023[_0x0128('0x41')]=[{'all':!![]}];}return db[_0x0128('0x2c')][_0x0128('0x42')](_0x345023);})[_0x0128('0x28')](function(_0x22dd50){_0x5a021f[_0x0128('0x43')]=_0x22dd50;return _0x5a021f;})[_0x0128('0x28')](respondWithFilteredResult(_0x2b9f40,_0x345023))[_0x0128('0x44')](handleError(_0x2b9f40,null));};exports[_0x0128('0x45')]=function(_0x5a7270,_0x3a01dd){var _0x4e1b22={'raw':![],'where':{'id':_0x5a7270[_0x0128('0x46')]['id']}},_0x1b5514={};_0x1b5514['model']=_[_0x0128('0x47')](db[_0x0128('0x2c')][_0x0128('0x2d')]);_0x1b5514[_0x0128('0x33')]=_[_0x0128('0x47')](_0x5a7270['query']);_0x1b5514[_0x0128('0x3b')]=_[_0x0128('0x34')](_0x1b5514[_0x0128('0x31')],_0x1b5514[_0x0128('0x33')]);_0x4e1b22[_0x0128('0x36')]=_[_0x0128('0x34')](_0x1b5514[_0x0128('0x31')],qs[_0x0128('0x35')](_0x5a7270[_0x0128('0x33')]['fields']));_0x4e1b22[_0x0128('0x36')]=_0x4e1b22['attributes'][_0x0128('0x48')]?_0x4e1b22[_0x0128('0x36')]:_0x1b5514[_0x0128('0x31')];if(_0x5a7270[_0x0128('0x33')][_0x0128('0x40')]){_0x4e1b22[_0x0128('0x41')]=[{'all':!![]}];}_0x4e1b22=_[_0x0128('0x3e')]({},_0x4e1b22,_0x5a7270[_0x0128('0x3f')]);return db['UserProfile']['find'](_0x4e1b22)[_0x0128('0x28')](handleEntityNotFound(_0x3a01dd,null))[_0x0128('0x28')](respondWithResult(_0x3a01dd,null))['catch'](handleError(_0x3a01dd,null));};exports[_0x0128('0x49')]=function(_0x133c7f,_0x47d364){return db[_0x0128('0x2c')][_0x0128('0x49')](_0x133c7f[_0x0128('0x4a')],{})[_0x0128('0x28')](respondWithResult(_0x47d364,0xc9))['catch'](handleError(_0x47d364,null));};exports['clone']=function(_0x2ce604,_0x5051fa){var _0x315103={'where':{'id':_0x2ce604[_0x0128('0x46')]['id']}},_0x547143={};_0x547143[_0x0128('0x31')]=_[_0x0128('0x47')](db[_0x0128('0x2c')]['rawAttributes']);_0x315103[_0x0128('0x36')]=_[_0x0128('0x34')](_0x547143[_0x0128('0x31')],qs[_0x0128('0x35')](_0x2ce604[_0x0128('0x33')]['fields']));_0x315103[_0x0128('0x36')]=_0x315103[_0x0128('0x36')][_0x0128('0x48')]?_0x315103[_0x0128('0x36')]:_0x547143[_0x0128('0x31')];if(_0x2ce604['query']['includeAll']){_0x315103[_0x0128('0x41')]=[{'all':!![]}];}_0x315103=_['merge']({},_0x315103,_0x2ce604[_0x0128('0x3f')]);return db['UserProfile'][_0x0128('0x4b')](_0x315103)[_0x0128('0x28')](handleEntityNotFound(_0x5051fa,null))['then'](function(_0x59fd67){if(_0x59fd67){var _0x44a1ed=_0x59fd67[_0x0128('0x4c')]({'plain':!![]});_0x44a1ed=qs[_0x0128('0x4d')](_0x44a1ed,['id',_0x0128('0x4e'),'updatedAt',_0x0128('0x4f')]);_0x2ce604[_0x0128('0x4a')]=_[_0x0128('0x4d')](_0x2ce604[_0x0128('0x4a')],['id',_0x0128('0x4e'),'updatedAt']);return db['sequelize'][_0x0128('0x50')](function(_0x21a695){return db['UserProfile'][_0x0128('0x49')](_[_0x0128('0x3e')](_0x44a1ed,_0x2ce604['body']),{'include':_0x2ce604[_0x0128('0x33')][_0x0128('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x21a695})[_0x0128('0x28')](function(_0x1daf5f){var _0x3160ad=_0x1daf5f[_0x0128('0x4c')]({'plain':!![]});return db[_0x0128('0x51')]['findAll']({'where':{'userProfileId':_0x2ce604['params']['id']},'raw':!![]})[_0x0128('0x28')](function(_0x363c7f){if(_0x363c7f){return BPromise[_0x0128('0x52')](_0x363c7f,function(_0x3ec069){return new BPromise(function(_0x260ee3,_0x2036b7){if(_0x3ec069[_0x0128('0x53')]===null||_0x3ec069[_0x0128('0x53')]===0x1)_0x260ee3(null);return db[_0x0128('0x54')][_0x0128('0x42')]({'where':{'sectionId':_0x3ec069['id']},'raw':!![]})[_0x0128('0x28')](function(_0x5b91db){var _0x400c1d=_[_0x0128('0x2b')](_0x5b91db,function(_0x310ee6){return qs[_0x0128('0x4d')](_0x310ee6,['id',_0x0128('0x4e'),'updatedAt','sectionId']);});_0x260ee3(_0x400c1d);})['catch'](function(_0x3e3c2e){_0x2036b7(_0x3e3c2e);});})[_0x0128('0x28')](function(_0x287849){var _0x3dae17=qs[_0x0128('0x4d')](_0x3ec069,['id',_0x0128('0x4e'),'updatedAt']);_0x3dae17[_0x0128('0x55')]=_0x3160ad['id'];if(_0x287849)_0x3dae17[_0x0128('0x56')]=_0x287849;return _0x3dae17;})[_0x0128('0x28')](function(_0x4c86e6){return db['UserProfileSection'][_0x0128('0x49')](_0x4c86e6,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x21a695});});})[_0x0128('0x28')](function(){return _0x3160ad;});}});});});}})['then'](respondWithResult(_0x5051fa,0xc9))['catch'](handleError(_0x5051fa,null));};exports[_0x0128('0x57')]=function(_0x19c9f6,_0x10ac95){if(_0x19c9f6[_0x0128('0x4a')]['id']){delete _0x19c9f6[_0x0128('0x4a')]['id'];}return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0x19c9f6[_0x0128('0x46')]['id']}})['then'](handleEntityNotFound(_0x10ac95,null))[_0x0128('0x28')](saveUpdates(_0x19c9f6[_0x0128('0x4a')],null))[_0x0128('0x28')](respondWithResult(_0x10ac95,null))[_0x0128('0x44')](handleError(_0x10ac95,null));};exports['destroy']=function(_0xccaac0,_0x2bd313){return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0xccaac0['params']['id']}})[_0x0128('0x28')](handleEntityNotFound(_0x2bd313,null))[_0x0128('0x28')](removeEntity(_0x2bd313,null))[_0x0128('0x44')](handleError(_0x2bd313,null));};exports[_0x0128('0x58')]=function(_0x3397e3,_0x210cdb){return db[_0x0128('0x2c')][_0x0128('0x58')]()['then'](respondWithResult(_0x210cdb,null))[_0x0128('0x44')](handleError(_0x210cdb,null));};exports['addSections']=function(_0x5355ad,_0x47814a){var _0x37791d=_0x5355ad[_0x0128('0x4a')];return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0x5355ad['params']['id']}})['then'](handleEntityNotFound(_0x47814a,null))['then'](function(_0x4bc2b6){if(_0x4bc2b6){return db[_0x0128('0x59')]['transaction'](function(_0x5f44d7){return db[_0x0128('0x51')][_0x0128('0x5a')]({'where':{'userProfileId':_0x5355ad['params']['id'],'sectionId':_[_0x0128('0x2b')](_0x37791d,function(_0x5bb236){return _0x5bb236['sectionId'];})},'transaction':_0x5f44d7})[_0x0128('0x28')](function(){var _0x1efe55=_['map'](_0x37791d,function(_0x1f406f){_0x1f406f['userProfileId']=_0x5355ad[_0x0128('0x46')]['id'];return _0x1f406f;});var _0x32f0ee=[];return BPromise['each'](_0x1efe55,function(_0x565fde){return db[_0x0128('0x51')][_0x0128('0x49')](_0x565fde,{'include':[{'model':db['UserProfileResource'],'as':_0x0128('0x56')}],'raw':!![],'transaction':_0x5f44d7})[_0x0128('0x28')](function(_0x20623a){_0x32f0ee[_0x0128('0x5b')](_0x20623a[_0x0128('0x4c')]({'plain':!![]}));});})[_0x0128('0x28')](function(){return _0x32f0ee;});});});}})[_0x0128('0x28')](function(_0x58acb8){return _0x58acb8;})[_0x0128('0x28')](respondWithResult(_0x47814a,null))[_0x0128('0x44')](handleError(_0x47814a,null));};exports[_0x0128('0x5c')]=function(_0x1ff859,_0x3a8df6){var _0x59ed04;return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0x1ff859['params']['id']},'attributes':['id',_0x0128('0x32')]})['then'](handleEntityNotFound(_0x3a8df6,null))['then'](function(_0x2bd382){if(_0x2bd382){_0x59ed04=_0x2bd382;return db[_0x0128('0x51')][_0x0128('0x5a')]({'where':{'userProfileId':_0x1ff859['params']['id'],'sectionId':_0x1ff859[_0x0128('0x33')]['ids']}});}})[_0x0128('0x28')](function(){return _0x59ed04;})[_0x0128('0x28')](respondWithStatusCode(_0x3a8df6,null))[_0x0128('0x44')](handleError(_0x3a8df6,null));};exports[_0x0128('0x5d')]=function(_0x399434,_0x4462a6){var _0x4d5df2=[];var _0x3f8e78=[];return db[_0x0128('0x51')][_0x0128('0x42')]({'where':{'userProfileId':_0x399434[_0x0128('0x46')]['id']},'raw':!![]})['then'](function(_0x59fed9){_0x4d5df2=_[_0x0128('0x3d')](_0x59fed9,function(_0x30f0e2){return _0x30f0e2[_0x0128('0x5e')]===0x1||_[_0x0128('0x5f')]([0x3eb,0x709],_0x30f0e2[_0x0128('0x60')]);});if(!_[_0x0128('0x61')](_0x4d5df2)){return _['map'](_0x4d5df2,function(_0x101e0e){return _0x101e0e['sectionId'];});}else{return;}})[_0x0128('0x28')](function(_0x270421){if(_0x270421)_0x3f8e78=_0x270421;if(_[_0x0128('0x5f')](_0x3f8e78,0x64)){var _0x58190b=_['find'](_0x4d5df2,{'sectionId':0x64});return hasDefaultDashboard(_0x58190b)['then'](function(_0x58acaf){return _[_0x0128('0x2b')](_0x4d5df2,function(_0xa9d84f){if(_0xa9d84f[_0x0128('0x60')]===0x64){_0xa9d84f[_0x0128('0x62')]=_0x58acaf;}return _0xa9d84f;});});}else{return;}})['then'](function(_0xea53a7){if(_0xea53a7)_0x4d5df2=_0xea53a7;if(_[_0x0128('0x5f')](_0x3f8e78,0x3eb)){var _0x57eeaf=_[_0x0128('0x4b')](_0x4d5df2,{'sectionId':0x3eb});return getCustomDashboards(_0x57eeaf)[_0x0128('0x28')](function(_0x2440bb){return _[_0x0128('0x2b')](_0x4d5df2,function(_0x27886f){if(_0x57eeaf[_0x0128('0x5e')]){if(_0x27886f[_0x0128('0x60')]===0x3eb){_0x27886f[_0x0128('0x62')]=_0x2440bb;}}else{if(_0x27886f[_0x0128('0x60')]===0x64){_0x27886f[_0x0128('0x62')]=_0x2440bb;}}return _0x27886f;});});}else{return;}})['then'](function(_0x1330b8){if(_0x1330b8)_0x4d5df2=_0x1330b8;if(_[_0x0128('0x5f')](_0x3f8e78,0x709)){var _0x353143=_['find'](_0x4d5df2,{'sectionId':0x709});return getPlugins(_0x353143)[_0x0128('0x28')](function(_0x2a06df){if(_0x353143[_0x0128('0x5e')]){return _['map'](_0x4d5df2,function(_0x17fe75){if(_0x17fe75['sectionId']===0x709){_0x17fe75[_0x0128('0x62')]=_0x2a06df;}return _0x17fe75;});}else{var _0x3da8f2={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2a06df};var _0xe7eee8=_['map'](_0x4d5df2);_0xe7eee8[_0x0128('0x5b')](_0x3da8f2);return _0xe7eee8;}});}else{return;}})[_0x0128('0x28')](function(_0x4a3769){if(_0x4a3769)_0x4d5df2=_0x4a3769;return _['filter'](_0x4d5df2,['enabled',0x1]);})[_0x0128('0x28')](respondWithResult(_0x4462a6,null))[_0x0128('0x44')](handleError(_0x4462a6,null));};function hasDefaultDashboard(_0x5b9ea7){var _0x2bf836=[0x65];return new BPromise(function(_0x13aa70,_0x31da4d){try{if(_0x5b9ea7[_0x0128('0x53')]){_0x13aa70(_0x2bf836);}else{return db[_0x0128('0x54')]['findOne']({'where':{'sectionId':_0x5b9ea7['id']},'raw':!![]})[_0x0128('0x28')](function(_0x54662d){_0x54662d?_0x13aa70(_0x2bf836):_0x13aa70();});}}catch(_0x2df0e7){_0x31da4d(_0x2df0e7);}});}function getCustomDashboards(_0x40be0b){var _0x3a4c78=[];return new BPromise(function(_0x50958b,_0x102ab7){try{if(_0x40be0b[_0x0128('0x53')]){return db[_0x0128('0x63')][_0x0128('0x42')]({'raw':!![]})['then'](function(_0x5cdbe6){_0x5cdbe6[_0x0128('0x64')](function(_0x52684d){_0x3a4c78[_0x0128('0x5b')](_0x52684d['id']+0x1869f);});_0x50958b(_0x3a4c78);});}else{return db[_0x0128('0x54')][_0x0128('0x42')]({'where':{'sectionId':_0x40be0b['id']},'raw':!![]})['then'](function(_0x3ae7c5){_0x3ae7c5[_0x0128('0x64')](function(_0xe4b4d7){_0x3a4c78[_0x0128('0x5b')](_0xe4b4d7[_0x0128('0x65')]+0x1869f);});_0x50958b(_0x3a4c78);});}}catch(_0x21c955){_0x102ab7(_0x21c955);}});}function getPlugins(_0x60d60b){var _0x18d712=[];return new BPromise(function(_0x1aa805,_0x294307){try{if(_0x60d60b[_0x0128('0x53')]){return db[_0x0128('0x66')][_0x0128('0x42')]({'raw':!![]})[_0x0128('0x28')](function(_0x36e695){_0x36e695[_0x0128('0x64')](function(_0x36cb65){_0x18d712[_0x0128('0x5b')](_0x36cb65['id']+0x15b38);});_0x1aa805(_0x18d712);});}else{return db[_0x0128('0x54')]['findAll']({'where':{'sectionId':_0x60d60b['id']},'raw':!![]})[_0x0128('0x28')](function(_0x4fa18c){_0x4fa18c['forEach'](function(_0x20d231){_0x18d712['push'](_0x20d231[_0x0128('0x65')]+0x15b38);});_0x1aa805(_0x18d712);});}}catch(_0x561663){_0x294307(_0x561663);}});}exports[_0x0128('0x67')]=function(_0x26f422,_0x35111e){return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0x26f422['params']['id']}})['then'](handleEntityNotFound(_0x35111e,null))[_0x0128('0x28')](function(_0x1c6961){if(_0x1c6961){return db[_0x0128('0x59')][_0x0128('0x50')](function(_0x9a7ea3){return db[_0x0128('0x51')]['findAll']({'where':{'userProfileId':_0x26f422[_0x0128('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x33a72b){if(_0x33a72b){return db[_0x0128('0x51')][_0x0128('0x5a')]({'where':{'userProfileId':_0x26f422[_0x0128('0x46')]['id'],'id':_[_0x0128('0x2b')](_0x33a72b,function(_0x312308){return _0x312308['id'];})},'transaction':_0x9a7ea3});}})[_0x0128('0x28')](function(_0xc2de79){var _0x580cce=_[_0x0128('0x2b')](_0x26f422[_0x0128('0x4a')],function(_0x1f53a1){_0x1f53a1[_0x0128('0x55')]=_0x26f422[_0x0128('0x46')]['id'];return _0x1f53a1;});return db[_0x0128('0x51')][_0x0128('0x68')](_0x580cce,{'raw':!![],'transaction':_0x9a7ea3});})[_0x0128('0x28')](function(_0x56390a){var _0x10a7cd=_[_0x0128('0x3d')](_[_0x0128('0x2b')](_0x56390a,function(_0x23d67b){return _0x23d67b[_0x0128('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x10a7cd){return db[_0x0128('0x51')]['findAll']({'where':{'userProfileId':_0x26f422[_0x0128('0x46')]['id'],'sectionId':_['map'](_0x10a7cd,function(_0x5bd9ef){return _0x5bd9ef[_0x0128('0x60')];})},'attributes':['id',_0x0128('0x60')],'raw':!![]})[_0x0128('0x28')](function(_0x5d4cd9){var _0x2ce064=_[_0x0128('0x2b')](_0x26f422[_0x0128('0x4a')],function(_0x3dae91){_0x3dae91[_0x0128('0x55')]=_0x26f422[_0x0128('0x46')]['id'];return _0x3dae91;});return db[_0x0128('0x54')][_0x0128('0x68')](_0x2ce064,{'raw':!![],'transaction':_0x9a7ea3});});}})['catch'](handleError(_0x35111e,null));});}})[_0x0128('0x28')](function(_0x4639c0){var _0x5ee1ee=_['map'](_0x4639c0,function(_0x3079f9){return _0x3079f9[_0x0128('0x4c')]({'plain':!![]});});})['then'](respondWithResult(_0x35111e,null))[_0x0128('0x44')](handleError(_0x35111e,null));};exports[_0x0128('0x69')]=function(_0x373fe0,_0x4ee7dd,_0x7a04f4){return db[_0x0128('0x2c')][_0x0128('0x4b')]({'where':{'id':_0x373fe0[_0x0128('0x46')]['id']}})[_0x0128('0x28')](handleEntityNotFound(_0x4ee7dd,null))['then'](function(_0xf759f8){if(_0xf759f8){return _0xf759f8[_0x0128('0x69')](_0x373fe0[_0x0128('0x33')][_0x0128('0x6a')]);}})[_0x0128('0x28')](respondWithStatusCode(_0x4ee7dd,null))['catch'](handleError(_0x4ee7dd,null));};exports[_0x0128('0x6b')]=function(_0x5e3ca9,_0x395cdc){var _0xc74099={};if(!_0x5e3ca9[_0x0128('0x33')][_0x0128('0x6c')])throw new Error(_0x0128('0x6d'));if(!_0x5e3ca9[_0x0128('0x33')][_0x0128('0x37')](_0x0128('0x6e'))){_0xc74099[_0x0128('0x21')]=qs[_0x0128('0x21')](_0x5e3ca9[_0x0128('0x33')][_0x0128('0x21')]);_0xc74099[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x5e3ca9[_0x0128('0x33')][_0x0128('0x1f')]);}return db[_0x0128('0x2c')]['find']({'where':{'id':_0x5e3ca9['params']['id']}})[_0x0128('0x28')](function(_0x214d60){if(!_0x214d60)throw new Error(_0x0128('0x6f')+_0x5e3ca9[_0x0128('0x46')]['id']);return db[_0x0128('0x2c')][_0x0128('0x6b')](_0x5e3ca9);})[_0x0128('0x28')](respondWithFilteredResult(_0x395cdc,_0xc74099))[_0x0128('0x44')](handleError(_0x395cdc,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9eb3c83..4fa5780 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 _0x5f6f=['../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x25885a,_0x599750){var _0x14c55a=function(_0x3cfbdd){while(--_0x3cfbdd){_0x25885a['push'](_0x25885a['shift']());}};_0x14c55a(++_0x599750);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0x5f6f[_0x4bfe08];return _0x1f9125;};'use strict';var EventEmitter=require(_0xf5f6('0x0'));var UserProfile=require(_0xf5f6('0x1'))['db'][_0xf5f6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf5f6('0x3')](0x0);var events={'afterCreate':_0xf5f6('0x4'),'afterUpdate':'update','afterDestroy':_0xf5f6('0x5')};function emitEvent(_0x438699){return function(_0x2f2e00,_0x58028b,_0x3dd995){UserProfileEvents[_0xf5f6('0x6')](_0x438699+':'+_0x2f2e00['id'],_0x2f2e00);UserProfileEvents[_0xf5f6('0x6')](_0x438699,_0x2f2e00);_0x3dd995(null);};}for(var e in events){if(events[_0xf5f6('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x7880=['exports','events','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7880,0x10f));var _0x0788=function(_0x272d97,_0x3cb745){_0x272d97=_0x272d97-0x0;var _0x40fc01=_0x7880[_0x272d97];return _0x40fc01;};'use strict';var EventEmitter=require(_0x0788('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x0788('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0788('0x2')](0x0);var events={'afterCreate':_0x0788('0x3'),'afterUpdate':_0x0788('0x4'),'afterDestroy':_0x0788('0x5')};function emitEvent(_0x509799){return function(_0x563529,_0x10143c,_0x487b5b){UserProfileEvents[_0x0788('0x6')](_0x509799+':'+_0x563529['id'],_0x563529);UserProfileEvents[_0x0788('0x6')](_0x509799,_0x563529);_0x487b5b(null);};}for(var e in events){if(events[_0x0788('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x0788('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7bee38a..955a478 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 _0x5fab=['whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','then','catch','model','associatedResources','map','UserProfileResource','type','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projects','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','VoiceRecording','Agents','name','membername','role','agent','Telephones','User','telephone','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceChanSpy','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueues','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','section','Invalid\x20section\x20\x27','find','params','ignore','isEmpty','union','length','push','all','rawAttributes','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','filters','merge','key','VIRTUAL','foreignKey','forEach','options','AnalyticExtractedReport','includeAll','include','reportType','default','DefaultReports','count','Tags','color','tag','ThroughTags','openTabs','true','rows','chat','sms','dataValues','fax','mail'];(function(_0x51f454,_0x10ef05){var _0x2122bd=function(_0x476f72){while(--_0x476f72){_0x51f454['push'](_0x51f454['shift']());}};_0x2122bd(++_0x10ef05);}(_0x5fab,0x177));var _0xb5fa=function(_0x14a513,_0x3239f){_0x14a513=_0x14a513-0x0;var _0x47236c=_0x5fab[_0x14a513];return _0x47236c;};'use strict';var _=require(_0xb5fa('0x0'));var attributes=require(_0xb5fa('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xb5fa('0x2'));module[_0xb5fa('0x3')]=function(_0x3fc227){var _0x316ad0=_0x3fc227[_0xb5fa('0x4')];function _0x595d8b(_0x29390a,_0x4341d3){return new Promise(function(_0x10361d,_0x44df89){if(!_0x4341d3)return _0x10361d(null);var _0x4a0249=_0x4341d3['filter']?{[_0x4341d3[_0xb5fa('0x5')][_0xb5fa('0x6')]]:_0x4341d3[_0xb5fa('0x5')]['value']}:undefined;return _0x316ad0[_0x29390a][_0xb5fa('0x7')]({'where':_0x4a0249,'raw':!![]})[_0xb5fa('0x8')](function(_0x2cf4a5){_0x4341d3['associatedResources']=_['map'](_0x2cf4a5,'id');_0x10361d(_0x4341d3);})[_0xb5fa('0x9')](function(_0x23d124){_0x44df89(_0x23d124);});});}function _0xe46b26(_0x44e6c8,_0x35ad13){return new Promise(function(_0xadef41,_0x65c6b6){var _0x46da66=_0x44e6c8[_0xb5fa('0x5')]?{[_0x44e6c8['filter'][_0xb5fa('0x6')]]:_0x44e6c8[_0xb5fa('0x5')]['value']}:undefined;return _0x316ad0[_0x44e6c8[_0xb5fa('0xa')]]['findAll']({'where':_0x46da66,'raw':!![]})[_0xb5fa('0x8')](function(_0x3fc372){_0x35ad13[_0xb5fa('0xb')]=_[_0xb5fa('0xc')](_0x3fc372,function(_0x8e9d1c){return _0x8e9d1c['name'];});_0xadef41(_0x35ad13);})['catch'](function(_0x38e964){_0x65c6b6(_0x38e964);});});}function _0x587043(_0x31f252,_0x27c8f7,_0x56fe10){if(!_0x27c8f7)return Promise['resolve'](null);return new Promise(function(_0x451a55,_0x1f7f05){return _0x316ad0[_0xb5fa('0xd')][_0xb5fa('0x7')]({'where':{'sectionId':_0x27c8f7['id']},'raw':!![]})[_0xb5fa('0x8')](function(_0x13e82b){if(_0x31f252[_0xb5fa('0x6')]&&_0x31f252[_0xb5fa('0x6')]!=='id'){_0x27c8f7[_0xb5fa('0xb')]=_[_0xb5fa('0xc')](_0x13e82b,function(_0x3c8d53){return _0x3c8d53[_0x31f252[_0xb5fa('0x6')]];});}else{if(_0x56fe10==='AnalyticExtractedReport'){_0x27c8f7[_0xb5fa('0xb')]=_['map'](_0x13e82b,function(_0x37ae06){return{'id':_0x37ae06['resourceId'],'type':_0x37ae06[_0xb5fa('0xe')]};});}else{_0x27c8f7[_0xb5fa('0xb')]=_['map'](_0x13e82b,function(_0x40dfdf){return _0x40dfdf[_0xb5fa('0xf')];});}}_0x451a55(_0x27c8f7);})[_0xb5fa('0x9')](function(_0x47f71a){_0x1f7f05(_0x47f71a);});});}function _0x32a85c(_0xec108f,_0x444237){var _0x542348={'parentSections':[]};switch(_0xec108f[_0xb5fa('0x10')]()){case'squareprojects':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x12');break;case _0xb5fa('0x13'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x14');break;case _0xb5fa('0x15'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x16');_0x542348['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case _0xb5fa('0x17'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x18');break;case _0xb5fa('0x19'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x1a');_0x542348[_0xb5fa('0x1b')]=[{'name':_0xb5fa('0x1c'),'field':'id','foreignKey':_0xb5fa('0x1d')}];break;case _0xb5fa('0x1e'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x1f');break;case _0xb5fa('0x20'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x21');break;case _0xb5fa('0x22'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x23');break;case _0xb5fa('0x24'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x25');break;case _0xb5fa('0x26'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x27');break;case'faxqueues':_0x542348[_0xb5fa('0x11')]='FaxQueue';break;case'faxaccounts':_0x542348['childModel']=_0xb5fa('0x28');break;case'inboundroutes':case _0xb5fa('0x29'):case'outboundroutes':_0x542348['childModel']=_0xb5fa('0x2a');break;case _0xb5fa('0x2b'):_0x542348['childModel']='VoiceContext';break;case _0xb5fa('0x2c'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x2d');break;case'voicerecordings':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x2e');_0x542348['parentSections']=[{'name':_0xb5fa('0x2f'),'field':_0xb5fa('0x30'),'foreignKey':_0xb5fa('0x31'),'model':'User','filter':{'field':_0xb5fa('0x32'),'value':[_0xb5fa('0x33')]}},{'name':_0xb5fa('0x34'),'field':'name','foreignKey':_0xb5fa('0x31'),'model':_0xb5fa('0x35'),'filter':{'field':_0xb5fa('0x32'),'value':[_0xb5fa('0x36')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0xb5fa('0x37'),'field':'name','foreignKey':_0xb5fa('0x38'),'model':_0xb5fa('0x39'),'filter':{'field':_0xb5fa('0xe'),'value':[_0xb5fa('0x3a')]}}];break;case _0xb5fa('0x3b'):_0x542348[_0xb5fa('0x11')]='VoiceMusicOnHold';break;case'chanspies':_0x542348['childModel']=_0xb5fa('0x3c');break;case'voiceprefixes':_0x542348[_0xb5fa('0x11')]='VoicePrefix';break;case'ivrcampaigns':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x3d');break;case _0xb5fa('0x3e'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x3f');break;case _0xb5fa('0x40'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x41');break;case _0xb5fa('0x42'):_0x542348[_0xb5fa('0x11')]='MailSubstatus';break;case _0xb5fa('0x43'):_0x542348['childModel']=_0xb5fa('0x44');break;case _0xb5fa('0x45'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x46');break;case _0xb5fa('0x47'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x48');break;case _0xb5fa('0x49'):_0x542348['childModel']=_0xb5fa('0x4a');break;case _0xb5fa('0x4b'):_0x542348['childModel']=_0xb5fa('0x4c');break;case'whatsappaccounts':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x4d');break;case'teams':_0x542348['childModel']=_0xb5fa('0x4e');break;case _0xb5fa('0x4f'):case _0xb5fa('0x50'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x39');if(_0x444237){_0x542348[_0xb5fa('0x1b')]=[{'name':_0xb5fa('0x51')},{'name':_0xb5fa('0x37')}];}break;case'users':case _0xb5fa('0x52'):case _0xb5fa('0x53'):_0x542348['childModel']=_0xb5fa('0x35');if(_0x444237){_0x542348[_0xb5fa('0x1b')]=[{'name':_0xb5fa('0x54'),'filter':{'field':_0xb5fa('0x32'),'value':[_0xb5fa('0x55'),_0xb5fa('0x56')]},'ignore':!![]},{'name':_0xb5fa('0x2f')},{'name':_0xb5fa('0x34')}];}break;case _0xb5fa('0x57'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x58');break;case _0xb5fa('0x59'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x5a');break;case _0xb5fa('0x5b'):_0x542348[_0xb5fa('0x11')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x542348[_0xb5fa('0x11')]='SugarcrmAccount';break;case _0xb5fa('0x5c'):_0x542348[_0xb5fa('0x11')]='DeskAccount';break;case _0xb5fa('0x5d'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x5e');break;case _0xb5fa('0x5f'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x35');break;case'cannedanswers':_0x542348[_0xb5fa('0x11')]='CannedAnswer';break;case _0xb5fa('0x60'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x61');break;case'customdashboards':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x62');break;case'intervals':_0x542348['childModel']=_0xb5fa('0x63');break;case _0xb5fa('0x64'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x65');break;case _0xb5fa('0x66'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x67');break;case _0xb5fa('0x68'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x69');break;case _0xb5fa('0x6a'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x6b');break;case _0xb5fa('0x6c'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x6d');break;case _0xb5fa('0x6e'):_0x542348[_0xb5fa('0x11')]='Trigger';break;case _0xb5fa('0x6f'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x70');break;case _0xb5fa('0x71'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x72');break;case _0xb5fa('0x73'):_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x74');break;case _0xb5fa('0x75'):_0x542348['childModel']='AnalyticExtractedReport';_0x542348[_0xb5fa('0x1b')]=[{'name':_0xb5fa('0x76'),'field':'id','foreignKey':_0xb5fa('0x77')}];break;case'metrics':_0x542348[_0xb5fa('0x11')]=_0xb5fa('0x78');break;}return _0x542348;}function _0x1572fb(_0x2e855c,_0x31ab22){var _0x9d12f1=_0x2e855c[_0xb5fa('0x79')](0x0)['toUpperCase']()+_0x2e855c[_0xb5fa('0x7a')](0x1);var _0x4611f3={'type':_0x316ad0['Sequelize'][_0xb5fa('0x7b')][_0xb5fa('0x7c')],'raw':!![]};return new Promise(function(_0x540295,_0xd94224){var _0x3ae802=squel[_0xb5fa('0x7d')]()[_0xb5fa('0x6')](_0xb5fa('0x7e')+_0x9d12f1+_0xb5fa('0x7f'),'id')[_0xb5fa('0x6')](_0xb5fa('0x80'))[_0xb5fa('0x81')](_0xb5fa('0x82')+_0x2e855c+_0xb5fa('0x83'),'ui')[_0xb5fa('0x84')](_0xb5fa('0x85'),_0x31ab22['id']);return _0x316ad0[_0xb5fa('0x86')][_0xb5fa('0x87')](_0x3ae802[_0xb5fa('0x88')](),_0x4611f3)[_0xb5fa('0x8')](function(_0x23fb01){_0x31ab22[_0x9d12f1+_0xb5fa('0x89')]=_0x23fb01;_0x540295(_0x23fb01);})[_0xb5fa('0x9')](function(_0x421a93){_0xd94224(_0x421a93);});});}return _0x3fc227[_0xb5fa('0x8a')]('UserProfile',attributes,{'tableName':_0xb5fa('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x34ebd0){var _0x43692b={'raw':![],'where':{}};var _0x580d1a={};var _0x32ab33={'count':0x0,'rows':[]};var _0x2d786e=_0x34ebd0['query'][_0xb5fa('0x8c')];var _0xb535c3=_0x34ebd0[_0xb5fa('0x87')]['mergeResources']||![];var _0x5c93a0=_0x32a85c(_0x2d786e,_0xb535c3);if(!_0x5c93a0[_0xb5fa('0x11')])throw new Error(_0xb5fa('0x8d')+_0x2d786e+'\x27');var _0x432f04=[{'name':_0x2d786e}];if(!_['isEmpty'](_0x5c93a0[_0xb5fa('0x1b')]))_0x432f04=_0x5c93a0[_0xb5fa('0x1b')];var _0x199555=[];for(var _0x12b0a2=0x0;_0x12b0a2<_0x432f04['length'];_0x12b0a2++){_0x199555['push'](_0x316ad0['UserProfileSection'][_0xb5fa('0x8e')]({'where':{'userProfileId':_0x34ebd0[_0xb5fa('0x8f')]['id'],'name':_0x432f04[_0x12b0a2][_0xb5fa('0x30')]},'raw':!![]}));}return Promise['all'](_0x199555)[_0xb5fa('0x8')](function(_0x29f65b){var _0x13ef3a=_[_0xb5fa('0x5')](_0x29f65b,function(_0x2a1872){return _0x2a1872?_0x2a1872:undefined;});var _0x36b709=_[_0xb5fa('0x5')](_0x432f04,[_0xb5fa('0x90'),!![]]);var _0x35eeb9=_[_0xb5fa('0x91')](_0x13ef3a)&&_[_0xb5fa('0x91')](_0x36b709)?null:_[_0xb5fa('0x92')](_0x36b709,_0x13ef3a);if(!_0x35eeb9)return null;var _0xecdff3=[];for(var _0x38faa6=0x0;_0x38faa6<_0x35eeb9[_0xb5fa('0x93')];_0x38faa6++){var _0x5eeaa1=_[_0xb5fa('0x8e')](_0x432f04,function(_0x5a6f74){return _0x35eeb9[_0x38faa6]?_0x5a6f74[_0xb5fa('0x30')]===_0x35eeb9[_0x38faa6][_0xb5fa('0x30')]:null;});if(_0x5eeaa1){if(_0x35eeb9[_0x38faa6][_0xb5fa('0x90')]){_0xecdff3[_0xb5fa('0x94')](_0x595d8b(_0x5c93a0[_0xb5fa('0x11')],_0x35eeb9[_0x38faa6]));}else{if(!_0x35eeb9[_0x38faa6]['autoAssociation']){_0xecdff3[_0xb5fa('0x94')](_0x587043(_0x5eeaa1,_0x35eeb9[_0x38faa6],_0x5c93a0['childModel']));}else{if(_0x5eeaa1[_0xb5fa('0xa')]){_0xecdff3[_0xb5fa('0x94')](_0xe46b26(_0x5eeaa1,_0x35eeb9[_0x38faa6]));}}}}}return Promise[_0xb5fa('0x95')](_0xecdff3);})[_0xb5fa('0x8')](function(_0x5e44d8){var _0x4d1117=_0x5e44d8;var _0x59920c=null;if(_0x4d1117){_0x59920c=_0x4d1117[_0xb5fa('0x93')]===0x1?_0x4d1117[0x0]:null;}if(!_0x59920c&&!_0x4d1117)return _0x32ab33;var _0x885acb=_0x316ad0[_0x5c93a0[_0xb5fa('0x11')]][_0xb5fa('0x96')];_0x580d1a[_0xb5fa('0xa')]=_[_0xb5fa('0x97')](_0x885acb);_0x580d1a['query']=_[_0xb5fa('0x97')](_0x34ebd0['query']);_0x580d1a['filters']=_[_0xb5fa('0x98')](_0x580d1a['model'],_0x580d1a['query']);_0x43692b['attributes']=_[_0xb5fa('0x98')](_0x580d1a['model'],qs[_0xb5fa('0x99')](_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0x99')]));_0x43692b['attributes']=_0x43692b['attributes'][_0xb5fa('0x93')]?_0x43692b[_0xb5fa('0x9a')]:_0x580d1a['model'];if(!_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0x9b')](_0xb5fa('0x9c'))){_0x43692b[_0xb5fa('0x9d')]=qs['limit'](_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0x9d')]);_0x43692b[_0xb5fa('0x9e')]=qs[_0xb5fa('0x9e')](_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0x9e')]);}_0x43692b[_0xb5fa('0x9f')]=qs['sort'](_0x34ebd0[_0xb5fa('0x87')]['sort']);_0x43692b[_0xb5fa('0x84')]=qs[_0xb5fa('0xa0')](_['pick'](_0x34ebd0[_0xb5fa('0x87')],_0x580d1a[_0xb5fa('0xa0')]));if(_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0x5')]){_0x43692b[_0xb5fa('0x84')]=_[_0xb5fa('0xa1')](_0x43692b[_0xb5fa('0x84')],{'$or':_[_0xb5fa('0xc')](_0x885acb,function(_0x4b1135){if(_0x4b1135[_0xb5fa('0xe')][_0xb5fa('0xa2')]!==_0xb5fa('0xa3')){var _0x20ffa1={};_0x20ffa1[_0x4b1135['field']]={'$like':'%'+_0x34ebd0['query']['filter']+'%'};return _0x20ffa1;}})});}var _0x5557a3=[];var _0x1c60bd=null;var _0x1e607b={};if(_0x59920c){_0x1c60bd=_[_0xb5fa('0x8e')](_0x432f04,[_0xb5fa('0x30'),_0x59920c['name']]);if(_0x1c60bd['field']){_0x1e607b={};if(_0x5c93a0[_0xb5fa('0x11')]==='AnalyticExtractedReport'){_0x1e607b[_0x1c60bd[_0xb5fa('0xa4')]]=_[_0xb5fa('0xc')](_0x59920c[_0xb5fa('0xb')],'id');}else{_0x1e607b[_0x1c60bd[_0xb5fa('0xa4')]]=_0x59920c['associatedResources'];}_0x5557a3[_0xb5fa('0x94')](_0x1e607b);}else{_0x43692b['where']['id']=_0x59920c[_0xb5fa('0xb')];}}else{for(var _0x3b17cf=0x0;_0x3b17cf<_0x4d1117['length'];_0x3b17cf++){_0x1c60bd=_['find'](_0x432f04,[_0xb5fa('0x30'),_0x4d1117[_0x3b17cf][_0xb5fa('0x30')]]);if(_0x1c60bd[_0xb5fa('0x6')]){_0x1e607b={};_0x1e607b[_0x1c60bd[_0xb5fa('0xa4')]]=_0x4d1117[_0x3b17cf][_0xb5fa('0xb')];_0x5557a3[_0xb5fa('0x94')](_0x1e607b);}else{if(!_0x43692b[_0xb5fa('0x84')]['id'])_0x43692b[_0xb5fa('0x84')]['id']=[];_0x4d1117[_0x3b17cf][_0xb5fa('0xb')][_0xb5fa('0xa5')](function(_0x316a06){_0x43692b[_0xb5fa('0x84')]['id'][_0xb5fa('0x94')](_0x316a06);});}}}if(!_['isEmpty'](_0x5557a3)){_0x43692b['where']=_[_0xb5fa('0xa1')](_0x43692b['where'],{'$and':{'$or':_0x5557a3}});}_0x43692b=_[_0xb5fa('0xa1')]({},_0x43692b,_0x34ebd0[_0xb5fa('0xa6')]);if(_0x59920c&&!_0x59920c['autoAssociation']&&_0x5c93a0[_0xb5fa('0x11')]===_0xb5fa('0xa7')){if(_0x34ebd0['query'][_0xb5fa('0xa8')]){_0x43692b[_0xb5fa('0xa9')]=[{'all':!![]}];}return _0x316ad0[_0x5c93a0['childModel']][_0xb5fa('0x7')](_0x43692b)[_0xb5fa('0x8')](function(_0x367593){var _0x5a358d=[];_0x367593['forEach'](function(_0x9dca71){var _0x1a24a2;switch(_0x9dca71[_0xb5fa('0xaa')]){case _0xb5fa('0xab'):_0x1a24a2=_[_0xb5fa('0x8e')](_0x59920c[_0xb5fa('0xb')],function(_0x10222c){return _0x10222c['id']===_0x9dca71[_0xb5fa('0x77')]&&_0x10222c[_0xb5fa('0xe')]===_0xb5fa('0xac');});break;case'custom':_0x1a24a2=_['find'](_0x59920c[_0xb5fa('0xb')],function(_0x414507){return _0x414507['id']===_0x9dca71[_0xb5fa('0x77')]&&_0x414507[_0xb5fa('0xe')]==='CustomReports';});break;}if(_0x1a24a2)_0x5a358d[_0xb5fa('0x94')](_0x9dca71);});_0x32ab33[_0xb5fa('0xad')]=_0x5a358d[_0xb5fa('0x93')];_0x32ab33['rows']=_0x5a358d;return _0x32ab33;});}else{return _0x316ad0[_0x5c93a0[_0xb5fa('0x11')]][_0xb5fa('0xad')]({'where':_0x43692b[_0xb5fa('0x84')]})[_0xb5fa('0x8')](function(_0x5ba2e7){_0x32ab33[_0xb5fa('0xad')]=_0x5ba2e7;if(_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xa8')]){if(_0x5c93a0[_0xb5fa('0x11')]===_0xb5fa('0x1a')){_0x43692b[_0xb5fa('0xa9')]=[{'model':_0x316ad0[_0xb5fa('0x6b')],'as':_0xb5fa('0xae'),'attributes':['id',_0xb5fa('0x30'),_0xb5fa('0xaf')],'required':_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xb0')]?!![]:![]},{'model':_0x316ad0[_0xb5fa('0x6b')],'as':_0xb5fa('0xb1'),'attributes':['id',_0xb5fa('0x30'),'color'],'through':_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xb0')]?{'attributes':[],'where':{'TagId':_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xb0')]||undefined}}:{},'required':_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xb0')]?!![]:![]}];}else{_0x43692b[_0xb5fa('0xa9')]=[{'all':!![]}];}}return _0x316ad0[_0x5c93a0[_0xb5fa('0x11')]]['findAll'](_0x43692b);})['then'](function(_0x3203e8){_0x32ab33['rows']=_0x3203e8;if(_0x2d786e==='Agents'&&_0x34ebd0[_0xb5fa('0x87')][_0xb5fa('0xb2')]===_0xb5fa('0xb3')){var _0x4d607d=[];for(var _0x3e3b94=0x0;_0x3e3b94<_0x32ab33[_0xb5fa('0xb4')][_0xb5fa('0x93')];_0x3e3b94++){_0x4d607d['push'](_0x1572fb(_0xb5fa('0xb5'),_0x32ab33[_0xb5fa('0xb4')][_0x3e3b94]['dataValues']));_0x4d607d[_0xb5fa('0x94')](_0x1572fb(_0xb5fa('0xb6'),_0x32ab33[_0xb5fa('0xb4')][_0x3e3b94][_0xb5fa('0xb7')]));_0x4d607d[_0xb5fa('0x94')](_0x1572fb(_0xb5fa('0xb8'),_0x32ab33[_0xb5fa('0xb4')][_0x3e3b94]['dataValues']));_0x4d607d[_0xb5fa('0x94')](_0x1572fb(_0xb5fa('0xb9'),_0x32ab33[_0xb5fa('0xb4')][_0x3e3b94][_0xb5fa('0xb7')]));_0x4d607d['push'](_0x1572fb('openchannel',_0x32ab33[_0xb5fa('0xb4')][_0x3e3b94][_0xb5fa('0xb7')]));_0x4d607d[_0xb5fa('0x94')](_0x1572fb(_0xb5fa('0xba'),_0x32ab33['rows'][_0x3e3b94]['dataValues']));}return Promise['all'](_0x4d607d)['then'](function(){return _0x32ab33;});}return _0x32ab33;});}});}}});}; \ No newline at end of file +var _0x6455=['faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','tags','templates','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','reportType','default','DefaultReports','CustomReports','count','rows','include','Tag','Tags','tag','color','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','findAll','then','associatedResources','map','catch','value','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue'];(function(_0x7c1a77,_0x1cefe3){var _0x3496d7=function(_0x306bb5){while(--_0x306bb5){_0x7c1a77['push'](_0x7c1a77['shift']());}};_0x3496d7(++_0x1cefe3);}(_0x6455,0x97));var _0x5645=function(_0x5eb261,_0x2d71fd){_0x5eb261=_0x5eb261-0x0;var _0x464399=_0x6455[_0x5eb261];return _0x464399;};'use strict';var _=require(_0x5645('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x5645('0x1'));var squel=require(_0x5645('0x2'));module[_0x5645('0x3')]=function(_0x1c3f7e){var _0x37c67a=_0x1c3f7e[_0x5645('0x4')];function _0x5388ff(_0x233875,_0x29cefe){return new Promise(function(_0x282ef3,_0x9400a8){if(!_0x29cefe)return _0x282ef3(null);var _0x3a635d=_0x29cefe[_0x5645('0x5')]?{[_0x29cefe[_0x5645('0x5')][_0x5645('0x6')]]:_0x29cefe['filter']['value']}:undefined;return _0x37c67a[_0x233875][_0x5645('0x7')]({'where':_0x3a635d,'raw':!![]})[_0x5645('0x8')](function(_0x38c07a){_0x29cefe[_0x5645('0x9')]=_[_0x5645('0xa')](_0x38c07a,'id');_0x282ef3(_0x29cefe);})[_0x5645('0xb')](function(_0x587c61){_0x9400a8(_0x587c61);});});}function _0x212e46(_0x6021da,_0x425d1a){return new Promise(function(_0x21e32c,_0x5a6092){var _0x333e91=_0x6021da['filter']?{[_0x6021da[_0x5645('0x5')][_0x5645('0x6')]]:_0x6021da[_0x5645('0x5')][_0x5645('0xc')]}:undefined;return _0x37c67a[_0x6021da[_0x5645('0xd')]][_0x5645('0x7')]({'where':_0x333e91,'raw':!![]})[_0x5645('0x8')](function(_0x2270a1){_0x425d1a['associatedResources']=_[_0x5645('0xa')](_0x2270a1,function(_0x3e0ec6){return _0x3e0ec6[_0x5645('0xe')];});_0x21e32c(_0x425d1a);})['catch'](function(_0x4b3be6){_0x5a6092(_0x4b3be6);});});}function _0x439b55(_0x361cfd,_0x511aed,_0x35e0c7){if(!_0x511aed)return Promise[_0x5645('0xf')](null);return new Promise(function(_0x3911ea,_0x5179fd){return _0x37c67a[_0x5645('0x10')][_0x5645('0x7')]({'where':{'sectionId':_0x511aed['id']},'raw':!![]})[_0x5645('0x8')](function(_0x102c19){if(_0x361cfd['field']&&_0x361cfd[_0x5645('0x6')]!=='id'){_0x511aed['associatedResources']=_['map'](_0x102c19,function(_0x7c39d7){return _0x7c39d7[_0x361cfd[_0x5645('0x6')]];});}else{if(_0x35e0c7===_0x5645('0x11')){_0x511aed['associatedResources']=_[_0x5645('0xa')](_0x102c19,function(_0x50ed38){return{'id':_0x50ed38[_0x5645('0x12')],'type':_0x50ed38['type']};});}else{_0x511aed['associatedResources']=_[_0x5645('0xa')](_0x102c19,function(_0x53d763){return _0x53d763[_0x5645('0x12')];});}}_0x3911ea(_0x511aed);})[_0x5645('0xb')](function(_0x502c2e){_0x5179fd(_0x502c2e);});});}function _0x18680f(_0x116bfc,_0xe83ed7){var _0x50fa82={'parentSections':[]};switch(_0x116bfc[_0x5645('0x13')]()){case _0x5645('0x14'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x16');break;case'odbc':_0x50fa82['childModel']='SquareOdbc';break;case'squarerecordings':_0x50fa82[_0x5645('0x15')]='SquareRecording';_0x50fa82['parentSections']=[{'name':_0x5645('0x17'),'field':_0x5645('0xe'),'foreignKey':_0x5645('0x18')}];break;case _0x5645('0x19'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x1a');break;case _0x5645('0x1b'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x1c');_0x50fa82[_0x5645('0x1d')]=[{'name':_0x5645('0x1e'),'field':'id','foreignKey':_0x5645('0x1f')}];break;case _0x5645('0x20'):_0x50fa82[_0x5645('0x15')]='CmList';break;case _0x5645('0x21'):_0x50fa82['childModel']=_0x5645('0x22');break;case _0x5645('0x23'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x24');break;case _0x5645('0x25'):_0x50fa82[_0x5645('0x15')]='ChatQueue';break;case'chatwebsites':_0x50fa82[_0x5645('0x15')]=_0x5645('0x26');break;case _0x5645('0x27'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x28');break;case _0x5645('0x29'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x2a');break;case _0x5645('0x2b'):case _0x5645('0x2c'):case _0x5645('0x2d'):_0x50fa82['childModel']='VoiceExtension';break;case _0x5645('0x2e'):_0x50fa82['childModel']=_0x5645('0x2f');break;case'voicemails':_0x50fa82[_0x5645('0x15')]='VoiceMail';break;case _0x5645('0x30'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x31');_0x50fa82[_0x5645('0x1d')]=[{'name':_0x5645('0x32'),'field':_0x5645('0xe'),'foreignKey':'membername','model':_0x5645('0x33'),'filter':{'field':_0x5645('0x34'),'value':[_0x5645('0x35')]}},{'name':_0x5645('0x36'),'field':_0x5645('0xe'),'foreignKey':_0x5645('0x37'),'model':_0x5645('0x33'),'filter':{'field':_0x5645('0x34'),'value':['telephone']}},{'name':_0x5645('0x38'),'field':'name','foreignKey':_0x5645('0x39'),'model':_0x5645('0x3a'),'filter':{'field':_0x5645('0x3b'),'value':[_0x5645('0x3c')]}},{'name':_0x5645('0x3d'),'field':'name','foreignKey':_0x5645('0x39'),'model':_0x5645('0x3a'),'filter':{'field':_0x5645('0x3b'),'value':[_0x5645('0x3e')]}}];break;case _0x5645('0x3f'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x40');break;case _0x5645('0x41'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x42');break;case _0x5645('0x43'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x44');break;case _0x5645('0x45'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x46');break;case'mailqueues':_0x50fa82[_0x5645('0x15')]=_0x5645('0x47');break;case'mailaccounts':_0x50fa82[_0x5645('0x15')]=_0x5645('0x48');break;case'mailsubstatuses':_0x50fa82[_0x5645('0x15')]=_0x5645('0x49');break;case _0x5645('0x4a'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x4b');break;case _0x5645('0x4c'):_0x50fa82[_0x5645('0x15')]='OpenchannelAccount';break;case'smsqueues':_0x50fa82[_0x5645('0x15')]=_0x5645('0x4d');break;case _0x5645('0x4e'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x4f');break;case _0x5645('0x50'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x51');break;case _0x5645('0x52'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x53');break;case _0x5645('0x54'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x55');break;case _0x5645('0x56'):case _0x5645('0x57'):_0x50fa82[_0x5645('0x15')]='VoiceQueue';if(_0xe83ed7){_0x50fa82['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x5645('0x58'):case _0x5645('0x59'):case _0x5645('0x5a'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x33');if(_0xe83ed7){_0x50fa82['parentSections']=[{'name':_0x5645('0x5b'),'filter':{'field':_0x5645('0x34'),'value':[_0x5645('0x5c'),_0x5645('0x5d')]},'ignore':!![]},{'name':_0x5645('0x32')},{'name':'Telephones'}];}break;case _0x5645('0x5e'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x5f');break;case _0x5645('0x60'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x61');break;case _0x5645('0x62'):_0x50fa82[_0x5645('0x15')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x50fa82[_0x5645('0x15')]=_0x5645('0x63');break;case'deskaccounts':_0x50fa82['childModel']=_0x5645('0x64');break;case'zohoaccounts':_0x50fa82[_0x5645('0x15')]=_0x5645('0x65');break;case _0x5645('0x66'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x33');break;case'cannedanswers':_0x50fa82[_0x5645('0x15')]='CannedAnswer';break;case'dispositions':_0x50fa82[_0x5645('0x15')]=_0x5645('0x67');break;case _0x5645('0x68'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x69');break;case _0x5645('0x6a'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x6b');break;case _0x5645('0x6c'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x6d');break;case _0x5645('0x6e'):_0x50fa82['childModel']='Schedule';break;case _0x5645('0x6f'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x70');break;case _0x5645('0x71'):_0x50fa82[_0x5645('0x15')]='Tag';break;case _0x5645('0x72'):_0x50fa82[_0x5645('0x15')]='Template';break;case _0x5645('0x73'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x74');break;case _0x5645('0x75'):_0x50fa82[_0x5645('0x15')]='Trunk';break;case _0x5645('0x76'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x77');break;case _0x5645('0x78'):_0x50fa82['childModel']=_0x5645('0x79');break;case _0x5645('0x7a'):_0x50fa82[_0x5645('0x15')]=_0x5645('0x11');_0x50fa82[_0x5645('0x1d')]=[{'name':_0x5645('0x7b'),'field':'id','foreignKey':_0x5645('0x7c')}];break;case _0x5645('0x7d'):_0x50fa82[_0x5645('0x15')]='AnalyticMetric';break;}return _0x50fa82;}function _0x345c48(_0x36f3e3,_0x49488f){var _0x5d90a6=_0x36f3e3[_0x5645('0x7e')](0x0)['toUpperCase']()+_0x36f3e3[_0x5645('0x7f')](0x1);var _0x30134e={'type':_0x37c67a[_0x5645('0x80')][_0x5645('0x81')][_0x5645('0x82')],'raw':!![]};return new Promise(function(_0x2e72bc,_0x19e5d4){var _0x4c7649=squel[_0x5645('0x83')]()[_0x5645('0x6')](_0x5645('0x84')+_0x5d90a6+_0x5645('0x85'),'id')[_0x5645('0x6')](_0x5645('0x86'))[_0x5645('0x87')](_0x5645('0x88')+_0x36f3e3+'_interactions','ui')[_0x5645('0x89')](_0x5645('0x8a'),_0x49488f['id']);return _0x37c67a[_0x5645('0x8b')][_0x5645('0x8c')](_0x4c7649['toString'](),_0x30134e)[_0x5645('0x8')](function(_0x31661a){_0x49488f[_0x5d90a6+_0x5645('0x8d')]=_0x31661a;_0x2e72bc(_0x31661a);})[_0x5645('0xb')](function(_0x4545f8){_0x19e5d4(_0x4545f8);});});}return _0x1c3f7e[_0x5645('0x8e')](_0x5645('0x8f'),attributes,{'tableName':_0x5645('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x498acc){var _0x1ccfa1={'raw':![],'where':{}};var _0x417c4d={};var _0x1283fe={'count':0x0,'rows':[]};var _0x28b5ee=_0x498acc[_0x5645('0x8c')][_0x5645('0x91')];var _0x4e2f97=_0x498acc[_0x5645('0x8c')][_0x5645('0x92')]||![];var _0x1e8b14=_0x18680f(_0x28b5ee,_0x4e2f97);if(!_0x1e8b14[_0x5645('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x28b5ee+'\x27');var _0x5c561d=[{'name':_0x28b5ee}];if(!_[_0x5645('0x93')](_0x1e8b14[_0x5645('0x1d')]))_0x5c561d=_0x1e8b14[_0x5645('0x1d')];var _0x5814fe=[];for(var _0xa322de=0x0;_0xa322de<_0x5c561d[_0x5645('0x94')];_0xa322de++){_0x5814fe[_0x5645('0x95')](_0x37c67a[_0x5645('0x96')][_0x5645('0x97')]({'where':{'userProfileId':_0x498acc[_0x5645('0x98')]['id'],'name':_0x5c561d[_0xa322de][_0x5645('0xe')]},'raw':!![]}));}return Promise[_0x5645('0x99')](_0x5814fe)['then'](function(_0x948638){var _0x41fbaf=_[_0x5645('0x5')](_0x948638,function(_0x44d07d){return _0x44d07d?_0x44d07d:undefined;});var _0x60e8bd=_['filter'](_0x5c561d,['ignore',!![]]);var _0xdacc11=_['isEmpty'](_0x41fbaf)&&_['isEmpty'](_0x60e8bd)?null:_['union'](_0x60e8bd,_0x41fbaf);if(!_0xdacc11)return null;var _0x2dcf56=[];for(var _0x32270f=0x0;_0x32270f<_0xdacc11[_0x5645('0x94')];_0x32270f++){var _0x1a2b41=_[_0x5645('0x97')](_0x5c561d,function(_0x4f34bd){return _0xdacc11[_0x32270f]?_0x4f34bd[_0x5645('0xe')]===_0xdacc11[_0x32270f]['name']:null;});if(_0x1a2b41){if(_0xdacc11[_0x32270f][_0x5645('0x9a')]){_0x2dcf56['push'](_0x5388ff(_0x1e8b14[_0x5645('0x15')],_0xdacc11[_0x32270f]));}else{if(!_0xdacc11[_0x32270f]['autoAssociation']){_0x2dcf56['push'](_0x439b55(_0x1a2b41,_0xdacc11[_0x32270f],_0x1e8b14[_0x5645('0x15')]));}else{if(_0x1a2b41['model']){_0x2dcf56[_0x5645('0x95')](_0x212e46(_0x1a2b41,_0xdacc11[_0x32270f]));}}}}}return Promise[_0x5645('0x99')](_0x2dcf56);})[_0x5645('0x8')](function(_0x483647){var _0xbbe45d=_0x483647;var _0x1fe5f7=null;if(_0xbbe45d){_0x1fe5f7=_0xbbe45d['length']===0x1?_0xbbe45d[0x0]:null;}if(!_0x1fe5f7&&!_0xbbe45d)return _0x1283fe;var _0x5112bc=_0x37c67a[_0x1e8b14['childModel']]['rawAttributes'];_0x417c4d[_0x5645('0xd')]=_[_0x5645('0x9b')](_0x5112bc);_0x417c4d['query']=_[_0x5645('0x9b')](_0x498acc[_0x5645('0x8c')]);_0x417c4d[_0x5645('0x9c')]=_[_0x5645('0x9d')](_0x417c4d[_0x5645('0xd')],_0x417c4d[_0x5645('0x8c')]);_0x1ccfa1[_0x5645('0x9e')]=_[_0x5645('0x9d')](_0x417c4d[_0x5645('0xd')],qs[_0x5645('0x9f')](_0x498acc['query'][_0x5645('0x9f')]));_0x1ccfa1['attributes']=_0x1ccfa1[_0x5645('0x9e')]['length']?_0x1ccfa1[_0x5645('0x9e')]:_0x417c4d['model'];if(!_0x498acc[_0x5645('0x8c')][_0x5645('0xa0')](_0x5645('0xa1'))){_0x1ccfa1[_0x5645('0xa2')]=qs[_0x5645('0xa2')](_0x498acc[_0x5645('0x8c')][_0x5645('0xa2')]);_0x1ccfa1[_0x5645('0xa3')]=qs[_0x5645('0xa3')](_0x498acc[_0x5645('0x8c')][_0x5645('0xa3')]);}_0x1ccfa1[_0x5645('0xa4')]=qs[_0x5645('0xa5')](_0x498acc[_0x5645('0x8c')]['sort']);_0x1ccfa1[_0x5645('0x89')]=qs[_0x5645('0x9c')](_[_0x5645('0xa6')](_0x498acc['query'],_0x417c4d['filters']));if(_0x498acc[_0x5645('0x8c')]['filter']){_0x1ccfa1['where']=_[_0x5645('0xa7')](_0x1ccfa1[_0x5645('0x89')],{'$or':_['map'](_0x5112bc,function(_0x321ed8){if(_0x321ed8[_0x5645('0x3b')][_0x5645('0xa8')]!==_0x5645('0xa9')){var _0x1b1dcd={};_0x1b1dcd[_0x321ed8[_0x5645('0x6')]]={'$like':'%'+_0x498acc[_0x5645('0x8c')][_0x5645('0x5')]+'%'};return _0x1b1dcd;}})});}var _0x34cbb7=[];var _0x16c0ce=null;var _0x5d9f2e={};if(_0x1fe5f7){_0x16c0ce=_[_0x5645('0x97')](_0x5c561d,['name',_0x1fe5f7[_0x5645('0xe')]]);if(_0x16c0ce[_0x5645('0x6')]){_0x5d9f2e={};if(_0x1e8b14['childModel']===_0x5645('0x11')){_0x5d9f2e[_0x16c0ce[_0x5645('0xaa')]]=_[_0x5645('0xa')](_0x1fe5f7[_0x5645('0x9')],'id');}else{_0x5d9f2e[_0x16c0ce['foreignKey']]=_0x1fe5f7['associatedResources'];}_0x34cbb7['push'](_0x5d9f2e);}else{_0x1ccfa1[_0x5645('0x89')]['id']=_0x1fe5f7[_0x5645('0x9')];}}else{for(var _0x40f14e=0x0;_0x40f14e<_0xbbe45d[_0x5645('0x94')];_0x40f14e++){_0x16c0ce=_['find'](_0x5c561d,[_0x5645('0xe'),_0xbbe45d[_0x40f14e]['name']]);if(_0x16c0ce[_0x5645('0x6')]){_0x5d9f2e={};_0x5d9f2e[_0x16c0ce[_0x5645('0xaa')]]=_0xbbe45d[_0x40f14e][_0x5645('0x9')];_0x34cbb7['push'](_0x5d9f2e);}else{if(!_0x1ccfa1[_0x5645('0x89')]['id'])_0x1ccfa1[_0x5645('0x89')]['id']=[];_0xbbe45d[_0x40f14e][_0x5645('0x9')][_0x5645('0xab')](function(_0x3fa5f9){_0x1ccfa1[_0x5645('0x89')]['id'][_0x5645('0x95')](_0x3fa5f9);});}}}if(!_[_0x5645('0x93')](_0x34cbb7)){_0x1ccfa1['where']=_[_0x5645('0xa7')](_0x1ccfa1[_0x5645('0x89')],{'$and':{'$or':_0x34cbb7}});}_0x1ccfa1=_['merge']({},_0x1ccfa1,_0x498acc[_0x5645('0xac')]);if(_0x1fe5f7&&!_0x1fe5f7[_0x5645('0xad')]&&_0x1e8b14[_0x5645('0x15')]===_0x5645('0x11')){if(_0x498acc[_0x5645('0x8c')][_0x5645('0xae')]){_0x1ccfa1['include']=[{'all':!![]}];}return _0x37c67a[_0x1e8b14[_0x5645('0x15')]]['findAll'](_0x1ccfa1)[_0x5645('0x8')](function(_0xd33255){var _0x42ae53=[];_0xd33255[_0x5645('0xab')](function(_0x2fc5dc){var _0x59ac34;switch(_0x2fc5dc[_0x5645('0xaf')]){case _0x5645('0xb0'):_0x59ac34=_[_0x5645('0x97')](_0x1fe5f7[_0x5645('0x9')],function(_0xfcc599){return _0xfcc599['id']===_0x2fc5dc[_0x5645('0x7c')]&&_0xfcc599[_0x5645('0x3b')]===_0x5645('0xb1');});break;case'custom':_0x59ac34=_[_0x5645('0x97')](_0x1fe5f7[_0x5645('0x9')],function(_0x24d0dd){return _0x24d0dd['id']===_0x2fc5dc[_0x5645('0x7c')]&&_0x24d0dd[_0x5645('0x3b')]===_0x5645('0xb2');});break;}if(_0x59ac34)_0x42ae53[_0x5645('0x95')](_0x2fc5dc);});_0x1283fe[_0x5645('0xb3')]=_0x42ae53[_0x5645('0x94')];_0x1283fe[_0x5645('0xb4')]=_0x42ae53;return _0x1283fe;});}else{return _0x37c67a[_0x1e8b14[_0x5645('0x15')]][_0x5645('0xb3')]({'where':_0x1ccfa1[_0x5645('0x89')]})[_0x5645('0x8')](function(_0x44902c){_0x1283fe[_0x5645('0xb3')]=_0x44902c;if(_0x498acc[_0x5645('0x8c')][_0x5645('0xae')]){if(_0x1e8b14[_0x5645('0x15')]===_0x5645('0x1c')){_0x1ccfa1[_0x5645('0xb5')]=[{'model':_0x37c67a[_0x5645('0xb6')],'as':_0x5645('0xb7'),'attributes':['id',_0x5645('0xe'),'color'],'required':_0x498acc[_0x5645('0x8c')][_0x5645('0xb8')]?!![]:![]},{'model':_0x37c67a['Tag'],'as':'ThroughTags','attributes':['id',_0x5645('0xe'),_0x5645('0xb9')],'through':_0x498acc[_0x5645('0x8c')][_0x5645('0xb8')]?{'attributes':[],'where':{'TagId':_0x498acc['query'][_0x5645('0xb8')]||undefined}}:{},'required':_0x498acc[_0x5645('0x8c')]['tag']?!![]:![]}];}else{_0x1ccfa1[_0x5645('0xb5')]=[{'all':!![]}];}}return _0x37c67a[_0x1e8b14[_0x5645('0x15')]][_0x5645('0x7')](_0x1ccfa1);})['then'](function(_0x374286){_0x1283fe[_0x5645('0xb4')]=_0x374286;if(_0x28b5ee===_0x5645('0x32')&&_0x498acc[_0x5645('0x8c')]['openTabs']===_0x5645('0xba')){var _0x13a622=[];for(var _0x2cbaee=0x0;_0x2cbaee<_0x1283fe[_0x5645('0xb4')]['length'];_0x2cbaee++){_0x13a622[_0x5645('0x95')](_0x345c48('chat',_0x1283fe[_0x5645('0xb4')][_0x2cbaee][_0x5645('0xbb')]));_0x13a622[_0x5645('0x95')](_0x345c48(_0x5645('0xbc'),_0x1283fe[_0x5645('0xb4')][_0x2cbaee][_0x5645('0xbb')]));_0x13a622[_0x5645('0x95')](_0x345c48('fax',_0x1283fe[_0x5645('0xb4')][_0x2cbaee]['dataValues']));_0x13a622[_0x5645('0x95')](_0x345c48(_0x5645('0xbd'),_0x1283fe[_0x5645('0xb4')][_0x2cbaee][_0x5645('0xbb')]));_0x13a622['push'](_0x345c48(_0x5645('0xbe'),_0x1283fe[_0x5645('0xb4')][_0x2cbaee][_0x5645('0xbb')]));_0x13a622[_0x5645('0x95')](_0x345c48(_0x5645('0xbf'),_0x1283fe[_0x5645('0xb4')][_0x2cbaee][_0x5645('0xbb')]));}return Promise['all'](_0x13a622)[_0x5645('0x8')](function(){return _0x1283fe;});}return _0x1283fe;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index cc19121..4b0f48f 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 _0x3974=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9862,_0x521d3c){var _0x583b46=function(_0x42c077){while(--_0x42c077){_0x4a9862['push'](_0x4a9862['shift']());}};_0x583b46(++_0x521d3c);}(_0x3974,0xbc));var _0x4397=function(_0x3f0055,_0xcbc7a9){_0x3f0055=_0x3f0055-0x0;var _0x49b299=_0x3974[_0x3f0055];return _0x49b299;};'use strict';var _=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var moment=require(_0x4397('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4397('0x3'));var db=require(_0x4397('0x4'))['db'];var utils=require(_0x4397('0x5'));var logger=require(_0x4397('0x6'))(_0x4397('0x7'));var config=require('../../config/environment');var jayson=require(_0x4397('0x8'));var client=jayson[_0x4397('0x9')][_0x4397('0xa')]({'port':0x232a});config[_0x4397('0xb')]=_['defaults'](config[_0x4397('0xb')],{'host':_0x4397('0xc'),'port':0x18eb});var socket=require(_0x4397('0xd'))(new Redis(config[_0x4397('0xb')]));require('./userProfile.socket')[_0x4397('0xe')](socket);function respondWithRpcPromise(_0x26f0ab,_0x13a0e8,_0x54419f){return new BPromise(function(_0x47e207,_0x41d0da){return client[_0x4397('0xf')](_0x26f0ab,_0x54419f)[_0x4397('0x10')](function(_0x4afa76){logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));logger['debug'](_0x4397('0x14'),_0x13a0e8,_0x4397('0x13'),JSON[_0x4397('0x15')](_0x4afa76));if(_0x4afa76['error']){if(_0x4afa76[_0x4397('0x16')]['code']===0x1f4){logger[_0x4397('0x16')]('UserProfile,\x20%s,\x20%s',_0x13a0e8,_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);return _0x41d0da(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}logger[_0x4397('0x16')](_0x4397('0x12'),_0x13a0e8,_0x4afa76['error'][_0x4397('0x17')]);return _0x47e207(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}else{logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));_0x47e207(_0x4afa76[_0x4397('0x18')][_0x4397('0x17')]);}})[_0x4397('0x19')](function(_0x5270d7){logger['error'](_0x4397('0x12'),_0x13a0e8,_0x5270d7);_0x41d0da(_0x5270d7);});});} \ No newline at end of file +var _0xba18=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x34cafa,_0x251fc9){var _0x2741d1=function(_0x1586c4){while(--_0x1586c4){_0x34cafa['push'](_0x34cafa['shift']());}};_0x2741d1(++_0x251fc9);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var moment=require(_0x8ba1('0x2'));var BPromise=require(_0x8ba1('0x3'));var rs=require(_0x8ba1('0x4'));var fs=require('fs');var Redis=require(_0x8ba1('0x5'));var db=require(_0x8ba1('0x6'))['db'];var utils=require(_0x8ba1('0x7'));var logger=require('../../config/logger')(_0x8ba1('0x8'));var config=require(_0x8ba1('0x9'));var jayson=require(_0x8ba1('0xa'));var client=jayson[_0x8ba1('0xb')][_0x8ba1('0xc')]({'port':0x232a});config[_0x8ba1('0xd')]=_['defaults'](config[_0x8ba1('0xd')],{'host':_0x8ba1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x8ba1('0xf')](socket);function respondWithRpcPromise(_0x141a88,_0x4d9f8b,_0x457158){return new BPromise(function(_0x38aae9,_0x460e69){return client[_0x8ba1('0x10')](_0x141a88,_0x457158)[_0x8ba1('0x11')](function(_0x4c270f){logger[_0x8ba1('0x12')](_0x8ba1('0x13'),_0x4d9f8b,_0x8ba1('0x14'));logger[_0x8ba1('0x15')](_0x8ba1('0x16'),_0x4d9f8b,_0x8ba1('0x14'),JSON['stringify'](_0x4c270f));if(_0x4c270f[_0x8ba1('0x17')]){if(_0x4c270f[_0x8ba1('0x17')][_0x8ba1('0x18')]===0x1f4){logger[_0x8ba1('0x17')]('UserProfile,\x20%s,\x20%s',_0x4d9f8b,_0x4c270f['error']['message']);return _0x460e69(_0x4c270f[_0x8ba1('0x17')][_0x8ba1('0x19')]);}logger[_0x8ba1('0x17')](_0x8ba1('0x13'),_0x4d9f8b,_0x4c270f[_0x8ba1('0x17')][_0x8ba1('0x19')]);return _0x38aae9(_0x4c270f[_0x8ba1('0x17')][_0x8ba1('0x19')]);}else{logger[_0x8ba1('0x12')](_0x8ba1('0x13'),_0x4d9f8b,'request\x20sent');_0x38aae9(_0x4c270f['result'][_0x8ba1('0x19')]);}})[_0x8ba1('0x1a')](function(_0x54ae28){logger[_0x8ba1('0x17')](_0x8ba1('0x13'),_0x4d9f8b,_0x54ae28);_0x460e69(_0x54ae28);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 50012cd..5ed6db7 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 _0xc91f=['length','./userProfile.events','save','remove','update','register'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xc91f,0x17b));var _0xfc91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91f[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xfc91('0x0'));var events=[_0xfc91('0x1'),_0xfc91('0x2'),_0xfc91('0x3')];function createListener(_0x1f785c,_0x5b25bd){return function(_0x4a57ee){_0x5b25bd['emit'](_0x1f785c,_0x4a57ee);};}function removeListener(_0x426849,_0x212db2){return function(){UserProfileEvents['removeListener'](_0x426849,_0x212db2);};}exports[_0xfc91('0x4')]=function(_0x3879ee){for(var _0x24d061=0x0,_0x31db2c=events[_0xfc91('0x5')];_0x24d061<_0x31db2c;_0x24d061++){var _0x27e855=events[_0x24d061];var _0x2c8906=createListener('userProfile:'+_0x27e855,_0x3879ee);UserProfileEvents['on'](_0x27e855,_0x2c8906);}}; \ No newline at end of file +var _0xc620=['emit','removeListener','register','userProfile:','./userProfile.events','remove','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc620,0x74));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x0c62('0x0'));var events=['save',_0x0c62('0x1'),_0x0c62('0x2')];function createListener(_0x4680a2,_0x5cbac1){return function(_0x47dbbc){_0x5cbac1[_0x0c62('0x3')](_0x4680a2,_0x47dbbc);};}function removeListener(_0xbc1819,_0x50a663){return function(){UserProfileEvents[_0x0c62('0x4')](_0xbc1819,_0x50a663);};}exports[_0x0c62('0x5')]=function(_0x4f7caa){for(var _0x127c08=0x0,_0x420c81=events['length'];_0x127c08<_0x420c81;_0x127c08++){var _0x250c49=events[_0x127c08];var _0x3e25a7=createListener(_0x0c62('0x6')+_0x250c49,_0x4f7caa);UserProfileEvents['on'](_0x250c49,_0x3e25a7);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index da87b04..10a6c32 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 _0x314e=['create','put','/:id','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','post'];(function(_0x99405c,_0x445476){var _0x3daed0=function(_0x21d002){while(--_0x21d002){_0x99405c['push'](_0x99405c['shift']());}};_0x3daed0(++_0x445476);}(_0x314e,0x173));var _0xe314=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x314e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe314('0x0'));var util=require(_0xe314('0x1'));var path=require(_0xe314('0x2'));var timeout=require('connect-timeout');var express=require(_0xe314('0x3'));var router=express['Router']();var fs_extra=require(_0xe314('0x4'));var auth=require(_0xe314('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe314('0x6'));var controller=require('./userProfileResource.controller');router[_0xe314('0x7')]('/',auth[_0xe314('0x8')](),controller[_0xe314('0x9')]);router['get']('/describe',auth[_0xe314('0x8')](),controller[_0xe314('0xa')]);router[_0xe314('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe314('0xb')]);router[_0xe314('0xc')]('/',auth[_0xe314('0x8')](),controller[_0xe314('0xd')]);router[_0xe314('0xe')](_0xe314('0xf'),auth[_0xe314('0x8')](),controller['update']);router['delete'](_0xe314('0xf'),auth[_0xe314('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa3e9=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xa3e9,0x189));var _0x9a3e=function(_0x425d1d,_0x201f4e){_0x425d1d=_0x425d1d-0x0;var _0x55e848=_0xa3e9[_0x425d1d];return _0x55e848;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a3e('0x0'));var timeout=require(_0x9a3e('0x1'));var express=require(_0x9a3e('0x2'));var router=express['Router']();var fs_extra=require(_0x9a3e('0x3'));var auth=require(_0x9a3e('0x4'));var interaction=require(_0x9a3e('0x5'));var config=require(_0x9a3e('0x6'));var controller=require('./userProfileResource.controller');router[_0x9a3e('0x7')]('/',auth['isAuthenticated'](),controller[_0x9a3e('0x8')]);router[_0x9a3e('0x7')](_0x9a3e('0x9'),auth[_0x9a3e('0xa')](),controller[_0x9a3e('0xb')]);router[_0x9a3e('0x7')](_0x9a3e('0xc'),auth['isAuthenticated'](),controller[_0x9a3e('0xd')]);router[_0x9a3e('0xe')]('/',auth[_0x9a3e('0xa')](),controller[_0x9a3e('0xf')]);router[_0x9a3e('0x10')](_0x9a3e('0xc'),auth['isAuthenticated'](),controller[_0x9a3e('0x11')]);router[_0x9a3e('0x12')](_0x9a3e('0xc'),auth[_0x9a3e('0xa')](),controller['destroy']);module[_0x9a3e('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index f60142c..40252f0 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 _0x87ce=['sequelize','exports','INTEGER'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x87ce,0x156));var _0xe87c=function(_0x442b77,_0x21ec07){_0x442b77=_0x442b77-0x0;var _0x1496fc=_0x87ce[_0x442b77];return _0x1496fc;};'use strict';var Sequelize=require(_0xe87c('0x0'));module[_0xe87c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe87c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5e94=['sequelize','exports','INTEGER','STRING'];(function(_0x469b7d,_0x4760f8){var _0xc78a4b=function(_0xd48e6c){while(--_0xd48e6c){_0x469b7d['push'](_0x469b7d['shift']());}};_0xc78a4b(++_0x4760f8);}(_0x5e94,0x198));var _0x45e9=function(_0x5e94d9,_0x26892){_0x5e94d9=_0x5e94d9-0x0;var _0x559b84=_0x5e94[_0x5e94d9];return _0x559b84;};'use strict';var Sequelize=require(_0x45e9('0x0'));module[_0x45e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x45e9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x45e9('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0109059..db7ad1e 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 _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x5ae657,_0x4e99e9){var _0x3d3604=function(_0x5bf1c2){while(--_0x5bf1c2){_0x5ae657['push'](_0x5ae657['shift']());}};_0x3d3604(++_0x4e99e9);}(_0x1a85,0x178));var _0x51a8=function(_0xf3897e,_0x3ac8b7){_0xf3897e=_0xf3897e-0x0;var _0x26b187=_0x1a85[_0xf3897e];return _0x26b187;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0x687b,0x14a));var _0xb687=function(_0x253d2b,_0x49a0fb){_0x253d2b=_0x253d2b-0x0;var _0x3ce8bd=_0x687b[_0x253d2b];return _0x3ce8bd;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f677683..4b6687f 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 _0x4e62=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x33fada,_0x4d485e){var _0x247eb7=function(_0x5de322){while(--_0x5de322){_0x33fada['push'](_0x33fada['shift']());}};_0x247eb7(++_0x4d485e);}(_0x4e62,0xc0));var _0x24e6=function(_0x11a5ed,_0x278692){_0x11a5ed=_0x11a5ed-0x0;var _0x3041bd=_0x4e62[_0x11a5ed];return _0x3041bd;};'use strict';var _=require(_0x24e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x24e6('0x1'));var moment=require(_0x24e6('0x2'));var BPromise=require(_0x24e6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24e6('0x4'));var rimraf=require(_0x24e6('0x5'));var config=require(_0x24e6('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x24e6('0x7')]=function(_0x5fdd83,_0x331d7c){return _0x5fdd83['define'](_0x24e6('0x8'),attributes,{'tableName':_0x24e6('0x9'),'paranoid':![],'indexes':[{'name':_0x24e6('0xa'),'fields':[_0x24e6('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e20=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','moment'];(function(_0x472cf8,_0xd3ba21){var _0x3f9a63=function(_0x17246d){while(--_0x17246d){_0x472cf8['push'](_0x472cf8['shift']());}};_0x3f9a63(++_0xd3ba21);}(_0x3e20,0x1cc));var _0x03e2=function(_0x3a90ad,_0x3bbe5d){_0x3a90ad=_0x3a90ad-0x0;var _0x20e8b4=_0x3e20[_0x3a90ad];return _0x20e8b4;};'use strict';var _=require(_0x03e2('0x0'));var util=require(_0x03e2('0x1'));var logger=require(_0x03e2('0x2'))(_0x03e2('0x3'));var moment=require(_0x03e2('0x4'));var BPromise=require(_0x03e2('0x5'));var rp=require(_0x03e2('0x6'));var fs=require('fs');var path=require(_0x03e2('0x7'));var rimraf=require(_0x03e2('0x8'));var config=require(_0x03e2('0x9'));var attributes=require(_0x03e2('0xa'));module[_0x03e2('0xb')]=function(_0x54dc77,_0xd04fa2){return _0x54dc77[_0x03e2('0xc')]('UserProfileResource',attributes,{'tableName':_0x03e2('0xd'),'paranoid':![],'indexes':[{'name':_0x03e2('0xe'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index d3cc84b..402deca 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 _0x6b9d=['jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0x6b9d,0x1e4));var _0xd6b9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6b9d[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xd6b9('0x0'));var util=require(_0xd6b9('0x1'));var moment=require(_0xd6b9('0x2'));var BPromise=require(_0xd6b9('0x3'));var rs=require(_0xd6b9('0x4'));var fs=require('fs');var Redis=require(_0xd6b9('0x5'));var db=require(_0xd6b9('0x6'))['db'];var utils=require(_0xd6b9('0x7'));var logger=require(_0xd6b9('0x8'))(_0xd6b9('0x9'));var config=require('../../config/environment');var jayson=require(_0xd6b9('0xa'));var client=jayson[_0xd6b9('0xb')][_0xd6b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b4f81,_0xcd8090,_0x38e9b4){return new BPromise(function(_0x11214c,_0x3eae1d){return client[_0xd6b9('0xd')](_0x1b4f81,_0x38e9b4)[_0xd6b9('0xe')](function(_0xfbf329){logger['info'](_0xd6b9('0xf'),_0xcd8090,'request\x20sent');logger[_0xd6b9('0x10')](_0xd6b9('0x11'),_0xcd8090,'request\x20sent',JSON[_0xd6b9('0x12')](_0xfbf329));if(_0xfbf329[_0xd6b9('0x13')]){if(_0xfbf329[_0xd6b9('0x13')][_0xd6b9('0x14')]===0x1f4){logger['error'](_0xd6b9('0xf'),_0xcd8090,_0xfbf329[_0xd6b9('0x13')][_0xd6b9('0x15')]);return _0x3eae1d(_0xfbf329[_0xd6b9('0x13')][_0xd6b9('0x15')]);}logger[_0xd6b9('0x13')]('UserProfileResource,\x20%s,\x20%s',_0xcd8090,_0xfbf329['error']['message']);return _0x11214c(_0xfbf329[_0xd6b9('0x13')][_0xd6b9('0x15')]);}else{logger[_0xd6b9('0x16')]('UserProfileResource,\x20%s,\x20%s',_0xcd8090,_0xd6b9('0x17'));_0x11214c(_0xfbf329[_0xd6b9('0x18')][_0xd6b9('0x15')]);}})[_0xd6b9('0x19')](function(_0x43fe92){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xcd8090,_0x43fe92);_0x3eae1d(_0x43fe92);});});} \ No newline at end of file +var _0x589f=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x443fd1,_0x16228c){var _0x225ec5=function(_0x1f4ace){while(--_0x1f4ace){_0x443fd1['push'](_0x443fd1['shift']());}};_0x225ec5(++_0x16228c);}(_0x589f,0x1e6));var _0xf589=function(_0x2fcadf,_0x401da6){_0x2fcadf=_0x2fcadf-0x0;var _0x2a2c05=_0x589f[_0x2fcadf];return _0x2a2c05;};'use strict';var _=require(_0xf589('0x0'));var util=require('util');var moment=require(_0xf589('0x1'));var BPromise=require(_0xf589('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf589('0x3'));var db=require(_0xf589('0x4'))['db'];var utils=require(_0xf589('0x5'));var logger=require(_0xf589('0x6'))(_0xf589('0x7'));var config=require('../../config/environment');var jayson=require(_0xf589('0x8'));var client=jayson[_0xf589('0x9')][_0xf589('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56e6bf,_0x25aa8,_0x3c2159){return new BPromise(function(_0x227228,_0x1541fc){return client[_0xf589('0xb')](_0x56e6bf,_0x3c2159)['then'](function(_0x323b5f){logger[_0xf589('0xc')](_0xf589('0xd'),_0x25aa8,_0xf589('0xe'));logger[_0xf589('0xf')](_0xf589('0x10'),_0x25aa8,'request\x20sent',JSON[_0xf589('0x11')](_0x323b5f));if(_0x323b5f[_0xf589('0x12')]){if(_0x323b5f[_0xf589('0x12')][_0xf589('0x13')]===0x1f4){logger[_0xf589('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x25aa8,_0x323b5f[_0xf589('0x12')][_0xf589('0x14')]);return _0x1541fc(_0x323b5f[_0xf589('0x12')][_0xf589('0x14')]);}logger['error'](_0xf589('0xd'),_0x25aa8,_0x323b5f['error'][_0xf589('0x14')]);return _0x227228(_0x323b5f['error'][_0xf589('0x14')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x25aa8,_0xf589('0xe'));_0x227228(_0x323b5f[_0xf589('0x15')]['message']);}})[_0xf589('0x16')](function(_0x427189){logger['error'](_0xf589('0xd'),_0x25aa8,_0x427189);_0x1541fc(_0x427189);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9b396a8..68b4cbb 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 _0x37c7=['../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x572cd3,_0x2451d4){var _0x4a5303=function(_0x11c283){while(--_0x11c283){_0x572cd3['push'](_0x572cd3['shift']());}};_0x4a5303(++_0x2451d4);}(_0x37c7,0x72));var _0x737c=function(_0x2252be,_0x1bceeb){_0x2252be=_0x2252be-0x0;var _0x3dd367=_0x37c7[_0x2252be];return _0x3dd367;};'use strict';var multer=require(_0x737c('0x0'));var util=require(_0x737c('0x1'));var path=require(_0x737c('0x2'));var timeout=require(_0x737c('0x3'));var express=require('express');var router=express[_0x737c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x737c('0x5'));var config=require(_0x737c('0x6'));var controller=require(_0x737c('0x7'));router[_0x737c('0x8')]('/',auth[_0x737c('0x9')](),controller['index']);router[_0x737c('0x8')](_0x737c('0xa'),auth[_0x737c('0x9')](),controller[_0x737c('0xb')]);router['get'](_0x737c('0xc'),auth[_0x737c('0x9')](),controller[_0x737c('0xd')]);router[_0x737c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x737c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x737c('0x10')]);router[_0x737c('0x11')](_0x737c('0xc'),auth[_0x737c('0x9')](),controller[_0x737c('0x12')]);module[_0x737c('0x13')]=router; \ No newline at end of file +var _0x350b=['/describe','describe','post','create','put','/:id','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x265e0e,_0x4154a1){var _0x5c0c98=function(_0x35f793){while(--_0x35f793){_0x265e0e['push'](_0x265e0e['shift']());}};_0x5c0c98(++_0x4154a1);}(_0x350b,0x1af));var _0xb350=function(_0x504ae3,_0x392efe){_0x504ae3=_0x504ae3-0x0;var _0x6805a7=_0x350b[_0x504ae3];return _0x6805a7;};'use strict';var multer=require(_0xb350('0x0'));var util=require('util');var path=require(_0xb350('0x1'));var timeout=require(_0xb350('0x2'));var express=require('express');var router=express[_0xb350('0x3')]();var fs_extra=require(_0xb350('0x4'));var auth=require(_0xb350('0x5'));var interaction=require(_0xb350('0x6'));var config=require(_0xb350('0x7'));var controller=require(_0xb350('0x8'));router[_0xb350('0x9')]('/',auth[_0xb350('0xa')](),controller['index']);router[_0xb350('0x9')](_0xb350('0xb'),auth['isAuthenticated'](),controller[_0xb350('0xc')]);router[_0xb350('0x9')]('/:id',auth[_0xb350('0xa')](),controller['show']);router[_0xb350('0xd')]('/',auth[_0xb350('0xa')](),controller[_0xb350('0xe')]);router[_0xb350('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xb350('0x10'),auth[_0xb350('0xa')](),controller['destroy']);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 70cec62..1a1de38 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 _0x0fd9=['join','getDataValue','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x40a44d,_0x2460b6){var _0x976772=function(_0x1d3864){while(--_0x1d3864){_0x40a44d['push'](_0x40a44d['shift']());}};_0x976772(++_0x2460b6);}(_0x0fd9,0xa3));var _0x90fd=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0fd9[_0x4ae829];return _0x256b31;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'name':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x90fd('0x1')],'set':function(_0x2a5f76){this[_0x90fd('0x3')](_0x90fd('0x4'),_0x2a5f76?_0x2a5f76[_0x90fd('0x5')](''):[]);},'get':function(){return this[_0x90fd('0x6')]('crudPermissions')?this['getDataValue'](_0x90fd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0xf7b4=['getDataValue','split','sequelize','STRING','INTEGER','setDataValue','crudPermissions','join'];(function(_0x5da5fd,_0x1906d8){var _0x58fd93=function(_0x4d80c9){while(--_0x4d80c9){_0x5da5fd['push'](_0x5da5fd['shift']());}};_0x58fd93(++_0x1906d8);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5f41ae,_0x44627c){_0x5f41ae=_0x5f41ae-0x0;var _0x1c1823=_0xf7b4[_0x5f41ae];return _0x1c1823;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f7b('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f7b('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f7b('0x1')],'set':function(_0x3e18fd){this[_0x4f7b('0x3')](_0x4f7b('0x4'),_0x3e18fd?_0x3e18fd[_0x4f7b('0x5')](''):[]);},'get':function(){return this[_0x4f7b('0x6')](_0x4f7b('0x4'))?this[_0x4f7b('0x6')](_0x4f7b('0x4'))[_0x4f7b('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2410bd8..a82ba2b 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 _0xf9bb=['reject','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xf9bb,0x10c));var _0xbf9b=function(_0x35a1cb,_0x5985c3){_0x35a1cb=_0x35a1cb-0x0;var _0x2cd095=_0xf9bb[_0x35a1cb];return _0x2cd095;};'use strict';var emlformat=require(_0xbf9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf9b('0x1'));var jsonpatch=require(_0xbf9b('0x2'));var rp=require(_0xbf9b('0x3'));var moment=require(_0xbf9b('0x4'));var BPromise=require(_0xbf9b('0x5'));var Mustache=require('mustache');var util=require(_0xbf9b('0x6'));var path=require(_0xbf9b('0x7'));var sox=require(_0xbf9b('0x8'));var csv=require(_0xbf9b('0x9'));var ejs=require(_0xbf9b('0xa'));var fs=require('fs');var fs_extra=require(_0xbf9b('0xb'));var _=require(_0xbf9b('0xc'));var squel=require(_0xbf9b('0xd'));var crypto=require(_0xbf9b('0xe'));var jsforce=require(_0xbf9b('0xf'));var deskjs=require(_0xbf9b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf9b('0x11'));var Redis=require(_0xbf9b('0x12'));var authService=require(_0xbf9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbf9b('0x14'));var hardwareService=require(_0xbf9b('0x15'));var logger=require('../../config/logger')(_0xbf9b('0x16'));var utils=require(_0xbf9b('0x17'));var config=require(_0xbf9b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf9b('0x19'))['db'];function respondWithStatusCode(_0x5cabe8,_0xe6e048){_0xe6e048=_0xe6e048||0xcc;return function(_0x38cf88){if(_0x38cf88){return _0x5cabe8[_0xbf9b('0x1a')](_0xe6e048);}return _0x5cabe8['status'](_0xe6e048)[_0xbf9b('0x1b')]();};}function respondWithResult(_0x226a8d,_0x530bce){_0x530bce=_0x530bce||0xc8;return function(_0x3089f0){if(_0x3089f0){return _0x226a8d[_0xbf9b('0x1c')](_0x530bce)['json'](_0x3089f0);}};}function respondWithFilteredResult(_0x4f384a,_0x207d51){return function(_0x339070){if(_0x339070){var _0x2237d2=typeof _0x207d51[_0xbf9b('0x1d')]===_0xbf9b('0x1e')&&typeof _0x207d51[_0xbf9b('0x1f')]===_0xbf9b('0x1e');var _0x3838fe=_0x339070[_0xbf9b('0x20')];var _0x3a9858=_0x2237d2?0x0:_0x207d51[_0xbf9b('0x1d')];var _0x5913c4=_0x2237d2?_0x339070['count']:_0x207d51['offset']+_0x207d51[_0xbf9b('0x1f')];var _0x27407d;if(_0x5913c4>=_0x3838fe){_0x5913c4=_0x3838fe;_0x27407d=0xc8;}else{_0x27407d=0xce;}_0x4f384a[_0xbf9b('0x1c')](_0x27407d);return _0x4f384a[_0xbf9b('0x21')](_0xbf9b('0x22'),_0x3a9858+'-'+_0x5913c4+'/'+_0x3838fe)[_0xbf9b('0x23')](_0x339070);}return null;};}function patchUpdates(_0x1f1a4f){return function(_0x3b62ff){try{jsonpatch['apply'](_0x3b62ff,_0x1f1a4f,!![]);}catch(_0x3d9b30){return BPromise[_0xbf9b('0x24')](_0x3d9b30);}return _0x3b62ff[_0xbf9b('0x25')]();};}function saveUpdates(_0x2c3e1b,_0x26a75a){return function(_0x159818){if(_0x159818){return _0x159818[_0xbf9b('0x26')](_0x2c3e1b)[_0xbf9b('0x27')](function(_0x1a770e){return _0x1a770e;});}return null;};}function removeEntity(_0x59ba5b,_0x1b18a1){return function(_0x103971){if(_0x103971){return _0x103971[_0xbf9b('0x28')]()[_0xbf9b('0x27')](function(){_0x59ba5b[_0xbf9b('0x1c')](0xcc)[_0xbf9b('0x1b')]();});}};}function handleEntityNotFound(_0x370e2b,_0x4d0294){return function(_0x378621){if(!_0x378621){_0x370e2b[_0xbf9b('0x1a')](0x194);}return _0x378621;};}function handleError(_0x5e2911,_0x2e6c07){_0x2e6c07=_0x2e6c07||0x1f4;return function(_0x29be71){logger[_0xbf9b('0x29')](_0x29be71[_0xbf9b('0x2a')]);if(_0x29be71['name']){delete _0x29be71[_0xbf9b('0x2b')];}_0x5e2911['status'](_0x2e6c07)[_0xbf9b('0x2c')](_0x29be71);};}exports[_0xbf9b('0x2d')]=function(_0x4ef8cc,_0x386bbc){var _0x433b44={},_0x4dfe4d={},_0x3cf81d={'count':0x0,'rows':[]};var _0x3883af=_['map'](db[_0xbf9b('0x2e')][_0xbf9b('0x2f')],function(_0x5b7f6f){return{'name':_0x5b7f6f['fieldName'],'type':_0x5b7f6f['type']['key']};});_0x4dfe4d['model']=_[_0xbf9b('0x30')](_0x3883af,_0xbf9b('0x2b'));_0x4dfe4d[_0xbf9b('0x31')]=_['keys'](_0x4ef8cc['query']);_0x4dfe4d[_0xbf9b('0x32')]=_[_0xbf9b('0x33')](_0x4dfe4d[_0xbf9b('0x34')],_0x4dfe4d['query']);_0x433b44['attributes']=_['intersection'](_0x4dfe4d[_0xbf9b('0x34')],qs['fields'](_0x4ef8cc[_0xbf9b('0x31')][_0xbf9b('0x35')]));_0x433b44['attributes']=_0x433b44[_0xbf9b('0x36')][_0xbf9b('0x37')]?_0x433b44[_0xbf9b('0x36')]:_0x4dfe4d[_0xbf9b('0x34')];if(!_0x4ef8cc[_0xbf9b('0x31')][_0xbf9b('0x38')](_0xbf9b('0x39'))){_0x433b44[_0xbf9b('0x1f')]=qs[_0xbf9b('0x1f')](_0x4ef8cc[_0xbf9b('0x31')]['limit']);_0x433b44[_0xbf9b('0x1d')]=qs[_0xbf9b('0x1d')](_0x4ef8cc[_0xbf9b('0x31')]['offset']);}_0x433b44['order']=qs['sort'](_0x4ef8cc[_0xbf9b('0x31')][_0xbf9b('0x3a')]);_0x433b44[_0xbf9b('0x3b')]=qs[_0xbf9b('0x32')](_[_0xbf9b('0x3c')](_0x4ef8cc['query'],_0x4dfe4d[_0xbf9b('0x32')]),_0x3883af);if(_0x4ef8cc[_0xbf9b('0x31')]['filter']){_0x433b44[_0xbf9b('0x3b')]=_[_0xbf9b('0x3d')](_0x433b44[_0xbf9b('0x3b')],{'$or':_['map'](_0x3883af,function(_0x53f573){if(_0x53f573['type']!==_0xbf9b('0x3e')){var _0x199f1e={};_0x199f1e[_0x53f573[_0xbf9b('0x2b')]]={'$like':'%'+_0x4ef8cc[_0xbf9b('0x31')]['filter']+'%'};return _0x199f1e;}})});}_0x433b44=_[_0xbf9b('0x3d')]({},_0x433b44,_0x4ef8cc[_0xbf9b('0x3f')]);var _0x13da2f={'where':_0x433b44[_0xbf9b('0x3b')]};return db[_0xbf9b('0x2e')][_0xbf9b('0x20')](_0x13da2f)[_0xbf9b('0x27')](function(_0xdfdfda){_0x3cf81d[_0xbf9b('0x20')]=_0xdfdfda;if(_0x4ef8cc['query'][_0xbf9b('0x40')]){_0x433b44[_0xbf9b('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0xbf9b('0x42')](_0x433b44);})[_0xbf9b('0x27')](function(_0x4f3121){_0x3cf81d[_0xbf9b('0x43')]=_0x4f3121;return _0x3cf81d;})[_0xbf9b('0x27')](respondWithFilteredResult(_0x386bbc,_0x433b44))[_0xbf9b('0x44')](handleError(_0x386bbc,null));};exports[_0xbf9b('0x45')]=function(_0x228311,_0x12b198){var _0x78ff6={'raw':![],'where':{'id':_0x228311[_0xbf9b('0x46')]['id']}},_0x58ee0c={};_0x58ee0c['model']=_['keys'](db[_0xbf9b('0x2e')][_0xbf9b('0x2f')]);_0x58ee0c[_0xbf9b('0x31')]=_[_0xbf9b('0x47')](_0x228311[_0xbf9b('0x31')]);_0x58ee0c[_0xbf9b('0x32')]=_['intersection'](_0x58ee0c[_0xbf9b('0x34')],_0x58ee0c['query']);_0x78ff6[_0xbf9b('0x36')]=_[_0xbf9b('0x33')](_0x58ee0c[_0xbf9b('0x34')],qs['fields'](_0x228311['query'][_0xbf9b('0x35')]));_0x78ff6[_0xbf9b('0x36')]=_0x78ff6['attributes'][_0xbf9b('0x37')]?_0x78ff6[_0xbf9b('0x36')]:_0x58ee0c['model'];if(_0x228311[_0xbf9b('0x31')][_0xbf9b('0x40')]){_0x78ff6['include']=[{'all':!![]}];}_0x78ff6=_['merge']({},_0x78ff6,_0x228311[_0xbf9b('0x3f')]);return db['UserProfileSection'][_0xbf9b('0x48')](_0x78ff6)[_0xbf9b('0x27')](handleEntityNotFound(_0x12b198,null))['then'](respondWithResult(_0x12b198,null))['catch'](handleError(_0x12b198,null));};exports[_0xbf9b('0x49')]=function(_0xa5706d,_0x1aec50){return db[_0xbf9b('0x2e')][_0xbf9b('0x49')](_0xa5706d[_0xbf9b('0x4a')],{})[_0xbf9b('0x27')](respondWithResult(_0x1aec50,0xc9))['catch'](handleError(_0x1aec50,null));};exports[_0xbf9b('0x26')]=function(_0x1e5bd8,_0x228bce){if(_0x1e5bd8[_0xbf9b('0x4a')]['id']){delete _0x1e5bd8[_0xbf9b('0x4a')]['id'];}return db[_0xbf9b('0x2e')][_0xbf9b('0x48')]({'where':{'id':_0x1e5bd8[_0xbf9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x228bce,null))[_0xbf9b('0x27')](saveUpdates(_0x1e5bd8[_0xbf9b('0x4a')],null))[_0xbf9b('0x27')](respondWithResult(_0x228bce,null))['catch'](handleError(_0x228bce,null));};exports[_0xbf9b('0x28')]=function(_0x3c984f,_0x1ace85){return db['UserProfileSection'][_0xbf9b('0x48')]({'where':{'id':_0x3c984f[_0xbf9b('0x46')]['id']}})[_0xbf9b('0x27')](handleEntityNotFound(_0x1ace85,null))[_0xbf9b('0x27')](removeEntity(_0x1ace85,null))[_0xbf9b('0x44')](handleError(_0x1ace85,null));};exports[_0xbf9b('0x4b')]=function(_0x1d82e6,_0x4fa9bd){return db[_0xbf9b('0x2e')][_0xbf9b('0x4b')]()[_0xbf9b('0x27')](respondWithResult(_0x4fa9bd,null))['catch'](handleError(_0x4fa9bd,null));}; \ No newline at end of file +var _0x918c=['hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','merge','includeAll','findAll','catch','show','params','keys','intersection','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','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','sendStatus','status','offset','count','set','Content-Range','json','apply','reject','update','destroy','then','name','send','map','UserProfileSection','rawAttributes','fieldName','key','query','model','attributes','fields','length'];(function(_0x591c2b,_0x5a2d22){var _0x29e56c=function(_0x1c3360){while(--_0x1c3360){_0x591c2b['push'](_0x591c2b['shift']());}};_0x29e56c(++_0x5a2d22);}(_0x918c,0x1df));var _0xc918=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x918c[_0x1a7846];return _0x48049;};'use strict';var emlformat=require(_0xc918('0x0'));var rimraf=require(_0xc918('0x1'));var zipdir=require(_0xc918('0x2'));var jsonpatch=require(_0xc918('0x3'));var rp=require(_0xc918('0x4'));var moment=require(_0xc918('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc918('0x6'));var util=require(_0xc918('0x7'));var path=require(_0xc918('0x8'));var sox=require(_0xc918('0x9'));var csv=require('to-csv');var ejs=require(_0xc918('0xa'));var fs=require('fs');var fs_extra=require(_0xc918('0xb'));var _=require(_0xc918('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc918('0xd'));var deskjs=require(_0xc918('0xe'));var toCsv=require(_0xc918('0xf'));var querystring=require(_0xc918('0x10'));var Papa=require(_0xc918('0x11'));var Redis=require(_0xc918('0x12'));var authService=require(_0xc918('0x13'));var qs=require(_0xc918('0x14'));var as=require(_0xc918('0x15'));var hardwareService=require(_0xc918('0x16'));var logger=require(_0xc918('0x17'))(_0xc918('0x18'));var utils=require(_0xc918('0x19'));var config=require(_0xc918('0x1a'));var licenseUtil=require(_0xc918('0x1b'));var db=require(_0xc918('0x1c'))['db'];function respondWithStatusCode(_0xc2328c,_0x382b9e){_0x382b9e=_0x382b9e||0xcc;return function(_0x4bd99f){if(_0x4bd99f){return _0xc2328c[_0xc918('0x1d')](_0x382b9e);}return _0xc2328c[_0xc918('0x1e')](_0x382b9e)['end']();};}function respondWithResult(_0x44f50b,_0xbe14c){_0xbe14c=_0xbe14c||0xc8;return function(_0x2056fd){if(_0x2056fd){return _0x44f50b['status'](_0xbe14c)['json'](_0x2056fd);}};}function respondWithFilteredResult(_0x2939ce,_0x4e045f){return function(_0x22b919){if(_0x22b919){var _0x3d3739=typeof _0x4e045f[_0xc918('0x1f')]==='undefined'&&typeof _0x4e045f['limit']==='undefined';var _0x12c111=_0x22b919[_0xc918('0x20')];var _0x1dec83=_0x3d3739?0x0:_0x4e045f[_0xc918('0x1f')];var _0x8e52f0=_0x3d3739?_0x22b919[_0xc918('0x20')]:_0x4e045f[_0xc918('0x1f')]+_0x4e045f['limit'];var _0x32fe4c;if(_0x8e52f0>=_0x12c111){_0x8e52f0=_0x12c111;_0x32fe4c=0xc8;}else{_0x32fe4c=0xce;}_0x2939ce[_0xc918('0x1e')](_0x32fe4c);return _0x2939ce[_0xc918('0x21')](_0xc918('0x22'),_0x1dec83+'-'+_0x8e52f0+'/'+_0x12c111)[_0xc918('0x23')](_0x22b919);}return null;};}function patchUpdates(_0x4be9fe){return function(_0x1b4989){try{jsonpatch[_0xc918('0x24')](_0x1b4989,_0x4be9fe,!![]);}catch(_0x74adc9){return BPromise[_0xc918('0x25')](_0x74adc9);}return _0x1b4989['save']();};}function saveUpdates(_0x4a7db2,_0x165ec6){return function(_0x443da4){if(_0x443da4){return _0x443da4[_0xc918('0x26')](_0x4a7db2)['then'](function(_0x44f2b1){return _0x44f2b1;});}return null;};}function removeEntity(_0xdbaa1d,_0x2a18b7){return function(_0x8b79ce){if(_0x8b79ce){return _0x8b79ce[_0xc918('0x27')]()[_0xc918('0x28')](function(){_0xdbaa1d[_0xc918('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0bef,_0x103406){return function(_0x34c8f0){if(!_0x34c8f0){_0x2b0bef[_0xc918('0x1d')](0x194);}return _0x34c8f0;};}function handleError(_0x3765cd,_0x4266b3){_0x4266b3=_0x4266b3||0x1f4;return function(_0x56d476){logger['error'](_0x56d476['stack']);if(_0x56d476[_0xc918('0x29')]){delete _0x56d476[_0xc918('0x29')];}_0x3765cd[_0xc918('0x1e')](_0x4266b3)[_0xc918('0x2a')](_0x56d476);};}exports['index']=function(_0x4c2505,_0x229d8b){var _0x563be4={},_0x4e9a79={},_0x517f57={'count':0x0,'rows':[]};var _0x345cd6=_[_0xc918('0x2b')](db[_0xc918('0x2c')][_0xc918('0x2d')],function(_0x34941e){return{'name':_0x34941e[_0xc918('0x2e')],'type':_0x34941e['type'][_0xc918('0x2f')]};});_0x4e9a79['model']=_[_0xc918('0x2b')](_0x345cd6,'name');_0x4e9a79[_0xc918('0x30')]=_['keys'](_0x4c2505[_0xc918('0x30')]);_0x4e9a79['filters']=_['intersection'](_0x4e9a79[_0xc918('0x31')],_0x4e9a79[_0xc918('0x30')]);_0x563be4[_0xc918('0x32')]=_['intersection'](_0x4e9a79[_0xc918('0x31')],qs[_0xc918('0x33')](_0x4c2505['query'][_0xc918('0x33')]));_0x563be4[_0xc918('0x32')]=_0x563be4['attributes'][_0xc918('0x34')]?_0x563be4['attributes']:_0x4e9a79[_0xc918('0x31')];if(!_0x4c2505[_0xc918('0x30')][_0xc918('0x35')](_0xc918('0x36'))){_0x563be4[_0xc918('0x37')]=qs[_0xc918('0x37')](_0x4c2505[_0xc918('0x30')][_0xc918('0x37')]);_0x563be4[_0xc918('0x1f')]=qs[_0xc918('0x1f')](_0x4c2505[_0xc918('0x30')][_0xc918('0x1f')]);}_0x563be4[_0xc918('0x38')]=qs[_0xc918('0x39')](_0x4c2505['query'][_0xc918('0x39')]);_0x563be4[_0xc918('0x3a')]=qs[_0xc918('0x3b')](_[_0xc918('0x3c')](_0x4c2505[_0xc918('0x30')],_0x4e9a79[_0xc918('0x3b')]),_0x345cd6);if(_0x4c2505[_0xc918('0x30')][_0xc918('0x3d')]){_0x563be4[_0xc918('0x3a')]=_['merge'](_0x563be4[_0xc918('0x3a')],{'$or':_['map'](_0x345cd6,function(_0x456e96){if(_0x456e96[_0xc918('0x3e')]!=='VIRTUAL'){var _0x7c9149={};_0x7c9149[_0x456e96['name']]={'$like':'%'+_0x4c2505[_0xc918('0x30')][_0xc918('0x3d')]+'%'};return _0x7c9149;}})});}_0x563be4=_[_0xc918('0x3f')]({},_0x563be4,_0x4c2505['options']);var _0x4d909a={'where':_0x563be4['where']};return db[_0xc918('0x2c')][_0xc918('0x20')](_0x4d909a)[_0xc918('0x28')](function(_0x424979){_0x517f57[_0xc918('0x20')]=_0x424979;if(_0x4c2505['query'][_0xc918('0x40')]){_0x563be4['include']=[{'all':!![]}];}return db[_0xc918('0x2c')][_0xc918('0x41')](_0x563be4);})[_0xc918('0x28')](function(_0x3e90ef){_0x517f57['rows']=_0x3e90ef;return _0x517f57;})[_0xc918('0x28')](respondWithFilteredResult(_0x229d8b,_0x563be4))[_0xc918('0x42')](handleError(_0x229d8b,null));};exports[_0xc918('0x43')]=function(_0x2fefb6,_0x342915){var _0x283490={'raw':![],'where':{'id':_0x2fefb6[_0xc918('0x44')]['id']}},_0x193c4e={};_0x193c4e[_0xc918('0x31')]=_['keys'](db['UserProfileSection']['rawAttributes']);_0x193c4e[_0xc918('0x30')]=_[_0xc918('0x45')](_0x2fefb6[_0xc918('0x30')]);_0x193c4e[_0xc918('0x3b')]=_[_0xc918('0x46')](_0x193c4e[_0xc918('0x31')],_0x193c4e[_0xc918('0x30')]);_0x283490['attributes']=_[_0xc918('0x46')](_0x193c4e[_0xc918('0x31')],qs[_0xc918('0x33')](_0x2fefb6[_0xc918('0x30')][_0xc918('0x33')]));_0x283490[_0xc918('0x32')]=_0x283490['attributes']['length']?_0x283490[_0xc918('0x32')]:_0x193c4e['model'];if(_0x2fefb6[_0xc918('0x30')][_0xc918('0x40')]){_0x283490['include']=[{'all':!![]}];}_0x283490=_[_0xc918('0x3f')]({},_0x283490,_0x2fefb6[_0xc918('0x47')]);return db[_0xc918('0x2c')][_0xc918('0x48')](_0x283490)[_0xc918('0x28')](handleEntityNotFound(_0x342915,null))[_0xc918('0x28')](respondWithResult(_0x342915,null))[_0xc918('0x42')](handleError(_0x342915,null));};exports[_0xc918('0x49')]=function(_0x3c74ba,_0x52b439){return db[_0xc918('0x2c')][_0xc918('0x49')](_0x3c74ba[_0xc918('0x4a')],{})[_0xc918('0x28')](respondWithResult(_0x52b439,0xc9))[_0xc918('0x42')](handleError(_0x52b439,null));};exports[_0xc918('0x26')]=function(_0xa63d7,_0x344e5d){if(_0xa63d7[_0xc918('0x4a')]['id']){delete _0xa63d7['body']['id'];}return db['UserProfileSection'][_0xc918('0x48')]({'where':{'id':_0xa63d7[_0xc918('0x44')]['id']}})[_0xc918('0x28')](handleEntityNotFound(_0x344e5d,null))[_0xc918('0x28')](saveUpdates(_0xa63d7[_0xc918('0x4a')],null))[_0xc918('0x28')](respondWithResult(_0x344e5d,null))[_0xc918('0x42')](handleError(_0x344e5d,null));};exports[_0xc918('0x27')]=function(_0x5c30cf,_0x599eca){return db[_0xc918('0x2c')]['find']({'where':{'id':_0x5c30cf['params']['id']}})[_0xc918('0x28')](handleEntityNotFound(_0x599eca,null))[_0xc918('0x28')](removeEntity(_0x599eca,null))[_0xc918('0x42')](handleError(_0x599eca,null));};exports['describe']=function(_0x28188e,_0x4ce4a0){return db[_0xc918('0x2c')][_0xc918('0x4b')]()['then'](respondWithResult(_0x4ce4a0,null))['catch'](handleError(_0x4ce4a0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 8bdac20..05e06ea 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 _0x0e61=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x2d1adc,_0x17a5d9){var _0x3ed0fe=function(_0x552e0b){while(--_0x552e0b){_0x2d1adc['push'](_0x2d1adc['shift']());}};_0x3ed0fe(++_0x17a5d9);}(_0x0e61,0x137));var _0x10e6=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x0e61[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0x10e6('0x0'));var util=require(_0x10e6('0x1'));var logger=require(_0x10e6('0x2'))(_0x10e6('0x3'));var moment=require('moment');var BPromise=require(_0x10e6('0x4'));var rp=require(_0x10e6('0x5'));var fs=require('fs');var path=require(_0x10e6('0x6'));var rimraf=require(_0x10e6('0x7'));var config=require(_0x10e6('0x8'));var attributes=require(_0x10e6('0x9'));module['exports']=function(_0x13a570,_0x3c78f8){return _0x13a570['define'](_0x10e6('0xa'),attributes,{'tableName':_0x10e6('0xb'),'paranoid':![],'indexes':[{'name':_0x10e6('0xc'),'fields':[_0x10e6('0xd'),_0x10e6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6773=['api','moment','bluebird','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x4de9bb,_0x921089){var _0x2db80e=function(_0x4c2303){while(--_0x4c2303){_0x4de9bb['push'](_0x4de9bb['shift']());}};_0x2db80e(++_0x921089);}(_0x6773,0x16b));var _0x3677=function(_0x1e1c1e,_0x63d716){_0x1e1c1e=_0x1e1c1e-0x0;var _0x3e0911=_0x6773[_0x1e1c1e];return _0x3e0911;};'use strict';var _=require(_0x3677('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3677('0x1'));var moment=require(_0x3677('0x2'));var BPromise=require(_0x3677('0x3'));var rp=require(_0x3677('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3677('0x5'));var attributes=require(_0x3677('0x6'));module[_0x3677('0x7')]=function(_0x57e2c5,_0x5ed60e){return _0x57e2c5[_0x3677('0x8')](_0x3677('0x9'),attributes,{'tableName':_0x3677('0xa'),'paranoid':![],'indexes':[{'name':_0x3677('0xb'),'fields':[_0x3677('0xc'),_0x3677('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 015e333..c3b17eb 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 _0x8b7c=['message','info','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b7c,0x1a4));var _0xc8b7=function(_0x557f77,_0x2ff13f){_0x557f77=_0x557f77-0x0;var _0x166ce5=_0x8b7c[_0x557f77];return _0x166ce5;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require('moment');var BPromise=require(_0xc8b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8b7('0x3'));var db=require(_0xc8b7('0x4'))['db'];var utils=require(_0xc8b7('0x5'));var logger=require(_0xc8b7('0x6'))(_0xc8b7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc8b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e8b20,_0x36699f,_0x9cf0a){return new BPromise(function(_0x2f4bc5,_0x6957dc){return client[_0xc8b7('0x9')](_0x2e8b20,_0x9cf0a)[_0xc8b7('0xa')](function(_0x4a57d5){logger['info'](_0xc8b7('0xb'),_0x36699f,_0xc8b7('0xc'));logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x36699f,_0xc8b7('0xc'),JSON['stringify'](_0x4a57d5));if(_0x4a57d5[_0xc8b7('0xf')]){if(_0x4a57d5['error'][_0xc8b7('0x10')]===0x1f4){logger[_0xc8b7('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x36699f,_0x4a57d5[_0xc8b7('0xf')][_0xc8b7('0x11')]);return _0x6957dc(_0x4a57d5[_0xc8b7('0xf')][_0xc8b7('0x11')]);}logger[_0xc8b7('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x36699f,_0x4a57d5[_0xc8b7('0xf')][_0xc8b7('0x11')]);return _0x2f4bc5(_0x4a57d5['error'][_0xc8b7('0x11')]);}else{logger[_0xc8b7('0x12')](_0xc8b7('0xb'),_0x36699f,'request\x20sent');_0x2f4bc5(_0x4a57d5['result'][_0xc8b7('0x11')]);}})['catch'](function(_0x5b03d9){logger[_0xc8b7('0xf')](_0xc8b7('0xb'),_0x36699f,_0x5b03d9);_0x6957dc(_0x5b03d9);});});} \ No newline at end of file +var _0x5081=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5081,0x145));var _0x1508=function(_0x7132e5,_0x990ee1){_0x7132e5=_0x7132e5-0x0;var _0x5c1a1a=_0x5081[_0x7132e5];return _0x5c1a1a;};'use strict';var _=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));var moment=require('moment');var BPromise=require(_0x1508('0x2'));var rs=require(_0x1508('0x3'));var fs=require('fs');var Redis=require(_0x1508('0x4'));var db=require(_0x1508('0x5'))['db'];var utils=require(_0x1508('0x6'));var logger=require(_0x1508('0x7'))(_0x1508('0x8'));var config=require(_0x1508('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1508('0xa')][_0x1508('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440d8c,_0x499504,_0x1a0d33){return new BPromise(function(_0x5608ee,_0x5018bb){return client[_0x1508('0xc')](_0x440d8c,_0x1a0d33)[_0x1508('0xd')](function(_0xb911a){logger[_0x1508('0xe')](_0x1508('0xf'),_0x499504,'request\x20sent');logger['debug'](_0x1508('0x10'),_0x499504,_0x1508('0x11'),JSON['stringify'](_0xb911a));if(_0xb911a[_0x1508('0x12')]){if(_0xb911a[_0x1508('0x12')]['code']===0x1f4){logger[_0x1508('0x12')](_0x1508('0xf'),_0x499504,_0xb911a[_0x1508('0x12')]['message']);return _0x5018bb(_0xb911a[_0x1508('0x12')][_0x1508('0x13')]);}logger['error'](_0x1508('0xf'),_0x499504,_0xb911a[_0x1508('0x12')]['message']);return _0x5608ee(_0xb911a[_0x1508('0x12')][_0x1508('0x13')]);}else{logger['info'](_0x1508('0xf'),_0x499504,_0x1508('0x11'));_0x5608ee(_0xb911a[_0x1508('0x14')]['message']);}})[_0x1508('0x15')](function(_0x1da12b){logger[_0x1508('0x12')](_0x1508('0xf'),_0x499504,_0x1da12b);_0x5018bb(_0x1da12b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 74c8503..d9261da 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4d744d,_0x16b5cd){var _0x2b902e=function(_0x5ded05){while(--_0x5ded05){_0x4d744d['push'](_0x4d744d['shift']());}};_0x2b902e(++_0x16b5cd);}(_0x70e0,0x17b));var _0x070e=function(_0x55f0eb,_0x4df8d7){_0x55f0eb=_0x55f0eb-0x0;var _0x4868a4=_0x70e0[_0x55f0eb];return _0x4868a4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2b7260,_0x1a6799){var _0x4d4803=function(_0x1465f1){while(--_0x1465f1){_0x2b7260['push'](_0x2b7260['shift']());}};_0x4d4803(++_0x1a6799);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xcb91[_0x26fc81];return _0x9feece;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 082fc63..81570ba 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 _0x8284=['INTEGER','sequelize','exports'];(function(_0x5d4052,_0x1661ff){var _0x41095e=function(_0xb75e99){while(--_0xb75e99){_0x5d4052['push'](_0x5d4052['shift']());}};_0x41095e(++_0x1661ff);}(_0x8284,0x76));var _0x4828=function(_0x47d640,_0x4e574e){_0x47d640=_0x47d640-0x0;var _0x1ccda2=_0x8284[_0x47d640];return _0x1ccda2;};'use strict';var Sequelize=require(_0x4828('0x0'));module[_0x4828('0x1')]={'penalty':{'type':Sequelize[_0x4828('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x91ff=['exports','INTEGER','sequelize'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x91ff,0x1ac));var _0xf91f=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x91ff[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xf91f('0x0'));module[_0xf91f('0x1')]={'penalty':{'type':Sequelize[_0xf91f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 40c2fe6..ec78962 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 _0x8085=['define','UserSmsQueue','user_has_sms_queues','lodash','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes'];(function(_0x4b1473,_0x570c61){var _0x4eb602=function(_0x4ee4ab){while(--_0x4ee4ab){_0x4b1473['push'](_0x4b1473['shift']());}};_0x4eb602(++_0x570c61);}(_0x8085,0x71));var _0x5808=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x8085[_0x30cd7e];return _0x462a02;};'use strict';var _=require(_0x5808('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5808('0x1'));var moment=require(_0x5808('0x2'));var BPromise=require(_0x5808('0x3'));var rp=require(_0x5808('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5808('0x5'));var attributes=require(_0x5808('0x6'));module['exports']=function(_0x17f899,_0x749306){return _0x17f899[_0x5808('0x7')](_0x5808('0x8'),attributes,{'tableName':_0x5808('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x30629c,_0x54c991){var _0x49bfc9=function(_0x3ecb31){while(--_0x3ecb31){_0x30629c['push'](_0x30629c['shift']());}};_0x49bfc9(++_0x54c991);}(_0x6050,0x196));var _0x0605=function(_0x539fce,_0x4ad7d0){_0x539fce=_0x539fce-0x0;var _0x39025f=_0x6050[_0x539fce];return _0x39025f;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index cc3b61e..f5b1f2d 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 _0x45ab=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','ioredis'];(function(_0x138164,_0x2fedaa){var _0x3fbe5e=function(_0x15a8d1){while(--_0x15a8d1){_0x138164['push'](_0x138164['shift']());}};_0x3fbe5e(++_0x2fedaa);}(_0x45ab,0x12a));var _0xb45a=function(_0x319af4,_0x19cce9){_0x319af4=_0x319af4-0x0;var _0x187817=_0x45ab[_0x319af4];return _0x187817;};'use strict';var _=require(_0xb45a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb45a('0x1'));var db=require(_0xb45a('0x2'))['db'];var utils=require(_0xb45a('0x3'));var logger=require(_0xb45a('0x4'))(_0xb45a('0x5'));var config=require('../../config/environment');var jayson=require(_0xb45a('0x6'));var client=jayson[_0xb45a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x537988,_0x61dc89,_0x3d9b5d){return new BPromise(function(_0xfa13ce,_0x8276a0){return client[_0xb45a('0x8')](_0x537988,_0x3d9b5d)[_0xb45a('0x9')](function(_0x2ec9ee){logger[_0xb45a('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x61dc89,_0xb45a('0xb'));logger[_0xb45a('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x61dc89,'request\x20sent',JSON[_0xb45a('0xd')](_0x2ec9ee));if(_0x2ec9ee[_0xb45a('0xe')]){if(_0x2ec9ee[_0xb45a('0xe')][_0xb45a('0xf')]===0x1f4){logger[_0xb45a('0xe')](_0xb45a('0x10'),_0x61dc89,_0x2ec9ee[_0xb45a('0xe')][_0xb45a('0x11')]);return _0x8276a0(_0x2ec9ee['error']['message']);}logger[_0xb45a('0xe')](_0xb45a('0x10'),_0x61dc89,_0x2ec9ee[_0xb45a('0xe')]['message']);return _0xfa13ce(_0x2ec9ee['error'][_0xb45a('0x11')]);}else{logger[_0xb45a('0xa')](_0xb45a('0x10'),_0x61dc89,_0xb45a('0xb'));_0xfa13ce(_0x2ec9ee[_0xb45a('0x12')][_0xb45a('0x11')]);}})[_0xb45a('0x13')](function(_0x24e950){logger[_0xb45a('0xe')](_0xb45a('0x10'),_0x61dc89,_0x24e950);_0x8276a0(_0x24e950);});});} \ No newline at end of file +var _0x035f=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5729f2,_0x512c8c){var _0x4ef3da=function(_0x592640){while(--_0x592640){_0x5729f2['push'](_0x5729f2['shift']());}};_0x4ef3da(++_0x512c8c);}(_0x035f,0x1d6));var _0xf035=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x035f[_0x5e36d1];return _0x950b9e;};'use strict';var _=require('lodash');var util=require(_0xf035('0x0'));var moment=require(_0xf035('0x1'));var BPromise=require(_0xf035('0x2'));var rs=require(_0xf035('0x3'));var fs=require('fs');var Redis=require(_0xf035('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf035('0x5'));var logger=require(_0xf035('0x6'))(_0xf035('0x7'));var config=require(_0xf035('0x8'));var jayson=require(_0xf035('0x9'));var client=jayson[_0xf035('0xa')][_0xf035('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28d901,_0x10a2c2,_0x19b496){return new BPromise(function(_0x30a32f,_0x416715){return client[_0xf035('0xc')](_0x28d901,_0x19b496)[_0xf035('0xd')](function(_0x19db89){logger[_0xf035('0xe')](_0xf035('0xf'),_0x10a2c2,_0xf035('0x10'));logger[_0xf035('0x11')](_0xf035('0x12'),_0x10a2c2,_0xf035('0x10'),JSON[_0xf035('0x13')](_0x19db89));if(_0x19db89[_0xf035('0x14')]){if(_0x19db89['error'][_0xf035('0x15')]===0x1f4){logger[_0xf035('0x14')](_0xf035('0xf'),_0x10a2c2,_0x19db89['error']['message']);return _0x416715(_0x19db89[_0xf035('0x14')]['message']);}logger['error'](_0xf035('0xf'),_0x10a2c2,_0x19db89[_0xf035('0x14')]['message']);return _0x30a32f(_0x19db89['error'][_0xf035('0x16')]);}else{logger[_0xf035('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x10a2c2,_0xf035('0x10'));_0x30a32f(_0x19db89['result'][_0xf035('0x16')]);}})['catch'](function(_0x3a05a3){logger[_0xf035('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x10a2c2,_0x3a05a3);_0x416715(_0x3a05a3);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/index.js b/server/api/userVoicePrefix/index.js index 542efd4..cf2dc4b 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(_0x536068,_0x3de52c){var _0x4a5db2=function(_0x1a8091){while(--_0x1a8091){_0x536068['push'](_0x536068['shift']());}};_0x4a5db2(++_0x3de52c);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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(_0x1ff04b,_0x8099b3){var _0x5a21ea=function(_0x15e902){while(--_0x15e902){_0x1ff04b['push'](_0x1ff04b['shift']());}};_0x5a21ea(++_0x8099b3);}(_0xe706,0xa3));var _0x6e70=function(_0x2d747c,_0x851c49){_0x2d747c=_0x2d747c-0x0;var _0x2ac042=_0xe706[_0x2d747c];return _0x2ac042;};'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 cc9b6c2..fb3cabd 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 _0x940f=['exports','INTEGER'];(function(_0x2b8452,_0x20233e){var _0x3d0503=function(_0x131e51){while(--_0x131e51){_0x2b8452['push'](_0x2b8452['shift']());}};_0x3d0503(++_0x20233e);}(_0x940f,0x17e));var _0xf940=function(_0x232719,_0x435255){_0x232719=_0x232719-0x0;var _0x23deea=_0x940f[_0x232719];return _0x23deea;};'use strict';var Sequelize=require('sequelize');module[_0xf940('0x0')]={'UserId':{'type':Sequelize[_0xf940('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xf940('0x1')]}}; \ No newline at end of file +var _0x543a=['INTEGER','sequelize','exports'];(function(_0x5b79c9,_0x22e9de){var _0xa357ab=function(_0x3e400e){while(--_0x3e400e){_0x5b79c9['push'](_0x5b79c9['shift']());}};_0xa357ab(++_0x22e9de);}(_0x543a,0x133));var _0xa543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa543('0x0'));module[_0xa543('0x1')]={'UserId':{'type':Sequelize[_0xa543('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xa543('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index efb0040..e823af2 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(_0x557eff,_0x22cab5){var _0x401b9d=function(_0x517248){while(--_0x517248){_0x557eff['push'](_0x557eff['shift']());}};_0x401b9d(++_0x22cab5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x178ebc,_0xcff988){var _0x586994=function(_0x3150de){while(--_0x3150de){_0x178ebc['push'](_0x178ebc['shift']());}};_0x586994(++_0xcff988);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 bfa661c..7705131 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 _0x006d=['info','UserVoicePrefix,\x20%s,\x20%s','request\x20sent','debug','UserVoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','then'];(function(_0x4b64fe,_0x71b2a4){var _0x288459=function(_0x3674ed){while(--_0x3674ed){_0x4b64fe['push'](_0x4b64fe['shift']());}};_0x288459(++_0x71b2a4);}(_0x006d,0x1ac));var _0xd006=function(_0x388fa2,_0x421e0b){_0x388fa2=_0x388fa2-0x0;var _0x29ba97=_0x006d[_0x388fa2];return _0x29ba97;};'use strict';var _=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var moment=require(_0xd006('0x2'));var BPromise=require('bluebird');var rs=require(_0xd006('0x3'));var fs=require('fs');var Redis=require(_0xd006('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd006('0x5'))('rpc');var config=require(_0xd006('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd006('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3218aa,_0x59ac3c,_0x4fb1a5){return new BPromise(function(_0x170c90,_0xf7e31d){return client['request'](_0x3218aa,_0x4fb1a5)[_0xd006('0x8')](function(_0x29c321){logger[_0xd006('0x9')](_0xd006('0xa'),_0x59ac3c,_0xd006('0xb'));logger[_0xd006('0xc')](_0xd006('0xd'),_0x59ac3c,_0xd006('0xb'),JSON['stringify'](_0x29c321));if(_0x29c321[_0xd006('0xe')]){if(_0x29c321[_0xd006('0xe')][_0xd006('0xf')]===0x1f4){logger[_0xd006('0xe')](_0xd006('0xa'),_0x59ac3c,_0x29c321[_0xd006('0xe')]['message']);return _0xf7e31d(_0x29c321['error'][_0xd006('0x10')]);}logger[_0xd006('0xe')]('UserVoicePrefix,\x20%s,\x20%s',_0x59ac3c,_0x29c321[_0xd006('0xe')][_0xd006('0x10')]);return _0x170c90(_0x29c321[_0xd006('0xe')][_0xd006('0x10')]);}else{logger[_0xd006('0x9')](_0xd006('0xa'),_0x59ac3c,_0xd006('0xb'));_0x170c90(_0x29c321[_0xd006('0x11')]['message']);}})[_0xd006('0x12')](function(_0x4e5726){logger[_0xd006('0xe')](_0xd006('0xa'),_0x59ac3c,_0x4e5726);_0xf7e31d(_0x4e5726);});});} \ No newline at end of file +var _0xbb26=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserVoicePrefix,\x20%s,\x20%s','debug','UserVoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0xbb26,0xb5));var _0x6bb2=function(_0x5117d5,_0x3e9f3e){_0x5117d5=_0x5117d5-0x0;var _0x4da521=_0xbb26[_0x5117d5];return _0x4da521;};'use strict';var _=require(_0x6bb2('0x0'));var util=require(_0x6bb2('0x1'));var moment=require(_0x6bb2('0x2'));var BPromise=require(_0x6bb2('0x3'));var rs=require(_0x6bb2('0x4'));var fs=require('fs');var Redis=require(_0x6bb2('0x5'));var db=require(_0x6bb2('0x6'))['db'];var utils=require(_0x6bb2('0x7'));var logger=require(_0x6bb2('0x8'))(_0x6bb2('0x9'));var config=require(_0x6bb2('0xa'));var jayson=require(_0x6bb2('0xb'));var client=jayson['client'][_0x6bb2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xeaaa09,_0x1d7b79,_0xc60ad3){return new BPromise(function(_0x146187,_0x583dc0){return client[_0x6bb2('0xd')](_0xeaaa09,_0xc60ad3)[_0x6bb2('0xe')](function(_0x79d865){logger['info'](_0x6bb2('0xf'),_0x1d7b79,'request\x20sent');logger[_0x6bb2('0x10')](_0x6bb2('0x11'),_0x1d7b79,_0x6bb2('0x12'),JSON[_0x6bb2('0x13')](_0x79d865));if(_0x79d865[_0x6bb2('0x14')]){if(_0x79d865['error'][_0x6bb2('0x15')]===0x1f4){logger['error'](_0x6bb2('0xf'),_0x1d7b79,_0x79d865[_0x6bb2('0x14')][_0x6bb2('0x16')]);return _0x583dc0(_0x79d865['error'][_0x6bb2('0x16')]);}logger[_0x6bb2('0x14')](_0x6bb2('0xf'),_0x1d7b79,_0x79d865[_0x6bb2('0x14')][_0x6bb2('0x16')]);return _0x146187(_0x79d865['error'][_0x6bb2('0x16')]);}else{logger[_0x6bb2('0x17')](_0x6bb2('0xf'),_0x1d7b79,'request\x20sent');_0x146187(_0x79d865['result'][_0x6bb2('0x16')]);}})[_0x6bb2('0x18')](function(_0x2d96b6){logger[_0x6bb2('0x14')](_0x6bb2('0xf'),_0x1d7b79,_0x2d96b6);_0x583dc0(_0x2d96b6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index de2f728..6c0955a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1c9b1c,_0x310730){var _0x175905=function(_0x42e863){while(--_0x42e863){_0x1c9b1c['push'](_0x1c9b1c['shift']());}};_0x175905(++_0x310730);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0xcb91[_0x28edda];return _0x21f4a4;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2f96d8,_0x19de1a){var _0x244927=function(_0xb277b6){while(--_0xb277b6){_0x2f96d8['push'](_0x2f96d8['shift']());}};_0x244927(++_0x19de1a);}(_0xedd9,0xfc));var _0x9edd=function(_0x610568,_0x1b0386){_0x610568=_0x610568-0x0;var _0x360299=_0xedd9[_0x610568];return _0x360299;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 3831f53..b8e913a 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 _0x616a=['sequelize'];(function(_0x6f89d4,_0xd0ce56){var _0x362e06=function(_0x5c0a82){while(--_0x5c0a82){_0x6f89d4['push'](_0x6f89d4['shift']());}};_0x362e06(++_0xd0ce56);}(_0x616a,0x175));var _0xa616=function(_0x5e27de,_0x2c1156){_0x5e27de=_0x5e27de-0x0;var _0x31c2fd=_0x616a[_0x5e27de];return _0x31c2fd;};'use strict';var Sequelize=require(_0xa616('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x39b1=['sequelize','INTEGER'];(function(_0x545a59,_0x4b8921){var _0x1a5865=function(_0x16c768){while(--_0x16c768){_0x545a59['push'](_0x545a59['shift']());}};_0x1a5865(++_0x4b8921);}(_0x39b1,0x1a2));var _0x139b=function(_0x27919b,_0x47449e){_0x27919b=_0x27919b-0x0;var _0x594fc8=_0x39b1[_0x27919b];return _0x594fc8;};'use strict';var Sequelize=require(_0x139b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x139b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index f4ce144..990d319 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 _0x5300=['api','moment','bluebird','path','rimraf','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x57952d,_0x5949c7){var _0x8d525a=function(_0x3177a4){while(--_0x3177a4){_0x57952d['push'](_0x57952d['shift']());}};_0x8d525a(++_0x5949c7);}(_0x5300,0x1e9));var _0x0530=function(_0x507804,_0x5d553a){_0x507804=_0x507804-0x0;var _0x3039fe=_0x5300[_0x507804];return _0x3039fe;};'use strict';var _=require(_0x0530('0x0'));var util=require(_0x0530('0x1'));var logger=require(_0x0530('0x2'))(_0x0530('0x3'));var moment=require(_0x0530('0x4'));var BPromise=require(_0x0530('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0530('0x6'));var rimraf=require(_0x0530('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x0530('0x8')]=function(_0x1b40ea,_0x42a913){return _0x1b40ea[_0x0530('0x9')](_0x0530('0xa'),attributes,{'tableName':_0x0530('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x917f=['path','rimraf','exports','define','UserVoiceQueue','api','bluebird','request-promise'];(function(_0x429235,_0x3339bf){var _0x117d09=function(_0xd735ef){while(--_0xd735ef){_0x429235['push'](_0x429235['shift']());}};_0x117d09(++_0x3339bf);}(_0x917f,0xbd));var _0xf917=function(_0x3c5bad,_0x11714c){_0x3c5bad=_0x3c5bad-0x0;var _0x5e2458=_0x917f[_0x3c5bad];return _0x5e2458;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf917('0x0'));var moment=require('moment');var BPromise=require(_0xf917('0x1'));var rp=require(_0xf917('0x2'));var fs=require('fs');var path=require(_0xf917('0x3'));var rimraf=require(_0xf917('0x4'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0xf917('0x5')]=function(_0x169697,_0x287e66){return _0x169697[_0xf917('0x6')](_0xf917('0x7'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 9d1f5c6..d7ef615 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 _0x562b=['message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x285c34,_0x3bbc0f){var _0x25381d=function(_0x207f6c){while(--_0x207f6c){_0x285c34['push'](_0x285c34['shift']());}};_0x25381d(++_0x3bbc0f);}(_0x562b,0xb4));var _0xb562=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x562b[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xb562('0x0'));var util=require(_0xb562('0x1'));var moment=require(_0xb562('0x2'));var BPromise=require(_0xb562('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb562('0x4'))['db'];var utils=require(_0xb562('0x5'));var logger=require('../../config/logger')(_0xb562('0x6'));var config=require('../../config/environment');var jayson=require(_0xb562('0x7'));var client=jayson[_0xb562('0x8')][_0xb562('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d590,_0x434b1f,_0x1bd309){return new BPromise(function(_0x4733ff,_0x562be6){return client[_0xb562('0xa')](_0x16d590,_0x1bd309)[_0xb562('0xb')](function(_0x2a6d34){logger['info'](_0xb562('0xc'),_0x434b1f,_0xb562('0xd'));logger['debug'](_0xb562('0xe'),_0x434b1f,'request\x20sent',JSON[_0xb562('0xf')](_0x2a6d34));if(_0x2a6d34['error']){if(_0x2a6d34['error'][_0xb562('0x10')]===0x1f4){logger[_0xb562('0x11')](_0xb562('0xc'),_0x434b1f,_0x2a6d34[_0xb562('0x11')][_0xb562('0x12')]);return _0x562be6(_0x2a6d34['error'][_0xb562('0x12')]);}logger[_0xb562('0x11')](_0xb562('0xc'),_0x434b1f,_0x2a6d34[_0xb562('0x11')][_0xb562('0x12')]);return _0x4733ff(_0x2a6d34[_0xb562('0x11')][_0xb562('0x12')]);}else{logger[_0xb562('0x13')](_0xb562('0xc'),_0x434b1f,_0xb562('0xd'));_0x4733ff(_0x2a6d34[_0xb562('0x14')][_0xb562('0x12')]);}})[_0xb562('0x15')](function(_0x233243){logger[_0xb562('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x434b1f,_0x233243);_0x562be6(_0x233243);});});} \ No newline at end of file +var _0x6204=['error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1186d6,_0x66cc98){var _0x342104=function(_0x26ad57){while(--_0x26ad57){_0x1186d6['push'](_0x1186d6['shift']());}};_0x342104(++_0x66cc98);}(_0x6204,0x1e8));var _0x4620=function(_0x142479,_0x347d51){_0x142479=_0x142479-0x0;var _0x360798=_0x6204[_0x142479];return _0x360798;};'use strict';var _=require(_0x4620('0x0'));var util=require(_0x4620('0x1'));var moment=require(_0x4620('0x2'));var BPromise=require(_0x4620('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4620('0x4'));var db=require(_0x4620('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4620('0x6'));var config=require(_0x4620('0x7'));var jayson=require(_0x4620('0x8'));var client=jayson[_0x4620('0x9')][_0x4620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15a94d,_0x4e2a8c,_0x5b1b5a){return new BPromise(function(_0x5c95ea,_0x5a1c92){return client[_0x4620('0xb')](_0x15a94d,_0x5b1b5a)[_0x4620('0xc')](function(_0x1a535f){logger[_0x4620('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4e2a8c,_0x4620('0xe'));logger[_0x4620('0xf')](_0x4620('0x10'),_0x4e2a8c,'request\x20sent',JSON[_0x4620('0x11')](_0x1a535f));if(_0x1a535f['error']){if(_0x1a535f[_0x4620('0x12')][_0x4620('0x13')]===0x1f4){logger[_0x4620('0x12')](_0x4620('0x14'),_0x4e2a8c,_0x1a535f[_0x4620('0x12')]['message']);return _0x5a1c92(_0x1a535f[_0x4620('0x12')][_0x4620('0x15')]);}logger['error'](_0x4620('0x14'),_0x4e2a8c,_0x1a535f[_0x4620('0x12')]['message']);return _0x5c95ea(_0x1a535f[_0x4620('0x12')]['message']);}else{logger[_0x4620('0xd')](_0x4620('0x14'),_0x4e2a8c,_0x4620('0xe'));_0x5c95ea(_0x1a535f[_0x4620('0x16')][_0x4620('0x15')]);}})['catch'](function(_0x13ea76){logger[_0x4620('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x4e2a8c,_0x13ea76);_0x5a1c92(_0x13ea76);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index f0de707..5ca9472 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x877a9f,_0x3c29c1){var _0x134d7f=function(_0x26f834){while(--_0x26f834){_0x877a9f['push'](_0x877a9f['shift']());}};_0x134d7f(++_0x3c29c1);}(_0xe706,0xa3));var _0x6e70=function(_0xda1de5,_0x231f2c){_0xda1de5=_0xda1de5-0x0;var _0x52079b=_0xe706[_0xda1de5];return _0x52079b;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 500d443..684b361 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 _0x4f14=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x1badea,_0x822323){var _0x161758=function(_0x33a776){while(--_0x33a776){_0x1badea['push'](_0x1badea['shift']());}};_0x161758(++_0x822323);}(_0x4f14,0x11d));var _0x44f1=function(_0x2bafbd,_0x28e308){_0x2bafbd=_0x2bafbd-0x0;var _0x13d4ac=_0x4f14[_0x2bafbd];return _0x13d4ac;};'use strict';var Sequelize=require(_0x44f1('0x0'));module[_0x44f1('0x1')]={'uniqueid':{'type':Sequelize[_0x44f1('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x44f1('0x3')},'membername':{'type':Sequelize[_0x44f1('0x4')],'allowNull':![],'comment':_0x44f1('0x3')},'UserId':{'type':Sequelize[_0x44f1('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x44f1('0x4')],'allowNull':![],'unique':_0x44f1('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x44f1('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x44f1('0x4')],'allowNull':![],'unique':_0x44f1('0x5'),'comment':_0x44f1('0x3')},'penalty':{'type':Sequelize[_0x44f1('0x2')](0xb),'defaultValue':0x0,'comment':_0x44f1('0x3')},'paused':{'type':Sequelize[_0x44f1('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x4b09=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b09,0xa3));var _0x94b0=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x4b09[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0x94b0('0x0'));module[_0x94b0('0x1')]={'uniqueid':{'type':Sequelize[_0x94b0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x94b0('0x3')},'membername':{'type':Sequelize[_0x94b0('0x4')],'allowNull':![],'comment':_0x94b0('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x94b0('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x94b0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x94b0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x94b0('0x4')],'allowNull':![],'unique':_0x94b0('0x5'),'comment':_0x94b0('0x3')},'penalty':{'type':Sequelize[_0x94b0('0x2')](0xb),'defaultValue':0x0,'comment':_0x94b0('0x3')},'paused':{'type':Sequelize[_0x94b0('0x2')](0xb),'defaultValue':0x0,'comment':_0x94b0('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index fbe1a30..c05a3a6 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 _0xf7fd=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x399290,_0x50dddf){var _0x1400ff=function(_0x172773){while(--_0x172773){_0x399290['push'](_0x399290['shift']());}};_0x1400ff(++_0x50dddf);}(_0xf7fd,0x132));var _0xdf7f=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xf7fd[_0x487b0c];return _0x1adbdc;};'use strict';var EventEmitter=require(_0xdf7f('0x0'));var UserVoiceQueueRt=require(_0xdf7f('0x1'))['db'][_0xdf7f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xdf7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf7f('0x4'),'afterDestroy':_0xdf7f('0x5')};function emitEvent(_0x214006){return function(_0x46ce7f,_0x13f7c6,_0x1a0dac){UserVoiceQueueRtEvents[_0xdf7f('0x6')](_0x214006+':'+_0x46ce7f['id'],_0x46ce7f);UserVoiceQueueRtEvents[_0xdf7f('0x6')](_0x214006,_0x46ce7f);_0x1a0dac(null);};}for(var e in events){if(events[_0xdf7f('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xdf7f('0x8')](e,emitEvent(event));}}module[_0xdf7f('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd46c=['save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd46c,0x19b));var _0xcd46=function(_0x6d0cba,_0x2c6e67){_0x6d0cba=_0x6d0cba-0x0;var _0x21d348=_0xd46c[_0x6d0cba];return _0x21d348;};'use strict';var EventEmitter=require(_0xcd46('0x0'));var UserVoiceQueueRt=require(_0xcd46('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd46('0x2'),'afterUpdate':_0xcd46('0x3'),'afterDestroy':_0xcd46('0x4')};function emitEvent(_0x543100){return function(_0xfd5104,_0x144b1f,_0x10f9f4){UserVoiceQueueRtEvents['emit'](_0x543100+':'+_0xfd5104['id'],_0xfd5104);UserVoiceQueueRtEvents[_0xcd46('0x5')](_0x543100,_0xfd5104);_0x10f9f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xcd46('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2cc0b87..005498a 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 _0x1cf8=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x22f37b,_0x3a5981){var _0x5b9a38=function(_0x56018f){while(--_0x56018f){_0x22f37b['push'](_0x22f37b['shift']());}};_0x5b9a38(++_0x3a5981);}(_0x1cf8,0xdc));var _0x81cf=function(_0x2d259a,_0x31068e){_0x2d259a=_0x2d259a-0x0;var _0x16f9d5=_0x1cf8[_0x2d259a];return _0x16f9d5;};'use strict';var _=require(_0x81cf('0x0'));var util=require('util');var logger=require(_0x81cf('0x1'))('api');var moment=require(_0x81cf('0x2'));var BPromise=require(_0x81cf('0x3'));var rp=require(_0x81cf('0x4'));var fs=require('fs');var path=require(_0x81cf('0x5'));var rimraf=require(_0x81cf('0x6'));var config=require(_0x81cf('0x7'));var attributes=require(_0x81cf('0x8'));module[_0x81cf('0x9')]=function(_0x433cf8,_0x1e8201){return _0x433cf8[_0x81cf('0xa')](_0x81cf('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5263=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x54d975,_0x1ded36){var _0x421b0b=function(_0xd76bd2){while(--_0xd76bd2){_0x54d975['push'](_0x54d975['shift']());}};_0x421b0b(++_0x1ded36);}(_0x5263,0x15a));var _0x3526=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x5263[_0x543084];return _0x306a57;};'use strict';var _=require(_0x3526('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3526('0x1'));var moment=require(_0x3526('0x2'));var BPromise=require(_0x3526('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3526('0x4'));var config=require(_0x3526('0x5'));var attributes=require(_0x3526('0x6'));module[_0x3526('0x7')]=function(_0x57b4fc,_0x515f9f){return _0x57b4fc[_0x3526('0x8')](_0x3526('0x9'),attributes,{'tableName':_0x3526('0xa'),'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 b947704..9ef3fe2 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 _0xad87=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','COUNT','sequelize','literal','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x41763a,_0xe1a239){var _0x7b9f9b=function(_0x3f3d66){while(--_0x3f3d66){_0x41763a['push'](_0x41763a['shift']());}};_0x7b9f9b(++_0xe1a239);}(_0xad87,0x178));var _0x7ad8=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xad87[_0x96f74c];return _0x379222;};'use strict';var _=require(_0x7ad8('0x0'));var util=require(_0x7ad8('0x1'));var moment=require(_0x7ad8('0x2'));var BPromise=require(_0x7ad8('0x3'));var rs=require(_0x7ad8('0x4'));var fs=require('fs');var Redis=require(_0x7ad8('0x5'));var db=require(_0x7ad8('0x6'))['db'];var utils=require(_0x7ad8('0x7'));var logger=require(_0x7ad8('0x8'))('rpc');var config=require(_0x7ad8('0x9'));var jayson=require(_0x7ad8('0xa'));var client=jayson[_0x7ad8('0xb')][_0x7ad8('0xc')]({'port':0x232a});config[_0x7ad8('0xd')]=_[_0x7ad8('0xe')](config[_0x7ad8('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ad8('0xf'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x213a33,_0x40e215,_0x51c7b9){return new BPromise(function(_0x554f6c,_0x3421a3){return client[_0x7ad8('0x10')](_0x213a33,_0x51c7b9)[_0x7ad8('0x11')](function(_0x37d910){logger[_0x7ad8('0x12')](_0x7ad8('0x13'),_0x40e215,_0x7ad8('0x14'));logger[_0x7ad8('0x15')](_0x7ad8('0x16'),_0x40e215,_0x7ad8('0x14'),JSON[_0x7ad8('0x17')](_0x37d910));if(_0x37d910[_0x7ad8('0x18')]){if(_0x37d910['error'][_0x7ad8('0x19')]===0x1f4){logger[_0x7ad8('0x18')](_0x7ad8('0x13'),_0x40e215,_0x37d910[_0x7ad8('0x18')][_0x7ad8('0x1a')]);return _0x3421a3(_0x37d910[_0x7ad8('0x18')][_0x7ad8('0x1a')]);}logger[_0x7ad8('0x18')](_0x7ad8('0x13'),_0x40e215,_0x37d910[_0x7ad8('0x18')][_0x7ad8('0x1a')]);return _0x554f6c(_0x37d910[_0x7ad8('0x18')][_0x7ad8('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x40e215,_0x7ad8('0x14'));_0x554f6c(_0x37d910['result'][_0x7ad8('0x1a')]);}})['catch'](function(_0x5eda28){logger[_0x7ad8('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40e215,_0x5eda28);_0x3421a3(_0x5eda28);});});}exports[_0x7ad8('0x1b')]=function(_0x33ec73){var _0x5b0c2c=this;return new Promise(function(_0x5c0058,_0x1e692e){return db[_0x7ad8('0x1c')][_0x7ad8('0x1d')]({'raw':_0x33ec73[_0x7ad8('0x1e')]?_0x33ec73['options']['raw']===undefined?!![]:![]:!![],'where':_0x33ec73[_0x7ad8('0x1e')]?_0x33ec73[_0x7ad8('0x1e')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x7ad8('0x1f'),db['sequelize']['fn']('IF',db[_0x7ad8('0x20')][_0x7ad8('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0x7ad8('0x22')]]})[_0x7ad8('0x11')](function(_0x5f0c8e){logger[_0x7ad8('0x12')](_0x7ad8('0x1b'),_0x33ec73);logger[_0x7ad8('0x15')]('GetVoiceQueueRtPauses',_0x33ec73,JSON[_0x7ad8('0x17')](_0x5f0c8e));_0x5c0058(_0x5f0c8e);})[_0x7ad8('0x23')](function(_0x553538){logger[_0x7ad8('0x18')](_0x7ad8('0x1b'),_0x553538[_0x7ad8('0x1a')],_0x33ec73);_0x1e692e(_0x5b0c2c[_0x7ad8('0x18')](0x1f4,_0x553538[_0x7ad8('0x1a')]));});});}; \ No newline at end of file +var _0x2e31=['UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x3391fe,_0x5c24d9){var _0x1ae383=function(_0x5e71a4){while(--_0x5e71a4){_0x3391fe['push'](_0x3391fe['shift']());}};_0x1ae383(++_0x5c24d9);}(_0x2e31,0xe7));var _0x12e3=function(_0x29e877,_0x44ef69){_0x29e877=_0x29e877-0x0;var _0x2b7834=_0x2e31[_0x29e877];return _0x2b7834;};'use strict';var _=require(_0x12e3('0x0'));var util=require('util');var moment=require(_0x12e3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12e3('0x2'));var db=require(_0x12e3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12e3('0x4'))(_0x12e3('0x5'));var config=require(_0x12e3('0x6'));var jayson=require(_0x12e3('0x7'));var client=jayson[_0x12e3('0x8')][_0x12e3('0x9')]({'port':0x232a});config['redis']=_[_0x12e3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12e3('0xb')]));require('./userVoiceQueueRt.socket')[_0x12e3('0xc')](socket);function respondWithRpcPromise(_0x49a73f,_0x312e9d,_0x34589c){return new BPromise(function(_0x367716,_0x1f3307){return client[_0x12e3('0xd')](_0x49a73f,_0x34589c)['then'](function(_0x371df7){logger[_0x12e3('0xe')](_0x12e3('0xf'),_0x312e9d,_0x12e3('0x10'));logger['debug'](_0x12e3('0x11'),_0x312e9d,_0x12e3('0x10'),JSON['stringify'](_0x371df7));if(_0x371df7[_0x12e3('0x12')]){if(_0x371df7[_0x12e3('0x12')]['code']===0x1f4){logger[_0x12e3('0x12')](_0x12e3('0xf'),_0x312e9d,_0x371df7['error']['message']);return _0x1f3307(_0x371df7[_0x12e3('0x12')][_0x12e3('0x13')]);}logger[_0x12e3('0x12')](_0x12e3('0xf'),_0x312e9d,_0x371df7['error']['message']);return _0x367716(_0x371df7['error']['message']);}else{logger['info'](_0x12e3('0xf'),_0x312e9d,_0x12e3('0x10'));_0x367716(_0x371df7[_0x12e3('0x14')][_0x12e3('0x13')]);}})[_0x12e3('0x15')](function(_0xc08dde){logger[_0x12e3('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x312e9d,_0xc08dde);_0x1f3307(_0xc08dde);});});}exports[_0x12e3('0x16')]=function(_0xb632ef){var _0xcfe487=this;return new Promise(function(_0x54ddda,_0x4b3148){return db[_0x12e3('0x17')][_0x12e3('0x18')]({'raw':_0xb632ef[_0x12e3('0x19')]?_0xb632ef[_0x12e3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xb632ef[_0x12e3('0x19')]?_0xb632ef[_0x12e3('0x19')]['where']||null:null,'attributes':[[db[_0x12e3('0x1a')]['fn'](_0x12e3('0x1b'),db[_0x12e3('0x1a')]['fn']('IF',db[_0x12e3('0x1a')]['literal'](_0x12e3('0x1c')))),_0x12e3('0x1d')]]})['then'](function(_0x3e7d0e){logger['info'](_0x12e3('0x16'),_0xb632ef);logger['debug']('GetVoiceQueueRtPauses',_0xb632ef,JSON[_0x12e3('0x1e')](_0x3e7d0e));_0x54ddda(_0x3e7d0e);})[_0x12e3('0x15')](function(_0x89320e){logger[_0x12e3('0x12')](_0x12e3('0x16'),_0x89320e[_0x12e3('0x13')],_0xb632ef);_0x4b3148(_0xcfe487[_0x12e3('0x12')](0x1f4,_0x89320e[_0x12e3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index a531c31..33330ef 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 _0x0b3d=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x0b3d,0x76));var _0xd0b3=function(_0x367054,_0x1debc3){_0x367054=_0x367054-0x0;var _0x472454=_0x0b3d[_0x367054];return _0x472454;};'use strict';var UserVoiceQueueRtEvents=require(_0xd0b3('0x0'));var events=['save',_0xd0b3('0x1'),'update'];function createListener(_0x44585b,_0x5cd26e){return function(_0x2e82a6){_0x5cd26e['emit'](_0x44585b,_0x2e82a6);};}function removeListener(_0x372f08,_0x50faaa){return function(){UserVoiceQueueRtEvents[_0xd0b3('0x2')](_0x372f08,_0x50faaa);};}exports[_0xd0b3('0x3')]=function(_0x5b80df){for(var _0x2968c9=0x0,_0x5bc883=events[_0xd0b3('0x4')];_0x2968c9<_0x5bc883;_0x2968c9++){var _0x5f3196=events[_0x2968c9];var _0x5ab5b2=createListener(_0xd0b3('0x5')+_0x5f3196,_0x5b80df);UserVoiceQueueRtEvents['on'](_0x5f3196,_0x5ab5b2);}}; \ No newline at end of file +var _0x287e=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x2fe79e,_0x21a0bb){var _0x409236=function(_0x1a8350){while(--_0x1a8350){_0x2fe79e['push'](_0x2fe79e['shift']());}};_0x409236(++_0x21a0bb);}(_0x287e,0x1e3));var _0xe287=function(_0x1ad850,_0x4c0f82){_0x1ad850=_0x1ad850-0x0;var _0x14c1f4=_0x287e[_0x1ad850];return _0x14c1f4;};'use strict';var UserVoiceQueueRtEvents=require(_0xe287('0x0'));var events=[_0xe287('0x1'),_0xe287('0x2'),_0xe287('0x3')];function createListener(_0x43ac68,_0xf00cd7){return function(_0x33e26a){_0xf00cd7[_0xe287('0x4')](_0x43ac68,_0x33e26a);};}function removeListener(_0x16d2d7,_0x5f34d6){return function(){UserVoiceQueueRtEvents[_0xe287('0x5')](_0x16d2d7,_0x5f34d6);};}exports[_0xe287('0x6')]=function(_0x5af7ce){for(var _0x4b3807=0x0,_0x38bd18=events['length'];_0x4b3807<_0x38bd18;_0x4b3807++){var _0x4f3cf1=events[_0x4b3807];var _0x4cd1f4=createListener(_0xe287('0x7')+_0x4f3cf1,_0x5af7ce);UserVoiceQueueRtEvents['on'](_0x4f3cf1,_0x4cd1f4);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 629eb84..e2a3373 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x407cda,_0x1b4d98){var _0x5b6c92=function(_0x43db12){while(--_0x43db12){_0x407cda['push'](_0x407cda['shift']());}};_0x5b6c92(++_0x1b4d98);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x36d13b,_0xa6a5d5){var _0x2a9d5a=function(_0x317640){while(--_0x317640){_0x36d13b['push'](_0x36d13b['shift']());}};_0x2a9d5a(++_0xa6a5d5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0xcb91[_0x967959];return _0x5c4489;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index fb41dc4..e959ce9 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 _0x1217=['exports','sequelize'];(function(_0x4fdb95,_0x12c99b){var _0x2bea1d=function(_0x1d698e){while(--_0x1d698e){_0x4fdb95['push'](_0x4fdb95['shift']());}};_0x2bea1d(++_0x12c99b);}(_0x1217,0xb1));var _0x7121=function(_0x518bd4,_0x2ee16b){_0x518bd4=_0x518bd4-0x0;var _0x1e0e66=_0x1217[_0x518bd4];return _0x1e0e66;};'use strict';var Sequelize=require(_0x7121('0x0'));module[_0x7121('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9879=['exports','INTEGER','sequelize'];(function(_0x317257,_0x3894ab){var _0x1e4dde=function(_0x4ba770){while(--_0x4ba770){_0x317257['push'](_0x317257['shift']());}};_0x1e4dde(++_0x3894ab);}(_0x9879,0x92));var _0x9987=function(_0x177cde,_0x40bdb2){_0x177cde=_0x177cde-0x0;var _0x5c8ce1=_0x9879[_0x177cde];return _0x5c8ce1;};'use strict';var Sequelize=require(_0x9987('0x0'));module[_0x9987('0x1')]={'penalty':{'type':Sequelize[_0x9987('0x2')],'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 63bc7a3..7707419 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 _0xd498=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x4b5368,_0x1e62bc){var _0x36da89=function(_0x2c3ed3){while(--_0x2c3ed3){_0x4b5368['push'](_0x4b5368['shift']());}};_0x36da89(++_0x1e62bc);}(_0xd498,0x13f));var _0x8d49=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xd498[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require(_0x8d49('0x0'));var logger=require(_0x8d49('0x1'))(_0x8d49('0x2'));var moment=require(_0x8d49('0x3'));var BPromise=require(_0x8d49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d49('0x5'));var rimraf=require('rimraf');var config=require(_0x8d49('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x8d49('0x7')]=function(_0x2534f9,_0x26fdb5){return _0x2534f9[_0x8d49('0x8')](_0x8d49('0x9'),attributes,{'tableName':_0x8d49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1440=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x49e7ba,_0x1b190f){var _0x2219e0=function(_0x40933c){while(--_0x40933c){_0x49e7ba['push'](_0x49e7ba['shift']());}};_0x2219e0(++_0x1b190f);}(_0x1440,0x1c3));var _0x0144=function(_0x513fc3,_0x38a686){_0x513fc3=_0x513fc3-0x0;var _0x5df172=_0x1440[_0x513fc3];return _0x5df172;};'use strict';var _=require(_0x0144('0x0'));var util=require('util');var logger=require(_0x0144('0x1'))(_0x0144('0x2'));var moment=require(_0x0144('0x3'));var BPromise=require(_0x0144('0x4'));var rp=require(_0x0144('0x5'));var fs=require('fs');var path=require(_0x0144('0x6'));var rimraf=require(_0x0144('0x7'));var config=require(_0x0144('0x8'));var attributes=require(_0x0144('0x9'));module[_0x0144('0xa')]=function(_0x24b6c0,_0x4618c8){return _0x24b6c0[_0x0144('0xb')](_0x0144('0xc'),attributes,{'tableName':_0x0144('0xd'),'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 d387850..ecee0a9 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 _0x295a=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a9d03,_0x19c30b){var _0x49e694=function(_0x296e01){while(--_0x296e01){_0x4a9d03['push'](_0x4a9d03['shift']());}};_0x49e694(++_0x19c30b);}(_0x295a,0x1c8));var _0xa295=function(_0x20e372,_0xdca6aa){_0x20e372=_0x20e372-0x0;var _0x11a28f=_0x295a[_0x20e372];return _0x11a28f;};'use strict';var _=require(_0xa295('0x0'));var util=require(_0xa295('0x1'));var moment=require(_0xa295('0x2'));var BPromise=require(_0xa295('0x3'));var rs=require(_0xa295('0x4'));var fs=require('fs');var Redis=require(_0xa295('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa295('0x6'));var config=require(_0xa295('0x7'));var jayson=require(_0xa295('0x8'));var client=jayson[_0xa295('0x9')][_0xa295('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346c3a,_0x491c6a,_0x4abe0c){return new BPromise(function(_0x57cf57,_0x42b885){return client[_0xa295('0xb')](_0x346c3a,_0x4abe0c)[_0xa295('0xc')](function(_0x20b0aa){logger[_0xa295('0xd')](_0xa295('0xe'),_0x491c6a,_0xa295('0xf'));logger[_0xa295('0x10')](_0xa295('0x11'),_0x491c6a,_0xa295('0xf'),JSON[_0xa295('0x12')](_0x20b0aa));if(_0x20b0aa[_0xa295('0x13')]){if(_0x20b0aa['error'][_0xa295('0x14')]===0x1f4){logger[_0xa295('0x13')](_0xa295('0xe'),_0x491c6a,_0x20b0aa['error']['message']);return _0x42b885(_0x20b0aa[_0xa295('0x13')][_0xa295('0x15')]);}logger[_0xa295('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x491c6a,_0x20b0aa[_0xa295('0x13')][_0xa295('0x15')]);return _0x57cf57(_0x20b0aa[_0xa295('0x13')][_0xa295('0x15')]);}else{logger[_0xa295('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x491c6a,_0xa295('0xf'));_0x57cf57(_0x20b0aa[_0xa295('0x16')]['message']);}})[_0xa295('0x17')](function(_0xff5f49){logger[_0xa295('0x13')](_0xa295('0xe'),_0x491c6a,_0xff5f49);_0x42b885(_0xff5f49);});});} \ No newline at end of file +var _0xc285=['request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x527afe,_0xcb09c){var _0x1c6cb3=function(_0x896f67){while(--_0x896f67){_0x527afe['push'](_0x527afe['shift']());}};_0x1c6cb3(++_0xcb09c);}(_0xc285,0xea));var _0x5c28=function(_0x4c5e8b,_0x11b9fa){_0x4c5e8b=_0x4c5e8b-0x0;var _0x3ca42e=_0xc285[_0x4c5e8b];return _0x3ca42e;};'use strict';var _=require(_0x5c28('0x0'));var util=require(_0x5c28('0x1'));var moment=require(_0x5c28('0x2'));var BPromise=require(_0x5c28('0x3'));var rs=require(_0x5c28('0x4'));var fs=require('fs');var Redis=require(_0x5c28('0x5'));var db=require(_0x5c28('0x6'))['db'];var utils=require(_0x5c28('0x7'));var logger=require('../../config/logger')(_0x5c28('0x8'));var config=require(_0x5c28('0x9'));var jayson=require(_0x5c28('0xa'));var client=jayson[_0x5c28('0xb')][_0x5c28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x526649,_0x22baf6,_0x391a79){return new BPromise(function(_0xb3487b,_0x30fa6e){return client[_0x5c28('0xd')](_0x526649,_0x391a79)[_0x5c28('0xe')](function(_0x4f8cc5){logger['info'](_0x5c28('0xf'),_0x22baf6,_0x5c28('0x10'));logger['debug'](_0x5c28('0x11'),_0x22baf6,_0x5c28('0x10'),JSON[_0x5c28('0x12')](_0x4f8cc5));if(_0x4f8cc5[_0x5c28('0x13')]){if(_0x4f8cc5[_0x5c28('0x13')][_0x5c28('0x14')]===0x1f4){logger[_0x5c28('0x13')](_0x5c28('0xf'),_0x22baf6,_0x4f8cc5['error']['message']);return _0x30fa6e(_0x4f8cc5[_0x5c28('0x13')][_0x5c28('0x15')]);}logger[_0x5c28('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22baf6,_0x4f8cc5[_0x5c28('0x13')][_0x5c28('0x15')]);return _0xb3487b(_0x4f8cc5[_0x5c28('0x13')][_0x5c28('0x15')]);}else{logger[_0x5c28('0x16')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22baf6,_0x5c28('0x10'));_0xb3487b(_0x4f8cc5[_0x5c28('0x17')][_0x5c28('0x15')]);}})[_0x5c28('0x18')](function(_0x59e3db){logger[_0x5c28('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x22baf6,_0x59e3db);_0x30fa6e(_0x59e3db);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index dbf9692..04b3922 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 _0xb903=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','show','post','/:id','exports','multer','util'];(function(_0x364ed6,_0x462bca){var _0x3b8554=function(_0xaf80c8){while(--_0xaf80c8){_0x364ed6['push'](_0x364ed6['shift']());}};_0x3b8554(++_0x462bca);}(_0xb903,0x185));var _0x3b90=function(_0x24e8d7,_0x1865ed){_0x24e8d7=_0x24e8d7-0x0;var _0x259a60=_0xb903[_0x24e8d7];return _0x259a60;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/:id',auth[_0x3b90('0xc')](),controller[_0x3b90('0xd')]);router[_0x3b90('0xe')]('/',auth[_0x3b90('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b90('0xf'),auth[_0x3b90('0xc')](),controller['destroy']);module[_0x3b90('0x10')]=router; \ No newline at end of file +var _0xc874=['put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','index','/:id','isAuthenticated','show'];(function(_0x550274,_0x13f4ba){var _0x3736a2=function(_0x2f28fa){while(--_0x2f28fa){_0x550274['push'](_0x550274['shift']());}};_0x3736a2(++_0x13f4ba);}(_0xc874,0x154));var _0x4c87=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xc874[_0xcd5a3d];return _0xd43207;};'use strict';var multer=require(_0x4c87('0x0'));var util=require('util');var path=require(_0x4c87('0x1'));var timeout=require(_0x4c87('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c87('0x3'));var auth=require(_0x4c87('0x4'));var interaction=require(_0x4c87('0x5'));var config=require('../../config/environment');var controller=require(_0x4c87('0x6'));router[_0x4c87('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x8')]);router[_0x4c87('0x7')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xb')]);router['post']('/',auth[_0x4c87('0xa')](),controller['create']);router[_0x4c87('0xc')](_0x4c87('0x9'),auth[_0x4c87('0xa')](),controller[_0x4c87('0xd')]);router[_0x4c87('0xe')]('/:id',auth[_0x4c87('0xa')](),controller[_0x4c87('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1fbfe2d..4a6e416 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 _0x4444=['exports','name','STRING','sequelize'];(function(_0x58da8d,_0x9dfa17){var _0x1b1682=function(_0x3e9ad4){while(--_0x3e9ad4){_0x58da8d['push'](_0x58da8d['shift']());}};_0x1b1682(++_0x9dfa17);}(_0x4444,0xa3));var _0x4444=function(_0x14b8c7,_0x4839ea){_0x14b8c7=_0x14b8c7-0x0;var _0x4bb5a3=_0x4444[_0x14b8c7];return _0x4bb5a3;};'use strict';var Sequelize=require(_0x4444('0x0'));module[_0x4444('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4444('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4444('0x3')]}}; \ No newline at end of file +var _0x5d53=['exports','STRING','name'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5d53,0x81));var _0x35d5=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0x5d53[_0x30780e];return _0x5b9129;};'use strict';var Sequelize=require('sequelize');module[_0x35d5('0x0')]={'name':{'type':Sequelize[_0x35d5('0x1')],'unique':_0x35d5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x35d5('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 51051c2..a80ec39 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 _0x3eef=['model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','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','status','end','offset','undefined','limit','count','json','apply','save','then','get','Variables','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x3eef,0x6f));var _0xf3ee=function(_0x1f703c,_0x30954a){_0x1f703c=_0x1f703c-0x0;var _0x333466=_0x3eef[_0x1f703c];return _0x333466;};'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(_0xf3ee('0x0'));var moment=require(_0xf3ee('0x1'));var BPromise=require(_0xf3ee('0x2'));var Mustache=require('mustache');var util=require(_0xf3ee('0x3'));var path=require(_0xf3ee('0x4'));var sox=require(_0xf3ee('0x5'));var csv=require('to-csv');var ejs=require(_0xf3ee('0x6'));var fs=require('fs');var fs_extra=require(_0xf3ee('0x7'));var _=require('lodash');var squel=require(_0xf3ee('0x8'));var crypto=require(_0xf3ee('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf3ee('0xa'));var querystring=require(_0xf3ee('0xb'));var Papa=require(_0xf3ee('0xc'));var Redis=require(_0xf3ee('0xd'));var authService=require(_0xf3ee('0xe'));var qs=require(_0xf3ee('0xf'));var as=require(_0xf3ee('0x10'));var hardwareService=require(_0xf3ee('0x11'));var logger=require(_0xf3ee('0x12'))(_0xf3ee('0x13'));var utils=require(_0xf3ee('0x14'));var config=require(_0xf3ee('0x15'));var licenseUtil=require(_0xf3ee('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3d8f,_0x4a2d8e){_0x4a2d8e=_0x4a2d8e||0xcc;return function(_0x48620a){if(_0x48620a){return _0x5e3d8f['sendStatus'](_0x4a2d8e);}return _0x5e3d8f[_0xf3ee('0x17')](_0x4a2d8e)[_0xf3ee('0x18')]();};}function respondWithResult(_0x5b1adf,_0x437d39){_0x437d39=_0x437d39||0xc8;return function(_0x5c0c59){if(_0x5c0c59){return _0x5b1adf[_0xf3ee('0x17')](_0x437d39)['json'](_0x5c0c59);}};}function respondWithFilteredResult(_0x1fb040,_0x31626b){return function(_0x25db7d){if(_0x25db7d){var _0x53b397=typeof _0x31626b[_0xf3ee('0x19')]===_0xf3ee('0x1a')&&typeof _0x31626b[_0xf3ee('0x1b')]===_0xf3ee('0x1a');var _0x9c2434=_0x25db7d[_0xf3ee('0x1c')];var _0x4f50f6=_0x53b397?0x0:_0x31626b['offset'];var _0x3c7fe9=_0x53b397?_0x25db7d[_0xf3ee('0x1c')]:_0x31626b[_0xf3ee('0x19')]+_0x31626b[_0xf3ee('0x1b')];var _0x35c3e9;if(_0x3c7fe9>=_0x9c2434){_0x3c7fe9=_0x9c2434;_0x35c3e9=0xc8;}else{_0x35c3e9=0xce;}_0x1fb040['status'](_0x35c3e9);return _0x1fb040['set']('Content-Range',_0x4f50f6+'-'+_0x3c7fe9+'/'+_0x9c2434)[_0xf3ee('0x1d')](_0x25db7d);}return null;};}function patchUpdates(_0x2a8631){return function(_0x5c2100){try{jsonpatch[_0xf3ee('0x1e')](_0x5c2100,_0x2a8631,!![]);}catch(_0x2ecf68){return BPromise['reject'](_0x2ecf68);}return _0x5c2100[_0xf3ee('0x1f')]();};}function saveUpdates(_0x56402c,_0x3908b0){return function(_0x1b3ed8){if(_0x1b3ed8){return _0x1b3ed8['update'](_0x56402c)[_0xf3ee('0x20')](function(_0x54fc94){return _0x54fc94;});}return null;};}function removeEntity(_0x12e6ef,_0x477cba){return function(_0x351112){if(_0x351112){return _0x351112['destroy']()[_0xf3ee('0x20')](function(){var _0x3119cf=_0x351112[_0xf3ee('0x21')]({'plain':!![]});var _0xdf5d27=_0xf3ee('0x22');return db[_0xf3ee('0x23')][_0xf3ee('0x24')]({'where':{'type':_0xdf5d27,'resourceId':_0x3119cf['id']}})['then'](function(){return _0x351112;});})[_0xf3ee('0x20')](function(){_0x12e6ef[_0xf3ee('0x17')](0xcc)[_0xf3ee('0x18')]();});}};}function handleEntityNotFound(_0x3c244c,_0x351618){return function(_0x42fd29){if(!_0x42fd29){_0x3c244c[_0xf3ee('0x25')](0x194);}return _0x42fd29;};}function handleError(_0x569777,_0x4b1eb2){_0x4b1eb2=_0x4b1eb2||0x1f4;return function(_0x3584de){logger[_0xf3ee('0x26')](_0x3584de[_0xf3ee('0x27')]);if(_0x3584de[_0xf3ee('0x28')]){delete _0x3584de[_0xf3ee('0x28')];}_0x569777[_0xf3ee('0x17')](_0x4b1eb2)[_0xf3ee('0x29')](_0x3584de);};}exports[_0xf3ee('0x2a')]=function(_0x1c63b1,_0x223c66){var _0x13e23d={},_0xaf567a={},_0x4cdd80={'count':0x0,'rows':[]};var _0x1c4e24=_[_0xf3ee('0x2b')](db[_0xf3ee('0x2c')][_0xf3ee('0x2d')],function(_0x2f5f9f){return{'name':_0x2f5f9f[_0xf3ee('0x2e')],'type':_0x2f5f9f[_0xf3ee('0x2f')][_0xf3ee('0x30')]};});_0xaf567a[_0xf3ee('0x31')]=_['map'](_0x1c4e24,_0xf3ee('0x28'));_0xaf567a['query']=_[_0xf3ee('0x32')](_0x1c63b1[_0xf3ee('0x33')]);_0xaf567a[_0xf3ee('0x34')]=_[_0xf3ee('0x35')](_0xaf567a['model'],_0xaf567a[_0xf3ee('0x33')]);_0x13e23d[_0xf3ee('0x36')]=_[_0xf3ee('0x35')](_0xaf567a[_0xf3ee('0x31')],qs[_0xf3ee('0x37')](_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x37')]));_0x13e23d['attributes']=_0x13e23d[_0xf3ee('0x36')][_0xf3ee('0x38')]?_0x13e23d[_0xf3ee('0x36')]:_0xaf567a[_0xf3ee('0x31')];if(!_0x1c63b1[_0xf3ee('0x33')]['hasOwnProperty']('nolimit')){_0x13e23d[_0xf3ee('0x1b')]=qs['limit'](_0x1c63b1['query'][_0xf3ee('0x1b')]);_0x13e23d['offset']=qs['offset'](_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x19')]);}_0x13e23d[_0xf3ee('0x39')]=qs[_0xf3ee('0x3a')](_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x3a')]);_0x13e23d[_0xf3ee('0x3b')]=qs[_0xf3ee('0x34')](_[_0xf3ee('0x3c')](_0x1c63b1[_0xf3ee('0x33')],_0xaf567a[_0xf3ee('0x34')]),_0x1c4e24);if(_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x3d')]){_0x13e23d[_0xf3ee('0x3b')]=_[_0xf3ee('0x3e')](_0x13e23d[_0xf3ee('0x3b')],{'$or':_['map'](_0x1c4e24,function(_0x5ead93){if(_0x5ead93[_0xf3ee('0x2f')]!==_0xf3ee('0x3f')){var _0x2551a2={};_0x2551a2[_0x5ead93['name']]={'$like':'%'+_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x3d')]+'%'};return _0x2551a2;}})});}_0x13e23d=_[_0xf3ee('0x3e')]({},_0x13e23d,_0x1c63b1[_0xf3ee('0x40')]);var _0x36b926={'where':_0x13e23d[_0xf3ee('0x3b')]};return db[_0xf3ee('0x2c')][_0xf3ee('0x1c')](_0x36b926)['then'](function(_0x5c959c){_0x4cdd80[_0xf3ee('0x1c')]=_0x5c959c;if(_0x1c63b1[_0xf3ee('0x33')][_0xf3ee('0x41')]){_0x13e23d[_0xf3ee('0x42')]=[{'all':!![]}];}return db[_0xf3ee('0x2c')]['findAll'](_0x13e23d);})[_0xf3ee('0x20')](function(_0x2db55d){_0x4cdd80[_0xf3ee('0x43')]=_0x2db55d;return _0x4cdd80;})[_0xf3ee('0x20')](respondWithFilteredResult(_0x223c66,_0x13e23d))[_0xf3ee('0x44')](handleError(_0x223c66,null));};exports['show']=function(_0x5b37f0,_0x475821){var _0x2a43f5={'raw':!![],'where':{'id':_0x5b37f0[_0xf3ee('0x45')]['id']}},_0x3c7af1={};_0x3c7af1['model']=_['keys'](db[_0xf3ee('0x2c')][_0xf3ee('0x2d')]);_0x3c7af1['query']=_[_0xf3ee('0x32')](_0x5b37f0[_0xf3ee('0x33')]);_0x3c7af1[_0xf3ee('0x34')]=_[_0xf3ee('0x35')](_0x3c7af1[_0xf3ee('0x31')],_0x3c7af1[_0xf3ee('0x33')]);_0x2a43f5['attributes']=_[_0xf3ee('0x35')](_0x3c7af1['model'],qs[_0xf3ee('0x37')](_0x5b37f0[_0xf3ee('0x33')]['fields']));_0x2a43f5[_0xf3ee('0x36')]=_0x2a43f5[_0xf3ee('0x36')][_0xf3ee('0x38')]?_0x2a43f5['attributes']:_0x3c7af1['model'];if(_0x5b37f0['query']['includeAll']){_0x2a43f5['include']=[{'all':!![]}];}_0x2a43f5=_[_0xf3ee('0x3e')]({},_0x2a43f5,_0x5b37f0['options']);return db[_0xf3ee('0x2c')][_0xf3ee('0x46')](_0x2a43f5)[_0xf3ee('0x20')](handleEntityNotFound(_0x475821,null))['then'](respondWithResult(_0x475821,null))[_0xf3ee('0x44')](handleError(_0x475821,null));};exports[_0xf3ee('0x47')]=function(_0x120fb0,_0x402ec9){return db[_0xf3ee('0x2c')][_0xf3ee('0x47')](_0x120fb0[_0xf3ee('0x48')],{})[_0xf3ee('0x20')](function(_0x8c9e67){var _0xaefb01=_0x120fb0[_0xf3ee('0x49')][_0xf3ee('0x21')]({'plain':!![]});if(!_0xaefb01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaefb01[_0xf3ee('0x4a')]===_0xf3ee('0x49')){var _0x5bae8b=_0x8c9e67[_0xf3ee('0x21')]({'plain':!![]});var _0x3bda7e=_0xf3ee('0x22');return db[_0xf3ee('0x4b')]['find']({'where':{'name':_0x3bda7e,'userProfileId':_0xaefb01[_0xf3ee('0x4c')]},'raw':!![]})['then'](function(_0x6ea4a3){if(_0x6ea4a3&&_0x6ea4a3[_0xf3ee('0x4d')]===0x0){return db[_0xf3ee('0x23')]['create']({'name':_0x5bae8b[_0xf3ee('0x28')],'resourceId':_0x5bae8b['id'],'type':_0x6ea4a3['name'],'sectionId':_0x6ea4a3['id']},{})[_0xf3ee('0x20')](function(){return _0x8c9e67;});}else{return _0x8c9e67;}})[_0xf3ee('0x44')](function(_0x1fee3c){logger['error'](_0xf3ee('0x4e'),_0x1fee3c);throw _0x1fee3c;});}return _0x8c9e67;})['then'](respondWithResult(_0x402ec9,0xc9))['catch'](handleError(_0x402ec9,null));};exports[_0xf3ee('0x4f')]=function(_0x32ea25,_0x2a5d6d){if(_0x32ea25[_0xf3ee('0x48')]['id']){delete _0x32ea25['body']['id'];}return db[_0xf3ee('0x2c')][_0xf3ee('0x46')]({'where':{'id':_0x32ea25[_0xf3ee('0x45')]['id']}})[_0xf3ee('0x20')](handleEntityNotFound(_0x2a5d6d,null))[_0xf3ee('0x20')](saveUpdates(_0x32ea25[_0xf3ee('0x48')],null))['then'](respondWithResult(_0x2a5d6d,null))[_0xf3ee('0x44')](handleError(_0x2a5d6d,null));};exports[_0xf3ee('0x24')]=function(_0x3f847d,_0x513573){return db[_0xf3ee('0x2c')][_0xf3ee('0x46')]({'where':{'id':_0x3f847d[_0xf3ee('0x45')]['id']}})[_0xf3ee('0x20')](handleEntityNotFound(_0x513573,null))[_0xf3ee('0x20')](removeEntity(_0x513573,null))[_0xf3ee('0x44')](handleError(_0x513573,null));}; \ No newline at end of file +var _0x8aa1=['squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','end','stack','name','send','index','Variable','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','user','role','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','bluebird','mustache','path','to-csv','fs-extra','lodash'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x8aa1,0x134));var _0x18aa=function(_0x58e84a,_0x57ed90){_0x58e84a=_0x58e84a-0x0;var _0x3b2e7f=_0x8aa1[_0x58e84a];return _0x3b2e7f;};'use strict';var emlformat=require(_0x18aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18aa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x18aa('0x2'));var Mustache=require(_0x18aa('0x3'));var util=require('util');var path=require(_0x18aa('0x4'));var sox=require('sox');var csv=require(_0x18aa('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18aa('0x6'));var _=require(_0x18aa('0x7'));var squel=require(_0x18aa('0x8'));var crypto=require(_0x18aa('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x18aa('0xa'));var toCsv=require('to-csv');var querystring=require(_0x18aa('0xb'));var Papa=require('papaparse');var Redis=require(_0x18aa('0xc'));var authService=require(_0x18aa('0xd'));var qs=require(_0x18aa('0xe'));var as=require(_0x18aa('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18aa('0x10'))(_0x18aa('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x18aa('0x12'));var db=require(_0x18aa('0x13'))['db'];function respondWithStatusCode(_0x61265c,_0x1995eb){_0x1995eb=_0x1995eb||0xcc;return function(_0x4caab5){if(_0x4caab5){return _0x61265c[_0x18aa('0x14')](_0x1995eb);}return _0x61265c[_0x18aa('0x15')](_0x1995eb)['end']();};}function respondWithResult(_0x5dc157,_0x57611b){_0x57611b=_0x57611b||0xc8;return function(_0x42b614){if(_0x42b614){return _0x5dc157[_0x18aa('0x15')](_0x57611b)[_0x18aa('0x16')](_0x42b614);}};}function respondWithFilteredResult(_0x3dda3f,_0x33c240){return function(_0x357232){if(_0x357232){var _0x39bc64=typeof _0x33c240[_0x18aa('0x17')]==='undefined'&&typeof _0x33c240[_0x18aa('0x18')]===_0x18aa('0x19');var _0x203a84=_0x357232[_0x18aa('0x1a')];var _0x587ec5=_0x39bc64?0x0:_0x33c240[_0x18aa('0x17')];var _0x7c114d=_0x39bc64?_0x357232['count']:_0x33c240['offset']+_0x33c240[_0x18aa('0x18')];var _0x2bd4f6;if(_0x7c114d>=_0x203a84){_0x7c114d=_0x203a84;_0x2bd4f6=0xc8;}else{_0x2bd4f6=0xce;}_0x3dda3f[_0x18aa('0x15')](_0x2bd4f6);return _0x3dda3f[_0x18aa('0x1b')](_0x18aa('0x1c'),_0x587ec5+'-'+_0x7c114d+'/'+_0x203a84)[_0x18aa('0x16')](_0x357232);}return null;};}function patchUpdates(_0x1aa24d){return function(_0x2eaeb7){try{jsonpatch['apply'](_0x2eaeb7,_0x1aa24d,!![]);}catch(_0x303e77){return BPromise[_0x18aa('0x1d')](_0x303e77);}return _0x2eaeb7[_0x18aa('0x1e')]();};}function saveUpdates(_0x3bbd48,_0x4d893e){return function(_0x2657be){if(_0x2657be){return _0x2657be[_0x18aa('0x1f')](_0x3bbd48)[_0x18aa('0x20')](function(_0x1a0fba){return _0x1a0fba;});}return null;};}function removeEntity(_0x12d117,_0x3b10a7){return function(_0x5a83e2){if(_0x5a83e2){return _0x5a83e2['destroy']()[_0x18aa('0x20')](function(){var _0xe2bb08=_0x5a83e2[_0x18aa('0x21')]({'plain':!![]});var _0x496fb4='Variables';return db[_0x18aa('0x22')][_0x18aa('0x23')]({'where':{'type':_0x496fb4,'resourceId':_0xe2bb08['id']}})['then'](function(){return _0x5a83e2;});})['then'](function(){_0x12d117[_0x18aa('0x15')](0xcc)[_0x18aa('0x24')]();});}};}function handleEntityNotFound(_0x1f523c,_0x5a4752){return function(_0x417b82){if(!_0x417b82){_0x1f523c[_0x18aa('0x14')](0x194);}return _0x417b82;};}function handleError(_0x2338bf,_0x4bb8bc){_0x4bb8bc=_0x4bb8bc||0x1f4;return function(_0x2ee644){logger['error'](_0x2ee644[_0x18aa('0x25')]);if(_0x2ee644[_0x18aa('0x26')]){delete _0x2ee644[_0x18aa('0x26')];}_0x2338bf[_0x18aa('0x15')](_0x4bb8bc)[_0x18aa('0x27')](_0x2ee644);};}exports[_0x18aa('0x28')]=function(_0x1ede10,_0x12915d){var _0x3b0d0b={},_0x5de3ec={},_0x32cd7c={'count':0x0,'rows':[]};var _0x57980c=_['map'](db[_0x18aa('0x29')][_0x18aa('0x2a')],function(_0x43a6f6){return{'name':_0x43a6f6[_0x18aa('0x2b')],'type':_0x43a6f6[_0x18aa('0x2c')]['key']};});_0x5de3ec[_0x18aa('0x2d')]=_[_0x18aa('0x2e')](_0x57980c,_0x18aa('0x26'));_0x5de3ec['query']=_[_0x18aa('0x2f')](_0x1ede10[_0x18aa('0x30')]);_0x5de3ec['filters']=_[_0x18aa('0x31')](_0x5de3ec[_0x18aa('0x2d')],_0x5de3ec['query']);_0x3b0d0b[_0x18aa('0x32')]=_[_0x18aa('0x31')](_0x5de3ec['model'],qs[_0x18aa('0x33')](_0x1ede10['query'][_0x18aa('0x33')]));_0x3b0d0b['attributes']=_0x3b0d0b[_0x18aa('0x32')][_0x18aa('0x34')]?_0x3b0d0b[_0x18aa('0x32')]:_0x5de3ec[_0x18aa('0x2d')];if(!_0x1ede10[_0x18aa('0x30')][_0x18aa('0x35')]('nolimit')){_0x3b0d0b[_0x18aa('0x18')]=qs['limit'](_0x1ede10['query'][_0x18aa('0x18')]);_0x3b0d0b[_0x18aa('0x17')]=qs[_0x18aa('0x17')](_0x1ede10[_0x18aa('0x30')][_0x18aa('0x17')]);}_0x3b0d0b[_0x18aa('0x36')]=qs[_0x18aa('0x37')](_0x1ede10[_0x18aa('0x30')][_0x18aa('0x37')]);_0x3b0d0b[_0x18aa('0x38')]=qs[_0x18aa('0x39')](_[_0x18aa('0x3a')](_0x1ede10['query'],_0x5de3ec[_0x18aa('0x39')]),_0x57980c);if(_0x1ede10[_0x18aa('0x30')][_0x18aa('0x3b')]){_0x3b0d0b[_0x18aa('0x38')]=_['merge'](_0x3b0d0b[_0x18aa('0x38')],{'$or':_[_0x18aa('0x2e')](_0x57980c,function(_0x699f8){if(_0x699f8[_0x18aa('0x2c')]!==_0x18aa('0x3c')){var _0x5ddd81={};_0x5ddd81[_0x699f8[_0x18aa('0x26')]]={'$like':'%'+_0x1ede10[_0x18aa('0x30')]['filter']+'%'};return _0x5ddd81;}})});}_0x3b0d0b=_[_0x18aa('0x3d')]({},_0x3b0d0b,_0x1ede10[_0x18aa('0x3e')]);var _0x4db83f={'where':_0x3b0d0b['where']};return db['Variable']['count'](_0x4db83f)[_0x18aa('0x20')](function(_0x24b229){_0x32cd7c[_0x18aa('0x1a')]=_0x24b229;if(_0x1ede10['query'][_0x18aa('0x3f')]){_0x3b0d0b[_0x18aa('0x40')]=[{'all':!![]}];}return db['Variable'][_0x18aa('0x41')](_0x3b0d0b);})[_0x18aa('0x20')](function(_0x398277){_0x32cd7c[_0x18aa('0x42')]=_0x398277;return _0x32cd7c;})['then'](respondWithFilteredResult(_0x12915d,_0x3b0d0b))['catch'](handleError(_0x12915d,null));};exports[_0x18aa('0x43')]=function(_0x324a38,_0x435d3f){var _0x91db91={'raw':!![],'where':{'id':_0x324a38['params']['id']}},_0x44b832={};_0x44b832[_0x18aa('0x2d')]=_[_0x18aa('0x2f')](db[_0x18aa('0x29')][_0x18aa('0x2a')]);_0x44b832[_0x18aa('0x30')]=_[_0x18aa('0x2f')](_0x324a38[_0x18aa('0x30')]);_0x44b832[_0x18aa('0x39')]=_['intersection'](_0x44b832[_0x18aa('0x2d')],_0x44b832['query']);_0x91db91[_0x18aa('0x32')]=_['intersection'](_0x44b832[_0x18aa('0x2d')],qs[_0x18aa('0x33')](_0x324a38[_0x18aa('0x30')][_0x18aa('0x33')]));_0x91db91[_0x18aa('0x32')]=_0x91db91[_0x18aa('0x32')][_0x18aa('0x34')]?_0x91db91[_0x18aa('0x32')]:_0x44b832[_0x18aa('0x2d')];if(_0x324a38[_0x18aa('0x30')][_0x18aa('0x3f')]){_0x91db91['include']=[{'all':!![]}];}_0x91db91=_[_0x18aa('0x3d')]({},_0x91db91,_0x324a38[_0x18aa('0x3e')]);return db[_0x18aa('0x29')][_0x18aa('0x44')](_0x91db91)['then'](handleEntityNotFound(_0x435d3f,null))[_0x18aa('0x20')](respondWithResult(_0x435d3f,null))[_0x18aa('0x45')](handleError(_0x435d3f,null));};exports['create']=function(_0x410b23,_0x2ea8cc){return db[_0x18aa('0x29')][_0x18aa('0x46')](_0x410b23['body'],{})[_0x18aa('0x20')](function(_0x3c81d3){var _0xd0b4d6=_0x410b23[_0x18aa('0x47')][_0x18aa('0x21')]({'plain':!![]});if(!_0xd0b4d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd0b4d6[_0x18aa('0x48')]===_0x18aa('0x47')){var _0x5b704d=_0x3c81d3[_0x18aa('0x21')]({'plain':!![]});var _0x5136a0=_0x18aa('0x49');return db[_0x18aa('0x4a')][_0x18aa('0x44')]({'where':{'name':_0x5136a0,'userProfileId':_0xd0b4d6[_0x18aa('0x4b')]},'raw':!![]})[_0x18aa('0x20')](function(_0x575bc8){if(_0x575bc8&&_0x575bc8[_0x18aa('0x4c')]===0x0){return db['UserProfileResource'][_0x18aa('0x46')]({'name':_0x5b704d[_0x18aa('0x26')],'resourceId':_0x5b704d['id'],'type':_0x575bc8[_0x18aa('0x26')],'sectionId':_0x575bc8['id']},{})[_0x18aa('0x20')](function(){return _0x3c81d3;});}else{return _0x3c81d3;}})[_0x18aa('0x45')](function(_0x3a2138){logger['error'](_0x18aa('0x4d'),_0x3a2138);throw _0x3a2138;});}return _0x3c81d3;})['then'](respondWithResult(_0x2ea8cc,0xc9))[_0x18aa('0x45')](handleError(_0x2ea8cc,null));};exports[_0x18aa('0x1f')]=function(_0x509711,_0x43701c){if(_0x509711['body']['id']){delete _0x509711['body']['id'];}return db['Variable'][_0x18aa('0x44')]({'where':{'id':_0x509711[_0x18aa('0x4e')]['id']}})[_0x18aa('0x20')](handleEntityNotFound(_0x43701c,null))['then'](saveUpdates(_0x509711['body'],null))[_0x18aa('0x20')](respondWithResult(_0x43701c,null))[_0x18aa('0x45')](handleError(_0x43701c,null));};exports[_0x18aa('0x23')]=function(_0x57453e,_0xacb05){return db[_0x18aa('0x29')][_0x18aa('0x44')]({'where':{'id':_0x57453e[_0x18aa('0x4e')]['id']}})[_0x18aa('0x20')](handleEntityNotFound(_0xacb05,null))[_0x18aa('0x20')](removeEntity(_0xacb05,null))['catch'](handleError(_0xacb05,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 011d7e8..e3f0e93 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 _0x498e=['api','request-promise','path','exports','Variable','tools_variables','lodash','util','../../config/logger'];(function(_0x5096a5,_0x460c32){var _0x1cee5b=function(_0x50be37){while(--_0x50be37){_0x5096a5['push'](_0x5096a5['shift']());}};_0x1cee5b(++_0x460c32);}(_0x498e,0x1ad));var _0xe498=function(_0x3e4d28,_0x3face9){_0x3e4d28=_0x3e4d28-0x0;var _0x11a3af=_0x498e[_0x3e4d28];return _0x11a3af;};'use strict';var _=require(_0xe498('0x0'));var util=require(_0xe498('0x1'));var logger=require(_0xe498('0x2'))(_0xe498('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe498('0x4'));var fs=require('fs');var path=require(_0xe498('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xe498('0x6')]=function(_0x49c315,_0x171ec2){return _0x49c315['define'](_0xe498('0x7'),attributes,{'tableName':_0xe498('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb65e=['bluebird','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x13659a,_0x41453c){var _0x4b1c49=function(_0x270c47){while(--_0x270c47){_0x13659a['push'](_0x13659a['shift']());}};_0x4b1c49(++_0x41453c);}(_0xb65e,0x1b4));var _0xeb65=function(_0x27939f,_0x2d0a36){_0x27939f=_0x27939f-0x0;var _0x39614d=_0xb65e[_0x27939f];return _0x39614d;};'use strict';var _=require(_0xeb65('0x0'));var util=require(_0xeb65('0x1'));var logger=require(_0xeb65('0x2'))(_0xeb65('0x3'));var moment=require(_0xeb65('0x4'));var BPromise=require(_0xeb65('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module['exports']=function(_0x150565,_0x57527c){return _0x150565[_0xeb65('0x6')](_0xeb65('0x7'),attributes,{'tableName':_0xeb65('0x8'),'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 bd4a0cc..9e66007 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x577acd,_0x2dddb2){var _0x2bfd74=function(_0x39d069){while(--_0x39d069){_0x577acd['push'](_0x577acd['shift']());}};_0x2bfd74(++_0x2dddb2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x35f98d,_0x21687c){_0x35f98d=_0x35f98d-0x0;var _0x3ed52d=_0x1cb9[_0x35f98d];return _0x3ed52d;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa41a,0x6b));var _0xaa41=function(_0x4f6110,_0x5e40db){_0x4f6110=_0x4f6110-0x0;var _0x38afc8=_0xa41a[_0x4f6110];return _0x38afc8;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 690cb6f..30e9eba 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 _0x989e=['fetch','/reset','canUpdate','reset','/pull','pull','migrations','exports','../../components/auth/service','get','index','/fetch','isAuthenticated'];(function(_0xbc1574,_0x5ac3bb){var _0x180d35=function(_0x3edcf4){while(--_0x3edcf4){_0xbc1574['push'](_0xbc1574['shift']());}};_0x180d35(++_0x5ac3bb);}(_0x989e,0xd8));var _0xe989=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x989e[_0x99868f];return _0x27a71b;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xe989('0x0'));var controller=require('./version.controller');router[_0xe989('0x1')]('/',controller[_0xe989('0x2')]);router['get'](_0xe989('0x3'),auth[_0xe989('0x4')](),auth['canUpdate'](),controller[_0xe989('0x5')]);router[_0xe989('0x1')](_0xe989('0x6'),auth[_0xe989('0x4')](),auth[_0xe989('0x7')](),controller[_0xe989('0x8')]);router[_0xe989('0x1')](_0xe989('0x9'),auth['isAuthenticated'](),auth[_0xe989('0x7')](),controller[_0xe989('0xa')]);router[_0xe989('0x1')]('/restart',auth[_0xe989('0x4')](),controller['restart']);router['get']('/migrations',controller[_0xe989('0xb')]);module[_0xe989('0xc')]=router; \ No newline at end of file +var _0x8b1a=['/migrations','migrations','exports','Router','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart'];(function(_0x5ecbbc,_0x2e0e54){var _0x364bb6=function(_0x5b8f62){while(--_0x5b8f62){_0x5ecbbc['push'](_0x5ecbbc['shift']());}};_0x364bb6(++_0x2e0e54);}(_0x8b1a,0x1c5));var _0xa8b1=function(_0x2f3dd6,_0xf43ba3){_0x2f3dd6=_0x2f3dd6-0x0;var _0x211199=_0x8b1a[_0x2f3dd6];return _0x211199;};'use strict';var express=require('express');var router=express[_0xa8b1('0x0')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xa8b1('0x1')]('/',controller[_0xa8b1('0x2')]);router[_0xa8b1('0x1')](_0xa8b1('0x3'),auth[_0xa8b1('0x4')](),auth[_0xa8b1('0x5')](),controller[_0xa8b1('0x6')]);router[_0xa8b1('0x1')](_0xa8b1('0x7'),auth[_0xa8b1('0x4')](),auth[_0xa8b1('0x5')](),controller[_0xa8b1('0x8')]);router[_0xa8b1('0x1')](_0xa8b1('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0xa8b1('0x1')](_0xa8b1('0xa'),auth[_0xa8b1('0x4')](),controller[_0xa8b1('0xb')]);router[_0xa8b1('0x1')](_0xa8b1('0xc'),controller[_0xa8b1('0xd')]);module[_0xa8b1('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a5d75fa..0254015 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 _0x41a3=['latest','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','fetch'];(function(_0x3d687f,_0x1a59f8){var _0x21859b=function(_0x441c20){while(--_0x441c20){_0x3d687f['push'](_0x3d687f['shift']());}};_0x21859b(++_0x1a59f8);}(_0x41a3,0x1cd));var _0x341a=function(_0xf52bb7,_0x5df494){_0xf52bb7=_0xf52bb7-0x0;var _0x4e36dc=_0x41a3[_0xf52bb7];return _0x4e36dc;};'use strict';var Umzug=require(_0x341a('0x0'));var path=require(_0x341a('0x1'));var fs=require('fs');var _=require(_0x341a('0x2'));var pkginfo=require(_0x341a('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x341a('0x4'))[_0x341a('0x5')];var db=require(_0x341a('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x341a('0x7'));var logger=require(_0x341a('0x8'))(_0x341a('0x9'));var git=require(_0x341a('0xa'))(config[_0x341a('0xb')]);exports['index']=function(_0xacde50,_0x2f57ea){var _0x43d178={'current':module[_0x341a('0xc')][_0x341a('0xd')],'phonebar':0x2};if(_0xacde50[_0x341a('0xe')]&&_0xacde50[_0x341a('0xe')]['latest']){return git[_0x341a('0xf')]()['tags'](function(_0x5ed97f,_0x5bfbc1){_0x43d178[_0x341a('0x10')]=(_0x5ed97f?module[_0x341a('0xc')][_0x341a('0xd')]:_0x5bfbc1['latest'])||'2.0.0';return _0x2f57ea[_0x341a('0x11')](0xc8)[_0x341a('0x12')](_0x43d178);});}else{return _0x2f57ea[_0x341a('0x11')](0xc8)['json'](_0x43d178);}};exports[_0x341a('0xf')]=function(_0x206dd4,_0x533726){return git[_0x341a('0xf')](['origin',_0x341a('0x13')],function(_0x3fb9ca){if(_0x3fb9ca){logger[_0x341a('0x14')](_0x3fb9ca);return _0x533726[_0x341a('0x11')](0x1f4)['json'](_0x3fb9ca);}logger[_0x341a('0x15')](_0x341a('0x16'));return _0x533726[_0x341a('0x11')](0xc8)[_0x341a('0x12')]({'output':_0x341a('0x17')});});};exports['reset']=function(_0x1ae6eb,_0x462c6e){return git['reset']([_0x341a('0x18'),_0x341a('0x19')],function(_0x5ab301){if(_0x5ab301){logger[_0x341a('0x14')](_0x5ab301);return _0x462c6e[_0x341a('0x11')](0x1f4)[_0x341a('0x12')](_0x5ab301);}logger[_0x341a('0x15')](_0x341a('0x1a'));return _0x462c6e[_0x341a('0x11')](0xc8)['json']({'output':_0x341a('0x1b')});});};exports[_0x341a('0x1c')]=function(_0x5921a1,_0x29dbf5){exec(_0x341a('0x1d'),function(_0x8f07c4,_0x4707b5,_0x9d1c16){logger[_0x341a('0x15')](_0x4707b5);logger[_0x341a('0x15')](_0x9d1c16);if(_0x8f07c4){logger[_0x341a('0x14')](_0x8f07c4);return _0x29dbf5[_0x341a('0x11')](0x1f4)[_0x341a('0x12')](_0x8f07c4);}return _0x29dbf5[_0x341a('0x11')](0xc8)[_0x341a('0x12')]({'output':_0x4707b5});});};exports['restart']=function(_0x8f70d1,_0x3b1e66){return pm2['restart'](_0x341a('0x1e'))[_0x341a('0x1f')](function(_0x1d362e){logger[_0x341a('0x15')](_0x341a('0x20'),_0x1d362e);return _0x3b1e66[_0x341a('0x11')](0xc8)[_0x341a('0x12')]({'output':_0x341a('0x21')});})[_0x341a('0x22')](function(_0x36048e){logger[_0x341a('0x14')](_0x36048e);return _0x3b1e66['status'](0x1f4)[_0x341a('0x12')](_0x36048e);});};exports[_0x341a('0x23')]=function(_0xa80e94,_0x1219c4){var _0x235c11=fs[_0x341a('0x24')](path['join'](config[_0x341a('0xb')],_0x341a('0x25'),'migrations'));var _0x39834a=[];for(var _0x45fd6b=0x0;_0x45fd6b<_0x235c11[_0x341a('0x26')];_0x45fd6b++){var _0x94a34a=_0x235c11[_0x45fd6b][_0x341a('0x27')](_0x341a('0x28'),'');if(compareVersions(module[_0x341a('0xc')][_0x341a('0xd')],_0x94a34a)===-0x1){_0x39834a[_0x341a('0x29')](_0x94a34a);}}if(_0x39834a[_0x341a('0x26')]){var _0xb42e15=_0x39834a[_0x341a('0x2a')](compareVersions);var _0x490e7a=new Umzug({'storage':_0x341a('0x2b'),'storageOptions':{'model':db[_0x341a('0x2c')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0x341a('0x2d')](),db[_0x341a('0x2b')][_0x341a('0x2e')],function(){throw new Error(_0x341a('0x2f'));}],'path':path[_0x341a('0x30')](config[_0x341a('0xb')],'server','migrations'),'pattern':/\.js$/}});_0x490e7a['up']({'migrations':_['map'](_0xb42e15,function(_0x129451){return _0x129451+_0x341a('0x28');})})['then'](function(){return _0x1219c4['status'](0xc8)['json']({'output':_0x341a('0x31')+module[_0x341a('0xc')][_0x341a('0xd')]+'\x20to\x20'+_[_0x341a('0x32')](_0xb42e15),'migrations':_[_0x341a('0x30')](_0xb42e15)});})[_0x341a('0x22')](function(_0x3b8f12){if(_0x3b8f12 instanceof db[_0x341a('0x2b')][_0x341a('0x33')]){return _0x1219c4[_0x341a('0x11')](0xc8)[_0x341a('0x12')]({'output':_0x341a('0x34')});}else{return _0x1219c4[_0x341a('0x11')](0x1f4)['json'](_0x3b8f12);}});}else{return _0x1219c4[_0x341a('0x11')](0xc8)[_0x341a('0x12')]({'output':_0x341a('0x34')});}}; \ No newline at end of file +var _0xaa08=['fetch','tags','2.0.0','json','status','origin','info','git\x20fetch','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/pm2','update','simple-git','root','exports','query','latest'];(function(_0x190573,_0x5edd6a){var _0x314ec1=function(_0x285bee){while(--_0x285bee){_0x190573['push'](_0x190573['shift']());}};_0x314ec1(++_0x5edd6a);}(_0xaa08,0x113));var _0x8aa0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xaa08[_0x3b380d];return _0x54502b;};'use strict';var Umzug=require(_0x8aa0('0x0'));var path=require(_0x8aa0('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x8aa0('0x2'))(module,_0x8aa0('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x8aa0('0x4')];var db=require(_0x8aa0('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0x8aa0('0x6'));var logger=require('../../config/logger')(_0x8aa0('0x7'));var git=require(_0x8aa0('0x8'))(config[_0x8aa0('0x9')]);exports['index']=function(_0x53b5ea,_0x59ccd5){var _0x178e71={'current':module[_0x8aa0('0xa')][_0x8aa0('0x3')],'phonebar':0x2};if(_0x53b5ea[_0x8aa0('0xb')]&&_0x53b5ea['query'][_0x8aa0('0xc')]){return git[_0x8aa0('0xd')]()[_0x8aa0('0xe')](function(_0x588ac0,_0x40a13e){_0x178e71[_0x8aa0('0xc')]=(_0x588ac0?module[_0x8aa0('0xa')]['version']:_0x40a13e['latest'])||_0x8aa0('0xf');return _0x59ccd5['status'](0xc8)[_0x8aa0('0x10')](_0x178e71);});}else{return _0x59ccd5[_0x8aa0('0x11')](0xc8)[_0x8aa0('0x10')](_0x178e71);}};exports[_0x8aa0('0xd')]=function(_0x9d0c49,_0x40dfca){return git[_0x8aa0('0xd')]([_0x8aa0('0x12'),'master'],function(_0x4edd6d){if(_0x4edd6d){logger['error'](_0x4edd6d);return _0x40dfca[_0x8aa0('0x11')](0x1f4)[_0x8aa0('0x10')](_0x4edd6d);}logger[_0x8aa0('0x13')](_0x8aa0('0x14'));return _0x40dfca[_0x8aa0('0x11')](0xc8)[_0x8aa0('0x10')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x5f2e20,_0x4756f2){return git[_0x8aa0('0x15')]([_0x8aa0('0x16'),_0x8aa0('0x17')],function(_0x46ab20){if(_0x46ab20){logger[_0x8aa0('0x18')](_0x46ab20);return _0x4756f2[_0x8aa0('0x11')](0x1f4)['json'](_0x46ab20);}logger[_0x8aa0('0x13')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4756f2['status'](0xc8)[_0x8aa0('0x10')]({'output':_0x8aa0('0x19')});});};exports[_0x8aa0('0x1a')]=function(_0x2f5498,_0x32fb46){exec('npm\x20install\x20--production',function(_0x3edc4e,_0x2e5f9e,_0x417a67){logger[_0x8aa0('0x13')](_0x2e5f9e);logger[_0x8aa0('0x13')](_0x417a67);if(_0x3edc4e){logger[_0x8aa0('0x18')](_0x3edc4e);return _0x32fb46[_0x8aa0('0x11')](0x1f4)[_0x8aa0('0x10')](_0x3edc4e);}return _0x32fb46[_0x8aa0('0x11')](0xc8)[_0x8aa0('0x10')]({'output':_0x2e5f9e});});};exports['restart']=function(_0x227e00,_0x202c50){return pm2[_0x8aa0('0x1b')](_0x8aa0('0x1c'))[_0x8aa0('0x1d')](function(_0x24c28e){logger[_0x8aa0('0x13')]('pm2\x20restart\x20motion\x20%s',_0x24c28e);return _0x202c50[_0x8aa0('0x11')](0xc8)['json']({'output':_0x8aa0('0x1e')});})[_0x8aa0('0x1f')](function(_0x394ec7){logger[_0x8aa0('0x18')](_0x394ec7);return _0x202c50[_0x8aa0('0x11')](0x1f4)[_0x8aa0('0x10')](_0x394ec7);});};exports['migrations']=function(_0x9fb8c,_0x15353d){var _0xd6c0cf=fs[_0x8aa0('0x20')](path[_0x8aa0('0x21')](config[_0x8aa0('0x9')],_0x8aa0('0x22'),_0x8aa0('0x23')));var _0xe420b0=[];for(var _0x2bc86c=0x0;_0x2bc86c<_0xd6c0cf[_0x8aa0('0x24')];_0x2bc86c++){var _0x101e71=_0xd6c0cf[_0x2bc86c][_0x8aa0('0x25')](_0x8aa0('0x26'),'');if(compareVersions(module[_0x8aa0('0xa')][_0x8aa0('0x3')],_0x101e71)===-0x1){_0xe420b0['push'](_0x101e71);}}if(_0xe420b0[_0x8aa0('0x24')]){var _0x1930e8=_0xe420b0['sort'](compareVersions);var _0x4a37cc=new Umzug({'storage':_0x8aa0('0x27'),'storageOptions':{'model':db[_0x8aa0('0x28')],'modelName':_0x8aa0('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x8aa0('0x27')]['getQueryInterface'](),db[_0x8aa0('0x27')][_0x8aa0('0x29')],function(){throw new Error(_0x8aa0('0x2a'));}],'path':path[_0x8aa0('0x21')](config[_0x8aa0('0x9')],_0x8aa0('0x22'),_0x8aa0('0x23')),'pattern':/\.js$/}});_0x4a37cc['up']({'migrations':_[_0x8aa0('0x2b')](_0x1930e8,function(_0x218028){return _0x218028+_0x8aa0('0x26');})})[_0x8aa0('0x1d')](function(){return _0x15353d['status'](0xc8)[_0x8aa0('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8aa0('0xa')][_0x8aa0('0x3')]+_0x8aa0('0x2c')+_[_0x8aa0('0x2d')](_0x1930e8),'migrations':_['join'](_0x1930e8)});})[_0x8aa0('0x1f')](function(_0x59d1c1){if(_0x59d1c1 instanceof db[_0x8aa0('0x27')][_0x8aa0('0x2e')]){return _0x15353d[_0x8aa0('0x11')](0xc8)[_0x8aa0('0x10')]({'output':_0x8aa0('0x2f')});}else{return _0x15353d['status'](0x1f4)[_0x8aa0('0x10')](_0x59d1c1);}});}else{return _0x15353d[_0x8aa0('0x11')](0xc8)[_0x8aa0('0x10')]({'output':_0x8aa0('0x2f')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5ef52fa..72f992c 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 _0x0f6c=['../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x31ce8a,_0x562868){var _0x21ce95=function(_0x3a6f04){while(--_0x3a6f04){_0x31ce8a['push'](_0x31ce8a['shift']());}};_0x21ce95(++_0x562868);}(_0x0f6c,0x1bd));var _0xc0f6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0f6c[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0xc0f6('0x0'));var path=require(_0xc0f6('0x1'));var timeout=require(_0xc0f6('0x2'));var express=require(_0xc0f6('0x3'));var router=express[_0xc0f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc0f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0f6('0x6'));var controller=require(_0xc0f6('0x7'));router[_0xc0f6('0x8')]('/',auth[_0xc0f6('0x9')](),controller['index']);router[_0xc0f6('0x8')](_0xc0f6('0xa'),auth[_0xc0f6('0x9')](),controller[_0xc0f6('0xb')]);router['get'](_0xc0f6('0xc'),auth[_0xc0f6('0x9')](),controller[_0xc0f6('0xd')]);router[_0xc0f6('0xe')]('/',auth[_0xc0f6('0x9')](),controller['create']);router[_0xc0f6('0xf')](_0xc0f6('0xc'),auth[_0xc0f6('0x9')](),controller['update']);router[_0xc0f6('0x10')]('/:id',auth[_0xc0f6('0x9')](),controller['destroy']);module[_0xc0f6('0x11')]=router; \ No newline at end of file +var _0x09e0=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0xaf3002,_0x27aa2a){var _0xc85101=function(_0xa4d741){while(--_0xa4d741){_0xaf3002['push'](_0xaf3002['shift']());}};_0xc85101(++_0x27aa2a);}(_0x09e0,0x145));var _0x009e=function(_0x143368,_0x5d0b64){_0x143368=_0x143368-0x0;var _0x44c10a=_0x09e0[_0x143368];return _0x44c10a;};'use strict';var multer=require(_0x009e('0x0'));var util=require(_0x009e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x009e('0x2')]();var fs_extra=require(_0x009e('0x3'));var auth=require(_0x009e('0x4'));var interaction=require(_0x009e('0x5'));var config=require(_0x009e('0x6'));var controller=require(_0x009e('0x7'));router[_0x009e('0x8')]('/',auth['isAuthenticated'](),controller[_0x009e('0x9')]);router[_0x009e('0x8')](_0x009e('0xa'),auth[_0x009e('0xb')](),controller[_0x009e('0xc')]);router[_0x009e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x009e('0xd')]);router[_0x009e('0xe')]('/',auth[_0x009e('0xb')](),controller[_0x009e('0xf')]);router[_0x009e('0x10')](_0x009e('0x11'),auth[_0x009e('0xb')](),controller[_0x009e('0x12')]);router[_0x009e('0x13')](_0x009e('0x11'),auth['isAuthenticated'](),controller[_0x009e('0x14')]);module[_0x009e('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index aa9c21b..4cd85a0 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 _0x9d5b=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x312899,_0x246743){_0x312899=_0x312899-0x0;var _0x49c478=_0x9d5b[_0x312899];return _0x49c478;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'type':{'type':Sequelize[_0xb9d5('0x1')]},'uniqueid':{'type':Sequelize[_0xb9d5('0x1')]},'calleridnum':{'type':Sequelize[_0xb9d5('0x1')]},'calleridname':{'type':Sequelize[_0xb9d5('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb9d5('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xb9d5('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb9d5('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xb9d5('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xb9d5('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb9d5('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb9d5('0x4')]},'agentacw':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb9d5('0x4')]},'reason':{'type':Sequelize[_0xb9d5('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb9d5('0x1')]},'channelstate':{'type':Sequelize[_0xb9d5('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb9d5('0x1')]},'connectedlinename':{'type':Sequelize[_0xb9d5('0x1')]},'language':{'type':Sequelize[_0xb9d5('0x1')]},'accountcode':{'type':Sequelize[_0xb9d5('0x1')]},'context':{'type':Sequelize[_0xb9d5('0x1')]},'exten':{'type':Sequelize[_0xb9d5('0x1')]},'priority':{'type':Sequelize[_0xb9d5('0x1')]},'destchannel':{'type':Sequelize[_0xb9d5('0x1')]},'destchannelstate':{'type':Sequelize[_0xb9d5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb9d5('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb9d5('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb9d5('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb9d5('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb9d5('0x1')]},'destcontext':{'type':Sequelize[_0xb9d5('0x1')]},'destexten':{'type':Sequelize[_0xb9d5('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xb9d5('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb9d5('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb9d5('0x1')]},'transfer':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb9d5('0x1')],'comment':_0xb9d5('0x5')},'transferexten':{'type':Sequelize[_0xb9d5('0x1')]},'transferuniqueid':{'type':Sequelize[_0xb9d5('0x1')]},'agententerreason':{'type':Sequelize[_0xb9d5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9582=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x419a03,_0x5e0695){_0x419a03=_0x419a03-0x0;var _0x5411dc=_0x9582[_0x419a03];return _0x5411dc;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'type':{'type':Sequelize[_0x2958('0x2')]},'uniqueid':{'type':Sequelize[_0x2958('0x2')]},'calleridnum':{'type':Sequelize[_0x2958('0x2')]},'calleridname':{'type':Sequelize[_0x2958('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2958('0x2')]},'membername':{'type':Sequelize[_0x2958('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2958('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2958('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x2958('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x2958('0x3')]},'agentdumpAt':{'type':Sequelize[_0x2958('0x3')]},'holdtime':{'type':Sequelize[_0x2958('0x4')]},'agentcomplete':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x2958('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2958('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2958('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2958('0x2')]},'connectedlinename':{'type':Sequelize[_0x2958('0x2')]},'language':{'type':Sequelize[_0x2958('0x2')]},'accountcode':{'type':Sequelize[_0x2958('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2958('0x2')]},'priority':{'type':Sequelize[_0x2958('0x2')]},'destchannel':{'type':Sequelize[_0x2958('0x2')]},'destchannelstate':{'type':Sequelize[_0x2958('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2958('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2958('0x2')]},'destcalleridname':{'type':Sequelize[_0x2958('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2958('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2958('0x2')]},'destaccountcode':{'type':Sequelize[_0x2958('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2958('0x2')]},'destuniqueid':{'type':Sequelize[_0x2958('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x2958('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x2958('0x6')},'transferexten':{'type':Sequelize[_0x2958('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'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 971d7dd..04706cf 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(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 d6d10f2..605ca50 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 _0x3645=['define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x3645,0x154));var _0x5364=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x3645[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var logger=require(_0x5364('0x1'))(_0x5364('0x2'));var moment=require(_0x5364('0x3'));var BPromise=require(_0x5364('0x4'));var rp=require(_0x5364('0x5'));var fs=require('fs');var path=require(_0x5364('0x6'));var rimraf=require('rimraf');var config=require(_0x5364('0x7'));var attributes=require(_0x5364('0x8'));module[_0x5364('0x9')]=function(_0x1f9c6b,_0x417c44){return _0x1f9c6b[_0x5364('0xa')](_0x5364('0xb'),attributes,{'tableName':_0x5364('0xc'),'paranoid':![],'indexes':[{'fields':[_0x5364('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc492=['../../config/environment','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x465873,_0x1bc11c){var _0x49f729=function(_0x3198ff){while(--_0x3198ff){_0x465873['push'](_0x465873['shift']());}};_0x49f729(++_0x1bc11c);}(_0xc492,0xd7));var _0x2c49=function(_0x1e3051,_0x419297){_0x1e3051=_0x1e3051-0x0;var _0x3e0d96=_0xc492[_0x1e3051];return _0x3e0d96;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var logger=require(_0x2c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0x2c49('0x6')]=function(_0x499c4e,_0x3ad911){return _0x499c4e[_0x2c49('0x7')]('VoiceAgentReport',attributes,{'tableName':_0x2c49('0x8'),'paranoid':![],'indexes':[{'fields':[_0x2c49('0x9'),_0x2c49('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index c533a91..c2289ce 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 _0x88f0=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x448d26,_0x1f39a6){var _0x1ff92f=function(_0x45e8f2){while(--_0x45e8f2){_0x448d26['push'](_0x448d26['shift']());}};_0x1ff92f(++_0x1f39a6);}(_0x88f0,0x1aa));var _0x088f=function(_0x493c8c,_0x470567){_0x493c8c=_0x493c8c-0x0;var _0x17344b=_0x88f0[_0x493c8c];return _0x17344b;};'use strict';var _=require(_0x088f('0x0'));var util=require(_0x088f('0x1'));var moment=require(_0x088f('0x2'));var BPromise=require(_0x088f('0x3'));var rs=require(_0x088f('0x4'));var fs=require('fs');var Redis=require(_0x088f('0x5'));var db=require(_0x088f('0x6'))['db'];var utils=require(_0x088f('0x7'));var logger=require(_0x088f('0x8'))(_0x088f('0x9'));var config=require('../../config/environment');var jayson=require(_0x088f('0xa'));var client=jayson['client'][_0x088f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398a27,_0x2ab600,_0x5b8f38){return new BPromise(function(_0x54b6e1,_0xf07473){return client[_0x088f('0xc')](_0x398a27,_0x5b8f38)['then'](function(_0x1aeea7){logger[_0x088f('0xd')](_0x088f('0xe'),_0x2ab600,_0x088f('0xf'));logger[_0x088f('0x10')](_0x088f('0x11'),_0x2ab600,_0x088f('0xf'),JSON[_0x088f('0x12')](_0x1aeea7));if(_0x1aeea7[_0x088f('0x13')]){if(_0x1aeea7[_0x088f('0x13')][_0x088f('0x14')]===0x1f4){logger['error'](_0x088f('0xe'),_0x2ab600,_0x1aeea7[_0x088f('0x13')][_0x088f('0x15')]);return _0xf07473(_0x1aeea7[_0x088f('0x13')][_0x088f('0x15')]);}logger[_0x088f('0x13')](_0x088f('0xe'),_0x2ab600,_0x1aeea7['error'][_0x088f('0x15')]);return _0x54b6e1(_0x1aeea7[_0x088f('0x13')][_0x088f('0x15')]);}else{logger[_0x088f('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x2ab600,_0x088f('0xf'));_0x54b6e1(_0x1aeea7[_0x088f('0x16')][_0x088f('0x15')]);}})[_0x088f('0x17')](function(_0x202612){logger['error'](_0x088f('0xe'),_0x2ab600,_0x202612);_0xf07473(_0x202612);});});}exports[_0x088f('0x18')]=function(_0x57e0a5){var _0x3ea63f=this;return new Promise(function(_0x4fdb2d,_0x45c991){return db[_0x088f('0x19')][_0x088f('0x1a')](_0x57e0a5[_0x088f('0x1b')],{'raw':_0x57e0a5['options']?_0x57e0a5[_0x088f('0x1c')][_0x088f('0x1d')]===undefined?!![]:![]:!![]})[_0x088f('0x1e')](function(_0x4f27d2){logger['info'](_0x088f('0x18'),_0x57e0a5);logger['debug'](_0x088f('0x18'),_0x57e0a5,JSON['stringify'](_0x4f27d2));_0x4fdb2d(_0x4f27d2);})[_0x088f('0x17')](function(_0xae3faa){logger[_0x088f('0x13')](_0x088f('0x18'),_0xae3faa[_0x088f('0x15')],_0x57e0a5);_0x45c991(_0x3ea63f[_0x088f('0x13')](0x1f4,_0xae3faa[_0x088f('0x15')]));});});};exports[_0x088f('0x1f')]=function(_0x42779f){var _0x59c5ed=this;return new Promise(function(_0x140b88,_0x5d6e46){return db['VoiceAgentReport'][_0x088f('0x20')](_0x42779f[_0x088f('0x1b')],{'raw':_0x42779f['options']?_0x42779f[_0x088f('0x1c')][_0x088f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42779f[_0x088f('0x1c')]?_0x42779f[_0x088f('0x1c')][_0x088f('0x21')]||null:null,'attributes':_0x42779f[_0x088f('0x1c')]?_0x42779f['options'][_0x088f('0x22')]||null:null,'limit':_0x42779f['options']?_0x42779f[_0x088f('0x1c')][_0x088f('0x23')]||null:null})[_0x088f('0x1e')](function(_0x4d5a26){logger['info'](_0x088f('0x1f'),_0x42779f);logger[_0x088f('0x10')](_0x088f('0x1f'),_0x42779f,JSON[_0x088f('0x12')](_0x4d5a26));_0x140b88(_0x4d5a26);})['catch'](function(_0x5a2d6f){logger['error'](_0x088f('0x1f'),_0x5a2d6f[_0x088f('0x15')],_0x42779f);_0x5d6e46(_0x59c5ed[_0x088f('0x13')](0x1f4,_0x5a2d6f[_0x088f('0x15')]));});});}; \ No newline at end of file +var _0x89ca=['message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','info','debug','UpdateVoiceAgentReport','update','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x89ca,0x159));var _0xa89c=function(_0x519e9a,_0x14d986){_0x519e9a=_0x519e9a-0x0;var _0x5f3619=_0x89ca[_0x519e9a];return _0x5f3619;};'use strict';var _=require(_0xa89c('0x0'));var util=require(_0xa89c('0x1'));var moment=require(_0xa89c('0x2'));var BPromise=require(_0xa89c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa89c('0x4'));var db=require(_0xa89c('0x5'))['db'];var utils=require(_0xa89c('0x6'));var logger=require(_0xa89c('0x7'))(_0xa89c('0x8'));var config=require(_0xa89c('0x9'));var jayson=require(_0xa89c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa29d31,_0x480f51,_0x518286){return new BPromise(function(_0x237880,_0x52b2a0){return client[_0xa89c('0xb')](_0xa29d31,_0x518286)[_0xa89c('0xc')](function(_0x109c8b){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x480f51,_0xa89c('0xd'));logger['debug'](_0xa89c('0xe'),_0x480f51,_0xa89c('0xd'),JSON[_0xa89c('0xf')](_0x109c8b));if(_0x109c8b[_0xa89c('0x10')]){if(_0x109c8b[_0xa89c('0x10')]['code']===0x1f4){logger[_0xa89c('0x10')](_0xa89c('0x11'),_0x480f51,_0x109c8b[_0xa89c('0x10')][_0xa89c('0x12')]);return _0x52b2a0(_0x109c8b[_0xa89c('0x10')][_0xa89c('0x12')]);}logger[_0xa89c('0x10')](_0xa89c('0x11'),_0x480f51,_0x109c8b[_0xa89c('0x10')][_0xa89c('0x12')]);return _0x237880(_0x109c8b['error'][_0xa89c('0x12')]);}else{logger['info'](_0xa89c('0x11'),_0x480f51,_0xa89c('0xd'));_0x237880(_0x109c8b[_0xa89c('0x13')][_0xa89c('0x12')]);}})[_0xa89c('0x14')](function(_0x5b6abb){logger[_0xa89c('0x10')](_0xa89c('0x11'),_0x480f51,_0x5b6abb);_0x52b2a0(_0x5b6abb);});});}exports[_0xa89c('0x15')]=function(_0x371c36){var _0x306018=this;return new Promise(function(_0x1f2f0b,_0x5bf2aa){return db[_0xa89c('0x16')][_0xa89c('0x17')](_0x371c36[_0xa89c('0x18')],{'raw':_0x371c36['options']?_0x371c36[_0xa89c('0x19')][_0xa89c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1eddd6){logger[_0xa89c('0x1b')](_0xa89c('0x15'),_0x371c36);logger[_0xa89c('0x1c')]('CreateVoiceAgentReport',_0x371c36,JSON[_0xa89c('0xf')](_0x1eddd6));_0x1f2f0b(_0x1eddd6);})[_0xa89c('0x14')](function(_0x58bc8c){logger[_0xa89c('0x10')](_0xa89c('0x15'),_0x58bc8c[_0xa89c('0x12')],_0x371c36);_0x5bf2aa(_0x306018[_0xa89c('0x10')](0x1f4,_0x58bc8c[_0xa89c('0x12')]));});});};exports[_0xa89c('0x1d')]=function(_0x2cdee3){var _0x468bae=this;return new Promise(function(_0x5547d7,_0x331ff9){return db['VoiceAgentReport'][_0xa89c('0x1e')](_0x2cdee3['body'],{'raw':_0x2cdee3[_0xa89c('0x19')]?_0x2cdee3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cdee3[_0xa89c('0x19')]?_0x2cdee3[_0xa89c('0x19')][_0xa89c('0x1f')]||null:null,'attributes':_0x2cdee3[_0xa89c('0x19')]?_0x2cdee3['options'][_0xa89c('0x20')]||null:null,'limit':_0x2cdee3['options']?_0x2cdee3[_0xa89c('0x19')]['limit']||null:null})[_0xa89c('0xc')](function(_0x490860){logger[_0xa89c('0x1b')](_0xa89c('0x1d'),_0x2cdee3);logger[_0xa89c('0x1c')](_0xa89c('0x1d'),_0x2cdee3,JSON[_0xa89c('0xf')](_0x490860));_0x5547d7(_0x490860);})[_0xa89c('0x14')](function(_0x18e6c7){logger[_0xa89c('0x10')](_0xa89c('0x1d'),_0x18e6c7[_0xa89c('0x12')],_0x2cdee3);_0x331ff9(_0x468bae[_0xa89c('0x10')](0x1f4,_0x18e6c7[_0xa89c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index fedb9a5..c79fc55 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 _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x420ab5,_0x10a996){var _0x378d65=function(_0x5a45a7){while(--_0x5a45a7){_0x420ab5['push'](_0x420ab5['shift']());}};_0x378d65(++_0x10a996);}(_0x9a19,0x114));var _0x99a1=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x9a19[_0x58e469];return _0x4c01c5;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file +var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x423f82,_0x58bc6b){var _0x492120=function(_0x8a8187){while(--_0x8a8187){_0x423f82['push'](_0x423f82['shift']());}};_0x492120(++_0x58bc6b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x47cfb2,_0x550212){_0x47cfb2=_0x47cfb2-0x0;var _0x1d5212=_0x7fbe[_0x47cfb2];return _0x1d5212;};'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['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 4e09982..b554a07 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 _0x3da7=['outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal'];(function(_0x588791,_0x35a42e){var _0x28937a=function(_0x8ca701){while(--_0x8ca701){_0x588791['push'](_0x588791['shift']());}};_0x28937a(++_0x35a42e);}(_0x3da7,0xe2));var _0x73da=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x3da7[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x73da('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x73da('0x1')]},'type':{'type':Sequelize[_0x73da('0x2')](_0x73da('0x3'),_0x73da('0x4'),_0x73da('0x5'),_0x73da('0x6'),'outbound-fax',_0x73da('0x7'))},'tag':{'type':Sequelize[_0x73da('0x1')]},'accountcode':{'type':Sequelize[_0x73da('0x1')]},'source':{'type':Sequelize[_0x73da('0x1')]},'destination':{'type':Sequelize[_0x73da('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x73da('0x1')]},'destinationchannel':{'type':Sequelize[_0x73da('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x73da('0x8')]},'starttime':{'type':Sequelize[_0x73da('0x9')]},'systemanswertime':{'type':Sequelize[_0x73da('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x73da('0x9')]},'duration':{'type':Sequelize[_0x73da('0xa')]},'billableseconds':{'type':Sequelize[_0x73da('0xa')]},'mohtime':{'type':Sequelize[_0x73da('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x73da('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x73da('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x73da('0x1')]},'note':{'type':Sequelize[_0x73da('0x1')]},'prefix':{'type':Sequelize[_0x73da('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x73da('0x1')]}}; \ No newline at end of file +var _0x98e7=['exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer','DATE','INTEGER'];(function(_0x321ccd,_0x4e751a){var _0x2402d0=function(_0x484f23){while(--_0x484f23){_0x321ccd['push'](_0x321ccd['shift']());}};_0x2402d0(++_0x4e751a);}(_0x98e7,0x1c2));var _0x798e=function(_0x32292b,_0x4e9525){_0x32292b=_0x32292b-0x0;var _0x1845b4=_0x98e7[_0x32292b];return _0x1845b4;};'use strict';var Sequelize=require('sequelize');module[_0x798e('0x0')]={'uniqueid':{'type':Sequelize[_0x798e('0x1')]},'type':{'type':Sequelize[_0x798e('0x2')](_0x798e('0x3'),_0x798e('0x4'),_0x798e('0x5'),_0x798e('0x6'),'outbound-fax',_0x798e('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x798e('0x1')]},'source':{'type':Sequelize[_0x798e('0x1')]},'destination':{'type':Sequelize[_0x798e('0x1')]},'destinationcontext':{'type':Sequelize[_0x798e('0x1')]},'callerid':{'type':Sequelize[_0x798e('0x1')]},'channel':{'type':Sequelize[_0x798e('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x798e('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x798e('0x8')]},'systemanswertime':{'type':Sequelize[_0x798e('0x8')]},'answertime':{'type':Sequelize[_0x798e('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x798e('0x9')]},'billableseconds':{'type':Sequelize[_0x798e('0x9')]},'mohtime':{'type':Sequelize[_0x798e('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x798e('0x1')]},'amaflags':{'type':Sequelize[_0x798e('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x798e('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x798e('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x798e('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x798e('0x9')]},'sipcallid':{'type':Sequelize[_0x798e('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index aa66518..7d4a934 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x12f313,_0x270e76){var _0x3d7705=function(_0x4c5686){while(--_0x4c5686){_0x12f313['push'](_0x12f313['shift']());}};_0x3d7705(++_0x270e76);}(_0x0b0e,0x187));var _0xe0b0=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0x0b0e[_0x75267d];return _0x21ccec;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x18593a,_0x3a019e){var _0x419cfa=function(_0x5743a8){while(--_0x5743a8){_0x18593a['push'](_0x18593a['shift']());}};_0x419cfa(++_0x3a019e);}(_0xdb28,0x106));var _0x8db2=function(_0x485b85,_0x3df1d7){_0x485b85=_0x485b85-0x0;var _0x3e6254=_0xdb28[_0x485b85];return _0x3e6254;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e21dd78..634b84d 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 _0x0db8=['exports','VoiceCallReport','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5b81dd,_0x498482){var _0x8f7ca=function(_0x3171c7){while(--_0x3171c7){_0x5b81dd['push'](_0x5b81dd['shift']());}};_0x8f7ca(++_0x498482);}(_0x0db8,0xd4));var _0x80db=function(_0x2920ec,_0x6b3d89){_0x2920ec=_0x2920ec-0x0;var _0x318807=_0x0db8[_0x2920ec];return _0x318807;};'use strict';var _=require('lodash');var util=require(_0x80db('0x0'));var logger=require(_0x80db('0x1'))(_0x80db('0x2'));var moment=require(_0x80db('0x3'));var BPromise=require(_0x80db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80db('0x5'));var rimraf=require(_0x80db('0x6'));var config=require(_0x80db('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x80db('0x8')]=function(_0x289372,_0x1db9ea){return _0x289372['define'](_0x80db('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f65=['report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6f65,0xec));var _0x56f6=function(_0x39417e,_0x87bf42){_0x39417e=_0x39417e-0x0;var _0x4ae9a6=_0x6f65[_0x39417e];return _0x4ae9a6;};'use strict';var _=require(_0x56f6('0x0'));var util=require(_0x56f6('0x1'));var logger=require(_0x56f6('0x2'))(_0x56f6('0x3'));var moment=require('moment');var BPromise=require(_0x56f6('0x4'));var rp=require(_0x56f6('0x5'));var fs=require('fs');var path=require(_0x56f6('0x6'));var rimraf=require(_0x56f6('0x7'));var config=require(_0x56f6('0x8'));var attributes=require(_0x56f6('0x9'));module['exports']=function(_0x3f1735,_0x249710){return _0x3f1735['define'](_0x56f6('0xa'),attributes,{'tableName':_0x56f6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x56f6('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 b03bb08..c9b469c 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 _0x2eea=['update','UpdateVoiceCallReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','create','body','CreateVoiceCallReport'];(function(_0x5195f5,_0x1daeba){var _0x25de05=function(_0x50d322){while(--_0x50d322){_0x5195f5['push'](_0x5195f5['shift']());}};_0x25de05(++_0x1daeba);}(_0x2eea,0x188));var _0xa2ee=function(_0x4dc58c,_0x2ca32e){_0x4dc58c=_0x4dc58c-0x0;var _0x20fbbd=_0x2eea[_0x4dc58c];return _0x20fbbd;};'use strict';var _=require(_0xa2ee('0x0'));var util=require('util');var moment=require(_0xa2ee('0x1'));var BPromise=require(_0xa2ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ee('0x3'));var db=require(_0xa2ee('0x4'))['db'];var utils=require(_0xa2ee('0x5'));var logger=require(_0xa2ee('0x6'))('rpc');var config=require(_0xa2ee('0x7'));var jayson=require(_0xa2ee('0x8'));var client=jayson[_0xa2ee('0x9')][_0xa2ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ccc5,_0x562c4e,_0x3c9164){return new BPromise(function(_0x458122,_0xbe2b61){return client['request'](_0x59ccc5,_0x3c9164)[_0xa2ee('0xb')](function(_0x11ce64){logger[_0xa2ee('0xc')](_0xa2ee('0xd'),_0x562c4e,_0xa2ee('0xe'));logger[_0xa2ee('0xf')](_0xa2ee('0x10'),_0x562c4e,_0xa2ee('0xe'),JSON[_0xa2ee('0x11')](_0x11ce64));if(_0x11ce64[_0xa2ee('0x12')]){if(_0x11ce64[_0xa2ee('0x12')][_0xa2ee('0x13')]===0x1f4){logger['error'](_0xa2ee('0xd'),_0x562c4e,_0x11ce64[_0xa2ee('0x12')][_0xa2ee('0x14')]);return _0xbe2b61(_0x11ce64[_0xa2ee('0x12')][_0xa2ee('0x14')]);}logger[_0xa2ee('0x12')](_0xa2ee('0xd'),_0x562c4e,_0x11ce64[_0xa2ee('0x12')][_0xa2ee('0x14')]);return _0x458122(_0x11ce64[_0xa2ee('0x12')][_0xa2ee('0x14')]);}else{logger[_0xa2ee('0xc')](_0xa2ee('0xd'),_0x562c4e,_0xa2ee('0xe'));_0x458122(_0x11ce64[_0xa2ee('0x15')][_0xa2ee('0x14')]);}})[_0xa2ee('0x16')](function(_0x3979cd){logger[_0xa2ee('0x12')](_0xa2ee('0xd'),_0x562c4e,_0x3979cd);_0xbe2b61(_0x3979cd);});});}exports[_0xa2ee('0x17')]=function(_0x5e1f31){var _0x4fd979=this;return new Promise(function(_0x73eacc,_0x698c18){return db[_0xa2ee('0x18')][_0xa2ee('0x19')]({'raw':_0x5e1f31['options']?_0x5e1f31[_0xa2ee('0x1a')][_0xa2ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e1f31[_0xa2ee('0x1a')]?_0x5e1f31[_0xa2ee('0x1a')][_0xa2ee('0x1c')]||null:null,'attributes':_0x5e1f31[_0xa2ee('0x1a')]?_0x5e1f31[_0xa2ee('0x1a')][_0xa2ee('0x1d')]||null:null,'limit':_0x5e1f31[_0xa2ee('0x1a')]?_0x5e1f31[_0xa2ee('0x1a')][_0xa2ee('0x1e')]||null:null,'include':_0x5e1f31[_0xa2ee('0x1a')]?_0x5e1f31[_0xa2ee('0x1a')][_0xa2ee('0x1f')]?_['map'](_0x5e1f31['options']['include'],function(_0x527888){return{'model':db[_0x527888['model']],'as':_0x527888['as'],'attributes':_0x527888[_0xa2ee('0x1d')],'include':_0x527888['include']?_['map'](_0x527888[_0xa2ee('0x1f')],function(_0x4473ef){return{'model':db[_0x4473ef[_0xa2ee('0x20')]],'as':_0x4473ef['as'],'attributes':_0x4473ef[_0xa2ee('0x1d')],'include':_0x4473ef[_0xa2ee('0x1f')]?_[_0xa2ee('0x21')](_0x4473ef[_0xa2ee('0x1f')],function(_0x128ab3){return{'model':db[_0x128ab3[_0xa2ee('0x20')]],'as':_0x128ab3['as'],'attributes':_0x128ab3[_0xa2ee('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa2ee('0xb')](function(_0x53d24f){logger[_0xa2ee('0xc')](_0xa2ee('0x17'),_0x5e1f31);logger['debug']('GetVoiceCallReport',_0x5e1f31,JSON[_0xa2ee('0x11')](_0x53d24f));_0x73eacc(_0x53d24f);})['catch'](function(_0x1aebfc){logger[_0xa2ee('0x12')]('GetVoiceCallReport',_0x1aebfc['message'],_0x5e1f31);_0x698c18(_0x4fd979[_0xa2ee('0x12')](0x1f4,_0x1aebfc[_0xa2ee('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x17cbcf){var _0x56ed74=this;return new Promise(function(_0x18ccd8,_0x28f6e3){return db[_0xa2ee('0x18')][_0xa2ee('0x22')](_0x17cbcf[_0xa2ee('0x23')],{'raw':_0x17cbcf[_0xa2ee('0x1a')]?_0x17cbcf[_0xa2ee('0x1a')][_0xa2ee('0x1b')]===undefined?!![]:![]:!![]})[_0xa2ee('0xb')](function(_0x46b051){logger['info'](_0xa2ee('0x24'),_0x17cbcf);logger['debug'](_0xa2ee('0x24'),_0x17cbcf,JSON[_0xa2ee('0x11')](_0x46b051));_0x18ccd8(_0x46b051);})[_0xa2ee('0x16')](function(_0x8865e0){logger[_0xa2ee('0x12')](_0xa2ee('0x24'),_0x8865e0[_0xa2ee('0x14')],_0x17cbcf);_0x28f6e3(_0x56ed74['error'](0x1f4,_0x8865e0[_0xa2ee('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x4a917f){var _0x4395a9=this;return new Promise(function(_0x43db1a,_0x554758){return db['VoiceCallReport'][_0xa2ee('0x25')](_0x4a917f['body'],{'raw':_0x4a917f[_0xa2ee('0x1a')]?_0x4a917f[_0xa2ee('0x1a')][_0xa2ee('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a917f[_0xa2ee('0x1a')]?_0x4a917f[_0xa2ee('0x1a')][_0xa2ee('0x1c')]||null:null,'attributes':_0x4a917f['options']?_0x4a917f[_0xa2ee('0x1a')][_0xa2ee('0x1d')]||null:null,'limit':_0x4a917f[_0xa2ee('0x1a')]?_0x4a917f[_0xa2ee('0x1a')][_0xa2ee('0x1e')]||null:null})[_0xa2ee('0xb')](function(_0x3dd679){logger[_0xa2ee('0xc')](_0xa2ee('0x26'),_0x4a917f);logger[_0xa2ee('0xf')](_0xa2ee('0x26'),_0x4a917f,JSON[_0xa2ee('0x11')](_0x3dd679));_0x43db1a(_0x3dd679);})[_0xa2ee('0x16')](function(_0x38a551){logger[_0xa2ee('0x12')](_0xa2ee('0x26'),_0x38a551[_0xa2ee('0x14')],_0x4a917f);_0x554758(_0x4395a9[_0xa2ee('0x12')](0x1f4,_0x38a551[_0xa2ee('0x14')]));});});}; \ No newline at end of file +var _0x48c9=['debug','stringify','error','code','message','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit','include','model','map','info','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','where','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x48c9,0xca));var _0x948c=function(_0xa74e4c,_0x152094){_0xa74e4c=_0xa74e4c-0x0;var _0x5aceaa=_0x48c9[_0xa74e4c];return _0x5aceaa;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x948c('0x0'));var rs=require(_0x948c('0x1'));var fs=require('fs');var Redis=require(_0x948c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x948c('0x3'));var logger=require(_0x948c('0x4'))(_0x948c('0x5'));var config=require(_0x948c('0x6'));var jayson=require(_0x948c('0x7'));var client=jayson[_0x948c('0x8')][_0x948c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130d0c,_0x242068,_0x8a4f74){return new BPromise(function(_0x4cab4e,_0xfe812f){return client[_0x948c('0xa')](_0x130d0c,_0x8a4f74)[_0x948c('0xb')](function(_0x724a0e){logger['info'](_0x948c('0xc'),_0x242068,_0x948c('0xd'));logger[_0x948c('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x242068,'request\x20sent',JSON[_0x948c('0xf')](_0x724a0e));if(_0x724a0e['error']){if(_0x724a0e[_0x948c('0x10')][_0x948c('0x11')]===0x1f4){logger[_0x948c('0x10')](_0x948c('0xc'),_0x242068,_0x724a0e['error'][_0x948c('0x12')]);return _0xfe812f(_0x724a0e[_0x948c('0x10')][_0x948c('0x12')]);}logger['error'](_0x948c('0xc'),_0x242068,_0x724a0e[_0x948c('0x10')][_0x948c('0x12')]);return _0x4cab4e(_0x724a0e['error'][_0x948c('0x12')]);}else{logger['info'](_0x948c('0xc'),_0x242068,_0x948c('0xd'));_0x4cab4e(_0x724a0e['result'][_0x948c('0x12')]);}})[_0x948c('0x13')](function(_0x54e3f4){logger['error'](_0x948c('0xc'),_0x242068,_0x54e3f4);_0xfe812f(_0x54e3f4);});});}exports[_0x948c('0x14')]=function(_0x199e19){var _0x5c7606=this;return new Promise(function(_0x30e2db,_0x30878e){return db['VoiceCallReport'][_0x948c('0x15')]({'raw':_0x199e19[_0x948c('0x16')]?_0x199e19[_0x948c('0x16')][_0x948c('0x17')]===undefined?!![]:![]:!![],'where':_0x199e19['options']?_0x199e19[_0x948c('0x16')]['where']||null:null,'attributes':_0x199e19[_0x948c('0x16')]?_0x199e19[_0x948c('0x16')][_0x948c('0x18')]||null:null,'limit':_0x199e19[_0x948c('0x16')]?_0x199e19[_0x948c('0x16')][_0x948c('0x19')]||null:null,'include':_0x199e19[_0x948c('0x16')]?_0x199e19['options'][_0x948c('0x1a')]?_['map'](_0x199e19[_0x948c('0x16')][_0x948c('0x1a')],function(_0x24f30a){return{'model':db[_0x24f30a[_0x948c('0x1b')]],'as':_0x24f30a['as'],'attributes':_0x24f30a[_0x948c('0x18')],'include':_0x24f30a[_0x948c('0x1a')]?_['map'](_0x24f30a['include'],function(_0x300c49){return{'model':db[_0x300c49[_0x948c('0x1b')]],'as':_0x300c49['as'],'attributes':_0x300c49['attributes'],'include':_0x300c49['include']?_[_0x948c('0x1c')](_0x300c49[_0x948c('0x1a')],function(_0x4914ee){return{'model':db[_0x4914ee[_0x948c('0x1b')]],'as':_0x4914ee['as'],'attributes':_0x4914ee[_0x948c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x948c('0xb')](function(_0x36a969){logger[_0x948c('0x1d')]('GetVoiceCallReport',_0x199e19);logger[_0x948c('0xe')](_0x948c('0x14'),_0x199e19,JSON[_0x948c('0xf')](_0x36a969));_0x30e2db(_0x36a969);})[_0x948c('0x13')](function(_0x19e406){logger[_0x948c('0x10')](_0x948c('0x14'),_0x19e406['message'],_0x199e19);_0x30878e(_0x5c7606[_0x948c('0x10')](0x1f4,_0x19e406[_0x948c('0x12')]));});});};exports[_0x948c('0x1e')]=function(_0x29a65e){var _0xc6636c=this;return new Promise(function(_0x5aa49a,_0x38b611){return db[_0x948c('0x1f')][_0x948c('0x20')](_0x29a65e[_0x948c('0x21')],{'raw':_0x29a65e[_0x948c('0x16')]?_0x29a65e[_0x948c('0x16')][_0x948c('0x17')]===undefined?!![]:![]:!![]})[_0x948c('0xb')](function(_0x5af6b7){logger[_0x948c('0x1d')](_0x948c('0x1e'),_0x29a65e);logger['debug'](_0x948c('0x1e'),_0x29a65e,JSON[_0x948c('0xf')](_0x5af6b7));_0x5aa49a(_0x5af6b7);})[_0x948c('0x13')](function(_0xdcf437){logger[_0x948c('0x10')](_0x948c('0x1e'),_0xdcf437[_0x948c('0x12')],_0x29a65e);_0x38b611(_0xc6636c[_0x948c('0x10')](0x1f4,_0xdcf437['message']));});});};exports[_0x948c('0x22')]=function(_0x2d55a2){var _0x221bba=this;return new Promise(function(_0x115e7d,_0x2dda43){return db[_0x948c('0x1f')]['update'](_0x2d55a2[_0x948c('0x21')],{'raw':_0x2d55a2[_0x948c('0x16')]?_0x2d55a2[_0x948c('0x16')][_0x948c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d55a2[_0x948c('0x16')]?_0x2d55a2[_0x948c('0x16')][_0x948c('0x23')]||null:null,'attributes':_0x2d55a2[_0x948c('0x16')]?_0x2d55a2[_0x948c('0x16')][_0x948c('0x18')]||null:null,'limit':_0x2d55a2[_0x948c('0x16')]?_0x2d55a2[_0x948c('0x16')]['limit']||null:null})['then'](function(_0xf26f02){logger[_0x948c('0x1d')](_0x948c('0x22'),_0x2d55a2);logger['debug'](_0x948c('0x22'),_0x2d55a2,JSON[_0x948c('0xf')](_0xf26f02));_0x115e7d(_0xf26f02);})[_0x948c('0x13')](function(_0x319342){logger[_0x948c('0x10')](_0x948c('0x22'),_0x319342[_0x948c('0x12')],_0x2d55a2);_0x2dda43(_0x221bba[_0x948c('0x10')](0x1f4,_0x319342[_0x948c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3e38dbe..baf253e 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 _0xac71=['isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x42c7b1,_0x41c915){var _0x1de606=function(_0x6ba1ab){while(--_0x6ba1ab){_0x42c7b1['push'](_0x42c7b1['shift']());}};_0x1de606(++_0x41c915);}(_0xac71,0x1a0));var _0x1ac7=function(_0x84293f,_0x1b4173){_0x84293f=_0x84293f-0x0;var _0x15a611=_0xac71[_0x84293f];return _0x15a611;};'use strict';var multer=require(_0x1ac7('0x0'));var util=require(_0x1ac7('0x1'));var path=require(_0x1ac7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ac7('0x3')]();var fs_extra=require(_0x1ac7('0x4'));var auth=require(_0x1ac7('0x5'));var interaction=require(_0x1ac7('0x6'));var config=require(_0x1ac7('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x1ac7('0x8')]('/',auth[_0x1ac7('0x9')](),controller[_0x1ac7('0xa')]);router[_0x1ac7('0x8')](_0x1ac7('0xb'),auth[_0x1ac7('0x9')](),controller[_0x1ac7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1ac7('0xd')](_0x1ac7('0xb'),auth[_0x1ac7('0x9')](),controller[_0x1ac7('0xe')]);router[_0x1ac7('0xf')](_0x1ac7('0xb'),auth[_0x1ac7('0x9')](),controller['destroy']);module[_0x1ac7('0x10')]=router; \ No newline at end of file +var _0xeeeb=['express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeeeb,0x1a0));var _0xbeee=function(_0x5d7907,_0x1e9f61){_0x5d7907=_0x5d7907-0x0;var _0x38196b=_0xeeeb[_0x5d7907];return _0x38196b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbeee('0x0'));var timeout=require(_0xbeee('0x1'));var express=require(_0xbeee('0x2'));var router=express[_0xbeee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbeee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbeee('0x5'));var controller=require(_0xbeee('0x6'));router[_0xbeee('0x7')]('/',auth[_0xbeee('0x8')](),controller[_0xbeee('0x9')]);router[_0xbeee('0x7')](_0xbeee('0xa'),auth[_0xbeee('0x8')](),controller[_0xbeee('0xb')]);router[_0xbeee('0xc')]('/',auth['isAuthenticated'](),controller[_0xbeee('0xd')]);router[_0xbeee('0xe')](_0xbeee('0xa'),auth['isAuthenticated'](),controller[_0xbeee('0xf')]);router[_0xbeee('0x10')](_0xbeee('0xa'),auth[_0xbeee('0x8')](),controller[_0xbeee('0x11')]);module[_0xbeee('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8843503..4ce22f1 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 _0xe2f1=['exports','name','setDataValue','join','getDataValue','options','split','BOOLEAN','STRING'];(function(_0x1e2a99,_0x23d9f0){var _0x1482e7=function(_0x1b9ab0){while(--_0x1b9ab0){_0x1e2a99['push'](_0x1e2a99['shift']());}};_0x1482e7(++_0x23d9f0);}(_0xe2f1,0x1dd));var _0x1e2f=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xe2f1[_0x41bdd4];return _0x5c03a6;};'use strict';var Sequelize=require('sequelize');module[_0x1e2f('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x1e2f('0x1'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x209bb3){this[_0x1e2f('0x2')]('options',_0x209bb3?_0x209bb3[_0x1e2f('0x3')](''):[]);},'get':function(){return this[_0x1e2f('0x4')](_0x1e2f('0x5'))?this[_0x1e2f('0x4')]('options')[_0x1e2f('0x6')](''):[];}},'auth':{'type':Sequelize[_0x1e2f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x1e2f('0x8')]},'record':{'type':Sequelize[_0x1e2f('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1e2f('0x8')]},'description':{'type':Sequelize[_0x1e2f('0x8')]}}; \ No newline at end of file +var _0x7f29=['split','sequelize','STRING','name','setDataValue','join','getDataValue','options'];(function(_0x41a2ce,_0x5232e7){var _0x7b254b=function(_0x57f3e3){while(--_0x57f3e3){_0x41a2ce['push'](_0x41a2ce['shift']());}};_0x7b254b(++_0x5232e7);}(_0x7f29,0x181));var _0x97f2=function(_0x23e968,_0xdc4f0){_0x23e968=_0x23e968-0x0;var _0x559f52=_0x7f29[_0x23e968];return _0x559f52;};'use strict';var Sequelize=require(_0x97f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x97f2('0x1')]},'prefix':{'type':Sequelize[_0x97f2('0x1')],'unique':_0x97f2('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x97f2('0x1')],'set':function(_0x6ea55){this[_0x97f2('0x3')]('options',_0x6ea55?_0x6ea55[_0x97f2('0x4')](''):[]);},'get':function(){return this[_0x97f2('0x5')](_0x97f2('0x6'))?this['getDataValue'](_0x97f2('0x6'))[_0x97f2('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x97f2('0x1')]},'description':{'type':Sequelize[_0x97f2('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6a726e3..7538139 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 _0xbdeb=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','VoiceChanSpy','includeAll','findAll','rows','catch','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','rawAttributes'];(function(_0x14a8c2,_0x4861d9){var _0x57cacb=function(_0x2d97b7){while(--_0x2d97b7){_0x14a8c2['push'](_0x14a8c2['shift']());}};_0x57cacb(++_0x4861d9);}(_0xbdeb,0x6f));var _0xbbde=function(_0x16c619,_0x6cac5){_0x16c619=_0x16c619-0x0;var _0x87d66c=_0xbdeb[_0x16c619];return _0x87d66c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbde('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbde('0x1'));var rp=require('request-promise');var moment=require(_0xbbde('0x2'));var BPromise=require(_0xbbde('0x3'));var Mustache=require(_0xbbde('0x4'));var util=require(_0xbbde('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbbde('0x6'));var ejs=require(_0xbbde('0x7'));var fs=require('fs');var fs_extra=require(_0xbbde('0x8'));var _=require(_0xbbde('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbbde('0xa'));var deskjs=require(_0xbbde('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbbde('0xc'));var Papa=require(_0xbbde('0xd'));var Redis=require(_0xbbde('0xe'));var authService=require(_0xbbde('0xf'));var qs=require(_0xbbde('0x10'));var as=require(_0xbbde('0x11'));var hardwareService=require(_0xbbde('0x12'));var logger=require(_0xbbde('0x13'))(_0xbbde('0x14'));var utils=require(_0xbbde('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbbde('0x16'))['db'];function respondWithStatusCode(_0x5bda89,_0x3d09fa){_0x3d09fa=_0x3d09fa||0xcc;return function(_0x55e439){if(_0x55e439){return _0x5bda89[_0xbbde('0x17')](_0x3d09fa);}return _0x5bda89[_0xbbde('0x18')](_0x3d09fa)[_0xbbde('0x19')]();};}function respondWithResult(_0x397dda,_0x4afa45){_0x4afa45=_0x4afa45||0xc8;return function(_0x374e93){if(_0x374e93){return _0x397dda[_0xbbde('0x18')](_0x4afa45)['json'](_0x374e93);}};}function respondWithFilteredResult(_0x259c16,_0x13db58){return function(_0x4b3c6f){if(_0x4b3c6f){var _0x5ce713=typeof _0x13db58[_0xbbde('0x1a')]==='undefined'&&typeof _0x13db58[_0xbbde('0x1b')]==='undefined';var _0x2b8e3f=_0x4b3c6f[_0xbbde('0x1c')];var _0x593e58=_0x5ce713?0x0:_0x13db58[_0xbbde('0x1a')];var _0x1bc7eb=_0x5ce713?_0x4b3c6f[_0xbbde('0x1c')]:_0x13db58[_0xbbde('0x1a')]+_0x13db58[_0xbbde('0x1b')];var _0x327762;if(_0x1bc7eb>=_0x2b8e3f){_0x1bc7eb=_0x2b8e3f;_0x327762=0xc8;}else{_0x327762=0xce;}_0x259c16['status'](_0x327762);return _0x259c16[_0xbbde('0x1d')](_0xbbde('0x1e'),_0x593e58+'-'+_0x1bc7eb+'/'+_0x2b8e3f)[_0xbbde('0x1f')](_0x4b3c6f);}return null;};}function patchUpdates(_0xc027e7){return function(_0x1a5c58){try{jsonpatch['apply'](_0x1a5c58,_0xc027e7,!![]);}catch(_0x44eca0){return BPromise[_0xbbde('0x20')](_0x44eca0);}return _0x1a5c58[_0xbbde('0x21')]();};}function saveUpdates(_0x19efbb,_0x2c2c14){return function(_0x31b97d){if(_0x31b97d){return _0x31b97d[_0xbbde('0x22')](_0x19efbb)[_0xbbde('0x23')](function(_0x82b9f){return _0x82b9f;});}return null;};}function removeEntity(_0x1b6f82,_0x4ac50b){return function(_0x45db0e){if(_0x45db0e){return _0x45db0e[_0xbbde('0x24')]()[_0xbbde('0x23')](function(){var _0x5c6e6c=_0x45db0e[_0xbbde('0x25')]({'plain':!![]});var _0x34c327=_0xbbde('0x26');return db[_0xbbde('0x27')][_0xbbde('0x24')]({'where':{'type':_0x34c327,'resourceId':_0x5c6e6c['id']}})['then'](function(){return _0x45db0e;});})[_0xbbde('0x23')](function(){_0x1b6f82[_0xbbde('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3efbd7,_0x3d1c58){return function(_0x2854d7){if(!_0x2854d7){_0x3efbd7[_0xbbde('0x17')](0x194);}return _0x2854d7;};}function handleError(_0xd59301,_0x5d9fcd){_0x5d9fcd=_0x5d9fcd||0x1f4;return function(_0x549b1f){logger[_0xbbde('0x28')](_0x549b1f[_0xbbde('0x29')]);if(_0x549b1f['name']){delete _0x549b1f[_0xbbde('0x2a')];}_0xd59301[_0xbbde('0x18')](_0x5d9fcd)[_0xbbde('0x2b')](_0x549b1f);};}exports[_0xbbde('0x2c')]=function(_0x23bc37,_0x4936bd){var _0x387eb3={},_0x28f4ac={},_0xcd1131={'count':0x0,'rows':[]};var _0x32566e=_[_0xbbde('0x2d')](db['VoiceChanSpy'][_0xbbde('0x2e')],function(_0x11fabd){return{'name':_0x11fabd['fieldName'],'type':_0x11fabd['type'][_0xbbde('0x2f')]};});_0x28f4ac[_0xbbde('0x30')]=_[_0xbbde('0x2d')](_0x32566e,_0xbbde('0x2a'));_0x28f4ac[_0xbbde('0x31')]=_[_0xbbde('0x32')](_0x23bc37[_0xbbde('0x31')]);_0x28f4ac[_0xbbde('0x33')]=_[_0xbbde('0x34')](_0x28f4ac['model'],_0x28f4ac[_0xbbde('0x31')]);_0x387eb3[_0xbbde('0x35')]=_[_0xbbde('0x34')](_0x28f4ac[_0xbbde('0x30')],qs['fields'](_0x23bc37['query'][_0xbbde('0x36')]));_0x387eb3[_0xbbde('0x35')]=_0x387eb3[_0xbbde('0x35')][_0xbbde('0x37')]?_0x387eb3['attributes']:_0x28f4ac[_0xbbde('0x30')];if(!_0x23bc37['query'][_0xbbde('0x38')](_0xbbde('0x39'))){_0x387eb3[_0xbbde('0x1b')]=qs[_0xbbde('0x1b')](_0x23bc37[_0xbbde('0x31')]['limit']);_0x387eb3[_0xbbde('0x1a')]=qs[_0xbbde('0x1a')](_0x23bc37['query'][_0xbbde('0x1a')]);}_0x387eb3[_0xbbde('0x3a')]=qs['sort'](_0x23bc37[_0xbbde('0x31')]['sort']);_0x387eb3[_0xbbde('0x3b')]=qs[_0xbbde('0x33')](_[_0xbbde('0x3c')](_0x23bc37['query'],_0x28f4ac[_0xbbde('0x33')]),_0x32566e);if(_0x23bc37[_0xbbde('0x31')]['filter']){_0x387eb3[_0xbbde('0x3b')]=_['merge'](_0x387eb3[_0xbbde('0x3b')],{'$or':_[_0xbbde('0x2d')](_0x32566e,function(_0x4c528d){if(_0x4c528d[_0xbbde('0x3d')]!==_0xbbde('0x3e')){var _0xbc6de1={};_0xbc6de1[_0x4c528d[_0xbbde('0x2a')]]={'$like':'%'+_0x23bc37['query'][_0xbbde('0x3f')]+'%'};return _0xbc6de1;}})});}_0x387eb3=_[_0xbbde('0x40')]({},_0x387eb3,_0x23bc37['options']);var _0x253a96={'where':_0x387eb3[_0xbbde('0x3b')]};return db[_0xbbde('0x41')][_0xbbde('0x1c')](_0x253a96)['then'](function(_0x2a74ce){_0xcd1131[_0xbbde('0x1c')]=_0x2a74ce;if(_0x23bc37['query'][_0xbbde('0x42')]){_0x387eb3['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xbbde('0x43')](_0x387eb3);})[_0xbbde('0x23')](function(_0x3110d8){_0xcd1131[_0xbbde('0x44')]=_0x3110d8;return _0xcd1131;})[_0xbbde('0x23')](respondWithFilteredResult(_0x4936bd,_0x387eb3))[_0xbbde('0x45')](handleError(_0x4936bd,null));};exports['show']=function(_0x1e4fc1,_0x1c3600){var _0x2d6719={'raw':![],'where':{'id':_0x1e4fc1[_0xbbde('0x46')]['id']}},_0x6bff1a={};_0x6bff1a['model']=_[_0xbbde('0x32')](db[_0xbbde('0x41')][_0xbbde('0x2e')]);_0x6bff1a['query']=_['keys'](_0x1e4fc1['query']);_0x6bff1a[_0xbbde('0x33')]=_['intersection'](_0x6bff1a[_0xbbde('0x30')],_0x6bff1a[_0xbbde('0x31')]);_0x2d6719[_0xbbde('0x35')]=_[_0xbbde('0x34')](_0x6bff1a['model'],qs[_0xbbde('0x36')](_0x1e4fc1[_0xbbde('0x31')][_0xbbde('0x36')]));_0x2d6719[_0xbbde('0x35')]=_0x2d6719[_0xbbde('0x35')]['length']?_0x2d6719['attributes']:_0x6bff1a['model'];if(_0x1e4fc1[_0xbbde('0x31')][_0xbbde('0x42')]){_0x2d6719[_0xbbde('0x47')]=[{'all':!![]}];}_0x2d6719=_['merge']({},_0x2d6719,_0x1e4fc1['options']);return db[_0xbbde('0x41')]['find'](_0x2d6719)[_0xbbde('0x23')](handleEntityNotFound(_0x1c3600,null))['then'](respondWithResult(_0x1c3600,null))[_0xbbde('0x45')](handleError(_0x1c3600,null));};exports['create']=function(_0x4b204b,_0x356109){return db[_0xbbde('0x41')][_0xbbde('0x48')](_0x4b204b['body'],{})['then'](function(_0x4319c1){var _0x3c12c5=_0x4b204b['user'][_0xbbde('0x25')]({'plain':!![]});if(!_0x3c12c5)throw new Error(_0xbbde('0x49'));if(_0x3c12c5[_0xbbde('0x4a')]==='user'){var _0x779382=_0x4319c1[_0xbbde('0x25')]({'plain':!![]});var _0x222eee='ChanSpies';return db[_0xbbde('0x4b')]['find']({'where':{'name':_0x222eee,'userProfileId':_0x3c12c5[_0xbbde('0x4c')]},'raw':!![]})[_0xbbde('0x23')](function(_0x160e6c){if(_0x160e6c&&_0x160e6c['autoAssociation']===0x0){return db[_0xbbde('0x27')]['create']({'name':_0x779382[_0xbbde('0x2a')],'resourceId':_0x779382['id'],'type':_0x160e6c[_0xbbde('0x2a')],'sectionId':_0x160e6c['id']},{})[_0xbbde('0x23')](function(){return _0x4319c1;});}else{return _0x4319c1;}})[_0xbbde('0x45')](function(_0x278e40){logger['error'](_0xbbde('0x4d'),_0x278e40);throw _0x278e40;});}return _0x4319c1;})['then'](respondWithResult(_0x356109,0xc9))[_0xbbde('0x45')](handleError(_0x356109,null));};exports[_0xbbde('0x22')]=function(_0x47759a,_0x28859f){if(_0x47759a['body']['id']){delete _0x47759a['body']['id'];}return db[_0xbbde('0x41')][_0xbbde('0x4e')]({'where':{'id':_0x47759a['params']['id']}})[_0xbbde('0x23')](handleEntityNotFound(_0x28859f,null))[_0xbbde('0x23')](saveUpdates(_0x47759a['body'],null))[_0xbbde('0x23')](respondWithResult(_0x28859f,null))['catch'](handleError(_0x28859f,null));};exports[_0xbbde('0x24')]=function(_0x514980,_0x28883f){return db[_0xbbde('0x41')][_0xbbde('0x4e')]({'where':{'id':_0x514980[_0xbbde('0x46')]['id']}})[_0xbbde('0x23')](handleEntityNotFound(_0x28883f,null))[_0xbbde('0x23')](removeEntity(_0x28883f,null))[_0xbbde('0x45')](handleError(_0x28883f,null));}; \ No newline at end of file +var _0xf822=['squel','crypto','jsforce','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','offset','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0xf822,0x19e));var _0x2f82=function(_0x2e24fd,_0x59f888){_0x2e24fd=_0x2e24fd-0x0;var _0x410160=_0xf822[_0x2e24fd];return _0x410160;};'use strict';var emlformat=require(_0x2f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f82('0x1'));var jsonpatch=require(_0x2f82('0x2'));var rp=require(_0x2f82('0x3'));var moment=require(_0x2f82('0x4'));var BPromise=require(_0x2f82('0x5'));var Mustache=require(_0x2f82('0x6'));var util=require('util');var path=require(_0x2f82('0x7'));var sox=require(_0x2f82('0x8'));var csv=require(_0x2f82('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f82('0xa'));var _=require('lodash');var squel=require(_0x2f82('0xb'));var crypto=require(_0x2f82('0xc'));var jsforce=require(_0x2f82('0xd'));var deskjs=require(_0x2f82('0xe'));var toCsv=require(_0x2f82('0x9'));var querystring=require(_0x2f82('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f82('0x10'));var authService=require(_0x2f82('0x11'));var qs=require(_0x2f82('0x12'));var as=require(_0x2f82('0x13'));var hardwareService=require(_0x2f82('0x14'));var logger=require(_0x2f82('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2f82('0x16'));var licenseUtil=require(_0x2f82('0x17'));var db=require(_0x2f82('0x18'))['db'];function respondWithStatusCode(_0x4305b5,_0x5e7036){_0x5e7036=_0x5e7036||0xcc;return function(_0x5f51f4){if(_0x5f51f4){return _0x4305b5[_0x2f82('0x19')](_0x5e7036);}return _0x4305b5[_0x2f82('0x1a')](_0x5e7036)[_0x2f82('0x1b')]();};}function respondWithResult(_0x57b8a1,_0x434262){_0x434262=_0x434262||0xc8;return function(_0x2df1bf){if(_0x2df1bf){return _0x57b8a1['status'](_0x434262)['json'](_0x2df1bf);}};}function respondWithFilteredResult(_0x52bbba,_0x6d2748){return function(_0x14f4b7){if(_0x14f4b7){var _0xe1a92f=typeof _0x6d2748[_0x2f82('0x1c')]==='undefined'&&typeof _0x6d2748[_0x2f82('0x1d')]==='undefined';var _0x216259=_0x14f4b7['count'];var _0x2ac8dc=_0xe1a92f?0x0:_0x6d2748[_0x2f82('0x1c')];var _0x2c3ce9=_0xe1a92f?_0x14f4b7[_0x2f82('0x1e')]:_0x6d2748[_0x2f82('0x1c')]+_0x6d2748[_0x2f82('0x1d')];var _0x47022b;if(_0x2c3ce9>=_0x216259){_0x2c3ce9=_0x216259;_0x47022b=0xc8;}else{_0x47022b=0xce;}_0x52bbba[_0x2f82('0x1a')](_0x47022b);return _0x52bbba['set'](_0x2f82('0x1f'),_0x2ac8dc+'-'+_0x2c3ce9+'/'+_0x216259)[_0x2f82('0x20')](_0x14f4b7);}return null;};}function patchUpdates(_0x1d08fb){return function(_0x56357a){try{jsonpatch[_0x2f82('0x21')](_0x56357a,_0x1d08fb,!![]);}catch(_0x2d9d89){return BPromise[_0x2f82('0x22')](_0x2d9d89);}return _0x56357a[_0x2f82('0x23')]();};}function saveUpdates(_0x3e014d,_0x508a52){return function(_0x3e9b75){if(_0x3e9b75){return _0x3e9b75[_0x2f82('0x24')](_0x3e014d)[_0x2f82('0x25')](function(_0x4a0a2a){return _0x4a0a2a;});}return null;};}function removeEntity(_0x530e1b,_0x510bd0){return function(_0x3f2abc){if(_0x3f2abc){return _0x3f2abc[_0x2f82('0x26')]()['then'](function(){var _0x4f6e52=_0x3f2abc[_0x2f82('0x27')]({'plain':!![]});var _0x452472=_0x2f82('0x28');return db[_0x2f82('0x29')][_0x2f82('0x26')]({'where':{'type':_0x452472,'resourceId':_0x4f6e52['id']}})['then'](function(){return _0x3f2abc;});})['then'](function(){_0x530e1b[_0x2f82('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd978,_0x5d48e5){return function(_0x29d54e){if(!_0x29d54e){_0x3fd978[_0x2f82('0x19')](0x194);}return _0x29d54e;};}function handleError(_0x43959b,_0x289dd3){_0x289dd3=_0x289dd3||0x1f4;return function(_0x359592){logger['error'](_0x359592[_0x2f82('0x2a')]);if(_0x359592[_0x2f82('0x2b')]){delete _0x359592[_0x2f82('0x2b')];}_0x43959b[_0x2f82('0x1a')](_0x289dd3)[_0x2f82('0x2c')](_0x359592);};}exports[_0x2f82('0x2d')]=function(_0x2213fe,_0x18c2e7){var _0xead18={},_0x50e05b={},_0x35cfee={'count':0x0,'rows':[]};var _0x35c7ac=_[_0x2f82('0x2e')](db[_0x2f82('0x2f')][_0x2f82('0x30')],function(_0x248011){return{'name':_0x248011[_0x2f82('0x31')],'type':_0x248011['type'][_0x2f82('0x32')]};});_0x50e05b[_0x2f82('0x33')]=_[_0x2f82('0x2e')](_0x35c7ac,_0x2f82('0x2b'));_0x50e05b[_0x2f82('0x34')]=_[_0x2f82('0x35')](_0x2213fe['query']);_0x50e05b[_0x2f82('0x36')]=_[_0x2f82('0x37')](_0x50e05b['model'],_0x50e05b['query']);_0xead18[_0x2f82('0x38')]=_['intersection'](_0x50e05b[_0x2f82('0x33')],qs[_0x2f82('0x39')](_0x2213fe[_0x2f82('0x34')]['fields']));_0xead18[_0x2f82('0x38')]=_0xead18[_0x2f82('0x38')][_0x2f82('0x3a')]?_0xead18['attributes']:_0x50e05b[_0x2f82('0x33')];if(!_0x2213fe[_0x2f82('0x34')]['hasOwnProperty']('nolimit')){_0xead18[_0x2f82('0x1d')]=qs['limit'](_0x2213fe[_0x2f82('0x34')]['limit']);_0xead18['offset']=qs[_0x2f82('0x1c')](_0x2213fe[_0x2f82('0x34')][_0x2f82('0x1c')]);}_0xead18[_0x2f82('0x3b')]=qs[_0x2f82('0x3c')](_0x2213fe[_0x2f82('0x34')][_0x2f82('0x3c')]);_0xead18['where']=qs['filters'](_[_0x2f82('0x3d')](_0x2213fe[_0x2f82('0x34')],_0x50e05b[_0x2f82('0x36')]),_0x35c7ac);if(_0x2213fe[_0x2f82('0x34')]['filter']){_0xead18[_0x2f82('0x3e')]=_[_0x2f82('0x3f')](_0xead18[_0x2f82('0x3e')],{'$or':_[_0x2f82('0x2e')](_0x35c7ac,function(_0x595493){if(_0x595493[_0x2f82('0x40')]!==_0x2f82('0x41')){var _0x407999={};_0x407999[_0x595493['name']]={'$like':'%'+_0x2213fe[_0x2f82('0x34')][_0x2f82('0x42')]+'%'};return _0x407999;}})});}_0xead18=_[_0x2f82('0x3f')]({},_0xead18,_0x2213fe[_0x2f82('0x43')]);var _0x443c56={'where':_0xead18['where']};return db['VoiceChanSpy']['count'](_0x443c56)['then'](function(_0x50040b){_0x35cfee[_0x2f82('0x1e')]=_0x50040b;if(_0x2213fe[_0x2f82('0x34')][_0x2f82('0x44')]){_0xead18[_0x2f82('0x45')]=[{'all':!![]}];}return db[_0x2f82('0x2f')][_0x2f82('0x46')](_0xead18);})[_0x2f82('0x25')](function(_0x32b927){_0x35cfee[_0x2f82('0x47')]=_0x32b927;return _0x35cfee;})[_0x2f82('0x25')](respondWithFilteredResult(_0x18c2e7,_0xead18))[_0x2f82('0x48')](handleError(_0x18c2e7,null));};exports[_0x2f82('0x49')]=function(_0x392f03,_0x1a083a){var _0x170801={'raw':![],'where':{'id':_0x392f03[_0x2f82('0x4a')]['id']}},_0x119c39={};_0x119c39[_0x2f82('0x33')]=_[_0x2f82('0x35')](db[_0x2f82('0x2f')][_0x2f82('0x30')]);_0x119c39['query']=_[_0x2f82('0x35')](_0x392f03[_0x2f82('0x34')]);_0x119c39['filters']=_[_0x2f82('0x37')](_0x119c39[_0x2f82('0x33')],_0x119c39['query']);_0x170801[_0x2f82('0x38')]=_[_0x2f82('0x37')](_0x119c39[_0x2f82('0x33')],qs[_0x2f82('0x39')](_0x392f03[_0x2f82('0x34')][_0x2f82('0x39')]));_0x170801['attributes']=_0x170801[_0x2f82('0x38')][_0x2f82('0x3a')]?_0x170801[_0x2f82('0x38')]:_0x119c39[_0x2f82('0x33')];if(_0x392f03[_0x2f82('0x34')][_0x2f82('0x44')]){_0x170801['include']=[{'all':!![]}];}_0x170801=_[_0x2f82('0x3f')]({},_0x170801,_0x392f03[_0x2f82('0x43')]);return db['VoiceChanSpy'][_0x2f82('0x4b')](_0x170801)[_0x2f82('0x25')](handleEntityNotFound(_0x1a083a,null))[_0x2f82('0x25')](respondWithResult(_0x1a083a,null))[_0x2f82('0x48')](handleError(_0x1a083a,null));};exports[_0x2f82('0x4c')]=function(_0x542707,_0x42a55b){return db[_0x2f82('0x2f')][_0x2f82('0x4c')](_0x542707[_0x2f82('0x4d')],{})[_0x2f82('0x25')](function(_0x7868fd){var _0xbb8dfc=_0x542707['user'][_0x2f82('0x27')]({'plain':!![]});if(!_0xbb8dfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbb8dfc[_0x2f82('0x4e')]===_0x2f82('0x4f')){var _0x286c9f=_0x7868fd['get']({'plain':!![]});var _0x310623='ChanSpies';return db[_0x2f82('0x50')]['find']({'where':{'name':_0x310623,'userProfileId':_0xbb8dfc[_0x2f82('0x51')]},'raw':!![]})[_0x2f82('0x25')](function(_0xa12b90){if(_0xa12b90&&_0xa12b90[_0x2f82('0x52')]===0x0){return db[_0x2f82('0x29')]['create']({'name':_0x286c9f['name'],'resourceId':_0x286c9f['id'],'type':_0xa12b90[_0x2f82('0x2b')],'sectionId':_0xa12b90['id']},{})['then'](function(){return _0x7868fd;});}else{return _0x7868fd;}})[_0x2f82('0x48')](function(_0x5036d1){logger[_0x2f82('0x53')](_0x2f82('0x54'),_0x5036d1);throw _0x5036d1;});}return _0x7868fd;})['then'](respondWithResult(_0x42a55b,0xc9))[_0x2f82('0x48')](handleError(_0x42a55b,null));};exports[_0x2f82('0x24')]=function(_0x165b5f,_0x35dc70){if(_0x165b5f['body']['id']){delete _0x165b5f[_0x2f82('0x4d')]['id'];}return db[_0x2f82('0x2f')][_0x2f82('0x4b')]({'where':{'id':_0x165b5f[_0x2f82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35dc70,null))[_0x2f82('0x25')](saveUpdates(_0x165b5f['body'],null))['then'](respondWithResult(_0x35dc70,null))[_0x2f82('0x48')](handleError(_0x35dc70,null));};exports[_0x2f82('0x26')]=function(_0x584153,_0x2f8b56){return db['VoiceChanSpy'][_0x2f82('0x4b')]({'where':{'id':_0x584153[_0x2f82('0x4a')]['id']}})[_0x2f82('0x25')](handleEntityNotFound(_0x2f8b56,null))['then'](removeEntity(_0x2f8b56,null))[_0x2f82('0x48')](handleError(_0x2f8b56,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 07de96b..784d184 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 _0x2b02=['exports','models','define','voice_chanspy','bulkCreate','VoiceExtension','destroy','then','length','catch','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','Set','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','internal','concat','User','findAll','agent'];(function(_0xc8a11,_0x347a33){var _0x55a500=function(_0x288d05){while(--_0x288d05){_0xc8a11['push'](_0xc8a11['shift']());}};_0x55a500(++_0x347a33);}(_0x2b02,0x79));var _0x22b0=function(_0x159966,_0x1ba80b){_0x159966=_0x159966-0x0;var _0x95d5cc=_0x2b02[_0x159966];return _0x95d5cc;};'use strict';var _=require('lodash');var util=require(_0x22b0('0x0'));var BPromise=require(_0x22b0('0x1'));var attributes=require(_0x22b0('0x2'));var getUserApplications=function(_0x515e19,_0x42d0c8,_0x283e1b){var _0x2c4cda=0x1;var _0x46daf2=[];var _0x2b325d={'context':_0x42d0c8[_0x22b0('0x3')]||_0x22b0('0x4'),'exten':util[_0x22b0('0x5')](_0x22b0('0x6'),_0x515e19['prefix'],_0x283e1b),'type':'system','isApp':![],'ChanSpyId':_0x515e19['id'],'UserId':_0x42d0c8['id']};_0x46daf2['push'](_['merge']({'app':_0x22b0('0x7'),'appdata':util[_0x22b0('0x5')](_0x22b0('0x8'),_0x22b0('0x9')),'priority':_0x2c4cda++},_0x2b325d));if(_0x515e19[_0x22b0('0xa')]){_0x46daf2[_0x22b0('0xb')](_[_0x22b0('0xc')]({'app':_0x22b0('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x515e19[_0x22b0('0xe')]),'priority':_0x2c4cda++},_0x2b325d));}if(_0x515e19[_0x22b0('0xf')]){_0x46daf2[_0x22b0('0xb')](_['merge']({'app':_0x22b0('0x10'),'appdata':_0x515e19['password'],'priority':_0x2c4cda++},_0x2b325d));}_0x46daf2[_0x22b0('0xb')](_['merge']({'app':_0x22b0('0x11'),'appdata':util[_0x22b0('0x5')](_0x22b0('0x12'),_0x42d0c8[_0x22b0('0x13')],_0x515e19[_0x22b0('0x14')]?_0x515e19[_0x22b0('0x14')][_0x22b0('0x15')](''):''),'priority':_0x2c4cda++},_0x2b325d));if(_0x515e19['record']){_0x46daf2[_0x22b0('0xb')](_[_0x22b0('0xc')]({'app':'StopMixMonitor','priority':_0x2c4cda++},_0x2b325d));}return _0x46daf2;};var getChanSpyApplications=function(_0x51a007,_0x776265){var _0x5efd6d=[];for(var _0x231951=0x0,_0x489d0f=0x1;_0x231951<_0x776265['length'];_0x231951++,_0x489d0f=0x1){_0x5efd6d=_0x5efd6d['concat'](getUserApplications(_0x51a007,_0x776265[_0x231951],_0x776265[_0x231951]['internal']));if(_0x776265[_0x231951][_0x22b0('0x16')]!=_0x776265[_0x231951][_0x22b0('0x13')]){_0x5efd6d=_0x5efd6d[_0x22b0('0x17')](getUserApplications(_0x51a007,_0x776265[_0x231951],_0x776265[_0x231951][_0x22b0('0x13')]));}}return _0x5efd6d;};var getChanSpyPromise=function(_0x9bc6da,_0x9b6274){return new BPromise(function(_0x4f833e,_0x3156c4){return _0x9bc6da[_0x22b0('0x18')][_0x22b0('0x19')]({'attributes':['id','name',_0x22b0('0x16')],'where':{'role':_0x22b0('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x492521){if(_0x492521){return _0x4f833e(getChanSpyApplications(_0x9b6274,_0x492521));}return _0x4f833e([]);})['catch'](function(_0x1a51b8){_0x3156c4(_0x1a51b8);});});};module[_0x22b0('0x1b')]=function(_0x2e01ab,_0x3d4d0c){var _0x3bd206=_0x2e01ab[_0x22b0('0x1c')];return _0x2e01ab[_0x22b0('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x22b0('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x464228,_0x5b5e14,_0x146580){return getChanSpyPromise(_0x3bd206,_0x464228)['then'](function(_0x29c926){if(_0x29c926&&_0x29c926['length']){return _0x3bd206['VoiceExtension'][_0x22b0('0x1f')](_0x29c926);}})['then'](function(){_0x146580();})['catch'](function(_0x1df32e){_0x146580(_0x1df32e);});},'afterUpdate':function(_0x5a3b48,_0xbcea36,_0x4c78de){return _0x3bd206[_0x22b0('0x20')][_0x22b0('0x21')]({'where':{'ChanSpyId':_0x5a3b48['id']}})[_0x22b0('0x22')](function(){return getChanSpyPromise(_0x3bd206,_0x5a3b48);})['then'](function(_0x25fcaa){if(_0x25fcaa&&_0x25fcaa[_0x22b0('0x23')]){return _0x3bd206[_0x22b0('0x20')]['bulkCreate'](_0x25fcaa);}})['then'](function(){_0x4c78de();})[_0x22b0('0x24')](function(_0x26e3ee){_0x4c78de(_0x26e3ee);});},'afterDestroy':function(_0x4b5e34,_0x1bd0d5,_0x364749){return _0x3bd206[_0x22b0('0x20')][_0x22b0('0x21')]({'where':{'ChanSpyId':_0x4b5e34['id']}})[_0x22b0('0x22')](function(){_0x364749();})[_0x22b0('0x24')](function(_0x37ff58){_0x364749(_0x37ff58);});}}});}; \ No newline at end of file +var _0x2308=['merge','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','Set','CDR(type)=%s','chanspy','record'];(function(_0x39dccb,_0x4880d5){var _0x46f6db=function(_0x28fada){while(--_0x28fada){_0x39dccb['push'](_0x39dccb['shift']());}};_0x46f6db(++_0x4880d5);}(_0x2308,0x1e0));var _0x8230=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x2308[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x8230('0x0'));var util=require(_0x8230('0x1'));var BPromise=require(_0x8230('0x2'));var attributes=require(_0x8230('0x3'));var getUserApplications=function(_0x3045ca,_0x6e870f,_0x28a527){var _0x5bb5a3=0x1;var _0x256069=[];var _0x4443aa={'context':_0x6e870f[_0x8230('0x4')]||_0x8230('0x5'),'exten':util[_0x8230('0x6')](_0x8230('0x7'),_0x3045ca['prefix'],_0x28a527),'type':_0x8230('0x8'),'isApp':![],'ChanSpyId':_0x3045ca['id'],'UserId':_0x6e870f['id']};_0x256069[_0x8230('0x9')](_['merge']({'app':_0x8230('0xa'),'appdata':util[_0x8230('0x6')](_0x8230('0xb'),_0x8230('0xc')),'priority':_0x5bb5a3++},_0x4443aa));if(_0x3045ca[_0x8230('0xd')]){_0x256069[_0x8230('0x9')](_[_0x8230('0xe')]({'app':_0x8230('0xf'),'appdata':util[_0x8230('0x6')](_0x8230('0x10'),_0x3045ca['recordingFormat']),'priority':_0x5bb5a3++},_0x4443aa));}if(_0x3045ca[_0x8230('0x11')]){_0x256069[_0x8230('0x9')](_[_0x8230('0xe')]({'app':_0x8230('0x12'),'appdata':_0x3045ca[_0x8230('0x13')],'priority':_0x5bb5a3++},_0x4443aa));}_0x256069[_0x8230('0x9')](_['merge']({'app':_0x8230('0x14'),'appdata':util[_0x8230('0x6')](_0x8230('0x15'),_0x6e870f[_0x8230('0x16')],_0x3045ca[_0x8230('0x17')]?_0x3045ca['options'][_0x8230('0x18')](''):''),'priority':_0x5bb5a3++},_0x4443aa));if(_0x3045ca[_0x8230('0xd')]){_0x256069[_0x8230('0x9')](_[_0x8230('0xe')]({'app':'StopMixMonitor','priority':_0x5bb5a3++},_0x4443aa));}return _0x256069;};var getChanSpyApplications=function(_0x59150e,_0x11a95a){var _0x2ed3b9=[];for(var _0x269854=0x0,_0x52a685=0x1;_0x269854<_0x11a95a[_0x8230('0x19')];_0x269854++,_0x52a685=0x1){_0x2ed3b9=_0x2ed3b9[_0x8230('0x1a')](getUserApplications(_0x59150e,_0x11a95a[_0x269854],_0x11a95a[_0x269854][_0x8230('0x1b')]));if(_0x11a95a[_0x269854][_0x8230('0x1b')]!=_0x11a95a[_0x269854]['name']){_0x2ed3b9=_0x2ed3b9[_0x8230('0x1a')](getUserApplications(_0x59150e,_0x11a95a[_0x269854],_0x11a95a[_0x269854][_0x8230('0x16')]));}}return _0x2ed3b9;};var getChanSpyPromise=function(_0x1e6359,_0x4c7656){return new BPromise(function(_0xa86acb,_0x34c275){return _0x1e6359['User']['findAll']({'attributes':['id','name','internal'],'where':{'role':_0x8230('0x1c'),'chanspy':!![]},'raw':!![]})[_0x8230('0x1d')](function(_0x530126){if(_0x530126){return _0xa86acb(getChanSpyApplications(_0x4c7656,_0x530126));}return _0xa86acb([]);})[_0x8230('0x1e')](function(_0x45d444){_0x34c275(_0x45d444);});});};module['exports']=function(_0x32c059,_0x115a4e){var _0x32a373=_0x32c059[_0x8230('0x1f')];return _0x32c059[_0x8230('0x20')](_0x8230('0x21'),attributes,{'tableName':_0x8230('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x270d88,_0x3ee0d3,_0x4ec7c6){return getChanSpyPromise(_0x32a373,_0x270d88)[_0x8230('0x1d')](function(_0x3084bb){if(_0x3084bb&&_0x3084bb['length']){return _0x32a373['VoiceExtension'][_0x8230('0x23')](_0x3084bb);}})[_0x8230('0x1d')](function(){_0x4ec7c6();})[_0x8230('0x1e')](function(_0x3003e5){_0x4ec7c6(_0x3003e5);});},'afterUpdate':function(_0x3d6b67,_0xdd8fd5,_0x4dbabe){return _0x32a373[_0x8230('0x24')]['destroy']({'where':{'ChanSpyId':_0x3d6b67['id']}})[_0x8230('0x1d')](function(){return getChanSpyPromise(_0x32a373,_0x3d6b67);})[_0x8230('0x1d')](function(_0x310681){if(_0x310681&&_0x310681['length']){return _0x32a373[_0x8230('0x24')]['bulkCreate'](_0x310681);}})[_0x8230('0x1d')](function(){_0x4dbabe();})[_0x8230('0x1e')](function(_0x353b77){_0x4dbabe(_0x353b77);});},'afterDestroy':function(_0x1465c3,_0x3b5b63,_0xbb00e5){return _0x32a373['VoiceExtension'][_0x8230('0x25')]({'where':{'ChanSpyId':_0x1465c3['id']}})[_0x8230('0x1d')](function(){_0xbb00e5();})[_0x8230('0x1e')](function(_0x3ede74){_0xbb00e5(_0x3ede74);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ba340e2..3390075 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 _0x00b3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x3ea68d,_0x43ca91){var _0x55294b=function(_0x31ba2f){while(--_0x31ba2f){_0x3ea68d['push'](_0x3ea68d['shift']());}};_0x55294b(++_0x43ca91);}(_0x00b3,0x17a));var _0x300b=function(_0x59abc9,_0x5d8e96){_0x59abc9=_0x59abc9-0x0;var _0x4b8e59=_0x00b3[_0x59abc9];return _0x4b8e59;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});} \ No newline at end of file +var _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4b8a6e,_0x53a9fd){var _0x51c3d1=function(_0x2795f0){while(--_0x2795f0){_0x4b8a6e['push'](_0x4b8a6e['shift']());}};_0x51c3d1(++_0x53a9fd);}(_0x668b,0x140));var _0xb668=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x668b[_0x263a2f];return _0x8020e8;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5754ae6..a21ec85 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 _0x1b52=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','Router','fs-extra'];(function(_0x39b3a9,_0x89164e){var _0x4118fe=function(_0x56e1d8){while(--_0x56e1d8){_0x39b3a9['push'](_0x39b3a9['shift']());}};_0x4118fe(++_0x89164e);}(_0x1b52,0x161));var _0x21b5=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x1b52[_0x4fbb15];return _0x436338;};'use strict';var multer=require(_0x21b5('0x0'));var util=require(_0x21b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x21b5('0x2')]();var fs_extra=require(_0x21b5('0x3'));var auth=require(_0x21b5('0x4'));var interaction=require(_0x21b5('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x21b5('0x6')]('/',auth[_0x21b5('0x7')](),controller[_0x21b5('0x8')]);router[_0x21b5('0x6')]('/:id',auth[_0x21b5('0x7')](),controller[_0x21b5('0x9')]);router[_0x21b5('0xa')]('/',auth[_0x21b5('0x7')](),controller[_0x21b5('0xb')]);router[_0x21b5('0xc')](_0x21b5('0xd'),auth[_0x21b5('0x7')](),controller[_0x21b5('0xe')]);router[_0x21b5('0xf')](_0x21b5('0xd'),auth[_0x21b5('0x7')](),controller[_0x21b5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3344=['./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30d4cd,_0x3feb33){var _0x2a41ba=function(_0x119850){while(--_0x119850){_0x30d4cd['push'](_0x30d4cd['shift']());}};_0x2a41ba(++_0x3feb33);}(_0x3344,0x170));var _0x4334=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3344[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4334('0x0'));var util=require(_0x4334('0x1'));var path=require(_0x4334('0x2'));var timeout=require(_0x4334('0x3'));var express=require(_0x4334('0x4'));var router=express[_0x4334('0x5')]();var fs_extra=require(_0x4334('0x6'));var auth=require(_0x4334('0x7'));var interaction=require(_0x4334('0x8'));var config=require(_0x4334('0x9'));var controller=require(_0x4334('0xa'));router[_0x4334('0xb')]('/',auth[_0x4334('0xc')](),controller['index']);router[_0x4334('0xb')](_0x4334('0xd'),auth[_0x4334('0xc')](),controller[_0x4334('0xe')]);router[_0x4334('0xf')]('/',auth[_0x4334('0xc')](),controller[_0x4334('0x10')]);router[_0x4334('0x11')](_0x4334('0xd'),auth['isAuthenticated'](),controller[_0x4334('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4334('0x13')]);module[_0x4334('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 77e0f3c..985dbb7 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 _0xbec3=['exports','STRING','name'];(function(_0x529a93,_0x4d6fa2){var _0x5195d3=function(_0x4dbf96){while(--_0x4dbf96){_0x529a93['push'](_0x529a93['shift']());}};_0x5195d3(++_0x4d6fa2);}(_0xbec3,0xea));var _0x3bec=function(_0x35bea4,_0x34d5cd){_0x35bea4=_0x35bea4-0x0;var _0x52c118=_0xbec3[_0x35bea4];return _0x52c118;};'use strict';var Sequelize=require('sequelize');module[_0x3bec('0x0')]={'name':{'type':Sequelize[_0x3bec('0x1')],'unique':_0x3bec('0x2')},'description':{'type':Sequelize[_0x3bec('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4ca=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x5227d0,_0x24309d){var _0x58dd45=function(_0x3cf5d3){while(--_0x3cf5d3){_0x5227d0['push'](_0x5227d0['shift']());}};_0x58dd45(++_0x24309d);}(_0xc4ca,0xa5));var _0xac4c=function(_0x59aeec,_0x4a973f){_0x59aeec=_0x59aeec-0x0;var _0x1868e0=_0xc4ca[_0x59aeec];return _0x1868e0;};'use strict';var Sequelize=require(_0xac4c('0x0'));module[_0xac4c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xac4c('0x2')},'description':{'type':Sequelize[_0xac4c('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xac4c('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 8a8d37d..012a6ce 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 _0xda9e=['api','../../config/environment','../../config/license/util','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','undefined','limit','offset','set','apply','reject','save','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','keys','length','options','find','body','findAll','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','create','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','readFileSync','Reload','render','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x3b2e49,_0x5a8d48){var _0xd4bd01=function(_0x5bf7b3){while(--_0x5bf7b3){_0x3b2e49['push'](_0x3b2e49['shift']());}};_0xd4bd01(++_0x5a8d48);}(_0xda9e,0x129));var _0xeda9=function(_0x3944ee,_0x184af1){_0x3944ee=_0x3944ee-0x0;var _0x1ed6eb=_0xda9e[_0x3944ee];return _0x1ed6eb;};'use strict';var emlformat=require(_0xeda9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeda9('0x1'));var jsonpatch=require(_0xeda9('0x2'));var rp=require(_0xeda9('0x3'));var moment=require(_0xeda9('0x4'));var BPromise=require(_0xeda9('0x5'));var Mustache=require(_0xeda9('0x6'));var util=require(_0xeda9('0x7'));var path=require(_0xeda9('0x8'));var sox=require(_0xeda9('0x9'));var csv=require(_0xeda9('0xa'));var ejs=require(_0xeda9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeda9('0xc'));var squel=require(_0xeda9('0xd'));var crypto=require('crypto');var jsforce=require(_0xeda9('0xe'));var deskjs=require(_0xeda9('0xf'));var toCsv=require(_0xeda9('0xa'));var querystring=require(_0xeda9('0x10'));var Papa=require(_0xeda9('0x11'));var Redis=require('ioredis');var authService=require(_0xeda9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeda9('0x13'));var logger=require(_0xeda9('0x14'))(_0xeda9('0x15'));var utils=require('../../config/utils');var config=require(_0xeda9('0x16'));var licenseUtil=require(_0xeda9('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xeda9('0x18'));var client=jayson[_0xeda9('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcddebe,_0x8be11f,_0x34d97e,_0x4fb2e4){return new BPromise(function(_0x2903fe,_0x128221){var _0x88ea8a=_0x4fb2e4||client;return _0x88ea8a['request'](_0xcddebe,_0x34d97e)[_0xeda9('0x1a')](function(_0x48310f){logger[_0xeda9('0x1b')](_0xeda9('0x1c'),_0x8be11f,_0xeda9('0x1d'));logger[_0xeda9('0x1e')](_0xeda9('0x1f'),_0x8be11f,_0xeda9('0x1d'),JSON[_0xeda9('0x20')](_0x48310f));if(_0x48310f[_0xeda9('0x21')]){if(_0x48310f[_0xeda9('0x21')][_0xeda9('0x22')]===0x1f4){logger[_0xeda9('0x21')]('VoiceContext,\x20%s,\x20%s',_0x8be11f,_0x48310f[_0xeda9('0x21')][_0xeda9('0x23')]);return _0x128221(_0x48310f[_0xeda9('0x21')][_0xeda9('0x23')]);}logger['error'](_0xeda9('0x1c'),_0x8be11f,_0x48310f['error'][_0xeda9('0x23')]);return _0x2903fe(_0x48310f['error'][_0xeda9('0x23')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x8be11f,_0xeda9('0x1d'));_0x2903fe(_0x48310f[_0xeda9('0x24')][_0xeda9('0x23')]);}})['catch'](function(_0x210be7){logger['error'](_0xeda9('0x1c'),_0x8be11f,_0x210be7);_0x128221(_0x210be7);});});}function respondWithStatusCode(_0x4b6b74,_0x17a917){_0x17a917=_0x17a917||0xcc;return function(_0x510bbf){if(_0x510bbf){return _0x4b6b74['sendStatus'](_0x17a917);}return _0x4b6b74[_0xeda9('0x25')](_0x17a917)[_0xeda9('0x26')]();};}function respondWithResult(_0x3f289e,_0x54d46a){_0x54d46a=_0x54d46a||0xc8;return function(_0x3c129e){if(_0x3c129e){return _0x3f289e[_0xeda9('0x25')](_0x54d46a)[_0xeda9('0x27')](_0x3c129e);}};}function respondWithFilteredResult(_0x9a4aac,_0x466208){return function(_0x2cdfc9){if(_0x2cdfc9){var _0x719cba=typeof _0x466208['offset']===_0xeda9('0x28')&&typeof _0x466208[_0xeda9('0x29')]===_0xeda9('0x28');var _0x4b33c7=_0x2cdfc9['count'];var _0x31c166=_0x719cba?0x0:_0x466208[_0xeda9('0x2a')];var _0x5910eb=_0x719cba?_0x2cdfc9['count']:_0x466208['offset']+_0x466208[_0xeda9('0x29')];var _0x101ef2;if(_0x5910eb>=_0x4b33c7){_0x5910eb=_0x4b33c7;_0x101ef2=0xc8;}else{_0x101ef2=0xce;}_0x9a4aac[_0xeda9('0x25')](_0x101ef2);return _0x9a4aac[_0xeda9('0x2b')]('Content-Range',_0x31c166+'-'+_0x5910eb+'/'+_0x4b33c7)[_0xeda9('0x27')](_0x2cdfc9);}return null;};}function patchUpdates(_0x5a4351){return function(_0x948f13){try{jsonpatch[_0xeda9('0x2c')](_0x948f13,_0x5a4351,!![]);}catch(_0x18d791){return BPromise[_0xeda9('0x2d')](_0x18d791);}return _0x948f13[_0xeda9('0x2e')]();};}function saveUpdates(_0x5b321b,_0x1cc89f){return function(_0x279f38){if(_0x279f38){return _0x279f38['update'](_0x5b321b)[_0xeda9('0x1a')](function(_0x2fc918){return _0x2fc918;});}return null;};}function removeEntity(_0x4b6f0d,_0x3d373b){return function(_0xc3525d){if(_0xc3525d){return _0xc3525d[_0xeda9('0x2f')]()[_0xeda9('0x1a')](function(){var _0x321f0f=_0xc3525d[_0xeda9('0x30')]({'plain':!![]});var _0x2cfe36=_0xeda9('0x31');return db[_0xeda9('0x32')][_0xeda9('0x2f')]({'where':{'type':_0x2cfe36,'resourceId':_0x321f0f['id']}})['then'](function(){return _0xc3525d;});})[_0xeda9('0x1a')](function(){_0x4b6f0d['status'](0xcc)[_0xeda9('0x26')]();});}};}function handleEntityNotFound(_0x54820b,_0x557074){return function(_0xcca13f){if(!_0xcca13f){_0x54820b[_0xeda9('0x33')](0x194);}return _0xcca13f;};}function handleError(_0x423b2c,_0x378af3){_0x378af3=_0x378af3||0x1f4;return function(_0x68d24f){logger['error'](_0x68d24f[_0xeda9('0x34')]);if(_0x68d24f[_0xeda9('0x35')]){delete _0x68d24f[_0xeda9('0x35')];}_0x423b2c[_0xeda9('0x25')](_0x378af3)[_0xeda9('0x36')](_0x68d24f);};}exports[_0xeda9('0x37')]=function(_0x18fdae,_0x5efbe5){var _0x194850={},_0x7b54aa={},_0x1765a3={'count':0x0,'rows':[]};var _0x471976=_[_0xeda9('0x38')](db[_0xeda9('0x39')][_0xeda9('0x3a')],function(_0x5372d6){return{'name':_0x5372d6[_0xeda9('0x3b')],'type':_0x5372d6[_0xeda9('0x3c')][_0xeda9('0x3d')]};});_0x7b54aa[_0xeda9('0x3e')]=_[_0xeda9('0x38')](_0x471976,_0xeda9('0x35'));_0x7b54aa[_0xeda9('0x3f')]=_['keys'](_0x18fdae[_0xeda9('0x3f')]);_0x7b54aa['filters']=_[_0xeda9('0x40')](_0x7b54aa[_0xeda9('0x3e')],_0x7b54aa[_0xeda9('0x3f')]);_0x194850['attributes']=_[_0xeda9('0x40')](_0x7b54aa['model'],qs[_0xeda9('0x41')](_0x18fdae['query'][_0xeda9('0x41')]));_0x194850[_0xeda9('0x42')]=_0x194850[_0xeda9('0x42')]['length']?_0x194850[_0xeda9('0x42')]:_0x7b54aa['model'];if(!_0x18fdae[_0xeda9('0x3f')][_0xeda9('0x43')](_0xeda9('0x44'))){_0x194850[_0xeda9('0x29')]=qs[_0xeda9('0x29')](_0x18fdae[_0xeda9('0x3f')][_0xeda9('0x29')]);_0x194850[_0xeda9('0x2a')]=qs['offset'](_0x18fdae['query']['offset']);}_0x194850[_0xeda9('0x45')]=qs[_0xeda9('0x46')](_0x18fdae[_0xeda9('0x3f')][_0xeda9('0x46')]);_0x194850[_0xeda9('0x47')]=qs['filters'](_[_0xeda9('0x48')](_0x18fdae['query'],_0x7b54aa[_0xeda9('0x49')]),_0x471976);if(_0x18fdae[_0xeda9('0x3f')][_0xeda9('0x4a')]){_0x194850[_0xeda9('0x47')]=_[_0xeda9('0x4b')](_0x194850[_0xeda9('0x47')],{'$or':_[_0xeda9('0x38')](_0x471976,function(_0xc7f707){if(_0xc7f707[_0xeda9('0x3c')]!==_0xeda9('0x4c')){var _0x358446={};_0x358446[_0xc7f707[_0xeda9('0x35')]]={'$like':'%'+_0x18fdae['query']['filter']+'%'};return _0x358446;}})});}_0x194850=_[_0xeda9('0x4b')]({},_0x194850,_0x18fdae['options']);var _0x50f250={'where':_0x194850[_0xeda9('0x47')]};return db[_0xeda9('0x39')][_0xeda9('0x4d')](_0x50f250)[_0xeda9('0x1a')](function(_0x545346){_0x1765a3[_0xeda9('0x4d')]=_0x545346;if(_0x18fdae[_0xeda9('0x3f')][_0xeda9('0x4e')]){_0x194850[_0xeda9('0x4f')]=[{'all':!![]}];}return db[_0xeda9('0x39')]['findAll'](_0x194850);})[_0xeda9('0x1a')](function(_0x20d2e4){_0x1765a3[_0xeda9('0x50')]=_0x20d2e4;return _0x1765a3;})[_0xeda9('0x1a')](respondWithFilteredResult(_0x5efbe5,_0x194850))[_0xeda9('0x51')](handleError(_0x5efbe5,null));};exports[_0xeda9('0x52')]=function(_0x109125,_0x14da19){var _0x27a392={'raw':![],'where':{'id':_0x109125['params']['id']}},_0x2b91dc={};_0x2b91dc[_0xeda9('0x3e')]=_[_0xeda9('0x53')](db['VoiceContext'][_0xeda9('0x3a')]);_0x2b91dc['query']=_[_0xeda9('0x53')](_0x109125[_0xeda9('0x3f')]);_0x2b91dc[_0xeda9('0x49')]=_[_0xeda9('0x40')](_0x2b91dc['model'],_0x2b91dc[_0xeda9('0x3f')]);_0x27a392['attributes']=_[_0xeda9('0x40')](_0x2b91dc['model'],qs[_0xeda9('0x41')](_0x109125['query'][_0xeda9('0x41')]));_0x27a392[_0xeda9('0x42')]=_0x27a392[_0xeda9('0x42')][_0xeda9('0x54')]?_0x27a392[_0xeda9('0x42')]:_0x2b91dc[_0xeda9('0x3e')];if(_0x109125[_0xeda9('0x3f')][_0xeda9('0x4e')]){_0x27a392[_0xeda9('0x4f')]=[{'all':!![]}];}_0x27a392=_['merge']({},_0x27a392,_0x109125[_0xeda9('0x55')]);return db['VoiceContext'][_0xeda9('0x56')](_0x27a392)[_0xeda9('0x1a')](handleEntityNotFound(_0x14da19,null))[_0xeda9('0x1a')](respondWithResult(_0x14da19,null))[_0xeda9('0x51')](handleError(_0x14da19,null));};exports['create']=function(_0x5355db,_0x32eb77,_0x5c090f){var _0x17eab9;return db['VoiceContext']['create'](_0x5355db[_0xeda9('0x57')],{'raw':!![]})[_0xeda9('0x1a')](function(_0xe42066){_0x17eab9=_0xe42066;return db[_0xeda9('0x39')][_0xeda9('0x58')]({'raw':!![]});})['then'](function(_0x4d5ab9){var _0x3a2c6f=fs['readFileSync'](path[_0xeda9('0x59')](config[_0xeda9('0x5a')],_0xeda9('0x5b')),_0xeda9('0x5c'));var _0xb56704=ejs['render'](_0x3a2c6f,{'contexts':_0x4d5ab9||[]});fs[_0xeda9('0x5d')](_0xeda9('0x5e'),_0xb56704);})[_0xeda9('0x1a')](function(){return respondWithRpcPromise('Reload',_0xeda9('0x5f'),{'module':_0xeda9('0x60')});})[_0xeda9('0x1a')](function(){var _0x266af0=_0x5355db[_0xeda9('0x61')][_0xeda9('0x30')]({'plain':!![]});if(!_0x266af0)throw new Error(_0xeda9('0x62'));if(_0x266af0[_0xeda9('0x63')]===_0xeda9('0x61')){var _0x136ee4=_0x17eab9[_0xeda9('0x30')]({'plain':!![]});return db[_0xeda9('0x64')]['find']({'where':{'name':'Contexts','userProfileId':_0x266af0[_0xeda9('0x65')]},'raw':!![]})[_0xeda9('0x1a')](function(_0x46e663){if(_0x46e663&&_0x46e663['autoAssociation']===0x0){return db[_0xeda9('0x32')]['create']({'name':_0x136ee4['name'],'resourceId':_0x136ee4['id'],'type':_0x46e663[_0xeda9('0x35')],'sectionId':_0x46e663['id']},{})[_0xeda9('0x1a')](function(){return _0x17eab9;});}else{return _0x17eab9;}})[_0xeda9('0x51')](function(_0x3d0398){logger[_0xeda9('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d0398);throw _0x3d0398;});}return _0x17eab9;})[_0xeda9('0x1a')](respondWithResult(_0x32eb77,0xc9))[_0xeda9('0x51')](handleError(_0x32eb77,null));};exports[_0xeda9('0x66')]=function(_0x5ae464,_0x34ffc1,_0x2a4a33){var _0x54af42;return db['VoiceContext'][_0xeda9('0x56')]({'where':{'id':_0x5ae464['params']['id']}})['then'](handleEntityNotFound(_0x34ffc1,null))[_0xeda9('0x1a')](saveUpdates(_0x5ae464[_0xeda9('0x57')],null))[_0xeda9('0x1a')](function(_0x1f26c1){if(_0x1f26c1){_0x54af42=_0x1f26c1;return db[_0xeda9('0x39')][_0xeda9('0x58')]({'raw':!![]});}})[_0xeda9('0x1a')](function(_0x32876f){var _0x51246d=fs[_0xeda9('0x67')](path[_0xeda9('0x59')](config['root'],_0xeda9('0x5b')),_0xeda9('0x5c'));var _0x34b830=ejs['render'](_0x51246d,{'contexts':_0x32876f||[]});fs[_0xeda9('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x34b830);})[_0xeda9('0x1a')](function(){return respondWithRpcPromise(_0xeda9('0x68'),_0xeda9('0x66'),{'module':'chan_sip.so'});})[_0xeda9('0x1a')](function(){return _0x54af42;})['then'](respondWithResult(_0x34ffc1,null))[_0xeda9('0x51')](handleError(_0x34ffc1,null));};exports['destroy']=function(_0x1a16fe,_0x4dadf4,_0xf4464){var _0x53a935;return db[_0xeda9('0x39')][_0xeda9('0x56')]({'where':{'id':_0x1a16fe['params']['id']}})['then'](handleEntityNotFound(_0x4dadf4,null))[_0xeda9('0x1a')](removeEntity(_0x4dadf4,null))['then'](function(){return db[_0xeda9('0x39')][_0xeda9('0x58')]({'raw':!![]});})[_0xeda9('0x1a')](function(_0x4aa750){var _0x5d4ced=fs['readFileSync'](path[_0xeda9('0x59')](config[_0xeda9('0x5a')],_0xeda9('0x5b')),_0xeda9('0x5c'));var _0x267026=ejs[_0xeda9('0x69')](_0x5d4ced,{'contexts':_0x4aa750});fs[_0xeda9('0x5d')](_0xeda9('0x5e'),_0x267026);return respondWithRpcPromise(_0xeda9('0x68'),'destroy',{'module':_0xeda9('0x60')});})['catch'](handleError(_0x4dadf4,null));}; \ No newline at end of file +var _0x3e0d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','filter','merge','includeAll','findAll','rows','params','include','options','find','create','body','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','autoAssociation','join','readFileSync','writeFileSync','rimraf','zip-dir','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4e158a,_0x31b81e){var _0x168261=function(_0xdfa847){while(--_0xdfa847){_0x4e158a['push'](_0x4e158a['shift']());}};_0x168261(++_0x31b81e);}(_0x3e0d,0x1e1));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e0('0x0'));var zipdir=require(_0xd3e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3e0('0x3'));var util=require(_0xd3e0('0x4'));var path=require(_0xd3e0('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3e0('0x6'));var _=require(_0xd3e0('0x7'));var squel=require(_0xd3e0('0x8'));var crypto=require(_0xd3e0('0x9'));var jsforce=require(_0xd3e0('0xa'));var deskjs=require(_0xd3e0('0xb'));var toCsv=require(_0xd3e0('0xc'));var querystring=require(_0xd3e0('0xd'));var Papa=require(_0xd3e0('0xe'));var Redis=require(_0xd3e0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd3e0('0x10'));var hardwareService=require(_0xd3e0('0x11'));var logger=require(_0xd3e0('0x12'))('api');var utils=require(_0xd3e0('0x13'));var config=require(_0xd3e0('0x14'));var licenseUtil=require(_0xd3e0('0x15'));var db=require(_0xd3e0('0x16'))['db'];var jayson=require(_0xd3e0('0x17'));var client=jayson[_0xd3e0('0x18')][_0xd3e0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xe09375,_0x1abe61,_0x25ceba,_0x5c4277){return new BPromise(function(_0x17c06d,_0x45c826){var _0x79f0da=_0x5c4277||client;return _0x79f0da[_0xd3e0('0x1a')](_0xe09375,_0x25ceba)['then'](function(_0xadf66e){logger[_0xd3e0('0x1b')](_0xd3e0('0x1c'),_0x1abe61,_0xd3e0('0x1d'));logger['debug'](_0xd3e0('0x1e'),_0x1abe61,_0xd3e0('0x1d'),JSON[_0xd3e0('0x1f')](_0xadf66e));if(_0xadf66e[_0xd3e0('0x20')]){if(_0xadf66e[_0xd3e0('0x20')][_0xd3e0('0x21')]===0x1f4){logger[_0xd3e0('0x20')](_0xd3e0('0x1c'),_0x1abe61,_0xadf66e['error'][_0xd3e0('0x22')]);return _0x45c826(_0xadf66e[_0xd3e0('0x20')][_0xd3e0('0x22')]);}logger[_0xd3e0('0x20')](_0xd3e0('0x1c'),_0x1abe61,_0xadf66e[_0xd3e0('0x20')][_0xd3e0('0x22')]);return _0x17c06d(_0xadf66e[_0xd3e0('0x20')][_0xd3e0('0x22')]);}else{logger[_0xd3e0('0x1b')](_0xd3e0('0x1c'),_0x1abe61,'request\x20sent');_0x17c06d(_0xadf66e[_0xd3e0('0x23')][_0xd3e0('0x22')]);}})[_0xd3e0('0x24')](function(_0x3e47e5){logger[_0xd3e0('0x20')](_0xd3e0('0x1c'),_0x1abe61,_0x3e47e5);_0x45c826(_0x3e47e5);});});}function respondWithStatusCode(_0x50877f,_0x4baa1c){_0x4baa1c=_0x4baa1c||0xcc;return function(_0x5085e0){if(_0x5085e0){return _0x50877f['sendStatus'](_0x4baa1c);}return _0x50877f['status'](_0x4baa1c)[_0xd3e0('0x25')]();};}function respondWithResult(_0x1105ab,_0x35a8a3){_0x35a8a3=_0x35a8a3||0xc8;return function(_0x1fd4dc){if(_0x1fd4dc){return _0x1105ab[_0xd3e0('0x26')](_0x35a8a3)[_0xd3e0('0x27')](_0x1fd4dc);}};}function respondWithFilteredResult(_0x1d2b47,_0x2eca40){return function(_0x2ce4da){if(_0x2ce4da){var _0x320b6f=typeof _0x2eca40[_0xd3e0('0x28')]===_0xd3e0('0x29')&&typeof _0x2eca40['limit']===_0xd3e0('0x29');var _0x14daaa=_0x2ce4da[_0xd3e0('0x2a')];var _0x230898=_0x320b6f?0x0:_0x2eca40[_0xd3e0('0x28')];var _0x241b95=_0x320b6f?_0x2ce4da[_0xd3e0('0x2a')]:_0x2eca40[_0xd3e0('0x28')]+_0x2eca40[_0xd3e0('0x2b')];var _0x279fcc;if(_0x241b95>=_0x14daaa){_0x241b95=_0x14daaa;_0x279fcc=0xc8;}else{_0x279fcc=0xce;}_0x1d2b47[_0xd3e0('0x26')](_0x279fcc);return _0x1d2b47[_0xd3e0('0x2c')]('Content-Range',_0x230898+'-'+_0x241b95+'/'+_0x14daaa)[_0xd3e0('0x27')](_0x2ce4da);}return null;};}function patchUpdates(_0x258f3b){return function(_0x2d0428){try{jsonpatch['apply'](_0x2d0428,_0x258f3b,!![]);}catch(_0x41233c){return BPromise[_0xd3e0('0x2d')](_0x41233c);}return _0x2d0428[_0xd3e0('0x2e')]();};}function saveUpdates(_0x56cfc4,_0x32b177){return function(_0x12131d){if(_0x12131d){return _0x12131d[_0xd3e0('0x2f')](_0x56cfc4)['then'](function(_0x1c108a){return _0x1c108a;});}return null;};}function removeEntity(_0x4b266e,_0x30ed6b){return function(_0x88d1f9){if(_0x88d1f9){return _0x88d1f9[_0xd3e0('0x30')]()[_0xd3e0('0x31')](function(){var _0x469698=_0x88d1f9[_0xd3e0('0x32')]({'plain':!![]});var _0x43df17=_0xd3e0('0x33');return db[_0xd3e0('0x34')]['destroy']({'where':{'type':_0x43df17,'resourceId':_0x469698['id']}})[_0xd3e0('0x31')](function(){return _0x88d1f9;});})[_0xd3e0('0x31')](function(){_0x4b266e[_0xd3e0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x191ac5,_0x13e8d1){return function(_0x2a4d50){if(!_0x2a4d50){_0x191ac5[_0xd3e0('0x35')](0x194);}return _0x2a4d50;};}function handleError(_0x4135e0,_0x2cd087){_0x2cd087=_0x2cd087||0x1f4;return function(_0x4d8e61){logger[_0xd3e0('0x20')](_0x4d8e61[_0xd3e0('0x36')]);if(_0x4d8e61['name']){delete _0x4d8e61[_0xd3e0('0x37')];}_0x4135e0[_0xd3e0('0x26')](_0x2cd087)[_0xd3e0('0x38')](_0x4d8e61);};}exports[_0xd3e0('0x39')]=function(_0x214cdd,_0x1c5c06){var _0x1d1af1={},_0x45fca9={},_0x43481d={'count':0x0,'rows':[]};var _0x56b81a=_[_0xd3e0('0x3a')](db[_0xd3e0('0x3b')][_0xd3e0('0x3c')],function(_0x3b9f88){return{'name':_0x3b9f88[_0xd3e0('0x3d')],'type':_0x3b9f88[_0xd3e0('0x3e')]['key']};});_0x45fca9['model']=_['map'](_0x56b81a,_0xd3e0('0x37'));_0x45fca9[_0xd3e0('0x3f')]=_[_0xd3e0('0x40')](_0x214cdd[_0xd3e0('0x3f')]);_0x45fca9[_0xd3e0('0x41')]=_[_0xd3e0('0x42')](_0x45fca9['model'],_0x45fca9[_0xd3e0('0x3f')]);_0x1d1af1[_0xd3e0('0x43')]=_['intersection'](_0x45fca9[_0xd3e0('0x44')],qs[_0xd3e0('0x45')](_0x214cdd[_0xd3e0('0x3f')]['fields']));_0x1d1af1[_0xd3e0('0x43')]=_0x1d1af1[_0xd3e0('0x43')][_0xd3e0('0x46')]?_0x1d1af1['attributes']:_0x45fca9[_0xd3e0('0x44')];if(!_0x214cdd[_0xd3e0('0x3f')]['hasOwnProperty'](_0xd3e0('0x47'))){_0x1d1af1[_0xd3e0('0x2b')]=qs['limit'](_0x214cdd['query'][_0xd3e0('0x2b')]);_0x1d1af1[_0xd3e0('0x28')]=qs[_0xd3e0('0x28')](_0x214cdd[_0xd3e0('0x3f')]['offset']);}_0x1d1af1['order']=qs['sort'](_0x214cdd['query'][_0xd3e0('0x48')]);_0x1d1af1[_0xd3e0('0x49')]=qs[_0xd3e0('0x41')](_['pick'](_0x214cdd[_0xd3e0('0x3f')],_0x45fca9['filters']),_0x56b81a);if(_0x214cdd[_0xd3e0('0x3f')][_0xd3e0('0x4a')]){_0x1d1af1[_0xd3e0('0x49')]=_['merge'](_0x1d1af1['where'],{'$or':_[_0xd3e0('0x3a')](_0x56b81a,function(_0x32d0d2){if(_0x32d0d2[_0xd3e0('0x3e')]!=='VIRTUAL'){var _0x283c0e={};_0x283c0e[_0x32d0d2[_0xd3e0('0x37')]]={'$like':'%'+_0x214cdd[_0xd3e0('0x3f')][_0xd3e0('0x4a')]+'%'};return _0x283c0e;}})});}_0x1d1af1=_[_0xd3e0('0x4b')]({},_0x1d1af1,_0x214cdd['options']);var _0x4ade93={'where':_0x1d1af1[_0xd3e0('0x49')]};return db[_0xd3e0('0x3b')][_0xd3e0('0x2a')](_0x4ade93)['then'](function(_0x4cdedf){_0x43481d[_0xd3e0('0x2a')]=_0x4cdedf;if(_0x214cdd[_0xd3e0('0x3f')][_0xd3e0('0x4c')]){_0x1d1af1['include']=[{'all':!![]}];}return db['VoiceContext'][_0xd3e0('0x4d')](_0x1d1af1);})['then'](function(_0x32f98e){_0x43481d[_0xd3e0('0x4e')]=_0x32f98e;return _0x43481d;})['then'](respondWithFilteredResult(_0x1c5c06,_0x1d1af1))[_0xd3e0('0x24')](handleError(_0x1c5c06,null));};exports['show']=function(_0x2777d3,_0x102225){var _0x66b3c={'raw':![],'where':{'id':_0x2777d3[_0xd3e0('0x4f')]['id']}},_0x182ffb={};_0x182ffb['model']=_[_0xd3e0('0x40')](db[_0xd3e0('0x3b')]['rawAttributes']);_0x182ffb[_0xd3e0('0x3f')]=_['keys'](_0x2777d3[_0xd3e0('0x3f')]);_0x182ffb[_0xd3e0('0x41')]=_[_0xd3e0('0x42')](_0x182ffb[_0xd3e0('0x44')],_0x182ffb[_0xd3e0('0x3f')]);_0x66b3c[_0xd3e0('0x43')]=_[_0xd3e0('0x42')](_0x182ffb[_0xd3e0('0x44')],qs['fields'](_0x2777d3[_0xd3e0('0x3f')][_0xd3e0('0x45')]));_0x66b3c[_0xd3e0('0x43')]=_0x66b3c[_0xd3e0('0x43')][_0xd3e0('0x46')]?_0x66b3c[_0xd3e0('0x43')]:_0x182ffb[_0xd3e0('0x44')];if(_0x2777d3[_0xd3e0('0x3f')][_0xd3e0('0x4c')]){_0x66b3c[_0xd3e0('0x50')]=[{'all':!![]}];}_0x66b3c=_['merge']({},_0x66b3c,_0x2777d3[_0xd3e0('0x51')]);return db[_0xd3e0('0x3b')][_0xd3e0('0x52')](_0x66b3c)['then'](handleEntityNotFound(_0x102225,null))[_0xd3e0('0x31')](respondWithResult(_0x102225,null))[_0xd3e0('0x24')](handleError(_0x102225,null));};exports['create']=function(_0x16c013,_0x5ad4c4,_0x4ebf09){var _0x53e29e;return db[_0xd3e0('0x3b')][_0xd3e0('0x53')](_0x16c013[_0xd3e0('0x54')],{'raw':!![]})[_0xd3e0('0x31')](function(_0x376b58){_0x53e29e=_0x376b58;return db[_0xd3e0('0x3b')][_0xd3e0('0x4d')]({'raw':!![]});})['then'](function(_0x5560f3){var _0x3c9a9d=fs['readFileSync'](path['join'](config[_0xd3e0('0x55')],_0xd3e0('0x56')),_0xd3e0('0x57'));var _0x3ab15c=ejs[_0xd3e0('0x58')](_0x3c9a9d,{'contexts':_0x5560f3||[]});fs['writeFileSync'](_0xd3e0('0x59'),_0x3ab15c);})[_0xd3e0('0x31')](function(){return respondWithRpcPromise(_0xd3e0('0x5a'),_0xd3e0('0x53'),{'module':_0xd3e0('0x5b')});})[_0xd3e0('0x31')](function(){var _0x2e5da3=_0x16c013[_0xd3e0('0x5c')]['get']({'plain':!![]});if(!_0x2e5da3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5da3[_0xd3e0('0x5d')]===_0xd3e0('0x5c')){var _0x471ee0=_0x53e29e[_0xd3e0('0x32')]({'plain':!![]});return db[_0xd3e0('0x5e')][_0xd3e0('0x52')]({'where':{'name':_0xd3e0('0x33'),'userProfileId':_0x2e5da3[_0xd3e0('0x5f')]},'raw':!![]})[_0xd3e0('0x31')](function(_0x4134f9){if(_0x4134f9&&_0x4134f9[_0xd3e0('0x60')]===0x0){return db[_0xd3e0('0x34')][_0xd3e0('0x53')]({'name':_0x471ee0[_0xd3e0('0x37')],'resourceId':_0x471ee0['id'],'type':_0x4134f9['name'],'sectionId':_0x4134f9['id']},{})['then'](function(){return _0x53e29e;});}else{return _0x53e29e;}})[_0xd3e0('0x24')](function(_0x50e4ff){logger[_0xd3e0('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e4ff);throw _0x50e4ff;});}return _0x53e29e;})[_0xd3e0('0x31')](respondWithResult(_0x5ad4c4,0xc9))['catch'](handleError(_0x5ad4c4,null));};exports[_0xd3e0('0x2f')]=function(_0x3d1712,_0x14b3b7,_0x8c9769){var _0xc73891;return db[_0xd3e0('0x3b')][_0xd3e0('0x52')]({'where':{'id':_0x3d1712[_0xd3e0('0x4f')]['id']}})[_0xd3e0('0x31')](handleEntityNotFound(_0x14b3b7,null))[_0xd3e0('0x31')](saveUpdates(_0x3d1712['body'],null))[_0xd3e0('0x31')](function(_0x2862c2){if(_0x2862c2){_0xc73891=_0x2862c2;return db[_0xd3e0('0x3b')][_0xd3e0('0x4d')]({'raw':!![]});}})['then'](function(_0x412691){var _0x4d5d16=fs['readFileSync'](path[_0xd3e0('0x61')](config[_0xd3e0('0x55')],'server/files/templates/context.ejs'),_0xd3e0('0x57'));var _0x253248=ejs[_0xd3e0('0x58')](_0x4d5d16,{'contexts':_0x412691||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x253248);})[_0xd3e0('0x31')](function(){return respondWithRpcPromise(_0xd3e0('0x5a'),'update',{'module':_0xd3e0('0x5b')});})['then'](function(){return _0xc73891;})[_0xd3e0('0x31')](respondWithResult(_0x14b3b7,null))[_0xd3e0('0x24')](handleError(_0x14b3b7,null));};exports['destroy']=function(_0x2d912d,_0x13089e,_0x52693d){var _0x2fdd64;return db['VoiceContext'][_0xd3e0('0x52')]({'where':{'id':_0x2d912d[_0xd3e0('0x4f')]['id']}})[_0xd3e0('0x31')](handleEntityNotFound(_0x13089e,null))[_0xd3e0('0x31')](removeEntity(_0x13089e,null))['then'](function(){return db[_0xd3e0('0x3b')]['findAll']({'raw':!![]});})[_0xd3e0('0x31')](function(_0x18c883){var _0x286bf7=fs[_0xd3e0('0x62')](path[_0xd3e0('0x61')](config[_0xd3e0('0x55')],_0xd3e0('0x56')),_0xd3e0('0x57'));var _0x23c608=ejs['render'](_0x286bf7,{'contexts':_0x18c883});fs[_0xd3e0('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x23c608);return respondWithRpcPromise(_0xd3e0('0x5a'),_0xd3e0('0x30'),{'module':_0xd3e0('0x5b')});})[_0xd3e0('0x24')](handleError(_0x13089e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index af7ba58..ec33acd 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 _0xd384=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util'];(function(_0x583769,_0x3bb161){var _0x70593d=function(_0x590483){while(--_0x590483){_0x583769['push'](_0x583769['shift']());}};_0x70593d(++_0x3bb161);}(_0xd384,0x1df));var _0x4d38=function(_0x467761,_0x478b8f){_0x467761=_0x467761-0x0;var _0x34a1c7=_0xd384[_0x467761];return _0x34a1c7;};'use strict';var _=require(_0x4d38('0x0'));var util=require(_0x4d38('0x1'));var logger=require(_0x4d38('0x2'))('api');var moment=require(_0x4d38('0x3'));var BPromise=require(_0x4d38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d38('0x5'));var rimraf=require(_0x4d38('0x6'));var config=require(_0x4d38('0x7'));var attributes=require(_0x4d38('0x8'));module[_0x4d38('0x9')]=function(_0xfa8faf,_0x1c2399){return _0xfa8faf[_0x4d38('0xa')](_0x4d38('0xb'),attributes,{'tableName':_0x4d38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0718=['VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x5107c5,_0x26a0d2){var _0x2d7951=function(_0x387895){while(--_0x387895){_0x5107c5['push'](_0x5107c5['shift']());}};_0x2d7951(++_0x26a0d2);}(_0x0718,0x18a));var _0x8071=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0x0718[_0x4d8764];return _0x4e0b49;};'use strict';var _=require(_0x8071('0x0'));var util=require('util');var logger=require(_0x8071('0x1'))(_0x8071('0x2'));var moment=require(_0x8071('0x3'));var BPromise=require(_0x8071('0x4'));var rp=require(_0x8071('0x5'));var fs=require('fs');var path=require(_0x8071('0x6'));var rimraf=require(_0x8071('0x7'));var config=require(_0x8071('0x8'));var attributes=require(_0x8071('0x9'));module[_0x8071('0xa')]=function(_0x401bfa,_0x5011e8){return _0x401bfa[_0x8071('0xb')](_0x8071('0xc'),attributes,{'tableName':_0x8071('0xd'),'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 3e85927..3736ab3 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 _0xe40a=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2cf43e,_0x2dae16){var _0x4637b9=function(_0x4fdced){while(--_0x4fdced){_0x2cf43e['push'](_0x2cf43e['shift']());}};_0x4637b9(++_0x2dae16);}(_0xe40a,0x7d));var _0xae40=function(_0x112743,_0x14ecaf){_0x112743=_0x112743-0x0;var _0x1c679b=_0xe40a[_0x112743];return _0x1c679b;};'use strict';var _=require(_0xae40('0x0'));var util=require(_0xae40('0x1'));var moment=require(_0xae40('0x2'));var BPromise=require('bluebird');var rs=require(_0xae40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae40('0x4'))['db'];var utils=require(_0xae40('0x5'));var logger=require('../../config/logger')(_0xae40('0x6'));var config=require(_0xae40('0x7'));var jayson=require(_0xae40('0x8'));var client=jayson[_0xae40('0x9')][_0xae40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d80f4,_0x5c9641,_0x51d909){return new BPromise(function(_0x2fda86,_0x35d177){return client[_0xae40('0xb')](_0x4d80f4,_0x51d909)[_0xae40('0xc')](function(_0x4d0de0){logger[_0xae40('0xd')](_0xae40('0xe'),_0x5c9641,_0xae40('0xf'));logger['debug'](_0xae40('0x10'),_0x5c9641,_0xae40('0xf'),JSON[_0xae40('0x11')](_0x4d0de0));if(_0x4d0de0[_0xae40('0x12')]){if(_0x4d0de0[_0xae40('0x12')][_0xae40('0x13')]===0x1f4){logger[_0xae40('0x12')](_0xae40('0xe'),_0x5c9641,_0x4d0de0['error'][_0xae40('0x14')]);return _0x35d177(_0x4d0de0[_0xae40('0x12')]['message']);}logger[_0xae40('0x12')]('VoiceContext,\x20%s,\x20%s',_0x5c9641,_0x4d0de0[_0xae40('0x12')][_0xae40('0x14')]);return _0x2fda86(_0x4d0de0[_0xae40('0x12')][_0xae40('0x14')]);}else{logger[_0xae40('0xd')](_0xae40('0xe'),_0x5c9641,_0xae40('0xf'));_0x2fda86(_0x4d0de0[_0xae40('0x15')][_0xae40('0x14')]);}})[_0xae40('0x16')](function(_0x3adee2){logger['error'](_0xae40('0xe'),_0x5c9641,_0x3adee2);_0x35d177(_0x3adee2);});});} \ No newline at end of file +var _0xcbde=['http','request','then','VoiceContext,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x565f80,_0x4b0eb4){var _0x331c76=function(_0x31df82){while(--_0x31df82){_0x565f80['push'](_0x565f80['shift']());}};_0x331c76(++_0x4b0eb4);}(_0xcbde,0x141));var _0xecbd=function(_0x173afe,_0x12eb14){_0x173afe=_0x173afe-0x0;var _0xb3e606=_0xcbde[_0x173afe];return _0xb3e606;};'use strict';var _=require(_0xecbd('0x0'));var util=require('util');var moment=require(_0xecbd('0x1'));var BPromise=require(_0xecbd('0x2'));var rs=require(_0xecbd('0x3'));var fs=require('fs');var Redis=require(_0xecbd('0x4'));var db=require(_0xecbd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecbd('0x8')][_0xecbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x545ca6,_0x5d1ba5,_0x2947a0){return new BPromise(function(_0x3e9e7a,_0x2f3b03){return client[_0xecbd('0xa')](_0x545ca6,_0x2947a0)[_0xecbd('0xb')](function(_0x43a04e){logger['info'](_0xecbd('0xc'),_0x5d1ba5,'request\x20sent');logger[_0xecbd('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5d1ba5,'request\x20sent',JSON[_0xecbd('0xe')](_0x43a04e));if(_0x43a04e['error']){if(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x10')]===0x1f4){logger['error'](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x2f3b03(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);}logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x3e9e7a(_0x43a04e['error'][_0xecbd('0x11')]);}else{logger[_0xecbd('0x12')](_0xecbd('0xc'),_0x5d1ba5,_0xecbd('0x13'));_0x3e9e7a(_0x43a04e[_0xecbd('0x14')][_0xecbd('0x11')]);}})[_0xecbd('0x15')](function(_0x1af064){logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x1af064);_0x2f3b03(_0x1af064);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1596dab..17cc8c2 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 _0x4ba0=['describe','show','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4ba0,0xe0));var _0x04ba=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4ba0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x04ba('0x0'));var util=require('util');var path=require(_0x04ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x04ba('0x2'));var router=express[_0x04ba('0x3')]();var fs_extra=require(_0x04ba('0x4'));var auth=require(_0x04ba('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x04ba('0x6'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x04ba('0x7')](),controller['index']);router[_0x04ba('0x8')](_0x04ba('0x9'),auth[_0x04ba('0x7')](),controller[_0x04ba('0xa')]);router[_0x04ba('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x04ba('0xb')]);router['post']('/',auth[_0x04ba('0x7')](),controller['create']);router[_0x04ba('0xc')](_0x04ba('0xd'),auth['isAuthenticated'](),controller[_0x04ba('0xe')]);router[_0x04ba('0xf')](_0x04ba('0xd'),auth[_0x04ba('0x7')](),controller[_0x04ba('0x10')]);module[_0x04ba('0x11')]=router; \ No newline at end of file +var _0x5fb3=['isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get'];(function(_0x418627,_0x303f88){var _0x2d5130=function(_0x1c7b4d){while(--_0x1c7b4d){_0x418627['push'](_0x418627['shift']());}};_0x2d5130(++_0x303f88);}(_0x5fb3,0xc9));var _0x35fb=function(_0x57a9a8,_0x39ac1e){_0x57a9a8=_0x57a9a8-0x0;var _0xadabf3=_0x5fb3[_0x57a9a8];return _0xadabf3;};'use strict';var multer=require('multer');var util=require(_0x35fb('0x0'));var path=require('path');var timeout=require(_0x35fb('0x1'));var express=require(_0x35fb('0x2'));var router=express[_0x35fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35fb('0x4'));var interaction=require(_0x35fb('0x5'));var config=require('../../config/environment');var controller=require(_0x35fb('0x6'));router[_0x35fb('0x7')]('/',auth[_0x35fb('0x8')](),controller[_0x35fb('0x9')]);router[_0x35fb('0x7')]('/describe',auth[_0x35fb('0x8')](),controller[_0x35fb('0xa')]);router[_0x35fb('0x7')](_0x35fb('0xb'),auth[_0x35fb('0x8')](),controller[_0x35fb('0xc')]);router['post']('/',auth[_0x35fb('0x8')](),controller[_0x35fb('0xd')]);router[_0x35fb('0xe')](_0x35fb('0xb'),auth[_0x35fb('0x8')](),controller[_0x35fb('0xf')]);router[_0x35fb('0x10')](_0x35fb('0xb'),auth[_0x35fb('0x8')](),controller[_0x35fb('0x11')]);module[_0x35fb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a713491..1bb6d21 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 _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x184501,_0x4c1279){var _0x5888a8=function(_0x137f1f){while(--_0x137f1f){_0x184501['push'](_0x184501['shift']());}};_0x5888a8(++_0x4c1279);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d01a125..249e5c2 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 _0xc10e=['util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','sendStatus','name','index','VoiceDialReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0xc10e,0xd6));var _0xec10=function(_0x18b36c,_0x3fd9e5){_0x18b36c=_0x18b36c-0x0;var _0x3efbfa=_0xc10e[_0x18b36c];return _0x3efbfa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xec10('0x0'));var jsonpatch=require(_0xec10('0x1'));var rp=require(_0xec10('0x2'));var moment=require('moment');var BPromise=require(_0xec10('0x3'));var Mustache=require(_0xec10('0x4'));var util=require(_0xec10('0x5'));var path=require('path');var sox=require(_0xec10('0x6'));var csv=require(_0xec10('0x7'));var ejs=require(_0xec10('0x8'));var fs=require('fs');var fs_extra=require(_0xec10('0x9'));var _=require('lodash');var squel=require(_0xec10('0xa'));var crypto=require(_0xec10('0xb'));var jsforce=require(_0xec10('0xc'));var deskjs=require(_0xec10('0xd'));var toCsv=require('to-csv');var querystring=require(_0xec10('0xe'));var Papa=require(_0xec10('0xf'));var Redis=require(_0xec10('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xec10('0x11'));var as=require(_0xec10('0x12'));var hardwareService=require(_0xec10('0x13'));var logger=require(_0xec10('0x14'))(_0xec10('0x15'));var utils=require(_0xec10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec10('0x17'));var db=require(_0xec10('0x18'))['db'];function respondWithStatusCode(_0x4c859b,_0x248753){_0x248753=_0x248753||0xcc;return function(_0x545e91){if(_0x545e91){return _0x4c859b['sendStatus'](_0x248753);}return _0x4c859b['status'](_0x248753)[_0xec10('0x19')]();};}function respondWithResult(_0x58d509,_0x5c5251){_0x5c5251=_0x5c5251||0xc8;return function(_0x2116e0){if(_0x2116e0){return _0x58d509[_0xec10('0x1a')](_0x5c5251)['json'](_0x2116e0);}};}function respondWithFilteredResult(_0x5c084e,_0x539f1f){return function(_0x504589){if(_0x504589){var _0x26bd62=typeof _0x539f1f[_0xec10('0x1b')]===_0xec10('0x1c')&&typeof _0x539f1f[_0xec10('0x1d')]==='undefined';var _0x470164=_0x504589[_0xec10('0x1e')];var _0xf4e701=_0x26bd62?0x0:_0x539f1f[_0xec10('0x1b')];var _0x52df80=_0x26bd62?_0x504589['count']:_0x539f1f[_0xec10('0x1b')]+_0x539f1f[_0xec10('0x1d')];var _0x309085;if(_0x52df80>=_0x470164){_0x52df80=_0x470164;_0x309085=0xc8;}else{_0x309085=0xce;}_0x5c084e[_0xec10('0x1a')](_0x309085);return _0x5c084e[_0xec10('0x1f')](_0xec10('0x20'),_0xf4e701+'-'+_0x52df80+'/'+_0x470164)[_0xec10('0x21')](_0x504589);}return null;};}function patchUpdates(_0x847ce8){return function(_0x373c61){try{jsonpatch[_0xec10('0x22')](_0x373c61,_0x847ce8,!![]);}catch(_0x149fcf){return BPromise['reject'](_0x149fcf);}return _0x373c61[_0xec10('0x23')]();};}function saveUpdates(_0x2eb223,_0xb13529){return function(_0x18a017){if(_0x18a017){return _0x18a017['update'](_0x2eb223)['then'](function(_0x1c4306){return _0x1c4306;});}return null;};}function removeEntity(_0x1cd0ad,_0xcc4aef){return function(_0x4983f2){if(_0x4983f2){return _0x4983f2[_0xec10('0x24')]()['then'](function(){_0x1cd0ad['status'](0xcc)[_0xec10('0x19')]();});}};}function handleEntityNotFound(_0x21fe0c,_0x39322f){return function(_0x3aaf11){if(!_0x3aaf11){_0x21fe0c[_0xec10('0x25')](0x194);}return _0x3aaf11;};}function handleError(_0x3394ec,_0x14dd93){_0x14dd93=_0x14dd93||0x1f4;return function(_0x1c869d){logger['error'](_0x1c869d['stack']);if(_0x1c869d['name']){delete _0x1c869d[_0xec10('0x26')];}_0x3394ec[_0xec10('0x1a')](_0x14dd93)['send'](_0x1c869d);};}exports[_0xec10('0x27')]=function(_0x3dd5c2,_0x2a8713){var _0x78f1b0={},_0x1fd6bb={},_0x359266={'count':0x0,'rows':[]};var _0x5295e4=_['map'](db[_0xec10('0x28')][_0xec10('0x29')],function(_0x3d117f){return{'name':_0x3d117f[_0xec10('0x2a')],'type':_0x3d117f['type'][_0xec10('0x2b')]};});_0x1fd6bb[_0xec10('0x2c')]=_[_0xec10('0x2d')](_0x5295e4,_0xec10('0x26'));_0x1fd6bb[_0xec10('0x2e')]=_[_0xec10('0x2f')](_0x3dd5c2[_0xec10('0x2e')]);_0x1fd6bb[_0xec10('0x30')]=_[_0xec10('0x31')](_0x1fd6bb[_0xec10('0x2c')],_0x1fd6bb['query']);_0x78f1b0['attributes']=_[_0xec10('0x31')](_0x1fd6bb['model'],qs[_0xec10('0x32')](_0x3dd5c2['query'][_0xec10('0x32')]));_0x78f1b0[_0xec10('0x33')]=_0x78f1b0['attributes'][_0xec10('0x34')]?_0x78f1b0['attributes']:_0x1fd6bb[_0xec10('0x2c')];if(!_0x3dd5c2[_0xec10('0x2e')]['hasOwnProperty']('nolimit')){_0x78f1b0[_0xec10('0x1d')]=qs[_0xec10('0x1d')](_0x3dd5c2['query']['limit']);_0x78f1b0[_0xec10('0x1b')]=qs[_0xec10('0x1b')](_0x3dd5c2[_0xec10('0x2e')][_0xec10('0x1b')]);}_0x78f1b0[_0xec10('0x35')]=qs[_0xec10('0x36')](_0x3dd5c2[_0xec10('0x2e')]['sort']);_0x78f1b0[_0xec10('0x37')]=qs[_0xec10('0x30')](_['pick'](_0x3dd5c2[_0xec10('0x2e')],_0x1fd6bb[_0xec10('0x30')]),_0x5295e4);if(_0x3dd5c2[_0xec10('0x2e')][_0xec10('0x38')]){_0x78f1b0[_0xec10('0x37')]=_[_0xec10('0x39')](_0x78f1b0[_0xec10('0x37')],{'$or':_[_0xec10('0x2d')](_0x5295e4,function(_0x1d9964){if(_0x1d9964[_0xec10('0x3a')]!==_0xec10('0x3b')){var _0x441d7e={};_0x441d7e[_0x1d9964['name']]={'$like':'%'+_0x3dd5c2['query'][_0xec10('0x38')]+'%'};return _0x441d7e;}})});}_0x78f1b0=_[_0xec10('0x39')]({},_0x78f1b0,_0x3dd5c2[_0xec10('0x3c')]);var _0x53b07f={'where':_0x78f1b0[_0xec10('0x37')]};return db[_0xec10('0x28')][_0xec10('0x1e')](_0x53b07f)['then'](function(_0x311cc6){_0x359266[_0xec10('0x1e')]=_0x311cc6;if(_0x3dd5c2[_0xec10('0x2e')][_0xec10('0x3d')]){_0x78f1b0[_0xec10('0x3e')]=[{'all':!![]}];}return db[_0xec10('0x28')][_0xec10('0x3f')](_0x78f1b0);})['then'](function(_0x9c2de9){_0x359266['rows']=_0x9c2de9;return _0x359266;})[_0xec10('0x40')](respondWithFilteredResult(_0x2a8713,_0x78f1b0))[_0xec10('0x41')](handleError(_0x2a8713,null));};exports[_0xec10('0x42')]=function(_0x3d1c24,_0x136d4a){var _0x52dfdd={'raw':!![],'where':{'id':_0x3d1c24[_0xec10('0x43')]['id']}},_0xd92841={};_0xd92841[_0xec10('0x2c')]=_['keys'](db[_0xec10('0x28')]['rawAttributes']);_0xd92841['query']=_[_0xec10('0x2f')](_0x3d1c24[_0xec10('0x2e')]);_0xd92841[_0xec10('0x30')]=_['intersection'](_0xd92841[_0xec10('0x2c')],_0xd92841[_0xec10('0x2e')]);_0x52dfdd[_0xec10('0x33')]=_['intersection'](_0xd92841[_0xec10('0x2c')],qs['fields'](_0x3d1c24['query'][_0xec10('0x32')]));_0x52dfdd[_0xec10('0x33')]=_0x52dfdd[_0xec10('0x33')][_0xec10('0x34')]?_0x52dfdd[_0xec10('0x33')]:_0xd92841[_0xec10('0x2c')];if(_0x3d1c24[_0xec10('0x2e')][_0xec10('0x3d')]){_0x52dfdd['include']=[{'all':!![]}];}_0x52dfdd=_[_0xec10('0x39')]({},_0x52dfdd,_0x3d1c24['options']);return db[_0xec10('0x28')][_0xec10('0x44')](_0x52dfdd)[_0xec10('0x40')](handleEntityNotFound(_0x136d4a,null))[_0xec10('0x40')](respondWithResult(_0x136d4a,null))[_0xec10('0x41')](handleError(_0x136d4a,null));};exports[_0xec10('0x45')]=function(_0x4bd623,_0x20f6c4){return db[_0xec10('0x28')][_0xec10('0x45')](_0x4bd623[_0xec10('0x46')],{})[_0xec10('0x40')](respondWithResult(_0x20f6c4,0xc9))['catch'](handleError(_0x20f6c4,null));};exports[_0xec10('0x47')]=function(_0x303cfb,_0x5efbe3){if(_0x303cfb[_0xec10('0x46')]['id']){delete _0x303cfb['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x303cfb[_0xec10('0x43')]['id']}})[_0xec10('0x40')](handleEntityNotFound(_0x5efbe3,null))['then'](saveUpdates(_0x303cfb[_0xec10('0x46')],null))[_0xec10('0x40')](respondWithResult(_0x5efbe3,null))[_0xec10('0x41')](handleError(_0x5efbe3,null));};exports[_0xec10('0x24')]=function(_0x301470,_0x49704e){return db[_0xec10('0x28')]['find']({'where':{'id':_0x301470[_0xec10('0x43')]['id']}})[_0xec10('0x40')](handleEntityNotFound(_0x49704e,null))[_0xec10('0x40')](removeEntity(_0x49704e,null))[_0xec10('0x41')](handleError(_0x49704e,null));};exports['describe']=function(_0x3d6790,_0x5615b9){return db[_0xec10('0x28')][_0xec10('0x48')]()[_0xec10('0x40')](respondWithResult(_0x5615b9,null))[_0xec10('0x41')](handleError(_0x5615b9,null));}; \ No newline at end of file +var _0xfc65=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','then','destroy','sendStatus','error','name','send','index','VoiceDialReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4433e7,_0x327388){var _0x2dbbaf=function(_0x4792ac){while(--_0x4792ac){_0x4433e7['push'](_0x4433e7['shift']());}};_0x2dbbaf(++_0x327388);}(_0xfc65,0x155));var _0x5fc6=function(_0x11532c,_0x417ada){_0x11532c=_0x11532c-0x0;var _0x392fe8=_0xfc65[_0x11532c];return _0x392fe8;};'use strict';var emlformat=require(_0x5fc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5fc6('0x1'));var jsonpatch=require(_0x5fc6('0x2'));var rp=require(_0x5fc6('0x3'));var moment=require('moment');var BPromise=require(_0x5fc6('0x4'));var Mustache=require(_0x5fc6('0x5'));var util=require('util');var path=require(_0x5fc6('0x6'));var sox=require(_0x5fc6('0x7'));var csv=require(_0x5fc6('0x8'));var ejs=require(_0x5fc6('0x9'));var fs=require('fs');var fs_extra=require(_0x5fc6('0xa'));var _=require(_0x5fc6('0xb'));var squel=require(_0x5fc6('0xc'));var crypto=require(_0x5fc6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5fc6('0xe'));var toCsv=require(_0x5fc6('0x8'));var querystring=require(_0x5fc6('0xf'));var Papa=require('papaparse');var Redis=require(_0x5fc6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5fc6('0x11'));var as=require(_0x5fc6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fc6('0x13'))(_0x5fc6('0x14'));var utils=require('../../config/utils');var config=require(_0x5fc6('0x15'));var licenseUtil=require(_0x5fc6('0x16'));var db=require(_0x5fc6('0x17'))['db'];function respondWithStatusCode(_0x319cb6,_0x56b320){_0x56b320=_0x56b320||0xcc;return function(_0x44d80d){if(_0x44d80d){return _0x319cb6['sendStatus'](_0x56b320);}return _0x319cb6[_0x5fc6('0x18')](_0x56b320)['end']();};}function respondWithResult(_0x405346,_0x2ae913){_0x2ae913=_0x2ae913||0xc8;return function(_0x5c896b){if(_0x5c896b){return _0x405346[_0x5fc6('0x18')](_0x2ae913)[_0x5fc6('0x19')](_0x5c896b);}};}function respondWithFilteredResult(_0x3a13bb,_0x2ec646){return function(_0x2bd827){if(_0x2bd827){var _0x482bed=typeof _0x2ec646[_0x5fc6('0x1a')]===_0x5fc6('0x1b')&&typeof _0x2ec646[_0x5fc6('0x1c')]===_0x5fc6('0x1b');var _0xe0ab4c=_0x2bd827[_0x5fc6('0x1d')];var _0x346034=_0x482bed?0x0:_0x2ec646[_0x5fc6('0x1a')];var _0xca2fc4=_0x482bed?_0x2bd827['count']:_0x2ec646[_0x5fc6('0x1a')]+_0x2ec646['limit'];var _0x239655;if(_0xca2fc4>=_0xe0ab4c){_0xca2fc4=_0xe0ab4c;_0x239655=0xc8;}else{_0x239655=0xce;}_0x3a13bb['status'](_0x239655);return _0x3a13bb['set']('Content-Range',_0x346034+'-'+_0xca2fc4+'/'+_0xe0ab4c)[_0x5fc6('0x19')](_0x2bd827);}return null;};}function patchUpdates(_0x336cfc){return function(_0x645b6f){try{jsonpatch[_0x5fc6('0x1e')](_0x645b6f,_0x336cfc,!![]);}catch(_0x3f778f){return BPromise[_0x5fc6('0x1f')](_0x3f778f);}return _0x645b6f['save']();};}function saveUpdates(_0x48e9f5,_0x58d0ce){return function(_0xcb72b7){if(_0xcb72b7){return _0xcb72b7['update'](_0x48e9f5)[_0x5fc6('0x20')](function(_0x16ee25){return _0x16ee25;});}return null;};}function removeEntity(_0x3f2e71,_0x58390d){return function(_0x1705f6){if(_0x1705f6){return _0x1705f6[_0x5fc6('0x21')]()[_0x5fc6('0x20')](function(){_0x3f2e71[_0x5fc6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178f7f,_0x5c5f25){return function(_0x445dc8){if(!_0x445dc8){_0x178f7f[_0x5fc6('0x22')](0x194);}return _0x445dc8;};}function handleError(_0x10747f,_0x4c3d80){_0x4c3d80=_0x4c3d80||0x1f4;return function(_0xe35945){logger[_0x5fc6('0x23')](_0xe35945['stack']);if(_0xe35945[_0x5fc6('0x24')]){delete _0xe35945[_0x5fc6('0x24')];}_0x10747f[_0x5fc6('0x18')](_0x4c3d80)[_0x5fc6('0x25')](_0xe35945);};}exports[_0x5fc6('0x26')]=function(_0x25b324,_0x3abd64){var _0x39097d={},_0x54e5f9={},_0x1ee5e7={'count':0x0,'rows':[]};var _0x4d2849=_['map'](db[_0x5fc6('0x27')][_0x5fc6('0x28')],function(_0x1c7da6){return{'name':_0x1c7da6[_0x5fc6('0x29')],'type':_0x1c7da6['type'][_0x5fc6('0x2a')]};});_0x54e5f9[_0x5fc6('0x2b')]=_[_0x5fc6('0x2c')](_0x4d2849,'name');_0x54e5f9[_0x5fc6('0x2d')]=_[_0x5fc6('0x2e')](_0x25b324[_0x5fc6('0x2d')]);_0x54e5f9[_0x5fc6('0x2f')]=_[_0x5fc6('0x30')](_0x54e5f9[_0x5fc6('0x2b')],_0x54e5f9[_0x5fc6('0x2d')]);_0x39097d['attributes']=_[_0x5fc6('0x30')](_0x54e5f9[_0x5fc6('0x2b')],qs[_0x5fc6('0x31')](_0x25b324[_0x5fc6('0x2d')][_0x5fc6('0x31')]));_0x39097d[_0x5fc6('0x32')]=_0x39097d['attributes'][_0x5fc6('0x33')]?_0x39097d[_0x5fc6('0x32')]:_0x54e5f9[_0x5fc6('0x2b')];if(!_0x25b324[_0x5fc6('0x2d')][_0x5fc6('0x34')]('nolimit')){_0x39097d[_0x5fc6('0x1c')]=qs['limit'](_0x25b324['query']['limit']);_0x39097d[_0x5fc6('0x1a')]=qs[_0x5fc6('0x1a')](_0x25b324['query'][_0x5fc6('0x1a')]);}_0x39097d[_0x5fc6('0x35')]=qs[_0x5fc6('0x36')](_0x25b324[_0x5fc6('0x2d')][_0x5fc6('0x36')]);_0x39097d[_0x5fc6('0x37')]=qs[_0x5fc6('0x2f')](_['pick'](_0x25b324[_0x5fc6('0x2d')],_0x54e5f9['filters']),_0x4d2849);if(_0x25b324[_0x5fc6('0x2d')][_0x5fc6('0x38')]){_0x39097d[_0x5fc6('0x37')]=_[_0x5fc6('0x39')](_0x39097d['where'],{'$or':_['map'](_0x4d2849,function(_0x528994){if(_0x528994['type']!==_0x5fc6('0x3a')){var _0x439adb={};_0x439adb[_0x528994['name']]={'$like':'%'+_0x25b324[_0x5fc6('0x2d')]['filter']+'%'};return _0x439adb;}})});}_0x39097d=_[_0x5fc6('0x39')]({},_0x39097d,_0x25b324[_0x5fc6('0x3b')]);var _0x5b63b1={'where':_0x39097d[_0x5fc6('0x37')]};return db['VoiceDialReport'][_0x5fc6('0x1d')](_0x5b63b1)[_0x5fc6('0x20')](function(_0x653d8e){_0x1ee5e7[_0x5fc6('0x1d')]=_0x653d8e;if(_0x25b324[_0x5fc6('0x2d')][_0x5fc6('0x3c')]){_0x39097d[_0x5fc6('0x3d')]=[{'all':!![]}];}return db[_0x5fc6('0x27')][_0x5fc6('0x3e')](_0x39097d);})[_0x5fc6('0x20')](function(_0x4c9cb4){_0x1ee5e7[_0x5fc6('0x3f')]=_0x4c9cb4;return _0x1ee5e7;})[_0x5fc6('0x20')](respondWithFilteredResult(_0x3abd64,_0x39097d))[_0x5fc6('0x40')](handleError(_0x3abd64,null));};exports[_0x5fc6('0x41')]=function(_0x240cb1,_0x2d38fe){var _0x406202={'raw':!![],'where':{'id':_0x240cb1[_0x5fc6('0x42')]['id']}},_0x2f1fd5={};_0x2f1fd5[_0x5fc6('0x2b')]=_[_0x5fc6('0x2e')](db[_0x5fc6('0x27')]['rawAttributes']);_0x2f1fd5[_0x5fc6('0x2d')]=_['keys'](_0x240cb1[_0x5fc6('0x2d')]);_0x2f1fd5[_0x5fc6('0x2f')]=_[_0x5fc6('0x30')](_0x2f1fd5[_0x5fc6('0x2b')],_0x2f1fd5['query']);_0x406202[_0x5fc6('0x32')]=_['intersection'](_0x2f1fd5[_0x5fc6('0x2b')],qs[_0x5fc6('0x31')](_0x240cb1[_0x5fc6('0x2d')][_0x5fc6('0x31')]));_0x406202[_0x5fc6('0x32')]=_0x406202[_0x5fc6('0x32')][_0x5fc6('0x33')]?_0x406202[_0x5fc6('0x32')]:_0x2f1fd5[_0x5fc6('0x2b')];if(_0x240cb1[_0x5fc6('0x2d')]['includeAll']){_0x406202[_0x5fc6('0x3d')]=[{'all':!![]}];}_0x406202=_['merge']({},_0x406202,_0x240cb1[_0x5fc6('0x3b')]);return db[_0x5fc6('0x27')][_0x5fc6('0x43')](_0x406202)[_0x5fc6('0x20')](handleEntityNotFound(_0x2d38fe,null))['then'](respondWithResult(_0x2d38fe,null))['catch'](handleError(_0x2d38fe,null));};exports[_0x5fc6('0x44')]=function(_0x4fd5ff,_0xaed2fb){return db['VoiceDialReport']['create'](_0x4fd5ff[_0x5fc6('0x45')],{})[_0x5fc6('0x20')](respondWithResult(_0xaed2fb,0xc9))[_0x5fc6('0x40')](handleError(_0xaed2fb,null));};exports[_0x5fc6('0x46')]=function(_0x2ac44c,_0x406b18){if(_0x2ac44c[_0x5fc6('0x45')]['id']){delete _0x2ac44c[_0x5fc6('0x45')]['id'];}return db[_0x5fc6('0x27')][_0x5fc6('0x43')]({'where':{'id':_0x2ac44c[_0x5fc6('0x42')]['id']}})[_0x5fc6('0x20')](handleEntityNotFound(_0x406b18,null))[_0x5fc6('0x20')](saveUpdates(_0x2ac44c['body'],null))['then'](respondWithResult(_0x406b18,null))[_0x5fc6('0x40')](handleError(_0x406b18,null));};exports[_0x5fc6('0x21')]=function(_0x4eddfb,_0x1b122a){return db[_0x5fc6('0x27')][_0x5fc6('0x43')]({'where':{'id':_0x4eddfb[_0x5fc6('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b122a,null))[_0x5fc6('0x20')](removeEntity(_0x1b122a,null))[_0x5fc6('0x40')](handleError(_0x1b122a,null));};exports[_0x5fc6('0x47')]=function(_0x304cbc,_0x147956){return db['VoiceDialReport']['describe']()[_0x5fc6('0x20')](respondWithResult(_0x147956,null))['catch'](handleError(_0x147956,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index cd05f17..8a209be 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 _0xc6d7=['api','moment','request-promise','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger'];(function(_0x2ed1a0,_0x36acd9){var _0x3d272e=function(_0x41460c){while(--_0x41460c){_0x2ed1a0['push'](_0x2ed1a0['shift']());}};_0x3d272e(++_0x36acd9);}(_0xc6d7,0x174));var _0x7c6d=function(_0x39c522,_0x10db8d){_0x39c522=_0x39c522-0x0;var _0x54a2d3=_0xc6d7[_0x39c522];return _0x54a2d3;};'use strict';var _=require(_0x7c6d('0x0'));var util=require('util');var logger=require(_0x7c6d('0x1'))(_0x7c6d('0x2'));var moment=require(_0x7c6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c6d('0x5'));var attributes=require(_0x7c6d('0x6'));module['exports']=function(_0x5a2c66,_0x311891){return _0x5a2c66[_0x7c6d('0x7')](_0x7c6d('0x8'),attributes,{'tableName':_0x7c6d('0x9'),'paranoid':![],'indexes':[{'fields':[_0x7c6d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64d0=['request-promise','rimraf','../../config/environment','exports','define','VoiceDialReport','lodash','util','../../config/logger','api','moment'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x64d0,0x171));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x064d('0x0'));var util=require(_0x064d('0x1'));var logger=require(_0x064d('0x2'))(_0x064d('0x3'));var moment=require(_0x064d('0x4'));var BPromise=require('bluebird');var rp=require(_0x064d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x064d('0x6'));var config=require(_0x064d('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x064d('0x8')]=function(_0x30fc34,_0x36c287){return _0x30fc34[_0x064d('0x9')](_0x064d('0xa'),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 b39c47c..3a257be 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 _0x884b=['moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','update','body','attributes','limit','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x884b,0x1b1));var _0xb884=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x884b[_0x424a9a];return _0xa7831c;};'use strict';var _=require('lodash');var util=require(_0xb884('0x0'));var moment=require(_0xb884('0x1'));var BPromise=require('bluebird');var rs=require(_0xb884('0x2'));var fs=require('fs');var Redis=require(_0xb884('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb884('0x4'));var logger=require('../../config/logger')(_0xb884('0x5'));var config=require('../../config/environment');var jayson=require(_0xb884('0x6'));var client=jayson['client'][_0xb884('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x568760,_0x2be3f5,_0x15c37a){return new BPromise(function(_0x4ae25a,_0x17bc56){return client[_0xb884('0x8')](_0x568760,_0x15c37a)[_0xb884('0x9')](function(_0x24cd3a){logger['info'](_0xb884('0xa'),_0x2be3f5,_0xb884('0xb'));logger[_0xb884('0xc')](_0xb884('0xd'),_0x2be3f5,_0xb884('0xb'),JSON['stringify'](_0x24cd3a));if(_0x24cd3a[_0xb884('0xe')]){if(_0x24cd3a['error'][_0xb884('0xf')]===0x1f4){logger[_0xb884('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x2be3f5,_0x24cd3a[_0xb884('0xe')][_0xb884('0x10')]);return _0x17bc56(_0x24cd3a[_0xb884('0xe')]['message']);}logger[_0xb884('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x2be3f5,_0x24cd3a[_0xb884('0xe')][_0xb884('0x10')]);return _0x4ae25a(_0x24cd3a[_0xb884('0xe')][_0xb884('0x10')]);}else{logger[_0xb884('0x11')](_0xb884('0xa'),_0x2be3f5,_0xb884('0xb'));_0x4ae25a(_0x24cd3a[_0xb884('0x12')][_0xb884('0x10')]);}})[_0xb884('0x13')](function(_0x175243){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2be3f5,_0x175243);_0x17bc56(_0x175243);});});}exports['CreateVoiceDialReport']=function(_0xb31698){var _0x4aab39=this;return new Promise(function(_0x44053c,_0xfdd50c){return db[_0xb884('0x14')][_0xb884('0x15')](_0xb31698['body'],{'raw':_0xb31698[_0xb884('0x16')]?_0xb31698[_0xb884('0x16')][_0xb884('0x17')]===undefined?!![]:![]:!![]})[_0xb884('0x9')](function(_0x3276c6){logger[_0xb884('0x11')](_0xb884('0x18'),_0xb31698);logger[_0xb884('0xc')]('CreateVoiceDialReport',_0xb31698,JSON[_0xb884('0x19')](_0x3276c6));_0x44053c(_0x3276c6);})[_0xb884('0x13')](function(_0x501cd8){logger[_0xb884('0xe')](_0xb884('0x18'),_0x501cd8['message'],_0xb31698);_0xfdd50c(_0x4aab39[_0xb884('0xe')](0x1f4,_0x501cd8[_0xb884('0x10')]));});});};exports[_0xb884('0x1a')]=function(_0x3a8e91){var _0x41a48d=this;return new Promise(function(_0x14d664,_0x19d404){return db[_0xb884('0x14')][_0xb884('0x1b')](_0x3a8e91[_0xb884('0x1c')],{'raw':_0x3a8e91[_0xb884('0x16')]?_0x3a8e91[_0xb884('0x16')][_0xb884('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a8e91['options']?_0x3a8e91['options']['where']||null:null,'attributes':_0x3a8e91[_0xb884('0x16')]?_0x3a8e91[_0xb884('0x16')][_0xb884('0x1d')]||null:null,'limit':_0x3a8e91['options']?_0x3a8e91[_0xb884('0x16')][_0xb884('0x1e')]||null:null})[_0xb884('0x9')](function(_0x270880){logger['info'](_0xb884('0x1a'),_0x3a8e91);logger[_0xb884('0xc')](_0xb884('0x1a'),_0x3a8e91,JSON['stringify'](_0x270880));_0x14d664(_0x270880);})['catch'](function(_0x9f4361){logger[_0xb884('0xe')](_0xb884('0x1a'),_0x9f4361['message'],_0x3a8e91);_0x19d404(_0x41a48d['error'](0x1f4,_0x9f4361[_0xb884('0x10')]));});});}; \ No newline at end of file +var _0xcd0f=['update','where','limit','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateVoiceDialReport','VoiceDialReport','body','options','debug','UpdateVoiceDialReport'];(function(_0x223563,_0x48bdf){var _0x3174a0=function(_0x2917d2){while(--_0x2917d2){_0x223563['push'](_0x223563['shift']());}};_0x3174a0(++_0x48bdf);}(_0xcd0f,0x8f));var _0xfcd0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcd0f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xfcd0('0x0'));var moment=require(_0xfcd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcd0('0x2'))['db'];var utils=require(_0xfcd0('0x3'));var logger=require(_0xfcd0('0x4'))(_0xfcd0('0x5'));var config=require(_0xfcd0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfcd0('0x7')][_0xfcd0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15415a,_0xcb4147,_0x1a864e){return new BPromise(function(_0x233481,_0x15259b){return client['request'](_0x15415a,_0x1a864e)[_0xfcd0('0x9')](function(_0x2cd5d1){logger['info'](_0xfcd0('0xa'),_0xcb4147,_0xfcd0('0xb'));logger['debug'](_0xfcd0('0xc'),_0xcb4147,'request\x20sent',JSON[_0xfcd0('0xd')](_0x2cd5d1));if(_0x2cd5d1[_0xfcd0('0xe')]){if(_0x2cd5d1[_0xfcd0('0xe')][_0xfcd0('0xf')]===0x1f4){logger[_0xfcd0('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0xcb4147,_0x2cd5d1['error']['message']);return _0x15259b(_0x2cd5d1[_0xfcd0('0xe')][_0xfcd0('0x10')]);}logger[_0xfcd0('0xe')](_0xfcd0('0xa'),_0xcb4147,_0x2cd5d1[_0xfcd0('0xe')][_0xfcd0('0x10')]);return _0x233481(_0x2cd5d1[_0xfcd0('0xe')]['message']);}else{logger[_0xfcd0('0x11')](_0xfcd0('0xa'),_0xcb4147,_0xfcd0('0xb'));_0x233481(_0x2cd5d1['result'][_0xfcd0('0x10')]);}})[_0xfcd0('0x12')](function(_0x38a24f){logger[_0xfcd0('0xe')](_0xfcd0('0xa'),_0xcb4147,_0x38a24f);_0x15259b(_0x38a24f);});});}exports[_0xfcd0('0x13')]=function(_0x8ab1dc){var _0x21fad7=this;return new Promise(function(_0xb470e1,_0x2de0b0){return db[_0xfcd0('0x14')]['create'](_0x8ab1dc[_0xfcd0('0x15')],{'raw':_0x8ab1dc[_0xfcd0('0x16')]?_0x8ab1dc[_0xfcd0('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1cd958){logger['info'](_0xfcd0('0x13'),_0x8ab1dc);logger[_0xfcd0('0x17')](_0xfcd0('0x13'),_0x8ab1dc,JSON[_0xfcd0('0xd')](_0x1cd958));_0xb470e1(_0x1cd958);})[_0xfcd0('0x12')](function(_0x35fc15){logger[_0xfcd0('0xe')](_0xfcd0('0x13'),_0x35fc15[_0xfcd0('0x10')],_0x8ab1dc);_0x2de0b0(_0x21fad7[_0xfcd0('0xe')](0x1f4,_0x35fc15[_0xfcd0('0x10')]));});});};exports[_0xfcd0('0x18')]=function(_0x1d4087){var _0x2f2a1b=this;return new Promise(function(_0x4ded9d,_0x4d02d9){return db[_0xfcd0('0x14')][_0xfcd0('0x19')](_0x1d4087[_0xfcd0('0x15')],{'raw':_0x1d4087[_0xfcd0('0x16')]?_0x1d4087[_0xfcd0('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d4087[_0xfcd0('0x16')]?_0x1d4087['options'][_0xfcd0('0x1a')]||null:null,'attributes':_0x1d4087[_0xfcd0('0x16')]?_0x1d4087[_0xfcd0('0x16')]['attributes']||null:null,'limit':_0x1d4087[_0xfcd0('0x16')]?_0x1d4087[_0xfcd0('0x16')][_0xfcd0('0x1b')]||null:null})[_0xfcd0('0x9')](function(_0x30b7ff){logger[_0xfcd0('0x11')](_0xfcd0('0x18'),_0x1d4087);logger[_0xfcd0('0x17')](_0xfcd0('0x18'),_0x1d4087,JSON[_0xfcd0('0xd')](_0x30b7ff));_0x4ded9d(_0x30b7ff);})[_0xfcd0('0x12')](function(_0x52f0d3){logger[_0xfcd0('0xe')]('UpdateVoiceDialReport',_0x52f0d3[_0xfcd0('0x10')],_0x1d4087);_0x4d02d9(_0x2f2a1b[_0xfcd0('0xe')](0x1f4,_0x52f0d3[_0xfcd0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index da12c31..2cb06ed 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 _0xbb37=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','post','/:id/applications','put','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4516c8,_0x6bada6){var _0x24954e=function(_0x569061){while(--_0x569061){_0x4516c8['push'](_0x4516c8['shift']());}};_0x24954e(++_0x6bada6);}(_0xbb37,0x1a0));var _0x7bb3=function(_0x482815,_0x3601b1){_0x482815=_0x482815-0x0;var _0x272d11=_0xbb37[_0x482815];return _0x272d11;};'use strict';var multer=require(_0x7bb3('0x0'));var util=require(_0x7bb3('0x1'));var path=require(_0x7bb3('0x2'));var timeout=require(_0x7bb3('0x3'));var express=require(_0x7bb3('0x4'));var router=express['Router']();var fs_extra=require(_0x7bb3('0x5'));var auth=require(_0x7bb3('0x6'));var interaction=require(_0x7bb3('0x7'));var config=require(_0x7bb3('0x8'));var controller=require('./voiceExtension.controller');router[_0x7bb3('0x9')]('/',auth[_0x7bb3('0xa')](),controller[_0x7bb3('0xb')]);router[_0x7bb3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7bb3('0xc')]);router['post']('/',auth[_0x7bb3('0xa')](),controller[_0x7bb3('0xd')]);router[_0x7bb3('0xe')](_0x7bb3('0xf'),auth[_0x7bb3('0xa')](),controller['addApplications']);router[_0x7bb3('0x10')](_0x7bb3('0x11'),auth[_0x7bb3('0xa')](),controller[_0x7bb3('0x12')]);router['delete'](_0x7bb3('0x11'),auth['isAuthenticated'](),controller[_0x7bb3('0x13')]);module[_0x7bb3('0x14')]=router; \ No newline at end of file +var _0xeb83=['isAuthenticated','index','/:id','post','/:id/applications','addApplications','update','delete','destroy','exports','multer','util','path','Router','fs-extra','./voiceExtension.controller','get'];(function(_0x2e9f96,_0x155318){var _0x5383bb=function(_0x3ebc85){while(--_0x3ebc85){_0x2e9f96['push'](_0x2e9f96['shift']());}};_0x5383bb(++_0x155318);}(_0xeb83,0x16f));var _0x3eb8=function(_0x1b45e1,_0x175e72){_0x1b45e1=_0x1b45e1-0x0;var _0x525317=_0xeb83[_0x1b45e1];return _0x525317;};'use strict';var multer=require(_0x3eb8('0x0'));var util=require(_0x3eb8('0x1'));var path=require(_0x3eb8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3eb8('0x3')]();var fs_extra=require(_0x3eb8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3eb8('0x5'));router[_0x3eb8('0x6')]('/',auth[_0x3eb8('0x7')](),controller[_0x3eb8('0x8')]);router[_0x3eb8('0x6')](_0x3eb8('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3eb8('0xa')](_0x3eb8('0xb'),auth['isAuthenticated'](),controller[_0x3eb8('0xc')]);router['put'](_0x3eb8('0x9'),auth[_0x3eb8('0x7')](),controller[_0x3eb8('0xd')]);router[_0x3eb8('0xe')](_0x3eb8('0x9'),auth['isAuthenticated'](),controller[_0x3eb8('0xf')]);module[_0x3eb8('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 0a0fc58..a4814e3 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 _0x6daf=['exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize'];(function(_0x4e0994,_0x5bf8e6){var _0x3daa41=function(_0x5ee0fd){while(--_0x5ee0fd){_0x4e0994['push'](_0x4e0994['shift']());}};_0x3daa41(++_0x5bf8e6);}(_0x6daf,0x142));var _0xf6da=function(_0x21010d,_0x4878f2){_0x21010d=_0x21010d-0x0;var _0x28c12c=_0x6daf[_0x21010d];return _0x28c12c;};'use strict';var Sequelize=require(_0xf6da('0x0'));module[_0xf6da('0x1')]={'context':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'unique':_0xf6da('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'unique':_0xf6da('0x3')},'priority':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf6da('0x3')},'tag':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'defaultValue':_0xf6da('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf6da('0x5')](_0xf6da('0x6'),_0xf6da('0x7'),_0xf6da('0x8'),_0xf6da('0x9'),_0xf6da('0xa'),_0xf6da('0xb'),_0xf6da('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0xf6da('0x2')]},'interval':{'type':Sequelize[_0xf6da('0x2')],'allowNull':![],'defaultValue':_0xf6da('0xd')},'IntervalId':{'type':Sequelize[_0xf6da('0xe')]},'isApp':{'type':Sequelize[_0xf6da('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf6da('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xf6da('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf6da('0xe')]},'recordingFormat':{'type':Sequelize[_0xf6da('0x2')],'defaultValue':_0xf6da('0x10')},'answer':{'type':Sequelize[_0xf6da('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0xf6da('0x11')],'get':function(_0x75cde5){return this['getDataValue'](_0xf6da('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x7244=['exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x7244,0xcd));var _0x4724=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7244[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4724('0x0'));module[_0x4724('0x1')]={'context':{'type':Sequelize[_0x4724('0x2')],'allowNull':![],'unique':_0x4724('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4724('0x3')},'priority':{'type':Sequelize[_0x4724('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4724('0x3')},'tag':{'type':Sequelize[_0x4724('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4724('0x2')],'allowNull':![],'defaultValue':_0x4724('0x4')},'appdata':{'type':Sequelize[_0x4724('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4724('0x5')]('inbound',_0x4724('0x6'),_0x4724('0x7'),_0x4724('0x8'),'outbound-fax',_0x4724('0x9'),_0x4724('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4724('0x2')]},'interval':{'type':Sequelize[_0x4724('0x2')],'allowNull':![],'defaultValue':_0x4724('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x4724('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4724('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x4724('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4724('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4724('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4724('0xe')],'get':function(_0x135835){return this[_0x4724('0xf')](_0x4724('0x10'));}},'alias':{'type':Sequelize[_0x4724('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 815c3cd..8f94499 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 _0x7cb2=['InternalRoutes','filter','ignore','value','type','name','UserProfileResource','sendStatus','error','stack','send','index','map','VoiceExtension','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','find','outbound','body','exten','concat','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','cutdigits','alias','findOne','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes'];(function(_0x154276,_0xdced12){var _0xff137e=function(_0xdadd75){while(--_0xdadd75){_0x154276['push'](_0x154276['shift']());}};_0xff137e(++_0xdced12);}(_0x7cb2,0xb1));var _0x27cb=function(_0x375c8c,_0x355281){_0x375c8c=_0x375c8c-0x0;var _0x479b10=_0x7cb2[_0x375c8c];return _0x479b10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27cb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x27cb('0x1'));var BPromise=require(_0x27cb('0x2'));var Mustache=require(_0x27cb('0x3'));var util=require(_0x27cb('0x4'));var path=require(_0x27cb('0x5'));var sox=require(_0x27cb('0x6'));var csv=require(_0x27cb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27cb('0x8'));var _=require(_0x27cb('0x9'));var squel=require(_0x27cb('0xa'));var crypto=require('crypto');var jsforce=require(_0x27cb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x27cb('0x7'));var querystring=require(_0x27cb('0xc'));var Papa=require(_0x27cb('0xd'));var Redis=require(_0x27cb('0xe'));var authService=require(_0x27cb('0xf'));var qs=require(_0x27cb('0x10'));var as=require(_0x27cb('0x11'));var hardwareService=require(_0x27cb('0x12'));var logger=require(_0x27cb('0x13'))(_0x27cb('0x14'));var utils=require(_0x27cb('0x15'));var config=require(_0x27cb('0x16'));var licenseUtil=require(_0x27cb('0x17'));var db=require(_0x27cb('0x18'))['db'];config[_0x27cb('0x19')]=_['defaults'](config[_0x27cb('0x19')],{'host':_0x27cb('0x1a'),'port':0x18eb});var socket=require(_0x27cb('0x1b'))(new Redis(config[_0x27cb('0x19')]));require(_0x27cb('0x1c'))[_0x27cb('0x1d')](socket);function respondWithStatusCode(_0x3199b6,_0x197072){_0x197072=_0x197072||0xcc;return function(_0x2c712e){if(_0x2c712e){return _0x3199b6['sendStatus'](_0x197072);}return _0x3199b6[_0x27cb('0x1e')](_0x197072)[_0x27cb('0x1f')]();};}function respondWithResult(_0x55124d,_0x158e9c){_0x158e9c=_0x158e9c||0xc8;return function(_0xa5b373){if(_0xa5b373){return _0x55124d[_0x27cb('0x1e')](_0x158e9c)[_0x27cb('0x20')](_0xa5b373);}};}function respondWithFilteredResult(_0x2259f8,_0x83b344){return function(_0x65244){if(_0x65244){var _0x2a6353=typeof _0x83b344[_0x27cb('0x21')]===_0x27cb('0x22')&&typeof _0x83b344[_0x27cb('0x23')]===_0x27cb('0x22');var _0x5d9d81=_0x65244[_0x27cb('0x24')];var _0x2e7bec=_0x2a6353?0x0:_0x83b344['offset'];var _0x2c9db5=_0x2a6353?_0x65244[_0x27cb('0x24')]:_0x83b344[_0x27cb('0x21')]+_0x83b344[_0x27cb('0x23')];var _0x4510c7;if(_0x2c9db5>=_0x5d9d81){_0x2c9db5=_0x5d9d81;_0x4510c7=0xc8;}else{_0x4510c7=0xce;}_0x2259f8['status'](_0x4510c7);return _0x2259f8['set'](_0x27cb('0x25'),_0x2e7bec+'-'+_0x2c9db5+'/'+_0x5d9d81)[_0x27cb('0x20')](_0x65244);}return null;};}function patchUpdates(_0x482dcd){return function(_0x2a6bb9){try{jsonpatch['apply'](_0x2a6bb9,_0x482dcd,!![]);}catch(_0x5ad84){return BPromise[_0x27cb('0x26')](_0x5ad84);}return _0x2a6bb9[_0x27cb('0x27')]();};}function saveUpdates(_0xf56aef,_0x3bb942){return function(_0x19f8cb){if(_0x19f8cb){return _0x19f8cb[_0x27cb('0x28')](_0xf56aef)[_0x27cb('0x29')](function(_0x2617bb){return _0x2617bb;});}return null;};}function removeEntity(_0x4219f4,_0x3850e6){return function(_0x1f96af){if(_0x1f96af){return _0x1f96af[_0x27cb('0x2a')]()[_0x27cb('0x29')](function(){var _0x3f3eac=_0x1f96af[_0x27cb('0x2b')]({'plain':!![]});var _0x25396b=[{'name':_0x27cb('0x2c'),'value':_0x27cb('0x2d'),'ignore':![]},{'name':_0x27cb('0x2e'),'value':'outbound','ignore':![]},{'name':_0x27cb('0x2f'),'value':'internal','ignore':![]}];var _0x4f7bec=_(_0x25396b)[_0x27cb('0x30')](_0x27cb('0x31'))['map'](_0x27cb('0x32'))['value']();if(_['includes'](_0x4f7bec,_0x3f3eac['type'])){return;}var _0x14a6ce=_['find'](_0x25396b,[_0x27cb('0x32'),_0x3f3eac[_0x27cb('0x33')]])[_0x27cb('0x34')];return db[_0x27cb('0x35')][_0x27cb('0x2a')]({'where':{'type':_0x14a6ce,'resourceId':_0x3f3eac['id']}})['then'](function(){return _0x1f96af;});})['then'](function(){_0x4219f4[_0x27cb('0x1e')](0xcc)[_0x27cb('0x1f')]();});}};}function handleEntityNotFound(_0x2cceb5,_0x3d645b){return function(_0x50d3f6){if(!_0x50d3f6){_0x2cceb5[_0x27cb('0x36')](0x194);}return _0x50d3f6;};}function handleError(_0x51b9d8,_0x16a474){_0x16a474=_0x16a474||0x1f4;return function(_0x231351){logger[_0x27cb('0x37')](_0x231351[_0x27cb('0x38')]);if(_0x231351['name']){delete _0x231351['name'];}_0x51b9d8[_0x27cb('0x1e')](_0x16a474)[_0x27cb('0x39')](_0x231351);};}exports[_0x27cb('0x3a')]=function(_0x1c9eeb,_0x19e1f1){var _0x4cd28f={},_0x3e06e7={},_0x5bac6f={'count':0x0,'rows':[]};var _0x200c0e=_[_0x27cb('0x3b')](db[_0x27cb('0x3c')]['rawAttributes'],function(_0x2909e1){return{'name':_0x2909e1[_0x27cb('0x3d')],'type':_0x2909e1[_0x27cb('0x33')][_0x27cb('0x3e')]};});_0x3e06e7[_0x27cb('0x3f')]=_[_0x27cb('0x3b')](_0x200c0e,_0x27cb('0x34'));_0x3e06e7['query']=_[_0x27cb('0x40')](_0x1c9eeb[_0x27cb('0x41')]);_0x3e06e7[_0x27cb('0x42')]=_[_0x27cb('0x43')](_0x3e06e7[_0x27cb('0x3f')],_0x3e06e7[_0x27cb('0x41')]);_0x4cd28f[_0x27cb('0x44')]=_[_0x27cb('0x43')](_0x3e06e7[_0x27cb('0x3f')],qs[_0x27cb('0x45')](_0x1c9eeb[_0x27cb('0x41')][_0x27cb('0x45')]));_0x4cd28f['attributes']=_0x4cd28f[_0x27cb('0x44')]['length']?_0x4cd28f[_0x27cb('0x44')]:_0x3e06e7['model'];if(!_0x1c9eeb['query'][_0x27cb('0x46')](_0x27cb('0x47'))){_0x4cd28f['limit']=qs[_0x27cb('0x23')](_0x1c9eeb[_0x27cb('0x41')][_0x27cb('0x23')]);_0x4cd28f[_0x27cb('0x21')]=qs[_0x27cb('0x21')](_0x1c9eeb[_0x27cb('0x41')][_0x27cb('0x21')]);}_0x4cd28f['order']=qs['sort'](_0x1c9eeb[_0x27cb('0x41')][_0x27cb('0x48')]);_0x4cd28f['where']=qs['filters'](_[_0x27cb('0x49')](_0x1c9eeb[_0x27cb('0x41')],_0x3e06e7[_0x27cb('0x42')]),_0x200c0e);if(_0x1c9eeb[_0x27cb('0x41')]['filter']){_0x4cd28f[_0x27cb('0x4a')]=_[_0x27cb('0x4b')](_0x4cd28f[_0x27cb('0x4a')],{'$or':_[_0x27cb('0x3b')](_0x200c0e,function(_0x4e620a){if(_0x4e620a[_0x27cb('0x33')]!==_0x27cb('0x4c')){var _0x599406={};_0x599406[_0x4e620a[_0x27cb('0x34')]]={'$like':'%'+_0x1c9eeb[_0x27cb('0x41')][_0x27cb('0x30')]+'%'};return _0x599406;}})});}_0x4cd28f=_[_0x27cb('0x4b')]({},_0x4cd28f,_0x1c9eeb['options']);var _0x186135={'where':_0x4cd28f[_0x27cb('0x4a')]};return db[_0x27cb('0x3c')][_0x27cb('0x24')](_0x186135)[_0x27cb('0x29')](function(_0x5dbb36){_0x5bac6f[_0x27cb('0x24')]=_0x5dbb36;if(_0x1c9eeb['query']['includeAll']){_0x4cd28f[_0x27cb('0x4d')]=[{'all':!![]}];}return db[_0x27cb('0x3c')][_0x27cb('0x4e')](_0x4cd28f);})[_0x27cb('0x29')](function(_0x23e99d){_0x5bac6f[_0x27cb('0x4f')]=_0x23e99d;return _0x5bac6f;})['then'](respondWithFilteredResult(_0x19e1f1,_0x4cd28f))[_0x27cb('0x50')](handleError(_0x19e1f1,null));};exports[_0x27cb('0x51')]=function(_0x3e80cd,_0xefe3e9){var _0x180fe2={'raw':![],'where':{'id':_0x3e80cd[_0x27cb('0x52')]['id']}},_0x442415={};_0x442415['model']=_[_0x27cb('0x40')](db['VoiceExtension'][_0x27cb('0x53')]);_0x442415[_0x27cb('0x41')]=_[_0x27cb('0x40')](_0x3e80cd['query']);_0x442415[_0x27cb('0x42')]=_[_0x27cb('0x43')](_0x442415[_0x27cb('0x3f')],_0x442415[_0x27cb('0x41')]);_0x180fe2[_0x27cb('0x44')]=_[_0x27cb('0x43')](_0x442415[_0x27cb('0x3f')],qs[_0x27cb('0x45')](_0x3e80cd[_0x27cb('0x41')][_0x27cb('0x45')]));_0x180fe2[_0x27cb('0x44')]=_0x180fe2['attributes'][_0x27cb('0x54')]?_0x180fe2[_0x27cb('0x44')]:_0x442415[_0x27cb('0x3f')];if(_0x3e80cd[_0x27cb('0x41')][_0x27cb('0x55')]){_0x180fe2['include']=[{'all':!![]}];}_0x180fe2=_[_0x27cb('0x4b')]({},_0x180fe2,_0x3e80cd[_0x27cb('0x56')]);return db['VoiceExtension'][_0x27cb('0x57')](_0x180fe2)[_0x27cb('0x29')](handleEntityNotFound(_0xefe3e9,null))[_0x27cb('0x29')](respondWithResult(_0xefe3e9,null))['catch'](handleError(_0xefe3e9,null));};exports[_0x27cb('0x2a')]=function(_0x3496fc,_0x2e233b){return db[_0x27cb('0x3c')]['find']({'where':{'id':_0x3496fc[_0x27cb('0x52')]['id']}})[_0x27cb('0x29')](handleEntityNotFound(_0x2e233b,null))['then'](removeEntity(_0x2e233b,null))[_0x27cb('0x50')](handleError(_0x2e233b,null));};exports['create']=function(_0x4b7c50,_0x2d09a5){if(_0x4b7c50['body']['type']===_0x27cb('0x58')&&!_['startsWith'](_0x4b7c50[_0x27cb('0x59')][_0x27cb('0x5a')],'_')){_0x4b7c50[_0x27cb('0x59')][_0x27cb('0x5a')]='_'[_0x27cb('0x5b')](_0x4b7c50[_0x27cb('0x59')][_0x27cb('0x5a')]);}return db[_0x27cb('0x3c')][_0x27cb('0x5c')](_0x4b7c50['body'],{'raw':![]})[_0x27cb('0x29')](function(_0xc403d9){var _0x323c58=_0x4b7c50[_0x27cb('0x5d')][_0x27cb('0x2b')]({'plain':!![]});if(!_0x323c58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x323c58[_0x27cb('0x5e')]===_0x27cb('0x5d')){var _0x3871cf=_0xc403d9[_0x27cb('0x2b')]({'plain':!![]});var _0x307d7c=[{'name':'InboundRoutes','value':_0x27cb('0x2d')},{'name':_0x27cb('0x2e'),'value':'outbound'},{'name':_0x27cb('0x2f'),'value':'internal'}];var _0x57214b=_[_0x27cb('0x57')](_0x307d7c,['value',_0x3871cf[_0x27cb('0x33')]])[_0x27cb('0x34')];return db[_0x27cb('0x5f')][_0x27cb('0x57')]({'where':{'name':_0x57214b,'userProfileId':_0x323c58[_0x27cb('0x60')]},'raw':!![]})[_0x27cb('0x29')](function(_0x1f2641){if(_0x1f2641&&_0x1f2641[_0x27cb('0x61')]===0x0){return db[_0x27cb('0x35')][_0x27cb('0x5c')]({'name':_0x3871cf['name'],'resourceId':_0x3871cf['id'],'type':_0x1f2641['name'],'sectionId':_0x1f2641['id']},{})[_0x27cb('0x29')](function(){return _0xc403d9;});}else{return _0xc403d9;}})[_0x27cb('0x50')](function(_0x57eb14){logger[_0x27cb('0x37')](_0x27cb('0x62'),_0x57eb14);throw _0x57eb14;});}return _0xc403d9;})[_0x27cb('0x29')](respondWithResult(_0x2d09a5,0xc9))['catch'](handleError(_0x2d09a5,null));};exports[_0x27cb('0x28')]=function(_0x264d4c,_0xfaf928){if(_0x264d4c['body']['id']){delete _0x264d4c[_0x27cb('0x59')]['id'];}return db['VoiceExtension'][_0x27cb('0x57')]({'where':{'id':_0x264d4c['params']['id']}})[_0x27cb('0x29')](handleEntityNotFound(_0xfaf928,null))[_0x27cb('0x29')](function(_0x2b4a56){if(_0x2b4a56){return db[_0x27cb('0x3c')][_0x27cb('0x28')](_[_0x27cb('0x49')](_0x264d4c['body'],[_0x27cb('0x5a'),_0x27cb('0x63'),'description','recordingFormat',_0x27cb('0x64'),'mandatoryDisposition',_0x27cb('0x65')]),{'where':{'context':_0x2b4a56['context'],'exten':_0x2b4a56[_0x27cb('0x5a')]},'individualHooks':!![]})[_0x27cb('0x29')](function(_0x23e31b){return _0x23e31b;});}return null;})[_0x27cb('0x29')](respondWithStatusCode(_0xfaf928,null))[_0x27cb('0x50')](handleError(_0xfaf928,null));};exports['addApplications']=function(_0x347942,_0x19a951){return db[_0x27cb('0x3c')][_0x27cb('0x66')]({'where':{'id':_0x347942['params']['id']}})['then'](function(_0x2d5a1d){if(_0x2d5a1d){return db['sequelize'][_0x27cb('0x67')](function(_0x19c526){return db['VoiceExtension'][_0x27cb('0x2a')]({'where':{'VoiceExtensionId':_0x347942[_0x27cb('0x52')]['id']},'transaction':_0x19c526})['then'](function(){var _0x4200e7=_[_0x27cb('0x3b')](_0x347942[_0x27cb('0x59')],function(_0xf0db6d){_0xf0db6d[_0x27cb('0x68')]=_0x347942[_0x27cb('0x52')]['id'];_0xf0db6d[_0x27cb('0x69')]=!![];return _0xf0db6d;});var _0x557ab4=_0x347942[_0x27cb('0x41')][_0x27cb('0x6a')]&&_0x347942[_0x27cb('0x41')][_0x27cb('0x6a')][_0x27cb('0x6b')]()===_0x27cb('0x6c')?!![]:![];return _0x2d5a1d[_0x27cb('0x6d')](_0x4200e7,_0x557ab4);})['then'](function(_0xbec585){return db[_0x27cb('0x3c')][_0x27cb('0x6e')](_0xbec585,{'transaction':_0x19c526});});})[_0x27cb('0x29')](function(){return db[_0x27cb('0x3c')][_0x27cb('0x6f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x347942[_0x27cb('0x52')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x27cb('0x29')](respondWithResult(_0x19a951,null))['catch'](handleError(_0x19a951,null));}; \ No newline at end of file +var _0xf2aa=['VoiceExtensionId','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','status','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','InboundRoutes','inbound','outbound','InternalRoutes','map','value','includes','find','type','name','UserProfileResource','end','sendStatus','stack','send','index','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceExtension','includeAll','findAll','catch','show','params','rawAttributes','intersection','body','startsWith','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','internal','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','alias','addApplications','findOne','transaction'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0xf2aa,0x1c0));var _0xaf2a=function(_0x1f17d9,_0x2f98cf){_0x1f17d9=_0x1f17d9-0x0;var _0x14ec1f=_0xf2aa[_0x1f17d9];return _0x14ec1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf2a('0x0'));var zipdir=require(_0xaf2a('0x1'));var jsonpatch=require(_0xaf2a('0x2'));var rp=require(_0xaf2a('0x3'));var moment=require(_0xaf2a('0x4'));var BPromise=require(_0xaf2a('0x5'));var Mustache=require(_0xaf2a('0x6'));var util=require(_0xaf2a('0x7'));var path=require(_0xaf2a('0x8'));var sox=require(_0xaf2a('0x9'));var csv=require(_0xaf2a('0xa'));var ejs=require(_0xaf2a('0xb'));var fs=require('fs');var fs_extra=require(_0xaf2a('0xc'));var _=require(_0xaf2a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf2a('0xe'));var toCsv=require(_0xaf2a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf2a('0xf'));var authService=require(_0xaf2a('0x10'));var qs=require(_0xaf2a('0x11'));var as=require(_0xaf2a('0x12'));var hardwareService=require(_0xaf2a('0x13'));var logger=require(_0xaf2a('0x14'))(_0xaf2a('0x15'));var utils=require(_0xaf2a('0x16'));var config=require(_0xaf2a('0x17'));var licenseUtil=require(_0xaf2a('0x18'));var db=require(_0xaf2a('0x19'))['db'];config[_0xaf2a('0x1a')]=_['defaults'](config[_0xaf2a('0x1a')],{'host':_0xaf2a('0x1b'),'port':0x18eb});var socket=require(_0xaf2a('0x1c'))(new Redis(config[_0xaf2a('0x1a')]));require(_0xaf2a('0x1d'))['register'](socket);function respondWithStatusCode(_0x1879bd,_0x5f4304){_0x5f4304=_0x5f4304||0xcc;return function(_0x523e5c){if(_0x523e5c){return _0x1879bd['sendStatus'](_0x5f4304);}return _0x1879bd[_0xaf2a('0x1e')](_0x5f4304)['end']();};}function respondWithResult(_0x3fb79a,_0x23fce1){_0x23fce1=_0x23fce1||0xc8;return function(_0x1b75c6){if(_0x1b75c6){return _0x3fb79a[_0xaf2a('0x1e')](_0x23fce1)[_0xaf2a('0x1f')](_0x1b75c6);}};}function respondWithFilteredResult(_0x58b07b,_0x8e60c5){return function(_0x112cf1){if(_0x112cf1){var _0x135669=typeof _0x8e60c5['offset']===_0xaf2a('0x20')&&typeof _0x8e60c5[_0xaf2a('0x21')]===_0xaf2a('0x20');var _0xc7e565=_0x112cf1[_0xaf2a('0x22')];var _0x3d37d2=_0x135669?0x0:_0x8e60c5[_0xaf2a('0x23')];var _0x136b06=_0x135669?_0x112cf1[_0xaf2a('0x22')]:_0x8e60c5[_0xaf2a('0x23')]+_0x8e60c5['limit'];var _0x455ce8;if(_0x136b06>=_0xc7e565){_0x136b06=_0xc7e565;_0x455ce8=0xc8;}else{_0x455ce8=0xce;}_0x58b07b['status'](_0x455ce8);return _0x58b07b[_0xaf2a('0x24')]('Content-Range',_0x3d37d2+'-'+_0x136b06+'/'+_0xc7e565)[_0xaf2a('0x1f')](_0x112cf1);}return null;};}function patchUpdates(_0xb811a){return function(_0x414945){try{jsonpatch[_0xaf2a('0x25')](_0x414945,_0xb811a,!![]);}catch(_0x49bb44){return BPromise[_0xaf2a('0x26')](_0x49bb44);}return _0x414945['save']();};}function saveUpdates(_0x883910,_0x981f6e){return function(_0x3b42af){if(_0x3b42af){return _0x3b42af[_0xaf2a('0x27')](_0x883910)[_0xaf2a('0x28')](function(_0x1059cb){return _0x1059cb;});}return null;};}function removeEntity(_0x3aa1e6,_0x304a23){return function(_0x30538d){if(_0x30538d){return _0x30538d[_0xaf2a('0x29')]()[_0xaf2a('0x28')](function(){var _0x402ef7=_0x30538d['get']({'plain':!![]});var _0x4eb63c=[{'name':_0xaf2a('0x2a'),'value':_0xaf2a('0x2b'),'ignore':![]},{'name':'OutboundRoutes','value':_0xaf2a('0x2c'),'ignore':![]},{'name':_0xaf2a('0x2d'),'value':'internal','ignore':![]}];var _0x5ad5dc=_(_0x4eb63c)['filter']('ignore')[_0xaf2a('0x2e')](_0xaf2a('0x2f'))[_0xaf2a('0x2f')]();if(_[_0xaf2a('0x30')](_0x5ad5dc,_0x402ef7['type'])){return;}var _0x531cf5=_[_0xaf2a('0x31')](_0x4eb63c,[_0xaf2a('0x2f'),_0x402ef7[_0xaf2a('0x32')]])[_0xaf2a('0x33')];return db[_0xaf2a('0x34')][_0xaf2a('0x29')]({'where':{'type':_0x531cf5,'resourceId':_0x402ef7['id']}})[_0xaf2a('0x28')](function(){return _0x30538d;});})[_0xaf2a('0x28')](function(){_0x3aa1e6[_0xaf2a('0x1e')](0xcc)[_0xaf2a('0x35')]();});}};}function handleEntityNotFound(_0x4de805,_0x5cee3b){return function(_0x289ce2){if(!_0x289ce2){_0x4de805[_0xaf2a('0x36')](0x194);}return _0x289ce2;};}function handleError(_0x438012,_0x4e0e80){_0x4e0e80=_0x4e0e80||0x1f4;return function(_0xae6c75){logger['error'](_0xae6c75[_0xaf2a('0x37')]);if(_0xae6c75[_0xaf2a('0x33')]){delete _0xae6c75[_0xaf2a('0x33')];}_0x438012[_0xaf2a('0x1e')](_0x4e0e80)[_0xaf2a('0x38')](_0xae6c75);};}exports[_0xaf2a('0x39')]=function(_0x4992b9,_0x42ac9a){var _0x999904={},_0x28cd63={},_0x40d130={'count':0x0,'rows':[]};var _0x22ce5c=_[_0xaf2a('0x2e')](db['VoiceExtension']['rawAttributes'],function(_0xea8d90){return{'name':_0xea8d90['fieldName'],'type':_0xea8d90[_0xaf2a('0x32')][_0xaf2a('0x3a')]};});_0x28cd63[_0xaf2a('0x3b')]=_['map'](_0x22ce5c,_0xaf2a('0x33'));_0x28cd63[_0xaf2a('0x3c')]=_[_0xaf2a('0x3d')](_0x4992b9[_0xaf2a('0x3c')]);_0x28cd63[_0xaf2a('0x3e')]=_['intersection'](_0x28cd63[_0xaf2a('0x3b')],_0x28cd63['query']);_0x999904[_0xaf2a('0x3f')]=_['intersection'](_0x28cd63[_0xaf2a('0x3b')],qs[_0xaf2a('0x40')](_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x40')]));_0x999904['attributes']=_0x999904['attributes'][_0xaf2a('0x41')]?_0x999904[_0xaf2a('0x3f')]:_0x28cd63['model'];if(!_0x4992b9[_0xaf2a('0x3c')]['hasOwnProperty'](_0xaf2a('0x42'))){_0x999904[_0xaf2a('0x21')]=qs[_0xaf2a('0x21')](_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x21')]);_0x999904[_0xaf2a('0x23')]=qs[_0xaf2a('0x23')](_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x23')]);}_0x999904['order']=qs[_0xaf2a('0x43')](_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x43')]);_0x999904[_0xaf2a('0x44')]=qs[_0xaf2a('0x3e')](_[_0xaf2a('0x45')](_0x4992b9['query'],_0x28cd63['filters']),_0x22ce5c);if(_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x46')]){_0x999904[_0xaf2a('0x44')]=_[_0xaf2a('0x47')](_0x999904[_0xaf2a('0x44')],{'$or':_['map'](_0x22ce5c,function(_0x2237d3){if(_0x2237d3[_0xaf2a('0x32')]!==_0xaf2a('0x48')){var _0x20499f={};_0x20499f[_0x2237d3[_0xaf2a('0x33')]]={'$like':'%'+_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x46')]+'%'};return _0x20499f;}})});}_0x999904=_['merge']({},_0x999904,_0x4992b9['options']);var _0xa3c2cd={'where':_0x999904[_0xaf2a('0x44')]};return db[_0xaf2a('0x49')]['count'](_0xa3c2cd)[_0xaf2a('0x28')](function(_0x278ae9){_0x40d130[_0xaf2a('0x22')]=_0x278ae9;if(_0x4992b9[_0xaf2a('0x3c')][_0xaf2a('0x4a')]){_0x999904['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xaf2a('0x4b')](_0x999904);})[_0xaf2a('0x28')](function(_0x3a7775){_0x40d130['rows']=_0x3a7775;return _0x40d130;})['then'](respondWithFilteredResult(_0x42ac9a,_0x999904))[_0xaf2a('0x4c')](handleError(_0x42ac9a,null));};exports[_0xaf2a('0x4d')]=function(_0x395fe2,_0x1fe844){var _0x2ab6b6={'raw':![],'where':{'id':_0x395fe2[_0xaf2a('0x4e')]['id']}},_0x1af067={};_0x1af067[_0xaf2a('0x3b')]=_['keys'](db[_0xaf2a('0x49')][_0xaf2a('0x4f')]);_0x1af067['query']=_['keys'](_0x395fe2['query']);_0x1af067['filters']=_[_0xaf2a('0x50')](_0x1af067[_0xaf2a('0x3b')],_0x1af067[_0xaf2a('0x3c')]);_0x2ab6b6[_0xaf2a('0x3f')]=_[_0xaf2a('0x50')](_0x1af067['model'],qs[_0xaf2a('0x40')](_0x395fe2[_0xaf2a('0x3c')]['fields']));_0x2ab6b6[_0xaf2a('0x3f')]=_0x2ab6b6['attributes'][_0xaf2a('0x41')]?_0x2ab6b6[_0xaf2a('0x3f')]:_0x1af067[_0xaf2a('0x3b')];if(_0x395fe2[_0xaf2a('0x3c')][_0xaf2a('0x4a')]){_0x2ab6b6['include']=[{'all':!![]}];}_0x2ab6b6=_[_0xaf2a('0x47')]({},_0x2ab6b6,_0x395fe2['options']);return db[_0xaf2a('0x49')][_0xaf2a('0x31')](_0x2ab6b6)[_0xaf2a('0x28')](handleEntityNotFound(_0x1fe844,null))['then'](respondWithResult(_0x1fe844,null))[_0xaf2a('0x4c')](handleError(_0x1fe844,null));};exports[_0xaf2a('0x29')]=function(_0x3e1f28,_0x16f3a8){return db['VoiceExtension']['find']({'where':{'id':_0x3e1f28[_0xaf2a('0x4e')]['id']}})[_0xaf2a('0x28')](handleEntityNotFound(_0x16f3a8,null))[_0xaf2a('0x28')](removeEntity(_0x16f3a8,null))[_0xaf2a('0x4c')](handleError(_0x16f3a8,null));};exports['create']=function(_0x50d245,_0x13a0dd){if(_0x50d245[_0xaf2a('0x51')][_0xaf2a('0x32')]===_0xaf2a('0x2c')&&!_[_0xaf2a('0x52')](_0x50d245[_0xaf2a('0x51')][_0xaf2a('0x53')],'_')){_0x50d245[_0xaf2a('0x51')][_0xaf2a('0x53')]='_'[_0xaf2a('0x54')](_0x50d245[_0xaf2a('0x51')][_0xaf2a('0x53')]);}return db[_0xaf2a('0x49')][_0xaf2a('0x55')](_0x50d245[_0xaf2a('0x51')],{'raw':![]})[_0xaf2a('0x28')](function(_0x2b8e20){var _0x2307bb=_0x50d245[_0xaf2a('0x56')][_0xaf2a('0x57')]({'plain':!![]});if(!_0x2307bb)throw new Error(_0xaf2a('0x58'));if(_0x2307bb[_0xaf2a('0x59')]===_0xaf2a('0x56')){var _0x1bf011=_0x2b8e20[_0xaf2a('0x57')]({'plain':!![]});var _0x3ef5af=[{'name':'InboundRoutes','value':_0xaf2a('0x2b')},{'name':_0xaf2a('0x5a'),'value':'outbound'},{'name':_0xaf2a('0x2d'),'value':_0xaf2a('0x5b')}];var _0x43bd88=_['find'](_0x3ef5af,[_0xaf2a('0x2f'),_0x1bf011[_0xaf2a('0x32')]])['name'];return db[_0xaf2a('0x5c')][_0xaf2a('0x31')]({'where':{'name':_0x43bd88,'userProfileId':_0x2307bb[_0xaf2a('0x5d')]},'raw':!![]})[_0xaf2a('0x28')](function(_0x1a70c8){if(_0x1a70c8&&_0x1a70c8['autoAssociation']===0x0){return db[_0xaf2a('0x34')]['create']({'name':_0x1bf011[_0xaf2a('0x33')],'resourceId':_0x1bf011['id'],'type':_0x1a70c8[_0xaf2a('0x33')],'sectionId':_0x1a70c8['id']},{})['then'](function(){return _0x2b8e20;});}else{return _0x2b8e20;}})['catch'](function(_0x468c75){logger['error'](_0xaf2a('0x5e'),_0x468c75);throw _0x468c75;});}return _0x2b8e20;})[_0xaf2a('0x28')](respondWithResult(_0x13a0dd,0xc9))[_0xaf2a('0x4c')](handleError(_0x13a0dd,null));};exports[_0xaf2a('0x27')]=function(_0x429f68,_0x52cda9){if(_0x429f68[_0xaf2a('0x51')]['id']){delete _0x429f68['body']['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x429f68[_0xaf2a('0x4e')]['id']}})[_0xaf2a('0x28')](handleEntityNotFound(_0x52cda9,null))[_0xaf2a('0x28')](function(_0x51214e){if(_0x51214e){return db[_0xaf2a('0x49')][_0xaf2a('0x27')](_[_0xaf2a('0x45')](_0x429f68[_0xaf2a('0x51')],[_0xaf2a('0x53'),_0xaf2a('0x5f'),_0xaf2a('0x60'),_0xaf2a('0x61'),'cutdigits','mandatoryDisposition',_0xaf2a('0x62')]),{'where':{'context':_0x51214e[_0xaf2a('0x5f')],'exten':_0x51214e[_0xaf2a('0x53')]},'individualHooks':!![]})[_0xaf2a('0x28')](function(_0x1c7827){return _0x1c7827;});}return null;})[_0xaf2a('0x28')](respondWithStatusCode(_0x52cda9,null))[_0xaf2a('0x4c')](handleError(_0x52cda9,null));};exports[_0xaf2a('0x63')]=function(_0x5c04ea,_0x115861){return db['VoiceExtension'][_0xaf2a('0x64')]({'where':{'id':_0x5c04ea[_0xaf2a('0x4e')]['id']}})[_0xaf2a('0x28')](function(_0x3e0493){if(_0x3e0493){return db['sequelize'][_0xaf2a('0x65')](function(_0x950b21){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x5c04ea[_0xaf2a('0x4e')]['id']},'transaction':_0x950b21})[_0xaf2a('0x28')](function(){var _0x17f2a4=_['map'](_0x5c04ea[_0xaf2a('0x51')],function(_0x1401c4){_0x1401c4[_0xaf2a('0x66')]=_0x5c04ea[_0xaf2a('0x4e')]['id'];_0x1401c4['isApp']=!![];return _0x1401c4;});var _0x212c8d=_0x5c04ea[_0xaf2a('0x3c')]['rewriteDial']&&_0x5c04ea[_0xaf2a('0x3c')][_0xaf2a('0x67')][_0xaf2a('0x68')]()===_0xaf2a('0x69')?!![]:![];return _0x3e0493[_0xaf2a('0x6a')](_0x17f2a4,_0x212c8d);})[_0xaf2a('0x28')](function(_0x2c325d){return db['VoiceExtension'][_0xaf2a('0x6b')](_0x2c325d,{'transaction':_0x950b21});});})[_0xaf2a('0x28')](function(){return db['VoiceExtension'][_0xaf2a('0x6c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c04ea['params']['id']},'order':_0xaf2a('0x6d')});});}})['then'](respondWithResult(_0x115861,null))[_0xaf2a('0x4c')](handleError(_0x115861,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 376bab4..f14de89 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 _0x597c=['VoiceExtension','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5787fa,_0x2073d7){var _0x424173=function(_0xb94b0e){while(--_0xb94b0e){_0x5787fa['push'](_0x5787fa['shift']());}};_0x424173(++_0x2073d7);}(_0x597c,0x96));var _0xc597=function(_0x22730f,_0x33047a){_0x22730f=_0x22730f-0x0;var _0x338c3a=_0x597c[_0x22730f];return _0x338c3a;};'use strict';var EventEmitter=require(_0xc597('0x0'));var VoiceExtension=require(_0xc597('0x1'))['db'][_0xc597('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc597('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3bd49f){return function(_0x10d297,_0x287624,_0x2faaa4){VoiceExtensionEvents[_0xc597('0x4')](_0x3bd49f+':'+_0x10d297['id'],_0x10d297);VoiceExtensionEvents[_0xc597('0x4')](_0x3bd49f,_0x10d297);_0x2faaa4(null);};}for(var e in events){if(events[_0xc597('0x5')](e)){var event=events[e];VoiceExtension[_0xc597('0x6')](e,emitEvent(event));}}module[_0xc597('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xdcf6=['hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcf6,0x138));var _0x6dcf=function(_0x2ae8b5,_0x2a2cb6){_0x2ae8b5=_0x2ae8b5-0x0;var _0x29def1=_0xdcf6[_0x2ae8b5];return _0x29def1;};'use strict';var EventEmitter=require(_0x6dcf('0x0'));var VoiceExtension=require(_0x6dcf('0x1'))['db'][_0x6dcf('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6dcf('0x3')](0x0);var events={'afterCreate':_0x6dcf('0x4'),'afterUpdate':_0x6dcf('0x5'),'afterDestroy':_0x6dcf('0x6')};function emitEvent(_0x36fbeb){return function(_0x587db6,_0x262ebd,_0x5be195){VoiceExtensionEvents[_0x6dcf('0x7')](_0x36fbeb+':'+_0x587db6['id'],_0x587db6);VoiceExtensionEvents[_0x6dcf('0x7')](_0x36fbeb,_0x587db6);_0x5be195(null);};}for(var e in events){if(events[_0x6dcf('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x6dcf('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 63aac63..f013766 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 _0x0af8=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','options','url','length','trunk','param','phone','split','prefix','SIP','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','catch','define','last','then','Hangup','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','type','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','push'];(function(_0x431771,_0x4353b4){var _0x42be3b=function(_0x30e280){while(--_0x30e280){_0x431771['push'](_0x431771['shift']());}};_0x42be3b(++_0x4353b4);}(_0x0af8,0x121));var _0x80af=function(_0x4fa5c9,_0x40229b){_0x4fa5c9=_0x4fa5c9-0x0;var _0x10a7c8=_0x0af8[_0x4fa5c9];return _0x10a7c8;};'use strict';var util=require('util');var _=require(_0x80af('0x0'));var attributes=require(_0x80af('0x1'));module[_0x80af('0x2')]=function(_0x20d9f0){var _0x2bd28c=_0x20d9f0[_0x80af('0x3')];function _0x34b104(_0x3e8313){var _0x302b95=0x2;var _0x56dada=[{'type':_0x3e8313['type'],'app':'Set','appdata':_0x80af('0x4')+_0x3e8313[_0x80af('0x5')],'context':_0x3e8313['context'],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']},{'type':_0x3e8313[_0x80af('0x5')],'app':_0x3e8313[_0x80af('0x7')]?_0x80af('0x8'):_0x80af('0x9'),'appdata':_0x3e8313[_0x80af('0x7')]?_0x80af('0xa')+_0x3e8313[_0x80af('0x7')]:_0x80af('0xb'),'context':_0x3e8313[_0x80af('0xc')],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']}];if(_0x3e8313[_0x80af('0x5')]===_0x80af('0xd')){_0x56dada['push']({'type':'inbound','app':'Set','appdata':_0x80af('0xe')+_0x3e8313['id'],'context':_0x3e8313['context'],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']});}_0x56dada['push']({'type':_0x3e8313['type'],'app':_0x80af('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3e8313[_0x80af('0xc')],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']},{'type':_0x3e8313[_0x80af('0x5')],'app':_0x80af('0x8'),'appdata':_0x80af('0xf'),'context':_0x3e8313[_0x80af('0xc')],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']},{'type':_0x3e8313[_0x80af('0x5')],'app':_0x80af('0x8'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3e8313[_0x80af('0xc')],'exten':_0x3e8313[_0x80af('0x6')],'priority':_0x302b95++,'VoiceExtensionId':_0x3e8313['id']});return _0x56dada;}function _0x23f75c(_0x1038d5){var _0x250808=0x2;var _0x216308=[{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':_0x80af('0x11'),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x1038d5[_0x80af('0x7')]?_0x80af('0x8'):'NoOp','appdata':_0x1038d5['alias']?_0x80af('0xa')+_0x1038d5[_0x80af('0x7')]:_0x80af('0xb'),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':_0x80af('0x12')+(_0x1038d5[_0x80af('0x13')]?_0x80af('0x14')+_0x1038d5[_0x80af('0x13')]+'}':_0x80af('0x15')),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5['exten'],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':_0x80af('0xe')+_0x1038d5['id'],'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':'ExecIf','appdata':_0x80af('0x16')+(_0x250808+0x2)+_0x80af('0x17')+(_0x250808+0x1)+')','context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':'outbound','app':_0x80af('0x8'),'appdata':_0x1038d5[_0x80af('0x13')]?_0x80af('0x18')+_0x1038d5[_0x80af('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':'Set','appdata':_0x80af('0xf'),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':_0x80af('0x19'),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':_0x80af('0x1a')+_0x1038d5['id'],'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']}];if(_0x1038d5[_0x80af('0x1b')](_0x80af('0x1c'))&&_0x1038d5['recordingFormat']!==_0x80af('0x1d')){_0x216308[_0x80af('0x1e')]({'type':_0x80af('0x10'),'app':'Set','appdata':_0x80af('0x1f'),'context':_0x1038d5[_0x80af('0xc')],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']},{'type':_0x80af('0x10'),'app':_0x80af('0x8'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1038d5['recordingFormat']||_0x80af('0x20'),'context':_0x1038d5['context'],'exten':_0x1038d5[_0x80af('0x6')],'priority':_0x250808++,'VoiceExtensionId':_0x1038d5['id']});}return _0x216308;}function _0x2947eb(_0x364639){var _0x4d46ad=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x80af('0x21'),'param':0x2},{'name':_0x80af('0x22'),'param':0x3}];var _0xc65b6={};var _0x4f85c1=_0x364639['split'](',');var _0x48c3b4=[];for(var _0x535cc6=0x0;_0x535cc6<_0x4d46ad[_0x80af('0x23')];_0x535cc6++){switch(_0x4d46ad[_0x535cc6]['name']){case _0x80af('0x24'):_0xc65b6[_0x80af('0x24')]=_0x4f85c1[_0x4d46ad[_0x535cc6][_0x80af('0x25')]]['split']('/')[0x1];_0xc65b6[_0x80af('0x26')]=_0x4f85c1[_0x4d46ad[_0x535cc6][_0x80af('0x25')]][_0x80af('0x27')]('/')[0x2];_0xc65b6[_0x80af('0x28')]=_0xc65b6[_0x80af('0x26')]?_0xc65b6[_0x80af('0x26')]['split']('$')[0x0]:undefined;_0xc65b6[_0x80af('0x26')]=route[_0x80af('0x13')]?(_0xc65b6['prefix']||'')+_0x80af('0x14')+route[_0x80af('0x13')]+'}':(_0xc65b6['prefix']||'')+'${EXTEN}';_0x48c3b4[_0x4d46ad[_0x535cc6]['param']]=[_0x80af('0x29'),_0xc65b6[_0x80af('0x24')],_0xc65b6[_0x80af('0x26')]]['join']('/');break;case _0x80af('0x21'):_0xc65b6[_0x80af('0x21')]=_0x4f85c1[_0x4d46ad[_0x535cc6]['param']];if(route['recordingFormat']!==_0x80af('0x1d')){if(_0xc65b6['options']['indexOf'](_0x80af('0x2a'))<0x0){_0xc65b6[_0x80af('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0xc65b6[_0x80af('0x21')]=_0xc65b6[_0x80af('0x21')][_0x80af('0x2b')](_0x80af('0x2a'),'');}_0x48c3b4[_0x4d46ad[_0x535cc6][_0x80af('0x25')]]=_0xc65b6[_0x80af('0x21')];break;default:_0x48c3b4[_0x4d46ad[_0x535cc6][_0x80af('0x25')]]=_0x4f85c1[_0x4d46ad[_0x535cc6][_0x80af('0x25')]];}}return _0x48c3b4['join'](',');}function _0x359fab(_0x6216e8,_0x266793,_0x445b14,_0x3599ea){return new Promise(function(_0x2e0c05,_0x11b6de){var _0x31691d=[];if(_['isEmpty'](_0x266793))return _0x2e0c05(_0x31691d);_0x2bd28c[_0x80af('0x2c')][_0x80af('0x2d')]({'attributes':['id',_0x80af('0x2e'),_0x80af('0x2f')],'raw':!![]})['then'](function(_0x3092ca){for(var _0x148b79=0x0,_0x51c5a1=0x0;_0x148b79<_0x266793[_0x80af('0x23')];_0x148b79++,_0x51c5a1=0x0){var _0x139846=_0x266793[_0x148b79];var _0x35dd9d=[];var _0x1efdf9=[];if(_0x139846[_0x80af('0x2e')]!==_0x80af('0x30')){_0x139846[_0x80af('0x31')]=[_0x139846[_0x80af('0x2e')]];}else{_0x139846[_0x80af('0x31')]=_0x139846[_0x80af('0x2f')]?_[_0x80af('0x32')](_[_0x80af('0x33')](_0x3092ca,{'IntervalId':_0x139846['IntervalId']}),_0x80af('0x2e')):[];}_0x139846[_0x80af('0xc')]=_0x6216e8[_0x80af('0xc')];_0x139846['exten']=_0x6216e8['exten'];if(_0x139846[_0x80af('0x5')])_0x139846[_0x80af('0x5')]=_0x139846['type'][_0x80af('0x34')]();if(_0x6216e8[_0x80af('0x5')]==='outbound'){if(_0x139846[_0x80af('0x1b')]('tag')&&_0x139846['tag']&&_0x139846[_0x80af('0x35')]!=='--'){_0x35dd9d[_0x80af('0x1e')]({'type':_0x139846[_0x80af('0x5')][_0x80af('0x34')](),'app':_0x80af('0x8'),'appdata':_0x80af('0x36')+_0x139846[_0x80af('0x35')],'context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8['exten'],'priority':_0x139846[_0x80af('0x31')]['length']+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});}_0x35dd9d[_0x80af('0x1e')]({'type':_0x139846[_0x80af('0x5')]['toLowerCase'](),'app':_0x80af('0x37'),'appdata':_0x80af('0x38')+(_0x139846[_0x80af('0x39')]?_0x80af('0x3a')+_0x139846[_0x80af('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8[_0x80af('0x6')],'priority':_0x139846[_0x80af('0x31')]['length']+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});}else{if(_0x139846['hasOwnProperty'](_0x80af('0x3b'))){if([_0x80af('0x3c'),_0x80af('0x3d')][_0x80af('0x3e')](_0x139846[_0x80af('0x3f')][_0x80af('0x34')]())&&_0x139846[_0x80af('0x40')]!==_0x80af('0x41')){if(_0x139846['answer']){_0x35dd9d[_0x80af('0x1e')]({'type':_0x139846[_0x80af('0x5')][_0x80af('0x34')](),'app':'ExecIf','appdata':_0x80af('0x42'),'context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8[_0x80af('0x6')],'priority':_0x139846[_0x80af('0x31')][_0x80af('0x23')]+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});_0x35dd9d[_0x80af('0x1e')]({'type':_0x139846['type'][_0x80af('0x34')](),'app':_0x80af('0x8'),'appdata':_0x80af('0x43'),'context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8['exten'],'priority':_0x139846[_0x80af('0x31')][_0x80af('0x23')]+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});}else{_0x35dd9d['push']({'type':_0x139846[_0x80af('0x5')][_0x80af('0x34')](),'app':_0x80af('0x37'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8[_0x80af('0x6')],'priority':_0x139846['intervals']['length']+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});_0x35dd9d[_0x80af('0x1e')]({'type':_0x139846[_0x80af('0x5')][_0x80af('0x34')](),'app':_0x80af('0x8'),'appdata':_0x80af('0x44'),'context':_0x6216e8[_0x80af('0xc')],'exten':_0x6216e8[_0x80af('0x6')],'priority':_0x139846['intervals']['length']+_0x445b14+_0x51c5a1++,'VoiceExtensionId':_0x6216e8['id']});}}}}for(var _0x173c66=0x0;_0x173c66<_0x139846[_0x80af('0x31')]['length'];_0x173c66++){var _0x489a1e=_0x445b14+_0x139846[_0x80af('0x31')][_0x80af('0x23')];var _0x1dddf3=_0x173c66===_0x139846[_0x80af('0x31')][_0x80af('0x23')]-0x1?_0x445b14+_0x35dd9d[_0x80af('0x23')]+_0x1efdf9['length']+0x2:_0x445b14+_0x173c66+0x1;_0x35dd9d['splice'](_0x173c66,0x0,{'type':_0x6216e8['type'],'app':_0x80af('0x45'),'appdata':_0x139846['intervals'][_0x173c66]+'?'+_0x6216e8['context']+_0x80af('0x46')+_0x489a1e+':'+_0x6216e8['context']+_0x80af('0x46')+_0x1dddf3,'exten':_0x6216e8[_0x80af('0x6')],'context':_0x6216e8[_0x80af('0xc')],'priority':_0x445b14+_0x173c66,'VoiceExtensionId':_0x6216e8['id']});}if(_0x3599ea&&_0x139846[_0x80af('0x40')]===_0x80af('0x47'))_0x139846[_0x80af('0x48')]=_0x2947eb(_0x139846[_0x80af('0x48')]);_0x139846[_0x80af('0x49')]=_0x35dd9d[_0x80af('0x23')]?_['last'](_0x35dd9d)[_0x80af('0x49')]+0x1:_0x445b14;_0x31691d=_[_0x80af('0x4a')](_0x31691d,_0x35dd9d,[_0x139846],_0x1efdf9);_0x445b14=_['last'](_0x31691d)[_0x80af('0x49')]+0x1;}return _0x2e0c05(_0x31691d);})[_0x80af('0x4b')](function(_0xa01510){_0x11b6de(_0xa01510);});});}return _0x20d9f0[_0x80af('0x4c')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x270002,_0x315747){var _0x19631b=this;var _0x1998bb=_0x19631b[_0x80af('0x5')]===_0x80af('0x10')?_0x23f75c(_0x19631b):_0x34b104(_0x19631b);return _0x359fab(_0x19631b,_0x270002,_[_0x80af('0x4d')](_0x1998bb)[_0x80af('0x49')]+0x1,_0x315747)[_0x80af('0x4e')](function(_0x784702){var _0x445401=_[_0x80af('0x4a')](_0x1998bb,_0x784702);_0x445401[_0x80af('0x1e')]({'type':_0x19631b[_0x80af('0x5')],'app':_0x80af('0x4f'),'exten':_0x19631b[_0x80af('0x6')],'context':_0x19631b[_0x80af('0xc')],'priority':_[_0x80af('0x4d')](_0x445401)[_0x80af('0x49')]+0x1,'VoiceExtensionId':_0x19631b['id']});return _0x445401;});}}});}; \ No newline at end of file +var _0x70e8=['CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','url','name','trunk','param','split','phone','prefix','${EXTEN:','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','length','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','last','concat','catch','define','VoiceExtension','voice_extensions','priority','util','./voiceExtension.attributes','exports','type','CDR(type)=','context','exten','alias','Set','NoOp','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','outbound','CDR(routeAlias)='];(function(_0x4c5ea6,_0x51eb14){var _0x482d99=function(_0x59f48c){while(--_0x59f48c){_0x4c5ea6['push'](_0x4c5ea6['shift']());}};_0x482d99(++_0x51eb14);}(_0x70e8,0x17b));var _0x870e=function(_0x5d1e76,_0x2d7965){_0x5d1e76=_0x5d1e76-0x0;var _0xce5f9c=_0x70e8[_0x5d1e76];return _0xce5f9c;};'use strict';var util=require(_0x870e('0x0'));var _=require('lodash');var attributes=require(_0x870e('0x1'));module[_0x870e('0x2')]=function(_0x2feb0b){var _0x396f8f=_0x2feb0b['models'];function _0x5e36a8(_0x27616c){var _0x2f99ee=0x2;var _0x3f6566=[{'type':_0x27616c[_0x870e('0x3')],'app':'Set','appdata':_0x870e('0x4')+_0x27616c[_0x870e('0x3')],'context':_0x27616c[_0x870e('0x5')],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']},{'type':_0x27616c[_0x870e('0x3')],'app':_0x27616c[_0x870e('0x7')]?_0x870e('0x8'):_0x870e('0x9'),'appdata':_0x27616c[_0x870e('0x7')]?'CDR(routeAlias)='+_0x27616c['alias']:'No\x20alias\x20set','context':_0x27616c[_0x870e('0x5')],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']}];if(_0x27616c['type']===_0x870e('0xa')){_0x3f6566[_0x870e('0xb')]({'type':'inbound','app':_0x870e('0x8'),'appdata':_0x870e('0xc')+_0x27616c['id'],'context':_0x27616c[_0x870e('0x5')],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']});}_0x3f6566[_0x870e('0xb')]({'type':_0x27616c[_0x870e('0x3')],'app':_0x870e('0x8'),'appdata':_0x870e('0xd'),'context':_0x27616c['context'],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']},{'type':_0x27616c[_0x870e('0x3')],'app':_0x870e('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x27616c['context'],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']},{'type':_0x27616c[_0x870e('0x3')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x27616c[_0x870e('0x5')],'exten':_0x27616c[_0x870e('0x6')],'priority':_0x2f99ee++,'VoiceExtensionId':_0x27616c['id']});return _0x3f6566;}function _0x345bb4(_0x4dbeda){var _0x3a66f3=0x2;var _0x3aee1e=[{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':'CDR(type)=outbound','context':_0x4dbeda['context'],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':'outbound','app':_0x4dbeda[_0x870e('0x7')]?'Set':_0x870e('0x9'),'appdata':_0x4dbeda[_0x870e('0x7')]?_0x870e('0xf')+_0x4dbeda['alias']:'No\x20alias\x20set','context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':'outbound','app':_0x870e('0x8'),'appdata':_0x870e('0x10')+(_0x4dbeda[_0x870e('0x11')]?'${EXTEN:'+_0x4dbeda[_0x870e('0x11')]+'}':'${EXTEN}'),'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda['exten'],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':_0x870e('0xc')+_0x4dbeda['id'],'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':'outbound','app':_0x870e('0x12'),'appdata':_0x870e('0x13')+(_0x3a66f3+0x2)+_0x870e('0x14')+(_0x3a66f3+0x1)+')','context':_0x4dbeda['context'],'exten':_0x4dbeda['exten'],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':_0x4dbeda['cutdigits']?_0x870e('0x15')+_0x4dbeda[_0x870e('0x11')]+'}':_0x870e('0x16'),'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':_0x870e('0xd'),'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':_0x870e('0x17'),'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':'outbound','app':'Set','appdata':_0x870e('0x18'),'context':_0x4dbeda['context'],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':'outbound','app':'Set','appdata':_0x870e('0x19')+_0x4dbeda['id'],'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']}];if(_0x4dbeda[_0x870e('0x1a')](_0x870e('0x1b'))&&_0x4dbeda[_0x870e('0x1b')]!==_0x870e('0x1c')){_0x3aee1e[_0x870e('0xb')]({'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']},{'type':_0x870e('0xe'),'app':_0x870e('0x8'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4dbeda[_0x870e('0x1b')]||_0x870e('0x1d'),'context':_0x4dbeda[_0x870e('0x5')],'exten':_0x4dbeda[_0x870e('0x6')],'priority':_0x3a66f3++,'VoiceExtensionId':_0x4dbeda['id']});}return _0x3aee1e;}function _0x5d24b7(_0x55ad06){var _0x149a9c=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x870e('0x1e'),'param':0x3}];var _0x38f052={};var _0x49f556=_0x55ad06['split'](',');var _0x40c5d0=[];for(var _0x51bb3e=0x0;_0x51bb3e<_0x149a9c['length'];_0x51bb3e++){switch(_0x149a9c[_0x51bb3e][_0x870e('0x1f')]){case _0x870e('0x20'):_0x38f052[_0x870e('0x20')]=_0x49f556[_0x149a9c[_0x51bb3e][_0x870e('0x21')]][_0x870e('0x22')]('/')[0x1];_0x38f052[_0x870e('0x23')]=_0x49f556[_0x149a9c[_0x51bb3e][_0x870e('0x21')]][_0x870e('0x22')]('/')[0x2];_0x38f052['prefix']=_0x38f052[_0x870e('0x23')]?_0x38f052['phone']['split']('$')[0x0]:undefined;_0x38f052[_0x870e('0x23')]=route['cutdigits']?(_0x38f052[_0x870e('0x24')]||'')+_0x870e('0x25')+route[_0x870e('0x11')]+'}':(_0x38f052[_0x870e('0x24')]||'')+_0x870e('0x26');_0x40c5d0[_0x149a9c[_0x51bb3e][_0x870e('0x21')]]=[_0x870e('0x27'),_0x38f052['trunk'],_0x38f052[_0x870e('0x23')]][_0x870e('0x28')]('/');break;case _0x870e('0x29'):_0x38f052[_0x870e('0x29')]=_0x49f556[_0x149a9c[_0x51bb3e]['param']];if(route[_0x870e('0x1b')]!==_0x870e('0x1c')){if(_0x38f052[_0x870e('0x29')][_0x870e('0x2a')](_0x870e('0x2b'))<0x0){_0x38f052[_0x870e('0x29')]+=_0x870e('0x2b');}}else{_0x38f052['options']=_0x38f052[_0x870e('0x29')][_0x870e('0x2c')](_0x870e('0x2b'),'');}_0x40c5d0[_0x149a9c[_0x51bb3e]['param']]=_0x38f052[_0x870e('0x29')];break;default:_0x40c5d0[_0x149a9c[_0x51bb3e]['param']]=_0x49f556[_0x149a9c[_0x51bb3e]['param']];}}return _0x40c5d0[_0x870e('0x28')](',');}function _0x2f86bf(_0x2a09c6,_0x3e71cd,_0x4afb5f,_0xbb799e){return new Promise(function(_0x546673,_0x4a2219){var _0x191e7f=[];if(_[_0x870e('0x2d')](_0x3e71cd))return _0x546673(_0x191e7f);_0x396f8f[_0x870e('0x2e')][_0x870e('0x2f')]({'attributes':['id',_0x870e('0x30'),_0x870e('0x31')],'raw':!![]})[_0x870e('0x32')](function(_0x3b45ff){for(var _0x25aa4e=0x0,_0x56d294=0x0;_0x25aa4e<_0x3e71cd['length'];_0x25aa4e++,_0x56d294=0x0){var _0x6d9b01=_0x3e71cd[_0x25aa4e];var _0x38a8ce=[];var _0x566304=[];if(_0x6d9b01[_0x870e('0x30')]!==_0x870e('0x33')){_0x6d9b01[_0x870e('0x34')]=[_0x6d9b01[_0x870e('0x30')]];}else{_0x6d9b01[_0x870e('0x34')]=_0x6d9b01[_0x870e('0x31')]?_['map'](_['filter'](_0x3b45ff,{'IntervalId':_0x6d9b01[_0x870e('0x31')]}),_0x870e('0x30')):[];}_0x6d9b01['context']=_0x2a09c6[_0x870e('0x5')];_0x6d9b01[_0x870e('0x6')]=_0x2a09c6[_0x870e('0x6')];if(_0x6d9b01[_0x870e('0x3')])_0x6d9b01['type']=_0x6d9b01[_0x870e('0x3')]['toLowerCase']();if(_0x2a09c6['type']==='outbound'){if(_0x6d9b01[_0x870e('0x1a')]('tag')&&_0x6d9b01[_0x870e('0x35')]&&_0x6d9b01[_0x870e('0x35')]!=='--'){_0x38a8ce[_0x870e('0xb')]({'type':_0x6d9b01[_0x870e('0x3')][_0x870e('0x36')](),'app':_0x870e('0x8'),'appdata':_0x870e('0x37')+_0x6d9b01['tag'],'context':_0x2a09c6[_0x870e('0x5')],'exten':_0x2a09c6['exten'],'priority':_0x6d9b01[_0x870e('0x34')]['length']+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});}_0x38a8ce[_0x870e('0xb')]({'type':_0x6d9b01[_0x870e('0x3')][_0x870e('0x36')](),'app':_0x870e('0x12'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x6d9b01[_0x870e('0x38')]?_0x870e('0x39')+_0x6d9b01[_0x870e('0x38')]+')':_0x870e('0x3a')),'context':_0x2a09c6[_0x870e('0x5')],'exten':_0x2a09c6[_0x870e('0x6')],'priority':_0x6d9b01[_0x870e('0x34')]['length']+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});}else{if(_0x6d9b01[_0x870e('0x1a')](_0x870e('0x3b'))){if(['queue',_0x870e('0x3c')][_0x870e('0x3d')](_0x6d9b01[_0x870e('0x3e')]['toLowerCase']())&&_0x6d9b01[_0x870e('0x3f')]!==_0x870e('0x40')){if(_0x6d9b01['answer']){_0x38a8ce[_0x870e('0xb')]({'type':_0x6d9b01[_0x870e('0x3')][_0x870e('0x36')](),'app':_0x870e('0x12'),'appdata':_0x870e('0x41'),'context':_0x2a09c6['context'],'exten':_0x2a09c6['exten'],'priority':_0x6d9b01[_0x870e('0x34')][_0x870e('0x42')]+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});_0x38a8ce['push']({'type':_0x6d9b01['type'][_0x870e('0x36')](),'app':_0x870e('0x8'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2a09c6[_0x870e('0x5')],'exten':_0x2a09c6[_0x870e('0x6')],'priority':_0x6d9b01[_0x870e('0x34')]['length']+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});}else{_0x38a8ce[_0x870e('0xb')]({'type':_0x6d9b01[_0x870e('0x3')][_0x870e('0x36')](),'app':_0x870e('0x12'),'appdata':_0x870e('0x43'),'context':_0x2a09c6[_0x870e('0x5')],'exten':_0x2a09c6[_0x870e('0x6')],'priority':_0x6d9b01['intervals'][_0x870e('0x42')]+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});_0x38a8ce[_0x870e('0xb')]({'type':_0x6d9b01['type'][_0x870e('0x36')](),'app':'Set','appdata':_0x870e('0x44'),'context':_0x2a09c6['context'],'exten':_0x2a09c6[_0x870e('0x6')],'priority':_0x6d9b01[_0x870e('0x34')][_0x870e('0x42')]+_0x4afb5f+_0x56d294++,'VoiceExtensionId':_0x2a09c6['id']});}}}}for(var _0x2effe7=0x0;_0x2effe7<_0x6d9b01[_0x870e('0x34')]['length'];_0x2effe7++){var _0x1b10ae=_0x4afb5f+_0x6d9b01[_0x870e('0x34')][_0x870e('0x42')];var _0x576366=_0x2effe7===_0x6d9b01[_0x870e('0x34')][_0x870e('0x42')]-0x1?_0x4afb5f+_0x38a8ce[_0x870e('0x42')]+_0x566304['length']+0x2:_0x4afb5f+_0x2effe7+0x1;_0x38a8ce[_0x870e('0x45')](_0x2effe7,0x0,{'type':_0x2a09c6[_0x870e('0x3')],'app':'GotoIfTime','appdata':_0x6d9b01['intervals'][_0x2effe7]+'?'+_0x2a09c6[_0x870e('0x5')]+',${EXTEN},'+_0x1b10ae+':'+_0x2a09c6[_0x870e('0x5')]+_0x870e('0x46')+_0x576366,'exten':_0x2a09c6[_0x870e('0x6')],'context':_0x2a09c6[_0x870e('0x5')],'priority':_0x4afb5f+_0x2effe7,'VoiceExtensionId':_0x2a09c6['id']});}if(_0xbb799e&&_0x6d9b01['appType']==='outboundDial')_0x6d9b01[_0x870e('0x47')]=_0x5d24b7(_0x6d9b01[_0x870e('0x47')]);_0x6d9b01['priority']=_0x38a8ce[_0x870e('0x42')]?_[_0x870e('0x48')](_0x38a8ce)['priority']+0x1:_0x4afb5f;_0x191e7f=_[_0x870e('0x49')](_0x191e7f,_0x38a8ce,[_0x6d9b01],_0x566304);_0x4afb5f=_['last'](_0x191e7f)['priority']+0x1;}return _0x546673(_0x191e7f);})[_0x870e('0x4a')](function(_0x2b2ce4){_0x4a2219(_0x2b2ce4);});});}return _0x2feb0b[_0x870e('0x4b')](_0x870e('0x4c'),attributes,{'tableName':_0x870e('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1a7e4e,_0x545778){var _0x505194=this;var _0x158e9b=_0x505194[_0x870e('0x3')]===_0x870e('0xe')?_0x345bb4(_0x505194):_0x5e36a8(_0x505194);return _0x2f86bf(_0x505194,_0x1a7e4e,_[_0x870e('0x48')](_0x158e9b)[_0x870e('0x4e')]+0x1,_0x545778)['then'](function(_0x1909b0){var _0x275d66=_[_0x870e('0x49')](_0x158e9b,_0x1909b0);_0x275d66[_0x870e('0xb')]({'type':_0x505194['type'],'app':'Hangup','exten':_0x505194[_0x870e('0x6')],'context':_0x505194[_0x870e('0x5')],'priority':_[_0x870e('0x48')](_0x275d66)['priority']+0x1,'VoiceExtensionId':_0x505194['id']});return _0x275d66;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d99a57c..4001ff4 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 _0x0958=['http','redis','defaults','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','include','map','model','info','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var moment=require(_0x8095('0x2'));var BPromise=require('bluebird');var rs=require(_0x8095('0x3'));var fs=require('fs');var Redis=require(_0x8095('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8095('0x5'))(_0x8095('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8095('0x7')][_0x8095('0x8')]({'port':0x232a});config[_0x8095('0x9')]=_[_0x8095('0xa')](config[_0x8095('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8095('0x9')]));require(_0x8095('0xb'))['register'](socket);function respondWithRpcPromise(_0x54ce4f,_0x333df1,_0x4e4a06){return new BPromise(function(_0xa11cd4,_0x2c94a3){return client[_0x8095('0xc')](_0x54ce4f,_0x4e4a06)[_0x8095('0xd')](function(_0x1f8609){logger['info'](_0x8095('0xe'),_0x333df1,'request\x20sent');logger[_0x8095('0xf')](_0x8095('0x10'),_0x333df1,_0x8095('0x11'),JSON[_0x8095('0x12')](_0x1f8609));if(_0x1f8609[_0x8095('0x13')]){if(_0x1f8609[_0x8095('0x13')]['code']===0x1f4){logger[_0x8095('0x13')](_0x8095('0xe'),_0x333df1,_0x1f8609[_0x8095('0x13')]['message']);return _0x2c94a3(_0x1f8609[_0x8095('0x13')][_0x8095('0x14')]);}logger[_0x8095('0x13')](_0x8095('0xe'),_0x333df1,_0x1f8609[_0x8095('0x13')]['message']);return _0xa11cd4(_0x1f8609[_0x8095('0x13')][_0x8095('0x14')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x333df1,_0x8095('0x11'));_0xa11cd4(_0x1f8609['result'][_0x8095('0x14')]);}})[_0x8095('0x15')](function(_0x1bcdf1){logger['error'](_0x8095('0xe'),_0x333df1,_0x1bcdf1);_0x2c94a3(_0x1bcdf1);});});}exports[_0x8095('0x16')]=function(_0x220b38){var _0x589289=this;return new Promise(function(_0x160e67,_0x104cc4){return db[_0x8095('0x17')]['findAll']({'raw':_0x220b38[_0x8095('0x18')]?_0x220b38['options'][_0x8095('0x19')]===undefined?!![]:![]:!![],'where':_0x220b38[_0x8095('0x18')]?_0x220b38[_0x8095('0x18')][_0x8095('0x1a')]||null:null,'attributes':_0x220b38[_0x8095('0x18')]?_0x220b38[_0x8095('0x18')][_0x8095('0x1b')]||null:null,'limit':_0x220b38[_0x8095('0x18')]?_0x220b38[_0x8095('0x18')][_0x8095('0x1c')]||null:null,'include':_0x220b38[_0x8095('0x18')]?_0x220b38[_0x8095('0x18')][_0x8095('0x1d')]?_[_0x8095('0x1e')](_0x220b38['options']['include'],function(_0x1b2939){return{'model':db[_0x1b2939[_0x8095('0x1f')]],'as':_0x1b2939['as'],'attributes':_0x1b2939[_0x8095('0x1b')],'include':_0x1b2939[_0x8095('0x1d')]?_[_0x8095('0x1e')](_0x1b2939[_0x8095('0x1d')],function(_0x320f4f){return{'model':db[_0x320f4f[_0x8095('0x1f')]],'as':_0x320f4f['as'],'attributes':_0x320f4f[_0x8095('0x1b')],'include':_0x320f4f[_0x8095('0x1d')]?_[_0x8095('0x1e')](_0x320f4f[_0x8095('0x1d')],function(_0x223ade){return{'model':db[_0x223ade[_0x8095('0x1f')]],'as':_0x223ade['as'],'attributes':_0x223ade[_0x8095('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8095('0xd')](function(_0x38d69e){logger[_0x8095('0x20')]('GetVoiceExtension',_0x220b38);logger[_0x8095('0xf')](_0x8095('0x16'),_0x220b38,JSON[_0x8095('0x12')](_0x38d69e));_0x160e67(_0x38d69e);})[_0x8095('0x15')](function(_0x21c8e8){logger[_0x8095('0x13')](_0x8095('0x16'),_0x21c8e8['message'],_0x220b38);_0x104cc4(_0x589289['error'](0x1f4,_0x21c8e8['message']));});});}; \ No newline at end of file +var _0xfd2e=['model','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map'];(function(_0x452407,_0x436afc){var _0x2f7799=function(_0xb30176){while(--_0xb30176){_0x452407['push'](_0x452407['shift']());}};_0x2f7799(++_0x436afc);}(_0xfd2e,0x6e));var _0xefd2=function(_0x3c9d26,_0x384c54){_0x3c9d26=_0x3c9d26-0x0;var _0x3e5cb5=_0xfd2e[_0x3c9d26];return _0x3e5cb5;};'use strict';var _=require(_0xefd2('0x0'));var util=require('util');var moment=require(_0xefd2('0x1'));var BPromise=require('bluebird');var rs=require(_0xefd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefd2('0x3'))['db'];var utils=require(_0xefd2('0x4'));var logger=require(_0xefd2('0x5'))(_0xefd2('0x6'));var config=require(_0xefd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefd2('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xefd2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xefd2('0xa'))(new Redis(config[_0xefd2('0x9')]));require(_0xefd2('0xb'))[_0xefd2('0xc')](socket);function respondWithRpcPromise(_0xa787ba,_0x2d7d0d,_0x602f0){return new BPromise(function(_0x490a6d,_0x2d8eff){return client[_0xefd2('0xd')](_0xa787ba,_0x602f0)[_0xefd2('0xe')](function(_0x14de17){logger[_0xefd2('0xf')](_0xefd2('0x10'),_0x2d7d0d,_0xefd2('0x11'));logger[_0xefd2('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2d7d0d,'request\x20sent',JSON[_0xefd2('0x13')](_0x14de17));if(_0x14de17['error']){if(_0x14de17['error'][_0xefd2('0x14')]===0x1f4){logger[_0xefd2('0x15')](_0xefd2('0x10'),_0x2d7d0d,_0x14de17[_0xefd2('0x15')][_0xefd2('0x16')]);return _0x2d8eff(_0x14de17['error'][_0xefd2('0x16')]);}logger[_0xefd2('0x15')](_0xefd2('0x10'),_0x2d7d0d,_0x14de17[_0xefd2('0x15')][_0xefd2('0x16')]);return _0x490a6d(_0x14de17[_0xefd2('0x15')]['message']);}else{logger['info'](_0xefd2('0x10'),_0x2d7d0d,_0xefd2('0x11'));_0x490a6d(_0x14de17[_0xefd2('0x17')][_0xefd2('0x16')]);}})[_0xefd2('0x18')](function(_0x5080a8){logger[_0xefd2('0x15')](_0xefd2('0x10'),_0x2d7d0d,_0x5080a8);_0x2d8eff(_0x5080a8);});});}exports[_0xefd2('0x19')]=function(_0x11baea){var _0x4d2e38=this;return new Promise(function(_0x115ad8,_0x387398){return db[_0xefd2('0x1a')][_0xefd2('0x1b')]({'raw':_0x11baea['options']?_0x11baea[_0xefd2('0x1c')][_0xefd2('0x1d')]===undefined?!![]:![]:!![],'where':_0x11baea[_0xefd2('0x1c')]?_0x11baea[_0xefd2('0x1c')][_0xefd2('0x1e')]||null:null,'attributes':_0x11baea[_0xefd2('0x1c')]?_0x11baea[_0xefd2('0x1c')]['attributes']||null:null,'limit':_0x11baea['options']?_0x11baea[_0xefd2('0x1c')][_0xefd2('0x1f')]||null:null,'include':_0x11baea[_0xefd2('0x1c')]?_0x11baea[_0xefd2('0x1c')][_0xefd2('0x20')]?_[_0xefd2('0x21')](_0x11baea[_0xefd2('0x1c')][_0xefd2('0x20')],function(_0x159a53){return{'model':db[_0x159a53[_0xefd2('0x22')]],'as':_0x159a53['as'],'attributes':_0x159a53[_0xefd2('0x23')],'include':_0x159a53['include']?_[_0xefd2('0x21')](_0x159a53[_0xefd2('0x20')],function(_0x127e4f){return{'model':db[_0x127e4f[_0xefd2('0x22')]],'as':_0x127e4f['as'],'attributes':_0x127e4f[_0xefd2('0x23')],'include':_0x127e4f[_0xefd2('0x20')]?_[_0xefd2('0x21')](_0x127e4f['include'],function(_0x386ee1){return{'model':db[_0x386ee1[_0xefd2('0x22')]],'as':_0x386ee1['as'],'attributes':_0x386ee1[_0xefd2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xefd2('0xe')](function(_0x168a43){logger['info'](_0xefd2('0x19'),_0x11baea);logger[_0xefd2('0x12')]('GetVoiceExtension',_0x11baea,JSON[_0xefd2('0x13')](_0x168a43));_0x115ad8(_0x168a43);})[_0xefd2('0x18')](function(_0x1f16a1){logger[_0xefd2('0x15')](_0xefd2('0x19'),_0x1f16a1[_0xefd2('0x16')],_0x11baea);_0x387398(_0x4d2e38[_0xefd2('0x15')](0x1f4,_0x1f16a1[_0xefd2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4ef6c52..940e27a 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(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x814b,0x1a2));var _0xb814=function(_0x512e72,_0x49ffe1){_0x512e72=_0x512e72-0x0;var _0x143086=_0x814b[_0x512e72];return _0x143086;};'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(_0x56fbae,_0x459d21){var _0x42dbea=function(_0x2a44f9){while(--_0x2a44f9){_0x56fbae['push'](_0x56fbae['shift']());}};_0x42dbea(++_0x459d21);}(_0x326f,0xd1));var _0xf326=function(_0x45a44e,_0x1dbdca){_0x45a44e=_0x45a44e-0x0;var _0x1a3042=_0x326f[_0x45a44e];return _0x1a3042;};'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 a01572a..6410566 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 _0xe2fe=['show','/:id/messages','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x41f2f5,_0x14f33c){var _0x3d49f1=function(_0x300207){while(--_0x300207){_0x41f2f5['push'](_0x41f2f5['shift']());}};_0x3d49f1(++_0x14f33c);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./voiceMail.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['getMessages']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file +var _0x6455=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller'];(function(_0x44ae84,_0x304dca){var _0x4c6935=function(_0x16bb09){while(--_0x16bb09){_0x44ae84['push'](_0x44ae84['shift']());}};_0x4c6935(++_0x304dca);}(_0x6455,0x97));var _0x5645=function(_0x1db1ba,_0x250dfe){_0x1db1ba=_0x1db1ba-0x0;var _0x34aacc=_0x6455[_0x1db1ba];return _0x34aacc;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['show']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0xf')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0x10')]);router['put'](_0x5645('0xc'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router[_0x5645('0x12')]('/:id',auth[_0x5645('0xa')](),controller['destroy']);module[_0x5645('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 58ff086..5eb9579 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 _0x9690=['yes','ENUM','TINYINT(4)','INTEGER','getDataValue','\x20-\x20','mailbox','STRING','contest_mailbox','setDataValue','email','trim'];(function(_0x231438,_0x431b0e){var _0x3c8759=function(_0x4ff40c){while(--_0x4ff40c){_0x231438['push'](_0x231438['shift']());}};_0x3c8759(++_0x431b0e);}(_0x9690,0xeb));var _0x0969=function(_0x3e59de,_0x51d45b){_0x3e59de=_0x3e59de-0x0;var _0x1fc6ca=_0x9690[_0x3e59de];return _0x1fc6ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x0969('0x0')]},'context':{'type':Sequelize[_0x0969('0x0')],'defaultValue':'from-voicemail','unique':_0x0969('0x1')},'mailbox':{'type':Sequelize[_0x0969('0x0')],'defaultValue':'','allowNull':![],'unique':_0x0969('0x1')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0969('0x0')],'validate':{'isEmail':!![]},'set':function(_0x15123){this[_0x0969('0x2')](_0x0969('0x3'),typeof _0x15123==='string'&&_0x15123[_0x0969('0x4')]()?_0x15123[_0x0969('0x4')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x0969('0x5'),'no'),'defaultValue':_0x0969('0x5'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':_0x0969('0x5'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0969('0x0')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x0969('0x5'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0969('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0969('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0969('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':_0x0969('0x5'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0969('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0969('0x6')](_0x0969('0x5'),'no'),'defaultValue':_0x0969('0x5'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x0969('0x0')]},'emailbody':{'type':Sequelize[_0x0969('0x0')]},'maxsecs':{'type':Sequelize[_0x0969('0x8')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0969('0x8')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0969('0x9')]('fullname')+_0x0969('0xa')+this['getDataValue'](_0x0969('0xb'));}}}; \ No newline at end of file +var _0xc27b=['exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x24cfda,_0x1dc752){var _0xe3b3df=function(_0x36c32f){while(--_0x36c32f){_0x24cfda['push'](_0x24cfda['shift']());}};_0xe3b3df(++_0x1dc752);}(_0xc27b,0x155));var _0xbc27=function(_0x9383b7,_0x5371ac){_0x9383b7=_0x9383b7-0x0;var _0x3b587b=_0xc27b[_0x9383b7];return _0x3b587b;};'use strict';var Sequelize=require(_0xbc27('0x0'));module[_0xbc27('0x1')]={'customer_id':{'type':Sequelize[_0xbc27('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xbc27('0x3'),'unique':_0xbc27('0x4')},'mailbox':{'type':Sequelize[_0xbc27('0x2')],'defaultValue':'','allowNull':![],'unique':_0xbc27('0x4')},'password':{'type':Sequelize[_0xbc27('0x2')]},'fullname':{'type':Sequelize[_0xbc27('0x2')]},'email':{'type':Sequelize[_0xbc27('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2727a4){this['setDataValue'](_0xbc27('0x5'),typeof _0x2727a4===_0xbc27('0x6')&&_0x2727a4[_0xbc27('0x7')]()?_0x2727a4['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xbc27('0x2')],'defaultValue':_0xbc27('0x8')},'attach':{'type':Sequelize[_0xbc27('0x9')]('yes','no'),'defaultValue':_0xbc27('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xbc27('0x9')]('yes','no'),'defaultValue':_0xbc27('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xbc27('0x2')]},'callback':{'type':Sequelize[_0xbc27('0x2')]},'review':{'type':Sequelize[_0xbc27('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xbc27('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbc27('0x9')](_0xbc27('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbc27('0x9')](_0xbc27('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbc27('0x9')](_0xbc27('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xbc27('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xbc27('0x9')](_0xbc27('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xbc27('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbc27('0x9')](_0xbc27('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xbc27('0xb')},'emailsubject':{'type':Sequelize[_0xbc27('0x2')]},'emailbody':{'type':Sequelize[_0xbc27('0x2')]},'maxsecs':{'type':Sequelize[_0xbc27('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbc27('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xbc27('0xd')],'get':function(){return this['getDataValue'](_0xbc27('0xe'))+_0xbc27('0xf')+this[_0xbc27('0x10')](_0xbc27('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8cc5ac1..89cebe4 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 _0x2f68=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','destroy','getMessages','findOne','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel'];(function(_0x42e341,_0xc4bae8){var _0x3b4b1a=function(_0x37efb9){while(--_0x37efb9){_0x42e341['push'](_0x42e341['shift']());}};_0x3b4b1a(++_0xc4bae8);}(_0x2f68,0x9a));var _0x82f6=function(_0x32c4e2,_0x99108d){_0x32c4e2=_0x32c4e2-0x0;var _0x45977f=_0x2f68[_0x32c4e2];return _0x45977f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];function respondWithStatusCode(_0x442262,_0x4cc967){_0x4cc967=_0x4cc967||0xcc;return function(_0x194da7){if(_0x194da7){return _0x442262[_0x82f6('0x15')](_0x4cc967);}return _0x442262[_0x82f6('0x16')](_0x4cc967)[_0x82f6('0x17')]();};}function respondWithResult(_0x371481,_0xa00275){_0xa00275=_0xa00275||0xc8;return function(_0x115c7b){if(_0x115c7b){return _0x371481[_0x82f6('0x16')](_0xa00275)[_0x82f6('0x18')](_0x115c7b);}};}function respondWithFilteredResult(_0x55b58e,_0x389949){return function(_0x5d0827){if(_0x5d0827){var _0x249222=typeof _0x389949[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x389949[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x2326ae=_0x5d0827[_0x82f6('0x1c')];var _0xcbc95f=_0x249222?0x0:_0x389949[_0x82f6('0x19')];var _0x2bfd57=_0x249222?_0x5d0827[_0x82f6('0x1c')]:_0x389949[_0x82f6('0x19')]+_0x389949[_0x82f6('0x1b')];var _0x4fe226;if(_0x2bfd57>=_0x2326ae){_0x2bfd57=_0x2326ae;_0x4fe226=0xc8;}else{_0x4fe226=0xce;}_0x55b58e[_0x82f6('0x16')](_0x4fe226);return _0x55b58e['set'](_0x82f6('0x1d'),_0xcbc95f+'-'+_0x2bfd57+'/'+_0x2326ae)[_0x82f6('0x18')](_0x5d0827);}return null;};}function patchUpdates(_0x55cbce){return function(_0x2b03ad){try{jsonpatch[_0x82f6('0x1e')](_0x2b03ad,_0x55cbce,!![]);}catch(_0x46713a){return BPromise[_0x82f6('0x1f')](_0x46713a);}return _0x2b03ad['save']();};}function saveUpdates(_0xdc4dea,_0x4beccf){return function(_0x8668bb){if(_0x8668bb){return _0x8668bb[_0x82f6('0x20')](_0xdc4dea)['then'](function(_0x516deb){return _0x516deb;});}return null;};}function removeEntity(_0x3af5f7,_0x1d96d5){return function(_0x4c57c5){if(_0x4c57c5){return _0x4c57c5['destroy']()[_0x82f6('0x21')](function(){var _0x31face=_0x4c57c5['get']({'plain':!![]});var _0xfd8b68=_0x82f6('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd8b68,'resourceId':_0x31face['id']}})[_0x82f6('0x21')](function(){return _0x4c57c5;});})['then'](function(){_0x3af5f7[_0x82f6('0x16')](0xcc)[_0x82f6('0x17')]();});}};}function handleEntityNotFound(_0x54ce11,_0x3795ef){return function(_0x15c9b7){if(!_0x15c9b7){_0x54ce11[_0x82f6('0x15')](0x194);}return _0x15c9b7;};}function handleError(_0x1125a0,_0x4f9fa4){_0x4f9fa4=_0x4f9fa4||0x1f4;return function(_0x40a071){logger[_0x82f6('0x23')](_0x40a071[_0x82f6('0x24')]);if(_0x40a071[_0x82f6('0x25')]){delete _0x40a071[_0x82f6('0x25')];}_0x1125a0[_0x82f6('0x16')](_0x4f9fa4)[_0x82f6('0x26')](_0x40a071);};}exports[_0x82f6('0x27')]=function(_0x1e1aa4,_0x402449){var _0x3c9419={},_0x20d1c5={},_0x6ce179={'count':0x0,'rows':[]};var _0x91117b=_['map'](db[_0x82f6('0x28')][_0x82f6('0x29')],function(_0x418f34){return{'name':_0x418f34['fieldName'],'type':_0x418f34[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x20d1c5[_0x82f6('0x2c')]=_[_0x82f6('0x2d')](_0x91117b,_0x82f6('0x25'));_0x20d1c5[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x1e1aa4[_0x82f6('0x2e')]);_0x20d1c5[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x20d1c5[_0x82f6('0x2c')],_0x20d1c5[_0x82f6('0x2e')]);_0x3c9419[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x20d1c5['model'],qs[_0x82f6('0x33')](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x3c9419[_0x82f6('0x32')]=_0x3c9419[_0x82f6('0x32')][_0x82f6('0x34')]?_0x3c9419[_0x82f6('0x32')]:_0x20d1c5[_0x82f6('0x2c')];if(!_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x3c9419[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1e1aa4[_0x82f6('0x2e')]['limit']);_0x3c9419[_0x82f6('0x19')]=qs['offset'](_0x1e1aa4['query'][_0x82f6('0x19')]);}_0x3c9419[_0x82f6('0x37')]=qs['sort'](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x3c9419[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x3a')](_0x1e1aa4['query'],_0x20d1c5[_0x82f6('0x30')]),_0x91117b);if(_0x1e1aa4['query'][_0x82f6('0x3b')]){_0x3c9419['where']=_[_0x82f6('0x3c')](_0x3c9419[_0x82f6('0x39')],{'$or':_['map'](_0x91117b,function(_0xfce1dd){if(_0xfce1dd[_0x82f6('0x2a')]!==_0x82f6('0x3d')){var _0x43dcd1={};_0x43dcd1[_0xfce1dd['name']]={'$like':'%'+_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0x43dcd1;}})});}_0x3c9419=_[_0x82f6('0x3c')]({},_0x3c9419,_0x1e1aa4[_0x82f6('0x3e')]);var _0x55ecd4={'where':_0x3c9419[_0x82f6('0x39')]};return db[_0x82f6('0x28')]['count'](_0x55ecd4)[_0x82f6('0x21')](function(_0x699803){_0x6ce179[_0x82f6('0x1c')]=_0x699803;if(_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3f')]){_0x3c9419['include']=[{'all':!![]}];}return db[_0x82f6('0x28')]['findAll'](_0x3c9419);})[_0x82f6('0x21')](function(_0x38e82d){_0x6ce179[_0x82f6('0x40')]=_0x38e82d;return _0x6ce179;})[_0x82f6('0x21')](respondWithFilteredResult(_0x402449,_0x3c9419))[_0x82f6('0x41')](handleError(_0x402449,null));};exports[_0x82f6('0x42')]=function(_0x43fefc,_0x47a0d1){var _0x165493={'raw':!![],'where':{'id':_0x43fefc[_0x82f6('0x43')]['id']}},_0x297cda={};_0x297cda[_0x82f6('0x2c')]=_['keys'](db[_0x82f6('0x28')]['rawAttributes']);_0x297cda[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x43fefc[_0x82f6('0x2e')]);_0x297cda[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],_0x297cda['query']);_0x165493[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],qs[_0x82f6('0x33')](_0x43fefc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x165493[_0x82f6('0x32')]=_0x165493[_0x82f6('0x32')]['length']?_0x165493[_0x82f6('0x32')]:_0x297cda[_0x82f6('0x2c')];if(_0x43fefc['query'][_0x82f6('0x3f')]){_0x165493['include']=[{'all':!![]}];}_0x165493=_[_0x82f6('0x3c')]({},_0x165493,_0x43fefc['options']);return db[_0x82f6('0x28')][_0x82f6('0x44')](_0x165493)[_0x82f6('0x21')](handleEntityNotFound(_0x47a0d1,null))[_0x82f6('0x21')](respondWithResult(_0x47a0d1,null))[_0x82f6('0x41')](handleError(_0x47a0d1,null));};exports[_0x82f6('0x45')]=function(_0x53f7d4,_0x3cb1f0){return db[_0x82f6('0x28')]['create'](_0x53f7d4['body'],{})[_0x82f6('0x21')](function(_0x2a6366){var _0x2c2b64=_0x53f7d4['user'][_0x82f6('0x46')]({'plain':!![]});if(!_0x2c2b64)throw new Error(_0x82f6('0x47'));if(_0x2c2b64[_0x82f6('0x48')]===_0x82f6('0x49')){var _0x4e9e13=_0x2a6366['get']({'plain':!![]});var _0x1695ea=_0x82f6('0x22');return db[_0x82f6('0x4a')]['find']({'where':{'name':_0x1695ea,'userProfileId':_0x2c2b64[_0x82f6('0x4b')]},'raw':!![]})[_0x82f6('0x21')](function(_0x4bc646){if(_0x4bc646&&_0x4bc646['autoAssociation']===0x0){return db['UserProfileResource'][_0x82f6('0x45')]({'name':_0x4e9e13['name'],'resourceId':_0x4e9e13['id'],'type':_0x4bc646[_0x82f6('0x25')],'sectionId':_0x4bc646['id']},{})['then'](function(){return _0x2a6366;});}else{return _0x2a6366;}})[_0x82f6('0x41')](function(_0x4f69de){logger[_0x82f6('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f69de);throw _0x4f69de;});}return _0x2a6366;})[_0x82f6('0x21')](respondWithResult(_0x3cb1f0,0xc9))[_0x82f6('0x41')](handleError(_0x3cb1f0,null));};exports[_0x82f6('0x20')]=function(_0x1633cf,_0xb8d7d8){if(_0x1633cf[_0x82f6('0x4c')]['id']){delete _0x1633cf['body']['id'];}return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x1633cf[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0xb8d7d8,null))['then'](saveUpdates(_0x1633cf[_0x82f6('0x4c')],null))[_0x82f6('0x21')](respondWithResult(_0xb8d7d8,null))[_0x82f6('0x41')](handleError(_0xb8d7d8,null));};exports[_0x82f6('0x4d')]=function(_0x49a204,_0x2c1c0e){return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x49a204['params']['id']}})['then'](handleEntityNotFound(_0x2c1c0e,null))['then'](removeEntity(_0x2c1c0e,null))[_0x82f6('0x41')](handleError(_0x2c1c0e,null));};exports[_0x82f6('0x4e')]=function(_0x221cfc,_0x59176d,_0x4013f0){return db[_0x82f6('0x28')][_0x82f6('0x4f')]({'where':{'id':_0x221cfc[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0x59176d,null))[_0x82f6('0x21')](function(_0x94aed4){var _0x12a5b9;var _0x33591b={},_0x4a8bdb={};_0x4a8bdb['model']=_[_0x82f6('0x2f')](db[_0x82f6('0x50')]['rawAttributes']);_0x4a8bdb[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x221cfc[_0x82f6('0x2e')]);_0x4a8bdb['filters']=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],_0x4a8bdb[_0x82f6('0x2e')]);_0x33591b[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],qs['fields'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x33591b[_0x82f6('0x32')]=_0x33591b[_0x82f6('0x32')][_0x82f6('0x34')]?_0x33591b['attributes']:_0x4a8bdb[_0x82f6('0x2c')];if(!_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x33591b[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x1b')]);_0x33591b['offset']=qs[_0x82f6('0x19')](_0x221cfc['query'][_0x82f6('0x19')]);}_0x33591b[_0x82f6('0x37')]=qs['sort'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x33591b[_0x82f6('0x39')]=qs['filters'](_['pick'](_0x221cfc[_0x82f6('0x2e')],_0x4a8bdb[_0x82f6('0x30')]));if(_0x221cfc['query']['filter']){_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'$or':_[_0x82f6('0x2d')](_0x33591b[_0x82f6('0x32')],function(_0x11581c){var _0xc1d784={};_0xc1d784[_0x11581c]={'$like':'%'+_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0xc1d784;})});}_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'mailboxuser':_0x94aed4['mailbox']});_0x33591b=_[_0x82f6('0x3c')]({},_0x33591b,_0x221cfc[_0x82f6('0x3e')]);return db[_0x82f6('0x50')][_0x82f6('0x51')](_0x33591b)[_0x82f6('0x21')](respondWithFilteredResult(_0x59176d,_0x33591b));})['catch'](handleError(_0x59176d,null));}; \ No newline at end of file +var _0xb10b=['attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','merge','options','VoiceMail','include','findAll','rows','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','get','end','error','stack','name','send','map','fieldName','key','model','query','keys','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0xc59d5d,_0x5a6b47){_0xc59d5d=_0xc59d5d-0x0;var _0x3771b1=_0xb10b[_0xc59d5d];return _0x3771b1;};'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(){var _0x3ba6cd=_0x436104[_0xbb10('0x25')]({'plain':!![]});var _0x537898='Voicemails';return db['UserProfileResource'][_0xbb10('0x24')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x23')](function(){return _0x436104;});})[_0xbb10('0x23')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x18')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x27')](_0x4aabb9[_0xbb10('0x28')]);if(_0x4aabb9[_0xbb10('0x29')]){delete _0x4aabb9[_0xbb10('0x29')];}_0x20d946[_0xbb10('0x19')](_0x2a0e8b)[_0xbb10('0x2a')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=_[_0xbb10('0x2b')](db['VoiceMail']['rawAttributes'],function(_0x4c3744){return{'name':_0x4c3744[_0xbb10('0x2c')],'type':_0x4c3744['type'][_0xbb10('0x2d')]};});_0x56f2da[_0xbb10('0x2e')]=_[_0xbb10('0x2b')](_0x1dcc9c,_0xbb10('0x29'));_0x56f2da[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x221624[_0xbb10('0x2f')]);_0x56f2da['filters']=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],_0x56f2da[_0xbb10('0x2f')]);_0x448d5c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x448d5c['attributes']=_0x448d5c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x448d5c[_0xbb10('0x32')]:_0x56f2da[_0xbb10('0x2e')];if(!_0x221624['query'][_0xbb10('0x35')]('nolimit')){_0x448d5c['limit']=qs[_0xbb10('0x1c')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x1c')]);_0x448d5c[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x221624[_0xbb10('0x2f')]['offset']);}_0x448d5c[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x221624['query']['sort']);_0x448d5c['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x221624[_0xbb10('0x2f')],_0x56f2da['filters']),_0x1dcc9c);if(_0x221624[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x448d5c[_0xbb10('0x3b')]=_['merge'](_0x448d5c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x1dcc9c,function(_0x1dcd38){if(_0x1dcd38[_0xbb10('0x3c')]!=='VIRTUAL'){var _0xd238e9={};_0xd238e9[_0x1dcd38[_0xbb10('0x29')]]={'$like':'%'+_0x221624['query'][_0xbb10('0x3a')]+'%'};return _0xd238e9;}})});}_0x448d5c=_[_0xbb10('0x3d')]({},_0x448d5c,_0x221624[_0xbb10('0x3e')]);var _0x3a9934={'where':_0x448d5c[_0xbb10('0x3b')]};return db[_0xbb10('0x3f')]['count'](_0x3a9934)[_0xbb10('0x23')](function(_0x1c7fae){_0x16ad2a[_0xbb10('0x1e')]=_0x1c7fae;if(_0x221624[_0xbb10('0x2f')]['includeAll']){_0x448d5c[_0xbb10('0x40')]=[{'all':!![]}];}return db[_0xbb10('0x3f')][_0xbb10('0x41')](_0x448d5c);})[_0xbb10('0x23')](function(_0x5e2cfa){_0x16ad2a[_0xbb10('0x42')]=_0x5e2cfa;return _0x16ad2a;})[_0xbb10('0x23')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))['catch'](handleError(_0x4ee02e,null));};exports['show']=function(_0x38d78f,_0x4a3ddf){var _0x318984={'raw':!![],'where':{'id':_0x38d78f['params']['id']}},_0x180933={};_0x180933[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x3f')]['rawAttributes']);_0x180933[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x38d78f[_0xbb10('0x2f')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],_0x180933[_0xbb10('0x2f')]);_0x318984[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x38d78f[_0xbb10('0x2f')]['fields']));_0x318984[_0xbb10('0x32')]=_0x318984[_0xbb10('0x32')]['length']?_0x318984[_0xbb10('0x32')]:_0x180933[_0xbb10('0x2e')];if(_0x38d78f[_0xbb10('0x2f')][_0xbb10('0x43')]){_0x318984[_0xbb10('0x40')]=[{'all':!![]}];}_0x318984=_[_0xbb10('0x3d')]({},_0x318984,_0x38d78f[_0xbb10('0x3e')]);return db['VoiceMail']['find'](_0x318984)[_0xbb10('0x23')](handleEntityNotFound(_0x4a3ddf,null))[_0xbb10('0x23')](respondWithResult(_0x4a3ddf,null))[_0xbb10('0x44')](handleError(_0x4a3ddf,null));};exports['create']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x3f')][_0xbb10('0x45')](_0x5f0c12[_0xbb10('0x46')],{})[_0xbb10('0x23')](function(_0x22b315){var _0x2f2552=_0x5f0c12[_0xbb10('0x47')][_0xbb10('0x25')]({'plain':!![]});if(!_0x2f2552)throw new Error(_0xbb10('0x48'));if(_0x2f2552['role']==='user'){var _0x412e13=_0x22b315[_0xbb10('0x25')]({'plain':!![]});var _0x36ab7d=_0xbb10('0x49');return db[_0xbb10('0x4a')][_0xbb10('0x4b')]({'where':{'name':_0x36ab7d,'userProfileId':_0x2f2552[_0xbb10('0x4c')]},'raw':!![]})[_0xbb10('0x23')](function(_0x1c0d8f){if(_0x1c0d8f&&_0x1c0d8f[_0xbb10('0x4d')]===0x0){return db[_0xbb10('0x4e')][_0xbb10('0x45')]({'name':_0x412e13[_0xbb10('0x29')],'resourceId':_0x412e13['id'],'type':_0x1c0d8f[_0xbb10('0x29')],'sectionId':_0x1c0d8f['id']},{})[_0xbb10('0x23')](function(){return _0x22b315;});}else{return _0x22b315;}})['catch'](function(_0x124052){logger['error'](_0xbb10('0x4f'),_0x124052);throw _0x124052;});}return _0x22b315;})[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,0xc9))[_0xbb10('0x44')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x22')]=function(_0x26e66e,_0x32d8e9){if(_0x26e66e[_0xbb10('0x46')]['id']){delete _0x26e66e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x26e66e[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x23')](saveUpdates(_0x26e66e[_0xbb10('0x46')],null))[_0xbb10('0x23')](respondWithResult(_0x32d8e9,null))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x24')]=function(_0x466eb7,_0x1b83a9){return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x466eb7[_0xbb10('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b83a9,null))[_0xbb10('0x23')](removeEntity(_0x1b83a9,null))[_0xbb10('0x44')](handleError(_0x1b83a9,null));};exports[_0xbb10('0x51')]=function(_0x14fed3,_0x432728,_0x22de7f){return db[_0xbb10('0x3f')][_0xbb10('0x52')]({'where':{'id':_0x14fed3[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x432728,null))[_0xbb10('0x23')](function(_0x2a1ce1){var _0x16932f;var _0x4e7fac={},_0x4ea1a6={};_0x4ea1a6[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x53')][_0xbb10('0x54')]);_0x4ea1a6['query']=_['keys'](_0x14fed3[_0xbb10('0x2f')]);_0x4ea1a6[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x4ea1a6[_0xbb10('0x2e')],_0x4ea1a6[_0xbb10('0x2f')]);_0x4e7fac[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x4ea1a6['model'],qs[_0xbb10('0x33')](_0x14fed3[_0xbb10('0x2f')]['fields']));_0x4e7fac['attributes']=_0x4e7fac['attributes'][_0xbb10('0x34')]?_0x4e7fac[_0xbb10('0x32')]:_0x4ea1a6[_0xbb10('0x2e')];if(!_0x14fed3['query']['hasOwnProperty']('nolimit')){_0x4e7fac[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x14fed3[_0xbb10('0x2f')]['limit']);_0x4e7fac[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x14fed3['query']['offset']);}_0x4e7fac[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x37')]);_0x4e7fac['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x14fed3[_0xbb10('0x2f')],_0x4ea1a6['filters']));if(_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x4e7fac[_0xbb10('0x3b')]=_['merge'](_0x4e7fac[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x4e7fac[_0xbb10('0x32')],function(_0x37b65f){var _0x5e4a6e={};_0x5e4a6e[_0x37b65f]={'$like':'%'+_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]+'%'};return _0x5e4a6e;})});}_0x4e7fac[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x4e7fac['where'],{'mailboxuser':_0x2a1ce1[_0xbb10('0x55')]});_0x4e7fac=_[_0xbb10('0x3d')]({},_0x4e7fac,_0x14fed3[_0xbb10('0x3e')]);return db[_0xbb10('0x53')][_0xbb10('0x56')](_0x4e7fac)[_0xbb10('0x23')](respondWithFilteredResult(_0x432728,_0x4e7fac));})[_0xbb10('0x44')](handleError(_0x432728,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 588d4ee..31f8b99 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 _0x250f=['mailbox','context','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','voice_voicemail','mailbox_context'];(function(_0x29ceb8,_0xaa5650){var _0x3dc754=function(_0x130296){while(--_0x130296){_0x29ceb8['push'](_0x29ceb8['shift']());}};_0x3dc754(++_0xaa5650);}(_0x250f,0x1be));var _0xf250=function(_0x548db9,_0x48bdee){_0x548db9=_0x548db9-0x0;var _0xeb7985=_0x250f[_0x548db9];return _0xeb7985;};'use strict';var _=require('lodash');var util=require(_0xf250('0x0'));var logger=require('../../config/logger')(_0xf250('0x1'));var moment=require(_0xf250('0x2'));var BPromise=require(_0xf250('0x3'));var rp=require(_0xf250('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf250('0x5'));var config=require(_0xf250('0x6'));var attributes=require(_0xf250('0x7'));module['exports']=function(_0x111ae8,_0x152c7a){return _0x111ae8['define']('VoiceMail',attributes,{'tableName':_0xf250('0x8'),'paranoid':![],'indexes':[{'name':_0xf250('0x9'),'fields':[_0xf250('0xa'),_0xf250('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51b0=['mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','mailbox_context'];(function(_0x1b3bcd,_0x59ef82){var _0x1d97f3=function(_0x146109){while(--_0x146109){_0x1b3bcd['push'](_0x1b3bcd['shift']());}};_0x1d97f3(++_0x59ef82);}(_0x51b0,0x101));var _0x051b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x51b0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x051b('0x0'));var util=require(_0x051b('0x1'));var logger=require(_0x051b('0x2'))(_0x051b('0x3'));var moment=require(_0x051b('0x4'));var BPromise=require(_0x051b('0x5'));var rp=require(_0x051b('0x6'));var fs=require('fs');var path=require(_0x051b('0x7'));var rimraf=require('rimraf');var config=require(_0x051b('0x8'));var attributes=require(_0x051b('0x9'));module[_0x051b('0xa')]=function(_0x53256e,_0x5d7b66){return _0x53256e['define'](_0x051b('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x051b('0xc'),'fields':[_0x051b('0xd'),_0x051b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5dcd844..7bc4d26 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 _0x4dbb=['result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x20cf60,_0x19e3a9){var _0x3b28e7=function(_0x22c132){while(--_0x22c132){_0x20cf60['push'](_0x20cf60['shift']());}};_0x3b28e7(++_0x19e3a9);}(_0x4dbb,0x145));var _0xb4db=function(_0x413426,_0x4f7814){_0x413426=_0x413426-0x0;var _0x5576e2=_0x4dbb[_0x413426];return _0x5576e2;};'use strict';var _=require('lodash');var util=require(_0xb4db('0x0'));var moment=require(_0xb4db('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4db('0x2'))['db'];var utils=require(_0xb4db('0x3'));var logger=require(_0xb4db('0x4'))('rpc');var config=require(_0xb4db('0x5'));var jayson=require(_0xb4db('0x6'));var client=jayson[_0xb4db('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27a773,_0x10a88e,_0x2e7574){return new BPromise(function(_0x21be9b,_0x17dc82){return client[_0xb4db('0x8')](_0x27a773,_0x2e7574)[_0xb4db('0x9')](function(_0x479503){logger[_0xb4db('0xa')](_0xb4db('0xb'),_0x10a88e,_0xb4db('0xc'));logger['debug'](_0xb4db('0xd'),_0x10a88e,'request\x20sent',JSON[_0xb4db('0xe')](_0x479503));if(_0x479503['error']){if(_0x479503[_0xb4db('0xf')]['code']===0x1f4){logger[_0xb4db('0xf')](_0xb4db('0xb'),_0x10a88e,_0x479503['error'][_0xb4db('0x10')]);return _0x17dc82(_0x479503[_0xb4db('0xf')][_0xb4db('0x10')]);}logger[_0xb4db('0xf')]('VoiceMail,\x20%s,\x20%s',_0x10a88e,_0x479503[_0xb4db('0xf')][_0xb4db('0x10')]);return _0x21be9b(_0x479503[_0xb4db('0xf')][_0xb4db('0x10')]);}else{logger['info'](_0xb4db('0xb'),_0x10a88e,'request\x20sent');_0x21be9b(_0x479503[_0xb4db('0x11')][_0xb4db('0x10')]);}})[_0xb4db('0x12')](function(_0x257ae1){logger['error']('VoiceMail,\x20%s,\x20%s',_0x10a88e,_0x257ae1);_0x17dc82(_0x257ae1);});});} \ No newline at end of file +var _0xca66=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','request\x20sent'];(function(_0xb3bd39,_0x3dae2a){var _0x3970ec=function(_0x41b84f){while(--_0x41b84f){_0xb3bd39['push'](_0xb3bd39['shift']());}};_0x3970ec(++_0x3dae2a);}(_0xca66,0xeb));var _0x6ca6=function(_0xa7851b,_0x53ec8c){_0xa7851b=_0xa7851b-0x0;var _0x406318=_0xca66[_0xa7851b];return _0x406318;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var moment=require(_0x6ca6('0x1'));var BPromise=require(_0x6ca6('0x2'));var rs=require(_0x6ca6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ca6('0x4'))['db'];var utils=require(_0x6ca6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ca6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ca6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x134b6d,_0x97fa51,_0x514d10){return new BPromise(function(_0x592ef4,_0x4ac25f){return client[_0x6ca6('0x8')](_0x134b6d,_0x514d10)[_0x6ca6('0x9')](function(_0xed94a8){logger[_0x6ca6('0xa')]('VoiceMail,\x20%s,\x20%s',_0x97fa51,_0x6ca6('0xb'));logger['debug'](_0x6ca6('0xc'),_0x97fa51,_0x6ca6('0xb'),JSON[_0x6ca6('0xd')](_0xed94a8));if(_0xed94a8[_0x6ca6('0xe')]){if(_0xed94a8[_0x6ca6('0xe')][_0x6ca6('0xf')]===0x1f4){logger[_0x6ca6('0xe')](_0x6ca6('0x10'),_0x97fa51,_0xed94a8[_0x6ca6('0xe')][_0x6ca6('0x11')]);return _0x4ac25f(_0xed94a8[_0x6ca6('0xe')][_0x6ca6('0x11')]);}logger[_0x6ca6('0xe')](_0x6ca6('0x10'),_0x97fa51,_0xed94a8[_0x6ca6('0xe')][_0x6ca6('0x11')]);return _0x592ef4(_0xed94a8['error'][_0x6ca6('0x11')]);}else{logger[_0x6ca6('0xa')](_0x6ca6('0x10'),_0x97fa51,_0x6ca6('0xb'));_0x592ef4(_0xed94a8['result'][_0x6ca6('0x11')]);}})[_0x6ca6('0x12')](function(_0x3bef31){logger[_0x6ca6('0xe')](_0x6ca6('0x10'),_0x97fa51,_0x3bef31);_0x4ac25f(_0x3bef31);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index e756791..e718d4b 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 _0x631d=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','put'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0x631d,0x159));var _0xd631=function(_0x1025c4,_0x583890){_0x1025c4=_0x1025c4-0x0;var _0xc7209e=_0x631d[_0x1025c4];return _0xc7209e;};'use strict';var multer=require(_0xd631('0x0'));var util=require('util');var path=require(_0xd631('0x1'));var timeout=require(_0xd631('0x2'));var express=require(_0xd631('0x3'));var router=express['Router']();var fs_extra=require(_0xd631('0x4'));var auth=require(_0xd631('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd631('0x6'));var controller=require(_0xd631('0x7'));router[_0xd631('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd631('0x9'),auth[_0xd631('0xa')](),controller[_0xd631('0xb')]);router[_0xd631('0x8')](_0xd631('0xc'),auth[_0xd631('0xa')](),controller[_0xd631('0xd')]);router[_0xd631('0xe')]('/',auth[_0xd631('0xa')](),controller['create']);router[_0xd631('0xf')](_0xd631('0x9'),auth[_0xd631('0xa')](),controller['update']);router[_0xd631('0x10')](_0xd631('0x9'),auth[_0xd631('0xa')](),controller[_0xd631('0x11')]);module[_0xd631('0x12')]=router; \ No newline at end of file +var _0x82df=['path','connect-timeout','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update','destroy','multer','util'];(function(_0x6505c,_0x5329a7){var _0x1a7a96=function(_0x5bb1c6){while(--_0x5bb1c6){_0x6505c['push'](_0x6505c['shift']());}};_0x1a7a96(++_0x5329a7);}(_0x82df,0x7c));var _0xf82d=function(_0x8b1642,_0x438b4c){_0x8b1642=_0x8b1642-0x0;var _0x163e28=_0x82df[_0x8b1642];return _0x163e28;};'use strict';var multer=require(_0xf82d('0x0'));var util=require(_0xf82d('0x1'));var path=require(_0xf82d('0x2'));var timeout=require(_0xf82d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf82d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf82d('0x5'));var controller=require(_0xf82d('0x6'));router[_0xf82d('0x7')]('/',auth[_0xf82d('0x8')](),controller[_0xf82d('0x9')]);router['get'](_0xf82d('0xa'),auth[_0xf82d('0x8')](),controller[_0xf82d('0xb')]);router[_0xf82d('0x7')]('/:id/download',auth[_0xf82d('0x8')](),controller[_0xf82d('0xc')]);router[_0xf82d('0xd')]('/',auth[_0xf82d('0x8')](),controller[_0xf82d('0xe')]);router[_0xf82d('0xf')](_0xf82d('0xa'),auth[_0xf82d('0x8')](),controller[_0xf82d('0x10')]);router['delete'](_0xf82d('0xa'),auth[_0xf82d('0x8')](),controller[_0xf82d('0x11')]);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 34fde61..93869d9 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 _0xf9c3=['sequelize','exports','VIRTUAL','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0xf9c3,0x1e8));var _0x3f9c=function(_0x2c7341,_0x293a18){_0x2c7341=_0x2c7341-0x0;var _0x23f3fc=_0xf9c3[_0x2c7341];return _0x23f3fc;};'use strict';var Sequelize=require(_0x3f9c('0x0'));module[_0x3f9c('0x1')]={'name':{'type':Sequelize[_0x3f9c('0x2')],'get':function(_0xdf386b){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3f9c('0x4')](_0x3f9c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3f9c('0x3')],'defaultValue':''},'stamp':{'type':_0x3f9c('0x6'),'defaultValue':Sequelize[_0x3f9c('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x64ff=['INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','VIRTUAL','getDataValue'];(function(_0x10d993,_0x278d8e){var _0x5ad929=function(_0x3b55f1){while(--_0x3b55f1){_0x10d993['push'](_0x10d993['shift']());}};_0x5ad929(++_0x278d8e);}(_0x64ff,0x114));var _0xf64f=function(_0x4d422d,_0x198422){_0x4d422d=_0x4d422d-0x0;var _0x3741a0=_0x64ff[_0x4d422d];return _0x3741a0;};'use strict';var Sequelize=require(_0xf64f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf64f('0x1')],'get':function(_0x18a084){return this[_0xf64f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf64f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf64f('0x5')](_0xf64f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf64f('0x4')],'defaultValue':''},'stamp':{'type':_0xf64f('0x7'),'defaultValue':Sequelize[_0xf64f('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index edf285c..07dc80e 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 _0xe52a=['count','offset','set','Content-Range','then','destroy','error','stack','name','index','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','update','body','download','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','recording','eml-format','rimraf','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','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','sendStatus','end','status','json','undefined','limit'];(function(_0x2ed2c3,_0x560850){var _0x53ae07=function(_0x13d067){while(--_0x13d067){_0x2ed2c3['push'](_0x2ed2c3['shift']());}};_0x53ae07(++_0x560850);}(_0xe52a,0x16a));var _0xae52=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xe52a[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0xae52('0x0'));var rimraf=require(_0xae52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xae52('0x2'));var moment=require(_0xae52('0x3'));var BPromise=require(_0xae52('0x4'));var Mustache=require('mustache');var util=require(_0xae52('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae52('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae52('0x7'));var squel=require(_0xae52('0x8'));var crypto=require(_0xae52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xae52('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae52('0xb'));var Redis=require(_0xae52('0xc'));var authService=require(_0xae52('0xd'));var qs=require(_0xae52('0xe'));var as=require(_0xae52('0xf'));var hardwareService=require(_0xae52('0x10'));var logger=require(_0xae52('0x11'))('api');var utils=require(_0xae52('0x12'));var config=require(_0xae52('0x13'));var licenseUtil=require(_0xae52('0x14'));var db=require(_0xae52('0x15'))['db'];function respondWithStatusCode(_0x570b54,_0x4e5a65){_0x4e5a65=_0x4e5a65||0xcc;return function(_0x530dd9){if(_0x530dd9){return _0x570b54[_0xae52('0x16')](_0x4e5a65);}return _0x570b54['status'](_0x4e5a65)[_0xae52('0x17')]();};}function respondWithResult(_0x229b0a,_0x274a09){_0x274a09=_0x274a09||0xc8;return function(_0x335db3){if(_0x335db3){return _0x229b0a[_0xae52('0x18')](_0x274a09)[_0xae52('0x19')](_0x335db3);}};}function respondWithFilteredResult(_0x52be82,_0x1cf886){return function(_0x36237e){if(_0x36237e){var _0x51296e=typeof _0x1cf886['offset']===_0xae52('0x1a')&&typeof _0x1cf886[_0xae52('0x1b')]===_0xae52('0x1a');var _0x765790=_0x36237e[_0xae52('0x1c')];var _0x2b8b78=_0x51296e?0x0:_0x1cf886[_0xae52('0x1d')];var _0x3d267b=_0x51296e?_0x36237e[_0xae52('0x1c')]:_0x1cf886[_0xae52('0x1d')]+_0x1cf886[_0xae52('0x1b')];var _0x55de1d;if(_0x3d267b>=_0x765790){_0x3d267b=_0x765790;_0x55de1d=0xc8;}else{_0x55de1d=0xce;}_0x52be82[_0xae52('0x18')](_0x55de1d);return _0x52be82[_0xae52('0x1e')](_0xae52('0x1f'),_0x2b8b78+'-'+_0x3d267b+'/'+_0x765790)[_0xae52('0x19')](_0x36237e);}return null;};}function patchUpdates(_0x228e02){return function(_0x3927b3){try{jsonpatch['apply'](_0x3927b3,_0x228e02,!![]);}catch(_0x8b4b03){return BPromise['reject'](_0x8b4b03);}return _0x3927b3['save']();};}function saveUpdates(_0x4b09b2,_0xb38901){return function(_0x447dd0){if(_0x447dd0){return _0x447dd0['update'](_0x4b09b2)[_0xae52('0x20')](function(_0x319158){return _0x319158;});}return null;};}function removeEntity(_0x56b1eb,_0x4a2d5a){return function(_0x44cbe1){if(_0x44cbe1){return _0x44cbe1[_0xae52('0x21')]()[_0xae52('0x20')](function(){_0x56b1eb[_0xae52('0x18')](0xcc)[_0xae52('0x17')]();});}};}function handleEntityNotFound(_0x23eef5,_0x5e5c22){return function(_0x24a749){if(!_0x24a749){_0x23eef5[_0xae52('0x16')](0x194);}return _0x24a749;};}function handleError(_0x3b5968,_0x55a23b){_0x55a23b=_0x55a23b||0x1f4;return function(_0x90d38c){logger[_0xae52('0x22')](_0x90d38c[_0xae52('0x23')]);if(_0x90d38c[_0xae52('0x24')]){delete _0x90d38c[_0xae52('0x24')];}_0x3b5968['status'](_0x55a23b)['send'](_0x90d38c);};}exports[_0xae52('0x25')]=function(_0x15cd76,_0x3b15d8){var _0xdc1c24={},_0x3ba81e={},_0x50b52a={'count':0x0,'rows':[]};var _0x3f510b=_[_0xae52('0x26')](db[_0xae52('0x27')]['rawAttributes'],function(_0x2d66e0){return{'name':_0x2d66e0[_0xae52('0x28')],'type':_0x2d66e0[_0xae52('0x29')][_0xae52('0x2a')]};});_0x3ba81e[_0xae52('0x2b')]=_[_0xae52('0x2c')](_[_0xae52('0x26')](_0x3f510b,_0xae52('0x24')),[_0xae52('0x24')]);_0x3ba81e[_0xae52('0x2d')]=_[_0xae52('0x2e')](_0x15cd76[_0xae52('0x2d')]);_0x3ba81e['filters']=_[_0xae52('0x2f')](_0x3ba81e[_0xae52('0x2b')],_0x3ba81e[_0xae52('0x2d')]);_0xdc1c24[_0xae52('0x30')]=_[_0xae52('0x2f')](_0x3ba81e[_0xae52('0x2b')],qs[_0xae52('0x31')](_0x15cd76[_0xae52('0x2d')][_0xae52('0x31')]));_0xdc1c24['attributes']=_0xdc1c24[_0xae52('0x30')]['length']?_0xdc1c24['attributes']:_0x3ba81e[_0xae52('0x2b')];if(!_0x15cd76[_0xae52('0x2d')][_0xae52('0x32')](_0xae52('0x33'))){_0xdc1c24['limit']=qs['limit'](_0x15cd76['query'][_0xae52('0x1b')]);_0xdc1c24['offset']=qs[_0xae52('0x1d')](_0x15cd76[_0xae52('0x2d')][_0xae52('0x1d')]);}_0xdc1c24['order']=qs[_0xae52('0x34')](_0x15cd76['query'][_0xae52('0x34')]);_0xdc1c24[_0xae52('0x35')]=qs['filters'](_['pick'](_0x15cd76[_0xae52('0x2d')],_0x3ba81e[_0xae52('0x36')]),_0x3f510b);if(_0x15cd76[_0xae52('0x2d')][_0xae52('0x37')]){_0xdc1c24[_0xae52('0x35')]=_[_0xae52('0x38')](_0xdc1c24[_0xae52('0x35')],{'$or':_[_0xae52('0x26')](_0x3f510b,function(_0x17653f){if(_0x17653f[_0xae52('0x29')]!==_0xae52('0x39')){var _0x56d480={};_0x56d480[_0x17653f[_0xae52('0x24')]]={'$like':'%'+_0x15cd76['query']['filter']+'%'};return _0x56d480;}})});}_0xdc1c24=_[_0xae52('0x38')]({},_0xdc1c24,_0x15cd76[_0xae52('0x3a')]);var _0x55dc56={'where':_0xdc1c24[_0xae52('0x35')]};return db[_0xae52('0x27')][_0xae52('0x1c')](_0x55dc56)['then'](function(_0x20e8f3){_0x50b52a[_0xae52('0x1c')]=_0x20e8f3;if(_0x15cd76[_0xae52('0x2d')][_0xae52('0x3b')]){_0xdc1c24[_0xae52('0x3c')]=[{'all':!![]}];}return db[_0xae52('0x27')][_0xae52('0x3d')](_0xdc1c24);})[_0xae52('0x20')](function(_0x4fb2b7){_0x50b52a[_0xae52('0x3e')]=_0x4fb2b7;return _0x50b52a;})[_0xae52('0x20')](respondWithFilteredResult(_0x3b15d8,_0xdc1c24))[_0xae52('0x3f')](handleError(_0x3b15d8,null));};exports['show']=function(_0x2aceab,_0x301d6e){var _0x4b9587={'raw':!![],'where':{'id':_0x2aceab[_0xae52('0x40')]['id']}},_0x45fe29={};_0x45fe29['model']=_['keys'](db[_0xae52('0x27')][_0xae52('0x41')]);_0x45fe29['query']=_[_0xae52('0x2e')](_0x2aceab[_0xae52('0x2d')]);_0x45fe29['filters']=_[_0xae52('0x2f')](_0x45fe29['model'],_0x45fe29[_0xae52('0x2d')]);_0x4b9587[_0xae52('0x30')]=_[_0xae52('0x2f')](_0x45fe29[_0xae52('0x2b')],qs[_0xae52('0x31')](_0x2aceab[_0xae52('0x2d')][_0xae52('0x31')]));_0x4b9587[_0xae52('0x30')]=_0x4b9587['attributes'][_0xae52('0x42')]?_0x4b9587[_0xae52('0x30')]:_0x45fe29['model'];if(_0x2aceab[_0xae52('0x2d')][_0xae52('0x3b')]){_0x4b9587[_0xae52('0x3c')]=[{'all':!![]}];}_0x4b9587=_[_0xae52('0x38')]({},_0x4b9587,_0x2aceab['options']);return db[_0xae52('0x27')][_0xae52('0x43')](_0x4b9587)['then'](handleEntityNotFound(_0x301d6e,null))['then'](respondWithResult(_0x301d6e,null))[_0xae52('0x3f')](handleError(_0x301d6e,null));};exports['create']=function(_0x72760a,_0x51e218){return db['VoiceMailMessage']['create'](_0x72760a['body'],{})[_0xae52('0x20')](respondWithResult(_0x51e218,0xc9))[_0xae52('0x3f')](handleError(_0x51e218,null));};exports[_0xae52('0x44')]=function(_0x1aed8f,_0x803da8){if(_0x1aed8f['body']['id']){delete _0x1aed8f[_0xae52('0x45')]['id'];}return db[_0xae52('0x27')][_0xae52('0x43')]({'where':{'id':_0x1aed8f['params']['id']}})['then'](handleEntityNotFound(_0x803da8,null))[_0xae52('0x20')](saveUpdates(_0x1aed8f[_0xae52('0x45')],null))['then'](respondWithResult(_0x803da8,null))[_0xae52('0x3f')](handleError(_0x803da8,null));};exports[_0xae52('0x21')]=function(_0x51bdb5,_0x57558a){return db[_0xae52('0x27')][_0xae52('0x43')]({'where':{'id':_0x51bdb5[_0xae52('0x40')]['id']}})[_0xae52('0x20')](handleEntityNotFound(_0x57558a,null))[_0xae52('0x20')](removeEntity(_0x57558a,null))[_0xae52('0x3f')](handleError(_0x57558a,null));};exports[_0xae52('0x46')]=function(_0x3f0733,_0x261983,_0x515c3d){return db[_0xae52('0x27')]['find']({'where':{'id':_0x3f0733[_0xae52('0x40')]['id']},'attributes':['id','recording',_0xae52('0x47')]})[_0xae52('0x20')](handleEntityNotFound(_0x261983,null))[_0xae52('0x20')](function(_0xba57ac){if(_0xba57ac){if(!_0xba57ac['recording']){throw new db['Sequelize']['ValidationError'](_0xae52('0x48'));}var _0x3aeb30={'Content-Type':_0xae52('0x49'),'Content-Disposition':_0xae52('0x4a')};if(_0xba57ac[_0xae52('0x47')]){_0x3aeb30[_0xae52('0x4b')]='attachment;\x20filename=\x22'+_0xba57ac[_0xae52('0x47')]+_0xae52('0x4c');}_0x261983['set'](_0x3aeb30);return _0x261983['send'](new Buffer(_0xba57ac[_0xae52('0x4d')]));}})['catch'](handleError(_0x261983,null));}; \ No newline at end of file +var _0x8bac=['util','path','sox','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','destroy','download','recording','msg_id','Sequelize','audio/wav','Content-Disposition','.wav\x22','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x5cb573,_0x32d709){var _0x349406=function(_0x3a495e){while(--_0x3a495e){_0x5cb573['push'](_0x5cb573['shift']());}};_0x349406(++_0x32d709);}(_0x8bac,0x1e7));var _0xc8ba=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x8bac[_0x2136d5];return _0x3bee2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8ba('0x0'));var zipdir=require(_0xc8ba('0x1'));var jsonpatch=require(_0xc8ba('0x2'));var rp=require('request-promise');var moment=require(_0xc8ba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc8ba('0x4'));var util=require(_0xc8ba('0x5'));var path=require(_0xc8ba('0x6'));var sox=require(_0xc8ba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8ba('0x8'));var squel=require(_0xc8ba('0x9'));var crypto=require('crypto');var jsforce=require(_0xc8ba('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc8ba('0xb'));var Papa=require(_0xc8ba('0xc'));var Redis=require(_0xc8ba('0xd'));var authService=require(_0xc8ba('0xe'));var qs=require(_0xc8ba('0xf'));var as=require(_0xc8ba('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8ba('0x11'))(_0xc8ba('0x12'));var utils=require(_0xc8ba('0x13'));var config=require(_0xc8ba('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x402dc8,_0x1658e7){_0x1658e7=_0x1658e7||0xcc;return function(_0x4ae905){if(_0x4ae905){return _0x402dc8[_0xc8ba('0x15')](_0x1658e7);}return _0x402dc8[_0xc8ba('0x16')](_0x1658e7)[_0xc8ba('0x17')]();};}function respondWithResult(_0x16dd06,_0x5d72a3){_0x5d72a3=_0x5d72a3||0xc8;return function(_0x11f855){if(_0x11f855){return _0x16dd06['status'](_0x5d72a3)[_0xc8ba('0x18')](_0x11f855);}};}function respondWithFilteredResult(_0x12fde1,_0x238726){return function(_0x40f181){if(_0x40f181){var _0x1e5e23=typeof _0x238726[_0xc8ba('0x19')]==='undefined'&&typeof _0x238726[_0xc8ba('0x1a')]===_0xc8ba('0x1b');var _0x1f5303=_0x40f181['count'];var _0x171a74=_0x1e5e23?0x0:_0x238726[_0xc8ba('0x19')];var _0x37e24f=_0x1e5e23?_0x40f181[_0xc8ba('0x1c')]:_0x238726['offset']+_0x238726['limit'];var _0x4a0d17;if(_0x37e24f>=_0x1f5303){_0x37e24f=_0x1f5303;_0x4a0d17=0xc8;}else{_0x4a0d17=0xce;}_0x12fde1[_0xc8ba('0x16')](_0x4a0d17);return _0x12fde1[_0xc8ba('0x1d')](_0xc8ba('0x1e'),_0x171a74+'-'+_0x37e24f+'/'+_0x1f5303)[_0xc8ba('0x18')](_0x40f181);}return null;};}function patchUpdates(_0x570dff){return function(_0x6a70c4){try{jsonpatch['apply'](_0x6a70c4,_0x570dff,!![]);}catch(_0x300585){return BPromise[_0xc8ba('0x1f')](_0x300585);}return _0x6a70c4[_0xc8ba('0x20')]();};}function saveUpdates(_0x1531f4,_0x51d9ff){return function(_0x497510){if(_0x497510){return _0x497510['update'](_0x1531f4)[_0xc8ba('0x21')](function(_0x2cd517){return _0x2cd517;});}return null;};}function removeEntity(_0x236515,_0x96da6){return function(_0x2b578c){if(_0x2b578c){return _0x2b578c['destroy']()[_0xc8ba('0x21')](function(){_0x236515[_0xc8ba('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f30dc,_0x4837d7){return function(_0x2d4702){if(!_0x2d4702){_0x2f30dc[_0xc8ba('0x15')](0x194);}return _0x2d4702;};}function handleError(_0x2d1654,_0x1956d3){_0x1956d3=_0x1956d3||0x1f4;return function(_0x602a37){logger[_0xc8ba('0x22')](_0x602a37[_0xc8ba('0x23')]);if(_0x602a37[_0xc8ba('0x24')]){delete _0x602a37[_0xc8ba('0x24')];}_0x2d1654['status'](_0x1956d3)[_0xc8ba('0x25')](_0x602a37);};}exports[_0xc8ba('0x26')]=function(_0x38fe3b,_0x33d9d4){var _0x48c3c3={},_0x1f293d={},_0xe3b7ff={'count':0x0,'rows':[]};var _0x1c4b16=_[_0xc8ba('0x27')](db[_0xc8ba('0x28')][_0xc8ba('0x29')],function(_0x575ed7){return{'name':_0x575ed7[_0xc8ba('0x2a')],'type':_0x575ed7[_0xc8ba('0x2b')]['key']};});_0x1f293d[_0xc8ba('0x2c')]=_[_0xc8ba('0x2d')](_[_0xc8ba('0x27')](_0x1c4b16,_0xc8ba('0x24')),['name']);_0x1f293d[_0xc8ba('0x2e')]=_[_0xc8ba('0x2f')](_0x38fe3b['query']);_0x1f293d['filters']=_[_0xc8ba('0x30')](_0x1f293d[_0xc8ba('0x2c')],_0x1f293d[_0xc8ba('0x2e')]);_0x48c3c3[_0xc8ba('0x31')]=_['intersection'](_0x1f293d[_0xc8ba('0x2c')],qs[_0xc8ba('0x32')](_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x32')]));_0x48c3c3['attributes']=_0x48c3c3[_0xc8ba('0x31')][_0xc8ba('0x33')]?_0x48c3c3['attributes']:_0x1f293d[_0xc8ba('0x2c')];if(!_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x34')](_0xc8ba('0x35'))){_0x48c3c3[_0xc8ba('0x1a')]=qs[_0xc8ba('0x1a')](_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x1a')]);_0x48c3c3[_0xc8ba('0x19')]=qs['offset'](_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x19')]);}_0x48c3c3[_0xc8ba('0x36')]=qs[_0xc8ba('0x37')](_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x37')]);_0x48c3c3[_0xc8ba('0x38')]=qs[_0xc8ba('0x39')](_[_0xc8ba('0x3a')](_0x38fe3b[_0xc8ba('0x2e')],_0x1f293d[_0xc8ba('0x39')]),_0x1c4b16);if(_0x38fe3b[_0xc8ba('0x2e')][_0xc8ba('0x3b')]){_0x48c3c3[_0xc8ba('0x38')]=_[_0xc8ba('0x3c')](_0x48c3c3['where'],{'$or':_[_0xc8ba('0x27')](_0x1c4b16,function(_0xe7f530){if(_0xe7f530[_0xc8ba('0x2b')]!==_0xc8ba('0x3d')){var _0x1c04cd={};_0x1c04cd[_0xe7f530[_0xc8ba('0x24')]]={'$like':'%'+_0x38fe3b['query']['filter']+'%'};return _0x1c04cd;}})});}_0x48c3c3=_[_0xc8ba('0x3c')]({},_0x48c3c3,_0x38fe3b[_0xc8ba('0x3e')]);var _0x593421={'where':_0x48c3c3[_0xc8ba('0x38')]};return db[_0xc8ba('0x28')]['count'](_0x593421)[_0xc8ba('0x21')](function(_0x4149f3){_0xe3b7ff[_0xc8ba('0x1c')]=_0x4149f3;if(_0x38fe3b['query'][_0xc8ba('0x3f')]){_0x48c3c3[_0xc8ba('0x40')]=[{'all':!![]}];}return db[_0xc8ba('0x28')][_0xc8ba('0x41')](_0x48c3c3);})['then'](function(_0x22eecb){_0xe3b7ff[_0xc8ba('0x42')]=_0x22eecb;return _0xe3b7ff;})[_0xc8ba('0x21')](respondWithFilteredResult(_0x33d9d4,_0x48c3c3))[_0xc8ba('0x43')](handleError(_0x33d9d4,null));};exports[_0xc8ba('0x44')]=function(_0x3b77ec,_0x293861){var _0x1b70a8={'raw':!![],'where':{'id':_0x3b77ec['params']['id']}},_0x4180d2={};_0x4180d2[_0xc8ba('0x2c')]=_[_0xc8ba('0x2f')](db[_0xc8ba('0x28')][_0xc8ba('0x29')]);_0x4180d2[_0xc8ba('0x2e')]=_[_0xc8ba('0x2f')](_0x3b77ec[_0xc8ba('0x2e')]);_0x4180d2['filters']=_[_0xc8ba('0x30')](_0x4180d2[_0xc8ba('0x2c')],_0x4180d2[_0xc8ba('0x2e')]);_0x1b70a8[_0xc8ba('0x31')]=_[_0xc8ba('0x30')](_0x4180d2[_0xc8ba('0x2c')],qs['fields'](_0x3b77ec[_0xc8ba('0x2e')]['fields']));_0x1b70a8[_0xc8ba('0x31')]=_0x1b70a8['attributes'][_0xc8ba('0x33')]?_0x1b70a8[_0xc8ba('0x31')]:_0x4180d2[_0xc8ba('0x2c')];if(_0x3b77ec['query'][_0xc8ba('0x3f')]){_0x1b70a8['include']=[{'all':!![]}];}_0x1b70a8=_[_0xc8ba('0x3c')]({},_0x1b70a8,_0x3b77ec[_0xc8ba('0x3e')]);return db[_0xc8ba('0x28')][_0xc8ba('0x45')](_0x1b70a8)['then'](handleEntityNotFound(_0x293861,null))[_0xc8ba('0x21')](respondWithResult(_0x293861,null))[_0xc8ba('0x43')](handleError(_0x293861,null));};exports['create']=function(_0xb5dd97,_0x4ef5da){return db[_0xc8ba('0x28')][_0xc8ba('0x46')](_0xb5dd97[_0xc8ba('0x47')],{})[_0xc8ba('0x21')](respondWithResult(_0x4ef5da,0xc9))[_0xc8ba('0x43')](handleError(_0x4ef5da,null));};exports[_0xc8ba('0x48')]=function(_0x517d39,_0x2acda0){if(_0x517d39[_0xc8ba('0x47')]['id']){delete _0x517d39[_0xc8ba('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x517d39[_0xc8ba('0x49')]['id']}})[_0xc8ba('0x21')](handleEntityNotFound(_0x2acda0,null))[_0xc8ba('0x21')](saveUpdates(_0x517d39['body'],null))[_0xc8ba('0x21')](respondWithResult(_0x2acda0,null))['catch'](handleError(_0x2acda0,null));};exports[_0xc8ba('0x4a')]=function(_0x44c582,_0x37431e){return db[_0xc8ba('0x28')][_0xc8ba('0x45')]({'where':{'id':_0x44c582['params']['id']}})[_0xc8ba('0x21')](handleEntityNotFound(_0x37431e,null))[_0xc8ba('0x21')](removeEntity(_0x37431e,null))[_0xc8ba('0x43')](handleError(_0x37431e,null));};exports[_0xc8ba('0x4b')]=function(_0x156245,_0x3069e6,_0x504b25){return db[_0xc8ba('0x28')][_0xc8ba('0x45')]({'where':{'id':_0x156245[_0xc8ba('0x49')]['id']},'attributes':['id',_0xc8ba('0x4c'),_0xc8ba('0x4d')]})['then'](handleEntityNotFound(_0x3069e6,null))[_0xc8ba('0x21')](function(_0x71d54){if(_0x71d54){if(!_0x71d54['recording']){throw new db[(_0xc8ba('0x4e'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x23c529={'Content-Type':_0xc8ba('0x4f'),'Content-Disposition':'attachment'};if(_0x71d54[_0xc8ba('0x4d')]){_0x23c529[_0xc8ba('0x50')]='attachment;\x20filename=\x22'+_0x71d54['msg_id']+_0xc8ba('0x51');}_0x3069e6['set'](_0x23c529);return _0x3069e6[_0xc8ba('0x25')](new Buffer(_0x71d54['recording']));}})[_0xc8ba('0x43')](handleError(_0x3069e6,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 368a284..42d1183 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 _0xa165=['../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4679db,_0x47135b){var _0x463ef0=function(_0x14d843){while(--_0x14d843){_0x4679db['push'](_0x4679db['shift']());}};_0x463ef0(++_0x47135b);}(_0xa165,0x6e));var _0x5a16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa165[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5a16('0x0'));var util=require(_0x5a16('0x1'));var logger=require(_0x5a16('0x2'))(_0x5a16('0x3'));var moment=require('moment');var BPromise=require(_0x5a16('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a16('0x5'));var rimraf=require(_0x5a16('0x6'));var config=require(_0x5a16('0x7'));var attributes=require(_0x5a16('0x8'));module[_0x5a16('0x9')]=function(_0x254a66,_0x6aad53){return _0x254a66['define'](_0x5a16('0xa'),attributes,{'tableName':_0x5a16('0xb'),'paranoid':![],'indexes':[{'name':_0x5a16('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x26da=['define','VoiceMailMessage','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26da,0x188));var _0xa26d=function(_0x1d24f0,_0xff2706){_0x1d24f0=_0x1d24f0-0x0;var _0xbfea1b=_0x26da[_0x1d24f0];return _0xbfea1b;};'use strict';var _=require('lodash');var util=require(_0xa26d('0x0'));var logger=require(_0xa26d('0x1'))(_0xa26d('0x2'));var moment=require(_0xa26d('0x3'));var BPromise=require(_0xa26d('0x4'));var rp=require(_0xa26d('0x5'));var fs=require('fs');var path=require(_0xa26d('0x6'));var rimraf=require(_0xa26d('0x7'));var config=require(_0xa26d('0x8'));var attributes=require(_0xa26d('0x9'));module[_0xa26d('0xa')]=function(_0x5e72bc,_0x4869b4){return _0x5e72bc[_0xa26d('0xb')](_0xa26d('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 131e73f..3c741ed 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 _0x7492=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x7492,0xcf));var _0x2749=function(_0x5ad2b3,_0x9a1bec){_0x5ad2b3=_0x5ad2b3-0x0;var _0x1f8d12=_0x7492[_0x5ad2b3];return _0x1f8d12;};'use strict';var _=require(_0x2749('0x0'));var util=require(_0x2749('0x1'));var moment=require('moment');var BPromise=require(_0x2749('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2749('0x3'));var db=require(_0x2749('0x4'))['db'];var utils=require(_0x2749('0x5'));var logger=require(_0x2749('0x6'))('rpc');var config=require(_0x2749('0x7'));var jayson=require(_0x2749('0x8'));var client=jayson['client'][_0x2749('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e4d59,_0x6c8490,_0x24a6ca){return new BPromise(function(_0x2ec41a,_0x3fbee9){return client[_0x2749('0xa')](_0x1e4d59,_0x24a6ca)['then'](function(_0x2be7c7){logger[_0x2749('0xb')](_0x2749('0xc'),_0x6c8490,'request\x20sent');logger[_0x2749('0xd')](_0x2749('0xe'),_0x6c8490,_0x2749('0xf'),JSON[_0x2749('0x10')](_0x2be7c7));if(_0x2be7c7[_0x2749('0x11')]){if(_0x2be7c7[_0x2749('0x11')][_0x2749('0x12')]===0x1f4){logger[_0x2749('0x11')](_0x2749('0xc'),_0x6c8490,_0x2be7c7[_0x2749('0x11')][_0x2749('0x13')]);return _0x3fbee9(_0x2be7c7[_0x2749('0x11')][_0x2749('0x13')]);}logger[_0x2749('0x11')](_0x2749('0xc'),_0x6c8490,_0x2be7c7['error'][_0x2749('0x13')]);return _0x2ec41a(_0x2be7c7[_0x2749('0x11')][_0x2749('0x13')]);}else{logger[_0x2749('0xb')](_0x2749('0xc'),_0x6c8490,_0x2749('0xf'));_0x2ec41a(_0x2be7c7[_0x2749('0x14')][_0x2749('0x13')]);}})['catch'](function(_0x5372bd){logger[_0x2749('0x11')](_0x2749('0xc'),_0x6c8490,_0x5372bd);_0x3fbee9(_0x5372bd);});});} \ No newline at end of file +var _0x6eec=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x148f2c,_0x199d15){var _0xc248bf=function(_0x208309){while(--_0x208309){_0x148f2c['push'](_0x148f2c['shift']());}};_0xc248bf(++_0x199d15);}(_0x6eec,0x1a5));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var moment=require(_0xc6ee('0x2'));var BPromise=require(_0xc6ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6ee('0x4'));var db=require(_0xc6ee('0x5'))['db'];var utils=require(_0xc6ee('0x6'));var logger=require(_0xc6ee('0x7'))(_0xc6ee('0x8'));var config=require(_0xc6ee('0x9'));var jayson=require(_0xc6ee('0xa'));var client=jayson[_0xc6ee('0xb')][_0xc6ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574766,_0x4da2d2,_0x1dddf7){return new BPromise(function(_0x5228bf,_0x32e907){return client[_0xc6ee('0xd')](_0x574766,_0x1dddf7)[_0xc6ee('0xe')](function(_0xe100bd){logger['info'](_0xc6ee('0xf'),_0x4da2d2,'request\x20sent');logger[_0xc6ee('0x10')](_0xc6ee('0x11'),_0x4da2d2,'request\x20sent',JSON[_0xc6ee('0x12')](_0xe100bd));if(_0xe100bd[_0xc6ee('0x13')]){if(_0xe100bd['error'][_0xc6ee('0x14')]===0x1f4){logger[_0xc6ee('0x13')](_0xc6ee('0xf'),_0x4da2d2,_0xe100bd['error'][_0xc6ee('0x15')]);return _0x32e907(_0xe100bd[_0xc6ee('0x13')][_0xc6ee('0x15')]);}logger['error'](_0xc6ee('0xf'),_0x4da2d2,_0xe100bd[_0xc6ee('0x13')][_0xc6ee('0x15')]);return _0x5228bf(_0xe100bd['error']['message']);}else{logger[_0xc6ee('0x16')](_0xc6ee('0xf'),_0x4da2d2,_0xc6ee('0x17'));_0x5228bf(_0xe100bd['result']['message']);}})[_0xc6ee('0x18')](function(_0x8942ab){logger[_0xc6ee('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x4da2d2,_0x8942ab);_0x32e907(_0x8942ab);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3979771..08b05d2 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 _0x0b97=['../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x49ae92,_0x301e2a){var _0x4f2b13=function(_0x392110){while(--_0x392110){_0x49ae92['push'](_0x49ae92['shift']());}};_0x4f2b13(++_0x301e2a);}(_0x0b97,0x1b3));var _0x70b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0b97[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x70b9('0x0'));var util=require(_0x70b9('0x1'));var path=require(_0x70b9('0x2'));var timeout=require(_0x70b9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x70b9('0x4'));var auth=require(_0x70b9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x70b9('0x6'));router[_0x70b9('0x7')]('/',auth[_0x70b9('0x8')](),controller[_0x70b9('0x9')]);router[_0x70b9('0x7')](_0x70b9('0xa'),auth[_0x70b9('0x8')](),controller[_0x70b9('0xb')]);router[_0x70b9('0x7')](_0x70b9('0xc'),auth[_0x70b9('0x8')](),controller[_0x70b9('0xd')]);router['post']('/',auth[_0x70b9('0x8')](),controller['create']);router[_0x70b9('0xe')](_0x70b9('0xc'),auth[_0x70b9('0x8')](),controller[_0x70b9('0xf')]);router[_0x70b9('0x10')](_0x70b9('0xa'),auth[_0x70b9('0x8')](),controller[_0x70b9('0x11')]);router[_0x70b9('0x12')](_0x70b9('0xa'),auth[_0x70b9('0x8')](),controller[_0x70b9('0x13')]);router[_0x70b9('0x12')](_0x70b9('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0x70b9('0x15')]=router; \ No newline at end of file +var _0xf0bf=['delete','destroy','/:id/sounds/:id2','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','update'];(function(_0x4dbcf8,_0x55ca2b){var _0x24bd2f=function(_0x11f97e){while(--_0x11f97e){_0x4dbcf8['push'](_0x4dbcf8['shift']());}};_0x24bd2f(++_0x55ca2b);}(_0xf0bf,0x100));var _0xff0b=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xf0bf[_0x1793de];return _0x4f0309;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff0b('0x0'));var timeout=require(_0xff0b('0x1'));var express=require(_0xff0b('0x2'));var router=express[_0xff0b('0x3')]();var fs_extra=require(_0xff0b('0x4'));var auth=require(_0xff0b('0x5'));var interaction=require(_0xff0b('0x6'));var config=require('../../config/environment');var controller=require(_0xff0b('0x7'));router[_0xff0b('0x8')]('/',auth['isAuthenticated'](),controller[_0xff0b('0x9')]);router[_0xff0b('0x8')](_0xff0b('0xa'),auth[_0xff0b('0xb')](),controller[_0xff0b('0xc')]);router[_0xff0b('0x8')](_0xff0b('0xd'),auth[_0xff0b('0xb')](),controller[_0xff0b('0xe')]);router[_0xff0b('0xf')]('/',auth['isAuthenticated'](),controller[_0xff0b('0x10')]);router['post']('/:id/sounds',auth[_0xff0b('0xb')](),controller[_0xff0b('0x11')]);router[_0xff0b('0x12')](_0xff0b('0xa'),auth['isAuthenticated'](),controller[_0xff0b('0x13')]);router[_0xff0b('0x14')](_0xff0b('0xa'),auth['isAuthenticated'](),controller[_0xff0b('0x15')]);router[_0xff0b('0x14')](_0xff0b('0x16'),auth[_0xff0b('0xb')](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 67f0e39..4ebbd2c 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 _0x0a73=['alpha','TIMESTAMP','sequelize','exports','STRING','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x149567,_0x5515a0){var _0x3b14e3=function(_0x462dca){while(--_0x462dca){_0x149567['push'](_0x149567['shift']());}};_0x3b14e3(++_0x5515a0);}(_0x0a73,0x65));var _0x30a7=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0x0a73[_0x30a956];return _0x2ac17d;};'use strict';var Sequelize=require(_0x30a7('0x0'));module[_0x30a7('0x1')]={'name':{'type':Sequelize[_0x30a7('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x30a7('0x3'),_0x30a7('0x4'),_0x30a7('0x5'),_0x30a7('0x6'),_0x30a7('0x7'),_0x30a7('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x30a7('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x30a7('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x30a7('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x30a7('0x2')],'allowNull':!![],'defaultValue':_0x30a7('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x30a7('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x77a9=['quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','files','mp3nb'];(function(_0x5dfde8,_0xa2f77d){var _0x2253fb=function(_0x16ad74){while(--_0x16ad74){_0x5dfde8['push'](_0x5dfde8['shift']());}};_0x2253fb(++_0xa2f77d);}(_0x77a9,0x103));var _0x977a=function(_0x5d7367,_0x195416){_0x5d7367=_0x5d7367-0x0;var _0x2e3c63=_0x77a9[_0x5d7367];return _0x2e3c63;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x977a('0x2')},'mode':{'type':Sequelize['ENUM']('custom',_0x977a('0x3'),_0x977a('0x4'),'quietmp3nb',_0x977a('0x5'),_0x977a('0x6')),'allowNull':!![],'defaultValue':_0x977a('0x3')},'directory':{'type':Sequelize[_0x977a('0x7')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x977a('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x977a('0x7')],'allowNull':!![],'defaultValue':_0x977a('0x8')},'format':{'type':Sequelize[_0x977a('0x7')],'allowNull':!![]},'stamp':{'type':_0x977a('0x9')},'defaultEntry':{'type':Sequelize[_0x977a('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 6be720d..5202213 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 _0x4192=['end','json','undefined','limit','offset','count','status','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','find','body','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','message','addSound','Sound','save_name','converted_format','createdAt','format','basename','%s.%s','symlinkSync','findOne','removeSound','id2','ValidationError','getSounds','length','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x4adbf7,_0x1d2025){var _0x158655=function(_0xdbf6eb){while(--_0xdbf6eb){_0x4adbf7['push'](_0x4adbf7['shift']());}};_0x158655(++_0x1d2025);}(_0x4192,0x1a7));var _0x2419=function(_0x27787d,_0x3c832a){_0x27787d=_0x27787d-0x0;var _0x2ec19c=_0x4192[_0x27787d];return _0x2ec19c;};'use strict';var emlformat=require(_0x2419('0x0'));var rimraf=require(_0x2419('0x1'));var zipdir=require(_0x2419('0x2'));var jsonpatch=require(_0x2419('0x3'));var rp=require(_0x2419('0x4'));var moment=require(_0x2419('0x5'));var BPromise=require(_0x2419('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2419('0x7'));var sox=require(_0x2419('0x8'));var csv=require(_0x2419('0x9'));var ejs=require(_0x2419('0xa'));var fs=require('fs');var fs_extra=require(_0x2419('0xb'));var _=require(_0x2419('0xc'));var squel=require(_0x2419('0xd'));var crypto=require(_0x2419('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2419('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2419('0x10'));var qs=require(_0x2419('0x11'));var as=require(_0x2419('0x12'));var hardwareService=require(_0x2419('0x13'));var logger=require(_0x2419('0x14'))('api');var utils=require(_0x2419('0x15'));var config=require(_0x2419('0x16'));var licenseUtil=require(_0x2419('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d9fa5,_0x77caf3){_0x77caf3=_0x77caf3||0xcc;return function(_0x165be2){if(_0x165be2){return _0x2d9fa5[_0x2419('0x18')](_0x77caf3);}return _0x2d9fa5['status'](_0x77caf3)[_0x2419('0x19')]();};}function respondWithResult(_0x230b6b,_0x3a6606){_0x3a6606=_0x3a6606||0xc8;return function(_0x463392){if(_0x463392){return _0x230b6b['status'](_0x3a6606)[_0x2419('0x1a')](_0x463392);}};}function respondWithFilteredResult(_0x3aae8b,_0xc3ec6){return function(_0x3487fd){if(_0x3487fd){var _0x45642d=typeof _0xc3ec6['offset']===_0x2419('0x1b')&&typeof _0xc3ec6[_0x2419('0x1c')]==='undefined';var _0x3dbfcc=_0x3487fd['count'];var _0xede620=_0x45642d?0x0:_0xc3ec6[_0x2419('0x1d')];var _0x5ea7f9=_0x45642d?_0x3487fd[_0x2419('0x1e')]:_0xc3ec6[_0x2419('0x1d')]+_0xc3ec6[_0x2419('0x1c')];var _0xd7ba68;if(_0x5ea7f9>=_0x3dbfcc){_0x5ea7f9=_0x3dbfcc;_0xd7ba68=0xc8;}else{_0xd7ba68=0xce;}_0x3aae8b[_0x2419('0x1f')](_0xd7ba68);return _0x3aae8b[_0x2419('0x20')](_0x2419('0x21'),_0xede620+'-'+_0x5ea7f9+'/'+_0x3dbfcc)[_0x2419('0x1a')](_0x3487fd);}return null;};}function patchUpdates(_0x382a36){return function(_0xfe35dc){try{jsonpatch['apply'](_0xfe35dc,_0x382a36,!![]);}catch(_0x365a36){return BPromise[_0x2419('0x22')](_0x365a36);}return _0xfe35dc[_0x2419('0x23')]();};}function saveUpdates(_0x340cce,_0xae0f6){return function(_0x567457){if(_0x567457){return _0x567457[_0x2419('0x24')](_0x340cce)['then'](function(_0x351e10){return _0x351e10;});}return null;};}function removeEntity(_0x11d5ec,_0x5dfa22){return function(_0xd951fc){if(_0xd951fc){return _0xd951fc[_0x2419('0x25')]()[_0x2419('0x26')](function(){var _0x2b2594=_0xd951fc[_0x2419('0x27')]({'plain':!![]});var _0x46df59='MusicOnHolds';return db[_0x2419('0x28')][_0x2419('0x25')]({'where':{'type':_0x46df59,'resourceId':_0x2b2594['id']}})['then'](function(){return _0xd951fc;});})[_0x2419('0x26')](function(){_0x11d5ec['status'](0xcc)[_0x2419('0x19')]();});}};}function handleEntityNotFound(_0x35a346,_0x5d66eb){return function(_0x49fc3d){if(!_0x49fc3d){_0x35a346[_0x2419('0x18')](0x194);}return _0x49fc3d;};}function handleError(_0x2ef1e2,_0x529780){_0x529780=_0x529780||0x1f4;return function(_0x123489){logger['error'](_0x123489[_0x2419('0x29')]);if(_0x123489[_0x2419('0x2a')]){delete _0x123489[_0x2419('0x2a')];}_0x2ef1e2[_0x2419('0x1f')](_0x529780)[_0x2419('0x2b')](_0x123489);};}exports[_0x2419('0x2c')]=function(_0x114e49,_0x16596d){var _0x1ed456={},_0x2f9125={},_0x5af828={'count':0x0,'rows':[]};var _0x4551cd=_[_0x2419('0x2d')](db[_0x2419('0x2e')][_0x2419('0x2f')],function(_0x2091fe){return{'name':_0x2091fe[_0x2419('0x30')],'type':_0x2091fe[_0x2419('0x31')][_0x2419('0x32')]};});_0x2f9125[_0x2419('0x33')]=_[_0x2419('0x2d')](_0x4551cd,_0x2419('0x2a'));_0x2f9125[_0x2419('0x34')]=_[_0x2419('0x35')](_0x114e49[_0x2419('0x34')]);_0x2f9125[_0x2419('0x36')]=_[_0x2419('0x37')](_0x2f9125[_0x2419('0x33')],_0x2f9125[_0x2419('0x34')]);_0x1ed456[_0x2419('0x38')]=_['intersection'](_0x2f9125[_0x2419('0x33')],qs['fields'](_0x114e49['query']['fields']));_0x1ed456[_0x2419('0x38')]=_0x1ed456[_0x2419('0x38')]['length']?_0x1ed456['attributes']:_0x2f9125[_0x2419('0x33')];if(!_0x114e49[_0x2419('0x34')]['hasOwnProperty'](_0x2419('0x39'))){_0x1ed456['limit']=qs[_0x2419('0x1c')](_0x114e49['query'][_0x2419('0x1c')]);_0x1ed456['offset']=qs[_0x2419('0x1d')](_0x114e49['query']['offset']);}_0x1ed456[_0x2419('0x3a')]=qs[_0x2419('0x3b')](_0x114e49[_0x2419('0x34')]['sort']);delete _0x114e49[_0x2419('0x34')][_0x2419('0x3b')];_0x1ed456[_0x2419('0x3c')]=qs[_0x2419('0x36')](_[_0x2419('0x3d')](_0x114e49[_0x2419('0x34')],_0x2f9125[_0x2419('0x36')]),_0x4551cd);if(_0x114e49[_0x2419('0x34')][_0x2419('0x3e')]){_0x1ed456[_0x2419('0x3c')]=_[_0x2419('0x3f')](_0x1ed456[_0x2419('0x3c')],{'$or':_['map'](_0x4551cd,function(_0x412e4c){if(_0x412e4c[_0x2419('0x31')]!=='VIRTUAL'){var _0x3deb86={};_0x3deb86[_0x412e4c[_0x2419('0x2a')]]={'$like':'%'+_0x114e49[_0x2419('0x34')][_0x2419('0x3e')]+'%'};return _0x3deb86;}})});}_0x1ed456=_[_0x2419('0x3f')]({},_0x1ed456,_0x114e49[_0x2419('0x40')]);var _0x524834={'where':_0x1ed456['where']};return db['VoiceMusicOnHold'][_0x2419('0x1e')](_0x524834)[_0x2419('0x26')](function(_0x3b45db){_0x5af828[_0x2419('0x1e')]=_0x3b45db;if(_0x114e49['query'][_0x2419('0x41')]){_0x1ed456[_0x2419('0x42')]=[{'all':!![]}];}return db[_0x2419('0x2e')]['findAll'](_0x1ed456);})[_0x2419('0x26')](function(_0x421a9e){_0x5af828[_0x2419('0x43')]=_0x421a9e;return _0x5af828;})[_0x2419('0x26')](respondWithFilteredResult(_0x16596d,_0x1ed456))[_0x2419('0x44')](handleError(_0x16596d,null));};exports[_0x2419('0x45')]=function(_0x2ab803,_0x2d0fd4){var _0x4d09e1={'raw':![],'where':{'id':_0x2ab803[_0x2419('0x46')]['id']}},_0x5ad94f={};_0x5ad94f[_0x2419('0x33')]=_[_0x2419('0x35')](db[_0x2419('0x2e')]['rawAttributes']);_0x5ad94f[_0x2419('0x34')]=_['keys'](_0x2ab803['query']);_0x5ad94f[_0x2419('0x36')]=_[_0x2419('0x37')](_0x5ad94f['model'],_0x5ad94f[_0x2419('0x34')]);_0x4d09e1['attributes']=_[_0x2419('0x37')](_0x5ad94f[_0x2419('0x33')],qs[_0x2419('0x47')](_0x2ab803[_0x2419('0x34')][_0x2419('0x47')]));_0x4d09e1[_0x2419('0x38')]=_0x4d09e1[_0x2419('0x38')]['length']?_0x4d09e1[_0x2419('0x38')]:_0x5ad94f[_0x2419('0x33')];if(_0x2ab803[_0x2419('0x34')][_0x2419('0x41')]){_0x4d09e1[_0x2419('0x42')]=[{'all':!![]}];}_0x4d09e1=_[_0x2419('0x3f')]({},_0x4d09e1,_0x2ab803[_0x2419('0x40')]);return db[_0x2419('0x2e')][_0x2419('0x48')](_0x4d09e1)['then'](handleEntityNotFound(_0x2d0fd4,null))[_0x2419('0x26')](respondWithResult(_0x2d0fd4,null))[_0x2419('0x44')](handleError(_0x2d0fd4,null));};exports[_0x2419('0x24')]=function(_0x15ce2e,_0x28b57a){if(_0x15ce2e[_0x2419('0x49')]['id']){delete _0x15ce2e[_0x2419('0x49')]['id'];}return db[_0x2419('0x2e')][_0x2419('0x48')]({'where':{'id':_0x15ce2e[_0x2419('0x46')]['id']}})[_0x2419('0x26')](handleEntityNotFound(_0x28b57a,null))[_0x2419('0x26')](saveUpdates(_0x15ce2e[_0x2419('0x49')],null))['then'](respondWithResult(_0x28b57a,null))[_0x2419('0x44')](handleError(_0x28b57a,null));};exports[_0x2419('0x4a')]=function(_0x3a1cc8,_0x1ce592,_0x219e79){return db[_0x2419('0x4b')][_0x2419('0x4c')](function(_0x584a6b){if(_0x3a1cc8['body'][_0x2419('0x4d')]===_0x2419('0x4e')){_0x3a1cc8[_0x2419('0x49')]['directory']=path[_0x2419('0x4f')](config[_0x2419('0x50')],_0x2419('0x51'),_0x3a1cc8[_0x2419('0x49')]['name']);}return db[_0x2419('0x2e')]['create'](_0x3a1cc8[_0x2419('0x49')],{'transaction':_0x584a6b})['then'](function(_0x34c672){if(_0x3a1cc8[_0x2419('0x49')]['mode']==='files'){fs[_0x2419('0x52')](_0x34c672[_0x2419('0x53')],parseInt('0777',0x8));}var _0x469750=_0x3a1cc8[_0x2419('0x54')][_0x2419('0x27')]({'plain':!![]});if(!_0x469750)throw new Error(_0x2419('0x55'));if(_0x469750[_0x2419('0x56')]===_0x2419('0x54')){var _0x307c74=_0x34c672['get']({'plain':!![]});return db[_0x2419('0x57')][_0x2419('0x48')]({'where':{'name':_0x2419('0x58'),'userProfileId':_0x469750['userProfileId']},'raw':!![]})[_0x2419('0x26')](function(_0x41bfde){if(_0x41bfde&&_0x41bfde[_0x2419('0x59')]===0x0){return db[_0x2419('0x28')][_0x2419('0x4a')]({'name':_0x307c74['name'],'resourceId':_0x307c74['id'],'type':_0x41bfde[_0x2419('0x2a')],'sectionId':_0x41bfde['id']},{})[_0x2419('0x26')](function(){return _0x34c672;});}else{return _0x34c672;}})[_0x2419('0x44')](function(_0x496ee4){logger[_0x2419('0x5a')](_0x2419('0x5b'),_0x496ee4);});}return _0x34c672;});})[_0x2419('0x26')](respondWithResult(_0x1ce592,0xc9))['catch'](handleError(_0x1ce592,null));};exports[_0x2419('0x25')]=function(_0x15977e,_0x5cd62a,_0xb89e5e){var _0x293486;return db[_0x2419('0x2e')][_0x2419('0x48')]({'where':{'id':_0x15977e[_0x2419('0x46')]['id']}})[_0x2419('0x26')](function(_0x5da666){if(_0x5da666){return db[_0x2419('0x4b')][_0x2419('0x4c')](function(_0x3c74a5){return _0x5da666[_0x2419('0x25')]({'transaction':_0x3c74a5,'raw':!![]})['then'](function(_0x48c3f2){if(_0x48c3f2[_0x2419('0x53')]){fs['readdirSync'](_0x48c3f2[_0x2419('0x53')])[_0x2419('0x5c')](function(_0x410f4d){fs[_0x2419('0x5d')](path['join'](_0x48c3f2[_0x2419('0x53')],_0x410f4d));});fs[_0x2419('0x5e')](_0x48c3f2['directory']);}return _0x48c3f2;});})[_0x2419('0x44')](function(_0x3947c3){throw new db['Sequelize']['ValidationError'](_0x3947c3[_0x2419('0x5f')]);});}})[_0x2419('0x26')](handleEntityNotFound(_0x5cd62a,null))[_0x2419('0x26')](removeEntity(_0x5cd62a,null))[_0x2419('0x44')](handleError(_0x5cd62a,null));};exports['addSound']=function(_0x4c6143,_0x37baed,_0x298341){return db[_0x2419('0x4b')][_0x2419('0x4c')](function(_0x35f50b){var _0x4a1d74;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4c6143['params']['id']}})[_0x2419('0x26')](function(_0x44fde8){if(_0x44fde8){_0x4a1d74=_0x44fde8;return _0x44fde8[_0x2419('0x60')](_0x4c6143[_0x2419('0x49')]['id'],{'transaction':_0x35f50b});}})['then'](function(_0x4205cb){if(_0x4205cb){return db[_0x2419('0x61')]['findOne']({'where':{'id':_0x4c6143['body']['id']},'attributes':['id',_0x2419('0x2a'),_0x2419('0x62'),_0x2419('0x63'),_0x2419('0x64')],'raw':!![]});}})['then'](function(_0x4f454a){if(_0x4f454a){var _0x1a0e81=path[_0x2419('0x4f')](config[_0x2419('0x50')],'server/files/sounds/converted',util[_0x2419('0x65')]('%s.%s',path[_0x2419('0x66')](_0x4f454a[_0x2419('0x62')],path['extname'](_0x4f454a[_0x2419('0x62')])),_0x4f454a[_0x2419('0x63')]));var _0x7d87cc=path[_0x2419('0x4f')](config['root'],_0x2419('0x51'),_0x4a1d74[_0x2419('0x2a')],util[_0x2419('0x65')](_0x2419('0x67'),_0x4f454a['name'],_0x4f454a[_0x2419('0x63')]));fs[_0x2419('0x68')](_0x1a0e81,_0x7d87cc);return _0x4f454a;}})[_0x2419('0x44')](function(_0x15d2f5){throw new db['Sequelize']['ValidationError'](_0x15d2f5[_0x2419('0x5f')]);});})[_0x2419('0x26')](handleEntityNotFound(_0x37baed,null))[_0x2419('0x26')](respondWithResult(_0x37baed,0xc9))[_0x2419('0x44')](handleError(_0x37baed,null));};exports['removeSound']=function(_0x392e58,_0x3bd298,_0x51e8e9){return db['sequelize'][_0x2419('0x4c')](function(_0x575239){var _0x9dee8d;return db['VoiceMusicOnHold'][_0x2419('0x69')]({'where':{'id':_0x392e58[_0x2419('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bd298,null))[_0x2419('0x26')](function(_0x9f8f0e){if(_0x9f8f0e){_0x9dee8d=_0x9f8f0e;return _0x9f8f0e[_0x2419('0x6a')](_0x392e58[_0x2419('0x46')][_0x2419('0x6b')]);}})[_0x2419('0x26')](function(_0x23970d){if(_0x23970d){return db[_0x2419('0x61')][_0x2419('0x69')]({'where':{'id':_0x392e58[_0x2419('0x46')][_0x2419('0x6b')]},'attributes':['id','name',_0x2419('0x62'),_0x2419('0x63'),'createdAt'],'raw':!![]});}})[_0x2419('0x26')](function(_0x847869){if(_0x847869){fs[_0x2419('0x5d')](path[_0x2419('0x4f')](_0x9dee8d[_0x2419('0x53')],util[_0x2419('0x65')](_0x2419('0x67'),_0x847869[_0x2419('0x2a')],_0x847869[_0x2419('0x63')])));return _0x847869;}})[_0x2419('0x44')](function(_0x3302b9){throw new db['Sequelize'][(_0x2419('0x6c'))](_0x3302b9['message']);});})[_0x2419('0x26')](handleEntityNotFound(_0x3bd298,null))[_0x2419('0x26')](respondWithStatusCode(_0x3bd298,0xcc))[_0x2419('0x44')](handleError(_0x3bd298,null));};exports['getSounds']=function(_0x118fa3,_0x3758b2,_0x5ea7d7){var _0x3227f7={};var _0x5b7e95={};var _0x48b168;var _0x2a0001;return db[_0x2419('0x2e')]['findOne']({'where':{'id':_0x118fa3['params']['id']}})[_0x2419('0x26')](handleEntityNotFound(_0x3758b2,null))['then'](function(_0x118845){if(_0x118845){_0x48b168=_0x118845;_0x5b7e95[_0x2419('0x33')]=_[_0x2419('0x35')](db[_0x2419('0x61')]['rawAttributes']);_0x5b7e95[_0x2419('0x34')]=_[_0x2419('0x35')](_0x118fa3['query']);_0x5b7e95['filters']=_[_0x2419('0x37')](_0x5b7e95['model'],_0x5b7e95[_0x2419('0x34')]);_0x3227f7[_0x2419('0x38')]=_[_0x2419('0x37')](_0x5b7e95[_0x2419('0x33')],qs[_0x2419('0x47')](_0x118fa3[_0x2419('0x34')][_0x2419('0x47')]));_0x3227f7[_0x2419('0x38')]=_0x3227f7['attributes']['length']?_0x3227f7[_0x2419('0x38')]:_0x5b7e95['model'];_0x3227f7[_0x2419('0x3a')]=qs[_0x2419('0x3b')](_0x118fa3[_0x2419('0x34')][_0x2419('0x3b')]);_0x3227f7[_0x2419('0x3c')]=qs[_0x2419('0x36')](_['pick'](_0x118fa3['query'],_0x5b7e95[_0x2419('0x36')]));if(_0x118fa3['query']['filter']){_0x3227f7[_0x2419('0x3c')]=_[_0x2419('0x3f')](_0x3227f7[_0x2419('0x3c')],{'$or':_['map'](_0x3227f7[_0x2419('0x38')],function(_0x5b1a31){var _0x54f7af={};_0x54f7af[_0x5b1a31]={'$like':'%'+_0x118fa3[_0x2419('0x34')][_0x2419('0x3e')]+'%'};return _0x54f7af;})});}_0x3227f7=_['merge']({},_0x3227f7,_0x118fa3[_0x2419('0x40')]);return _0x48b168[_0x2419('0x6d')](_0x3227f7);}})[_0x2419('0x26')](function(_0x5b8b5d){if(_0x5b8b5d){_0x2a0001=_0x5b8b5d[_0x2419('0x6e')];if(!_0x118fa3['query'][_0x2419('0x6f')]('nolimit')){_0x3227f7[_0x2419('0x1c')]=qs[_0x2419('0x1c')](_0x118fa3[_0x2419('0x34')][_0x2419('0x1c')]);_0x3227f7[_0x2419('0x1d')]=qs['offset'](_0x118fa3[_0x2419('0x34')]['offset']);}return _0x48b168[_0x2419('0x6d')](_0x3227f7);}})[_0x2419('0x26')](function(_0x3fd420){if(_0x3fd420){return _0x3fd420?{'count':_0x2a0001,'rows':_0x3fd420}:null;}})[_0x2419('0x26')](respondWithResult(_0x3758b2,null))[_0x2419('0x44')](handleError(_0x3758b2,null));}; \ No newline at end of file +var _0x13a6=['sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','VoiceMusicOnHold','length','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','findOne','id2','getSounds','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x447222,_0xaca048){var _0x5635ea=function(_0x484194){while(--_0x484194){_0x447222['push'](_0x447222['shift']());}};_0x5635ea(++_0xaca048);}(_0x13a6,0xc3));var _0x613a=function(_0x138aeb,_0x2ae31a){_0x138aeb=_0x138aeb-0x0;var _0x2241fe=_0x13a6[_0x138aeb];return _0x2241fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x613a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x613a('0x1'));var moment=require('moment');var BPromise=require(_0x613a('0x2'));var Mustache=require(_0x613a('0x3'));var util=require(_0x613a('0x4'));var path=require('path');var sox=require(_0x613a('0x5'));var csv=require(_0x613a('0x6'));var ejs=require(_0x613a('0x7'));var fs=require('fs');var fs_extra=require(_0x613a('0x8'));var _=require('lodash');var squel=require(_0x613a('0x9'));var crypto=require(_0x613a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x613a('0xb'));var toCsv=require(_0x613a('0x6'));var querystring=require(_0x613a('0xc'));var Papa=require('papaparse');var Redis=require(_0x613a('0xd'));var authService=require(_0x613a('0xe'));var qs=require(_0x613a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x613a('0x10'))(_0x613a('0x11'));var utils=require(_0x613a('0x12'));var config=require(_0x613a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x613a('0x14'))['db'];function respondWithStatusCode(_0x16e86c,_0x3616cf){_0x3616cf=_0x3616cf||0xcc;return function(_0x5a1cc2){if(_0x5a1cc2){return _0x16e86c[_0x613a('0x15')](_0x3616cf);}return _0x16e86c['status'](_0x3616cf)[_0x613a('0x16')]();};}function respondWithResult(_0x1763cb,_0x4659cf){_0x4659cf=_0x4659cf||0xc8;return function(_0x17f682){if(_0x17f682){return _0x1763cb[_0x613a('0x17')](_0x4659cf)['json'](_0x17f682);}};}function respondWithFilteredResult(_0x4010d0,_0x44cf9f){return function(_0x254b67){if(_0x254b67){var _0x2a89df=typeof _0x44cf9f[_0x613a('0x18')]===_0x613a('0x19')&&typeof _0x44cf9f[_0x613a('0x1a')]==='undefined';var _0x21fde7=_0x254b67[_0x613a('0x1b')];var _0x42c1f0=_0x2a89df?0x0:_0x44cf9f[_0x613a('0x18')];var _0x2335d1=_0x2a89df?_0x254b67[_0x613a('0x1b')]:_0x44cf9f[_0x613a('0x18')]+_0x44cf9f[_0x613a('0x1a')];var _0x563e37;if(_0x2335d1>=_0x21fde7){_0x2335d1=_0x21fde7;_0x563e37=0xc8;}else{_0x563e37=0xce;}_0x4010d0['status'](_0x563e37);return _0x4010d0[_0x613a('0x1c')](_0x613a('0x1d'),_0x42c1f0+'-'+_0x2335d1+'/'+_0x21fde7)[_0x613a('0x1e')](_0x254b67);}return null;};}function patchUpdates(_0x1e92be){return function(_0x25109f){try{jsonpatch['apply'](_0x25109f,_0x1e92be,!![]);}catch(_0x14a15c){return BPromise[_0x613a('0x1f')](_0x14a15c);}return _0x25109f['save']();};}function saveUpdates(_0x2cea65,_0x29855b){return function(_0x4b0848){if(_0x4b0848){return _0x4b0848['update'](_0x2cea65)[_0x613a('0x20')](function(_0x580572){return _0x580572;});}return null;};}function removeEntity(_0xa417d6,_0x3d8ba6){return function(_0x22d3e4){if(_0x22d3e4){return _0x22d3e4[_0x613a('0x21')]()[_0x613a('0x20')](function(){var _0x582a2e=_0x22d3e4['get']({'plain':!![]});var _0x261693=_0x613a('0x22');return db[_0x613a('0x23')][_0x613a('0x21')]({'where':{'type':_0x261693,'resourceId':_0x582a2e['id']}})[_0x613a('0x20')](function(){return _0x22d3e4;});})[_0x613a('0x20')](function(){_0xa417d6[_0x613a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a758,_0x2c7208){return function(_0x329c41){if(!_0x329c41){_0x16a758['sendStatus'](0x194);}return _0x329c41;};}function handleError(_0x3adf1e,_0x11e7b1){_0x11e7b1=_0x11e7b1||0x1f4;return function(_0x2a9e2d){logger[_0x613a('0x24')](_0x2a9e2d['stack']);if(_0x2a9e2d[_0x613a('0x25')]){delete _0x2a9e2d['name'];}_0x3adf1e[_0x613a('0x17')](_0x11e7b1)[_0x613a('0x26')](_0x2a9e2d);};}exports[_0x613a('0x27')]=function(_0x93495d,_0x35d898){var _0x18d8e3={},_0x3b15db={},_0x54ecbc={'count':0x0,'rows':[]};var _0x56d97d=_[_0x613a('0x28')](db['VoiceMusicOnHold'][_0x613a('0x29')],function(_0x4a05b3){return{'name':_0x4a05b3[_0x613a('0x2a')],'type':_0x4a05b3['type'][_0x613a('0x2b')]};});_0x3b15db[_0x613a('0x2c')]=_[_0x613a('0x28')](_0x56d97d,_0x613a('0x25'));_0x3b15db[_0x613a('0x2d')]=_[_0x613a('0x2e')](_0x93495d[_0x613a('0x2d')]);_0x3b15db[_0x613a('0x2f')]=_[_0x613a('0x30')](_0x3b15db['model'],_0x3b15db[_0x613a('0x2d')]);_0x18d8e3[_0x613a('0x31')]=_[_0x613a('0x30')](_0x3b15db['model'],qs[_0x613a('0x32')](_0x93495d[_0x613a('0x2d')][_0x613a('0x32')]));_0x18d8e3[_0x613a('0x31')]=_0x18d8e3['attributes']['length']?_0x18d8e3[_0x613a('0x31')]:_0x3b15db['model'];if(!_0x93495d['query'][_0x613a('0x33')](_0x613a('0x34'))){_0x18d8e3[_0x613a('0x1a')]=qs[_0x613a('0x1a')](_0x93495d['query'][_0x613a('0x1a')]);_0x18d8e3[_0x613a('0x18')]=qs[_0x613a('0x18')](_0x93495d['query'][_0x613a('0x18')]);}_0x18d8e3[_0x613a('0x35')]=qs['sort'](_0x93495d[_0x613a('0x2d')][_0x613a('0x36')]);delete _0x93495d[_0x613a('0x2d')]['sort'];_0x18d8e3['where']=qs[_0x613a('0x2f')](_[_0x613a('0x37')](_0x93495d['query'],_0x3b15db[_0x613a('0x2f')]),_0x56d97d);if(_0x93495d[_0x613a('0x2d')][_0x613a('0x38')]){_0x18d8e3[_0x613a('0x39')]=_['merge'](_0x18d8e3[_0x613a('0x39')],{'$or':_[_0x613a('0x28')](_0x56d97d,function(_0x9b07ca){if(_0x9b07ca['type']!==_0x613a('0x3a')){var _0x2874a3={};_0x2874a3[_0x9b07ca[_0x613a('0x25')]]={'$like':'%'+_0x93495d[_0x613a('0x2d')][_0x613a('0x38')]+'%'};return _0x2874a3;}})});}_0x18d8e3=_[_0x613a('0x3b')]({},_0x18d8e3,_0x93495d[_0x613a('0x3c')]);var _0x1ee729={'where':_0x18d8e3[_0x613a('0x39')]};return db['VoiceMusicOnHold'][_0x613a('0x1b')](_0x1ee729)[_0x613a('0x20')](function(_0x275b02){_0x54ecbc[_0x613a('0x1b')]=_0x275b02;if(_0x93495d[_0x613a('0x2d')][_0x613a('0x3d')]){_0x18d8e3['include']=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x18d8e3);})[_0x613a('0x20')](function(_0x3478bf){_0x54ecbc[_0x613a('0x3e')]=_0x3478bf;return _0x54ecbc;})[_0x613a('0x20')](respondWithFilteredResult(_0x35d898,_0x18d8e3))[_0x613a('0x3f')](handleError(_0x35d898,null));};exports[_0x613a('0x40')]=function(_0x1a9833,_0x5c42bc){var _0x2a10f7={'raw':![],'where':{'id':_0x1a9833[_0x613a('0x41')]['id']}},_0xfc60d6={};_0xfc60d6['model']=_[_0x613a('0x2e')](db[_0x613a('0x42')][_0x613a('0x29')]);_0xfc60d6[_0x613a('0x2d')]=_['keys'](_0x1a9833['query']);_0xfc60d6['filters']=_['intersection'](_0xfc60d6[_0x613a('0x2c')],_0xfc60d6['query']);_0x2a10f7[_0x613a('0x31')]=_[_0x613a('0x30')](_0xfc60d6[_0x613a('0x2c')],qs[_0x613a('0x32')](_0x1a9833[_0x613a('0x2d')][_0x613a('0x32')]));_0x2a10f7['attributes']=_0x2a10f7[_0x613a('0x31')][_0x613a('0x43')]?_0x2a10f7[_0x613a('0x31')]:_0xfc60d6[_0x613a('0x2c')];if(_0x1a9833['query']['includeAll']){_0x2a10f7['include']=[{'all':!![]}];}_0x2a10f7=_[_0x613a('0x3b')]({},_0x2a10f7,_0x1a9833[_0x613a('0x3c')]);return db['VoiceMusicOnHold'][_0x613a('0x44')](_0x2a10f7)[_0x613a('0x20')](handleEntityNotFound(_0x5c42bc,null))[_0x613a('0x20')](respondWithResult(_0x5c42bc,null))[_0x613a('0x3f')](handleError(_0x5c42bc,null));};exports[_0x613a('0x45')]=function(_0x25295a,_0x4c246e){if(_0x25295a[_0x613a('0x46')]['id']){delete _0x25295a['body']['id'];}return db[_0x613a('0x42')][_0x613a('0x44')]({'where':{'id':_0x25295a['params']['id']}})['then'](handleEntityNotFound(_0x4c246e,null))[_0x613a('0x20')](saveUpdates(_0x25295a[_0x613a('0x46')],null))[_0x613a('0x20')](respondWithResult(_0x4c246e,null))['catch'](handleError(_0x4c246e,null));};exports[_0x613a('0x47')]=function(_0x2a1c82,_0x53a3dd,_0x4d17b6){return db[_0x613a('0x48')][_0x613a('0x49')](function(_0x2352fc){if(_0x2a1c82[_0x613a('0x46')][_0x613a('0x4a')]===_0x613a('0x4b')){_0x2a1c82['body'][_0x613a('0x4c')]=path[_0x613a('0x4d')](config[_0x613a('0x4e')],_0x613a('0x4f'),_0x2a1c82[_0x613a('0x46')][_0x613a('0x25')]);}return db[_0x613a('0x42')][_0x613a('0x47')](_0x2a1c82['body'],{'transaction':_0x2352fc})[_0x613a('0x20')](function(_0x5a7da0){if(_0x2a1c82[_0x613a('0x46')][_0x613a('0x4a')]===_0x613a('0x4b')){fs[_0x613a('0x50')](_0x5a7da0[_0x613a('0x4c')],parseInt('0777',0x8));}var _0x4ffd55=_0x2a1c82[_0x613a('0x51')][_0x613a('0x52')]({'plain':!![]});if(!_0x4ffd55)throw new Error(_0x613a('0x53'));if(_0x4ffd55['role']===_0x613a('0x51')){var _0x388872=_0x5a7da0[_0x613a('0x52')]({'plain':!![]});return db[_0x613a('0x54')][_0x613a('0x44')]({'where':{'name':_0x613a('0x22'),'userProfileId':_0x4ffd55[_0x613a('0x55')]},'raw':!![]})['then'](function(_0x2b4cf1){if(_0x2b4cf1&&_0x2b4cf1['autoAssociation']===0x0){return db[_0x613a('0x23')][_0x613a('0x47')]({'name':_0x388872[_0x613a('0x25')],'resourceId':_0x388872['id'],'type':_0x2b4cf1[_0x613a('0x25')],'sectionId':_0x2b4cf1['id']},{})[_0x613a('0x20')](function(){return _0x5a7da0;});}else{return _0x5a7da0;}})[_0x613a('0x3f')](function(_0xfb2d68){logger[_0x613a('0x24')](_0x613a('0x56'),_0xfb2d68);});}return _0x5a7da0;});})[_0x613a('0x20')](respondWithResult(_0x53a3dd,0xc9))['catch'](handleError(_0x53a3dd,null));};exports[_0x613a('0x21')]=function(_0x52fafe,_0x589af8,_0x5ac3f8){var _0x28a314;return db[_0x613a('0x42')][_0x613a('0x44')]({'where':{'id':_0x52fafe[_0x613a('0x41')]['id']}})[_0x613a('0x20')](function(_0x10d096){if(_0x10d096){return db[_0x613a('0x48')][_0x613a('0x49')](function(_0xaec962){return _0x10d096[_0x613a('0x21')]({'transaction':_0xaec962,'raw':!![]})[_0x613a('0x20')](function(_0x1bfe9b){if(_0x1bfe9b[_0x613a('0x4c')]){fs[_0x613a('0x57')](_0x1bfe9b[_0x613a('0x4c')])['forEach'](function(_0x1cef1c){fs[_0x613a('0x58')](path['join'](_0x1bfe9b['directory'],_0x1cef1c));});fs[_0x613a('0x59')](_0x1bfe9b[_0x613a('0x4c')]);}return _0x1bfe9b;});})[_0x613a('0x3f')](function(_0x202870){throw new db[(_0x613a('0x5a'))][(_0x613a('0x5b'))](_0x202870[_0x613a('0x5c')]);});}})[_0x613a('0x20')](handleEntityNotFound(_0x589af8,null))['then'](removeEntity(_0x589af8,null))[_0x613a('0x3f')](handleError(_0x589af8,null));};exports['addSound']=function(_0x5e086d,_0xb06c48,_0x3e125b){return db['sequelize'][_0x613a('0x49')](function(_0x5e2ad6){var _0x5f01e3;return db[_0x613a('0x42')][_0x613a('0x44')]({'where':{'id':_0x5e086d['params']['id']}})[_0x613a('0x20')](function(_0x289f26){if(_0x289f26){_0x5f01e3=_0x289f26;return _0x289f26[_0x613a('0x5d')](_0x5e086d[_0x613a('0x46')]['id'],{'transaction':_0x5e2ad6});}})[_0x613a('0x20')](function(_0x19fcab){if(_0x19fcab){return db[_0x613a('0x5e')]['findOne']({'where':{'id':_0x5e086d[_0x613a('0x46')]['id']},'attributes':['id',_0x613a('0x25'),_0x613a('0x5f'),_0x613a('0x60'),_0x613a('0x61')],'raw':!![]});}})[_0x613a('0x20')](function(_0x504766){if(_0x504766){var _0x328539=path[_0x613a('0x4d')](config[_0x613a('0x4e')],_0x613a('0x62'),util[_0x613a('0x63')](_0x613a('0x64'),path[_0x613a('0x65')](_0x504766[_0x613a('0x5f')],path[_0x613a('0x66')](_0x504766['save_name'])),_0x504766['converted_format']));var _0x50d943=path['join'](config[_0x613a('0x4e')],'server/files/moh',_0x5f01e3[_0x613a('0x25')],util['format'](_0x613a('0x64'),_0x504766[_0x613a('0x25')],_0x504766[_0x613a('0x60')]));fs[_0x613a('0x67')](_0x328539,_0x50d943);return _0x504766;}})['catch'](function(_0x20d75a){throw new db['Sequelize'][(_0x613a('0x5b'))](_0x20d75a[_0x613a('0x5c')]);});})[_0x613a('0x20')](handleEntityNotFound(_0xb06c48,null))[_0x613a('0x20')](respondWithResult(_0xb06c48,0xc9))[_0x613a('0x3f')](handleError(_0xb06c48,null));};exports[_0x613a('0x68')]=function(_0x1ed520,_0x241714,_0x1b2311){return db[_0x613a('0x48')][_0x613a('0x49')](function(_0x3e2718){var _0x351637;return db[_0x613a('0x42')][_0x613a('0x69')]({'where':{'id':_0x1ed520[_0x613a('0x41')]['id']}})[_0x613a('0x20')](handleEntityNotFound(_0x241714,null))[_0x613a('0x20')](function(_0x514aac){if(_0x514aac){_0x351637=_0x514aac;return _0x514aac[_0x613a('0x68')](_0x1ed520[_0x613a('0x41')][_0x613a('0x6a')]);}})[_0x613a('0x20')](function(_0x54bb01){if(_0x54bb01){return db[_0x613a('0x5e')][_0x613a('0x69')]({'where':{'id':_0x1ed520[_0x613a('0x41')]['id2']},'attributes':['id',_0x613a('0x25'),_0x613a('0x5f'),_0x613a('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0xfe4b76){if(_0xfe4b76){fs[_0x613a('0x58')](path[_0x613a('0x4d')](_0x351637['directory'],util[_0x613a('0x63')](_0x613a('0x64'),_0xfe4b76['name'],_0xfe4b76[_0x613a('0x60')])));return _0xfe4b76;}})[_0x613a('0x3f')](function(_0x15f324){throw new db[(_0x613a('0x5a'))][(_0x613a('0x5b'))](_0x15f324[_0x613a('0x5c')]);});})[_0x613a('0x20')](handleEntityNotFound(_0x241714,null))[_0x613a('0x20')](respondWithStatusCode(_0x241714,0xcc))[_0x613a('0x3f')](handleError(_0x241714,null));};exports[_0x613a('0x6b')]=function(_0x52767a,_0x16d2de,_0x4bae88){var _0x278540={};var _0xf2ad11={};var _0xfb7949;var _0x37aa04;return db['VoiceMusicOnHold'][_0x613a('0x69')]({'where':{'id':_0x52767a['params']['id']}})['then'](handleEntityNotFound(_0x16d2de,null))[_0x613a('0x20')](function(_0x3832bb){if(_0x3832bb){_0xfb7949=_0x3832bb;_0xf2ad11[_0x613a('0x2c')]=_['keys'](db['Sound']['rawAttributes']);_0xf2ad11[_0x613a('0x2d')]=_[_0x613a('0x2e')](_0x52767a['query']);_0xf2ad11[_0x613a('0x2f')]=_[_0x613a('0x30')](_0xf2ad11['model'],_0xf2ad11[_0x613a('0x2d')]);_0x278540[_0x613a('0x31')]=_[_0x613a('0x30')](_0xf2ad11['model'],qs['fields'](_0x52767a['query'][_0x613a('0x32')]));_0x278540[_0x613a('0x31')]=_0x278540[_0x613a('0x31')][_0x613a('0x43')]?_0x278540['attributes']:_0xf2ad11[_0x613a('0x2c')];_0x278540['order']=qs['sort'](_0x52767a[_0x613a('0x2d')][_0x613a('0x36')]);_0x278540['where']=qs['filters'](_[_0x613a('0x37')](_0x52767a[_0x613a('0x2d')],_0xf2ad11[_0x613a('0x2f')]));if(_0x52767a[_0x613a('0x2d')]['filter']){_0x278540[_0x613a('0x39')]=_[_0x613a('0x3b')](_0x278540['where'],{'$or':_[_0x613a('0x28')](_0x278540['attributes'],function(_0x4dab4c){var _0x3c316b={};_0x3c316b[_0x4dab4c]={'$like':'%'+_0x52767a[_0x613a('0x2d')]['filter']+'%'};return _0x3c316b;})});}_0x278540=_[_0x613a('0x3b')]({},_0x278540,_0x52767a[_0x613a('0x3c')]);return _0xfb7949[_0x613a('0x6b')](_0x278540);}})[_0x613a('0x20')](function(_0x3cb68e){if(_0x3cb68e){_0x37aa04=_0x3cb68e['length'];if(!_0x52767a['query'][_0x613a('0x33')]('nolimit')){_0x278540[_0x613a('0x1a')]=qs['limit'](_0x52767a['query'][_0x613a('0x1a')]);_0x278540[_0x613a('0x18')]=qs['offset'](_0x52767a['query'][_0x613a('0x18')]);}return _0xfb7949[_0x613a('0x6b')](_0x278540);}})[_0x613a('0x20')](function(_0x568c71){if(_0x568c71){return _0x568c71?{'count':_0x37aa04,'rows':_0x568c71}:null;}})[_0x613a('0x20')](respondWithResult(_0x16d2de,null))[_0x613a('0x3f')](handleError(_0x16d2de,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 97e6e6c..5c8b917 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 _0x2039=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','moment','bluebird'];(function(_0x51280f,_0x3443d2){var _0x1ba0e9=function(_0x2158ec){while(--_0x2158ec){_0x51280f['push'](_0x51280f['shift']());}};_0x1ba0e9(++_0x3443d2);}(_0x2039,0x7f));var _0x9203=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2039[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9203('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9203('0x1'));var BPromise=require(_0x9203('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9203('0x3'));var rimraf=require(_0x9203('0x4'));var config=require(_0x9203('0x5'));var attributes=require(_0x9203('0x6'));module[_0x9203('0x7')]=function(_0x1b3862,_0x48ad9a){return _0x1b3862['define'](_0x9203('0x8'),attributes,{'tableName':_0x9203('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7606=['bluebird','request-promise','path','rimraf','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x7606,0xf7));var _0x6760=function(_0xc33ad2,_0xcc3046){_0xc33ad2=_0xc33ad2-0x0;var _0x2883f2=_0x7606[_0xc33ad2];return _0x2883f2;};'use strict';var _=require(_0x6760('0x0'));var util=require(_0x6760('0x1'));var logger=require(_0x6760('0x2'))(_0x6760('0x3'));var moment=require(_0x6760('0x4'));var BPromise=require(_0x6760('0x5'));var rp=require(_0x6760('0x6'));var fs=require('fs');var path=require(_0x6760('0x7'));var rimraf=require(_0x6760('0x8'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x6760('0x9')]=function(_0x210f4d,_0x4c4e64){return _0x210f4d['define'](_0x6760('0xa'),attributes,{'tableName':_0x6760('0xb'),'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 27ba6c7..54d07b0 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x36aa83,_0x100dfa){var _0x1df15c=function(_0x435de2){while(--_0x435de2){_0x36aa83['push'](_0x36aa83['shift']());}};_0x1df15c(++_0x100dfa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcb91[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x237577,_0x124a21){var _0x13cea8=function(_0x346de9){while(--_0x346de9){_0x237577['push'](_0x237577['shift']());}};_0x13cea8(++_0x124a21);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8f0cb17..e748ef3 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 _0x006d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','show','/:id/users','post','addAgents','addTeams','/:id','update','delete','destroy','removeAgents','/:id/teams','exports'];(function(_0x5b5907,_0x3b8995){var _0x3ea86d=function(_0x2c45fd){while(--_0x2c45fd){_0x5b5907['push'](_0x5b5907['shift']());}};_0x3ea86d(++_0x3b8995);}(_0x006d,0xea));var _0xd006=function(_0x3bca67,_0x1cdaf7){_0x3bca67=_0x3bca67-0x0;var _0x1dff2c=_0x006d[_0x3bca67];return _0x1dff2c;};'use strict';var multer=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var path=require(_0xd006('0x2'));var timeout=require(_0xd006('0x3'));var express=require(_0xd006('0x4'));var router=express[_0xd006('0x5')]();var fs_extra=require(_0xd006('0x6'));var auth=require(_0xd006('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd006('0x8'));router[_0xd006('0x9')]('/',auth['isAuthenticated'](),controller[_0xd006('0xa')]);router['get'](_0xd006('0xb'),auth[_0xd006('0xc')](),controller[_0xd006('0xd')]);router[_0xd006('0x9')]('/:id',auth[_0xd006('0xc')](),controller[_0xd006('0xe')]);router[_0xd006('0x9')](_0xd006('0xf'),auth[_0xd006('0xc')](),controller['getAgents']);router[_0xd006('0x9')]('/:id/teams',auth[_0xd006('0xc')](),controller['getTeams']);router[_0xd006('0x10')]('/',auth[_0xd006('0xc')](),controller['create']);router[_0xd006('0x10')](_0xd006('0xf'),auth['isAuthenticated'](),controller[_0xd006('0x11')]);router['post']('/:id/teams',auth[_0xd006('0xc')](),controller[_0xd006('0x12')]);router['put'](_0xd006('0x13'),auth['isAuthenticated'](),controller[_0xd006('0x14')]);router[_0xd006('0x15')](_0xd006('0x13'),auth['isAuthenticated'](),controller[_0xd006('0x16')]);router[_0xd006('0x15')](_0xd006('0xf'),auth[_0xd006('0xc')](),controller[_0xd006('0x17')]);router[_0xd006('0x15')](_0xd006('0x18'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xd006('0x19')]=router; \ No newline at end of file +var _0xca54=['../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','put','update','delete','removeTeams','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x19b706,_0xcf936c){var _0x4c877c=function(_0x527d6){while(--_0x527d6){_0x19b706['push'](_0x19b706['shift']());}};_0x4c877c(++_0xcf936c);}(_0xca54,0x9c));var _0x4ca5=function(_0x52425d,_0x18f391){_0x52425d=_0x52425d-0x0;var _0x26bdae=_0xca54[_0x52425d];return _0x26bdae;};'use strict';var multer=require('multer');var util=require(_0x4ca5('0x0'));var path=require(_0x4ca5('0x1'));var timeout=require(_0x4ca5('0x2'));var express=require(_0x4ca5('0x3'));var router=express[_0x4ca5('0x4')]();var fs_extra=require(_0x4ca5('0x5'));var auth=require(_0x4ca5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ca5('0x7'));var controller=require('./voicePrefix.controller');router[_0x4ca5('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ca5('0x9')]);router[_0x4ca5('0x8')](_0x4ca5('0xa'),auth['isAuthenticated'](),controller[_0x4ca5('0xb')]);router[_0x4ca5('0x8')](_0x4ca5('0xc'),auth[_0x4ca5('0xd')](),controller[_0x4ca5('0xe')]);router[_0x4ca5('0x8')](_0x4ca5('0xf'),auth[_0x4ca5('0xd')](),controller[_0x4ca5('0x10')]);router[_0x4ca5('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4ca5('0x11')]);router[_0x4ca5('0x12')]('/',auth[_0x4ca5('0xd')](),controller[_0x4ca5('0x13')]);router['post'](_0x4ca5('0xf'),auth[_0x4ca5('0xd')](),controller[_0x4ca5('0x14')]);router[_0x4ca5('0x12')](_0x4ca5('0x15'),auth[_0x4ca5('0xd')](),controller[_0x4ca5('0x16')]);router[_0x4ca5('0x17')]('/:id',auth[_0x4ca5('0xd')](),controller[_0x4ca5('0x18')]);router[_0x4ca5('0x19')]('/:id',auth[_0x4ca5('0xd')](),controller['destroy']);router[_0x4ca5('0x19')]('/:id/users',auth[_0x4ca5('0xd')](),controller['removeAgents']);router[_0x4ca5('0x19')](_0x4ca5('0x15'),auth['isAuthenticated'](),controller[_0x4ca5('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 5981894..653f6d2 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 _0xccfa=['name','system-','getDataValue','sequelize','exports','STRING'];(function(_0x417d7a,_0x2ae287){var _0x5ee48f=function(_0x56ab2e){while(--_0x56ab2e){_0x417d7a['push'](_0x417d7a['shift']());}};_0x5ee48f(++_0x2ae287);}(_0xccfa,0x1cb));var _0xaccf=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xccfa[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require(_0xaccf('0x0'));module[_0xaccf('0x1')]={'name':{'type':Sequelize[_0xaccf('0x2')],'allowNull':![],'unique':_0xaccf('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x4233fa){return _0xaccf('0x4')+this[_0xaccf('0x5')](_0xaccf('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xaccf('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9315=['INTEGER','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9315,0x12d));var _0x5931=function(_0xfd5c9f,_0x2a4912){_0xfd5c9f=_0xfd5c9f-0x0;var _0x30fee2=_0x9315[_0xfd5c9f];return _0x30fee2;};'use strict';var Sequelize=require(_0x5931('0x0'));module['exports']={'name':{'type':Sequelize[_0x5931('0x1')],'allowNull':![],'unique':_0x5931('0x2')},'prefix':{'type':Sequelize[_0x5931('0x3')],'get':function(_0x2e2604){return _0x5931('0x4')+this['getDataValue'](_0x5931('0x2'))+'-';}},'description':{'type':Sequelize[_0x5931('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x5931('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d03cb1a..4bd0437 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 _0xb78e=['userVoicePrefix:remove','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','get','VoicePrefixes','destroy','sendStatus','name','index','map','VoicePrefix','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','catch','params','keys','rawAttributes','length','includeAll','find','create','sequelize','transaction','body','VoiceExtension','user','userProfileId','autoAssociation','error','exten','app','system','description','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','emit','removeAgents','getAgents','User','pick','merge','getTeams','findOne','Team','addTeams','Agents','online','interface','flatMap','each','upsert','UserVoicePrefix','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty'];(function(_0x4a6fac,_0x398714){var _0x109bfa=function(_0x38cabd){while(--_0x38cabd){_0x4a6fac['push'](_0x4a6fac['shift']());}};_0x109bfa(++_0x398714);}(_0xb78e,0x1c9));var _0xeb78=function(_0x57c8b0,_0x1c8d9d){_0x57c8b0=_0x57c8b0-0x0;var _0x416302=_0xb78e[_0x57c8b0];return _0x416302;};'use strict';var emlformat=require(_0xeb78('0x0'));var rimraf=require(_0xeb78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb78('0x2'));var rp=require(_0xeb78('0x3'));var moment=require(_0xeb78('0x4'));var BPromise=require(_0xeb78('0x5'));var Mustache=require(_0xeb78('0x6'));var util=require(_0xeb78('0x7'));var path=require(_0xeb78('0x8'));var sox=require(_0xeb78('0x9'));var csv=require('to-csv');var ejs=require(_0xeb78('0xa'));var fs=require('fs');var fs_extra=require(_0xeb78('0xb'));var _=require(_0xeb78('0xc'));var squel=require(_0xeb78('0xd'));var crypto=require(_0xeb78('0xe'));var jsforce=require(_0xeb78('0xf'));var deskjs=require(_0xeb78('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeb78('0x11'));var Papa=require(_0xeb78('0x12'));var Redis=require(_0xeb78('0x13'));var authService=require(_0xeb78('0x14'));var qs=require(_0xeb78('0x15'));var as=require(_0xeb78('0x16'));var hardwareService=require(_0xeb78('0x17'));var logger=require(_0xeb78('0x18'))(_0xeb78('0x19'));var utils=require('../../config/utils');var config=require(_0xeb78('0x1a'));var licenseUtil=require(_0xeb78('0x1b'));var db=require(_0xeb78('0x1c'))['db'];config[_0xeb78('0x1d')]=_[_0xeb78('0x1e')](config[_0xeb78('0x1d')],{'host':_0xeb78('0x1f'),'port':0x18eb});var socket=require(_0xeb78('0x20'))(new Redis(config[_0xeb78('0x1d')]));require(_0xeb78('0x21'))['register'](socket);function respondWithStatusCode(_0x315914,_0x3e4d24){_0x3e4d24=_0x3e4d24||0xcc;return function(_0x4e8b8c){if(_0x4e8b8c){return _0x315914['sendStatus'](_0x3e4d24);}return _0x315914['status'](_0x3e4d24)[_0xeb78('0x22')]();};}function respondWithResult(_0x50ebae,_0xa28d5e){_0xa28d5e=_0xa28d5e||0xc8;return function(_0x247cb1){if(_0x247cb1){return _0x50ebae['status'](_0xa28d5e)[_0xeb78('0x23')](_0x247cb1);}};}function respondWithFilteredResult(_0x53c811,_0x21c521){return function(_0x92e410){if(_0x92e410){var _0x576802=typeof _0x21c521[_0xeb78('0x24')]===_0xeb78('0x25')&&typeof _0x21c521[_0xeb78('0x26')]==='undefined';var _0x24d845=_0x92e410[_0xeb78('0x27')];var _0x4ab933=_0x576802?0x0:_0x21c521['offset'];var _0x455e30=_0x576802?_0x92e410[_0xeb78('0x27')]:_0x21c521[_0xeb78('0x24')]+_0x21c521[_0xeb78('0x26')];var _0x432b18;if(_0x455e30>=_0x24d845){_0x455e30=_0x24d845;_0x432b18=0xc8;}else{_0x432b18=0xce;}_0x53c811[_0xeb78('0x28')](_0x432b18);return _0x53c811[_0xeb78('0x29')](_0xeb78('0x2a'),_0x4ab933+'-'+_0x455e30+'/'+_0x24d845)[_0xeb78('0x23')](_0x92e410);}return null;};}function patchUpdates(_0x52b8c1){return function(_0x5d3cf8){try{jsonpatch['apply'](_0x5d3cf8,_0x52b8c1,!![]);}catch(_0x5c9e0d){return BPromise[_0xeb78('0x2b')](_0x5c9e0d);}return _0x5d3cf8['save']();};}function saveUpdates(_0x2159c1,_0x1fbf2f){return function(_0x566336){if(_0x566336){return _0x566336[_0xeb78('0x2c')](_0x2159c1)['then'](function(_0x9a00b){return _0x9a00b;});}return null;};}function removeEntity(_0x5fc575,_0x315f98){return function(_0x12b3b2){if(_0x12b3b2){return _0x12b3b2['destroy']()[_0xeb78('0x2d')](function(){var _0x515158=_0x12b3b2[_0xeb78('0x2e')]({'plain':!![]});var _0x23295a=_0xeb78('0x2f');return db['UserProfileResource'][_0xeb78('0x30')]({'where':{'type':_0x23295a,'resourceId':_0x515158['id']}})[_0xeb78('0x2d')](function(){return _0x12b3b2;});})[_0xeb78('0x2d')](function(){_0x5fc575[_0xeb78('0x28')](0xcc)[_0xeb78('0x22')]();});}};}function handleEntityNotFound(_0x3516b8,_0x1131a9){return function(_0x22c25f){if(!_0x22c25f){_0x3516b8[_0xeb78('0x31')](0x194);}return _0x22c25f;};}function handleError(_0x19ad00,_0x1f3a14){_0x1f3a14=_0x1f3a14||0x1f4;return function(_0x505468){logger['error'](_0x505468['stack']);if(_0x505468[_0xeb78('0x32')]){delete _0x505468[_0xeb78('0x32')];}_0x19ad00[_0xeb78('0x28')](_0x1f3a14)['send'](_0x505468);};}exports[_0xeb78('0x33')]=function(_0x1ecdfb,_0x3de59f){var _0x83b35d={},_0x4e720c={},_0x1a0ce6={'count':0x0,'rows':[]};var _0x1ec0bc=_[_0xeb78('0x34')](db[_0xeb78('0x35')]['rawAttributes'],function(_0x3ff33f){return{'name':_0x3ff33f['fieldName'],'type':_0x3ff33f[_0xeb78('0x36')][_0xeb78('0x37')]};});_0x4e720c[_0xeb78('0x38')]=_[_0xeb78('0x34')](_0x1ec0bc,_0xeb78('0x32'));_0x4e720c[_0xeb78('0x39')]=_['keys'](_0x1ecdfb['query']);_0x4e720c[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x4e720c[_0xeb78('0x38')],_0x4e720c[_0xeb78('0x39')]);_0x83b35d[_0xeb78('0x3c')]=_['intersection'](_0x4e720c[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x83b35d[_0xeb78('0x3c')]=_0x83b35d[_0xeb78('0x3c')]['length']?_0x83b35d['attributes']:_0x4e720c['model'];if(!_0x1ecdfb['query'][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x83b35d[_0xeb78('0x26')]=qs['limit'](_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x26')]);_0x83b35d['offset']=qs['offset'](_0x1ecdfb['query'][_0xeb78('0x24')]);}_0x83b35d[_0xeb78('0x40')]=qs[_0xeb78('0x41')](_0x1ecdfb['query'][_0xeb78('0x41')]);_0x83b35d[_0xeb78('0x42')]=qs[_0xeb78('0x3a')](_['pick'](_0x1ecdfb[_0xeb78('0x39')],_0x4e720c[_0xeb78('0x3a')]),_0x1ec0bc);if(_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x43')]){_0x83b35d['where']=_['merge'](_0x83b35d[_0xeb78('0x42')],{'$or':_[_0xeb78('0x34')](_0x1ec0bc,function(_0x2e416b){if(_0x2e416b[_0xeb78('0x36')]!==_0xeb78('0x44')){var _0x2fbdb4={};_0x2fbdb4[_0x2e416b[_0xeb78('0x32')]]={'$like':'%'+_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x43')]+'%'};return _0x2fbdb4;}})});}_0x83b35d=_['merge']({},_0x83b35d,_0x1ecdfb[_0xeb78('0x45')]);var _0xa02a32={'where':_0x83b35d[_0xeb78('0x42')]};return db['VoicePrefix'][_0xeb78('0x27')](_0xa02a32)['then'](function(_0x21f81b){_0x1a0ce6[_0xeb78('0x27')]=_0x21f81b;if(_0x1ecdfb[_0xeb78('0x39')]['includeAll']){_0x83b35d[_0xeb78('0x46')]=[{'all':!![]}];}return db[_0xeb78('0x35')][_0xeb78('0x47')](_0x83b35d);})[_0xeb78('0x2d')](function(_0x2dc9f7){_0x1a0ce6['rows']=_0x2dc9f7;return _0x1a0ce6;})[_0xeb78('0x2d')](respondWithFilteredResult(_0x3de59f,_0x83b35d))[_0xeb78('0x48')](handleError(_0x3de59f,null));};exports['show']=function(_0xece1cb,_0x31a146){var _0x1f2610={'raw':![],'where':{'id':_0xece1cb[_0xeb78('0x49')]['id']}},_0x51dfbc={};_0x51dfbc[_0xeb78('0x38')]=_[_0xeb78('0x4a')](db[_0xeb78('0x35')][_0xeb78('0x4b')]);_0x51dfbc[_0xeb78('0x39')]=_['keys'](_0xece1cb['query']);_0x51dfbc[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x51dfbc['model'],_0x51dfbc[_0xeb78('0x39')]);_0x1f2610[_0xeb78('0x3c')]=_[_0xeb78('0x3b')](_0x51dfbc[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0xece1cb[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x1f2610[_0xeb78('0x3c')]=_0x1f2610[_0xeb78('0x3c')][_0xeb78('0x4c')]?_0x1f2610[_0xeb78('0x3c')]:_0x51dfbc[_0xeb78('0x38')];if(_0xece1cb[_0xeb78('0x39')][_0xeb78('0x4d')]){_0x1f2610[_0xeb78('0x46')]=[{'all':!![]}];}_0x1f2610=_['merge']({},_0x1f2610,_0xece1cb[_0xeb78('0x45')]);return db[_0xeb78('0x35')][_0xeb78('0x4e')](_0x1f2610)[_0xeb78('0x2d')](handleEntityNotFound(_0x31a146,null))['then'](respondWithResult(_0x31a146,null))[_0xeb78('0x48')](handleError(_0x31a146,null));};exports[_0xeb78('0x30')]=function(_0xcaccc5,_0x3d30a4){return db[_0xeb78('0x35')]['find']({'where':{'id':_0xcaccc5['params']['id']}})['then'](handleEntityNotFound(_0x3d30a4,null))[_0xeb78('0x2d')](removeEntity(_0x3d30a4,null))[_0xeb78('0x48')](handleError(_0x3d30a4,null));};exports['describe']=function(_0x10efdb,_0x43164f){return db[_0xeb78('0x35')]['describe']()['then'](respondWithResult(_0x43164f,null))[_0xeb78('0x48')](handleError(_0x43164f,null));};exports[_0xeb78('0x4f')]=function(_0x1f5b67,_0x4e3f1a){var _0x3c7214;return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x4a3c91){return db['VoicePrefix']['create'](_0x1f5b67[_0xeb78('0x52')],{'transaction':_0x4a3c91})[_0xeb78('0x2d')](function(_0x55c643){_0x3c7214=_0x55c643[_0xeb78('0x2e')]({'plain':!![]});return db[_0xeb78('0x53')][_0xeb78('0x4e')]({'where':{'id':_0x3c7214['VoiceExtensionId']},'raw':!![]})[_0xeb78('0x2d')](function(_0x572aaf){return createVoicePrefixExtensions(_0x3c7214,_0x572aaf,_0x4a3c91);});});})[_0xeb78('0x2d')](function(){var _0x151083=_0x1f5b67[_0xeb78('0x54')]['get']({'plain':!![]});if(!_0x151083)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x151083['role']==='user'){var _0x3238e9=_0x3c7214;return db['UserProfileSection'][_0xeb78('0x4e')]({'where':{'name':_0xeb78('0x2f'),'userProfileId':_0x151083[_0xeb78('0x55')]},'raw':!![]})[_0xeb78('0x2d')](function(_0x2a1f7f){if(_0x2a1f7f&&_0x2a1f7f[_0xeb78('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x3238e9[_0xeb78('0x32')],'resourceId':_0x3238e9['id'],'type':_0x2a1f7f[_0xeb78('0x32')],'sectionId':_0x2a1f7f['id']},{})[_0xeb78('0x2d')](function(){return _0x3c7214;});}else{return _0x3c7214;}})[_0xeb78('0x48')](function(_0x480093){logger[_0xeb78('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x480093);throw _0x480093;});}return _0x3c7214;})[_0xeb78('0x2d')](respondWithResult(_0x4e3f1a,null))[_0xeb78('0x48')](handleError(_0x4e3f1a,null));};function Extension(_0x1d4761,_0x5b4998,_0x363cec,_0x37649c){this['context']='from-sip';this[_0xeb78('0x58')]=_0x1d4761;this[_0xeb78('0x59')]=_0x363cec;this['type']=_0xeb78('0x5a');this[_0xeb78('0x5b')]='Voice\x20Prefix\x20Extension';this['priority']=_0x5b4998;this[_0xeb78('0x5c')]=_0x37649c;}function createVoicePrefixExtensions(_0x5baf31,_0x539ad7,_0x2029ea){return new BPromise(function(_0x486899,_0x27b425){var _0x42c249=new Extension(formatPrefixName(_0x5baf31[_0xeb78('0x5d')]),0x1,'NoOp',_0xeb78('0x5e'));_0x42c249[_0xeb78('0x5f')]=_0x5baf31['id'];return db[_0xeb78('0x53')]['create'](_0x42c249,{'transaction':_0x2029ea})[_0xeb78('0x2d')](function(_0x4ec4ec){var _0xd61214=_0x4ec4ec[_0xeb78('0x2e')]({'plain':!![]});var _0x45aeaf=_[_0xeb78('0x34')](addVoicePrefixExtensions(_0x5baf31,_0x539ad7),function(_0x50d38d){_0x50d38d[_0xeb78('0x60')]=_0xd61214['id'];_0x50d38d['VoicePrefixId']=_0x5baf31['id'];return _0x50d38d;});return db[_0xeb78('0x53')][_0xeb78('0x61')](_0x45aeaf,{'transaction':_0x2029ea})[_0xeb78('0x2d')](function(_0x442fa7){if(!_0x442fa7){return _0x27b425(_0xeb78('0x62'));}else{return _0x486899(_0x442fa7);}})['catch'](function(_0x2ffe3b){return _0x27b425(_0x2ffe3b);});});;});};function addVoicePrefixExtensions(_0x2bf5a8,_0xf7eebe){var _0x22aa3a=[];var _0x3eb9c5=formatPrefixName(_0x2bf5a8[_0xeb78('0x5d')]);_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x2,_0xeb78('0x64'),_0xeb78('0x65')+_0x2bf5a8[_0xeb78('0x32')]));if(_0x2bf5a8[_0xeb78('0x66')]){_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x3,_0xeb78('0x64'),_0xeb78('0x67')+_0x2bf5a8[_0xeb78('0x66')]));}else{_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x3,'NoOp',_0xeb78('0x68')));}_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x4,_0xeb78('0x69'),_0xf7eebe['context']+','+_0xeb78('0x6a')+(0x8+_0x2bf5a8[_0xeb78('0x32')][_0xeb78('0x4c')])+'}'+','+0x1));return _0x22aa3a;}function formatPrefixName(_0x2208c2){var _0xe88f54='_';for(var _0x2d6f67=0x0;_0x2d6f67<_0x2208c2[_0xeb78('0x4c')];_0x2d6f67++){if(_0x2208c2[_0xeb78('0x6b')](_0x2d6f67)=='-'){_0xe88f54+=_0x2208c2[_0xeb78('0x6b')](_0x2d6f67);}else{_0xe88f54+='['+_0x2208c2['charAt'](_0x2d6f67)+']';}}_0xe88f54+='.';return _0xe88f54;}exports['update']=function(_0x2bf610,_0x129e0e,_0x44a2c8){var _0x30c186=_0x2bf610[_0xeb78('0x52')];_0x30c186[_0xeb78('0x5d')]=_0xeb78('0x6c')+_0x30c186[_0xeb78('0x32')]+'-';return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x5c27de){return db[_0xeb78('0x35')][_0xeb78('0x2c')](_0x30c186,{'where':{'id':_0x30c186['id']},'transaction':_0x5c27de})[_0xeb78('0x2d')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x30c186['id']},'transaction':_0x5c27de})['then'](function(){return db['VoiceExtension'][_0xeb78('0x4e')]({'where':{'id':_0x30c186[_0xeb78('0x60')]},'raw':!![]})[_0xeb78('0x2d')](function(_0xf89f26){return createVoicePrefixExtensions(_0x30c186,_0xf89f26,_0x5c27de);});});});})[_0xeb78('0x2d')](function(){return db[_0xeb78('0x35')][_0xeb78('0x6d')](_0x30c186['id']);})[_0xeb78('0x2d')](respondWithResult(_0x129e0e,null))[_0xeb78('0x48')](handleError(_0x129e0e,null));};exports[_0xeb78('0x6e')]=function(_0x259525,_0x53cf73,_0x42cfd1){return db['VoicePrefix'][_0xeb78('0x4e')]({'where':{'id':_0x259525['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x53cf73,null))[_0xeb78('0x2d')](function(_0x2a9d4d){if(_0x2a9d4d){return _0x2a9d4d[_0xeb78('0x6e')](_0x259525[_0xeb78('0x52')]['ids'],_[_0xeb78('0x6f')](_0x259525[_0xeb78('0x52')],[_0xeb78('0x70'),'id'])||{})[_0xeb78('0x71')](function(_0x3896a1){for(var _0x2da098=0x0;_0x2da098<_0x259525[_0xeb78('0x52')][_0xeb78('0x70')][_0xeb78('0x4c')];_0x2da098+=0x1){socket[_0xeb78('0x72')]('userVoicePrefix:save',{'UserId':Number(_0x259525[_0xeb78('0x52')][_0xeb78('0x70')][_0x2da098]),'VoicePrefixId':Number(_0x259525[_0xeb78('0x49')]['id'])});}return _0x3896a1;});}})[_0xeb78('0x2d')](respondWithResult(_0x53cf73,null))[_0xeb78('0x48')](handleError(_0x53cf73,null));};exports[_0xeb78('0x73')]=function(_0x37217c,_0x5dbfef,_0x37a587){return db['VoicePrefix'][_0xeb78('0x4e')]({'where':{'id':_0x37217c[_0xeb78('0x49')]['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x5dbfef,null))['then'](function(_0x1732e5){if(_0x1732e5){return _0x1732e5[_0xeb78('0x73')](_0x37217c['query'][_0xeb78('0x70')])[_0xeb78('0x2d')](function(){if(_['isArray'](_0x37217c[_0xeb78('0x39')][_0xeb78('0x70')])){for(var _0x1f000b=0x0;_0x1f000b<_0x37217c['query'][_0xeb78('0x70')][_0xeb78('0x4c')];_0x1f000b+=0x1){socket[_0xeb78('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x37217c[_0xeb78('0x39')][_0xeb78('0x70')][_0x1f000b]),'VoicePrefixId':Number(_0x37217c['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x37217c['query'][_0xeb78('0x70')]),'VoicePrefixId':Number(_0x37217c[_0xeb78('0x49')]['id'])});}});}})[_0xeb78('0x2d')](respondWithStatusCode(_0x5dbfef,null))[_0xeb78('0x48')](handleError(_0x5dbfef,null));};exports[_0xeb78('0x74')]=function(_0x468483,_0x7fc774,_0x34a1f3){var _0x3232a8={};var _0xd3ed51={};var _0x3386f3;var _0x21e3ac;return db[_0xeb78('0x35')]['findOne']({'where':{'id':_0x468483['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x7fc774,null))[_0xeb78('0x2d')](function(_0x39f1cc){if(_0x39f1cc){_0x3386f3=_0x39f1cc;_0xd3ed51[_0xeb78('0x38')]=_[_0xeb78('0x4a')](db[_0xeb78('0x75')]['rawAttributes']);_0xd3ed51[_0xeb78('0x39')]=_[_0xeb78('0x4a')](_0x468483['query']);_0xd3ed51[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0xd3ed51[_0xeb78('0x38')],_0xd3ed51[_0xeb78('0x39')]);_0x3232a8[_0xeb78('0x3c')]=_[_0xeb78('0x3b')](_0xd3ed51[_0xeb78('0x38')],qs['fields'](_0x468483[_0xeb78('0x39')]['fields']));_0x3232a8[_0xeb78('0x3c')]=_0x3232a8[_0xeb78('0x3c')][_0xeb78('0x4c')]?_0x3232a8[_0xeb78('0x3c')]:_0xd3ed51['model'];_0x3232a8[_0xeb78('0x40')]=qs['sort'](_0x468483['query'][_0xeb78('0x41')]);_0x3232a8[_0xeb78('0x42')]=qs[_0xeb78('0x3a')](_[_0xeb78('0x76')](_0x468483[_0xeb78('0x39')],_0xd3ed51[_0xeb78('0x3a')]));if(_0x468483[_0xeb78('0x39')][_0xeb78('0x43')]){_0x3232a8[_0xeb78('0x42')]=_['merge'](_0x3232a8['where'],{'$or':_[_0xeb78('0x34')](_0x3232a8[_0xeb78('0x3c')],function(_0x2ea1fe){var _0x49936c={};_0x49936c[_0x2ea1fe]={'$like':'%'+_0x468483[_0xeb78('0x39')][_0xeb78('0x43')]+'%'};return _0x49936c;})});}_0x3232a8=_[_0xeb78('0x77')]({},_0x3232a8,_0x468483[_0xeb78('0x45')]);return _0x3386f3['getAgents'](_0x3232a8);}})['then'](function(_0x493f82){if(_0x493f82){_0x21e3ac=_0x493f82['length'];if(!_0x468483[_0xeb78('0x39')][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x3232a8[_0xeb78('0x26')]=qs[_0xeb78('0x26')](_0x468483[_0xeb78('0x39')]['limit']);_0x3232a8[_0xeb78('0x24')]=qs[_0xeb78('0x24')](_0x468483[_0xeb78('0x39')][_0xeb78('0x24')]);}return _0x3386f3[_0xeb78('0x74')](_0x3232a8);}})[_0xeb78('0x2d')](function(_0x51a349){if(_0x51a349){return _0x51a349?{'count':_0x21e3ac,'rows':_0x51a349}:null;}})[_0xeb78('0x2d')](respondWithResult(_0x7fc774,null))['catch'](handleError(_0x7fc774,null));};exports[_0xeb78('0x78')]=function(_0x506734,_0x30eb7c,_0x43637d){var _0x1ad737={};var _0x25cb1c={};var _0x335008;var _0x5d6506;return db[_0xeb78('0x35')][_0xeb78('0x79')]({'where':{'id':_0x506734['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x30eb7c,null))['then'](function(_0x2e9eb9){if(_0x2e9eb9){_0x335008=_0x2e9eb9;_0x25cb1c['model']=_[_0xeb78('0x4a')](db[_0xeb78('0x7a')][_0xeb78('0x4b')]);_0x25cb1c[_0xeb78('0x39')]=_[_0xeb78('0x4a')](_0x506734[_0xeb78('0x39')]);_0x25cb1c[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x25cb1c['model'],_0x25cb1c[_0xeb78('0x39')]);_0x1ad737[_0xeb78('0x3c')]=_['intersection'](_0x25cb1c[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0x506734[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x1ad737[_0xeb78('0x3c')]=_0x1ad737['attributes'][_0xeb78('0x4c')]?_0x1ad737[_0xeb78('0x3c')]:_0x25cb1c['model'];_0x1ad737[_0xeb78('0x40')]=qs[_0xeb78('0x41')](_0x506734['query'][_0xeb78('0x41')]);_0x1ad737[_0xeb78('0x42')]=qs['filters'](_[_0xeb78('0x76')](_0x506734['query'],_0x25cb1c['filters']));if(_0x506734[_0xeb78('0x39')][_0xeb78('0x43')]){_0x1ad737[_0xeb78('0x42')]=_[_0xeb78('0x77')](_0x1ad737[_0xeb78('0x42')],{'$or':_[_0xeb78('0x34')](_0x1ad737[_0xeb78('0x3c')],function(_0x2da372){var _0x1a929b={};_0x1a929b[_0x2da372]={'$like':'%'+_0x506734[_0xeb78('0x39')]['filter']+'%'};return _0x1a929b;})});}_0x1ad737=_['merge']({},_0x1ad737,_0x506734[_0xeb78('0x45')]);return _0x335008[_0xeb78('0x78')](_0x1ad737);}})[_0xeb78('0x2d')](function(_0x3f99a1){if(_0x3f99a1){_0x5d6506=_0x3f99a1[_0xeb78('0x4c')];if(!_0x506734[_0xeb78('0x39')][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x1ad737[_0xeb78('0x26')]=qs[_0xeb78('0x26')](_0x506734[_0xeb78('0x39')][_0xeb78('0x26')]);_0x1ad737['offset']=qs['offset'](_0x506734[_0xeb78('0x39')]['offset']);}return _0x335008[_0xeb78('0x78')](_0x1ad737);}})['then'](function(_0x577f5f){if(_0x577f5f){return _0x577f5f?{'count':_0x5d6506,'rows':_0x577f5f}:null;}})[_0xeb78('0x2d')](respondWithResult(_0x30eb7c,null))[_0xeb78('0x48')](handleError(_0x30eb7c,null));};exports[_0xeb78('0x7b')]=function(_0x371c1d,_0x29a90d,_0xb69f0e){var _0x370f7a=_0x371c1d[_0xeb78('0x52')]['ids'];var _0x12773a;return db[_0xeb78('0x7a')]['findAll']({'where':{'id':_0x370f7a},'attributes':['id'],'include':[{'model':db[_0xeb78('0x75')],'as':_0xeb78('0x7c'),'attributes':['id',_0xeb78('0x32'),_0xeb78('0x7d'),'voicePause',_0xeb78('0x7e')],'raw':!![]}]})['then'](function(_0x64848b){if(_0x64848b){_0x12773a=_0x64848b;var _0x15b7d3=_[_0xeb78('0x7f')](_0x64848b,function(_0x523dc9){var _0x2401c8=_0x523dc9[_0xeb78('0x2e')]({'plain':!![]});return _0x2401c8[_0xeb78('0x7c')];});return db[_0xeb78('0x35')][_0xeb78('0x4e')]({'where':{'id':_0x371c1d[_0xeb78('0x49')]['id']}})[_0xeb78('0x2d')](function(_0x12b7d7){return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x3e7088){return _0x12b7d7[_0xeb78('0x7b')](_0x370f7a,{'transaction':_0x3e7088})[_0xeb78('0x2d')](function(){return BPromise[_0xeb78('0x80')](_0x12773a,function(_0x5b1d20){return db['TeamVoicePrefix'][_0xeb78('0x81')]({'TeamId':_0x5b1d20['id'],'VoicePrefixId':_0x371c1d[_0xeb78('0x49')]['id']},{'transaction':_0x3e7088});});})[_0xeb78('0x2d')](function(){return BPromise[_0xeb78('0x80')](_0x15b7d3,function(_0x4c2c7e){return db[_0xeb78('0x82')]['findOrCreate']({'where':{'UserId':_0x4c2c7e['id'],'VoicePrefixId':_0x371c1d['params']['id']},'transaction':_0x3e7088});});})['then'](function(){_0x15b7d3[_0xeb78('0x83')](function(_0x1f5d36){socket['emit']('userVoicePrefix:save',{'UserId':_0x1f5d36['id'],'VoicePrefixId':_0x12b7d7['id']});});});});});}})['then'](respondWithStatusCode(_0x29a90d,null))[_0xeb78('0x48')](handleError(_0x29a90d,null));};exports[_0xeb78('0x84')]=function(_0x5fb310,_0x5553cf,_0x3d4163){return db[_0xeb78('0x7a')][_0xeb78('0x47')]({'where':{'id':_0x5fb310[_0xeb78('0x39')][_0xeb78('0x70')]},'attributes':['id'],'include':[{'model':db[_0xeb78('0x75')],'as':_0xeb78('0x7c'),'attributes':['id'],'raw':!![]}]})[_0xeb78('0x2d')](handleEntityNotFound(_0x5553cf,null))[_0xeb78('0x2d')](function(_0x502af6){var _0x32f23a=_[_0xeb78('0x34')](_0x502af6,'id');var _0x5a1c25=[];var _0x3e2374=[];var _0x3a80b7=squel[_0xeb78('0x85')]();_0x3a80b7[_0xeb78('0x86')](_0xeb78('0x87'))[_0xeb78('0x88')](_0xeb78('0x89'),'tq')[_0xeb78('0x8a')]('user_has_teams','ut',_0xeb78('0x8b'))[_0xeb78('0x42')](_0xeb78('0x8c'),_0x5fb310['params']['id']);for(var _0x55515a=0x0;_0x55515a<_0x502af6[_0xeb78('0x4c')];_0x55515a+=0x1){let _0x207202=_0x502af6[_0x55515a];for(var _0x5edbef=0x0;_0x5edbef<_0x207202[_0xeb78('0x7c')][_0xeb78('0x4c')];_0x5edbef+=0x1){let _0x55041b=_0x207202[_0xeb78('0x7c')][_0x5edbef];var _0x13d95b=_0x3a80b7['clone']();_0x13d95b[_0xeb78('0x42')](_0xeb78('0x8d'),_0x55041b['id']);_0x3e2374['push'](db[_0xeb78('0x50')][_0xeb78('0x39')](_0x13d95b[_0xeb78('0x8e')](),{'type':db[_0xeb78('0x50')][_0xeb78('0x8f')][_0xeb78('0x90')]})[_0xeb78('0x2d')](function(_0x5df43e){if(_0x5df43e[_0xeb78('0x4c')]===0x1){return _0x55041b['id'];}else{var _0x399b9c=_[_0xeb78('0x91')](_[_0xeb78('0x34')](_0x5df43e,_0xeb78('0x92')),function(_0x4beb24){return _['includes'](_0x32f23a,_0x4beb24);});if(_0x399b9c){return _0x55041b['id'];}}}));}}return BPromise[_0xeb78('0x93')](_0x3e2374)[_0xeb78('0x2d')](function(_0x497b99){_0x5a1c25=_(_0x5a1c25)['union'](_0x497b99)[_0xeb78('0x94')]()[_0xeb78('0x95')]();return db[_0xeb78('0x35')][_0xeb78('0x4e')]({'where':{'id':_0x5fb310[_0xeb78('0x49')]['id']}})['then'](function(_0x326468){return db['sequelize']['transaction'](function(_0x1170d3){return _0x326468['removeTeams'](_0x5fb310[_0xeb78('0x39')]['ids'],{'transaction':_0x1170d3})['then'](function(){if(!_[_0xeb78('0x96')](_0x5a1c25)){return _0x326468[_0xeb78('0x73')](_0x5a1c25,{'transaction':_0x1170d3});}})['then'](function(){_0x5a1c25[_0xeb78('0x83')](function(_0x10f23e){socket['emit'](_0xeb78('0x97'),{'UserId':_0x10f23e,'VoicePrefixId':_0x326468['id']});});});});});});})[_0xeb78('0x2d')](respondWithStatusCode(_0x5553cf,null))[_0xeb78('0x48')](handleError(_0x5553cf,null));}; \ No newline at end of file +var _0x93e9=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','options','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','Team','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','every','TeamId','includes','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','catch','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','appdata','prefix','NoOp'];(function(_0x20a403,_0x1a1fec){var _0x78fd94=function(_0x1006b9){while(--_0x1006b9){_0x20a403['push'](_0x20a403['shift']());}};_0x78fd94(++_0x1a1fec);}(_0x93e9,0xcc));var _0x993e=function(_0x577b4f,_0x103dc4){_0x577b4f=_0x577b4f-0x0;var _0x2ee831=_0x93e9[_0x577b4f];return _0x2ee831;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];config['redis']=_['defaults'](config[_0x993e('0x19')],{'host':_0x993e('0x1a'),'port':0x18eb});var socket=require(_0x993e('0x1b'))(new Redis(config[_0x993e('0x19')]));require(_0x993e('0x1c'))[_0x993e('0x1d')](socket);function respondWithStatusCode(_0x34ddda,_0x20f32a){_0x20f32a=_0x20f32a||0xcc;return function(_0x2a184b){if(_0x2a184b){return _0x34ddda[_0x993e('0x1e')](_0x20f32a);}return _0x34ddda[_0x993e('0x1f')](_0x20f32a)[_0x993e('0x20')]();};}function respondWithResult(_0x3df0e7,_0x125322){_0x125322=_0x125322||0xc8;return function(_0x1f267f){if(_0x1f267f){return _0x3df0e7[_0x993e('0x1f')](_0x125322)[_0x993e('0x21')](_0x1f267f);}};}function respondWithFilteredResult(_0x526e06,_0x22f7cc){return function(_0x1acd21){if(_0x1acd21){var _0x3cc2b9=typeof _0x22f7cc[_0x993e('0x22')]===_0x993e('0x23')&&typeof _0x22f7cc[_0x993e('0x24')]==='undefined';var _0x11cd41=_0x1acd21[_0x993e('0x25')];var _0x1eaf57=_0x3cc2b9?0x0:_0x22f7cc[_0x993e('0x22')];var _0x130a8a=_0x3cc2b9?_0x1acd21[_0x993e('0x25')]:_0x22f7cc[_0x993e('0x22')]+_0x22f7cc[_0x993e('0x24')];var _0x4bbe9c;if(_0x130a8a>=_0x11cd41){_0x130a8a=_0x11cd41;_0x4bbe9c=0xc8;}else{_0x4bbe9c=0xce;}_0x526e06[_0x993e('0x1f')](_0x4bbe9c);return _0x526e06['set'](_0x993e('0x26'),_0x1eaf57+'-'+_0x130a8a+'/'+_0x11cd41)[_0x993e('0x21')](_0x1acd21);}return null;};}function patchUpdates(_0x32b09e){return function(_0x5ba2a1){try{jsonpatch[_0x993e('0x27')](_0x5ba2a1,_0x32b09e,!![]);}catch(_0x13db4e){return BPromise[_0x993e('0x28')](_0x13db4e);}return _0x5ba2a1[_0x993e('0x29')]();};}function saveUpdates(_0x3b45ef,_0x328d22){return function(_0xa1c83e){if(_0xa1c83e){return _0xa1c83e[_0x993e('0x2a')](_0x3b45ef)[_0x993e('0x2b')](function(_0x18f6ac){return _0x18f6ac;});}return null;};}function removeEntity(_0x3fe099,_0x3603fa){return function(_0x4fe471){if(_0x4fe471){return _0x4fe471[_0x993e('0x2c')]()[_0x993e('0x2b')](function(){var _0x52b727=_0x4fe471[_0x993e('0x2d')]({'plain':!![]});var _0x4f5cc1=_0x993e('0x2e');return db[_0x993e('0x2f')][_0x993e('0x2c')]({'where':{'type':_0x4f5cc1,'resourceId':_0x52b727['id']}})[_0x993e('0x2b')](function(){return _0x4fe471;});})['then'](function(){_0x3fe099['status'](0xcc)[_0x993e('0x20')]();});}};}function handleEntityNotFound(_0x466d63,_0x4a4f00){return function(_0x223af0){if(!_0x223af0){_0x466d63[_0x993e('0x1e')](0x194);}return _0x223af0;};}function handleError(_0x248354,_0x4c5ee3){_0x4c5ee3=_0x4c5ee3||0x1f4;return function(_0x2495b7){logger[_0x993e('0x30')](_0x2495b7[_0x993e('0x31')]);if(_0x2495b7[_0x993e('0x32')]){delete _0x2495b7[_0x993e('0x32')];}_0x248354['status'](_0x4c5ee3)[_0x993e('0x33')](_0x2495b7);};}exports['index']=function(_0x782298,_0x5ba163){var _0x1da357={},_0x567ed4={},_0x3b9c3c={'count':0x0,'rows':[]};var _0x2ce5d5=_[_0x993e('0x34')](db[_0x993e('0x35')][_0x993e('0x36')],function(_0x360e2d){return{'name':_0x360e2d['fieldName'],'type':_0x360e2d[_0x993e('0x37')]['key']};});_0x567ed4['model']=_[_0x993e('0x34')](_0x2ce5d5,'name');_0x567ed4[_0x993e('0x38')]=_[_0x993e('0x39')](_0x782298[_0x993e('0x38')]);_0x567ed4[_0x993e('0x3a')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],_0x567ed4[_0x993e('0x38')]);_0x1da357[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x782298[_0x993e('0x38')][_0x993e('0x3e')]));_0x1da357[_0x993e('0x3d')]=_0x1da357[_0x993e('0x3d')]['length']?_0x1da357[_0x993e('0x3d')]:_0x567ed4[_0x993e('0x3c')];if(!_0x782298[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1da357[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x782298[_0x993e('0x38')][_0x993e('0x24')]);_0x1da357['offset']=qs[_0x993e('0x22')](_0x782298['query'][_0x993e('0x22')]);}_0x1da357[_0x993e('0x41')]=qs[_0x993e('0x42')](_0x782298[_0x993e('0x38')][_0x993e('0x42')]);_0x1da357[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x782298['query'],_0x567ed4[_0x993e('0x3a')]),_0x2ce5d5);if(_0x782298['query'][_0x993e('0x45')]){_0x1da357['where']=_[_0x993e('0x46')](_0x1da357[_0x993e('0x43')],{'$or':_[_0x993e('0x34')](_0x2ce5d5,function(_0x1f1327){if(_0x1f1327[_0x993e('0x37')]!==_0x993e('0x47')){var _0xb728cf={};_0xb728cf[_0x1f1327[_0x993e('0x32')]]={'$like':'%'+_0x782298['query'][_0x993e('0x45')]+'%'};return _0xb728cf;}})});}_0x1da357=_['merge']({},_0x1da357,_0x782298['options']);var _0x1a2712={'where':_0x1da357[_0x993e('0x43')]};return db[_0x993e('0x35')]['count'](_0x1a2712)[_0x993e('0x2b')](function(_0x40719d){_0x3b9c3c[_0x993e('0x25')]=_0x40719d;if(_0x782298['query']['includeAll']){_0x1da357['include']=[{'all':!![]}];}return db[_0x993e('0x35')][_0x993e('0x48')](_0x1da357);})[_0x993e('0x2b')](function(_0x539c9d){_0x3b9c3c[_0x993e('0x49')]=_0x539c9d;return _0x3b9c3c;})[_0x993e('0x2b')](respondWithFilteredResult(_0x5ba163,_0x1da357))['catch'](handleError(_0x5ba163,null));};exports[_0x993e('0x4a')]=function(_0x5f7563,_0x5074a6){var _0x258795={'raw':![],'where':{'id':_0x5f7563[_0x993e('0x4b')]['id']}},_0x576ea={};_0x576ea['model']=_['keys'](db['VoicePrefix'][_0x993e('0x36')]);_0x576ea[_0x993e('0x38')]=_[_0x993e('0x39')](_0x5f7563[_0x993e('0x38')]);_0x576ea['filters']=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],_0x576ea[_0x993e('0x38')]);_0x258795[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],qs['fields'](_0x5f7563['query'][_0x993e('0x3e')]));_0x258795[_0x993e('0x3d')]=_0x258795['attributes']['length']?_0x258795[_0x993e('0x3d')]:_0x576ea[_0x993e('0x3c')];if(_0x5f7563[_0x993e('0x38')][_0x993e('0x4c')]){_0x258795[_0x993e('0x4d')]=[{'all':!![]}];}_0x258795=_[_0x993e('0x46')]({},_0x258795,_0x5f7563['options']);return db[_0x993e('0x35')]['find'](_0x258795)[_0x993e('0x2b')](handleEntityNotFound(_0x5074a6,null))[_0x993e('0x2b')](respondWithResult(_0x5074a6,null))[_0x993e('0x4e')](handleError(_0x5074a6,null));};exports[_0x993e('0x2c')]=function(_0x2cba37,_0x276b99){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x2cba37['params']['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x276b99,null))[_0x993e('0x2b')](removeEntity(_0x276b99,null))[_0x993e('0x4e')](handleError(_0x276b99,null));};exports['describe']=function(_0x355912,_0x53c1e9){return db[_0x993e('0x35')][_0x993e('0x50')]()['then'](respondWithResult(_0x53c1e9,null))[_0x993e('0x4e')](handleError(_0x53c1e9,null));};exports[_0x993e('0x51')]=function(_0x579c43,_0x3809ef){var _0x207e27;return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x2e368e){return db['VoicePrefix']['create'](_0x579c43['body'],{'transaction':_0x2e368e})[_0x993e('0x2b')](function(_0x29f8a5){_0x207e27=_0x29f8a5[_0x993e('0x2d')]({'plain':!![]});return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x207e27[_0x993e('0x55')]},'raw':!![]})['then'](function(_0x3a897d){return createVoicePrefixExtensions(_0x207e27,_0x3a897d,_0x2e368e);});});})[_0x993e('0x2b')](function(){var _0x15c8ed=_0x579c43['user'][_0x993e('0x2d')]({'plain':!![]});if(!_0x15c8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c8ed['role']===_0x993e('0x56')){var _0x37d7b1=_0x207e27;return db['UserProfileSection'][_0x993e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x15c8ed[_0x993e('0x57')]},'raw':!![]})[_0x993e('0x2b')](function(_0x4a0dbd){if(_0x4a0dbd&&_0x4a0dbd['autoAssociation']===0x0){return db[_0x993e('0x2f')][_0x993e('0x51')]({'name':_0x37d7b1[_0x993e('0x32')],'resourceId':_0x37d7b1['id'],'type':_0x4a0dbd[_0x993e('0x32')],'sectionId':_0x4a0dbd['id']},{})[_0x993e('0x2b')](function(){return _0x207e27;});}else{return _0x207e27;}})[_0x993e('0x4e')](function(_0x4f9225){logger[_0x993e('0x30')](_0x993e('0x58'),_0x4f9225);throw _0x4f9225;});}return _0x207e27;})['then'](respondWithResult(_0x3809ef,null))[_0x993e('0x4e')](handleError(_0x3809ef,null));};function Extension(_0x473e00,_0x1b2113,_0x5ebaec,_0x426341){this[_0x993e('0x59')]=_0x993e('0x5a');this['exten']=_0x473e00;this[_0x993e('0x5b')]=_0x5ebaec;this[_0x993e('0x37')]=_0x993e('0x5c');this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x1b2113;this[_0x993e('0x5d')]=_0x426341;}function createVoicePrefixExtensions(_0x98d16c,_0x3a3d29,_0x411484){return new BPromise(function(_0xc62106,_0x55a347){var _0x18367f=new Extension(formatPrefixName(_0x98d16c[_0x993e('0x5e')]),0x1,_0x993e('0x5f'),'Voice\x20Prefix');_0x18367f[_0x993e('0x60')]=_0x98d16c['id'];return db[_0x993e('0x54')][_0x993e('0x51')](_0x18367f,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x5e4ab1){var _0x54417b=_0x5e4ab1[_0x993e('0x2d')]({'plain':!![]});var _0x51cec9=_['map'](addVoicePrefixExtensions(_0x98d16c,_0x3a3d29),function(_0x17c7f7){_0x17c7f7[_0x993e('0x55')]=_0x54417b['id'];_0x17c7f7[_0x993e('0x60')]=_0x98d16c['id'];return _0x17c7f7;});return db[_0x993e('0x54')][_0x993e('0x61')](_0x51cec9,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x211204){if(!_0x211204){return _0x55a347(_0x993e('0x62'));}else{return _0xc62106(_0x211204);}})[_0x993e('0x4e')](function(_0x113395){return _0x55a347(_0x113395);});});;});};function addVoicePrefixExtensions(_0x300a93,_0x44def2){var _0x2ddc16=[];var _0x609430=formatPrefixName(_0x300a93[_0x993e('0x5e')]);_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x2,'Set',_0x993e('0x64')+_0x300a93[_0x993e('0x32')]));if(_0x300a93['callerIdAll']){_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'Set',_0x993e('0x65')+_0x300a93[_0x993e('0x66')]));}else{_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'NoOp',_0x993e('0x67')));}_0x2ddc16['push'](new Extension(_0x609430,0x4,'goto',_0x44def2[_0x993e('0x59')]+','+_0x993e('0x68')+(0x8+_0x300a93[_0x993e('0x32')][_0x993e('0x69')])+'}'+','+0x1));return _0x2ddc16;}function formatPrefixName(_0x2a243a){var _0x5194de='_';for(var _0x120d51=0x0;_0x120d51<_0x2a243a[_0x993e('0x69')];_0x120d51++){if(_0x2a243a[_0x993e('0x6a')](_0x120d51)=='-'){_0x5194de+=_0x2a243a['charAt'](_0x120d51);}else{_0x5194de+='['+_0x2a243a[_0x993e('0x6a')](_0x120d51)+']';}}_0x5194de+='.';return _0x5194de;}exports['update']=function(_0x1ab10e,_0x6ef96,_0x42288d){var _0x5afba1=_0x1ab10e[_0x993e('0x6b')];_0x5afba1[_0x993e('0x5e')]=_0x993e('0x6c')+_0x5afba1[_0x993e('0x32')]+'-';return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x108cad){return db[_0x993e('0x35')][_0x993e('0x2a')](_0x5afba1,{'where':{'id':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db['VoiceExtension'][_0x993e('0x2c')]({'where':{'VoicePrefixId':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x5afba1[_0x993e('0x55')]},'raw':!![]})[_0x993e('0x2b')](function(_0x282c53){return createVoicePrefixExtensions(_0x5afba1,_0x282c53,_0x108cad);});});});})[_0x993e('0x2b')](function(){return db['VoicePrefix']['findById'](_0x5afba1['id']);})[_0x993e('0x2b')](respondWithResult(_0x6ef96,null))['catch'](handleError(_0x6ef96,null));};exports[_0x993e('0x6d')]=function(_0x444da6,_0x2ce913,_0x49788e){return db[_0x993e('0x35')]['find']({'where':{'id':_0x444da6[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x2ce913,null))[_0x993e('0x2b')](function(_0x40768a){if(_0x40768a){return _0x40768a[_0x993e('0x6d')](_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')],_[_0x993e('0x6f')](_0x444da6['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x5a70ff){for(var _0x2fb182=0x0;_0x2fb182<_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x993e('0x69')];_0x2fb182+=0x1){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':Number(_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x2fb182]),'VoicePrefixId':Number(_0x444da6[_0x993e('0x4b')]['id'])});}return _0x5a70ff;});}})[_0x993e('0x2b')](respondWithResult(_0x2ce913,null))['catch'](handleError(_0x2ce913,null));};exports[_0x993e('0x73')]=function(_0x14347f,_0x4a0002,_0x4742d9){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x14347f[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x4a0002,null))[_0x993e('0x2b')](function(_0x4157b6){if(_0x4157b6){return _0x4157b6[_0x993e('0x73')](_0x14347f[_0x993e('0x38')]['ids'])[_0x993e('0x2b')](function(){if(_[_0x993e('0x74')](_0x14347f[_0x993e('0x38')][_0x993e('0x6e')])){for(var _0x53ce16=0x0;_0x53ce16<_0x14347f['query'][_0x993e('0x6e')]['length'];_0x53ce16+=0x1){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')][_0x53ce16]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}}else{socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a0002,null))[_0x993e('0x4e')](handleError(_0x4a0002,null));};exports[_0x993e('0x76')]=function(_0x3abd3a,_0x278c2a,_0x3f6347){var _0x1a3967={};var _0x1079e7={};var _0x5c634a;var _0x47c3b6;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x3abd3a[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x278c2a,null))[_0x993e('0x2b')](function(_0x53b0c8){if(_0x53b0c8){_0x5c634a=_0x53b0c8;_0x1079e7['model']=_['keys'](db[_0x993e('0x78')][_0x993e('0x36')]);_0x1079e7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x3abd3a[_0x993e('0x38')]);_0x1079e7['filters']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],_0x1079e7[_0x993e('0x38')]);_0x1a3967['attributes']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x3e')]));_0x1a3967[_0x993e('0x3d')]=_0x1a3967['attributes'][_0x993e('0x69')]?_0x1a3967['attributes']:_0x1079e7['model'];_0x1a3967['order']=qs['sort'](_0x3abd3a[_0x993e('0x38')][_0x993e('0x42')]);_0x1a3967[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x3abd3a[_0x993e('0x38')],_0x1079e7[_0x993e('0x3a')]));if(_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]){_0x1a3967['where']=_[_0x993e('0x46')](_0x1a3967['where'],{'$or':_[_0x993e('0x34')](_0x1a3967[_0x993e('0x3d')],function(_0x3e7793){var _0x65c6f0={};_0x65c6f0[_0x3e7793]={'$like':'%'+_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x65c6f0;})});}_0x1a3967=_[_0x993e('0x46')]({},_0x1a3967,_0x3abd3a['options']);return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})[_0x993e('0x2b')](function(_0x285c93){if(_0x285c93){_0x47c3b6=_0x285c93['length'];if(!_0x3abd3a[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1a3967['limit']=qs[_0x993e('0x24')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x24')]);_0x1a3967[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x22')]);}return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})['then'](function(_0x412d21){if(_0x412d21){return _0x412d21?{'count':_0x47c3b6,'rows':_0x412d21}:null;}})['then'](respondWithResult(_0x278c2a,null))[_0x993e('0x4e')](handleError(_0x278c2a,null));};exports[_0x993e('0x79')]=function(_0x4d6d94,_0x505f28,_0x4e2ccf){var _0x4506cb={};var _0x31e947={};var _0x7800d4;var _0x4e1fcf;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x4d6d94[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x505f28,null))['then'](function(_0xc35545){if(_0xc35545){_0x7800d4=_0xc35545;_0x31e947['model']=_[_0x993e('0x39')](db['Team']['rawAttributes']);_0x31e947[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4d6d94[_0x993e('0x38')]);_0x31e947[_0x993e('0x3a')]=_['intersection'](_0x31e947['model'],_0x31e947['query']);_0x4506cb[_0x993e('0x3d')]=_['intersection'](_0x31e947[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x3e')]));_0x4506cb[_0x993e('0x3d')]=_0x4506cb['attributes'][_0x993e('0x69')]?_0x4506cb[_0x993e('0x3d')]:_0x31e947['model'];_0x4506cb[_0x993e('0x41')]=qs['sort'](_0x4d6d94[_0x993e('0x38')][_0x993e('0x42')]);_0x4506cb[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x4d6d94[_0x993e('0x38')],_0x31e947[_0x993e('0x3a')]));if(_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]){_0x4506cb['where']=_[_0x993e('0x46')](_0x4506cb['where'],{'$or':_[_0x993e('0x34')](_0x4506cb[_0x993e('0x3d')],function(_0x50dd66){var _0x48acd5={};_0x48acd5[_0x50dd66]={'$like':'%'+_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x48acd5;})});}_0x4506cb=_['merge']({},_0x4506cb,_0x4d6d94[_0x993e('0x7a')]);return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0xc56e5a){if(_0xc56e5a){_0x4e1fcf=_0xc56e5a['length'];if(!_0x4d6d94[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x4506cb[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x4d6d94['query'][_0x993e('0x24')]);_0x4506cb[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x22')]);}return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0x5d2b00){if(_0x5d2b00){return _0x5d2b00?{'count':_0x4e1fcf,'rows':_0x5d2b00}:null;}})[_0x993e('0x2b')](respondWithResult(_0x505f28,null))['catch'](handleError(_0x505f28,null));};exports[_0x993e('0x7b')]=function(_0x8dc65,_0x4a5755,_0x43b5c5){var _0x4d53d1=_0x8dc65['body'][_0x993e('0x6e')];var _0x371be2;return db['Team'][_0x993e('0x48')]({'where':{'id':_0x4d53d1},'attributes':['id'],'include':[{'model':db[_0x993e('0x78')],'as':_0x993e('0x7c'),'attributes':['id',_0x993e('0x32'),'online',_0x993e('0x7d'),'interface'],'raw':!![]}]})[_0x993e('0x2b')](function(_0x5c9960){if(_0x5c9960){_0x371be2=_0x5c9960;var _0x4286a0=_[_0x993e('0x7e')](_0x5c9960,function(_0x2540e4){var _0x56a23a=_0x2540e4['get']({'plain':!![]});return _0x56a23a[_0x993e('0x7c')];});return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x8dc65[_0x993e('0x4b')]['id']}})['then'](function(_0x37409f){return db['sequelize'][_0x993e('0x53')](function(_0xa16043){return _0x37409f[_0x993e('0x7b')](_0x4d53d1,{'transaction':_0xa16043})['then'](function(){return BPromise[_0x993e('0x7f')](_0x371be2,function(_0x30f7a3){return db[_0x993e('0x80')][_0x993e('0x81')]({'TeamId':_0x30f7a3['id'],'VoicePrefixId':_0x8dc65[_0x993e('0x4b')]['id']},{'transaction':_0xa16043});});})[_0x993e('0x2b')](function(){return BPromise[_0x993e('0x7f')](_0x4286a0,function(_0x3e61d2){return db[_0x993e('0x82')]['findOrCreate']({'where':{'UserId':_0x3e61d2['id'],'VoicePrefixId':_0x8dc65['params']['id']},'transaction':_0xa16043});});})['then'](function(){_0x4286a0[_0x993e('0x83')](function(_0x47c230){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':_0x47c230['id'],'VoicePrefixId':_0x37409f['id']});});});});});}})[_0x993e('0x2b')](respondWithStatusCode(_0x4a5755,null))[_0x993e('0x4e')](handleError(_0x4a5755,null));};exports['removeTeams']=function(_0x548dfb,_0x123dcd,_0x4e7340){return db[_0x993e('0x84')][_0x993e('0x48')]({'where':{'id':_0x548dfb[_0x993e('0x38')][_0x993e('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x993e('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x123dcd,null))['then'](function(_0x242374){var _0x1a3779=_[_0x993e('0x34')](_0x242374,'id');var _0x366809=[];var _0x11ba3a=[];var _0x1b2ca0=squel[_0x993e('0x85')]();_0x1b2ca0[_0x993e('0x86')](_0x993e('0x87'))[_0x993e('0x88')](_0x993e('0x89'),'tq')[_0x993e('0x8a')]('user_has_teams','ut',_0x993e('0x8b'))[_0x993e('0x43')](_0x993e('0x8c'),_0x548dfb[_0x993e('0x4b')]['id']);for(var _0x23ecf0=0x0;_0x23ecf0<_0x242374[_0x993e('0x69')];_0x23ecf0+=0x1){let _0x2fcfaa=_0x242374[_0x23ecf0];for(var _0x5303c9=0x0;_0x5303c9<_0x2fcfaa[_0x993e('0x7c')]['length'];_0x5303c9+=0x1){let _0x5d5dc8=_0x2fcfaa[_0x993e('0x7c')][_0x5303c9];var _0x102393=_0x1b2ca0[_0x993e('0x8d')]();_0x102393['where'](_0x993e('0x8e'),_0x5d5dc8['id']);_0x11ba3a[_0x993e('0x63')](db[_0x993e('0x52')][_0x993e('0x38')](_0x102393[_0x993e('0x8f')](),{'type':db[_0x993e('0x52')][_0x993e('0x90')]['SELECT']})[_0x993e('0x2b')](function(_0x6ee3c0){if(_0x6ee3c0['length']===0x1){return _0x5d5dc8['id'];}else{var _0x58fee1=_[_0x993e('0x91')](_[_0x993e('0x34')](_0x6ee3c0,_0x993e('0x92')),function(_0x2f0669){return _[_0x993e('0x93')](_0x1a3779,_0x2f0669);});if(_0x58fee1){return _0x5d5dc8['id'];}}}));}}return BPromise['all'](_0x11ba3a)[_0x993e('0x2b')](function(_0x3725b5){_0x366809=_(_0x366809)['union'](_0x3725b5)[_0x993e('0x94')]()['value']();return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x548dfb['params']['id']}})[_0x993e('0x2b')](function(_0x5ee2e0){return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x289772){return _0x5ee2e0['removeTeams'](_0x548dfb['query'][_0x993e('0x6e')],{'transaction':_0x289772})[_0x993e('0x2b')](function(){if(!_[_0x993e('0x95')](_0x366809)){return _0x5ee2e0[_0x993e('0x73')](_0x366809,{'transaction':_0x289772});}})[_0x993e('0x2b')](function(){_0x366809[_0x993e('0x83')](function(_0x366f8f){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':_0x366f8f,'VoicePrefixId':_0x5ee2e0['id']});});});});});});})['then'](respondWithStatusCode(_0x123dcd,null))[_0x993e('0x4e')](handleError(_0x123dcd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 41f25a2..aadb1c9 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 _0x0f8f=['../../mysqldb','VoicePrefix','setMaxListeners','update','emit','hook','exports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x0f8f,0x149));var _0xf0f8=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x0f8f[_0x5ebc04];return _0x17845c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xf0f8('0x0'))['db'][_0xf0f8('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf0f8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf0f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3a66b5){return function(_0x2f9574,_0x2f7e31,_0x352b09){VoicePrefixEvents[_0xf0f8('0x4')](_0x3a66b5+':'+_0x2f9574['id'],_0x2f9574);VoicePrefixEvents[_0xf0f8('0x4')](_0x3a66b5,_0x2f9574);_0x352b09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xf0f8('0x5')](e,emitEvent(event));}}module[_0xf0f8('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0xa43f=['exports','events','VoicePrefix','save','update','remove','emit','hasOwnProperty'];(function(_0x5a11c1,_0x3b266f){var _0x180f89=function(_0xd2f1aa){while(--_0xd2f1aa){_0x5a11c1['push'](_0x5a11c1['shift']());}};_0x180f89(++_0x3b266f);}(_0xa43f,0x159));var _0xfa43=function(_0x3d4ea0,_0x17bf89){_0x3d4ea0=_0x3d4ea0-0x0;var _0x1a5049=_0xa43f[_0x3d4ea0];return _0x1a5049;};'use strict';var EventEmitter=require(_0xfa43('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xfa43('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfa43('0x2'),'afterUpdate':_0xfa43('0x3'),'afterDestroy':_0xfa43('0x4')};function emitEvent(_0x26e3ce){return function(_0x47a04d,_0x59fa5b,_0x2691cd){VoicePrefixEvents[_0xfa43('0x5')](_0x26e3ce+':'+_0x47a04d['id'],_0x47a04d);VoicePrefixEvents[_0xfa43('0x5')](_0x26e3ce,_0x47a04d);_0x2691cd(null);};}for(var e in events){if(events[_0xfa43('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xfa43('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 732b0fe..1613ef2 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 _0xf4fa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf4fa,0x1b0));var _0xaf4f=function(_0x13a229,_0x1cb982){_0x13a229=_0x13a229-0x0;var _0x2e7c45=_0xf4fa[_0x13a229];return _0x2e7c45;};'use strict';var _=require(_0xaf4f('0x0'));var util=require('util');var logger=require(_0xaf4f('0x1'))(_0xaf4f('0x2'));var moment=require(_0xaf4f('0x3'));var BPromise=require(_0xaf4f('0x4'));var rp=require(_0xaf4f('0x5'));var fs=require('fs');var path=require(_0xaf4f('0x6'));var rimraf=require(_0xaf4f('0x7'));var config=require(_0xaf4f('0x8'));var attributes=require(_0xaf4f('0x9'));module[_0xaf4f('0xa')]=function(_0x344e8a,_0x1055d0){return _0x344e8a[_0xaf4f('0xb')](_0xaf4f('0xc'),attributes,{'tableName':_0xaf4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06cf=['rimraf','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes','util','../../config/logger','api','moment','request-promise','path'];(function(_0x445d34,_0x1b5a7f){var _0x260cd0=function(_0x348bd6){while(--_0x348bd6){_0x445d34['push'](_0x445d34['shift']());}};_0x260cd0(++_0x1b5a7f);}(_0x06cf,0xc0));var _0xf06c=function(_0x49b8eb,_0x4815e9){_0x49b8eb=_0x49b8eb-0x0;var _0x1d04de=_0x06cf[_0x49b8eb];return _0x1d04de;};'use strict';var _=require('lodash');var util=require(_0xf06c('0x0'));var logger=require(_0xf06c('0x1'))(_0xf06c('0x2'));var moment=require(_0xf06c('0x3'));var BPromise=require('bluebird');var rp=require(_0xf06c('0x4'));var fs=require('fs');var path=require(_0xf06c('0x5'));var rimraf=require(_0xf06c('0x6'));var config=require(_0xf06c('0x7'));var attributes=require(_0xf06c('0x8'));module[_0xf06c('0x9')]=function(_0x1fe75e,_0xf52e13){return _0x1fe75e['define']('VoicePrefix',attributes,{'tableName':_0xf06c('0xa'),'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 5128b00..4bcd069 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 _0x68fd=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3760f6,_0x1ea631){var _0x2119fe=function(_0x33e1c3){while(--_0x33e1c3){_0x3760f6['push'](_0x3760f6['shift']());}};_0x2119fe(++_0x1ea631);}(_0x68fd,0x1e9));var _0xd68f=function(_0x2f72b5,_0x38c432){_0x2f72b5=_0x2f72b5-0x0;var _0x2a13eb=_0x68fd[_0x2f72b5];return _0x2a13eb;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var moment=require(_0xd68f('0x1'));var BPromise=require(_0xd68f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd68f('0x3'));var db=require(_0xd68f('0x4'))['db'];var utils=require(_0xd68f('0x5'));var logger=require(_0xd68f('0x6'))(_0xd68f('0x7'));var config=require(_0xd68f('0x8'));var jayson=require(_0xd68f('0x9'));var client=jayson[_0xd68f('0xa')][_0xd68f('0xb')]({'port':0x232a});config['redis']=_[_0xd68f('0xc')](config[_0xd68f('0xd')],{'host':_0xd68f('0xe'),'port':0x18eb});var socket=require(_0xd68f('0xf'))(new Redis(config[_0xd68f('0xd')]));require(_0xd68f('0x10'))[_0xd68f('0x11')](socket);function respondWithRpcPromise(_0x4ff4ee,_0x52514d,_0x1c397a){return new BPromise(function(_0x59ac71,_0x114bda){return client[_0xd68f('0x12')](_0x4ff4ee,_0x1c397a)[_0xd68f('0x13')](function(_0x27001e){logger[_0xd68f('0x14')](_0xd68f('0x15'),_0x52514d,_0xd68f('0x16'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x52514d,'request\x20sent',JSON['stringify'](_0x27001e));if(_0x27001e[_0xd68f('0x17')]){if(_0x27001e[_0xd68f('0x17')]['code']===0x1f4){logger[_0xd68f('0x17')](_0xd68f('0x15'),_0x52514d,_0x27001e[_0xd68f('0x17')][_0xd68f('0x18')]);return _0x114bda(_0x27001e[_0xd68f('0x17')][_0xd68f('0x18')]);}logger[_0xd68f('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x52514d,_0x27001e[_0xd68f('0x17')]['message']);return _0x59ac71(_0x27001e['error'][_0xd68f('0x18')]);}else{logger[_0xd68f('0x14')](_0xd68f('0x15'),_0x52514d,_0xd68f('0x16'));_0x59ac71(_0x27001e[_0xd68f('0x19')][_0xd68f('0x18')]);}})[_0xd68f('0x1a')](function(_0x47fdbc){logger['error'](_0xd68f('0x15'),_0x52514d,_0x47fdbc);_0x114bda(_0x47fdbc);});});} \ No newline at end of file +var _0x649f=['request','then','info','VoicePrefix,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x37c97d,_0x3205f0){var _0x3add5c=function(_0x15c15c){while(--_0x15c15c){_0x37c97d['push'](_0x37c97d['shift']());}};_0x3add5c(++_0x3205f0);}(_0x649f,0x93));var _0xf649=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x649f[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf649('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf649('0x4'));var logger=require(_0xf649('0x5'))(_0xf649('0x6'));var config=require(_0xf649('0x7'));var jayson=require(_0xf649('0x8'));var client=jayson[_0xf649('0x9')][_0xf649('0xa')]({'port':0x232a});config[_0xf649('0xb')]=_['defaults'](config['redis'],{'host':_0xf649('0xc'),'port':0x18eb});var socket=require(_0xf649('0xd'))(new Redis(config[_0xf649('0xb')]));require('./voicePrefix.socket')[_0xf649('0xe')](socket);function respondWithRpcPromise(_0x2a278c,_0x38d583,_0x4061a2){return new BPromise(function(_0x5abb8f,_0x7f5eda){return client[_0xf649('0xf')](_0x2a278c,_0x4061a2)[_0xf649('0x10')](function(_0xe5a71c){logger[_0xf649('0x11')](_0xf649('0x12'),_0x38d583,'request\x20sent');logger[_0xf649('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x38d583,'request\x20sent',JSON[_0xf649('0x14')](_0xe5a71c));if(_0xe5a71c[_0xf649('0x15')]){if(_0xe5a71c[_0xf649('0x15')][_0xf649('0x16')]===0x1f4){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x7f5eda(_0xe5a71c['error'][_0xf649('0x17')]);}logger[_0xf649('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x5abb8f(_0xe5a71c[_0xf649('0x15')]['message']);}else{logger['info'](_0xf649('0x12'),_0x38d583,_0xf649('0x18'));_0x5abb8f(_0xe5a71c[_0xf649('0x19')][_0xf649('0x17')]);}})[_0xf649('0x1a')](function(_0x2d956d){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0x2d956d);_0x7f5eda(_0x2d956d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d0b5289..b1a737f 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 _0x7eb9=['removeListener','./voicePrefix.events','update','emit'];(function(_0x46e5df,_0x5512ed){var _0x37d448=function(_0x53c44f){while(--_0x53c44f){_0x46e5df['push'](_0x46e5df['shift']());}};_0x37d448(++_0x5512ed);}(_0x7eb9,0xd9));var _0x97eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7eb9[_0x20a584];return _0x4b41a8;};'use strict';var VoicePrefixEvents=require(_0x97eb('0x0'));var events=['save','remove',_0x97eb('0x1')];function createListener(_0x48a73e,_0x580fd1){return function(_0x41d2c7){_0x580fd1[_0x97eb('0x2')](_0x48a73e,_0x41d2c7);};}function removeListener(_0x130bf4,_0x5066c1){return function(){VoicePrefixEvents[_0x97eb('0x3')](_0x130bf4,_0x5066c1);};}exports['register']=function(_0x5f78f4){for(var _0x5327d4=0x0,_0x44595e=events['length'];_0x5327d4<_0x44595e;_0x5327d4++){var _0x5227f4=events[_0x5327d4];var _0x429ed6=createListener('voicePrefix:'+_0x5227f4,_0x5f78f4);VoicePrefixEvents['on'](_0x5227f4,_0x429ed6);}}; \ No newline at end of file +var _0x2bc6=['length','./voicePrefix.events','save','remove','emit','removeListener'];(function(_0x281011,_0x597419){var _0x322acc=function(_0x3a4cd3){while(--_0x3a4cd3){_0x281011['push'](_0x281011['shift']());}};_0x322acc(++_0x597419);}(_0x2bc6,0x163));var _0x62bc=function(_0x127a40,_0x6989e5){_0x127a40=_0x127a40-0x0;var _0x14118b=_0x2bc6[_0x127a40];return _0x14118b;};'use strict';var VoicePrefixEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){VoicePrefixEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('voicePrefix:'+_0x3ed6ad,_0x3cce26);VoicePrefixEvents['on'](_0x3ed6ad,_0x3f625c);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 8ae442c..f2d0a47 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 _0xfd9c=['/:id/hoppers','getHopperHistories','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','destroy','delete','removeAgents','removeLists','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id'];(function(_0x5a5c11,_0x358f6b){var _0x5d6ba7=function(_0x272c72){while(--_0x272c72){_0x5a5c11['push'](_0x5a5c11['shift']());}};_0x5d6ba7(++_0x358f6b);}(_0xfd9c,0x114));var _0xcfd9=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xfd9c[_0x5e8d3e];return _0x1348c0;};'use strict';var multer=require(_0xcfd9('0x0'));var util=require(_0xcfd9('0x1'));var path=require(_0xcfd9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfd9('0x3'));var auth=require(_0xcfd9('0x4'));var interaction=require(_0xcfd9('0x5'));var config=require(_0xcfd9('0x6'));var controller=require(_0xcfd9('0x7'));router[_0xcfd9('0x8')]('/',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0xa')]);router['get'](_0xcfd9('0xb'),auth[_0xcfd9('0x9')](),controller['show']);router[_0xcfd9('0x8')](_0xcfd9('0xc'),auth[_0xcfd9('0x9')](),controller['getHoppers']);router[_0xcfd9('0x8')]('/:id/hopper_histories',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0xd')]);router['get']('/:id/hopper_finals',auth[_0xcfd9('0x9')](),controller['getHopperFinals']);router[_0xcfd9('0x8')]('/:id/hopper_black',auth[_0xcfd9('0x9')](),controller['getHopperBlacks']);router['get'](_0xcfd9('0xe'),auth[_0xcfd9('0x9')](),controller[_0xcfd9('0xf')]);router[_0xcfd9('0x8')](_0xcfd9('0x10'),auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x11')]);router[_0xcfd9('0x8')](_0xcfd9('0x12'),auth[_0xcfd9('0x9')](),controller['getMembers']);router[_0xcfd9('0x8')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xcfd9('0x8')](_0xcfd9('0x13'),auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x14')]);router[_0xcfd9('0x15')]('/',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x16')]);router[_0xcfd9('0x15')](_0xcfd9('0x17'),auth[_0xcfd9('0x9')](),controller['clone']);router[_0xcfd9('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0xcfd9('0x18')]);router[_0xcfd9('0x15')](_0xcfd9('0x10'),auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x19')]);router[_0xcfd9('0x15')](_0xcfd9('0x1a'),auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x1b')]);router[_0xcfd9('0x15')]('/:id/blacklists',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x1c')]);router[_0xcfd9('0x1d')](_0xcfd9('0xb'),auth['isAuthenticated'](),controller[_0xcfd9('0x1e')]);router['delete'](_0xcfd9('0xb'),auth['isAuthenticated'](),controller[_0xcfd9('0x1f')]);router[_0xcfd9('0x20')](_0xcfd9('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xcfd9('0x20')]('/:id/users',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x21')]);router[_0xcfd9('0x20')]('/:id/lists',auth[_0xcfd9('0x9')](),controller[_0xcfd9('0x22')]);router[_0xcfd9('0x20')](_0xcfd9('0x13'),auth[_0xcfd9('0x9')](),controller['removeBlackLists']);module[_0xcfd9('0x23')]=router; \ No newline at end of file +var _0xb959=['update','delete','removeTeams','removeLists','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','addTeams','addLists','addBlackLists'];(function(_0x1bf27e,_0x34f111){var _0x224cfd=function(_0x290cbd){while(--_0x290cbd){_0x1bf27e['push'](_0x1bf27e['shift']());}};_0x224cfd(++_0x34f111);}(_0xb959,0x13f));var _0x9b95=function(_0x3792d8,_0x4b9693){_0x3792d8=_0x3792d8-0x0;var _0x328f99=_0xb959[_0x3792d8];return _0x328f99;};'use strict';var multer=require(_0x9b95('0x0'));var util=require(_0x9b95('0x1'));var path=require(_0x9b95('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b95('0x3'));var router=express[_0x9b95('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b95('0x5'));var interaction=require(_0x9b95('0x6'));var config=require(_0x9b95('0x7'));var controller=require('./voiceQueue.controller');router[_0x9b95('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b95('0x9')]);router['get'](_0x9b95('0xa'),auth[_0x9b95('0xb')](),controller[_0x9b95('0xc')]);router[_0x9b95('0x8')](_0x9b95('0xd'),auth[_0x9b95('0xb')](),controller[_0x9b95('0xe')]);router[_0x9b95('0x8')](_0x9b95('0xf'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x10')]);router['get']('/:id/hopper_finals',auth[_0x9b95('0xb')](),controller['getHopperFinals']);router['get'](_0x9b95('0x11'),auth['isAuthenticated'](),controller[_0x9b95('0x12')]);router[_0x9b95('0x8')](_0x9b95('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0x9b95('0x8')](_0x9b95('0x14'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x15')]);router['get'](_0x9b95('0x16'),auth[_0x9b95('0xb')](),controller['getMembers']);router[_0x9b95('0x8')](_0x9b95('0x17'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x18')]);router[_0x9b95('0x8')](_0x9b95('0x19'),auth['isAuthenticated'](),controller[_0x9b95('0x1a')]);router['post']('/',auth[_0x9b95('0xb')](),controller['create']);router[_0x9b95('0x1b')]('/:id/clone',auth[_0x9b95('0xb')](),controller['clone']);router[_0x9b95('0x1b')](_0x9b95('0x13'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x1c')]);router[_0x9b95('0x1b')](_0x9b95('0x14'),auth[_0x9b95('0xb')](),controller['addAgents']);router[_0x9b95('0x1b')](_0x9b95('0x17'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x1d')]);router[_0x9b95('0x1b')](_0x9b95('0x19'),auth['isAuthenticated'](),controller[_0x9b95('0x1e')]);router['put']('/:id',auth[_0x9b95('0xb')](),controller[_0x9b95('0x1f')]);router[_0x9b95('0x20')](_0x9b95('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x9b95('0x20')](_0x9b95('0x13'),auth['isAuthenticated'](),controller[_0x9b95('0x21')]);router[_0x9b95('0x20')](_0x9b95('0x14'),auth[_0x9b95('0xb')](),controller['removeAgents']);router[_0x9b95('0x20')](_0x9b95('0x17'),auth[_0x9b95('0xb')](),controller[_0x9b95('0x22')]);router[_0x9b95('0x20')](_0x9b95('0x19'),auth[_0x9b95('0xb')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 5669eba..fabcb0b 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 _0xaa19=['wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default','ENUM','leastrecent','fewestcalls','random','linear','ringall','setDataValue','strategy','getDataValue','booked','rrmemory','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw'];(function(_0xbeeae1,_0x49d789){var _0x14fed7=function(_0x5b2e85){while(--_0x5b2e85){_0xbeeae1['push'](_0xbeeae1['shift']());}};_0x14fed7(++_0x49d789);}(_0xaa19,0x79));var _0x9aa1=function(_0x1ed127,_0x21d3b1){_0x1ed127=_0x1ed127-0x0;var _0x564c7a=_0xaa19[_0x1ed127];return _0x564c7a;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')],'allowNull':![],'unique':_0x9aa1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x9aa1('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x9aa1('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x9aa1('0x5')},'announce':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9aa1('0x6')]('rr','ringall',_0x9aa1('0x7'),_0x9aa1('0x8'),_0x9aa1('0x9'),'rrmemory',_0x9aa1('0xa'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x9aa1('0xb'),'set':function(_0x234b36){this[_0x9aa1('0xc')](_0x9aa1('0xd'),_0x234b36?_0x234b36:'rrmemory');},'get':function(){var _0x5e76cc=this[_0x9aa1('0xe')]('type');var _0x19ff10=this['getDataValue']('dialMethod');var _0x53e93a=this[_0x9aa1('0xe')](_0x9aa1('0xd'));if(_0x5e76cc==='inbound'){return _0x53e93a;}if(_0x19ff10===_0x9aa1('0xf')&&_0x53e93a===_0x9aa1('0x10')||_0x19ff10===_0x9aa1('0xf')&&_0x53e93a==='roundrobin'){return _0x53e93a;}if(_0x19ff10==='progressive'||_0x19ff10===_0x9aa1('0x11')||_0x19ff10==='power'){return _0x53e93a;}return null;}},'servicelevel':{'type':Sequelize[_0x9aa1('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9aa1('0x12')](0xb)},'timeout':{'type':Sequelize[_0x9aa1('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9aa1('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9aa1('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':_0x9aa1('0x13')},'autopause':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no',_0x9aa1('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9aa1('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9aa1('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9aa1('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9aa1('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9aa1('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9aa1('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x9aa1('0x2')]},'periodic_announce':{'type':Sequelize[_0x9aa1('0x15')],'set':function(_0x592e56){this['setDataValue'](_0x9aa1('0x16'),_0x592e56?_0x592e56[_0x9aa1('0x17')](','):[]);},'get':function(){return this[_0x9aa1('0xe')](_0x9aa1('0x16'))?this[_0x9aa1('0xe')](_0x9aa1('0x16'))[_0x9aa1('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':'yes','set':function(_0x1470c0){this[_0x9aa1('0xc')](_0x9aa1('0x19'),_0x1470c0?_0x1470c0['join'](','):undefined);},'get':function(){return this[_0x9aa1('0xe')]('joinempty')?this[_0x9aa1('0xe')](_0x9aa1('0x19'))[_0x9aa1('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':'no','set':function(_0x4490f0){this[_0x9aa1('0xc')]('leavewhenempty',_0x4490f0?_0x4490f0[_0x9aa1('0x17')](','):undefined);},'get':function(){return this[_0x9aa1('0xe')]('leavewhenempty')?this[_0x9aa1('0xe')](_0x9aa1('0x1a'))[_0x9aa1('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9aa1('0x2')]},'acw':{'type':Sequelize[_0x9aa1('0x1b')],'defaultValue':0x0,'set':function(_0x249630){this['setDataValue'](_0x9aa1('0x1c'),_0x249630);if(_0x249630){if(this['getDataValue']('wrapuptime')<0x2){this[_0x9aa1('0xc')](_0x9aa1('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9aa1('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9aa1('0x1b')],'defaultValue':0x0,'comment':_0x9aa1('0x1e')},'dialMethod':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x1f'),_0x9aa1('0x20'),'power',_0x9aa1('0x11'),_0x9aa1('0xf')),'defaultValue':_0x9aa1('0x20'),'comment':_0x9aa1('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x9aa1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9aa1('0x23')},'dialLimitQueue':{'type':Sequelize[_0x9aa1('0x12')](0x4)[_0x9aa1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x9aa1('0x24')](0x2)[_0x9aa1('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9aa1('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x9aa1('0x6')](_0x9aa1('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x9aa1('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9aa1('0x24')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9aa1('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9aa1('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9aa1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9aa1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x9aa1('0x2')],'comment':_0x9aa1('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'comment':_0x9aa1('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x9aa1('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9aa1('0x31'),_0x9aa1('0x32'),_0x9aa1('0x33')),'defaultValue':_0x9aa1('0x31')},'dialAMDActive':{'type':Sequelize[_0x9aa1('0x1b')],'defaultValue':0x0,'comment':_0x9aa1('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0x9aa1('0x12')](0x9)[_0x9aa1('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9aa1('0x35')},'dialAMDGreeting':{'type':Sequelize[_0x9aa1('0x12')](0x9)[_0x9aa1('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9aa1('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9aa1('0x12')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9aa1('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9aa1('0x12')](0x9)[_0x9aa1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9aa1('0x12')](0x9)[_0x9aa1('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9aa1('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9aa1('0x12')](0x9)[_0x9aa1('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9aa1('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9aa1('0x12')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9aa1('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9aa1('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9aa1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9aa1('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x9aa1('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9aa1('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x9aa1('0x1b')],'defaultValue':0x0,'comment':_0x9aa1('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9aa1('0x3f'),_0x9aa1('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x9aa1('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9aa1('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9aa1('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9aa1('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9aa1('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9aa1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9aa1('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9aa1('0x12')],'allowNull':!![],'comment':_0x9aa1('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x383393){if(!_0x383393)this[_0x9aa1('0xc')]('mandatoryDispositionPauseId',null);this[_0x9aa1('0xc')](_0x9aa1('0x4a'),_0x383393);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9aa1('0x12')](0x3)[_0x9aa1('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9aa1('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x00b3=['random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','BOOLEAN','acw','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x00b3,0x97));var _0x300b=function(_0x46e8c7,_0x3d9cc2){_0x46e8c7=_0x46e8c7-0x0;var _0x33eede=_0x00b3[_0x46e8c7];return _0x33eede;};'use strict';var Sequelize=require(_0x300b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x300b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x300b('0x2')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x300b('0x3')},'musiconhold':{'type':Sequelize[_0x300b('0x4')],'defaultValue':_0x300b('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x300b('0x2')]('rr',_0x300b('0x6'),_0x300b('0x7'),_0x300b('0x8'),_0x300b('0x9'),_0x300b('0xa'),_0x300b('0xb'),_0x300b('0xc'),_0x300b('0xd')),'allowNull':![],'defaultValue':_0x300b('0x6'),'set':function(_0x1b9048){this[_0x300b('0xe')](_0x300b('0xf'),_0x1b9048?_0x1b9048:'rrmemory');},'get':function(){var _0x45ab52=this[_0x300b('0x10')](_0x300b('0x11'));var _0x4a9996=this[_0x300b('0x10')](_0x300b('0x12'));var _0x5bf458=this['getDataValue'](_0x300b('0xf'));if(_0x45ab52==='inbound'){return _0x5bf458;}if(_0x4a9996===_0x300b('0x13')&&_0x5bf458===_0x300b('0xa')||_0x4a9996===_0x300b('0x13')&&_0x5bf458===_0x300b('0x14')){return _0x5bf458;}if(_0x4a9996===_0x300b('0x15')||_0x4a9996===_0x300b('0x16')||_0x4a9996==='power'){return _0x5bf458;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x300b('0x17')](0xb)},'timeout':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x300b('0x4')]},'weight':{'type':Sequelize[_0x300b('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x300b('0x2')]('yes','no'),'defaultValue':_0x300b('0x18')},'autopause':{'type':Sequelize[_0x300b('0x2')]('yes','no',_0x300b('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x300b('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x300b('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x300b('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x300b('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x300b('0x2')]('yes','no'),'defaultValue':_0x300b('0x18')},'announce_holdtime':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no',_0x300b('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x300b('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x300b('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x300b('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x300b('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x300b('0x4')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x300b('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x300b('0x4')]},'queue_less_than':{'type':Sequelize[_0x300b('0x4')]},'periodic_announce':{'type':Sequelize[_0x300b('0x1b')],'set':function(_0x555a21){this['setDataValue'](_0x300b('0x1c'),_0x555a21?_0x555a21[_0x300b('0x1d')](','):[]);},'get':function(){return this[_0x300b('0x10')]('periodic_announce')?this['getDataValue'](_0x300b('0x1c'))[_0x300b('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x300b('0x4')],'defaultValue':_0x300b('0x18'),'set':function(_0x1bfe89){this[_0x300b('0xe')]('joinempty',_0x1bfe89?_0x1bfe89[_0x300b('0x1d')](','):undefined);},'get':function(){return this[_0x300b('0x10')](_0x300b('0x1f'))?this[_0x300b('0x10')](_0x300b('0x1f'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x33693b){this[_0x300b('0xe')]('leavewhenempty',_0x33693b?_0x33693b[_0x300b('0x1d')](','):undefined);},'get':function(){return this[_0x300b('0x10')]('leavewhenempty')?this[_0x300b('0x10')]('leavewhenempty')[_0x300b('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x300b('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x300b('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x300b('0x2')](_0x300b('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x300b('0x4')]},'description':{'type':Sequelize[_0x300b('0x4')]},'acw':{'type':Sequelize[_0x300b('0x20')],'defaultValue':0x0,'set':function(_0xe296fb){this[_0x300b('0xe')](_0x300b('0x21'),_0xe296fb);if(_0xe296fb){if(this[_0x300b('0x10')]('wrapuptime')<0x2){this[_0x300b('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x300b('0x20')],'defaultValue':0x0,'comment':_0x300b('0x22')},'dialMethod':{'type':Sequelize['ENUM'](_0x300b('0x23'),'progressive',_0x300b('0x24'),_0x300b('0x16'),'booked'),'defaultValue':_0x300b('0x15'),'comment':_0x300b('0x25')},'dialLimitChannel':{'type':Sequelize[_0x300b('0x17')](0x4)[_0x300b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x300b('0x27')},'dialLimitQueue':{'type':Sequelize[_0x300b('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x300b('0x28')},'dialPowerLevel':{'type':Sequelize[_0x300b('0x29')](0x2)[_0x300b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x300b('0x2a'),_0x300b('0x2b')),'defaultValue':_0x300b('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x300b('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x300b('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x300b('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x300b('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x300b('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x300b('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x300b('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x30')},'dialQueueProject':{'type':Sequelize[_0x300b('0x4')],'comment':_0x300b('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x300b('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x300b('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x300b('0x2')]('always',_0x300b('0x38'),_0x300b('0x39')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x300b('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x300b('0x17')](0x9)[_0x300b('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x300b('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x300b('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x300b('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x300b('0x17')](0x9)[_0x300b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x300b('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x300b('0x17')](0x9)[_0x300b('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x300b('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x300b('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x300b('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x300b('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x300b('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x300b('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x300b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x300b('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x300b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x300b('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x300b('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x300b('0x2')]('DESC',_0x300b('0x43')),'defaultValue':_0x300b('0x44')},'dialQueueProject2':{'type':Sequelize[_0x300b('0x4')],'comment':_0x300b('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x300b('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x300b('0x45')},'dialCutDigit':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x300b('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x300b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x300b('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x300b('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x300b('0x17')](0x5)[_0x300b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x300b('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x300b('0x17')],'allowNull':!![],'comment':_0x300b('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x300b('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x260776){if(!_0x260776)this[_0x300b('0xe')](_0x300b('0x4f'),null);this[_0x300b('0xe')]('mandatoryDisposition',_0x260776);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x300b('0x17')](0x3)[_0x300b('0x26')],'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 6eb9c8f..189836e 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 _0xab14=['map','VoiceQueue','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','VIRTUAL','count','include','rows','catch','show','params','fields','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','inbound','UserProfileSection','findOne','CmHopper','filters','pick','VoiceQueueId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','interface','format','emit','userVoiceQueue:save','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','union','compact','transaction','ids','isEmpty','removeAgents','addAgents','spread','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','undefined','limit','Content-Range','then','destroy','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','end','send','index'];(function(_0x5910ae,_0x34335f){var _0x4c8c09=function(_0x1cafb8){while(--_0x1cafb8){_0x5910ae['push'](_0x5910ae['shift']());}};_0x4c8c09(++_0x34335f);}(_0xab14,0x80));var _0x4ab1=function(_0x65700,_0x25dde7){_0x65700=_0x65700-0x0;var _0x278c35=_0xab14[_0x65700];return _0x278c35;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ab1('0x0'));var jsonpatch=require(_0x4ab1('0x1'));var rp=require(_0x4ab1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ab1('0x3'));var util=require(_0x4ab1('0x4'));var path=require(_0x4ab1('0x5'));var sox=require(_0x4ab1('0x6'));var csv=require('to-csv');var ejs=require(_0x4ab1('0x7'));var fs=require('fs');var fs_extra=require(_0x4ab1('0x8'));var _=require(_0x4ab1('0x9'));var squel=require(_0x4ab1('0xa'));var crypto=require('crypto');var jsforce=require(_0x4ab1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4ab1('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4ab1('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4ab1('0xe'));var hardwareService=require(_0x4ab1('0xf'));var logger=require(_0x4ab1('0x10'))(_0x4ab1('0x11'));var utils=require(_0x4ab1('0x12'));var config=require(_0x4ab1('0x13'));var licenseUtil=require(_0x4ab1('0x14'));var db=require(_0x4ab1('0x15'))['db'];config['redis']=_[_0x4ab1('0x16')](config[_0x4ab1('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ab1('0x18'))(new Redis(config['redis']));require(_0x4ab1('0x19'))['register'](socket);function respondWithStatusCode(_0x31e158,_0x1eab80){_0x1eab80=_0x1eab80||0xcc;return function(_0x48ff1f){if(_0x48ff1f){return _0x31e158[_0x4ab1('0x1a')](_0x1eab80);}return _0x31e158[_0x4ab1('0x1b')](_0x1eab80)['end']();};}function respondWithResult(_0x1fd402,_0x47a121){_0x47a121=_0x47a121||0xc8;return function(_0x3f4267){if(_0x3f4267){return _0x1fd402['status'](_0x47a121)[_0x4ab1('0x1c')](_0x3f4267);}};}function respondWithFilteredResult(_0x787d04,_0x4d6d67){return function(_0x1f0bf4){if(_0x1f0bf4){var _0xa46b36=typeof _0x4d6d67['offset']===_0x4ab1('0x1d')&&typeof _0x4d6d67['limit']===_0x4ab1('0x1d');var _0x325a37=_0x1f0bf4['count'];var _0x15f2ba=_0xa46b36?0x0:_0x4d6d67['offset'];var _0x76d3b8=_0xa46b36?_0x1f0bf4['count']:_0x4d6d67['offset']+_0x4d6d67[_0x4ab1('0x1e')];var _0x1281c4;if(_0x76d3b8>=_0x325a37){_0x76d3b8=_0x325a37;_0x1281c4=0xc8;}else{_0x1281c4=0xce;}_0x787d04[_0x4ab1('0x1b')](_0x1281c4);return _0x787d04['set'](_0x4ab1('0x1f'),_0x15f2ba+'-'+_0x76d3b8+'/'+_0x325a37)[_0x4ab1('0x1c')](_0x1f0bf4);}return null;};}function patchUpdates(_0x38439d){return function(_0x48a063){try{jsonpatch['apply'](_0x48a063,_0x38439d,!![]);}catch(_0x393f39){return BPromise['reject'](_0x393f39);}return _0x48a063['save']();};}function saveUpdates(_0x2dadfc,_0x5ecbc4){return function(_0xa0a8ba){if(_0xa0a8ba){return _0xa0a8ba['update'](_0x2dadfc)[_0x4ab1('0x20')](function(_0x4594b0){return _0x4594b0;});}return null;};}function removeEntity(_0x793c38,_0x5404c1){return function(_0xca9fe2){if(_0xca9fe2){return _0xca9fe2[_0x4ab1('0x21')]()[_0x4ab1('0x20')](function(){var _0x12d99d=_0xca9fe2['get']({'plain':!![]});var _0x223d9b=[{'name':_0x4ab1('0x22'),'value':'inbound','ignore':![]},{'name':_0x4ab1('0x23'),'value':_0x4ab1('0x24'),'ignore':![]}];var _0x1d9efe=_(_0x223d9b)[_0x4ab1('0x25')](_0x4ab1('0x26'))['map'](_0x4ab1('0x27'))[_0x4ab1('0x27')]();if(_[_0x4ab1('0x28')](_0x1d9efe,_0x12d99d[_0x4ab1('0x29')])){return;}var _0x4df283=_[_0x4ab1('0x2a')](_0x223d9b,[_0x4ab1('0x27'),_0x12d99d[_0x4ab1('0x29')]])[_0x4ab1('0x2b')];return db['UserProfileResource'][_0x4ab1('0x21')]({'where':{'type':_0x4df283,'resourceId':_0x12d99d['id']}})[_0x4ab1('0x20')](function(){return _0xca9fe2;});})['then'](function(){_0x793c38[_0x4ab1('0x1b')](0xcc)[_0x4ab1('0x2c')]();});}};}function handleEntityNotFound(_0x5928f0,_0x440930){return function(_0x4d8d12){if(!_0x4d8d12){_0x5928f0[_0x4ab1('0x1a')](0x194);}return _0x4d8d12;};}function handleError(_0x3b0ed3,_0x1106c1){_0x1106c1=_0x1106c1||0x1f4;return function(_0x375052){logger['error'](_0x375052['stack']);if(_0x375052[_0x4ab1('0x2b')]){delete _0x375052['name'];}_0x3b0ed3[_0x4ab1('0x1b')](_0x1106c1)[_0x4ab1('0x2d')](_0x375052);};}exports[_0x4ab1('0x2e')]=function(_0x1f2f80,_0xdac745){var _0x370f7a={},_0x224616={},_0x4c6ce6={'count':0x0,'rows':[]};var _0x10b298=_[_0x4ab1('0x2f')](db[_0x4ab1('0x30')][_0x4ab1('0x31')],function(_0x2fb12f){return{'name':_0x2fb12f['fieldName'],'type':_0x2fb12f[_0x4ab1('0x29')][_0x4ab1('0x32')]};});_0x224616[_0x4ab1('0x33')]=_[_0x4ab1('0x2f')](_0x10b298,_0x4ab1('0x2b'));_0x224616[_0x4ab1('0x34')]=_[_0x4ab1('0x35')](_0x1f2f80['query']);_0x224616['filters']=_[_0x4ab1('0x36')](_0x224616[_0x4ab1('0x33')],_0x224616[_0x4ab1('0x34')]);_0x370f7a['attributes']=_[_0x4ab1('0x36')](_0x224616[_0x4ab1('0x33')],qs['fields'](_0x1f2f80['query']['fields']));_0x370f7a[_0x4ab1('0x37')]=_0x370f7a[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0x370f7a[_0x4ab1('0x37')]:_0x224616[_0x4ab1('0x33')];if(!_0x1f2f80['query'][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x370f7a['limit']=qs[_0x4ab1('0x1e')](_0x1f2f80[_0x4ab1('0x34')][_0x4ab1('0x1e')]);_0x370f7a[_0x4ab1('0x3b')]=qs['offset'](_0x1f2f80[_0x4ab1('0x34')]['offset']);}_0x370f7a[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x1f2f80[_0x4ab1('0x34')]['sort']);_0x370f7a[_0x4ab1('0x3e')]=qs['filters'](_['pick'](_0x1f2f80[_0x4ab1('0x34')],_0x224616['filters']),_0x10b298);if(_0x1f2f80[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x370f7a[_0x4ab1('0x3e')]=_[_0x4ab1('0x3f')](_0x370f7a[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x10b298,function(_0x1a781c){if(_0x1a781c[_0x4ab1('0x29')]!==_0x4ab1('0x40')){var _0x2f041b={};_0x2f041b[_0x1a781c[_0x4ab1('0x2b')]]={'$like':'%'+_0x1f2f80[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x2f041b;}})});}_0x370f7a=_[_0x4ab1('0x3f')]({},_0x370f7a,_0x1f2f80['options']);var _0x1065b7={'where':_0x370f7a[_0x4ab1('0x3e')]};return db[_0x4ab1('0x30')][_0x4ab1('0x41')](_0x1065b7)[_0x4ab1('0x20')](function(_0x3a2022){_0x4c6ce6[_0x4ab1('0x41')]=_0x3a2022;if(_0x1f2f80[_0x4ab1('0x34')]['includeAll']){_0x370f7a[_0x4ab1('0x42')]=[{'all':!![]}];}return db[_0x4ab1('0x30')]['findAll'](_0x370f7a);})[_0x4ab1('0x20')](function(_0x217f11){_0x4c6ce6[_0x4ab1('0x43')]=_0x217f11;return _0x4c6ce6;})[_0x4ab1('0x20')](respondWithFilteredResult(_0xdac745,_0x370f7a))[_0x4ab1('0x44')](handleError(_0xdac745,null));};exports[_0x4ab1('0x45')]=function(_0x1b21b8,_0x3cd87a){var _0xc33d55={'raw':![],'where':{'id':_0x1b21b8[_0x4ab1('0x46')]['id']}},_0x4d5306={};_0x4d5306[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db[_0x4ab1('0x30')][_0x4ab1('0x31')]);_0x4d5306[_0x4ab1('0x34')]=_['keys'](_0x1b21b8[_0x4ab1('0x34')]);_0x4d5306['filters']=_[_0x4ab1('0x36')](_0x4d5306[_0x4ab1('0x33')],_0x4d5306[_0x4ab1('0x34')]);_0xc33d55['attributes']=_[_0x4ab1('0x36')](_0x4d5306[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x1b21b8[_0x4ab1('0x34')][_0x4ab1('0x47')]));_0xc33d55[_0x4ab1('0x37')]=_0xc33d55[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0xc33d55['attributes']:_0x4d5306[_0x4ab1('0x33')];if(_0x1b21b8['query'][_0x4ab1('0x48')]){_0xc33d55[_0x4ab1('0x42')]=[{'all':!![]}];}_0xc33d55=_[_0x4ab1('0x3f')]({},_0xc33d55,_0x1b21b8[_0x4ab1('0x49')]);return db[_0x4ab1('0x30')][_0x4ab1('0x2a')](_0xc33d55)[_0x4ab1('0x20')](handleEntityNotFound(_0x3cd87a,null))[_0x4ab1('0x20')](respondWithResult(_0x3cd87a,null))[_0x4ab1('0x44')](handleError(_0x3cd87a,null));};exports[_0x4ab1('0x4a')]=function(_0x493ad4,_0x343372){return db[_0x4ab1('0x30')][_0x4ab1('0x4a')](_0x493ad4[_0x4ab1('0x4b')],{})['then'](function(_0x1a0965){var _0x31cc85=_0x493ad4[_0x4ab1('0x4c')][_0x4ab1('0x4d')]({'plain':!![]});if(!_0x31cc85)throw new Error(_0x4ab1('0x4e'));if(_0x31cc85[_0x4ab1('0x4f')]==='user'){var _0x18ec67=_0x1a0965[_0x4ab1('0x4d')]({'plain':!![]});var _0x5c57fb=[{'name':_0x4ab1('0x22'),'value':'inbound'},{'name':_0x4ab1('0x23'),'value':'outbound'}];var _0x2988fc=_[_0x4ab1('0x2a')](_0x5c57fb,[_0x4ab1('0x27'),_0x18ec67[_0x4ab1('0x29')]])[_0x4ab1('0x2b')];return db['UserProfileSection']['find']({'where':{'name':_0x2988fc,'userProfileId':_0x31cc85[_0x4ab1('0x50')]},'raw':!![]})['then'](function(_0x4ba720){if(_0x4ba720&&_0x4ba720['autoAssociation']===0x0){return db[_0x4ab1('0x51')][_0x4ab1('0x4a')]({'name':_0x18ec67[_0x4ab1('0x2b')],'resourceId':_0x18ec67['id'],'type':_0x4ba720[_0x4ab1('0x2b')],'sectionId':_0x4ba720['id']},{})[_0x4ab1('0x20')](function(){return _0x1a0965;});}else{return _0x1a0965;}})[_0x4ab1('0x44')](function(_0x1968b2){logger[_0x4ab1('0x52')](_0x4ab1('0x53'),_0x1968b2);throw _0x1968b2;});}return _0x1a0965;})[_0x4ab1('0x20')](respondWithResult(_0x343372,0xc9))[_0x4ab1('0x44')](handleError(_0x343372,null));};exports['clone']=function(_0x2e1620,_0x416063){var _0xb86b45={'where':{'id':_0x2e1620['params']['id']}},_0x35a190={};_0x35a190[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db[_0x4ab1('0x30')][_0x4ab1('0x31')]);_0xb86b45[_0x4ab1('0x37')]=_[_0x4ab1('0x36')](_0x35a190[_0x4ab1('0x33')],qs['fields'](_0x2e1620[_0x4ab1('0x34')]['fields']));_0xb86b45['attributes']=_0xb86b45['attributes']['length']?_0xb86b45['attributes']:_0x35a190[_0x4ab1('0x33')];if(_0x2e1620[_0x4ab1('0x34')][_0x4ab1('0x48')]){_0xb86b45[_0x4ab1('0x42')]=[{'all':!![]}];}_0xb86b45=_[_0x4ab1('0x3f')]({},_0xb86b45,_0x2e1620['options']);return db[_0x4ab1('0x30')][_0x4ab1('0x2a')](_0xb86b45)['then'](handleEntityNotFound(_0x416063,null))[_0x4ab1('0x20')](function(_0x1c37ea){if(_0x1c37ea){var _0x23d2db=_0x1c37ea['get']({'plain':!![]});_0x23d2db=qs[_0x4ab1('0x54')](_0x23d2db,['id',_0x4ab1('0x55'),'updatedAt']);_0x2e1620['body']=_['omit'](_0x2e1620['body'],['id',_0x4ab1('0x55'),_0x4ab1('0x56')]);return db[_0x4ab1('0x30')]['create'](_[_0x4ab1('0x3f')](_0x23d2db,_0x2e1620[_0x4ab1('0x4b')]),{'include':_0x2e1620[_0x4ab1('0x34')][_0x4ab1('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0xfc7d3){var _0x2925f0=_0x2e1620[_0x4ab1('0x4c')][_0x4ab1('0x4d')]({'plain':!![]});if(!_0x2925f0)throw new Error(_0x4ab1('0x4e'));if(_0x2925f0[_0x4ab1('0x4f')]===_0x4ab1('0x4c')){var _0x5de0c8=_0xfc7d3[_0x4ab1('0x4d')]({'plain':!![]});var _0x388b45=[{'name':_0x4ab1('0x22'),'value':_0x4ab1('0x57')},{'name':'QueueCampaigns','value':'outbound'}];var _0xe605cd=_[_0x4ab1('0x2a')](_0x388b45,[_0x4ab1('0x27'),_0x5de0c8['type']])[_0x4ab1('0x2b')];return db[_0x4ab1('0x58')]['find']({'where':{'name':_0xe605cd,'userProfileId':_0x2925f0[_0x4ab1('0x50')]},'raw':!![]})['then'](function(_0x45ea17){if(_0x45ea17&&_0x45ea17['autoAssociation']===0x0){return db[_0x4ab1('0x51')][_0x4ab1('0x4a')]({'name':_0x5de0c8['name'],'resourceId':_0x5de0c8['id'],'type':_0x45ea17[_0x4ab1('0x2b')],'sectionId':_0x45ea17['id']},{})[_0x4ab1('0x20')](function(){return _0xfc7d3;});}else{return _0xfc7d3;}})['catch'](function(_0x51afaf){logger[_0x4ab1('0x52')](_0x4ab1('0x53'),_0x51afaf);throw _0x51afaf;});}return _0xfc7d3;});}})[_0x4ab1('0x20')](respondWithResult(_0x416063,0xc9))[_0x4ab1('0x44')](handleError(_0x416063,null));};exports['update']=function(_0x4a9d15,_0x3a3fbc){if(_0x4a9d15[_0x4ab1('0x4b')]['id']){delete _0x4a9d15[_0x4ab1('0x4b')]['id'];}return db['VoiceQueue'][_0x4ab1('0x2a')]({'where':{'id':_0x4a9d15[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x3a3fbc,null))[_0x4ab1('0x20')](saveUpdates(_0x4a9d15[_0x4ab1('0x4b')],null))[_0x4ab1('0x20')](respondWithResult(_0x3a3fbc,null))[_0x4ab1('0x44')](handleError(_0x3a3fbc,null));};exports[_0x4ab1('0x21')]=function(_0x284729,_0x1dd845){return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x284729[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x1dd845,null))[_0x4ab1('0x20')](removeEntity(_0x1dd845,null))[_0x4ab1('0x44')](handleError(_0x1dd845,null));};exports['getHoppers']=function(_0x36aef3,_0x46dd35,_0x447adf){var _0x493e14={'raw':![],'where':{}};var _0x606005={};var _0x31f087={'count':0x0,'rows':[]};return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x36aef3[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x46dd35,null))[_0x4ab1('0x20')](function(_0x31dc57){if(_0x31dc57){_0x606005[_0x4ab1('0x33')]=_['keys'](db[_0x4ab1('0x5a')][_0x4ab1('0x31')]);_0x606005[_0x4ab1('0x34')]=_[_0x4ab1('0x35')](_0x36aef3[_0x4ab1('0x34')]);_0x606005[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0x606005['model'],_0x606005[_0x4ab1('0x34')]);_0x493e14['attributes']=_[_0x4ab1('0x36')](_0x606005['model'],qs['fields'](_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x47')]));_0x493e14[_0x4ab1('0x37')]=_0x493e14[_0x4ab1('0x37')]['length']?_0x493e14[_0x4ab1('0x37')]:_0x606005['model'];if(!_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x39')]('nolimit')){_0x493e14[_0x4ab1('0x1e')]=qs['limit'](_0x36aef3[_0x4ab1('0x34')]['limit']);_0x493e14[_0x4ab1('0x3b')]=qs['offset'](_0x36aef3['query'][_0x4ab1('0x3b')]);}_0x493e14[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x3d')]);_0x493e14[_0x4ab1('0x3e')]=qs[_0x4ab1('0x5b')](_[_0x4ab1('0x5c')](_0x36aef3[_0x4ab1('0x34')],_0x606005[_0x4ab1('0x5b')]));_0x493e14[_0x4ab1('0x3e')][_0x4ab1('0x5d')]=_0x31dc57['id'];if(_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x493e14[_0x4ab1('0x3e')]=_[_0x4ab1('0x3f')](_0x493e14['where'],{'$or':_[_0x4ab1('0x2f')](_0x493e14[_0x4ab1('0x37')],function(_0x23e65e){var _0x43f6e4={};_0x43f6e4[_0x23e65e]={'$like':'%'+_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x43f6e4;})});}_0x493e14=_[_0x4ab1('0x3f')]({},_0x493e14,_0x36aef3['options']);return db[_0x4ab1('0x5a')][_0x4ab1('0x41')]({'where':_0x493e14[_0x4ab1('0x3e')]})[_0x4ab1('0x20')](function(_0x8a6fae){_0x31f087[_0x4ab1('0x41')]=_0x8a6fae;if(_0x36aef3[_0x4ab1('0x34')][_0x4ab1('0x48')]){_0x493e14[_0x4ab1('0x42')]=[{'all':!![]}];}return db[_0x4ab1('0x5a')][_0x4ab1('0x5e')](_0x493e14);})['then'](function(_0x590e72){_0x31f087[_0x4ab1('0x43')]=_0x590e72;return _0x31f087;});}})['then'](respondWithFilteredResult(_0x46dd35,_0x493e14))[_0x4ab1('0x44')](handleError(_0x46dd35,null));};exports['getHopperHistories']=function(_0x59768b,_0x40548f,_0x1760e9){var _0x7f0b2c={'raw':!![],'where':{}};var _0x44c40d={};var _0x304485={'count':0x0,'rows':[]};return db[_0x4ab1('0x30')]['findOne']({'where':{'id':_0x59768b[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x40548f,null))[_0x4ab1('0x20')](function(_0x42ad30){if(_0x42ad30){_0x44c40d[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db['CmHopperHistory'][_0x4ab1('0x31')]);_0x44c40d['query']=_['keys'](_0x59768b[_0x4ab1('0x34')]);_0x44c40d[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0x44c40d[_0x4ab1('0x33')],_0x44c40d[_0x4ab1('0x34')]);_0x7f0b2c['attributes']=_[_0x4ab1('0x36')](_0x44c40d['model'],qs[_0x4ab1('0x47')](_0x59768b[_0x4ab1('0x34')]['fields']));_0x7f0b2c[_0x4ab1('0x37')]=_0x7f0b2c[_0x4ab1('0x37')]['length']?_0x7f0b2c[_0x4ab1('0x37')]:_0x44c40d[_0x4ab1('0x33')];if(!_0x59768b[_0x4ab1('0x34')]['hasOwnProperty'](_0x4ab1('0x3a'))){_0x7f0b2c[_0x4ab1('0x1e')]=qs[_0x4ab1('0x1e')](_0x59768b[_0x4ab1('0x34')]['limit']);_0x7f0b2c[_0x4ab1('0x3b')]=qs[_0x4ab1('0x3b')](_0x59768b[_0x4ab1('0x34')]['offset']);}_0x7f0b2c[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x59768b['query']['sort']);_0x7f0b2c[_0x4ab1('0x3e')]=qs['filters'](_[_0x4ab1('0x5c')](_0x59768b[_0x4ab1('0x34')],_0x44c40d['filters']));_0x7f0b2c['where'][_0x4ab1('0x5d')]=_0x42ad30['id'];if(_0x59768b[_0x4ab1('0x34')]['filter']){_0x7f0b2c['where']=_[_0x4ab1('0x3f')](_0x7f0b2c[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x7f0b2c['attributes'],function(_0x250d87){var _0x1ae954={};_0x1ae954[_0x250d87]={'$like':'%'+_0x59768b[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x1ae954;})});}_0x7f0b2c=_['merge']({},_0x7f0b2c,_0x59768b['options']);return db[_0x4ab1('0x5f')][_0x4ab1('0x41')]({'where':_0x7f0b2c[_0x4ab1('0x3e')]})[_0x4ab1('0x20')](function(_0x2075c2){_0x304485[_0x4ab1('0x41')]=_0x2075c2;if(_0x59768b[_0x4ab1('0x34')][_0x4ab1('0x48')]){_0x7f0b2c[_0x4ab1('0x42')]=[{'all':!![]}];}return db[_0x4ab1('0x5f')][_0x4ab1('0x5e')](_0x7f0b2c);})['then'](function(_0x2dfdd2){_0x304485[_0x4ab1('0x43')]=_0x2dfdd2;return _0x304485;});}})['then'](respondWithFilteredResult(_0x40548f,_0x7f0b2c))['catch'](handleError(_0x40548f,null));};exports[_0x4ab1('0x60')]=function(_0x3c28f9,_0x2d16f0,_0x210db9){var _0x5b70c2={'raw':!![],'where':{}};var _0x216e0a={};var _0x4bbbc8={'count':0x0,'rows':[]};return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x3c28f9['params']['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x2d16f0,null))['then'](function(_0x178c1b){if(_0x178c1b){_0x216e0a[_0x4ab1('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x216e0a[_0x4ab1('0x34')]=_[_0x4ab1('0x35')](_0x3c28f9[_0x4ab1('0x34')]);_0x216e0a[_0x4ab1('0x5b')]=_['intersection'](_0x216e0a[_0x4ab1('0x33')],_0x216e0a[_0x4ab1('0x34')]);_0x5b70c2['attributes']=_[_0x4ab1('0x36')](_0x216e0a[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x3c28f9[_0x4ab1('0x34')][_0x4ab1('0x47')]));_0x5b70c2['attributes']=_0x5b70c2[_0x4ab1('0x37')]['length']?_0x5b70c2[_0x4ab1('0x37')]:_0x216e0a['model'];if(!_0x3c28f9[_0x4ab1('0x34')][_0x4ab1('0x39')]('nolimit')){_0x5b70c2[_0x4ab1('0x1e')]=qs['limit'](_0x3c28f9['query'][_0x4ab1('0x1e')]);_0x5b70c2[_0x4ab1('0x3b')]=qs['offset'](_0x3c28f9[_0x4ab1('0x34')]['offset']);}_0x5b70c2[_0x4ab1('0x3c')]=qs['sort'](_0x3c28f9[_0x4ab1('0x34')][_0x4ab1('0x3d')]);_0x5b70c2[_0x4ab1('0x3e')]=qs['filters'](_['pick'](_0x3c28f9[_0x4ab1('0x34')],_0x216e0a[_0x4ab1('0x5b')]));_0x5b70c2[_0x4ab1('0x3e')]['VoiceQueueId']=_0x178c1b['id'];if(_0x3c28f9[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x5b70c2[_0x4ab1('0x3e')]=_[_0x4ab1('0x3f')](_0x5b70c2['where'],{'$or':_[_0x4ab1('0x2f')](_0x5b70c2[_0x4ab1('0x37')],function(_0x521194){var _0xa4f54a={};_0xa4f54a[_0x521194]={'$like':'%'+_0x3c28f9[_0x4ab1('0x34')]['filter']+'%'};return _0xa4f54a;})});}_0x5b70c2=_[_0x4ab1('0x3f')]({},_0x5b70c2,_0x3c28f9[_0x4ab1('0x49')]);return db[_0x4ab1('0x61')]['count']({'where':_0x5b70c2['where']})[_0x4ab1('0x20')](function(_0x301374){_0x4bbbc8['count']=_0x301374;if(_0x3c28f9[_0x4ab1('0x34')][_0x4ab1('0x48')]){_0x5b70c2['include']=[{'all':!![]}];}return db[_0x4ab1('0x61')]['findAll'](_0x5b70c2);})[_0x4ab1('0x20')](function(_0x4e3035){_0x4bbbc8[_0x4ab1('0x43')]=_0x4e3035;return _0x4bbbc8;});}})[_0x4ab1('0x20')](respondWithFilteredResult(_0x2d16f0,_0x5b70c2))['catch'](handleError(_0x2d16f0,null));};exports[_0x4ab1('0x62')]=function(_0x27f36b,_0x2cb5b9,_0x5103d8){var _0x275af1={'raw':!![],'where':{}};var _0x3197f6={};var _0x3fa1e2={'count':0x0,'rows':[]};return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x27f36b[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x2cb5b9,null))['then'](function(_0x276f0f){if(_0x276f0f){_0x3197f6['model']=_[_0x4ab1('0x35')](db['CmHopperBlack'][_0x4ab1('0x31')]);_0x3197f6[_0x4ab1('0x34')]=_['keys'](_0x27f36b[_0x4ab1('0x34')]);_0x3197f6[_0x4ab1('0x5b')]=_['intersection'](_0x3197f6[_0x4ab1('0x33')],_0x3197f6[_0x4ab1('0x34')]);_0x275af1[_0x4ab1('0x37')]=_['intersection'](_0x3197f6[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x47')]));_0x275af1[_0x4ab1('0x37')]=_0x275af1[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0x275af1[_0x4ab1('0x37')]:_0x3197f6['model'];if(!_0x27f36b['query'][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x275af1['limit']=qs[_0x4ab1('0x1e')](_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x1e')]);_0x275af1[_0x4ab1('0x3b')]=qs[_0x4ab1('0x3b')](_0x27f36b[_0x4ab1('0x34')]['offset']);}_0x275af1[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x3d')]);_0x275af1['where']=qs[_0x4ab1('0x5b')](_['pick'](_0x27f36b[_0x4ab1('0x34')],_0x3197f6[_0x4ab1('0x5b')]));_0x275af1['where'][_0x4ab1('0x5d')]=_0x276f0f['id'];if(_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x275af1['where']=_[_0x4ab1('0x3f')](_0x275af1['where'],{'$or':_[_0x4ab1('0x2f')](_0x275af1[_0x4ab1('0x37')],function(_0x2de23e){var _0x413a09={};_0x413a09[_0x2de23e]={'$like':'%'+_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x413a09;})});}_0x275af1=_[_0x4ab1('0x3f')]({},_0x275af1,_0x27f36b[_0x4ab1('0x49')]);return db['CmHopperBlack'][_0x4ab1('0x41')]({'where':_0x275af1[_0x4ab1('0x3e')]})[_0x4ab1('0x20')](function(_0x333950){_0x3fa1e2['count']=_0x333950;if(_0x27f36b[_0x4ab1('0x34')][_0x4ab1('0x48')]){_0x275af1[_0x4ab1('0x42')]=[{'all':!![]}];}return db[_0x4ab1('0x63')]['findAll'](_0x275af1);})[_0x4ab1('0x20')](function(_0x370a79){_0x3fa1e2[_0x4ab1('0x43')]=_0x370a79;return _0x3fa1e2;});}})['then'](respondWithFilteredResult(_0x2cb5b9,_0x275af1))[_0x4ab1('0x44')](handleError(_0x2cb5b9,null));};exports[_0x4ab1('0x64')]=function(_0x5bcba8,_0x173dd5,_0x308642){var _0x2c6bcf={};var _0x1182fe={};var _0xfc0e3;var _0x52f1c6;return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x5bcba8[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x173dd5,null))[_0x4ab1('0x20')](function(_0x422de0){if(_0x422de0){_0xfc0e3=_0x422de0;_0x1182fe[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db[_0x4ab1('0x65')][_0x4ab1('0x31')]);_0x1182fe[_0x4ab1('0x34')]=_['keys'](_0x5bcba8[_0x4ab1('0x34')]);_0x1182fe[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0x1182fe[_0x4ab1('0x33')],_0x1182fe[_0x4ab1('0x34')]);_0x2c6bcf[_0x4ab1('0x37')]=_['intersection'](_0x1182fe[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x47')]));_0x2c6bcf[_0x4ab1('0x37')]=_0x2c6bcf[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0x2c6bcf[_0x4ab1('0x37')]:_0x1182fe[_0x4ab1('0x33')];_0x2c6bcf[_0x4ab1('0x3c')]=qs['sort'](_0x5bcba8['query'][_0x4ab1('0x3d')]);_0x2c6bcf['where']=qs[_0x4ab1('0x5b')](_['pick'](_0x5bcba8['query'],_0x1182fe[_0x4ab1('0x5b')]));if(_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x2c6bcf[_0x4ab1('0x3e')]=_['merge'](_0x2c6bcf[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x2c6bcf[_0x4ab1('0x37')],function(_0x1f6e63){var _0x53c5e1={};_0x53c5e1[_0x1f6e63]={'$like':'%'+_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x53c5e1;})});}_0x2c6bcf=_[_0x4ab1('0x3f')]({},_0x2c6bcf,_0x5bcba8['options']);return _0xfc0e3[_0x4ab1('0x64')](_0x2c6bcf);}})['then'](function(_0x2c3967){if(_0x2c3967){_0x52f1c6=_0x2c3967[_0x4ab1('0x38')];if(!_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x2c6bcf[_0x4ab1('0x1e')]=qs[_0x4ab1('0x1e')](_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x1e')]);_0x2c6bcf['offset']=qs[_0x4ab1('0x3b')](_0x5bcba8[_0x4ab1('0x34')][_0x4ab1('0x3b')]);}return _0xfc0e3['getTeams'](_0x2c6bcf);}})[_0x4ab1('0x20')](function(_0x3a0233){if(_0x3a0233){return _0x3a0233?{'count':_0x52f1c6,'rows':_0x3a0233}:null;}})[_0x4ab1('0x20')](respondWithResult(_0x173dd5,null))['catch'](handleError(_0x173dd5,null));};exports[_0x4ab1('0x66')]=function(_0x58c2e8,_0x2a2b98,_0x614a16){var _0x1197cc=_0x58c2e8[_0x4ab1('0x4b')][_0x4ab1('0x67')];var _0x562d16=_[_0x4ab1('0x2f')](_0x1197cc,'id');return db['Team']['findAll']({'where':{'id':_0x562d16},'attributes':['id'],'include':[{'model':db[_0x4ab1('0x68')],'as':_0x4ab1('0x69'),'attributes':['id',_0x4ab1('0x2b'),_0x4ab1('0x6a'),_0x4ab1('0x6b'),'interface'],'raw':!![]}]})[_0x4ab1('0x20')](function(_0x2c08b8){if(_0x2c08b8){var _0x4659ec=_[_0x4ab1('0x6c')](_0x2c08b8,function(_0xeff8cb){var _0x38b409=_0xeff8cb[_0x4ab1('0x4d')]({'plain':!![]});_0x38b409[_0x4ab1('0x69')][_0x4ab1('0x6d')](function(_0x316f36){_0x316f36['penalty']=_['find'](_0x1197cc,{'id':_0x38b409['id']})[_0x4ab1('0x6e')];});return _0x38b409['Agents'];});return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x58c2e8['params']['id']}})[_0x4ab1('0x20')](function(_0x253c2e){return db[_0x4ab1('0x6f')]['transaction'](function(_0x3fe52e){return _0x253c2e[_0x4ab1('0x66')](_0x562d16,{'transaction':_0x3fe52e})[_0x4ab1('0x20')](function(){return BPromise[_0x4ab1('0x70')](_0x1197cc,function(_0x425129){return db[_0x4ab1('0x71')][_0x4ab1('0x72')]({'TeamId':_0x425129['id'],'VoiceQueueId':_0x58c2e8[_0x4ab1('0x46')]['id'],'penalty':_0x425129['penalty']},{'transaction':_0x3fe52e});});})[_0x4ab1('0x20')](function(){return BPromise[_0x4ab1('0x70')](_0x4659ec,function(_0x4fa870){return db[_0x4ab1('0x73')][_0x4ab1('0x74')]({'where':{'UserId':_0x4fa870['id'],'VoiceQueueId':_0x58c2e8[_0x4ab1('0x46')]['id']},'defaults':{'penalty':_0x4fa870[_0x4ab1('0x6e')]},'transaction':_0x3fe52e});});})['then'](function(){return BPromise[_0x4ab1('0x70')](_[_0x4ab1('0x25')](_0x4659ec,{'online':!![]}),function(_0x4d7300){return db[_0x4ab1('0x75')][_0x4ab1('0x72')]({'membername':_0x4d7300['name'],'UserId':_0x4d7300['id'],'queue_name':_0x253c2e[_0x4ab1('0x2b')],'VoiceQueueId':_0x253c2e['id'],'interface':_['isNil'](_0x4d7300[_0x4ab1('0x76')])?util[_0x4ab1('0x77')]('SIP/%s',_0x4d7300[_0x4ab1('0x2b')]):_0x4d7300[_0x4ab1('0x76')],'paused':_0x4d7300[_0x4ab1('0x6b')]||![],'penalty':_0x4d7300[_0x4ab1('0x6e')]},{'transaction':_0x3fe52e});});})[_0x4ab1('0x20')](function(){_0x4659ec[_0x4ab1('0x6d')](function(_0x57f93c){socket[_0x4ab1('0x78')](_0x4ab1('0x79'),{'UserId':_0x57f93c['id'],'VoiceQueueId':_0x253c2e['id']});});});});});}})[_0x4ab1('0x20')](respondWithStatusCode(_0x2a2b98,null))[_0x4ab1('0x44')](handleError(_0x2a2b98,null));};exports[_0x4ab1('0x7a')]=function(_0x466526,_0x156b46,_0x2b5f74){return db[_0x4ab1('0x65')][_0x4ab1('0x5e')]({'where':{'id':_0x466526[_0x4ab1('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4ab1('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4ab1('0x20')](handleEntityNotFound(_0x156b46,null))['then'](function(_0x361deb){var _0x90b50c=_[_0x4ab1('0x2f')](_0x361deb,'id');var _0x549682=[];var _0x1346b9=[];var _0x2c4f68=squel[_0x4ab1('0x7b')]();_0x2c4f68[_0x4ab1('0x7c')]('tq.TeamId')[_0x4ab1('0x7d')]('team_has_voice_queues','tq')['join'](_0x4ab1('0x7e'),'ut',_0x4ab1('0x7f'))[_0x4ab1('0x3e')](_0x4ab1('0x80'),_0x466526[_0x4ab1('0x46')]['id']);for(var _0x293f75=0x0;_0x293f75<_0x361deb[_0x4ab1('0x38')];_0x293f75+=0x1){let _0x1fdd61=_0x361deb[_0x293f75];for(var _0x27554e=0x0;_0x27554e<_0x1fdd61[_0x4ab1('0x69')][_0x4ab1('0x38')];_0x27554e+=0x1){let _0x4cb1b5=_0x1fdd61[_0x4ab1('0x69')][_0x27554e];var _0x14ce48=_0x2c4f68['clone']();_0x14ce48['where'](_0x4ab1('0x81'),_0x4cb1b5['id']);_0x1346b9[_0x4ab1('0x82')](db[_0x4ab1('0x6f')]['query'](_0x14ce48['toString'](),{'type':db[_0x4ab1('0x6f')][_0x4ab1('0x83')][_0x4ab1('0x84')]})[_0x4ab1('0x20')](function(_0x4ef243){if(_0x4ef243[_0x4ab1('0x38')]===0x1){return _0x4cb1b5['id'];}else{var _0x6c8471=_['every'](_[_0x4ab1('0x2f')](_0x4ef243,'TeamId'),function(_0x5b00c7){return _[_0x4ab1('0x28')](_0x90b50c,_0x5b00c7);});if(_0x6c8471){return _0x4cb1b5['id'];}}}));}}return BPromise['all'](_0x1346b9)[_0x4ab1('0x20')](function(_0x5e5ec5){_0x549682=_(_0x549682)[_0x4ab1('0x85')](_0x5e5ec5)[_0x4ab1('0x86')]()[_0x4ab1('0x27')]();return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x466526[_0x4ab1('0x46')]['id']}})['then'](function(_0x334514){return db[_0x4ab1('0x6f')][_0x4ab1('0x87')](function(_0x158bc7){return _0x334514[_0x4ab1('0x7a')](_0x466526[_0x4ab1('0x34')][_0x4ab1('0x88')],{'transaction':_0x158bc7})[_0x4ab1('0x20')](function(){if(!_[_0x4ab1('0x89')](_0x549682)){return _0x334514[_0x4ab1('0x8a')](_0x549682,{'transaction':_0x158bc7})[_0x4ab1('0x20')](function(){return db[_0x4ab1('0x75')]['destroy']({'where':{'VoiceQueueId':_0x466526[_0x4ab1('0x46')]['id'],'UserId':_0x549682},'transaction':_0x158bc7});});}})['then'](function(){_0x549682['forEach'](function(_0x5ae1e4){socket['emit']('userVoiceQueue:remove',{'UserId':_0x5ae1e4,'VoiceQueueId':_0x334514['id']});});});});});});})[_0x4ab1('0x20')](respondWithStatusCode(_0x156b46,null))['catch'](handleError(_0x156b46,null));};exports['addAgents']=function(_0x4741aa,_0x150987,_0x58743a){var _0x19df78,_0x56eed7;return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x4741aa[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x150987,null))[_0x4ab1('0x20')](function(_0x3a2fca){if(_0x3a2fca){_0x56eed7=_0x3a2fca;return _0x3a2fca[_0x4ab1('0x8b')](_0x4741aa[_0x4ab1('0x4b')][_0x4ab1('0x88')],_[_0x4ab1('0x54')](_0x4741aa[_0x4ab1('0x4b')],['ids','id'])||{})[_0x4ab1('0x8c')](function(_0x44f061){for(var _0x4057f=0x0;_0x4057f<_0x4741aa[_0x4ab1('0x4b')][_0x4ab1('0x88')][_0x4ab1('0x38')];_0x4057f+=0x1){socket[_0x4ab1('0x78')](_0x4ab1('0x79'),{'UserId':Number(_0x4741aa['body'][_0x4ab1('0x88')][_0x4057f]),'VoiceQueueId':Number(_0x4741aa[_0x4ab1('0x46')]['id'])});}return _0x44f061;});}})[_0x4ab1('0x20')](function(_0x1ba784){_0x19df78=_0x1ba784||[];if(_0x56eed7){return db[_0x4ab1('0x68')][_0x4ab1('0x5e')]({'where':{'id':_0x4741aa[_0x4ab1('0x4b')][_0x4ab1('0x88')]},'attributes':['id',_0x4ab1('0x2b'),_0x4ab1('0x6a'),'voicePause',_0x4ab1('0x76')],'raw':!![]});}})[_0x4ab1('0x20')](function(_0x1f7725){if(!_['isEmpty'](_0x1f7725)){var _0x269544=[];for(var _0x3f7de4=0x0;_0x3f7de4<_0x1f7725[_0x4ab1('0x38')];_0x3f7de4++){if(_0x1f7725[_0x3f7de4][_0x4ab1('0x6a')]){_0x269544['push'](db[_0x4ab1('0x75')][_0x4ab1('0x72')]({'membername':_0x1f7725[_0x3f7de4][_0x4ab1('0x2b')],'UserId':_0x1f7725[_0x3f7de4]['id'],'queue_name':_0x56eed7[_0x4ab1('0x2b')],'VoiceQueueId':_0x56eed7['id'],'interface':_['isNil'](_0x1f7725[_0x3f7de4]['interface'])?util['format'](_0x4ab1('0x8d'),_0x1f7725[_0x3f7de4]['name']):_0x1f7725[_0x3f7de4][_0x4ab1('0x76')],'paused':_0x1f7725[_0x3f7de4][_0x4ab1('0x6b')]||![],'penalty':_0x4741aa[_0x4ab1('0x4b')][_0x4ab1('0x6e')]||0x0}));}}return BPromise['all'](_0x269544);}})[_0x4ab1('0x20')](function(){return _0x19df78;})[_0x4ab1('0x20')](respondWithResult(_0x150987,null))[_0x4ab1('0x44')](handleError(_0x150987,null));};exports[_0x4ab1('0x8a')]=function(_0x2938de,_0x4033aa,_0x169826){return db[_0x4ab1('0x30')]['find']({'where':{'id':_0x2938de[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x4033aa,null))['then'](function(_0x4a1363){if(_0x4a1363){return _0x4a1363[_0x4ab1('0x8a')](_0x2938de[_0x4ab1('0x34')][_0x4ab1('0x88')])[_0x4ab1('0x20')](function(){if(_[_0x4ab1('0x8e')](_0x2938de[_0x4ab1('0x34')]['ids'])){for(var _0x529de0=0x0;_0x529de0<_0x2938de[_0x4ab1('0x34')][_0x4ab1('0x88')][_0x4ab1('0x38')];_0x529de0+=0x1){socket[_0x4ab1('0x78')](_0x4ab1('0x8f'),{'UserId':Number(_0x2938de['query'][_0x4ab1('0x88')][_0x529de0]),'VoiceQueueId':Number(_0x2938de[_0x4ab1('0x46')]['id'])});}}else{socket[_0x4ab1('0x78')]('userVoiceQueue:remove',{'UserId':Number(_0x2938de['query'][_0x4ab1('0x88')]),'VoiceQueueId':Number(_0x2938de[_0x4ab1('0x46')]['id'])});}});}})[_0x4ab1('0x20')](function(_0x1921a7){return db[_0x4ab1('0x75')]['destroy']({'where':{'VoiceQueueId':_0x2938de[_0x4ab1('0x46')]['id'],'UserId':_0x2938de[_0x4ab1('0x34')][_0x4ab1('0x88')]}})[_0x4ab1('0x20')](function(){return _0x1921a7;});})[_0x4ab1('0x20')](respondWithStatusCode(_0x4033aa,null))[_0x4ab1('0x44')](handleError(_0x4033aa,null));};exports[_0x4ab1('0x90')]=function(_0x28fcbe,_0x67584c,_0x25bc5d){var _0x35b9e6={};var _0xc2b72a={};var _0x4be96f;var _0x5100e3;return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x28fcbe[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x67584c,null))[_0x4ab1('0x20')](function(_0x4488de){if(_0x4488de){_0x4be96f=_0x4488de;_0xc2b72a[_0x4ab1('0x33')]=_['keys'](db['User']['rawAttributes']);_0xc2b72a['query']=_[_0x4ab1('0x35')](_0x28fcbe['query']);_0xc2b72a[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0xc2b72a['model'],_0xc2b72a[_0x4ab1('0x34')]);_0x35b9e6[_0x4ab1('0x37')]=_['intersection'](_0xc2b72a[_0x4ab1('0x33')],qs['fields'](_0x28fcbe[_0x4ab1('0x34')]['fields']));_0x35b9e6['attributes']=_0x35b9e6['attributes'][_0x4ab1('0x38')]?_0x35b9e6[_0x4ab1('0x37')]:_0xc2b72a['model'];_0x35b9e6[_0x4ab1('0x3c')]=qs['sort'](_0x28fcbe[_0x4ab1('0x34')]['sort']);_0x35b9e6[_0x4ab1('0x3e')]=qs[_0x4ab1('0x5b')](_[_0x4ab1('0x5c')](_0x28fcbe[_0x4ab1('0x34')],_0xc2b72a[_0x4ab1('0x5b')]));if(_0x28fcbe[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x35b9e6['where']=_[_0x4ab1('0x3f')](_0x35b9e6[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x35b9e6[_0x4ab1('0x37')],function(_0x180088){var _0x3a03df={};_0x3a03df[_0x180088]={'$like':'%'+_0x28fcbe[_0x4ab1('0x34')]['filter']+'%'};return _0x3a03df;})});}_0x35b9e6=_[_0x4ab1('0x3f')]({},_0x35b9e6,_0x28fcbe[_0x4ab1('0x49')]);return _0x4be96f['getAgents'](_0x35b9e6);}})[_0x4ab1('0x20')](function(_0x4fd418){if(_0x4fd418){_0x5100e3=_0x4fd418[_0x4ab1('0x38')];if(!_0x28fcbe[_0x4ab1('0x34')][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x35b9e6[_0x4ab1('0x1e')]=qs['limit'](_0x28fcbe['query'][_0x4ab1('0x1e')]);_0x35b9e6[_0x4ab1('0x3b')]=qs['offset'](_0x28fcbe[_0x4ab1('0x34')][_0x4ab1('0x3b')]);}return _0x4be96f[_0x4ab1('0x90')](_0x35b9e6);}})[_0x4ab1('0x20')](function(_0x558bc5){if(_0x558bc5){return _0x558bc5?{'count':_0x5100e3,'rows':_0x558bc5}:null;}})[_0x4ab1('0x20')](respondWithResult(_0x67584c,null))['catch'](handleError(_0x67584c,null));};exports['getMembers']=function(_0x425fd8,_0x394cc5,_0x36afaf){var _0x1ceab8={};var _0x57ff8b={};var _0xf035c9;var _0x16d21f;return db['VoiceQueue']['findOne']({'where':{'id':_0x425fd8['params']['id']}})['then'](handleEntityNotFound(_0x394cc5,null))[_0x4ab1('0x20')](function(_0x472743){if(_0x472743){_0xf035c9=_0x472743;_0x57ff8b[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db[_0x4ab1('0x75')]['rawAttributes']);_0x57ff8b['query']=_[_0x4ab1('0x35')](_0x425fd8[_0x4ab1('0x34')]);_0x57ff8b[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0x57ff8b[_0x4ab1('0x33')],_0x57ff8b[_0x4ab1('0x34')]);_0x1ceab8[_0x4ab1('0x37')]=_[_0x4ab1('0x36')](_0x57ff8b[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x425fd8['query'][_0x4ab1('0x47')]));_0x1ceab8[_0x4ab1('0x37')]=_0x1ceab8[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0x1ceab8[_0x4ab1('0x37')]:_0x57ff8b[_0x4ab1('0x33')];_0x1ceab8[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x425fd8['query'][_0x4ab1('0x3d')]);_0x1ceab8[_0x4ab1('0x3e')]=qs['filters'](_[_0x4ab1('0x5c')](_0x425fd8['query'],_0x57ff8b['filters']));if(_0x425fd8[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x1ceab8['where']=_['merge'](_0x1ceab8[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x1ceab8[_0x4ab1('0x37')],function(_0x2ab700){var _0x475c49={};_0x475c49[_0x2ab700]={'$like':'%'+_0x425fd8[_0x4ab1('0x34')][_0x4ab1('0x25')]+'%'};return _0x475c49;})});}_0x1ceab8=_['merge']({},_0x1ceab8,_0x425fd8['options']);return _0xf035c9['getMembers'](_0x1ceab8);}})[_0x4ab1('0x20')](function(_0x146317){if(_0x146317){_0x16d21f=_0x146317[_0x4ab1('0x38')];if(!_0x425fd8['query'][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x1ceab8[_0x4ab1('0x1e')]=qs['limit'](_0x425fd8['query'][_0x4ab1('0x1e')]);_0x1ceab8[_0x4ab1('0x3b')]=qs[_0x4ab1('0x3b')](_0x425fd8['query']['offset']);}return _0xf035c9['getMembers'](_0x1ceab8);}})['then'](function(_0x187b74){return _0x187b74?{'count':_0x16d21f,'rows':_0x187b74}:null;})['then'](respondWithResult(_0x394cc5,null))[_0x4ab1('0x44')](handleError(_0x394cc5,null));};exports[_0x4ab1('0x91')]=function(_0x163771,_0x130aba,_0x262aa1){var _0x3b01ad={};var _0x1b7077={};var _0xd50689;var _0x2dd9c2;return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x163771['params']['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x130aba,null))[_0x4ab1('0x20')](function(_0x5d9fd1){if(_0x5d9fd1){_0xd50689=_0x5d9fd1;_0x1b7077[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db[_0x4ab1('0x92')]['rawAttributes']);_0x1b7077[_0x4ab1('0x34')]=_[_0x4ab1('0x35')](_0x163771[_0x4ab1('0x34')]);_0x1b7077['filters']=_[_0x4ab1('0x36')](_0x1b7077['model'],_0x1b7077[_0x4ab1('0x34')]);_0x3b01ad[_0x4ab1('0x37')]=_[_0x4ab1('0x36')](_0x1b7077[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x163771['query'][_0x4ab1('0x47')]));_0x3b01ad[_0x4ab1('0x37')]=_0x3b01ad[_0x4ab1('0x37')][_0x4ab1('0x38')]?_0x3b01ad[_0x4ab1('0x37')]:_0x1b7077[_0x4ab1('0x33')];_0x3b01ad[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x163771[_0x4ab1('0x34')][_0x4ab1('0x3d')]);_0x3b01ad[_0x4ab1('0x3e')]=qs[_0x4ab1('0x5b')](_[_0x4ab1('0x5c')](_0x163771[_0x4ab1('0x34')],_0x1b7077[_0x4ab1('0x5b')]));if(_0x163771[_0x4ab1('0x34')][_0x4ab1('0x25')]){_0x3b01ad['where']=_[_0x4ab1('0x3f')](_0x3b01ad[_0x4ab1('0x3e')],{'$or':_[_0x4ab1('0x2f')](_0x3b01ad[_0x4ab1('0x37')],function(_0x2e0c25){var _0x31f7b1={};_0x31f7b1[_0x2e0c25]={'$like':'%'+_0x163771['query'][_0x4ab1('0x25')]+'%'};return _0x31f7b1;})});}_0x3b01ad=_[_0x4ab1('0x3f')]({},_0x3b01ad,_0x163771[_0x4ab1('0x49')]);return _0xd50689[_0x4ab1('0x91')](_0x3b01ad);}})['then'](function(_0xaea765){if(_0xaea765){_0x2dd9c2=_0xaea765[_0x4ab1('0x38')];if(!_0x163771[_0x4ab1('0x34')][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x3b01ad['limit']=qs[_0x4ab1('0x1e')](_0x163771[_0x4ab1('0x34')][_0x4ab1('0x1e')]);_0x3b01ad[_0x4ab1('0x3b')]=qs['offset'](_0x163771[_0x4ab1('0x34')][_0x4ab1('0x3b')]);}return _0xd50689[_0x4ab1('0x91')](_0x3b01ad);}})[_0x4ab1('0x20')](function(_0x2aeb4d){if(_0x2aeb4d){return _0x2aeb4d?{'count':_0x2dd9c2,'rows':_0x2aeb4d}:null;}})[_0x4ab1('0x20')](respondWithResult(_0x130aba,null))[_0x4ab1('0x44')](handleError(_0x130aba,null));};exports[_0x4ab1('0x93')]=function(_0x2a7e97,_0x280905,_0x32d017){var _0x535236,_0x47579c;return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x2a7e97[_0x4ab1('0x46')]['id']}})['then'](handleEntityNotFound(_0x280905,null))[_0x4ab1('0x20')](function(_0x3850d1){if(_0x3850d1){_0x47579c=_0x3850d1;return _0x3850d1[_0x4ab1('0x93')](_0x2a7e97['body']['ids'],_[_0x4ab1('0x54')](_0x2a7e97[_0x4ab1('0x4b')],[_0x4ab1('0x88'),'id'])||{});}return null;})[_0x4ab1('0x8c')](function(_0x19ce10){var _0x4468dd;_0x535236=_0x19ce10||[];var _0x5cef81=[];if(_0x19ce10){for(var _0x5901aa=0x0;_0x5901aa<_0x19ce10[_0x4ab1('0x38')];_0x5901aa+=0x1){var _0x533ede=_0x19ce10[_0x5901aa]['get']({'plain':!![]});_0x47579c['dialCheckDuplicateType']=_0x2a7e97['body'][_0x4ab1('0x94')]?_0x2a7e97[_0x4ab1('0x4b')]['dialCheckDuplicateType']:_0x47579c[_0x4ab1('0x94')];switch(_0x47579c[_0x4ab1('0x94')]){case'always':_0x4468dd=squel[_0x4ab1('0x95')]()['into'](_0x4ab1('0x96'))[_0x4ab1('0x97')]([_0x4ab1('0x98'),'scheduledAt',_0x4ab1('0x99'),_0x4ab1('0x9a'),_0x4ab1('0x5d'),_0x4ab1('0x55'),_0x4ab1('0x56')],squel['select']()[_0x4ab1('0x7c')](_0x4ab1('0x98'),_0x4ab1('0x98'))['field']('NOW()',_0x4ab1('0x9b'))[_0x4ab1('0x7c')]('id',_0x4ab1('0x99'))[_0x4ab1('0x7c')](_0x533ede[_0x4ab1('0x9c')]['toString'](),_0x4ab1('0x9a'))[_0x4ab1('0x7c')](_0x2a7e97[_0x4ab1('0x46')]['id']['toString'](),_0x4ab1('0x5d'))[_0x4ab1('0x7c')]('NOW()',_0x4ab1('0x55'))['field'](_0x4ab1('0x9d'),_0x4ab1('0x56'))[_0x4ab1('0x7d')]('cm_contacts')[_0x4ab1('0x3e')](_0x4ab1('0x9e'))[_0x4ab1('0x3e')](_0x4ab1('0x9f'),_0x533ede[_0x4ab1('0x9c')][_0x4ab1('0xa0')]())[_0x4ab1('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4ab1('0xa1'),squel['select']()[_0x4ab1('0x7c')](_0x4ab1('0xa2'))[_0x4ab1('0x7d')](_0x4ab1('0xa3'))['where'](_0x4ab1('0x80'),_0x2a7e97[_0x4ab1('0x46')]['id'][_0x4ab1('0xa0')]()))[_0x4ab1('0x3e')](_0x4ab1('0xa1'),squel[_0x4ab1('0x7b')]()[_0x4ab1('0x7c')](_0x4ab1('0xa4'))[_0x4ab1('0x7d')](_0x4ab1('0x96'))[_0x4ab1('0x3e')](_0x4ab1('0x80'),_0x2a7e97['params']['id'][_0x4ab1('0xa0')]())))['toString']();break;case _0x4ab1('0xa5'):_0x4468dd=squel[_0x4ab1('0x95')]()[_0x4ab1('0xa6')](_0x4ab1('0x96'))[_0x4ab1('0x97')]([_0x4ab1('0x98'),_0x4ab1('0x9b'),_0x4ab1('0x99'),_0x4ab1('0x9a'),_0x4ab1('0x5d'),_0x4ab1('0x55'),_0x4ab1('0x56')],squel[_0x4ab1('0x7b')]()[_0x4ab1('0x7c')](_0x4ab1('0x98'),'phone')[_0x4ab1('0x7c')](_0x4ab1('0x9d'),_0x4ab1('0x9b'))['field']('id','ContactId')[_0x4ab1('0x7c')](_0x533ede['CmListId'][_0x4ab1('0xa0')](),_0x4ab1('0x9a'))['field'](_0x2a7e97[_0x4ab1('0x46')]['id'][_0x4ab1('0xa0')](),_0x4ab1('0x5d'))[_0x4ab1('0x7c')](_0x4ab1('0x9d'),'createdAt')[_0x4ab1('0x7c')](_0x4ab1('0x9d'),_0x4ab1('0x56'))[_0x4ab1('0x7d')]('cm_contacts')[_0x4ab1('0x3e')](_0x4ab1('0x9e'))[_0x4ab1('0x3e')](_0x4ab1('0x9f'),_0x533ede[_0x4ab1('0x9c')][_0x4ab1('0xa0')]())[_0x4ab1('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4ab1('0xa1'),squel[_0x4ab1('0x7b')]()[_0x4ab1('0x7c')](_0x4ab1('0xa4'))[_0x4ab1('0x7d')](_0x4ab1('0x96'))[_0x4ab1('0x3e')](_0x4ab1('0x80'),_0x2a7e97[_0x4ab1('0x46')]['id'][_0x4ab1('0xa0')]())))[_0x4ab1('0xa0')]();break;default:_0x4468dd=squel[_0x4ab1('0x95')]()[_0x4ab1('0xa6')]('cm_hopper')[_0x4ab1('0x97')](['phone',_0x4ab1('0x9b'),_0x4ab1('0x99'),_0x4ab1('0x9a'),'VoiceQueueId',_0x4ab1('0x55'),_0x4ab1('0x56')],squel['select']()[_0x4ab1('0x7c')](_0x4ab1('0x98'),'phone')[_0x4ab1('0x7c')]('NOW()','scheduledAt')[_0x4ab1('0x7c')]('id',_0x4ab1('0x99'))[_0x4ab1('0x7c')](_0x533ede['CmListId'][_0x4ab1('0xa0')](),_0x4ab1('0x9a'))[_0x4ab1('0x7c')](_0x2a7e97[_0x4ab1('0x46')]['id'][_0x4ab1('0xa0')](),_0x4ab1('0x5d'))[_0x4ab1('0x7c')](_0x4ab1('0x9d'),'createdAt')[_0x4ab1('0x7c')](_0x4ab1('0x9d'),_0x4ab1('0x56'))['from'](_0x4ab1('0xa7'))[_0x4ab1('0x3e')](_0x4ab1('0x9e'))[_0x4ab1('0x3e')]('ListId\x20=\x20?',_0x533ede[_0x4ab1('0x9c')][_0x4ab1('0xa0')]())['where'](_0x4ab1('0xa8')))['toString']();}_0x5cef81[_0x4ab1('0x82')](db[_0x4ab1('0x6f')]['query'](_0x4468dd));}return BPromise['all'](_0x5cef81);}})[_0x4ab1('0x20')](function(){return _0x535236;})['then'](respondWithResult(_0x280905,null))[_0x4ab1('0x44')](handleError(_0x280905,null));};exports[_0x4ab1('0xa9')]=function(_0x5996fc,_0x20d782,_0x5bd0e8){return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x5996fc[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x20d782,null))[_0x4ab1('0x20')](function(_0x1f361e){if(_0x1f361e){return _0x1f361e[_0x4ab1('0xa9')](_0x5996fc['query']['ids']);}})[_0x4ab1('0x20')](function(_0x211d33){if(_0x211d33){return db['CmHopper']['destroy']({'where':{'ListId':_0x5996fc[_0x4ab1('0x34')][_0x4ab1('0x88')],'VoiceQueueId':_0x5996fc['params']['id']}})[_0x4ab1('0x20')](function(){return _0x211d33;});}})['then'](respondWithStatusCode(_0x20d782,null))[_0x4ab1('0x44')](handleError(_0x20d782,null));};exports[_0x4ab1('0xaa')]=function(_0x5ed33d,_0x370e50,_0x2ac5e9){var _0x36dbc9={};var _0x10e61f={};var _0x43344f;var _0x476d7b;return db[_0x4ab1('0x30')][_0x4ab1('0x59')]({'where':{'id':_0x5ed33d[_0x4ab1('0x46')]['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x370e50,null))['then'](function(_0x3daed2){if(_0x3daed2){_0x43344f=_0x3daed2;_0x10e61f[_0x4ab1('0x33')]=_[_0x4ab1('0x35')](db['CmList']['rawAttributes']);_0x10e61f[_0x4ab1('0x34')]=_[_0x4ab1('0x35')](_0x5ed33d[_0x4ab1('0x34')]);_0x10e61f[_0x4ab1('0x5b')]=_[_0x4ab1('0x36')](_0x10e61f[_0x4ab1('0x33')],_0x10e61f[_0x4ab1('0x34')]);_0x36dbc9[_0x4ab1('0x37')]=_[_0x4ab1('0x36')](_0x10e61f[_0x4ab1('0x33')],qs[_0x4ab1('0x47')](_0x5ed33d['query']['fields']));_0x36dbc9[_0x4ab1('0x37')]=_0x36dbc9[_0x4ab1('0x37')]['length']?_0x36dbc9[_0x4ab1('0x37')]:_0x10e61f[_0x4ab1('0x33')];_0x36dbc9[_0x4ab1('0x3c')]=qs[_0x4ab1('0x3d')](_0x5ed33d[_0x4ab1('0x34')][_0x4ab1('0x3d')]);_0x36dbc9[_0x4ab1('0x3e')]=qs[_0x4ab1('0x5b')](_[_0x4ab1('0x5c')](_0x5ed33d[_0x4ab1('0x34')],_0x10e61f[_0x4ab1('0x5b')]));if(_0x5ed33d['query'][_0x4ab1('0x25')]){_0x36dbc9[_0x4ab1('0x3e')]=_['merge'](_0x36dbc9[_0x4ab1('0x3e')],{'$or':_['map'](_0x36dbc9['attributes'],function(_0x317102){var _0x15a9b1={};_0x15a9b1[_0x317102]={'$like':'%'+_0x5ed33d[_0x4ab1('0x34')]['filter']+'%'};return _0x15a9b1;})});}_0x36dbc9=_[_0x4ab1('0x3f')]({},_0x36dbc9,_0x5ed33d[_0x4ab1('0x49')]);return _0x43344f[_0x4ab1('0xaa')](_0x36dbc9);}})[_0x4ab1('0x20')](function(_0x512c4c){if(_0x512c4c){_0x476d7b=_0x512c4c['length'];if(!_0x5ed33d[_0x4ab1('0x34')][_0x4ab1('0x39')](_0x4ab1('0x3a'))){_0x36dbc9['limit']=qs[_0x4ab1('0x1e')](_0x5ed33d[_0x4ab1('0x34')][_0x4ab1('0x1e')]);_0x36dbc9[_0x4ab1('0x3b')]=qs['offset'](_0x5ed33d[_0x4ab1('0x34')][_0x4ab1('0x3b')]);}return _0x43344f['getBlackLists'](_0x36dbc9);}})['then'](function(_0x480713){if(_0x480713){return _0x480713?{'count':_0x476d7b,'rows':_0x480713}:null;}})[_0x4ab1('0x20')](respondWithResult(_0x370e50,null))[_0x4ab1('0x44')](handleError(_0x370e50,null));};exports[_0x4ab1('0xab')]=function(_0x21fb1f,_0x149565,_0x566082){var _0x480f20,_0x37f4ee;return db[_0x4ab1('0x30')][_0x4ab1('0x2a')]({'where':{'id':_0x21fb1f['params']['id']}})[_0x4ab1('0x20')](handleEntityNotFound(_0x149565,null))[_0x4ab1('0x20')](function(_0x4e5f75){if(_0x4e5f75){_0x37f4ee=_0x4e5f75;return _0x4e5f75['addBlackLists'](_0x21fb1f[_0x4ab1('0x4b')][_0x4ab1('0x88')],_[_0x4ab1('0x54')](_0x21fb1f[_0x4ab1('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x20a054){var _0x5cd844;_0x480f20=_0x20a054||[];var _0x57a2cf=[];if(_0x20a054){for(var _0x4e2d3b=0x0;_0x4e2d3b<_0x20a054[_0x4ab1('0x38')];_0x4e2d3b+=0x1){var _0x25256d=_0x20a054[_0x4e2d3b][_0x4ab1('0x4d')]({'plain':!![]});_0x5cd844=squel[_0x4ab1('0x95')]()['into'](_0x4ab1('0xac'))[_0x4ab1('0x97')]([_0x4ab1('0x98'),_0x4ab1('0x99'),_0x4ab1('0x9a'),_0x4ab1('0x5d'),'createdAt','updatedAt'],squel['select']()[_0x4ab1('0x7c')]('phone',_0x4ab1('0x98'))['field']('id',_0x4ab1('0x99'))[_0x4ab1('0x7c')](_0x25256d[_0x4ab1('0x9c')]['toString'](),_0x4ab1('0x9a'))[_0x4ab1('0x7c')](_0x21fb1f[_0x4ab1('0x46')]['id'][_0x4ab1('0xa0')](),_0x4ab1('0x5d'))[_0x4ab1('0x7c')](_0x4ab1('0x9d'),_0x4ab1('0x55'))[_0x4ab1('0x7c')](_0x4ab1('0x9d'),_0x4ab1('0x56'))[_0x4ab1('0x7d')]('cm_contacts')[_0x4ab1('0x3e')](_0x4ab1('0x9e'))[_0x4ab1('0x3e')](_0x4ab1('0x9f'),_0x25256d[_0x4ab1('0x9c')]['toString']())[_0x4ab1('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x4ab1('0xa0')]();_0x57a2cf[_0x4ab1('0x82')](db[_0x4ab1('0x6f')][_0x4ab1('0x34')](_0x5cd844));}return BPromise[_0x4ab1('0xad')](_0x57a2cf);}})[_0x4ab1('0x20')](function(){return _0x480f20;})[_0x4ab1('0x20')](respondWithResult(_0x149565,null))[_0x4ab1('0x44')](handleError(_0x149565,null));};exports[_0x4ab1('0xae')]=function(_0x1235f3,_0x28880f,_0x42722c){return db['VoiceQueue'][_0x4ab1('0x2a')]({'where':{'id':_0x1235f3['params']['id']}})['then'](handleEntityNotFound(_0x28880f,null))['then'](function(_0x53509d){if(_0x53509d){return _0x53509d[_0x4ab1('0xae')](_0x1235f3[_0x4ab1('0x34')]['ids']);}})[_0x4ab1('0x20')](function(_0xb56398){if(_0xb56398){return db[_0x4ab1('0x63')][_0x4ab1('0x21')]({'where':{'ListId':_0x1235f3[_0x4ab1('0x34')][_0x4ab1('0x88')],'VoiceQueueId':_0x1235f3['params']['id']}})[_0x4ab1('0x20')](function(){return _0xb56398;});}})['then'](respondWithStatusCode(_0x28880f,null))['catch'](handleError(_0x28880f,null));}; \ No newline at end of file +var _0x18b5=['compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isNil','format','all','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','cm_hopper','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','send','VoiceQueue','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','omit','body','updatedAt','get','CmHopper','hasOwnProperty','order','pick','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','SIP/%s','forEach','emit','userVoiceQueue:save','ids','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','QueryTypes','every','TeamId','union'];(function(_0x27dddf,_0x8fbb76){var _0x495958=function(_0x5a6be0){while(--_0x5a6be0){_0x27dddf['push'](_0x27dddf['shift']());}};_0x495958(++_0x8fbb76);}(_0x18b5,0x19f));var _0x518b=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x18b5[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x518b('0x0'));var rimraf=require(_0x518b('0x1'));var zipdir=require(_0x518b('0x2'));var jsonpatch=require(_0x518b('0x3'));var rp=require(_0x518b('0x4'));var moment=require(_0x518b('0x5'));var BPromise=require(_0x518b('0x6'));var Mustache=require(_0x518b('0x7'));var util=require(_0x518b('0x8'));var path=require(_0x518b('0x9'));var sox=require('sox');var csv=require(_0x518b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x518b('0xb'));var _=require(_0x518b('0xc'));var squel=require('squel');var crypto=require(_0x518b('0xd'));var jsforce=require(_0x518b('0xe'));var deskjs=require(_0x518b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x518b('0x10'));var Papa=require(_0x518b('0x11'));var Redis=require(_0x518b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x518b('0x13'));var as=require(_0x518b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x518b('0x15'))(_0x518b('0x16'));var utils=require('../../config/utils');var config=require(_0x518b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x518b('0x18')]=_[_0x518b('0x19')](config[_0x518b('0x18')],{'host':_0x518b('0x1a'),'port':0x18eb});var socket=require(_0x518b('0x1b'))(new Redis(config[_0x518b('0x18')]));require(_0x518b('0x1c'))['register'](socket);function respondWithStatusCode(_0x3e460f,_0x5d13aa){_0x5d13aa=_0x5d13aa||0xcc;return function(_0x3ba1f5){if(_0x3ba1f5){return _0x3e460f[_0x518b('0x1d')](_0x5d13aa);}return _0x3e460f[_0x518b('0x1e')](_0x5d13aa)[_0x518b('0x1f')]();};}function respondWithResult(_0x1a0d04,_0x51eb16){_0x51eb16=_0x51eb16||0xc8;return function(_0x35f72e){if(_0x35f72e){return _0x1a0d04[_0x518b('0x1e')](_0x51eb16)[_0x518b('0x20')](_0x35f72e);}};}function respondWithFilteredResult(_0x10263a,_0x43bf7f){return function(_0x243f31){if(_0x243f31){var _0x1f5190=typeof _0x43bf7f[_0x518b('0x21')]===_0x518b('0x22')&&typeof _0x43bf7f[_0x518b('0x23')]===_0x518b('0x22');var _0x4d09e7=_0x243f31[_0x518b('0x24')];var _0x1242ca=_0x1f5190?0x0:_0x43bf7f['offset'];var _0x37aa2c=_0x1f5190?_0x243f31['count']:_0x43bf7f['offset']+_0x43bf7f['limit'];var _0xd3ae5;if(_0x37aa2c>=_0x4d09e7){_0x37aa2c=_0x4d09e7;_0xd3ae5=0xc8;}else{_0xd3ae5=0xce;}_0x10263a[_0x518b('0x1e')](_0xd3ae5);return _0x10263a['set'](_0x518b('0x25'),_0x1242ca+'-'+_0x37aa2c+'/'+_0x4d09e7)['json'](_0x243f31);}return null;};}function patchUpdates(_0x112b88){return function(_0x4c5c2c){try{jsonpatch[_0x518b('0x26')](_0x4c5c2c,_0x112b88,!![]);}catch(_0x3eb223){return BPromise[_0x518b('0x27')](_0x3eb223);}return _0x4c5c2c[_0x518b('0x28')]();};}function saveUpdates(_0x234586,_0x407389){return function(_0x5d441d){if(_0x5d441d){return _0x5d441d[_0x518b('0x29')](_0x234586)[_0x518b('0x2a')](function(_0x2479c9){return _0x2479c9;});}return null;};}function removeEntity(_0x10e6f3,_0x183650){return function(_0x4215c9){if(_0x4215c9){return _0x4215c9[_0x518b('0x2b')]()[_0x518b('0x2a')](function(){var _0x1ba967=_0x4215c9['get']({'plain':!![]});var _0x21757b=[{'name':_0x518b('0x2c'),'value':_0x518b('0x2d'),'ignore':![]},{'name':_0x518b('0x2e'),'value':_0x518b('0x2f'),'ignore':![]}];var _0x17e4fe=_(_0x21757b)[_0x518b('0x30')](_0x518b('0x31'))[_0x518b('0x32')](_0x518b('0x33'))[_0x518b('0x33')]();if(_[_0x518b('0x34')](_0x17e4fe,_0x1ba967[_0x518b('0x35')])){return;}var _0x4d071e=_[_0x518b('0x36')](_0x21757b,['value',_0x1ba967[_0x518b('0x35')]])[_0x518b('0x37')];return db[_0x518b('0x38')][_0x518b('0x2b')]({'where':{'type':_0x4d071e,'resourceId':_0x1ba967['id']}})[_0x518b('0x2a')](function(){return _0x4215c9;});})[_0x518b('0x2a')](function(){_0x10e6f3['status'](0xcc)[_0x518b('0x1f')]();});}};}function handleEntityNotFound(_0x531a12,_0x53a6ce){return function(_0x1f0630){if(!_0x1f0630){_0x531a12[_0x518b('0x1d')](0x194);}return _0x1f0630;};}function handleError(_0x525c2d,_0x268b16){_0x268b16=_0x268b16||0x1f4;return function(_0x13895e){logger['error'](_0x13895e[_0x518b('0x39')]);if(_0x13895e[_0x518b('0x37')]){delete _0x13895e[_0x518b('0x37')];}_0x525c2d[_0x518b('0x1e')](_0x268b16)[_0x518b('0x3a')](_0x13895e);};}exports['index']=function(_0xfaf7,_0x1793e6){var _0x312b0e={},_0x3b3dea={},_0x394a50={'count':0x0,'rows':[]};var _0x2a22ad=_['map'](db[_0x518b('0x3b')]['rawAttributes'],function(_0x58dac8){return{'name':_0x58dac8[_0x518b('0x3c')],'type':_0x58dac8[_0x518b('0x35')][_0x518b('0x3d')]};});_0x3b3dea['model']=_['map'](_0x2a22ad,_0x518b('0x37'));_0x3b3dea[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0xfaf7[_0x518b('0x3e')]);_0x3b3dea[_0x518b('0x40')]=_[_0x518b('0x41')](_0x3b3dea[_0x518b('0x42')],_0x3b3dea[_0x518b('0x3e')]);_0x312b0e[_0x518b('0x43')]=_[_0x518b('0x41')](_0x3b3dea[_0x518b('0x42')],qs[_0x518b('0x44')](_0xfaf7[_0x518b('0x3e')][_0x518b('0x44')]));_0x312b0e['attributes']=_0x312b0e[_0x518b('0x43')][_0x518b('0x45')]?_0x312b0e[_0x518b('0x43')]:_0x3b3dea[_0x518b('0x42')];if(!_0xfaf7[_0x518b('0x3e')]['hasOwnProperty'](_0x518b('0x46'))){_0x312b0e[_0x518b('0x23')]=qs[_0x518b('0x23')](_0xfaf7[_0x518b('0x3e')]['limit']);_0x312b0e[_0x518b('0x21')]=qs[_0x518b('0x21')](_0xfaf7[_0x518b('0x3e')][_0x518b('0x21')]);}_0x312b0e['order']=qs[_0x518b('0x47')](_0xfaf7['query'][_0x518b('0x47')]);_0x312b0e['where']=qs[_0x518b('0x40')](_['pick'](_0xfaf7[_0x518b('0x3e')],_0x3b3dea[_0x518b('0x40')]),_0x2a22ad);if(_0xfaf7[_0x518b('0x3e')]['filter']){_0x312b0e['where']=_[_0x518b('0x48')](_0x312b0e[_0x518b('0x49')],{'$or':_['map'](_0x2a22ad,function(_0x1c9387){if(_0x1c9387[_0x518b('0x35')]!==_0x518b('0x4a')){var _0x927083={};_0x927083[_0x1c9387[_0x518b('0x37')]]={'$like':'%'+_0xfaf7['query'][_0x518b('0x30')]+'%'};return _0x927083;}})});}_0x312b0e=_[_0x518b('0x48')]({},_0x312b0e,_0xfaf7[_0x518b('0x4b')]);var _0x199055={'where':_0x312b0e[_0x518b('0x49')]};return db[_0x518b('0x3b')][_0x518b('0x24')](_0x199055)[_0x518b('0x2a')](function(_0x2b2b01){_0x394a50['count']=_0x2b2b01;if(_0xfaf7[_0x518b('0x3e')][_0x518b('0x4c')]){_0x312b0e[_0x518b('0x4d')]=[{'all':!![]}];}return db[_0x518b('0x3b')]['findAll'](_0x312b0e);})[_0x518b('0x2a')](function(_0x2a11c8){_0x394a50[_0x518b('0x4e')]=_0x2a11c8;return _0x394a50;})[_0x518b('0x2a')](respondWithFilteredResult(_0x1793e6,_0x312b0e))[_0x518b('0x4f')](handleError(_0x1793e6,null));};exports[_0x518b('0x50')]=function(_0x383d53,_0x18f892){var _0x3557db={'raw':![],'where':{'id':_0x383d53[_0x518b('0x51')]['id']}},_0x16bc67={};_0x16bc67[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x3b')][_0x518b('0x52')]);_0x16bc67[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x383d53[_0x518b('0x3e')]);_0x16bc67[_0x518b('0x40')]=_[_0x518b('0x41')](_0x16bc67[_0x518b('0x42')],_0x16bc67['query']);_0x3557db[_0x518b('0x43')]=_['intersection'](_0x16bc67[_0x518b('0x42')],qs[_0x518b('0x44')](_0x383d53[_0x518b('0x3e')]['fields']));_0x3557db['attributes']=_0x3557db[_0x518b('0x43')][_0x518b('0x45')]?_0x3557db[_0x518b('0x43')]:_0x16bc67[_0x518b('0x42')];if(_0x383d53[_0x518b('0x3e')]['includeAll']){_0x3557db[_0x518b('0x4d')]=[{'all':!![]}];}_0x3557db=_[_0x518b('0x48')]({},_0x3557db,_0x383d53[_0x518b('0x4b')]);return db[_0x518b('0x3b')][_0x518b('0x36')](_0x3557db)[_0x518b('0x2a')](handleEntityNotFound(_0x18f892,null))['then'](respondWithResult(_0x18f892,null))[_0x518b('0x4f')](handleError(_0x18f892,null));};exports[_0x518b('0x53')]=function(_0x946247,_0x131650){return db['VoiceQueue'][_0x518b('0x53')](_0x946247['body'],{})[_0x518b('0x2a')](function(_0x5df6bf){var _0x2001b9=_0x946247[_0x518b('0x54')]['get']({'plain':!![]});if(!_0x2001b9)throw new Error(_0x518b('0x55'));if(_0x2001b9[_0x518b('0x56')]===_0x518b('0x54')){var _0x55cfc2=_0x5df6bf['get']({'plain':!![]});var _0x3870ef=[{'name':_0x518b('0x2c'),'value':_0x518b('0x2d')},{'name':_0x518b('0x2e'),'value':'outbound'}];var _0x58598e=_['find'](_0x3870ef,[_0x518b('0x33'),_0x55cfc2[_0x518b('0x35')]])['name'];return db[_0x518b('0x57')][_0x518b('0x36')]({'where':{'name':_0x58598e,'userProfileId':_0x2001b9[_0x518b('0x58')]},'raw':!![]})[_0x518b('0x2a')](function(_0x25bbae){if(_0x25bbae&&_0x25bbae[_0x518b('0x59')]===0x0){return db[_0x518b('0x38')][_0x518b('0x53')]({'name':_0x55cfc2[_0x518b('0x37')],'resourceId':_0x55cfc2['id'],'type':_0x25bbae[_0x518b('0x37')],'sectionId':_0x25bbae['id']},{})['then'](function(){return _0x5df6bf;});}else{return _0x5df6bf;}})[_0x518b('0x4f')](function(_0xf2408e){logger['error'](_0x518b('0x5a'),_0xf2408e);throw _0xf2408e;});}return _0x5df6bf;})['then'](respondWithResult(_0x131650,0xc9))[_0x518b('0x4f')](handleError(_0x131650,null));};exports['clone']=function(_0x2ad7b5,_0x1a0cbc){var _0x4fd01f={'where':{'id':_0x2ad7b5[_0x518b('0x51')]['id']}},_0x1af0b5={};_0x1af0b5[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x3b')][_0x518b('0x52')]);_0x4fd01f[_0x518b('0x43')]=_['intersection'](_0x1af0b5[_0x518b('0x42')],qs[_0x518b('0x44')](_0x2ad7b5['query'][_0x518b('0x44')]));_0x4fd01f[_0x518b('0x43')]=_0x4fd01f['attributes'][_0x518b('0x45')]?_0x4fd01f['attributes']:_0x1af0b5['model'];if(_0x2ad7b5['query']['includeAll']){_0x4fd01f['include']=[{'all':!![]}];}_0x4fd01f=_[_0x518b('0x48')]({},_0x4fd01f,_0x2ad7b5[_0x518b('0x4b')]);return db[_0x518b('0x3b')]['find'](_0x4fd01f)['then'](handleEntityNotFound(_0x1a0cbc,null))[_0x518b('0x2a')](function(_0x31668e){if(_0x31668e){var _0x47ab09=_0x31668e['get']({'plain':!![]});_0x47ab09=qs['omit'](_0x47ab09,['id',_0x518b('0x5b'),'updatedAt']);_0x2ad7b5['body']=_[_0x518b('0x5c')](_0x2ad7b5[_0x518b('0x5d')],['id',_0x518b('0x5b'),_0x518b('0x5e')]);return db['VoiceQueue'][_0x518b('0x53')](_[_0x518b('0x48')](_0x47ab09,_0x2ad7b5[_0x518b('0x5d')]),{'include':_0x2ad7b5['query'][_0x518b('0x4c')]?[{'all':!![]}]:undefined})[_0x518b('0x2a')](function(_0x11d1a6){var _0x1391a6=_0x2ad7b5[_0x518b('0x54')][_0x518b('0x5f')]({'plain':!![]});if(!_0x1391a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1391a6[_0x518b('0x56')]==='user'){var _0x50d843=_0x11d1a6['get']({'plain':!![]});var _0xa3d2e0=[{'name':_0x518b('0x2c'),'value':_0x518b('0x2d')},{'name':_0x518b('0x2e'),'value':_0x518b('0x2f')}];var _0x33643d=_[_0x518b('0x36')](_0xa3d2e0,[_0x518b('0x33'),_0x50d843[_0x518b('0x35')]])[_0x518b('0x37')];return db['UserProfileSection'][_0x518b('0x36')]({'where':{'name':_0x33643d,'userProfileId':_0x1391a6[_0x518b('0x58')]},'raw':!![]})[_0x518b('0x2a')](function(_0x27e531){if(_0x27e531&&_0x27e531[_0x518b('0x59')]===0x0){return db[_0x518b('0x38')]['create']({'name':_0x50d843[_0x518b('0x37')],'resourceId':_0x50d843['id'],'type':_0x27e531[_0x518b('0x37')],'sectionId':_0x27e531['id']},{})[_0x518b('0x2a')](function(){return _0x11d1a6;});}else{return _0x11d1a6;}})['catch'](function(_0x487d7a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487d7a);throw _0x487d7a;});}return _0x11d1a6;});}})[_0x518b('0x2a')](respondWithResult(_0x1a0cbc,0xc9))[_0x518b('0x4f')](handleError(_0x1a0cbc,null));};exports[_0x518b('0x29')]=function(_0x4962e2,_0x376a3e){if(_0x4962e2[_0x518b('0x5d')]['id']){delete _0x4962e2[_0x518b('0x5d')]['id'];}return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x4962e2['params']['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x376a3e,null))[_0x518b('0x2a')](saveUpdates(_0x4962e2[_0x518b('0x5d')],null))[_0x518b('0x2a')](respondWithResult(_0x376a3e,null))[_0x518b('0x4f')](handleError(_0x376a3e,null));};exports[_0x518b('0x2b')]=function(_0x2e3c60,_0x5a3e12){return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x2e3c60[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x5a3e12,null))[_0x518b('0x2a')](removeEntity(_0x5a3e12,null))[_0x518b('0x4f')](handleError(_0x5a3e12,null));};exports['getHoppers']=function(_0x1b906a,_0x8dbd70,_0x3f3c31){var _0x5b5937={'raw':![],'where':{}};var _0x58a8e9={};var _0x8a42c3={'count':0x0,'rows':[]};return db[_0x518b('0x3b')]['findOne']({'where':{'id':_0x1b906a[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x8dbd70,null))[_0x518b('0x2a')](function(_0x335479){if(_0x335479){_0x58a8e9[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x60')][_0x518b('0x52')]);_0x58a8e9[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x1b906a['query']);_0x58a8e9[_0x518b('0x40')]=_[_0x518b('0x41')](_0x58a8e9[_0x518b('0x42')],_0x58a8e9['query']);_0x5b5937[_0x518b('0x43')]=_[_0x518b('0x41')](_0x58a8e9[_0x518b('0x42')],qs[_0x518b('0x44')](_0x1b906a['query']['fields']));_0x5b5937[_0x518b('0x43')]=_0x5b5937[_0x518b('0x43')][_0x518b('0x45')]?_0x5b5937[_0x518b('0x43')]:_0x58a8e9[_0x518b('0x42')];if(!_0x1b906a[_0x518b('0x3e')][_0x518b('0x61')](_0x518b('0x46'))){_0x5b5937[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x1b906a[_0x518b('0x3e')][_0x518b('0x23')]);_0x5b5937[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x1b906a[_0x518b('0x3e')][_0x518b('0x21')]);}_0x5b5937[_0x518b('0x62')]=qs[_0x518b('0x47')](_0x1b906a['query'][_0x518b('0x47')]);_0x5b5937['where']=qs[_0x518b('0x40')](_[_0x518b('0x63')](_0x1b906a['query'],_0x58a8e9[_0x518b('0x40')]));_0x5b5937['where'][_0x518b('0x64')]=_0x335479['id'];if(_0x1b906a[_0x518b('0x3e')]['filter']){_0x5b5937[_0x518b('0x49')]=_[_0x518b('0x48')](_0x5b5937[_0x518b('0x49')],{'$or':_['map'](_0x5b5937[_0x518b('0x43')],function(_0x58000f){var _0x5e3651={};_0x5e3651[_0x58000f]={'$like':'%'+_0x1b906a['query'][_0x518b('0x30')]+'%'};return _0x5e3651;})});}_0x5b5937=_[_0x518b('0x48')]({},_0x5b5937,_0x1b906a[_0x518b('0x4b')]);return db['CmHopper'][_0x518b('0x24')]({'where':_0x5b5937[_0x518b('0x49')]})['then'](function(_0x449bf5){_0x8a42c3['count']=_0x449bf5;if(_0x1b906a[_0x518b('0x3e')][_0x518b('0x4c')]){_0x5b5937['include']=[{'all':!![]}];}return db['CmHopper'][_0x518b('0x65')](_0x5b5937);})[_0x518b('0x2a')](function(_0x4193b0){_0x8a42c3[_0x518b('0x4e')]=_0x4193b0;return _0x8a42c3;});}})['then'](respondWithFilteredResult(_0x8dbd70,_0x5b5937))['catch'](handleError(_0x8dbd70,null));};exports[_0x518b('0x66')]=function(_0x5c9892,_0x593e47,_0x538ae0){var _0x58ea6c={'raw':!![],'where':{}};var _0x419c1a={};var _0x32feec={'count':0x0,'rows':[]};return db[_0x518b('0x3b')][_0x518b('0x67')]({'where':{'id':_0x5c9892[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x593e47,null))[_0x518b('0x2a')](function(_0x76499){if(_0x76499){_0x419c1a[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x68')][_0x518b('0x52')]);_0x419c1a[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x5c9892[_0x518b('0x3e')]);_0x419c1a[_0x518b('0x40')]=_[_0x518b('0x41')](_0x419c1a['model'],_0x419c1a[_0x518b('0x3e')]);_0x58ea6c[_0x518b('0x43')]=_[_0x518b('0x41')](_0x419c1a[_0x518b('0x42')],qs['fields'](_0x5c9892[_0x518b('0x3e')][_0x518b('0x44')]));_0x58ea6c['attributes']=_0x58ea6c['attributes'][_0x518b('0x45')]?_0x58ea6c[_0x518b('0x43')]:_0x419c1a['model'];if(!_0x5c9892[_0x518b('0x3e')][_0x518b('0x61')]('nolimit')){_0x58ea6c['limit']=qs[_0x518b('0x23')](_0x5c9892[_0x518b('0x3e')][_0x518b('0x23')]);_0x58ea6c['offset']=qs[_0x518b('0x21')](_0x5c9892[_0x518b('0x3e')][_0x518b('0x21')]);}_0x58ea6c[_0x518b('0x62')]=qs['sort'](_0x5c9892[_0x518b('0x3e')][_0x518b('0x47')]);_0x58ea6c[_0x518b('0x49')]=qs[_0x518b('0x40')](_['pick'](_0x5c9892['query'],_0x419c1a[_0x518b('0x40')]));_0x58ea6c[_0x518b('0x49')][_0x518b('0x64')]=_0x76499['id'];if(_0x5c9892['query'][_0x518b('0x30')]){_0x58ea6c[_0x518b('0x49')]=_[_0x518b('0x48')](_0x58ea6c[_0x518b('0x49')],{'$or':_['map'](_0x58ea6c[_0x518b('0x43')],function(_0x549da6){var _0x2054b8={};_0x2054b8[_0x549da6]={'$like':'%'+_0x5c9892[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x2054b8;})});}_0x58ea6c=_[_0x518b('0x48')]({},_0x58ea6c,_0x5c9892[_0x518b('0x4b')]);return db[_0x518b('0x68')]['count']({'where':_0x58ea6c[_0x518b('0x49')]})['then'](function(_0xa1e6be){_0x32feec['count']=_0xa1e6be;if(_0x5c9892['query']['includeAll']){_0x58ea6c[_0x518b('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x518b('0x65')](_0x58ea6c);})[_0x518b('0x2a')](function(_0x4cd8e2){_0x32feec['rows']=_0x4cd8e2;return _0x32feec;});}})['then'](respondWithFilteredResult(_0x593e47,_0x58ea6c))['catch'](handleError(_0x593e47,null));};exports['getHopperFinals']=function(_0x99ad9c,_0x4b3e4c,_0x346776){var _0x3b72d2={'raw':!![],'where':{}};var _0x8e68c2={};var _0x31e715={'count':0x0,'rows':[]};return db[_0x518b('0x3b')][_0x518b('0x67')]({'where':{'id':_0x99ad9c['params']['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x4b3e4c,null))[_0x518b('0x2a')](function(_0x37bcfb){if(_0x37bcfb){_0x8e68c2[_0x518b('0x42')]=_['keys'](db[_0x518b('0x69')][_0x518b('0x52')]);_0x8e68c2[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x99ad9c[_0x518b('0x3e')]);_0x8e68c2['filters']=_[_0x518b('0x41')](_0x8e68c2[_0x518b('0x42')],_0x8e68c2[_0x518b('0x3e')]);_0x3b72d2[_0x518b('0x43')]=_[_0x518b('0x41')](_0x8e68c2[_0x518b('0x42')],qs[_0x518b('0x44')](_0x99ad9c['query'][_0x518b('0x44')]));_0x3b72d2[_0x518b('0x43')]=_0x3b72d2['attributes'][_0x518b('0x45')]?_0x3b72d2['attributes']:_0x8e68c2[_0x518b('0x42')];if(!_0x99ad9c[_0x518b('0x3e')]['hasOwnProperty']('nolimit')){_0x3b72d2[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x99ad9c[_0x518b('0x3e')][_0x518b('0x23')]);_0x3b72d2[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x99ad9c[_0x518b('0x3e')][_0x518b('0x21')]);}_0x3b72d2['order']=qs['sort'](_0x99ad9c['query'][_0x518b('0x47')]);_0x3b72d2[_0x518b('0x49')]=qs[_0x518b('0x40')](_[_0x518b('0x63')](_0x99ad9c[_0x518b('0x3e')],_0x8e68c2[_0x518b('0x40')]));_0x3b72d2['where'][_0x518b('0x64')]=_0x37bcfb['id'];if(_0x99ad9c[_0x518b('0x3e')]['filter']){_0x3b72d2['where']=_['merge'](_0x3b72d2['where'],{'$or':_[_0x518b('0x32')](_0x3b72d2[_0x518b('0x43')],function(_0x584f4f){var _0x52daf7={};_0x52daf7[_0x584f4f]={'$like':'%'+_0x99ad9c[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x52daf7;})});}_0x3b72d2=_['merge']({},_0x3b72d2,_0x99ad9c[_0x518b('0x4b')]);return db[_0x518b('0x69')][_0x518b('0x24')]({'where':_0x3b72d2['where']})[_0x518b('0x2a')](function(_0x1cea5c){_0x31e715[_0x518b('0x24')]=_0x1cea5c;if(_0x99ad9c[_0x518b('0x3e')][_0x518b('0x4c')]){_0x3b72d2['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x518b('0x65')](_0x3b72d2);})[_0x518b('0x2a')](function(_0x557203){_0x31e715[_0x518b('0x4e')]=_0x557203;return _0x31e715;});}})[_0x518b('0x2a')](respondWithFilteredResult(_0x4b3e4c,_0x3b72d2))[_0x518b('0x4f')](handleError(_0x4b3e4c,null));};exports[_0x518b('0x6a')]=function(_0x4973c3,_0x6c5f71,_0x18d42d){var _0x291a69={'raw':!![],'where':{}};var _0x1dfa73={};var _0x5875e7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x518b('0x67')]({'where':{'id':_0x4973c3[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x6c5f71,null))[_0x518b('0x2a')](function(_0x16d934){if(_0x16d934){_0x1dfa73[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x6b')]['rawAttributes']);_0x1dfa73['query']=_[_0x518b('0x3f')](_0x4973c3[_0x518b('0x3e')]);_0x1dfa73[_0x518b('0x40')]=_[_0x518b('0x41')](_0x1dfa73[_0x518b('0x42')],_0x1dfa73[_0x518b('0x3e')]);_0x291a69[_0x518b('0x43')]=_['intersection'](_0x1dfa73['model'],qs['fields'](_0x4973c3[_0x518b('0x3e')][_0x518b('0x44')]));_0x291a69[_0x518b('0x43')]=_0x291a69['attributes'][_0x518b('0x45')]?_0x291a69[_0x518b('0x43')]:_0x1dfa73[_0x518b('0x42')];if(!_0x4973c3['query'][_0x518b('0x61')](_0x518b('0x46'))){_0x291a69[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x4973c3[_0x518b('0x3e')][_0x518b('0x23')]);_0x291a69[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x4973c3['query'][_0x518b('0x21')]);}_0x291a69[_0x518b('0x62')]=qs[_0x518b('0x47')](_0x4973c3[_0x518b('0x3e')][_0x518b('0x47')]);_0x291a69[_0x518b('0x49')]=qs[_0x518b('0x40')](_[_0x518b('0x63')](_0x4973c3[_0x518b('0x3e')],_0x1dfa73[_0x518b('0x40')]));_0x291a69[_0x518b('0x49')][_0x518b('0x64')]=_0x16d934['id'];if(_0x4973c3[_0x518b('0x3e')]['filter']){_0x291a69[_0x518b('0x49')]=_['merge'](_0x291a69['where'],{'$or':_[_0x518b('0x32')](_0x291a69['attributes'],function(_0x3474e1){var _0x32d521={};_0x32d521[_0x3474e1]={'$like':'%'+_0x4973c3[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x32d521;})});}_0x291a69=_[_0x518b('0x48')]({},_0x291a69,_0x4973c3['options']);return db['CmHopperBlack'][_0x518b('0x24')]({'where':_0x291a69[_0x518b('0x49')]})[_0x518b('0x2a')](function(_0x725598){_0x5875e7[_0x518b('0x24')]=_0x725598;if(_0x4973c3[_0x518b('0x3e')][_0x518b('0x4c')]){_0x291a69[_0x518b('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x291a69);})[_0x518b('0x2a')](function(_0x453724){_0x5875e7['rows']=_0x453724;return _0x5875e7;});}})[_0x518b('0x2a')](respondWithFilteredResult(_0x6c5f71,_0x291a69))[_0x518b('0x4f')](handleError(_0x6c5f71,null));};exports[_0x518b('0x6c')]=function(_0x57b03f,_0x22e940,_0x27d330){var _0x2f291b={};var _0x383dac={};var _0x36f2f9;var _0x126003;return db[_0x518b('0x3b')][_0x518b('0x67')]({'where':{'id':_0x57b03f[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x22e940,null))[_0x518b('0x2a')](function(_0x602380){if(_0x602380){_0x36f2f9=_0x602380;_0x383dac[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x6d')][_0x518b('0x52')]);_0x383dac[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x57b03f[_0x518b('0x3e')]);_0x383dac[_0x518b('0x40')]=_['intersection'](_0x383dac[_0x518b('0x42')],_0x383dac[_0x518b('0x3e')]);_0x2f291b[_0x518b('0x43')]=_[_0x518b('0x41')](_0x383dac[_0x518b('0x42')],qs[_0x518b('0x44')](_0x57b03f['query'][_0x518b('0x44')]));_0x2f291b[_0x518b('0x43')]=_0x2f291b[_0x518b('0x43')][_0x518b('0x45')]?_0x2f291b['attributes']:_0x383dac[_0x518b('0x42')];_0x2f291b[_0x518b('0x62')]=qs[_0x518b('0x47')](_0x57b03f[_0x518b('0x3e')]['sort']);_0x2f291b[_0x518b('0x49')]=qs[_0x518b('0x40')](_[_0x518b('0x63')](_0x57b03f[_0x518b('0x3e')],_0x383dac[_0x518b('0x40')]));if(_0x57b03f[_0x518b('0x3e')][_0x518b('0x30')]){_0x2f291b['where']=_[_0x518b('0x48')](_0x2f291b[_0x518b('0x49')],{'$or':_['map'](_0x2f291b['attributes'],function(_0x219e55){var _0x3b91d3={};_0x3b91d3[_0x219e55]={'$like':'%'+_0x57b03f[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x3b91d3;})});}_0x2f291b=_[_0x518b('0x48')]({},_0x2f291b,_0x57b03f['options']);return _0x36f2f9['getTeams'](_0x2f291b);}})[_0x518b('0x2a')](function(_0x32159d){if(_0x32159d){_0x126003=_0x32159d[_0x518b('0x45')];if(!_0x57b03f[_0x518b('0x3e')][_0x518b('0x61')](_0x518b('0x46'))){_0x2f291b[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x57b03f[_0x518b('0x3e')][_0x518b('0x23')]);_0x2f291b[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x57b03f[_0x518b('0x3e')][_0x518b('0x21')]);}return _0x36f2f9['getTeams'](_0x2f291b);}})[_0x518b('0x2a')](function(_0x23de3d){if(_0x23de3d){return _0x23de3d?{'count':_0x126003,'rows':_0x23de3d}:null;}})['then'](respondWithResult(_0x22e940,null))[_0x518b('0x4f')](handleError(_0x22e940,null));};exports[_0x518b('0x6e')]=function(_0x40e3de,_0x5b6752,_0x3df2f2){var _0x34c97d=_0x40e3de['body'][_0x518b('0x6f')];var _0x23fe85=_[_0x518b('0x32')](_0x34c97d,'id');return db[_0x518b('0x6d')]['findAll']({'where':{'id':_0x23fe85},'attributes':['id'],'include':[{'model':db[_0x518b('0x70')],'as':_0x518b('0x71'),'attributes':['id','name',_0x518b('0x72'),_0x518b('0x73'),_0x518b('0x74')],'raw':!![]}]})[_0x518b('0x2a')](function(_0x97675f){if(_0x97675f){var _0x59e7f5=_[_0x518b('0x75')](_0x97675f,function(_0x133629){var _0x310275=_0x133629[_0x518b('0x5f')]({'plain':!![]});_0x310275[_0x518b('0x71')]['forEach'](function(_0x3fdd30){_0x3fdd30[_0x518b('0x76')]=_[_0x518b('0x36')](_0x34c97d,{'id':_0x310275['id']})[_0x518b('0x76')];});return _0x310275[_0x518b('0x71')];});return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x40e3de[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](function(_0x5b490c){return db['sequelize']['transaction'](function(_0x45e4fd){return _0x5b490c[_0x518b('0x6e')](_0x23fe85,{'transaction':_0x45e4fd})[_0x518b('0x2a')](function(){return BPromise['each'](_0x34c97d,function(_0x2cd131){return db[_0x518b('0x77')][_0x518b('0x78')]({'TeamId':_0x2cd131['id'],'VoiceQueueId':_0x40e3de[_0x518b('0x51')]['id'],'penalty':_0x2cd131[_0x518b('0x76')]},{'transaction':_0x45e4fd});});})[_0x518b('0x2a')](function(){return BPromise[_0x518b('0x79')](_0x59e7f5,function(_0x51d651){return db[_0x518b('0x7a')][_0x518b('0x7b')]({'where':{'UserId':_0x51d651['id'],'VoiceQueueId':_0x40e3de[_0x518b('0x51')]['id']},'defaults':{'penalty':_0x51d651['penalty']},'transaction':_0x45e4fd});});})['then'](function(){return BPromise[_0x518b('0x79')](_[_0x518b('0x30')](_0x59e7f5,{'online':!![]}),function(_0x181ec9){return db['UserVoiceQueueRt']['upsert']({'membername':_0x181ec9['name'],'UserId':_0x181ec9['id'],'queue_name':_0x5b490c['name'],'VoiceQueueId':_0x5b490c['id'],'interface':_['isNil'](_0x181ec9[_0x518b('0x74')])?util['format'](_0x518b('0x7c'),_0x181ec9[_0x518b('0x37')]):_0x181ec9['interface'],'paused':_0x181ec9[_0x518b('0x73')]||![],'penalty':_0x181ec9[_0x518b('0x76')]},{'transaction':_0x45e4fd});});})[_0x518b('0x2a')](function(){_0x59e7f5[_0x518b('0x7d')](function(_0x54722e){socket[_0x518b('0x7e')](_0x518b('0x7f'),{'UserId':_0x54722e['id'],'VoiceQueueId':_0x5b490c['id']});});});});});}})[_0x518b('0x2a')](respondWithStatusCode(_0x5b6752,null))[_0x518b('0x4f')](handleError(_0x5b6752,null));};exports['removeTeams']=function(_0x58a2fc,_0x3db9c5,_0x5b924a){return db[_0x518b('0x6d')]['findAll']({'where':{'id':_0x58a2fc[_0x518b('0x3e')][_0x518b('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x518b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x518b('0x2a')](handleEntityNotFound(_0x3db9c5,null))[_0x518b('0x2a')](function(_0x16d01f){var _0x19ff06=_[_0x518b('0x32')](_0x16d01f,'id');var _0x2cece6=[];var _0x5e58ae=[];var _0x448cb6=squel['select']();_0x448cb6[_0x518b('0x81')](_0x518b('0x82'))['from']('team_has_voice_queues','tq')['join'](_0x518b('0x83'),'ut',_0x518b('0x84'))['where']('VoiceQueueId\x20=\x20?',_0x58a2fc[_0x518b('0x51')]['id']);for(var _0x35b790=0x0;_0x35b790<_0x16d01f[_0x518b('0x45')];_0x35b790+=0x1){let _0x2e6ea4=_0x16d01f[_0x35b790];for(var _0x1213bc=0x0;_0x1213bc<_0x2e6ea4[_0x518b('0x71')][_0x518b('0x45')];_0x1213bc+=0x1){let _0x5d11f6=_0x2e6ea4[_0x518b('0x71')][_0x1213bc];var _0x1e30e4=_0x448cb6[_0x518b('0x85')]();_0x1e30e4[_0x518b('0x49')]('ut.UserId\x20=\x20?',_0x5d11f6['id']);_0x5e58ae[_0x518b('0x86')](db[_0x518b('0x87')]['query'](_0x1e30e4['toString'](),{'type':db[_0x518b('0x87')][_0x518b('0x88')]['SELECT']})['then'](function(_0x3ad7e4){if(_0x3ad7e4[_0x518b('0x45')]===0x1){return _0x5d11f6['id'];}else{var _0x287f14=_[_0x518b('0x89')](_[_0x518b('0x32')](_0x3ad7e4,_0x518b('0x8a')),function(_0x5f4398){return _[_0x518b('0x34')](_0x19ff06,_0x5f4398);});if(_0x287f14){return _0x5d11f6['id'];}}}));}}return BPromise['all'](_0x5e58ae)[_0x518b('0x2a')](function(_0x317417){_0x2cece6=_(_0x2cece6)[_0x518b('0x8b')](_0x317417)[_0x518b('0x8c')]()[_0x518b('0x33')]();return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x58a2fc[_0x518b('0x51')]['id']}})['then'](function(_0x432c1b){return db[_0x518b('0x87')][_0x518b('0x8d')](function(_0x39cd3f){return _0x432c1b['removeTeams'](_0x58a2fc[_0x518b('0x3e')][_0x518b('0x80')],{'transaction':_0x39cd3f})[_0x518b('0x2a')](function(){if(!_[_0x518b('0x8e')](_0x2cece6)){return _0x432c1b[_0x518b('0x8f')](_0x2cece6,{'transaction':_0x39cd3f})['then'](function(){return db[_0x518b('0x90')]['destroy']({'where':{'VoiceQueueId':_0x58a2fc[_0x518b('0x51')]['id'],'UserId':_0x2cece6},'transaction':_0x39cd3f});});}})['then'](function(){_0x2cece6['forEach'](function(_0x1e587d){socket[_0x518b('0x7e')](_0x518b('0x91'),{'UserId':_0x1e587d,'VoiceQueueId':_0x432c1b['id']});});});});});});})[_0x518b('0x2a')](respondWithStatusCode(_0x3db9c5,null))[_0x518b('0x4f')](handleError(_0x3db9c5,null));};exports[_0x518b('0x92')]=function(_0x1f364f,_0x33da24,_0x431e94){var _0x51788a,_0xb9079c;return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x1f364f[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x33da24,null))[_0x518b('0x2a')](function(_0x4953a8){if(_0x4953a8){_0xb9079c=_0x4953a8;return _0x4953a8[_0x518b('0x92')](_0x1f364f[_0x518b('0x5d')][_0x518b('0x80')],_[_0x518b('0x5c')](_0x1f364f[_0x518b('0x5d')],[_0x518b('0x80'),'id'])||{})[_0x518b('0x93')](function(_0x9b4e45){for(var _0x186f62=0x0;_0x186f62<_0x1f364f[_0x518b('0x5d')]['ids'][_0x518b('0x45')];_0x186f62+=0x1){socket[_0x518b('0x7e')]('userVoiceQueue:save',{'UserId':Number(_0x1f364f[_0x518b('0x5d')]['ids'][_0x186f62]),'VoiceQueueId':Number(_0x1f364f[_0x518b('0x51')]['id'])});}return _0x9b4e45;});}})[_0x518b('0x2a')](function(_0x1bd026){_0x51788a=_0x1bd026||[];if(_0xb9079c){return db[_0x518b('0x70')][_0x518b('0x65')]({'where':{'id':_0x1f364f[_0x518b('0x5d')][_0x518b('0x80')]},'attributes':['id',_0x518b('0x37'),_0x518b('0x72'),_0x518b('0x73'),'interface'],'raw':!![]});}})['then'](function(_0xcaa29){if(!_[_0x518b('0x8e')](_0xcaa29)){var _0x4511c8=[];for(var _0x297840=0x0;_0x297840<_0xcaa29[_0x518b('0x45')];_0x297840++){if(_0xcaa29[_0x297840]['online']){_0x4511c8[_0x518b('0x86')](db[_0x518b('0x90')][_0x518b('0x78')]({'membername':_0xcaa29[_0x297840][_0x518b('0x37')],'UserId':_0xcaa29[_0x297840]['id'],'queue_name':_0xb9079c[_0x518b('0x37')],'VoiceQueueId':_0xb9079c['id'],'interface':_[_0x518b('0x94')](_0xcaa29[_0x297840][_0x518b('0x74')])?util[_0x518b('0x95')](_0x518b('0x7c'),_0xcaa29[_0x297840][_0x518b('0x37')]):_0xcaa29[_0x297840][_0x518b('0x74')],'paused':_0xcaa29[_0x297840][_0x518b('0x73')]||![],'penalty':_0x1f364f['body'][_0x518b('0x76')]||0x0}));}}return BPromise[_0x518b('0x96')](_0x4511c8);}})[_0x518b('0x2a')](function(){return _0x51788a;})[_0x518b('0x2a')](respondWithResult(_0x33da24,null))[_0x518b('0x4f')](handleError(_0x33da24,null));};exports['removeAgents']=function(_0x1e3b43,_0x50599a,_0x40c90e){return db['VoiceQueue']['find']({'where':{'id':_0x1e3b43[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x50599a,null))[_0x518b('0x2a')](function(_0x5e5dfd){if(_0x5e5dfd){return _0x5e5dfd[_0x518b('0x8f')](_0x1e3b43['query']['ids'])[_0x518b('0x2a')](function(){if(_['isArray'](_0x1e3b43[_0x518b('0x3e')][_0x518b('0x80')])){for(var _0x39a0ae=0x0;_0x39a0ae<_0x1e3b43[_0x518b('0x3e')]['ids'][_0x518b('0x45')];_0x39a0ae+=0x1){socket[_0x518b('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x1e3b43['query'][_0x518b('0x80')][_0x39a0ae]),'VoiceQueueId':Number(_0x1e3b43[_0x518b('0x51')]['id'])});}}else{socket[_0x518b('0x7e')]('userVoiceQueue:remove',{'UserId':Number(_0x1e3b43[_0x518b('0x3e')][_0x518b('0x80')]),'VoiceQueueId':Number(_0x1e3b43[_0x518b('0x51')]['id'])});}});}})[_0x518b('0x2a')](function(_0x34904e){return db[_0x518b('0x90')]['destroy']({'where':{'VoiceQueueId':_0x1e3b43['params']['id'],'UserId':_0x1e3b43[_0x518b('0x3e')][_0x518b('0x80')]}})[_0x518b('0x2a')](function(){return _0x34904e;});})['then'](respondWithStatusCode(_0x50599a,null))[_0x518b('0x4f')](handleError(_0x50599a,null));};exports['getAgents']=function(_0x58af2d,_0x1f8fb0,_0x31d335){var _0x4d854a={};var _0x273b63={};var _0x184041;var _0xffd150;return db[_0x518b('0x3b')][_0x518b('0x67')]({'where':{'id':_0x58af2d[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x1f8fb0,null))[_0x518b('0x2a')](function(_0xc9d778){if(_0xc9d778){_0x184041=_0xc9d778;_0x273b63[_0x518b('0x42')]=_['keys'](db['User'][_0x518b('0x52')]);_0x273b63[_0x518b('0x3e')]=_[_0x518b('0x3f')](_0x58af2d[_0x518b('0x3e')]);_0x273b63[_0x518b('0x40')]=_['intersection'](_0x273b63[_0x518b('0x42')],_0x273b63[_0x518b('0x3e')]);_0x4d854a[_0x518b('0x43')]=_['intersection'](_0x273b63['model'],qs['fields'](_0x58af2d[_0x518b('0x3e')][_0x518b('0x44')]));_0x4d854a['attributes']=_0x4d854a[_0x518b('0x43')]['length']?_0x4d854a[_0x518b('0x43')]:_0x273b63[_0x518b('0x42')];_0x4d854a['order']=qs['sort'](_0x58af2d['query'][_0x518b('0x47')]);_0x4d854a[_0x518b('0x49')]=qs['filters'](_[_0x518b('0x63')](_0x58af2d['query'],_0x273b63[_0x518b('0x40')]));if(_0x58af2d[_0x518b('0x3e')]['filter']){_0x4d854a[_0x518b('0x49')]=_[_0x518b('0x48')](_0x4d854a[_0x518b('0x49')],{'$or':_[_0x518b('0x32')](_0x4d854a[_0x518b('0x43')],function(_0x5e43a7){var _0x217b87={};_0x217b87[_0x5e43a7]={'$like':'%'+_0x58af2d[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x217b87;})});}_0x4d854a=_[_0x518b('0x48')]({},_0x4d854a,_0x58af2d[_0x518b('0x4b')]);return _0x184041[_0x518b('0x97')](_0x4d854a);}})[_0x518b('0x2a')](function(_0x324e3b){if(_0x324e3b){_0xffd150=_0x324e3b[_0x518b('0x45')];if(!_0x58af2d['query'][_0x518b('0x61')](_0x518b('0x46'))){_0x4d854a[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x58af2d['query']['limit']);_0x4d854a[_0x518b('0x21')]=qs['offset'](_0x58af2d[_0x518b('0x3e')][_0x518b('0x21')]);}return _0x184041[_0x518b('0x97')](_0x4d854a);}})['then'](function(_0x26b7d3){if(_0x26b7d3){return _0x26b7d3?{'count':_0xffd150,'rows':_0x26b7d3}:null;}})['then'](respondWithResult(_0x1f8fb0,null))[_0x518b('0x4f')](handleError(_0x1f8fb0,null));};exports[_0x518b('0x98')]=function(_0x113ef4,_0x27694c,_0x587a04){var _0x520776={};var _0x42921c={};var _0x12f0fe;var _0x2362c4;return db[_0x518b('0x3b')]['findOne']({'where':{'id':_0x113ef4[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x27694c,null))['then'](function(_0x46f002){if(_0x46f002){_0x12f0fe=_0x46f002;_0x42921c[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x90')]['rawAttributes']);_0x42921c['query']=_[_0x518b('0x3f')](_0x113ef4[_0x518b('0x3e')]);_0x42921c['filters']=_[_0x518b('0x41')](_0x42921c['model'],_0x42921c[_0x518b('0x3e')]);_0x520776[_0x518b('0x43')]=_[_0x518b('0x41')](_0x42921c[_0x518b('0x42')],qs[_0x518b('0x44')](_0x113ef4[_0x518b('0x3e')][_0x518b('0x44')]));_0x520776[_0x518b('0x43')]=_0x520776[_0x518b('0x43')][_0x518b('0x45')]?_0x520776[_0x518b('0x43')]:_0x42921c[_0x518b('0x42')];_0x520776['order']=qs[_0x518b('0x47')](_0x113ef4[_0x518b('0x3e')]['sort']);_0x520776[_0x518b('0x49')]=qs[_0x518b('0x40')](_['pick'](_0x113ef4[_0x518b('0x3e')],_0x42921c[_0x518b('0x40')]));if(_0x113ef4[_0x518b('0x3e')][_0x518b('0x30')]){_0x520776[_0x518b('0x49')]=_['merge'](_0x520776[_0x518b('0x49')],{'$or':_[_0x518b('0x32')](_0x520776[_0x518b('0x43')],function(_0x3aeeda){var _0x1e41cf={};_0x1e41cf[_0x3aeeda]={'$like':'%'+_0x113ef4[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x1e41cf;})});}_0x520776=_[_0x518b('0x48')]({},_0x520776,_0x113ef4[_0x518b('0x4b')]);return _0x12f0fe[_0x518b('0x98')](_0x520776);}})[_0x518b('0x2a')](function(_0x22e2c2){if(_0x22e2c2){_0x2362c4=_0x22e2c2[_0x518b('0x45')];if(!_0x113ef4['query'][_0x518b('0x61')](_0x518b('0x46'))){_0x520776['limit']=qs[_0x518b('0x23')](_0x113ef4[_0x518b('0x3e')]['limit']);_0x520776['offset']=qs[_0x518b('0x21')](_0x113ef4[_0x518b('0x3e')][_0x518b('0x21')]);}return _0x12f0fe[_0x518b('0x98')](_0x520776);}})[_0x518b('0x2a')](function(_0x2fc575){return _0x2fc575?{'count':_0x2362c4,'rows':_0x2fc575}:null;})[_0x518b('0x2a')](respondWithResult(_0x27694c,null))[_0x518b('0x4f')](handleError(_0x27694c,null));};exports[_0x518b('0x99')]=function(_0x41cfd5,_0x15dd8b,_0x5a51a9){var _0xc72e1={};var _0xf1d26b={};var _0x273a0a;var _0x218122;return db[_0x518b('0x3b')][_0x518b('0x67')]({'where':{'id':_0x41cfd5[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x15dd8b,null))[_0x518b('0x2a')](function(_0xf8911c){if(_0xf8911c){_0x273a0a=_0xf8911c;_0xf1d26b[_0x518b('0x42')]=_['keys'](db[_0x518b('0x9a')][_0x518b('0x52')]);_0xf1d26b['query']=_['keys'](_0x41cfd5[_0x518b('0x3e')]);_0xf1d26b[_0x518b('0x40')]=_[_0x518b('0x41')](_0xf1d26b[_0x518b('0x42')],_0xf1d26b[_0x518b('0x3e')]);_0xc72e1['attributes']=_[_0x518b('0x41')](_0xf1d26b['model'],qs[_0x518b('0x44')](_0x41cfd5[_0x518b('0x3e')][_0x518b('0x44')]));_0xc72e1[_0x518b('0x43')]=_0xc72e1[_0x518b('0x43')][_0x518b('0x45')]?_0xc72e1[_0x518b('0x43')]:_0xf1d26b[_0x518b('0x42')];_0xc72e1[_0x518b('0x62')]=qs['sort'](_0x41cfd5[_0x518b('0x3e')][_0x518b('0x47')]);_0xc72e1[_0x518b('0x49')]=qs[_0x518b('0x40')](_[_0x518b('0x63')](_0x41cfd5[_0x518b('0x3e')],_0xf1d26b[_0x518b('0x40')]));if(_0x41cfd5[_0x518b('0x3e')][_0x518b('0x30')]){_0xc72e1['where']=_[_0x518b('0x48')](_0xc72e1[_0x518b('0x49')],{'$or':_['map'](_0xc72e1[_0x518b('0x43')],function(_0x10ea19){var _0x44941d={};_0x44941d[_0x10ea19]={'$like':'%'+_0x41cfd5[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x44941d;})});}_0xc72e1=_[_0x518b('0x48')]({},_0xc72e1,_0x41cfd5[_0x518b('0x4b')]);return _0x273a0a[_0x518b('0x99')](_0xc72e1);}})[_0x518b('0x2a')](function(_0x31a95e){if(_0x31a95e){_0x218122=_0x31a95e[_0x518b('0x45')];if(!_0x41cfd5[_0x518b('0x3e')]['hasOwnProperty']('nolimit')){_0xc72e1[_0x518b('0x23')]=qs[_0x518b('0x23')](_0x41cfd5[_0x518b('0x3e')][_0x518b('0x23')]);_0xc72e1[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x41cfd5['query']['offset']);}return _0x273a0a['getLists'](_0xc72e1);}})['then'](function(_0x390dfc){if(_0x390dfc){return _0x390dfc?{'count':_0x218122,'rows':_0x390dfc}:null;}})[_0x518b('0x2a')](respondWithResult(_0x15dd8b,null))[_0x518b('0x4f')](handleError(_0x15dd8b,null));};exports[_0x518b('0x9b')]=function(_0x547ca3,_0x2b7308,_0xbd3f52){var _0x203489,_0x425b0f;return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x547ca3[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x2b7308,null))['then'](function(_0x23bd4b){if(_0x23bd4b){_0x425b0f=_0x23bd4b;return _0x23bd4b[_0x518b('0x9b')](_0x547ca3[_0x518b('0x5d')][_0x518b('0x80')],_[_0x518b('0x5c')](_0x547ca3[_0x518b('0x5d')],['ids','id'])||{});}return null;})[_0x518b('0x93')](function(_0x3e1e53){var _0x1c3b3d;_0x203489=_0x3e1e53||[];var _0x320066=[];if(_0x3e1e53){for(var _0x283071=0x0;_0x283071<_0x3e1e53[_0x518b('0x45')];_0x283071+=0x1){var _0xee9e50=_0x3e1e53[_0x283071][_0x518b('0x5f')]({'plain':!![]});_0x425b0f[_0x518b('0x9c')]=_0x547ca3['body'][_0x518b('0x9c')]?_0x547ca3[_0x518b('0x5d')][_0x518b('0x9c')]:_0x425b0f[_0x518b('0x9c')];switch(_0x425b0f[_0x518b('0x9c')]){case _0x518b('0x9d'):_0x1c3b3d=squel[_0x518b('0x9e')]()[_0x518b('0x9f')]('cm_hopper')[_0x518b('0xa0')]([_0x518b('0xa1'),_0x518b('0xa2'),_0x518b('0xa3'),_0x518b('0xa4'),_0x518b('0x64'),'createdAt',_0x518b('0x5e')],squel[_0x518b('0xa5')]()[_0x518b('0x81')]('phone','phone')[_0x518b('0x81')](_0x518b('0xa6'),_0x518b('0xa2'))[_0x518b('0x81')]('id',_0x518b('0xa3'))['field'](_0xee9e50[_0x518b('0xa7')][_0x518b('0xa8')](),_0x518b('0xa4'))[_0x518b('0x81')](_0x547ca3[_0x518b('0x51')]['id'][_0x518b('0xa8')](),_0x518b('0x64'))[_0x518b('0x81')](_0x518b('0xa6'),_0x518b('0x5b'))[_0x518b('0x81')](_0x518b('0xa6'),'updatedAt')[_0x518b('0xa9')](_0x518b('0xaa'))[_0x518b('0x49')](_0x518b('0xab'))[_0x518b('0x49')]('ListId\x20=\x20?',_0xee9e50['CmListId']['toString']())[_0x518b('0x49')](_0x518b('0xac'))[_0x518b('0x49')](_0x518b('0xad'),squel[_0x518b('0xa5')]()[_0x518b('0x81')](_0x518b('0xae'))[_0x518b('0xa9')](_0x518b('0xaf'))[_0x518b('0x49')](_0x518b('0xb0'),_0x547ca3[_0x518b('0x51')]['id'][_0x518b('0xa8')]()))['where'](_0x518b('0xad'),squel[_0x518b('0xa5')]()[_0x518b('0x81')]('COALESCE(phone,\x27\x27)')[_0x518b('0xa9')](_0x518b('0xb1'))[_0x518b('0x49')]('VoiceQueueId\x20=\x20?',_0x547ca3[_0x518b('0x51')]['id'][_0x518b('0xa8')]())))['toString']();break;case'onlyIfOpen':_0x1c3b3d=squel[_0x518b('0x9e')]()[_0x518b('0x9f')](_0x518b('0xb1'))['fromQuery']([_0x518b('0xa1'),_0x518b('0xa2'),'ContactId',_0x518b('0xa4'),_0x518b('0x64'),'createdAt',_0x518b('0x5e')],squel[_0x518b('0xa5')]()[_0x518b('0x81')]('phone','phone')['field'](_0x518b('0xa6'),'scheduledAt')[_0x518b('0x81')]('id','ContactId')[_0x518b('0x81')](_0xee9e50[_0x518b('0xa7')]['toString'](),_0x518b('0xa4'))[_0x518b('0x81')](_0x547ca3[_0x518b('0x51')]['id'][_0x518b('0xa8')](),_0x518b('0x64'))[_0x518b('0x81')](_0x518b('0xa6'),_0x518b('0x5b'))[_0x518b('0x81')](_0x518b('0xa6'),_0x518b('0x5e'))[_0x518b('0xa9')](_0x518b('0xaa'))[_0x518b('0x49')]('deletedAt\x20IS\x20NULL')[_0x518b('0x49')]('ListId\x20=\x20?',_0xee9e50[_0x518b('0xa7')][_0x518b('0xa8')]())['where'](_0x518b('0xac'))[_0x518b('0x49')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x518b('0x81')](_0x518b('0xb2'))[_0x518b('0xa9')](_0x518b('0xb1'))[_0x518b('0x49')]('VoiceQueueId\x20=\x20?',_0x547ca3[_0x518b('0x51')]['id'][_0x518b('0xa8')]())))[_0x518b('0xa8')]();break;default:_0x1c3b3d=squel['insert']()['into'](_0x518b('0xb1'))[_0x518b('0xa0')]([_0x518b('0xa1'),_0x518b('0xa2'),_0x518b('0xa3'),_0x518b('0xa4'),_0x518b('0x64'),_0x518b('0x5b'),'updatedAt'],squel[_0x518b('0xa5')]()[_0x518b('0x81')](_0x518b('0xa1'),_0x518b('0xa1'))[_0x518b('0x81')](_0x518b('0xa6'),'scheduledAt')[_0x518b('0x81')]('id',_0x518b('0xa3'))[_0x518b('0x81')](_0xee9e50[_0x518b('0xa7')][_0x518b('0xa8')](),'ListId')[_0x518b('0x81')](_0x547ca3[_0x518b('0x51')]['id']['toString'](),_0x518b('0x64'))[_0x518b('0x81')](_0x518b('0xa6'),'createdAt')[_0x518b('0x81')](_0x518b('0xa6'),_0x518b('0x5e'))['from'](_0x518b('0xaa'))['where'](_0x518b('0xab'))[_0x518b('0x49')](_0x518b('0xb3'),_0xee9e50['CmListId'][_0x518b('0xa8')]())[_0x518b('0x49')](_0x518b('0xac')))[_0x518b('0xa8')]();}_0x320066['push'](db[_0x518b('0x87')][_0x518b('0x3e')](_0x1c3b3d));}return BPromise[_0x518b('0x96')](_0x320066);}})['then'](function(){return _0x203489;})[_0x518b('0x2a')](respondWithResult(_0x2b7308,null))[_0x518b('0x4f')](handleError(_0x2b7308,null));};exports['removeLists']=function(_0x2dbd63,_0x3e6c95,_0x4a8a37){return db['VoiceQueue'][_0x518b('0x36')]({'where':{'id':_0x2dbd63[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x3e6c95,null))['then'](function(_0x2fbd12){if(_0x2fbd12){return _0x2fbd12[_0x518b('0xb4')](_0x2dbd63[_0x518b('0x3e')][_0x518b('0x80')]);}})[_0x518b('0x2a')](function(_0x4ca78e){if(_0x4ca78e){return db[_0x518b('0x60')][_0x518b('0x2b')]({'where':{'ListId':_0x2dbd63[_0x518b('0x3e')][_0x518b('0x80')],'VoiceQueueId':_0x2dbd63[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](function(){return _0x4ca78e;});}})['then'](respondWithStatusCode(_0x3e6c95,null))[_0x518b('0x4f')](handleError(_0x3e6c95,null));};exports['getBlackLists']=function(_0x4e7bfc,_0x12bbb7,_0x83326a){var _0x40d184={};var _0x7cbd50={};var _0x81fa15;var _0x551daf;return db[_0x518b('0x3b')]['findOne']({'where':{'id':_0x4e7bfc[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x12bbb7,null))[_0x518b('0x2a')](function(_0xe0227d){if(_0xe0227d){_0x81fa15=_0xe0227d;_0x7cbd50[_0x518b('0x42')]=_[_0x518b('0x3f')](db[_0x518b('0x9a')][_0x518b('0x52')]);_0x7cbd50[_0x518b('0x3e')]=_['keys'](_0x4e7bfc[_0x518b('0x3e')]);_0x7cbd50['filters']=_['intersection'](_0x7cbd50[_0x518b('0x42')],_0x7cbd50[_0x518b('0x3e')]);_0x40d184[_0x518b('0x43')]=_[_0x518b('0x41')](_0x7cbd50['model'],qs['fields'](_0x4e7bfc[_0x518b('0x3e')][_0x518b('0x44')]));_0x40d184[_0x518b('0x43')]=_0x40d184[_0x518b('0x43')][_0x518b('0x45')]?_0x40d184[_0x518b('0x43')]:_0x7cbd50['model'];_0x40d184[_0x518b('0x62')]=qs[_0x518b('0x47')](_0x4e7bfc[_0x518b('0x3e')]['sort']);_0x40d184['where']=qs[_0x518b('0x40')](_['pick'](_0x4e7bfc[_0x518b('0x3e')],_0x7cbd50[_0x518b('0x40')]));if(_0x4e7bfc['query'][_0x518b('0x30')]){_0x40d184['where']=_['merge'](_0x40d184[_0x518b('0x49')],{'$or':_['map'](_0x40d184['attributes'],function(_0xfdc486){var _0x407835={};_0x407835[_0xfdc486]={'$like':'%'+_0x4e7bfc[_0x518b('0x3e')][_0x518b('0x30')]+'%'};return _0x407835;})});}_0x40d184=_[_0x518b('0x48')]({},_0x40d184,_0x4e7bfc['options']);return _0x81fa15[_0x518b('0xb5')](_0x40d184);}})[_0x518b('0x2a')](function(_0xe4a821){if(_0xe4a821){_0x551daf=_0xe4a821['length'];if(!_0x4e7bfc[_0x518b('0x3e')][_0x518b('0x61')](_0x518b('0x46'))){_0x40d184['limit']=qs['limit'](_0x4e7bfc[_0x518b('0x3e')][_0x518b('0x23')]);_0x40d184[_0x518b('0x21')]=qs[_0x518b('0x21')](_0x4e7bfc[_0x518b('0x3e')][_0x518b('0x21')]);}return _0x81fa15[_0x518b('0xb5')](_0x40d184);}})[_0x518b('0x2a')](function(_0x2b2313){if(_0x2b2313){return _0x2b2313?{'count':_0x551daf,'rows':_0x2b2313}:null;}})[_0x518b('0x2a')](respondWithResult(_0x12bbb7,null))[_0x518b('0x4f')](handleError(_0x12bbb7,null));};exports[_0x518b('0xb6')]=function(_0x509e0b,_0x4ba9bc,_0x3ef7e6){var _0x51317e,_0x2dd717;return db[_0x518b('0x3b')][_0x518b('0x36')]({'where':{'id':_0x509e0b[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x4ba9bc,null))['then'](function(_0x50a474){if(_0x50a474){_0x2dd717=_0x50a474;return _0x50a474['addBlackLists'](_0x509e0b['body'][_0x518b('0x80')],_['omit'](_0x509e0b['body'],[_0x518b('0x80'),'id'])||{});}return null;})[_0x518b('0x93')](function(_0x31e97c){var _0x2c878e;_0x51317e=_0x31e97c||[];var _0x3a1b37=[];if(_0x31e97c){for(var _0x45cc91=0x0;_0x45cc91<_0x31e97c['length'];_0x45cc91+=0x1){var _0x4d342c=_0x31e97c[_0x45cc91][_0x518b('0x5f')]({'plain':!![]});_0x2c878e=squel[_0x518b('0x9e')]()[_0x518b('0x9f')](_0x518b('0xb7'))[_0x518b('0xa0')]([_0x518b('0xa1'),_0x518b('0xa3'),_0x518b('0xa4'),_0x518b('0x64'),_0x518b('0x5b'),'updatedAt'],squel['select']()[_0x518b('0x81')](_0x518b('0xa1'),'phone')['field']('id',_0x518b('0xa3'))['field'](_0x4d342c[_0x518b('0xa7')][_0x518b('0xa8')](),_0x518b('0xa4'))[_0x518b('0x81')](_0x509e0b[_0x518b('0x51')]['id']['toString'](),_0x518b('0x64'))['field'](_0x518b('0xa6'),_0x518b('0x5b'))['field'](_0x518b('0xa6'),_0x518b('0x5e'))['from']('cm_contacts')[_0x518b('0x49')]('deletedAt\x20IS\x20NULL')[_0x518b('0x49')](_0x518b('0xb3'),_0x4d342c[_0x518b('0xa7')]['toString']())[_0x518b('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x518b('0xa8')]();_0x3a1b37[_0x518b('0x86')](db[_0x518b('0x87')][_0x518b('0x3e')](_0x2c878e));}return BPromise['all'](_0x3a1b37);}})['then'](function(){return _0x51317e;})[_0x518b('0x2a')](respondWithResult(_0x4ba9bc,null))[_0x518b('0x4f')](handleError(_0x4ba9bc,null));};exports[_0x518b('0xb8')]=function(_0x5cf563,_0x50f888,_0x34325b){return db['VoiceQueue']['find']({'where':{'id':_0x5cf563['params']['id']}})[_0x518b('0x2a')](handleEntityNotFound(_0x50f888,null))[_0x518b('0x2a')](function(_0x1f6f14){if(_0x1f6f14){return _0x1f6f14[_0x518b('0xb8')](_0x5cf563[_0x518b('0x3e')][_0x518b('0x80')]);}})[_0x518b('0x2a')](function(_0x81a585){if(_0x81a585){return db[_0x518b('0x6b')]['destroy']({'where':{'ListId':_0x5cf563[_0x518b('0x3e')][_0x518b('0x80')],'VoiceQueueId':_0x5cf563[_0x518b('0x51')]['id']}})[_0x518b('0x2a')](function(){return _0x81a585;});}})[_0x518b('0x2a')](respondWithStatusCode(_0x50f888,null))[_0x518b('0x4f')](handleError(_0x50f888,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 7b17857..6086947 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 _0x1876=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x5bcca2,_0x5d6105){var _0x1cfaf6=function(_0x97e5ae){while(--_0x97e5ae){_0x5bcca2['push'](_0x5bcca2['shift']());}};_0x1cfaf6(++_0x5d6105);}(_0x1876,0xfd));var _0x6187=function(_0x629af8,_0x15fd89){_0x629af8=_0x629af8-0x0;var _0x3f582d=_0x1876[_0x629af8];return _0x3f582d;};'use strict';var EventEmitter=require(_0x6187('0x0'));var VoiceQueue=require(_0x6187('0x1'))['db'][_0x6187('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6187('0x3')](0x0);var events={'afterCreate':_0x6187('0x4'),'afterUpdate':_0x6187('0x5'),'afterDestroy':_0x6187('0x6')};function emitEvent(_0x53714c){return function(_0x32ccd1,_0x1e667c,_0xfff090){VoiceQueueEvents['emit'](_0x53714c+':'+_0x32ccd1['id'],_0x32ccd1);VoiceQueueEvents[_0x6187('0x7')](_0x53714c,_0x32ccd1);_0xfff090(null);};}for(var e in events){if(events[_0x6187('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x6187('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x8e5d=['remove','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','update'];(function(_0x4345c0,_0x4e234a){var _0x108486=function(_0x3a10cd){while(--_0x3a10cd){_0x4345c0['push'](_0x4345c0['shift']());}};_0x108486(++_0x4e234a);}(_0x8e5d,0xdd));var _0xd8e5=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x8e5d[_0x4d82ea];return _0x257f4a;};'use strict';var EventEmitter=require(_0xd8e5('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xd8e5('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd8e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd8e5('0x3'),'afterDestroy':_0xd8e5('0x4')};function emitEvent(_0x2bb67c){return function(_0x3e74ae,_0x29e101,_0x120de7){VoiceQueueEvents['emit'](_0x2bb67c+':'+_0x3e74ae['id'],_0x3e74ae);VoiceQueueEvents[_0xd8e5('0x5')](_0x2bb67c,_0x3e74ae);_0x120de7(null);};}for(var e in events){if(events[_0xd8e5('0x6')](e)){var event=events[e];VoiceQueue[_0xd8e5('0x7')](e,emitEvent(event));}}module[_0xd8e5('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d30b1ec..afa5d62 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x32a85d,_0x2e16a7){var _0x615b5e=function(_0x42c571){while(--_0x42c571){_0x32a85d['push'](_0x32a85d['shift']());}};_0x615b5e(++_0x2e16a7);}(_0x70e0,0x17b));var _0x070e=function(_0x4b6cf5,_0x4c9843){_0x4b6cf5=_0x4b6cf5-0x0;var _0x501a5f=_0x70e0[_0x4b6cf5];return _0x501a5f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x55ca,0x126));var _0xa55c=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0x55ca[_0x5e8282];return _0x5cd37d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 345e142..3f426dd 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 _0x0346=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','include','map','model','attributes','ShowVoiceQueue','find','where'];(function(_0x1bccaa,_0x24af4b){var _0x40de94=function(_0xaf0628){while(--_0xaf0628){_0x1bccaa['push'](_0x1bccaa['shift']());}};_0x40de94(++_0x24af4b);}(_0x0346,0x17a));var _0x6034=function(_0x23fe6c,_0x4a8743){_0x23fe6c=_0x23fe6c-0x0;var _0x5d11b7=_0x0346[_0x23fe6c];return _0x5d11b7;};'use strict';var _=require(_0x6034('0x0'));var util=require(_0x6034('0x1'));var moment=require(_0x6034('0x2'));var BPromise=require(_0x6034('0x3'));var rs=require(_0x6034('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6034('0x5'))['db'];var utils=require(_0x6034('0x6'));var logger=require(_0x6034('0x7'))(_0x6034('0x8'));var config=require(_0x6034('0x9'));var jayson=require(_0x6034('0xa'));var client=jayson['client'][_0x6034('0xb')]({'port':0x232a});config[_0x6034('0xc')]=_[_0x6034('0xd')](config[_0x6034('0xc')],{'host':_0x6034('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6034('0xf'))[_0x6034('0x10')](socket);function respondWithRpcPromise(_0x133c9a,_0x4feec4,_0x383a7a){return new BPromise(function(_0x27450b,_0x2ba5a8){return client[_0x6034('0x11')](_0x133c9a,_0x383a7a)[_0x6034('0x12')](function(_0xd4b6ed){logger['info'](_0x6034('0x13'),_0x4feec4,'request\x20sent');logger[_0x6034('0x14')](_0x6034('0x15'),_0x4feec4,_0x6034('0x16'),JSON[_0x6034('0x17')](_0xd4b6ed));if(_0xd4b6ed[_0x6034('0x18')]){if(_0xd4b6ed[_0x6034('0x18')][_0x6034('0x19')]===0x1f4){logger[_0x6034('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x4feec4,_0xd4b6ed[_0x6034('0x18')][_0x6034('0x1a')]);return _0x2ba5a8(_0xd4b6ed[_0x6034('0x18')][_0x6034('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4feec4,_0xd4b6ed[_0x6034('0x18')]['message']);return _0x27450b(_0xd4b6ed[_0x6034('0x18')][_0x6034('0x1a')]);}else{logger[_0x6034('0x1b')](_0x6034('0x13'),_0x4feec4,'request\x20sent');_0x27450b(_0xd4b6ed[_0x6034('0x1c')][_0x6034('0x1a')]);}})[_0x6034('0x1d')](function(_0x3e7833){logger[_0x6034('0x18')](_0x6034('0x13'),_0x4feec4,_0x3e7833);_0x2ba5a8(_0x3e7833);});});}exports[_0x6034('0x1e')]=function(_0x358937){var _0x4f95e2=this;return new Promise(function(_0x3c2165,_0x5c5aae){return db[_0x6034('0x1f')][_0x6034('0x20')]({'raw':_0x358937[_0x6034('0x21')]?_0x358937[_0x6034('0x21')][_0x6034('0x22')]===undefined?!![]:![]:!![],'where':_0x358937[_0x6034('0x21')]?_0x358937[_0x6034('0x21')]['where']||null:null,'attributes':_0x358937[_0x6034('0x21')]?_0x358937[_0x6034('0x21')]['attributes']||null:null,'limit':_0x358937[_0x6034('0x21')]?_0x358937[_0x6034('0x21')]['limit']||null:null,'include':_0x358937[_0x6034('0x21')]?_0x358937[_0x6034('0x21')][_0x6034('0x23')]?_[_0x6034('0x24')](_0x358937[_0x6034('0x21')][_0x6034('0x23')],function(_0x25b5e5){return{'model':db[_0x25b5e5[_0x6034('0x25')]],'as':_0x25b5e5['as'],'attributes':_0x25b5e5[_0x6034('0x26')],'include':_0x25b5e5['include']?_['map'](_0x25b5e5[_0x6034('0x23')],function(_0x150b9d){return{'model':db[_0x150b9d[_0x6034('0x25')]],'as':_0x150b9d['as'],'attributes':_0x150b9d['attributes'],'include':_0x150b9d[_0x6034('0x23')]?_[_0x6034('0x24')](_0x150b9d[_0x6034('0x23')],function(_0x2321cd){return{'model':db[_0x2321cd[_0x6034('0x25')]],'as':_0x2321cd['as'],'attributes':_0x2321cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x6034('0x12')](function(_0x135d26){logger['info'](_0x6034('0x1e'),_0x358937);logger[_0x6034('0x14')](_0x6034('0x1e'),_0x358937,JSON[_0x6034('0x17')](_0x135d26));_0x3c2165(_0x135d26);})[_0x6034('0x1d')](function(_0x2f557e){logger[_0x6034('0x18')](_0x6034('0x1e'),_0x2f557e[_0x6034('0x1a')],_0x358937);_0x5c5aae(_0x4f95e2[_0x6034('0x18')](0x1f4,_0x2f557e['message']));});});};exports[_0x6034('0x27')]=function(_0x227301){var _0x79f329=this;return new Promise(function(_0x23d9fc,_0x42cb0e){return db[_0x6034('0x1f')][_0x6034('0x28')]({'raw':_0x227301[_0x6034('0x21')]?_0x227301[_0x6034('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x227301[_0x6034('0x21')]?_0x227301[_0x6034('0x21')][_0x6034('0x29')]||null:null,'attributes':_0x227301[_0x6034('0x21')]?_0x227301[_0x6034('0x21')][_0x6034('0x26')]||null:null,'include':_0x227301[_0x6034('0x21')]?_0x227301[_0x6034('0x21')][_0x6034('0x23')]?_['map'](_0x227301[_0x6034('0x21')][_0x6034('0x23')],function(_0x2f8b25){return{'model':db[_0x2f8b25[_0x6034('0x25')]],'as':_0x2f8b25['as'],'attributes':_0x2f8b25[_0x6034('0x26')],'include':_0x2f8b25['include']?_[_0x6034('0x24')](_0x2f8b25[_0x6034('0x23')],function(_0xc01ae4){return{'model':db[_0xc01ae4[_0x6034('0x25')]],'as':_0xc01ae4['as'],'attributes':_0xc01ae4['attributes'],'include':_0xc01ae4[_0x6034('0x23')]?_[_0x6034('0x24')](_0xc01ae4[_0x6034('0x23')],function(_0x3c5a9c){return{'model':db[_0x3c5a9c[_0x6034('0x25')]],'as':_0x3c5a9c['as'],'attributes':_0x3c5a9c[_0x6034('0x26')]};}):[]};}):[]};}):[]:[]})[_0x6034('0x12')](function(_0x432467){logger['info']('ShowVoiceQueue',_0x227301);logger['debug'](_0x6034('0x27'),_0x227301,JSON[_0x6034('0x17')](_0x432467));_0x23d9fc(_0x432467);})[_0x6034('0x1d')](function(_0x254400){logger[_0x6034('0x18')](_0x6034('0x27'),_0x254400[_0x6034('0x1a')],_0x227301);_0x42cb0e(_0x79f329[_0x6034('0x18')](0x1f4,_0x254400[_0x6034('0x1a')]));});});}; \ No newline at end of file +var _0x45a4=['VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','ShowVoiceQueue','find','raw','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x367aac,_0x19455c){var _0x537128=function(_0x422b12){while(--_0x422b12){_0x367aac['push'](_0x367aac['shift']());}};_0x537128(++_0x19455c);}(_0x45a4,0xe5));var _0x445a=function(_0x240d59,_0x430854){_0x240d59=_0x240d59-0x0;var _0x6b4f55=_0x45a4[_0x240d59];return _0x6b4f55;};'use strict';var _=require(_0x445a('0x0'));var util=require(_0x445a('0x1'));var moment=require(_0x445a('0x2'));var BPromise=require(_0x445a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x445a('0x4'))['db'];var utils=require(_0x445a('0x5'));var logger=require(_0x445a('0x6'))(_0x445a('0x7'));var config=require(_0x445a('0x8'));var jayson=require(_0x445a('0x9'));var client=jayson[_0x445a('0xa')][_0x445a('0xb')]({'port':0x232a});config[_0x445a('0xc')]=_[_0x445a('0xd')](config[_0x445a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x445a('0xe'))(new Redis(config[_0x445a('0xc')]));require(_0x445a('0xf'))[_0x445a('0x10')](socket);function respondWithRpcPromise(_0x3ffbed,_0x586709,_0x12380e){return new BPromise(function(_0x101bc3,_0x4b8a08){return client[_0x445a('0x11')](_0x3ffbed,_0x12380e)[_0x445a('0x12')](function(_0x9e0619){logger[_0x445a('0x13')](_0x445a('0x14'),_0x586709,_0x445a('0x15'));logger[_0x445a('0x16')](_0x445a('0x17'),_0x586709,_0x445a('0x15'),JSON['stringify'](_0x9e0619));if(_0x9e0619[_0x445a('0x18')]){if(_0x9e0619[_0x445a('0x18')][_0x445a('0x19')]===0x1f4){logger[_0x445a('0x18')](_0x445a('0x14'),_0x586709,_0x9e0619[_0x445a('0x18')][_0x445a('0x1a')]);return _0x4b8a08(_0x9e0619[_0x445a('0x18')][_0x445a('0x1a')]);}logger[_0x445a('0x18')](_0x445a('0x14'),_0x586709,_0x9e0619[_0x445a('0x18')]['message']);return _0x101bc3(_0x9e0619['error']['message']);}else{logger[_0x445a('0x13')](_0x445a('0x14'),_0x586709,_0x445a('0x15'));_0x101bc3(_0x9e0619['result'][_0x445a('0x1a')]);}})[_0x445a('0x1b')](function(_0x432a98){logger['error'](_0x445a('0x14'),_0x586709,_0x432a98);_0x4b8a08(_0x432a98);});});}exports[_0x445a('0x1c')]=function(_0x84c8d0){var _0x32a9d6=this;return new Promise(function(_0x343b86,_0x231980){return db[_0x445a('0x1d')][_0x445a('0x1e')]({'raw':_0x84c8d0['options']?_0x84c8d0[_0x445a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x84c8d0['options']?_0x84c8d0[_0x445a('0x1f')][_0x445a('0x20')]||null:null,'attributes':_0x84c8d0[_0x445a('0x1f')]?_0x84c8d0[_0x445a('0x1f')][_0x445a('0x21')]||null:null,'limit':_0x84c8d0[_0x445a('0x1f')]?_0x84c8d0[_0x445a('0x1f')][_0x445a('0x22')]||null:null,'include':_0x84c8d0['options']?_0x84c8d0[_0x445a('0x1f')][_0x445a('0x23')]?_[_0x445a('0x24')](_0x84c8d0[_0x445a('0x1f')][_0x445a('0x23')],function(_0x3ac3a0){return{'model':db[_0x3ac3a0[_0x445a('0x25')]],'as':_0x3ac3a0['as'],'attributes':_0x3ac3a0['attributes'],'include':_0x3ac3a0[_0x445a('0x23')]?_[_0x445a('0x24')](_0x3ac3a0[_0x445a('0x23')],function(_0x413dc5){return{'model':db[_0x413dc5[_0x445a('0x25')]],'as':_0x413dc5['as'],'attributes':_0x413dc5['attributes'],'include':_0x413dc5['include']?_[_0x445a('0x24')](_0x413dc5[_0x445a('0x23')],function(_0x4742d5){return{'model':db[_0x4742d5[_0x445a('0x25')]],'as':_0x4742d5['as'],'attributes':_0x4742d5[_0x445a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x445a('0x12')](function(_0x532322){logger['info']('GetVoiceQueue',_0x84c8d0);logger[_0x445a('0x16')]('GetVoiceQueue',_0x84c8d0,JSON['stringify'](_0x532322));_0x343b86(_0x532322);})[_0x445a('0x1b')](function(_0x3d87b2){logger[_0x445a('0x18')](_0x445a('0x1c'),_0x3d87b2[_0x445a('0x1a')],_0x84c8d0);_0x231980(_0x32a9d6[_0x445a('0x18')](0x1f4,_0x3d87b2['message']));});});};exports[_0x445a('0x26')]=function(_0x379744){var _0x2ddbea=this;return new Promise(function(_0x4902f0,_0x9c8ca1){return db['VoiceQueue'][_0x445a('0x27')]({'raw':_0x379744[_0x445a('0x1f')]?_0x379744['options'][_0x445a('0x28')]===undefined?!![]:![]:!![],'where':_0x379744['options']?_0x379744[_0x445a('0x1f')][_0x445a('0x20')]||null:null,'attributes':_0x379744['options']?_0x379744[_0x445a('0x1f')][_0x445a('0x21')]||null:null,'include':_0x379744[_0x445a('0x1f')]?_0x379744[_0x445a('0x1f')][_0x445a('0x23')]?_[_0x445a('0x24')](_0x379744[_0x445a('0x1f')][_0x445a('0x23')],function(_0x14d47c){return{'model':db[_0x14d47c[_0x445a('0x25')]],'as':_0x14d47c['as'],'attributes':_0x14d47c[_0x445a('0x21')],'include':_0x14d47c[_0x445a('0x23')]?_['map'](_0x14d47c[_0x445a('0x23')],function(_0x94a05b){return{'model':db[_0x94a05b['model']],'as':_0x94a05b['as'],'attributes':_0x94a05b['attributes'],'include':_0x94a05b['include']?_[_0x445a('0x24')](_0x94a05b[_0x445a('0x23')],function(_0x5abfdf){return{'model':db[_0x5abfdf[_0x445a('0x25')]],'as':_0x5abfdf['as'],'attributes':_0x5abfdf[_0x445a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e7a40){logger['info']('ShowVoiceQueue',_0x379744);logger[_0x445a('0x16')](_0x445a('0x26'),_0x379744,JSON[_0x445a('0x29')](_0x3e7a40));_0x4902f0(_0x3e7a40);})[_0x445a('0x1b')](function(_0x35088d){logger['error']('ShowVoiceQueue',_0x35088d['message'],_0x379744);_0x9c8ca1(_0x2ddbea['error'](0x1f4,_0x35088d[_0x445a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ff62eec..49bd4c9 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 _0x381b=['removeListener','register','length','voiceQueue:','save','update','emit'];(function(_0xf11478,_0x29fee9){var _0x1ead53=function(_0x2f838c){while(--_0x2f838c){_0xf11478['push'](_0xf11478['shift']());}};_0x1ead53(++_0x29fee9);}(_0x381b,0x1d9));var _0xb381=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x381b[_0x32729c];return _0x482cfd;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb381('0x0'),'remove',_0xb381('0x1')];function createListener(_0x310fa9,_0x1d99a7){return function(_0x15a3f0){_0x1d99a7[_0xb381('0x2')](_0x310fa9,_0x15a3f0);};}function removeListener(_0x1f5087,_0x438400){return function(){VoiceQueueEvents[_0xb381('0x3')](_0x1f5087,_0x438400);};}exports[_0xb381('0x4')]=function(_0x2bae0a){for(var _0x4afae3=0x0,_0x23a5e0=events[_0xb381('0x5')];_0x4afae3<_0x23a5e0;_0x4afae3++){var _0x56c9a7=events[_0x4afae3];var _0x4200f4=createListener(_0xb381('0x6')+_0x56c9a7,_0x2bae0a);VoiceQueueEvents['on'](_0x56c9a7,_0x4200f4);}}; \ No newline at end of file +var _0x1745=['./voiceQueue.events','save','update','emit','register','length','voiceQueue:'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x1745,0x1dc));var _0x5174=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1745[_0x5ddb1c];return _0x354adc;};'use strict';var VoiceQueueEvents=require(_0x5174('0x0'));var events=[_0x5174('0x1'),'remove',_0x5174('0x2')];function createListener(_0xf9fd47,_0x1a3cac){return function(_0x314e77){_0x1a3cac[_0x5174('0x3')](_0xf9fd47,_0x314e77);};}function removeListener(_0x1175b0,_0xebe669){return function(){VoiceQueueEvents['removeListener'](_0x1175b0,_0xebe669);};}exports[_0x5174('0x4')]=function(_0x291de3){for(var _0x4f6b8a=0x0,_0xf81e6f=events[_0x5174('0x5')];_0x4f6b8a<_0xf81e6f;_0x4f6b8a++){var _0x51d8c0=events[_0x4f6b8a];var _0x2d48e9=createListener(_0x5174('0x6')+_0x51d8c0,_0x291de3);VoiceQueueEvents['on'](_0x51d8c0,_0x2d48e9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c1c8b4f..6806e09 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 _0x1dd4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','put','update','delete','destroy','exports','multer','util','express'];(function(_0x2b7237,_0x1ced84){var _0x3e57e9=function(_0x3a7445){while(--_0x3a7445){_0x2b7237['push'](_0x2b7237['shift']());}};_0x3e57e9(++_0x1ced84);}(_0x1dd4,0x6b));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x41dd('0x0'));var util=require(_0x41dd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x41dd('0x2'));var router=express['Router']();var fs_extra=require(_0x41dd('0x3'));var auth=require(_0x41dd('0x4'));var interaction=require(_0x41dd('0x5'));var config=require(_0x41dd('0x6'));var controller=require(_0x41dd('0x7'));router[_0x41dd('0x8')]('/',auth[_0x41dd('0x9')](),controller[_0x41dd('0xa')]);router[_0x41dd('0x8')](_0x41dd('0xb'),auth[_0x41dd('0x9')](),controller[_0x41dd('0xc')]);router[_0x41dd('0x8')](_0x41dd('0xd'),auth[_0x41dd('0x9')](),controller[_0x41dd('0xe')]);router['get'](_0x41dd('0xf'),auth[_0x41dd('0x9')](),controller['show']);router[_0x41dd('0x10')]('/',auth[_0x41dd('0x9')](),controller['create']);router[_0x41dd('0x11')](_0x41dd('0xf'),auth[_0x41dd('0x9')](),controller[_0x41dd('0x12')]);router[_0x41dd('0x13')](_0x41dd('0xf'),auth['isAuthenticated'](),controller[_0x41dd('0x14')]);module[_0x41dd('0x15')]=router; \ No newline at end of file +var _0xd618=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','/:id','show','post','create','put','update'];(function(_0x4d71c8,_0x24e7e7){var _0xee7882=function(_0x347f0e){while(--_0x347f0e){_0x4d71c8['push'](_0x4d71c8['shift']());}};_0xee7882(++_0x24e7e7);}(_0xd618,0xba));var _0x8d61=function(_0x378795,_0x24a54d){_0x378795=_0x378795-0x0;var _0xc5d361=_0xd618[_0x378795];return _0xc5d361;};'use strict';var multer=require(_0x8d61('0x0'));var util=require(_0x8d61('0x1'));var path=require(_0x8d61('0x2'));var timeout=require(_0x8d61('0x3'));var express=require(_0x8d61('0x4'));var router=express[_0x8d61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8d61('0x6'));var interaction=require(_0x8d61('0x7'));var config=require(_0x8d61('0x8'));var controller=require(_0x8d61('0x9'));router[_0x8d61('0xa')]('/',auth[_0x8d61('0xb')](),controller['index']);router[_0x8d61('0xa')](_0x8d61('0xc'),auth[_0x8d61('0xb')](),controller[_0x8d61('0xd')]);router[_0x8d61('0xa')]('/index',auth[_0x8d61('0xb')](),controller[_0x8d61('0xe')]);router[_0x8d61('0xa')](_0x8d61('0xf'),auth[_0x8d61('0xb')](),controller[_0x8d61('0x10')]);router[_0x8d61('0x11')]('/',auth['isAuthenticated'](),controller[_0x8d61('0x12')]);router[_0x8d61('0x13')](_0x8d61('0xf'),auth['isAuthenticated'](),controller[_0x8d61('0x14')]);router[_0x8d61('0x15')]('/:id',auth[_0x8d61('0xb')](),controller[_0x8d61('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index f9b21d3..6fa4b51 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 _0xe726=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x48ccaa,_0x118a60){var _0x3c11ab=function(_0x4cfdee){while(--_0x4cfdee){_0x48ccaa['push'](_0x48ccaa['shift']());}};_0x3c11ab(++_0x118a60);}(_0xe726,0x192));var _0x6e72=function(_0xcb33a6,_0x1741fe){_0xcb33a6=_0xcb33a6-0x0;var _0xff7353=_0xe726[_0xcb33a6];return _0xff7353;};'use strict';var Sequelize=require(_0x6e72('0x0'));var moment=require(_0x6e72('0x1'));module[_0x6e72('0x2')]={'type':{'type':Sequelize[_0x6e72('0x3')]},'uniqueid':{'type':Sequelize[_0x6e72('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6e72('0x3')]},'queue':{'type':Sequelize[_0x6e72('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x6e72('0x4')],'set':function(_0x5331e1){var _0x7bc9c6=moment(_0x5331e1);var _0x320077=moment(this['getDataValue'](_0x6e72('0x5')))[_0x6e72('0x6')](_0x6e72('0x7'));var _0x2efca7=_0x7bc9c6[_0x6e72('0x8')](_0x320077,_0x6e72('0x9'));this['setDataValue'](_0x6e72('0xa'),_0x5331e1);this['setDataValue'](_0x6e72('0xb'),_0x2efca7||null);}},'position':{'type':Sequelize[_0x6e72('0xc')]},'count':{'type':Sequelize[_0x6e72('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6e72('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x6e72('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6e72('0x4')]},'queuecallerexit':{'type':Sequelize[_0x6e72('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6e72('0x3')],'comment':_0x6e72('0xe')},'originalposition':{'type':Sequelize[_0x6e72('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6e72('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6e72('0x3')]},'context':{'type':Sequelize[_0x6e72('0x3')]},'exten':{'type':Sequelize[_0x6e72('0x3')]},'priority':{'type':Sequelize[_0x6e72('0x3')]},'holdtime':{'type':Sequelize[_0x6e72('0xc')]},'mohtime':{'type':Sequelize[_0x6e72('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6e72('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6e72('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6e72('0x3')],'comment':_0x6e72('0xf')},'transferexten':{'type':Sequelize[_0x6e72('0x3')]},'transferuniqueid':{'type':Sequelize[_0x6e72('0x3')]},'disposition':{'type':Sequelize[_0x6e72('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6e72('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4a3=['STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4a3,0xfa));var _0x3c4a=function(_0x5ac70e,_0x227aea){_0x5ac70e=_0x5ac70e-0x0;var _0x4fa0d3=_0xc4a3[_0x5ac70e];return _0x4fa0d3;};'use strict';var Sequelize=require(_0x3c4a('0x0'));var moment=require(_0x3c4a('0x1'));module['exports']={'type':{'type':Sequelize[_0x3c4a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3c4a('0x2')]},'calleridname':{'type':Sequelize[_0x3c4a('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x3c4a('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3c4a('0x3')],'set':function(_0x4cb8d1){var _0x3f2dfa=moment(_0x4cb8d1);var _0x2c3d44=moment(this[_0x3c4a('0x4')](_0x3c4a('0x5')))['format'](_0x3c4a('0x6'));var _0x481746=_0x3f2dfa[_0x3c4a('0x7')](_0x2c3d44,_0x3c4a('0x8'));this[_0x3c4a('0x9')]('queuecallerleaveAt',_0x4cb8d1);this[_0x3c4a('0x9')]('holdtime',_0x481746||null);}},'position':{'type':Sequelize[_0x3c4a('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x3c4a('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3c4a('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3c4a('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3c4a('0x2')],'comment':_0x3c4a('0xc')},'originalposition':{'type':Sequelize[_0x3c4a('0xa')]},'channel':{'type':Sequelize[_0x3c4a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3c4a('0x2')]},'connectedlinename':{'type':Sequelize[_0x3c4a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3c4a('0x2')]},'exten':{'type':Sequelize[_0x3c4a('0x2')]},'priority':{'type':Sequelize[_0x3c4a('0x2')]},'holdtime':{'type':Sequelize[_0x3c4a('0xa')]},'mohtime':{'type':Sequelize[_0x3c4a('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3c4a('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3c4a('0x2')]},'transfer':{'type':Sequelize[_0x3c4a('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3c4a('0x2')],'comment':_0x3c4a('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3c4a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3c4a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3c4a('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index ae43595..a44fae2 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 _0x72f7=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','destroy','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2ff467,_0x3f407c){var _0x28b7f4=function(_0x4c9ea0){while(--_0x4c9ea0){_0x2ff467['push'](_0x2ff467['shift']());}};_0x28b7f4(++_0x3f407c);}(_0x72f7,0xa7));var _0x772f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72f7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x772f('0x0'));var rimraf=require(_0x772f('0x1'));var zipdir=require(_0x772f('0x2'));var jsonpatch=require(_0x772f('0x3'));var rp=require(_0x772f('0x4'));var moment=require(_0x772f('0x5'));var BPromise=require(_0x772f('0x6'));var Mustache=require(_0x772f('0x7'));var util=require(_0x772f('0x8'));var path=require(_0x772f('0x9'));var sox=require(_0x772f('0xa'));var csv=require(_0x772f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x772f('0xc'));var _=require(_0x772f('0xd'));var squel=require(_0x772f('0xe'));var crypto=require(_0x772f('0xf'));var jsforce=require(_0x772f('0x10'));var deskjs=require(_0x772f('0x11'));var toCsv=require('to-csv');var querystring=require(_0x772f('0x12'));var Papa=require(_0x772f('0x13'));var Redis=require('ioredis');var authService=require(_0x772f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x772f('0x15'));var hardwareService=require(_0x772f('0x16'));var logger=require(_0x772f('0x17'))(_0x772f('0x18'));var utils=require(_0x772f('0x19'));var config=require(_0x772f('0x1a'));var licenseUtil=require(_0x772f('0x1b'));var db=require('../../mysqldb')['db'];config[_0x772f('0x1c')]=_[_0x772f('0x1d')](config[_0x772f('0x1c')],{'host':_0x772f('0x1e'),'port':0x18eb});var socket=require(_0x772f('0x1f'))(new Redis(config[_0x772f('0x1c')]));require(_0x772f('0x20'))[_0x772f('0x21')](socket);function respondWithStatusCode(_0x2efb56,_0x158f88){_0x158f88=_0x158f88||0xcc;return function(_0x34c92e){if(_0x34c92e){return _0x2efb56[_0x772f('0x22')](_0x158f88);}return _0x2efb56[_0x772f('0x23')](_0x158f88)[_0x772f('0x24')]();};}function respondWithResult(_0x125f57,_0x228732){_0x228732=_0x228732||0xc8;return function(_0x483bfb){if(_0x483bfb){return _0x125f57['status'](_0x228732)['json'](_0x483bfb);}};}function respondWithFilteredResult(_0x5c81c3,_0x34b9fe){return function(_0x10ce36){if(_0x10ce36){var _0x2ba5f5=typeof _0x34b9fe[_0x772f('0x25')]===_0x772f('0x26')&&typeof _0x34b9fe['limit']==='undefined';var _0x11df80=_0x10ce36[_0x772f('0x27')];var _0xbb5e95=_0x2ba5f5?0x0:_0x34b9fe[_0x772f('0x25')];var _0x1429ec=_0x2ba5f5?_0x10ce36[_0x772f('0x27')]:_0x34b9fe['offset']+_0x34b9fe[_0x772f('0x28')];var _0x154428;if(_0x1429ec>=_0x11df80){_0x1429ec=_0x11df80;_0x154428=0xc8;}else{_0x154428=0xce;}_0x5c81c3['status'](_0x154428);return _0x5c81c3['set']('Content-Range',_0xbb5e95+'-'+_0x1429ec+'/'+_0x11df80)[_0x772f('0x29')](_0x10ce36);}return null;};}function patchUpdates(_0x44f075){return function(_0x2ea3da){try{jsonpatch[_0x772f('0x2a')](_0x2ea3da,_0x44f075,!![]);}catch(_0x4d7556){return BPromise[_0x772f('0x2b')](_0x4d7556);}return _0x2ea3da[_0x772f('0x2c')]();};}function saveUpdates(_0x3c15f2,_0x485fe2){return function(_0x7871a6){if(_0x7871a6){return _0x7871a6['update'](_0x3c15f2)['then'](function(_0x3ae73c){return _0x3ae73c;});}return null;};}function removeEntity(_0xaa778b,_0x456c26){return function(_0x4e747b){if(_0x4e747b){return _0x4e747b[_0x772f('0x2d')]()['then'](function(){_0xaa778b[_0x772f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x210be0,_0x173014){return function(_0x28884e){if(!_0x28884e){_0x210be0[_0x772f('0x22')](0x194);}return _0x28884e;};}function handleError(_0x498e4f,_0x1b9ffa){_0x1b9ffa=_0x1b9ffa||0x1f4;return function(_0x2216a3){logger['error'](_0x2216a3[_0x772f('0x2e')]);if(_0x2216a3[_0x772f('0x2f')]){delete _0x2216a3[_0x772f('0x2f')];}_0x498e4f['status'](_0x1b9ffa)['send'](_0x2216a3);};}exports[_0x772f('0x30')]=function(_0x31cb57,_0x764f8c){var _0x1c99aa={},_0x21d6aa={},_0x10abbf={'count':0x0,'rows':[]};var _0x162f96=_[_0x772f('0x31')](db[_0x772f('0x32')][_0x772f('0x33')],function(_0x4f459f){return{'name':_0x4f459f[_0x772f('0x34')],'type':_0x4f459f[_0x772f('0x35')][_0x772f('0x36')]};});_0x21d6aa['model']=_['map'](_0x162f96,_0x772f('0x2f'));_0x21d6aa[_0x772f('0x37')]=_[_0x772f('0x38')](_0x31cb57[_0x772f('0x37')]);_0x21d6aa[_0x772f('0x39')]=_[_0x772f('0x3a')](_0x21d6aa[_0x772f('0x3b')],_0x21d6aa[_0x772f('0x37')]);_0x1c99aa[_0x772f('0x3c')]=_[_0x772f('0x3a')](_0x21d6aa[_0x772f('0x3b')],qs['fields'](_0x31cb57['query'][_0x772f('0x3d')]));_0x1c99aa[_0x772f('0x3c')]=_0x1c99aa[_0x772f('0x3c')]['length']?_0x1c99aa['attributes']:_0x21d6aa['model'];if(!_0x31cb57['query'][_0x772f('0x3e')](_0x772f('0x3f'))){_0x1c99aa['limit']=qs[_0x772f('0x28')](_0x31cb57['query'][_0x772f('0x28')]);_0x1c99aa[_0x772f('0x25')]=qs[_0x772f('0x25')](_0x31cb57[_0x772f('0x37')][_0x772f('0x25')]);}_0x1c99aa[_0x772f('0x40')]=qs[_0x772f('0x41')](_0x31cb57[_0x772f('0x37')]['sort']);_0x1c99aa[_0x772f('0x42')]=qs[_0x772f('0x39')](_[_0x772f('0x43')](_0x31cb57[_0x772f('0x37')],_0x21d6aa[_0x772f('0x39')]),_0x162f96);if(_0x31cb57[_0x772f('0x37')][_0x772f('0x44')]){_0x1c99aa[_0x772f('0x42')]=_[_0x772f('0x45')](_0x1c99aa[_0x772f('0x42')],{'$or':_[_0x772f('0x31')](_0x162f96,function(_0x45d725){if(_0x45d725[_0x772f('0x35')]!==_0x772f('0x46')){var _0x2cb039={};_0x2cb039[_0x45d725[_0x772f('0x2f')]]={'$like':'%'+_0x31cb57[_0x772f('0x37')]['filter']+'%'};return _0x2cb039;}})});}_0x1c99aa=_[_0x772f('0x45')]({},_0x1c99aa,_0x31cb57[_0x772f('0x47')]);var _0x5b7546={'where':_0x1c99aa['where']};return db['VoiceQueueReport'][_0x772f('0x27')](_0x5b7546)[_0x772f('0x48')](function(_0x1c3490){_0x10abbf[_0x772f('0x27')]=_0x1c3490;if(_0x31cb57[_0x772f('0x37')][_0x772f('0x49')]){_0x1c99aa[_0x772f('0x4a')]=[{'all':!![]}];}return db[_0x772f('0x32')][_0x772f('0x4b')](_0x1c99aa);})[_0x772f('0x48')](function(_0x1a6267){_0x10abbf[_0x772f('0x4c')]=_0x1a6267;return _0x10abbf;})['then'](respondWithFilteredResult(_0x764f8c,_0x1c99aa))['catch'](handleError(_0x764f8c,null));};exports[_0x772f('0x4d')]=function(_0x361ac6,_0x3af0cf){var _0x3c11f6={'raw':![],'where':{'id':_0x361ac6[_0x772f('0x4e')]['id']}},_0x47956e={};_0x47956e['model']=_['keys'](db[_0x772f('0x32')][_0x772f('0x33')]);_0x47956e[_0x772f('0x37')]=_[_0x772f('0x38')](_0x361ac6[_0x772f('0x37')]);_0x47956e[_0x772f('0x39')]=_[_0x772f('0x3a')](_0x47956e[_0x772f('0x3b')],_0x47956e[_0x772f('0x37')]);_0x3c11f6['attributes']=_[_0x772f('0x3a')](_0x47956e[_0x772f('0x3b')],qs[_0x772f('0x3d')](_0x361ac6['query'][_0x772f('0x3d')]));_0x3c11f6[_0x772f('0x3c')]=_0x3c11f6[_0x772f('0x3c')][_0x772f('0x4f')]?_0x3c11f6[_0x772f('0x3c')]:_0x47956e['model'];if(_0x361ac6[_0x772f('0x37')][_0x772f('0x49')]){_0x3c11f6[_0x772f('0x4a')]=[{'all':!![]}];}_0x3c11f6=_['merge']({},_0x3c11f6,_0x361ac6[_0x772f('0x47')]);return db[_0x772f('0x32')][_0x772f('0x50')](_0x3c11f6)['then'](handleEntityNotFound(_0x3af0cf,null))[_0x772f('0x48')](respondWithResult(_0x3af0cf,null))[_0x772f('0x51')](handleError(_0x3af0cf,null));};exports[_0x772f('0x52')]=function(_0x134cfe,_0x12d755){return db[_0x772f('0x32')][_0x772f('0x52')](_0x134cfe['body'],{})[_0x772f('0x48')](respondWithResult(_0x12d755,0xc9))['catch'](handleError(_0x12d755,null));};exports['update']=function(_0x37ca92,_0x4812c3){if(_0x37ca92[_0x772f('0x53')]['id']){delete _0x37ca92[_0x772f('0x53')]['id'];}return db[_0x772f('0x32')][_0x772f('0x50')]({'where':{'id':_0x37ca92['params']['id']}})[_0x772f('0x48')](handleEntityNotFound(_0x4812c3,null))[_0x772f('0x48')](saveUpdates(_0x37ca92[_0x772f('0x53')],null))[_0x772f('0x48')](respondWithResult(_0x4812c3,null))['catch'](handleError(_0x4812c3,null));};exports['destroy']=function(_0x23854b,_0x51c7ce){return db['VoiceQueueReport'][_0x772f('0x50')]({'where':{'id':_0x23854b[_0x772f('0x4e')]['id']}})[_0x772f('0x48')](handleEntityNotFound(_0x51c7ce,null))['then'](removeEntity(_0x51c7ce,null))[_0x772f('0x51')](handleError(_0x51c7ce,null));};exports[_0x772f('0x54')]=function(_0x120a14,_0x2793d7){return db[_0x772f('0x32')][_0x772f('0x54')]()['then'](respondWithResult(_0x2793d7,null))[_0x772f('0x51')](handleError(_0x2793d7,null));};exports[_0x772f('0x55')]=function(_0x4bea45,_0x4185cb){var _0x106b76={},_0x59a57b={},_0x23f09a={'count':0x0,'rows':[]};_0x59a57b[_0x772f('0x3b')]=_[_0x772f('0x38')](db['VoiceQueueReport']['rawAttributes']);_0x59a57b[_0x772f('0x37')]=_[_0x772f('0x38')](_0x4bea45['query']);_0x59a57b[_0x772f('0x39')]=_[_0x772f('0x3a')](_0x59a57b[_0x772f('0x3b')],_0x59a57b[_0x772f('0x37')]);_0x106b76['attributes']=_[_0x772f('0x3a')](_0x59a57b[_0x772f('0x3b')],qs[_0x772f('0x3d')](_0x4bea45[_0x772f('0x37')][_0x772f('0x3d')]));_0x106b76[_0x772f('0x3c')]=_0x106b76[_0x772f('0x3c')]['length']?_0x106b76[_0x772f('0x3c')]:_0x59a57b[_0x772f('0x3b')];if(!_0x4bea45[_0x772f('0x37')][_0x772f('0x3e')](_0x772f('0x3f'))){_0x106b76[_0x772f('0x28')]=qs[_0x772f('0x28')](_0x4bea45[_0x772f('0x37')][_0x772f('0x28')]);_0x106b76['offset']=qs[_0x772f('0x25')](_0x4bea45[_0x772f('0x37')][_0x772f('0x25')]);}_0x106b76[_0x772f('0x40')]=qs['sort'](_0x4bea45[_0x772f('0x37')][_0x772f('0x41')]);_0x106b76[_0x772f('0x42')]=qs[_0x772f('0x39')](_[_0x772f('0x43')](_0x4bea45[_0x772f('0x37')],_0x59a57b[_0x772f('0x39')]));if(_0x4bea45[_0x772f('0x37')][_0x772f('0x44')]){_0x106b76[_0x772f('0x42')]=_[_0x772f('0x45')](_0x106b76[_0x772f('0x42')],{'$or':_[_0x772f('0x31')](_0x106b76[_0x772f('0x3c')],function(_0x6e8c8c){var _0x299f88={};_0x299f88[_0x6e8c8c]={'$like':'%'+_0x4bea45[_0x772f('0x37')][_0x772f('0x44')]+'%'};return _0x299f88;})});}_0x106b76=_['merge']({},_0x106b76,_0x4bea45[_0x772f('0x47')]);var _0x3d92bf={'where':_0x106b76['where']};return db['VoiceQueueReport'][_0x772f('0x27')](_0x3d92bf)[_0x772f('0x48')](function(_0x20c335){_0x23f09a[_0x772f('0x27')]=_0x20c335;if(_0x4bea45['query'][_0x772f('0x49')]){_0x106b76[_0x772f('0x4a')]=[{'all':!![]}];}return db[_0x772f('0x32')][_0x772f('0x4b')](_0x106b76);})[_0x772f('0x48')](function(_0x1d1505){_0x23f09a['rows']=_0x1d1505;return _0x23f09a;})[_0x772f('0x48')](respondWithFilteredResult(_0x4185cb,_0x106b76,_0x772f('0x55')))[_0x772f('0x51')](handleError(_0x4185cb,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x3ab6=['map','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','describe','getVoiceQueuesReport','rawAttributes','findAll','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','limit','undefined','count','offset','json','apply','reject','update','then','destroy','stack','name','send','index','VoiceQueueReport','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x41d57c,_0x6fbdd1){var _0x53ded7=function(_0x5361e6){while(--_0x5361e6){_0x41d57c['push'](_0x41d57c['shift']());}};_0x53ded7(++_0x6fbdd1);}(_0x3ab6,0x105));var _0x63ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x63ab('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63ab('0x1'));var moment=require(_0x63ab('0x2'));var BPromise=require(_0x63ab('0x3'));var Mustache=require(_0x63ab('0x4'));var util=require('util');var path=require(_0x63ab('0x5'));var sox=require(_0x63ab('0x6'));var csv=require(_0x63ab('0x7'));var ejs=require(_0x63ab('0x8'));var fs=require('fs');var fs_extra=require(_0x63ab('0x9'));var _=require(_0x63ab('0xa'));var squel=require(_0x63ab('0xb'));var crypto=require(_0x63ab('0xc'));var jsforce=require(_0x63ab('0xd'));var deskjs=require(_0x63ab('0xe'));var toCsv=require(_0x63ab('0x7'));var querystring=require(_0x63ab('0xf'));var Papa=require(_0x63ab('0x10'));var Redis=require('ioredis');var authService=require(_0x63ab('0x11'));var qs=require(_0x63ab('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x63ab('0x13'))(_0x63ab('0x14'));var utils=require('../../config/utils');var config=require(_0x63ab('0x15'));var licenseUtil=require(_0x63ab('0x16'));var db=require(_0x63ab('0x17'))['db'];config['redis']=_[_0x63ab('0x18')](config[_0x63ab('0x19')],{'host':_0x63ab('0x1a'),'port':0x18eb});var socket=require(_0x63ab('0x1b'))(new Redis(config[_0x63ab('0x19')]));require(_0x63ab('0x1c'))['register'](socket);function respondWithStatusCode(_0x9a5462,_0x57d037){_0x57d037=_0x57d037||0xcc;return function(_0x4da01d){if(_0x4da01d){return _0x9a5462[_0x63ab('0x1d')](_0x57d037);}return _0x9a5462[_0x63ab('0x1e')](_0x57d037)[_0x63ab('0x1f')]();};}function respondWithResult(_0x21e788,_0x39f451){_0x39f451=_0x39f451||0xc8;return function(_0x4a1f4a){if(_0x4a1f4a){return _0x21e788[_0x63ab('0x1e')](_0x39f451)['json'](_0x4a1f4a);}};}function respondWithFilteredResult(_0xab36ea,_0x2e7d98){return function(_0x46dbe3){if(_0x46dbe3){var _0x3ec614=typeof _0x2e7d98['offset']==='undefined'&&typeof _0x2e7d98[_0x63ab('0x20')]===_0x63ab('0x21');var _0xd5dab5=_0x46dbe3[_0x63ab('0x22')];var _0x9a416c=_0x3ec614?0x0:_0x2e7d98[_0x63ab('0x23')];var _0x45a30a=_0x3ec614?_0x46dbe3[_0x63ab('0x22')]:_0x2e7d98['offset']+_0x2e7d98['limit'];var _0x134c09;if(_0x45a30a>=_0xd5dab5){_0x45a30a=_0xd5dab5;_0x134c09=0xc8;}else{_0x134c09=0xce;}_0xab36ea['status'](_0x134c09);return _0xab36ea['set']('Content-Range',_0x9a416c+'-'+_0x45a30a+'/'+_0xd5dab5)[_0x63ab('0x24')](_0x46dbe3);}return null;};}function patchUpdates(_0x367826){return function(_0x336d9d){try{jsonpatch[_0x63ab('0x25')](_0x336d9d,_0x367826,!![]);}catch(_0x104e0c){return BPromise[_0x63ab('0x26')](_0x104e0c);}return _0x336d9d['save']();};}function saveUpdates(_0x19252c,_0x17945c){return function(_0x3079ec){if(_0x3079ec){return _0x3079ec[_0x63ab('0x27')](_0x19252c)[_0x63ab('0x28')](function(_0x58ae17){return _0x58ae17;});}return null;};}function removeEntity(_0x461e6f,_0x531280){return function(_0x4a82b1){if(_0x4a82b1){return _0x4a82b1[_0x63ab('0x29')]()[_0x63ab('0x28')](function(){_0x461e6f[_0x63ab('0x1e')](0xcc)[_0x63ab('0x1f')]();});}};}function handleEntityNotFound(_0x23eb91,_0x24c06f){return function(_0x56fefc){if(!_0x56fefc){_0x23eb91[_0x63ab('0x1d')](0x194);}return _0x56fefc;};}function handleError(_0x176b0d,_0x4fbc63){_0x4fbc63=_0x4fbc63||0x1f4;return function(_0x1f2307){logger['error'](_0x1f2307[_0x63ab('0x2a')]);if(_0x1f2307[_0x63ab('0x2b')]){delete _0x1f2307[_0x63ab('0x2b')];}_0x176b0d[_0x63ab('0x1e')](_0x4fbc63)[_0x63ab('0x2c')](_0x1f2307);};}exports[_0x63ab('0x2d')]=function(_0x1e2d73,_0x1410cb){var _0x2e4677={},_0x1a030f={},_0x5971bf={'count':0x0,'rows':[]};var _0x4392b1=_['map'](db[_0x63ab('0x2e')]['rawAttributes'],function(_0x15f7fd){return{'name':_0x15f7fd['fieldName'],'type':_0x15f7fd[_0x63ab('0x2f')][_0x63ab('0x30')]};});_0x1a030f[_0x63ab('0x31')]=_['map'](_0x4392b1,_0x63ab('0x2b'));_0x1a030f[_0x63ab('0x32')]=_[_0x63ab('0x33')](_0x1e2d73[_0x63ab('0x32')]);_0x1a030f[_0x63ab('0x34')]=_['intersection'](_0x1a030f[_0x63ab('0x31')],_0x1a030f[_0x63ab('0x32')]);_0x2e4677[_0x63ab('0x35')]=_['intersection'](_0x1a030f['model'],qs[_0x63ab('0x36')](_0x1e2d73['query']['fields']));_0x2e4677['attributes']=_0x2e4677['attributes'][_0x63ab('0x37')]?_0x2e4677[_0x63ab('0x35')]:_0x1a030f[_0x63ab('0x31')];if(!_0x1e2d73[_0x63ab('0x32')][_0x63ab('0x38')](_0x63ab('0x39'))){_0x2e4677[_0x63ab('0x20')]=qs[_0x63ab('0x20')](_0x1e2d73['query'][_0x63ab('0x20')]);_0x2e4677[_0x63ab('0x23')]=qs[_0x63ab('0x23')](_0x1e2d73[_0x63ab('0x32')][_0x63ab('0x23')]);}_0x2e4677[_0x63ab('0x3a')]=qs['sort'](_0x1e2d73[_0x63ab('0x32')][_0x63ab('0x3b')]);_0x2e4677[_0x63ab('0x3c')]=qs['filters'](_[_0x63ab('0x3d')](_0x1e2d73[_0x63ab('0x32')],_0x1a030f['filters']),_0x4392b1);if(_0x1e2d73[_0x63ab('0x32')]['filter']){_0x2e4677[_0x63ab('0x3c')]=_[_0x63ab('0x3e')](_0x2e4677[_0x63ab('0x3c')],{'$or':_[_0x63ab('0x3f')](_0x4392b1,function(_0x4b2d0a){if(_0x4b2d0a[_0x63ab('0x2f')]!==_0x63ab('0x40')){var _0x5b0103={};_0x5b0103[_0x4b2d0a['name']]={'$like':'%'+_0x1e2d73['query'][_0x63ab('0x41')]+'%'};return _0x5b0103;}})});}_0x2e4677=_[_0x63ab('0x3e')]({},_0x2e4677,_0x1e2d73[_0x63ab('0x42')]);var _0x5b53b7={'where':_0x2e4677['where']};return db[_0x63ab('0x2e')][_0x63ab('0x22')](_0x5b53b7)[_0x63ab('0x28')](function(_0x273f4a){_0x5971bf[_0x63ab('0x22')]=_0x273f4a;if(_0x1e2d73['query'][_0x63ab('0x43')]){_0x2e4677[_0x63ab('0x44')]=[{'all':!![]}];}return db[_0x63ab('0x2e')]['findAll'](_0x2e4677);})[_0x63ab('0x28')](function(_0x398343){_0x5971bf[_0x63ab('0x45')]=_0x398343;return _0x5971bf;})[_0x63ab('0x28')](respondWithFilteredResult(_0x1410cb,_0x2e4677))[_0x63ab('0x46')](handleError(_0x1410cb,null));};exports[_0x63ab('0x47')]=function(_0x343ab3,_0x1adf3c){var _0x436910={'raw':![],'where':{'id':_0x343ab3[_0x63ab('0x48')]['id']}},_0x335f90={};_0x335f90['model']=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x335f90[_0x63ab('0x32')]=_['keys'](_0x343ab3['query']);_0x335f90[_0x63ab('0x34')]=_[_0x63ab('0x49')](_0x335f90[_0x63ab('0x31')],_0x335f90[_0x63ab('0x32')]);_0x436910['attributes']=_[_0x63ab('0x49')](_0x335f90['model'],qs[_0x63ab('0x36')](_0x343ab3[_0x63ab('0x32')][_0x63ab('0x36')]));_0x436910['attributes']=_0x436910[_0x63ab('0x35')]['length']?_0x436910[_0x63ab('0x35')]:_0x335f90[_0x63ab('0x31')];if(_0x343ab3[_0x63ab('0x32')][_0x63ab('0x43')]){_0x436910[_0x63ab('0x44')]=[{'all':!![]}];}_0x436910=_[_0x63ab('0x3e')]({},_0x436910,_0x343ab3['options']);return db['VoiceQueueReport'][_0x63ab('0x4a')](_0x436910)[_0x63ab('0x28')](handleEntityNotFound(_0x1adf3c,null))[_0x63ab('0x28')](respondWithResult(_0x1adf3c,null))[_0x63ab('0x46')](handleError(_0x1adf3c,null));};exports['create']=function(_0x25d1d1,_0x1fb49a){return db[_0x63ab('0x2e')][_0x63ab('0x4b')](_0x25d1d1[_0x63ab('0x4c')],{})['then'](respondWithResult(_0x1fb49a,0xc9))['catch'](handleError(_0x1fb49a,null));};exports[_0x63ab('0x27')]=function(_0x42d91c,_0x3bffab){if(_0x42d91c[_0x63ab('0x4c')]['id']){delete _0x42d91c[_0x63ab('0x4c')]['id'];}return db[_0x63ab('0x2e')][_0x63ab('0x4a')]({'where':{'id':_0x42d91c[_0x63ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bffab,null))[_0x63ab('0x28')](saveUpdates(_0x42d91c[_0x63ab('0x4c')],null))[_0x63ab('0x28')](respondWithResult(_0x3bffab,null))[_0x63ab('0x46')](handleError(_0x3bffab,null));};exports[_0x63ab('0x29')]=function(_0x54c41e,_0x2a6bdc){return db[_0x63ab('0x2e')][_0x63ab('0x4a')]({'where':{'id':_0x54c41e[_0x63ab('0x48')]['id']}})[_0x63ab('0x28')](handleEntityNotFound(_0x2a6bdc,null))[_0x63ab('0x28')](removeEntity(_0x2a6bdc,null))[_0x63ab('0x46')](handleError(_0x2a6bdc,null));};exports[_0x63ab('0x4d')]=function(_0x12cefb,_0x1ca1f6){return db[_0x63ab('0x2e')][_0x63ab('0x4d')]()[_0x63ab('0x28')](respondWithResult(_0x1ca1f6,null))[_0x63ab('0x46')](handleError(_0x1ca1f6,null));};exports[_0x63ab('0x4e')]=function(_0x34148a,_0x5267e5){var _0x161679={},_0x2649f0={},_0x4c0fff={'count':0x0,'rows':[]};_0x2649f0['model']=_[_0x63ab('0x33')](db[_0x63ab('0x2e')][_0x63ab('0x4f')]);_0x2649f0[_0x63ab('0x32')]=_[_0x63ab('0x33')](_0x34148a['query']);_0x2649f0[_0x63ab('0x34')]=_['intersection'](_0x2649f0['model'],_0x2649f0[_0x63ab('0x32')]);_0x161679[_0x63ab('0x35')]=_[_0x63ab('0x49')](_0x2649f0[_0x63ab('0x31')],qs[_0x63ab('0x36')](_0x34148a[_0x63ab('0x32')][_0x63ab('0x36')]));_0x161679[_0x63ab('0x35')]=_0x161679['attributes']['length']?_0x161679[_0x63ab('0x35')]:_0x2649f0[_0x63ab('0x31')];if(!_0x34148a[_0x63ab('0x32')][_0x63ab('0x38')](_0x63ab('0x39'))){_0x161679[_0x63ab('0x20')]=qs[_0x63ab('0x20')](_0x34148a['query'][_0x63ab('0x20')]);_0x161679['offset']=qs[_0x63ab('0x23')](_0x34148a[_0x63ab('0x32')]['offset']);}_0x161679['order']=qs['sort'](_0x34148a[_0x63ab('0x32')][_0x63ab('0x3b')]);_0x161679[_0x63ab('0x3c')]=qs[_0x63ab('0x34')](_[_0x63ab('0x3d')](_0x34148a['query'],_0x2649f0['filters']));if(_0x34148a['query'][_0x63ab('0x41')]){_0x161679[_0x63ab('0x3c')]=_['merge'](_0x161679[_0x63ab('0x3c')],{'$or':_[_0x63ab('0x3f')](_0x161679[_0x63ab('0x35')],function(_0x459716){var _0x3bd021={};_0x3bd021[_0x459716]={'$like':'%'+_0x34148a[_0x63ab('0x32')]['filter']+'%'};return _0x3bd021;})});}_0x161679=_[_0x63ab('0x3e')]({},_0x161679,_0x34148a[_0x63ab('0x42')]);var _0xe15eed={'where':_0x161679[_0x63ab('0x3c')]};return db[_0x63ab('0x2e')]['count'](_0xe15eed)[_0x63ab('0x28')](function(_0x2c0549){_0x4c0fff[_0x63ab('0x22')]=_0x2c0549;if(_0x34148a[_0x63ab('0x32')][_0x63ab('0x43')]){_0x161679[_0x63ab('0x44')]=[{'all':!![]}];}return db[_0x63ab('0x2e')][_0x63ab('0x50')](_0x161679);})[_0x63ab('0x28')](function(_0x726cd9){_0x4c0fff[_0x63ab('0x45')]=_0x726cd9;return _0x4c0fff;})[_0x63ab('0x28')](respondWithFilteredResult(_0x5267e5,_0x161679,_0x63ab('0x4e')))[_0x63ab('0x46')](handleError(_0x5267e5,null,_0x63ab('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index be32612..6224649 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 _0xd388=['save','update','remove','emit','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x47e27b,_0x5974c8){var _0x3e4b95=function(_0x59fb5f){while(--_0x59fb5f){_0x47e27b['push'](_0x47e27b['shift']());}};_0x3e4b95(++_0x5974c8);}(_0xd388,0x95));var _0x8d38=function(_0x32d609,_0x10a503){_0x32d609=_0x32d609-0x0;var _0x2bda93=_0xd388[_0x32d609];return _0x2bda93;};'use strict';var EventEmitter=require(_0x8d38('0x0'));var VoiceQueueReport=require(_0x8d38('0x1'))['db'][_0x8d38('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8d38('0x3')](0x0);var events={'afterCreate':_0x8d38('0x4'),'afterUpdate':_0x8d38('0x5'),'afterDestroy':_0x8d38('0x6')};function emitEvent(_0x369291){return function(_0x11ecfd,_0x14f76f,_0x4a3237){VoiceQueueReportEvents[_0x8d38('0x7')](_0x369291+':'+_0x11ecfd['id'],_0x11ecfd);VoiceQueueReportEvents[_0x8d38('0x7')](_0x369291,_0x11ecfd);_0x4a3237(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x8d38('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8875=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x233d84,_0x3f63c9){var _0x33f28f=function(_0x27646b){while(--_0x27646b){_0x233d84['push'](_0x233d84['shift']());}};_0x33f28f(++_0x3f63c9);}(_0x8875,0x1ba));var _0x5887=function(_0xf9b41e,_0x32cbb0){_0xf9b41e=_0xf9b41e-0x0;var _0xdb1456=_0x8875[_0xf9b41e];return _0xdb1456;};'use strict';var EventEmitter=require(_0x5887('0x0'));var VoiceQueueReport=require(_0x5887('0x1'))['db'][_0x5887('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5887('0x3')](0x0);var events={'afterCreate':_0x5887('0x4'),'afterUpdate':'update','afterDestroy':_0x5887('0x5')};function emitEvent(_0x30ffcf){return function(_0x490313,_0x3f6df0,_0x1f120f){VoiceQueueReportEvents[_0x5887('0x6')](_0x30ffcf+':'+_0x490313['id'],_0x490313);VoiceQueueReportEvents['emit'](_0x30ffcf,_0x490313);_0x1f120f(null);};}for(var e in events){if(events[_0x5887('0x7')](e)){var event=events[e];VoiceQueueReport[_0x5887('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4c0531f..6ce6c6f 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 _0x0a64=['../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','lodash','util'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x0a64,0xd6));var _0x40a6=function(_0x56dfa5,_0xfaa178){_0x56dfa5=_0x56dfa5-0x0;var _0x5eb3e2=_0x0a64[_0x56dfa5];return _0x5eb3e2;};'use strict';var _=require(_0x40a6('0x0'));var util=require(_0x40a6('0x1'));var logger=require(_0x40a6('0x2'))(_0x40a6('0x3'));var moment=require(_0x40a6('0x4'));var BPromise=require('bluebird');var rp=require(_0x40a6('0x5'));var fs=require('fs');var path=require(_0x40a6('0x6'));var rimraf=require('rimraf');var config=require(_0x40a6('0x7'));var attributes=require(_0x40a6('0x8'));module[_0x40a6('0x9')]=function(_0x3b4626,_0x24892f){return _0x3b4626[_0x40a6('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x40a6('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x359f=['bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','api','moment'];(function(_0x363013,_0x202893){var _0x534a60=function(_0x1ad149){while(--_0x1ad149){_0x363013['push'](_0x363013['shift']());}};_0x534a60(++_0x202893);}(_0x359f,0x1c5));var _0xf359=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x359f[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xf359('0x0'));var logger=require('../../config/logger')(_0xf359('0x1'));var moment=require(_0xf359('0x2'));var BPromise=require(_0xf359('0x3'));var rp=require(_0xf359('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf359('0x5'));var attributes=require(_0xf359('0x6'));module[_0xf359('0x7')]=function(_0x3259c5,_0x1ad4bb){return _0x3259c5[_0xf359('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xf359('0x9'),'paranoid':![],'indexes':[{'fields':[_0xf359('0xa')]},{'fields':[_0xf359('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 53cef8a..a0c2351 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 _0x9b47=['UpdateVoiceQueueReport','update','limit','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','stringify','catch','CreateVoiceQueueReport','create','body'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x9b47,0x1e7));var _0x79b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x79b4('0x0'));var moment=require(_0x79b4('0x1'));var BPromise=require(_0x79b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79b4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x79b4('0x4'));var logger=require(_0x79b4('0x5'))(_0x79b4('0x6'));var config=require(_0x79b4('0x7'));var jayson=require(_0x79b4('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x79b4('0x9')]=_[_0x79b4('0xa')](config[_0x79b4('0x9')],{'host':_0x79b4('0xb'),'port':0x18eb});var socket=require(_0x79b4('0xc'))(new Redis(config['redis']));require(_0x79b4('0xd'))[_0x79b4('0xe')](socket);function respondWithRpcPromise(_0x52b452,_0x21a6f0,_0x2c0281){return new BPromise(function(_0x30944f,_0x16caf6){return client[_0x79b4('0xf')](_0x52b452,_0x2c0281)[_0x79b4('0x10')](function(_0x4f89ad){logger[_0x79b4('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x21a6f0,'request\x20sent');logger[_0x79b4('0x12')](_0x79b4('0x13'),_0x21a6f0,_0x79b4('0x14'),JSON['stringify'](_0x4f89ad));if(_0x4f89ad[_0x79b4('0x15')]){if(_0x4f89ad[_0x79b4('0x15')][_0x79b4('0x16')]===0x1f4){logger[_0x79b4('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x21a6f0,_0x4f89ad[_0x79b4('0x15')][_0x79b4('0x17')]);return _0x16caf6(_0x4f89ad[_0x79b4('0x15')][_0x79b4('0x17')]);}logger[_0x79b4('0x15')](_0x79b4('0x18'),_0x21a6f0,_0x4f89ad[_0x79b4('0x15')]['message']);return _0x30944f(_0x4f89ad['error'][_0x79b4('0x17')]);}else{logger[_0x79b4('0x11')](_0x79b4('0x18'),_0x21a6f0,'request\x20sent');_0x30944f(_0x4f89ad[_0x79b4('0x19')][_0x79b4('0x17')]);}})['catch'](function(_0x2b5e4b){logger[_0x79b4('0x15')](_0x79b4('0x18'),_0x21a6f0,_0x2b5e4b);_0x16caf6(_0x2b5e4b);});});}exports[_0x79b4('0x1a')]=function(_0xb1cf6e){var _0x29c0e9=this;return new Promise(function(_0x363bab,_0x229997){return db[_0x79b4('0x1b')][_0x79b4('0x1c')]({'raw':_0xb1cf6e[_0x79b4('0x1d')]?_0xb1cf6e[_0x79b4('0x1d')][_0x79b4('0x1e')]===undefined?!![]:![]:!![],'where':_0xb1cf6e[_0x79b4('0x1d')]?_0xb1cf6e[_0x79b4('0x1d')][_0x79b4('0x1f')]||null:null,'attributes':_0xb1cf6e['options']?_0xb1cf6e[_0x79b4('0x1d')][_0x79b4('0x20')]||null:null,'limit':_0xb1cf6e[_0x79b4('0x1d')]?_0xb1cf6e[_0x79b4('0x1d')]['limit']||null:null,'include':_0xb1cf6e[_0x79b4('0x1d')]?_0xb1cf6e[_0x79b4('0x1d')][_0x79b4('0x21')]?_[_0x79b4('0x22')](_0xb1cf6e[_0x79b4('0x1d')]['include'],function(_0x46e83c){return{'model':db[_0x46e83c[_0x79b4('0x23')]],'as':_0x46e83c['as'],'attributes':_0x46e83c['attributes'],'include':_0x46e83c[_0x79b4('0x21')]?_[_0x79b4('0x22')](_0x46e83c[_0x79b4('0x21')],function(_0x5a2b52){return{'model':db[_0x5a2b52['model']],'as':_0x5a2b52['as'],'attributes':_0x5a2b52['attributes'],'include':_0x5a2b52[_0x79b4('0x21')]?_[_0x79b4('0x22')](_0x5a2b52['include'],function(_0x2be7cb){return{'model':db[_0x2be7cb[_0x79b4('0x23')]],'as':_0x2be7cb['as'],'attributes':_0x2be7cb[_0x79b4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x79b4('0x10')](function(_0x417ffd){logger['info'](_0x79b4('0x1a'),_0xb1cf6e);logger['debug'](_0x79b4('0x1a'),_0xb1cf6e,JSON[_0x79b4('0x24')](_0x417ffd));_0x363bab(_0x417ffd);})[_0x79b4('0x25')](function(_0x1eae0d){logger[_0x79b4('0x15')](_0x79b4('0x1a'),_0x1eae0d[_0x79b4('0x17')],_0xb1cf6e);_0x229997(_0x29c0e9['error'](0x1f4,_0x1eae0d[_0x79b4('0x17')]));});});};exports[_0x79b4('0x26')]=function(_0x517f41){var _0x2cbdef=this;return new Promise(function(_0x2cf449,_0x1aaa3b){return db[_0x79b4('0x1b')][_0x79b4('0x27')](_0x517f41[_0x79b4('0x28')],{'raw':_0x517f41[_0x79b4('0x1d')]?_0x517f41[_0x79b4('0x1d')][_0x79b4('0x1e')]===undefined?!![]:![]:!![]})[_0x79b4('0x10')](function(_0x33c2a2){logger['info'](_0x79b4('0x26'),_0x517f41);logger[_0x79b4('0x12')](_0x79b4('0x26'),_0x517f41,JSON['stringify'](_0x33c2a2));_0x2cf449(_0x33c2a2);})['catch'](function(_0x2bf126){logger['error']('CreateVoiceQueueReport',_0x2bf126['message'],_0x517f41);_0x1aaa3b(_0x2cbdef['error'](0x1f4,_0x2bf126['message']));});});};exports[_0x79b4('0x29')]=function(_0x4922c1){var _0x5ed853=this;return new Promise(function(_0x4ff006,_0xe08c73){return db[_0x79b4('0x1b')][_0x79b4('0x2a')](_0x4922c1[_0x79b4('0x28')],{'raw':_0x4922c1[_0x79b4('0x1d')]?_0x4922c1[_0x79b4('0x1d')][_0x79b4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4922c1[_0x79b4('0x1d')]?_0x4922c1[_0x79b4('0x1d')]['where']||null:null,'attributes':_0x4922c1['options']?_0x4922c1[_0x79b4('0x1d')]['attributes']||null:null,'limit':_0x4922c1['options']?_0x4922c1[_0x79b4('0x1d')][_0x79b4('0x2b')]||null:null})[_0x79b4('0x10')](function(_0x53f16a){logger[_0x79b4('0x11')]('UpdateVoiceQueueReport',_0x4922c1);logger['debug']('UpdateVoiceQueueReport',_0x4922c1,JSON['stringify'](_0x53f16a));_0x4ff006(_0x53f16a);})[_0x79b4('0x25')](function(_0xe46f7b){logger[_0x79b4('0x15')]('UpdateVoiceQueueReport',_0xe46f7b[_0x79b4('0x17')],_0x4922c1);_0xe08c73(_0x5ed853['error'](0x1f4,_0xe46f7b[_0x79b4('0x17')]));});});}; \ No newline at end of file +var _0xc7fe=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','raw','stringify','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xc7fe,0x11c));var _0xec7f=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xc7fe[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xec7f('0x0'));var util=require('util');var moment=require(_0xec7f('0x1'));var BPromise=require(_0xec7f('0x2'));var rs=require(_0xec7f('0x3'));var fs=require('fs');var Redis=require(_0xec7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec7f('0x5'));var logger=require(_0xec7f('0x6'))(_0xec7f('0x7'));var config=require(_0xec7f('0x8'));var jayson=require(_0xec7f('0x9'));var client=jayson['client'][_0xec7f('0xa')]({'port':0x232a});config[_0xec7f('0xb')]=_['defaults'](config[_0xec7f('0xb')],{'host':_0xec7f('0xc'),'port':0x18eb});var socket=require(_0xec7f('0xd'))(new Redis(config['redis']));require(_0xec7f('0xe'))[_0xec7f('0xf')](socket);function respondWithRpcPromise(_0x3c5a21,_0x3c1ab5,_0x2ece7a){return new BPromise(function(_0x54463f,_0x462717){return client[_0xec7f('0x10')](_0x3c5a21,_0x2ece7a)[_0xec7f('0x11')](function(_0x42b4c1){logger[_0xec7f('0x12')](_0xec7f('0x13'),_0x3c1ab5,'request\x20sent');logger[_0xec7f('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3c1ab5,_0xec7f('0x15'),JSON['stringify'](_0x42b4c1));if(_0x42b4c1[_0xec7f('0x16')]){if(_0x42b4c1[_0xec7f('0x16')]['code']===0x1f4){logger[_0xec7f('0x16')](_0xec7f('0x13'),_0x3c1ab5,_0x42b4c1['error']['message']);return _0x462717(_0x42b4c1[_0xec7f('0x16')][_0xec7f('0x17')]);}logger['error'](_0xec7f('0x13'),_0x3c1ab5,_0x42b4c1['error']['message']);return _0x54463f(_0x42b4c1[_0xec7f('0x16')]['message']);}else{logger['info'](_0xec7f('0x13'),_0x3c1ab5,_0xec7f('0x15'));_0x54463f(_0x42b4c1['result']['message']);}})[_0xec7f('0x18')](function(_0x20adcc){logger[_0xec7f('0x16')](_0xec7f('0x13'),_0x3c1ab5,_0x20adcc);_0x462717(_0x20adcc);});});}exports[_0xec7f('0x19')]=function(_0x2f89ec){var _0x40d23f=this;return new Promise(function(_0x42af40,_0x42285b){return db[_0xec7f('0x1a')]['findAll']({'raw':_0x2f89ec[_0xec7f('0x1b')]?_0x2f89ec[_0xec7f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2f89ec[_0xec7f('0x1b')]?_0x2f89ec[_0xec7f('0x1b')][_0xec7f('0x1c')]||null:null,'attributes':_0x2f89ec[_0xec7f('0x1b')]?_0x2f89ec[_0xec7f('0x1b')][_0xec7f('0x1d')]||null:null,'limit':_0x2f89ec[_0xec7f('0x1b')]?_0x2f89ec[_0xec7f('0x1b')]['limit']||null:null,'include':_0x2f89ec[_0xec7f('0x1b')]?_0x2f89ec[_0xec7f('0x1b')][_0xec7f('0x1e')]?_[_0xec7f('0x1f')](_0x2f89ec[_0xec7f('0x1b')]['include'],function(_0x55f73b){return{'model':db[_0x55f73b['model']],'as':_0x55f73b['as'],'attributes':_0x55f73b[_0xec7f('0x1d')],'include':_0x55f73b['include']?_['map'](_0x55f73b[_0xec7f('0x1e')],function(_0x2d5222){return{'model':db[_0x2d5222[_0xec7f('0x20')]],'as':_0x2d5222['as'],'attributes':_0x2d5222[_0xec7f('0x1d')],'include':_0x2d5222[_0xec7f('0x1e')]?_[_0xec7f('0x1f')](_0x2d5222[_0xec7f('0x1e')],function(_0x2a029c){return{'model':db[_0x2a029c[_0xec7f('0x20')]],'as':_0x2a029c['as'],'attributes':_0x2a029c[_0xec7f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xec7f('0x11')](function(_0x22ebc5){logger[_0xec7f('0x12')](_0xec7f('0x19'),_0x2f89ec);logger[_0xec7f('0x14')](_0xec7f('0x19'),_0x2f89ec,JSON['stringify'](_0x22ebc5));_0x42af40(_0x22ebc5);})[_0xec7f('0x18')](function(_0x42be1c){logger[_0xec7f('0x16')]('GetVoiceQueueReport',_0x42be1c[_0xec7f('0x17')],_0x2f89ec);_0x42285b(_0x40d23f[_0xec7f('0x16')](0x1f4,_0x42be1c[_0xec7f('0x17')]));});});};exports[_0xec7f('0x21')]=function(_0x27790e){var _0x36cc24=this;return new Promise(function(_0x52e595,_0x1515b1){return db[_0xec7f('0x1a')][_0xec7f('0x22')](_0x27790e[_0xec7f('0x23')],{'raw':_0x27790e['options']?_0x27790e[_0xec7f('0x1b')][_0xec7f('0x24')]===undefined?!![]:![]:!![]})[_0xec7f('0x11')](function(_0x577097){logger[_0xec7f('0x12')](_0xec7f('0x21'),_0x27790e);logger[_0xec7f('0x14')](_0xec7f('0x21'),_0x27790e,JSON[_0xec7f('0x25')](_0x577097));_0x52e595(_0x577097);})['catch'](function(_0x134d90){logger[_0xec7f('0x16')](_0xec7f('0x21'),_0x134d90[_0xec7f('0x17')],_0x27790e);_0x1515b1(_0x36cc24['error'](0x1f4,_0x134d90[_0xec7f('0x17')]));});});};exports[_0xec7f('0x26')]=function(_0x331bc7){var _0x167d6b=this;return new Promise(function(_0x44de6c,_0x17061){return db[_0xec7f('0x1a')][_0xec7f('0x27')](_0x331bc7['body'],{'raw':_0x331bc7[_0xec7f('0x1b')]?_0x331bc7[_0xec7f('0x1b')][_0xec7f('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331bc7[_0xec7f('0x1b')]?_0x331bc7[_0xec7f('0x1b')]['where']||null:null,'attributes':_0x331bc7['options']?_0x331bc7[_0xec7f('0x1b')]['attributes']||null:null,'limit':_0x331bc7[_0xec7f('0x1b')]?_0x331bc7[_0xec7f('0x1b')][_0xec7f('0x28')]||null:null})['then'](function(_0x1feea3){logger[_0xec7f('0x12')](_0xec7f('0x26'),_0x331bc7);logger['debug']('UpdateVoiceQueueReport',_0x331bc7,JSON[_0xec7f('0x25')](_0x1feea3));_0x44de6c(_0x1feea3);})[_0xec7f('0x18')](function(_0x32f981){logger['error'](_0xec7f('0x26'),_0x32f981[_0xec7f('0x17')],_0x331bc7);_0x17061(_0x167d6b[_0xec7f('0x16')](0x1f4,_0x32f981['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 055dafc..d181c26 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 _0xd1e8=['voiceQueueReport:','remove','update','length'];(function(_0x25686b,_0x2a2554){var _0x26e569=function(_0x2239ad){while(--_0x2239ad){_0x25686b['push'](_0x25686b['shift']());}};_0x26e569(++_0x2a2554);}(_0xd1e8,0x101));var _0x8d1e=function(_0x26aee1,_0x34fcd7){_0x26aee1=_0x26aee1-0x0;var _0x26f918=_0xd1e8[_0x26aee1];return _0x26f918;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x8d1e('0x0'),_0x8d1e('0x1')];function createListener(_0x211590,_0x1ef9ae){return function(_0x25b924){_0x1ef9ae['emit'](_0x211590,_0x25b924);};}function removeListener(_0x4a08d9,_0xe23267){return function(){VoiceQueueReportEvents['removeListener'](_0x4a08d9,_0xe23267);};}exports['register']=function(_0x5426b5){for(var _0x38aa20=0x0,_0x242fd8=events[_0x8d1e('0x2')];_0x38aa20<_0x242fd8;_0x38aa20++){var _0x58919c=events[_0x38aa20];var _0x50672f=createListener(_0x8d1e('0x3')+_0x58919c,_0x5426b5);VoiceQueueReportEvents['on'](_0x58919c,_0x50672f);}}; \ No newline at end of file +var _0x7d9f=['./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x29acd3,_0x832b76){var _0x1057dd=function(_0x1e1d44){while(--_0x1e1d44){_0x29acd3['push'](_0x29acd3['shift']());}};_0x1057dd(++_0x832b76);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x5b984b,_0x355e68){_0x5b984b=_0x5b984b-0x0;var _0x52e07d=_0x7d9f[_0x5b984b];return _0x52e07d;};'use strict';var VoiceQueueReportEvents=require(_0xf7d9('0x0'));var events=[_0xf7d9('0x1'),_0xf7d9('0x2'),_0xf7d9('0x3')];function createListener(_0x265b56,_0x538e69){return function(_0x15a23b){_0x538e69[_0xf7d9('0x4')](_0x265b56,_0x15a23b);};}function removeListener(_0xd43b74,_0x159e95){return function(){VoiceQueueReportEvents[_0xf7d9('0x5')](_0xd43b74,_0x159e95);};}exports['register']=function(_0x4b50c7){for(var _0x2eb0f1=0x0,_0x250675=events['length'];_0x2eb0f1<_0x250675;_0x2eb0f1++){var _0x21c654=events[_0x2eb0f1];var _0x1685a6=createListener('voiceQueueReport:'+_0x21c654,_0x4b50c7);VoiceQueueReportEvents['on'](_0x21c654,_0x1685a6);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index eced783..f306813 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 _0xc6f6=['isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','get','show','post'];(function(_0x553249,_0x42e8ce){var _0x534c47=function(_0x194401){while(--_0x194401){_0x553249['push'](_0x553249['shift']());}};_0x534c47(++_0x42e8ce);}(_0xc6f6,0xeb));var _0x6c6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc6f6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6c6f('0x0'));var util=require(_0x6c6f('0x1'));var path=require(_0x6c6f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c6f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6c6f('0x4'));var interaction=require(_0x6c6f('0x5'));var config=require(_0x6c6f('0x6'));var controller=require(_0x6c6f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6c6f('0x8')]);router[_0x6c6f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6c6f('0xa')]);router[_0x6c6f('0xb')]('/',auth[_0x6c6f('0xc')](),controller[_0x6c6f('0xd')]);router[_0x6c6f('0xe')](_0x6c6f('0xf'),auth[_0x6c6f('0xc')](),controller['update']);router[_0x6c6f('0x10')](_0x6c6f('0xf'),auth[_0x6c6f('0xc')](),controller[_0x6c6f('0x11')]);module[_0x6c6f('0x12')]=router; \ No newline at end of file +var _0xb0de=['put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post'];(function(_0xd204b0,_0x4c7d1d){var _0xfc8310=function(_0x4f4b5a){while(--_0x4f4b5a){_0xd204b0['push'](_0xd204b0['shift']());}};_0xfc8310(++_0x4c7d1d);}(_0xb0de,0x148));var _0xeb0d=function(_0x270a8f,_0x519a17){_0x270a8f=_0x270a8f-0x0;var _0xc45a9a=_0xb0de[_0x270a8f];return _0xc45a9a;};'use strict';var multer=require(_0xeb0d('0x0'));var util=require('util');var path=require(_0xeb0d('0x1'));var timeout=require(_0xeb0d('0x2'));var express=require(_0xeb0d('0x3'));var router=express[_0xeb0d('0x4')]();var fs_extra=require(_0xeb0d('0x5'));var auth=require(_0xeb0d('0x6'));var interaction=require(_0xeb0d('0x7'));var config=require(_0xeb0d('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0xeb0d('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb0d('0xa')]);router[_0xeb0d('0x9')]('/:id',auth[_0xeb0d('0xb')](),controller[_0xeb0d('0xc')]);router[_0xeb0d('0xd')]('/',auth[_0xeb0d('0xb')](),controller['create']);router[_0xeb0d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xeb0d('0xf')]);router[_0xeb0d('0x10')](_0xeb0d('0x11'),auth[_0xeb0d('0xb')](),controller[_0xeb0d('0x12')]);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 1a30181..2ccee8b 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 _0x74d3=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x40d1aa,_0xa3872c){var _0x475da5=function(_0xceaac){while(--_0xceaac){_0x40d1aa['push'](_0x40d1aa['shift']());}};_0x475da5(++_0xa3872c);}(_0x74d3,0x159));var _0x374d=function(_0x12f5f7,_0xa58b52){_0x12f5f7=_0x12f5f7-0x0;var _0x345c1b=_0x74d3[_0x12f5f7];return _0x345c1b;};'use strict';var Sequelize=require(_0x374d('0x0'));var moment=require(_0x374d('0x1'));module[_0x374d('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x374d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x374d('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x374d('0x5'))}}; \ No newline at end of file +var _0x2145=['moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x29f171,_0x15fb46){var _0x3b9730=function(_0x8b51ad){while(--_0x8b51ad){_0x29f171['push'](_0x29f171['shift']());}};_0x3b9730(++_0x15fb46);}(_0x2145,0x1d6));var _0x5214=function(_0x170f6d,_0xf636db){_0x170f6d=_0x170f6d-0x0;var _0x5e6447=_0x2145[_0x170f6d];return _0x5e6447;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5214('0x0'));module['exports']={'time':{'type':Sequelize[_0x5214('0x1')]},'callid':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5214('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5214('0x2')],'allowNull':![],'defaultValue':moment()[_0x5214('0x3')](_0x5214('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c10b626..3c02c28 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 _0x6cee=['../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4221a2,_0x4ec5d9){var _0x435f05=function(_0x1eef69){while(--_0x1eef69){_0x4221a2['push'](_0x4221a2['shift']());}};_0x435f05(++_0x4ec5d9);}(_0x6cee,0xd0));var _0xe6ce=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x6cee[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xe6ce('0x0'));var rimraf=require(_0xe6ce('0x1'));var zipdir=require(_0xe6ce('0x2'));var jsonpatch=require(_0xe6ce('0x3'));var rp=require('request-promise');var moment=require(_0xe6ce('0x4'));var BPromise=require(_0xe6ce('0x5'));var Mustache=require(_0xe6ce('0x6'));var util=require(_0xe6ce('0x7'));var path=require(_0xe6ce('0x8'));var sox=require(_0xe6ce('0x9'));var csv=require(_0xe6ce('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6ce('0xb'));var _=require(_0xe6ce('0xc'));var squel=require(_0xe6ce('0xd'));var crypto=require(_0xe6ce('0xe'));var jsforce=require(_0xe6ce('0xf'));var deskjs=require(_0xe6ce('0x10'));var toCsv=require(_0xe6ce('0xa'));var querystring=require(_0xe6ce('0x11'));var Papa=require(_0xe6ce('0x12'));var Redis=require(_0xe6ce('0x13'));var authService=require(_0xe6ce('0x14'));var qs=require(_0xe6ce('0x15'));var as=require(_0xe6ce('0x16'));var hardwareService=require(_0xe6ce('0x17'));var logger=require(_0xe6ce('0x18'))(_0xe6ce('0x19'));var utils=require('../../config/utils');var config=require(_0xe6ce('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe4f7d1,_0x1e55d3){_0x1e55d3=_0x1e55d3||0xcc;return function(_0x5afec2){if(_0x5afec2){return _0xe4f7d1['sendStatus'](_0x1e55d3);}return _0xe4f7d1[_0xe6ce('0x1b')](_0x1e55d3)[_0xe6ce('0x1c')]();};}function respondWithResult(_0x1ed8af,_0x4d8a56){_0x4d8a56=_0x4d8a56||0xc8;return function(_0x34f995){if(_0x34f995){return _0x1ed8af[_0xe6ce('0x1b')](_0x4d8a56)[_0xe6ce('0x1d')](_0x34f995);}};}function respondWithFilteredResult(_0xb5c363,_0x368a47){return function(_0x255b7d){if(_0x255b7d){var _0x489eab=typeof _0x368a47['offset']==='undefined'&&typeof _0x368a47[_0xe6ce('0x1e')]===_0xe6ce('0x1f');var _0x3a8cd5=_0x255b7d['count'];var _0xaa43ad=_0x489eab?0x0:_0x368a47[_0xe6ce('0x20')];var _0x4e3262=_0x489eab?_0x255b7d[_0xe6ce('0x21')]:_0x368a47[_0xe6ce('0x20')]+_0x368a47[_0xe6ce('0x1e')];var _0x120638;if(_0x4e3262>=_0x3a8cd5){_0x4e3262=_0x3a8cd5;_0x120638=0xc8;}else{_0x120638=0xce;}_0xb5c363[_0xe6ce('0x1b')](_0x120638);return _0xb5c363[_0xe6ce('0x22')](_0xe6ce('0x23'),_0xaa43ad+'-'+_0x4e3262+'/'+_0x3a8cd5)[_0xe6ce('0x1d')](_0x255b7d);}return null;};}function patchUpdates(_0x422256){return function(_0x51e1cb){try{jsonpatch[_0xe6ce('0x24')](_0x51e1cb,_0x422256,!![]);}catch(_0x6e2957){return BPromise[_0xe6ce('0x25')](_0x6e2957);}return _0x51e1cb[_0xe6ce('0x26')]();};}function saveUpdates(_0x439e27,_0x5b607d){return function(_0x5c56d4){if(_0x5c56d4){return _0x5c56d4[_0xe6ce('0x27')](_0x439e27)[_0xe6ce('0x28')](function(_0x37d89e){return _0x37d89e;});}return null;};}function removeEntity(_0x5a5a70,_0x47f9b0){return function(_0x32dd61){if(_0x32dd61){return _0x32dd61['destroy']()[_0xe6ce('0x28')](function(){_0x5a5a70[_0xe6ce('0x1b')](0xcc)[_0xe6ce('0x1c')]();});}};}function handleEntityNotFound(_0x27ef0a,_0x85ecbe){return function(_0xc8f1ff){if(!_0xc8f1ff){_0x27ef0a[_0xe6ce('0x29')](0x194);}return _0xc8f1ff;};}function handleError(_0x2c0e03,_0x542fde){_0x542fde=_0x542fde||0x1f4;return function(_0x28c5d0){logger[_0xe6ce('0x2a')](_0x28c5d0['stack']);if(_0x28c5d0[_0xe6ce('0x2b')]){delete _0x28c5d0[_0xe6ce('0x2b')];}_0x2c0e03[_0xe6ce('0x1b')](_0x542fde)[_0xe6ce('0x2c')](_0x28c5d0);};}exports['index']=function(_0x500395,_0x52dc7f){var _0xee0e60={},_0x1199ef={},_0x16baef={'count':0x0,'rows':[]};var _0x1c8ade=_[_0xe6ce('0x2d')](db[_0xe6ce('0x2e')][_0xe6ce('0x2f')],function(_0x234afe){return{'name':_0x234afe[_0xe6ce('0x30')],'type':_0x234afe[_0xe6ce('0x31')][_0xe6ce('0x32')]};});_0x1199ef[_0xe6ce('0x33')]=_[_0xe6ce('0x2d')](_0x1c8ade,'name');_0x1199ef['query']=_[_0xe6ce('0x34')](_0x500395[_0xe6ce('0x35')]);_0x1199ef[_0xe6ce('0x36')]=_[_0xe6ce('0x37')](_0x1199ef[_0xe6ce('0x33')],_0x1199ef[_0xe6ce('0x35')]);_0xee0e60[_0xe6ce('0x38')]=_['intersection'](_0x1199ef['model'],qs[_0xe6ce('0x39')](_0x500395['query'][_0xe6ce('0x39')]));_0xee0e60['attributes']=_0xee0e60['attributes'][_0xe6ce('0x3a')]?_0xee0e60['attributes']:_0x1199ef['model'];if(!_0x500395[_0xe6ce('0x35')][_0xe6ce('0x3b')](_0xe6ce('0x3c'))){_0xee0e60[_0xe6ce('0x1e')]=qs['limit'](_0x500395[_0xe6ce('0x35')][_0xe6ce('0x1e')]);_0xee0e60['offset']=qs['offset'](_0x500395[_0xe6ce('0x35')]['offset']);}_0xee0e60[_0xe6ce('0x3d')]=qs[_0xe6ce('0x3e')](_0x500395[_0xe6ce('0x35')][_0xe6ce('0x3e')]);_0xee0e60[_0xe6ce('0x3f')]=qs[_0xe6ce('0x36')](_[_0xe6ce('0x40')](_0x500395[_0xe6ce('0x35')],_0x1199ef['filters']),_0x1c8ade);if(_0x500395[_0xe6ce('0x35')][_0xe6ce('0x41')]){_0xee0e60[_0xe6ce('0x3f')]=_[_0xe6ce('0x42')](_0xee0e60[_0xe6ce('0x3f')],{'$or':_[_0xe6ce('0x2d')](_0x1c8ade,function(_0x222e48){if(_0x222e48[_0xe6ce('0x31')]!=='VIRTUAL'){var _0x29b7e8={};_0x29b7e8[_0x222e48['name']]={'$like':'%'+_0x500395['query'][_0xe6ce('0x41')]+'%'};return _0x29b7e8;}})});}_0xee0e60=_[_0xe6ce('0x42')]({},_0xee0e60,_0x500395[_0xe6ce('0x43')]);var _0xdc509c={'where':_0xee0e60[_0xe6ce('0x3f')]};return db[_0xe6ce('0x2e')]['count'](_0xdc509c)['then'](function(_0x3c705e){_0x16baef[_0xe6ce('0x21')]=_0x3c705e;if(_0x500395['query'][_0xe6ce('0x44')]){_0xee0e60[_0xe6ce('0x45')]=[{'all':!![]}];}return db[_0xe6ce('0x2e')]['findAll'](_0xee0e60);})[_0xe6ce('0x28')](function(_0x12fb73){_0x16baef[_0xe6ce('0x46')]=_0x12fb73;return _0x16baef;})['then'](respondWithFilteredResult(_0x52dc7f,_0xee0e60))[_0xe6ce('0x47')](handleError(_0x52dc7f,null));};exports[_0xe6ce('0x48')]=function(_0x155b05,_0x1d4efb){var _0x51dc4a={'raw':!![],'where':{'id':_0x155b05[_0xe6ce('0x49')]['id']}},_0xc94f5e={};_0xc94f5e[_0xe6ce('0x33')]=_[_0xe6ce('0x34')](db[_0xe6ce('0x2e')]['rawAttributes']);_0xc94f5e['query']=_[_0xe6ce('0x34')](_0x155b05[_0xe6ce('0x35')]);_0xc94f5e['filters']=_[_0xe6ce('0x37')](_0xc94f5e[_0xe6ce('0x33')],_0xc94f5e[_0xe6ce('0x35')]);_0x51dc4a[_0xe6ce('0x38')]=_[_0xe6ce('0x37')](_0xc94f5e['model'],qs[_0xe6ce('0x39')](_0x155b05[_0xe6ce('0x35')][_0xe6ce('0x39')]));_0x51dc4a[_0xe6ce('0x38')]=_0x51dc4a['attributes']['length']?_0x51dc4a[_0xe6ce('0x38')]:_0xc94f5e[_0xe6ce('0x33')];if(_0x155b05['query'][_0xe6ce('0x44')]){_0x51dc4a[_0xe6ce('0x45')]=[{'all':!![]}];}_0x51dc4a=_[_0xe6ce('0x42')]({},_0x51dc4a,_0x155b05[_0xe6ce('0x43')]);return db['VoiceQueuesLog'][_0xe6ce('0x4a')](_0x51dc4a)[_0xe6ce('0x28')](handleEntityNotFound(_0x1d4efb,null))['then'](respondWithResult(_0x1d4efb,null))[_0xe6ce('0x47')](handleError(_0x1d4efb,null));};exports[_0xe6ce('0x4b')]=function(_0xd2d19a,_0x5172af){return db['VoiceQueuesLog'][_0xe6ce('0x4b')](_0xd2d19a[_0xe6ce('0x4c')],{})['then'](respondWithResult(_0x5172af,0xc9))[_0xe6ce('0x47')](handleError(_0x5172af,null));};exports[_0xe6ce('0x27')]=function(_0x2e94ba,_0x19c8ce){if(_0x2e94ba['body']['id']){delete _0x2e94ba['body']['id'];}return db[_0xe6ce('0x2e')][_0xe6ce('0x4a')]({'where':{'id':_0x2e94ba[_0xe6ce('0x49')]['id']}})[_0xe6ce('0x28')](handleEntityNotFound(_0x19c8ce,null))[_0xe6ce('0x28')](saveUpdates(_0x2e94ba[_0xe6ce('0x4c')],null))['then'](respondWithResult(_0x19c8ce,null))[_0xe6ce('0x47')](handleError(_0x19c8ce,null));};exports['destroy']=function(_0x553ddb,_0x467486){return db['VoiceQueuesLog'][_0xe6ce('0x4a')]({'where':{'id':_0x553ddb[_0xe6ce('0x49')]['id']}})[_0xe6ce('0x28')](handleEntityNotFound(_0x467486,null))['then'](removeEntity(_0x467486,null))[_0xe6ce('0x47')](handleError(_0x467486,null));}; \ No newline at end of file +var _0x6cdf=['keys','find','create','body','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x3b76a8,_0x5e8485){var _0x3a6ce9=function(_0x1a183b){while(--_0x1a183b){_0x3b76a8['push'](_0x3b76a8['shift']());}};_0x3a6ce9(++_0x5e8485);}(_0x6cdf,0xeb));var _0xf6cd=function(_0x2d43b4,_0xa4ee8f){_0x2d43b4=_0x2d43b4-0x0;var _0x3a387c=_0x6cdf[_0x2d43b4];return _0x3a387c;};'use strict';var emlformat=require(_0xf6cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6cd('0x1'));var jsonpatch=require(_0xf6cd('0x2'));var rp=require('request-promise');var moment=require(_0xf6cd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6cd('0x4'));var path=require(_0xf6cd('0x5'));var sox=require(_0xf6cd('0x6'));var csv=require(_0xf6cd('0x7'));var ejs=require(_0xf6cd('0x8'));var fs=require('fs');var fs_extra=require(_0xf6cd('0x9'));var _=require('lodash');var squel=require(_0xf6cd('0xa'));var crypto=require(_0xf6cd('0xb'));var jsforce=require(_0xf6cd('0xc'));var deskjs=require(_0xf6cd('0xd'));var toCsv=require(_0xf6cd('0x7'));var querystring=require(_0xf6cd('0xe'));var Papa=require(_0xf6cd('0xf'));var Redis=require(_0xf6cd('0x10'));var authService=require(_0xf6cd('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6cd('0x12'));var logger=require(_0xf6cd('0x13'))('api');var utils=require(_0xf6cd('0x14'));var config=require(_0xf6cd('0x15'));var licenseUtil=require(_0xf6cd('0x16'));var db=require(_0xf6cd('0x17'))['db'];function respondWithStatusCode(_0x4df059,_0x5a98be){_0x5a98be=_0x5a98be||0xcc;return function(_0x8be323){if(_0x8be323){return _0x4df059['sendStatus'](_0x5a98be);}return _0x4df059[_0xf6cd('0x18')](_0x5a98be)[_0xf6cd('0x19')]();};}function respondWithResult(_0x5b59f1,_0x1880fb){_0x1880fb=_0x1880fb||0xc8;return function(_0x16580a){if(_0x16580a){return _0x5b59f1['status'](_0x1880fb)[_0xf6cd('0x1a')](_0x16580a);}};}function respondWithFilteredResult(_0x306caa,_0x341cdb){return function(_0x312970){if(_0x312970){var _0x3c9dc4=typeof _0x341cdb[_0xf6cd('0x1b')]===_0xf6cd('0x1c')&&typeof _0x341cdb[_0xf6cd('0x1d')]===_0xf6cd('0x1c');var _0x5c272f=_0x312970['count'];var _0x995b1=_0x3c9dc4?0x0:_0x341cdb['offset'];var _0x2aa01c=_0x3c9dc4?_0x312970[_0xf6cd('0x1e')]:_0x341cdb[_0xf6cd('0x1b')]+_0x341cdb['limit'];var _0x486849;if(_0x2aa01c>=_0x5c272f){_0x2aa01c=_0x5c272f;_0x486849=0xc8;}else{_0x486849=0xce;}_0x306caa[_0xf6cd('0x18')](_0x486849);return _0x306caa[_0xf6cd('0x1f')](_0xf6cd('0x20'),_0x995b1+'-'+_0x2aa01c+'/'+_0x5c272f)[_0xf6cd('0x1a')](_0x312970);}return null;};}function patchUpdates(_0x1bf4a9){return function(_0x3ef2c3){try{jsonpatch[_0xf6cd('0x21')](_0x3ef2c3,_0x1bf4a9,!![]);}catch(_0x3f0218){return BPromise[_0xf6cd('0x22')](_0x3f0218);}return _0x3ef2c3[_0xf6cd('0x23')]();};}function saveUpdates(_0x23f424,_0x43a9bf){return function(_0x468796){if(_0x468796){return _0x468796[_0xf6cd('0x24')](_0x23f424)[_0xf6cd('0x25')](function(_0x378ce4){return _0x378ce4;});}return null;};}function removeEntity(_0x38035e,_0x4ed8cc){return function(_0x3bc079){if(_0x3bc079){return _0x3bc079[_0xf6cd('0x26')]()[_0xf6cd('0x25')](function(){_0x38035e[_0xf6cd('0x18')](0xcc)[_0xf6cd('0x19')]();});}};}function handleEntityNotFound(_0x256cf0,_0x24d924){return function(_0x51a807){if(!_0x51a807){_0x256cf0[_0xf6cd('0x27')](0x194);}return _0x51a807;};}function handleError(_0x2becc5,_0x41c7ab){_0x41c7ab=_0x41c7ab||0x1f4;return function(_0x469628){logger['error'](_0x469628[_0xf6cd('0x28')]);if(_0x469628[_0xf6cd('0x29')]){delete _0x469628['name'];}_0x2becc5[_0xf6cd('0x18')](_0x41c7ab)[_0xf6cd('0x2a')](_0x469628);};}exports[_0xf6cd('0x2b')]=function(_0x3e7279,_0x3c71cd){var _0x33b38d={},_0x22da0a={},_0x5af116={'count':0x0,'rows':[]};var _0x269470=_['map'](db[_0xf6cd('0x2c')][_0xf6cd('0x2d')],function(_0x53f959){return{'name':_0x53f959[_0xf6cd('0x2e')],'type':_0x53f959['type'][_0xf6cd('0x2f')]};});_0x22da0a[_0xf6cd('0x30')]=_['map'](_0x269470,'name');_0x22da0a[_0xf6cd('0x31')]=_['keys'](_0x3e7279[_0xf6cd('0x31')]);_0x22da0a[_0xf6cd('0x32')]=_['intersection'](_0x22da0a[_0xf6cd('0x30')],_0x22da0a[_0xf6cd('0x31')]);_0x33b38d[_0xf6cd('0x33')]=_[_0xf6cd('0x34')](_0x22da0a[_0xf6cd('0x30')],qs[_0xf6cd('0x35')](_0x3e7279['query'][_0xf6cd('0x35')]));_0x33b38d[_0xf6cd('0x33')]=_0x33b38d[_0xf6cd('0x33')][_0xf6cd('0x36')]?_0x33b38d[_0xf6cd('0x33')]:_0x22da0a['model'];if(!_0x3e7279[_0xf6cd('0x31')][_0xf6cd('0x37')](_0xf6cd('0x38'))){_0x33b38d[_0xf6cd('0x1d')]=qs[_0xf6cd('0x1d')](_0x3e7279[_0xf6cd('0x31')]['limit']);_0x33b38d[_0xf6cd('0x1b')]=qs[_0xf6cd('0x1b')](_0x3e7279['query'][_0xf6cd('0x1b')]);}_0x33b38d[_0xf6cd('0x39')]=qs[_0xf6cd('0x3a')](_0x3e7279['query']['sort']);_0x33b38d[_0xf6cd('0x3b')]=qs[_0xf6cd('0x32')](_[_0xf6cd('0x3c')](_0x3e7279[_0xf6cd('0x31')],_0x22da0a[_0xf6cd('0x32')]),_0x269470);if(_0x3e7279[_0xf6cd('0x31')]['filter']){_0x33b38d[_0xf6cd('0x3b')]=_[_0xf6cd('0x3d')](_0x33b38d[_0xf6cd('0x3b')],{'$or':_[_0xf6cd('0x3e')](_0x269470,function(_0x46ff58){if(_0x46ff58[_0xf6cd('0x3f')]!==_0xf6cd('0x40')){var _0x57f365={};_0x57f365[_0x46ff58[_0xf6cd('0x29')]]={'$like':'%'+_0x3e7279[_0xf6cd('0x31')]['filter']+'%'};return _0x57f365;}})});}_0x33b38d=_[_0xf6cd('0x3d')]({},_0x33b38d,_0x3e7279[_0xf6cd('0x41')]);var _0x1e378f={'where':_0x33b38d[_0xf6cd('0x3b')]};return db['VoiceQueuesLog'][_0xf6cd('0x1e')](_0x1e378f)[_0xf6cd('0x25')](function(_0x2277e6){_0x5af116['count']=_0x2277e6;if(_0x3e7279[_0xf6cd('0x31')][_0xf6cd('0x42')]){_0x33b38d[_0xf6cd('0x43')]=[{'all':!![]}];}return db[_0xf6cd('0x2c')][_0xf6cd('0x44')](_0x33b38d);})[_0xf6cd('0x25')](function(_0x547494){_0x5af116[_0xf6cd('0x45')]=_0x547494;return _0x5af116;})[_0xf6cd('0x25')](respondWithFilteredResult(_0x3c71cd,_0x33b38d))[_0xf6cd('0x46')](handleError(_0x3c71cd,null));};exports[_0xf6cd('0x47')]=function(_0x3c0482,_0x2684b0){var _0x33a9fd={'raw':!![],'where':{'id':_0x3c0482[_0xf6cd('0x48')]['id']}},_0x264353={};_0x264353[_0xf6cd('0x30')]=_[_0xf6cd('0x49')](db['VoiceQueuesLog'][_0xf6cd('0x2d')]);_0x264353[_0xf6cd('0x31')]=_[_0xf6cd('0x49')](_0x3c0482[_0xf6cd('0x31')]);_0x264353[_0xf6cd('0x32')]=_[_0xf6cd('0x34')](_0x264353[_0xf6cd('0x30')],_0x264353[_0xf6cd('0x31')]);_0x33a9fd[_0xf6cd('0x33')]=_[_0xf6cd('0x34')](_0x264353['model'],qs['fields'](_0x3c0482['query'][_0xf6cd('0x35')]));_0x33a9fd['attributes']=_0x33a9fd[_0xf6cd('0x33')]['length']?_0x33a9fd[_0xf6cd('0x33')]:_0x264353['model'];if(_0x3c0482[_0xf6cd('0x31')][_0xf6cd('0x42')]){_0x33a9fd['include']=[{'all':!![]}];}_0x33a9fd=_[_0xf6cd('0x3d')]({},_0x33a9fd,_0x3c0482[_0xf6cd('0x41')]);return db[_0xf6cd('0x2c')][_0xf6cd('0x4a')](_0x33a9fd)[_0xf6cd('0x25')](handleEntityNotFound(_0x2684b0,null))[_0xf6cd('0x25')](respondWithResult(_0x2684b0,null))[_0xf6cd('0x46')](handleError(_0x2684b0,null));};exports[_0xf6cd('0x4b')]=function(_0x489f70,_0x3f7460){return db[_0xf6cd('0x2c')][_0xf6cd('0x4b')](_0x489f70['body'],{})[_0xf6cd('0x25')](respondWithResult(_0x3f7460,0xc9))[_0xf6cd('0x46')](handleError(_0x3f7460,null));};exports[_0xf6cd('0x24')]=function(_0x1527b9,_0xe17853){if(_0x1527b9[_0xf6cd('0x4c')]['id']){delete _0x1527b9['body']['id'];}return db[_0xf6cd('0x2c')][_0xf6cd('0x4a')]({'where':{'id':_0x1527b9[_0xf6cd('0x48')]['id']}})[_0xf6cd('0x25')](handleEntityNotFound(_0xe17853,null))[_0xf6cd('0x25')](saveUpdates(_0x1527b9[_0xf6cd('0x4c')],null))['then'](respondWithResult(_0xe17853,null))[_0xf6cd('0x46')](handleError(_0xe17853,null));};exports[_0xf6cd('0x26')]=function(_0x35bd2a,_0x5d8af9){return db[_0xf6cd('0x2c')][_0xf6cd('0x4a')]({'where':{'id':_0x35bd2a['params']['id']}})[_0xf6cd('0x25')](handleEntityNotFound(_0x5d8af9,null))[_0xf6cd('0x25')](removeEntity(_0x5d8af9,null))['catch'](handleError(_0x5d8af9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3199661..8dd0444 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 _0xa351=['voice_queues_log','event_dtm','event','dtm','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define'];(function(_0x5c3273,_0x358ecb){var _0x2128da=function(_0x54846b){while(--_0x54846b){_0x5c3273['push'](_0x5c3273['shift']());}};_0x2128da(++_0x358ecb);}(_0xa351,0xac));var _0x1a35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa351[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a35('0x0'))(_0x1a35('0x1'));var moment=require(_0x1a35('0x2'));var BPromise=require(_0x1a35('0x3'));var rp=require(_0x1a35('0x4'));var fs=require('fs');var path=require(_0x1a35('0x5'));var rimraf=require(_0x1a35('0x6'));var config=require(_0x1a35('0x7'));var attributes=require(_0x1a35('0x8'));module['exports']=function(_0x444876,_0x42633d){return _0x444876[_0x1a35('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x1a35('0xa'),'paranoid':![],'indexes':[{'name':_0x1a35('0xb'),'fields':[_0x1a35('0xc'),_0x1a35('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4228=['bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment'];(function(_0x1c7d86,_0x3276c5){var _0x391ccd=function(_0x1c398a){while(--_0x1c398a){_0x1c7d86['push'](_0x1c7d86['shift']());}};_0x391ccd(++_0x3276c5);}(_0x4228,0xd8));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8422('0x0'));var util=require(_0x8422('0x1'));var logger=require(_0x8422('0x2'))(_0x8422('0x3'));var moment=require(_0x8422('0x4'));var BPromise=require(_0x8422('0x5'));var rp=require(_0x8422('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8422('0x7'));var config=require(_0x8422('0x8'));var attributes=require(_0x8422('0x9'));module[_0x8422('0xa')]=function(_0x3852a1,_0xfa0d76){return _0x3852a1[_0x8422('0xb')](_0x8422('0xc'),attributes,{'tableName':_0x8422('0xd'),'paranoid':![],'indexes':[{'name':_0x8422('0xe'),'fields':[_0x8422('0xf'),_0x8422('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index fdfb963..1bb7f25 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 _0x4e61=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x38681d,_0x1df041){var _0x520a3f=function(_0x1b0d49){while(--_0x1b0d49){_0x38681d['push'](_0x38681d['shift']());}};_0x520a3f(++_0x1df041);}(_0x4e61,0x8c));var _0x14e6=function(_0x28f922,_0x1302f8){_0x28f922=_0x28f922-0x0;var _0x4eceac=_0x4e61[_0x28f922];return _0x4eceac;};'use strict';var _=require(_0x14e6('0x0'));var util=require(_0x14e6('0x1'));var moment=require(_0x14e6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14e6('0x3'));var db=require(_0x14e6('0x4'))['db'];var utils=require(_0x14e6('0x5'));var logger=require(_0x14e6('0x6'))(_0x14e6('0x7'));var config=require(_0x14e6('0x8'));var jayson=require(_0x14e6('0x9'));var client=jayson[_0x14e6('0xa')][_0x14e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9f9c31,_0x2a5bc1,_0x91ca48){return new BPromise(function(_0x34b4eb,_0x1200e5){return client[_0x14e6('0xc')](_0x9f9c31,_0x91ca48)[_0x14e6('0xd')](function(_0x17eeed){logger[_0x14e6('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a5bc1,_0x14e6('0xf'));logger[_0x14e6('0x10')](_0x14e6('0x11'),_0x2a5bc1,_0x14e6('0xf'),JSON['stringify'](_0x17eeed));if(_0x17eeed['error']){if(_0x17eeed['error']['code']===0x1f4){logger[_0x14e6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a5bc1,_0x17eeed['error'][_0x14e6('0x13')]);return _0x1200e5(_0x17eeed[_0x14e6('0x12')][_0x14e6('0x13')]);}logger['error'](_0x14e6('0x14'),_0x2a5bc1,_0x17eeed[_0x14e6('0x12')][_0x14e6('0x13')]);return _0x34b4eb(_0x17eeed[_0x14e6('0x12')][_0x14e6('0x13')]);}else{logger['info'](_0x14e6('0x14'),_0x2a5bc1,_0x14e6('0xf'));_0x34b4eb(_0x17eeed[_0x14e6('0x15')][_0x14e6('0x13')]);}})[_0x14e6('0x16')](function(_0x4d6d42){logger[_0x14e6('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a5bc1,_0x4d6d42);_0x1200e5(_0x4d6d42);});});} \ No newline at end of file +var _0xeeaf=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x55515e,_0x2646fd){var _0x3e17b7=function(_0x3580a7){while(--_0x3580a7){_0x55515e['push'](_0x55515e['shift']());}};_0x3e17b7(++_0x2646fd);}(_0xeeaf,0x1bc));var _0xfeea=function(_0x4b8c7e,_0xebee02){_0x4b8c7e=_0x4b8c7e-0x0;var _0x8097e8=_0xeeaf[_0x4b8c7e];return _0x8097e8;};'use strict';var _=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var moment=require(_0xfeea('0x2'));var BPromise=require(_0xfeea('0x3'));var rs=require(_0xfeea('0x4'));var fs=require('fs');var Redis=require(_0xfeea('0x5'));var db=require(_0xfeea('0x6'))['db'];var utils=require(_0xfeea('0x7'));var logger=require('../../config/logger')(_0xfeea('0x8'));var config=require(_0xfeea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfeea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ee0c,_0x37f662,_0x4980ef){return new BPromise(function(_0x5e10ec,_0x5ef7c8){return client[_0xfeea('0xb')](_0x56ee0c,_0x4980ef)[_0xfeea('0xc')](function(_0x57db5d){logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));logger[_0xfeea('0x10')](_0xfeea('0x11'),_0x37f662,_0xfeea('0xf'),JSON[_0xfeea('0x12')](_0x57db5d));if(_0x57db5d[_0xfeea('0x13')]){if(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x14')]===0x1f4){logger[_0xfeea('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5ef7c8(_0x57db5d['error'][_0xfeea('0x15')]);}logger[_0xfeea('0x13')](_0xfeea('0xe'),_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5e10ec(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x15')]);}else{logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));_0x5e10ec(_0x57db5d[_0xfeea('0x16')][_0xfeea('0x15')]);}})[_0xfeea('0x17')](function(_0x2a3668){logger[_0xfeea('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x37f662,_0x2a3668);_0x5ef7c8(_0x2a3668);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 4821514..317e282 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 _0x985e=['post','create','/:id/transcribe','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id/downloads','downloads'];(function(_0x18ba39,_0x19eac1){var _0x4bde1e=function(_0x4754fa){while(--_0x4754fa){_0x18ba39['push'](_0x18ba39['shift']());}};_0x4bde1e(++_0x19eac1);}(_0x985e,0x81));var _0xe985=function(_0x1b45c5,_0x168a3a){_0x1b45c5=_0x1b45c5-0x0;var _0x4f9499=_0x985e[_0x1b45c5];return _0x4f9499;};'use strict';var multer=require(_0xe985('0x0'));var util=require(_0xe985('0x1'));var path=require(_0xe985('0x2'));var timeout=require(_0xe985('0x3'));var express=require(_0xe985('0x4'));var router=express[_0xe985('0x5')]();var fs_extra=require(_0xe985('0x6'));var auth=require(_0xe985('0x7'));var interaction=require(_0xe985('0x8'));var config=require(_0xe985('0x9'));var controller=require(_0xe985('0xa'));router[_0xe985('0xb')]('/',auth[_0xe985('0xc')](),controller[_0xe985('0xd')]);router[_0xe985('0xb')](_0xe985('0xe'),auth['isAuthenticated'](),controller[_0xe985('0xf')]);router[_0xe985('0xb')]('/:id',auth[_0xe985('0xc')](),controller[_0xe985('0x10')]);router[_0xe985('0xb')](_0xe985('0x11'),auth['isAuthenticated'](),controller[_0xe985('0x12')]);router['get'](_0xe985('0x13'),controller[_0xe985('0x14')]);router[_0xe985('0xb')]('/:id/transcribe',auth[_0xe985('0xc')](),controller['downloadTranscribe']);router[_0xe985('0x15')]('/',auth[_0xe985('0xc')](),controller[_0xe985('0x16')]);router['post'](_0xe985('0x17'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xe985('0x18')]('/:id',auth[_0xe985('0xc')](),controller[_0xe985('0x19')]);router[_0xe985('0x1a')](_0xe985('0x1b'),auth[_0xe985('0xc')](),controller[_0xe985('0x1c')]);module[_0xe985('0x1d')]=router; \ No newline at end of file +var _0x9918=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','/:id','update','delete'];(function(_0x2575eb,_0x456f3f){var _0x1c49da=function(_0x32dcb1){while(--_0x32dcb1){_0x2575eb['push'](_0x2575eb['shift']());}};_0x1c49da(++_0x456f3f);}(_0x9918,0x169));var _0x8991=function(_0xdd74bb,_0x49e2b8){_0xdd74bb=_0xdd74bb-0x0;var _0x4d8939=_0x9918[_0xdd74bb];return _0x4d8939;};'use strict';var multer=require(_0x8991('0x0'));var util=require(_0x8991('0x1'));var path=require(_0x8991('0x2'));var timeout=require(_0x8991('0x3'));var express=require(_0x8991('0x4'));var router=express[_0x8991('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8991('0x6'));var config=require(_0x8991('0x7'));var controller=require('./voiceRecording.controller');router[_0x8991('0x8')]('/',auth[_0x8991('0x9')](),controller[_0x8991('0xa')]);router[_0x8991('0x8')](_0x8991('0xb'),auth[_0x8991('0x9')](),controller[_0x8991('0xc')]);router[_0x8991('0x8')]('/:id',auth[_0x8991('0x9')](),controller['show']);router[_0x8991('0x8')]('/:id/download',auth[_0x8991('0x9')](),controller['download']);router[_0x8991('0x8')]('/:id/downloads',controller[_0x8991('0xd')]);router[_0x8991('0x8')](_0x8991('0xe'),auth[_0x8991('0x9')](),controller[_0x8991('0xf')]);router[_0x8991('0x10')]('/',auth[_0x8991('0x9')](),controller[_0x8991('0x11')]);router['post'](_0x8991('0xe'),auth['isAuthenticated'](),controller[_0x8991('0x12')]);router[_0x8991('0x13')](_0x8991('0x14'),auth['isAuthenticated'](),controller[_0x8991('0x15')]);router[_0x8991('0x16')](_0x8991('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x8991('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 413d34b..c315391 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 2e7d35a..290c56d 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 _0x8048=['Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','fileText','root','.txt','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','findAll','rows','catch','show','params','create','body','find','describe','download','uniqueid','value','existsSync','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','push','%s.cypher','decryptFile','Sequelize','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','basename','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets'];(function(_0x1786a5,_0x4ee9ab){var _0x51774f=function(_0x32dd65){while(--_0x32dd65){_0x1786a5['push'](_0x1786a5['shift']());}};_0x51774f(++_0x4ee9ab);}(_0x8048,0xa2));var _0x8804=function(_0x26f5e4,_0x4efb0f){_0x26f5e4=_0x26f5e4-0x0;var _0x1a107c=_0x8048[_0x26f5e4];return _0x1a107c;};'use strict';var emlformat=require(_0x8804('0x0'));var rimraf=require(_0x8804('0x1'));var zipdir=require(_0x8804('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8804('0x3'));var moment=require(_0x8804('0x4'));var BPromise=require(_0x8804('0x5'));var Mustache=require('mustache');var util=require(_0x8804('0x6'));var path=require(_0x8804('0x7'));var sox=require(_0x8804('0x8'));var csv=require(_0x8804('0x9'));var ejs=require(_0x8804('0xa'));var fs=require('fs');var fs_extra=require(_0x8804('0xb'));var _=require(_0x8804('0xc'));var squel=require('squel');var crypto=require(_0x8804('0xd'));var jsforce=require(_0x8804('0xe'));var deskjs=require(_0x8804('0xf'));var toCsv=require(_0x8804('0x9'));var querystring=require('querystring');var Papa=require(_0x8804('0x10'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x8804('0x11'));var authService=require(_0x8804('0x12'));var qs=require(_0x8804('0x13'));var as=require(_0x8804('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8804('0x15'));var utils=require(_0x8804('0x16'));var config=require(_0x8804('0x17'));var licenseUtil=require(_0x8804('0x18'));var db=require(_0x8804('0x19'))['db'];function respondWithStatusCode(_0x3657ea,_0x39ae0d){_0x39ae0d=_0x39ae0d||0xcc;return function(_0x2c7f7c){if(_0x2c7f7c){return _0x3657ea[_0x8804('0x1a')](_0x39ae0d);}return _0x3657ea['status'](_0x39ae0d)[_0x8804('0x1b')]();};}function respondWithResult(_0x2a8d11,_0x3b564e){_0x3b564e=_0x3b564e||0xc8;return function(_0x49a08f){if(_0x49a08f){return _0x2a8d11['status'](_0x3b564e)[_0x8804('0x1c')](_0x49a08f);}};}function respondWithFilteredResult(_0x20dac4,_0x306b39){return function(_0x1f86a9){if(_0x1f86a9){var _0x552af1=typeof _0x306b39['offset']===_0x8804('0x1d')&&typeof _0x306b39['limit']===_0x8804('0x1d');var _0x4281f8=_0x1f86a9[_0x8804('0x1e')];var _0x2120d0=_0x552af1?0x0:_0x306b39['offset'];var _0x1ba99e=_0x552af1?_0x1f86a9['count']:_0x306b39[_0x8804('0x1f')]+_0x306b39[_0x8804('0x20')];var _0x550068;if(_0x1ba99e>=_0x4281f8){_0x1ba99e=_0x4281f8;_0x550068=0xc8;}else{_0x550068=0xce;}_0x20dac4[_0x8804('0x21')](_0x550068);return _0x20dac4[_0x8804('0x22')](_0x8804('0x23'),_0x2120d0+'-'+_0x1ba99e+'/'+_0x4281f8)[_0x8804('0x1c')](_0x1f86a9);}return null;};}function patchUpdates(_0x1f39e2){return function(_0x290b7a){try{jsonpatch['apply'](_0x290b7a,_0x1f39e2,!![]);}catch(_0xb808f9){return BPromise[_0x8804('0x24')](_0xb808f9);}return _0x290b7a['save']();};}function saveUpdates(_0x5604a4,_0xae961a){return function(_0x24e845){if(_0x24e845){return _0x24e845[_0x8804('0x25')](_0x5604a4)[_0x8804('0x26')](function(_0x3816a3){return _0x3816a3;});}return null;};}function removeEntity(_0xcfe82c,_0x4b17d5){return function(_0x158864){if(_0x158864){return _0x158864['destroy']()['then'](function(){_0xcfe82c['status'](0xcc)[_0x8804('0x1b')]();});}};}function handleEntityNotFound(_0x4ec645,_0x3cb08f){return function(_0x54e0dd){if(!_0x54e0dd){_0x4ec645[_0x8804('0x1a')](0x194);}return _0x54e0dd;};}function handleError(_0x1eaa2f,_0x369894){_0x369894=_0x369894||0x1f4;return function(_0x3f1f48){logger[_0x8804('0x27')](_0x3f1f48[_0x8804('0x28')]);if(_0x3f1f48[_0x8804('0x29')]){delete _0x3f1f48[_0x8804('0x29')];}_0x1eaa2f[_0x8804('0x21')](_0x369894)[_0x8804('0x2a')](_0x3f1f48);};}exports[_0x8804('0x2b')]=function(_0x5cf056,_0x4046b5){var _0x144820={},_0xb51b39={},_0x5827a3={'count':0x0,'rows':[]};var _0x1717f6=_[_0x8804('0x2c')](db['VoiceRecording'][_0x8804('0x2d')],function(_0x15faef){return{'name':_0x15faef[_0x8804('0x2e')],'type':_0x15faef[_0x8804('0x2f')][_0x8804('0x30')]};});_0xb51b39['model']=_[_0x8804('0x31')](_[_0x8804('0x2c')](_0x1717f6,_0x8804('0x29')),[_0x8804('0x32')]);_0xb51b39[_0x8804('0x33')]=_[_0x8804('0x34')](_0x5cf056[_0x8804('0x33')]);_0xb51b39[_0x8804('0x35')]=_[_0x8804('0x36')](_0xb51b39[_0x8804('0x37')],_0xb51b39[_0x8804('0x33')]);_0x144820[_0x8804('0x38')]=_[_0x8804('0x36')](_0xb51b39['model'],qs[_0x8804('0x39')](_0x5cf056[_0x8804('0x33')][_0x8804('0x39')]));_0x144820['attributes']=_0x144820[_0x8804('0x38')][_0x8804('0x3a')]?_0x144820[_0x8804('0x38')]:_0xb51b39[_0x8804('0x37')];if(!_0x5cf056[_0x8804('0x33')][_0x8804('0x3b')]('nolimit')){_0x144820[_0x8804('0x20')]=qs[_0x8804('0x20')](_0x5cf056[_0x8804('0x33')]['limit']);_0x144820[_0x8804('0x1f')]=qs[_0x8804('0x1f')](_0x5cf056[_0x8804('0x33')]['offset']);}_0x144820['order']=qs['sort'](_0x5cf056[_0x8804('0x33')][_0x8804('0x3c')]);_0x144820[_0x8804('0x3d')]=qs[_0x8804('0x35')](_[_0x8804('0x3e')](_0x5cf056[_0x8804('0x33')],_0xb51b39[_0x8804('0x35')]),_0x1717f6);if(_0x5cf056[_0x8804('0x33')][_0x8804('0x3f')]){_0x144820[_0x8804('0x3d')]=_[_0x8804('0x40')](_0x144820[_0x8804('0x3d')],{'$or':_['map'](_0x1717f6,function(_0x2dd6d4){if(_0x2dd6d4[_0x8804('0x2f')]!==_0x8804('0x41')){var _0x4b9e32={};_0x4b9e32[_0x2dd6d4[_0x8804('0x29')]]={'$like':'%'+_0x5cf056[_0x8804('0x33')][_0x8804('0x3f')]+'%'};return _0x4b9e32;}})});}_0x144820=_[_0x8804('0x40')]({},_0x144820,_0x5cf056[_0x8804('0x42')]);var _0x24dda5={'where':_0x144820['where']};return db[_0x8804('0x43')][_0x8804('0x1e')](_0x24dda5)['then'](function(_0x2040aa){_0x5827a3[_0x8804('0x1e')]=_0x2040aa;if(_0x5cf056[_0x8804('0x33')][_0x8804('0x44')]){_0x144820['include']=[{'all':!![]}];}return db[_0x8804('0x43')][_0x8804('0x45')](_0x144820);})['then'](function(_0x457a06){_0x5827a3[_0x8804('0x46')]=_0x457a06;return _0x5827a3;})[_0x8804('0x26')](respondWithFilteredResult(_0x4046b5,_0x144820))[_0x8804('0x47')](handleError(_0x4046b5,null));};exports[_0x8804('0x48')]=function(_0x1adfed,_0x584e54){var _0x265c8a={'raw':![],'where':{'id':_0x1adfed[_0x8804('0x49')]['id']}},_0x52d588={};_0x52d588[_0x8804('0x37')]=_[_0x8804('0x34')](db['VoiceRecording'][_0x8804('0x2d')]);_0x52d588[_0x8804('0x33')]=_[_0x8804('0x34')](_0x1adfed[_0x8804('0x33')]);_0x52d588[_0x8804('0x35')]=_[_0x8804('0x36')](_0x52d588[_0x8804('0x37')],_0x52d588[_0x8804('0x33')]);_0x265c8a[_0x8804('0x38')]=_[_0x8804('0x36')](_0x52d588[_0x8804('0x37')],qs['fields'](_0x1adfed[_0x8804('0x33')]['fields']));_0x265c8a[_0x8804('0x38')]=_0x265c8a['attributes'][_0x8804('0x3a')]?_0x265c8a['attributes']:_0x52d588[_0x8804('0x37')];if(_0x1adfed['query'][_0x8804('0x44')]){_0x265c8a['include']=[{'all':!![]}];}_0x265c8a=_['merge']({},_0x265c8a,_0x1adfed[_0x8804('0x42')]);return db[_0x8804('0x43')]['find'](_0x265c8a)[_0x8804('0x26')](handleEntityNotFound(_0x584e54,null))[_0x8804('0x26')](respondWithResult(_0x584e54,null))['catch'](handleError(_0x584e54,null));};exports[_0x8804('0x4a')]=function(_0xb17ea3,_0x6ffeef){return db[_0x8804('0x43')]['create'](_0xb17ea3[_0x8804('0x4b')],{})[_0x8804('0x26')](respondWithResult(_0x6ffeef,0xc9))['catch'](handleError(_0x6ffeef,null));};exports[_0x8804('0x25')]=function(_0x2b08eb,_0x5a70aa){if(_0x2b08eb[_0x8804('0x4b')]['id']){delete _0x2b08eb[_0x8804('0x4b')]['id'];}return db['VoiceRecording'][_0x8804('0x4c')]({'where':{'id':_0x2b08eb[_0x8804('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a70aa,null))['then'](saveUpdates(_0x2b08eb[_0x8804('0x4b')],null))[_0x8804('0x26')](respondWithResult(_0x5a70aa,null))[_0x8804('0x47')](handleError(_0x5a70aa,null));};exports[_0x8804('0x4d')]=function(_0x4bc140,_0x198706){return db[_0x8804('0x43')][_0x8804('0x4d')]()[_0x8804('0x26')](respondWithResult(_0x198706,null))['catch'](handleError(_0x198706,null));};exports[_0x8804('0x4e')]=function(_0x5b6d4c,_0xd816e2,_0x4ec45e){var _0x370e9c=require('../../components/encryptor');var _0x54ab96=![];var _0x5e7766={};if(_0x5b6d4c[_0x8804('0x33')]['type']&&_0x5b6d4c['query'][_0x8804('0x2f')]===_0x8804('0x4f')){_0x5e7766[_0x8804('0x4f')]=_0x5b6d4c[_0x8804('0x49')]['id'];}else{_0x5e7766['id']=_0x5b6d4c[_0x8804('0x49')]['id'];}return db[_0x8804('0x43')][_0x8804('0x4c')]({'where':_0x5e7766,'attributes':['id',_0x8804('0x50')],'raw':!![]})[_0x8804('0x26')](handleEntityNotFound(_0xd816e2,null))[_0x8804('0x26')](function(_0x51cac0){if(_0x51cac0){var _0x269285=_0x51cac0['value'];var _0x3be734=util['format']('%s.cypher',_0x269285);if(fs[_0x8804('0x51')](_0x3be734)){_0x54ab96=!![];return _0x370e9c['decryptFile'](_0x3be734,_0x269285,config[_0x8804('0x52')][_0x8804('0x53')])[_0x8804('0x26')](function(){return _0x51cac0;});}return _0x51cac0;}})['then'](function(_0x3e7814){if(_0x3e7814){var _0x4a7f84=_0x3e7814[_0x8804('0x50')];if(!fs[_0x8804('0x51')](_0x4a7f84)){throw new db['Sequelize'][(_0x8804('0x54'))](_0x8804('0x55'));}if(_0x3e7814[_0x8804('0x56')]){return _0xd816e2[_0x8804('0x4e')](_0x4a7f84,_0x3e7814[_0x8804('0x56')]+path[_0x8804('0x57')](_0x4a7f84),function(){if(_0x54ab96){fs['unlink'](_0x4a7f84);}});}else{return _0xd816e2[_0x8804('0x4e')](_0x4a7f84,function(_0x5ea199){if(_0x54ab96){fs['unlink'](_0x4a7f84);}});}}})[_0x8804('0x47')](function(_0x508186){if(_0x508186[_0x8804('0x58')]===_0x8804('0x55')){_0xd816e2['status'](0x194)[_0x8804('0x2a')](_0x8804('0x59'));}else{return handleError(_0xd816e2,null);}});};exports[_0x8804('0x5a')]=function(_0x59ab3d,_0xcadc6e,_0x4004e6){var _0x415499=require(_0x8804('0x5b'));var _0x36e120=![];var _0x543737={'$and':[db['sequelize'][_0x8804('0x3d')](db[_0x8804('0x5c')]['fn'](_0x8804('0x5d'),db[_0x8804('0x5c')][_0x8804('0x5e')]('uniqueid')),_0x59ab3d['query']['token'])]};if(_0x59ab3d[_0x8804('0x33')][_0x8804('0x2f')]&&_0x59ab3d[_0x8804('0x33')][_0x8804('0x2f')]==='uniqueid'){_0x543737[_0x8804('0x5f')][_0x8804('0x60')]({'uniqueid':_0x59ab3d[_0x8804('0x49')]['id']});}else{_0x543737['$and'][_0x8804('0x60')]({'id':_0x59ab3d[_0x8804('0x49')]['id']});}return db[_0x8804('0x43')][_0x8804('0x4c')]({'where':_0x543737,'attributes':['id',_0x8804('0x50')],'raw':!![]})[_0x8804('0x26')](handleEntityNotFound(_0xcadc6e,null))[_0x8804('0x26')](function(_0x31ab75){if(_0x31ab75){var _0x58144b=util['format'](_0x8804('0x61'),_0x31ab75[_0x8804('0x50')]);if(fs[_0x8804('0x51')](_0x58144b)){_0x36e120=!![];return _0x415499[_0x8804('0x62')](_0x58144b,_0x31ab75[_0x8804('0x50')],config[_0x8804('0x52')][_0x8804('0x53')])[_0x8804('0x26')](function(){return _0x31ab75;});}return _0x31ab75;}})['then'](function(_0x91722){if(_0x91722){if(!fs[_0x8804('0x51')](_0x91722['value'])){throw new db[(_0x8804('0x63'))]['ValidationError'](_0x8804('0x55'));}if(_0x91722[_0x8804('0x56')]){return _0xcadc6e[_0x8804('0x4e')](_0x91722['value'],_0x91722['filename']+path[_0x8804('0x57')](_0x91722['value']),function(){if(_0x36e120){fs[_0x8804('0x64')](_0x91722['value']);}});}else{return _0xcadc6e['download'](_0x91722[_0x8804('0x50')],function(_0x31ab3c){if(_0x36e120){fs[_0x8804('0x64')](_0x91722['value']);}});}}})['catch'](handleError(_0xcadc6e,null));};exports[_0x8804('0x65')]=function(_0x32d585,_0x39cc0b){return db[_0x8804('0x43')][_0x8804('0x4c')]({'where':{'id':_0x32d585[_0x8804('0x49')]['id']}})[_0x8804('0x26')](function(_0x20f214){if(_[_0x8804('0x66')](_0x20f214)){throw new ReferenceError(_0x8804('0x67'));}return _0x20f214;})[_0x8804('0x26')](function(_0x4b6d45){var _0x136ed7=_0x4b6d45[_0x8804('0x50')];logger[_0x8804('0x68')](_0x8804('0x69'),_0x136ed7);if(!_['isNil'](_0x4b6d45[_0x8804('0x50')])&&fs[_0x8804('0x51')](_0x136ed7)){logger[_0x8804('0x68')]('File:\x20\x22'+_0x136ed7+_0x8804('0x6a'));fs[_0x8804('0x6b')](_0x136ed7);}_0x136ed7=_0x136ed7+_0x8804('0x6c');if(!_[_0x8804('0x66')](_0x4b6d45[_0x8804('0x50')])&&fs['existsSync'](_0x136ed7)){logger[_0x8804('0x68')](_0x8804('0x6d')+_0x136ed7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8804('0x6b')](_0x136ed7);}return _0x4b6d45;})[_0x8804('0x26')](function(_0x4b8a29){if(!_0x4b8a29)throw new InternalError();return _0x4b8a29['destroy']();})['then'](function(){_0x39cc0b['status'](0xcc)[_0x8804('0x1b')]();})[_0x8804('0x47')](handleError(_0x39cc0b,null));};function getBucketslist(_0x30e16a,_0x3f146d,_0x3ea69b){return new Promise(function(_0x532c2e,_0x28bd32){var _0x4605e1=new AWS['S3']({'accessKeyId':_0x3f146d,'secretAccessKey':_0x30e16a,'region':_0x3ea69b});_0x4605e1[_0x8804('0x6e')]({},function(_0xeb1820,_0x5f3b3d){if(_0xeb1820){return _0x28bd32(_0xeb1820);}else{return _0x532c2e(_0x5f3b3d);}});});}function createBucket(_0x32f9b4,_0x4fa42b,_0x58249e,_0x42d678){return new Promise(function(_0xe3614d,_0x2dd24d){var _0x281412=new AWS['S3']({'accessKeyId':_0x4fa42b,'secretAccessKey':_0x32f9b4,'region':_0x58249e});_0x281412[_0x8804('0x6f')]({'Bucket':_0x42d678},function(_0x3fd37b,_0x592401){if(_0x3fd37b){return _0x2dd24d(_0x3fd37b);}else{return _0xe3614d(_0x592401);}});});}function uploadFile(_0x39bdc9,_0x511db9,_0xe0e49c,_0x54744a,_0x49c71c,_0x41ad86){return new Promise(function(_0x2baa88,_0x11dc2a){var _0x3bd79d=new AWS['S3']({'accessKeyId':_0x511db9,'secretAccessKey':_0x39bdc9,'region':_0xe0e49c});_0x3bd79d[_0x8804('0x70')]({'Bucket':_0x54744a,'Key':_0x49c71c,'Body':_0x41ad86},function(_0x5de777,_0x26c575){if(_0x5de777){return _0x11dc2a(_0x5de777);}else{return _0x2baa88(_0x26c575);}});});}function startTranscribe(_0x14da96,_0x30f9c7,_0xe7f52,_0x3bce65,_0x23786f,_0x3981b1){return new Promise(function(_0xf01fd5,_0x6b2db7){var _0x3ae29a=new AWS['TranscribeService']({'accessKeyId':_0x30f9c7,'secretAccessKey':_0x14da96,'region':_0xe7f52});_0x3ae29a['startTranscriptionJob']({'TranscriptionJobName':_0x3bce65,'LanguageCode':_0x23786f,'Media':{'MediaFileUri':_0x3981b1}},function(_0xcbda9b,_0x11fc1d){if(_0xcbda9b){return _0x6b2db7(_0xcbda9b);}else{return _0xf01fd5(_0x11fc1d);}});});}function transcribe(_0xd1e627,_0x4d1b4b,_0x1c2e7f,_0x5b6979,_0x5e5314,_0x30f7ea,_0x34404f){return new Promise(function(_0xe2b47a,_0x12b1bc){var _0x269c7c={};logger[_0x8804('0x68')](util[_0x8804('0x32')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xd1e627,_0x5e5314));return uploadFile(_0x4d1b4b,_0x1c2e7f,_0x5b6979,_0x5e5314,path[_0x8804('0x71')](_0x30f7ea),fs['readFileSync'](_0x30f7ea))['then'](function(_0x5edbea){logger[_0x8804('0x68')](util[_0x8804('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xd1e627,_0x5e5314,_0x5edbea[_0x8804('0x72')]));_0x269c7c['bucket']=_0x5edbea[_0x8804('0x73')];_0x269c7c[_0x8804('0x74')]=_0x5edbea[_0x8804('0x72')];logger[_0x8804('0x68')](util[_0x8804('0x32')](_0x8804('0x75'),_0xd1e627));return startTranscribe(_0x4d1b4b,_0x1c2e7f,_0x5b6979,uuidv4(),_0x34404f,_0x5edbea[_0x8804('0x72')]);})[_0x8804('0x26')](function(_0x4cc45d){logger[_0x8804('0x68')](util[_0x8804('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xd1e627,_0x4cc45d[_0x8804('0x76')][_0x8804('0x77')]));_0x269c7c[_0x8804('0x78')]=_0x4cc45d['TranscriptionJob'][_0x8804('0x77')];_0x269c7c['transcribeStatus']=_0x4cc45d[_0x8804('0x76')][_0x8804('0x79')];return _0xe2b47a(_0x269c7c);})[_0x8804('0x47')](function(_0x3e9ebe){return _0x12b1bc(_0x3e9ebe);});});}exports[_0x8804('0x7a')]=function(_0x2408f4,_0x1713a2,_0x4f2933){var _0x27ab23;var _0x44a8f9;var _0x417971;var _0x1c5515=require('../../components/encryptor');return db['VoiceRecording'][_0x8804('0x7b')]({'where':{'id':_0x2408f4[_0x8804('0x49')]['id']}})[_0x8804('0x26')](function(_0x230d41){if(_0x230d41){var _0x4d191c=util[_0x8804('0x32')](_0x8804('0x61'),_0x230d41[_0x8804('0x50')]);if(fs[_0x8804('0x51')](_0x4d191c)){cypher=!![];return _0x1c5515[_0x8804('0x62')](_0x4d191c,_0x230d41[_0x8804('0x50')],config[_0x8804('0x52')][_0x8804('0x53')])[_0x8804('0x26')](function(){return _0x230d41;});}return _0x230d41;}})[_0x8804('0x26')](function(_0x59f97b){if(!_0x59f97b){throw new db['Sequelize'][(_0x8804('0x54'))](_0x8804('0x7c'));}_0x44a8f9=_0x59f97b;return db[_0x8804('0x7d')][_0x8804('0x7b')]({'where':{'id':0x1}});})[_0x8804('0x26')](handleEntityNotFound(_0x1713a2,null))[_0x8804('0x26')](function(_0xc0f0de){if(_0xc0f0de){_0x27ab23=_0xc0f0de;if(!_0x27ab23[_0x8804('0x7e')]||!_0x27ab23[_0x8804('0x7f')]||!_0x27ab23['transcribeRegion']||!_0x27ab23[_0x8804('0x80')]||!_0x27ab23[_0x8804('0x81')]){throw new db[(_0x8804('0x63'))][(_0x8804('0x54'))](_0x8804('0x82'));}if(_0x2408f4[_0x8804('0x4b')]['runSentiment']&&(!_0x27ab23[_0x8804('0x83')]||!_0x27ab23[_0x8804('0x84')]||!_0x27ab23['sentimentRegion']||!_0x27ab23[_0x8804('0x80')]||!_0x27ab23['bucket'])){throw new db[(_0x8804('0x63'))][(_0x8804('0x54'))](_0x8804('0x85'));}return db[_0x8804('0x86')][_0x8804('0x7b')]({'where':{'id':_0x27ab23['transcribeAccountId']}});}})[_0x8804('0x26')](function(_0x429808){if(!_0x429808){throw new db[(_0x8804('0x63'))][(_0x8804('0x54'))](_0x8804('0x87'));}if(!_0x429808[_0x8804('0x88')]||!_0x429808[_0x8804('0x89')]){throw new db[(_0x8804('0x63'))][(_0x8804('0x54'))](_0x8804('0x8a'));}_0x417971=_0x429808;return getBucketslist(_0x417971[_0x8804('0x88')],_0x417971[_0x8804('0x89')],_0x27ab23['transcribeRegion']);})[_0x8804('0x26')](function(_0x598cd5){if(_0x598cd5&&_0x598cd5[_0x8804('0x8b')]){var _0x212eca=_[_0x8804('0x4c')](_0x598cd5[_0x8804('0x8b')],function(_0x571c32){return _0x571c32[_0x8804('0x8c')]===_0x27ab23[_0x8804('0x81')];});if(!_0x212eca){logger['info'](util[_0x8804('0x32')](_0x8804('0x8d'),_0x2408f4['params']['id'],_0x27ab23[_0x8804('0x81')]));return createBucket(_0x417971[_0x8804('0x88')],_0x417971['data2'],_0x27ab23['transcribeRegion'],_0x27ab23[_0x8804('0x81')]);}logger['info'](util[_0x8804('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x2408f4['params']['id'],_0x27ab23['bucket']));return;}})[_0x8804('0x26')](function(_0x3385ae){if(_0x44a8f9[_0x8804('0x8e')]==='NEW'){return transcribe(_0x2408f4[_0x8804('0x49')]['id'],_0x417971[_0x8804('0x88')],_0x417971[_0x8804('0x89')],_0x27ab23[_0x8804('0x8f')],_0x27ab23[_0x8804('0x81')],_0x44a8f9[_0x8804('0x50')],_0x27ab23[_0x8804('0x80')]);}else{logger[_0x8804('0x68')](util[_0x8804('0x32')](_0x8804('0x90'),_0x2408f4[_0x8804('0x49')]['id']));return{'transcribeStatus':_0x8804('0x91')};}})[_0x8804('0x26')](function(_0x324b93){if(_0x324b93){_0x324b93['tempSentiment']=_0x2408f4['body'][_0x8804('0x92')];return _0x44a8f9[_0x8804('0x93')](_0x324b93);}})[_0x8804('0x26')](respondWithResult(_0x1713a2,null))[_0x8804('0x47')](handleError(_0x1713a2,null));};function writeFile(_0x31e55d,_0x3dcf2a){return new Promise(function(_0x827648,_0xfb2d95){fs['writeFile'](_0x3dcf2a,_0x31e55d,function(_0x250aca,_0x3fb83d){if(_0x250aca){return _0xfb2d95(_0x250aca);}else{return _0x827648(_0x3fb83d);}});});}exports['downloadTranscribe']=function(_0x6c0704,_0x18436c,_0x48a192){return db['VoiceRecording']['findOne']({'where':{'id':_0x6c0704['params']['id']}})['then'](handleEntityNotFound(_0x18436c))[_0x8804('0x26')](function(_0x5fe45b){if(_0x5fe45b&&_0x5fe45b[_0x8804('0x94')]){var _0x1b500e=_0x5fe45b[_0x8804('0x94')];var _0x35f61f=config[_0x8804('0x95')]+'/server/files/transcribes/transcribe_'+_0x5fe45b['id']+_0x8804('0x96');if(fs[_0x8804('0x51')](_0x35f61f)){return _0x35f61f;}return writeFile(_0x1b500e,_0x35f61f)[_0x8804('0x26')](function(){return _0x35f61f;});}else{throw new db[(_0x8804('0x63'))][(_0x8804('0x54'))]('Transcript\x20not\x20available');}})[_0x8804('0x26')](function(_0x3f6c66){return _0x18436c[_0x8804('0x4e')](_0x3f6c66);})['catch'](handleError(_0x18436c));}; \ No newline at end of file +var _0xab8e=['format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','type','VIRTUAL','filter','options','includeAll','VoiceRecording','findAll','show','params','include','find','create','catch','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','download','filename','extname','message','Not\x20found','downloads','sequelize','$and','push','unlink','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','ValidationError','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeRegion','language','Transcribe\x20not\x20configured','sentimentAccountId','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','name','send','rawAttributes','fieldName','model'];(function(_0x207d76,_0x53433a){var _0x2b616e=function(_0x51b36b){while(--_0x51b36b){_0x207d76['push'](_0x207d76['shift']());}};_0x2b616e(++_0x53433a);}(_0xab8e,0x64));var _0xeab8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xab8e[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeab8('0x0'));var zipdir=require(_0xeab8('0x1'));var jsonpatch=require(_0xeab8('0x2'));var rp=require(_0xeab8('0x3'));var moment=require(_0xeab8('0x4'));var BPromise=require(_0xeab8('0x5'));var Mustache=require(_0xeab8('0x6'));var util=require(_0xeab8('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeab8('0x8'));var fs=require('fs');var fs_extra=require(_0xeab8('0x9'));var _=require(_0xeab8('0xa'));var squel=require(_0xeab8('0xb'));var crypto=require(_0xeab8('0xc'));var jsforce=require(_0xeab8('0xd'));var deskjs=require(_0xeab8('0xe'));var toCsv=require(_0xeab8('0xf'));var querystring=require(_0xeab8('0x10'));var Papa=require(_0xeab8('0x11'));var AWS=require(_0xeab8('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0xeab8('0x13'));var authService=require(_0xeab8('0x14'));var qs=require(_0xeab8('0x15'));var as=require(_0xeab8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xeab8('0x17'));var config=require(_0xeab8('0x18'));var licenseUtil=require(_0xeab8('0x19'));var db=require(_0xeab8('0x1a'))['db'];function respondWithStatusCode(_0x472470,_0x51d35e){_0x51d35e=_0x51d35e||0xcc;return function(_0x37e6d4){if(_0x37e6d4){return _0x472470['sendStatus'](_0x51d35e);}return _0x472470['status'](_0x51d35e)[_0xeab8('0x1b')]();};}function respondWithResult(_0xe660cd,_0x2d2667){_0x2d2667=_0x2d2667||0xc8;return function(_0x94fce3){if(_0x94fce3){return _0xe660cd[_0xeab8('0x1c')](_0x2d2667)['json'](_0x94fce3);}};}function respondWithFilteredResult(_0x4cf7da,_0x4d4371){return function(_0xc2826){if(_0xc2826){var _0x5ef241=typeof _0x4d4371[_0xeab8('0x1d')]===_0xeab8('0x1e')&&typeof _0x4d4371[_0xeab8('0x1f')]===_0xeab8('0x1e');var _0x486391=_0xc2826['count'];var _0x233a39=_0x5ef241?0x0:_0x4d4371[_0xeab8('0x1d')];var _0x108312=_0x5ef241?_0xc2826[_0xeab8('0x20')]:_0x4d4371[_0xeab8('0x1d')]+_0x4d4371[_0xeab8('0x1f')];var _0x5a3088;if(_0x108312>=_0x486391){_0x108312=_0x486391;_0x5a3088=0xc8;}else{_0x5a3088=0xce;}_0x4cf7da[_0xeab8('0x1c')](_0x5a3088);return _0x4cf7da[_0xeab8('0x21')](_0xeab8('0x22'),_0x233a39+'-'+_0x108312+'/'+_0x486391)[_0xeab8('0x23')](_0xc2826);}return null;};}function patchUpdates(_0x36401e){return function(_0x5bb73f){try{jsonpatch[_0xeab8('0x24')](_0x5bb73f,_0x36401e,!![]);}catch(_0x68fa5a){return BPromise[_0xeab8('0x25')](_0x68fa5a);}return _0x5bb73f['save']();};}function saveUpdates(_0x112ee8,_0x304c0c){return function(_0x5ad183){if(_0x5ad183){return _0x5ad183[_0xeab8('0x26')](_0x112ee8)[_0xeab8('0x27')](function(_0x231438){return _0x231438;});}return null;};}function removeEntity(_0x59798e,_0x2fb43e){return function(_0x35a227){if(_0x35a227){return _0x35a227[_0xeab8('0x28')]()[_0xeab8('0x27')](function(){_0x59798e[_0xeab8('0x1c')](0xcc)[_0xeab8('0x1b')]();});}};}function handleEntityNotFound(_0x2595bc,_0x128265){return function(_0x2a9368){if(!_0x2a9368){_0x2595bc[_0xeab8('0x29')](0x194);}return _0x2a9368;};}function handleError(_0xe4d8a3,_0x34e397){_0x34e397=_0x34e397||0x1f4;return function(_0x42984d){logger['error'](_0x42984d['stack']);if(_0x42984d[_0xeab8('0x2a')]){delete _0x42984d[_0xeab8('0x2a')];}_0xe4d8a3[_0xeab8('0x1c')](_0x34e397)[_0xeab8('0x2b')](_0x42984d);};}exports['index']=function(_0x544f43,_0x11a687){var _0x4ee883={},_0x2020af={},_0x4bedd4={'count':0x0,'rows':[]};var _0x14a1ac=_['map'](db['VoiceRecording'][_0xeab8('0x2c')],function(_0x20d8a4){return{'name':_0x20d8a4[_0xeab8('0x2d')],'type':_0x20d8a4['type']['key']};});_0x2020af[_0xeab8('0x2e')]=_['differenceBy'](_['map'](_0x14a1ac,'name'),[_0xeab8('0x2f')]);_0x2020af[_0xeab8('0x30')]=_[_0xeab8('0x31')](_0x544f43[_0xeab8('0x30')]);_0x2020af['filters']=_[_0xeab8('0x32')](_0x2020af[_0xeab8('0x2e')],_0x2020af[_0xeab8('0x30')]);_0x4ee883[_0xeab8('0x33')]=_['intersection'](_0x2020af[_0xeab8('0x2e')],qs[_0xeab8('0x34')](_0x544f43[_0xeab8('0x30')][_0xeab8('0x34')]));_0x4ee883[_0xeab8('0x33')]=_0x4ee883['attributes'][_0xeab8('0x35')]?_0x4ee883[_0xeab8('0x33')]:_0x2020af[_0xeab8('0x2e')];if(!_0x544f43[_0xeab8('0x30')][_0xeab8('0x36')](_0xeab8('0x37'))){_0x4ee883[_0xeab8('0x1f')]=qs[_0xeab8('0x1f')](_0x544f43[_0xeab8('0x30')][_0xeab8('0x1f')]);_0x4ee883['offset']=qs[_0xeab8('0x1d')](_0x544f43[_0xeab8('0x30')][_0xeab8('0x1d')]);}_0x4ee883['order']=qs[_0xeab8('0x38')](_0x544f43[_0xeab8('0x30')][_0xeab8('0x38')]);_0x4ee883[_0xeab8('0x39')]=qs[_0xeab8('0x3a')](_[_0xeab8('0x3b')](_0x544f43[_0xeab8('0x30')],_0x2020af[_0xeab8('0x3a')]),_0x14a1ac);if(_0x544f43[_0xeab8('0x30')]['filter']){_0x4ee883['where']=_[_0xeab8('0x3c')](_0x4ee883['where'],{'$or':_[_0xeab8('0x3d')](_0x14a1ac,function(_0x382b17){if(_0x382b17[_0xeab8('0x3e')]!==_0xeab8('0x3f')){var _0x54e6d7={};_0x54e6d7[_0x382b17[_0xeab8('0x2a')]]={'$like':'%'+_0x544f43['query'][_0xeab8('0x40')]+'%'};return _0x54e6d7;}})});}_0x4ee883=_['merge']({},_0x4ee883,_0x544f43[_0xeab8('0x41')]);var _0x51e67f={'where':_0x4ee883['where']};return db['VoiceRecording']['count'](_0x51e67f)['then'](function(_0x16167f){_0x4bedd4['count']=_0x16167f;if(_0x544f43[_0xeab8('0x30')][_0xeab8('0x42')]){_0x4ee883['include']=[{'all':!![]}];}return db[_0xeab8('0x43')][_0xeab8('0x44')](_0x4ee883);})[_0xeab8('0x27')](function(_0x2ba129){_0x4bedd4['rows']=_0x2ba129;return _0x4bedd4;})[_0xeab8('0x27')](respondWithFilteredResult(_0x11a687,_0x4ee883))['catch'](handleError(_0x11a687,null));};exports[_0xeab8('0x45')]=function(_0x28fe32,_0x28a462){var _0x225d5f={'raw':![],'where':{'id':_0x28fe32[_0xeab8('0x46')]['id']}},_0x4fd036={};_0x4fd036[_0xeab8('0x2e')]=_['keys'](db['VoiceRecording'][_0xeab8('0x2c')]);_0x4fd036[_0xeab8('0x30')]=_[_0xeab8('0x31')](_0x28fe32[_0xeab8('0x30')]);_0x4fd036[_0xeab8('0x3a')]=_[_0xeab8('0x32')](_0x4fd036[_0xeab8('0x2e')],_0x4fd036[_0xeab8('0x30')]);_0x225d5f[_0xeab8('0x33')]=_[_0xeab8('0x32')](_0x4fd036[_0xeab8('0x2e')],qs['fields'](_0x28fe32['query'][_0xeab8('0x34')]));_0x225d5f[_0xeab8('0x33')]=_0x225d5f[_0xeab8('0x33')]['length']?_0x225d5f['attributes']:_0x4fd036[_0xeab8('0x2e')];if(_0x28fe32[_0xeab8('0x30')][_0xeab8('0x42')]){_0x225d5f[_0xeab8('0x47')]=[{'all':!![]}];}_0x225d5f=_[_0xeab8('0x3c')]({},_0x225d5f,_0x28fe32[_0xeab8('0x41')]);return db[_0xeab8('0x43')][_0xeab8('0x48')](_0x225d5f)[_0xeab8('0x27')](handleEntityNotFound(_0x28a462,null))[_0xeab8('0x27')](respondWithResult(_0x28a462,null))['catch'](handleError(_0x28a462,null));};exports[_0xeab8('0x49')]=function(_0x361171,_0x41d939){return db[_0xeab8('0x43')][_0xeab8('0x49')](_0x361171['body'],{})[_0xeab8('0x27')](respondWithResult(_0x41d939,0xc9))[_0xeab8('0x4a')](handleError(_0x41d939,null));};exports[_0xeab8('0x26')]=function(_0x576c57,_0x5e3866){if(_0x576c57[_0xeab8('0x4b')]['id']){delete _0x576c57[_0xeab8('0x4b')]['id'];}return db[_0xeab8('0x43')][_0xeab8('0x48')]({'where':{'id':_0x576c57[_0xeab8('0x46')]['id']}})[_0xeab8('0x27')](handleEntityNotFound(_0x5e3866,null))['then'](saveUpdates(_0x576c57['body'],null))['then'](respondWithResult(_0x5e3866,null))['catch'](handleError(_0x5e3866,null));};exports[_0xeab8('0x4c')]=function(_0x3653d0,_0x2d3cec){return db[_0xeab8('0x43')][_0xeab8('0x4c')]()[_0xeab8('0x27')](respondWithResult(_0x2d3cec,null))[_0xeab8('0x4a')](handleError(_0x2d3cec,null));};exports['download']=function(_0x3070cd,_0x1593f9,_0x4c1a03){var _0x793c00=require(_0xeab8('0x4d'));var _0x5dbd72=![];var _0x18d0eb={};if(_0x3070cd[_0xeab8('0x30')][_0xeab8('0x3e')]&&_0x3070cd[_0xeab8('0x30')][_0xeab8('0x3e')]==='uniqueid'){_0x18d0eb[_0xeab8('0x4e')]=_0x3070cd[_0xeab8('0x46')]['id'];}else{_0x18d0eb['id']=_0x3070cd[_0xeab8('0x46')]['id'];}return db['VoiceRecording'][_0xeab8('0x48')]({'where':_0x18d0eb,'attributes':['id',_0xeab8('0x4f')],'raw':!![]})[_0xeab8('0x27')](handleEntityNotFound(_0x1593f9,null))[_0xeab8('0x27')](function(_0x24a4d6){if(_0x24a4d6){var _0x4478bf=_0x24a4d6[_0xeab8('0x4f')];var _0x23ad93=util[_0xeab8('0x2f')](_0xeab8('0x50'),_0x4478bf);if(fs[_0xeab8('0x51')](_0x23ad93)){_0x5dbd72=!![];return _0x793c00[_0xeab8('0x52')](_0x23ad93,_0x4478bf,config[_0xeab8('0x53')][_0xeab8('0x54')])['then'](function(){return _0x24a4d6;});}return _0x24a4d6;}})[_0xeab8('0x27')](function(_0xbcf871){if(_0xbcf871){var _0x28dc3c=_0xbcf871['value'];if(!fs[_0xeab8('0x51')](_0x28dc3c)){throw new db[(_0xeab8('0x55'))]['ValidationError'](_0xeab8('0x56'));}if(_0xbcf871['filename']){return _0x1593f9[_0xeab8('0x57')](_0x28dc3c,_0xbcf871[_0xeab8('0x58')]+path[_0xeab8('0x59')](_0x28dc3c),function(){if(_0x5dbd72){fs['unlink'](_0x28dc3c);}});}else{return _0x1593f9['download'](_0x28dc3c,function(_0x2dcd3b){if(_0x5dbd72){fs['unlink'](_0x28dc3c);}});}}})[_0xeab8('0x4a')](function(_0xbcd473){if(_0xbcd473[_0xeab8('0x5a')]===_0xeab8('0x56')){_0x1593f9[_0xeab8('0x1c')](0x194)['send'](_0xeab8('0x5b'));}else{return handleError(_0x1593f9,null);}});};exports[_0xeab8('0x5c')]=function(_0x1b738d,_0x333927,_0x4a8cdb){var _0x1161f2=require(_0xeab8('0x4d'));var _0xa005df=![];var _0x292da5={'$and':[db[_0xeab8('0x5d')]['where'](db[_0xeab8('0x5d')]['fn']('MD5',db[_0xeab8('0x5d')]['col'](_0xeab8('0x4e'))),_0x1b738d[_0xeab8('0x30')]['token'])]};if(_0x1b738d[_0xeab8('0x30')][_0xeab8('0x3e')]&&_0x1b738d[_0xeab8('0x30')][_0xeab8('0x3e')]==='uniqueid'){_0x292da5[_0xeab8('0x5e')][_0xeab8('0x5f')]({'uniqueid':_0x1b738d[_0xeab8('0x46')]['id']});}else{_0x292da5['$and'][_0xeab8('0x5f')]({'id':_0x1b738d[_0xeab8('0x46')]['id']});}return db['VoiceRecording'][_0xeab8('0x48')]({'where':_0x292da5,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x333927,null))[_0xeab8('0x27')](function(_0x4355fe){if(_0x4355fe){var _0x4885a4=util[_0xeab8('0x2f')]('%s.cypher',_0x4355fe[_0xeab8('0x4f')]);if(fs['existsSync'](_0x4885a4)){_0xa005df=!![];return _0x1161f2[_0xeab8('0x52')](_0x4885a4,_0x4355fe['value'],config[_0xeab8('0x53')][_0xeab8('0x54')])[_0xeab8('0x27')](function(){return _0x4355fe;});}return _0x4355fe;}})[_0xeab8('0x27')](function(_0x33ba65){if(_0x33ba65){if(!fs[_0xeab8('0x51')](_0x33ba65[_0xeab8('0x4f')])){throw new db[(_0xeab8('0x55'))]['ValidationError'](_0xeab8('0x56'));}if(_0x33ba65[_0xeab8('0x58')]){return _0x333927['download'](_0x33ba65[_0xeab8('0x4f')],_0x33ba65[_0xeab8('0x58')]+path[_0xeab8('0x59')](_0x33ba65[_0xeab8('0x4f')]),function(){if(_0xa005df){fs[_0xeab8('0x60')](_0x33ba65[_0xeab8('0x4f')]);}});}else{return _0x333927[_0xeab8('0x57')](_0x33ba65[_0xeab8('0x4f')],function(_0x1aa78a){if(_0xa005df){fs[_0xeab8('0x60')](_0x33ba65['value']);}});}}})[_0xeab8('0x4a')](handleError(_0x333927,null));};exports[_0xeab8('0x28')]=function(_0x1ad2ea,_0x56eb0c){return db[_0xeab8('0x43')][_0xeab8('0x48')]({'where':{'id':_0x1ad2ea[_0xeab8('0x46')]['id']}})[_0xeab8('0x27')](function(_0x5b5863){if(_['isNil'](_0x5b5863)){throw new ReferenceError(_0xeab8('0x61'));}return _0x5b5863;})[_0xeab8('0x27')](function(_0x53fafc){var _0x4eff91=_0x53fafc['value'];logger[_0xeab8('0x62')](_0xeab8('0x63'),_0x4eff91);if(!_[_0xeab8('0x64')](_0x53fafc[_0xeab8('0x4f')])&&fs[_0xeab8('0x51')](_0x4eff91)){logger[_0xeab8('0x62')]('File:\x20\x22'+_0x4eff91+_0xeab8('0x65'));fs[_0xeab8('0x66')](_0x4eff91);}_0x4eff91=_0x4eff91+_0xeab8('0x67');if(!_[_0xeab8('0x64')](_0x53fafc[_0xeab8('0x4f')])&&fs[_0xeab8('0x51')](_0x4eff91)){logger[_0xeab8('0x62')](_0xeab8('0x68')+_0x4eff91+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xeab8('0x66')](_0x4eff91);}return _0x53fafc;})[_0xeab8('0x27')](function(_0x444698){if(!_0x444698)throw new InternalError();return _0x444698[_0xeab8('0x28')]();})[_0xeab8('0x27')](function(){_0x56eb0c[_0xeab8('0x1c')](0xcc)[_0xeab8('0x1b')]();})[_0xeab8('0x4a')](handleError(_0x56eb0c,null));};function getBucketslist(_0x38ade4,_0x4b05c4,_0x107e61){return new Promise(function(_0x5d665f,_0x514793){var _0x146544=new AWS['S3']({'accessKeyId':_0x4b05c4,'secretAccessKey':_0x38ade4,'region':_0x107e61});_0x146544[_0xeab8('0x69')]({},function(_0x944b47,_0x54a724){if(_0x944b47){return _0x514793(_0x944b47);}else{return _0x5d665f(_0x54a724);}});});}function createBucket(_0x5c851c,_0x355ab6,_0x5d5a98,_0x443ddf){return new Promise(function(_0x302344,_0x43e5bb){var _0x387878=new AWS['S3']({'accessKeyId':_0x355ab6,'secretAccessKey':_0x5c851c,'region':_0x5d5a98});_0x387878[_0xeab8('0x6a')]({'Bucket':_0x443ddf},function(_0x5e6417,_0x3f68c6){if(_0x5e6417){return _0x43e5bb(_0x5e6417);}else{return _0x302344(_0x3f68c6);}});});}function uploadFile(_0x4da1e1,_0x27ac05,_0x4843c4,_0xdf2bb2,_0x32ef31,_0x48c057){return new Promise(function(_0x319a40,_0x3f7e73){var _0x261bd5=new AWS['S3']({'accessKeyId':_0x27ac05,'secretAccessKey':_0x4da1e1,'region':_0x4843c4});_0x261bd5[_0xeab8('0x6b')]({'Bucket':_0xdf2bb2,'Key':_0x32ef31,'Body':_0x48c057},function(_0x5dfa0b,_0x5aab11){if(_0x5dfa0b){return _0x3f7e73(_0x5dfa0b);}else{return _0x319a40(_0x5aab11);}});});}function startTranscribe(_0x248c4f,_0x22de4b,_0x33e129,_0x1073f3,_0x314c5a,_0x5df6a4){return new Promise(function(_0x5e7fd8,_0x537c77){var _0x35ec38=new AWS[(_0xeab8('0x6c'))]({'accessKeyId':_0x22de4b,'secretAccessKey':_0x248c4f,'region':_0x33e129});_0x35ec38['startTranscriptionJob']({'TranscriptionJobName':_0x1073f3,'LanguageCode':_0x314c5a,'Media':{'MediaFileUri':_0x5df6a4}},function(_0x20065d,_0x1d1e5a){if(_0x20065d){return _0x537c77(_0x20065d);}else{return _0x5e7fd8(_0x1d1e5a);}});});}function transcribe(_0x488a29,_0x293217,_0x456746,_0x324da9,_0x39a9ed,_0x4bbf8b,_0x2d05e7){return new Promise(function(_0x135640,_0x26889c){var _0x3bb408={};logger[_0xeab8('0x62')](util[_0xeab8('0x2f')](_0xeab8('0x6d'),_0x488a29,_0x39a9ed));return uploadFile(_0x293217,_0x456746,_0x324da9,_0x39a9ed,path['basename'](_0x4bbf8b),fs[_0xeab8('0x6e')](_0x4bbf8b))[_0xeab8('0x27')](function(_0x59ee73){logger[_0xeab8('0x62')](util[_0xeab8('0x2f')](_0xeab8('0x6f'),_0x488a29,_0x39a9ed,_0x59ee73['Location']));_0x3bb408[_0xeab8('0x70')]=_0x59ee73['Bucket'];_0x3bb408['location']=_0x59ee73[_0xeab8('0x71')];logger[_0xeab8('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x488a29));return startTranscribe(_0x293217,_0x456746,_0x324da9,uuidv4(),_0x2d05e7,_0x59ee73[_0xeab8('0x71')]);})[_0xeab8('0x27')](function(_0x3dd4f1){logger[_0xeab8('0x62')](util['format'](_0xeab8('0x72'),_0x488a29,_0x3dd4f1[_0xeab8('0x73')][_0xeab8('0x74')]));_0x3bb408['transcribeName']=_0x3dd4f1['TranscriptionJob']['TranscriptionJobName'];_0x3bb408[_0xeab8('0x75')]=_0x3dd4f1[_0xeab8('0x73')][_0xeab8('0x76')];return _0x135640(_0x3bb408);})[_0xeab8('0x4a')](function(_0x20d5d5){return _0x26889c(_0x20d5d5);});});}exports['runTranscribe']=function(_0x3253f8,_0x1c0182,_0x5384c7){var _0xed72fd;var _0x463bb8;var _0x430381;var _0x499f96=require(_0xeab8('0x4d'));return db['VoiceRecording']['findOne']({'where':{'id':_0x3253f8[_0xeab8('0x46')]['id']}})[_0xeab8('0x27')](function(_0xb7cf31){if(_0xb7cf31){var _0x4592ca=util[_0xeab8('0x2f')](_0xeab8('0x50'),_0xb7cf31[_0xeab8('0x4f')]);if(fs[_0xeab8('0x51')](_0x4592ca)){cypher=!![];return _0x499f96[_0xeab8('0x52')](_0x4592ca,_0xb7cf31[_0xeab8('0x4f')],config[_0xeab8('0x53')][_0xeab8('0x54')])[_0xeab8('0x27')](function(){return _0xb7cf31;});}return _0xb7cf31;}})[_0xeab8('0x27')](function(_0x20c6d4){if(!_0x20c6d4){throw new db['Sequelize'][(_0xeab8('0x77'))](_0xeab8('0x78'));}_0x463bb8=_0x20c6d4;return db[_0xeab8('0x79')][_0xeab8('0x7a')]({'where':{'id':0x1}});})[_0xeab8('0x27')](handleEntityNotFound(_0x1c0182,null))[_0xeab8('0x27')](function(_0x3e1c9a){if(_0x3e1c9a){_0xed72fd=_0x3e1c9a;if(!_0xed72fd['transcribe']||!_0xed72fd['transcribeAccountId']||!_0xed72fd[_0xeab8('0x7b')]||!_0xed72fd[_0xeab8('0x7c')]||!_0xed72fd[_0xeab8('0x70')]){throw new db[(_0xeab8('0x55'))][(_0xeab8('0x77'))](_0xeab8('0x7d'));}if(_0x3253f8[_0xeab8('0x4b')]['runSentiment']&&(!_0xed72fd['sentiment']||!_0xed72fd[_0xeab8('0x7e')]||!_0xed72fd['sentimentRegion']||!_0xed72fd[_0xeab8('0x7c')]||!_0xed72fd[_0xeab8('0x70')])){throw new db[(_0xeab8('0x55'))][(_0xeab8('0x77'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xeab8('0x7f')][_0xeab8('0x7a')]({'where':{'id':_0xed72fd[_0xeab8('0x80')]}});}})[_0xeab8('0x27')](function(_0x1fb952){if(!_0x1fb952){throw new db[(_0xeab8('0x55'))][(_0xeab8('0x77'))](_0xeab8('0x81'));}if(!_0x1fb952['data1']||!_0x1fb952[_0xeab8('0x82')]){throw new db[(_0xeab8('0x55'))][(_0xeab8('0x77'))](_0xeab8('0x83'));}_0x430381=_0x1fb952;return getBucketslist(_0x430381[_0xeab8('0x84')],_0x430381[_0xeab8('0x82')],_0xed72fd['transcribeRegion']);})[_0xeab8('0x27')](function(_0x48a193){if(_0x48a193&&_0x48a193['Buckets']){var _0x54319e=_[_0xeab8('0x48')](_0x48a193['Buckets'],function(_0x59a2a8){return _0x59a2a8[_0xeab8('0x85')]===_0xed72fd[_0xeab8('0x70')];});if(!_0x54319e){logger['info'](util[_0xeab8('0x2f')](_0xeab8('0x86'),_0x3253f8[_0xeab8('0x46')]['id'],_0xed72fd['bucket']));return createBucket(_0x430381[_0xeab8('0x84')],_0x430381[_0xeab8('0x82')],_0xed72fd[_0xeab8('0x7b')],_0xed72fd[_0xeab8('0x70')]);}logger['info'](util['format'](_0xeab8('0x87'),_0x3253f8[_0xeab8('0x46')]['id'],_0xed72fd[_0xeab8('0x70')]));return;}})[_0xeab8('0x27')](function(_0x2dfd7e){if(_0x463bb8[_0xeab8('0x75')]===_0xeab8('0x88')){return transcribe(_0x3253f8[_0xeab8('0x46')]['id'],_0x430381[_0xeab8('0x84')],_0x430381[_0xeab8('0x82')],_0xed72fd[_0xeab8('0x7b')],_0xed72fd[_0xeab8('0x70')],_0x463bb8[_0xeab8('0x4f')],_0xed72fd['language']);}else{logger[_0xeab8('0x62')](util[_0xeab8('0x2f')](_0xeab8('0x89'),_0x3253f8['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xeab8('0x27')](function(_0x278fbb){if(_0x278fbb){_0x278fbb[_0xeab8('0x8a')]=_0x3253f8[_0xeab8('0x4b')][_0xeab8('0x8b')];return _0x463bb8[_0xeab8('0x8c')](_0x278fbb);}})[_0xeab8('0x27')](respondWithResult(_0x1c0182,null))[_0xeab8('0x4a')](handleError(_0x1c0182,null));};function writeFile(_0x1743f7,_0x1701c4){return new Promise(function(_0x351fe4,_0x117d69){fs[_0xeab8('0x8d')](_0x1701c4,_0x1743f7,function(_0x294889,_0x50a56b){if(_0x294889){return _0x117d69(_0x294889);}else{return _0x351fe4(_0x50a56b);}});});}exports[_0xeab8('0x8e')]=function(_0x3698fd,_0x49e315,_0x3187e3){return db[_0xeab8('0x43')][_0xeab8('0x7a')]({'where':{'id':_0x3698fd[_0xeab8('0x46')]['id']}})[_0xeab8('0x27')](handleEntityNotFound(_0x49e315))[_0xeab8('0x27')](function(_0xe88fef){if(_0xe88fef&&_0xe88fef['fileText']){var _0x3893d9=_0xe88fef[_0xeab8('0x8f')];var _0x2a319e=config[_0xeab8('0x90')]+'/server/files/transcribes/transcribe_'+_0xe88fef['id']+_0xeab8('0x91');if(fs[_0xeab8('0x51')](_0x2a319e)){return _0x2a319e;}return writeFile(_0x3893d9,_0x2a319e)[_0xeab8('0x27')](function(){return _0x2a319e;});}else{throw new db[(_0xeab8('0x55'))][(_0xeab8('0x77'))](_0xeab8('0x92'));}})[_0xeab8('0x27')](function(_0xc8d998){return _0x49e315['download'](_0xc8d998);})[_0xeab8('0x4a')](handleError(_0x49e315));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6fe03c2..c586fd5 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 _0xf3eb=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x11dceb,_0x376d1b){var _0x3a2f21=function(_0x5c3ca4){while(--_0x5c3ca4){_0x11dceb['push'](_0x11dceb['shift']());}};_0x3a2f21(++_0x376d1b);}(_0xf3eb,0x102));var _0xbf3e=function(_0x4f48fa,_0x2d9b8b){_0x4f48fa=_0x4f48fa-0x0;var _0x464380=_0xf3eb[_0x4f48fa];return _0x464380;};'use strict';var _=require(_0xbf3e('0x0'));var util=require(_0xbf3e('0x1'));var logger=require('../../config/logger')(_0xbf3e('0x2'));var moment=require(_0xbf3e('0x3'));var BPromise=require(_0xbf3e('0x4'));var rp=require(_0xbf3e('0x5'));var fs=require('fs');var path=require(_0xbf3e('0x6'));var rimraf=require(_0xbf3e('0x7'));var config=require(_0xbf3e('0x8'));var attributes=require(_0xbf3e('0x9'));module['exports']=function(_0x7c361,_0x3c1d23){return _0x7c361[_0xbf3e('0xa')](_0xbf3e('0xb'),attributes,{'tableName':_0xbf3e('0xc'),'paranoid':![],'indexes':[{'name':_0xbf3e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x472f=['uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','./voiceRecording.attributes','exports','define'];(function(_0x1519aa,_0x42844a){var _0x1f233f=function(_0x5881cd){while(--_0x5881cd){_0x1519aa['push'](_0x1519aa['shift']());}};_0x1f233f(++_0x42844a);}(_0x472f,0x1e5));var _0xf472=function(_0x3f503a,_0x466d69){_0x3f503a=_0x3f503a-0x0;var _0xc2b745=_0x472f[_0x3f503a];return _0xc2b745;};'use strict';var _=require(_0xf472('0x0'));var util=require(_0xf472('0x1'));var logger=require('../../config/logger')(_0xf472('0x2'));var moment=require(_0xf472('0x3'));var BPromise=require(_0xf472('0x4'));var rp=require(_0xf472('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf472('0x6'));var config=require('../../config/environment');var attributes=require(_0xf472('0x7'));module[_0xf472('0x8')]=function(_0x2327e6,_0x1d42bc){return _0x2327e6[_0xf472('0x9')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xf472('0xa'),'fields':[_0xf472('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 381803b..42d3363 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 _0x66fa=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','body','options','raw','where','attributes','UpdateVoiceRecording','stringify'];(function(_0x31483c,_0x5f53d9){var _0x469206=function(_0x268497){while(--_0x268497){_0x31483c['push'](_0x31483c['shift']());}};_0x469206(++_0x5f53d9);}(_0x66fa,0x117));var _0xa66f=function(_0x150b41,_0x999c4a){_0x150b41=_0x150b41-0x0;var _0x1a6fd1=_0x66fa[_0x150b41];return _0x1a6fd1;};'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')]('VoiceRecording,\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')]('VoiceRecording,\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);});});}exports['UpdateVoiceRecording']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')](_0x1cbe64[_0xa66f('0x16')],{'raw':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x19')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x1a')]||null:null,'limit':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')]['limit']||null:null})[_0xa66f('0xb')](function(_0xc5c82e){logger[_0xa66f('0xc')](_0xa66f('0x1b'),_0x1cbe64);logger['debug'](_0xa66f('0x1b'),_0x1cbe64,JSON[_0xa66f('0x1c')](_0xc5c82e));_0x4a28d4(_0xc5c82e);})[_0xa66f('0x13')](function(_0x16f1fa){logger['error']('UpdateVoiceRecording',_0x16f1fa[_0xa66f('0x12')],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x16f1fa[_0xa66f('0x12')]));});});};exports[_0xa66f('0x1d')]=function(_0x384164){var _0x57da7f=this;return new Promise(function(_0x4683c7,_0x1c2903){var _0x13495f=require(_0xa66f('0x1e'));var _0x17c103;return db[_0xa66f('0x1f')][_0xa66f('0x20')]({'attributes':['id',_0xa66f('0x21')],'where':{'id':0x1},'raw':!![]})[_0xa66f('0xb')](function(_0x117d03){_0x17c103=_0x117d03;return db[_0xa66f('0x14')][_0xa66f('0x22')](_0x384164[_0xa66f('0x16')]);})[_0xa66f('0xb')](function(_0x49f615){if(_0x17c103['callRecordingEncryption']&&fs[_0xa66f('0x23')](_0x49f615[_0xa66f('0x24')])){var _0x55f309=util[_0xa66f('0x25')](_0xa66f('0x26'),_0x49f615['value']);return _0x13495f[_0xa66f('0x27')](_0x49f615[_0xa66f('0x24')],_0x55f309,config[_0xa66f('0x28')][_0xa66f('0x29')])[_0xa66f('0xb')](function(){fs['unlink'](_0x49f615[_0xa66f('0x24')]);logger['info'](_0xa66f('0x2a'));return _0x49f615;});}return _0x49f615;})[_0xa66f('0xb')](function(_0x2e4dc8){logger['info'](_0xa66f('0x1d'),_0x384164);logger[_0xa66f('0x2b')]('CreateVoiceRecording',_0x384164,JSON[_0xa66f('0x1c')](_0x2e4dc8));_0x4683c7(_0x2e4dc8);})[_0xa66f('0x13')](function(_0xba9457){logger[_0xa66f('0xf')](_0xa66f('0x1d'),_0xba9457[_0xa66f('0x12')],_0x384164);_0x1c2903(_0x57da7f[_0xa66f('0xf')](0x1f4,_0xba9457[_0xa66f('0x12')]));});});}; \ No newline at end of file +var _0xd7d1=['unlink','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x228f5f,_0x1ec92e){_0x228f5f=_0x228f5f-0x0;var _0x305940=_0xd7d1[_0x228f5f];return _0x305940;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['VoiceRecording'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2['options'][_0x1d7d('0x1e')]||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['attributes']||null:null,'limit':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['limit']||null:null})['then'](function(_0x1dcaf2){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger['debug'](_0x1d7d('0x19'),_0x4db4f2,JSON[_0x1d7d('0x13')](_0x1dcaf2));_0x191024(_0x1dcaf2);})[_0x1d7d('0x18')](function(_0x21e59){logger['error'](_0x1d7d('0x19'),_0x21e59[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f['error'](0x1f4,_0x21e59['message']));});});};exports[_0x1d7d('0x1f')]=function(_0x52c618){var _0x38c323=this;return new Promise(function(_0x2d4de4,_0x3bc6e8){var _0x22c40d=require(_0x1d7d('0x20'));var _0x59f827;return db[_0x1d7d('0x21')][_0x1d7d('0x22')]({'attributes':['id',_0x1d7d('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x78adbe){_0x59f827=_0x78adbe;return db[_0x1d7d('0x24')][_0x1d7d('0x25')](_0x52c618['body']);})['then'](function(_0x53e25c){if(_0x59f827[_0x1d7d('0x23')]&&fs[_0x1d7d('0x26')](_0x53e25c['value'])){var _0x1ebcbc=util[_0x1d7d('0x27')](_0x1d7d('0x28'),_0x53e25c[_0x1d7d('0x29')]);return _0x22c40d[_0x1d7d('0x2a')](_0x53e25c[_0x1d7d('0x29')],_0x1ebcbc,config[_0x1d7d('0x2b')][_0x1d7d('0x2c')])[_0x1d7d('0xe')](function(){fs[_0x1d7d('0x2d')](_0x53e25c['value']);logger['info'](_0x1d7d('0x2e'));return _0x53e25c;});}return _0x53e25c;})[_0x1d7d('0xe')](function(_0x90e852){logger[_0x1d7d('0xf')](_0x1d7d('0x1f'),_0x52c618);logger[_0x1d7d('0x2f')](_0x1d7d('0x1f'),_0x52c618,JSON[_0x1d7d('0x13')](_0x90e852));_0x2d4de4(_0x90e852);})[_0x1d7d('0x18')](function(_0x47b6b2){logger[_0x1d7d('0x14')](_0x1d7d('0x1f'),_0x47b6b2[_0x1d7d('0x16')],_0x52c618);_0x3bc6e8(_0x38c323[_0x1d7d('0x14')](0x1f4,_0x47b6b2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0856fd9..7ebafa3 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 _0x0038=['destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update'];(function(_0x37a519,_0x30dfc9){var _0x16e1a5=function(_0x59a6d8){while(--_0x59a6d8){_0x37a519['push'](_0x37a519['shift']());}};_0x16e1a5(++_0x30dfc9);}(_0x0038,0x133));var _0x8003=function(_0x415c36,_0xb8ef21){_0x415c36=_0x415c36-0x0;var _0x3dc93a=_0x0038[_0x415c36];return _0x3dc93a;};'use strict';var multer=require('multer');var util=require(_0x8003('0x0'));var path=require(_0x8003('0x1'));var timeout=require(_0x8003('0x2'));var express=require('express');var router=express[_0x8003('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8003('0x4'));var interaction=require(_0x8003('0x5'));var config=require(_0x8003('0x6'));var controller=require(_0x8003('0x7'));router[_0x8003('0x8')]('/',auth[_0x8003('0x9')](),controller[_0x8003('0xa')]);router[_0x8003('0x8')]('/describe',auth[_0x8003('0x9')](),controller[_0x8003('0xb')]);router[_0x8003('0x8')](_0x8003('0xc'),auth[_0x8003('0x9')](),controller['show']);router[_0x8003('0xd')]('/',auth[_0x8003('0x9')](),controller[_0x8003('0xe')]);router[_0x8003('0xf')](_0x8003('0xc'),auth['isAuthenticated'](),controller[_0x8003('0x10')]);router['delete'](_0x8003('0xc'),auth['isAuthenticated'](),controller[_0x8003('0x11')]);module['exports']=router; \ No newline at end of file +var _0x298e=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4fabd8,_0x3be1df){var _0x245b41=function(_0x3eaeff){while(--_0x3eaeff){_0x4fabd8['push'](_0x4fabd8['shift']());}};_0x245b41(++_0x3be1df);}(_0x298e,0xe2));var _0xe298=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x298e[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xe298('0x0'));var util=require(_0xe298('0x1'));var path=require(_0xe298('0x2'));var timeout=require('connect-timeout');var express=require(_0xe298('0x3'));var router=express[_0xe298('0x4')]();var fs_extra=require(_0xe298('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe298('0x6'));var config=require(_0xe298('0x7'));var controller=require(_0xe298('0x8'));router[_0xe298('0x9')]('/',auth[_0xe298('0xa')](),controller['index']);router[_0xe298('0x9')]('/describe',auth[_0xe298('0xa')](),controller[_0xe298('0xb')]);router['get'](_0xe298('0xc'),auth[_0xe298('0xa')](),controller[_0xe298('0xd')]);router['post']('/',auth[_0xe298('0xa')](),controller[_0xe298('0xe')]);router[_0xe298('0xf')](_0xe298('0xc'),auth[_0xe298('0xa')](),controller[_0xe298('0x10')]);router[_0xe298('0x11')]('/:id',auth[_0xe298('0xa')](),controller[_0xe298('0x12')]);module[_0xe298('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 5b7ad45..bd9f5b1 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 _0xa9a8=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xa9a8,0xd4));var _0x8a9a=function(_0x158cff,_0x381848){_0x158cff=_0x158cff-0x0;var _0x153c8b=_0xa9a8[_0x158cff];return _0x153c8b;};'use strict';var Sequelize=require(_0x8a9a('0x0'));var moment=require(_0x8a9a('0x1'));module[_0x8a9a('0x2')]={'type':{'type':Sequelize[_0x8a9a('0x3')](_0x8a9a('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8a9a('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x8a9a('0x5')]},'transferercalleridname':{'type':Sequelize[_0x8a9a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8a9a('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x8a9a('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x8a9a('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x8a9a('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x8a9a('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8a9a('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x8a9a('0x5')]},'transfereecontext':{'type':Sequelize[_0x8a9a('0x5')]},'transfereeexten':{'type':Sequelize[_0x8a9a('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x8a9a('0x5')]},'isexternal':{'type':Sequelize[_0x8a9a('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x8a9a('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc18d=['exports','attended','STRING','ENUM','sequelize','moment'];(function(_0x287612,_0x43eb60){var _0x1df932=function(_0x2f8a48){while(--_0x2f8a48){_0x287612['push'](_0x287612['shift']());}};_0x1df932(++_0x43eb60);}(_0xc18d,0x112));var _0xdc18=function(_0x2df2e7,_0x39426a){_0x2df2e7=_0x2df2e7-0x0;var _0x243fd6=_0xc18d[_0x2df2e7];return _0x243fd6;};'use strict';var Sequelize=require(_0xdc18('0x0'));var moment=require(_0xdc18('0x1'));module[_0xdc18('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xdc18('0x3'))},'result':{'type':Sequelize[_0xdc18('0x4')]},'transfererchannel':{'type':Sequelize[_0xdc18('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xdc18('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xdc18('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xdc18('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xdc18('0x4')]},'transferercontext':{'type':Sequelize[_0xdc18('0x4')]},'transfererexten':{'type':Sequelize[_0xdc18('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xdc18('0x4')]},'transfereechannel':{'type':Sequelize[_0xdc18('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xdc18('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xdc18('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xdc18('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xdc18('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xdc18('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xdc18('0x4')]},'isexternal':{'type':Sequelize[_0xdc18('0x5')]('Yes','No')},'context':{'type':Sequelize[_0xdc18('0x4')]},'extension':{'type':Sequelize[_0xdc18('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a07f45a..023e1b2 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 _0x8319=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','map','VoiceTransferReport','rawAttributes'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0x8319,0xfe));var _0x9831=function(_0x185db1,_0xbf9a5b){_0x185db1=_0x185db1-0x0;var _0x143426=_0x8319[_0x185db1];return _0x143426;};'use strict';var emlformat=require(_0x9831('0x0'));var rimraf=require(_0x9831('0x1'));var zipdir=require(_0x9831('0x2'));var jsonpatch=require(_0x9831('0x3'));var rp=require('request-promise');var moment=require(_0x9831('0x4'));var BPromise=require(_0x9831('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9831('0x6'));var sox=require(_0x9831('0x7'));var csv=require(_0x9831('0x8'));var ejs=require(_0x9831('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9831('0xa'));var squel=require(_0x9831('0xb'));var crypto=require('crypto');var jsforce=require(_0x9831('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9831('0x8'));var querystring=require('querystring');var Papa=require(_0x9831('0xd'));var Redis=require(_0x9831('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9831('0xf'));var as=require(_0x9831('0x10'));var hardwareService=require(_0x9831('0x11'));var logger=require(_0x9831('0x12'))(_0x9831('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9831('0x14'));var db=require(_0x9831('0x15'))['db'];function respondWithStatusCode(_0x42d7bc,_0x359be0){_0x359be0=_0x359be0||0xcc;return function(_0x985b68){if(_0x985b68){return _0x42d7bc['sendStatus'](_0x359be0);}return _0x42d7bc[_0x9831('0x16')](_0x359be0)[_0x9831('0x17')]();};}function respondWithResult(_0x526a62,_0xf19241){_0xf19241=_0xf19241||0xc8;return function(_0x15e38f){if(_0x15e38f){return _0x526a62[_0x9831('0x16')](_0xf19241)[_0x9831('0x18')](_0x15e38f);}};}function respondWithFilteredResult(_0x59c544,_0x12e45a){return function(_0x4aa67a){if(_0x4aa67a){var _0x14992c=typeof _0x12e45a[_0x9831('0x19')]==='undefined'&&typeof _0x12e45a['limit']===_0x9831('0x1a');var _0x117a4e=_0x4aa67a[_0x9831('0x1b')];var _0x3986e4=_0x14992c?0x0:_0x12e45a['offset'];var _0x1a95cc=_0x14992c?_0x4aa67a[_0x9831('0x1b')]:_0x12e45a[_0x9831('0x19')]+_0x12e45a[_0x9831('0x1c')];var _0x25fe0d;if(_0x1a95cc>=_0x117a4e){_0x1a95cc=_0x117a4e;_0x25fe0d=0xc8;}else{_0x25fe0d=0xce;}_0x59c544[_0x9831('0x16')](_0x25fe0d);return _0x59c544[_0x9831('0x1d')](_0x9831('0x1e'),_0x3986e4+'-'+_0x1a95cc+'/'+_0x117a4e)[_0x9831('0x18')](_0x4aa67a);}return null;};}function patchUpdates(_0x253b0c){return function(_0x4c12c2){try{jsonpatch['apply'](_0x4c12c2,_0x253b0c,!![]);}catch(_0x1ddb92){return BPromise[_0x9831('0x1f')](_0x1ddb92);}return _0x4c12c2[_0x9831('0x20')]();};}function saveUpdates(_0x114bb9,_0x426e21){return function(_0x5202bd){if(_0x5202bd){return _0x5202bd[_0x9831('0x21')](_0x114bb9)['then'](function(_0x59ead7){return _0x59ead7;});}return null;};}function removeEntity(_0x4f50d0,_0x4b81bf){return function(_0xac2eb1){if(_0xac2eb1){return _0xac2eb1['destroy']()[_0x9831('0x22')](function(){_0x4f50d0[_0x9831('0x16')](0xcc)[_0x9831('0x17')]();});}};}function handleEntityNotFound(_0x5effef,_0x1f335c){return function(_0x1df240){if(!_0x1df240){_0x5effef[_0x9831('0x23')](0x194);}return _0x1df240;};}function handleError(_0x3db096,_0x54cfe1){_0x54cfe1=_0x54cfe1||0x1f4;return function(_0x29a57c){logger[_0x9831('0x24')](_0x29a57c[_0x9831('0x25')]);if(_0x29a57c['name']){delete _0x29a57c[_0x9831('0x26')];}_0x3db096[_0x9831('0x16')](_0x54cfe1)['send'](_0x29a57c);};}exports['index']=function(_0x448153,_0x3912e0){var _0x5218ff={},_0x664b02={},_0x15ad7d={'count':0x0,'rows':[]};var _0x17815d=_[_0x9831('0x27')](db[_0x9831('0x28')][_0x9831('0x29')],function(_0x144d8b){return{'name':_0x144d8b[_0x9831('0x2a')],'type':_0x144d8b[_0x9831('0x2b')][_0x9831('0x2c')]};});_0x664b02[_0x9831('0x2d')]=_[_0x9831('0x27')](_0x17815d,_0x9831('0x26'));_0x664b02[_0x9831('0x2e')]=_[_0x9831('0x2f')](_0x448153[_0x9831('0x2e')]);_0x664b02[_0x9831('0x30')]=_[_0x9831('0x31')](_0x664b02['model'],_0x664b02[_0x9831('0x2e')]);_0x5218ff['attributes']=_[_0x9831('0x31')](_0x664b02[_0x9831('0x2d')],qs[_0x9831('0x32')](_0x448153[_0x9831('0x2e')][_0x9831('0x32')]));_0x5218ff[_0x9831('0x33')]=_0x5218ff['attributes'][_0x9831('0x34')]?_0x5218ff[_0x9831('0x33')]:_0x664b02[_0x9831('0x2d')];if(!_0x448153[_0x9831('0x2e')][_0x9831('0x35')](_0x9831('0x36'))){_0x5218ff['limit']=qs[_0x9831('0x1c')](_0x448153[_0x9831('0x2e')][_0x9831('0x1c')]);_0x5218ff[_0x9831('0x19')]=qs['offset'](_0x448153[_0x9831('0x2e')][_0x9831('0x19')]);}_0x5218ff[_0x9831('0x37')]=qs[_0x9831('0x38')](_0x448153[_0x9831('0x2e')]['sort']);_0x5218ff[_0x9831('0x39')]=qs[_0x9831('0x30')](_[_0x9831('0x3a')](_0x448153[_0x9831('0x2e')],_0x664b02['filters']),_0x17815d);if(_0x448153['query'][_0x9831('0x3b')]){_0x5218ff[_0x9831('0x39')]=_[_0x9831('0x3c')](_0x5218ff['where'],{'$or':_[_0x9831('0x27')](_0x17815d,function(_0x18ad33){if(_0x18ad33['type']!=='VIRTUAL'){var _0x51d6cf={};_0x51d6cf[_0x18ad33[_0x9831('0x26')]]={'$like':'%'+_0x448153[_0x9831('0x2e')]['filter']+'%'};return _0x51d6cf;}})});}_0x5218ff=_[_0x9831('0x3c')]({},_0x5218ff,_0x448153[_0x9831('0x3d')]);var _0x39c419={'where':_0x5218ff['where']};return db['VoiceTransferReport'][_0x9831('0x1b')](_0x39c419)[_0x9831('0x22')](function(_0x3ba6e5){_0x15ad7d['count']=_0x3ba6e5;if(_0x448153['query'][_0x9831('0x3e')]){_0x5218ff['include']=[{'all':!![]}];}return db[_0x9831('0x28')][_0x9831('0x3f')](_0x5218ff);})[_0x9831('0x22')](function(_0x274acb){_0x15ad7d[_0x9831('0x40')]=_0x274acb;return _0x15ad7d;})[_0x9831('0x22')](respondWithFilteredResult(_0x3912e0,_0x5218ff))[_0x9831('0x41')](handleError(_0x3912e0,null));};exports[_0x9831('0x42')]=function(_0x18cbf2,_0x286cd2){var _0x3253db={'raw':!![],'where':{'id':_0x18cbf2[_0x9831('0x43')]['id']}},_0x5d1c37={};_0x5d1c37['model']=_[_0x9831('0x2f')](db[_0x9831('0x28')][_0x9831('0x29')]);_0x5d1c37[_0x9831('0x2e')]=_[_0x9831('0x2f')](_0x18cbf2[_0x9831('0x2e')]);_0x5d1c37[_0x9831('0x30')]=_[_0x9831('0x31')](_0x5d1c37[_0x9831('0x2d')],_0x5d1c37[_0x9831('0x2e')]);_0x3253db['attributes']=_[_0x9831('0x31')](_0x5d1c37[_0x9831('0x2d')],qs['fields'](_0x18cbf2[_0x9831('0x2e')]['fields']));_0x3253db['attributes']=_0x3253db['attributes'][_0x9831('0x34')]?_0x3253db['attributes']:_0x5d1c37[_0x9831('0x2d')];if(_0x18cbf2[_0x9831('0x2e')]['includeAll']){_0x3253db[_0x9831('0x44')]=[{'all':!![]}];}_0x3253db=_[_0x9831('0x3c')]({},_0x3253db,_0x18cbf2[_0x9831('0x3d')]);return db[_0x9831('0x28')]['find'](_0x3253db)['then'](handleEntityNotFound(_0x286cd2,null))['then'](respondWithResult(_0x286cd2,null))['catch'](handleError(_0x286cd2,null));};exports[_0x9831('0x45')]=function(_0x2d8a5d,_0x802999){return db[_0x9831('0x28')][_0x9831('0x45')](_0x2d8a5d[_0x9831('0x46')],{})[_0x9831('0x22')](respondWithResult(_0x802999,0xc9))[_0x9831('0x41')](handleError(_0x802999,null));};exports[_0x9831('0x21')]=function(_0x3508a3,_0x7e2180){if(_0x3508a3[_0x9831('0x46')]['id']){delete _0x3508a3[_0x9831('0x46')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x3508a3[_0x9831('0x43')]['id']}})[_0x9831('0x22')](handleEntityNotFound(_0x7e2180,null))[_0x9831('0x22')](saveUpdates(_0x3508a3['body'],null))[_0x9831('0x22')](respondWithResult(_0x7e2180,null))['catch'](handleError(_0x7e2180,null));};exports[_0x9831('0x47')]=function(_0x171bf5,_0x524952){return db[_0x9831('0x28')][_0x9831('0x48')]({'where':{'id':_0x171bf5[_0x9831('0x43')]['id']}})[_0x9831('0x22')](handleEntityNotFound(_0x524952,null))[_0x9831('0x22')](removeEntity(_0x524952,null))[_0x9831('0x41')](handleError(_0x524952,null));};exports[_0x9831('0x49')]=function(_0x90969a,_0x213800){return db[_0x9831('0x28')]['describe']()[_0x9831('0x22')](respondWithResult(_0x213800,null))['catch'](handleError(_0x213800,null));}; \ No newline at end of file +var _0x467e=['crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x467e,0x8c));var _0xe467=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0x467e[_0x17784a];return _0x41aded;};'use strict';var emlformat=require(_0xe467('0x0'));var rimraf=require(_0xe467('0x1'));var zipdir=require(_0xe467('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe467('0x3'));var moment=require(_0xe467('0x4'));var BPromise=require(_0xe467('0x5'));var Mustache=require(_0xe467('0x6'));var util=require(_0xe467('0x7'));var path=require(_0xe467('0x8'));var sox=require(_0xe467('0x9'));var csv=require(_0xe467('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe467('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe467('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe467('0xa'));var querystring=require(_0xe467('0xd'));var Papa=require(_0xe467('0xe'));var Redis=require(_0xe467('0xf'));var authService=require(_0xe467('0x10'));var qs=require(_0xe467('0x11'));var as=require(_0xe467('0x12'));var hardwareService=require(_0xe467('0x13'));var logger=require(_0xe467('0x14'))(_0xe467('0x15'));var utils=require(_0xe467('0x16'));var config=require(_0xe467('0x17'));var licenseUtil=require(_0xe467('0x18'));var db=require(_0xe467('0x19'))['db'];function respondWithStatusCode(_0x544894,_0x23fcae){_0x23fcae=_0x23fcae||0xcc;return function(_0x340356){if(_0x340356){return _0x544894[_0xe467('0x1a')](_0x23fcae);}return _0x544894[_0xe467('0x1b')](_0x23fcae)['end']();};}function respondWithResult(_0x4aecf5,_0x100785){_0x100785=_0x100785||0xc8;return function(_0x1c87e7){if(_0x1c87e7){return _0x4aecf5[_0xe467('0x1b')](_0x100785)['json'](_0x1c87e7);}};}function respondWithFilteredResult(_0x5c38d7,_0x5510d3){return function(_0x5b86e2){if(_0x5b86e2){var _0x1d2966=typeof _0x5510d3[_0xe467('0x1c')]===_0xe467('0x1d')&&typeof _0x5510d3['limit']===_0xe467('0x1d');var _0x15eb29=_0x5b86e2[_0xe467('0x1e')];var _0x5363d6=_0x1d2966?0x0:_0x5510d3[_0xe467('0x1c')];var _0x5f2ba5=_0x1d2966?_0x5b86e2[_0xe467('0x1e')]:_0x5510d3[_0xe467('0x1c')]+_0x5510d3[_0xe467('0x1f')];var _0x52557f;if(_0x5f2ba5>=_0x15eb29){_0x5f2ba5=_0x15eb29;_0x52557f=0xc8;}else{_0x52557f=0xce;}_0x5c38d7['status'](_0x52557f);return _0x5c38d7[_0xe467('0x20')](_0xe467('0x21'),_0x5363d6+'-'+_0x5f2ba5+'/'+_0x15eb29)[_0xe467('0x22')](_0x5b86e2);}return null;};}function patchUpdates(_0x4b8c0a){return function(_0x1176be){try{jsonpatch[_0xe467('0x23')](_0x1176be,_0x4b8c0a,!![]);}catch(_0x5419df){return BPromise[_0xe467('0x24')](_0x5419df);}return _0x1176be['save']();};}function saveUpdates(_0x24e0c8,_0x55ed5f){return function(_0x36d4b5){if(_0x36d4b5){return _0x36d4b5[_0xe467('0x25')](_0x24e0c8)[_0xe467('0x26')](function(_0x41700c){return _0x41700c;});}return null;};}function removeEntity(_0x2e7705,_0x2b2066){return function(_0x25c047){if(_0x25c047){return _0x25c047[_0xe467('0x27')]()['then'](function(){_0x2e7705[_0xe467('0x1b')](0xcc)[_0xe467('0x28')]();});}};}function handleEntityNotFound(_0x4d804b,_0x1442a8){return function(_0x36f581){if(!_0x36f581){_0x4d804b[_0xe467('0x1a')](0x194);}return _0x36f581;};}function handleError(_0x58b9bc,_0x595365){_0x595365=_0x595365||0x1f4;return function(_0x49563f){logger[_0xe467('0x29')](_0x49563f['stack']);if(_0x49563f['name']){delete _0x49563f[_0xe467('0x2a')];}_0x58b9bc['status'](_0x595365)['send'](_0x49563f);};}exports[_0xe467('0x2b')]=function(_0xabdd8d,_0x14fa4a){var _0x4a352e={},_0x56d631={},_0x51983e={'count':0x0,'rows':[]};var _0x90533a=_['map'](db[_0xe467('0x2c')][_0xe467('0x2d')],function(_0x7bec3f){return{'name':_0x7bec3f[_0xe467('0x2e')],'type':_0x7bec3f[_0xe467('0x2f')][_0xe467('0x30')]};});_0x56d631[_0xe467('0x31')]=_[_0xe467('0x32')](_0x90533a,_0xe467('0x2a'));_0x56d631[_0xe467('0x33')]=_['keys'](_0xabdd8d[_0xe467('0x33')]);_0x56d631['filters']=_[_0xe467('0x34')](_0x56d631[_0xe467('0x31')],_0x56d631[_0xe467('0x33')]);_0x4a352e['attributes']=_[_0xe467('0x34')](_0x56d631[_0xe467('0x31')],qs[_0xe467('0x35')](_0xabdd8d[_0xe467('0x33')][_0xe467('0x35')]));_0x4a352e[_0xe467('0x36')]=_0x4a352e['attributes'][_0xe467('0x37')]?_0x4a352e[_0xe467('0x36')]:_0x56d631[_0xe467('0x31')];if(!_0xabdd8d[_0xe467('0x33')]['hasOwnProperty'](_0xe467('0x38'))){_0x4a352e['limit']=qs[_0xe467('0x1f')](_0xabdd8d[_0xe467('0x33')][_0xe467('0x1f')]);_0x4a352e[_0xe467('0x1c')]=qs[_0xe467('0x1c')](_0xabdd8d[_0xe467('0x33')][_0xe467('0x1c')]);}_0x4a352e[_0xe467('0x39')]=qs[_0xe467('0x3a')](_0xabdd8d[_0xe467('0x33')][_0xe467('0x3a')]);_0x4a352e['where']=qs[_0xe467('0x3b')](_[_0xe467('0x3c')](_0xabdd8d['query'],_0x56d631[_0xe467('0x3b')]),_0x90533a);if(_0xabdd8d['query'][_0xe467('0x3d')]){_0x4a352e[_0xe467('0x3e')]=_['merge'](_0x4a352e['where'],{'$or':_[_0xe467('0x32')](_0x90533a,function(_0x41b24f){if(_0x41b24f[_0xe467('0x2f')]!==_0xe467('0x3f')){var _0x234aca={};_0x234aca[_0x41b24f[_0xe467('0x2a')]]={'$like':'%'+_0xabdd8d[_0xe467('0x33')]['filter']+'%'};return _0x234aca;}})});}_0x4a352e=_[_0xe467('0x40')]({},_0x4a352e,_0xabdd8d[_0xe467('0x41')]);var _0x853879={'where':_0x4a352e[_0xe467('0x3e')]};return db['VoiceTransferReport'][_0xe467('0x1e')](_0x853879)[_0xe467('0x26')](function(_0x508e01){_0x51983e[_0xe467('0x1e')]=_0x508e01;if(_0xabdd8d[_0xe467('0x33')]['includeAll']){_0x4a352e[_0xe467('0x42')]=[{'all':!![]}];}return db[_0xe467('0x2c')][_0xe467('0x43')](_0x4a352e);})[_0xe467('0x26')](function(_0x524936){_0x51983e[_0xe467('0x44')]=_0x524936;return _0x51983e;})['then'](respondWithFilteredResult(_0x14fa4a,_0x4a352e))[_0xe467('0x45')](handleError(_0x14fa4a,null));};exports[_0xe467('0x46')]=function(_0x43ea5b,_0xfd93db){var _0xd5b028={'raw':!![],'where':{'id':_0x43ea5b[_0xe467('0x47')]['id']}},_0x192ba2={};_0x192ba2[_0xe467('0x31')]=_['keys'](db[_0xe467('0x2c')][_0xe467('0x2d')]);_0x192ba2[_0xe467('0x33')]=_[_0xe467('0x48')](_0x43ea5b[_0xe467('0x33')]);_0x192ba2[_0xe467('0x3b')]=_[_0xe467('0x34')](_0x192ba2[_0xe467('0x31')],_0x192ba2['query']);_0xd5b028[_0xe467('0x36')]=_[_0xe467('0x34')](_0x192ba2[_0xe467('0x31')],qs[_0xe467('0x35')](_0x43ea5b[_0xe467('0x33')]['fields']));_0xd5b028['attributes']=_0xd5b028['attributes'][_0xe467('0x37')]?_0xd5b028[_0xe467('0x36')]:_0x192ba2[_0xe467('0x31')];if(_0x43ea5b[_0xe467('0x33')]['includeAll']){_0xd5b028['include']=[{'all':!![]}];}_0xd5b028=_[_0xe467('0x40')]({},_0xd5b028,_0x43ea5b[_0xe467('0x41')]);return db[_0xe467('0x2c')][_0xe467('0x49')](_0xd5b028)[_0xe467('0x26')](handleEntityNotFound(_0xfd93db,null))[_0xe467('0x26')](respondWithResult(_0xfd93db,null))['catch'](handleError(_0xfd93db,null));};exports['create']=function(_0x3074c5,_0xf9a4ec){return db[_0xe467('0x2c')]['create'](_0x3074c5[_0xe467('0x4a')],{})[_0xe467('0x26')](respondWithResult(_0xf9a4ec,0xc9))['catch'](handleError(_0xf9a4ec,null));};exports[_0xe467('0x25')]=function(_0x149377,_0xe99392){if(_0x149377[_0xe467('0x4a')]['id']){delete _0x149377[_0xe467('0x4a')]['id'];}return db[_0xe467('0x2c')][_0xe467('0x49')]({'where':{'id':_0x149377['params']['id']}})[_0xe467('0x26')](handleEntityNotFound(_0xe99392,null))[_0xe467('0x26')](saveUpdates(_0x149377[_0xe467('0x4a')],null))[_0xe467('0x26')](respondWithResult(_0xe99392,null))[_0xe467('0x45')](handleError(_0xe99392,null));};exports[_0xe467('0x27')]=function(_0x54645a,_0x78157a){return db[_0xe467('0x2c')][_0xe467('0x49')]({'where':{'id':_0x54645a[_0xe467('0x47')]['id']}})[_0xe467('0x26')](handleEntityNotFound(_0x78157a,null))[_0xe467('0x26')](removeEntity(_0x78157a,null))[_0xe467('0x45')](handleError(_0x78157a,null));};exports['describe']=function(_0x48684d,_0x23ec9f){return db['VoiceTransferReport'][_0xe467('0x4b')]()['then'](respondWithResult(_0x23ec9f,null))[_0xe467('0x45')](handleError(_0x23ec9f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5772a85..f30ec7d 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 _0x97c3=['../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3457cd,_0x461c6b){var _0x325bc6=function(_0x536db7){while(--_0x536db7){_0x3457cd['push'](_0x3457cd['shift']());}};_0x325bc6(++_0x461c6b);}(_0x97c3,0xad));var _0x397c=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x97c3[_0x25fc41];return _0x1371d1;};'use strict';var _=require(_0x397c('0x0'));var util=require(_0x397c('0x1'));var logger=require(_0x397c('0x2'))(_0x397c('0x3'));var moment=require(_0x397c('0x4'));var BPromise=require(_0x397c('0x5'));var rp=require(_0x397c('0x6'));var fs=require('fs');var path=require(_0x397c('0x7'));var rimraf=require(_0x397c('0x8'));var config=require(_0x397c('0x9'));var attributes=require(_0x397c('0xa'));module[_0x397c('0xb')]=function(_0x57d0c1,_0x577465){return _0x57d0c1[_0x397c('0xc')]('VoiceTransferReport',attributes,{'tableName':_0x397c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde04=['VoiceTransferReport','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x53400f,_0x181bc6){var _0x1f6492=function(_0x2db2be){while(--_0x2db2be){_0x53400f['push'](_0x53400f['shift']());}};_0x1f6492(++_0x181bc6);}(_0xde04,0x8d));var _0x4de0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde04[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x4de0('0x0'));var logger=require(_0x4de0('0x1'))(_0x4de0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4de0('0x3'));var fs=require('fs');var path=require(_0x4de0('0x4'));var rimraf=require(_0x4de0('0x5'));var config=require(_0x4de0('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x4de0('0x7')]=function(_0x3ced18,_0x123fb3){return _0x3ced18[_0x4de0('0x8')](_0x4de0('0x9'),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 ce56d87..0279a90 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 _0x4fe8=['client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','VoiceTransferReport','create','body','options','raw','catch','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xb6acd3,_0x3553d9){var _0x2faa05=function(_0x5aa06f){while(--_0x5aa06f){_0xb6acd3['push'](_0xb6acd3['shift']());}};_0x2faa05(++_0x3553d9);}(_0x4fe8,0x1c7));var _0x84fe=function(_0x32e453,_0x309e3e){_0x32e453=_0x32e453-0x0;var _0xafb7d=_0x4fe8[_0x32e453];return _0xafb7d;};'use strict';var _=require('lodash');var util=require(_0x84fe('0x0'));var moment=require(_0x84fe('0x1'));var BPromise=require(_0x84fe('0x2'));var rs=require(_0x84fe('0x3'));var fs=require('fs');var Redis=require(_0x84fe('0x4'));var db=require(_0x84fe('0x5'))['db'];var utils=require(_0x84fe('0x6'));var logger=require(_0x84fe('0x7'))(_0x84fe('0x8'));var config=require('../../config/environment');var jayson=require(_0x84fe('0x9'));var client=jayson[_0x84fe('0xa')][_0x84fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f61ae,_0x524c8b,_0x3b6522){return new BPromise(function(_0x4e55da,_0x3e7eba){return client[_0x84fe('0xc')](_0x1f61ae,_0x3b6522)[_0x84fe('0xd')](function(_0x40cbd6){logger[_0x84fe('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x524c8b,_0x84fe('0xf'));logger[_0x84fe('0x10')](_0x84fe('0x11'),_0x524c8b,_0x84fe('0xf'),JSON[_0x84fe('0x12')](_0x40cbd6));if(_0x40cbd6[_0x84fe('0x13')]){if(_0x40cbd6[_0x84fe('0x13')][_0x84fe('0x14')]===0x1f4){logger[_0x84fe('0x13')](_0x84fe('0x15'),_0x524c8b,_0x40cbd6[_0x84fe('0x13')][_0x84fe('0x16')]);return _0x3e7eba(_0x40cbd6[_0x84fe('0x13')][_0x84fe('0x16')]);}logger['error'](_0x84fe('0x15'),_0x524c8b,_0x40cbd6['error'][_0x84fe('0x16')]);return _0x4e55da(_0x40cbd6[_0x84fe('0x13')][_0x84fe('0x16')]);}else{logger[_0x84fe('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x524c8b,_0x84fe('0xf'));_0x4e55da(_0x40cbd6[_0x84fe('0x17')][_0x84fe('0x16')]);}})['catch'](function(_0x12b6fe){logger[_0x84fe('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x524c8b,_0x12b6fe);_0x3e7eba(_0x12b6fe);});});}exports['CreateVoiceTransferReport']=function(_0x23b267){var _0xf3fc22=this;return new Promise(function(_0x1206c3,_0x17f810){return db[_0x84fe('0x18')][_0x84fe('0x19')](_0x23b267[_0x84fe('0x1a')],{'raw':_0x23b267[_0x84fe('0x1b')]?_0x23b267[_0x84fe('0x1b')][_0x84fe('0x1c')]===undefined?!![]:![]:!![]})[_0x84fe('0xd')](function(_0x1f1427){logger[_0x84fe('0xe')]('CreateVoiceTransferReport',_0x23b267);logger[_0x84fe('0x10')]('CreateVoiceTransferReport',_0x23b267,JSON[_0x84fe('0x12')](_0x1f1427));_0x1206c3(_0x1f1427);})[_0x84fe('0x1d')](function(_0x10e618){logger[_0x84fe('0x13')](_0x84fe('0x1e'),_0x10e618['message'],_0x23b267);_0x17f810(_0xf3fc22[_0x84fe('0x13')](0x1f4,_0x10e618[_0x84fe('0x16')]));});});}; \ No newline at end of file +var _0x7fc9=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x7fc9,0x9e));var _0x97fc=function(_0x35fc62,_0x21fd86){_0x35fc62=_0x35fc62-0x0;var _0x24faf8=_0x7fc9[_0x35fc62];return _0x24faf8;};'use strict';var _=require(_0x97fc('0x0'));var util=require(_0x97fc('0x1'));var moment=require(_0x97fc('0x2'));var BPromise=require(_0x97fc('0x3'));var rs=require(_0x97fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97fc('0x5'))['db'];var utils=require(_0x97fc('0x6'));var logger=require('../../config/logger')(_0x97fc('0x7'));var config=require(_0x97fc('0x8'));var jayson=require(_0x97fc('0x9'));var client=jayson[_0x97fc('0xa')][_0x97fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x513fb2,_0x123daf,_0x5d8988){return new BPromise(function(_0x3a26c0,_0x39e003){return client[_0x97fc('0xc')](_0x513fb2,_0x5d8988)[_0x97fc('0xd')](function(_0x5d5878){logger[_0x97fc('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x123daf,_0x97fc('0xf'));logger['debug'](_0x97fc('0x10'),_0x123daf,_0x97fc('0xf'),JSON[_0x97fc('0x11')](_0x5d5878));if(_0x5d5878[_0x97fc('0x12')]){if(_0x5d5878[_0x97fc('0x12')][_0x97fc('0x13')]===0x1f4){logger[_0x97fc('0x12')](_0x97fc('0x14'),_0x123daf,_0x5d5878[_0x97fc('0x12')][_0x97fc('0x15')]);return _0x39e003(_0x5d5878[_0x97fc('0x12')][_0x97fc('0x15')]);}logger['error'](_0x97fc('0x14'),_0x123daf,_0x5d5878[_0x97fc('0x12')][_0x97fc('0x15')]);return _0x3a26c0(_0x5d5878[_0x97fc('0x12')][_0x97fc('0x15')]);}else{logger[_0x97fc('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x123daf,_0x97fc('0xf'));_0x3a26c0(_0x5d5878[_0x97fc('0x16')][_0x97fc('0x15')]);}})[_0x97fc('0x17')](function(_0x5d4ee8){logger[_0x97fc('0x12')](_0x97fc('0x14'),_0x123daf,_0x5d4ee8);_0x39e003(_0x5d4ee8);});});}exports[_0x97fc('0x18')]=function(_0x50bfba){var _0x14264f=this;return new Promise(function(_0x108692,_0x2819af){return db[_0x97fc('0x19')][_0x97fc('0x1a')](_0x50bfba[_0x97fc('0x1b')],{'raw':_0x50bfba[_0x97fc('0x1c')]?_0x50bfba['options'][_0x97fc('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x483750){logger[_0x97fc('0xe')]('CreateVoiceTransferReport',_0x50bfba);logger['debug'](_0x97fc('0x18'),_0x50bfba,JSON['stringify'](_0x483750));_0x108692(_0x483750);})[_0x97fc('0x17')](function(_0x2ac5b9){logger[_0x97fc('0x12')](_0x97fc('0x18'),_0x2ac5b9[_0x97fc('0x15')],_0x50bfba);_0x2819af(_0x14264f[_0x97fc('0x12')](0x1f4,_0x2ac5b9[_0x97fc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7d34816..9d05b33 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 _0x4723=['answer','hold','/unhold','/transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','hangup','/answer'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x4723,0x170));var _0x3472=function(_0x282320,_0x379ad6){_0x282320=_0x282320-0x0;var _0x271d54=_0x4723[_0x282320];return _0x271d54;};'use strict';var express=require('express');var router=express[_0x3472('0x0')]();var auth=require(_0x3472('0x1'));var controller=require(_0x3472('0x2'));router[_0x3472('0x3')](_0x3472('0x4'),auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller['originate']);router[_0x3472('0x3')]('/hangup',auth[_0x3472('0x5')](),auth['canUpdate'](),controller[_0x3472('0x7')]);router['post'](_0x3472('0x8'),auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller[_0x3472('0x9')]);router['post']('/hold',auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller[_0x3472('0xa')]);router[_0x3472('0x3')](_0x3472('0xb'),auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller['unhold']);router[_0x3472('0x3')]('/calls',auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller['calls']);router['post'](_0x3472('0xc'),auth[_0x3472('0x5')](),auth[_0x3472('0x6')](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0xbddc=['express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','hangup','/answer','answer','hold','/unhold','unhold','calls','/transfer','transfer','exports'];(function(_0x1226cf,_0xc202f9){var _0x5450db=function(_0x16eca8){while(--_0x16eca8){_0x1226cf['push'](_0x1226cf['shift']());}};_0x5450db(++_0xc202f9);}(_0xbddc,0x1e6));var _0xcbdd=function(_0xd40840,_0x334089){_0xd40840=_0xd40840-0x0;var _0x16ea03=_0xbddc[_0xd40840];return _0x16ea03;};'use strict';var express=require(_0xcbdd('0x0'));var router=express[_0xcbdd('0x1')]();var auth=require(_0xcbdd('0x2'));var controller=require(_0xcbdd('0x3'));router[_0xcbdd('0x4')](_0xcbdd('0x5'),auth[_0xcbdd('0x6')](),auth[_0xcbdd('0x7')](),controller['originate']);router[_0xcbdd('0x4')]('/hangup',auth[_0xcbdd('0x6')](),auth[_0xcbdd('0x7')](),controller[_0xcbdd('0x8')]);router[_0xcbdd('0x4')](_0xcbdd('0x9'),auth[_0xcbdd('0x6')](),auth[_0xcbdd('0x7')](),controller[_0xcbdd('0xa')]);router[_0xcbdd('0x4')]('/hold',auth['isAuthenticated'](),auth[_0xcbdd('0x7')](),controller[_0xcbdd('0xb')]);router[_0xcbdd('0x4')](_0xcbdd('0xc'),auth[_0xcbdd('0x6')](),auth['canUpdate'](),controller[_0xcbdd('0xd')]);router[_0xcbdd('0x4')]('/calls',auth[_0xcbdd('0x6')](),auth['canUpdate'](),controller[_0xcbdd('0xe')]);router[_0xcbdd('0x4')](_0xcbdd('0xf'),auth[_0xcbdd('0x6')](),auth['canUpdate'](),controller[_0xcbdd('0x10')]);module[_0xcbdd('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 3bcf458..2355c15 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 _0xe644=['rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callerId','callbackUrl','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','format','user:%s','webbar:hangup','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','send','status','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter'];(function(_0x2aba58,_0x520d37){var _0x430761=function(_0x1fa9cc){while(--_0x1fa9cc){_0x2aba58['push'](_0x2aba58['shift']());}};_0x430761(++_0x520d37);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x4e64('0x0'));var fs=require('fs');var _=require(_0x4e64('0x1'));var db=require(_0x4e64('0x2'))['db'];var config=require(_0x4e64('0x3'));var util=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x4e64('0x6')][_0x4e64('0x7')]({'port':0x232a});var logger=require(_0x4e64('0x8'))(_0x4e64('0x9'));var Redis=require(_0x4e64('0xa'));config[_0x4e64('0xb')]=_['defaults'](config[_0x4e64('0xb')],{'host':_0x4e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x4e64('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4e64('0xe'),'required':[!![],_0x4e64('0xf')]},'callerId':{'type':_0x4e64('0xe')},'callbackUrl':{'type':_0x4e64('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x4e64('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x4e64('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4e64('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]}});function emit(_0x5b35b0,_0x3b885a,_0x3677f9){logger[_0x4e64('0x14')](_0x5b35b0,_0x3b885a,JSON[_0x4e64('0x15')](_0x3677f9));io['to'](_0x5b35b0)[_0x4e64('0x16')](_0x3b885a,_0x3677f9);}function handleError(_0x2a60ad){return function(_0x135ffb){console[_0x4e64('0x17')](_0x4e64('0x18'),_0x135ffb,_0x135ffb instanceof RangeError);logger[_0x4e64('0x19')](_0x135ffb['stack']);if(_0x135ffb instanceof RangeError){if(_0x135ffb[_0x4e64('0x1a')]){delete _0x135ffb[_0x4e64('0x1a')];}_0x2a60ad['status'](0x194)[_0x4e64('0x1b')](_0x135ffb);}else{if(_0x135ffb['name']){delete _0x135ffb['name'];}_0x2a60ad[_0x4e64('0x1c')](0x1f4)[_0x4e64('0x1b')](_0x135ffb);}};}function checkError(){return function(_0x227d64){if(!_0x227d64){throw new RangeError('NotFound');}return _0x227d64;};}function respondWithRpcPromise(_0x4a5c6d,_0x4a9957){return new BPromise(function(_0x30e356,_0x336c53){var _0x2df7a0=amiClient;return _0x2df7a0['request'](_0x4a5c6d,_0x4a9957)[_0x4e64('0x1d')](function(_0x58ea85){if(_0x58ea85[_0x4e64('0x19')]){if(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1e')]===0x1f4){return _0x336c53(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1f')]);}return _0x30e356(_0x58ea85['error'][_0x4e64('0x1f')]);}else{_0x30e356(_0x58ea85[_0x4e64('0x20')]);}})[_0x4e64('0x21')](function(_0x4afb9c){_0x336c53(_0x4afb9c);});});}function getAgent(_0x786ba9){return db[_0x4e64('0x22')][_0x4e64('0x23')]({'where':{'id':_0x786ba9,'role':_0x4e64('0x24')}})[_0x4e64('0x1d')](checkError());}function getAgentCheckSession(_0x5f0d42,_0x3185ba){return new BPromise(function(_0x2b1f2b,_0x45953f){var _0x194f33=respondWithRpcPromise(_0x4e64('0x25'));var _0x1057d0=getAgent(_0x5f0d42);Promise[_0x4e64('0x26')]([_0x194f33,_0x1057d0])[_0x4e64('0x1d')](function(_0x5467a5){var _0x371035=_0x5467a5[0x0];var _0xb17ca7=_0x5467a5[0x1];var _0x45ef44=_[_0x4e64('0x27')](_0x371035[_0x4e64('0x28')],function(_0x3b1f16){return _0x3b1f16[_0x4e64('0x29')]==_0xb17ca7['id']&&_0x3b1f16['sessionId']==_0x3185ba;});if(_0x45ef44[_0x4e64('0x2a')]==0x1){_0x2b1f2b(_0xb17ca7);}else{_0x45953f(new RangeError(_0x4e64('0x2b')+_0x3185ba+_0x4e64('0x2c')));}});});}exports[_0x4e64('0x2d')]=function(_0x3d8042,_0x3d6cec){logger[_0x4e64('0x14')]('originate\x20fired:',_0x3d8042[_0x4e64('0x2e')]);var _0x317c07=originateValidation[_0x4e64('0xd')](_0x3d8042['body']);if(_0x317c07[_0x4e64('0x2a')]>0x0){return _0x3d6cec['status'](0x190)[_0x4e64('0x2f')](_0x317c07);}var _0x37cde0=_0x3d8042['body']['userId'];var _0x5417ad=_0x3d8042[_0x4e64('0x2e')]['callNumber'];var _0x2c2397=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x30')];var _0x18ca6c=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x31')];return getAgent(_0x37cde0)[_0x4e64('0x1d')](function(_0x50b8d5){logger[_0x4e64('0x14')]('entityFound:',_0x50b8d5[_0x4e64('0x1a')]);emit(util['format']('user:%s',_0x50b8d5['name']),_0x4e64('0x32'),{'callNumber':_0x5417ad,'callerId':_0x2c2397,'callbackUrl':_0x18ca6c});return _0x3d6cec['status'](0xc8)['json']({'error':![],'message':_0x4e64('0x33')});})[_0x4e64('0x21')](handleError(_0x3d6cec));};exports[_0x4e64('0x34')]=function(_0x189769,_0x1757a2){logger[_0x4e64('0x14')](_0x4e64('0x35'),_0x189769['body']);var _0x5a03a8=hangupValidation['validate'](_0x189769[_0x4e64('0x2e')]);if(_0x5a03a8[_0x4e64('0x2a')]>0x0){return _0x1757a2[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x5a03a8);}var _0x5bf847=_0x189769[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x11c373=_0x189769[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x5bf847)['then'](function(_0x4faf59){logger[_0x4e64('0x14')]('entityFound:',_0x4faf59[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x4faf59[_0x4e64('0x1a')]),_0x4e64('0x3a'),{'sessionId':_0x11c373});return _0x1757a2[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x4e64('0x21')](handleError(_0x1757a2));};exports[_0x4e64('0x3b')]=function(_0x460d66,_0x2e6684){logger[_0x4e64('0x14')](_0x4e64('0x3c'),_0x460d66[_0x4e64('0x2e')]);var _0x21e835=answerValidation['validate'](_0x460d66[_0x4e64('0x2e')]);if(_0x21e835[_0x4e64('0x2a')]>0x0){return _0x2e6684['status'](0x190)[_0x4e64('0x2f')](_0x21e835);}var _0x306b4d=_0x460d66['body'][_0x4e64('0x36')];var _0x1ddcf2=_0x460d66[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x306b4d)[_0x4e64('0x1d')](function(_0x5bc523){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x5bc523[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x5bc523[_0x4e64('0x1a')]),_0x4e64('0x3e'),{'sessionId':_0x1ddcf2});return _0x2e6684[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x4e64('0x21')](handleError(_0x2e6684));};exports[_0x4e64('0x3f')]=function(_0x3cf687,_0x5861d7){logger[_0x4e64('0x14')](_0x4e64('0x40'),_0x3cf687[_0x4e64('0x2e')]);var _0x19a71b=holdValidation[_0x4e64('0xd')](_0x3cf687['body']);if(_0x19a71b[_0x4e64('0x2a')]>0x0){return _0x5861d7['status'](0x190)[_0x4e64('0x2f')](_0x19a71b);}var _0x3a5fad=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x4cfac3=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x3a5fad)[_0x4e64('0x1d')](function(_0x38a885){logger[_0x4e64('0x14')]('entityFound:',_0x38a885[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x38a885[_0x4e64('0x1a')]),_0x4e64('0x41'),{'sessionId':_0x4cfac3});return _0x5861d7[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x42')});})[_0x4e64('0x21')](handleError(_0x5861d7));};exports[_0x4e64('0x43')]=function(_0x4c2948,_0x44946b){logger[_0x4e64('0x14')]('unhold\x20fired:',_0x4c2948[_0x4e64('0x2e')]);var _0x5cedc6=unholdValidation[_0x4e64('0xd')](_0x4c2948['body']);if(_0x5cedc6[_0x4e64('0x2a')]>0x0){return _0x44946b['status'](0x190)[_0x4e64('0x2f')](_0x5cedc6);}var _0xb2c2c7=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x33933a=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0xb2c2c7)['then'](function(_0x471be1){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x471be1['name']);emit(util['format'](_0x4e64('0x39'),_0x471be1['name']),_0x4e64('0x44'),{'sessionId':_0x33933a});return _0x44946b[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':_0x4e64('0x45')});})[_0x4e64('0x21')](handleError(_0x44946b));};exports['calls']=function(_0x562f53,_0x339e39){logger[_0x4e64('0x14')](_0x4e64('0x46'),_0x339e39[_0x4e64('0x2e')]);var _0x3def87=callsValidation[_0x4e64('0xd')](_0x562f53[_0x4e64('0x2e')]);if(_0x3def87[_0x4e64('0x2a')]>0x0){return _0x339e39['status'](0x190)[_0x4e64('0x2f')](_0x3def87);}var _0x3251a3=_0x562f53[_0x4e64('0x2e')]['userId'];var _0xa277da=respondWithRpcPromise(_0x4e64('0x25'));var _0x502640=getAgent(_0x3251a3);return Promise[_0x4e64('0x26')]([_0xa277da,_0x502640])[_0x4e64('0x1d')](function(_0xb1ef5f){var _0x377da8=_0xb1ef5f[0x0];var _0x82dcde=_0xb1ef5f[0x1];var _0x10d2ac=_['filter'](_0x377da8[_0x4e64('0x28')],function(_0x12bf29){return _0x12bf29[_0x4e64('0x29')]==_0x82dcde['id'];});return _0x339e39['status'](0xc8)[_0x4e64('0x2f')]({'count':_0x10d2ac[_0x4e64('0x2a')],'rows':_0x10d2ac});})[_0x4e64('0x21')](handleError(_0x339e39));};exports[_0x4e64('0x47')]=function(_0x5d3789,_0x1914bf){logger[_0x4e64('0x14')]('conference\x20fired:',_0x5d3789[_0x4e64('0x2e')]);var _0xafc845=conferenceValidation[_0x4e64('0xd')](_0x5d3789[_0x4e64('0x2e')]);if(_0xafc845[_0x4e64('0x2a')]>0x0){return _0x1914bf[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0xafc845);}var _0x40873c=_0x5d3789['body'][_0x4e64('0x36')];return getAgent(_0x40873c)[_0x4e64('0x1d')](function(_0x489a34){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x489a34[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x489a34['name']),_0x4e64('0x48'));return _0x1914bf[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x49')});})[_0x4e64('0x21')](handleError(_0x1914bf));};exports[_0x4e64('0x4a')]=function(_0x44c368,_0xf9c4e0){logger[_0x4e64('0x14')]('transfer\x20fired:',_0x44c368[_0x4e64('0x2e')]);var _0x291fe8=transferValidation[_0x4e64('0xd')](_0x44c368['body']);if(_0x291fe8[_0x4e64('0x2a')]>0x0){return _0xf9c4e0[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x291fe8);}var _0x5ed23f=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x5761c9=_0x44c368['body']['sessionId'];var _0x3f2a81=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x4b')];return getAgent(_0x5ed23f)[_0x4e64('0x1d')](function(_0x27db3f){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x27db3f[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x27db3f[_0x4e64('0x1a')]),_0x4e64('0x4c'),{'sessionId':_0x5761c9,'transferNumber':_0x3f2a81});return _0xf9c4e0[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0xf9c4e0));}; \ No newline at end of file +var _0x9099=['../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','callNumber\x20is\x20required','string','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','../../mysqldb'];(function(_0x51fb8b,_0x5cfa7c){var _0x2e9263=function(_0x2c95d9){while(--_0x2c95d9){_0x51fb8b['push'](_0x51fb8b['shift']());}};_0x2e9263(++_0x5cfa7c);}(_0x9099,0x1ac));var _0x9909=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x9099[_0x2d9535];return _0xb4e710;};'use strict';var path=require(_0x9909('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x9909('0x1'))['db'];var config=require(_0x9909('0x2'));var util=require(_0x9909('0x3'));var BPromise=require(_0x9909('0x4'));var jayson=require(_0x9909('0x5'));var amiClient=jayson[_0x9909('0x6')][_0x9909('0x7')]({'port':0x232a});var logger=require(_0x9909('0x8'))(_0x9909('0x9'));var Redis=require(_0x9909('0xa'));config[_0x9909('0xb')]=_[_0x9909('0xc')](config[_0x9909('0xb')],{'host':_0x9909('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9909('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x9909('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9909('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':[!![],_0x9909('0x12')]},'transferNumber':{'type':_0x9909('0xf'),'required':[!![],_0x9909('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9909('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9909('0x11')]}});function emit(_0x5bd7e7,_0x1a9c97,_0x1b56c7){logger[_0x9909('0x14')](_0x5bd7e7,_0x1a9c97,JSON['stringify'](_0x1b56c7));io['to'](_0x5bd7e7)[_0x9909('0x15')](_0x1a9c97,_0x1b56c7);}function handleError(_0xb003b6){return function(_0x180929){console[_0x9909('0x16')](_0x9909('0x17'),_0x180929,_0x180929 instanceof RangeError);logger[_0x9909('0x18')](_0x180929[_0x9909('0x19')]);if(_0x180929 instanceof RangeError){if(_0x180929['name']){delete _0x180929[_0x9909('0x1a')];}_0xb003b6[_0x9909('0x1b')](0x194)['send'](_0x180929);}else{if(_0x180929[_0x9909('0x1a')]){delete _0x180929[_0x9909('0x1a')];}_0xb003b6[_0x9909('0x1b')](0x1f4)[_0x9909('0x1c')](_0x180929);}};}function checkError(){return function(_0xe6275e){if(!_0xe6275e){throw new RangeError(_0x9909('0x1d'));}return _0xe6275e;};}function respondWithRpcPromise(_0x262d69,_0x54d0e2){return new BPromise(function(_0x112727,_0x319c31){var _0x4a626b=amiClient;return _0x4a626b['request'](_0x262d69,_0x54d0e2)[_0x9909('0x1e')](function(_0x176593){if(_0x176593[_0x9909('0x18')]){if(_0x176593[_0x9909('0x18')][_0x9909('0x1f')]===0x1f4){return _0x319c31(_0x176593['error']['message']);}return _0x112727(_0x176593[_0x9909('0x18')][_0x9909('0x20')]);}else{_0x112727(_0x176593[_0x9909('0x21')]);}})[_0x9909('0x22')](function(_0x52be17){_0x319c31(_0x52be17);});});}function getAgent(_0x20a8ec){return db[_0x9909('0x23')][_0x9909('0x24')]({'where':{'id':_0x20a8ec,'role':_0x9909('0x25')}})['then'](checkError());}function getAgentCheckSession(_0x405c5e,_0x22ff12){return new BPromise(function(_0x19c7e8,_0x14ec4b){var _0x5250d8=respondWithRpcPromise(_0x9909('0x26'));var _0x175d52=getAgent(_0x405c5e);Promise[_0x9909('0x27')]([_0x5250d8,_0x175d52])[_0x9909('0x1e')](function(_0x26267b){var _0x43f368=_0x26267b[0x0];var _0x427530=_0x26267b[0x1];var _0x4f1e52=_[_0x9909('0x28')](_0x43f368[_0x9909('0x29')],function(_0x87ac8a){return _0x87ac8a[_0x9909('0x2a')]==_0x427530['id']&&_0x87ac8a[_0x9909('0x2b')]==_0x22ff12;});if(_0x4f1e52['length']==0x1){_0x19c7e8(_0x427530);}else{_0x14ec4b(new RangeError(_0x9909('0x2c')+_0x22ff12+_0x9909('0x2d')));}});});}exports[_0x9909('0x2e')]=function(_0x3e599a,_0xc1bd06){logger[_0x9909('0x14')](_0x9909('0x2f'),_0x3e599a[_0x9909('0x30')]);var _0x59886b=originateValidation['validate'](_0x3e599a[_0x9909('0x30')]);if(_0x59886b[_0x9909('0x31')]>0x0){return _0xc1bd06['status'](0x190)[_0x9909('0x32')](_0x59886b);}var _0x323f15=_0x3e599a[_0x9909('0x30')][_0x9909('0x33')];var _0x46affb=_0x3e599a[_0x9909('0x30')][_0x9909('0x34')];var _0x51ed4e=_0x3e599a[_0x9909('0x30')][_0x9909('0x35')];var _0x262452=_0x3e599a[_0x9909('0x30')][_0x9909('0x36')];return getAgent(_0x323f15)['then'](function(_0x7f709e){logger[_0x9909('0x14')]('entityFound:',_0x7f709e[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x7f709e[_0x9909('0x1a')]),_0x9909('0x39'),{'callNumber':_0x46affb,'callerId':_0x51ed4e,'callbackUrl':_0x262452});return _0xc1bd06[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x3a')});})[_0x9909('0x22')](handleError(_0xc1bd06));};exports[_0x9909('0x3b')]=function(_0x45e897,_0x449074){logger[_0x9909('0x14')](_0x9909('0x3c'),_0x45e897[_0x9909('0x30')]);var _0x222769=hangupValidation[_0x9909('0x3d')](_0x45e897[_0x9909('0x30')]);if(_0x222769[_0x9909('0x31')]>0x0){return _0x449074[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x222769);}var _0x201897=_0x45e897[_0x9909('0x30')][_0x9909('0x33')];var _0x3dc4e9=_0x45e897[_0x9909('0x30')][_0x9909('0x2b')];return getAgent(_0x201897)[_0x9909('0x1e')](function(_0x1b224d){logger[_0x9909('0x14')]('entityFound:',_0x1b224d['name']);emit(util[_0x9909('0x37')]('user:%s',_0x1b224d['name']),_0x9909('0x3e'),{'sessionId':_0x3dc4e9});return _0x449074[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x3f')});})['catch'](handleError(_0x449074));};exports[_0x9909('0x40')]=function(_0x312373,_0x5e0bd7){logger['info'](_0x9909('0x41'),_0x312373[_0x9909('0x30')]);var _0x345ba0=answerValidation['validate'](_0x312373[_0x9909('0x30')]);if(_0x345ba0[_0x9909('0x31')]>0x0){return _0x5e0bd7[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x345ba0);}var _0x1f57bd=_0x312373[_0x9909('0x30')][_0x9909('0x33')];var _0x3b1844=_0x312373['body'][_0x9909('0x2b')];return getAgent(_0x1f57bd)[_0x9909('0x1e')](function(_0x512f97){logger[_0x9909('0x14')](_0x9909('0x42'),_0x512f97['name']);emit(util['format'](_0x9909('0x38'),_0x512f97[_0x9909('0x1a')]),_0x9909('0x43'),{'sessionId':_0x3b1844});return _0x5e0bd7[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x44')});})[_0x9909('0x22')](handleError(_0x5e0bd7));};exports[_0x9909('0x45')]=function(_0x415407,_0x33fd6c){logger['info'](_0x9909('0x46'),_0x415407[_0x9909('0x30')]);var _0x4234fd=holdValidation[_0x9909('0x3d')](_0x415407['body']);if(_0x4234fd['length']>0x0){return _0x33fd6c[_0x9909('0x1b')](0x190)['json'](_0x4234fd);}var _0x266957=_0x415407[_0x9909('0x30')][_0x9909('0x33')];var _0x56a3c7=_0x415407[_0x9909('0x30')][_0x9909('0x2b')];return getAgent(_0x266957)[_0x9909('0x1e')](function(_0x54152c){logger[_0x9909('0x14')](_0x9909('0x42'),_0x54152c[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x54152c[_0x9909('0x1a')]),_0x9909('0x47'),{'sessionId':_0x56a3c7});return _0x33fd6c['status'](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x48')});})['catch'](handleError(_0x33fd6c));};exports[_0x9909('0x49')]=function(_0x240947,_0x3d105f){logger[_0x9909('0x14')](_0x9909('0x4a'),_0x240947['body']);var _0x24e3ae=unholdValidation['validate'](_0x240947[_0x9909('0x30')]);if(_0x24e3ae[_0x9909('0x31')]>0x0){return _0x3d105f[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x24e3ae);}var _0xfc8c2=_0x240947[_0x9909('0x30')][_0x9909('0x33')];var _0x109625=_0x240947['body']['sessionId'];return getAgent(_0xfc8c2)[_0x9909('0x1e')](function(_0x55ec6e){logger['info'](_0x9909('0x42'),_0x55ec6e[_0x9909('0x1a')]);emit(util['format'](_0x9909('0x38'),_0x55ec6e[_0x9909('0x1a')]),_0x9909('0x4b'),{'sessionId':_0x109625});return _0x3d105f[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x4c')});})['catch'](handleError(_0x3d105f));};exports[_0x9909('0x4d')]=function(_0x2517ff,_0x50ada8){logger['info'](_0x9909('0x4e'),_0x50ada8['body']);var _0x180cf5=callsValidation[_0x9909('0x3d')](_0x2517ff[_0x9909('0x30')]);if(_0x180cf5[_0x9909('0x31')]>0x0){return _0x50ada8['status'](0x190)['json'](_0x180cf5);}var _0x5d9337=_0x2517ff[_0x9909('0x30')][_0x9909('0x33')];var _0x4e48f0=respondWithRpcPromise('VoiceChannels');var _0x2f575b=getAgent(_0x5d9337);return Promise[_0x9909('0x27')]([_0x4e48f0,_0x2f575b])[_0x9909('0x1e')](function(_0x5a7337){var _0xdfa2b0=_0x5a7337[0x0];var _0x42e4fe=_0x5a7337[0x1];var _0x4826b7=_[_0x9909('0x28')](_0xdfa2b0[_0x9909('0x29')],function(_0x400aad){return _0x400aad[_0x9909('0x2a')]==_0x42e4fe['id'];});return _0x50ada8['status'](0xc8)['json']({'count':_0x4826b7[_0x9909('0x31')],'rows':_0x4826b7});})[_0x9909('0x22')](handleError(_0x50ada8));};exports[_0x9909('0x4f')]=function(_0x9cf51d,_0xb73944){logger[_0x9909('0x14')](_0x9909('0x50'),_0x9cf51d[_0x9909('0x30')]);var _0x291c47=conferenceValidation[_0x9909('0x3d')](_0x9cf51d['body']);if(_0x291c47[_0x9909('0x31')]>0x0){return _0xb73944[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x291c47);}var _0x3ab49c=_0x9cf51d[_0x9909('0x30')][_0x9909('0x33')];return getAgent(_0x3ab49c)[_0x9909('0x1e')](function(_0x3b92f8){logger[_0x9909('0x14')](_0x9909('0x42'),_0x3b92f8['name']);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x3b92f8[_0x9909('0x1a')]),_0x9909('0x51'));return _0xb73944[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x52')});})['catch'](handleError(_0xb73944));};exports[_0x9909('0x53')]=function(_0xd56c48,_0x884c61){logger[_0x9909('0x14')]('transfer\x20fired:',_0xd56c48[_0x9909('0x30')]);var _0x2bb2f4=transferValidation['validate'](_0xd56c48[_0x9909('0x30')]);if(_0x2bb2f4[_0x9909('0x31')]>0x0){return _0x884c61[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x2bb2f4);}var _0x38decb=_0xd56c48[_0x9909('0x30')][_0x9909('0x33')];var _0x2ed52e=_0xd56c48[_0x9909('0x30')]['sessionId'];var _0x5691e2=_0xd56c48['body'][_0x9909('0x54')];return getAgent(_0x38decb)[_0x9909('0x1e')](function(_0x5a15eb){logger[_0x9909('0x14')](_0x9909('0x42'),_0x5a15eb[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x5a15eb['name']),'webbar:transfer',{'sessionId':_0x2ed52e,'transferNumber':_0x5691e2});return _0x884c61[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x55')});})[_0x9909('0x22')](handleError(_0x884c61));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9959cd4..bac91c9 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 _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0x7880,0x1f4));var _0x0788=function(_0x2f2377,_0x11cc21){_0x2f2377=_0x2f2377-0x0;var _0x441e6b=_0x7880[_0x2f2377];return _0x441e6b;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router; \ No newline at end of file +var _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0x35c9b9,_0x491966){var _0x128eff=function(_0xd492ea){while(--_0xd492ea){_0x35c9b9['push'](_0x35c9b9['shift']());}};_0x128eff(++_0x491966);}(_0xfcf0,0x138));var _0x0fcf=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xfcf0[_0x11e05d];return _0x335588;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 6522d67..c7c593a 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 _0xa4cc=['ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate'];(function(_0x1f5218,_0x552311){var _0x27fed5=function(_0x1befa4){while(--_0x1befa4){_0x1f5218['push'](_0x1f5218['shift']());}};_0x27fed5(++_0x552311);}(_0xa4cc,0xa3));var _0xca4c=function(_0x137c32,_0x1ad9b4){_0x137c32=_0x137c32-0x0;var _0x2a9112=_0xa4cc[_0x137c32];return _0x2a9112;};'use strict';var Sequelize=require(_0xca4c('0x0'));var rs=require('randomstring');module[_0xca4c('0x1')]={'name':{'type':Sequelize[_0xca4c('0x2')],'unique':_0xca4c('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xca4c('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xca4c('0x5')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xca4c('0x2')]},'notificationTemplate':{'type':Sequelize[_0xca4c('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xca4c('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xca4c('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca4c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xca4c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca4c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca4c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca4c('0x8')],'comment':_0xca4c('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xca4c('0x7')],'defaultValue':![],'comment':_0xca4c('0xa'),'set':function(_0x5be176){if(!_0x5be176){this[_0xca4c('0xb')](_0xca4c('0xc'),null);}this[_0xca4c('0xb')](_0xca4c('0xd'),_0x5be176);}},'description':{'type':Sequelize[_0xca4c('0x2')]}}; \ No newline at end of file +var _0xe673=['ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','generate'];(function(_0x3763d8,_0xef288f){var _0x5c223e=function(_0x20f4af){while(--_0x20f4af){_0x3763d8['push'](_0x3763d8['shift']());}};_0x5c223e(++_0xef288f);}(_0xe673,0x1bc));var _0x3e67=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe673[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3e67('0x0'));var rs=require(_0x3e67('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x3e67('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3e67('0x2')],'defaultValue':function(){return rs[_0x3e67('0x3')]();}},'phone':{'type':Sequelize[_0x3e67('0x2')]},'type':{'type':Sequelize[_0x3e67('0x4')](_0x3e67('0x5'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3e67('0x6')],'defaultValue':function(){return _0x3e67('0x7');}},'notificationSound':{'type':Sequelize[_0x3e67('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3e67('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e67('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e67('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e67('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e67('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e67('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3e67('0x8')],'defaultValue':![],'comment':_0x3e67('0xa'),'set':function(_0x1e59a8){if(!_0x1e59a8){this['setDataValue'](_0x3e67('0xb'),null);}this[_0x3e67('0xc')](_0x3e67('0xd'),_0x1e59a8);}},'description':{'type':Sequelize[_0x3e67('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 88870fa..43d6425 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 _0x3f37=['updatedAt','difference','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','CmContact','DESC','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','send','\x0a','to\x20is\x20mandatory','List','user','out','dataValues','Messages','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','client','http','request','then','info','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','stack','name','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','applications','asc','Sequelize','ValidationError','createdAt'];(function(_0x4b4c9b,_0x2bdec8){var _0x1aea08=function(_0x5c1d6e){while(--_0x5c1d6e){_0x4b4c9b['push'](_0x4b4c9b['shift']());}};_0x1aea08(++_0x2bdec8);}(_0x3f37,0xe9));var _0x73f3=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x3f37[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x73f3('0x0'));var rp=require('request-promise');var moment=require(_0x73f3('0x1'));var BPromise=require(_0x73f3('0x2'));var Mustache=require(_0x73f3('0x3'));var util=require(_0x73f3('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x73f3('0x5'));var ejs=require(_0x73f3('0x6'));var fs=require('fs');var fs_extra=require(_0x73f3('0x7'));var _=require(_0x73f3('0x8'));var squel=require(_0x73f3('0x9'));var crypto=require(_0x73f3('0xa'));var jsforce=require(_0x73f3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x73f3('0xc'));var Redis=require(_0x73f3('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73f3('0xe'));var hardwareService=require(_0x73f3('0xf'));var logger=require('../../config/logger')(_0x73f3('0x10'));var utils=require('../../config/utils');var config=require(_0x73f3('0x11'));var licenseUtil=require(_0x73f3('0x12'));var db=require(_0x73f3('0x13'))['db'];config['redis']=_[_0x73f3('0x14')](config[_0x73f3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x73f3('0x16'))(new Redis(config[_0x73f3('0x15')]));require(_0x73f3('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x73f3('0x18')][_0x73f3('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x18ca0d,_0x4f4ba5,_0x26aa03,_0xa9b187){return new BPromise(function(_0x3dc946,_0x410c42){var _0x31af6e=_0xa9b187||client;return _0x31af6e[_0x73f3('0x1a')](_0x18ca0d,_0x26aa03)[_0x73f3('0x1b')](function(_0x438487){logger[_0x73f3('0x1c')]('WhatsappAccount,\x20%s,\x20%s',_0x4f4ba5,_0x73f3('0x1d'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4f4ba5,'request\x20sent',JSON[_0x73f3('0x1e')](_0x438487));if(_0x438487['error']){if(_0x438487[_0x73f3('0x1f')][_0x73f3('0x20')]===0x1f4){logger[_0x73f3('0x1f')](_0x73f3('0x21'),_0x4f4ba5,_0x438487['error'][_0x73f3('0x22')]);return _0x410c42(_0x438487[_0x73f3('0x1f')][_0x73f3('0x22')]);}logger[_0x73f3('0x1f')](_0x73f3('0x21'),_0x4f4ba5,_0x438487['error'][_0x73f3('0x22')]);return _0x3dc946(_0x438487[_0x73f3('0x1f')][_0x73f3('0x22')]);}else{logger[_0x73f3('0x1c')](_0x73f3('0x21'),_0x4f4ba5,'request\x20sent');_0x3dc946(_0x438487['result'][_0x73f3('0x22')]);}})[_0x73f3('0x23')](function(_0x4b6b9f){logger[_0x73f3('0x1f')](_0x73f3('0x21'),_0x4f4ba5,_0x4b6b9f);_0x410c42(_0x4b6b9f);});});}function respondWithStatusCode(_0x366be3,_0x3fffd8){_0x3fffd8=_0x3fffd8||0xcc;return function(_0x3c9547){if(_0x3c9547){return _0x366be3['sendStatus'](_0x3fffd8);}return _0x366be3[_0x73f3('0x24')](_0x3fffd8)[_0x73f3('0x25')]();};}function respondWithResult(_0x353477,_0x2d1cdd){_0x2d1cdd=_0x2d1cdd||0xc8;return function(_0x1da620){if(_0x1da620){return _0x353477[_0x73f3('0x24')](_0x2d1cdd)[_0x73f3('0x26')](_0x1da620);}};}function respondWithFilteredResult(_0x46493e,_0x10edda){return function(_0x136007){if(_0x136007){var _0x5d79a3=typeof _0x10edda[_0x73f3('0x27')]===_0x73f3('0x28')&&typeof _0x10edda[_0x73f3('0x29')]===_0x73f3('0x28');var _0x4d93c3=_0x136007[_0x73f3('0x2a')];var _0x160bce=_0x5d79a3?0x0:_0x10edda[_0x73f3('0x27')];var _0x4cbd2b=_0x5d79a3?_0x136007[_0x73f3('0x2a')]:_0x10edda[_0x73f3('0x27')]+_0x10edda[_0x73f3('0x29')];var _0x5d8ee4;if(_0x4cbd2b>=_0x4d93c3){_0x4cbd2b=_0x4d93c3;_0x5d8ee4=0xc8;}else{_0x5d8ee4=0xce;}_0x46493e[_0x73f3('0x24')](_0x5d8ee4);return _0x46493e['set'](_0x73f3('0x2b'),_0x160bce+'-'+_0x4cbd2b+'/'+_0x4d93c3)['json'](_0x136007);}return null;};}function patchUpdates(_0x35d872){return function(_0x91073c){try{jsonpatch[_0x73f3('0x2c')](_0x91073c,_0x35d872,!![]);}catch(_0x48a425){return BPromise[_0x73f3('0x2d')](_0x48a425);}return _0x91073c[_0x73f3('0x2e')]();};}function saveUpdates(_0x5c4b83,_0xbeb63d){return function(_0x3527c9){if(_0x3527c9){return _0x3527c9[_0x73f3('0x2f')](_0x5c4b83)['then'](function(_0x27457f){return _0x27457f;});}return null;};}function removeEntity(_0x317f0d,_0x3236e8){return function(_0x168885){if(_0x168885){return _0x168885[_0x73f3('0x30')]()[_0x73f3('0x1b')](function(){var _0x4b8419=_0x168885['get']({'plain':!![]});var _0xa93c89=_0x73f3('0x31');return db['UserProfileResource'][_0x73f3('0x30')]({'where':{'type':_0xa93c89,'resourceId':_0x4b8419['id']}})[_0x73f3('0x1b')](function(){return _0x168885;});})[_0x73f3('0x1b')](function(){_0x317f0d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xde56d9,_0x24519e){return function(_0x2d5ce1){if(!_0x2d5ce1){_0xde56d9['sendStatus'](0x194);}return _0x2d5ce1;};}function handleError(_0x57b4ec,_0x75eb38){_0x75eb38=_0x75eb38||0x1f4;return function(_0x560cc7){logger['error'](_0x560cc7[_0x73f3('0x32')]);if(_0x560cc7[_0x73f3('0x33')]){delete _0x560cc7[_0x73f3('0x33')];}_0x57b4ec[_0x73f3('0x24')](_0x75eb38)['send'](_0x560cc7);};}exports[_0x73f3('0x34')]=function(_0x21a62f,_0x4241fc){var _0x5a2401={'include':[{'model':db[_0x73f3('0x35')],'as':_0x73f3('0x36')}]},_0x34509a={},_0x3c8340={'count':0x0,'rows':[]};var _0x2e621d=_['map'](db[_0x73f3('0x37')][_0x73f3('0x38')],function(_0xe2c3af){return{'name':_0xe2c3af[_0x73f3('0x39')],'type':_0xe2c3af[_0x73f3('0x3a')][_0x73f3('0x3b')]};});_0x34509a['model']=_[_0x73f3('0x3c')](_0x2e621d,_0x73f3('0x33'));_0x34509a[_0x73f3('0x3d')]=_[_0x73f3('0x3e')](_0x21a62f[_0x73f3('0x3d')]);_0x34509a[_0x73f3('0x3f')]=_[_0x73f3('0x40')](_0x34509a['model'],_0x34509a[_0x73f3('0x3d')]);_0x5a2401[_0x73f3('0x41')]=_[_0x73f3('0x40')](_0x34509a[_0x73f3('0x42')],qs[_0x73f3('0x43')](_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x43')]));_0x5a2401[_0x73f3('0x41')]=_0x5a2401[_0x73f3('0x41')][_0x73f3('0x44')]?_0x5a2401[_0x73f3('0x41')]:_0x34509a[_0x73f3('0x42')];if(!_0x21a62f['query'][_0x73f3('0x45')]('nolimit')){_0x5a2401[_0x73f3('0x29')]=qs[_0x73f3('0x29')](_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x29')]);_0x5a2401['offset']=qs[_0x73f3('0x27')](_0x21a62f['query']['offset']);}_0x5a2401[_0x73f3('0x46')]=qs[_0x73f3('0x47')](_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x47')]);_0x5a2401[_0x73f3('0x48')]=qs[_0x73f3('0x3f')](_['pick'](_0x21a62f[_0x73f3('0x3d')],_0x34509a['filters']),_0x2e621d);if(_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x49')]){_0x5a2401[_0x73f3('0x48')]=_[_0x73f3('0x4a')](_0x5a2401['where'],{'$or':_[_0x73f3('0x3c')](_0x2e621d,function(_0x111fb5){if(_0x111fb5[_0x73f3('0x3a')]!==_0x73f3('0x4b')){var _0x58c00d={};_0x58c00d[_0x111fb5[_0x73f3('0x33')]]={'$like':'%'+_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x49')]+'%'};return _0x58c00d;}})});}_0x5a2401=_[_0x73f3('0x4a')]({},_0x5a2401,_0x21a62f['options']);var _0x29def3={'where':_0x5a2401[_0x73f3('0x48')]};return db['WhatsappAccount'][_0x73f3('0x2a')](_0x29def3)[_0x73f3('0x1b')](function(_0x373979){_0x3c8340[_0x73f3('0x2a')]=_0x373979;if(_0x21a62f[_0x73f3('0x3d')][_0x73f3('0x4c')]){_0x5a2401[_0x73f3('0x4d')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x73f3('0x4e')](_0x5a2401);})[_0x73f3('0x1b')](function(_0x4d1350){_0x3c8340[_0x73f3('0x4f')]=_0x4d1350;return _0x3c8340;})[_0x73f3('0x1b')](respondWithFilteredResult(_0x4241fc,_0x5a2401))[_0x73f3('0x23')](handleError(_0x4241fc,null));};exports[_0x73f3('0x50')]=function(_0x4cba54,_0x526881){var _0x262abf={'raw':![],'where':{'id':_0x4cba54[_0x73f3('0x51')]['id']},'include':[{'model':db[_0x73f3('0x35')],'as':_0x73f3('0x36')}]},_0x17192c={};_0x17192c[_0x73f3('0x42')]=_[_0x73f3('0x3e')](db[_0x73f3('0x37')][_0x73f3('0x38')]);_0x17192c[_0x73f3('0x3d')]=_[_0x73f3('0x3e')](_0x4cba54[_0x73f3('0x3d')]);_0x17192c[_0x73f3('0x3f')]=_[_0x73f3('0x40')](_0x17192c[_0x73f3('0x42')],_0x17192c[_0x73f3('0x3d')]);_0x262abf[_0x73f3('0x41')]=_[_0x73f3('0x40')](_0x17192c[_0x73f3('0x42')],qs[_0x73f3('0x43')](_0x4cba54['query'][_0x73f3('0x43')]));_0x262abf[_0x73f3('0x41')]=_0x262abf[_0x73f3('0x41')]['length']?_0x262abf[_0x73f3('0x41')]:_0x17192c[_0x73f3('0x42')];if(_0x4cba54[_0x73f3('0x3d')]['includeAll']){_0x262abf[_0x73f3('0x4d')]=[{'all':!![]}];}_0x262abf=_[_0x73f3('0x4a')]({},_0x262abf,_0x4cba54[_0x73f3('0x52')]);return db[_0x73f3('0x37')][_0x73f3('0x53')](_0x262abf)[_0x73f3('0x1b')](handleEntityNotFound(_0x526881,null))[_0x73f3('0x1b')](respondWithResult(_0x526881,null))['catch'](handleError(_0x526881,null));};exports[_0x73f3('0x54')]=function(_0x31016d,_0x5cdf63){return db[_0x73f3('0x37')][_0x73f3('0x54')](_0x31016d[_0x73f3('0x55')],{})[_0x73f3('0x1b')](function(_0x23dc70){var _0x47a96f=_0x31016d['user'][_0x73f3('0x56')]({'plain':!![]});if(!_0x47a96f)throw new Error(_0x73f3('0x57'));if(_0x47a96f[_0x73f3('0x58')]==='user'){var _0x3268d5=_0x23dc70[_0x73f3('0x56')]({'plain':!![]});var _0x58b4ff='WhatsappAccounts';return db[_0x73f3('0x59')]['find']({'where':{'name':_0x58b4ff,'userProfileId':_0x47a96f[_0x73f3('0x5a')]},'raw':!![]})['then'](function(_0xbe284a){if(_0xbe284a&&_0xbe284a[_0x73f3('0x5b')]===0x0){return db[_0x73f3('0x5c')][_0x73f3('0x54')]({'name':_0x3268d5['name'],'resourceId':_0x3268d5['id'],'type':_0xbe284a[_0x73f3('0x33')],'sectionId':_0xbe284a['id']},{})[_0x73f3('0x1b')](function(){return _0x23dc70;});}else{return _0x23dc70;}})['catch'](function(_0x594d7b){logger[_0x73f3('0x1f')](_0x73f3('0x5d'),_0x594d7b);throw _0x594d7b;});}return _0x23dc70;})[_0x73f3('0x1b')](respondWithResult(_0x5cdf63,0xc9))[_0x73f3('0x23')](handleError(_0x5cdf63,null));};exports[_0x73f3('0x2f')]=function(_0x9f3c8a,_0x12585f){if(_0x9f3c8a[_0x73f3('0x55')]['id']){delete _0x9f3c8a[_0x73f3('0x55')]['id'];}return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x9f3c8a[_0x73f3('0x51')]['id']},'include':[{'model':db[_0x73f3('0x35')],'as':_0x73f3('0x36')}]})[_0x73f3('0x1b')](handleEntityNotFound(_0x12585f,null))[_0x73f3('0x1b')](saveUpdates(_0x9f3c8a['body'],null))[_0x73f3('0x1b')](respondWithResult(_0x12585f,null))[_0x73f3('0x23')](handleError(_0x12585f,null));};exports[_0x73f3('0x30')]=function(_0x144a66,_0x234d32){return db['WhatsappAccount'][_0x73f3('0x53')]({'where':{'id':_0x144a66['params']['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x234d32,null))[_0x73f3('0x1b')](removeEntity(_0x234d32,null))[_0x73f3('0x23')](handleError(_0x234d32,null));};exports[_0x73f3('0x5e')]=function(_0x55b130,_0x5e04a9){return db[_0x73f3('0x37')][_0x73f3('0x5e')]()[_0x73f3('0x1b')](respondWithResult(_0x5e04a9,null))[_0x73f3('0x23')](handleError(_0x5e04a9,null));};exports[_0x73f3('0x5f')]=function(_0x4ca46f,_0x6d40fe,_0x26021b){if(_0x4ca46f[_0x73f3('0x55')]['id']){delete _0x4ca46f[_0x73f3('0x55')]['id'];}return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x4ca46f[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x6d40fe,null))[_0x73f3('0x1b')](function(_0x4d6648){if(_0x4d6648){_0x4ca46f[_0x73f3('0x55')][_0x73f3('0x60')]=_0x4d6648['id'];return db['Disposition'][_0x73f3('0x54')](_0x4ca46f[_0x73f3('0x55')]);}})[_0x73f3('0x1b')](respondWithResult(_0x6d40fe,null))[_0x73f3('0x23')](handleError(_0x6d40fe,null));};exports['getDispositions']=function(_0x57a03a,_0x23d6e6,_0x1218db){var _0x13b7f2={'raw':![],'where':{}};var _0x43a2b5={};var _0x3f8cc0={'count':0x0,'rows':[]};return db[_0x73f3('0x37')][_0x73f3('0x61')]({'where':{'id':_0x57a03a['params']['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x23d6e6,null))[_0x73f3('0x1b')](function(_0x6500e0){if(_0x6500e0){_0x43a2b5[_0x73f3('0x42')]=_[_0x73f3('0x3e')](db[_0x73f3('0x62')][_0x73f3('0x38')]);_0x43a2b5['query']=_[_0x73f3('0x3e')](_0x57a03a[_0x73f3('0x3d')]);_0x43a2b5['filters']=_[_0x73f3('0x40')](_0x43a2b5[_0x73f3('0x42')],_0x43a2b5['query']);_0x13b7f2[_0x73f3('0x41')]=_['intersection'](_0x43a2b5['model'],qs['fields'](_0x57a03a['query'][_0x73f3('0x43')]));_0x13b7f2['attributes']=_0x13b7f2[_0x73f3('0x41')]['length']?_0x13b7f2[_0x73f3('0x41')]:_0x43a2b5[_0x73f3('0x42')];if(!_0x57a03a[_0x73f3('0x3d')]['hasOwnProperty']('nolimit')){_0x13b7f2[_0x73f3('0x29')]=qs[_0x73f3('0x29')](_0x57a03a[_0x73f3('0x3d')][_0x73f3('0x29')]);_0x13b7f2['offset']=qs[_0x73f3('0x27')](_0x57a03a[_0x73f3('0x3d')][_0x73f3('0x27')]);}_0x13b7f2[_0x73f3('0x46')]=qs['sort'](_0x57a03a[_0x73f3('0x3d')][_0x73f3('0x47')]);_0x13b7f2[_0x73f3('0x48')]=qs[_0x73f3('0x3f')](_[_0x73f3('0x63')](_0x57a03a[_0x73f3('0x3d')],_0x43a2b5['filters']));_0x13b7f2[_0x73f3('0x48')]['WhatsappAccountId']=_0x6500e0['id'];if(_0x57a03a[_0x73f3('0x3d')][_0x73f3('0x49')]){_0x13b7f2[_0x73f3('0x48')]=_[_0x73f3('0x4a')](_0x13b7f2['where'],{'$or':_['map'](_0x13b7f2[_0x73f3('0x41')],function(_0x47cc85){var _0x20c270={};_0x20c270[_0x47cc85]={'$like':'%'+_0x57a03a[_0x73f3('0x3d')][_0x73f3('0x49')]+'%'};return _0x20c270;})});}_0x13b7f2=_[_0x73f3('0x4a')]({},_0x13b7f2,_0x57a03a[_0x73f3('0x52')]);return db['Disposition'][_0x73f3('0x2a')]({'where':_0x13b7f2[_0x73f3('0x48')]})[_0x73f3('0x1b')](function(_0x59f847){_0x3f8cc0[_0x73f3('0x2a')]=_0x59f847;if(_0x57a03a['query']['includeAll']){_0x13b7f2[_0x73f3('0x4d')]=[{'all':!![]}];}return db[_0x73f3('0x62')][_0x73f3('0x4e')](_0x13b7f2);})[_0x73f3('0x1b')](function(_0x31ce5b){_0x3f8cc0['rows']=_0x31ce5b;return _0x3f8cc0;});}})[_0x73f3('0x1b')](respondWithFilteredResult(_0x23d6e6,_0x13b7f2))[_0x73f3('0x23')](handleError(_0x23d6e6,null));};exports[_0x73f3('0x64')]=function(_0x377aa4,_0x2c99c0,_0x34fbee){return db[_0x73f3('0x37')]['find']({'where':{'id':_0x377aa4[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x2c99c0,null))[_0x73f3('0x1b')](function(_0x4483ea){if(_0x4483ea){return _0x4483ea[_0x73f3('0x64')](_0x377aa4['query'][_0x73f3('0x65')]);}})[_0x73f3('0x1b')](respondWithStatusCode(_0x2c99c0,null))[_0x73f3('0x23')](handleError(_0x2c99c0,null));};exports[_0x73f3('0x66')]=function(_0x559365,_0x596bc1,_0xd67d6f){if(_0x559365[_0x73f3('0x55')]['id']){delete _0x559365[_0x73f3('0x55')]['id'];}return db[_0x73f3('0x37')]['find']({'where':{'id':_0x559365[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x596bc1,null))[_0x73f3('0x1b')](function(_0x113458){if(_0x113458){_0x559365[_0x73f3('0x55')][_0x73f3('0x60')]=_0x113458['id'];return db[_0x73f3('0x67')][_0x73f3('0x54')](_0x559365[_0x73f3('0x55')]);}})['then'](respondWithResult(_0x596bc1,null))[_0x73f3('0x23')](handleError(_0x596bc1,null));};exports[_0x73f3('0x68')]=function(_0x73de49,_0x39540b,_0x4ab111){var _0x2d052c={'raw':![],'where':{}};var _0x361a39={};var _0x36cf66={'count':0x0,'rows':[]};return db[_0x73f3('0x37')][_0x73f3('0x61')]({'where':{'id':_0x73de49[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x39540b,null))[_0x73f3('0x1b')](function(_0x3e7e97){if(_0x3e7e97){_0x361a39[_0x73f3('0x42')]=_[_0x73f3('0x3e')](db['CannedAnswer'][_0x73f3('0x38')]);_0x361a39['query']=_[_0x73f3('0x3e')](_0x73de49[_0x73f3('0x3d')]);_0x361a39[_0x73f3('0x3f')]=_[_0x73f3('0x40')](_0x361a39[_0x73f3('0x42')],_0x361a39[_0x73f3('0x3d')]);_0x2d052c[_0x73f3('0x41')]=_[_0x73f3('0x40')](_0x361a39[_0x73f3('0x42')],qs['fields'](_0x73de49['query']['fields']));_0x2d052c[_0x73f3('0x41')]=_0x2d052c['attributes']['length']?_0x2d052c[_0x73f3('0x41')]:_0x361a39[_0x73f3('0x42')];if(!_0x73de49[_0x73f3('0x3d')]['hasOwnProperty'](_0x73f3('0x69'))){_0x2d052c[_0x73f3('0x29')]=qs['limit'](_0x73de49[_0x73f3('0x3d')][_0x73f3('0x29')]);_0x2d052c[_0x73f3('0x27')]=qs[_0x73f3('0x27')](_0x73de49[_0x73f3('0x3d')][_0x73f3('0x27')]);}_0x2d052c[_0x73f3('0x46')]=qs[_0x73f3('0x47')](_0x73de49[_0x73f3('0x3d')][_0x73f3('0x47')]);_0x2d052c['where']=qs[_0x73f3('0x3f')](_['pick'](_0x73de49[_0x73f3('0x3d')],_0x361a39[_0x73f3('0x3f')]));_0x2d052c[_0x73f3('0x48')][_0x73f3('0x60')]=_0x3e7e97['id'];if(_0x73de49['query'][_0x73f3('0x49')]){_0x2d052c[_0x73f3('0x48')]=_[_0x73f3('0x4a')](_0x2d052c[_0x73f3('0x48')],{'$or':_[_0x73f3('0x3c')](_0x2d052c[_0x73f3('0x41')],function(_0x5311ff){var _0x41670c={};_0x41670c[_0x5311ff]={'$like':'%'+_0x73de49[_0x73f3('0x3d')][_0x73f3('0x49')]+'%'};return _0x41670c;})});}_0x2d052c=_['merge']({},_0x2d052c,_0x73de49['options']);return db[_0x73f3('0x67')][_0x73f3('0x2a')]({'where':_0x2d052c[_0x73f3('0x48')]})[_0x73f3('0x1b')](function(_0x5078e5){_0x36cf66['count']=_0x5078e5;if(_0x73de49['query'][_0x73f3('0x4c')]){_0x2d052c['include']=[{'all':!![]}];}return db[_0x73f3('0x67')]['findAll'](_0x2d052c);})[_0x73f3('0x1b')](function(_0x3d114d){_0x36cf66[_0x73f3('0x4f')]=_0x3d114d;return _0x36cf66;});}})['then'](respondWithFilteredResult(_0x39540b,_0x2d052c))[_0x73f3('0x23')](handleError(_0x39540b,null));};exports['removeAnswers']=function(_0x546c89,_0x1ae906,_0x14ec5a){return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x546c89[_0x73f3('0x51')]['id']}})['then'](handleEntityNotFound(_0x1ae906,null))[_0x73f3('0x1b')](function(_0x24475d){if(_0x24475d){return _0x24475d[_0x73f3('0x6a')](_0x546c89['query']['ids']);}})[_0x73f3('0x1b')](respondWithStatusCode(_0x1ae906,null))[_0x73f3('0x23')](handleError(_0x1ae906,null));};exports[_0x73f3('0x6b')]=function(_0x1b7137,_0x2c03c0,_0x4eeb2e){return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x1b7137[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x2c03c0,null))[_0x73f3('0x1b')](function(_0x38a2a4){if(_0x38a2a4){return _0x38a2a4[_0x73f3('0x6b')](_0x1b7137['body'][_0x73f3('0x65')],_['omit'](_0x1b7137[_0x73f3('0x55')],[_0x73f3('0x65'),'id'])||{})[_0x73f3('0x6c')](function(_0x30d229){for(var _0x24b640=0x0;_0x24b640<_0x1b7137[_0x73f3('0x55')][_0x73f3('0x65')]['length'];_0x24b640+=0x1){socket['emit'](_0x73f3('0x6d'),{'UserId':Number(_0x1b7137[_0x73f3('0x55')][_0x73f3('0x65')][_0x24b640]),'WhatsappAccountId':Number(_0x1b7137[_0x73f3('0x51')]['id'])});}return _0x30d229;});}})[_0x73f3('0x1b')](respondWithResult(_0x2c03c0,null))['catch'](handleError(_0x2c03c0,null));};exports[_0x73f3('0x6e')]=function(_0x53158a,_0x2d40e3,_0x27b506){return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x53158a[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x2d40e3,null))[_0x73f3('0x1b')](function(_0x389282){if(_0x389282){return _0x389282[_0x73f3('0x6e')](_0x53158a[_0x73f3('0x3d')][_0x73f3('0x65')])['then'](function(){if(_['isArray'](_0x53158a[_0x73f3('0x3d')][_0x73f3('0x65')])){for(var _0x2f7de4=0x0;_0x2f7de4<_0x53158a[_0x73f3('0x3d')]['ids']['length'];_0x2f7de4+=0x1){socket[_0x73f3('0x6f')](_0x73f3('0x70'),{'UserId':Number(_0x53158a[_0x73f3('0x3d')]['ids'][_0x2f7de4]),'WhatsappAccountId':Number(_0x53158a[_0x73f3('0x51')]['id'])});}}else{socket['emit'](_0x73f3('0x70'),{'UserId':Number(_0x53158a[_0x73f3('0x3d')][_0x73f3('0x65')]),'WhatsappAccountId':Number(_0x53158a[_0x73f3('0x51')]['id'])});}});}})[_0x73f3('0x1b')](respondWithStatusCode(_0x2d40e3,null))[_0x73f3('0x23')](handleError(_0x2d40e3,null));};exports[_0x73f3('0x71')]=function(_0x115a90,_0x2c78b0,_0x3bd7b5){var _0x3bfb38={};var _0x552dd1={};var _0x29f910;var _0x3bec70;return db['WhatsappAccount'][_0x73f3('0x61')]({'where':{'id':_0x115a90[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x2c78b0,null))[_0x73f3('0x1b')](function(_0x420a37){if(_0x420a37){_0x29f910=_0x420a37;_0x552dd1[_0x73f3('0x42')]=_[_0x73f3('0x3e')](db[_0x73f3('0x72')][_0x73f3('0x38')]);_0x552dd1[_0x73f3('0x3d')]=_['keys'](_0x115a90['query']);_0x552dd1[_0x73f3('0x3f')]=_[_0x73f3('0x40')](_0x552dd1[_0x73f3('0x42')],_0x552dd1[_0x73f3('0x3d')]);_0x3bfb38[_0x73f3('0x41')]=_[_0x73f3('0x40')](_0x552dd1[_0x73f3('0x42')],qs[_0x73f3('0x43')](_0x115a90[_0x73f3('0x3d')]['fields']));_0x3bfb38[_0x73f3('0x41')]=_0x3bfb38[_0x73f3('0x41')]['length']?_0x3bfb38[_0x73f3('0x41')]:_0x552dd1[_0x73f3('0x42')];_0x3bfb38[_0x73f3('0x46')]=qs[_0x73f3('0x47')](_0x115a90['query'][_0x73f3('0x47')]);_0x3bfb38[_0x73f3('0x48')]=qs['filters'](_[_0x73f3('0x63')](_0x115a90[_0x73f3('0x3d')],_0x552dd1[_0x73f3('0x3f')]));if(_0x115a90['query']['filter']){_0x3bfb38[_0x73f3('0x48')]=_['merge'](_0x3bfb38[_0x73f3('0x48')],{'$or':_[_0x73f3('0x3c')](_0x3bfb38[_0x73f3('0x41')],function(_0x237ed7){var _0x32732e={};_0x32732e[_0x237ed7]={'$like':'%'+_0x115a90[_0x73f3('0x3d')]['filter']+'%'};return _0x32732e;})});}_0x3bfb38=_['merge']({},_0x3bfb38,_0x115a90['options']);return _0x29f910['getAgents'](_0x3bfb38);}})[_0x73f3('0x1b')](function(_0x3ea56e){if(_0x3ea56e){_0x3bec70=_0x3ea56e[_0x73f3('0x44')];if(!_0x115a90['query']['hasOwnProperty'](_0x73f3('0x69'))){_0x3bfb38[_0x73f3('0x29')]=qs[_0x73f3('0x29')](_0x115a90[_0x73f3('0x3d')]['limit']);_0x3bfb38[_0x73f3('0x27')]=qs['offset'](_0x115a90[_0x73f3('0x3d')]['offset']);}return _0x29f910[_0x73f3('0x71')](_0x3bfb38);}})[_0x73f3('0x1b')](function(_0x420ce7){if(_0x420ce7){return _0x420ce7?{'count':_0x3bec70,'rows':_0x420ce7}:null;}})['then'](respondWithResult(_0x2c78b0,null))['catch'](handleError(_0x2c78b0,null));};exports['addApplications']=function(_0x435137,_0x1199da,_0x1bf993){return db['WhatsappAccount'][_0x73f3('0x61')]({'where':{'id':_0x435137[_0x73f3('0x51')]['id']}})[_0x73f3('0x1b')](handleEntityNotFound(_0x1199da,null))[_0x73f3('0x1b')](function(_0x2dd246){if(_0x2dd246){return db[_0x73f3('0x73')]['transaction'](function(_0xfccb57){return db[_0x73f3('0x74')][_0x73f3('0x30')]({'where':{'WhatsappAccountId':_0x435137[_0x73f3('0x51')]['id']},'transaction':_0xfccb57})[_0x73f3('0x1b')](function(_0x43e881){var _0x2b409b=_[_0x73f3('0x3c')](_0x435137['body'],function(_0x4f901b){_0x4f901b[_0x73f3('0x60')]=_0x435137[_0x73f3('0x51')]['id'];return _0x4f901b;});return db[_0x73f3('0x74')][_0x73f3('0x75')](_0x2b409b,{'transaction':_0xfccb57});});})['then'](function(){return db[_0x73f3('0x74')][_0x73f3('0x76')]({'where':{'WhatsappAccountId':_0x435137['params']['id']},'order':_0x73f3('0x77')});});}})['then'](respondWithResult(_0x1199da,null))['catch'](handleError(_0x1199da,null));};exports['getApplications']=function(_0xdfbd26,_0x48ca0f,_0x2a3c90){var _0x531282={};var _0x2551d1={};var _0x376708;var _0x5d3c20;return db['WhatsappAccount'][_0x73f3('0x61')]({'where':{'id':_0xdfbd26['params']['id']}})['then'](handleEntityNotFound(_0x48ca0f,null))['then'](function(_0x3016d1){if(_0x3016d1){_0x376708=_0x3016d1;_0x2551d1[_0x73f3('0x42')]=_[_0x73f3('0x3e')](db[_0x73f3('0x74')][_0x73f3('0x38')]);_0x2551d1['query']=_[_0x73f3('0x3e')](_0xdfbd26['query']);_0x2551d1['filters']=_[_0x73f3('0x40')](_0x2551d1[_0x73f3('0x42')],_0x2551d1[_0x73f3('0x3d')]);_0x531282[_0x73f3('0x41')]=_['intersection'](_0x2551d1[_0x73f3('0x42')],qs['fields'](_0xdfbd26[_0x73f3('0x3d')][_0x73f3('0x43')]));_0x531282[_0x73f3('0x41')]=_0x531282['attributes']['length']?_0x531282[_0x73f3('0x41')]:_0x2551d1[_0x73f3('0x42')];_0x531282[_0x73f3('0x46')]=qs[_0x73f3('0x47')](_0xdfbd26['query'][_0x73f3('0x47')]);_0x531282[_0x73f3('0x48')]=qs[_0x73f3('0x3f')](_[_0x73f3('0x63')](_0xdfbd26[_0x73f3('0x3d')],_0x2551d1[_0x73f3('0x3f')]));if(_0xdfbd26[_0x73f3('0x3d')][_0x73f3('0x49')]){_0x531282[_0x73f3('0x48')]=_[_0x73f3('0x4a')](_0x531282[_0x73f3('0x48')],{'$or':_['map'](_0x531282[_0x73f3('0x41')],function(_0xe64c0e){var _0x259d1f={};_0x259d1f[_0xe64c0e]={'$like':'%'+_0xdfbd26[_0x73f3('0x3d')][_0x73f3('0x49')]+'%'};return _0x259d1f;})});}_0x531282=_[_0x73f3('0x4a')]({},_0x531282,_0xdfbd26['options']);return _0x376708[_0x73f3('0x78')](_0x531282);}})[_0x73f3('0x1b')](function(_0x114d15){if(_0x114d15){_0x5d3c20=_0x114d15['length'];if(!_0xdfbd26[_0x73f3('0x3d')]['hasOwnProperty'](_0x73f3('0x69'))){_0x531282[_0x73f3('0x29')]=qs[_0x73f3('0x29')](_0xdfbd26['query'][_0x73f3('0x29')]);_0x531282['offset']=qs[_0x73f3('0x27')](_0xdfbd26[_0x73f3('0x3d')][_0x73f3('0x27')]);}return _0x376708[_0x73f3('0x78')](_0x531282);}})[_0x73f3('0x1b')](function(_0x26a6c7){if(_0x26a6c7){return _0x26a6c7?{'count':_0x5d3c20,'rows':_0x26a6c7}:null;}})['then'](respondWithResult(_0x48ca0f,null))['catch'](handleError(_0x48ca0f,null));};exports[_0x73f3('0x79')]=function(_0x265cfb,_0x3017c5,_0x3c7d20){var _0x1cb3dc={'channel':'whatsapp'};var _0x4030a9=[];var _0x44877d=[];var _0x4f81ca={};return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x265cfb['params']['id']},'include':[{'model':db[_0x73f3('0x74')],'as':_0x73f3('0x7a')}]})[_0x73f3('0x1b')](handleEntityNotFound(_0x3017c5,null))[_0x73f3('0x1b')](function(_0x248dc7){_0x1cb3dc[_0x73f3('0x7b')]=_0x248dc7;_0x1cb3dc[_0x73f3('0x7c')]=_['orderBy'](_0x248dc7[_0x73f3('0x7a')],[_0x73f3('0x77')],[_0x73f3('0x7d')]);if(_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x7a')]){delete _0x1cb3dc[_0x73f3('0x7b')]['Applications'];}return db['CmContact'][_0x73f3('0x5e')]();})[_0x73f3('0x1b')](function(_0x3da1b5){if(!_0x3da1b5){throw new db[(_0x73f3('0x7e'))][(_0x73f3('0x7f'))]('no\x20available\x20attributes');}_0x4030a9=_['difference'](_['keys'](_0x3da1b5),[_0x73f3('0x80'),_0x73f3('0x81')]);_0x44877d=_[_0x73f3('0x82')](_[_0x73f3('0x3e')](_0x3da1b5),[_0x73f3('0x80'),'updatedAt',_0x73f3('0x83'),'ListId']);_0x1cb3dc['body']={'mapKey':_0x73f3('0x84')};if(_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x3a')]&&_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x3a')]===_0x73f3('0x85')){_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')]=_0x265cfb['body'][_0x73f3('0x87')][_0x73f3('0x88')](_0x73f3('0x89'),'');_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x55')]=_0x265cfb['body'][_0x73f3('0x8a')];_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x8b')]=_0x265cfb[_0x73f3('0x55')]['MessageSid'];}if(_0x1cb3dc[_0x73f3('0x55')]['id']){delete _0x1cb3dc['body']['id'];}if(_[_0x73f3('0x8c')](_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')])){throw new db[(_0x73f3('0x7e'))]['ValidationError'](_0x73f3('0x8d'));}if(_['isNil'](_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x55')])||_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x55')]===''){throw new db[(_0x73f3('0x7e'))][(_0x73f3('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x73f3('0x8c')](_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x8e')])){throw new db[(_0x73f3('0x7e'))][(_0x73f3('0x7f'))](_0x73f3('0x8f')+_0x44877d);}if(!_[_0x73f3('0x90')](_0x44877d,_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x8e')])){throw new db[(_0x73f3('0x7e'))][(_0x73f3('0x7f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44877d);}_0x4f81ca[_0x1cb3dc['body']['mapKey']]=_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')];return db['CmList']['find']({'where':{'id':_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x91')]},'include':[{'model':db[_0x73f3('0x92')],'as':'Contacts','where':_0x4f81ca,'limit':0x1,'order':[['updatedAt',_0x73f3('0x93')]]}]});})['then'](handleEntityNotFound(_0x3017c5,null))[_0x73f3('0x1b')](function(_0x298621){if(_0x298621){_0x1cb3dc[_0x73f3('0x94')]=_[_0x73f3('0x95')](_0x298621,[_0x73f3('0x96')]);if(_0x298621[_0x73f3('0x96')][_0x73f3('0x44')]){return _0x298621[_0x73f3('0x96')][0x0];}var _0x4d73e0=_['defaults'](_0x1cb3dc[_0x73f3('0x55')],{'firstName':_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')],'ListId':_0x298621['id']});_0x4d73e0[_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x8e')]]=_0x1cb3dc['body'][_0x73f3('0x86')];return db[_0x73f3('0x92')][_0x73f3('0x54')](_0x4d73e0,{'fields':_0x4030a9,'raw':!![]});}})[_0x73f3('0x1b')](handleEntityNotFound(_0x3017c5,null))[_0x73f3('0x1b')](function(_0x429244){if(_0x429244){_0x1cb3dc[_0x73f3('0x97')]=_0x429244;var _0x548c5b={'ContactId':_0x429244['id'],'phone':_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')],'WhatsappAccountId':_0x265cfb[_0x73f3('0x51')]['id']};var _0x4ea1b3={'ContactId':_0x429244['id'],'WhatsappAccountId':_0x265cfb[_0x73f3('0x51')]['id'],'closed':![]};return db[_0x73f3('0x98')]['find']({'where':_0x4ea1b3})[_0x73f3('0x1b')](function(_0x57cf72){if(_0x57cf72){return[_0x57cf72,![]];}return db[_0x73f3('0x98')]['create'](_0x548c5b)[_0x73f3('0x1b')](function(_0x3c353c){return[_0x3c353c,!![]];});});}})[_0x73f3('0x6c')](function(_0x1d6f05,_0x2eb5d2){_0x1cb3dc[_0x73f3('0x99')]=_0x1d6f05[_0x73f3('0x56')]({'plain':!![]});_0x1cb3dc[_0x73f3('0x99')][_0x73f3('0x9a')]=![];if(_0x2eb5d2){if(_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x9b')]){_0x1cb3dc[_0x73f3('0x7c')][_0x73f3('0x9c')]({'id':0x0,'priority':_0x1cb3dc[_0x73f3('0x7c')][_0x73f3('0x44')]+0x1,'app':'close','appdata':_0x73f3('0x9d'),'interval':_0x73f3('0x9e')});}_0x1cb3dc[_0x73f3('0x99')][_0x73f3('0x9a')]=!![];}return db[_0x73f3('0x9f')][_0x73f3('0x54')]({'phone':_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x86')],'messageId':_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0x8b')],'body':_0x1cb3dc[_0x73f3('0x55')]['body'],'WhatsappAccountId':_0x265cfb[_0x73f3('0x51')]['id'],'WhatsappInteractionId':_0x1d6f05['id'],'direction':'in','ContactId':_0x1d6f05[_0x73f3('0xa0')],'AttachmentId':_0x1cb3dc[_0x73f3('0x55')][_0x73f3('0xa1')]});})[_0x73f3('0x1b')](function(_0x452ae9){_0x1cb3dc[_0x73f3('0x22')]=_0x452ae9;if(_0x1cb3dc[_0x73f3('0x99')][_0x73f3('0xa2')]){return db[_0x73f3('0x72')]['find']({'attributes':['id',_0x73f3('0x33')],'where':{'id':_0x1cb3dc[_0x73f3('0x99')]['UserId']}})[_0x73f3('0x1b')](function(_0x4796ca){if(_0x4796ca){_0x1cb3dc['applications'][_0x73f3('0xa3')]({'id':0x0,'priority':0x0,'app':_0x73f3('0xa4'),'appdata':_0x4796ca['name']+','+(_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0xa5')]||0xa),'interval':_0x73f3('0x9e')});}return respondWithRpcPromise(_0x73f3('0xa6'),_0x73f3('0xa7'),_0x1cb3dc);});}return respondWithRpcPromise(_0x73f3('0xa6'),_0x73f3('0xa7'),_0x1cb3dc);})[_0x73f3('0x1b')](function(_0x2071d2){if(_0x2071d2){var _0x17f317=0xc8;var _0x33bad5=_0x73f3('0xa8');logger[_0x73f3('0x1c')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x33bad5,_0x17f317,_0x73f3('0xa9'));logger['debug'](_0x73f3('0xaa'),_0x33bad5,_0x17f317,_0x73f3('0xa9'),JSON[_0x73f3('0x1e')](_0x2071d2));if(_0x1cb3dc[_0x73f3('0x7b')][_0x73f3('0x3a')]===_0x73f3('0x85')){return _0x3017c5[_0x73f3('0x24')](_0x17f317)[_0x73f3('0xab')](_0x73f3('0xac'),'text/xml')[_0x73f3('0xad')](_0x73f3('0xae'));}else{return _0x3017c5[_0x73f3('0x24')](_0x17f317)[_0x73f3('0x26')](_0x2071d2);}}})[_0x73f3('0x23')](handleError(_0x3017c5,null));};exports[_0x73f3('0xad')]=function(_0x32cd93,_0x3ffa52,_0x57c58b){var _0x411ec4,_0x3d5159,_0x51357f;if(_[_0x73f3('0x8c')](_0x32cd93['body']['body'])||_0x32cd93['body'][_0x73f3('0x55')]===''){throw new db['Sequelize'][(_0x73f3('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x73f3('0x8c')](_0x32cd93[_0x73f3('0x55')]['to'])){throw new db[(_0x73f3('0x7e'))][(_0x73f3('0x7f'))](_0x73f3('0xaf'));}_0x411ec4=_0x32cd93[_0x73f3('0x55')]['to'];return db[_0x73f3('0x37')][_0x73f3('0x53')]({'where':{'id':_0x32cd93[_0x73f3('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x73f3('0xb0'),'include':[{'model':db[_0x73f3('0x92')],'as':_0x73f3('0x96'),'where':{'mobile':_0x411ec4},'limit':0x1,'order':[[_0x73f3('0x81'),_0x73f3('0x93')]]}]}]})['then'](handleEntityNotFound(_0x3ffa52,null))[_0x73f3('0x1b')](function(_0x4ec45d){if(_0x4ec45d&&_0x4ec45d[_0x73f3('0xb0')]){_0x3d5159=_0x4ec45d[_0x73f3('0x56')]({'plain':!![]});if(_0x3d5159[_0x73f3('0xb0')]&&_0x3d5159[_0x73f3('0xb0')][_0x73f3('0x96')][_0x73f3('0x44')]){return _0x3d5159[_0x73f3('0xb0')][_0x73f3('0x96')][0x0];}return db['CmContact'][_0x73f3('0x54')](_['defaults'](_0x32cd93[_0x73f3('0x55')],{'firstName':_0x411ec4,'mobile':_0x411ec4,'phone':_0x411ec4,'ListId':_0x3d5159['ListId']}));}})['then'](handleEntityNotFound(_0x3ffa52,null))['then'](function(_0x2a2891){if(_0x2a2891){_0x51357f=_0x2a2891;return db[_0x73f3('0x98')]['find']({'where':{'ContactId':_0x51357f['id'],'closed':![],'WhatsappAccountId':_0x3d5159['id']}})[_0x73f3('0x1b')](function(_0x540a9a){if(_0x540a9a){return[_0x540a9a,![]];}return db[_0x73f3('0x98')][_0x73f3('0x54')]({'UserId':_0x32cd93[_0x73f3('0xb1')]['id'],'ContactId':_0x51357f['id'],'WhatsappAccountId':_0x3d5159['id'],'phone':_0x411ec4,'firstMsgDirection':_0x73f3('0xb2'),'Messages':[_[_0x73f3('0x4a')](_0x32cd93[_0x73f3('0x55')],{'read':![],'body':_0x32cd93['body'][_0x73f3('0x55')],'phone':_0x411ec4,'WhatsappAccountId':_0x3d5159['id'],'UserId':_0x32cd93['user']['id'],'ContactId':_0x51357f['id']})]},{'include':[{'model':db[_0x73f3('0x9f')],'as':'Messages'}]})['then'](function(_0xfa08b2){return[_0xfa08b2,!![]];});});}})['spread'](function(_0x4b7390,_0x47db76){if(_0x47db76){return _0x4b7390;}return db[_0x73f3('0x9f')][_0x73f3('0x54')](_[_0x73f3('0x4a')](_0x32cd93[_0x73f3('0x55')],{'read':![],'body':_0x32cd93[_0x73f3('0x55')][_0x73f3('0x55')],'phone':_0x411ec4,'WhatsappAccountId':_0x3d5159['id'],'WhatsappInteractionId':_0x4b7390['id'],'UserId':_0x32cd93['user']['id'],'ContactId':_0x51357f['id']}))['then'](function(_0x27dbad){_0x4b7390[_0x73f3('0xb3')][_0x73f3('0xb4')]=[];_0x4b7390[_0x73f3('0xb3')][_0x73f3('0xb4')]['push'](_0x27dbad[_0x73f3('0xb3')]);return _0x4b7390;});})[_0x73f3('0x1b')](respondWithResult(_0x3ffa52,null))[_0x73f3('0x23')](handleError(_0x3ffa52,null));}; \ No newline at end of file +var _0xda6c=['applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','Contacts','list','contact','WhatsappInteraction','interaction','created','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','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','./whatsappAccount.socket','register','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','WhatsappAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','Pause','rawAttributes','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','removeDispositions','ids','addAnswer','findOne','CannedAnswer','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','WhatsappApplication','bulkCreate','priority','getApplications','notify','Applications','account'];(function(_0x2603e4,_0x21c4eb){var _0x258981=function(_0x33d658){while(--_0x33d658){_0x2603e4['push'](_0x2603e4['shift']());}};_0x258981(++_0x21c4eb);}(_0xda6c,0xf0));var _0xcda6=function(_0x4e541f,_0x4bd151){_0x4e541f=_0x4e541f-0x0;var _0x4b90d2=_0xda6c[_0x4e541f];return _0x4b90d2;};'use strict';var emlformat=require(_0xcda6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcda6('0x1'));var jsonpatch=require(_0xcda6('0x2'));var rp=require('request-promise');var moment=require(_0xcda6('0x3'));var BPromise=require(_0xcda6('0x4'));var Mustache=require(_0xcda6('0x5'));var util=require(_0xcda6('0x6'));var path=require(_0xcda6('0x7'));var sox=require(_0xcda6('0x8'));var csv=require(_0xcda6('0x9'));var ejs=require(_0xcda6('0xa'));var fs=require('fs');var fs_extra=require(_0xcda6('0xb'));var _=require(_0xcda6('0xc'));var squel=require('squel');var crypto=require(_0xcda6('0xd'));var jsforce=require(_0xcda6('0xe'));var deskjs=require(_0xcda6('0xf'));var toCsv=require(_0xcda6('0x9'));var querystring=require(_0xcda6('0x10'));var Papa=require('papaparse');var Redis=require(_0xcda6('0x11'));var authService=require(_0xcda6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcda6('0x13'));var hardwareService=require(_0xcda6('0x14'));var logger=require(_0xcda6('0x15'))(_0xcda6('0x16'));var utils=require('../../config/utils');var config=require(_0xcda6('0x17'));var licenseUtil=require(_0xcda6('0x18'));var db=require(_0xcda6('0x19'))['db'];config[_0xcda6('0x1a')]=_[_0xcda6('0x1b')](config[_0xcda6('0x1a')],{'host':_0xcda6('0x1c'),'port':0x18eb});var socket=require(_0xcda6('0x1d'))(new Redis(config[_0xcda6('0x1a')]));require(_0xcda6('0x1e'))[_0xcda6('0x1f')](socket);var jayson=require(_0xcda6('0x20'));var client=jayson['client'][_0xcda6('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x404c3b,_0x367d27,_0xb4bb1,_0x25bf15){return new BPromise(function(_0x6524f,_0x8b3e1d){var _0x558400=_0x25bf15||client;return _0x558400[_0xcda6('0x22')](_0x404c3b,_0xb4bb1)['then'](function(_0x498cc5){logger[_0xcda6('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x367d27,'request\x20sent');logger['debug'](_0xcda6('0x24'),_0x367d27,_0xcda6('0x25'),JSON['stringify'](_0x498cc5));if(_0x498cc5[_0xcda6('0x26')]){if(_0x498cc5[_0xcda6('0x26')]['code']===0x1f4){logger[_0xcda6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x367d27,_0x498cc5[_0xcda6('0x26')][_0xcda6('0x27')]);return _0x8b3e1d(_0x498cc5[_0xcda6('0x26')][_0xcda6('0x27')]);}logger[_0xcda6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x367d27,_0x498cc5[_0xcda6('0x26')][_0xcda6('0x27')]);return _0x6524f(_0x498cc5['error'][_0xcda6('0x27')]);}else{logger[_0xcda6('0x23')](_0xcda6('0x28'),_0x367d27,_0xcda6('0x25'));_0x6524f(_0x498cc5[_0xcda6('0x29')]['message']);}})[_0xcda6('0x2a')](function(_0x3fb35a){logger[_0xcda6('0x26')](_0xcda6('0x28'),_0x367d27,_0x3fb35a);_0x8b3e1d(_0x3fb35a);});});}function respondWithStatusCode(_0x230a7d,_0x314971){_0x314971=_0x314971||0xcc;return function(_0x4e861c){if(_0x4e861c){return _0x230a7d[_0xcda6('0x2b')](_0x314971);}return _0x230a7d[_0xcda6('0x2c')](_0x314971)[_0xcda6('0x2d')]();};}function respondWithResult(_0x1b95c6,_0xc9ba99){_0xc9ba99=_0xc9ba99||0xc8;return function(_0x2e3c91){if(_0x2e3c91){return _0x1b95c6[_0xcda6('0x2c')](_0xc9ba99)[_0xcda6('0x2e')](_0x2e3c91);}};}function respondWithFilteredResult(_0x2affd9,_0xa1508b){return function(_0x3b650b){if(_0x3b650b){var _0x1f4312=typeof _0xa1508b[_0xcda6('0x2f')]===_0xcda6('0x30')&&typeof _0xa1508b[_0xcda6('0x31')]===_0xcda6('0x30');var _0x18d40b=_0x3b650b[_0xcda6('0x32')];var _0x25570c=_0x1f4312?0x0:_0xa1508b[_0xcda6('0x2f')];var _0x404584=_0x1f4312?_0x3b650b['count']:_0xa1508b[_0xcda6('0x2f')]+_0xa1508b[_0xcda6('0x31')];var _0x186f41;if(_0x404584>=_0x18d40b){_0x404584=_0x18d40b;_0x186f41=0xc8;}else{_0x186f41=0xce;}_0x2affd9[_0xcda6('0x2c')](_0x186f41);return _0x2affd9[_0xcda6('0x33')](_0xcda6('0x34'),_0x25570c+'-'+_0x404584+'/'+_0x18d40b)[_0xcda6('0x2e')](_0x3b650b);}return null;};}function patchUpdates(_0x24d5e){return function(_0x18abe7){try{jsonpatch[_0xcda6('0x35')](_0x18abe7,_0x24d5e,!![]);}catch(_0x1a40de){return BPromise[_0xcda6('0x36')](_0x1a40de);}return _0x18abe7[_0xcda6('0x37')]();};}function saveUpdates(_0x4723b5,_0x51076c){return function(_0x408b5a){if(_0x408b5a){return _0x408b5a[_0xcda6('0x38')](_0x4723b5)['then'](function(_0x352962){return _0x352962;});}return null;};}function removeEntity(_0x20956a,_0x2871d1){return function(_0x8fb357){if(_0x8fb357){return _0x8fb357['destroy']()[_0xcda6('0x39')](function(){var _0x18fb47=_0x8fb357[_0xcda6('0x3a')]({'plain':!![]});var _0x337ac9=_0xcda6('0x3b');return db[_0xcda6('0x3c')]['destroy']({'where':{'type':_0x337ac9,'resourceId':_0x18fb47['id']}})[_0xcda6('0x39')](function(){return _0x8fb357;});})[_0xcda6('0x39')](function(){_0x20956a['status'](0xcc)[_0xcda6('0x2d')]();});}};}function handleEntityNotFound(_0x391e61,_0x3d5e40){return function(_0x1f8a5c){if(!_0x1f8a5c){_0x391e61[_0xcda6('0x2b')](0x194);}return _0x1f8a5c;};}function handleError(_0x311660,_0x3ce186){_0x3ce186=_0x3ce186||0x1f4;return function(_0x6dce33){logger[_0xcda6('0x26')](_0x6dce33[_0xcda6('0x3d')]);if(_0x6dce33[_0xcda6('0x3e')]){delete _0x6dce33[_0xcda6('0x3e')];}_0x311660['status'](_0x3ce186)[_0xcda6('0x3f')](_0x6dce33);};}exports['index']=function(_0x2bec1f,_0xa0e89d){var _0xc9cb47={'include':[{'model':db['Pause'],'as':_0xcda6('0x40')}]},_0x48d270={},_0x340fd3={'count':0x0,'rows':[]};var _0x4a338b=_[_0xcda6('0x41')](db[_0xcda6('0x42')]['rawAttributes'],function(_0x587012){return{'name':_0x587012[_0xcda6('0x43')],'type':_0x587012[_0xcda6('0x44')]['key']};});_0x48d270[_0xcda6('0x45')]=_[_0xcda6('0x41')](_0x4a338b,'name');_0x48d270['query']=_[_0xcda6('0x46')](_0x2bec1f[_0xcda6('0x47')]);_0x48d270[_0xcda6('0x48')]=_[_0xcda6('0x49')](_0x48d270[_0xcda6('0x45')],_0x48d270['query']);_0xc9cb47[_0xcda6('0x4a')]=_[_0xcda6('0x49')](_0x48d270['model'],qs[_0xcda6('0x4b')](_0x2bec1f[_0xcda6('0x47')][_0xcda6('0x4b')]));_0xc9cb47[_0xcda6('0x4a')]=_0xc9cb47['attributes'][_0xcda6('0x4c')]?_0xc9cb47['attributes']:_0x48d270[_0xcda6('0x45')];if(!_0x2bec1f[_0xcda6('0x47')][_0xcda6('0x4d')](_0xcda6('0x4e'))){_0xc9cb47[_0xcda6('0x31')]=qs[_0xcda6('0x31')](_0x2bec1f[_0xcda6('0x47')]['limit']);_0xc9cb47[_0xcda6('0x2f')]=qs[_0xcda6('0x2f')](_0x2bec1f[_0xcda6('0x47')]['offset']);}_0xc9cb47[_0xcda6('0x4f')]=qs[_0xcda6('0x50')](_0x2bec1f[_0xcda6('0x47')][_0xcda6('0x50')]);_0xc9cb47[_0xcda6('0x51')]=qs[_0xcda6('0x48')](_[_0xcda6('0x52')](_0x2bec1f[_0xcda6('0x47')],_0x48d270[_0xcda6('0x48')]),_0x4a338b);if(_0x2bec1f['query'][_0xcda6('0x53')]){_0xc9cb47[_0xcda6('0x51')]=_[_0xcda6('0x54')](_0xc9cb47[_0xcda6('0x51')],{'$or':_['map'](_0x4a338b,function(_0x2e75cc){if(_0x2e75cc[_0xcda6('0x44')]!==_0xcda6('0x55')){var _0xd650b3={};_0xd650b3[_0x2e75cc[_0xcda6('0x3e')]]={'$like':'%'+_0x2bec1f[_0xcda6('0x47')][_0xcda6('0x53')]+'%'};return _0xd650b3;}})});}_0xc9cb47=_['merge']({},_0xc9cb47,_0x2bec1f[_0xcda6('0x56')]);var _0x5533ab={'where':_0xc9cb47[_0xcda6('0x51')]};return db[_0xcda6('0x42')]['count'](_0x5533ab)[_0xcda6('0x39')](function(_0x2f5ee8){_0x340fd3[_0xcda6('0x32')]=_0x2f5ee8;if(_0x2bec1f[_0xcda6('0x47')]['includeAll']){_0xc9cb47[_0xcda6('0x57')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcda6('0x58')](_0xc9cb47);})[_0xcda6('0x39')](function(_0x272cf2){_0x340fd3[_0xcda6('0x59')]=_0x272cf2;return _0x340fd3;})['then'](respondWithFilteredResult(_0xa0e89d,_0xc9cb47))[_0xcda6('0x2a')](handleError(_0xa0e89d,null));};exports[_0xcda6('0x5a')]=function(_0x4883bc,_0x845d26){var _0x23e6cd={'raw':![],'where':{'id':_0x4883bc[_0xcda6('0x5b')]['id']},'include':[{'model':db[_0xcda6('0x5c')],'as':_0xcda6('0x40')}]},_0x551cc3={};_0x551cc3[_0xcda6('0x45')]=_[_0xcda6('0x46')](db['WhatsappAccount'][_0xcda6('0x5d')]);_0x551cc3[_0xcda6('0x47')]=_['keys'](_0x4883bc['query']);_0x551cc3['filters']=_[_0xcda6('0x49')](_0x551cc3['model'],_0x551cc3[_0xcda6('0x47')]);_0x23e6cd['attributes']=_[_0xcda6('0x49')](_0x551cc3[_0xcda6('0x45')],qs['fields'](_0x4883bc[_0xcda6('0x47')]['fields']));_0x23e6cd[_0xcda6('0x4a')]=_0x23e6cd['attributes'][_0xcda6('0x4c')]?_0x23e6cd[_0xcda6('0x4a')]:_0x551cc3[_0xcda6('0x45')];if(_0x4883bc[_0xcda6('0x47')][_0xcda6('0x5e')]){_0x23e6cd['include']=[{'all':!![]}];}_0x23e6cd=_[_0xcda6('0x54')]({},_0x23e6cd,_0x4883bc[_0xcda6('0x56')]);return db[_0xcda6('0x42')][_0xcda6('0x5f')](_0x23e6cd)[_0xcda6('0x39')](handleEntityNotFound(_0x845d26,null))[_0xcda6('0x39')](respondWithResult(_0x845d26,null))[_0xcda6('0x2a')](handleError(_0x845d26,null));};exports[_0xcda6('0x60')]=function(_0x152bf8,_0x33a5f6){return db[_0xcda6('0x42')][_0xcda6('0x60')](_0x152bf8[_0xcda6('0x61')],{})[_0xcda6('0x39')](function(_0x5299de){var _0x277da3=_0x152bf8['user'][_0xcda6('0x3a')]({'plain':!![]});if(!_0x277da3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x277da3[_0xcda6('0x62')]===_0xcda6('0x63')){var _0x3a00ef=_0x5299de[_0xcda6('0x3a')]({'plain':!![]});var _0x4da510=_0xcda6('0x3b');return db[_0xcda6('0x64')][_0xcda6('0x5f')]({'where':{'name':_0x4da510,'userProfileId':_0x277da3[_0xcda6('0x65')]},'raw':!![]})[_0xcda6('0x39')](function(_0x2ae70a){if(_0x2ae70a&&_0x2ae70a[_0xcda6('0x66')]===0x0){return db[_0xcda6('0x3c')][_0xcda6('0x60')]({'name':_0x3a00ef[_0xcda6('0x3e')],'resourceId':_0x3a00ef['id'],'type':_0x2ae70a[_0xcda6('0x3e')],'sectionId':_0x2ae70a['id']},{})[_0xcda6('0x39')](function(){return _0x5299de;});}else{return _0x5299de;}})['catch'](function(_0x2649e4){logger[_0xcda6('0x26')](_0xcda6('0x67'),_0x2649e4);throw _0x2649e4;});}return _0x5299de;})[_0xcda6('0x39')](respondWithResult(_0x33a5f6,0xc9))[_0xcda6('0x2a')](handleError(_0x33a5f6,null));};exports['update']=function(_0x165055,_0x29c355){if(_0x165055['body']['id']){delete _0x165055[_0xcda6('0x61')]['id'];}return db['WhatsappAccount'][_0xcda6('0x5f')]({'where':{'id':_0x165055['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcda6('0x39')](handleEntityNotFound(_0x29c355,null))[_0xcda6('0x39')](saveUpdates(_0x165055[_0xcda6('0x61')],null))[_0xcda6('0x39')](respondWithResult(_0x29c355,null))[_0xcda6('0x2a')](handleError(_0x29c355,null));};exports[_0xcda6('0x68')]=function(_0x5f058b,_0x11f4f2){return db[_0xcda6('0x42')][_0xcda6('0x5f')]({'where':{'id':_0x5f058b[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x11f4f2,null))['then'](removeEntity(_0x11f4f2,null))['catch'](handleError(_0x11f4f2,null));};exports[_0xcda6('0x69')]=function(_0x261453,_0xee9b04){return db[_0xcda6('0x42')][_0xcda6('0x69')]()['then'](respondWithResult(_0xee9b04,null))[_0xcda6('0x2a')](handleError(_0xee9b04,null));};exports[_0xcda6('0x6a')]=function(_0x2a2dfa,_0xd0bfcf,_0x1c0bd2){if(_0x2a2dfa['body']['id']){delete _0x2a2dfa[_0xcda6('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2a2dfa['params']['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0xd0bfcf,null))[_0xcda6('0x39')](function(_0x376e7b){if(_0x376e7b){_0x2a2dfa[_0xcda6('0x61')][_0xcda6('0x6b')]=_0x376e7b['id'];return db['Disposition'][_0xcda6('0x60')](_0x2a2dfa[_0xcda6('0x61')]);}})[_0xcda6('0x39')](respondWithResult(_0xd0bfcf,null))[_0xcda6('0x2a')](handleError(_0xd0bfcf,null));};exports[_0xcda6('0x6c')]=function(_0x45e26f,_0x371e78,_0x2c438c){var _0x1f4a38={'raw':![],'where':{}};var _0x4da653={};var _0x387c1a={'count':0x0,'rows':[]};return db[_0xcda6('0x42')]['findOne']({'where':{'id':_0x45e26f[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x371e78,null))[_0xcda6('0x39')](function(_0x4dac69){if(_0x4dac69){_0x4da653['model']=_[_0xcda6('0x46')](db[_0xcda6('0x6d')]['rawAttributes']);_0x4da653[_0xcda6('0x47')]=_['keys'](_0x45e26f[_0xcda6('0x47')]);_0x4da653[_0xcda6('0x48')]=_['intersection'](_0x4da653[_0xcda6('0x45')],_0x4da653[_0xcda6('0x47')]);_0x1f4a38['attributes']=_[_0xcda6('0x49')](_0x4da653['model'],qs[_0xcda6('0x4b')](_0x45e26f[_0xcda6('0x47')]['fields']));_0x1f4a38[_0xcda6('0x4a')]=_0x1f4a38[_0xcda6('0x4a')]['length']?_0x1f4a38[_0xcda6('0x4a')]:_0x4da653[_0xcda6('0x45')];if(!_0x45e26f[_0xcda6('0x47')][_0xcda6('0x4d')]('nolimit')){_0x1f4a38[_0xcda6('0x31')]=qs[_0xcda6('0x31')](_0x45e26f[_0xcda6('0x47')][_0xcda6('0x31')]);_0x1f4a38[_0xcda6('0x2f')]=qs['offset'](_0x45e26f[_0xcda6('0x47')][_0xcda6('0x2f')]);}_0x1f4a38[_0xcda6('0x4f')]=qs['sort'](_0x45e26f[_0xcda6('0x47')][_0xcda6('0x50')]);_0x1f4a38[_0xcda6('0x51')]=qs['filters'](_[_0xcda6('0x52')](_0x45e26f[_0xcda6('0x47')],_0x4da653[_0xcda6('0x48')]));_0x1f4a38[_0xcda6('0x51')][_0xcda6('0x6b')]=_0x4dac69['id'];if(_0x45e26f['query'][_0xcda6('0x53')]){_0x1f4a38['where']=_[_0xcda6('0x54')](_0x1f4a38['where'],{'$or':_[_0xcda6('0x41')](_0x1f4a38['attributes'],function(_0x411975){var _0x3bac31={};_0x3bac31[_0x411975]={'$like':'%'+_0x45e26f[_0xcda6('0x47')]['filter']+'%'};return _0x3bac31;})});}_0x1f4a38=_[_0xcda6('0x54')]({},_0x1f4a38,_0x45e26f[_0xcda6('0x56')]);return db[_0xcda6('0x6d')][_0xcda6('0x32')]({'where':_0x1f4a38[_0xcda6('0x51')]})[_0xcda6('0x39')](function(_0x4a34b3){_0x387c1a[_0xcda6('0x32')]=_0x4a34b3;if(_0x45e26f['query'][_0xcda6('0x5e')]){_0x1f4a38[_0xcda6('0x57')]=[{'all':!![]}];}return db[_0xcda6('0x6d')]['findAll'](_0x1f4a38);})[_0xcda6('0x39')](function(_0x169769){_0x387c1a['rows']=_0x169769;return _0x387c1a;});}})['then'](respondWithFilteredResult(_0x371e78,_0x1f4a38))['catch'](handleError(_0x371e78,null));};exports[_0xcda6('0x6e')]=function(_0x4371c7,_0x46f77d,_0x16bddf){return db[_0xcda6('0x42')]['find']({'where':{'id':_0x4371c7[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x46f77d,null))[_0xcda6('0x39')](function(_0x57cde9){if(_0x57cde9){return _0x57cde9[_0xcda6('0x6e')](_0x4371c7['query'][_0xcda6('0x6f')]);}})[_0xcda6('0x39')](respondWithStatusCode(_0x46f77d,null))[_0xcda6('0x2a')](handleError(_0x46f77d,null));};exports[_0xcda6('0x70')]=function(_0x49d20f,_0x3b8c9f,_0x556d87){if(_0x49d20f[_0xcda6('0x61')]['id']){delete _0x49d20f['body']['id'];}return db[_0xcda6('0x42')][_0xcda6('0x5f')]({'where':{'id':_0x49d20f['params']['id']}})['then'](handleEntityNotFound(_0x3b8c9f,null))[_0xcda6('0x39')](function(_0x401238){if(_0x401238){_0x49d20f['body'][_0xcda6('0x6b')]=_0x401238['id'];return db['CannedAnswer'][_0xcda6('0x60')](_0x49d20f['body']);}})[_0xcda6('0x39')](respondWithResult(_0x3b8c9f,null))['catch'](handleError(_0x3b8c9f,null));};exports['getAnswers']=function(_0x574d9a,_0x101e06,_0x5b55f6){var _0x2d958f={'raw':![],'where':{}};var _0x45833e={};var _0x5da398={'count':0x0,'rows':[]};return db[_0xcda6('0x42')][_0xcda6('0x71')]({'where':{'id':_0x574d9a['params']['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x101e06,null))[_0xcda6('0x39')](function(_0x21cac0){if(_0x21cac0){_0x45833e[_0xcda6('0x45')]=_[_0xcda6('0x46')](db[_0xcda6('0x72')][_0xcda6('0x5d')]);_0x45833e[_0xcda6('0x47')]=_[_0xcda6('0x46')](_0x574d9a['query']);_0x45833e[_0xcda6('0x48')]=_[_0xcda6('0x49')](_0x45833e[_0xcda6('0x45')],_0x45833e['query']);_0x2d958f[_0xcda6('0x4a')]=_[_0xcda6('0x49')](_0x45833e['model'],qs['fields'](_0x574d9a[_0xcda6('0x47')][_0xcda6('0x4b')]));_0x2d958f[_0xcda6('0x4a')]=_0x2d958f[_0xcda6('0x4a')][_0xcda6('0x4c')]?_0x2d958f[_0xcda6('0x4a')]:_0x45833e['model'];if(!_0x574d9a['query']['hasOwnProperty'](_0xcda6('0x4e'))){_0x2d958f[_0xcda6('0x31')]=qs[_0xcda6('0x31')](_0x574d9a[_0xcda6('0x47')][_0xcda6('0x31')]);_0x2d958f[_0xcda6('0x2f')]=qs[_0xcda6('0x2f')](_0x574d9a[_0xcda6('0x47')][_0xcda6('0x2f')]);}_0x2d958f[_0xcda6('0x4f')]=qs[_0xcda6('0x50')](_0x574d9a['query'][_0xcda6('0x50')]);_0x2d958f['where']=qs[_0xcda6('0x48')](_[_0xcda6('0x52')](_0x574d9a[_0xcda6('0x47')],_0x45833e[_0xcda6('0x48')]));_0x2d958f[_0xcda6('0x51')][_0xcda6('0x6b')]=_0x21cac0['id'];if(_0x574d9a[_0xcda6('0x47')][_0xcda6('0x53')]){_0x2d958f[_0xcda6('0x51')]=_[_0xcda6('0x54')](_0x2d958f[_0xcda6('0x51')],{'$or':_[_0xcda6('0x41')](_0x2d958f['attributes'],function(_0x5818a2){var _0x4166f7={};_0x4166f7[_0x5818a2]={'$like':'%'+_0x574d9a['query']['filter']+'%'};return _0x4166f7;})});}_0x2d958f=_['merge']({},_0x2d958f,_0x574d9a['options']);return db[_0xcda6('0x72')]['count']({'where':_0x2d958f[_0xcda6('0x51')]})[_0xcda6('0x39')](function(_0x23898c){_0x5da398['count']=_0x23898c;if(_0x574d9a[_0xcda6('0x47')][_0xcda6('0x5e')]){_0x2d958f[_0xcda6('0x57')]=[{'all':!![]}];}return db[_0xcda6('0x72')]['findAll'](_0x2d958f);})['then'](function(_0x32eea2){_0x5da398[_0xcda6('0x59')]=_0x32eea2;return _0x5da398;});}})[_0xcda6('0x39')](respondWithFilteredResult(_0x101e06,_0x2d958f))['catch'](handleError(_0x101e06,null));};exports['removeAnswers']=function(_0x23ab06,_0x1dcc91,_0x284db2){return db[_0xcda6('0x42')][_0xcda6('0x5f')]({'where':{'id':_0x23ab06['params']['id']}})['then'](handleEntityNotFound(_0x1dcc91,null))['then'](function(_0x4328dc){if(_0x4328dc){return _0x4328dc['removeAnswers'](_0x23ab06[_0xcda6('0x47')]['ids']);}})[_0xcda6('0x39')](respondWithStatusCode(_0x1dcc91,null))[_0xcda6('0x2a')](handleError(_0x1dcc91,null));};exports[_0xcda6('0x73')]=function(_0x2c8fd6,_0x3b4828,_0x182ff5){return db[_0xcda6('0x42')]['find']({'where':{'id':_0x2c8fd6[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x3b4828,null))['then'](function(_0x349e2a){if(_0x349e2a){return _0x349e2a[_0xcda6('0x73')](_0x2c8fd6['body'][_0xcda6('0x6f')],_[_0xcda6('0x74')](_0x2c8fd6[_0xcda6('0x61')],['ids','id'])||{})[_0xcda6('0x75')](function(_0x351020){for(var _0x33838f=0x0;_0x33838f<_0x2c8fd6['body']['ids'][_0xcda6('0x4c')];_0x33838f+=0x1){socket[_0xcda6('0x76')](_0xcda6('0x77'),{'UserId':Number(_0x2c8fd6[_0xcda6('0x61')]['ids'][_0x33838f]),'WhatsappAccountId':Number(_0x2c8fd6[_0xcda6('0x5b')]['id'])});}return _0x351020;});}})[_0xcda6('0x39')](respondWithResult(_0x3b4828,null))[_0xcda6('0x2a')](handleError(_0x3b4828,null));};exports['removeAgents']=function(_0x529edd,_0x59d767,_0xc4a889){return db[_0xcda6('0x42')][_0xcda6('0x5f')]({'where':{'id':_0x529edd[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x59d767,null))[_0xcda6('0x39')](function(_0x365616){if(_0x365616){return _0x365616[_0xcda6('0x78')](_0x529edd[_0xcda6('0x47')][_0xcda6('0x6f')])[_0xcda6('0x39')](function(){if(_[_0xcda6('0x79')](_0x529edd[_0xcda6('0x47')][_0xcda6('0x6f')])){for(var _0x1cf10a=0x0;_0x1cf10a<_0x529edd[_0xcda6('0x47')][_0xcda6('0x6f')]['length'];_0x1cf10a+=0x1){socket[_0xcda6('0x76')](_0xcda6('0x7a'),{'UserId':Number(_0x529edd[_0xcda6('0x47')][_0xcda6('0x6f')][_0x1cf10a]),'WhatsappAccountId':Number(_0x529edd[_0xcda6('0x5b')]['id'])});}}else{socket[_0xcda6('0x76')](_0xcda6('0x7a'),{'UserId':Number(_0x529edd[_0xcda6('0x47')][_0xcda6('0x6f')]),'WhatsappAccountId':Number(_0x529edd[_0xcda6('0x5b')]['id'])});}});}})[_0xcda6('0x39')](respondWithStatusCode(_0x59d767,null))[_0xcda6('0x2a')](handleError(_0x59d767,null));};exports['getAgents']=function(_0x214d55,_0x539572,_0x6580bd){var _0x480169={};var _0x2e3113={};var _0x2d9ea9;var _0xd5e875;return db['WhatsappAccount'][_0xcda6('0x71')]({'where':{'id':_0x214d55[_0xcda6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x539572,null))[_0xcda6('0x39')](function(_0x511765){if(_0x511765){_0x2d9ea9=_0x511765;_0x2e3113['model']=_[_0xcda6('0x46')](db[_0xcda6('0x7b')][_0xcda6('0x5d')]);_0x2e3113[_0xcda6('0x47')]=_[_0xcda6('0x46')](_0x214d55['query']);_0x2e3113[_0xcda6('0x48')]=_['intersection'](_0x2e3113['model'],_0x2e3113[_0xcda6('0x47')]);_0x480169[_0xcda6('0x4a')]=_['intersection'](_0x2e3113[_0xcda6('0x45')],qs[_0xcda6('0x4b')](_0x214d55[_0xcda6('0x47')][_0xcda6('0x4b')]));_0x480169[_0xcda6('0x4a')]=_0x480169[_0xcda6('0x4a')]['length']?_0x480169[_0xcda6('0x4a')]:_0x2e3113[_0xcda6('0x45')];_0x480169[_0xcda6('0x4f')]=qs['sort'](_0x214d55[_0xcda6('0x47')][_0xcda6('0x50')]);_0x480169[_0xcda6('0x51')]=qs[_0xcda6('0x48')](_[_0xcda6('0x52')](_0x214d55[_0xcda6('0x47')],_0x2e3113[_0xcda6('0x48')]));if(_0x214d55[_0xcda6('0x47')][_0xcda6('0x53')]){_0x480169[_0xcda6('0x51')]=_[_0xcda6('0x54')](_0x480169[_0xcda6('0x51')],{'$or':_['map'](_0x480169[_0xcda6('0x4a')],function(_0x31e8dd){var _0x44ad5b={};_0x44ad5b[_0x31e8dd]={'$like':'%'+_0x214d55[_0xcda6('0x47')]['filter']+'%'};return _0x44ad5b;})});}_0x480169=_['merge']({},_0x480169,_0x214d55[_0xcda6('0x56')]);return _0x2d9ea9[_0xcda6('0x7c')](_0x480169);}})[_0xcda6('0x39')](function(_0x1ec90a){if(_0x1ec90a){_0xd5e875=_0x1ec90a['length'];if(!_0x214d55[_0xcda6('0x47')][_0xcda6('0x4d')](_0xcda6('0x4e'))){_0x480169[_0xcda6('0x31')]=qs[_0xcda6('0x31')](_0x214d55[_0xcda6('0x47')][_0xcda6('0x31')]);_0x480169[_0xcda6('0x2f')]=qs['offset'](_0x214d55['query'][_0xcda6('0x2f')]);}return _0x2d9ea9['getAgents'](_0x480169);}})['then'](function(_0x605d20){if(_0x605d20){return _0x605d20?{'count':_0xd5e875,'rows':_0x605d20}:null;}})[_0xcda6('0x39')](respondWithResult(_0x539572,null))[_0xcda6('0x2a')](handleError(_0x539572,null));};exports['addApplications']=function(_0x4877f0,_0x3db952,_0x4c5ce8){return db[_0xcda6('0x42')][_0xcda6('0x71')]({'where':{'id':_0x4877f0[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x3db952,null))['then'](function(_0x3661c8){if(_0x3661c8){return db['sequelize']['transaction'](function(_0x3148bf){return db['WhatsappApplication'][_0xcda6('0x68')]({'where':{'WhatsappAccountId':_0x4877f0[_0xcda6('0x5b')]['id']},'transaction':_0x3148bf})['then'](function(_0x442fbf){var _0x276afe=_[_0xcda6('0x41')](_0x4877f0[_0xcda6('0x61')],function(_0xc8bd3a){_0xc8bd3a['WhatsappAccountId']=_0x4877f0['params']['id'];return _0xc8bd3a;});return db[_0xcda6('0x7d')][_0xcda6('0x7e')](_0x276afe,{'transaction':_0x3148bf});});})['then'](function(){return db[_0xcda6('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4877f0[_0xcda6('0x5b')]['id']},'order':_0xcda6('0x7f')});});}})[_0xcda6('0x39')](respondWithResult(_0x3db952,null))['catch'](handleError(_0x3db952,null));};exports[_0xcda6('0x80')]=function(_0x52b240,_0x2990ff,_0x2fe10e){var _0x290911={};var _0x52acf1={};var _0x2ac935;var _0xbb631a;return db[_0xcda6('0x42')][_0xcda6('0x71')]({'where':{'id':_0x52b240[_0xcda6('0x5b')]['id']}})[_0xcda6('0x39')](handleEntityNotFound(_0x2990ff,null))[_0xcda6('0x39')](function(_0x51a0c8){if(_0x51a0c8){_0x2ac935=_0x51a0c8;_0x52acf1[_0xcda6('0x45')]=_[_0xcda6('0x46')](db['WhatsappApplication'][_0xcda6('0x5d')]);_0x52acf1['query']=_[_0xcda6('0x46')](_0x52b240[_0xcda6('0x47')]);_0x52acf1[_0xcda6('0x48')]=_[_0xcda6('0x49')](_0x52acf1['model'],_0x52acf1['query']);_0x290911['attributes']=_['intersection'](_0x52acf1[_0xcda6('0x45')],qs[_0xcda6('0x4b')](_0x52b240[_0xcda6('0x47')]['fields']));_0x290911[_0xcda6('0x4a')]=_0x290911[_0xcda6('0x4a')]['length']?_0x290911[_0xcda6('0x4a')]:_0x52acf1[_0xcda6('0x45')];_0x290911[_0xcda6('0x4f')]=qs[_0xcda6('0x50')](_0x52b240[_0xcda6('0x47')][_0xcda6('0x50')]);_0x290911[_0xcda6('0x51')]=qs[_0xcda6('0x48')](_[_0xcda6('0x52')](_0x52b240[_0xcda6('0x47')],_0x52acf1[_0xcda6('0x48')]));if(_0x52b240['query']['filter']){_0x290911[_0xcda6('0x51')]=_[_0xcda6('0x54')](_0x290911[_0xcda6('0x51')],{'$or':_['map'](_0x290911['attributes'],function(_0x3855f3){var _0x39a8b5={};_0x39a8b5[_0x3855f3]={'$like':'%'+_0x52b240[_0xcda6('0x47')][_0xcda6('0x53')]+'%'};return _0x39a8b5;})});}_0x290911=_[_0xcda6('0x54')]({},_0x290911,_0x52b240['options']);return _0x2ac935[_0xcda6('0x80')](_0x290911);}})['then'](function(_0x320d2c){if(_0x320d2c){_0xbb631a=_0x320d2c[_0xcda6('0x4c')];if(!_0x52b240[_0xcda6('0x47')][_0xcda6('0x4d')](_0xcda6('0x4e'))){_0x290911[_0xcda6('0x31')]=qs[_0xcda6('0x31')](_0x52b240[_0xcda6('0x47')][_0xcda6('0x31')]);_0x290911['offset']=qs['offset'](_0x52b240[_0xcda6('0x47')][_0xcda6('0x2f')]);}return _0x2ac935[_0xcda6('0x80')](_0x290911);}})[_0xcda6('0x39')](function(_0x2532a8){if(_0x2532a8){return _0x2532a8?{'count':_0xbb631a,'rows':_0x2532a8}:null;}})['then'](respondWithResult(_0x2990ff,null))[_0xcda6('0x2a')](handleError(_0x2990ff,null));};exports[_0xcda6('0x81')]=function(_0x510a81,_0x3fc468,_0x543499){var _0x546c0c={'channel':'whatsapp'};var _0x44ab91=[];var _0x250d26=[];var _0x1643e0={};return db[_0xcda6('0x42')]['find']({'where':{'id':_0x510a81['params']['id']},'include':[{'model':db[_0xcda6('0x7d')],'as':_0xcda6('0x82')}]})[_0xcda6('0x39')](handleEntityNotFound(_0x3fc468,null))[_0xcda6('0x39')](function(_0xec3112){_0x546c0c[_0xcda6('0x83')]=_0xec3112;_0x546c0c[_0xcda6('0x84')]=_[_0xcda6('0x85')](_0xec3112[_0xcda6('0x82')],[_0xcda6('0x7f')],[_0xcda6('0x86')]);if(_0x546c0c[_0xcda6('0x83')][_0xcda6('0x82')]){delete _0x546c0c[_0xcda6('0x83')][_0xcda6('0x82')];}return db[_0xcda6('0x87')][_0xcda6('0x69')]();})[_0xcda6('0x39')](function(_0x23d4d4){if(!_0x23d4d4){throw new db[(_0xcda6('0x88'))][(_0xcda6('0x89'))]('no\x20available\x20attributes');}_0x44ab91=_[_0xcda6('0x8a')](_['keys'](_0x23d4d4),['createdAt',_0xcda6('0x8b')]);_0x250d26=_[_0xcda6('0x8a')](_[_0xcda6('0x46')](_0x23d4d4),[_0xcda6('0x8c'),_0xcda6('0x8b'),_0xcda6('0x8d'),'ListId']);_0x546c0c[_0xcda6('0x61')]={'mapKey':_0xcda6('0x8e')};if(_0x546c0c[_0xcda6('0x83')][_0xcda6('0x44')]&&_0x546c0c[_0xcda6('0x83')][_0xcda6('0x44')]===_0xcda6('0x8f')){_0x546c0c['body'][_0xcda6('0x90')]=_0x510a81['body'][_0xcda6('0x91')][_0xcda6('0x92')](_0xcda6('0x93'),'');_0x546c0c[_0xcda6('0x61')][_0xcda6('0x61')]=_0x510a81[_0xcda6('0x61')]['Body'];_0x546c0c['body'][_0xcda6('0x94')]=_0x510a81[_0xcda6('0x61')][_0xcda6('0x95')];}if(_0x546c0c[_0xcda6('0x61')]['id']){delete _0x546c0c[_0xcda6('0x61')]['id'];}if(_[_0xcda6('0x96')](_0x546c0c[_0xcda6('0x61')]['from'])){throw new db[(_0xcda6('0x88'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x546c0c['body'][_0xcda6('0x61')])||_0x546c0c[_0xcda6('0x61')][_0xcda6('0x61')]===''){throw new db[(_0xcda6('0x88'))][(_0xcda6('0x89'))](_0xcda6('0x97'));}if(_['isNil'](_0x546c0c[_0xcda6('0x61')]['mapKey'])){throw new db[(_0xcda6('0x88'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x250d26);}if(!_[_0xcda6('0x98')](_0x250d26,_0x546c0c[_0xcda6('0x61')]['mapKey'])){throw new db[(_0xcda6('0x88'))]['ValidationError'](_0xcda6('0x99')+_0x250d26);}_0x1643e0[_0x546c0c[_0xcda6('0x61')][_0xcda6('0x9a')]]=_0x546c0c[_0xcda6('0x61')][_0xcda6('0x90')];return db[_0xcda6('0x9b')][_0xcda6('0x5f')]({'where':{'id':_0x546c0c['account'][_0xcda6('0x9c')]},'include':[{'model':db['CmContact'],'as':_0xcda6('0x9d'),'where':_0x1643e0,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xcda6('0x39')](handleEntityNotFound(_0x3fc468,null))['then'](function(_0x564174){if(_0x564174){_0x546c0c[_0xcda6('0x9e')]=_[_0xcda6('0x74')](_0x564174,[_0xcda6('0x9d')]);if(_0x564174['Contacts']['length']){return _0x564174[_0xcda6('0x9d')][0x0];}var _0x1af9ef=_[_0xcda6('0x1b')](_0x546c0c['body'],{'firstName':_0x546c0c[_0xcda6('0x61')][_0xcda6('0x90')],'ListId':_0x564174['id']});_0x1af9ef[_0x546c0c['body']['mapKey']]=_0x546c0c['body']['from'];return db[_0xcda6('0x87')][_0xcda6('0x60')](_0x1af9ef,{'fields':_0x44ab91,'raw':!![]});}})[_0xcda6('0x39')](handleEntityNotFound(_0x3fc468,null))['then'](function(_0x1a8101){if(_0x1a8101){_0x546c0c[_0xcda6('0x9f')]=_0x1a8101;var _0x1662c2={'ContactId':_0x1a8101['id'],'phone':_0x546c0c[_0xcda6('0x61')][_0xcda6('0x90')],'WhatsappAccountId':_0x510a81[_0xcda6('0x5b')]['id']};var _0x4d9b04={'ContactId':_0x1a8101['id'],'WhatsappAccountId':_0x510a81[_0xcda6('0x5b')]['id'],'closed':![]};return db[_0xcda6('0xa0')]['find']({'where':_0x4d9b04})['then'](function(_0x445288){if(_0x445288){return[_0x445288,![]];}return db[_0xcda6('0xa0')]['create'](_0x1662c2)[_0xcda6('0x39')](function(_0x465520){return[_0x465520,!![]];});});}})[_0xcda6('0x75')](function(_0x4613d4,_0x333ddf){_0x546c0c['interaction']=_0x4613d4[_0xcda6('0x3a')]({'plain':!![]});_0x546c0c[_0xcda6('0xa1')][_0xcda6('0xa2')]=![];if(_0x333ddf){if(_0x546c0c[_0xcda6('0x83')]['autoclose']){_0x546c0c['applications']['push']({'id':0x0,'priority':_0x546c0c[_0xcda6('0x84')][_0xcda6('0x4c')]+0x1,'app':'close','appdata':_0xcda6('0xa3'),'interval':_0xcda6('0xa4')});}_0x546c0c['interaction'][_0xcda6('0xa2')]=!![];}return db[_0xcda6('0xa5')][_0xcda6('0x60')]({'phone':_0x546c0c['body'][_0xcda6('0x90')],'messageId':_0x546c0c[_0xcda6('0x61')][_0xcda6('0x94')],'body':_0x546c0c[_0xcda6('0x61')][_0xcda6('0x61')],'WhatsappAccountId':_0x510a81[_0xcda6('0x5b')]['id'],'WhatsappInteractionId':_0x4613d4['id'],'direction':'in','ContactId':_0x4613d4[_0xcda6('0xa6')],'AttachmentId':_0x546c0c[_0xcda6('0x61')][_0xcda6('0xa7')]});})[_0xcda6('0x39')](function(_0x4a2284){_0x546c0c[_0xcda6('0x27')]=_0x4a2284;if(_0x546c0c[_0xcda6('0xa1')][_0xcda6('0xa8')]){return db['User'][_0xcda6('0x5f')]({'attributes':['id',_0xcda6('0x3e')],'where':{'id':_0x546c0c[_0xcda6('0xa1')][_0xcda6('0xa8')]}})[_0xcda6('0x39')](function(_0x31f873){if(_0x31f873){_0x546c0c['applications'][_0xcda6('0xa9')]({'id':0x0,'priority':0x0,'app':_0xcda6('0xaa'),'appdata':_0x31f873[_0xcda6('0x3e')]+','+(_0x546c0c[_0xcda6('0x83')][_0xcda6('0xab')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x546c0c);});}return respondWithRpcPromise('Start',_0xcda6('0xac'),_0x546c0c);})[_0xcda6('0x39')](function(_0x565958){if(_0x565958){var _0x1c9c3e=0xc8;var _0x3a01c1=_0xcda6('0xad');logger[_0xcda6('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3a01c1,_0x1c9c3e,_0xcda6('0xae'));logger[_0xcda6('0xaf')](_0xcda6('0xb0'),_0x3a01c1,_0x1c9c3e,_0xcda6('0xae'),JSON[_0xcda6('0xb1')](_0x565958));if(_0x546c0c[_0xcda6('0x83')]['type']===_0xcda6('0x8f')){return _0x3fc468['status'](_0x1c9c3e)[_0xcda6('0x33')]('Content-Type',_0xcda6('0xb2'))[_0xcda6('0x3f')](_0xcda6('0xb3'));}else{return _0x3fc468['status'](_0x1c9c3e)[_0xcda6('0x2e')](_0x565958);}}})[_0xcda6('0x2a')](handleError(_0x3fc468,null));};exports[_0xcda6('0x3f')]=function(_0x203681,_0x3f7146,_0x1ddc05){var _0x3471b1,_0x288c0d,_0xd1f92f;if(_['isNil'](_0x203681[_0xcda6('0x61')][_0xcda6('0x61')])||_0x203681[_0xcda6('0x61')]['body']===''){throw new db[(_0xcda6('0x88'))][(_0xcda6('0x89'))](_0xcda6('0x97'));}if(_[_0xcda6('0x96')](_0x203681[_0xcda6('0x61')]['to'])){throw new db['Sequelize']['ValidationError'](_0xcda6('0xb4'));}_0x3471b1=_0x203681[_0xcda6('0x61')]['to'];return db[_0xcda6('0x42')]['find']({'where':{'id':_0x203681[_0xcda6('0x5b')]['id']},'include':[{'model':db[_0xcda6('0x9b')],'as':_0xcda6('0xb5'),'include':[{'model':db[_0xcda6('0x87')],'as':'Contacts','where':{'mobile':_0x3471b1},'limit':0x1,'order':[[_0xcda6('0x8b'),_0xcda6('0xb6')]]}]}]})[_0xcda6('0x39')](handleEntityNotFound(_0x3f7146,null))['then'](function(_0x7fc24){if(_0x7fc24&&_0x7fc24['List']){_0x288c0d=_0x7fc24[_0xcda6('0x3a')]({'plain':!![]});if(_0x288c0d[_0xcda6('0xb5')]&&_0x288c0d[_0xcda6('0xb5')][_0xcda6('0x9d')]['length']){return _0x288c0d[_0xcda6('0xb5')][_0xcda6('0x9d')][0x0];}return db[_0xcda6('0x87')][_0xcda6('0x60')](_[_0xcda6('0x1b')](_0x203681[_0xcda6('0x61')],{'firstName':_0x3471b1,'mobile':_0x3471b1,'phone':_0x3471b1,'ListId':_0x288c0d[_0xcda6('0x9c')]}));}})[_0xcda6('0x39')](handleEntityNotFound(_0x3f7146,null))[_0xcda6('0x39')](function(_0xcec91c){if(_0xcec91c){_0xd1f92f=_0xcec91c;return db[_0xcda6('0xa0')]['find']({'where':{'ContactId':_0xd1f92f['id'],'closed':![],'WhatsappAccountId':_0x288c0d['id']}})[_0xcda6('0x39')](function(_0x471b3b){if(_0x471b3b){return[_0x471b3b,![]];}return db[_0xcda6('0xa0')][_0xcda6('0x60')]({'UserId':_0x203681['user']['id'],'ContactId':_0xd1f92f['id'],'WhatsappAccountId':_0x288c0d['id'],'phone':_0x3471b1,'firstMsgDirection':'out','Messages':[_[_0xcda6('0x54')](_0x203681[_0xcda6('0x61')],{'read':![],'body':_0x203681[_0xcda6('0x61')][_0xcda6('0x61')],'phone':_0x3471b1,'WhatsappAccountId':_0x288c0d['id'],'UserId':_0x203681['user']['id'],'ContactId':_0xd1f92f['id']})]},{'include':[{'model':db[_0xcda6('0xa5')],'as':_0xcda6('0xb7')}]})[_0xcda6('0x39')](function(_0x4eadbc){return[_0x4eadbc,!![]];});});}})['spread'](function(_0xd5e1f7,_0x44683d){if(_0x44683d){return _0xd5e1f7;}return db['WhatsappMessage']['create'](_['merge'](_0x203681[_0xcda6('0x61')],{'read':![],'body':_0x203681['body'][_0xcda6('0x61')],'phone':_0x3471b1,'WhatsappAccountId':_0x288c0d['id'],'WhatsappInteractionId':_0xd5e1f7['id'],'UserId':_0x203681[_0xcda6('0x63')]['id'],'ContactId':_0xd1f92f['id']}))[_0xcda6('0x39')](function(_0x409da9){_0xd5e1f7[_0xcda6('0xb8')][_0xcda6('0xb7')]=[];_0xd5e1f7[_0xcda6('0xb8')][_0xcda6('0xb7')][_0xcda6('0xb9')](_0x409da9[_0xcda6('0xb8')]);return _0xd5e1f7;});})[_0xcda6('0x39')](respondWithResult(_0x3f7146,null))['catch'](handleError(_0x3f7146,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 11ff88d..a4745c8 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 _0x9440=['WhatsappAccount','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x3a28cf,_0x287640){var _0x29a456=function(_0x29ff85){while(--_0x29ff85){_0x3a28cf['push'](_0x3a28cf['shift']());}};_0x29a456(++_0x287640);}(_0x9440,0xce));var _0x0944=function(_0x9942b2,_0x4ea131){_0x9942b2=_0x9942b2-0x0;var _0xb00340=_0x9440[_0x9942b2];return _0xb00340;};'use strict';var EventEmitter=require(_0x0944('0x0'));var WhatsappAccount=require(_0x0944('0x1'))['db'][_0x0944('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0944('0x3')](0x0);var events={'afterCreate':_0x0944('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb43ec3){return function(_0x5aa3a8,_0x21c4ac,_0x3adad4){WhatsappAccountEvents[_0x0944('0x5')](_0xb43ec3+':'+_0x5aa3a8['id'],_0x5aa3a8);WhatsappAccountEvents[_0x0944('0x5')](_0xb43ec3,_0x5aa3a8);_0x3adad4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x0944('0x6')](e,emitEvent(event));}}module[_0x0944('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x49fb=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x33e307,_0x28e896){var _0x272e69=function(_0x1e802b){while(--_0x1e802b){_0x33e307['push'](_0x33e307['shift']());}};_0x272e69(++_0x28e896);}(_0x49fb,0x1c3));var _0xb49f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x49fb[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xb49f('0x0'));var WhatsappAccount=require(_0xb49f('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb49f('0x2'),'afterUpdate':'update','afterDestroy':_0xb49f('0x3')};function emitEvent(_0x2bf5dd){return function(_0x4b28a7,_0x1a7372,_0x44ccfe){WhatsappAccountEvents[_0xb49f('0x4')](_0x2bf5dd+':'+_0x4b28a7['id'],_0x4b28a7);WhatsappAccountEvents['emit'](_0x2bf5dd,_0x4b28a7);_0x44ccfe(null);};}for(var e in events){if(events[_0xb49f('0x5')](e)){var event=events[e];WhatsappAccount[_0xb49f('0x6')](e,emitEvent(event));}}module[_0xb49f('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index d8419fd..ec19709 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 _0xb3d6=['whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappAccount.attributes','exports','WhatsappAccount'];(function(_0x10c266,_0x41e8d2){var _0x4a9598=function(_0x3e8ba0){while(--_0x3e8ba0){_0x10c266['push'](_0x10c266['shift']());}};_0x4a9598(++_0x41e8d2);}(_0xb3d6,0xfe));var _0x6b3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb3d6[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6b3d('0x0'));var util=require('util');var logger=require(_0x6b3d('0x1'))(_0x6b3d('0x2'));var moment=require(_0x6b3d('0x3'));var BPromise=require(_0x6b3d('0x4'));var rp=require(_0x6b3d('0x5'));var fs=require('fs');var path=require(_0x6b3d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6b3d('0x7'));module[_0x6b3d('0x8')]=function(_0x162f78,_0x578595){return _0x162f78['define'](_0x6b3d('0x9'),attributes,{'tableName':_0x6b3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa92c=['WhatsappAccount','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x345432,_0x585025){var _0x162838=function(_0x72ce8c){while(--_0x72ce8c){_0x345432['push'](_0x345432['shift']());}};_0x162838(++_0x585025);}(_0xa92c,0xf1));var _0xca92=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa92c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xca92('0x0'));var util=require(_0xca92('0x1'));var logger=require(_0xca92('0x2'))(_0xca92('0x3'));var moment=require(_0xca92('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca92('0x5'));var rimraf=require(_0xca92('0x6'));var config=require(_0xca92('0x7'));var attributes=require(_0xca92('0x8'));module[_0xca92('0x9')]=function(_0x59436c,_0x555ca7){return _0x59436c[_0xca92('0xa')](_0xca92('0xb'),attributes,{'tableName':'whatsapp_accounts','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 224ffbf..a0c8183 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 _0x8f21=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappAccount','find','options','where','attributes','include','map','model','then','ShowWhatsappAccount'];(function(_0xbc7dd1,_0x8457a4){var _0x6a5f24=function(_0x56e4e7){while(--_0x56e4e7){_0xbc7dd1['push'](_0xbc7dd1['shift']());}};_0x6a5f24(++_0x8457a4);}(_0x8f21,0x1ee));var _0x18f2=function(_0x454b61,_0xdc3d5d){_0x454b61=_0x454b61-0x0;var _0x472c8f=_0x8f21[_0x454b61];return _0x472c8f;};'use strict';var _=require('lodash');var util=require(_0x18f2('0x0'));var moment=require(_0x18f2('0x1'));var BPromise=require(_0x18f2('0x2'));var rs=require(_0x18f2('0x3'));var fs=require('fs');var Redis=require(_0x18f2('0x4'));var db=require(_0x18f2('0x5'))['db'];var utils=require(_0x18f2('0x6'));var logger=require('../../config/logger')(_0x18f2('0x7'));var config=require(_0x18f2('0x8'));var jayson=require(_0x18f2('0x9'));var client=jayson[_0x18f2('0xa')][_0x18f2('0xb')]({'port':0x232a});config[_0x18f2('0xc')]=_[_0x18f2('0xd')](config[_0x18f2('0xc')],{'host':_0x18f2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18f2('0xc')]));require(_0x18f2('0xf'))[_0x18f2('0x10')](socket);function respondWithRpcPromise(_0x2e8cf0,_0x293df9,_0xfbe3b6){return new BPromise(function(_0x12db0a,_0x4678c6){return client[_0x18f2('0x11')](_0x2e8cf0,_0xfbe3b6)['then'](function(_0x2fd377){logger['info'](_0x18f2('0x12'),_0x293df9,_0x18f2('0x13'));logger[_0x18f2('0x14')](_0x18f2('0x15'),_0x293df9,_0x18f2('0x13'),JSON[_0x18f2('0x16')](_0x2fd377));if(_0x2fd377[_0x18f2('0x17')]){if(_0x2fd377['error']['code']===0x1f4){logger['error'](_0x18f2('0x12'),_0x293df9,_0x2fd377[_0x18f2('0x17')][_0x18f2('0x18')]);return _0x4678c6(_0x2fd377[_0x18f2('0x17')]['message']);}logger[_0x18f2('0x17')](_0x18f2('0x12'),_0x293df9,_0x2fd377[_0x18f2('0x17')][_0x18f2('0x18')]);return _0x12db0a(_0x2fd377['error'][_0x18f2('0x18')]);}else{logger[_0x18f2('0x19')](_0x18f2('0x12'),_0x293df9,'request\x20sent');_0x12db0a(_0x2fd377[_0x18f2('0x1a')][_0x18f2('0x18')]);}})[_0x18f2('0x1b')](function(_0xd39737){logger[_0x18f2('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x293df9,_0xd39737);_0x4678c6(_0xd39737);});});}exports['ShowWhatsappAccount']=function(_0x30a66c){var _0x474da4=this;return new Promise(function(_0x1c81e2,_0x192349){return db[_0x18f2('0x1c')][_0x18f2('0x1d')]({'raw':_0x30a66c[_0x18f2('0x1e')]?_0x30a66c[_0x18f2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x30a66c[_0x18f2('0x1e')]?_0x30a66c[_0x18f2('0x1e')][_0x18f2('0x1f')]||null:null,'attributes':_0x30a66c[_0x18f2('0x1e')]?_0x30a66c[_0x18f2('0x1e')][_0x18f2('0x20')]||null:null,'include':_0x30a66c[_0x18f2('0x1e')]?_0x30a66c[_0x18f2('0x1e')][_0x18f2('0x21')]?_[_0x18f2('0x22')](_0x30a66c[_0x18f2('0x1e')]['include'],function(_0x4a99dd){return{'model':db[_0x4a99dd[_0x18f2('0x23')]],'as':_0x4a99dd['as'],'attributes':_0x4a99dd[_0x18f2('0x20')],'include':_0x4a99dd[_0x18f2('0x21')]?_[_0x18f2('0x22')](_0x4a99dd[_0x18f2('0x21')],function(_0x5c67de){return{'model':db[_0x5c67de[_0x18f2('0x23')]],'as':_0x5c67de['as'],'attributes':_0x5c67de[_0x18f2('0x20')],'include':_0x5c67de[_0x18f2('0x21')]?_[_0x18f2('0x22')](_0x5c67de[_0x18f2('0x21')],function(_0x59ccf7){return{'model':db[_0x59ccf7[_0x18f2('0x23')]],'as':_0x59ccf7['as'],'attributes':_0x59ccf7[_0x18f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x18f2('0x24')](function(_0x2cacc4){logger[_0x18f2('0x19')](_0x18f2('0x25'),_0x30a66c);logger[_0x18f2('0x14')](_0x18f2('0x25'),_0x30a66c,JSON['stringify'](_0x2cacc4));_0x1c81e2(_0x2cacc4);})['catch'](function(_0x346797){logger[_0x18f2('0x17')](_0x18f2('0x25'),_0x346797[_0x18f2('0x18')],_0x30a66c);_0x192349(_0x474da4[_0x18f2('0x17')](0x1f4,_0x346797[_0x18f2('0x18')]));});});}; \ No newline at end of file +var _0x0ec5=['./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0ec5,0x9e));var _0x50ec=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0ec5[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x50ec('0x0'));var util=require(_0x50ec('0x1'));var moment=require(_0x50ec('0x2'));var BPromise=require(_0x50ec('0x3'));var rs=require(_0x50ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50ec('0x5'));var logger=require('../../config/logger')(_0x50ec('0x6'));var config=require(_0x50ec('0x7'));var jayson=require(_0x50ec('0x8'));var client=jayson['client'][_0x50ec('0x9')]({'port':0x232a});config[_0x50ec('0xa')]=_['defaults'](config[_0x50ec('0xa')],{'host':_0x50ec('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50ec('0xa')]));require(_0x50ec('0xc'))[_0x50ec('0xd')](socket);function respondWithRpcPromise(_0x2fca1a,_0x251a23,_0x4b385b){return new BPromise(function(_0x2f2d8e,_0x41b72d){return client[_0x50ec('0xe')](_0x2fca1a,_0x4b385b)[_0x50ec('0xf')](function(_0x509ef1){logger[_0x50ec('0x10')](_0x50ec('0x11'),_0x251a23,_0x50ec('0x12'));logger[_0x50ec('0x13')](_0x50ec('0x14'),_0x251a23,_0x50ec('0x12'),JSON['stringify'](_0x509ef1));if(_0x509ef1[_0x50ec('0x15')]){if(_0x509ef1[_0x50ec('0x15')][_0x50ec('0x16')]===0x1f4){logger['error'](_0x50ec('0x11'),_0x251a23,_0x509ef1[_0x50ec('0x15')]['message']);return _0x41b72d(_0x509ef1[_0x50ec('0x15')][_0x50ec('0x17')]);}logger[_0x50ec('0x15')](_0x50ec('0x11'),_0x251a23,_0x509ef1['error'][_0x50ec('0x17')]);return _0x2f2d8e(_0x509ef1[_0x50ec('0x15')][_0x50ec('0x17')]);}else{logger[_0x50ec('0x10')](_0x50ec('0x11'),_0x251a23,_0x50ec('0x12'));_0x2f2d8e(_0x509ef1['result'][_0x50ec('0x17')]);}})[_0x50ec('0x18')](function(_0x2fa19b){logger[_0x50ec('0x15')](_0x50ec('0x11'),_0x251a23,_0x2fa19b);_0x41b72d(_0x2fa19b);});});}exports[_0x50ec('0x19')]=function(_0x56a0e6){var _0x35c4b6=this;return new Promise(function(_0x1c8f7a,_0x3c5d2d){return db[_0x50ec('0x1a')][_0x50ec('0x1b')]({'raw':_0x56a0e6[_0x50ec('0x1c')]?_0x56a0e6[_0x50ec('0x1c')][_0x50ec('0x1d')]===undefined?!![]:![]:!![],'where':_0x56a0e6['options']?_0x56a0e6['options'][_0x50ec('0x1e')]||null:null,'attributes':_0x56a0e6['options']?_0x56a0e6['options'][_0x50ec('0x1f')]||null:null,'include':_0x56a0e6[_0x50ec('0x1c')]?_0x56a0e6[_0x50ec('0x1c')][_0x50ec('0x20')]?_['map'](_0x56a0e6[_0x50ec('0x1c')][_0x50ec('0x20')],function(_0x4b1dea){return{'model':db[_0x4b1dea[_0x50ec('0x21')]],'as':_0x4b1dea['as'],'attributes':_0x4b1dea[_0x50ec('0x1f')],'include':_0x4b1dea[_0x50ec('0x20')]?_['map'](_0x4b1dea[_0x50ec('0x20')],function(_0x1242a4){return{'model':db[_0x1242a4[_0x50ec('0x21')]],'as':_0x1242a4['as'],'attributes':_0x1242a4[_0x50ec('0x1f')],'include':_0x1242a4[_0x50ec('0x20')]?_['map'](_0x1242a4['include'],function(_0x11b608){return{'model':db[_0x11b608['model']],'as':_0x11b608['as'],'attributes':_0x11b608[_0x50ec('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x409b94){logger['info'](_0x50ec('0x19'),_0x56a0e6);logger['debug'](_0x50ec('0x19'),_0x56a0e6,JSON['stringify'](_0x409b94));_0x1c8f7a(_0x409b94);})[_0x50ec('0x18')](function(_0x3784c7){logger[_0x50ec('0x15')](_0x50ec('0x19'),_0x3784c7[_0x50ec('0x17')],_0x56a0e6);_0x3c5d2d(_0x35c4b6[_0x50ec('0x15')](0x1f4,_0x3784c7['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 490511f..fb34fe2 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 _0xf2fe=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','register','length'];(function(_0x39e144,_0x4b4847){var _0x5ba205=function(_0x4317d3){while(--_0x4317d3){_0x39e144['push'](_0x39e144['shift']());}};_0x5ba205(++_0x4b4847);}(_0xf2fe,0x1d1));var _0xef2f=function(_0x1c5d50,_0x3f0b41){_0x1c5d50=_0x1c5d50-0x0;var _0x338541=_0xf2fe[_0x1c5d50];return _0x338541;};'use strict';var WhatsappAccountEvents=require(_0xef2f('0x0'));var events=[_0xef2f('0x1'),_0xef2f('0x2'),_0xef2f('0x3')];function createListener(_0x28ff6f,_0x46dadf){return function(_0xc71cfc){_0x46dadf[_0xef2f('0x4')](_0x28ff6f,_0xc71cfc);};}function removeListener(_0x457a9b,_0x476b5d){return function(){WhatsappAccountEvents['removeListener'](_0x457a9b,_0x476b5d);};}exports[_0xef2f('0x5')]=function(_0xc2bf63){for(var _0x16c154=0x0,_0x2e8912=events[_0xef2f('0x6')];_0x16c154<_0x2e8912;_0x16c154++){var _0x18779d=events[_0x16c154];var _0x3c9327=createListener(_0xef2f('0x7')+_0x18779d,_0xc2bf63);WhatsappAccountEvents['on'](_0x18779d,_0x3c9327);}}; \ No newline at end of file +var _0x1c8c=['length','whatsappAccount:','./whatsappAccount.events','remove','emit','removeListener','register'];(function(_0xe114b1,_0x5b1581){var _0x5f08b3=function(_0x1b1d98){while(--_0x1b1d98){_0xe114b1['push'](_0xe114b1['shift']());}};_0x5f08b3(++_0x5b1581);}(_0x1c8c,0x16e));var _0xc1c8=function(_0x39869d,_0xba5659){_0x39869d=_0x39869d-0x0;var _0x1d76fc=_0x1c8c[_0x39869d];return _0x1d76fc;};'use strict';var WhatsappAccountEvents=require(_0xc1c8('0x0'));var events=['save',_0xc1c8('0x1'),'update'];function createListener(_0x448d3b,_0x18e5f3){return function(_0x4d7c1c){_0x18e5f3[_0xc1c8('0x2')](_0x448d3b,_0x4d7c1c);};}function removeListener(_0x5f4890,_0xf634ce){return function(){WhatsappAccountEvents[_0xc1c8('0x3')](_0x5f4890,_0xf634ce);};}exports[_0xc1c8('0x4')]=function(_0x3ce370){for(var _0x36e29f=0x0,_0x47c222=events[_0xc1c8('0x5')];_0x36e29f<_0x47c222;_0x36e29f++){var _0x3a9ef5=events[_0x36e29f];var _0x26c547=createListener(_0xc1c8('0x6')+_0x3a9ef5,_0x3ce370);WhatsappAccountEvents['on'](_0x3a9ef5,_0x26c547);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index a2bdc53..2c7f9fd 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 _0xeaff=['show','put','update','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x4ec32e,_0x282aff){var _0x306ad0=function(_0x33cba4){while(--_0x33cba4){_0x4ec32e['push'](_0x4ec32e['shift']());}};_0x306ad0(++_0x282aff);}(_0xeaff,0xae));var _0xfeaf=function(_0x2e1604,_0x2d98b2){_0x2e1604=_0x2e1604-0x0;var _0x55bb17=_0xeaff[_0x2e1604];return _0x55bb17;};'use strict';var multer=require('multer');var util=require(_0xfeaf('0x0'));var path=require(_0xfeaf('0x1'));var timeout=require('connect-timeout');var express=require(_0xfeaf('0x2'));var router=express[_0xfeaf('0x3')]();var fs_extra=require(_0xfeaf('0x4'));var auth=require(_0xfeaf('0x5'));var interaction=require(_0xfeaf('0x6'));var config=require(_0xfeaf('0x7'));var controller=require(_0xfeaf('0x8'));router[_0xfeaf('0x9')]('/',auth[_0xfeaf('0xa')](),controller[_0xfeaf('0xb')]);router[_0xfeaf('0x9')](_0xfeaf('0xc'),auth[_0xfeaf('0xa')](),controller[_0xfeaf('0xd')]);router['post']('/',auth[_0xfeaf('0xa')](),controller['create']);router[_0xfeaf('0xe')](_0xfeaf('0xc'),auth[_0xfeaf('0xa')](),controller[_0xfeaf('0xf')]);router[_0xfeaf('0x10')](_0xfeaf('0xc'),auth[_0xfeaf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x947e=['isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x947e,0x1d2));var _0xe947=function(_0x480409,_0xac5662){_0x480409=_0x480409-0x0;var _0x56b323=_0x947e[_0x480409];return _0x56b323;};'use strict';var multer=require(_0xe947('0x0'));var util=require(_0xe947('0x1'));var path=require(_0xe947('0x2'));var timeout=require(_0xe947('0x3'));var express=require(_0xe947('0x4'));var router=express['Router']();var fs_extra=require(_0xe947('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe947('0x6'));var config=require(_0xe947('0x7'));var controller=require('./whatsappApplication.controller');router[_0xe947('0x8')]('/',auth[_0xe947('0x9')](),controller[_0xe947('0xa')]);router[_0xe947('0x8')]('/:id',auth[_0xe947('0x9')](),controller[_0xe947('0xb')]);router[_0xe947('0xc')]('/',auth[_0xe947('0x9')](),controller[_0xe947('0xd')]);router[_0xe947('0xe')](_0xe947('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xe947('0x10')]('/:id',auth[_0xe947('0x9')](),controller[_0xe947('0x11')]);module[_0xe947('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index c4877f0..a9c7a7d 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 _0x12d1=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x450c9e,_0x365443){var _0x3b9b4b=function(_0x2c6a7e){while(--_0x2c6a7e){_0x450c9e['push'](_0x450c9e['shift']());}};_0x3b9b4b(++_0x365443);}(_0x12d1,0x138));var _0x112d=function(_0x46726f,_0x3cc926){_0x46726f=_0x46726f-0x0;var _0x185698=_0x12d1[_0x46726f];return _0x185698;};'use strict';var Sequelize=require(_0x112d('0x0'));module[_0x112d('0x1')]={'priority':{'type':Sequelize[_0x112d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x112d('0x3')],'allowNull':![],'defaultValue':_0x112d('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x112d('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6b0f=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6b0f,0x7c));var _0xf6b0=function(_0x41d336,_0x22db65){_0x41d336=_0x41d336-0x0;var _0x1c1f11=_0x6b0f[_0x41d336];return _0x1c1f11;};'use strict';var Sequelize=require(_0xf6b0('0x0'));module[_0xf6b0('0x1')]={'priority':{'type':Sequelize[_0xf6b0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf6b0('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf6b0('0x4')]()},'description':{'type':Sequelize[_0xf6b0('0x3')]},'interval':{'type':Sequelize[_0xf6b0('0x3')],'defaultValue':_0xf6b0('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index ee5674a..b7224a5 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 _0xe1c4=['../../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','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xd46479,_0x5b1b55){var _0x531f04=function(_0x3c1af6){while(--_0x3c1af6){_0xd46479['push'](_0xd46479['shift']());}};_0x531f04(++_0x5b1b55);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x499eaf,_0x560a5a){_0x499eaf=_0x499eaf-0x0;var _0x2fa121=_0xe1c4[_0x499eaf];return _0x2fa121;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4e1c('0x4'));var util=require(_0x4e1c('0x5'));var path=require(_0x4e1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e1c('0x7'));var fs=require('fs');var fs_extra=require(_0x4e1c('0x8'));var _=require(_0x4e1c('0x9'));var squel=require(_0x4e1c('0xa'));var crypto=require(_0x4e1c('0xb'));var jsforce=require(_0x4e1c('0xc'));var deskjs=require(_0x4e1c('0xd'));var toCsv=require(_0x4e1c('0xe'));var querystring=require(_0x4e1c('0xf'));var Papa=require(_0x4e1c('0x10'));var Redis=require(_0x4e1c('0x11'));var authService=require(_0x4e1c('0x12'));var qs=require(_0x4e1c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e1c('0x14'));var logger=require(_0x4e1c('0x15'))('api');var utils=require(_0x4e1c('0x16'));var config=require(_0x4e1c('0x17'));var licenseUtil=require(_0x4e1c('0x18'));var db=require(_0x4e1c('0x19'))['db'];function respondWithStatusCode(_0x54b2d1,_0xb4a030){_0xb4a030=_0xb4a030||0xcc;return function(_0x12178d){if(_0x12178d){return _0x54b2d1[_0x4e1c('0x1a')](_0xb4a030);}return _0x54b2d1[_0x4e1c('0x1b')](_0xb4a030)['end']();};}function respondWithResult(_0x531159,_0x550f27){_0x550f27=_0x550f27||0xc8;return function(_0x12e7fe){if(_0x12e7fe){return _0x531159[_0x4e1c('0x1b')](_0x550f27)[_0x4e1c('0x1c')](_0x12e7fe);}};}function respondWithFilteredResult(_0x201779,_0x4d47ec){return function(_0x2cd5bc){if(_0x2cd5bc){var _0x374c78=typeof _0x4d47ec[_0x4e1c('0x1d')]===_0x4e1c('0x1e')&&typeof _0x4d47ec[_0x4e1c('0x1f')]===_0x4e1c('0x1e');var _0x58d9e3=_0x2cd5bc[_0x4e1c('0x20')];var _0x399bcc=_0x374c78?0x0:_0x4d47ec[_0x4e1c('0x1d')];var _0x46a887=_0x374c78?_0x2cd5bc[_0x4e1c('0x20')]:_0x4d47ec[_0x4e1c('0x1d')]+_0x4d47ec[_0x4e1c('0x1f')];var _0x544b08;if(_0x46a887>=_0x58d9e3){_0x46a887=_0x58d9e3;_0x544b08=0xc8;}else{_0x544b08=0xce;}_0x201779[_0x4e1c('0x1b')](_0x544b08);return _0x201779[_0x4e1c('0x21')](_0x4e1c('0x22'),_0x399bcc+'-'+_0x46a887+'/'+_0x58d9e3)[_0x4e1c('0x1c')](_0x2cd5bc);}return null;};}function patchUpdates(_0x33da37){return function(_0x427cc1){try{jsonpatch[_0x4e1c('0x23')](_0x427cc1,_0x33da37,!![]);}catch(_0x53a020){return BPromise[_0x4e1c('0x24')](_0x53a020);}return _0x427cc1[_0x4e1c('0x25')]();};}function saveUpdates(_0xc57bcc,_0x169b4e){return function(_0x3dde0d){if(_0x3dde0d){return _0x3dde0d[_0x4e1c('0x26')](_0xc57bcc)[_0x4e1c('0x27')](function(_0x19ed77){return _0x19ed77;});}return null;};}function removeEntity(_0x45c13e,_0x5ada14){return function(_0x46ad33){if(_0x46ad33){return _0x46ad33[_0x4e1c('0x28')]()[_0x4e1c('0x27')](function(){_0x45c13e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f5a5,_0x551d50){return function(_0x25cc93){if(!_0x25cc93){_0x17f5a5[_0x4e1c('0x1a')](0x194);}return _0x25cc93;};}function handleError(_0x2a2ccb,_0x564b30){_0x564b30=_0x564b30||0x1f4;return function(_0x12364d){logger[_0x4e1c('0x29')](_0x12364d['stack']);if(_0x12364d[_0x4e1c('0x2a')]){delete _0x12364d[_0x4e1c('0x2a')];}_0x2a2ccb[_0x4e1c('0x1b')](_0x564b30)[_0x4e1c('0x2b')](_0x12364d);};}exports[_0x4e1c('0x2c')]=function(_0x5ef2f7,_0xeccf79){var _0x8e3e14={},_0x1b5ba8={},_0x1c4c4a={'count':0x0,'rows':[]};var _0x504259=_[_0x4e1c('0x2d')](db[_0x4e1c('0x2e')]['rawAttributes'],function(_0x46d181){return{'name':_0x46d181['fieldName'],'type':_0x46d181[_0x4e1c('0x2f')][_0x4e1c('0x30')]};});_0x1b5ba8[_0x4e1c('0x31')]=_[_0x4e1c('0x2d')](_0x504259,'name');_0x1b5ba8[_0x4e1c('0x32')]=_['keys'](_0x5ef2f7[_0x4e1c('0x32')]);_0x1b5ba8['filters']=_[_0x4e1c('0x33')](_0x1b5ba8[_0x4e1c('0x31')],_0x1b5ba8['query']);_0x8e3e14[_0x4e1c('0x34')]=_['intersection'](_0x1b5ba8[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x35')]));_0x8e3e14[_0x4e1c('0x34')]=_0x8e3e14[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x8e3e14[_0x4e1c('0x34')]:_0x1b5ba8[_0x4e1c('0x31')];if(!_0x5ef2f7[_0x4e1c('0x32')]['hasOwnProperty'](_0x4e1c('0x37'))){_0x8e3e14[_0x4e1c('0x1f')]=qs[_0x4e1c('0x1f')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x1f')]);_0x8e3e14[_0x4e1c('0x1d')]=qs['offset'](_0x5ef2f7['query'][_0x4e1c('0x1d')]);}_0x8e3e14[_0x4e1c('0x38')]=qs[_0x4e1c('0x39')](_0x5ef2f7[_0x4e1c('0x32')]['sort']);_0x8e3e14[_0x4e1c('0x3a')]=qs[_0x4e1c('0x3b')](_['pick'](_0x5ef2f7[_0x4e1c('0x32')],_0x1b5ba8[_0x4e1c('0x3b')]),_0x504259);if(_0x5ef2f7[_0x4e1c('0x32')]['filter']){_0x8e3e14[_0x4e1c('0x3a')]=_[_0x4e1c('0x3c')](_0x8e3e14['where'],{'$or':_[_0x4e1c('0x2d')](_0x504259,function(_0x128ddd){if(_0x128ddd[_0x4e1c('0x2f')]!==_0x4e1c('0x3d')){var _0x1cb1a3={};_0x1cb1a3[_0x128ddd[_0x4e1c('0x2a')]]={'$like':'%'+_0x5ef2f7['query']['filter']+'%'};return _0x1cb1a3;}})});}_0x8e3e14=_[_0x4e1c('0x3c')]({},_0x8e3e14,_0x5ef2f7[_0x4e1c('0x3e')]);var _0x390d05={'where':_0x8e3e14[_0x4e1c('0x3a')]};return db[_0x4e1c('0x2e')][_0x4e1c('0x20')](_0x390d05)[_0x4e1c('0x27')](function(_0x6838bc){_0x1c4c4a[_0x4e1c('0x20')]=_0x6838bc;if(_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x3f')]){_0x8e3e14['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x4e1c('0x40')](_0x8e3e14);})[_0x4e1c('0x27')](function(_0xe26367){_0x1c4c4a[_0x4e1c('0x41')]=_0xe26367;return _0x1c4c4a;})[_0x4e1c('0x27')](respondWithFilteredResult(_0xeccf79,_0x8e3e14))[_0x4e1c('0x42')](handleError(_0xeccf79,null));};exports['show']=function(_0x18d021,_0x1da617){var _0x827f0a={'raw':!![],'where':{'id':_0x18d021[_0x4e1c('0x43')]['id']}},_0xdfb6d7={};_0xdfb6d7[_0x4e1c('0x31')]=_[_0x4e1c('0x44')](db[_0x4e1c('0x2e')][_0x4e1c('0x45')]);_0xdfb6d7[_0x4e1c('0x32')]=_[_0x4e1c('0x44')](_0x18d021['query']);_0xdfb6d7[_0x4e1c('0x3b')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],_0xdfb6d7[_0x4e1c('0x32')]);_0x827f0a[_0x4e1c('0x34')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x18d021['query'][_0x4e1c('0x35')]));_0x827f0a['attributes']=_0x827f0a[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x827f0a['attributes']:_0xdfb6d7[_0x4e1c('0x31')];if(_0x18d021[_0x4e1c('0x32')]['includeAll']){_0x827f0a['include']=[{'all':!![]}];}_0x827f0a=_[_0x4e1c('0x3c')]({},_0x827f0a,_0x18d021[_0x4e1c('0x3e')]);return db[_0x4e1c('0x2e')][_0x4e1c('0x46')](_0x827f0a)['then'](handleEntityNotFound(_0x1da617,null))[_0x4e1c('0x27')](respondWithResult(_0x1da617,null))[_0x4e1c('0x42')](handleError(_0x1da617,null));};exports[_0x4e1c('0x47')]=function(_0x6fae67,_0x488fe4){return db[_0x4e1c('0x2e')][_0x4e1c('0x47')](_0x6fae67[_0x4e1c('0x48')],{})[_0x4e1c('0x27')](respondWithResult(_0x488fe4,0xc9))[_0x4e1c('0x42')](handleError(_0x488fe4,null));};exports[_0x4e1c('0x26')]=function(_0x38aa72,_0x25ba45){if(_0x38aa72[_0x4e1c('0x48')]['id']){delete _0x38aa72['body']['id'];}return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x38aa72[_0x4e1c('0x43')]['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x25ba45,null))[_0x4e1c('0x27')](saveUpdates(_0x38aa72['body'],null))['then'](respondWithResult(_0x25ba45,null))[_0x4e1c('0x42')](handleError(_0x25ba45,null));};exports[_0x4e1c('0x28')]=function(_0x4b6910,_0x304b74){return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x4b6910['params']['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x304b74,null))['then'](removeEntity(_0x304b74,null))[_0x4e1c('0x42')](handleError(_0x304b74,null));}; \ No newline at end of file +var _0x11c1=['include','findAll','catch','show','params','includeAll','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options'];(function(_0x5a7e9a,_0xe66044){var _0x374c90=function(_0x3529ac){while(--_0x3529ac){_0x5a7e9a['push'](_0x5a7e9a['shift']());}};_0x374c90(++_0xe66044);}(_0x11c1,0x1cb));var _0x111c=function(_0x507bd3,_0x4f499c){_0x507bd3=_0x507bd3-0x0;var _0x557254=_0x11c1[_0x507bd3];return _0x557254;};'use strict';var emlformat=require(_0x111c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x111c('0x1'));var jsonpatch=require(_0x111c('0x2'));var rp=require(_0x111c('0x3'));var moment=require(_0x111c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x111c('0x5'));var util=require(_0x111c('0x6'));var path=require(_0x111c('0x7'));var sox=require(_0x111c('0x8'));var csv=require(_0x111c('0x9'));var ejs=require(_0x111c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x111c('0xb'));var squel=require(_0x111c('0xc'));var crypto=require(_0x111c('0xd'));var jsforce=require(_0x111c('0xe'));var deskjs=require(_0x111c('0xf'));var toCsv=require(_0x111c('0x9'));var querystring=require(_0x111c('0x10'));var Papa=require(_0x111c('0x11'));var Redis=require(_0x111c('0x12'));var authService=require(_0x111c('0x13'));var qs=require(_0x111c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x111c('0x15'));var config=require(_0x111c('0x16'));var licenseUtil=require(_0x111c('0x17'));var db=require(_0x111c('0x18'))['db'];function respondWithStatusCode(_0x161df9,_0x18f728){_0x18f728=_0x18f728||0xcc;return function(_0x37deee){if(_0x37deee){return _0x161df9[_0x111c('0x19')](_0x18f728);}return _0x161df9[_0x111c('0x1a')](_0x18f728)[_0x111c('0x1b')]();};}function respondWithResult(_0x1b0dd5,_0x37a4bd){_0x37a4bd=_0x37a4bd||0xc8;return function(_0x3ad856){if(_0x3ad856){return _0x1b0dd5[_0x111c('0x1a')](_0x37a4bd)[_0x111c('0x1c')](_0x3ad856);}};}function respondWithFilteredResult(_0x412f7e,_0x2d2adb){return function(_0x9e7a7c){if(_0x9e7a7c){var _0x3babf6=typeof _0x2d2adb['offset']==='undefined'&&typeof _0x2d2adb['limit']===_0x111c('0x1d');var _0x4bd3d8=_0x9e7a7c['count'];var _0x198249=_0x3babf6?0x0:_0x2d2adb[_0x111c('0x1e')];var _0x2d54e6=_0x3babf6?_0x9e7a7c[_0x111c('0x1f')]:_0x2d2adb[_0x111c('0x1e')]+_0x2d2adb[_0x111c('0x20')];var _0x5b9171;if(_0x2d54e6>=_0x4bd3d8){_0x2d54e6=_0x4bd3d8;_0x5b9171=0xc8;}else{_0x5b9171=0xce;}_0x412f7e[_0x111c('0x1a')](_0x5b9171);return _0x412f7e[_0x111c('0x21')]('Content-Range',_0x198249+'-'+_0x2d54e6+'/'+_0x4bd3d8)[_0x111c('0x1c')](_0x9e7a7c);}return null;};}function patchUpdates(_0x211de8){return function(_0x1df840){try{jsonpatch['apply'](_0x1df840,_0x211de8,!![]);}catch(_0x39ebe3){return BPromise[_0x111c('0x22')](_0x39ebe3);}return _0x1df840[_0x111c('0x23')]();};}function saveUpdates(_0x54a586,_0x31b236){return function(_0x17d02b){if(_0x17d02b){return _0x17d02b[_0x111c('0x24')](_0x54a586)[_0x111c('0x25')](function(_0x2c4c6b){return _0x2c4c6b;});}return null;};}function removeEntity(_0x3da021,_0xe5b252){return function(_0x3694b5){if(_0x3694b5){return _0x3694b5[_0x111c('0x26')]()['then'](function(){_0x3da021[_0x111c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b3b8,_0x2576b8){return function(_0x5764b9){if(!_0x5764b9){_0x26b3b8[_0x111c('0x19')](0x194);}return _0x5764b9;};}function handleError(_0x17a9cd,_0x55e7d0){_0x55e7d0=_0x55e7d0||0x1f4;return function(_0x33040d){logger[_0x111c('0x27')](_0x33040d[_0x111c('0x28')]);if(_0x33040d[_0x111c('0x29')]){delete _0x33040d[_0x111c('0x29')];}_0x17a9cd[_0x111c('0x1a')](_0x55e7d0)[_0x111c('0x2a')](_0x33040d);};}exports[_0x111c('0x2b')]=function(_0x46e407,_0x70592b){var _0x5e3047={},_0x40d992={},_0x45bd8c={'count':0x0,'rows':[]};var _0x4c9c67=_[_0x111c('0x2c')](db[_0x111c('0x2d')]['rawAttributes'],function(_0x401138){return{'name':_0x401138[_0x111c('0x2e')],'type':_0x401138['type'][_0x111c('0x2f')]};});_0x40d992['model']=_['map'](_0x4c9c67,_0x111c('0x29'));_0x40d992[_0x111c('0x30')]=_[_0x111c('0x31')](_0x46e407[_0x111c('0x30')]);_0x40d992[_0x111c('0x32')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],_0x40d992[_0x111c('0x30')]);_0x5e3047[_0x111c('0x35')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],qs[_0x111c('0x36')](_0x46e407[_0x111c('0x30')]['fields']));_0x5e3047[_0x111c('0x35')]=_0x5e3047[_0x111c('0x35')][_0x111c('0x37')]?_0x5e3047['attributes']:_0x40d992[_0x111c('0x34')];if(!_0x46e407[_0x111c('0x30')][_0x111c('0x38')](_0x111c('0x39'))){_0x5e3047[_0x111c('0x20')]=qs[_0x111c('0x20')](_0x46e407[_0x111c('0x30')]['limit']);_0x5e3047[_0x111c('0x1e')]=qs['offset'](_0x46e407[_0x111c('0x30')][_0x111c('0x1e')]);}_0x5e3047[_0x111c('0x3a')]=qs[_0x111c('0x3b')](_0x46e407['query'][_0x111c('0x3b')]);_0x5e3047['where']=qs[_0x111c('0x32')](_['pick'](_0x46e407[_0x111c('0x30')],_0x40d992[_0x111c('0x32')]),_0x4c9c67);if(_0x46e407[_0x111c('0x30')][_0x111c('0x3c')]){_0x5e3047[_0x111c('0x3d')]=_[_0x111c('0x3e')](_0x5e3047[_0x111c('0x3d')],{'$or':_[_0x111c('0x2c')](_0x4c9c67,function(_0x56fb83){if(_0x56fb83[_0x111c('0x3f')]!==_0x111c('0x40')){var _0x591fe1={};_0x591fe1[_0x56fb83['name']]={'$like':'%'+_0x46e407[_0x111c('0x30')]['filter']+'%'};return _0x591fe1;}})});}_0x5e3047=_['merge']({},_0x5e3047,_0x46e407[_0x111c('0x41')]);var _0x5ffb09={'where':_0x5e3047[_0x111c('0x3d')]};return db[_0x111c('0x2d')][_0x111c('0x1f')](_0x5ffb09)[_0x111c('0x25')](function(_0x167b00){_0x45bd8c[_0x111c('0x1f')]=_0x167b00;if(_0x46e407[_0x111c('0x30')]['includeAll']){_0x5e3047[_0x111c('0x42')]=[{'all':!![]}];}return db[_0x111c('0x2d')][_0x111c('0x43')](_0x5e3047);})['then'](function(_0x354dca){_0x45bd8c['rows']=_0x354dca;return _0x45bd8c;})['then'](respondWithFilteredResult(_0x70592b,_0x5e3047))[_0x111c('0x44')](handleError(_0x70592b,null));};exports[_0x111c('0x45')]=function(_0x10f4f7,_0x22e95b){var _0x38d7a0={'raw':!![],'where':{'id':_0x10f4f7[_0x111c('0x46')]['id']}},_0x1b4e4f={};_0x1b4e4f[_0x111c('0x34')]=_['keys'](db[_0x111c('0x2d')]['rawAttributes']);_0x1b4e4f[_0x111c('0x30')]=_[_0x111c('0x31')](_0x10f4f7[_0x111c('0x30')]);_0x1b4e4f[_0x111c('0x32')]=_[_0x111c('0x33')](_0x1b4e4f['model'],_0x1b4e4f['query']);_0x38d7a0[_0x111c('0x35')]=_[_0x111c('0x33')](_0x1b4e4f[_0x111c('0x34')],qs['fields'](_0x10f4f7['query']['fields']));_0x38d7a0['attributes']=_0x38d7a0[_0x111c('0x35')]['length']?_0x38d7a0['attributes']:_0x1b4e4f['model'];if(_0x10f4f7[_0x111c('0x30')][_0x111c('0x47')]){_0x38d7a0['include']=[{'all':!![]}];}_0x38d7a0=_['merge']({},_0x38d7a0,_0x10f4f7['options']);return db[_0x111c('0x2d')]['find'](_0x38d7a0)[_0x111c('0x25')](handleEntityNotFound(_0x22e95b,null))[_0x111c('0x25')](respondWithResult(_0x22e95b,null))[_0x111c('0x44')](handleError(_0x22e95b,null));};exports[_0x111c('0x48')]=function(_0x2849b6,_0x137ee5){return db['WhatsappApplication'][_0x111c('0x48')](_0x2849b6[_0x111c('0x49')],{})['then'](respondWithResult(_0x137ee5,0xc9))[_0x111c('0x44')](handleError(_0x137ee5,null));};exports[_0x111c('0x24')]=function(_0x8cad9c,_0x24731d){if(_0x8cad9c[_0x111c('0x49')]['id']){delete _0x8cad9c[_0x111c('0x49')]['id'];}return db[_0x111c('0x2d')][_0x111c('0x4a')]({'where':{'id':_0x8cad9c[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x24731d,null))['then'](saveUpdates(_0x8cad9c['body'],null))[_0x111c('0x25')](respondWithResult(_0x24731d,null))[_0x111c('0x44')](handleError(_0x24731d,null));};exports[_0x111c('0x26')]=function(_0x4288ab,_0x584c6f){return db['WhatsappApplication'][_0x111c('0x4a')]({'where':{'id':_0x4288ab[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x584c6f,null))[_0x111c('0x25')](removeEntity(_0x584c6f,null))['catch'](handleError(_0x584c6f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 61909b5..1a8843b 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 _0xa37e=['bluebird','path','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x31996a,_0x279ab3){var _0x443a50=function(_0x51008b){while(--_0x51008b){_0x31996a['push'](_0x31996a['shift']());}};_0x443a50(++_0x279ab3);}(_0xa37e,0x97));var _0xea37=function(_0x1f384d,_0x3a0062){_0x1f384d=_0x1f384d-0x0;var _0x21fd75=_0xa37e[_0x1f384d];return _0x21fd75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea37('0x4'));var rimraf=require('rimraf');var config=require(_0xea37('0x5'));var attributes=require(_0xea37('0x6'));module[_0xea37('0x7')]=function(_0x4d380b,_0x57135b){return _0x4d380b[_0xea37('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea37('0x9'),'collate':_0xea37('0xa')});}; \ No newline at end of file +var _0xce50=['whatsapp_applications','utf8mb4','util','../../config/logger','api','moment','bluebird','rimraf','exports','define'];(function(_0x5e5888,_0x22bc3f){var _0x4c1bdb=function(_0x11e08c){while(--_0x11e08c){_0x5e5888['push'](_0x5e5888['shift']());}};_0x4c1bdb(++_0x22bc3f);}(_0xce50,0x1d8));var _0x0ce5=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xce50[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0x0ce5('0x0'));var logger=require(_0x0ce5('0x1'))(_0x0ce5('0x2'));var moment=require(_0x0ce5('0x3'));var BPromise=require(_0x0ce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce5('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0x0ce5('0x6')]=function(_0x42fadd,_0x69892c){return _0x42fadd[_0x0ce5('0x7')]('WhatsappApplication',attributes,{'tableName':_0x0ce5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ce5('0x9'),'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 c6ec27b..392dbc7 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 _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x49b80a,_0x5886a6){var _0x3026f4=function(_0x4e4acb){while(--_0x4e4acb){_0x49b80a['push'](_0x49b80a['shift']());}};_0x3026f4(++_0x5886a6);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x4bc3[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x172811,_0x303826){var _0x10e7f2=function(_0x50f0f2){while(--_0x50f0f2){_0x172811['push'](_0x172811['shift']());}};_0x10e7f2(++_0x303826);}(_0xd2ea,0x15f));var _0xad2e=function(_0x93d9c,_0x2ca30e){_0x93d9c=_0x93d9c-0x0;var _0x5713a8=_0xd2ea[_0x93d9c];return _0x5713a8;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 497dc74..3180c2a 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 _0x39e6=['/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','removeTags','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x39e6,0x9e));var _0x639e=function(_0x22fe2b,_0x51b858){_0x22fe2b=_0x22fe2b-0x0;var _0x3a3413=_0x39e6[_0x22fe2b];return _0x3a3413;};'use strict';var multer=require(_0x639e('0x0'));var util=require('util');var path=require(_0x639e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x639e('0x2')]();var fs_extra=require(_0x639e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x639e('0x4'));var config=require(_0x639e('0x5'));var controller=require(_0x639e('0x6'));router[_0x639e('0x7')]('/',auth[_0x639e('0x8')](),controller[_0x639e('0x9')]);router[_0x639e('0x7')](_0x639e('0xa'),auth[_0x639e('0x8')](),controller[_0x639e('0xb')]);router[_0x639e('0x7')](_0x639e('0xc'),auth[_0x639e('0x8')](),controller[_0x639e('0xd')]);router[_0x639e('0x7')](_0x639e('0xe'),auth[_0x639e('0x8')](),controller[_0x639e('0xf')]);router['get']('/:id/download',auth[_0x639e('0x8')](),controller[_0x639e('0x10')]);router[_0x639e('0x11')]('/',auth[_0x639e('0x8')](),controller[_0x639e('0x12')]);router[_0x639e('0x11')](_0x639e('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0x639e('0x11')](_0x639e('0x13'),auth[_0x639e('0x8')](),interaction[_0x639e('0x14')](_0x639e('0x15'),_0x639e('0x16')),controller['addTags']);router[_0x639e('0x17')](_0x639e('0xc'),auth[_0x639e('0x8')](),interaction[_0x639e('0x14')]('whatsapp',_0x639e('0x18')),controller['update']);router[_0x639e('0x19')](_0x639e('0xc'),auth[_0x639e('0x8')](),interaction[_0x639e('0x14')](_0x639e('0x15'),_0x639e('0x1a')),controller['destroy']);router[_0x639e('0x19')](_0x639e('0x13'),auth[_0x639e('0x8')](),controller[_0x639e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x5162=['whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp'];(function(_0x5d6b77,_0x3f9975){var _0x58bd92=function(_0x1c9503){while(--_0x1c9503){_0x5d6b77['push'](_0x5d6b77['shift']());}};_0x58bd92(++_0x3f9975);}(_0x5162,0x103));var _0x2516=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0x5162[_0x521e8d];return _0x518bbd;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['get'](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x2516('0xf')]('/',auth[_0x2516('0x9')](),controller[_0x2516('0x10')]);router[_0x2516('0xf')]('/:id/messages',auth[_0x2516('0x9')](),controller[_0x2516('0x11')]);router[_0x2516('0xf')](_0x2516('0x12'),auth[_0x2516('0x9')](),interaction[_0x2516('0x13')](_0x2516('0x14'),_0x2516('0x15')),controller[_0x2516('0x16')]);router[_0x2516('0x17')](_0x2516('0xb'),auth[_0x2516('0x9')](),interaction[_0x2516('0x13')](_0x2516('0x14'),_0x2516('0x18')),controller['update']);router[_0x2516('0x19')](_0x2516('0xb'),auth[_0x2516('0x9')](),interaction['tracked'](_0x2516('0x14'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x2516('0x19')](_0x2516('0x12'),auth[_0x2516('0x9')](),controller[_0x2516('0x1a')]);module[_0x2516('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index bc8c192..e2c47ba 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 _0x1059=['STRING','out','ENUM','sequelize','moment','BOOLEAN','DATE'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1059,0x176));var _0x9105=function(_0x352db9,_0x555de6){_0x352db9=_0x352db9-0x0;var _0x1bf5e8=_0x1059[_0x352db9];return _0x1bf5e8;};'use strict';var Sequelize=require(_0x9105('0x0'));var moment=require(_0x9105('0x1'));module['exports']={'closed':{'type':Sequelize[_0x9105('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9105('0x3')]},'disposition':{'type':Sequelize[_0x9105('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9105('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9105('0x4')]},'read1stAt':{'type':Sequelize[_0x9105('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9105('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9105('0x6')]('in',_0x9105('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9105('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2bd8=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x47c28c,_0x52f17e){var _0x13c2ec=function(_0xf21752){while(--_0xf21752){_0x47c28c['push'](_0x47c28c['shift']());}};_0x13c2ec(++_0x52f17e);}(_0x2bd8,0x130));var _0x82bd=function(_0x5a8229,_0x435a9f){_0x5a8229=_0x5a8229-0x0;var _0x165ca9=_0x2bd8[_0x5a8229];return _0x165ca9;};'use strict';var Sequelize=require(_0x82bd('0x0'));var moment=require('moment');module[_0x82bd('0x1')]={'closed':{'type':Sequelize[_0x82bd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x82bd('0x3')]},'disposition':{'type':Sequelize[_0x82bd('0x4')]},'secondDisposition':{'type':Sequelize[_0x82bd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x82bd('0x4')]},'note':{'type':Sequelize[_0x82bd('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x82bd('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x82bd('0x5')]('in',_0x82bd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x82bd('0x5')]('in',_0x82bd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x82bd('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 214b185..5c08f3d 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 _0xcf95=['sort','where','filters','pick','select','field','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','tools_tags','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','getFullTextValue','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','isEmpty','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','merge','WhatsappInteraction','a.key','Account.key','Account.mandatoryDisposition','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.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','includeAll','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','removeTags','download','unix','join','root','server','tmp','files','attachments','User','CmContact','firstName','Attachment','direction','secret','WhatsappAccount','Owner','get','Whatsapp','Account','N.A.','createdAt','closed','closedAt','Messages','createReadStream','basename','out','System','lastName','renderFile','views','downloadInteraction.ejs','.pdf','log','unlinkSync','sendStatus','eml-format','rimraf','moment','bluebird','mustache','util','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','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','name','send','map','fullname','TagIds','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x118047,_0x4e310d){var _0x3bcc46=function(_0x1aa84c){while(--_0x1aa84c){_0x118047['push'](_0x118047['shift']());}};_0x3bcc46(++_0x4e310d);}(_0xcf95,0xa1));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5cf9('0x0'));var rimraf=require(_0x5cf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cf9('0x2'));var BPromise=require(_0x5cf9('0x3'));var Mustache=require(_0x5cf9('0x4'));var util=require(_0x5cf9('0x5'));var path=require('path');var sox=require(_0x5cf9('0x6'));var csv=require(_0x5cf9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cf9('0x8'));var squel=require(_0x5cf9('0x9'));var crypto=require('crypto');var jsforce=require(_0x5cf9('0xa'));var deskjs=require(_0x5cf9('0xb'));var toCsv=require(_0x5cf9('0x7'));var querystring=require(_0x5cf9('0xc'));var Papa=require(_0x5cf9('0xd'));var Redis=require(_0x5cf9('0xe'));var authService=require(_0x5cf9('0xf'));var qs=require(_0x5cf9('0x10'));var as=require(_0x5cf9('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x5cf9('0x12'));var logger=require(_0x5cf9('0x13'))(_0x5cf9('0x14'));var utils=require(_0x5cf9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf9('0x16'));var db=require(_0x5cf9('0x17'))['db'];config[_0x5cf9('0x18')]=_[_0x5cf9('0x19')](config[_0x5cf9('0x18')],{'host':_0x5cf9('0x1a'),'port':0x18eb});var socket=require(_0x5cf9('0x1b'))(new Redis(config[_0x5cf9('0x18')]));require('./whatsappInteraction.socket')[_0x5cf9('0x1c')](socket);function respondWithStatusCode(_0x182836,_0x506631){_0x506631=_0x506631||0xcc;return function(_0x576855){if(_0x576855){return _0x182836['sendStatus'](_0x506631);}return _0x182836['status'](_0x506631)[_0x5cf9('0x1d')]();};}function respondWithResult(_0x208884,_0x46ee98){_0x46ee98=_0x46ee98||0xc8;return function(_0x2f4d21){if(_0x2f4d21){return _0x208884['status'](_0x46ee98)[_0x5cf9('0x1e')](_0x2f4d21);}};}function respondWithFilteredResult(_0x314d56,_0x4ef361){return function(_0x48f233){if(_0x48f233){var _0x17e526=typeof _0x4ef361[_0x5cf9('0x1f')]===_0x5cf9('0x20')&&typeof _0x4ef361[_0x5cf9('0x21')]===_0x5cf9('0x20');var _0x55fd3d=_0x48f233['count'];var _0x395320=_0x17e526?0x0:_0x4ef361[_0x5cf9('0x1f')];var _0x1f4da8=_0x17e526?_0x48f233[_0x5cf9('0x22')]:_0x4ef361['offset']+_0x4ef361[_0x5cf9('0x21')];var _0x539add;if(_0x1f4da8>=_0x55fd3d){_0x1f4da8=_0x55fd3d;_0x539add=0xc8;}else{_0x539add=0xce;}_0x314d56[_0x5cf9('0x23')](_0x539add);return _0x314d56[_0x5cf9('0x24')]('Content-Range',_0x395320+'-'+_0x1f4da8+'/'+_0x55fd3d)[_0x5cf9('0x1e')](_0x48f233);}return null;};}function patchUpdates(_0x3f0b8c){return function(_0x599faa){try{jsonpatch[_0x5cf9('0x25')](_0x599faa,_0x3f0b8c,!![]);}catch(_0x2d153e){return BPromise[_0x5cf9('0x26')](_0x2d153e);}return _0x599faa[_0x5cf9('0x27')]();};}function saveUpdates(_0x1b793d,_0x590568){return function(_0x3a3280){if(_0x3a3280){return _0x3a3280[_0x5cf9('0x28')](_0x1b793d)[_0x5cf9('0x29')](function(_0x4de284){return _0x4de284;});}return null;};}function removeEntity(_0x46d31c,_0x5560bd){return function(_0x30b294){if(_0x30b294){return _0x30b294[_0x5cf9('0x2a')]()[_0x5cf9('0x29')](function(){_0x46d31c[_0x5cf9('0x23')](0xcc)[_0x5cf9('0x1d')]();});}};}function handleEntityNotFound(_0x4216eb,_0xac4c7e){return function(_0x2f5871){if(!_0x2f5871){_0x4216eb['sendStatus'](0x194);}return _0x2f5871;};}function handleError(_0x4290de,_0x382c62){_0x382c62=_0x382c62||0x1f4;return function(_0x11a939){logger['error'](_0x11a939['stack']);if(_0x11a939[_0x5cf9('0x2b')]){delete _0x11a939['name'];}_0x4290de[_0x5cf9('0x23')](_0x382c62)[_0x5cf9('0x2c')](_0x11a939);};}function getInteractionUsers(_0x482306,_0x376446){return new BPromise(function(_0x39f222,_0x434eef){try{if(_0x376446[_0x482306['id']]){_0x482306['Users']=_[_0x5cf9('0x2d')](_0x376446[_0x482306['id']],function(_0x1f2d84){return{'id':_0x1f2d84['id'],'fullname':_0x1f2d84[_0x5cf9('0x2e')]};});}}catch(_0x38ac82){_0x434eef(_0x38ac82);}_0x39f222(_0x482306);});}function getInteractionTags(_0x1b64a2,_0x159ff4){return new BPromise(function(_0x586aac,_0x1e24af){try{if(_0x1b64a2[_0x5cf9('0x2f')]){_0x1b64a2['Tags']=[];_0x1b64a2[_0x5cf9('0x2f')]['split'](',')['forEach'](function(_0x494c11){_0x1b64a2['Tags'][_0x5cf9('0x30')](_0x159ff4[_0x494c11]);});}delete _0x1b64a2[_0x5cf9('0x2f')];}catch(_0x20dfb3){_0x1e24af(_0x20dfb3);}_0x586aac(_0x1b64a2);});}function updateWhatsappInteraction(_0x3a6c67,_0x2a2b83,_0x2bfbb6){return new BPromise(function(_0x28b30d,_0x21f205){return getInteractionUsers(_0x3a6c67,_0x2bfbb6)[_0x5cf9('0x29')](function(_0x2f5475){return getInteractionTags(_0x2f5475,_0x2a2b83);})[_0x5cf9('0x29')](function(_0x4a7da6){_0x28b30d(_0x4a7da6);})[_0x5cf9('0x31')](function(_0x1c2d1e){_0x21f205(_0x1c2d1e);});});}exports[_0x5cf9('0x32')]=function(_0x1f8cd8,_0x28f051){var _0x4deb07={},_0x2ba19e={},_0x41d829={'count':0x0,'rows':[]};var _0x2a2a7a=_[_0x5cf9('0x2d')](db['WhatsappInteraction'][_0x5cf9('0x33')],function(_0x517c15){return{'name':_0x517c15[_0x5cf9('0x34')],'type':_0x517c15[_0x5cf9('0x35')][_0x5cf9('0x36')]};});_0x2ba19e[_0x5cf9('0x37')]=_[_0x5cf9('0x2d')](_0x2a2a7a,_0x5cf9('0x2b'));_0x2ba19e[_0x5cf9('0x38')]=_[_0x5cf9('0x39')](_0x1f8cd8['query']);_0x2ba19e['filters']=_['intersection'](_0x2ba19e[_0x5cf9('0x37')],_0x2ba19e[_0x5cf9('0x38')]);_0x4deb07['attributes']=_[_0x5cf9('0x3a')](_0x2ba19e[_0x5cf9('0x37')],qs[_0x5cf9('0x3b')](_0x1f8cd8['query'][_0x5cf9('0x3b')]));_0x4deb07['attributes']=_0x4deb07[_0x5cf9('0x3c')][_0x5cf9('0x3d')]?_0x4deb07[_0x5cf9('0x3c')]:_0x2ba19e[_0x5cf9('0x37')];if(!_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x3e')](_0x5cf9('0x3f'))){_0x4deb07['limit']=qs[_0x5cf9('0x21')](_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x21')]);_0x4deb07[_0x5cf9('0x1f')]=qs[_0x5cf9('0x1f')](_0x1f8cd8['query'][_0x5cf9('0x1f')]);}_0x4deb07[_0x5cf9('0x40')]=qs['sort'](_0x1f8cd8['query'][_0x5cf9('0x41')]);_0x4deb07[_0x5cf9('0x42')]=qs[_0x5cf9('0x43')](_[_0x5cf9('0x44')](_0x1f8cd8[_0x5cf9('0x38')],_0x2ba19e['filters']),_0x2a2a7a);var _0x11c360=[];var _0x4ce975=squel[_0x5cf9('0x45')]()['field']('id')[_0x5cf9('0x46')]('name')[_0x5cf9('0x46')]('color')[_0x5cf9('0x47')]('tools_tags');var _0x175f72=squel[_0x5cf9('0x45')]()[_0x5cf9('0x46')](_0x5cf9('0x48'))[_0x5cf9('0x46')](_0x5cf9('0x49'))[_0x5cf9('0x46')](_0x5cf9('0x4a'))[_0x5cf9('0x47')](_0x5cf9('0x4b'),'ui')[_0x5cf9('0x4c')](_0x5cf9('0x4d'),'u',_0x5cf9('0x4e'));var _0x3c9157=squel['select']()['from'](_0x5cf9('0x4f'),'i')[_0x5cf9('0x4c')](_0x5cf9('0x50'),'c',_0x5cf9('0x51'))[_0x5cf9('0x4c')]('users','o',_0x5cf9('0x52'))['left_join']('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x5cf9('0x4c')]('whatsapp_messages','me',_0x5cf9('0x53'))[_0x5cf9('0x4c')](_0x5cf9('0x54'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x5cf9('0x4c')](_0x5cf9('0x55'),'t','t.id\x20=\x20it.TagId');var _0xd16c12=squel['expr']();var _0x4069fe=[];var _0x524fa1=squel[_0x5cf9('0x56')]();var _0x4e5769;if(_0x1f8cd8['query'][_0x5cf9('0x57')]){_0x4e5769=as['parseSearch'](_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x57')]);var _0x2324ad=_0x4e5769[_0x5cf9('0x58')];for(var _0x487f9b=0x0;_0x487f9b<_0x4e5769['conditions'][_0x5cf9('0x3d')];_0x487f9b++){var _0x14b79e=_0x4e5769[_0x5cf9('0x59')][_0x487f9b];var _0x447571='i';var _0x202de7=_[_0x5cf9('0x5a')](_0x2a2a7a,['name',_0x14b79e[_0x5cf9('0x46')]]);if(!_0x202de7){switch(_0x14b79e['field']){case _0x5cf9('0x5b'):if(_0x14b79e[_0x5cf9('0x5c')]==0x1){_0x3c9157[_0x5cf9('0x5d')]('`'+_0x14b79e['field']+_0x5cf9('0x5e'));}else{_0x3c9157['having']('`'+_0x14b79e['field']+_0x5cf9('0x5f'));}break;case _0x5cf9('0x60'):if(_0x14b79e[_0x5cf9('0x61')]===_0x5cf9('0x62')){if(_0x14b79e[_0x5cf9('0x5c')][_0x5cf9('0x63')]('\x20')[_0x5cf9('0x3d')]>0x1){_0xd16c12[_0x2324ad]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5cf9('0x64')](_0x14b79e[_0x5cf9('0x5c')]),null);}else{var _0x1ecb77='%'+_0x14b79e[_0x5cf9('0x5c')]+'%';_0xd16c12[_0x2324ad]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1ecb77,_0x1ecb77,_0x1ecb77);}}else{_0x202de7=_['find'](_0x2a2a7a,[_0x5cf9('0x2b'),'ContactId']);_0x14b79e[_0x5cf9('0x46')]=_0x5cf9('0x65');_0x16969f=as[_0x5cf9('0x66')](_0x447571,_0x202de7['type'],_0x14b79e);_0xd16c12[_0x2324ad](_0x16969f['text'],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x67')],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x1d')]);}break;case _0x5cf9('0x68'):var _0x5e171e=_0x14b79e[_0x5cf9('0x5c')][_0x5cf9('0x63')](',')[_0x5cf9('0x2d')](function(_0x497b01){return Number(_0x497b01);});_0x5e171e[_0x5cf9('0x69')](function(_0x243cab){_0x524fa1['or'](_0x5cf9('0x6a'),'%,'+_0x243cab+',%');});_0x4069fe=_[_0x5cf9('0x6b')](_0x4069fe,_0x5e171e);break;case'User':if(_0x14b79e[_0x5cf9('0x61')]==='$substring'){_0xd16c12[_0x2324ad](_0x5cf9('0x6c'),'%'+_0x14b79e['value']+'%',null);}else{_0x202de7=_[_0x5cf9('0x5a')](_0x2a2a7a,[_0x5cf9('0x2b'),_0x5cf9('0x6d')]);_0x14b79e[_0x5cf9('0x46')]=_0x5cf9('0x6d');_0x16969f=as[_0x5cf9('0x66')](_0x447571,_0x202de7['type'],_0x14b79e);_0xd16c12[_0x2324ad](_0x16969f['text'],_0x16969f[_0x5cf9('0x5c')]['start'],_0x16969f['value'][_0x5cf9('0x1d')]);}break;case _0x5cf9('0x6e'):_0x16969f=as[_0x5cf9('0x66')]('me',null,_0x14b79e);_0xd16c12[_0x2324ad](_0x16969f[_0x5cf9('0x6f')],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x67')],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x1d')]);break;}}else{var _0x16969f=as[_0x5cf9('0x66')](_0x447571,_0x202de7[_0x5cf9('0x35')],_0x14b79e);_0xd16c12[_0x2324ad](_0x16969f[_0x5cf9('0x6f')],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x67')],_0x16969f[_0x5cf9('0x5c')][_0x5cf9('0x1d')]);}}}else{var _0x304d41=_(_0x1f8cd8['query'])[_0x5cf9('0x39')]()['map'](function(_0x5a01c3){return _['some'](_0x2a2a7a,[_0x5cf9('0x2b'),_0x5a01c3])?_0x5a01c3:undefined;})['compact']()[_0x5cf9('0x5c')]();if(!_[_0x5cf9('0x70')](_0x304d41)){_0x304d41['forEach'](function(_0x424b39){if(_0x424b39==='WhatsappAccountId'){_0x3c9157[_0x5cf9('0x42')]('i.WhatsappAccountId\x20IN\x20?',[][_0x5cf9('0x71')](_0x1f8cd8[_0x5cf9('0x38')][_0x424b39]));}else if(_0x424b39==='createdAt'){var _0x21eaf8=JSON[_0x5cf9('0x72')](_0x1f8cd8['query'][_0x424b39])[_0x5cf9('0x73')];var _0x1a8d63=JSON[_0x5cf9('0x72')](_0x1f8cd8[_0x5cf9('0x38')][_0x424b39])[_0x5cf9('0x74')];_0x3c9157[_0x5cf9('0x42')](_0x5cf9('0x75'),_0x21eaf8,_0x1a8d63);}else{if(_0x1f8cd8[_0x5cf9('0x38')][_0x424b39]==='null'){_0x3c9157['where']('i.'+_0x424b39+_0x5cf9('0x76'));}else{_0x3c9157[_0x5cf9('0x42')]('i.'+_0x424b39+'\x20=\x20?',_0x1f8cd8[_0x5cf9('0x38')][_0x424b39]);}}});}if(_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x77')]){if(_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x77')]==0x1){_0x3c9157[_0x5cf9('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x3c9157[_0x5cf9('0x5d')](_0x5cf9('0x78'));}}if(_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x79')]){_0x4069fe=_[_0x5cf9('0x7a')](_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x79')])?_0x1f8cd8['query']['tag']:new Array(_0x1f8cd8[_0x5cf9('0x38')]['tag']);_0x4069fe[_0x5cf9('0x69')](function(_0x6215db){_0x524fa1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x6215db+',%');});}if(_0x1f8cd8[_0x5cf9('0x38')][_0x5cf9('0x7b')]){var _0x31c02a=_0x1f8cd8[_0x5cf9('0x38')]['filter'][_0x5cf9('0x7c')]('\x5c','\x5c\x5c')[_0x5cf9('0x7c')](/'/g,'\x27\x27');if(qs[_0x5cf9('0x7d')](_0x31c02a)){_0xd16c12['or'](_0x5cf9('0x7e'),_0x31c02a+'%')['or']('i.phone\x20LIKE\x20?',_0x31c02a+'%');}else{_0xd16c12['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x31c02a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x31c02a+'%');}}}_0x3c9157[_0x5cf9('0x42')](_0xd16c12);_0x3c9157[_0x5cf9('0x7f')](_0x5cf9('0x80'));var _0x4648ff={'type':db[_0x5cf9('0x81')][_0x5cf9('0x82')][_0x5cf9('0x83')],'raw':!![]};var _0x4be77c=_0x3c9157[_0x5cf9('0x84')]();_0x4be77c[_0x5cf9('0x46')](_0x5cf9('0x80'));_0x4be77c[_0x5cf9('0x46')](_0x5cf9('0x85'),_0x5cf9('0x5b'));if(_0x4deb07['order']){_0x4deb07[_0x5cf9('0x40')][_0x5cf9('0x69')](function(_0xb9afcd){var _0x1b6ef9=_0xb9afcd[0x0]===_0x5cf9('0x86')?_0xb9afcd[0x0]:'i.'+_0xb9afcd[0x0];_0x3c9157[_0x5cf9('0x40')](_0x1b6ef9,_0xb9afcd[0x1]===_0x5cf9('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x4069fe)){_0x3c9157[_0x5cf9('0x5d')](_0x524fa1);_0x4be77c['where'](_0x5cf9('0x88'),_0x4069fe);}BPromise[_0x5cf9('0x89')]()[_0x5cf9('0x29')](function(){if(!_0x4e5769){if(_0x1f8cd8[_0x5cf9('0x38')]['WhatsappAccountId'])return;_0x4be77c[_0x5cf9('0x42')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x3c9157['where'](_0x5cf9('0x8a'));return;}if(_0x1f8cd8[_0x5cf9('0x8b')][_0x5cf9('0x8c')]!==_0x5cf9('0x8d'))return;return _0x1f8cd8[_0x5cf9('0x8b')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ced81){if(_[_0x5cf9('0x70')](_0x1ced81)){_0x4be77c[_0x5cf9('0x42')]('i.WhatsappAccountId\x20IS\x20NULL');_0x3c9157['where'](_0x5cf9('0x8e'));}else{_0x4be77c[_0x5cf9('0x42')](_0x5cf9('0x8f'),_[_0x5cf9('0x2d')](_0x1ced81,'id'));_0x3c9157[_0x5cf9('0x42')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x1ced81,'id'));}});})[_0x5cf9('0x29')](function(){if(_0x1f8cd8[_0x5cf9('0x8b')][_0x5cf9('0x8c')]==='agent'&&!_0x4e5769&&!_0x1f8cd8[_0x5cf9('0x38')]['WhatsappAccountId'])return[];return db[_0x5cf9('0x90')][_0x5cf9('0x38')](_0x4be77c[_0x5cf9('0x91')](),_0x4648ff);})[_0x5cf9('0x29')](function(_0x59e599){_0x41d829['count']=_0x59e599[_0x5cf9('0x3d')];if(_0x41d829[_0x5cf9('0x22')]===0x0)return[];return db[_0x5cf9('0x90')][_0x5cf9('0x38')](_0x4ce975['toString'](),_0x4648ff)[_0x5cf9('0x29')](function(_0x1ff699){_0x11c360=_['keyBy'](_0x1ff699,'id');_0x4648ff=_[_0x5cf9('0x92')](_0x4648ff,{'model':db[_0x5cf9('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1f8cd8[_0x5cf9('0x38')]['fields']){_0x4deb07[_0x5cf9('0x3c')][_0x5cf9('0x69')](function(_0x580023){_0x3c9157[_0x5cf9('0x46')]('i.'+_0x580023);});}else{_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x85'),_0x5cf9('0x5b'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x94'),_0x5cf9('0x95'));_0x3c9157[_0x5cf9('0x46')]('a.mandatoryDisposition',_0x5cf9('0x96'));_0x3c9157[_0x5cf9('0x46')]('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',_0x5cf9('0x86'));_0x3c9157[_0x5cf9('0x46')]('i.*');_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x97'),_0x5cf9('0x98'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x99'),_0x5cf9('0x9a'));_0x3c9157['field'](_0x5cf9('0x9b'),_0x5cf9('0x9c'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x9d'),_0x5cf9('0x9e'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0x9f'),_0x5cf9('0xa0'));_0x3c9157['field'](_0x5cf9('0xa1'),_0x5cf9('0xa2'));_0x3c9157[_0x5cf9('0x46')]('o.fullname',_0x5cf9('0xa3'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0xa4'),_0x5cf9('0xa5'));_0x3c9157[_0x5cf9('0x46')](_0x5cf9('0xa6'),_0x5cf9('0x2f'));}if(_0x4deb07[_0x5cf9('0x21')])_0x3c9157[_0x5cf9('0x21')](_0x4deb07[_0x5cf9('0x21')]);if(_0x4deb07[_0x5cf9('0x1f')])_0x3c9157[_0x5cf9('0x1f')](_0x4deb07[_0x5cf9('0x1f')]);return db[_0x5cf9('0x90')][_0x5cf9('0x38')](_0x3c9157[_0x5cf9('0x91')](),_0x4648ff);})['then'](function(_0x12b5e1){if(_0x12b5e1[_0x5cf9('0x3d')]>0x0)_0x175f72[_0x5cf9('0x42')](_0x5cf9('0xa7'),_[_0x5cf9('0x2d')](_0x12b5e1,'id'));return db['sequelize']['query'](_0x175f72[_0x5cf9('0x91')](),_0x4648ff)['then'](function(_0x318f8e){var _0x22ee10=_[_0x5cf9('0xa8')](_0x318f8e,_0x5cf9('0xa9'));var _0x44b877=[];_0x12b5e1['forEach'](function(_0x4c4b76){_0x44b877['push'](updateWhatsappInteraction(_0x4c4b76,_0x11c360,_0x22ee10));});return BPromise[_0x5cf9('0xaa')](_0x44b877);});});})[_0x5cf9('0x29')](function(_0x56c27d){_0x41d829[_0x5cf9('0xab')]=_0x56c27d;return _0x41d829;})[_0x5cf9('0x29')](respondWithFilteredResult(_0x28f051,_0x4deb07))[_0x5cf9('0x31')](handleError(_0x28f051,null));};exports['show']=function(_0x7c44a4,_0x30cefc){var _0x1240ec={'raw':![],'where':{'id':_0x7c44a4[_0x5cf9('0xac')]['id']}},_0x309cea={};_0x309cea[_0x5cf9('0x37')]=_[_0x5cf9('0x39')](db[_0x5cf9('0x93')][_0x5cf9('0x33')]);_0x309cea[_0x5cf9('0x38')]=_[_0x5cf9('0x39')](_0x7c44a4['query']);_0x309cea[_0x5cf9('0x43')]=_[_0x5cf9('0x3a')](_0x309cea[_0x5cf9('0x37')],_0x309cea[_0x5cf9('0x38')]);_0x1240ec['attributes']=_[_0x5cf9('0x3a')](_0x309cea[_0x5cf9('0x37')],qs[_0x5cf9('0x3b')](_0x7c44a4[_0x5cf9('0x38')]['fields']));_0x1240ec[_0x5cf9('0x3c')]=_0x1240ec['attributes'][_0x5cf9('0x3d')]?_0x1240ec[_0x5cf9('0x3c')]:_0x309cea['model'];if(_0x7c44a4[_0x5cf9('0x38')][_0x5cf9('0xad')]){_0x1240ec['include']=[{'all':!![]}];}_0x1240ec=_[_0x5cf9('0x92')]({},_0x1240ec,_0x7c44a4[_0x5cf9('0xae')]);return db[_0x5cf9('0x93')]['find'](_0x1240ec)['then'](handleEntityNotFound(_0x30cefc,null))[_0x5cf9('0x29')](respondWithResult(_0x30cefc,null))['catch'](handleError(_0x30cefc,null));};exports[_0x5cf9('0xaf')]=function(_0x3fc9b1,_0x40eac6){return db[_0x5cf9('0x93')][_0x5cf9('0xaf')](_0x3fc9b1[_0x5cf9('0x6e')],{})[_0x5cf9('0x29')](respondWithResult(_0x40eac6,0xc9))[_0x5cf9('0x31')](handleError(_0x40eac6,null));};exports[_0x5cf9('0x28')]=function(_0x2b90c4,_0x3f8d93){if(_0x2b90c4[_0x5cf9('0x6e')]['id']){delete _0x2b90c4[_0x5cf9('0x6e')]['id'];}return db[_0x5cf9('0x93')][_0x5cf9('0x5a')]({'where':{'id':_0x2b90c4['params']['id']}})[_0x5cf9('0x29')](handleEntityNotFound(_0x3f8d93,null))[_0x5cf9('0x29')](saveUpdates(_0x2b90c4[_0x5cf9('0x6e')],null))[_0x5cf9('0x29')](respondWithResult(_0x3f8d93,null))[_0x5cf9('0x31')](handleError(_0x3f8d93,null));};exports['destroy']=function(_0x13f824,_0x1f0b5c){return db[_0x5cf9('0x93')][_0x5cf9('0x5a')]({'where':{'id':_0x13f824[_0x5cf9('0xac')]['id']}})['then'](handleEntityNotFound(_0x1f0b5c,null))[_0x5cf9('0x29')](removeEntity(_0x1f0b5c,null))[_0x5cf9('0x31')](handleError(_0x1f0b5c,null));};exports[_0x5cf9('0xb0')]=function(_0x458a9d,_0x529675){return db[_0x5cf9('0x93')][_0x5cf9('0xb0')]()[_0x5cf9('0x29')](respondWithResult(_0x529675,null))[_0x5cf9('0x31')](handleError(_0x529675,null));};exports[_0x5cf9('0xb1')]=function(_0x4cc1fd,_0x27db7a,_0x5b05ed){return db[_0x5cf9('0xb2')][_0x5cf9('0x5a')]({'where':{'id':_0x4cc1fd[_0x5cf9('0xac')]['id']}})['then'](handleEntityNotFound(_0x27db7a,null))['then'](function(_0xaafb0e){if(_0xaafb0e){return _0xaafb0e[_0x5cf9('0xb1')](_0x4cc1fd['body'][_0x5cf9('0xb3')],_[_0x5cf9('0xb4')](_0x4cc1fd[_0x5cf9('0x6e')],[_0x5cf9('0xb3'),'id'])||{});}})[_0x5cf9('0x29')](respondWithResult(_0x27db7a,null))[_0x5cf9('0x31')](handleError(_0x27db7a,null));};exports[_0x5cf9('0xb5')]=function(_0x287cdc,_0x4d9277,_0xa134c2){var _0x408f34={'raw':![],'where':{}};var _0x444d8b={};var _0x271d96={'count':0x0,'rows':[]};return db[_0x5cf9('0x93')]['findOne']({'where':{'id':_0x287cdc[_0x5cf9('0xac')]['id']}})['then'](handleEntityNotFound(_0x4d9277,null))[_0x5cf9('0x29')](function(_0x1cf05f){if(_0x1cf05f){_0x444d8b[_0x5cf9('0x37')]=_[_0x5cf9('0x39')](db[_0x5cf9('0xb2')][_0x5cf9('0x33')]);_0x444d8b[_0x5cf9('0x38')]=_['keys'](_0x287cdc[_0x5cf9('0x38')]);_0x444d8b[_0x5cf9('0x43')]=_[_0x5cf9('0x3a')](_0x444d8b['model'],_0x444d8b[_0x5cf9('0x38')]);_0x408f34[_0x5cf9('0x3c')]=_[_0x5cf9('0x3a')](_0x444d8b['model'],qs['fields'](_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0x3b')]));_0x408f34[_0x5cf9('0x3c')]=_0x408f34[_0x5cf9('0x3c')][_0x5cf9('0x3d')]?_0x408f34['attributes']:_0x444d8b[_0x5cf9('0x37')];if(!_0x287cdc[_0x5cf9('0x38')]['hasOwnProperty'](_0x5cf9('0x3f'))){_0x408f34[_0x5cf9('0x21')]=qs[_0x5cf9('0x21')](_0x287cdc['query'][_0x5cf9('0x21')]);_0x408f34[_0x5cf9('0x1f')]=qs[_0x5cf9('0x1f')](_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0x1f')]);}_0x408f34['order']=qs[_0x5cf9('0x41')](_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0x41')]);_0x408f34['where']=qs['filters'](_[_0x5cf9('0x44')](_0x287cdc[_0x5cf9('0x38')],_0x444d8b[_0x5cf9('0x43')]));_0x408f34[_0x5cf9('0x42')][_0x5cf9('0xa9')]=_0x1cf05f['id'];if(_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0x7b')]){_0x408f34[_0x5cf9('0x42')]=_['merge'](_0x408f34[_0x5cf9('0x42')],{'$or':_[_0x5cf9('0x2d')](_0x408f34[_0x5cf9('0x3c')],function(_0x3b77ee){var _0x47ae4b={};_0x47ae4b[_0x3b77ee]={'$like':'%'+_0x287cdc[_0x5cf9('0x38')]['filter']+'%'};return _0x47ae4b;})});}if(_0x287cdc['query'][_0x5cf9('0x73')]){var _0x587a16=_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0x73')]['split'](',');var _0x4151c8={};_0x4151c8[_0x587a16[0x0]]={'$gte':moment(_0x587a16[0x1])[_0x5cf9('0xb6')](_0x5cf9('0xb7'))};_0x408f34[_0x5cf9('0x42')]=_[_0x5cf9('0x92')](_0x408f34[_0x5cf9('0x42')],_0x4151c8);}_0x408f34=_['merge']({},_0x408f34,_0x287cdc['options']);return db[_0x5cf9('0xb2')][_0x5cf9('0x22')]({'where':_0x408f34[_0x5cf9('0x42')]})[_0x5cf9('0x29')](function(_0x2b7239){_0x271d96[_0x5cf9('0x22')]=_0x2b7239;if(_0x287cdc[_0x5cf9('0x38')][_0x5cf9('0xad')]){_0x408f34[_0x5cf9('0xb8')]=[{'all':!![]}];}return db[_0x5cf9('0xb2')][_0x5cf9('0xb9')](_0x408f34);})[_0x5cf9('0x29')](function(_0x5b14f1){_0x271d96['rows']=_0x5b14f1;return _0x271d96;});}})[_0x5cf9('0x29')](respondWithFilteredResult(_0x4d9277,_0x408f34))[_0x5cf9('0x31')](handleError(_0x4d9277,null));};exports[_0x5cf9('0xba')]=function(_0xb2a114,_0x29ced2,_0x45a8b3){return db[_0x5cf9('0x93')][_0x5cf9('0x5a')]({'where':{'id':_0xb2a114[_0x5cf9('0xac')]['id']}})['then'](handleEntityNotFound(_0x29ced2,null))[_0x5cf9('0x29')](function(_0x2fe1bf){if(_0x2fe1bf){return _0x2fe1bf[_0x5cf9('0xbb')](_0xb2a114[_0x5cf9('0x6e')][_0x5cf9('0xb3')],_['omit'](_0xb2a114[_0x5cf9('0x6e')],[_0x5cf9('0xb3'),'id'])||{})[_0x5cf9('0xbc')](function(){return db[_0x5cf9('0x68')]['findAll']({'attributes':['id',_0x5cf9('0x2b'),'color'],'where':{'id':_0xb2a114[_0x5cf9('0x6e')][_0x5cf9('0xb3')]}});})['then'](function(_0x5150f7){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0xb2a114[_0x5cf9('0xac')]['id']),'tags':_0x5150f7||[]});return{'id':Number(_0xb2a114[_0x5cf9('0xac')]['id']),'tags':_0x5150f7||[]};});}})['then'](respondWithResult(_0x29ced2,null))['catch'](handleError(_0x29ced2,null));};exports[_0x5cf9('0xbd')]=function(_0x2593b5,_0x11f63a,_0x1abc8f){return db['WhatsappInteraction']['find']({'where':{'id':_0x2593b5['params']['id']}})[_0x5cf9('0x29')](handleEntityNotFound(_0x11f63a,null))['then'](function(_0x5260a5){if(_0x5260a5){return _0x5260a5[_0x5cf9('0xbd')](_0x2593b5[_0x5cf9('0x38')][_0x5cf9('0xb3')]);}})[_0x5cf9('0x29')](respondWithStatusCode(_0x11f63a,null))[_0x5cf9('0x31')](handleError(_0x11f63a,null));};exports[_0x5cf9('0xbe')]=function(_0xc2a39e,_0x3c35be){var _0x522695=moment()[_0x5cf9('0xbf')]()[_0x5cf9('0x91')]();var _0xe02b=path[_0x5cf9('0xc0')](config[_0x5cf9('0xc1')],_0x5cf9('0xc2'),'files',_0x5cf9('0xc3'));var _0x4c20fd=path['join'](config[_0x5cf9('0xc1')],_0x5cf9('0xc2'),_0x5cf9('0xc4'),_0x5cf9('0xc5'));var _0x2b530c=path['join'](_0xe02b,_0x522695);var _0x4cb837=util[_0x5cf9('0xb6')]('transcript-%d-%s.zip',_0xc2a39e[_0x5cf9('0xac')]['id'],_0x522695);var _0x1432b6=path[_0x5cf9('0xc0')](_0xe02b,_0x4cb837);var _0x37c2cf=[];_0x37c2cf[_0x5cf9('0x30')]({'model':db[_0x5cf9('0xc6')],'as':'User','attributes':['id',_0x5cf9('0x2e')],'raw':!![]});_0x37c2cf['push']({'model':db[_0x5cf9('0xc7')],'as':_0x5cf9('0x60'),'attributes':['id',_0x5cf9('0xc8'),'lastName'],'raw':!![]});if(_0xc2a39e[_0x5cf9('0x38')][_0x5cf9('0xc5')]){_0x37c2cf[_0x5cf9('0x30')]({'model':db[_0x5cf9('0xc9')],'as':_0x5cf9('0xc9'),'raw':!![]});}var _0x1834fe=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x5cf9('0x6e'),'createdAt',_0x5cf9('0xca'),_0x5cf9('0xcb'),_0x5cf9('0x77')],'include':_0x37c2cf}];_0x1834fe[_0x5cf9('0x30')]({'model':db[_0x5cf9('0xcc')],'as':'Account','attributes':['id','name']});_0x1834fe[_0x5cf9('0x30')]({'model':db[_0x5cf9('0xc6')],'as':_0x5cf9('0xcd'),'attributes':['id','fullname']});return db[_0x5cf9('0x93')][_0x5cf9('0x5a')]({'where':{'id':_0xc2a39e['params']['id']},'include':_0x1834fe})[_0x5cf9('0x29')](handleEntityNotFound(_0x3c35be,null))[_0x5cf9('0x29')](function(_0x256037){if(_0x256037){var _0x5391ee=_0x256037[_0x5cf9('0xce')]({'plain':!![]});fs['mkdirSync'](_0x2b530c);var _0x1b97f9={'channel':_0x5cf9('0xcf'),'account':_0x5391ee[_0x5cf9('0xd0')][_0x5cf9('0x2b')],'agent':_0x5391ee[_0x5cf9('0xcd')]?_0x5391ee['Owner'][_0x5cf9('0x2e')]:_0x5cf9('0xd1'),'createdAt':moment(_0x5391ee[_0x5cf9('0xd2')])[_0x5cf9('0xb6')](_0x5cf9('0xb7'))[_0x5cf9('0x91')](),'closedAt':_0x5391ee[_0x5cf9('0xd3')]?moment(_0x5391ee[_0x5cf9('0xd4')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5cf9('0x91')]():'','disposition':_0x5391ee['disposition'],'messages':_(_0x5391ee[_0x5cf9('0xd5')])[_0x5cf9('0x7b')]({'secret':![]})[_0x5cf9('0x2d')](function(_0x434b9a){if(_0x434b9a[_0x5cf9('0xc9')]){var _0xf6d803=path[_0x5cf9('0xc0')](_0x4c20fd,_0x434b9a['Attachment']['basename']);if(fs['existsSync'](_0xf6d803)){fs[_0x5cf9('0xd6')](_0xf6d803)['pipe'](fs['createWriteStream'](path['join'](_0x2b530c,_0x434b9a[_0x5cf9('0xc9')][_0x5cf9('0xd7')])));}}return{'date':moment(_0x434b9a['createdAt'])[_0x5cf9('0xb6')](_0x5cf9('0xb7'))['toString'](),'sender':_0x434b9a['direction']===_0x5cf9('0xd8')?_0x434b9a[_0x5cf9('0xc6')]?_0x434b9a['User'][_0x5cf9('0x2e')]:_0x5cf9('0xd9'):_0x434b9a['Contact'][_0x5cf9('0xc8')]+(_0x434b9a['Contact'][_0x5cf9('0xda')]?'\x20'+_0x434b9a[_0x5cf9('0x60')][_0x5cf9('0xda')]:''),'body':_0x434b9a['Attachment']?_0x434b9a[_0x5cf9('0xc9')][_0x5cf9('0xd7')]:_0x434b9a['body'],'direction':_0x434b9a[_0x5cf9('0xca')]===_0x5cf9('0xd8')?'A':'C','secret':_0x434b9a[_0x5cf9('0xcb')],'read':_0x434b9a[_0x5cf9('0x77')],'attachment':_0x434b9a[_0x5cf9('0xc9')]};})[_0x5cf9('0x5c')]()};return ejs[_0x5cf9('0xdb')](path[_0x5cf9('0xc0')](config[_0x5cf9('0xc1')],_0x5cf9('0xc2'),_0x5cf9('0xdc'),_0x5cf9('0xdd')),{'interaction':_0x1b97f9})[_0x5cf9('0x29')](function(_0x5cf168){var _0x38a2c7=path[_0x5cf9('0xc0')](_0x2b530c,'transcript-'+_0x5391ee['id']+'-'+_0x522695+_0x5cf9('0xde'));var _0xd646fb={'path':_0x38a2c7,'channel':_0x5cf9('0xcf'),'interactionId':_0x5391ee['id']};return pdf['createPdfFromHTML'](_0x5cf168,_0xd646fb);})[_0x5cf9('0x29')](function(){return new BPromise(function(_0x3bade4,_0x42ebc1){zipdir(_0x2b530c,{'saveTo':_0x1432b6},function(_0x32facc,_0x29307e){if(_0x32facc)return _0x42ebc1(_0x32facc);return _0x3bade4(_0x29307e);});})[_0x5cf9('0x29')](function(){return new BPromise(function(_0x235baf,_0x4e6e54){rimraf(_0x2b530c,function(_0x51c3ce){if(_0x51c3ce)_0x4e6e54(_0x51c3ce);return _0x235baf();});});})[_0x5cf9('0x29')](function(){return _0x3c35be[_0x5cf9('0xbe')](_0x1432b6,_0x4cb837,function(_0x2c293f){if(_0x2c293f){console[_0x5cf9('0xdf')]('err',_0x2c293f);}else{fs[_0x5cf9('0xe0')](_0x1432b6);}});});});}else{return _0x3c35be[_0x5cf9('0xe1')](0xc8);}})[_0x5cf9('0x31')](handleError(_0x3c35be,null));}; \ No newline at end of file +var _0x1280=['catch','index','WhatsappInteraction','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','select','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','left_join','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','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','Sequelize','QueryTypes','SELECT','i.id','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','toString','sequelize','keyBy','merge','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','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','findOne','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','root','server','files','tmp','join','transcript-%d-%s.zip','User','Contact','firstName','lastName','Attachment','Messages','direction','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x1280,0xba));var _0x0128=function(_0x215393,_0x4c406d){_0x215393=_0x215393-0x0;var _0x595198=_0x1280[_0x215393];return _0x595198;};'use strict';var emlformat=require(_0x0128('0x0'));var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require(_0x0128('0x7'));var util=require(_0x0128('0x8'));var path=require('path');var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0128('0xb'));var squel=require(_0x0128('0xc'));var crypto=require(_0x0128('0xd'));var jsforce=require(_0x0128('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x0128('0x14'));var logger=require(_0x0128('0x15'))(_0x0128('0x16'));var utils=require(_0x0128('0x17'));var config=require(_0x0128('0x18'));var licenseUtil=require(_0x0128('0x19'));var db=require(_0x0128('0x1a'))['db'];config[_0x0128('0x1b')]=_['defaults'](config[_0x0128('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0128('0x1b')]));require(_0x0128('0x1c'))[_0x0128('0x1d')](socket);function respondWithStatusCode(_0x2a954f,_0x43539a){_0x43539a=_0x43539a||0xcc;return function(_0x4fd99f){if(_0x4fd99f){return _0x2a954f[_0x0128('0x1e')](_0x43539a);}return _0x2a954f[_0x0128('0x1f')](_0x43539a)[_0x0128('0x20')]();};}function respondWithResult(_0x5098cd,_0x5d1efd){_0x5d1efd=_0x5d1efd||0xc8;return function(_0x542bc4){if(_0x542bc4){return _0x5098cd[_0x0128('0x1f')](_0x5d1efd)[_0x0128('0x21')](_0x542bc4);}};}function respondWithFilteredResult(_0xc78193,_0x179a99){return function(_0x5a2147){if(_0x5a2147){var _0x50a307=typeof _0x179a99[_0x0128('0x22')]===_0x0128('0x23')&&typeof _0x179a99[_0x0128('0x24')]===_0x0128('0x23');var _0x521871=_0x5a2147['count'];var _0xc3a962=_0x50a307?0x0:_0x179a99[_0x0128('0x22')];var _0x283ca2=_0x50a307?_0x5a2147[_0x0128('0x25')]:_0x179a99[_0x0128('0x22')]+_0x179a99['limit'];var _0x4580fe;if(_0x283ca2>=_0x521871){_0x283ca2=_0x521871;_0x4580fe=0xc8;}else{_0x4580fe=0xce;}_0xc78193[_0x0128('0x1f')](_0x4580fe);return _0xc78193[_0x0128('0x26')](_0x0128('0x27'),_0xc3a962+'-'+_0x283ca2+'/'+_0x521871)[_0x0128('0x21')](_0x5a2147);}return null;};}function patchUpdates(_0x333f54){return function(_0x3ef695){try{jsonpatch[_0x0128('0x28')](_0x3ef695,_0x333f54,!![]);}catch(_0x22583c){return BPromise['reject'](_0x22583c);}return _0x3ef695[_0x0128('0x29')]();};}function saveUpdates(_0x4b8ca5,_0x1f6ee0){return function(_0x5b617d){if(_0x5b617d){return _0x5b617d[_0x0128('0x2a')](_0x4b8ca5)[_0x0128('0x2b')](function(_0x3ad8a9){return _0x3ad8a9;});}return null;};}function removeEntity(_0x132fa2,_0x2411c2){return function(_0x13c5ff){if(_0x13c5ff){return _0x13c5ff[_0x0128('0x2c')]()[_0x0128('0x2b')](function(){_0x132fa2[_0x0128('0x1f')](0xcc)[_0x0128('0x20')]();});}};}function handleEntityNotFound(_0x19fbce,_0x3a6161){return function(_0x4a5594){if(!_0x4a5594){_0x19fbce[_0x0128('0x1e')](0x194);}return _0x4a5594;};}function handleError(_0x2cbfe6,_0x197580){_0x197580=_0x197580||0x1f4;return function(_0x11f7c5){logger['error'](_0x11f7c5[_0x0128('0x2d')]);if(_0x11f7c5['name']){delete _0x11f7c5[_0x0128('0x2e')];}_0x2cbfe6[_0x0128('0x1f')](_0x197580)[_0x0128('0x2f')](_0x11f7c5);};}function getInteractionUsers(_0x64efc0,_0x35be49){return new BPromise(function(_0x3dde36,_0x120b50){try{if(_0x35be49[_0x64efc0['id']]){_0x64efc0[_0x0128('0x30')]=_['map'](_0x35be49[_0x64efc0['id']],function(_0x2f6e24){return{'id':_0x2f6e24['id'],'fullname':_0x2f6e24[_0x0128('0x31')]};});}}catch(_0x40c619){_0x120b50(_0x40c619);}_0x3dde36(_0x64efc0);});}function getInteractionTags(_0xf72861,_0x5874b8){return new BPromise(function(_0x5f0a77,_0x3cac0e){try{if(_0xf72861[_0x0128('0x32')]){_0xf72861[_0x0128('0x33')]=[];_0xf72861[_0x0128('0x32')][_0x0128('0x34')](',')[_0x0128('0x35')](function(_0x21dde4){_0xf72861[_0x0128('0x33')][_0x0128('0x36')](_0x5874b8[_0x21dde4]);});}delete _0xf72861[_0x0128('0x32')];}catch(_0x3c7e7d){_0x3cac0e(_0x3c7e7d);}_0x5f0a77(_0xf72861);});}function updateWhatsappInteraction(_0x19dc91,_0x10d33c,_0x39d00f){return new BPromise(function(_0x5952bf,_0x7f5c40){return getInteractionUsers(_0x19dc91,_0x39d00f)[_0x0128('0x2b')](function(_0x3cb924){return getInteractionTags(_0x3cb924,_0x10d33c);})[_0x0128('0x2b')](function(_0xc2fe47){_0x5952bf(_0xc2fe47);})[_0x0128('0x37')](function(_0x152321){_0x7f5c40(_0x152321);});});}exports[_0x0128('0x38')]=function(_0x319cd7,_0x28f3f2){var _0x1d3235={},_0xa94d51={},_0x3d8055={'count':0x0,'rows':[]};var _0x124423=_['map'](db[_0x0128('0x39')][_0x0128('0x3a')],function(_0x9af75c){return{'name':_0x9af75c[_0x0128('0x3b')],'type':_0x9af75c['type'][_0x0128('0x3c')]};});_0xa94d51[_0x0128('0x3d')]=_[_0x0128('0x3e')](_0x124423,_0x0128('0x2e'));_0xa94d51[_0x0128('0x3f')]=_[_0x0128('0x40')](_0x319cd7[_0x0128('0x3f')]);_0xa94d51[_0x0128('0x41')]=_[_0x0128('0x42')](_0xa94d51[_0x0128('0x3d')],_0xa94d51[_0x0128('0x3f')]);_0x1d3235[_0x0128('0x43')]=_['intersection'](_0xa94d51[_0x0128('0x3d')],qs[_0x0128('0x44')](_0x319cd7[_0x0128('0x3f')][_0x0128('0x44')]));_0x1d3235[_0x0128('0x43')]=_0x1d3235[_0x0128('0x43')]['length']?_0x1d3235['attributes']:_0xa94d51[_0x0128('0x3d')];if(!_0x319cd7[_0x0128('0x3f')][_0x0128('0x45')](_0x0128('0x46'))){_0x1d3235[_0x0128('0x24')]=qs['limit'](_0x319cd7[_0x0128('0x3f')][_0x0128('0x24')]);_0x1d3235[_0x0128('0x22')]=qs['offset'](_0x319cd7[_0x0128('0x3f')][_0x0128('0x22')]);}_0x1d3235[_0x0128('0x47')]=qs[_0x0128('0x48')](_0x319cd7[_0x0128('0x3f')][_0x0128('0x48')]);_0x1d3235['where']=qs[_0x0128('0x41')](_[_0x0128('0x49')](_0x319cd7['query'],_0xa94d51[_0x0128('0x41')]),_0x124423);var _0x529020=[];var _0x360df0=squel['select']()[_0x0128('0x4a')]('id')[_0x0128('0x4a')](_0x0128('0x2e'))['field'](_0x0128('0x4b'))[_0x0128('0x4c')]('tools_tags');var _0xf3af35=squel[_0x0128('0x4d')]()[_0x0128('0x4a')](_0x0128('0x4e'))[_0x0128('0x4a')](_0x0128('0x4f'))[_0x0128('0x4a')](_0x0128('0x50'))['from']('user_has_whatsapp_interactions','ui')['left_join'](_0x0128('0x51'),'u',_0x0128('0x52'));var _0x2b00cc=squel[_0x0128('0x4d')]()[_0x0128('0x4c')]('whatsapp_interactions','i')[_0x0128('0x53')]('cm_contacts','c',_0x0128('0x54'))[_0x0128('0x53')](_0x0128('0x51'),'o',_0x0128('0x55'))[_0x0128('0x53')](_0x0128('0x56'),'a',_0x0128('0x57'))[_0x0128('0x53')](_0x0128('0x58'),'me',_0x0128('0x59'))['left_join'](_0x0128('0x5a'),'it',_0x0128('0x5b'))[_0x0128('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x191c89=squel[_0x0128('0x5c')]();var _0x32e745=[];var _0xdf6f51=squel[_0x0128('0x5c')]();var _0x31fd8f;if(_0x319cd7[_0x0128('0x3f')][_0x0128('0x5d')]){_0x31fd8f=as[_0x0128('0x5e')](_0x319cd7[_0x0128('0x3f')]['search']);var _0x301368=_0x31fd8f[_0x0128('0x5f')];for(var _0x492f03=0x0;_0x492f03<_0x31fd8f[_0x0128('0x60')][_0x0128('0x61')];_0x492f03++){var _0x23c21f=_0x31fd8f[_0x0128('0x60')][_0x492f03];var _0x47023d='i';var _0x36c501=_['find'](_0x124423,['name',_0x23c21f[_0x0128('0x4a')]]);if(!_0x36c501){switch(_0x23c21f[_0x0128('0x4a')]){case _0x0128('0x62'):if(_0x23c21f[_0x0128('0x63')]==0x1){_0x2b00cc[_0x0128('0x64')]('`'+_0x23c21f['field']+_0x0128('0x65'));}else{_0x2b00cc[_0x0128('0x64')]('`'+_0x23c21f['field']+_0x0128('0x66'));}break;case'Contact':if(_0x23c21f[_0x0128('0x67')]==='$substring'){if(_0x23c21f[_0x0128('0x63')]['split']('\x20')[_0x0128('0x61')]>0x1){_0x191c89[_0x301368]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x23c21f[_0x0128('0x63')]),null);}else{var _0x1814e='%'+_0x23c21f['value']+'%';_0x191c89[_0x301368](_0x0128('0x68'),_0x1814e,_0x1814e,_0x1814e);}}else{_0x36c501=_[_0x0128('0x69')](_0x124423,[_0x0128('0x2e'),_0x0128('0x6a')]);_0x23c21f['field']=_0x0128('0x6a');_0x5adeaf=as[_0x0128('0x6b')](_0x47023d,_0x36c501[_0x0128('0x6c')],_0x23c21f);_0x191c89[_0x301368](_0x5adeaf[_0x0128('0x6d')],_0x5adeaf[_0x0128('0x63')][_0x0128('0x6e')],_0x5adeaf['value'][_0x0128('0x20')]);}break;case _0x0128('0x6f'):var _0xca0c2c=_0x23c21f[_0x0128('0x63')][_0x0128('0x34')](',')[_0x0128('0x3e')](function(_0x4a9236){return Number(_0x4a9236);});_0xca0c2c[_0x0128('0x35')](function(_0x3743b2){_0xdf6f51['or'](_0x0128('0x70'),'%,'+_0x3743b2+',%');});_0x32e745=_[_0x0128('0x71')](_0x32e745,_0xca0c2c);break;case'User':if(_0x23c21f['operator']===_0x0128('0x72')){_0x191c89[_0x301368](_0x0128('0x73'),'%'+_0x23c21f['value']+'%',null);}else{_0x36c501=_[_0x0128('0x69')](_0x124423,[_0x0128('0x2e'),'UserId']);_0x23c21f[_0x0128('0x4a')]=_0x0128('0x74');_0x5adeaf=as[_0x0128('0x6b')](_0x47023d,_0x36c501['type'],_0x23c21f);_0x191c89[_0x301368](_0x5adeaf[_0x0128('0x6d')],_0x5adeaf[_0x0128('0x63')][_0x0128('0x6e')],_0x5adeaf[_0x0128('0x63')]['end']);}break;case _0x0128('0x75'):_0x5adeaf=as[_0x0128('0x6b')]('me',null,_0x23c21f);_0x191c89[_0x301368](_0x5adeaf[_0x0128('0x6d')],_0x5adeaf[_0x0128('0x63')]['start'],_0x5adeaf['value'][_0x0128('0x20')]);break;}}else{var _0x5adeaf=as[_0x0128('0x6b')](_0x47023d,_0x36c501['type'],_0x23c21f);_0x191c89[_0x301368](_0x5adeaf[_0x0128('0x6d')],_0x5adeaf['value'][_0x0128('0x6e')],_0x5adeaf[_0x0128('0x63')][_0x0128('0x20')]);}}}else{var _0x5c29e7=_(_0x319cd7[_0x0128('0x3f')])[_0x0128('0x40')]()[_0x0128('0x3e')](function(_0x11130f){return _[_0x0128('0x76')](_0x124423,[_0x0128('0x2e'),_0x11130f])?_0x11130f:undefined;})['compact']()['value']();if(!_[_0x0128('0x77')](_0x5c29e7)){_0x5c29e7['forEach'](function(_0x4bb5b5){if(_0x4bb5b5===_0x0128('0x78')){_0x2b00cc[_0x0128('0x79')](_0x0128('0x7a'),[][_0x0128('0x7b')](_0x319cd7[_0x0128('0x3f')][_0x4bb5b5]));}else if(_0x4bb5b5===_0x0128('0x7c')){var _0x3c37a7=JSON[_0x0128('0x7d')](_0x319cd7['query'][_0x4bb5b5])[_0x0128('0x7e')];var _0x5e50f4=JSON['parse'](_0x319cd7[_0x0128('0x3f')][_0x4bb5b5])[_0x0128('0x7f')];_0x2b00cc['where'](_0x0128('0x80'),_0x3c37a7,_0x5e50f4);}else{if(_0x319cd7[_0x0128('0x3f')][_0x4bb5b5]===_0x0128('0x81')){_0x2b00cc[_0x0128('0x79')]('i.'+_0x4bb5b5+_0x0128('0x82'));}else{_0x2b00cc['where']('i.'+_0x4bb5b5+_0x0128('0x83'),_0x319cd7[_0x0128('0x3f')][_0x4bb5b5]);}}});}if(_0x319cd7['query'][_0x0128('0x84')]){if(_0x319cd7[_0x0128('0x3f')][_0x0128('0x84')]==0x1){_0x2b00cc['having'](_0x0128('0x85'));}else{_0x2b00cc[_0x0128('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x319cd7[_0x0128('0x3f')][_0x0128('0x86')]){_0x32e745=_[_0x0128('0x87')](_0x319cd7[_0x0128('0x3f')][_0x0128('0x86')])?_0x319cd7[_0x0128('0x3f')][_0x0128('0x86')]:new Array(_0x319cd7[_0x0128('0x3f')][_0x0128('0x86')]);_0x32e745['forEach'](function(_0x119af7){_0xdf6f51['or'](_0x0128('0x70'),'%,'+_0x119af7+',%');});}if(_0x319cd7[_0x0128('0x3f')][_0x0128('0x88')]){var _0x59eea9=_0x319cd7['query'][_0x0128('0x88')][_0x0128('0x89')]('\x5c','\x5c\x5c')[_0x0128('0x89')](/'/g,'\x27\x27');if(qs[_0x0128('0x8a')](_0x59eea9)){_0x191c89['or'](_0x0128('0x8b'),_0x59eea9+'%')['or'](_0x0128('0x8c'),_0x59eea9+'%');}else{_0x191c89['or'](_0x0128('0x8d'),qs[_0x0128('0x8e')](_0x59eea9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x59eea9+'%');}}}_0x2b00cc['where'](_0x191c89);_0x2b00cc[_0x0128('0x8f')]('i.id');var _0x275a51={'type':db[_0x0128('0x90')][_0x0128('0x91')][_0x0128('0x92')],'raw':!![]};var _0x367ccc=_0x2b00cc['clone']();_0x367ccc[_0x0128('0x4a')](_0x0128('0x93'));_0x367ccc[_0x0128('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0128('0x62'));if(_0x1d3235[_0x0128('0x47')]){_0x1d3235[_0x0128('0x47')]['forEach'](function(_0xdd7319){var _0x1fa14d=_0xdd7319[0x0]===_0x0128('0x94')?_0xdd7319[0x0]:'i.'+_0xdd7319[0x0];_0x2b00cc[_0x0128('0x47')](_0x1fa14d,_0xdd7319[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0128('0x77')](_0x32e745)){_0x2b00cc['having'](_0xdf6f51);_0x367ccc[_0x0128('0x79')](_0x0128('0x95'),_0x32e745);}BPromise[_0x0128('0x96')]()[_0x0128('0x2b')](function(){if(!_0x31fd8f){if(_0x319cd7[_0x0128('0x3f')][_0x0128('0x78')])return;_0x367ccc[_0x0128('0x79')](_0x0128('0x97'));_0x2b00cc['where'](_0x0128('0x97'));return;}if(_0x319cd7['user'][_0x0128('0x98')]!==_0x0128('0x99'))return;return _0x319cd7['user'][_0x0128('0x9a')]({'attributes':['id'],'raw':!![]})[_0x0128('0x2b')](function(_0xe0150a){if(_[_0x0128('0x77')](_0xe0150a)){_0x367ccc[_0x0128('0x79')](_0x0128('0x9b'));_0x2b00cc['where'](_0x0128('0x9b'));}else{_0x367ccc[_0x0128('0x79')]('i.WhatsappAccountId\x20IN\x20?',_[_0x0128('0x3e')](_0xe0150a,'id'));_0x2b00cc[_0x0128('0x79')](_0x0128('0x7a'),_['map'](_0xe0150a,'id'));}});})[_0x0128('0x2b')](function(){if(_0x319cd7[_0x0128('0x9c')][_0x0128('0x98')]===_0x0128('0x99')&&!_0x31fd8f&&!_0x319cd7['query'][_0x0128('0x78')])return[];return db['sequelize']['query'](_0x367ccc[_0x0128('0x9d')](),_0x275a51);})[_0x0128('0x2b')](function(_0x4c1011){_0x3d8055[_0x0128('0x25')]=_0x4c1011[_0x0128('0x61')];if(_0x3d8055[_0x0128('0x25')]===0x0)return[];return db[_0x0128('0x9e')][_0x0128('0x3f')](_0x360df0[_0x0128('0x9d')](),_0x275a51)[_0x0128('0x2b')](function(_0x7a225){_0x529020=_[_0x0128('0x9f')](_0x7a225,'id');_0x275a51=_[_0x0128('0xa0')](_0x275a51,{'model':db[_0x0128('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x319cd7['query'][_0x0128('0x44')]){_0x1d3235['attributes'][_0x0128('0x35')](function(_0x196f6f){_0x2b00cc[_0x0128('0x4a')]('i.'+_0x196f6f);});}else{_0x2b00cc['field'](_0x0128('0xa1'),'unreadMessages');_0x2b00cc[_0x0128('0x4a')](_0x0128('0xa2'),_0x0128('0xa3'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xa4'),_0x0128('0xa5'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xa6'),_0x0128('0x94'));_0x2b00cc[_0x0128('0x4a')]('i.*');_0x2b00cc[_0x0128('0x4a')](_0x0128('0xa7'),_0x0128('0xa8'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xa9'),_0x0128('0xaa'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xab'),'Contact.email');_0x2b00cc[_0x0128('0x4a')](_0x0128('0xac'),_0x0128('0xad'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xae'),_0x0128('0xaf'));_0x2b00cc['field']('c.fax',_0x0128('0xb0'));_0x2b00cc[_0x0128('0x4a')](_0x0128('0xb1'),_0x0128('0xb2'));_0x2b00cc[_0x0128('0x4a')]('o.internal',_0x0128('0xb3'));_0x2b00cc['field'](_0x0128('0xb4'),_0x0128('0x32'));}if(_0x1d3235[_0x0128('0x24')])_0x2b00cc['limit'](_0x1d3235[_0x0128('0x24')]);if(_0x1d3235[_0x0128('0x22')])_0x2b00cc['offset'](_0x1d3235[_0x0128('0x22')]);return db['sequelize'][_0x0128('0x3f')](_0x2b00cc[_0x0128('0x9d')](),_0x275a51);})[_0x0128('0x2b')](function(_0x3bc869){if(_0x3bc869['length']>0x0)_0xf3af35[_0x0128('0x79')](_0x0128('0xb5'),_['map'](_0x3bc869,'id'));return db[_0x0128('0x9e')][_0x0128('0x3f')](_0xf3af35['toString'](),_0x275a51)['then'](function(_0x40ea52){var _0xfcda67=_[_0x0128('0xb6')](_0x40ea52,'WhatsappInteractionId');var _0x3a71f4=[];_0x3bc869[_0x0128('0x35')](function(_0x5af33e){_0x3a71f4[_0x0128('0x36')](updateWhatsappInteraction(_0x5af33e,_0x529020,_0xfcda67));});return BPromise[_0x0128('0xb7')](_0x3a71f4);});});})[_0x0128('0x2b')](function(_0x35d7a8){_0x3d8055[_0x0128('0xb8')]=_0x35d7a8;return _0x3d8055;})[_0x0128('0x2b')](respondWithFilteredResult(_0x28f3f2,_0x1d3235))[_0x0128('0x37')](handleError(_0x28f3f2,null));};exports[_0x0128('0xb9')]=function(_0x1aab5e,_0x3a2dde){var _0x554c3f={'raw':![],'where':{'id':_0x1aab5e[_0x0128('0xba')]['id']}},_0x404fc3={};_0x404fc3['model']=_[_0x0128('0x40')](db[_0x0128('0x39')][_0x0128('0x3a')]);_0x404fc3[_0x0128('0x3f')]=_[_0x0128('0x40')](_0x1aab5e[_0x0128('0x3f')]);_0x404fc3['filters']=_[_0x0128('0x42')](_0x404fc3[_0x0128('0x3d')],_0x404fc3['query']);_0x554c3f['attributes']=_[_0x0128('0x42')](_0x404fc3[_0x0128('0x3d')],qs[_0x0128('0x44')](_0x1aab5e[_0x0128('0x3f')][_0x0128('0x44')]));_0x554c3f['attributes']=_0x554c3f[_0x0128('0x43')][_0x0128('0x61')]?_0x554c3f['attributes']:_0x404fc3[_0x0128('0x3d')];if(_0x1aab5e['query'][_0x0128('0xbb')]){_0x554c3f[_0x0128('0xbc')]=[{'all':!![]}];}_0x554c3f=_['merge']({},_0x554c3f,_0x1aab5e[_0x0128('0xbd')]);return db['WhatsappInteraction'][_0x0128('0x69')](_0x554c3f)['then'](handleEntityNotFound(_0x3a2dde,null))[_0x0128('0x2b')](respondWithResult(_0x3a2dde,null))[_0x0128('0x37')](handleError(_0x3a2dde,null));};exports[_0x0128('0xbe')]=function(_0x51c889,_0x274a8d){return db[_0x0128('0x39')]['create'](_0x51c889[_0x0128('0x75')],{})[_0x0128('0x2b')](respondWithResult(_0x274a8d,0xc9))[_0x0128('0x37')](handleError(_0x274a8d,null));};exports['update']=function(_0x37b0f5,_0x43b2e7){if(_0x37b0f5[_0x0128('0x75')]['id']){delete _0x37b0f5[_0x0128('0x75')]['id'];}return db[_0x0128('0x39')]['find']({'where':{'id':_0x37b0f5[_0x0128('0xba')]['id']}})['then'](handleEntityNotFound(_0x43b2e7,null))[_0x0128('0x2b')](saveUpdates(_0x37b0f5[_0x0128('0x75')],null))[_0x0128('0x2b')](respondWithResult(_0x43b2e7,null))['catch'](handleError(_0x43b2e7,null));};exports[_0x0128('0x2c')]=function(_0x1fe728,_0xd7891b){return db[_0x0128('0x39')][_0x0128('0x69')]({'where':{'id':_0x1fe728[_0x0128('0xba')]['id']}})[_0x0128('0x2b')](handleEntityNotFound(_0xd7891b,null))[_0x0128('0x2b')](removeEntity(_0xd7891b,null))[_0x0128('0x37')](handleError(_0xd7891b,null));};exports[_0x0128('0xbf')]=function(_0x4faa74,_0x1be6af){return db['WhatsappInteraction'][_0x0128('0xbf')]()[_0x0128('0x2b')](respondWithResult(_0x1be6af,null))[_0x0128('0x37')](handleError(_0x1be6af,null));};exports[_0x0128('0xc0')]=function(_0x115e61,_0x5e87a,_0x2567b4){return db[_0x0128('0xc1')][_0x0128('0x69')]({'where':{'id':_0x115e61[_0x0128('0xba')]['id']}})[_0x0128('0x2b')](handleEntityNotFound(_0x5e87a,null))['then'](function(_0x1f6058){if(_0x1f6058){return _0x1f6058[_0x0128('0xc0')](_0x115e61['body'][_0x0128('0xc2')],_[_0x0128('0xc3')](_0x115e61[_0x0128('0x75')],['ids','id'])||{});}})['then'](respondWithResult(_0x5e87a,null))[_0x0128('0x37')](handleError(_0x5e87a,null));};exports['getMessages']=function(_0x3f3276,_0x15d849,_0x2bd5b2){var _0x3d15e4={'raw':![],'where':{}};var _0x1f6a5b={};var _0x3c40c2={'count':0x0,'rows':[]};return db[_0x0128('0x39')][_0x0128('0xc4')]({'where':{'id':_0x3f3276[_0x0128('0xba')]['id']}})[_0x0128('0x2b')](handleEntityNotFound(_0x15d849,null))[_0x0128('0x2b')](function(_0x43bb55){if(_0x43bb55){_0x1f6a5b[_0x0128('0x3d')]=_[_0x0128('0x40')](db[_0x0128('0xc1')]['rawAttributes']);_0x1f6a5b[_0x0128('0x3f')]=_[_0x0128('0x40')](_0x3f3276[_0x0128('0x3f')]);_0x1f6a5b[_0x0128('0x41')]=_[_0x0128('0x42')](_0x1f6a5b[_0x0128('0x3d')],_0x1f6a5b['query']);_0x3d15e4[_0x0128('0x43')]=_['intersection'](_0x1f6a5b[_0x0128('0x3d')],qs['fields'](_0x3f3276[_0x0128('0x3f')]['fields']));_0x3d15e4[_0x0128('0x43')]=_0x3d15e4['attributes'][_0x0128('0x61')]?_0x3d15e4[_0x0128('0x43')]:_0x1f6a5b[_0x0128('0x3d')];if(!_0x3f3276[_0x0128('0x3f')]['hasOwnProperty'](_0x0128('0x46'))){_0x3d15e4['limit']=qs[_0x0128('0x24')](_0x3f3276[_0x0128('0x3f')][_0x0128('0x24')]);_0x3d15e4[_0x0128('0x22')]=qs['offset'](_0x3f3276['query'][_0x0128('0x22')]);}_0x3d15e4[_0x0128('0x47')]=qs[_0x0128('0x48')](_0x3f3276[_0x0128('0x3f')]['sort']);_0x3d15e4[_0x0128('0x79')]=qs['filters'](_[_0x0128('0x49')](_0x3f3276[_0x0128('0x3f')],_0x1f6a5b[_0x0128('0x41')]));_0x3d15e4['where'][_0x0128('0xc5')]=_0x43bb55['id'];if(_0x3f3276[_0x0128('0x3f')]['filter']){_0x3d15e4['where']=_[_0x0128('0xa0')](_0x3d15e4['where'],{'$or':_[_0x0128('0x3e')](_0x3d15e4['attributes'],function(_0x274e36){var _0x5d0b02={};_0x5d0b02[_0x274e36]={'$like':'%'+_0x3f3276[_0x0128('0x3f')]['filter']+'%'};return _0x5d0b02;})});}if(_0x3f3276[_0x0128('0x3f')][_0x0128('0x7e')]){var _0x48fe90=_0x3f3276[_0x0128('0x3f')][_0x0128('0x7e')][_0x0128('0x34')](',');var _0x26bc70={};_0x26bc70[_0x48fe90[0x0]]={'$gte':moment(_0x48fe90[0x1])[_0x0128('0xc6')](_0x0128('0xc7'))};_0x3d15e4[_0x0128('0x79')]=_['merge'](_0x3d15e4[_0x0128('0x79')],_0x26bc70);}_0x3d15e4=_['merge']({},_0x3d15e4,_0x3f3276[_0x0128('0xbd')]);return db[_0x0128('0xc1')][_0x0128('0x25')]({'where':_0x3d15e4['where']})[_0x0128('0x2b')](function(_0x4baa3b){_0x3c40c2['count']=_0x4baa3b;if(_0x3f3276[_0x0128('0x3f')][_0x0128('0xbb')]){_0x3d15e4[_0x0128('0xbc')]=[{'all':!![]}];}return db[_0x0128('0xc1')][_0x0128('0xc8')](_0x3d15e4);})[_0x0128('0x2b')](function(_0x35fbbf){_0x3c40c2[_0x0128('0xb8')]=_0x35fbbf;return _0x3c40c2;});}})[_0x0128('0x2b')](respondWithFilteredResult(_0x15d849,_0x3d15e4))[_0x0128('0x37')](handleError(_0x15d849,null));};exports[_0x0128('0xc9')]=function(_0x4bc20f,_0x420596,_0x5e71e9){return db[_0x0128('0x39')][_0x0128('0x69')]({'where':{'id':_0x4bc20f['params']['id']}})[_0x0128('0x2b')](handleEntityNotFound(_0x420596,null))['then'](function(_0x20c227){if(_0x20c227){return _0x20c227['setTags'](_0x4bc20f[_0x0128('0x75')][_0x0128('0xc2')],_[_0x0128('0xc3')](_0x4bc20f[_0x0128('0x75')],[_0x0128('0xc2'),'id'])||{})[_0x0128('0xca')](function(){return db['Tag'][_0x0128('0xc8')]({'attributes':['id','name',_0x0128('0x4b')],'where':{'id':_0x4bc20f[_0x0128('0x75')][_0x0128('0xc2')]}});})[_0x0128('0x2b')](function(_0x258d00){socket[_0x0128('0xcb')]('whatsappInteractionTags:save',{'id':Number(_0x4bc20f['params']['id']),'tags':_0x258d00||[]});return{'id':Number(_0x4bc20f['params']['id']),'tags':_0x258d00||[]};});}})[_0x0128('0x2b')](respondWithResult(_0x420596,null))[_0x0128('0x37')](handleError(_0x420596,null));};exports['removeTags']=function(_0x5a1b1e,_0x5727ad,_0x593bd5){return db['WhatsappInteraction'][_0x0128('0x69')]({'where':{'id':_0x5a1b1e[_0x0128('0xba')]['id']}})[_0x0128('0x2b')](handleEntityNotFound(_0x5727ad,null))[_0x0128('0x2b')](function(_0x598d25){if(_0x598d25){return _0x598d25[_0x0128('0xcc')](_0x5a1b1e['query'][_0x0128('0xc2')]);}})[_0x0128('0x2b')](respondWithStatusCode(_0x5727ad,null))[_0x0128('0x37')](handleError(_0x5727ad,null));};exports['download']=function(_0x23279e,_0x4a7d01){var _0x12ebff=moment()['unix']()[_0x0128('0x9d')]();var _0x4266ae=path['join'](config[_0x0128('0xcd')],_0x0128('0xce'),_0x0128('0xcf'),_0x0128('0xd0'));var _0x500c2c=path[_0x0128('0xd1')](config['root'],_0x0128('0xce'),_0x0128('0xcf'),'attachments');var _0x357a8d=path[_0x0128('0xd1')](_0x4266ae,_0x12ebff);var _0x40862d=util[_0x0128('0xc6')](_0x0128('0xd2'),_0x23279e['params']['id'],_0x12ebff);var _0x4c87ed=path[_0x0128('0xd1')](_0x4266ae,_0x40862d);var _0x28ac96=[];_0x28ac96[_0x0128('0x36')]({'model':db[_0x0128('0xd3')],'as':_0x0128('0xd3'),'attributes':['id',_0x0128('0x31')],'raw':!![]});_0x28ac96[_0x0128('0x36')]({'model':db['CmContact'],'as':_0x0128('0xd4'),'attributes':['id',_0x0128('0xd5'),_0x0128('0xd6')],'raw':!![]});if(_0x23279e[_0x0128('0x3f')]['attachments']){_0x28ac96[_0x0128('0x36')]({'model':db[_0x0128('0xd7')],'as':_0x0128('0xd7'),'raw':!![]});}var _0x14d4a=[{'model':db[_0x0128('0xc1')],'as':_0x0128('0xd8'),'attributes':['id',_0x0128('0x75'),'createdAt',_0x0128('0xd9'),'secret','read'],'include':_0x28ac96}];_0x14d4a[_0x0128('0x36')]({'model':db['WhatsappAccount'],'as':_0x0128('0xda'),'attributes':['id',_0x0128('0x2e')]});_0x14d4a[_0x0128('0x36')]({'model':db[_0x0128('0xd3')],'as':_0x0128('0xdb'),'attributes':['id',_0x0128('0x31')]});return db[_0x0128('0x39')][_0x0128('0x69')]({'where':{'id':_0x23279e[_0x0128('0xba')]['id']},'include':_0x14d4a})[_0x0128('0x2b')](handleEntityNotFound(_0x4a7d01,null))[_0x0128('0x2b')](function(_0x2c5397){if(_0x2c5397){var _0x30d09b=_0x2c5397[_0x0128('0xdc')]({'plain':!![]});fs[_0x0128('0xdd')](_0x357a8d);var _0x42fe6a={'channel':_0x0128('0xde'),'account':_0x30d09b[_0x0128('0xda')][_0x0128('0x2e')],'agent':_0x30d09b[_0x0128('0xdb')]?_0x30d09b['Owner'][_0x0128('0x31')]:_0x0128('0xdf'),'createdAt':moment(_0x30d09b[_0x0128('0x7c')])[_0x0128('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0128('0x9d')](),'closedAt':_0x30d09b[_0x0128('0xe0')]?moment(_0x30d09b[_0x0128('0xe1')])[_0x0128('0xc6')](_0x0128('0xc7'))[_0x0128('0x9d')]():'','disposition':_0x30d09b[_0x0128('0xe2')],'messages':_(_0x30d09b[_0x0128('0xd8')])[_0x0128('0x88')]({'secret':![]})['map'](function(_0x72d2ac){if(_0x72d2ac[_0x0128('0xd7')]){var _0x43813e=path['join'](_0x500c2c,_0x72d2ac[_0x0128('0xd7')][_0x0128('0xe3')]);if(fs['existsSync'](_0x43813e)){fs[_0x0128('0xe4')](_0x43813e)[_0x0128('0xe5')](fs[_0x0128('0xe6')](path['join'](_0x357a8d,_0x72d2ac['Attachment'][_0x0128('0xe3')])));}}return{'date':moment(_0x72d2ac['createdAt'])[_0x0128('0xc6')](_0x0128('0xc7'))[_0x0128('0x9d')](),'sender':_0x72d2ac[_0x0128('0xd9')]===_0x0128('0xe7')?_0x72d2ac[_0x0128('0xd3')]?_0x72d2ac[_0x0128('0xd3')][_0x0128('0x31')]:'System':_0x72d2ac[_0x0128('0xd4')][_0x0128('0xd5')]+(_0x72d2ac[_0x0128('0xd4')][_0x0128('0xd6')]?'\x20'+_0x72d2ac[_0x0128('0xd4')]['lastName']:''),'body':_0x72d2ac['Attachment']?_0x72d2ac[_0x0128('0xd7')][_0x0128('0xe3')]:_0x72d2ac[_0x0128('0x75')],'direction':_0x72d2ac[_0x0128('0xd9')]==='out'?'A':'C','secret':_0x72d2ac[_0x0128('0xe8')],'read':_0x72d2ac['read'],'attachment':_0x72d2ac[_0x0128('0xd7')]};})[_0x0128('0x63')]()};return ejs[_0x0128('0xe9')](path[_0x0128('0xd1')](config[_0x0128('0xcd')],_0x0128('0xce'),_0x0128('0xea'),_0x0128('0xeb')),{'interaction':_0x42fe6a})[_0x0128('0x2b')](function(_0x3c7230){var _0x41d7fe=path[_0x0128('0xd1')](_0x357a8d,_0x0128('0xec')+_0x30d09b['id']+'-'+_0x12ebff+_0x0128('0xed'));var _0x4044cc={'path':_0x41d7fe,'channel':_0x0128('0xde'),'interactionId':_0x30d09b['id']};return pdf[_0x0128('0xee')](_0x3c7230,_0x4044cc);})[_0x0128('0x2b')](function(){return new BPromise(function(_0x320701,_0x2a2569){zipdir(_0x357a8d,{'saveTo':_0x4c87ed},function(_0x599c4b,_0x442b60){if(_0x599c4b)return _0x2a2569(_0x599c4b);return _0x320701(_0x442b60);});})['then'](function(){return new BPromise(function(_0x3520ad,_0x176823){rimraf(_0x357a8d,function(_0x4dc123){if(_0x4dc123)_0x176823(_0x4dc123);return _0x3520ad();});});})[_0x0128('0x2b')](function(){return _0x4a7d01[_0x0128('0xef')](_0x4c87ed,_0x40862d,function(_0x3f3b80){if(_0x3f3b80){console[_0x0128('0xf0')]('err',_0x3f3b80);}else{fs['unlinkSync'](_0x4c87ed);}});});});}else{return _0x4a7d01[_0x0128('0x1e')](0xc8);}})[_0x0128('0x37')](handleError(_0x4a7d01,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index a0b0f59..f2071d5 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 _0x1020=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','findAll'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x1020,0x1a4));var _0x0102=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x1020[_0x39f34f];return _0x59fee1;};'use strict';var EventEmitter=require(_0x0102('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x0102('0x1')];var WhatsappMessage=require(_0x0102('0x2'))['db'][_0x0102('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0102('0x4')](0x0);var events={'afterCreate':_0x0102('0x5'),'afterUpdate':_0x0102('0x6'),'afterDestroy':_0x0102('0x7')};function emitEvent(_0x3d59aa){return function(_0xb7253a,_0x4485c5,_0x27dd86){_0xb7253a[_0x0102('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x26804d){_0xb7253a[_0x0102('0x9')](_0x0102('0xa'),_0x26804d['map'](function(_0x54c005){return{'id':_0x54c005['id']};}));return WhatsappMessage[_0x0102('0xb')]({'where':{'WhatsappInteractionId':_0xb7253a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x47fac0){_0xb7253a[_0x0102('0x9')](_0x0102('0xc'),_0x47fac0[_0x0102('0xd')]);WhatsappInteractionEvents[_0x0102('0xe')](_0x3d59aa+':'+_0xb7253a['id'],_0xb7253a);WhatsappInteractionEvents[_0x0102('0xe')](_0x3d59aa,_0xb7253a);_0x27dd86(null);})['catch'](_0x27dd86(null));};}for(var e in events){if(events[_0x0102('0xf')](e)){var event=events[e];WhatsappInteraction[_0x0102('0x10')](e,emitEvent(event));}}module[_0x0102('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xa9e5=['remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x186043,_0x3791f5){var _0x3b3097=function(_0x363e35){while(--_0x363e35){_0x186043['push'](_0x186043['shift']());}};_0x3b3097(++_0x3791f5);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x4e49af,_0x3da9c5){_0x4e49af=_0x4e49af-0x0;var _0x3f60d2=_0xa9e5[_0x4e49af];return _0x3f60d2;};'use strict';var EventEmitter=require(_0x5a9e('0x0'));var WhatsappInteraction=require(_0x5a9e('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x5a9e('0x1'))['db'][_0x5a9e('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5a9e('0x3')](0x0);var events={'afterCreate':_0x5a9e('0x4'),'afterUpdate':_0x5a9e('0x5'),'afterDestroy':_0x5a9e('0x6')};function emitEvent(_0x3ce605){return function(_0x2f42f8,_0x120d60,_0x34a9ed){_0x2f42f8[_0x5a9e('0x7')]({'attributes':['id'],'raw':!![]})[_0x5a9e('0x8')](function(_0x69b06a){_0x2f42f8[_0x5a9e('0x9')]('Users',_0x69b06a[_0x5a9e('0xa')](function(_0x18ee71){return{'id':_0x18ee71['id']};}));return WhatsappMessage[_0x5a9e('0xb')]({'where':{'WhatsappInteractionId':_0x2f42f8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5a9e('0x8')](function(_0x4ffdb3){_0x2f42f8[_0x5a9e('0x9')]('unreadMessages',_0x4ffdb3[_0x5a9e('0xc')]);WhatsappInteractionEvents[_0x5a9e('0xd')](_0x3ce605+':'+_0x2f42f8['id'],_0x2f42f8);WhatsappInteractionEvents[_0x5a9e('0xd')](_0x3ce605,_0x2f42f8);_0x34a9ed(null);})[_0x5a9e('0xe')](_0x34a9ed(null));};}for(var e in events){if(events[_0x5a9e('0xf')](e)){var event=events[e];WhatsappInteraction[_0x5a9e('0x10')](e,emitEvent(event));}}module[_0x5a9e('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index ce2be21..b451f42 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 _0x14ca=['api','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x14ca,0x148));var _0xa14c=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x14ca[_0x50bf5a];return _0x4ddc1d;};'use strict';var _=require(_0xa14c('0x0'));var util=require(_0xa14c('0x1'));var logger=require('../../config/logger')(_0xa14c('0x2'));var moment=require('moment');var BPromise=require(_0xa14c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa14c('0x4'));var rimraf=require(_0xa14c('0x5'));var config=require('../../config/environment');var attributes=require(_0xa14c('0x6'));module[_0xa14c('0x7')]=function(_0x10c814,_0x50f9e8){return _0x10c814['define'](_0xa14c('0x8'),attributes,{'tableName':_0xa14c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8bbe56,_0x22e572,_0x2b708a){if(_0x8bbe56[_0xa14c('0xa')](_0xa14c('0xb'))){_0x8bbe56[_0xa14c('0xc')]=moment()[_0xa14c('0xd')](_0xa14c('0xe'));}_0x2b708a(null,_0x8bbe56);}}});}; \ No newline at end of file +var _0x1409=['format','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closed','closedAt'];(function(_0xfcdcb3,_0x50dc3b){var _0x493aa7=function(_0x108c8a){while(--_0x108c8a){_0xfcdcb3['push'](_0xfcdcb3['shift']());}};_0x493aa7(++_0x50dc3b);}(_0x1409,0x79));var _0x9140=function(_0x5abcee,_0x16d90a){_0x5abcee=_0x5abcee-0x0;var _0x326edc=_0x1409[_0x5abcee];return _0x326edc;};'use strict';var _=require('lodash');var util=require(_0x9140('0x0'));var logger=require(_0x9140('0x1'))(_0x9140('0x2'));var moment=require(_0x9140('0x3'));var BPromise=require(_0x9140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9140('0x5'));var rimraf=require(_0x9140('0x6'));var config=require(_0x9140('0x7'));var attributes=require(_0x9140('0x8'));module[_0x9140('0x9')]=function(_0x5681c6,_0x15fa75){return _0x5681c6[_0x9140('0xa')]('WhatsappInteraction',attributes,{'tableName':_0x9140('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1861e8,_0x469a4e,_0x409872){if(_0x1861e8['changed'](_0x9140('0xc'))){_0x1861e8[_0x9140('0xd')]=moment()[_0x9140('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x409872(null,_0x1861e8);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 77b5185..09c6af7 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 _0xb90a=['socket.io-emitter','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','WhatsappInteraction','update','body','options','where','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost'];(function(_0x57188b,_0x3c3e81){var _0x39607e=function(_0x3d7f10){while(--_0x3d7f10){_0x57188b['push'](_0x57188b['shift']());}};_0x39607e(++_0x3c3e81);}(_0xb90a,0xb7));var _0xab90=function(_0x1fc429,_0x2321df){_0x1fc429=_0x1fc429-0x0;var _0x10d7a7=_0xb90a[_0x1fc429];return _0x10d7a7;};'use strict';var _=require('lodash');var util=require(_0xab90('0x0'));var moment=require(_0xab90('0x1'));var BPromise=require(_0xab90('0x2'));var rs=require(_0xab90('0x3'));var fs=require('fs');var Redis=require(_0xab90('0x4'));var db=require(_0xab90('0x5'))['db'];var utils=require(_0xab90('0x6'));var logger=require(_0xab90('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab90('0x8'));var client=jayson[_0xab90('0x9')]['http']({'port':0x232a});config[_0xab90('0xa')]=_['defaults'](config[_0xab90('0xa')],{'host':_0xab90('0xb'),'port':0x18eb});var socket=require(_0xab90('0xc'))(new Redis(config[_0xab90('0xa')]));require(_0xab90('0xd'))[_0xab90('0xe')](socket);function respondWithRpcPromise(_0x1ca4da,_0x467303,_0x5d1500){return new BPromise(function(_0x11dd6f,_0x185b7d){return client['request'](_0x1ca4da,_0x5d1500)[_0xab90('0xf')](function(_0x5cf497){logger[_0xab90('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x467303,_0xab90('0x11'));logger[_0xab90('0x12')](_0xab90('0x13'),_0x467303,_0xab90('0x11'),JSON[_0xab90('0x14')](_0x5cf497));if(_0x5cf497['error']){if(_0x5cf497[_0xab90('0x15')]['code']===0x1f4){logger[_0xab90('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x467303,_0x5cf497[_0xab90('0x15')][_0xab90('0x16')]);return _0x185b7d(_0x5cf497[_0xab90('0x15')][_0xab90('0x16')]);}logger[_0xab90('0x15')](_0xab90('0x17'),_0x467303,_0x5cf497[_0xab90('0x15')][_0xab90('0x16')]);return _0x11dd6f(_0x5cf497[_0xab90('0x15')][_0xab90('0x16')]);}else{logger['info'](_0xab90('0x17'),_0x467303,_0xab90('0x11'));_0x11dd6f(_0x5cf497[_0xab90('0x18')][_0xab90('0x16')]);}})[_0xab90('0x19')](function(_0xe8c96d){logger['error'](_0xab90('0x17'),_0x467303,_0xe8c96d);_0x185b7d(_0xe8c96d);});});}exports['UpdateWhatsappInteraction']=function(_0x32a22d){var _0x46875a=this;return new Promise(function(_0x414710,_0x1d9fe6){return db[_0xab90('0x1a')][_0xab90('0x1b')](_0x32a22d[_0xab90('0x1c')],{'raw':_0x32a22d[_0xab90('0x1d')]?_0x32a22d[_0xab90('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32a22d[_0xab90('0x1d')]?_0x32a22d[_0xab90('0x1d')][_0xab90('0x1e')]||null:null,'attributes':_0x32a22d[_0xab90('0x1d')]?_0x32a22d[_0xab90('0x1d')]['attributes']||null:null,'limit':_0x32a22d[_0xab90('0x1d')]?_0x32a22d[_0xab90('0x1d')]['limit']||null:null})[_0xab90('0xf')](function(_0x43f9a9){logger['info'](_0xab90('0x1f'),_0x32a22d);logger[_0xab90('0x12')](_0xab90('0x1f'),_0x32a22d,JSON[_0xab90('0x14')](_0x43f9a9));_0x414710(_0x43f9a9);})[_0xab90('0x19')](function(_0xf9aadd){logger['error']('UpdateWhatsappInteraction',_0xf9aadd['message'],_0x32a22d);_0x1d9fe6(_0x46875a[_0xab90('0x15')](0x1f4,_0xf9aadd[_0xab90('0x16')]));});});};exports[_0xab90('0x20')]=function(_0x434409){return new Promise(function(_0x3eeab5,_0x27dd06){return db[_0xab90('0x1a')][_0xab90('0x21')]({'where':_0x434409[_0xab90('0x1d')]?_0x434409[_0xab90('0x1d')][_0xab90('0x1e')]||null:null})[_0xab90('0xf')](function(_0x164d36){if(_0x164d36){return _0x164d36[_0xab90('0x22')](_0x434409['body'][_0xab90('0x23')],_[_0xab90('0x24')](_0x434409['body'],[_0xab90('0x23'),'id'])||{});}})[_0xab90('0x25')](function(_0x4205c0){logger[_0xab90('0x10')]('AddTags',_0x434409);logger[_0xab90('0x12')](_0xab90('0x26'),_0x434409,JSON['stringify'](_0x4205c0));_0x3eeab5(_0x4205c0);})[_0xab90('0x19')](function(_0x8bab5f){logger['error'](_0xab90('0x26'),_0x8bab5f[_0xab90('0x16')],_0x434409);_0x27dd06(_this[_0xab90('0x15')](0x1f4,_0x8bab5f['message']));});});}; \ No newline at end of file +var _0x06b6=['message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','debug','stringify','AddTagsToWhatsappInteraction','find','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error'];(function(_0x359125,_0xab5b35){var _0x5804fa=function(_0xd972cf){while(--_0xd972cf){_0x359125['push'](_0x359125['shift']());}};_0x5804fa(++_0xab5b35);}(_0x06b6,0x1b1));var _0x606b=function(_0x1d93ab,_0x7e2a7a){_0x1d93ab=_0x1d93ab-0x0;var _0x3a778a=_0x06b6[_0x1d93ab];return _0x3a778a;};'use strict';var _=require(_0x606b('0x0'));var util=require('util');var moment=require(_0x606b('0x1'));var BPromise=require(_0x606b('0x2'));var rs=require(_0x606b('0x3'));var fs=require('fs');var Redis=require(_0x606b('0x4'));var db=require(_0x606b('0x5'))['db'];var utils=require(_0x606b('0x6'));var logger=require(_0x606b('0x7'))(_0x606b('0x8'));var config=require('../../config/environment');var jayson=require(_0x606b('0x9'));var client=jayson[_0x606b('0xa')]['http']({'port':0x232a});config['redis']=_[_0x606b('0xb')](config[_0x606b('0xc')],{'host':_0x606b('0xd'),'port':0x18eb});var socket=require(_0x606b('0xe'))(new Redis(config['redis']));require(_0x606b('0xf'))['register'](socket);function respondWithRpcPromise(_0xe6eda1,_0x1396f8,_0x5b5d83){return new BPromise(function(_0x1a9a4c,_0x2b8e85){return client[_0x606b('0x10')](_0xe6eda1,_0x5b5d83)[_0x606b('0x11')](function(_0x4664c5){logger[_0x606b('0x12')](_0x606b('0x13'),_0x1396f8,_0x606b('0x14'));logger['debug'](_0x606b('0x15'),_0x1396f8,_0x606b('0x14'),JSON['stringify'](_0x4664c5));if(_0x4664c5[_0x606b('0x16')]){if(_0x4664c5[_0x606b('0x16')]['code']===0x1f4){logger[_0x606b('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x1396f8,_0x4664c5['error'][_0x606b('0x17')]);return _0x2b8e85(_0x4664c5[_0x606b('0x16')]['message']);}logger[_0x606b('0x16')](_0x606b('0x13'),_0x1396f8,_0x4664c5[_0x606b('0x16')][_0x606b('0x17')]);return _0x1a9a4c(_0x4664c5[_0x606b('0x16')][_0x606b('0x17')]);}else{logger[_0x606b('0x12')](_0x606b('0x13'),_0x1396f8,_0x606b('0x14'));_0x1a9a4c(_0x4664c5[_0x606b('0x18')][_0x606b('0x17')]);}})['catch'](function(_0x28ba3e){logger[_0x606b('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x1396f8,_0x28ba3e);_0x2b8e85(_0x28ba3e);});});}exports[_0x606b('0x19')]=function(_0x2bb8ce){var _0x5c453d=this;return new Promise(function(_0x44f004,_0x439a39){return db[_0x606b('0x1a')][_0x606b('0x1b')](_0x2bb8ce[_0x606b('0x1c')],{'raw':_0x2bb8ce[_0x606b('0x1d')]?_0x2bb8ce['options'][_0x606b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb8ce['options']?_0x2bb8ce['options']['where']||null:null,'attributes':_0x2bb8ce['options']?_0x2bb8ce[_0x606b('0x1d')]['attributes']||null:null,'limit':_0x2bb8ce[_0x606b('0x1d')]?_0x2bb8ce['options']['limit']||null:null})['then'](function(_0x2ddda5){logger[_0x606b('0x12')](_0x606b('0x19'),_0x2bb8ce);logger[_0x606b('0x1f')](_0x606b('0x19'),_0x2bb8ce,JSON[_0x606b('0x20')](_0x2ddda5));_0x44f004(_0x2ddda5);})['catch'](function(_0x329865){logger[_0x606b('0x16')](_0x606b('0x19'),_0x329865[_0x606b('0x17')],_0x2bb8ce);_0x439a39(_0x5c453d[_0x606b('0x16')](0x1f4,_0x329865[_0x606b('0x17')]));});});};exports[_0x606b('0x21')]=function(_0x27538b){return new Promise(function(_0x3e84d2,_0x4f1900){return db[_0x606b('0x1a')][_0x606b('0x22')]({'where':_0x27538b['options']?_0x27538b[_0x606b('0x1d')]['where']||null:null})[_0x606b('0x11')](function(_0x520a4c){if(_0x520a4c){return _0x520a4c['addTags'](_0x27538b[_0x606b('0x1c')]['ids'],_[_0x606b('0x23')](_0x27538b[_0x606b('0x1c')],[_0x606b('0x24'),'id'])||{});}})['spread'](function(_0x1683a3){logger[_0x606b('0x12')](_0x606b('0x25'),_0x27538b);logger[_0x606b('0x1f')](_0x606b('0x25'),_0x27538b,JSON[_0x606b('0x20')](_0x1683a3));_0x3e84d2(_0x1683a3);})['catch'](function(_0x5b7dbf){logger[_0x606b('0x16')](_0x606b('0x25'),_0x5b7dbf[_0x606b('0x17')],_0x27538b);_0x4f1900(_this[_0x606b('0x16')](0x1f4,_0x5b7dbf['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 48f2768..dcb5a66 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 _0xfe72=['remove','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xfe72,0x1de));var _0x2fe7=function(_0x26dcb2,_0x3244c0){_0x26dcb2=_0x26dcb2-0x0;var _0x18f9bd=_0xfe72[_0x26dcb2];return _0x18f9bd;};'use strict';var WhatsappInteractionEvents=require(_0x2fe7('0x0'));var events=[_0x2fe7('0x1'),_0x2fe7('0x2'),_0x2fe7('0x3')];function createListener(_0x5d35e0,_0x2d5cf7){return function(_0x3b8b6b){_0x2d5cf7[_0x2fe7('0x4')](_0x5d35e0,_0x3b8b6b);};}function removeListener(_0x197430,_0x27c103){return function(){WhatsappInteractionEvents['removeListener'](_0x197430,_0x27c103);};}exports[_0x2fe7('0x5')]=function(_0x4e79e2){for(var _0x5da68b=0x0,_0x2c6e86=events[_0x2fe7('0x6')];_0x5da68b<_0x2c6e86;_0x5da68b++){var _0x4c4fd3=events[_0x5da68b];var _0x379f5a=createListener(_0x2fe7('0x7')+_0x4c4fd3,_0x4e79e2);WhatsappInteractionEvents['on'](_0x4c4fd3,_0x379f5a);}}; \ No newline at end of file +var _0xc72a=['./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x418321,_0x52b4f1){var _0x402cbd=function(_0x3f597a){while(--_0x3f597a){_0x418321['push'](_0x418321['shift']());}};_0x402cbd(++_0x52b4f1);}(_0xc72a,0x70));var _0xac72=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0xc72a[_0x45346d];return _0x5ce7ca;};'use strict';var WhatsappInteractionEvents=require(_0xac72('0x0'));var events=[_0xac72('0x1'),_0xac72('0x2'),_0xac72('0x3')];function createListener(_0x56b5b8,_0x35dbe3){return function(_0x25a199){_0x35dbe3[_0xac72('0x4')](_0x56b5b8,_0x25a199);};}function removeListener(_0x5b7240,_0x4253a1){return function(){WhatsappInteractionEvents[_0xac72('0x5')](_0x5b7240,_0x4253a1);};}exports[_0xac72('0x6')]=function(_0x501ae7){for(var _0x1ca9b2=0x0,_0x5e03a2=events[_0xac72('0x7')];_0x1ca9b2<_0x5e03a2;_0x1ca9b2++){var _0x1ba225=events[_0x1ca9b2];var _0x2ea356=createListener('whatsappInteraction:'+_0x1ba225,_0x501ae7);WhatsappInteractionEvents['on'](_0x1ba225,_0x2ea356);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0adf07d..08c4600 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 _0x3bab=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','describe','/:id','isAuthenticated','post','tracked','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject'];(function(_0x13c947,_0x426f6f){var _0x5788f0=function(_0x201beb){while(--_0x201beb){_0x13c947['push'](_0x13c947['shift']());}};_0x5788f0(++_0x426f6f);}(_0x3bab,0x84));var _0xb3ba=function(_0x9ea68f,_0x56532d){_0x9ea68f=_0x9ea68f-0x0;var _0x3153e1=_0x3bab[_0x9ea68f];return _0x3153e1;};'use strict';var multer=require(_0xb3ba('0x0'));var util=require(_0xb3ba('0x1'));var path=require(_0xb3ba('0x2'));var timeout=require(_0xb3ba('0x3'));var express=require('express');var router=express[_0xb3ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb3ba('0x5'));var interaction=require(_0xb3ba('0x6'));var config=require(_0xb3ba('0x7'));var controller=require(_0xb3ba('0x8'));router[_0xb3ba('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3ba('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb3ba('0xa')]);router[_0xb3ba('0x9')](_0xb3ba('0xb'),auth[_0xb3ba('0xc')](),controller['show']);router[_0xb3ba('0xd')]('/',auth[_0xb3ba('0xc')](),interaction[_0xb3ba('0xe')]('whatsapp',_0xb3ba('0xf')),controller[_0xb3ba('0x10')]);router[_0xb3ba('0xd')](_0xb3ba('0x11'),controller[_0xb3ba('0x12')]);router['put'](_0xb3ba('0xb'),auth[_0xb3ba('0xc')](),controller[_0xb3ba('0x13')]);router[_0xb3ba('0x14')](_0xb3ba('0x15'),auth[_0xb3ba('0xc')](),controller[_0xb3ba('0x16')]);router['put'](_0xb3ba('0x17'),auth[_0xb3ba('0xc')](),controller['reject']);router[_0xb3ba('0x18')](_0xb3ba('0xb'),auth[_0xb3ba('0xc')](),controller['destroy']);module[_0xb3ba('0x19')]=router; \ No newline at end of file +var _0xfe67=['../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','whatsapp','whatsappmessage:create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4ccd61,_0x273bd5){var _0x39f19e=function(_0x53d4b5){while(--_0x53d4b5){_0x4ccd61['push'](_0x4ccd61['shift']());}};_0x39f19e(++_0x273bd5);}(_0xfe67,0x9b));var _0x7fe6=function(_0x2c684b,_0x55b624){_0x2c684b=_0x2c684b-0x0;var _0x4c4965=_0xfe67[_0x2c684b];return _0x4c4965;};'use strict';var multer=require(_0x7fe6('0x0'));var util=require(_0x7fe6('0x1'));var path=require(_0x7fe6('0x2'));var timeout=require(_0x7fe6('0x3'));var express=require(_0x7fe6('0x4'));var router=express['Router']();var fs_extra=require(_0x7fe6('0x5'));var auth=require(_0x7fe6('0x6'));var interaction=require(_0x7fe6('0x7'));var config=require(_0x7fe6('0x8'));var controller=require(_0x7fe6('0x9'));router[_0x7fe6('0xa')]('/',auth[_0x7fe6('0xb')](),controller[_0x7fe6('0xc')]);router['get'](_0x7fe6('0xd'),auth[_0x7fe6('0xb')](),controller['describe']);router[_0x7fe6('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7fe6('0xb')](),interaction['tracked'](_0x7fe6('0xe'),_0x7fe6('0xf')),controller['create']);router[_0x7fe6('0x10')](_0x7fe6('0x11'),controller[_0x7fe6('0x12')]);router[_0x7fe6('0x13')](_0x7fe6('0x14'),auth[_0x7fe6('0xb')](),controller[_0x7fe6('0x15')]);router[_0x7fe6('0x13')](_0x7fe6('0x16'),auth['isAuthenticated'](),controller[_0x7fe6('0x17')]);router[_0x7fe6('0x13')]('/:id/reject',auth[_0x7fe6('0xb')](),controller[_0x7fe6('0x18')]);router[_0x7fe6('0x19')](_0x7fe6('0x14'),auth[_0x7fe6('0xb')](),controller['destroy']);module[_0x7fe6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 34a1a1f..1d24998 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 _0x8d19=['exports','TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3e8d7e,_0x2f1a41){var _0x311362=function(_0x65732c){while(--_0x65732c){_0x3e8d7e['push'](_0x3e8d7e['shift']());}};_0x311362(++_0x2f1a41);}(_0x8d19,0xd1));var _0x98d1=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x8d19[_0x3f2a90];return _0xb46279;};'use strict';var Sequelize=require(_0x98d1('0x0'));module[_0x98d1('0x1')]={'body':{'type':Sequelize[_0x98d1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x98d1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x98d1('0x4')]('in','out'),'defaultValue':_0x98d1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x98d1('0x6')](0xbe)},'phone':{'type':Sequelize[_0x98d1('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x98d1('0x6')]},'providerResponse':{'type':Sequelize[_0x98d1('0x2')]}}; \ No newline at end of file +var _0x521e=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x49bea1,_0x58a1a6){var _0x617fd2=function(_0x3386ff){while(--_0x3386ff){_0x49bea1['push'](_0x49bea1['shift']());}};_0x617fd2(++_0x58a1a6);}(_0x521e,0x86));var _0xe521=function(_0x407e82,_0x226acb){_0x407e82=_0x407e82-0x0;var _0x32fd7c=_0x521e[_0x407e82];return _0x32fd7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xe521('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xe521('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe521('0x2')]('in','out'),'defaultValue':_0xe521('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe521('0x4')](0xbe)},'phone':{'type':Sequelize[_0xe521('0x4')]},'readAt':{'type':Sequelize[_0xe521('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe521('0x4')]},'providerResponse':{'type':Sequelize[_0xe521('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 502fa7c..3edca7c 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 _0xb0de=['request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','destroy','end','stack','name','map','WhatsappMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','catch','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','rejectMessage','contact','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http'];(function(_0x556694,_0x37d745){var _0x5a4f47=function(_0x117c05){while(--_0x117c05){_0x556694['push'](_0x556694['shift']());}};_0x5a4f47(++_0x37d745);}(_0xb0de,0xec));var _0xeb0d=function(_0x11d349,_0x205c68){_0x11d349=_0x11d349-0x0;var _0x1ff268=_0xb0de[_0x11d349];return _0x1ff268;};'use strict';var emlformat=require(_0xeb0d('0x0'));var rimraf=require(_0xeb0d('0x1'));var zipdir=require(_0xeb0d('0x2'));var jsonpatch=require(_0xeb0d('0x3'));var rp=require(_0xeb0d('0x4'));var moment=require('moment');var BPromise=require(_0xeb0d('0x5'));var Mustache=require(_0xeb0d('0x6'));var util=require(_0xeb0d('0x7'));var path=require(_0xeb0d('0x8'));var sox=require(_0xeb0d('0x9'));var csv=require(_0xeb0d('0xa'));var ejs=require(_0xeb0d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb0d('0xc'));var squel=require('squel');var crypto=require(_0xeb0d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeb0d('0xa'));var querystring=require(_0xeb0d('0xe'));var Papa=require('papaparse');var Redis=require(_0xeb0d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb0d('0x10'));var hardwareService=require(_0xeb0d('0x11'));var logger=require(_0xeb0d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xeb0d('0x13'));var licenseUtil=require(_0xeb0d('0x14'));var db=require(_0xeb0d('0x15'))['db'];config[_0xeb0d('0x16')]=_[_0xeb0d('0x17')](config['redis'],{'host':_0xeb0d('0x18'),'port':0x18eb});var socket=require(_0xeb0d('0x19'))(new Redis(config[_0xeb0d('0x16')]));require(_0xeb0d('0x1a'))[_0xeb0d('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xeb0d('0x1c')][_0xeb0d('0x1d')]({'port':0x232c});var client9002=jayson[_0xeb0d('0x1c')][_0xeb0d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5e53cd,_0x419ff0,_0x2f98c6,_0x13fd88){return new BPromise(function(_0x16edcb,_0x3e2a4e){var _0x17c5cd=_0x13fd88||client;return _0x17c5cd[_0xeb0d('0x1e')](_0x5e53cd,_0x2f98c6)[_0xeb0d('0x1f')](function(_0x578691){logger[_0xeb0d('0x20')](_0xeb0d('0x21'),_0x419ff0,_0xeb0d('0x22'));logger[_0xeb0d('0x23')](_0xeb0d('0x24'),_0x419ff0,'request\x20sent',JSON['stringify'](_0x578691));if(_0x578691[_0xeb0d('0x25')]){if(_0x578691[_0xeb0d('0x25')][_0xeb0d('0x26')]===0x1f4){logger[_0xeb0d('0x25')](_0xeb0d('0x21'),_0x419ff0,_0x578691[_0xeb0d('0x25')]['message']);return _0x3e2a4e(_0x578691['error'][_0xeb0d('0x27')]);}logger[_0xeb0d('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x419ff0,_0x578691['error'][_0xeb0d('0x27')]);return _0x16edcb(_0x578691[_0xeb0d('0x25')][_0xeb0d('0x27')]);}else{logger[_0xeb0d('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x419ff0,'request\x20sent');_0x16edcb(_0x578691['result']['message']);}})['catch'](function(_0x249b0a){logger['error'](_0xeb0d('0x21'),_0x419ff0,_0x249b0a);_0x3e2a4e(_0x249b0a);});});}function respondWithStatusCode(_0x37e2ae,_0x172390){_0x172390=_0x172390||0xcc;return function(_0x2698ea){if(_0x2698ea){return _0x37e2ae[_0xeb0d('0x28')](_0x172390);}return _0x37e2ae[_0xeb0d('0x29')](_0x172390)['end']();};}function respondWithResult(_0x1b1b7b,_0x4f9fae){_0x4f9fae=_0x4f9fae||0xc8;return function(_0x5ba3c4){if(_0x5ba3c4){return _0x1b1b7b['status'](_0x4f9fae)['json'](_0x5ba3c4);}};}function respondWithFilteredResult(_0x1cd5a1,_0x90da66){return function(_0x51a94c){if(_0x51a94c){var _0x193785=typeof _0x90da66[_0xeb0d('0x2a')]===_0xeb0d('0x2b')&&typeof _0x90da66[_0xeb0d('0x2c')]===_0xeb0d('0x2b');var _0x4f23c3=_0x51a94c[_0xeb0d('0x2d')];var _0x3e5f5a=_0x193785?0x0:_0x90da66['offset'];var _0x11fe0f=_0x193785?_0x51a94c[_0xeb0d('0x2d')]:_0x90da66[_0xeb0d('0x2a')]+_0x90da66['limit'];var _0x4e7242;if(_0x11fe0f>=_0x4f23c3){_0x11fe0f=_0x4f23c3;_0x4e7242=0xc8;}else{_0x4e7242=0xce;}_0x1cd5a1[_0xeb0d('0x29')](_0x4e7242);return _0x1cd5a1['set']('Content-Range',_0x3e5f5a+'-'+_0x11fe0f+'/'+_0x4f23c3)[_0xeb0d('0x2e')](_0x51a94c);}return null;};}function patchUpdates(_0x400837){return function(_0x58f4f9){try{jsonpatch[_0xeb0d('0x2f')](_0x58f4f9,_0x400837,!![]);}catch(_0x1828f4){return BPromise[_0xeb0d('0x30')](_0x1828f4);}return _0x58f4f9[_0xeb0d('0x31')]();};}function saveUpdates(_0x32f626,_0x5b8adb){return function(_0x1cc613){if(_0x1cc613){return _0x1cc613[_0xeb0d('0x32')](_0x32f626)['then'](function(_0x2a80ca){return _0x2a80ca;});}return null;};}function removeEntity(_0x2ca93f,_0x5f5523){return function(_0x4680f8){if(_0x4680f8){return _0x4680f8[_0xeb0d('0x33')]()[_0xeb0d('0x1f')](function(){_0x2ca93f[_0xeb0d('0x29')](0xcc)[_0xeb0d('0x34')]();});}};}function handleEntityNotFound(_0x5cbd73,_0xb8c6){return function(_0xf05bfa){if(!_0xf05bfa){_0x5cbd73[_0xeb0d('0x28')](0x194);}return _0xf05bfa;};}function handleError(_0x4da448,_0x53a987){_0x53a987=_0x53a987||0x1f4;return function(_0x4f2e01){logger[_0xeb0d('0x25')](_0x4f2e01[_0xeb0d('0x35')]);if(_0x4f2e01['name']){delete _0x4f2e01[_0xeb0d('0x36')];}_0x4da448[_0xeb0d('0x29')](_0x53a987)['send'](_0x4f2e01);};}exports['index']=function(_0x3cc160,_0x591d77){var _0x5754aa={},_0x35d833={},_0x4c24c9={'count':0x0,'rows':[]};var _0x1fedc1=_[_0xeb0d('0x37')](db[_0xeb0d('0x38')][_0xeb0d('0x39')],function(_0x109d36){return{'name':_0x109d36[_0xeb0d('0x3a')],'type':_0x109d36[_0xeb0d('0x3b')]['key']};});_0x35d833['model']=_[_0xeb0d('0x37')](_0x1fedc1,_0xeb0d('0x36'));_0x35d833[_0xeb0d('0x3c')]=_[_0xeb0d('0x3d')](_0x3cc160[_0xeb0d('0x3c')]);_0x35d833[_0xeb0d('0x3e')]=_[_0xeb0d('0x3f')](_0x35d833[_0xeb0d('0x40')],_0x35d833['query']);_0x5754aa[_0xeb0d('0x41')]=_[_0xeb0d('0x3f')](_0x35d833[_0xeb0d('0x40')],qs[_0xeb0d('0x42')](_0x3cc160[_0xeb0d('0x3c')][_0xeb0d('0x42')]));_0x5754aa[_0xeb0d('0x41')]=_0x5754aa[_0xeb0d('0x41')][_0xeb0d('0x43')]?_0x5754aa['attributes']:_0x35d833[_0xeb0d('0x40')];if(!_0x3cc160[_0xeb0d('0x3c')][_0xeb0d('0x44')](_0xeb0d('0x45'))){_0x5754aa[_0xeb0d('0x2c')]=qs[_0xeb0d('0x2c')](_0x3cc160[_0xeb0d('0x3c')][_0xeb0d('0x2c')]);_0x5754aa[_0xeb0d('0x2a')]=qs[_0xeb0d('0x2a')](_0x3cc160[_0xeb0d('0x3c')][_0xeb0d('0x2a')]);}_0x5754aa['order']=qs['sort'](_0x3cc160[_0xeb0d('0x3c')]['sort']);_0x5754aa[_0xeb0d('0x46')]=qs[_0xeb0d('0x3e')](_[_0xeb0d('0x47')](_0x3cc160[_0xeb0d('0x3c')],_0x35d833['filters']),_0x1fedc1);if(_0x3cc160['query'][_0xeb0d('0x48')]){_0x5754aa[_0xeb0d('0x46')]=_[_0xeb0d('0x49')](_0x5754aa[_0xeb0d('0x46')],{'$or':_[_0xeb0d('0x37')](_0x1fedc1,function(_0x58407e){if(_0x58407e[_0xeb0d('0x3b')]!==_0xeb0d('0x4a')){var _0x451945={};_0x451945[_0x58407e[_0xeb0d('0x36')]]={'$like':'%'+_0x3cc160['query']['filter']+'%'};return _0x451945;}})});}_0x5754aa=_[_0xeb0d('0x49')]({},_0x5754aa,_0x3cc160[_0xeb0d('0x4b')]);var _0x18719c={'where':_0x5754aa['where']};return db[_0xeb0d('0x38')][_0xeb0d('0x2d')](_0x18719c)[_0xeb0d('0x1f')](function(_0x50245f){_0x4c24c9[_0xeb0d('0x2d')]=_0x50245f;if(_0x3cc160[_0xeb0d('0x3c')]['includeAll']){_0x5754aa[_0xeb0d('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xeb0d('0x4d')](_0x5754aa);})[_0xeb0d('0x1f')](function(_0x3b22ee){_0x4c24c9['rows']=_0x3b22ee;return _0x4c24c9;})['then'](respondWithFilteredResult(_0x591d77,_0x5754aa))['catch'](handleError(_0x591d77,null));};exports[_0xeb0d('0x4e')]=function(_0x266eb2,_0x52dcf7){var _0x2018d1={'raw':!![],'where':{'id':_0x266eb2[_0xeb0d('0x4f')]['id']}},_0x50ef30={};_0x50ef30['model']=_[_0xeb0d('0x3d')](db[_0xeb0d('0x38')][_0xeb0d('0x39')]);_0x50ef30[_0xeb0d('0x3c')]=_['keys'](_0x266eb2['query']);_0x50ef30[_0xeb0d('0x3e')]=_[_0xeb0d('0x3f')](_0x50ef30[_0xeb0d('0x40')],_0x50ef30[_0xeb0d('0x3c')]);_0x2018d1[_0xeb0d('0x41')]=_[_0xeb0d('0x3f')](_0x50ef30['model'],qs[_0xeb0d('0x42')](_0x266eb2[_0xeb0d('0x3c')][_0xeb0d('0x42')]));_0x2018d1[_0xeb0d('0x41')]=_0x2018d1[_0xeb0d('0x41')][_0xeb0d('0x43')]?_0x2018d1[_0xeb0d('0x41')]:_0x50ef30[_0xeb0d('0x40')];if(_0x266eb2[_0xeb0d('0x3c')][_0xeb0d('0x50')]){_0x2018d1[_0xeb0d('0x4c')]=[{'all':!![]}];}_0x2018d1=_[_0xeb0d('0x49')]({},_0x2018d1,_0x266eb2[_0xeb0d('0x4b')]);return db[_0xeb0d('0x38')][_0xeb0d('0x51')](_0x2018d1)['then'](handleEntityNotFound(_0x52dcf7,null))[_0xeb0d('0x1f')](respondWithResult(_0x52dcf7,null))[_0xeb0d('0x52')](handleError(_0x52dcf7,null));};exports[_0xeb0d('0x53')]=function(_0x2133d4,_0x4d5963){return db[_0xeb0d('0x38')]['create'](_0x2133d4[_0xeb0d('0x54')],{})['then'](respondWithResult(_0x4d5963,0xc9))[_0xeb0d('0x52')](handleError(_0x4d5963,null));};exports[_0xeb0d('0x32')]=function(_0x35fa1b,_0x5bb787){if(_0x35fa1b['body']['id']){delete _0x35fa1b['body']['id'];}return db[_0xeb0d('0x38')][_0xeb0d('0x51')]({'where':{'id':_0x35fa1b['params']['id']}})[_0xeb0d('0x1f')](handleEntityNotFound(_0x5bb787,null))[_0xeb0d('0x1f')](saveUpdates(_0x35fa1b[_0xeb0d('0x54')],null))[_0xeb0d('0x1f')](respondWithResult(_0x5bb787,null))[_0xeb0d('0x52')](handleError(_0x5bb787,null));};exports[_0xeb0d('0x33')]=function(_0x191623,_0x3f6d83){return db['WhatsappMessage'][_0xeb0d('0x51')]({'where':{'id':_0x191623[_0xeb0d('0x4f')]['id']}})[_0xeb0d('0x1f')](handleEntityNotFound(_0x3f6d83,null))[_0xeb0d('0x1f')](removeEntity(_0x3f6d83,null))[_0xeb0d('0x52')](handleError(_0x3f6d83,null));};exports[_0xeb0d('0x55')]=function(_0x2b12b3,_0x1e8b59){return db[_0xeb0d('0x38')]['describe']()[_0xeb0d('0x1f')](respondWithResult(_0x1e8b59,null))['catch'](handleError(_0x1e8b59,null));};var interaction_log=require(_0xeb0d('0x12'))(_0xeb0d('0x56'));exports[_0xeb0d('0x57')]=function(_0x365a1c,_0x35e1b3,_0x526289){var _0x83c0c7={'agent':{},'channel':_0xeb0d('0x58')};if(_0x365a1c[_0xeb0d('0x54')]['id']){delete _0x365a1c[_0xeb0d('0x54')]['id'];}_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x59')]=!![];_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x5a')]=moment()['format'](_0xeb0d('0x5b'));_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x5c')]=_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x5c')]||_0x365a1c[_0xeb0d('0x5d')]['id'];_0x83c0c7[_0xeb0d('0x5e')]['id']=_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x5c')];return db['WhatsappMessage'][_0xeb0d('0x51')]({'where':{'id':_0x365a1c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35e1b3,null))[_0xeb0d('0x1f')](saveUpdates(_0x365a1c['body'],null))[_0xeb0d('0x1f')](function(_0x5d440d){if(_0x5d440d){_0x83c0c7['message']=_0x5d440d[_0xeb0d('0x5f')]({'plain':!![]});return db[_0xeb0d('0x60')][_0xeb0d('0x51')]({'where':{'id':_0x5d440d[_0xeb0d('0x61')]}});}return null;})[_0xeb0d('0x1f')](handleEntityNotFound(_0x35e1b3,null))[_0xeb0d('0x1f')](function(_0x26c8b9){if(_0x26c8b9){return _0x26c8b9[_0xeb0d('0x32')]({'UserId':_0x365a1c[_0xeb0d('0x54')][_0xeb0d('0x5c')],'read1stAt':_[_0xeb0d('0x62')](_0x26c8b9['read1stAt'])?moment()[_0xeb0d('0x63')](_0xeb0d('0x5b')):undefined});}return null;})['then'](function(_0x80a3c4){if(_0x80a3c4){_0x83c0c7[_0xeb0d('0x64')]=_0x80a3c4['get']({'plain':!![]});interaction_log[_0xeb0d('0x20')](_0xeb0d('0x65'),_0x365a1c['user']['id'],_0x365a1c[_0xeb0d('0x5d')][_0xeb0d('0x36')],_0x365a1c[_0xeb0d('0x5d')][_0xeb0d('0x66')],_0x83c0c7[_0xeb0d('0x64')]['id'],_0x365a1c[_0xeb0d('0x54')]?JSON[_0xeb0d('0x67')](_0x365a1c['body']):_0xeb0d('0x68'));return respondWithRpcPromise(_0xeb0d('0x69'),_0xeb0d('0x6a'),_0x83c0c7);}return null;})[_0xeb0d('0x1f')](function(_0xd2529a){var _0x5dd398=_0xeb0d('0x6b')+_0xd2529a['message'][_0xeb0d('0x6c')];return db[_0xeb0d('0x6d')]['query'](_0x5dd398,{'type':db[_0xeb0d('0x6e')][_0xeb0d('0x6f')][_0xeb0d('0x70')],'raw':!![]})[_0xeb0d('0x1f')](function(_0x276b95){return _0x276b95;});})[_0xeb0d('0x1f')](function(_0x7e6b43){if(_0x7e6b43){_0x83c0c7[_0xeb0d('0x27')]['contact']=_0x7e6b43[0x0];if(!_0x365a1c['body']['UserId'])return;return db[_0xeb0d('0x71')]['find']({'where':{'id':_0x365a1c['body'][_0xeb0d('0x5c')],'role':_0xeb0d('0x5e')},'attributes':['id',_0xeb0d('0x36'),_0xeb0d('0x72'),_0xeb0d('0x73'),_0xeb0d('0x74')],'raw':!![]});}return null;})[_0xeb0d('0x1f')](function(_0x46dcf6){if(!_0x46dcf6)return null;_0x83c0c7[_0xeb0d('0x27')]['agent']=_0x46dcf6;return _0x83c0c7;})[_0xeb0d('0x1f')](function(_0x11edf5){if(_0x11edf5){if(_0x365a1c[_0xeb0d('0x54')]['manual']){_0x83c0c7['message'][_0xeb0d('0x75')]=util[_0xeb0d('0x63')](_0xeb0d('0x76'),_0x365a1c[_0xeb0d('0x5d')][_0xeb0d('0x36')]);_0x83c0c7[_0xeb0d('0x27')][_0xeb0d('0x77')]=_0x83c0c7[_0xeb0d('0x77')];_0x83c0c7[_0xeb0d('0x27')][_0xeb0d('0x78')]=_0x83c0c7['channel'];_0x83c0c7['message'][_0xeb0d('0x79')]=_0xeb0d('0x57');return respondWithRpcPromise(_0xeb0d('0x7a'),_0xeb0d('0x7a'),{'event':'acceptmessage','message':_0x83c0c7['message']},client9002)[_0xeb0d('0x1f')](function(){return _0x83c0c7;});}return _0x83c0c7;}return null;})[_0xeb0d('0x1f')](respondWithResult(_0x35e1b3,null))['catch'](handleError(_0x35e1b3,null));};var interaction_log=require(_0xeb0d('0x12'))(_0xeb0d('0x56'));exports[_0xeb0d('0x30')]=function(_0x28103a,_0x48a445,_0x4d0fec){var _0x399c1b={'agent':{},'channel':_0xeb0d('0x58')};if(_0x28103a[_0xeb0d('0x54')]['id']){delete _0x28103a[_0xeb0d('0x54')]['id'];}_0x28103a[_0xeb0d('0x54')][_0xeb0d('0x5c')]=_0x28103a['body'][_0xeb0d('0x5c')]||_0x28103a[_0xeb0d('0x5d')]['id'];_0x399c1b[_0xeb0d('0x5e')]['id']=_0x28103a['body']['UserId'];return db[_0xeb0d('0x38')]['find']({'where':{'id':_0x28103a[_0xeb0d('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48a445,null))[_0xeb0d('0x1f')](function(_0x4d0e7f){if(_0x4d0e7f){_0x399c1b[_0xeb0d('0x27')]=_0x4d0e7f[_0xeb0d('0x5f')]({'plain':!![]});return db[_0xeb0d('0x60')][_0xeb0d('0x51')]({'where':{'id':_0x4d0e7f['WhatsappInteractionId']}});}return null;})[_0xeb0d('0x1f')](handleEntityNotFound(_0x48a445,null))[_0xeb0d('0x1f')](function(_0x115ae3){if(_0x115ae3){_0x399c1b[_0xeb0d('0x64')]=_0x115ae3[_0xeb0d('0x5f')]({'plain':!![]});interaction_log[_0xeb0d('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28103a[_0xeb0d('0x5d')]['id'],_0x28103a[_0xeb0d('0x5d')][_0xeb0d('0x36')],_0x28103a[_0xeb0d('0x5d')][_0xeb0d('0x66')],_0x399c1b[_0xeb0d('0x64')]['id'],_0x28103a['body']?JSON[_0xeb0d('0x67')](_0x28103a[_0xeb0d('0x54')]):_0xeb0d('0x68'));return respondWithRpcPromise('RejectMessage',_0xeb0d('0x7b'),_0x399c1b);}return null;})[_0xeb0d('0x1f')](function(_0x100443){var _0x1860f3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x100443['message'][_0xeb0d('0x6c')];return db[_0xeb0d('0x6d')][_0xeb0d('0x3c')](_0x1860f3,{'type':db[_0xeb0d('0x6e')][_0xeb0d('0x6f')][_0xeb0d('0x70')],'raw':!![]})[_0xeb0d('0x1f')](function(_0x131113){return _0x131113;});})[_0xeb0d('0x1f')](function(_0xebec56){if(_0xebec56){_0x399c1b['message'][_0xeb0d('0x7c')]=_0xebec56[0x0];if(!_0x28103a[_0xeb0d('0x54')][_0xeb0d('0x5c')])return;return db[_0xeb0d('0x71')][_0xeb0d('0x51')]({'where':{'id':_0x28103a[_0xeb0d('0x54')][_0xeb0d('0x5c')],'role':_0xeb0d('0x5e')},'attributes':['id',_0xeb0d('0x36'),_0xeb0d('0x72'),_0xeb0d('0x73'),'internal'],'raw':!![]});}return null;})[_0xeb0d('0x1f')](function(_0x28acba){if(!_0x28acba)return null;_0x399c1b[_0xeb0d('0x27')][_0xeb0d('0x5e')]=_0x28acba;return _0x399c1b;})[_0xeb0d('0x1f')](function(_0x759977){if(_0x759977){_0x759977['message'][_0xeb0d('0x75')]=util['format'](_0xeb0d('0x76'),_0x28103a[_0xeb0d('0x5d')][_0xeb0d('0x36')]);_0x759977[_0xeb0d('0x27')][_0xeb0d('0x77')]=_0x399c1b[_0xeb0d('0x77')];_0x759977[_0xeb0d('0x27')][_0xeb0d('0x78')]=_0x399c1b[_0xeb0d('0x77')];_0x759977[_0xeb0d('0x27')][_0xeb0d('0x79')]=_0xeb0d('0x30');respondWithRpcPromise(_0xeb0d('0x7a'),_0xeb0d('0x7a'),{'event':'rejectmessage','message':_0x759977[_0xeb0d('0x27')]},client9002);return _0x399c1b;}return null;})[_0xeb0d('0x1f')](respondWithResult(_0x48a445,null))[_0xeb0d('0x52')](handleError(_0x48a445,null));};exports[_0xeb0d('0x29')]=function(_0x13581f,_0x130dad,_0x1a735b){if(_0x13581f[_0xeb0d('0x54')]['id']){delete _0x13581f[_0xeb0d('0x54')]['id'];}var _0x1f45e6;return db[_0xeb0d('0x38')][_0xeb0d('0x51')]({'where':{'id':_0x13581f[_0xeb0d('0x4f')]['id']}})[_0xeb0d('0x1f')](handleEntityNotFound(_0x130dad,null))[_0xeb0d('0x1f')](function(_0x559b99){if(_0x559b99){_0x1f45e6=_0x559b99;return db[_0xeb0d('0x7d')][_0xeb0d('0x51')]({'where':{'id':_0x559b99[_0xeb0d('0x7e')]}});}})[_0xeb0d('0x1f')](handleEntityNotFound(_0x130dad,null))[_0xeb0d('0x1f')](function(_0x50214f){if(_0x50214f){logger[_0xeb0d('0x23')](_0xeb0d('0x7f'),'status',_0xeb0d('0x80'),_0x50214f[_0xeb0d('0x3b')],util[_0xeb0d('0x81')](_0x13581f[_0xeb0d('0x54')],{'showHidden':![],'depth':null}));switch(_0x50214f[_0xeb0d('0x3b')]){case _0xeb0d('0x82'):if(_0x13581f[_0xeb0d('0x54')]['MessageSid']&&_0x13581f[_0xeb0d('0x54')]['MessageSid']===_0x1f45e6[_0xeb0d('0x83')]&&_0x13581f['body'][_0xeb0d('0x84')]&&_0x13581f['body']['MessageStatus']===_0xeb0d('0x59')){return _0x1f45e6[_0xeb0d('0x32')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xeb0d('0x29'),_0xeb0d('0x82'),util[_0xeb0d('0x81')](_0x13581f[_0xeb0d('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x1f45e6;}})['then'](respondWithResult(_0x130dad,null))[_0xeb0d('0x52')](handleError(_0x130dad,null));}; \ No newline at end of file +var _0x03fe=['redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','name','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','include','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','read','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','fullname','email','SIP/%s','event','rejectmessage','WhatsappAccount','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x59f1e6,_0xda13c5){var _0x2aada5=function(_0x5bf12c){while(--_0x5bf12c){_0x59f1e6['push'](_0x59f1e6['shift']());}};_0x2aada5(++_0xda13c5);}(_0x03fe,0x73));var _0xe03f=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0x03fe[_0x208b7a];return _0x37b7ec;};'use strict';var emlformat=require(_0xe03f('0x0'));var rimraf=require(_0xe03f('0x1'));var zipdir=require(_0xe03f('0x2'));var jsonpatch=require(_0xe03f('0x3'));var rp=require('request-promise');var moment=require(_0xe03f('0x4'));var BPromise=require(_0xe03f('0x5'));var Mustache=require('mustache');var util=require(_0xe03f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe03f('0x7'));var ejs=require(_0xe03f('0x8'));var fs=require('fs');var fs_extra=require(_0xe03f('0x9'));var _=require(_0xe03f('0xa'));var squel=require(_0xe03f('0xb'));var crypto=require('crypto');var jsforce=require(_0xe03f('0xc'));var deskjs=require(_0xe03f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe03f('0xe'));var Papa=require(_0xe03f('0xf'));var Redis=require(_0xe03f('0x10'));var authService=require(_0xe03f('0x11'));var qs=require(_0xe03f('0x12'));var as=require(_0xe03f('0x13'));var hardwareService=require(_0xe03f('0x14'));var logger=require(_0xe03f('0x15'))(_0xe03f('0x16'));var utils=require(_0xe03f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe03f('0x18'));var db=require(_0xe03f('0x19'))['db'];config[_0xe03f('0x1a')]=_[_0xe03f('0x1b')](config[_0xe03f('0x1a')],{'host':_0xe03f('0x1c'),'port':0x18eb});var socket=require(_0xe03f('0x1d'))(new Redis(config[_0xe03f('0x1a')]));require(_0xe03f('0x1e'))[_0xe03f('0x1f')](socket);var jayson=require(_0xe03f('0x20'));var client=jayson['client'][_0xe03f('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xe03f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4d9010,_0x4f9e8a,_0xe78195,_0x4e5ac4){return new BPromise(function(_0x3097e8,_0x485095){var _0x20a252=_0x4e5ac4||client;return _0x20a252[_0xe03f('0x22')](_0x4d9010,_0xe78195)[_0xe03f('0x23')](function(_0x9589ef){logger[_0xe03f('0x24')](_0xe03f('0x25'),_0x4f9e8a,_0xe03f('0x26'));logger[_0xe03f('0x27')](_0xe03f('0x28'),_0x4f9e8a,'request\x20sent',JSON[_0xe03f('0x29')](_0x9589ef));if(_0x9589ef['error']){if(_0x9589ef[_0xe03f('0x2a')][_0xe03f('0x2b')]===0x1f4){logger[_0xe03f('0x2a')](_0xe03f('0x25'),_0x4f9e8a,_0x9589ef['error'][_0xe03f('0x2c')]);return _0x485095(_0x9589ef['error']['message']);}logger[_0xe03f('0x2a')](_0xe03f('0x25'),_0x4f9e8a,_0x9589ef['error']['message']);return _0x3097e8(_0x9589ef[_0xe03f('0x2a')][_0xe03f('0x2c')]);}else{logger[_0xe03f('0x24')](_0xe03f('0x25'),_0x4f9e8a,'request\x20sent');_0x3097e8(_0x9589ef[_0xe03f('0x2d')][_0xe03f('0x2c')]);}})['catch'](function(_0xe46b8d){logger['error'](_0xe03f('0x25'),_0x4f9e8a,_0xe46b8d);_0x485095(_0xe46b8d);});});}function respondWithStatusCode(_0x5a9402,_0x5c475f){_0x5c475f=_0x5c475f||0xcc;return function(_0x26ba6e){if(_0x26ba6e){return _0x5a9402[_0xe03f('0x2e')](_0x5c475f);}return _0x5a9402['status'](_0x5c475f)[_0xe03f('0x2f')]();};}function respondWithResult(_0x413c06,_0x5d90b6){_0x5d90b6=_0x5d90b6||0xc8;return function(_0x204f88){if(_0x204f88){return _0x413c06[_0xe03f('0x30')](_0x5d90b6)[_0xe03f('0x31')](_0x204f88);}};}function respondWithFilteredResult(_0x5e88c5,_0x29a216){return function(_0xa1803){if(_0xa1803){var _0x11efe1=typeof _0x29a216['offset']===_0xe03f('0x32')&&typeof _0x29a216[_0xe03f('0x33')]==='undefined';var _0x3c8c43=_0xa1803[_0xe03f('0x34')];var _0x12b12e=_0x11efe1?0x0:_0x29a216[_0xe03f('0x35')];var _0x49a5fb=_0x11efe1?_0xa1803[_0xe03f('0x34')]:_0x29a216[_0xe03f('0x35')]+_0x29a216['limit'];var _0x5d4517;if(_0x49a5fb>=_0x3c8c43){_0x49a5fb=_0x3c8c43;_0x5d4517=0xc8;}else{_0x5d4517=0xce;}_0x5e88c5[_0xe03f('0x30')](_0x5d4517);return _0x5e88c5[_0xe03f('0x36')](_0xe03f('0x37'),_0x12b12e+'-'+_0x49a5fb+'/'+_0x3c8c43)[_0xe03f('0x31')](_0xa1803);}return null;};}function patchUpdates(_0x2eb7d4){return function(_0x20f789){try{jsonpatch[_0xe03f('0x38')](_0x20f789,_0x2eb7d4,!![]);}catch(_0x4296a5){return BPromise[_0xe03f('0x39')](_0x4296a5);}return _0x20f789[_0xe03f('0x3a')]();};}function saveUpdates(_0x407e35,_0x11ae90){return function(_0x2f61be){if(_0x2f61be){return _0x2f61be[_0xe03f('0x3b')](_0x407e35)['then'](function(_0x7d3b6d){return _0x7d3b6d;});}return null;};}function removeEntity(_0x1c6271,_0x5f4686){return function(_0x43d59d){if(_0x43d59d){return _0x43d59d[_0xe03f('0x3c')]()['then'](function(){_0x1c6271[_0xe03f('0x30')](0xcc)[_0xe03f('0x2f')]();});}};}function handleEntityNotFound(_0x105abe,_0x3eb69e){return function(_0x1d0015){if(!_0x1d0015){_0x105abe['sendStatus'](0x194);}return _0x1d0015;};}function handleError(_0x408d43,_0x37e982){_0x37e982=_0x37e982||0x1f4;return function(_0x2c20a8){logger[_0xe03f('0x2a')](_0x2c20a8[_0xe03f('0x3d')]);if(_0x2c20a8['name']){delete _0x2c20a8['name'];}_0x408d43[_0xe03f('0x30')](_0x37e982)[_0xe03f('0x3e')](_0x2c20a8);};}exports[_0xe03f('0x3f')]=function(_0x23abfe,_0x48e410){var _0x3d5676={},_0x3b9c36={},_0x38bd36={'count':0x0,'rows':[]};var _0x22d799=_[_0xe03f('0x40')](db[_0xe03f('0x41')][_0xe03f('0x42')],function(_0x82960a){return{'name':_0x82960a[_0xe03f('0x43')],'type':_0x82960a[_0xe03f('0x44')]['key']};});_0x3b9c36[_0xe03f('0x45')]=_[_0xe03f('0x40')](_0x22d799,_0xe03f('0x46'));_0x3b9c36['query']=_[_0xe03f('0x47')](_0x23abfe['query']);_0x3b9c36[_0xe03f('0x48')]=_['intersection'](_0x3b9c36[_0xe03f('0x45')],_0x3b9c36[_0xe03f('0x49')]);_0x3d5676[_0xe03f('0x4a')]=_[_0xe03f('0x4b')](_0x3b9c36[_0xe03f('0x45')],qs['fields'](_0x23abfe[_0xe03f('0x49')][_0xe03f('0x4c')]));_0x3d5676['attributes']=_0x3d5676['attributes'][_0xe03f('0x4d')]?_0x3d5676['attributes']:_0x3b9c36['model'];if(!_0x23abfe[_0xe03f('0x49')][_0xe03f('0x4e')](_0xe03f('0x4f'))){_0x3d5676[_0xe03f('0x33')]=qs[_0xe03f('0x33')](_0x23abfe[_0xe03f('0x49')][_0xe03f('0x33')]);_0x3d5676[_0xe03f('0x35')]=qs[_0xe03f('0x35')](_0x23abfe[_0xe03f('0x49')][_0xe03f('0x35')]);}_0x3d5676[_0xe03f('0x50')]=qs[_0xe03f('0x51')](_0x23abfe[_0xe03f('0x49')][_0xe03f('0x51')]);_0x3d5676[_0xe03f('0x52')]=qs[_0xe03f('0x48')](_[_0xe03f('0x53')](_0x23abfe[_0xe03f('0x49')],_0x3b9c36[_0xe03f('0x48')]),_0x22d799);if(_0x23abfe[_0xe03f('0x49')][_0xe03f('0x54')]){_0x3d5676[_0xe03f('0x52')]=_[_0xe03f('0x55')](_0x3d5676[_0xe03f('0x52')],{'$or':_[_0xe03f('0x40')](_0x22d799,function(_0x197e66){if(_0x197e66[_0xe03f('0x44')]!==_0xe03f('0x56')){var _0x41f1b9={};_0x41f1b9[_0x197e66[_0xe03f('0x46')]]={'$like':'%'+_0x23abfe['query']['filter']+'%'};return _0x41f1b9;}})});}_0x3d5676=_[_0xe03f('0x55')]({},_0x3d5676,_0x23abfe[_0xe03f('0x57')]);var _0x33cc83={'where':_0x3d5676[_0xe03f('0x52')]};return db[_0xe03f('0x41')]['count'](_0x33cc83)['then'](function(_0x5cfdcd){_0x38bd36[_0xe03f('0x34')]=_0x5cfdcd;if(_0x23abfe[_0xe03f('0x49')][_0xe03f('0x58')]){_0x3d5676['include']=[{'all':!![]}];}return db[_0xe03f('0x41')]['findAll'](_0x3d5676);})[_0xe03f('0x23')](function(_0x3093e4){_0x38bd36[_0xe03f('0x59')]=_0x3093e4;return _0x38bd36;})[_0xe03f('0x23')](respondWithFilteredResult(_0x48e410,_0x3d5676))[_0xe03f('0x5a')](handleError(_0x48e410,null));};exports['show']=function(_0x564ff4,_0x23e1b1){var _0x23e0c2={'raw':!![],'where':{'id':_0x564ff4['params']['id']}},_0xe53ffc={};_0xe53ffc['model']=_['keys'](db['WhatsappMessage'][_0xe03f('0x42')]);_0xe53ffc[_0xe03f('0x49')]=_[_0xe03f('0x47')](_0x564ff4[_0xe03f('0x49')]);_0xe53ffc[_0xe03f('0x48')]=_[_0xe03f('0x4b')](_0xe53ffc[_0xe03f('0x45')],_0xe53ffc['query']);_0x23e0c2[_0xe03f('0x4a')]=_[_0xe03f('0x4b')](_0xe53ffc['model'],qs[_0xe03f('0x4c')](_0x564ff4[_0xe03f('0x49')]['fields']));_0x23e0c2['attributes']=_0x23e0c2[_0xe03f('0x4a')][_0xe03f('0x4d')]?_0x23e0c2[_0xe03f('0x4a')]:_0xe53ffc[_0xe03f('0x45')];if(_0x564ff4[_0xe03f('0x49')][_0xe03f('0x58')]){_0x23e0c2[_0xe03f('0x5b')]=[{'all':!![]}];}_0x23e0c2=_[_0xe03f('0x55')]({},_0x23e0c2,_0x564ff4[_0xe03f('0x57')]);return db[_0xe03f('0x41')]['find'](_0x23e0c2)[_0xe03f('0x23')](handleEntityNotFound(_0x23e1b1,null))[_0xe03f('0x23')](respondWithResult(_0x23e1b1,null))['catch'](handleError(_0x23e1b1,null));};exports[_0xe03f('0x5c')]=function(_0x107129,_0x5dc397){return db[_0xe03f('0x41')]['create'](_0x107129['body'],{})['then'](respondWithResult(_0x5dc397,0xc9))[_0xe03f('0x5a')](handleError(_0x5dc397,null));};exports[_0xe03f('0x3b')]=function(_0x4c318d,_0xfa669a){if(_0x4c318d[_0xe03f('0x5d')]['id']){delete _0x4c318d[_0xe03f('0x5d')]['id'];}return db[_0xe03f('0x41')][_0xe03f('0x5e')]({'where':{'id':_0x4c318d[_0xe03f('0x5f')]['id']}})[_0xe03f('0x23')](handleEntityNotFound(_0xfa669a,null))['then'](saveUpdates(_0x4c318d[_0xe03f('0x5d')],null))['then'](respondWithResult(_0xfa669a,null))[_0xe03f('0x5a')](handleError(_0xfa669a,null));};exports[_0xe03f('0x3c')]=function(_0x54854f,_0x2a15d8){return db['WhatsappMessage']['find']({'where':{'id':_0x54854f[_0xe03f('0x5f')]['id']}})[_0xe03f('0x23')](handleEntityNotFound(_0x2a15d8,null))[_0xe03f('0x23')](removeEntity(_0x2a15d8,null))['catch'](handleError(_0x2a15d8,null));};exports[_0xe03f('0x60')]=function(_0x251c79,_0x511482){return db[_0xe03f('0x41')][_0xe03f('0x60')]()[_0xe03f('0x23')](respondWithResult(_0x511482,null))[_0xe03f('0x5a')](handleError(_0x511482,null));};var interaction_log=require('../../config/logger')(_0xe03f('0x61'));exports[_0xe03f('0x62')]=function(_0x42db76,_0xf98762,_0x20be8f){var _0x2a3787={'agent':{},'channel':_0xe03f('0x63')};if(_0x42db76[_0xe03f('0x5d')]['id']){delete _0x42db76[_0xe03f('0x5d')]['id'];}_0x42db76[_0xe03f('0x5d')][_0xe03f('0x64')]=!![];_0x42db76['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42db76[_0xe03f('0x5d')][_0xe03f('0x65')]=_0x42db76[_0xe03f('0x5d')]['UserId']||_0x42db76['user']['id'];_0x2a3787[_0xe03f('0x66')]['id']=_0x42db76[_0xe03f('0x5d')][_0xe03f('0x65')];return db[_0xe03f('0x41')][_0xe03f('0x5e')]({'where':{'id':_0x42db76[_0xe03f('0x5f')]['id'],'UserId':null}})[_0xe03f('0x23')](handleEntityNotFound(_0xf98762,null))[_0xe03f('0x23')](saveUpdates(_0x42db76['body'],null))[_0xe03f('0x23')](function(_0x14fcd5){if(_0x14fcd5){_0x2a3787['message']=_0x14fcd5[_0xe03f('0x67')]({'plain':!![]});return db[_0xe03f('0x68')][_0xe03f('0x5e')]({'where':{'id':_0x14fcd5[_0xe03f('0x69')]}});}return null;})[_0xe03f('0x23')](handleEntityNotFound(_0xf98762,null))['then'](function(_0x32c7b2){if(_0x32c7b2){return _0x32c7b2['update']({'UserId':_0x42db76[_0xe03f('0x5d')]['UserId'],'read1stAt':_['isNil'](_0x32c7b2[_0xe03f('0x6a')])?moment()[_0xe03f('0x6b')](_0xe03f('0x6c')):undefined});}return null;})['then'](function(_0xc7528){if(_0xc7528){_0x2a3787['interaction']=_0xc7528[_0xe03f('0x67')]({'plain':!![]});interaction_log['info'](_0xe03f('0x6d'),_0x42db76['user']['id'],_0x42db76[_0xe03f('0x6e')][_0xe03f('0x46')],_0x42db76['user']['role'],_0x2a3787[_0xe03f('0x6f')]['id'],_0x42db76[_0xe03f('0x5d')]?JSON['stringify'](_0x42db76[_0xe03f('0x5d')]):_0xe03f('0x70'));return respondWithRpcPromise(_0xe03f('0x71'),'acceptMessage',_0x2a3787);}return null;})[_0xe03f('0x23')](function(_0x5ac236){var _0x50a87d=_0xe03f('0x72')+_0x5ac236['message'][_0xe03f('0x73')];return db[_0xe03f('0x74')]['query'](_0x50a87d,{'type':db[_0xe03f('0x75')][_0xe03f('0x76')][_0xe03f('0x77')],'raw':!![]})[_0xe03f('0x23')](function(_0x329bc0){return _0x329bc0;});})[_0xe03f('0x23')](function(_0x2ef56f){if(_0x2ef56f){_0x2a3787[_0xe03f('0x2c')][_0xe03f('0x78')]=_0x2ef56f[0x0];if(!_0x42db76[_0xe03f('0x5d')]['UserId'])return;return db[_0xe03f('0x79')][_0xe03f('0x5e')]({'where':{'id':_0x42db76['body'][_0xe03f('0x65')],'role':_0xe03f('0x66')},'attributes':['id',_0xe03f('0x46'),'fullname','email',_0xe03f('0x7a')],'raw':!![]});}return null;})[_0xe03f('0x23')](function(_0x53e59e){if(!_0x53e59e)return null;_0x2a3787[_0xe03f('0x2c')][_0xe03f('0x66')]=_0x53e59e;return _0x2a3787;})['then'](function(_0x41c9a4){if(_0x41c9a4){if(_0x42db76[_0xe03f('0x5d')][_0xe03f('0x7b')]){_0x2a3787[_0xe03f('0x2c')][_0xe03f('0x7c')]=util[_0xe03f('0x6b')]('SIP/%s',_0x42db76[_0xe03f('0x6e')][_0xe03f('0x46')]);_0x2a3787[_0xe03f('0x2c')][_0xe03f('0x7d')]=_0x2a3787[_0xe03f('0x7d')];_0x2a3787[_0xe03f('0x2c')][_0xe03f('0x7e')]=_0x2a3787['channel'];_0x2a3787[_0xe03f('0x2c')]['event']=_0xe03f('0x62');return respondWithRpcPromise(_0xe03f('0x7f'),_0xe03f('0x7f'),{'event':'acceptmessage','message':_0x2a3787[_0xe03f('0x2c')]},client9002)['then'](function(){return _0x2a3787;});}return _0x2a3787;}return null;})[_0xe03f('0x23')](respondWithResult(_0xf98762,null))[_0xe03f('0x5a')](handleError(_0xf98762,null));};var interaction_log=require('../../config/logger')(_0xe03f('0x61'));exports[_0xe03f('0x39')]=function(_0xe9c26f,_0x2e1785,_0x5efed0){var _0x11f2f4={'agent':{},'channel':_0xe03f('0x63')};if(_0xe9c26f[_0xe03f('0x5d')]['id']){delete _0xe9c26f[_0xe03f('0x5d')]['id'];}_0xe9c26f['body'][_0xe03f('0x65')]=_0xe9c26f[_0xe03f('0x5d')][_0xe03f('0x65')]||_0xe9c26f[_0xe03f('0x6e')]['id'];_0x11f2f4['agent']['id']=_0xe9c26f[_0xe03f('0x5d')][_0xe03f('0x65')];return db[_0xe03f('0x41')][_0xe03f('0x5e')]({'where':{'id':_0xe9c26f[_0xe03f('0x5f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e1785,null))[_0xe03f('0x23')](function(_0x3f570d){if(_0x3f570d){_0x11f2f4[_0xe03f('0x2c')]=_0x3f570d[_0xe03f('0x67')]({'plain':!![]});return db[_0xe03f('0x68')][_0xe03f('0x5e')]({'where':{'id':_0x3f570d[_0xe03f('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x2e1785,null))['then'](function(_0x2b4ff6){if(_0x2b4ff6){_0x11f2f4[_0xe03f('0x6f')]=_0x2b4ff6[_0xe03f('0x67')]({'plain':!![]});interaction_log['info'](_0xe03f('0x80'),_0xe9c26f['user']['id'],_0xe9c26f[_0xe03f('0x6e')][_0xe03f('0x46')],_0xe9c26f[_0xe03f('0x6e')][_0xe03f('0x81')],_0x11f2f4[_0xe03f('0x6f')]['id'],_0xe9c26f[_0xe03f('0x5d')]?JSON[_0xe03f('0x29')](_0xe9c26f[_0xe03f('0x5d')]):_0xe03f('0x70'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x11f2f4);}return null;})['then'](function(_0x426656){var _0x1a3ade='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x426656[_0xe03f('0x2c')][_0xe03f('0x73')];return db[_0xe03f('0x74')][_0xe03f('0x49')](_0x1a3ade,{'type':db[_0xe03f('0x75')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe03f('0x23')](function(_0x36275e){return _0x36275e;});})[_0xe03f('0x23')](function(_0xaa9f61){if(_0xaa9f61){_0x11f2f4[_0xe03f('0x2c')][_0xe03f('0x78')]=_0xaa9f61[0x0];if(!_0xe9c26f[_0xe03f('0x5d')][_0xe03f('0x65')])return;return db['User']['find']({'where':{'id':_0xe9c26f[_0xe03f('0x5d')][_0xe03f('0x65')],'role':'agent'},'attributes':['id','name',_0xe03f('0x82'),_0xe03f('0x83'),'internal'],'raw':!![]});}return null;})[_0xe03f('0x23')](function(_0xeb4382){if(!_0xeb4382)return null;_0x11f2f4[_0xe03f('0x2c')][_0xe03f('0x66')]=_0xeb4382;return _0x11f2f4;})['then'](function(_0x32a7d9){if(_0x32a7d9){_0x32a7d9[_0xe03f('0x2c')][_0xe03f('0x7c')]=util[_0xe03f('0x6b')](_0xe03f('0x84'),_0xe9c26f[_0xe03f('0x6e')][_0xe03f('0x46')]);_0x32a7d9[_0xe03f('0x2c')][_0xe03f('0x7d')]=_0x11f2f4[_0xe03f('0x7d')];_0x32a7d9[_0xe03f('0x2c')]['motionChannel']=_0x11f2f4[_0xe03f('0x7d')];_0x32a7d9[_0xe03f('0x2c')][_0xe03f('0x85')]=_0xe03f('0x39');respondWithRpcPromise(_0xe03f('0x7f'),'EventManager',{'event':_0xe03f('0x86'),'message':_0x32a7d9[_0xe03f('0x2c')]},client9002);return _0x11f2f4;}return null;})[_0xe03f('0x23')](respondWithResult(_0x2e1785,null))['catch'](handleError(_0x2e1785,null));};exports[_0xe03f('0x30')]=function(_0x31cb0a,_0x407a61,_0x2ea67e){if(_0x31cb0a['body']['id']){delete _0x31cb0a[_0xe03f('0x5d')]['id'];}var _0x5f1cf0;return db[_0xe03f('0x41')][_0xe03f('0x5e')]({'where':{'id':_0x31cb0a['params']['id']}})[_0xe03f('0x23')](handleEntityNotFound(_0x407a61,null))[_0xe03f('0x23')](function(_0x1e43b4){if(_0x1e43b4){_0x5f1cf0=_0x1e43b4;return db[_0xe03f('0x87')][_0xe03f('0x5e')]({'where':{'id':_0x1e43b4['WhatsappAccountId']}});}})[_0xe03f('0x23')](handleEntityNotFound(_0x407a61,null))[_0xe03f('0x23')](function(_0x236651){if(_0x236651){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x236651[_0xe03f('0x44')],util['inspect'](_0x31cb0a[_0xe03f('0x5d')],{'showHidden':![],'depth':null}));switch(_0x236651[_0xe03f('0x44')]){case _0xe03f('0x88'):if(_0x31cb0a['body'][_0xe03f('0x89')]&&_0x31cb0a['body'][_0xe03f('0x89')]===_0x5f1cf0['messageId']&&_0x31cb0a[_0xe03f('0x5d')]['MessageStatus']&&_0x31cb0a[_0xe03f('0x5d')][_0xe03f('0x8a')]===_0xe03f('0x64')){return _0x5f1cf0[_0xe03f('0x3b')]({'read':!![]});}else{logger[_0xe03f('0x2a')](_0xe03f('0x8b'),'status',_0xe03f('0x88'),util[_0xe03f('0x8c')](_0x31cb0a[_0xe03f('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x5f1cf0;}})[_0xe03f('0x23')](respondWithResult(_0x407a61,null))[_0xe03f('0x5a')](handleError(_0x407a61,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6589237..0806763 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 _0xd757=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x22f6ad,_0xcf937f){var _0x413819=function(_0x549f2e){while(--_0x549f2e){_0x22f6ad['push'](_0x22f6ad['shift']());}};_0x413819(++_0xcf937f);}(_0xd757,0x1e5));var _0x7d75=function(_0x1a792a,_0x43a146){_0x1a792a=_0x1a792a-0x0;var _0x3a65ca=_0xd757[_0x1a792a];return _0x3a65ca;};'use strict';var EventEmitter=require(_0x7d75('0x0'));var WhatsappMessage=require(_0x7d75('0x1'))['db'][_0x7d75('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7d75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7d75('0x4')};function emitEvent(_0x2772a3){return function(_0x5e4a4c,_0xa7df66,_0x10d11a){WhatsappMessageEvents[_0x7d75('0x5')](_0x2772a3+':'+_0x5e4a4c['id'],_0x5e4a4c);WhatsappMessageEvents['emit'](_0x2772a3,_0x5e4a4c);_0x10d11a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x7d75('0x6')](e,emitEvent(event));}}module[_0x7d75('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x087b=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x24235f,_0x12ee7e){var _0x10cb40=function(_0x23723a){while(--_0x23723a){_0x24235f['push'](_0x24235f['shift']());}};_0x10cb40(++_0x12ee7e);}(_0x087b,0x11a));var _0xb087=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x087b[_0x47aa64];return _0x549c7a;};'use strict';var EventEmitter=require(_0xb087('0x0'));var WhatsappMessage=require(_0xb087('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb087('0x2'),'afterUpdate':'update','afterDestroy':_0xb087('0x3')};function emitEvent(_0x2020b7){return function(_0x1d3299,_0xf1cf84,_0x183efd){WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7+':'+_0x1d3299['id'],_0x1d3299);WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7,_0x1d3299);_0x183efd(null);};}for(var e in events){if(events[_0xb087('0x5')](e)){var event=events[e];WhatsappMessage[_0xb087('0x6')](e,emitEvent(event));}}module[_0xb087('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 9849b69..ea9ce3e 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 _0xc2df=['createdAt','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','then','update'];(function(_0xf3ae5e,_0x385757){var _0x353c92=function(_0x39670f){while(--_0x39670f){_0xf3ae5e['push'](_0xf3ae5e['shift']());}};_0x353c92(++_0x385757);}(_0xc2df,0x197));var _0xfc2d=function(_0x4abb4a,_0x34125e){_0x4abb4a=_0x4abb4a-0x0;var _0x5b7d21=_0xc2df[_0x4abb4a];return _0x5b7d21;};'use strict';var _=require(_0xfc2d('0x0'));var util=require(_0xfc2d('0x1'));var logger=require('../../config/logger')(_0xfc2d('0x2'));var moment=require(_0xfc2d('0x3'));var BPromise=require(_0xfc2d('0x4'));var rp=require(_0xfc2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc2d('0x6'));var config=require(_0xfc2d('0x7'));var attributes=require(_0xfc2d('0x8'));module['exports']=function(_0x2ad876,_0x501529){return _0x2ad876['define'](_0xfc2d('0x9'),attributes,{'tableName':_0xfc2d('0xa'),'paranoid':![],'indexes':[{'name':_0xfc2d('0xb'),'fields':[_0xfc2d('0xb')]},{'name':_0xfc2d('0xc'),'fields':[_0xfc2d('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc5821,_0x47c23c,_0x3dceeb){var _0x3f78c0=_0x2ad876[_0xfc2d('0xe')];var _0x149aa5=_0xc5821[_0xfc2d('0xf')]({'plain':!![]});if(_0x149aa5['direction']['toLowerCase']()==='in'||_0x149aa5[_0xfc2d('0x10')][_0xfc2d('0x11')]()===_0xfc2d('0x12')&&!_0x149aa5[_0xfc2d('0x13')]&&!_['isNil'](_0x149aa5[_0xfc2d('0x14')])){_0x3f78c0[_0xfc2d('0x15')][_0xfc2d('0x16')]({'where':{'id':_0x149aa5['WhatsappInteractionId']}})[_0xfc2d('0x17')](function(_0x1a978f){if(_0x1a978f){_0x1a978f[_0xfc2d('0x18')]({'lastMsgAt':_0x149aa5[_0xfc2d('0x19')],'lastMsgDirection':_0x149aa5[_0xfc2d('0x10')][_0xfc2d('0x11')]()});}})['catch'](function(_0xf9aa6f){console['error'](_0xf9aa6f);});}if(_0x149aa5[_0xfc2d('0x10')]==='out'&&!_0x149aa5[_0xfc2d('0x13')]){var _0x17f4fe;_0x3f78c0['WhatsappAccount'][_0xfc2d('0x1a')]({'where':{'id':_0x149aa5[_0xfc2d('0x1b')]},'raw':!![]})[_0xfc2d('0x17')](function(_0x4c6fc4){_0x17f4fe=_0x4c6fc4;if(_0x17f4fe&&_0x17f4fe[_0xfc2d('0x1c')]){switch(_0x17f4fe['type']){case _0xfc2d('0x1d'):var _0x3ba431=require('twilio');if(_0x17f4fe[_0xfc2d('0x1e')]&&_0x17f4fe['authToken']&&_0x17f4fe[_0xfc2d('0x1f')]){var _0x23579d=new _0x3ba431(_0x17f4fe[_0xfc2d('0x1e')],_0x17f4fe[_0xfc2d('0x20')]);_0x23579d[_0xfc2d('0x21')][_0xfc2d('0x22')]({'body':_0x149aa5[_0xfc2d('0xd')],'to':'whatsapp:'+_0x149aa5[_0xfc2d('0x1f')],'from':_0xfc2d('0x23')+_0x17f4fe['phone'],'statusCallback':_0x17f4fe[_0xfc2d('0x24')]+_0xfc2d('0x25')+_0x149aa5['id']+_0xfc2d('0x26')+_0x17f4fe[_0xfc2d('0x27')]})[_0xfc2d('0x17')](function(_0x293e8f){if(_0x293e8f[_0xfc2d('0x28')]){return _0xc5821[_0xfc2d('0x18')]({'messageId':_0x293e8f[_0xfc2d('0x28')]});}})[_0xfc2d('0x29')](function(_0x5972f5){logger['error'](_0xfc2d('0x2a'),_0xfc2d('0x2b'),_0xfc2d('0x1d'),util[_0xfc2d('0x2c')](_0x5972f5,{'showHidden':![],'depth':null}));});}else{logger[_0xfc2d('0x2d')](_0xfc2d('0x2a'),_0xfc2d('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x3dceeb();});}else{_0x3dceeb();}}},'charset':_0xfc2d('0x2e'),'collate':_0xfc2d('0x2f')});}; \ No newline at end of file +var _0x5d4c=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','error','WhatsappAccount','type','twilio','accountSid','authToken','messages','create','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5d4c,0x1ba));var _0xc5d4=function(_0x57f610,_0x1c8cd8){_0x57f610=_0x57f610-0x0;var _0x543f1f=_0x5d4c[_0x57f610];return _0x543f1f;};'use strict';var _=require(_0xc5d4('0x0'));var util=require(_0xc5d4('0x1'));var logger=require('../../config/logger')(_0xc5d4('0x2'));var moment=require(_0xc5d4('0x3'));var BPromise=require(_0xc5d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5d4('0x5'));var rimraf=require('rimraf');var config=require(_0xc5d4('0x6'));var attributes=require(_0xc5d4('0x7'));module[_0xc5d4('0x8')]=function(_0x368c78,_0x1c5fe5){return _0x368c78['define'](_0xc5d4('0x9'),attributes,{'tableName':_0xc5d4('0xa'),'paranoid':![],'indexes':[{'name':_0xc5d4('0xb'),'fields':[_0xc5d4('0xb')]},{'name':_0xc5d4('0xc'),'fields':['body'],'type':_0xc5d4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b14fb,_0x5da740,_0x436186){var _0x1f8a79=_0x368c78[_0xc5d4('0xe')];var _0x1d8821=_0x4b14fb['get']({'plain':!![]});if(_0x1d8821['direction'][_0xc5d4('0xf')]()==='in'||_0x1d8821[_0xc5d4('0x10')][_0xc5d4('0xf')]()===_0xc5d4('0x11')&&!_0x1d8821[_0xc5d4('0x12')]&&!_[_0xc5d4('0x13')](_0x1d8821[_0xc5d4('0x14')])){_0x1f8a79[_0xc5d4('0x15')][_0xc5d4('0x16')]({'where':{'id':_0x1d8821['WhatsappInteractionId']}})[_0xc5d4('0x17')](function(_0x180a77){if(_0x180a77){_0x180a77[_0xc5d4('0x18')]({'lastMsgAt':_0x1d8821[_0xc5d4('0x19')],'lastMsgDirection':_0x1d8821['direction'][_0xc5d4('0xf')]()});}})[_0xc5d4('0x1a')](function(_0x47946b){console[_0xc5d4('0x1b')](_0x47946b);});}if(_0x1d8821['direction']===_0xc5d4('0x11')&&!_0x1d8821['secret']){var _0x2aada1;_0x1f8a79[_0xc5d4('0x1c')]['find']({'where':{'id':_0x1d8821['WhatsappAccountId']},'raw':!![]})['then'](function(_0x4707d8){_0x2aada1=_0x4707d8;if(_0x2aada1&&_0x2aada1[_0xc5d4('0x1d')]){switch(_0x2aada1[_0xc5d4('0x1d')]){case'twilio':var _0x150489=require(_0xc5d4('0x1e'));if(_0x2aada1[_0xc5d4('0x1f')]&&_0x2aada1['authToken']&&_0x2aada1['phone']){var _0x55b2ac=new _0x150489(_0x2aada1[_0xc5d4('0x1f')],_0x2aada1[_0xc5d4('0x20')]);_0x55b2ac[_0xc5d4('0x21')][_0xc5d4('0x22')]({'body':_0x1d8821[_0xc5d4('0x23')],'to':_0xc5d4('0x24')+_0x1d8821[_0xc5d4('0x25')],'from':_0xc5d4('0x24')+_0x2aada1['phone'],'statusCallback':_0x2aada1[_0xc5d4('0x26')]+_0xc5d4('0x27')+_0x1d8821['id']+_0xc5d4('0x28')+_0x2aada1[_0xc5d4('0x29')]})[_0xc5d4('0x17')](function(_0x553fe2){if(_0x553fe2[_0xc5d4('0x2a')]){return _0x4b14fb[_0xc5d4('0x18')]({'messageId':_0x553fe2[_0xc5d4('0x2a')]});}})[_0xc5d4('0x1a')](function(_0x444442){logger[_0xc5d4('0x1b')](_0xc5d4('0x2b'),_0xc5d4('0x2c'),_0xc5d4('0x1e'),util[_0xc5d4('0x2d')](_0x444442,{'showHidden':![],'depth':null}));});}else{logger[_0xc5d4('0x1b')](_0xc5d4('0x2b'),'afterCreate',_0xc5d4('0x1e'),_0xc5d4('0x2e'));}break;}}})['finally'](function(){_0x436186();});}else{_0x436186();}}},'charset':_0xc5d4('0x2f'),'collate':_0xc5d4('0x30')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 8dd9c1d..4d60f8b 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 _0xfa61=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','CreateWhatsappMessage','WhatsappMessage','body','raw','then','debug','stringify','catch','util','randomstring'];(function(_0x5f3599,_0x44533a){var _0x57a673=function(_0x18cc92){while(--_0x18cc92){_0x5f3599['push'](_0x5f3599['shift']());}};_0x57a673(++_0x44533a);}(_0xfa61,0x12a));var _0x1fa6=function(_0x1df202,_0x2f0e8b){_0x1df202=_0x1df202-0x0;var _0x4566b2=_0xfa61[_0x1df202];return _0x4566b2;};'use strict';var _=require('lodash');var util=require(_0x1fa6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1fa6('0x1'));var fs=require('fs');var Redis=require(_0x1fa6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fa6('0x3'));var logger=require('../../config/logger')(_0x1fa6('0x4'));var config=require(_0x1fa6('0x5'));var jayson=require(_0x1fa6('0x6'));var client=jayson[_0x1fa6('0x7')]['http']({'port':0x232a});config[_0x1fa6('0x8')]=_[_0x1fa6('0x9')](config['redis'],{'host':_0x1fa6('0xa'),'port':0x18eb});var socket=require(_0x1fa6('0xb'))(new Redis(config[_0x1fa6('0x8')]));require(_0x1fa6('0xc'))[_0x1fa6('0xd')](socket);function respondWithRpcPromise(_0x956eca,_0x357068,_0x5297ce){return new BPromise(function(_0x23be43,_0x10e51a){return client[_0x1fa6('0xe')](_0x956eca,_0x5297ce)['then'](function(_0x21b202){logger['info'](_0x1fa6('0xf'),_0x357068,'request\x20sent');logger['debug'](_0x1fa6('0x10'),_0x357068,_0x1fa6('0x11'),JSON['stringify'](_0x21b202));if(_0x21b202[_0x1fa6('0x12')]){if(_0x21b202[_0x1fa6('0x12')][_0x1fa6('0x13')]===0x1f4){logger[_0x1fa6('0x12')](_0x1fa6('0xf'),_0x357068,_0x21b202['error'][_0x1fa6('0x14')]);return _0x10e51a(_0x21b202[_0x1fa6('0x12')][_0x1fa6('0x14')]);}logger[_0x1fa6('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x357068,_0x21b202['error'][_0x1fa6('0x14')]);return _0x23be43(_0x21b202['error'][_0x1fa6('0x14')]);}else{logger[_0x1fa6('0x15')](_0x1fa6('0xf'),_0x357068,_0x1fa6('0x11'));_0x23be43(_0x21b202['result'][_0x1fa6('0x14')]);}})['catch'](function(_0x1122bc){logger[_0x1fa6('0x12')](_0x1fa6('0xf'),_0x357068,_0x1122bc);_0x10e51a(_0x1122bc);});});}exports[_0x1fa6('0x16')]=function(_0x2347fc){var _0xc04462=this;return new Promise(function(_0x30011c,_0x5b414d){return db[_0x1fa6('0x17')]['create'](_0x2347fc[_0x1fa6('0x18')],{'raw':_0x2347fc['options']?_0x2347fc['options'][_0x1fa6('0x19')]===undefined?!![]:![]:!![]})[_0x1fa6('0x1a')](function(_0x149be6){logger[_0x1fa6('0x15')]('CreateWhatsappMessage',_0x2347fc);logger[_0x1fa6('0x1b')]('CreateWhatsappMessage',_0x2347fc,JSON[_0x1fa6('0x1c')](_0x149be6));_0x30011c(_0x149be6);})[_0x1fa6('0x1d')](function(_0x8d809b){logger[_0x1fa6('0x12')](_0x1fa6('0x16'),_0x8d809b[_0x1fa6('0x14')],_0x2347fc);_0x5b414d(_0xc04462[_0x1fa6('0x12')](0x1f4,_0x8d809b[_0x1fa6('0x14')]));});});}; \ No newline at end of file +var _0xa888=['socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost'];(function(_0xef4758,_0x18d0cf){var _0x483a67=function(_0x541956){while(--_0x541956){_0xef4758['push'](_0xef4758['shift']());}};_0x483a67(++_0x18d0cf);}(_0xa888,0xa8));var _0x8a88=function(_0x5b95f7,_0x312c80){_0x5b95f7=_0x5b95f7-0x0;var _0x4a4c7b=_0xa888[_0x5b95f7];return _0x4a4c7b;};'use strict';var _=require(_0x8a88('0x0'));var util=require(_0x8a88('0x1'));var moment=require('moment');var BPromise=require(_0x8a88('0x2'));var rs=require(_0x8a88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a88('0x5'))(_0x8a88('0x6'));var config=require(_0x8a88('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8a88('0x8')]['http']({'port':0x232a});config[_0x8a88('0x9')]=_[_0x8a88('0xa')](config[_0x8a88('0x9')],{'host':_0x8a88('0xb'),'port':0x18eb});var socket=require(_0x8a88('0xc'))(new Redis(config[_0x8a88('0x9')]));require(_0x8a88('0xd'))[_0x8a88('0xe')](socket);function respondWithRpcPromise(_0x10ad26,_0x2c50df,_0x559157){return new BPromise(function(_0xfa09db,_0xacee22){return client[_0x8a88('0xf')](_0x10ad26,_0x559157)['then'](function(_0xb951cb){logger[_0x8a88('0x10')](_0x8a88('0x11'),_0x2c50df,_0x8a88('0x12'));logger[_0x8a88('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2c50df,_0x8a88('0x12'),JSON[_0x8a88('0x14')](_0xb951cb));if(_0xb951cb[_0x8a88('0x15')]){if(_0xb951cb[_0x8a88('0x15')]['code']===0x1f4){logger[_0x8a88('0x15')](_0x8a88('0x11'),_0x2c50df,_0xb951cb['error'][_0x8a88('0x16')]);return _0xacee22(_0xb951cb[_0x8a88('0x15')][_0x8a88('0x16')]);}logger[_0x8a88('0x15')](_0x8a88('0x11'),_0x2c50df,_0xb951cb[_0x8a88('0x15')][_0x8a88('0x16')]);return _0xfa09db(_0xb951cb['error'][_0x8a88('0x16')]);}else{logger[_0x8a88('0x10')](_0x8a88('0x11'),_0x2c50df,_0x8a88('0x12'));_0xfa09db(_0xb951cb['result'][_0x8a88('0x16')]);}})[_0x8a88('0x17')](function(_0x24bcaf){logger[_0x8a88('0x15')](_0x8a88('0x11'),_0x2c50df,_0x24bcaf);_0xacee22(_0x24bcaf);});});}exports[_0x8a88('0x18')]=function(_0x2ebf2d){var _0x2c3237=this;return new Promise(function(_0x11e481,_0x2a05a5){return db[_0x8a88('0x19')][_0x8a88('0x1a')](_0x2ebf2d['body'],{'raw':_0x2ebf2d[_0x8a88('0x1b')]?_0x2ebf2d[_0x8a88('0x1b')][_0x8a88('0x1c')]===undefined?!![]:![]:!![]})[_0x8a88('0x1d')](function(_0x4e2871){logger[_0x8a88('0x10')](_0x8a88('0x18'),_0x2ebf2d);logger[_0x8a88('0x13')](_0x8a88('0x18'),_0x2ebf2d,JSON[_0x8a88('0x14')](_0x4e2871));_0x11e481(_0x4e2871);})[_0x8a88('0x17')](function(_0x47ea92){logger[_0x8a88('0x15')](_0x8a88('0x18'),_0x47ea92['message'],_0x2ebf2d);_0x2a05a5(_0x2c3237[_0x8a88('0x15')](0x1f4,_0x47ea92[_0x8a88('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index cf97fa6..4883de6 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 _0xd34c=['removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','emit'];(function(_0x52d303,_0x26f460){var _0x42d1c6=function(_0x23d305){while(--_0x23d305){_0x52d303['push'](_0x52d303['shift']());}};_0x42d1c6(++_0x26f460);}(_0xd34c,0x1a0));var _0xcd34=function(_0x32ef5a,_0x38647a){_0x32ef5a=_0x32ef5a-0x0;var _0x31c603=_0xd34c[_0x32ef5a];return _0x31c603;};'use strict';var WhatsappMessageEvents=require(_0xcd34('0x0'));var events=[_0xcd34('0x1'),_0xcd34('0x2'),'update'];function createListener(_0x53f729,_0x184941){return function(_0x574327){_0x184941[_0xcd34('0x3')](_0x53f729,_0x574327);};}function removeListener(_0x434489,_0x37dfb4){return function(){WhatsappMessageEvents[_0xcd34('0x4')](_0x434489,_0x37dfb4);};}exports[_0xcd34('0x5')]=function(_0x5b4ff0){for(var _0x4aa41b=0x0,_0x306415=events['length'];_0x4aa41b<_0x306415;_0x4aa41b++){var _0x153079=events[_0x4aa41b];var _0x3dc7b4=createListener(_0xcd34('0x6')+_0x153079,_0x5b4ff0);WhatsappMessageEvents['on'](_0x153079,_0x3dc7b4);}}; \ No newline at end of file +var _0x28cc=['save','remove','update','emit','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x3c9577,_0x21f16e){var _0xd0f3ea=function(_0x1e9148){while(--_0x1e9148){_0x3c9577['push'](_0x3c9577['shift']());}};_0xd0f3ea(++_0x21f16e);}(_0x28cc,0x141));var _0xc28c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28cc[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappMessageEvents=require(_0xc28c('0x0'));var events=[_0xc28c('0x1'),_0xc28c('0x2'),_0xc28c('0x3')];function createListener(_0x42a1c3,_0x172b66){return function(_0x2b11a4){_0x172b66[_0xc28c('0x4')](_0x42a1c3,_0x2b11a4);};}function removeListener(_0x293202,_0x13aecf){return function(){WhatsappMessageEvents['removeListener'](_0x293202,_0x13aecf);};}exports['register']=function(_0x115e62){for(var _0x62b26f=0x0,_0x4aae9e=events[_0xc28c('0x5')];_0x62b26f<_0x4aae9e;_0x62b26f++){var _0x360ec7=events[_0x62b26f];var _0x39aed0=createListener(_0xc28c('0x6')+_0x360ec7,_0x115e62);WhatsappMessageEvents['on'](_0x360ec7,_0x39aed0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a488bf6..51e56fb 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 _0x9dac=['post','create','addTeams','put','/:id','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','./whatsappQueue.controller','get','index','describe','isAuthenticated','show','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x27c76e,_0x1b32e1){var _0x2f8028=function(_0x29ace9){while(--_0x29ace9){_0x27c76e['push'](_0x27c76e['shift']());}};_0x2f8028(++_0x1b32e1);}(_0x9dac,0x1a0));var _0xc9da=function(_0x133942,_0x1ba5a8){_0x133942=_0x133942-0x0;var _0x2706ac=_0x9dac[_0x133942];return _0x2706ac;};'use strict';var multer=require(_0xc9da('0x0'));var util=require(_0xc9da('0x1'));var path=require(_0xc9da('0x2'));var timeout=require(_0xc9da('0x3'));var express=require('express');var router=express[_0xc9da('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9da('0x5'));var controller=require(_0xc9da('0x6'));router[_0xc9da('0x7')]('/',auth['isAuthenticated'](),controller[_0xc9da('0x8')]);router[_0xc9da('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xc9da('0x9')]);router[_0xc9da('0x7')]('/:id',auth[_0xc9da('0xa')](),controller[_0xc9da('0xb')]);router[_0xc9da('0x7')]('/:id/members',auth[_0xc9da('0xa')](),controller[_0xc9da('0xc')]);router['get'](_0xc9da('0xd'),auth[_0xc9da('0xa')](),controller[_0xc9da('0xe')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc9da('0xf')]);router[_0xc9da('0x10')]('/',auth['isAuthenticated'](),controller[_0xc9da('0x11')]);router[_0xc9da('0x10')](_0xc9da('0xd'),auth[_0xc9da('0xa')](),controller[_0xc9da('0x12')]);router[_0xc9da('0x10')]('/:id/users',auth[_0xc9da('0xa')](),controller['addAgents']);router[_0xc9da('0x13')](_0xc9da('0x14'),auth[_0xc9da('0xa')](),controller[_0xc9da('0x15')]);router[_0xc9da('0x16')](_0xc9da('0x14'),auth['isAuthenticated'](),controller[_0xc9da('0x17')]);router[_0xc9da('0x16')]('/:id/teams',auth[_0xc9da('0xa')](),controller['removeTeams']);router[_0xc9da('0x16')](_0xc9da('0x18'),auth[_0xc9da('0xa')](),controller[_0xc9da('0x19')]);module[_0xc9da('0x1a')]=router; \ No newline at end of file +var _0x2524=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/teams','/:id/users','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express'];(function(_0x12558c,_0x1f0d3b){var _0x155607=function(_0x29ec08){while(--_0x29ec08){_0x12558c['push'](_0x12558c['shift']());}};_0x155607(++_0x1f0d3b);}(_0x2524,0x135));var _0x4252=function(_0x28d2e0,_0x15d176){_0x28d2e0=_0x28d2e0-0x0;var _0x1aaee5=_0x2524[_0x28d2e0];return _0x1aaee5;};'use strict';var multer=require('multer');var util=require(_0x4252('0x0'));var path=require(_0x4252('0x1'));var timeout=require('connect-timeout');var express=require(_0x4252('0x2'));var router=express[_0x4252('0x3')]();var fs_extra=require(_0x4252('0x4'));var auth=require(_0x4252('0x5'));var interaction=require(_0x4252('0x6'));var config=require(_0x4252('0x7'));var controller=require(_0x4252('0x8'));router[_0x4252('0x9')]('/',auth[_0x4252('0xa')](),controller[_0x4252('0xb')]);router['get'](_0x4252('0xc'),auth[_0x4252('0xa')](),controller['describe']);router[_0x4252('0x9')](_0x4252('0xd'),auth[_0x4252('0xa')](),controller[_0x4252('0xe')]);router['get']('/:id/members',auth[_0x4252('0xa')](),controller['getMembers']);router[_0x4252('0x9')](_0x4252('0xf'),auth[_0x4252('0xa')](),controller['getTeams']);router[_0x4252('0x9')](_0x4252('0x10'),auth[_0x4252('0xa')](),controller['getAgents']);router[_0x4252('0x11')]('/',auth[_0x4252('0xa')](),controller['create']);router['post'](_0x4252('0xf'),auth['isAuthenticated'](),controller[_0x4252('0x12')]);router['post'](_0x4252('0x10'),auth[_0x4252('0xa')](),controller[_0x4252('0x13')]);router['put']('/:id',auth[_0x4252('0xa')](),controller[_0x4252('0x14')]);router[_0x4252('0x15')](_0x4252('0xd'),auth[_0x4252('0xa')](),controller[_0x4252('0x16')]);router[_0x4252('0x15')](_0x4252('0xf'),auth[_0x4252('0xa')](),controller[_0x4252('0x17')]);router[_0x4252('0x15')](_0x4252('0x10'),auth['isAuthenticated'](),controller[_0x4252('0x18')]);module[_0x4252('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 c6a10c2..d1ad1ad 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 _0x688a=['STRING','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x24eca7,_0x41dae8){var _0x24c0f9=function(_0x4192ee){while(--_0x4192ee){_0x24eca7['push'](_0x24eca7['shift']());}};_0x24c0f9(++_0x41dae8);}(_0x688a,0x124));var _0xa688=function(_0x29e7ed,_0x4321cb){_0x29e7ed=_0x29e7ed-0x0;var _0x1fd32d=_0x688a[_0x29e7ed];return _0x1fd32d;};'use strict';var Sequelize=require(_0xa688('0x0'));module[_0xa688('0x1')]={'name':{'type':Sequelize[_0xa688('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa688('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa688('0x4'),_0xa688('0x5'),'roundrobin')},'description':{'type':Sequelize[_0xa688('0x2')]}}; \ No newline at end of file +var _0x4e34=['rrmemory','roundrobin','STRING','name'];(function(_0xfb473f,_0x1ca685){var _0x330953=function(_0x106e6c){while(--_0x106e6c){_0xfb473f['push'](_0xfb473f['shift']());}};_0x330953(++_0x1ca685);}(_0x4e34,0x19e));var _0x44e3=function(_0x1399fa,_0x112f28){_0x1399fa=_0x1399fa-0x0;var _0x5bc6ca=_0x4e34[_0x1399fa];return _0x5bc6ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x44e3('0x0')],'unique':_0x44e3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x44e3('0x2'),'beepall',_0x44e3('0x3'))},'description':{'type':Sequelize[_0x44e3('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 08e7dd2..585ae81 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 _0x3074=['moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','./whatsappQueue.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','whatsappPause','getTeams','findOne','addTeams','ids','voicePause','interface','flatMap','sequelize','forEach','userWhatsappQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','compact','value','transaction','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','request-promise'];(function(_0x27d1c4,_0x394f97){var _0x587bbf=function(_0x1e4082){while(--_0x1e4082){_0x27d1c4['push'](_0x27d1c4['shift']());}};_0x587bbf(++_0x394f97);}(_0x3074,0x113));var _0x4307=function(_0x37f304,_0x5e5e47){_0x37f304=_0x37f304-0x0;var _0x19a94c=_0x3074[_0x37f304];return _0x19a94c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4307('0x0'));var zipdir=require(_0x4307('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4307('0x2'));var moment=require(_0x4307('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4307('0x4'));var util=require('util');var path=require(_0x4307('0x5'));var sox=require(_0x4307('0x6'));var csv=require(_0x4307('0x7'));var ejs=require(_0x4307('0x8'));var fs=require('fs');var fs_extra=require(_0x4307('0x9'));var _=require(_0x4307('0xa'));var squel=require(_0x4307('0xb'));var crypto=require(_0x4307('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4307('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4307('0xe'));var Papa=require(_0x4307('0xf'));var Redis=require(_0x4307('0x10'));var authService=require(_0x4307('0x11'));var qs=require(_0x4307('0x12'));var as=require(_0x4307('0x13'));var hardwareService=require(_0x4307('0x14'));var logger=require(_0x4307('0x15'))(_0x4307('0x16'));var utils=require(_0x4307('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4307('0x18'));var db=require('../../mysqldb')['db'];config[_0x4307('0x19')]=_[_0x4307('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4307('0x19')]));require(_0x4307('0x1b'))['register'](socket);function respondWithStatusCode(_0x2613cf,_0x10b0b0){_0x10b0b0=_0x10b0b0||0xcc;return function(_0x1c4259){if(_0x1c4259){return _0x2613cf[_0x4307('0x1c')](_0x10b0b0);}return _0x2613cf['status'](_0x10b0b0)[_0x4307('0x1d')]();};}function respondWithResult(_0x4b9cdd,_0x11db4f){_0x11db4f=_0x11db4f||0xc8;return function(_0x4c136d){if(_0x4c136d){return _0x4b9cdd['status'](_0x11db4f)[_0x4307('0x1e')](_0x4c136d);}};}function respondWithFilteredResult(_0x5a26a1,_0x4fd20f){return function(_0x83c17){if(_0x83c17){var _0xe4ef55=typeof _0x4fd20f[_0x4307('0x1f')]===_0x4307('0x20')&&typeof _0x4fd20f[_0x4307('0x21')]===_0x4307('0x20');var _0x3e29fe=_0x83c17[_0x4307('0x22')];var _0x432335=_0xe4ef55?0x0:_0x4fd20f[_0x4307('0x1f')];var _0x391cf4=_0xe4ef55?_0x83c17['count']:_0x4fd20f[_0x4307('0x1f')]+_0x4fd20f[_0x4307('0x21')];var _0x1fe554;if(_0x391cf4>=_0x3e29fe){_0x391cf4=_0x3e29fe;_0x1fe554=0xc8;}else{_0x1fe554=0xce;}_0x5a26a1[_0x4307('0x23')](_0x1fe554);return _0x5a26a1[_0x4307('0x24')]('Content-Range',_0x432335+'-'+_0x391cf4+'/'+_0x3e29fe)['json'](_0x83c17);}return null;};}function patchUpdates(_0x56041d){return function(_0x2209ff){try{jsonpatch[_0x4307('0x25')](_0x2209ff,_0x56041d,!![]);}catch(_0x439957){return BPromise[_0x4307('0x26')](_0x439957);}return _0x2209ff[_0x4307('0x27')]();};}function saveUpdates(_0x30bd3d,_0x53d073){return function(_0x5e96a3){if(_0x5e96a3){return _0x5e96a3[_0x4307('0x28')](_0x30bd3d)[_0x4307('0x29')](function(_0x3d4ed9){return _0x3d4ed9;});}return null;};}function removeEntity(_0x12a9d0,_0x30afca){return function(_0x4fdde3){if(_0x4fdde3){return _0x4fdde3[_0x4307('0x2a')]()['then'](function(){var _0x42c189=_0x4fdde3[_0x4307('0x2b')]({'plain':!![]});var _0x2aa223='WhatsappQueues';return db[_0x4307('0x2c')][_0x4307('0x2a')]({'where':{'type':_0x2aa223,'resourceId':_0x42c189['id']}})[_0x4307('0x29')](function(){return _0x4fdde3;});})[_0x4307('0x29')](function(){_0x12a9d0[_0x4307('0x23')](0xcc)[_0x4307('0x1d')]();});}};}function handleEntityNotFound(_0x31cb75,_0x456361){return function(_0x3bc769){if(!_0x3bc769){_0x31cb75[_0x4307('0x1c')](0x194);}return _0x3bc769;};}function handleError(_0x4b7322,_0x1dd5fb){_0x1dd5fb=_0x1dd5fb||0x1f4;return function(_0x5c08e5){logger[_0x4307('0x2d')](_0x5c08e5[_0x4307('0x2e')]);if(_0x5c08e5[_0x4307('0x2f')]){delete _0x5c08e5[_0x4307('0x2f')];}_0x4b7322['status'](_0x1dd5fb)[_0x4307('0x30')](_0x5c08e5);};}exports[_0x4307('0x31')]=function(_0x426326,_0x5864cf){var _0x10502b={},_0x336c18={},_0x172589={'count':0x0,'rows':[]};var _0x2f865b=_[_0x4307('0x32')](db[_0x4307('0x33')]['rawAttributes'],function(_0x5378a6){return{'name':_0x5378a6[_0x4307('0x34')],'type':_0x5378a6[_0x4307('0x35')]['key']};});_0x336c18[_0x4307('0x36')]=_['map'](_0x2f865b,_0x4307('0x2f'));_0x336c18[_0x4307('0x37')]=_[_0x4307('0x38')](_0x426326[_0x4307('0x37')]);_0x336c18[_0x4307('0x39')]=_['intersection'](_0x336c18[_0x4307('0x36')],_0x336c18[_0x4307('0x37')]);_0x10502b['attributes']=_[_0x4307('0x3a')](_0x336c18[_0x4307('0x36')],qs['fields'](_0x426326[_0x4307('0x37')][_0x4307('0x3b')]));_0x10502b[_0x4307('0x3c')]=_0x10502b[_0x4307('0x3c')][_0x4307('0x3d')]?_0x10502b['attributes']:_0x336c18[_0x4307('0x36')];if(!_0x426326[_0x4307('0x37')][_0x4307('0x3e')](_0x4307('0x3f'))){_0x10502b[_0x4307('0x21')]=qs['limit'](_0x426326['query'][_0x4307('0x21')]);_0x10502b[_0x4307('0x1f')]=qs[_0x4307('0x1f')](_0x426326[_0x4307('0x37')][_0x4307('0x1f')]);}_0x10502b[_0x4307('0x40')]=qs[_0x4307('0x41')](_0x426326['query'][_0x4307('0x41')]);_0x10502b[_0x4307('0x42')]=qs['filters'](_[_0x4307('0x43')](_0x426326[_0x4307('0x37')],_0x336c18['filters']),_0x2f865b);if(_0x426326[_0x4307('0x37')][_0x4307('0x44')]){_0x10502b[_0x4307('0x42')]=_[_0x4307('0x45')](_0x10502b[_0x4307('0x42')],{'$or':_[_0x4307('0x32')](_0x2f865b,function(_0x340791){if(_0x340791[_0x4307('0x35')]!==_0x4307('0x46')){var _0x45b619={};_0x45b619[_0x340791[_0x4307('0x2f')]]={'$like':'%'+_0x426326[_0x4307('0x37')][_0x4307('0x44')]+'%'};return _0x45b619;}})});}_0x10502b=_[_0x4307('0x45')]({},_0x10502b,_0x426326[_0x4307('0x47')]);var _0x5c50a0={'where':_0x10502b[_0x4307('0x42')]};return db['WhatsappQueue'][_0x4307('0x22')](_0x5c50a0)[_0x4307('0x29')](function(_0x114a90){_0x172589[_0x4307('0x22')]=_0x114a90;if(_0x426326[_0x4307('0x37')]['includeAll']){_0x10502b['include']=[{'all':!![]}];}return db[_0x4307('0x33')][_0x4307('0x48')](_0x10502b);})[_0x4307('0x29')](function(_0x477394){_0x172589[_0x4307('0x49')]=_0x477394;return _0x172589;})[_0x4307('0x29')](respondWithFilteredResult(_0x5864cf,_0x10502b))[_0x4307('0x4a')](handleError(_0x5864cf,null));};exports[_0x4307('0x4b')]=function(_0x3473d2,_0xabb74d){var _0x4e0987={'raw':!![],'where':{'id':_0x3473d2[_0x4307('0x4c')]['id']}},_0x5a5a8f={};_0x5a5a8f['model']=_[_0x4307('0x38')](db[_0x4307('0x33')][_0x4307('0x4d')]);_0x5a5a8f[_0x4307('0x37')]=_[_0x4307('0x38')](_0x3473d2[_0x4307('0x37')]);_0x5a5a8f[_0x4307('0x39')]=_[_0x4307('0x3a')](_0x5a5a8f[_0x4307('0x36')],_0x5a5a8f['query']);_0x4e0987[_0x4307('0x3c')]=_[_0x4307('0x3a')](_0x5a5a8f[_0x4307('0x36')],qs[_0x4307('0x3b')](_0x3473d2[_0x4307('0x37')][_0x4307('0x3b')]));_0x4e0987[_0x4307('0x3c')]=_0x4e0987[_0x4307('0x3c')][_0x4307('0x3d')]?_0x4e0987[_0x4307('0x3c')]:_0x5a5a8f['model'];if(_0x3473d2['query'][_0x4307('0x4e')]){_0x4e0987[_0x4307('0x4f')]=[{'all':!![]}];}_0x4e0987=_[_0x4307('0x45')]({},_0x4e0987,_0x3473d2['options']);return db[_0x4307('0x33')][_0x4307('0x50')](_0x4e0987)[_0x4307('0x29')](handleEntityNotFound(_0xabb74d,null))[_0x4307('0x29')](respondWithResult(_0xabb74d,null))[_0x4307('0x4a')](handleError(_0xabb74d,null));};exports[_0x4307('0x51')]=function(_0x3d0d50,_0x368575){return db[_0x4307('0x33')]['create'](_0x3d0d50['body'],{})[_0x4307('0x29')](function(_0x4c3761){var _0xa0442d=_0x3d0d50[_0x4307('0x52')][_0x4307('0x2b')]({'plain':!![]});if(!_0xa0442d)throw new Error(_0x4307('0x53'));if(_0xa0442d[_0x4307('0x54')]===_0x4307('0x52')){var _0x7321b3=_0x4c3761[_0x4307('0x2b')]({'plain':!![]});var _0x3e2da7=_0x4307('0x55');return db['UserProfileSection'][_0x4307('0x50')]({'where':{'name':_0x3e2da7,'userProfileId':_0xa0442d[_0x4307('0x56')]},'raw':!![]})[_0x4307('0x29')](function(_0x1bf0e8){if(_0x1bf0e8&&_0x1bf0e8[_0x4307('0x57')]===0x0){return db[_0x4307('0x2c')][_0x4307('0x51')]({'name':_0x7321b3[_0x4307('0x2f')],'resourceId':_0x7321b3['id'],'type':_0x1bf0e8[_0x4307('0x2f')],'sectionId':_0x1bf0e8['id']},{})[_0x4307('0x29')](function(){return _0x4c3761;});}else{return _0x4c3761;}})[_0x4307('0x4a')](function(_0x52dc89){logger[_0x4307('0x2d')](_0x4307('0x58'),_0x52dc89);throw _0x52dc89;});}return _0x4c3761;})[_0x4307('0x29')](respondWithResult(_0x368575,0xc9))[_0x4307('0x4a')](handleError(_0x368575,null));};exports[_0x4307('0x28')]=function(_0x5a24ba,_0x2fd71b){if(_0x5a24ba[_0x4307('0x59')]['id']){delete _0x5a24ba[_0x4307('0x59')]['id'];}return db[_0x4307('0x33')][_0x4307('0x50')]({'where':{'id':_0x5a24ba[_0x4307('0x4c')]['id']}})[_0x4307('0x29')](handleEntityNotFound(_0x2fd71b,null))[_0x4307('0x29')](saveUpdates(_0x5a24ba[_0x4307('0x59')],null))[_0x4307('0x29')](respondWithResult(_0x2fd71b,null))[_0x4307('0x4a')](handleError(_0x2fd71b,null));};exports[_0x4307('0x2a')]=function(_0x4cf840,_0xb1bcfb){return db[_0x4307('0x33')]['find']({'where':{'id':_0x4cf840[_0x4307('0x4c')]['id']}})[_0x4307('0x29')](handleEntityNotFound(_0xb1bcfb,null))[_0x4307('0x29')](removeEntity(_0xb1bcfb,null))['catch'](handleError(_0xb1bcfb,null));};exports['describe']=function(_0x538123,_0x5b678b){return db[_0x4307('0x33')][_0x4307('0x5a')]()['then'](respondWithResult(_0x5b678b,null))['catch'](handleError(_0x5b678b,null));};exports[_0x4307('0x5b')]=function(_0x584b1c,_0x50fd99,_0x1f00d4){var _0x43f34f={'raw':!![],'where':{}},_0x36eaab={},_0x29f97c;return db[_0x4307('0x33')]['findOne']({'where':{'id':_0x584b1c[_0x4307('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50fd99,null))[_0x4307('0x29')](function(_0x5defbd){if(_0x5defbd){_0x29f97c=_0x5defbd[_0x4307('0x2b')]({'plain':!![]});_0x36eaab[_0x4307('0x36')]=_[_0x4307('0x38')](db[_0x4307('0x5c')][_0x4307('0x4d')]);_0x36eaab['query']=_['keys'](_0x584b1c['query']);_0x36eaab[_0x4307('0x39')]=_['intersection'](_0x36eaab['model'],_0x36eaab[_0x4307('0x37')]);_0x43f34f[_0x4307('0x3c')]=_[_0x4307('0x3a')](_0x36eaab['model'],qs[_0x4307('0x3b')](_0x584b1c[_0x4307('0x37')][_0x4307('0x3b')]));_0x43f34f[_0x4307('0x3c')]=_0x43f34f['attributes'][_0x4307('0x3d')]?_0x43f34f[_0x4307('0x3c')]:_0x36eaab[_0x4307('0x36')];if(!_0x584b1c['query'][_0x4307('0x3e')](_0x4307('0x3f'))){_0x43f34f['limit']=qs[_0x4307('0x21')](_0x584b1c[_0x4307('0x37')]['limit']);_0x43f34f['offset']=qs['offset'](_0x584b1c[_0x4307('0x37')][_0x4307('0x1f')]);}_0x43f34f[_0x4307('0x40')]=qs['sort'](_0x584b1c[_0x4307('0x37')][_0x4307('0x41')]);_0x43f34f[_0x4307('0x42')]=qs['filters'](_[_0x4307('0x43')](_0x584b1c[_0x4307('0x37')],_0x36eaab[_0x4307('0x39')]));_0x43f34f[_0x4307('0x42')][_0x4307('0x5d')]=_0x5defbd['id'];if(_0x584b1c[_0x4307('0x37')][_0x4307('0x44')]){_0x43f34f[_0x4307('0x42')]=_['merge'](_0x43f34f[_0x4307('0x42')],{'$or':_[_0x4307('0x32')](_0x43f34f[_0x4307('0x3c')],function(_0x291461){var _0x32f07d={};_0x32f07d[_0x291461]={'$like':'%'+_0x584b1c[_0x4307('0x37')]['filter']+'%'};return _0x32f07d;})});}_0x43f34f=_[_0x4307('0x45')]({},_0x43f34f,_0x584b1c[_0x4307('0x47')]);return db[_0x4307('0x5c')][_0x4307('0x48')](_0x43f34f);}})[_0x4307('0x29')](function(_0x59a61d){if(_0x59a61d){return db[_0x4307('0x5e')][_0x4307('0x5f')]({'where':{'id':_['map'](_0x59a61d,'UserId'),'role':_0x4307('0x60')},'attributes':['id',_0x4307('0x2f'),'whatsappPause',_0x4307('0x61'),_0x4307('0x62')]});}})[_0x4307('0x29')](function(_0x4360ef){if(_0x4360ef){return{'count':_0x4360ef['count'],'rows':_['map'](_0x4360ef[_0x4307('0x49')],function(_0x38cb9a){return{'membername':_0x38cb9a[_0x4307('0x2f')],'UserId':_0x38cb9a['id'],'queue_name':_0x29f97c[_0x4307('0x2f')],'WhatsappQueueId':_0x29f97c['id'],'interface':util['format'](_0x4307('0x63'),_0x4307('0x64'),_0x38cb9a[_0x4307('0x2f')]),'penalty':0x0,'paused':_0x38cb9a[_0x4307('0x65')],'createdAt':_0x38cb9a['createdAt'],'updatedAt':_0x38cb9a[_0x4307('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4307('0x29')](respondWithFilteredResult(_0x50fd99,_0x43f34f))[_0x4307('0x4a')](handleError(_0x50fd99,null));};exports[_0x4307('0x66')]=function(_0x34fbd3,_0x5e2d18,_0x287d07){var _0xb4a203={};var _0xd41985={};var _0x2f0fa2;var _0x10d0f9;return db['WhatsappQueue'][_0x4307('0x67')]({'where':{'id':_0x34fbd3[_0x4307('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e2d18,null))[_0x4307('0x29')](function(_0xe8e531){if(_0xe8e531){_0x2f0fa2=_0xe8e531;_0xd41985[_0x4307('0x36')]=_[_0x4307('0x38')](db['Team'][_0x4307('0x4d')]);_0xd41985[_0x4307('0x37')]=_[_0x4307('0x38')](_0x34fbd3[_0x4307('0x37')]);_0xd41985[_0x4307('0x39')]=_[_0x4307('0x3a')](_0xd41985['model'],_0xd41985[_0x4307('0x37')]);_0xb4a203['attributes']=_['intersection'](_0xd41985[_0x4307('0x36')],qs[_0x4307('0x3b')](_0x34fbd3[_0x4307('0x37')]['fields']));_0xb4a203[_0x4307('0x3c')]=_0xb4a203[_0x4307('0x3c')][_0x4307('0x3d')]?_0xb4a203['attributes']:_0xd41985[_0x4307('0x36')];_0xb4a203['order']=qs[_0x4307('0x41')](_0x34fbd3[_0x4307('0x37')]['sort']);_0xb4a203['where']=qs[_0x4307('0x39')](_[_0x4307('0x43')](_0x34fbd3['query'],_0xd41985[_0x4307('0x39')]));if(_0x34fbd3['query'][_0x4307('0x44')]){_0xb4a203[_0x4307('0x42')]=_['merge'](_0xb4a203[_0x4307('0x42')],{'$or':_[_0x4307('0x32')](_0xb4a203['attributes'],function(_0x595bba){var _0x5351fa={};_0x5351fa[_0x595bba]={'$like':'%'+_0x34fbd3[_0x4307('0x37')][_0x4307('0x44')]+'%'};return _0x5351fa;})});}_0xb4a203=_[_0x4307('0x45')]({},_0xb4a203,_0x34fbd3[_0x4307('0x47')]);return _0x2f0fa2[_0x4307('0x66')](_0xb4a203);}})[_0x4307('0x29')](function(_0x3497dc){if(_0x3497dc){_0x10d0f9=_0x3497dc['length'];if(!_0x34fbd3[_0x4307('0x37')][_0x4307('0x3e')]('nolimit')){_0xb4a203[_0x4307('0x21')]=qs[_0x4307('0x21')](_0x34fbd3['query'][_0x4307('0x21')]);_0xb4a203[_0x4307('0x1f')]=qs[_0x4307('0x1f')](_0x34fbd3[_0x4307('0x37')][_0x4307('0x1f')]);}return _0x2f0fa2['getTeams'](_0xb4a203);}})[_0x4307('0x29')](function(_0x4bfa16){if(_0x4bfa16){return _0x4bfa16?{'count':_0x10d0f9,'rows':_0x4bfa16}:null;}})[_0x4307('0x29')](respondWithResult(_0x5e2d18,null))[_0x4307('0x4a')](handleError(_0x5e2d18,null));};exports[_0x4307('0x68')]=function(_0x4b2629,_0x5b01d8,_0xac40a5){var _0x3f44e0=_0x4b2629[_0x4307('0x59')][_0x4307('0x69')];return db['Team'][_0x4307('0x48')]({'where':{'id':_0x3f44e0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x4307('0x2f'),'online',_0x4307('0x6a'),_0x4307('0x6b')],'raw':!![]}]})[_0x4307('0x29')](function(_0x3684e3){if(_0x3684e3){var _0x18e6b9=_[_0x4307('0x6c')](_0x3684e3,function(_0x3861b2){var _0x4e0a69=_0x3861b2[_0x4307('0x2b')]({'plain':!![]});return _0x4e0a69['Agents'];});return db['WhatsappQueue'][_0x4307('0x50')]({'where':{'id':_0x4b2629[_0x4307('0x4c')]['id']}})['then'](function(_0x5c460a){return db[_0x4307('0x6d')]['transaction'](function(_0x33214d){return _0x5c460a[_0x4307('0x68')](_0x3f44e0,{'transaction':_0x33214d})[_0x4307('0x29')](function(){return BPromise['each'](_0x18e6b9,function(_0x1e5fec){return db[_0x4307('0x5c')]['findOrCreate']({'where':{'UserId':_0x1e5fec['id'],'WhatsappQueueId':_0x4b2629[_0x4307('0x4c')]['id']},'transaction':_0x33214d});});})['then'](function(){_0x18e6b9[_0x4307('0x6e')](function(_0x38986f){socket['emit'](_0x4307('0x6f'),{'UserId':_0x38986f['id'],'WhatsappQueueId':_0x5c460a['id']});});});});});}})['then'](respondWithStatusCode(_0x5b01d8,null))['catch'](handleError(_0x5b01d8,null));};exports[_0x4307('0x70')]=function(_0x24f512,_0x173dde,_0x3c09fb){return db['Team'][_0x4307('0x48')]({'where':{'id':_0x24f512[_0x4307('0x37')][_0x4307('0x69')]},'attributes':['id'],'include':[{'model':db[_0x4307('0x5e')],'as':_0x4307('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x173dde,null))[_0x4307('0x29')](function(_0x25da41){var _0x4394d1=_['map'](_0x25da41,'id');var _0x5eb00e=[];var _0x3d220f=[];var _0x3a1a29=squel[_0x4307('0x72')]();_0x3a1a29[_0x4307('0x73')](_0x4307('0x74'))[_0x4307('0x75')](_0x4307('0x76'),'tq')[_0x4307('0x77')](_0x4307('0x78'),'ut',_0x4307('0x79'))[_0x4307('0x42')](_0x4307('0x7a'),_0x24f512[_0x4307('0x4c')]['id']);for(var _0x217a66=0x0;_0x217a66<_0x25da41[_0x4307('0x3d')];_0x217a66+=0x1){let _0x595db9=_0x25da41[_0x217a66];for(var _0x23c4f9=0x0;_0x23c4f9<_0x595db9[_0x4307('0x71')]['length'];_0x23c4f9+=0x1){let _0x310bc2=_0x595db9['Agents'][_0x23c4f9];var _0x3a147b=_0x3a1a29['clone']();_0x3a147b[_0x4307('0x42')](_0x4307('0x7b'),_0x310bc2['id']);_0x3d220f['push'](db['sequelize'][_0x4307('0x37')](_0x3a147b[_0x4307('0x7c')](),{'type':db[_0x4307('0x6d')]['QueryTypes'][_0x4307('0x7d')]})['then'](function(_0x7a8e94){if(_0x7a8e94[_0x4307('0x3d')]===0x1){return _0x310bc2['id'];}else{var _0x27467a=_[_0x4307('0x7e')](_[_0x4307('0x32')](_0x7a8e94,_0x4307('0x7f')),function(_0x1316f5){return _['includes'](_0x4394d1,_0x1316f5);});if(_0x27467a){return _0x310bc2['id'];}}}));}}return BPromise['all'](_0x3d220f)[_0x4307('0x29')](function(_0x1dc5c3){_0x5eb00e=_(_0x5eb00e)['union'](_0x1dc5c3)[_0x4307('0x80')]()[_0x4307('0x81')]();return db[_0x4307('0x33')][_0x4307('0x50')]({'where':{'id':_0x24f512['params']['id']}})[_0x4307('0x29')](function(_0x2cc6ff){return db[_0x4307('0x6d')][_0x4307('0x82')](function(_0x378f8a){return _0x2cc6ff[_0x4307('0x70')](_0x24f512[_0x4307('0x37')]['ids'],{'transaction':_0x378f8a})[_0x4307('0x29')](function(){if(!_[_0x4307('0x83')](_0x5eb00e)){return _0x2cc6ff[_0x4307('0x84')](_0x5eb00e,{'transaction':_0x378f8a});}})[_0x4307('0x29')](function(){_0x5eb00e['forEach'](function(_0x898467){socket[_0x4307('0x85')](_0x4307('0x86'),{'UserId':_0x898467,'WhatsappQueueId':_0x2cc6ff['id']});});});});});});})[_0x4307('0x29')](respondWithStatusCode(_0x173dde,null))[_0x4307('0x4a')](handleError(_0x173dde,null));};exports[_0x4307('0x87')]=function(_0x523ec4,_0x40a8fd,_0x156c57){return db[_0x4307('0x33')]['find']({'where':{'id':_0x523ec4[_0x4307('0x4c')]['id']}})[_0x4307('0x29')](handleEntityNotFound(_0x40a8fd,null))[_0x4307('0x29')](function(_0x325de7){if(_0x325de7){return _0x325de7['addAgents'](_0x523ec4['body'][_0x4307('0x69')],_['omit'](_0x523ec4[_0x4307('0x59')],[_0x4307('0x69'),'id'])||{})[_0x4307('0x88')](function(_0x2d251b){for(var _0x4019ff=0x0;_0x4019ff<_0x523ec4[_0x4307('0x59')]['ids'][_0x4307('0x3d')];_0x4019ff+=0x1){socket[_0x4307('0x85')]('userWhatsappQueue:save',{'UserId':Number(_0x523ec4[_0x4307('0x59')][_0x4307('0x69')][_0x4019ff]),'WhatsappQueueId':Number(_0x523ec4[_0x4307('0x4c')]['id'])});}return _0x2d251b;});}})['then'](respondWithResult(_0x40a8fd,null))[_0x4307('0x4a')](handleError(_0x40a8fd,null));};exports[_0x4307('0x84')]=function(_0x564b1b,_0x4986fd,_0x268134){return db[_0x4307('0x33')][_0x4307('0x50')]({'where':{'id':_0x564b1b[_0x4307('0x4c')]['id']}})[_0x4307('0x29')](handleEntityNotFound(_0x4986fd,null))[_0x4307('0x29')](function(_0x49178b){if(_0x49178b){return _0x49178b['removeAgents'](_0x564b1b[_0x4307('0x37')][_0x4307('0x69')])[_0x4307('0x29')](function(){if(_[_0x4307('0x89')](_0x564b1b['query'][_0x4307('0x69')])){for(var _0x4e158f=0x0;_0x4e158f<_0x564b1b[_0x4307('0x37')][_0x4307('0x69')]['length'];_0x4e158f+=0x1){socket['emit'](_0x4307('0x86'),{'UserId':Number(_0x564b1b[_0x4307('0x37')][_0x4307('0x69')][_0x4e158f]),'WhatsappQueueId':Number(_0x564b1b[_0x4307('0x4c')]['id'])});}}else{socket[_0x4307('0x85')](_0x4307('0x86'),{'UserId':Number(_0x564b1b[_0x4307('0x37')]['ids']),'WhatsappQueueId':Number(_0x564b1b['params']['id'])});}});}})[_0x4307('0x29')](respondWithStatusCode(_0x4986fd,null))[_0x4307('0x4a')](handleError(_0x4986fd,null));};exports[_0x4307('0x8a')]=function(_0x1fcffb,_0x919889,_0x19b7eb){var _0x5e074e={};var _0x3f8ca5={};var _0x272668;var _0x20c23d;return db[_0x4307('0x33')][_0x4307('0x67')]({'where':{'id':_0x1fcffb[_0x4307('0x4c')]['id']}})[_0x4307('0x29')](handleEntityNotFound(_0x919889,null))[_0x4307('0x29')](function(_0x548f9f){if(_0x548f9f){_0x272668=_0x548f9f;_0x3f8ca5[_0x4307('0x36')]=_['keys'](db[_0x4307('0x5e')][_0x4307('0x4d')]);_0x3f8ca5[_0x4307('0x37')]=_[_0x4307('0x38')](_0x1fcffb[_0x4307('0x37')]);_0x3f8ca5['filters']=_[_0x4307('0x3a')](_0x3f8ca5[_0x4307('0x36')],_0x3f8ca5[_0x4307('0x37')]);_0x5e074e[_0x4307('0x3c')]=_[_0x4307('0x3a')](_0x3f8ca5[_0x4307('0x36')],qs[_0x4307('0x3b')](_0x1fcffb[_0x4307('0x37')][_0x4307('0x3b')]));_0x5e074e['attributes']=_0x5e074e['attributes'][_0x4307('0x3d')]?_0x5e074e['attributes']:_0x3f8ca5[_0x4307('0x36')];_0x5e074e[_0x4307('0x40')]=qs[_0x4307('0x41')](_0x1fcffb[_0x4307('0x37')][_0x4307('0x41')]);_0x5e074e[_0x4307('0x42')]=qs['filters'](_[_0x4307('0x43')](_0x1fcffb[_0x4307('0x37')],_0x3f8ca5[_0x4307('0x39')]));if(_0x1fcffb['query'][_0x4307('0x44')]){_0x5e074e['where']=_[_0x4307('0x45')](_0x5e074e[_0x4307('0x42')],{'$or':_[_0x4307('0x32')](_0x5e074e[_0x4307('0x3c')],function(_0x492fc5){var _0x274be5={};_0x274be5[_0x492fc5]={'$like':'%'+_0x1fcffb['query'][_0x4307('0x44')]+'%'};return _0x274be5;})});}_0x5e074e=_['merge']({},_0x5e074e,_0x1fcffb[_0x4307('0x47')]);return _0x272668[_0x4307('0x8a')](_0x5e074e);}})['then'](function(_0x48dd86){if(_0x48dd86){_0x20c23d=_0x48dd86[_0x4307('0x3d')];if(!_0x1fcffb[_0x4307('0x37')][_0x4307('0x3e')](_0x4307('0x3f'))){_0x5e074e[_0x4307('0x21')]=qs[_0x4307('0x21')](_0x1fcffb[_0x4307('0x37')]['limit']);_0x5e074e[_0x4307('0x1f')]=qs['offset'](_0x1fcffb[_0x4307('0x37')][_0x4307('0x1f')]);}return _0x272668[_0x4307('0x8a')](_0x5e074e);}})['then'](function(_0x23b57c){if(_0x23b57c){return _0x23b57c?{'count':_0x20c23d,'rows':_0x23b57c}:null;}})['then'](respondWithResult(_0x919889,null))['catch'](handleError(_0x919889,null));}; \ No newline at end of file +var _0xe3c1=['include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','body','describe','findOne','nolimit','order','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','agent','whatsappPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xe3c1,0x1f2));var _0x1e3c=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xe3c1[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0x1e3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e3c('0x1'));var jsonpatch=require(_0x1e3c('0x2'));var rp=require(_0x1e3c('0x3'));var moment=require(_0x1e3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e3c('0x5'));var util=require(_0x1e3c('0x6'));var path=require(_0x1e3c('0x7'));var sox=require(_0x1e3c('0x8'));var csv=require('to-csv');var ejs=require(_0x1e3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e3c('0xa'));var squel=require(_0x1e3c('0xb'));var crypto=require('crypto');var jsforce=require(_0x1e3c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1e3c('0xd'));var querystring=require(_0x1e3c('0xe'));var Papa=require(_0x1e3c('0xf'));var Redis=require(_0x1e3c('0x10'));var authService=require(_0x1e3c('0x11'));var qs=require(_0x1e3c('0x12'));var as=require(_0x1e3c('0x13'));var hardwareService=require(_0x1e3c('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1e3c('0x15'));var db=require(_0x1e3c('0x16'))['db'];config[_0x1e3c('0x17')]=_[_0x1e3c('0x18')](config[_0x1e3c('0x17')],{'host':_0x1e3c('0x19'),'port':0x18eb});var socket=require(_0x1e3c('0x1a'))(new Redis(config[_0x1e3c('0x17')]));require(_0x1e3c('0x1b'))[_0x1e3c('0x1c')](socket);function respondWithStatusCode(_0x5a837a,_0x3205fb){_0x3205fb=_0x3205fb||0xcc;return function(_0x598b04){if(_0x598b04){return _0x5a837a[_0x1e3c('0x1d')](_0x3205fb);}return _0x5a837a['status'](_0x3205fb)[_0x1e3c('0x1e')]();};}function respondWithResult(_0x3591c8,_0x5b16e1){_0x5b16e1=_0x5b16e1||0xc8;return function(_0x1aea41){if(_0x1aea41){return _0x3591c8[_0x1e3c('0x1f')](_0x5b16e1)[_0x1e3c('0x20')](_0x1aea41);}};}function respondWithFilteredResult(_0x5e07af,_0x2f2a74){return function(_0x151a5e){if(_0x151a5e){var _0x365207=typeof _0x2f2a74['offset']==='undefined'&&typeof _0x2f2a74[_0x1e3c('0x21')]==='undefined';var _0x2555c0=_0x151a5e[_0x1e3c('0x22')];var _0x57bf09=_0x365207?0x0:_0x2f2a74['offset'];var _0x5b8b56=_0x365207?_0x151a5e[_0x1e3c('0x22')]:_0x2f2a74['offset']+_0x2f2a74[_0x1e3c('0x21')];var _0x4ff0e3;if(_0x5b8b56>=_0x2555c0){_0x5b8b56=_0x2555c0;_0x4ff0e3=0xc8;}else{_0x4ff0e3=0xce;}_0x5e07af['status'](_0x4ff0e3);return _0x5e07af[_0x1e3c('0x23')](_0x1e3c('0x24'),_0x57bf09+'-'+_0x5b8b56+'/'+_0x2555c0)[_0x1e3c('0x20')](_0x151a5e);}return null;};}function patchUpdates(_0x2c1d26){return function(_0x33f6ec){try{jsonpatch[_0x1e3c('0x25')](_0x33f6ec,_0x2c1d26,!![]);}catch(_0x1c1976){return BPromise[_0x1e3c('0x26')](_0x1c1976);}return _0x33f6ec[_0x1e3c('0x27')]();};}function saveUpdates(_0x8c6c1b,_0x20a3ca){return function(_0xef13b){if(_0xef13b){return _0xef13b[_0x1e3c('0x28')](_0x8c6c1b)[_0x1e3c('0x29')](function(_0x589276){return _0x589276;});}return null;};}function removeEntity(_0x13595b,_0x10ff73){return function(_0x3f8d43){if(_0x3f8d43){return _0x3f8d43[_0x1e3c('0x2a')]()[_0x1e3c('0x29')](function(){var _0x2d4b53=_0x3f8d43[_0x1e3c('0x2b')]({'plain':!![]});var _0x447cc3='WhatsappQueues';return db[_0x1e3c('0x2c')][_0x1e3c('0x2a')]({'where':{'type':_0x447cc3,'resourceId':_0x2d4b53['id']}})[_0x1e3c('0x29')](function(){return _0x3f8d43;});})[_0x1e3c('0x29')](function(){_0x13595b[_0x1e3c('0x1f')](0xcc)[_0x1e3c('0x1e')]();});}};}function handleEntityNotFound(_0x15e991,_0x4e6923){return function(_0x160296){if(!_0x160296){_0x15e991[_0x1e3c('0x1d')](0x194);}return _0x160296;};}function handleError(_0x28173f,_0xe2a8d9){_0xe2a8d9=_0xe2a8d9||0x1f4;return function(_0x15d888){logger[_0x1e3c('0x2d')](_0x15d888[_0x1e3c('0x2e')]);if(_0x15d888[_0x1e3c('0x2f')]){delete _0x15d888['name'];}_0x28173f['status'](_0xe2a8d9)[_0x1e3c('0x30')](_0x15d888);};}exports[_0x1e3c('0x31')]=function(_0x2dac9e,_0x34d787){var _0x59dbe7={},_0x47d82b={},_0x43e6c1={'count':0x0,'rows':[]};var _0xbcf23f=_[_0x1e3c('0x32')](db[_0x1e3c('0x33')][_0x1e3c('0x34')],function(_0x52b384){return{'name':_0x52b384[_0x1e3c('0x35')],'type':_0x52b384[_0x1e3c('0x36')][_0x1e3c('0x37')]};});_0x47d82b[_0x1e3c('0x38')]=_[_0x1e3c('0x32')](_0xbcf23f,_0x1e3c('0x2f'));_0x47d82b[_0x1e3c('0x39')]=_[_0x1e3c('0x3a')](_0x2dac9e[_0x1e3c('0x39')]);_0x47d82b[_0x1e3c('0x3b')]=_['intersection'](_0x47d82b[_0x1e3c('0x38')],_0x47d82b[_0x1e3c('0x39')]);_0x59dbe7[_0x1e3c('0x3c')]=_[_0x1e3c('0x3d')](_0x47d82b['model'],qs['fields'](_0x2dac9e[_0x1e3c('0x39')][_0x1e3c('0x3e')]));_0x59dbe7[_0x1e3c('0x3c')]=_0x59dbe7[_0x1e3c('0x3c')][_0x1e3c('0x3f')]?_0x59dbe7['attributes']:_0x47d82b[_0x1e3c('0x38')];if(!_0x2dac9e[_0x1e3c('0x39')][_0x1e3c('0x40')]('nolimit')){_0x59dbe7[_0x1e3c('0x21')]=qs[_0x1e3c('0x21')](_0x2dac9e[_0x1e3c('0x39')]['limit']);_0x59dbe7[_0x1e3c('0x41')]=qs[_0x1e3c('0x41')](_0x2dac9e[_0x1e3c('0x39')]['offset']);}_0x59dbe7['order']=qs[_0x1e3c('0x42')](_0x2dac9e[_0x1e3c('0x39')][_0x1e3c('0x42')]);_0x59dbe7[_0x1e3c('0x43')]=qs[_0x1e3c('0x3b')](_[_0x1e3c('0x44')](_0x2dac9e['query'],_0x47d82b['filters']),_0xbcf23f);if(_0x2dac9e[_0x1e3c('0x39')][_0x1e3c('0x45')]){_0x59dbe7[_0x1e3c('0x43')]=_[_0x1e3c('0x46')](_0x59dbe7[_0x1e3c('0x43')],{'$or':_[_0x1e3c('0x32')](_0xbcf23f,function(_0x318263){if(_0x318263[_0x1e3c('0x36')]!==_0x1e3c('0x47')){var _0xe4ce21={};_0xe4ce21[_0x318263['name']]={'$like':'%'+_0x2dac9e['query'][_0x1e3c('0x45')]+'%'};return _0xe4ce21;}})});}_0x59dbe7=_[_0x1e3c('0x46')]({},_0x59dbe7,_0x2dac9e[_0x1e3c('0x48')]);var _0x1508fd={'where':_0x59dbe7[_0x1e3c('0x43')]};return db['WhatsappQueue'][_0x1e3c('0x22')](_0x1508fd)[_0x1e3c('0x29')](function(_0x336dcc){_0x43e6c1[_0x1e3c('0x22')]=_0x336dcc;if(_0x2dac9e[_0x1e3c('0x39')][_0x1e3c('0x49')]){_0x59dbe7[_0x1e3c('0x4a')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x1e3c('0x4b')](_0x59dbe7);})[_0x1e3c('0x29')](function(_0x12a2bd){_0x43e6c1[_0x1e3c('0x4c')]=_0x12a2bd;return _0x43e6c1;})[_0x1e3c('0x29')](respondWithFilteredResult(_0x34d787,_0x59dbe7))['catch'](handleError(_0x34d787,null));};exports[_0x1e3c('0x4d')]=function(_0x277571,_0x32aa29){var _0x32fc79={'raw':!![],'where':{'id':_0x277571[_0x1e3c('0x4e')]['id']}},_0x4df32a={};_0x4df32a[_0x1e3c('0x38')]=_[_0x1e3c('0x3a')](db[_0x1e3c('0x33')]['rawAttributes']);_0x4df32a[_0x1e3c('0x39')]=_['keys'](_0x277571[_0x1e3c('0x39')]);_0x4df32a['filters']=_[_0x1e3c('0x3d')](_0x4df32a[_0x1e3c('0x38')],_0x4df32a['query']);_0x32fc79[_0x1e3c('0x3c')]=_[_0x1e3c('0x3d')](_0x4df32a[_0x1e3c('0x38')],qs[_0x1e3c('0x3e')](_0x277571[_0x1e3c('0x39')][_0x1e3c('0x3e')]));_0x32fc79[_0x1e3c('0x3c')]=_0x32fc79[_0x1e3c('0x3c')]['length']?_0x32fc79[_0x1e3c('0x3c')]:_0x4df32a[_0x1e3c('0x38')];if(_0x277571['query'][_0x1e3c('0x49')]){_0x32fc79[_0x1e3c('0x4a')]=[{'all':!![]}];}_0x32fc79=_[_0x1e3c('0x46')]({},_0x32fc79,_0x277571[_0x1e3c('0x48')]);return db[_0x1e3c('0x33')][_0x1e3c('0x4f')](_0x32fc79)[_0x1e3c('0x29')](handleEntityNotFound(_0x32aa29,null))['then'](respondWithResult(_0x32aa29,null))[_0x1e3c('0x50')](handleError(_0x32aa29,null));};exports[_0x1e3c('0x51')]=function(_0x57519f,_0x286353){return db[_0x1e3c('0x33')][_0x1e3c('0x51')](_0x57519f['body'],{})['then'](function(_0x192272){var _0x4d7641=_0x57519f[_0x1e3c('0x52')]['get']({'plain':!![]});if(!_0x4d7641)throw new Error(_0x1e3c('0x53'));if(_0x4d7641[_0x1e3c('0x54')]===_0x1e3c('0x52')){var _0x1bf3f7=_0x192272[_0x1e3c('0x2b')]({'plain':!![]});var _0x32dd81=_0x1e3c('0x55');return db['UserProfileSection'][_0x1e3c('0x4f')]({'where':{'name':_0x32dd81,'userProfileId':_0x4d7641[_0x1e3c('0x56')]},'raw':!![]})[_0x1e3c('0x29')](function(_0xda02eb){if(_0xda02eb&&_0xda02eb[_0x1e3c('0x57')]===0x0){return db['UserProfileResource'][_0x1e3c('0x51')]({'name':_0x1bf3f7[_0x1e3c('0x2f')],'resourceId':_0x1bf3f7['id'],'type':_0xda02eb[_0x1e3c('0x2f')],'sectionId':_0xda02eb['id']},{})['then'](function(){return _0x192272;});}else{return _0x192272;}})[_0x1e3c('0x50')](function(_0x40d823){logger[_0x1e3c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40d823);throw _0x40d823;});}return _0x192272;})[_0x1e3c('0x29')](respondWithResult(_0x286353,0xc9))[_0x1e3c('0x50')](handleError(_0x286353,null));};exports['update']=function(_0x252cab,_0x532386){if(_0x252cab[_0x1e3c('0x58')]['id']){delete _0x252cab[_0x1e3c('0x58')]['id'];}return db[_0x1e3c('0x33')][_0x1e3c('0x4f')]({'where':{'id':_0x252cab[_0x1e3c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x532386,null))[_0x1e3c('0x29')](saveUpdates(_0x252cab[_0x1e3c('0x58')],null))[_0x1e3c('0x29')](respondWithResult(_0x532386,null))[_0x1e3c('0x50')](handleError(_0x532386,null));};exports[_0x1e3c('0x2a')]=function(_0x3aa36e,_0x599af0){return db[_0x1e3c('0x33')]['find']({'where':{'id':_0x3aa36e[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x599af0,null))[_0x1e3c('0x29')](removeEntity(_0x599af0,null))[_0x1e3c('0x50')](handleError(_0x599af0,null));};exports[_0x1e3c('0x59')]=function(_0x3deac1,_0xe6e989){return db['WhatsappQueue'][_0x1e3c('0x59')]()[_0x1e3c('0x29')](respondWithResult(_0xe6e989,null))[_0x1e3c('0x50')](handleError(_0xe6e989,null));};exports['getMembers']=function(_0x1cca1e,_0x835f4d,_0x57ca2c){var _0x92460={'raw':!![],'where':{}},_0xa92f57={},_0x553ea3;return db[_0x1e3c('0x33')][_0x1e3c('0x5a')]({'where':{'id':_0x1cca1e['params']['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x835f4d,null))[_0x1e3c('0x29')](function(_0xc76b43){if(_0xc76b43){_0x553ea3=_0xc76b43[_0x1e3c('0x2b')]({'plain':!![]});_0xa92f57['model']=_['keys'](db['UserWhatsappQueue'][_0x1e3c('0x34')]);_0xa92f57[_0x1e3c('0x39')]=_['keys'](_0x1cca1e['query']);_0xa92f57[_0x1e3c('0x3b')]=_['intersection'](_0xa92f57[_0x1e3c('0x38')],_0xa92f57[_0x1e3c('0x39')]);_0x92460[_0x1e3c('0x3c')]=_[_0x1e3c('0x3d')](_0xa92f57[_0x1e3c('0x38')],qs[_0x1e3c('0x3e')](_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x3e')]));_0x92460[_0x1e3c('0x3c')]=_0x92460[_0x1e3c('0x3c')][_0x1e3c('0x3f')]?_0x92460['attributes']:_0xa92f57[_0x1e3c('0x38')];if(!_0x1cca1e[_0x1e3c('0x39')]['hasOwnProperty'](_0x1e3c('0x5b'))){_0x92460['limit']=qs[_0x1e3c('0x21')](_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x21')]);_0x92460[_0x1e3c('0x41')]=qs[_0x1e3c('0x41')](_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x41')]);}_0x92460[_0x1e3c('0x5c')]=qs[_0x1e3c('0x42')](_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x42')]);_0x92460[_0x1e3c('0x43')]=qs[_0x1e3c('0x3b')](_[_0x1e3c('0x44')](_0x1cca1e['query'],_0xa92f57[_0x1e3c('0x3b')]));_0x92460[_0x1e3c('0x43')][_0x1e3c('0x5d')]=_0xc76b43['id'];if(_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x45')]){_0x92460[_0x1e3c('0x43')]=_[_0x1e3c('0x46')](_0x92460[_0x1e3c('0x43')],{'$or':_[_0x1e3c('0x32')](_0x92460['attributes'],function(_0x179f82){var _0x1ea47d={};_0x1ea47d[_0x179f82]={'$like':'%'+_0x1cca1e[_0x1e3c('0x39')][_0x1e3c('0x45')]+'%'};return _0x1ea47d;})});}_0x92460=_[_0x1e3c('0x46')]({},_0x92460,_0x1cca1e[_0x1e3c('0x48')]);return db[_0x1e3c('0x5e')][_0x1e3c('0x4b')](_0x92460);}})['then'](function(_0xef6e23){if(_0xef6e23){return db[_0x1e3c('0x5f')][_0x1e3c('0x60')]({'where':{'id':_[_0x1e3c('0x32')](_0xef6e23,'UserId'),'role':_0x1e3c('0x61')},'attributes':['id','name',_0x1e3c('0x62'),'updatedAt','createdAt']});}})['then'](function(_0x51fe66){if(_0x51fe66){return{'count':_0x51fe66[_0x1e3c('0x22')],'rows':_[_0x1e3c('0x32')](_0x51fe66[_0x1e3c('0x4c')],function(_0x3208cd){return{'membername':_0x3208cd[_0x1e3c('0x2f')],'UserId':_0x3208cd['id'],'queue_name':_0x553ea3[_0x1e3c('0x2f')],'WhatsappQueueId':_0x553ea3['id'],'interface':util[_0x1e3c('0x63')](_0x1e3c('0x64'),'SIP',_0x3208cd[_0x1e3c('0x2f')]),'penalty':0x0,'paused':_0x3208cd[_0x1e3c('0x62')],'createdAt':_0x3208cd[_0x1e3c('0x65')],'updatedAt':_0x3208cd[_0x1e3c('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1e3c('0x29')](respondWithFilteredResult(_0x835f4d,_0x92460))['catch'](handleError(_0x835f4d,null));};exports[_0x1e3c('0x67')]=function(_0x366843,_0x5434ce,_0x3bb000){var _0x403576={};var _0x21be24={};var _0x5ba14;var _0x12bce1;return db[_0x1e3c('0x33')][_0x1e3c('0x5a')]({'where':{'id':_0x366843[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x5434ce,null))[_0x1e3c('0x29')](function(_0x1323fb){if(_0x1323fb){_0x5ba14=_0x1323fb;_0x21be24['model']=_[_0x1e3c('0x3a')](db[_0x1e3c('0x68')]['rawAttributes']);_0x21be24['query']=_[_0x1e3c('0x3a')](_0x366843[_0x1e3c('0x39')]);_0x21be24[_0x1e3c('0x3b')]=_[_0x1e3c('0x3d')](_0x21be24[_0x1e3c('0x38')],_0x21be24[_0x1e3c('0x39')]);_0x403576[_0x1e3c('0x3c')]=_['intersection'](_0x21be24['model'],qs[_0x1e3c('0x3e')](_0x366843[_0x1e3c('0x39')][_0x1e3c('0x3e')]));_0x403576['attributes']=_0x403576[_0x1e3c('0x3c')]['length']?_0x403576[_0x1e3c('0x3c')]:_0x21be24['model'];_0x403576[_0x1e3c('0x5c')]=qs['sort'](_0x366843[_0x1e3c('0x39')][_0x1e3c('0x42')]);_0x403576[_0x1e3c('0x43')]=qs[_0x1e3c('0x3b')](_[_0x1e3c('0x44')](_0x366843[_0x1e3c('0x39')],_0x21be24[_0x1e3c('0x3b')]));if(_0x366843[_0x1e3c('0x39')][_0x1e3c('0x45')]){_0x403576[_0x1e3c('0x43')]=_[_0x1e3c('0x46')](_0x403576[_0x1e3c('0x43')],{'$or':_[_0x1e3c('0x32')](_0x403576[_0x1e3c('0x3c')],function(_0x3b0d54){var _0x32ded8={};_0x32ded8[_0x3b0d54]={'$like':'%'+_0x366843[_0x1e3c('0x39')]['filter']+'%'};return _0x32ded8;})});}_0x403576=_[_0x1e3c('0x46')]({},_0x403576,_0x366843[_0x1e3c('0x48')]);return _0x5ba14[_0x1e3c('0x67')](_0x403576);}})[_0x1e3c('0x29')](function(_0x17299e){if(_0x17299e){_0x12bce1=_0x17299e[_0x1e3c('0x3f')];if(!_0x366843[_0x1e3c('0x39')][_0x1e3c('0x40')](_0x1e3c('0x5b'))){_0x403576['limit']=qs[_0x1e3c('0x21')](_0x366843[_0x1e3c('0x39')][_0x1e3c('0x21')]);_0x403576[_0x1e3c('0x41')]=qs['offset'](_0x366843[_0x1e3c('0x39')][_0x1e3c('0x41')]);}return _0x5ba14['getTeams'](_0x403576);}})[_0x1e3c('0x29')](function(_0x478df1){if(_0x478df1){return _0x478df1?{'count':_0x12bce1,'rows':_0x478df1}:null;}})['then'](respondWithResult(_0x5434ce,null))['catch'](handleError(_0x5434ce,null));};exports[_0x1e3c('0x69')]=function(_0x380117,_0x43e6bf,_0x5a45bf){var _0xd87e3e=_0x380117['body'][_0x1e3c('0x6a')];return db[_0x1e3c('0x68')][_0x1e3c('0x4b')]({'where':{'id':_0xd87e3e},'attributes':['id'],'include':[{'model':db[_0x1e3c('0x5f')],'as':_0x1e3c('0x6b'),'attributes':['id',_0x1e3c('0x2f'),'online',_0x1e3c('0x6c'),_0x1e3c('0x6d')],'raw':!![]}]})['then'](function(_0x229a80){if(_0x229a80){var _0x2d5a21=_[_0x1e3c('0x6e')](_0x229a80,function(_0x3740ff){var _0x5913ba=_0x3740ff[_0x1e3c('0x2b')]({'plain':!![]});return _0x5913ba[_0x1e3c('0x6b')];});return db['WhatsappQueue'][_0x1e3c('0x4f')]({'where':{'id':_0x380117[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](function(_0x4f503d){return db[_0x1e3c('0x6f')][_0x1e3c('0x70')](function(_0x5df808){return _0x4f503d[_0x1e3c('0x69')](_0xd87e3e,{'transaction':_0x5df808})[_0x1e3c('0x29')](function(){return BPromise[_0x1e3c('0x71')](_0x2d5a21,function(_0xee0324){return db[_0x1e3c('0x5e')]['findOrCreate']({'where':{'UserId':_0xee0324['id'],'WhatsappQueueId':_0x380117['params']['id']},'transaction':_0x5df808});});})['then'](function(){_0x2d5a21[_0x1e3c('0x72')](function(_0xe7e1e7){socket[_0x1e3c('0x73')](_0x1e3c('0x74'),{'UserId':_0xe7e1e7['id'],'WhatsappQueueId':_0x4f503d['id']});});});});});}})[_0x1e3c('0x29')](respondWithStatusCode(_0x43e6bf,null))[_0x1e3c('0x50')](handleError(_0x43e6bf,null));};exports[_0x1e3c('0x75')]=function(_0x4c69c4,_0x676188,_0x252d1d){return db[_0x1e3c('0x68')][_0x1e3c('0x4b')]({'where':{'id':_0x4c69c4[_0x1e3c('0x39')][_0x1e3c('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x1e3c('0x5f')],'as':_0x1e3c('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x1e3c('0x29')](handleEntityNotFound(_0x676188,null))[_0x1e3c('0x29')](function(_0x36b659){var _0x251c68=_[_0x1e3c('0x32')](_0x36b659,'id');var _0x49e9a8=[];var _0x3519f2=[];var _0x5411cb=squel[_0x1e3c('0x76')]();_0x5411cb[_0x1e3c('0x77')](_0x1e3c('0x78'))[_0x1e3c('0x79')](_0x1e3c('0x7a'),'tq')['join'](_0x1e3c('0x7b'),'ut',_0x1e3c('0x7c'))[_0x1e3c('0x43')](_0x1e3c('0x7d'),_0x4c69c4['params']['id']);for(var _0x4ad575=0x0;_0x4ad575<_0x36b659[_0x1e3c('0x3f')];_0x4ad575+=0x1){let _0x446523=_0x36b659[_0x4ad575];for(var _0x245db5=0x0;_0x245db5<_0x446523[_0x1e3c('0x6b')][_0x1e3c('0x3f')];_0x245db5+=0x1){let _0x1f0fc1=_0x446523['Agents'][_0x245db5];var _0x5cd4e2=_0x5411cb[_0x1e3c('0x7e')]();_0x5cd4e2[_0x1e3c('0x43')](_0x1e3c('0x7f'),_0x1f0fc1['id']);_0x3519f2[_0x1e3c('0x80')](db[_0x1e3c('0x6f')][_0x1e3c('0x39')](_0x5cd4e2[_0x1e3c('0x81')](),{'type':db['sequelize']['QueryTypes'][_0x1e3c('0x82')]})[_0x1e3c('0x29')](function(_0x516c4b){if(_0x516c4b[_0x1e3c('0x3f')]===0x1){return _0x1f0fc1['id'];}else{var _0x147b78=_['every'](_[_0x1e3c('0x32')](_0x516c4b,'TeamId'),function(_0x45e55d){return _[_0x1e3c('0x83')](_0x251c68,_0x45e55d);});if(_0x147b78){return _0x1f0fc1['id'];}}}));}}return BPromise[_0x1e3c('0x84')](_0x3519f2)[_0x1e3c('0x29')](function(_0x5b6d5d){_0x49e9a8=_(_0x49e9a8)[_0x1e3c('0x85')](_0x5b6d5d)[_0x1e3c('0x86')]()[_0x1e3c('0x87')]();return db[_0x1e3c('0x33')]['find']({'where':{'id':_0x4c69c4[_0x1e3c('0x4e')]['id']}})['then'](function(_0x5d1f8f){return db[_0x1e3c('0x6f')]['transaction'](function(_0x43b5b1){return _0x5d1f8f[_0x1e3c('0x75')](_0x4c69c4['query'][_0x1e3c('0x6a')],{'transaction':_0x43b5b1})[_0x1e3c('0x29')](function(){if(!_['isEmpty'](_0x49e9a8)){return _0x5d1f8f[_0x1e3c('0x88')](_0x49e9a8,{'transaction':_0x43b5b1});}})['then'](function(){_0x49e9a8[_0x1e3c('0x72')](function(_0x521325){socket[_0x1e3c('0x73')](_0x1e3c('0x89'),{'UserId':_0x521325,'WhatsappQueueId':_0x5d1f8f['id']});});});});});});})['then'](respondWithStatusCode(_0x676188,null))[_0x1e3c('0x50')](handleError(_0x676188,null));};exports['addAgents']=function(_0x4084ba,_0x38b186,_0x219e51){return db[_0x1e3c('0x33')][_0x1e3c('0x4f')]({'where':{'id':_0x4084ba[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x38b186,null))[_0x1e3c('0x29')](function(_0x4fd6cb){if(_0x4fd6cb){return _0x4fd6cb[_0x1e3c('0x8a')](_0x4084ba[_0x1e3c('0x58')][_0x1e3c('0x6a')],_[_0x1e3c('0x8b')](_0x4084ba[_0x1e3c('0x58')],[_0x1e3c('0x6a'),'id'])||{})[_0x1e3c('0x8c')](function(_0x22e1dd){for(var _0x108c36=0x0;_0x108c36<_0x4084ba['body'][_0x1e3c('0x6a')][_0x1e3c('0x3f')];_0x108c36+=0x1){socket[_0x1e3c('0x73')](_0x1e3c('0x74'),{'UserId':Number(_0x4084ba[_0x1e3c('0x58')]['ids'][_0x108c36]),'WhatsappQueueId':Number(_0x4084ba[_0x1e3c('0x4e')]['id'])});}return _0x22e1dd;});}})[_0x1e3c('0x29')](respondWithResult(_0x38b186,null))['catch'](handleError(_0x38b186,null));};exports[_0x1e3c('0x88')]=function(_0x595bfd,_0x509360,_0xe1b2b5){return db['WhatsappQueue'][_0x1e3c('0x4f')]({'where':{'id':_0x595bfd[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x509360,null))[_0x1e3c('0x29')](function(_0x1a1130){if(_0x1a1130){return _0x1a1130['removeAgents'](_0x595bfd[_0x1e3c('0x39')][_0x1e3c('0x6a')])[_0x1e3c('0x29')](function(){if(_[_0x1e3c('0x8d')](_0x595bfd[_0x1e3c('0x39')]['ids'])){for(var _0x5e512b=0x0;_0x5e512b<_0x595bfd['query'][_0x1e3c('0x6a')][_0x1e3c('0x3f')];_0x5e512b+=0x1){socket[_0x1e3c('0x73')](_0x1e3c('0x89'),{'UserId':Number(_0x595bfd[_0x1e3c('0x39')][_0x1e3c('0x6a')][_0x5e512b]),'WhatsappQueueId':Number(_0x595bfd[_0x1e3c('0x4e')]['id'])});}}else{socket['emit'](_0x1e3c('0x89'),{'UserId':Number(_0x595bfd[_0x1e3c('0x39')][_0x1e3c('0x6a')]),'WhatsappQueueId':Number(_0x595bfd[_0x1e3c('0x4e')]['id'])});}});}})[_0x1e3c('0x29')](respondWithStatusCode(_0x509360,null))[_0x1e3c('0x50')](handleError(_0x509360,null));};exports['getAgents']=function(_0x312c37,_0x2893ff,_0x11a84a){var _0x485223={};var _0x5f0812={};var _0x492c3e;var _0x431fc9;return db[_0x1e3c('0x33')][_0x1e3c('0x5a')]({'where':{'id':_0x312c37[_0x1e3c('0x4e')]['id']}})[_0x1e3c('0x29')](handleEntityNotFound(_0x2893ff,null))['then'](function(_0x3fa462){if(_0x3fa462){_0x492c3e=_0x3fa462;_0x5f0812[_0x1e3c('0x38')]=_[_0x1e3c('0x3a')](db[_0x1e3c('0x5f')][_0x1e3c('0x34')]);_0x5f0812['query']=_[_0x1e3c('0x3a')](_0x312c37[_0x1e3c('0x39')]);_0x5f0812[_0x1e3c('0x3b')]=_[_0x1e3c('0x3d')](_0x5f0812[_0x1e3c('0x38')],_0x5f0812[_0x1e3c('0x39')]);_0x485223[_0x1e3c('0x3c')]=_['intersection'](_0x5f0812[_0x1e3c('0x38')],qs[_0x1e3c('0x3e')](_0x312c37['query'][_0x1e3c('0x3e')]));_0x485223['attributes']=_0x485223['attributes']['length']?_0x485223[_0x1e3c('0x3c')]:_0x5f0812[_0x1e3c('0x38')];_0x485223[_0x1e3c('0x5c')]=qs['sort'](_0x312c37[_0x1e3c('0x39')][_0x1e3c('0x42')]);_0x485223[_0x1e3c('0x43')]=qs['filters'](_[_0x1e3c('0x44')](_0x312c37['query'],_0x5f0812[_0x1e3c('0x3b')]));if(_0x312c37[_0x1e3c('0x39')][_0x1e3c('0x45')]){_0x485223[_0x1e3c('0x43')]=_['merge'](_0x485223[_0x1e3c('0x43')],{'$or':_[_0x1e3c('0x32')](_0x485223[_0x1e3c('0x3c')],function(_0x73e48a){var _0x2fdf44={};_0x2fdf44[_0x73e48a]={'$like':'%'+_0x312c37[_0x1e3c('0x39')][_0x1e3c('0x45')]+'%'};return _0x2fdf44;})});}_0x485223=_[_0x1e3c('0x46')]({},_0x485223,_0x312c37[_0x1e3c('0x48')]);return _0x492c3e[_0x1e3c('0x8e')](_0x485223);}})[_0x1e3c('0x29')](function(_0x36bca8){if(_0x36bca8){_0x431fc9=_0x36bca8['length'];if(!_0x312c37[_0x1e3c('0x39')]['hasOwnProperty'](_0x1e3c('0x5b'))){_0x485223[_0x1e3c('0x21')]=qs[_0x1e3c('0x21')](_0x312c37[_0x1e3c('0x39')][_0x1e3c('0x21')]);_0x485223[_0x1e3c('0x41')]=qs['offset'](_0x312c37['query'][_0x1e3c('0x41')]);}return _0x492c3e[_0x1e3c('0x8e')](_0x485223);}})[_0x1e3c('0x29')](function(_0x8db672){if(_0x8db672){return _0x8db672?{'count':_0x431fc9,'rows':_0x8db672}:null;}})[_0x1e3c('0x29')](respondWithResult(_0x2893ff,null))[_0x1e3c('0x50')](handleError(_0x2893ff,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 4c73d05..6b897f3 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 _0xd938=['WhatsappQueue','setMaxListeners','save','remove','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x372d02,_0x1e08b2){var _0x95059c=function(_0xafae53){while(--_0xafae53){_0x372d02['push'](_0x372d02['shift']());}};_0x95059c(++_0x1e08b2);}(_0xd938,0x19e));var _0x8d93=function(_0x852c55,_0x515d88){_0x852c55=_0x852c55-0x0;var _0x538122=_0xd938[_0x852c55];return _0x538122;};'use strict';var EventEmitter=require(_0x8d93('0x0'));var WhatsappQueue=require(_0x8d93('0x1'))['db'][_0x8d93('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8d93('0x3')](0x0);var events={'afterCreate':_0x8d93('0x4'),'afterUpdate':'update','afterDestroy':_0x8d93('0x5')};function emitEvent(_0x3f8b9a){return function(_0x517e5d,_0x4863dd,_0x5c60cb){WhatsappQueueEvents['emit'](_0x3f8b9a+':'+_0x517e5d['id'],_0x517e5d);WhatsappQueueEvents['emit'](_0x3f8b9a,_0x517e5d);_0x5c60cb(null);};}for(var e in events){if(events[_0x8d93('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x8d93('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xf76f=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0xf76f,0x175));var _0xff76=function(_0x463ad4,_0x4686c7){_0x463ad4=_0x463ad4-0x0;var _0x29ec8b=_0xf76f[_0x463ad4];return _0x29ec8b;};'use strict';var EventEmitter=require(_0xff76('0x0'));var WhatsappQueue=require(_0xff76('0x1'))['db'][_0xff76('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xff76('0x3')](0x0);var events={'afterCreate':_0xff76('0x4'),'afterUpdate':_0xff76('0x5'),'afterDestroy':_0xff76('0x6')};function emitEvent(_0x574038){return function(_0x15a7db,_0x5cabb9,_0x355812){WhatsappQueueEvents[_0xff76('0x7')](_0x574038+':'+_0x15a7db['id'],_0x15a7db);WhatsappQueueEvents['emit'](_0x574038,_0x15a7db);_0x355812(null);};}for(var e in events){if(events[_0xff76('0x8')](e)){var event=events[e];WhatsappQueue[_0xff76('0x9')](e,emitEvent(event));}}module[_0xff76('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 30ac9a6..37ba4ce 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 _0x487c=['whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x487c,0x16c));var _0xc487=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x487c[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0xc487('0x0'));var util=require(_0xc487('0x1'));var logger=require(_0xc487('0x2'))(_0xc487('0x3'));var moment=require(_0xc487('0x4'));var BPromise=require(_0xc487('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc487('0x6'));var attributes=require(_0xc487('0x7'));module['exports']=function(_0x3dec7c,_0x547582){return _0x3dec7c[_0xc487('0x8')](_0xc487('0x9'),attributes,{'tableName':_0xc487('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2580=['exports','define','lodash','util','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes'];(function(_0x5bddec,_0x14388e){var _0x472581=function(_0x2cec29){while(--_0x2cec29){_0x5bddec['push'](_0x5bddec['shift']());}};_0x472581(++_0x14388e);}(_0x2580,0x122));var _0x0258=function(_0x97210a,_0x393454){_0x97210a=_0x97210a-0x0;var _0x107e9e=_0x2580[_0x97210a];return _0x107e9e;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0258('0x2'));var rp=require(_0x0258('0x3'));var fs=require('fs');var path=require(_0x0258('0x4'));var rimraf=require('rimraf');var config=require(_0x0258('0x5'));var attributes=require(_0x0258('0x6'));module[_0x0258('0x7')]=function(_0x485ab9,_0x55130c){return _0x485ab9[_0x0258('0x8')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','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 9c0564d..8b048d2 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 _0x702d=['info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','model','map','ShowWhatsappQueue','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x46c941,_0x161f32){var _0xaf49f6=function(_0x4b9a74){while(--_0x4b9a74){_0x46c941['push'](_0x46c941['shift']());}};_0xaf49f6(++_0x161f32);}(_0x702d,0x1d2));var _0xd702=function(_0x5a8308,_0x11d2af){_0x5a8308=_0x5a8308-0x0;var _0xa2f5c9=_0x702d[_0x5a8308];return _0xa2f5c9;};'use strict';var _=require(_0xd702('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd702('0x1'));var rs=require(_0xd702('0x2'));var fs=require('fs');var Redis=require(_0xd702('0x3'));var db=require(_0xd702('0x4'))['db'];var utils=require(_0xd702('0x5'));var logger=require(_0xd702('0x6'))(_0xd702('0x7'));var config=require(_0xd702('0x8'));var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});config[_0xd702('0xb')]=_[_0xd702('0xc')](config[_0xd702('0xb')],{'host':_0xd702('0xd'),'port':0x18eb});var socket=require(_0xd702('0xe'))(new Redis(config[_0xd702('0xb')]));require(_0xd702('0xf'))[_0xd702('0x10')](socket);function respondWithRpcPromise(_0x419aa4,_0x17f1e7,_0x4e02b7){return new BPromise(function(_0xc615e8,_0x243195){return client[_0xd702('0x11')](_0x419aa4,_0x4e02b7)[_0xd702('0x12')](function(_0x1e3408){logger['info'](_0xd702('0x13'),_0x17f1e7,_0xd702('0x14'));logger[_0xd702('0x15')](_0xd702('0x16'),_0x17f1e7,_0xd702('0x14'),JSON[_0xd702('0x17')](_0x1e3408));if(_0x1e3408[_0xd702('0x18')]){if(_0x1e3408[_0xd702('0x18')]['code']===0x1f4){logger[_0xd702('0x18')](_0xd702('0x13'),_0x17f1e7,_0x1e3408[_0xd702('0x18')]['message']);return _0x243195(_0x1e3408['error'][_0xd702('0x19')]);}logger[_0xd702('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x17f1e7,_0x1e3408[_0xd702('0x18')][_0xd702('0x19')]);return _0xc615e8(_0x1e3408[_0xd702('0x18')][_0xd702('0x19')]);}else{logger[_0xd702('0x1a')](_0xd702('0x13'),_0x17f1e7,'request\x20sent');_0xc615e8(_0x1e3408[_0xd702('0x1b')][_0xd702('0x19')]);}})[_0xd702('0x1c')](function(_0x3b7ac3){logger[_0xd702('0x18')](_0xd702('0x13'),_0x17f1e7,_0x3b7ac3);_0x243195(_0x3b7ac3);});});}exports[_0xd702('0x1d')]=function(_0x494410){var _0x472fcc=this;return new Promise(function(_0x81fbc6,_0x468614){return db[_0xd702('0x1e')][_0xd702('0x1f')]({'raw':_0x494410[_0xd702('0x20')]?_0x494410[_0xd702('0x20')][_0xd702('0x21')]===undefined?!![]:![]:!![],'where':_0x494410['options']?_0x494410[_0xd702('0x20')]['where']||null:null,'attributes':_0x494410[_0xd702('0x20')]?_0x494410['options'][_0xd702('0x22')]||null:null,'limit':_0x494410['options']?_0x494410['options']['limit']||null:null,'include':_0x494410[_0xd702('0x20')]?_0x494410[_0xd702('0x20')][_0xd702('0x23')]?_['map'](_0x494410['options'][_0xd702('0x23')],function(_0x32d56a){return{'model':db[_0x32d56a[_0xd702('0x24')]],'as':_0x32d56a['as'],'attributes':_0x32d56a[_0xd702('0x22')],'include':_0x32d56a[_0xd702('0x23')]?_[_0xd702('0x25')](_0x32d56a[_0xd702('0x23')],function(_0x3774a5){return{'model':db[_0x3774a5[_0xd702('0x24')]],'as':_0x3774a5['as'],'attributes':_0x3774a5[_0xd702('0x22')],'include':_0x3774a5[_0xd702('0x23')]?_[_0xd702('0x25')](_0x3774a5[_0xd702('0x23')],function(_0x35f445){return{'model':db[_0x35f445['model']],'as':_0x35f445['as'],'attributes':_0x35f445[_0xd702('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd702('0x12')](function(_0x8560a3){logger[_0xd702('0x1a')](_0xd702('0x1d'),_0x494410);logger[_0xd702('0x15')](_0xd702('0x1d'),_0x494410,JSON[_0xd702('0x17')](_0x8560a3));_0x81fbc6(_0x8560a3);})[_0xd702('0x1c')](function(_0x346536){logger['error'](_0xd702('0x1d'),_0x346536['message'],_0x494410);_0x468614(_0x472fcc[_0xd702('0x18')](0x1f4,_0x346536[_0xd702('0x19')]));});});};exports[_0xd702('0x26')]=function(_0x515d8c){var _0x2b13c1=this;return new Promise(function(_0x15741a,_0x54e8f8){return db[_0xd702('0x1e')][_0xd702('0x27')]({'raw':_0x515d8c['options']?_0x515d8c[_0xd702('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x515d8c['options']?_0x515d8c[_0xd702('0x20')][_0xd702('0x28')]||null:null,'attributes':_0x515d8c['options']?_0x515d8c[_0xd702('0x20')]['attributes']||null:null,'include':_0x515d8c[_0xd702('0x20')]?_0x515d8c['options'][_0xd702('0x23')]?_[_0xd702('0x25')](_0x515d8c['options']['include'],function(_0xac7967){return{'model':db[_0xac7967[_0xd702('0x24')]],'as':_0xac7967['as'],'attributes':_0xac7967[_0xd702('0x22')],'include':_0xac7967[_0xd702('0x23')]?_['map'](_0xac7967['include'],function(_0x120fb3){return{'model':db[_0x120fb3[_0xd702('0x24')]],'as':_0x120fb3['as'],'attributes':_0x120fb3[_0xd702('0x22')],'include':_0x120fb3[_0xd702('0x23')]?_[_0xd702('0x25')](_0x120fb3[_0xd702('0x23')],function(_0x178851){return{'model':db[_0x178851[_0xd702('0x24')]],'as':_0x178851['as'],'attributes':_0x178851[_0xd702('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11bd99){logger[_0xd702('0x1a')](_0xd702('0x26'),_0x515d8c);logger[_0xd702('0x15')]('ShowWhatsappQueue',_0x515d8c,JSON[_0xd702('0x17')](_0x11bd99));_0x15741a(_0x11bd99);})[_0xd702('0x1c')](function(_0x49a6b7){logger['error'](_0xd702('0x26'),_0x49a6b7[_0xd702('0x19')],_0x515d8c);_0x54e8f8(_0x2b13c1['error'](0x1f4,_0x49a6b7['message']));});});}; \ No newline at end of file +var _0x6313=['jayson/promise','client','redis','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','findAll','options','where','limit','map','include','model','attributes','catch','ShowWhatsappQueue','find','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x6313,0x1a5));var _0x3631=function(_0x5585ca,_0x4c6c65){_0x5585ca=_0x5585ca-0x0;var _0x415be9=_0x6313[_0x5585ca];return _0x415be9;};'use strict';var _=require('lodash');var util=require(_0x3631('0x0'));var moment=require(_0x3631('0x1'));var BPromise=require(_0x3631('0x2'));var rs=require(_0x3631('0x3'));var fs=require('fs');var Redis=require(_0x3631('0x4'));var db=require(_0x3631('0x5'))['db'];var utils=require(_0x3631('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3631('0x7'));var jayson=require(_0x3631('0x8'));var client=jayson[_0x3631('0x9')]['http']({'port':0x232a});config[_0x3631('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3631('0xb'))(new Redis(config[_0x3631('0xa')]));require(_0x3631('0xc'))[_0x3631('0xd')](socket);function respondWithRpcPromise(_0x5ef49a,_0x3b0555,_0x4b289b){return new BPromise(function(_0x5d7dad,_0x1b351b){return client[_0x3631('0xe')](_0x5ef49a,_0x4b289b)['then'](function(_0x36bbde){logger[_0x3631('0xf')](_0x3631('0x10'),_0x3b0555,_0x3631('0x11'));logger[_0x3631('0x12')](_0x3631('0x13'),_0x3b0555,'request\x20sent',JSON[_0x3631('0x14')](_0x36bbde));if(_0x36bbde[_0x3631('0x15')]){if(_0x36bbde[_0x3631('0x15')][_0x3631('0x16')]===0x1f4){logger[_0x3631('0x15')](_0x3631('0x10'),_0x3b0555,_0x36bbde['error'][_0x3631('0x17')]);return _0x1b351b(_0x36bbde['error'][_0x3631('0x17')]);}logger[_0x3631('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x3b0555,_0x36bbde['error'][_0x3631('0x17')]);return _0x5d7dad(_0x36bbde['error'][_0x3631('0x17')]);}else{logger[_0x3631('0xf')](_0x3631('0x10'),_0x3b0555,_0x3631('0x11'));_0x5d7dad(_0x36bbde[_0x3631('0x18')][_0x3631('0x17')]);}})['catch'](function(_0x2bdd47){logger[_0x3631('0x15')](_0x3631('0x10'),_0x3b0555,_0x2bdd47);_0x1b351b(_0x2bdd47);});});}exports[_0x3631('0x19')]=function(_0x5e76a7){var _0x39b799=this;return new Promise(function(_0x40a4b5,_0x3775e5){return db['WhatsappQueue'][_0x3631('0x1a')]({'raw':_0x5e76a7['options']?_0x5e76a7[_0x3631('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5e76a7['options']?_0x5e76a7[_0x3631('0x1b')][_0x3631('0x1c')]||null:null,'attributes':_0x5e76a7[_0x3631('0x1b')]?_0x5e76a7[_0x3631('0x1b')]['attributes']||null:null,'limit':_0x5e76a7[_0x3631('0x1b')]?_0x5e76a7[_0x3631('0x1b')][_0x3631('0x1d')]||null:null,'include':_0x5e76a7[_0x3631('0x1b')]?_0x5e76a7['options']['include']?_[_0x3631('0x1e')](_0x5e76a7[_0x3631('0x1b')][_0x3631('0x1f')],function(_0x49f19c){return{'model':db[_0x49f19c[_0x3631('0x20')]],'as':_0x49f19c['as'],'attributes':_0x49f19c[_0x3631('0x21')],'include':_0x49f19c['include']?_[_0x3631('0x1e')](_0x49f19c[_0x3631('0x1f')],function(_0x5e0833){return{'model':db[_0x5e0833[_0x3631('0x20')]],'as':_0x5e0833['as'],'attributes':_0x5e0833['attributes'],'include':_0x5e0833[_0x3631('0x1f')]?_['map'](_0x5e0833[_0x3631('0x1f')],function(_0x47900c){return{'model':db[_0x47900c[_0x3631('0x20')]],'as':_0x47900c['as'],'attributes':_0x47900c[_0x3631('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d3fcd){logger[_0x3631('0xf')](_0x3631('0x19'),_0x5e76a7);logger['debug'](_0x3631('0x19'),_0x5e76a7,JSON[_0x3631('0x14')](_0x4d3fcd));_0x40a4b5(_0x4d3fcd);})[_0x3631('0x22')](function(_0x126cdf){logger[_0x3631('0x15')](_0x3631('0x19'),_0x126cdf[_0x3631('0x17')],_0x5e76a7);_0x3775e5(_0x39b799[_0x3631('0x15')](0x1f4,_0x126cdf[_0x3631('0x17')]));});});};exports[_0x3631('0x23')]=function(_0x49f34e){var _0x301b1f=this;return new Promise(function(_0x5d8497,_0x50ee55){return db['WhatsappQueue'][_0x3631('0x24')]({'raw':_0x49f34e[_0x3631('0x1b')]?_0x49f34e[_0x3631('0x1b')][_0x3631('0x25')]===undefined?!![]:![]:!![],'where':_0x49f34e[_0x3631('0x1b')]?_0x49f34e['options'][_0x3631('0x1c')]||null:null,'attributes':_0x49f34e[_0x3631('0x1b')]?_0x49f34e[_0x3631('0x1b')][_0x3631('0x21')]||null:null,'include':_0x49f34e[_0x3631('0x1b')]?_0x49f34e['options'][_0x3631('0x1f')]?_[_0x3631('0x1e')](_0x49f34e[_0x3631('0x1b')]['include'],function(_0x37351c){return{'model':db[_0x37351c[_0x3631('0x20')]],'as':_0x37351c['as'],'attributes':_0x37351c[_0x3631('0x21')],'include':_0x37351c[_0x3631('0x1f')]?_[_0x3631('0x1e')](_0x37351c[_0x3631('0x1f')],function(_0x3e0354){return{'model':db[_0x3e0354['model']],'as':_0x3e0354['as'],'attributes':_0x3e0354[_0x3631('0x21')],'include':_0x3e0354[_0x3631('0x1f')]?_[_0x3631('0x1e')](_0x3e0354[_0x3631('0x1f')],function(_0x2eb950){return{'model':db[_0x2eb950[_0x3631('0x20')]],'as':_0x2eb950['as'],'attributes':_0x2eb950['attributes']};}):[]};}):[]};}):[]:[]})[_0x3631('0x26')](function(_0x5b540b){logger[_0x3631('0xf')](_0x3631('0x23'),_0x49f34e);logger['debug']('ShowWhatsappQueue',_0x49f34e,JSON[_0x3631('0x14')](_0x5b540b));_0x5d8497(_0x5b540b);})[_0x3631('0x22')](function(_0x55e26e){logger[_0x3631('0x15')](_0x3631('0x23'),_0x55e26e[_0x3631('0x17')],_0x49f34e);_0x50ee55(_0x301b1f[_0x3631('0x15')](0x1f4,_0x55e26e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 302ac10..88deab2 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 _0xb788=['emit','removeListener','register','length','./whatsappQueue.events','save','remove','update'];(function(_0x499ba3,_0x6c3057){var _0x1972f0=function(_0x59b6f8){while(--_0x59b6f8){_0x499ba3['push'](_0x499ba3['shift']());}};_0x1972f0(++_0x6c3057);}(_0xb788,0x184));var _0x8b78=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0xb788[_0x37d3f3];return _0x185c9c;};'use strict';var WhatsappQueueEvents=require(_0x8b78('0x0'));var events=[_0x8b78('0x1'),_0x8b78('0x2'),_0x8b78('0x3')];function createListener(_0x2b8a39,_0xbf7872){return function(_0x2dd95e){_0xbf7872[_0x8b78('0x4')](_0x2b8a39,_0x2dd95e);};}function removeListener(_0x37690f,_0x1c6723){return function(){WhatsappQueueEvents[_0x8b78('0x5')](_0x37690f,_0x1c6723);};}exports[_0x8b78('0x6')]=function(_0x5532eb){for(var _0x849027=0x0,_0x47a9d7=events[_0x8b78('0x7')];_0x849027<_0x47a9d7;_0x849027++){var _0x3c8d70=events[_0x849027];var _0x3cbf56=createListener('whatsappQueue:'+_0x3c8d70,_0x5532eb);WhatsappQueueEvents['on'](_0x3c8d70,_0x3cbf56);}}; \ No newline at end of file +var _0xfdb0=['emit','removeListener','register','length','./whatsappQueue.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfdb0,0x1cb));var _0x0fdb=function(_0x601466,_0x5eb67f){_0x601466=_0x601466-0x0;var _0xd08a92=_0xfdb0[_0x601466];return _0xd08a92;};'use strict';var WhatsappQueueEvents=require(_0x0fdb('0x0'));var events=[_0x0fdb('0x1'),_0x0fdb('0x2'),'update'];function createListener(_0x344f6d,_0x59289d){return function(_0x3417f7){_0x59289d[_0x0fdb('0x3')](_0x344f6d,_0x3417f7);};}function removeListener(_0x4fe02a,_0x208d19){return function(){WhatsappQueueEvents[_0x0fdb('0x4')](_0x4fe02a,_0x208d19);};}exports[_0x0fdb('0x5')]=function(_0x4aa90f){for(var _0x48d94f=0x0,_0x23097d=events[_0x0fdb('0x6')];_0x48d94f<_0x23097d;_0x48d94f++){var _0x197f2b=events[_0x48d94f];var _0x231e92=createListener('whatsappQueue:'+_0x197f2b,_0x4aa90f);WhatsappQueueEvents['on'](_0x197f2b,_0x231e92);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8435fb7..2604375 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 _0xe863=['Router','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','put','/:id','destroy','util','path','connect-timeout','express'];(function(_0x3f4055,_0x2f783b){var _0x2a3a65=function(_0x1d603b){while(--_0x1d603b){_0x3f4055['push'](_0x3f4055['shift']());}};_0x2a3a65(++_0x2f783b);}(_0xe863,0x84));var _0x3e86=function(_0x31282b,_0xa476db){_0x31282b=_0x31282b-0x0;var _0x19c632=_0xe863[_0x31282b];return _0x19c632;};'use strict';var multer=require('multer');var util=require(_0x3e86('0x0'));var path=require(_0x3e86('0x1'));var timeout=require(_0x3e86('0x2'));var express=require(_0x3e86('0x3'));var router=express[_0x3e86('0x4')]();var fs_extra=require(_0x3e86('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e86('0x6'));var config=require('../../config/environment');var controller=require(_0x3e86('0x7'));router['get']('/',auth[_0x3e86('0x8')](),controller[_0x3e86('0x9')]);router[_0x3e86('0xa')](_0x3e86('0xb'),auth[_0x3e86('0x8')](),controller[_0x3e86('0xc')]);router[_0x3e86('0xa')]('/:id',auth[_0x3e86('0x8')](),controller['show']);router[_0x3e86('0xd')]('/',auth[_0x3e86('0x8')](),controller['create']);router[_0x3e86('0xe')](_0x3e86('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3e86('0x10')]);module['exports']=router; \ No newline at end of file +var _0x316c=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x5696b5,_0x581373){var _0x2070df=function(_0x356127){while(--_0x356127){_0x5696b5['push'](_0x5696b5['shift']());}};_0x2070df(++_0x581373);}(_0x316c,0x18f));var _0xc316=function(_0x5d4dc3,_0x172da3){_0x5d4dc3=_0x5d4dc3-0x0;var _0x9376ee=_0x316c[_0x5d4dc3];return _0x9376ee;};'use strict';var multer=require(_0xc316('0x0'));var util=require(_0xc316('0x1'));var path=require(_0xc316('0x2'));var timeout=require(_0xc316('0x3'));var express=require(_0xc316('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc316('0x5'));var interaction=require(_0xc316('0x6'));var config=require(_0xc316('0x7'));var controller=require(_0xc316('0x8'));router[_0xc316('0x9')]('/',auth['isAuthenticated'](),controller[_0xc316('0xa')]);router['get'](_0xc316('0xb'),auth['isAuthenticated'](),controller[_0xc316('0xc')]);router[_0xc316('0x9')](_0xc316('0xd'),auth[_0xc316('0xe')](),controller[_0xc316('0xf')]);router[_0xc316('0x10')]('/',auth[_0xc316('0xe')](),controller[_0xc316('0x11')]);router[_0xc316('0x12')](_0xc316('0xd'),auth[_0xc316('0xe')](),controller[_0xc316('0x13')]);router[_0xc316('0x14')](_0xc316('0xd'),auth['isAuthenticated'](),controller[_0xc316('0x15')]);module[_0xc316('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 42d140b..fb4e48d 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x46de78,_0x3da4e7){var _0x5f5550=function(_0x1eaf39){while(--_0x1eaf39){_0x46de78['push'](_0x46de78['shift']());}};_0x5f5550(++_0x3da4e7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x51b2ee,_0x17bc64){var _0xd02810=function(_0x11044e){while(--_0x11044e){_0x51b2ee['push'](_0x51b2ee['shift']());}};_0xd02810(++_0x17bc64);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 1f30b25..a81ba84 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 _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x3af0d0,_0xee84f9){var _0x5533a7=function(_0xe0d1c7){while(--_0xe0d1c7){_0x3af0d0['push'](_0x3af0d0['shift']());}};_0x5533a7(++_0xee84f9);}(_0x1c9a,0x98));var _0xa1c9=function(_0x27855a,_0x23e4f9){_0x27855a=_0x27855a-0x0;var _0x31cf0d=_0x1c9a[_0x27855a];return _0x31cf0d;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));}; \ No newline at end of file +var _0x7af2=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x2923b8,_0x1dba92){var _0x25659a=function(_0x12c8d8){while(--_0x12c8d8){_0x2923b8['push'](_0x2923b8['shift']());}};_0x25659a(++_0x1dba92);}(_0x7af2,0x119));var _0x27af=function(_0x3101fd,_0x4b55be){_0x3101fd=_0x3101fd-0x0;var _0x3e6465=_0x7af2[_0x3101fd];return _0x3e6465;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];function respondWithStatusCode(_0x49a883,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x203501){if(_0x203501){return _0x49a883[_0x27af('0x17')](_0x406340);}return _0x49a883[_0x27af('0x18')](_0x406340)[_0x27af('0x19')]();};}function respondWithResult(_0x1edb50,_0x234825){_0x234825=_0x234825||0xc8;return function(_0x3da435){if(_0x3da435){return _0x1edb50[_0x27af('0x18')](_0x234825)[_0x27af('0x1a')](_0x3da435);}};}function respondWithFilteredResult(_0x30f675,_0x9c2d4b){return function(_0x2d7800){if(_0x2d7800){var _0x3102c4=typeof _0x9c2d4b[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x9c2d4b[_0x27af('0x1d')]===_0x27af('0x1c');var _0x58583a=_0x2d7800[_0x27af('0x1e')];var _0x31d702=_0x3102c4?0x0:_0x9c2d4b['offset'];var _0x4e6e2f=_0x3102c4?_0x2d7800[_0x27af('0x1e')]:_0x9c2d4b[_0x27af('0x1b')]+_0x9c2d4b[_0x27af('0x1d')];var _0x31573a;if(_0x4e6e2f>=_0x58583a){_0x4e6e2f=_0x58583a;_0x31573a=0xc8;}else{_0x31573a=0xce;}_0x30f675[_0x27af('0x18')](_0x31573a);return _0x30f675['set'](_0x27af('0x1f'),_0x31d702+'-'+_0x4e6e2f+'/'+_0x58583a)[_0x27af('0x1a')](_0x2d7800);}return null;};}function patchUpdates(_0xcb4b90){return function(_0x5e7c19){try{jsonpatch[_0x27af('0x20')](_0x5e7c19,_0xcb4b90,!![]);}catch(_0x2eec5f){return BPromise[_0x27af('0x21')](_0x2eec5f);}return _0x5e7c19['save']();};}function saveUpdates(_0x2dce2b,_0x2460f4){return function(_0x30720b){if(_0x30720b){return _0x30720b[_0x27af('0x22')](_0x2dce2b)[_0x27af('0x23')](function(_0x396156){return _0x396156;});}return null;};}function removeEntity(_0x43dd9e,_0x35b36d){return function(_0x2e1bb0){if(_0x2e1bb0){return _0x2e1bb0['destroy']()['then'](function(){_0x43dd9e['status'](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x4feaf1,_0x12625c){return function(_0x396326){if(!_0x396326){_0x4feaf1['sendStatus'](0x194);}return _0x396326;};}function handleError(_0x393190,_0x1d9341){_0x1d9341=_0x1d9341||0x1f4;return function(_0x463e36){logger[_0x27af('0x24')](_0x463e36[_0x27af('0x25')]);if(_0x463e36[_0x27af('0x26')]){delete _0x463e36[_0x27af('0x26')];}_0x393190['status'](_0x1d9341)[_0x27af('0x27')](_0x463e36);};}exports[_0x27af('0x28')]=function(_0xadd38e,_0xe009a){var _0x25d65a={},_0xa08dd9={},_0x42a5b7={'count':0x0,'rows':[]};var _0x2b26ac=_[_0x27af('0x29')](db[_0x27af('0x2a')][_0x27af('0x2b')],function(_0x4f4955){return{'name':_0x4f4955[_0x27af('0x2c')],'type':_0x4f4955[_0x27af('0x2d')][_0x27af('0x2e')]};});_0xa08dd9[_0x27af('0x2f')]=_[_0x27af('0x29')](_0x2b26ac,_0x27af('0x26'));_0xa08dd9['query']=_['keys'](_0xadd38e[_0x27af('0x30')]);_0xa08dd9[_0x27af('0x31')]=_['intersection'](_0xa08dd9[_0x27af('0x2f')],_0xa08dd9[_0x27af('0x30')]);_0x25d65a[_0x27af('0x32')]=_[_0x27af('0x33')](_0xa08dd9[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xadd38e[_0x27af('0x30')][_0x27af('0x34')]));_0x25d65a[_0x27af('0x32')]=_0x25d65a[_0x27af('0x32')][_0x27af('0x35')]?_0x25d65a['attributes']:_0xa08dd9['model'];if(!_0xadd38e[_0x27af('0x30')][_0x27af('0x36')]('nolimit')){_0x25d65a[_0x27af('0x1d')]=qs[_0x27af('0x1d')](_0xadd38e['query'][_0x27af('0x1d')]);_0x25d65a[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xadd38e[_0x27af('0x30')][_0x27af('0x1b')]);}_0x25d65a['order']=qs[_0x27af('0x37')](_0xadd38e[_0x27af('0x30')]['sort']);_0x25d65a['where']=qs[_0x27af('0x31')](_[_0x27af('0x38')](_0xadd38e[_0x27af('0x30')],_0xa08dd9[_0x27af('0x31')]),_0x2b26ac);if(_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]){_0x25d65a['where']=_[_0x27af('0x3a')](_0x25d65a['where'],{'$or':_[_0x27af('0x29')](_0x2b26ac,function(_0x38a532){if(_0x38a532[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x1c6a4d={};_0x1c6a4d[_0x38a532['name']]={'$like':'%'+_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]+'%'};return _0x1c6a4d;}})});}_0x25d65a=_[_0x27af('0x3a')]({},_0x25d65a,_0xadd38e[_0x27af('0x3c')]);var _0x10c1be={'where':_0x25d65a[_0x27af('0x3d')]};return db[_0x27af('0x2a')][_0x27af('0x1e')](_0x10c1be)[_0x27af('0x23')](function(_0x18f11b){_0x42a5b7[_0x27af('0x1e')]=_0x18f11b;if(_0xadd38e[_0x27af('0x30')][_0x27af('0x3e')]){_0x25d65a[_0x27af('0x3f')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x27af('0x40')](_0x25d65a);})[_0x27af('0x23')](function(_0x44534b){_0x42a5b7[_0x27af('0x41')]=_0x44534b;return _0x42a5b7;})['then'](respondWithFilteredResult(_0xe009a,_0x25d65a))[_0x27af('0x42')](handleError(_0xe009a,null));};exports['show']=function(_0x516651,_0x2425dd){var _0x3c9c81={'raw':!![],'where':{'id':_0x516651[_0x27af('0x43')]['id']}},_0x279f99={};_0x279f99[_0x27af('0x2f')]=_[_0x27af('0x44')](db[_0x27af('0x2a')][_0x27af('0x2b')]);_0x279f99[_0x27af('0x30')]=_[_0x27af('0x44')](_0x516651[_0x27af('0x30')]);_0x279f99[_0x27af('0x31')]=_['intersection'](_0x279f99[_0x27af('0x2f')],_0x279f99[_0x27af('0x30')]);_0x3c9c81['attributes']=_['intersection'](_0x279f99[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x516651[_0x27af('0x30')][_0x27af('0x34')]));_0x3c9c81[_0x27af('0x32')]=_0x3c9c81['attributes'][_0x27af('0x35')]?_0x3c9c81['attributes']:_0x279f99[_0x27af('0x2f')];if(_0x516651[_0x27af('0x30')][_0x27af('0x3e')]){_0x3c9c81[_0x27af('0x3f')]=[{'all':!![]}];}_0x3c9c81=_[_0x27af('0x3a')]({},_0x3c9c81,_0x516651[_0x27af('0x3c')]);return db[_0x27af('0x2a')]['find'](_0x3c9c81)['then'](handleEntityNotFound(_0x2425dd,null))[_0x27af('0x23')](respondWithResult(_0x2425dd,null))['catch'](handleError(_0x2425dd,null));};exports[_0x27af('0x45')]=function(_0x1b43e2,_0x226025){return db[_0x27af('0x2a')][_0x27af('0x45')](_0x1b43e2[_0x27af('0x46')],{})[_0x27af('0x23')](respondWithResult(_0x226025,0xc9))['catch'](handleError(_0x226025,null));};exports[_0x27af('0x22')]=function(_0xc7e2a8,_0x20e180){if(_0xc7e2a8[_0x27af('0x46')]['id']){delete _0xc7e2a8[_0x27af('0x46')]['id'];}return db['WhatsappQueueReport'][_0x27af('0x47')]({'where':{'id':_0xc7e2a8[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x20e180,null))['then'](saveUpdates(_0xc7e2a8['body'],null))[_0x27af('0x23')](respondWithResult(_0x20e180,null))[_0x27af('0x42')](handleError(_0x20e180,null));};exports[_0x27af('0x48')]=function(_0x5be44f,_0x495794){return db[_0x27af('0x2a')]['find']({'where':{'id':_0x5be44f[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x495794,null))[_0x27af('0x23')](removeEntity(_0x495794,null))[_0x27af('0x42')](handleError(_0x495794,null));};exports[_0x27af('0x49')]=function(_0xb9e23,_0x123533){return db[_0x27af('0x2a')][_0x27af('0x49')]()[_0x27af('0x23')](respondWithResult(_0x123533,null))[_0x27af('0x42')](handleError(_0x123533,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 95a75f4..7a26494 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 _0x52b4=['uniqueid','lodash','util','api','bluebird','path','rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x2f987f,_0x1e91ae){var _0x4378f9=function(_0x40c010){while(--_0x40c010){_0x2f987f['push'](_0x2f987f['shift']());}};_0x4378f9(++_0x1e91ae);}(_0x52b4,0x64));var _0x452b=function(_0x8ba65c,_0x2ccef2){_0x8ba65c=_0x8ba65c-0x0;var _0x1c909f=_0x52b4[_0x8ba65c];return _0x1c909f;};'use strict';var _=require(_0x452b('0x0'));var util=require(_0x452b('0x1'));var logger=require('../../config/logger')(_0x452b('0x2'));var moment=require('moment');var BPromise=require(_0x452b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x452b('0x4'));var rimraf=require(_0x452b('0x5'));var config=require('../../config/environment');var attributes=require(_0x452b('0x6'));module[_0x452b('0x7')]=function(_0x20bf2f,_0x4fed45){return _0x20bf2f[_0x452b('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x452b('0x9'),'paranoid':![],'indexes':[{'name':_0x452b('0xa'),'fields':[_0x452b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa21b=['api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x453a81,_0xa594c1){var _0x4812e6=function(_0x4dc09a){while(--_0x4dc09a){_0x453a81['push'](_0x453a81['shift']());}};_0x4812e6(++_0xa594c1);}(_0xa21b,0x166));var _0xba21=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa21b[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xba21('0x0'));var util=require('util');var logger=require(_0xba21('0x1'))(_0xba21('0x2'));var moment=require(_0xba21('0x3'));var BPromise=require(_0xba21('0x4'));var rp=require(_0xba21('0x5'));var fs=require('fs');var path=require(_0xba21('0x6'));var rimraf=require('rimraf');var config=require(_0xba21('0x7'));var attributes=require(_0xba21('0x8'));module[_0xba21('0x9')]=function(_0x262f8a,_0x529d2f){return _0x262f8a['define'](_0xba21('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xba21('0xb'),'fields':[_0xba21('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 253c694..d0178e2 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 _0x2802=['../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','CreateWhatsappQueueReport','update','raw','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2f55e8,_0x4919a8){var _0x5a4dd8=function(_0x382395){while(--_0x382395){_0x2f55e8['push'](_0x2f55e8['shift']());}};_0x5a4dd8(++_0x4919a8);}(_0x2802,0x118));var _0x2280=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x2802[_0x4d0df6];return _0x4e2615;};'use strict';var _=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var moment=require(_0x2280('0x2'));var BPromise=require(_0x2280('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2280('0x4'))['db'];var utils=require(_0x2280('0x5'));var logger=require(_0x2280('0x6'))(_0x2280('0x7'));var config=require(_0x2280('0x8'));var jayson=require(_0x2280('0x9'));var client=jayson[_0x2280('0xa')][_0x2280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1888af,_0x1b0875,_0x117ea7){return new BPromise(function(_0x5bbdec,_0x39b5fe){return client['request'](_0x1888af,_0x117ea7)[_0x2280('0xc')](function(_0x3aca59){logger[_0x2280('0xd')](_0x2280('0xe'),_0x1b0875,_0x2280('0xf'));logger[_0x2280('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1b0875,_0x2280('0xf'),JSON[_0x2280('0x11')](_0x3aca59));if(_0x3aca59[_0x2280('0x12')]){if(_0x3aca59[_0x2280('0x12')]['code']===0x1f4){logger['error'](_0x2280('0xe'),_0x1b0875,_0x3aca59[_0x2280('0x12')][_0x2280('0x13')]);return _0x39b5fe(_0x3aca59[_0x2280('0x12')][_0x2280('0x13')]);}logger[_0x2280('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b0875,_0x3aca59[_0x2280('0x12')][_0x2280('0x13')]);return _0x5bbdec(_0x3aca59[_0x2280('0x12')][_0x2280('0x13')]);}else{logger[_0x2280('0xd')](_0x2280('0xe'),_0x1b0875,_0x2280('0xf'));_0x5bbdec(_0x3aca59[_0x2280('0x14')][_0x2280('0x13')]);}})[_0x2280('0x15')](function(_0x5b538c){logger['error'](_0x2280('0xe'),_0x1b0875,_0x5b538c);_0x39b5fe(_0x5b538c);});});}exports['CreateWhatsappQueueReport']=function(_0x80fcea){var _0x1ec629=this;return new Promise(function(_0x160871,_0x5ab282){return db[_0x2280('0x16')][_0x2280('0x17')](_0x80fcea[_0x2280('0x18')],{'raw':_0x80fcea[_0x2280('0x19')]?_0x80fcea[_0x2280('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2280('0xc')](function(_0xc4637a){logger[_0x2280('0xd')](_0x2280('0x1a'),_0x80fcea);logger[_0x2280('0x10')](_0x2280('0x1a'),_0x80fcea,JSON['stringify'](_0xc4637a));_0x160871(_0xc4637a);})[_0x2280('0x15')](function(_0xa079d0){logger[_0x2280('0x12')](_0x2280('0x1a'),_0xa079d0['message'],_0x80fcea);_0x5ab282(_0x1ec629['error'](0x1f4,_0xa079d0[_0x2280('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x29a823){var _0x12ef08=this;return new Promise(function(_0x33de27,_0x310021){return db['WhatsappQueueReport'][_0x2280('0x1b')](_0x29a823[_0x2280('0x18')],{'raw':_0x29a823[_0x2280('0x19')]?_0x29a823[_0x2280('0x19')][_0x2280('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a823[_0x2280('0x19')]?_0x29a823[_0x2280('0x19')]['where']||null:null,'attributes':_0x29a823[_0x2280('0x19')]?_0x29a823['options'][_0x2280('0x1d')]||null:null,'limit':_0x29a823[_0x2280('0x19')]?_0x29a823[_0x2280('0x19')][_0x2280('0x1e')]||null:null})['then'](function(_0x1446dd){logger[_0x2280('0xd')](_0x2280('0x1f'),_0x29a823);logger[_0x2280('0x10')](_0x2280('0x1f'),_0x29a823,JSON[_0x2280('0x11')](_0x1446dd));_0x33de27(_0x1446dd);})['catch'](function(_0x5084c2){logger['error'](_0x2280('0x1f'),_0x5084c2[_0x2280('0x13')],_0x29a823);_0x310021(_0x12ef08[_0x2280('0x12')](0x1f4,_0x5084c2[_0x2280('0x13')]));});});}; \ No newline at end of file +var _0x9012=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','debug','UpdateWhatsappQueueReport','body','where','attributes','limit','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9012,0x1b0));var _0x2901=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x9012[_0x4fc80b];return _0x119dba;};'use strict';var _=require(_0x2901('0x0'));var util=require(_0x2901('0x1'));var moment=require('moment');var BPromise=require(_0x2901('0x2'));var rs=require(_0x2901('0x3'));var fs=require('fs');var Redis=require(_0x2901('0x4'));var db=require(_0x2901('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2901('0x6'))(_0x2901('0x7'));var config=require('../../config/environment');var jayson=require(_0x2901('0x8'));var client=jayson['client'][_0x2901('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21702f,_0x3d2155,_0x4ce64e){return new BPromise(function(_0x5505c4,_0x35b8fd){return client[_0x2901('0xa')](_0x21702f,_0x4ce64e)[_0x2901('0xb')](function(_0x3bd7f1){logger[_0x2901('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3d2155,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3d2155,'request\x20sent',JSON[_0x2901('0xd')](_0x3bd7f1));if(_0x3bd7f1['error']){if(_0x3bd7f1[_0x2901('0xe')][_0x2901('0xf')]===0x1f4){logger[_0x2901('0xe')](_0x2901('0x10'),_0x3d2155,_0x3bd7f1['error'][_0x2901('0x11')]);return _0x35b8fd(_0x3bd7f1[_0x2901('0xe')][_0x2901('0x11')]);}logger[_0x2901('0xe')](_0x2901('0x10'),_0x3d2155,_0x3bd7f1[_0x2901('0xe')][_0x2901('0x11')]);return _0x5505c4(_0x3bd7f1['error'][_0x2901('0x11')]);}else{logger[_0x2901('0xc')](_0x2901('0x10'),_0x3d2155,_0x2901('0x12'));_0x5505c4(_0x3bd7f1[_0x2901('0x13')][_0x2901('0x11')]);}})[_0x2901('0x14')](function(_0x418243){logger[_0x2901('0xe')](_0x2901('0x10'),_0x3d2155,_0x418243);_0x35b8fd(_0x418243);});});}exports[_0x2901('0x15')]=function(_0x51a414){var _0x238cd8=this;return new Promise(function(_0x24a4fd,_0x3441e3){return db[_0x2901('0x16')]['create'](_0x51a414['body'],{'raw':_0x51a414[_0x2901('0x17')]?_0x51a414['options'][_0x2901('0x18')]===undefined?!![]:![]:!![]})[_0x2901('0xb')](function(_0x2f48f1){logger[_0x2901('0xc')](_0x2901('0x15'),_0x51a414);logger[_0x2901('0x19')](_0x2901('0x15'),_0x51a414,JSON[_0x2901('0xd')](_0x2f48f1));_0x24a4fd(_0x2f48f1);})[_0x2901('0x14')](function(_0x480467){logger[_0x2901('0xe')](_0x2901('0x15'),_0x480467[_0x2901('0x11')],_0x51a414);_0x3441e3(_0x238cd8[_0x2901('0xe')](0x1f4,_0x480467[_0x2901('0x11')]));});});};exports[_0x2901('0x1a')]=function(_0x3be2fb){var _0x248dbc=this;return new Promise(function(_0x21a9f9,_0x9fb250){return db['WhatsappQueueReport']['update'](_0x3be2fb[_0x2901('0x1b')],{'raw':_0x3be2fb[_0x2901('0x17')]?_0x3be2fb[_0x2901('0x17')][_0x2901('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3be2fb[_0x2901('0x17')]?_0x3be2fb[_0x2901('0x17')][_0x2901('0x1c')]||null:null,'attributes':_0x3be2fb[_0x2901('0x17')]?_0x3be2fb['options'][_0x2901('0x1d')]||null:null,'limit':_0x3be2fb[_0x2901('0x17')]?_0x3be2fb['options'][_0x2901('0x1e')]||null:null})[_0x2901('0xb')](function(_0x436b6e){logger[_0x2901('0xc')](_0x2901('0x1a'),_0x3be2fb);logger[_0x2901('0x19')](_0x2901('0x1a'),_0x3be2fb,JSON[_0x2901('0xd')](_0x436b6e));_0x21a9f9(_0x436b6e);})[_0x2901('0x14')](function(_0x57f9c1){logger[_0x2901('0xe')]('UpdateWhatsappQueueReport',_0x57f9c1[_0x2901('0x11')],_0x3be2fb);_0x9fb250(_0x248dbc[_0x2901('0xe')](0x1f4,_0x57f9c1[_0x2901('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index a31ae5a..ecf8b93 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 _0xe10a=['./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0xe10a,0x151));var _0xae10=function(_0x39df7d,_0x44c1f6){_0x39df7d=_0x39df7d-0x0;var _0x16d25e=_0xe10a[_0x39df7d];return _0x16d25e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae10('0x0'));var timeout=require(_0xae10('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xae10('0x2'));var auth=require(_0xae10('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xae10('0x4'));var controller=require(_0xae10('0x5'));router[_0xae10('0x6')]('/',auth[_0xae10('0x7')](),controller[_0xae10('0x8')]);router[_0xae10('0x6')](_0xae10('0x9'),auth['isAuthenticated'](),controller[_0xae10('0xa')]);router[_0xae10('0x6')](_0xae10('0xb'),auth['isAuthenticated'](),controller[_0xae10('0xc')]);router[_0xae10('0xd')]('/',auth[_0xae10('0x7')](),controller['create']);router['put'](_0xae10('0xb'),auth[_0xae10('0x7')](),controller[_0xae10('0xe')]);router[_0xae10('0xf')](_0xae10('0xb'),auth[_0xae10('0x7')](),controller[_0xae10('0x10')]);module[_0xae10('0x11')]=router; \ No newline at end of file +var _0x3037=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x48e196,_0x2b4033){var _0x1d1323=function(_0x5da829){while(--_0x5da829){_0x48e196['push'](_0x48e196['shift']());}};_0x1d1323(++_0x2b4033);}(_0x3037,0x126));var _0x7303=function(_0x1a16ba,_0x1fe509){_0x1a16ba=_0x1a16ba-0x0;var _0x2f6f50=_0x3037[_0x1a16ba];return _0x2f6f50;};'use strict';var multer=require(_0x7303('0x0'));var util=require(_0x7303('0x1'));var path=require(_0x7303('0x2'));var timeout=require(_0x7303('0x3'));var express=require('express');var router=express[_0x7303('0x4')]();var fs_extra=require(_0x7303('0x5'));var auth=require(_0x7303('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7303('0x7'));router[_0x7303('0x8')]('/',auth[_0x7303('0x9')](),controller['index']);router[_0x7303('0x8')](_0x7303('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7303('0x8')](_0x7303('0xb'),auth[_0x7303('0x9')](),controller['show']);router[_0x7303('0xc')]('/',auth['isAuthenticated'](),controller[_0x7303('0xd')]);router[_0x7303('0xe')](_0x7303('0xb'),auth[_0x7303('0x9')](),controller[_0x7303('0xf')]);router['delete'](_0x7303('0xb'),auth[_0x7303('0x9')](),controller[_0x7303('0x10')]);module[_0x7303('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 79020dd..fba2710 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 _0x5464=['exports','STRING','account','queue','sequelize'];(function(_0xe3f0b0,_0x43edc9){var _0x3a839e=function(_0x45e9cf){while(--_0x45e9cf){_0xe3f0b0['push'](_0xe3f0b0['shift']());}};_0x3a839e(++_0x43edc9);}(_0x5464,0x15d));var _0x4546=function(_0xd8c63c,_0x402601){_0xd8c63c=_0xd8c63c-0x0;var _0x54a90c=_0x5464[_0xd8c63c];return _0x54a90c;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'uniqueid':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4546('0x3'),'agent',_0x4546('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x49f8=['ENUM','account','queue','sequelize'];(function(_0x4c632c,_0xb7fa){var _0x2c0451=function(_0x391441){while(--_0x391441){_0x4c632c['push'](_0x4c632c['shift']());}};_0x2c0451(++_0xb7fa);}(_0x49f8,0xff));var _0x849f=function(_0xc835d8,_0x413012){_0xc835d8=_0xc835d8-0x0;var _0x25950f=_0x49f8[_0xc835d8];return _0x25950f;};'use strict';var Sequelize=require(_0x849f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x849f('0x1')](_0x849f('0x2'),'agent',_0x849f('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c9cc264..947be84 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 _0xe7bc=['save','update','then','error','stack','name','send','index','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject'];(function(_0x1883c3,_0x3487c0){var _0x340c3b=function(_0xf3464e){while(--_0xf3464e){_0x1883c3['push'](_0x1883c3['shift']());}};_0x340c3b(++_0x3487c0);}(_0xe7bc,0x1dd));var _0xce7b=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xe7bc[_0x32b542];return _0x554d54;};'use strict';var emlformat=require(_0xce7b('0x0'));var rimraf=require(_0xce7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce7b('0x2'));var rp=require(_0xce7b('0x3'));var moment=require(_0xce7b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce7b('0x5'));var util=require(_0xce7b('0x6'));var path=require(_0xce7b('0x7'));var sox=require('sox');var csv=require(_0xce7b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce7b('0x9'));var _=require(_0xce7b('0xa'));var squel=require(_0xce7b('0xb'));var crypto=require(_0xce7b('0xc'));var jsforce=require(_0xce7b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xce7b('0x8'));var querystring=require('querystring');var Papa=require(_0xce7b('0xe'));var Redis=require('ioredis');var authService=require(_0xce7b('0xf'));var qs=require(_0xce7b('0x10'));var as=require(_0xce7b('0x11'));var hardwareService=require(_0xce7b('0x12'));var logger=require(_0xce7b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xce7b('0x14'));var licenseUtil=require(_0xce7b('0x15'));var db=require(_0xce7b('0x16'))['db'];function respondWithStatusCode(_0x88ca5c,_0x1877fc){_0x1877fc=_0x1877fc||0xcc;return function(_0x2b47ed){if(_0x2b47ed){return _0x88ca5c[_0xce7b('0x17')](_0x1877fc);}return _0x88ca5c[_0xce7b('0x18')](_0x1877fc)[_0xce7b('0x19')]();};}function respondWithResult(_0x3fa55c,_0xfd2dd8){_0xfd2dd8=_0xfd2dd8||0xc8;return function(_0x27740c){if(_0x27740c){return _0x3fa55c[_0xce7b('0x18')](_0xfd2dd8)['json'](_0x27740c);}};}function respondWithFilteredResult(_0x594135,_0x231d2c){return function(_0x308d50){if(_0x308d50){var _0x5ce13a=typeof _0x231d2c['offset']===_0xce7b('0x1a')&&typeof _0x231d2c[_0xce7b('0x1b')]===_0xce7b('0x1a');var _0xe3eac2=_0x308d50[_0xce7b('0x1c')];var _0x516149=_0x5ce13a?0x0:_0x231d2c[_0xce7b('0x1d')];var _0x3c2030=_0x5ce13a?_0x308d50['count']:_0x231d2c[_0xce7b('0x1d')]+_0x231d2c[_0xce7b('0x1b')];var _0x6f2975;if(_0x3c2030>=_0xe3eac2){_0x3c2030=_0xe3eac2;_0x6f2975=0xc8;}else{_0x6f2975=0xce;}_0x594135[_0xce7b('0x18')](_0x6f2975);return _0x594135[_0xce7b('0x1e')]('Content-Range',_0x516149+'-'+_0x3c2030+'/'+_0xe3eac2)[_0xce7b('0x1f')](_0x308d50);}return null;};}function patchUpdates(_0x57f66c){return function(_0x107352){try{jsonpatch[_0xce7b('0x20')](_0x107352,_0x57f66c,!![]);}catch(_0x2f7be4){return BPromise[_0xce7b('0x21')](_0x2f7be4);}return _0x107352[_0xce7b('0x22')]();};}function saveUpdates(_0x16a173,_0x3aa220){return function(_0x4ea770){if(_0x4ea770){return _0x4ea770[_0xce7b('0x23')](_0x16a173)[_0xce7b('0x24')](function(_0x72fa2f){return _0x72fa2f;});}return null;};}function removeEntity(_0xa8c6a5,_0xbec9e0){return function(_0x2ee842){if(_0x2ee842){return _0x2ee842['destroy']()[_0xce7b('0x24')](function(){_0xa8c6a5[_0xce7b('0x18')](0xcc)[_0xce7b('0x19')]();});}};}function handleEntityNotFound(_0x2281c3,_0x4b3cc4){return function(_0xb2a451){if(!_0xb2a451){_0x2281c3[_0xce7b('0x17')](0x194);}return _0xb2a451;};}function handleError(_0x5e5749,_0x2fd278){_0x2fd278=_0x2fd278||0x1f4;return function(_0x3d3faf){logger[_0xce7b('0x25')](_0x3d3faf[_0xce7b('0x26')]);if(_0x3d3faf[_0xce7b('0x27')]){delete _0x3d3faf[_0xce7b('0x27')];}_0x5e5749['status'](_0x2fd278)[_0xce7b('0x28')](_0x3d3faf);};}exports[_0xce7b('0x29')]=function(_0x4228f8,_0x17d713){var _0x4159a7={},_0x4aaea3={},_0x1f4954={'count':0x0,'rows':[]};var _0x4ab5a1=_['map'](db['WhatsappTransferReport'][_0xce7b('0x2a')],function(_0x30f6ef){return{'name':_0x30f6ef['fieldName'],'type':_0x30f6ef[_0xce7b('0x2b')]['key']};});_0x4aaea3[_0xce7b('0x2c')]=_[_0xce7b('0x2d')](_0x4ab5a1,_0xce7b('0x27'));_0x4aaea3[_0xce7b('0x2e')]=_['keys'](_0x4228f8[_0xce7b('0x2e')]);_0x4aaea3[_0xce7b('0x2f')]=_[_0xce7b('0x30')](_0x4aaea3[_0xce7b('0x2c')],_0x4aaea3[_0xce7b('0x2e')]);_0x4159a7[_0xce7b('0x31')]=_[_0xce7b('0x30')](_0x4aaea3[_0xce7b('0x2c')],qs[_0xce7b('0x32')](_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x32')]));_0x4159a7['attributes']=_0x4159a7[_0xce7b('0x31')][_0xce7b('0x33')]?_0x4159a7[_0xce7b('0x31')]:_0x4aaea3['model'];if(!_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x34')](_0xce7b('0x35'))){_0x4159a7[_0xce7b('0x1b')]=qs[_0xce7b('0x1b')](_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x1b')]);_0x4159a7[_0xce7b('0x1d')]=qs[_0xce7b('0x1d')](_0x4228f8['query'][_0xce7b('0x1d')]);}_0x4159a7[_0xce7b('0x36')]=qs[_0xce7b('0x37')](_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x37')]);_0x4159a7[_0xce7b('0x38')]=qs[_0xce7b('0x2f')](_['pick'](_0x4228f8[_0xce7b('0x2e')],_0x4aaea3[_0xce7b('0x2f')]),_0x4ab5a1);if(_0x4228f8['query'][_0xce7b('0x39')]){_0x4159a7[_0xce7b('0x38')]=_[_0xce7b('0x3a')](_0x4159a7[_0xce7b('0x38')],{'$or':_[_0xce7b('0x2d')](_0x4ab5a1,function(_0x3de1e0){if(_0x3de1e0[_0xce7b('0x2b')]!==_0xce7b('0x3b')){var _0xac7e66={};_0xac7e66[_0x3de1e0[_0xce7b('0x27')]]={'$like':'%'+_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x39')]+'%'};return _0xac7e66;}})});}_0x4159a7=_[_0xce7b('0x3a')]({},_0x4159a7,_0x4228f8[_0xce7b('0x3c')]);var _0x57c8a3={'where':_0x4159a7[_0xce7b('0x38')]};return db[_0xce7b('0x3d')]['count'](_0x57c8a3)['then'](function(_0x49ea55){_0x1f4954['count']=_0x49ea55;if(_0x4228f8[_0xce7b('0x2e')][_0xce7b('0x3e')]){_0x4159a7[_0xce7b('0x3f')]=[{'all':!![]}];}return db[_0xce7b('0x3d')][_0xce7b('0x40')](_0x4159a7);})[_0xce7b('0x24')](function(_0x32d860){_0x1f4954[_0xce7b('0x41')]=_0x32d860;return _0x1f4954;})['then'](respondWithFilteredResult(_0x17d713,_0x4159a7))[_0xce7b('0x42')](handleError(_0x17d713,null));};exports['show']=function(_0x30c940,_0x10db5d){var _0x1c3bfd={'raw':!![],'where':{'id':_0x30c940[_0xce7b('0x43')]['id']}},_0x1bfc28={};_0x1bfc28['model']=_[_0xce7b('0x44')](db[_0xce7b('0x3d')][_0xce7b('0x2a')]);_0x1bfc28[_0xce7b('0x2e')]=_[_0xce7b('0x44')](_0x30c940[_0xce7b('0x2e')]);_0x1bfc28[_0xce7b('0x2f')]=_[_0xce7b('0x30')](_0x1bfc28['model'],_0x1bfc28[_0xce7b('0x2e')]);_0x1c3bfd[_0xce7b('0x31')]=_['intersection'](_0x1bfc28[_0xce7b('0x2c')],qs[_0xce7b('0x32')](_0x30c940[_0xce7b('0x2e')][_0xce7b('0x32')]));_0x1c3bfd[_0xce7b('0x31')]=_0x1c3bfd[_0xce7b('0x31')][_0xce7b('0x33')]?_0x1c3bfd[_0xce7b('0x31')]:_0x1bfc28[_0xce7b('0x2c')];if(_0x30c940['query'][_0xce7b('0x3e')]){_0x1c3bfd['include']=[{'all':!![]}];}_0x1c3bfd=_['merge']({},_0x1c3bfd,_0x30c940[_0xce7b('0x3c')]);return db[_0xce7b('0x3d')]['find'](_0x1c3bfd)[_0xce7b('0x24')](handleEntityNotFound(_0x10db5d,null))['then'](respondWithResult(_0x10db5d,null))[_0xce7b('0x42')](handleError(_0x10db5d,null));};exports[_0xce7b('0x45')]=function(_0x1347da,_0x2d3931){return db[_0xce7b('0x3d')][_0xce7b('0x45')](_0x1347da['body'],{})[_0xce7b('0x24')](respondWithResult(_0x2d3931,0xc9))[_0xce7b('0x42')](handleError(_0x2d3931,null));};exports[_0xce7b('0x23')]=function(_0x562f75,_0x341fd1){if(_0x562f75['body']['id']){delete _0x562f75[_0xce7b('0x46')]['id'];}return db['WhatsappTransferReport'][_0xce7b('0x47')]({'where':{'id':_0x562f75[_0xce7b('0x43')]['id']}})[_0xce7b('0x24')](handleEntityNotFound(_0x341fd1,null))['then'](saveUpdates(_0x562f75[_0xce7b('0x46')],null))[_0xce7b('0x24')](respondWithResult(_0x341fd1,null))['catch'](handleError(_0x341fd1,null));};exports[_0xce7b('0x48')]=function(_0x3b5419,_0x2ba58c){return db['WhatsappTransferReport']['find']({'where':{'id':_0x3b5419[_0xce7b('0x43')]['id']}})[_0xce7b('0x24')](handleEntityNotFound(_0x2ba58c,null))[_0xce7b('0x24')](removeEntity(_0x2ba58c,null))[_0xce7b('0x42')](handleError(_0x2ba58c,null));};exports['describe']=function(_0x2dec9f,_0x28b1db){return db[_0xce7b('0x3d')]['describe']()['then'](respondWithResult(_0x28b1db,null))[_0xce7b('0x42')](handleError(_0x28b1db,null));}; \ No newline at end of file +var _0xdbcd=['type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','show','params','rawAttributes','catch','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','WhatsappTransferReport','fieldName'];(function(_0x50f31d,_0x24235e){var _0x3c523f=function(_0x38420a){while(--_0x38420a){_0x50f31d['push'](_0x50f31d['shift']());}};_0x3c523f(++_0x24235e);}(_0xdbcd,0x67));var _0xddbc=function(_0x3e226e,_0x5df0d3){_0x3e226e=_0x3e226e-0x0;var _0x2493ad=_0xdbcd[_0x3e226e];return _0x2493ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddbc('0x0'));var zipdir=require(_0xddbc('0x1'));var jsonpatch=require(_0xddbc('0x2'));var rp=require('request-promise');var moment=require(_0xddbc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xddbc('0x4'));var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require(_0xddbc('0x7'));var csv=require(_0xddbc('0x8'));var ejs=require(_0xddbc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddbc('0xa'));var squel=require(_0xddbc('0xb'));var crypto=require('crypto');var jsforce=require(_0xddbc('0xc'));var deskjs=require(_0xddbc('0xd'));var toCsv=require(_0xddbc('0x8'));var querystring=require(_0xddbc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddbc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xddbc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xddbc('0x11'));var utils=require(_0xddbc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xddbc('0x13'));var db=require(_0xddbc('0x14'))['db'];function respondWithStatusCode(_0x351758,_0x4955b2){_0x4955b2=_0x4955b2||0xcc;return function(_0x28d35f){if(_0x28d35f){return _0x351758['sendStatus'](_0x4955b2);}return _0x351758[_0xddbc('0x15')](_0x4955b2)[_0xddbc('0x16')]();};}function respondWithResult(_0x44b09c,_0x193730){_0x193730=_0x193730||0xc8;return function(_0x286945){if(_0x286945){return _0x44b09c['status'](_0x193730)[_0xddbc('0x17')](_0x286945);}};}function respondWithFilteredResult(_0x370eb9,_0x3482f9){return function(_0x5dc036){if(_0x5dc036){var _0x424a23=typeof _0x3482f9[_0xddbc('0x18')]===_0xddbc('0x19')&&typeof _0x3482f9[_0xddbc('0x1a')]===_0xddbc('0x19');var _0x3af297=_0x5dc036['count'];var _0xfb043f=_0x424a23?0x0:_0x3482f9[_0xddbc('0x18')];var _0x45c92f=_0x424a23?_0x5dc036['count']:_0x3482f9['offset']+_0x3482f9[_0xddbc('0x1a')];var _0x1acd7c;if(_0x45c92f>=_0x3af297){_0x45c92f=_0x3af297;_0x1acd7c=0xc8;}else{_0x1acd7c=0xce;}_0x370eb9[_0xddbc('0x15')](_0x1acd7c);return _0x370eb9['set'](_0xddbc('0x1b'),_0xfb043f+'-'+_0x45c92f+'/'+_0x3af297)[_0xddbc('0x17')](_0x5dc036);}return null;};}function patchUpdates(_0x4b79d8){return function(_0x4a3a4a){try{jsonpatch[_0xddbc('0x1c')](_0x4a3a4a,_0x4b79d8,!![]);}catch(_0x412eb6){return BPromise[_0xddbc('0x1d')](_0x412eb6);}return _0x4a3a4a[_0xddbc('0x1e')]();};}function saveUpdates(_0x54a869,_0xa1352f){return function(_0x31b36d){if(_0x31b36d){return _0x31b36d['update'](_0x54a869)['then'](function(_0x8a2659){return _0x8a2659;});}return null;};}function removeEntity(_0x4b71e2,_0x30b3a2){return function(_0x5bf670){if(_0x5bf670){return _0x5bf670[_0xddbc('0x1f')]()[_0xddbc('0x20')](function(){_0x4b71e2[_0xddbc('0x15')](0xcc)[_0xddbc('0x16')]();});}};}function handleEntityNotFound(_0x404270,_0x4a91a2){return function(_0x3bbec5){if(!_0x3bbec5){_0x404270[_0xddbc('0x21')](0x194);}return _0x3bbec5;};}function handleError(_0x9b2e33,_0xedda1){_0xedda1=_0xedda1||0x1f4;return function(_0x4f4ace){logger[_0xddbc('0x22')](_0x4f4ace[_0xddbc('0x23')]);if(_0x4f4ace[_0xddbc('0x24')]){delete _0x4f4ace[_0xddbc('0x24')];}_0x9b2e33[_0xddbc('0x15')](_0xedda1)['send'](_0x4f4ace);};}exports[_0xddbc('0x25')]=function(_0x3d5235,_0x49fa43){var _0x5b5fd1={},_0x2e1217={},_0x169ef4={'count':0x0,'rows':[]};var _0x518af5=_[_0xddbc('0x26')](db[_0xddbc('0x27')]['rawAttributes'],function(_0xf43b00){return{'name':_0xf43b00[_0xddbc('0x28')],'type':_0xf43b00[_0xddbc('0x29')][_0xddbc('0x2a')]};});_0x2e1217['model']=_[_0xddbc('0x26')](_0x518af5,_0xddbc('0x24'));_0x2e1217[_0xddbc('0x2b')]=_[_0xddbc('0x2c')](_0x3d5235[_0xddbc('0x2b')]);_0x2e1217[_0xddbc('0x2d')]=_[_0xddbc('0x2e')](_0x2e1217[_0xddbc('0x2f')],_0x2e1217[_0xddbc('0x2b')]);_0x5b5fd1[_0xddbc('0x30')]=_[_0xddbc('0x2e')](_0x2e1217['model'],qs[_0xddbc('0x31')](_0x3d5235[_0xddbc('0x2b')][_0xddbc('0x31')]));_0x5b5fd1['attributes']=_0x5b5fd1[_0xddbc('0x30')][_0xddbc('0x32')]?_0x5b5fd1['attributes']:_0x2e1217[_0xddbc('0x2f')];if(!_0x3d5235[_0xddbc('0x2b')]['hasOwnProperty'](_0xddbc('0x33'))){_0x5b5fd1[_0xddbc('0x1a')]=qs['limit'](_0x3d5235[_0xddbc('0x2b')]['limit']);_0x5b5fd1['offset']=qs['offset'](_0x3d5235[_0xddbc('0x2b')][_0xddbc('0x18')]);}_0x5b5fd1['order']=qs[_0xddbc('0x34')](_0x3d5235[_0xddbc('0x2b')]['sort']);_0x5b5fd1[_0xddbc('0x35')]=qs['filters'](_[_0xddbc('0x36')](_0x3d5235[_0xddbc('0x2b')],_0x2e1217[_0xddbc('0x2d')]),_0x518af5);if(_0x3d5235[_0xddbc('0x2b')]['filter']){_0x5b5fd1['where']=_[_0xddbc('0x37')](_0x5b5fd1[_0xddbc('0x35')],{'$or':_['map'](_0x518af5,function(_0x58fa4){if(_0x58fa4['type']!==_0xddbc('0x38')){var _0x17c828={};_0x17c828[_0x58fa4[_0xddbc('0x24')]]={'$like':'%'+_0x3d5235['query'][_0xddbc('0x39')]+'%'};return _0x17c828;}})});}_0x5b5fd1=_['merge']({},_0x5b5fd1,_0x3d5235[_0xddbc('0x3a')]);var _0x5ce983={'where':_0x5b5fd1[_0xddbc('0x35')]};return db['WhatsappTransferReport']['count'](_0x5ce983)[_0xddbc('0x20')](function(_0x120f21){_0x169ef4[_0xddbc('0x3b')]=_0x120f21;if(_0x3d5235[_0xddbc('0x2b')][_0xddbc('0x3c')]){_0x5b5fd1[_0xddbc('0x3d')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x5b5fd1);})[_0xddbc('0x20')](function(_0x3c23ef){_0x169ef4[_0xddbc('0x3e')]=_0x3c23ef;return _0x169ef4;})[_0xddbc('0x20')](respondWithFilteredResult(_0x49fa43,_0x5b5fd1))['catch'](handleError(_0x49fa43,null));};exports[_0xddbc('0x3f')]=function(_0x356966,_0x1df159){var _0x16d69e={'raw':!![],'where':{'id':_0x356966[_0xddbc('0x40')]['id']}},_0x5333c4={};_0x5333c4[_0xddbc('0x2f')]=_[_0xddbc('0x2c')](db[_0xddbc('0x27')][_0xddbc('0x41')]);_0x5333c4[_0xddbc('0x2b')]=_[_0xddbc('0x2c')](_0x356966[_0xddbc('0x2b')]);_0x5333c4[_0xddbc('0x2d')]=_[_0xddbc('0x2e')](_0x5333c4[_0xddbc('0x2f')],_0x5333c4['query']);_0x16d69e[_0xddbc('0x30')]=_[_0xddbc('0x2e')](_0x5333c4['model'],qs[_0xddbc('0x31')](_0x356966['query']['fields']));_0x16d69e['attributes']=_0x16d69e[_0xddbc('0x30')][_0xddbc('0x32')]?_0x16d69e[_0xddbc('0x30')]:_0x5333c4[_0xddbc('0x2f')];if(_0x356966[_0xddbc('0x2b')][_0xddbc('0x3c')]){_0x16d69e[_0xddbc('0x3d')]=[{'all':!![]}];}_0x16d69e=_[_0xddbc('0x37')]({},_0x16d69e,_0x356966[_0xddbc('0x3a')]);return db[_0xddbc('0x27')]['find'](_0x16d69e)[_0xddbc('0x20')](handleEntityNotFound(_0x1df159,null))[_0xddbc('0x20')](respondWithResult(_0x1df159,null))[_0xddbc('0x42')](handleError(_0x1df159,null));};exports[_0xddbc('0x43')]=function(_0x4a1fa2,_0x189fb5){return db['WhatsappTransferReport'][_0xddbc('0x43')](_0x4a1fa2[_0xddbc('0x44')],{})['then'](respondWithResult(_0x189fb5,0xc9))[_0xddbc('0x42')](handleError(_0x189fb5,null));};exports[_0xddbc('0x45')]=function(_0x37be9b,_0x201e6f){if(_0x37be9b[_0xddbc('0x44')]['id']){delete _0x37be9b['body']['id'];}return db[_0xddbc('0x27')][_0xddbc('0x46')]({'where':{'id':_0x37be9b['params']['id']}})['then'](handleEntityNotFound(_0x201e6f,null))[_0xddbc('0x20')](saveUpdates(_0x37be9b[_0xddbc('0x44')],null))['then'](respondWithResult(_0x201e6f,null))[_0xddbc('0x42')](handleError(_0x201e6f,null));};exports[_0xddbc('0x1f')]=function(_0xd4c17,_0x51ad45){return db[_0xddbc('0x27')][_0xddbc('0x46')]({'where':{'id':_0xd4c17[_0xddbc('0x40')]['id']}})[_0xddbc('0x20')](handleEntityNotFound(_0x51ad45,null))[_0xddbc('0x20')](removeEntity(_0x51ad45,null))[_0xddbc('0x42')](handleError(_0x51ad45,null));};exports[_0xddbc('0x47')]=function(_0x41dc24,_0xc4d632){return db[_0xddbc('0x27')][_0xddbc('0x47')]()[_0xddbc('0x20')](respondWithResult(_0xc4d632,null))[_0xddbc('0x42')](handleError(_0xc4d632,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e0591c0..2e7b711 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 _0x3ea0=['bluebird','path','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x16c504,_0x56ca29){var _0x2492ca=function(_0x5070c4){while(--_0x5070c4){_0x16c504['push'](_0x16c504['shift']());}};_0x2492ca(++_0x56ca29);}(_0x3ea0,0x11a));var _0x03ea=function(_0x168057,_0x18fae0){_0x168057=_0x168057-0x0;var _0x470c2f=_0x3ea0[_0x168057];return _0x470c2f;};'use strict';var _=require(_0x03ea('0x0'));var util=require('util');var logger=require(_0x03ea('0x1'))(_0x03ea('0x2'));var moment=require(_0x03ea('0x3'));var BPromise=require(_0x03ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03ea('0x5'));var rimraf=require('rimraf');var config=require(_0x03ea('0x6'));var attributes=require(_0x03ea('0x7'));module[_0x03ea('0x8')]=function(_0x35abfc,_0x158a6f){return _0x35abfc['define'](_0x03ea('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x03ea('0xa'),'fields':[_0x03ea('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3083=['moment','bluebird','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','../../config/logger','api'];(function(_0x597f51,_0x4013e2){var _0x4e774b=function(_0x50ab0e){while(--_0x50ab0e){_0x597f51['push'](_0x597f51['shift']());}};_0x4e774b(++_0x4013e2);}(_0x3083,0xae));var _0x3308=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x3083[_0x48e1ec];return _0x3b33eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3308('0x0'))(_0x3308('0x1'));var moment=require(_0x3308('0x2'));var BPromise=require(_0x3308('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3308('0x4'));var rimraf=require('rimraf');var config=require(_0x3308('0x5'));var attributes=require(_0x3308('0x6'));module[_0x3308('0x7')]=function(_0x1393f3,_0x3326ee){return _0x1393f3[_0x3308('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x3308('0x9'),'paranoid':![],'indexes':[{'name':_0x3308('0xa'),'fields':[_0x3308('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 96b2dc4..ecd516c 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 _0xde67=['../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x564c27,_0x2cdbdd){var _0x49709e=function(_0x1e267f){while(--_0x1e267f){_0x564c27['push'](_0x564c27['shift']());}};_0x49709e(++_0x2cdbdd);}(_0xde67,0x1af));var _0x7de6=function(_0x248703,_0xa58c07){_0x248703=_0x248703-0x0;var _0x12daa9=_0xde67[_0x248703];return _0x12daa9;};'use strict';var _=require(_0x7de6('0x0'));var util=require(_0x7de6('0x1'));var moment=require(_0x7de6('0x2'));var BPromise=require(_0x7de6('0x3'));var rs=require(_0x7de6('0x4'));var fs=require('fs');var Redis=require(_0x7de6('0x5'));var db=require(_0x7de6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7de6('0x7'))('rpc');var config=require(_0x7de6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7de6('0x9')][_0x7de6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ca937,_0x4bc503,_0x4eb0ce){return new BPromise(function(_0x3ff35c,_0x49402e){return client[_0x7de6('0xb')](_0x4ca937,_0x4eb0ce)[_0x7de6('0xc')](function(_0x450492){logger[_0x7de6('0xd')](_0x7de6('0xe'),_0x4bc503,_0x7de6('0xf'));logger['debug'](_0x7de6('0x10'),_0x4bc503,_0x7de6('0xf'),JSON[_0x7de6('0x11')](_0x450492));if(_0x450492[_0x7de6('0x12')]){if(_0x450492[_0x7de6('0x12')][_0x7de6('0x13')]===0x1f4){logger[_0x7de6('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4bc503,_0x450492['error'][_0x7de6('0x14')]);return _0x49402e(_0x450492[_0x7de6('0x12')][_0x7de6('0x14')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x4bc503,_0x450492[_0x7de6('0x12')][_0x7de6('0x14')]);return _0x3ff35c(_0x450492[_0x7de6('0x12')][_0x7de6('0x14')]);}else{logger[_0x7de6('0xd')](_0x7de6('0xe'),_0x4bc503,'request\x20sent');_0x3ff35c(_0x450492[_0x7de6('0x15')][_0x7de6('0x14')]);}})[_0x7de6('0x16')](function(_0x5a4bce){logger[_0x7de6('0x12')](_0x7de6('0xe'),_0x4bc503,_0x5a4bce);_0x49402e(_0x5a4bce);});});} \ No newline at end of file +var _0x9381=['../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28d48f,_0x3030a9){var _0x25e61b=function(_0x2e73ec){while(--_0x2e73ec){_0x28d48f['push'](_0x28d48f['shift']());}};_0x25e61b(++_0x3030a9);}(_0x9381,0x67));var _0x1938=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x9381[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0x1938('0x0'));var moment=require(_0x1938('0x1'));var BPromise=require('bluebird');var rs=require(_0x1938('0x2'));var fs=require('fs');var Redis=require(_0x1938('0x3'));var db=require(_0x1938('0x4'))['db'];var utils=require(_0x1938('0x5'));var logger=require(_0x1938('0x6'))('rpc');var config=require(_0x1938('0x7'));var jayson=require(_0x1938('0x8'));var client=jayson[_0x1938('0x9')][_0x1938('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14bf89,_0x254a91,_0x1bd8cb){return new BPromise(function(_0x26fb3e,_0x703d7b){return client['request'](_0x14bf89,_0x1bd8cb)[_0x1938('0xb')](function(_0x317fcb){logger[_0x1938('0xc')](_0x1938('0xd'),_0x254a91,_0x1938('0xe'));logger['debug'](_0x1938('0xf'),_0x254a91,_0x1938('0xe'),JSON[_0x1938('0x10')](_0x317fcb));if(_0x317fcb[_0x1938('0x11')]){if(_0x317fcb['error'][_0x1938('0x12')]===0x1f4){logger[_0x1938('0x11')](_0x1938('0xd'),_0x254a91,_0x317fcb[_0x1938('0x11')]['message']);return _0x703d7b(_0x317fcb[_0x1938('0x11')][_0x1938('0x13')]);}logger['error'](_0x1938('0xd'),_0x254a91,_0x317fcb[_0x1938('0x11')][_0x1938('0x13')]);return _0x26fb3e(_0x317fcb[_0x1938('0x11')][_0x1938('0x13')]);}else{logger[_0x1938('0xc')](_0x1938('0xd'),_0x254a91,_0x1938('0xe'));_0x26fb3e(_0x317fcb[_0x1938('0x14')]['message']);}})[_0x1938('0x15')](function(_0x4f290f){logger['error'](_0x1938('0xd'),_0x254a91,_0x4f290f);_0x703d7b(_0x4f290f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index b65d9de..94ed222 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x236c=['app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','listen','then','info','start','map','filter','online','join','status','name','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/logger'];(function(_0x5b6e55,_0x2a2b7e){var _0x4ce8d1=function(_0x46b252){while(--_0x46b252){_0x5b6e55['push'](_0x5b6e55['shift']());}};_0x4ce8d1(++_0x2a2b7e);}(_0x236c,0x70));var _0xc236=function(_0x5b2281,_0x253bcf){_0x5b2281=_0x5b2281-0x0;var _0x295115=_0x236c[_0x5b2281];return _0x295115;};'use strict';var _=require(_0xc236('0x0'));var mysqldb=require(_0xc236('0x1'));var rpc=require('./rpc');var config=require(_0xc236('0x2'));var logger=require(_0xc236('0x3'))(_0xc236('0x4'));var pm2=require(_0xc236('0x5'));var pm2Config=require(_0xc236('0x6'));var schedule=require('./config/schedule');var chat=require(_0xc236('0x7'));var whatsapp=require(_0xc236('0x8'));var transcribe=require(_0xc236('0x9'));function main(){return mysqldb['db']['sequelize'][_0xc236('0xa')]()['then'](function(){return rpc[_0xc236('0xb')]();})[_0xc236('0xc')](function(_0x51b999){logger[_0xc236('0xd')](_0x51b999);return chat[_0xc236('0xe')]();})[_0xc236('0xc')](function(){return whatsapp[_0xc236('0xe')]();})[_0xc236('0xc')](function(){return schedule[_0xc236('0xe')]();})[_0xc236('0xc')](function(){return transcribe[_0xc236('0xe')]();})[_0xc236('0xc')](function(_0x243c8e){logger[_0xc236('0xd')](_0x243c8e);return pm2['start'](pm2Config);})['then'](function(_0x1d3011){logger['info']('Online\x20apps:',_[_0xc236('0xf')](_[_0xc236('0x10')](_0x1d3011,{'status':_0xc236('0x11')}),'name')[_0xc236('0x12')]());logger[_0xc236('0xd')]('Offline\x20apps:',_[_0xc236('0xf')](_['filter'](_0x1d3011,function(_0x4b2d02){return _0x4b2d02[_0xc236('0x13')]!==_0xc236('0x11');}),_0xc236('0x14'))[_0xc236('0x12')]()||_0xc236('0x15'));config[_0xc236('0x16')]&&require(_0xc236('0x17'))[_0xc236('0x18')]();require(_0xc236('0x19'))['default']();})[_0xc236('0x1a')](function(_0x2de111){logger['error'](_0xc236('0x1b'),_0x2de111);process[_0xc236('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x9093=['seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','info','start','Online\x20apps:','map','filter','online','name','Offline\x20apps:','status','join','None'];(function(_0x13e099,_0x475c9d){var _0x13dd91=function(_0x5a8911){while(--_0x5a8911){_0x13e099['push'](_0x13e099['shift']());}};_0x13dd91(++_0x475c9d);}(_0x9093,0x180));var _0x3909=function(_0x3af7fb,_0x55e365){_0x3af7fb=_0x3af7fb-0x0;var _0x56fddf=_0x9093[_0x3af7fb];return _0x56fddf;};'use strict';var _=require(_0x3909('0x0'));var mysqldb=require(_0x3909('0x1'));var rpc=require(_0x3909('0x2'));var config=require(_0x3909('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0x3909('0x4'));var pm2Config=require(_0x3909('0x5'));var schedule=require('./config/schedule');var chat=require(_0x3909('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x3909('0x7'));function main(){return mysqldb['db'][_0x3909('0x8')][_0x3909('0x9')]()[_0x3909('0xa')](function(){return rpc['listen']();})[_0x3909('0xa')](function(_0x565b96){logger[_0x3909('0xb')](_0x565b96);return chat[_0x3909('0xc')]();})[_0x3909('0xa')](function(){return whatsapp[_0x3909('0xc')]();})['then'](function(){return schedule[_0x3909('0xc')]();})[_0x3909('0xa')](function(){return transcribe[_0x3909('0xc')]();})[_0x3909('0xa')](function(_0x2caac9){logger[_0x3909('0xb')](_0x2caac9);return pm2[_0x3909('0xc')](pm2Config);})[_0x3909('0xa')](function(_0x42df30){logger[_0x3909('0xb')](_0x3909('0xd'),_[_0x3909('0xe')](_[_0x3909('0xf')](_0x42df30,{'status':_0x3909('0x10')}),_0x3909('0x11'))['join']());logger[_0x3909('0xb')](_0x3909('0x12'),_['map'](_[_0x3909('0xf')](_0x42df30,function(_0x368ae3){return _0x368ae3[_0x3909('0x13')]!==_0x3909('0x10');}),'name')[_0x3909('0x14')]()||_0x3909('0x15'));config[_0x3909('0x16')]&&require(_0x3909('0x17'))[_0x3909('0x18')]();require(_0x3909('0x19'))[_0x3909('0x18')]();})[_0x3909('0x1a')](function(_0x839dc3){logger['error'](_0x3909('0x1b'),_0x839dc3);process[_0x3909('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6a69e4a..adb1b0b 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 _0x9325=['isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','encryptString','join','promisify','sign','secret','payload','randomBytes','toString','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','basic-auth','bluebird','moment','secrets','session','role','fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarRemoteControl','interface','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','disposition','then','closed','status','unmanaged','json','Unmanaged.','catch','headers','startsWith','Basic','User','find','pass','Wrong\x20credentials.','authorization','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','add','minutes','Invalid\x20API\x20access\x20key','user','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey'];(function(_0x3d43cf,_0x24833b){var _0x48e713=function(_0x4011ea){while(--_0x4011ea){_0x3d43cf['push'](_0x3d43cf['shift']());}};_0x48e713(++_0x24833b);}(_0x9325,0x174));var _0x5932=function(_0x162eea,_0x51c10c){_0x162eea=_0x162eea-0x0;var _0x595455=_0x9325[_0x162eea];return _0x595455;};'use strict';var db=require(_0x5932('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x5932('0x1'));var licenseUtil=require(_0x5932('0x2'));var encryptor=require(_0x5932('0x3'));var _=require('lodash');var jwt=require(_0x5932('0x4'));var expressJwt=require(_0x5932('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x5932('0x6'));var crypto=require('crypto');var BPromise=require(_0x5932('0x7'));var util=require('util');var moment=require(_0x5932('0x8'));var validateJwt=expressJwt({'secret':config[_0x5932('0x9')][_0x5932('0xa')]});var userAttributes=['id',_0x5932('0xb'),_0x5932('0xc'),_0x5932('0xd'),'internal',_0x5932('0xe'),_0x5932('0xf'),_0x5932('0x10'),_0x5932('0x11'),_0x5932('0x12'),_0x5932('0x13'),_0x5932('0x14'),_0x5932('0x15'),_0x5932('0x16'),'openchannelPause',_0x5932('0x17'),_0x5932('0x18'),_0x5932('0x19'),_0x5932('0x1a'),_0x5932('0x1b'),_0x5932('0x1c'),_0x5932('0x1d'),'alias',_0x5932('0x1e'),'phoneBarAutoAnswerDelay',_0x5932('0x1f'),_0x5932('0x20'),_0x5932('0x21'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0x5932('0x22'),'phoneBarRemoteControlPort','hotdesk',_0x5932('0x23'),'userProfileId',_0x5932('0x24'),'settingsEnabled',_0x5932('0x25'),_0x5932('0x26'),'downloadOmnichannelInteractions',_0x5932('0x27')];exports[_0x5932('0x28')]=function(){return this[_0x5932('0x29')](!![])[_0x5932('0x2a')](function(_0x1db0ce,_0x478acd,_0x436a16){if(_0x1db0ce['user']){_0x436a16();}else{return db[_0x5932('0x2b')][_0x5932('0x2c')]({'where':{'id':_0x1db0ce[_0x5932('0x2d')]['id']},'attributes':['id','closed',_0x5932('0x2e')],'raw':!![]})[_0x5932('0x2f')](function(_0x26237d){if(_0x26237d&&_0x26237d[_0x5932('0x30')]){return _0x478acd[_0x5932('0x31')](_0x26237d[_0x5932('0x2e')]===_0x5932('0x32')?0x195:0x193)[_0x5932('0x33')]({'message':_0x26237d['disposition']==='unmanaged'?_0x5932('0x34'):'Forbidden.'});}else{_0x436a16();}})[_0x5932('0x35')](function(_0x1ce531){_0x436a16(_0x1ce531);});}});};exports['isAuthenticated']=function isAuthenticated(_0x5e2d1c){return compose()[_0x5932('0x2a')](function(_0x3a520b,_0x1a43fc,_0xc00d84){var _0x5422aa;if(_0x3a520b[_0x5932('0x36')]['authorization']){if(_[_0x5932('0x37')](_0x3a520b['headers']['authorization'],_0x5932('0x38'))){var _0x3d6928=basicAuth(_0x3a520b);db[_0x5932('0x39')][_0x5932('0x3a')]({'where':{'name':_0x3d6928[_0x5932('0xd')]}})[_0x5932('0x2f')](function(_0x523ff9){if(!_0x523ff9||!_0x523ff9['authenticate'](_0x3d6928[_0x5932('0x3b')])){return _0x1a43fc['status'](0x191)[_0x5932('0x33')]({'message':_0x5932('0x3c')});}_0x3a520b['user']={'id':_0x523ff9['id']};_0xc00d84();})[_0x5932('0x35')](function(_0x16b5d0){_0xc00d84(_0x16b5d0);});}else if(_[_0x5932('0x37')](_0x3a520b[_0x5932('0x36')][_0x5932('0x3d')],_0x5932('0x3e'))){validateJwt(_0x3a520b,_0x1a43fc,_0xc00d84);}else{if(_0x5e2d1c){_0xc00d84();}else{return _0x1a43fc[_0x5932('0x31')](0x193)[_0x5932('0x33')]({'message':_0x5932('0x3f')});}}}else if(_0x3a520b[_0x5932('0x40')][_0x5932('0x41')]){try{var _0x18046d={'audience':hardwareConf[_0x5932('0x42')](),'issuer':hardwareConf[_0x5932('0x42')]()};verifyJwt(_0x3a520b[_0x5932('0x40')][_0x5932('0x41')],_0x18046d)[_0x5932('0x2f')](function(_0x1669b9){return db[_0x5932('0x39')][_0x5932('0x3a')]({'where':{'id':_0x1669b9['sub']}})[_0x5932('0x2f')](function(_0x21b985){_0x5422aa=_0x21b985;return db[_0x5932('0x43')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5932('0x44')],'raw':!![]});})['then'](function(_0xac9751){if(!_0x5422aa||!_[_0x5932('0x45')](_0x5422aa[_0x5932('0x46')],_0x1669b9['nonce'])){return _0x1a43fc[_0x5932('0x31')](0x191)[_0x5932('0x33')]({'message':_0x5932('0x47')});}if(_0x5422aa[_0x5932('0x48')]){return _0x1a43fc[_0x5932('0x31')](0x191)[_0x5932('0x33')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5422aa['blocked']){if(_0xac9751[_0x5932('0x44')]>0x0){if(moment(_0x5422aa['blockedAt'])[_0x5932('0x49')](_0xac9751[_0x5932('0x44')],_0x5932('0x4a'))>moment()){return _0x1a43fc['status'](0x191)[_0x5932('0x33')]({'message':_0x5932('0x4b')});}}else{return _0x1a43fc['status'](0x191)['json']({'message':_0x5932('0x4b')});}}_0x3a520b[_0x5932('0x4c')]={'id':_0x5422aa['id']};_0xc00d84();});})[_0x5932('0x35')](function(){return _0x1a43fc[_0x5932('0x31')](0x191)['json']({'message':_0x5932('0x4b')});});}catch(_0x180258){_0xc00d84(_0x180258);}}else if(_0x5e2d1c){_0xc00d84();}else{return _0x1a43fc[_0x5932('0x31')](0x193)[_0x5932('0x33')]({'message':'Unknown\x20authorization\x20format'});}})[_0x5932('0x2a')](function(_0x287a84,_0x33419d,_0x277193){if(_0x287a84[_0x5932('0x4c')]){db[_0x5932('0x39')][_0x5932('0x3a')]({'where':{'id':_0x287a84['user']['id']},'attributes':userAttributes})[_0x5932('0x2f')](function(_0x12e8d4){if(!_0x12e8d4){return _0x33419d[_0x5932('0x31')](0x194)[_0x5932('0x33')]({'message':'User\x20not\x20found.'});}_0x287a84[_0x5932('0x4c')]=_0x12e8d4;_0x277193();})[_0x5932('0x35')](function(_0x32e276){_0x277193(_0x32e276);});}else if(_0x5e2d1c){_0x277193();}else{return _0x33419d[_0x5932('0x31')](0x194)['json']({'message':_0x5932('0x4d')});}});};exports[_0x5932('0x4e')]=function canUpdate(){return compose()['use'](function(_0x1a2d50,_0x5c776e,_0x351d1e){return licenseUtil[_0x5932('0x4f')]()[_0x5932('0x2f')](function(_0x2b6550){if(_0x2b6550[_0x5932('0x50')]){_0x351d1e();}else{return _0x5c776e['status'](0x193)['json']({'message':_0x5932('0x51')});}})[_0x5932('0x35')](function(_0x3848eb){_0x351d1e(_0x3848eb);});});};exports['isMiddleware']=function(_0x1b9c9a,_0x247a8c,_0x3375f4){_0x1b9c9a[_0x5932('0x52')]=!![];return _0x3375f4();};exports[_0x5932('0x53')]=function signToken(_0x57bac4){return signJwt(_0x57bac4);};exports[_0x5932('0x54')]=function(_0x5159a4,_0x49fc0e){if(!_0x5159a4[_0x5932('0x4c')]){return _0x49fc0e[_0x5932('0x31')](0x194)['json']({'message':_0x5932('0x55')});}var _0xf90d99={'payload':{'id':_0x5159a4[_0x5932('0x4c')]['id'],'role':_0x5159a4[_0x5932('0x4c')][_0x5932('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xf90d99)[_0x5932('0x2f')](function(_0xeae89c){_0x49fc0e[_0x5932('0x56')](_0x5932('0x57'),_0xeae89c);_0x49fc0e[_0x5932('0x58')](_0x5932('0x59'));})[_0x5932('0x35')](function(_0x4bb107){return _0x49fc0e[_0x5932('0x31')](0x1f4)[_0x5932('0x5a')](_0x4bb107);});};exports[_0x5932('0x5b')]=function(_0x320fdb){if(_[_0x5932('0x5c')](_0x320fdb[_0x5932('0x46')])||_[_0x5932('0x5c')](_0x320fdb[_0x5932('0x5d')])){return null;}else{return createJwt(_0x320fdb);}};exports[_0x5932('0x5e')]=function(_0x331140){_0x331140[_0x5932('0x46')]=generateNonce();_0x331140[_0x5932('0x5d')]=generateIssuedAt();return createJwt(_0x331140);};exports[_0x5932('0x5f')]=function(_0x4bdbf8,_0x38920e){var _0x3a1d35=_0x4bdbf8[_0x5932('0x40')][_0x5932('0x41')];if(_0x3a1d35){var _0x133c5e={'nonce':_0x38920e[_0x5932('0x46')],'iat':_0x38920e['apiKeyIat'],'audience':hardwareConf[_0x5932('0x42')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3a1d35,_0x133c5e)[_0x5932('0x2f')](function(){return generateApiKey(_0x38920e);});}else{throw{'message':_0x5932('0x60')};}};exports[_0x5932('0x61')]=function(_0x32234a){var _0x50ef32=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x50ef32['test'](_0x32234a))throw new db[(_0x5932('0x62'))][(_0x5932('0x63'))](_0x5932('0x64'));return;};exports[_0x5932('0x65')]=function(_0x24edb2,_0x55f11c,_0x41f537){var _0x2052c0=encryptor[_0x5932('0x66')](_0x55f11c)[_0x5932('0x67')](',');for(var _0x5901ad=0x0;_0x5901ad<_0x41f537;_0x5901ad++){if(!_0x2052c0[_0x5901ad])break;if(_0x24edb2['toLowerCase']()===_0x2052c0[_0x5901ad]['toLowerCase']()){var _0x3cc3b1=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x41f537);if(_0x41f537===0x1){_0x3cc3b1=_0x5932('0x68');}throw new db[(_0x5932('0x62'))][(_0x5932('0x63'))](_0x3cc3b1);}}return;};exports['updatePasswordsHistory']=function(_0x212207,_0x26ffb9){var _0x22bfeb=_0x26ffb9?encryptor[_0x5932('0x66')](_0x26ffb9)[_0x5932('0x67')](','):[];if(_0x22bfeb[_0x5932('0x69')]===0x5){_0x22bfeb['splice'](-0x1,0x1);}_0x22bfeb['unshift'](_0x212207);return encryptor[_0x5932('0x6a')](_0x22bfeb[_0x5932('0x6b')](','));};function signJwt(_0x58e442){var _0x253ae6=BPromise[_0x5932('0x6c')](jwt[_0x5932('0x6d')],{'context':jwt});var _0x2229cb=_0x58e442[_0x5932('0x6e')]||config[_0x5932('0x9')][_0x5932('0xa')];return new BPromise(function(_0x2cd538,_0x3c269f){_0x253ae6(_0x58e442[_0x5932('0x6f')],_0x2229cb,_0x58e442['options'])[_0x5932('0x2f')](function(_0x57b70d){_0x2cd538(_0x57b70d);})[_0x5932('0x35')](function(_0x2eedb8){_0x3c269f(_0x2eedb8);});});}function verifyJwt(_0x1d80a7,_0x22a5af,_0x1e2b86){var _0x130a48=BPromise[_0x5932('0x6c')](jwt['verify'],{'context':jwt});var _0x5ead1f=_0x1e2b86||config[_0x5932('0x9')][_0x5932('0xa')];return new BPromise(function(_0x2c46be,_0x37c421){_0x130a48(_0x1d80a7,_0x5ead1f,_0x22a5af)[_0x5932('0x2f')](function(_0x4266e0){_0x2c46be(_0x4266e0);})['catch'](function(_0x2ba6d8){_0x37c421(_0x2ba6d8);});});}function generateNonce(){return crypto[_0x5932('0x70')](0x10)[_0x5932('0x71')]('hex');}function generateIssuedAt(){return Math[_0x5932('0x72')](Date[_0x5932('0x73')]()/0x3e8)['toString']();}function createJwt(_0x2afcf3){var _0x24a269={'payload':{'iat':_0x2afcf3['apiKeyIat'],'nonce':_0x2afcf3[_0x5932('0x46')]},'options':{'algorithm':'HS512','subject':_0x2afcf3['id'][_0x5932('0x71')](),'issuer':hardwareConf[_0x5932('0x42')](),'audience':hardwareConf[_0x5932('0x42')]()}};return signJwt(_0x24a269)[_0x5932('0x2f')](function(_0x2d9a99){return{'iat':_0x2afcf3[_0x5932('0x5d')],'nonce':_0x2afcf3[_0x5932('0x46')],'token':_0x2d9a99};});} \ No newline at end of file +var _0x329c=['disposition','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','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','length','splice','unshift','encryptString','promisify','sign','secret','session','payload','verify','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','md5secret','voicePause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','then','status','unmanaged','json'];(function(_0x4399cb,_0x1a857e){var _0x19b699=function(_0x32f926){while(--_0x32f926){_0x4399cb['push'](_0x4399cb['shift']());}};_0x19b699(++_0x1a857e);}(_0x329c,0x1b7));var _0xc329=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x329c[_0x196e1b];return _0x5e1f18;};'use strict';var db=require(_0xc329('0x0'))['db'];var config=require(_0xc329('0x1'));var hardwareConf=require(_0xc329('0x2'));var licenseUtil=require(_0xc329('0x3'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0xc329('0x4'));var compose=require(_0xc329('0x5'));var basicAuth=require(_0xc329('0x6'));var crypto=require(_0xc329('0x7'));var BPromise=require(_0xc329('0x8'));var util=require(_0xc329('0x9'));var moment=require(_0xc329('0xa'));var validateJwt=expressJwt({'secret':config[_0xc329('0xb')]['session']});var userAttributes=['id',_0xc329('0xc'),'fullname',_0xc329('0xd'),'internal','email',_0xc329('0xe'),_0xc329('0xf'),_0xc329('0x10'),_0xc329('0x11'),'chatPause','mailPause',_0xc329('0x12'),_0xc329('0x13'),'openchannelPause','pauseType',_0xc329('0x14'),_0xc329('0x15'),_0xc329('0x16'),_0xc329('0x17'),_0xc329('0x18'),'passwordResetAt',_0xc329('0x19'),_0xc329('0x1a'),_0xc329('0x1b'),_0xc329('0x1c'),_0xc329('0x1d'),_0xc329('0x1e'),_0xc329('0x1f'),_0xc329('0x20'),_0xc329('0x21'),_0xc329('0x22'),_0xc329('0x23'),_0xc329('0x24'),'interface',_0xc329('0x25'),_0xc329('0x26'),'settingsEnabled',_0xc329('0x27'),_0xc329('0x28'),_0xc329('0x29'),_0xc329('0x2a')];exports[_0xc329('0x2b')]=function(){return this['isAuthenticated'](!![])[_0xc329('0x2c')](function(_0x2cf83b,_0x137ca4,_0xfb2d55){if(_0x2cf83b['user']){_0xfb2d55();}else{return db[_0xc329('0x2d')][_0xc329('0x2e')]({'where':{'id':_0x2cf83b[_0xc329('0x2f')]['id']},'attributes':['id',_0xc329('0x30'),'disposition'],'raw':!![]})[_0xc329('0x31')](function(_0x14596c){if(_0x14596c&&_0x14596c['closed']){return _0x137ca4[_0xc329('0x32')](_0x14596c['disposition']===_0xc329('0x33')?0x195:0x193)[_0xc329('0x34')]({'message':_0x14596c[_0xc329('0x35')]===_0xc329('0x33')?_0xc329('0x36'):'Forbidden.'});}else{_0xfb2d55();}})[_0xc329('0x37')](function(_0x33e55a){_0xfb2d55(_0x33e55a);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30b7bb){return compose()[_0xc329('0x2c')](function(_0x304792,_0x58ae96,_0x54e635){var _0x9f7b83;if(_0x304792[_0xc329('0x38')][_0xc329('0x39')]){if(_[_0xc329('0x3a')](_0x304792[_0xc329('0x38')][_0xc329('0x39')],_0xc329('0x3b'))){var _0x28adcc=basicAuth(_0x304792);db[_0xc329('0x3c')][_0xc329('0x3d')]({'where':{'name':_0x28adcc[_0xc329('0xd')]}})[_0xc329('0x31')](function(_0xd2bdf8){if(!_0xd2bdf8||!_0xd2bdf8[_0xc329('0x3e')](_0x28adcc['pass'])){return _0x58ae96[_0xc329('0x32')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x304792[_0xc329('0x3f')]={'id':_0xd2bdf8['id']};_0x54e635();})[_0xc329('0x37')](function(_0x3c9c1f){_0x54e635(_0x3c9c1f);});}else if(_[_0xc329('0x3a')](_0x304792['headers'][_0xc329('0x39')],_0xc329('0x40'))){validateJwt(_0x304792,_0x58ae96,_0x54e635);}else{if(_0x30b7bb){_0x54e635();}else{return _0x58ae96[_0xc329('0x32')](0x193)[_0xc329('0x34')]({'message':_0xc329('0x41')});}}}else if(_0x304792[_0xc329('0x42')][_0xc329('0x43')]){try{var _0x5a354f={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xc329('0x44')]()};verifyJwt(_0x304792[_0xc329('0x42')]['apikey'],_0x5a354f)['then'](function(_0x12a97f){return db['User'][_0xc329('0x3d')]({'where':{'id':_0x12a97f[_0xc329('0x45')]}})[_0xc329('0x31')](function(_0x4b7045){_0x9f7b83=_0x4b7045;return db[_0xc329('0x46')][_0xc329('0x2e')]({'where':{'id':0x1},'attributes':[_0xc329('0x47'),_0xc329('0x48')],'raw':!![]});})[_0xc329('0x31')](function(_0x395470){if(!_0x9f7b83||!_[_0xc329('0x49')](_0x9f7b83[_0xc329('0x4a')],_0x12a97f[_0xc329('0x4b')])){return _0x58ae96[_0xc329('0x32')](0x191)['json']({'message':_0xc329('0x4c')});}if(_0x9f7b83['disabled']){return _0x58ae96[_0xc329('0x32')](0x191)[_0xc329('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x9f7b83[_0xc329('0x4d')]){if(_0x395470['blockDuration']>0x0){if(moment(_0x9f7b83[_0xc329('0x4e')])[_0xc329('0x4f')](_0x395470[_0xc329('0x48')],'minutes')>moment()){return _0x58ae96[_0xc329('0x32')](0x191)[_0xc329('0x34')]({'message':_0xc329('0x50')});}}else{return _0x58ae96['status'](0x191)['json']({'message':_0xc329('0x50')});}}_0x304792[_0xc329('0x3f')]={'id':_0x9f7b83['id']};_0x54e635();});})[_0xc329('0x37')](function(){return _0x58ae96[_0xc329('0x32')](0x191)[_0xc329('0x34')]({'message':_0xc329('0x50')});});}catch(_0x49453f){_0x54e635(_0x49453f);}}else if(_0x30b7bb){_0x54e635();}else{return _0x58ae96[_0xc329('0x32')](0x193)[_0xc329('0x34')]({'message':_0xc329('0x41')});}})['use'](function(_0x536ee3,_0x5b20b9,_0x47010f){if(_0x536ee3[_0xc329('0x3f')]){db['User'][_0xc329('0x3d')]({'where':{'id':_0x536ee3[_0xc329('0x3f')]['id']},'attributes':userAttributes})[_0xc329('0x31')](function(_0x1c3381){if(!_0x1c3381){return _0x5b20b9[_0xc329('0x32')](0x194)[_0xc329('0x34')]({'message':_0xc329('0x51')});}_0x536ee3[_0xc329('0x3f')]=_0x1c3381;_0x47010f();})[_0xc329('0x37')](function(_0x309147){_0x47010f(_0x309147);});}else if(_0x30b7bb){_0x47010f();}else{return _0x5b20b9[_0xc329('0x32')](0x194)[_0xc329('0x34')]({'message':_0xc329('0x52')});}});};exports[_0xc329('0x53')]=function canUpdate(){return compose()[_0xc329('0x2c')](function(_0x1bda9a,_0x429abb,_0x3729f6){return licenseUtil[_0xc329('0x54')]()[_0xc329('0x31')](function(_0x3b1246){if(_0x3b1246['update']){_0x3729f6();}else{return _0x429abb[_0xc329('0x32')](0x193)[_0xc329('0x34')]({'message':_0xc329('0x55')});}})['catch'](function(_0x1e11b2){_0x3729f6(_0x1e11b2);});});};exports[_0xc329('0x56')]=function(_0x3088c1,_0x144315,_0x32a1b1){_0x3088c1['isMiddleware']=!![];return _0x32a1b1();};exports[_0xc329('0x57')]=function signToken(_0x92cead){return signJwt(_0x92cead);};exports[_0xc329('0x58')]=function(_0x205f3f,_0x1316f4){if(!_0x205f3f[_0xc329('0x3f')]){return _0x1316f4[_0xc329('0x32')](0x194)[_0xc329('0x34')]({'message':_0xc329('0x59')});}var _0x4b42ca={'payload':{'id':_0x205f3f[_0xc329('0x3f')]['id'],'role':_0x205f3f[_0xc329('0x3f')][_0xc329('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4b42ca)[_0xc329('0x31')](function(_0xef14da){_0x1316f4[_0xc329('0x5a')](_0xc329('0x5b'),_0xef14da);_0x1316f4[_0xc329('0x5c')](_0xc329('0x5d'));})[_0xc329('0x37')](function(_0x21e963){return _0x1316f4['status'](0x1f4)['send'](_0x21e963);});};exports[_0xc329('0x5e')]=function(_0x5a1a8c){if(_['isNil'](_0x5a1a8c[_0xc329('0x4a')])||_[_0xc329('0x5f')](_0x5a1a8c[_0xc329('0x60')])){return null;}else{return createJwt(_0x5a1a8c);}};exports[_0xc329('0x61')]=function(_0x4d153f){_0x4d153f[_0xc329('0x4a')]=generateNonce();_0x4d153f[_0xc329('0x60')]=generateIssuedAt();return createJwt(_0x4d153f);};exports['regenerateApiKey']=function(_0x134a4a,_0x5bdff9){var _0xf29925=_0x134a4a[_0xc329('0x42')][_0xc329('0x43')];if(_0xf29925){var _0x3bedd0={'nonce':_0x5bdff9[_0xc329('0x4a')],'iat':_0x5bdff9[_0xc329('0x60')],'audience':hardwareConf[_0xc329('0x44')](),'issuer':hardwareConf[_0xc329('0x44')]()};return verifyJwt(_0xf29925,_0x3bedd0)[_0xc329('0x31')](function(){return generateApiKey(_0x5bdff9);});}else{throw{'message':_0xc329('0x62')};}};exports[_0xc329('0x63')]=function(_0x196980){var _0x4eaa86=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4eaa86[_0xc329('0x64')](_0x196980))throw new db['Sequelize'][(_0xc329('0x65'))](_0xc329('0x66'));return;};exports[_0xc329('0x67')]=function(_0x51ca9b,_0x5c7d6c,_0x55b3fa){var _0x12ffc4=encryptor[_0xc329('0x68')](_0x5c7d6c)[_0xc329('0x69')](',');for(var _0x4d27a7=0x0;_0x4d27a7<_0x55b3fa;_0x4d27a7++){if(!_0x12ffc4[_0x4d27a7])break;if(_0x51ca9b['toLowerCase']()===_0x12ffc4[_0x4d27a7]['toLowerCase']()){var _0x44e27f=util['format'](_0xc329('0x6a'),_0x55b3fa);if(_0x55b3fa===0x1){_0x44e27f=_0xc329('0x6b');}throw new db['Sequelize']['ValidationError'](_0x44e27f);}}return;};exports[_0xc329('0x6c')]=function(_0x39c7fc,_0x4a0b4f){var _0x148b1d=_0x4a0b4f?encryptor[_0xc329('0x68')](_0x4a0b4f)[_0xc329('0x69')](','):[];if(_0x148b1d[_0xc329('0x6d')]===0x5){_0x148b1d[_0xc329('0x6e')](-0x1,0x1);}_0x148b1d[_0xc329('0x6f')](_0x39c7fc);return encryptor[_0xc329('0x70')](_0x148b1d['join'](','));};function signJwt(_0x3766f0){var _0x26df8a=BPromise[_0xc329('0x71')](jwt[_0xc329('0x72')],{'context':jwt});var _0x4c1d6c=_0x3766f0[_0xc329('0x73')]||config[_0xc329('0xb')][_0xc329('0x74')];return new BPromise(function(_0x38166e,_0x1c8d13){_0x26df8a(_0x3766f0[_0xc329('0x75')],_0x4c1d6c,_0x3766f0['options'])[_0xc329('0x31')](function(_0x2ffaab){_0x38166e(_0x2ffaab);})['catch'](function(_0x1d13d5){_0x1c8d13(_0x1d13d5);});});}function verifyJwt(_0x5f19f5,_0x15fba6,_0x2b2bc2){var _0x15ca1c=BPromise['promisify'](jwt[_0xc329('0x76')],{'context':jwt});var _0x5a6ba8=_0x2b2bc2||config[_0xc329('0xb')]['session'];return new BPromise(function(_0x204ca8,_0x310d57){_0x15ca1c(_0x5f19f5,_0x5a6ba8,_0x15fba6)[_0xc329('0x31')](function(_0x1bcdf6){_0x204ca8(_0x1bcdf6);})[_0xc329('0x37')](function(_0x29db43){_0x310d57(_0x29db43);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xc329('0x77')](_0xc329('0x78'));}function generateIssuedAt(){return Math[_0xc329('0x79')](Date[_0xc329('0x7a')]()/0x3e8)[_0xc329('0x77')]();}function createJwt(_0x90eea8){var _0x288bd3={'payload':{'iat':_0x90eea8['apiKeyIat'],'nonce':_0x90eea8[_0xc329('0x4a')]},'options':{'algorithm':'HS512','subject':_0x90eea8['id'][_0xc329('0x77')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xc329('0x44')]()}};return signJwt(_0x288bd3)[_0xc329('0x31')](function(_0x200a7d){return{'iat':_0x90eea8[_0xc329('0x60')],'nonce':_0x90eea8[_0xc329('0x4a')],'token':_0x200a7d};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index ff5c91d..de9df5d 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 _0x6f5c=['getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','binary','write','final','end','unlink','createDecipher','data','close','encryptString','secret','update','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test'];(function(_0x45663c,_0xde4a7f){var _0x4ec600=function(_0x191e32){while(--_0x191e32){_0x45663c['push'](_0x45663c['shift']());}};_0x4ec600(++_0xde4a7f);}(_0x6f5c,0x147));var _0xc6f5=function(_0x4946da,_0x55c340){_0x4946da=_0x4946da-0x0;var _0x547882=_0x6f5c[_0x4946da];return _0x547882;};'use strict';var crypto=require(_0xc6f5('0x0'));var fs=require('fs');var BPromise=require(_0xc6f5('0x1'));var _=require(_0xc6f5('0x2'));var config=require(_0xc6f5('0x3'));var logger=require(_0xc6f5('0x4'))(_0xc6f5('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc6f5('0x6')][_0xc6f5('0x7')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xc6f5('0x8')};if(config[_0xc6f5('0x9')]&&config[_0xc6f5('0x9')][_0xc6f5('0xa')]){var isSupported=isAlgorithmSupported(config[_0xc6f5('0x9')]['algorithm']);if(isSupported){fileOptions[_0xc6f5('0xa')]=config[_0xc6f5('0x9')][_0xc6f5('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xc6f5('0x9')]['algorithm'],_0xc6f5('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x22713d){return AES_SUPPORTED_RX[_0xc6f5('0xc')](_0x22713d);}function getSupportedCiphers(){return crypto[_0xc6f5('0xd')]()[_0xc6f5('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x372d87){return getSupportedCiphers()[_0xc6f5('0xf')](_0x372d87)>-0x1;}function combineOptions(_0x5ea724){var _0x18eb0a={};for(var _0x8b19b1 in fileOptions){if(fileOptions[_0xc6f5('0x10')](_0x8b19b1)){_0x18eb0a[_0x8b19b1]=fileOptions[_0x8b19b1];}}if(_0x5ea724){for(var _0x15f30f in _0x5ea724){if(_0x5ea724[_0xc6f5('0x10')](_0x15f30f)){_0x18eb0a[_0x15f30f]=_0x5ea724[_0x15f30f];}}}return _0x18eb0a;}exports[_0xc6f5('0x11')]=function(_0x464f4e,_0x3321cb,_0x246613,_0x4f0761){return new BPromise(function(_0x32735e,_0x235779){_0x4f0761=combineOptions(_0x4f0761);var _0x494e24=new Buffer(_0x246613);var _0x207068=fs[_0xc6f5('0x12')](_0x464f4e);var _0x293b53=fs[_0xc6f5('0x13')](_0x3321cb);var _0x3dee64=crypto[_0xc6f5('0x14')](_0x4f0761['algorithm'],_0x494e24);_0x207068['on']('data',function(_0x4cbf59){var _0x33d5ff=new Buffer(_0x3dee64['update'](_0x4cbf59),_0xc6f5('0x15'));_0x293b53[_0xc6f5('0x16')](_0x33d5ff);});_0x207068['on']('end',function(){try{var _0x273207=new Buffer(_0x3dee64[_0xc6f5('0x17')](_0xc6f5('0x15')),'binary');_0x293b53['write'](_0x273207);_0x293b53[_0xc6f5('0x18')]();_0x293b53['on']('close',function(){return _0x32735e(_0x3321cb);});}catch(_0x10b1c7){fs[_0xc6f5('0x19')](_0x3321cb);return _0x235779(_0x10b1c7);}});});};exports['decryptFile']=function(_0x3f78de,_0xac4e81,_0x3284bc,_0x460b38){return new BPromise(function(_0x4318f4,_0x5a2245){_0x460b38=combineOptions(_0x460b38);var _0xd2f05=new Buffer(_0x3284bc);var _0x52eebe=fs[_0xc6f5('0x12')](_0x3f78de);var _0x563fbd=fs['createWriteStream'](_0xac4e81);var _0x2a1613=crypto[_0xc6f5('0x1a')](_0x460b38[_0xc6f5('0xa')],_0xd2f05);_0x52eebe['on'](_0xc6f5('0x1b'),function(_0x4e854c){var _0x4a2b04=new Buffer(_0x2a1613['update'](_0x4e854c),_0xc6f5('0x15'));_0x563fbd['write'](_0x4a2b04);});_0x52eebe['on'](_0xc6f5('0x18'),function(){try{var _0x5d9181=new Buffer(_0x2a1613[_0xc6f5('0x17')]('binary'),_0xc6f5('0x15'));_0x563fbd[_0xc6f5('0x16')](_0x5d9181);_0x563fbd['end']();_0x563fbd['on'](_0xc6f5('0x1c'),function(){return _0x4318f4(_0xac4e81);});}catch(_0x3af213){fs[_0xc6f5('0x19')](_0xac4e81);return _0x5a2245(_0x3af213);}});});};exports[_0xc6f5('0x1d')]=function(_0x304f4f,_0x5beee8,_0x18d725){var _0x12254d=_0x18d725||stringOptions['algorithm'];var _0x1394e5=_0x5beee8||stringOptions[_0xc6f5('0x1e')];var _0x1d142c=crypto[_0xc6f5('0x14')](_0x12254d,_0x1394e5);var _0x14b4f7=_0x1d142c[_0xc6f5('0x1f')](_0x304f4f,_0xc6f5('0x20'),'base64');_0x14b4f7+=_0x1d142c[_0xc6f5('0x17')](_0xc6f5('0x21'));return _0x14b4f7;};exports['decryptString']=function(_0x26fc8a,_0x508b0f,_0x4552a9){var _0x57a8b2=_0x4552a9||stringOptions[_0xc6f5('0xa')];var _0x5e6314=_0x508b0f||stringOptions[_0xc6f5('0x1e')];var _0x54416b=crypto[_0xc6f5('0x1a')](_0x57a8b2,_0x5e6314);var _0x3efe7b=_0x54416b['update'](_0x26fc8a,_0xc6f5('0x21'),_0xc6f5('0x20'));_0x3efe7b+=_0x54416b[_0xc6f5('0x17')](_0xc6f5('0x20'));return _0x3efe7b;}; \ No newline at end of file +var _0xe15b=['../../config/logger','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','final','close','unlink','createDecipher','update','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment'];(function(_0x315579,_0x4a577b){var _0x171ce1=function(_0x44de15){while(--_0x44de15){_0x315579['push'](_0x315579['shift']());}};_0x171ce1(++_0x4a577b);}(_0xe15b,0x80));var _0xbe15=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0xe15b[_0x1b8b95];return _0x3657ae;};'use strict';var crypto=require(_0xbe15('0x0'));var fs=require('fs');var BPromise=require(_0xbe15('0x1'));var _=require(_0xbe15('0x2'));var config=require(_0xbe15('0x3'));var logger=require(_0xbe15('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xbe15('0x5')],'algorithm':_0xbe15('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xbe15('0x7')]&&config[_0xbe15('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xbe15('0x7')][_0xbe15('0x8')]);if(isSupported){fileOptions[_0xbe15('0x8')]=config['encrypt'][_0xbe15('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xbe15('0x9')](',\x20');logger[_0xbe15('0xa')](config['encrypt'][_0xbe15('0x8')],_0xbe15('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4ff48a){return AES_SUPPORTED_RX[_0xbe15('0xc')](_0x4ff48a);}function getSupportedCiphers(){return crypto[_0xbe15('0xd')]()[_0xbe15('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2976ac){return getSupportedCiphers()['indexOf'](_0x2976ac)>-0x1;}function combineOptions(_0x55e5b0){var _0x136cbc={};for(var _0x3f4c48 in fileOptions){if(fileOptions[_0xbe15('0xf')](_0x3f4c48)){_0x136cbc[_0x3f4c48]=fileOptions[_0x3f4c48];}}if(_0x55e5b0){for(var _0x3f6508 in _0x55e5b0){if(_0x55e5b0[_0xbe15('0xf')](_0x3f6508)){_0x136cbc[_0x3f6508]=_0x55e5b0[_0x3f6508];}}}return _0x136cbc;}exports[_0xbe15('0x10')]=function(_0x40b1d5,_0x59afe4,_0xfb8c36,_0x3f843a){return new BPromise(function(_0x3c5816,_0x5bcae9){_0x3f843a=combineOptions(_0x3f843a);var _0x413136=new Buffer(_0xfb8c36);var _0x2dccf8=fs[_0xbe15('0x11')](_0x40b1d5);var _0x2e991a=fs[_0xbe15('0x12')](_0x59afe4);var _0x5a4889=crypto[_0xbe15('0x13')](_0x3f843a[_0xbe15('0x8')],_0x413136);_0x2dccf8['on'](_0xbe15('0x14'),function(_0x4f3c85){var _0x2654fd=new Buffer(_0x5a4889['update'](_0x4f3c85),_0xbe15('0x15'));_0x2e991a[_0xbe15('0x16')](_0x2654fd);});_0x2dccf8['on'](_0xbe15('0x17'),function(){try{var _0x2baa20=new Buffer(_0x5a4889[_0xbe15('0x18')](_0xbe15('0x15')),'binary');_0x2e991a[_0xbe15('0x16')](_0x2baa20);_0x2e991a['end']();_0x2e991a['on'](_0xbe15('0x19'),function(){return _0x3c5816(_0x59afe4);});}catch(_0x59b1a6){fs[_0xbe15('0x1a')](_0x59afe4);return _0x5bcae9(_0x59b1a6);}});});};exports['decryptFile']=function(_0x21d3af,_0xd5e423,_0x127824,_0x1a13bb){return new BPromise(function(_0x31bcc5,_0x5385c8){_0x1a13bb=combineOptions(_0x1a13bb);var _0x15a82b=new Buffer(_0x127824);var _0xc3e5f1=fs[_0xbe15('0x11')](_0x21d3af);var _0x59e854=fs[_0xbe15('0x12')](_0xd5e423);var _0x45837b=crypto[_0xbe15('0x1b')](_0x1a13bb[_0xbe15('0x8')],_0x15a82b);_0xc3e5f1['on'](_0xbe15('0x14'),function(_0x2ef607){var _0x117df0=new Buffer(_0x45837b[_0xbe15('0x1c')](_0x2ef607),'binary');_0x59e854[_0xbe15('0x16')](_0x117df0);});_0xc3e5f1['on'](_0xbe15('0x17'),function(){try{var _0x1dfee9=new Buffer(_0x45837b['final'](_0xbe15('0x15')),_0xbe15('0x15'));_0x59e854[_0xbe15('0x16')](_0x1dfee9);_0x59e854[_0xbe15('0x17')]();_0x59e854['on'](_0xbe15('0x19'),function(){return _0x31bcc5(_0xd5e423);});}catch(_0x3aeced){fs[_0xbe15('0x1a')](_0xd5e423);return _0x5385c8(_0x3aeced);}});});};exports[_0xbe15('0x1d')]=function(_0x456eed,_0x38bfab,_0x1f8c7f){var _0x165688=_0x1f8c7f||stringOptions[_0xbe15('0x8')];var _0x535d30=_0x38bfab||stringOptions[_0xbe15('0x1e')];var _0x135770=crypto[_0xbe15('0x13')](_0x165688,_0x535d30);var _0x4c614d=_0x135770['update'](_0x456eed,_0xbe15('0x1f'),_0xbe15('0x20'));_0x4c614d+=_0x135770[_0xbe15('0x18')]('base64');return _0x4c614d;};exports['decryptString']=function(_0x3954b0,_0x164f08,_0x4163a0){var _0x5b3834=_0x4163a0||stringOptions[_0xbe15('0x8')];var _0x2524a5=_0x164f08||stringOptions['secret'];var _0x111700=crypto[_0xbe15('0x1b')](_0x5b3834,_0x2524a5);var _0x5c1694=_0x111700[_0xbe15('0x1c')](_0x3954b0,_0xbe15('0x20'),'utf8');_0x5c1694+=_0x111700[_0xbe15('0x18')](_0xbe15('0x1f'));return _0x5c1694;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 5a49bf3..1ddf6fb 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 _0x60c7=['inspect','Failed','finally','util','path','lodash','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','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','join','mkdirSync','%s%d.%s','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x331a2c,_0xc59b3e){var _0x508e83=function(_0x5e8d02){while(--_0x5e8d02){_0x331a2c['push'](_0x331a2c['shift']());}};_0x508e83(++_0xc59b3e);}(_0x60c7,0x1ce));var _0x760c=function(_0x19e6f6,_0x508896){_0x19e6f6=_0x19e6f6-0x0;var _0x3320e6=_0x60c7[_0x19e6f6];return _0x3320e6;};'use strict';var util=require(_0x760c('0x0'));var path=require(_0x760c('0x1'));var _=require(_0x760c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x760c('0x3'));var zipdir=require(_0x760c('0x4'));var rimraf=require(_0x760c('0x5'));var db=require(_0x760c('0x6'))['db'];var dbH=require(_0x760c('0x6'))[_0x760c('0x7')];var logger=require(_0x760c('0x8'))(_0x760c('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x760c('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x760c('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x387e12,_0x2c4467){var _0x1456d3={'status':_0x387e12};var _0x3f36e1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c4467){_0x1456d3[_0x760c('0xb')]=_0x2c4467;}return db[_0x760c('0xc')][_0x760c('0xd')](_0x1456d3,_0x3f36e1);}function main(){var _0x172103=0x1388;var _0x3e00e9;logger[_0x760c('0xe')](util[_0x760c('0xf')](_0x760c('0x10'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x760c('0x11')][_0x760c('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x760c('0x13'),_0x760c('0x14')]})['then'](function(_0x417647){if(_0x417647){_0x3e00e9=_0x417647;_0x172103=_0x3e00e9[_0x760c('0x14')]||0x1388;}})[_0x760c('0x15')](function(){return dbH[_0x760c('0x16')][_0x760c('0x17')](util[_0x760c('0xf')](_0x760c('0x18'),QUERY),{'type':dbH[_0x760c('0x16')][_0x760c('0x19')]['SELECT']});})[_0x760c('0x15')](function(_0x5ad9f6){if(!_0x5ad9f6[0x0][_0x760c('0x1a')]){return analyticExtractedReport(_0x760c('0x1b'));}var _0x5c3fb9=[];var _0x3ddc3d=0x0;if(_0x3e00e9[_0x760c('0x13')]){if(_0x5ad9f6&&_0x5ad9f6[_0x760c('0x1c')]){var _0x47dc07=_['range'](_0x5ad9f6[0x0]['num']/_0x172103);var _0x3bde0d=Number[_0x760c('0x1d')](_0x5ad9f6[0x0][_0x760c('0x1a')]/_0x172103)?_0x5ad9f6[0x0][_0x760c('0x1a')]%_0x172103:0x0;_0x47dc07[_0x760c('0x1e')](function(_0x59393a){if(_0x59393a>0x0){_0x3ddc3d+=_0x172103;}_0x5c3fb9[_0x760c('0x1f')](dbH[_0x760c('0x16')][_0x760c('0x17')](util[_0x760c('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x172103,_0x3ddc3d),{'type':dbH[_0x760c('0x16')][_0x760c('0x19')]['SELECT']}));});if(_0x3bde0d>0x0){_0x3ddc3d+=_0x172103;_0x5c3fb9[_0x760c('0x1f')](dbH[_0x760c('0x16')][_0x760c('0x17')](util[_0x760c('0xf')](_0x760c('0x20'),QUERY,_0x3bde0d,_0x3ddc3d),{'type':dbH['sequelize']['QueryTypes'][_0x760c('0x21')]}));}}}else{_0x5c3fb9[_0x760c('0x1f')](dbH[_0x760c('0x16')][_0x760c('0x17')](QUERY,{'type':dbH[_0x760c('0x16')][_0x760c('0x19')]['SELECT']}));}var _0x519146=path[_0x760c('0x22')](PATH);var _0x2c6cc5=path[_0x760c('0x23')](PATH,'.csv');var _0x59373d=_0x3e00e9[_0x760c('0x13')]&&_0x5c3fb9['length']>0x1;var _0x2223fd=[];if(!fs['existsSync'](path[_0x760c('0x24')](_0x519146,_0x2c6cc5))&&_0x59373d){fs[_0x760c('0x25')](path['join'](_0x519146,_0x2c6cc5));}return BPromise['each'](_0x5c3fb9,function(_0x2fc05c){_0x2223fd[_0x760c('0x1f')](_0x2fc05c);})[_0x760c('0x15')](function(){for(var _0x18754c=0x0;_0x18754c<_0x2223fd['length'];_0x18754c+=0x1){var _0x5e4cce;var _0x201d9f=_0x2223fd[_0x18754c];if(_0x59373d){_0x5e4cce=path[_0x760c('0x24')](_0x519146,_0x2c6cc5,util[_0x760c('0xf')](_0x760c('0x26'),_0x2c6cc5,_0x18754c,_0x760c('0x27')));}else{_0x5e4cce=path[_0x760c('0x24')](_0x519146,util['format'](_0x760c('0x28'),_0x2c6cc5,_0x760c('0x27')));}fs['writeFileSync'](_0x5e4cce,csv(_0x201d9f));}})[_0x760c('0x15')](function(){if(_0x59373d){return new Promise(function(_0x2beb47){zipdir(path['join'](_0x519146,_0x2c6cc5),{'saveTo':path[_0x760c('0x24')](_0x519146,util[_0x760c('0xf')](_0x760c('0x28'),_0x2c6cc5,'zip'))},function(_0x192763,_0x1a9183){rimraf(path[_0x760c('0x24')](_0x519146,_0x2c6cc5),function(){});_0x2beb47(_0x760c('0x29'));});});}})[_0x760c('0x15')](function(){logger[_0x760c('0xe')](util[_0x760c('0xf')](_0x760c('0x2a'),EXTRACTED_REPORT_ID,_0x760c('0x2b')));return analyticExtractedReport(_0x760c('0x2c'),_0x59373d?util['format']('%s.%s',_0x2c6cc5,_0x59373d?_0x760c('0x2d'):'csv'):null);});})[_0x760c('0x2e')](function(_0x29c69b){logger['info'](util[_0x760c('0xf')](_0x760c('0x2f'),EXTRACTED_REPORT_ID,_0x760c('0x2b')),util[_0x760c('0x30')](_0x29c69b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x760c('0x31'));})[_0x760c('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb41a=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','length','existsSync','mkdirSync','join','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format'];(function(_0x44e4dd,_0x2ef1d4){var _0xf2eda5=function(_0x14a166){while(--_0x14a166){_0x44e4dd['push'](_0x44e4dd['shift']());}};_0xf2eda5(++_0x2ef1d4);}(_0xb41a,0x142));var _0xab41=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xb41a[_0x1a9204];return _0x17ca68;};'use strict';var util=require(_0xab41('0x0'));var path=require(_0xab41('0x1'));var _=require(_0xab41('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xab41('0x3'));var zipdir=require(_0xab41('0x4'));var rimraf=require('rimraf');var db=require(_0xab41('0x5'))['db'];var dbH=require(_0xab41('0x5'))[_0xab41('0x6')];var logger=require(_0xab41('0x7'))(_0xab41('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xab41('0x9')][0x2]);var QUERY=process[_0xab41('0x9')][0x3];var PATH=process[_0xab41('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1850d4,_0x4b5544){var _0x249389={'status':_0x1850d4};var _0x50575a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b5544){_0x249389['savename']=_0x4b5544;}return db[_0xab41('0xa')][_0xab41('0xb')](_0x249389,_0x50575a);}function main(){var _0x2f60ba=0x1388;var _0x5eb8f1;logger[_0xab41('0xc')](util[_0xab41('0xd')](_0xab41('0xe'),EXTRACTED_REPORT_ID,_0xab41('0xf')));return db[_0xab41('0x10')][_0xab41('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xab41('0x12'),_0xab41('0x13')]})[_0xab41('0x14')](function(_0x574b4b){if(_0x574b4b){_0x5eb8f1=_0x574b4b;_0x2f60ba=_0x5eb8f1[_0xab41('0x13')]||0x1388;}})[_0xab41('0x14')](function(){return dbH[_0xab41('0x15')][_0xab41('0x16')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xab41('0x17')]['SELECT']});})[_0xab41('0x14')](function(_0x12a815){if(!_0x12a815[0x0][_0xab41('0x18')]){return analyticExtractedReport('Empty');}var _0x1571f=[];var _0x3d66cf=0x0;if(_0x5eb8f1['split']){if(_0x12a815&&_0x12a815['length']){var _0x506d05=_['range'](_0x12a815[0x0][_0xab41('0x18')]/_0x2f60ba);var _0x4a2a46=Number[_0xab41('0x19')](_0x12a815[0x0][_0xab41('0x18')]/_0x2f60ba)?_0x12a815[0x0][_0xab41('0x18')]%_0x2f60ba:0x0;_0x506d05[_0xab41('0x1a')](function(_0x5ac605){if(_0x5ac605>0x0){_0x3d66cf+=_0x2f60ba;}_0x1571f[_0xab41('0x1b')](dbH[_0xab41('0x15')][_0xab41('0x16')](util[_0xab41('0xd')](_0xab41('0x1c'),QUERY,_0x2f60ba,_0x3d66cf),{'type':dbH[_0xab41('0x15')]['QueryTypes'][_0xab41('0x1d')]}));});if(_0x4a2a46>0x0){_0x3d66cf+=_0x2f60ba;_0x1571f['push'](dbH[_0xab41('0x15')]['query'](util[_0xab41('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4a2a46,_0x3d66cf),{'type':dbH['sequelize'][_0xab41('0x17')][_0xab41('0x1d')]}));}}}else{_0x1571f[_0xab41('0x1b')](dbH['sequelize'][_0xab41('0x16')](QUERY,{'type':dbH[_0xab41('0x15')]['QueryTypes']['SELECT']}));}var _0x36879b=path[_0xab41('0x1e')](PATH);var _0x5d0303=path[_0xab41('0x1f')](PATH,_0xab41('0x20'));var _0x5031f8=_0x5eb8f1[_0xab41('0x12')]&&_0x1571f[_0xab41('0x21')]>0x1;var _0x283b83=[];if(!fs[_0xab41('0x22')](path['join'](_0x36879b,_0x5d0303))&&_0x5031f8){fs[_0xab41('0x23')](path[_0xab41('0x24')](_0x36879b,_0x5d0303));}return BPromise['each'](_0x1571f,function(_0x4d88ff){_0x283b83[_0xab41('0x1b')](_0x4d88ff);})[_0xab41('0x14')](function(){for(var _0x3aebcd=0x0;_0x3aebcd<_0x283b83['length'];_0x3aebcd+=0x1){var _0x20b249;var _0x151ee5=_0x283b83[_0x3aebcd];if(_0x5031f8){_0x20b249=path[_0xab41('0x24')](_0x36879b,_0x5d0303,util['format']('%s%d.%s',_0x5d0303,_0x3aebcd,'csv'));}else{_0x20b249=path[_0xab41('0x24')](_0x36879b,util[_0xab41('0xd')](_0xab41('0x25'),_0x5d0303,_0xab41('0x26')));}fs[_0xab41('0x27')](_0x20b249,csv(_0x151ee5));}})[_0xab41('0x14')](function(){if(_0x5031f8){return new Promise(function(_0x21f941){zipdir(path[_0xab41('0x24')](_0x36879b,_0x5d0303),{'saveTo':path[_0xab41('0x24')](_0x36879b,util['format']('%s.%s',_0x5d0303,_0xab41('0x28')))},function(_0xf34a20,_0x200fac){rimraf(path[_0xab41('0x24')](_0x36879b,_0x5d0303),function(){});_0x21f941(_0xab41('0x29'));});});}})[_0xab41('0x14')](function(){logger[_0xab41('0xc')](util['format'](_0xab41('0x2a'),EXTRACTED_REPORT_ID,_0xab41('0xf')));return analyticExtractedReport(_0xab41('0x2b'),_0x5031f8?util['format'](_0xab41('0x25'),_0x5d0303,_0x5031f8?_0xab41('0x28'):_0xab41('0x26')):null);});})['catch'](function(_0x2b3d82){logger[_0xab41('0xc')](util[_0xab41('0xd')](_0xab41('0x2c'),EXTRACTED_REPORT_ID,_0xab41('0xf')),util['inspect'](_0x2b3d82,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab41('0x2d'));})[_0xab41('0x2e')](function(){process[_0xab41('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index bfd9325..8e12dcf 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 _0xe9da=['fill','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','footer','Arial','right','num','Setting','find','split','splitSizePdf','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','existsSync','mkdirSync','join','each','then','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','tableHeader','pick','toString','value'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xe9da,0x159));var _0xae9d=function(_0x5985b3,_0x26454f){_0x5985b3=_0x5985b3-0x0;var _0x4e2edb=_0xe9da[_0x5985b3];return _0x4e2edb;};'use strict';var _=require(_0xae9d('0x0'));var fs=require('fs');var util=require(_0xae9d('0x1'));var path=require(_0xae9d('0x2'));var moment=require(_0xae9d('0x3'));var htmlToPdfmake=require(_0xae9d('0x4'));var PdfPrinter=require(_0xae9d('0x5'));var zipdir=require(_0xae9d('0x6'));var rimraf=require(_0xae9d('0x7'));var JSDOM=require(_0xae9d('0x8'))[_0xae9d('0x9')];var window=new JSDOM('')[_0xae9d('0xa')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0xae9d('0xb'))[_0xae9d('0xc')];var logger=require(_0xae9d('0xd'))(_0xae9d('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0xae9d('0xf')][0x2]);var QUERY=process[_0xae9d('0xf')][0x3];var PATH=process[_0xae9d('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d8937,_0x5a5169){var _0x13bf61={'status':_0x4d8937};var _0x53afa6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a5169){_0x13bf61[_0xae9d('0x10')]=_0x5a5169;}return db[_0xae9d('0x11')][_0xae9d('0x12')](_0x13bf61,_0x53afa6);}function getHeaders(_0xdba4aa){return _['map'](_0xdba4aa,function(_0xbadfc7){return{'text':_0xbadfc7,'style':_0xae9d('0x13')};});}function getRows(_0x300159,_0x2880e2){return _['map'](_0x2880e2,function(_0x19e700){return _(_0x19e700)[_0xae9d('0x14')](_0x300159)['map'](function(_0x285ce3){return _0x285ce3?_[_0xae9d('0x15')](_0x285ce3):'';})[_0xae9d('0x16')]();});}function createTable(_0x31cbad,_0x4105d0){var _0x4d513b={'widths':_[_0xae9d('0x17')](Array(_0x31cbad[_0xae9d('0x18')]),0x91),'heights':function(_0x3685da){return _0x3685da===0x0?_0xae9d('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4b622a=getHeaders(_0x31cbad);_0x4d513b[_0xae9d('0x1a')][_0xae9d('0x1b')](_0x4b622a);var _0x3c42ba=getRows(_0x31cbad,_0x4105d0);_0x4d513b[_0xae9d('0x1a')]=_0x4d513b[_0xae9d('0x1a')]['concat'](_0x3c42ba);return _0x4d513b;}function createTables(_0x4290de){var _0x112dfd=[];var _0x1029c1=_[_0xae9d('0x1c')](Object[_0xae9d('0x1d')](_0x4290de[0x0]),0x5);_0x1029c1[_0xae9d('0x1e')](function(_0x44e05f){_0x112dfd[_0xae9d('0x1b')](createTable(_0x44e05f,_0x4290de));});return _0x112dfd;}function getPDFDocDefinition(_0x49374a){var _0x317824=util[_0xae9d('0x1f')](_0xae9d('0x20'),NAME,EXTRACTED_REPORT[_0xae9d('0x21')],moment(EXTRACTED_REPORT[_0xae9d('0x22')])[_0xae9d('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0xae9d('0x23')])[_0xae9d('0x1f')](FORMAT));var _0x4d41d5=[];for(var _0xafd381=0x0;_0xafd381<_0x49374a[_0xae9d('0x18')];_0xafd381++){var _0x6c382f=[];if(_0xafd381===0x0){_0x6c382f['push']({'text':_0x317824,'style':_0xae9d('0x24')});}var _0x2573bb={'table':_0x49374a[_0xafd381]};if(_0xafd381>0x0){_0x2573bb[_0xae9d('0x25')]='before';_0x2573bb[_0xae9d('0x26')]=[0x0,0x46,0x0,0x0];}_0x6c382f[_0xae9d('0x1b')](_0x2573bb);_0x4d41d5[_0xae9d('0x1b')](_0x6c382f);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4d41d5,'footer':function(_0x273b51,_0x2c8b0e){return{'text':_0x273b51[_0xae9d('0x15')]()+'\x20/\x20'+_0x2c8b0e,'style':_0xae9d('0x27')};},'defaultStyle':{'font':_0xae9d('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xae9d('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x522b0f){var _0x260b9d=0x1388;var _0x1d11f7;if(!_0x522b0f[0x0][_0xae9d('0x2a')]){return analyticExtractedReport('Empty');}return db[_0xae9d('0x2b')][_0xae9d('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xae9d('0x2d'),_0xae9d('0x2e')]})['then'](function(_0x519fa1){if(_0x519fa1){_0x1d11f7=_0x519fa1;_0x260b9d=_0x1d11f7[_0xae9d('0x2e')]||0x3e8;}})['then'](function(){var _0x1baf66=[];var _0xa3a48b=0x0;if(_0x1d11f7[_0xae9d('0x2d')]){if(_0x522b0f&&_0x522b0f['length']){var _0x2c3151=_[_0xae9d('0x2f')](_0x522b0f[0x0][_0xae9d('0x2a')]/_0x260b9d);var _0x332a70=Number[_0xae9d('0x30')](_0x522b0f[0x0][_0xae9d('0x2a')]/_0x260b9d)?_0x522b0f[0x0][_0xae9d('0x2a')]%_0x260b9d:0x0;_0x2c3151[_0xae9d('0x1e')](function(_0x8d27f8){if(_0x8d27f8>0x0){_0xa3a48b+=_0x260b9d;}_0x1baf66[_0xae9d('0x1b')](dbH[_0xae9d('0x31')]['query'](util[_0xae9d('0x1f')](_0xae9d('0x32'),QUERY,_0x260b9d,_0xa3a48b),{'type':dbH[_0xae9d('0x31')][_0xae9d('0x33')][_0xae9d('0x34')]}));});if(_0x332a70>0x0){_0xa3a48b+=_0x260b9d;_0x1baf66[_0xae9d('0x1b')](dbH[_0xae9d('0x31')]['query'](util['format'](_0xae9d('0x32'),QUERY,_0x332a70,_0xa3a48b),{'type':dbH['sequelize'][_0xae9d('0x33')]['SELECT']}));}}}else{_0x1baf66[_0xae9d('0x1b')](dbH[_0xae9d('0x31')][_0xae9d('0x35')](QUERY,{'type':dbH['sequelize'][_0xae9d('0x33')][_0xae9d('0x34')]}));}var _0x5b401d=path['dirname'](PATH);var _0xc07e2f=path[_0xae9d('0x36')](PATH,_0xae9d('0x37'));var _0x43aed0=_0x1d11f7['split']&&_0x1baf66['length']>0x1;var _0x173057=[];if(!fs[_0xae9d('0x38')](path['join'](_0x5b401d,_0xc07e2f))&&_0x43aed0){fs[_0xae9d('0x39')](path[_0xae9d('0x3a')](_0x5b401d,_0xc07e2f));}return BPromise[_0xae9d('0x3b')](_0x1baf66,function(_0xbbb155){_0x173057[_0xae9d('0x1b')](_0xbbb155);})[_0xae9d('0x3c')](function(){var _0x337685=[];for(var _0xeaf285=0x0;_0xeaf285<_0x173057[_0xae9d('0x18')];_0xeaf285+=0x1){var _0x243d07=_0x173057[_0xeaf285];var _0x360ef2=createTables(_[_0xae9d('0x3d')](_0x243d07));var _0x27b3af;var _0x2c4b6a=getPDFDocDefinition(_0x360ef2);var _0x18cd4c=getPDFPrinter();var _0x48c34d=_0x18cd4c[_0xae9d('0x3e')](_0x2c4b6a);if(_0x43aed0){_0x27b3af=path[_0xae9d('0x3a')](_0x5b401d,_0xc07e2f,util['format'](_0xae9d('0x3f'),_0xc07e2f,_0xeaf285,_0xae9d('0x40')));}else{_0x27b3af=path['join'](_0x5b401d,util[_0xae9d('0x1f')](_0xae9d('0x41'),_0xc07e2f,_0xae9d('0x40')));}_0x337685[_0xae9d('0x1b')](writePDFDocument(_0x48c34d,_0x27b3af));}return Promise['all'](_0x337685);})['then'](function(){if(_0x43aed0){return new Promise(function(_0x5d0da3){zipdir(path['join'](_0x5b401d,_0xc07e2f),{'saveTo':path[_0xae9d('0x3a')](_0x5b401d,util[_0xae9d('0x1f')](_0xae9d('0x41'),_0xc07e2f,'zip'))},function(){rimraf(path[_0xae9d('0x3a')](_0x5b401d,_0xc07e2f),function(){});_0x5d0da3(_0xae9d('0x42'));});});}})[_0xae9d('0x3c')](function(){if(!_0x43aed0)return;rimraf(path[_0xae9d('0x3a')](_0x5b401d,_0xc07e2f),function(){});})['then'](function(){logger[_0xae9d('0x43')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xae9d('0x44')));return analyticExtractedReport(_0xae9d('0x45'),_0x43aed0?util[_0xae9d('0x1f')](_0xae9d('0x41'),_0xc07e2f,_0x43aed0?_0xae9d('0x46'):_0xae9d('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xae9d('0x43')](util[_0xae9d('0x1f')](_0xae9d('0x47'),EXTRACTED_REPORT_ID,_0xae9d('0x44')));return db[_0xae9d('0x11')][_0xae9d('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x105fb4){EXTRACTED_REPORT=_0x105fb4;return dbH[_0xae9d('0x31')][_0xae9d('0x35')](util['format'](_0xae9d('0x49'),QUERY),{'type':dbH[_0xae9d('0x31')][_0xae9d('0x33')]['SELECT']});})[_0xae9d('0x3c')](extractReport)[_0xae9d('0x4a')](function(_0x4eecc5){logger[_0xae9d('0x43')](util[_0xae9d('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xae9d('0x44')),util[_0xae9d('0x4b')](_0x4eecc5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xae9d('0x4c'));})[_0xae9d('0x4d')](function(){process[_0xae9d('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x555889=new PdfPrinter({'Arial':{'normal':__dirname+_0xae9d('0x4f'),'bold':__dirname+_0xae9d('0x50'),'italics':__dirname+_0xae9d('0x51'),'bolditalics':__dirname+_0xae9d('0x52')}});return _0x555889;}function getPDFDocDefinitionFromHTML(_0x1992eb,_0x447208){var _0x1abfc4=util[_0xae9d('0x1f')](_0xae9d('0x53'),_0x447208['channel'],_0x447208['interactionId']);var _0x3c14c8=moment()[_0xae9d('0x1f')]('YYYY-MM-DD')['toString']();var _0x3d7ef1=htmlToPdfmake(_0x1992eb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3d7ef1],'defaultStyle':{'font':_0xae9d('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xae9d('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xae9d('0x24')}];},'footer':function(_0x110a82,_0x426bb1){return[{'text':util['format'](_0xae9d('0x55'),_0x1abfc4,_0x110a82,_0x426bb1,_0x3c14c8),'style':'footer'}];}};}function writePDFDocument(_0x12d8d9,_0x41508d){return new Promise(function(_0x374ec9,_0x25f354){var _0x3ec757=_0x12d8d9[_0xae9d('0x56')](fs[_0xae9d('0x57')](_0x41508d));_0x3ec757['on'](_0xae9d('0x58'),function(){_0x374ec9('finish');});_0x3ec757['on'](_0xae9d('0x59'),function(_0x1ebf40){_0x25f354(_0x1ebf40);});_0x12d8d9[_0xae9d('0x5a')]();});}exports[_0xae9d('0x5b')]=function(_0x6e11f8,_0x2a864e){var _0x12d7d9=getPDFPrinter();var _0x853828=getPDFDocDefinitionFromHTML(_0x6e11f8,_0x2a864e);var _0x27c0d0=_0x12d7d9[_0xae9d('0x3e')](_0x853828);return writePDFDocument(_0x27c0d0,_0x2a864e[_0xae9d('0x2')])[_0xae9d('0x4a')](function(_0x38757e){throw _0x38757e;});}; \ No newline at end of file +var _0xc754=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.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','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','toString','\x20/\x20','Arial','black','right','num','Empty','find','split','splitSizePdf','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','basename','existsSync','join','mkdirSync','each','then','flatten','createPdfKitDocument','pdf','%s.%s','all','zip'];(function(_0xf5e575,_0xb14e2a){var _0x3a2abc=function(_0x4fc1c5){while(--_0x4fc1c5){_0xf5e575['push'](_0xf5e575['shift']());}};_0x3a2abc(++_0xb14e2a);}(_0xc754,0xce));var _0x4c75=function(_0x81bda6,_0x58e84c){_0x81bda6=_0x81bda6-0x0;var _0x40c71e=_0xc754[_0x81bda6];return _0x40c71e;};'use strict';var _=require(_0x4c75('0x0'));var fs=require('fs');var util=require(_0x4c75('0x1'));var path=require(_0x4c75('0x2'));var moment=require(_0x4c75('0x3'));var htmlToPdfmake=require(_0x4c75('0x4'));var PdfPrinter=require(_0x4c75('0x5'));var zipdir=require(_0x4c75('0x6'));var rimraf=require(_0x4c75('0x7'));var JSDOM=require(_0x4c75('0x8'))['JSDOM'];var window=new JSDOM('')[_0x4c75('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x4c75('0xa'))[_0x4c75('0xb')];var logger=require(_0x4c75('0xc'))(_0x4c75('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x4c75('0xe')][0x2]);var QUERY=process[_0x4c75('0xe')][0x3];var PATH=process[_0x4c75('0xe')][0x4];var NAME=process[_0x4c75('0xe')][0x5];var FORMAT=_0x4c75('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x24c8a5,_0x3f2fff){var _0x4448ce={'status':_0x24c8a5};var _0x2e57ed={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f2fff){_0x4448ce[_0x4c75('0x10')]=_0x3f2fff;}return db['AnalyticExtractedReport'][_0x4c75('0x11')](_0x4448ce,_0x2e57ed);}function getHeaders(_0x726e8d){return _[_0x4c75('0x12')](_0x726e8d,function(_0x392994){return{'text':_0x392994,'style':'tableHeader'};});}function getRows(_0x538400,_0x4d67c6){return _[_0x4c75('0x12')](_0x4d67c6,function(_0x373d59){return _(_0x373d59)[_0x4c75('0x13')](_0x538400)['map'](function(_0xd8413a){return _0xd8413a?_['toString'](_0xd8413a):'';})[_0x4c75('0x14')]();});}function createTable(_0x50388b,_0x5b1419){var _0x281c94={'widths':_[_0x4c75('0x15')](Array(_0x50388b[_0x4c75('0x16')]),0x91),'heights':function(_0x182c70){return _0x182c70===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x9eed37=getHeaders(_0x50388b);_0x281c94[_0x4c75('0x17')][_0x4c75('0x18')](_0x9eed37);var _0x295443=getRows(_0x50388b,_0x5b1419);_0x281c94['body']=_0x281c94[_0x4c75('0x17')][_0x4c75('0x19')](_0x295443);return _0x281c94;}function createTables(_0x223b97){var _0x319afb=[];var _0x3cc303=_[_0x4c75('0x1a')](Object[_0x4c75('0x1b')](_0x223b97[0x0]),0x5);_0x3cc303[_0x4c75('0x1c')](function(_0x311666){_0x319afb[_0x4c75('0x18')](createTable(_0x311666,_0x223b97));});return _0x319afb;}function getPDFDocDefinition(_0x3498c9){var _0x3ebaaf=util[_0x4c75('0x1d')](_0x4c75('0x1e'),NAME,EXTRACTED_REPORT[_0x4c75('0x1f')],moment(EXTRACTED_REPORT[_0x4c75('0x20')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x4c75('0x21')])[_0x4c75('0x1d')](FORMAT));var _0x1d8ab2=[];for(var _0x44a562=0x0;_0x44a562<_0x3498c9['length'];_0x44a562++){var _0x40b307=[];if(_0x44a562===0x0){_0x40b307[_0x4c75('0x18')]({'text':_0x3ebaaf,'style':_0x4c75('0x22')});}var _0x559e56={'table':_0x3498c9[_0x44a562]};if(_0x44a562>0x0){_0x559e56[_0x4c75('0x23')]=_0x4c75('0x24');_0x559e56[_0x4c75('0x25')]=[0x0,0x46,0x0,0x0];}_0x40b307[_0x4c75('0x18')](_0x559e56);_0x1d8ab2[_0x4c75('0x18')](_0x40b307);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x1d8ab2,'footer':function(_0x14f0c2,_0x310616){return{'text':_0x14f0c2[_0x4c75('0x26')]()+_0x4c75('0x27')+_0x310616,'style':'footer'};},'defaultStyle':{'font':_0x4c75('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4c75('0x29')},'footer':{'alignment':_0x4c75('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1c3c8e){var _0xc51ba2=0x1388;var _0x13a5f4;if(!_0x1c3c8e[0x0][_0x4c75('0x2b')]){return analyticExtractedReport(_0x4c75('0x2c'));}return db['Setting'][_0x4c75('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4c75('0x2e'),_0x4c75('0x2f')]})['then'](function(_0x5b6ef9){if(_0x5b6ef9){_0x13a5f4=_0x5b6ef9;_0xc51ba2=_0x13a5f4['splitSizePdf']||0x3e8;}})['then'](function(){var _0x298999=[];var _0x16e7e6=0x0;if(_0x13a5f4[_0x4c75('0x2e')]){if(_0x1c3c8e&&_0x1c3c8e[_0x4c75('0x16')]){var _0xa8d7f0=_[_0x4c75('0x30')](_0x1c3c8e[0x0]['num']/_0xc51ba2);var _0x16635e=Number[_0x4c75('0x31')](_0x1c3c8e[0x0][_0x4c75('0x2b')]/_0xc51ba2)?_0x1c3c8e[0x0][_0x4c75('0x2b')]%_0xc51ba2:0x0;_0xa8d7f0[_0x4c75('0x1c')](function(_0x4fdfdb){if(_0x4fdfdb>0x0){_0x16e7e6+=_0xc51ba2;}_0x298999['push'](dbH['sequelize'][_0x4c75('0x32')](util['format'](_0x4c75('0x33'),QUERY,_0xc51ba2,_0x16e7e6),{'type':dbH[_0x4c75('0x34')][_0x4c75('0x35')][_0x4c75('0x36')]}));});if(_0x16635e>0x0){_0x16e7e6+=_0xc51ba2;_0x298999[_0x4c75('0x18')](dbH[_0x4c75('0x34')]['query'](util[_0x4c75('0x1d')](_0x4c75('0x33'),QUERY,_0x16635e,_0x16e7e6),{'type':dbH[_0x4c75('0x34')][_0x4c75('0x35')][_0x4c75('0x36')]}));}}}else{_0x298999[_0x4c75('0x18')](dbH['sequelize'][_0x4c75('0x32')](QUERY,{'type':dbH[_0x4c75('0x34')]['QueryTypes'][_0x4c75('0x36')]}));}var _0x23d2cb=path['dirname'](PATH);var _0x2ee34d=path[_0x4c75('0x37')](PATH,'.pdf');var _0x33b7b4=_0x13a5f4[_0x4c75('0x2e')]&&_0x298999[_0x4c75('0x16')]>0x1;var _0x486f51=[];if(!fs[_0x4c75('0x38')](path[_0x4c75('0x39')](_0x23d2cb,_0x2ee34d))&&_0x33b7b4){fs[_0x4c75('0x3a')](path[_0x4c75('0x39')](_0x23d2cb,_0x2ee34d));}return BPromise[_0x4c75('0x3b')](_0x298999,function(_0x3d7145){_0x486f51[_0x4c75('0x18')](_0x3d7145);})[_0x4c75('0x3c')](function(){var _0x4bec14=[];for(var _0x362892=0x0;_0x362892<_0x486f51[_0x4c75('0x16')];_0x362892+=0x1){var _0x1f1a7c=_0x486f51[_0x362892];var _0x58c174=createTables(_[_0x4c75('0x3d')](_0x1f1a7c));var _0x28814b;var _0x3ea45d=getPDFDocDefinition(_0x58c174);var _0x5064c1=getPDFPrinter();var _0x378870=_0x5064c1[_0x4c75('0x3e')](_0x3ea45d);if(_0x33b7b4){_0x28814b=path['join'](_0x23d2cb,_0x2ee34d,util[_0x4c75('0x1d')]('%s%d.%s',_0x2ee34d,_0x362892,_0x4c75('0x3f')));}else{_0x28814b=path[_0x4c75('0x39')](_0x23d2cb,util[_0x4c75('0x1d')](_0x4c75('0x40'),_0x2ee34d,_0x4c75('0x3f')));}_0x4bec14['push'](writePDFDocument(_0x378870,_0x28814b));}return Promise[_0x4c75('0x41')](_0x4bec14);})[_0x4c75('0x3c')](function(){if(_0x33b7b4){return new Promise(function(_0x196558){zipdir(path['join'](_0x23d2cb,_0x2ee34d),{'saveTo':path[_0x4c75('0x39')](_0x23d2cb,util[_0x4c75('0x1d')]('%s.%s',_0x2ee34d,_0x4c75('0x42')))},function(){rimraf(path['join'](_0x23d2cb,_0x2ee34d),function(){});_0x196558('zip\x20finished');});});}})[_0x4c75('0x3c')](function(){if(!_0x33b7b4)return;rimraf(path['join'](_0x23d2cb,_0x2ee34d),function(){});})['then'](function(){logger['info'](util['format'](_0x4c75('0x43'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x33b7b4?util[_0x4c75('0x1d')]('%s.%s',_0x2ee34d,_0x33b7b4?_0x4c75('0x42'):_0x4c75('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x4c75('0x44')](util[_0x4c75('0x1d')](_0x4c75('0x45'),EXTRACTED_REPORT_ID,_0x4c75('0x46')));return db['AnalyticExtractedReport'][_0x4c75('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4c75('0x3c')](function(_0x160584){EXTRACTED_REPORT=_0x160584;return dbH[_0x4c75('0x34')][_0x4c75('0x32')](util[_0x4c75('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x4c75('0x35')][_0x4c75('0x36')]});})[_0x4c75('0x3c')](extractReport)[_0x4c75('0x48')](function(_0x231659){logger[_0x4c75('0x44')](util[_0x4c75('0x1d')](_0x4c75('0x49'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x231659,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4c75('0x4a')](function(){process[_0x4c75('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x34e031=new PdfPrinter({'Arial':{'normal':__dirname+_0x4c75('0x4c'),'bold':__dirname+_0x4c75('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x4c75('0x4e')}});return _0x34e031;}function getPDFDocDefinitionFromHTML(_0x49fca4,_0xb179ce){var _0x457cb1=util[_0x4c75('0x1d')](_0x4c75('0x4f'),_0xb179ce[_0x4c75('0x50')],_0xb179ce[_0x4c75('0x51')]);var _0x5c7ebf=moment()[_0x4c75('0x1d')]('YYYY-MM-DD')[_0x4c75('0x26')]();var _0x1d3576=htmlToPdfmake(_0x49fca4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1d3576],'defaultStyle':{'font':_0x4c75('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x4c75('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x4c75('0x52')}},'header':function(){return[{'text':_0x4c75('0x53'),'style':_0x4c75('0x22')}];},'footer':function(_0x177ecc,_0x250a62){return[{'text':util[_0x4c75('0x1d')](_0x4c75('0x54'),_0x457cb1,_0x177ecc,_0x250a62,_0x5c7ebf),'style':'footer'}];}};}function writePDFDocument(_0xe1e95e,_0x15d82f){return new Promise(function(_0x4d9dbe,_0x1c9cc5){var _0x3a2d56=_0xe1e95e[_0x4c75('0x55')](fs[_0x4c75('0x56')](_0x15d82f));_0x3a2d56['on']('finish',function(){_0x4d9dbe(_0x4c75('0x57'));});_0x3a2d56['on'](_0x4c75('0x58'),function(_0x16e9f7){_0x1c9cc5(_0x16e9f7);});_0xe1e95e[_0x4c75('0x59')]();});}exports[_0x4c75('0x5a')]=function(_0x1b62eb,_0x1abfb1){var _0x598308=getPDFPrinter();var _0x3640d7=getPDFDocDefinitionFromHTML(_0x1b62eb,_0x1abfb1);var _0x4c2ef5=_0x598308[_0x4c75('0x3e')](_0x3640d7);return writePDFDocument(_0x4c2ef5,_0x1abfb1[_0x4c75('0x2')])[_0x4c75('0x48')](function(_0xf5f3ce){throw _0xf5f3ce;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6470fcc..e3effb8 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 _0xbc8a=['query','QueryTypes','SELECT','num','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','each','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','info','format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize'];(function(_0x2dfa01,_0x505dbf){var _0x3aa8eb=function(_0xbe5099){while(--_0xbe5099){_0x2dfa01['push'](_0x2dfa01['shift']());}};_0x3aa8eb(++_0x505dbf);}(_0xbc8a,0xd3));var _0xabc8=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0xbc8a[_0x3cd133];return _0x2512c8;};'use strict';var util=require('util');var path=require(_0xabc8('0x0'));var _=require(_0xabc8('0x1'));var fs=require('fs');var json2xls=require(_0xabc8('0x2'));var BPromise=require(_0xabc8('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xabc8('0x4'));var db=require(_0xabc8('0x5'))['db'];var dbH=require(_0xabc8('0x5'))['dbH'];var logger=require('../../config/logger')(_0xabc8('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xabc8('0x7')][0x2]);var QUERY=process[_0xabc8('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xaa7964,_0x23c179){var _0x2adc47={'status':_0xaa7964};var _0x5d99af={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23c179){_0x2adc47[_0xabc8('0x8')]=_0x23c179;}return db[_0xabc8('0x9')]['update'](_0x2adc47,_0x5d99af);}function main(){var _0x28c868=0x1388;var _0xd7669c;logger[_0xabc8('0xa')](util[_0xabc8('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xabc8('0xc')));return db[_0xabc8('0xd')][_0xabc8('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xabc8('0xf'),'splitSizeXlsx']})[_0xabc8('0x10')](function(_0x5e98dc){if(_0x5e98dc){_0xd7669c=_0x5e98dc;_0x28c868=_0xd7669c[_0xabc8('0x11')]||0x1388;}})[_0xabc8('0x10')](function(){return dbH[_0xabc8('0x12')][_0xabc8('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xabc8('0x12')][_0xabc8('0x14')][_0xabc8('0x15')]});})[_0xabc8('0x10')](function(_0x48ab73){if(!_0x48ab73[0x0][_0xabc8('0x16')]){return analyticExtractedReport('Empty');}var _0x593579=[];var _0x259fd1=0x0;if(_0xd7669c[_0xabc8('0xf')]){if(_0x48ab73&&_0x48ab73[_0xabc8('0x17')]){var _0x1127ab=_[_0xabc8('0x18')](_0x48ab73[0x0][_0xabc8('0x16')]/_0x28c868);var _0x130993=Number['isInteger'](_0x48ab73[0x0]['num']/_0x28c868)?_0x48ab73[0x0][_0xabc8('0x16')]%_0x28c868:0x0;_0x1127ab['forEach'](function(_0xfc9ebb){if(_0xfc9ebb>0x0){_0x259fd1+=_0x28c868;}_0x593579[_0xabc8('0x19')](dbH['sequelize'][_0xabc8('0x13')](util[_0xabc8('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x28c868,_0x259fd1),{'type':dbH[_0xabc8('0x12')][_0xabc8('0x14')][_0xabc8('0x15')]}));});if(_0x130993>0x0){_0x259fd1+=_0x28c868;_0x593579[_0xabc8('0x19')](dbH['sequelize'][_0xabc8('0x13')](util[_0xabc8('0xb')](_0xabc8('0x1a'),QUERY,_0x130993,_0x259fd1),{'type':dbH[_0xabc8('0x12')][_0xabc8('0x14')]['SELECT']}));}}}else{_0x593579['push'](dbH['sequelize'][_0xabc8('0x13')](QUERY,{'type':dbH[_0xabc8('0x12')][_0xabc8('0x14')]['SELECT']}));}var _0x476a08=path[_0xabc8('0x1b')](PATH);var _0x55edf7=path[_0xabc8('0x1c')](PATH,_0xabc8('0x1d'));var _0x33addb=_0xd7669c['split']&&_0x593579['length']>0x1;var _0x2c10c0=[];if(!fs[_0xabc8('0x1e')](path['join'](_0x476a08,_0x55edf7))&&_0x33addb){fs['mkdirSync'](path[_0xabc8('0x1f')](_0x476a08,_0x55edf7));}return BPromise[_0xabc8('0x20')](_0x593579,function(_0x5c86d2){_0x2c10c0['push'](_0x5c86d2);})[_0xabc8('0x10')](function(){for(var _0x18300e=0x0;_0x18300e<_0x2c10c0['length'];_0x18300e+=0x1){var _0x320ad2;var _0x40e897=_0x2c10c0[_0x18300e];if(_0x33addb){_0x320ad2=path[_0xabc8('0x1f')](_0x476a08,_0x55edf7,util[_0xabc8('0xb')]('%s%d.%s',_0x55edf7,_0x18300e,'xlsx'));}else{_0x320ad2=path[_0xabc8('0x1f')](_0x476a08,util[_0xabc8('0xb')](_0xabc8('0x21'),_0x55edf7,_0xabc8('0x22')));}fs[_0xabc8('0x23')](_0x320ad2,json2xls(_0x40e897),_0xabc8('0x24'));}})[_0xabc8('0x10')](function(){if(_0x33addb){return new Promise(function(_0x53b682){zipdir(path['join'](_0x476a08,_0x55edf7),{'saveTo':path[_0xabc8('0x1f')](_0x476a08,util[_0xabc8('0xb')](_0xabc8('0x21'),_0x55edf7,_0xabc8('0x25')))},function(_0x2d7802,_0x4931b5){rimraf(path[_0xabc8('0x1f')](_0x476a08,_0x55edf7),function(){});_0x53b682(_0xabc8('0x26'));});});}})[_0xabc8('0x10')](function(){logger[_0xabc8('0xa')](util['format'](_0xabc8('0x27'),EXTRACTED_REPORT_ID,_0xabc8('0xc')));return analyticExtractedReport(_0xabc8('0x28'),_0x33addb?util[_0xabc8('0xb')](_0xabc8('0x21'),_0x55edf7,_0x33addb?_0xabc8('0x25'):_0xabc8('0x22')):null);});})[_0xabc8('0x29')](function(_0x31144f){logger[_0xabc8('0xa')](util[_0xabc8('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xabc8('0xc')),util[_0xabc8('0x2a')](_0x31144f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xabc8('0x2b'));})[_0xabc8('0x2c')](function(){process[_0xabc8('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9822=['xlsx','%s.%s','writeFileSync','zip','zip\x20finished','info','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','exit','util','path','lodash','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','length','join','each'];(function(_0x3f0d07,_0x3d5cc4){var _0x3e3074=function(_0x372d0a){while(--_0x372d0a){_0x3f0d07['push'](_0x3f0d07['shift']());}};_0x3e3074(++_0x3d5cc4);}(_0x9822,0x93));var _0x2982=function(_0x270a95,_0x5955c4){_0x270a95=_0x270a95-0x0;var _0x19d8d9=_0x9822[_0x270a95];return _0x19d8d9;};'use strict';var util=require(_0x2982('0x0'));var path=require(_0x2982('0x1'));var _=require(_0x2982('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2982('0x3'));var db=require(_0x2982('0x4'))['db'];var dbH=require(_0x2982('0x4'))[_0x2982('0x5')];var logger=require(_0x2982('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2982('0x7')][0x2]);var QUERY=process[_0x2982('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd348b9,_0x17ce53){var _0x587245={'status':_0xd348b9};var _0x17653e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17ce53){_0x587245[_0x2982('0x8')]=_0x17ce53;}return db[_0x2982('0x9')][_0x2982('0xa')](_0x587245,_0x17653e);}function main(){var _0x4a31e0=0x1388;var _0x45277b;logger['info'](util[_0x2982('0xb')](_0x2982('0xc'),EXTRACTED_REPORT_ID,_0x2982('0xd')));return db[_0x2982('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2982('0xf'),_0x2982('0x10')]})[_0x2982('0x11')](function(_0x3814eb){if(_0x3814eb){_0x45277b=_0x3814eb;_0x4a31e0=_0x45277b[_0x2982('0x10')]||0x1388;}})[_0x2982('0x11')](function(){return dbH['sequelize'][_0x2982('0x12')](util[_0x2982('0xb')](_0x2982('0x13'),QUERY),{'type':dbH[_0x2982('0x14')][_0x2982('0x15')][_0x2982('0x16')]});})[_0x2982('0x11')](function(_0x54eaff){if(!_0x54eaff[0x0][_0x2982('0x17')]){return analyticExtractedReport('Empty');}var _0x1e3fd2=[];var _0x382e6c=0x0;if(_0x45277b[_0x2982('0xf')]){if(_0x54eaff&&_0x54eaff['length']){var _0x1940f4=_[_0x2982('0x18')](_0x54eaff[0x0][_0x2982('0x17')]/_0x4a31e0);var _0x2c934e=Number[_0x2982('0x19')](_0x54eaff[0x0][_0x2982('0x17')]/_0x4a31e0)?_0x54eaff[0x0][_0x2982('0x17')]%_0x4a31e0:0x0;_0x1940f4['forEach'](function(_0x588eb5){if(_0x588eb5>0x0){_0x382e6c+=_0x4a31e0;}_0x1e3fd2[_0x2982('0x1a')](dbH[_0x2982('0x14')][_0x2982('0x12')](util[_0x2982('0xb')](_0x2982('0x1b'),QUERY,_0x4a31e0,_0x382e6c),{'type':dbH[_0x2982('0x14')][_0x2982('0x15')][_0x2982('0x16')]}));});if(_0x2c934e>0x0){_0x382e6c+=_0x4a31e0;_0x1e3fd2['push'](dbH['sequelize'][_0x2982('0x12')](util[_0x2982('0xb')](_0x2982('0x1b'),QUERY,_0x2c934e,_0x382e6c),{'type':dbH[_0x2982('0x14')][_0x2982('0x15')][_0x2982('0x16')]}));}}}else{_0x1e3fd2[_0x2982('0x1a')](dbH['sequelize'][_0x2982('0x12')](QUERY,{'type':dbH['sequelize'][_0x2982('0x15')][_0x2982('0x16')]}));}var _0x1f9dad=path[_0x2982('0x1c')](PATH);var _0x4ba696=path['basename'](PATH,_0x2982('0x1d'));var _0x4c7736=_0x45277b[_0x2982('0xf')]&&_0x1e3fd2[_0x2982('0x1e')]>0x1;var _0x1a7c93=[];if(!fs['existsSync'](path['join'](_0x1f9dad,_0x4ba696))&&_0x4c7736){fs['mkdirSync'](path[_0x2982('0x1f')](_0x1f9dad,_0x4ba696));}return BPromise[_0x2982('0x20')](_0x1e3fd2,function(_0x21ecdc){_0x1a7c93[_0x2982('0x1a')](_0x21ecdc);})[_0x2982('0x11')](function(){for(var _0x5ac5f0=0x0;_0x5ac5f0<_0x1a7c93[_0x2982('0x1e')];_0x5ac5f0+=0x1){var _0x1a96fa;var _0x15146a=_0x1a7c93[_0x5ac5f0];if(_0x4c7736){_0x1a96fa=path['join'](_0x1f9dad,_0x4ba696,util[_0x2982('0xb')]('%s%d.%s',_0x4ba696,_0x5ac5f0,_0x2982('0x21')));}else{_0x1a96fa=path[_0x2982('0x1f')](_0x1f9dad,util[_0x2982('0xb')](_0x2982('0x22'),_0x4ba696,_0x2982('0x21')));}fs[_0x2982('0x23')](_0x1a96fa,json2xls(_0x15146a),'binary');}})[_0x2982('0x11')](function(){if(_0x4c7736){return new Promise(function(_0x5dd44e){zipdir(path[_0x2982('0x1f')](_0x1f9dad,_0x4ba696),{'saveTo':path[_0x2982('0x1f')](_0x1f9dad,util[_0x2982('0xb')](_0x2982('0x22'),_0x4ba696,_0x2982('0x24')))},function(_0x116c37,_0x54cec2){rimraf(path[_0x2982('0x1f')](_0x1f9dad,_0x4ba696),function(){});_0x5dd44e(_0x2982('0x25'));});});}})[_0x2982('0x11')](function(){logger[_0x2982('0x26')](util[_0x2982('0xb')](_0x2982('0x27'),EXTRACTED_REPORT_ID,_0x2982('0xd')));return analyticExtractedReport(_0x2982('0x28'),_0x4c7736?util[_0x2982('0xb')](_0x2982('0x22'),_0x4ba696,_0x4c7736?_0x2982('0x24'):_0x2982('0x21')):null);});})[_0x2982('0x29')](function(_0x14baa6){logger['info'](util[_0x2982('0xb')](_0x2982('0x2a'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x2982('0x2b')](_0x14baa6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x2982('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b875335..f497800 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 _0x5165=['bulkCreate','sortBy','catch','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','type','Set','format','context','VoiceExtensionId','CDR(routeid)=','outbound','extension','push','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy'];(function(_0x5e310b,_0x445128){var _0x123866=function(_0x498e4c){while(--_0x498e4c){_0x5e310b['push'](_0x5e310b['shift']());}};_0x123866(++_0x445128);}(_0x5165,0x1ad));var _0x5516=function(_0x12c47f,_0x217d5d){_0x12c47f=_0x12c47f-0x0;var _0x4b95b1=_0x5165[_0x12c47f];return _0x4b95b1;};'use strict';var _=require(_0x5516('0x0'));var util=require(_0x5516('0x1'));function rewrite(_0x48e8b7,_0x4c524f){var _0x41092e=this;return _0x48e8b7[_0x5516('0x2')][_0x5516('0x3')][_0x5516('0x4')]({'raw':!![]})['then'](function(_0x34a3fb){_0x41092e[_0x5516('0x5')]=_0x34a3fb;return _0x48e8b7[_0x5516('0x2')][_0x5516('0x6')][_0x5516('0x4')]({'where':{'IntervalId':_0x4c524f[_0x5516('0x7')]},'raw':!![]});})[_0x5516('0x8')](function(_0x46cefb){return _0x48e8b7['models'][_0x5516('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x5516('0x9')](_0x46cefb,_0x5516('0xa')))}},'order':[{'raw':_0x5516('0xb')}],'raw':!![]});})['then'](function(_0x3bb6d3){var _0x26bc29=_[_0x5516('0xc')](_0x3bb6d3,{'priority':'1'});var _0x1a7375=_[_0x5516('0xc')](_0x3bb6d3,{'isApp':0x1});var _0xc4b9cf=_[_0x5516('0xd')](_0x1a7375,_0x5516('0xa'));var _0x58d407=[_0x5516('0xe'),_0x5516('0xf')];var _0x29b797=[];var _0x4fc5d9=[];for(var _0x34875f in _0xc4b9cf){if(_0xc4b9cf[_0x5516('0x10')](_0x34875f)){_0x41092e[_0x5516('0x11')]=0x2;_0x41092e[_0x5516('0x12')]=[];_0x41092e['extension']=_[_0x5516('0x13')](_0x26bc29,{'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')]});_0x41092e['extensions']['push']({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':util[_0x5516('0x16')]('CDR(type)=%s',_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')]),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e['priority']++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});if(_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')]==='inbound'){_0x41092e[_0x5516('0x12')]['push']({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x19')+_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')],'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});}else if(_0xc4b9cf[_0x34875f][0x0]['type']===_0x5516('0x1a')){if(_0x41092e[_0x5516('0x1b')]){_0x41092e[_0x5516('0x12')][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0]['type'],'app':_0x5516('0x15'),'appdata':_0x5516('0x1d')+(_0x41092e['extension']['cutdigits']?_0x5516('0x1e')+_0x41092e[_0x5516('0x1b')][_0x5516('0x1f')]+'}':_0x5516('0x20')),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0]['VoiceExtensionId']});}_0x41092e[_0x5516('0x12')][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x19')+_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')],'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});var _0x19ba67=_0x41092e[_0x5516('0x11')]++;_0x41092e['extensions'][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x21'),'appdata':_0x5516('0x22')+(_0x19ba67+0x2)+'):Goto('+(_0x19ba67+0x1)+')','context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x19ba67,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});if(_0x41092e[_0x5516('0x1b')]){_0x41092e[_0x5516('0x12')]['push']({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x41092e[_0x5516('0x1b')][_0x5516('0x1f')]?_0x5516('0x23')+_0x41092e['extension'][_0x5516('0x1f')]+'}':_0x5516('0x24'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});}_0x41092e['extensions'][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0]['type'],'app':_0x5516('0x15'),'appdata':'outboundrouteid='+_0xc4b9cf[_0x34875f][0x0]['VoiceExtensionId'],'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e['priority']++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0]['VoiceExtensionId']});if(_0x41092e[_0x5516('0x1b')]&&_0x41092e[_0x5516('0x1b')]['hasOwnProperty']('recordingFormat')&&_0x41092e['extension'][_0x5516('0x25')]!==_0x5516('0x26')){_0x41092e[_0x5516('0x12')][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x27'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});_0x41092e['extensions'][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x28')+_0x41092e[_0x5516('0x1b')][_0x5516('0x25')]||_0x5516('0x29'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e['priority']++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});}}_0x41092e[_0x5516('0x12')][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':'Set','appdata':_0x5516('0x2a'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});_0x41092e['extensions'][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':'Set','appdata':_0x5516('0x2b'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0]['exten'],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});_0x41092e[_0x5516('0x12')][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0]['type'],'app':_0x5516('0x15'),'appdata':_0x5516('0x2c'),'context':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x17')],'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'priority':_0x41092e[_0x5516('0x11')]++,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});for(var _0x54f4ff=0x0,_0x1bb9e5=0x0;_0x54f4ff<_0xc4b9cf[_0x34875f]['length'];_0x54f4ff+=0x1,_0x1bb9e5=0x0){var _0x34b47d=_0xc4b9cf[_0x34875f][_0x54f4ff];if(_0x34b47d[_0x5516('0x14')]){_0x34b47d['type']=_0x34b47d['type'][_0x5516('0x2d')]();}var _0x468c1b=[];var _0xd7bd6c=[];delete _0x34b47d['id'];delete _0x34b47d[_0x5516('0x2e')];delete _0x34b47d['updatedAt'];var _0x14b367=_0x34b47d[_0x5516('0x2f')]!==_0x5516('0x30')?[_0x34b47d['interval']]:_0x34b47d[_0x5516('0x7')]?_[_0x5516('0x9')](_[_0x5516('0xc')](_0x41092e[_0x5516('0x5')],{'IntervalId':_0x34b47d['IntervalId']}),'interval'):[];if(_0x34b47d[_0x5516('0x10')]('tag')){if(_0x34b47d[_0x5516('0x31')]&&_0x34b47d[_0x5516('0x31')]!=='--'){_0x468c1b['push']({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x32')+_0x34b47d['tag'],'context':_0x34b47d[_0x5516('0x17')],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367[_0x5516('0x33')]+_0x41092e[_0x5516('0x11')]+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d[_0x5516('0x18')]});}}if(_0x34b47d[_0x5516('0x14')]===_0x5516('0x1a')&&_0x34b47d['hasOwnProperty']('callerID')){if(_0x34b47d[_0x5516('0x34')]){_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d['type'],'app':_0x5516('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x34b47d[_0x5516('0x34')]+')','context':_0x34b47d[_0x5516('0x17')],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367[_0x5516('0x33')]+_0x41092e[_0x5516('0x11')]+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d[_0x5516('0x18')]});}else{_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x21'),'appdata':_0x5516('0x35'),'context':_0x34b47d['context'],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367['length']+_0x41092e[_0x5516('0x11')]+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d[_0x5516('0x18')]});}}if(_0x34b47d[_0x5516('0x10')](_0x5516('0x36'))){if(_0x58d407[_0x5516('0x37')](_0x34b47d[_0x5516('0x38')][_0x5516('0x2d')]())>=0x0&&_0x34b47d[_0x5516('0x39')]!=='custom'){if(_0x34b47d[_0x5516('0x36')]){_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x21'),'appdata':_0x5516('0x3a'),'context':_0x34b47d[_0x5516('0x17')],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367[_0x5516('0x33')]+_0x41092e[_0x5516('0x11')]+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d['VoiceExtensionId']});_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':_0x5516('0x3b'),'context':_0x34b47d['context'],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367[_0x5516('0x33')]+_0x41092e['priority']+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d['VoiceExtensionId']});}else{_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x34b47d[_0x5516('0x17')],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367['length']+_0x41092e[_0x5516('0x11')]+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d['VoiceExtensionId']});_0x468c1b[_0x5516('0x1c')]({'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x34b47d[_0x5516('0x17')],'exten':_0x34b47d[_0x5516('0xa')],'priority':_0x14b367[_0x5516('0x33')]+_0x41092e['priority']+_0x1bb9e5++,'VoiceExtensionId':_0x34b47d['VoiceExtensionId']});}}}for(var _0x18b13e=0x0;_0x18b13e<_0x14b367[_0x5516('0x33')];_0x18b13e+=0x1){var _0x42a7b6=_0x41092e['priority']+_0x14b367[_0x5516('0x33')];var _0xae874=_0x18b13e===_0x14b367[_0x5516('0x33')]-0x1?_0x41092e[_0x5516('0x11')]+_0x468c1b[_0x5516('0x33')]+_0xd7bd6c['length']+0x2:_0x41092e[_0x5516('0x11')]+_0x18b13e+0x1;_0x468c1b[_0x5516('0x3c')](_0x18b13e,0x0,{'type':_0x34b47d[_0x5516('0x14')],'app':_0x5516('0x3d'),'appdata':_0x14b367[_0x18b13e]+'?'+_0x34b47d[_0x5516('0x17')]+_0x5516('0x3e')+_0x42a7b6+':'+_0x34b47d[_0x5516('0x17')]+_0x5516('0x3e')+_0xae874,'exten':_0x34b47d[_0x5516('0xa')],'context':_0x34b47d[_0x5516('0x17')],'priority':_0x41092e[_0x5516('0x11')]+_0x18b13e,'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]});}_0x34b47d[_0x5516('0x11')]=_0x468c1b[_0x5516('0x33')]?_[_0x5516('0x3f')](_0x468c1b)[_0x5516('0x11')]+0x1:_0x41092e[_0x5516('0x11')];_0x41092e[_0x5516('0x11')]=(_0xd7bd6c[_0x5516('0x33')]?_[_0x5516('0x3f')](_0xd7bd6c)[_0x5516('0x11')]:_0x34b47d[_0x5516('0x11')])+0x1;_0x41092e['extensions']=_[_0x5516('0x40')](_0x41092e['extensions'],_0x468c1b,[_0x34b47d],_0xd7bd6c);}_0x41092e['extensions'][_0x5516('0x1c')]({'type':_0xc4b9cf[_0x34875f][0x0][_0x5516('0x14')],'app':_0x5516('0x41'),'exten':_0xc4b9cf[_0x34875f][0x0][_0x5516('0xa')],'context':_0xc4b9cf[_0x34875f][0x0]['context'],'priority':_0x41092e['priority'],'VoiceExtensionId':_0xc4b9cf[_0x34875f][0x0]['VoiceExtensionId']});_0x29b797['push'](_0xc4b9cf[_0x34875f][0x0][_0x5516('0x18')]);_0x4fc5d9=_[_0x5516('0x40')](_0x4fc5d9,_0x41092e['extensions']);}}return _0x48e8b7[_0x5516('0x42')](function(_0x575db4){return _0x48e8b7['models'][_0x5516('0x6')][_0x5516('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x29b797}},'transaction':_0x575db4})[_0x5516('0x8')](function(_0x1315df){return _0x48e8b7[_0x5516('0x2')][_0x5516('0x6')][_0x5516('0x44')](_[_0x5516('0x45')](_0x4fc5d9,'priority'),{'transaction':_0x575db4});});});})[_0x5516('0x46')](function(_0x577123){console['error'](_0x577123);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x3f95=['concat','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last'];(function(_0x28278f,_0x574b0d){var _0x3d9f74=function(_0x306742){while(--_0x306742){_0x28278f['push'](_0x28278f['shift']());}};_0x3d9f74(++_0x574b0d);}(_0x3f95,0x198));var _0x53f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3f95[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x53f9('0x0'));var util=require(_0x53f9('0x1'));function rewrite(_0x51ff34,_0x27dc62){var _0x40304e=this;return _0x51ff34[_0x53f9('0x2')][_0x53f9('0x3')][_0x53f9('0x4')]({'raw':!![]})[_0x53f9('0x5')](function(_0x201f91){_0x40304e['intervals']=_0x201f91;return _0x51ff34[_0x53f9('0x2')][_0x53f9('0x6')][_0x53f9('0x4')]({'where':{'IntervalId':_0x27dc62[_0x53f9('0x7')]},'raw':!![]});})[_0x53f9('0x5')](function(_0x43e1f3){return _0x51ff34[_0x53f9('0x2')][_0x53f9('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x53f9('0x8')](_0x43e1f3,_0x53f9('0x9')))}},'order':[{'raw':_0x53f9('0xa')}],'raw':!![]});})[_0x53f9('0x5')](function(_0x303ac1){var _0x7d3a77=_[_0x53f9('0xb')](_0x303ac1,{'priority':'1'});var _0x46dd46=_[_0x53f9('0xb')](_0x303ac1,{'isApp':0x1});var _0x4d28ff=_[_0x53f9('0xc')](_0x46dd46,'exten');var _0x1f4930=[_0x53f9('0xd'),_0x53f9('0xe')];var _0x396fac=[];var _0x511e9f=[];for(var _0x3261a0 in _0x4d28ff){if(_0x4d28ff[_0x53f9('0xf')](_0x3261a0)){_0x40304e['priority']=0x2;_0x40304e[_0x53f9('0x10')]=[];_0x40304e[_0x53f9('0x11')]=_[_0x53f9('0x12')](_0x7d3a77,{'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')]});_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':util[_0x53f9('0x16')](_0x53f9('0x17'),_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')]),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});if(_0x4d28ff[_0x3261a0][0x0]['type']==='inbound'){_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':'CDR(routeid)='+_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId'],'context':_0x4d28ff[_0x3261a0][0x0]['context'],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e['priority']++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});}else if(_0x4d28ff[_0x3261a0][0x0]['type']===_0x53f9('0x1b')){if(_0x40304e['extension']){_0x40304e[_0x53f9('0x10')]['push']({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x1c')+(_0x40304e[_0x53f9('0x11')][_0x53f9('0x1d')]?_0x53f9('0x1e')+_0x40304e[_0x53f9('0x11')][_0x53f9('0x1d')]+'}':'${EXTEN}'),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});}_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':'Set','appdata':_0x53f9('0x1f')+_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')],'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']});var _0x349bb5=_0x40304e['priority']++;_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':'ExecIf','appdata':_0x53f9('0x20')+(_0x349bb5+0x2)+_0x53f9('0x21')+(_0x349bb5+0x1)+')','context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0]['exten'],'priority':_0x349bb5,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});if(_0x40304e['extension']){_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0]['type'],'app':_0x53f9('0x15'),'appdata':_0x40304e['extension'][_0x53f9('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x40304e['extension']['cutdigits']+'}':_0x53f9('0x22'),'context':_0x4d28ff[_0x3261a0][0x0]['context'],'exten':_0x4d28ff[_0x3261a0][0x0]['exten'],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});}_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':'outboundrouteid='+_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')],'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0]['exten'],'priority':_0x40304e['priority']++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});if(_0x40304e[_0x53f9('0x11')]&&_0x40304e[_0x53f9('0x11')][_0x53f9('0xf')](_0x53f9('0x23'))&&_0x40304e[_0x53f9('0x11')][_0x53f9('0x23')]!==_0x53f9('0x24')){_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x25'),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e['priority']++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x40304e[_0x53f9('0x11')][_0x53f9('0x23')]||'wav','context':_0x4d28ff[_0x3261a0][0x0]['context'],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e['priority']++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});}}_0x40304e['extensions'][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x26'),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e['priority']++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']});_0x40304e['extensions'][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x27'),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']});_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0]['type'],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x28'),'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'priority':_0x40304e[_0x53f9('0x19')]++,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']});for(var _0x385f68=0x0,_0x26a3f3=0x0;_0x385f68<_0x4d28ff[_0x3261a0][_0x53f9('0x29')];_0x385f68+=0x1,_0x26a3f3=0x0){var _0x3baf41=_0x4d28ff[_0x3261a0][_0x385f68];if(_0x3baf41['type']){_0x3baf41[_0x53f9('0x14')]=_0x3baf41[_0x53f9('0x14')][_0x53f9('0x2a')]();}var _0x3a492d=[];var _0x4b72f4=[];delete _0x3baf41['id'];delete _0x3baf41['createdAt'];delete _0x3baf41[_0x53f9('0x2b')];var _0x502f39=_0x3baf41[_0x53f9('0x2c')]!==_0x53f9('0x2d')?[_0x3baf41[_0x53f9('0x2c')]]:_0x3baf41['IntervalId']?_[_0x53f9('0x8')](_[_0x53f9('0xb')](_0x40304e['intervals'],{'IntervalId':_0x3baf41['IntervalId']}),'interval'):[];if(_0x3baf41[_0x53f9('0xf')](_0x53f9('0x2e'))){if(_0x3baf41[_0x53f9('0x2e')]&&_0x3baf41['tag']!=='--'){_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41['type'],'app':'Set','appdata':'CDR(tag)='+_0x3baf41[_0x53f9('0x2e')],'context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41['exten'],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});}}if(_0x3baf41['type']==='outbound'&&_0x3baf41[_0x53f9('0xf')](_0x53f9('0x2f'))){if(_0x3baf41['callerID']){_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41['type'],'app':'ExecIf','appdata':_0x53f9('0x30')+_0x3baf41[_0x53f9('0x2f')]+')','context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41[_0x53f9('0x9')],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});}else{_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41['type'],'app':_0x53f9('0x31'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41[_0x53f9('0x9')],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e['priority']+_0x26a3f3++,'VoiceExtensionId':_0x3baf41['VoiceExtensionId']});}}if(_0x3baf41['hasOwnProperty'](_0x53f9('0x32'))){if(_0x1f4930[_0x53f9('0x33')](_0x3baf41[_0x53f9('0x34')][_0x53f9('0x2a')]())>=0x0&&_0x3baf41['appType']!==_0x53f9('0x35')){if(_0x3baf41['answer']){_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41[_0x53f9('0x14')],'app':'ExecIf','appdata':_0x53f9('0x36'),'context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41[_0x53f9('0x9')],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41[_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x37'),'context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41[_0x53f9('0x9')],'priority':_0x502f39['length']+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});}else{_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41[_0x53f9('0x14')],'app':_0x53f9('0x31'),'appdata':_0x53f9('0x38'),'context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41[_0x53f9('0x9')],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});_0x3a492d[_0x53f9('0x13')]({'type':_0x3baf41[_0x53f9('0x14')],'app':_0x53f9('0x15'),'appdata':_0x53f9('0x39'),'context':_0x3baf41[_0x53f9('0x18')],'exten':_0x3baf41['exten'],'priority':_0x502f39[_0x53f9('0x29')]+_0x40304e[_0x53f9('0x19')]+_0x26a3f3++,'VoiceExtensionId':_0x3baf41[_0x53f9('0x1a')]});}}}for(var _0x2f7547=0x0;_0x2f7547<_0x502f39[_0x53f9('0x29')];_0x2f7547+=0x1){var _0x3a7b46=_0x40304e[_0x53f9('0x19')]+_0x502f39[_0x53f9('0x29')];var _0x294fdf=_0x2f7547===_0x502f39[_0x53f9('0x29')]-0x1?_0x40304e[_0x53f9('0x19')]+_0x3a492d[_0x53f9('0x29')]+_0x4b72f4[_0x53f9('0x29')]+0x2:_0x40304e[_0x53f9('0x19')]+_0x2f7547+0x1;_0x3a492d[_0x53f9('0x3a')](_0x2f7547,0x0,{'type':_0x3baf41[_0x53f9('0x14')],'app':'GotoIfTime','appdata':_0x502f39[_0x2f7547]+'?'+_0x3baf41['context']+_0x53f9('0x3b')+_0x3a7b46+':'+_0x3baf41[_0x53f9('0x18')]+_0x53f9('0x3b')+_0x294fdf,'exten':_0x3baf41[_0x53f9('0x9')],'context':_0x3baf41[_0x53f9('0x18')],'priority':_0x40304e['priority']+_0x2f7547,'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x1a')]});}_0x3baf41[_0x53f9('0x19')]=_0x3a492d[_0x53f9('0x29')]?_[_0x53f9('0x3c')](_0x3a492d)['priority']+0x1:_0x40304e[_0x53f9('0x19')];_0x40304e['priority']=(_0x4b72f4['length']?_['last'](_0x4b72f4)[_0x53f9('0x19')]:_0x3baf41[_0x53f9('0x19')])+0x1;_0x40304e[_0x53f9('0x10')]=_[_0x53f9('0x3d')](_0x40304e['extensions'],_0x3a492d,[_0x3baf41],_0x4b72f4);}_0x40304e[_0x53f9('0x10')][_0x53f9('0x13')]({'type':_0x4d28ff[_0x3261a0][0x0]['type'],'app':'Hangup','exten':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x9')],'context':_0x4d28ff[_0x3261a0][0x0][_0x53f9('0x18')],'priority':_0x40304e['priority'],'VoiceExtensionId':_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']});_0x396fac[_0x53f9('0x13')](_0x4d28ff[_0x3261a0][0x0]['VoiceExtensionId']);_0x511e9f=_[_0x53f9('0x3d')](_0x511e9f,_0x40304e[_0x53f9('0x10')]);}}return _0x51ff34[_0x53f9('0x3e')](function(_0x2c50e1){return _0x51ff34[_0x53f9('0x2')][_0x53f9('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x396fac}},'transaction':_0x2c50e1})[_0x53f9('0x5')](function(_0x40d3c0){return _0x51ff34[_0x53f9('0x2')][_0x53f9('0x6')][_0x53f9('0x3f')](_[_0x53f9('0x40')](_0x511e9f,_0x53f9('0x19')),{'transaction':_0x2c50e1});});});})[_0x53f9('0x41')](function(_0x44a306){console['error'](_0x44a306);});}exports[_0x53f9('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 70e15be..d5c81e2 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 _0x15ae=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','ListId','CompanyId','length','find','Duplicate\x20Contact','CmContact','create','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','then','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resolve','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse'];(function(_0x21cf66,_0x5151d7){var _0x253703=function(_0x4cf29c){while(--_0x4cf29c){_0x21cf66['push'](_0x21cf66['shift']());}};_0x253703(++_0x5151d7);}(_0x15ae,0x13d));var _0xe15a=function(_0x58f5b7,_0xf26c83){_0x58f5b7=_0x58f5b7-0x0;var _0xc24a5=_0x15ae[_0x58f5b7];return _0xc24a5;};'use strict';var BPromise=require(_0xe15a('0x0'));var util=require('util');var _=require(_0xe15a('0x1'));var fs=require('fs');var squel=require(_0xe15a('0x2'));var Papa=require(_0xe15a('0x3'));var Redis=require(_0xe15a('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xe15a('0x5'));var logger=require('../../../config/logger')('api');config[_0xe15a('0x6')]=_[_0xe15a('0x7')](config[_0xe15a('0x6')],{'host':_0xe15a('0x8'),'port':0x18eb});var socket=require(_0xe15a('0x9'))(new Redis(config[_0xe15a('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0xe15a('0xa')](socket);try{if(!process[_0xe15a('0xb')][0x2]||process[_0xe15a('0xb')][0x2]===_0xe15a('0xc')||process[_0xe15a('0xb')][0x2]==='null'){throw new Error(_0xe15a('0xd'));}var FILEPATH=process[_0xe15a('0xb')][0x2];if(!process[_0xe15a('0xb')][0x3]||process[_0xe15a('0xb')][0x3]===_0xe15a('0xc')||process[_0xe15a('0xb')][0x3]===_0xe15a('0xe')||!process[_0xe15a('0xb')][0x4]||process[_0xe15a('0xb')][0x4]==='undefined'||process[_0xe15a('0xb')][0x4]==='null'){throw new Error(_0xe15a('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process[_0xe15a('0xb')][0x4][_0xe15a('0x10')](','));if(!process[_0xe15a('0xb')][0x5]||process[_0xe15a('0xb')][0x5]===_0xe15a('0xc')||process[_0xe15a('0xb')][0x5]===_0xe15a('0xe')){throw new Error(_0xe15a('0x11'));}var LISTID=process[_0xe15a('0xb')][0x5];var COMPANYID=process[_0xe15a('0xb')][0x6]&&process[_0xe15a('0xb')][0x6]!=='undefined'&&process[_0xe15a('0xb')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xe15a('0xb')][0x7]&&process[_0xe15a('0xb')][0x7]!==_0xe15a('0xc')&&process[_0xe15a('0xb')][0x7]!=='null'?process[_0xe15a('0xb')][0x7]:null;if(!process[_0xe15a('0xb')][0x8]||process['argv'][0x8]===_0xe15a('0xc')||process[_0xe15a('0xb')][0x8]===_0xe15a('0xe')){throw new Error(_0xe15a('0x12'));}var SOCKET_TIMESTAMP=process[_0xe15a('0xb')][0x8];}catch(_0x5e24e0){logger[_0xe15a('0x13')](_0x5e24e0);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(_0x426c1e,_0x4d8976,_0x3fdddd,_0x270160){var _0x20269b={'message':_0x4d8976};_0x20269b[_0x426c1e]=!![];if(_0x3fdddd){_0x20269b['contact']=_0x3fdddd;}if(_0x270160){_0x20269b['index']=_0x270160;}return _0x20269b;}function isEmail(_0x229ac0){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))*$/[_0xe15a('0x14')](_0x229ac0);}function checkRow(_0x18e640,_0x5b03af,_0x40e120){return new BPromise(function(_0x3c75c5,_0x37181a){if(_[_0xe15a('0x15')](_0x18e640)){return _0x37181a(handleCheckRowError(_0xe15a('0x13'),_0xe15a('0x16'),null,_0x40e120));}if(_0x18e640['errors']&&_0x18e640[_0xe15a('0x17')]['length']){var _0x28f7e1=_[_0xe15a('0x18')](_0x18e640[_0xe15a('0x17')],'message')[_0xe15a('0x19')](';');return _0x37181a(handleCheckRowError(_0xe15a('0x13'),_0x28f7e1,null,_0x40e120));}var _0x24ec93={};for(var _0x118ab6 in FIELDS){if(FIELDS['hasOwnProperty'](_0x118ab6)&&FIELDS[_0x118ab6]){_0x24ec93[_0x118ab6]=_0x18e640['data'][0x0][FIELDS[_0x118ab6]]||_0x18e640[_0xe15a('0x1a')][0x0]['\ufeff'+FIELDS[_0x118ab6]];}}if(!_0x24ec93[_0xe15a('0x1b')]){return _0x37181a(handleCheckRowError(_0xe15a('0x13'),_0xe15a('0x1c'),null,_0x40e120));}if(!_0x24ec93[_0xe15a('0x1d')]){return _0x37181a(handleCheckRowError(_0xe15a('0x13'),'phone\x20not\x20specified!',null,_0x40e120));}if(_0x24ec93[_0xe15a('0x1e')]){var _0xec8e78=moment(_0x24ec93[_0xe15a('0x1e')],_0xe15a('0x1f'));if(!_0xec8e78[_0xe15a('0x20')]()){return _0x37181a(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x40e120));}}if(_0x24ec93[_0xe15a('0x21')]){if(!isEmail(_0x24ec93[_0xe15a('0x21')])){return _0x37181a(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x40e120));}}_0x24ec93[_0xe15a('0x22')]=LISTID;_0x24ec93[_0xe15a('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe15a('0x24')]&&_0x5b03af){var _0x2ac8cc={};for(var _0x3af708=0x0,_0xb96fcb=DUPLICATES['length'];_0x3af708<_0xb96fcb;_0x3af708+=0x1){_0x2ac8cc[DUPLICATES[_0x3af708]]=_0x24ec93[DUPLICATES[_0x3af708]];}var _0x34d1e1=_[_0xe15a('0x25')](_0x5b03af,_0x2ac8cc);if(_0x34d1e1){return _0x37181a(handleCheckRowError('duplicate',_0xe15a('0x26'),_0x34d1e1,_0x40e120));}}return db[_0xe15a('0x27')][_0xe15a('0x28')](_0x24ec93,{'raw':!![],'hooks':![],'fields':_['keys'](_0x24ec93)})['then'](function(_0x3f3a78){if(DUPLICATES&&DUPLICATES[_0xe15a('0x24')]&&_0x5b03af){_0x5b03af[_0xe15a('0x29')](_[_0xe15a('0x2a')](_0x24ec93,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3f3a78['id'];return _0x3c75c5();})[_0xe15a('0x2b')](function(_0x5c3240){return _0x37181a(handleCheckRowError(_0xe15a('0x13'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5c3240[_0xe15a('0x2c')]||JSON[_0xe15a('0x2d')](_0x5c3240)),null,_0x40e120));});});}function checkHopper(){function _0x5b07e3(){return function(_0x26ee8a){logger[_0xe15a('0x13')](_0xe15a('0x2e'),_0xe15a('0x2f'),util[_0xe15a('0x30')](_0x26ee8a,{'showHidden':![],'depth':null}));};}var _0x1b45bd=function(_0x519029,_0xa66332){var _0x672905=squel[_0xe15a('0x31')]()[_0xe15a('0x32')](_0xe15a('0x33'))['fromQuery']([_0xe15a('0x1d'),_0xe15a('0x34'),_0xe15a('0x35'),'ListId',_0xa66332,_0xe15a('0x36'),_0xe15a('0x37')],squel[_0xe15a('0x38')]()[_0xe15a('0x39')](_0xe15a('0x1d'),_0xe15a('0x1d'))[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x34'))[_0xe15a('0x39')]('id',_0xe15a('0x35'))[_0xe15a('0x39')](LISTID['toString'](),_0xe15a('0x22'))['field'](_0x519029['id'][_0xe15a('0x3b')](),_0xa66332)[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x36'))[_0xe15a('0x39')](_0xe15a('0x3a'),'updatedAt')[_0xe15a('0x3c')](_0xe15a('0x3d'))[_0xe15a('0x3e')](_0xe15a('0x3f'))['where'](_0xe15a('0x40'),LISTID[_0xe15a('0x3b')]())[_0xe15a('0x3e')](_0xe15a('0x41'))[_0xe15a('0x3e')](_0xe15a('0x42'),squel[_0xe15a('0x38')]()[_0xe15a('0x39')]('phone')[_0xe15a('0x3c')](_0xe15a('0x33'))[_0xe15a('0x3e')](_0xa66332+_0xe15a('0x43'),_0x519029['id'][_0xe15a('0x3b')]())))[_0xe15a('0x3b')]();return _0x672905;};var _0x299e8b=function(_0x1fa130,_0x1fbb46){var _0xa4bf45=squel[_0xe15a('0x31')]()[_0xe15a('0x32')](_0xe15a('0x33'))[_0xe15a('0x44')]([_0xe15a('0x1d'),_0xe15a('0x34'),'ContactId','ListId',_0x1fbb46,_0xe15a('0x36'),_0xe15a('0x37')],squel[_0xe15a('0x38')]()[_0xe15a('0x39')]('phone',_0xe15a('0x1d'))[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x34'))['field']('id',_0xe15a('0x35'))[_0xe15a('0x39')](LISTID[_0xe15a('0x3b')](),'ListId')[_0xe15a('0x39')](_0x1fa130['id'][_0xe15a('0x3b')](),_0x1fbb46)[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x36'))[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x37'))['from'](_0xe15a('0x3d'))[_0xe15a('0x3e')](_0xe15a('0x3f'))[_0xe15a('0x3e')]('ListId\x20=\x20?',LISTID[_0xe15a('0x3b')]())[_0xe15a('0x3e')](_0xe15a('0x45'),squel[_0xe15a('0x46')](hopperContacts))[_0xe15a('0x3e')](_0xe15a('0x41'))[_0xe15a('0x3e')](_0xe15a('0x42'),squel[_0xe15a('0x38')]()['field'](_0xe15a('0x47'))['from'](_0xe15a('0x48'))['where'](_0x1fbb46+_0xe15a('0x43'),_0x1fa130['id'][_0xe15a('0x3b')]()))[_0xe15a('0x3e')](_0xe15a('0x42'),squel[_0xe15a('0x38')]()[_0xe15a('0x39')](_0xe15a('0x1d'))[_0xe15a('0x3c')](_0xe15a('0x33'))[_0xe15a('0x3e')](_0x1fbb46+_0xe15a('0x43'),_0x1fa130['id'][_0xe15a('0x3b')]())))[_0xe15a('0x3b')]();return _0xa4bf45;};function _0x12007f(_0x5d0ebf,_0x4ab5f9){var _0x29c115=squel['insert']()[_0xe15a('0x32')]('cm_hopper')[_0xe15a('0x44')](['phone',_0xe15a('0x34'),_0xe15a('0x35'),_0xe15a('0x22'),_0x4ab5f9,'createdAt',_0xe15a('0x37')],squel['select']()[_0xe15a('0x39')](_0xe15a('0x1d'),_0xe15a('0x1d'))[_0xe15a('0x39')](_0xe15a('0x3a'),_0xe15a('0x34'))[_0xe15a('0x39')]('id','ContactId')['field'](LISTID[_0xe15a('0x3b')](),_0xe15a('0x22'))[_0xe15a('0x39')](_0x5d0ebf['id'][_0xe15a('0x3b')](),_0x4ab5f9)[_0xe15a('0x39')](_0xe15a('0x3a'),'createdAt')[_0xe15a('0x39')]('NOW()',_0xe15a('0x37'))[_0xe15a('0x3c')]('cm_contacts')[_0xe15a('0x3e')](_0xe15a('0x3f'))[_0xe15a('0x3e')]('ListId\x20=\x20?',LISTID[_0xe15a('0x3b')]())['where'](_0xe15a('0x45'),squel[_0xe15a('0x46')](hopperContacts))[_0xe15a('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x29c115;}function _0xd53e36(_0x4901e3,_0x25348f){var _0x112cce=squel[_0xe15a('0x31')]()['into'](_0xe15a('0x49'))[_0xe15a('0x44')]([_0xe15a('0x1d'),'ContactId',_0xe15a('0x22'),_0x25348f,'createdAt','updatedAt'],squel['select']()[_0xe15a('0x39')](_0xe15a('0x1d'),_0xe15a('0x1d'))[_0xe15a('0x39')]('id',_0xe15a('0x35'))[_0xe15a('0x39')](LISTID[_0xe15a('0x3b')](),_0xe15a('0x22'))['field'](_0x4901e3['id'][_0xe15a('0x3b')](),_0x25348f)[_0xe15a('0x39')](_0xe15a('0x3a'),'createdAt')[_0xe15a('0x39')](_0xe15a('0x3a'),'updatedAt')[_0xe15a('0x3c')](_0xe15a('0x3d'))[_0xe15a('0x3e')](_0xe15a('0x3f'))[_0xe15a('0x3e')](_0xe15a('0x40'),LISTID[_0xe15a('0x3b')]())[_0xe15a('0x3e')](_0xe15a('0x45'),squel[_0xe15a('0x46')](hopperContacts))[_0xe15a('0x3e')](_0xe15a('0x41')))[_0xe15a('0x3b')]();return _0x112cce;}return db[_0xe15a('0x4a')][_0xe15a('0x4b')]({'where':{'type':_0xe15a('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xe15a('0x4d')](function(_0x425c6f){var _0x3e7d63=[];if(_0x425c6f){var _0x452534;for(var _0x1d26b6=0x0,_0x1d928a;_0x1d26b6<_0x425c6f[_0xe15a('0x24')];_0x1d26b6+=0x1){_0x1d928a=_0x425c6f[_0x1d26b6][_0xe15a('0x4e')]({'plain':!![]});switch(_0x1d928a[_0xe15a('0x4f')]){case _0xe15a('0x50'):_0x3e7d63[_0xe15a('0x29')](db[_0xe15a('0x51')][_0xe15a('0x52')](_0x299e8b(_0x1d928a,_0xe15a('0x53')))['then'](function(){})[_0xe15a('0x2b')](_0x5b07e3()));break;case _0xe15a('0x54'):_0x3e7d63[_0xe15a('0x29')](db[_0xe15a('0x51')]['query'](_0x1b45bd(_0x1d928a,_0xe15a('0x53')))[_0xe15a('0x4d')](function(){})[_0xe15a('0x2b')](_0x5b07e3()));break;default:_0x3e7d63[_0xe15a('0x29')](db[_0xe15a('0x51')][_0xe15a('0x52')](_0x12007f(_0x1d928a,_0xe15a('0x53')))[_0xe15a('0x4d')](function(){})[_0xe15a('0x2b')](_0x5b07e3()));}}}return _0x3e7d63;})[_0xe15a('0x55')]()[_0xe15a('0x4d')](function(){return db[_0xe15a('0x4a')][_0xe15a('0x4b')]({'where':{'type':_0xe15a('0x4c')},'attributes':['id'],'include':[{'model':db[_0xe15a('0x56')],'as':_0xe15a('0x57'),'where':{'id':LISTID}}]})[_0xe15a('0x4d')](function(_0x290166){var _0x585f2e=[];if(_0x290166){var _0x51ab04;for(var _0x9417a9=0x0,_0x1794f2;_0x9417a9<_0x290166['length'];_0x9417a9+=0x1){_0x1794f2=_0x290166[_0x9417a9][_0xe15a('0x4e')]({'plain':!![]});_0x585f2e[_0xe15a('0x29')](db[_0xe15a('0x51')][_0xe15a('0x52')](_0xd53e36(_0x1794f2,'VoiceQueueId'))[_0xe15a('0x4d')](function(){})[_0xe15a('0x2b')](_0x5b07e3()));}}return _0x585f2e;})[_0xe15a('0x55')]();})['then'](function(){return db[_0xe15a('0x58')][_0xe15a('0x4b')]({'attributes':['id',_0xe15a('0x4f')],'include':[{'model':db[_0xe15a('0x56')],'as':_0xe15a('0x59'),'where':{'id':LISTID}}]})[_0xe15a('0x4d')](function(_0x353f97){var _0x1bb2db=[];if(_0x353f97){for(var _0x424a30=0x0,_0x46e518;_0x424a30<_0x353f97[_0xe15a('0x24')];_0x424a30+=0x1){_0x46e518=_0x353f97[_0x424a30][_0xe15a('0x4e')]({'plain':!![]});switch(_0x46e518[_0xe15a('0x4f')]){case _0xe15a('0x50'):_0x1bb2db[_0xe15a('0x29')](db[_0xe15a('0x51')][_0xe15a('0x52')](_0x299e8b(_0x46e518,_0xe15a('0x5a')))[_0xe15a('0x4d')](function(){})[_0xe15a('0x2b')](_0x5b07e3()));break;case _0xe15a('0x54'):_0x1bb2db[_0xe15a('0x29')](db['sequelize'][_0xe15a('0x52')](_0x1b45bd(_0x46e518,_0xe15a('0x5a')))[_0xe15a('0x4d')](function(){})[_0xe15a('0x2b')](_0x5b07e3()));break;default:_0x1bb2db[_0xe15a('0x29')](db[_0xe15a('0x51')][_0xe15a('0x52')](_0x12007f(_0x46e518,_0xe15a('0x5a')))['then'](function(){})[_0xe15a('0x2b')](_0x5b07e3()));}}}return _0x1bb2db;})['all']();})['then'](function(){return db[_0xe15a('0x58')][_0xe15a('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xe15a('0x56')],'as':_0xe15a('0x57'),'where':{'id':LISTID}}]})[_0xe15a('0x4d')](function(_0x33e48f){var _0x5d3a11=[];if(_0x33e48f){for(var _0x9e27ee=0x0,_0x55f918;_0x9e27ee<_0x33e48f[_0xe15a('0x24')];_0x9e27ee+=0x1){_0x55f918=_0x33e48f[_0x9e27ee][_0xe15a('0x4e')]({'plain':!![]});_0x5d3a11[_0xe15a('0x29')](db['sequelize'][_0xe15a('0x52')](_0xd53e36(_0x55f918,'CampaignId'))['then'](function(){})['catch'](_0x5b07e3()));}}return _0x5d3a11;})[_0xe15a('0x55')]();})[_0xe15a('0x2b')](function(_0x14f23f){logger['error'](_0xe15a('0x5b'),_0xe15a('0x5c'),_0x14f23f[_0xe15a('0x2c')]);});}var processPromises=function(_0x122139){return BPromise[_0xe15a('0x55')](promises)[_0xe15a('0x4d')](function(_0x5679e6){})[_0xe15a('0x2b')](function(_0x40cdce){logger[_0xe15a('0x13')](_0xe15a('0x5d'),JSON[_0xe15a('0x2d')](_0x40cdce));})['finally'](function(){socket[_0xe15a('0x5e')](_0xe15a('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x122139){return _0x122139['resume']();}});};var endCsv=function(){return BPromise[_0xe15a('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe15a('0x4d')](function(){socket[_0xe15a('0x5e')](_0xe15a('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe15a('0x61')](FILEPATH);}catch(_0x887166){logger[_0xe15a('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xe15a('0x2d')](_0x887166));}finally{process[_0xe15a('0x62')](0x0);}});};process['on']('SIGINT',function(){logger[_0xe15a('0x63')](_0xe15a('0x64'));endCsv();});function main(){return BPromise[_0xe15a('0x60')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe15a('0x10')](',');return db[_0xe15a('0x27')][_0xe15a('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x58f03a){var _0x18e7ed=fs[_0xe15a('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe15a('0x66')](_0x18e7ed,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4f75ec,_0x87b194){total+=0x1;var _0x4b12f9=total;promises[_0xe15a('0x29')](checkRow(_0x4f75ec,_0x58f03a,_0x4b12f9)['then'](function(){success+=0x1;})[_0xe15a('0x2b')](function(_0x1b95d7){if(_0x1b95d7[_0xe15a('0x13')]){errors+=0x1;delete _0x1b95d7[_0xe15a('0x13')];}else if(_0x1b95d7[_0xe15a('0x67')]){duplicates+=0x1;delete _0x1b95d7[_0xe15a('0x67')];}rows[_0xe15a('0x29')](_0x1b95d7);}));if(total%0xc8===0x0){_0x87b194['pause']();return processPromises(_0x87b194);}},'complete':function(){return processPromises()['then'](function(){logger[_0xe15a('0x63')](_0xe15a('0x68'));endCsv();});},'error':function(_0x2825dc,_0x2d1a70){logger[_0xe15a('0x63')](_0xe15a('0x69'),JSON[_0xe15a('0x2d')](_0x2825dc));endCsv();}});})[_0xe15a('0x2b')](function(_0x1df9bb){logger[_0xe15a('0x13')](_0xe15a('0x6a'),JSON['stringify'](_0x1df9bb));});}main(); \ No newline at end of file +var _0x5583=['unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','join','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','Duplicate\x20Contact','CmContact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ListId','createdAt','field','NOW()','scheduledAt','toString','updatedAt','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','select','ContactId','cm_contacts','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','Lists','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resolve','contact:csv_'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0x5583,0x78));var _0x3558=function(_0x52c1f6,_0x4eda0b){_0x52c1f6=_0x52c1f6-0x0;var _0x4df981=_0x5583[_0x52c1f6];return _0x4df981;};'use strict';var BPromise=require('bluebird');var util=require(_0x3558('0x0'));var _=require(_0x3558('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x3558('0x2'));var Redis=require(_0x3558('0x3'));var db=require(_0x3558('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3558('0x5'))(_0x3558('0x6'));config['redis']=_[_0x3558('0x7')](config[_0x3558('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3558('0x9'))(new Redis(config[_0x3558('0x8')]));require(_0x3558('0xa'))[_0x3558('0xb')](socket);try{if(!process[_0x3558('0xc')][0x2]||process[_0x3558('0xc')][0x2]===_0x3558('0xd')||process[_0x3558('0xc')][0x2]===_0x3558('0xe')){throw new Error(_0x3558('0xf'));}var FILEPATH=process[_0x3558('0xc')][0x2];if(!process[_0x3558('0xc')][0x3]||process[_0x3558('0xc')][0x3]==='undefined'||process[_0x3558('0xc')][0x3]==='null'||!process[_0x3558('0xc')][0x4]||process[_0x3558('0xc')][0x4]==='undefined'||process[_0x3558('0xc')][0x4]===_0x3558('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x3558('0x10')](process['argv'][0x3][_0x3558('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0x3558('0xc')][0x5]||process[_0x3558('0xc')][0x5]==='undefined'||process[_0x3558('0xc')][0x5]==='null'){throw new Error(_0x3558('0x12'));}var LISTID=process[_0x3558('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3558('0xc')][0x6]!==_0x3558('0xd')&&process['argv'][0x6]!==_0x3558('0xe')?process[_0x3558('0xc')][0x6]:null;var DUPLICATES=process[_0x3558('0xc')][0x7]&&process['argv'][0x7]!==_0x3558('0xd')&&process[_0x3558('0xc')][0x7]!==_0x3558('0xe')?process[_0x3558('0xc')][0x7]:null;if(!process[_0x3558('0xc')][0x8]||process['argv'][0x8]===_0x3558('0xd')||process[_0x3558('0xc')][0x8]===_0x3558('0xe')){throw new Error(_0x3558('0x13'));}var SOCKET_TIMESTAMP=process[_0x3558('0xc')][0x8];}catch(_0x5a4025){logger[_0x3558('0x14')](_0x5a4025);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(_0x2a4208,_0x50248f,_0x1635f1,_0x2f0db5){var _0x5add23={'message':_0x50248f};_0x5add23[_0x2a4208]=!![];if(_0x1635f1){_0x5add23[_0x3558('0x15')]=_0x1635f1;}if(_0x2f0db5){_0x5add23[_0x3558('0x16')]=_0x2f0db5;}return _0x5add23;}function isEmail(_0x4f1444){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'](_0x4f1444);}function checkRow(_0x14fc80,_0x2b1e83,_0x2595e6){return new BPromise(function(_0x6895fc,_0x48ec3a){if(_[_0x3558('0x17')](_0x14fc80)){return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x2595e6));}if(_0x14fc80[_0x3558('0x18')]&&_0x14fc80[_0x3558('0x18')][_0x3558('0x19')]){var _0x348729=_[_0x3558('0x1a')](_0x14fc80[_0x3558('0x18')],_0x3558('0x1b'))[_0x3558('0x1c')](';');return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),_0x348729,null,_0x2595e6));}var _0xf3cdc5={};for(var _0x631468 in FIELDS){if(FIELDS['hasOwnProperty'](_0x631468)&&FIELDS[_0x631468]){_0xf3cdc5[_0x631468]=_0x14fc80[_0x3558('0x1d')][0x0][FIELDS[_0x631468]]||_0x14fc80[_0x3558('0x1d')][0x0]['\ufeff'+FIELDS[_0x631468]];}}if(!_0xf3cdc5[_0x3558('0x1e')]){return _0x48ec3a(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x2595e6));}if(!_0xf3cdc5[_0x3558('0x1f')]){return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),'phone\x20not\x20specified!',null,_0x2595e6));}if(_0xf3cdc5[_0x3558('0x20')]){var _0x461ee=moment(_0xf3cdc5[_0x3558('0x20')],_0x3558('0x21'));if(!_0x461ee[_0x3558('0x22')]()){return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),_0x3558('0x23'),null,_0x2595e6));}}if(_0xf3cdc5['email']){if(!isEmail(_0xf3cdc5[_0x3558('0x24')])){return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),_0x3558('0x25'),null,_0x2595e6));}}_0xf3cdc5['ListId']=LISTID;_0xf3cdc5[_0x3558('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3558('0x19')]&&_0x2b1e83){var _0x430707={};for(var _0xb2fdd4=0x0,_0x3119ec=DUPLICATES[_0x3558('0x19')];_0xb2fdd4<_0x3119ec;_0xb2fdd4+=0x1){_0x430707[DUPLICATES[_0xb2fdd4]]=_0xf3cdc5[DUPLICATES[_0xb2fdd4]];}var _0x2e42bc=_['find'](_0x2b1e83,_0x430707);if(_0x2e42bc){return _0x48ec3a(handleCheckRowError('duplicate',_0x3558('0x27'),_0x2e42bc,_0x2595e6));}}return db[_0x3558('0x28')]['create'](_0xf3cdc5,{'raw':!![],'hooks':![],'fields':_[_0x3558('0x29')](_0xf3cdc5)})[_0x3558('0x2a')](function(_0x2d800a){if(DUPLICATES&&DUPLICATES[_0x3558('0x19')]&&_0x2b1e83){_0x2b1e83['push'](_[_0x3558('0x2b')](_0xf3cdc5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2d800a['id'];return _0x6895fc();})[_0x3558('0x2c')](function(_0x31e09c){return _0x48ec3a(handleCheckRowError(_0x3558('0x14'),_0x3558('0x2d')+(_0x31e09c[_0x3558('0x1b')]||JSON[_0x3558('0x2e')](_0x31e09c)),null,_0x2595e6));});});}function checkHopper(){function _0x3973ad(){return function(_0x318241){logger['error'](_0x3558('0x2f'),_0x3558('0x30'),util[_0x3558('0x31')](_0x318241,{'showHidden':![],'depth':null}));};}var _0x3e7d9e=function(_0x5e4453,_0x13a10a){var _0x206293=squel[_0x3558('0x32')]()[_0x3558('0x33')](_0x3558('0x34'))[_0x3558('0x35')](['phone','scheduledAt','ContactId',_0x3558('0x36'),_0x13a10a,_0x3558('0x37'),'updatedAt'],squel['select']()[_0x3558('0x38')]('phone',_0x3558('0x1f'))[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x3a'))['field']('id','ContactId')[_0x3558('0x38')](LISTID[_0x3558('0x3b')](),_0x3558('0x36'))[_0x3558('0x38')](_0x5e4453['id'][_0x3558('0x3b')](),_0x13a10a)[_0x3558('0x38')](_0x3558('0x39'),'createdAt')[_0x3558('0x38')]('NOW()',_0x3558('0x3c'))[_0x3558('0x3d')]('cm_contacts')['where'](_0x3558('0x3e'))['where'](_0x3558('0x3f'),LISTID[_0x3558('0x3b')]())[_0x3558('0x40')](_0x3558('0x41'))[_0x3558('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x3558('0x1f'))[_0x3558('0x3d')](_0x3558('0x34'))[_0x3558('0x40')](_0x13a10a+_0x3558('0x42'),_0x5e4453['id'][_0x3558('0x3b')]())))[_0x3558('0x3b')]();return _0x206293;};var _0x39efd7=function(_0xa7f1b1,_0x5afed4){var _0x569b27=squel[_0x3558('0x32')]()[_0x3558('0x33')]('cm_hopper')['fromQuery']([_0x3558('0x1f'),_0x3558('0x3a'),'ContactId',_0x3558('0x36'),_0x5afed4,_0x3558('0x37'),_0x3558('0x3c')],squel[_0x3558('0x43')]()[_0x3558('0x38')](_0x3558('0x1f'),_0x3558('0x1f'))[_0x3558('0x38')](_0x3558('0x39'),'scheduledAt')['field']('id',_0x3558('0x44'))[_0x3558('0x38')](LISTID[_0x3558('0x3b')](),'ListId')[_0x3558('0x38')](_0xa7f1b1['id'][_0x3558('0x3b')](),_0x5afed4)[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x37'))[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x3c'))[_0x3558('0x3d')](_0x3558('0x45'))['where'](_0x3558('0x3e'))[_0x3558('0x40')](_0x3558('0x3f'),LISTID['toString']())[_0x3558('0x40')](_0x3558('0x46'),squel[_0x3558('0x47')](hopperContacts))[_0x3558('0x40')](_0x3558('0x41'))['where'](_0x3558('0x48'),squel[_0x3558('0x43')]()[_0x3558('0x38')]('calleridnum')[_0x3558('0x3d')](_0x3558('0x49'))[_0x3558('0x40')](_0x5afed4+'\x20=\x20?',_0xa7f1b1['id'][_0x3558('0x3b')]()))[_0x3558('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3558('0x38')](_0x3558('0x1f'))[_0x3558('0x3d')]('cm_hopper')[_0x3558('0x40')](_0x5afed4+'\x20=\x20?',_0xa7f1b1['id']['toString']())))['toString']();return _0x569b27;};function _0x44829a(_0xe70ea8,_0x12a549){var _0x2158eb=squel[_0x3558('0x32')]()[_0x3558('0x33')]('cm_hopper')[_0x3558('0x35')]([_0x3558('0x1f'),_0x3558('0x3a'),'ContactId',_0x3558('0x36'),_0x12a549,'createdAt',_0x3558('0x3c')],squel['select']()['field']('phone',_0x3558('0x1f'))[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x3a'))['field']('id',_0x3558('0x44'))[_0x3558('0x38')](LISTID[_0x3558('0x3b')](),'ListId')[_0x3558('0x38')](_0xe70ea8['id'][_0x3558('0x3b')](),_0x12a549)[_0x3558('0x38')]('NOW()','createdAt')[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x3c'))[_0x3558('0x3d')](_0x3558('0x45'))[_0x3558('0x40')](_0x3558('0x3e'))['where'](_0x3558('0x3f'),LISTID[_0x3558('0x3b')]())[_0x3558('0x40')](_0x3558('0x46'),squel[_0x3558('0x47')](hopperContacts))[_0x3558('0x40')](_0x3558('0x41')))[_0x3558('0x3b')]();return _0x2158eb;}function _0x1d1843(_0x48b8ee,_0x49d62a){var _0x50f713=squel['insert']()[_0x3558('0x33')](_0x3558('0x4a'))[_0x3558('0x35')]([_0x3558('0x1f'),'ContactId',_0x3558('0x36'),_0x49d62a,_0x3558('0x37'),'updatedAt'],squel[_0x3558('0x43')]()[_0x3558('0x38')](_0x3558('0x1f'),_0x3558('0x1f'))[_0x3558('0x38')]('id',_0x3558('0x44'))[_0x3558('0x38')](LISTID[_0x3558('0x3b')](),_0x3558('0x36'))['field'](_0x48b8ee['id'][_0x3558('0x3b')](),_0x49d62a)[_0x3558('0x38')](_0x3558('0x39'),_0x3558('0x37'))[_0x3558('0x38')]('NOW()','updatedAt')[_0x3558('0x3d')]('cm_contacts')[_0x3558('0x40')](_0x3558('0x3e'))[_0x3558('0x40')](_0x3558('0x3f'),LISTID[_0x3558('0x3b')]())[_0x3558('0x40')]('id\x20IN\x20?',squel[_0x3558('0x47')](hopperContacts))['where'](_0x3558('0x41')))[_0x3558('0x3b')]();return _0x50f713;}return db[_0x3558('0x4b')][_0x3558('0x4c')]({'where':{'type':_0x3558('0x4d')},'attributes':['id',_0x3558('0x4e')],'include':[{'model':db[_0x3558('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x3558('0x2a')](function(_0x958ef9){var _0x21957f=[];if(_0x958ef9){var _0x2abc13;for(var _0x425767=0x0,_0x45b670;_0x425767<_0x958ef9['length'];_0x425767+=0x1){_0x45b670=_0x958ef9[_0x425767][_0x3558('0x50')]({'plain':!![]});switch(_0x45b670[_0x3558('0x4e')]){case'always':_0x21957f[_0x3558('0x51')](db[_0x3558('0x52')][_0x3558('0x53')](_0x39efd7(_0x45b670,_0x3558('0x54')))[_0x3558('0x2a')](function(){})[_0x3558('0x2c')](_0x3973ad()));break;case _0x3558('0x55'):_0x21957f[_0x3558('0x51')](db[_0x3558('0x52')][_0x3558('0x53')](_0x3e7d9e(_0x45b670,_0x3558('0x54')))[_0x3558('0x2a')](function(){})[_0x3558('0x2c')](_0x3973ad()));break;default:_0x21957f[_0x3558('0x51')](db[_0x3558('0x52')]['query'](_0x44829a(_0x45b670,_0x3558('0x54')))['then'](function(){})['catch'](_0x3973ad()));}}}return _0x21957f;})[_0x3558('0x56')]()[_0x3558('0x2a')](function(){return db[_0x3558('0x4b')]['findAll']({'where':{'type':_0x3558('0x4d')},'attributes':['id'],'include':[{'model':db[_0x3558('0x4f')],'as':_0x3558('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x488dce){var _0x3b4568=[];if(_0x488dce){var _0x9333c9;for(var _0x4cfbdd=0x0,_0x157029;_0x4cfbdd<_0x488dce[_0x3558('0x19')];_0x4cfbdd+=0x1){_0x157029=_0x488dce[_0x4cfbdd][_0x3558('0x50')]({'plain':!![]});_0x3b4568[_0x3558('0x51')](db['sequelize']['query'](_0x1d1843(_0x157029,_0x3558('0x54')))[_0x3558('0x2a')](function(){})['catch'](_0x3973ad()));}}return _0x3b4568;})[_0x3558('0x56')]();})[_0x3558('0x2a')](function(){return db[_0x3558('0x58')][_0x3558('0x4c')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3558('0x4f')],'as':_0x3558('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x9d9c93){var _0x3c1aba=[];if(_0x9d9c93){for(var _0x5e9177=0x0,_0x5ae339;_0x5e9177<_0x9d9c93[_0x3558('0x19')];_0x5e9177+=0x1){_0x5ae339=_0x9d9c93[_0x5e9177][_0x3558('0x50')]({'plain':!![]});switch(_0x5ae339[_0x3558('0x4e')]){case _0x3558('0x5a'):_0x3c1aba[_0x3558('0x51')](db[_0x3558('0x52')][_0x3558('0x53')](_0x39efd7(_0x5ae339,_0x3558('0x5b')))[_0x3558('0x2a')](function(){})[_0x3558('0x2c')](_0x3973ad()));break;case _0x3558('0x55'):_0x3c1aba[_0x3558('0x51')](db[_0x3558('0x52')][_0x3558('0x53')](_0x3e7d9e(_0x5ae339,_0x3558('0x5b')))[_0x3558('0x2a')](function(){})['catch'](_0x3973ad()));break;default:_0x3c1aba[_0x3558('0x51')](db['sequelize'][_0x3558('0x53')](_0x44829a(_0x5ae339,'CampaignId'))['then'](function(){})[_0x3558('0x2c')](_0x3973ad()));}}}return _0x3c1aba;})['all']();})[_0x3558('0x2a')](function(){return db['Campaign'][_0x3558('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3558('0x2a')](function(_0x9cd78){var _0x464443=[];if(_0x9cd78){for(var _0x3214e2=0x0,_0x347aa6;_0x3214e2<_0x9cd78[_0x3558('0x19')];_0x3214e2+=0x1){_0x347aa6=_0x9cd78[_0x3214e2][_0x3558('0x50')]({'plain':!![]});_0x464443[_0x3558('0x51')](db[_0x3558('0x52')][_0x3558('0x53')](_0x1d1843(_0x347aa6,_0x3558('0x5b')))[_0x3558('0x2a')](function(){})[_0x3558('0x2c')](_0x3973ad()));}}return _0x464443;})[_0x3558('0x56')]();})['catch'](function(_0x25c55e){logger['error'](_0x3558('0x5c'),_0x3558('0x5d'),_0x25c55e['message']);});}var processPromises=function(_0x1617b4){return BPromise[_0x3558('0x56')](promises)['then'](function(_0x5b973f){})[_0x3558('0x2c')](function(_0x3ecb3b){logger[_0x3558('0x14')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x3ecb3b));})[_0x3558('0x5e')](function(){socket[_0x3558('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1617b4){return _0x1617b4['resume']();}});};var endCsv=function(){return BPromise[_0x3558('0x60')]()[_0x3558('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x3558('0x2a')](function(){socket[_0x3558('0x5f')](_0x3558('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3558('0x62')](FILEPATH);}catch(_0x1b8e40){logger[_0x3558('0x14')](_0x3558('0x63'),JSON['stringify'](_0x1b8e40));}finally{process[_0x3558('0x64')](0x0);}});};process['on'](_0x3558('0x65'),function(){logger[_0x3558('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x3558('0x60')]()[_0x3558('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3558('0x11')](',');return db['CmContact'][_0x3558('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3558('0x2a')](function(_0x1f3a2a){var _0x5714d2=fs[_0x3558('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3558('0x68')](_0x5714d2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x30eb79,_0x503389){total+=0x1;var _0x208bc8=total;promises[_0x3558('0x51')](checkRow(_0x30eb79,_0x1f3a2a,_0x208bc8)['then'](function(){success+=0x1;})[_0x3558('0x2c')](function(_0x1a345b){if(_0x1a345b[_0x3558('0x14')]){errors+=0x1;delete _0x1a345b[_0x3558('0x14')];}else if(_0x1a345b[_0x3558('0x69')]){duplicates+=0x1;delete _0x1a345b[_0x3558('0x69')];}rows['push'](_0x1a345b);}));if(total%0xc8===0x0){_0x503389[_0x3558('0x6a')]();return processPromises(_0x503389);}},'complete':function(){return processPromises()[_0x3558('0x2a')](function(){logger['info'](_0x3558('0x6b'));endCsv();});},'error':function(_0x31b334,_0x1ec4bb){logger[_0x3558('0x66')]('CSV\x20parse\x20error',JSON[_0x3558('0x2e')](_0x31b334));endCsv();}});})[_0x3558('0x2c')](function(_0x27c314){logger[_0x3558('0x14')](_0x3558('0x6c'),JSON[_0x3558('0x2e')](_0x27c314));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 09d40f1..db976c2 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 _0x1735=['isNaN','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','length','SystemRow','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','where','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','cm_hopper_black','cm_contacts','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','errors','push','code','message','info','query','spread','catch','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','data','rows','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1735,0xb1));var _0x5173=function(_0x580c9f,_0x5594c5){_0x580c9f=_0x580c9f-0x0;var _0x359f9f=_0x1735[_0x580c9f];return _0x359f9f;};'use strict';var fs=require('fs');var path=require(_0x5173('0x0'));var _=require(_0x5173('0x1'));var Papa=require(_0x5173('0x2'));var util=require(_0x5173('0x3'));var BPromise=require(_0x5173('0x4'));var moment=require('moment');var squel=require(_0x5173('0x5'));var Redis=require('ioredis');var db=require(_0x5173('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x5173('0x7'))('import');config[_0x5173('0x8')]=_[_0x5173('0x9')](config[_0x5173('0x8')],{'host':_0x5173('0xa'),'port':0x18eb});var socket=require(_0x5173('0xb'))(new Redis(config[_0x5173('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x5173('0xc')](_0x5173('0xd'));function isEmail(_0x3878da){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))*$/[_0x5173('0xe')](_0x3878da);}function selectNotIn(_0x1e5d2b,_0x141b18,_0x56d11e,_0x3400a3,_0xafc0fc){return squel['select']()[_0x5173('0xf')](_0x5173('0x10'))[_0x5173('0x11')](_0x3400a3)['join'](_0x141b18,null,_0x141b18+'.id\x20=\x20'+_0x3400a3+'.'+_0x56d11e)[_0x5173('0x12')](_0x3400a3+'.'+_0x56d11e+'\x20=\x20'+_0x1e5d2b+'.'+_0x56d11e)[_0x5173('0x12')](_0x141b18+'.dialCheckDuplicateType\x20IN\x20('+_0xafc0fc[_0x5173('0x13')]()+')');}function insertCmHopper(_0x234b3f,_0x2581f8,_0x1d3120,_0x42a4c7,_0x88c32d){var _0x43bb82=[_0x5173('0x14'),_0x5173('0x15'),_0x5173('0x16'),_0x5173('0x17'),_0x2581f8+'.'+_0x42a4c7,_0x5173('0x18'),_0x5173('0x19'),_0x5173('0x1a'),_0x5173('0x1b'),'\x22'+_0x88c32d+'\x22'];return squel[_0x5173('0x1c')]()[_0x5173('0x1d')]('cm_hopper')[_0x5173('0x1e')]([_0x5173('0x10'),'scheduledat',_0x5173('0x1f'),_0x5173('0x20'),_0x42a4c7,_0x5173('0x21'),_0x5173('0x22'),_0x5173('0x23'),_0x5173('0x24'),_0x5173('0x25')],squel[_0x5173('0x26')]()[_0x5173('0x27')](_0x43bb82)[_0x5173('0x11')](_0x2581f8)[_0x5173('0x13')]('cm_contacts',null,_0x5173('0x28')+_0x2581f8+_0x5173('0x29'))[_0x5173('0x13')](_0x1d3120,null,_0x1d3120+'.id\x20=\x20'+_0x2581f8+'.'+_0x42a4c7)['where'](_0x2581f8+'.CmListId\x20=\x20?',_0x234b3f)[_0x5173('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5173('0x12')](_0x5173('0x2a'),selectNotIn(_0x2581f8,_0x1d3120,_0x42a4c7,'cm_hopper',[_0x5173('0x2b'),_0x5173('0x2c')]))[_0x5173('0x12')](_0x5173('0x2a'),selectNotIn(_0x2581f8,_0x1d3120,_0x42a4c7,_0x5173('0x2d'),[_0x5173('0x2b')])))['toString']();}function insertCmHopperBlack(_0x1d342a,_0xac49e9,_0x21d2c4,_0x483e63){var _0x57edd0=[_0x5173('0x14'),_0x5173('0x16'),_0x5173('0x17'),_0xac49e9+'.'+_0x483e63,'cm_contacts.createdAt',_0x5173('0x19')];return squel['insert']()['into'](_0x5173('0x2e'))[_0x5173('0x1e')](['phone',_0x5173('0x1f'),'ListId',_0x483e63,'createdAt',_0x5173('0x22')],squel[_0x5173('0x26')]()[_0x5173('0x27')](_0x57edd0)[_0x5173('0x11')](_0xac49e9)[_0x5173('0x13')](_0x5173('0x2f'),null,_0x5173('0x28')+_0xac49e9+_0x5173('0x29'))['join'](_0x21d2c4,null,_0x21d2c4+_0x5173('0x30')+_0xac49e9+'.'+_0x483e63)['where'](_0xac49e9+'.CmListId\x20=\x20?',_0x1d342a)[_0x5173('0x12')](_0x5173('0x31'),NOW)[_0x5173('0x12')](_0x5173('0x2a'),squel[_0x5173('0x26')]()[_0x5173('0xf')](_0x5173('0x10'))[_0x5173('0x11')](_0x5173('0x2e'))[_0x5173('0x12')](_0x5173('0x32'),_0x1d342a)['where'](_0x483e63+_0x5173('0x33'),_0xac49e9+'.'+_0x483e63)))[_0x5173('0x34')]();}function insertCmContact(_0x4cf841,_0x1e9e30,_0x234331,_0x2db2f3){var _0x58700d=_[_0x5173('0x35')](_[_0x5173('0x36')](_0x2db2f3),['ListId','CompanyId',_0x5173('0x21'),_0x5173('0x22')]);return squel['insert']()[_0x5173('0x1d')](_0x5173('0x2f'))[_0x5173('0x1e')](_0x58700d,squel[_0x5173('0x26')]()[_0x5173('0x27')](_0x58700d)[_0x5173('0x11')](_0x1e9e30)[_0x5173('0x12')]('('+_0x234331[_0x5173('0x13')](',')+_0x5173('0x37'),squel['select']()['fields'](_0x234331)['from'](_0x5173('0x2f'))[_0x5173('0x12')](_0x5173('0x32'),_0x4cf841)['where'](_0x5173('0x38')))[_0x5173('0x12')](_0x5173('0x39'),squel['select']()[_0x5173('0xf')](_0x5173('0x3a'),'min_id')[_0x5173('0x11')](_0x1e9e30)[_0x5173('0x3b')](_0x234331['join'](','))))[_0x5173('0x34')]();}function handleStop(){logger['info'](_0x5173('0x3c'));stopped=!![];}function handleUncaughtException(_0x3bf705){logger[_0x5173('0x3d')](_0x3bf705['message']);process['exit'](0x1);}function handleError(_0x57442a,_0x5ca168){stats[_0x5173('0x3e')][_0x5173('0x3f')]({'name':_0x5ca168[_0x5173('0x40')],'message':_0x5ca168[_0x5173('0x41')],'row':_0x57442a});}function handleQuery(_0x51f75c){logger[_0x5173('0x42')](_0x51f75c);return db['sequelize'][_0x5173('0x43')](_0x51f75c)[_0x5173('0x44')](function(_0x5e4de4){results[_0x5173('0x3f')](_0x5e4de4);})[_0x5173('0x45')](function(_0x1246c2){logger[_0x5173('0x3d')](_0x1246c2[_0x5173('0x41')]);});}function main(_0x56a847,_0x33a89f,_0x3cbf39,_0x379b90){logger[_0x5173('0x42')]('main',_0x56a847,JSON[_0x5173('0x46')](_0x33a89f));process[_0x5173('0x47')](_0x5173('0x48'));var _0x36b130=_0x33a89f[_0x5173('0x49')];var _0x468796=_0x33a89f[_0x5173('0x4a')];var _0x3a4323=path[_0x5173('0x13')](config[_0x5173('0x4b')],_0x5173('0x4c'),_0x468796+'.csv');var _0x47c884=_[_0x5173('0x36')](_0x36b130)[_0x5173('0x13')]();logger['info'](_0x5173('0x4d'),_0x47c884);fs[_0x5173('0x4e')](_0x3a4323,_0x47c884+'\x0a');Papa['parse'](fs['createReadStream'](_0x56a847),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5abc6f,_0x3861c9){try{for(var _0x221c32=0x0,_0x99bb21=[];_0x221c32<_0x5abc6f[_0x5173('0x4f')]['length'];_0x221c32++){stats[_0x5173('0x50')]+=0x1;if(_0x5abc6f[_0x5173('0x3e')][_0x221c32]){handleError(_0x5abc6f[_0x5173('0x4f')][_0x221c32],_0x5abc6f[_0x5173('0x3e')][_0x221c32]);}else{var _0x5d9999=[];for(var _0x16fa40 in _0x36b130){if(_0x36b130['hasOwnProperty'](_0x16fa40)){if(_0x5abc6f[_0x5173('0x4f')][_0x221c32][_0x36b130[_0x16fa40]]){var _0xd1a842=_['trim'](_0x5abc6f[_0x5173('0x4f')][_0x221c32][_0x36b130[_0x16fa40]][_0x5173('0x51')](/"/g,'\x27'));switch(_0x16fa40){case _0x5173('0x52'):var _0x9cde0f=moment(_0xd1a842,_0x5173('0xd'),!![]);if(_0x9cde0f[_0x5173('0x53')]()){_0x99bb21['push']('\x22'+_0xd1a842+'\x22');}else{_0x5d9999[_0x5173('0x3f')](_0x5173('0x54'));}break;case _0x5173('0x23'):var _0x5781d5=parseInt(_0xd1a842);_0xd1a842=_[_0x5173('0x55')](_0x5781d5)||_0x5781d5<0x0||_0x5781d5>0x4?_0x379b90?0x3:0x2:_0x5781d5;_0x99bb21['push']('\x22'+_0xd1a842+'\x22');break;case _0x5173('0x24'):var _0x4fe3df=parseInt(_0xd1a842);if(_[_0x5173('0x56')](_0x4fe3df)&&_[_0x5173('0x57')](_0x3cbf39,_0x4fe3df)){_0x99bb21[_0x5173('0x3f')]('\x22'+_0x4fe3df+'\x22');}else{_0x5d9999['push'](_0x5173('0x58'));}break;case _0x5173('0x59'):if(isEmail(_0xd1a842)){_0x99bb21[_0x5173('0x3f')]('\x22'+_0xd1a842+'\x22');}else{_0x5d9999[_0x5173('0x3f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0xfd7c2f=moment(_0xd1a842,_0x5173('0x5a'),!![]);if(_0xfd7c2f[_0x5173('0x53')]()){_0x99bb21[_0x5173('0x3f')]('\x22'+_0xd1a842+'\x22');}else{_0x5d9999['push'](_0x5173('0x5b'));}break;default:_0x99bb21[_0x5173('0x3f')]('\x22'+_0xd1a842+'\x22');}}else{switch(_0x16fa40){case'firstName':case _0x5173('0x10'):_0x5d9999[_0x5173('0x3f')](_0x16fa40+_0x5173('0x5c'));break;default:_0x99bb21[_0x5173('0x3f')]('\x22\x22');}}}}if(_0x5d9999[_0x5173('0x5d')]){handleError(_0x5abc6f[_0x5173('0x4f')][_0x221c32],{'code':_0x5173('0x5e'),'message':_0x5d9999['join']()});}else{fs['appendFileSync'](_0x3a4323,_0x99bb21[_0x5173('0x13')]()+'\x0a');}_0x99bb21=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x5173('0x5f')+_0x468796,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x5173('0x60'));_0x3861c9['abort']();}}catch(_0x30ee94){handleError(_0x5abc6f[_0x5173('0x4f')][_0x221c32],{'code':_0x5173('0x61'),'message':_0x30ee94['message']});logger[_0x5173('0x3d')](_0x5173('0x62'),_0x30ee94[_0x5173('0x41')]);}},'complete':function(){try{var _0x4f6f85=[];var _0xdfd742=_0x5173('0x2f');if(_0x33a89f['duplicates']&&_0x33a89f[_0x5173('0x63')][_0x5173('0x5d')]){_0xdfd742=_0x5173('0x64')+_0x468796;_0x4f6f85[_0x5173('0x3f')](_0x5173('0x65')+_0xdfd742+'\x20LIKE\x20cm_contacts;');}var _0x598e03=util['format'](_0x5173('0x66'),_0x3a4323,_0xdfd742,_0x47c884,_0x33a89f[_0x5173('0x20')],_0x33a89f[_0x5173('0x67')]||null,NOW,NOW);if(_['isNil'](_0x36b130['scheduledat'])){_0x598e03+=_0x5173('0x68');}_0x4f6f85[_0x5173('0x3f')](_0x598e03);if(_0x33a89f[_0x5173('0x63')]&&_0x33a89f[_0x5173('0x63')][_0x5173('0x5d')]){_0x4f6f85[_0x5173('0x3f')](insertCmContact(_0x33a89f['ListId'],_0xdfd742,_0x33a89f[_0x5173('0x63')],_0x36b130));_0x4f6f85[_0x5173('0x3f')]('DROP\x20TABLE\x20'+_0xdfd742+';');}_0x4f6f85['push'](insertCmHopper(_0x33a89f['ListId'],_0x5173('0x69'),_0x5173('0x6a'),_0x5173('0x6b'),_0x379b90));_0x4f6f85['push'](insertCmHopperBlack(_0x33a89f[_0x5173('0x20')],'voice_queues_has_cm_blacklists',_0x5173('0x6a'),_0x5173('0x6b')));_0x4f6f85[_0x5173('0x3f')](insertCmHopper(_0x33a89f['ListId'],_0x5173('0x6c'),_0x5173('0x6d'),_0x5173('0x6e'),_0x379b90));_0x4f6f85[_0x5173('0x3f')](insertCmHopperBlack(_0x33a89f['ListId'],_0x5173('0x6f'),_0x5173('0x6d'),_0x5173('0x6e')));BPromise[_0x5173('0x70')](_0x4f6f85,handleQuery)[_0x5173('0x71')](function(_0xc5d832){stats[_0x5173('0x72')]=!![];stats['affectedRows']=_0x33a89f['duplicates']&&_0x33a89f[_0x5173('0x63')][_0x5173('0x5d')]?results[0x2][_0x5173('0x73')]:results[0x0][_0x5173('0x73')];socket['emit'](_0x5173('0x5f')+_0x468796,stats);fs['unlink'](_0x56a847);fs['unlink'](_0x3a4323);process[_0x5173('0x74')](0x0);})['catch'](function(_0x12aa17){logger[_0x5173('0x3d')](_0x12aa17[_0x5173('0x41')]);process[_0x5173('0x74')](0x1);});}catch(_0x477c61){logger[_0x5173('0x3d')]('complete',_0x477c61[_0x5173('0x41')]);process[_0x5173('0x74')](0x1);}},'error':function(_0x4efd64,_0x44b0e5,_0x7a1390,_0x568d67){throw new Error(_0x568d67);}});}function validate(){if(process[_0x5173('0x75')]&&process[_0x5173('0x75')]['length']<0x4){throw new Error(_0x5173('0x76'));}var _0x2309e8=path[_0x5173('0x13')](config['root'],_0x5173('0x4c'),process[_0x5173('0x75')][0x2]);if(!fs[_0x5173('0x77')](_0x2309e8)){throw new Error(_0x5173('0x78'));}var _0x471dc0={};try{_0x471dc0=JSON['parse'](process[_0x5173('0x75')][0x3]);if(!_0x471dc0[_0x5173('0x49')]){throw new Error(_0x5173('0x79'));}if(!_0x471dc0[_0x5173('0x49')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x471dc0[_0x5173('0x49')][_0x5173('0x7a')]){throw new Error(_0x5173('0x7b'));}var _0x945903=0x0;if(_0x471dc0['binding'][_0x5173('0x24')]){_0x945903=0x1;}if(!_0x471dc0[_0x5173('0x20')]){throw new Error(_0x5173('0x7c'));}}catch(_0x58921f){throw new Error(_0x5173('0x7d'));}var _0x28fb27=[];try{_0x28fb27=_[_0x5173('0x7e')](JSON[_0x5173('0x7f')](process[_0x5173('0x75')][0x4]),'id');}catch(_0x4398c3){logger['info'](_0x5173('0x80'));}main(_0x2309e8,_0x471dc0,_0x28fb27,_0x945903);}validate();process['on'](_0x5173('0x81'),handleStop);process['on'](_0x5173('0x82'),handleUncaughtException); \ No newline at end of file +var _0x5276=['cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','.CmListId','\x20=\x20?','concat','CompanyId','fields','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','push','code','message','sequelize','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','length','data','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','Abort\x20parser','abort','SystemError','step','duplicates','\x20LIKE\x20cm_contacts;','format','isNil','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','parse','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x5276,0xf8));var _0x6527=function(_0x5a3816,_0x22ab14){_0x5a3816=_0x5a3816-0x0;var _0x32ddbf=_0x5276[_0x5a3816];return _0x32ddbf;};'use strict';var fs=require('fs');var path=require(_0x6527('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x6527('0x1'));var BPromise=require('bluebird');var moment=require(_0x6527('0x2'));var squel=require(_0x6527('0x3'));var Redis=require(_0x6527('0x4'));var db=require(_0x6527('0x5'))['db'];var config=require(_0x6527('0x6'));var logger=require(_0x6527('0x7'))(_0x6527('0x8'));config[_0x6527('0x9')]=_[_0x6527('0xa')](config[_0x6527('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6527('0xb'))(new Redis(config[_0x6527('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x6527('0xc'));function isEmail(_0x2cc37a){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))*$/[_0x6527('0xd')](_0x2cc37a);}function selectNotIn(_0x14d049,_0x5c5704,_0x3fe145,_0x25d51b,_0x2b9ae8){return squel['select']()[_0x6527('0xe')](_0x6527('0xf'))[_0x6527('0x10')](_0x25d51b)['join'](_0x5c5704,null,_0x5c5704+_0x6527('0x11')+_0x25d51b+'.'+_0x3fe145)[_0x6527('0x12')](_0x25d51b+'.'+_0x3fe145+'\x20=\x20'+_0x14d049+'.'+_0x3fe145)[_0x6527('0x12')](_0x5c5704+_0x6527('0x13')+_0x2b9ae8['join']()+')');}function insertCmHopper(_0x1df6b3,_0xecb915,_0x404e3c,_0x5337c7,_0x519ef0){var _0x1ba507=[_0x6527('0x14'),'cm_contacts.scheduledat',_0x6527('0x15'),_0x6527('0x16'),_0xecb915+'.'+_0x5337c7,_0x6527('0x17'),'cm_contacts.updatedAt',_0x6527('0x18'),_0x6527('0x19'),'\x22'+_0x519ef0+'\x22'];return squel[_0x6527('0x1a')]()[_0x6527('0x1b')](_0x6527('0x1c'))[_0x6527('0x1d')]([_0x6527('0xf'),'scheduledat',_0x6527('0x1e'),_0x6527('0x1f'),_0x5337c7,_0x6527('0x20'),_0x6527('0x21'),_0x6527('0x22'),_0x6527('0x23'),_0x6527('0x24')],squel[_0x6527('0x25')]()['fields'](_0x1ba507)[_0x6527('0x10')](_0xecb915)[_0x6527('0x26')](_0x6527('0x27'),null,_0x6527('0x28')+_0xecb915+'.CmListId')['join'](_0x404e3c,null,_0x404e3c+_0x6527('0x11')+_0xecb915+'.'+_0x5337c7)['where'](_0xecb915+_0x6527('0x29'),_0x1df6b3)[_0x6527('0x12')](_0x6527('0x2a'),NOW)[_0x6527('0x12')](_0x6527('0x2b'),selectNotIn(_0xecb915,_0x404e3c,_0x5337c7,_0x6527('0x1c'),[_0x6527('0x2c'),_0x6527('0x2d')]))[_0x6527('0x12')](_0x6527('0x2b'),selectNotIn(_0xecb915,_0x404e3c,_0x5337c7,'cm_hopper',[_0x6527('0x2c')])))[_0x6527('0x2e')]();}function insertCmHopperBlack(_0x43683e,_0x724193,_0x3dfa92,_0x337da1){var _0x428fd2=[_0x6527('0x14'),_0x6527('0x15'),_0x6527('0x16'),_0x724193+'.'+_0x337da1,_0x6527('0x17'),_0x6527('0x2f')];return squel[_0x6527('0x1a')]()[_0x6527('0x1b')](_0x6527('0x30'))[_0x6527('0x1d')]([_0x6527('0xf'),'ContactId','ListId',_0x337da1,_0x6527('0x20'),_0x6527('0x21')],squel[_0x6527('0x25')]()['fields'](_0x428fd2)['from'](_0x724193)[_0x6527('0x26')](_0x6527('0x27'),null,_0x6527('0x28')+_0x724193+_0x6527('0x31'))[_0x6527('0x26')](_0x3dfa92,null,_0x3dfa92+_0x6527('0x11')+_0x724193+'.'+_0x337da1)[_0x6527('0x12')](_0x724193+_0x6527('0x29'),_0x43683e)[_0x6527('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6527('0x12')](_0x6527('0x2b'),squel[_0x6527('0x25')]()[_0x6527('0xe')](_0x6527('0xf'))[_0x6527('0x10')]('cm_hopper_black')[_0x6527('0x12')]('ListId\x20=\x20?',_0x43683e)[_0x6527('0x12')](_0x337da1+_0x6527('0x32'),_0x724193+'.'+_0x337da1)))[_0x6527('0x2e')]();}function insertCmContact(_0x3547f0,_0xeed04e,_0x458f74,_0xf604db){var _0x97dcb6=_[_0x6527('0x33')](_['keys'](_0xf604db),[_0x6527('0x1f'),_0x6527('0x34'),_0x6527('0x20'),_0x6527('0x21')]);return squel[_0x6527('0x1a')]()['into'](_0x6527('0x27'))['fromQuery'](_0x97dcb6,squel[_0x6527('0x25')]()[_0x6527('0x35')](_0x97dcb6)[_0x6527('0x10')](_0xeed04e)[_0x6527('0x12')]('('+_0x458f74[_0x6527('0x26')](',')+')\x20NOT\x20IN\x20?',squel[_0x6527('0x25')]()[_0x6527('0x35')](_0x458f74)['from'](_0x6527('0x27'))[_0x6527('0x12')](_0x6527('0x36'),_0x3547f0)[_0x6527('0x12')](_0x6527('0x37')))[_0x6527('0x12')](_0x6527('0x38'),squel['select']()[_0x6527('0xe')](_0x6527('0x39'),_0x6527('0x3a'))['from'](_0xeed04e)[_0x6527('0x3b')](_0x458f74['join'](','))))[_0x6527('0x2e')]();}function handleStop(){logger[_0x6527('0x3c')](_0x6527('0x3d'));stopped=!![];}function handleUncaughtException(_0x4524d1){logger['error'](_0x4524d1['message']);process[_0x6527('0x3e')](0x1);}function handleError(_0xbc2202,_0x1866d2){stats[_0x6527('0x3f')][_0x6527('0x40')]({'name':_0x1866d2[_0x6527('0x41')],'message':_0x1866d2[_0x6527('0x42')],'row':_0xbc2202});}function handleQuery(_0x491a66){logger[_0x6527('0x3c')](_0x491a66);return db[_0x6527('0x43')][_0x6527('0x44')](_0x491a66)[_0x6527('0x45')](function(_0x5b77de){results['push'](_0x5b77de);})[_0x6527('0x46')](function(_0x4d503c){logger[_0x6527('0x47')](_0x4d503c[_0x6527('0x42')]);});}function main(_0x3f8c47,_0x52923c,_0x1ee747,_0x3882c5){logger['info'](_0x6527('0x48'),_0x3f8c47,JSON[_0x6527('0x49')](_0x52923c));process[_0x6527('0x4a')](_0x6527('0x4b'));var _0x3447f3=_0x52923c[_0x6527('0x4c')];var _0x1d90b2=_0x52923c[_0x6527('0x4d')];var _0x231a98=path['join'](config[_0x6527('0x4e')],_0x6527('0x4f'),_0x1d90b2+'.csv');var _0x56def2=_['keys'](_0x3447f3)[_0x6527('0x26')]();logger[_0x6527('0x3c')](_0x6527('0x50'),_0x56def2);fs[_0x6527('0x51')](_0x231a98,_0x56def2+'\x0a');Papa['parse'](fs['createReadStream'](_0x3f8c47),{'header':!![],'skipEmptyLines':!![],'step':function(_0x459e05,_0x325ea4){try{for(var _0x4a26e2=0x0,_0x4fa678=[];_0x4a26e2<_0x459e05['data'][_0x6527('0x52')];_0x4a26e2++){stats['rows']+=0x1;if(_0x459e05[_0x6527('0x3f')][_0x4a26e2]){handleError(_0x459e05[_0x6527('0x53')][_0x4a26e2],_0x459e05['errors'][_0x4a26e2]);}else{var _0x401cb3=[];for(var _0x3eee66 in _0x3447f3){if(_0x3447f3[_0x6527('0x54')](_0x3eee66)){if(_0x459e05[_0x6527('0x53')][_0x4a26e2][_0x3447f3[_0x3eee66]]){var _0x5d78be=_[_0x6527('0x55')](_0x459e05[_0x6527('0x53')][_0x4a26e2][_0x3447f3[_0x3eee66]][_0x6527('0x56')](/"/g,'\x27'));switch(_0x3eee66){case _0x6527('0x57'):var _0x82fb43=moment(_0x5d78be,_0x6527('0xc'),!![]);if(_0x82fb43[_0x6527('0x58')]()){_0x4fa678[_0x6527('0x40')]('\x22'+_0x5d78be+'\x22');}else{_0x401cb3[_0x6527('0x40')](_0x6527('0x59'));}break;case _0x6527('0x22'):var _0x551cf6=parseInt(_0x5d78be);_0x5d78be=_['isNaN'](_0x551cf6)||_0x551cf6<0x0||_0x551cf6>0x4?_0x3882c5?0x3:0x2:_0x551cf6;_0x4fa678[_0x6527('0x40')]('\x22'+_0x5d78be+'\x22');break;case'UserId':var _0x397cc0=parseInt(_0x5d78be);if(_[_0x6527('0x5a')](_0x397cc0)&&_['includes'](_0x1ee747,_0x397cc0)){_0x4fa678[_0x6527('0x40')]('\x22'+_0x397cc0+'\x22');}else{_0x401cb3[_0x6527('0x40')](_0x6527('0x5b'));}break;case'email':if(isEmail(_0x5d78be)){_0x4fa678[_0x6527('0x40')]('\x22'+_0x5d78be+'\x22');}else{_0x401cb3[_0x6527('0x40')](_0x6527('0x5c'));}break;case _0x6527('0x5d'):var _0x40e0b8=moment(_0x5d78be,_0x6527('0x5e'),!![]);if(_0x40e0b8[_0x6527('0x58')]()){_0x4fa678['push']('\x22'+_0x5d78be+'\x22');}else{_0x401cb3['push'](_0x6527('0x5f'));}break;default:_0x4fa678[_0x6527('0x40')]('\x22'+_0x5d78be+'\x22');}}else{switch(_0x3eee66){case _0x6527('0x60'):case _0x6527('0xf'):_0x401cb3['push'](_0x3eee66+_0x6527('0x61'));break;default:_0x4fa678[_0x6527('0x40')]('\x22\x22');}}}}if(_0x401cb3[_0x6527('0x52')]){handleError(_0x459e05[_0x6527('0x53')][_0x4a26e2],{'code':_0x6527('0x62'),'message':_0x401cb3[_0x6527('0x26')]()});}else{fs[_0x6527('0x63')](_0x231a98,_0x4fa678['join']()+'\x0a');}_0x4fa678=[];}if(!(stats[_0x6527('0x64')]%0xc8)){socket[_0x6527('0x65')]('contact:import:'+_0x1d90b2,stats);stats['errors']=[];}}if(stopped){logger[_0x6527('0x3c')](_0x6527('0x66'));_0x325ea4[_0x6527('0x67')]();}}catch(_0xd11728){handleError(_0x459e05[_0x6527('0x53')][_0x4a26e2],{'code':_0x6527('0x68'),'message':_0xd11728[_0x6527('0x42')]});logger[_0x6527('0x47')](_0x6527('0x69'),_0xd11728['message']);}},'complete':function(){try{var _0x3a3cd8=[];var _0x12a4f1=_0x6527('0x27');if(_0x52923c['duplicates']&&_0x52923c[_0x6527('0x6a')]['length']){_0x12a4f1='cm_contacts_'+_0x1d90b2;_0x3a3cd8['push']('CREATE\x20TABLE\x20'+_0x12a4f1+_0x6527('0x6b'));}var _0x4ef31e=util[_0x6527('0x6c')]('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',_0x231a98,_0x12a4f1,_0x56def2,_0x52923c[_0x6527('0x1f')],_0x52923c[_0x6527('0x34')]||null,NOW,NOW);if(_[_0x6527('0x6d')](_0x3447f3[_0x6527('0x57')])){_0x4ef31e+=',\x20scheduledAt\x20=\x20NOW()';}_0x3a3cd8[_0x6527('0x40')](_0x4ef31e);if(_0x52923c['duplicates']&&_0x52923c['duplicates']['length']){_0x3a3cd8['push'](insertCmContact(_0x52923c['ListId'],_0x12a4f1,_0x52923c[_0x6527('0x6a')],_0x3447f3));_0x3a3cd8[_0x6527('0x40')]('DROP\x20TABLE\x20'+_0x12a4f1+';');}_0x3a3cd8['push'](insertCmHopper(_0x52923c[_0x6527('0x1f')],_0x6527('0x6e'),_0x6527('0x6f'),'VoiceQueueId',_0x3882c5));_0x3a3cd8['push'](insertCmHopperBlack(_0x52923c[_0x6527('0x1f')],_0x6527('0x70'),_0x6527('0x6f'),_0x6527('0x71')));_0x3a3cd8[_0x6527('0x40')](insertCmHopper(_0x52923c[_0x6527('0x1f')],_0x6527('0x72'),_0x6527('0x73'),_0x6527('0x74'),_0x3882c5));_0x3a3cd8[_0x6527('0x40')](insertCmHopperBlack(_0x52923c[_0x6527('0x1f')],_0x6527('0x75'),'campaigns',_0x6527('0x74')));BPromise[_0x6527('0x76')](_0x3a3cd8,handleQuery)['then'](function(_0x50225){stats[_0x6527('0x77')]=!![];stats[_0x6527('0x78')]=_0x52923c[_0x6527('0x6a')]&&_0x52923c[_0x6527('0x6a')]['length']?results[0x2][_0x6527('0x78')]:results[0x0][_0x6527('0x78')];socket[_0x6527('0x65')](_0x6527('0x79')+_0x1d90b2,stats);fs['unlink'](_0x3f8c47);fs[_0x6527('0x7a')](_0x231a98);process[_0x6527('0x3e')](0x0);})[_0x6527('0x46')](function(_0x383b8e){logger['error'](_0x383b8e['message']);process[_0x6527('0x3e')](0x1);});}catch(_0x35b889){logger[_0x6527('0x47')](_0x6527('0x7b'),_0x35b889[_0x6527('0x42')]);process[_0x6527('0x3e')](0x1);}},'error':function(_0x231c7b,_0x1b8c71,_0x2187fe,_0xe1ea8){throw new Error(_0xe1ea8);}});}function validate(){if(process[_0x6527('0x7c')]&&process['argv'][_0x6527('0x52')]<0x4){throw new Error(_0x6527('0x7d'));}var _0x470e22=path[_0x6527('0x26')](config['root'],_0x6527('0x4f'),process[_0x6527('0x7c')][0x2]);if(!fs[_0x6527('0x7e')](_0x470e22)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x1ec780={};try{_0x1ec780=JSON[_0x6527('0x7f')](process[_0x6527('0x7c')][0x3]);if(!_0x1ec780[_0x6527('0x4c')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x1ec780[_0x6527('0x4c')][_0x6527('0xf')]){throw new Error(_0x6527('0x80'));}if(!_0x1ec780['binding'][_0x6527('0x60')]){throw new Error('firstName\x20is\x20mandatory');}var _0x2c3cef=0x0;if(_0x1ec780[_0x6527('0x4c')][_0x6527('0x23')]){_0x2c3cef=0x1;}if(!_0x1ec780[_0x6527('0x1f')]){throw new Error(_0x6527('0x81'));}}catch(_0xbe4e2){throw new Error(_0x6527('0x82'));}var _0x2e669c=[];try{_0x2e669c=_[_0x6527('0x83')](JSON[_0x6527('0x7f')](process[_0x6527('0x7c')][0x4]),'id');}catch(_0x37f6cc){logger[_0x6527('0x3c')](_0x6527('0x84'));}main(_0x470e22,_0x1ec780,_0x2e669c,_0x2c3cef);}validate();process['on'](_0x6527('0x85'),handleStop);process['on'](_0x6527('0x86'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 632d38e..1540475 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 _0x35f7=['inbound','push','queue','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Name','destexten','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcompleteAt','holdtime','Talk\x20Time','talktime','outbound','***\x20Call\x20Info\x20***','Called\x20Number','membername','UniqueId','Date','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice'];(function(_0x5a853a,_0x7338b2){var _0x55e77d=function(_0x3439cf){while(--_0x3439cf){_0x5a853a['push'](_0x5a853a['shift']());}};_0x55e77d(++_0x7338b2);}(_0x35f7,0x19d));var _0x735f=function(_0x18f1c2,_0x43109c){_0x18f1c2=_0x18f1c2-0x0;var _0x189fc6=_0x35f7[_0x18f1c2];return _0x189fc6;};'use strict';exports[_0x735f('0x0')]=function(_0x3c73ca,_0x429cb0){var _0x3c833d=[{'type':_0x735f('0x1'),'content':_0x735f('0x2'),'variableName':null}];switch(_0x3c73ca[_0x735f('0x3')]()){case _0x735f('0x4'):switch(_0x429cb0[_0x735f('0x3')]()){case _0x735f('0x5'):_0x3c833d[_0x735f('0x6')]({'type':'variable','content':'','variableName':_0x735f('0x7')});_0x3c833d[_0x735f('0x6')]({'type':_0x735f('0x8'),'content':'','variableName':_0x735f('0x9')});break;case'outbound':_0x3c833d['push']({'type':'string','content':_0x735f('0xa'),'variableName':null});_0x3c833d[_0x735f('0x6')]({'type':_0x735f('0x8'),'content':'','variableName':_0x735f('0xb')});break;}}return _0x3c833d;};exports[_0x735f('0xc')]=function(_0x18c905,_0x327e75){var _0x193874=[];switch(_0x18c905[_0x735f('0x3')]()){case _0x735f('0x4'):switch(_0x327e75['toLowerCase']()){case _0x735f('0x5'):_0x193874=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x735f('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x735f('0x8'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x735f('0xe'),'keyType':_0x735f('0x8'),'variableName':'calleridname'},{'type':_0x735f('0xd'),'content':'','key':'Call\x20To','keyType':_0x735f('0x8'),'variableName':_0x735f('0xf')},{'type':_0x735f('0xd'),'content':'','key':'Queue','keyType':_0x735f('0x8'),'variableName':_0x735f('0x7')},{'type':_0x735f('0xd'),'content':'','key':'UniqueId','keyType':_0x735f('0x8'),'variableName':'uniqueid'},{'type':_0x735f('0xd'),'content':'','key':'Date','keyType':'variable','variableName':_0x735f('0x10')},{'type':_0x735f('0x1'),'content':_0x735f('0x11'),'key':null,'keyType':null,'variableName':null},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x12'),'keyType':_0x735f('0x8'),'variableName':'destcalleridname'},{'type':_0x735f('0xd'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0x735f('0xb')},{'type':_0x735f('0x1'),'content':_0x735f('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x14'),'keyType':_0x735f('0x8'),'variableName':'agentcalledAt'},{'type':_0x735f('0xd'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':'agentconnectAt'},{'type':_0x735f('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x735f('0x8'),'variableName':_0x735f('0x15')},{'type':_0x735f('0xd'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x735f('0x16')},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x17'),'keyType':_0x735f('0x8'),'variableName':_0x735f('0x18')}];break;case _0x735f('0x19'):_0x193874=[{'type':_0x735f('0x1'),'content':_0x735f('0x1a'),'variableName':null},{'type':'keyValue','content':'','key':_0x735f('0x1b'),'keyType':_0x735f('0x8'),'keyContent':'','variableName':_0x735f('0xb')},{'type':_0x735f('0xd'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0x735f('0x1c')},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x1d'),'keyType':_0x735f('0x8'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x735f('0x1e'),'keyType':_0x735f('0x8'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x735f('0x13')},{'type':'keyValue','content':'','key':_0x735f('0x1f'),'keyType':'variable','keyContent':'','variableName':_0x735f('0x20')},{'type':'keyValue','content':'','key':_0x735f('0x21'),'keyType':_0x735f('0x8'),'keyContent':'','variableName':_0x735f('0x22')},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x23'),'keyType':_0x735f('0x8'),'keyContent':'','variableName':_0x735f('0x24')},{'type':_0x735f('0xd'),'content':'','key':_0x735f('0x25'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x193874;}; \ No newline at end of file +var _0xb808=['***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','calleridname','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x914a73,_0x1dbbf7){var _0x129180=function(_0xd82a3d){while(--_0xd82a3d){_0x914a73['push'](_0x914a73['shift']());}};_0x129180(++_0x1dbbf7);}(_0xb808,0x151));var _0x8b80=function(_0x101281,_0x398cfc){_0x101281=_0x101281-0x0;var _0x566ea8=_0xb808[_0x101281];return _0x566ea8;};'use strict';exports['getSubjects']=function(_0x5bcc11,_0x31c891){var _0x19541f=[{'type':_0x8b80('0x0'),'content':_0x8b80('0x1'),'variableName':null}];switch(_0x5bcc11[_0x8b80('0x2')]()){case _0x8b80('0x3'):switch(_0x31c891[_0x8b80('0x2')]()){case _0x8b80('0x4'):_0x19541f[_0x8b80('0x5')]({'type':'variable','content':'','variableName':_0x8b80('0x6')});_0x19541f['push']({'type':_0x8b80('0x7'),'content':'','variableName':_0x8b80('0x8')});break;case _0x8b80('0x9'):_0x19541f[_0x8b80('0x5')]({'type':_0x8b80('0x0'),'content':'Outbound\x20Call','variableName':null});_0x19541f[_0x8b80('0x5')]({'type':_0x8b80('0x7'),'content':'','variableName':_0x8b80('0xa')});break;}}return _0x19541f;};exports[_0x8b80('0xb')]=function(_0x214ee8,_0x23d09c){var _0x34cd6a=[];switch(_0x214ee8[_0x8b80('0x2')]()){case'voice':switch(_0x23d09c['toLowerCase']()){case _0x8b80('0x4'):_0x34cd6a=[{'type':_0x8b80('0x0'),'content':_0x8b80('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x8b80('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x8b80('0x7'),'variableName':_0x8b80('0xe')},{'type':_0x8b80('0xd'),'content':'','key':'Call\x20To','keyType':_0x8b80('0x7'),'variableName':'destexten'},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0xf'),'keyType':'variable','variableName':_0x8b80('0x6')},{'type':'keyValue','content':'','key':_0x8b80('0x10'),'keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x11')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x12'),'keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x13')},{'type':'string','content':_0x8b80('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x15'),'keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x16')},{'type':_0x8b80('0xd'),'content':'','key':'Agent\x20Number','keyType':_0x8b80('0x7'),'variableName':'destcalleridnum'},{'type':_0x8b80('0x0'),'content':_0x8b80('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x8b80('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x13')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x18'),'keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x19')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x1a'),'keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x1b')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x1c'),'keyType':_0x8b80('0x7'),'variableName':'holdtime'},{'type':_0x8b80('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x8b80('0x7'),'variableName':_0x8b80('0x1d')}];break;case _0x8b80('0x9'):_0x34cd6a=[{'type':_0x8b80('0x0'),'content':_0x8b80('0xc'),'variableName':null},{'type':_0x8b80('0xd'),'content':'','key':'Called\x20Number','keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0xa')},{'type':'keyValue','content':'','key':_0x8b80('0x1e'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x1f')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x10'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x11')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x12'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x20')},{'type':_0x8b80('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x21'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x22'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x23')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x24'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x25')},{'type':_0x8b80('0xd'),'content':'','key':_0x8b80('0x26'),'keyType':_0x8b80('0x7'),'keyContent':'','variableName':_0x8b80('0x27')}];break;}}return _0x34cd6a;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 93bcd69..e17684b 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 _0x3686=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','then','update','info','catch','error','tracked','user','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x3686,0xdf));var _0x6368=function(_0x3e4138,_0x65a305){_0x3e4138=_0x3e4138-0x0;var _0x5d8c9a=_0x3686[_0x3e4138];return _0x5d8c9a;};'use strict';var _=require(_0x6368('0x0'));var db=require(_0x6368('0x1'))['db'];var loggers={'openchannel':require(_0x6368('0x2'))(_0x6368('0x3')),'mail':require(_0x6368('0x2'))(_0x6368('0x4')),'fax':require(_0x6368('0x2'))(_0x6368('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x6368('0x2'))(_0x6368('0x6')),'whatsapp':require(_0x6368('0x2'))(_0x6368('0x7'))};function getInteractionId(_0x14811a,_0xe5dd2d,_0x486358){if(_0x14811a&&_0x14811a[_[_0x6368('0x8')](_0x486358)+'InteractionId']){return _0x14811a[_['upperFirst'](_0x486358)+_0x6368('0x9')];}else if(_0x14811a&&_0x14811a['id']){return _0x14811a['id'];}else if(_0xe5dd2d&&_0xe5dd2d['id']){return _0xe5dd2d['id'];}else{return _0x6368('0xa');}}function log(_0x3ddacb,_0x55cc22,_0x36627f,_0x434c6c,_0x1cf191,_0x3ff1f7){loggers[_0x1cf191[_0x6368('0xb')]()][_0x3ddacb](_0x6368('0xc'),_0x3ff1f7[_0x6368('0xd')](),_0x55cc22?_0x55cc22['id']:null,_0x55cc22?_0x55cc22[_0x6368('0xe')]:null,_0x55cc22?_0x55cc22[_0x6368('0xf')]:null,getInteractionId(_0x36627f,_0x434c6c,_0x1cf191),_0x36627f?JSON[_0x6368('0x10')](_0x36627f):_0x6368('0x11'));}function updateUser(_0x2a846c,_0x1a336c,_0x1348a8,_0x293495,_0x2bc7da){db[_[_0x6368('0x8')](_0x293495)+_0x6368('0x12')]['findOne']({'where':{'id':getInteractionId(_0x1a336c,_0x1348a8,_0x293495)}})[_0x6368('0x13')](function(_0x145edf){if(_0x145edf){return _0x145edf[_0x6368('0x14')]({'UserId':_0x2a846c?_0x2a846c['id']:null});}})['then'](function(_0xd29bc4){if(_0xd29bc4){log(_0x6368('0x15'),_0x2a846c,_0x1a336c,_0x1348a8,_0x293495,_0x2bc7da);}})[_0x6368('0x16')](function(){log(_0x6368('0x17'),_0x2a846c,_0x1a336c,_0x1348a8,_0x293495,_0x2bc7da);});}exports[_0x6368('0x18')]=function(_0x6d5b10,_0x5e52f4){return function(_0x1e9618,_0x458205,_0x5e07f6){var _0xd56cb0=_0x1e9618[_0x6368('0x19')];var _0x1a8df0={};var _0x113442=_0x1e9618['query'];if(_0x1a8df0){_0x1a8df0=_[_0x6368('0x1a')](_0x1e9618[_0x6368('0x1b')]);_0x1a8df0=_[_0x6368('0x1c')](_0x1a8df0,[_0x6368('0x1b'),_0x6368('0x1d'),_0x6368('0x1e'),_0x6368('0x1f'),_0x6368('0x20')]);}updateUser(_0xd56cb0,_0x1a8df0,_0x113442,_0x6d5b10,_0x5e52f4);_0x5e07f6(null);};}; \ No newline at end of file +var _0x4899=['Interaction','findOne','update','then','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null'];(function(_0x45c3ae,_0xf0f13b){var _0xbd19e9=function(_0x4a4503){while(--_0x4a4503){_0x45c3ae['push'](_0x45c3ae['shift']());}};_0xbd19e9(++_0xf0f13b);}(_0x4899,0xac));var _0x9489=function(_0x5d2632,_0x3492dc){_0x5d2632=_0x5d2632-0x0;var _0x34063a=_0x4899[_0x5d2632];return _0x34063a;};'use strict';var _=require(_0x9489('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x9489('0x1'))(_0x9489('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0x9489('0x3')),'sms':require(_0x9489('0x1'))(_0x9489('0x4')),'chat':require('../../config/logger')(_0x9489('0x5')),'whatsapp':require(_0x9489('0x1'))(_0x9489('0x6'))};function getInteractionId(_0xe64bd4,_0x3fbeec,_0x5c1612){if(_0xe64bd4&&_0xe64bd4[_[_0x9489('0x7')](_0x5c1612)+'InteractionId']){return _0xe64bd4[_[_0x9489('0x7')](_0x5c1612)+_0x9489('0x8')];}else if(_0xe64bd4&&_0xe64bd4['id']){return _0xe64bd4['id'];}else if(_0x3fbeec&&_0x3fbeec['id']){return _0x3fbeec['id'];}else{return _0x9489('0x9');}}function log(_0x3a2ce1,_0x4c81a5,_0x307087,_0x285d97,_0x40acb6,_0x4cf06f){loggers[_0x40acb6['toLowerCase']()][_0x3a2ce1](_0x9489('0xa'),_0x4cf06f[_0x9489('0xb')](),_0x4c81a5?_0x4c81a5['id']:null,_0x4c81a5?_0x4c81a5['name']:null,_0x4c81a5?_0x4c81a5[_0x9489('0xc')]:null,getInteractionId(_0x307087,_0x285d97,_0x40acb6),_0x307087?JSON['stringify'](_0x307087):_0x9489('0xd'));}function updateUser(_0x41f4c5,_0x3397b3,_0x2bf3b0,_0x56e865,_0x181a22){db[_[_0x9489('0x7')](_0x56e865)+_0x9489('0xe')][_0x9489('0xf')]({'where':{'id':getInteractionId(_0x3397b3,_0x2bf3b0,_0x56e865)}})['then'](function(_0x1008e8){if(_0x1008e8){return _0x1008e8[_0x9489('0x10')]({'UserId':_0x41f4c5?_0x41f4c5['id']:null});}})[_0x9489('0x11')](function(_0x2a2b4f){if(_0x2a2b4f){log(_0x9489('0x12'),_0x41f4c5,_0x3397b3,_0x2bf3b0,_0x56e865,_0x181a22);}})[_0x9489('0x13')](function(){log(_0x9489('0x14'),_0x41f4c5,_0x3397b3,_0x2bf3b0,_0x56e865,_0x181a22);});}exports[_0x9489('0x15')]=function(_0x3eef4f,_0x235ed2){return function(_0xfb20bd,_0xd8d6e2,_0x48f47d){var _0x28adad=_0xfb20bd[_0x9489('0x16')];var _0x40cfa5={};var _0x594dcd=_0xfb20bd[_0x9489('0x17')];if(_0x40cfa5){_0x40cfa5=_[_0x9489('0x18')](_0xfb20bd[_0x9489('0x19')]);_0x40cfa5=_[_0x9489('0x1a')](_0x40cfa5,[_0x9489('0x19'),_0x9489('0x1b'),_0x9489('0x1c'),_0x9489('0x1d'),_0x9489('0x1e')]);}updateUser(_0x28adad,_0x40cfa5,_0x594dcd,_0x3eef4f,_0x235ed2);_0x48f47d(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0c0ceff..0f0e8ef 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 _0x6d44=['admin','user','isUserLimit','util','composable-middleware','data1','license','split','createDecipher','aes-256-ctr','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x3d61d8,_0x4bb850){var _0x5dd47a=function(_0x21500f){while(--_0x21500f){_0x3d61d8['push'](_0x3d61d8['shift']());}};_0x5dd47a(++_0x4bb850);}(_0x6d44,0x198));var _0x46d4=function(_0x37d5ff,_0x5ee83b){_0x37d5ff=_0x37d5ff-0x0;var _0x146b37=_0x6d44[_0x37d5ff];return _0x146b37;};'use strict';var crypto=require('crypto');var util=require(_0x46d4('0x0'));var compose=require(_0x46d4('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x12cf36,_0x29f0bc){if(_0x12cf36&&_0x29f0bc){if(_0x29f0bc[_0x46d4('0x2')]&&_0x29f0bc[_0x46d4('0x3')]){var _0xdb1584=_0x29f0bc[_0x46d4('0x2')];var _0x2435c4=_0x29f0bc[_0x46d4('0x3')];var _0x5d9dae=_0xdb1584[_0x46d4('0x4')]('-')[0x4];var _0x12d6e8=_0xdb1584[_0x46d4('0x4')]('-')[0x0];var _0x5c17ad=crypto[_0x46d4('0x5')](_0x46d4('0x6'),util['format']('%s:%s:%s',_0x5d9dae,_0xdb1584,_0x12d6e8));var _0x5ba8d1=_0x5c17ad[_0x46d4('0x7')](_0x2435c4,'base64',_0x46d4('0x8'));_0x5ba8d1+=_0x5c17ad[_0x46d4('0x9')](_0x46d4('0x8'));var _0x5579a9=JSON[_0x46d4('0xa')](_0x5ba8d1);return _0x5579a9[_0x46d4('0xb')](_0x12cf36)?_0x5579a9[_0x12cf36]:null;}}return null;}function isLimit(_0x5f2154,_0x336800,_0x43de3e,_0x1a435b){var _0x275c32=_0x336800;return compose()[_0x46d4('0xc')](function(_0x211189,_0x21d68e,_0xe41ff4){return db[_0x46d4('0xd')][_0x46d4('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x46d4('0xf')](function(_0x407613){var _0x416670=getValueFromLicense(_0x5f2154,_0x407613);return _0x416670?_0x416670:_0x275c32;})['then'](function(_0x55d34b){_0x275c32=_0x55d34b;return _0x43de3e[_0x46d4('0x10')](_0x1a435b);})['then'](function(_0x59749e){if(_0x59749e>=_0x275c32){return _0x21d68e[_0x46d4('0x11')](0x193)[_0x46d4('0x12')]({'message':util[_0x46d4('0x13')](_0x46d4('0x14'),_0x5f2154)});}_0xe41ff4();})[_0x46d4('0x15')](function(_0x5d3e3b){_0xe41ff4(_0x5d3e3b);});});}function isUserLimit(){return isLimit(_0x46d4('0x16'),0x1,db[_0x46d4('0x17')],{'where':{'$or':[{'role':_0x46d4('0x18')},{'role':_0x46d4('0x19')}]}});}exports[_0x46d4('0x1a')]=isUserLimit; \ No newline at end of file +var _0x64dd=['utf8','use','License','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','final'];(function(_0x29d8fb,_0x2ac526){var _0x43362d=function(_0x3ef2b8){while(--_0x3ef2b8){_0x29d8fb['push'](_0x29d8fb['shift']());}};_0x43362d(++_0x2ac526);}(_0x64dd,0xc3));var _0xd64d=function(_0x47a824,_0x233769){_0x47a824=_0x47a824-0x0;var _0x59e39f=_0x64dd[_0x47a824];return _0x59e39f;};'use strict';var crypto=require(_0xd64d('0x0'));var util=require(_0xd64d('0x1'));var compose=require(_0xd64d('0x2'));var db=require(_0xd64d('0x3'))['db'];var config=require(_0xd64d('0x4'));function getValueFromLicense(_0x5d7848,_0x2b4d5e){if(_0x5d7848&&_0x2b4d5e){if(_0x2b4d5e[_0xd64d('0x5')]&&_0x2b4d5e[_0xd64d('0x6')]){var _0x3efceb=_0x2b4d5e[_0xd64d('0x5')];var _0x4fc106=_0x2b4d5e[_0xd64d('0x6')];var _0x19d02e=_0x3efceb[_0xd64d('0x7')]('-')[0x4];var _0x14a725=_0x3efceb['split']('-')[0x0];var _0x40189d=crypto[_0xd64d('0x8')]('aes-256-ctr',util[_0xd64d('0x9')](_0xd64d('0xa'),_0x19d02e,_0x3efceb,_0x14a725));var _0x343c95=_0x40189d[_0xd64d('0xb')](_0x4fc106,'base64','utf8');_0x343c95+=_0x40189d[_0xd64d('0xc')](_0xd64d('0xd'));var _0x151601=JSON['parse'](_0x343c95);return _0x151601['hasOwnProperty'](_0x5d7848)?_0x151601[_0x5d7848]:null;}}return null;}function isLimit(_0x18b369,_0x1f732b,_0x152902,_0x24aed6){var _0x61b248=_0x1f732b;return compose()[_0xd64d('0xe')](function(_0x44bea6,_0x5168f8,_0x4f03a2){return db[_0xd64d('0xf')][_0xd64d('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xd64d('0x11')](function(_0x2c94bb){var _0x5ccb16=getValueFromLicense(_0x18b369,_0x2c94bb);return _0x5ccb16?_0x5ccb16:_0x61b248;})[_0xd64d('0x11')](function(_0x580362){_0x61b248=_0x580362;return _0x152902['count'](_0x24aed6);})[_0xd64d('0x11')](function(_0x115c4b){if(_0x115c4b>=_0x61b248){return _0x5168f8['status'](0x193)[_0xd64d('0x12')]({'message':util[_0xd64d('0x9')](_0xd64d('0x13'),_0x18b369)});}_0x4f03a2();})[_0xd64d('0x14')](function(_0x4dd7d0){_0x4f03a2(_0x4dd7d0);});});}function isUserLimit(){return isLimit(_0xd64d('0x15'),0x1,db[_0xd64d('0x16')],{'where':{'$or':[{'role':_0xd64d('0x17')},{'role':_0xd64d('0x18')}]}});}exports[_0xd64d('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bfb3927..07442d0 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 _0xe119=['format','castTo','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$substring','shift','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','match','forEach','filter','indexOf','map','conditions','buildExpression','operator','$eq','value','includes','$gt','$lte','add','days'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xe119,0xca));var _0x9e11=function(_0x32d5e5,_0x37d2f4){_0x32d5e5=_0x32d5e5-0x0;var _0x960501=_0xe119[_0x32d5e5];return _0x960501;};'use strict';var _=require(_0x9e11('0x0'));var moment=require(_0x9e11('0x1'));exports[_0x9e11('0x2')]=function(_0x3af15f){var _0x32f765={'conditions':[]};_0x32f765[_0x9e11('0x3')]=_['startsWith'](_0x3af15f,_0x9e11('0x4'))?'or':_0x9e11('0x5');var _0x108c25=_0x3af15f[_0x9e11('0x6')](_0x9e11('0x7'),'')[_0x9e11('0x6')]('[$or]','')[_0x9e11('0x8')]('||');for(var _0x1bdee4=0x0;_0x1bdee4<_0x108c25[_0x9e11('0x9')];_0x1bdee4++){var _0x527ebd=_0x108c25[_0x1bdee4][_0x9e11('0x8')](':=');var _0xf8be55=_0x527ebd[0x0];var _0x17b23f=_0x527ebd[_0x9e11('0xa')](0x1);_0x17b23f['forEach'](function(_0x4de6e9){var _0x56c19d=_0x4de6e9[_0x9e11('0x8')]('[')['shift']();var _0x86c562=_0x4de6e9[_0x9e11('0xb')](/\[(.*?)\]/g);_0x86c562[_0x9e11('0xc')](function(_0x45f950){var _0x405213=_0x45f950[_0x9e11('0x8')]('[')[_0x9e11('0xd')](function(_0x37dc07){return _0x37dc07[_0x9e11('0xe')](']')>-0x1;})[_0x9e11('0xf')](function(_0x457fc5){return _0x457fc5[_0x9e11('0x8')](']')[0x0];})[0x0];_0x32f765[_0x9e11('0x10')]['push']({'field':_0xf8be55,'operator':_0x56c19d,'value':_0x405213});});});}return _0x32f765;};exports[_0x9e11('0x11')]=function(_0x49fd5f,_0xa012ce,_0x1b0018){var _0x1ec4d3={};if(_0xa012ce==='DATE'){if(_0x1b0018[_0x9e11('0x12')]===_0x9e11('0x13')){_0x1b0018[_0x9e11('0x12')]='$between';_0x1b0018['value']+=','+_0x1b0018[_0x9e11('0x14')];}else if(_[_0x9e11('0x15')]([_0x9e11('0x16'),_0x9e11('0x17')],_0x1b0018[_0x9e11('0x12')])){_0x1b0018[_0x9e11('0x14')]=moment(_0x1b0018[_0x9e11('0x14')])[_0x9e11('0x18')](0x1,_0x9e11('0x19'))[_0x9e11('0x1a')]('YYYY-MM-DD');}}if(_0x1b0018[_0x9e11('0x1b')]){_0xa012ce=_0x1b0018[_0x9e11('0x1b')];_0x1ec4d3['text']='CAST('+_0x49fd5f+'.'+_0x1b0018[_0x9e11('0x1c')]+_0x9e11('0x1d')+_0x1b0018[_0x9e11('0x1b')]+')\x20'+parseOperator(_0x1b0018[_0x9e11('0x12')]);}else{_0x1ec4d3[_0x9e11('0x1e')]=_0x49fd5f+'.'+_0x1b0018[_0x9e11('0x1c')]+'\x20'+parseOperator(_0x1b0018[_0x9e11('0x12')]);}if(_[_0x9e11('0x15')]([_0x9e11('0x1f'),_0x9e11('0x20')],_0x1b0018['operator']))_0x1ec4d3[_0x9e11('0x1e')]='('+_0x1ec4d3[_0x9e11('0x1e')]+_0x9e11('0x21')+_0x49fd5f+'.'+_0x1b0018[_0x9e11('0x1c')]+_0x9e11('0x22');_0x1ec4d3[_0x9e11('0x14')]=parseValue(_0xa012ce,_0x1b0018[_0x9e11('0x12')],_0x1b0018['value']);return _0x1ec4d3;};function parseOperator(_0x192ba7){var _0x3222e5;switch(_0x192ba7){case _0x9e11('0x23'):_0x3222e5=_0x9e11('0x24');break;case'$notIn':_0x3222e5=_0x9e11('0x25');break;case _0x9e11('0x13'):_0x3222e5='=\x20?';break;case'$ne':_0x3222e5=_0x9e11('0x26');break;case'$substring':case _0x9e11('0x27'):case _0x9e11('0x28'):_0x3222e5=_0x9e11('0x29');break;case _0x9e11('0x2a'):_0x3222e5=_0x9e11('0x2b');break;case _0x9e11('0x16'):_0x3222e5=_0x9e11('0x2c');break;case _0x9e11('0x17'):_0x3222e5=_0x9e11('0x2d');break;case _0x9e11('0x2e'):_0x3222e5=_0x9e11('0x2f');break;case _0x9e11('0x30'):_0x3222e5=_0x9e11('0x31');break;}return _0x3222e5;}function parseValue(_0x14c2e3,_0x13d27c,_0x4469b7){var _0x2e582e={'start':undefined,'end':undefined};switch(_0x13d27c){case _0x9e11('0x23'):case _0x9e11('0x20'):_0x2e582e[_0x9e11('0x32')]=_0x4469b7[_0x9e11('0x8')](',');break;case _0x9e11('0x33'):_0x2e582e['start']='%'+_0x4469b7+'%';break;case _0x9e11('0x27'):_0x2e582e[_0x9e11('0x32')]=_0x4469b7+'%';break;case _0x9e11('0x28'):_0x2e582e['start']='%'+_0x4469b7;break;case'$between':var _0x1d7438=_0x4469b7[_0x9e11('0x8')](',');var _0x4469b7=_0x1d7438[_0x9e11('0x34')]();var _0x3c9d36=_0x1d7438[_0x9e11('0x35')]();if(_0x14c2e3==='DATE'){_0x4469b7=moment(_0x4469b7)[_0x9e11('0x36')](0x0,!![])['format']();_0x3c9d36=moment(_0x3c9d36)[_0x9e11('0x36')](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x9e11('0x37'))[_0x9e11('0x18')](0x3b,_0x9e11('0x38'))[_0x9e11('0x1a')]();}_0x2e582e={'start':_0x4469b7,'end':_0x3c9d36};break;default:_0x2e582e[_0x9e11('0x32')]=_0x4469b7;break;}return _0x2e582e;} \ No newline at end of file +var _0x7212=['parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','YYYY-MM-DD','castTo','text','field','\x20AS\x20','includes','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$startsWith','LIKE\x20?','<\x20?','>\x20?','$lte','$gte','>=\x20?','start','$substring','$endsWith','shift','format','utcOffset','minutes','seconds','lodash','moment'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7212,0xa3));var _0x2721=function(_0x2fe8a6,_0x5e1f6c){_0x2fe8a6=_0x2fe8a6-0x0;var _0x411368=_0x7212[_0x2fe8a6];return _0x411368;};'use strict';var _=require(_0x2721('0x0'));var moment=require(_0x2721('0x1'));exports[_0x2721('0x2')]=function(_0x129438){var _0x2d3b53={'conditions':[]};_0x2d3b53[_0x2721('0x3')]=_[_0x2721('0x4')](_0x129438,_0x2721('0x5'))?'or':_0x2721('0x6');var _0x170f87=_0x129438[_0x2721('0x7')](_0x2721('0x8'),'')[_0x2721('0x7')](_0x2721('0x5'),'')[_0x2721('0x9')]('||');for(var _0xe07cdb=0x0;_0xe07cdb<_0x170f87[_0x2721('0xa')];_0xe07cdb++){var _0x139a3f=_0x170f87[_0xe07cdb][_0x2721('0x9')](':=');var _0x1d27c5=_0x139a3f[0x0];var _0x4f84b2=_0x139a3f[_0x2721('0xb')](0x1);_0x4f84b2[_0x2721('0xc')](function(_0x5099ae){var _0x56f935=_0x5099ae['split']('[')['shift']();var _0x4e3d15=_0x5099ae[_0x2721('0xd')](/\[(.*?)\]/g);_0x4e3d15[_0x2721('0xc')](function(_0x399be0){var _0x281e72=_0x399be0[_0x2721('0x9')]('[')[_0x2721('0xe')](function(_0x794495){return _0x794495['indexOf'](']')>-0x1;})[_0x2721('0xf')](function(_0x3e5182){return _0x3e5182['split'](']')[0x0];})[0x0];_0x2d3b53[_0x2721('0x10')][_0x2721('0x11')]({'field':_0x1d27c5,'operator':_0x56f935,'value':_0x281e72});});});}return _0x2d3b53;};exports[_0x2721('0x12')]=function(_0x16acd9,_0x10ae4a,_0x2a2630){var _0x5c4639={};if(_0x10ae4a===_0x2721('0x13')){if(_0x2a2630[_0x2721('0x14')]===_0x2721('0x15')){_0x2a2630[_0x2721('0x14')]=_0x2721('0x16');_0x2a2630[_0x2721('0x17')]+=','+_0x2a2630[_0x2721('0x17')];}else if(_['includes']([_0x2721('0x18'),'$lte'],_0x2a2630[_0x2721('0x14')])){_0x2a2630[_0x2721('0x17')]=moment(_0x2a2630[_0x2721('0x17')])[_0x2721('0x19')](0x1,'days')['format'](_0x2721('0x1a'));}}if(_0x2a2630[_0x2721('0x1b')]){_0x10ae4a=_0x2a2630[_0x2721('0x1b')];_0x5c4639[_0x2721('0x1c')]='CAST('+_0x16acd9+'.'+_0x2a2630[_0x2721('0x1d')]+_0x2721('0x1e')+_0x2a2630[_0x2721('0x1b')]+')\x20'+parseOperator(_0x2a2630['operator']);}else{_0x5c4639[_0x2721('0x1c')]=_0x16acd9+'.'+_0x2a2630['field']+'\x20'+parseOperator(_0x2a2630['operator']);}if(_[_0x2721('0x1f')]([_0x2721('0x20'),'$notIn'],_0x2a2630[_0x2721('0x14')]))_0x5c4639[_0x2721('0x1c')]='('+_0x5c4639[_0x2721('0x1c')]+_0x2721('0x21')+_0x16acd9+'.'+_0x2a2630['field']+_0x2721('0x22');_0x5c4639[_0x2721('0x17')]=parseValue(_0x10ae4a,_0x2a2630[_0x2721('0x14')],_0x2a2630[_0x2721('0x17')]);return _0x5c4639;};function parseOperator(_0x55989f){var _0xbe9386;switch(_0x55989f){case _0x2721('0x23'):_0xbe9386=_0x2721('0x24');break;case _0x2721('0x25'):_0xbe9386=_0x2721('0x26');break;case _0x2721('0x15'):_0xbe9386=_0x2721('0x27');break;case _0x2721('0x20'):_0xbe9386='<>\x20?';break;case'$substring':case _0x2721('0x28'):case'$endsWith':_0xbe9386=_0x2721('0x29');break;case'$lt':_0xbe9386=_0x2721('0x2a');break;case _0x2721('0x18'):_0xbe9386=_0x2721('0x2b');break;case _0x2721('0x2c'):_0xbe9386='<=\x20?';break;case _0x2721('0x2d'):_0xbe9386=_0x2721('0x2e');break;case _0x2721('0x16'):_0xbe9386='BETWEEN\x20?\x20AND\x20?';break;}return _0xbe9386;}function parseValue(_0x246549,_0x59464a,_0x48edaa){var _0x40e906={'start':undefined,'end':undefined};switch(_0x59464a){case _0x2721('0x23'):case _0x2721('0x25'):_0x40e906[_0x2721('0x2f')]=_0x48edaa['split'](',');break;case _0x2721('0x30'):_0x40e906['start']='%'+_0x48edaa+'%';break;case _0x2721('0x28'):_0x40e906['start']=_0x48edaa+'%';break;case _0x2721('0x31'):_0x40e906[_0x2721('0x2f')]='%'+_0x48edaa;break;case _0x2721('0x16'):var _0x48e4e6=_0x48edaa[_0x2721('0x9')](',');var _0x48edaa=_0x48e4e6[_0x2721('0x32')]();var _0x145a9b=_0x48e4e6['pop']();if(_0x246549===_0x2721('0x13')){_0x48edaa=moment(_0x48edaa)['utcOffset'](0x0,!![])[_0x2721('0x33')]();_0x145a9b=moment(_0x145a9b)[_0x2721('0x34')](0x0,!![])[_0x2721('0x19')](0x17,'hours')['add'](0x3b,_0x2721('0x35'))[_0x2721('0x19')](0x3b,_0x2721('0x36'))[_0x2721('0x33')]();}_0x40e906={'start':_0x48edaa,'end':_0x145a9b};break;default:_0x40e906[_0x2721('0x2f')]=_0x48edaa;break;}return _0x40e906;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dfe7af1..0e25438 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 _0xfc92=['getFullTextValue','forEach','push','getOptions','query','$id','name','intersection','model','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','lower','options','moment','parse','includes','fields','split','filters','DATE','$gte','YYYY-MM-DD','utc','$lte','format','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isEmpty','isObject','isString','isNumeric','match','isEmail'];(function(_0xead859,_0x3682ba){var _0x5ae5bb=function(_0x3bae97){while(--_0x3bae97){_0xead859['push'](_0xead859['shift']());}};_0x5ae5bb(++_0x3682ba);}(_0xfc92,0x187));var _0x2fc9=function(_0x5a9666,_0x30bc94){_0x5a9666=_0x5a9666-0x0;var _0x28601f=_0xfc92[_0x5a9666];return _0x28601f;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x2fc9('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4434ee){var _0x43b6af=['ne'];try{var _0x274345=JSON[_0x2fc9('0x1')](_0x4434ee);var _0x16bbfd=Object['keys'](_0x274345)[0x0];return _0x43b6af[_0x2fc9('0x2')](_0x16bbfd);}catch(_0x27885b){return![];}}function getOperatorValue(_0xb4d119){var _0x28d614=JSON['parse'](_0xb4d119);var _0x5c5e4b=Object['keys'](_0x28d614)[0x0];var _0xdb3e6c=_0x28d614[_0x5c5e4b];return{['$'+_0x5c5e4b]:_0xdb3e6c};}exports[_0x2fc9('0x3')]=function(_0x4b6510){var _0x4197fc=null;if(_0x4b6510){_0x4197fc=_0x4b6510[_0x2fc9('0x4')](',');}return _0x4197fc;};exports[_0x2fc9('0x5')]=function(_0x1851ca,_0x32e498){var _0x43e7a1={};if(!_['isEmpty'](_0x1851ca)){_['forOwn'](_0x1851ca,function(_0x40d445,_0x5b6bf5){try{if(_0x32e498){var _0x1eaf5f=_['find'](_0x32e498,{'name':_0x5b6bf5})||{};if(hasSequelizeOperator(_0x40d445)){_0x43e7a1[_0x5b6bf5]=getOperatorValue(_0x40d445);}else if(_0x1eaf5f['type']===_0x2fc9('0x6')&&_['isPlainObject'](_0x40d445)){var _0xfa906=JSON[_0x2fc9('0x1')](_0x40d445);var _0x588b43={'$gte':moment(moment(_0xfa906[_0x2fc9('0x7')])['format'](_0x2fc9('0x8')))[_0x2fc9('0x9')]()['format'](),'$lte':moment(moment(_0xfa906[_0x2fc9('0xa')])[_0x2fc9('0xb')]('YYYY-MM-DD'))[_0x2fc9('0x9')]()[_0x2fc9('0xc')](0x1,'s')[_0x2fc9('0xb')]()};_0x43e7a1[_0x5b6bf5]=_0x588b43;}else if(_0x1eaf5f['name']===_0x2fc9('0xd')){_0x43e7a1[_0x5b6bf5]=_0x40d445;}else{_0x43e7a1[_0x5b6bf5]=_[_0x2fc9('0xe')](_0x40d445)?_0x40d445:JSON[_0x2fc9('0x1')](_0x40d445);}}else{_0x43e7a1[_0x5b6bf5]=_[_0x2fc9('0xe')](_0x40d445)?_0x40d445:JSON[_0x2fc9('0x1')](_0x40d445);}}catch(_0x339349){_0x43e7a1[_0x5b6bf5]=_0x40d445['split'](',');}});}return _0x43e7a1;};exports[_0x2fc9('0xf')]=function(_0x376f2c){_0x376f2c=parseInt(_0x376f2c,0xa);if(!_0x376f2c||_0x376f2c<0x0){_0x376f2c=LIMIT_VALUE;}return _0x376f2c;};exports[_0x2fc9('0x10')]=function(_0x34e543){_0x34e543=parseInt(_0x34e543,0xa);if(!_0x34e543||_0x34e543<0x0){_0x34e543=0x0;}return _0x34e543;};exports[_0x2fc9('0x11')]=function(_0x47068d){var _0x1b86a6,_0x1adbb4=null;if(_0x47068d){_0x1b86a6=_0x47068d[_0x2fc9('0x4')](',');_0x1adbb4=_[_0x2fc9('0x12')](_0x1b86a6,function(_0xa2edab){if(_0xa2edab[_0x2fc9('0x13')]('-')===0x0){return[_0xa2edab===_0x2fc9('0x14')?sequelize[_0x2fc9('0x15')](sequelize[_0x2fc9('0x16')]('priority'),_0x2fc9('0x17')):_0xa2edab[_0x2fc9('0x18')](0x1),_0x2fc9('0x19')];}else{return[_0xa2edab==='priority'?sequelize['cast'](sequelize[_0x2fc9('0x16')]('priority'),_0x2fc9('0x17')):_0xa2edab,'ASC'];}});}return _0x1adbb4;};exports[_0x2fc9('0x1a')]=function(_0x1980f2,_0x110495){if(_[_0x2fc9('0x1b')](_0x1980f2)){return _0x1980f2;}if(_[_0x2fc9('0xe')](_0x1980f2)){for(var _0x558d68=0x0;_0x558d68<_0x1980f2['length'];_0x558d68+=0x1){_0x1980f2[_0x558d68]=this[_0x2fc9('0x1a')](_0x1980f2[_0x558d68],_0x110495);}return _0x1980f2;}if(!_[_0x2fc9('0x1c')](_0x1980f2)){return _0x1980f2;}if(_[_0x2fc9('0x1d')](_0x110495)){_0x110495=[_0x110495];}if(!_['isArray'](_0x110495)){return _0x1980f2;}for(var _0x402cec=0x0;_0x402cec<_0x110495['length'];_0x402cec+=0x1){_['unset'](_0x1980f2,_0x110495[_0x402cec]);}for(var _0x40d426 in _0x1980f2){if(_0x1980f2['hasOwnProperty'](_0x40d426)){_0x1980f2[_0x40d426]=this[_0x2fc9('0x1a')](_0x1980f2[_0x40d426],_0x110495);}}return _0x1980f2;};exports[_0x2fc9('0x1e')]=function(_0x402118){return _0x402118[_0x2fc9('0x1f')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x2fc9('0x20')]=function(_0x475cf1){return _0x475cf1['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x2fc9('0x21')]=function(_0xee0840){var _0xcdda81=[];_0xee0840[_0x2fc9('0x4')](/[ ,]+/)[_0x2fc9('0x22')](function(_0x3bf7b2){_0x3bf7b2=_0x3bf7b2['replace'](/([^:]")"+/g,'$1');_0x3bf7b2='+'+_0x3bf7b2+'*';if(_0x3bf7b2[_0x2fc9('0x2')]('@'))_0x3bf7b2='\x22'+_0x3bf7b2+'\x22';_0xcdda81[_0x2fc9('0x23')](_0x3bf7b2);});return _0xcdda81['join']('\x20');};exports[_0x2fc9('0x24')]=function(_0x284295,_0x4f5325,_0xdc88cb){var _0x401b19={},_0x28c2a0={};if(_0x4f5325[_0x2fc9('0x25')]['$id']){_0x4f5325[_0x2fc9('0x25')]['id']=_0x4f5325[_0x2fc9('0x25')]['$id'];delete _0x4f5325['query'][_0x2fc9('0x26')];}_0x401b19['model']=_['map'](_0x284295,_0x2fc9('0x27'));_0x401b19[_0x2fc9('0x25')]=_['keys'](_0x4f5325[_0x2fc9('0x25')]);_0x401b19['filters']=_[_0x2fc9('0x28')](_0x401b19[_0x2fc9('0x29')],_0x401b19[_0x2fc9('0x25')]);_0x28c2a0[_0x2fc9('0x2a')]=_[_0x2fc9('0x28')](_0x401b19[_0x2fc9('0x29')],this['fields'](_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0x3')]));_0x28c2a0[_0x2fc9('0x2a')]=_0x28c2a0[_0x2fc9('0x2a')][_0x2fc9('0x2b')]?_0x28c2a0['attributes']:_0x401b19[_0x2fc9('0x29')];if(!_0x4f5325['query'][_0x2fc9('0x2c')]('nolimit')){_0x28c2a0[_0x2fc9('0xf')]=this['limit'](_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0xf')]);_0x28c2a0[_0x2fc9('0x10')]=this[_0x2fc9('0x10')](_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0x10')]);}_0x28c2a0[_0x2fc9('0x2d')]=this[_0x2fc9('0x11')](_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0x11')]);_0x28c2a0[_0x2fc9('0x2e')]=this['filters'](_[_0x2fc9('0x2f')](_0x4f5325['query'],_0x401b19['filters']),_0x284295);if(_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0x30')]){_0x28c2a0[_0x2fc9('0x2e')]=_[_0x2fc9('0x31')](_0x28c2a0[_0x2fc9('0x2e')],{'$or':_[_0x2fc9('0x12')](_0x284295,function(_0x5ef669){if(_0x5ef669['type']!==_0x2fc9('0x32')){if(_0xdc88cb){return sequelize[_0x2fc9('0x2e')](sequelize['fn'](_0x2fc9('0x33'),sequelize[_0x2fc9('0x16')](_0x5ef669['name'])),{'$like':sequelize['fn'](_0x2fc9('0x33'),'%'+_0x4f5325[_0x2fc9('0x25')][_0x2fc9('0x30')]+'%')});}else{var _0x39c073={};_0x39c073[_0x5ef669['name']]={'$like':'%'+_0x4f5325[_0x2fc9('0x25')]['filter']+'%'};return _0x39c073;}}})});}_0x28c2a0=_[_0x2fc9('0x31')]({},_0x28c2a0,_0x4f5325[_0x2fc9('0x34')]);return _0x28c2a0;}; \ No newline at end of file +var _0x73fd=['VIRTUAL','lower','filter','options','lodash','sequelize','moment','parse','includes','keys','split','filters','isEmpty','forOwn','find','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','isArray','limit','sort','map','indexOf','priority','unsigned','substr','DESC','cast','col','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','offset','order','where','pick','merge','type'];(function(_0x14e17c,_0x5638c9){var _0x2b322f=function(_0xe3bdeb){while(--_0xe3bdeb){_0x14e17c['push'](_0x14e17c['shift']());}};_0x2b322f(++_0x5638c9);}(_0x73fd,0xfc));var _0xd73f=function(_0x3b4585,_0x16a9c2){_0x3b4585=_0x3b4585-0x0;var _0x551be9=_0x73fd[_0x3b4585];return _0x551be9;};'use strict';var _=require(_0xd73f('0x0'));var sequelize=require(_0xd73f('0x1'));var moment=require(_0xd73f('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5b2305){var _0x2c6bec=['ne'];try{var _0x313b77=JSON[_0xd73f('0x3')](_0x5b2305);var _0x4e0f59=Object['keys'](_0x313b77)[0x0];return _0x2c6bec[_0xd73f('0x4')](_0x4e0f59);}catch(_0x1c08cb){return![];}}function getOperatorValue(_0x4985e8){var _0x1951a4=JSON[_0xd73f('0x3')](_0x4985e8);var _0x516e9c=Object[_0xd73f('0x5')](_0x1951a4)[0x0];var _0x2795c4=_0x1951a4[_0x516e9c];return{['$'+_0x516e9c]:_0x2795c4};}exports['fields']=function(_0x338f19){var _0x571671=null;if(_0x338f19){_0x571671=_0x338f19[_0xd73f('0x6')](',');}return _0x571671;};exports[_0xd73f('0x7')]=function(_0x9cd970,_0xe5594){var _0xac6541={};if(!_[_0xd73f('0x8')](_0x9cd970)){_[_0xd73f('0x9')](_0x9cd970,function(_0xe50db9,_0x1c07a2){try{if(_0xe5594){var _0x359510=_[_0xd73f('0xa')](_0xe5594,{'name':_0x1c07a2})||{};if(hasSequelizeOperator(_0xe50db9)){_0xac6541[_0x1c07a2]=getOperatorValue(_0xe50db9);}else if(_0x359510['type']==='DATE'&&_[_0xd73f('0xb')](_0xe50db9)){var _0x3b470b=JSON[_0xd73f('0x3')](_0xe50db9);var _0x31bd77={'$gte':moment(moment(_0x3b470b[_0xd73f('0xc')])[_0xd73f('0xd')]('YYYY-MM-DD'))[_0xd73f('0xe')]()[_0xd73f('0xd')](),'$lte':moment(moment(_0x3b470b[_0xd73f('0xf')])['format'](_0xd73f('0x10')))[_0xd73f('0xe')]()[_0xd73f('0x11')](0x1,'s')[_0xd73f('0xd')]()};_0xac6541[_0x1c07a2]=_0x31bd77;}else if(_0x359510[_0xd73f('0x12')]==='uniqueid'){_0xac6541[_0x1c07a2]=_0xe50db9;}else{_0xac6541[_0x1c07a2]=_[_0xd73f('0x13')](_0xe50db9)?_0xe50db9:JSON[_0xd73f('0x3')](_0xe50db9);}}else{_0xac6541[_0x1c07a2]=_[_0xd73f('0x13')](_0xe50db9)?_0xe50db9:JSON[_0xd73f('0x3')](_0xe50db9);}}catch(_0x2d3c5f){_0xac6541[_0x1c07a2]=_0xe50db9['split'](',');}});}return _0xac6541;};exports[_0xd73f('0x14')]=function(_0x316420){_0x316420=parseInt(_0x316420,0xa);if(!_0x316420||_0x316420<0x0){_0x316420=LIMIT_VALUE;}return _0x316420;};exports['offset']=function(_0x4c9043){_0x4c9043=parseInt(_0x4c9043,0xa);if(!_0x4c9043||_0x4c9043<0x0){_0x4c9043=0x0;}return _0x4c9043;};exports[_0xd73f('0x15')]=function(_0x4a1844){var _0x720997,_0x24cf04=null;if(_0x4a1844){_0x720997=_0x4a1844[_0xd73f('0x6')](',');_0x24cf04=_[_0xd73f('0x16')](_0x720997,function(_0x5e6d0a){if(_0x5e6d0a[_0xd73f('0x17')]('-')===0x0){return[_0x5e6d0a===_0xd73f('0x18')?sequelize['cast'](sequelize['col'](_0xd73f('0x18')),_0xd73f('0x19')):_0x5e6d0a[_0xd73f('0x1a')](0x1),_0xd73f('0x1b')];}else{return[_0x5e6d0a==='priority'?sequelize[_0xd73f('0x1c')](sequelize[_0xd73f('0x1d')]('priority'),_0xd73f('0x19')):_0x5e6d0a,'ASC'];}});}return _0x24cf04;};exports[_0xd73f('0x1e')]=function(_0x484080,_0x14090c){if(_[_0xd73f('0x8')](_0x484080)){return _0x484080;}if(_[_0xd73f('0x13')](_0x484080)){for(var _0x563e2b=0x0;_0x563e2b<_0x484080[_0xd73f('0x1f')];_0x563e2b+=0x1){_0x484080[_0x563e2b]=this['omit'](_0x484080[_0x563e2b],_0x14090c);}return _0x484080;}if(!_[_0xd73f('0x20')](_0x484080)){return _0x484080;}if(_[_0xd73f('0x21')](_0x14090c)){_0x14090c=[_0x14090c];}if(!_[_0xd73f('0x13')](_0x14090c)){return _0x484080;}for(var _0x4ef9d0=0x0;_0x4ef9d0<_0x14090c['length'];_0x4ef9d0+=0x1){_[_0xd73f('0x22')](_0x484080,_0x14090c[_0x4ef9d0]);}for(var _0x3d1922 in _0x484080){if(_0x484080[_0xd73f('0x23')](_0x3d1922)){_0x484080[_0x3d1922]=this[_0xd73f('0x1e')](_0x484080[_0x3d1922],_0x14090c);}}return _0x484080;};exports[_0xd73f('0x24')]=function(_0x5a9ab6){return _0x5a9ab6[_0xd73f('0x25')](RegExp(_0xd73f('0x26')))?!![]:![];};exports[_0xd73f('0x27')]=function(_0x5dbafe){return _0x5dbafe[_0xd73f('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3cb0c4){var _0x3c0997=[];_0x3cb0c4[_0xd73f('0x6')](/[ ,]+/)[_0xd73f('0x28')](function(_0x4de6b1){_0x4de6b1=_0x4de6b1[_0xd73f('0x29')](/([^:]")"+/g,'$1');_0x4de6b1='+'+_0x4de6b1+'*';if(_0x4de6b1[_0xd73f('0x4')]('@'))_0x4de6b1='\x22'+_0x4de6b1+'\x22';_0x3c0997[_0xd73f('0x2a')](_0x4de6b1);});return _0x3c0997[_0xd73f('0x2b')]('\x20');};exports[_0xd73f('0x2c')]=function(_0x3b8e80,_0x1f69fc,_0x4d4d00){var _0x3dd2ec={},_0x1d1cd6={};if(_0x1f69fc[_0xd73f('0x2d')][_0xd73f('0x2e')]){_0x1f69fc['query']['id']=_0x1f69fc['query'][_0xd73f('0x2e')];delete _0x1f69fc[_0xd73f('0x2d')][_0xd73f('0x2e')];}_0x3dd2ec[_0xd73f('0x2f')]=_[_0xd73f('0x16')](_0x3b8e80,_0xd73f('0x12'));_0x3dd2ec['query']=_[_0xd73f('0x5')](_0x1f69fc[_0xd73f('0x2d')]);_0x3dd2ec[_0xd73f('0x7')]=_[_0xd73f('0x30')](_0x3dd2ec[_0xd73f('0x2f')],_0x3dd2ec['query']);_0x1d1cd6[_0xd73f('0x31')]=_[_0xd73f('0x30')](_0x3dd2ec['model'],this[_0xd73f('0x32')](_0x1f69fc[_0xd73f('0x2d')]['fields']));_0x1d1cd6[_0xd73f('0x31')]=_0x1d1cd6['attributes'][_0xd73f('0x1f')]?_0x1d1cd6[_0xd73f('0x31')]:_0x3dd2ec[_0xd73f('0x2f')];if(!_0x1f69fc[_0xd73f('0x2d')][_0xd73f('0x23')](_0xd73f('0x33'))){_0x1d1cd6[_0xd73f('0x14')]=this[_0xd73f('0x14')](_0x1f69fc[_0xd73f('0x2d')][_0xd73f('0x14')]);_0x1d1cd6[_0xd73f('0x34')]=this[_0xd73f('0x34')](_0x1f69fc['query'][_0xd73f('0x34')]);}_0x1d1cd6[_0xd73f('0x35')]=this['sort'](_0x1f69fc[_0xd73f('0x2d')]['sort']);_0x1d1cd6[_0xd73f('0x36')]=this[_0xd73f('0x7')](_[_0xd73f('0x37')](_0x1f69fc[_0xd73f('0x2d')],_0x3dd2ec[_0xd73f('0x7')]),_0x3b8e80);if(_0x1f69fc[_0xd73f('0x2d')]['filter']){_0x1d1cd6[_0xd73f('0x36')]=_[_0xd73f('0x38')](_0x1d1cd6['where'],{'$or':_[_0xd73f('0x16')](_0x3b8e80,function(_0x3ca5b8){if(_0x3ca5b8[_0xd73f('0x39')]!==_0xd73f('0x3a')){if(_0x4d4d00){return sequelize['where'](sequelize['fn'](_0xd73f('0x3b'),sequelize[_0xd73f('0x1d')](_0x3ca5b8[_0xd73f('0x12')])),{'$like':sequelize['fn'](_0xd73f('0x3b'),'%'+_0x1f69fc[_0xd73f('0x2d')][_0xd73f('0x3c')]+'%')});}else{var _0xa696ad={};_0xa696ad[_0x3ca5b8[_0xd73f('0x12')]]={'$like':'%'+_0x1f69fc['query'][_0xd73f('0x3c')]+'%'};return _0xa696ad;}}})});}_0x1d1cd6=_[_0xd73f('0x38')]({},_0x1d1cd6,_0x1f69fc[_0xd73f('0x3d')]);return _0x1d1cd6;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e358cea..4f619ce 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4546=['cookie-parser','errorhandler','path','passport','cors','moment','./environment','get','env','production','set','appPath','root','public','development','test','join','use','json\x20replacer','split','static','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','express','body-parser','method-override'];(function(_0x1a0f78,_0x2e0158){var _0x1a14ca=function(_0x36973b){while(--_0x36973b){_0x1a0f78['push'](_0x1a0f78['shift']());}};_0x1a14ca(++_0x2e0158);}(_0x4546,0xbd));var _0x6454=function(_0x2b920f,_0x565f0d){_0x2b920f=_0x2b920f-0x0;var _0x376b72=_0x4546[_0x2b920f];return _0x376b72;};'use strict';var express=require(_0x6454('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x6454('0x1'));var methodOverride=require(_0x6454('0x2'));var cookieParser=require(_0x6454('0x3'));var errorHandler=require(_0x6454('0x4'));var path=require(_0x6454('0x5'));var passport=require(_0x6454('0x6'));var cors=require(_0x6454('0x7'));var moment=require(_0x6454('0x8'));var config=require(_0x6454('0x9'));var db=require('../mysqldb')['db'];exports['default']=function(_0x2c7b38){var _0x13f8cb=_0x2c7b38[_0x6454('0xa')](_0x6454('0xb'));if(_0x13f8cb===_0x6454('0xc')){_0x2c7b38[_0x6454('0xd')](_0x6454('0xe'),path['join'](config[_0x6454('0xf')],_0x6454('0x10')));}if(_0x13f8cb===_0x6454('0x11')||_0x13f8cb===_0x6454('0x12')){_0x2c7b38[_0x6454('0xd')]('appPath',path[_0x6454('0x13')](config[_0x6454('0xf')],'client'));_0x2c7b38[_0x6454('0x14')](errorHandler());}_0x2c7b38[_0x6454('0xd')](_0x6454('0x15'),function(_0x3aa880,_0x309389){if(this[_0x3aa880]instanceof Date){_0x309389=this[_0x3aa880]['toISOString']()[_0x6454('0x16')]('.')[0x0]+'Z';}return _0x309389;});_0x2c7b38[_0x6454('0x14')](express[_0x6454('0x17')](_0x2c7b38[_0x6454('0xa')]('appPath')));_0x2c7b38[_0x6454('0xd')]('views',config['root']+_0x6454('0x18'));_0x2c7b38[_0x6454('0x19')](_0x6454('0x1a'),require(_0x6454('0x1b'))[_0x6454('0x1c')]);_0x2c7b38['set']('view\x20engine',_0x6454('0x1a'));_0x2c7b38[_0x6454('0x14')](bodyParser[_0x6454('0x1d')]({'limit':_0x6454('0x1e'),'extended':!![]}));_0x2c7b38[_0x6454('0x14')](bodyParser[_0x6454('0x1f')]({'limit':'50mb'}));_0x2c7b38[_0x6454('0x14')](cors());_0x2c7b38[_0x6454('0x14')](methodOverride());_0x2c7b38[_0x6454('0x14')](cookieParser());_0x2c7b38[_0x6454('0x14')](passport['initialize']());}; \ No newline at end of file +var _0x13d9=['50mb','express','serve-favicon','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','test','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x13d9,0xd3));var _0x913d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13d9[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x913d('0x0'));var favicon=require(_0x913d('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x913d('0x2'));var cookieParser=require(_0x913d('0x3'));var errorHandler=require(_0x913d('0x4'));var path=require(_0x913d('0x5'));var passport=require(_0x913d('0x6'));var cors=require(_0x913d('0x7'));var moment=require(_0x913d('0x8'));var config=require(_0x913d('0x9'));var db=require(_0x913d('0xa'))['db'];exports[_0x913d('0xb')]=function(_0x3303cd){var _0x3cfb11=_0x3303cd[_0x913d('0xc')](_0x913d('0xd'));if(_0x3cfb11==='production'){_0x3303cd[_0x913d('0xe')](_0x913d('0xf'),path[_0x913d('0x10')](config[_0x913d('0x11')],_0x913d('0x12')));}if(_0x3cfb11===_0x913d('0x13')||_0x3cfb11===_0x913d('0x14')){_0x3303cd[_0x913d('0xe')](_0x913d('0xf'),path[_0x913d('0x10')](config[_0x913d('0x11')],'client'));_0x3303cd[_0x913d('0x15')](errorHandler());}_0x3303cd[_0x913d('0xe')](_0x913d('0x16'),function(_0x257eed,_0x5ed6ef){if(this[_0x257eed]instanceof Date){_0x5ed6ef=this[_0x257eed][_0x913d('0x17')]()[_0x913d('0x18')]('.')[0x0]+'Z';}return _0x5ed6ef;});_0x3303cd[_0x913d('0x15')](express[_0x913d('0x19')](_0x3303cd['get'](_0x913d('0xf'))));_0x3303cd[_0x913d('0xe')]('views',config[_0x913d('0x11')]+_0x913d('0x1a'));_0x3303cd[_0x913d('0x1b')](_0x913d('0x1c'),require(_0x913d('0x1d'))[_0x913d('0x1e')]);_0x3303cd[_0x913d('0xe')](_0x913d('0x1f'),_0x913d('0x1c'));_0x3303cd[_0x913d('0x15')](bodyParser[_0x913d('0x20')]({'limit':'50mb','extended':!![]}));_0x3303cd[_0x913d('0x15')](bodyParser[_0x913d('0x21')]({'limit':_0x913d('0x22')}));_0x3303cd['use'](cors());_0x3303cd[_0x913d('0x15')](methodOverride());_0x3303cd[_0x913d('0x15')](cookieParser());_0x3303cd[_0x913d('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e0b3225..d74a9ff 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 _0x6712=['00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','licenseToken','win32','utf8','replace','ipAddress','substring','lodash','crypto','execSync','../environment','keys','length','filter','family','IPv4','head','mac'];(function(_0x5eab69,_0x468a6e){var _0x354f2a=function(_0x4dde09){while(--_0x4dde09){_0x5eab69['push'](_0x5eab69['shift']());}};_0x354f2a(++_0x468a6e);}(_0x6712,0xb5));var _0x2671=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6712[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x2671('0x0'));var os=require('os');var crypto=require(_0x2671('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x2671('0x2')];var config=require(_0x2671('0x3'));function getInterfaces(){var _0x56b392=[];var _0x3babf7=os['networkInterfaces']();var _0x1bbe7c=_['orderBy'](_[_0x2671('0x4')](_0x3babf7));for(var _0x59251e=0x0;_0x59251e<_0x1bbe7c[_0x2671('0x5')];_0x59251e++){var _0x5e2701=_0x3babf7[_0x1bbe7c[_0x59251e]][_0x2671('0x6')](function(_0xfea9cc){return _0xfea9cc[_0x2671('0x7')]===_0x2671('0x8')&&_0xfea9cc['internal']===![];});_0x56b392=_0x56b392['concat'](_0x5e2701);}return _0x56b392;}function getFirstInterface(){var _0x121145=_[_0x2671('0x9')](getInterfaces());return{'macAddress':_0x121145&&_0x121145[_0x2671('0xa')]?_0x121145[_0x2671('0xa')]:_0x2671('0xb'),'ipAddress':_0x121145&&_0x121145[_0x2671('0xc')]?_0x121145[_0x2671('0xc')]:_0x2671('0xd')};}exports[_0x2671('0xe')]=getFirstInterface;function getCPUhash(){var _0x3d621c=_[_0x2671('0xf')](os[_0x2671('0x10')]()[_0x2671('0x11')](function(_0x305e67){return _0x305e67[_0x2671('0x12')];}))[_0x2671('0x13')](':');return crypto[_0x2671('0x14')](_0x2671('0x15'))[_0x2671('0x16')](_0x3d621c)[_0x2671('0x17')](_0x2671('0x18'));}exports[_0x2671('0x19')]=function(){var _0x533318=os['platform']();var _0x49a9bc=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x49a9bc['test'](config[_0x2671('0x1a')])){return config[_0x2671('0x1a')];}else if(_0x533318===_0x2671('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x2671('0x1c')})[_0x2671('0x1d')]('\x0d\x0a','');}else{var _0x2212af=getFirstInterface();var _0x857717=getCPUhash();var _0xbdb62c=_0x857717+'|'+os['hostname']()+'|'+_0x2212af['macAddress']+'|'+_0x2212af[_0x2671('0x1e')];var _0x3d4039=crypto[_0x2671('0x14')]('md5')['update'](_0xbdb62c)[_0x2671('0x17')](_0x2671('0x18'));return _0x3d4039[_0x2671('0x1f')](0x0,0x8)+'-'+_0x3d4039[_0x2671('0x1f')](0x8,0xc)+'-'+_0x3d4039[_0x2671('0x1f')](0xc,0x10)+'-'+_0x3d4039[_0x2671('0x1f')](0x10,0x14)+'-'+_0x3d4039[_0x2671('0x1f')](0x14);}}; \ No newline at end of file +var _0x1b86=['substring','lodash','bimedia-machine-uuid','../environment','orderBy','length','filter','family','IPv4','internal','concat','head','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress'];(function(_0x42c4c3,_0x268391){var _0x3bed55=function(_0x4d49eb){while(--_0x4d49eb){_0x42c4c3['push'](_0x42c4c3['shift']());}};_0x3bed55(++_0x268391);}(_0x1b86,0x121));var _0x61b8=function(_0x52c2f1,_0x36ae0c){_0x52c2f1=_0x52c2f1-0x0;var _0x4b0d51=_0x1b86[_0x52c2f1];return _0x4b0d51;};'use strict';var _=require(_0x61b8('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x61b8('0x1'));var exec=require('child_process')['execSync'];var config=require(_0x61b8('0x2'));function getInterfaces(){var _0x2c6dfa=[];var _0x52a7f8=os['networkInterfaces']();var _0x4c71cf=_[_0x61b8('0x3')](_['keys'](_0x52a7f8));for(var _0x47e6ae=0x0;_0x47e6ae<_0x4c71cf[_0x61b8('0x4')];_0x47e6ae++){var _0xc10e6b=_0x52a7f8[_0x4c71cf[_0x47e6ae]][_0x61b8('0x5')](function(_0x5ac753){return _0x5ac753[_0x61b8('0x6')]===_0x61b8('0x7')&&_0x5ac753[_0x61b8('0x8')]===![];});_0x2c6dfa=_0x2c6dfa[_0x61b8('0x9')](_0xc10e6b);}return _0x2c6dfa;}function getFirstInterface(){var _0xae79d2=_[_0x61b8('0xa')](getInterfaces());return{'macAddress':_0xae79d2&&_0xae79d2['mac']?_0xae79d2['mac']:_0x61b8('0xb'),'ipAddress':_0xae79d2&&_0xae79d2['address']?_0xae79d2['address']:_0x61b8('0xc')};}exports[_0x61b8('0xd')]=getFirstInterface;function getCPUhash(){var _0x5de977=_['orderBy'](os[_0x61b8('0xe')]()[_0x61b8('0xf')](function(_0x47ae5e){return _0x47ae5e['model'];}))[_0x61b8('0x10')](':');return crypto[_0x61b8('0x11')](_0x61b8('0x12'))[_0x61b8('0x13')](_0x5de977)[_0x61b8('0x14')](_0x61b8('0x15'));}exports['getUuid']=function(){var _0x38fc80=os[_0x61b8('0x16')]();var _0x424015=/[0-9a-f-]{36}/;if(config[_0x61b8('0x17')]&&_0x424015[_0x61b8('0x18')](config[_0x61b8('0x17')])){return config[_0x61b8('0x17')];}else if(_0x38fc80==='win32'){return exec(_0x61b8('0x19'),{'encoding':_0x61b8('0x1a')})[_0x61b8('0x1b')]('\x0d\x0a','');}else{var _0x140324=getFirstInterface();var _0x55c234=getCPUhash();var _0x134cd7=_0x55c234+'|'+os[_0x61b8('0x1c')]()+'|'+_0x140324[_0x61b8('0x1d')]+'|'+_0x140324[_0x61b8('0x1e')];var _0x31c91c=crypto['createHash'](_0x61b8('0x12'))[_0x61b8('0x13')](_0x134cd7)[_0x61b8('0x14')](_0x61b8('0x15'));return _0x31c91c[_0x61b8('0x1f')](0x0,0x8)+'-'+_0x31c91c[_0x61b8('0x1f')](0x8,0xc)+'-'+_0x31c91c[_0x61b8('0x1f')](0xc,0x10)+'-'+_0x31c91c[_0x61b8('0x1f')](0x10,0x14)+'-'+_0x31c91c['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index e4279ee..03ba26f 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 _0x71bc=['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','decryptString','days','error','message','finally','getUuid','License','findOrCreate','spread','default','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','exports','version','GET','then','catch','get','data1','active','info','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Changed'];(function(_0x1cd380,_0x524a44){var _0x5496a2=function(_0x3c52f2){while(--_0x3c52f2){_0x1cd380['push'](_0x1cd380['shift']());}};_0x5496a2(++_0x524a44);}(_0x71bc,0x82));var _0xc71b=function(_0x52fa2f,_0x52517a){_0x52fa2f=_0x52fa2f-0x0;var _0x4f499c=_0x71bc[_0x52fa2f];return _0x4f499c;};'use strict';var util=require('util');var moment=require(_0xc71b('0x0'));var rp=require(_0xc71b('0x1'));var BPromise=require(_0xc71b('0x2'));var pkginfo=require(_0xc71b('0x3'))(module,'version');var db=require(_0xc71b('0x4'))['db'];var encryptor=require(_0xc71b('0x5'));var hardware=require(_0xc71b('0x6'));var logger=require('../logger')(_0xc71b('0x7'));var HOST=_0xc71b('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5648f0){return new BPromise(function(_0x2674c3,_0xdec8f){var _0x173a23=util[_0xc71b('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x5648f0,module[_0xc71b('0xa')]['version']);if(oldToken){_0x173a23=util[_0xc71b('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5648f0,module[_0xc71b('0xa')][_0xc71b('0xb')],oldToken);}var _0x522693={'uri':_0x173a23,'method':_0xc71b('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x522693)[_0xc71b('0xd')](function(_0x2a5dbb){_0x2674c3(_0x2a5dbb);})[_0xc71b('0xe')](function(_0xe7d85f){_0xdec8f(_0xe7d85f);});});}function manageLicense(_0x183175,_0x3a3b7b){var _0x20e7f5=_0x3a3b7b[_0xc71b('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x20e7f5[_0xc71b('0x10')]!==_0x183175&&!_0x20e7f5['data2']){oldToken=_0x20e7f5['data1'];}httpRequest(_0x183175)[_0xc71b('0xd')](function(_0x25ee4d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25ee4d[_0xc71b('0x11')]){isOldTokenSent=![];if(!_0x20e7f5[_0xc71b('0x7')]&&_0x20e7f5[_0xc71b('0x7')]!=_0x25ee4d['license']||_0x20e7f5[_0xc71b('0x7')]&&_0x20e7f5['data2']){logger[_0xc71b('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x20e7f5[_0xc71b('0x7')]&&!_0x20e7f5[_0xc71b('0x13')]&&_0x20e7f5[_0xc71b('0x7')]!=_0x25ee4d['license']){logger[_0xc71b('0x12')](_0xc71b('0x14'));}if(_0x20e7f5['license']&&!_0x20e7f5['data2']&&_0x20e7f5['license']==_0x25ee4d[_0xc71b('0x7')]){return _0x3a3b7b;}return _0x3a3b7b['update']({'data1':_0x183175,'data2':null,'license':_0x25ee4d['license']});}else{if(_0x25ee4d[_0xc71b('0x7')]||_0x20e7f5[_0xc71b('0x7')]){if(!_0x20e7f5['data2']){if(_0x20e7f5[_0xc71b('0x10')]==_0x183175){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc71b('0x15');logger[_0xc71b('0x12')](_0xc71b('0x16'),_0x20e7f5['data1'],_0x183175);}logger[_0xc71b('0x12')](_0xc71b('0x17'),GRAY_PERIOD_REASON[_0xc71b('0x18')](),moment()[_0xc71b('0x9')](_0xc71b('0x19')));return _0x3a3b7b[_0xc71b('0x1a')]({'data2':encryptor[_0xc71b('0x1b')](moment()[_0xc71b('0x9')](_0xc71b('0x19')))});}else{if(moment()['diff'](encryptor[_0xc71b('0x1c')](_0x20e7f5[_0xc71b('0x13')]),_0xc71b('0x1d'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xc71b('0x9')](_0xc71b('0x19')));isOldTokenSent=![];return _0x3a3b7b['update']({'data1':_0x183175,'data2':null,'license':null});}}}else{if(_0x20e7f5[_0xc71b('0x10')]!=_0x183175){logger[_0xc71b('0x12')](_0xc71b('0x16'),_0x20e7f5[_0xc71b('0x10')],_0x183175);return _0x3a3b7b['update']({'data1':_0x183175,'data2':null,'license':null});}}}return _0x3a3b7b;})[_0xc71b('0xd')](function(_0x3329af){_0x3a3b7b=_0x3329af;})['catch'](function(_0x5ea335){logger[_0xc71b('0x1e')](_0x5ea335[_0xc71b('0x1f')]);})[_0xc71b('0x20')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3a3b7b);},TIME);});}function defaultLicense(){var _0x3697e2=hardware[_0xc71b('0x21')]();if(_0x3697e2){return db[_0xc71b('0x22')][_0xc71b('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3697e2}})[_0xc71b('0x24')](function(_0x11aa75,_0x5cccba){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3697e2);manageLicense(_0x3697e2,_0x11aa75);})[_0xc71b('0xe')](function(_0x1d2e1a){logger[_0xc71b('0x1e')](_0x1d2e1a[_0xc71b('0x1f')]);});}}exports[_0xc71b('0x25')]=defaultLicense; \ No newline at end of file +var _0xca8b=['data2','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','data1'];(function(_0x3c3b37,_0x57e357){var _0x305894=function(_0x4e3149){while(--_0x4e3149){_0x3c3b37['push'](_0x3c3b37['shift']());}};_0x305894(++_0x57e357);}(_0xca8b,0x192));var _0xbca8=function(_0x2672b,_0x116075){_0x2672b=_0x2672b-0x0;var _0x760b04=_0xca8b[_0x2672b];return _0x760b04;};'use strict';var util=require(_0xbca8('0x0'));var moment=require(_0xbca8('0x1'));var rp=require(_0xbca8('0x2'));var BPromise=require(_0xbca8('0x3'));var pkginfo=require(_0xbca8('0x4'))(module,_0xbca8('0x5'));var db=require(_0xbca8('0x6'))['db'];var encryptor=require(_0xbca8('0x7'));var hardware=require(_0xbca8('0x8'));var logger=require(_0xbca8('0x9'))(_0xbca8('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xcda4b4){return new BPromise(function(_0x3b1782,_0x286b94){var _0x348d99=util[_0xbca8('0xb')](_0xbca8('0xc'),HOST,_0xcda4b4,module[_0xbca8('0xd')][_0xbca8('0x5')]);if(oldToken){_0x348d99=util[_0xbca8('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0xcda4b4,module[_0xbca8('0xd')][_0xbca8('0x5')],oldToken);}var _0x545c18={'uri':_0x348d99,'method':_0xbca8('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x545c18)[_0xbca8('0xf')](function(_0x407164){_0x3b1782(_0x407164);})[_0xbca8('0x10')](function(_0x12d1e5){_0x286b94(_0x12d1e5);});});}function manageLicense(_0x47cf1b,_0x717c5c){var _0x530d25=_0x717c5c['get']({'plain':!![]});if(!isOldTokenSent&&_0x530d25[_0xbca8('0x11')]!==_0x47cf1b&&!_0x530d25[_0xbca8('0x12')]){oldToken=_0x530d25[_0xbca8('0x11')];}httpRequest(_0x47cf1b)['then'](function(_0x310581){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x310581['active']){isOldTokenSent=![];if(!_0x530d25[_0xbca8('0xa')]&&_0x530d25[_0xbca8('0xa')]!=_0x310581[_0xbca8('0xa')]||_0x530d25[_0xbca8('0xa')]&&_0x530d25['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x530d25[_0xbca8('0xa')]&&!_0x530d25[_0xbca8('0x12')]&&_0x530d25[_0xbca8('0xa')]!=_0x310581['license']){logger[_0xbca8('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x530d25[_0xbca8('0xa')]&&!_0x530d25[_0xbca8('0x12')]&&_0x530d25['license']==_0x310581[_0xbca8('0xa')]){return _0x717c5c;}return _0x717c5c[_0xbca8('0x14')]({'data1':_0x47cf1b,'data2':null,'license':_0x310581[_0xbca8('0xa')]});}else{if(_0x310581[_0xbca8('0xa')]||_0x530d25[_0xbca8('0xa')]){if(!_0x530d25[_0xbca8('0x12')]){if(_0x530d25[_0xbca8('0x11')]==_0x47cf1b){GRAY_PERIOD_REASON=_0xbca8('0x15');logger[_0xbca8('0x13')](_0xbca8('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xbca8('0x17'),_0x530d25['data1'],_0x47cf1b);}logger[_0xbca8('0x13')](_0xbca8('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xbca8('0xb')](_0xbca8('0x19')));return _0x717c5c['update']({'data2':encryptor[_0xbca8('0x1a')](moment()[_0xbca8('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x530d25[_0xbca8('0x12')]),_0xbca8('0x1b'))>DAYS){logger[_0xbca8('0x13')](_0xbca8('0x1c'),moment()[_0xbca8('0xb')](_0xbca8('0x19')));isOldTokenSent=![];return _0x717c5c[_0xbca8('0x14')]({'data1':_0x47cf1b,'data2':null,'license':null});}}}else{if(_0x530d25[_0xbca8('0x11')]!=_0x47cf1b){logger['info'](_0xbca8('0x17'),_0x530d25[_0xbca8('0x11')],_0x47cf1b);return _0x717c5c[_0xbca8('0x14')]({'data1':_0x47cf1b,'data2':null,'license':null});}}}return _0x717c5c;})['then'](function(_0x49a851){_0x717c5c=_0x49a851;})['catch'](function(_0xdf734e){logger[_0xbca8('0x1d')](_0xdf734e['message']);})[_0xbca8('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xbca8('0x1f')](),_0x717c5c);},TIME);});}function defaultLicense(){var _0x43fbfd=hardware[_0xbca8('0x1f')]();if(_0x43fbfd){return db[_0xbca8('0x20')][_0xbca8('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x43fbfd}})['spread'](function(_0x2fcb9b,_0x3c0e13){logger[_0xbca8('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x43fbfd);manageLicense(_0x43fbfd,_0x2fcb9b);})['catch'](function(_0x564bec){logger[_0xbca8('0x1d')](_0x564bec['message']);});}}exports[_0xbca8('0x22')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index fcdac15..65b7162 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 _0xc1ee=['role','sequelize','COUNT','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util','lodash','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','split','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','deadline','add','days','format','changed','message','User','findAll'];(function(_0x1e0543,_0x4e200d){var _0x21a58e=function(_0x15eba6){while(--_0x15eba6){_0x1e0543['push'](_0x1e0543['shift']());}};_0x21a58e(++_0x4e200d);}(_0xc1ee,0x11c));var _0xec1e=function(_0x5bb8b9,_0x37b264){_0x5bb8b9=_0x5bb8b9-0x0;var _0x3f3a6a=_0xc1ee[_0x5bb8b9];return _0x3f3a6a;};'use strict';var util=require(_0xec1e('0x0'));var _=require(_0xec1e('0x1'));var moment=require(_0xec1e('0x2'));var BPromise=require(_0xec1e('0x3'));var hardware=require(_0xec1e('0x4'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xec1e('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xec1e('0x6'),'machineUuid':hardware[_0xec1e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xec1e('0x8'),'machineUuid':hardware[_0xec1e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5745f0){return new BPromise(function(_0x4aeb0a,_0x413715){return db[_0xec1e('0x9')][_0xec1e('0xa')](_[_0xec1e('0xb')](_0x5745f0,{'raw':!![],'where':{'id':0x1}}))[_0xec1e('0xc')](function(_0x415c70){return checkLicense(_0x415c70,null);})[_0xec1e('0xc')](function(_0x519adb){_0x4aeb0a(_0x519adb);return;})['catch'](function(_0xb987b9){_0x413715(_0xb987b9);});});}function checkLicense(_0x5603c3,_0x381ba2){if(!_0x5603c3){demoLicense[_0xec1e('0xd')]=_0x5603c3[_0xec1e('0xe')];return demoLicense;}try{var _0x2f7be5=_0x381ba2||_0x5603c3[_0xec1e('0xf')];if(_['isEmpty'](_0x2f7be5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x24c959=_0x5603c3['data1'];var _0x55b98e=_0x5603c3['data2'];var _0x537bb4=_0x24c959['split']('-')[0x4];var _0x502245=_0x24c959[_0xec1e('0x10')]('-')[0x0];var _0x305ad3=encryptor['decryptString'](_0x2f7be5,util['format'](_0xec1e('0x11'),_0x537bb4,_0x24c959,_0x502245));var _0x1df9d5=JSON[_0xec1e('0x12')](_0x305ad3);_0x1df9d5[_0xec1e('0x13')]=![];_0x1df9d5['uuid']=_0x24c959;_0x1df9d5[_0xec1e('0x14')]=hardware['getUuid']();if(_0x55b98e){var _0x366589=encryptor[_0xec1e('0x15')](_0x55b98e);_0x1df9d5[_0xec1e('0x16')]=_0x366589;_0x1df9d5[_0xec1e('0x17')]=moment(_0x366589)[_0xec1e('0x18')](0x7,_0xec1e('0x19'))[_0xec1e('0x1a')]();_0x1df9d5['grayReason']=_0x1df9d5[_0xec1e('0xd')]!=_0x1df9d5[_0xec1e('0x14')]?_0xec1e('0x1b'):'disabled';}return _0x1df9d5;}catch(_0x47b2bd){breakingLicense[_0xec1e('0xd')]=_0x5603c3[_0xec1e('0xe')];breakingLicense[_0xec1e('0x1c')]=_0x47b2bd[_0xec1e('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xc0958,_0x496265){getLicense()['then'](function(_0x20332d){return db[_0xec1e('0x1d')][_0xec1e('0x1e')]({'attributes':[_0xec1e('0x1f'),[db[_0xec1e('0x20')]['fn'](_0xec1e('0x21'),db[_0xec1e('0x20')]['col']('role')),'count']],'group':'role','where':{'role':{'$or':[_0xec1e('0x22'),_0xec1e('0x23'),_0xec1e('0x24')]}},'raw':!![]})[_0xec1e('0xc')](function(_0x34bcd8){var _0x1c77fb={'user':_0x20332d[_0xec1e('0x25')]||0x0,'telephone':_0x20332d['telephones']||0x0};_0x34bcd8[_0xec1e('0x26')](function(_0x40d573){var _0x4d97b6=_0x40d573[_0xec1e('0x1f')]==='admin'?_0xec1e('0x23'):_0x40d573[_0xec1e('0x1f')];_0x1c77fb[_0x4d97b6]-=_0x40d573[_0xec1e('0x27')];if(_0x1c77fb[_0x4d97b6]<0x0)_0x1c77fb[_0x4d97b6]=0x0;});_0xc0958(_0x1c77fb);return;});})['catch'](function(_0x23da89){_0x496265(_0x23da89);});});}function checkUserLimits(_0x1a2802){return new BPromise(function(_0x5026d1,_0x282610){getLimits()['then'](function(_0x3748c0){var _0x4d4f10=_[_0xec1e('0x28')](_[_0xec1e('0x29')](_0x1a2802,'role'),[_0xec1e('0x22'),_0xec1e('0x23'),_0xec1e('0x24')]);var _0x5cba35=(_0x4d4f10[_0xec1e('0x22')]||0x0)+(_0x4d4f10[_0xec1e('0x23')]||0x0);var _0x25f37e=_0x4d4f10[_0xec1e('0x24')]||0x0;if(_0x5cba35>_0x3748c0[_0xec1e('0x23')])return _0x282610('License\x20limit\x20reached\x20for\x20users');if(_0x25f37e>_0x3748c0['telephone'])return _0x282610(_0xec1e('0x2a'));return _0x5026d1();})[_0xec1e('0x2b')](function(_0x38baeb){_0x282610(_0x38baeb);});});}module[_0xec1e('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5234=['admin','telephone','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','util','moment','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','getUuid','gray','add','days','machineUuid','changed','disabled','message','findAll','role','COUNT','sequelize','col','count'];(function(_0x2acc08,_0x306a9a){var _0x16d902=function(_0x47dc33){while(--_0x47dc33){_0x2acc08['push'](_0x2acc08['shift']());}};_0x16d902(++_0x306a9a);}(_0x5234,0x1a1));var _0x4523=function(_0x5e5606,_0x57c481){_0x5e5606=_0x5e5606-0x0;var _0x4f0425=_0x5234[_0x5e5606];return _0x4f0425;};'use strict';var util=require(_0x4523('0x0'));var _=require('lodash');var moment=require(_0x4523('0x1'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4523('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4523('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4523('0x3'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x962a7a){return new BPromise(function(_0x160199,_0x6030c5){return db[_0x4523('0x4')][_0x4523('0x5')](_['defaults'](_0x962a7a,{'raw':!![],'where':{'id':0x1}}))[_0x4523('0x6')](function(_0x1bad42){return checkLicense(_0x1bad42,null);})[_0x4523('0x6')](function(_0x12025d){_0x160199(_0x12025d);return;})[_0x4523('0x7')](function(_0x161d09){_0x6030c5(_0x161d09);});});}function checkLicense(_0x149418,_0x339b9f){if(!_0x149418){demoLicense[_0x4523('0x8')]=_0x149418[_0x4523('0x9')];return demoLicense;}try{var _0x3aafd5=_0x339b9f||_0x149418[_0x4523('0xa')];if(_[_0x4523('0xb')](_0x3aafd5)){throw new Error(_0x4523('0xc'));}var _0xeca489=_0x149418[_0x4523('0x9')];var _0x2582e2=_0x149418[_0x4523('0xd')];var _0x12fd63=_0xeca489['split']('-')[0x4];var _0x53deca=_0xeca489[_0x4523('0xe')]('-')[0x0];var _0x4483f2=encryptor[_0x4523('0xf')](_0x3aafd5,util[_0x4523('0x10')](_0x4523('0x11'),_0x12fd63,_0xeca489,_0x53deca));var _0xf64312=JSON[_0x4523('0x12')](_0x4483f2);_0xf64312[_0x4523('0x13')]=![];_0xf64312[_0x4523('0x8')]=_0xeca489;_0xf64312['machineUuid']=hardware[_0x4523('0x14')]();if(_0x2582e2){var _0x1d723f=encryptor['decryptString'](_0x2582e2);_0xf64312[_0x4523('0x15')]=_0x1d723f;_0xf64312['deadline']=moment(_0x1d723f)[_0x4523('0x16')](0x7,_0x4523('0x17'))[_0x4523('0x10')]();_0xf64312['grayReason']=_0xf64312['uuid']!=_0xf64312[_0x4523('0x18')]?_0x4523('0x19'):_0x4523('0x1a');}return _0xf64312;}catch(_0x4f00b1){breakingLicense[_0x4523('0x8')]=_0x149418['data1'];breakingLicense[_0x4523('0x1b')]=_0x4f00b1[_0x4523('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x32d08c,_0x22fc72){getLicense()[_0x4523('0x6')](function(_0x26a827){return db['User'][_0x4523('0x1c')]({'attributes':[_0x4523('0x1d'),[db['sequelize']['fn'](_0x4523('0x1e'),db[_0x4523('0x1f')][_0x4523('0x20')]('role')),_0x4523('0x21')]],'group':'role','where':{'role':{'$or':[_0x4523('0x22'),'user',_0x4523('0x23')]}},'raw':!![]})['then'](function(_0x13bd61){var _0x4ae0be={'user':_0x26a827['users']||0x0,'telephone':_0x26a827['telephones']||0x0};_0x13bd61[_0x4523('0x24')](function(_0x1498ef){var _0x3c11a6=_0x1498ef['role']===_0x4523('0x22')?_0x4523('0x25'):_0x1498ef[_0x4523('0x1d')];_0x4ae0be[_0x3c11a6]-=_0x1498ef[_0x4523('0x21')];if(_0x4ae0be[_0x3c11a6]<0x0)_0x4ae0be[_0x3c11a6]=0x0;});_0x32d08c(_0x4ae0be);return;});})[_0x4523('0x7')](function(_0xeb5eb6){_0x22fc72(_0xeb5eb6);});});}function checkUserLimits(_0x9df0c5){return new BPromise(function(_0x5cd9e0,_0x2ee7c9){getLimits()[_0x4523('0x6')](function(_0x5892e3){var _0x1b8e55=_[_0x4523('0x26')](_[_0x4523('0x27')](_0x9df0c5,'role'),['admin',_0x4523('0x25'),_0x4523('0x23')]);var _0x289ede=(_0x1b8e55[_0x4523('0x22')]||0x0)+(_0x1b8e55['user']||0x0);var _0x35fb29=_0x1b8e55[_0x4523('0x23')]||0x0;if(_0x289ede>_0x5892e3[_0x4523('0x25')])return _0x2ee7c9('License\x20limit\x20reached\x20for\x20users');if(_0x35fb29>_0x5892e3['telephone'])return _0x2ee7c9(_0x4523('0x28'));return _0x5cd9e0();})[_0x4523('0x7')](function(_0x1cb750){_0x2ee7c9(_0x1cb750);});});}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 3f9403c..6fde337 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 _0x0b0e=['secret','exports','myappanuglar-secret'];(function(_0x4d1ff1,_0xbee8c6){var _0x18ac99=function(_0x2a62c8){while(--_0x2a62c8){_0x4d1ff1['push'](_0x4d1ff1['shift']());}};_0x18ac99(++_0xbee8c6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b0e[_0x542da8];return _0x533d7e;};'use strict';module[_0xe0b0('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xe0b0('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe0b0('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x93e9=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x93e9,0xcc));var _0x993e=function(_0x4c5a24,_0x5ef60c){_0x4c5a24=_0x4c5a24-0x0;var _0x4b067e=_0x93e9[_0x4c5a24];return _0x4b067e;};'use strict';module[_0x993e('0x0')]={'DOMAIN':_0x993e('0x1'),'SESSION_SECRET':_0x993e('0x2'),'GOOGLE_ID':_0x993e('0x3'),'GOOGLE_SECRET':_0x993e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ec9dba4..05eb9a6 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcba9=['debugLevel','moment','winston','util','path','INFO','join','/var','log','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env'];(function(_0x5aba05,_0x2b2dd2){var _0x36de06=function(_0x436ebb){while(--_0x436ebb){_0x5aba05['push'](_0x5aba05['shift']());}};_0x36de06(++_0x2b2dd2);}(_0xcba9,0xb7));var _0x9cba=function(_0xe3bbf3,_0x1e5d36){_0xe3bbf3=_0xe3bbf3-0x0;var _0x1ee802=_0xcba9[_0xe3bbf3];return _0x1ee802;};'use strict';var moment=require(_0x9cba('0x0'));var winston=require(_0x9cba('0x1'));var util=require(_0x9cba('0x2'));var path=require(_0x9cba('0x3'));var debugLevel=_0x9cba('0x4');function filename(_0x221b35,_0x572898){return path[_0x9cba('0x5')](_0x9cba('0x6'),_0x9cba('0x7'),'xcally',util[_0x9cba('0x8')]('%s-%s.log',_0x221b35,_0x572898));}function formatter(_0x275674,_0x360d68){_0x360d68[_0x9cba('0x9')]=_0x360d68[_0x9cba('0x9')][_0x9cba('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,_0x9cba('0xb'))[_0x9cba('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x9cba('0x8')](_0x9cba('0xc'),moment()[_0x9cba('0x8')](_0x9cba('0xd')),_0x360d68[_0x9cba('0xe')][_0x9cba('0xf')](),_0x275674,_0x360d68[_0x9cba('0x9')]);}module[_0x9cba('0x10')]=function(_0x122e2e){return new winston[(_0x9cba('0x11'))]({'transports':[new winston[(_0x9cba('0x12'))][(_0x9cba('0x13'))]({'name':util[_0x9cba('0x8')](_0x9cba('0x14'),_0x122e2e,_0x9cba('0x15')),'filename':filename(_0x122e2e,_0x9cba('0x15')),'level':_0x9cba('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x402a73){return formatter(_0x122e2e,_0x402a73);}}),new winston[(_0x9cba('0x12'))][(_0x9cba('0x13'))]({'name':util[_0x9cba('0x8')](_0x9cba('0x14'),_0x122e2e,_0x9cba('0x16')),'filename':filename(_0x122e2e,_0x9cba('0x16')),'level':_0x9cba('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3cb1b7){return formatter(_0x122e2e,_0x3cb1b7);}}),new winston[(_0x9cba('0x12'))][(_0x9cba('0x17'))]({'level':process[_0x9cba('0x18')][_0x9cba('0x19')]||debugLevel,'json':![],'formatter':function(_0x22c3e8){return formatter(_0x122e2e,_0x22c3e8);}})]});}; \ No newline at end of file +var _0x6b3d=['transports','File','%s-%s','error','info','Console','env','winston','util','INFO','log','xcally','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x6b3d,0x1d5));var _0xd6b3=function(_0xeaf049,_0x1e54d0){_0xeaf049=_0xeaf049-0x0;var _0x6ddc83=_0x6b3d[_0xeaf049];return _0x6ddc83;};'use strict';var moment=require('moment');var winston=require(_0xd6b3('0x0'));var util=require(_0xd6b3('0x1'));var path=require('path');var debugLevel=_0xd6b3('0x2');function filename(_0x43bb4f,_0x4e1cc3){return path['join']('/var',_0xd6b3('0x3'),_0xd6b3('0x4'),util[_0xd6b3('0x5')](_0xd6b3('0x6'),_0x43bb4f,_0x4e1cc3));}function formatter(_0x4098e8,_0x1be315){_0x1be315[_0xd6b3('0x7')]=_0x1be315['message'][_0xd6b3('0x8')](/@@{/g,'{{{')[_0xd6b3('0x8')](/}@@/g,'}}}')[_0xd6b3('0x8')](/@{/g,'{{')[_0xd6b3('0x8')](/}@/g,'}}');return util['format'](_0xd6b3('0x9'),moment()[_0xd6b3('0x5')](_0xd6b3('0xa')),_0x1be315[_0xd6b3('0xb')][_0xd6b3('0xc')](),_0x4098e8,_0x1be315[_0xd6b3('0x7')]);}module[_0xd6b3('0xd')]=function(_0x1df877){return new winston['Logger']({'transports':[new winston[(_0xd6b3('0xe'))][(_0xd6b3('0xf'))]({'name':util[_0xd6b3('0x5')](_0xd6b3('0x10'),_0x1df877,_0xd6b3('0x11')),'filename':filename(_0x1df877,_0xd6b3('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfb53f0){return formatter(_0x1df877,_0xfb53f0);}}),new winston[(_0xd6b3('0xe'))][(_0xd6b3('0xf'))]({'name':util[_0xd6b3('0x5')]('%s-%s',_0x1df877,_0xd6b3('0x12')),'filename':filename(_0x1df877,_0xd6b3('0x12')),'level':_0xd6b3('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x23ef80){return formatter(_0x1df877,_0x23ef80);}}),new winston[(_0xd6b3('0xe'))][(_0xd6b3('0x13'))]({'level':process[_0xd6b3('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4a958c){return formatter(_0x1df877,_0x4a958c);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c2f7acc..df47e13 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 _0xb084=['exports','join','../../services/express/index.js','../../services/ami/index.js','agi','email','routing','xdr'];(function(_0x3e4843,_0x19b227){var _0x5d2c05=function(_0x1a1c82){while(--_0x1a1c82){_0x3e4843['push'](_0x3e4843['shift']());}};_0x5d2c05(++_0x19b227);}(_0xb084,0x91));var _0x4b08=function(_0x4743bf,_0x4c0a60){_0x4743bf=_0x4743bf-0x0;var _0xb57de2=_0xb084[_0x4743bf];return _0xb57de2;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x4b08('0x0')](__dirname,_0x4b08('0x1'))},{'name':'ami','script':path[_0x4b08('0x0')](__dirname,_0x4b08('0x2'))},{'name':_0x4b08('0x3'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x4b08('0x4'),'script':path[_0x4b08('0x0')](__dirname,'../../services/email/index.js')},{'name':_0x4b08('0x5'),'script':path[_0x4b08('0x0')](__dirname,'../../services/routing/index.js')},{'name':_0x4b08('0x6'),'script':path[_0x4b08('0x0')](__dirname,'../../services/xdr/index.js')}]};module[_0x4b08('0x7')]=config; \ No newline at end of file +var _0x6cab=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','../../services/express/index.js','../../services/ami/index.js','agi','join'];(function(_0x20c844,_0x6531ee){var _0x33dc1b=function(_0x280244){while(--_0x280244){_0x20c844['push'](_0x20c844['shift']());}};_0x33dc1b(++_0x6531ee);}(_0x6cab,0x6f));var _0xb6ca=function(_0x125425,_0x4b6bab){_0x125425=_0x125425-0x0;var _0xd04dc4=_0x6cab[_0x125425];return _0xd04dc4;};'use strict';var path=require(_0xb6ca('0x0'));var os=require('os');var config={'apps':[{'name':_0xb6ca('0x1'),'script':path['join'](__dirname,_0xb6ca('0x2'))},{'name':'ami','script':path['join'](__dirname,_0xb6ca('0x3'))},{'name':_0xb6ca('0x4'),'script':path[_0xb6ca('0x5')](__dirname,_0xb6ca('0x6'))},{'name':_0xb6ca('0x7'),'script':path[_0xb6ca('0x5')](__dirname,_0xb6ca('0x8'))},{'name':_0xb6ca('0x9'),'script':path['join'](__dirname,_0xb6ca('0xa'))},{'name':_0xb6ca('0xb'),'script':path[_0xb6ca('0x5')](__dirname,'../../services/xdr/index.js')}]};module[_0xb6ca('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4b9106b..0d86cab 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 _0x3dfb=['connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','./config','connect'];(function(_0x119659,_0x30d2d2){var _0x209c38=function(_0x259b42){while(--_0x259b42){_0x119659['push'](_0x119659['shift']());}};_0x209c38(++_0x30d2d2);}(_0x3dfb,0x8d));var _0xb3df=function(_0x44e3db,_0x23e14f){_0x44e3db=_0x44e3db-0x0;var _0x58b326=_0x3dfb[_0x44e3db];return _0x58b326;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0xb3df('0x0'));function connect(){return new BPromise(function(_0x5727d4,_0x24d80f){return pm2[_0xb3df('0x1')](function(_0x50fab3){if(_0x50fab3){return _0x24d80f(_0x50fab3);}return _0x5727d4(_0xb3df('0x2'));});});};exports[_0xb3df('0x3')]=function(_0x4c201f){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x24fd02,_0x2d4f54){return pm2[_0xb3df('0x3')](_0x4c201f,function(_0x68a88e,_0x5e53db){if(_0x68a88e){return _0x2d4f54(_0x68a88e);}pm2[_0xb3df('0x5')]();return _0x24fd02(_0x5e53db);});});});};exports[_0xb3df('0x6')]=function(_0x48f489){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x5fdeac,_0x13eed2){return pm2['stop'](_0x48f489,function(_0x257893,_0x371ccf){if(_0x257893){return _0x13eed2(_0x257893);}pm2[_0xb3df('0x5')]();return _0x5fdeac(_0x371ccf);});});});};exports[_0xb3df('0x7')]=function(_0x4b09d8){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x7b75ec,_0x405cf1){return pm2[_0xb3df('0x7')](_0x4b09d8,function(_0x101fbf,_0x166b42){if(_0x101fbf){return _0x405cf1(_0x101fbf);}pm2[_0xb3df('0x5')]();return _0x7b75ec(_0x166b42);});});});};exports[_0xb3df('0x8')]=function(){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x5e55e8,_0x490d0c){return pm2['list'](function(_0x3df06b,_0x22083c){if(_0x3df06b){return _0x490d0c(_0x3df06b);}pm2[_0xb3df('0x5')]();return _0x5e55e8(_0x22083c);});});});};exports[_0xb3df('0x9')]=function(_0x450b38){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x15e7ed,_0x1a61f9){return pm2['describe'](_0x450b38,function(_0x534e1a,_0x4fd810){if(_0x534e1a){return _0x1a61f9(_0x534e1a);}pm2[_0xb3df('0x5')]();return _0x15e7ed(_0x4fd810);});});});};exports[_0xb3df('0xa')]=function(_0x50a492){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x14623f,_0x2e555e){return pm2[_0xb3df('0xa')](_0x50a492,function(_0x2cfc00,_0x3f6af2){if(_0x2cfc00){return _0x2e555e(_0x2cfc00);}pm2[_0xb3df('0x5')]();return _0x14623f(_0x3f6af2);});});});};exports[_0xb3df('0xb')]=function(){return connect()[_0xb3df('0x4')](function(){return new BPromise(function(_0x140255,_0x5b37f0){return pm2[_0xb3df('0xb')](function(_0x5121b9){if(_0x5121b9){return _0x5b37f0(_0x5121b9);}return _0x140255(_0xb3df('0xc'));});});});}; \ No newline at end of file +var _0x7641=['delete','dump','saved','bluebird','./config','connect','connected','start','then','stop','disconnect','list','describe'];(function(_0x1f3867,_0x215d16){var _0x7a0b19=function(_0x34c24e){while(--_0x34c24e){_0x1f3867['push'](_0x1f3867['shift']());}};_0x7a0b19(++_0x215d16);}(_0x7641,0x1d7));var _0x1764=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7641[_0x397e5f];return _0x5302b8;};'use strict';var pm2=require('pm2');var BPromise=require(_0x1764('0x0'));var config=require(_0x1764('0x1'));function connect(){return new BPromise(function(_0x31dbd1,_0x6ad366){return pm2[_0x1764('0x2')](function(_0x4739f2){if(_0x4739f2){return _0x6ad366(_0x4739f2);}return _0x31dbd1(_0x1764('0x3'));});});};exports[_0x1764('0x4')]=function(_0x4f80b3){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0x41e4af,_0x3eb541){return pm2['start'](_0x4f80b3,function(_0x2589c4,_0x480487){if(_0x2589c4){return _0x3eb541(_0x2589c4);}pm2['disconnect']();return _0x41e4af(_0x480487);});});});};exports[_0x1764('0x6')]=function(_0x146bd4){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0x3b0595,_0x202ba9){return pm2['stop'](_0x146bd4,function(_0x3dc9e5,_0xdf90c7){if(_0x3dc9e5){return _0x202ba9(_0x3dc9e5);}pm2[_0x1764('0x7')]();return _0x3b0595(_0xdf90c7);});});});};exports['restart']=function(_0x5d38cd){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0x848c8b,_0x3c9989){return pm2['restart'](_0x5d38cd,function(_0x3944d5,_0x5b4788){if(_0x3944d5){return _0x3c9989(_0x3944d5);}pm2[_0x1764('0x7')]();return _0x848c8b(_0x5b4788);});});});};exports[_0x1764('0x8')]=function(){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0x5ef40d,_0x47e6ad){return pm2[_0x1764('0x8')](function(_0x4e24db,_0x4c0845){if(_0x4e24db){return _0x47e6ad(_0x4e24db);}pm2[_0x1764('0x7')]();return _0x5ef40d(_0x4c0845);});});});};exports['describe']=function(_0x2bd9af){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0xa13c5c,_0x580a5f){return pm2[_0x1764('0x9')](_0x2bd9af,function(_0x1c25df,_0x4a4346){if(_0x1c25df){return _0x580a5f(_0x1c25df);}pm2[_0x1764('0x7')]();return _0xa13c5c(_0x4a4346);});});});};exports['delete']=function(_0x14eda3){return connect()['then'](function(){return new BPromise(function(_0x5056b9,_0xd29ca2){return pm2[_0x1764('0xa')](_0x14eda3,function(_0x116a63,_0x532744){if(_0x116a63){return _0xd29ca2(_0x116a63);}pm2[_0x1764('0x7')]();return _0x5056b9(_0x532744);});});});};exports[_0x1764('0xb')]=function(){return connect()[_0x1764('0x5')](function(){return new BPromise(function(_0x3dbfc7,_0x285fed){return pm2[_0x1764('0xb')](function(_0x533342){if(_0x533342){return _0x285fed(_0x533342);}return _0x3dbfc7(_0x1764('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f275986..3ce5f38 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 _0x26c1=['start','lodash','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost','Setting','find','then','findAll','lastMsgAt','subtract','chatTimeout','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x14d074,_0x21d869){var _0x50df38=function(_0x3f0226){while(--_0x3f0226){_0x14d074['push'](_0x14d074['shift']());}};_0x50df38(++_0x21d869);}(_0x26c1,0x15d));var _0x126c=function(_0x12a201,_0x30aaba){_0x12a201=_0x12a201-0x0;var _0x52a4d2=_0x26c1[_0x12a201];return _0x52a4d2;};'use strict';var _=require(_0x126c('0x0'));var moment=require('moment');var Redis=require(_0x126c('0x1'));var util=require(_0x126c('0x2'));var config=require('../../config/environment');var db=require(_0x126c('0x3'))['db'];var logger=require('../logger')(_0x126c('0x4'));config[_0x126c('0x5')]=_[_0x126c('0x6')](config[_0x126c('0x5')],{'host':_0x126c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x126c('0x5')]));function closeInteractions(){var _0x102be2=0x0;var _0x5c2fa8=[];return db[_0x126c('0x8')][_0x126c('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x126c('0xa')](function(_0x56b963){_0x102be2=_0x56b963['chatTimeout'];if(_0x102be2){return db['ChatInteraction'][_0x126c('0xb')]({'raw':!![],'attributes':['id',_0x126c('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x126c('0xd')](_0x56b963[_0x126c('0xe')],_0x126c('0xf'))}}});}else{return[];}})[_0x126c('0xa')](function(_0x54830e){if(_0x54830e&&_0x54830e[_0x126c('0x10')]){_0x5c2fa8=_[_0x126c('0x11')](_0x54830e||[],'id');logger[_0x126c('0x12')](_0x126c('0x13'),_0x5c2fa8[_0x126c('0x14')]());return db['ChatInteraction']['update']({'closeReason':_0x126c('0x15'),'disposition':_0x126c('0x16'),'closed':!![],'closedAt':moment()[_0x126c('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5c2fa8}});}})[_0x126c('0xa')](function(){if(_0x5c2fa8&&_0x5c2fa8[_0x126c('0x10')]){logger['info'](_0x126c('0x18'),_0x5c2fa8[_0x126c('0x14')]());for(var _0x5d2324=0x0;_0x5d2324<_0x5c2fa8[_0x126c('0x10')];_0x5d2324++){io[_0x126c('0x19')]('chatInteraction:update',{'id':_0x5c2fa8[_0x5d2324],'closed':!![]});}}})['catch'](function(_0x470465){logger['error'](_0x126c('0x1a'),_0x470465?util[_0x126c('0x1b')](_0x470465,{'showHidden':![],'depth':null}):'');});}exports[_0x126c('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1ea6=['find','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','map','info','join','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x1ea6,0x12c));var _0x61ea=function(_0x21b9db,_0x535312){_0x21b9db=_0x21b9db-0x0;var _0x35aaea=_0x1ea6[_0x21b9db];return _0x35aaea;};'use strict';var _=require('lodash');var moment=require(_0x61ea('0x0'));var Redis=require('ioredis');var util=require(_0x61ea('0x1'));var config=require('../../config/environment');var db=require(_0x61ea('0x2'))['db'];var logger=require(_0x61ea('0x3'))(_0x61ea('0x4'));config[_0x61ea('0x5')]=_[_0x61ea('0x6')](config['redis'],{'host':_0x61ea('0x7'),'port':0x18eb});var io=require(_0x61ea('0x8'))(new Redis(config[_0x61ea('0x5')]));function closeInteractions(){var _0x2d3e80=0x0;var _0x41110c=[];return db[_0x61ea('0x9')][_0x61ea('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x13bca7){_0x2d3e80=_0x13bca7[_0x61ea('0xb')];if(_0x2d3e80){return db[_0x61ea('0xc')][_0x61ea('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x61ea('0xe')](_0x13bca7[_0x61ea('0xb')],_0x61ea('0xf'))}}});}else{return[];}})[_0x61ea('0x10')](function(_0x2e1e80){if(_0x2e1e80&&_0x2e1e80['length']){_0x41110c=_[_0x61ea('0x11')](_0x2e1e80||[],'id');logger[_0x61ea('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x41110c[_0x61ea('0x13')]());return db[_0x61ea('0xc')]['update']({'closeReason':_0x61ea('0x14'),'disposition':_0x61ea('0x15'),'closed':!![],'closedAt':moment()[_0x61ea('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x41110c}});}})['then'](function(){if(_0x41110c&&_0x41110c[_0x61ea('0x17')]){logger['info'](_0x61ea('0x18'),_0x41110c[_0x61ea('0x13')]());for(var _0x55eb7e=0x0;_0x55eb7e<_0x41110c['length'];_0x55eb7e++){io[_0x61ea('0x19')](_0x61ea('0x1a'),{'id':_0x41110c[_0x55eb7e],'closed':!![]});}}})['catch'](function(_0x529938){logger[_0x61ea('0x1b')](_0x61ea('0x1c'),_0x529938?util[_0x61ea('0x1d')](_0x529938,{'showHidden':![],'depth':null}):'');});}exports[_0x61ea('0x1e')]=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 4e3a0e4..ccbb7df 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 _0xa331=['toRun','index','resolve','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','basename','savename','extname','existsSync','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','status','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','error','error\x20mail','catch','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','intersection','difference','length','exists','stop','deleteJob'];(function(_0x218540,_0x53f0d2){var _0xab02e8=function(_0x2a0b8b){while(--_0x2a0b8b){_0x218540['push'](_0x218540['shift']());}};_0xab02e8(++_0x53f0d2);}(_0xa331,0x1d0));var _0x1a33=function(_0x2968df,_0x2bfc02){_0x2968df=_0x2968df-0x0;var _0x45e1c7=_0xa331[_0x2968df];return _0x45e1c7;};'use strict';var fs=require('fs');var util=require(_0x1a33('0x0'));var path=require(_0x1a33('0x1'));var _=require(_0x1a33('0x2'));var moment=require(_0x1a33('0x3'));var CronJobManager=require(_0x1a33('0x4'));var jayson=require(_0x1a33('0x5'));var BPromise=require(_0x1a33('0x6'));var logger=require('../logger')(_0x1a33('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x1a33('0x8'));var analyticDefaultReportController=require(_0x1a33('0x9'));var client=jayson['client'][_0x1a33('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3d7afc,_0x5575da){return function(){logger[_0x1a33('0xb')](_0x1a33('0xc'),_0x3d7afc[_0x1a33('0xd')]);var _0xf1fe58=!![];var _0x51945e={'tls':{'rejectUnauthorized':![]}};if(_0x3d7afc[_0x1a33('0xe')][_0x1a33('0xf')]['service']){_0x51945e[_0x1a33('0x10')]=_0x3d7afc[_0x1a33('0xe')]['Smtp'][_0x1a33('0x10')];}else{_0x51945e[_0x1a33('0x11')]=_0x3d7afc['MailAccount'][_0x1a33('0xf')][_0x1a33('0x11')];_0x51945e[_0x1a33('0x12')]=_0x3d7afc[_0x1a33('0xe')][_0x1a33('0xf')][_0x1a33('0x12')];_0x51945e[_0x1a33('0x13')]=_0x3d7afc[_0x1a33('0xe')]['Smtp'][_0x1a33('0x13')];}if(_0x3d7afc['MailAccount'][_0x1a33('0xf')][_0x1a33('0x14')]){_0x51945e[_0x1a33('0x15')]={'user':_0x3d7afc[_0x1a33('0xe')][_0x1a33('0xf')][_0x1a33('0x16')],'pass':_0x3d7afc['MailAccount']['Smtp'][_0x1a33('0x17')]};}var _0x2275e1={'account':_0x51945e,'message':{'from':util[_0x1a33('0x18')](_0x1a33('0x19'),_0x3d7afc[_0x1a33('0xe')][_0x1a33('0x1a')],_0x3d7afc[_0x1a33('0xe')][_0x1a33('0xd')]||_0x3d7afc[_0x1a33('0xe')][_0x1a33('0xf')][_0x1a33('0x16')]),'to':_0x3d7afc[_0x1a33('0xd')],'cc':_0x3d7afc['cc'],'bcc':_0x3d7afc[_0x1a33('0x1b')],'subject':util[_0x1a33('0x18')](_0x1a33('0x1c'),_0x5575da[_0x1a33('0x1a')],_0x3d7afc[_0x1a33('0x1d')],_0x3d7afc['subtractUnit'])}};var _0x45cd23=path[_0x1a33('0x1e')](__dirname,_0x1a33('0x1f'));var _0x34d936=_0x5575da['savename'];var _0x3e97f6=util['format']('%s.%s',path[_0x1a33('0x20')](_0x5575da[_0x1a33('0x21')],path[_0x1a33('0x22')](_0x5575da[_0x1a33('0x21')])),'zip');var _0x914b05=path[_0x1a33('0x1e')](_0x45cd23,_0x34d936);var _0x5878ba=path['join'](_0x45cd23,_0x3e97f6);if(fs[_0x1a33('0x23')](_0x914b05)){_0x5575da['status']='Sent';_0x2275e1[_0x1a33('0x24')]['attachments']=[{'filename':_0x34d936,'path':_0x914b05}];_0x2275e1['message'][_0x1a33('0x25')]=util[_0x1a33('0x18')](_0x1a33('0x26'),JSON['stringify'](_0x5575da,null,0x2));}else if(fs['existsSync'](_0x5878ba)){_0x5575da[_0x1a33('0x27')]=_0x1a33('0x28');_0x2275e1[_0x1a33('0x24')][_0x1a33('0x29')]=[{'filename':_0x3e97f6,'path':_0x5878ba}];}else{_0x2275e1[_0x1a33('0x24')][_0x1a33('0x25')]=_0x1a33('0x2a');if(!_0x3d7afc[_0x1a33('0x2b')]){_0xf1fe58=![];logger['info'](_0x1a33('0x2c'));}}if(_0xf1fe58){return client['request']('SendMail',_0x2275e1)['then'](function(_0x26cdd8){if(_0x26cdd8[_0x1a33('0x2d')]){return logger[_0x1a33('0x2d')](_0x1a33('0x2e'),JSON['stringify'](_0x26cdd8));}return logger[_0x1a33('0xb')]('email\x20sent');})[_0x1a33('0x2f')](function(_0x187627){return logger[_0x1a33('0x2d')](_0x1a33('0x2e'),JSON[_0x1a33('0x30')](_0x187627));});}};}function handleError(){return function(_0x329ca4){return logger[_0x1a33('0x2d')](JSON['stringify'](_0x329ca4));};}function handleResult(_0x5b2fb0){return function(_0x2eddf0){logger[_0x1a33('0xb')](_0x1a33('0x31'),JSON[_0x1a33('0x30')](_0x2eddf0));if(_0x5b2fb0['MailAccount']&&_0x5b2fb0[_0x1a33('0xe')][_0x1a33('0xf')]&&!_[_0x1a33('0x32')](_0x5b2fb0[_0x1a33('0xd')])){setTimeout(handleSendEmail(_0x5b2fb0,_0x2eddf0),0x3c*0x3e8);}};}function handleJob(_0xe06f19){return function(){try{if(_[_0x1a33('0x32')](_0xe06f19['subtractNumber'])){return logger[_0x1a33('0xb')](_0x1a33('0x33'));}if(_['isNil'](_0xe06f19['subtractUnit'])){return logger['info'](_0x1a33('0x34'));}var _0x3c89a6={'startDate':moment()['subtract'](_0xe06f19['subtractNumber'],_0xe06f19[_0x1a33('0x35')])['format'](_0x1a33('0x36')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x1a33('0x37'),'output':_0xe06f19[_0x1a33('0x38')],'name':_0xe06f19['name']};if(!_[_0x1a33('0x32')](_0xe06f19[_0x1a33('0x39')])){logger[_0x1a33('0xb')](_0x1a33('0x3a'),_0xe06f19['DefaultReportId']);return analyticDefaultReportController[_0x1a33('0x3b')]({'id':_0xe06f19[_0x1a33('0x39')]},_0x3c89a6)['then'](handleResult(_0xe06f19))[_0x1a33('0x2f')](handleError());}if(!_[_0x1a33('0x32')](_0xe06f19[_0x1a33('0x3c')])){logger[_0x1a33('0xb')](_0x1a33('0x3d'),_0xe06f19[_0x1a33('0x3c')]);return analyticCustomReportController[_0x1a33('0x3b')]({'id':_0xe06f19[_0x1a33('0x3c')]},_0x3c89a6)[_0x1a33('0x3e')](handleResult(_0xe06f19))['catch'](handleError());}}catch(_0x263caf){logger[_0x1a33('0x2d')](JSON[_0x1a33('0x30')](_0x263caf));}return logger[_0x1a33('0xb')]('no\x20report\x20id');};}function getJobs(_0x58a1e7){var _0x2011ae={};if(_0x58a1e7){_0x2011ae['id']=_0x58a1e7;}return db[_0x1a33('0x3f')][_0x1a33('0x40')]({'where':_0x2011ae,'include':[{'model':db[_0x1a33('0xe')],'attributes':['id',_0x1a33('0x1a'),'email'],'include':[{'model':db[_0x1a33('0x41')],'as':_0x1a33('0xf')}]}]})[_0x1a33('0x3e')](function(_0x53583f){var _0x517fd3=_[_0x1a33('0x42')](manager['jobs']);var _0x2e71d3=_[_0x1a33('0x43')](_0x53583f,function(_0x84ae77){return _0x84ae77['id'][_0x1a33('0x44')]();});var _0xb9b6a5=_[_0x1a33('0x45')](_0x53583f,function(_0x38a106){return _0x38a106['id'][_0x1a33('0x44')]();});var _0x3d0794=_0x58a1e7?_0x2e71d3:_['difference'](_0x2e71d3,_0x517fd3);var _0x34df62=_[_0x1a33('0x46')](_0x2e71d3,_0x517fd3);var _0xb353b7=_[_0x1a33('0x47')](_0x517fd3,_0x2e71d3);var _0x5f4f11;var _0x238575;for(_0x5f4f11=0x0;_0x5f4f11<_0xb353b7[_0x1a33('0x48')]&&!_0x58a1e7;_0x5f4f11+=0x1){_0x238575=_0xb353b7[_0x5f4f11][_0x1a33('0x44')]();if(manager[_0x1a33('0x49')](_0x238575)){manager[_0x1a33('0x4a')](_0x238575);manager[_0x1a33('0x4b')](_0x238575);logger['info']('delete\x20cron',_0x238575);}}logger[_0x1a33('0xb')](_0x1a33('0x4c'),JSON['stringify'](_0x3d0794));for(_0x5f4f11=0x0;_0x5f4f11<_0x3d0794[_0x1a33('0x48')];_0x5f4f11+=0x1){_0x238575=_0x3d0794[_0x5f4f11]['toString']();logger['info'](_0x1a33('0x4d'),_0x238575);if(_0x58a1e7){logger[_0x1a33('0xb')]('my\x20id',_0x58a1e7);logger[_0x1a33('0xb')](JSON[_0x1a33('0x30')](_0xb9b6a5[_0x238575]));BPromise[_0x1a33('0x4e')]()[_0x1a33('0x3e')](handleJob(_0xb9b6a5[_0x238575]));logger[_0x1a33('0xb')]('run\x20job',_0xb9b6a5[_0x238575][_0x1a33('0x1a')],_0xb9b6a5[_0x238575][_0x1a33('0x4f')]);}else if(_0xb9b6a5[_0x238575][_0x1a33('0x4f')]&&_0xb9b6a5[_0x238575][_0x1a33('0x50')]&&moment()[_0x1a33('0x51')](_0xb9b6a5[_0x238575][_0x1a33('0x52')],_0xb9b6a5[_0x238575]['endAt'])){manager[_0x1a33('0x53')](_0x238575,_0xb9b6a5[_0x238575][_0x1a33('0x4f')],handleJob(_0xb9b6a5[_0x238575]));manager[_0x1a33('0x54')](_0x238575);logger['info'](_0x1a33('0x55'),_0xb9b6a5[_0x238575][_0x1a33('0x1a')],_0xb9b6a5[_0x238575][_0x1a33('0x4f')]);}else if(manager[_0x1a33('0x49')](_0x238575)){manager['stop'](_0x238575);manager[_0x1a33('0x4b')](_0x238575);logger[_0x1a33('0xb')](_0x1a33('0x56'),_0xb9b6a5[_0x238575][_0x1a33('0x1a')],_0xb9b6a5[_0x238575][_0x1a33('0x4f')]);}}for(_0x5f4f11=0x0,_0x238575;_0x5f4f11<_0x34df62[_0x1a33('0x48')]&&!_0x58a1e7;_0x5f4f11+=0x1){_0x238575=_0x34df62[_0x5f4f11][_0x1a33('0x44')]();if(manager['exists'](_0x238575)){if(_0xb9b6a5[_0x238575][_0x1a33('0x4f')]&&_0xb9b6a5[_0x238575][_0x1a33('0x50')]&&moment()[_0x1a33('0x51')](_0xb9b6a5[_0x238575]['startAt'],_0xb9b6a5[_0x238575][_0x1a33('0x57')])){manager[_0x1a33('0x58')](_0x238575,_0xb9b6a5[_0x238575]['cron'],handleJob(_0xb9b6a5[_0x238575]));logger[_0x1a33('0xb')](_0x1a33('0x59'),_0xb9b6a5[_0x238575][_0x1a33('0x1a')],_0xb9b6a5[_0x238575][_0x1a33('0x4f')]);}else{manager['stop'](_0x238575);manager[_0x1a33('0x4b')](_0x238575);logger['info']('stop\x20cron',_0xb9b6a5[_0x238575][_0x1a33('0x1a')],_0xb9b6a5[_0x238575][_0x1a33('0x4f')]);}}}})[_0x1a33('0x2f')](function(_0x18f731){logger[_0x1a33('0x2d')](JSON[_0x1a33('0x30')](_0x18f731));});}exports['run']=function(_0x751b99){return getJobs(_0x751b99);};exports[_0x1a33('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xfc77=['basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','stop','run','util','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','Smtp','service','MailAccount','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s'];(function(_0x5e1b4a,_0x118b76){var _0xaf5106=function(_0x2eaab4){while(--_0x2eaab4){_0x5e1b4a['push'](_0x5e1b4a['shift']());}};_0xaf5106(++_0x118b76);}(_0xfc77,0x166));var _0x7fc7=function(_0x536ed3,_0x481b22){_0x536ed3=_0x536ed3-0x0;var _0x1a3f43=_0xfc77[_0x536ed3];return _0x1a3f43;};'use strict';var fs=require('fs');var util=require(_0x7fc7('0x0'));var path=require(_0x7fc7('0x1'));var _=require(_0x7fc7('0x2'));var moment=require('moment');var CronJobManager=require(_0x7fc7('0x3'));var jayson=require(_0x7fc7('0x4'));var BPromise=require('bluebird');var logger=require(_0x7fc7('0x5'))(_0x7fc7('0x6'));var db=require(_0x7fc7('0x7'))['db'];var analyticCustomReportController=require(_0x7fc7('0x8'));var analyticDefaultReportController=require(_0x7fc7('0x9'));var client=jayson[_0x7fc7('0xa')][_0x7fc7('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x35141d,_0x318073){return function(){logger[_0x7fc7('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x35141d[_0x7fc7('0xd')]);var _0x3b2103=!![];var _0xf07e79={'tls':{'rejectUnauthorized':![]}};if(_0x35141d['MailAccount'][_0x7fc7('0xe')][_0x7fc7('0xf')]){_0xf07e79[_0x7fc7('0xf')]=_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xe')][_0x7fc7('0xf')];}else{_0xf07e79[_0x7fc7('0x11')]=_0x35141d['MailAccount']['Smtp'][_0x7fc7('0x11')];_0xf07e79[_0x7fc7('0x12')]=_0x35141d['MailAccount'][_0x7fc7('0xe')]['port'];_0xf07e79[_0x7fc7('0x13')]=_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xe')]['secure'];}if(_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xe')][_0x7fc7('0x14')]){_0xf07e79[_0x7fc7('0x15')]={'user':_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xe')][_0x7fc7('0x16')],'pass':_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xe')][_0x7fc7('0x17')]};}var _0x549950={'account':_0xf07e79,'message':{'from':util[_0x7fc7('0x18')](_0x7fc7('0x19'),_0x35141d[_0x7fc7('0x10')][_0x7fc7('0x1a')],_0x35141d[_0x7fc7('0x10')][_0x7fc7('0xd')]||_0x35141d['MailAccount'][_0x7fc7('0xe')]['user']),'to':_0x35141d[_0x7fc7('0xd')],'cc':_0x35141d['cc'],'bcc':_0x35141d[_0x7fc7('0x1b')],'subject':util[_0x7fc7('0x18')](_0x7fc7('0x1c'),_0x318073[_0x7fc7('0x1a')],_0x35141d['subtractNumber'],_0x35141d[_0x7fc7('0x1d')])}};var _0x35132e=path[_0x7fc7('0x1e')](__dirname,_0x7fc7('0x1f'));var _0x43383b=_0x318073[_0x7fc7('0x20')];var _0x3c5141=util['format'](_0x7fc7('0x21'),path[_0x7fc7('0x22')](_0x318073['savename'],path[_0x7fc7('0x23')](_0x318073['savename'])),_0x7fc7('0x24'));var _0x5773d2=path[_0x7fc7('0x1e')](_0x35132e,_0x43383b);var _0x6a47d7=path['join'](_0x35132e,_0x3c5141);if(fs[_0x7fc7('0x25')](_0x5773d2)){_0x318073[_0x7fc7('0x26')]=_0x7fc7('0x27');_0x549950[_0x7fc7('0x28')][_0x7fc7('0x29')]=[{'filename':_0x43383b,'path':_0x5773d2}];_0x549950[_0x7fc7('0x28')][_0x7fc7('0x2a')]=util[_0x7fc7('0x18')](_0x7fc7('0x2b'),JSON[_0x7fc7('0x2c')](_0x318073,null,0x2));}else if(fs[_0x7fc7('0x25')](_0x6a47d7)){_0x318073[_0x7fc7('0x26')]='Sent';_0x549950[_0x7fc7('0x28')][_0x7fc7('0x29')]=[{'filename':_0x3c5141,'path':_0x6a47d7}];}else{_0x549950[_0x7fc7('0x28')]['text']=_0x7fc7('0x2d');if(!_0x35141d[_0x7fc7('0x2e')]){_0x3b2103=![];logger[_0x7fc7('0xc')](_0x7fc7('0x2f'));}}if(_0x3b2103){return client[_0x7fc7('0x30')](_0x7fc7('0x31'),_0x549950)[_0x7fc7('0x32')](function(_0x3f64d6){if(_0x3f64d6['error']){return logger[_0x7fc7('0x33')](_0x7fc7('0x34'),JSON['stringify'](_0x3f64d6));}return logger[_0x7fc7('0xc')](_0x7fc7('0x35'));})[_0x7fc7('0x36')](function(_0x4c9c36){return logger[_0x7fc7('0x33')]('error\x20mail',JSON['stringify'](_0x4c9c36));});}};}function handleError(){return function(_0xf4c9d){return logger['error'](JSON[_0x7fc7('0x2c')](_0xf4c9d));};}function handleResult(_0x347091){return function(_0x3260d9){logger['info']('data',JSON[_0x7fc7('0x2c')](_0x3260d9));if(_0x347091[_0x7fc7('0x10')]&&_0x347091[_0x7fc7('0x10')][_0x7fc7('0xe')]&&!_[_0x7fc7('0x37')](_0x347091[_0x7fc7('0xd')])){setTimeout(handleSendEmail(_0x347091,_0x3260d9),0x3c*0x3e8);}};}function handleJob(_0x4eff8e){return function(){try{if(_[_0x7fc7('0x37')](_0x4eff8e['subtractNumber'])){return logger[_0x7fc7('0xc')](_0x7fc7('0x38'));}if(_[_0x7fc7('0x37')](_0x4eff8e[_0x7fc7('0x1d')])){return logger[_0x7fc7('0xc')](_0x7fc7('0x39'));}var _0x583ec8={'startDate':moment()[_0x7fc7('0x3a')](_0x4eff8e[_0x7fc7('0x3b')],_0x4eff8e[_0x7fc7('0x1d')])['format'](_0x7fc7('0x3c')),'endDate':moment()[_0x7fc7('0x18')](_0x7fc7('0x3c')),'type':_0x7fc7('0x3d'),'output':_0x4eff8e['output'],'name':_0x4eff8e['name']};if(!_[_0x7fc7('0x37')](_0x4eff8e[_0x7fc7('0x3e')])){logger[_0x7fc7('0xc')](_0x7fc7('0x3f'),_0x4eff8e[_0x7fc7('0x3e')]);return analyticDefaultReportController[_0x7fc7('0x40')]({'id':_0x4eff8e[_0x7fc7('0x3e')]},_0x583ec8)['then'](handleResult(_0x4eff8e))[_0x7fc7('0x36')](handleError());}if(!_['isNil'](_0x4eff8e[_0x7fc7('0x41')])){logger[_0x7fc7('0xc')]('exec\x20custom\x20report\x20id:%s',_0x4eff8e[_0x7fc7('0x41')]);return analyticCustomReportController[_0x7fc7('0x40')]({'id':_0x4eff8e[_0x7fc7('0x41')]},_0x583ec8)[_0x7fc7('0x32')](handleResult(_0x4eff8e))[_0x7fc7('0x36')](handleError());}}catch(_0xaf06a4){logger[_0x7fc7('0x33')](JSON[_0x7fc7('0x2c')](_0xaf06a4));}return logger[_0x7fc7('0xc')](_0x7fc7('0x42'));};}function getJobs(_0x505bec){var _0x336fb0={};if(_0x505bec){_0x336fb0['id']=_0x505bec;}return db[_0x7fc7('0x43')][_0x7fc7('0x44')]({'where':_0x336fb0,'include':[{'model':db[_0x7fc7('0x10')],'attributes':['id',_0x7fc7('0x1a'),_0x7fc7('0xd')],'include':[{'model':db[_0x7fc7('0x45')],'as':_0x7fc7('0xe')}]}]})[_0x7fc7('0x32')](function(_0x4d573c){var _0x5f417a=_[_0x7fc7('0x46')](manager[_0x7fc7('0x47')]);var _0x55c1ca=_[_0x7fc7('0x48')](_0x4d573c,function(_0x368f4b){return _0x368f4b['id'][_0x7fc7('0x49')]();});var _0x170962=_[_0x7fc7('0x4a')](_0x4d573c,function(_0x104384){return _0x104384['id'][_0x7fc7('0x49')]();});var _0x8362ee=_0x505bec?_0x55c1ca:_[_0x7fc7('0x4b')](_0x55c1ca,_0x5f417a);var _0x110ff4=_[_0x7fc7('0x4c')](_0x55c1ca,_0x5f417a);var _0x2479ac=_[_0x7fc7('0x4b')](_0x5f417a,_0x55c1ca);var _0x4d47bf;var _0x5a5ae9;for(_0x4d47bf=0x0;_0x4d47bf<_0x2479ac[_0x7fc7('0x4d')]&&!_0x505bec;_0x4d47bf+=0x1){_0x5a5ae9=_0x2479ac[_0x4d47bf][_0x7fc7('0x49')]();if(manager[_0x7fc7('0x4e')](_0x5a5ae9)){manager['stop'](_0x5a5ae9);manager[_0x7fc7('0x4f')](_0x5a5ae9);logger[_0x7fc7('0xc')](_0x7fc7('0x50'),_0x5a5ae9);}}logger[_0x7fc7('0xc')](_0x7fc7('0x51'),JSON['stringify'](_0x8362ee));for(_0x4d47bf=0x0;_0x4d47bf<_0x8362ee[_0x7fc7('0x4d')];_0x4d47bf+=0x1){_0x5a5ae9=_0x8362ee[_0x4d47bf][_0x7fc7('0x49')]();logger['info'](_0x7fc7('0x52'),_0x5a5ae9);if(_0x505bec){logger['info'](_0x7fc7('0x53'),_0x505bec);logger['info'](JSON['stringify'](_0x170962[_0x5a5ae9]));BPromise[_0x7fc7('0x54')]()[_0x7fc7('0x32')](handleJob(_0x170962[_0x5a5ae9]));logger[_0x7fc7('0xc')](_0x7fc7('0x55'),_0x170962[_0x5a5ae9][_0x7fc7('0x1a')],_0x170962[_0x5a5ae9][_0x7fc7('0x56')]);}else if(_0x170962[_0x5a5ae9]['cron']&&_0x170962[_0x5a5ae9]['active']&&moment()[_0x7fc7('0x57')](_0x170962[_0x5a5ae9][_0x7fc7('0x58')],_0x170962[_0x5a5ae9]['endAt'])){manager[_0x7fc7('0x59')](_0x5a5ae9,_0x170962[_0x5a5ae9][_0x7fc7('0x56')],handleJob(_0x170962[_0x5a5ae9]));manager[_0x7fc7('0x5a')](_0x5a5ae9);logger[_0x7fc7('0xc')](_0x7fc7('0x5b'),_0x170962[_0x5a5ae9][_0x7fc7('0x1a')],_0x170962[_0x5a5ae9]['cron']);}else if(manager['exists'](_0x5a5ae9)){manager['stop'](_0x5a5ae9);manager[_0x7fc7('0x4f')](_0x5a5ae9);logger[_0x7fc7('0xc')](_0x7fc7('0x5c'),_0x170962[_0x5a5ae9][_0x7fc7('0x1a')],_0x170962[_0x5a5ae9]['cron']);}}for(_0x4d47bf=0x0,_0x5a5ae9;_0x4d47bf<_0x110ff4[_0x7fc7('0x4d')]&&!_0x505bec;_0x4d47bf+=0x1){_0x5a5ae9=_0x110ff4[_0x4d47bf][_0x7fc7('0x49')]();if(manager[_0x7fc7('0x4e')](_0x5a5ae9)){if(_0x170962[_0x5a5ae9]['cron']&&_0x170962[_0x5a5ae9][_0x7fc7('0x5d')]&&moment()[_0x7fc7('0x57')](_0x170962[_0x5a5ae9][_0x7fc7('0x58')],_0x170962[_0x5a5ae9]['endAt'])){manager[_0x7fc7('0x5e')](_0x5a5ae9,_0x170962[_0x5a5ae9][_0x7fc7('0x56')],handleJob(_0x170962[_0x5a5ae9]));logger[_0x7fc7('0xc')](_0x7fc7('0x5f'),_0x170962[_0x5a5ae9][_0x7fc7('0x1a')],_0x170962[_0x5a5ae9]['cron']);}else{manager[_0x7fc7('0x60')](_0x5a5ae9);manager[_0x7fc7('0x4f')](_0x5a5ae9);logger[_0x7fc7('0xc')](_0x7fc7('0x5c'),_0x170962[_0x5a5ae9][_0x7fc7('0x1a')],_0x170962[_0x5a5ae9][_0x7fc7('0x56')]);}}}})[_0x7fc7('0x36')](function(_0x1a7eb7){logger[_0x7fc7('0x33')](JSON[_0x7fc7('0x2c')](_0x1a7eb7));});}exports[_0x7fc7('0x61')]=function(_0x5a3076){return getJobs(_0x5a3076);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 91873b3..712fbb3 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 _0x2a84=['all','catch','start','lodash','aws-sdk','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Mixed','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Transcribe\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','forEach','push'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2a84,0x170));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};var _=require(_0x42a8('0x0'));var AWS=require(_0x42a8('0x1'));var rp=require('request-promise');var util=require(_0x42a8('0x2'));var BPromise=require(_0x42a8('0x3'));var db=require(_0x42a8('0x4'))['db'];var logger=require('../../config/logger')(_0x42a8('0x5'));function getTranscriptionJob(_0x49dca9,_0xea116f,_0x1dc04a,_0x1b6a6a){return new Promise(function(_0x59505e,_0x593b3a){var _0x4b17b7=new AWS[(_0x42a8('0x6'))]({'accessKeyId':_0xea116f,'secretAccessKey':_0x49dca9,'region':_0x1dc04a});_0x4b17b7[_0x42a8('0x7')]({'TranscriptionJobName':_0x1b6a6a},function(_0x4ff8e0,_0x2aa872){if(_0x4ff8e0){return _0x593b3a(_0x4ff8e0);}else{return _0x59505e(_0x2aa872);}});});}function sentiment(_0x454118,_0x5b93ac,_0x40062e,_0x29fc29,_0x53048e){return new Promise(function(_0x127d12,_0x3467d4){var _0x7a340c=new AWS['Comprehend']({'accessKeyId':_0x5b93ac,'secretAccessKey':_0x454118,'region':_0x40062e});_0x7a340c['detectSentiment']({'Text':_0x29fc29,'LanguageCode':_0x53048e[_0x42a8('0x8')](0x0,0x2)},function(_0x54e4a5,_0x2cffd7){if(_0x54e4a5){return _0x3467d4(_0x54e4a5);}else{return _0x127d12(_0x2cffd7);}});});}function checkTranscribeJob(_0x52c0c3,_0x5441d7,_0x25dcb8){var _0x3133c4;return new BPromise(function(_0x449617,_0xb041a0){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0xb'),_0x52c0c3['id'],_0x52c0c3[_0x42a8('0xc')]));return getTranscriptionJob(_0x25dcb8['data1'],_0x25dcb8['data2'],_0x5441d7[_0x42a8('0xd')],_0x52c0c3[_0x42a8('0xc')])[_0x42a8('0xe')](function(_0x542543){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0xf'),_0x52c0c3['id'],_0x52c0c3[_0x42a8('0xc')],_0x542543[_0x42a8('0x10')][_0x42a8('0x11')]));if(!_0x52c0c3[_0x42a8('0x12')]){switch(_0x542543[_0x42a8('0x10')][_0x42a8('0x11')]){case'COMPLETED':var _0x509b0a={'transcribeStatus':_0x542543['TranscriptionJob'][_0x42a8('0x11')],'fileUri':_0x542543[_0x42a8('0x10')][_0x42a8('0x13')][_0x42a8('0x14')]};logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x15'),_0x52c0c3['id']));return rp({'uri':_0x542543['TranscriptionJob'][_0x42a8('0x13')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x58f83a){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x16'),_0x52c0c3['id']));if(_0x58f83a&&_0x58f83a['results']&&_0x58f83a[_0x42a8('0x17')]['transcripts']&&_0x58f83a['results'][_0x42a8('0x18')][_0x42a8('0x19')]){_0x509b0a[_0x42a8('0x12')]='';for(var _0xe6c44c=0x0;_0xe6c44c<_0x58f83a['results'][_0x42a8('0x18')]['length'];_0xe6c44c++){_0x509b0a[_0x42a8('0x12')]+=_0x58f83a[_0x42a8('0x17')][_0x42a8('0x18')][_0xe6c44c][_0x42a8('0x1a')]+'';}}return _0x52c0c3[_0x42a8('0x1b')](_0x509b0a);})[_0x42a8('0xe')](function(){logger['info'](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x52c0c3['id']));if(!_0x52c0c3[_0x42a8('0x1c')]){throw new db['Sequelize'][(_0x42a8('0x1d'))](_0x42a8('0x1e'));}if(!_0x5441d7[_0x42a8('0x1f')]||!_0x5441d7[_0x42a8('0x20')]||!_0x5441d7[_0x42a8('0x21')]||!_0x5441d7[_0x42a8('0x22')]||!_0x5441d7[_0x42a8('0x23')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x25'));}if(!_0x509b0a[_0x42a8('0x12')]){throw new Error(_0x42a8('0x26'));}if(_0x5441d7['sentimentAccountId']===_0x25dcb8['id']){return _0x25dcb8;}else{return db[_0x42a8('0x27')][_0x42a8('0x28')]({'where':{'id':_settings[_0x42a8('0x20')]}});}})[_0x42a8('0xe')](function(_0x85793d){if(!_0x85793d){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x29'));}if(!_0x85793d[_0x42a8('0x2a')]||!_0x85793d[_0x42a8('0x2b')]){throw new db['Sequelize'][(_0x42a8('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x3133c4=_0x85793d;logger[_0x42a8('0x9')](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x52c0c3['id']));return sentiment(_0x3133c4[_0x42a8('0x2a')],_0x3133c4[_0x42a8('0x2b')],_0x5441d7[_0x42a8('0x21')],_0x509b0a[_0x42a8('0x12')],_0x5441d7[_0x42a8('0x22')]);})['then'](function(_0x2a155e){logger[_0x42a8('0x9')](util['format'](_0x42a8('0x2c'),_0x52c0c3['id']));return _0x52c0c3[_0x42a8('0x1b')]({'sentiment':_0x2a155e[_0x42a8('0x2d')],'sPositive':_0x2a155e['SentimentScore'][_0x42a8('0x2e')],'sNegative':_0x2a155e['SentimentScore'][_0x42a8('0x2f')],'sMixed':_0x2a155e['SentimentScore']['Mixed'],'sNeutral':_0x2a155e[_0x42a8('0x30')][_0x42a8('0x31')]});})[_0x42a8('0xe')](function(){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});case _0x42a8('0x33'):return _0x52c0c3[_0x42a8('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x542543['TranscriptionJob'][_0x42a8('0x34')]})[_0x42a8('0xe')](function(){logger[_0x42a8('0x9')](util['format'](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});default:logger[_0x42a8('0x9')](util[_0x42a8('0xa')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x52c0c3['id']));break;}}else{return BPromise[_0x42a8('0x35')]()[_0x42a8('0xe')](function(){if(!_0x52c0c3[_0x42a8('0x1c')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5441d7[_0x42a8('0x1f')]||!_0x5441d7[_0x42a8('0x20')]||!_0x5441d7[_0x42a8('0x21')]||!_0x5441d7[_0x42a8('0x22')]||!_0x5441d7[_0x42a8('0x23')]){throw new db['Sequelize'][(_0x42a8('0x1d'))](_0x42a8('0x25'));}if(!_0x52c0c3[_0x42a8('0x12')]){throw new Error(_0x42a8('0x26'));}if(_0x5441d7[_0x42a8('0x20')]===_0x25dcb8['id']){return _0x25dcb8;}else{return db['CloudProvider'][_0x42a8('0x28')]({'where':{'id':_settings[_0x42a8('0x20')]}});}})[_0x42a8('0xe')](function(_0x2b8206){if(!_0x2b8206){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x29'));}if(!_0x2b8206[_0x42a8('0x2a')]||!_0x2b8206['data2']){throw new db[(_0x42a8('0x24'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x3133c4=_0x2b8206;logger['info'](util['format'](_0x42a8('0x36'),_0x52c0c3['id']));return sentiment(_0x3133c4[_0x42a8('0x2a')],_0x3133c4['data2'],_0x5441d7[_0x42a8('0x21')],_0x52c0c3[_0x42a8('0x12')],_0x5441d7[_0x42a8('0x22')]);})[_0x42a8('0xe')](function(_0x51302c){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x2c'),_0x52c0c3['id']));return _0x52c0c3[_0x42a8('0x1b')]({'sentiment':_0x51302c[_0x42a8('0x2d')],'sPositive':_0x51302c['SentimentScore'][_0x42a8('0x2e')],'sNegative':_0x51302c[_0x42a8('0x30')][_0x42a8('0x2f')],'sMixed':_0x51302c[_0x42a8('0x30')][_0x42a8('0x37')],'sNeutral':_0x51302c[_0x42a8('0x30')]['Neutral'],'transcribeStatus':_0x42a8('0x38')});})['then'](function(){logger[_0x42a8('0x9')](util[_0x42a8('0xa')](_0x42a8('0x32'),_0x52c0c3['id']));_0x449617();});}})['catch'](function(_0x556a0f){if(_0x556a0f){if(!_0x556a0f[_0x42a8('0x39')]||_0x556a0f['name']!==_0x42a8('0x3a')){logger[_0x42a8('0x3b')](util[_0x42a8('0xa')](_0x42a8('0x3c'),_0x52c0c3['id']),util[_0x42a8('0x3d')](_0x556a0f,{'showHidden':![],'depth':null}));}}_0x449617();});});}function checkTranscribe(){var _0x285e64;var _0xc576f8;var _0x17aec8;return db[_0x42a8('0x3e')][_0x42a8('0x3f')]({'where':{'transcribeStatus':_0x42a8('0x40')}})[_0x42a8('0xe')](function(_0x5863ac){if(!_0x5863ac||!_0x5863ac['length']){throw new db[(_0x42a8('0x24'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x285e64=_0x5863ac;return db['Setting'][_0x42a8('0x28')]({'where':{'id':0x1}});})[_0x42a8('0xe')](function(_0x5aae6b){if(!_0x5aae6b){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))]('Settings\x20not\x20available');}_0xc576f8=_0x5aae6b;if(!_0xc576f8['transcribe']||!_0xc576f8['transcribeAccountId']||!_0xc576f8[_0x42a8('0xd')]||!_0xc576f8[_0x42a8('0x22')]||!_0xc576f8[_0x42a8('0x23')]){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x41'));}return db[_0x42a8('0x27')][_0x42a8('0x28')]({'where':{'id':_0xc576f8[_0x42a8('0x42')]}});})[_0x42a8('0xe')](function(_0x142b12){if(!_0x142b12){throw new db['Sequelize']['ValidationError'](_0x42a8('0x29'));}if(!_0x142b12[_0x42a8('0x2a')]||!_0x142b12['data2']){throw new db[(_0x42a8('0x24'))][(_0x42a8('0x1d'))](_0x42a8('0x43'));}_0x17aec8=_0x142b12;var _0x2eeb0c=[];_0x285e64[_0x42a8('0x44')](function(_0x36db51){_0x2eeb0c[_0x42a8('0x45')](checkTranscribeJob(_0x36db51,_0xc576f8,_0x17aec8));});return BPromise[_0x42a8('0x46')](_0x2eeb0c);})[_0x42a8('0x47')](function(_0x2d3443){if(_0x2d3443){if(!_0x2d3443['name']||_0x2d3443[_0x42a8('0x39')]!=='SequelizeValidationError'){logger[_0x42a8('0x3b')](util[_0x42a8('0x3d')](_0x2d3443,{'showHidden':![],'depth':null}));}}});}exports[_0x42a8('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x153c=['substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Positive','catch','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','forEach','push','all','name','SequelizeValidationError','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment'];(function(_0x2ae46e,_0x4bd884){var _0x2c809f=function(_0x2bf4b8){while(--_0x2bf4b8){_0x2ae46e['push'](_0x2ae46e['shift']());}};_0x2c809f(++_0x4bd884);}(_0x153c,0x8c));var _0xc153=function(_0x2da63a,_0x46ff10){_0x2da63a=_0x2da63a-0x0;var _0x193669=_0x153c[_0x2da63a];return _0x193669;};var _=require(_0xc153('0x0'));var AWS=require(_0xc153('0x1'));var rp=require(_0xc153('0x2'));var util=require(_0xc153('0x3'));var BPromise=require('bluebird');var db=require(_0xc153('0x4'))['db'];var logger=require(_0xc153('0x5'))(_0xc153('0x6'));function getTranscriptionJob(_0x22c05b,_0x2e075e,_0x24fa12,_0x34e4b2){return new Promise(function(_0x58f5c5,_0x267a79){var _0x46a8b7=new AWS[(_0xc153('0x7'))]({'accessKeyId':_0x2e075e,'secretAccessKey':_0x22c05b,'region':_0x24fa12});_0x46a8b7[_0xc153('0x8')]({'TranscriptionJobName':_0x34e4b2},function(_0x374a0c,_0x5a844b){if(_0x374a0c){return _0x267a79(_0x374a0c);}else{return _0x58f5c5(_0x5a844b);}});});}function sentiment(_0x584a57,_0x5838f2,_0x3843d3,_0x3566e3,_0x12ecca){return new Promise(function(_0x4040b3,_0x1d706e){var _0x5367d7=new AWS['Comprehend']({'accessKeyId':_0x5838f2,'secretAccessKey':_0x584a57,'region':_0x3843d3});_0x5367d7[_0xc153('0x9')]({'Text':_0x3566e3,'LanguageCode':_0x12ecca[_0xc153('0xa')](0x0,0x2)},function(_0x49b44c,_0x138fae){if(_0x49b44c){return _0x1d706e(_0x49b44c);}else{return _0x4040b3(_0x138fae);}});});}function checkTranscribeJob(_0x361e7f,_0x4f48f5,_0x49286f){var _0x1c9d09;return new BPromise(function(_0x1f7c65,_0x2e92f5){logger['info'](util[_0xc153('0xb')](_0xc153('0xc'),_0x361e7f['id'],_0x361e7f[_0xc153('0xd')]));return getTranscriptionJob(_0x49286f['data1'],_0x49286f[_0xc153('0xe')],_0x4f48f5[_0xc153('0xf')],_0x361e7f['transcribeName'])['then'](function(_0x41c1a3){logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x11'),_0x361e7f['id'],_0x361e7f[_0xc153('0xd')],_0x41c1a3[_0xc153('0x12')][_0xc153('0x13')]));if(!_0x361e7f[_0xc153('0x14')]){switch(_0x41c1a3['TranscriptionJob'][_0xc153('0x13')]){case _0xc153('0x15'):var _0x19fc4e={'transcribeStatus':_0x41c1a3['TranscriptionJob'][_0xc153('0x13')],'fileUri':_0x41c1a3['TranscriptionJob']['Transcript'][_0xc153('0x16')]};logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x17'),_0x361e7f['id']));return rp({'uri':_0x41c1a3[_0xc153('0x12')][_0xc153('0x18')]['TranscriptFileUri'],'json':!![]})[_0xc153('0x19')](function(_0x4b7a9d){logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x1a'),_0x361e7f['id']));if(_0x4b7a9d&&_0x4b7a9d[_0xc153('0x1b')]&&_0x4b7a9d['results']['transcripts']&&_0x4b7a9d[_0xc153('0x1b')]['transcripts'][_0xc153('0x1c')]){_0x19fc4e[_0xc153('0x14')]='';for(var _0x2a1ea6=0x0;_0x2a1ea6<_0x4b7a9d[_0xc153('0x1b')]['transcripts'][_0xc153('0x1c')];_0x2a1ea6++){_0x19fc4e[_0xc153('0x14')]+=_0x4b7a9d[_0xc153('0x1b')][_0xc153('0x1d')][_0x2a1ea6][_0xc153('0x1e')]+'';}}return _0x361e7f[_0xc153('0x1f')](_0x19fc4e);})['then'](function(){logger[_0xc153('0x10')](util['format'](_0xc153('0x20'),_0x361e7f['id']));if(!_0x361e7f[_0xc153('0x21')]){throw new db['Sequelize'][(_0xc153('0x22'))](_0xc153('0x23'));}if(!_0x4f48f5['sentiment']||!_0x4f48f5[_0xc153('0x24')]||!_0x4f48f5[_0xc153('0x25')]||!_0x4f48f5[_0xc153('0x26')]||!_0x4f48f5['bucket']){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x28'));}if(!_0x19fc4e['fileText']){throw new Error(_0xc153('0x29'));}if(_0x4f48f5[_0xc153('0x24')]===_0x49286f['id']){return _0x49286f;}else{return db[_0xc153('0x2a')][_0xc153('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc153('0x19')](function(_0x56afaa){if(!_0x56afaa){throw new db[(_0xc153('0x27'))]['ValidationError'](_0xc153('0x2c'));}if(!_0x56afaa[_0xc153('0x2d')]||!_0x56afaa['data2']){throw new db[(_0xc153('0x27'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x1c9d09=_0x56afaa;logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x2e'),_0x361e7f['id']));return sentiment(_0x1c9d09[_0xc153('0x2d')],_0x1c9d09[_0xc153('0xe')],_0x4f48f5['sentimentRegion'],_0x19fc4e[_0xc153('0x14')],_0x4f48f5[_0xc153('0x26')]);})[_0xc153('0x19')](function(_0x2c1f35){logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x2f'),_0x361e7f['id']));return _0x361e7f[_0xc153('0x1f')]({'sentiment':_0x2c1f35[_0xc153('0x30')],'sPositive':_0x2c1f35[_0xc153('0x31')]['Positive'],'sNegative':_0x2c1f35['SentimentScore'][_0xc153('0x32')],'sMixed':_0x2c1f35['SentimentScore'][_0xc153('0x33')],'sNeutral':_0x2c1f35[_0xc153('0x31')][_0xc153('0x34')]});})['then'](function(){logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x20'),_0x361e7f['id']));_0x1f7c65();});case _0xc153('0x35'):return _0x361e7f[_0xc153('0x1f')]({'transcribeStatus':_0xc153('0x35'),'failureReason':_0x41c1a3[_0xc153('0x12')][_0xc153('0x36')]})['then'](function(){logger['info'](util[_0xc153('0xb')](_0xc153('0x20'),_0x361e7f['id']));_0x1f7c65();});default:logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x37'),_0x361e7f['id']));break;}}else{return BPromise[_0xc153('0x38')]()['then'](function(){if(!_0x361e7f[_0xc153('0x21')]){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4f48f5[_0xc153('0x39')]||!_0x4f48f5[_0xc153('0x24')]||!_0x4f48f5[_0xc153('0x25')]||!_0x4f48f5['language']||!_0x4f48f5['bucket']){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x361e7f[_0xc153('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x4f48f5[_0xc153('0x24')]===_0x49286f['id']){return _0x49286f;}else{return db[_0xc153('0x2a')][_0xc153('0x2b')]({'where':{'id':_settings[_0xc153('0x24')]}});}})[_0xc153('0x19')](function(_0x3d09d5){if(!_0x3d09d5){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x2c'));}if(!_0x3d09d5[_0xc153('0x2d')]||!_0x3d09d5[_0xc153('0xe')]){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x1c9d09=_0x3d09d5;logger[_0xc153('0x10')](util[_0xc153('0xb')](_0xc153('0x2e'),_0x361e7f['id']));return sentiment(_0x1c9d09[_0xc153('0x2d')],_0x1c9d09[_0xc153('0xe')],_0x4f48f5['sentimentRegion'],_0x361e7f[_0xc153('0x14')],_0x4f48f5[_0xc153('0x26')]);})['then'](function(_0x5c3c37){logger[_0xc153('0x10')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x361e7f['id']));return _0x361e7f['update']({'sentiment':_0x5c3c37[_0xc153('0x30')],'sPositive':_0x5c3c37['SentimentScore'][_0xc153('0x3a')],'sNegative':_0x5c3c37[_0xc153('0x31')][_0xc153('0x32')],'sMixed':_0x5c3c37['SentimentScore']['Mixed'],'sNeutral':_0x5c3c37[_0xc153('0x31')][_0xc153('0x34')],'transcribeStatus':_0xc153('0x15')});})[_0xc153('0x19')](function(){logger[_0xc153('0x10')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x361e7f['id']));_0x1f7c65();});}})[_0xc153('0x3b')](function(_0x5a38ed){if(_0x5a38ed){if(!_0x5a38ed['name']||_0x5a38ed['name']!=='SequelizeValidationError'){logger[_0xc153('0x3c')](util['format'](_0xc153('0x3d'),_0x361e7f['id']),util[_0xc153('0x3e')](_0x5a38ed,{'showHidden':![],'depth':null}));}}_0x1f7c65();});});}function checkTranscribe(){var _0x31c2f7;var _0x20be09;var _0x41eed2;return db['VoiceRecording'][_0xc153('0x3f')]({'where':{'transcribeStatus':_0xc153('0x40')}})[_0xc153('0x19')](function(_0x109814){if(!_0x109814||!_0x109814[_0xc153('0x1c')]){throw new db['Sequelize']['ValidationError'](_0xc153('0x41'));}_0x31c2f7=_0x109814;return db['Setting'][_0xc153('0x2b')]({'where':{'id':0x1}});})[_0xc153('0x19')](function(_0x108c00){if(!_0x108c00){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x42'));}_0x20be09=_0x108c00;if(!_0x20be09[_0xc153('0x6')]||!_0x20be09['transcribeAccountId']||!_0x20be09[_0xc153('0xf')]||!_0x20be09['language']||!_0x20be09['bucket']){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x43'));}return db[_0xc153('0x2a')][_0xc153('0x2b')]({'where':{'id':_0x20be09[_0xc153('0x44')]}});})[_0xc153('0x19')](function(_0x39e810){if(!_0x39e810){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x2c'));}if(!_0x39e810[_0xc153('0x2d')]||!_0x39e810[_0xc153('0xe')]){throw new db[(_0xc153('0x27'))][(_0xc153('0x22'))](_0xc153('0x45'));}_0x41eed2=_0x39e810;var _0x5e1f68=[];_0x31c2f7[_0xc153('0x46')](function(_0x366d94){_0x5e1f68[_0xc153('0x47')](checkTranscribeJob(_0x366d94,_0x20be09,_0x41eed2));});return BPromise[_0xc153('0x48')](_0x5e1f68);})[_0xc153('0x3b')](function(_0x3c2fb2){if(_0x3c2fb2){if(!_0x3c2fb2[_0xc153('0x49')]||_0x3c2fb2[_0xc153('0x49')]!==_0xc153('0x4a')){logger[_0xc153('0x3c')](util['inspect'](_0x3c2fb2,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index e36ab13..481f70e 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 _0xd739=['catch','error','inspect','start','lodash','moment','../../mysqldb','schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','length','whatsappInteraction:update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd739,0x17b));var _0x9d73=function(_0x22730a,_0x26a667){_0x22730a=_0x22730a-0x0;var _0x444912=_0xd739[_0x22730a];return _0x444912;};'use strict';var _=require(_0x9d73('0x0'));var moment=require(_0x9d73('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0x9d73('0x2'))['db'];var logger=require('../logger')(_0x9d73('0x3'));config[_0x9d73('0x4')]=_[_0x9d73('0x5')](config[_0x9d73('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9d73('0x4')]));function closeInteractions(){var _0x4763e0=[];return db[_0x9d73('0x6')][_0x9d73('0x7')]({'raw':!![],'attributes':['id',_0x9d73('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9d73('0x9')](0x18,_0x9d73('0xa'))}}})['then'](function(_0x491d1d){if(_0x491d1d&&_0x491d1d['length']){_0x4763e0=_[_0x9d73('0xb')](_0x491d1d||[],'id');logger['info'](_0x9d73('0xc'),_0x4763e0[_0x9d73('0xd')]());return db[_0x9d73('0x6')]['update']({'closeReason':_0x9d73('0xe'),'disposition':_0x9d73('0xf'),'closed':!![],'closedAt':moment()[_0x9d73('0x10')](_0x9d73('0x11'))},{'where':{'id':_0x4763e0}});}})['then'](function(){if(_0x4763e0&&_0x4763e0['length']){logger[_0x9d73('0x12')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4763e0['join']());for(var _0x148c1f=0x0;_0x148c1f<_0x4763e0[_0x9d73('0x13')];_0x148c1f++){io['emit'](_0x9d73('0x14'),{'id':_0x4763e0[_0x148c1f],'closed':!![]});}}})[_0x9d73('0x15')](function(_0x1f796d){logger[_0x9d73('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1f796d?util[_0x9d73('0x17')](_0x1f796d,{'showHidden':![],'depth':null}):'');});}exports[_0x9d73('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4075=['length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','hours'];(function(_0x20e40d,_0x2a9f0f){var _0x558350=function(_0x1cb908){while(--_0x1cb908){_0x20e40d['push'](_0x20e40d['shift']());}};_0x558350(++_0x2a9f0f);}(_0x4075,0xcc));var _0x5407=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0x4075[_0x4fa291];return _0x506d9b;};'use strict';var _=require(_0x5407('0x0'));var moment=require(_0x5407('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x5407('0x2'));var db=require(_0x5407('0x3'))['db'];var logger=require(_0x5407('0x4'))(_0x5407('0x5'));config[_0x5407('0x6')]=_[_0x5407('0x7')](config[_0x5407('0x6')],{'host':_0x5407('0x8'),'port':0x18eb});var io=require(_0x5407('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x2443a7=[];return db[_0x5407('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x5407('0xb'))}}})['then'](function(_0x57d35e){if(_0x57d35e&&_0x57d35e[_0x5407('0xc')]){_0x2443a7=_[_0x5407('0xd')](_0x57d35e||[],'id');logger[_0x5407('0xe')](_0x5407('0xf'),_0x2443a7[_0x5407('0x10')]());return db['WhatsappInteraction'][_0x5407('0x11')]({'closeReason':_0x5407('0x12'),'disposition':_0x5407('0x13'),'closed':!![],'closedAt':moment()[_0x5407('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2443a7}});}})[_0x5407('0x15')](function(){if(_0x2443a7&&_0x2443a7[_0x5407('0xc')]){logger[_0x5407('0xe')](_0x5407('0x16'),_0x2443a7[_0x5407('0x10')]());for(var _0x58ac2f=0x0;_0x58ac2f<_0x2443a7[_0x5407('0xc')];_0x58ac2f++){io['emit']('whatsappInteraction:update',{'id':_0x2443a7[_0x58ac2f],'closed':!![]});}}})[_0x5407('0x17')](function(_0x2b7d8b){logger['error'](_0x5407('0x18'),_0x2b7d8b?util[_0x5407('0x19')](_0x2b7d8b,{'showHidden':![],'depth':null}):'');});}exports[_0x5407('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index dfa577d..08c2f4e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8883=['catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','finished\x20populating','CmHopper','destroy','hopper1','log','contacts2'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x8883,0xef));var _0x3888=function(_0x4088a0,_0x163ade){_0x4088a0=_0x4088a0-0x0;var _0x5e3955=_0x8883[_0x4088a0];return _0x5e3955;};'use strict';var util=require(_0x3888('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3888('0x1')]({'id':i,'firstName':_0x3888('0x2')+i,'lastName':_0x3888('0x3')+i,'phone':0xf879fb460+i,'email':_0x3888('0x4')+i+_0x3888('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3888('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3888('0x6')](),'updatedAt':Date[_0x3888('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3888('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3888('0x4')+i+_0x3888('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3888('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x3888('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3888('0x6')](),'updatedAt':Date[_0x3888('0x6')]()});}db[_0x3888('0x7')]['destroy']({'where':{}})[_0x3888('0x8')](function(){return db[_0x3888('0x7')][_0x3888('0x9')](contacts);})[_0x3888('0x8')](function(){console['log'](_0x3888('0xa'),'contacts1');return db[_0x3888('0xb')][_0x3888('0xc')]({'where':{}});})[_0x3888('0x8')](function(){return db[_0x3888('0xb')][_0x3888('0x9')](hopper);})[_0x3888('0x8')](function(){console['log'](_0x3888('0xa'),_0x3888('0xd'));return db[_0x3888('0x7')]['bulkCreate'](contacts2);})[_0x3888('0x8')](function(){console[_0x3888('0xe')](_0x3888('0xa'),_0x3888('0xf'));return db[_0x3888('0xb')]['bulkCreate'](hopper2);})[_0x3888('0x8')](function(){console[_0x3888('0xe')](_0x3888('0xa'),'hopper2');})[_0x3888('0x10')](function(_0x1121b4){console[_0x3888('0xe')](_0x1121b4);}); \ No newline at end of file +var _0x9c4c=['CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','destroy','CmContact','bulkCreate','then','log','finished\x20populating','contacts1'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c4c,0x181));var _0xc9c4=function(_0x565975,_0x20a5c6){_0x565975=_0x565975-0x0;var _0x76817c=_0x9c4c[_0x565975];return _0x76817c;};'use strict';var util=require(_0xc9c4('0x0'));var db=require(_0xc9c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc9c4('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc9c4('0x3')+i,'phone':0xf879fb460+i,'email':_0xc9c4('0x4')+i+_0xc9c4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc9c4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc9c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc9c4('0x6')](),'updatedAt':Date[_0xc9c4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc9c4('0x2')]({'id':i,'firstName':_0xc9c4('0x7')+i,'lastName':_0xc9c4('0x3')+i,'phone':0xf879fb460+i,'email':_0xc9c4('0x4')+i+_0xc9c4('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc9c4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc9c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc9c4('0x6')](),'updatedAt':Date[_0xc9c4('0x6')]()});}db['CmContact'][_0xc9c4('0x8')]({'where':{}})['then'](function(){return db[_0xc9c4('0x9')][_0xc9c4('0xa')](contacts);})[_0xc9c4('0xb')](function(){console[_0xc9c4('0xc')](_0xc9c4('0xd'),_0xc9c4('0xe'));return db[_0xc9c4('0xf')][_0xc9c4('0x8')]({'where':{}});})[_0xc9c4('0xb')](function(){return db['CmHopper'][_0xc9c4('0xa')](hopper);})[_0xc9c4('0xb')](function(){console['log'](_0xc9c4('0xd'),_0xc9c4('0x10'));return db['CmContact'][_0xc9c4('0xa')](contacts2);})[_0xc9c4('0xb')](function(){console[_0xc9c4('0xc')](_0xc9c4('0xd'),_0xc9c4('0x11'));return db[_0xc9c4('0xf')]['bulkCreate'](hopper2);})[_0xc9c4('0xb')](function(){console['log'](_0xc9c4('0xd'),_0xc9c4('0x12'));})[_0xc9c4('0x13')](function(_0x79e607){console[_0xc9c4('0xc')](_0x79e607);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7d525cc..4942d75 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc35=['log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then'];(function(_0x48b5a2,_0x5014c7){var _0xc7f542=function(_0xa288f5){while(--_0xa288f5){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0xc7f542(++_0x5014c7);}(_0xcc35,0x133));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5cc3('0x0'));var db=require(_0x5cc3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5cc3('0x2')]({'name':util[_0x5cc3('0x3')](_0x5cc3('0x4'),_0x5cc3('0x5'),i),'fullname':util[_0x5cc3('0x3')]('%s%s',_0x5cc3('0x5'),i),'email':util[_0x5cc3('0x3')](_0x5cc3('0x6'),_0x5cc3('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x5cc3('0x7'),'ws',_0x5cc3('0x8')],'disallow':['all'],'allow':[_0x5cc3('0x9')],'defaultuser':util[_0x5cc3('0x3')](_0x5cc3('0x4'),_0x5cc3('0x5'),i),'encryption':_0x5cc3('0xa'),'avpf':_0x5cc3('0xa'),'force_avp':_0x5cc3('0xa'),'icesupport':'yes','dtlsenable':_0x5cc3('0xa'),'dtlsverify':'no','dtlscertfile':_0x5cc3('0xb'),'dtlsprivatekey':_0x5cc3('0xc'),'dtlssetup':_0x5cc3('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x5cc3('0x3')](_0x5cc3('0x4'),_0x5cc3('0x5'),i),0xfa0+i)});}db['User'][_0x5cc3('0xe')](users)[_0x5cc3('0xf')](function(){console[_0x5cc3('0x10')](_0x5cc3('0x11'));})[_0x5cc3('0x12')](function(_0x1df026){console['log'](_0x1df026);}); \ No newline at end of file +var _0x89d8=['catch','util','../mysqldb','push','format','%s%s','agent','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user'];(function(_0x3f2f3c,_0xfcb0de){var _0x5e9693=function(_0x115f02){while(--_0x115f02){_0x3f2f3c['push'](_0x3f2f3c['shift']());}};_0x5e9693(++_0xfcb0de);}(_0x89d8,0xa9));var _0x889d=function(_0x2a1ee0,_0x5c02aa){_0x2a1ee0=_0x2a1ee0-0x0;var _0x4d44df=_0x89d8[_0x2a1ee0];return _0x4d44df;};'use strict';var util=require(_0x889d('0x0'));var db=require(_0x889d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x889d('0x2')]({'name':util[_0x889d('0x3')](_0x889d('0x4'),_0x889d('0x5'),i),'fullname':util[_0x889d('0x3')]('%s%s',_0x889d('0x5'),i),'email':util[_0x889d('0x3')]('%s%s@xcally.com',_0x889d('0x5'),i),'role':'agent','password':_0x889d('0x6'),'internal':0xfa0+i,'type':_0x889d('0x7'),'transport':['udp','ws',_0x889d('0x8')],'disallow':[_0x889d('0x9')],'allow':[_0x889d('0xa')],'defaultuser':util[_0x889d('0x3')]('%s%s','agent',i),'encryption':'yes','avpf':'yes','force_avp':_0x889d('0xb'),'icesupport':_0x889d('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x889d('0xc'),'dtlsprivatekey':_0x889d('0xd'),'dtlssetup':_0x889d('0xe'),'callerid':util[_0x889d('0x3')]('\x22%s\x22\x20<%s>',util['format'](_0x889d('0x4'),_0x889d('0x5'),i),0xfa0+i)});}db[_0x889d('0xf')][_0x889d('0x10')](users)[_0x889d('0x11')](function(){console[_0x889d('0x12')](_0x889d('0x13'));})[_0x889d('0x14')](function(_0x1268bb){console[_0x889d('0x12')](_0x1268bb);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index fde0d58..5b587a0 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x565e=['chat','fax','mail','openchannel','whatsapp','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','log','default','connection','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','User','name','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','%s:queue:%s','Agents','length','format','user:%s','handshake','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','userProfileId','WhatsappQueue','getChatQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var BPromise=require(_0xe565('0x1'));var db=require(_0xe565('0x2'))['db'];var config=require(_0xe565('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xe565('0x4')],'attributes':['id',_0xe565('0x5'),_0xe565('0x6')],'raw':!![],'where':{'role':_0xe565('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xe565('0x5')],'where':{'role':_0xe565('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xe565('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xe565('0x5')],'where':{'role':_0xe565('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe565('0x5'),_0xe565('0x9')],'where':{'type':_0xe565('0xa')}};function getAssociatedResources(_0x449b7a,_0x27ee96,_0x1d3d48){return db[_0xe565('0xb')]['findOne']({'where':{'name':_0x449b7a,'userProfileId':_0x27ee96},'raw':!![]})[_0xe565('0xc')](function(_0x36c827){if(_0x36c827){if(_0x36c827[_0xe565('0xd')]){switch(_0x449b7a){case'VoiceQueues':case _0xe565('0xe'):case _0xe565('0xf'):case _0xe565('0x10'):case _0xe565('0x11'):case'OpenchannelQueues':case _0xe565('0x12'):return db[_0x1d3d48]['findAll'](queryQueues);case _0xe565('0x13'):return db[_0x1d3d48]['findAll'](queryTelephones);case _0xe565('0x14'):return db[_0x1d3d48][_0xe565('0x15')](queryTrunks);case _0xe565('0x16'):return db[_0x1d3d48]['findAll'](queryCampaigns);}}else{return db[_0xe565('0x17')][_0xe565('0x15')]({'attributes':[_0xe565('0x18')],'where':{'sectionId':_0x36c827['id']},'raw':!![]})[_0xe565('0xc')](function(_0x52b772){if(_0x52b772){var _0xcc7bad={'where':{'id':_[_0xe565('0x19')](_0x52b772,_0xe565('0x18'))},'raw':!![]};switch(_0x1d3d48){case _0xe565('0x4'):_0xcc7bad[_0xe565('0x1a')][_0xe565('0x6')]='telephone';break;case _0xe565('0x1b'):_0xcc7bad[_0xe565('0x1a')][_0xe565('0x9')]=_0xe565('0xa');break;}return db[_0x1d3d48]['findAll'](_0xcc7bad);}else{return[];}});}}else{return[];}})[_0xe565('0xc')](function(_0x41c80e){return _0x41c80e;});}function joinOrLeaveQueues(_0x5bf4d8,_0x515786,_0x1251aa,_0x426072){_0x5bf4d8[_0x515786](util['format'](_0xe565('0x1c'),_0x1251aa,_0x426072[_0xe565('0x5')]));if(_0x426072[_0xe565('0x1d')]){for(var _0x4ad5df=0x0;_0x4ad5df<_0x426072['Agents'][_0xe565('0x1e')];_0x4ad5df+=0x1){_0x5bf4d8[_0x515786](util[_0xe565('0x1f')](_0xe565('0x20'),_0x426072[_0xe565('0x1d')][_0x4ad5df]['name']));}}}function joinOrLeave(_0x3cca25,_0x5bfdce,_0x30b376){var _0x885f91;if(_0x3cca25[_0xe565('0x21')]['query']['id']){db[_0xe565('0x4')][_0xe565('0x22')]({'attributes':['id',_0xe565('0x5'),_0xe565('0x6'),'userProfileId'],'where':{'id':_0x3cca25[_0xe565('0x21')]['query']['id']},'include':[{'model':db[_0xe565('0x23')],'as':_0xe565('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xe565('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe565('0x26')],'as':_0xe565('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xe565('0x28')],'as':_0xe565('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xe565('0x2a')],'as':_0xe565('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xe565('0x2c')],'as':_0xe565('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x15ffeb){if(_0x15ffeb){_0x885f91=_0x15ffeb;_0x3cca25[_0x5bfdce](util['format'](_0xe565('0x20'),_0x15ffeb['name']));var _0x55841f=[];switch(_0x15ffeb[_0xe565('0x6')]){case'admin':_0x3cca25[_0x5bfdce](_0xe565('0x2e'));_0x3cca25[_0x5bfdce](_0xe565('0x2f'));if(queryQueues[_0xe565('0x30')](_0xe565('0x31'))){delete queryQueues[_0xe565('0x31')];}_0x55841f[_0xe565('0x32')](db[_0xe565('0x33')]['findAll'](queryQueues));_0x55841f['push'](db[_0xe565('0x34')][_0xe565('0x15')](queryQueues));_0x55841f[_0xe565('0x32')](db[_0xe565('0x35')]['findAll'](queryQueues));_0x55841f[_0xe565('0x32')](db[_0xe565('0x36')][_0xe565('0x15')](queryQueues));_0x55841f[_0xe565('0x32')](db[_0xe565('0x37')]['findAll'](queryQueues));_0x55841f[_0xe565('0x32')](db[_0xe565('0x38')][_0xe565('0x15')](queryQueues));_0x55841f[_0xe565('0x32')](db['WhatsappQueue'][_0xe565('0x15')](queryQueues));_0x55841f[_0xe565('0x32')](db[_0xe565('0x4')]['findAll'](queryTelephones));_0x55841f[_0xe565('0x32')](db[_0xe565('0x39')]['findAll'](queryTrunks));_0x55841f[_0xe565('0x32')](db[_0xe565('0x1b')]['findAll'](queryCampaigns));_0x55841f[_0xe565('0x32')](db[_0xe565('0x4')][_0xe565('0x15')](queryAgents));break;case _0xe565('0x3a'):_0x3cca25[_0x5bfdce](_0xe565('0x2e'));_0x3cca25[_0x5bfdce](_0xe565('0x2f'));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0x3b'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x33')));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0xe'),_0x15ffeb[_0xe565('0x3c')],'ChatQueue'));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0xf'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x35')));_0x55841f['push'](getAssociatedResources('SmsQueues',_0x15ffeb[_0xe565('0x3c')],'SmsQueue'));_0x55841f['push'](getAssociatedResources(_0xe565('0x11'),_0x15ffeb['userProfileId'],'MailQueue'));_0x55841f[_0xe565('0x32')](getAssociatedResources('OpenchannelQueues',_0x15ffeb['userProfileId'],_0xe565('0x38')));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0x12'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x3d')));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0x13'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x4')));_0x55841f['push'](getAssociatedResources(_0xe565('0x14'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x39')));_0x55841f[_0xe565('0x32')](getAssociatedResources(_0xe565('0x16'),_0x15ffeb[_0xe565('0x3c')],_0xe565('0x1b')));_0x55841f[_0xe565('0x32')](db['User'][_0xe565('0x15')](queryAgents));break;case _0xe565('0x7'):_0x3cca25[_0x5bfdce](_0xe565('0x2e'));_0x3cca25[_0x5bfdce](_0xe565('0x2f'));_0x55841f[_0xe565('0x32')](_0x15ffeb['getVoiceQueues']({'attributes':['id',_0xe565('0x5')]}));_0x55841f[_0xe565('0x32')](_0x15ffeb[_0xe565('0x3e')]({'attributes':['id',_0xe565('0x5')]}));_0x55841f[_0xe565('0x32')](_0x15ffeb[_0xe565('0x3f')]({'attributes':['id','name']}));_0x55841f[_0xe565('0x32')](_0x15ffeb['getSmsQueues']({'attributes':['id',_0xe565('0x5')]}));_0x55841f[_0xe565('0x32')](_0x15ffeb[_0xe565('0x40')]({'attributes':['id','name']}));_0x55841f['push'](_0x15ffeb['getOpenchannelQueues']({'attributes':['id',_0xe565('0x5')]}));_0x55841f[_0xe565('0x32')](_0x15ffeb[_0xe565('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0xe565('0x42')](_0x55841f);}})['then'](function(_0x43d9c3){if(_0x43d9c3&&_0x43d9c3['length']){for(var _0x133129=0x0;_0x133129<_0x43d9c3[_0xe565('0x1e')];_0x133129+=0x1){for(var _0x4fd247=0x0;_0x4fd247<_0x43d9c3[_0x133129][_0xe565('0x1e')];_0x4fd247+=0x1){switch(_0x133129){case 0x0:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,'voice',_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x1:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,_0xe565('0x43'),_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x2:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,_0xe565('0x44'),_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x3:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,'sms',_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x4:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,_0xe565('0x45'),_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x5:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,_0xe565('0x46'),_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x6:joinOrLeaveQueues(_0x3cca25,_0x5bfdce,_0xe565('0x47'),_0x43d9c3[_0x133129][_0x4fd247]);break;case 0x7:if(_0x885f91[_0xe565('0x6')]!==_0xe565('0x7'))_0x3cca25[_0x5bfdce](util[_0xe565('0x1f')]('telephone:%s',_0x43d9c3[_0x133129][_0x4fd247][_0xe565('0x5')]));break;case 0x8:if(_0x885f91[_0xe565('0x6')]!=='agent')_0x3cca25[_0x5bfdce](util[_0xe565('0x1f')]('trunk:%s',_0x43d9c3[_0x133129][_0x4fd247][_0xe565('0x5')]));break;case 0x9:if(_0x885f91[_0xe565('0x6')]!==_0xe565('0x7'))_0x3cca25[_0x5bfdce](util[_0xe565('0x1f')]('campaign:%s:%s',_0x43d9c3[_0x133129][_0x4fd247][_0xe565('0x9')],_0x43d9c3[_0x133129][_0x4fd247][_0xe565('0x5')]));break;case 0xa:_0x3cca25[_0x5bfdce](util[_0xe565('0x1f')](_0xe565('0x20'),_0x43d9c3[_0x133129][_0x4fd247][_0xe565('0x5')]));break;}}}}})[_0xe565('0xc')](function(){if(_0x5bfdce===_0xe565('0x48')){var _0x3be667=_[_0xe565('0x19')](_0x885f91['ChatInteractions'],'id');return _0x885f91[_0xe565('0x49')](_0x3be667)[_0xe565('0xc')](function(){for(var _0xabb4=0x0;_0xabb4<_0x3be667[_0xe565('0x1e')];_0xabb4+=0x1){_0x30b376[_0xe565('0x4a')](_0xe565('0x4b'),{'ChatInteractionId':Number(_0x3be667[_0xabb4]),'UserId':Number(_0x885f91['id'])});}});}})[_0xe565('0xc')](function(){if(_0x5bfdce===_0xe565('0x48')){var _0x36de5f=_[_0xe565('0x19')](_0x885f91['MailInteractions'],'id');return _0x885f91[_0xe565('0x4c')](_0x36de5f)[_0xe565('0xc')](function(){for(var _0x294792=0x0;_0x294792<_0x36de5f[_0xe565('0x1e')];_0x294792+=0x1){_0x30b376[_0xe565('0x4a')](_0xe565('0x4d'),{'MailInteractionId':Number(_0x36de5f[_0x294792]),'UserId':Number(_0x885f91['id'])});}});}})['then'](function(){if(_0x5bfdce===_0xe565('0x48')){var _0x21e82c=_[_0xe565('0x19')](_0x885f91[_0xe565('0x27')],'id');return _0x885f91[_0xe565('0x4e')](_0x21e82c)[_0xe565('0xc')](function(){for(var _0x72426f=0x0;_0x72426f<_0x21e82c[_0xe565('0x1e')];_0x72426f+=0x1){_0x30b376['emit'](_0xe565('0x4f'),{'FaxInteractionId':Number(_0x21e82c[_0x72426f]),'UserId':Number(_0x885f91['id'])});}});}})['then'](function(){if(_0x5bfdce===_0xe565('0x48')){var _0x5797e5=_[_0xe565('0x19')](_0x885f91[_0xe565('0x29')],'id');return _0x885f91[_0xe565('0x50')](_0x5797e5)[_0xe565('0xc')](function(){for(var _0x3efb6f=0x0;_0x3efb6f<_0x5797e5[_0xe565('0x1e')];_0x3efb6f+=0x1){_0x30b376[_0xe565('0x4a')](_0xe565('0x51'),{'SmsInteractionId':Number(_0x5797e5[_0x3efb6f]),'UserId':Number(_0x885f91['id'])});}});}})[_0xe565('0xc')](function(){if(_0x5bfdce===_0xe565('0x48')){var _0x242dab=_[_0xe565('0x19')](_0x885f91[_0xe565('0x2b')],'id');return _0x885f91['removeOpenchannelInteractions'](_0x242dab)['then'](function(){for(var _0x4c7626=0x0;_0x4c7626<_0x242dab[_0xe565('0x1e')];_0x4c7626+=0x1){_0x30b376[_0xe565('0x4a')](_0xe565('0x52'),{'OpenchannelInteractionId':Number(_0x242dab[_0x4c7626]),'UserId':Number(_0x885f91['id'])});}});}})['then'](function(){if(_0x5bfdce==='leave'){var _0x369e21=_['map'](_0x885f91['WhatsappInteractions'],'id');return _0x885f91['removeWhatsappInteractions'](_0x369e21)[_0xe565('0xc')](function(){for(var _0x170ce0=0x0;_0x170ce0<_0x369e21[_0xe565('0x1e')];_0x170ce0+=0x1){_0x30b376[_0xe565('0x4a')](_0xe565('0x53'),{'WhatsappInteractionId':Number(_0x369e21[_0x170ce0]),'UserId':Number(_0x885f91['id'])});}});}})['catch'](function(_0x3a737b){_0x3cca25[_0xe565('0x54')](_0x3a737b);});}}function onDisconnect(_0xa6a0ce,_0x4968d6){joinOrLeave(_0xa6a0ce,_0xe565('0x48'),_0x4968d6);}function onConnect(_0x3c6d67){joinOrLeave(_0x3c6d67,'join');}exports[_0xe565('0x55')]=function(_0xf423e1){_0xf423e1['on'](_0xe565('0x56'),function(_0x4cd3a6){_0x4cd3a6['setMaxListeners'](0x0);_0x4cd3a6[_0xe565('0x57')]=_0x4cd3a6['request'][_0xe565('0x56')][_0xe565('0x58')]+':'+_0x4cd3a6[_0xe565('0x59')][_0xe565('0x56')][_0xe565('0x5a')];_0x4cd3a6[_0xe565('0x5b')]=new Date();_0x4cd3a6[_0xe565('0x54')]=function(_0x2d374d){console[_0xe565('0x54')](_0xe565('0x5c')+_0x4cd3a6[_0xe565('0x5d')][_0xe565('0x5')]+'['+_0x4cd3a6[_0xe565('0x57')]+']',_0x2d374d);};_0x4cd3a6['on'](_0xe565('0x5e'),function(){onDisconnect(_0x4cd3a6,_0xf423e1);_0x4cd3a6[_0xe565('0x54')](_0xe565('0x5f'));});onConnect(_0x4cd3a6);_0x4cd3a6['log'](_0xe565('0x60'));});}; \ No newline at end of file +var _0x5ec3=['FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','SmsQueue','MailQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','chat','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','role','agent','telephone','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','User','Campaign','where','type','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions'];(function(_0x5312f9,_0x4efe9c){var _0x31c712=function(_0x56789c){while(--_0x56789c){_0x5312f9['push'](_0x5312f9['shift']());}};_0x31c712(++_0x4efe9c);}(_0x5ec3,0xf2));var _0x35ec=function(_0x31f492,_0x1c1ce9){_0x31f492=_0x31f492-0x0;var _0x1e3d6e=_0x5ec3[_0x31f492];return _0x1e3d6e;};'use strict';var _=require(_0x35ec('0x0'));var util=require('util');var BPromise=require(_0x35ec('0x1'));var db=require(_0x35ec('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x35ec('0x3')],'include':[{'as':_0x35ec('0x4'),'model':db['User'],'attributes':['id',_0x35ec('0x3'),_0x35ec('0x5')],'raw':!![],'where':{'role':_0x35ec('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x35ec('0x3')],'where':{'role':_0x35ec('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x35ec('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x35ec('0x3')],'where':{'role':_0x35ec('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x35ec('0x3'),'type'],'where':{'type':_0x35ec('0x8')}};function getAssociatedResources(_0x226379,_0x2f0108,_0x166fb6){return db['UserProfileSection'][_0x35ec('0x9')]({'where':{'name':_0x226379,'userProfileId':_0x2f0108},'raw':!![]})[_0x35ec('0xa')](function(_0x549d18){if(_0x549d18){if(_0x549d18[_0x35ec('0xb')]){switch(_0x226379){case _0x35ec('0xc'):case _0x35ec('0xd'):case _0x35ec('0xe'):case _0x35ec('0xf'):case'MailQueues':case _0x35ec('0x10'):case'WhatsappQueues':return db[_0x166fb6][_0x35ec('0x11')](queryQueues);case _0x35ec('0x12'):return db[_0x166fb6][_0x35ec('0x11')](queryTelephones);case _0x35ec('0x13'):return db[_0x166fb6][_0x35ec('0x11')](queryTrunks);case _0x35ec('0x14'):return db[_0x166fb6]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x35ec('0x11')]({'attributes':[_0x35ec('0x15')],'where':{'sectionId':_0x549d18['id']},'raw':!![]})[_0x35ec('0xa')](function(_0x38ec07){if(_0x38ec07){var _0x5275f6={'where':{'id':_[_0x35ec('0x16')](_0x38ec07,_0x35ec('0x15'))},'raw':!![]};switch(_0x166fb6){case _0x35ec('0x17'):_0x5275f6['where'][_0x35ec('0x5')]='telephone';break;case _0x35ec('0x18'):_0x5275f6[_0x35ec('0x19')][_0x35ec('0x1a')]=_0x35ec('0x8');break;}return db[_0x166fb6][_0x35ec('0x11')](_0x5275f6);}else{return[];}});}}else{return[];}})['then'](function(_0x3e7bc7){return _0x3e7bc7;});}function joinOrLeaveQueues(_0xe55d2,_0x2b6129,_0x243775,_0x407d79){_0xe55d2[_0x2b6129](util[_0x35ec('0x1b')](_0x35ec('0x1c'),_0x243775,_0x407d79[_0x35ec('0x3')]));if(_0x407d79[_0x35ec('0x4')]){for(var _0x5a991c=0x0;_0x5a991c<_0x407d79[_0x35ec('0x4')][_0x35ec('0x1d')];_0x5a991c+=0x1){_0xe55d2[_0x2b6129](util[_0x35ec('0x1b')](_0x35ec('0x1e'),_0x407d79[_0x35ec('0x4')][_0x5a991c][_0x35ec('0x3')]));}}}function joinOrLeave(_0x48b871,_0x577408,_0x5e96c4){var _0x57babe;if(_0x48b871[_0x35ec('0x1f')][_0x35ec('0x20')]['id']){db[_0x35ec('0x17')]['find']({'attributes':['id',_0x35ec('0x3'),_0x35ec('0x5'),_0x35ec('0x21')],'where':{'id':_0x48b871[_0x35ec('0x1f')][_0x35ec('0x20')]['id']},'include':[{'model':db[_0x35ec('0x22')],'as':_0x35ec('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x35ec('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x35ec('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x35ec('0x26')],'as':_0x35ec('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x35ec('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x35ec('0x29')],'as':_0x35ec('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x35ec('0xa')](function(_0x349878){if(_0x349878){_0x57babe=_0x349878;_0x48b871[_0x577408](util[_0x35ec('0x1b')](_0x35ec('0x1e'),_0x349878[_0x35ec('0x3')]));var _0x8b749b=[];switch(_0x349878['role']){case _0x35ec('0x2b'):_0x48b871[_0x577408](_0x35ec('0x2c'));_0x48b871[_0x577408](_0x35ec('0x2d'));if(queryQueues[_0x35ec('0x2e')](_0x35ec('0x2f'))){delete queryQueues['include'];}_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x31')][_0x35ec('0x11')](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x32')][_0x35ec('0x11')](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x33')]['findAll'](queryQueues));_0x8b749b[_0x35ec('0x30')](db['SmsQueue']['findAll'](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x34')]['findAll'](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x35')][_0x35ec('0x11')](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x36')][_0x35ec('0x11')](queryQueues));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x17')][_0x35ec('0x11')](queryTelephones));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x37')][_0x35ec('0x11')](queryTrunks));_0x8b749b['push'](db[_0x35ec('0x18')][_0x35ec('0x11')](queryCampaigns));_0x8b749b[_0x35ec('0x30')](db[_0x35ec('0x17')]['findAll'](queryAgents));break;case _0x35ec('0x38'):_0x48b871[_0x577408](_0x35ec('0x2c'));_0x48b871[_0x577408]('voice:outbound');_0x8b749b['push'](getAssociatedResources(_0x35ec('0xc'),_0x349878['userProfileId'],_0x35ec('0x31')));_0x8b749b['push'](getAssociatedResources(_0x35ec('0xd'),_0x349878[_0x35ec('0x21')],'ChatQueue'));_0x8b749b[_0x35ec('0x30')](getAssociatedResources(_0x35ec('0xe'),_0x349878[_0x35ec('0x21')],'FaxQueue'));_0x8b749b['push'](getAssociatedResources(_0x35ec('0xf'),_0x349878['userProfileId'],_0x35ec('0x39')));_0x8b749b[_0x35ec('0x30')](getAssociatedResources(_0x35ec('0x3a'),_0x349878['userProfileId'],'MailQueue'));_0x8b749b['push'](getAssociatedResources(_0x35ec('0x10'),_0x349878['userProfileId'],_0x35ec('0x35')));_0x8b749b[_0x35ec('0x30')](getAssociatedResources('WhatsappQueues',_0x349878[_0x35ec('0x21')],_0x35ec('0x36')));_0x8b749b[_0x35ec('0x30')](getAssociatedResources(_0x35ec('0x12'),_0x349878[_0x35ec('0x21')],_0x35ec('0x17')));_0x8b749b[_0x35ec('0x30')](getAssociatedResources('Trunks',_0x349878[_0x35ec('0x21')],_0x35ec('0x37')));_0x8b749b['push'](getAssociatedResources(_0x35ec('0x14'),_0x349878[_0x35ec('0x21')],'Campaign'));_0x8b749b['push'](db[_0x35ec('0x17')][_0x35ec('0x11')](queryAgents));break;case _0x35ec('0x6'):_0x48b871[_0x577408](_0x35ec('0x2c'));_0x48b871[_0x577408](_0x35ec('0x2d'));_0x8b749b['push'](_0x349878['getVoiceQueues']({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b['push'](_0x349878[_0x35ec('0x3b')]({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b['push'](_0x349878[_0x35ec('0x3c')]({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b[_0x35ec('0x30')](_0x349878['getSmsQueues']({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b[_0x35ec('0x30')](_0x349878['getMailQueues']({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b[_0x35ec('0x30')](_0x349878[_0x35ec('0x3d')]({'attributes':['id',_0x35ec('0x3')]}));_0x8b749b[_0x35ec('0x30')](_0x349878['getWhatsappQueues']({'attributes':['id',_0x35ec('0x3')]}));break;}return BPromise['all'](_0x8b749b);}})[_0x35ec('0xa')](function(_0x450fa3){if(_0x450fa3&&_0x450fa3['length']){for(var _0x38c005=0x0;_0x38c005<_0x450fa3[_0x35ec('0x1d')];_0x38c005+=0x1){for(var _0x213d96=0x0;_0x213d96<_0x450fa3[_0x38c005][_0x35ec('0x1d')];_0x213d96+=0x1){switch(_0x38c005){case 0x0:joinOrLeaveQueues(_0x48b871,_0x577408,'voice',_0x450fa3[_0x38c005][_0x213d96]);break;case 0x1:joinOrLeaveQueues(_0x48b871,_0x577408,_0x35ec('0x3e'),_0x450fa3[_0x38c005][_0x213d96]);break;case 0x2:joinOrLeaveQueues(_0x48b871,_0x577408,'fax',_0x450fa3[_0x38c005][_0x213d96]);break;case 0x3:joinOrLeaveQueues(_0x48b871,_0x577408,_0x35ec('0x3f'),_0x450fa3[_0x38c005][_0x213d96]);break;case 0x4:joinOrLeaveQueues(_0x48b871,_0x577408,'mail',_0x450fa3[_0x38c005][_0x213d96]);break;case 0x5:joinOrLeaveQueues(_0x48b871,_0x577408,_0x35ec('0x40'),_0x450fa3[_0x38c005][_0x213d96]);break;case 0x6:joinOrLeaveQueues(_0x48b871,_0x577408,_0x35ec('0x41'),_0x450fa3[_0x38c005][_0x213d96]);break;case 0x7:if(_0x57babe[_0x35ec('0x5')]!==_0x35ec('0x6'))_0x48b871[_0x577408](util[_0x35ec('0x1b')]('telephone:%s',_0x450fa3[_0x38c005][_0x213d96]['name']));break;case 0x8:if(_0x57babe[_0x35ec('0x5')]!==_0x35ec('0x6'))_0x48b871[_0x577408](util[_0x35ec('0x1b')](_0x35ec('0x42'),_0x450fa3[_0x38c005][_0x213d96]['name']));break;case 0x9:if(_0x57babe[_0x35ec('0x5')]!==_0x35ec('0x6'))_0x48b871[_0x577408](util[_0x35ec('0x1b')](_0x35ec('0x43'),_0x450fa3[_0x38c005][_0x213d96][_0x35ec('0x1a')],_0x450fa3[_0x38c005][_0x213d96][_0x35ec('0x3')]));break;case 0xa:_0x48b871[_0x577408](util[_0x35ec('0x1b')](_0x35ec('0x1e'),_0x450fa3[_0x38c005][_0x213d96]['name']));break;}}}}})[_0x35ec('0xa')](function(){if(_0x577408===_0x35ec('0x44')){var _0x122e73=_[_0x35ec('0x16')](_0x57babe[_0x35ec('0x23')],'id');return _0x57babe[_0x35ec('0x45')](_0x122e73)[_0x35ec('0xa')](function(){for(var _0x446be8=0x0;_0x446be8<_0x122e73[_0x35ec('0x1d')];_0x446be8+=0x1){_0x5e96c4[_0x35ec('0x46')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x122e73[_0x446be8]),'UserId':Number(_0x57babe['id'])});}});}})[_0x35ec('0xa')](function(){if(_0x577408===_0x35ec('0x44')){var _0x1fb353=_[_0x35ec('0x16')](_0x57babe[_0x35ec('0x24')],'id');return _0x57babe[_0x35ec('0x47')](_0x1fb353)[_0x35ec('0xa')](function(){for(var _0x54f631=0x0;_0x54f631<_0x1fb353['length'];_0x54f631+=0x1){_0x5e96c4['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1fb353[_0x54f631]),'UserId':Number(_0x57babe['id'])});}});}})[_0x35ec('0xa')](function(){if(_0x577408===_0x35ec('0x44')){var _0x16c308=_['map'](_0x57babe[_0x35ec('0x48')],'id');return _0x57babe[_0x35ec('0x49')](_0x16c308)[_0x35ec('0xa')](function(){for(var _0x2cc114=0x0;_0x2cc114<_0x16c308[_0x35ec('0x1d')];_0x2cc114+=0x1){_0x5e96c4[_0x35ec('0x46')](_0x35ec('0x4a'),{'FaxInteractionId':Number(_0x16c308[_0x2cc114]),'UserId':Number(_0x57babe['id'])});}});}})['then'](function(){if(_0x577408==='leave'){var _0x4226c4=_[_0x35ec('0x16')](_0x57babe[_0x35ec('0x27')],'id');return _0x57babe['removeSmsInteractions'](_0x4226c4)[_0x35ec('0xa')](function(){for(var _0x41bdf0=0x0;_0x41bdf0<_0x4226c4['length'];_0x41bdf0+=0x1){_0x5e96c4[_0x35ec('0x46')](_0x35ec('0x4b'),{'SmsInteractionId':Number(_0x4226c4[_0x41bdf0]),'UserId':Number(_0x57babe['id'])});}});}})[_0x35ec('0xa')](function(){if(_0x577408==='leave'){var _0x4748a1=_['map'](_0x57babe[_0x35ec('0x4c')],'id');return _0x57babe['removeOpenchannelInteractions'](_0x4748a1)[_0x35ec('0xa')](function(){for(var _0x3761b6=0x0;_0x3761b6<_0x4748a1[_0x35ec('0x1d')];_0x3761b6+=0x1){_0x5e96c4[_0x35ec('0x46')](_0x35ec('0x4d'),{'OpenchannelInteractionId':Number(_0x4748a1[_0x3761b6]),'UserId':Number(_0x57babe['id'])});}});}})[_0x35ec('0xa')](function(){if(_0x577408===_0x35ec('0x44')){var _0x4c7226=_[_0x35ec('0x16')](_0x57babe[_0x35ec('0x2a')],'id');return _0x57babe[_0x35ec('0x4e')](_0x4c7226)[_0x35ec('0xa')](function(){for(var _0x2f3883=0x0;_0x2f3883<_0x4c7226['length'];_0x2f3883+=0x1){_0x5e96c4[_0x35ec('0x46')](_0x35ec('0x4f'),{'WhatsappInteractionId':Number(_0x4c7226[_0x2f3883]),'UserId':Number(_0x57babe['id'])});}});}})[_0x35ec('0x50')](function(_0x5b6150){_0x48b871['log'](_0x5b6150);});}}function onDisconnect(_0x8a7b7b,_0x51f9f1){joinOrLeave(_0x8a7b7b,'leave',_0x51f9f1);}function onConnect(_0x2bd5d8){joinOrLeave(_0x2bd5d8,_0x35ec('0x51'));}exports[_0x35ec('0x52')]=function(_0x1a0519){_0x1a0519['on'](_0x35ec('0x53'),function(_0x4339a3){_0x4339a3[_0x35ec('0x54')](0x0);_0x4339a3[_0x35ec('0x55')]=_0x4339a3[_0x35ec('0x56')][_0x35ec('0x53')][_0x35ec('0x57')]+':'+_0x4339a3[_0x35ec('0x56')][_0x35ec('0x53')]['remotePort'];_0x4339a3['connectedAt']=new Date();_0x4339a3[_0x35ec('0x58')]=function(_0x2cd64d){console[_0x35ec('0x58')](_0x35ec('0x59')+_0x4339a3[_0x35ec('0x5a')][_0x35ec('0x3')]+'['+_0x4339a3['address']+']',_0x2cd64d);};_0x4339a3['on']('disconnect',function(){onDisconnect(_0x4339a3,_0x1a0519);_0x4339a3[_0x35ec('0x58')](_0x35ec('0x5b'));});onConnect(_0x4339a3);_0x4339a3[_0x35ec('0x58')](_0x35ec('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b5a942d..caae3d8 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 _0x5ce2=['get','channel','motionChannel','event','direction','query','QueryTypes','SELECT','then','contact','UserId','find','name','fullname','email','internal','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','changed','closed','User','length','hasOwnProperty','model','hook','callback','condition','../../mysqldb','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','Sms','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','FaxMessage','MailInteraction','Mail','substatus','Openchannel','OpenchannelInteraction','request','EventManager','error','code','Trigger,\x20%s','catch'];(function(_0x2ebb78,_0x3675c6){var _0x1d65c6=function(_0x1a5412){while(--_0x1a5412){_0x2ebb78['push'](_0x2ebb78['shift']());}};_0x1d65c6(++_0x3675c6);}(_0x5ce2,0x1b6));var _0x25ce=function(_0x28876d,_0x46f49d){_0x28876d=_0x28876d-0x0;var _0x1eb326=_0x5ce2[_0x28876d];return _0x1eb326;};'use strict';var util=require('util');var db=require(_0x25ce('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x25ce('0x1'))(_0x25ce('0x2'));var _=require(_0x25ce('0x3'));var client=jayson[_0x25ce('0x4')][_0x25ce('0x5')]({'port':0x232a});var triggers=[{'channel':_0x25ce('0x6'),'model':_0x25ce('0x7'),'event':_0x25ce('0x8'),'condition':_0x25ce('0x9'),'callback':afterCreate},{'channel':_0x25ce('0x6'),'model':'ChatInteraction','event':_0x25ce('0xa'),'condition':_0x25ce('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0x25ce('0xc'),'event':_0x25ce('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x25ce('0x8'),'condition':_0x25ce('0x9'),'callback':afterCreate},{'channel':_0x25ce('0xd'),'model':'SmsInteraction','event':_0x25ce('0xa'),'condition':_0x25ce('0xb'),'callback':afterUpdate},{'channel':_0x25ce('0xd'),'model':'SmsMessage','event':_0x25ce('0x8'),'condition':_0x25ce('0xe'),'callback':afterCreateMessage},{'channel':_0x25ce('0xf'),'model':'WhatsappInteraction','event':_0x25ce('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x25ce('0xf'),'model':_0x25ce('0x10'),'event':_0x25ce('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x25ce('0xf'),'model':_0x25ce('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x25ce('0x12'),'event':'afterCreate','condition':_0x25ce('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0x25ce('0x12'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x25ce('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x25ce('0x14'),'event':_0x25ce('0x8'),'condition':_0x25ce('0x9'),'callback':afterCreate},{'channel':_0x25ce('0x15'),'model':_0x25ce('0x14'),'event':'afterUpdate','condition':_0x25ce('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x25ce('0x14'),'event':_0x25ce('0x16'),'condition':'substatus','callback':afterUpdate},{'channel':_0x25ce('0x15'),'model':'MailMessage','event':'afterCreate','condition':_0x25ce('0xe'),'callback':afterCreateMessage},{'channel':_0x25ce('0x17'),'model':_0x25ce('0x18'),'event':_0x25ce('0x8'),'condition':_0x25ce('0x9'),'callback':afterCreate},{'channel':_0x25ce('0x17'),'model':'OpenchannelInteraction','event':_0x25ce('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x25ce('0x17'),'model':'OpenchannelMessage','event':_0x25ce('0x8'),'condition':_0x25ce('0xe'),'callback':afterCreateMessage}];function request(_0x2419c1){return client[_0x25ce('0x19')](_0x25ce('0x1a'),_0x2419c1)['then'](function(_0x1e8363){logger['info']('Trigger,\x20%s',_0x25ce('0x1a'),_0x1e8363);if(_0x1e8363[_0x25ce('0x1b')]){if(_0x1e8363[_0x25ce('0x1b')][_0x25ce('0x1c')]===0x1f4){logger['error'](_0x25ce('0x1d'),_0x25ce('0x1a'),_0x1e8363[_0x25ce('0x1b')]);}}})[_0x25ce('0x1e')](function(_0x262a34){logger[_0x25ce('0x1b')](_0x25ce('0x1d'),_0x25ce('0x1a'),_0x262a34);});}function afterCreateMessage(_0x39248f,_0x2ccea1){return function(_0xd3300,_0x1b1359){_0xd3300=_0xd3300[_0x25ce('0x1f')]({'plain':!![]});_0xd3300[_0x25ce('0x20')]=_0x39248f;_0xd3300[_0x25ce('0x21')]=_0x39248f;_0xd3300[_0x25ce('0x22')]=_0xd3300[_0x25ce('0x23')];var _0x5c6c8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd3300['ContactId'];return db['sequelize'][_0x25ce('0x24')](_0x5c6c8,{'type':db['Sequelize'][_0x25ce('0x25')][_0x25ce('0x26')],'raw':!![]})[_0x25ce('0x27')](function(_0x1b401e){return _0x1b401e;})[_0x25ce('0x27')](function(_0x2cbc94){if(_0x2cbc94){_0xd3300[_0x25ce('0x28')]=_0x2cbc94[0x0];}if(_0xd3300[_0x25ce('0x29')]){return db['User'][_0x25ce('0x2a')]({'where':{'id':_0xd3300[_0x25ce('0x29')]},'attributes':['id',_0x25ce('0x2b'),_0x25ce('0x2c'),_0x25ce('0x2d'),_0x25ce('0x2e')],'raw':!![]})[_0x25ce('0x27')](function(_0x3327e1){_0xd3300[_0x25ce('0x2f')]=util[_0x25ce('0x30')](_0x25ce('0x31'),_0x3327e1[_0x25ce('0x2b')]);_0xd3300[_0x25ce('0x20')]=_0x39248f;_0xd3300[_0x25ce('0x32')]=_0x3327e1;return request({'event':_0x25ce('0x33'),'message':_0xd3300});})['catch'](function(_0x1348d9){console[_0x25ce('0x1b')](_0x1348d9);});}else{return request({'event':_0x25ce('0x34'),'message':_0xd3300});}});};}function afterCreate(_0x4b64a0,_0x2ddb27){return function(_0x5d7386,_0x4f9a46){_0x5d7386=_0x5d7386['get']({'plain':!![]});_0x5d7386[_0x25ce('0x20')]=_0x4b64a0;_0x5d7386[_0x25ce('0x21')]=_0x4b64a0;_0x5d7386['event']=_0x25ce('0x35');var _0x17670c=_0x25ce('0x36')+_0x5d7386[_0x25ce('0x37')];return db[_0x25ce('0x38')]['query'](_0x17670c,{'type':db[_0x25ce('0x39')][_0x25ce('0x25')][_0x25ce('0x26')],'raw':!![]})[_0x25ce('0x27')](function(_0x20f4a9){return _0x20f4a9;})[_0x25ce('0x27')](function(_0x578169){if(_0x578169){_0x5d7386[_0x25ce('0x28')]=_0x578169[0x0];}return request({'event':_0x2ddb27,'message':_0x5d7386});});};}function afterUpdate(_0x25df53,_0x51931d){return function(_0x4a1ed1,_0x327541){if(_0x4a1ed1[_0x25ce('0x3a')](_0x25ce('0x3b'))&&_0x4a1ed1[_0x25ce('0x3b')]){_0x4a1ed1=_0x4a1ed1[_0x25ce('0x1f')]({'plain':!![]});_0x4a1ed1['channel']=_0x25df53;_0x4a1ed1['motionChannel']=_0x25df53;_0x4a1ed1[_0x25ce('0x22')]=_0x25ce('0x3b');var _0x50b529=_0x25ce('0x36')+_0x4a1ed1['ContactId'];return db[_0x25ce('0x38')]['query'](_0x50b529,{'type':db[_0x25ce('0x39')][_0x25ce('0x25')][_0x25ce('0x26')],'raw':!![]})[_0x25ce('0x27')](function(_0x1bc60c){return _0x1bc60c;})[_0x25ce('0x27')](function(_0x5778f8){if(_0x5778f8){_0x4a1ed1[_0x25ce('0x28')]=_0x5778f8[0x0];}if(_0x4a1ed1['UserId']){return db[_0x25ce('0x3c')][_0x25ce('0x2a')]({'where':{'id':_0x4a1ed1['UserId']},'attributes':['id','name','fullname',_0x25ce('0x2d'),_0x25ce('0x2e')],'raw':!![]})[_0x25ce('0x27')](function(_0x13a9f0){_0x4a1ed1['interface']=util[_0x25ce('0x30')](_0x25ce('0x31'),_0x13a9f0[_0x25ce('0x2b')]);_0x4a1ed1[_0x25ce('0x32')]=_0x13a9f0;return request({'event':_0x51931d,'message':_0x4a1ed1});})[_0x25ce('0x1e')](function(_0x1e1628){console[_0x25ce('0x1b')](_0x1e1628);});}else{return request({'event':_0x51931d,'message':_0x4a1ed1});}});}else if(_0x4a1ed1[_0x25ce('0x3a')](_0x25ce('0x16'))){_0x4a1ed1=_0x4a1ed1[_0x25ce('0x1f')]({'plain':!![]});_0x4a1ed1[_0x25ce('0x20')]=_0x25df53;_0x4a1ed1['event']=_0x25ce('0x16');var _0x50b529='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a1ed1[_0x25ce('0x37')];return db[_0x25ce('0x38')][_0x25ce('0x24')](_0x50b529,{'type':db[_0x25ce('0x39')][_0x25ce('0x25')][_0x25ce('0x26')],'raw':!![]})[_0x25ce('0x27')](function(_0xa0635d){return _0xa0635d;})[_0x25ce('0x27')](function(_0x43453b){if(_0x43453b){_0x4a1ed1[_0x25ce('0x28')]=_0x43453b[0x0];}if(_0x4a1ed1[_0x25ce('0x29')]){return db[_0x25ce('0x3c')][_0x25ce('0x2a')]({'where':{'id':_0x4a1ed1[_0x25ce('0x29')]},'attributes':['id','name',_0x25ce('0x2c'),_0x25ce('0x2d'),'internal'],'raw':!![]})['then'](function(_0x2954da){_0x4a1ed1[_0x25ce('0x2f')]=util[_0x25ce('0x30')]('SIP/%s',_0x2954da[_0x25ce('0x2b')]);_0x4a1ed1[_0x25ce('0x32')]=_0x2954da;return request({'event':_0x51931d,'message':_0x4a1ed1});})[_0x25ce('0x1e')](function(_0x205b3f){console[_0x25ce('0x1b')](_0x205b3f);});}else{return request({'event':_0x51931d,'message':_0x4a1ed1});}});}};}exports['default']=function(){for(var _0x352085=0x0;_0x352085=_0x48ac38['agents']){throw Error(_0x9e42('0x15'));}_0xe8599d(_0x5cd5b0);})[_0x9e42('0x16')](function(_0x13c82d){_0x391b4c(_0x13c82d);});});}; \ No newline at end of file +var _0x6189=['./license/util','mail','chat','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb'];(function(_0x536c1d,_0x4bac2d){var _0x399e88=function(_0x6e5c69){while(--_0x6e5c69){_0x536c1d['push'](_0x536c1d['shift']());}};_0x399e88(++_0x4bac2d);}(_0x6189,0x111));var _0x9618=function(_0x18fe06,_0x2dc7f5){_0x18fe06=_0x18fe06-0x0;var _0x366236=_0x6189[_0x18fe06];return _0x366236;};'use strict';var _=require(_0x9618('0x0'));var BPromise=require('bluebird');var db=require(_0x9618('0x1'))['db'];var util=require(_0x9618('0x2'));var channels=['voice',_0x9618('0x3'),_0x9618('0x4'),_0x9618('0x5'),_0x9618('0x6'),_0x9618('0x7'),_0x9618('0x8')];exports['getChannels']=function(){return channels;};exports[_0x9618('0x9')]=function(_0x1536d5){_0x1536d5=_0x1536d5[_0x9618('0xa')]();return _[_0x9618('0xb')](channels,_0x1536d5);};exports[_0x9618('0xc')]=function(_0x53aecf,_0x4e912f,_0x486f30,_0xf9aa2e){var _0x6f978b={'loginAttempts':_0x4e912f,'blocked':_0x486f30};if(!_[_0x9618('0xd')](_0xf9aa2e)){_0x6f978b[_0x9618('0xe')]=_0xf9aa2e;}return _0x53aecf[_0x9618('0xf')](_0x6f978b);};exports[_0x9618('0x10')]=function(_0x2645c4){return new BPromise(function(_0x4b7899,_0x4d7be8){var _0x4fae2a=0x0;if(_0x2645c4[_0x9618('0x11')]!==_0x9618('0x12')){_0x4b7899(_0x2645c4);}db[_0x9618('0x13')][_0x9618('0x14')]({'where':{'role':_0x9618('0x12'),'online':!![],'id':{'$ne':_0x2645c4['id']}}})[_0x9618('0x15')](function(_0x3cd41b){_0x4fae2a=_0x3cd41b;return util[_0x9618('0x10')]();})[_0x9618('0x15')](function(_0x290982){if(_0x290982&&_0x290982[_0x9618('0x16')]&&_0x4fae2a>=_0x290982['agents']){throw Error(_0x9618('0x17'));}_0x4b7899(_0x2645c4);})[_0x9618('0x18')](function(_0x1ab600){_0x4d7be8(_0x1ab600);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e0fce8b..ade8c1d 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18af=['status','render','send','exports','404'];(function(_0x3b15f1,_0x4fc1e5){var _0x47cd22=function(_0x497f34){while(--_0x497f34){_0x3b15f1['push'](_0x3b15f1['shift']());}};_0x47cd22(++_0x4fc1e5);}(_0x18af,0x17a));var _0xf18a=function(_0x504083,_0x52275e){_0x504083=_0x504083-0x0;var _0x460edf=_0x18af[_0x504083];return _0x460edf;};'use strict';module[_0xf18a('0x0')][0x194]=function pageNotFound(_0xd96335,_0x58e4b3){var _0x523663=_0xf18a('0x1');var _0xc5169d=0x194;var _0xd285e={'status':_0xc5169d};_0x58e4b3[_0xf18a('0x2')](_0xd285e[_0xf18a('0x2')]);_0x58e4b3[_0xf18a('0x3')](_0x523663,{},function(_0x935653,_0x3f5d20){if(_0x935653){return _0x58e4b3[_0xf18a('0x2')](_0xd285e[_0xf18a('0x2')])['json'](_0xd285e);}_0x58e4b3[_0xf18a('0x4')](_0x3f5d20);});}; \ No newline at end of file +var _0xfdd4=['status','json','exports','404'];(function(_0x5e230c,_0x4d5960){var _0x3d7956=function(_0x45071d){while(--_0x45071d){_0x5e230c['push'](_0x5e230c['shift']());}};_0x3d7956(++_0x4d5960);}(_0xfdd4,0x156));var _0x4fdd=function(_0x1ea4d6,_0x4b3516){_0x1ea4d6=_0x1ea4d6-0x0;var _0x4e77d6=_0xfdd4[_0x1ea4d6];return _0x4e77d6;};'use strict';module[_0x4fdd('0x0')][0x194]=function pageNotFound(_0x30bbc6,_0x45ad52){var _0x3d5d57=_0x4fdd('0x1');var _0x33b913=0x194;var _0x1b09e2={'status':_0x33b913};_0x45ad52[_0x4fdd('0x2')](_0x1b09e2[_0x4fdd('0x2')]);_0x45ad52['render'](_0x3d5d57,{},function(_0x5c5b16,_0x26869f){if(_0x5c5b16){return _0x45ad52[_0x4fdd('0x2')](_0x1b09e2['status'])[_0x4fdd('0x3')](_0x1b09e2);}_0x45ad52['send'](_0x26869f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 57f5114..7d40639 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dbd=['Teams','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','Dashboard','Items','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsAccountId','Answers','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','Interaction','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','user_has_openchannel_interactions','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Members','CompanyId','OpenchannelInteractions','Company','cm_contact_has_tags','Agent','Queue','CampaignId','OwnerId','Condition','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','SugarcrmField','AccountId','DeskAccount','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','team_has_fax_queues','FaxQueues','team_has_sms_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','determine','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','motion2','username','password','options','database','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../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','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','user_has_voice_prefixes','ChatWebsite','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','Contact','ContactId','MailServerIn','MailAccount','MailAccountId','MailServerOut','Dispositions','Interactions','List','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues'];(function(_0xef2a14,_0x4c359a){var _0x242a4d=function(_0x3227c9){while(--_0x3227c9){_0xef2a14['push'](_0xef2a14['shift']());}};_0x242a4d(++_0x4c359a);}(_0x0dbd,0x8e));var _0xd0db=function(_0x5a73e0,_0x26af6d){_0x5a73e0=_0x5a73e0-0x0;var _0x48d183=_0x0dbd[_0x5a73e0];return _0x48d183;};'use strict';var config=require(_0xd0db('0x0'));var Sequelize=require(_0xd0db('0x1'));var _=require(_0xd0db('0x2'));var jstz=require('jstz');var timezone=jstz[_0xd0db('0x3')]();config[_0xd0db('0x1')]=_['defaultsDeep'](config[_0xd0db('0x1')],{'database':'motion2','username':_0xd0db('0x4'),'password':_0xd0db('0x5'),'options':{'host':_0xd0db('0x6'),'port':0xcea,'dialect':_0xd0db('0x7'),'dialectOptions':{'charset':_0xd0db('0x8')},'logging':![],'timezone':timezone[_0xd0db('0x9')](),'define':{'charset':_0xd0db('0xa'),'collate':_0xd0db('0xb')}}});config['sequelizeHistory']=_[_0xd0db('0xc')](config[_0xd0db('0xd')],{'database':_0xd0db('0xe'),'username':_0xd0db('0x4'),'password':'xC@LL1234','options':{'host':_0xd0db('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd0db('0x1')]['database'],config[_0xd0db('0x1')][_0xd0db('0xf')],config[_0xd0db('0x1')][_0xd0db('0x10')],config[_0xd0db('0x1')][_0xd0db('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xd0db('0x12')],config[_0xd0db('0xd')][_0xd0db('0xf')],config[_0xd0db('0xd')][_0xd0db('0x10')],config[_0xd0db('0xd')][_0xd0db('0x11')])};db[_0xd0db('0x13')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x15'));db['VoiceChanSpy']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x16'));db[_0xd0db('0x17')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x18'));db[_0xd0db('0x19')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x1a'));db[_0xd0db('0x1b')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x1c'));db[_0xd0db('0x1d')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x1e'));db[_0xd0db('0x1f')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0xd0db('0x20')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x21'));db[_0xd0db('0x22')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x23'));db[_0xd0db('0x24')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x25'));db[_0xd0db('0x26')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x27'));db[_0xd0db('0x28')]=db[_0xd0db('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xd0db('0x29')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x2a'));db[_0xd0db('0x2b')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x2c'));db[_0xd0db('0x2d')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x2e'));db[_0xd0db('0x2f')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x30'));db[_0xd0db('0x31')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x32'));db[_0xd0db('0x33')]=db['sequelize'][_0xd0db('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x34'));db[_0xd0db('0x35')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x36'));db[_0xd0db('0x37')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x38'));db[_0xd0db('0x39')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x3a'));db[_0xd0db('0x3b')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x3c'));db['UserOpenchannelQueue']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x3d'));db['UserWhatsappQueue']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x3e'));db['MailServerOut']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x3f'));db['MailAccount']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x40'));db[_0xd0db('0x41')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x42'));db[_0xd0db('0x43')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x44'));db[_0xd0db('0x45')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x46'));db[_0xd0db('0x47')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x48'));db[_0xd0db('0x49')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x4a'));db[_0xd0db('0x4b')]=db[_0xd0db('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0xd0db('0x1')]['import'](_0xd0db('0x4c'));db[_0xd0db('0x4d')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x4e'));db['FaxAccount']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x4f'));db[_0xd0db('0x50')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x51'));db['FaxInteraction']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0xd0db('0x52')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x53'));db['FaxQueue']=db[_0xd0db('0x1')]['import'](_0xd0db('0x54'));db[_0xd0db('0x55')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x56'));db[_0xd0db('0x57')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/smsAccount/smsAccount.model');db[_0xd0db('0x58')]=db['sequelize'][_0xd0db('0x14')]('../api/smsApplication/smsApplication.model');db[_0xd0db('0x59')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x5a'));db[_0xd0db('0x5b')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/smsMessage/smsMessage.model');db[_0xd0db('0x5c')]=db['sequelize']['import'](_0xd0db('0x5d'));db[_0xd0db('0x5e')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x5f'));db[_0xd0db('0x60')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x61'));db[_0xd0db('0x62')]=db['sequelize'][_0xd0db('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x63'));db[_0xd0db('0x64')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x65'));db[_0xd0db('0x66')]=db[_0xd0db('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0xd0db('0x67')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x68'));db[_0xd0db('0x69')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x6a'));db[_0xd0db('0x6b')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x6c'));db[_0xd0db('0x6d')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x6e'));db[_0xd0db('0x6f')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x70'));db[_0xd0db('0x71')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x72'));db[_0xd0db('0x73')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x74'));db[_0xd0db('0x75')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x76'));db[_0xd0db('0x77')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x78'));db[_0xd0db('0x79')]=db['sequelize'][_0xd0db('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xd0db('0x7a')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x7b'));db['CmCustomField']=db['sequelize'][_0xd0db('0x14')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x7c'));db[_0xd0db('0x7d')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/automation/automation.model');db[_0xd0db('0x7e')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x7f'));db[_0xd0db('0x80')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/disposition/disposition.model');db['Condition']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x81'));db[_0xd0db('0x82')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/interval/interval.model');db[_0xd0db('0x83')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x84'));db[_0xd0db('0x85')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x86'));db[_0xd0db('0x87')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x88'));db['Schedule']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x89'));db[_0xd0db('0x8a')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x8b'));db[_0xd0db('0x8c')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x8d'));db[_0xd0db('0x8e')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x8f'));db[_0xd0db('0x90')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x91'));db[_0xd0db('0x92')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x93'));db['Integration']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x94'));db[_0xd0db('0x95')]=db['sequelize']['import'](_0xd0db('0x96'));db[_0xd0db('0x97')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x98'));db['AnalyticDefaultReport']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x99'));db[_0xd0db('0x9a')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x9b'));db[_0xd0db('0x9c')]=db[_0xd0db('0x1')]['import'](_0xd0db('0x9d'));db[_0xd0db('0x9e')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x9f'));db['AnalyticTreeReport']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xa0'));db[_0xd0db('0xa1')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xa2'));db[_0xd0db('0xa3')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xa4'));db[_0xd0db('0xa5')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xa6'));db[_0xd0db('0xa7')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xa8'));db['SugarcrmConfiguration']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xa9'));db['SugarcrmField']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xaa'));db['DeskAccount']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xab'));db[_0xd0db('0xac')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xad'));db[_0xd0db('0xae')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xaf'));db[_0xd0db('0xb0')]=db['sequelize'][_0xd0db('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0xd0db('0xb1')]=db['sequelize'][_0xd0db('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xd0db('0xb2')]=db[_0xd0db('0x1')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xd0db('0x1')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd0db('0xb3')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xd0db('0xb4')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xb5'));db[_0xd0db('0xb6')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xb7'));db[_0xd0db('0xb8')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xb9'));db[_0xd0db('0xba')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xd0db('0xbb')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xbc'));db[_0xd0db('0xbd')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xd0db('0xbe')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xbf'));db[_0xd0db('0xc0')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xd0db('0xc1')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xc2'));db[_0xd0db('0xc3')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xc4'));db[_0xd0db('0xc5')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xd0db('0xc6')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xc7'));db[_0xd0db('0xc8')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xc9'));db[_0xd0db('0xca')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xcb'));db['FreshsalesConfiguration']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xcc'));db[_0xd0db('0xcd')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/integration/integration.model');db[_0xd0db('0xce')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/network/network.model');db[_0xd0db('0xcf')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xd0'));db['ChatInternalMessage']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xd1'));db[_0xd0db('0xd2')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xd0db('0xd3')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xd4'));db[_0xd0db('0xd5')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xd6'));db[_0xd0db('0xd7')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xd8'));db[_0xd0db('0xd9')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xda'));db[_0xd0db('0xdb')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xdc'));db[_0xd0db('0xdd')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xde'));db[_0xd0db('0xdf')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xe0'));db[_0xd0db('0xe1')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xe2'));db[_0xd0db('0xe3')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/squareProject/squareProject.model');db[_0xd0db('0xe4')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xe5'));db['SquareMessage']=db[_0xd0db('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0xd0db('0xe6')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xe7'));db['License']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xe8'));db[_0xd0db('0xe9')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xea'));db[_0xd0db('0xeb')]=db['sequelize']['import'](_0xd0db('0xec'));db['Attachment']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/attachment/attachment.model');db[_0xd0db('0xed')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xee'));db['MailTransferReport']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xef'));db[_0xd0db('0xf0')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xf1'));db[_0xd0db('0xf2')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xf3'));db[_0xd0db('0xf4')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0xf5'));db[_0xd0db('0xf6')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xf7'));db[_0xd0db('0xf8')]=db[_0xd0db('0x1')]['import']('../api/cmList/cmList.model');db['VoicePrefix']=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xd0db('0xf9')]=db[_0xd0db('0x1')]['import'](_0xd0db('0xfa'));db[_0xd0db('0xfb')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xfc'));db[_0xd0db('0xfd')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xfe'));db['UserNotification']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0xff'));db[_0xd0db('0x100')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x101'));db['WhatsappApplication']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x102'));db[_0xd0db('0x103')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x104'));db[_0xd0db('0x105')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x106'));db[_0xd0db('0x107')]=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x108'));db['WhatsappQueue']=db['sequelize'][_0xd0db('0x14')](_0xd0db('0x109'));db['CloudProvider']=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x10a'));db[_0xd0db('0x10b')]=db[_0xd0db('0x1')][_0xd0db('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xd0db('0x10c')]=db[_0xd0db('0x1')][_0xd0db('0x14')](_0xd0db('0x10d'));db[_0xd0db('0x10e')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xd0db('0x13')][_0xd0db('0x10f')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x111')});db['User'][_0xd0db('0x112')](db[_0xd0db('0x1f')],{'as':'Recordings','foreignKey':_0xd0db('0x111')});db['User'][_0xd0db('0x112')](db[_0xd0db('0x33')],{'as':_0xd0db('0x113'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x13')][_0xd0db('0x112')](db[_0xd0db('0x19')],{'as':_0xd0db('0x114'),'onDelete':'cascade','hooks':!![]});db['User'][_0xd0db('0x112')](db[_0xd0db('0x115')],{'as':_0xd0db('0x116'),'foreignKey':_0xd0db('0x111')});db['User'][_0xd0db('0x112')](db[_0xd0db('0x79')],{'as':'HopperHistory','foreignKey':_0xd0db('0x111')});db[_0xd0db('0x13')]['hasMany'](db[_0xd0db('0x7a')],{'as':_0xd0db('0x7a'),'foreignKey':'UserId'});db[_0xd0db('0x13')][_0xd0db('0x112')](db[_0xd0db('0x62')],{'as':'OpenchannelInteractions','foreignKey':_0xd0db('0x111')});db[_0xd0db('0x13')]['hasMany'](db[_0xd0db('0x67')],{'as':_0xd0db('0x117'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x13')][_0xd0db('0x112')](db['SmsInteraction'],{'as':_0xd0db('0x118'),'foreignKey':'UserId'});db[_0xd0db('0x13')][_0xd0db('0x112')](db[_0xd0db('0x119')],{'as':_0xd0db('0x11a'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x13')]['hasMany'](db[_0xd0db('0x45')],{'as':_0xd0db('0x11b'),'foreignKey':'UserId'});db[_0xd0db('0x13')][_0xd0db('0x112')](db[_0xd0db('0x103')],{'as':_0xd0db('0x11c'),'foreignKey':'UserId'});db[_0xd0db('0x13')][_0xd0db('0x112')](db[_0xd0db('0x11d')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xd0db('0x11e')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xd0db('0x11f')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x6f')],{'as':'Groups','through':_0xd0db('0x121')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x75')],{'as':_0xd0db('0x122'),'through':_0xd0db('0x123')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0xf8')],{'as':'Lists','through':_0xd0db('0x124')});db[_0xd0db('0x13')]['belongsToMany'](db[_0xd0db('0xe6')],{'through':_0xd0db('0x125')});db[_0xd0db('0x13')][_0xd0db('0x120')](db['MailInteraction'],{'as':'MailInteractions','through':_0xd0db('0x126')});db['User']['belongsToMany'](db[_0xd0db('0x67')],{'as':_0xd0db('0x117'),'through':_0xd0db('0x127')});db['User'][_0xd0db('0x120')](db[_0xd0db('0x119')],{'as':_0xd0db('0x11a'),'through':_0xd0db('0x128')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x59')],{'as':_0xd0db('0x118'),'through':'user_has_sms_interactions'});db[_0xd0db('0x13')][_0xd0db('0x120')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x103')],{'as':'WhatsappInteractions','through':_0xd0db('0x129')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x1d')],{'as':_0xd0db('0x12a'),'through':_0xd0db('0x12b'),'required':![]});db[_0xd0db('0x13')]['belongsToMany'](db[_0xd0db('0x12c')],{'as':_0xd0db('0x12d'),'through':_0xd0db('0x10e'),'required':![]});db['User'][_0xd0db('0x120')](db['MailQueue'],{'as':_0xd0db('0x12e'),'through':_0xd0db('0x37'),'required':![]});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x6d')],{'as':_0xd0db('0x12f'),'through':_0xd0db('0x35'),'required':![],'hooks':!![]});db[_0xd0db('0x13')]['belongsToMany'](db[_0xd0db('0x130')],{'as':'FaxQueues','through':_0xd0db('0x39'),'required':![]});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x5c')],{'as':_0xd0db('0x131'),'through':_0xd0db('0x3b'),'required':![]});db[_0xd0db('0x13')]['belongsToMany'](db[_0xd0db('0x64')],{'as':_0xd0db('0x132'),'through':_0xd0db('0x133'),'required':![]});db['User']['belongsToMany'](db[_0xd0db('0x134')],{'as':_0xd0db('0x135'),'through':_0xd0db('0x136'),'required':![]});db[_0xd0db('0x13')]['belongsToMany'](db['CmList'],{'through':_0xd0db('0x124')});db[_0xd0db('0x13')]['belongsToMany'](db[_0xd0db('0x12c')],{'as':_0xd0db('0x12d'),'through':_0xd0db('0x137'),'required':![]});db['User'][_0xd0db('0x120')](db[_0xd0db('0x138')],{'as':'ChatWebsites','through':_0xd0db('0x139')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0x13a')],{'as':_0xd0db('0x13b'),'through':_0xd0db('0x13c')});db[_0xd0db('0x13')][_0xd0db('0x120')](db['MailAccount'],{'as':_0xd0db('0x13d'),'through':'user_has_mail_accounts'});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0xd0db('0x13e'),'through':_0xd0db('0x13f')});db[_0xd0db('0x13')][_0xd0db('0x120')](db['SmsAccount'],{'as':_0xd0db('0x140'),'through':'user_has_sms_accounts'});db[_0xd0db('0x13')][_0xd0db('0x120')](db['WhatsappAccount'],{'as':_0xd0db('0x141'),'through':_0xd0db('0x142')});db[_0xd0db('0x13')][_0xd0db('0x120')](db[_0xd0db('0xe3')],{'as':_0xd0db('0x143'),'through':_0xd0db('0x144')});db[_0xd0db('0x145')][_0xd0db('0x112')](db['VoiceExtension'],{'as':_0xd0db('0x146'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x147')});db[_0xd0db('0x17')][_0xd0db('0x112')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xd0db('0x19')][_0xd0db('0x112')](db[_0xd0db('0x19')],{'as':_0xd0db('0x148'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x1b')][_0xd0db('0x120')](db[_0xd0db('0x8a')],{'as':_0xd0db('0x149'),'through':_0xd0db('0x14a')});db['VoiceQueue'][_0xd0db('0x112')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xd0db('0x14b')});db[_0xd0db('0x1d')][_0xd0db('0x112')](db[_0xd0db('0x77')],{'as':_0xd0db('0x14c'),'foreignKey':_0xd0db('0x14b')});db[_0xd0db('0x1d')][_0xd0db('0x112')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd0db('0x14b')});db[_0xd0db('0x1d')][_0xd0db('0x112')](db['CmHopperHistory'],{'as':_0xd0db('0x14d'),'foreignKey':'VoiceQueueId'});db[_0xd0db('0x1d')][_0xd0db('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xd0db('0x14b')});db[_0xd0db('0x1d')][_0xd0db('0x112')](db[_0xd0db('0x14e')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0xd0db('0x1d')][_0xd0db('0x112')](db[_0xd0db('0xd5')],{'as':_0xd0db('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xd0db('0x1d')][_0xd0db('0x11e')](db[_0xd0db('0x2f')],{'as':_0xd0db('0x2f'),'foreignKey':_0xd0db('0x150')});db[_0xd0db('0x1d')][_0xd0db('0x11e')](db[_0xd0db('0x2f')],{'as':_0xd0db('0x151'),'foreignKey':_0xd0db('0x152')});db[_0xd0db('0x1d')][_0xd0db('0x11e')](db[_0xd0db('0x82')],{'as':'Interval','foreignKey':_0xd0db('0x153')});db[_0xd0db('0x1d')][_0xd0db('0x11e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xd0db('0x154')});db['VoiceQueue']['belongsToMany'](db[_0xd0db('0xf8')],{'as':_0xd0db('0x155'),'through':'voice_queues_has_cm_lists'});db[_0xd0db('0x1d')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x12b')});db[_0xd0db('0x1d')][_0xd0db('0x120')](db[_0xd0db('0xe6')],{'as':'Teams','through':_0xd0db('0x10b')});db[_0xd0db('0x1d')][_0xd0db('0x120')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x157'),'through':_0xd0db('0x158')});db[_0xd0db('0x1f')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x13'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x20')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x13'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x22')]['hasMany'](db['VoiceMailMessage'],{'as':_0xd0db('0x159'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x15a'),'sourceKey':_0xd0db('0x15b')});db['VoiceMailMessage'][_0xd0db('0x11e')](db[_0xd0db('0x22')],{'foreignKey':_0xd0db('0x15a'),'targetKey':'mailbox'});db[_0xd0db('0x26')]['hasMany'](db[_0xd0db('0x2b')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0xd0db('0x26')]['hasMany'](db[_0xd0db('0x29')],{'as':'AgentReports','foreignKey':_0xd0db('0x15c'),'constraints':![]});db['VoiceCallReport'][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x13'),'foreignKey':_0xd0db('0x111')});db['VoiceCallReport']['belongsTo'](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x15f')]['belongsTo'](db[_0xd0db('0x160')],{'as':_0xd0db('0x160'),'foreignKey':_0xd0db('0x161')});db[_0xd0db('0x162')]['belongsTo'](db[_0xd0db('0x160')],{'as':_0xd0db('0x160'),'foreignKey':_0xd0db('0x161')});db[_0xd0db('0x160')][_0xd0db('0x10f')](db[_0xd0db('0x15f')],{'as':'Imap','onDelete':_0xd0db('0x110')});db['MailAccount'][_0xd0db('0x10f')](db[_0xd0db('0x162')],{'as':'Smtp','onDelete':_0xd0db('0x110')});db[_0xd0db('0x160')][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':_0xd0db('0x163'),'foreignKey':_0xd0db('0x161'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x160')][_0xd0db('0x112')](db[_0xd0db('0x7e')],{'as':'Answers','foreignKey':_0xd0db('0x161')});db[_0xd0db('0x160')]['hasMany'](db[_0xd0db('0x47')],{'as':_0xd0db('0x159'),'foreignKey':_0xd0db('0x161')});db[_0xd0db('0x160')][_0xd0db('0x112')](db[_0xd0db('0x45')],{'as':_0xd0db('0x164')});db[_0xd0db('0x160')][_0xd0db('0x112')](db['MailApplication'],{'as':_0xd0db('0x148')});db[_0xd0db('0x160')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':'ListId'});db[_0xd0db('0x160')][_0xd0db('0x11e')](db[_0xd0db('0x8e')],{'as':_0xd0db('0x8e'),'foreignKey':_0xd0db('0x166')});db['MailAccount'][_0xd0db('0x11e')](db['Pause'],{'as':_0xd0db('0x167'),'foreignKey':_0xd0db('0x154')});db['MailAccount']['belongsToMany'](db[_0xd0db('0x13')],{'as':'Agents','through':_0xd0db('0x168')});db['MailQueue'][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x37')});db[_0xd0db('0x41')][_0xd0db('0x120')](db[_0xd0db('0xe6')],{'through':_0xd0db('0x169'),'as':_0xd0db('0x16a')});db[_0xd0db('0x45')]['hasMany'](db[_0xd0db('0x47')],{'as':'Messages','onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x16b')});db[_0xd0db('0x45')][_0xd0db('0x11e')](db['MailAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x161')});db['MailInteraction'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x45')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x16d'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x45')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':'mail_interaction_has_tags','as':_0xd0db('0x16e')});db[_0xd0db('0x45')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x16f'),'as':_0xd0db('0x170')});db[_0xd0db('0x45')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x171'),'through':_0xd0db('0x126'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0xd0db('0x172')],{'as':_0xd0db('0x173'),'onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0xd0db('0x13')],{'as':'User'});db[_0xd0db('0x47')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x15d')});db[_0xd0db('0x47')][_0xd0db('0x11e')](db[_0xd0db('0x45')],{'as':'Interaction','foreignKey':_0xd0db('0x16b')});db[_0xd0db('0x47')][_0xd0db('0x11e')](db[_0xd0db('0x160')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xd0db('0x47')][_0xd0db('0x11e')](db['ChatWebsite'],{'as':_0xd0db('0x138'),'foreignKey':_0xd0db('0x174')});db[_0xd0db('0x47')][_0xd0db('0x11e')](db[_0xd0db('0x6b')],{'as':_0xd0db('0x6b'),'foreignKey':_0xd0db('0x175')});db[_0xd0db('0x49')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':'restrict'});db[_0xd0db('0x49')][_0xd0db('0x11e')](db['MailQueue'],{'onDelete':_0xd0db('0x176')});db['MailApplication']['belongsTo'](db[_0xd0db('0x160')],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x49')]['belongsTo'](db[_0xd0db('0x82')],{'onDelete':'restrict','foreignKey':_0xd0db('0x153')});db[_0xd0db('0x49')][_0xd0db('0x11e')](db[_0xd0db('0x8c')],{'onDelete':'restrict','foreignKey':_0xd0db('0x177')});db[_0xd0db('0x4b')][_0xd0db('0x11e')](db['MailAccount'],{});db[_0xd0db('0x4b')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178')});db['MailQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':'ContactId'});db[_0xd0db('0x4b')][_0xd0db('0x11e')](db[_0xd0db('0x45')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db[_0xd0db('0x4b')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{});db[_0xd0db('0x4b')][_0xd0db('0x11e')](db['MailQueue'],{});db[_0xd0db('0x179')][_0xd0db('0x112')](db['DashboardItem'],{'as':_0xd0db('0x17a'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x13a')]['hasMany'](db[_0xd0db('0x80')],{'as':'Dispositions','foreignKey':_0xd0db('0x17b'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x13a')][_0xd0db('0x112')](db[_0xd0db('0x7e')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xd0db('0x13a')][_0xd0db('0x112')](db[_0xd0db('0x119')],{'as':_0xd0db('0x164')});db[_0xd0db('0x13a')][_0xd0db('0x112')](db['FaxApplication'],{'as':_0xd0db('0x148')});db[_0xd0db('0x13a')][_0xd0db('0x112')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xd0db('0x110')});db[_0xd0db('0x13a')]['hasMany'](db[_0xd0db('0x52')],{'as':_0xd0db('0x159')});db[_0xd0db('0x13a')][_0xd0db('0x11e')](db[_0xd0db('0x2f')],{'as':_0xd0db('0x2f')});db[_0xd0db('0x13a')]['belongsTo'](db['CmList'],{'as':_0xd0db('0x165'),'foreignKey':'ListId'});db[_0xd0db('0x13a')][_0xd0db('0x11e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xd0db('0x154')});db[_0xd0db('0x13a')][_0xd0db('0x120')](db['User'],{'as':'Agents','through':_0xd0db('0x13c')});db[_0xd0db('0x50')]['belongsTo'](db[_0xd0db('0x13')],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x50')][_0xd0db('0x11e')](db['FaxQueue'],{'onDelete':_0xd0db('0x176')});db['FaxApplication']['belongsTo'](db[_0xd0db('0x13a')],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x50')][_0xd0db('0x11e')](db[_0xd0db('0x8c')],{'onDelete':'restrict','foreignKey':_0xd0db('0x177')});db[_0xd0db('0x119')][_0xd0db('0x112')](db['FaxMessage'],{'as':_0xd0db('0x159'),'onDelete':'cascade','foreignKey':_0xd0db('0x17c')});db[_0xd0db('0x119')][_0xd0db('0x11e')](db['FaxAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x17b')});db[_0xd0db('0x119')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x119')][_0xd0db('0x11e')](db['User'],{'as':_0xd0db('0x16d'),'foreignKey':_0xd0db('0x111')});db[_0xd0db('0x119')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':'fax_interaction_has_tags','as':_0xd0db('0x16e')});db[_0xd0db('0x119')]['belongsToMany'](db[_0xd0db('0x8c')],{'through':_0xd0db('0x17d'),'as':_0xd0db('0x170')});db['FaxInteraction'][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x171'),'through':_0xd0db('0x128'),'foreignKey':_0xd0db('0x17c')});db[_0xd0db('0x52')][_0xd0db('0x11e')](db['User'],{'onDelete':'cascade','as':_0xd0db('0x13')});db[_0xd0db('0x52')][_0xd0db('0x11e')](db[_0xd0db('0x119')],{'as':'Interaction','foreignKey':_0xd0db('0x17c')});db['FaxMessage'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x15d')});db[_0xd0db('0x52')]['belongsTo'](db['Attachment'],{'as':_0xd0db('0x172'),'foreignKey':_0xd0db('0x17e')});db[_0xd0db('0x52')][_0xd0db('0x11e')](db[_0xd0db('0x13a')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x17b')});db[_0xd0db('0x130')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x39')});db[_0xd0db('0x130')][_0xd0db('0x120')](db[_0xd0db('0xe6')],{'through':'team_has_fax_queues','as':_0xd0db('0x16a')});db[_0xd0db('0x55')][_0xd0db('0x11e')](db['FaxAccount'],{});db[_0xd0db('0x55')][_0xd0db('0x11e')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xd0db('0x55')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db['FaxQueueReport']['belongsTo'](db[_0xd0db('0x119')],{});db['FaxQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x52')],{});db[_0xd0db('0x55')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{});db[_0xd0db('0x55')]['belongsTo'](db[_0xd0db('0x130')],{});db[_0xd0db('0x57')]['hasMany'](db['Disposition'],{'as':_0xd0db('0x163'),'foreignKey':_0xd0db('0x17f'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x57')]['hasMany'](db[_0xd0db('0x7e')],{'as':_0xd0db('0x180'),'foreignKey':_0xd0db('0x17f')});db[_0xd0db('0x57')][_0xd0db('0x112')](db['SmsMessage'],{'as':_0xd0db('0x159'),'foreignKey':_0xd0db('0x17f')});db[_0xd0db('0x57')][_0xd0db('0x112')](db[_0xd0db('0x59')],{'as':_0xd0db('0x164')});db[_0xd0db('0x57')][_0xd0db('0x112')](db[_0xd0db('0x58')],{'as':'Applications'});db['SmsAccount'][_0xd0db('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xd0db('0x178')});db[_0xd0db('0x57')][_0xd0db('0x11e')](db[_0xd0db('0x83')],{'as':_0xd0db('0x167'),'foreignKey':_0xd0db('0x154')});db[_0xd0db('0x57')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x181')});db['SmsApplication'][_0xd0db('0x11e')](db['User'],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x58')][_0xd0db('0x11e')](db[_0xd0db('0x5c')],{'onDelete':'restrict'});db[_0xd0db('0x58')][_0xd0db('0x11e')](db['SmsAccount'],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x58')][_0xd0db('0x11e')](db[_0xd0db('0x82')],{'onDelete':_0xd0db('0x176'),'foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0xd0db('0x8c')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x177')});db['SmsInteraction'][_0xd0db('0x112')](db[_0xd0db('0x5b')],{'as':_0xd0db('0x159'),'onDelete':'cascade','foreignKey':_0xd0db('0x182')});db[_0xd0db('0x59')][_0xd0db('0x11e')](db[_0xd0db('0x57')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x17f')});db[_0xd0db('0x59')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x59')]['belongsTo'](db[_0xd0db('0x13')],{'as':_0xd0db('0x16d'),'foreignKey':'UserId'});db[_0xd0db('0x59')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x183'),'as':_0xd0db('0x16e')});db[_0xd0db('0x59')][_0xd0db('0x120')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xd0db('0x170')});db[_0xd0db('0x59')][_0xd0db('0x120')](db['User'],{'as':_0xd0db('0x171'),'through':_0xd0db('0x184'),'foreignKey':_0xd0db('0x182')});db[_0xd0db('0x5b')][_0xd0db('0x11e')](db['User'],{'as':'User'});db[_0xd0db('0x5b')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'onDelete':_0xd0db('0x110'),'as':'Contact'});db[_0xd0db('0x5b')][_0xd0db('0x11e')](db[_0xd0db('0x59')],{'onDelete':'cascade','as':_0xd0db('0x185'),'foreignKey':_0xd0db('0x182')});db[_0xd0db('0x5b')][_0xd0db('0x11e')](db['SmsAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x17f')});db['SmsQueue']['belongsToMany'](db[_0xd0db('0x13')],{'as':'Agents','through':_0xd0db('0x3b'),'foreignKey':_0xd0db('0x186')});db[_0xd0db('0x5c')]['belongsToMany'](db[_0xd0db('0xe6')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xd0db('0x5e')][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':_0xd0db('0x163'),'foreignKey':_0xd0db('0x187'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x5e')][_0xd0db('0x112')](db[_0xd0db('0x7e')],{'as':'Answers','foreignKey':_0xd0db('0x187')});db[_0xd0db('0x5e')]['hasMany'](db[_0xd0db('0x62')],{'as':_0xd0db('0x164'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x5e')][_0xd0db('0x112')](db[_0xd0db('0x188')],{'as':_0xd0db('0x159'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x5e')]['hasMany'](db[_0xd0db('0x60')],{'as':_0xd0db('0x148'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x5e')]['belongsTo'](db[_0xd0db('0xf8')],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db[_0xd0db('0x83')],{'as':_0xd0db('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd0db('0x5e')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x13f')});db[_0xd0db('0x60')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':'restrict'});db[_0xd0db('0x60')][_0xd0db('0x11e')](db[_0xd0db('0x64')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x189')});db[_0xd0db('0x60')][_0xd0db('0x11e')](db[_0xd0db('0x5e')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x60')]['belongsTo'](db[_0xd0db('0x82')],{'onDelete':_0xd0db('0x176'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xd0db('0x11e')](db[_0xd0db('0x8c')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x177')});db[_0xd0db('0x62')]['hasMany'](db[_0xd0db('0x188')],{'as':_0xd0db('0x159'),'onDelete':_0xd0db('0x110'),'foreignKey':'OpenchannelInteractionId'});db[_0xd0db('0x62')][_0xd0db('0x11e')](db['OpenchannelAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x62')]['belongsTo'](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x62')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x16d'),'foreignKey':'UserId'});db[_0xd0db('0x62')]['belongsToMany'](db[_0xd0db('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0xd0db('0x16e')});db[_0xd0db('0x62')][_0xd0db('0x120')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xd0db('0x170')});db[_0xd0db('0x62')]['belongsToMany'](db['User'],{'as':_0xd0db('0x171'),'through':_0xd0db('0x18a'),'foreignKey':_0xd0db('0x18b')});db[_0xd0db('0x188')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x13')});db[_0xd0db('0x188')][_0xd0db('0x11e')](db['CmContact'],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x15d')});db[_0xd0db('0x188')][_0xd0db('0x11e')](db['OpenchannelInteraction'],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x185'),'foreignKey':_0xd0db('0x18b')});db[_0xd0db('0x188')][_0xd0db('0x11e')](db[_0xd0db('0x172')],{'as':_0xd0db('0x172'),'foreignKey':'AttachmentId'});db['OpenchannelMessage']['belongsTo'](db[_0xd0db('0x5e')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x187')});db[_0xd0db('0x64')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x133'),'foreignKey':_0xd0db('0x189')});db[_0xd0db('0x64')][_0xd0db('0x120')](db[_0xd0db('0xe6')],{'through':_0xd0db('0x18c'),'as':_0xd0db('0x16a')});db['ChatWebsite'][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xd0db('0x110')});db[_0xd0db('0x138')][_0xd0db('0x112')](db[_0xd0db('0x7e')],{'as':'Answers','foreignKey':_0xd0db('0x174')});db[_0xd0db('0x138')]['hasMany'](db[_0xd0db('0x71')],{'as':_0xd0db('0x18d')});db[_0xd0db('0x138')][_0xd0db('0x112')](db['ChatInteraction'],{'as':_0xd0db('0x164')});db[_0xd0db('0x138')][_0xd0db('0x112')](db[_0xd0db('0x18e')],{'as':_0xd0db('0x148')});db[_0xd0db('0x138')][_0xd0db('0x112')](db['ChatMessage'],{'as':_0xd0db('0x159')});db[_0xd0db('0x138')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':'ListId'});db['ChatWebsite']['belongsTo'](db[_0xd0db('0x82')],{'as':_0xd0db('0x82'),'foreignKey':_0xd0db('0x153')});db[_0xd0db('0x138')][_0xd0db('0x11e')](db[_0xd0db('0x160')],{'as':_0xd0db('0x160'),'foreignKey':_0xd0db('0x161')});db['ChatWebsite'][_0xd0db('0x11e')](db[_0xd0db('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xd0db('0x154')});db[_0xd0db('0x138')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x139')});db['OpenchannelQueueReport'][_0xd0db('0x11e')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xd0db('0x11e')](db['CmList'],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178')});db['OpenchannelQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db['OpenchannelQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x62')],{});db[_0xd0db('0x66')]['belongsTo'](db[_0xd0db('0x188')],{});db['OpenchannelQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x13')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0xd0db('0x18e')][_0xd0db('0x11e')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xd0db('0x18e')][_0xd0db('0x11e')](db[_0xd0db('0x6d')],{'as':'Queue','foreignKey':_0xd0db('0x18f'),'onDelete':_0xd0db('0x176')});db[_0xd0db('0x18e')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'as':_0xd0db('0x190'),'foreignKey':_0xd0db('0x174'),'onDelete':_0xd0db('0x176')});db['ChatApplication'][_0xd0db('0x11e')](db['Tag'],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x177')});db['ChatInteraction'][_0xd0db('0x112')](db[_0xd0db('0x69')],{'as':_0xd0db('0x159'),'onDelete':_0xd0db('0x110'),'foreignKey':'ChatInteractionId'});db[_0xd0db('0x67')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xd0db('0x67')][_0xd0db('0x11e')](db['CmContact'],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x67')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x16d'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0xd0db('0x8c')],{'through':'chat_interaction_has_tags','as':_0xd0db('0x16e')});db[_0xd0db('0x67')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x191'),'as':_0xd0db('0x170')});db[_0xd0db('0x67')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x171'),'through':_0xd0db('0x127'),'foreignKey':'ChatInteractionId'});db[_0xd0db('0x69')][_0xd0db('0x11e')](db['User'],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x13')});db[_0xd0db('0x69')][_0xd0db('0x11e')](db['CmContact'],{'onDelete':_0xd0db('0x110'),'as':'Contact','foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x69')][_0xd0db('0x11e')](db[_0xd0db('0x67')],{'onDelete':'cascade','as':_0xd0db('0x185'),'foreignKey':_0xd0db('0x192')});db[_0xd0db('0x69')][_0xd0db('0x11e')](db[_0xd0db('0x172')],{'as':_0xd0db('0x172'),'foreignKey':_0xd0db('0x17e')});db[_0xd0db('0x69')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'as':'Account','foreignKey':_0xd0db('0x174')});db[_0xd0db('0x6b')][_0xd0db('0x112')](db[_0xd0db('0x172')],{'as':_0xd0db('0x173'),'foreignKey':_0xd0db('0x175'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x6b')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'as':_0xd0db('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0xd0db('0x6d')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':'Agents','through':_0xd0db('0x35'),'hooks':!![]});db['ChatQueue'][_0xd0db('0x120')](db['Team'],{'through':_0xd0db('0x193'),'as':_0xd0db('0x16a')});db[_0xd0db('0x6f')]['hasMany'](db[_0xd0db('0x194')],{'as':_0xd0db('0x159'),'foreignKey':_0xd0db('0x195'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x6f')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x196'),'through':_0xd0db('0x121')});db[_0xd0db('0x71')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'as':_0xd0db('0x190'),'foreignKey':_0xd0db('0x174')});db[_0xd0db('0x73')]['hasMany'](db['CmContact'],{'as':_0xd0db('0x122'),'foreignKey':_0xd0db('0x197')});db[_0xd0db('0x75')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db[_0xd0db('0x75')][_0xd0db('0x112')](db['CmHopperFinal'],{'as':_0xd0db('0x116'),'foreignKey':_0xd0db('0x15e')});db['CmContact'][_0xd0db('0x112')](db[_0xd0db('0x79')],{'as':_0xd0db('0x14d'),'foreignKey':'ContactId'});db[_0xd0db('0x75')][_0xd0db('0x112')](db['ReportAgentPreview'],{'as':_0xd0db('0x7a'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x75')][_0xd0db('0x112')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xd0db('0x15e')});db['CmContact'][_0xd0db('0x112')](db['OpenchannelInteraction'],{'as':_0xd0db('0x198'),'foreignKey':_0xd0db('0x15e'),'onDelete':_0xd0db('0x176')});db[_0xd0db('0x75')][_0xd0db('0x112')](db['ChatInteraction'],{'as':_0xd0db('0x117'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xd0db('0x75')]['hasMany'](db[_0xd0db('0x59')],{'as':'SmsInteractions','foreignKey':_0xd0db('0x15e'),'onDelete':_0xd0db('0x176')});db['CmContact'][_0xd0db('0x112')](db[_0xd0db('0x119')],{'as':_0xd0db('0x11a'),'foreignKey':_0xd0db('0x15e'),'onDelete':_0xd0db('0x176')});db[_0xd0db('0x75')][_0xd0db('0x112')](db[_0xd0db('0x45')],{'as':'MailInteractions','foreignKey':_0xd0db('0x15e'),'onDelete':_0xd0db('0x176')});db[_0xd0db('0x75')]['belongsTo'](db[_0xd0db('0x73')],{'as':_0xd0db('0x199'),'foreignKey':_0xd0db('0x197')});db['CmContact'][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178'),'onDelete':'cascade'});db[_0xd0db('0x75')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':'Users','through':_0xd0db('0x123')});db[_0xd0db('0x75')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'as':_0xd0db('0x16e'),'through':_0xd0db('0x19a')});db['CmContact'][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x19a'),'as':_0xd0db('0x170')});db[_0xd0db('0x77')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper'][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x77')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x19b'),'foreignKey':'UserId'});db[_0xd0db('0x77')][_0xd0db('0x11e')](db['VoiceQueue'],{'as':_0xd0db('0x19c'),'foreignKey':_0xd0db('0x14b'),'onDelete':_0xd0db('0x110')});db['CmHopper']['belongsTo'](db[_0xd0db('0xe9')],{'as':'Campaign','foreignKey':_0xd0db('0x19d'),'onDelete':'cascade'});db[_0xd0db('0x77')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xd0db('0x19e')});db[_0xd0db('0x14e')][_0xd0db('0x11e')](db['CmContact'],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e'),'onDelete':'cascade'});db[_0xd0db('0x14e')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':'List','foreignKey':_0xd0db('0x178'),'onDelete':_0xd0db('0x110')});db['CmHopperBlack'][_0xd0db('0x11e')](db[_0xd0db('0x1d')],{'as':_0xd0db('0x19c'),'foreignKey':_0xd0db('0x14b'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0x14e')]['belongsTo'](db[_0xd0db('0xe9')],{'as':'Campaign','foreignKey':_0xd0db('0x19d'),'onDelete':'cascade'});db[_0xd0db('0x7d')][_0xd0db('0x112')](db[_0xd0db('0x19f')],{'as':{'plural':'All','singular':_0xd0db('0x1a0')},'foreignKey':_0xd0db('0x1a1'),'onDelete':_0xd0db('0x110'),'hooks':!![]});db[_0xd0db('0x7d')][_0xd0db('0x112')](db['Condition'],{'as':{'plural':_0xd0db('0x1a2'),'singular':_0xd0db('0x1a3')},'foreignKey':_0xd0db('0x1a4'),'onDelete':'cascade','hooks':!![]});db[_0xd0db('0x7d')][_0xd0db('0x112')](db[_0xd0db('0x1a5')],{'as':_0xd0db('0x1a6'),'foreignKey':_0xd0db('0x1a7'),'onDelete':_0xd0db('0x110'),'hooks':!![]});db[_0xd0db('0x80')][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':'Dispositions','foreignKey':_0xd0db('0x1a8'),'onDelete':'cascade'});db['Interval']['hasMany'](db[_0xd0db('0x82')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xd0db('0x110'),'hooks':!![],'required':![]});db[_0xd0db('0x82')][_0xd0db('0x112')](db[_0xd0db('0x19')],{'as':_0xd0db('0x114'),'foreignKey':_0xd0db('0x153'),'onDelete':'restrict'});db[_0xd0db('0x82')][_0xd0db('0x112')](db[_0xd0db('0x49')],{'as':'MailApplications','foreignKey':_0xd0db('0x153')});db[_0xd0db('0x82')][_0xd0db('0x112')](db[_0xd0db('0x18e')],{'as':_0xd0db('0x1a9'),'foreignKey':'IntervalId'});db[_0xd0db('0x82')][_0xd0db('0x112')](db[_0xd0db('0x50')],{'as':_0xd0db('0x1aa'),'foreignKey':'IntervalId'});db['Interval'][_0xd0db('0x112')](db['SmsApplication'],{'as':_0xd0db('0x1ab'),'foreignKey':_0xd0db('0x153')});db['Schedule']['belongsTo'](db[_0xd0db('0x160')],{});db[_0xd0db('0x1ac')]['belongsTo'](db[_0xd0db('0x1ad')],{'foreignKey':_0xd0db('0x1ae')});db[_0xd0db('0x1ac')][_0xd0db('0x11e')](db['AnalyticCustomReport'],{'foreignKey':_0xd0db('0x1af')});db['Sound'][_0xd0db('0x120')](db['VoiceMusicOnHold'],{'as':_0xd0db('0x1b0'),'through':'moh_has_sounds','onDelete':_0xd0db('0x176')});db[_0xd0db('0x8c')][_0xd0db('0x120')](db['CmContact'],{'through':_0xd0db('0x19a')});db['Tag'][_0xd0db('0x120')](db['ChatInteraction'],{'through':_0xd0db('0x191')});db[_0xd0db('0x8c')][_0xd0db('0x120')](db['MailInteraction'],{'through':_0xd0db('0x16f')});db[_0xd0db('0x8c')][_0xd0db('0x120')](db[_0xd0db('0x59')],{'through':_0xd0db('0x183')});db[_0xd0db('0x8c')][_0xd0db('0x120')](db[_0xd0db('0x119')],{'through':_0xd0db('0x17d')});db[_0xd0db('0x8c')][_0xd0db('0x120')](db['OpenchannelInteraction'],{'through':_0xd0db('0x1b1')});db[_0xd0db('0x8c')]['belongsToMany'](db[_0xd0db('0x103')],{'through':_0xd0db('0x1b2')});db['Trigger']['hasMany'](db[_0xd0db('0x19f')],{'as':{'plural':_0xd0db('0x1b3'),'singular':_0xd0db('0x1b4')},'foreignKey':'TriggerAllId','onDelete':_0xd0db('0x110'),'hooks':!![]});db['Trigger'][_0xd0db('0x112')](db[_0xd0db('0x19f')],{'as':{'plural':_0xd0db('0x1b5'),'singular':'AnyCondition'},'foreignKey':_0xd0db('0x1b6'),'onDelete':_0xd0db('0x110'),'hooks':!![]});db[_0xd0db('0x90')][_0xd0db('0x112')](db['Action'],{'as':_0xd0db('0x1a6'),'foreignKey':_0xd0db('0x1b7'),'onDelete':_0xd0db('0x110'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1af'),'hooks':!![]});db[_0xd0db('0x1ad')]['hasMany'](db[_0xd0db('0x9e')],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1ae')});db[_0xd0db('0x9c')][_0xd0db('0x112')](db['AnalyticFieldReport'],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':'MetricId'});db[_0xd0db('0x9e')][_0xd0db('0x11e')](db[_0xd0db('0x9c')],{'foreignKey':_0xd0db('0x1b9')});db['SalesforceAccount'][_0xd0db('0x112')](db['SalesforceConfiguration'],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':'AccountId'});db[_0xd0db('0xa3')]['hasMany'](db[_0xd0db('0xa5')],{'as':_0xd0db('0x1bb'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xa3')][_0xd0db('0x112')](db['SalesforceField'],{'as':_0xd0db('0x1bd'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xa3')][_0xd0db('0x112')](db[_0xd0db('0xa5')],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xa3')][_0xd0db('0x11e')](db['SalesforceAccount'],{'as':_0xd0db('0x16c'),'foreignKey':'AccountId'});db[_0xd0db('0xa5')][_0xd0db('0x112')](db['SalesforceField'],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xa5')][_0xd0db('0x112')](db[_0xd0db('0xa5')],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xa5')][_0xd0db('0x112')](db[_0xd0db('0xa5')],{'as':_0xd0db('0x1c2'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xa5')][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xa7')][_0xd0db('0x112')](db[_0xd0db('0x1c4')],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xd0db('0x112')](db[_0xd0db('0x1c5')],{'as':_0xd0db('0x1bb'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0x1c4')][_0xd0db('0x112')](db[_0xd0db('0x1c5')],{'as':_0xd0db('0x1bd'),'onDelete':_0xd0db('0x110'),'foreignKey':'DescriptionId'});db[_0xd0db('0x1c4')][_0xd0db('0x112')](db['SugarcrmField'],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0x1c4')]['belongsTo'](db[_0xd0db('0xa7')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0x1c5')][_0xd0db('0x112')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0x1c5')]['hasMany'](db[_0xd0db('0x1c5')],{'as':_0xd0db('0x1c1'),'foreignKey':'DescriptionId'});db[_0xd0db('0x1c5')][_0xd0db('0x112')](db[_0xd0db('0x1c5')],{'as':'Field','foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0x1c5')][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0x1c7')][_0xd0db('0x112')](db[_0xd0db('0xac')],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xac')][_0xd0db('0x112')](db[_0xd0db('0xae')],{'as':_0xd0db('0x1bb'),'onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0xd0db('0x112')](db[_0xd0db('0xae')],{'as':_0xd0db('0x1bd'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xac')][_0xd0db('0x112')](db[_0xd0db('0xae')],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xac')][_0xd0db('0x11e')](db[_0xd0db('0x1c7')],{'as':_0xd0db('0x16c'),'foreignKey':'AccountId'});db[_0xd0db('0xac')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x1c8')});db[_0xd0db('0xae')][_0xd0db('0x112')](db[_0xd0db('0xae')],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xae')]['hasMany'](db[_0xd0db('0xae')],{'as':_0xd0db('0x1c1'),'foreignKey':'DescriptionId'});db[_0xd0db('0xae')][_0xd0db('0x112')](db[_0xd0db('0xae')],{'as':_0xd0db('0x1c2'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xae')]['belongsTo'](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xb0')][_0xd0db('0x112')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xb1')]['hasMany'](db[_0xd0db('0xb2')],{'as':_0xd0db('0x1bb'),'onDelete':_0xd0db('0x110'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xd0db('0x112')](db['ZohoField'],{'as':_0xd0db('0x1bd'),'onDelete':'cascade','foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xb1')][_0xd0db('0x112')](db[_0xd0db('0xb2')],{'as':_0xd0db('0x1b8'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xb1')]['belongsTo'](db[_0xd0db('0xb0')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x1c6')});db['ZohoField'][_0xd0db('0x112')](db[_0xd0db('0xb2')],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xb2')][_0xd0db('0x112')](db[_0xd0db('0xb2')],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db['ZohoField'][_0xd0db('0x112')](db[_0xd0db('0xb2')],{'as':_0xd0db('0x1c2'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xb2')]['belongsTo'](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0x1c9')]['hasMany'](db['ZendeskConfiguration'],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xb3')]['hasMany'](db[_0xd0db('0xb4')],{'as':_0xd0db('0x1bb'),'foreignKey':'SubjectId'});db[_0xd0db('0xb3')][_0xd0db('0x112')](db[_0xd0db('0xb4')],{'as':_0xd0db('0x1bd'),'foreignKey':_0xd0db('0x1be')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0xd0db('0x1b8'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xb3')][_0xd0db('0x11e')](db['ZendeskAccount'],{'as':_0xd0db('0x16c'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0xd0db('0x8c')],{'through':_0xd0db('0x1ca')});db[_0xd0db('0xb4')]['hasMany'](db[_0xd0db('0xb4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd0db('0xb4')][_0xd0db('0x112')](db[_0xd0db('0xb4')],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xb4')][_0xd0db('0x112')](db[_0xd0db('0xb4')],{'as':_0xd0db('0x1c2'),'foreignKey':'FieldId'});db[_0xd0db('0xb4')][_0xd0db('0x11e')](db['Variable'],{'as':_0xd0db('0x92'),'foreignKey':'VariableId'});db[_0xd0db('0xb6')][_0xd0db('0x112')](db['FreshdeskConfiguration'],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db['FreshdeskConfiguration']['hasMany'](db[_0xd0db('0xba')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd0db('0xb8')][_0xd0db('0x112')](db['FreshdeskField'],{'as':_0xd0db('0x1bd'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xb8')]['hasMany'](db[_0xd0db('0xba')],{'as':'Fields','onDelete':_0xd0db('0x110'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0xd0db('0x11e')](db['FreshdeskAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xb8')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xd0db('0xba')][_0xd0db('0x112')](db['FreshdeskField'],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xba')]['hasMany'](db[_0xd0db('0xba')],{'as':_0xd0db('0x1c1'),'foreignKey':'DescriptionId'});db[_0xd0db('0xba')][_0xd0db('0x112')](db[_0xd0db('0xba')],{'as':_0xd0db('0x1c2'),'foreignKey':'FieldId'});db['FreshdeskField']['belongsTo'](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':'VariableId'});db[_0xd0db('0xbb')]['hasMany'](db[_0xd0db('0xbd')],{'as':'Configurations','onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xbd')]['hasMany'](db[_0xd0db('0xbe')],{'as':'Subjects','foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xbd')][_0xd0db('0x112')](db[_0xd0db('0xbe')],{'as':_0xd0db('0x1bd'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xbd')][_0xd0db('0x112')](db[_0xd0db('0xbe')],{'as':_0xd0db('0x1b8'),'foreignKey':_0xd0db('0x1bf')});db['VtigerConfiguration'][_0xd0db('0x11e')](db[_0xd0db('0xbb')],{'as':'Account','foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xbe')][_0xd0db('0x112')](db['VtigerField'],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xbe')][_0xd0db('0x112')](db['VtigerField'],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xbe')][_0xd0db('0x112')](db[_0xd0db('0xbe')],{'as':_0xd0db('0x1c2'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xbe')][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xc0')][_0xd0db('0x112')](db[_0xd0db('0xc1')],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xc1')][_0xd0db('0x112')](db[_0xd0db('0xc3')],{'as':_0xd0db('0x1bb'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xc1')][_0xd0db('0x112')](db[_0xd0db('0xc3')],{'as':_0xd0db('0x1bd'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xd0db('0xc3')],{'as':_0xd0db('0x1b8'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xc1')][_0xd0db('0x11e')](db[_0xd0db('0xc0')],{'as':'Account','foreignKey':_0xd0db('0x1c6')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Subject','foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xc3')][_0xd0db('0x112')](db[_0xd0db('0xc3')],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xc3')][_0xd0db('0x112')](db[_0xd0db('0xc3')],{'as':_0xd0db('0x1c2'),'foreignKey':'FieldId'});db[_0xd0db('0xc3')][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xc5')][_0xd0db('0x112')](db[_0xd0db('0xc6')],{'as':'Configurations','onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xc6')]['hasMany'](db[_0xd0db('0xc8')],{'as':_0xd0db('0x1bb'),'onDelete':_0xd0db('0x110'),'foreignKey':'SubjectId'});db[_0xd0db('0xc6')][_0xd0db('0x112')](db[_0xd0db('0xc8')],{'as':_0xd0db('0x1bd'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1be')});db[_0xd0db('0xc6')]['hasMany'](db[_0xd0db('0xc8')],{'as':'Fields','onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1bf')});db['Dynamics365Configuration'][_0xd0db('0x11e')](db[_0xd0db('0xc5')],{'as':_0xd0db('0x16c'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0xd0db('0x112')](db[_0xd0db('0xc8')],{'as':'Subject','foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0xc8')][_0xd0db('0x112')](db[_0xd0db('0xc8')],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db['Dynamics365Field']['hasMany'](db[_0xd0db('0xc8')],{'as':_0xd0db('0x1c2'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':'Variable','foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xca')][_0xd0db('0x112')](db[_0xd0db('0x1cb')],{'as':_0xd0db('0x1ba'),'onDelete':_0xd0db('0x110'),'foreignKey':'AccountId'});db[_0xd0db('0x1cb')][_0xd0db('0x112')](db[_0xd0db('0xcd')],{'as':_0xd0db('0x1bb'),'foreignKey':_0xd0db('0x1bc')});db[_0xd0db('0x1cb')][_0xd0db('0x112')](db[_0xd0db('0xcd')],{'as':_0xd0db('0x1bd'),'foreignKey':_0xd0db('0x1be')});db['FreshsalesConfiguration'][_0xd0db('0x112')](db['FreshsalesField'],{'as':_0xd0db('0x1b8'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0x1cb')]['belongsTo'](db[_0xd0db('0xca')],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x1c6')});db[_0xd0db('0xcd')]['hasMany'](db[_0xd0db('0xcd')],{'as':_0xd0db('0x1c0'),'foreignKey':_0xd0db('0x1bc')});db['FreshsalesField'][_0xd0db('0x112')](db['FreshsalesField'],{'as':_0xd0db('0x1c1'),'foreignKey':_0xd0db('0x1be')});db['FreshsalesField'][_0xd0db('0x112')](db[_0xd0db('0xcd')],{'as':_0xd0db('0x1c2'),'foreignKey':_0xd0db('0x1bf')});db[_0xd0db('0xcd')][_0xd0db('0x11e')](db[_0xd0db('0x92')],{'as':_0xd0db('0x92'),'foreignKey':_0xd0db('0x1c3')});db[_0xd0db('0xcf')][_0xd0db('0x11e')](db['ChatWebsite'],{});db[_0xd0db('0xcf')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0xcf')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':'Contact','foreignKey':_0xd0db('0x15e')});db[_0xd0db('0xcf')][_0xd0db('0x11e')](db[_0xd0db('0x67')],{});db['ChatQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x69')],{});db[_0xd0db('0xcf')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0xd0db('0x6d')],{});db[_0xd0db('0x194')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1cc')});db['ChatInternalMessage'][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1cd')});db['JscriptySessionReport'][_0xd0db('0x112')](db[_0xd0db('0xd3')],{'foreignKey':_0xd0db('0x1ce'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0xd5')][_0xd0db('0x112')](db[_0xd0db('0xd2')],{'foreignKey':_0xd0db('0x1ce'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0xd7')][_0xd0db('0x11e')](db[_0xd0db('0x57')],{});db[_0xd0db('0xd7')][_0xd0db('0x11e')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0xd7')][_0xd0db('0x11e')](db['SmsInteraction'],{});db[_0xd0db('0xd7')][_0xd0db('0x11e')](db[_0xd0db('0x5b')],{});db['SmsQueueReport']['belongsTo'](db[_0xd0db('0x13')],{});db[_0xd0db('0xd7')][_0xd0db('0x11e')](db[_0xd0db('0x5c')],{});db[_0xd0db('0xdd')][_0xd0db('0x112')](db[_0xd0db('0xd5')],{'foreignKey':_0xd0db('0x1cf')});db['JscriptyProject']['hasMany'](db[_0xd0db('0xd3')],{'foreignKey':_0xd0db('0x1cf')});db[_0xd0db('0xdd')][_0xd0db('0x112')](db[_0xd0db('0xd2')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xd0db('0x120')](db['User'],{'as':'Users','through':'user_has_square_projects'});db['Team'][_0xd0db('0x120')](db['User'],{'as':_0xd0db('0x156'),'through':_0xd0db('0x125')});db[_0xd0db('0xe6')]['belongsToMany'](db[_0xd0db('0x1d')],{'through':_0xd0db('0x10b'),'as':'VoiceQueues'});db['Team'][_0xd0db('0x120')](db[_0xd0db('0x41')],{'through':_0xd0db('0x169'),'as':_0xd0db('0x12e')});db[_0xd0db('0xe6')][_0xd0db('0x120')](db[_0xd0db('0x6d')],{'through':_0xd0db('0x193'),'as':_0xd0db('0x12f')});db[_0xd0db('0xe6')][_0xd0db('0x120')](db[_0xd0db('0x130')],{'through':_0xd0db('0x1d0'),'as':_0xd0db('0x1d1')});db[_0xd0db('0xe6')]['belongsToMany'](db[_0xd0db('0x5c')],{'through':_0xd0db('0x1d2'),'as':_0xd0db('0x131')});db[_0xd0db('0xe6')][_0xd0db('0x120')](db[_0xd0db('0x64')],{'through':_0xd0db('0x18c'),'as':_0xd0db('0x132')});db[_0xd0db('0xe6')][_0xd0db('0x120')](db['WhatsappQueue'],{'through':_0xd0db('0x1d3'),'as':_0xd0db('0x135')});db[_0xd0db('0xe6')][_0xd0db('0x120')](db[_0xd0db('0x12c')],{'through':'TeamVoicePrefix','as':_0xd0db('0x12d')});db[_0xd0db('0xe9')]['hasMany'](db[_0xd0db('0x77')],{'as':_0xd0db('0x14c'),'foreignKey':_0xd0db('0x19d')});db['Campaign']['hasMany'](db[_0xd0db('0x115')],{'as':_0xd0db('0x116'),'foreignKey':_0xd0db('0x19d')});db['Campaign'][_0xd0db('0x112')](db[_0xd0db('0x79')],{'as':'HopperHistories','foreignKey':_0xd0db('0x19d')});db[_0xd0db('0xe9')][_0xd0db('0x112')](db[_0xd0db('0x14e')],{'as':'HopperBlacks','foreignKey':_0xd0db('0x19d')});db[_0xd0db('0xe9')][_0xd0db('0x11e')](db['Trunk'],{'as':_0xd0db('0x2f'),'foreignKey':_0xd0db('0x150')});db[_0xd0db('0xe9')][_0xd0db('0x11e')](db['Trunk'],{'as':_0xd0db('0x151'),'foreignKey':'TrunkBackupId'});db[_0xd0db('0xe9')][_0xd0db('0x11e')](db[_0xd0db('0x82')],{'as':_0xd0db('0x82'),'foreignKey':_0xd0db('0x153')});db[_0xd0db('0xe9')][_0xd0db('0x11e')](db[_0xd0db('0xe3')],{'as':_0xd0db('0xe3'),'foreignKey':_0xd0db('0x1d4')});db['Campaign'][_0xd0db('0x120')](db[_0xd0db('0xf8')],{'as':_0xd0db('0x155'),'through':_0xd0db('0x1d5')});db[_0xd0db('0xe9')]['belongsToMany'](db[_0xd0db('0xf8')],{'as':_0xd0db('0x157'),'through':_0xd0db('0x1d6')});db['Attachment']['belongsTo'](db[_0xd0db('0x6b')],{'as':_0xd0db('0x6b'),'foreignKey':_0xd0db('0x175')});db[_0xd0db('0x1d7')][_0xd0db('0x11e')](db[_0xd0db('0x47')],{});db['MailTransferReport']['belongsTo'](db['MailInteraction'],{});db[_0xd0db('0x1d7')][_0xd0db('0x11e')](db[_0xd0db('0x160')],{'foreignKey':_0xd0db('0x1d8'),'as':_0xd0db('0x1d9')});db[_0xd0db('0x1d7')]['belongsTo'](db['User'],{'foreignKey':_0xd0db('0x1da'),'as':_0xd0db('0x1db')});db[_0xd0db('0x1d7')][_0xd0db('0x11e')](db['User'],{'foreignKey':_0xd0db('0x1dc'),'as':'ToAgent'});db[_0xd0db('0x1d7')][_0xd0db('0x11e')](db[_0xd0db('0x41')],{'foreignKey':_0xd0db('0x1dd'),'as':_0xd0db('0x1de')});db[_0xd0db('0x1d7')][_0xd0db('0x11e')](db[_0xd0db('0x160')],{'foreignKey':_0xd0db('0x1df'),'as':_0xd0db('0x1e0')});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db['ChatMessage'],{});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db[_0xd0db('0x67')],{});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'foreignKey':'FromChatWebsiteId','as':_0xd0db('0x1d9')});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1dc'),'as':_0xd0db('0x1e1')});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db['ChatQueue'],{'foreignKey':_0xd0db('0x1e2'),'as':'ToQueue'});db[_0xd0db('0xf0')][_0xd0db('0x11e')](db[_0xd0db('0x138')],{'foreignKey':_0xd0db('0x1e3'),'as':_0xd0db('0x1e0')});db[_0xd0db('0xf2')]['belongsTo'](db[_0xd0db('0x52')],{});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db[_0xd0db('0x119')],{});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0xd0db('0x1d9')});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db['User'],{'foreignKey':'FromUserId','as':_0xd0db('0x1db')});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1dc'),'as':_0xd0db('0x1e1')});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db['FaxQueue'],{'foreignKey':_0xd0db('0x1e4'),'as':_0xd0db('0x1de')});db[_0xd0db('0xf2')][_0xd0db('0x11e')](db['FaxAccount'],{'foreignKey':_0xd0db('0x1e5'),'as':_0xd0db('0x1e0')});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db['OpenchannelMessage'],{});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db[_0xd0db('0x62')],{});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db['OpenchannelAccount'],{'foreignKey':_0xd0db('0x1e6'),'as':_0xd0db('0x1d9')});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':'FromUserId','as':_0xd0db('0x1db')});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1dc'),'as':_0xd0db('0x1e1')});db[_0xd0db('0xf4')][_0xd0db('0x11e')](db[_0xd0db('0x64')],{'foreignKey':_0xd0db('0x1e7'),'as':_0xd0db('0x1de')});db[_0xd0db('0xf4')]['belongsTo'](db[_0xd0db('0x5e')],{'foreignKey':_0xd0db('0x1e8'),'as':'ToAccount'});db[_0xd0db('0xf6')]['belongsTo'](db[_0xd0db('0x5b')],{});db['SmsTransferReport'][_0xd0db('0x11e')](db[_0xd0db('0x59')],{});db['SmsTransferReport'][_0xd0db('0x11e')](db[_0xd0db('0x57')],{'foreignKey':_0xd0db('0x1e9'),'as':_0xd0db('0x1d9')});db[_0xd0db('0xf6')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':'FromUserId','as':_0xd0db('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1dc'),'as':'ToAgent'});db[_0xd0db('0xf6')][_0xd0db('0x11e')](db[_0xd0db('0x5c')],{'foreignKey':_0xd0db('0x1ea'),'as':_0xd0db('0x1de')});db[_0xd0db('0xf6')][_0xd0db('0x11e')](db[_0xd0db('0x57')],{'foreignKey':_0xd0db('0x1eb'),'as':_0xd0db('0x1e0')});db[_0xd0db('0xf8')][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':_0xd0db('0x163'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xd0db('0xf8')][_0xd0db('0x112')](db[_0xd0db('0x1ec')],{'as':_0xd0db('0x1ed'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0xf8')][_0xd0db('0x112')](db[_0xd0db('0x75')],{'as':_0xd0db('0x122'),'onDelete':'cascade','foreignKey':_0xd0db('0x178')});db[_0xd0db('0xf8')][_0xd0db('0x112')](db[_0xd0db('0x115')],{'as':_0xd0db('0x116'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0xf8')]['hasMany'](db[_0xd0db('0x79')],{'as':'HopperHistory','foreignKey':_0xd0db('0x178')});db[_0xd0db('0xf8')][_0xd0db('0x112')](db['ReportAgentPreview'],{'as':_0xd0db('0x7a'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0xf8')][_0xd0db('0x120')](db['VoiceQueue'],{'as':_0xd0db('0x1ee'),'through':_0xd0db('0x1ef')});db[_0xd0db('0xf8')]['belongsToMany'](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x124')});db[_0xd0db('0x12c')][_0xd0db('0x112')](db[_0xd0db('0x19')],{'as':'Extensions','onDelete':'cascade'});db[_0xd0db('0x12c')]['belongsToMany'](db[_0xd0db('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db['VoicePrefix'][_0xd0db('0x120')](db[_0xd0db('0xe6')],{'through':_0xd0db('0x10c'),'as':'Teams'});db['UserProfile'][_0xd0db('0x112')](db[_0xd0db('0x13')],{'as':_0xd0db('0x171'),'foreignKey':_0xd0db('0x11f')});db[_0xd0db('0xf9')][_0xd0db('0x112')](db[_0xd0db('0xfb')],{'as':_0xd0db('0x1f0'),'foreignKey':_0xd0db('0x11f'),'onDelete':_0xd0db('0x110')});db[_0xd0db('0xfb')][_0xd0db('0x112')](db[_0xd0db('0xfd')],{'as':_0xd0db('0x1f1'),'foreignKey':'sectionId','onDelete':_0xd0db('0x110')});db[_0xd0db('0x100')][_0xd0db('0x112')](db[_0xd0db('0x80')],{'as':_0xd0db('0x163'),'foreignKey':'WhatsappAccountId','onDelete':_0xd0db('0x110')});db[_0xd0db('0x100')]['hasMany'](db[_0xd0db('0x7e')],{'as':_0xd0db('0x180'),'foreignKey':'WhatsappAccountId'});db[_0xd0db('0x100')][_0xd0db('0x112')](db[_0xd0db('0x105')],{'as':'Messages','foreignKey':_0xd0db('0x1f2')});db['WhatsappAccount'][_0xd0db('0x112')](db[_0xd0db('0x103')],{'as':_0xd0db('0x164')});db[_0xd0db('0x100')][_0xd0db('0x112')](db['WhatsappApplication'],{'as':_0xd0db('0x148')});db['WhatsappAccount']['belongsTo'](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0x100')][_0xd0db('0x11e')](db[_0xd0db('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0xd0db('0x154')});db[_0xd0db('0x100')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x142')});db[_0xd0db('0x1f3')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'onDelete':'restrict'});db[_0xd0db('0x1f3')][_0xd0db('0x11e')](db[_0xd0db('0x134')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xd0db('0x11e')](db[_0xd0db('0x100')],{'onDelete':_0xd0db('0x176')});db[_0xd0db('0x1f3')][_0xd0db('0x11e')](db[_0xd0db('0x82')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x153')});db[_0xd0db('0x1f3')][_0xd0db('0x11e')](db[_0xd0db('0x8c')],{'onDelete':_0xd0db('0x176'),'foreignKey':_0xd0db('0x177')});db[_0xd0db('0x103')]['hasMany'](db[_0xd0db('0x105')],{'as':_0xd0db('0x159'),'onDelete':_0xd0db('0x110'),'foreignKey':_0xd0db('0x1f4')});db[_0xd0db('0x103')]['belongsTo'](db['WhatsappAccount'],{'as':_0xd0db('0x16c'),'foreignKey':_0xd0db('0x1f2')});db[_0xd0db('0x103')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db[_0xd0db('0x103')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xd0db('0x111')});db[_0xd0db('0x103')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x1b2'),'as':_0xd0db('0x16e')});db[_0xd0db('0x103')][_0xd0db('0x120')](db[_0xd0db('0x8c')],{'through':_0xd0db('0x1b2'),'as':_0xd0db('0x170')});db[_0xd0db('0x103')][_0xd0db('0x120')](db[_0xd0db('0x13')],{'as':_0xd0db('0x171'),'through':'user_has_whatsapp_interactions','foreignKey':_0xd0db('0x1f4')});db['WhatsappMessage'][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'as':_0xd0db('0x13')});db[_0xd0db('0x105')]['belongsTo'](db[_0xd0db('0x75')],{'onDelete':'cascade','as':'Contact'});db[_0xd0db('0x105')][_0xd0db('0x11e')](db[_0xd0db('0x103')],{'onDelete':_0xd0db('0x110'),'as':_0xd0db('0x185'),'foreignKey':_0xd0db('0x1f4')});db[_0xd0db('0x105')]['belongsTo'](db['WhatsappAccount'],{'as':_0xd0db('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x100')],{});db[_0xd0db('0x1f5')]['belongsTo'](db[_0xd0db('0xf8')],{'as':_0xd0db('0x165'),'foreignKey':_0xd0db('0x178')});db[_0xd0db('0x1f5')][_0xd0db('0x11e')](db[_0xd0db('0x75')],{'as':_0xd0db('0x15d'),'foreignKey':_0xd0db('0x15e')});db['WhatsappQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x103')],{});db['WhatsappQueueReport'][_0xd0db('0x11e')](db[_0xd0db('0x134')],{});db[_0xd0db('0x1f5')]['belongsTo'](db['WhatsappMessage'],{});db[_0xd0db('0x1f5')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{});db[_0xd0db('0x107')][_0xd0db('0x11e')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xd0db('0x11e')](db[_0xd0db('0x103')],{});db[_0xd0db('0x107')]['belongsTo'](db[_0xd0db('0x100')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xd0db('0x107')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0xd0db('0x1e0')});db[_0xd0db('0x107')]['belongsTo'](db[_0xd0db('0x134')],{'foreignKey':_0xd0db('0x1f6'),'as':'ToQueue'});db[_0xd0db('0x107')][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1da'),'as':_0xd0db('0x1db')});db['WhatsappTransferReport'][_0xd0db('0x11e')](db[_0xd0db('0x13')],{'foreignKey':_0xd0db('0x1dc'),'as':_0xd0db('0x1e1')});db[_0xd0db('0x134')]['belongsToMany'](db[_0xd0db('0x13')],{'as':_0xd0db('0x156'),'through':_0xd0db('0x136'),'foreignKey':_0xd0db('0x1f7')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':_0xd0db('0x1d3'),'as':'Teams'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x8440=['Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceMailMessage','uniqueid','VoiceCallReport','Contact','ContactId','MailServerIn','MailAccountId','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','MailApplication','Applications','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Disposition','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','Contacts','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','SalesforceAccount','Configurations','SalesforceConfiguration','SalesforceField','Descriptions','AccountId','Subject','SubjectId','DescriptionId','Field','VariableId','Subjects','FieldId','Description','DeskAccount','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowField','ChatQueueReport','ToId','SessionId','ProjectId','JscriptyProject','user_has_teams','team_has_chat_queues','OpenchannelQueues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','FromOpenchannelAccountId','ToUserId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSection','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','name','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','Schedule','../api/sound/sound.model','Tag','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','Team','License','../api/license/license.model','Campaign','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsite','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId'];(function(_0x1cfd39,_0x32af2a){var _0xa6f397=function(_0x14dd56){while(--_0x14dd56){_0x1cfd39['push'](_0x1cfd39['shift']());}};_0xa6f397(++_0x32af2a);}(_0x8440,0xa4));var _0x0844=function(_0x4c74c9,_0x479774){_0x4c74c9=_0x4c74c9-0x0;var _0x10a36f=_0x8440[_0x4c74c9];return _0x10a36f;};'use strict';var config=require(_0x0844('0x0'));var Sequelize=require('sequelize');var _=require(_0x0844('0x1'));var jstz=require(_0x0844('0x2'));var timezone=jstz[_0x0844('0x3')]();config[_0x0844('0x4')]=_[_0x0844('0x5')](config[_0x0844('0x4')],{'database':_0x0844('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x0844('0x7'),'port':0xcea,'dialect':_0x0844('0x8'),'dialectOptions':{'charset':_0x0844('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x0844('0xa'),'collate':_0x0844('0xb')}}});config[_0x0844('0xc')]=_[_0x0844('0x5')](config['sequelizeHistory'],{'database':'motion2','username':_0x0844('0xd'),'password':_0x0844('0xe'),'options':{'host':_0x0844('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0844('0x9')},'logging':![],'timezone':timezone[_0x0844('0xf')](),'define':{'charset':_0x0844('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0844('0x4')][_0x0844('0x10')],config['sequelize'][_0x0844('0x11')],config[_0x0844('0x4')][_0x0844('0x12')],config['sequelize'][_0x0844('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0844('0xc')][_0x0844('0x10')],config[_0x0844('0xc')][_0x0844('0x11')],config['sequelizeHistory'][_0x0844('0x12')],config[_0x0844('0xc')][_0x0844('0x13')])};db[_0x0844('0x14')]=db['sequelize']['import'](_0x0844('0x15'));db[_0x0844('0x16')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x18'));db[_0x0844('0x19')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x1a'));db['VoiceExtension']=db[_0x0844('0x4')]['import']('../api/voiceExtension/voiceExtension.model');db[_0x0844('0x1b')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x1c'));db[_0x0844('0x1d')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x1e'));db[_0x0844('0x1f')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x20'));db['ScreenRecording']=db['sequelize'][_0x0844('0x17')](_0x0844('0x21'));db[_0x0844('0x22')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize'][_0x0844('0x17')](_0x0844('0x23'));db['VoiceCallReport']=db['sequelize'][_0x0844('0x17')](_0x0844('0x24'));db['VoiceDialReport']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x25'));db[_0x0844('0x26')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x0844('0x27')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x28'));db[_0x0844('0x29')]=db[_0x0844('0x4')]['import'](_0x0844('0x2a'));db[_0x0844('0x2b')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x2c'));db[_0x0844('0x2d')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x2e'));db[_0x0844('0x2f')]=db[_0x0844('0x4')]['import'](_0x0844('0x30'));db[_0x0844('0x31')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x32'));db[_0x0844('0x33')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x34'));db[_0x0844('0x35')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x36'));db['UserSmsQueue']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x37'));db[_0x0844('0x38')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x39'));db['UserWhatsappQueue']=db['sequelize']['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/mailServerIn/mailServerIn.model');db[_0x0844('0x3a')]=db[_0x0844('0x4')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x0844('0x3b')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x3c'));db['MailQueue']=db['sequelize'][_0x0844('0x17')]('../api/mailQueue/mailQueue.model');db[_0x0844('0x3d')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x3e'));db['MailInteraction']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x3f'));db[_0x0844('0x40')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x41'));db[_0x0844('0x42')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x43'));db[_0x0844('0x44')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x45'));db['FaxAccount']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x46'));db[_0x0844('0x47')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x48'));db[_0x0844('0x49')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x4a'));db[_0x0844('0x4b')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/faxMessage/faxMessage.model');db[_0x0844('0x4c')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x4d'));db[_0x0844('0x4e')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x4f'));db[_0x0844('0x50')]=db[_0x0844('0x4')]['import'](_0x0844('0x51'));db[_0x0844('0x52')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x53'));db[_0x0844('0x54')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x55'));db[_0x0844('0x56')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x57'));db[_0x0844('0x58')]=db[_0x0844('0x4')]['import'](_0x0844('0x59'));db[_0x0844('0x5a')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x5b'));db[_0x0844('0x5c')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x5d'));db[_0x0844('0x5e')]=db['sequelize'][_0x0844('0x17')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0844('0x5f')]=db[_0x0844('0x4')]['import'](_0x0844('0x60'));db['OpenchannelQueue']=db[_0x0844('0x4')]['import'](_0x0844('0x61'));db['ChatWebsite']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x62'));db[_0x0844('0x63')]=db[_0x0844('0x4')]['import'](_0x0844('0x64'));db[_0x0844('0x65')]=db['sequelize'][_0x0844('0x17')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x66'));db[_0x0844('0x67')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x68'));db[_0x0844('0x69')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x6a'));db[_0x0844('0x6b')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/chatQueue/chatQueue.model');db[_0x0844('0x6c')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x6d'));db['ChatProactiveAction']=db[_0x0844('0x4')]['import'](_0x0844('0x6e'));db[_0x0844('0x6f')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x70'));db[_0x0844('0x71')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x72'));db[_0x0844('0x73')]=db[_0x0844('0x4')]['import'](_0x0844('0x74'));db[_0x0844('0x75')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x0844('0x76')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x0844('0x77')]=db['sequelize']['import'](_0x0844('0x78'));db[_0x0844('0x79')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x7a'));db[_0x0844('0x7b')]=db[_0x0844('0x4')]['import'](_0x0844('0x7c'));db[_0x0844('0x7d')]=db[_0x0844('0x4')]['import'](_0x0844('0x7e'));db[_0x0844('0x7f')]=db[_0x0844('0x4')]['import']('../api/automation/automation.model');db['CannedAnswer']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x80'));db['Disposition']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x81'));db[_0x0844('0x82')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x83'));db[_0x0844('0x84')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x85'));db['Pause']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x86'));db[_0x0844('0x87')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x88'));db['VoiceQueuesLog']=db['sequelize'][_0x0844('0x17')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x0844('0x89')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/schedule/schedule.model');db['Sound']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x8a'));db[_0x0844('0x8b')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/tag/tag.model');db[_0x0844('0x8c')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x8d'));db['Trigger']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x8e'));db[_0x0844('0x8f')]=db['sequelize']['import'](_0x0844('0x90'));db[_0x0844('0x91')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x92'));db[_0x0844('0x93')]=db[_0x0844('0x4')]['import']('../api/integrationReport/integrationReport.model');db[_0x0844('0x94')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x95'));db['AnalyticDefaultReport']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x96'));db[_0x0844('0x97')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x98'));db[_0x0844('0x99')]=db[_0x0844('0x4')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x0844('0x9a')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x9b'));db[_0x0844('0x9c')]=db[_0x0844('0x4')]['import'](_0x0844('0x9d'));db['SalesforceAccount']=db['sequelize'][_0x0844('0x17')](_0x0844('0x9e'));db['SalesforceConfiguration']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x9f'));db['SalesforceField']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0844('0xa0')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xa1'));db[_0x0844('0xa2')]=db['sequelize']['import'](_0x0844('0xa3'));db[_0x0844('0xa4')]=db['sequelize'][_0x0844('0x17')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/intDeskAccount/intDeskAccount.model');db[_0x0844('0xa5')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xa6'));db[_0x0844('0xa7')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xa8'));db['ZohoAccount']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xa9'));db[_0x0844('0xaa')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x0844('0xab')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xac'));db['ZendeskAccount']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xad'));db[_0x0844('0xae')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xaf'));db[_0x0844('0xb0')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xb1'));db[_0x0844('0xb2')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xb3'));db[_0x0844('0xb4')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x0844('0xb5')]=db['sequelize'][_0x0844('0x17')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x0844('0xb6')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xb7'));db[_0x0844('0xb8')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xb9'));db[_0x0844('0xba')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xbb'));db[_0x0844('0xbc')]=db['sequelize'][_0x0844('0x17')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x0844('0xbd')]=db[_0x0844('0x4')]['import'](_0x0844('0xbe'));db['ServicenowField']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xbf'));db[_0x0844('0xc0')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xc1'));db[_0x0844('0xc2')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xc3'));db[_0x0844('0xc4')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xc5'));db[_0x0844('0xc6')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xc7'));db[_0x0844('0xc8')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x0844('0xc9')]=db[_0x0844('0x4')]['import'](_0x0844('0xca'));db[_0x0844('0x91')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x92'));db[_0x0844('0xcb')]=db[_0x0844('0x4')]['import'](_0x0844('0xcc'));db['ChatQueueReport']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xcd'));db[_0x0844('0xce')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0844('0xcf')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xd0'));db[_0x0844('0xd1')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xd2'));db[_0x0844('0xd3')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xd4'));db[_0x0844('0xd5')]=db[_0x0844('0x4')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x0844('0xd6')]=db['sequelize']['import'](_0x0844('0xd7'));db['SquareDetailsReport']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xd8'));db['JscriptyProject']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xd9'));db[_0x0844('0xda')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/setting/setting.model');db[_0x0844('0xdb')]=db[_0x0844('0x4')]['import']('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize']['import'](_0x0844('0xdc'));db['SquareRecording']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xdd'));db[_0x0844('0xde')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/squareMessage/squareMessage.model');db[_0x0844('0xdf')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/team/team.model');db[_0x0844('0xe0')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xe1'));db[_0x0844('0xe2')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/campaign/campaign.model');db[_0x0844('0xe3')]=db['sequelize'][_0x0844('0x17')]('../api/migration/migration.model');db[_0x0844('0xe4')]=db[_0x0844('0x4')]['import'](_0x0844('0xe5'));db[_0x0844('0xe6')]=db['sequelize']['import'](_0x0844('0xe7'));db['MailTransferReport']=db[_0x0844('0x4')]['import'](_0x0844('0xe8'));db[_0x0844('0xe9')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xea'));db[_0x0844('0xeb')]=db[_0x0844('0x4')]['import'](_0x0844('0xec'));db[_0x0844('0xed')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xee'));db[_0x0844('0xef')]=db[_0x0844('0x4')]['import'](_0x0844('0xf0'));db[_0x0844('0xf1')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xf2'));db[_0x0844('0xf3')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xf4'));db[_0x0844('0xf5')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xf6'));db['UserProfileSection']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xf7'));db['UserProfileResource']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xf8'));db['UserNotification']=db['sequelize'][_0x0844('0x17')](_0x0844('0xf9'));db['WhatsappAccount']=db[_0x0844('0x4')][_0x0844('0x17')]('../api/whatsappAccount/whatsappAccount.model');db[_0x0844('0xfa')]=db['sequelize'][_0x0844('0x17')](_0x0844('0xfb'));db[_0x0844('0xfc')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xfd'));db[_0x0844('0xfe')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0xff'));db['WhatsappQueueReport']=db['sequelize'][_0x0844('0x17')](_0x0844('0x100'));db[_0x0844('0x101')]=db[_0x0844('0x4')][_0x0844('0x17')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x0844('0x102')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x103'));db['CloudProvider']=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x104'));db[_0x0844('0x105')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x106'));db[_0x0844('0x107')]=db['sequelize'][_0x0844('0x17')](_0x0844('0x108'));db[_0x0844('0x109')]=db[_0x0844('0x4')][_0x0844('0x17')](_0x0844('0x10a'));db[_0x0844('0x14')][_0x0844('0x10b')](db[_0x0844('0x22')],{'as':'VoiceMail','onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')]['hasMany'](db[_0x0844('0x1f')],{'as':_0x0844('0x10e'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x2d')],{'as':_0x0844('0x110'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x111')],{'as':_0x0844('0x112'),'onDelete':_0x0844('0x10c'),'hooks':!![]});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x76')],{'as':_0x0844('0x113'),'foreignKey':'UserId'});db[_0x0844('0x14')]['hasMany'](db[_0x0844('0x77')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x79')],{'as':_0x0844('0x79'),'foreignKey':'UserId'});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x5e')],{'as':_0x0844('0x114'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')]['hasMany'](db[_0x0844('0x115')],{'as':_0x0844('0x116'),'foreignKey':_0x0844('0x10d')});db['User'][_0x0844('0x10f')](db[_0x0844('0x54')],{'as':_0x0844('0x117'),'foreignKey':_0x0844('0x10d')});db['User']['hasMany'](db[_0x0844('0x49')],{'as':_0x0844('0x118'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')][_0x0844('0x10f')](db[_0x0844('0x119')],{'as':_0x0844('0x11a'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x14')]['hasMany'](db[_0x0844('0xfc')],{'as':_0x0844('0x11b'),'foreignKey':_0x0844('0x10d')});db['User'][_0x0844('0x10f')](db[_0x0844('0x11c')],{'as':_0x0844('0x11d'),'foreignKey':_0x0844('0x11e')});db[_0x0844('0x14')][_0x0844('0x11f')](db[_0x0844('0xf5')],{'as':_0x0844('0xf5'),'foreignKey':_0x0844('0x120')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x6c')],{'as':_0x0844('0x121'),'through':_0x0844('0x122')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x71')],{'as':'Contacts','through':_0x0844('0x124')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0xf1')],{'as':'Lists','through':_0x0844('0x125')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0xdf')],{'through':'user_has_teams'});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x119')],{'as':_0x0844('0x11a'),'through':_0x0844('0x126')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x115')],{'as':_0x0844('0x116'),'through':_0x0844('0x127')});db['User'][_0x0844('0x123')](db[_0x0844('0x49')],{'as':'FaxInteractions','through':_0x0844('0x128')});db['User'][_0x0844('0x123')](db[_0x0844('0x54')],{'as':_0x0844('0x117'),'through':_0x0844('0x129')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x5e')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0x0844('0x123')](db[_0x0844('0xfc')],{'as':'WhatsappInteractions','through':_0x0844('0x12a')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x1d')],{'as':_0x0844('0x12b'),'through':_0x0844('0x2f'),'required':![]});db['User'][_0x0844('0x123')](db[_0x0844('0xf3')],{'as':_0x0844('0x12c'),'through':_0x0844('0x109'),'required':![]});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x12d')],{'as':_0x0844('0x12e'),'through':_0x0844('0x33'),'required':![]});db[_0x0844('0x14')][_0x0844('0x123')](db['ChatQueue'],{'as':_0x0844('0x12f'),'through':_0x0844('0x31'),'required':![],'hooks':!![]});db['User'][_0x0844('0x123')](db[_0x0844('0x4c')],{'as':_0x0844('0x130'),'through':_0x0844('0x35'),'required':![]});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x58')],{'as':_0x0844('0x131'),'through':_0x0844('0x132'),'required':![]});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x133')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db['User']['belongsToMany'](db[_0x0844('0x102')],{'as':_0x0844('0x134'),'through':_0x0844('0x135'),'required':![]});db[_0x0844('0x14')][_0x0844('0x123')](db['CmList'],{'through':_0x0844('0x125')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0xf3')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db['User'][_0x0844('0x123')](db[_0x0844('0x136')],{'as':'ChatWebsites','through':_0x0844('0x137')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x138')],{'as':_0x0844('0x139'),'through':_0x0844('0x13a')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x3b')],{'as':'MailAccounts','through':_0x0844('0x13b')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x5a')],{'as':'OpenchannelAccounts','through':_0x0844('0x13c')});db[_0x0844('0x14')][_0x0844('0x123')](db[_0x0844('0x50')],{'as':_0x0844('0x13d'),'through':_0x0844('0x13e')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x13f')],{'as':_0x0844('0x140'),'through':_0x0844('0x141')});db[_0x0844('0x14')]['belongsToMany'](db[_0x0844('0x142')],{'as':_0x0844('0x143'),'through':_0x0844('0x144')});db[_0x0844('0x16')][_0x0844('0x10f')](db['VoiceExtension'],{'as':_0x0844('0x145'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x146')});db[_0x0844('0x19')]['hasMany'](db[_0x0844('0x111')],{'onDelete':_0x0844('0x10c')});db['VoiceExtension'][_0x0844('0x10f')](db[_0x0844('0x111')],{'as':'Applications','onDelete':_0x0844('0x10c')});db[_0x0844('0x1b')][_0x0844('0x123')](db[_0x0844('0x147')],{'as':_0x0844('0x148'),'through':_0x0844('0x149')});db[_0x0844('0x1d')][_0x0844('0x10f')](db[_0x0844('0x2d')],{'as':_0x0844('0x14a'),'foreignKey':_0x0844('0x14b')});db['VoiceQueue'][_0x0844('0x10f')](db['CmHopper'],{'as':_0x0844('0x14c'),'foreignKey':_0x0844('0x14b')});db[_0x0844('0x1d')]['hasMany'](db['CmHopperFinal'],{'as':_0x0844('0x113'),'foreignKey':'VoiceQueueId'});db[_0x0844('0x1d')][_0x0844('0x10f')](db[_0x0844('0x77')],{'as':_0x0844('0x14d'),'foreignKey':_0x0844('0x14b')});db[_0x0844('0x1d')]['hasMany'](db[_0x0844('0x79')],{'as':_0x0844('0x79'),'foreignKey':_0x0844('0x14b')});db[_0x0844('0x1d')][_0x0844('0x10f')](db[_0x0844('0x75')],{'as':_0x0844('0x14e'),'foreignKey':_0x0844('0x14b')});db['VoiceQueue'][_0x0844('0x10f')](db[_0x0844('0xd3')],{'as':_0x0844('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x0844('0x1d')][_0x0844('0x11f')](db[_0x0844('0x29')],{'as':_0x0844('0x29'),'foreignKey':_0x0844('0x150')});db[_0x0844('0x1d')][_0x0844('0x11f')](db['Trunk'],{'as':_0x0844('0x151'),'foreignKey':_0x0844('0x152')});db[_0x0844('0x1d')][_0x0844('0x11f')](db['Interval'],{'as':_0x0844('0x84'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x1d')][_0x0844('0x11f')](db[_0x0844('0x154')],{'as':_0x0844('0x155'),'foreignKey':_0x0844('0x156')});db[_0x0844('0x1d')][_0x0844('0x123')](db[_0x0844('0xf1')],{'as':_0x0844('0x157'),'through':_0x0844('0x158')});db[_0x0844('0x1d')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x2f')});db['VoiceQueue'][_0x0844('0x123')](db[_0x0844('0xdf')],{'as':_0x0844('0x15a'),'through':'TeamVoiceQueue'});db[_0x0844('0x1d')][_0x0844('0x123')](db[_0x0844('0xf1')],{'as':_0x0844('0x15b'),'through':_0x0844('0x15c')});db[_0x0844('0x1f')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x15d')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14'),'foreignKey':'UserId'});db['VoiceMail'][_0x0844('0x10f')](db['VoiceMailMessage'],{'as':_0x0844('0x15e'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x15f'),'sourceKey':_0x0844('0x160')});db[_0x0844('0x161')][_0x0844('0x11f')](db[_0x0844('0x22')],{'foreignKey':_0x0844('0x15f'),'targetKey':_0x0844('0x160')});db['VoiceCallReport'][_0x0844('0x10f')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x0844('0x162'),'constraints':![]});db[_0x0844('0x163')][_0x0844('0x10f')](db[_0x0844('0x26')],{'as':'AgentReports','foreignKey':_0x0844('0x162'),'constraints':![]});db[_0x0844('0x163')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14'),'foreignKey':_0x0844('0x10d')});db['VoiceCallReport'][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x166')][_0x0844('0x11f')](db['MailAccount'],{'as':_0x0844('0x3b'),'foreignKey':'MailAccountId'});db[_0x0844('0x3a')]['belongsTo'](db[_0x0844('0x3b')],{'as':_0x0844('0x3b'),'foreignKey':_0x0844('0x167')});db[_0x0844('0x3b')][_0x0844('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0844('0x10c')});db[_0x0844('0x3b')]['hasOne'](db[_0x0844('0x3a')],{'as':'Smtp','onDelete':_0x0844('0x10c')});db[_0x0844('0x3b')][_0x0844('0x10f')](db['Disposition'],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x167'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x3b')][_0x0844('0x10f')](db[_0x0844('0x169')],{'as':_0x0844('0x16a'),'foreignKey':_0x0844('0x167')});db[_0x0844('0x3b')][_0x0844('0x10f')](db[_0x0844('0x16b')],{'as':_0x0844('0x15e'),'foreignKey':_0x0844('0x167')});db[_0x0844('0x3b')][_0x0844('0x10f')](db[_0x0844('0x119')],{'as':_0x0844('0x16c')});db[_0x0844('0x3b')][_0x0844('0x10f')](db[_0x0844('0x16d')],{'as':_0x0844('0x16e')});db[_0x0844('0x3b')][_0x0844('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x0844('0x16f')});db[_0x0844('0x3b')][_0x0844('0x11f')](db[_0x0844('0x8c')],{'as':_0x0844('0x8c'),'foreignKey':_0x0844('0x170')});db[_0x0844('0x3b')][_0x0844('0x11f')](db['Pause'],{'as':_0x0844('0x155'),'foreignKey':_0x0844('0x156')});db[_0x0844('0x3b')][_0x0844('0x123')](db['User'],{'as':_0x0844('0x159'),'through':_0x0844('0x13b')});db[_0x0844('0x12d')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':'Agents','through':_0x0844('0x33')});db[_0x0844('0x12d')][_0x0844('0x123')](db[_0x0844('0xdf')],{'through':_0x0844('0x171'),'as':'Teams'});db[_0x0844('0x119')]['hasMany'](db['MailMessage'],{'as':'Messages','onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x172')});db['MailInteraction'][_0x0844('0x11f')](db[_0x0844('0x3b')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x167')});db[_0x0844('0x119')][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':'Contact','foreignKey':_0x0844('0x165')});db[_0x0844('0x119')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x174'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x119')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x175'),'as':_0x0844('0x176')});db[_0x0844('0x119')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x175'),'as':_0x0844('0x177')});db[_0x0844('0x119')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x178'),'through':'user_has_mail_interactions','foreignKey':_0x0844('0x172')});db[_0x0844('0x16b')]['hasMany'](db['Attachment'],{'as':_0x0844('0x179'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x16b')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14')});db[_0x0844('0x16b')]['belongsTo'](db[_0x0844('0x71')],{'onDelete':'cascade','as':_0x0844('0x164')});db[_0x0844('0x16b')][_0x0844('0x11f')](db['MailInteraction'],{'as':_0x0844('0x17a'),'foreignKey':'MailInteractionId'});db[_0x0844('0x16b')]['belongsTo'](db['MailAccount'],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x167')});db[_0x0844('0x16b')][_0x0844('0x11f')](db[_0x0844('0x136')],{'as':_0x0844('0x136'),'foreignKey':'ChatWebsiteId'});db[_0x0844('0x16b')][_0x0844('0x11f')](db['ChatOfflineMessage'],{'as':_0x0844('0x69'),'foreignKey':_0x0844('0x17b')});db['MailApplication']['belongsTo'](db[_0x0844('0x14')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0x16d')][_0x0844('0x11f')](db['MailQueue'],{'onDelete':_0x0844('0x17c')});db[_0x0844('0x16d')][_0x0844('0x11f')](db[_0x0844('0x3b')],{'onDelete':'restrict'});db[_0x0844('0x16d')][_0x0844('0x11f')](db['Interval'],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x16d')][_0x0844('0x11f')](db[_0x0844('0x8b')],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x17d')});db[_0x0844('0x40')]['belongsTo'](db[_0x0844('0x3b')],{});db[_0x0844('0x40')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':'ListId'});db[_0x0844('0x40')]['belongsTo'](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x40')][_0x0844('0x11f')](db[_0x0844('0x119')],{});db[_0x0844('0x40')][_0x0844('0x11f')](db[_0x0844('0x16b')],{});db[_0x0844('0x40')][_0x0844('0x11f')](db[_0x0844('0x14')],{});db[_0x0844('0x40')][_0x0844('0x11f')](db['MailQueue'],{});db[_0x0844('0x42')][_0x0844('0x10f')](db['DashboardItem'],{'as':_0x0844('0x17f'),'onDelete':_0x0844('0x10c')});db['FaxAccount'][_0x0844('0x10f')](db['Disposition'],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x180'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x138')][_0x0844('0x10f')](db[_0x0844('0x169')],{'as':_0x0844('0x16a'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x0844('0x10f')](db[_0x0844('0x49')],{'as':_0x0844('0x16c')});db['FaxAccount'][_0x0844('0x10f')](db[_0x0844('0x47')],{'as':'Applications'});db[_0x0844('0x138')][_0x0844('0x10f')](db[_0x0844('0x111')],{'as':_0x0844('0x181'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x138')][_0x0844('0x10f')](db[_0x0844('0x4b')],{'as':_0x0844('0x15e')});db[_0x0844('0x138')][_0x0844('0x11f')](db[_0x0844('0x29')],{'as':_0x0844('0x29')});db['FaxAccount'][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':_0x0844('0x16f')});db['FaxAccount'][_0x0844('0x11f')](db['Pause'],{'as':_0x0844('0x155'),'foreignKey':_0x0844('0x156')});db['FaxAccount'][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x13a')});db['FaxApplication'][_0x0844('0x11f')](db[_0x0844('0x14')],{'onDelete':'restrict'});db[_0x0844('0x47')][_0x0844('0x11f')](db[_0x0844('0x4c')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0x47')][_0x0844('0x11f')](db[_0x0844('0x138')],{'onDelete':_0x0844('0x17c')});db['FaxApplication'][_0x0844('0x11f')](db[_0x0844('0x8b')],{'onDelete':'restrict','foreignKey':_0x0844('0x17d')});db['FaxInteraction'][_0x0844('0x10f')](db['FaxMessage'],{'as':_0x0844('0x15e'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x182')});db[_0x0844('0x49')]['belongsTo'](db[_0x0844('0x138')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x180')});db['FaxInteraction'][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x49')]['belongsTo'](db['User'],{'as':_0x0844('0x174'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x49')]['belongsToMany'](db[_0x0844('0x8b')],{'through':_0x0844('0x183'),'as':_0x0844('0x176')});db[_0x0844('0x49')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x183'),'as':'ThroughTags'});db[_0x0844('0x49')]['belongsToMany'](db['User'],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x0844('0x4b')]['belongsTo'](db['User'],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x14')});db['FaxMessage'][_0x0844('0x11f')](db[_0x0844('0x49')],{'as':_0x0844('0x17a'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x0844('0x11f')](db[_0x0844('0x71')],{'onDelete':_0x0844('0x10c'),'as':'Contact'});db[_0x0844('0x4b')][_0x0844('0x11f')](db[_0x0844('0xe4')],{'as':_0x0844('0xe4'),'foreignKey':'AttachmentId'});db[_0x0844('0x4b')]['belongsTo'](db[_0x0844('0x138')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxQueue']['belongsToMany'](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x35')});db[_0x0844('0x4c')]['belongsToMany'](db[_0x0844('0xdf')],{'through':_0x0844('0x184'),'as':_0x0844('0x15a')});db[_0x0844('0x4e')]['belongsTo'](db[_0x0844('0x138')],{});db[_0x0844('0x4e')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':'ListId'});db[_0x0844('0x4e')][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x4e')][_0x0844('0x11f')](db['FaxInteraction'],{});db[_0x0844('0x4e')][_0x0844('0x11f')](db['FaxMessage'],{});db[_0x0844('0x4e')]['belongsTo'](db[_0x0844('0x14')],{});db[_0x0844('0x4e')][_0x0844('0x11f')](db[_0x0844('0x4c')],{});db['SmsAccount'][_0x0844('0x10f')](db['Disposition'],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x185'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x50')][_0x0844('0x10f')](db['CannedAnswer'],{'as':_0x0844('0x16a'),'foreignKey':_0x0844('0x185')});db[_0x0844('0x50')][_0x0844('0x10f')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x0844('0x185')});db[_0x0844('0x50')]['hasMany'](db[_0x0844('0x54')],{'as':_0x0844('0x16c')});db['SmsAccount'][_0x0844('0x10f')](db[_0x0844('0x52')],{'as':'Applications'});db[_0x0844('0x50')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':'List','foreignKey':_0x0844('0x16f')});db[_0x0844('0x50')][_0x0844('0x11f')](db[_0x0844('0x154')],{'as':_0x0844('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x13e')});db[_0x0844('0x52')][_0x0844('0x11f')](db[_0x0844('0x14')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0x52')]['belongsTo'](db[_0x0844('0x58')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0x52')][_0x0844('0x11f')](db[_0x0844('0x50')],{'onDelete':_0x0844('0x17c')});db['SmsApplication']['belongsTo'](db[_0x0844('0x84')],{'onDelete':'restrict','foreignKey':_0x0844('0x153')});db[_0x0844('0x52')][_0x0844('0x11f')](db[_0x0844('0x8b')],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x17d')});db[_0x0844('0x54')]['hasMany'](db[_0x0844('0x56')],{'as':_0x0844('0x15e'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x186')});db[_0x0844('0x54')][_0x0844('0x11f')](db[_0x0844('0x50')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x185')});db['SmsInteraction'][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x54')][_0x0844('0x11f')](db['User'],{'as':'Owner','foreignKey':_0x0844('0x10d')});db['SmsInteraction'][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x187'),'as':_0x0844('0x176')});db[_0x0844('0x54')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x187'),'as':_0x0844('0x177')});db[_0x0844('0x54')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x178'),'through':_0x0844('0x129'),'foreignKey':_0x0844('0x186')});db[_0x0844('0x56')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14')});db[_0x0844('0x56')][_0x0844('0x11f')](db[_0x0844('0x71')],{'onDelete':'cascade','as':_0x0844('0x164')});db['SmsMessage'][_0x0844('0x11f')](db[_0x0844('0x54')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x17a'),'foreignKey':_0x0844('0x186')});db[_0x0844('0x56')][_0x0844('0x11f')](db['SmsAccount'],{'as':_0x0844('0x173'),'foreignKey':'SmsAccountId'});db[_0x0844('0x58')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x132'),'foreignKey':_0x0844('0x188')});db['SmsQueue'][_0x0844('0x123')](db[_0x0844('0xdf')],{'through':_0x0844('0x189'),'as':_0x0844('0x15a')});db[_0x0844('0x5a')][_0x0844('0x10f')](db[_0x0844('0x18a')],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x18b'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x5a')][_0x0844('0x10f')](db[_0x0844('0x169')],{'as':_0x0844('0x16a'),'foreignKey':_0x0844('0x18b')});db[_0x0844('0x5a')]['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x0844('0x18b')});db[_0x0844('0x5a')]['hasMany'](db[_0x0844('0x5f')],{'as':_0x0844('0x15e'),'foreignKey':_0x0844('0x18b')});db[_0x0844('0x5a')][_0x0844('0x10f')](db[_0x0844('0x5c')],{'as':_0x0844('0x16e'),'foreignKey':_0x0844('0x18b')});db[_0x0844('0x5a')][_0x0844('0x11f')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount'][_0x0844('0x11f')](db['Pause'],{'as':_0x0844('0x155'),'foreignKey':_0x0844('0x156')});db[_0x0844('0x5a')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x13c')});db[_0x0844('0x5c')][_0x0844('0x11f')](db[_0x0844('0x14')],{'onDelete':'restrict'});db[_0x0844('0x5c')][_0x0844('0x11f')](db[_0x0844('0x133')],{'onDelete':'restrict','foreignKey':_0x0844('0x18c')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x18b')});db[_0x0844('0x5c')][_0x0844('0x11f')](db[_0x0844('0x84')],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x5c')][_0x0844('0x11f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x0844('0x17d')});db[_0x0844('0x5e')][_0x0844('0x10f')](db[_0x0844('0x5f')],{'as':_0x0844('0x15e'),'onDelete':'cascade','foreignKey':_0x0844('0x18d')});db[_0x0844('0x5e')][_0x0844('0x11f')](db[_0x0844('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x0844('0x5e')]['belongsTo'](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x5e')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':'Owner','foreignKey':_0x0844('0x10d')});db[_0x0844('0x5e')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x18e'),'as':_0x0844('0x176')});db['OpenchannelInteraction'][_0x0844('0x123')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0844('0x177')});db[_0x0844('0x5e')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x178'),'through':'user_has_openchannel_interactions','foreignKey':_0x0844('0x18d')});db[_0x0844('0x5f')][_0x0844('0x11f')](db['User'],{'onDelete':_0x0844('0x10c'),'as':'User'});db[_0x0844('0x5f')][_0x0844('0x11f')](db[_0x0844('0x71')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x164')});db[_0x0844('0x5f')][_0x0844('0x11f')](db[_0x0844('0x5e')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x17a'),'foreignKey':_0x0844('0x18d')});db[_0x0844('0x5f')]['belongsTo'](db[_0x0844('0xe4')],{'as':_0x0844('0xe4'),'foreignKey':_0x0844('0x18f')});db[_0x0844('0x5f')]['belongsTo'](db[_0x0844('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x0844('0x133')][_0x0844('0x123')](db['User'],{'as':_0x0844('0x159'),'through':'UserOpenchannelQueue','foreignKey':_0x0844('0x18c')});db['OpenchannelQueue'][_0x0844('0x123')](db['Team'],{'through':_0x0844('0x190'),'as':_0x0844('0x15a')});db['ChatWebsite'][_0x0844('0x10f')](db['Disposition'],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x191'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x136')][_0x0844('0x10f')](db[_0x0844('0x169')],{'as':'Answers','foreignKey':_0x0844('0x191')});db['ChatWebsite'][_0x0844('0x10f')](db[_0x0844('0x192')],{'as':_0x0844('0x193')});db[_0x0844('0x136')][_0x0844('0x10f')](db[_0x0844('0x115')],{'as':'Interactions'});db[_0x0844('0x136')]['hasMany'](db[_0x0844('0x65')],{'as':_0x0844('0x16e')});db[_0x0844('0x136')]['hasMany'](db[_0x0844('0x67')],{'as':'Messages'});db[_0x0844('0x136')][_0x0844('0x11f')](db['CmList'],{'as':_0x0844('0x17e'),'foreignKey':'ListId'});db[_0x0844('0x136')][_0x0844('0x11f')](db[_0x0844('0x84')],{'as':'Interval','foreignKey':_0x0844('0x153')});db[_0x0844('0x136')]['belongsTo'](db[_0x0844('0x3b')],{'as':_0x0844('0x3b'),'foreignKey':'MailAccountId'});db[_0x0844('0x136')]['belongsTo'](db['Pause'],{'as':_0x0844('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0844('0x136')]['belongsToMany'](db[_0x0844('0x14')],{'as':'Agents','through':_0x0844('0x137')});db[_0x0844('0x63')][_0x0844('0x11f')](db[_0x0844('0x5a')],{});db[_0x0844('0x63')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':'ListId'});db[_0x0844('0x63')][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x63')][_0x0844('0x11f')](db[_0x0844('0x5e')],{});db[_0x0844('0x63')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x0844('0x63')][_0x0844('0x11f')](db[_0x0844('0x14')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x0844('0x133')],{});db[_0x0844('0x65')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x194'),'foreignKey':_0x0844('0x10d'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x65')][_0x0844('0x11f')](db[_0x0844('0x6b')],{'as':_0x0844('0x195'),'foreignKey':_0x0844('0x196'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x65')][_0x0844('0x11f')](db[_0x0844('0x136')],{'as':_0x0844('0x197'),'foreignKey':_0x0844('0x191'),'onDelete':'restrict'});db[_0x0844('0x65')]['belongsTo'](db[_0x0844('0x8b')],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x17d')});db[_0x0844('0x115')][_0x0844('0x10f')](db[_0x0844('0x67')],{'as':'Messages','onDelete':_0x0844('0x10c'),'foreignKey':'ChatInteractionId'});db[_0x0844('0x115')]['belongsTo'](db[_0x0844('0x136')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x191')});db[_0x0844('0x115')][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x115')]['belongsTo'](db[_0x0844('0x14')],{'as':'Owner','foreignKey':_0x0844('0x10d')});db[_0x0844('0x115')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x198'),'as':_0x0844('0x176')});db['ChatInteraction'][_0x0844('0x123')](db['Tag'],{'through':_0x0844('0x198'),'as':'ThroughTags'});db['ChatInteraction']['belongsToMany'](db['User'],{'as':_0x0844('0x178'),'through':_0x0844('0x127'),'foreignKey':'ChatInteractionId'});db[_0x0844('0x67')][_0x0844('0x11f')](db['User'],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x14')});db[_0x0844('0x67')][_0x0844('0x11f')](db['CmContact'],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x164'),'foreignKey':'ContactId'});db['ChatMessage'][_0x0844('0x11f')](db[_0x0844('0x115')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x17a'),'foreignKey':_0x0844('0x199')});db['ChatMessage'][_0x0844('0x11f')](db[_0x0844('0xe4')],{'as':_0x0844('0xe4'),'foreignKey':_0x0844('0x18f')});db['ChatMessage']['belongsTo'](db[_0x0844('0x136')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x191')});db[_0x0844('0x69')][_0x0844('0x10f')](db[_0x0844('0xe4')],{'as':_0x0844('0x179'),'foreignKey':_0x0844('0x17b'),'onDelete':'cascade','hooks':!![]});db[_0x0844('0x69')][_0x0844('0x11f')](db[_0x0844('0x71')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db['ChatOfflineMessage'][_0x0844('0x11f')](db[_0x0844('0x136')],{'as':'Account','foreignKey':_0x0844('0x191')});db[_0x0844('0x6b')][_0x0844('0x123')](db['User'],{'as':_0x0844('0x159'),'through':_0x0844('0x31'),'hooks':!![]});db[_0x0844('0x6b')][_0x0844('0x123')](db[_0x0844('0xdf')],{'through':'team_has_chat_queues','as':_0x0844('0x15a')});db[_0x0844('0x6c')][_0x0844('0x10f')](db[_0x0844('0xce')],{'as':'Messages','foreignKey':_0x0844('0x19a'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x6c')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x14a'),'through':_0x0844('0x122')});db[_0x0844('0x192')][_0x0844('0x11f')](db[_0x0844('0x136')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x0844('0x6f')]['hasMany'](db['CmContact'],{'as':_0x0844('0x19b'),'foreignKey':_0x0844('0x19c')});db[_0x0844('0x71')][_0x0844('0x10f')](db['CmHopper'],{'as':_0x0844('0x14c'),'foreignKey':_0x0844('0x165')});db['CmContact'][_0x0844('0x10f')](db[_0x0844('0x76')],{'as':_0x0844('0x113'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x71')][_0x0844('0x10f')](db[_0x0844('0x77')],{'as':'HopperHistories','foreignKey':_0x0844('0x165')});db['CmContact'][_0x0844('0x10f')](db[_0x0844('0x79')],{'as':_0x0844('0x79'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x71')][_0x0844('0x10f')](db[_0x0844('0xd3')],{'as':_0x0844('0x14f'),'foreignKey':_0x0844('0x165')});db[_0x0844('0x71')][_0x0844('0x10f')](db[_0x0844('0x5e')],{'as':_0x0844('0x114'),'foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x71')][_0x0844('0x10f')](db['ChatInteraction'],{'as':_0x0844('0x116'),'foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x71')][_0x0844('0x10f')](db[_0x0844('0x54')],{'as':'SmsInteractions','foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x71')][_0x0844('0x10f')](db[_0x0844('0x49')],{'as':_0x0844('0x118'),'foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x71')]['hasMany'](db[_0x0844('0x119')],{'as':_0x0844('0x11a'),'foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x71')]['belongsTo'](db[_0x0844('0x6f')],{'as':_0x0844('0x19d'),'foreignKey':'CompanyId'});db['CmContact'][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':_0x0844('0x16f'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x71')][_0x0844('0x123')](db['User'],{'as':_0x0844('0x178'),'through':_0x0844('0x124')});db[_0x0844('0x71')][_0x0844('0x123')](db['Tag'],{'as':_0x0844('0x176'),'through':_0x0844('0x19e')});db['CmContact'][_0x0844('0x123')](db['Tag'],{'through':_0x0844('0x19e'),'as':'ThroughTags'});db[_0x0844('0x73')][_0x0844('0x11f')](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165'),'onDelete':'cascade'});db[_0x0844('0x73')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':'ListId','onDelete':_0x0844('0x10c')});db[_0x0844('0x73')]['belongsTo'](db['User'],{'as':_0x0844('0x194'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0x73')]['belongsTo'](db['VoiceQueue'],{'as':_0x0844('0x195'),'foreignKey':_0x0844('0x14b'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x73')][_0x0844('0x11f')](db['Campaign'],{'as':_0x0844('0xe2'),'foreignKey':_0x0844('0x19f'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x73')][_0x0844('0x11f')](db['User'],{'as':_0x0844('0x174'),'foreignKey':_0x0844('0x1a0')});db[_0x0844('0x75')]['belongsTo'](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165'),'onDelete':_0x0844('0x10c')});db['CmHopperBlack']['belongsTo'](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':_0x0844('0x16f'),'onDelete':_0x0844('0x10c')});db['CmHopperBlack'][_0x0844('0x11f')](db[_0x0844('0x1d')],{'as':_0x0844('0x195'),'foreignKey':'VoiceQueueId','onDelete':_0x0844('0x10c')});db[_0x0844('0x75')][_0x0844('0x11f')](db[_0x0844('0xe2')],{'as':_0x0844('0xe2'),'foreignKey':'CampaignId','onDelete':_0x0844('0x10c')});db[_0x0844('0x7f')][_0x0844('0x10f')](db['Condition'],{'as':{'plural':'All','singular':_0x0844('0x1a1')},'foreignKey':'AutomationAllId','onDelete':_0x0844('0x10c'),'hooks':!![]});db[_0x0844('0x7f')][_0x0844('0x10f')](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x0844('0x1a2'),'onDelete':_0x0844('0x10c'),'hooks':!![]});db[_0x0844('0x7f')][_0x0844('0x10f')](db[_0x0844('0x7d')],{'as':_0x0844('0x1a3'),'foreignKey':_0x0844('0x1a4'),'onDelete':_0x0844('0x10c'),'hooks':!![]});db['Disposition'][_0x0844('0x10f')](db[_0x0844('0x18a')],{'as':'Dispositions','foreignKey':_0x0844('0x1a5'),'onDelete':_0x0844('0x10c')});db[_0x0844('0x84')][_0x0844('0x10f')](db[_0x0844('0x84')],{'as':'Intervals','foreignKey':_0x0844('0x153'),'onDelete':_0x0844('0x10c'),'hooks':!![],'required':![]});db[_0x0844('0x84')][_0x0844('0x10f')](db[_0x0844('0x111')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x0844('0x17c')});db[_0x0844('0x84')]['hasMany'](db[_0x0844('0x16d')],{'as':_0x0844('0x1a6'),'foreignKey':_0x0844('0x153')});db['Interval'][_0x0844('0x10f')](db[_0x0844('0x65')],{'as':_0x0844('0x1a7'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x84')]['hasMany'](db[_0x0844('0x47')],{'as':_0x0844('0x1a8'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x84')]['hasMany'](db[_0x0844('0x52')],{'as':_0x0844('0x1a9'),'foreignKey':_0x0844('0x153')});db[_0x0844('0x89')][_0x0844('0x11f')](db[_0x0844('0x3b')],{});db[_0x0844('0x89')][_0x0844('0x11f')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0x0844('0x89')]['belongsTo'](db[_0x0844('0x94')],{'foreignKey':_0x0844('0x1aa')});db[_0x0844('0x147')][_0x0844('0x123')](db[_0x0844('0x1b')],{'as':_0x0844('0x1ab'),'through':_0x0844('0x149'),'onDelete':_0x0844('0x17c')});db[_0x0844('0x8b')][_0x0844('0x123')](db['CmContact'],{'through':_0x0844('0x19e')});db[_0x0844('0x8b')][_0x0844('0x123')](db['ChatInteraction'],{'through':_0x0844('0x198')});db[_0x0844('0x8b')][_0x0844('0x123')](db[_0x0844('0x119')],{'through':_0x0844('0x175')});db[_0x0844('0x8b')][_0x0844('0x123')](db[_0x0844('0x54')],{'through':'sms_interaction_has_tags'});db[_0x0844('0x8b')]['belongsToMany'](db['FaxInteraction'],{'through':_0x0844('0x183')});db[_0x0844('0x8b')]['belongsToMany'](db[_0x0844('0x5e')],{'through':_0x0844('0x18e')});db[_0x0844('0x8b')][_0x0844('0x123')](db[_0x0844('0xfc')],{'through':'whatsapp_interaction_has_tags'});db[_0x0844('0x1ac')]['hasMany'](db[_0x0844('0x82')],{'as':{'plural':'AllConditions','singular':_0x0844('0x1ad')},'foreignKey':_0x0844('0x1ae'),'onDelete':_0x0844('0x10c'),'hooks':!![]});db[_0x0844('0x1ac')][_0x0844('0x10f')](db[_0x0844('0x82')],{'as':{'plural':_0x0844('0x1af'),'singular':_0x0844('0x1b0')},'foreignKey':_0x0844('0x1b1'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x0844('0x10f')](db[_0x0844('0x7d')],{'as':'Actions','foreignKey':_0x0844('0x1b2'),'onDelete':_0x0844('0x10c'),'hooks':!![]});db[_0x0844('0x94')]['hasMany'](db[_0x0844('0x9a')],{'as':_0x0844('0x1b3'),'onDelete':_0x0844('0x10c'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0844('0x10f')](db[_0x0844('0x9a')],{'as':_0x0844('0x1b3'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1b4')});db[_0x0844('0x99')][_0x0844('0x10f')](db[_0x0844('0x9a')],{'as':_0x0844('0x1b3'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1b5')});db[_0x0844('0x9a')][_0x0844('0x11f')](db[_0x0844('0x99')],{'foreignKey':'MetricId'});db[_0x0844('0x1b6')][_0x0844('0x10f')](db['SalesforceConfiguration'],{'as':_0x0844('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x0844('0x1b8')][_0x0844('0x10f')](db[_0x0844('0x1b9')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0844('0x1b8')]['hasMany'](db['SalesforceField'],{'as':_0x0844('0x1ba'),'onDelete':_0x0844('0x10c'),'foreignKey':'DescriptionId'});db[_0x0844('0x1b8')][_0x0844('0x10f')](db[_0x0844('0x1b9')],{'as':_0x0844('0x1b3'),'onDelete':_0x0844('0x10c'),'foreignKey':'FieldId'});db[_0x0844('0x1b8')][_0x0844('0x11f')](db['SalesforceAccount'],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x1bb')});db['SalesforceField']['hasMany'](db[_0x0844('0x1b9')],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0x1b9')][_0x0844('0x10f')](db['SalesforceField'],{'as':'Description','foreignKey':_0x0844('0x1be')});db[_0x0844('0x1b9')]['hasMany'](db[_0x0844('0x1b9')],{'as':_0x0844('0x1bf'),'foreignKey':'FieldId'});db[_0x0844('0x1b9')][_0x0844('0x11f')](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xa0')][_0x0844('0x10f')](db[_0x0844('0xa2')],{'as':'Configurations','onDelete':_0x0844('0x10c'),'foreignKey':'AccountId'});db[_0x0844('0xa2')][_0x0844('0x10f')](db[_0x0844('0xa4')],{'as':_0x0844('0x1c1'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xa2')][_0x0844('0x10f')](db[_0x0844('0xa4')],{'as':_0x0844('0x1ba'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xa2')][_0x0844('0x10f')](db[_0x0844('0xa4')],{'as':_0x0844('0x1b3'),'onDelete':'cascade','foreignKey':_0x0844('0x1c2')});db[_0x0844('0xa2')][_0x0844('0x11f')](db[_0x0844('0xa0')],{'as':'Account','foreignKey':_0x0844('0x1bb')});db['SugarcrmField'][_0x0844('0x10f')](db['SugarcrmField'],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xa4')][_0x0844('0x10f')](db[_0x0844('0xa4')],{'as':_0x0844('0x1c3'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xa4')][_0x0844('0x10f')](db[_0x0844('0xa4')],{'as':'Field','foreignKey':'FieldId'});db[_0x0844('0xa4')][_0x0844('0x11f')](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0x1c4')][_0x0844('0x10f')](db[_0x0844('0xa5')],{'as':_0x0844('0x1b7'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0xa5')][_0x0844('0x10f')](db[_0x0844('0xa7')],{'as':_0x0844('0x1c1'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0844('0xa5')][_0x0844('0x10f')](db[_0x0844('0xa7')],{'as':_0x0844('0x1ba'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xa5')]['hasMany'](db[_0x0844('0xa7')],{'as':'Fields','onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xa5')][_0x0844('0x11f')](db[_0x0844('0x1c4')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0xa5')][_0x0844('0x123')](db['Tag'],{'through':_0x0844('0x1c5')});db[_0x0844('0xa7')][_0x0844('0x10f')](db['DeskField'],{'as':_0x0844('0x1bc'),'foreignKey':'SubjectId'});db['DeskField'][_0x0844('0x10f')](db[_0x0844('0xa7')],{'as':'Description','foreignKey':_0x0844('0x1be')});db[_0x0844('0xa7')]['hasMany'](db[_0x0844('0xa7')],{'as':'Field','foreignKey':_0x0844('0x1c2')});db[_0x0844('0xa7')]['belongsTo'](db['Variable'],{'as':_0x0844('0x8f'),'foreignKey':'VariableId'});db[_0x0844('0x1c6')][_0x0844('0x10f')](db[_0x0844('0xaa')],{'as':'Configurations','onDelete':_0x0844('0x10c'),'foreignKey':'AccountId'});db[_0x0844('0xaa')][_0x0844('0x10f')](db[_0x0844('0xab')],{'as':_0x0844('0x1c1'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xaa')][_0x0844('0x10f')](db[_0x0844('0xab')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0844('0x1be')});db['ZohoConfiguration'][_0x0844('0x10f')](db[_0x0844('0xab')],{'as':_0x0844('0x1b3'),'onDelete':'cascade','foreignKey':'FieldId'});db['ZohoConfiguration']['belongsTo'](db[_0x0844('0x1c6')],{'as':_0x0844('0x173'),'foreignKey':'AccountId'});db[_0x0844('0xab')][_0x0844('0x10f')](db['ZohoField'],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xab')][_0x0844('0x10f')](db[_0x0844('0xab')],{'as':_0x0844('0x1c3'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xab')][_0x0844('0x10f')](db[_0x0844('0xab')],{'as':_0x0844('0x1bf'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xab')][_0x0844('0x11f')](db[_0x0844('0x8f')],{'as':'Variable','foreignKey':_0x0844('0x1c0')});db[_0x0844('0x1c7')][_0x0844('0x10f')](db[_0x0844('0xae')],{'as':'Configurations','onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0xae')][_0x0844('0x10f')](db['ZendeskField'],{'as':_0x0844('0x1c1'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x0844('0x10f')](db[_0x0844('0xb0')],{'as':_0x0844('0x1ba'),'foreignKey':_0x0844('0x1be')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x0844('0x1b3'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xae')]['belongsTo'](db['ZendeskAccount'],{'as':_0x0844('0x173'),'foreignKey':'AccountId'});db[_0x0844('0xae')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x1c8')});db['ZendeskField'][_0x0844('0x10f')](db[_0x0844('0xb0')],{'as':_0x0844('0x1bc'),'foreignKey':'SubjectId'});db[_0x0844('0xb0')][_0x0844('0x10f')](db[_0x0844('0xb0')],{'as':'Description','foreignKey':_0x0844('0x1be')});db[_0x0844('0xb0')][_0x0844('0x10f')](db[_0x0844('0xb0')],{'as':'Field','foreignKey':_0x0844('0x1c2')});db['ZendeskField']['belongsTo'](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xb2')]['hasMany'](db[_0x0844('0xb4')],{'as':_0x0844('0x1b7'),'onDelete':_0x0844('0x10c'),'foreignKey':'AccountId'});db[_0x0844('0xb4')][_0x0844('0x10f')](db['FreshdeskField'],{'as':_0x0844('0x1c1'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xb4')]['hasMany'](db[_0x0844('0xb5')],{'as':_0x0844('0x1ba'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xb4')][_0x0844('0x10f')](db[_0x0844('0xb5')],{'as':_0x0844('0x1b3'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xb4')][_0x0844('0x11f')](db[_0x0844('0xb2')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0xb4')][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x1c9')});db[_0x0844('0xb5')][_0x0844('0x10f')](db['FreshdeskField'],{'as':_0x0844('0x1bc'),'foreignKey':'SubjectId'});db[_0x0844('0xb5')]['hasMany'](db[_0x0844('0xb5')],{'as':_0x0844('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0844('0xb5')][_0x0844('0x10f')](db['FreshdeskField'],{'as':_0x0844('0x1bf'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xb5')][_0x0844('0x11f')](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xb6')][_0x0844('0x10f')](db['VtigerConfiguration'],{'as':_0x0844('0x1b7'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0xb8')][_0x0844('0x10f')](db[_0x0844('0xba')],{'as':'Subjects','foreignKey':_0x0844('0x1bd')});db[_0x0844('0xb8')][_0x0844('0x10f')](db[_0x0844('0xba')],{'as':_0x0844('0x1ba'),'foreignKey':'DescriptionId'});db[_0x0844('0xb8')][_0x0844('0x10f')](db[_0x0844('0xba')],{'as':_0x0844('0x1b3'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xb8')][_0x0844('0x11f')](db['VtigerAccount'],{'as':_0x0844('0x173'),'foreignKey':'AccountId'});db[_0x0844('0xba')]['hasMany'](db['VtigerField'],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xba')][_0x0844('0x10f')](db[_0x0844('0xba')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0844('0xba')][_0x0844('0x10f')](db[_0x0844('0xba')],{'as':_0x0844('0x1bf'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xba')][_0x0844('0x11f')](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xbc')]['hasMany'](db[_0x0844('0xbd')],{'as':_0x0844('0x1b7'),'onDelete':_0x0844('0x10c'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x0844('0x10f')](db[_0x0844('0x1ca')],{'as':_0x0844('0x1c1'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xbd')][_0x0844('0x10f')](db[_0x0844('0x1ca')],{'as':'Descriptions','foreignKey':_0x0844('0x1be')});db[_0x0844('0xbd')]['hasMany'](db['ServicenowField'],{'as':_0x0844('0x1b3'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0xbd')][_0x0844('0x11f')](db[_0x0844('0xbc')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x1bb')});db[_0x0844('0x1ca')][_0x0844('0x10f')](db['ServicenowField'],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0x1ca')]['hasMany'](db[_0x0844('0x1ca')],{'as':'Description','foreignKey':_0x0844('0x1be')});db[_0x0844('0x1ca')][_0x0844('0x10f')](db[_0x0844('0x1ca')],{'as':_0x0844('0x1bf'),'foreignKey':_0x0844('0x1c2')});db[_0x0844('0x1ca')]['belongsTo'](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xc0')][_0x0844('0x10f')](db[_0x0844('0xc2')],{'as':_0x0844('0x1b7'),'onDelete':_0x0844('0x10c'),'foreignKey':'AccountId'});db[_0x0844('0xc2')][_0x0844('0x10f')](db[_0x0844('0xc4')],{'as':_0x0844('0x1c1'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xc2')]['hasMany'](db[_0x0844('0xc4')],{'as':_0x0844('0x1ba'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1be')});db[_0x0844('0xc2')][_0x0844('0x10f')](db[_0x0844('0xc4')],{'as':_0x0844('0x1b3'),'onDelete':'cascade','foreignKey':_0x0844('0x1c2')});db[_0x0844('0xc2')][_0x0844('0x11f')](db[_0x0844('0xc0')],{'as':_0x0844('0x173'),'foreignKey':'AccountId'});db[_0x0844('0xc4')][_0x0844('0x10f')](db['Dynamics365Field'],{'as':_0x0844('0x1bc'),'foreignKey':_0x0844('0x1bd')});db[_0x0844('0xc4')]['hasMany'](db[_0x0844('0xc4')],{'as':_0x0844('0x1c3'),'foreignKey':'DescriptionId'});db[_0x0844('0xc4')][_0x0844('0x10f')](db['Dynamics365Field'],{'as':_0x0844('0x1bf'),'foreignKey':'FieldId'});db[_0x0844('0xc4')]['belongsTo'](db[_0x0844('0x8f')],{'as':_0x0844('0x8f'),'foreignKey':_0x0844('0x1c0')});db[_0x0844('0xc6')]['hasMany'](db[_0x0844('0xc8')],{'as':_0x0844('0x1b7'),'onDelete':'cascade','foreignKey':_0x0844('0x1bb')});db['FreshsalesConfiguration'][_0x0844('0x10f')](db[_0x0844('0xc9')],{'as':'Subjects','foreignKey':_0x0844('0x1bd')});db['FreshsalesConfiguration'][_0x0844('0x10f')](db[_0x0844('0xc9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x0844('0xc8')][_0x0844('0x10f')](db[_0x0844('0xc9')],{'as':_0x0844('0x1b3'),'foreignKey':'FieldId'});db[_0x0844('0xc8')]['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x0844('0x1bb')});db[_0x0844('0xc9')][_0x0844('0x10f')](db[_0x0844('0xc9')],{'as':'Subject','foreignKey':_0x0844('0x1bd')});db['FreshsalesField'][_0x0844('0x10f')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x0844('0x1be')});db['FreshsalesField'][_0x0844('0x10f')](db[_0x0844('0xc9')],{'as':_0x0844('0x1bf'),'foreignKey':'FieldId'});db['FreshsalesField'][_0x0844('0x11f')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db[_0x0844('0x136')],{});db[_0x0844('0x1cb')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':'ListId'});db[_0x0844('0x1cb')][_0x0844('0x11f')](db['CmContact'],{'as':_0x0844('0x164'),'foreignKey':'ContactId'});db[_0x0844('0x1cb')][_0x0844('0x11f')](db[_0x0844('0x115')],{});db[_0x0844('0x1cb')]['belongsTo'](db[_0x0844('0x67')],{});db[_0x0844('0x1cb')]['belongsTo'](db[_0x0844('0x14')],{});db['ChatQueueReport'][_0x0844('0x11f')](db[_0x0844('0x6b')],{});db['ChatInternalMessage'][_0x0844('0x11f')](db[_0x0844('0x14')],{'onDelete':'cascade','foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0x0844('0x14')],{'onDelete':'cascade','foreignKey':_0x0844('0x1cc')});db['JscriptySessionReport'][_0x0844('0x10f')](db[_0x0844('0xd1')],{'foreignKey':_0x0844('0x1cd'),'onDelete':_0x0844('0x10c')});db[_0x0844('0xd3')][_0x0844('0x10f')](db[_0x0844('0xcf')],{'foreignKey':_0x0844('0x1cd'),'onDelete':'cascade'});db[_0x0844('0xd5')][_0x0844('0x11f')](db['SmsAccount'],{});db['SmsQueueReport'][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':_0x0844('0x16f')});db[_0x0844('0xd5')]['belongsTo'](db['CmContact'],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db['SmsQueueReport'][_0x0844('0x11f')](db[_0x0844('0x54')],{});db[_0x0844('0xd5')][_0x0844('0x11f')](db['SmsMessage'],{});db[_0x0844('0xd5')]['belongsTo'](db[_0x0844('0x14')],{});db[_0x0844('0xd5')]['belongsTo'](db[_0x0844('0x58')],{});db['JscriptyProject']['hasMany'](db[_0x0844('0xd3')],{'foreignKey':_0x0844('0x1ce')});db['JscriptyProject'][_0x0844('0x10f')](db[_0x0844('0xd1')],{'foreignKey':'ProjectId'});db[_0x0844('0x1cf')]['hasMany'](db[_0x0844('0xcf')],{'foreignKey':_0x0844('0x1ce')});db['SquareProject'][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x178'),'through':_0x0844('0x144')});db[_0x0844('0xdf')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x1d0')});db[_0x0844('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x0844('0x12b')});db['Team'][_0x0844('0x123')](db[_0x0844('0x12d')],{'through':_0x0844('0x171'),'as':'MailQueues'});db[_0x0844('0xdf')]['belongsToMany'](db[_0x0844('0x6b')],{'through':_0x0844('0x1d1'),'as':_0x0844('0x12f')});db[_0x0844('0xdf')][_0x0844('0x123')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x0844('0x130')});db[_0x0844('0xdf')][_0x0844('0x123')](db[_0x0844('0x58')],{'through':_0x0844('0x189'),'as':_0x0844('0x131')});db[_0x0844('0xdf')][_0x0844('0x123')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x0844('0x1d2')});db[_0x0844('0xdf')]['belongsToMany'](db[_0x0844('0x102')],{'through':'team_has_whatsapp_queues','as':_0x0844('0x134')});db[_0x0844('0xdf')]['belongsToMany'](db['VoicePrefix'],{'through':_0x0844('0x107'),'as':_0x0844('0x12c')});db[_0x0844('0xe2')]['hasMany'](db[_0x0844('0x73')],{'as':'Hoppers','foreignKey':_0x0844('0x19f')});db[_0x0844('0xe2')][_0x0844('0x10f')](db[_0x0844('0x76')],{'as':_0x0844('0x113'),'foreignKey':_0x0844('0x19f')});db[_0x0844('0xe2')][_0x0844('0x10f')](db[_0x0844('0x77')],{'as':_0x0844('0x14d'),'foreignKey':_0x0844('0x19f')});db[_0x0844('0xe2')][_0x0844('0x10f')](db[_0x0844('0x75')],{'as':_0x0844('0x14e'),'foreignKey':'CampaignId'});db[_0x0844('0xe2')][_0x0844('0x11f')](db[_0x0844('0x29')],{'as':_0x0844('0x29'),'foreignKey':'TrunkId'});db[_0x0844('0xe2')]['belongsTo'](db[_0x0844('0x29')],{'as':_0x0844('0x151'),'foreignKey':_0x0844('0x152')});db[_0x0844('0xe2')]['belongsTo'](db[_0x0844('0x84')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x0844('0x142')],{'as':_0x0844('0x142'),'foreignKey':'SquareProjectId'});db[_0x0844('0xe2')][_0x0844('0x123')](db['CmList'],{'as':_0x0844('0x157'),'through':_0x0844('0x1d3')});db['Campaign']['belongsToMany'](db[_0x0844('0xf1')],{'as':_0x0844('0x15b'),'through':_0x0844('0x1d4')});db[_0x0844('0xe4')][_0x0844('0x11f')](db['ChatOfflineMessage'],{'as':_0x0844('0x69'),'foreignKey':_0x0844('0x17b')});db['MailTransferReport'][_0x0844('0x11f')](db[_0x0844('0x16b')],{});db[_0x0844('0x1d5')][_0x0844('0x11f')](db[_0x0844('0x119')],{});db[_0x0844('0x1d5')][_0x0844('0x11f')](db['MailAccount'],{'foreignKey':_0x0844('0x1d6'),'as':_0x0844('0x1d7')});db['MailTransferReport']['belongsTo'](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1d8'),'as':_0x0844('0x1d9')});db[_0x0844('0x1d5')][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':'ToUserId','as':_0x0844('0x1da')});db['MailTransferReport']['belongsTo'](db[_0x0844('0x12d')],{'foreignKey':_0x0844('0x1db'),'as':_0x0844('0x1dc')});db[_0x0844('0x1d5')][_0x0844('0x11f')](db[_0x0844('0x3b')],{'foreignKey':_0x0844('0x1dd'),'as':_0x0844('0x1de')});db[_0x0844('0xe9')][_0x0844('0x11f')](db[_0x0844('0x67')],{});db[_0x0844('0xe9')]['belongsTo'](db['ChatInteraction'],{});db[_0x0844('0xe9')][_0x0844('0x11f')](db[_0x0844('0x136')],{'foreignKey':_0x0844('0x1df'),'as':_0x0844('0x1d7')});db[_0x0844('0xe9')]['belongsTo'](db[_0x0844('0x14')],{'foreignKey':'FromUserId','as':_0x0844('0x1d9')});db[_0x0844('0xe9')]['belongsTo'](db[_0x0844('0x14')],{'foreignKey':'ToUserId','as':_0x0844('0x1da')});db['ChatTransferReport']['belongsTo'](db[_0x0844('0x6b')],{'foreignKey':_0x0844('0x1e0'),'as':'ToQueue'});db[_0x0844('0xe9')][_0x0844('0x11f')](db[_0x0844('0x136')],{'foreignKey':_0x0844('0x1e1'),'as':_0x0844('0x1de')});db[_0x0844('0xeb')][_0x0844('0x11f')](db['FaxMessage'],{});db['FaxTransferReport'][_0x0844('0x11f')](db[_0x0844('0x49')],{});db['FaxTransferReport'][_0x0844('0x11f')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1d8'),'as':'FromAgent'});db[_0x0844('0xeb')][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0844('0xeb')][_0x0844('0x11f')](db[_0x0844('0x4c')],{'foreignKey':_0x0844('0x1e2'),'as':_0x0844('0x1dc')});db[_0x0844('0xeb')][_0x0844('0x11f')](db[_0x0844('0x138')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x0844('0xed')]['belongsTo'](db[_0x0844('0x5f')],{});db[_0x0844('0xed')][_0x0844('0x11f')](db['OpenchannelInteraction'],{});db[_0x0844('0xed')][_0x0844('0x11f')](db[_0x0844('0x5a')],{'foreignKey':_0x0844('0x1e3'),'as':_0x0844('0x1d7')});db['OpenchannelTransferReport'][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':'FromUserId','as':_0x0844('0x1d9')});db['OpenchannelTransferReport']['belongsTo'](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1e4'),'as':_0x0844('0x1da')});db[_0x0844('0xed')][_0x0844('0x11f')](db['OpenchannelQueue'],{'foreignKey':_0x0844('0x1e5'),'as':_0x0844('0x1dc')});db[_0x0844('0xed')][_0x0844('0x11f')](db[_0x0844('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x0844('0x1de')});db['SmsTransferReport']['belongsTo'](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db['SmsInteraction'],{});db[_0x0844('0xef')][_0x0844('0x11f')](db[_0x0844('0x50')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x0844('0xef')][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1d8'),'as':'FromAgent'});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0844('0x1e4'),'as':_0x0844('0x1da')});db[_0x0844('0xef')][_0x0844('0x11f')](db[_0x0844('0x58')],{'foreignKey':_0x0844('0x1e6'),'as':_0x0844('0x1dc')});db[_0x0844('0xef')]['belongsTo'](db[_0x0844('0x50')],{'foreignKey':_0x0844('0x1e7'),'as':'ToAccount'});db['CmList'][_0x0844('0x10f')](db['Disposition'],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x16f'),'onDelete':'cascade'});db[_0x0844('0xf1')][_0x0844('0x10f')](db['CmCustomField'],{'as':_0x0844('0x1e8'),'foreignKey':'ListId'});db[_0x0844('0xf1')][_0x0844('0x10f')](db[_0x0844('0x71')],{'as':_0x0844('0x19b'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x16f')});db[_0x0844('0xf1')]['hasMany'](db[_0x0844('0x76')],{'as':_0x0844('0x113'),'foreignKey':_0x0844('0x16f')});db[_0x0844('0xf1')][_0x0844('0x10f')](db[_0x0844('0x77')],{'as':_0x0844('0x1e9'),'foreignKey':_0x0844('0x16f')});db[_0x0844('0xf1')][_0x0844('0x10f')](db[_0x0844('0x79')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x0844('0xf1')][_0x0844('0x123')](db[_0x0844('0x1d')],{'as':_0x0844('0x1ea'),'through':_0x0844('0x158')});db[_0x0844('0xf1')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x125')});db[_0x0844('0xf3')][_0x0844('0x10f')](db[_0x0844('0x111')],{'as':_0x0844('0x112'),'onDelete':_0x0844('0x10c')});db[_0x0844('0xf3')]['belongsToMany'](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':'UserVoicePrefix'});db[_0x0844('0xf3')][_0x0844('0x123')](db['Team'],{'through':_0x0844('0x107'),'as':_0x0844('0x15a')});db['UserProfile'][_0x0844('0x10f')](db['User'],{'as':_0x0844('0x178'),'foreignKey':_0x0844('0x120')});db[_0x0844('0xf5')][_0x0844('0x10f')](db[_0x0844('0x1eb')],{'as':_0x0844('0x1ec'),'foreignKey':'userProfileId','onDelete':_0x0844('0x10c')});db[_0x0844('0x1eb')][_0x0844('0x10f')](db[_0x0844('0x1ed')],{'as':_0x0844('0x1ee'),'foreignKey':_0x0844('0x1ef'),'onDelete':'cascade'});db[_0x0844('0x13f')][_0x0844('0x10f')](db[_0x0844('0x18a')],{'as':_0x0844('0x168'),'foreignKey':_0x0844('0x1f0'),'onDelete':_0x0844('0x10c')});db['WhatsappAccount'][_0x0844('0x10f')](db[_0x0844('0x169')],{'as':_0x0844('0x16a'),'foreignKey':_0x0844('0x1f0')});db[_0x0844('0x13f')][_0x0844('0x10f')](db[_0x0844('0xfe')],{'as':_0x0844('0x15e'),'foreignKey':_0x0844('0x1f0')});db[_0x0844('0x13f')]['hasMany'](db[_0x0844('0xfc')],{'as':_0x0844('0x16c')});db[_0x0844('0x13f')]['hasMany'](db['WhatsappApplication'],{'as':_0x0844('0x16e')});db[_0x0844('0x13f')][_0x0844('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x0844('0x16f')});db['WhatsappAccount'][_0x0844('0x11f')](db[_0x0844('0x154')],{'as':_0x0844('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0844('0x13f')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x141')});db[_0x0844('0xfa')][_0x0844('0x11f')](db[_0x0844('0x14')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0xfa')][_0x0844('0x11f')](db[_0x0844('0x102')],{'onDelete':_0x0844('0x17c')});db[_0x0844('0xfa')][_0x0844('0x11f')](db[_0x0844('0x13f')],{'onDelete':_0x0844('0x17c')});db['WhatsappApplication'][_0x0844('0x11f')](db['Interval'],{'onDelete':_0x0844('0x17c'),'foreignKey':'IntervalId'});db['WhatsappApplication']['belongsTo'](db[_0x0844('0x8b')],{'onDelete':_0x0844('0x17c'),'foreignKey':_0x0844('0x17d')});db[_0x0844('0xfc')]['hasMany'](db['WhatsappMessage'],{'as':_0x0844('0x15e'),'onDelete':_0x0844('0x10c'),'foreignKey':_0x0844('0x1f1')});db[_0x0844('0xfc')][_0x0844('0x11f')](db[_0x0844('0x13f')],{'as':'Account','foreignKey':_0x0844('0x1f0')});db['WhatsappInteraction']['belongsTo'](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':_0x0844('0x165')});db[_0x0844('0xfc')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x174'),'foreignKey':_0x0844('0x10d')});db[_0x0844('0xfc')][_0x0844('0x123')](db['Tag'],{'through':_0x0844('0x1f2'),'as':'Tags'});db['WhatsappInteraction'][_0x0844('0x123')](db[_0x0844('0x8b')],{'through':_0x0844('0x1f2'),'as':_0x0844('0x177')});db[_0x0844('0xfc')][_0x0844('0x123')](db[_0x0844('0x14')],{'as':_0x0844('0x178'),'through':'user_has_whatsapp_interactions','foreignKey':_0x0844('0x1f1')});db[_0x0844('0xfe')][_0x0844('0x11f')](db[_0x0844('0x14')],{'as':_0x0844('0x14')});db[_0x0844('0xfe')]['belongsTo'](db[_0x0844('0x71')],{'onDelete':_0x0844('0x10c'),'as':_0x0844('0x164')});db[_0x0844('0xfe')][_0x0844('0x11f')](db[_0x0844('0xfc')],{'onDelete':'cascade','as':_0x0844('0x17a'),'foreignKey':_0x0844('0x1f1')});db[_0x0844('0xfe')][_0x0844('0x11f')](db[_0x0844('0x13f')],{'as':_0x0844('0x173'),'foreignKey':_0x0844('0x1f0')});db[_0x0844('0x1f3')][_0x0844('0x11f')](db[_0x0844('0x13f')],{});db[_0x0844('0x1f3')][_0x0844('0x11f')](db[_0x0844('0xf1')],{'as':_0x0844('0x17e'),'foreignKey':_0x0844('0x16f')});db[_0x0844('0x1f3')]['belongsTo'](db[_0x0844('0x71')],{'as':_0x0844('0x164'),'foreignKey':'ContactId'});db[_0x0844('0x1f3')][_0x0844('0x11f')](db[_0x0844('0xfc')],{});db['WhatsappQueueReport'][_0x0844('0x11f')](db[_0x0844('0x102')],{});db[_0x0844('0x1f3')][_0x0844('0x11f')](db[_0x0844('0xfe')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0844('0x14')],{});db['WhatsappTransferReport'][_0x0844('0x11f')](db[_0x0844('0xfe')],{});db[_0x0844('0x101')]['belongsTo'](db[_0x0844('0xfc')],{});db[_0x0844('0x101')][_0x0844('0x11f')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x0844('0x1d7')});db[_0x0844('0x101')][_0x0844('0x11f')](db[_0x0844('0x13f')],{'foreignKey':_0x0844('0x1f4'),'as':_0x0844('0x1de')});db[_0x0844('0x101')][_0x0844('0x11f')](db[_0x0844('0x102')],{'foreignKey':'ToQueueId','as':_0x0844('0x1dc')});db['WhatsappTransferReport'][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1d8'),'as':_0x0844('0x1d9')});db[_0x0844('0x101')][_0x0844('0x11f')](db[_0x0844('0x14')],{'foreignKey':_0x0844('0x1e4'),'as':_0x0844('0x1da')});db['WhatsappQueue']['belongsToMany'](db[_0x0844('0x14')],{'as':_0x0844('0x159'),'through':_0x0844('0x135'),'foreignKey':_0x0844('0x1f5')});db[_0x0844('0x102')]['belongsToMany'](db['Team'],{'through':_0x0844('0x1f6'),'as':_0x0844('0x15a')});module[_0x0844('0x1f7')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 39beaee..c4d758a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb709=['/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/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/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','username','password','newPassword','apiKey','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','}@@','replace','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','device','other','agent_name','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport'];(function(_0x4221c3,_0xf33bf8){var _0x97619a=function(_0x4f934d){while(--_0x4f934d){_0x4221c3['push'](_0x4221c3['shift']());}};_0x97619a(++_0xf33bf8);}(_0xb709,0x84));var _0x9b70=function(_0x56ca38,_0xb8c2b7){_0x56ca38=_0x56ca38-0x0;var _0x139a5b=_0xb709[_0x56ca38];return _0x139a5b;};'use strict';var _=require(_0x9b70('0x0'));var path=require(_0x9b70('0x1'));var express=require(_0x9b70('0x2'));var ewinston=require(_0x9b70('0x3'));var util=require('util');var errors=require(_0x9b70('0x4'));var config=require(_0x9b70('0x5'));var logger=require(_0x9b70('0x6'))(_0x9b70('0x7'));var authLogger=require('./config/logger')('auth');exports[_0x9b70('0x8')]=function(_0xa07c51){_0xa07c51['use'](ewinston[_0x9b70('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4b83a6,_0x14e52d){var _0x5b569e=_0x9b70('0xa');if(!_['isEmpty'](_0x4b83a6[_0x9b70('0xb')])){_0x5b569e+=_0x9b70('0xc');var _0x47ab5d=_0x4b83a6[_0x9b70('0xb')];maskSensitiveData(_0x47ab5d);}return util[_0x9b70('0xd')](_0x5b569e,_0x4b83a6[_0x9b70('0xe')],_0x4b83a6[_0x9b70('0xf')]['x-forwarded-for']?_0x4b83a6[_0x9b70('0xf')][_0x9b70('0x10')]:_0x4b83a6['connection'][_0x9b70('0x11')]||_0x4b83a6['ip'],_0x4b83a6[_0x9b70('0x12')],_0x14e52d[_0x9b70('0x13')],_0x14e52d[_0x9b70('0x14')],_0x4b83a6['user']?_0x4b83a6[_0x9b70('0x15')]['id']:null,_0x4b83a6[_0x9b70('0x15')]?_0x4b83a6[_0x9b70('0x15')][_0x9b70('0x16')]:null,_0x4b83a6['user']?_0x4b83a6[_0x9b70('0x15')][_0x9b70('0x17')]:null,_0x47ab5d?util[_0x9b70('0x18')](_0x47ab5d,![],null):'');}}));_0xa07c51[_0x9b70('0x19')](ewinston[_0x9b70('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x148e5e,_0x41ff69){var _0x59f0de=_0x9b70('0x1a');if(_0x148e5e[_0x9b70('0xb')]&&_0x148e5e[_0x9b70('0xb')]['device']&&_0x148e5e['body'][_0x9b70('0x1b')]){_0x59f0de=_0x9b70('0x1c');}return util[_0x9b70('0xd')](_0x59f0de,_0x148e5e[_0x9b70('0xe')],_0x148e5e[_0x9b70('0xf')]['x-forwarded-for']?_0x148e5e['headers'][_0x9b70('0x10')]:_0x148e5e[_0x9b70('0x1d')][_0x9b70('0x11')]||_0x148e5e['ip'],_0x148e5e[_0x9b70('0x12')],_0x41ff69['statusCode'],_0x41ff69[_0x9b70('0x14')],_0x148e5e[_0x9b70('0x15')]?_0x148e5e[_0x9b70('0x15')]['id']:null,_0x148e5e['user']?_0x148e5e[_0x9b70('0x15')][_0x9b70('0x16')]:null,_0x148e5e[_0x9b70('0x15')]?_0x148e5e[_0x9b70('0x15')]['role']:null,_0x148e5e[_0x9b70('0xb')]&&_0x148e5e['body'][_0x9b70('0x1e')]?_0x148e5e['body']['device']:_0x9b70('0x1f'),_0x148e5e[_0x9b70('0xb')]&&_0x148e5e[_0x9b70('0xb')][_0x9b70('0x1b')]?_0x148e5e['body']['agent_id']:'',_0x148e5e['body']&&_0x148e5e[_0x9b70('0xb')][_0x9b70('0x20')]?_0x148e5e[_0x9b70('0xb')][_0x9b70('0x20')]:'');},'ignoreRoute':function(_0x2059eb){var _0x5f0e8e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f0e8e['test'](_0x2059eb[_0x9b70('0x12')]);}}));_0xa07c51['use']('/api/users',require(_0x9b70('0x21')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x22'),require(_0x9b70('0x23')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x24'),require(_0x9b70('0x25')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x26'),require(_0x9b70('0x27')));_0xa07c51[_0x9b70('0x19')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x28'),require(_0x9b70('0x29')));_0xa07c51[_0x9b70('0x19')]('/api/voice/recordings',require(_0x9b70('0x2a')));_0xa07c51[_0x9b70('0x19')]('/api/screen/recordings',require('./api/screenRecording'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x2b'),require(_0x9b70('0x2c')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x2d'),require(_0x9b70('0x2e')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x2f'),require(_0x9b70('0x30')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x31'),require(_0x9b70('0x32')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x33'),require(_0x9b70('0x34')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x35'),require(_0x9b70('0x36')));_0xa07c51['use'](_0x9b70('0x37'),require(_0x9b70('0x38')));_0xa07c51[_0x9b70('0x19')]('/api/trunks',require('./api/trunk'));_0xa07c51[_0x9b70('0x19')]('/api/voice/transfers/reports',require(_0x9b70('0x39')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x3a'),require(_0x9b70('0x3b')));_0xa07c51['use'](_0x9b70('0x3c'),require(_0x9b70('0x3d')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x3e'),require(_0x9b70('0x3f')));_0xa07c51['use'](_0x9b70('0x40'),require('./api/mailSubstatus'));_0xa07c51['use'](_0x9b70('0x41'),require('./api/mailInteraction'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x42'),require('./api/mailMessage'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x43'),require(_0x9b70('0x44')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x45'),require('./api/mailQueueReport'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x46'),require(_0x9b70('0x47')));_0xa07c51[_0x9b70('0x19')]('/api/dashboards/items',require('./api/dashboardItem'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x48'),require(_0x9b70('0x49')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x4a'),require('./api/faxApplication'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x4b'),require('./api/faxInteraction'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x4c'),require('./api/faxMessage'));_0xa07c51[_0x9b70('0x19')]('/api/fax/queues',require(_0x9b70('0x4d')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x4e'),require(_0x9b70('0x4f')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x50'),require(_0x9b70('0x51')));_0xa07c51['use'](_0x9b70('0x52'),require(_0x9b70('0x53')));_0xa07c51['use'](_0x9b70('0x54'),require('./api/smsInteraction'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x55'),require(_0x9b70('0x56')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x57'),require(_0x9b70('0x58')));_0xa07c51['use'](_0x9b70('0x59'),require(_0x9b70('0x5a')));_0xa07c51['use'](_0x9b70('0x5b'),require(_0x9b70('0x5c')));_0xa07c51['use'](_0x9b70('0x5d'),require(_0x9b70('0x5e')));_0xa07c51[_0x9b70('0x19')]('/api/openchannel/messages',require(_0x9b70('0x5f')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x60'),require(_0x9b70('0x61')));_0xa07c51['use'](_0x9b70('0x62'),require(_0x9b70('0x63')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x64'),require('./api/openchannelQueueReport'));_0xa07c51['use'](_0x9b70('0x65'),require(_0x9b70('0x66')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x67'),require(_0x9b70('0x68')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x69'),require(_0x9b70('0x6a')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x6b'),require(_0x9b70('0x6c')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x6d'),require(_0x9b70('0x6e')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x6f'),require(_0x9b70('0x70')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x71'),require(_0x9b70('0x72')));_0xa07c51[_0x9b70('0x19')]('/api/cm/companies',require(_0x9b70('0x73')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x74'),require(_0x9b70('0x75')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x76'),require(_0x9b70('0x77')));_0xa07c51[_0x9b70('0x19')]('/api/cm/hopper_black',require(_0x9b70('0x78')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x79'),require('./api/cmHopperFinal'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x7a'),require(_0x9b70('0x7b')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x7c'),require(_0x9b70('0x7d')));_0xa07c51[_0x9b70('0x19')]('/api/actions',require(_0x9b70('0x7e')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x7f'),require(_0x9b70('0x80')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x81'),require(_0x9b70('0x82')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x83'),require(_0x9b70('0x84')));_0xa07c51['use']('/api/conditions',require(_0x9b70('0x85')));_0xa07c51['use'](_0x9b70('0x86'),require(_0x9b70('0x87')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x88'),require('./api/pause'));_0xa07c51[_0x9b70('0x19')]('/api/cdr',require(_0x9b70('0x89')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x8a'),require(_0x9b70('0x8b')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x8c'),require(_0x9b70('0x8d')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x8e'),require(_0x9b70('0x8f')));_0xa07c51[_0x9b70('0x19')]('/api/tags',require(_0x9b70('0x90')));_0xa07c51['use'](_0x9b70('0x91'),require(_0x9b70('0x92')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x93'),require(_0x9b70('0x94')));_0xa07c51[_0x9b70('0x19')]('/api/variables',require(_0x9b70('0x95')));_0xa07c51[_0x9b70('0x19')]('/api/integrations',require(_0x9b70('0x96')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x97'),require(_0x9b70('0x98')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x99'),require(_0x9b70('0x9a')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x9b'),require(_0x9b70('0x9c')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x9d'),require(_0x9b70('0x9e')));_0xa07c51['use'](_0x9b70('0x9f'),require('./api/analyticMetric'));_0xa07c51['use']('/api/analytics/field_reports',require(_0x9b70('0xa0')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xa1'),require(_0x9b70('0xa2')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xa3'),require(_0x9b70('0xa4')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xa5'),require(_0x9b70('0xa6')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/salesforce/fields',require(_0x9b70('0xa7')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xa8'),require(_0x9b70('0xa9')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xaa'),require(_0x9b70('0xab')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xac'),require(_0x9b70('0xad')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/desk/accounts',require(_0x9b70('0xae')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/desk/configurations',require(_0x9b70('0xaf')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xb0'),require(_0x9b70('0xb1')));_0xa07c51['use'](_0x9b70('0xb2'),require(_0x9b70('0xb3')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xb4'),require(_0x9b70('0xb5')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xb6'),require('./api/intZohoField'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xb7'),require(_0x9b70('0xb8')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xb9'),require(_0x9b70('0xba')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xbb'),require('./api/intZendeskField'));_0xa07c51['use'](_0x9b70('0xbc'),require('./api/intFreshdeskAccount'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xbd'),require(_0x9b70('0xbe')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xbf'),require(_0x9b70('0xc0')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xc1'),require('./api/intVtigerAccount'));_0xa07c51['use'](_0x9b70('0xc2'),require(_0x9b70('0xc3')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/vtiger/fields',require(_0x9b70('0xc4')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/servicenow/accounts',require(_0x9b70('0xc5')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xc6'),require(_0x9b70('0xc7')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xc8'),require(_0x9b70('0xc9')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/dynamics365/accounts',require(_0x9b70('0xca')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/dynamics365/configurations',require(_0x9b70('0xcb')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xcc'),require(_0x9b70('0xcd')));_0xa07c51['use'](_0x9b70('0xce'),require(_0x9b70('0xcf')));_0xa07c51['use'](_0x9b70('0xd0'),require(_0x9b70('0xd1')));_0xa07c51[_0x9b70('0x19')]('/api/integrations/freshsales/fields',require(_0x9b70('0xd2')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xd3'),require('./api/network'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xd4'),require(_0x9b70('0xd5')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xd6'),require(_0x9b70('0xd7')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xd8'),require('./api/jscriptyAnswerReport'));_0xa07c51['use'](_0x9b70('0xd9'),require('./api/jscriptyQuestionReport'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xda'),require('./api/jscriptySessionReport'));_0xa07c51['use'](_0x9b70('0xdb'),require(_0x9b70('0xdc')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xdd'),require(_0x9b70('0xde')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xdf'),require(_0x9b70('0xe0')));_0xa07c51[_0x9b70('0x19')]('/api/jscripty/projects',require(_0x9b70('0xe1')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xe2'),require(_0x9b70('0xe3')));_0xa07c51['use'](_0x9b70('0xe4'),require('./api/squareOdbc'));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xe5'),require('./api/squareProject'));_0xa07c51['use']('/api/square/recordings',require('./api/squareRecording'));_0xa07c51['use'](_0x9b70('0xe6'),require(_0x9b70('0xe7')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xe8'),require(_0x9b70('0xe9')));_0xa07c51[_0x9b70('0x19')]('/api/license',require(_0x9b70('0xea')));_0xa07c51['use'](_0x9b70('0xeb'),require(_0x9b70('0xec')));_0xa07c51['use'](_0x9b70('0xed'),require(_0x9b70('0xee')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xef'),require(_0x9b70('0xf0')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xf1'),require(_0x9b70('0xf2')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xf3'),require(_0x9b70('0xf4')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xf5'),require(_0x9b70('0xf6')));_0xa07c51[_0x9b70('0x19')]('/api/fax/reports/transfer',require(_0x9b70('0xf7')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xf8'),require(_0x9b70('0xf9')));_0xa07c51[_0x9b70('0x19')]('/api/sms/reports/transfer',require(_0x9b70('0xfa')));_0xa07c51[_0x9b70('0x19')]('/api/cm/lists',require('./api/cmList'));_0xa07c51['use'](_0x9b70('0xfb'),require(_0x9b70('0xfc')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0xfd'),require(_0x9b70('0xfe')));_0xa07c51[_0x9b70('0x19')]('/api/userProfile/sections',require(_0x9b70('0xff')));_0xa07c51[_0x9b70('0x19')]('/api/userProfile/resources',require(_0x9b70('0x100')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x101'),require(_0x9b70('0x102')));_0xa07c51['use'](_0x9b70('0x103'),require(_0x9b70('0x104')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x105'),require(_0x9b70('0x106')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x107'),require(_0x9b70('0x108')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x109'),require('./api/whatsappMessage'));_0xa07c51[_0x9b70('0x19')]('/api/whatsapp/reports/queue',require(_0x9b70('0x10a')));_0xa07c51['use'](_0x9b70('0x10b'),require(_0x9b70('0x10c')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x10d'),require(_0x9b70('0x10e')));_0xa07c51['use'](_0x9b70('0x10f'),require(_0x9b70('0x110')));_0xa07c51[_0x9b70('0x19')]('/api/realtime',require(_0x9b70('0x111')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x112'),require(_0x9b70('0x113')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x114'),require(_0x9b70('0x115')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x116'),require(_0x9b70('0x117')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x118'),require(_0x9b70('0x119')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x11a'),require(_0x9b70('0x11b')));_0xa07c51['use'](_0x9b70('0x11c'),require(_0x9b70('0x11d')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x11e'),require(_0x9b70('0x11f')));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x120'),require(_0x9b70('0x121')));_0xa07c51['use']('/apidoc',express[_0x9b70('0x122')](path[_0x9b70('0x123')](config[_0x9b70('0x124')],_0x9b70('0x125'))));_0xa07c51[_0x9b70('0x19')]('/www',express['static'](path[_0x9b70('0x123')](config[_0x9b70('0x124')],_0x9b70('0x126'))));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x127'),express[_0x9b70('0x122')](path[_0x9b70('0x123')](config[_0x9b70('0x124')],_0x9b70('0x127'))));_0xa07c51['use'](_0x9b70('0x128'),express[_0x9b70('0x122')](path[_0x9b70('0x123')](config['root'],_0x9b70('0x129'),_0x9b70('0x12a'))));_0xa07c51[_0x9b70('0x19')](_0x9b70('0x12b'),express['static'](path[_0x9b70('0x123')](config[_0x9b70('0x124')],_0x9b70('0x12c'))));_0xa07c51[_0x9b70('0x12d')](_0x9b70('0x12e'))['get'](errors[0x194]);_0xa07c51[_0x9b70('0x12d')]('/*')[_0x9b70('0x12f')](function(_0xed166b,_0x18a5ab){_0x18a5ab['sendFile'](path[_0x9b70('0x130')](_0xa07c51[_0x9b70('0x12f')](_0x9b70('0x131'))+'/index.html'));});};var sensitiveFields=[_0x9b70('0x132'),_0x9b70('0x133'),_0x9b70('0x134'),_0x9b70('0x135'),'firstName',_0x9b70('0x136'),_0x9b70('0x137'),_0x9b70('0x138'),_0x9b70('0x139'),_0x9b70('0x13a'),_0x9b70('0x13b'),_0x9b70('0x13c'),_0x9b70('0x13d'),_0x9b70('0x13e'),'code',_0x9b70('0x13f'),_0x9b70('0x140'),'token',_0x9b70('0x141'),'accessToken',_0x9b70('0x142'),_0x9b70('0x143'),_0x9b70('0x144'),_0x9b70('0x145'),_0x9b70('0x146'),_0x9b70('0x147'),_0x9b70('0x148'),_0x9b70('0x149'),_0x9b70('0x14a'),'clientEmail',_0x9b70('0x14b'),_0x9b70('0x14c'),_0x9b70('0x14d'),_0x9b70('0x14e'),'user','pass','accountSid','localstationid',_0x9b70('0x14f'),_0x9b70('0x150'),_0x9b70('0x151'),_0x9b70('0x152')];function maskSensitiveData(_0x5da14b){var _0x5b3ea9=/(?!^)[\s\S](?!$)/g;if(!_[_0x9b70('0x153')](_0x5da14b))return;for(var _0xa8df24 in _0x5da14b){if(_[_0x9b70('0x154')](_0x5da14b[_0xa8df24])){for(var _0x50081b=0x0;_0x50081b<_0x5da14b[_0xa8df24][_0x9b70('0x155')];_0x50081b++){maskSensitiveData(_0x5da14b[_0xa8df24][_0x50081b]);}}else if(_[_0x9b70('0x153')](_0x5da14b[_0xa8df24])){maskSensitiveData(_0x5da14b[_0xa8df24]);}else if(_[_0x9b70('0x156')](_0x5da14b[_0xa8df24])){_0x5da14b[_0xa8df24]=_0x5da14b[_0xa8df24]['replace'](/{{{/g,_0x9b70('0x157'))['replace'](/}}}/g,_0x9b70('0x158'))[_0x9b70('0x159')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0xa8df24)){_0x5da14b[_0xa8df24]=_0x5da14b[_0xa8df24]['replace'](_0x5b3ea9,'*');}}}} \ No newline at end of file +var _0x0b46=['/api/voice/calls/reports','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/template','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/configurations','/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/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/cloudProvider','./api/realtime','/api/auth/local','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','static','root','/apidoc','/www','/demo','join','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','username','password','newPassword','apiKey','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','accessKey','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','includes','path','express','express-winston','util','./config/environment','./config/logger','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','other','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage'];(function(_0x35ce81,_0x10b702){var _0x31296e=function(_0x2835fc){while(--_0x2835fc){_0x35ce81['push'](_0x35ce81['shift']());}};_0x31296e(++_0x10b702);}(_0x0b46,0x105));var _0x60b4=function(_0x42bbd8,_0x32af99){_0x42bbd8=_0x42bbd8-0x0;var _0x2d4a1c=_0x0b46[_0x42bbd8];return _0x2d4a1c;};'use strict';var _=require('lodash');var path=require(_0x60b4('0x0'));var express=require(_0x60b4('0x1'));var ewinston=require(_0x60b4('0x2'));var util=require(_0x60b4('0x3'));var errors=require('./errors');var config=require(_0x60b4('0x4'));var logger=require(_0x60b4('0x5'))('api');var authLogger=require('./config/logger')(_0x60b4('0x6'));exports[_0x60b4('0x7')]=function(_0x2949b4){_0x2949b4[_0x60b4('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x635ce8,_0x590efe){var _0x13e990=_0x60b4('0x9');if(!_[_0x60b4('0xa')](_0x635ce8[_0x60b4('0xb')])){_0x13e990+=_0x60b4('0xc');var _0xa03d71=_0x635ce8['body'];maskSensitiveData(_0xa03d71);}return util[_0x60b4('0xd')](_0x13e990,_0x635ce8[_0x60b4('0xe')],_0x635ce8[_0x60b4('0xf')]['x-forwarded-for']?_0x635ce8[_0x60b4('0xf')][_0x60b4('0x10')]:_0x635ce8[_0x60b4('0x11')][_0x60b4('0x12')]||_0x635ce8['ip'],_0x635ce8['url'],_0x590efe[_0x60b4('0x13')],_0x590efe[_0x60b4('0x14')],_0x635ce8['user']?_0x635ce8[_0x60b4('0x15')]['id']:null,_0x635ce8[_0x60b4('0x15')]?_0x635ce8[_0x60b4('0x15')][_0x60b4('0x16')]:null,_0x635ce8[_0x60b4('0x15')]?_0x635ce8[_0x60b4('0x15')][_0x60b4('0x17')]:null,_0xa03d71?util[_0x60b4('0x18')](_0xa03d71,![],null):'');}}));_0x2949b4[_0x60b4('0x8')](ewinston[_0x60b4('0x19')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5ed035,_0x8d0c47){var _0x46c367=_0x60b4('0x1a');if(_0x5ed035[_0x60b4('0xb')]&&_0x5ed035[_0x60b4('0xb')][_0x60b4('0x1b')]&&_0x5ed035['body']['agent_id']){_0x46c367=_0x60b4('0x1c');}return util['format'](_0x46c367,_0x5ed035[_0x60b4('0xe')],_0x5ed035['headers']['x-forwarded-for']?_0x5ed035[_0x60b4('0xf')]['x-forwarded-for']:_0x5ed035[_0x60b4('0x11')][_0x60b4('0x12')]||_0x5ed035['ip'],_0x5ed035[_0x60b4('0x1d')],_0x8d0c47[_0x60b4('0x13')],_0x8d0c47[_0x60b4('0x14')],_0x5ed035[_0x60b4('0x15')]?_0x5ed035[_0x60b4('0x15')]['id']:null,_0x5ed035[_0x60b4('0x15')]?_0x5ed035[_0x60b4('0x15')]['name']:null,_0x5ed035['user']?_0x5ed035[_0x60b4('0x15')][_0x60b4('0x17')]:null,_0x5ed035[_0x60b4('0xb')]&&_0x5ed035[_0x60b4('0xb')]['device']?_0x5ed035[_0x60b4('0xb')][_0x60b4('0x1b')]:_0x60b4('0x1e'),_0x5ed035[_0x60b4('0xb')]&&_0x5ed035[_0x60b4('0xb')][_0x60b4('0x1f')]?_0x5ed035['body'][_0x60b4('0x1f')]:'',_0x5ed035[_0x60b4('0xb')]&&_0x5ed035[_0x60b4('0xb')][_0x60b4('0x20')]?_0x5ed035['body'][_0x60b4('0x20')]:'');},'ignoreRoute':function(_0xcc3260){var _0x3bd125=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3bd125[_0x60b4('0x21')](_0xcc3260[_0x60b4('0x1d')]);}}));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x22'),require(_0x60b4('0x23')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x24'),require('./api/voiceChanSpy'));_0x2949b4['use']('/api/voice/contexts',require('./api/voiceContext'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x25'),require(_0x60b4('0x26')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x27'),require(_0x60b4('0x28')));_0x2949b4['use'](_0x60b4('0x29'),require('./api/voiceQueue'));_0x2949b4[_0x60b4('0x8')]('/api/voice/recordings',require(_0x60b4('0x2a')));_0x2949b4[_0x60b4('0x8')]('/api/screen/recordings',require(_0x60b4('0x2b')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x2c'),require('./api/voiceMail'));_0x2949b4['use'](_0x60b4('0x2d'),require(_0x60b4('0x2e')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x2f'),require('./api/voiceCallReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x30'),require('./api/voiceDialReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x31'),require(_0x60b4('0x32')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x33'),require('./api/voiceQueueReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x34'),require(_0x60b4('0x35')));_0x2949b4[_0x60b4('0x8')]('/api/trunks',require(_0x60b4('0x36')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x37'),require(_0x60b4('0x38')));_0x2949b4['use'](_0x60b4('0x39'),require(_0x60b4('0x3a')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x3b'),require(_0x60b4('0x3c')));_0x2949b4[_0x60b4('0x8')]('/api/mail/queues',require(_0x60b4('0x3d')));_0x2949b4[_0x60b4('0x8')]('/api/mail/substatuses',require(_0x60b4('0x3e')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x3f'),require(_0x60b4('0x40')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x41'),require(_0x60b4('0x42')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x43'),require(_0x60b4('0x44')));_0x2949b4[_0x60b4('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x45'),require(_0x60b4('0x46')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x47'),require(_0x60b4('0x48')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x49'),require(_0x60b4('0x4a')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x4b'),require(_0x60b4('0x4c')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x4d'),require(_0x60b4('0x4e')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x4f'),require(_0x60b4('0x50')));_0x2949b4['use'](_0x60b4('0x51'),require(_0x60b4('0x52')));_0x2949b4['use']('/api/fax/reports/queue',require(_0x60b4('0x53')));_0x2949b4['use'](_0x60b4('0x54'),require(_0x60b4('0x55')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x56'),require(_0x60b4('0x57')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x58'),require('./api/smsInteraction'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x59'),require(_0x60b4('0x5a')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x5b'),require(_0x60b4('0x5c')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x5d'),require(_0x60b4('0x5e')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x5f'),require(_0x60b4('0x60')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x61'),require(_0x60b4('0x62')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x63'),require(_0x60b4('0x64')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x65'),require(_0x60b4('0x66')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x67'),require(_0x60b4('0x68')));_0x2949b4['use'](_0x60b4('0x69'),require('./api/openchannelQueueReport'));_0x2949b4[_0x60b4('0x8')]('/api/chat/applications',require(_0x60b4('0x6a')));_0x2949b4['use']('/api/chat/interactions',require(_0x60b4('0x6b')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x6c'),require('./api/chatMessage'));_0x2949b4[_0x60b4('0x8')]('/api/chat/offline_messages',require(_0x60b4('0x6d')));_0x2949b4['use'](_0x60b4('0x6e'),require(_0x60b4('0x6f')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x70'),require(_0x60b4('0x71')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x72'),require('./api/chatProactiveAction'));_0x2949b4[_0x60b4('0x8')]('/api/cm/companies',require('./api/cmCompany'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x73'),require(_0x60b4('0x74')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x75'),require('./api/cmHopper'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x76'),require(_0x60b4('0x77')));_0x2949b4[_0x60b4('0x8')]('/api/cm/hopper_final',require(_0x60b4('0x78')));_0x2949b4[_0x60b4('0x8')]('/api/cm/hopper_history',require(_0x60b4('0x79')));_0x2949b4['use']('/api/cm/custom_fields',require(_0x60b4('0x7a')));_0x2949b4['use']('/api/actions',require('./api/action'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x7b'),require('./api/automation'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x7c'),require(_0x60b4('0x7d')));_0x2949b4['use'](_0x60b4('0x7e'),require(_0x60b4('0x7f')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x80'),require(_0x60b4('0x81')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x82'),require(_0x60b4('0x83')));_0x2949b4[_0x60b4('0x8')]('/api/pauses',require(_0x60b4('0x84')));_0x2949b4[_0x60b4('0x8')]('/api/cdr',require(_0x60b4('0x85')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x86'),require('./api/voiceQueuesLog'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x87'),require(_0x60b4('0x88')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x89'),require(_0x60b4('0x8a')));_0x2949b4[_0x60b4('0x8')]('/api/tags',require(_0x60b4('0x8b')));_0x2949b4[_0x60b4('0x8')]('/api/templates',require(_0x60b4('0x8c')));_0x2949b4[_0x60b4('0x8')]('/api/triggers',require('./api/trigger'));_0x2949b4[_0x60b4('0x8')]('/api/variables',require(_0x60b4('0x8d')));_0x2949b4['use'](_0x60b4('0x8e'),require('./api/integration'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x8f'),require(_0x60b4('0x90')));_0x2949b4['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x91'),require('./api/analyticDefaultReport'));_0x2949b4[_0x60b4('0x8')]('/api/analytics/extracted_reports',require(_0x60b4('0x92')));_0x2949b4[_0x60b4('0x8')]('/api/analytics/metrics',require(_0x60b4('0x93')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x94'),require('./api/analyticFieldReport'));_0x2949b4[_0x60b4('0x8')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x95'),require('./api/intSalesforceAccount'));_0x2949b4['use'](_0x60b4('0x96'),require('./api/intSalesforceConfiguration'));_0x2949b4[_0x60b4('0x8')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x2949b4[_0x60b4('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x60b4('0x97')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x98'),require('./api/intSugarcrmConfiguration'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x99'),require('./api/intSugarcrmField'));_0x2949b4[_0x60b4('0x8')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x9a'),require('./api/intDeskConfiguration'));_0x2949b4['use'](_0x60b4('0x9b'),require(_0x60b4('0x9c')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x9d'),require(_0x60b4('0x9e')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x9f'),require(_0x60b4('0xa0')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xa1'),require(_0x60b4('0xa2')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xa3'),require(_0x60b4('0xa4')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xa5'),require(_0x60b4('0xa6')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xa7'),require(_0x60b4('0xa8')));_0x2949b4['use'](_0x60b4('0xa9'),require(_0x60b4('0xaa')));_0x2949b4['use']('/api/integrations/freshdesk/configurations',require(_0x60b4('0xab')));_0x2949b4['use'](_0x60b4('0xac'),require('./api/intFreshdeskField'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xad'),require(_0x60b4('0xae')));_0x2949b4[_0x60b4('0x8')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x2949b4[_0x60b4('0x8')]('/api/integrations/vtiger/fields',require(_0x60b4('0xaf')));_0x2949b4['use'](_0x60b4('0xb0'),require(_0x60b4('0xb1')));_0x2949b4['use'](_0x60b4('0xb2'),require(_0x60b4('0xb3')));_0x2949b4[_0x60b4('0x8')]('/api/integrations/servicenow/fields',require(_0x60b4('0xb4')));_0x2949b4[_0x60b4('0x8')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x2949b4[_0x60b4('0x8')]('/api/integrations/dynamics365/configurations',require(_0x60b4('0xb5')));_0x2949b4['use'](_0x60b4('0xb6'),require(_0x60b4('0xb7')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xb8'),require('./api/intFreshsalesAccount'));_0x2949b4['use'](_0x60b4('0xb9'),require('./api/intFreshsalesConfiguration'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xba'),require('./api/intFreshsalesField'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xbb'),require(_0x60b4('0xbc')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xbd'),require(_0x60b4('0xbe')));_0x2949b4[_0x60b4('0x8')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xbf'),require(_0x60b4('0xc0')));_0x2949b4[_0x60b4('0x8')]('/api/jscripty/questions/reports',require(_0x60b4('0xc1')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xc2'),require(_0x60b4('0xc3')));_0x2949b4[_0x60b4('0x8')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x2949b4[_0x60b4('0x8')]('/api/square/reports',require(_0x60b4('0xc4')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xc5'),require(_0x60b4('0xc6')));_0x2949b4[_0x60b4('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xc7'),require(_0x60b4('0xc8')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xc9'),require(_0x60b4('0xca')));_0x2949b4[_0x60b4('0x8')]('/api/square/projects',require(_0x60b4('0xcb')));_0x2949b4['use'](_0x60b4('0xcc'),require(_0x60b4('0xcd')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xce'),require('./api/squareMessage'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xcf'),require('./api/team'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xd0'),require(_0x60b4('0xd1')));_0x2949b4[_0x60b4('0x8')]('/api/campaigns',require(_0x60b4('0xd2')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xd3'),require(_0x60b4('0xd4')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xd5'),require('./api/attachment'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xd6'),require(_0x60b4('0xd7')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xd8'),require(_0x60b4('0xd9')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xda'),require('./api/chatTransferReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xdb'),require(_0x60b4('0xdc')));_0x2949b4['use'](_0x60b4('0xdd'),require(_0x60b4('0xde')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xdf'),require(_0x60b4('0xe0')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xe1'),require('./api/cmList'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xe2'),require('./api/voicePrefix'));_0x2949b4[_0x60b4('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xe3'),require('./api/userProfileSection'));_0x2949b4['use'](_0x60b4('0xe4'),require(_0x60b4('0xe5')));_0x2949b4['use'](_0x60b4('0xe6'),require('./api/userNotification'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xe7'),require(_0x60b4('0xe8')));_0x2949b4[_0x60b4('0x8')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xe9'),require('./api/whatsappInteraction'));_0x2949b4[_0x60b4('0x8')]('/api/whatsapp/messages',require(_0x60b4('0xea')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xeb'),require(_0x60b4('0xec')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xed'),require('./api/whatsappTransferReport'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xee'),require('./api/whatsappQueue'));_0x2949b4['use']('/api/cloudProviders',require(_0x60b4('0xef')));_0x2949b4[_0x60b4('0x8')]('/api/realtime',require(_0x60b4('0xf0')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xf1'),require('./api/authLocal'));_0x2949b4['use'](_0x60b4('0xf2'),require('./api/authGoogle'));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xf3'),require(_0x60b4('0xf4')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xf5'),require(_0x60b4('0xf6')));_0x2949b4[_0x60b4('0x8')]('/api/version',require(_0x60b4('0xf7')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xf8'),require(_0x60b4('0xf9')));_0x2949b4[_0x60b4('0x8')](_0x60b4('0xfa'),require('./api/pm2'));_0x2949b4['use'](_0x60b4('0xfb'),require(_0x60b4('0xfc')));_0x2949b4[_0x60b4('0x8')]('/apidoc',express[_0x60b4('0xfd')](path['join'](config[_0x60b4('0xfe')],_0x60b4('0xff'))));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x100'),express[_0x60b4('0xfd')](path['join'](config['root'],_0x60b4('0x100'))));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x101'),express[_0x60b4('0xfd')](path[_0x60b4('0x102')](config[_0x60b4('0xfe')],_0x60b4('0x101'))));_0x2949b4['use'](_0x60b4('0x103'),express['static'](path[_0x60b4('0x102')](config['root'],_0x60b4('0x104'),_0x60b4('0x105'))));_0x2949b4[_0x60b4('0x8')](_0x60b4('0x106'),express[_0x60b4('0xfd')](path[_0x60b4('0x102')](config[_0x60b4('0xfe')],'/server/files/plugins')));_0x2949b4[_0x60b4('0x107')](_0x60b4('0x108'))[_0x60b4('0x109')](errors[0x194]);_0x2949b4['route']('/*')[_0x60b4('0x109')](function(_0x432d89,_0x576f7b){_0x576f7b[_0x60b4('0x10a')](path['resolve'](_0x2949b4[_0x60b4('0x109')](_0x60b4('0x10b'))+_0x60b4('0x10c')));});};var sensitiveFields=[_0x60b4('0x10d'),_0x60b4('0x10e'),_0x60b4('0x10f'),_0x60b4('0x110'),'firstName',_0x60b4('0x111'),'street',_0x60b4('0x112'),_0x60b4('0x113'),_0x60b4('0x114'),_0x60b4('0x115'),_0x60b4('0x116'),_0x60b4('0x117'),_0x60b4('0x118'),'code',_0x60b4('0x119'),'tenantId','token',_0x60b4('0x11a'),_0x60b4('0x11b'),_0x60b4('0x11c'),'authToken',_0x60b4('0x11d'),_0x60b4('0x11e'),_0x60b4('0x11f'),_0x60b4('0x120'),_0x60b4('0x121'),'exten',_0x60b4('0x122'),_0x60b4('0x123'),_0x60b4('0x124'),_0x60b4('0x125'),_0x60b4('0x126'),_0x60b4('0x127'),'user',_0x60b4('0x128'),'accountSid',_0x60b4('0x129'),'dsn',_0x60b4('0x12a'),_0x60b4('0x12b'),_0x60b4('0x12c')];function maskSensitiveData(_0x137907){var _0x3ca649=/(?!^)[\s\S](?!$)/g;if(!_[_0x60b4('0x12d')](_0x137907))return;for(var _0x5a270c in _0x137907){if(_[_0x60b4('0x12e')](_0x137907[_0x5a270c])){for(var _0x35bca8=0x0;_0x35bca8<_0x137907[_0x5a270c][_0x60b4('0x12f')];_0x35bca8++){maskSensitiveData(_0x137907[_0x5a270c][_0x35bca8]);}}else if(_[_0x60b4('0x12d')](_0x137907[_0x5a270c])){maskSensitiveData(_0x137907[_0x5a270c]);}else if(_[_0x60b4('0x130')](_0x137907[_0x5a270c])){_0x137907[_0x5a270c]=_0x137907[_0x5a270c][_0x60b4('0x131')](/{{{/g,_0x60b4('0x132'))[_0x60b4('0x131')](/}}}/g,'}@@')[_0x60b4('0x131')](/{{/g,'@{')[_0x60b4('0x131')](/}}/g,'}@');if(_[_0x60b4('0x133')](sensitiveFields,_0x5a270c)){_0x137907[_0x5a270c]=_0x137907[_0x5a270c][_0x60b4('0x131')](_0x3ca649,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index f7ed002..612df18 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49f9=['../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/trigger/trigger.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/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/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x49f9,0x1b2));var _0x949f=function(_0x55f380,_0x3e27f0){_0x55f380=_0x55f380-0x0;var _0x36b38e=_0x49f9[_0x55f380];return _0x36b38e;};'use strict';var jayson=require(_0x949f('0x0'));var BPromise=require('bluebird');var _=require(_0x949f('0x1'));var config=require(_0x949f('0x2'));exports[_0x949f('0x3')]=function(){return new BPromise(function(_0x25ad80,_0x55b96e){var _0x4cbc15={};_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x4')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x6')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x7')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x8')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x9')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0xa')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0xb')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0xc')));_0x4cbc15=_['merge'](_0x4cbc15,require('../api/memberReport/memberReport.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/trunk/trunk.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0xd')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0xe')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0xf')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x10')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x11')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x12')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x13')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x14')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x15')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x16')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x17')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x18')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x19')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x1a')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x1b')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x1c')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x1d')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/smsMessage/smsMessage.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x1e')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x1f')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x20')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x21')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x22')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x23')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x24')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/chatQueue/chatQueue.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x25')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x26')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x27')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x28')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x29')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x2a')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/interval/interval.rpc'));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x2b')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x2c')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x2d')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x2e')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x2f')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x30')));_0x4cbc15=_['merge'](_0x4cbc15,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x31')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x32')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x33')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x34')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x35')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x36')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x37')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x38')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x39')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x3a')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x3b')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/setting/setting.rpc'));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x3c')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x3d')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x3e')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x3f')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x40')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x41')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x42')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require(_0x949f('0x43')));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x44')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x4cbc15=_['merge'](_0x4cbc15,require(_0x949f('0x45')));_0x4cbc15=_[_0x949f('0x5')](_0x4cbc15,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x56650a=jayson[_0x949f('0x46')](_0x4cbc15)[_0x949f('0x47')]();var _0x4a84f8=config[_0x949f('0x48')][_0x949f('0x49')]||config[_0x949f('0x49')]+0x1;var _0x15916d=config[_0x949f('0x48')]['ip']||_0x949f('0x4a');_0x56650a['on']('error',function(_0x135822){return _0x55b96e(_0x135822);});_0x56650a[_0x949f('0x3')](_0x4a84f8,_0x15916d,function(){console[_0x949f('0x4b')](_0x949f('0x4c'),_0x15916d,_0x4a84f8);require('../config/triggers')[_0x949f('0x4d')]();return _0x25ad80(_0x949f('0x4e')+_0x15916d+':'+_0x4a84f8);});});}; \ No newline at end of file +var _0x374b=['../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','localhost','error','listen','log','../config/triggers','default','bluebird','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0xadaf72,_0x190c5e){var _0x3c9164=function(_0x1f56fd){while(--_0x1f56fd){_0xadaf72['push'](_0xadaf72['shift']());}};_0x3c9164(++_0x190c5e);}(_0x374b,0x188));var _0xb374=function(_0x54c529,_0x26e7a8){_0x54c529=_0x54c529-0x0;var _0x4a8a05=_0x374b[_0x54c529];return _0x4a8a05;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb374('0x0'));var _=require(_0xb374('0x1'));var config=require(_0xb374('0x2'));exports['listen']=function(){return new BPromise(function(_0x29abfa,_0x2e748b){var _0x199e4b={};_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x3')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x5')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/voiceQueue/voiceQueue.rpc'));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x6')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x7')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x8')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x9')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xa')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xb')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xc')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xd')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xe')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0xf')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x10')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x11')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x12')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x13')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x14')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x15')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x16')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/faxApplication/faxApplication.rpc'));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x17')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x18')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/faxQueue/faxQueue.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x19')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1a')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1b')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1c')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1d')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1e')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x1f')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x20')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x21')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x22')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x23')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/chatQueue/chatQueue.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x24')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x25')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x199e4b=_['merge'](_0x199e4b,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x26')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x27')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x28')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x29')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2a')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2b')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2c')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2d')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2e')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x2f')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x30')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x31')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x32')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x33')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x199e4b=_['merge'](_0x199e4b,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x34')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x35')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x36')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x37')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/squareOdbc/squareOdbc.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/squareProject/squareProject.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x38')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x39')));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x3a')));_0x199e4b=_['merge'](_0x199e4b,require('../api/attachment/attachment.rpc'));_0x199e4b=_['merge'](_0x199e4b,require(_0xb374('0x3b')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x3c')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x3d')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x3e')));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x199e4b=_[_0xb374('0x4')](_0x199e4b,require(_0xb374('0x3f')));var _0x5a5d30=jayson['server'](_0x199e4b)['http']();var _0x1a9b3c=config[_0xb374('0x40')][_0xb374('0x41')]||config[_0xb374('0x41')]+0x1;var _0x42dcd9=config['rpc']['ip']||_0xb374('0x42');_0x5a5d30['on'](_0xb374('0x43'),function(_0xf2c019){return _0x2e748b(_0xf2c019);});_0x5a5d30[_0xb374('0x44')](_0x1a9b3c,_0x42dcd9,function(){console[_0xb374('0x45')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x42dcd9,_0x1a9b3c);require(_0xb374('0x46'))[_0xb374('0x47')]();return _0x29abfa('RPC\x20listening\x20on\x20'+_0x42dcd9+':'+_0x1a9b3c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 56c66cb..640c6be 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 _0xa613=['replace','result=','indexOf','substr','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','label','exports','util','events','EventEmitter','./reply','./error','call','utf8','setTimeout','headers','emit','line','hangup','substring','search','520\x20End\x20of\x20proper','function'];(function(_0x5c8533,_0x312262){var _0x4e439a=function(_0x387c5b){while(--_0x387c5b){_0x5c8533['push'](_0x5c8533['shift']());}};_0x4e439a(++_0x312262);}(_0xa613,0x8a));var _0x3a61=function(_0x2d138a,_0x38524c){_0x2d138a=_0x2d138a-0x0;var _0x1c13e9=_0xa613[_0x2d138a];return _0x1c13e9;};'use strict';var util=require(_0x3a61('0x0'));var _=require('lodash');var EventEmitter=require(_0x3a61('0x1'))[_0x3a61('0x2')];var AGIReply=require(_0x3a61('0x3'));var AGIError=require(_0x3a61('0x4'));function AGIChannel(_0x38730f){var _0x322b07=this,_0x13ec14=new AGIReply(),_0x2a957f=![],_0x117c38={};EventEmitter[_0x3a61('0x5')](_0x322b07);_0x38730f['setEncoding'](_0x3a61('0x6'));_0x38730f[_0x3a61('0x7')](0x8*0x3c*0x3c*0x3e8);_0x13ec14['setEncoding'](_0x3a61('0x6'));_0x13ec14['on'](_0x3a61('0x8'),function(_0x3c7bdd){for(var _0x3040dd in _0x3c7bdd){_0x322b07[_0x3040dd]=_0x3c7bdd[_0x3040dd];}_0x322b07[_0x3a61('0x9')]('ready');});_0x13ec14['on'](_0x3a61('0xa'),function(_0x357242){if(_0x357242['toLowerCase']()=='hangup'){_0x322b07['emit'](_0x3a61('0xb'));return;}if(_0x357242[_0x3a61('0xc')](0x0,0xb)=='520-Invalid'){_0x2a957f=!![];}if(_0x2a957f){_0x117c38['rx']+=_0x357242+'\x0a';if(_0x357242[_0x3a61('0xd')](_0x3a61('0xe'))!=-0x1){_0x2a957f=![];}}else{_0x117c38['rx']=_0x357242;}if(_0x2a957f){return;}if(typeof _0x117c38['cb']==_0x3a61('0xf')){var _0xb3983d=_0x117c38['rx']['substring'](0x0,0x3),_0x3d8742=null,_0x1323eb=null;_0xb3983d=parseInt(_0xb3983d);if(isNaN(_0xb3983d)){_0x117c38['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xb3983d!=0xc8){_0x117c38['cb'](null,{'code':_0xb3983d,'result':-0x1,'extra':'KO'});return;}_0x3d8742=_0x117c38['rx'][_0x3a61('0xc')](0x4)[_0x3a61('0x10')](_0x3a61('0x11'),'');if(_0x3d8742[_0x3a61('0x12')]('\x20')!=-0x1){_0x3d8742=_0x3d8742[_0x3a61('0x13')](0x0,_0x3d8742['indexOf']('\x20'));}if(_['startsWith'](_0x3d8742,'-1')){_0x3d8742=parseInt(_0x3d8742);}_0x1323eb=_0x117c38['rx'][_0x3a61('0x14')]('\x20');if(_0x1323eb['length']==0x3){_0x1323eb=_0x1323eb[0x2][_0x3a61('0xc')](0x1,_0x1323eb[0x2]['length']-0x1);}else if(_0x1323eb[_0x3a61('0x15')]>0x3){var _0x29d99a=/\((.+)\)/;var _0x4e0ed7=_0x117c38['rx'][_0x3a61('0x16')](_0x29d99a);if(_0x4e0ed7){_0x1323eb=_0x4e0ed7[0x1];}else{_0x1323eb=null;}}else{_0x1323eb=null;}_0x117c38['cb'](null,{'code':_0xb3983d,'result':_0x3d8742,'extra':_0x1323eb});}});_0x38730f['on']('error',function(_0x24e4e6){_0x322b07['emit'](_0x3a61('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x24e4e6[_0x3a61('0x18')]));});_0x38730f['on'](_0x3a61('0x19'),function(){_0x322b07[_0x3a61('0x9')](_0x3a61('0x19'),new AGIError(_0x3a61('0x1a')));});_0x38730f['on'](_0x3a61('0x1b'),function(){_0x322b07[_0x3a61('0x9')](_0x3a61('0x1b'),new AGIError(_0x3a61('0x1c')));_0x38730f[_0x3a61('0x1d')]();});_0x38730f[_0x3a61('0x1e')](_0x13ec14);this[_0x3a61('0x1f')]=function(_0x466852,_0x188aaa){var _0x466852=_0x466852||'',_0x188aaa=typeof _0x188aaa==_0x3a61('0xf')?_0x188aaa:new Function();_0x117c38={'tx':_0x466852,'rx':'','cb':_0x188aaa};_0x38730f[_0x3a61('0x20')](_0x466852+'\x0a');},this[_0x3a61('0x19')]=function(){_0x38730f[_0x3a61('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x3a61('0x21')]['sendRequest']=function(_0x218620){return this[_0x3a61('0x1f')][_0x3a61('0x22')](this,_0x218620);};AGIChannel[_0x3a61('0x21')][_0x3a61('0x23')]=function(){return this[_0x3a61('0x24')](_0x3a61('0x25'));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x26')]=function(_0x1e33f3,_0x3ff98f,_0x44b88b){_0x1e33f3=_0x1e33f3===undefined?_0x3a61('0x27'):_0x1e33f3;_0x3ff98f=_0x3ff98f===undefined?'5':_0x3ff98f;_0x44b88b=_0x44b88b===undefined?'1':_0x44b88b;return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x29'),_0x1e33f3,_0x3ff98f*0x3e8,_0x44b88b));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x2a')]=function(_0x3f00b8){_0x3f00b8=_0x3f00b8||_0x3a61('0x2b');return this['sendRequest'](util[_0x3a61('0x28')](_0x3a61('0x2c'),_0x3f00b8));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x2d')]=function(_0xb7ba6f,_0x42499f){if(_[_0x3a61('0x2e')](_0x42499f)){return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x2f'),_0xb7ba6f,_0x42499f[_0x3a61('0x30')](',')));}return this[_0x3a61('0x24')](util['format'](_0x3a61('0x2f'),_0xb7ba6f,_0x42499f));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x31')]=function(_0x9317a8){return this[_0x3a61('0x24')](util['format'](_0x3a61('0x32'),_0x9317a8));};AGIChannel['prototype'][_0x3a61('0x33')]=function(_0x43936a){return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x34'),_0x43936a));};AGIChannel['prototype'][_0x3a61('0x35')]=function(_0x5988f4){return this[_0x3a61('0x24')](util[_0x3a61('0x28')]('SET\x20PRIORITY\x20%s',_0x5988f4));};AGIChannel[_0x3a61('0x21')][_0x3a61('0xb')]=function(){return this[_0x3a61('0x24')]('HANGUP');};AGIChannel[_0x3a61('0x21')][_0x3a61('0x36')]=function(_0x15b5e0,_0x2485e4){var _0x1cfea8=_[_0x3a61('0x37')](_0x2485e4)||_[_0x3a61('0x38')](_0x2485e4)?_0x2485e4[_0x3a61('0x39')]():_0x2485e4;return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x3a'),_0x15b5e0,_0x1cfea8?_0x1cfea8['toString']()[_0x3a61('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3a61('0x21')]['sayNumber']=function(_0x3bd4d7,_0x5ea89a){return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x3b'),_0x3bd4d7,_0x5ea89a));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x3c')]=function(_0x202fc6,_0x2d3593){return this[_0x3a61('0x24')](util[_0x3a61('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x202fc6,_0x2d3593));};AGIChannel['prototype']['sayPhonetic']=function(_0x1e2e3f,_0x298468){return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x3d'),_0x1e2e3f,_0x298468));};AGIChannel['prototype'][_0x3a61('0x3e')]=function(_0x1a6e00,_0x45991a,_0x5b1ba8){_0x45991a=_0x45991a||this[_0x3a61('0x3f')];_0x5b1ba8=_0x5b1ba8||0x1;this[_0x3a61('0x31')](_0x1a6e00);this[_0x3a61('0x33')](_0x45991a);this[_0x3a61('0x35')](_0x5b1ba8);return this[_0x3a61('0x2a')](util['format'](_0x3a61('0x40'),_0x1a6e00,_0x45991a,_0x5b1ba8));};AGIChannel['prototype'][_0x3a61('0x41')]=function(_0x51fcda){return this[_0x3a61('0x24')](util[_0x3a61('0x28')](_0x3a61('0x42'),_0x51fcda));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x43')]=function(_0x2c42fd,_0x290e82,_0x587304,_0x36c0dc,_0x2d9633,_0x4d3041){_0x290e82=_0x290e82||_0x3a61('0x44');_0x587304=_0x587304||'';_0x36c0dc=_0x36c0dc===undefined?-0x1:_0x36c0dc==='-1'?-0x1:_0x36c0dc*0x3e8;_0x2d9633=_0x2d9633===undefined?'':'s='+_0x2d9633;_0x4d3041=_0x4d3041?'BEEP':'';return this[_0x3a61('0x24')](util['format'](_0x3a61('0x45'),_0x2c42fd,_0x290e82,_0x587304,_0x36c0dc,_0x4d3041,_0x2d9633));};AGIChannel[_0x3a61('0x21')][_0x3a61('0x46')]=function(_0x27e931,_0x82c877){_0x82c877=_0x82c877||'';return this['sendRequest'](util['format'](_0x3a61('0x47'),_0x27e931,_0x82c877));};AGIChannel['prototype'][_0x3a61('0x48')]=function(_0x40c6b4){return this[_0x3a61('0x2d')](_0x3a61('0x49'),_0x40c6b4);};AGIChannel[_0x3a61('0x21')]['wait']=function(_0x3f1cf6){return this[_0x3a61('0x2d')](_0x3a61('0x4a'),_0x3f1cf6);};AGIChannel[_0x3a61('0x21')][_0x3a61('0x17')]=function(_0x40aab3,_0x27fbe2){this[_0x3a61('0x2a')](util[_0x3a61('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x40aab3['id'],_0x40aab3[_0x3a61('0x4b')],_0x27fbe2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3a61('0x4c')]=AGIChannel; \ No newline at end of file +var _0xf588=['no\x20code','result=','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','sendRequest','sync','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','call','setEncoding','utf8','ready','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function'];(function(_0x113324,_0x273ee0){var _0x29604d=function(_0x45feab){while(--_0x45feab){_0x113324['push'](_0x113324['shift']());}};_0x29604d(++_0x273ee0);}(_0xf588,0x1ad));var _0x8f58=function(_0x4273a7,_0x54e119){_0x4273a7=_0x4273a7-0x0;var _0x10ae62=_0xf588[_0x4273a7];return _0x10ae62;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x8f58('0x0'))[_0x8f58('0x1')];var AGIReply=require(_0x8f58('0x2'));var AGIError=require(_0x8f58('0x3'));function AGIChannel(_0x2ce0c0){var _0x4b87d7=this,_0x3ad607=new AGIReply(),_0xbd02cd=![],_0x2f51c4={};EventEmitter[_0x8f58('0x4')](_0x4b87d7);_0x2ce0c0[_0x8f58('0x5')](_0x8f58('0x6'));_0x2ce0c0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3ad607[_0x8f58('0x5')](_0x8f58('0x6'));_0x3ad607['on']('headers',function(_0x85448){for(var _0x32e4f0 in _0x85448){_0x4b87d7[_0x32e4f0]=_0x85448[_0x32e4f0];}_0x4b87d7['emit'](_0x8f58('0x7'));});_0x3ad607['on']('line',function(_0x1a2255){if(_0x1a2255['toLowerCase']()==_0x8f58('0x8')){_0x4b87d7[_0x8f58('0x9')]('hangup');return;}if(_0x1a2255[_0x8f58('0xa')](0x0,0xb)==_0x8f58('0xb')){_0xbd02cd=!![];}if(_0xbd02cd){_0x2f51c4['rx']+=_0x1a2255+'\x0a';if(_0x1a2255[_0x8f58('0xc')](_0x8f58('0xd'))!=-0x1){_0xbd02cd=![];}}else{_0x2f51c4['rx']=_0x1a2255;}if(_0xbd02cd){return;}if(typeof _0x2f51c4['cb']==_0x8f58('0xe')){var _0x360125=_0x2f51c4['rx'][_0x8f58('0xa')](0x0,0x3),_0x184152=null,_0x1c5bf8=null;_0x360125=parseInt(_0x360125);if(isNaN(_0x360125)){_0x2f51c4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8f58('0xf')});return;}if(_0x360125!=0xc8){_0x2f51c4['cb'](null,{'code':_0x360125,'result':-0x1,'extra':'KO'});return;}_0x184152=_0x2f51c4['rx'][_0x8f58('0xa')](0x4)['replace'](_0x8f58('0x10'),'');if(_0x184152[_0x8f58('0x11')]('\x20')!=-0x1){_0x184152=_0x184152['substr'](0x0,_0x184152[_0x8f58('0x11')]('\x20'));}if(_['startsWith'](_0x184152,'-1')){_0x184152=parseInt(_0x184152);}_0x1c5bf8=_0x2f51c4['rx'][_0x8f58('0x12')]('\x20');if(_0x1c5bf8[_0x8f58('0x13')]==0x3){_0x1c5bf8=_0x1c5bf8[0x2][_0x8f58('0xa')](0x1,_0x1c5bf8[0x2]['length']-0x1);}else if(_0x1c5bf8[_0x8f58('0x13')]>0x3){var _0x2dcbca=/\((.+)\)/;var _0x19f2c6=_0x2f51c4['rx'][_0x8f58('0x14')](_0x2dcbca);if(_0x19f2c6){_0x1c5bf8=_0x19f2c6[0x1];}else{_0x1c5bf8=null;}}else{_0x1c5bf8=null;}_0x2f51c4['cb'](null,{'code':_0x360125,'result':_0x184152,'extra':_0x1c5bf8});}});_0x2ce0c0['on'](_0x8f58('0x15'),function(_0x99d326){_0x4b87d7[_0x8f58('0x9')]('error',new AGIError(_0x8f58('0x16'),_0x99d326[_0x8f58('0x17')]));});_0x2ce0c0['on'](_0x8f58('0x18'),function(){_0x4b87d7[_0x8f58('0x9')]('close',new AGIError(_0x8f58('0x19')));});_0x2ce0c0['on'](_0x8f58('0x1a'),function(){_0x4b87d7[_0x8f58('0x9')](_0x8f58('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2ce0c0['destroy']();});_0x2ce0c0[_0x8f58('0x1b')](_0x3ad607);this[_0x8f58('0x1c')]=function(_0x14e133,_0x3face0){var _0x14e133=_0x14e133||'',_0x3face0=typeof _0x3face0==_0x8f58('0xe')?_0x3face0:new Function();_0x2f51c4={'tx':_0x14e133,'rx':'','cb':_0x3face0};_0x2ce0c0[_0x8f58('0x1d')](_0x14e133+'\x0a');},this['close']=function(){_0x2ce0c0['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x8f58('0x1e')]=function(_0x563dab){return this[_0x8f58('0x1c')][_0x8f58('0x1f')](this,_0x563dab);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x21')]=function(){return this[_0x8f58('0x1e')](_0x8f58('0x22'));};AGIChannel[_0x8f58('0x20')]['getData']=function(_0x21a232,_0x54da03,_0x571111){_0x21a232=_0x21a232===undefined?_0x8f58('0x23'):_0x21a232;_0x54da03=_0x54da03===undefined?'5':_0x54da03;_0x571111=_0x571111===undefined?'1':_0x571111;return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x25'),_0x21a232,_0x54da03*0x3e8,_0x571111));};AGIChannel['prototype']['noop']=function(_0x836f81){_0x836f81=_0x836f81||'NO\x20MESSAGE';return this[_0x8f58('0x1e')](util[_0x8f58('0x24')]('VERBOSE\x20\x22%s\x22',_0x836f81));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x26')]=function(_0x2e06f1,_0xdb45aa){if(_[_0x8f58('0x27')](_0xdb45aa)){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x28'),_0x2e06f1,_0xdb45aa[_0x8f58('0x29')](',')));}return this['sendRequest'](util[_0x8f58('0x24')]('EXEC\x20%s\x20%s',_0x2e06f1,_0xdb45aa));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x2a')]=function(_0x3f6680){return this[_0x8f58('0x1e')](util['format'](_0x8f58('0x2b'),_0x3f6680));};AGIChannel['prototype'][_0x8f58('0x2c')]=function(_0x1f5a57){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x2d'),_0x1f5a57));};AGIChannel['prototype'][_0x8f58('0x2e')]=function(_0x86d0bc){return this[_0x8f58('0x1e')](util['format'](_0x8f58('0x2f'),_0x86d0bc));};AGIChannel['prototype'][_0x8f58('0x8')]=function(){return this[_0x8f58('0x1e')](_0x8f58('0x30'));};AGIChannel['prototype']['setVariable']=function(_0x5b6616,_0x1b7463){var _0x11fbfc=_[_0x8f58('0x31')](_0x1b7463)||_[_0x8f58('0x32')](_0x1b7463)?_0x1b7463[_0x8f58('0x33')]():_0x1b7463;return this[_0x8f58('0x1e')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5b6616,_0x11fbfc?_0x11fbfc[_0x8f58('0x33')]()[_0x8f58('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x8f58('0x35')]=function(_0x53f29f,_0x488f8c){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x36'),_0x53f29f,_0x488f8c));};AGIChannel[_0x8f58('0x20')]['sayDigits']=function(_0xe31b68,_0x88fa53){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x37'),_0xe31b68,_0x88fa53));};AGIChannel['prototype'][_0x8f58('0x38')]=function(_0x10c426,_0x4440d2){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x39'),_0x10c426,_0x4440d2));};AGIChannel['prototype'][_0x8f58('0x3a')]=function(_0x4c91a3,_0x4a1b1d,_0x35e06c){_0x4a1b1d=_0x4a1b1d||this[_0x8f58('0x3b')];_0x35e06c=_0x35e06c||0x1;this[_0x8f58('0x2a')](_0x4c91a3);this[_0x8f58('0x2c')](_0x4a1b1d);this[_0x8f58('0x2e')](_0x35e06c);return this[_0x8f58('0x3c')](util[_0x8f58('0x24')](_0x8f58('0x3d'),_0x4c91a3,_0x4a1b1d,_0x35e06c));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x3e')]=function(_0x572233){return this[_0x8f58('0x1e')](util[_0x8f58('0x24')](_0x8f58('0x3f'),_0x572233));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x40')]=function(_0x1558ac,_0x5cf3f7,_0x3d5062,_0x3ac576,_0x408e43,_0x2909b4){_0x5cf3f7=_0x5cf3f7||'wav';_0x3d5062=_0x3d5062||'';_0x3ac576=_0x3ac576===undefined?-0x1:_0x3ac576==='-1'?-0x1:_0x3ac576*0x3e8;_0x408e43=_0x408e43===undefined?'':'s='+_0x408e43;_0x2909b4=_0x2909b4?_0x8f58('0x41'):'';return this[_0x8f58('0x1e')](util[_0x8f58('0x24')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1558ac,_0x5cf3f7,_0x3d5062,_0x3ac576,_0x2909b4,_0x408e43));};AGIChannel[_0x8f58('0x20')]['streamFile']=function(_0x23665b,_0x201543){_0x201543=_0x201543||'';return this['sendRequest'](util[_0x8f58('0x24')](_0x8f58('0x42'),_0x23665b,_0x201543));};AGIChannel[_0x8f58('0x20')][_0x8f58('0x43')]=function(_0x402374){return this[_0x8f58('0x26')](_0x8f58('0x44'),_0x402374);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x45')]=function(_0x7be8fe){return this[_0x8f58('0x26')](_0x8f58('0x46'),_0x7be8fe);};AGIChannel[_0x8f58('0x20')][_0x8f58('0x15')]=function(_0x5c7290,_0x2fd065){this[_0x8f58('0x3c')](util[_0x8f58('0x24')](_0x8f58('0x47'),_0x5c7290['id'],_0x5c7290[_0x8f58('0x48')],_0x2fd065));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8f58('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9e3475b..836eab8 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 _0x6515=['apply','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x490bc7,_0x2b231d){var _0x232f23=function(_0x382014){while(--_0x382014){_0x490bc7['push'](_0x490bc7['shift']());}};_0x232f23(++_0x2b231d);}(_0x6515,0x120));var _0x5651=function(_0x1ca120,_0x29e05c){_0x1ca120=_0x1ca120-0x0;var _0x25bc08=_0x6515[_0x1ca120];return _0x25bc08;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5651('0x0'),'E_AGI_ARGUMENT_PORT':_0x5651('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5651('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x5651('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5651('0x4'),'E_AGI_SOCKET_CLOSE':_0x5651('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x5651('0x6'),'E_AGI_COMMAND_EMPTY':_0x5651('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5651('0x8'),'E_AGI_IVR_ENTRY':_0x5651('0x9')};function AGIError(_0x28ed25){var _0x28ed25=_0x28ed25||null,_0x52d073=_0x52d073||[],_0x24125a=0x1,_0x3ae1bc='';if(!error[_0x28ed25]){_0x28ed25=_0x5651('0xa');}_0x52d073[_0x5651('0xb')](error[_0x28ed25]);while(arguments[_0x24125a]){_0x52d073['push'](arguments[_0x24125a]);_0x24125a++;}_0x3ae1bc=util['format'][_0x5651('0xc')](util,_0x52d073);this[_0x5651('0xd')]=_0x3ae1bc;this[_0x5651('0xe')]=_0x28ed25;}module['exports']=AGIError; \ No newline at end of file +var _0x340a=['E_AGI_UNDEFINED','format','apply','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x4f8566,_0xcba619){var _0x46ad0f=function(_0xd8b75b){while(--_0xd8b75b){_0x4f8566['push'](_0x4f8566['shift']());}};_0x46ad0f(++_0xcba619);}(_0x340a,0x9e));var _0xa340=function(_0x264a9c,_0xeb055b){_0x264a9c=_0x264a9c-0x0;var _0x2b5a50=_0x340a[_0x264a9c];return _0x2b5a50;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xa340('0x0'),'E_AGI_ARGUMENT_PORT':_0xa340('0x1'),'E_AGI_SERVER_ERROR':_0xa340('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xa340('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xa340('0x4'),'E_AGI_SOCKET_ERROR':_0xa340('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa340('0x6'),'E_AGI_COMMAND_EMPTY':_0xa340('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa340('0x8'),'E_AGI_IVR_ENTRY':_0xa340('0x9')};function AGIError(_0x4255c4){var _0x4255c4=_0x4255c4||null,_0x4122f0=_0x4122f0||[],_0x3a0ac3=0x1,_0x362a32='';if(!error[_0x4255c4]){_0x4255c4=_0xa340('0xa');}_0x4122f0['push'](error[_0x4255c4]);while(arguments[_0x3a0ac3]){_0x4122f0['push'](arguments[_0x3a0ac3]);_0x3a0ac3++;}_0x362a32=util[_0xa340('0xb')][_0xa340('0xc')](util,_0x4122f0);this['message']=_0x362a32;this['name']=_0x4255c4;}module[_0xa340('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index d910551..bb0c970 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 _0x4ae8=['size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push'];(function(_0x29c16c,_0x42302b){var _0x3802ae=function(_0x2ebf2b){while(--_0x2ebf2b){_0x29c16c['push'](_0x29c16c['shift']());}};_0x3802ae(++_0x42302b);}(_0x4ae8,0x1b5));var _0x84ae=function(_0x1ff32d,_0x445500){_0x1ff32d=_0x1ff32d-0x0;var _0x3d7209=_0x4ae8[_0x1ff32d];return _0x3d7209;};'use strict';var _=require(_0x84ae('0x0'));var logger=require(_0x84ae('0x1'))(_0x84ae('0x2'));var verticesWithRetry=['menu',_0x84ae('0x3'),_0x84ae('0x4')];var Graph=function(){this[_0x84ae('0x5')]={};this[_0x84ae('0x6')]={};this[_0x84ae('0x7')]=0x0;};Graph[_0x84ae('0x8')]['addVertex']=function(_0x50087f){this[_0x84ae('0x5')][_0x50087f['id']]=_0x50087f;this['edges'][_0x50087f['id']]=[];};Graph[_0x84ae('0x8')][_0x84ae('0x9')]=function(_0x4ab5e0,_0x275c24,_0x4510fc){this['edges'][_0x4ab5e0][_0x84ae('0xa')]({'target':_0x275c24,'condition':_0x4510fc});this[_0x84ae('0x7')]+=0x1;};Graph['prototype'][_0x84ae('0xb')]=function(){return _[_0x84ae('0xb')](this[_0x84ae('0x5')]);};Graph[_0x84ae('0x8')][_0x84ae('0xc')]=function(){return this[_0x84ae('0x7')];};Graph['prototype'][_0x84ae('0xd')]=function(_0x140c61){return this[_0x84ae('0x5')][_0x140c61];};Graph[_0x84ae('0x8')][_0x84ae('0xe')]=function(_0x1dde74,_0x1e5ce2){if(!this[_0x84ae('0x5')][_0x1dde74]){return logger[_0x84ae('0xf')](_0x84ae('0x10'));}var _0x172b6e=_0x1e5ce2(this[_0x84ae('0x5')][_0x1dde74]);if(!_0x172b6e){return logger[_0x84ae('0xf')](_0x84ae('0x11'));}if(this[_0x84ae('0x6')][_0x1dde74][_0x84ae('0x12')]===0x0){return logger[_0x84ae('0xf')](_0x84ae('0x13'));}for(var _0x36fb6f=0x0,_0x24185e=[],_0x40db75=![];_0x36fb6f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','traverseBFS','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./graph','./vertices','agi','127.0.0.1','error','stack','port','message','[%s]\x20%s','name','format','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','addEdge','target','value','getSquareProject','then','catch','indexOf','agi_','debug'];(function(_0x220b34,_0x953067){var _0x29fd9c=function(_0x5eef7c){while(--_0x5eef7c){_0x220b34['push'](_0x220b34['shift']());}};_0x29fd9c(++_0x953067);}(_0x6a70,0x11d));var _0x06a7=function(_0x4224a6,_0x50b634){_0x4224a6=_0x4224a6-0x0;var _0x4b9ed9=_0x6a70[_0x4224a6];return _0x4b9ed9;};'use strict';var parser=require(_0x06a7('0x0'));var _=require('lodash');var syncho=require(_0x06a7('0x1'));var util=require(_0x06a7('0x2'));var moment=require(_0x06a7('0x3'));var config=require(_0x06a7('0x4'));var logger=require(_0x06a7('0x5'))('agi');var utilLicense=require(_0x06a7('0x6'));var rpc=require(_0x06a7('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x06a7('0x8'));var Vertices=require(_0x06a7('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x06a7('0xa')]=_['defaults'](config['agi'],{'ip':_0x06a7('0xb'),'port':0x11dd});function connectionHandler(_0x14ca0e){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x14ca0e);agiHandler(_0x14ca0e);}catch(_0x3ef088){logger[_0x06a7('0xc')](_0x3ef088[_0x06a7('0xd')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x06a7('0xe')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x06a7('0xa')][_0x06a7('0xe')]));}function errorHandler(_0x292d95){if(_0x292d95&&_0x292d95['name']&&_0x292d95[_0x06a7('0xf')]){logger[_0x06a7('0xc')](util['format'](_0x06a7('0x10'),_0x292d95[_0x06a7('0x11')],_0x292d95[_0x06a7('0xf')]));}else{logger[_0x06a7('0xc')](util[_0x06a7('0x12')](_0x06a7('0x13'),_0x292d95[_0x06a7('0xd')]));}}function closeHandler(){logger[_0x06a7('0x14')](util['format'](_0x06a7('0x15'),this['arg_1'],this[_0x06a7('0x16')],this['callerid'],this[_0x06a7('0x17')],this[_0x06a7('0x18')]));try{createSquareReport(this);}catch(_0x553c52){logger[_0x06a7('0xc')](_0x553c52[_0x06a7('0xd')]);}}function timeoutHandler(){logger[_0x06a7('0x14')](util['format'](_0x06a7('0x19'),this[_0x06a7('0x1a')],this[_0x06a7('0x16')],this['callerid'],this[_0x06a7('0x17')],this[_0x06a7('0x18')]));}function hangupHandler(){logger[_0x06a7('0x14')](util[_0x06a7('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x06a7('0x1a')],this[_0x06a7('0x16')],this[_0x06a7('0x1b')],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x407ae5){return parser[_0x06a7('0x1c')](_0x407ae5,{'object':!![]})['mxGraphModel'][_0x06a7('0x1d')];}function addVertex(_0x2f1b60,_0x9bf273,_0x27002c){_0x9bf273[_0x06a7('0x1e')]=_0x27002c;if(_0x9bf273[_0x06a7('0x1f')](_0x06a7('0x20'))){_0x9bf273[_0x06a7('0x21')]=parseInt(_0x9bf273[_0x06a7('0x20')],0xa);}_0x2f1b60[_0x06a7('0x22')](_['omit'](_0x9bf273,'mxCell'));}function initGraph(_0x1fb28f,_0x5a7106){var _0x500d96=new Graph();for(var _0x15fe92 in _0x1fb28f){if(_0x1fb28f[_0x06a7('0x1f')](_0x15fe92)){if(_[_0x06a7('0x23')](_0x1fb28f[_0x15fe92])){for(var _0x7e5da0=0x0;_0x7e5da0<_0x1fb28f[_0x15fe92][_0x06a7('0x24')];_0x7e5da0+=0x1){addVertex(_0x500d96,_0x1fb28f[_0x15fe92][_0x7e5da0],_0x15fe92);}}else{addVertex(_0x500d96,_0x1fb28f[_0x15fe92],_0x15fe92);}}}for(var _0x33817d=0x0;_0x33817d<_0x5a7106[_0x06a7('0x24')];_0x33817d+=0x1){if(_0x5a7106[_0x33817d][_0x06a7('0x25')]&&_0x5a7106[_0x33817d]['target']){_0x500d96[_0x06a7('0x26')](_0x5a7106[_0x33817d][_0x06a7('0x25')],_0x5a7106[_0x33817d][_0x06a7('0x27')],_0x5a7106[_0x33817d][_0x06a7('0x28')]);}}return _0x500d96;}function getSquareProject(_0xfa8001,_0x5933fb){rpc[_0x06a7('0x29')](_0xfa8001)[_0x06a7('0x2a')](function(_0x236d73){_0x5933fb(null,_0x236d73);})[_0x06a7('0x2b')](function(_0x7ee545){_0x5933fb(null,_0x7ee545);});}function createSquareReport(_0x3d7518,_0x1abfad){rpc['createSquareReport'](_0x3d7518)[_0x06a7('0x2a')](function(_0x2952ba){if(_0x1abfad){_0x1abfad(null,_0x2952ba);}})[_0x06a7('0x2b')](function(_0x4f3c7c){if(_0x1abfad){_0x1abfad(null,_0x4f3c7c);}});}function setChannelVariables(_0x96721a){for(var _0x178de1 in _0x96721a){if(_0x96721a[_0x06a7('0x1f')](_0x178de1)){if(_0x178de1[_0x06a7('0x2c')](_0x06a7('0x2d'))===0x0){_0x96721a[_0x178de1['substring'](0x4)]=_0x96721a[_0x178de1];delete _0x96721a[_0x178de1];}}}}function getLogFromObject(_0x2b4ff9){return util['inspect'](_0x2b4ff9,{'showHidden':![],'depth':null});}function agiHandler(_0x25efc1){var _0xbcfd86,_0x268280,_0x254efe,_0x2069a9,_0xe49690;logger[_0x06a7('0x2e')](_0x06a7('0x2f'),JSON[_0x06a7('0x30')](_0x25efc1,null,0x2));logger[_0x06a7('0x14')](util[_0x06a7('0x12')](_0x06a7('0x31'),_0x25efc1[_0x06a7('0x1a')],_0x25efc1['calleridname'],_0x25efc1[_0x06a7('0x1b')],_0x25efc1[_0x06a7('0x17')],_0x25efc1[_0x06a7('0x18')]));_0x25efc1['on'](_0x06a7('0xc'),errorHandler);_0x25efc1['on'](_0x06a7('0x32'),closeHandler);_0x25efc1['on'](_0x06a7('0x33'),timeoutHandler);_0x25efc1[_0x06a7('0x34')]=![];_0x25efc1['on']('hangup',hangupHandler);var _0x379f4f=getSquareProject[_0x06a7('0x35')](null,_0x25efc1[_0x06a7('0x1a')]);if(_0x379f4f){if(_0x379f4f[_0x06a7('0x36')]){_0xbcfd86=getRoot(_0x379f4f['production']);if(_0xbcfd86&&_0xbcfd86[_0x06a7('0x37')]){logger[_0x06a7('0x2e')](_0x06a7('0x1d'),JSON['stringify'](_0xbcfd86,null,0x2));_0x25efc1['joinAt']=moment()[_0x06a7('0x12')](_0x06a7('0x38'));_0x268280=initGraph(_['omit'](_0xbcfd86,_0x06a7('0x39')),_0xbcfd86[_0x06a7('0x39')]);_0x254efe=new Vertices(_0x25efc1,rpc,mailRpc);logger[_0x06a7('0x14')](util[_0x06a7('0x12')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x25efc1[_0x06a7('0x1a')],_0x25efc1['calleridname'],_0x25efc1[_0x06a7('0x1b')],_0x25efc1['dnid'],_0x25efc1[_0x06a7('0x18')]));_0x268280[_0x06a7('0x3a')](_0xbcfd86[_0x06a7('0x37')]['id'],function(_0x4c3216){try{_0x4c3216=_0x254efe['clear'](_0x4c3216);logger[_0x06a7('0x2e')](_0x06a7('0x3b'),JSON[_0x06a7('0x30')](_0x4c3216,null,0x2));if(_0x4c3216['agicommand']==='gotoc'){logger['info'](_0x06a7('0x3c'));_0x25efc1[_0x06a7('0x3d')]=_0x4c3216['context']||_0x25efc1[_0x06a7('0x3d')];_0x25efc1[_0x06a7('0x3e')]=_0x4c3216[_0x06a7('0x3e')];_0x25efc1[_0x06a7('0x3f')]=_0x4c3216['priority']?_0x4c3216[_0x06a7('0x3f')]-0x1:0x1;return null;}else if(_0x4c3216&&_0x254efe[_0x4c3216[_0x06a7('0x1e')]]){_0xe49690=_0x254efe[_0x4c3216[_0x06a7('0x1e')]](_0x4c3216);logger[_0x06a7('0x14')](_0x06a7('0x40'),JSON[_0x06a7('0x30')](_0xe49690,null,0x2));if(_0xe49690&&_0xe49690[_0x06a7('0x41')]===AGI_CODE_SUCCESS&&_0xe49690[_0x06a7('0x42')]!==AGI_RESULT_ERROR&&!_0x25efc1[_0x06a7('0x34')]){logger[_0x06a7('0x2e')](_0x06a7('0x40'),getLogFromObject(_0xe49690));return _['isUndefined'](_0xe49690[_0x06a7('0x42')])?null:_0xe49690[_0x06a7('0x42')][_0x06a7('0x43')]();}else{logger[_0x06a7('0xc')]('response',getLogFromObject(_0xe49690));return null;}}else{logger[_0x06a7('0xc')](_0x06a7('0x44'));return null;}}catch(_0x28d88b){logger['error'](_0x28d88b[_0x06a7('0xd')]);return null;}});if(_0xbcfd86[_0x06a7('0x45')]){logger[_0x06a7('0x14')](util['format'](_0x06a7('0x46'),_0x25efc1[_0x06a7('0x1a')],_0x25efc1[_0x06a7('0x16')],_0x25efc1[_0x06a7('0x1b')],_0x25efc1[_0x06a7('0x17')],_0x25efc1['uniqueid']));_0x268280['traverseBFS'](_0xbcfd86[_0x06a7('0x45')]['id'],function(_0x16dc99){try{_0x16dc99=_0x254efe[_0x06a7('0x47')](_0x16dc99);logger[_0x06a7('0x2e')](_0x06a7('0x3b'),JSON[_0x06a7('0x30')](_0x16dc99,null,0x2));if(_0x16dc99&&_0x254efe[_0x16dc99[_0x06a7('0x1e')]]){_0xe49690=_0x254efe[_0x16dc99['agicommand']](_0x16dc99);if(_0xe49690){logger['debug']('response',getLogFromObject(_0xe49690));return _[_0x06a7('0x48')](_0xe49690[_0x06a7('0x42')])?null:_0xe49690[_0x06a7('0x42')]['toString']();}else{logger[_0x06a7('0xc')](_0x06a7('0x40'),getLogFromObject(_0xe49690));return null;}}else{logger[_0x06a7('0xc')](_0x06a7('0x44'));return null;}}catch(_0x155bef){logger[_0x06a7('0xc')](_0x155bef['stack']);return null;}});}logger[_0x06a7('0x14')](util[_0x06a7('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x25efc1['arg_1'],_0x25efc1[_0x06a7('0x16')],_0x25efc1['callerid'],_0x25efc1[_0x06a7('0x17')],_0x25efc1['uniqueid']));logger[_0x06a7('0x14')](util[_0x06a7('0x12')](_0x06a7('0x49'),_0x25efc1['context'],_0x25efc1[_0x06a7('0x3e')],parseInt(_0x25efc1[_0x06a7('0x3f')],0xa)+0x1));_0x25efc1[_0x06a7('0x4a')](_0x25efc1[_0x06a7('0x3d')],_0x25efc1['extension'],parseInt(_0x25efc1[_0x06a7('0x3f')],0xa)+0x1);_0x25efc1[_0x06a7('0x32')]();}}else{logger[_0x06a7('0xc')](util[_0x06a7('0x12')](_0x06a7('0x4b'),_0x25efc1[_0x06a7('0x1a')]));_0x25efc1[_0x06a7('0x4a')](_0x25efc1[_0x06a7('0x3d')],_0x25efc1['extension'],parseInt(_0x25efc1[_0x06a7('0x3f')],0xa)+0x1);_0x25efc1['close']();}}else{logger[_0x06a7('0xc')](util['format'](_0x06a7('0x4c'),_0x25efc1[_0x06a7('0x1a')]));_0x25efc1[_0x06a7('0x4a')](_0x25efc1[_0x06a7('0x3d')],_0x25efc1[_0x06a7('0x3e')],parseInt(_0x25efc1[_0x06a7('0x3f')],0xa)+0x1);_0x25efc1[_0x06a7('0x32')]();}}function main(){var _0x590002;return utilLicense[_0x06a7('0x4d')]()[_0x06a7('0x2a')](function(_0x370885){if(_0x370885){if(_0x370885['voice']){if(_0x370885[_0x06a7('0x4e')]&&_0x370885[_0x06a7('0x4e')]>0x0){logger[_0x06a7('0x14')](util['format'](_0x06a7('0x4f'),_0x370885[_0x06a7('0x4e')]));_0x590002=_0x370885[_0x06a7('0x4e')];}else{logger[_0x06a7('0x14')](_0x06a7('0x50'));}}else{logger['info'](_0x06a7('0x51'));_0x590002=-0x1;}}})['catch'](function(_0x1364e1){logger['error'](_0x06a7('0x52'),_0x1364e1[_0x06a7('0xd')]);})[_0x06a7('0x45')](function(){var _0x5bd978=require('./server')(config[_0x06a7('0xa')][_0x06a7('0xe')],config[_0x06a7('0xa')]['ip'],_0x590002);_0x5bd978['on']('error',errorHandler);_0x5bd978['on']('listening',listeningHandler);_0x5bd978['on']('connection',connectionHandler);_0x5bd978['on'](_0x06a7('0x32'),closeHandler);});}main(); \ No newline at end of file +var _0x522c=['arg_1','calleridname','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','value','getSquareProject','then','catch','createSquareReport','indexOf','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','extension','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','connection','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x5283f9,_0x59fd5d){var _0x5b204a=function(_0x348518){while(--_0x348518){_0x5283f9['push'](_0x5283f9['shift']());}};_0x5b204a(++_0x59fd5d);}(_0x522c,0x1e0));var _0xc522=function(_0x1ae923,_0x388aa4){_0x1ae923=_0x1ae923-0x0;var _0xb79b=_0x522c[_0x1ae923];return _0xb79b;};'use strict';var parser=require('xml2json');var _=require(_0xc522('0x0'));var syncho=require(_0xc522('0x1'));var util=require(_0xc522('0x2'));var moment=require(_0xc522('0x3'));var config=require('../../config/environment');var logger=require(_0xc522('0x4'))(_0xc522('0x5'));var utilLicense=require(_0xc522('0x6'));var rpc=require(_0xc522('0x7'));var mailRpc=require(_0xc522('0x8'));var Graph=require(_0xc522('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc522('0x5')]=_[_0xc522('0xa')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x11c83b){process[_0xc522('0xb')](function(){syncho(function(){try{setChannelVariables(_0x11c83b);agiHandler(_0x11c83b);}catch(_0x48055a){logger[_0xc522('0xc')](_0x48055a[_0xc522('0xd')]);}});});}function listeningHandler(){console[_0xc522('0xe')](_0xc522('0xf'),config['agi'][_0xc522('0x10')]);logger[_0xc522('0x11')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xc522('0x5')]['ip'],config['agi'][_0xc522('0x10')]));}function errorHandler(_0x3e8824){if(_0x3e8824&&_0x3e8824[_0xc522('0x12')]&&_0x3e8824[_0xc522('0x13')]){logger[_0xc522('0xc')](util[_0xc522('0x14')](_0xc522('0x15'),_0x3e8824[_0xc522('0x12')],_0x3e8824['message']));}else{logger['error'](util[_0xc522('0x14')](_0xc522('0x16'),_0x3e8824[_0xc522('0xd')]));}}function closeHandler(){logger[_0xc522('0x11')](util[_0xc522('0x14')](_0xc522('0x17'),this[_0xc522('0x18')],this[_0xc522('0x19')],this[_0xc522('0x1a')],this[_0xc522('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x33a00d){logger[_0xc522('0xc')](_0x33a00d[_0xc522('0xd')]);}}function timeoutHandler(){logger['info'](util[_0xc522('0x14')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xc522('0x19')],this[_0xc522('0x1a')],this[_0xc522('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0xc522('0x11')](util[_0xc522('0x14')](_0xc522('0x1c'),this['arg_1'],this[_0xc522('0x19')],this[_0xc522('0x1a')],this[_0xc522('0x1b')],this['uniqueid']));this[_0xc522('0x1d')]=!![];}function getRoot(_0x341475){return parser[_0xc522('0x1e')](_0x341475,{'object':!![]})[_0xc522('0x1f')][_0xc522('0x20')];}function addVertex(_0x1cf39b,_0x4aa2d4,_0x23320e){_0x4aa2d4[_0xc522('0x21')]=_0x23320e;if(_0x4aa2d4[_0xc522('0x22')]('retry')){_0x4aa2d4['maxRetry']=parseInt(_0x4aa2d4[_0xc522('0x23')],0xa);}_0x1cf39b[_0xc522('0x24')](_[_0xc522('0x25')](_0x4aa2d4,_0xc522('0x26')));}function initGraph(_0x23dada,_0xb4f8a5){var _0x2658f8=new Graph();for(var _0x305df3 in _0x23dada){if(_0x23dada[_0xc522('0x22')](_0x305df3)){if(_[_0xc522('0x27')](_0x23dada[_0x305df3])){for(var _0x302c2f=0x0;_0x302c2f<_0x23dada[_0x305df3][_0xc522('0x28')];_0x302c2f+=0x1){addVertex(_0x2658f8,_0x23dada[_0x305df3][_0x302c2f],_0x305df3);}}else{addVertex(_0x2658f8,_0x23dada[_0x305df3],_0x305df3);}}}for(var _0x54a7b9=0x0;_0x54a7b9<_0xb4f8a5[_0xc522('0x28')];_0x54a7b9+=0x1){if(_0xb4f8a5[_0x54a7b9]['source']&&_0xb4f8a5[_0x54a7b9]['target']){_0x2658f8['addEdge'](_0xb4f8a5[_0x54a7b9][_0xc522('0x29')],_0xb4f8a5[_0x54a7b9]['target'],_0xb4f8a5[_0x54a7b9][_0xc522('0x2a')]);}}return _0x2658f8;}function getSquareProject(_0x1cc796,_0x44e449){rpc[_0xc522('0x2b')](_0x1cc796)[_0xc522('0x2c')](function(_0x532f14){_0x44e449(null,_0x532f14);})[_0xc522('0x2d')](function(_0x39e041){_0x44e449(null,_0x39e041);});}function createSquareReport(_0xcf8f1d,_0x3710d8){rpc[_0xc522('0x2e')](_0xcf8f1d)[_0xc522('0x2c')](function(_0x599295){if(_0x3710d8){_0x3710d8(null,_0x599295);}})[_0xc522('0x2d')](function(_0x3fe697){if(_0x3710d8){_0x3710d8(null,_0x3fe697);}});}function setChannelVariables(_0x11f99b){for(var _0xcd7c5a in _0x11f99b){if(_0x11f99b[_0xc522('0x22')](_0xcd7c5a)){if(_0xcd7c5a[_0xc522('0x2f')]('agi_')===0x0){_0x11f99b[_0xcd7c5a['substring'](0x4)]=_0x11f99b[_0xcd7c5a];delete _0x11f99b[_0xcd7c5a];}}}}function getLogFromObject(_0x1b0fb5){return util[_0xc522('0x30')](_0x1b0fb5,{'showHidden':![],'depth':null});}function agiHandler(_0x3f03d9){var _0x1af3bd,_0x4b590f,_0x2c37f9,_0x3bb41f,_0x253b2e;logger[_0xc522('0x31')](_0xc522('0x32'),JSON[_0xc522('0x33')](_0x3f03d9,null,0x2));logger[_0xc522('0x11')](util[_0xc522('0x14')](_0xc522('0x34'),_0x3f03d9[_0xc522('0x18')],_0x3f03d9[_0xc522('0x19')],_0x3f03d9[_0xc522('0x1a')],_0x3f03d9[_0xc522('0x1b')],_0x3f03d9['uniqueid']));_0x3f03d9['on']('error',errorHandler);_0x3f03d9['on'](_0xc522('0x35'),closeHandler);_0x3f03d9['on']('timeout',timeoutHandler);_0x3f03d9[_0xc522('0x1d')]=![];_0x3f03d9['on']('hangup',hangupHandler);var _0xf33804=getSquareProject[_0xc522('0x36')](null,_0x3f03d9[_0xc522('0x18')]);if(_0xf33804){if(_0xf33804[_0xc522('0x37')]){_0x1af3bd=getRoot(_0xf33804[_0xc522('0x37')]);if(_0x1af3bd&&_0x1af3bd[_0xc522('0x38')]){logger[_0xc522('0x31')](_0xc522('0x20'),JSON[_0xc522('0x33')](_0x1af3bd,null,0x2));_0x3f03d9[_0xc522('0x39')]=moment()[_0xc522('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b590f=initGraph(_['omit'](_0x1af3bd,'mxCell'),_0x1af3bd[_0xc522('0x26')]);_0x2c37f9=new Vertices(_0x3f03d9,rpc,mailRpc);logger['info'](util['format'](_0xc522('0x3a'),_0x3f03d9[_0xc522('0x18')],_0x3f03d9['calleridname'],_0x3f03d9[_0xc522('0x1a')],_0x3f03d9[_0xc522('0x1b')],_0x3f03d9[_0xc522('0x3b')]));_0x4b590f[_0xc522('0x3c')](_0x1af3bd[_0xc522('0x38')]['id'],function(_0x566b5){try{_0x566b5=_0x2c37f9[_0xc522('0x3d')](_0x566b5);logger['debug'](_0xc522('0x3e'),JSON[_0xc522('0x33')](_0x566b5,null,0x2));if(_0x566b5[_0xc522('0x21')]==='gotoc'){logger[_0xc522('0x11')](_0xc522('0x3f'));_0x3f03d9[_0xc522('0x40')]=_0x566b5[_0xc522('0x40')]||_0x3f03d9[_0xc522('0x40')];_0x3f03d9['extension']=_0x566b5['extension'];_0x3f03d9['priority']=_0x566b5[_0xc522('0x41')]?_0x566b5[_0xc522('0x41')]-0x1:0x1;return null;}else if(_0x566b5&&_0x2c37f9[_0x566b5[_0xc522('0x21')]]){_0x253b2e=_0x2c37f9[_0x566b5[_0xc522('0x21')]](_0x566b5);logger[_0xc522('0x11')]('response',JSON['stringify'](_0x253b2e,null,0x2));if(_0x253b2e&&_0x253b2e[_0xc522('0x42')]===AGI_CODE_SUCCESS&&_0x253b2e['result']!==AGI_RESULT_ERROR&&!_0x3f03d9[_0xc522('0x1d')]){logger[_0xc522('0x31')](_0xc522('0x43'),getLogFromObject(_0x253b2e));return _[_0xc522('0x44')](_0x253b2e[_0xc522('0x45')])?null:_0x253b2e[_0xc522('0x45')][_0xc522('0x46')]();}else{logger['error'](_0xc522('0x43'),getLogFromObject(_0x253b2e));return null;}}else{logger['error'](_0xc522('0x47'));return null;}}catch(_0x1e3f6d){logger[_0xc522('0xc')](_0x1e3f6d[_0xc522('0xd')]);return null;}});if(_0x1af3bd['finally']){logger[_0xc522('0x11')](util[_0xc522('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3f03d9[_0xc522('0x18')],_0x3f03d9[_0xc522('0x19')],_0x3f03d9['callerid'],_0x3f03d9[_0xc522('0x1b')],_0x3f03d9[_0xc522('0x3b')]));_0x4b590f[_0xc522('0x3c')](_0x1af3bd[_0xc522('0x48')]['id'],function(_0x216887){try{_0x216887=_0x2c37f9[_0xc522('0x3d')](_0x216887);logger['debug']('vertex',JSON[_0xc522('0x33')](_0x216887,null,0x2));if(_0x216887&&_0x2c37f9[_0x216887[_0xc522('0x21')]]){_0x253b2e=_0x2c37f9[_0x216887['agicommand']](_0x216887);if(_0x253b2e){logger[_0xc522('0x31')]('response',getLogFromObject(_0x253b2e));return _[_0xc522('0x44')](_0x253b2e[_0xc522('0x45')])?null:_0x253b2e['result']['toString']();}else{logger['error'](_0xc522('0x43'),getLogFromObject(_0x253b2e));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3127b5){logger['error'](_0x3127b5[_0xc522('0xd')]);return null;}});}logger[_0xc522('0x11')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3f03d9[_0xc522('0x18')],_0x3f03d9[_0xc522('0x19')],_0x3f03d9['callerid'],_0x3f03d9[_0xc522('0x1b')],_0x3f03d9['uniqueid']));logger['info'](util[_0xc522('0x14')](_0xc522('0x49'),_0x3f03d9['context'],_0x3f03d9['extension'],parseInt(_0x3f03d9[_0xc522('0x41')],0xa)+0x1));_0x3f03d9[_0xc522('0x4a')](_0x3f03d9[_0xc522('0x40')],_0x3f03d9[_0xc522('0x4b')],parseInt(_0x3f03d9['priority'],0xa)+0x1);_0x3f03d9['close']();}}else{logger[_0xc522('0xc')](util[_0xc522('0x14')](_0xc522('0x4c'),_0x3f03d9[_0xc522('0x18')]));_0x3f03d9[_0xc522('0x4a')](_0x3f03d9[_0xc522('0x40')],_0x3f03d9[_0xc522('0x4b')],parseInt(_0x3f03d9['priority'],0xa)+0x1);_0x3f03d9[_0xc522('0x35')]();}}else{logger[_0xc522('0xc')](util[_0xc522('0x14')](_0xc522('0x4d'),_0x3f03d9[_0xc522('0x18')]));_0x3f03d9[_0xc522('0x4a')](_0x3f03d9[_0xc522('0x40')],_0x3f03d9[_0xc522('0x4b')],parseInt(_0x3f03d9[_0xc522('0x41')],0xa)+0x1);_0x3f03d9[_0xc522('0x35')]();}}function main(){var _0x57a550;return utilLicense[_0xc522('0x4e')]()[_0xc522('0x2c')](function(_0x381e84){if(_0x381e84){if(_0x381e84['voice']){if(_0x381e84[_0xc522('0x4f')]&&_0x381e84['callysquare']>0x0){logger[_0xc522('0x11')](util[_0xc522('0x14')](_0xc522('0x50'),_0x381e84[_0xc522('0x4f')]));_0x57a550=_0x381e84[_0xc522('0x4f')];}else{logger[_0xc522('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xc522('0x11')](_0xc522('0x51'));_0x57a550=-0x1;}}})[_0xc522('0x2d')](function(_0x3ee6b6){logger[_0xc522('0xc')]('[LICENSE]',_0x3ee6b6[_0xc522('0xd')]);})[_0xc522('0x48')](function(){var _0x35a2b5=require(_0xc522('0x52'))(config['agi'][_0xc522('0x10')],config[_0xc522('0x5')]['ip'],_0x57a550);_0x35a2b5['on'](_0xc522('0xc'),errorHandler);_0x35a2b5['on']('listening',listeningHandler);_0x35a2b5['on'](_0xc522('0x53'),connectionHandler);_0x35a2b5['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index f03d8d6..6074901 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 _0x3bbf=['request','then','error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client','http'];(function(_0x7ecbe4,_0x4fd8d4){var _0x5873c2=function(_0x411026){while(--_0x411026){_0x7ecbe4['push'](_0x7ecbe4['shift']());}};_0x5873c2(++_0x4fd8d4);}(_0x3bbf,0x1eb));var _0xf3bb=function(_0x48de40,_0x50fc9f){_0x48de40=_0x48de40-0x0;var _0x27730c=_0x3bbf[_0x48de40];return _0x27730c;};'use strict';var BPromise=require(_0xf3bb('0x0'));var jayson=require(_0xf3bb('0x1'));var client=jayson[_0xf3bb('0x2')][_0xf3bb('0x3')]({'port':0x232b});function request(_0x5a8794,_0xa3e44d){return new BPromise(function(_0x1f8a98,_0x25d06f){return client[_0xf3bb('0x4')](_0x5a8794,_0xa3e44d)[_0xf3bb('0x5')](function(_0x238691){if(_0x238691['error']){return _0x25d06f(_0x238691[_0xf3bb('0x6')][_0xf3bb('0x7')]);}else{return _0x1f8a98(_0x238691[_0xf3bb('0x8')]);}})[_0xf3bb('0x9')](function(_0x318e6a){return _0x25d06f(_0x318e6a);});});}exports[_0xf3bb('0xa')]=function(_0x4dff3f,_0x4a679d){return request('SendMail',{'account':_0x4dff3f,'message':_0x4a679d});}; \ No newline at end of file +var _0xd9af=['client','http','request','then','error','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x1641ca,_0x290a2e){var _0xd3a8d2=function(_0x1e3119){while(--_0x1e3119){_0x1641ca['push'](_0x1641ca['shift']());}};_0xd3a8d2(++_0x290a2e);}(_0xd9af,0x130));var _0xfd9a=function(_0x53b83a,_0xae19ec){_0x53b83a=_0x53b83a-0x0;var _0x41b540=_0xd9af[_0x53b83a];return _0x41b540;};'use strict';var BPromise=require(_0xfd9a('0x0'));var jayson=require(_0xfd9a('0x1'));var client=jayson[_0xfd9a('0x2')][_0xfd9a('0x3')]({'port':0x232b});function request(_0x2b5416,_0x4f6724){return new BPromise(function(_0x451e5c,_0x1d7390){return client[_0xfd9a('0x4')](_0x2b5416,_0x4f6724)[_0xfd9a('0x5')](function(_0x534d42){if(_0x534d42[_0xfd9a('0x6')]){return _0x1d7390(_0x534d42[_0xfd9a('0x6')]['message']);}else{return _0x451e5c(_0x534d42['result']);}})[_0xfd9a('0x7')](function(_0x53f13f){return _0x1d7390(_0x53f13f);});});}exports[_0xfd9a('0x8')]=function(_0x5226d9,_0x464481){return request('SendMail',{'account':_0x5226d9,'message':_0x464481});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 662a439..faad486 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 _0x3eb3=['_inBody','indexOf','substring','length','split','slice','trim','headers','emit','line','exports','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x96d980,_0x25a9d0){var _0xe021ab=function(_0x55115a){while(--_0x55115a){_0x96d980['push'](_0x96d980['shift']());}};_0xe021ab(++_0x25a9d0);}(_0x3eb3,0xf9));var _0x33eb=function(_0x17d47f,_0x3c990e){_0x17d47f=_0x17d47f-0x0;var _0x2f1d01=_0x3eb3[_0x17d47f];return _0x2f1d01;};'use strict';var util=require('util');var Transform=require('stream')['Transform'];function AGIReply(_0x5914c8){Transform['call'](this,_0x5914c8);this[_0x33eb('0x0')]='';this['_inBody']=![];}util[_0x33eb('0x1')](AGIReply,Transform);AGIReply[_0x33eb('0x2')][_0x33eb('0x3')]=function(_0x40978c,_0x45c64f,_0x583779){var _0xf1d6a='\x0a',_0x12bd23=['\x0a\x0a',_0x33eb('0x4')],_0x5da863=-0x1,_0x184182=-0x1,_0x3df49b='',_0x33c72d=0x0,_0x2a4dac='',_0x500831='';this[_0x33eb('0x0')]+=_0x40978c[_0x33eb('0x5')]();_0x2a4dac=this['_localBuffer'];if(!this[_0x33eb('0x6')]){_0x33c72d=0x0;while(_0x12bd23[_0x33c72d]){while((_0x184182=_0x2a4dac[_0x33eb('0x7')](_0x12bd23[_0x33c72d]))!=-0x1){_0x3df49b=_0x12bd23[_0x33c72d];_0x500831=_0x2a4dac[_0x33eb('0x8')](0x0,_0x184182);_0x2a4dac=_0x2a4dac[_0x33eb('0x8')](_0x184182+_0x3df49b[_0x33eb('0x9')]);var _0x5e84ba=_0x500831[_0x33eb('0xa')](_0xf1d6a),_0x4029cb=0x0,_0x5e0d29={},_0x1ac0af='',_0x2e7494='',_0x218039=-0x1;while(_0x5e84ba[_0x4029cb]){_0x218039=_0x5e84ba[_0x4029cb][_0x33eb('0x7')](':');if(_0x218039!=-0x1){_0x1ac0af=_0x5e84ba[_0x4029cb][_0x33eb('0xb')](0x0,_0x218039)['trim']();_0x2e7494=_0x5e84ba[_0x4029cb][_0x33eb('0xb')](_0x218039+0x1)[_0x33eb('0xc')]();if(_0x1ac0af['length']>0x0){_0x5e0d29[_0x1ac0af]=_0x2e7494;}}else{}_0x4029cb++;}this['emit'](_0x33eb('0xd'),_0x5e0d29);this[_0x33eb('0x6')]=!![];}_0x33c72d++;}this[_0x33eb('0x0')]=_0x2a4dac;}else{while((_0x5da863=_0x2a4dac['indexOf'](_0xf1d6a))!=-0x1){_0x500831=_0x2a4dac[_0x33eb('0x8')](0x0,_0x5da863);this[_0x33eb('0xe')](_0x33eb('0xf'),_0x500831);_0x2a4dac=_0x2a4dac[_0x33eb('0x8')](_0x5da863+_0xf1d6a[_0x33eb('0x9')]);}this[_0x33eb('0x0')]=_0x2a4dac;}_0x583779();};module[_0x33eb('0x10')]=AGIReply; \ No newline at end of file +var _0xf3bb=['call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','headers','exports','util','stream','Transform'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf3bb,0x129));var _0xbf3b=function(_0x50e6d7,_0x3cecf5){_0x50e6d7=_0x50e6d7-0x0;var _0x271fa1=_0xf3bb[_0x50e6d7];return _0x271fa1;};'use strict';var util=require(_0xbf3b('0x0'));var Transform=require(_0xbf3b('0x1'))[_0xbf3b('0x2')];function AGIReply(_0x38bbe1){Transform[_0xbf3b('0x3')](this,_0x38bbe1);this[_0xbf3b('0x4')]='';this['_inBody']=![];}util[_0xbf3b('0x5')](AGIReply,Transform);AGIReply[_0xbf3b('0x6')][_0xbf3b('0x7')]=function(_0x34f42a,_0x1f568f,_0x247589){var _0x4165ed='\x0a',_0x1ad141=['\x0a\x0a',_0xbf3b('0x8')],_0x7b4cc=-0x1,_0xb3b438=-0x1,_0x575121='',_0x418ec8=0x0,_0x424c8c='',_0x37bfd='';this['_localBuffer']+=_0x34f42a[_0xbf3b('0x9')]();_0x424c8c=this[_0xbf3b('0x4')];if(!this[_0xbf3b('0xa')]){_0x418ec8=0x0;while(_0x1ad141[_0x418ec8]){while((_0xb3b438=_0x424c8c[_0xbf3b('0xb')](_0x1ad141[_0x418ec8]))!=-0x1){_0x575121=_0x1ad141[_0x418ec8];_0x37bfd=_0x424c8c[_0xbf3b('0xc')](0x0,_0xb3b438);_0x424c8c=_0x424c8c[_0xbf3b('0xc')](_0xb3b438+_0x575121[_0xbf3b('0xd')]);var _0x28e847=_0x37bfd[_0xbf3b('0xe')](_0x4165ed),_0x22d8e7=0x0,_0x5178ba={},_0x154350='',_0x3e5b73='',_0x215b92=-0x1;while(_0x28e847[_0x22d8e7]){_0x215b92=_0x28e847[_0x22d8e7][_0xbf3b('0xb')](':');if(_0x215b92!=-0x1){_0x154350=_0x28e847[_0x22d8e7][_0xbf3b('0xf')](0x0,_0x215b92)[_0xbf3b('0x10')]();_0x3e5b73=_0x28e847[_0x22d8e7]['slice'](_0x215b92+0x1)[_0xbf3b('0x10')]();if(_0x154350[_0xbf3b('0xd')]>0x0){_0x5178ba[_0x154350]=_0x3e5b73;}}else{}_0x22d8e7++;}this[_0xbf3b('0x11')](_0xbf3b('0x12'),_0x5178ba);this[_0xbf3b('0xa')]=!![];}_0x418ec8++;}this[_0xbf3b('0x4')]=_0x424c8c;}else{while((_0x7b4cc=_0x424c8c[_0xbf3b('0xb')](_0x4165ed))!=-0x1){_0x37bfd=_0x424c8c[_0xbf3b('0xc')](0x0,_0x7b4cc);this['emit']('line',_0x37bfd);_0x424c8c=_0x424c8c[_0xbf3b('0xc')](_0x7b4cc+_0x4165ed[_0xbf3b('0xd')]);}this[_0xbf3b('0x4')]=_0x424c8c;}_0x247589();};module[_0xbf3b('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 2cd0efa..a42a2a7 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 _0x8066=['name','email','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','ShowCmHopper','phone','ListId','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut'];(function(_0x509ee1,_0x3197ca){var _0x4eeb46=function(_0xaab526){while(--_0xaab526){_0x509ee1['push'](_0x509ee1['shift']());}};_0x4eeb46(++_0x3197ca);}(_0x8066,0x135));var _0x6806=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x8066[_0x220f3f];return _0x1f170e;};'use strict';var BPromise=require(_0x6806('0x0'));var moment=require(_0x6806('0x1'));var _=require('lodash');var util=require(_0x6806('0x2'));var jayson=require(_0x6806('0x3'));var client=jayson[_0x6806('0x4')][_0x6806('0x5')]({'port':0x2329});function request(_0x583618,_0x5c82bb){return new BPromise(function(_0x4e9e24,_0x29abe2){return client[_0x6806('0x6')](_0x583618,_0x5c82bb)['then'](function(_0x3119b5){if(_0x3119b5['error']){return _0x29abe2(_0x3119b5[_0x6806('0x7')][_0x6806('0x8')]);}else{return _0x4e9e24(_0x3119b5[_0x6806('0x9')]);}})[_0x6806('0xa')](function(_0x5ca6d9){return _0x29abe2(_0x5ca6d9);});});}exports[_0x6806('0xb')]=function(_0x2a7ce3){return request(_0x6806('0xc'),{'options':{'raw':![],'where':{'name':_0x2a7ce3},'attributes':['production']}});};exports[_0x6806('0xd')]=function(_0x323f67){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x323f67},'include':[{'model':_0x6806('0xe'),'as':'Smtp'}],'attributes':['id',_0x6806('0xf'),_0x6806('0x10')]}});};exports['getSquareProjectById']=function(_0x22fd0f){return request(_0x6806('0xc'),{'options':{'where':{'id':_0x22fd0f},'attributes':[_0x6806('0xf')]}});};exports['getVoiceQueueById']=function(_0xb36283){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xb36283},'attributes':[_0x6806('0xf')]}});};exports[_0x6806('0x11')]=function(_0x5879e0){return request(_0x6806('0x12'),{'options':{'where':{'id':_0x5879e0},'attributes':[_0x6806('0xf')]}});};exports[_0x6806('0x13')]=function(_0x452c01){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x452c01},'attributes':[_0x6806('0x14')]}});};exports[_0x6806('0x15')]=function(_0x12c8fb){return request(_0x6806('0x16'),{'options':{'where':{'id':_0x12c8fb},'attributes':[_0x6806('0xf')]}});};exports[_0x6806('0x17')]=function(_0x507b5b){return request('ShowTrunk',{'options':{'where':{'id':_0x507b5b},'attributes':[_0x6806('0xf')]}});};exports[_0x6806('0x18')]=function(_0x118bc0){return request(_0x6806('0x19'),{'options':{'where':{'id':_0x118bc0},'attributes':[_0x6806('0x1a')]}});};exports[_0x6806('0x1b')]=function(_0x4b757e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4b757e},'include':[{'model':_0x6806('0x1c'),'as':_0x6806('0x1d')}]}});};exports[_0x6806('0x1e')]=function(_0x77bb9a){return request(_0x6806('0x1f'),{'options':{'where':{'id':_0x77bb9a},'attributes':['id',_0x6806('0xf')]}});};exports[_0x6806('0x20')]=function(_0x6be10e){return request(_0x6806('0x21'),{'body':_0x6be10e});};exports[_0x6806('0x22')]=function(_0x4d6a59){return request(_0x6806('0x23'),{'body':_0x4d6a59});};exports[_0x6806('0x24')]=function(_0x122ebd){return request('CreateSquareReport',{'body':_[_0x6806('0x25')](_0x122ebd,{'project_name':_0x122ebd['arg_1'],'prev_project_name':_0x122ebd[_0x6806('0x26')]||'','is_subproject':_0x122ebd[_0x6806('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x6806('0x27'))})});};exports[_0x6806('0x28')]=function(_0x34d860){return request(_0x6806('0x29'),{'body':_0x34d860});};exports['createSquareMessage']=function(_0x5c4c4a){return request('CreateSquareMessage',{'body':_0x5c4c4a});};exports['createCmContact']=function(_0x283049){return request(_0x6806('0x2a'),{'options':{'raw':![],'where':{'phone':_0x283049[_0x6806('0x2b')],'ListId':_0x283049[_0x6806('0x2c')]}}})[_0x6806('0x2d')](function(_0x9392f2){if(_0x9392f2){return _0x9392f2;}return request(_0x6806('0x2e'),{'body':_0x283049});});};exports['getPauseById']=function(_0x20c155){return request(_0x6806('0x2f'),{'options':{'where':{'id':_0x20c155},'attributes':[_0x6806('0xf')]}});};exports[_0x6806('0x30')]=function(_0x468ee5,_0x445e9e){return request(_0x6806('0x31'),{'body':{'interface':_0x445e9e},'options':{'where':_0x468ee5}});};exports[_0x6806('0x32')]=function(_0x3b2fee,_0x5ebc8a,_0x2ed018){return request(_0x6806('0x33'),{'body':{'type':_0x5ebc8a,'uniqueid':_0x2ed018},'options':{'where':_0x3b2fee}});};exports['agentUnpause']=function(_0x2cd36a){return request('UnpauseUser',{'body':{},'options':{'where':_0x2cd36a}});};exports[_0x6806('0x34')]=function(_0x4ad3dd){return request(_0x6806('0x35'),{'body':{},'options':{'where':_0x4ad3dd}});}; \ No newline at end of file +var _0x6d0d=['CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','then','agentLogin','LoginUser','agentPause','agentUnpause','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','request','error','message','result','catch','getMailAccountById','ShowMailAccount','MailServerOut','name','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport'];(function(_0x283f15,_0x2bc948){var _0x3b6be4=function(_0x2a82d6){while(--_0x2a82d6){_0x283f15['push'](_0x283f15['shift']());}};_0x3b6be4(++_0x2bc948);}(_0x6d0d,0x17e));var _0xd6d0=function(_0x93ee29,_0x56bfe2){_0x93ee29=_0x93ee29-0x0;var _0x5e2d70=_0x6d0d[_0x93ee29];return _0x5e2d70;};'use strict';var BPromise=require(_0xd6d0('0x0'));var moment=require(_0xd6d0('0x1'));var _=require(_0xd6d0('0x2'));var util=require(_0xd6d0('0x3'));var jayson=require(_0xd6d0('0x4'));var client=jayson[_0xd6d0('0x5')]['http']({'port':0x2329});function request(_0x45d868,_0x1210af){return new BPromise(function(_0x197450,_0x2e7192){return client[_0xd6d0('0x6')](_0x45d868,_0x1210af)['then'](function(_0xca3df3){if(_0xca3df3[_0xd6d0('0x7')]){return _0x2e7192(_0xca3df3['error'][_0xd6d0('0x8')]);}else{return _0x197450(_0xca3df3[_0xd6d0('0x9')]);}})[_0xd6d0('0xa')](function(_0x24df20){return _0x2e7192(_0x24df20);});});}exports['getSquareProject']=function(_0x5e73c7){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5e73c7},'attributes':['production']}});};exports[_0xd6d0('0xb')]=function(_0x12225d){return request(_0xd6d0('0xc'),{'options':{'raw':![],'where':{'id':_0x12225d},'include':[{'model':_0xd6d0('0xd'),'as':'Smtp'}],'attributes':['id',_0xd6d0('0xe'),'email']}});};exports['getSquareProjectById']=function(_0x422090){return request(_0xd6d0('0xf'),{'options':{'where':{'id':_0x422090},'attributes':['name']}});};exports[_0xd6d0('0x10')]=function(_0x359d0d){return request(_0xd6d0('0x11'),{'options':{'where':{'id':_0x359d0d},'attributes':[_0xd6d0('0xe')]}});};exports[_0xd6d0('0x12')]=function(_0x23cc27){return request('ShowVariable',{'options':{'where':{'id':_0x23cc27},'attributes':[_0xd6d0('0xe')]}});};exports[_0xd6d0('0x13')]=function(_0x30b70f){return request(_0xd6d0('0x14'),{'options':{'where':{'id':_0x30b70f},'attributes':['dsn']}});};exports[_0xd6d0('0x15')]=function(_0x3a67a5){return request(_0xd6d0('0x16'),{'options':{'where':{'id':_0x3a67a5},'attributes':[_0xd6d0('0xe')]}});};exports['getTrunkById']=function(_0x2bb473){return request(_0xd6d0('0x17'),{'options':{'where':{'id':_0x2bb473},'attributes':['name']}});};exports[_0xd6d0('0x18')]=function(_0x105d5e){return request(_0xd6d0('0x19'),{'options':{'where':{'id':_0x105d5e},'attributes':[_0xd6d0('0x1a')]}});};exports[_0xd6d0('0x1b')]=function(_0x4748f8){return request(_0xd6d0('0x1c'),{'options':{'raw':![],'where':{'id':_0x4748f8},'include':[{'model':'Interval','as':_0xd6d0('0x1d')}]}});};exports[_0xd6d0('0x1e')]=function(_0x39dc7e){return request(_0xd6d0('0x1f'),{'options':{'where':{'id':_0x39dc7e},'attributes':['id',_0xd6d0('0xe')]}});};exports[_0xd6d0('0x20')]=function(_0x15d2a7){return request('CreateSmsMessage',{'body':_0x15d2a7});};exports[_0xd6d0('0x21')]=function(_0x579441){return request(_0xd6d0('0x22'),{'body':_0x579441});};exports[_0xd6d0('0x23')]=function(_0x27c31d){return request('CreateSquareReport',{'body':_[_0xd6d0('0x24')](_0x27c31d,{'project_name':_0x27c31d[_0xd6d0('0x25')],'prev_project_name':_0x27c31d[_0xd6d0('0x26')]||'','is_subproject':_0x27c31d[_0xd6d0('0x26')]?!![]:![],'leaveAt':moment()['format'](_0xd6d0('0x27'))})});};exports[_0xd6d0('0x28')]=function(_0x826b60){return request(_0xd6d0('0x29'),{'body':_0x826b60});};exports[_0xd6d0('0x2a')]=function(_0x2b575b){return request(_0xd6d0('0x2b'),{'body':_0x2b575b});};exports['createCmContact']=function(_0x4ede61){return request(_0xd6d0('0x2c'),{'options':{'raw':![],'where':{'phone':_0x4ede61[_0xd6d0('0x2d')],'ListId':_0x4ede61['ListId']}}})[_0xd6d0('0x2e')](function(_0x4fb431){if(_0x4fb431){return _0x4fb431;}return request('CreateCmContact',{'body':_0x4ede61});});};exports['getPauseById']=function(_0x27668b){return request('ShowPause',{'options':{'where':{'id':_0x27668b},'attributes':[_0xd6d0('0xe')]}});};exports[_0xd6d0('0x2f')]=function(_0x556279,_0x5040db){return request(_0xd6d0('0x30'),{'body':{'interface':_0x5040db},'options':{'where':_0x556279}});};exports[_0xd6d0('0x31')]=function(_0x2b2e96,_0x4691cf,_0x4803de){return request('PauseUser',{'body':{'type':_0x4691cf,'uniqueid':_0x4803de},'options':{'where':_0x2b2e96}});};exports[_0xd6d0('0x32')]=function(_0x3e489e){return request('UnpauseUser',{'body':{},'options':{'where':_0x3e489e}});};exports[_0xd6d0('0x33')]=function(_0x433361){return request('LogoutUser',{'body':{},'options':{'where':_0x433361}});}; \ 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 82c4d34..607b705 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 _0x4753=['./lex','exports','./polly'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x4753,0x1f4));var _0x3475=function(_0x3cd156,_0x228fd8){_0x3cd156=_0x3cd156-0x0;var _0x1c2953=_0x4753[_0x3cd156];return _0x1c2953;};var polly=require(_0x3475('0x0'));var lex=require(_0x3475('0x1'));module[_0x3475('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8585=['exports','./polly','./lex'];(function(_0x509f05,_0x292e3e){var _0x38a9ad=function(_0x38f228){while(--_0x38f228){_0x509f05['push'](_0x509f05['shift']());}};_0x38a9ad(++_0x292e3e);}(_0x8585,0x64));var _0x5858=function(_0x4fde18,_0x11fe3e){_0x4fde18=_0x4fde18-0x0;var _0x3184a3=_0x8585[_0x4fde18];return _0x3184a3;};var polly=require(_0x5858('0x0'));var lex=require(_0x5858('0x1'));module[_0x5858('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index fbf7c39..6c6d4a1 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 _0xac4a=['exports','./lib/api'];(function(_0x54d9d0,_0x1a0a1d){var _0x568d25=function(_0x56ec9f){while(--_0x56ec9f){_0x54d9d0['push'](_0x54d9d0['shift']());}};_0x568d25(++_0x1a0a1d);}(_0xac4a,0x13f));var _0xaac4=function(_0x3710c5,_0x4dfc4c){_0x3710c5=_0x3710c5-0x0;var _0x2417cd=_0xac4a[_0x3710c5];return _0x2417cd;};'use strict';var lex=require(_0xaac4('0x0'));module[_0xaac4('0x1')]=function(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e){return lex(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48){return lex(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48);}; \ 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 55d5e42..3093f4a 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(_0x120dc4,_0x3c2749){var _0x381f71=function(_0x4a4dbe){while(--_0x4a4dbe){_0x120dc4['push'](_0x120dc4['shift']());}};_0x381f71(++_0x3c2749);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x17f1ab,_0x1c4d6f){var _0x1c6e91=function(_0x44ef27){while(--_0x44ef27){_0x17f1ab['push'](_0x17f1ab['shift']());}};_0x1c6e91(++_0x1c4d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 f8f8f6c..edabde7 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 _0x04e1=['exports','./lib/api'];(function(_0x94d79d,_0x31ff9f){var _0xf5cbd4=function(_0x272bf1){while(--_0x272bf1){_0x94d79d['push'](_0x94d79d['shift']());}};_0xf5cbd4(++_0x31ff9f);}(_0x04e1,0x1ed));var _0x104e=function(_0x1941fd,_0x596d49){_0x1941fd=_0x1941fd-0x0;var _0x5bf7da=_0x04e1[_0x1941fd];return _0x5bf7da;};'use strict';var polly=require(_0x104e('0x0'));module[_0x104e('0x1')]=function(_0x3bf3c8,_0x2881f5,_0x4d7b2a,_0x2798c8,_0x5ee939,_0x233c54,_0x3102f3){return polly(_0x3bf3c8,_0x2881f5,_0x4d7b2a,_0x2798c8,_0x5ee939,_0x233c54,_0x3102f3);}; \ No newline at end of file +var _0x7a6f=['./lib/api','exports'];(function(_0x2196fb,_0x2b71e6){var _0x4cde78=function(_0x5b49bf){while(--_0x5b49bf){_0x2196fb['push'](_0x2196fb['shift']());}};_0x4cde78(++_0x2b71e6);}(_0x7a6f,0x1ee));var _0xf7a6=function(_0x116efa,_0x5694ae){_0x116efa=_0x116efa-0x0;var _0x10aa67=_0x7a6f[_0x116efa];return _0x10aa67;};'use strict';var polly=require(_0xf7a6('0x0'));module[_0xf7a6('0x1')]=function(_0x50394c,_0x1b7f1,_0xb54b1e,_0xa18487,_0x346e03,_0x54dcdf,_0x52c423){return polly(_0x50394c,_0x1b7f1,_0xb54b1e,_0xa18487,_0x346e03,_0x54dcdf,_0x52c423);}; \ 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 fb6f94c..695259c 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 _0xae38=['exports','text','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x13ecca,_0xfd4f01){var _0x17c3b6=function(_0x4f7f15){while(--_0x4f7f15){_0x13ecca['push'](_0x13ecca['shift']());}};_0x17c3b6(++_0xfd4f01);}(_0xae38,0x1b2));var _0x8ae3=function(_0x5ce1ce,_0x3ed861){_0x5ce1ce=_0x5ce1ce-0x0;var _0x384f13=_0xae38[_0x5ce1ce];return _0x384f13;};'use strict';var fs=require('fs');var path=require(_0x8ae3('0x0'));var BPromise=require(_0x8ae3('0x1'));var rs=require(_0x8ae3('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x3686fc,_0x4df537,_0x33ceac){return new BPromise(function(_0x308318,_0x5d5150){_0x3686fc[_0x8ae3('0x3')](_0x4df537,function(_0x137ce6,_0x530eb1){if(_0x137ce6){_0x5d5150(_0x137ce6);}else if(_0x530eb1){if(_0x530eb1[_0x8ae3('0x4')]instanceof Buffer){fs[_0x8ae3('0x5')](_0x33ceac,_0x530eb1['AudioStream'],function(_0x2fc1d6){if(_0x2fc1d6){_0x5d5150(_0x2fc1d6);}else{_0x308318();}});}else{_0x5d5150(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5d5150(new Error(_0x8ae3('0x6')));}});});}module[_0x8ae3('0x7')]=function(_0x4036af,_0xcd0dfc,_0x3319b9,_0x315bbb,_0x4161b2,_0x4f6f54,_0x45a9c6){var _0x1cd73f=new AWS['Polly']({'accessKeyId':_0x4036af,'secretAccessKey':_0xcd0dfc,'region':_0x3319b9});var _0x4ac456={'Text':_0x4161b2,'TextType':_0x4f6f54||_0x8ae3('0x8'),'OutputFormat':'mp3','VoiceId':_0x315bbb};return pollyResult(_0x1cd73f,_0x4ac456,_0x45a9c6);}; \ No newline at end of file +var _0x3063=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4418f7,_0x1c52c6){var _0x3503bc=function(_0x3e1458){while(--_0x3e1458){_0x4418f7['push'](_0x4418f7['shift']());}};_0x3503bc(++_0x1c52c6);}(_0x3063,0xbf));var _0x3306=function(_0x3bbd6b,_0x498df1){_0x3bbd6b=_0x3bbd6b-0x0;var _0x1d27fc=_0x3063[_0x3bbd6b];return _0x1d27fc;};'use strict';var fs=require('fs');var path=require(_0x3306('0x0'));var BPromise=require(_0x3306('0x1'));var rs=require(_0x3306('0x2'));var AWS=require(_0x3306('0x3'));function pollyResult(_0x3d3968,_0x5b2535,_0x62b22c){return new BPromise(function(_0x3acf4b,_0x3b5c47){_0x3d3968[_0x3306('0x4')](_0x5b2535,function(_0x165098,_0x10c88d){if(_0x165098){_0x3b5c47(_0x165098);}else if(_0x10c88d){if(_0x10c88d[_0x3306('0x5')]instanceof Buffer){fs['writeFile'](_0x62b22c,_0x10c88d[_0x3306('0x5')],function(_0x1c32b8){if(_0x1c32b8){_0x3b5c47(_0x1c32b8);}else{_0x3acf4b();}});}else{_0x3b5c47(new Error(_0x3306('0x6')));}}else{_0x3b5c47(new Error(_0x3306('0x7')));}});});}module['exports']=function(_0x50fef3,_0x15a872,_0x1aa753,_0x39424e,_0x3ac9a0,_0x37088d,_0xb0bee1){var _0x21b4ed=new AWS[(_0x3306('0x8'))]({'accessKeyId':_0x50fef3,'secretAccessKey':_0x15a872,'region':_0x1aa753});var _0x652373={'Text':_0x3ac9a0,'TextType':_0x37088d||_0x3306('0x9'),'OutputFormat':_0x3306('0xa'),'VoiceId':_0x39424e};return pollyResult(_0x21b4ed,_0x652373,_0xb0bee1);}; \ 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 2ae1ace..ea7fccc 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfd0=['exports','./lib/api'];(function(_0x1ca4c3,_0x554126){var _0x4426a6=function(_0x11e9b0){while(--_0x11e9b0){_0x1ca4c3['push'](_0x1ca4c3['shift']());}};_0x4426a6(++_0x554126);}(_0xcfd0,0xcd));var _0x0cfd=function(_0x577197,_0x4c46e5){_0x577197=_0x577197-0x0;var _0x3a7259=_0xcfd0[_0x577197];return _0x3a7259;};'use strict';var asr=require(_0x0cfd('0x0'));module[_0x0cfd('0x1')]=function(_0x1203d3,_0x2e6d8a,_0x15067e,_0x544775){return asr(_0x1203d3,_0x2e6d8a,_0x15067e);}; \ No newline at end of file +var _0xfe0a=['exports'];(function(_0x2c1f0b,_0xfc4622){var _0x262bbf=function(_0x1c618d){while(--_0x1c618d){_0x2c1f0b['push'](_0x2c1f0b['shift']());}};_0x262bbf(++_0xfc4622);}(_0xfe0a,0x1a8));var _0xafe0=function(_0x256db8,_0x248342){_0x256db8=_0x256db8-0x0;var _0x25b73a=_0xfe0a[_0x256db8];return _0x25b73a;};'use strict';var asr=require('./lib/api');module[_0xafe0('0x0')]=function(_0x4b22ec,_0x3b7c84,_0x6af5f9,_0x4e4dae){return asr(_0x4b22ec,_0x3b7c84,_0x6af5f9);}; \ 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 2c42849..dfc9994 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 _0xa4db=['8000','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x2b563e,_0x517972){var _0x238108=function(_0x248466){while(--_0x248466){_0x2b563e['push'](_0x2b563e['shift']());}};_0x238108(++_0x517972);}(_0xa4db,0x139));var _0xba4d=function(_0x2faac9,_0x382c18){_0x2faac9=_0x2faac9-0x0;var _0x19b52e=_0xa4db[_0x2faac9];return _0x19b52e;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xba4d('0x0')]=function(_0x46aae0,_0x22432c,_0x1f3b60){return new BPromise(function(_0x32ad53,_0x158edc){var _0x5870ff;if(typeof _0x46aae0!==_0xba4d('0x1')||_0x46aae0['length']===0x0){return _0x158edc(_0xba4d('0x2'));}if(typeof _0x22432c!==_0xba4d('0x1')||_0x22432c[_0xba4d('0x3')]===0x0){return _0x158edc(_0xba4d('0x4'));}if(typeof _0x1f3b60!==_0xba4d('0x5')&&(typeof _0x1f3b60!==_0xba4d('0x1')||_0x1f3b60[_0xba4d('0x3')]===0x0)){return _0x158edc(_0xba4d('0x6'));}try{_0x5870ff=fs[_0xba4d('0x7')](_0x46aae0)['toString'](_0xba4d('0x8'));}catch(_0x1675a8){return _0x158edc(_0x1675a8);}return _0x32ad53({'method':_0xba4d('0x9'),'uri':host+_0xba4d('0xa')+_0x22432c,'body':{'config':{'encoding':_0xba4d('0xb'),'sampleRateHertz':_0xba4d('0xc'),'languageCode':_0x1f3b60},'audio':{'content':_0x5870ff}},'json':!![]});});}; \ No newline at end of file +var _0xb32d=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x5ceb4d,_0x3ea071){var _0x2085b9=function(_0x1f541a){while(--_0x1f541a){_0x5ceb4d['push'](_0x5ceb4d['shift']());}};_0x2085b9(++_0x3ea071);}(_0xb32d,0x1da));var _0xdb32=function(_0x33990e,_0x27b1f4){_0x33990e=_0x33990e-0x0;var _0x366423=_0xb32d[_0x33990e];return _0x366423;};'use strict';var url=require(_0xdb32('0x0'));var BPromise=require(_0xdb32('0x1'));var fs=require('fs');var host=_0xdb32('0x2');module[_0xdb32('0x3')]=function(_0x298769,_0x56a5af,_0x56bb98){return new BPromise(function(_0x2fe96e,_0x2c5527){var _0x581ceb;if(typeof _0x298769!==_0xdb32('0x4')||_0x298769[_0xdb32('0x5')]===0x0){return _0x2c5527(_0xdb32('0x6'));}if(typeof _0x56a5af!==_0xdb32('0x4')||_0x56a5af[_0xdb32('0x5')]===0x0){return _0x2c5527(_0xdb32('0x7'));}if(typeof _0x56bb98!=='undefined'&&(typeof _0x56bb98!==_0xdb32('0x4')||_0x56bb98[_0xdb32('0x5')]===0x0)){return _0x2c5527(_0xdb32('0x8'));}try{_0x581ceb=fs[_0xdb32('0x9')](_0x298769)[_0xdb32('0xa')](_0xdb32('0xb'));}catch(_0x112db6){return _0x2c5527(_0x112db6);}return _0x2fe96e({'method':_0xdb32('0xc'),'uri':host+_0xdb32('0xd')+_0x56a5af,'body':{'config':{'encoding':_0xdb32('0xe'),'sampleRateHertz':_0xdb32('0xf'),'languageCode':_0x56bb98},'audio':{'content':_0x581ceb}},'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 b3da0e1..cfaa647 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 _0x8681=['exports','./asr'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8681,0x14b));var _0x1868=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8681[_0x4b2863];return _0x567d67;};var asr=require(_0x1868('0x0'));module[_0x1868('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8ec6=['./asr'];(function(_0x351e5d,_0x1cff22){var _0x4f10d8=function(_0x52f820){while(--_0x52f820){_0x351e5d['push'](_0x351e5d['shift']());}};_0x4f10d8(++_0x1cff22);}(_0x8ec6,0x191));var _0x68ec=function(_0x5857d9,_0xc19540){_0x5857d9=_0x5857d9-0x0;var _0x2f456f=_0x8ec6[_0x5857d9];return _0x2f456f;};var asr=require(_0x68ec('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 4a1b04f..5412d05 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 _0xebe1=['dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','split','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','actionIncomplete','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','length','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','.mp3','polly','lex','ispeechTTS','format','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile'];(function(_0x1f870f,_0x4a5a96){var _0x2173a0=function(_0xd9f06f){while(--_0xd9f06f){_0x1f870f['push'](_0x1f870f['shift']());}};_0x2173a0(++_0x4a5a96);}(_0xebe1,0x117));var _0x1ebe=function(_0x14e75f,_0x59a1b9){_0x14e75f=_0x14e75f-0x0;var _0x2dfadf=_0xebe1[_0x14e75f];return _0x2dfadf;};'use strict';var apiai=require(_0x1ebe('0x0'));var BPromise=require(_0x1ebe('0x1'));var dialogflow=require(_0x1ebe('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x1ebe('0x3'));var md5=require(_0x1ebe('0x4'));var path=require(_0x1ebe('0x5'));var querystring=require(_0x1ebe('0x6'));var rp=require(_0x1ebe('0x7'));var rs=require(_0x1ebe('0x8'));var sox=require(_0x1ebe('0x9'));var tts=require(_0x1ebe('0xa'));var urlParse=require(_0x1ebe('0xb'))[_0x1ebe('0xc')];var util=require(_0x1ebe('0xd'));var aws=require(_0x1ebe('0xe'));var google=require('./google');var sestek=require(_0x1ebe('0xf'));var tilde=require(_0x1ebe('0x10'));var logger=require(_0x1ebe('0x11'))(_0x1ebe('0x12'));var ISPEECH_API=_0x1ebe('0x13');function downloadFile(_0x4b75f6,_0xfa8b0d){return new BPromise(function(_0x4989e4,_0x211ba2){var _0x2e82d5=urlParse(_0x4b75f6);var _0x2320a7=_0x2e82d5[_0x1ebe('0x14')]===_0x1ebe('0x15')?https:http;var _0x319771={'host':_0x2e82d5[_0x1ebe('0x16')],'path':_0x2e82d5[_0x1ebe('0x5')],'headers':{'user-agent':_0x1ebe('0x17')}};_0x2320a7[_0x1ebe('0x18')](_0x319771,function(_0x59dd67){if(_0x59dd67['statusCode']!==0xc8){logger[_0x1ebe('0x19')](_0x1ebe('0x1a')+_0x4b75f6+_0x1ebe('0x1b')+_0x59dd67[_0x1ebe('0x1c')]+'\x20('+_0x59dd67[_0x1ebe('0x1d')]+')');_0x211ba2(new Error('request\x20to\x20'+_0x4b75f6+_0x1ebe('0x1b')+_0x59dd67[_0x1ebe('0x1c')]+'\x20('+_0x59dd67[_0x1ebe('0x1d')]+')'));return;}var _0x5f4ff7=fs[_0x1ebe('0x1e')](_0xfa8b0d);_0x5f4ff7['on'](_0x1ebe('0x1f'),function(){logger[_0x1ebe('0x20')]('finish\x20download\x20file');_0x5f4ff7[_0x1ebe('0x21')](_0x4989e4);});_0x5f4ff7['on'](_0x1ebe('0x19'),function(_0x5f28e6){fs[_0x1ebe('0x22')](_0xfa8b0d);logger[_0x1ebe('0x19')](_0x1ebe('0x23'),_0x5f28e6);_0x211ba2(_0x5f28e6);});_0x59dd67['pipe'](_0x5f4ff7);})['on'](_0x1ebe('0x19'),function(_0x402992){logger['error'](_0x402992);_0x211ba2(_0x402992);})[_0x1ebe('0x24')]();});}function uploadFile(_0x936a08){return new BPromise(function(_0x2744fc,_0x4c616d){var _0x210a60=urlParse(_0x936a08);var _0x12b957=_0x210a60[_0x1ebe('0x14')]===_0x1ebe('0x15')?https:http;var _0x4756e8={'host':_0x210a60[_0x1ebe('0x16')],'path':_0x210a60[_0x1ebe('0x5')],'headers':{'user-agent':_0x1ebe('0x17')}};_0x12b957['get'](_0x4756e8,function(_0x618f8c){if(_0x618f8c[_0x1ebe('0x1c')]!==0xc8){_0x4c616d(new Error(_0x1ebe('0x1a')+_0x936a08+_0x1ebe('0x1b')+_0x618f8c[_0x1ebe('0x1c')]+'\x20('+_0x618f8c[_0x1ebe('0x1d')]+')'));return;}var _0x231cb6='';_0x618f8c['on']('data',function(_0x178b9f){_0x231cb6+=_0x178b9f;});_0x618f8c['on'](_0x1ebe('0x24'),function(){_0x2744fc(_0x231cb6);});})['on'](_0x1ebe('0x19'),function(_0x3de704){_0x4c616d(_0x3de704);})[_0x1ebe('0x24')]();});}function convertFile(_0x3959b5,_0x21e53c){return new BPromise(function(_0x524881,_0x1c40cd){var _0x467712=sox[_0x1ebe('0x25')](_0x3959b5,_0x21e53c,{'sampleRate':0x1f40,'format':_0x1ebe('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x467712['on'](_0x1ebe('0x19'),function(_0x2e0a67){logger[_0x1ebe('0x19')](_0x1ebe('0x27'),_0x2e0a67);_0x1c40cd(_0x2e0a67);});_0x467712['on'](_0x1ebe('0x24'),function(){logger[_0x1ebe('0x20')](_0x1ebe('0x28'));_0x524881();});_0x467712[_0x1ebe('0x29')]();});}function base64Decode(_0x2cb23d,_0x1b981e){var _0x40e5e1=path[_0x1ebe('0x2a')](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x2d'));fs['writeFileSync'](_0x40e5e1,_0x2cb23d,_0x1ebe('0x2e'));return convertFile(_0x40e5e1,_0x1b981e)[_0x1ebe('0x2f')](function(){try{fs[_0x1ebe('0x22')](_0x40e5e1);fs[_0x1ebe('0x30')](_0x1b981e,_0x1ebe('0x31'));}catch(_0x2b1762){logger[_0x1ebe('0x19')](_0x2b1762);}return _0x1b981e['split']('.')[0x0];});}function base64Encode(_0x43a444){var _0x598555=fs[_0x1ebe('0x32')](_0x43a444);return new Buffer(_0x598555)[_0x1ebe('0x33')](_0x1ebe('0x2e'));}exports[_0x1ebe('0x34')]=function(_0x29a8b7,_0x3f2ba4,_0x27ad59,_0x4df903,_0x52f2e3,_0x4a7316){var _0x4e55ea,_0x3363af;var _0x4e07cf=_0x1ebe('0x35');var _0x4e56af=_0x1ebe('0x36')+_0x29a8b7;var _0xf9fa07={};if(_0x3f2ba4===_0x1ebe('0x37')){_0xf9fa07[_0x1ebe('0x38')]={'ssml':_0x27ad59};}else{_0xf9fa07['input']={'text':_0x27ad59};};_0xf9fa07[_0x1ebe('0x39')]={'languageCode':_0x4df903,'ssmlGender':_0x52f2e3};_0xf9fa07[_0x1ebe('0x3a')]={'audioEncoding':_0x1ebe('0x3b'),'sampleRateHertz':0x1f40};var _0x15bf28={'url':_0x4e07cf+_0x1ebe('0x3c')+_0x4e56af,'method':_0x1ebe('0x3d'),'json':!![],'body':_0xf9fa07};return rp(_0x15bf28)[_0x1ebe('0x2f')](function(_0xf13895){return new BPromise(function(_0x2b53d8,_0x1864da){_0x4e55ea=path[_0x1ebe('0x2a')](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+'.mp3');var _0xe0a5be=Buffer[_0x1ebe('0x3e')](_0xf13895[_0x1ebe('0x3f')],_0x1ebe('0x2e'));return fs[_0x1ebe('0x40')](_0x4e55ea,_0xe0a5be,function(_0x451076){_0x1864da(_0x451076);},function(_0x4e2fe0){fs['chmodSync'](_0x4e55ea,_0x1ebe('0x31'));_0x2b53d8(_0x4e2fe0);});});})[_0x1ebe('0x2f')](function(_0x287144){_0x3363af=path[_0x1ebe('0x2a')](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x2d'));return convertFile(_0x4e55ea,_0x3363af);})[_0x1ebe('0x2f')](function(){try{fs['unlink'](_0x4e55ea);fs[_0x1ebe('0x30')](_0x3363af,'777');}catch(_0x283900){logger[_0x1ebe('0x19')](_0x283900);}logger[_0x1ebe('0x20')](_0x1ebe('0x41'),_0x3363af['split']('.')[0x0]);return _0x3363af['split']('.')[0x0];});};exports['googleTTS']=function(_0x37f7c3,_0x475149){var _0x5c49ab=_0x1ebe('0x42');var _0x2ba695,_0x19a149;var _0x3a97b1;var _0x7ae854={'encoding':_0x1ebe('0x43'),'method':'POST','timeout':0x2710,'url':_0x5c49ab,'headers':{'Content-Type':_0x1ebe('0x44')},'body':_0x1ebe('0x45')+encodeURIComponent(JSON[_0x1ebe('0x46')]([[[_0x1ebe('0x47'),JSON[_0x1ebe('0x46')]([_0x37f7c3,_0x475149||'en',![],_0x1ebe('0x48')]),null,_0x1ebe('0x49')]]]))};return rp(_0x7ae854)[_0x1ebe('0x2f')](function(_0x1b9483){try{_0x3a97b1=eval(_0x1b9483[_0x1ebe('0x4a')](0x5))[0x0][0x2];}catch(_0x57ce89){throw new Error(_0x1ebe('0x4b')+_0x1b9483['data']);}if(!_0x3a97b1){if(_0x37f7c3['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x1ebe('0x4c')+_0x475149+_0x1ebe('0x4d'));}}try{_0x3a97b1=eval(_0x3a97b1)[0x0];}catch(_0x44c058){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x42e60e=_0x3a97b1;_0x2ba695=path[_0x1ebe('0x2a')](__dirname,'tmp',rs[_0x1ebe('0x2c')](0x4)+'.mp3');fs['writeFileSync'](_0x2ba695,_0x3a97b1,{'encoding':_0x1ebe('0x2e')});_0x19a149=path['resolve'](__dirname,'tmp',rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x2d'));return convertFile(_0x2ba695,_0x19a149);})[_0x1ebe('0x2f')](function(){try{fs['unlink'](_0x2ba695);fs[_0x1ebe('0x30')](_0x19a149,_0x1ebe('0x31'));}catch(_0xa59fc1){logger[_0x1ebe('0x19')](_0xa59fc1);}logger[_0x1ebe('0x20')](_0x1ebe('0x4e'),_0x19a149[_0x1ebe('0x4f')]('.')[0x0]);return _0x19a149['split']('.')[0x0];});};exports[_0x1ebe('0x50')]=function(_0xfd0e0d,_0x445097,_0x3647ba){return google[_0x1ebe('0x51')](_0xfd0e0d,_0x445097,_0x3647ba)[_0x1ebe('0x2f')](function(_0x147c42){logger[_0x1ebe('0x20')](_0x147c42['uri']);return rp(_0x147c42);})[_0x1ebe('0x2f')](function(_0x1c5e6e){var _0x15ee22='';var _0x13f7f=0x0;try{fs['unlink'](_0xfd0e0d);}catch(_0x5c180e){logger[_0x1ebe('0x19')](_0x5c180e);}if(_0x1c5e6e&&_0x1c5e6e[_0x1ebe('0x52')]){_0x15ee22=_0x1c5e6e[_0x1ebe('0x52')][_0x1ebe('0x53')](function(_0x56bf4f){return _0x56bf4f&&_0x56bf4f['alternatives'][0x0]&&_0x56bf4f[_0x1ebe('0x54')][0x0][_0x1ebe('0x55')]?_0x56bf4f['alternatives'][0x0][_0x1ebe('0x55')]:'';})[_0x1ebe('0x56')]('\x0a');_0x13f7f=_0x1c5e6e[_0x1ebe('0x52')][_0x1ebe('0x53')](function(_0x193bad){return _0x193bad&&_0x193bad[_0x1ebe('0x54')][0x0]&&_0x193bad['alternatives'][0x0]['confidence']?_0x193bad['alternatives'][0x0][_0x1ebe('0x57')]:0x0;})[_0x1ebe('0x56')]('\x0a');}logger[_0x1ebe('0x20')](_0x1ebe('0x58'),_0x15ee22);logger[_0x1ebe('0x20')]('googleASR\x20confidence',_0x13f7f);return{'transcript':_0x15ee22,'confidence':_0x13f7f};})[_0x1ebe('0x59')](function(_0x1a6077){logger[_0x1ebe('0x19')](_0x1ebe('0x5a'),_0x1a6077[_0x1ebe('0x1c')],_0x1a6077[_0x1ebe('0x5b')],_0x1a6077[_0x1ebe('0x5c')]);});};exports[_0x1ebe('0x5d')]=function(_0x112157,_0x3ef4af,_0x301cf1,_0x5bd80b){var _0x176ec5=apiai(_0x3ef4af,{'language':_0x5bd80b||'en'});return _0x176ec5['textRequest'](_0x301cf1,{'sessionId':md5(_0x112157)})[_0x1ebe('0x2f')](function(_0x291c06){logger[_0x1ebe('0x20')](JSON['stringify'](_0x291c06));return{'source':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x5f')],'resolvedQuery':_0x291c06[_0x1ebe('0x5e')]['resolvedQuery'],'action':_0x291c06['result']['action'],'actionIncomplete':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x60')],'speech':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x61')][_0x1ebe('0x62')],'score':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x63')],'statusCode':_0x291c06['status']['code'],'endConversation':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x64')][_0x1ebe('0x65')]||![],'isFallbackIntent':_0x291c06[_0x1ebe('0x5e')][_0x1ebe('0x64')][_0x1ebe('0x66')]};});};exports['googleDialogflowV2']=function(_0x52c5a1,_0x8713fc,_0x4da336,_0xe14777,_0x5f5325,_0x352f75){var _0x1941e5=_0xe14777[_0x1ebe('0x67')](/\\n/g,'\x0a');var _0x37246b={'credentials':{'private_key':_0x1941e5,'client_email':_0x4da336}};var _0x462121=new dialogflow[(_0x1ebe('0x68'))](_0x37246b);var _0x3f2fd3=_0x462121[_0x1ebe('0x69')](_0x8713fc,md5(_0x52c5a1));var _0x28351c={'session':_0x3f2fd3,'queryInput':{'text':{'text':_0x5f5325,'languageCode':_0x352f75}}};return _0x462121[_0x1ebe('0x6a')](_0x28351c)['then'](function(_0x1ea8d9){if(_0x1ea8d9&&_0x1ea8d9[_0x1ebe('0x6b')]){logger[_0x1ebe('0x20')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x1ea8d9));var _0x599a24=_0x1ea8d9[0x0];if(_0x599a24){var _0x3b9308={'action':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x6d')],'allRequiredParamsPresent':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x6e')],'endConversation':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x6f')]&&_0x599a24[_0x1ebe('0x6c')]['diagnosticInfo']['fields']?_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x6f')][_0x1ebe('0x70')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x71')],'intentName':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x72')][_0x1ebe('0x5b')],'intentDisplayName':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x72')][_0x1ebe('0x73')],'isFallbackIntent':_0x599a24[_0x1ebe('0x6c')]['intent'][_0x1ebe('0x74')],'languageCode':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x75')],'queryText':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x76')],'responseId':_0x599a24[_0x1ebe('0x77')],'score':_0x599a24['queryResult'][_0x1ebe('0x78')],'speech':_0x599a24[_0x1ebe('0x6c')][_0x1ebe('0x71')],'providerResponse':JSON['stringify'](_0x1ea8d9)};return _0x3b9308;}}});};exports[_0x1ebe('0x79')]=function(_0x43962a,_0x14a9e2,_0x273a77,_0x26333a){return tilde[_0x1ebe('0x51')](_0x43962a,_0x14a9e2,_0x273a77,_0x26333a)[_0x1ebe('0x2f')](function(_0x50c7ba){try{fs[_0x1ebe('0x22')](_0x43962a);}catch(_0x3afc2e){logger[_0x1ebe('0x19')](_0x3afc2e);}logger[_0x1ebe('0x20')](_0x1ebe('0x7a'),_0x50c7ba[_0x1ebe('0x55')]);logger[_0x1ebe('0x20')]('Tilde\x20ASR\x20confidence',_0x50c7ba[_0x1ebe('0x57')]);return _0x50c7ba;});};exports[_0x1ebe('0x7b')]=function(_0x12594f,_0x3ee1eb,_0x3dbcbb,_0x51ad79,_0x54e549,_0x28f76c){var _0x2f67ef=path[_0x1ebe('0x2a')](__dirname,'tmp',rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x7c'));var _0x27d2d3;return aws[_0x1ebe('0x7d')](_0x12594f,_0x3ee1eb,_0x3dbcbb,_0x51ad79,_0x54e549,_0x28f76c,_0x2f67ef)[_0x1ebe('0x2f')](function(){_0x27d2d3=path['resolve'](__dirname,'tmp',rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x2d'));return convertFile(_0x2f67ef,_0x27d2d3);})[_0x1ebe('0x2f')](function(){try{fs[_0x1ebe('0x22')](_0x2f67ef);fs['chmodSync'](_0x27d2d3,_0x1ebe('0x31'));}catch(_0x436588){logger['error'](_0x436588);}return _0x27d2d3[_0x1ebe('0x4f')]('.')[0x0];});};exports['awsLex']=function(_0x4a1f45,_0x480c4d,_0x155060,_0x4e6ace,_0x41f551,_0x3a17e1){return aws[_0x1ebe('0x7e')](_0x4a1f45,_0x480c4d,_0x155060,_0x4e6ace,_0x41f551,_0x3a17e1)[_0x1ebe('0x2f')](function(_0x303fe0){logger[_0x1ebe('0x20')](JSON[_0x1ebe('0x46')](_0x303fe0));return _0x303fe0;});};exports[_0x1ebe('0x7f')]=function(_0xebff81,_0x4cd7d3,_0xb7dab,_0x19412a){var _0x252d82=util[_0x1ebe('0x80')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xebff81,encodeURIComponent(_0x4cd7d3),_0xb7dab,_0x19412a);var _0x56f4dc=path['resolve'](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x7c'));var _0x46c23e;return downloadFile(_0x252d82,_0x56f4dc)[_0x1ebe('0x2f')](function(){_0x46c23e=path[_0x1ebe('0x2a')](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+'.wav');return convertFile(_0x56f4dc,_0x46c23e);})[_0x1ebe('0x2f')](function(){try{fs[_0x1ebe('0x22')](_0x56f4dc);fs[_0x1ebe('0x30')](_0x46c23e,_0x1ebe('0x31'));}catch(_0xf0e10e){logger[_0x1ebe('0x19')](_0xf0e10e);}return _0x46c23e[_0x1ebe('0x4f')]('.')[0x0];});};exports[_0x1ebe('0x81')]=function(_0x9ed1e2,_0x4bc725,_0x1ae5e2,_0x2b9732){var _0x2ed1b9=util[_0x1ebe('0x80')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4bc725,_0x1ae5e2,base64Encode(_0x9ed1e2),_0x2b9732?util[_0x1ebe('0x80')]('model=%s',encodeURIComponent(_0x2b9732)):_0x1ebe('0x82'));return uploadFile(_0x2ed1b9)[_0x1ebe('0x2f')](function(_0x48de08){return querystring[_0x1ebe('0xc')](_0x48de08);});};exports[_0x1ebe('0x83')]=function(_0x473e9a,_0x57bc6f){return sestek[_0x1ebe('0x84')](_0x473e9a,_0x57bc6f)[_0x1ebe('0x2f')](function(_0x1d0436){logger[_0x1ebe('0x20')](JSON['stringify'](_0x1d0436));var _0x5e7283={'speech':_0x1d0436[_0x1ebe('0x85')],'action':_0x1d0436[_0x1ebe('0x86')]?_0x1d0436[_0x1ebe('0x86')]['CustomAction']:undefined,'actiondata':_0x1d0436[_0x1ebe('0x86')]?_0x1d0436[_0x1ebe('0x86')][_0x1ebe('0x87')]:undefined};if(_0x1d0436[_0x1ebe('0x86')]&&_0x1d0436['channelData'][_0x1ebe('0x88')]){return base64Decode(_0x1d0436[_0x1ebe('0x86')][_0x1ebe('0x88')]['Data'],path[_0x1ebe('0x2a')](__dirname,_0x1ebe('0x2b'),rs[_0x1ebe('0x2c')](0x4)+_0x1ebe('0x2d')))[_0x1ebe('0x2f')](function(_0xc35853){_0x5e7283[_0x1ebe('0x89')]=_0xc35853;return _0x5e7283;});}return _0x5e7283;});};exports[_0x1ebe('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x6ad5=['resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.mp3','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','action','actionIncomplete','fulfillment','speech','score','status','code','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','tildeASR','Tilde\x20ASR\x20confidence','polly','awsLex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','util','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','end','transcode','wav','finish\x20to\x20convert','start'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ad5,0x170));var _0x56ad=function(_0x3a9637,_0x51f973){_0x3a9637=_0x3a9637-0x0;var _0xf32cc9=_0x6ad5[_0x3a9637];return _0xf32cc9;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x56ad('0x0'));var dialogflow=require(_0x56ad('0x1'));var fs=require('fs');var http=require(_0x56ad('0x2'));var https=require(_0x56ad('0x3'));var md5=require(_0x56ad('0x4'));var path=require(_0x56ad('0x5'));var querystring=require(_0x56ad('0x6'));var rp=require(_0x56ad('0x7'));var rs=require(_0x56ad('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x56ad('0x9'))['parse'];var util=require(_0x56ad('0xa'));var aws=require(_0x56ad('0xb'));var google=require('./google');var sestek=require(_0x56ad('0xc'));var tilde=require(_0x56ad('0xd'));var logger=require('../../../config/logger')(_0x56ad('0xe'));var ISPEECH_API=_0x56ad('0xf');function downloadFile(_0x68800a,_0x5c7d36){return new BPromise(function(_0x34e0ef,_0x1a6723){var _0x3c46c8=urlParse(_0x68800a);var _0x570bdd=_0x3c46c8[_0x56ad('0x10')]===_0x56ad('0x11')?https:http;var _0x22398b={'host':_0x3c46c8[_0x56ad('0x12')],'path':_0x3c46c8['path'],'headers':{'user-agent':_0x56ad('0x13')}};_0x570bdd[_0x56ad('0x14')](_0x22398b,function(_0x2d79a1){if(_0x2d79a1[_0x56ad('0x15')]!==0xc8){logger[_0x56ad('0x16')](_0x56ad('0x17')+_0x68800a+_0x56ad('0x18')+_0x2d79a1[_0x56ad('0x15')]+'\x20('+_0x2d79a1[_0x56ad('0x19')]+')');_0x1a6723(new Error(_0x56ad('0x17')+_0x68800a+'\x20failed,\x20status\x20code\x20=\x20'+_0x2d79a1[_0x56ad('0x15')]+'\x20('+_0x2d79a1['statusMessage']+')'));return;}var _0x43a4af=fs[_0x56ad('0x1a')](_0x5c7d36);_0x43a4af['on'](_0x56ad('0x1b'),function(){logger[_0x56ad('0x1c')](_0x56ad('0x1d'));_0x43a4af[_0x56ad('0x1e')](_0x34e0ef);});_0x43a4af['on'](_0x56ad('0x16'),function(_0x1b9069){fs['unlink'](_0x5c7d36);logger['error'](_0x56ad('0x1f'),_0x1b9069);_0x1a6723(_0x1b9069);});_0x2d79a1['pipe'](_0x43a4af);})['on'](_0x56ad('0x16'),function(_0x236a3b){logger[_0x56ad('0x16')](_0x236a3b);_0x1a6723(_0x236a3b);})[_0x56ad('0x20')]();});}function uploadFile(_0x2c0f53){return new BPromise(function(_0xafd03f,_0x1748df){var _0xce15b8=urlParse(_0x2c0f53);var _0x380c94=_0xce15b8[_0x56ad('0x10')]===_0x56ad('0x11')?https:http;var _0x4c2f0e={'host':_0xce15b8[_0x56ad('0x12')],'path':_0xce15b8['path'],'headers':{'user-agent':_0x56ad('0x13')}};_0x380c94[_0x56ad('0x14')](_0x4c2f0e,function(_0x564254){if(_0x564254[_0x56ad('0x15')]!==0xc8){_0x1748df(new Error(_0x56ad('0x17')+_0x2c0f53+'\x20failed,\x20status\x20code\x20=\x20'+_0x564254[_0x56ad('0x15')]+'\x20('+_0x564254['statusMessage']+')'));return;}var _0x3b02d4='';_0x564254['on']('data',function(_0x168404){_0x3b02d4+=_0x168404;});_0x564254['on'](_0x56ad('0x20'),function(){_0xafd03f(_0x3b02d4);});})['on'](_0x56ad('0x16'),function(_0x2c60d8){_0x1748df(_0x2c60d8);})[_0x56ad('0x20')]();});}function convertFile(_0x597a82,_0x5cb484){return new BPromise(function(_0x1caa50,_0x43cc64){var _0x755f7b=sox[_0x56ad('0x21')](_0x597a82,_0x5cb484,{'sampleRate':0x1f40,'format':_0x56ad('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x755f7b['on'](_0x56ad('0x16'),function(_0x34bf46){logger[_0x56ad('0x16')]('error\x20convert',_0x34bf46);_0x43cc64(_0x34bf46);});_0x755f7b['on']('end',function(){logger[_0x56ad('0x1c')](_0x56ad('0x23'));_0x1caa50();});_0x755f7b[_0x56ad('0x24')]();});}function base64Decode(_0x202b73,_0x121321){var _0x589b32=path[_0x56ad('0x25')](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+_0x56ad('0x28'));fs[_0x56ad('0x29')](_0x589b32,_0x202b73,_0x56ad('0x2a'));return convertFile(_0x589b32,_0x121321)[_0x56ad('0x2b')](function(){try{fs[_0x56ad('0x2c')](_0x589b32);fs[_0x56ad('0x2d')](_0x121321,_0x56ad('0x2e'));}catch(_0x2e89ec){logger[_0x56ad('0x16')](_0x2e89ec);}return _0x121321[_0x56ad('0x2f')]('.')[0x0];});}function base64Encode(_0x40491d){var _0x2ec40e=fs[_0x56ad('0x30')](_0x40491d);return new Buffer(_0x2ec40e)[_0x56ad('0x31')](_0x56ad('0x2a'));}exports[_0x56ad('0x32')]=function(_0x2accbe,_0x1bbb09,_0x351740,_0x3fd786,_0x38efd1,_0x4e6c50){var _0x326eb3,_0x2fa3b4;var _0x54f50d='https://texttospeech.googleapis.com/v1/';var _0x34915f=_0x56ad('0x33')+_0x2accbe;var _0x14c3c0={};if(_0x1bbb09===_0x56ad('0x34')){_0x14c3c0[_0x56ad('0x35')]={'ssml':_0x351740};}else{_0x14c3c0['input']={'text':_0x351740};};_0x14c3c0[_0x56ad('0x36')]={'languageCode':_0x3fd786,'ssmlGender':_0x38efd1};_0x14c3c0[_0x56ad('0x37')]={'audioEncoding':_0x56ad('0x38'),'sampleRateHertz':0x1f40};var _0x37222f={'url':_0x54f50d+_0x56ad('0x39')+_0x34915f,'method':_0x56ad('0x3a'),'json':!![],'body':_0x14c3c0};return rp(_0x37222f)[_0x56ad('0x2b')](function(_0x118077){return new BPromise(function(_0x3d32e6,_0xeef7f3){_0x326eb3=path[_0x56ad('0x25')](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+'.mp3');var _0x4767ce=Buffer[_0x56ad('0x3b')](_0x118077[_0x56ad('0x3c')],_0x56ad('0x2a'));return fs[_0x56ad('0x3d')](_0x326eb3,_0x4767ce,function(_0x25e288){_0xeef7f3(_0x25e288);},function(_0x1b7486){fs[_0x56ad('0x2d')](_0x326eb3,_0x56ad('0x2e'));_0x3d32e6(_0x1b7486);});});})['then'](function(_0x17d17c){_0x2fa3b4=path[_0x56ad('0x25')](__dirname,'tmp',rs[_0x56ad('0x27')](0x4)+'.wav');return convertFile(_0x326eb3,_0x2fa3b4);})[_0x56ad('0x2b')](function(){try{fs[_0x56ad('0x2c')](_0x326eb3);fs[_0x56ad('0x2d')](_0x2fa3b4,_0x56ad('0x2e'));}catch(_0x438b19){logger[_0x56ad('0x16')](_0x438b19);}logger[_0x56ad('0x1c')](_0x56ad('0x3e'),_0x2fa3b4['split']('.')[0x0]);return _0x2fa3b4[_0x56ad('0x2f')]('.')[0x0];});};exports[_0x56ad('0x3f')]=function(_0x20fb8c,_0x51e545){var _0x1514dd=_0x56ad('0x40');var _0x3819a0,_0x382424;var _0x17845c;var _0x475885={'encoding':_0x56ad('0x41'),'method':_0x56ad('0x3a'),'timeout':0x2710,'url':_0x1514dd,'headers':{'Content-Type':_0x56ad('0x42')},'body':_0x56ad('0x43')+encodeURIComponent(JSON[_0x56ad('0x44')]([[[_0x56ad('0x45'),JSON[_0x56ad('0x44')]([_0x20fb8c,_0x51e545||'en',![],_0x56ad('0x46')]),null,_0x56ad('0x47')]]]))};return rp(_0x475885)[_0x56ad('0x2b')](function(_0x26cfb4){try{_0x17845c=eval(_0x26cfb4[_0x56ad('0x48')](0x5))[0x0][0x2];}catch(_0x354ab1){throw new Error(_0x56ad('0x49')+_0x26cfb4[_0x56ad('0x4a')]);}if(!_0x17845c){if(_0x20fb8c[_0x56ad('0x4b')]>0xc8){throw new Error(_0x56ad('0x4c'));}else{throw new Error('lang\x20\x22'+_0x51e545+_0x56ad('0x4d'));}}try{_0x17845c=eval(_0x17845c)[0x0];}catch(_0x5d8014){throw new Error(_0x56ad('0x49')+res['data']);}const _0x3587d2=_0x17845c;_0x3819a0=path['resolve'](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+_0x56ad('0x4e'));fs[_0x56ad('0x29')](_0x3819a0,_0x17845c,{'encoding':'base64'});_0x382424=path[_0x56ad('0x25')](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+'.wav');return convertFile(_0x3819a0,_0x382424);})[_0x56ad('0x2b')](function(){try{fs[_0x56ad('0x2c')](_0x3819a0);fs[_0x56ad('0x2d')](_0x382424,'777');}catch(_0xeaa593){logger[_0x56ad('0x16')](_0xeaa593);}logger[_0x56ad('0x1c')]('goggleTTS\x20path',_0x382424[_0x56ad('0x2f')]('.')[0x0]);return _0x382424[_0x56ad('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0xa646dd,_0x3c3cf5,_0x46c122){return google[_0x56ad('0x4f')](_0xa646dd,_0x3c3cf5,_0x46c122)[_0x56ad('0x2b')](function(_0x9b5b00){logger[_0x56ad('0x1c')](_0x9b5b00['uri']);return rp(_0x9b5b00);})[_0x56ad('0x2b')](function(_0x4967ab){var _0x385c3f='';var _0xe502d2=0x0;try{fs['unlink'](_0xa646dd);}catch(_0x5201d7){logger[_0x56ad('0x16')](_0x5201d7);}if(_0x4967ab&&_0x4967ab[_0x56ad('0x50')]){_0x385c3f=_0x4967ab[_0x56ad('0x50')][_0x56ad('0x51')](function(_0x14788e){return _0x14788e&&_0x14788e[_0x56ad('0x52')][0x0]&&_0x14788e[_0x56ad('0x52')][0x0][_0x56ad('0x53')]?_0x14788e[_0x56ad('0x52')][0x0][_0x56ad('0x53')]:'';})[_0x56ad('0x54')]('\x0a');_0xe502d2=_0x4967ab[_0x56ad('0x50')][_0x56ad('0x51')](function(_0x3bff03){return _0x3bff03&&_0x3bff03[_0x56ad('0x52')][0x0]&&_0x3bff03[_0x56ad('0x52')][0x0][_0x56ad('0x55')]?_0x3bff03['alternatives'][0x0][_0x56ad('0x55')]:0x0;})[_0x56ad('0x54')]('\x0a');}logger[_0x56ad('0x1c')](_0x56ad('0x56'),_0x385c3f);logger[_0x56ad('0x1c')](_0x56ad('0x57'),_0xe502d2);return{'transcript':_0x385c3f,'confidence':_0xe502d2};})['catch'](function(_0x1add17){logger['error'](_0x56ad('0x58'),_0x1add17['statusCode'],_0x1add17[_0x56ad('0x59')],_0x1add17[_0x56ad('0x5a')]);});};exports[_0x56ad('0x5b')]=function(_0x5bb37d,_0x5df2b1,_0x3bedb2,_0x447d94){var _0x20ec57=apiai(_0x5df2b1,{'language':_0x447d94||'en'});return _0x20ec57[_0x56ad('0x5c')](_0x3bedb2,{'sessionId':md5(_0x5bb37d)})[_0x56ad('0x2b')](function(_0x2703e9){logger[_0x56ad('0x1c')](JSON[_0x56ad('0x44')](_0x2703e9));return{'source':_0x2703e9[_0x56ad('0x5d')]['source'],'resolvedQuery':_0x2703e9['result']['resolvedQuery'],'action':_0x2703e9['result'][_0x56ad('0x5e')],'actionIncomplete':_0x2703e9[_0x56ad('0x5d')][_0x56ad('0x5f')],'speech':_0x2703e9[_0x56ad('0x5d')][_0x56ad('0x60')][_0x56ad('0x61')],'score':_0x2703e9[_0x56ad('0x5d')][_0x56ad('0x62')],'statusCode':_0x2703e9[_0x56ad('0x63')][_0x56ad('0x64')],'endConversation':_0x2703e9[_0x56ad('0x5d')]['metadata']['endConversation']||![],'isFallbackIntent':_0x2703e9['result']['metadata']['isFallbackIntent']};});};exports[_0x56ad('0x65')]=function(_0x10c9c9,_0x483ea9,_0xe2bcc5,_0x258425,_0x1b76a3,_0x302551){var _0x57dba2=_0x258425[_0x56ad('0x66')](/\\n/g,'\x0a');var _0x43de27={'credentials':{'private_key':_0x57dba2,'client_email':_0xe2bcc5}};var _0x25a2e0=new dialogflow[(_0x56ad('0x67'))](_0x43de27);var _0x533c74=_0x25a2e0[_0x56ad('0x68')](_0x483ea9,md5(_0x10c9c9));var _0x5b8e52={'session':_0x533c74,'queryInput':{'text':{'text':_0x1b76a3,'languageCode':_0x302551}}};return _0x25a2e0[_0x56ad('0x69')](_0x5b8e52)[_0x56ad('0x2b')](function(_0x165a0f){if(_0x165a0f&&_0x165a0f[_0x56ad('0x4b')]){logger[_0x56ad('0x1c')]('Dialogflow\x20V2\x20response:',JSON[_0x56ad('0x44')](_0x165a0f));var _0x21a096=_0x165a0f[0x0];if(_0x21a096){var _0xfb6ad={'action':_0x21a096[_0x56ad('0x6a')]['action'],'allRequiredParamsPresent':_0x21a096[_0x56ad('0x6a')][_0x56ad('0x6b')],'endConversation':_0x21a096['queryResult'][_0x56ad('0x6c')]&&_0x21a096['queryResult'][_0x56ad('0x6c')]['fields']?_0x21a096['queryResult'][_0x56ad('0x6c')][_0x56ad('0x6d')][_0x56ad('0x6e')][_0x56ad('0x6f')]:![],'fulfillmentText':_0x21a096['queryResult'][_0x56ad('0x70')],'intentName':_0x21a096[_0x56ad('0x6a')][_0x56ad('0x71')]['name'],'intentDisplayName':_0x21a096[_0x56ad('0x6a')][_0x56ad('0x71')][_0x56ad('0x72')],'isFallbackIntent':_0x21a096['queryResult'][_0x56ad('0x71')][_0x56ad('0x73')],'languageCode':_0x21a096[_0x56ad('0x6a')]['languageCode'],'queryText':_0x21a096[_0x56ad('0x6a')][_0x56ad('0x74')],'responseId':_0x21a096[_0x56ad('0x75')],'score':_0x21a096[_0x56ad('0x6a')]['intentDetectionConfidence'],'speech':_0x21a096[_0x56ad('0x6a')][_0x56ad('0x70')],'providerResponse':JSON[_0x56ad('0x44')](_0x165a0f)};return _0xfb6ad;}}});};exports[_0x56ad('0x76')]=function(_0x2b4a73,_0x28fecf,_0xae0d2c,_0x506903){return tilde[_0x56ad('0x4f')](_0x2b4a73,_0x28fecf,_0xae0d2c,_0x506903)['then'](function(_0x275e6f){try{fs[_0x56ad('0x2c')](_0x2b4a73);}catch(_0x480d26){logger[_0x56ad('0x16')](_0x480d26);}logger[_0x56ad('0x1c')]('Tilde\x20ASR\x20transcription',_0x275e6f['transcript']);logger[_0x56ad('0x1c')](_0x56ad('0x77'),_0x275e6f[_0x56ad('0x55')]);return _0x275e6f;});};exports['awsPolly']=function(_0x15e307,_0x117495,_0x1e0390,_0x529faa,_0x182766,_0x4aeb04){var _0xa3bdbe=path['resolve'](__dirname,'tmp',rs[_0x56ad('0x27')](0x4)+'.mp3');var _0x292b10;return aws[_0x56ad('0x78')](_0x15e307,_0x117495,_0x1e0390,_0x529faa,_0x182766,_0x4aeb04,_0xa3bdbe)[_0x56ad('0x2b')](function(){_0x292b10=path['resolve'](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+_0x56ad('0x28'));return convertFile(_0xa3bdbe,_0x292b10);})[_0x56ad('0x2b')](function(){try{fs[_0x56ad('0x2c')](_0xa3bdbe);fs[_0x56ad('0x2d')](_0x292b10,_0x56ad('0x2e'));}catch(_0x48a3b9){logger[_0x56ad('0x16')](_0x48a3b9);}return _0x292b10[_0x56ad('0x2f')]('.')[0x0];});};exports[_0x56ad('0x79')]=function(_0x1b1e3d,_0x259faf,_0x14d0f1,_0x81892e,_0x5833b8,_0x2f0951){return aws['lex'](_0x1b1e3d,_0x259faf,_0x14d0f1,_0x81892e,_0x5833b8,_0x2f0951)[_0x56ad('0x2b')](function(_0x472767){logger['info'](JSON[_0x56ad('0x44')](_0x472767));return _0x472767;});};exports['ispeechTTS']=function(_0x3575d8,_0xdf4662,_0x4f2171,_0x5bbfc6){var _0x201e9a=util['format'](_0x56ad('0x7a'),ISPEECH_API,_0x3575d8,encodeURIComponent(_0xdf4662),_0x4f2171,_0x5bbfc6);var _0xc41388=path[_0x56ad('0x25')](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+_0x56ad('0x4e'));var _0x2a310b;return downloadFile(_0x201e9a,_0xc41388)['then'](function(){_0x2a310b=path['resolve'](__dirname,'tmp',rs[_0x56ad('0x27')](0x4)+'.wav');return convertFile(_0xc41388,_0x2a310b);})[_0x56ad('0x2b')](function(){try{fs['unlink'](_0xc41388);fs[_0x56ad('0x2d')](_0x2a310b,_0x56ad('0x2e'));}catch(_0x590c10){logger[_0x56ad('0x16')](_0x590c10);}return _0x2a310b['split']('.')[0x0];});};exports[_0x56ad('0x7b')]=function(_0x3e3e36,_0xc9b84c,_0x18b329,_0x1501c6){var _0x44ebf3=util[_0x56ad('0x7c')](_0x56ad('0x7d'),ISPEECH_API,_0xc9b84c,_0x18b329,base64Encode(_0x3e3e36),_0x1501c6?util['format'](_0x56ad('0x7e'),encodeURIComponent(_0x1501c6)):'freeform=3');return uploadFile(_0x44ebf3)[_0x56ad('0x2b')](function(_0x1246f7){return querystring['parse'](_0x1246f7);});};exports[_0x56ad('0x7f')]=function(_0xe5555a,_0x210f29){return sestek[_0x56ad('0x80')](_0xe5555a,_0x210f29)[_0x56ad('0x2b')](function(_0x1f2d8f){logger[_0x56ad('0x1c')](JSON[_0x56ad('0x44')](_0x1f2d8f));var _0x5406ba={'speech':_0x1f2d8f[_0x56ad('0x81')],'action':_0x1f2d8f[_0x56ad('0x82')]?_0x1f2d8f[_0x56ad('0x82')][_0x56ad('0x83')]:undefined,'actiondata':_0x1f2d8f['channelData']?_0x1f2d8f[_0x56ad('0x82')]['CustomActionData']:undefined};if(_0x1f2d8f[_0x56ad('0x82')]&&_0x1f2d8f[_0x56ad('0x82')][_0x56ad('0x84')]){return base64Decode(_0x1f2d8f[_0x56ad('0x82')][_0x56ad('0x84')][_0x56ad('0x85')],path[_0x56ad('0x25')](__dirname,_0x56ad('0x26'),rs[_0x56ad('0x27')](0x4)+_0x56ad('0x28')))[_0x56ad('0x2b')](function(_0x303e87){_0x5406ba[_0x56ad('0x86')]=_0x303e87;return _0x5406ba;});}return _0x5406ba;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 3adf0b4..397efb0 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 _0xebc4=['exports','./nda'];(function(_0x1c02f7,_0x217c81){var _0x53ce2c=function(_0x4b341d){while(--_0x4b341d){_0x1c02f7['push'](_0x1c02f7['shift']());}};_0x53ce2c(++_0x217c81);}(_0xebc4,0x93));var _0x4ebc=function(_0x297fc9,_0x1c1166){_0x297fc9=_0x297fc9-0x0;var _0x558bc3=_0xebc4[_0x297fc9];return _0x558bc3;};var nda=require(_0x4ebc('0x0'));module[_0x4ebc('0x1')]={'nda':nda}; \ No newline at end of file +var _0xc13e=['./nda','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc13e,0x19e));var _0xec13=function(_0x2612b7,_0x31aacf){_0x2612b7=_0x2612b7-0x0;var _0x11a121=_0xc13e[_0x2612b7];return _0x11a121;};var nda=require(_0xec13('0x0'));module[_0xec13('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 095aa2b..36029a6 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 _0x6b20=['AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','agi','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','message','callerid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x6b20,0xd1));var _0x06b2=function(_0x126d19,_0x22a156){_0x126d19=_0x126d19-0x0;var _0x22d1b7=_0x6b20[_0x126d19];return _0x22d1b7;};'use strict';var rp=require(_0x06b2('0x0'));var url=require(_0x06b2('0x1'));var logger=require('../../../../../config/logger')(_0x06b2('0x2'));module['exports']=function(_0x257191,_0xdcad44){var _0x353f6a={'method':'POST','uri':url[_0x06b2('0x3')](_0xdcad44[_0x06b2('0x4')],_0x06b2('0x5')),'form':{'grant_type':_0x06b2('0x6'),'username':_0xdcad44[_0x06b2('0x7')],'password':_0xdcad44[_0x06b2('0x6')]},'json':!![]};return rp(_0x353f6a)[_0x06b2('0x8')](function(_0x4e6d3b){var _0x21cd31={'method':_0x06b2('0x9'),'uri':url[_0x06b2('0x3')](_0xdcad44['ndassistant_url'],_0x06b2('0xa')),'body':{'type':_0xdcad44['ndaactivity_type']||_0x06b2('0xb'),'channelId':'Nda','conversation':{'id':_0x257191['uniqueid']},'from':{'id':_0x257191[_0x06b2('0xc')],'name':_0x257191[_0x06b2('0xd')]},'recipient':{'id':_0x257191['dnid'],'name':_0x257191[_0x06b2('0xe')]},'text':_0xdcad44[_0x06b2('0xf')],'channelData':{}},'headers':{'Authorization':_0x06b2('0x10')+_0x4e6d3b[_0x06b2('0x11')]},'json':!![]};if(_0xdcad44[_0x06b2('0x12')]){_0x21cd31[_0x06b2('0x13')][_0x06b2('0x14')][_0x06b2('0x15')]=_0xdcad44[_0x06b2('0x12')];}if(_0xdcad44[_0x06b2('0x16')]=='1'){_0x21cd31[_0x06b2('0x13')][_0x06b2('0x14')][_0x06b2('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xdcad44[_0x06b2('0x18')]){_0x21cd31[_0x06b2('0x13')][_0x06b2('0x14')][_0x06b2('0x19')]=_0xdcad44[_0x06b2('0x18')];if(_0xdcad44[_0x06b2('0x1a')]){_0x21cd31['body'][_0x06b2('0x14')][_0x06b2('0x1b')]=_0xdcad44['custom_action_data'];}}logger[_0x06b2('0x1c')](JSON['stringify'](_0x21cd31));return rp(_0x21cd31);});}; \ No newline at end of file +var _0x4198=['CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','Bearer\x20','access_token','project','ProjectName','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data'];(function(_0x353d1b,_0x20ce87){var _0x5e3f3c=function(_0x3f4ff1){while(--_0x3f4ff1){_0x353d1b['push'](_0x353d1b['shift']());}};_0x5e3f3c(++_0x20ce87);}(_0x4198,0x69));var _0x8419=function(_0x37332d,_0x244341){_0x37332d=_0x37332d-0x0;var _0x2779c8=_0x4198[_0x37332d];return _0x2779c8;};'use strict';var rp=require(_0x8419('0x0'));var url=require('url');var logger=require(_0x8419('0x1'))(_0x8419('0x2'));module[_0x8419('0x3')]=function(_0x1e7a2f,_0x182359){var _0x144c71={'method':_0x8419('0x4'),'uri':url[_0x8419('0x5')](_0x182359[_0x8419('0x6')],_0x8419('0x7')),'form':{'grant_type':'password','username':_0x182359[_0x8419('0x8')],'password':_0x182359[_0x8419('0x9')]},'json':!![]};return rp(_0x144c71)[_0x8419('0xa')](function(_0x2043cd){var _0x45c2b5={'method':_0x8419('0x4'),'uri':url[_0x8419('0x5')](_0x182359[_0x8419('0xb')],_0x8419('0xc')),'body':{'type':_0x182359[_0x8419('0xd')]||_0x8419('0xe'),'channelId':_0x8419('0xf'),'conversation':{'id':_0x1e7a2f[_0x8419('0x10')]},'from':{'id':_0x1e7a2f[_0x8419('0x11')],'name':_0x1e7a2f[_0x8419('0x12')]},'recipient':{'id':_0x1e7a2f['dnid'],'name':_0x1e7a2f[_0x8419('0x13')]},'text':_0x182359['text'],'channelData':{}},'headers':{'Authorization':_0x8419('0x14')+_0x2043cd[_0x8419('0x15')]},'json':!![]};if(_0x182359[_0x8419('0x16')]){_0x45c2b5['body']['channelData'][_0x8419('0x17')]=_0x182359[_0x8419('0x16')];}if(_0x182359['ndagenerate_audio']=='1'){_0x45c2b5[_0x8419('0x18')][_0x8419('0x19')][_0x8419('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8419('0x1b')};}if(_0x182359[_0x8419('0x1c')]){_0x45c2b5['body'][_0x8419('0x19')][_0x8419('0x1d')]=_0x182359['custom_action'];if(_0x182359[_0x8419('0x1e')]){_0x45c2b5[_0x8419('0x18')][_0x8419('0x19')][_0x8419('0x1f')]=_0x182359[_0x8419('0x1e')];}}logger[_0x8419('0x20')](JSON[_0x8419('0x21')](_0x45c2b5));return rp(_0x45c2b5);});}; \ 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 8e3a176..f4b6c86 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 _0x9672=['./lib/api','exports'];(function(_0x90960c,_0x3d7485){var _0x1ce806=function(_0x10a2fb){while(--_0x10a2fb){_0x90960c['push'](_0x90960c['shift']());}};_0x1ce806(++_0x3d7485);}(_0x9672,0xee));var _0x2967=function(_0x50a014,_0x2f7893){_0x50a014=_0x50a014-0x0;var _0x253538=_0x9672[_0x50a014];return _0x253538;};'use strict';var asr=require(_0x2967('0x0'));module[_0x2967('0x1')]=function(_0x5a8035,_0x1d8106,_0xcaaf25,_0x1228b8){return asr(_0x5a8035,_0x1d8106,_0xcaaf25,_0x1228b8);}; \ No newline at end of file +var _0xe0de=['./lib/api'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe0de,0x128));var _0xee0d=function(_0x4783d0,_0x4b840b){_0x4783d0=_0x4783d0-0x0;var _0x1555a2=_0xe0de[_0x4783d0];return _0x1555a2;};'use strict';var asr=require(_0xee0d('0x0'));module['exports']=function(_0x1cd9c8,_0x20f004,_0x49406c,_0x2f20ab){return asr(_0x1cd9c8,_0x20f004,_0x49406c,_0x2f20ab);}; \ 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 c647e75..406efe0 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 _0xb984=['error','stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','info','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.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','moment','crypto','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','send','close'];(function(_0x2166a3,_0x237c50){var _0x260035=function(_0x2dbfa2){while(--_0x2dbfa2){_0x2166a3['push'](_0x2166a3['shift']());}};_0x260035(++_0x237c50);}(_0xb984,0x11f));var _0x4b98=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb984[_0x487b0c];return _0x1adbdc;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4b98('0x0'));var crypto=require(_0x4b98('0x1'));var logger=require('../../../../../../config/logger')(_0x4b98('0x2'));module[_0x4b98('0x3')]=function(_0x1382bb,_0x4aa2c7,_0x446fcd,_0x104b0c){return new BPromise(function(_0x5df96c,_0x376e1f){logger['info'](_0x4b98('0x4'),_0x104b0c||_0x4b98('0x5'));var _0x4afe56=new WebSocket(_0x104b0c||_0x4b98('0x5'),{'perMessageDeflate':![]});var _0x1c811e='';var _0xf0b3eb='0';var _0x4f865d='1';var _0x185d50='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2d9ecd(_0xae2dea){var _0x163d89=crypto[_0x4b98('0x6')](_0x4b98('0x7'));_0x163d89[_0x4b98('0x8')](_0xae2dea);return _0x163d89[_0x4b98('0x9')](_0x4b98('0xa'));}function _0x237c77(){try{logger['info'](_0x4b98('0xb'));var _0x41d580=moment()[_0x4b98('0xc')]();var _0x5944ee=_0x2d9ecd(_0x41d580+_0x4aa2c7+_0x446fcd);_0x4afe56['send'](JSON['stringify']({'appID':_0x4aa2c7,'timestamp':_0x41d580,'appKey':_0x5944ee}));var _0x5c2054=fs[_0x4b98('0xd')](_0x1382bb);_0x5c2054['on'](_0x4b98('0xe'),function(_0x2de61a){_0x4afe56[_0x4b98('0xf')](_0x2de61a);});_0x5c2054['on'](_0x4b98('0x10'),function(){_0x4afe56[_0x4b98('0xf')]('EOS');});}catch(_0x298a0b){logger[_0x4b98('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0x4b98('0x12')](_0x298a0b));_0x4afe56[_0x4b98('0x13')]();}}function _0x5b00d6(_0x4e710a){try{if(_0x4e710a){var _0x4439d9=JSON['parse'](_0x4e710a);switch(_0x4439d9[_0x4b98('0x14')]){case 0x0:if(_0x4439d9[_0x4b98('0x15')]){if(_0x4439d9[_0x4b98('0x15')][_0x4b98('0x16')]){logger['info'](_0x4b98('0x17'),JSON[_0x4b98('0x12')](_0x4439d9['result']['hypotheses']));_0x1c811e=_0x4439d9[_0x4b98('0x15')][_0x4b98('0x18')][0x0][_0x4b98('0x19')];_0xf0b3eb=_0x4439d9['result'][_0x4b98('0x18')][0x0][_0x4b98('0x1a')];_0x4f865d='0';_0x185d50='Success.';_0x4afe56[_0x4b98('0x13')]();}}break;case 0x1:logger[_0x4b98('0x1b')](_0x4b98('0x1c'));_0x4f865d='1';_0x185d50=_0x4b98('0x1c');break;case 0x2:logger[_0x4b98('0x1b')](_0x4b98('0x1d'));_0x4f865d='2';_0x185d50=_0x4b98('0x1d');break;case 0x9:logger[_0x4b98('0x1b')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4f865d='9';_0x185d50=_0x4b98('0x1e');break;case 0xa:logger[_0x4b98('0x1b')](_0x4b98('0x1f'));_0x4f865d='10';_0x185d50=_0x4b98('0x1f');break;case 0xb:logger[_0x4b98('0x1b')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4f865d='11';_0x185d50=_0x4b98('0x20');}}}catch(_0x3be1eb){logger[_0x4b98('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x4b98('0x12')](_0x3be1eb));_0x4afe56[_0x4b98('0x13')]();}}function _0x2aba57(){logger['info'](_0x4b98('0x21'));_0x5df96c({'transcript':_0x1c811e,'confidence':_0xf0b3eb,'status':_0x4f865d,'status_message':_0x185d50});}function _0x1dbbb9(_0x5d19e7){logger['error'](_0x4b98('0x22'));if(!_[_0x4b98('0x23')](_0x5d19e7)){logger['error'](_[_0x4b98('0x24')](_0x5d19e7)?JSON[_0x4b98('0x12')](_0x5d19e7):_0x5d19e7);}}_0x4afe56['on']('open',_0x237c77);_0x4afe56['on'](_0x4b98('0x25'),_0x5b00d6);_0x4afe56['on'](_0x4b98('0x10'),_0x2aba57);_0x4afe56['on'](_0x4b98('0x11'),_0x1dbbb9);});}; \ No newline at end of file +var _0xb21d=['Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','agi','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','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x22b64b,_0x5de02f){var _0x2b24de=function(_0x4c2051){while(--_0x4c2051){_0x22b64b['push'](_0x22b64b['shift']());}};_0x2b24de(++_0x5de02f);}(_0xb21d,0xf0));var _0xdb21=function(_0x29fd7b,_0x5859a7){_0x29fd7b=_0x29fd7b-0x0;var _0x2d2d07=_0xb21d[_0x29fd7b];return _0x2d2d07;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdb21('0x0'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0xdb21('0x1'));module['exports']=function(_0x17db82,_0x417dd8,_0x44aebc,_0x39a9a6){return new BPromise(function(_0x425028,_0x3e98ab){logger[_0xdb21('0x2')]('Tilde\x20URI',_0x39a9a6||_0xdb21('0x3'));var _0x310dab=new WebSocket(_0x39a9a6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4a5c27='';var _0xced5db='0';var _0x5c272c='1';var _0x224030=_0xdb21('0x4');function _0xad9ade(_0x57be4b){var _0x5e52ba=crypto[_0xdb21('0x5')]('sha1');_0x5e52ba[_0xdb21('0x6')](_0x57be4b);return _0x5e52ba[_0xdb21('0x7')]('hex');}function _0x49955a(){try{logger[_0xdb21('0x2')](_0xdb21('0x8'));var _0x340702=moment()['unix']();var _0x906ef0=_0xad9ade(_0x340702+_0x417dd8+_0x44aebc);_0x310dab[_0xdb21('0x9')](JSON[_0xdb21('0xa')]({'appID':_0x417dd8,'timestamp':_0x340702,'appKey':_0x906ef0}));var _0x448e96=fs[_0xdb21('0xb')](_0x17db82);_0x448e96['on']('data',function(_0x3884b0){_0x310dab[_0xdb21('0x9')](_0x3884b0);});_0x448e96['on'](_0xdb21('0xc'),function(){_0x310dab[_0xdb21('0x9')](_0xdb21('0xd'));});}catch(_0x375d24){logger[_0xdb21('0xe')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x375d24));_0x310dab[_0xdb21('0xf')]();}}function _0x246195(_0x25bba5){try{if(_0x25bba5){var _0x164caa=JSON[_0xdb21('0x10')](_0x25bba5);switch(_0x164caa[_0xdb21('0x11')]){case 0x0:if(_0x164caa[_0xdb21('0x12')]){if(_0x164caa[_0xdb21('0x12')][_0xdb21('0x13')]){logger[_0xdb21('0x2')](_0xdb21('0x14'),JSON[_0xdb21('0xa')](_0x164caa[_0xdb21('0x12')]['hypotheses']));_0x4a5c27=_0x164caa[_0xdb21('0x12')][_0xdb21('0x15')][0x0]['transcript'];_0xced5db=_0x164caa[_0xdb21('0x12')]['hypotheses'][0x0][_0xdb21('0x16')];_0x5c272c='0';_0x224030='Success.';_0x310dab['terminate']();}}break;case 0x1:logger[_0xdb21('0x2')](_0xdb21('0x4'));_0x5c272c='1';_0x224030='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xdb21('0x2')](_0xdb21('0x17'));_0x5c272c='2';_0x224030=_0xdb21('0x17');break;case 0x9:logger[_0xdb21('0x2')](_0xdb21('0x18'));_0x5c272c='9';_0x224030=_0xdb21('0x18');break;case 0xa:logger[_0xdb21('0x2')](_0xdb21('0x19'));_0x5c272c='10';_0x224030=_0xdb21('0x19');break;case 0xb:logger[_0xdb21('0x2')](_0xdb21('0x1a'));_0x5c272c='11';_0x224030=_0xdb21('0x1a');}}}catch(_0x2be752){logger[_0xdb21('0xe')](_0xdb21('0x1b'),JSON[_0xdb21('0xa')](_0x2be752));_0x310dab[_0xdb21('0xf')]();}}function _0x5782e6(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x425028({'transcript':_0x4a5c27,'confidence':_0xced5db,'status':_0x5c272c,'status_message':_0x224030});}function _0x3675cc(_0x35b223){logger['error'](_0xdb21('0x1c'));if(!_[_0xdb21('0x1d')](_0x35b223)){logger[_0xdb21('0xe')](_[_0xdb21('0x1e')](_0x35b223)?JSON[_0xdb21('0xa')](_0x35b223):_0x35b223);}}_0x310dab['on'](_0xdb21('0x1f'),_0x49955a);_0x310dab['on'](_0xdb21('0x20'),_0x246195);_0x310dab['on'](_0xdb21('0xc'),_0x5782e6);_0x310dab['on'](_0xdb21('0xe'),_0x3675cc);});}; \ 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 9b083c8..f1b8e58 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 _0x70f7=['./asr','exports'];(function(_0x498789,_0x465536){var _0x3f8b64=function(_0x47b635){while(--_0x47b635){_0x498789['push'](_0x498789['shift']());}};_0x3f8b64(++_0x465536);}(_0x70f7,0x16c));var _0x770f=function(_0x112db5,_0x38a06d){_0x112db5=_0x112db5-0x0;var _0x1d7d06=_0x70f7[_0x112db5];return _0x1d7d06;};var asr=require(_0x770f('0x0'));module[_0x770f('0x1')]={'asr':asr}; \ No newline at end of file +var _0xbb66=['exports','./asr'];(function(_0x52d166,_0x40bd4a){var _0x3d8d52=function(_0x4b2b18){while(--_0x4b2b18){_0x52d166['push'](_0x52d166['shift']());}};_0x3d8d52(++_0x40bd4a);}(_0xbb66,0x1cd));var _0x6bb6=function(_0x4151f0,_0x4fc681){_0x4151f0=_0x4151f0-0x0;var _0x535e9f=_0xbb66[_0x4151f0];return _0x535e9f;};var asr=require(_0x6bb6('0x0'));module[_0x6bb6('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 564ca91..00a688d 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 _0x2f04=['E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','EventEmitter','./channel','emit','error','listening','connection'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0x2f04,0xf9));var _0x42f0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x2f04[_0x82129b];return _0x2ae5dc;};'use strict';var util=require(_0x42f0('0x0'));var net=require('net');var EventEmitter=require('events')[_0x42f0('0x1')];var AGIError=require('./error');var AGIChannel=require(_0x42f0('0x2'));var AGIServer=function(_0x10be15,_0x5d2949,_0x371b15){var _0x3c3df4=this,_0x10be15=_0x10be15||0x11dd,_0x5d2949=_0x5d2949||'127.0.0.1',_0x581b55=null,_0x3b8165=0x0;EventEmitter['call'](_0x3c3df4);function _0x5b70e3(){if(!_0x10be15){_0x3c3df4[_0x42f0('0x3')](_0x42f0('0x4'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x581b55=net['createServer']();_0x581b55['listen'](_0x10be15,_0x5d2949);_0x581b55['on']('listening',function(){_0x3c3df4[_0x42f0('0x3')](_0x42f0('0x5'));});_0x581b55['on'](_0x42f0('0x6'),function(_0x1fbf35){_0x581b55['getConnections'](function(_0x2d434d,_0x4484bc){if(_0x2d434d){_0x3c3df4['emit'](_0x42f0('0x4'),new AGIError('E_AGI_SERVER_ERROR',_0x2d434d));}else if(_0x371b15&&_0x371b15<0x0){_0x3c3df4[_0x42f0('0x3')](_0x42f0('0x4'),new AGIError(_0x42f0('0x7')));_0x1fbf35[_0x42f0('0x8')]();}else if(_0x371b15&&_0x371b15>0x0&&_0x371b15<_0x4484bc){_0x3b8165+=0x1;_0x3c3df4['emit'](_0x42f0('0x4'),new AGIError(_0x42f0('0x9'),_0x3b8165));_0x1fbf35['destroy']();}else{var _0x327d40=new AGIChannel(_0x1fbf35);_0x327d40['on']('ready',function(){_0x3c3df4[_0x42f0('0x3')](_0x42f0('0x6'),_0x327d40);});}});});_0x581b55['on']('error',function(_0x3df1ce){_0x3c3df4['emit'](_0x42f0('0x4'),new AGIError(_0x42f0('0xa'),_0x3df1ce[_0x42f0('0xb')]));});_0x581b55['on'](_0x42f0('0xc'),function(){_0x3c3df4[_0x42f0('0x3')](_0x42f0('0xc'),new AGIError(_0x42f0('0xd')));});}process[_0x42f0('0xe')](function(){_0x5b70e3();});};util['inherits'](AGIServer,EventEmitter);module[_0x42f0('0xf')]=function(_0x3ccee9,_0x1781ee,_0x3ac9be){return new AGIServer(_0x3ccee9,_0x1781ee,_0x3ac9be);}; \ No newline at end of file +var _0xe9fe=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0xe9fe,0x169));var _0xee9f=function(_0x4fcb07,_0x4a77a4){_0x4fcb07=_0x4fcb07-0x0;var _0xf2eeb=_0xe9fe[_0x4fcb07];return _0xf2eeb;};'use strict';var util=require(_0xee9f('0x0'));var net=require(_0xee9f('0x1'));var EventEmitter=require(_0xee9f('0x2'))[_0xee9f('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xee9f('0x4'));var AGIServer=function(_0x412c81,_0x719649,_0xdcf360){var _0x2c6a54=this,_0x412c81=_0x412c81||0x11dd,_0x719649=_0x719649||_0xee9f('0x5'),_0x4fb82a=null,_0x3c524c=0x0;EventEmitter[_0xee9f('0x6')](_0x2c6a54);function _0x5b03e2(){if(!_0x412c81){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0x8'),new AGIError(_0xee9f('0x9')));return![];}_0x4fb82a=net[_0xee9f('0xa')]();_0x4fb82a[_0xee9f('0xb')](_0x412c81,_0x719649);_0x4fb82a['on'](_0xee9f('0xc'),function(){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0xc'));});_0x4fb82a['on'](_0xee9f('0xd'),function(_0x53cc9a){_0x4fb82a[_0xee9f('0xe')](function(_0x344a9f,_0x5aeeec){if(_0x344a9f){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0x8'),new AGIError(_0xee9f('0xf'),_0x344a9f));}else if(_0xdcf360&&_0xdcf360<0x0){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0x8'),new AGIError(_0xee9f('0x10')));_0x53cc9a[_0xee9f('0x11')]();}else if(_0xdcf360&&_0xdcf360>0x0&&_0xdcf360<_0x5aeeec){_0x3c524c+=0x1;_0x2c6a54[_0xee9f('0x7')](_0xee9f('0x8'),new AGIError(_0xee9f('0x12'),_0x3c524c));_0x53cc9a[_0xee9f('0x11')]();}else{var _0x459eb8=new AGIChannel(_0x53cc9a);_0x459eb8['on']('ready',function(){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0xd'),_0x459eb8);});}});});_0x4fb82a['on'](_0xee9f('0x8'),function(_0x42cdfc){_0x2c6a54[_0xee9f('0x7')]('error',new AGIError(_0xee9f('0xf'),_0x42cdfc[_0xee9f('0x13')]));});_0x4fb82a['on'](_0xee9f('0x14'),function(){_0x2c6a54[_0xee9f('0x7')](_0xee9f('0x14'),new AGIError(_0xee9f('0x15')));});}process['nextTick'](function(){_0x5b03e2();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x2913a5,_0x486d97,_0x5624ef){return new AGIServer(_0x2913a5,_0x486d97,_0x5624ef);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f0f10ad..2504ceb 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 _0x91c5=['noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','list_id','no\x20list\x20selected','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','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','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','gotoc','continueAt','no\x20condition\x20configured','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','false','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','opts','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayphonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','pass','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','odbc','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProjectById','getSquareOdbcById','dsn','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','callerid','context','extension','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','clone','isString','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x91c5,0x124));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x591c('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x591c('0x1'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x591c('0x2'))(_0x591c('0x3'));var config=require('../../config/environment');var scripts=require(_0x591c('0x4'));var FILES_PATH=_0x591c('0x5');var recursiveMapAttributes=['rawHeaders',_0x591c('0x6')];var verticesWithRetry=['menu',_0x591c('0x7'),_0x591c('0x8')];var AGIVertices=function(_0x143f76,_0x25b045,_0x38ac70){this[_0x591c('0x9')]=_0x143f76;this[_0x591c('0xa')]=_0x25b045;this[_0x591c('0xb')]=_0x38ac70;};AGIVertices[_0x591c('0xc')][_0x591c('0xd')]=function(_0x5c9e,_0x2a3a76){this[_0x591c('0xa')][_0x591c('0xe')](_0x5c9e)[_0x591c('0xf')](function(_0x2c6d89){_0x2a3a76(null,_0x2c6d89?_0x2c6d89['name']:![]);})[_0x591c('0x10')](function(_0x32446f){_0x2a3a76(_0x32446f);});};AGIVertices['prototype'][_0x591c('0x11')]=function(_0x265114,_0x39d254){this[_0x591c('0xa')][_0x591c('0x12')](_0x265114)[_0x591c('0xf')](function(_0x37cf42){_0x39d254(null,_0x37cf42?_0x37cf42[_0x591c('0x13')]:![]);})[_0x591c('0x10')](function(_0x4f029c){_0x39d254(_0x4f029c);});};AGIVertices[_0x591c('0xc')]['getSquareProject']=function(_0x26181c,_0x46b81f){this[_0x591c('0xa')][_0x591c('0x14')](_0x26181c)['then'](function(_0x2fbb24){_0x46b81f(null,_0x2fbb24?_0x2fbb24[_0x591c('0x13')]:![]);})[_0x591c('0x10')](function(_0x457b8f){_0x46b81f(_0x457b8f);});};AGIVertices[_0x591c('0xc')]['getSquareOdbc']=function(_0x380154,_0x15ec33){this[_0x591c('0xa')][_0x591c('0x15')](_0x380154)[_0x591c('0xf')](function(_0x15d9dd){_0x15ec33(null,_0x15d9dd?_0x15d9dd[_0x591c('0x16')]:![]);})[_0x591c('0x10')](function(_0x357718){_0x15ec33(_0x357718);});};AGIVertices[_0x591c('0xc')]['getUser']=function(_0x5e7f53,_0xb80c23){this[_0x591c('0xa')]['getUserById'](_0x5e7f53)[_0x591c('0xf')](function(_0x5bacdd){_0xb80c23(null,_0x5bacdd?_0x5bacdd['name']:![]);})[_0x591c('0x10')](function(_0x598803){_0xb80c23(_0x598803);});};AGIVertices[_0x591c('0xc')][_0x591c('0x17')]=function(_0x2086d4,_0x1c47e5){this[_0x591c('0xa')][_0x591c('0x18')](_0x2086d4)['then'](function(_0x4b315b){_0x1c47e5(null,_0x4b315b?_0x4b315b['name']:![]);})['catch'](function(_0x8d143c){_0x1c47e5(_0x8d143c);});};AGIVertices[_0x591c('0xc')][_0x591c('0x19')]=function(_0x50e603,_0x6e974f){var _0x335cbf=this;this['rpc'][_0x591c('0x1a')](_0x50e603)['then'](function(_0x1edf47){_0x6e974f(null,_0x1edf47?_0x335cbf[_0x591c('0x1b')](_0x1edf47[_0x591c('0x1c')]):![]);})[_0x591c('0x10')](function(_0x103796){_0x6e974f(_0x103796);});};AGIVertices[_0x591c('0xc')][_0x591c('0x1d')]=function(_0x3ab816,_0x44536e){this[_0x591c('0xa')]['getMailAccountById'](_0x3ab816)['then'](function(_0x250adf){_0x44536e(null,_0x250adf?_0x250adf:![]);})[_0x591c('0x10')](function(_0x5a1a1e){_0x44536e(_0x5a1a1e);});};AGIVertices['prototype'][_0x591c('0x1e')]=function(_0x3e88b6,_0xf4f6,_0x2edd5c){this[_0x591c('0xb')][_0x591c('0x1e')](_0x3e88b6,_0xf4f6)['then'](function(){_0x2edd5c(null);})[_0x591c('0x10')](function(_0x1f1411){_0x2edd5c(_0x1f1411);});};AGIVertices[_0x591c('0xc')][_0x591c('0x1f')]=function(_0x51e152,_0x516d3e){this['rpc'][_0x591c('0x20')](_0x51e152)[_0x591c('0xf')](function(_0x2b57cc){if(_0x2b57cc){if(_0x2b57cc[_0x591c('0x21')]){_0x516d3e(null,[_0x2b57cc['interval']]);}else{_0x516d3e(null,_['map'](_0x2b57cc[_0x591c('0x22')],_0x591c('0x23')));}}else{_0x516d3e(null,![]);}})[_0x591c('0x10')](function(_0x4d555b){_0x516d3e(_0x4d555b);});};AGIVertices[_0x591c('0xc')][_0x591c('0x1b')]=function(_0x4df433){return util[_0x591c('0x24')](_0x591c('0x25'),FILES_PATH,_0x4df433);};AGIVertices['prototype']['getQueryOdbc']=function(_0x2f3ca2,_0x36474b,_0x4e1d8e){odbc[_0x591c('0x26')](_0x2f3ca2,function(_0x337920){if(_0x337920){logger[_0x591c('0x27')](_0x591c('0x28'),_0x337920);_0x4e1d8e(_0x337920);}else{logger[_0x591c('0x29')]('ODBC\x20connection\x20successfully');odbc[_0x591c('0x2a')](_0x36474b,function(_0x318ffb,_0x55d427){if(_0x318ffb){logger[_0x591c('0x29')]('Error\x20executing\x20query\x20%s',_0x36474b);_0x4e1d8e(_0x318ffb);}else{logger[_0x591c('0x29')](_0x591c('0x2b'),_0x36474b);odbc['close'](function(_0x3c8f2c){if(_0x3c8f2c){logger['error'](_0x591c('0x2c'),_0x3c8f2c);}_0x4e1d8e(null,_0x55d427);});}});}});};AGIVertices[_0x591c('0xc')][_0x591c('0x2d')]=function(_0x2da0dc,_0x2aa87e){this[_0x591c('0xa')]['getSmsAccountById'](_0x2da0dc)['then'](function(_0x2573a6){_0x2aa87e(null,_0x2573a6?_0x2573a6:![]);})['catch'](function(_0x2ddf7d){_0x2aa87e(_0x2ddf7d);});};AGIVertices[_0x591c('0xc')][_0x591c('0x2e')]=function(_0x1f833a,_0x28e894){this[_0x591c('0xa')][_0x591c('0x2e')](_0x1f833a)['then'](function(_0x763b41){_0x28e894(null,_0x763b41);})['catch'](function(_0x2533bc){_0x28e894(_0x2533bc);});};AGIVertices[_0x591c('0xc')][_0x591c('0x2f')]=function(_0x4f8440,_0x3663c8,_0x28a6c1){this['rpc'][_0x591c('0x2f')]({'uniqueid':this[_0x591c('0x9')][_0x591c('0x30')],'node':_0x4f8440['label'],'application':_0x4f8440[_0x591c('0x31')],'data':_0x3663c8||null,'project_name':this[_0x591c('0x9')]['arg_1'],'callerid':this['channel']['callerid']})[_0x591c('0xf')](function(_0x2f100c){if(_0x28a6c1){_0x28a6c1(null,_0x2f100c);}})[_0x591c('0x10')](function(_0x595f4a){if(_0x28a6c1){_0x28a6c1(_0x595f4a);}});};AGIVertices[_0x591c('0xc')]['createSquareRecording']=function(_0xc5b2d9,_0x2fda50,_0x46366b,_0x21d158){this[_0x591c('0xa')]['createSquareRecording']({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x591c('0x9')][_0x591c('0x32')],'calleridname':this[_0x591c('0x9')]['calleridname'],'context':this[_0x591c('0x9')][_0x591c('0x33')],'extension':this['channel'][_0x591c('0x34')],'priority':this[_0x591c('0x9')][_0x591c('0x35')],'accountcode':this[_0x591c('0x9')][_0x591c('0x36')],'dnid':this[_0x591c('0x9')][_0x591c('0x37')],'projectName':this[_0x591c('0x9')][_0x591c('0x38')],'saveName':_0x2fda50,'filename':_0xc5b2d9['file']||_0x2fda50,'savePath':_0x46366b})[_0x591c('0xf')](function(_0x481aab){_0x21d158(null,_0x481aab);})['catch'](function(_0x26c234){_0x21d158(_0x26c234);});};AGIVertices['prototype']['createSquareMessage']=function(_0x188633,_0x579427,_0x354b8d,_0x23e5f8,_0x16e9cf){this[_0x591c('0xa')][_0x591c('0x39')]({'uniqueid':this['channel'][_0x591c('0x30')],'body':_0x188633,'direction':_0x579427,'providerName':_0x354b8d,'providerResponse':_0x23e5f8})[_0x591c('0xf')](function(_0x185020){if(_0x16e9cf){_0x16e9cf(null,_0x185020);}})[_0x591c('0x10')](function(_0x35a8f4){if(_0x16e9cf){_0x16e9cf(_0x35a8f4);}});};AGIVertices[_0x591c('0xc')][_0x591c('0x3a')]=function(_0xcfe55c,_0x6167b7){this[_0x591c('0xa')][_0x591c('0x3a')]({'firstName':_[_0x591c('0x3b')](_0xcfe55c[_0x591c('0x13')])||_[_0x591c('0x3c')](_0xcfe55c[_0x591c('0x13')])?_0x591c('0x3d')+Math[_0x591c('0x3e')]():_0xcfe55c[_0x591c('0x13')],'lastName':_[_0x591c('0x3b')](_0xcfe55c['lastName'])||_['isNil'](_0xcfe55c[_0x591c('0x3f')])?null:_0xcfe55c[_0x591c('0x3f')],'phone':_0xcfe55c[_0x591c('0x40')],'ListId':_0xcfe55c['list_id'],'scheduledat':_0xcfe55c[_0x591c('0x41')],'callbackUniqueid':this[_0x591c('0x9')][_0x591c('0x30')],'tags':'callback','description':_0x591c('0x42')+_0xcfe55c['scheduledAt'][_0x591c('0x43')](),'priority':_0xcfe55c[_0x591c('0x44')]})[_0x591c('0xf')](function(_0x2bd671){_0x6167b7(null,_0x2bd671);})[_0x591c('0x10')](function(_0xedbeb4){_0x6167b7(_0xedbeb4);});};AGIVertices['prototype']['getPause']=function(_0x2b3c0d,_0x12995c){this[_0x591c('0xa')][_0x591c('0x45')](_0x2b3c0d)[_0x591c('0xf')](function(_0x65dbd9){_0x12995c(null,_0x65dbd9?_0x65dbd9['name']:![]);})[_0x591c('0x10')](function(_0x3e9d31){_0x12995c(_0x3e9d31);});};AGIVertices['prototype'][_0x591c('0x46')]=function(_0x33fd4b,_0x5224fd,_0x5aad52){var _0x1ba4c5={'role':_0x591c('0x47')};_0x1ba4c5[_0x33fd4b]=this[_0x591c('0x9')][_0x591c('0x32')];this[_0x591c('0xa')]['agentPause'](_0x1ba4c5,_0x5224fd,this[_0x591c('0x9')][_0x591c('0x30')])['then'](function(_0x24f405){_0x5aad52(null,_[_0x591c('0x3c')](_0x24f405)?![]:!![]);})[_0x591c('0x10')](function(_0xcf8681){logger[_0x591c('0x27')](_0xcf8681);_0x5aad52(null,![]);});};AGIVertices[_0x591c('0xc')][_0x591c('0x48')]=function(_0x27a182,_0x4b146b){var _0x5e690b={'role':_0x591c('0x47')};_0x5e690b[_0x27a182]=this['channel'][_0x591c('0x32')];this[_0x591c('0xa')][_0x591c('0x48')](_0x5e690b)['then'](function(_0x19c9ba){_0x4b146b(null,_['isNil'](_0x19c9ba)?![]:!![]);})[_0x591c('0x10')](function(_0x40b215){logger[_0x591c('0x27')](_0x40b215);_0x4b146b(null,![]);});};AGIVertices['prototype'][_0x591c('0x49')]=function(_0xa241a2,_0x40db54){var _0x11c6fc={'role':'agent'};_0x11c6fc[_0xa241a2]=this[_0x591c('0x9')][_0x591c('0x32')];this[_0x591c('0xa')]['agentLogout'](_0x11c6fc)['then'](function(_0x5efdb1){_0x40db54(null,_['isNil'](_0x5efdb1)?![]:!![]);})[_0x591c('0x10')](function(_0x4ac643){logger['error'](_0x4ac643);_0x40db54(null,![]);});};AGIVertices[_0x591c('0xc')][_0x591c('0x4a')]=function(_0x609ef7,_0x1821d1){var _0x44ffe3={'role':_0x591c('0x47')};_0x44ffe3[_0x609ef7]=this[_0x591c('0x9')][_0x591c('0x32')];var _0x39d3ae=_0x609ef7!=_0x591c('0x4b')?util['format'](_0x591c('0x4c'),_0x591c('0x4d'),this['channel'][_0x591c('0x32')]):undefined;this[_0x591c('0xa')][_0x591c('0x4a')](_0x44ffe3,_0x39d3ae)['then'](function(_0x403861){_0x1821d1(null,_[_0x591c('0x3c')](_0x403861)?![]:!![]);})[_0x591c('0x10')](function(_0x2da6ab){logger[_0x591c('0x27')](_0x2da6ab);_0x1821d1(null,![]);});};AGIVertices[_0x591c('0xc')]['shellCommand']=function(_0x1776c2,_0x481cb1){sh[_0x591c('0x4e')](_['trim'](_0x1776c2),function(_0xb7f70d,_0x11e192){var _0x1b0615=_0x11e192[_0x591c('0x4f')](/(\r\n|\n|\r)/gm,'');_0x481cb1(null,_0x1b0615);});};AGIVertices[_0x591c('0xc')][_0x591c('0x50')]=function(_0x3046b4,_0x48cff6){scripts[_0x591c('0x50')](_0x3046b4[_0x591c('0x51')],_0x3046b4[_0x591c('0x52')]||'text',_0x3046b4[_0x591c('0x53')],_0x3046b4[_0x591c('0x54')]||_0x591c('0x55'),_0x3046b4[_0x591c('0x56')]||_0x591c('0x57'),_0x3046b4['audioEncoding']||_0x591c('0x58'))['then'](function(_0x39d712){_0x48cff6(null,_0x39d712);})[_0x591c('0x10')](function(_0x119010){_0x48cff6(_0x119010);});};AGIVertices['prototype'][_0x591c('0x59')]=function(_0x518dee,_0x15ce1a){scripts['googleTTS'](_0x518dee[_0x591c('0x53')],_0x518dee[_0x591c('0x5a')]||'en',0x1)[_0x591c('0xf')](function(_0x61cea7){_0x15ce1a(null,_0x61cea7);})['catch'](function(_0x438fdb){_0x15ce1a(_0x438fdb);});};AGIVertices[_0x591c('0xc')][_0x591c('0x5b')]=function(_0x39548b,_0x490e11){var _0x18c773={'uri':_0x39548b[_0x591c('0x5c')],'method':_0x39548b[_0x591c('0x5d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39548b[_0x591c('0x5e')])===_0x591c('0x5f')&&parseInt(_0x39548b[_0x591c('0x5e')])>=0x1?parseInt(_0x39548b[_0x591c('0x5e')])*0x3e8:0x5*0x3e8};if(_[_0x591c('0x60')]([_0x591c('0x61'),_0x591c('0x62')],_0x18c773[_0x591c('0x5d')][_0x591c('0x63')]())){try{_0x18c773[_0x591c('0x64')]=_0x39548b['rawBody']?JSON[_0x591c('0x65')](_0x39548b[_0x591c('0x6')]):{};}catch(_0x2205d9){logger['error'](_0x591c('0x66'),_0x2205d9);}}try{_0x18c773[_0x591c('0x67')]=_0x39548b[_0x591c('0x68')]?JSON[_0x591c('0x65')](_0x39548b[_0x591c('0x68')]):{};}catch(_0x48abeb){logger['error'](_0x591c('0x69'),_0x48abeb);}if(_0x39548b[_0x591c('0x6a')]){try{var _0x369d41=require(_0x39548b[_0x591c('0x6a')])[_0x591c('0x6b')](this,_0x18c773);_0x18c773[_0x591c('0x6c')]=Mustache['render'](_0x39548b[_0x591c('0x5c')],_0x369d41,{},['$$','$$']);if(_0x18c773[_0x591c('0x67')]){_0x18c773[_0x591c('0x67')]=JSON['parse'](Mustache['render'](JSON['stringify'](_0x18c773[_0x591c('0x67')]),_0x369d41,{},['$$','$$']));}if(_0x18c773[_0x591c('0x64')]){_0x18c773['body']=JSON[_0x591c('0x65')](Mustache['render'](JSON[_0x591c('0x6d')](_0x18c773[_0x591c('0x64')]),_0x369d41,{},['$$','$$']));}}catch(_0x75f45a){logger[_0x591c('0x27')](_0x591c('0x6e'),_0x75f45a);}}rp(_0x18c773)[_0x591c('0xf')](function(_0x589cda){var _0x1ed497={'statusCode':_0x589cda['statusCode']||0xc8,'statusMessage':_0x589cda[_0x591c('0x6f')]||'OK','headers':_0x589cda[_0x591c('0x67')]||{},'body':_0x589cda[_0x591c('0x64')]||{}};_0x490e11(null,_0x1ed497);})[_0x591c('0x10')](function(_0x3c207f){var _0x374213={'statusCode':_0x3c207f[_0x591c('0x70')]||0x1f4,'statusMessage':_0x3c207f[_0x591c('0x71')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x3c207f['options'][_0x591c('0x67')]||{},'body':_0x3c207f[_0x591c('0x72')][_0x591c('0x64')]||{}};_0x490e11(null,_0x374213);});};AGIVertices['prototype']['googleDialogflow']=function(_0x5c197b,_0x4970ef){scripts[_0x591c('0x73')](this[_0x591c('0x9')][_0x591c('0x30')],_0x5c197b[_0x591c('0x74')],_0x5c197b[_0x591c('0x53')],_0x5c197b[_0x591c('0x75')]||'en')[_0x591c('0xf')](function(_0x1e9952){_0x4970ef(null,_0x1e9952);})[_0x591c('0x10')](function(_0x4c8a4c){_0x4970ef(_0x4c8a4c);});};AGIVertices[_0x591c('0xc')]['googleDialogflowV2']=function(_0x2fe7ea,_0x5af988){scripts[_0x591c('0x76')](this['channel'][_0x591c('0x30')],_0x2fe7ea[_0x591c('0x77')],_0x2fe7ea[_0x591c('0x78')],_0x2fe7ea[_0x591c('0x79')],_0x2fe7ea['text'],_0x2fe7ea['dialogflowV2_language']||'en')[_0x591c('0xf')](function(_0x3eaa86){_0x5af988(null,_0x3eaa86);})[_0x591c('0x10')](function(_0x1f8656){_0x5af988(_0x1f8656);});};AGIVertices[_0x591c('0xc')]['sestekNDA']=function(_0x5b8f61,_0x3b9042){scripts['sestekNDA'](this[_0x591c('0x9')],_0x5b8f61)[_0x591c('0xf')](function(_0x2b880a){_0x3b9042(null,_0x2b880a);})['catch'](function(_0x30c435){_0x3b9042(_0x30c435);});};AGIVertices[_0x591c('0xc')][_0x591c('0x7a')]=function(_0x3e1479,_0x63aff3){scripts[_0x591c('0x7a')](_0x3e1479[_0x591c('0x74')],_0x3e1479[_0x591c('0x53')],_0x3e1479[_0x591c('0x7b')]||_0x591c('0x55'),_0x3e1479[_0x591c('0x7c')])['then'](function(_0x5dcd93){_0x63aff3(null,_0x5dcd93);})[_0x591c('0x10')](function(_0x1660c0){_0x63aff3(_0x1660c0);});};AGIVertices[_0x591c('0xc')][_0x591c('0x7d')]=function(_0x3406f1,_0x1411cf,_0x2d1ffa){scripts['ispeechASR'](_0x1411cf,_0x3406f1[_0x591c('0x74')],_0x3406f1[_0x591c('0x7e')]||_0x591c('0x55'),this[_0x591c('0x7f')](_0x3406f1[_0x591c('0x80')])?_0x3406f1['model']:undefined)['then'](function(_0x48d04c){_0x2d1ffa(null,_0x48d04c);})[_0x591c('0x10')](function(_0x425e32){_0x2d1ffa(_0x425e32);});};AGIVertices[_0x591c('0xc')][_0x591c('0x81')]=function(_0x3afc5d,_0x6a73bb){scripts[_0x591c('0x81')](_0x3afc5d[_0x591c('0x82')],_0x3afc5d[_0x591c('0x83')],_0x3afc5d[_0x591c('0x84')],_0x3afc5d[_0x591c('0x85')]||_0x591c('0x86'),_0x3afc5d[_0x591c('0x53')],_0x3afc5d['aws_text_type']||_0x591c('0x53'))['then'](function(_0x10157e){_0x6a73bb(null,_0x10157e);})[_0x591c('0x10')](function(_0x4d8eb9){_0x6a73bb(_0x4d8eb9);});};AGIVertices[_0x591c('0xc')][_0x591c('0x87')]=function(_0x17f5ab,_0x6ba67e){scripts[_0x591c('0x87')](this[_0x591c('0x9')][_0x591c('0x30')],_0x17f5ab['aws_access_key_id'],_0x17f5ab[_0x591c('0x83')],_0x17f5ab[_0x591c('0x88')],_0x17f5ab[_0x591c('0x53')],_0x17f5ab[_0x591c('0x89')])['then'](function(_0x3ea8a2){_0x6ba67e(null,_0x3ea8a2);})['catch'](function(_0x14e3b2){_0x6ba67e(_0x14e3b2);});};AGIVertices[_0x591c('0xc')][_0x591c('0x8a')]=function(_0x36cb10,_0x5bbe69,_0x197bee){scripts[_0x591c('0x8a')](_0x5bbe69,_0x36cb10['key'],_0x36cb10[_0x591c('0x8b')]||_0x591c('0x55'))['then'](function(_0x556ea8){_0x197bee(null,_0x556ea8);})[_0x591c('0x10')](function(_0xf26690){_0x197bee(_0xf26690);});};AGIVertices[_0x591c('0xc')]['tildeASR']=function(_0x59d91a,_0x57b0c4,_0x25dc9c){scripts['tildeASR'](_0x57b0c4,_0x59d91a[_0x591c('0x8c')],_0x59d91a['appsecret'],_0x59d91a['uri'])[_0x591c('0xf')](function(_0x2a5323){_0x25dc9c(null,_0x2a5323);})[_0x591c('0x10')](function(_0x45e69d){_0x25dc9c(_0x45e69d);});};AGIVertices[_0x591c('0xc')]['clear']=function(_0x4c26b8){var _0xbcd6a5=_[_0x591c('0x60')](verticesWithRetry,_0x4c26b8[_0x591c('0x31')])?_0x4c26b8:_[_0x591c('0x8d')](_0x4c26b8);for(var _0x333ca5 in _0xbcd6a5){if(_0xbcd6a5['hasOwnProperty'](_0x333ca5)){if(_0xbcd6a5[_0x333ca5]&&_[_0x591c('0x8e')](_0xbcd6a5[_0x333ca5])){if(_[_0x591c('0x60')](recursiveMapAttributes,_0x333ca5)){_0xbcd6a5[_0x333ca5]=this[_0x591c('0x8f')](_0xbcd6a5[_0x333ca5]);}else{_0xbcd6a5[_0x333ca5]=this['replaceAllVariables'](_0xbcd6a5[_0x333ca5]);}}}}return _0xbcd6a5;};AGIVertices[_0x591c('0xc')]['recursiveNodeIndex']=function(_0x47894b){for(var _0x2a5a79 in _0x47894b){if(_0x47894b[_0x591c('0x90')](_0x2a5a79)){if(_[_0x591c('0x91')](_0x47894b[_0x2a5a79])){this[_0x591c('0x92')](_0x47894b[_0x2a5a79]);}else if(_[_0x591c('0x93')](_0x47894b[_0x2a5a79])){for(var _0x3bda98=0x0;_0x3bda98<_0x47894b[_0x2a5a79][_0x591c('0x94')];_0x3bda98++){this['recursiveNodeIndex'](_0x47894b[_0x2a5a79][_0x3bda98]);}}else if(_[_0x591c('0x8e')](_0x47894b[_0x2a5a79])){_0x47894b[_0x2a5a79]=this[_0x591c('0x95')](_0x47894b[_0x2a5a79]);}}}};AGIVertices[_0x591c('0xc')]['saveRestApiResult']=function(_0x5f15ce,_0x509733){for(var _0x107d8b in _0x5f15ce){if(_0x5f15ce['hasOwnProperty'](_0x107d8b)){if(_[_0x591c('0x91')](_0x5f15ce[_0x107d8b])){if(!_[_0x591c('0x3b')](_0x5f15ce[_0x107d8b])){this[_0x591c('0x96')](_0x5f15ce[_0x107d8b],util['format'](_0x591c('0x97'),_0x509733,_0x107d8b));}}else if(_[_0x591c('0x93')](_0x5f15ce[_0x107d8b])){for(var _0x566a77=0x0;_0x566a77<_0x5f15ce[_0x107d8b][_0x591c('0x94')];_0x566a77++){this[_0x591c('0x96')](_0x5f15ce[_0x107d8b][_0x566a77],util[_0x591c('0x24')](_0x591c('0x97'),_0x509733,_0x107d8b+'['+_0x566a77+']'));}}else{if(!_[_0x591c('0x3c')](_0x5f15ce[_0x107d8b])){this['channel'][_0x591c('0x98')](util[_0x591c('0x24')](_0x591c('0x97'),_0x509733,_0x107d8b),_0x5f15ce[_0x107d8b]);}}}}};AGIVertices['prototype'][_0x591c('0x8f')]=function(_0x1727f3){try{var _0x40b271=JSON[_0x591c('0x65')](_0x1727f3);this[_0x591c('0x92')](_0x40b271);return JSON[_0x591c('0x6d')](_0x40b271);}catch(_0x507fec){return this[_0x591c('0x95')](_0x1727f3);}};AGIVertices[_0x591c('0xc')][_0x591c('0x95')]=function(_0x5ebef3){var _0x2fca7c=_0x5ebef3[_0x591c('0x99')]('{');for(var _0x3a2962=0x1;_0x3a2962<_0x2fca7c['length'];_0x3a2962+=0x1){var _0x55faa3=_0x2fca7c[_0x3a2962][_0x591c('0x99')]('}');if(_0x55faa3[_0x591c('0x94')]>0x1){_0x5ebef3=_0x5ebef3[_0x591c('0x9a')]('{'+_0x55faa3[0x0]+'}',this[_0x591c('0x9')][_0x591c('0xd')](_0x55faa3[0x0])[_0x591c('0x9b')]||_0x55faa3[0x0]);}}if(_0x2fca7c[_0x591c('0x94')]===0x1){return _0x5ebef3[_0x591c('0x43')]();}return this[_0x591c('0x95')](_0x5ebef3);};AGIVertices['prototype'][_0x591c('0x9c')]=function(_0x49c1db,_0xef5e3a){var _0x3da048=this['channel'][_0x591c('0xd')](_0x49c1db);if(_0x3da048[_0x591c('0x9d')]===-0x1){return _0x3da048;}logger[_0x591c('0x29')](util[_0x591c('0x24')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xef5e3a,_0x3da048[_0x591c('0x9b')]));return this[_0x591c('0x9')]['setVariable'](_0xef5e3a,_0x3da048[_0x591c('0x9b')]);};AGIVertices[_0x591c('0xc')][_0x591c('0x7f')]=function(_0x242904){return _0x242904&&_0x242904!=='0'&&_0x242904!=='-1'&&_0x242904!=='';};AGIVertices[_0x591c('0xc')][_0x591c('0x9e')]=function(_0x304c83){this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x304c83,'-');_0x304c83[_0x591c('0x9f')]=_0x304c83[_0x591c('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x591c('0xc')][_0x591c('0xa0')]=function(_0x53084c){logger['info'](util[_0x591c('0x24')](_0x591c('0xa1'),_0x53084c[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x53084c['text'])){return this['channel'][_0x591c('0xa3')](_0x591c('0xa4'));}var _0x11c52a='\x22'+_0x53084c[_0x591c('0x53')]+'\x22';if(this['isConfigured'](_0x53084c['options'])){_0x11c52a+=','+_0x53084c[_0x591c('0x72')];}var _0x47f46c=this[_0x591c('0x9')]['exec'](_0x591c('0xa5'),_0x11c52a);if(_0x47f46c['result']===-0x1){return _0x47f46c;}return this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xa6'),_0x11c52a));};AGIVertices[_0x591c('0xc')][_0x591c('0xa7')]=function(_0x3496c9){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3496c9[_0x591c('0xa2')]));if(!this['isConfigured'](_0x3496c9[_0x591c('0xa8')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x48c425=_0x3496c9[_0x591c('0xa8')];if(this['isConfigured'](_0x3496c9[_0x591c('0x72')])){_0x48c425+=','+_0x3496c9['options'];}var _0x413216=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0xa9'),_0x48c425);if(_0x413216[_0x591c('0x9d')]===-0x1){return _0x413216;}var _0x295ed6=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x591c('0xaa'));if(_0x295ed6['result']===-0x1){return _0x295ed6;}var _0x3fb089=this[_0x591c('0x9c')]('RECOG_INPUT()',_0x591c('0xab'));if(_0x3fb089[_0x591c('0x9d')]===-0x1){return _0x3fb089;}var _0x476881=this['getAndSetVariable'](_0x591c('0xac'),'MRCP_RECOG_INSTANCE');if(_0x476881[_0x591c('0x9d')]===-0x1){return _0x476881;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xad'),_0x48c425));};AGIVertices[_0x591c('0xc')][_0x591c('0x3')]=function(_0x551b2a){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0xae'),_0x551b2a[_0x591c('0xa2')]));return this[_0x591c('0x9')]['agi']([_0x551b2a['command'],_0x551b2a[_0x591c('0xaf')]]);};AGIVertices[_0x591c('0xc')][_0x591c('0xb0')]=function(_0x40d0c8){logger['info'](util[_0x591c('0x24')](_0x591c('0xb1'),_0x40d0c8[_0x591c('0xa2')]));if(this[_0x591c('0x7f')](_0x40d0c8[_0x591c('0x5e')])){logger['info'](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x40d0c8['timeout']));var _0x5a5843=this['channel'][_0x591c('0xb2')](_0x40d0c8[_0x591c('0x5e')]);if(_0x5a5843['result']===-0x1){return _0x5a5843;}}return this[_0x591c('0x9')]['answer']();};AGIVertices[_0x591c('0xc')][_0x591c('0xb3')]=function(_0x493a6e){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x493a6e['label']));if(!this['isConfigured'](_0x493a6e[_0x591c('0xb4')])){return this['channel'][_0x591c('0x27')](_0x493a6e,_0x591c('0xb5'));}_0x493a6e['scheduledAt']=moment();if(this['isConfigured'](_0x493a6e[_0x591c('0xb6')])){_0x493a6e[_0x591c('0x41')]=moment()['add'](_0x493a6e['delay'],_0x591c('0xb7'));}if(!this[_0x591c('0x7f')](_0x493a6e[_0x591c('0x44')])){_0x493a6e['callback_priority']=0x2;}this[_0x591c('0x3a')][_0x591c('0x6b')](this,_0x493a6e);return this[_0x591c('0x9')][_0x591c('0xa3')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x493a6e[_0x591c('0x40')],_0x493a6e[_0x591c('0xb4')],_0x493a6e[_0x591c('0x41')]));};AGIVertices['prototype'][_0x591c('0xb8')]=function(_0x2772e0){logger['info'](util[_0x591c('0x24')](_0x591c('0xb9'),_0x2772e0[_0x591c('0xa2')]));var _0x4e5b0d=this['channel'][_0x591c('0x4e')](_0x2772e0['application'],_0x2772e0[_0x591c('0x72')]);if(_0x4e5b0d[_0x591c('0x9d')]===-0x1){return _0x4e5b0d;}return this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xba'),_0x2772e0[_0x591c('0xbb')],_0x2772e0['options']));};AGIVertices[_0x591c('0xc')]['lumenvoxtts']=function(_0x5010be){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5010be['label']));if(!this['isConfigured'](_0x5010be['text'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}var _0x6b25ec='\x22'+_0x5010be[_0x591c('0x53')]+'\x22';if(this[_0x591c('0x7f')](_0x5010be[_0x591c('0x72')])){_0x6b25ec+=','+_0x5010be[_0x591c('0x72')];}var _0x3bb9ae=this[_0x591c('0x9')][_0x591c('0x4e')]('MRCPSynth',_0x6b25ec);if(_0x3bb9ae[_0x591c('0x9d')]===-0x1){return _0x3bb9ae;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x6b25ec));};AGIVertices[_0x591c('0xc')][_0x591c('0xbc')]=function(_0x4886c0){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0xbd'),_0x4886c0[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x4886c0[_0x591c('0x53')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}var _0x784c63='\x22'+_0x4886c0[_0x591c('0x53')]+'\x22';if(this[_0x591c('0x7f')](_0x4886c0['options'])){_0x784c63+=','+_0x4886c0[_0x591c('0x72')];}var _0x58a41f=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0xa5'),_0x784c63);if(_0x58a41f[_0x591c('0x9d')]===-0x1){return _0x58a41f;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xa6'),_0x784c63));};AGIVertices[_0x591c('0xc')]['lumenvoxasr']=function(_0x4408cd){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x4408cd[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x4408cd['grammar'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xbe'));}var _0x11ad4d=_0x4408cd['grammar'];if(this[_0x591c('0x7f')](_0x4408cd['options'])){_0x11ad4d+=','+_0x4408cd[_0x591c('0x72')];}var _0x5a2c21=this[_0x591c('0x9')][_0x591c('0x4e')]('MRCPRecog',_0x11ad4d);if(_0x5a2c21[_0x591c('0x9d')]===-0x1){return _0x5a2c21;}var _0x39ef40=this['getAndSetVariable'](_0x591c('0xbf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x39ef40['result']===-0x1){return _0x39ef40;}var _0x5da7c1=this[_0x591c('0x9c')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x5da7c1[_0x591c('0x9d')]===-0x1){return _0x5da7c1;}var _0x56a6c7=this[_0x591c('0x9c')]('RECOG_INSTANCE()',_0x591c('0xc0'));if(_0x56a6c7[_0x591c('0x9d')]===-0x1){return _0x56a6c7;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x11ad4d));};AGIVertices['prototype']['sestekasr']=function(_0x85e1d7){logger['info'](util['format'](_0x591c('0xc1'),_0x85e1d7['label']));if(!this[_0x591c('0x7f')](_0x85e1d7[_0x591c('0xa8')])){return this[_0x591c('0x9')]['noop'](_0x591c('0xbe'));}var _0x3ad08a=_0x85e1d7[_0x591c('0xa8')];if(this[_0x591c('0x7f')](_0x85e1d7[_0x591c('0x72')])){_0x3ad08a+=','+_0x85e1d7[_0x591c('0x72')];}var _0x4e56e0=this['channel']['exec'](_0x591c('0xa9'),_0x3ad08a);if(_0x4e56e0['result']===-0x1){return _0x4e56e0;}var _0x5203d7=this['getAndSetVariable'](_0x591c('0xbf'),_0x591c('0xc2'));if(_0x5203d7[_0x591c('0x9d')]===-0x1){return _0x5203d7;}var _0x4256c5=this['getAndSetVariable'](_0x591c('0xc3'),_0x591c('0xc4'));if(_0x4256c5['result']===-0x1){return _0x4256c5;}var _0x4b80b5=this[_0x591c('0x9c')](_0x591c('0xac'),_0x591c('0xc5'));if(_0x4b80b5['result']===-0x1){return _0x4b80b5;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3ad08a));};AGIVertices[_0x591c('0xc')]['database']=function(_0x2c0111){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0xc6'),_0x2c0111[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x2c0111[_0x591c('0xc7')])){return this['channel'][_0x591c('0x27')](_0x2c0111,_0x591c('0xc8'));}var _0x5853af=this['getSquareOdbc'][_0x591c('0x6b')](this,_0x2c0111[_0x591c('0xc7')]);if(!_0x5853af){return this[_0x591c('0x9')][_0x591c('0x27')](_0x2c0111,_0x591c('0xc9'));}if(!this[_0x591c('0x7f')](_0x2c0111[_0x591c('0x2a')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x2c0111,'no\x20query\x20configured');}var _0x4a4ccf=_0x2c0111[_0x591c('0x2a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('query:\x20%s',_0x4a4ccf));var _0x10ff0=this[_0x591c('0xca')][_0x591c('0x6b')](this,_0x5853af,_0x4a4ccf);this['createSquareDetailsReport']['sync'](this,_0x2c0111,_0x4a4ccf);if(!this['isConfigured'](_0x2c0111[_0x591c('0xcb')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xcc'));}var _0x2c5258=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x2c0111['variable_id']);if(!_0x2c5258){return this[_0x591c('0x9')]['error'](_0x2c0111,_0x591c('0xcd'));}var _0xb9d3b0=this;_0x10ff0[_0x591c('0xce')](function(_0x4cfd03,_0xd672ee){Object[_0x591c('0xcf')](_0x4cfd03)[_0x591c('0xce')](function(_0x3dd69e){_0xb9d3b0[_0x591c('0x9')][_0x591c('0x98')](util['format']('%s[%s][%s]',_0x2c5258,_0xd672ee,_0x3dd69e),_0x4cfd03[_0x3dd69e]);});});this['channel'][_0x591c('0x98')](util['format'](_0x591c('0xd0'),_0x2c5258),_0x10ff0[_0x591c('0x94')]);return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('variable\x20%s\x20set',_0x2c5258));};AGIVertices[_0x591c('0xc')][_0x591c('0xd1')]=function(_0x4a90de){logger[_0x591c('0xd2')](util[_0x591c('0x24')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4a90de[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x4a90de[_0x591c('0xd3')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x4a90de,_0x591c('0xd4'));}var _0x4f8253=this[_0x591c('0xd5')][_0x591c('0x6b')](this,_0x4a90de['sip_id']);if(!_0x4f8253){return this[_0x591c('0x9')]['error'](_0x4a90de,_0x591c('0xd6'));}var _0x5752fb=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0xd7'),[util['format'](_0x591c('0xd8'),_0x4f8253),_0x4a90de[_0x591c('0x5e')],_0x4a90de['opts'],_0x4a90de[_0x591c('0x5c')]]);if(_0x5752fb['result']===-0x1){return _0x5752fb;}return this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0xd9'),_0x591c('0xd7')));};AGIVertices[_0x591c('0xc')][_0x591c('0xda')]=function(_0x5ecfb6){logger['info'](util[_0x591c('0x24')](_0x591c('0xdb'),_0x5ecfb6[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x5ecfb6['key'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xdc'));}if(!this[_0x591c('0x7f')](_0x5ecfb6[_0x591c('0x53')])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20text\x20configured');}this[_0x591c('0x9')]['bot']=!![];this[_0x591c('0x2f')](_0x5ecfb6);this[_0x591c('0x39')](_0x5ecfb6[_0x591c('0x53')],'in','','');this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xdd'),_0x5ecfb6['text']));var _0x535f92=this[_0x591c('0x73')][_0x591c('0x6b')](this,_0x5ecfb6);if(_0x535f92){for(var _0x360922 in _0x535f92){if(_0x535f92[_0x591c('0x90')](_0x360922)){this['channel']['setVariable'](util[_0x591c('0x24')]('DIALOGFLOW_%s',_0x360922[_0x591c('0x63')]()),_0x535f92[_0x360922]);}}this[_0x591c('0x39')](_0x535f92[_0x591c('0xde')],'out',_0x591c('0xda'),'');return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xdf'),_0x535f92[_0x591c('0xde')]));}return this[_0x591c('0x9')][_0x591c('0x27')](_0x5ecfb6,_0x591c('0xe0'));};AGIVertices[_0x591c('0xc')][_0x591c('0xe1')]=function(_0x259832){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0xe2'),_0x259832[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x259832[_0x591c('0x77')])){return this['channel'][_0x591c('0xa3')](_0x591c('0xe3'));}if(!this[_0x591c('0x7f')](_0x259832[_0x591c('0x78')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xe4'));}if(!this[_0x591c('0x7f')](_0x259832[_0x591c('0x79')])){return this[_0x591c('0x9')]['noop'](_0x591c('0xe5'));}if(!this[_0x591c('0x7f')](_0x259832[_0x591c('0xe6')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xe7'));}if(!this[_0x591c('0x7f')](_0x259832['text'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}this['channel']['bot']=!![];this[_0x591c('0x2f')](_0x259832);this[_0x591c('0x39')](_0x259832[_0x591c('0x53')],'in','','');this[_0x591c('0x9')][_0x591c('0xa3')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x259832[_0x591c('0x53')]));var _0x2a4c40=this[_0x591c('0x76')][_0x591c('0x6b')](this,_0x259832);if(_0x2a4c40){for(var _0x3ee26c in _0x2a4c40){if(_0x2a4c40[_0x591c('0x90')](_0x3ee26c)){if(_0x3ee26c!==_0x591c('0xe8')){this[_0x591c('0x9')][_0x591c('0x98')](util['format'](_0x591c('0xe9'),_0x3ee26c['toUpperCase']()),_0x2a4c40[_0x3ee26c]);}}}this[_0x591c('0x39')](_0x2a4c40[_0x591c('0xde')],_0x591c('0xea'),'dialogflowV2',_0x2a4c40['providerResponse']);return this[_0x591c('0x9')]['noop'](util[_0x591c('0x24')](_0x591c('0xeb'),_0x2a4c40[_0x591c('0xde')]));}return this[_0x591c('0x9')]['error'](_0x259832,_0x591c('0xec'));};AGIVertices[_0x591c('0xc')][_0x591c('0xed')]=function(_0x65441a){logger['info'](util[_0x591c('0x24')](_0x591c('0xee'),_0x65441a[_0x591c('0xa2')]));if(!this['isConfigured'](_0x65441a[_0x591c('0xef')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xf0'));}if(!this[_0x591c('0x7f')](_0x65441a[_0x591c('0xf1')])){return this[_0x591c('0x9')]['noop'](_0x591c('0xf2'));}if(!this[_0x591c('0x7f')](_0x65441a[_0x591c('0xf3')])){return this[_0x591c('0x9')]['noop']('no\x20password\x20configured');}if(!this[_0x591c('0x7f')](_0x65441a[_0x591c('0xf4')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}this[_0x591c('0x9')][_0x591c('0xf5')]=!![];this[_0x591c('0x2f')](_0x65441a);this[_0x591c('0x39')](_0x65441a[_0x591c('0x53')],'in','','');this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xf6'),_0x65441a['text']));var _0x2b8db7=this[_0x591c('0xf7')]['sync'](this,_0x65441a);if(_0x2b8db7){for(var _0x190afe in _0x2b8db7){if(_0x2b8db7[_0x591c('0x90')](_0x190afe)){this[_0x591c('0x9')][_0x591c('0x98')](util[_0x591c('0x24')](_0x591c('0xf8'),_0x190afe[_0x591c('0x63')]()),_0x2b8db7[_0x190afe]);}}this['createSquareMessage'](_0x2b8db7[_0x591c('0xde')],_0x591c('0xea'),_0x591c('0xed'),'');if(_0x2b8db7[_0x591c('0xf9')]){this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xfa'),_0x2b8db7[_0x591c('0xf9')]));var _0x220d79=this[_0x591c('0x9')][_0x591c('0xfb')](_0x2b8db7[_0x591c('0xf9')]);try{fs[_0x591c('0xfc')](_0x2b8db7['audiofile']+_0x591c('0xfd'));}catch(_0x5b22b2){logger[_0x591c('0x27')](_0x5b22b2);}return _0x220d79;}else{return this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xfe'),_0x2b8db7[_0x591c('0xde')]));}}return this['channel'][_0x591c('0x27')](_0x65441a,_0x591c('0xff'));};AGIVertices[_0x591c('0xc')][_0x591c('0x100')]=function(_0x3991ad){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3991ad[_0x591c('0xa2')]));return this[_0x591c('0x9')]['noop'](_0x591c('0x100'));};AGIVertices[_0x591c('0xc')][_0x591c('0x101')]=function(_0x2e1221){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2e1221[_0x591c('0xa2')]));var _0x339803='';if(_0x2e1221[_0x591c('0x102')]){if(!this['isConfigured'](_0x2e1221[_0x591c('0x102')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x2e1221,_0x591c('0x103'));}else{var _0x43d515=parseInt(_0x2e1221[_0x591c('0x102')],0xa);if(isNaN(_0x43d515)){_0x339803=_0x2e1221['trunk_id'];}else{_0x339803=this[_0x591c('0x17')][_0x591c('0x6b')](this,_0x2e1221[_0x591c('0x102')]);if(!_0x339803){return this['channel'][_0x591c('0x27')](_0x2e1221,_0x591c('0x104'));}}}}else if(_0x2e1221[_0x591c('0x105')]){_0x339803=_0x2e1221[_0x591c('0x105')];}else{return this[_0x591c('0x9')][_0x591c('0x27')](_0x2e1221,_0x591c('0x103'));}var _0x3e0583=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0xd7'),[util[_0x591c('0x24')](_0x591c('0x106'),_0x339803,_0x2e1221[_0x591c('0x40')]),_0x2e1221[_0x591c('0x5e')],_0x2e1221['opts'],_0x2e1221['url']]);if(_0x3e0583[_0x591c('0x9d')]===-0x1){return _0x3e0583;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xd9'),'DIAL'));};AGIVertices['prototype'][_0x591c('0x107')]=function(_0x16e3ef){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x108'),_0x16e3ef['label']));return this[_0x591c('0x9')][_0x591c('0xa3')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x594f68){logger['info'](util[_0x591c('0x24')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x594f68[_0x591c('0xa2')]));if(_0x594f68['retry']===0x0){return this['maxRetry'](_0x594f68);}_0x594f68[_0x591c('0x9f')]-=0x1;if(!this[_0x591c('0x7f')](_0x594f68[_0x591c('0x109')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x594f68,_0x591c('0x10a'));}var _0x5ced5e=this[_0x591c('0x19')][_0x591c('0x6b')](this,_0x594f68[_0x591c('0x109')]);if(!_0x5ced5e){return this[_0x591c('0x9')][_0x591c('0x27')](_0x594f68,'no\x20file\x20audio\x20found');}if(!this[_0x591c('0x7f')](_0x594f68[_0x591c('0xcb')])){return this['channel'][_0x591c('0x27')](_0x591c('0xcc'));}var _0xa86174=this[_0x591c('0x9')][_0x591c('0x10b')](_0x5ced5e,_0x594f68[_0x591c('0x10c')],_0x594f68[_0x591c('0x10d')]);var _0x1767c1=_0xa86174['result']?_0xa86174['result'][_0x591c('0x43')]():'';logger['info'](_0x591c('0x10e'),JSON[_0x591c('0x6d')](_0xa86174));if(_0xa86174[_0x591c('0x9d')]===-0x1){this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x594f68,_0x1767c1);return _0xa86174;}else if(_0xa86174[_0x591c('0x9b')]===_0x591c('0x5e')){_0xa86174[_0x591c('0x9d')]=_0x1767c1['length']>=parseInt(_0x594f68[_0x591c('0x10f')])?'x':'i';}else{_0xa86174[_0x591c('0x9d')]=_0x1767c1[_0x591c('0x94')]>=parseInt(_0x594f68[_0x591c('0x10f')])&&_0x1767c1['length']<=parseInt(_0x594f68[_0x591c('0x10d')])?'x':'i';}var _0x3259e2=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x594f68[_0x591c('0xcb')]);if(!_0x3259e2){return this['channel'][_0x591c('0x27')](_0x594f68,_0x591c('0xcd'));}this[_0x591c('0x9')][_0x591c('0x98')](_0x3259e2,_0x1767c1);if(this[_0x591c('0x7f')](_0x594f68['hiddendigitsnum'])){var _0x2616b0=parseInt(_0x594f68[_0x591c('0x110')],0xa);var _0x3fe736=rs[_0x591c('0x111')]({'charset':'*','length':_0x2616b0});var _0x20190f=_0x1767c1[_0x591c('0x94')];if(_0x20190f>0x0){if(_0x20190f>_0x2616b0){this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x594f68,_0x594f68[_0x591c('0x112')]===_0x591c('0x113')?_0x3fe736+_0x1767c1[_0x591c('0x114')](_0x2616b0):_0x1767c1[_0x591c('0x114')](0x0,_0x20190f-_0x2616b0)+_0x3fe736);}else{this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x594f68,rs[_0x591c('0x111')]({'charset':'*','length':_0x20190f}));}}else{this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x594f68,'');}}else{this['createSquareDetailsReport'][_0x591c('0x6b')](this,_0x594f68,_0x1767c1);}return _0xa86174;};AGIVertices[_0x591c('0xc')][_0x591c('0x8')]=function(_0x18509c){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x18509c['label']));return this['getdigits'](_0x18509c);};AGIVertices[_0x591c('0xc')][_0x591c('0x115')]=function(_0x4780b1){logger[_0x591c('0x29')](util['format'](_0x591c('0x116'),_0x4780b1[_0x591c('0xa2')]));this['createSquareDetailsReport'][_0x591c('0x6b')](this,_0x4780b1,_0x4780b1[_0x591c('0x117')]);return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x118'),_0x4780b1[_0x591c('0x117')]));};AGIVertices[_0x591c('0xc')][_0x591c('0x119')]=function(_0x27759d){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x11a'),_0x27759d[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x27759d['aws_access_key_id'])||!this[_0x591c('0x7f')](_0x27759d[_0x591c('0x83')])){return this['channel'][_0x591c('0xa3')](_0x591c('0x11b'));}if(!this[_0x591c('0x7f')](_0x27759d['text'])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20text\x20configured');}this[_0x591c('0x9')]['noop'](util[_0x591c('0x24')](_0x591c('0x11c'),_0x27759d[_0x591c('0x53')]));var _0x3a9e23=this[_0x591c('0x81')][_0x591c('0x6b')](this,_0x27759d);if(_0x3a9e23){this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x11d'),_0x3a9e23));var _0x4dc070=this[_0x591c('0x9')][_0x591c('0xfb')](_0x3a9e23);try{fs[_0x591c('0xfc')](_0x3a9e23+_0x591c('0xfd'));}catch(_0xae0229){logger['error'](_0xae0229);}return _0x4dc070;}return this[_0x591c('0x9')][_0x591c('0x27')](_0x27759d,_0x591c('0x11e'));};AGIVertices[_0x591c('0xc')]['awslex']=function(_0x3e229e){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x11f'),_0x3e229e[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x3e229e[_0x591c('0x82')])||!this[_0x591c('0x7f')](_0x3e229e[_0x591c('0x83')])){return this[_0x591c('0x9')]['noop'](_0x591c('0x11b'));}if(!this[_0x591c('0x7f')](_0x3e229e['aws_bot_name'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x120'));}if(!this[_0x591c('0x7f')](_0x3e229e[_0x591c('0x53')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}this['channel'][_0x591c('0xf5')]=!![];this[_0x591c('0x2f')](_0x3e229e);this[_0x591c('0x39')](_0x3e229e['text'],'in','','');this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x121'),_0x3e229e[_0x591c('0x53')]));var _0x58c36f=this[_0x591c('0x87')][_0x591c('0x6b')](this,_0x3e229e);if(_0x58c36f){for(var _0x38ddd4 in _0x58c36f){if(_0x58c36f[_0x591c('0x90')](_0x38ddd4)&&_[_0x591c('0x8e')](_0x58c36f[_0x38ddd4])){this[_0x591c('0x9')]['setVariable'](util[_0x591c('0x24')](_0x591c('0x122'),_0x38ddd4[_0x591c('0x63')]()),_0x58c36f[_0x38ddd4]);}}if(_[_0x591c('0x3c')](_0x58c36f['message'])){return this[_0x591c('0x9')]['noop'](_0x591c('0x123'));}else{this['createSquareMessage'](_0x58c36f[_0x591c('0x71')],_0x591c('0xea'),_0x591c('0x124'),'');return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x125'),_0x58c36f['message']));}}return this[_0x591c('0x9')]['error'](_0x3e229e,_0x591c('0x126'));};AGIVertices['prototype'][_0x591c('0x127')]=function(_0x5ec0e9){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5ec0e9[_0x591c('0xa2')],_0x5ec0e9[_0x591c('0x5e')]));if(!this[_0x591c('0x7f')](_0x5ec0e9['key'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xdc'));}var _0x4a61fe=_0x591c('0x128');var _0x2431fb=util[_0x591c('0x24')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3bf6f8=util[_0x591c('0x24')](_0x591c('0x97'),_0x2431fb,_0x4a61fe);var _0xe2ced4=!![];if(_0x5ec0e9[_0x591c('0x129')]===_0x591c('0x12a')){_0xe2ced4=![];}var _0x5cafd6=this[_0x591c('0x9')][_0x591c('0x12b')](_0x2431fb,_0x4a61fe,_0x5ec0e9[_0x591c('0x12c')],_0x5ec0e9[_0x591c('0x5e')],undefined,_0xe2ced4);if(_0x5cafd6['result']!==-0x1){this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x12d'),_0x3bf6f8));var _0x352b6f=this[_0x591c('0x8a')][_0x591c('0x6b')](this,_0x5ec0e9,_0x3bf6f8);if(_0x352b6f){for(var _0x440616 in _0x352b6f){if(_0x352b6f['hasOwnProperty'](_0x440616)){this[_0x591c('0x9')][_0x591c('0x98')](util[_0x591c('0x24')](_0x591c('0x12e'),_0x440616['toUpperCase']()),_0x352b6f[_0x440616]);}}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x12f'),JSON['stringify'](_0x352b6f)));}}return _0x5cafd6;};AGIVertices['prototype'][_0x591c('0x130')]=function(_0x156dfd){logger[_0x591c('0x29')](util['format'](_0x591c('0x131'),_0x156dfd[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x156dfd[_0x591c('0x8c')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x132'));}if(!this['isConfigured'](_0x156dfd['appsecret'])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20appsecret\x20configured');}var _0x24f657='wav';var _0x3100de=util['format'](_0x591c('0x133'),FILES_PATH,rs[_0x591c('0x111')](0x4));var _0x298769=util[_0x591c('0x24')](_0x591c('0x97'),_0x3100de,_0x24f657);var _0x42ccc4=!![];if(_0x156dfd[_0x591c('0x129')]===_0x591c('0x12a')){_0x42ccc4=![];}var _0x7e428d=this[_0x591c('0x9')]['recordFile'](_0x3100de,_0x24f657,_0x156dfd[_0x591c('0x12c')],_0x156dfd[_0x591c('0x5e')],undefined,_0x42ccc4);if(_0x7e428d[_0x591c('0x9d')]!==-0x1){this[_0x591c('0x9')]['noop'](util[_0x591c('0x24')](_0x591c('0x134'),_0x298769));var _0x72aa55=this[_0x591c('0x135')][_0x591c('0x6b')](this,_0x156dfd,_0x298769);if(_0x72aa55){for(var _0x365789 in _0x72aa55){if(_0x72aa55[_0x591c('0x90')](_0x365789)){this[_0x591c('0x9')][_0x591c('0x98')](util['format'](_0x591c('0x136'),_0x365789[_0x591c('0x63')]()),_0x72aa55[_0x365789]);}}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x72aa55)));}}return _0x7e428d;};AGIVertices[_0x591c('0xc')][_0x591c('0x137')]=function(_0x5aaa09){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5aaa09['label']));return this[_0x591c('0x9')][_0x591c('0x138')](_0x5aaa09[_0x591c('0x33')],_0x5aaa09['extension'],_0x5aaa09[_0x591c('0x35')]);};AGIVertices[_0x591c('0xc')]['gotoif']=function(_0x20d0c0){logger['info'](util[_0x591c('0x24')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20d0c0[_0x591c('0xa2')]));if(!this['isConfigured'](_0x20d0c0['condition'])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x20d0c0,_0x591c('0x139'));}try{var _0x2a5719=eval(_0x20d0c0['condition'])?'true':'false';this['channel'][_0x591c('0xa3')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x20d0c0['condition'],_0x2a5719));return{'code':0xc8,'result':_0x2a5719};}catch(_0x16fb75){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x591c('0xc')][_0x591c('0x13a')]=function(_0x336827){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x13b'),_0x336827['label']));if(!this['isConfigured'](_0x336827[_0x591c('0x13c')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x336827,'no\x20interval\x20configured');}var _0x1a055c=this[_0x591c('0x1f')][_0x591c('0x6b')](this,_0x336827['interval_id']);if(!_0x1a055c){return this[_0x591c('0x9')]['error'](_0x336827,_0x591c('0x13d'));}for(var _0x118091=0x0;_0x118091<_0x1a055c[_0x591c('0x94')];_0x118091+=0x1){var _0x26e7d5=this['channel']['getVariable'](util[_0x591c('0x24')](_0x591c('0x13e'),_0x1a055c[_0x118091]));if(_0x26e7d5[_0x591c('0x9d')]===-0x1){return _0x26e7d5;}logger[_0x591c('0x29')](util['format'](_0x591c('0x13f'),_0x1a055c[_0x118091],_0x26e7d5[_0x591c('0x9b')]));if(_0x26e7d5[_0x591c('0x9b')]==='true'){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x13f'),_0x1a055c[_0x118091],_0x591c('0x140')));this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x13f'),_0x1a055c[_0x118091],_0x591c('0x140')));return{'code':0xc8,'result':_0x591c('0x140')};}else{logger[_0x591c('0x29')](util[_0x591c('0x24')]('IFTIME\x20%s\x20%s',_0x1a055c[_0x118091],_0x591c('0x141')));this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('IFTIME\x20%s\x20%s',_0x1a055c[_0x118091],_0x591c('0x141')));}}return{'code':0xc8,'result':_0x591c('0x141')};};AGIVertices[_0x591c('0xc')][_0x591c('0x142')]=function(_0x364692){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x364692[_0x591c('0xa2')]));return this['channel'][_0x591c('0x142')]();};AGIVertices['prototype'][_0x591c('0x143')]=function(_0x2309a1){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2309a1[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x2309a1['key'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xdc'));}var _0x492b8e=_0x591c('0x128');var _0x459166=util[_0x591c('0x24')](_0x591c('0x133'),FILES_PATH,rs[_0x591c('0x111')](0x4));var _0x21af6d=util['format'](_0x591c('0x97'),_0x459166,_0x492b8e);var _0x33bdb6=!![];if(_0x2309a1[_0x591c('0x129')]===_0x591c('0x12a')){_0x33bdb6=![];}var _0x1c92da=this[_0x591c('0x9')][_0x591c('0x12b')](_0x459166,_0x492b8e,_0x2309a1[_0x591c('0x12c')],_0x2309a1[_0x591c('0x5e')],undefined,_0x33bdb6);if(_0x1c92da[_0x591c('0x9d')]!==-0x1){this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0x144'),_0x21af6d));var _0x158dcf=this[_0x591c('0x7d')][_0x591c('0x6b')](this,_0x2309a1,_0x21af6d);if(_0x158dcf){for(var _0x320b97 in _0x158dcf){if(_0x158dcf[_0x591c('0x90')](_0x320b97)){this['channel'][_0x591c('0x98')](util['format'](_0x591c('0x145'),_0x320b97[_0x591c('0x63')]()),_0x158dcf[_0x320b97]);}}return this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')]('IspeechASR\x20Result\x20%s',JSON[_0x591c('0x6d')](_0x158dcf)));}}return _0x1c92da;};AGIVertices['prototype'][_0x591c('0x146')]=function(_0x452264){logger[_0x591c('0x29')](util['format'](_0x591c('0x147'),_0x452264[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x452264[_0x591c('0x74')])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20key\x20configured');}if(!this[_0x591c('0x7f')](_0x452264[_0x591c('0x53')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('Trying\x20ispeech\x20TTS\x20%s',_0x452264[_0x591c('0x53')]));var _0x13ab27=this['ispeechTTS']['sync'](this,_0x452264);if(_0x13ab27){this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x144'),_0x13ab27));var _0x2cf7d6=this[_0x591c('0x9')]['streamFile'](_0x13ab27,_0x452264['intKey']);try{fs[_0x591c('0xfc')](_0x13ab27+_0x591c('0xfd'));}catch(_0x35e772){logger[_0x591c('0x27')](_0x35e772);}return _0x2cf7d6;}return this[_0x591c('0x9')][_0x591c('0x27')](_0x452264,_0x591c('0x148'));};AGIVertices[_0x591c('0xc')][_0x591c('0x149')]=function(_0x4812ed){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x14a'),_0x4812ed[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x4812ed[_0x591c('0x14b')])){return this[_0x591c('0x9')]['error'](_0x4812ed,_0x591c('0x14c'));}logger['info'](util[_0x591c('0x24')](_0x591c('0x14d'),this[_0x591c('0x9')][_0x591c('0x32')],_0x4812ed[_0x591c('0x14b')]));var _0x24e027=this[_0x591c('0x4a')][_0x591c('0x6b')](this,_0x4812ed['findBy']);if(_0x24e027){logger[_0x591c('0x29')](util[_0x591c('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x591c('0x32')],_0x4812ed[_0x591c('0x14b')]));this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x14e'),this[_0x591c('0x9')][_0x591c('0x32')],_0x4812ed[_0x591c('0x14b')]));return{'code':0xc8,'result':_0x591c('0x14f')};}else{logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x150'),this['channel'][_0x591c('0x32')],_0x4812ed[_0x591c('0x14b')]));this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0x150'),this[_0x591c('0x9')][_0x591c('0x32')],_0x4812ed[_0x591c('0x14b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x591c('0xc')][_0x591c('0x151')]=function(_0x2a8763){logger[_0x591c('0x29')](util['format'](_0x591c('0x152'),_0x2a8763[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x2a8763[_0x591c('0x14b')])){return this['channel']['error'](_0x2a8763,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x591c('0x14d'),this[_0x591c('0x9')]['callerid'],_0x2a8763[_0x591c('0x14b')]));var _0x5cf8ed=this[_0x591c('0x49')]['sync'](this,_0x2a8763[_0x591c('0x14b')]);if(_0x5cf8ed){logger[_0x591c('0x29')](util['format'](_0x591c('0x14e'),this[_0x591c('0x9')][_0x591c('0x32')],_0x2a8763[_0x591c('0x14b')]));this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x591c('0x9')]['callerid'],_0x2a8763[_0x591c('0x14b')]));return{'code':0xc8,'result':_0x591c('0x14f')};}else{logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x150'),this[_0x591c('0x9')]['callerid'],_0x2a8763[_0x591c('0x14b')]));this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0x150'),this[_0x591c('0x9')][_0x591c('0x32')],_0x2a8763['findBy']));return{'code':0xc8,'result':_0x591c('0x153')};}};AGIVertices[_0x591c('0xc')][_0x591c('0x154')]=function(_0x27292f){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x155'),_0x27292f['label']));if(!this[_0x591c('0x7f')](_0x27292f['operation'])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x27292f,'no\x20operation\x20configured');}this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x156'),_0x27292f[_0x591c('0x157')]));var _0x1248ab=eval(_0x27292f[_0x591c('0x157')]);if(!this[_0x591c('0x7f')](_0x27292f['variable_id'])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x33b159=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x27292f[_0x591c('0xcb')]);if(!_0x33b159){return this[_0x591c('0x9')][_0x591c('0x27')](_0x27292f,_0x591c('0xcd'));}if(_[_0x591c('0x93')](_0x1248ab)){var _0x37616f=this;_0x1248ab[_0x591c('0xce')](function(_0x23da9c,_0x2789d7){_0x37616f[_0x591c('0x9')]['setVariable'](util[_0x591c('0x24')](_0x591c('0x158'),_0x33b159,_0x2789d7),_0x23da9c);});return this[_0x591c('0x9')][_0x591c('0xa3')](util['format']('variable\x20%s[key]\x20set',_0x33b159));}else{return this[_0x591c('0x9')][_0x591c('0x98')](_0x33b159,_0x1248ab);}};AGIVertices[_0x591c('0xc')][_0x591c('0x159')]=function(_0x47ed0f){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x15a'),_0x47ed0f['label']));if(_0x47ed0f['retry']===0x0){return this['maxRetry'](_0x47ed0f);}_0x47ed0f[_0x591c('0x9f')]-=0x1;if(!this['isConfigured'](_0x47ed0f['file_id'])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x47ed0f,'no\x20file\x20audio\x20selected');}var _0x2b5d25=this[_0x591c('0x19')][_0x591c('0x6b')](this,_0x47ed0f[_0x591c('0x109')]);if(!_0x2b5d25){return this[_0x591c('0x9')][_0x591c('0x27')](_0x47ed0f,'no\x20file\x20audio\x20found');}var _0xf0219d=this[_0x591c('0x9')][_0x591c('0x10b')](_0x2b5d25,_0x47ed0f[_0x591c('0x10c')],_0x47ed0f[_0x591c('0x15b')]);var _0x52b4fa=_0xf0219d[_0x591c('0x9d')];if(_0xf0219d[_0x591c('0x9d')]===-0x1){this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x47ed0f,'-1');return _0xf0219d;}else if(_0xf0219d['extra']===_0x591c('0x5e')){_0xf0219d[_0x591c('0x9d')]=_0xf0219d[_0x591c('0x9d')][_0x591c('0x94')]>0x0?_0xf0219d[_0x591c('0x9d')]:'t';}else if(_[_0x591c('0x3b')](_0xf0219d[_0x591c('0x9d')])){_0xf0219d[_0x591c('0x9d')]='#';_0x52b4fa='#';}if(!this['isConfigured'](_0x47ed0f[_0x591c('0xcb')])){this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xcc'));}else{var _0x350971=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x47ed0f[_0x591c('0xcb')]);if(!_0x350971){return this[_0x591c('0x9')][_0x591c('0x27')](_0x47ed0f,_0x591c('0xcd'));}this[_0x591c('0x9')][_0x591c('0x98')](_0x350971,_0x52b4fa);}this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x47ed0f,_0x52b4fa);return _0xf0219d;};AGIVertices['prototype'][_0x591c('0xa3')]=function(_0x365c77){logger['info'](util[_0x591c('0x24')](_0x591c('0x15c'),_0x365c77[_0x591c('0xa2')]));return this[_0x591c('0x9')][_0x591c('0xa3')](_0x365c77[_0x591c('0x15d')]||_0x365c77[_0x591c('0xa2')]);};AGIVertices[_0x591c('0xc')][_0x591c('0x15e')]=function(_0x22db99){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x15f'),_0x22db99[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x22db99['findBy'])){return this['channel'][_0x591c('0x27')](_0x22db99,_0x591c('0x14c'));}logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x14d'),this['channel'][_0x591c('0x32')],_0x22db99['findBy']));var _0x501e4e=this[_0x591c('0x160')][_0x591c('0x6b')](this,_0x22db99['pause_id']);var _0x48050d=this[_0x591c('0x46')]['sync'](this,_0x22db99[_0x591c('0x14b')],_0x501e4e);if(_0x48050d){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x14e'),this[_0x591c('0x9')][_0x591c('0x32')],_0x22db99['findBy']));this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x14e'),this['channel'][_0x591c('0x32')],_0x22db99[_0x591c('0x14b')]));return{'code':0xc8,'result':'success'};}else{logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x150'),this[_0x591c('0x9')][_0x591c('0x32')],_0x22db99['findBy']));this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0x14e'),this[_0x591c('0x9')][_0x591c('0x32')],_0x22db99[_0x591c('0x14b')]));return{'code':0xc8,'result':_0x591c('0x153')};}};AGIVertices[_0x591c('0xc')][_0x591c('0x161')]=function(_0x2588f4){logger[_0x591c('0x29')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2588f4[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x2588f4[_0x591c('0x109')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x2588f4,_0x591c('0x10a'));}var _0x43ba8f=this[_0x591c('0x19')]['sync'](this,_0x2588f4[_0x591c('0x109')]);if(!_0x43ba8f){return this['channel'][_0x591c('0x27')](_0x2588f4,_0x591c('0x162'));}var _0xf08e68=this['channel']['exec']('PLAYBACK',[_0x43ba8f,_0x2588f4['opts']]);if(_0xf08e68[_0x591c('0x9d')]===-0x1){return _0xf08e68;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xba'),_0x591c('0x163'),_0x43ba8f));};AGIVertices[_0x591c('0xc')][_0x591c('0x164')]=function(_0x4c0d05){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x165'),_0x4c0d05[_0x591c('0xa2')]));if(!this['isConfigured'](_0x4c0d05[_0x591c('0x166')])){return this[_0x591c('0x9')]['error'](_0x4c0d05,_0x591c('0x167'));}var _0x58fc9b='';var _0x40840e=parseInt(_0x4c0d05[_0x591c('0x166')],0xa);if(isNaN(_0x40840e)){_0x58fc9b=_0x4c0d05[_0x591c('0x166')];}else{_0x58fc9b=this[_0x591c('0x11')][_0x591c('0x6b')](this,_0x4c0d05[_0x591c('0x166')]);if(!_0x58fc9b){return this[_0x591c('0x9')][_0x591c('0x27')](_0x4c0d05,_0x591c('0x168'));}}var _0x2fe8b6='';if(this['isConfigured'](_0x4c0d05[_0x591c('0x109')])){var _0x4dfba5=this['getSound'][_0x591c('0x6b')](this,_0x4c0d05[_0x591c('0x109')]);if(_0x4dfba5){_0x2fe8b6=_0x4dfba5;}}this['createSquareDetailsReport'][_0x591c('0x6b')](this,_0x4c0d05,_0x58fc9b);if(_0x4c0d05['opts']['indexOf']('x')<0x0){_0x4c0d05[_0x591c('0x169')]+='x';}if(_0x4c0d05[_0x591c('0x169')][_0x591c('0x16a')]('X')<0x0){_0x4c0d05[_0x591c('0x169')]+='X';}this[_0x591c('0x9')][_0x591c('0x98')](_0x591c('0x16b'),_0x58fc9b?_0x58fc9b[_0x591c('0x16c')]():'');var _0x32bc9c=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0x16d'),[_0x58fc9b,_0x4c0d05['opts'],_0x4c0d05['url'],_0x2fe8b6,_0x4c0d05['timeout'],_0x4c0d05['agi'],_0x4c0d05[_0x591c('0x16e')],_0x4c0d05['gosub'],'',_0x4c0d05[_0x591c('0x16f')]]);if(_0x32bc9c[_0x591c('0x9d')]===-0x1){return _0x32bc9c;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')]('Executed\x20command\x20%s\x20%s',_0x591c('0x16d'),_0x58fc9b));};AGIVertices['prototype'][_0x591c('0x170')]=function(_0x2801ef){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x171'),_0x2801ef[_0x591c('0xa2')]));var _0x2bdf31=_0x2801ef['recordingFormat']||_0x591c('0x128');var _0x22db0f=util[_0x591c('0x24')](_0x591c('0x172'),this[_0x591c('0x9')][_0x591c('0x30')],rs[_0x591c('0x111')](0x5));var _0x5e77e6=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x22db0f,_0x2bdf31);var _0x2603f4=util[_0x591c('0x24')](_0x591c('0x133'),FILES_PATH,_0x22db0f);this[_0x591c('0x173')][_0x591c('0x6b')](this,_0x2801ef,_0x22db0f,_0x5e77e6);this[_0x591c('0x9')]['setVariable'](_0x591c('0x174'),_0x22db0f);logger[_0x591c('0x29')](_0x591c('0x175'),_0x2603f4,_0x2bdf31,_0x2801ef[_0x591c('0x176')],_0x2801ef[_0x591c('0x5e')]);return this['channel']['recordFile'](_0x2603f4,_0x2bdf31,_0x2801ef[_0x591c('0x176')],_0x2801ef[_0x591c('0x5e')],undefined,!![]);};AGIVertices['prototype'][_0x591c('0x177')]=function(_0x4f00a7){logger[_0x591c('0x29')](util['format'](_0x591c('0x178'),_0x4f00a7[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x4f00a7[_0x591c('0x5c')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x179'));}var _0x10d74b=this['restAPI'][_0x591c('0x6b')](this,_0x4f00a7);logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x17a'),util['inspect'](_0x10d74b,{'showHidden':![],'depth':null})));if(!this[_0x591c('0x7f')](_0x4f00a7['variable_id'])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x17b'));}var _0x114f4e=this['getVariable'][_0x591c('0x6b')](this,_0x4f00a7[_0x591c('0xcb')]);if(!_0x114f4e){return this['channel'][_0x591c('0x27')](_0x4f00a7,_0x591c('0xcd'));}this[_0x591c('0x9')][_0x591c('0x98')](util[_0x591c('0x24')](_0x591c('0x17c'),_0x114f4e),_0x10d74b[_0x591c('0x70')]?_0x10d74b[_0x591c('0x70')]:_0x591c('0x17d'));this['channel'][_0x591c('0x98')](util[_0x591c('0x24')]('%s_STATUS_MESSAGE',_0x114f4e),_0x10d74b['statusMessage']?_0x10d74b[_0x591c('0x6f')]:'OK');if(_0x10d74b[_0x591c('0x64')]){try{this[_0x591c('0x96')](_0x10d74b[_0x591c('0x64')],_0x114f4e);}catch(_0x546132){logger[_0x591c('0x27')](util['format'](_0x591c('0x17e'),_0x114f4e));}}return this['channel'][_0x591c('0xa3')](util['format'](_0x591c('0x17f'),_0x114f4e));};AGIVertices['prototype'][_0x591c('0x180')]=function(_0xa44df6){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x181'),_0xa44df6[_0x591c('0xa2')]));return this[_0x591c('0x9')][_0x591c('0x182')](_0xa44df6[_0x591c('0x183')][_0x591c('0x4f')](/\s+/g,''),_0xa44df6[_0x591c('0x176')]);};AGIVertices[_0x591c('0xc')]['saynumber']=function(_0xd8146f){logger[_0x591c('0x29')](util[_0x591c('0x24')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xd8146f['label']));return this['channel']['sayNumber'](_0xd8146f[_0x591c('0x5f')][_0x591c('0x4f')](/\s+/g,''),_0xd8146f[_0x591c('0x176')]);};AGIVertices[_0x591c('0xc')][_0x591c('0x184')]=function(_0x51b186){logger[_0x591c('0x29')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x51b186['label']));return this[_0x591c('0x9')]['sayPhonetic'](_0x51b186[_0x591c('0x53')],_0x51b186['escape_digits']);};AGIVertices[_0x591c('0xc')]['sendMail']=function(_0x358e2c){logger['info'](util[_0x591c('0x24')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x358e2c['label']));if(!this[_0x591c('0x7f')](_0x358e2c[_0x591c('0x185')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x186'));}var _0x31d6b3=this[_0x591c('0x1d')][_0x591c('0x6b')](this,_0x358e2c[_0x591c('0x185')]);if(!_0x31d6b3||!_0x31d6b3[_0x591c('0x187')]){return this[_0x591c('0x9')][_0x591c('0x27')](_0x358e2c,_0x591c('0x188'));}var _0x2815eb={'from':util[_0x591c('0x24')](_0x591c('0x189'),_0x31d6b3['name'],_0x31d6b3[_0x591c('0x18a')]||_0x31d6b3[_0x591c('0x187')][_0x591c('0x18b')]),'to':_0x358e2c['to']||'','cc':_0x358e2c['cc']||'','bcc':_0x358e2c[_0x591c('0x18c')]||'','subject':_0x358e2c['subject'],'html':_0x358e2c[_0x591c('0x53')],'text':_0x358e2c[_0x591c('0x53')]};var _0x36796c={'tls':{'rejectUnauthorized':![]}};if(_0x31d6b3[_0x591c('0x187')][_0x591c('0x18d')]){_0x36796c[_0x591c('0x18d')]=_0x31d6b3[_0x591c('0x187')][_0x591c('0x18d')];}else{_0x36796c[_0x591c('0x18e')]=_0x31d6b3[_0x591c('0x187')][_0x591c('0x18e')];_0x36796c[_0x591c('0x18f')]=_0x31d6b3['Smtp'][_0x591c('0x18f')];_0x36796c['secure']=_0x31d6b3[_0x591c('0x187')][_0x591c('0x190')];}if(_0x31d6b3['Smtp'][_0x591c('0x191')]){_0x36796c['auth']={'user':_0x31d6b3['Smtp'][_0x591c('0x18b')],'pass':_0x31d6b3[_0x591c('0x187')][_0x591c('0x192')]};}if(this[_0x591c('0x7f')](_0x358e2c['template_id'])){}logger[_0x591c('0xd2')]('sendMail\x20message',JSON[_0x591c('0x6d')](_0x2815eb));this['createSquareDetailsReport'][_0x591c('0x6b')](this,_0x358e2c,_0x358e2c[_0x591c('0x185')]);this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x193'),_0x31d6b3[_0x591c('0x13')]));this[_0x591c('0x1e')][_0x591c('0x6b')](this,_0x36796c,_0x2815eb);return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x194'));};AGIVertices[_0x591c('0xc')]['sendFax']=function(_0x2911e1){logger[_0x591c('0x29')](util['format'](_0x591c('0x195'),_0x2911e1[_0x591c('0xa2')]));return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x196'));};AGIVertices[_0x591c('0xc')][_0x591c('0x197')]=function(_0x12d63c){logger['info'](util[_0x591c('0x24')](_0x591c('0x198'),_0x12d63c[_0x591c('0xa2')]));if(!this['isConfigured'](_0x12d63c[_0x591c('0x199')])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x3bf65e=this[_0x591c('0x2d')][_0x591c('0x6b')](this,_0x12d63c['sms_account_id']);if(!_0x3bf65e){return this[_0x591c('0x9')][_0x591c('0x27')](_0x12d63c,_0x591c('0x19a'));}var _0x4dbd1e={'body':_0x12d63c[_0x591c('0x19b')],'phone':_0x12d63c['to']||'','SmsAccountId':_0x3bf65e['id']};logger[_0x591c('0xd2')]('sendSMS\x20message',JSON[_0x591c('0x6d')](_0x4dbd1e));this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x12d63c,_0x12d63c[_0x591c('0x199')]);this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x19c'),_0x3bf65e[_0x591c('0x13')]));this[_0x591c('0x2e')][_0x591c('0x6b')](this,_0x4dbd1e);return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x19d'));};AGIVertices[_0x591c('0xc')][_0x591c('0x19e')]=function(_0x38c44f){logger[_0x591c('0x29')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x38c44f[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x38c44f[_0x591c('0xcb')])){return this['channel'][_0x591c('0x27')](_0x38c44f,_0x591c('0x19f'));}var _0x2c1cfa=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x38c44f[_0x591c('0xcb')]);if(!_0x2c1cfa){return this['channel'][_0x591c('0x27')](_0x38c44f,'no\x20variable\x20found');}return this[_0x591c('0x9')][_0x591c('0x98')](_0x2c1cfa,_0x38c44f[_0x591c('0x1a0')]);};AGIVertices[_0x591c('0xc')][_0x591c('0x1a1')]=function(_0x3a7f0d){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x1a2'),_0x3a7f0d['label']));this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x1a3'));if(_0x3a7f0d['answer']==='yes'){this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0x1a4'));return this[_0x591c('0x9')][_0x591c('0xb0')]();}return this['channel'][_0x591c('0xa3')](_0x591c('0x1a5'));};AGIVertices[_0x591c('0xc')][_0x591c('0x1a6')]=function(_0x13383a){logger[_0x591c('0x29')](util['format'](_0x591c('0x1a7'),_0x13383a[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0x13383a[_0x591c('0x1a8')])){return this[_0x591c('0x9')][_0x591c('0x27')](_0x13383a,_0x591c('0x1a9'));}var _0x1e4cc4=this['getSquareProject'][_0x591c('0x6b')](this,_0x13383a[_0x591c('0x1a8')]);if(!this[_0x591c('0x7f')](_0x1e4cc4)){return this[_0x591c('0x9')][_0x591c('0x27')](_0x13383a,util['format'](_0x591c('0x1aa'),_0x13383a[_0x591c('0x1a8')]));}if(_0x1e4cc4===this['channel'][_0x591c('0x38')]){return this['channel'][_0x591c('0x27')](_0x13383a,_0x591c('0x1ab'));}this['createSquareDetailsReport'][_0x591c('0x6b')](this,_0x13383a,_0x1e4cc4);var _0x563b53=this[_0x591c('0x9')]['exec'](_0x591c('0x1ac'),util['format'](_0x591c('0x1ad'),config['agi']['host']||_0x591c('0x1ae'),_0x1e4cc4,this[_0x591c('0x9')][_0x591c('0x38')]));if(_0x563b53[_0x591c('0x9d')]===-0x1){return _0x563b53;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xba'),_0x591c('0x1ac'),_0x1e4cc4));};AGIVertices[_0x591c('0xc')][_0x591c('0x1af')]=function(_0x1daf54){logger[_0x591c('0x29')](util['format'](_0x591c('0x1b0'),_0x1daf54[_0x591c('0xa2')]));var _0x87fc15=this[_0x591c('0x1b1')][_0x591c('0x6b')](this,_0x1daf54[_0x591c('0x1b2')]);this[_0x591c('0x2f')][_0x591c('0x6b')](this,_0x1daf54,_0x1daf54[_0x591c('0x1b2')]);if(this['isConfigured'](_0x1daf54[_0x591c('0xcb')])){var _0x374515=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x1daf54[_0x591c('0xcb')]);if(_0x374515){this['channel'][_0x591c('0x98')](_0x374515,_0x87fc15);return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x1b3'),_0x1daf54[_0x591c('0x1b2')],_0x374515));}}return this[_0x591c('0x9')][_0x591c('0xa3')](util['format'](_0x591c('0x1b4'),_0x1daf54[_0x591c('0x1b2')]));};AGIVertices[_0x591c('0xc')][_0x591c('0x1b5')]=function(_0x3b6cbd){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x1b6'),_0x3b6cbd[_0x591c('0xa2')]));_0x3b6cbd[_0x591c('0x53')]=_0x3b6cbd[_0x591c('0x53')][_0x591c('0x4f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3b6cbd[_0x591c('0x51')])){return this[_0x591c('0x9')][_0x591c('0xa3')]('no\x20apiKey\x20configured');}if(!this[_0x591c('0x7f')](_0x3b6cbd['text'])){return this['channel']['noop'](_0x591c('0xa4'));}this[_0x591c('0x9')]['noop'](util[_0x591c('0x24')](_0x591c('0x1b7'),_0x3b6cbd['text']));var _0x477a88=this[_0x591c('0x50')][_0x591c('0x6b')](this,_0x3b6cbd);if(_0x477a88){this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x1b8'),_0x477a88));var _0x17c3f9=this[_0x591c('0x9')][_0x591c('0xfb')](_0x477a88);try{fs['unlink'](_0x477a88+_0x591c('0xfd'));}catch(_0x5ee8b9){logger[_0x591c('0x27')](_0x5ee8b9);}return _0x17c3f9;}return this[_0x591c('0x9')][_0x591c('0x27')](_0x3b6cbd,_0x591c('0x1b9'));};AGIVertices[_0x591c('0xc')][_0x591c('0x1ba')]=function(_0x586d97){logger[_0x591c('0x29')](util['format'](_0x591c('0x1bb'),_0x586d97['label']));_0x586d97[_0x591c('0x53')]=_0x586d97[_0x591c('0x53')][_0x591c('0x4f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x591c('0x7f')](_0x586d97[_0x591c('0x53')])){return this[_0x591c('0x9')][_0x591c('0xa3')](_0x591c('0xa4'));}this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x1bc'),_0x586d97[_0x591c('0x53')]));var _0x534614=this['googleTTS'][_0x591c('0x6b')](this,_0x586d97);if(_0x534614){this['channel'][_0x591c('0xa3')](util[_0x591c('0x24')]('Google\x20TTS\x20%s\x20file\x20created',_0x534614));var _0x5a9648=this[_0x591c('0x9')][_0x591c('0xfb')](_0x534614);try{fs[_0x591c('0xfc')](_0x534614+_0x591c('0xfd'));}catch(_0x27b65e){logger[_0x591c('0x27')](_0x27b65e);}return _0x5a9648;}return this[_0x591c('0x9')][_0x591c('0x27')](_0x586d97,_0x591c('0x1bd'));};AGIVertices[_0x591c('0xc')][_0x591c('0x1be')]=function(_0xaf09d1){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x1bf'),_0xaf09d1[_0x591c('0xa2')]));if(!this[_0x591c('0x7f')](_0xaf09d1[_0x591c('0x14b')])){return this['channel'][_0x591c('0x27')](_0xaf09d1,_0x591c('0x14c'));}logger['info'](util[_0x591c('0x24')](_0x591c('0x14d'),this['channel']['callerid'],_0xaf09d1['findBy']));var _0x129422=this[_0x591c('0x48')]['sync'](this,_0xaf09d1[_0x591c('0x14b')]);if(_0x129422){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x14e'),this[_0x591c('0x9')][_0x591c('0x32')],_0xaf09d1[_0x591c('0x14b')]));this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0x14e'),this['channel'][_0x591c('0x32')],_0xaf09d1[_0x591c('0x14b')]));return{'code':0xc8,'result':_0x591c('0x14f')};}else{logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x150'),this[_0x591c('0x9')][_0x591c('0x32')],_0xaf09d1[_0x591c('0x14b')]));this['channel']['noop'](util[_0x591c('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x591c('0x9')]['callerid'],_0xaf09d1[_0x591c('0x14b')]));return{'code':0xc8,'result':_0x591c('0x153')};}};AGIVertices[_0x591c('0xc')]['voicemail']=function(_0x4c8ad4){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x1c0'),_0x4c8ad4[_0x591c('0xa2')]));var _0x543077=this[_0x591c('0x9')][_0x591c('0x4e')](_0x591c('0x1c1'),[_0x4c8ad4[_0x591c('0x1c2')],_0x4c8ad4[_0x591c('0x72')]]);if(_0x543077[_0x591c('0x9d')]===-0x1){return _0x543077;}return this[_0x591c('0x9')][_0x591c('0xa3')](util[_0x591c('0x24')](_0x591c('0xba'),'VOICEMAIL',_0x4c8ad4['mailbox']));};AGIVertices[_0x591c('0xc')][_0x591c('0x1c3')]=function(_0x36c68c){logger[_0x591c('0x29')](util[_0x591c('0x24')](_0x591c('0x1c4'),_0x36c68c['label']));if(!this[_0x591c('0x7f')](_0x36c68c[_0x591c('0xcb')])){return this['channel'][_0x591c('0x27')](_0x36c68c,'no\x20variable\x20selected');}var _0x4180ed=this[_0x591c('0xd')][_0x591c('0x6b')](this,_0x36c68c[_0x591c('0xcb')]);if(!_0x4180ed){return this[_0x591c('0x9')][_0x591c('0x27')](_0x36c68c,'no\x20variable\x20found');}var _0x37c081=this[_0x591c('0x9')]['getVariable'](_0x4180ed);return{'code':0xc8,'result':_0x37c081['extra']?_0x37c081[_0x591c('0x9b')]:'-'};};String['prototype']['replaceAll']=function(_0x4a4e02,_0xe7c9d){return this[_0x591c('0x99')](_0x4a4e02)[_0x591c('0x1c5')](_0xe7c9d);};module[_0x591c('0x1c6')]=AGIVertices; \ No newline at end of file +var _0x5d9d=['Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','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','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','port','secure','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','prototype','getVariableById','then','name','catch','rpc','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','agentLogin','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','isConfigured','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','getAndSetVariable','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d9d,0xcc));var _0xd5d9=function(_0x43c589,_0x13040e){_0x43c589=_0x43c589-0x0;var _0x40e3e4=_0x5d9d[_0x43c589];return _0x40e3e4;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd5d9('0x0'));var _=require(_0xd5d9('0x1'));var sh=require(_0xd5d9('0x2'));var odbc=require(_0xd5d9('0x3'))();var rs=require(_0xd5d9('0x4'));var moment=require(_0xd5d9('0x5'));var Mustache=require(_0xd5d9('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')(_0xd5d9('0x7'));var config=require('../../config/environment');var scripts=require(_0xd5d9('0x8'));var FILES_PATH=_0xd5d9('0x9');var recursiveMapAttributes=[_0xd5d9('0xa'),_0xd5d9('0xb')];var verticesWithRetry=[_0xd5d9('0xc'),_0xd5d9('0xd'),_0xd5d9('0xe')];var AGIVertices=function(_0x558b69,_0x2e2544,_0x401a9a){this['channel']=_0x558b69;this['rpc']=_0x2e2544;this['mailRpc']=_0x401a9a;};AGIVertices[_0xd5d9('0xf')]['getVariable']=function(_0x278030,_0x21128c){this['rpc'][_0xd5d9('0x10')](_0x278030)[_0xd5d9('0x11')](function(_0x2b1711){_0x21128c(null,_0x2b1711?_0x2b1711[_0xd5d9('0x12')]:![]);})[_0xd5d9('0x13')](function(_0x2320b6){_0x21128c(_0x2320b6);});};AGIVertices[_0xd5d9('0xf')]['getVoiceQueue']=function(_0x367d56,_0x20b0e4){this[_0xd5d9('0x14')]['getVoiceQueueById'](_0x367d56)[_0xd5d9('0x11')](function(_0x310b5c){_0x20b0e4(null,_0x310b5c?_0x310b5c[_0xd5d9('0x12')]:![]);})[_0xd5d9('0x13')](function(_0x3718af){_0x20b0e4(_0x3718af);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x15')]=function(_0xe53300,_0x2f2733){this['rpc'][_0xd5d9('0x16')](_0xe53300)['then'](function(_0x456587){_0x2f2733(null,_0x456587?_0x456587[_0xd5d9('0x12')]:![]);})['catch'](function(_0x18c8c9){_0x2f2733(_0x18c8c9);});};AGIVertices[_0xd5d9('0xf')]['getSquareOdbc']=function(_0x1591bb,_0x31bbe4){this['rpc'][_0xd5d9('0x17')](_0x1591bb)[_0xd5d9('0x11')](function(_0x38bb53){_0x31bbe4(null,_0x38bb53?_0x38bb53[_0xd5d9('0x18')]:![]);})[_0xd5d9('0x13')](function(_0x81f1fa){_0x31bbe4(_0x81f1fa);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x19')]=function(_0x159046,_0x5b26de){this[_0xd5d9('0x14')]['getUserById'](_0x159046)[_0xd5d9('0x11')](function(_0x4a41ba){_0x5b26de(null,_0x4a41ba?_0x4a41ba[_0xd5d9('0x12')]:![]);})[_0xd5d9('0x13')](function(_0x141a9a){_0x5b26de(_0x141a9a);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1a')]=function(_0x3bc31a,_0x158695){this[_0xd5d9('0x14')][_0xd5d9('0x1b')](_0x3bc31a)[_0xd5d9('0x11')](function(_0x59b3e1){_0x158695(null,_0x59b3e1?_0x59b3e1[_0xd5d9('0x12')]:![]);})[_0xd5d9('0x13')](function(_0x56908c){_0x158695(_0x56908c);});};AGIVertices[_0xd5d9('0xf')]['getSound']=function(_0x2831f3,_0x2e8820){var _0x4bd309=this;this[_0xd5d9('0x14')]['getSoundById'](_0x2831f3)['then'](function(_0x26a784){_0x2e8820(null,_0x26a784?_0x4bd309[_0xd5d9('0x1c')](_0x26a784[_0xd5d9('0x1d')]):![]);})[_0xd5d9('0x13')](function(_0x5e0af8){_0x2e8820(_0x5e0af8);});};AGIVertices['prototype'][_0xd5d9('0x1e')]=function(_0x1bd853,_0x17054e){this[_0xd5d9('0x14')][_0xd5d9('0x1f')](_0x1bd853)[_0xd5d9('0x11')](function(_0x4246b8){_0x17054e(null,_0x4246b8?_0x4246b8:![]);})[_0xd5d9('0x13')](function(_0x57979b){_0x17054e(_0x57979b);});};AGIVertices['prototype']['sendMailMessage']=function(_0x28f526,_0x18bcb9,_0x4121bd){this[_0xd5d9('0x20')][_0xd5d9('0x21')](_0x28f526,_0x18bcb9)[_0xd5d9('0x11')](function(){_0x4121bd(null);})['catch'](function(_0x377da1){_0x4121bd(_0x377da1);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x22')]=function(_0x9ffcfa,_0x4789c7){this[_0xd5d9('0x14')][_0xd5d9('0x23')](_0x9ffcfa)['then'](function(_0xabe3c5){if(_0xabe3c5){if(_0xabe3c5[_0xd5d9('0x24')]){_0x4789c7(null,[_0xabe3c5[_0xd5d9('0x25')]]);}else{_0x4789c7(null,_['map'](_0xabe3c5[_0xd5d9('0x26')],'interval'));}}else{_0x4789c7(null,![]);}})['catch'](function(_0x3f10e7){_0x4789c7(_0x3f10e7);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1c')]=function(_0x55793d){return util['format'](_0xd5d9('0x27'),FILES_PATH,_0x55793d);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x28')]=function(_0x25e413,_0x28fcf6,_0x1136d7){odbc['open'](_0x25e413,function(_0xc78c30){if(_0xc78c30){logger['error'](_0xd5d9('0x29'),_0xc78c30);_0x1136d7(_0xc78c30);}else{logger['info'](_0xd5d9('0x2a'));odbc[_0xd5d9('0x2b')](_0x28fcf6,function(_0x471523,_0x25bed6){if(_0x471523){logger[_0xd5d9('0x2c')](_0xd5d9('0x2d'),_0x28fcf6);_0x1136d7(_0x471523);}else{logger[_0xd5d9('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x28fcf6);odbc[_0xd5d9('0x2e')](function(_0x4c5bf7){if(_0x4c5bf7){logger[_0xd5d9('0x2f')](_0xd5d9('0x30'),_0x4c5bf7);}_0x1136d7(null,_0x25bed6);});}});}});};AGIVertices['prototype'][_0xd5d9('0x31')]=function(_0x3d5637,_0x9f2205){this[_0xd5d9('0x14')]['getSmsAccountById'](_0x3d5637)[_0xd5d9('0x11')](function(_0x190153){_0x9f2205(null,_0x190153?_0x190153:![]);})[_0xd5d9('0x13')](function(_0x1aea66){_0x9f2205(_0x1aea66);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x32')]=function(_0x143a73,_0x34ec81){this[_0xd5d9('0x14')]['createSmsMessage'](_0x143a73)[_0xd5d9('0x11')](function(_0x2f7489){_0x34ec81(null,_0x2f7489);})[_0xd5d9('0x13')](function(_0x4899be){_0x34ec81(_0x4899be);});};AGIVertices['prototype'][_0xd5d9('0x33')]=function(_0x4216b8,_0x49e5ee,_0x7031d6){this[_0xd5d9('0x14')]['createSquareDetailsReport']({'uniqueid':this[_0xd5d9('0x34')][_0xd5d9('0x35')],'node':_0x4216b8[_0xd5d9('0x36')],'application':_0x4216b8[_0xd5d9('0x37')],'data':_0x49e5ee||null,'project_name':this[_0xd5d9('0x34')][_0xd5d9('0x38')],'callerid':this[_0xd5d9('0x34')][_0xd5d9('0x39')]})['then'](function(_0x3d1f19){if(_0x7031d6){_0x7031d6(null,_0x3d1f19);}})[_0xd5d9('0x13')](function(_0x532224){if(_0x7031d6){_0x7031d6(_0x532224);}});};AGIVertices['prototype'][_0xd5d9('0x3a')]=function(_0xc68cfa,_0x48abda,_0x514e97,_0x6cfdaa){this[_0xd5d9('0x14')][_0xd5d9('0x3a')]({'uniqueid':this[_0xd5d9('0x34')][_0xd5d9('0x35')],'callerid':this['channel'][_0xd5d9('0x39')],'calleridname':this[_0xd5d9('0x34')][_0xd5d9('0x3b')],'context':this[_0xd5d9('0x34')][_0xd5d9('0x3c')],'extension':this['channel'][_0xd5d9('0x3d')],'priority':this[_0xd5d9('0x34')][_0xd5d9('0x3e')],'accountcode':this[_0xd5d9('0x34')][_0xd5d9('0x3f')],'dnid':this[_0xd5d9('0x34')]['dnid'],'projectName':this[_0xd5d9('0x34')][_0xd5d9('0x38')],'saveName':_0x48abda,'filename':_0xc68cfa['file']||_0x48abda,'savePath':_0x514e97})[_0xd5d9('0x11')](function(_0x58d3aa){_0x6cfdaa(null,_0x58d3aa);})[_0xd5d9('0x13')](function(_0x3b5b3b){_0x6cfdaa(_0x3b5b3b);});};AGIVertices['prototype'][_0xd5d9('0x40')]=function(_0x48067f,_0xb8d0dd,_0x275716,_0x358764,_0x247a67){this[_0xd5d9('0x14')][_0xd5d9('0x40')]({'uniqueid':this[_0xd5d9('0x34')][_0xd5d9('0x35')],'body':_0x48067f,'direction':_0xb8d0dd,'providerName':_0x275716,'providerResponse':_0x358764})['then'](function(_0x2294ce){if(_0x247a67){_0x247a67(null,_0x2294ce);}})['catch'](function(_0xfbe2e){if(_0x247a67){_0x247a67(_0xfbe2e);}});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x41')]=function(_0x2e3624,_0x69ccb7){this[_0xd5d9('0x14')][_0xd5d9('0x41')]({'firstName':_[_0xd5d9('0x42')](_0x2e3624[_0xd5d9('0x12')])||_[_0xd5d9('0x43')](_0x2e3624['name'])?'callback_'+Math['random']():_0x2e3624[_0xd5d9('0x12')],'lastName':_[_0xd5d9('0x42')](_0x2e3624['lastName'])||_[_0xd5d9('0x43')](_0x2e3624['lastName'])?null:_0x2e3624['lastName'],'phone':_0x2e3624[_0xd5d9('0x44')],'ListId':_0x2e3624[_0xd5d9('0x45')],'scheduledat':_0x2e3624['scheduledAt'],'callbackUniqueid':this[_0xd5d9('0x34')][_0xd5d9('0x35')],'tags':_0xd5d9('0x46'),'description':_0xd5d9('0x47')+_0x2e3624[_0xd5d9('0x48')][_0xd5d9('0x49')](),'priority':_0x2e3624[_0xd5d9('0x4a')]})[_0xd5d9('0x11')](function(_0x3c2123){_0x69ccb7(null,_0x3c2123);})[_0xd5d9('0x13')](function(_0x2cec46){_0x69ccb7(_0x2cec46);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x4b')]=function(_0x4b3cc5,_0x419e4f){this[_0xd5d9('0x14')][_0xd5d9('0x4c')](_0x4b3cc5)[_0xd5d9('0x11')](function(_0x1f52ce){_0x419e4f(null,_0x1f52ce?_0x1f52ce[_0xd5d9('0x12')]:![]);})[_0xd5d9('0x13')](function(_0x452c28){_0x419e4f(_0x452c28);});};AGIVertices[_0xd5d9('0xf')]['agentPause']=function(_0x2c40c6,_0x35c873,_0x8ce658){var _0x1aa946={'role':_0xd5d9('0x4d')};_0x1aa946[_0x2c40c6]=this[_0xd5d9('0x34')][_0xd5d9('0x39')];this[_0xd5d9('0x14')][_0xd5d9('0x4e')](_0x1aa946,_0x35c873,this[_0xd5d9('0x34')][_0xd5d9('0x35')])[_0xd5d9('0x11')](function(_0x3b27ca){_0x8ce658(null,_[_0xd5d9('0x43')](_0x3b27ca)?![]:!![]);})[_0xd5d9('0x13')](function(_0xb12591){logger[_0xd5d9('0x2f')](_0xb12591);_0x8ce658(null,![]);});};AGIVertices[_0xd5d9('0xf')]['agentUnpause']=function(_0x3164a8,_0x149082){var _0x32db87={'role':_0xd5d9('0x4d')};_0x32db87[_0x3164a8]=this[_0xd5d9('0x34')][_0xd5d9('0x39')];this[_0xd5d9('0x14')][_0xd5d9('0x4f')](_0x32db87)[_0xd5d9('0x11')](function(_0x1ca408){_0x149082(null,_[_0xd5d9('0x43')](_0x1ca408)?![]:!![]);})[_0xd5d9('0x13')](function(_0x39cfe6){logger[_0xd5d9('0x2f')](_0x39cfe6);_0x149082(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x499e3b,_0x441300){var _0x238644={'role':_0xd5d9('0x4d')};_0x238644[_0x499e3b]=this[_0xd5d9('0x34')][_0xd5d9('0x39')];this[_0xd5d9('0x14')][_0xd5d9('0x50')](_0x238644)[_0xd5d9('0x11')](function(_0x24f3c6){_0x441300(null,_[_0xd5d9('0x43')](_0x24f3c6)?![]:!![]);})['catch'](function(_0x247cd1){logger[_0xd5d9('0x2f')](_0x247cd1);_0x441300(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x8cc013,_0x2fde40){var _0x1740b1={'role':_0xd5d9('0x4d')};_0x1740b1[_0x8cc013]=this[_0xd5d9('0x34')][_0xd5d9('0x39')];var _0x41ed5c=_0x8cc013!=_0xd5d9('0x51')?util[_0xd5d9('0x52')](_0xd5d9('0x53'),'LOCAL',this[_0xd5d9('0x34')][_0xd5d9('0x39')]):undefined;this['rpc'][_0xd5d9('0x54')](_0x1740b1,_0x41ed5c)[_0xd5d9('0x11')](function(_0x1f670f){_0x2fde40(null,_[_0xd5d9('0x43')](_0x1f670f)?![]:!![]);})['catch'](function(_0x365df0){logger[_0xd5d9('0x2f')](_0x365df0);_0x2fde40(null,![]);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x55')]=function(_0x2a4471,_0x457c83){sh[_0xd5d9('0x56')](_['trim'](_0x2a4471),function(_0x2b4960,_0x56d6a3){var _0x21445a=_0x56d6a3[_0xd5d9('0x57')](/(\r\n|\n|\r)/gm,'');_0x457c83(null,_0x21445a);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x58')]=function(_0x3e8751,_0x40116f){scripts[_0xd5d9('0x58')](_0x3e8751['apiKey'],_0x3e8751[_0xd5d9('0x59')]||'text',_0x3e8751[_0xd5d9('0x5a')],_0x3e8751[_0xd5d9('0x5b')]||_0xd5d9('0x5c'),_0x3e8751[_0xd5d9('0x5d')]||_0xd5d9('0x5e'),_0x3e8751[_0xd5d9('0x5f')]||_0xd5d9('0x60'))[_0xd5d9('0x11')](function(_0x10da88){_0x40116f(null,_0x10da88);})[_0xd5d9('0x13')](function(_0x294b6b){_0x40116f(_0x294b6b);});};AGIVertices['prototype'][_0xd5d9('0x61')]=function(_0x236ccd,_0x3645ca){scripts[_0xd5d9('0x61')](_0x236ccd[_0xd5d9('0x5a')],_0x236ccd['google_tts_language']||'en',0x1)['then'](function(_0x36a783){_0x3645ca(null,_0x36a783);})[_0xd5d9('0x13')](function(_0x24dc71){_0x3645ca(_0x24dc71);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x62')]=function(_0x3f3c57,_0xbc4f9f){var _0x385637={'uri':_0x3f3c57[_0xd5d9('0x63')],'method':_0x3f3c57[_0xd5d9('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3f3c57[_0xd5d9('0x65')])===_0xd5d9('0x66')&&parseInt(_0x3f3c57['timeout'])>=0x1?parseInt(_0x3f3c57[_0xd5d9('0x65')])*0x3e8:0x5*0x3e8};if(_[_0xd5d9('0x67')]([_0xd5d9('0x68'),'PUT'],_0x385637[_0xd5d9('0x64')][_0xd5d9('0x69')]())){try{_0x385637[_0xd5d9('0x6a')]=_0x3f3c57[_0xd5d9('0xb')]?JSON[_0xd5d9('0x6b')](_0x3f3c57['rawBody']):{};}catch(_0x960817){logger[_0xd5d9('0x2f')](_0xd5d9('0x6c'),_0x960817);}}try{_0x385637[_0xd5d9('0x6d')]=_0x3f3c57['rawHeaders']?JSON[_0xd5d9('0x6b')](_0x3f3c57[_0xd5d9('0xa')]):{};}catch(_0x37d851){logger[_0xd5d9('0x2f')](_0xd5d9('0x6e'),_0x37d851);}if(_0x3f3c57[_0xd5d9('0x6f')]){try{var _0x2efaa8=require(_0x3f3c57[_0xd5d9('0x6f')])['sync'](this,_0x385637);_0x385637[_0xd5d9('0x70')]=Mustache[_0xd5d9('0x71')](_0x3f3c57[_0xd5d9('0x63')],_0x2efaa8,{},['$$','$$']);if(_0x385637['headers']){_0x385637[_0xd5d9('0x6d')]=JSON['parse'](Mustache[_0xd5d9('0x71')](JSON['stringify'](_0x385637[_0xd5d9('0x6d')]),_0x2efaa8,{},['$$','$$']));}if(_0x385637['body']){_0x385637[_0xd5d9('0x6a')]=JSON['parse'](Mustache['render'](JSON[_0xd5d9('0x72')](_0x385637[_0xd5d9('0x6a')]),_0x2efaa8,{},['$$','$$']));}}catch(_0x35c67a){logger['error'](_0xd5d9('0x73'),_0x35c67a);}}rp(_0x385637)[_0xd5d9('0x11')](function(_0x178dca){var _0x4450e4={'statusCode':_0x178dca[_0xd5d9('0x74')]||0xc8,'statusMessage':_0x178dca['statusMessage']||'OK','headers':_0x178dca[_0xd5d9('0x6d')]||{},'body':_0x178dca[_0xd5d9('0x6a')]||{}};_0xbc4f9f(null,_0x4450e4);})['catch'](function(_0x48956a){var _0xe744f1={'statusCode':_0x48956a[_0xd5d9('0x74')]||0x1f4,'statusMessage':_0x48956a[_0xd5d9('0x75')]||_0xd5d9('0x76'),'headers':_0x48956a[_0xd5d9('0x77')][_0xd5d9('0x6d')]||{},'body':_0x48956a[_0xd5d9('0x77')][_0xd5d9('0x6a')]||{}};_0xbc4f9f(null,_0xe744f1);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x78')]=function(_0x5d765f,_0x6b1ae5){scripts[_0xd5d9('0x78')](this[_0xd5d9('0x34')]['uniqueid'],_0x5d765f['key'],_0x5d765f[_0xd5d9('0x5a')],_0x5d765f[_0xd5d9('0x79')]||'en')[_0xd5d9('0x11')](function(_0x28be15){_0x6b1ae5(null,_0x28be15);})[_0xd5d9('0x13')](function(_0x5a360a){_0x6b1ae5(_0x5a360a);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x7a')]=function(_0x4ededa,_0x237b52){scripts[_0xd5d9('0x7a')](this[_0xd5d9('0x34')]['uniqueid'],_0x4ededa[_0xd5d9('0x7b')],_0x4ededa[_0xd5d9('0x7c')],_0x4ededa[_0xd5d9('0x7d')],_0x4ededa[_0xd5d9('0x5a')],_0x4ededa[_0xd5d9('0x7e')]||'en')[_0xd5d9('0x11')](function(_0x53dfbb){_0x237b52(null,_0x53dfbb);})[_0xd5d9('0x13')](function(_0x3005ab){_0x237b52(_0x3005ab);});};AGIVertices['prototype'][_0xd5d9('0x7f')]=function(_0x11024a,_0x27d3fe){scripts['sestekNDA'](this[_0xd5d9('0x34')],_0x11024a)[_0xd5d9('0x11')](function(_0x1dff80){_0x27d3fe(null,_0x1dff80);})[_0xd5d9('0x13')](function(_0x4c4f6d){_0x27d3fe(_0x4c4f6d);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x80')]=function(_0x372c2c,_0x3a3d89){scripts[_0xd5d9('0x80')](_0x372c2c[_0xd5d9('0x81')],_0x372c2c[_0xd5d9('0x5a')],_0x372c2c[_0xd5d9('0x82')]||_0xd5d9('0x5c'),_0x372c2c[_0xd5d9('0x83')])[_0xd5d9('0x11')](function(_0x1ffaf0){_0x3a3d89(null,_0x1ffaf0);})[_0xd5d9('0x13')](function(_0x7deeb2){_0x3a3d89(_0x7deeb2);});};AGIVertices['prototype'][_0xd5d9('0x84')]=function(_0x117780,_0x7ce61f,_0x1cfe8c){scripts[_0xd5d9('0x84')](_0x7ce61f,_0x117780[_0xd5d9('0x81')],_0x117780['ispeech_asr_language']||_0xd5d9('0x5c'),this['isConfigured'](_0x117780['model'])?_0x117780[_0xd5d9('0x85')]:undefined)[_0xd5d9('0x11')](function(_0x25f870){_0x1cfe8c(null,_0x25f870);})['catch'](function(_0x11ddcf){_0x1cfe8c(_0x11ddcf);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x86')]=function(_0x1e8a6d,_0x52c929){scripts[_0xd5d9('0x86')](_0x1e8a6d[_0xd5d9('0x87')],_0x1e8a6d[_0xd5d9('0x88')],_0x1e8a6d[_0xd5d9('0x89')],_0x1e8a6d[_0xd5d9('0x8a')]||_0xd5d9('0x8b'),_0x1e8a6d[_0xd5d9('0x5a')],_0x1e8a6d[_0xd5d9('0x8c')]||'text')[_0xd5d9('0x11')](function(_0x55570f){_0x52c929(null,_0x55570f);})[_0xd5d9('0x13')](function(_0x5d6384){_0x52c929(_0x5d6384);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x8d')]=function(_0x39879f,_0x508c21){scripts[_0xd5d9('0x8d')](this['channel'][_0xd5d9('0x35')],_0x39879f[_0xd5d9('0x87')],_0x39879f[_0xd5d9('0x88')],_0x39879f[_0xd5d9('0x8e')],_0x39879f[_0xd5d9('0x5a')],_0x39879f['aws_bot_name'])['then'](function(_0x3aafd3){_0x508c21(null,_0x3aafd3);})[_0xd5d9('0x13')](function(_0x33464c){_0x508c21(_0x33464c);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x8f')]=function(_0x4a62ea,_0x581fb0,_0x4ba2d2){scripts[_0xd5d9('0x8f')](_0x581fb0,_0x4a62ea[_0xd5d9('0x81')],_0x4a62ea[_0xd5d9('0x90')]||_0xd5d9('0x5c'))[_0xd5d9('0x11')](function(_0x5c1cae){_0x4ba2d2(null,_0x5c1cae);})['catch'](function(_0x17f59b){_0x4ba2d2(_0x17f59b);});};AGIVertices[_0xd5d9('0xf')]['tildeASR']=function(_0x362b76,_0x471876,_0x16b53a){scripts[_0xd5d9('0x91')](_0x471876,_0x362b76[_0xd5d9('0x92')],_0x362b76[_0xd5d9('0x93')],_0x362b76[_0xd5d9('0x70')])[_0xd5d9('0x11')](function(_0x48bef0){_0x16b53a(null,_0x48bef0);})[_0xd5d9('0x13')](function(_0x4c8a9d){_0x16b53a(_0x4c8a9d);});};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x94')]=function(_0x2d1c34){var _0x36655f=_[_0xd5d9('0x67')](verticesWithRetry,_0x2d1c34[_0xd5d9('0x37')])?_0x2d1c34:_[_0xd5d9('0x95')](_0x2d1c34);for(var _0x462840 in _0x36655f){if(_0x36655f['hasOwnProperty'](_0x462840)){if(_0x36655f[_0x462840]&&_[_0xd5d9('0x96')](_0x36655f[_0x462840])){if(_[_0xd5d9('0x67')](recursiveMapAttributes,_0x462840)){_0x36655f[_0x462840]=this[_0xd5d9('0x97')](_0x36655f[_0x462840]);}else{_0x36655f[_0x462840]=this[_0xd5d9('0x98')](_0x36655f[_0x462840]);}}}}return _0x36655f;};AGIVertices['prototype'][_0xd5d9('0x99')]=function(_0x2a4507){for(var _0x23fa22 in _0x2a4507){if(_0x2a4507[_0xd5d9('0x9a')](_0x23fa22)){if(_[_0xd5d9('0x9b')](_0x2a4507[_0x23fa22])){this[_0xd5d9('0x99')](_0x2a4507[_0x23fa22]);}else if(_[_0xd5d9('0x9c')](_0x2a4507[_0x23fa22])){for(var _0x3c7499=0x0;_0x3c7499<_0x2a4507[_0x23fa22][_0xd5d9('0x9d')];_0x3c7499++){this[_0xd5d9('0x99')](_0x2a4507[_0x23fa22][_0x3c7499]);}}else if(_[_0xd5d9('0x96')](_0x2a4507[_0x23fa22])){_0x2a4507[_0x23fa22]=this['replaceAllVariables'](_0x2a4507[_0x23fa22]);}}}};AGIVertices['prototype'][_0xd5d9('0x9e')]=function(_0x41832e,_0x1624a6){for(var _0x10433b in _0x41832e){if(_0x41832e[_0xd5d9('0x9a')](_0x10433b)){if(_[_0xd5d9('0x9b')](_0x41832e[_0x10433b])){if(!_[_0xd5d9('0x42')](_0x41832e[_0x10433b])){this[_0xd5d9('0x9e')](_0x41832e[_0x10433b],util[_0xd5d9('0x52')](_0xd5d9('0x9f'),_0x1624a6,_0x10433b));}}else if(_['isArray'](_0x41832e[_0x10433b])){for(var _0x317361=0x0;_0x317361<_0x41832e[_0x10433b][_0xd5d9('0x9d')];_0x317361++){this[_0xd5d9('0x9e')](_0x41832e[_0x10433b][_0x317361],util[_0xd5d9('0x52')](_0xd5d9('0x9f'),_0x1624a6,_0x10433b+'['+_0x317361+']'));}}else{if(!_[_0xd5d9('0x43')](_0x41832e[_0x10433b])){this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util[_0xd5d9('0x52')](_0xd5d9('0x9f'),_0x1624a6,_0x10433b),_0x41832e[_0x10433b]);}}}}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x97')]=function(_0x59dfa0){try{var _0x20bbd5=JSON['parse'](_0x59dfa0);this[_0xd5d9('0x99')](_0x20bbd5);return JSON[_0xd5d9('0x72')](_0x20bbd5);}catch(_0x4204f7){return this[_0xd5d9('0x98')](_0x59dfa0);}};AGIVertices['prototype'][_0xd5d9('0x98')]=function(_0x19b8d1){var _0x3dc196=_0x19b8d1[_0xd5d9('0xa1')]('{');for(var _0x4f1275=0x1;_0x4f1275<_0x3dc196[_0xd5d9('0x9d')];_0x4f1275+=0x1){var _0x2c1387=_0x3dc196[_0x4f1275][_0xd5d9('0xa1')]('}');if(_0x2c1387[_0xd5d9('0x9d')]>0x1){_0x19b8d1=_0x19b8d1[_0xd5d9('0xa2')]('{'+_0x2c1387[0x0]+'}',this[_0xd5d9('0x34')][_0xd5d9('0xa3')](_0x2c1387[0x0])[_0xd5d9('0xa4')]||_0x2c1387[0x0]);}}if(_0x3dc196[_0xd5d9('0x9d')]===0x1){return _0x19b8d1[_0xd5d9('0x49')]();}return this[_0xd5d9('0x98')](_0x19b8d1);};AGIVertices[_0xd5d9('0xf')]['getAndSetVariable']=function(_0x4d71fd,_0x56d7a4){var _0x39e386=this[_0xd5d9('0x34')]['getVariable'](_0x4d71fd);if(_0x39e386[_0xd5d9('0xa5')]===-0x1){return _0x39e386;}logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0xa6'),_0x56d7a4,_0x39e386[_0xd5d9('0xa4')]));return this[_0xd5d9('0x34')]['setVariable'](_0x56d7a4,_0x39e386[_0xd5d9('0xa4')]);};AGIVertices[_0xd5d9('0xf')]['isConfigured']=function(_0x42f244){return _0x42f244&&_0x42f244!=='0'&&_0x42f244!=='-1'&&_0x42f244!=='';};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xa7')]=function(_0x14076c){this['createSquareDetailsReport'][_0xd5d9('0xa8')](this,_0x14076c,'-');_0x14076c[_0xd5d9('0xa9')]=_0x14076c['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xaa')]=function(_0x4d00df){logger['info'](util[_0xd5d9('0x52')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4d00df['label']));if(!this[_0xd5d9('0xab')](_0x4d00df[_0xd5d9('0x5a')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0xad'));}var _0x396a3a='\x22'+_0x4d00df['text']+'\x22';if(this[_0xd5d9('0xab')](_0x4d00df[_0xd5d9('0x77')])){_0x396a3a+=','+_0x4d00df[_0xd5d9('0x77')];}var _0x179961=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xae'),_0x396a3a);if(_0x179961[_0xd5d9('0xa5')]===-0x1){return _0x179961;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xaf'),_0x396a3a));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xb0')]=function(_0x1913a0){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xb1'),_0x1913a0[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x1913a0[_0xd5d9('0xb2')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xb3'));}var _0x3c1077=_0x1913a0[_0xd5d9('0xb2')];if(this[_0xd5d9('0xab')](_0x1913a0[_0xd5d9('0x77')])){_0x3c1077+=','+_0x1913a0['options'];}var _0x394e93=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xb4'),_0x3c1077);if(_0x394e93[_0xd5d9('0xa5')]===-0x1){return _0x394e93;}var _0x64dae=this['getAndSetVariable'](_0xd5d9('0xb5'),_0xd5d9('0xb6'));if(_0x64dae[_0xd5d9('0xa5')]===-0x1){return _0x64dae;}var _0x334735=this['getAndSetVariable'](_0xd5d9('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x334735[_0xd5d9('0xa5')]===-0x1){return _0x334735;}var _0x210e74=this[_0xd5d9('0xb8')]('RECOG_INSTANCE()',_0xd5d9('0xb9'));if(_0x210e74[_0xd5d9('0xa5')]===-0x1){return _0x210e74;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xba'),_0x3c1077));};AGIVertices[_0xd5d9('0xf')]['agi']=function(_0xa8c2bb){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0xbb'),_0xa8c2bb[_0xd5d9('0x36')]));return this['channel'][_0xd5d9('0x7')]([_0xa8c2bb[_0xd5d9('0xbc')],_0xa8c2bb[_0xd5d9('0xbd')]]);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xbe')]=function(_0x5cdea1){logger['info'](util[_0xd5d9('0x52')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5cdea1[_0xd5d9('0x36')]));if(this[_0xd5d9('0xab')](_0x5cdea1[_0xd5d9('0x65')])){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xbf'),_0x5cdea1['timeout']));var _0x3cbdf0=this['channel'][_0xd5d9('0xc0')](_0x5cdea1[_0xd5d9('0x65')]);if(_0x3cbdf0[_0xd5d9('0xa5')]===-0x1){return _0x3cbdf0;}}return this[_0xd5d9('0x34')][_0xd5d9('0xbe')]();};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x46')]=function(_0x49dfb6){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0xc1'),_0x49dfb6[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x49dfb6[_0xd5d9('0x45')])){return this['channel'][_0xd5d9('0x2f')](_0x49dfb6,_0xd5d9('0xc2'));}_0x49dfb6['scheduledAt']=moment();if(this[_0xd5d9('0xab')](_0x49dfb6['delay'])){_0x49dfb6[_0xd5d9('0x48')]=moment()[_0xd5d9('0xc3')](_0x49dfb6[_0xd5d9('0xc4')],'minutes');}if(!this[_0xd5d9('0xab')](_0x49dfb6[_0xd5d9('0x4a')])){_0x49dfb6[_0xd5d9('0x4a')]=0x2;}this[_0xd5d9('0x41')][_0xd5d9('0xa8')](this,_0x49dfb6);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x49dfb6['phone'],_0x49dfb6[_0xd5d9('0x45')],_0x49dfb6[_0xd5d9('0x48')]));};AGIVertices['prototype'][_0xd5d9('0xc5')]=function(_0x51f47f){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xc6'),_0x51f47f[_0xd5d9('0x36')]));var _0x3dc303=this['channel'][_0xd5d9('0x56')](_0x51f47f['application'],_0x51f47f['options']);if(_0x3dc303[_0xd5d9('0xa5')]===-0x1){return _0x3dc303;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xc7'),_0x51f47f['application'],_0x51f47f['options']));};AGIVertices[_0xd5d9('0xf')]['lumenvoxtts']=function(_0x394dc8){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xc8'),_0x394dc8[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x394dc8[_0xd5d9('0x5a')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xad'));}var _0x45b8c8='\x22'+_0x394dc8[_0xd5d9('0x5a')]+'\x22';if(this[_0xd5d9('0xab')](_0x394dc8[_0xd5d9('0x77')])){_0x45b8c8+=','+_0x394dc8['options'];}var _0x57d25a=this[_0xd5d9('0x34')][_0xd5d9('0x56')]('MRCPSynth',_0x45b8c8);if(_0x57d25a[_0xd5d9('0xa5')]===-0x1){return _0x57d25a;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xaf'),_0x45b8c8));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xc9')]=function(_0x397acd){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x397acd['label']));if(!this['isConfigured'](_0x397acd[_0xd5d9('0x5a')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xad'));}var _0x170a6f='\x22'+_0x397acd[_0xd5d9('0x5a')]+'\x22';if(this[_0xd5d9('0xab')](_0x397acd[_0xd5d9('0x77')])){_0x170a6f+=','+_0x397acd[_0xd5d9('0x77')];}var _0x347757=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xae'),_0x170a6f);if(_0x347757[_0xd5d9('0xa5')]===-0x1){return _0x347757;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xaf'),_0x170a6f));};AGIVertices['prototype'][_0xd5d9('0xca')]=function(_0x30a01f){logger['info'](util['format'](_0xd5d9('0xcb'),_0x30a01f[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x30a01f[_0xd5d9('0xb2')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')]('no\x20grammar\x20configured');}var _0x4a6bcd=_0x30a01f['grammar'];if(this[_0xd5d9('0xab')](_0x30a01f[_0xd5d9('0x77')])){_0x4a6bcd+=','+_0x30a01f[_0xd5d9('0x77')];}var _0x294b0f=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xb4'),_0x4a6bcd);if(_0x294b0f[_0xd5d9('0xa5')]===-0x1){return _0x294b0f;}var _0x5c556f=this[_0xd5d9('0xb8')](_0xd5d9('0xb5'),_0xd5d9('0xcc'));if(_0x5c556f[_0xd5d9('0xa5')]===-0x1){return _0x5c556f;}var _0x1b0a7e=this[_0xd5d9('0xb8')](_0xd5d9('0xb7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1b0a7e[_0xd5d9('0xa5')]===-0x1){return _0x1b0a7e;}var _0x194f1c=this[_0xd5d9('0xb8')]('RECOG_INSTANCE()',_0xd5d9('0xcd'));if(_0x194f1c[_0xd5d9('0xa5')]===-0x1){return _0x194f1c;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xba'),_0x4a6bcd));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xce')]=function(_0xdd62e2){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xcf'),_0xdd62e2[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0xdd62e2[_0xd5d9('0xb2')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xb3'));}var _0x59ea98=_0xdd62e2[_0xd5d9('0xb2')];if(this[_0xd5d9('0xab')](_0xdd62e2['options'])){_0x59ea98+=','+_0xdd62e2[_0xd5d9('0x77')];}var _0x31ec4e=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xb4'),_0x59ea98);if(_0x31ec4e['result']===-0x1){return _0x31ec4e;}var _0x1722ee=this[_0xd5d9('0xb8')](_0xd5d9('0xb5'),_0xd5d9('0xd0'));if(_0x1722ee[_0xd5d9('0xa5')]===-0x1){return _0x1722ee;}var _0x48a9a8=this[_0xd5d9('0xb8')](_0xd5d9('0xb7'),_0xd5d9('0xd1'));if(_0x48a9a8[_0xd5d9('0xa5')]===-0x1){return _0x48a9a8;}var _0x10f729=this['getAndSetVariable'](_0xd5d9('0xd2'),'SESTEK_ASR_INSTANCE');if(_0x10f729['result']===-0x1){return _0x10f729;}return this['channel']['noop'](util[_0xd5d9('0x52')](_0xd5d9('0xba'),_0x59ea98));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xd3')]=function(_0x5b04c8){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5b04c8['label']));if(!this['isConfigured'](_0x5b04c8[_0xd5d9('0xd4')])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x5b04c8,_0xd5d9('0xd5'));}var _0x59b128=this[_0xd5d9('0xd6')]['sync'](this,_0x5b04c8[_0xd5d9('0xd4')]);if(!_0x59b128){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x5b04c8,_0xd5d9('0xd7'));}if(!this[_0xd5d9('0xab')](_0x5b04c8[_0xd5d9('0x2b')])){return this[_0xd5d9('0x34')]['error'](_0x5b04c8,_0xd5d9('0xd8'));}var _0x3afbcf=_0x5b04c8[_0xd5d9('0x2b')][_0xd5d9('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd5d9('0x34')]['noop'](util['format']('query:\x20%s',_0x3afbcf));var _0x42ff39=this[_0xd5d9('0x28')][_0xd5d9('0xa8')](this,_0x59b128,_0x3afbcf);this['createSquareDetailsReport'][_0xd5d9('0xa8')](this,_0x5b04c8,_0x3afbcf);if(!this['isConfigured'](_0x5b04c8[_0xd5d9('0xd9')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x222e76=this[_0xd5d9('0xa3')][_0xd5d9('0xa8')](this,_0x5b04c8[_0xd5d9('0xd9')]);if(!_0x222e76){return this[_0xd5d9('0x34')]['error'](_0x5b04c8,_0xd5d9('0xda'));}var _0x55d982=this;_0x42ff39[_0xd5d9('0xdb')](function(_0x4bdb13,_0x593931){Object[_0xd5d9('0xdc')](_0x4bdb13)[_0xd5d9('0xdb')](function(_0xc76f5d){_0x55d982[_0xd5d9('0x34')][_0xd5d9('0xa0')](util['format'](_0xd5d9('0xdd'),_0x222e76,_0x593931,_0xc76f5d),_0x4bdb13[_0xc76f5d]);});});this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util['format'](_0xd5d9('0xde'),_0x222e76),_0x42ff39['length']);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xdf'),_0x222e76));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xe0')]=function(_0x275754){logger['debug'](util[_0xd5d9('0x52')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x275754[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x275754[_0xd5d9('0xe1')])){return this['channel'][_0xd5d9('0x2f')](_0x275754,_0xd5d9('0xe2'));}var _0x237446=this[_0xd5d9('0x19')][_0xd5d9('0xa8')](this,_0x275754[_0xd5d9('0xe1')]);if(!_0x237446){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x275754,_0xd5d9('0xe3'));}var _0x437577=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xe4'),[util[_0xd5d9('0x52')](_0xd5d9('0xe5'),_0x237446),_0x275754[_0xd5d9('0x65')],_0x275754[_0xd5d9('0xe6')],_0x275754[_0xd5d9('0x63')]]);if(_0x437577[_0xd5d9('0xa5')]===-0x1){return _0x437577;}return this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('Executed\x20command\x20%s',_0xd5d9('0xe4')));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xe7')]=function(_0x5ed828){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0xe8'),_0x5ed828[_0xd5d9('0x36')]));if(!this['isConfigured'](_0x5ed828[_0xd5d9('0x81')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xe9'));}if(!this[_0xd5d9('0xab')](_0x5ed828[_0xd5d9('0x5a')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xea')]=!![];this['createSquareDetailsReport'](_0x5ed828);this[_0xd5d9('0x40')](_0x5ed828['text'],'in','','');this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xeb'),_0x5ed828[_0xd5d9('0x5a')]));var _0x3a5d75=this['googleDialogflow'][_0xd5d9('0xa8')](this,_0x5ed828);if(_0x3a5d75){for(var _0x19188d in _0x3a5d75){if(_0x3a5d75[_0xd5d9('0x9a')](_0x19188d)){this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util[_0xd5d9('0x52')]('DIALOGFLOW_%s',_0x19188d['toUpperCase']()),_0x3a5d75[_0x19188d]);}}this[_0xd5d9('0x40')](_0x3a5d75[_0xd5d9('0xec')],_0xd5d9('0xed'),'dialogflow','');return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xee'),_0x3a5d75[_0xd5d9('0xec')]));}return this[_0xd5d9('0x34')]['error'](_0x5ed828,_0xd5d9('0xef'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xf0')]=function(_0x204171){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0xf1'),_0x204171[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x204171[_0xd5d9('0x7b')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0xf2'));}if(!this[_0xd5d9('0xab')](_0x204171[_0xd5d9('0x7c')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xf3'));}if(!this[_0xd5d9('0xab')](_0x204171[_0xd5d9('0x7d')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0xf4'));}if(!this[_0xd5d9('0xab')](_0x204171['dialogflowV2_language'])){return this[_0xd5d9('0x34')]['noop']('no\x20anguage\x20configured');}if(!this[_0xd5d9('0xab')](_0x204171[_0xd5d9('0x5a')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xea')]=!![];this[_0xd5d9('0x33')](_0x204171);this[_0xd5d9('0x40')](_0x204171[_0xd5d9('0x5a')],'in','','');this['channel']['noop'](util['format'](_0xd5d9('0xf5'),_0x204171[_0xd5d9('0x5a')]));var _0x358010=this[_0xd5d9('0x7a')][_0xd5d9('0xa8')](this,_0x204171);if(_0x358010){for(var _0x540588 in _0x358010){if(_0x358010[_0xd5d9('0x9a')](_0x540588)){if(_0x540588!==_0xd5d9('0xf6')){this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util['format'](_0xd5d9('0xf7'),_0x540588[_0xd5d9('0x69')]()),_0x358010[_0x540588]);}}}this['createSquareMessage'](_0x358010[_0xd5d9('0xec')],_0xd5d9('0xed'),_0xd5d9('0xf0'),_0x358010[_0xd5d9('0xf6')]);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xf8'),_0x358010[_0xd5d9('0xec')]));}return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x204171,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xd5d9('0xf9')]=function(_0x4597e8){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4597e8[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x4597e8[_0xd5d9('0xfa')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xfb'));}if(!this['isConfigured'](_0x4597e8[_0xd5d9('0xfc')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xfd'));}if(!this[_0xd5d9('0xab')](_0x4597e8[_0xd5d9('0xfe')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xff'));}if(!this[_0xd5d9('0xab')](_0x4597e8[_0xd5d9('0x100')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xea')]=!![];this[_0xd5d9('0x33')](_0x4597e8);this[_0xd5d9('0x40')](_0x4597e8[_0xd5d9('0x5a')],'in','','');this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x101'),_0x4597e8[_0xd5d9('0x5a')]));var _0x5a7878=this[_0xd5d9('0x7f')]['sync'](this,_0x4597e8);if(_0x5a7878){for(var _0x318345 in _0x5a7878){if(_0x5a7878[_0xd5d9('0x9a')](_0x318345)){this[_0xd5d9('0x34')]['setVariable'](util[_0xd5d9('0x52')](_0xd5d9('0x102'),_0x318345[_0xd5d9('0x69')]()),_0x5a7878[_0x318345]);}}this[_0xd5d9('0x40')](_0x5a7878['speech'],_0xd5d9('0xed'),_0xd5d9('0xf9'),'');if(_0x5a7878['audiofile']){this[_0xd5d9('0x34')]['noop'](util['format'](_0xd5d9('0x103'),_0x5a7878[_0xd5d9('0x104')]));var _0x18ba30=this[_0xd5d9('0x34')][_0xd5d9('0x105')](_0x5a7878[_0xd5d9('0x104')]);try{fs[_0xd5d9('0x106')](_0x5a7878['audiofile']+_0xd5d9('0x107'));}catch(_0x55720f){logger[_0xd5d9('0x2f')](_0x55720f);}return _0x18ba30;}else{return this[_0xd5d9('0x34')]['noop'](util[_0xd5d9('0x52')]('SestekNDA\x20Result\x20%s',_0x5a7878['speech']));}}return this['channel'][_0xd5d9('0x2f')](_0x4597e8,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x108')]=function(_0x12f3b6){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x109'),_0x12f3b6['label']));return this['channel'][_0xd5d9('0xac')](_0xd5d9('0x108'));};AGIVertices[_0xd5d9('0xf')]['ext_dial']=function(_0x5e13ec){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5e13ec[_0xd5d9('0x36')]));var _0x22ffd1='';if(_0x5e13ec[_0xd5d9('0x10a')]){if(!this['isConfigured'](_0x5e13ec[_0xd5d9('0x10a')])){return this[_0xd5d9('0x34')]['error'](_0x5e13ec,_0xd5d9('0x10b'));}else{var _0x27a19f=parseInt(_0x5e13ec['trunk_id'],0xa);if(isNaN(_0x27a19f)){_0x22ffd1=_0x5e13ec[_0xd5d9('0x10a')];}else{_0x22ffd1=this[_0xd5d9('0x1a')][_0xd5d9('0xa8')](this,_0x5e13ec['trunk_id']);if(!_0x22ffd1){return this[_0xd5d9('0x34')]['error'](_0x5e13ec,_0xd5d9('0x10c'));}}}}else if(_0x5e13ec[_0xd5d9('0x10d')]){_0x22ffd1=_0x5e13ec[_0xd5d9('0x10d')];}else{return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x5e13ec,_0xd5d9('0x10b'));}var _0x262e01=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0xe4'),[util[_0xd5d9('0x52')](_0xd5d9('0x10e'),_0x22ffd1,_0x5e13ec['phone']),_0x5e13ec[_0xd5d9('0x65')],_0x5e13ec[_0xd5d9('0xe6')],_0x5e13ec[_0xd5d9('0x63')]]);if(_0x262e01[_0xd5d9('0xa5')]===-0x1){return _0x262e01;}return this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x10f'),_0xd5d9('0xe4')));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x110')]=function(_0x260099){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x111'),_0x260099['label']));return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0x110'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xd')]=function(_0x310a34){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x112'),_0x310a34['label']));if(_0x310a34[_0xd5d9('0xa9')]===0x0){return this[_0xd5d9('0xa7')](_0x310a34);}_0x310a34['retry']-=0x1;if(!this['isConfigured'](_0x310a34[_0xd5d9('0x113')])){return this[_0xd5d9('0x34')]['error'](_0x310a34,_0xd5d9('0x114'));}var _0x22c3f2=this[_0xd5d9('0x115')][_0xd5d9('0xa8')](this,_0x310a34[_0xd5d9('0x113')]);if(!_0x22c3f2){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x310a34,'no\x20file\x20audio\x20found');}if(!this[_0xd5d9('0xab')](_0x310a34[_0xd5d9('0xd9')])){return this[_0xd5d9('0x34')]['error'](_0xd5d9('0x116'));}var _0x5cda0f=this[_0xd5d9('0x34')][_0xd5d9('0x117')](_0x22c3f2,_0x310a34[_0xd5d9('0x118')],_0x310a34[_0xd5d9('0x119')]);var _0x55bfd2=_0x5cda0f[_0xd5d9('0xa5')]?_0x5cda0f[_0xd5d9('0xa5')][_0xd5d9('0x49')]():'';logger[_0xd5d9('0x2c')](_0xd5d9('0x11a'),JSON[_0xd5d9('0x72')](_0x5cda0f));if(_0x5cda0f['result']===-0x1){this[_0xd5d9('0x33')]['sync'](this,_0x310a34,_0x55bfd2);return _0x5cda0f;}else if(_0x5cda0f['extra']==='timeout'){_0x5cda0f[_0xd5d9('0xa5')]=_0x55bfd2[_0xd5d9('0x9d')]>=parseInt(_0x310a34['mindigit'])?'x':'i';}else{_0x5cda0f[_0xd5d9('0xa5')]=_0x55bfd2[_0xd5d9('0x9d')]>=parseInt(_0x310a34['mindigit'])&&_0x55bfd2['length']<=parseInt(_0x310a34[_0xd5d9('0x119')])?'x':'i';}var _0x1db5ea=this[_0xd5d9('0xa3')][_0xd5d9('0xa8')](this,_0x310a34[_0xd5d9('0xd9')]);if(!_0x1db5ea){return this['channel']['error'](_0x310a34,_0xd5d9('0xda'));}this[_0xd5d9('0x34')]['setVariable'](_0x1db5ea,_0x55bfd2);if(this['isConfigured'](_0x310a34[_0xd5d9('0x11b')])){var _0x3b0224=parseInt(_0x310a34[_0xd5d9('0x11b')],0xa);var _0x2a6765=rs[_0xd5d9('0x11c')]({'charset':'*','length':_0x3b0224});var _0x53801d=_0x55bfd2['length'];if(_0x53801d>0x0){if(_0x53801d>_0x3b0224){this[_0xd5d9('0x33')]['sync'](this,_0x310a34,_0x310a34[_0xd5d9('0x11d')]===_0xd5d9('0x11e')?_0x2a6765+_0x55bfd2[_0xd5d9('0x11f')](_0x3b0224):_0x55bfd2[_0xd5d9('0x11f')](0x0,_0x53801d-_0x3b0224)+_0x2a6765);}else{this[_0xd5d9('0x33')]['sync'](this,_0x310a34,rs[_0xd5d9('0x11c')]({'charset':'*','length':_0x53801d}));}}else{this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x310a34,'');}}else{this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x310a34,_0x55bfd2);}return _0x5cda0f;};AGIVertices[_0xd5d9('0xf')]['getsecretdigits']=function(_0x2dad5f){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x120'),_0x2dad5f[_0xd5d9('0x36')]));return this[_0xd5d9('0xd')](_0x2dad5f);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x121')]=function(_0x470fec){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x122'),_0x470fec[_0xd5d9('0x36')]));this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x470fec,_0x470fec[_0xd5d9('0x123')]);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format']('GOAL\x20%s',_0x470fec['goalname']));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x124')]=function(_0xdca3ea){logger['info'](util[_0xd5d9('0x52')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0xdca3ea['label']));if(!this[_0xd5d9('0xab')](_0xdca3ea['aws_access_key_id'])||!this[_0xd5d9('0xab')](_0xdca3ea['aws_secret_access_key'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x125'));}if(!this['isConfigured'](_0xdca3ea['text'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x126'),_0xdca3ea['text']));var _0x4f9a89=this[_0xd5d9('0x86')][_0xd5d9('0xa8')](this,_0xdca3ea);if(_0x4f9a89){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0x127'),_0x4f9a89));var _0x586fb3=this[_0xd5d9('0x34')][_0xd5d9('0x105')](_0x4f9a89);try{fs[_0xd5d9('0x106')](_0x4f9a89+_0xd5d9('0x107'));}catch(_0x6a6693){logger[_0xd5d9('0x2f')](_0x6a6693);}return _0x586fb3;}return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0xdca3ea,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xd5d9('0x128')]=function(_0x19fb42){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x129'),_0x19fb42[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x19fb42[_0xd5d9('0x87')])||!this[_0xd5d9('0xab')](_0x19fb42[_0xd5d9('0x88')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x19fb42[_0xd5d9('0x12a')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x12b'));}if(!this[_0xd5d9('0xab')](_0x19fb42['text'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xea')]=!![];this['createSquareDetailsReport'](_0x19fb42);this[_0xd5d9('0x40')](_0x19fb42['text'],'in','','');this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x12c'),_0x19fb42[_0xd5d9('0x5a')]));var _0x47a6c9=this[_0xd5d9('0x8d')]['sync'](this,_0x19fb42);if(_0x47a6c9){for(var _0x392bd0 in _0x47a6c9){if(_0x47a6c9[_0xd5d9('0x9a')](_0x392bd0)&&_[_0xd5d9('0x96')](_0x47a6c9[_0x392bd0])){this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util['format']('AWS_LEX_%s',_0x392bd0['toUpperCase']()),_0x47a6c9[_0x392bd0]);}}if(_[_0xd5d9('0x43')](_0x47a6c9['message'])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0x12d'));}else{this[_0xd5d9('0x40')](_0x47a6c9[_0xd5d9('0x75')],_0xd5d9('0xed'),'amazonlex','');return this[_0xd5d9('0x34')]['noop'](util['format'](_0xd5d9('0x12e'),_0x47a6c9[_0xd5d9('0x75')]));}}return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x19fb42,_0xd5d9('0x12f'));};AGIVertices['prototype'][_0xd5d9('0x130')]=function(_0x3f52d1){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x131'),_0x3f52d1[_0xd5d9('0x36')],_0x3f52d1[_0xd5d9('0x65')]));if(!this[_0xd5d9('0xab')](_0x3f52d1[_0xd5d9('0x81')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0xe9'));}var _0x58e0f4=_0xd5d9('0x132');var _0x2ede4d=util[_0xd5d9('0x52')](_0xd5d9('0x133'),FILES_PATH,rs[_0xd5d9('0x11c')](0x4));var _0x5b4024=util[_0xd5d9('0x52')]('%s.%s',_0x2ede4d,_0x58e0f4);var _0x18d745=!![];if(_0x3f52d1[_0xd5d9('0x134')]===_0xd5d9('0x135')){_0x18d745=![];}var _0x25b5ef=this[_0xd5d9('0x34')]['recordFile'](_0x2ede4d,_0x58e0f4,_0x3f52d1[_0xd5d9('0x136')],_0x3f52d1[_0xd5d9('0x65')],undefined,_0x18d745);if(_0x25b5ef[_0xd5d9('0xa5')]!==-0x1){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x137'),_0x5b4024));var _0x377f6d=this[_0xd5d9('0x8f')][_0xd5d9('0xa8')](this,_0x3f52d1,_0x5b4024);if(_0x377f6d){for(var _0x5a5174 in _0x377f6d){if(_0x377f6d['hasOwnProperty'](_0x5a5174)){this['channel'][_0xd5d9('0xa0')](util[_0xd5d9('0x52')](_0xd5d9('0x138'),_0x5a5174[_0xd5d9('0x69')]()),_0x377f6d[_0x5a5174]);}}return this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x377f6d)));}}return _0x25b5ef;};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x139')]=function(_0xd83349){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x13a'),_0xd83349[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0xd83349[_0xd5d9('0x92')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0x13b'));}if(!this[_0xd5d9('0xab')](_0xd83349[_0xd5d9('0x93')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x13c'));}var _0xe56021='wav';var _0x145386=util[_0xd5d9('0x52')]('%s/recordings/%s',FILES_PATH,rs[_0xd5d9('0x11c')](0x4));var _0x1a1e47=util['format'](_0xd5d9('0x9f'),_0x145386,_0xe56021);var _0x88125b=!![];if(_0xd83349[_0xd5d9('0x134')]===_0xd5d9('0x135')){_0x88125b=![];}var _0x100a7f=this[_0xd5d9('0x34')][_0xd5d9('0x13d')](_0x145386,_0xe56021,_0xd83349[_0xd5d9('0x136')],_0xd83349[_0xd5d9('0x65')],undefined,_0x88125b);if(_0x100a7f['result']!==-0x1){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x13e'),_0x1a1e47));var _0x2d6615=this[_0xd5d9('0x91')][_0xd5d9('0xa8')](this,_0xd83349,_0x1a1e47);if(_0x2d6615){for(var _0x4c2274 in _0x2d6615){if(_0x2d6615[_0xd5d9('0x9a')](_0x4c2274)){this[_0xd5d9('0x34')]['setVariable'](util['format']('TILDE_ASR_%s',_0x4c2274[_0xd5d9('0x69')]()),_0x2d6615[_0x4c2274]);}}return this[_0xd5d9('0x34')]['noop'](util['format'](_0xd5d9('0x13f'),JSON[_0xd5d9('0x72')](_0x2d6615)));}}return _0x100a7f;};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x140')]=function(_0x39a5cb){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x141'),_0x39a5cb[_0xd5d9('0x36')]));return this[_0xd5d9('0x34')][_0xd5d9('0x142')](_0x39a5cb[_0xd5d9('0x3c')],_0x39a5cb['extension'],_0x39a5cb[_0xd5d9('0x3e')]);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x143')]=function(_0x2338a5){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x144'),_0x2338a5[_0xd5d9('0x36')]));if(!this['isConfigured'](_0x2338a5['condition'])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x2338a5,'no\x20condition\x20configured');}try{var _0x45acce=eval(_0x2338a5[_0xd5d9('0x145')])?_0xd5d9('0x146'):_0xd5d9('0x147');this['channel'][_0xd5d9('0xac')](util['format'](_0xd5d9('0x148'),_0x2338a5[_0xd5d9('0x145')],_0x45acce));return{'code':0xc8,'result':_0x45acce};}catch(_0x2c2df0){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x149')]=function(_0x446569){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x14a'),_0x446569[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x446569[_0xd5d9('0x14b')])){return this[_0xd5d9('0x34')]['error'](_0x446569,_0xd5d9('0x14c'));}var _0x12ee0c=this[_0xd5d9('0x22')][_0xd5d9('0xa8')](this,_0x446569['interval_id']);if(!_0x12ee0c){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x446569,_0xd5d9('0x14d'));}for(var _0x283d2b=0x0;_0x283d2b<_0x12ee0c[_0xd5d9('0x9d')];_0x283d2b+=0x1){var _0x273c02=this[_0xd5d9('0x34')]['getVariable'](util['format'](_0xd5d9('0x14e'),_0x12ee0c[_0x283d2b]));if(_0x273c02[_0xd5d9('0xa5')]===-0x1){return _0x273c02;}logger[_0xd5d9('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x12ee0c[_0x283d2b],_0x273c02['extra']));if(_0x273c02[_0xd5d9('0xa4')]===_0xd5d9('0x146')){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x14f'),_0x12ee0c[_0x283d2b],_0xd5d9('0x146')));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x14f'),_0x12ee0c[_0x283d2b],_0xd5d9('0x146')));return{'code':0xc8,'result':_0xd5d9('0x146')};}else{logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('IFTIME\x20%s\x20%s',_0x12ee0c[_0x283d2b],_0xd5d9('0x147')));this['channel']['noop'](util[_0xd5d9('0x52')](_0xd5d9('0x14f'),_0x12ee0c[_0x283d2b],'false'));}}return{'code':0xc8,'result':_0xd5d9('0x147')};};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x150')]=function(_0x5ba749){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x151'),_0x5ba749[_0xd5d9('0x36')]));return this['channel'][_0xd5d9('0x150')]();};AGIVertices['prototype'][_0xd5d9('0x152')]=function(_0x1121df){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1121df[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x1121df[_0xd5d9('0x81')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0xe9'));}var _0x412ace='wav';var _0x3021f3=util[_0xd5d9('0x52')](_0xd5d9('0x133'),FILES_PATH,rs[_0xd5d9('0x11c')](0x4));var _0x4060a7=util['format'](_0xd5d9('0x9f'),_0x3021f3,_0x412ace);var _0x276e99=!![];if(_0x1121df[_0xd5d9('0x134')]===_0xd5d9('0x135')){_0x276e99=![];}var _0xdb0e4b=this[_0xd5d9('0x34')]['recordFile'](_0x3021f3,_0x412ace,_0x1121df['intKey'],_0x1121df[_0xd5d9('0x65')],undefined,_0x276e99);if(_0xdb0e4b[_0xd5d9('0xa5')]!==-0x1){this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x153'),_0x4060a7));var _0x293723=this['ispeechASR'][_0xd5d9('0xa8')](this,_0x1121df,_0x4060a7);if(_0x293723){for(var _0x6ae451 in _0x293723){if(_0x293723[_0xd5d9('0x9a')](_0x6ae451)){this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util[_0xd5d9('0x52')](_0xd5d9('0x154'),_0x6ae451[_0xd5d9('0x69')]()),_0x293723[_0x6ae451]);}}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0x155'),JSON[_0xd5d9('0x72')](_0x293723)));}}return _0xdb0e4b;};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x156')]=function(_0x3f3b13){logger['info'](util[_0xd5d9('0x52')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3f3b13[_0xd5d9('0x36')]));if(!this['isConfigured'](_0x3f3b13[_0xd5d9('0x81')])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x3f3b13['text'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')]('no\x20text\x20configured');}this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x157'),_0x3f3b13[_0xd5d9('0x5a')]));var _0x3e1c0c=this[_0xd5d9('0x80')]['sync'](this,_0x3f3b13);if(_0x3e1c0c){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format']('ispeech\x20%s\x20file\x20created',_0x3e1c0c));var _0x32c2f4=this['channel'][_0xd5d9('0x105')](_0x3e1c0c,_0x3f3b13[_0xd5d9('0x136')]);try{fs[_0xd5d9('0x106')](_0x3e1c0c+_0xd5d9('0x107'));}catch(_0x291e14){logger[_0xd5d9('0x2f')](_0x291e14);}return _0x32c2f4;}return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x3f3b13,_0xd5d9('0x158'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x159')]=function(_0x17fd03){logger['info'](util[_0xd5d9('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x17fd03[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x17fd03['findBy'])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x17fd03,'no\x20find\x20by\x20configured');}logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15a'),this[_0xd5d9('0x34')]['callerid'],_0x17fd03[_0xd5d9('0x15b')]));var _0x3d72ef=this[_0xd5d9('0x54')]['sync'](this,_0x17fd03['findBy']);if(_0x3d72ef){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this['channel'][_0xd5d9('0x39')],_0x17fd03[_0xd5d9('0x15b')]));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x17fd03['findBy']));return{'code':0xc8,'result':_0xd5d9('0x15d')};}else{logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x15e'),this[_0xd5d9('0x34')]['callerid'],_0x17fd03[_0xd5d9('0x15b')]));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0x15e'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x17fd03[_0xd5d9('0x15b')]));return{'code':0xc8,'result':_0xd5d9('0x15f')};}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x160')]=function(_0x4f48d8){logger[_0xd5d9('0x2c')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4f48d8[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x4f48d8[_0xd5d9('0x15b')])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x4f48d8,_0xd5d9('0x161'));}logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15a'),this['channel'][_0xd5d9('0x39')],_0x4f48d8[_0xd5d9('0x15b')]));var _0x79c950=this['agentLogout'][_0xd5d9('0xa8')](this,_0x4f48d8[_0xd5d9('0x15b')]);if(_0x79c950){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f48d8[_0xd5d9('0x15b')]));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f48d8['findBy']));return{'code':0xc8,'result':_0xd5d9('0x15d')};}else{logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f48d8[_0xd5d9('0x15b')]));this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd5d9('0x39')],_0x4f48d8[_0xd5d9('0x15b')]));return{'code':0xc8,'result':_0xd5d9('0x15f')};}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x162')]=function(_0x4b6403){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x163'),_0x4b6403[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x4b6403[_0xd5d9('0x164')])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x4b6403,'no\x20operation\x20configured');}this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x165'),_0x4b6403[_0xd5d9('0x164')]));var _0x59b096=eval(_0x4b6403['operation']);if(!this[_0xd5d9('0xab')](_0x4b6403[_0xd5d9('0xd9')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0x116'));}var _0x1b44ae=this[_0xd5d9('0xa3')][_0xd5d9('0xa8')](this,_0x4b6403[_0xd5d9('0xd9')]);if(!_0x1b44ae){return this[_0xd5d9('0x34')]['error'](_0x4b6403,_0xd5d9('0xda'));}if(_['isArray'](_0x59b096)){var _0x454d44=this;_0x59b096[_0xd5d9('0xdb')](function(_0xddee7f,_0x1e8172){_0x454d44[_0xd5d9('0x34')][_0xd5d9('0xa0')](util[_0xd5d9('0x52')](_0xd5d9('0x166'),_0x1b44ae,_0x1e8172),_0xddee7f);});return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('variable\x20%s[key]\x20set',_0x1b44ae));}else{return this['channel'][_0xd5d9('0xa0')](_0x1b44ae,_0x59b096);}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xc')]=function(_0x37ee17){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x167'),_0x37ee17['label']));if(_0x37ee17[_0xd5d9('0xa9')]===0x0){return this['maxRetry'](_0x37ee17);}_0x37ee17[_0xd5d9('0xa9')]-=0x1;if(!this[_0xd5d9('0xab')](_0x37ee17['file_id'])){return this['channel']['error'](_0x37ee17,_0xd5d9('0x114'));}var _0x50034e=this[_0xd5d9('0x115')][_0xd5d9('0xa8')](this,_0x37ee17[_0xd5d9('0x113')]);if(!_0x50034e){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x37ee17,_0xd5d9('0x168'));}var _0x3b0214=this['channel'][_0xd5d9('0x117')](_0x50034e,_0x37ee17[_0xd5d9('0x118')],_0x37ee17[_0xd5d9('0x169')]);var _0x4c71e1=_0x3b0214['result'];if(_0x3b0214[_0xd5d9('0xa5')]===-0x1){this[_0xd5d9('0x33')]['sync'](this,_0x37ee17,'-1');return _0x3b0214;}else if(_0x3b0214[_0xd5d9('0xa4')]===_0xd5d9('0x65')){_0x3b0214[_0xd5d9('0xa5')]=_0x3b0214[_0xd5d9('0xa5')][_0xd5d9('0x9d')]>0x0?_0x3b0214[_0xd5d9('0xa5')]:'t';}else if(_[_0xd5d9('0x42')](_0x3b0214['result'])){_0x3b0214[_0xd5d9('0xa5')]='#';_0x4c71e1='#';}if(!this[_0xd5d9('0xab')](_0x37ee17[_0xd5d9('0xd9')])){this[_0xd5d9('0x34')]['noop'](_0xd5d9('0x116'));}else{var _0x351ffe=this[_0xd5d9('0xa3')][_0xd5d9('0xa8')](this,_0x37ee17[_0xd5d9('0xd9')]);if(!_0x351ffe){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x37ee17,'no\x20variable\x20found');}this[_0xd5d9('0x34')][_0xd5d9('0xa0')](_0x351ffe,_0x4c71e1);}this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x37ee17,_0x4c71e1);return _0x3b0214;};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0xac')]=function(_0x268075){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x16a'),_0x268075[_0xd5d9('0x36')]));return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0x268075['output']||_0x268075[_0xd5d9('0x36')]);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x16b')]=function(_0x4f479f){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x16c'),_0x4f479f[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x4f479f[_0xd5d9('0x15b')])){return this['channel'][_0xd5d9('0x2f')](_0x4f479f,_0xd5d9('0x161'));}logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x15a'),this['channel'][_0xd5d9('0x39')],_0x4f479f['findBy']));var _0x19008b=this[_0xd5d9('0x4b')]['sync'](this,_0x4f479f[_0xd5d9('0x16d')]);var _0x25726e=this[_0xd5d9('0x4e')][_0xd5d9('0xa8')](this,_0x4f479f[_0xd5d9('0x15b')],_0x19008b);if(_0x25726e){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f479f['findBy']));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f479f[_0xd5d9('0x15b')]));return{'code':0xc8,'result':_0xd5d9('0x15d')};}else{logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15e'),this['channel'][_0xd5d9('0x39')],_0x4f479f['findBy']));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x4f479f[_0xd5d9('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x16e')]=function(_0x45df9d){logger['info'](util['format'](_0xd5d9('0x16f'),_0x45df9d[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x45df9d['file_id'])){return this[_0xd5d9('0x34')]['error'](_0x45df9d,_0xd5d9('0x114'));}var _0x5ca57f=this[_0xd5d9('0x115')][_0xd5d9('0xa8')](this,_0x45df9d[_0xd5d9('0x113')]);if(!_0x5ca57f){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x45df9d,_0xd5d9('0x168'));}var _0x2b95b4=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0x170'),[_0x5ca57f,_0x45df9d[_0xd5d9('0xe6')]]);if(_0x2b95b4[_0xd5d9('0xa5')]===-0x1){return _0x2b95b4;}return this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xc7'),_0xd5d9('0x170'),_0x5ca57f));};AGIVertices[_0xd5d9('0xf')]['queue']=function(_0xbab082){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x171'),_0xbab082[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0xbab082['queue_id'])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0xbab082,_0xd5d9('0x172'));}var _0x47a71c='';var _0x96575d=parseInt(_0xbab082[_0xd5d9('0x173')],0xa);if(isNaN(_0x96575d)){_0x47a71c=_0xbab082[_0xd5d9('0x173')];}else{_0x47a71c=this[_0xd5d9('0x174')]['sync'](this,_0xbab082['queue_id']);if(!_0x47a71c){return this[_0xd5d9('0x34')]['error'](_0xbab082,'no\x20queue\x20found');}}var _0x5a6a74='';if(this[_0xd5d9('0xab')](_0xbab082['file_id'])){var _0x5d3978=this[_0xd5d9('0x115')][_0xd5d9('0xa8')](this,_0xbab082[_0xd5d9('0x113')]);if(_0x5d3978){_0x5a6a74=_0x5d3978;}}this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0xbab082,_0x47a71c);if(_0xbab082[_0xd5d9('0xe6')][_0xd5d9('0x175')]('x')<0x0){_0xbab082[_0xd5d9('0xe6')]+='x';}if(_0xbab082['opts']['indexOf']('X')<0x0){_0xbab082[_0xd5d9('0xe6')]+='X';}this[_0xd5d9('0x34')][_0xd5d9('0xa0')](_0xd5d9('0x176'),_0x47a71c?_0x47a71c[_0xd5d9('0x177')]():'');var _0x4170d2=this[_0xd5d9('0x34')]['exec']('QUEUE',[_0x47a71c,_0xbab082[_0xd5d9('0xe6')],_0xbab082['url'],_0x5a6a74,_0xbab082[_0xd5d9('0x65')],_0xbab082[_0xd5d9('0x7')],_0xbab082[_0xd5d9('0x178')],_0xbab082[_0xd5d9('0x179')],'',_0xbab082['position']]);if(_0x4170d2[_0xd5d9('0xa5')]===-0x1){return _0x4170d2;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xc7'),_0xd5d9('0x17a'),_0x47a71c));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x17b')]=function(_0x324199){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x324199[_0xd5d9('0x36')]));var _0x279cb0=_0x324199['recordingFormat']||_0xd5d9('0x132');var _0x5abe84=util[_0xd5d9('0x52')](_0xd5d9('0x17c'),this[_0xd5d9('0x34')][_0xd5d9('0x35')],rs[_0xd5d9('0x11c')](0x5));var _0x38cc72=util['format'](_0xd5d9('0x17d'),FILES_PATH,_0x5abe84,_0x279cb0);var _0xca1f1=util['format']('%s/recordings/%s',FILES_PATH,_0x5abe84);this[_0xd5d9('0x3a')][_0xd5d9('0xa8')](this,_0x324199,_0x5abe84,_0x38cc72);this['channel']['setVariable'](_0xd5d9('0x17e'),_0x5abe84);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0xca1f1,_0x279cb0,_0x324199[_0xd5d9('0x17f')],_0x324199['timeout']);return this[_0xd5d9('0x34')][_0xd5d9('0x13d')](_0xca1f1,_0x279cb0,_0x324199['escape_digits'],_0x324199[_0xd5d9('0x65')],undefined,!![]);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x180')]=function(_0x41de99){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x181'),_0x41de99[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x41de99['url'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x182'));}var _0x361483=this[_0xd5d9('0x62')][_0xd5d9('0xa8')](this,_0x41de99);logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x183'),util[_0xd5d9('0x184')](_0x361483,{'showHidden':![],'depth':null})));if(!this[_0xd5d9('0xab')](_0x41de99['variable_id'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x185'));}var _0x126ff8=this[_0xd5d9('0xa3')][_0xd5d9('0xa8')](this,_0x41de99[_0xd5d9('0xd9')]);if(!_0x126ff8){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x41de99,_0xd5d9('0xda'));}this[_0xd5d9('0x34')][_0xd5d9('0xa0')](util[_0xd5d9('0x52')](_0xd5d9('0x186'),_0x126ff8),_0x361483[_0xd5d9('0x74')]?_0x361483[_0xd5d9('0x74')]:_0xd5d9('0x187'));this['channel']['setVariable'](util['format'](_0xd5d9('0x188'),_0x126ff8),_0x361483[_0xd5d9('0x189')]?_0x361483[_0xd5d9('0x189')]:'OK');if(_0x361483[_0xd5d9('0x6a')]){try{this[_0xd5d9('0x9e')](_0x361483[_0xd5d9('0x6a')],_0x126ff8);}catch(_0x298e2a){logger[_0xd5d9('0x2f')](util[_0xd5d9('0x52')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x126ff8));}}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('variable\x20%s\x20set',_0x126ff8));};AGIVertices['prototype'][_0xd5d9('0x18a')]=function(_0x458708){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x18b'),_0x458708['label']));return this['channel'][_0xd5d9('0x18c')](_0x458708[_0xd5d9('0x18d')][_0xd5d9('0x57')](/\s+/g,''),_0x458708['escape_digits']);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x18e')]=function(_0x3b9fea){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x18f'),_0x3b9fea['label']));return this[_0xd5d9('0x34')][_0xd5d9('0x190')](_0x3b9fea[_0xd5d9('0x66')][_0xd5d9('0x57')](/\s+/g,''),_0x3b9fea[_0xd5d9('0x17f')]);};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x191')]=function(_0x41ac8c){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x192'),_0x41ac8c[_0xd5d9('0x36')]));return this[_0xd5d9('0x34')]['sayPhonetic'](_0x41ac8c[_0xd5d9('0x5a')],_0x41ac8c[_0xd5d9('0x17f')]);};AGIVertices['prototype'][_0xd5d9('0x193')]=function(_0x3c4b22){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x194'),_0x3c4b22[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x3c4b22[_0xd5d9('0x195')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0x196'));}var _0x41516e=this[_0xd5d9('0x1e')][_0xd5d9('0xa8')](this,_0x3c4b22[_0xd5d9('0x195')]);if(!_0x41516e||!_0x41516e[_0xd5d9('0x197')]){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x3c4b22,_0xd5d9('0x198'));}var _0x1a9ea1={'from':util['format'](_0xd5d9('0x199'),_0x41516e[_0xd5d9('0x12')],_0x41516e[_0xd5d9('0x19a')]||_0x41516e['Smtp'][_0xd5d9('0x19b')]),'to':_0x3c4b22['to']||'','cc':_0x3c4b22['cc']||'','bcc':_0x3c4b22[_0xd5d9('0x19c')]||'','subject':_0x3c4b22[_0xd5d9('0x19d')],'html':_0x3c4b22['text'],'text':_0x3c4b22[_0xd5d9('0x5a')]};var _0x49c351={'tls':{'rejectUnauthorized':![]}};if(_0x41516e['Smtp'][_0xd5d9('0x19e')]){_0x49c351[_0xd5d9('0x19e')]=_0x41516e[_0xd5d9('0x197')][_0xd5d9('0x19e')];}else{_0x49c351['host']=_0x41516e[_0xd5d9('0x197')]['host'];_0x49c351['port']=_0x41516e['Smtp'][_0xd5d9('0x19f')];_0x49c351[_0xd5d9('0x1a0')]=_0x41516e['Smtp'][_0xd5d9('0x1a0')];}if(_0x41516e[_0xd5d9('0x197')]['authentication']){_0x49c351['auth']={'user':_0x41516e[_0xd5d9('0x197')][_0xd5d9('0x19b')],'pass':_0x41516e[_0xd5d9('0x197')]['pass']};}if(this[_0xd5d9('0xab')](_0x3c4b22['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0xd5d9('0x72')](_0x1a9ea1));this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x3c4b22,_0x3c4b22['account_id']);this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x1a1'),_0x41516e[_0xd5d9('0x12')]));this[_0xd5d9('0x21')][_0xd5d9('0xa8')](this,_0x49c351,_0x1a9ea1);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x1a2'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1a3')]=function(_0x53bf75){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1a4'),_0x53bf75['label']));return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0x1a5'));};AGIVertices[_0xd5d9('0xf')]['sendSMS']=function(_0x34e5c3){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1a6'),_0x34e5c3[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x34e5c3[_0xd5d9('0x1a7')])){return this['channel'][_0xd5d9('0xac')](_0xd5d9('0x1a8'));}var _0x48eacf=this[_0xd5d9('0x31')][_0xd5d9('0xa8')](this,_0x34e5c3['sms_account_id']);if(!_0x48eacf){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x34e5c3,_0xd5d9('0x1a9'));}var _0x32c972={'body':_0x34e5c3[_0xd5d9('0x1aa')],'phone':_0x34e5c3['to']||'','SmsAccountId':_0x48eacf['id']};logger['debug'](_0xd5d9('0x1ab'),JSON['stringify'](_0x32c972));this['createSquareDetailsReport'][_0xd5d9('0xa8')](this,_0x34e5c3,_0x34e5c3[_0xd5d9('0x1a7')]);this['channel'][_0xd5d9('0xac')](util['format'](_0xd5d9('0x1ac'),_0x48eacf['name']));this[_0xd5d9('0x32')][_0xd5d9('0xa8')](this,_0x32c972);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x1ad'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1ae')]=function(_0xedd190){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1af'),_0xedd190['label']));if(!this['isConfigured'](_0xedd190['variable_id'])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0xedd190,_0xd5d9('0x1b0'));}var _0x4f1700=this['getVariable'][_0xd5d9('0xa8')](this,_0xedd190[_0xd5d9('0xd9')]);if(!_0x4f1700){return this['channel'][_0xd5d9('0x2f')](_0xedd190,_0xd5d9('0xda'));}return this[_0xd5d9('0x34')][_0xd5d9('0xa0')](_0x4f1700,_0xedd190[_0xd5d9('0x1b1')]);};AGIVertices['prototype'][_0xd5d9('0x1b2')]=function(_0x2ccf74){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')]('Enter\x20in\x20START\x20(%s)\x20block',_0x2ccf74[_0xd5d9('0x36')]));this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x1b3'));if(_0x2ccf74[_0xd5d9('0xbe')]===_0xd5d9('0x1b4')){this['channel'][_0xd5d9('0xac')](_0xd5d9('0x1b5'));return this[_0xd5d9('0x34')]['answer']();}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x1b6'));};AGIVertices[_0xd5d9('0xf')]['subproject']=function(_0x59bca3){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x1b7'),_0x59bca3[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x59bca3[_0xd5d9('0x1b8')])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x59bca3,'no\x20subproject\x20selected');}var _0x460cc8=this[_0xd5d9('0x15')]['sync'](this,_0x59bca3[_0xd5d9('0x1b8')]);if(!this['isConfigured'](_0x460cc8)){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x59bca3,util[_0xd5d9('0x52')](_0xd5d9('0x1b9'),_0x59bca3[_0xd5d9('0x1b8')]));}if(_0x460cc8===this[_0xd5d9('0x34')][_0xd5d9('0x38')]){return this[_0xd5d9('0x34')]['error'](_0x59bca3,_0xd5d9('0x1ba'));}this[_0xd5d9('0x33')][_0xd5d9('0xa8')](this,_0x59bca3,_0x460cc8);var _0x2cbdf3=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0x1bb'),util[_0xd5d9('0x52')](_0xd5d9('0x1bc'),config[_0xd5d9('0x7')][_0xd5d9('0x1bd')]||_0xd5d9('0x1be'),_0x460cc8,this[_0xd5d9('0x34')][_0xd5d9('0x38')]));if(_0x2cbdf3['result']===-0x1){return _0x2cbdf3;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0xc7'),_0xd5d9('0x1bb'),_0x460cc8));};AGIVertices['prototype'][_0xd5d9('0x1bf')]=function(_0x3f23ca){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1c0'),_0x3f23ca['label']));var _0x41907c=this['shellCommand']['sync'](this,_0x3f23ca[_0xd5d9('0xbc')]);this['createSquareDetailsReport'][_0xd5d9('0xa8')](this,_0x3f23ca,_0x3f23ca['command']);if(this[_0xd5d9('0xab')](_0x3f23ca['variable_id'])){var _0x5ece72=this[_0xd5d9('0xa3')]['sync'](this,_0x3f23ca[_0xd5d9('0xd9')]);if(_0x5ece72){this['channel'][_0xd5d9('0xa0')](_0x5ece72,_0x41907c);return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x1c1'),_0x3f23ca[_0xd5d9('0xbc')],_0x5ece72));}}return this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x1c2'),_0x3f23ca[_0xd5d9('0xbc')]));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1c3')]=function(_0x26d560){logger['info'](util[_0xd5d9('0x52')](_0xd5d9('0x1c4'),_0x26d560[_0xd5d9('0x36')]));_0x26d560[_0xd5d9('0x5a')]=_0x26d560[_0xd5d9('0x5a')][_0xd5d9('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd5d9('0xab')](_0x26d560['apiKey'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0x1c5'));}if(!this['isConfigured'](_0x26d560[_0xd5d9('0x5a')])){return this[_0xd5d9('0x34')]['noop'](_0xd5d9('0xad'));}this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x1c6'),_0x26d560['text']));var _0x107fe1=this[_0xd5d9('0x58')][_0xd5d9('0xa8')](this,_0x26d560);if(_0x107fe1){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x107fe1));var _0x38b4b5=this[_0xd5d9('0x34')][_0xd5d9('0x105')](_0x107fe1);try{fs['unlink'](_0x107fe1+_0xd5d9('0x107'));}catch(_0x4b4b48){logger[_0xd5d9('0x2f')](_0x4b4b48);}return _0x38b4b5;}return this[_0xd5d9('0x34')]['error'](_0x26d560,_0xd5d9('0x1c7'));};AGIVertices['prototype']['tts']=function(_0x271932){logger['info'](util['format'](_0xd5d9('0x1c8'),_0x271932[_0xd5d9('0x36')]));_0x271932[_0xd5d9('0x5a')]=_0x271932[_0xd5d9('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd5d9('0xab')](_0x271932['text'])){return this[_0xd5d9('0x34')][_0xd5d9('0xac')](_0xd5d9('0xad'));}this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x1c9'),_0x271932[_0xd5d9('0x5a')]));var _0xea5fb7=this['googleTTS'][_0xd5d9('0xa8')](this,_0x271932);if(_0xea5fb7){this[_0xd5d9('0x34')][_0xd5d9('0xac')](util['format'](_0xd5d9('0x1ca'),_0xea5fb7));var _0x4aab0e=this[_0xd5d9('0x34')][_0xd5d9('0x105')](_0xea5fb7);try{fs[_0xd5d9('0x106')](_0xea5fb7+_0xd5d9('0x107'));}catch(_0x389eb8){logger[_0xd5d9('0x2f')](_0x389eb8);}return _0x4aab0e;}return this['channel'][_0xd5d9('0x2f')](_0x271932,_0xd5d9('0x1cb'));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1cc')]=function(_0x3f6b3b){logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x1cd'),_0x3f6b3b[_0xd5d9('0x36')]));if(!this[_0xd5d9('0xab')](_0x3f6b3b[_0xd5d9('0x15b')])){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x3f6b3b,'no\x20find\x20by\x20configured');}logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15a'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x3f6b3b[_0xd5d9('0x15b')]));var _0x258997=this[_0xd5d9('0x4f')]['sync'](this,_0x3f6b3b[_0xd5d9('0x15b')]);if(_0x258997){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this['channel'][_0xd5d9('0x39')],_0x3f6b3b[_0xd5d9('0x15b')]));this['channel'][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x15c'),this[_0xd5d9('0x34')]['callerid'],_0x3f6b3b[_0xd5d9('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xd5d9('0x2c')](util['format'](_0xd5d9('0x15e'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x3f6b3b['findBy']));this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0x15e'),this[_0xd5d9('0x34')][_0xd5d9('0x39')],_0x3f6b3b[_0xd5d9('0x15b')]));return{'code':0xc8,'result':_0xd5d9('0x15f')};}};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1ce')]=function(_0x471439){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1cf'),_0x471439[_0xd5d9('0x36')]));var _0x247eaa=this[_0xd5d9('0x34')][_0xd5d9('0x56')](_0xd5d9('0x1d0'),[_0x471439[_0xd5d9('0x1d1')],_0x471439['options']]);if(_0x247eaa['result']===-0x1){return _0x247eaa;}return this[_0xd5d9('0x34')][_0xd5d9('0xac')](util[_0xd5d9('0x52')](_0xd5d9('0xc7'),'VOICEMAIL',_0x471439[_0xd5d9('0x1d1')]));};AGIVertices[_0xd5d9('0xf')][_0xd5d9('0x1d2')]=function(_0x19dd8d){logger[_0xd5d9('0x2c')](util[_0xd5d9('0x52')](_0xd5d9('0x1d3'),_0x19dd8d['label']));if(!this[_0xd5d9('0xab')](_0x19dd8d['variable_id'])){return this['channel']['error'](_0x19dd8d,_0xd5d9('0x1b0'));}var _0x11f6a7=this[_0xd5d9('0xa3')]['sync'](this,_0x19dd8d[_0xd5d9('0xd9')]);if(!_0x11f6a7){return this[_0xd5d9('0x34')][_0xd5d9('0x2f')](_0x19dd8d,'no\x20variable\x20found');}var _0x22dd49=this[_0xd5d9('0x34')][_0xd5d9('0xa3')](_0x11f6a7);return{'code':0xc8,'result':_0x22dd49[_0xd5d9('0xa4')]?_0x22dd49[_0xd5d9('0xa4')]:'-'};};String[_0xd5d9('0xf')][_0xd5d9('0xa2')]=function(_0x51a7dc,_0x43bccd){return this[_0xd5d9('0xa1')](_0x51a7dc)['join'](_0x43bccd);};module[_0xd5d9('0x1d4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 6ad7903..968a16d 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 _0x9339=['[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','bind','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','attended','destlinkedid','savePause','info','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]'];(function(_0x1719df,_0x3f375e){var _0x20983b=function(_0x170dc6){while(--_0x170dc6){_0x1719df['push'](_0x1719df['shift']());}};_0x20983b(++_0x3f375e);}(_0x9339,0x173));var _0x9933=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x9339[_0x5e7514];return _0x12f472;};'use strict';var util=require(_0x9933('0x0'));var _=require('lodash');var moment=require(_0x9933('0x1'));var ami=require(_0x9933('0x2'));var logger=require(_0x9933('0x3'))(_0x9933('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x9933('0x5'));function Acw(_0x3e4661){this[_0x9933('0x6')]=_0x3e4661[_0x9933('0x6')];this[_0x9933('0x7')]=_0x3e4661[_0x9933('0x7')];this[_0x9933('0x8')]=_0x3e4661[_0x9933('0x8')];this[_0x9933('0x9')]={};ami['on'](_0x9933('0xa'),this['syncAgentConnect']['bind'](this));ami['on'](_0x9933('0xb'),this[_0x9933('0xc')]['bind'](this));ami['on'](_0x9933('0xd'),this[_0x9933('0xe')]['bind'](this));ami['on'](_0x9933('0xf'),this[_0x9933('0x10')][_0x9933('0x11')](this));ami['on'](_0x9933('0x12'),this[_0x9933('0x13')][_0x9933('0x11')](this));ami['on'](_0x9933('0x14'),this[_0x9933('0x15')][_0x9933('0x11')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x9933('0x11')](this));}function getDiff(_0x468465){var _0x37a102=moment()[_0x9933('0x16')](0x0);var _0x44ace1=moment(_0x468465)[_0x9933('0x16')](0x0);return _0x37a102[_0x9933('0x17')](_0x44ace1,_0x9933('0x18'));}Acw[_0x9933('0x19')][_0x9933('0x1a')]=function(_0x556f7b){try{var _0xa59e02=this;var _0x148c06=this[_0x9933('0x9')][_0x556f7b][_0x9933('0x1b')];var _0x78896b=this[_0x9933('0x9')][_0x556f7b][_0x9933('0x1c')];var _0x4c0324=this['voiceQueues'][_0x78896b];var _0x4a1d30=![];var _0x4aed0a=_0x9933('0x1d');if(_0x4c0324[_0x9933('0x1e')]){if(_0x4c0324[_0x9933('0x1f')][_0x9933('0x20')]){_0x4a1d30=!![];_0x4aed0a=_0x4c0324['mandatoryDispositionPause'][_0x9933('0x20')];}}ami[_0x9933('0x21')]({'action':_0x9933('0x22'),'interface':_0x148c06,'paused':!![],'reason':_0x4aed0a})['then'](function(_0x24b361){if(_0xa59e02['agents'][_0x148c06]){return RpcUser['getAgent'](_0xa59e02['agents'][_0x148c06]['id'])[_0x9933('0x23')](function(_0x464778){if(_0x464778&&!_0x464778[_0x9933('0x24')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x556f7b,_0x148c06,_0x78896b);var _0x441345=_0xa59e02['channels'][_0x556f7b][_0x9933('0x25')]&&_0xa59e02[_0x9933('0x9')][_0x556f7b]['destlinkedid']?_0xa59e02['channels'][_0x556f7b][_0x9933('0x26')]:_0x556f7b;return RpcUser[_0x9933('0x27')](_0xa59e02[_0x9933('0x7')][_0x148c06],_0x4aed0a,_0x441345)[_0x9933('0x23')](function(_0x195e82){if(!_0x4a1d30){_0xa59e02[_0x9933('0x8')][_0x148c06]={};logger[_0x9933('0x28')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x556f7b,_0xa59e02[_0x9933('0x6')][_0x78896b]['acwTimeout'],_0x148c06,_0x78896b);_0xa59e02[_0x9933('0x8')][_0x148c06]['timer']=setTimeout(_0xa59e02['stopAcw']['bind'](_0xa59e02,_0x148c06),_0xa59e02[_0x9933('0x6')][_0x78896b][_0x9933('0x29')]*0x3e8);_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2a')]=moment()[_0x9933('0x2b')](_0x9933('0x2c'));_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2d')]=_0x556f7b;_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x1c')]=_0x78896b;_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2e')]=function(){var _0x25f54b=getDiff(_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2a')]);clearTimeout(_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2f')]);_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2f')]=![];RpcVoiceAgentReport[_0x9933('0x30')]({'acwtime':_0x25f54b},_0xa59e02[_0x9933('0x8')][_0x148c06][_0x9933('0x2d')],_0x148c06)[_0x9933('0x23')](function(_0x7d68af){logger[_0x9933('0x28')](_0x9933('0x31'),_0x556f7b,_0x25f54b,_0x7d68af);})[_0x9933('0x32')](function(_0x2156a1){logger[_0x9933('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x556f7b,_0x2156a1);});delete _0xa59e02[_0x9933('0x8')][_0x148c06];};}});}else{logger[_0x9933('0x28')](_0x9933('0x34'),_0x556f7b,_0x148c06,_0x78896b);}});}})[_0x9933('0x32')](function(_0x3a77e9){logger[_0x9933('0x33')](_0x9933('0x35'),_0x556f7b,_0xa59e02[_0x9933('0x6')][_0x78896b][_0x9933('0x29')],_0x148c06,_0x78896b);})[_0x9933('0x36')](function(){delete _0xa59e02['channels'][_0x556f7b];});}catch(_0x569424){logger[_0x9933('0x33')](_0x9933('0x37'),_0x569424[_0x9933('0x38')]);}};Acw['prototype'][_0x9933('0x39')]=function(_0x51b161){try{var _0x2396e0=this;if(_0x2396e0[_0x9933('0x8')][_0x51b161]){_0x2396e0['timers'][_0x51b161][_0x9933('0x2f')]=![];var _0xdc24ae=_0x2396e0[_0x9933('0x8')][_0x51b161][_0x9933('0x2d')];var _0x1c8941=_0x2396e0[_0x9933('0x8')][_0x51b161][_0x9933('0x1c')];var _0xa1ceaa=_0x2396e0[_0x9933('0x6')][_0x1c8941]['acwTimeout'];logger[_0x9933('0x28')](_0x9933('0x3a'),_0xdc24ae,_0x51b161);RpcUser[_0x9933('0x3b')](this['agents'][_0x51b161]);RpcVoiceAgentReport[_0x9933('0x30')]({'acwtime':_0xa1ceaa,'agentacw':!![]},_0xdc24ae,_0x51b161)['then'](function(_0x54068f){logger[_0x9933('0x28')]('[%s][UPDATE][ACWTIME:%s]',_0xdc24ae,_0xa1ceaa,_0x54068f);})['catch'](function(_0x4d39c1){logger[_0x9933('0x33')](_0x9933('0x3c'),_0xdc24ae,_0x4d39c1);});}else{logger['error'](_0x9933('0x3d'),_0x51b161);if(_0x2396e0['timers']){logger['info'](_0x9933('0x3e'),JSON[_0x9933('0x3f')](_0x2396e0['timers']));}}}catch(_0x5cc7dc){logger[_0x9933('0x33')](_0x9933('0x40'),_0x5cc7dc['message']);}};Acw['prototype'][_0x9933('0x41')]=function(_0x48f772){try{if(this[_0x9933('0x6')][_0x48f772[_0x9933('0x1c')]]&&(this[_0x9933('0x6')][_0x48f772[_0x9933('0x1c')]]['acw']||this[_0x9933('0x6')][_0x48f772[_0x9933('0x1c')]][_0x9933('0x1e')])){if(this['agents'][_0x48f772['interface']]){this['channels'][_0x48f772[_0x9933('0x2d')]]={'queue':_0x48f772[_0x9933('0x1c')],'interface':_0x48f772[_0x9933('0x1b')],'destlinkedid':_0x48f772[_0x9933('0x26')]};}}}catch(_0x1ca8c0){logger[_0x9933('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x1ca8c0[_0x9933('0x38')]);}};Acw[_0x9933('0x19')][_0x9933('0x42')]=function(_0x6d92de){try{if(this['voiceQueues'][_0x6d92de[_0x9933('0x1c')]]&&(this[_0x9933('0x6')][_0x6d92de[_0x9933('0x1c')]][_0x9933('0x4')]||this[_0x9933('0x6')][_0x6d92de[_0x9933('0x1c')]][_0x9933('0x1e')])){if(this['agents'][_0x6d92de['interface']]){this[_0x9933('0x9')][_0x6d92de[_0x9933('0x2d')]]={'queue':_0x6d92de[_0x9933('0x1c')],'interface':_0x6d92de[_0x9933('0x1b')]};}}}catch(_0x12cf4e){logger[_0x9933('0x33')](_0x9933('0x43'),_0x12cf4e[_0x9933('0x38')]);}};Acw['prototype']['syncHangupRequest']=function(_0x49ba05){try{if(this[_0x9933('0x9')][_0x49ba05['uniqueid']]&&_['isUndefined'](this[_0x9933('0x9')][_0x49ba05[_0x9933('0x2d')]]['attended'])){logger[_0x9933('0x28')](_0x9933('0x44'),_0x49ba05[_0x9933('0x2d')]);this[_0x9933('0x1a')](_0x49ba05['uniqueid']);}else if(this[_0x9933('0x9')][_0x49ba05[_0x9933('0x45')]]&&_[_0x9933('0x46')](this[_0x9933('0x9')][_0x49ba05['linkedid']][_0x9933('0x25')])){logger[_0x9933('0x28')](_0x9933('0x47'),_0x49ba05[_0x9933('0x45')]);this[_0x9933('0x1a')](_0x49ba05[_0x9933('0x45')]);}}catch(_0x2828b6){logger[_0x9933('0x33')](_0x9933('0x48'),_0x2828b6[_0x9933('0x38')]);}};Acw['prototype'][_0x9933('0xe')]=function(_0x3be624){try{if(this['channels'][_0x3be624[_0x9933('0x2d')]]&&this[_0x9933('0x9')][_0x3be624[_0x9933('0x2d')]][_0x9933('0x25')]){logger[_0x9933('0x28')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3be624[_0x9933('0x2d')]);this[_0x9933('0x1a')](_0x3be624[_0x9933('0x2d')]);}else if(this[_0x9933('0x9')][_0x3be624[_0x9933('0x45')]]&&this[_0x9933('0x9')][_0x3be624[_0x9933('0x45')]][_0x9933('0x25')]){logger['info'](_0x9933('0x49'),_0x3be624['linkedid']);this[_0x9933('0x1a')](_0x3be624[_0x9933('0x45')]);}}catch(_0x12cbaa){logger[_0x9933('0x33')](_0x9933('0x4a'),_0x12cbaa['message']);}};Acw[_0x9933('0x19')][_0x9933('0x13')]=function(_0x29f319){try{if(!_[_0x9933('0x4b')](this[_0x9933('0x9')][_0x29f319['transfereeuniqueid']])){this[_0x9933('0x1a')](_0x29f319[_0x9933('0x4c')]);if(this[_0x9933('0x9')][_0x29f319['secondtransfereruniqueid']]){this[_0x9933('0x9')][_0x29f319['secondtransfereruniqueid']]['attended']=!![];this[_0x9933('0x9')][_0x29f319[_0x9933('0x4d')]]=this[_0x9933('0x9')][_0x29f319[_0x9933('0x4e')]];delete this[_0x9933('0x9')][_0x29f319[_0x9933('0x4e')]];}}else if(!_[_0x9933('0x4b')](this[_0x9933('0x9')][_0x29f319[_0x9933('0x4d')]])){this[_0x9933('0x1a')](_0x29f319[_0x9933('0x4d')]);if(this['channels'][_0x29f319[_0x9933('0x4f')]]){this[_0x9933('0x9')][_0x29f319[_0x9933('0x4f')]]['attended']=!![];this[_0x9933('0x9')][_0x29f319[_0x9933('0x4c')]]=this[_0x9933('0x9')][_0x29f319['origtransfereruniqueid']];delete this['channels'][_0x29f319[_0x9933('0x4f')]];}}}catch(_0x376be2){logger[_0x9933('0x33')](_0x9933('0x50'),_0x376be2['message']);}};Acw[_0x9933('0x19')][_0x9933('0x15')]=function(_0x48d41c){try{if(this[_0x9933('0x9')][_0x48d41c[_0x9933('0x51')]]){logger[_0x9933('0x28')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x9933('0x3f')](_0x48d41c[_0x9933('0x51')]));this[_0x9933('0x1a')](_0x48d41c['transfereruniqueid']);}else if(this[_0x9933('0x9')][_0x48d41c[_0x9933('0x52')]]){logger[_0x9933('0x28')](_0x9933('0x53'),JSON[_0x9933('0x3f')](_0x48d41c[_0x9933('0x52')]));this[_0x9933('0x1a')](_0x48d41c['transfererlinkedid']);}}catch(_0x1ee9c0){logger[_0x9933('0x33')]('[ACW][syncBlindTransfer]\x20%s',_0x1ee9c0[_0x9933('0x38')]);}};Acw[_0x9933('0x19')][_0x9933('0x10')]=function(_0x547821){try{if(this[_0x9933('0x6')][_0x547821[_0x9933('0x1c')]]&&this['voiceQueues'][_0x547821[_0x9933('0x1c')]][_0x9933('0x54')]==='all'){if(this[_0x9933('0x7')][_0x547821[_0x9933('0x1b')]]){logger[_0x9933('0x28')](_0x9933('0x55'),_0x547821[_0x9933('0x2d')],_0x547821['interface'],_0x547821['queue']);return RpcUser[_0x9933('0x27')](this[_0x9933('0x7')][_0x547821[_0x9933('0x1b')]],_0x9933('0x56'),_0x547821[_0x9933('0x2d')]);}}}catch(_0x415cb8){logger['error'](_0x9933('0x57'),_0x415cb8['message']);}};module[_0x9933('0x58')]=Acw; \ No newline at end of file +var _0xef9c=['all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][syncAgentConnect]\x20%s','message','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xef9c,0xae));var _0xcef9=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0xef9c[_0x395bfe];return _0x35c81c;};'use strict';var util=require(_0xcef9('0x0'));var _=require(_0xcef9('0x1'));var moment=require(_0xcef9('0x2'));var ami=require(_0xcef9('0x3'));var logger=require(_0xcef9('0x4'))(_0xcef9('0x5'));var RpcUser=require(_0xcef9('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x402990){this[_0xcef9('0x7')]=_0x402990[_0xcef9('0x7')];this['agents']=_0x402990[_0xcef9('0x8')];this[_0xcef9('0x9')]=_0x402990[_0xcef9('0x9')];this[_0xcef9('0xa')]={};ami['on']('agentconnect',this[_0xcef9('0xb')][_0xcef9('0xc')](this));ami['on'](_0xcef9('0xd'),this[_0xcef9('0xe')][_0xcef9('0xc')](this));ami['on'](_0xcef9('0xf'),this[_0xcef9('0x10')][_0xcef9('0xc')](this));ami['on'](_0xcef9('0x11'),this['syncAgentRingNoAnswer'][_0xcef9('0xc')](this));ami['on'](_0xcef9('0x12'),this[_0xcef9('0x13')][_0xcef9('0xc')](this));ami['on'](_0xcef9('0x14'),this['syncBlindTransfer'][_0xcef9('0xc')](this));ami['on'](_0xcef9('0x15'),this[_0xcef9('0x16')][_0xcef9('0xc')](this));}function getDiff(_0x3fa0a0){var _0x4d59e8=moment()[_0xcef9('0x17')](0x0);var _0x1f1e10=moment(_0x3fa0a0)['milliseconds'](0x0);return _0x4d59e8['diff'](_0x1f1e10,_0xcef9('0x18'));}Acw[_0xcef9('0x19')][_0xcef9('0x1a')]=function(_0x3b243e){try{var _0x233d03=this;var _0xa7c6ba=this[_0xcef9('0xa')][_0x3b243e][_0xcef9('0x1b')];var _0xda5ef9=this[_0xcef9('0xa')][_0x3b243e][_0xcef9('0x1c')];var _0x169028=this[_0xcef9('0x7')][_0xda5ef9];var _0x4148d5=![];var _0x5bdc3c=_0xcef9('0x1d');if(_0x169028[_0xcef9('0x1e')]){if(_0x169028[_0xcef9('0x1f')]['name']){_0x4148d5=!![];_0x5bdc3c=_0x169028[_0xcef9('0x1f')][_0xcef9('0x20')];}}ami[_0xcef9('0x21')]({'action':'QueuePause','interface':_0xa7c6ba,'paused':!![],'reason':_0x5bdc3c})[_0xcef9('0x22')](function(_0x5a6dde){if(_0x233d03[_0xcef9('0x8')][_0xa7c6ba]){return RpcUser[_0xcef9('0x23')](_0x233d03[_0xcef9('0x8')][_0xa7c6ba]['id'])[_0xcef9('0x22')](function(_0x243852){if(_0x243852&&!_0x243852[_0xcef9('0x24')]){logger[_0xcef9('0x25')](_0xcef9('0x26'),_0x3b243e,_0xa7c6ba,_0xda5ef9);var _0x38e756=_0x233d03[_0xcef9('0xa')][_0x3b243e]['attended']&&_0x233d03[_0xcef9('0xa')][_0x3b243e][_0xcef9('0x27')]?_0x233d03[_0xcef9('0xa')][_0x3b243e]['destlinkedid']:_0x3b243e;return RpcUser[_0xcef9('0x28')](_0x233d03[_0xcef9('0x8')][_0xa7c6ba],_0x5bdc3c,_0x38e756)['then'](function(_0x190084){if(!_0x4148d5){_0x233d03[_0xcef9('0x9')][_0xa7c6ba]={};logger[_0xcef9('0x25')](_0xcef9('0x29'),_0x3b243e,_0x233d03[_0xcef9('0x7')][_0xda5ef9][_0xcef9('0x2a')],_0xa7c6ba,_0xda5ef9);_0x233d03[_0xcef9('0x9')][_0xa7c6ba][_0xcef9('0x2b')]=setTimeout(_0x233d03[_0xcef9('0x2c')][_0xcef9('0xc')](_0x233d03,_0xa7c6ba),_0x233d03[_0xcef9('0x7')][_0xda5ef9]['acwTimeout']*0x3e8);_0x233d03[_0xcef9('0x9')][_0xa7c6ba][_0xcef9('0x2d')]=moment()[_0xcef9('0x2e')](_0xcef9('0x2f'));_0x233d03['timers'][_0xa7c6ba][_0xcef9('0x30')]=_0x3b243e;_0x233d03[_0xcef9('0x9')][_0xa7c6ba]['queue']=_0xda5ef9;_0x233d03[_0xcef9('0x9')][_0xa7c6ba]['updateAcw']=function(){var _0x4f2ff5=getDiff(_0x233d03[_0xcef9('0x9')][_0xa7c6ba][_0xcef9('0x2d')]);clearTimeout(_0x233d03[_0xcef9('0x9')][_0xa7c6ba][_0xcef9('0x2b')]);_0x233d03[_0xcef9('0x9')][_0xa7c6ba][_0xcef9('0x2b')]=![];RpcVoiceAgentReport[_0xcef9('0x31')]({'acwtime':_0x4f2ff5},_0x233d03['timers'][_0xa7c6ba][_0xcef9('0x30')],_0xa7c6ba)[_0xcef9('0x22')](function(_0xd1212e){logger[_0xcef9('0x25')](_0xcef9('0x32'),_0x3b243e,_0x4f2ff5,_0xd1212e);})[_0xcef9('0x33')](function(_0xb745f4){logger[_0xcef9('0x34')](_0xcef9('0x35'),_0x3b243e,_0xb745f4);});delete _0x233d03[_0xcef9('0x9')][_0xa7c6ba];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x3b243e,_0xa7c6ba,_0xda5ef9);}});}})[_0xcef9('0x33')](function(_0x2999fb){logger[_0xcef9('0x34')](_0xcef9('0x29'),_0x3b243e,_0x233d03[_0xcef9('0x7')][_0xda5ef9]['acwTimeout'],_0xa7c6ba,_0xda5ef9);})['finally'](function(){delete _0x233d03[_0xcef9('0xa')][_0x3b243e];});}catch(_0x1b39c0){logger[_0xcef9('0x34')](_0xcef9('0x36'),_0x1b39c0['message']);}};Acw[_0xcef9('0x19')][_0xcef9('0x2c')]=function(_0x9aab34){try{var _0x865194=this;if(_0x865194[_0xcef9('0x9')][_0x9aab34]){_0x865194['timers'][_0x9aab34]['timer']=![];var _0x1161ef=_0x865194[_0xcef9('0x9')][_0x9aab34]['uniqueid'];var _0x3a15e6=_0x865194[_0xcef9('0x9')][_0x9aab34][_0xcef9('0x1c')];var _0x25b2fc=_0x865194[_0xcef9('0x7')][_0x3a15e6][_0xcef9('0x2a')];logger[_0xcef9('0x25')](_0xcef9('0x37'),_0x1161ef,_0x9aab34);RpcUser[_0xcef9('0x38')](this['agents'][_0x9aab34]);RpcVoiceAgentReport[_0xcef9('0x31')]({'acwtime':_0x25b2fc,'agentacw':!![]},_0x1161ef,_0x9aab34)['then'](function(_0x578299){logger['info'](_0xcef9('0x32'),_0x1161ef,_0x25b2fc,_0x578299);})[_0xcef9('0x33')](function(_0x20004b){logger[_0xcef9('0x34')](_0xcef9('0x35'),_0x1161ef,_0x20004b);});}else{logger[_0xcef9('0x34')](_0xcef9('0x39'),_0x9aab34);if(_0x865194[_0xcef9('0x9')]){logger[_0xcef9('0x25')](_0xcef9('0x3a'),JSON['stringify'](_0x865194[_0xcef9('0x9')]));}}}catch(_0x26f1a7){logger[_0xcef9('0x34')]('[ACW][STOP]\x20%s',_0x26f1a7['message']);}};Acw[_0xcef9('0x19')]['syncAgentConnect']=function(_0x5ea58d){try{if(this['voiceQueues'][_0x5ea58d[_0xcef9('0x1c')]]&&(this[_0xcef9('0x7')][_0x5ea58d[_0xcef9('0x1c')]][_0xcef9('0x5')]||this[_0xcef9('0x7')][_0x5ea58d[_0xcef9('0x1c')]][_0xcef9('0x1e')])){if(this['agents'][_0x5ea58d[_0xcef9('0x1b')]]){this[_0xcef9('0xa')][_0x5ea58d[_0xcef9('0x30')]]={'queue':_0x5ea58d[_0xcef9('0x1c')],'interface':_0x5ea58d[_0xcef9('0x1b')],'destlinkedid':_0x5ea58d[_0xcef9('0x27')]};}}}catch(_0x2cf74b){logger[_0xcef9('0x34')](_0xcef9('0x3b'),_0x2cf74b[_0xcef9('0x3c')]);}};Acw[_0xcef9('0x19')]['syncAgentConnectPreview']=function(_0x4ccbb0){try{if(this[_0xcef9('0x7')][_0x4ccbb0['queue']]&&(this[_0xcef9('0x7')][_0x4ccbb0[_0xcef9('0x1c')]]['acw']||this[_0xcef9('0x7')][_0x4ccbb0[_0xcef9('0x1c')]][_0xcef9('0x1e')])){if(this[_0xcef9('0x8')][_0x4ccbb0[_0xcef9('0x1b')]]){this['channels'][_0x4ccbb0[_0xcef9('0x30')]]={'queue':_0x4ccbb0[_0xcef9('0x1c')],'interface':_0x4ccbb0[_0xcef9('0x1b')]};}}}catch(_0x912932){logger[_0xcef9('0x34')]('[ACW][syncAgentConnectPreview]\x20%s',_0x912932[_0xcef9('0x3c')]);}};Acw[_0xcef9('0x19')][_0xcef9('0xe')]=function(_0x418fd6){try{if(this[_0xcef9('0xa')][_0x418fd6[_0xcef9('0x30')]]&&_[_0xcef9('0x3d')](this[_0xcef9('0xa')][_0x418fd6[_0xcef9('0x30')]]['attended'])){logger['info'](_0xcef9('0x3e'),_0x418fd6[_0xcef9('0x30')]);this['startAcw'](_0x418fd6[_0xcef9('0x30')]);}else if(this[_0xcef9('0xa')][_0x418fd6[_0xcef9('0x3f')]]&&_[_0xcef9('0x3d')](this[_0xcef9('0xa')][_0x418fd6[_0xcef9('0x3f')]][_0xcef9('0x40')])){logger[_0xcef9('0x25')]('[%s][HANGUP:LINKEDID]',_0x418fd6[_0xcef9('0x3f')]);this['startAcw'](_0x418fd6[_0xcef9('0x3f')]);}}catch(_0x56bea8){logger[_0xcef9('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x56bea8[_0xcef9('0x3c')]);}};Acw['prototype'][_0xcef9('0x10')]=function(_0x29a82f){try{if(this[_0xcef9('0xa')][_0x29a82f['uniqueid']]&&this[_0xcef9('0xa')][_0x29a82f[_0xcef9('0x30')]][_0xcef9('0x40')]){logger[_0xcef9('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x29a82f[_0xcef9('0x30')]);this[_0xcef9('0x1a')](_0x29a82f['uniqueid']);}else if(this[_0xcef9('0xa')][_0x29a82f['linkedid']]&&this['channels'][_0x29a82f[_0xcef9('0x3f')]]['attended']){logger['info'](_0xcef9('0x41'),_0x29a82f[_0xcef9('0x3f')]);this[_0xcef9('0x1a')](_0x29a82f['linkedid']);}}catch(_0x3558b8){logger[_0xcef9('0x34')](_0xcef9('0x42'),_0x3558b8[_0xcef9('0x3c')]);}};Acw[_0xcef9('0x19')][_0xcef9('0x13')]=function(_0x1da38f){try{if(!_[_0xcef9('0x43')](this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x44')]])){this[_0xcef9('0x1a')](_0x1da38f[_0xcef9('0x44')]);if(this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x45')]]){this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x45')]][_0xcef9('0x40')]=!![];this['channels'][_0x1da38f[_0xcef9('0x46')]]=this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x45')]];delete this[_0xcef9('0xa')][_0x1da38f['secondtransfereruniqueid']];}}else if(!_[_0xcef9('0x43')](this[_0xcef9('0xa')][_0x1da38f['transfertargetuniqueid']])){this[_0xcef9('0x1a')](_0x1da38f[_0xcef9('0x46')]);if(this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x47')]]){this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x47')]][_0xcef9('0x40')]=!![];this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x44')]]=this[_0xcef9('0xa')][_0x1da38f['origtransfereruniqueid']];delete this[_0xcef9('0xa')][_0x1da38f[_0xcef9('0x47')]];}}}catch(_0x3c03dc){logger[_0xcef9('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x3c03dc[_0xcef9('0x3c')]);}};Acw[_0xcef9('0x19')][_0xcef9('0x48')]=function(_0x1b6cb7){try{if(this['channels'][_0x1b6cb7[_0xcef9('0x49')]]){logger['info'](_0xcef9('0x4a'),JSON[_0xcef9('0x4b')](_0x1b6cb7[_0xcef9('0x49')]));this[_0xcef9('0x1a')](_0x1b6cb7[_0xcef9('0x49')]);}else if(this[_0xcef9('0xa')][_0x1b6cb7[_0xcef9('0x4c')]]){logger[_0xcef9('0x25')](_0xcef9('0x4d'),JSON[_0xcef9('0x4b')](_0x1b6cb7[_0xcef9('0x4c')]));this[_0xcef9('0x1a')](_0x1b6cb7[_0xcef9('0x4c')]);}}catch(_0x411d48){logger['error'](_0xcef9('0x4e'),_0x411d48[_0xcef9('0x3c')]);}};Acw['prototype'][_0xcef9('0x4f')]=function(_0x2983a5){try{if(this[_0xcef9('0x7')][_0x2983a5[_0xcef9('0x1c')]]&&this[_0xcef9('0x7')][_0x2983a5[_0xcef9('0x1c')]][_0xcef9('0x50')]===_0xcef9('0x51')){if(this['agents'][_0x2983a5[_0xcef9('0x1b')]]){logger[_0xcef9('0x25')](_0xcef9('0x52'),_0x2983a5['uniqueid'],_0x2983a5['interface'],_0x2983a5[_0xcef9('0x1c')]);return RpcUser[_0xcef9('0x28')](this[_0xcef9('0x8')][_0x2983a5[_0xcef9('0x1b')]],_0xcef9('0x53'),_0x2983a5['uniqueid']);}}}catch(_0x1c5d05){logger[_0xcef9('0x34')](_0xcef9('0x54'),_0x1c5d05['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 1f6fa4c..604b1fc 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 _0xc355=['once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x423781,_0x4fd89b){var _0x522226=function(_0x18bcfd){while(--_0x18bcfd){_0x423781['push'](_0x423781['shift']());}};_0x522226(++_0x4fd89b);}(_0xc355,0x1cf));var _0x5c35=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0xc355[_0x4f8d61];return _0x3bc078;};'use strict';var Manager=require(_0x5c35('0x0'));var BPromise=require(_0x5c35('0x1'));var moment=require('moment');var util=require(_0x5c35('0x2'));var _=require(_0x5c35('0x3'));var logger=require(_0x5c35('0x4'))(_0x5c35('0x5'));var config=require(_0x5c35('0x6'));var ami=new Manager(config[_0x5c35('0x7')]['port'],config['asterisk']['ip'],config['asterisk'][_0x5c35('0x8')],config[_0x5c35('0x7')][_0x5c35('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x5c35('0xa')](ami[_0x5c35('0xb')]);function error(_0x1feedf){logger[_0x5c35('0xc')](util[_0x5c35('0xd')](_0x5c35('0xe'),config[_0x5c35('0x7')]['username'],config[_0x5c35('0x7')]['ip'],config[_0x5c35('0x7')]['port'],util[_0x5c35('0xf')](_0x1feedf,![],null)));}function close(){logger[_0x5c35('0xc')](util[_0x5c35('0xd')](_0x5c35('0x10'),config[_0x5c35('0x7')][_0x5c35('0x8')],config['asterisk']['ip'],config[_0x5c35('0x7')][_0x5c35('0x11')]));}ami[_0x5c35('0x12')]=function(){return function(){return ami[_0x5c35('0x13')]({'action':_0x5c35('0x14')});};};ami[_0x5c35('0x15')]=function(){return function(){return ami[_0x5c35('0x13')]({'action':_0x5c35('0x16')});};};ami[_0x5c35('0x17')]=function(){return function(){return ami[_0x5c35('0x13')]({'action':'sippeerstatus'});};};ami[_0x5c35('0x18')]=function(){return function(){return ami['Action']({'action':_0x5c35('0x19')});};};ami[_0x5c35('0x1a')]=function(){return function(){return ami[_0x5c35('0x13')]({'action':_0x5c35('0x1b')});};};function connect(_0x265e77){logger['info'](util[_0x5c35('0xd')](_0x5c35('0x1c'),config[_0x5c35('0x7')][_0x5c35('0x8')],config['asterisk']['ip'],config[_0x5c35('0x7')][_0x5c35('0x11')]));ami[_0x5c35('0x1d')]('error',error);ami[_0x5c35('0x1d')](_0x5c35('0x1e'),close);}ami['on'](_0x5c35('0x1f'),connect);ami['on'](_0x5c35('0x20'),function(_0x3f6876){logger[_0x5c35('0x21')](util['format'](_0x5c35('0x22'),config['asterisk']['username'],config[_0x5c35('0x7')]['ip'],config[_0x5c35('0x7')][_0x5c35('0x11')],util[_0x5c35('0xf')](_0x3f6876,![],null)));});ami['on'](_0x5c35('0x23'),function(_0x190ae8){logger[_0x5c35('0x21')](util[_0x5c35('0xd')](_0x5c35('0x24'),config[_0x5c35('0x7')][_0x5c35('0x8')],config['asterisk']['ip'],config[_0x5c35('0x7')][_0x5c35('0x11')]));return BPromise[_0x5c35('0x25')]()[_0x5c35('0x26')](ami[_0x5c35('0x12')]())[_0x5c35('0x26')](ami[_0x5c35('0x15')]())[_0x5c35('0x26')](ami[_0x5c35('0x17')]())['then'](ami[_0x5c35('0x18')]())[_0x5c35('0x26')](ami['actionCoreShowChannels']())[_0x5c35('0x27')](function(_0x2a1c94){console[_0x5c35('0x28')](_0x2a1c94);});});ami['once'](_0x5c35('0xc'),error);ami[_0x5c35('0x1d')](_0x5c35('0x1e'),close);module['exports']=ami; \ No newline at end of file +var _0x293d=['port','keepConnected','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','info','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','resolve','then','actionCoreShowChannels','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x51c6d0,_0xb98516){var _0x4e0c6f=function(_0x2d0b5f){while(--_0x2d0b5f){_0x51c6d0['push'](_0x51c6d0['shift']());}};_0x4e0c6f(++_0xb98516);}(_0x293d,0xfa));var _0xd293=function(_0x2c8137,_0x16e9df){_0x2c8137=_0x2c8137-0x0;var _0xe7ac36=_0x293d[_0x2c8137];return _0xe7ac36;};'use strict';var Manager=require(_0xd293('0x0'));var BPromise=require(_0xd293('0x1'));var moment=require(_0xd293('0x2'));var util=require(_0xd293('0x3'));var _=require(_0xd293('0x4'));var logger=require(_0xd293('0x5'))(_0xd293('0x6'));var config=require(_0xd293('0x7'));var ami=new Manager(config[_0xd293('0x8')][_0xd293('0x9')],config[_0xd293('0x8')]['ip'],config[_0xd293('0x8')]['username'],config[_0xd293('0x8')]['password'],!![]);ami[_0xd293('0xa')]();ami['Action']=BPromise[_0xd293('0xb')](ami['action']);function error(_0x3e5d74){logger['error'](util[_0xd293('0xc')](_0xd293('0xd'),config[_0xd293('0x8')][_0xd293('0xe')],config[_0xd293('0x8')]['ip'],config[_0xd293('0x8')][_0xd293('0x9')],util[_0xd293('0xf')](_0x3e5d74,![],null)));}function close(){logger[_0xd293('0x10')](util[_0xd293('0xc')](_0xd293('0x11'),config['asterisk'][_0xd293('0xe')],config['asterisk']['ip'],config[_0xd293('0x8')][_0xd293('0x9')]));}ami[_0xd293('0x12')]=function(){return function(){return ami[_0xd293('0x13')]({'action':_0xd293('0x14')});};};ami[_0xd293('0x15')]=function(){return function(){return ami[_0xd293('0x13')]({'action':'devicestatelist'});};};ami[_0xd293('0x16')]=function(){return function(){return ami[_0xd293('0x13')]({'action':_0xd293('0x17')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xd293('0x13')]({'action':_0xd293('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xd293('0x13')]({'action':_0xd293('0x19')});};};function connect(_0x152af7){logger[_0xd293('0x1a')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xd293('0x8')][_0xd293('0xe')],config[_0xd293('0x8')]['ip'],config[_0xd293('0x8')][_0xd293('0x9')]));ami[_0xd293('0x1b')](_0xd293('0x10'),error);ami['once'](_0xd293('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0xd293('0x1d'),function(_0x1008ae){logger['info'](util[_0xd293('0xc')](_0xd293('0x1e'),config['asterisk'][_0xd293('0xe')],config[_0xd293('0x8')]['ip'],config[_0xd293('0x8')][_0xd293('0x9')],util[_0xd293('0xf')](_0x1008ae,![],null)));});ami['on'](_0xd293('0x1f'),function(_0x47cc2f){logger['info'](util['format'](_0xd293('0x20'),config[_0xd293('0x8')][_0xd293('0xe')],config[_0xd293('0x8')]['ip'],config[_0xd293('0x8')]['port']));return BPromise[_0xd293('0x21')]()[_0xd293('0x22')](ami['actionSipShowRegistry']())[_0xd293('0x22')](ami[_0xd293('0x15')]())[_0xd293('0x22')](ami[_0xd293('0x16')]())[_0xd293('0x22')](ami['actionQueueSummary']())[_0xd293('0x22')](ami[_0xd293('0x23')]())['catch'](function(_0x1854a8){console['log'](_0x1854a8);});});ami[_0xd293('0x1b')](_0xd293('0x10'),error);ami[_0xd293('0x1b')](_0xd293('0x1c'),close);module[_0xd293('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 9ad87e6..d3b3dcc 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xe706,0xa3));var _0x6e70=function(_0x5bfee6,_0x3e9443){_0x5bfee6=_0x5bfee6-0x0;var _0x4aad05=_0xe706[_0x5bfee6];return _0x4aad05;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x9bde,0xe1));var _0xe9bd=function(_0x17b64c,_0x1abe84){_0x17b64c=_0x17b64c-0x0;var _0x1ab1f6=_0x9bde[_0x17b64c];return _0x1ab1f6;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index da6cf50..3cadb95 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 _0xa882=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','format','dialCutDigit','substring','getQueue','queue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','scheduledat','countbusyretry','countcongestionretry'];(function(_0xe383c0,_0x305370){var _0x13a9a1=function(_0x3639f0){while(--_0x3639f0){_0xe383c0['push'](_0xe383c0['shift']());}};_0x13a9a1(++_0x305370);}(_0xa882,0x1d0));var _0x2a88=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xa882[_0x5608a3];return _0x1ed50a;};'use strict';var util=require(_0x2a88('0x0'));var _=require(_0x2a88('0x1'));var moment=require('moment');function checkNameSurname(_0x268c7e,_0x27857f,_0x1060a7){var _0x2293f7='';if(!_[_0x2a88('0x2')](_0x27857f)&&'string'===typeof _0x27857f){_0x2293f7+=_0x27857f;}if(!_[_0x2a88('0x2')](_0x1060a7)&&_0x2a88('0x3')===typeof _0x1060a7){_0x2293f7+='\x20'+_0x1060a7;}if(_0x2293f7!==''){return _0x2293f7;}return _0x268c7e;}function Action(_0x5e7b8d,_0x31cb53,_0xc636db){this[_0x2a88('0x4')]=_0x5e7b8d;this[_0x2a88('0x5')]=_0xc636db||undefined;this[_0x2a88('0x6')]=checkNameSurname(_0x31cb53[_0x2a88('0x7')][_0x2a88('0x8')],_0x31cb53['Contact'][_0x2a88('0x9')],_0x31cb53[_0x2a88('0x7')]['lastName']);this[_0x2a88('0xa')]=_0x31cb53[_0x2a88('0x7')]['phone'];this['queue']=_0x5e7b8d[_0x2a88('0x6')];this[_0x2a88('0xb')]=_0x31cb53['active']||![];this[_0x2a88('0xc')]=_0x5e7b8d['type'];this['dialQueueTimeout']=_0x5e7b8d['dialQueueTimeout']||0x3;this[_0x2a88('0xd')]=_0x31cb53[_0x2a88('0xd')];this[_0x2a88('0xe')]=_0x31cb53[_0x2a88('0xe')];this['countcongestionretry']=_0x31cb53[_0x2a88('0xf')];this[_0x2a88('0x10')]=_0x31cb53[_0x2a88('0x10')];this[_0x2a88('0x11')]=_0x31cb53[_0x2a88('0x11')];this[_0x2a88('0x12')]=_0x31cb53['countdropretry'];this[_0x2a88('0x13')]=_0x31cb53[_0x2a88('0x13')];this[_0x2a88('0x14')]=_0x31cb53['countmachineretry'];this['countagentrejectretry']=_0x31cb53['countagentrejectretry'];this[_0x2a88('0x15')]=_0x31cb53[_0x2a88('0x15')];this['ListId']=_0x31cb53[_0x2a88('0x16')];this['UserId']=_0x31cb53['UserId'];this[_0x2a88('0x17')]=_0x31cb53[_0x2a88('0x17')];this[_0x2a88('0x18')]=_0x31cb53[_0x2a88('0x18')];this[_0x2a88('0x19')]=_0x31cb53['id'];this[_0x2a88('0x1a')]=_0x31cb53[_0x2a88('0x7')][_0x2a88('0x9')]||'';this[_0x2a88('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a88('0x1c')]=_0x31cb53[_0x2a88('0x1c')];this['callbackuniqueid']=_0x31cb53[_0x2a88('0x1d')];this['callbackat']=_0x31cb53['callbackat'];this[_0x2a88('0x1e')]=_0x31cb53[_0x2a88('0x1e')];this[_0x2a88('0x1f')]='';this[_0x2a88('0x20')]='';}Action[_0x2a88('0x21')]['getCaller']=function(){return util[_0x2a88('0x22')]('\x22%s\x22\x20<%s>',this[_0x2a88('0x6')],this[_0x2a88('0x4')][_0x2a88('0x23')]>0x0?this[_0x2a88('0xa')][_0x2a88('0x24')](this[_0x2a88('0x4')][_0x2a88('0x23')]):this[_0x2a88('0xa')]);};Action[_0x2a88('0x21')][_0x2a88('0x25')]=function(){return this[_0x2a88('0x26')];};module[_0x2a88('0x27')]=Action; \ No newline at end of file +var _0x3c44=['uniqueid','Contact','phone','firstName','lastName','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','prototype','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue'];(function(_0x5e577e,_0x1ebc67){var _0x4e4fc0=function(_0x4a6aed){while(--_0x4a6aed){_0x5e577e['push'](_0x5e577e['shift']());}};_0x4e4fc0(++_0x1ebc67);}(_0x3c44,0x1a1));var _0x43c4=function(_0x502262,_0x3c5d68){_0x502262=_0x502262-0x0;var _0x302121=_0x3c44[_0x502262];return _0x302121;};'use strict';var util=require(_0x43c4('0x0'));var _=require(_0x43c4('0x1'));var moment=require(_0x43c4('0x2'));function checkNameSurname(_0x152d47,_0x338511,_0x19c387){var _0x30ee81='';if(!_['isNil'](_0x338511)&&_0x43c4('0x3')===typeof _0x338511){_0x30ee81+=_0x338511;}if(!_[_0x43c4('0x4')](_0x19c387)&&_0x43c4('0x3')===typeof _0x19c387){_0x30ee81+='\x20'+_0x19c387;}if(_0x30ee81!==''){return _0x30ee81;}return _0x152d47;}function Action(_0x1ec5b4,_0x144c7a,_0x13e0d5){this[_0x43c4('0x5')]=_0x1ec5b4;this[_0x43c4('0x6')]=_0x13e0d5||undefined;this['name']=checkNameSurname(_0x144c7a[_0x43c4('0x7')][_0x43c4('0x8')],_0x144c7a['Contact'][_0x43c4('0x9')],_0x144c7a[_0x43c4('0x7')][_0x43c4('0xa')]);this['number']=_0x144c7a[_0x43c4('0x7')][_0x43c4('0x8')];this[_0x43c4('0xb')]=_0x1ec5b4[_0x43c4('0xc')];this['active']=_0x144c7a['active']||![];this[_0x43c4('0xd')]=_0x1ec5b4[_0x43c4('0xd')];this[_0x43c4('0xe')]=_0x1ec5b4[_0x43c4('0xe')]||0x3;this[_0x43c4('0xf')]=_0x144c7a[_0x43c4('0xf')];this[_0x43c4('0x10')]=_0x144c7a[_0x43c4('0x10')];this[_0x43c4('0x11')]=_0x144c7a['countcongestionretry'];this[_0x43c4('0x12')]=_0x144c7a['countnoanswerretry'];this[_0x43c4('0x13')]=_0x144c7a[_0x43c4('0x13')];this[_0x43c4('0x14')]=_0x144c7a[_0x43c4('0x14')];this['countabandonedretry']=_0x144c7a[_0x43c4('0x15')];this[_0x43c4('0x16')]=_0x144c7a[_0x43c4('0x16')];this[_0x43c4('0x17')]=_0x144c7a[_0x43c4('0x17')];this[_0x43c4('0x18')]=_0x144c7a[_0x43c4('0x18')];this['ListId']=_0x144c7a[_0x43c4('0x19')];this['UserId']=_0x144c7a[_0x43c4('0x1a')];this[_0x43c4('0x1b')]=_0x144c7a['VoiceQueueId'];this['CampaignId']=_0x144c7a[_0x43c4('0x1c')];this[_0x43c4('0x1d')]=_0x144c7a['id'];this[_0x43c4('0x1e')]=_0x144c7a[_0x43c4('0x7')]['firstName']||'';this['starttime']=moment()[_0x43c4('0x1f')](_0x43c4('0x20'));this[_0x43c4('0x21')]=_0x144c7a[_0x43c4('0x21')];this[_0x43c4('0x22')]=_0x144c7a['callbackuniqueid'];this[_0x43c4('0x23')]=_0x144c7a[_0x43c4('0x23')];this[_0x43c4('0x24')]=_0x144c7a[_0x43c4('0x24')];this[_0x43c4('0x25')]='';this[_0x43c4('0x26')]='';}Action['prototype'][_0x43c4('0x27')]=function(){return util[_0x43c4('0x1f')](_0x43c4('0x28'),this[_0x43c4('0xc')],this[_0x43c4('0x5')]['dialCutDigit']>0x0?this['number'][_0x43c4('0x29')](this[_0x43c4('0x5')][_0x43c4('0x2a')]):this[_0x43c4('0x2b')]);};Action[_0x43c4('0x2c')][_0x43c4('0x2d')]=function(){return this['queue'];};module[_0x43c4('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 62888c5..6060581 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 _0xcd97=['diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xcd97,0xad));var _0x7cd9=function(_0x5055f1,_0x3cbb87){_0x5055f1=_0x5055f1-0x0;var _0x28a9f0=_0xcd97[_0x5055f1];return _0x28a9f0;};'use strict';var util=require(_0x7cd9('0x0'));var _=require(_0x7cd9('0x1'));var moment=require('moment');function getSeconds(_0x3a1eca,_0x4b1def){var _0xd98a25=moment(_0x3a1eca)[_0x7cd9('0x2')](0x0);var _0x33625b=moment(_0x4b1def)[_0x7cd9('0x2')](0x0);return _0xd98a25[_0x7cd9('0x3')](_0x33625b,'seconds');}function AgentComplete(_0x2c6c76,_0x5965fa){this[_0x7cd9('0x4')]=0x4;this[_0x7cd9('0x5')]='Answer';this[_0x7cd9('0x6')]=_0x2c6c76[_0x7cd9('0x6')];this[_0x7cd9('0x7')]=_0x2c6c76[_0x7cd9('0x7')];this[_0x7cd9('0x8')]=_0x2c6c76[_0x7cd9('0x7')]===_0x7cd9('0x9')?_0x7cd9('0xa'):_0x2c6c76[_0x7cd9('0x7')];this[_0x7cd9('0xb')]=_0x2c6c76[_0x7cd9('0xb')];this['countcongestionretry']=_0x2c6c76[_0x7cd9('0xc')];this[_0x7cd9('0xd')]=_0x2c6c76[_0x7cd9('0xd')];this[_0x7cd9('0xe')]=_0x2c6c76[_0x7cd9('0xb')]+_0x2c6c76[_0x7cd9('0xc')]+_0x2c6c76[_0x7cd9('0xd')]+_0x2c6c76[_0x7cd9('0xf')]+_0x2c6c76[_0x7cd9('0x10')]+_0x2c6c76['countabandonedretry']+_0x2c6c76['countmachineretry']+_0x2c6c76[_0x7cd9('0x11')];this['countnosuchnumberretry']=_0x2c6c76[_0x7cd9('0xf')];this[_0x7cd9('0x10')]=_0x2c6c76[_0x7cd9('0x10')];this[_0x7cd9('0x12')]=_0x2c6c76['countabandonedretry'];this[_0x7cd9('0x13')]=_0x2c6c76[_0x7cd9('0x13')];this[_0x7cd9('0x11')]=_0x2c6c76[_0x7cd9('0x11')];this[_0x7cd9('0x14')]=_0x5965fa[_0x7cd9('0x14')];this['calleridname']=_0x2c6c76[_0x7cd9('0x15')];this['calleridnum']=_0x2c6c76[_0x7cd9('0x16')];this[_0x7cd9('0x17')]=_0x2c6c76['starttime'];this['responsetime']=_0x2c6c76[_0x7cd9('0x18')];this[_0x7cd9('0x19')]=_0x2c6c76[_0x7cd9('0x19')];this[_0x7cd9('0x1a')]=moment()[_0x7cd9('0x1b')](_0x7cd9('0x1c'));this[_0x7cd9('0x1d')]=getSeconds(_0x2c6c76[_0x7cd9('0x18')],_0x2c6c76['starttime']);this[_0x7cd9('0x1e')]=getSeconds(_0x2c6c76[_0x7cd9('0x19')],_0x2c6c76['responsetime']);this[_0x7cd9('0x1f')]=getSeconds(this[_0x7cd9('0x1a')],_0x2c6c76[_0x7cd9('0x19')]);this[_0x7cd9('0xa')]=_0x5965fa[_0x7cd9('0xa')];this[_0x7cd9('0x20')]=_0x5965fa[_0x7cd9('0x20')];this['reason']=_0x5965fa[_0x7cd9('0x21')];this['callback']=_0x2c6c76['callback'];this[_0x7cd9('0x22')]=_0x2c6c76[_0x7cd9('0x22')];this[_0x7cd9('0x23')]=_0x2c6c76[_0x7cd9('0x23')];this[_0x7cd9('0x24')]=_0x2c6c76[_0x7cd9('0x24')];this['ContactId']=_0x2c6c76['ContactId'];this['ListId']=_0x2c6c76[_0x7cd9('0x25')];this['UserId']=_0x2c6c76[_0x7cd9('0x26')];this[_0x7cd9('0x27')]=_0x2c6c76[_0x7cd9('0x27')];this['CampaignId']=_0x2c6c76[_0x7cd9('0x28')];this[_0x7cd9('0x29')]=_0x2c6c76[_0x7cd9('0x29')]||'';this[_0x7cd9('0x2a')]=_0x2c6c76['originatecalleridname']||'';}module[_0x7cd9('0x2b')]=AgentComplete; \ No newline at end of file +var _0xe0b4=['statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','state'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xe0b4,0x190));var _0x4e0b=function(_0xdd696,_0x1b5dc0){_0xdd696=_0xdd696-0x0;var _0x1a17c1=_0xe0b4[_0xdd696];return _0x1a17c1;};'use strict';var util=require(_0x4e0b('0x0'));var _=require(_0x4e0b('0x1'));var moment=require('moment');function getSeconds(_0x569dc4,_0x22862b){var _0x3cfa21=moment(_0x569dc4)[_0x4e0b('0x2')](0x0);var _0x9a24cc=moment(_0x22862b)['milliseconds'](0x0);return _0x3cfa21['diff'](_0x9a24cc,_0x4e0b('0x3'));}function AgentComplete(_0x3eb5a5,_0x1c6ebb){this[_0x4e0b('0x4')]=0x4;this[_0x4e0b('0x5')]=_0x4e0b('0x6');this[_0x4e0b('0x7')]=_0x3eb5a5[_0x4e0b('0x7')];this[_0x4e0b('0x8')]=_0x3eb5a5['type'];this['campaigntype']=_0x3eb5a5['type']===_0x4e0b('0x9')?'queue':_0x3eb5a5[_0x4e0b('0x8')];this[_0x4e0b('0xa')]=_0x3eb5a5[_0x4e0b('0xa')];this[_0x4e0b('0xb')]=_0x3eb5a5[_0x4e0b('0xb')];this[_0x4e0b('0xc')]=_0x3eb5a5[_0x4e0b('0xc')];this[_0x4e0b('0xd')]=_0x3eb5a5[_0x4e0b('0xa')]+_0x3eb5a5[_0x4e0b('0xb')]+_0x3eb5a5[_0x4e0b('0xc')]+_0x3eb5a5[_0x4e0b('0xe')]+_0x3eb5a5[_0x4e0b('0xf')]+_0x3eb5a5[_0x4e0b('0x10')]+_0x3eb5a5[_0x4e0b('0x11')]+_0x3eb5a5[_0x4e0b('0x12')];this[_0x4e0b('0xe')]=_0x3eb5a5[_0x4e0b('0xe')];this[_0x4e0b('0xf')]=_0x3eb5a5[_0x4e0b('0xf')];this[_0x4e0b('0x10')]=_0x3eb5a5[_0x4e0b('0x10')];this[_0x4e0b('0x11')]=_0x3eb5a5[_0x4e0b('0x11')];this[_0x4e0b('0x12')]=_0x3eb5a5['countagentrejectretry'];this[_0x4e0b('0x13')]=_0x1c6ebb[_0x4e0b('0x13')];this[_0x4e0b('0x14')]=_0x3eb5a5['name'];this['calleridnum']=_0x3eb5a5[_0x4e0b('0x15')];this[_0x4e0b('0x16')]=_0x3eb5a5[_0x4e0b('0x16')];this[_0x4e0b('0x17')]=_0x3eb5a5[_0x4e0b('0x17')];this['answertime']=_0x3eb5a5[_0x4e0b('0x18')];this[_0x4e0b('0x19')]=moment()[_0x4e0b('0x1a')](_0x4e0b('0x1b'));this[_0x4e0b('0x1c')]=getSeconds(_0x3eb5a5[_0x4e0b('0x17')],_0x3eb5a5[_0x4e0b('0x16')]);this[_0x4e0b('0x1d')]=getSeconds(_0x3eb5a5[_0x4e0b('0x18')],_0x3eb5a5[_0x4e0b('0x17')]);this['talktime']=getSeconds(this[_0x4e0b('0x19')],_0x3eb5a5['answertime']);this[_0x4e0b('0x1e')]=_0x1c6ebb[_0x4e0b('0x1e')];this[_0x4e0b('0x1f')]=_0x1c6ebb[_0x4e0b('0x1f')];this['reason']=_0x1c6ebb[_0x4e0b('0x20')];this[_0x4e0b('0x21')]=_0x3eb5a5['callback'];this[_0x4e0b('0x22')]=_0x3eb5a5[_0x4e0b('0x22')];this[_0x4e0b('0x23')]=_0x3eb5a5[_0x4e0b('0x23')];this[_0x4e0b('0x24')]=_0x3eb5a5[_0x4e0b('0x24')];this[_0x4e0b('0x25')]=_0x3eb5a5[_0x4e0b('0x25')];this[_0x4e0b('0x26')]=_0x3eb5a5[_0x4e0b('0x26')];this['UserId']=_0x3eb5a5[_0x4e0b('0x27')];this['VoiceQueueId']=_0x3eb5a5[_0x4e0b('0x28')];this[_0x4e0b('0x29')]=_0x3eb5a5[_0x4e0b('0x29')];this[_0x4e0b('0x2a')]=_0x3eb5a5[_0x4e0b('0x2a')]||'';this[_0x4e0b('0x2b')]=_0x3eb5a5[_0x4e0b('0x2b')]||'';}module[_0x4e0b('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 447be3a..a88c0e5 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 _0x4300=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x907c3d,_0x1e8850){var _0x16684c=function(_0x1ee01b){while(--_0x1ee01b){_0x907c3d['push'](_0x907c3d['shift']());}};_0x16684c(++_0x1e8850);}(_0x4300,0x1a6));var _0x0430=function(_0x49d501,_0x3596f7){_0x49d501=_0x49d501-0x0;var _0x5272ae=_0x4300[_0x49d501];return _0x5272ae;};'use strict';var util=require(_0x0430('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x481e26,_0x54a4da){var _0x4388ad=moment(_0x481e26)[_0x0430('0x1')](0x0);var _0x1c139f=moment(_0x54a4da)[_0x0430('0x1')](0x0);return _0x4388ad[_0x0430('0x2')](_0x1c139f,'seconds');}function Final(_0x46b412){this['uniqueid']=_0x46b412[_0x0430('0x3')];this['scheduledat']=_0x46b412[_0x0430('0x4')];this[_0x0430('0x5')]=_0x46b412[_0x0430('0x5')];this[_0x0430('0x6')]=_0x46b412[_0x0430('0x5')]===_0x0430('0x7')?_0x0430('0x8'):_0x46b412[_0x0430('0x5')];this[_0x0430('0x9')]=_0x46b412['countbusyretry'];this[_0x0430('0xa')]=_0x46b412[_0x0430('0xa')];this[_0x0430('0xb')]=_0x46b412[_0x0430('0xb')];this[_0x0430('0xc')]=_0x46b412[_0x0430('0x9')]+_0x46b412[_0x0430('0xa')]+_0x46b412[_0x0430('0xb')]+_0x46b412['countnosuchnumberretry']+_0x46b412['countdropretry']+_0x46b412[_0x0430('0xd')]+_0x46b412[_0x0430('0xe')]+_0x46b412[_0x0430('0xf')];this[_0x0430('0x10')]=_0x46b412[_0x0430('0x10')];this[_0x0430('0x11')]=_0x46b412[_0x0430('0x11')];this['countabandonedretry']=_0x46b412[_0x0430('0xd')];this[_0x0430('0xe')]=_0x46b412[_0x0430('0xe')];this[_0x0430('0xf')]=_0x46b412['countagentrejectretry'];this['queue']=_0x46b412['queue'];this[_0x0430('0x12')]=_0x46b412['calleridname'];this['calleridnum']=_0x46b412[_0x0430('0x13')];this[_0x0430('0x14')]=_0x46b412[_0x0430('0x14')];this[_0x0430('0x15')]=_0x46b412[_0x0430('0x15')];this['endtime']=_0x46b412['responsetime'];this[_0x0430('0x16')]=_0x46b412[_0x0430('0x16')]||0x0;this[_0x0430('0x17')]=_0x46b412[_0x0430('0x17')]||0x0;this['talktime']=_0x46b412['talktime']||0x0;this[_0x0430('0x18')]=_0x46b412[_0x0430('0x18')];this[_0x0430('0x19')]=_0x46b412[_0x0430('0x19')];this[_0x0430('0x1a')]=_0x46b412[_0x0430('0x1a')];this['recallme']=_0x46b412[_0x0430('0x1b')];this[_0x0430('0x1c')]=_0x46b412[_0x0430('0x1c')];this[_0x0430('0x1d')]=_0x46b412['ListId'];this[_0x0430('0x1e')]=_0x46b412[_0x0430('0x1e')];this[_0x0430('0x1f')]=_0x46b412[_0x0430('0x1f')];this[_0x0430('0x20')]=_0x46b412[_0x0430('0x20')];this[_0x0430('0x21')]=_0x46b412[_0x0430('0x21')]||'';this[_0x0430('0x22')]=_0x46b412['originatecalleridname']||'';}module[_0x0430('0x23')]=Final; \ No newline at end of file +var _0x06f4=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x366bc3,_0x732556){var _0x1683fc=function(_0x369664){while(--_0x369664){_0x366bc3['push'](_0x366bc3['shift']());}};_0x1683fc(++_0x732556);}(_0x06f4,0x136));var _0x406f=function(_0x33a7db,_0x3348bb){_0x33a7db=_0x33a7db-0x0;var _0x4cecdb=_0x06f4[_0x33a7db];return _0x4cecdb;};'use strict';var util=require(_0x406f('0x0'));var _=require(_0x406f('0x1'));var moment=require('moment');function getSeconds(_0x203c04,_0x276a15){var _0x58cd7d=moment(_0x203c04)['milliseconds'](0x0);var _0x3a4ff0=moment(_0x276a15)['milliseconds'](0x0);return _0x58cd7d[_0x406f('0x2')](_0x3a4ff0,_0x406f('0x3'));}function Final(_0x3ab3d4){this[_0x406f('0x4')]=_0x3ab3d4['uniqueid'];this[_0x406f('0x5')]=_0x3ab3d4['scheduledat'];this[_0x406f('0x6')]=_0x3ab3d4[_0x406f('0x6')];this[_0x406f('0x7')]=_0x3ab3d4['type']===_0x406f('0x8')?'queue':_0x3ab3d4['type'];this[_0x406f('0x9')]=_0x3ab3d4['countbusyretry'];this[_0x406f('0xa')]=_0x3ab3d4['countcongestionretry'];this[_0x406f('0xb')]=_0x3ab3d4['countnoanswerretry'];this[_0x406f('0xc')]=_0x3ab3d4[_0x406f('0x9')]+_0x3ab3d4['countcongestionretry']+_0x3ab3d4[_0x406f('0xb')]+_0x3ab3d4[_0x406f('0xd')]+_0x3ab3d4[_0x406f('0xe')]+_0x3ab3d4[_0x406f('0xf')]+_0x3ab3d4[_0x406f('0x10')]+_0x3ab3d4[_0x406f('0x11')];this[_0x406f('0xd')]=_0x3ab3d4[_0x406f('0xd')];this[_0x406f('0xe')]=_0x3ab3d4[_0x406f('0xe')];this[_0x406f('0xf')]=_0x3ab3d4['countabandonedretry'];this[_0x406f('0x10')]=_0x3ab3d4[_0x406f('0x10')];this[_0x406f('0x11')]=_0x3ab3d4['countagentrejectretry'];this[_0x406f('0x12')]=_0x3ab3d4[_0x406f('0x12')];this['calleridname']=_0x3ab3d4['calleridname'];this[_0x406f('0x13')]=_0x3ab3d4[_0x406f('0x13')];this['starttime']=_0x3ab3d4[_0x406f('0x14')];this['responsetime']=_0x3ab3d4[_0x406f('0x15')];this[_0x406f('0x16')]=_0x3ab3d4[_0x406f('0x15')];this[_0x406f('0x17')]=_0x3ab3d4['ringtime']||0x0;this['holdtime']=_0x3ab3d4[_0x406f('0x18')]||0x0;this['talktime']=_0x3ab3d4[_0x406f('0x19')]||0x0;this['callback']=_0x3ab3d4[_0x406f('0x1a')];this[_0x406f('0x1b')]=_0x3ab3d4[_0x406f('0x1b')];this['callbackat']=_0x3ab3d4['callbackat'];this['recallme']=_0x3ab3d4[_0x406f('0x1c')];this[_0x406f('0x1d')]=_0x3ab3d4[_0x406f('0x1d')];this['ListId']=_0x3ab3d4[_0x406f('0x1e')];this['UserId']=_0x3ab3d4[_0x406f('0x1f')];this[_0x406f('0x20')]=_0x3ab3d4[_0x406f('0x20')];this[_0x406f('0x21')]=_0x3ab3d4[_0x406f('0x21')];this['originatecalleridnum']=_0x3ab3d4['originatecalleridnum']||'';this[_0x406f('0x22')]=_0x3ab3d4['originatecalleridname']||'';}module[_0x406f('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d146ddd..40a778a 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 _0x46af=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','endtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x46af,0x1c2));var _0xf46a=function(_0x4df837,_0x50e6b6){_0x4df837=_0x4df837-0x0;var _0x14a149=_0x46af[_0x4df837];return _0x14a149;};'use strict';var util=require(_0xf46a('0x0'));var _=require(_0xf46a('0x1'));var moment=require(_0xf46a('0x2'));function getSeconds(_0x273f5b,_0x1a01c8){var _0x2abc8b=moment(_0x273f5b)[_0xf46a('0x3')](0x0);var _0x5c0e75=moment(_0x1a01c8)[_0xf46a('0x3')](0x0);return _0x2abc8b['diff'](_0x5c0e75,_0xf46a('0x4'));}function Hangup(_0x4ab592,_0x2b6ab1){this[_0xf46a('0x5')]=0x4;this[_0xf46a('0x6')]='Answer';this['scheduledat']=_0x4ab592[_0xf46a('0x7')];this[_0xf46a('0x8')]=_0x4ab592['type'];this[_0xf46a('0x9')]=_0x4ab592[_0xf46a('0x8')]==='outbound'?_0xf46a('0xa'):_0x4ab592[_0xf46a('0x8')];this[_0xf46a('0xb')]=_0x4ab592[_0xf46a('0xb')];this[_0xf46a('0xc')]=_0x4ab592[_0xf46a('0xc')];this[_0xf46a('0xd')]=_0x4ab592['countnoanswerretry'];this[_0xf46a('0xe')]=_0x4ab592['countbusyretry']+_0x4ab592[_0xf46a('0xc')]+_0x4ab592[_0xf46a('0xd')]+_0x4ab592[_0xf46a('0xf')]+_0x4ab592[_0xf46a('0x10')]+_0x4ab592[_0xf46a('0x11')]+_0x4ab592[_0xf46a('0x12')]+_0x4ab592[_0xf46a('0x13')];this['countnosuchnumberretry']=_0x4ab592[_0xf46a('0xf')];this[_0xf46a('0x10')]=_0x4ab592[_0xf46a('0x10')];this[_0xf46a('0x11')]=_0x4ab592[_0xf46a('0x11')];this[_0xf46a('0x12')]=_0x4ab592[_0xf46a('0x12')];this[_0xf46a('0x13')]=_0x4ab592[_0xf46a('0x13')];this[_0xf46a('0x14')]=_0x2b6ab1[_0xf46a('0x14')];this[_0xf46a('0x15')]=_0x4ab592[_0xf46a('0x16')];this[_0xf46a('0x17')]=_0x4ab592[_0xf46a('0x18')];this[_0xf46a('0x19')]=_0x4ab592[_0xf46a('0x19')];this[_0xf46a('0x1a')]=_0x4ab592[_0xf46a('0x1a')];this['endtime']=moment()[_0xf46a('0x1b')](_0xf46a('0x1c'));this[_0xf46a('0x1d')]=getSeconds(_0x4ab592[_0xf46a('0x1a')],_0x4ab592['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0xf46a('0x1e')],_0x4ab592[_0xf46a('0x1a')]);this['queue']=_0x4ab592[_0xf46a('0xa')];this['membername']='IVR';this[_0xf46a('0x1f')]=_0x2b6ab1[_0xf46a('0x20')];this[_0xf46a('0x21')]=_0x4ab592[_0xf46a('0x21')];this[_0xf46a('0x22')]=_0x4ab592[_0xf46a('0x22')];this[_0xf46a('0x23')]=_0x4ab592[_0xf46a('0x23')];this[_0xf46a('0x24')]=_0x4ab592[_0xf46a('0x24')];this[_0xf46a('0x25')]=_0x4ab592[_0xf46a('0x25')];this[_0xf46a('0x26')]=_0x4ab592[_0xf46a('0x26')];this[_0xf46a('0x27')]=_0x4ab592[_0xf46a('0x27')];this[_0xf46a('0x28')]=_0x4ab592[_0xf46a('0x28')];this[_0xf46a('0x29')]=_0x4ab592[_0xf46a('0x29')];}module['exports']=Hangup; \ No newline at end of file +var _0x94ac=['talktime','endtime','queue','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','format','holdtime'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x94ac,0x8b));var _0xc94a=function(_0xe573fd,_0x38c349){_0xe573fd=_0xe573fd-0x0;var _0x36700d=_0x94ac[_0xe573fd];return _0x36700d;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xc94a('0x0'));function getSeconds(_0x13e24e,_0x31091e){var _0x960356=moment(_0x13e24e)[_0xc94a('0x1')](0x0);var _0x1f4940=moment(_0x31091e)[_0xc94a('0x1')](0x0);return _0x960356[_0xc94a('0x2')](_0x1f4940,_0xc94a('0x3'));}function Hangup(_0x5d914b,_0x2c2600){this[_0xc94a('0x4')]=0x4;this['statedesc']=_0xc94a('0x5');this[_0xc94a('0x6')]=_0x5d914b['scheduledat'];this['type']=_0x5d914b[_0xc94a('0x7')];this[_0xc94a('0x8')]=_0x5d914b[_0xc94a('0x7')]===_0xc94a('0x9')?'queue':_0x5d914b[_0xc94a('0x7')];this[_0xc94a('0xa')]=_0x5d914b[_0xc94a('0xa')];this[_0xc94a('0xb')]=_0x5d914b['countcongestionretry'];this['countnoanswerretry']=_0x5d914b[_0xc94a('0xc')];this['countglobal']=_0x5d914b[_0xc94a('0xa')]+_0x5d914b[_0xc94a('0xb')]+_0x5d914b[_0xc94a('0xc')]+_0x5d914b['countnosuchnumberretry']+_0x5d914b[_0xc94a('0xd')]+_0x5d914b[_0xc94a('0xe')]+_0x5d914b[_0xc94a('0xf')]+_0x5d914b['countagentrejectretry'];this['countnosuchnumberretry']=_0x5d914b[_0xc94a('0x10')];this[_0xc94a('0xd')]=_0x5d914b[_0xc94a('0xd')];this[_0xc94a('0xe')]=_0x5d914b[_0xc94a('0xe')];this[_0xc94a('0xf')]=_0x5d914b['countmachineretry'];this[_0xc94a('0x11')]=_0x5d914b[_0xc94a('0x11')];this['uniqueid']=_0x2c2600[_0xc94a('0x12')];this['calleridname']=_0x5d914b[_0xc94a('0x13')];this[_0xc94a('0x14')]=_0x5d914b['number'];this[_0xc94a('0x15')]=_0x5d914b['starttime'];this[_0xc94a('0x16')]=_0x5d914b[_0xc94a('0x16')];this['endtime']=moment()[_0xc94a('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x5d914b[_0xc94a('0x16')],_0x5d914b[_0xc94a('0x15')]);this[_0xc94a('0x18')]=0x0;this[_0xc94a('0x19')]=getSeconds(this[_0xc94a('0x1a')],_0x5d914b['responsetime']);this['queue']=_0x5d914b[_0xc94a('0x1b')];this[_0xc94a('0x1c')]=_0xc94a('0x1d');this[_0xc94a('0x1e')]=_0x2c2600['cause-txt'];this[_0xc94a('0x1f')]=_0x5d914b['callback'];this['callbackuniqueid']=_0x5d914b[_0xc94a('0x20')];this['callbackat']=_0x5d914b[_0xc94a('0x21')];this['recallme']=_0x5d914b[_0xc94a('0x22')];this[_0xc94a('0x23')]=_0x5d914b['ContactId'];this[_0xc94a('0x24')]=_0x5d914b[_0xc94a('0x24')];this[_0xc94a('0x25')]=_0x5d914b[_0xc94a('0x25')];this[_0xc94a('0x26')]=_0x5d914b[_0xc94a('0x26')];this[_0xc94a('0x27')]=_0x5d914b['CampaignId'];}module[_0xc94a('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 040c75a..2a1628d 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 _0x60fc=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x60fc,0x128));var _0xc60f=function(_0x324d12,_0x259e6a){_0x324d12=_0x324d12-0x0;var _0x5a1d21=_0x60fc[_0x324d12];return _0x5a1d21;};'use strict';var util=require(_0xc60f('0x0'));var _=require(_0xc60f('0x1'));var moment=require(_0xc60f('0x2'));function getSeconds(_0x19c6e7,_0x586861){var _0x8d5c2=moment(_0x19c6e7)[_0xc60f('0x3')](0x0);var _0x21090a=moment(_0x586861)['milliseconds'](0x0);return _0x8d5c2['diff'](_0x21090a,'seconds');}function History(_0x29ac77){this[_0xc60f('0x4')]=_0x29ac77['uniqueid'];this['scheduledat']=_0x29ac77['scheduledat']||undefined;this['type']=_0x29ac77[_0xc60f('0x5')];this[_0xc60f('0x6')]=_0x29ac77[_0xc60f('0x5')]===_0xc60f('0x7')?_0xc60f('0x8'):_0x29ac77[_0xc60f('0x5')];this[_0xc60f('0x9')]=_0x29ac77[_0xc60f('0x9')];this[_0xc60f('0xa')]=_0x29ac77['countcongestionretry'];this[_0xc60f('0xb')]=_0x29ac77[_0xc60f('0xb')];this[_0xc60f('0xc')]=_0x29ac77[_0xc60f('0x9')]+_0x29ac77[_0xc60f('0xa')]+_0x29ac77['countnoanswerretry']+_0x29ac77[_0xc60f('0xd')]+_0x29ac77[_0xc60f('0xe')]+_0x29ac77['countabandonedretry']+_0x29ac77[_0xc60f('0xf')]+_0x29ac77[_0xc60f('0x10')];this['countnosuchnumberretry']=_0x29ac77[_0xc60f('0xd')];this[_0xc60f('0xe')]=_0x29ac77[_0xc60f('0xe')];this[_0xc60f('0x11')]=_0x29ac77['countabandonedretry'];this['countmachineretry']=_0x29ac77[_0xc60f('0xf')];this['countagentrejectretry']=_0x29ac77['countagentrejectretry'];this[_0xc60f('0x8')]=_0x29ac77[_0xc60f('0x8')];this[_0xc60f('0x12')]=_0x29ac77['name'];this[_0xc60f('0x13')]=_0x29ac77['number'];this['starttime']=_0x29ac77[_0xc60f('0x14')];this[_0xc60f('0x15')]=_0x29ac77[_0xc60f('0x15')];this[_0xc60f('0x16')]=_0x29ac77[_0xc60f('0x15')];this[_0xc60f('0x17')]=getSeconds(_0x29ac77[_0xc60f('0x15')],_0x29ac77['starttime']);this['holdtime']=0x0;this[_0xc60f('0x18')]=0x0;this[_0xc60f('0x19')]=_0x29ac77[_0xc60f('0x19')];this[_0xc60f('0x1a')]=_0x29ac77['callbackuniqueid'];this[_0xc60f('0x1b')]=_0x29ac77[_0xc60f('0x1b')];this[_0xc60f('0x1c')]=_0x29ac77['recallme'];this['ContactId']=_0x29ac77[_0xc60f('0x1d')];this[_0xc60f('0x1e')]=_0x29ac77[_0xc60f('0x1e')];this[_0xc60f('0x1f')]=_0x29ac77[_0xc60f('0x1f')];this[_0xc60f('0x20')]=_0x29ac77[_0xc60f('0x20')];this[_0xc60f('0x21')]=_0x29ac77[_0xc60f('0x21')];this[_0xc60f('0x22')]=_0x29ac77[_0xc60f('0x22')]||'';this['originatecalleridname']=_0x29ac77[_0xc60f('0x23')]||'';}module['exports']=History; \ No newline at end of file +var _0x3b4f=['countmachineretry','countagentrejectretry','countnosuchnumberretry','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry'];(function(_0x56ca58,_0x3d5326){var _0x58cf12=function(_0x567f75){while(--_0x567f75){_0x56ca58['push'](_0x56ca58['shift']());}};_0x58cf12(++_0x3d5326);}(_0x3b4f,0x176));var _0xf3b4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3b4f[_0x4565bf];return _0x5610ba;};'use strict';var util=require('util');var _=require(_0xf3b4('0x0'));var moment=require(_0xf3b4('0x1'));function getSeconds(_0x2a2b5a,_0x38eca7){var _0x1153ea=moment(_0x2a2b5a)[_0xf3b4('0x2')](0x0);var _0x1eb2ca=moment(_0x38eca7)[_0xf3b4('0x2')](0x0);return _0x1153ea[_0xf3b4('0x3')](_0x1eb2ca,'seconds');}function History(_0x262b3e){this[_0xf3b4('0x4')]=_0x262b3e['uniqueid'];this[_0xf3b4('0x5')]=_0x262b3e[_0xf3b4('0x5')]||undefined;this[_0xf3b4('0x6')]=_0x262b3e[_0xf3b4('0x6')];this[_0xf3b4('0x7')]=_0x262b3e[_0xf3b4('0x6')]===_0xf3b4('0x8')?_0xf3b4('0x9'):_0x262b3e['type'];this['countbusyretry']=_0x262b3e['countbusyretry'];this[_0xf3b4('0xa')]=_0x262b3e[_0xf3b4('0xa')];this[_0xf3b4('0xb')]=_0x262b3e['countnoanswerretry'];this[_0xf3b4('0xc')]=_0x262b3e[_0xf3b4('0xd')]+_0x262b3e[_0xf3b4('0xa')]+_0x262b3e['countnoanswerretry']+_0x262b3e['countnosuchnumberretry']+_0x262b3e[_0xf3b4('0xe')]+_0x262b3e[_0xf3b4('0xf')]+_0x262b3e[_0xf3b4('0x10')]+_0x262b3e[_0xf3b4('0x11')];this[_0xf3b4('0x12')]=_0x262b3e[_0xf3b4('0x12')];this['countdropretry']=_0x262b3e[_0xf3b4('0xe')];this[_0xf3b4('0xf')]=_0x262b3e[_0xf3b4('0xf')];this[_0xf3b4('0x10')]=_0x262b3e['countmachineretry'];this['countagentrejectretry']=_0x262b3e[_0xf3b4('0x11')];this[_0xf3b4('0x9')]=_0x262b3e[_0xf3b4('0x9')];this['calleridname']=_0x262b3e[_0xf3b4('0x13')];this['calleridnum']=_0x262b3e[_0xf3b4('0x14')];this[_0xf3b4('0x15')]=_0x262b3e[_0xf3b4('0x15')];this[_0xf3b4('0x16')]=_0x262b3e[_0xf3b4('0x16')];this[_0xf3b4('0x17')]=_0x262b3e['responsetime'];this[_0xf3b4('0x18')]=getSeconds(_0x262b3e[_0xf3b4('0x16')],_0x262b3e[_0xf3b4('0x15')]);this[_0xf3b4('0x19')]=0x0;this[_0xf3b4('0x1a')]=0x0;this[_0xf3b4('0x1b')]=_0x262b3e[_0xf3b4('0x1b')];this[_0xf3b4('0x1c')]=_0x262b3e[_0xf3b4('0x1c')];this[_0xf3b4('0x1d')]=_0x262b3e[_0xf3b4('0x1d')];this[_0xf3b4('0x1e')]=_0x262b3e[_0xf3b4('0x1e')];this[_0xf3b4('0x1f')]=_0x262b3e[_0xf3b4('0x1f')];this[_0xf3b4('0x20')]=_0x262b3e[_0xf3b4('0x20')];this[_0xf3b4('0x21')]=_0x262b3e['UserId'];this[_0xf3b4('0x22')]=_0x262b3e[_0xf3b4('0x22')];this[_0xf3b4('0x23')]=_0x262b3e[_0xf3b4('0x23')];this[_0xf3b4('0x24')]=_0x262b3e[_0xf3b4('0x24')]||'';this[_0xf3b4('0x25')]=_0x262b3e[_0xf3b4('0x25')]||'';}module[_0xf3b4('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0479d03..1a578a1 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 _0x5f6a=['Global:\x20','Timezone:\x20','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','handleIvr','checkIfTime','dialTimezone','checkDialMethod','[syncQueueSummary]','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialOriginateCallerIdNumber','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','ACTIVE','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Error','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','[uniqueid]','[actions]','clearZombieChannels','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','trunks','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','buildObj','amd','[syncHangupInAMD][createHistory]','value','MACHINE','AMD','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','[rescheduleContact][Machine]','countcongestionretry','countnosuchnumberretry','countabandonedretry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','agiafterat','dialQueueProject2','countdropretry','queueCallerAbandonCreateState','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncNewExten','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','preview','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTime','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','length','command','interval','content','iftime\x20%s,%s','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]'];(function(_0x4f0c65,_0x8695c0){var _0x55af3f=function(_0x348d8b){while(--_0x348d8b){_0x4f0c65['push'](_0x4f0c65['shift']());}};_0x55af3f(++_0x8695c0);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x49f472,_0x23a0a4){_0x49f472=_0x49f472-0x0;var _0x56ab2a=_0x5f6a[_0x49f472];return _0x56ab2a;};'use strict';var util=require(_0xa5f6('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xa5f6('0x1'));var moment=require(_0xa5f6('0x2'));var rr=require('rr');var md5=require(_0xa5f6('0x3'));var Redis=require(_0xa5f6('0x4'));var ut=require('../preview/util/util');var config=require(_0xa5f6('0x5'));var logger=require(_0xa5f6('0x6'))(_0xa5f6('0x7'));var loggerBooked=require(_0xa5f6('0x6'))(_0xa5f6('0x8'));var loggerPredictive=require(_0xa5f6('0x6'))(_0xa5f6('0x9'));var loggerPredictiveCalls=require(_0xa5f6('0x6'))(_0xa5f6('0xa'));var loggerSyncQueueSummary=require(_0xa5f6('0x6'))('syncQueueSummary');var ami=require('../ami');config['redis']=_[_0xa5f6('0xb')](config[_0xa5f6('0xc')],{'host':_0xa5f6('0xd'),'port':0x18eb});var io=require(_0xa5f6('0xe'))(new Redis(config[_0xa5f6('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xa5f6('0xf'));var cmHopperBlack=require(_0xa5f6('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xa5f6('0x11'));var History=require('./history');var Final=require(_0xa5f6('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xa5f6('0x13'));var Hangup=require(_0xa5f6('0x14'));var ipAgi=process['env'][_0xa5f6('0x15')]||_0xa5f6('0x16');var strategy={'rrmemory':_0xa5f6('0x17'),'roundrobin':_0xa5f6('0x18')};var Sequence=function(){};Sequence['prototype'][_0xa5f6('0x19')]=function(_0x20db76){this[_0xa5f6('0x1a')]=this['tail']?this[_0xa5f6('0x1a')][_0xa5f6('0x1b')](_0x20db76):_0x20db76();};function Dialer(_0x1c53a1,_0xdda598){this[_0xa5f6('0x1c')]=new Sequence();this['preview']=_0xdda598;this[_0xa5f6('0x1d')]=_0x1c53a1[_0xa5f6('0x1d')];this['campaigns']=_0x1c53a1[_0xa5f6('0x1e')];this[_0xa5f6('0x1f')]=_0x1c53a1[_0xa5f6('0x1f')];this['trunks']=_0x1c53a1['trunks'];this['maxNumberOriginate']=config[_0xa5f6('0x20')]||0x2;this['channels']={};this[_0xa5f6('0x21')]={};this[_0xa5f6('0x22')]={};this[_0xa5f6('0x23')]={};this['optionPredictive']={};this[_0xa5f6('0x24')]={};this['startProgressive']={};this[_0xa5f6('0x25')]={};this[_0xa5f6('0x26')]={};this[_0xa5f6('0x27')]={};ami['on'](_0xa5f6('0x28'),this[_0xa5f6('0x29')]['bind'](this));ami['on']('queuecallerabandon',this[_0xa5f6('0x2a')]['bind'](this));ami['on'](_0xa5f6('0x2b'),this['syncOriginateResponse'][_0xa5f6('0x2c')](this));ami['on'](_0xa5f6('0x2d'),this[_0xa5f6('0x2e')][_0xa5f6('0x2c')](this));ami['on'](_0xa5f6('0x2f'),this[_0xa5f6('0x30')][_0xa5f6('0x2c')](this));ami['on'](_0xa5f6('0x31'),this[_0xa5f6('0x32')][_0xa5f6('0x2c')](this));ami['on'](_0xa5f6('0x33'),this['syncNewExten']['bind'](this));ami['on'](_0xa5f6('0x34'),this[_0xa5f6('0x35')][_0xa5f6('0x2c')](this));ami['on'](_0xa5f6('0x36'),this[_0xa5f6('0x37')][_0xa5f6('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xa5f6('0x38')][_0xa5f6('0x2c')](this));this[_0xa5f6('0x39')]();this[_0xa5f6('0x3a')]();}function isNotNull(_0x3c47c5){return _0x3c47c5!==null&&!_[_0xa5f6('0x3b')](_0x3c47c5);}function checkIsLoggedIn(_0x1bc4b8,_0x249ed9){return function(){if(_0x249ed9<=0x0){_0x1bc4b8['message']=_0xa5f6('0x3c');throw _0x1bc4b8[_0xa5f6('0x3d')]+_0xa5f6('0x3e');}};}function isActive(_0x3f2ef0){return _0x3f2ef0;}function checkIsActive(_0x19e522,_0x4bc914){return function(){if(!isActive(_0x4bc914)){_0x19e522[_0xa5f6('0x3f')]=_0xa5f6('0x40');throw _0x19e522[_0xa5f6('0x3d')]+'\x20NOT\x20Active';}};}function checkInterval(_0x3fcefb){return function(){if(!isNotNull(_0x3fcefb[_0xa5f6('0x41')])){_0x3fcefb[_0xa5f6('0x3f')]=_0xa5f6('0x42');throw _0x3fcefb[_0xa5f6('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3fcefb[_0xa5f6('0x41')][_0xa5f6('0x43')])){_0x3fcefb[_0xa5f6('0x3f')]=_0xa5f6('0x42');throw _0x3fcefb['name']+_0xa5f6('0x44');}if(!isNotNull(_[_0xa5f6('0x45')](_0x3fcefb[_0xa5f6('0x41')][_0xa5f6('0x43')]))){_0x3fcefb['message']=_0xa5f6('0x42');throw _0x3fcefb[_0xa5f6('0x3d')]+_0xa5f6('0x44');}};}function msgResponse(_0xf6cde9,_0x4d2f20,_0x6e541e){return{'action':_0xf6cde9,'response':_0x4d2f20,'message':_0x6e541e,'stack':_0x6e541e};}function myreject(_0x4f3658){return function(_0x3b0219){return _0x4f3658(msgResponse('[ifTime][Action]',_0xa5f6('0x46'),JSON['stringify'](_0x3b0219)));};}function getSeconds(_0x5dcd01,_0x28c430){var _0x5c8521=moment(_0x5dcd01)[_0xa5f6('0x47')](0x0);var _0x357dee=moment(_0x28c430)['milliseconds'](0x0);return _0x5c8521[_0xa5f6('0x48')](_0x357dee,'seconds');}function emit(_0x4f53bf,_0x4b7cb1,_0x3d3453){io['to'](_0x4f53bf)[_0xa5f6('0x49')](_0x4b7cb1,_0x3d3453);}function emitVoiceQueueSummary(_0x137273){if(_0x137273[_0xa5f6('0x4a')]===_0xa5f6('0x4b')){var _0x116be1={'id':_0x137273['id'],'name':_0x137273[_0xa5f6('0x3d')],'strategy':_0x137273[_0xa5f6('0x4c')],'answered':_0x137273[_0xa5f6('0x4d')],'available':_0x137273[_0xa5f6('0x4e')],'loggedIn':_0x137273[_0xa5f6('0x4f')],'pTalking':_0x137273[_0xa5f6('0x50')],'sumBillable':_0x137273[_0xa5f6('0x51')],'sumDuration':_0x137273[_0xa5f6('0x52')],'sumHoldTime':_0x137273['sumHoldTime']||0x0,'talking':_0x137273[_0xa5f6('0x53')],'total':_0x137273[_0xa5f6('0x54')],'type':_0x137273[_0xa5f6('0x4a')],'unmanaged':_0x137273[_0xa5f6('0x55')],'abandoned':_0x137273[_0xa5f6('0x56')],'waiting':_0x137273[_0xa5f6('0x57')],'loggedInDb':_0x137273[_0xa5f6('0x58')],'dialActive':_0x137273[_0xa5f6('0x59')],'dialMethod':_0x137273[_0xa5f6('0x5a')],'dialOriginateCallerIdName':_0x137273['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x137273['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x137273['dialOriginateTimeout'],'dialPrefix':_0x137273[_0xa5f6('0x5b')],'outboundAnswerAgiCallsDay':_0x137273[_0xa5f6('0x5c')],'outboundAnswerCallsDay':_0x137273[_0xa5f6('0x5d')],'outboundBlacklistCallsDay':_0x137273[_0xa5f6('0x5e')],'outboundBusyCallsDay':_0x137273[_0xa5f6('0x5f')],'outboundCongestionCallsDay':_0x137273[_0xa5f6('0x60')],'outboundDropCallsDayACS':_0x137273['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x137273[_0xa5f6('0x61')],'outboundDropCallsDayTimeout':_0x137273[_0xa5f6('0x62')],'outboundNoAnswerCallsDay':_0x137273['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x137273[_0xa5f6('0x63')],'outboundOriginateFailureCallsDay':_0x137273[_0xa5f6('0x64')],'outboundReCallsDay':_0x137273[_0xa5f6('0x65')],'outboundRejectCallsDay':_0x137273[_0xa5f6('0x66')],'outboundUnknownCallsDay':_0x137273[_0xa5f6('0x67')],'predictiveIntervalAnsweredCalls':_0x137273[_0xa5f6('0x68')],'predictiveIntervalAvgHoldtime':_0x137273[_0xa5f6('0x69')],'predictiveIntervalAvgTalktime':_0x137273[_0xa5f6('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x137273[_0xa5f6('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x137273[_0xa5f6('0x6c')],'predictiveIntervalErlangCalls':_0x137273['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x137273['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x137273[_0xa5f6('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x137273[_0xa5f6('0x6e')],'predictiveIntervalPauses':_0x137273[_0xa5f6('0x6f')],'predictiveIntervalAvailable':_0x137273['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x137273[_0xa5f6('0x70')],'message':_0x137273[_0xa5f6('0x3f')],'originated':_0x137273[_0xa5f6('0x71')],'erlangCalls':_0x137273[_0xa5f6('0x72')],'erlangCallToSecond':_0x137273['erlangCallToSecond'],'erlangAbandonmentRate':_0x137273[_0xa5f6('0x73')],'erlangBusyFactor':_0x137273[_0xa5f6('0x74')],'startPredictive':_0x137273[_0xa5f6('0x24')],'startProgressive':_0x137273[_0xa5f6('0x75')]};if(_0x137273[_0xa5f6('0x76')]){_0x116be1[_0xa5f6('0x76')]={'id':_0x137273[_0xa5f6('0x76')]['id'],'name':_0x137273[_0xa5f6('0x76')][_0xa5f6('0x3d')],'active':_0x137273[_0xa5f6('0x76')][_0xa5f6('0x77')],'callerid':_0x137273[_0xa5f6('0x76')]['callerid']};}if(_0x137273[_0xa5f6('0x41')]){_0x116be1[_0xa5f6('0x41')]={'id':_0x137273[_0xa5f6('0x41')]['id'],'name':_0x137273[_0xa5f6('0x41')]['name']};}var _0x19d3b1=md5(JSON[_0xa5f6('0x78')](_0x116be1));if(_0x137273[_0xa5f6('0x3')]!==_0x19d3b1){_0x137273[_0xa5f6('0x3')]=_0x19d3b1;emit(util[_0xa5f6('0x79')](_0xa5f6('0x7a'),_0x116be1[_0xa5f6('0x3d')]),_0xa5f6('0x7b'),_0x116be1);}}}function emitCampaignSummary(_0x305651){if(_0x305651['type']===_0xa5f6('0x7c')){emit(util[_0xa5f6('0x79')](_0xa5f6('0x7d'),_0x305651[_0xa5f6('0x3d')]),_0xa5f6('0x7e'),_0x305651);}}function checkGetDataPredictive(_0x1ef4b0){if(isNotNull(_0x1ef4b0)&&!_[_0xa5f6('0x45')](_0x1ef4b0)){loggerPredictive['info'](_0xa5f6('0x7f'));loggerPredictive[_0xa5f6('0x80')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ef4b0[_0xa5f6('0x70')]);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x81'),_0x1ef4b0['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x82'),_0x1ef4b0[_0xa5f6('0x6c')]);loggerPredictive['info'](_0xa5f6('0x83'),_0x1ef4b0['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x84'),_0x1ef4b0['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xa5f6('0x85'),_0x1ef4b0[_0xa5f6('0x6a')]);loggerPredictive[_0xa5f6('0x80')]('---------------------------');if(_0x1ef4b0[_0xa5f6('0x70')]>0x0){if(!_['isUndefined'](_0x1ef4b0['predictiveIntervalAvgTalktime'])&&_0x1ef4b0[_0xa5f6('0x6a')]>0x0){return!![];}loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x86'));if(!_[_0xa5f6('0x3b')](_0x1ef4b0[_0xa5f6('0x69')])&&_0x1ef4b0['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xa5f6('0x80')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x87'));}}else{loggerPredictive['info'](_0xa5f6('0x88'));}return![];}function mergeDataErlangB(_0x28ca18){return function(_0x39dac3){loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x89'));loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x8a'),_0x39dac3[_0xa5f6('0x72')]);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x8b'),_0x39dac3[_0xa5f6('0x8c')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39dac3[_0xa5f6('0x73')]);loggerPredictive['info'](_0xa5f6('0x8d'),_0x39dac3[_0xa5f6('0x74')]);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x8e'),_0x39dac3[_0xa5f6('0x73')]);loggerPredictive[_0xa5f6('0x80')]('---------------------------');_[_0xa5f6('0x8f')](_0x28ca18,_0x39dac3);};}function getDiff(_0x5d9e15){var _0x1f7940=moment()[_0xa5f6('0x47')](0x0);var _0x3ff4f2=moment(_0x5d9e15)[_0xa5f6('0x47')](0x0);return _0x1f7940['diff'](_0x3ff4f2,_0xa5f6('0x90'));}function ifInterval(_0x49f81b,_0x55f8d5){if(_[_0xa5f6('0x3b')](_0x55f8d5)){return![];}return getDiff(_0x55f8d5)<_0x49f81b*0x3c;}function freeVariablesPredictive(_0x2a986d){if(isNotNull(_0x2a986d)){if(!_[_0xa5f6('0x3b')](_0x2a986d[_0xa5f6('0x75')])){_0x2a986d[_0xa5f6('0x75')]=undefined;loggerPredictive[_0xa5f6('0x80')](_0x2a986d['name'],_0xa5f6('0x91'));}if(!_['isUndefined'](_0x2a986d[_0xa5f6('0x24')])){_0x2a986d[_0xa5f6('0x24')]=undefined;loggerPredictive[_0xa5f6('0x80')](_0x2a986d['name'],_0xa5f6('0x92'));}if(!_[_0xa5f6('0x3b')](_0x2a986d[_0xa5f6('0x93')])){clearInterval(_0x2a986d['handlePredictive']);_0x2a986d[_0xa5f6('0x93')]=undefined;loggerPredictive[_0xa5f6('0x80')](_0x2a986d[_0xa5f6('0x3d')],_0xa5f6('0x94'));}}}function erlangb(_0x1d613c,_0x36c374){if(_0x36c374===0x0){return 0x0;}var _0x2f0d20=0x1;for(var _0x57e8ff=0x1;_0x57e8ff<=_0x36c374;_0x57e8ff+=0x1){_0x2f0d20=0x1+_0x2f0d20*_0x57e8ff/_0x1d613c;}return 0x1/_0x2f0d20;}function isVoiceQueueOutbound(_0x2951a3){return _0x2951a3===_0xa5f6('0x4b');}function isNotPreview(_0x29646d){return _0x29646d!=='preview';}function isCampaignIvr(_0x2d8eed){return _0x2d8eed==='ivr';}function getCallerId(_0x40acf0,_0x40704b,_0xcdb63f){if(!_['isUndefined'](_0xcdb63f)&&typeof _0xcdb63f===_0xa5f6('0x95')&&!_[_0xa5f6('0x45')](_0xcdb63f)){if(!_[_0xa5f6('0x3b')](_0x40704b)&&typeof _0x40704b===_0xa5f6('0x95')&&!_[_0xa5f6('0x45')](_0x40704b)){return util[_0xa5f6('0x79')](_0xa5f6('0x96'),_0x40704b,_0xcdb63f);}return util['format']('\x22%s\x22\x20<%s>',_0xcdb63f,_0xcdb63f);}if(!_['isUndefined'](_0x40acf0)&&typeof _0x40acf0==='string'&&!_['isEmpty'](_0x40acf0)){return _0x40acf0;}return _0xa5f6('0x97');}function loggerCatchQueueSummary(_0x2d6970,_0x1790f5){return function(_0x1a1102){freeVariablesPredictive(_0x1790f5);emitVoiceQueueSummary(_0x1790f5);emitCampaignSummary(_0x1790f5);loggerSyncQueueSummary[_0xa5f6('0x98')](_0x2d6970,util['inspect'](_0x1a1102,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5ec3d0,_0x52e4e9){return function(_0x5728bc){loggerPredictive[_0xa5f6('0x98')](_0x52e4e9[_0xa5f6('0x3d')],_0x5ec3d0);loggerPredictive['error'](_0x5728bc[_0xa5f6('0x99')]);freeVariablesPredictive(_0x52e4e9);};}function loggerCatch(_0x200357){return function(_0x4a9061){logger[_0xa5f6('0x98')](_0x200357,util[_0xa5f6('0x9a')](_0x4a9061,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3d9b5c){return _0x3d9b5c&&!_[_0xa5f6('0x3b')](_0x3d9b5c)&&_0x3d9b5c['length']>0x0;}function decremetOriginate(_0x172073){if(!_['isUndefined'](_0x172073)&&_0x172073!==null){if(typeof _0x172073[_0xa5f6('0x71')]!==_0xa5f6('0x9b')){if(_0x172073['originated']>0x0){_0x172073[_0xa5f6('0x71')]-=0x1;}else{logger['error'](_0xa5f6('0x9c'));}}}else{logger['error'](_0xa5f6('0x9d'));}}function checkContactLowerLimitOriginate(_0x1cd6e4,_0x4a2672,_0x1a5367){if(_0x4a2672>_0x1a5367){for(var _0x3f0045=0x0;_0x3f0045<_0x4a2672-_0x1a5367;_0x3f0045+=0x1){decremetOriginate(_0x1cd6e4);}}}function loggerGetContactDialer(_0x16e77c,_0x2c4e51,_0x53b6ce){return function(_0x782a6b){checkContactLowerLimitOriginate(_0x2c4e51,_0x53b6ce,0x0);logger['error'](_0x16e77c,util[_0xa5f6('0x9a')](_0x782a6b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3baf32){return function(_0x4e4028){if(isNotNull(_0x4e4028)&&isNotNull(_0x4e4028[0x0])){if(_0x4e4028[0x0][_0xa5f6('0x9e')]>0x0){_0x3baf32[_0xa5f6('0x3f')]=_0xa5f6('0x9f');logger[_0xa5f6('0x80')]('[getContactDialer2][ReScheduled]'+_0x3baf32[_0xa5f6('0x3d')],_0x4e4028[0x0]['contactsRescheduled'],_0xa5f6('0xa0'));}else{_0x3baf32[_0xa5f6('0x3f')]=_0xa5f6('0xa1');logger[_0xa5f6('0x80')]('[getContactDialer2][Empty]'+_0x3baf32[_0xa5f6('0x3d')]);}}};}function notSendMessagesQueue(_0x10f07f){if(_0x10f07f[_0xa5f6('0xa2')]){freeVariablesPredictive(_0x10f07f);if(_0x10f07f[_0xa5f6('0x71')]===0x0&&_0x10f07f[_0xa5f6('0x53')]===0x0&&_0x10f07f[_0xa5f6('0x57')]===0x0&&(_0x10f07f[_0xa5f6('0x50')]||0x0)===0x0){_0x10f07f[_0xa5f6('0xa2')]=![];_0x10f07f['available']=0x0;_0x10f07f[_0xa5f6('0x3f')]=_0xa5f6('0x40');loggerSyncQueueSummary[_0xa5f6('0x98')](_0xa5f6('0xa3'),_0x10f07f[_0xa5f6('0x3d')],_0xa5f6('0xa4'));}else{_0x10f07f[_0xa5f6('0x3f')]=_0xa5f6('0xa5');loggerSyncQueueSummary[_0xa5f6('0x98')](_0xa5f6('0xa3'),_0x10f07f[_0xa5f6('0x3d')],_0xa5f6('0xa6'));}emitVoiceQueueSummary(_0x10f07f);}}function notSendMessagesCampaign(_0x3abfc1){if(_0x3abfc1['sendMessageOneNotActive']){if(_0x3abfc1[_0xa5f6('0x71')]===0x0){_0x3abfc1['sendMessageOneNotActive']=![];_0x3abfc1[_0xa5f6('0x3f')]=_0xa5f6('0x40');loggerSyncQueueSummary[_0xa5f6('0x98')](_0xa5f6('0xa7'),_0x3abfc1['name'],_0xa5f6('0xa4'));}else{_0x3abfc1[_0xa5f6('0x3f')]=_0xa5f6('0xa5');loggerSyncQueueSummary[_0xa5f6('0x98')](_0xa5f6('0xa7'),_0x3abfc1[_0xa5f6('0x3d')],_0xa5f6('0xa6'));}emitCampaignSummary(_0x3abfc1);}}function createObjHistory(_0x48e800,_0x814419,_0x22e743,_0x5ce2bb,_0x233892){_0x48e800['message']=_0x22e743;var _0x194950=new Action(_0x48e800,_0x814419);var _0x9ed8c6=new History(_0x194950);_0x9ed8c6[_0xa5f6('0xa8')]=_0x5ce2bb;_0x9ed8c6[_0xa5f6('0xa9')]=_0x233892;_0x9ed8c6[_0xa5f6('0xaa')]=_0x194950[_0xa5f6('0xab')];return _0x9ed8c6;}Dialer[_0xa5f6('0xac')][_0xa5f6('0x3a')]=function(){var _0x1ead68=this;setInterval(function(){_0x1ead68['clearZombieChannels'](_0x1ead68['uniqueId'],_0xa5f6('0xad'));_0x1ead68['clearZombieChannels'](_0x1ead68[_0xa5f6('0x21')],_0xa5f6('0xae'));},0x32c8);};Dialer[_0xa5f6('0xac')][_0xa5f6('0xaf')]=function(_0x2a9376,_0x2ec20f){var _0x40ca59=this;for(var _0x1e2081 in _0x2a9376){if(typeof _0x2a9376[_0x1e2081]!=='undefined'){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x2a9376[_0x1e2081])){return ami[_0xa5f6('0xb0')]({'action':_0xa5f6('0xb1'),'channel':_0x2a9376[_0x1e2081][_0xa5f6('0xb2')]})[_0xa5f6('0xb3')](function(_0x17c2ae){if(_0x17c2ae[_0xa5f6('0x3f')]===_0xa5f6('0xb4')){setTimeout(function(){if(_0x2a9376[_0x1e2081]&&_0x2a9376[_0x1e2081][_0xa5f6('0x4a')]!==_0xa5f6('0x7c')){_0x40ca59['updateOriginated'](_0x40ca59[_0xa5f6('0x1d')][_0x2a9376[_0x1e2081][_0xa5f6('0xb5')]]);logger[_0xa5f6('0x98')](_0xa5f6('0xb6'),_0x2ec20f,_0x1e2081,_0x2a9376[_0x1e2081][_0xa5f6('0xb5')]);delete _0x2a9376[_0x1e2081];}if(_0x2a9376[_0x1e2081]&&_0x2a9376[_0x1e2081][_0xa5f6('0x4a')]==='ivr'){_0x40ca59[_0xa5f6('0xb7')](_0x40ca59['campaigns'][_0x2a9376[_0x1e2081][_0xa5f6('0xb5')]]);logger[_0xa5f6('0x98')](_0xa5f6('0xb8'),_0x2ec20f,_0x1e2081,_0x2a9376[_0x1e2081][_0xa5f6('0xb5')]);delete _0x2a9376[_0x1e2081];}},0x2328);}});}});}}};Dialer[_0xa5f6('0xac')][_0xa5f6('0xb9')]=function(_0x276d20){return BPromise['resolve']()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xb9')](_0x276d20))[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xbb')));};Dialer[_0xa5f6('0xac')][_0xa5f6('0xbc')]=function(_0x766f10){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x766f10))['catch'](loggerCatch(_0xa5f6('0xbd')));};Dialer['prototype'][_0xa5f6('0xbe')]=function(_0x5625e8){return BPromise['resolve']()['then'](cmHopperBlack[_0xa5f6('0xbe')](_0x5625e8))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xa5f6('0xac')]['averageHandleTime']=function(_0x2fcfa0){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopperHistory[_0xa5f6('0xc0')](_0x2fcfa0))[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xc1')));};Dialer[_0xa5f6('0xac')][_0xa5f6('0xc2')]=function(_0x3529c0){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xc2')](_0x3529c0))[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xc3')));};Dialer[_0xa5f6('0xac')]['unlockContact']=function(_0x5f02d7,_0x39b267,_0x56f393){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xc4')](_0x5f02d7,_0x39b267,_0x56f393))['catch'](loggerCatch(_0xa5f6('0xc5')));};Dialer[_0xa5f6('0xac')]['getContactDialer']=function(_0x1324a2,_0x2ff085,_0x226294,_0x71ff0,_0x36ee1b){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xc6')](_0x1324a2,_0x2ff085,_0x226294,_0x71ff0))[_0xa5f6('0xb3')](function(_0x17ffb9){_0x36ee1b[_0xa5f6('0xc7')]-=_0x226294;_0x36ee1b[_0xa5f6('0xc7')]=_0x36ee1b['temp']>0x0?_0x36ee1b[_0xa5f6('0xc7')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x17ffb9);});};Dialer['prototype'][_0xa5f6('0xc8')]=function(_0x5aee40,_0x278dfe,_0x5f341a,_0x2a3e7c){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xc8')](_0x5aee40,_0x278dfe,_0x5f341a))[_0xa5f6('0xb3')](function(_0x3dba8e){_0x2a3e7c[_0xa5f6('0xc7')]-=_0x278dfe;_0x2a3e7c[_0xa5f6('0xc7')]=_0x2a3e7c[_0xa5f6('0xc7')]>0x0?_0x2a3e7c[_0xa5f6('0xc7')]:0x0;loggerCatch(_0xa5f6('0xc9'))(_0x3dba8e);});};Dialer[_0xa5f6('0xac')][_0xa5f6('0xca')]=function(_0x41f08e){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](voiceQueueRt[_0xa5f6('0xca')](_0x41f08e))[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xcb')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x60662b){return BPromise['resolve']()[_0xa5f6('0xba')](cmHopper[_0xa5f6('0xcc')](_0x60662b))['catch'](loggerCatch(_0xa5f6('0xcd')));};Dialer[_0xa5f6('0xac')][_0xa5f6('0xce')]=function(_0x5ee53c){return BPromise[_0xa5f6('0xbf')]()[_0xa5f6('0xba')](cmHopperHistory[_0xa5f6('0xce')](_0x5ee53c))[_0xa5f6('0xb3')](loggerCatch('[createHistory]\x20'));};Dialer[_0xa5f6('0xac')][_0xa5f6('0xb7')]=function(_0x1cbafb){if(!_['isUndefined'](_0x1cbafb)&&_0x1cbafb!==null){if(typeof _0x1cbafb[_0xa5f6('0x71')]!==_0xa5f6('0x9b')){if(_0x1cbafb['originated']>0x0){_0x1cbafb['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xa5f6('0xcf'));}};Dialer[_0xa5f6('0xac')][_0xa5f6('0xd0')]=function(_0x3710fa,_0x49d58b){var _0xde3eaa=this;return function(_0xb65e98){_0xde3eaa[_0xa5f6('0xb7')](_0x49d58b);logger['error'](_0x3710fa,util[_0xa5f6('0x9a')](_0xb65e98,{'showHidden':![],'depth':null}));};};Dialer[_0xa5f6('0xac')][_0xa5f6('0xd1')]=function(_0x579c2e,_0x41e25e,_0x17b27a){var _0x1f8746={'state':0x19,'statedesc':_0xa5f6('0xd2')};this[_0xa5f6('0xb7')](_0x41e25e);this['saveInDb'](_[_0xa5f6('0x8f')](_0x1f8746,_[_0xa5f6('0xd3')](_0x17b27a,[_0xa5f6('0xd4'),_0xa5f6('0xd5'),_0xa5f6('0xd6'),'VoiceQueueId',_0xa5f6('0xd7')])),_0xa5f6('0xd8'),_0xa5f6('0xd9'));logger[_0xa5f6('0x98')](_0x579c2e);};Dialer[_0xa5f6('0xac')][_0xa5f6('0xda')]=function(_0x498748){return _0x498748===_0xa5f6('0xdb');};Dialer['prototype']['isTrunkReachable']=function(_0x27021f){return!_[_0xa5f6('0x3b')](_0x27021f)&&_0x27021f&&!_['isUndefined'](_0x27021f['name'])&&!_['isUndefined'](_0x27021f[_0xa5f6('0x77')])&&_0x27021f[_0xa5f6('0x77')]&&(this[_0xa5f6('0xdc')][util[_0xa5f6('0x79')](_0xa5f6('0xdd'),_0x27021f[_0xa5f6('0x3d')])]['status']===_0xa5f6('0xde')||this[_0xa5f6('0xdc')][util[_0xa5f6('0x79')]('SIP/%s',_0x27021f[_0xa5f6('0x3d')])][_0xa5f6('0xb1')]===_0xa5f6('0xdf'));};Dialer[_0xa5f6('0xac')][_0xa5f6('0xe0')]=function(_0xb4dd72,_0x328bb8,_0x46b202){this[_0xa5f6('0xce')](_0xb4dd72)[_0xa5f6('0xb3')](loggerCatch(_0x328bb8));this[_0xa5f6('0xcc')](_0xb4dd72)[_0xa5f6('0xb3')](loggerCatch(_0x46b202));};Dialer['prototype'][_0xa5f6('0x35')]=function(_0x1aff14){var _0x1f527f=this[_0xa5f6('0x23')][_0x1aff14[_0xa5f6('0xe1')]];var _0x337c4;if(!_['isNil'](_0x1aff14)&&!_[_0xa5f6('0xe2')](_0x1aff14[_0xa5f6('0xe3')])&&!_[_0xa5f6('0xe2')](_0x1aff14[_0xa5f6('0xe3')][_0xa5f6('0xe4')])&&_0x1aff14[_0xa5f6('0xe5')]===_0xa5f6('0xe6')&&_0x1f527f){if(_0x1f527f[_0xa5f6('0x4a')]!=='ivr'&&this[_0xa5f6('0x1d')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0xe7')]&&_0x1aff14['value']===_0xa5f6('0xe8')){delete this[_0xa5f6('0x23')][_0x1aff14[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this[_0xa5f6('0x1d')][_0x1f527f[_0xa5f6('0xb5')]]);this['voiceQueues'][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0x5d')]+=0x1;this[_0xa5f6('0x1d')][_0x1f527f['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x337c4=new Hangup(_0x1f527f,_0x1aff14);_0x337c4[_0xa5f6('0xa8')]=0x12;_0x337c4[_0xa5f6('0xa9')]=_0xa5f6('0xe9');_0x337c4[_0xa5f6('0xea')]='AMD';ami[_0xa5f6('0x49')]('custom:amd',ut[_0xa5f6('0xeb')](_0x337c4,_0xa5f6('0xec')));this['saveInDb'](_0x337c4,_0xa5f6('0xed'),'[syncHangupInAMD]');}if(_0x1f527f[_0xa5f6('0x4a')]!==_0xa5f6('0x7c')&&this[_0xa5f6('0x1d')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0xe7')]&&_0x1aff14[_0xa5f6('0xee')]===_0xa5f6('0xef')){var _0x388f20=this;return new BPromise(function(_0xe52afb,_0x34d638){delete _0x388f20[_0xa5f6('0x23')][_0x1aff14[_0xa5f6('0xe1')]];_0x388f20[_0xa5f6('0xb7')](_0x388f20['voiceQueues'][_0x1f527f[_0xa5f6('0xb5')]]);_0x388f20[_0xa5f6('0x1d')][_0x1f527f['queue']][_0xa5f6('0x5d')]+=0x1;_0x388f20[_0xa5f6('0x1d')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0x5c')]+=0x1;var _0x57c308=_0x388f20[_0xa5f6('0x1d')][_0x1f527f['queue']];var _0x22b6ab=new Hangup(_0x1f527f,_0x1aff14);_0x22b6ab[_0xa5f6('0xa8')]=0x13;_0x22b6ab[_0xa5f6('0xa9')]='Machine';_0x22b6ab[_0xa5f6('0xea')]=_0xa5f6('0xf0');_0x22b6ab[_0xa5f6('0xf1')]+=0x1;_0x22b6ab[_0xa5f6('0xf2')]+=0x1;_0x22b6ab[_0xa5f6('0xec')]=!![];ami[_0xa5f6('0x49')](_0xa5f6('0xf3'),ut[_0xa5f6('0xeb')](_0x22b6ab,_0xa5f6('0xec')));_0x388f20[_0xa5f6('0xce')](_0x22b6ab)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xf4')));if(_0x22b6ab[_0xa5f6('0xf5')]+_0x22b6ab['countcongestionretry']+_0x22b6ab[_0xa5f6('0xf6')]+_0x22b6ab['countnosuchnumberretry']+_0x22b6ab['countdropretry']+_0x22b6ab['countabandonedretry']+_0x22b6ab[_0xa5f6('0xf1')]+_0x22b6ab[_0xa5f6('0xf7')]>=_0x57c308[_0xa5f6('0xf8')]){_0x388f20[_0xa5f6('0xf9')](_0x22b6ab,_0xe52afb,_0x34d638,_0xa5f6('0xfa'));}else{if(_0x22b6ab[_0xa5f6('0xf1')]>=_0x57c308[_0xa5f6('0xfb')]){_0x388f20[_0xa5f6('0xfc')](_0x22b6ab,_0xe52afb,_0x34d638,_0xa5f6('0xfd'));}else{_0x388f20['rescheduleContact']({'active':![],'countmachineretry':_0x22b6ab[_0xa5f6('0xf1')],'scheduledat':moment()[_0xa5f6('0xfe')](_0x57c308['dialMachineRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22b6ab[_0xa5f6('0xd4')],'ListId':_0x22b6ab[_0xa5f6('0xd5')],'VoiceQueueId':_0x22b6ab['VoiceQueueId']||undefined,'CampaignId':_0x22b6ab['CampaignId']||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x100')));_0xe52afb({'reschedule':0x1});}}});}if(_0x1f527f['type']==='ivr'&&this[_0xa5f6('0x1e')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0xe7')]&&_0x1aff14[_0xa5f6('0xee')]===_0xa5f6('0xe8')){delete this[_0xa5f6('0x23')][_0x1aff14[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this[_0xa5f6('0x1e')][_0x1f527f[_0xa5f6('0xb5')]]);_0x337c4=new Hangup(_0x1f527f,_0x1aff14);_0x337c4[_0xa5f6('0xa8')]=0x12;_0x337c4[_0xa5f6('0xa9')]='HangupInAMD';_0x337c4[_0xa5f6('0xea')]=_0xa5f6('0xf0');ami[_0xa5f6('0x49')](_0xa5f6('0xf3'),ut['buildObj'](_0x337c4,_0xa5f6('0xec')));this['saveInDb'](_0x337c4,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x1f527f[_0xa5f6('0x4a')]===_0xa5f6('0x7c')&&this[_0xa5f6('0x1e')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0xe7')]&&_0x1aff14['value']===_0xa5f6('0xef')){var _0x388f20=this;return new BPromise(function(_0x13a19b,_0x4aee32){delete _0x388f20[_0xa5f6('0x23')][_0x1aff14[_0xa5f6('0xe1')]];_0x388f20[_0xa5f6('0xb7')](_0x388f20[_0xa5f6('0x1e')][_0x1f527f[_0xa5f6('0xb5')]]);_0x388f20[_0xa5f6('0x1e')][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0x5d')]+=0x1;_0x388f20['campaigns'][_0x1f527f[_0xa5f6('0xb5')]][_0xa5f6('0x5c')]+=0x1;var _0x2176e2=_0x388f20['campaigns'][_0x1f527f['queue']];var _0xf4a1bb=new Hangup(_0x1f527f,_0x1aff14);_0xf4a1bb[_0xa5f6('0xa8')]=0x13;_0xf4a1bb[_0xa5f6('0xa9')]='Machine';_0xf4a1bb[_0xa5f6('0xea')]=_0xa5f6('0xf0');_0xf4a1bb['countmachineretry']+=0x1;_0xf4a1bb[_0xa5f6('0xf2')]+=0x1;_0xf4a1bb[_0xa5f6('0xec')]=!![];ami[_0xa5f6('0x49')]('custom:amd',ut[_0xa5f6('0xeb')](_0xf4a1bb,_0xa5f6('0xec')));_0x388f20[_0xa5f6('0xce')](_0xf4a1bb)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xf4')));if(_0xf4a1bb[_0xa5f6('0xf5')]+_0xf4a1bb[_0xa5f6('0x101')]+_0xf4a1bb[_0xa5f6('0xf6')]+_0xf4a1bb[_0xa5f6('0x102')]+_0xf4a1bb['countdropretry']+_0xf4a1bb[_0xa5f6('0x103')]+_0xf4a1bb['countmachineretry']+_0xf4a1bb[_0xa5f6('0xf7')]>=_0x2176e2[_0xa5f6('0xf8')]){_0x388f20[_0xa5f6('0xf9')](_0xf4a1bb,_0x13a19b,_0x4aee32,'reason19\x20machine....');}else{if(_0xf4a1bb['countmachineretry']>=_0x2176e2[_0xa5f6('0xfb')]){_0x388f20['createStateFinal'](_0xf4a1bb,_0x13a19b,_0x4aee32,_0xa5f6('0xfd'));}else{_0x388f20[_0xa5f6('0xc2')]({'active':![],'countmachineretry':_0xf4a1bb['countmachineretry'],'scheduledat':moment()[_0xa5f6('0xfe')](_0x2176e2[_0xa5f6('0x104')],_0xa5f6('0xff'))['format'](_0xa5f6('0x105')),'ContactId':_0xf4a1bb[_0xa5f6('0xd4')],'ListId':_0xf4a1bb[_0xa5f6('0xd5')],'VoiceQueueId':_0xf4a1bb[_0xa5f6('0x106')]||undefined,'CampaignId':_0xf4a1bb['CampaignId']||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x100')));_0x13a19b({'reschedule':0x1});}}});}}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x32')]=function(_0x10fa4e){var _0x52e012=this[_0xa5f6('0x23')][_0x10fa4e[_0xa5f6('0xe1')]];var _0x279b6c=this;var _0x2e15f7;if(_0x52e012&&_0x52e012['type']===_0xa5f6('0x7c')){delete this[_0xa5f6('0x23')][_0x10fa4e[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this[_0xa5f6('0x1e')][_0x52e012[_0xa5f6('0xb5')]]);this[_0xa5f6('0x1e')][_0x52e012['queue']][_0xa5f6('0x107')]+=0x1;_0x2e15f7=new Hangup(_0x52e012,_0x10fa4e);this['createHistory'](_0x2e15f7)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x108')));this[_0xa5f6('0xcc')](_0x2e15f7)[_0xa5f6('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x52e012&&_0x52e012[_0xa5f6('0x4a')]!==_0xa5f6('0x7c')&&isNotNull(this[_0xa5f6('0x1d')][_0x52e012['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x10fa4e[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this[_0xa5f6('0x1d')][_0x52e012[_0xa5f6('0xb5')]]);this[_0xa5f6('0x1d')][_0x52e012[_0xa5f6('0xb5')]][_0xa5f6('0x5d')]+=0x1;this[_0xa5f6('0x1d')][_0x52e012[_0xa5f6('0xb5')]][_0xa5f6('0x5c')]+=0x1;_0x2e15f7=new Hangup(_0x52e012,_0x10fa4e);_0x2e15f7[_0xa5f6('0xa8')]=0x10;_0x2e15f7[_0xa5f6('0xa9')]=_0xa5f6('0x109');_0x2e15f7[_0xa5f6('0xea')]=_0xa5f6('0x10a');this[_0xa5f6('0xce')](_0x2e15f7)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x108')));this['moveContactManagedDialer'](_0x2e15f7)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x10b')));}if(_0x52e012&&_0x52e012['type']!=='ivr'&&!isNotNull(this[_0xa5f6('0x1d')][_0x52e012[_0xa5f6('0xb5')]][_0xa5f6('0x10c')])){delete this[_0xa5f6('0x23')][_0x10fa4e[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this['voiceQueues'][_0x52e012[_0xa5f6('0xb5')]]);this[_0xa5f6('0x1d')][_0x52e012[_0xa5f6('0xb5')]][_0xa5f6('0x67')]+=0x1;_0x2e15f7=new Hangup(_0x52e012,_0x10fa4e);_0x2e15f7['state']=0xc;_0x2e15f7[_0xa5f6('0xa9')]=_0x10fa4e[_0xa5f6('0x10d')];_0x2e15f7[_0xa5f6('0xea')]=_0xa5f6('0x10e');this[_0xa5f6('0xce')](_0x2e15f7)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x2e15f7)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x10b')));}};Dialer[_0xa5f6('0xac')]['syncAgentComplete']=function(_0xf0253b){var _0x1a1a1a=this[_0xa5f6('0x23')][_0xf0253b[_0xa5f6('0xe1')]];var _0x5c314c=this;if(this[_0xa5f6('0x1d')][_0xf0253b[_0xa5f6('0xb5')]]){if(_0x1a1a1a&&_0x1a1a1a[_0xa5f6('0x4a')]!==_0xa5f6('0x7c')){delete this[_0xa5f6('0x23')][_0xf0253b[_0xa5f6('0xe1')]];this[_0xa5f6('0x1d')][_0xf0253b[_0xa5f6('0xb5')]][_0xa5f6('0x5d')]+=0x1;var _0x3e5eea=new AgentComplete(_0x1a1a1a,_0xf0253b);if(_0xf0253b[_0xa5f6('0x10f')]===_0xa5f6('0x110')){_0x3e5eea['agiafterat']=this[_0xa5f6('0x1d')][_0xf0253b[_0xa5f6('0xb5')]]['dialQueueProject2']&&this[_0xa5f6('0x1d')][_0xf0253b[_0xa5f6('0xb5')]][_0xa5f6('0x111')]?moment()[_0xa5f6('0x79')](_0xa5f6('0x105')):undefined;}this[_0xa5f6('0xce')](_0x3e5eea)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x112')));this[_0xa5f6('0xcc')](_0x3e5eea)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x113')));}}};Dialer['prototype'][_0xa5f6('0x29')]=function(_0x1eb321){if(this['voiceQueues'][_0x1eb321['queue']]){if(this['uniqueId'][_0x1eb321['uniqueid']]&&this[_0xa5f6('0x23')][_0x1eb321[_0xa5f6('0xe1')]][_0xa5f6('0x4a')]!=='ivr'){this[_0xa5f6('0xb7')](this[_0xa5f6('0x1d')][_0x1eb321[_0xa5f6('0xb5')]]);this['uniqueId'][_0x1eb321[_0xa5f6('0xe1')]][_0xa5f6('0x114')]=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x88665b){this[_0xa5f6('0xce')](_0x88665b)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x112')));this[_0xa5f6('0xcc')](_0x88665b)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x115')));};Dialer['prototype'][_0xa5f6('0x2a')]=function(_0x1a9d84){var _0x3c44e2=this['uniqueId'][_0x1a9d84[_0xa5f6('0xe1')]];var _0x55d6da=this;if(this[_0xa5f6('0x1d')][_0x1a9d84['queue']]){if(_0x3c44e2&&_0x3c44e2[_0xa5f6('0x4a')]!==_0xa5f6('0x7c')){delete this['uniqueId'][_0x1a9d84[_0xa5f6('0xe1')]];this[_0xa5f6('0xb7')](this[_0xa5f6('0x1d')][_0x1a9d84['queue']]);_0x3c44e2[_0xa5f6('0x116')]=moment()['format'](_0xa5f6('0x105'));var _0x5b01eb=new QueueCallerAbandon(_0x3c44e2,_0x1a9d84);if(getSeconds(_0x3c44e2[_0xa5f6('0x116')],_0x3c44e2[_0xa5f6('0x117')])>=_0x3c44e2[_0xa5f6('0x118')]){this['voiceQueues'][_0x1a9d84[_0xa5f6('0xb5')]][_0xa5f6('0x6c')]+=0x1;this['voiceQueues'][_0x1a9d84['queue']][_0xa5f6('0x62')]+=0x1;this['voiceQueues'][_0x1a9d84['queue']][_0xa5f6('0x119')]+=0x1;_0x5b01eb['state']=0xa;_0x5b01eb['statedesc']=_0xa5f6('0x11a');_0x5b01eb['dropreason']=_0xa5f6('0x11b');_0x5b01eb[_0xa5f6('0x11c')]=this[_0xa5f6('0x1d')][_0x1a9d84[_0xa5f6('0xb5')]][_0xa5f6('0x11d')]?moment()[_0xa5f6('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5b01eb['countdropretry']+=0x1;_0x5b01eb[_0xa5f6('0xf2')]+=0x1;if(_0x5b01eb[_0xa5f6('0x11e')]>=this[_0xa5f6('0x1d')][_0x1a9d84['queue']]['dialDropMaxRetry']){this[_0xa5f6('0x11f')](_0x5b01eb);}else{this[_0xa5f6('0xc2')]({'active':![],'countdropretry':_0x5b01eb[_0xa5f6('0x11e')],'scheduledat':moment()[_0xa5f6('0xfe')](this[_0xa5f6('0x1d')][_0x1a9d84[_0xa5f6('0xb5')]]['dialDropRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x3c44e2[_0xa5f6('0xd4')],'ListId':_0x3c44e2[_0xa5f6('0xd5')],'VoiceQueueId':_0x3c44e2[_0xa5f6('0x106')]||undefined,'CampaignId':_0x3c44e2[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x120')));var _0x4ae948=new History(_0x5b01eb);_0x4ae948['state']=0xa;_0x4ae948[_0xa5f6('0xa9')]=_0xa5f6('0x11a');_0x4ae948[_0xa5f6('0xab')]=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));_0x4ae948[_0xa5f6('0xaa')]=_0x4ae948[_0xa5f6('0xab')];_0x4ae948[_0xa5f6('0x121')]=_0x5b01eb[_0xa5f6('0x121')];_0x4ae948['calleridnum']=_0x5b01eb[_0xa5f6('0x122')];this[_0xa5f6('0xce')](_0x4ae948)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x123')));}}else{this[_0xa5f6('0x1d')][_0x1a9d84[_0xa5f6('0xb5')]][_0xa5f6('0x6b')]+=0x1;this[_0xa5f6('0x1d')][_0x1a9d84['queue']][_0xa5f6('0x61')]+=0x1;_0x5b01eb[_0xa5f6('0xa8')]=0xb;_0x5b01eb[_0xa5f6('0xa9')]=_0xa5f6('0x124');_0x5b01eb[_0xa5f6('0x125')]=_0xa5f6('0x126');_0x5b01eb[_0xa5f6('0x103')]+=0x1;_0x5b01eb[_0xa5f6('0xf2')]+=0x1;if(_0x5b01eb[_0xa5f6('0x103')]>=this[_0xa5f6('0x1d')][_0x1a9d84[_0xa5f6('0xb5')]][_0xa5f6('0x127')]){this[_0xa5f6('0x11f')](_0x5b01eb);}else{this[_0xa5f6('0xc2')]({'active':![],'countabandonedretry':_0x5b01eb[_0xa5f6('0x103')],'scheduledat':moment()[_0xa5f6('0xfe')](this[_0xa5f6('0x1d')][_0x1a9d84[_0xa5f6('0xb5')]]['dialAbandonedRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x3c44e2[_0xa5f6('0xd4')],'ListId':_0x3c44e2['ListId'],'VoiceQueueId':_0x3c44e2['VoiceQueueId']||undefined,'CampaignId':_0x3c44e2[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x128')));var _0x4ae948=new History(_0x5b01eb);_0x4ae948[_0xa5f6('0xa8')]=0xb;_0x4ae948['statedesc']=_0xa5f6('0x124');_0x4ae948['starttime']=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));_0x4ae948[_0xa5f6('0xaa')]=_0x4ae948[_0xa5f6('0xab')];_0x4ae948[_0xa5f6('0x121')]=_0x5b01eb[_0xa5f6('0x121')];_0x4ae948[_0xa5f6('0x122')]=_0x5b01eb[_0xa5f6('0x122')];this['createHistory'](_0x4ae948)[_0xa5f6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x129')]=function(_0x3ea607){if(this[_0xa5f6('0x21')][_0x3ea607[_0xa5f6('0xe1')]]){this[_0xa5f6('0x21')][_0x3ea607[_0xa5f6('0xe1')]]['channel']=_0x3ea607[_0xa5f6('0xb2')];}if(this[_0xa5f6('0x23')][_0x3ea607[_0xa5f6('0xe1')]]){this[_0xa5f6('0x23')][_0x3ea607[_0xa5f6('0xe1')]][_0xa5f6('0xb2')]=_0x3ea607[_0xa5f6('0xb2')];}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x37')]=function(_0x27b254){if(strategy[this[_0xa5f6('0x1d')][this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]][_0xa5f6('0x4c')]]===_0xa5f6('0x18')){if(this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]]&&_['isNil'](this['actions'][_0x27b254['actionid']][_0xa5f6('0x12b')])&&_0x27b254[_0xa5f6('0xb1')]==='1'&&_0x27b254[_0xa5f6('0x12c')]==='0'){if(this[_0xa5f6('0x1f')][_0x27b254[_0xa5f6('0x12d')]]){if(!this[_0xa5f6('0x1f')][_0x27b254[_0xa5f6('0x12d')]][_0xa5f6('0x12b')]){this[_0xa5f6('0x1f')][_0x27b254[_0xa5f6('0x12d')]][_0xa5f6('0x12b')]=!![];this['actions'][_0x27b254[_0xa5f6('0x12a')]][_0xa5f6('0x12b')]=!![];this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]][_0xa5f6('0x12d')]=_0x27b254[_0xa5f6('0x12d')];}}}}else if((strategy[this[_0xa5f6('0x1d')][this['actions'][_0x27b254['actionid']][_0xa5f6('0xb5')]][_0xa5f6('0x4c')]]||'rrmemory')===_0xa5f6('0x17')){if(this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]]){if(this[_0xa5f6('0x1f')][_0x27b254['stateinterface']]){this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]][_0xa5f6('0x12d')]=_0x27b254[_0xa5f6('0x12d')];if(_[_0xa5f6('0xe2')](this[_0xa5f6('0x26')][this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]])){this[_0xa5f6('0x26')][this[_0xa5f6('0x21')][_0x27b254[_0xa5f6('0x12a')]]['queue']]=[];}this[_0xa5f6('0x26')][this['actions'][_0x27b254['actionid']][_0xa5f6('0xb5')]][_0xa5f6('0x12e')](_[_0xa5f6('0x8f')](_[_0xa5f6('0xd3')](this['actions'][_0x27b254['actionid']],['idHopper',_0xa5f6('0x12d')]),{'status':_0x27b254[_0xa5f6('0xb1')],'paused':_0x27b254[_0xa5f6('0x12c')]}));}}}};function unlockQueueStatus(_0x59db68,_0x2cae0b){setTimeout(function(){if(_[_0xa5f6('0x3b')](_0x59db68[_0xa5f6('0x12f')])){loggerBooked[_0xa5f6('0x98')](_0xa5f6('0x130'),_0x2cae0b);}_0x59db68[_0xa5f6('0x12f')]=!![];loggerBooked['info'](_0xa5f6('0x131'),_0x2cae0b,JSON[_0xa5f6('0x78')](_[_0xa5f6('0xd3')](_0x59db68,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0xa5f6('0xac')][_0xa5f6('0x38')]=function(_0x52c58e){var _0x304b8b=this;var _0x3c90b8=_0x304b8b[_0xa5f6('0x1d')][_0x304b8b[_0xa5f6('0x21')][_0x52c58e['actionid']]['queue']];if(strategy[this[_0xa5f6('0x1d')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]][_0xa5f6('0x4c')]]===_0xa5f6('0x18')){if(this['actions'][_0x52c58e[_0xa5f6('0x12a')]]&&this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0x12d')]){this['preview'][_0xa5f6('0x132')](this['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0x133')],this['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0x12d')])['catch'](function(_0x5f2ac4){logger[_0xa5f6('0x98')](_0xa5f6('0x134'),util['inspect'](_0x5f2ac4,{'showHidden':![],'depth':null}));})[_0xa5f6('0x1b')](function(){_0x304b8b[_0xa5f6('0xb7')](_0x304b8b[_0xa5f6('0x1d')][_0x304b8b[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]]['queue']]);_0x304b8b[_0xa5f6('0x1f')][_0x304b8b[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0x12d')]][_0xa5f6('0x12b')]=![];delete _0x304b8b['actions'][_0x52c58e[_0xa5f6('0x12a')]];unlockQueueStatus(_0x3c90b8);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]);this[_0xa5f6('0xc2')]({'active':![],'ContactId':this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xd4')],'ListId':this[_0xa5f6('0x21')][_0x52c58e['actionid']][_0xa5f6('0xd5')],'VoiceQueueId':this['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0x106')]||undefined,'CampaignId':this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x135')));delete this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]];unlockQueueStatus(_0x3c90b8);}}else if((strategy[this[_0xa5f6('0x1d')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]][_0xa5f6('0x4c')]]||_0xa5f6('0x17'))===_0xa5f6('0x17')){var _0x5340a6;if(this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]]&&!_['isEmpty'](this[_0xa5f6('0x26')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]]['queue']])){if(this[_0xa5f6('0x27')][_0x304b8b['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]){this['queueBookedRR'][_0x304b8b['actions'][_0x52c58e[_0xa5f6('0x12a')]]['queue']]=this[_0xa5f6('0x27')][this['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]?this[_0xa5f6('0x27')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]:this[_0xa5f6('0x26')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]?this[_0xa5f6('0x26')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]]['_rr']||0x0:0x0;}this[_0xa5f6('0x26')][this['actions'][_0x52c58e[_0xa5f6('0x12a')]][_0xa5f6('0xb5')]][_0xa5f6('0x136')]=this[_0xa5f6('0x27')][this[_0xa5f6('0x21')][_0x52c58e[_0xa5f6('0x12a')]]['queue']];for(var _0x39413d=0x0;_0x39413d=0x0;})[_0xa5f6('0xb3')](myreject(_0x541aba)));}}else{_0x2590fb['push'](ami['Action']({'action':_0xa5f6('0x14c'),'command':util[_0xa5f6('0x79')](_0xa5f6('0x14f'),_0x3bbea8,!_[_0xa5f6('0x3b')](config[_0xa5f6('0x149')][_0x18cd7a])?_0x18cd7a:'')})[_0xa5f6('0xba')](function(_0x1ba20a){return _0x1ba20a[_0xa5f6('0x14e')][_0xa5f6('0x150')](_0xa5f6('0x151'))>=0x0;})[_0xa5f6('0xb3')](myreject(_0x541aba)));}BPromise[_0xa5f6('0x152')](_0x2590fb)[_0xa5f6('0xba')](function(_0x18e28f){var _0x2b712e=_[_0xa5f6('0x153')](_0x18e28f);if(_0x2b712e){return _0x56fda9(_0x2b712e);}else{_0x53462c[_0xa5f6('0x3f')]=_0x7fd5e1?_0xa5f6('0x154'):_0xa5f6('0x155');return _0x541aba(msgResponse(_0xa5f6('0x156'),_0xa5f6('0x147'),_0xa5f6('0x157')+_0x7fd5e1+'\x20'+_0x35ca26+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa5f6('0x9a')](_0x3bbea8,{'showHidden':![],'depth':null})+_0xa5f6('0x158')+_0x18cd7a));}})[_0xa5f6('0xb3')](function(_0x58495d){return _0x541aba(msgResponse(_0xa5f6('0x145'),_0xa5f6('0x147'),JSON[_0xa5f6('0x78')](_0x58495d)));});});};Dialer[_0xa5f6('0xac')]['checkDialMethod']=function(_0xaa3e76){var _0x2c6ae9=this;return function(){switch(_0xaa3e76[_0xa5f6('0x5a')]){case _0xa5f6('0x159'):freeVariablesPredictive(_0xaa3e76);_0x2c6ae9['handlePower'](_0xaa3e76,0x1);break;case _0xa5f6('0x15a'):freeVariablesPredictive(_0xaa3e76);_0x2c6ae9[_0xa5f6('0x15b')](_0xaa3e76,_0xaa3e76[_0xa5f6('0x15c')]);break;case'predictive':_0x2c6ae9[_0xa5f6('0x9')](_0xaa3e76);break;case _0xa5f6('0x8'):freeVariablesPredictive(_0xaa3e76);_0x2c6ae9['handlePower'](_0xaa3e76,0x1);break;default:freeVariablesPredictive(_0xaa3e76);logger[_0xa5f6('0x98')](_0xa5f6('0x15d'),_0xaa3e76['name'],_0xa5f6('0x15e'));}};};Dialer['prototype']['launchHandleIvr']=function(_0x22cbfd){var _0x28955b=this;return function(){_0x28955b[_0xa5f6('0x15f')](_0x22cbfd);};};Dialer['prototype'][_0xa5f6('0x30')]=function(_0x2fd12b){var _0x19c471=this;if(isNotPreview(_0x2fd12b[_0xa5f6('0x5a')])){if(isVoiceQueueOutbound(_0x2fd12b[_0xa5f6('0x4a')])&&isActive(_0x2fd12b[_0xa5f6('0x59')])){_0x2fd12b[_0xa5f6('0xa2')]=!![];BPromise[_0xa5f6('0xbf')]()['then'](checkIsLoggedIn(_0x2fd12b,_0x2fd12b['loggedIn']))['then'](checkIsActive(_0x2fd12b,_0x2fd12b['dialActive']))[_0xa5f6('0xba')](checkInterval(_0x2fd12b))['then'](_0x19c471[_0xa5f6('0x13f')](_0x2fd12b))['then'](_0x19c471[_0xa5f6('0x160')](_0x2fd12b['dialGlobalInterval'],_0x2fd12b[_0xa5f6('0x161')],_0x2fd12b['name'],_0x2fd12b))[_0xa5f6('0xba')](_0x19c471[_0xa5f6('0x144')](_0x2fd12b[_0xa5f6('0x41')],_0x2fd12b[_0xa5f6('0x161')],_0x2fd12b[_0xa5f6('0x3d')],_0x2fd12b))[_0xa5f6('0xba')](_0x19c471[_0xa5f6('0x162')](_0x2fd12b))[_0xa5f6('0xb3')](loggerCatchQueueSummary(_0xa5f6('0x163'),_0x2fd12b));}else{notSendMessagesQueue(_0x2fd12b);}}else{freeVariablesPredictive(_0x2fd12b);}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x164')]=function(){var _0x20c481=this;var _0x18bdbf;for(var _0x4dd9c5 in this['campaigns']){if(typeof this[_0xa5f6('0x1e')][_0x4dd9c5]!==_0xa5f6('0x9b')){_0x18bdbf=this[_0xa5f6('0x1e')][_0x4dd9c5];if(isCampaignIvr(_0x18bdbf[_0xa5f6('0x4a')])&&isActive(_0x18bdbf[_0xa5f6('0x77')])){_0x18bdbf[_0xa5f6('0xa2')]=!![];BPromise['resolve']()[_0xa5f6('0xba')](checkIsActive(_0x18bdbf,_0x18bdbf[_0xa5f6('0x77')]))[_0xa5f6('0xba')](checkInterval(_0x18bdbf))[_0xa5f6('0xba')](_0x20c481[_0xa5f6('0x13f')](_0x18bdbf))[_0xa5f6('0xba')](_0x20c481[_0xa5f6('0x160')](_0x18bdbf['dialGlobalInterval'],_0x18bdbf[_0xa5f6('0x161')],_0x18bdbf[_0xa5f6('0x3d')],_0x18bdbf))[_0xa5f6('0xba')](_0x20c481[_0xa5f6('0x144')](_0x18bdbf[_0xa5f6('0x41')],_0x18bdbf[_0xa5f6('0x161')],_0x18bdbf[_0xa5f6('0x3d')],_0x18bdbf))['then'](_0x20c481[_0xa5f6('0x165')](_0x18bdbf))[_0xa5f6('0xb3')](loggerCatchQueueSummary(_0xa5f6('0x166'),_0x18bdbf));}else{notSendMessagesCampaign(_0x18bdbf);}}}};function getCallerIdRandom(_0x24d24b,_0x37824e){var _0x2dcf53;var _0x2ccfea;var _0x159068;if(_0x37824e<=0x0){_0x37824e=0x1;}_0x2dcf53=new RegExp(_0xa5f6('0x167')+_0x37824e+'}$');_0x2ccfea=Math[_0xa5f6('0x168')](0xa,_0x37824e-0x1);_0x159068=Math[_0xa5f6('0x168')](0xa,_0x37824e)-0x1;return util['format']('%s',_[_0xa5f6('0x169')](_0x24d24b,_0x2dcf53,_[_0xa5f6('0x16a')](_0x2ccfea,_0x159068)));}function extractCalleridName(_0x4b99e6){var _0x393b94=_0x4b99e6[_0xa5f6('0x16b')](/"(.*?)"/);return _0x393b94?_0x393b94[0x1]:_0x4b99e6;}function extractCalleridNumber(_0x3a635b){var _0x316127=_0x3a635b[_0xa5f6('0x16b')](/<(.*?)>/);return _0x316127?_0x316127[0x1]:_0x3a635b;}Dialer[_0xa5f6('0xac')][_0xa5f6('0x16c')]=function(_0x142c22,_0x312e82){var _0x5bf377=this;var _0x4389e2=uuid['v4']();this['actions'][_0x4389e2]=new Action(_0x142c22,_0x312e82,_0x4389e2);return new BPromise(function(_0x3ca9ef,_0x81610f){if(_[_0xa5f6('0x3b')](_0x142c22)&&typeof _0x142c22!==_0xa5f6('0x16d')){return _0x81610f(msgResponse('originate',_0xa5f6('0x147'),_0xa5f6('0x16e')));}if(_['isUndefined'](_0x312e82['Contact'][_0xa5f6('0x16f')])||_0x312e82[_0xa5f6('0x170')]['phone']===null){return _0x81610f(msgResponse(_0xa5f6('0x171'),_0xa5f6('0x147'),_0xa5f6('0x172')));}var _0x71439c={'XMD-CALLERID':_0x5bf377[_0xa5f6('0x21')][_0x4389e2][_0xa5f6('0x173')](),'XMD-AGI':_0x142c22[_0xa5f6('0x10c')]?util[_0xa5f6('0x79')](_0xa5f6('0x174'),ipAgi,_0x142c22['dialQueueProject']):_0xa5f6('0x175'),'XMD-AGIAFTER':_0x142c22['dialQueueProject2']?util[_0xa5f6('0x79')](_0xa5f6('0x174'),ipAgi,_0x142c22[_0xa5f6('0x11d')]):'NONE','XMD-QUEUE':_0x142c22[_0xa5f6('0x4a')]===_0xa5f6('0x4b')?util[_0xa5f6('0x79')](_0xa5f6('0x176'),_0x142c22[_0xa5f6('0x3d')],_0x142c22[_0xa5f6('0x177')]||'',_0x142c22[_0xa5f6('0x111')]?'c':'',_0x142c22['dialQueueTimeout']||0x3):_0xa5f6('0x175'),'XMD-CONTACTID':_0x312e82[_0xa5f6('0xd4')],'XMD-CDRTYPE':_0xa5f6('0x7'),'CALLERID(all)':_0x5bf377['actions'][_0x4389e2][_0xa5f6('0x173')](),'XMD-AMD':_0x142c22['dialAMDActive']?'ACTIVE':'NONE','XMD-DESTINATION':_0xa5f6('0xe6')};if(_0x142c22['dialAMDActive']){_0x71439c['XMD-AMDINITIALSILENCE']=_0x142c22[_0xa5f6('0x178')]||0x9c4;_0x71439c[_0xa5f6('0x179')]=_0x142c22[_0xa5f6('0x17a')]||0x5dc;_0x71439c[_0xa5f6('0x17b')]=_0x142c22[_0xa5f6('0x17c')]||0x320;_0x71439c[_0xa5f6('0x17d')]=_0x142c22['dialAMDTotalAnalysisTime']||0x1388;_0x71439c[_0xa5f6('0x17e')]=_0x142c22[_0xa5f6('0x17f')]||0x64;_0x71439c['XMD-AMDBETWEENWORDSSILENCE']=_0x142c22['dialAMDBetweenWordsSilence']||0x32;_0x71439c['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x142c22[_0xa5f6('0x180')]||0x3;_0x71439c[_0xa5f6('0x181')]=_0x142c22[_0xa5f6('0x182')]||0x100;_0x71439c[_0xa5f6('0x183')]=_0x142c22[_0xa5f6('0x184')]||0x1388;}if(_0x142c22[_0xa5f6('0x4a')]===_0xa5f6('0x4b')){_0x71439c[_0xa5f6('0x185')]=_0x312e82['VoiceQueueId'];}else{_0x71439c[_0xa5f6('0x186')]=_0x312e82[_0xa5f6('0xd7')];}for(var _0x3a28f2 in _0x312e82[_0xa5f6('0x170')]){if(typeof _0x312e82['Contact'][_0x3a28f2]!==_0xa5f6('0x9b')){if(isNotNull(_0x312e82[_0xa5f6('0x170')][_0x3a28f2])&&_0x3a28f2!=='id'&&_0x3a28f2!=='tags'&&_0x3a28f2!==_0xa5f6('0x187')&&_0x3a28f2!==_0xa5f6('0x188')){_0x71439c[util[_0xa5f6('0x79')](_0xa5f6('0x189'),_0xa5f6('0x18a'),_[_0xa5f6('0x18b')](_0x3a28f2))]=_0x312e82[_0xa5f6('0x170')][_0x3a28f2];}}}var _0x167e0a=_0x5bf377['isTrunkReachable'](_0x142c22['Trunk'])?getCallerId(_0x142c22[_0xa5f6('0x76')]['callerid'],_0x142c22[_0xa5f6('0x18c')],_0x142c22['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x142c22[_0xa5f6('0x18d')],_0x142c22['dialRandomLastDigitCallerIdNumber']):_0x142c22['dialOriginateCallerIdNumber']):getCallerId(_[_0xa5f6('0xe2')](_0x142c22[_0xa5f6('0x141')])?_0x142c22[_0xa5f6('0x76')][_0xa5f6('0x18e')]:_0x142c22[_0xa5f6('0x141')][_0xa5f6('0x18e')],_0x142c22[_0xa5f6('0x18c')],_0x142c22[_0xa5f6('0x18f')]>0x0?getCallerIdRandom(_0x142c22['dialOriginateCallerIdNumber'],_0x142c22[_0xa5f6('0x18f')]):_0x142c22[_0xa5f6('0x18d')]);if(_0x167e0a){_0x71439c[_0xa5f6('0x190')]=_0x5bf377[_0xa5f6('0x21')][_0x4389e2][_0xa5f6('0x191')]=extractCalleridName(_0x167e0a);_0x71439c[_0xa5f6('0x192')]=_0x5bf377['actions'][_0x4389e2][_0xa5f6('0x193')]=extractCalleridNumber(_0x167e0a);}return ami[_0xa5f6('0xb0')]({'actionid':_0x4389e2,'action':_0xa5f6('0x171'),'channel':_0x5bf377[_0xa5f6('0x140')](_0x142c22[_0xa5f6('0x76')])?util['format'](_0xa5f6('0x194'),_0x142c22[_0xa5f6('0x76')]['name'],isNotNull(_0x142c22[_0xa5f6('0x5b')])?_0x142c22['dialPrefix'][_0xa5f6('0x195')]()||'':'',_0x142c22[_0xa5f6('0x196')]>0x0?_0x312e82['Contact'][_0xa5f6('0x16f')][_0xa5f6('0x197')](_0x142c22[_0xa5f6('0x196')]):_0x312e82['Contact'][_0xa5f6('0x16f')]):util[_0xa5f6('0x79')](_0xa5f6('0x194'),_[_0xa5f6('0xe2')](_0x142c22[_0xa5f6('0x141')])?_0x142c22[_0xa5f6('0x76')][_0xa5f6('0x3d')]:_0x142c22[_0xa5f6('0x141')][_0xa5f6('0x3d')],isNotNull(_0x142c22['dialPrefix'])?_0x142c22['dialPrefix'][_0xa5f6('0x195')]()||'':'',_0x142c22[_0xa5f6('0x196')]>0x0?_0x312e82['Contact'][_0xa5f6('0x16f')]['substring'](_0x142c22['dialCutDigit']):_0x312e82['Contact'][_0xa5f6('0x16f')]),'callerid':_0x167e0a,'Exten':_0xa5f6('0xe6'),'Context':_0xa5f6('0x198'),'Priority':'1','variable':_0x71439c,'timeout':(_0x142c22[_0xa5f6('0x199')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4389e2})[_0xa5f6('0xba')](function(_0x504c75){return _0x3ca9ef(_0x504c75);})[_0xa5f6('0xb3')](function(_0x35ad81){_0x142c22[_0xa5f6('0x64')]+=0x1;var _0xd20b2e=new History(_0x5bf377[_0xa5f6('0x21')][_0x4389e2]);logger[_0xa5f6('0x98')](util[_0xa5f6('0x79')]('[originateError]:\x20%s',JSON[_0xa5f6('0x78')](_0x35ad81)));_0xd20b2e[_0xa5f6('0xa8')]=0xe;_0xd20b2e[_0xa5f6('0xa9')]=_0xa5f6('0x19a');_0xd20b2e[_0xa5f6('0xab')]=moment()['format'](_0xa5f6('0x105'));_0xd20b2e[_0xa5f6('0xaa')]=_0xd20b2e[_0xa5f6('0xab')];_0x5bf377[_0xa5f6('0xce')](_0xd20b2e)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x19b')));_0x5bf377[_0xa5f6('0xcc')](_0xd20b2e)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x19b')))[_0xa5f6('0x1b')](function(){delete _0x5bf377['actions'][_0x4389e2];return _0x81610f(msgResponse('originate',_0xa5f6('0x46'),'originate\x20action\x20Error'));});});});};Dialer[_0xa5f6('0xac')][_0xa5f6('0x19c')]=function(_0x513ae9){var _0x52a395=this[_0xa5f6('0x21')][_0x513ae9[_0xa5f6('0x12a')]];if(_0x52a395){delete this['actions'][_0x513ae9['actionid']];_0x52a395[_0xa5f6('0x117')]=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));var _0xb65185=_0x52a395[_0xa5f6('0x4a')]===_0xa5f6('0x7c')?this[_0xa5f6('0x1e')][_0x52a395[_0xa5f6('0xb5')]]:this['voiceQueues'][_0x52a395['getQueue']()];if(!this['isSuccess'](_0x513ae9[_0xa5f6('0x19d')])){this[_0xa5f6('0xb7')](_0xb65185);return this[_0xa5f6('0x19e')](_0x52a395,_0xb65185,_0x513ae9)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x19f')));}this['uniqueId'][_0x513ae9[_0xa5f6('0xe1')]]=_0x52a395;}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x1a0')]=function(_0x5d8de5,_0x2a8062,_0x147ea0){var _0x5f2352=new History(_0x2a8062);if(_0x5f2352['countbusyretry']+_0x5f2352['countcongestionretry']+_0x5f2352[_0xa5f6('0xf6')]+_0x5f2352[_0xa5f6('0x102')]+_0x5f2352[_0xa5f6('0x11e')]+_0x5f2352[_0xa5f6('0x103')]+_0x5f2352['countmachineretry']+_0x5f2352[_0xa5f6('0xf7')]>=_0x147ea0[_0xa5f6('0xf8')]-0x1){return!![];}switch(_0x5d8de5){case 0x3:if(_0x5f2352[_0xa5f6('0xf6')]>=_0x147ea0[_0xa5f6('0x1a1')]-0x1){return!![];}this[_0xa5f6('0xc2')]({'active':![],'countnoanswerretry':_0x5f2352[_0xa5f6('0xf6')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0['dialNoAnswerRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352['VoiceQueueId']||undefined,'CampaignId':_0x5f2352[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1a2')));break;case 0x5:if(_0x5f2352[_0xa5f6('0xf5')]>=_0x147ea0[_0xa5f6('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x5f2352[_0xa5f6('0xf5')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0['dialBusyRetryFrequency'],_0xa5f6('0xff'))['format'](_0xa5f6('0x105')),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352['CampaignId']||undefined})['catch'](loggerCatch(_0xa5f6('0x1a4')));break;case 0x8:if(_0x5f2352[_0xa5f6('0x101')]>=_0x147ea0[_0xa5f6('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x5f2352[_0xa5f6('0x101')]+=0x1,'scheduledat':moment()['add'](_0x147ea0['dialCongestionRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1a6')));break;case 0x0:if(_0x5f2352[_0xa5f6('0x102')]>=_0x147ea0[_0xa5f6('0x1a7')]-0x1){return!![];}else{this[_0xa5f6('0xc2')]({'active':![],'countnosuchnumberretry':_0x5f2352['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0['dialNoSuchNumberRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x5f2352['ContactId'],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1a8')));}break;case 0xa:if(_0x5f2352[_0xa5f6('0x11e')]>=_0x147ea0['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x5f2352[_0xa5f6('0x11e')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0[_0xa5f6('0x1a9')],_0xa5f6('0xff'))['format'](_0xa5f6('0x105')),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352['CampaignId']||undefined})[_0xa5f6('0xb3')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5f2352[_0xa5f6('0x103')]>=_0x147ea0[_0xa5f6('0x127')]-0x1){return!![];}this[_0xa5f6('0xc2')]({'active':![],'countabandonedretry':_0x5f2352[_0xa5f6('0x103')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0[_0xa5f6('0x1aa')],'minutes')[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352['ListId'],'VoiceQueueId':_0x5f2352['VoiceQueueId']||undefined,'CampaignId':_0x5f2352['CampaignId']||undefined})[_0xa5f6('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5f2352[_0xa5f6('0xf1')]>=_0x147ea0[_0xa5f6('0xfb')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x5f2352[_0xa5f6('0xf1')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0['dialMachineRetryFrequency'],_0xa5f6('0xff'))[_0xa5f6('0x79')](_0xa5f6('0x105')),'ContactId':_0x5f2352['ContactId'],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352[_0xa5f6('0xd7')]||undefined})['catch'](loggerCatch(_0xa5f6('0x100')));break;case 0x14:if(_0x5f2352[_0xa5f6('0xf7')]>=_0x147ea0[_0xa5f6('0x1ab')]-0x1){return!![];}this[_0xa5f6('0xc2')]({'active':![],'countagentrejectretry':_0x5f2352[_0xa5f6('0xf7')]+=0x1,'scheduledat':moment()[_0xa5f6('0xfe')](_0x147ea0['dialAgentRejectRetryFrequency'],'minutes')['format'](_0xa5f6('0x105')),'ContactId':_0x5f2352[_0xa5f6('0xd4')],'ListId':_0x5f2352[_0xa5f6('0xd5')],'VoiceQueueId':_0x5f2352[_0xa5f6('0x106')]||undefined,'CampaignId':_0x5f2352[_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x19e')]=function(_0x19a1a6,_0x5a5443,_0x5da82f){var _0x2c2306=this;var _0x11b12a=new History(_0x19a1a6);return new BPromise(function(_0x3db5b0,_0xb8619b){if(_[_0xa5f6('0x3b')](_0x5a5443)&&typeof _0x5a5443!=='object'){return _0xb8619b(msgResponse(_0xa5f6('0x1ac'),_0xa5f6('0x147'),_0xa5f6('0x1ad')));}if(_[_0xa5f6('0x3b')](_0x5da82f)&&typeof _0x5da82f!==_0xa5f6('0x16d')){return _0xb8619b(msgResponse(_0xa5f6('0x1ac'),_0xa5f6('0x147'),_0xa5f6('0x1ae')));}switch(_0x5da82f['reason']){case'0':_0x5a5443[_0xa5f6('0x63')]+=0x1;_0x11b12a[_0xa5f6('0xa8')]=0x0;_0x11b12a[_0xa5f6('0xa9')]=_0xa5f6('0x1af');_0x11b12a[_0xa5f6('0x102')]+=0x1;_0x11b12a[_0xa5f6('0xf2')]+=0x1;ami[_0xa5f6('0x49')](_0xa5f6('0x1b0'),ut[_0xa5f6('0xeb')](_0x19a1a6,_0xa5f6('0x1b1')));_0x2c2306['createHistory'](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xf4')));if(_0x2c2306[_0xa5f6('0x1a0')](0x0,_0x19a1a6,_0x5a5443)){if(_0x11b12a[_0xa5f6('0x102')]>=_0x5a5443['dialNoSuchNumberMaxRetry']){_0x2c2306[_0xa5f6('0xfc')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1b2'));}else{_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1b2'));}}break;case'3':_0x5a5443['outboundNoAnswerCallsDay']+=0x1;_0x11b12a[_0xa5f6('0xa8')]=0x3;_0x11b12a[_0xa5f6('0xa9')]=_0xa5f6('0x1b3');_0x11b12a[_0xa5f6('0xf6')]+=0x1;_0x11b12a[_0xa5f6('0xf2')]+=0x1;ami[_0xa5f6('0x49')](_0xa5f6('0x1b4'),ut[_0xa5f6('0xeb')](_0x19a1a6,_0xa5f6('0x1b5')));_0x2c2306['createHistory'](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2c2306['checkRetriveMax'](0x3,_0x19a1a6,_0x5a5443)){if(_0x11b12a['countnoanswerretry']>=_0x5a5443[_0xa5f6('0x1a1')]){_0x2c2306[_0xa5f6('0xfc')](_0x11b12a,_0x3db5b0,_0xb8619b,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1b6'));}}break;case'5':_0x5a5443[_0xa5f6('0x5f')]+=0x1;_0x11b12a[_0xa5f6('0xa8')]=0x5;_0x11b12a[_0xa5f6('0xa9')]='Busy';_0x11b12a[_0xa5f6('0xf5')]+=0x1;_0x11b12a[_0xa5f6('0xf2')]+=0x1;ami[_0xa5f6('0x49')](_0xa5f6('0x1b7'),ut['buildObj'](_0x19a1a6,_0xa5f6('0x1b8')));_0x2c2306[_0xa5f6('0xce')](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1b9')));if(_0x2c2306['checkRetriveMax'](0x5,_0x19a1a6,_0x5a5443)){if(_0x11b12a['countbusyretry']>=_0x5a5443[_0xa5f6('0x1a3')]){_0x2c2306['createStateFinal'](_0x11b12a,_0x3db5b0,_0xb8619b,'reason\x205\x20busy');}else{_0x2c2306['stateGlobal'](_0x11b12a,_0x3db5b0,_0xb8619b,'reason\x205\x20busy');}}break;case'8':_0x5a5443['outboundCongestionCallsDay']+=0x1;_0x11b12a[_0xa5f6('0xa8')]=0x8;_0x11b12a[_0xa5f6('0xa9')]=_0xa5f6('0x1ba');_0x11b12a[_0xa5f6('0x101')]+=0x1;_0x11b12a[_0xa5f6('0xf2')]+=0x1;ami[_0xa5f6('0x49')]('custom:agentcongestion',ut['buildObj'](_0x19a1a6,'congestion'));_0x2c2306[_0xa5f6('0xce')](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1bb')));if(_0x2c2306[_0xa5f6('0x1a0')](0x8,_0x19a1a6,_0x5a5443)){if(_0x11b12a[_0xa5f6('0x101')]>=_0x5a5443['dialCongestionMaxRetry']){_0x2c2306['createStateFinal'](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1bc'));}else{_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1bc'));}}break;case'11':_0x5a5443['outboundAbandonedCallsDay']+=0x1;_0x11b12a['state']=0xb;_0x11b12a[_0xa5f6('0xa9')]=_0xa5f6('0x124');_0x11b12a[_0xa5f6('0x103')]+=0x1;_0x11b12a['countglobal']+=0x1;_0x2c2306[_0xa5f6('0xce')](_0x11b12a)['catch'](loggerCatch(_0xa5f6('0x1bd')));if(_0x2c2306[_0xa5f6('0x1a0')](0xb,_0x19a1a6,_0x5a5443)){if(_0x11b12a[_0xa5f6('0x103')]>=_0x5a5443[_0xa5f6('0x127')]){_0x2c2306[_0xa5f6('0xfc')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1be'));}else{_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1be'));}}break;case'20':_0x5a5443[_0xa5f6('0x66')]+=0x1;_0x11b12a['state']=0x14;_0x11b12a[_0xa5f6('0xa9')]='AgentReject';_0x11b12a['countagentrejectretry']+=0x1;_0x11b12a[_0xa5f6('0xf2')]+=0x1;ami[_0xa5f6('0x49')](_0xa5f6('0x1bf'),ut[_0xa5f6('0xeb')](_0x19a1a6,_0xa5f6('0x1c0')));_0x2c2306[_0xa5f6('0xce')](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1c1')));if(_0x2c2306['checkRetriveMax'](0x14,_0x19a1a6,_0x5a5443)){if(_0x11b12a['countagentrejectretry']>=_0x5a5443[_0xa5f6('0x1ab')]){_0x2c2306[_0xa5f6('0xfc')](_0x11b12a,_0x3db5b0,_0xb8619b,'reason\x2020\x20agentreject');}else{_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0xa5f6('0x1c2'));}}break;default:_0x5a5443[_0xa5f6('0x67')]+=0x1;_0x11b12a['state']=0xc;_0x11b12a[_0xa5f6('0xa9')]=_0x5da82f[_0xa5f6('0x10f')];_0x2c2306[_0xa5f6('0xce')](_0x11b12a)[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1c3')));if(_0x2c2306[_0xa5f6('0x1a0')](_0x5da82f[_0xa5f6('0x10f')],_0x19a1a6,_0x5a5443)){if(_0x11b12a[_0xa5f6('0xf5')]+_0x11b12a[_0xa5f6('0x101')]+_0x11b12a[_0xa5f6('0xf6')]+_0x11b12a[_0xa5f6('0x102')]+_0x11b12a[_0xa5f6('0x11e')]+_0x11b12a[_0xa5f6('0x103')]+_0x11b12a[_0xa5f6('0xf1')]+_0x11b12a[_0xa5f6('0xf7')]>=_0x5a5443[_0xa5f6('0xf8')]){_0x2c2306[_0xa5f6('0xf9')](_0x11b12a,_0x3db5b0,_0xb8619b,_0x5da82f[_0xa5f6('0x10f')]);}else{_0x2c2306[_0xa5f6('0xfc')](_0x11b12a,_0x3db5b0,_0xb8619b,_0x5da82f['reason']);}}}});};Dialer[_0xa5f6('0xac')][_0xa5f6('0xf9')]=function(_0x1ebcfc,_0x3b12f1,_0x254ae2,_0x4a2638){var _0x311af0=new Final(_0x1ebcfc);_0x311af0[_0xa5f6('0xa8')]=0xf;_0x311af0[_0xa5f6('0xa9')]=_0xa5f6('0x1c4');this[_0xa5f6('0xfc')](_0x311af0,_0x3b12f1,_0x254ae2,_0x4a2638);};Dialer[_0xa5f6('0xac')][_0xa5f6('0xfc')]=function(_0x348967,_0x5416ad,_0x32e08d,_0x168d40){this[_0xa5f6('0xcc')](_0x348967)[_0xa5f6('0xba')](function(){return _0x5416ad(msgResponse(_0xa5f6('0x1ac'),'Success',_0x168d40));})[_0xa5f6('0xb3')](function(){return _0x32e08d(msgResponse(_0xa5f6('0x1c5'),_0xa5f6('0x147'),'contact\x20not\x20moved'));});};Dialer[_0xa5f6('0xac')][_0xa5f6('0x9')]=function(_0x5ab302){var _0x30492a=_0x5ab302[_0xa5f6('0x1c6')]/0x64;var _0x5b3cc8=_0x5ab302[_0xa5f6('0x62')]/(_0x5ab302[_0xa5f6('0x62')]+_0x5ab302[_0xa5f6('0x5d')]);var _0x53545e=Math[_0xa5f6('0x1c7')](_0x5ab302[_0xa5f6('0x1c8')]*(_0x5ab302[_0xa5f6('0x1c9')]/0x64));var _0x349cf6=Math[_0xa5f6('0x1c7')](_0x5ab302['predictiveIntervalAvailable']*(_0x5ab302['predictiveIntervalMinThreshold']/0x64));var _0x53d627=_0x5ab302['available']+_0x5ab302[_0xa5f6('0x53')];var _0x423b2e=Math[_0xa5f6('0x1ca')](_0x5ab302[_0xa5f6('0x72')]*_0x5ab302[_0xa5f6('0x73')]*_0x5ab302[_0xa5f6('0x6d')]*_0x5ab302[_0xa5f6('0x6e')]);if(_['isUndefined'](_0x5ab302[_0xa5f6('0x75')])){if(!_[_0xa5f6('0x3b')](_0x5ab302[_0xa5f6('0x24')])){_0x5ab302[_0xa5f6('0x24')]=undefined;loggerPredictive[_0xa5f6('0x98')](_0xa5f6('0x1cb'),_0xa5f6('0x1cc'));}if(!_[_0xa5f6('0x3b')](_0x5ab302['handlePredictive'])){loggerPredictive[_0xa5f6('0x98')]('[startMethodPredictive][StartProgressive]',_0xa5f6('0x1cd'));clearInterval(_0x5ab302[_0xa5f6('0x93')]);_0x5ab302[_0xa5f6('0x93')]=undefined;}_0x5ab302['startProgressive']=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));loggerPredictive[_0xa5f6('0x80')](_0x5ab302['name'],'collection\x20data\x20in\x20progressive\x20at',_0x5ab302[_0xa5f6('0x75')]);this[_0xa5f6('0x15b')](_0x5ab302,0x1);}else if(ifInterval(_0x5ab302['dialPredictiveInterval'],_0x5ab302[_0xa5f6('0x75')])){this[_0xa5f6('0x15b')](_0x5ab302,0x1);loggerPredictiveCalls[_0xa5f6('0x80')](_0xa5f6('0x1ce'),_0x5ab302[_0xa5f6('0x75')],_0x5ab302['name']);_0x5ab302['erlangCalls']=0x0;_0x5ab302[_0xa5f6('0x119')]=0x0;}else if(_0x30492a<_0x5b3cc8&&_0x5ab302[_0xa5f6('0x1cf')]==='dropRate'){freeVariablesPredictive(_0x5ab302);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xa5f6('0x1d0'),_0x5b3cc8,_0xa5f6('0x75'),_0x5ab302[_0xa5f6('0x3d')]);}else if(_0x423b2e<_0x5ab302['predictiveIntervalErlangCallsDroppedCalls']&&_0x5ab302[_0xa5f6('0x1cf')]===_0xa5f6('0x1d1')){freeVariablesPredictive(_0x5ab302);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xa5f6('0x1d2'),_0x423b2e,_0xa5f6('0x1d3'),_0x5ab302[_0xa5f6('0x119')],_0xa5f6('0x75'),_0x5ab302[_0xa5f6('0x3d')]);}else if(!ifInterval(_0x5ab302['dialPredictiveInterval'],_0x5ab302['startProgressive'])&&_[_0xa5f6('0x3b')](_0x5ab302[_0xa5f6('0x24')])&&!_[_0xa5f6('0x3b')](_0x5ab302[_0xa5f6('0x75')])){_0x5ab302[_0xa5f6('0x24')]=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));loggerPredictive[_0xa5f6('0x80')](_0x5ab302[_0xa5f6('0x3d')],_0xa5f6('0x1d4'),_0x5ab302['startPredictive']);this['averageHandleTime'](_0x5ab302['dialPredictiveInterval'])[_0xa5f6('0xba')](this['getDataPredictive'](_0x5ab302))[_0xa5f6('0xba')](mergeDataErlangB(_0x5ab302))['then'](this[_0xa5f6('0x1d5')](_0x5ab302))['catch'](loggerCatchPredictive(_0xa5f6('0x1d6'),_0x5ab302));}else if(!ifInterval(_0x5ab302[_0xa5f6('0x1d7')],_0x5ab302[_0xa5f6('0x24')])){_0x5ab302[_0xa5f6('0x119')]=0x0;_0x5ab302[_0xa5f6('0x24')]=moment()[_0xa5f6('0x79')](_0xa5f6('0x105'));loggerPredictive[_0xa5f6('0x80')](_0x5ab302[_0xa5f6('0x3d')],_0xa5f6('0x1d8'),_0x5ab302[_0xa5f6('0x24')]);clearInterval(_0x5ab302[_0xa5f6('0x93')]);_0x5ab302[_0xa5f6('0x93')]=undefined;this[_0xa5f6('0x1d9')](_0x5ab302[_0xa5f6('0x1d7')])[_0xa5f6('0xba')](this[_0xa5f6('0x1da')](_0x5ab302))[_0xa5f6('0xba')](mergeDataErlangB(_0x5ab302))[_0xa5f6('0xba')](this[_0xa5f6('0x1d5')](_0x5ab302))['catch'](loggerCatchPredictive(_0xa5f6('0x1db'),_0x5ab302));}else if(_0x5ab302[_0xa5f6('0x1c8')]&&_0x53d627<_0x5ab302[_0xa5f6('0x1c8')]-_0x349cf6){freeVariablesPredictive(_0x5ab302);loggerPredictive[_0xa5f6('0x80')](_0x5ab302['name'],_0xa5f6('0x1dc'),_0x53d627,')\x20are\x20less\x20than\x20threshold\x20(',_0x5ab302['predictiveIntervalAvailable'],'-',_0x349cf6,'=',_0x5ab302[_0xa5f6('0x1c8')]-_0x349cf6,')');}else if(_0x5ab302[_0xa5f6('0x1c8')]&&_0x53d627>_0x5ab302['predictiveIntervalAvailable']+_0x53545e){freeVariablesPredictive(_0x5ab302);loggerPredictive[_0xa5f6('0x80')](_0x5ab302[_0xa5f6('0x3d')],_0xa5f6('0x1dc'),_0x53d627,_0xa5f6('0x1dd'),_0x5ab302['predictiveIntervalAvailable'],'+',_0x53545e,'=',_0x5ab302[_0xa5f6('0x1c8')]+_0x53545e,')');}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x1da')]=function(_0x17d8ce){var _0x222ee9=this;return function(_0x444656){return new BPromise(function(_0x968215,_0x5a9859){_['merge'](_0x17d8ce,_0x444656[0x0]);if(checkGetDataPredictive(_0x444656[0x0])){var _0x2a6999=_0x17d8ce[_0xa5f6('0x1c8')]=_0x17d8ce[_0xa5f6('0x53')]+_0x17d8ce[_0xa5f6('0x4e')];var _0x332ec7=_0x17d8ce['dialPredictiveInterval']*0x3c;var _0x3c15ad=_0x444656[0x0][_0xa5f6('0x6a')]+_0x444656[0x0][_0xa5f6('0x69')];var _0x3b0228=(_0x444656[0x0]['predictiveIntervalAnsweredCalls']+_0x444656[0x0][_0xa5f6('0x6c')]+_0x444656[0x0][_0xa5f6('0x6b')])/_0x444656[0x0][_0xa5f6('0x70')];_0x17d8ce['predictiveIntervalHitRate']=_0x3b0228>0x0?_0x3b0228:0x1;switch(_0x17d8ce[_0xa5f6('0x1cf')]){case _0xa5f6('0x1d1'):var _0x47623a=_0x17d8ce[_0xa5f6('0x1c6')]/0x64;return _0x222ee9[_0xa5f6('0x1de')](_0x2a6999,_0x332ec7,_0x3c15ad,_0x3b0228,_0x47623a)[_0xa5f6('0xba')](function(_0x30f486){return _0x968215(_0x30f486);});case _0xa5f6('0x1df'):var _0x84dda0=_0x17d8ce[_0xa5f6('0x1c6')]/0x64;return _0x222ee9[_0xa5f6('0x1e0')](_0x2a6999,_0x332ec7,_0x3c15ad,_0x3b0228,_0x84dda0)['then'](function(_0x5c8485){return _0x968215(_0x5c8485);});default:return _0x5a9859(msgResponse('[getDataPredictive]',_0xa5f6('0x147'),_0xa5f6('0x1e1')));}}else{return _0x5a9859(msgResponse(_0xa5f6('0x1e2'),_0xa5f6('0x147'),'check\x20failure'));}});};};Dialer[_0xa5f6('0xac')]['getDataPredictiveOld']=function(_0xdda3ff){var _0x584d1e=this;return function(_0x43d5ab){return new BPromise(function(_0x125feb,_0x2de2b3){_[_0xa5f6('0x8f')](_0xdda3ff,_0x43d5ab[0x0]);if(checkGetDataPredictive(_0x43d5ab[0x0])){loggerPredictive['info'](JSON[_0xa5f6('0x78')](_0x43d5ab[0x0]));if(_0xdda3ff[_0xa5f6('0x1cf')]==='dropRate'){return _0x584d1e[_0xa5f6('0xca')](_0xdda3ff['id'])[_0xa5f6('0xba')](function(_0x1ab6da){var _0x2a826f=_0xdda3ff[_0xa5f6('0x4f')]-_0x1ab6da[0x0][_0xa5f6('0x1e3')];var _0x57fdd4=_0xdda3ff[_0xa5f6('0x1d7')]*0x3c;var _0x47b53c=_0x43d5ab[0x0]['predictiveIntervalAvgTalktime']+_0x43d5ab[0x0][_0xa5f6('0x69')];var _0x1b52de=(_0x43d5ab[0x0]['predictiveIntervalAnsweredCalls']+_0x43d5ab[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x43d5ab[0x0][_0xa5f6('0x6b')])/_0x43d5ab[0x0]['predictiveIntervalTotalCalls'];var _0x4b1df6=_0xdda3ff[_0xa5f6('0x1c6')]/0x64;_0xdda3ff[_0xa5f6('0x6f')]=_0x1ab6da[0x0][_0xa5f6('0x1e3')]||0x0;_0xdda3ff['predictiveIntervalHitRate']=_0x1b52de>0x0?_0x1b52de:0x1;return _0x584d1e[_0xa5f6('0x1de')](_0x2a826f,_0x57fdd4,_0x47b53c,_0x1b52de,_0x4b1df6);})[_0xa5f6('0xba')](function(_0x278a15){return _0x125feb(_0x278a15);})['catch'](function(_0x15b971){return _0x2de2b3(msgResponse(_0xa5f6('0x1e4'),_0xa5f6('0x147'),JSON[_0xa5f6('0x78')](_0x15b971)));});}if(_0xdda3ff[_0xa5f6('0x1cf')]===_0xa5f6('0x1df')){return _0x584d1e[_0xa5f6('0xca')](_0xdda3ff['id'])['then'](function(_0x446e32){var _0x2d6f1f=_0xdda3ff['loggedIn']-_0x446e32[0x0][_0xa5f6('0x1e3')];var _0x40b0dc=_0xdda3ff[_0xa5f6('0x1d7')]*0x3c;var _0x1a18d0=_0x43d5ab[0x0][_0xa5f6('0x6a')]+_0x43d5ab[0x0][_0xa5f6('0x69')];var _0x5771c2=(_0x43d5ab[0x0][_0xa5f6('0x68')]+_0x43d5ab[0x0][_0xa5f6('0x6c')]+_0x43d5ab[0x0][_0xa5f6('0x6b')])/_0x43d5ab[0x0]['predictiveIntervalTotalCalls'];var _0x635ae5=_0xdda3ff[_0xa5f6('0x1c6')]/0x64;_0xdda3ff['predictiveIntervalPauses']=_0x446e32[0x0]['outboundQueuePauses']||0x0;_0xdda3ff[_0xa5f6('0x6d')]=_0x5771c2>0x0?_0x5771c2:0x1;return _0x584d1e[_0xa5f6('0x1e0')](_0x2d6f1f,_0x40b0dc,_0x1a18d0,_0x5771c2,_0x635ae5);})[_0xa5f6('0xba')](function(_0x5c9749){return _0x125feb(_0x5c9749);})[_0xa5f6('0xb3')](function(_0x208b74){return _0x2de2b3(msgResponse(_0xa5f6('0x1e4'),'Failure',JSON['stringify'](_0x208b74)));});}}else{return _0x2de2b3(msgResponse(_0xa5f6('0x1e2'),_0xa5f6('0x147'),_0xa5f6('0x1e5')));}});};};Dialer[_0xa5f6('0xac')]['startMethodPredictive']=function(_0x2bade9){var _0x1759f2=this;return function(){var _0x515142=0x0;var _0x7bb6eb=Math[_0xa5f6('0x1ca')](_0x2bade9[_0xa5f6('0x8c')]*0x3e8);if(_0x7bb6eb>0x0){_0x7bb6eb=_0x7bb6eb<0x64?0x64:_0x7bb6eb;loggerPredictive['info'](_0x2bade9[_0xa5f6('0x3d')],_0xa5f6('0x1e6'),_0x7bb6eb,'milliseconds');_0x2bade9[_0xa5f6('0x93')]=setInterval(function(){_0x1759f2[_0xa5f6('0x93')](_0x2bade9);loggerPredictiveCalls[_0xa5f6('0x80')]('[handlePredictive]',_0x515142+=0x1);},_0x7bb6eb);}else{loggerPredictive['info'](_0x2bade9[_0xa5f6('0x3d')],_0xa5f6('0x1e7'));}};};Dialer[_0xa5f6('0xac')][_0xa5f6('0x1e8')]=function(_0x130ca7,_0x1c54c8){var _0x294cf2=this;return function(_0x35cedf){if(_[_0xa5f6('0x45')](_0x35cedf)){if(_['isNil'](_0x1c54c8[_0xa5f6('0xd6')])||!_0x1c54c8['recallme']){if(_0x130ca7[_0xa5f6('0x5a')]===_0xa5f6('0x8')){_0x130ca7[_0xa5f6('0x12f')]=_[_0xa5f6('0x3b')](_0x130ca7[_0xa5f6('0x12f')])?!![]:_0x130ca7['queueStatusComplete'];var _0x3299f9=uuid['v4']();_0x294cf2[_0xa5f6('0x21')][_0x3299f9]=new Action(_0x130ca7,_0x1c54c8,_0x3299f9);loggerBooked['info']('[booked][checkContactBlack]',_0x3299f9,'queueStatusComplete:\x20',JSON['stringify'](_0x130ca7[_0xa5f6('0x12f')]),_0xa5f6('0x1e9'),_0x130ca7['name']);if(_0x130ca7['queueStatusComplete']){_0x130ca7['queueStatusComplete']=![];_0x294cf2['queueBooked'][_0x294cf2[_0xa5f6('0x21')][_0x3299f9][_0xa5f6('0xb5')]]=[];ami[_0xa5f6('0xb0')]({'actionid':_0x3299f9,'action':_0xa5f6('0x1ea'),'queue':_0x130ca7['name']})['catch'](function(){_0x294cf2['updateOriginated'](_0x130ca7);_0x294cf2['rescheduleContact']({'active':![],'ContactId':_0x294cf2['actions'][_0x3299f9][_0xa5f6('0xd4')],'ListId':_0x294cf2[_0xa5f6('0x21')][_0x3299f9][_0xa5f6('0xd5')],'VoiceQueueId':_0x294cf2['actions'][_0x3299f9]['VoiceQueueId']||undefined,'CampaignId':_0x294cf2[_0xa5f6('0x21')][_0x3299f9][_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0x1eb')));delete _0x294cf2[_0xa5f6('0x21')][_0x3299f9];});}else{loggerBooked[_0xa5f6('0x80')](_0xa5f6('0x1ec'),JSON[_0xa5f6('0x78')](_0x130ca7['queueStatusComplete']),_0xa5f6('0x1e9'),_0x130ca7[_0xa5f6('0x3d')]);_0x294cf2[_0xa5f6('0xb7')](_0x130ca7);_0x294cf2[_0xa5f6('0xc2')]({'active':![],'ContactId':_0x294cf2[_0xa5f6('0x21')][_0x3299f9][_0xa5f6('0xd4')],'ListId':_0x294cf2[_0xa5f6('0x21')][_0x3299f9][_0xa5f6('0xd5')],'VoiceQueueId':_0x294cf2['actions'][_0x3299f9]['VoiceQueueId']||undefined,'CampaignId':_0x294cf2['actions'][_0x3299f9][_0xa5f6('0xd7')]||undefined})[_0xa5f6('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x294cf2[_0xa5f6('0x21')][_0x3299f9];}}else{return _0x294cf2[_0xa5f6('0x16c')](_0x130ca7,_0x1c54c8);}}else{if(getDiff(_0x1c54c8[_0xa5f6('0x1ed')])<_0x130ca7[_0xa5f6('0x1ee')]*0x3c){if(_0x1c54c8[_0xa5f6('0x1ef')]&&!_0x1c54c8[_0xa5f6('0x1ef')][_0xa5f6('0x1f0')]){_0x294cf2['preview'][_0xa5f6('0x132')](_0x1c54c8['id'])[_0xa5f6('0x1b')](function(){_0x294cf2[_0xa5f6('0xb7')](_0x130ca7);});}else{_0x294cf2[_0xa5f6('0xc4')]({'active':![]},_0x1c54c8['id'],0x1)['finally'](function(){_0x294cf2['updateOriginated'](_0x130ca7);});}}else{_0x130ca7[_0xa5f6('0x65')]+=0x1;_0x294cf2[_0xa5f6('0xb7')](_0x130ca7);if(_0x130ca7[_0xa5f6('0x1f1')]){_0x294cf2[_0xa5f6('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c54c8[_0xa5f6('0xd4')],'ListId':_0x1c54c8[_0xa5f6('0xd5')],'VoiceQueueId':_0x1c54c8[_0xa5f6('0x106')]||undefined,'CampaignId':_0x1c54c8[_0xa5f6('0xd7')]||undefined})['catch'](loggerCatch(_0xa5f6('0x1f2')));_0x294cf2[_0xa5f6('0xce')](createObjHistory(_0x130ca7,_0x1c54c8,_0xa5f6('0x1f3'),0x17,_0xa5f6('0x1f4')))['catch'](loggerCatch(_0xa5f6('0x1f5')));}else{_0x294cf2['saveInDb'](createObjHistory(_0x130ca7,_0x1c54c8,'RECALLFAILEDTIMEOUT',0x16,_0xa5f6('0x1f6')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x130ca7[_0xa5f6('0x5e')]+=0x1;_0x294cf2[_0xa5f6('0xe0')](createObjHistory(_0x130ca7,_0x1c54c8,'BLACKLIST',0xd,_0xa5f6('0x1f7')),_0xa5f6('0x1f8'),'[Originate][MoveBlacklist]');throw _0xa5f6('0x1f9');}};};Dialer[_0xa5f6('0xac')][_0xa5f6('0x15f')]=function(_0x3b8c2e){var _0x5a72ed=this;var _0x53fb11=_0x3b8c2e[_0xa5f6('0x1fa')]-_0x3b8c2e['originated']-_0x3b8c2e[_0xa5f6('0xc7')];emitCampaignSummary(_0x3b8c2e);if(_0x53fb11>0x0){if(_0x53fb11>this[_0xa5f6('0x20')]){_0x53fb11=this[_0xa5f6('0x20')];}_0x3b8c2e[_0xa5f6('0xc7')]+=_0x53fb11;this[_0xa5f6('0xc8')](_0x3b8c2e['id'],_0x53fb11,_0x3b8c2e['dialOrderByScheduledAt'],_0x3b8c2e)[_0xa5f6('0xba')](function(_0xa3344a){_0x3b8c2e[_0xa5f6('0xc7')]-=_0x53fb11;_0x3b8c2e[_0xa5f6('0xc7')]=_0x3b8c2e[_0xa5f6('0xc7')]>0x0?_0x3b8c2e[_0xa5f6('0xc7')]:0x0;if(!checkContactEmpty(_0xa3344a)){_0x3b8c2e[_0xa5f6('0x3f')]=_0xa5f6('0xa1');logger[_0xa5f6('0x80')](_0xa5f6('0x1fb')+_0x3b8c2e[_0xa5f6('0x3d')]);}else{_0x3b8c2e['originated']+=_0xa3344a[_0xa5f6('0x14b')];_0x3b8c2e[_0xa5f6('0x3f')]=_0xa5f6('0x1fc');for(var _0x3fb4ed=0x0;_0x3fb4ed<_0xa3344a[_0xa5f6('0x14b')];_0x3fb4ed+=0x1){_0x3b8c2e['ivrTotalCallsDays']+=0x1;if(_[_0xa5f6('0xe2')](_0xa3344a[_0x3fb4ed])||_[_0xa5f6('0xe2')](_0xa3344a[_0x3fb4ed][_0xa5f6('0x170')])||_[_0xa5f6('0xe2')](_0xa3344a[_0x3fb4ed][_0xa5f6('0x170')][_0xa5f6('0x16f')])){_0x5a72ed[_0xa5f6('0xd1')](_0xa5f6('0x1fd'),_0x3b8c2e,_0xa3344a[_0x3fb4ed]);}else{_0x5a72ed[_0xa5f6('0xbe')](_[_0xa5f6('0xd3')](_0xa3344a[_0x3fb4ed],[_0xa5f6('0xd7'),'Contact.phone']))[_0xa5f6('0xba')](_0x5a72ed['checkContactBlack'](_0x3b8c2e,_0xa3344a[_0x3fb4ed]))[_0xa5f6('0xb3')](_0x5a72ed[_0xa5f6('0xd0')](_0xa5f6('0x1fe'),_0x3b8c2e));}}}})[_0xa5f6('0xb3')](loggerGetContactDialer(_0xa5f6('0x1ff'),_0x3b8c2e,_0x53fb11));}};Dialer['prototype'][_0xa5f6('0x15b')]=function(_0x207888,_0x25a397){var _0x1c7841=this;var _0x450d90=[];var _0x1bbd96=_0x25a397>=0x1?_0x25a397:0x1;if(_0x207888['dialMethod']===_0xa5f6('0x8')){_0x1bbd96=0x1;}var _0x54ca5f=Math[_0xa5f6('0x1ca')](_0x207888[_0xa5f6('0x4e')]*_0x1bbd96)-_0x207888[_0xa5f6('0x71')]-_0x207888[_0xa5f6('0xc7')];emitVoiceQueueSummary(_0x207888);if(_0x207888[_0xa5f6('0x200')]>0x0){var _0x39ed51=_0x207888[_0xa5f6('0x200')]-_0x207888['originated']-_0x207888['talking']-_0x207888['temp']-_0x207888[_0xa5f6('0x50')];if(_0x54ca5f>_0x39ed51){_0x54ca5f=_0x39ed51;}}if(_0x54ca5f>0x0){if(_0x207888[_0xa5f6('0x5a')]===_0xa5f6('0x8')){_0x54ca5f=0x1;}if(_0x54ca5f>this[_0xa5f6('0x20')]){_0x54ca5f=this[_0xa5f6('0x20')];}_0x207888[_0xa5f6('0xc7')]+=_0x54ca5f;for(var _0x55ddb2 in this[_0xa5f6('0x1f')]){if(typeof this[_0xa5f6('0x1f')][_0x55ddb2]!=='undefined'){if(this['agents'][_0x55ddb2][_0xa5f6('0xa8')]===_0xa5f6('0x201')&&this['agents'][_0x55ddb2]['status']===_0xa5f6('0xde')){_0x450d90[_0xa5f6('0x12e')](this[_0xa5f6('0x1f')][_0x55ddb2]['id']);}}}this[_0xa5f6('0xc6')](_0x207888['id'],_0x450d90,_0x54ca5f,_0x207888[_0xa5f6('0x202')],_0x207888)['then'](function(_0x142961){_0x207888[_0xa5f6('0xc7')]-=_0x54ca5f;_0x207888[_0xa5f6('0xc7')]=_0x207888[_0xa5f6('0xc7')]>0x0?_0x207888[_0xa5f6('0xc7')]:0x0;if(!checkContactEmpty(_0x142961)){_0x1c7841['countReScheduled'](_0x207888)[_0xa5f6('0xba')](sendMessageReschedule(_0x207888))[_0xa5f6('0xb3')](loggerCatch(_0xa5f6('0xbb')));}else{_0x207888[_0xa5f6('0x71')]+=_0x142961[_0xa5f6('0x14b')];_0x207888[_0xa5f6('0x3f')]=_0x207888[_0xa5f6('0x5a')]==='booked'?_0xa5f6('0x203'):_0xa5f6('0x1fc');for(var _0x4c720b=0x0;_0x4c720b<_0x142961[_0xa5f6('0x14b')];_0x4c720b+=0x1){if(_[_0xa5f6('0xe2')](_0x142961[_0x4c720b])||_[_0xa5f6('0xe2')](_0x142961[_0x4c720b]['Contact'])||_[_0xa5f6('0xe2')](_0x142961[_0x4c720b][_0xa5f6('0x170')]['phone'])){_0x1c7841[_0xa5f6('0xd1')]('[actionOriginate]\x20',_0x207888,_0x142961[_0x4c720b]);}else{_0x1c7841['checkIsBlackList'](_[_0xa5f6('0xd3')](_0x142961[_0x4c720b],[_0xa5f6('0x106'),_0xa5f6('0x204')]))[_0xa5f6('0xba')](_0x1c7841[_0xa5f6('0x1e8')](_0x207888,_0x142961[_0x4c720b]))[_0xa5f6('0xb3')](_0x1c7841[_0xa5f6('0xd0')](_0xa5f6('0x1fd'),_0x207888));}}}})[_0xa5f6('0xb3')](loggerGetContactDialer(_0xa5f6('0x205'),_0x207888,_0x54ca5f));}};Dialer[_0xa5f6('0xac')][_0xa5f6('0x93')]=function(_0xec7966){if(_0xec7966[_0xa5f6('0x200')]>0x0){var _0x2d3382=_0xec7966[_0xa5f6('0x200')]-_0xec7966[_0xa5f6('0x71')]-_0xec7966['talking'];if(_0x2d3382>0x0){this[_0xa5f6('0x206')](_0xec7966);}else{loggerPredictiveCalls[_0xa5f6('0x80')](_0xa5f6('0x207'));}}else{this['tryOriginatePredictive'](_0xec7966);}};Dialer[_0xa5f6('0xac')]['tryOriginatePredictive']=function(_0x4fbb60){var _0x19ff62=this;var _0x20f11c=[];_0x4fbb60[_0xa5f6('0x71')]+=0x1;for(var _0x54849a in this[_0xa5f6('0x1f')]){if(typeof this[_0xa5f6('0x1f')][_0x54849a]!==_0xa5f6('0x9b')){if(this[_0xa5f6('0x1f')][_0x54849a][_0xa5f6('0xa8')]===_0xa5f6('0x201')&&this[_0xa5f6('0x1f')][_0x54849a][_0xa5f6('0xb1')]===_0xa5f6('0xde')){_0x20f11c['push'](this[_0xa5f6('0x1f')][_0x54849a]['id']);}}}this[_0xa5f6('0xc6')](_0x4fbb60['id'],_0x20f11c,0x1,_0x4fbb60[_0xa5f6('0x202')],_0x4fbb60)[_0xa5f6('0xba')](function(_0x2d7ff1){if(!checkContactEmpty(_0x2d7ff1)){checkContactLowerLimitOriginate(_0x4fbb60,0x1,0x0);_0x19ff62[_0xa5f6('0xb9')](_0x4fbb60)['then'](sendMessageReschedule(_0x4fbb60))[_0xa5f6('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x4fbb60[_0xa5f6('0x3f')]=_0xa5f6('0x1fc');if(_[_0xa5f6('0xe2')](_0x2d7ff1[0x0])||_[_0xa5f6('0xe2')](_0x2d7ff1[0x0]['Contact'])||_[_0xa5f6('0xe2')](_0x2d7ff1[0x0][_0xa5f6('0x170')][_0xa5f6('0x16f')])){_0x19ff62[_0xa5f6('0xd1')](_0xa5f6('0x1fd'),_0x4fbb60,_0x2d7ff1[0x0]);}else{_0x19ff62[_0xa5f6('0xbc')](_[_0xa5f6('0xd3')](_0x2d7ff1[0x0],[_0xa5f6('0x106'),_0xa5f6('0x204')]))[_0xa5f6('0xba')](_0x19ff62[_0xa5f6('0x1e8')](_0x4fbb60,_0x2d7ff1[0x0]))[_0xa5f6('0xb3')](_0x19ff62[_0xa5f6('0xd0')]('[actionOriginatePredictive]\x20',_0x4fbb60));}}})[_0xa5f6('0xb3')](loggerGetContactDialer(_0xa5f6('0x208'),_0x4fbb60,0x1));emitVoiceQueueSummary(_0x4fbb60);};Dialer['prototype'][_0xa5f6('0x1de')]=function(_0x5e78fd,_0x32567c,_0x4aef42,_0x46f044,_0x5a91f3,_0x34758c){loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x209'));loggerPredictive['info'](_0xa5f6('0x20a'),_0x5e78fd);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20b'),_0x32567c);loggerPredictive['info'](_0xa5f6('0x20c'),_0x4aef42);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20d'),_0x46f044);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20e'),_0x5a91f3);loggerPredictive['info'](_0xa5f6('0x20f'));return new BPromise(function(_0x2f6f7c,_0x4eda64){if(_0x5e78fd<=0x0||isNaN(_0x5e78fd)){return _0x4eda64(msgResponse(_0xa5f6('0x210'),_0xa5f6('0x46'),_0xa5f6('0x211')+_0x5e78fd));}if(_0x4aef42<=0x0||isNaN(_0x4aef42)){return _0x4eda64(msgResponse(_0xa5f6('0x210'),'Error',_0xa5f6('0x212')+_0x4aef42));}if(_0x46f044<=0x0||isNaN(_0x46f044)){return _0x4eda64(msgResponse('[abandonmentRate]',_0xa5f6('0x46'),_0xa5f6('0x213')+_0x46f044));}if(_0x32567c<=0x0||isNaN(_0x32567c)){return _0x4eda64(msgResponse('[abandonmentRate]','Error',_0xa5f6('0x214')+_0x32567c));}if(_0x5a91f3<=0x0||isNaN(_0x5a91f3)){return _0x4eda64(msgResponse(_0xa5f6('0x210'),'Error',_0xa5f6('0x215')+_0x5a91f3));}_0x34758c=_0x34758c||0x0;var _0x323d22=0x1/_0x4aef42;var _0x1e967b=0x0;var _0x2fab8e=0x0;var _0x435bfd=0x0;var _0x174992=0x0;for(var _0xaa1dcc=0x0;_0x435bfd<_0x5a91f3;_0xaa1dcc+=0x1){_0x2fab8e=_0xaa1dcc/_0x32567c;_0x1e967b=(_0x46f044*_0x2fab8e+_0x34758c)/_0x323d22;_0x435bfd=erlangb(_0x1e967b,_0x5e78fd);_0x174992=_0x1e967b/_0x5e78fd*(0x1-erlangb(_0x1e967b,_0x5e78fd));}return _0x2f6f7c({'erlangCalls':_0xaa1dcc,'erlangCallToSecond':_0x32567c/_0xaa1dcc,'erlangAbandonmentRate':_0x435bfd,'erlangBusyFactor':_0x174992});});};Dialer[_0xa5f6('0xac')][_0xa5f6('0x1e0')]=function(_0x2d3ced,_0x71b6fc,_0x554e71,_0x34eca5,_0x560c3a,_0x4d5c6a){loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x216'));loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20a'),_0x2d3ced);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20b'),_0x71b6fc);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20c'),_0x554e71);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x20d'),_0x34eca5);loggerPredictive[_0xa5f6('0x80')](_0xa5f6('0x217'),_0x560c3a);loggerPredictive['info'](_0xa5f6('0x20f'));return new BPromise(function(_0x32965d,_0x33de99){if(_0x2d3ced<=0x0||isNaN(_0x2d3ced)){return _0x33de99(msgResponse(_0xa5f6('0x218'),_0xa5f6('0x46'),_0xa5f6('0x211')+_0x2d3ced));}if(_0x554e71<=0x0||isNaN(_0x554e71)){return _0x33de99(msgResponse(_0xa5f6('0x218'),'Error',_0xa5f6('0x212')+_0x554e71));}if(_0x34eca5<=0x0||isNaN(_0x34eca5)){return _0x33de99(msgResponse('[busyFactor]',_0xa5f6('0x46'),'p\x20=\x20'+_0x34eca5));}if(_0x71b6fc<=0x0||isNaN(_0x71b6fc)){return _0x33de99(msgResponse(_0xa5f6('0x218'),_0xa5f6('0x46'),_0xa5f6('0x214')+_0x71b6fc));}if(_0x560c3a<=0x0||isNaN(_0x560c3a)){return _0x33de99(msgResponse(_0xa5f6('0x218'),_0xa5f6('0x46'),_0xa5f6('0x219')+_0x560c3a));}_0x4d5c6a=_0x4d5c6a||0x0;var _0xe0b0b2=0x1/_0x554e71;var _0x37527e=0x0;var _0x4516b9=0x0;var _0x4277a2=0x0;var _0x5d4b7e=0x0;for(var _0x4bf856=0x0;_0x5d4b7e<_0x560c3a;_0x4bf856+=0x1){_0x4516b9=_0x4bf856/_0x71b6fc;_0x37527e=(_0x34eca5*_0x4516b9+_0x4d5c6a)/_0xe0b0b2;_0x4277a2=erlangb(_0x37527e,_0x2d3ced);_0x5d4b7e=_0x37527e/_0x2d3ced*(0x1-erlangb(_0x37527e,_0x2d3ced));}return _0x32965d({'erlangCalls':_0x4bf856,'erlangCallToSecond':_0x71b6fc/_0x4bf856,'erlangAbandonmentRate':_0x4277a2,'erlangBusyFactor':_0x5d4b7e});});};module[_0xa5f6('0x21a')]=Dialer; \ No newline at end of file +var _0x48d0=['syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','content','indexOf','true','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','run','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','countReScheduled','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./final','./agentComplete','./queueCallerAbandon','env','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','contactsId','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','Trunk','callerid','ivr','format','info','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','loopClearZombieChannels','clearZombieChannels','uniqueId','[uniqueid]','actions','sequence','isNil','Action','status','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','then','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','active','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','[syncHangupInAMD]','MACHINE','Machine','countglobal','buildObj','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','dialAMDActive','HANGUP','[syncHangupInAMDIvr]','countbusyretry','countdropretry','countagentrejectretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','TIMEOUT','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','agents','strategy','queueBooked','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]'];(function(_0x7548be,_0x3720c6){var _0x2c2bf1=function(_0x17cd3e){while(--_0x17cd3e){_0x7548be['push'](_0x7548be['shift']());}};_0x2c2bf1(++_0x3720c6);}(_0x48d0,0xd3));var _0x048d=function(_0x4d5656,_0x57679e){_0x4d5656=_0x4d5656-0x0;var _0x911ebf=_0x48d0[_0x4d5656];return _0x911ebf;};'use strict';var util=require(_0x048d('0x0'));var _=require(_0x048d('0x1'));var BPromise=require('bluebird');var uuid=require(_0x048d('0x2'));var moment=require(_0x048d('0x3'));var rr=require('rr');var md5=require(_0x048d('0x4'));var Redis=require('ioredis');var ut=require(_0x048d('0x5'));var config=require(_0x048d('0x6'));var logger=require('../../../config/logger')(_0x048d('0x7'));var loggerBooked=require(_0x048d('0x8'))(_0x048d('0x9'));var loggerPredictive=require('../../../config/logger')(_0x048d('0xa'));var loggerPredictiveCalls=require(_0x048d('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x048d('0x8'))(_0x048d('0xb'));var ami=require(_0x048d('0xc'));config[_0x048d('0xd')]=_[_0x048d('0xe')](config[_0x048d('0xd')],{'host':_0x048d('0xf'),'port':0x18eb});var io=require(_0x048d('0x10'))(new Redis(config[_0x048d('0xd')]));var cmHopper=require(_0x048d('0x11'));var cmHopperHistory=require(_0x048d('0x12'));var cmHopperBlack=require(_0x048d('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x048d('0x14'));var History=require('./history');var Final=require(_0x048d('0x15'));var AgentComplete=require(_0x048d('0x16'));var QueueCallerAbandon=require(_0x048d('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0x048d('0x18')]['XCALLY_IP_AGI']||_0x048d('0x19');var strategy={'rrmemory':_0x048d('0x1a'),'roundrobin':_0x048d('0x1b')};var Sequence=function(){};Sequence[_0x048d('0x1c')]['enqueue']=function(_0x11b499){this[_0x048d('0x1d')]=this[_0x048d('0x1d')]?this[_0x048d('0x1d')][_0x048d('0x1e')](_0x11b499):_0x11b499();};function Dialer(_0x22795c,_0x5934b6){this['sequence']=new Sequence();this[_0x048d('0x1f')]=_0x5934b6;this[_0x048d('0x20')]=_0x22795c[_0x048d('0x20')];this['campaigns']=_0x22795c[_0x048d('0x21')];this['agents']=_0x22795c['agents'];this[_0x048d('0x22')]=_0x22795c[_0x048d('0x22')];this[_0x048d('0x23')]=config['maxNumberOriginate']||0x2;this[_0x048d('0x24')]={};this['actions']={};this[_0x048d('0x25')]={};this['uniqueId']={};this['optionPredictive']={};this[_0x048d('0x26')]={};this[_0x048d('0x27')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x048d('0x28')]={};ami['on'](_0x048d('0x29'),this[_0x048d('0x2a')][_0x048d('0x2b')](this));ami['on'](_0x048d('0x2c'),this[_0x048d('0x2d')]['bind'](this));ami['on']('originateresponse',this[_0x048d('0x2e')]['bind'](this));ami['on']('agentcomplete',this[_0x048d('0x2f')]['bind'](this));ami['on']('custom:queuesummary',this[_0x048d('0xb')][_0x048d('0x2b')](this));ami['on'](_0x048d('0x30'),this[_0x048d('0x31')][_0x048d('0x2b')](this));ami['on'](_0x048d('0x32'),this[_0x048d('0x33')][_0x048d('0x2b')](this));ami['on'](_0x048d('0x34'),this[_0x048d('0x35')][_0x048d('0x2b')](this));ami['on']('queuemember',this[_0x048d('0x36')][_0x048d('0x2b')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0x048d('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x26780c){return _0x26780c!==null&&!_[_0x048d('0x38')](_0x26780c);}function checkIsLoggedIn(_0x35acaa,_0x1ae6b9){return function(){if(_0x1ae6b9<=0x0){_0x35acaa[_0x048d('0x39')]=_0x048d('0x3a');throw _0x35acaa['name']+_0x048d('0x3b');}};}function isActive(_0x3237c2){return _0x3237c2;}function checkIsActive(_0x4da4e5,_0x1849d2){return function(){if(!isActive(_0x1849d2)){_0x4da4e5[_0x048d('0x39')]=_0x048d('0x3c');throw _0x4da4e5[_0x048d('0x3d')]+_0x048d('0x3e');}};}function checkInterval(_0x15b7d2){return function(){if(!isNotNull(_0x15b7d2[_0x048d('0x3f')])){_0x15b7d2[_0x048d('0x39')]='INTERVAL_IS_NULL';throw _0x15b7d2[_0x048d('0x3d')]+_0x048d('0x40');}if(!isNotNull(_0x15b7d2[_0x048d('0x3f')]['Intervals'])){_0x15b7d2[_0x048d('0x39')]=_0x048d('0x41');throw _0x15b7d2[_0x048d('0x3d')]+_0x048d('0x40');}if(!isNotNull(_[_0x048d('0x42')](_0x15b7d2[_0x048d('0x3f')][_0x048d('0x43')]))){_0x15b7d2[_0x048d('0x39')]=_0x048d('0x41');throw _0x15b7d2[_0x048d('0x3d')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3077ac,_0x47fbe3,_0x5445f2){return{'action':_0x3077ac,'response':_0x47fbe3,'message':_0x5445f2,'stack':_0x5445f2};}function myreject(_0x530e3b){return function(_0xfdd4dd){return _0x530e3b(msgResponse(_0x048d('0x44'),_0x048d('0x45'),JSON[_0x048d('0x46')](_0xfdd4dd)));};}function getSeconds(_0xee8fcd,_0x35a6be){var _0x44ae95=moment(_0xee8fcd)[_0x048d('0x47')](0x0);var _0x4a1e86=moment(_0x35a6be)['milliseconds'](0x0);return _0x44ae95[_0x048d('0x48')](_0x4a1e86,'seconds');}function emit(_0x4836ef,_0x64507b,_0x2f3d2a){io['to'](_0x4836ef)[_0x048d('0x49')](_0x64507b,_0x2f3d2a);}function emitVoiceQueueSummary(_0x2413bd){if(_0x2413bd[_0x048d('0x4a')]===_0x048d('0x4b')){var _0xe31f11={'id':_0x2413bd['id'],'name':_0x2413bd[_0x048d('0x3d')],'strategy':_0x2413bd['strategy'],'answered':_0x2413bd['answered'],'available':_0x2413bd[_0x048d('0x4c')],'loggedIn':_0x2413bd[_0x048d('0x4d')],'pTalking':_0x2413bd[_0x048d('0x4e')],'sumBillable':_0x2413bd['sumBillable'],'sumDuration':_0x2413bd[_0x048d('0x4f')],'sumHoldTime':_0x2413bd[_0x048d('0x50')]||0x0,'talking':_0x2413bd[_0x048d('0x51')],'total':_0x2413bd[_0x048d('0x52')],'type':_0x2413bd[_0x048d('0x4a')],'unmanaged':_0x2413bd[_0x048d('0x53')],'abandoned':_0x2413bd[_0x048d('0x54')],'waiting':_0x2413bd[_0x048d('0x55')],'loggedInDb':_0x2413bd[_0x048d('0x56')],'dialActive':_0x2413bd[_0x048d('0x57')],'dialMethod':_0x2413bd[_0x048d('0x58')],'dialOriginateCallerIdName':_0x2413bd[_0x048d('0x59')],'dialOriginateCallerIdNumber':_0x2413bd[_0x048d('0x5a')],'dialOriginateTimeout':_0x2413bd[_0x048d('0x5b')],'dialPrefix':_0x2413bd[_0x048d('0x5c')],'outboundAnswerAgiCallsDay':_0x2413bd['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2413bd[_0x048d('0x5d')],'outboundBlacklistCallsDay':_0x2413bd[_0x048d('0x5e')],'outboundBusyCallsDay':_0x2413bd[_0x048d('0x5f')],'outboundCongestionCallsDay':_0x2413bd[_0x048d('0x60')],'outboundDropCallsDayACS':_0x2413bd[_0x048d('0x61')],'outboundDropCallsDayCallersExit':_0x2413bd[_0x048d('0x62')],'outboundDropCallsDayTimeout':_0x2413bd[_0x048d('0x63')],'outboundNoAnswerCallsDay':_0x2413bd[_0x048d('0x64')],'outboundNoSuchCallsDay':_0x2413bd[_0x048d('0x65')],'outboundOriginateFailureCallsDay':_0x2413bd['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2413bd['outboundReCallsDay'],'outboundRejectCallsDay':_0x2413bd[_0x048d('0x66')],'outboundUnknownCallsDay':_0x2413bd[_0x048d('0x67')],'predictiveIntervalAnsweredCalls':_0x2413bd[_0x048d('0x68')],'predictiveIntervalAvgHoldtime':_0x2413bd[_0x048d('0x69')],'predictiveIntervalAvgTalktime':_0x2413bd[_0x048d('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x2413bd[_0x048d('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x2413bd[_0x048d('0x6c')],'predictiveIntervalErlangCalls':_0x2413bd[_0x048d('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x2413bd[_0x048d('0x6e')],'predictiveIntervalHitRate':_0x2413bd[_0x048d('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x2413bd[_0x048d('0x70')],'predictiveIntervalPauses':_0x2413bd['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2413bd[_0x048d('0x71')],'predictiveIntervalTotalCalls':_0x2413bd[_0x048d('0x72')],'message':_0x2413bd[_0x048d('0x39')],'originated':_0x2413bd['originated'],'erlangCalls':_0x2413bd[_0x048d('0x73')],'erlangCallToSecond':_0x2413bd['erlangCallToSecond'],'erlangAbandonmentRate':_0x2413bd[_0x048d('0x74')],'erlangBusyFactor':_0x2413bd['erlangBusyFactor'],'startPredictive':_0x2413bd[_0x048d('0x26')],'startProgressive':_0x2413bd[_0x048d('0x27')]};if(_0x2413bd[_0x048d('0x75')]){_0xe31f11[_0x048d('0x75')]={'id':_0x2413bd[_0x048d('0x75')]['id'],'name':_0x2413bd[_0x048d('0x75')][_0x048d('0x3d')],'active':_0x2413bd[_0x048d('0x75')]['active'],'callerid':_0x2413bd['Trunk'][_0x048d('0x76')]};}if(_0x2413bd[_0x048d('0x3f')]){_0xe31f11['Interval']={'id':_0x2413bd['Interval']['id'],'name':_0x2413bd['Interval']['name']};}var _0x409fdb=md5(JSON[_0x048d('0x46')](_0xe31f11));if(_0x2413bd[_0x048d('0x4')]!==_0x409fdb){_0x2413bd[_0x048d('0x4')]=_0x409fdb;emit(util['format']('voice:queue:%s',_0xe31f11[_0x048d('0x3d')]),'voice_queue:save',_0xe31f11);}}}function emitCampaignSummary(_0x2abc92){if(_0x2abc92[_0x048d('0x4a')]===_0x048d('0x77')){emit(util[_0x048d('0x78')]('campaign:ivr:%s',_0x2abc92[_0x048d('0x3d')]),'campaign:save',_0x2abc92);}}function checkGetDataPredictive(_0x18ec00){if(isNotNull(_0x18ec00)&&!_[_0x048d('0x42')](_0x18ec00)){loggerPredictive[_0x048d('0x79')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x048d('0x79')](_0x048d('0x7a'),_0x18ec00[_0x048d('0x72')]);loggerPredictive[_0x048d('0x79')](_0x048d('0x7b'),_0x18ec00['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x048d('0x79')](_0x048d('0x7c'),_0x18ec00[_0x048d('0x6c')]);loggerPredictive[_0x048d('0x79')](_0x048d('0x7d'),_0x18ec00[_0x048d('0x6b')]);loggerPredictive[_0x048d('0x79')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18ec00[_0x048d('0x69')]);loggerPredictive[_0x048d('0x79')](_0x048d('0x7e'),_0x18ec00[_0x048d('0x6a')]);loggerPredictive['info']('---------------------------');if(_0x18ec00['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x18ec00['predictiveIntervalAvgTalktime'])&&_0x18ec00[_0x048d('0x6a')]>0x0){return!![];}loggerPredictive[_0x048d('0x79')](_0x048d('0x7f'));if(!_[_0x048d('0x38')](_0x18ec00['predictiveIntervalAvgHoldtime'])&&_0x18ec00[_0x048d('0x69')]>0x0){return!![];}loggerPredictive['info'](_0x048d('0x80'));}else{loggerPredictive[_0x048d('0x79')](_0x048d('0x81'));}}else{loggerPredictive[_0x048d('0x79')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x22f31a){return function(_0x254c02){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x048d('0x79')](_0x048d('0x82'),_0x254c02['erlangCalls']);loggerPredictive['info'](_0x048d('0x83'),_0x254c02[_0x048d('0x84')]);loggerPredictive[_0x048d('0x79')](_0x048d('0x85'),_0x254c02['erlangAbandonmentRate']);loggerPredictive[_0x048d('0x79')](_0x048d('0x86'),_0x254c02['erlangBusyFactor']);loggerPredictive[_0x048d('0x79')](_0x048d('0x85'),_0x254c02['erlangAbandonmentRate']);loggerPredictive['info'](_0x048d('0x87'));_[_0x048d('0x88')](_0x22f31a,_0x254c02);};}function getDiff(_0x15334c){var _0x4fe4ac=moment()['milliseconds'](0x0);var _0x17aff9=moment(_0x15334c)['milliseconds'](0x0);return _0x4fe4ac['diff'](_0x17aff9,_0x048d('0x89'));}function ifInterval(_0x41b57f,_0xa40d75){if(_[_0x048d('0x38')](_0xa40d75)){return![];}return getDiff(_0xa40d75)<_0x41b57f*0x3c;}function freeVariablesPredictive(_0x251cda){if(isNotNull(_0x251cda)){if(!_[_0x048d('0x38')](_0x251cda['startProgressive'])){_0x251cda[_0x048d('0x27')]=undefined;loggerPredictive['info'](_0x251cda[_0x048d('0x3d')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x048d('0x38')](_0x251cda['startPredictive'])){_0x251cda['startPredictive']=undefined;loggerPredictive[_0x048d('0x79')](_0x251cda['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x048d('0x38')](_0x251cda['handlePredictive'])){clearInterval(_0x251cda[_0x048d('0x8a')]);_0x251cda[_0x048d('0x8a')]=undefined;loggerPredictive[_0x048d('0x79')](_0x251cda[_0x048d('0x3d')],_0x048d('0x8b'));}}}function erlangb(_0x2d3ee0,_0x4b3750){if(_0x4b3750===0x0){return 0x0;}var _0x5b7f0a=0x1;for(var _0x492d45=0x1;_0x492d45<=_0x4b3750;_0x492d45+=0x1){_0x5b7f0a=0x1+_0x5b7f0a*_0x492d45/_0x2d3ee0;}return 0x1/_0x5b7f0a;}function isVoiceQueueOutbound(_0x2e0b15){return _0x2e0b15===_0x048d('0x4b');}function isNotPreview(_0x295c8e){return _0x295c8e!==_0x048d('0x1f');}function isCampaignIvr(_0x396f67){return _0x396f67===_0x048d('0x77');}function getCallerId(_0x3dc97f,_0x1e88a3,_0x19cf9a){if(!_[_0x048d('0x38')](_0x19cf9a)&&typeof _0x19cf9a===_0x048d('0x8c')&&!_['isEmpty'](_0x19cf9a)){if(!_[_0x048d('0x38')](_0x1e88a3)&&typeof _0x1e88a3===_0x048d('0x8c')&&!_[_0x048d('0x42')](_0x1e88a3)){return util['format'](_0x048d('0x8d'),_0x1e88a3,_0x19cf9a);}return util['format']('\x22%s\x22\x20<%s>',_0x19cf9a,_0x19cf9a);}if(!_[_0x048d('0x38')](_0x3dc97f)&&typeof _0x3dc97f===_0x048d('0x8c')&&!_[_0x048d('0x42')](_0x3dc97f)){return _0x3dc97f;}return _0x048d('0x8e');}function loggerCatchQueueSummary(_0x4ebb52,_0x56141f){return function(_0x2ddbc3){freeVariablesPredictive(_0x56141f);emitVoiceQueueSummary(_0x56141f);emitCampaignSummary(_0x56141f);loggerSyncQueueSummary[_0x048d('0x8f')](_0x4ebb52,util['inspect'](_0x2ddbc3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x38cace,_0x8b5012){return function(_0x3e1df0){loggerPredictive[_0x048d('0x8f')](_0x8b5012[_0x048d('0x3d')],_0x38cace);loggerPredictive[_0x048d('0x8f')](_0x3e1df0[_0x048d('0x90')]);freeVariablesPredictive(_0x8b5012);};}function loggerCatch(_0x45c4ef){return function(_0x320722){logger[_0x048d('0x8f')](_0x45c4ef,util[_0x048d('0x91')](_0x320722,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4249e0){return _0x4249e0&&!_[_0x048d('0x38')](_0x4249e0)&&_0x4249e0['length']>0x0;}function decremetOriginate(_0x588e3c){if(!_[_0x048d('0x38')](_0x588e3c)&&_0x588e3c!==null){if(typeof _0x588e3c['originated']!=='undefined'){if(_0x588e3c[_0x048d('0x92')]>0x0){_0x588e3c[_0x048d('0x92')]-=0x1;}else{logger['error'](_0x048d('0x93'));}}}else{logger[_0x048d('0x8f')](_0x048d('0x94'));}}function checkContactLowerLimitOriginate(_0x1d9b0c,_0x3a2059,_0x3f9781){if(_0x3a2059>_0x3f9781){for(var _0x1b4f92=0x0;_0x1b4f92<_0x3a2059-_0x3f9781;_0x1b4f92+=0x1){decremetOriginate(_0x1d9b0c);}}}function loggerGetContactDialer(_0x569df1,_0x10642b,_0x224325){return function(_0x414539){checkContactLowerLimitOriginate(_0x10642b,_0x224325,0x0);logger['error'](_0x569df1,util[_0x048d('0x91')](_0x414539,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x25af63){return function(_0x350781){if(isNotNull(_0x350781)&&isNotNull(_0x350781[0x0])){if(_0x350781[0x0][_0x048d('0x95')]>0x0){_0x25af63[_0x048d('0x39')]='RESCHEDULED_CONTACTS';logger[_0x048d('0x79')](_0x048d('0x96')+_0x25af63[_0x048d('0x3d')],_0x350781[0x0][_0x048d('0x95')],_0x048d('0x97'));}else{_0x25af63[_0x048d('0x39')]=_0x048d('0x98');logger[_0x048d('0x79')](_0x048d('0x99')+_0x25af63[_0x048d('0x3d')]);}}};}function notSendMessagesQueue(_0x366cf7){if(_0x366cf7[_0x048d('0x9a')]){freeVariablesPredictive(_0x366cf7);if(_0x366cf7['originated']===0x0&&_0x366cf7['talking']===0x0&&_0x366cf7[_0x048d('0x55')]===0x0&&(_0x366cf7[_0x048d('0x4e')]||0x0)===0x0){_0x366cf7[_0x048d('0x9a')]=![];_0x366cf7[_0x048d('0x4c')]=0x0;_0x366cf7[_0x048d('0x39')]=_0x048d('0x3c');loggerSyncQueueSummary[_0x048d('0x8f')](_0x048d('0x9b'),_0x366cf7[_0x048d('0x3d')],_0x048d('0x9c'));}else{_0x366cf7['message']=_0x048d('0x9d');loggerSyncQueueSummary[_0x048d('0x8f')](_0x048d('0x9b'),_0x366cf7['name'],_0x048d('0x9e'));}emitVoiceQueueSummary(_0x366cf7);}}function notSendMessagesCampaign(_0x5903cb){if(_0x5903cb[_0x048d('0x9a')]){if(_0x5903cb[_0x048d('0x92')]===0x0){_0x5903cb[_0x048d('0x9a')]=![];_0x5903cb[_0x048d('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x048d('0x9f'),_0x5903cb['name'],'is\x20not\x20active');}else{_0x5903cb['message']=_0x048d('0x9d');loggerSyncQueueSummary['error'](_0x048d('0x9f'),_0x5903cb['name'],_0x048d('0x9e'));}emitCampaignSummary(_0x5903cb);}}function createObjHistory(_0x5784fd,_0x50369c,_0x34d0ba,_0x34d0b7,_0x3c08fa){_0x5784fd[_0x048d('0x39')]=_0x34d0ba;var _0x2a76f4=new Action(_0x5784fd,_0x50369c);var _0x2afbb1=new History(_0x2a76f4);_0x2afbb1[_0x048d('0xa0')]=_0x34d0b7;_0x2afbb1[_0x048d('0xa1')]=_0x3c08fa;_0x2afbb1[_0x048d('0xa2')]=_0x2a76f4[_0x048d('0xa3')];return _0x2afbb1;}Dialer[_0x048d('0x1c')][_0x048d('0xa4')]=function(){var _0x1a6870=this;setInterval(function(){_0x1a6870[_0x048d('0xa5')](_0x1a6870[_0x048d('0xa6')],_0x048d('0xa7'));_0x1a6870['clearZombieChannels'](_0x1a6870[_0x048d('0xa8')],'[actions]');},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x2c18e4,_0x5a99f9){var _0x380af8=this;for(var _0x229a33 in _0x2c18e4){if(typeof _0x2c18e4[_0x229a33]!=='undefined'){this[_0x048d('0xa9')]['enqueue'](function(){if(!_[_0x048d('0xaa')](_0x2c18e4[_0x229a33])){return ami[_0x048d('0xab')]({'action':_0x048d('0xac'),'channel':_0x2c18e4[_0x229a33]['channel']})[_0x048d('0xad')](function(_0x3d4cd3){if(_0x3d4cd3[_0x048d('0x39')]===_0x048d('0xae')){setTimeout(function(){if(_0x2c18e4[_0x229a33]&&_0x2c18e4[_0x229a33][_0x048d('0x4a')]!=='ivr'){_0x380af8['updateOriginated'](_0x380af8[_0x048d('0x20')][_0x2c18e4[_0x229a33][_0x048d('0xaf')]]);logger[_0x048d('0x8f')](_0x048d('0xb0'),_0x5a99f9,_0x229a33,_0x2c18e4[_0x229a33][_0x048d('0xaf')]);delete _0x2c18e4[_0x229a33];}if(_0x2c18e4[_0x229a33]&&_0x2c18e4[_0x229a33]['type']===_0x048d('0x77')){_0x380af8[_0x048d('0xb1')](_0x380af8['campaigns'][_0x2c18e4[_0x229a33][_0x048d('0xaf')]]);logger['error'](_0x048d('0xb2'),_0x5a99f9,_0x229a33,_0x2c18e4[_0x229a33][_0x048d('0xaf')]);delete _0x2c18e4[_0x229a33];}},0x2328);}});}});}}};Dialer[_0x048d('0x1c')]['countReScheduled']=function(_0x4f4a46){return BPromise[_0x048d('0xb3')]()['then'](cmHopper['countReScheduled'](_0x4f4a46))[_0x048d('0xad')](loggerCatch(_0x048d('0xb4')));};Dialer[_0x048d('0x1c')][_0x048d('0xb5')]=function(_0x432937){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x432937))[_0x048d('0xad')](loggerCatch(_0x048d('0xb6')));};Dialer[_0x048d('0x1c')][_0x048d('0xb7')]=function(_0x22a72c){return BPromise[_0x048d('0xb3')]()['then'](cmHopperBlack[_0x048d('0xb7')](_0x22a72c))[_0x048d('0xad')](loggerCatch(_0x048d('0xb8')));};Dialer['prototype'][_0x048d('0xb9')]=function(_0x3d427c){return BPromise[_0x048d('0xb3')]()[_0x048d('0xba')](cmHopperHistory[_0x048d('0xbb')](_0x3d427c))[_0x048d('0xad')](loggerCatch(_0x048d('0xbc')));};Dialer['prototype'][_0x048d('0xbd')]=function(_0x159410){return BPromise[_0x048d('0xb3')]()[_0x048d('0xba')](cmHopper[_0x048d('0xbd')](_0x159410))[_0x048d('0xad')](loggerCatch(_0x048d('0xbe')));};Dialer[_0x048d('0x1c')][_0x048d('0xbf')]=function(_0x250414,_0x3ab70a,_0x502271){return BPromise[_0x048d('0xb3')]()[_0x048d('0xba')](cmHopper[_0x048d('0xbf')](_0x250414,_0x3ab70a,_0x502271))['catch'](loggerCatch(_0x048d('0xc0')));};Dialer['prototype'][_0x048d('0xc1')]=function(_0x44247d,_0x13c14f,_0x33891e,_0x1c1a8a,_0x2cc2fb){return BPromise['resolve']()['then'](cmHopper['getContactDialer'](_0x44247d,_0x13c14f,_0x33891e,_0x1c1a8a))[_0x048d('0xad')](function(_0x30fdc4){_0x2cc2fb[_0x048d('0xc2')]-=_0x33891e;_0x2cc2fb['temp']=_0x2cc2fb[_0x048d('0xc2')]>0x0?_0x2cc2fb[_0x048d('0xc2')]:0x0;loggerCatch(_0x048d('0xc3'))(_0x30fdc4);});};Dialer[_0x048d('0x1c')][_0x048d('0xc4')]=function(_0x49cfc4,_0x2b8791,_0xa7c332,_0x2b1f66){return BPromise[_0x048d('0xb3')]()['then'](cmHopper[_0x048d('0xc4')](_0x49cfc4,_0x2b8791,_0xa7c332))[_0x048d('0xad')](function(_0x4e56d3){_0x2b1f66[_0x048d('0xc2')]-=_0x2b8791;_0x2b1f66['temp']=_0x2b1f66[_0x048d('0xc2')]>0x0?_0x2b1f66[_0x048d('0xc2')]:0x0;loggerCatch(_0x048d('0xc5'))(_0x4e56d3);});};Dialer[_0x048d('0x1c')][_0x048d('0xc6')]=function(_0x7ce6c4){return BPromise[_0x048d('0xb3')]()[_0x048d('0xba')](voiceQueueRt[_0x048d('0xc6')](_0x7ce6c4))['catch'](loggerCatch(_0x048d('0xc7')));};Dialer[_0x048d('0x1c')][_0x048d('0xc8')]=function(_0x1a423d){return BPromise['resolve']()[_0x048d('0xba')](cmHopper[_0x048d('0xc8')](_0x1a423d))[_0x048d('0xad')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x048d('0x1c')][_0x048d('0xc9')]=function(_0x3ee497){return BPromise['resolve']()[_0x048d('0xba')](cmHopperHistory[_0x048d('0xc9')](_0x3ee497))['catch'](loggerCatch(_0x048d('0xca')));};Dialer['prototype'][_0x048d('0xb1')]=function(_0x56592a){if(!_[_0x048d('0x38')](_0x56592a)&&_0x56592a!==null){if(typeof _0x56592a[_0x048d('0x92')]!==_0x048d('0xcb')){if(_0x56592a[_0x048d('0x92')]>0x0){_0x56592a[_0x048d('0x92')]-=0x1;}else{logger[_0x048d('0x8f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x048d('0x8f')](_0x048d('0xcc'));}};Dialer['prototype'][_0x048d('0xcd')]=function(_0x325f33,_0x82e09d){var _0x2a6ece=this;return function(_0x122e63){_0x2a6ece['updateOriginated'](_0x82e09d);logger[_0x048d('0x8f')](_0x325f33,util[_0x048d('0x91')](_0x122e63,{'showHidden':![],'depth':null}));};};Dialer[_0x048d('0x1c')][_0x048d('0xce')]=function(_0x544d0c,_0x41f112,_0x274994){var _0xfabad0={'state':0x19,'statedesc':_0x048d('0xcf')};this['updateOriginated'](_0x41f112);this[_0x048d('0xd0')](_[_0x048d('0x88')](_0xfabad0,_[_0x048d('0xd1')](_0x274994,[_0x048d('0xd2'),_0x048d('0xd3'),_0x048d('0xd4'),_0x048d('0xd5'),_0x048d('0xd6')])),'[emptyContact][createHistory]',_0x048d('0xd7'));logger[_0x048d('0x8f')](_0x544d0c);};Dialer[_0x048d('0x1c')][_0x048d('0xd8')]=function(_0x33c522){return _0x33c522==='Success';};Dialer[_0x048d('0x1c')][_0x048d('0xd9')]=function(_0x4c3b65){return!_[_0x048d('0x38')](_0x4c3b65)&&_0x4c3b65&&!_[_0x048d('0x38')](_0x4c3b65[_0x048d('0x3d')])&&!_[_0x048d('0x38')](_0x4c3b65['active'])&&_0x4c3b65[_0x048d('0xda')]&&(this[_0x048d('0x22')][util[_0x048d('0x78')]('SIP/%s',_0x4c3b65[_0x048d('0x3d')])][_0x048d('0xac')]===_0x048d('0xdb')||this['trunks'][util[_0x048d('0x78')](_0x048d('0xdc'),_0x4c3b65[_0x048d('0x3d')])][_0x048d('0xac')]===_0x048d('0xdd'));};Dialer['prototype'][_0x048d('0xd0')]=function(_0x3eafa1,_0x3a7c9a,_0xdc061e){this[_0x048d('0xc9')](_0x3eafa1)['catch'](loggerCatch(_0x3a7c9a));this['moveContactManagedDialer'](_0x3eafa1)[_0x048d('0xad')](loggerCatch(_0xdc061e));};Dialer[_0x048d('0x1c')][_0x048d('0x35')]=function(_0x2692e4){var _0x42c59e=this[_0x048d('0xa6')][_0x2692e4[_0x048d('0xde')]];var _0x41599c;if(!_[_0x048d('0xaa')](_0x2692e4)&&!_[_0x048d('0xaa')](_0x2692e4[_0x048d('0xdf')])&&!_[_0x048d('0xaa')](_0x2692e4[_0x048d('0xdf')][_0x048d('0xe0')])&&_0x2692e4[_0x048d('0xe1')]===_0x048d('0xe2')&&_0x42c59e){if(_0x42c59e['type']!==_0x048d('0x77')&&this[_0x048d('0x20')][_0x42c59e[_0x048d('0xaf')]]['dialAMDActive']&&_0x2692e4[_0x048d('0xe3')]==='HANGUP'){delete this['uniqueId'][_0x2692e4[_0x048d('0xde')]];this['updateOriginated'](this['voiceQueues'][_0x42c59e[_0x048d('0xaf')]]);this[_0x048d('0x20')][_0x42c59e[_0x048d('0xaf')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x42c59e[_0x048d('0xaf')]][_0x048d('0xe4')]+=0x1;_0x41599c=new Hangup(_0x42c59e,_0x2692e4);_0x41599c['state']=0x12;_0x41599c['statedesc']=_0x048d('0xe5');_0x41599c[_0x048d('0xe6')]=_0x048d('0xe7');ami[_0x048d('0x49')](_0x048d('0xe8'),ut['buildObj'](_0x41599c,'amd'));this['saveInDb'](_0x41599c,'[syncHangupInAMD][createHistory]',_0x048d('0xe9'));}if(_0x42c59e[_0x048d('0x4a')]!=='ivr'&&this[_0x048d('0x20')][_0x42c59e[_0x048d('0xaf')]]['dialAMDActive']&&_0x2692e4[_0x048d('0xe3')]===_0x048d('0xea')){var _0x2d9885=this;return new BPromise(function(_0x5dc40b,_0x272538){delete _0x2d9885[_0x048d('0xa6')][_0x2692e4['uniqueid']];_0x2d9885['updateOriginated'](_0x2d9885[_0x048d('0x20')][_0x42c59e[_0x048d('0xaf')]]);_0x2d9885[_0x048d('0x20')][_0x42c59e['queue']]['outboundAnswerCallsDay']+=0x1;_0x2d9885[_0x048d('0x20')][_0x42c59e[_0x048d('0xaf')]][_0x048d('0xe4')]+=0x1;var _0x492a82=_0x2d9885[_0x048d('0x20')][_0x42c59e['queue']];var _0x391333=new Hangup(_0x42c59e,_0x2692e4);_0x391333[_0x048d('0xa0')]=0x13;_0x391333[_0x048d('0xa1')]=_0x048d('0xeb');_0x391333[_0x048d('0xe6')]='AMD';_0x391333['countmachineretry']+=0x1;_0x391333[_0x048d('0xec')]+=0x1;_0x391333['amd']=!![];ami[_0x048d('0x49')](_0x048d('0xe8'),ut[_0x048d('0xed')](_0x391333,_0x048d('0xee')));_0x2d9885[_0x048d('0xc9')](_0x391333)['catch'](loggerCatch(_0x048d('0xef')));if(_0x391333['countbusyretry']+_0x391333[_0x048d('0xf0')]+_0x391333[_0x048d('0xf1')]+_0x391333[_0x048d('0xf2')]+_0x391333['countdropretry']+_0x391333[_0x048d('0xf3')]+_0x391333[_0x048d('0xf4')]+_0x391333['countagentrejectretry']>=_0x492a82[_0x048d('0xf5')]){_0x2d9885[_0x048d('0xf6')](_0x391333,_0x5dc40b,_0x272538,_0x048d('0xf7'));}else{if(_0x391333['countmachineretry']>=_0x492a82['dialMachineMaxRetry']){_0x2d9885[_0x048d('0xf8')](_0x391333,_0x5dc40b,_0x272538,_0x048d('0xf9'));}else{_0x2d9885[_0x048d('0xbd')]({'active':![],'countmachineretry':_0x391333[_0x048d('0xf4')],'scheduledat':moment()[_0x048d('0xfa')](_0x492a82[_0x048d('0xfb')],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x391333[_0x048d('0xd2')],'ListId':_0x391333['ListId'],'VoiceQueueId':_0x391333['VoiceQueueId']||undefined,'CampaignId':_0x391333[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0xfe')));_0x5dc40b({'reschedule':0x1});}}});}if(_0x42c59e[_0x048d('0x4a')]==='ivr'&&this[_0x048d('0x21')][_0x42c59e[_0x048d('0xaf')]][_0x048d('0xff')]&&_0x2692e4['value']===_0x048d('0x100')){delete this['uniqueId'][_0x2692e4['uniqueid']];this[_0x048d('0xb1')](this['campaigns'][_0x42c59e[_0x048d('0xaf')]]);_0x41599c=new Hangup(_0x42c59e,_0x2692e4);_0x41599c[_0x048d('0xa0')]=0x12;_0x41599c['statedesc']=_0x048d('0xe5');_0x41599c[_0x048d('0xe6')]=_0x048d('0xe7');ami[_0x048d('0x49')](_0x048d('0xe8'),ut[_0x048d('0xed')](_0x41599c,'amd'));this[_0x048d('0xd0')](_0x41599c,'[syncHangupInAMDIvr][createHistory]',_0x048d('0x101'));}if(_0x42c59e[_0x048d('0x4a')]==='ivr'&&this[_0x048d('0x21')][_0x42c59e[_0x048d('0xaf')]][_0x048d('0xff')]&&_0x2692e4['value']==='MACHINE'){var _0x2d9885=this;return new BPromise(function(_0x120e03,_0x5ad6dc){delete _0x2d9885[_0x048d('0xa6')][_0x2692e4[_0x048d('0xde')]];_0x2d9885[_0x048d('0xb1')](_0x2d9885['campaigns'][_0x42c59e['queue']]);_0x2d9885[_0x048d('0x21')][_0x42c59e[_0x048d('0xaf')]][_0x048d('0x5d')]+=0x1;_0x2d9885['campaigns'][_0x42c59e[_0x048d('0xaf')]][_0x048d('0xe4')]+=0x1;var _0x1ec125=_0x2d9885['campaigns'][_0x42c59e['queue']];var _0x2677e7=new Hangup(_0x42c59e,_0x2692e4);_0x2677e7[_0x048d('0xa0')]=0x13;_0x2677e7['statedesc']=_0x048d('0xeb');_0x2677e7[_0x048d('0xe6')]=_0x048d('0xe7');_0x2677e7[_0x048d('0xf4')]+=0x1;_0x2677e7['countglobal']+=0x1;_0x2677e7[_0x048d('0xee')]=!![];ami[_0x048d('0x49')](_0x048d('0xe8'),ut[_0x048d('0xed')](_0x2677e7,_0x048d('0xee')));_0x2d9885[_0x048d('0xc9')](_0x2677e7)[_0x048d('0xad')](loggerCatch(_0x048d('0xef')));if(_0x2677e7[_0x048d('0x102')]+_0x2677e7['countcongestionretry']+_0x2677e7[_0x048d('0xf1')]+_0x2677e7[_0x048d('0xf2')]+_0x2677e7[_0x048d('0x103')]+_0x2677e7[_0x048d('0xf3')]+_0x2677e7[_0x048d('0xf4')]+_0x2677e7[_0x048d('0x104')]>=_0x1ec125['dialGlobalMaxRetry']){_0x2d9885[_0x048d('0xf6')](_0x2677e7,_0x120e03,_0x5ad6dc,_0x048d('0xf7'));}else{if(_0x2677e7['countmachineretry']>=_0x1ec125[_0x048d('0x105')]){_0x2d9885[_0x048d('0xf8')](_0x2677e7,_0x120e03,_0x5ad6dc,'reason\x2019\x20machine....');}else{_0x2d9885[_0x048d('0xbd')]({'active':![],'countmachineretry':_0x2677e7['countmachineretry'],'scheduledat':moment()[_0x048d('0xfa')](_0x1ec125[_0x048d('0xfb')],_0x048d('0xfc'))['format'](_0x048d('0xfd')),'ContactId':_0x2677e7[_0x048d('0xd2')],'ListId':_0x2677e7['ListId'],'VoiceQueueId':_0x2677e7[_0x048d('0xd5')]||undefined,'CampaignId':_0x2677e7['CampaignId']||undefined})['catch'](loggerCatch(_0x048d('0xfe')));_0x120e03({'reschedule':0x1});}}});}}};Dialer[_0x048d('0x1c')]['syncHangup']=function(_0x222302){var _0x42c1fd=this['uniqueId'][_0x222302[_0x048d('0xde')]];var _0x1eaa77=this;var _0x557c02;if(_0x42c1fd&&_0x42c1fd[_0x048d('0x4a')]===_0x048d('0x77')){delete this[_0x048d('0xa6')][_0x222302[_0x048d('0xde')]];this[_0x048d('0xb1')](this[_0x048d('0x21')][_0x42c1fd[_0x048d('0xaf')]]);this[_0x048d('0x21')][_0x42c1fd['queue']][_0x048d('0x106')]+=0x1;_0x557c02=new Hangup(_0x42c1fd,_0x222302);this[_0x048d('0xc9')](_0x557c02)[_0x048d('0xad')](loggerCatch(_0x048d('0x107')));this[_0x048d('0xc8')](_0x557c02)[_0x048d('0xad')](loggerCatch(_0x048d('0x108')));}if(_0x42c1fd&&_0x42c1fd[_0x048d('0x4a')]!==_0x048d('0x77')&&isNotNull(this[_0x048d('0x20')][_0x42c1fd[_0x048d('0xaf')]][_0x048d('0x109')])){delete this[_0x048d('0xa6')][_0x222302['uniqueid']];this[_0x048d('0xb1')](this[_0x048d('0x20')][_0x42c1fd[_0x048d('0xaf')]]);this['voiceQueues'][_0x42c1fd[_0x048d('0xaf')]][_0x048d('0x5d')]+=0x1;this['voiceQueues'][_0x42c1fd[_0x048d('0xaf')]][_0x048d('0xe4')]+=0x1;_0x557c02=new Hangup(_0x42c1fd,_0x222302);_0x557c02['state']=0x10;_0x557c02[_0x048d('0xa1')]=_0x048d('0x10a');_0x557c02['membername']=_0x048d('0x10b');this[_0x048d('0xc9')](_0x557c02)['catch'](loggerCatch(_0x048d('0x107')));this[_0x048d('0xc8')](_0x557c02)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x42c1fd&&_0x42c1fd[_0x048d('0x4a')]!==_0x048d('0x77')&&!isNotNull(this[_0x048d('0x20')][_0x42c1fd['queue']][_0x048d('0x109')])){delete this[_0x048d('0xa6')][_0x222302['uniqueid']];this[_0x048d('0xb1')](this[_0x048d('0x20')][_0x42c1fd[_0x048d('0xaf')]]);this['voiceQueues'][_0x42c1fd[_0x048d('0xaf')]][_0x048d('0x67')]+=0x1;_0x557c02=new Hangup(_0x42c1fd,_0x222302);_0x557c02['state']=0xc;_0x557c02[_0x048d('0xa1')]=_0x222302[_0x048d('0x10c')];_0x557c02[_0x048d('0xe6')]=_0x048d('0x10d');this[_0x048d('0xc9')](_0x557c02)[_0x048d('0xad')](loggerCatch(_0x048d('0x107')));this[_0x048d('0xc8')](_0x557c02)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x048d('0x1c')]['syncAgentComplete']=function(_0x47721a){var _0x1ea184=this['uniqueId'][_0x47721a[_0x048d('0xde')]];var _0x7589fb=this;if(this[_0x048d('0x20')][_0x47721a[_0x048d('0xaf')]]){if(_0x1ea184&&_0x1ea184[_0x048d('0x4a')]!==_0x048d('0x77')){delete this[_0x048d('0xa6')][_0x47721a['uniqueid']];this['voiceQueues'][_0x47721a[_0x048d('0xaf')]][_0x048d('0x5d')]+=0x1;var _0x221400=new AgentComplete(_0x1ea184,_0x47721a);if(_0x47721a[_0x048d('0x10e')]===_0x048d('0x10f')){_0x221400[_0x048d('0x110')]=this[_0x048d('0x20')][_0x47721a['queue']][_0x048d('0x111')]&&this['voiceQueues'][_0x47721a['queue']][_0x048d('0x112')]?moment()[_0x048d('0x78')](_0x048d('0xfd')):undefined;}this['createHistory'](_0x221400)[_0x048d('0xad')](loggerCatch(_0x048d('0x113')));this['moveContactManagedDialer'](_0x221400)[_0x048d('0xad')](loggerCatch(_0x048d('0x114')));}}};Dialer[_0x048d('0x1c')][_0x048d('0x2a')]=function(_0x2a4737){if(this[_0x048d('0x20')][_0x2a4737[_0x048d('0xaf')]]){if(this[_0x048d('0xa6')][_0x2a4737['uniqueid']]&&this['uniqueId'][_0x2a4737[_0x048d('0xde')]]['type']!==_0x048d('0x77')){this[_0x048d('0xb1')](this[_0x048d('0x20')][_0x2a4737[_0x048d('0xaf')]]);this[_0x048d('0xa6')][_0x2a4737[_0x048d('0xde')]][_0x048d('0x115')]=moment()[_0x048d('0x78')](_0x048d('0xfd'));}}};Dialer[_0x048d('0x1c')][_0x048d('0x116')]=function(_0x4f2d14){this['createHistory'](_0x4f2d14)[_0x048d('0xad')](loggerCatch(_0x048d('0x113')));this[_0x048d('0xc8')](_0x4f2d14)[_0x048d('0xad')](loggerCatch(_0x048d('0x117')));};Dialer['prototype'][_0x048d('0x2d')]=function(_0x1036dc){var _0x260fe1=this[_0x048d('0xa6')][_0x1036dc['uniqueid']];var _0x2f3abb=this;if(this[_0x048d('0x20')][_0x1036dc['queue']]){if(_0x260fe1&&_0x260fe1[_0x048d('0x4a')]!==_0x048d('0x77')){delete this[_0x048d('0xa6')][_0x1036dc['uniqueid']];this[_0x048d('0xb1')](this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]]);_0x260fe1[_0x048d('0x118')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x10fcc6=new QueueCallerAbandon(_0x260fe1,_0x1036dc);if(getSeconds(_0x260fe1['droptime'],_0x260fe1[_0x048d('0x119')])>=_0x260fe1['dialQueueTimeout']){this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x6c')]+=0x1;this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x6e')]+=0x1;_0x10fcc6[_0x048d('0xa0')]=0xa;_0x10fcc6['statedesc']='Drop';_0x10fcc6['dropreason']=_0x048d('0x11a');_0x10fcc6[_0x048d('0x110')]=this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x111')]?moment()[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x10fcc6[_0x048d('0x103')]+=0x1;_0x10fcc6[_0x048d('0xec')]+=0x1;if(_0x10fcc6[_0x048d('0x103')]>=this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x11b')]){this[_0x048d('0x116')](_0x10fcc6);}else{this[_0x048d('0xbd')]({'active':![],'countdropretry':_0x10fcc6[_0x048d('0x103')],'scheduledat':moment()[_0x048d('0xfa')](this['voiceQueues'][_0x1036dc[_0x048d('0xaf')]]['dialDropRetryFrequency'],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x260fe1[_0x048d('0xd2')],'ListId':_0x260fe1['ListId'],'VoiceQueueId':_0x260fe1[_0x048d('0xd5')]||undefined,'CampaignId':_0x260fe1[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x11c')));var _0x8869ad=new History(_0x10fcc6);_0x8869ad[_0x048d('0xa0')]=0xa;_0x8869ad['statedesc']=_0x048d('0x11d');_0x8869ad['starttime']=moment()[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x8869ad[_0x048d('0xa2')]=_0x8869ad[_0x048d('0xa3')];_0x8869ad[_0x048d('0x11e')]=_0x10fcc6[_0x048d('0x11e')];_0x8869ad['calleridnum']=_0x10fcc6[_0x048d('0x11f')];this[_0x048d('0xc9')](_0x8869ad)['catch'](loggerCatch(_0x048d('0x120')));}}else{this[_0x048d('0x20')][_0x1036dc['queue']][_0x048d('0x6b')]+=0x1;this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x62')]+=0x1;_0x10fcc6[_0x048d('0xa0')]=0xb;_0x10fcc6['statedesc']=_0x048d('0x121');_0x10fcc6[_0x048d('0x122')]=_0x048d('0x123');_0x10fcc6[_0x048d('0xf3')]+=0x1;_0x10fcc6[_0x048d('0xec')]+=0x1;if(_0x10fcc6['countabandonedretry']>=this[_0x048d('0x20')][_0x1036dc[_0x048d('0xaf')]][_0x048d('0x124')]){this['queueCallerAbandonCreateState'](_0x10fcc6);}else{this[_0x048d('0xbd')]({'active':![],'countabandonedretry':_0x10fcc6[_0x048d('0xf3')],'scheduledat':moment()[_0x048d('0xfa')](this[_0x048d('0x20')][_0x1036dc['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x260fe1[_0x048d('0xd2')],'ListId':_0x260fe1['ListId'],'VoiceQueueId':_0x260fe1[_0x048d('0xd5')]||undefined,'CampaignId':_0x260fe1[_0x048d('0xd6')]||undefined})['catch'](loggerCatch(_0x048d('0x125')));var _0x8869ad=new History(_0x10fcc6);_0x8869ad['state']=0xb;_0x8869ad[_0x048d('0xa1')]=_0x048d('0x121');_0x8869ad[_0x048d('0xa3')]=moment()['format'](_0x048d('0xfd'));_0x8869ad['endtime']=_0x8869ad[_0x048d('0xa3')];_0x8869ad[_0x048d('0x11e')]=_0x10fcc6[_0x048d('0x11e')];_0x8869ad[_0x048d('0x11f')]=_0x10fcc6['calleridnum'];this[_0x048d('0xc9')](_0x8869ad)[_0x048d('0xad')](loggerCatch(_0x048d('0x126')));}}}}};Dialer[_0x048d('0x1c')]['syncNewExten']=function(_0x154ffe){if(this[_0x048d('0xa8')][_0x154ffe['uniqueid']]){this[_0x048d('0xa8')][_0x154ffe[_0x048d('0xde')]][_0x048d('0x127')]=_0x154ffe[_0x048d('0x127')];}if(this[_0x048d('0xa6')][_0x154ffe['uniqueid']]){this['uniqueId'][_0x154ffe[_0x048d('0xde')]][_0x048d('0x127')]=_0x154ffe[_0x048d('0x127')];}};Dialer[_0x048d('0x1c')][_0x048d('0x36')]=function(_0x21dacd){if(strategy[this[_0x048d('0x20')][this['actions'][_0x21dacd[_0x048d('0x128')]][_0x048d('0xaf')]]['strategy']]===_0x048d('0x1b')){if(this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]]&&_[_0x048d('0xaa')](this['actions'][_0x21dacd[_0x048d('0x128')]][_0x048d('0x129')])&&_0x21dacd['status']==='1'&&_0x21dacd[_0x048d('0x12a')]==='0'){if(this['agents'][_0x21dacd[_0x048d('0x12b')]]){if(!this[_0x048d('0x12c')][_0x21dacd['stateinterface']][_0x048d('0x129')]){this[_0x048d('0x12c')][_0x21dacd[_0x048d('0x12b')]][_0x048d('0x129')]=!![];this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]][_0x048d('0x129')]=!![];this['actions'][_0x21dacd[_0x048d('0x128')]][_0x048d('0x12b')]=_0x21dacd['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x21dacd[_0x048d('0x128')]][_0x048d('0xaf')]][_0x048d('0x12d')]]||_0x048d('0x1a'))==='rrmemory'){if(this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]]){if(this[_0x048d('0x12c')][_0x21dacd['stateinterface']]){this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]][_0x048d('0x12b')]=_0x21dacd[_0x048d('0x12b')];if(_['isNil'](this['queueBooked'][this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]][_0x048d('0xaf')]])){this[_0x048d('0x12e')][this[_0x048d('0xa8')][_0x21dacd['actionid']]['queue']]=[];}this['queueBooked'][this[_0x048d('0xa8')][_0x21dacd['actionid']][_0x048d('0xaf')]][_0x048d('0x12f')](_[_0x048d('0x88')](_['pick'](this[_0x048d('0xa8')][_0x21dacd[_0x048d('0x128')]],[_0x048d('0x130'),'stateinterface']),{'status':_0x21dacd[_0x048d('0xac')],'paused':_0x21dacd[_0x048d('0x12a')]}));}}}};function unlockQueueStatus(_0x341819,_0x49d9d7){setTimeout(function(){if(_['isUndefined'](_0x341819[_0x048d('0x131')])){loggerBooked[_0x048d('0x8f')]('[unlockQueueStatus][undefined]',_0x49d9d7);}_0x341819[_0x048d('0x131')]=!![];loggerBooked['info'](_0x048d('0x132'),_0x49d9d7,JSON['stringify'](_[_0x048d('0xd1')](_0x341819,[_0x048d('0x3d'),_0x048d('0x131')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x518836){var _0x18530d=this;var _0x6ae627=_0x18530d[_0x048d('0x20')][_0x18530d[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]];if(strategy[this['voiceQueues'][this['actions'][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]][_0x048d('0x12d')]]===_0x048d('0x1b')){if(this['actions'][_0x518836[_0x048d('0x128')]]&&this[_0x048d('0xa8')][_0x518836['actionid']][_0x048d('0x12b')]){this[_0x048d('0x1f')]['run'](this['actions'][_0x518836[_0x048d('0x128')]][_0x048d('0x130')],this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0x12b')])[_0x048d('0xad')](function(_0x38e22c){logger[_0x048d('0x8f')](_0x048d('0x133'),util[_0x048d('0x91')](_0x38e22c,{'showHidden':![],'depth':null}));})[_0x048d('0x1e')](function(){_0x18530d[_0x048d('0xb1')](_0x18530d[_0x048d('0x20')][_0x18530d[_0x048d('0xa8')][_0x518836['actionid']]['queue']]);_0x18530d[_0x048d('0x12c')][_0x18530d['actions'][_0x518836['actionid']]['stateinterface']][_0x048d('0x129')]=![];delete _0x18530d[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]];unlockQueueStatus(_0x6ae627);});}else{this[_0x048d('0xb1')](this[_0x048d('0x20')][this['actions'][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]]);this[_0x048d('0xbd')]({'active':![],'ContactId':this[_0x048d('0xa8')][_0x518836['actionid']]['ContactId'],'ListId':this['actions'][_0x518836['actionid']]['ListId'],'VoiceQueueId':this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x134')));delete this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]];unlockQueueStatus(_0x6ae627);}}else if((strategy[this[_0x048d('0x20')][this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]][_0x048d('0x12d')]]||_0x048d('0x1a'))===_0x048d('0x1a')){var _0x4eca62;if(this[_0x048d('0xa8')][_0x518836['actionid']]&&!_[_0x048d('0x42')](this[_0x048d('0x12e')][this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]])){if(this[_0x048d('0x28')][_0x18530d[_0x048d('0xa8')][_0x518836['actionid']][_0x048d('0xaf')]]){this[_0x048d('0x28')][_0x18530d['actions'][_0x518836['actionid']][_0x048d('0xaf')]]=this[_0x048d('0x28')][this[_0x048d('0xa8')][_0x518836['actionid']]['queue']]?this[_0x048d('0x28')][this['actions'][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]]:this[_0x048d('0x12e')][this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]]?this[_0x048d('0x12e')][this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]][_0x048d('0x135')]||0x0:0x0;}this[_0x048d('0x12e')][this['actions'][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]][_0x048d('0x135')]=this[_0x048d('0x28')][this[_0x048d('0xa8')][_0x518836[_0x048d('0x128')]][_0x048d('0xaf')]];for(var _0x52ccd1=0x0;_0x52ccd1=0x0;})[_0x048d('0xad')](myreject(_0x9a52bb)));}}else{_0x5853dd[_0x048d('0x12f')](ami[_0x048d('0xab')]({'action':_0x048d('0x14d'),'command':util[_0x048d('0x78')](_0x048d('0x149'),_0xe5db60,!_[_0x048d('0x38')](config[_0x048d('0x146')][_0xd2decc])?_0xd2decc:'')})['then'](function(_0x35d212){return _0x35d212[_0x048d('0x14a')][_0x048d('0x14b')]('true')>=0x0;})['catch'](myreject(_0x9a52bb)));}BPromise[_0x048d('0x14e')](_0x5853dd)[_0x048d('0xba')](function(_0x233846){var _0x3251b5=_[_0x048d('0x14f')](_0x233846);if(_0x3251b5){return _0x57eb85(_0x3251b5);}else{_0x4945cf[_0x048d('0x39')]=_0x544fd9?_0x048d('0x150'):_0x048d('0x151');return _0x9a52bb(msgResponse('[ifTime][promiseAll]','Failure',_0x048d('0x152')+_0x544fd9+'\x20'+_0x3fcda2+_0x048d('0x153')+util[_0x048d('0x91')](_0xe5db60,{'showHidden':![],'depth':null})+_0x048d('0x154')+_0xd2decc));}})[_0x048d('0xad')](function(_0x15083e){return _0x9a52bb(msgResponse(_0x048d('0x142'),'Failure',JSON[_0x048d('0x46')](_0x15083e)));});});};Dialer[_0x048d('0x1c')]['checkDialMethod']=function(_0x43ef0b){var _0x2131d0=this;return function(){switch(_0x43ef0b[_0x048d('0x58')]){case _0x048d('0x155'):freeVariablesPredictive(_0x43ef0b);_0x2131d0[_0x048d('0x156')](_0x43ef0b,0x1);break;case _0x048d('0x157'):freeVariablesPredictive(_0x43ef0b);_0x2131d0[_0x048d('0x156')](_0x43ef0b,_0x43ef0b[_0x048d('0x158')]);break;case _0x048d('0xa'):_0x2131d0[_0x048d('0xa')](_0x43ef0b);break;case _0x048d('0x9'):freeVariablesPredictive(_0x43ef0b);_0x2131d0[_0x048d('0x156')](_0x43ef0b,0x1);break;default:freeVariablesPredictive(_0x43ef0b);logger[_0x048d('0x8f')](_0x048d('0x159'),_0x43ef0b['name'],'method\x20not\x20recognized');}};};Dialer[_0x048d('0x1c')][_0x048d('0x15a')]=function(_0x2bb134){var _0x99262e=this;return function(){_0x99262e[_0x048d('0x15b')](_0x2bb134);};};Dialer[_0x048d('0x1c')][_0x048d('0xb')]=function(_0x4c56a3){var _0x28c565=this;if(isNotPreview(_0x4c56a3['dialMethod'])){if(isVoiceQueueOutbound(_0x4c56a3[_0x048d('0x4a')])&&isActive(_0x4c56a3[_0x048d('0x57')])){_0x4c56a3[_0x048d('0x9a')]=!![];BPromise[_0x048d('0xb3')]()['then'](checkIsLoggedIn(_0x4c56a3,_0x4c56a3[_0x048d('0x4d')]))[_0x048d('0xba')](checkIsActive(_0x4c56a3,_0x4c56a3['dialActive']))['then'](checkInterval(_0x4c56a3))[_0x048d('0xba')](_0x28c565[_0x048d('0x13f')](_0x4c56a3))['then'](_0x28c565[_0x048d('0x15c')](_0x4c56a3[_0x048d('0x15d')],_0x4c56a3['dialTimezone'],_0x4c56a3['name'],_0x4c56a3))[_0x048d('0xba')](_0x28c565[_0x048d('0x15e')](_0x4c56a3[_0x048d('0x3f')],_0x4c56a3['dialTimezone'],_0x4c56a3[_0x048d('0x3d')],_0x4c56a3))['then'](_0x28c565[_0x048d('0x15f')](_0x4c56a3))[_0x048d('0xad')](loggerCatchQueueSummary(_0x048d('0x160'),_0x4c56a3));}else{notSendMessagesQueue(_0x4c56a3);}}else{freeVariablesPredictive(_0x4c56a3);}};Dialer[_0x048d('0x1c')][_0x048d('0x13e')]=function(){var _0x4a4f97=this;var _0x59d4c3;for(var _0x3e67d6 in this['campaigns']){if(typeof this['campaigns'][_0x3e67d6]!=='undefined'){_0x59d4c3=this[_0x048d('0x21')][_0x3e67d6];if(isCampaignIvr(_0x59d4c3[_0x048d('0x4a')])&&isActive(_0x59d4c3['active'])){_0x59d4c3[_0x048d('0x9a')]=!![];BPromise[_0x048d('0xb3')]()['then'](checkIsActive(_0x59d4c3,_0x59d4c3[_0x048d('0xda')]))[_0x048d('0xba')](checkInterval(_0x59d4c3))[_0x048d('0xba')](_0x4a4f97[_0x048d('0x13f')](_0x59d4c3))[_0x048d('0xba')](_0x4a4f97['checkIfTime'](_0x59d4c3['dialGlobalInterval'],_0x59d4c3[_0x048d('0x161')],_0x59d4c3['name'],_0x59d4c3))[_0x048d('0xba')](_0x4a4f97['checkIfTimeIntervals'](_0x59d4c3['Interval'],_0x59d4c3[_0x048d('0x161')],_0x59d4c3['name'],_0x59d4c3))[_0x048d('0xba')](_0x4a4f97['launchHandleIvr'](_0x59d4c3))['catch'](loggerCatchQueueSummary(_0x048d('0x162'),_0x59d4c3));}else{notSendMessagesCampaign(_0x59d4c3);}}}};function getCallerIdRandom(_0x3afb43,_0x1ddb7d){var _0x5e4e67;var _0x47ccae;var _0x27d5c3;if(_0x1ddb7d<=0x0){_0x1ddb7d=0x1;}_0x5e4e67=new RegExp(_0x048d('0x163')+_0x1ddb7d+'}$');_0x47ccae=Math[_0x048d('0x164')](0xa,_0x1ddb7d-0x1);_0x27d5c3=Math[_0x048d('0x164')](0xa,_0x1ddb7d)-0x1;return util['format']('%s',_[_0x048d('0x165')](_0x3afb43,_0x5e4e67,_[_0x048d('0x166')](_0x47ccae,_0x27d5c3)));}function extractCalleridName(_0x1c1d09){var _0x38e60c=_0x1c1d09[_0x048d('0x167')](/"(.*?)"/);return _0x38e60c?_0x38e60c[0x1]:_0x1c1d09;}function extractCalleridNumber(_0x41d810){var _0x42ad05=_0x41d810[_0x048d('0x167')](/<(.*?)>/);return _0x42ad05?_0x42ad05[0x1]:_0x41d810;}Dialer[_0x048d('0x1c')]['actionOriginate']=function(_0x2e456c,_0x2f7857){var _0x2a535c=this;var _0x53a4fc=uuid['v4']();this[_0x048d('0xa8')][_0x53a4fc]=new Action(_0x2e456c,_0x2f7857,_0x53a4fc);return new BPromise(function(_0x4b8c18,_0x5096d0){if(_['isUndefined'](_0x2e456c)&&typeof _0x2e456c!==_0x048d('0x168')){return _0x5096d0(msgResponse(_0x048d('0x169'),_0x048d('0x143'),_0x048d('0x16a')));}if(_['isUndefined'](_0x2f7857[_0x048d('0x16b')][_0x048d('0x16c')])||_0x2f7857[_0x048d('0x16b')][_0x048d('0x16c')]===null){return _0x5096d0(msgResponse(_0x048d('0x169'),_0x048d('0x143'),_0x048d('0x16d')));}var _0xe0ecf={'XMD-CALLERID':_0x2a535c[_0x048d('0xa8')][_0x53a4fc][_0x048d('0x16e')](),'XMD-AGI':_0x2e456c['dialQueueProject']?util[_0x048d('0x78')](_0x048d('0x16f'),ipAgi,_0x2e456c[_0x048d('0x109')]):'NONE','XMD-AGIAFTER':_0x2e456c[_0x048d('0x111')]?util[_0x048d('0x78')](_0x048d('0x16f'),ipAgi,_0x2e456c[_0x048d('0x111')]):_0x048d('0x170'),'XMD-QUEUE':_0x2e456c[_0x048d('0x4a')]===_0x048d('0x4b')?util[_0x048d('0x78')](_0x048d('0x171'),_0x2e456c[_0x048d('0x3d')],_0x2e456c[_0x048d('0x172')]||'',_0x2e456c['dialAgiAfterHangupAgent']?'c':'',_0x2e456c[_0x048d('0x173')]||0x3):_0x048d('0x170'),'XMD-CONTACTID':_0x2f7857[_0x048d('0xd2')],'XMD-CDRTYPE':_0x048d('0x7'),'CALLERID(all)':_0x2a535c[_0x048d('0xa8')][_0x53a4fc]['getCaller'](),'XMD-AMD':_0x2e456c['dialAMDActive']?'ACTIVE':'NONE','XMD-DESTINATION':_0x048d('0xe2')};if(_0x2e456c[_0x048d('0xff')]){_0xe0ecf['XMD-AMDINITIALSILENCE']=_0x2e456c[_0x048d('0x174')]||0x9c4;_0xe0ecf[_0x048d('0x175')]=_0x2e456c[_0x048d('0x176')]||0x5dc;_0xe0ecf['XMD-AMDAFTERGREETINGSILENCE']=_0x2e456c['dialAMDAfterGreetingSilence']||0x320;_0xe0ecf['XMD-AMDTOTALANALYSISTIME']=_0x2e456c[_0x048d('0x177')]||0x1388;_0xe0ecf[_0x048d('0x178')]=_0x2e456c['dialAMDMinWordLength']||0x64;_0xe0ecf['XMD-AMDBETWEENWORDSSILENCE']=_0x2e456c[_0x048d('0x179')]||0x32;_0xe0ecf[_0x048d('0x17a')]=_0x2e456c[_0x048d('0x17b')]||0x3;_0xe0ecf[_0x048d('0x17c')]=_0x2e456c[_0x048d('0x17d')]||0x100;_0xe0ecf[_0x048d('0x17e')]=_0x2e456c[_0x048d('0x17f')]||0x1388;}if(_0x2e456c[_0x048d('0x4a')]===_0x048d('0x4b')){_0xe0ecf[_0x048d('0x180')]=_0x2f7857['VoiceQueueId'];}else{_0xe0ecf['XMD-CAMPAIGNID']=_0x2f7857[_0x048d('0xd6')];}for(var _0x48ef8c in _0x2f7857[_0x048d('0x16b')]){if(typeof _0x2f7857[_0x048d('0x16b')][_0x48ef8c]!==_0x048d('0xcb')){if(isNotNull(_0x2f7857[_0x048d('0x16b')][_0x48ef8c])&&_0x48ef8c!=='id'&&_0x48ef8c!=='tags'&&_0x48ef8c!=='createdAt'&&_0x48ef8c!==_0x048d('0x181')){_0xe0ecf[util['format'](_0x048d('0x182'),'XMD-',_[_0x048d('0x183')](_0x48ef8c))]=_0x2f7857[_0x048d('0x16b')][_0x48ef8c];}}}var _0x3ac4c8=_0x2a535c[_0x048d('0xd9')](_0x2e456c[_0x048d('0x75')])?getCallerId(_0x2e456c[_0x048d('0x75')][_0x048d('0x76')],_0x2e456c[_0x048d('0x59')],_0x2e456c[_0x048d('0x184')]>0x0?getCallerIdRandom(_0x2e456c[_0x048d('0x5a')],_0x2e456c[_0x048d('0x184')]):_0x2e456c['dialOriginateCallerIdNumber']):getCallerId(_[_0x048d('0xaa')](_0x2e456c[_0x048d('0x140')])?_0x2e456c[_0x048d('0x75')]['callerid']:_0x2e456c[_0x048d('0x140')][_0x048d('0x76')],_0x2e456c[_0x048d('0x59')],_0x2e456c[_0x048d('0x184')]>0x0?getCallerIdRandom(_0x2e456c[_0x048d('0x5a')],_0x2e456c[_0x048d('0x184')]):_0x2e456c[_0x048d('0x5a')]);if(_0x3ac4c8){_0xe0ecf[_0x048d('0x185')]=_0x2a535c[_0x048d('0xa8')][_0x53a4fc]['originatecalleridname']=extractCalleridName(_0x3ac4c8);_0xe0ecf[_0x048d('0x186')]=_0x2a535c['actions'][_0x53a4fc]['originatecalleridnum']=extractCalleridNumber(_0x3ac4c8);}return ami[_0x048d('0xab')]({'actionid':_0x53a4fc,'action':'originate','channel':_0x2a535c['isTrunkReachable'](_0x2e456c['Trunk'])?util[_0x048d('0x78')](_0x048d('0x187'),_0x2e456c[_0x048d('0x75')]['name'],isNotNull(_0x2e456c['dialPrefix'])?_0x2e456c[_0x048d('0x5c')][_0x048d('0x188')]()||'':'',_0x2e456c[_0x048d('0x189')]>0x0?_0x2f7857[_0x048d('0x16b')][_0x048d('0x16c')][_0x048d('0x18a')](_0x2e456c[_0x048d('0x189')]):_0x2f7857[_0x048d('0x16b')][_0x048d('0x16c')]):util[_0x048d('0x78')]('SIP/%s/%s%s',_[_0x048d('0xaa')](_0x2e456c[_0x048d('0x140')])?_0x2e456c[_0x048d('0x75')][_0x048d('0x3d')]:_0x2e456c[_0x048d('0x140')]['name'],isNotNull(_0x2e456c['dialPrefix'])?_0x2e456c[_0x048d('0x5c')][_0x048d('0x188')]()||'':'',_0x2e456c['dialCutDigit']>0x0?_0x2f7857['Contact'][_0x048d('0x16c')][_0x048d('0x18a')](_0x2e456c[_0x048d('0x189')]):_0x2f7857['Contact']['phone']),'callerid':_0x3ac4c8,'Exten':'xcally-motion-dialer','Context':_0x048d('0x18b'),'Priority':'1','variable':_0xe0ecf,'timeout':(_0x2e456c[_0x048d('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x53a4fc})[_0x048d('0xba')](function(_0x4fb3b2){return _0x4b8c18(_0x4fb3b2);})[_0x048d('0xad')](function(_0x2561cf){_0x2e456c[_0x048d('0x18c')]+=0x1;var _0x516f4a=new History(_0x2a535c['actions'][_0x53a4fc]);logger['error'](util[_0x048d('0x78')](_0x048d('0x18d'),JSON[_0x048d('0x46')](_0x2561cf)));_0x516f4a[_0x048d('0xa0')]=0xe;_0x516f4a[_0x048d('0xa1')]=_0x048d('0x18e');_0x516f4a[_0x048d('0xa3')]=moment()['format'](_0x048d('0xfd'));_0x516f4a['endtime']=_0x516f4a['starttime'];_0x2a535c[_0x048d('0xc9')](_0x516f4a)[_0x048d('0xad')](loggerCatch(_0x048d('0x18f')));_0x2a535c[_0x048d('0xc8')](_0x516f4a)[_0x048d('0xad')](loggerCatch(_0x048d('0x18f')))['finally'](function(){delete _0x2a535c['actions'][_0x53a4fc];return _0x5096d0(msgResponse(_0x048d('0x169'),_0x048d('0x45'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x048d('0x2e')]=function(_0x4b0eaf){var _0x16f138=this['actions'][_0x4b0eaf[_0x048d('0x128')]];if(_0x16f138){delete this[_0x048d('0xa8')][_0x4b0eaf['actionid']];_0x16f138[_0x048d('0x119')]=moment()[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5d24c2=_0x16f138[_0x048d('0x4a')]===_0x048d('0x77')?this[_0x048d('0x21')][_0x16f138[_0x048d('0xaf')]]:this[_0x048d('0x20')][_0x16f138['getQueue']()];if(!this[_0x048d('0xd8')](_0x4b0eaf['response'])){this['updateOriginated'](_0x5d24c2);return this[_0x048d('0x190')](_0x16f138,_0x5d24c2,_0x4b0eaf)['catch'](loggerCatch(_0x048d('0x191')));}this[_0x048d('0xa6')][_0x4b0eaf[_0x048d('0xde')]]=_0x16f138;}};Dialer['prototype']['checkRetriveMax']=function(_0x46cdaf,_0x412b01,_0x558c15){var _0x50b140=new History(_0x412b01);if(_0x50b140[_0x048d('0x102')]+_0x50b140[_0x048d('0xf0')]+_0x50b140['countnoanswerretry']+_0x50b140[_0x048d('0xf2')]+_0x50b140[_0x048d('0x103')]+_0x50b140[_0x048d('0xf3')]+_0x50b140[_0x048d('0xf4')]+_0x50b140[_0x048d('0x104')]>=_0x558c15['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x46cdaf){case 0x3:if(_0x50b140[_0x048d('0xf1')]>=_0x558c15['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countnoanswerretry':_0x50b140[_0x048d('0xf1')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x192')],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140['ContactId'],'ListId':_0x50b140[_0x048d('0xd3')],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140[_0x048d('0xd6')]||undefined})['catch'](loggerCatch(_0x048d('0x193')));break;case 0x5:if(_0x50b140[_0x048d('0x102')]>=_0x558c15[_0x048d('0x194')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countbusyretry':_0x50b140[_0x048d('0x102')]+=0x1,'scheduledat':moment()['add'](_0x558c15[_0x048d('0x195')],'minutes')[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140[_0x048d('0xd2')],'ListId':_0x50b140['ListId'],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140['CampaignId']||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x196')));break;case 0x8:if(_0x50b140['countcongestionretry']>=_0x558c15[_0x048d('0x197')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countcongestionretry':_0x50b140[_0x048d('0xf0')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x198')],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140[_0x048d('0xd2')],'ListId':_0x50b140[_0x048d('0xd3')],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x50b140[_0x048d('0xf2')]>=_0x558c15['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x048d('0xbd')]({'active':![],'countnosuchnumberretry':_0x50b140[_0x048d('0xf2')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x199')],'minutes')[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140[_0x048d('0xd2')],'ListId':_0x50b140['ListId'],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x19a')));}break;case 0xa:if(_0x50b140[_0x048d('0x103')]>=_0x558c15[_0x048d('0x11b')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countdropretry':_0x50b140[_0x048d('0x103')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x19b')],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140[_0x048d('0xd2')],'ListId':_0x50b140[_0x048d('0xd3')],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x11c')));break;case 0xb:if(_0x50b140[_0x048d('0xf3')]>=_0x558c15[_0x048d('0x124')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countabandonedretry':_0x50b140[_0x048d('0xf3')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x19c')],_0x048d('0xfc'))[_0x048d('0x78')](_0x048d('0xfd')),'ContactId':_0x50b140[_0x048d('0xd2')],'ListId':_0x50b140[_0x048d('0xd3')],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140['CampaignId']||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x125')));break;case 0x13:if(_0x50b140[_0x048d('0xf4')]>=_0x558c15[_0x048d('0x105')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countmachineretry':_0x50b140[_0x048d('0xf4')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0xfb')],_0x048d('0xfc'))[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50b140['ContactId'],'ListId':_0x50b140[_0x048d('0xd3')],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140[_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0xfe')));break;case 0x14:if(_0x50b140[_0x048d('0x104')]>=_0x558c15[_0x048d('0x19d')]-0x1){return!![];}this[_0x048d('0xbd')]({'active':![],'countagentrejectretry':_0x50b140[_0x048d('0x104')]+=0x1,'scheduledat':moment()[_0x048d('0xfa')](_0x558c15[_0x048d('0x19e')],_0x048d('0xfc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50b140['ContactId'],'ListId':_0x50b140['ListId'],'VoiceQueueId':_0x50b140[_0x048d('0xd5')]||undefined,'CampaignId':_0x50b140['CampaignId']||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x19f')));break;default:return!![];}};Dialer['prototype'][_0x048d('0x190')]=function(_0x2e3acd,_0x50cc01,_0x1b04b9){var _0x401536=this;var _0x5ce75a=new History(_0x2e3acd);return new BPromise(function(_0x3edc60,_0x334953){if(_[_0x048d('0x38')](_0x50cc01)&&typeof _0x50cc01!==_0x048d('0x168')){return _0x334953(msgResponse('[callProgressDetecting]',_0x048d('0x143'),_0x048d('0x1a0')));}if(_[_0x048d('0x38')](_0x1b04b9)&&typeof _0x1b04b9!=='object'){return _0x334953(msgResponse('[callProgressDetecting]',_0x048d('0x143'),'evt\x20is\x20undefine'));}switch(_0x1b04b9[_0x048d('0x10e')]){case'0':_0x50cc01[_0x048d('0x65')]+=0x1;_0x5ce75a['state']=0x0;_0x5ce75a[_0x048d('0xa1')]=_0x048d('0x1a1');_0x5ce75a[_0x048d('0xf2')]+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;ami[_0x048d('0x49')](_0x048d('0x1a2'),ut[_0x048d('0xed')](_0x2e3acd,_0x048d('0x1a3')));_0x401536[_0x048d('0xc9')](_0x5ce75a)[_0x048d('0xad')](loggerCatch(_0x048d('0xef')));if(_0x401536[_0x048d('0x1a4')](0x0,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0xf2')]>=_0x50cc01['dialNoSuchNumberMaxRetry']){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x200\x20no\x20such\x20number....');}else{_0x401536[_0x048d('0xf6')](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1a5'));}}break;case'3':_0x50cc01[_0x048d('0x64')]+=0x1;_0x5ce75a[_0x048d('0xa0')]=0x3;_0x5ce75a[_0x048d('0xa1')]=_0x048d('0x1a6');_0x5ce75a['countnoanswerretry']+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;ami[_0x048d('0x49')](_0x048d('0x1a7'),ut[_0x048d('0xed')](_0x2e3acd,'noanswer'));_0x401536[_0x048d('0xc9')](_0x5ce75a)[_0x048d('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x401536['checkRetriveMax'](0x3,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0xf1')]>=_0x50cc01[_0x048d('0x1a8')]){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x203\x20ringing\x20no\x20answer');}else{_0x401536['stateGlobal'](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1a9'));}}break;case'5':_0x50cc01[_0x048d('0x5f')]+=0x1;_0x5ce75a[_0x048d('0xa0')]=0x5;_0x5ce75a['statedesc']=_0x048d('0x1aa');_0x5ce75a[_0x048d('0x102')]+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;ami[_0x048d('0x49')]('custom:agentbusy',ut[_0x048d('0xed')](_0x2e3acd,_0x048d('0x1ab')));_0x401536[_0x048d('0xc9')](_0x5ce75a)[_0x048d('0xad')](loggerCatch(_0x048d('0x1ac')));if(_0x401536[_0x048d('0x1a4')](0x5,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0x102')]>=_0x50cc01['dialBusyMaxRetry']){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1ad'));}else{_0x401536[_0x048d('0xf6')](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1ad'));}}break;case'8':_0x50cc01[_0x048d('0x60')]+=0x1;_0x5ce75a[_0x048d('0xa0')]=0x8;_0x5ce75a['statedesc']=_0x048d('0x1ae');_0x5ce75a[_0x048d('0xf0')]+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;ami[_0x048d('0x49')](_0x048d('0x1af'),ut[_0x048d('0xed')](_0x2e3acd,_0x048d('0x1b0')));_0x401536[_0x048d('0xc9')](_0x5ce75a)[_0x048d('0xad')](loggerCatch(_0x048d('0x1b1')));if(_0x401536[_0x048d('0x1a4')](0x8,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0xf0')]>=_0x50cc01['dialCongestionMaxRetry']){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x208\x20congestion');}else{_0x401536[_0x048d('0xf6')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x208\x20congestion');}}break;case'11':_0x50cc01[_0x048d('0x1b2')]+=0x1;_0x5ce75a[_0x048d('0xa0')]=0xb;_0x5ce75a['statedesc']='Abandoned';_0x5ce75a[_0x048d('0xf3')]+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;_0x401536[_0x048d('0xc9')](_0x5ce75a)['catch'](loggerCatch(_0x048d('0x126')));if(_0x401536['checkRetriveMax'](0xb,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0xf3')]>=_0x50cc01[_0x048d('0x124')]){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1b3'));}else{_0x401536[_0x048d('0xf6')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x2011\x20abandoned');}}break;case'20':_0x50cc01['outboundRejectCallsDay']+=0x1;_0x5ce75a['state']=0x14;_0x5ce75a[_0x048d('0xa1')]=_0x048d('0x1b4');_0x5ce75a['countagentrejectretry']+=0x1;_0x5ce75a[_0x048d('0xec')]+=0x1;ami[_0x048d('0x49')](_0x048d('0x1b5'),ut[_0x048d('0xed')](_0x2e3acd,_0x048d('0x1b6')));_0x401536['createHistory'](_0x5ce75a)[_0x048d('0xad')](loggerCatch(_0x048d('0x1b7')));if(_0x401536[_0x048d('0x1a4')](0x14,_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0x104')]>=_0x50cc01['dialAgentRejectMaxRetry']){_0x401536[_0x048d('0xf8')](_0x5ce75a,_0x3edc60,_0x334953,_0x048d('0x1b8'));}else{_0x401536[_0x048d('0xf6')](_0x5ce75a,_0x3edc60,_0x334953,'reason\x2020\x20agentreject');}}break;default:_0x50cc01[_0x048d('0x67')]+=0x1;_0x5ce75a[_0x048d('0xa0')]=0xc;_0x5ce75a[_0x048d('0xa1')]=_0x1b04b9[_0x048d('0x10e')];_0x401536[_0x048d('0xc9')](_0x5ce75a)[_0x048d('0xad')](loggerCatch(_0x048d('0x1b9')));if(_0x401536[_0x048d('0x1a4')](_0x1b04b9['reason'],_0x2e3acd,_0x50cc01)){if(_0x5ce75a[_0x048d('0x102')]+_0x5ce75a[_0x048d('0xf0')]+_0x5ce75a[_0x048d('0xf1')]+_0x5ce75a[_0x048d('0xf2')]+_0x5ce75a[_0x048d('0x103')]+_0x5ce75a[_0x048d('0xf3')]+_0x5ce75a[_0x048d('0xf4')]+_0x5ce75a[_0x048d('0x104')]>=_0x50cc01[_0x048d('0xf5')]){_0x401536['stateGlobal'](_0x5ce75a,_0x3edc60,_0x334953,_0x1b04b9[_0x048d('0x10e')]);}else{_0x401536['createStateFinal'](_0x5ce75a,_0x3edc60,_0x334953,_0x1b04b9[_0x048d('0x10e')]);}}}});};Dialer[_0x048d('0x1c')][_0x048d('0xf6')]=function(_0xda6065,_0x223825,_0x2ca183,_0x1cb443){var _0x3aa7ef=new Final(_0xda6065);_0x3aa7ef[_0x048d('0xa0')]=0xf;_0x3aa7ef[_0x048d('0xa1')]=_0x048d('0x1ba');this[_0x048d('0xf8')](_0x3aa7ef,_0x223825,_0x2ca183,_0x1cb443);};Dialer[_0x048d('0x1c')][_0x048d('0xf8')]=function(_0x4bc429,_0x38969f,_0x161551,_0x53f806){this[_0x048d('0xc8')](_0x4bc429)[_0x048d('0xba')](function(){return _0x38969f(msgResponse(_0x048d('0x1bb'),'Success',_0x53f806));})[_0x048d('0xad')](function(){return _0x161551(msgResponse('[moveContactManagedDialer][0]',_0x048d('0x143'),_0x048d('0x1bc')));});};Dialer[_0x048d('0x1c')][_0x048d('0xa')]=function(_0x1379c9){var _0x54398e=_0x1379c9[_0x048d('0x1bd')]/0x64;var _0xa3f782=_0x1379c9['outboundDropCallsDayTimeout']/(_0x1379c9[_0x048d('0x63')]+_0x1379c9['outboundAnswerCallsDay']);var _0x4d63f5=Math[_0x048d('0x1be')](_0x1379c9[_0x048d('0x71')]*(_0x1379c9[_0x048d('0x1bf')]/0x64));var _0x15a28b=Math[_0x048d('0x1be')](_0x1379c9[_0x048d('0x71')]*(_0x1379c9[_0x048d('0x1c0')]/0x64));var _0x554f03=_0x1379c9[_0x048d('0x4c')]+_0x1379c9[_0x048d('0x51')];var _0x3ff4bc=Math['floor'](_0x1379c9[_0x048d('0x73')]*_0x1379c9[_0x048d('0x74')]*_0x1379c9['predictiveIntervalHitRate']*_0x1379c9[_0x048d('0x70')]);if(_['isUndefined'](_0x1379c9['startProgressive'])){if(!_[_0x048d('0x38')](_0x1379c9[_0x048d('0x26')])){_0x1379c9[_0x048d('0x26')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x048d('0x1c1'));}if(!_[_0x048d('0x38')](_0x1379c9[_0x048d('0x8a')])){loggerPredictive[_0x048d('0x8f')]('[startMethodPredictive][StartProgressive]',_0x048d('0x1c2'));clearInterval(_0x1379c9[_0x048d('0x8a')]);_0x1379c9[_0x048d('0x8a')]=undefined;}_0x1379c9['startProgressive']=moment()[_0x048d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x048d('0x79')](_0x1379c9[_0x048d('0x3d')],_0x048d('0x1c3'),_0x1379c9['startProgressive']);this['handlePower'](_0x1379c9,0x1);}else if(ifInterval(_0x1379c9[_0x048d('0x1c4')],_0x1379c9['startProgressive'])){this[_0x048d('0x156')](_0x1379c9,0x1);loggerPredictiveCalls[_0x048d('0x79')](_0x048d('0x1c5'),_0x1379c9[_0x048d('0x27')],_0x1379c9[_0x048d('0x3d')]);_0x1379c9[_0x048d('0x73')]=0x0;_0x1379c9[_0x048d('0x6e')]=0x0;}else if(_0x54398e<_0xa3f782&&_0x1379c9['dialPredictiveOptimization']===_0x048d('0x1c6')){freeVariablesPredictive(_0x1379c9);loggerPredictive[_0x048d('0x79')](_0x048d('0x1c7'),_0x048d('0x1c8'),_0xa3f782,_0x048d('0x27'),_0x1379c9[_0x048d('0x3d')]);}else if(_0x3ff4bc<_0x1379c9[_0x048d('0x6e')]&&_0x1379c9[_0x048d('0x1c9')]==='dropRate'){freeVariablesPredictive(_0x1379c9);loggerPredictive[_0x048d('0x79')](_0x048d('0x1ca'),_0x048d('0x1cb'),_0x3ff4bc,_0x048d('0x1cc'),_0x1379c9[_0x048d('0x6e')],_0x048d('0x27'),_0x1379c9[_0x048d('0x3d')]);}else if(!ifInterval(_0x1379c9['dialPredictiveInterval'],_0x1379c9[_0x048d('0x27')])&&_[_0x048d('0x38')](_0x1379c9[_0x048d('0x26')])&&!_[_0x048d('0x38')](_0x1379c9[_0x048d('0x27')])){_0x1379c9[_0x048d('0x26')]=moment()[_0x048d('0x78')](_0x048d('0xfd'));loggerPredictive[_0x048d('0x79')](_0x1379c9[_0x048d('0x3d')],'started\x20in\x20predictive\x20at',_0x1379c9[_0x048d('0x26')]);this[_0x048d('0xb9')](_0x1379c9[_0x048d('0x1c4')])['then'](this[_0x048d('0x1cd')](_0x1379c9))[_0x048d('0xba')](mergeDataErlangB(_0x1379c9))[_0x048d('0xba')](this[_0x048d('0x1ce')](_0x1379c9))['catch'](loggerCatchPredictive(_0x048d('0x1cf'),_0x1379c9));}else if(!ifInterval(_0x1379c9[_0x048d('0x1c4')],_0x1379c9[_0x048d('0x26')])){_0x1379c9[_0x048d('0x6e')]=0x0;_0x1379c9[_0x048d('0x26')]=moment()[_0x048d('0x78')](_0x048d('0xfd'));loggerPredictive[_0x048d('0x79')](_0x1379c9[_0x048d('0x3d')],_0x048d('0x1d0'),_0x1379c9['startPredictive']);clearInterval(_0x1379c9['handlePredictive']);_0x1379c9[_0x048d('0x8a')]=undefined;this[_0x048d('0xb9')](_0x1379c9[_0x048d('0x1c4')])[_0x048d('0xba')](this[_0x048d('0x1cd')](_0x1379c9))[_0x048d('0xba')](mergeDataErlangB(_0x1379c9))[_0x048d('0xba')](this['startMethodPredictive'](_0x1379c9))[_0x048d('0xad')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1379c9));}else if(_0x1379c9[_0x048d('0x71')]&&_0x554f03<_0x1379c9['predictiveIntervalAvailable']-_0x15a28b){freeVariablesPredictive(_0x1379c9);loggerPredictive['info'](_0x1379c9[_0x048d('0x3d')],_0x048d('0x1d1'),_0x554f03,_0x048d('0x1d2'),_0x1379c9[_0x048d('0x71')],'-',_0x15a28b,'=',_0x1379c9[_0x048d('0x71')]-_0x15a28b,')');}else if(_0x1379c9[_0x048d('0x71')]&&_0x554f03>_0x1379c9[_0x048d('0x71')]+_0x4d63f5){freeVariablesPredictive(_0x1379c9);loggerPredictive[_0x048d('0x79')](_0x1379c9[_0x048d('0x3d')],_0x048d('0x1d1'),_0x554f03,_0x048d('0x1d3'),_0x1379c9[_0x048d('0x71')],'+',_0x4d63f5,'=',_0x1379c9[_0x048d('0x71')]+_0x4d63f5,')');}};Dialer[_0x048d('0x1c')][_0x048d('0x1cd')]=function(_0xac12e0){var _0x3d7ed9=this;return function(_0x440485){return new BPromise(function(_0x147acc,_0x362985){_['merge'](_0xac12e0,_0x440485[0x0]);if(checkGetDataPredictive(_0x440485[0x0])){var _0x5ba066=_0xac12e0[_0x048d('0x71')]=_0xac12e0['talking']+_0xac12e0[_0x048d('0x4c')];var _0x4aa27f=_0xac12e0[_0x048d('0x1c4')]*0x3c;var _0x4ced14=_0x440485[0x0][_0x048d('0x6a')]+_0x440485[0x0][_0x048d('0x69')];var _0x28211c=(_0x440485[0x0][_0x048d('0x68')]+_0x440485[0x0][_0x048d('0x6c')]+_0x440485[0x0][_0x048d('0x6b')])/_0x440485[0x0][_0x048d('0x72')];_0xac12e0[_0x048d('0x6f')]=_0x28211c>0x0?_0x28211c:0x1;switch(_0xac12e0[_0x048d('0x1c9')]){case _0x048d('0x1c6'):var _0x2d3e80=_0xac12e0[_0x048d('0x1bd')]/0x64;return _0x3d7ed9['abandonmentRate'](_0x5ba066,_0x4aa27f,_0x4ced14,_0x28211c,_0x2d3e80)[_0x048d('0xba')](function(_0x268a4e){return _0x147acc(_0x268a4e);});case'agentBusyFactor':var _0x4b5a83=_0xac12e0[_0x048d('0x1bd')]/0x64;return _0x3d7ed9['busyFactor'](_0x5ba066,_0x4aa27f,_0x4ced14,_0x28211c,_0x4b5a83)[_0x048d('0xba')](function(_0x5781dc){return _0x147acc(_0x5781dc);});default:return _0x362985(msgResponse(_0x048d('0x1d4'),_0x048d('0x143'),_0x048d('0x1d5')));}}else{return _0x362985(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x048d('0x1c')][_0x048d('0x1d6')]=function(_0x4c6074){var _0x27e880=this;return function(_0x56ad28){return new BPromise(function(_0x17eec9,_0x459974){_[_0x048d('0x88')](_0x4c6074,_0x56ad28[0x0]);if(checkGetDataPredictive(_0x56ad28[0x0])){loggerPredictive['info'](JSON[_0x048d('0x46')](_0x56ad28[0x0]));if(_0x4c6074[_0x048d('0x1c9')]===_0x048d('0x1c6')){return _0x27e880['getVoiceQueueRtPauses'](_0x4c6074['id'])[_0x048d('0xba')](function(_0x21ad72){var _0x4a887e=_0x4c6074[_0x048d('0x4d')]-_0x21ad72[0x0][_0x048d('0x1d7')];var _0x28c021=_0x4c6074[_0x048d('0x1c4')]*0x3c;var _0x59e03a=_0x56ad28[0x0]['predictiveIntervalAvgTalktime']+_0x56ad28[0x0][_0x048d('0x69')];var _0x19b121=(_0x56ad28[0x0]['predictiveIntervalAnsweredCalls']+_0x56ad28[0x0][_0x048d('0x6c')]+_0x56ad28[0x0][_0x048d('0x6b')])/_0x56ad28[0x0][_0x048d('0x72')];var _0x4863e4=_0x4c6074[_0x048d('0x1bd')]/0x64;_0x4c6074[_0x048d('0x1d8')]=_0x21ad72[0x0][_0x048d('0x1d7')]||0x0;_0x4c6074['predictiveIntervalHitRate']=_0x19b121>0x0?_0x19b121:0x1;return _0x27e880[_0x048d('0x1d9')](_0x4a887e,_0x28c021,_0x59e03a,_0x19b121,_0x4863e4);})[_0x048d('0xba')](function(_0x38c9ba){return _0x17eec9(_0x38c9ba);})[_0x048d('0xad')](function(_0xcd0718){return _0x459974(msgResponse(_0x048d('0x1da'),_0x048d('0x143'),JSON[_0x048d('0x46')](_0xcd0718)));});}if(_0x4c6074['dialPredictiveOptimization']===_0x048d('0x1db')){return _0x27e880[_0x048d('0xc6')](_0x4c6074['id'])[_0x048d('0xba')](function(_0x259cad){var _0x256b15=_0x4c6074[_0x048d('0x4d')]-_0x259cad[0x0][_0x048d('0x1d7')];var _0xc51d6b=_0x4c6074['dialPredictiveInterval']*0x3c;var _0x4c5084=_0x56ad28[0x0]['predictiveIntervalAvgTalktime']+_0x56ad28[0x0][_0x048d('0x69')];var _0x4d22e6=(_0x56ad28[0x0][_0x048d('0x68')]+_0x56ad28[0x0][_0x048d('0x6c')]+_0x56ad28[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x56ad28[0x0][_0x048d('0x72')];var _0x4abfe8=_0x4c6074['dialPredictiveOptimizationPercentage']/0x64;_0x4c6074[_0x048d('0x1d8')]=_0x259cad[0x0][_0x048d('0x1d7')]||0x0;_0x4c6074['predictiveIntervalHitRate']=_0x4d22e6>0x0?_0x4d22e6:0x1;return _0x27e880[_0x048d('0x1dc')](_0x256b15,_0xc51d6b,_0x4c5084,_0x4d22e6,_0x4abfe8);})[_0x048d('0xba')](function(_0xb42916){return _0x17eec9(_0xb42916);})[_0x048d('0xad')](function(_0x314016){return _0x459974(msgResponse(_0x048d('0x1da'),_0x048d('0x143'),JSON[_0x048d('0x46')](_0x314016)));});}}else{return _0x459974(msgResponse(_0x048d('0x1d4'),_0x048d('0x143'),'check\x20failure'));}});};};Dialer[_0x048d('0x1c')][_0x048d('0x1ce')]=function(_0xcfb3e8){var _0x16ba91=this;return function(){var _0xdc3e65=0x0;var _0x43cb3f=Math['floor'](_0xcfb3e8['erlangCallToSecond']*0x3e8);if(_0x43cb3f>0x0){_0x43cb3f=_0x43cb3f<0x64?0x64:_0x43cb3f;loggerPredictive[_0x048d('0x79')](_0xcfb3e8[_0x048d('0x3d')],_0x048d('0x1dd'),_0x43cb3f,_0x048d('0x47'));_0xcfb3e8[_0x048d('0x8a')]=setInterval(function(){_0x16ba91[_0x048d('0x8a')](_0xcfb3e8);loggerPredictiveCalls[_0x048d('0x79')](_0x048d('0x1de'),_0xdc3e65+=0x1);},_0x43cb3f);}else{loggerPredictive[_0x048d('0x79')](_0xcfb3e8[_0x048d('0x3d')],_0x048d('0x1df'));}};};Dialer[_0x048d('0x1c')][_0x048d('0x1e0')]=function(_0x5e3c68,_0x3144f6){var _0x5c4210=this;return function(_0x1b1c50){if(_['isEmpty'](_0x1b1c50)){if(_[_0x048d('0xaa')](_0x3144f6[_0x048d('0xd4')])||!_0x3144f6['recallme']){if(_0x5e3c68[_0x048d('0x58')]===_0x048d('0x9')){_0x5e3c68[_0x048d('0x131')]=_[_0x048d('0x38')](_0x5e3c68[_0x048d('0x131')])?!![]:_0x5e3c68[_0x048d('0x131')];var _0x1d29cf=uuid['v4']();_0x5c4210[_0x048d('0xa8')][_0x1d29cf]=new Action(_0x5e3c68,_0x3144f6,_0x1d29cf);loggerBooked['info'](_0x048d('0x1e1'),_0x1d29cf,'queueStatusComplete:\x20',JSON[_0x048d('0x46')](_0x5e3c68[_0x048d('0x131')]),_0x048d('0x1e2'),_0x5e3c68[_0x048d('0x3d')]);if(_0x5e3c68[_0x048d('0x131')]){_0x5e3c68[_0x048d('0x131')]=![];_0x5c4210[_0x048d('0x12e')][_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xaf')]]=[];ami['Action']({'actionid':_0x1d29cf,'action':_0x048d('0x1e3'),'queue':_0x5e3c68[_0x048d('0x3d')]})[_0x048d('0xad')](function(){_0x5c4210[_0x048d('0xb1')](_0x5e3c68);_0x5c4210[_0x048d('0xbd')]({'active':![],'ContactId':_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xd2')],'ListId':_0x5c4210['actions'][_0x1d29cf][_0x048d('0xd3')],'VoiceQueueId':_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xd5')]||undefined,'CampaignId':_0x5c4210['actions'][_0x1d29cf]['CampaignId']||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x1e4')));delete _0x5c4210[_0x048d('0xa8')][_0x1d29cf];});}else{loggerBooked['info'](_0x048d('0x1e5'),JSON[_0x048d('0x46')](_0x5e3c68[_0x048d('0x131')]),_0x048d('0x1e2'),_0x5e3c68['name']);_0x5c4210[_0x048d('0xb1')](_0x5e3c68);_0x5c4210[_0x048d('0xbd')]({'active':![],'ContactId':_0x5c4210['actions'][_0x1d29cf][_0x048d('0xd2')],'ListId':_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xd3')],'VoiceQueueId':_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xd5')]||undefined,'CampaignId':_0x5c4210[_0x048d('0xa8')][_0x1d29cf][_0x048d('0xd6')]||undefined})[_0x048d('0xad')](loggerCatch(_0x048d('0x1e4')));delete _0x5c4210['actions'][_0x1d29cf];}}else{return _0x5c4210['actionOriginate'](_0x5e3c68,_0x3144f6);}}else{if(getDiff(_0x3144f6['scheduledat'])<_0x5e3c68[_0x048d('0x1e6')]*0x3c){if(_0x3144f6[_0x048d('0x1e7')]&&!_0x3144f6['Agent'][_0x048d('0x1e8')]){_0x5c4210['preview'][_0x048d('0x1e9')](_0x3144f6['id'])[_0x048d('0x1e')](function(){_0x5c4210['updateOriginated'](_0x5e3c68);});}else{_0x5c4210[_0x048d('0xbf')]({'active':![]},_0x3144f6['id'],0x1)[_0x048d('0x1e')](function(){_0x5c4210['updateOriginated'](_0x5e3c68);});}}else{_0x5e3c68[_0x048d('0x1ea')]+=0x1;_0x5c4210[_0x048d('0xb1')](_0x5e3c68);if(_0x5e3c68[_0x048d('0x1eb')]){_0x5c4210['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3144f6[_0x048d('0xd2')],'ListId':_0x3144f6[_0x048d('0xd3')],'VoiceQueueId':_0x3144f6[_0x048d('0xd5')]||undefined,'CampaignId':_0x3144f6[_0x048d('0xd6')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5c4210[_0x048d('0xc9')](createObjHistory(_0x5e3c68,_0x3144f6,_0x048d('0x1ec'),0x17,_0x048d('0x1ed')))[_0x048d('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5c4210[_0x048d('0xd0')](createObjHistory(_0x5e3c68,_0x3144f6,_0x048d('0x1ee'),0x16,_0x048d('0x1ef')),_0x048d('0x1f0'),_0x048d('0x1f1'));}}}}else{_0x5e3c68['outboundBlacklistCallsDay']+=0x1;_0x5c4210[_0x048d('0xd0')](createObjHistory(_0x5e3c68,_0x3144f6,_0x048d('0x1f2'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x048d('0x1f3'));throw _0x048d('0x1f4');}};};Dialer[_0x048d('0x1c')]['handleIvr']=function(_0x415e4b){var _0x37fa33=this;var _0x40e920=_0x415e4b[_0x048d('0x1f5')]-_0x415e4b[_0x048d('0x92')]-_0x415e4b['temp'];emitCampaignSummary(_0x415e4b);if(_0x40e920>0x0){if(_0x40e920>this[_0x048d('0x23')]){_0x40e920=this[_0x048d('0x23')];}_0x415e4b['temp']+=_0x40e920;this[_0x048d('0xc4')](_0x415e4b['id'],_0x40e920,_0x415e4b['dialOrderByScheduledAt'],_0x415e4b)['then'](function(_0x374bc1){_0x415e4b[_0x048d('0xc2')]-=_0x40e920;_0x415e4b['temp']=_0x415e4b[_0x048d('0xc2')]>0x0?_0x415e4b[_0x048d('0xc2')]:0x0;if(!checkContactEmpty(_0x374bc1)){_0x415e4b[_0x048d('0x39')]=_0x048d('0x98');logger[_0x048d('0x79')]('[getContactCampaign2][Empty]'+_0x415e4b['name']);}else{_0x415e4b['originated']+=_0x374bc1[_0x048d('0x136')];_0x415e4b[_0x048d('0x39')]=_0x048d('0x1f6');for(var _0x320ea8=0x0;_0x320ea8<_0x374bc1[_0x048d('0x136')];_0x320ea8+=0x1){_0x415e4b[_0x048d('0x1f7')]+=0x1;if(_[_0x048d('0xaa')](_0x374bc1[_0x320ea8])||_[_0x048d('0xaa')](_0x374bc1[_0x320ea8]['Contact'])||_[_0x048d('0xaa')](_0x374bc1[_0x320ea8]['Contact']['phone'])){_0x37fa33[_0x048d('0xce')](_0x048d('0x1f8'),_0x415e4b,_0x374bc1[_0x320ea8]);}else{_0x37fa33['checkIsBlackListIvr'](_['pick'](_0x374bc1[_0x320ea8],[_0x048d('0xd6'),'Contact.phone']))[_0x048d('0xba')](_0x37fa33[_0x048d('0x1e0')](_0x415e4b,_0x374bc1[_0x320ea8]))[_0x048d('0xad')](_0x37fa33[_0x048d('0xcd')]('[actionOriginateIvr]\x20',_0x415e4b));}}}})[_0x048d('0xad')](loggerGetContactDialer(_0x048d('0x1f9'),_0x415e4b,_0x40e920));}};Dialer[_0x048d('0x1c')]['handlePower']=function(_0x2a975a,_0x44b1e6){var _0x1a1567=this;var _0x2a88a9=[];var _0x4fe455=_0x44b1e6>=0x1?_0x44b1e6:0x1;if(_0x2a975a['dialMethod']===_0x048d('0x9')){_0x4fe455=0x1;}var _0x5efb7d=Math[_0x048d('0x1fa')](_0x2a975a['available']*_0x4fe455)-_0x2a975a[_0x048d('0x92')]-_0x2a975a['temp'];emitVoiceQueueSummary(_0x2a975a);if(_0x2a975a[_0x048d('0x1fb')]>0x0){var _0x330ea1=_0x2a975a[_0x048d('0x1fb')]-_0x2a975a[_0x048d('0x92')]-_0x2a975a[_0x048d('0x51')]-_0x2a975a[_0x048d('0xc2')]-_0x2a975a[_0x048d('0x4e')];if(_0x5efb7d>_0x330ea1){_0x5efb7d=_0x330ea1;}}if(_0x5efb7d>0x0){if(_0x2a975a[_0x048d('0x58')]===_0x048d('0x9')){_0x5efb7d=0x1;}if(_0x5efb7d>this['maxNumberOriginate']){_0x5efb7d=this['maxNumberOriginate'];}_0x2a975a[_0x048d('0xc2')]+=_0x5efb7d;for(var _0x162e9a in this[_0x048d('0x12c')]){if(typeof this['agents'][_0x162e9a]!=='undefined'){if(this['agents'][_0x162e9a][_0x048d('0xa0')]===_0x048d('0x1fc')&&this['agents'][_0x162e9a][_0x048d('0xac')]===_0x048d('0xdb')){_0x2a88a9['push'](this['agents'][_0x162e9a]['id']);}}}this[_0x048d('0xc1')](_0x2a975a['id'],_0x2a88a9,_0x5efb7d,_0x2a975a[_0x048d('0x1fd')],_0x2a975a)[_0x048d('0xba')](function(_0x2eda2d){_0x2a975a['temp']-=_0x5efb7d;_0x2a975a[_0x048d('0xc2')]=_0x2a975a['temp']>0x0?_0x2a975a[_0x048d('0xc2')]:0x0;if(!checkContactEmpty(_0x2eda2d)){_0x1a1567['countReScheduled'](_0x2a975a)[_0x048d('0xba')](sendMessageReschedule(_0x2a975a))[_0x048d('0xad')](loggerCatch(_0x048d('0xb4')));}else{_0x2a975a[_0x048d('0x92')]+=_0x2eda2d[_0x048d('0x136')];_0x2a975a[_0x048d('0x39')]=_0x2a975a[_0x048d('0x58')]==='booked'?'ACTIVE':_0x048d('0x1f6');for(var _0x232c7e=0x0;_0x232c7e<_0x2eda2d[_0x048d('0x136')];_0x232c7e+=0x1){if(_[_0x048d('0xaa')](_0x2eda2d[_0x232c7e])||_[_0x048d('0xaa')](_0x2eda2d[_0x232c7e]['Contact'])||_['isNil'](_0x2eda2d[_0x232c7e][_0x048d('0x16b')][_0x048d('0x16c')])){_0x1a1567[_0x048d('0xce')](_0x048d('0x1f8'),_0x2a975a,_0x2eda2d[_0x232c7e]);}else{_0x1a1567[_0x048d('0xb5')](_[_0x048d('0xd1')](_0x2eda2d[_0x232c7e],[_0x048d('0xd5'),'Contact.phone']))[_0x048d('0xba')](_0x1a1567[_0x048d('0x1e0')](_0x2a975a,_0x2eda2d[_0x232c7e]))[_0x048d('0xad')](_0x1a1567['loggerHandler'](_0x048d('0x1f8'),_0x2a975a));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x2a975a,_0x5efb7d));}};Dialer['prototype']['handlePredictive']=function(_0xcbf616){if(_0xcbf616[_0x048d('0x1fb')]>0x0){var _0x22379d=_0xcbf616[_0x048d('0x1fb')]-_0xcbf616[_0x048d('0x92')]-_0xcbf616[_0x048d('0x51')];if(_0x22379d>0x0){this[_0x048d('0x1fe')](_0xcbf616);}else{loggerPredictiveCalls[_0x048d('0x79')](_0x048d('0x1ff'));}}else{this[_0x048d('0x1fe')](_0xcbf616);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x781d5c){var _0x5380a5=this;var _0x58ceef=[];_0x781d5c[_0x048d('0x92')]+=0x1;for(var _0x41d563 in this['agents']){if(typeof this[_0x048d('0x12c')][_0x41d563]!==_0x048d('0xcb')){if(this[_0x048d('0x12c')][_0x41d563]['state']===_0x048d('0x1fc')&&this[_0x048d('0x12c')][_0x41d563][_0x048d('0xac')]===_0x048d('0xdb')){_0x58ceef[_0x048d('0x12f')](this[_0x048d('0x12c')][_0x41d563]['id']);}}}this[_0x048d('0xc1')](_0x781d5c['id'],_0x58ceef,0x1,_0x781d5c[_0x048d('0x1fd')],_0x781d5c)[_0x048d('0xba')](function(_0x3f95f5){if(!checkContactEmpty(_0x3f95f5)){checkContactLowerLimitOriginate(_0x781d5c,0x1,0x0);_0x5380a5[_0x048d('0x200')](_0x781d5c)[_0x048d('0xba')](sendMessageReschedule(_0x781d5c))[_0x048d('0xad')](loggerCatch(_0x048d('0xb4')));}else{_0x781d5c[_0x048d('0x39')]='RUNNING';if(_[_0x048d('0xaa')](_0x3f95f5[0x0])||_[_0x048d('0xaa')](_0x3f95f5[0x0]['Contact'])||_[_0x048d('0xaa')](_0x3f95f5[0x0]['Contact']['phone'])){_0x5380a5['emptyContact'](_0x048d('0x1f8'),_0x781d5c,_0x3f95f5[0x0]);}else{_0x5380a5[_0x048d('0xb5')](_[_0x048d('0xd1')](_0x3f95f5[0x0],[_0x048d('0xd5'),'Contact.phone']))[_0x048d('0xba')](_0x5380a5['checkContactBlack'](_0x781d5c,_0x3f95f5[0x0]))['catch'](_0x5380a5[_0x048d('0xcd')]('[actionOriginatePredictive]\x20',_0x781d5c));}}})[_0x048d('0xad')](loggerGetContactDialer(_0x048d('0x201'),_0x781d5c,0x1));emitVoiceQueueSummary(_0x781d5c);};Dialer['prototype'][_0x048d('0x1d9')]=function(_0xadecc9,_0x24d529,_0x224687,_0x4fcdff,_0x5780b7,_0xcad21d){loggerPredictive['info'](_0x048d('0x202'));loggerPredictive[_0x048d('0x79')]('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',_0xadecc9);loggerPredictive[_0x048d('0x79')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24d529);loggerPredictive[_0x048d('0x79')]('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',_0x224687);loggerPredictive[_0x048d('0x79')](_0x048d('0x203'),_0x4fcdff);loggerPredictive[_0x048d('0x79')](_0x048d('0x204'),_0x5780b7);loggerPredictive[_0x048d('0x79')]('---------------------------');return new BPromise(function(_0x2b142a,_0x9a4403){if(_0xadecc9<=0x0||isNaN(_0xadecc9)){return _0x9a4403(msgResponse(_0x048d('0x205'),_0x048d('0x45'),_0x048d('0x206')+_0xadecc9));}if(_0x224687<=0x0||isNaN(_0x224687)){return _0x9a4403(msgResponse('[abandonmentRate]',_0x048d('0x45'),_0x048d('0x207')+_0x224687));}if(_0x4fcdff<=0x0||isNaN(_0x4fcdff)){return _0x9a4403(msgResponse('[abandonmentRate]',_0x048d('0x45'),_0x048d('0x208')+_0x4fcdff));}if(_0x24d529<=0x0||isNaN(_0x24d529)){return _0x9a4403(msgResponse(_0x048d('0x205'),_0x048d('0x45'),_0x048d('0x209')+_0x24d529));}if(_0x5780b7<=0x0||isNaN(_0x5780b7)){return _0x9a4403(msgResponse(_0x048d('0x205'),'Error',_0x048d('0x20a')+_0x5780b7));}_0xcad21d=_0xcad21d||0x0;var _0x5cc5f5=0x1/_0x224687;var _0x37b5a5=0x0;var _0x88aa77=0x0;var _0x1fb756=0x0;var _0x418edc=0x0;for(var _0x1d1363=0x0;_0x1fb756<_0x5780b7;_0x1d1363+=0x1){_0x88aa77=_0x1d1363/_0x24d529;_0x37b5a5=(_0x4fcdff*_0x88aa77+_0xcad21d)/_0x5cc5f5;_0x1fb756=erlangb(_0x37b5a5,_0xadecc9);_0x418edc=_0x37b5a5/_0xadecc9*(0x1-erlangb(_0x37b5a5,_0xadecc9));}return _0x2b142a({'erlangCalls':_0x1d1363,'erlangCallToSecond':_0x24d529/_0x1d1363,'erlangAbandonmentRate':_0x1fb756,'erlangBusyFactor':_0x418edc});});};Dialer[_0x048d('0x1c')][_0x048d('0x1dc')]=function(_0x50c39a,_0x5f037b,_0x221e55,_0xedc591,_0x18bcfd,_0x44e6f0){loggerPredictive[_0x048d('0x79')](_0x048d('0x20b'));loggerPredictive[_0x048d('0x79')](_0x048d('0x20c'),_0x50c39a);loggerPredictive['info'](_0x048d('0x20d'),_0x5f037b);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x221e55);loggerPredictive[_0x048d('0x79')](_0x048d('0x203'),_0xedc591);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18bcfd);loggerPredictive[_0x048d('0x79')](_0x048d('0x87'));return new BPromise(function(_0x374172,_0x121235){if(_0x50c39a<=0x0||isNaN(_0x50c39a)){return _0x121235(msgResponse(_0x048d('0x20e'),_0x048d('0x45'),_0x048d('0x206')+_0x50c39a));}if(_0x221e55<=0x0||isNaN(_0x221e55)){return _0x121235(msgResponse(_0x048d('0x20e'),_0x048d('0x45'),_0x048d('0x207')+_0x221e55));}if(_0xedc591<=0x0||isNaN(_0xedc591)){return _0x121235(msgResponse(_0x048d('0x20e'),_0x048d('0x45'),_0x048d('0x208')+_0xedc591));}if(_0x5f037b<=0x0||isNaN(_0x5f037b)){return _0x121235(msgResponse('[busyFactor]',_0x048d('0x45'),_0x048d('0x209')+_0x5f037b));}if(_0x18bcfd<=0x0||isNaN(_0x18bcfd)){return _0x121235(msgResponse(_0x048d('0x20e'),'Error',_0x048d('0x20f')+_0x18bcfd));}_0x44e6f0=_0x44e6f0||0x0;var _0x4c9251=0x1/_0x221e55;var _0x31213=0x0;var _0x2c4ec5=0x0;var _0x3ab013=0x0;var _0x1c5ba=0x0;for(var _0x13318f=0x0;_0x1c5ba<_0x18bcfd;_0x13318f+=0x1){_0x2c4ec5=_0x13318f/_0x5f037b;_0x31213=(_0xedc591*_0x2c4ec5+_0x44e6f0)/_0x4c9251;_0x3ab013=erlangb(_0x31213,_0x50c39a);_0x1c5ba=_0x31213/_0x50c39a*(0x1-erlangb(_0x31213,_0x50c39a));}return _0x374172({'erlangCalls':_0x13318f,'erlangCallToSecond':_0x5f037b/_0x13318f,'erlangAbandonmentRate':_0x3ab013,'erlangBusyFactor':_0x1c5ba});});};module[_0x048d('0x210')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 846c1da..ef6c485 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 _0xe2e4=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','seconds','scheduledat','campaigntype','outbound','type','countbusyretry','countcongestionretry'];(function(_0x3db9d6,_0x4f5425){var _0x1284b8=function(_0x1b2204){while(--_0x1b2204){_0x3db9d6['push'](_0x3db9d6['shift']());}};_0x1284b8(++_0x4f5425);}(_0xe2e4,0x1ce));var _0x4e2e=function(_0x5e0e4c,_0x152934){_0x5e0e4c=_0x5e0e4c-0x0;var _0x45a3a1=_0xe2e4[_0x5e0e4c];return _0x45a3a1;};'use strict';var util=require(_0x4e2e('0x0'));var _=require(_0x4e2e('0x1'));var moment=require('moment');function getSeconds(_0x27db51,_0x14bf60){var _0x267fbc=moment(_0x27db51)[_0x4e2e('0x2')](0x0);var _0x67b743=moment(_0x14bf60)[_0x4e2e('0x2')](0x0);return _0x267fbc[_0x4e2e('0x3')](_0x67b743,_0x4e2e('0x4'));}function QueueCallerAbandon(_0x1fe79f,_0x8cca3a){this[_0x4e2e('0x5')]=_0x1fe79f['scheduledat'];this['type']=_0x1fe79f['type'];this[_0x4e2e('0x6')]=_0x1fe79f['type']===_0x4e2e('0x7')?'queue':_0x1fe79f[_0x4e2e('0x8')];this[_0x4e2e('0x9')]=_0x1fe79f[_0x4e2e('0x9')];this['countcongestionretry']=_0x1fe79f[_0x4e2e('0xa')];this[_0x4e2e('0xb')]=_0x1fe79f[_0x4e2e('0xb')];this[_0x4e2e('0xc')]=_0x1fe79f['countbusyretry']+_0x1fe79f['countcongestionretry']+_0x1fe79f[_0x4e2e('0xb')]+_0x1fe79f[_0x4e2e('0xd')]+_0x1fe79f[_0x4e2e('0xe')]+_0x1fe79f[_0x4e2e('0xf')]+_0x1fe79f[_0x4e2e('0x10')]+_0x1fe79f['countagentrejectretry'];this[_0x4e2e('0xd')]=_0x1fe79f[_0x4e2e('0xd')];this[_0x4e2e('0xe')]=_0x1fe79f[_0x4e2e('0xe')];this['countabandonedretry']=_0x1fe79f[_0x4e2e('0xf')];this[_0x4e2e('0x10')]=_0x1fe79f[_0x4e2e('0x10')];this['countagentrejectretry']=_0x1fe79f[_0x4e2e('0x11')];this['uniqueid']=_0x8cca3a[_0x4e2e('0x12')];this[_0x4e2e('0x13')]=_0x1fe79f[_0x4e2e('0x14')];this[_0x4e2e('0x15')]=_0x1fe79f['number'];this['starttime']=_0x1fe79f[_0x4e2e('0x16')];this[_0x4e2e('0x17')]=_0x1fe79f[_0x4e2e('0x17')];this[_0x4e2e('0x18')]=_0x1fe79f[_0x4e2e('0x18')];this[_0x4e2e('0x19')]=this[_0x4e2e('0x18')];this[_0x4e2e('0x1a')]=getSeconds(_0x1fe79f[_0x4e2e('0x17')],_0x1fe79f[_0x4e2e('0x16')]);this[_0x4e2e('0x1b')]=getSeconds(this[_0x4e2e('0x18')],_0x1fe79f['responsetime']);this[_0x4e2e('0x1c')]=0x0;this['queue']=_0x8cca3a[_0x4e2e('0x1d')];this[_0x4e2e('0x1e')]=_0x8cca3a[_0x4e2e('0x1f')];this[_0x4e2e('0x20')]=_0x8cca3a[_0x4e2e('0x20')];this[_0x4e2e('0x21')]=_0x1fe79f[_0x4e2e('0x21')];this['callbackuniqueid']=_0x1fe79f[_0x4e2e('0x22')];this['callbackat']=_0x1fe79f['callbackat'];this[_0x4e2e('0x23')]=_0x1fe79f[_0x4e2e('0x23')];this['ContactId']=_0x1fe79f[_0x4e2e('0x24')];this[_0x4e2e('0x25')]=_0x1fe79f[_0x4e2e('0x25')];this[_0x4e2e('0x26')]=_0x1fe79f[_0x4e2e('0x26')];this[_0x4e2e('0x27')]=_0x1fe79f[_0x4e2e('0x27')];this[_0x4e2e('0x28')]=_0x1fe79f[_0x4e2e('0x28')];this[_0x4e2e('0x29')]=_0x1fe79f[_0x4e2e('0x29')]||'';this['originatecalleridname']=_0x1fe79f['originatecalleridname']||'';}module[_0x4e2e('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x4ece=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridnum','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat'];(function(_0x216b9b,_0x1bf025){var _0x51ba89=function(_0x5bab61){while(--_0x5bab61){_0x216b9b['push'](_0x216b9b['shift']());}};_0x51ba89(++_0x1bf025);}(_0x4ece,0x1b5));var _0xe4ec=function(_0x30963a,_0x345655){_0x30963a=_0x30963a-0x0;var _0x14220e=_0x4ece[_0x30963a];return _0x14220e;};'use strict';var util=require(_0xe4ec('0x0'));var _=require(_0xe4ec('0x1'));var moment=require(_0xe4ec('0x2'));function getSeconds(_0x53aabd,_0x251c69){var _0x1fe27e=moment(_0x53aabd)[_0xe4ec('0x3')](0x0);var _0xce7710=moment(_0x251c69)[_0xe4ec('0x3')](0x0);return _0x1fe27e['diff'](_0xce7710,_0xe4ec('0x4'));}function QueueCallerAbandon(_0x212e63,_0x5b8ad1){this[_0xe4ec('0x5')]=_0x212e63[_0xe4ec('0x5')];this[_0xe4ec('0x6')]=_0x212e63['type'];this[_0xe4ec('0x7')]=_0x212e63[_0xe4ec('0x6')]===_0xe4ec('0x8')?'queue':_0x212e63[_0xe4ec('0x6')];this[_0xe4ec('0x9')]=_0x212e63[_0xe4ec('0x9')];this['countcongestionretry']=_0x212e63[_0xe4ec('0xa')];this['countnoanswerretry']=_0x212e63['countnoanswerretry'];this['countglobal']=_0x212e63[_0xe4ec('0x9')]+_0x212e63[_0xe4ec('0xa')]+_0x212e63[_0xe4ec('0xb')]+_0x212e63['countnosuchnumberretry']+_0x212e63[_0xe4ec('0xc')]+_0x212e63[_0xe4ec('0xd')]+_0x212e63['countmachineretry']+_0x212e63[_0xe4ec('0xe')];this['countnosuchnumberretry']=_0x212e63[_0xe4ec('0xf')];this[_0xe4ec('0xc')]=_0x212e63[_0xe4ec('0xc')];this[_0xe4ec('0xd')]=_0x212e63[_0xe4ec('0xd')];this['countmachineretry']=_0x212e63['countmachineretry'];this[_0xe4ec('0xe')]=_0x212e63['countagentrejectretry'];this[_0xe4ec('0x10')]=_0x5b8ad1[_0xe4ec('0x10')];this['calleridname']=_0x212e63['name'];this[_0xe4ec('0x11')]=_0x212e63['number'];this[_0xe4ec('0x12')]=_0x212e63['starttime'];this['responsetime']=_0x212e63[_0xe4ec('0x13')];this['droptime']=_0x212e63[_0xe4ec('0x14')];this[_0xe4ec('0x15')]=this[_0xe4ec('0x14')];this[_0xe4ec('0x16')]=getSeconds(_0x212e63[_0xe4ec('0x13')],_0x212e63[_0xe4ec('0x12')]);this['holdtime']=getSeconds(this[_0xe4ec('0x14')],_0x212e63[_0xe4ec('0x13')]);this[_0xe4ec('0x17')]=0x0;this[_0xe4ec('0x18')]=_0x5b8ad1[_0xe4ec('0x18')];this[_0xe4ec('0x19')]=_0x5b8ad1[_0xe4ec('0x1a')];this[_0xe4ec('0x1b')]=_0x5b8ad1[_0xe4ec('0x1b')];this[_0xe4ec('0x1c')]=_0x212e63[_0xe4ec('0x1c')];this[_0xe4ec('0x1d')]=_0x212e63[_0xe4ec('0x1d')];this[_0xe4ec('0x1e')]=_0x212e63[_0xe4ec('0x1e')];this[_0xe4ec('0x1f')]=_0x212e63[_0xe4ec('0x1f')];this[_0xe4ec('0x20')]=_0x212e63[_0xe4ec('0x20')];this[_0xe4ec('0x21')]=_0x212e63[_0xe4ec('0x21')];this[_0xe4ec('0x22')]=_0x212e63[_0xe4ec('0x22')];this[_0xe4ec('0x23')]=_0x212e63[_0xe4ec('0x23')];this['CampaignId']=_0x212e63[_0xe4ec('0x24')];this['originatecalleridnum']=_0x212e63['originatecalleridnum']||'';this[_0xe4ec('0x25')]=_0x212e63['originatecalleridname']||'';}module[_0xe4ec('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ee859dd..b2571d8 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(_0x1f4993,_0x3cf7ab){var _0x5176f6=function(_0x19f641){while(--_0x19f641){_0x1f4993['push'](_0x1f4993['shift']());}};_0x5176f6(++_0x3cf7ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x2743b9,_0x372ea8){var _0x3244fe=function(_0xf88c44){while(--_0xf88c44){_0x2743b9['push'](_0x2743b9['shift']());}};_0x3244fe(++_0x372ea8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 4cb9ce0..62b445e 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 _0x4855=['unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','name','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x353ce4,_0x259b63){var _0x2f10ec=function(_0x6750bf){while(--_0x6750bf){_0x353ce4['push'](_0x353ce4['shift']());}};_0x2f10ec(++_0x259b63);}(_0x4855,0x7b));var _0x5485=function(_0x23a766,_0x2eab2c){_0x23a766=_0x23a766-0x0;var _0x439cd4=_0x4855[_0x23a766];return _0x439cd4;};'use strict';var util=require(_0x5485('0x0'));var _=require(_0x5485('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5485('0x2'));var moment=require(_0x5485('0x3'));var path=require(_0x5485('0x4'));var tiff2pdf=require(_0x5485('0x5'));var gs=require(_0x5485('0x6'));var logger=require(_0x5485('0x7'))(_0x5485('0x8'));var ami=require(_0x5485('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x5485('0xa'));var ut=require(_0x5485('0xb'));var Action=require(_0x5485('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x333006){this[_0x5485('0xd')]={};this[_0x5485('0xe')]=_0x333006['faxAccounts'];this[_0x5485('0xf')]=_0x333006['trunks'];this['actions']={};ami['on'](_0x5485('0x10'),this[_0x5485('0x11')][_0x5485('0x12')](this));ami['on'](_0x5485('0x13'),this[_0x5485('0x14')]['bind'](this));ami['on']('newstate',this[_0x5485('0x15')][_0x5485('0x12')](this));ami['on'](_0x5485('0x16'),this['syncNewExten'][_0x5485('0x12')](this));ami['on'](_0x5485('0x17'),this[_0x5485('0x18')][_0x5485('0x12')](this));ami['on'](_0x5485('0x19'),this[_0x5485('0x1a')]['bind'](this));ami['on'](_0x5485('0x1b'),this['syncHangup'][_0x5485('0x12')](this));ami['on'](_0x5485('0x1c'),this[_0x5485('0x1d')][_0x5485('0x12')](this));}Fax[_0x5485('0x1e')][_0x5485('0x11')]=function(_0xab0c9b){if(_0xab0c9b[_0x5485('0x1f')]===_0x5485('0x20')){for(var _0xa74dd4 in this[_0x5485('0xe')]){if(this[_0x5485('0xe')][_0x5485('0x21')](_0xa74dd4)){if(_0xab0c9b[_0x5485('0x22')]===this[_0x5485('0xe')][_0xa74dd4]['localstationid']){this['channels'][_0xab0c9b[_0x5485('0x23')]]={};this['channels'][_0xab0c9b[_0x5485('0x23')]][_0x5485('0x24')]=_0xab0c9b[_0x5485('0x24')];this[_0x5485('0xd')][_0xab0c9b[_0x5485('0x23')]]['id']=this[_0x5485('0xe')][_0xa74dd4]['id'];this['channels'][_0xab0c9b[_0x5485('0x23')]]['name']=this['faxAccounts'][_0xa74dd4]['name'];logger[_0x5485('0x25')](_0xab0c9b[_0x5485('0x23')],_0x5485('0x26'));}}}}if(this[_0x5485('0x27')][_0xab0c9b[_0x5485('0x23')]]){this[_0x5485('0xd')][_0xab0c9b['uniqueid']]={};this['channels'][_0xab0c9b[_0x5485('0x23')]][_0x5485('0x24')]=_0xab0c9b[_0x5485('0x24')];logger[_0x5485('0x25')](_0xab0c9b[_0x5485('0x23')],_0x5485('0x26'));}};Fax[_0x5485('0x1e')]['syncVarSet']=function(_0x280f25){if(this[_0x5485('0xd')][_0x280f25[_0x5485('0x23')]]){for(var _0x31758f in _0x280f25[_0x5485('0x28')]){if(_0x280f25[_0x5485('0x28')][_0x5485('0x21')](_0x31758f)){this[_0x5485('0xd')][_0x280f25[_0x5485('0x23')]][_0x31758f]=_0x280f25[_0x5485('0x29')];}}}};Fax[_0x5485('0x1e')]['syncNewState']=function(_0x3570e5){if(this[_0x5485('0xd')][_0x3570e5['uniqueid']]){this[_0x5485('0xd')][_0x3570e5['uniqueid']][_0x5485('0x2a')]=_0x3570e5[_0x5485('0x2a')];this[_0x5485('0xd')][_0x3570e5[_0x5485('0x23')]][_0x5485('0x2b')]=_0x3570e5[_0x5485('0x2b')];}};Fax[_0x5485('0x1e')]['syncNewExten']=function(_0xa3e05d){if(this[_0x5485('0xd')][_0xa3e05d[_0x5485('0x23')]]){for(var _0x2c4dda in _0xa3e05d[_0x5485('0x28')]){if(_0xa3e05d['variable'][_0x5485('0x21')](_0x2c4dda)){this[_0x5485('0xd')][_0xa3e05d['uniqueid']][_0x2c4dda]=_0xa3e05d[_0x5485('0x29')];}}}};Fax[_0x5485('0x1e')][_0x5485('0x18')]=function(_0x3a9b00){if(this[_0x5485('0xd')][_0x3a9b00[_0x5485('0x23')]]){this[_0x5485('0xd')][_0x3a9b00[_0x5485('0x23')]][_0x5485('0x2c')]=_0x3a9b00[_0x5485('0x2c')];this['channels'][_0x3a9b00[_0x5485('0x23')]][_0x5485('0x2d')]=_0x3a9b00[_0x5485('0x2d')];this[_0x5485('0xd')][_0x3a9b00['uniqueid']][_0x5485('0x2e')]=_0x3a9b00['localstationid'];this[_0x5485('0xd')][_0x3a9b00['uniqueid']][_0x5485('0x2f')]=_0x3a9b00[_0x5485('0x2f')];logger[_0x5485('0x25')](_0x3a9b00[_0x5485('0x23')],_0x5485('0x30'));}};Fax[_0x5485('0x1e')][_0x5485('0x1a')]=function(_0x5a8492){var _0x401260=this;if(this[_0x5485('0xd')][_0x5a8492[_0x5485('0x23')]]){var _0x2dad4d=this[_0x5485('0xd')][_0x5a8492[_0x5485('0x23')]]['id'];this[_0x5485('0xd')][_0x5a8492['uniqueid']]['remotestationid']=_0x5a8492[_0x5485('0x31')];this[_0x5485('0xd')][_0x5a8492['uniqueid']][_0x5485('0x32')]=_0x5a8492[_0x5485('0x32')];this[_0x5485('0xd')][_0x5a8492['uniqueid']]['localstationid']=_0x5a8492[_0x5485('0x2e')];this['channels'][_0x5a8492[_0x5485('0x23')]][_0x5485('0x33')]=_0x5a8492[_0x5485('0x33')];this[_0x5485('0xd')][_0x5a8492[_0x5485('0x23')]]['transferrate']=_0x5a8492[_0x5485('0x34')];this[_0x5485('0xd')][_0x5a8492[_0x5485('0x23')]][_0x5485('0x2f')]=_0x5a8492[_0x5485('0x2f')];this[_0x5485('0xd')][_0x5a8492['uniqueid']][_0x5485('0x35')]=_0x5a8492['calleridnum'];if(this[_0x5485('0xd')][_0x5a8492[_0x5485('0x23')]][_0x5485('0x32')]>0x0){tiff2pdf(_0x5a8492[_0x5485('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x1266bf){logger['info'](_0x5a8492[_0x5485('0x23')],_0x5485('0x36'),_0x1266bf['message']);attachment[_0x5485('0x37')]({'name':path[_0x5485('0x38')](_0x5a8492['filename'])[_0x5485('0x39')],'basename':path[_0x5485('0x38')](_0x5a8492[_0x5485('0x2f')])['name']+_0x5485('0x3a'),'type':_0x5485('0x3b')})['then'](function(_0x18adf4){faxAccount[_0x5485('0x3c')](_0x2dad4d,{'from':_0x5a8492[_0x5485('0x35')],'mapKey':_0x5485('0x8'),'body':path['parse'](_0x5a8492[_0x5485('0x2f')])[_0x5485('0x39')]+_0x5485('0x3a'),'AttachmentId':_0x18adf4['id']})[_0x5485('0x3d')](function(_0x52d526){logger[_0x5485('0x3e')](_0x5a8492['uniqueid'],_0x5485('0x3f'),JSON[_0x5485('0x40')](_0x52d526));});})[_0x5485('0x3d')](function(_0x701391){logger[_0x5485('0x3e')](_0x5a8492[_0x5485('0x23')],_0x5485('0x41'),JSON[_0x5485('0x40')](_0x701391));});});}logger[_0x5485('0x25')](_0x5a8492[_0x5485('0x23')],'\x20receiveFax\x20');}};Fax[_0x5485('0x1e')][_0x5485('0x1d')]=function(_0x33a754){if(this[_0x5485('0x27')][_0x33a754[_0x5485('0x23')]]){_['merge'](this[_0x5485('0xd')][_0x33a754['uniqueid']],_['pick'](_0x33a754,[_0x5485('0x42'),_0x5485('0x43')]));}};function updateStatus(_0x1c3a17){if(_0x1c3a17['AttachmentId']){faxMessage['update'](_0x1c3a17[_0x5485('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x5485('0x45')](function(_0x4bd97a){ut[_0x5485('0x46')]('[Fax][Message][Error][Updated]',_0x4bd97a);})['catch'](function(_0x17c3c5){ut[_0x5485('0x46')](_0x5485('0x47'),_0x17c3c5);});}else{ut['logger'](_0x5485('0x48'));}}Fax[_0x5485('0x1e')][_0x5485('0x49')]=function(_0x2b7ab7,_0x28a66c,_0x416cb1){var _0x3c429d=this;var _0x57cb2e={};if(_0x28a66c){_0x57cb2e={'read':_0x28a66c};}else{_0x57cb2e={'failMessage':_0x416cb1};}if(this[_0x5485('0x27')][_0x2b7ab7]['AttachmentId']){faxMessage[_0x5485('0x4a')](this['actions'][_0x2b7ab7]['AttachmentId'],_0x57cb2e)[_0x5485('0x45')](function(_0x3a5460){ut[_0x5485('0x46')](_0x5485('0x4b'),_0x3a5460);})[_0x5485('0x3d')](function(_0x81aeb1){ut[_0x5485('0x46')]('[Fax][Message][NoUpdate1]',_0x81aeb1);})[_0x5485('0x4c')](function(){delete _0x3c429d['channels'][_0x2b7ab7];delete _0x3c429d['actions'][_0x2b7ab7];});}else{ut[_0x5485('0x46')]('[Fax][Message][NoUpdate2]');delete this[_0x5485('0xd')][_0x2b7ab7];delete this[_0x5485('0x27')][_0x2b7ab7];}};Fax[_0x5485('0x1e')][_0x5485('0x4d')]=function(_0x504b9f){var _0x54b3bb=this;if(this[_0x5485('0xd')][_0x504b9f[_0x5485('0x23')]]){if(this[_0x5485('0x27')][_0x504b9f[_0x5485('0x23')]]){this[_0x5485('0xd')][_0x504b9f[_0x5485('0x23')]]['id']=this['actions'][_0x504b9f[_0x5485('0x23')]]['id'];this['channels'][_0x504b9f[_0x5485('0x23')]][_0x5485('0x39')]=this[_0x5485('0x27')][_0x504b9f['uniqueid']][_0x5485('0x39')];}logger[_0x5485('0x25')](_0x504b9f[_0x5485('0x23')],this['actions'][_0x504b9f[_0x5485('0x23')]]?_0x5485('0x4e'):_0x5485('0x4f'),JSON[_0x5485('0x40')](this[_0x5485('0xd')][_0x504b9f['uniqueid']]));if(this[_0x5485('0x27')][_0x504b9f[_0x5485('0x23')]]){if(this['channels'][_0x504b9f[_0x5485('0x23')]][_0x5485('0x50')]>0x0&&this[_0x5485('0xd')][_0x504b9f[_0x5485('0x23')]][_0x5485('0x17')]===_0x5485('0x51')){this[_0x5485('0x49')](_0x504b9f[_0x5485('0x23')],!![]);}else{this[_0x5485('0x49')](_0x504b9f[_0x5485('0x23')],![],this[_0x5485('0xd')][_0x504b9f['uniqueid']]['faxstatusstring']?_0x5485('0x52')+this[_0x5485('0xd')][_0x504b9f[_0x5485('0x23')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x5485('0x1e')][_0x5485('0x53')]=function(_0xc7adfb){var _0x5f1b0f=this;return new BPromise(function(_0x336495,_0x4e3f42){_0x5f1b0f[_0x5485('0x54')](_0xc7adfb,_0x5f1b0f[_0x5485('0xe')][_0xc7adfb[_0x5485('0x55')]])[_0x5485('0x45')](function(_0xc0d6){ut['logger'](_0x5485('0x56'),_0xc0d6);_0x336495(ut[_0x5485('0x57')]('Fax\x20received'));})[_0x5485('0x3d')](function(_0x2764cd){ut[_0x5485('0x46')](_0x5485('0x58'),_0x2764cd);updateStatus(_0xc7adfb);_0x4e3f42(ut[_0x5485('0x57')]('Fax\x20failed'));});});};Fax[_0x5485('0x1e')][_0x5485('0x59')]=function(_0x49600b){var _0x2dca0b=this;return new BPromise(function(_0x4dcf4e,_0x119ef8){var _0x5addb9=_0x2dca0b[_0x5485('0x5a')](_0x2dca0b[_0x5485('0xe')][_0x49600b[_0x5485('0x55')]][_0x5485('0x5b')],_0x49600b);if(_0x5addb9['isValid']){_0x4dcf4e(ut[_0x5485('0x57')](_0x5485('0x5c')));}else{_0x119ef8(ut['message'](_0x5addb9[_0x5485('0x57')]));}});};function originate(_0x42edf2,_0x4c02e2,_0x44c930){return new BPromise(function(_0x3abdfe,_0x3f58c9){if(_0x44c930){var _0x27ea8e=util[_0x5485('0x5d')](_0x5485('0x5e'),path[_0x5485('0x38')](_0x42edf2[_0x5485('0x4')])[_0x5485('0x39')],_0x42edf2['path']);gs['execute'](_0x27ea8e)[_0x5485('0x45')](function(){_0x42edf2['path']=util[_0x5485('0x5d')](_0x5485('0x5f'),path[_0x5485('0x38')](_0x42edf2[_0x5485('0x4')])[_0x5485('0x60')],path[_0x5485('0x38')](_0x42edf2[_0x5485('0x4')])['name']);_0x4c02e2[_0x5485('0x61')]=_0x42edf2['path'];ut[_0x5485('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0x5485('0x62')](ut[_0x5485('0x63')](_0x42edf2,_0x4c02e2))[_0x5485('0x45')](function(_0x5e704b){_0x3abdfe(_0x5e704b);})[_0x5485('0x3d')](function(_0x1e551f){_0x3f58c9(_0x1e551f);});})['catch'](function(_0x2d1679){_0x3f58c9(_0x2d1679);});}else{ami[_0x5485('0x62')](ut[_0x5485('0x63')](_0x42edf2,_0x4c02e2))['then'](function(_0x4c07f6){_0x3abdfe(_0x4c07f6);})[_0x5485('0x3d')](function(_0x305713){_0x3f58c9(_0x305713);});}});}Fax[_0x5485('0x1e')][_0x5485('0x54')]=function(_0x5ac825,_0x4a3be1){var _0x40223b=this;return new BPromise(function(_0x558684,_0x1aaa74){var _0x4c7d72=uuid['v4']();var _0x45fe49=ut[_0x5485('0x64')](_0x5ac825,_0x4a3be1);_0x40223b['actions'][_0x4c7d72]=new Action(_0x4c7d72,_0x4a3be1,_0x5ac825);var _0x54ce8d=_0x40223b[_0x5485('0x27')][_0x4c7d72];if(path[_0x5485('0x38')](_0x5ac825[_0x5485('0x4')])[_0x5485('0x65')]===_0x5485('0x3a')){originate(_0x54ce8d,_0x45fe49,!![])['then'](function(_0xf4026d){_0x558684(_0xf4026d);})[_0x5485('0x3d')](function(_0x3ffed8){_0x1aaa74(_0x3ffed8);});}else{originate(_0x54ce8d,_0x45fe49,![])[_0x5485('0x45')](function(_0x3d4401){_0x558684(_0x3d4401);})[_0x5485('0x3d')](function(_0x108643){_0x1aaa74(_0x108643);});}});};Fax[_0x5485('0x1e')][_0x5485('0x66')]=function(_0x15cdf5){return!_[_0x5485('0x67')](_0x15cdf5)&&!_[_0x5485('0x67')](_0x15cdf5[_0x5485('0x39')])&&!_[_0x5485('0x67')](_0x15cdf5['active'])&&_0x15cdf5[_0x5485('0x68')]&&!_[_0x5485('0x67')](this[_0x5485('0xf')][util[_0x5485('0x5d')]('SIP/%s',_0x15cdf5[_0x5485('0x39')])])&&!_[_0x5485('0x67')](this['trunks'][util[_0x5485('0x5d')](_0x5485('0x69'),_0x15cdf5[_0x5485('0x39')])][_0x5485('0x2d')])&&(this['trunks'][util[_0x5485('0x5d')](_0x5485('0x69'),_0x15cdf5['name'])][_0x5485('0x2d')]===_0x5485('0x6a')||this[_0x5485('0xf')][util[_0x5485('0x5d')](_0x5485('0x69'),_0x15cdf5[_0x5485('0x39')])][_0x5485('0x2d')]===_0x5485('0x6b'));};Fax[_0x5485('0x1e')][_0x5485('0x5a')]=function(_0xb323d2,_0x5b1471){if(!this['isTrunkReachable'](_0xb323d2)){ut[_0x5485('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x5485('0x67')](_0xb323d2)?'':_0xb323d2[_0x5485('0x39')]+_0x5485('0x6c'));return{'isValid':![],'message':_0x5485('0x6d')};}if(_[_0x5485('0x67')](_0x5b1471['fax'])){ut[_0x5485('0x46')](_0x5485('0x6e'),JSON[_0x5485('0x40')](_0x5b1471));return{'isValid':![],'message':_0x5485('0x6f')};}if(_['isNil'](_0x5b1471[_0x5485('0x4')])){ut['logger'](_0x5485('0x70'),JSON[_0x5485('0x40')](_0x5b1471));return{'isValid':![],'message':_0x5485('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x5485('0x72')]=Fax; \ No newline at end of file +var _0x7040=['FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED'];(function(_0x131a3e,_0x166604){var _0x4f0927=function(_0x4fcbd9){while(--_0x4fcbd9){_0x131a3e['push'](_0x131a3e['shift']());}};_0x4f0927(++_0x166604);}(_0x7040,0x109));var _0x0704=function(_0xd93470,_0x15b48f){_0xd93470=_0xd93470-0x0;var _0xc55587=_0x7040[_0xd93470];return _0xc55587;};'use strict';var util=require(_0x0704('0x0'));var _=require(_0x0704('0x1'));var BPromise=require(_0x0704('0x2'));var uuid=require(_0x0704('0x3'));var moment=require(_0x0704('0x4'));var path=require(_0x0704('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x0704('0x6'));var logger=require(_0x0704('0x7'))(_0x0704('0x8'));var ami=require('../ami');var rpcDb=require(_0x0704('0x9'));var Channel=require(_0x0704('0xa'));var ut=require(_0x0704('0xb'));var Action=require(_0x0704('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x0704('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x4f0b4b){this[_0x0704('0xe')]={};this[_0x0704('0xf')]=_0x4f0b4b['faxAccounts'];this[_0x0704('0x10')]=_0x4f0b4b[_0x0704('0x10')];this[_0x0704('0x11')]={};ami['on'](_0x0704('0x12'),this[_0x0704('0x13')]['bind'](this));ami['on'](_0x0704('0x14'),this[_0x0704('0x15')][_0x0704('0x16')](this));ami['on'](_0x0704('0x17'),this[_0x0704('0x18')][_0x0704('0x16')](this));ami['on'](_0x0704('0x19'),this[_0x0704('0x1a')][_0x0704('0x16')](this));ami['on'](_0x0704('0x1b'),this[_0x0704('0x1c')][_0x0704('0x16')](this));ami['on'](_0x0704('0x1d'),this[_0x0704('0x1e')][_0x0704('0x16')](this));ami['on'](_0x0704('0x1f'),this['syncHangup'][_0x0704('0x16')](this));ami['on'](_0x0704('0x20'),this[_0x0704('0x21')]['bind'](this));}Fax[_0x0704('0x22')][_0x0704('0x13')]=function(_0x401ecc){if(_0x401ecc[_0x0704('0x23')]===_0x0704('0x24')){for(var _0x1ac751 in this[_0x0704('0xf')]){if(this[_0x0704('0xf')]['hasOwnProperty'](_0x1ac751)){if(_0x401ecc[_0x0704('0x25')]===this[_0x0704('0xf')][_0x1ac751][_0x0704('0x26')]){this[_0x0704('0xe')][_0x401ecc['uniqueid']]={};this['channels'][_0x401ecc[_0x0704('0x27')]][_0x0704('0x28')]=_0x401ecc[_0x0704('0x28')];this[_0x0704('0xe')][_0x401ecc['uniqueid']]['id']=this[_0x0704('0xf')][_0x1ac751]['id'];this[_0x0704('0xe')][_0x401ecc[_0x0704('0x27')]][_0x0704('0x29')]=this['faxAccounts'][_0x1ac751][_0x0704('0x29')];logger[_0x0704('0x2a')](_0x401ecc[_0x0704('0x27')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x401ecc[_0x0704('0x27')]]){this[_0x0704('0xe')][_0x401ecc['uniqueid']]={};this[_0x0704('0xe')][_0x401ecc[_0x0704('0x27')]]['channel']=_0x401ecc['channel'];logger[_0x0704('0x2a')](_0x401ecc[_0x0704('0x27')],_0x0704('0x2b'));}};Fax[_0x0704('0x22')][_0x0704('0x15')]=function(_0x5931d7){if(this[_0x0704('0xe')][_0x5931d7[_0x0704('0x27')]]){for(var _0x52de63 in _0x5931d7[_0x0704('0x2c')]){if(_0x5931d7[_0x0704('0x2c')][_0x0704('0x2d')](_0x52de63)){this['channels'][_0x5931d7['uniqueid']][_0x52de63]=_0x5931d7[_0x0704('0x2e')];}}}};Fax['prototype'][_0x0704('0x18')]=function(_0x5bba10){if(this['channels'][_0x5bba10[_0x0704('0x27')]]){this['channels'][_0x5bba10[_0x0704('0x27')]]['channelstate']=_0x5bba10[_0x0704('0x2f')];this[_0x0704('0xe')][_0x5bba10['uniqueid']]['channelstatedesc']=_0x5bba10['channelstatedesc'];}};Fax[_0x0704('0x22')]['syncNewExten']=function(_0x44d2f4){if(this[_0x0704('0xe')][_0x44d2f4['uniqueid']]){for(var _0x803a8b in _0x44d2f4[_0x0704('0x2c')]){if(_0x44d2f4[_0x0704('0x2c')][_0x0704('0x2d')](_0x803a8b)){this['channels'][_0x44d2f4['uniqueid']][_0x803a8b]=_0x44d2f4['value'];}}}};Fax['prototype'][_0x0704('0x1c')]=function(_0x23661a){if(this[_0x0704('0xe')][_0x23661a[_0x0704('0x27')]]){this[_0x0704('0xe')][_0x23661a[_0x0704('0x27')]]['operation']=_0x23661a[_0x0704('0x30')];this[_0x0704('0xe')][_0x23661a[_0x0704('0x27')]][_0x0704('0x31')]=_0x23661a['status'];this[_0x0704('0xe')][_0x23661a[_0x0704('0x27')]]['localstationid']=_0x23661a[_0x0704('0x26')];this[_0x0704('0xe')][_0x23661a['uniqueid']]['filename']=_0x23661a[_0x0704('0x32')];logger[_0x0704('0x2a')](_0x23661a[_0x0704('0x27')],_0x0704('0x33'));}};Fax[_0x0704('0x22')][_0x0704('0x1e')]=function(_0x58339e){var _0x5b3f21=this;if(this['channels'][_0x58339e[_0x0704('0x27')]]){var _0x4ac171=this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]]['id'];this[_0x0704('0xe')][_0x58339e['uniqueid']][_0x0704('0x34')]=_0x58339e[_0x0704('0x34')];this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]]['pagestransferred']=_0x58339e['pagestransferred'];this['channels'][_0x58339e[_0x0704('0x27')]][_0x0704('0x26')]=_0x58339e[_0x0704('0x26')];this['channels'][_0x58339e[_0x0704('0x27')]][_0x0704('0x35')]=_0x58339e[_0x0704('0x35')];this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]]['transferrate']=_0x58339e[_0x0704('0x36')];this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]][_0x0704('0x32')]=_0x58339e[_0x0704('0x32')];this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]][_0x0704('0x37')]=_0x58339e[_0x0704('0x37')];if(this[_0x0704('0xe')][_0x58339e[_0x0704('0x27')]][_0x0704('0x38')]>0x0){tiff2pdf(_0x58339e[_0x0704('0x32')],_0x0704('0x39'),function(_0x57eedd){logger['info'](_0x58339e['uniqueid'],_0x0704('0x3a'),_0x57eedd['message']);attachment['create']({'name':path[_0x0704('0x3b')](_0x58339e[_0x0704('0x32')])[_0x0704('0x29')],'basename':path[_0x0704('0x3b')](_0x58339e[_0x0704('0x32')])['name']+'.pdf','type':_0x0704('0x3c')})[_0x0704('0x3d')](function(_0x19b823){faxAccount[_0x0704('0x3e')](_0x4ac171,{'from':_0x58339e[_0x0704('0x37')],'mapKey':_0x0704('0x8'),'body':path[_0x0704('0x3b')](_0x58339e[_0x0704('0x32')])['name']+_0x0704('0x3f'),'AttachmentId':_0x19b823['id']})[_0x0704('0x40')](function(_0x7d9544){logger[_0x0704('0x41')](_0x58339e[_0x0704('0x27')],_0x0704('0x42'),JSON['stringify'](_0x7d9544));});})[_0x0704('0x40')](function(_0x34ce0d){logger[_0x0704('0x41')](_0x58339e[_0x0704('0x27')],_0x0704('0x43'),JSON[_0x0704('0x44')](_0x34ce0d));});});}logger[_0x0704('0x2a')](_0x58339e[_0x0704('0x27')],_0x0704('0x43'));}};Fax['prototype'][_0x0704('0x21')]=function(_0x5267ee){if(this[_0x0704('0x11')][_0x5267ee[_0x0704('0x27')]]){_[_0x0704('0x45')](this['channels'][_0x5267ee[_0x0704('0x27')]],_[_0x0704('0x46')](_0x5267ee,[_0x0704('0x47'),_0x0704('0x48')]));}};function updateStatus(_0x51322b){if(_0x51322b[_0x0704('0x49')]){faxMessage[_0x0704('0x4a')](_0x51322b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0704('0x3d')](function(_0x218d50){ut[_0x0704('0x4b')]('[Fax][Message][Error][Updated]',_0x218d50);})['catch'](function(_0x2a819c){ut['logger'](_0x0704('0x4c'),_0x2a819c);});}else{ut[_0x0704('0x4b')](_0x0704('0x4d'));}}Fax[_0x0704('0x22')][_0x0704('0x4e')]=function(_0x4fcfa7,_0x26749a,_0x214c6c){var _0x2475fd=this;var _0x1025e3={};if(_0x26749a){_0x1025e3={'read':_0x26749a};}else{_0x1025e3={'failMessage':_0x214c6c};}if(this[_0x0704('0x11')][_0x4fcfa7][_0x0704('0x49')]){faxMessage[_0x0704('0x4a')](this[_0x0704('0x11')][_0x4fcfa7][_0x0704('0x49')],_0x1025e3)[_0x0704('0x3d')](function(_0x44c594){ut[_0x0704('0x4b')](_0x0704('0x4f'),_0x44c594);})[_0x0704('0x40')](function(_0x29f656){ut[_0x0704('0x4b')](_0x0704('0x50'),_0x29f656);})[_0x0704('0x51')](function(){delete _0x2475fd[_0x0704('0xe')][_0x4fcfa7];delete _0x2475fd['actions'][_0x4fcfa7];});}else{ut[_0x0704('0x4b')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x4fcfa7];delete this[_0x0704('0x11')][_0x4fcfa7];}};Fax[_0x0704('0x22')][_0x0704('0x52')]=function(_0x3c07bd){var _0x12a5ff=this;if(this[_0x0704('0xe')][_0x3c07bd['uniqueid']]){if(this[_0x0704('0x11')][_0x3c07bd['uniqueid']]){this[_0x0704('0xe')][_0x3c07bd[_0x0704('0x27')]]['id']=this[_0x0704('0x11')][_0x3c07bd[_0x0704('0x27')]]['id'];this[_0x0704('0xe')][_0x3c07bd[_0x0704('0x27')]]['name']=this['actions'][_0x3c07bd[_0x0704('0x27')]][_0x0704('0x29')];}logger['info'](_0x3c07bd[_0x0704('0x27')],this['actions'][_0x3c07bd[_0x0704('0x27')]]?_0x0704('0x53'):_0x0704('0x54'),JSON[_0x0704('0x44')](this['channels'][_0x3c07bd[_0x0704('0x27')]]));if(this[_0x0704('0x11')][_0x3c07bd['uniqueid']]){if(this[_0x0704('0xe')][_0x3c07bd[_0x0704('0x27')]][_0x0704('0x55')]>0x0&&this[_0x0704('0xe')][_0x3c07bd[_0x0704('0x27')]][_0x0704('0x1b')]==='SUCCESS'){this[_0x0704('0x4e')](_0x3c07bd[_0x0704('0x27')],!![]);}else{this[_0x0704('0x4e')](_0x3c07bd[_0x0704('0x27')],![],this['channels'][_0x3c07bd[_0x0704('0x27')]][_0x0704('0x56')]?_0x0704('0x57')+this[_0x0704('0xe')][_0x3c07bd[_0x0704('0x27')]][_0x0704('0x56')]:_0x0704('0x58'));}}}};Fax['prototype']['send']=function(_0x4b9791){var _0x124425=this;return new BPromise(function(_0x3dcf9f,_0x265774){_0x124425['execOriginate'](_0x4b9791,_0x124425[_0x0704('0xf')][_0x4b9791[_0x0704('0x59')]])[_0x0704('0x3d')](function(_0xa8e76b){ut['logger'](_0x0704('0x5a'),_0xa8e76b);_0x3dcf9f(ut['message'](_0x0704('0x5b')));})[_0x0704('0x40')](function(_0x1ac312){ut[_0x0704('0x4b')](_0x0704('0x5c'),_0x1ac312);updateStatus(_0x4b9791);_0x265774(ut[_0x0704('0x5d')](_0x0704('0x5e')));});});};Fax[_0x0704('0x22')]['checkAfterSend']=function(_0x265ea6){var _0x4932c4=this;return new BPromise(function(_0x4674b2,_0x53a551){var _0x1ecbac=_0x4932c4['checkTrunk'](_0x4932c4['faxAccounts'][_0x265ea6[_0x0704('0x59')]][_0x0704('0x5f')],_0x265ea6);if(_0x1ecbac[_0x0704('0x60')]){_0x4674b2(ut[_0x0704('0x5d')](_0x0704('0x61')));}else{_0x53a551(ut[_0x0704('0x5d')](_0x1ecbac['message']));}});};function originate(_0x5c549a,_0x111af0,_0x4f9fd0){return new BPromise(function(_0x31611a,_0x6c9425){if(_0x4f9fd0){var _0x400fdf=util[_0x0704('0x62')](_0x0704('0x63'),path[_0x0704('0x3b')](_0x5c549a[_0x0704('0x5')])['name'],_0x5c549a[_0x0704('0x5')]);gs['execute'](_0x400fdf)[_0x0704('0x3d')](function(){_0x5c549a[_0x0704('0x5')]=util[_0x0704('0x62')]('%s/%s.tif',path[_0x0704('0x3b')](_0x5c549a['path'])[_0x0704('0x64')],path[_0x0704('0x3b')](_0x5c549a[_0x0704('0x5')])['name']);_0x111af0['XMF-PATH']=_0x5c549a[_0x0704('0x5')];ut[_0x0704('0x4b')](_0x0704('0x65'),'');ami['Action'](ut[_0x0704('0x66')](_0x5c549a,_0x111af0))[_0x0704('0x3d')](function(_0x818ec4){_0x31611a(_0x818ec4);})[_0x0704('0x40')](function(_0x33e7b8){_0x6c9425(_0x33e7b8);});})[_0x0704('0x40')](function(_0x1cc39c){_0x6c9425(_0x1cc39c);});}else{ami[_0x0704('0x67')](ut[_0x0704('0x66')](_0x5c549a,_0x111af0))['then'](function(_0x53f17d){_0x31611a(_0x53f17d);})['catch'](function(_0x132a12){_0x6c9425(_0x132a12);});}});}Fax['prototype']['execOriginate']=function(_0x2af1d8,_0x974bd2){var _0x150d4f=this;return new BPromise(function(_0x5648d9,_0x586afb){var _0xbc1c27=uuid['v4']();var _0x38b18d=ut[_0x0704('0x68')](_0x2af1d8,_0x974bd2);_0x150d4f['actions'][_0xbc1c27]=new Action(_0xbc1c27,_0x974bd2,_0x2af1d8);var _0x3192ea=_0x150d4f[_0x0704('0x11')][_0xbc1c27];if(path[_0x0704('0x3b')](_0x2af1d8['path'])[_0x0704('0x69')]===_0x0704('0x3f')){originate(_0x3192ea,_0x38b18d,!![])[_0x0704('0x3d')](function(_0x4d187b){_0x5648d9(_0x4d187b);})['catch'](function(_0x3ea799){_0x586afb(_0x3ea799);});}else{originate(_0x3192ea,_0x38b18d,![])[_0x0704('0x3d')](function(_0xb6f401){_0x5648d9(_0xb6f401);})[_0x0704('0x40')](function(_0x2fa443){_0x586afb(_0x2fa443);});}});};Fax[_0x0704('0x22')][_0x0704('0x6a')]=function(_0x270fcf){return!_[_0x0704('0x6b')](_0x270fcf)&&!_[_0x0704('0x6b')](_0x270fcf[_0x0704('0x29')])&&!_[_0x0704('0x6b')](_0x270fcf['active'])&&_0x270fcf[_0x0704('0x6c')]&&!_['isNil'](this['trunks'][util[_0x0704('0x62')](_0x0704('0x6d'),_0x270fcf[_0x0704('0x29')])])&&!_[_0x0704('0x6b')](this['trunks'][util[_0x0704('0x62')](_0x0704('0x6d'),_0x270fcf[_0x0704('0x29')])]['status'])&&(this[_0x0704('0x10')][util['format']('SIP/%s',_0x270fcf[_0x0704('0x29')])][_0x0704('0x31')]==='reachable'||this['trunks'][util[_0x0704('0x62')]('SIP/%s',_0x270fcf[_0x0704('0x29')])]['status']===_0x0704('0x6e'));};Fax['prototype'][_0x0704('0x6f')]=function(_0x34f5e7,_0x4465c7){if(!this[_0x0704('0x6a')](_0x34f5e7)){ut[_0x0704('0x4b')](_0x0704('0x70'),_['isNil'](_0x34f5e7)?'':_0x34f5e7['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x0704('0x71')};}if(_[_0x0704('0x6b')](_0x4465c7[_0x0704('0x8')])){ut[_0x0704('0x4b')](_0x0704('0x72'),JSON[_0x0704('0x44')](_0x4465c7));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x4465c7[_0x0704('0x5')])){ut[_0x0704('0x4b')](_0x0704('0x73'),JSON['stringify'](_0x4465c7));return{'isValid':![],'message':_0x0704('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0704('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6e5f2b0..c646f22 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 _0x98a7=['inspect','resolve','then','catch','[Notify]\x20','util','bluebird','preview'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x98a7,0x125));var _0x798a=function(_0x27cff8,_0x57d6c5){_0x27cff8=_0x27cff8-0x0;var _0x4121f9=_0x98a7[_0x27cff8];return _0x4121f9;};'use strict';var util=require(_0x798a('0x0'));var BPromise=require(_0x798a('0x1'));var logger=require('../../../config/logger')(_0x798a('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x572d20){return function(_0x4c0d03){logger['error'](_0x572d20,util[_0x798a('0x3')](_0x4c0d03,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5c4160,_0x3ad75f){return BPromise[_0x798a('0x4')]()[_0x798a('0x5')](faxAccount['notify'](_0x5c4160,_0x3ad75f))[_0x798a('0x6')](loggerCatch(_0x798a('0x7')));}; \ No newline at end of file +var _0x7ce8=['lodash','../rpc/faxAccount','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7ce8,0x15d));var _0x87ce=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0x7ce8[_0x2967c1];return _0x103397;};'use strict';var util=require(_0x87ce('0x0'));var BPromise=require(_0x87ce('0x1'));var logger=require('../../../config/logger')(_0x87ce('0x2'));var _=require(_0x87ce('0x3'));var faxAccount=require(_0x87ce('0x4'));function loggerCatch(_0x232984){return function(_0x33656b){logger['error'](_0x232984,util[_0x87ce('0x5')](_0x33656b,{'showHidden':![],'depth':null}));};}exports[_0x87ce('0x6')]=function(_0xecbda3,_0x16cd60){return BPromise[_0x87ce('0x7')]()[_0x87ce('0x8')](faxAccount[_0x87ce('0x6')](_0xecbda3,_0x16cd60))[_0x87ce('0x9')](loggerCatch(_0x87ce('0xa')));}; \ 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 8c8e0d4..cdff7d2 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 _0x9a4f=['fax','bluebird','child_process','exec','execute','info','\x20Error\x20:','util'];(function(_0x94d2f8,_0x5c2540){var _0x40103a=function(_0x273c2d){while(--_0x273c2d){_0x94d2f8['push'](_0x94d2f8['shift']());}};_0x40103a(++_0x5c2540);}(_0x9a4f,0x1ef));var _0xf9a4=function(_0x37b9ad,_0x179adf){_0x37b9ad=_0x37b9ad-0x0;var _0x6264e2=_0x9a4f[_0x37b9ad];return _0x6264e2;};'use strict';var util=require(_0xf9a4('0x0'));var logger=require('../../../../config/logger')(_0xf9a4('0x1'));var BPromise=require(_0xf9a4('0x2'));var exec=require(_0xf9a4('0x3'))[_0xf9a4('0x4')];exports[_0xf9a4('0x5')]=function(_0x21b463){return new BPromise(function(_0x5407ff,_0x5f24de){exec(_0x21b463,function(_0x100a72,_0x3f45f6,_0x509867){logger[_0xf9a4('0x6')]('Exec\x20gs',_0x3f45f6);if(_0x100a72){logger[_0xf9a4('0x6')]('Exec\x20gs',_0xf9a4('0x7'),util['inspect'](_0x100a72,{'showHidden':![],'depth':null}),_0x3f45f6,_0x509867);_0x5f24de(_0x100a72);}_0x5407ff(_0x3f45f6);});});}; \ No newline at end of file +var _0x6e7a=['../../../../config/logger','fax','bluebird','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util'];(function(_0x47d3b5,_0x21f8f2){var _0x1cb2c3=function(_0x1e7f25){while(--_0x1e7f25){_0x47d3b5['push'](_0x47d3b5['shift']());}};_0x1cb2c3(++_0x21f8f2);}(_0x6e7a,0x13f));var _0xa6e7=function(_0x1aecdc,_0x522a27){_0x1aecdc=_0x1aecdc-0x0;var _0xef638b=_0x6e7a[_0x1aecdc];return _0xef638b;};'use strict';var util=require(_0xa6e7('0x0'));var logger=require(_0xa6e7('0x1'))(_0xa6e7('0x2'));var BPromise=require(_0xa6e7('0x3'));var exec=require('child_process')[_0xa6e7('0x4')];exports[_0xa6e7('0x5')]=function(_0x16e02e){return new BPromise(function(_0x2faa91,_0x15e86e){exec(_0x16e02e,function(_0x11cfea,_0x49b7ad,_0x555f9e){logger['info'](_0xa6e7('0x6'),_0x49b7ad);if(_0x11cfea){logger[_0xa6e7('0x7')](_0xa6e7('0x6'),_0xa6e7('0x8'),util[_0xa6e7('0x9')](_0x11cfea,{'showHidden':![],'depth':null}),_0x49b7ad,_0x555f9e);_0x15e86e(_0x11cfea);}_0x2faa91(_0x49b7ad);});});}; \ 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 4733d54..dfff13f 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 _0x2bab=['localstationid','util','lodash','moment','fax','logger','info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','gateway','faxdetect','t38timeout','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2bab,0x188));var _0xb2ba=function(_0x47531a,_0x2be65c){_0x47531a=_0x47531a-0x0;var _0x245e7b=_0x2bab[_0x47531a];return _0x245e7b;};'use strict';var util=require(_0xb2ba('0x0'));var _=require(_0xb2ba('0x1'));var moment=require(_0xb2ba('0x2'));var logger=require('../../../../config/logger')(_0xb2ba('0x3'));exports['message']=function(_0x57f0a6){return{'message':_0x57f0a6};};exports[_0xb2ba('0x4')]=function(_0x7d5044,_0x32679a){logger[_0xb2ba('0x5')](_0x7d5044,util[_0xb2ba('0x6')](_0x32679a,{'showHidden':![],'depth':null}));};exports[_0xb2ba('0x7')]=function(_0x5db3cb,_0x116ad8){var _0x3f5aa6={'XMF-ECM':_0x116ad8[_0xb2ba('0x8')],'XMF-HEADERINFO':_0x116ad8[_0xb2ba('0x9')],'XMF-MINRATE':_0x116ad8['minrate'],'XMF-MAXRATE':_0x116ad8['maxrate'],'XMF-MODEM':util[_0xb2ba('0xa')](_0xb2ba('0xb'),_0x116ad8['modem']),'XMF-GATEWAY':_0x116ad8[_0xb2ba('0xc')],'XMF-FAXDETECT':_0x116ad8[_0xb2ba('0xd')],'XMF-T38TIMEOUT':_0x116ad8[_0xb2ba('0xe')],'XMF-LOCALSTATIONID':_0x116ad8['localstationid'],'XMF-PATH':_0x5db3cb['path']};return _0x3f5aa6;};exports[_0xb2ba('0xf')]=function(_0x2cddb9,_0x19db14){return{'actionid':_0x2cddb9[_0xb2ba('0x10')],'action':_0xb2ba('0x11'),'channel':_0x2cddb9[_0xb2ba('0x12')],'Exten':_0xb2ba('0x13'),'Context':_0xb2ba('0x14'),'Priority':'1','callerid':util['format'](_0xb2ba('0x15'),_0x2cddb9[_0xb2ba('0x9')]?_0x2cddb9['headerinfo']:'',_0x2cddb9[_0xb2ba('0x16')]),'variable':_0x19db14,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2cddb9[_0xb2ba('0x10')]};}; \ No newline at end of file +var _0x60b3=['channel','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid','lodash','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','originate'];(function(_0x38e22d,_0x3e4fdc){var _0x4670a1=function(_0xa0c183){while(--_0xa0c183){_0x38e22d['push'](_0x38e22d['shift']());}};_0x4670a1(++_0x3e4fdc);}(_0x60b3,0xb5));var _0x360b=function(_0x24a7c9,_0x157c78){_0x24a7c9=_0x24a7c9-0x0;var _0x451a81=_0x60b3[_0x24a7c9];return _0x451a81;};'use strict';var util=require('util');var _=require(_0x360b('0x0'));var moment=require(_0x360b('0x1'));var logger=require(_0x360b('0x2'))(_0x360b('0x3'));exports[_0x360b('0x4')]=function(_0x20e3f4){return{'message':_0x20e3f4};};exports[_0x360b('0x5')]=function(_0x17d44d,_0x1745a9){logger['info'](_0x17d44d,util[_0x360b('0x6')](_0x1745a9,{'showHidden':![],'depth':null}));};exports[_0x360b('0x7')]=function(_0x1b284b,_0x14a80e){var _0x4e09d0={'XMF-ECM':_0x14a80e[_0x360b('0x8')],'XMF-HEADERINFO':_0x14a80e[_0x360b('0x9')],'XMF-MINRATE':_0x14a80e[_0x360b('0xa')],'XMF-MAXRATE':_0x14a80e[_0x360b('0xb')],'XMF-MODEM':util[_0x360b('0xc')](_0x360b('0xd'),_0x14a80e['modem']),'XMF-GATEWAY':_0x14a80e[_0x360b('0xe')],'XMF-FAXDETECT':_0x14a80e[_0x360b('0xf')],'XMF-T38TIMEOUT':_0x14a80e['t38timeout'],'XMF-LOCALSTATIONID':_0x14a80e['localstationid'],'XMF-PATH':_0x1b284b['path']};return _0x4e09d0;};exports['variablesAction']=function(_0x5553fa,_0x97b3e){return{'actionid':_0x5553fa['uniqueid'],'action':_0x360b('0x10'),'channel':_0x5553fa[_0x360b('0x11')],'Exten':'xcally-motion-fax','Context':_0x360b('0x12'),'Priority':'1','callerid':util[_0x360b('0xc')](_0x360b('0x13'),_0x5553fa[_0x360b('0x9')]?_0x5553fa[_0x360b('0x9')]:'',_0x5553fa[_0x360b('0x14')]),'variable':_0x97b3e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5553fa[_0x360b('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index fdde2fc..aeeb37b 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 _0x476a=['./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','hour','get','resolve','then','getTrunks','initTrunks','initVoiceQueues','getTriggers','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x476a,0x66));var _0xa476=function(_0x307888,_0x2e8d30){_0x307888=_0x307888-0x0;var _0x3af557=_0x476a[_0x307888];return _0x3af557;};'use strict';var BPromise=require(_0xa476('0x0'));var util=require('util');var moment=require(_0xa476('0x1'));var server=require(_0xa476('0x2'));var Realtime=require(_0xa476('0x3'));var Report=require(_0xa476('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0xa476('0x5'));var Preview=require(_0xa476('0x6'));var Fax=require(_0xa476('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0xa476('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xa476('0x9'));var trunk=require(_0xa476('0xa'));var trigger=require(_0xa476('0xb'));var template=require(_0xa476('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xa476('0xd'));var voiceExtension=require(_0xa476('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xa476('0xf'));var salesforce=require(_0xa476('0x10'));var sugarcrm=require(_0xa476('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xa476('0x12'));var zoho=require(_0xa476('0x13'));var vtiger=require(_0xa476('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xa476('0x15'));var dynamics365=require('./rpc/integrations/dynamics365');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()['get'](_0xa476('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa476('0x17')](_0xa476('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa476('0x18')]()[_0xa476('0x19')](user['getAgents']())[_0xa476('0x19')](realtime['initAgents']())[_0xa476('0x19')](user['getTelephones']())[_0xa476('0x19')](realtime['initTelephones']())[_0xa476('0x19')](trunk[_0xa476('0x1a')]())['then'](realtime[_0xa476('0x1b')]())[_0xa476('0x19')](voiceQueue['getVoiceQueues']())[_0xa476('0x19')](realtime[_0xa476('0x1c')]())[_0xa476('0x19')](trigger[_0xa476('0x1d')]())[_0xa476('0x19')](realtime['initTriggers']())[_0xa476('0x19')](template['getTemplates']())[_0xa476('0x19')](realtime['initTemplates']())[_0xa476('0x19')](zendesk[_0xa476('0x1e')]())[_0xa476('0x19')](realtime['initZendeskAccounts']())[_0xa476('0x19')](salesforce[_0xa476('0x1f')]())['then'](realtime[_0xa476('0x20')]())[_0xa476('0x19')](sugarcrm['getSugarcrmAccounts']())[_0xa476('0x19')](realtime['initSugarcrmAccounts']())[_0xa476('0x19')](freshdesk[_0xa476('0x21')]())['then'](realtime[_0xa476('0x22')]())[_0xa476('0x19')](desk[_0xa476('0x23')]())[_0xa476('0x19')](realtime[_0xa476('0x24')]())[_0xa476('0x19')](zoho[_0xa476('0x25')]())['then'](realtime[_0xa476('0x26')]())[_0xa476('0x19')](vtiger[_0xa476('0x27')]())[_0xa476('0x19')](realtime[_0xa476('0x28')]())[_0xa476('0x19')](freshsales[_0xa476('0x29')]())['then'](realtime[_0xa476('0x2a')]())[_0xa476('0x19')](servicenow[_0xa476('0x2b')]())['then'](realtime[_0xa476('0x2c')]())['then'](dynamics365['getDynamics365Accounts']())[_0xa476('0x19')](realtime['initDynamics365Accounts']())[_0xa476('0x19')](campaign[_0xa476('0x2d')]())[_0xa476('0x19')](realtime['initCampaigns']())[_0xa476('0x19')](voiceExtension[_0xa476('0x2e')]())[_0xa476('0x19')](realtime['initVoiceExtensions']())[_0xa476('0x19')](faxAccount['getFaxAccounts']())[_0xa476('0x19')](realtime[_0xa476('0x2f')]())[_0xa476('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xa476('0x19')](voiceQueueReport[_0xa476('0x30')]())[_0xa476('0x19')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xa476('0x19')](realtime[_0xa476('0x31')]())[_0xa476('0x19')](cmHopperHistory[_0xa476('0x32')]())['then'](realtime[_0xa476('0x33')]())['then'](voiceCallReport[_0xa476('0x34')]())[_0xa476('0x19')](realtime['initVoiceCallReports']())['then'](function(_0x328ca4){})[_0xa476('0x35')](function(_0x55fdf){console[_0xa476('0x36')](_0x55fdf);});}function main(){return server[_0xa476('0x37')](realtime,preview,fax)[_0xa476('0x19')](function(_0x1dae1d){return initRealtime();})['then'](function(){return initParams();})[_0xa476('0x19')](function(){report[_0xa476('0x38')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x25cd7f){console[_0xa476('0x36')](_0x25cd7f);});}main(); \ No newline at end of file +var _0x99e7=['./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./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','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./report','./acw','./trigger'];(function(_0x507b3b,_0x30c190){var _0xe1e48e=function(_0x1865ed){while(--_0x1865ed){_0x507b3b['push'](_0x507b3b['shift']());}};_0xe1e48e(++_0x30c190);}(_0x99e7,0x166));var _0x799e=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x99e7[_0x650e11];return _0x1a9b47;};'use strict';var BPromise=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var moment=require(_0x799e('0x2'));var server=require(_0x799e('0x3'));var Realtime=require('./realtime');var Report=require(_0x799e('0x4'));var Acw=require(_0x799e('0x5'));var Trigger=require(_0x799e('0x6'));var Dialer=require('./dialer');var Preview=require(_0x799e('0x7'));var Fax=require(_0x799e('0x8'));var user=require(_0x799e('0x9'));var voiceQueue=require(_0x799e('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x799e('0xb'));var trunk=require(_0x799e('0xc'));var trigger=require(_0x799e('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x799e('0xe'));var campaign=require(_0x799e('0xf'));var voiceExtension=require(_0x799e('0x10'));var faxAccount=require(_0x799e('0x11'));var zendesk=require(_0x799e('0x12'));var salesforce=require(_0x799e('0x13'));var sugarcrm=require(_0x799e('0x14'));var freshdesk=require(_0x799e('0x15'));var desk=require(_0x799e('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x799e('0x17'));var freshsales=require(_0x799e('0x18'));var servicenow=require(_0x799e('0x19'));var dynamics365=require(_0x799e('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()[_0x799e('0x1b')](_0x799e('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x799e('0x1b')](_0x799e('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x799e('0x1d')]()[_0x799e('0x1e')](user[_0x799e('0x1f')]())[_0x799e('0x1e')](realtime[_0x799e('0x20')]())[_0x799e('0x1e')](user[_0x799e('0x21')]())[_0x799e('0x1e')](realtime[_0x799e('0x22')]())[_0x799e('0x1e')](trunk[_0x799e('0x23')]())['then'](realtime[_0x799e('0x24')]())[_0x799e('0x1e')](voiceQueue[_0x799e('0x25')]())['then'](realtime[_0x799e('0x26')]())[_0x799e('0x1e')](trigger[_0x799e('0x27')]())[_0x799e('0x1e')](realtime[_0x799e('0x28')]())['then'](template[_0x799e('0x29')]())[_0x799e('0x1e')](realtime[_0x799e('0x2a')]())[_0x799e('0x1e')](zendesk[_0x799e('0x2b')]())[_0x799e('0x1e')](realtime[_0x799e('0x2c')]())[_0x799e('0x1e')](salesforce[_0x799e('0x2d')]())[_0x799e('0x1e')](realtime[_0x799e('0x2e')]())[_0x799e('0x1e')](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())[_0x799e('0x1e')](freshdesk[_0x799e('0x2f')]())[_0x799e('0x1e')](realtime['initFreshdeskAccounts']())[_0x799e('0x1e')](desk[_0x799e('0x30')]())[_0x799e('0x1e')](realtime['initDeskAccounts']())[_0x799e('0x1e')](zoho[_0x799e('0x31')]())[_0x799e('0x1e')](realtime[_0x799e('0x32')]())[_0x799e('0x1e')](vtiger[_0x799e('0x33')]())['then'](realtime[_0x799e('0x34')]())[_0x799e('0x1e')](freshsales[_0x799e('0x35')]())[_0x799e('0x1e')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x799e('0x36')]())[_0x799e('0x1e')](realtime[_0x799e('0x37')]())['then'](dynamics365[_0x799e('0x38')]())[_0x799e('0x1e')](realtime[_0x799e('0x39')]())['then'](campaign[_0x799e('0x3a')]())[_0x799e('0x1e')](realtime[_0x799e('0x3b')]())['then'](voiceExtension[_0x799e('0x3c')]())[_0x799e('0x1e')](realtime[_0x799e('0x3d')]())[_0x799e('0x1e')](faxAccount['getFaxAccounts']())['then'](realtime[_0x799e('0x3e')]())[_0x799e('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x799e('0x1d')]()[_0x799e('0x1e')](voiceQueueReport[_0x799e('0x3f')]())[_0x799e('0x1e')](realtime[_0x799e('0x40')]())[_0x799e('0x1e')](cmHopperHistory[_0x799e('0x41')]())[_0x799e('0x1e')](realtime[_0x799e('0x42')]())[_0x799e('0x1e')](cmHopperHistory[_0x799e('0x43')]())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x799e('0x44')]())[_0x799e('0x1e')](realtime[_0x799e('0x45')]())['then'](function(_0x499369){})[_0x799e('0x46')](function(_0x582802){console[_0x799e('0x47')](_0x582802);});}function main(){return server[_0x799e('0x48')](realtime,preview,fax)[_0x799e('0x1e')](function(_0x3cb44f){return initRealtime();})['then'](function(){return initParams();})[_0x799e('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x799e('0x46')](function(_0x52e390){console['log'](_0x52e390);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index d7179b1..274e9c3 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0xae7093,_0x850492){var _0x5774ec=function(_0x8acc8a){while(--_0x8acc8a){_0xae7093['push'](_0xae7093['shift']());}};_0x5774ec(++_0x850492);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xcb91[_0x1bc0ae];return _0x501104;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x20c275,_0x14e9ac){var _0xb2a989=function(_0x35fd9c){while(--_0x35fd9c){_0x20c275['push'](_0x20c275['shift']());}};_0xb2a989(++_0x14e9ac);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 04129a0..de6f4b0 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 _0x5e95=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0x55b494,_0x3c5413){var _0x31ce23=function(_0x335aac){while(--_0x335aac){_0x55b494['push'](_0x55b494['shift']());}};_0x31ce23(++_0x3c5413);}(_0x5e95,0x199));var _0x55e9=function(_0x3e42f0,_0x541ef4){_0x3e42f0=_0x3e42f0-0x0;var _0x2b6d3a=_0x5e95[_0x3e42f0];return _0x2b6d3a;};'use strict';function Campaign(_0x32d7f4){this['id']=_0x32d7f4['id']||0x0;this[_0x55e9('0x0')]=_0x32d7f4['name']||'';this['type']=_0x32d7f4[_0x55e9('0x1')]||_0x55e9('0x2');this[_0x55e9('0x3')]=0x0;this[_0x55e9('0x4')]=0x0;this[_0x55e9('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x55e9('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x55e9('0x7')]=_0x32d7f4['active'];this[_0x55e9('0x8')]=_0x32d7f4['limitCalls'];this['dialTimezone']=_0x32d7f4['dialTimezone']||null;this[_0x55e9('0x9')]=_0x32d7f4[_0x55e9('0x9')]?_0x32d7f4[_0x55e9('0x9')]:null;this['dialOriginateCallerIdName']=_0x32d7f4[_0x55e9('0xa')];this[_0x55e9('0xb')]=_0x32d7f4[_0x55e9('0xb')];this[_0x55e9('0xc')]=_0x32d7f4[_0x55e9('0xc')]||0x1e;this[_0x55e9('0xd')]=_0x32d7f4['dialCongestionMaxRetry'];this[_0x55e9('0xe')]=_0x32d7f4[_0x55e9('0xe')];this[_0x55e9('0xf')]=_0x32d7f4[_0x55e9('0xf')];this[_0x55e9('0x10')]=_0x32d7f4[_0x55e9('0x10')];this[_0x55e9('0x11')]=_0x32d7f4[_0x55e9('0x11')];this[_0x55e9('0x12')]=_0x32d7f4[_0x55e9('0x12')];this[_0x55e9('0x13')]=_0x32d7f4['dialGlobalMaxRetry'];this[_0x55e9('0x14')]=_0x32d7f4[_0x55e9('0x14')]||0x3;this[_0x55e9('0x15')]=_0x32d7f4['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x32d7f4[_0x55e9('0x16')]||0x3;this[_0x55e9('0x17')]=_0x32d7f4[_0x55e9('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x32d7f4[_0x55e9('0x18')]||0x3;this[_0x55e9('0x19')]=_0x32d7f4[_0x55e9('0x19')]||0x96;this[_0x55e9('0x1a')]=_0x32d7f4[_0x55e9('0x1a')]||0x3;this[_0x55e9('0x1b')]=_0x32d7f4[_0x55e9('0x1b')]||0x96;this[_0x55e9('0x1c')]=_0x32d7f4[_0x55e9('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x32d7f4[_0x55e9('0x1d')]||0x96;this[_0x55e9('0x1e')]=_0x32d7f4[_0x55e9('0x1e')]||'DESC';this['dialPrefix']=_0x32d7f4['dialPrefix']||undefined;this[_0x55e9('0x1f')]=_0x32d7f4[_0x55e9('0x1f')]||undefined;this[_0x55e9('0x20')]=_0x32d7f4[_0x55e9('0x20')]||undefined;this[_0x55e9('0x21')]=_0x32d7f4[_0x55e9('0x21')]?_0x32d7f4['TrunkBackup']:undefined;this[_0x55e9('0x22')]=_0x32d7f4[_0x55e9('0x22')]?_0x32d7f4['Trunk']:undefined;this[_0x55e9('0x23')]=_0x32d7f4[_0x55e9('0x23')]?_0x32d7f4[_0x55e9('0x23')]:undefined;this[_0x55e9('0x24')]=_0x32d7f4[_0x55e9('0x24')]?_0x32d7f4[_0x55e9('0x24')]:undefined;this[_0x55e9('0x25')]=_0x32d7f4[_0x55e9('0x24')]?_0x32d7f4[_0x55e9('0x24')][_0x55e9('0x0')]:undefined;this['dialAMDActive']=_0x32d7f4['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x32d7f4[_0x55e9('0x26')];this[_0x55e9('0x27')]=_0x32d7f4[_0x55e9('0x27')];this[_0x55e9('0x28')]=_0x32d7f4['dialAMDAfterGreetingSilence'];this[_0x55e9('0x29')]=_0x32d7f4[_0x55e9('0x29')];this['dialAMDMinWordLength']=_0x32d7f4['dialAMDMinWordLength'];this[_0x55e9('0x2a')]=_0x32d7f4[_0x55e9('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x32d7f4[_0x55e9('0x2b')];this['dialAMDSilenceThreshold']=_0x32d7f4[_0x55e9('0x2c')];this[_0x55e9('0x2d')]=_0x32d7f4[_0x55e9('0x2d')];}module[_0x55e9('0x2e')]=Campaign; \ No newline at end of file +var _0x3520=['temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','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'];(function(_0x54981e,_0x20067d){var _0x446c50=function(_0x504b0d){while(--_0x504b0d){_0x54981e['push'](_0x54981e['shift']());}};_0x446c50(++_0x20067d);}(_0x3520,0xd0));var _0x0352=function(_0x5df07a,_0xb5e010){_0x5df07a=_0x5df07a-0x0;var _0x19cae8=_0x3520[_0x5df07a];return _0x19cae8;};'use strict';function Campaign(_0x7f10f1){this['id']=_0x7f10f1['id']||0x0;this[_0x0352('0x0')]=_0x7f10f1[_0x0352('0x0')]||'';this[_0x0352('0x1')]=_0x7f10f1[_0x0352('0x1')]||_0x0352('0x2');this[_0x0352('0x3')]=0x0;this[_0x0352('0x4')]=0x0;this[_0x0352('0x5')]=0x0;this[_0x0352('0x6')]=0x0;this[_0x0352('0x7')]='';this[_0x0352('0x8')]=!![];this[_0x0352('0x9')]=_0x7f10f1['active'];this[_0x0352('0xa')]=_0x7f10f1[_0x0352('0xa')];this[_0x0352('0xb')]=_0x7f10f1[_0x0352('0xb')]||null;this[_0x0352('0xc')]=_0x7f10f1[_0x0352('0xc')]?_0x7f10f1['dialGlobalInterval']:null;this[_0x0352('0xd')]=_0x7f10f1[_0x0352('0xd')];this[_0x0352('0xe')]=_0x7f10f1[_0x0352('0xe')];this[_0x0352('0xf')]=_0x7f10f1[_0x0352('0xf')]||0x1e;this[_0x0352('0x10')]=_0x7f10f1['dialCongestionMaxRetry'];this[_0x0352('0x11')]=_0x7f10f1[_0x0352('0x11')];this[_0x0352('0x12')]=_0x7f10f1['dialBusyMaxRetry'];this[_0x0352('0x13')]=_0x7f10f1[_0x0352('0x13')];this['dialNoAnswerMaxRetry']=_0x7f10f1[_0x0352('0x14')];this[_0x0352('0x15')]=_0x7f10f1[_0x0352('0x15')];this[_0x0352('0x16')]=_0x7f10f1[_0x0352('0x16')];this[_0x0352('0x17')]=_0x7f10f1[_0x0352('0x17')]||0x3;this[_0x0352('0x18')]=_0x7f10f1['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x7f10f1[_0x0352('0x19')]||0x3;this['dialDropRetryFrequency']=_0x7f10f1['dialDropRetryFrequency']||0x96;this[_0x0352('0x1a')]=_0x7f10f1['dialAbandonedMaxRetry']||0x3;this[_0x0352('0x1b')]=_0x7f10f1[_0x0352('0x1b')]||0x96;this[_0x0352('0x1c')]=_0x7f10f1[_0x0352('0x1c')]||0x3;this[_0x0352('0x1d')]=_0x7f10f1[_0x0352('0x1d')]||0x96;this[_0x0352('0x1e')]=_0x7f10f1['dialAgentRejectMaxRetry']||0x3;this[_0x0352('0x1f')]=_0x7f10f1[_0x0352('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x7f10f1[_0x0352('0x20')]||_0x0352('0x21');this[_0x0352('0x22')]=_0x7f10f1['dialPrefix']||undefined;this[_0x0352('0x23')]=_0x7f10f1[_0x0352('0x23')]||undefined;this[_0x0352('0x24')]=_0x7f10f1[_0x0352('0x24')]||undefined;this[_0x0352('0x25')]=_0x7f10f1[_0x0352('0x25')]?_0x7f10f1['TrunkBackup']:undefined;this[_0x0352('0x26')]=_0x7f10f1[_0x0352('0x26')]?_0x7f10f1[_0x0352('0x26')]:undefined;this[_0x0352('0x27')]=_0x7f10f1[_0x0352('0x27')]?_0x7f10f1[_0x0352('0x27')]:undefined;this['SquareProject']=_0x7f10f1[_0x0352('0x28')]?_0x7f10f1[_0x0352('0x28')]:undefined;this[_0x0352('0x29')]=_0x7f10f1[_0x0352('0x28')]?_0x7f10f1['SquareProject'][_0x0352('0x0')]:undefined;this[_0x0352('0x2a')]=_0x7f10f1[_0x0352('0x2a')]||![];this[_0x0352('0x2b')]=_0x7f10f1[_0x0352('0x2b')];this[_0x0352('0x2c')]=_0x7f10f1[_0x0352('0x2c')];this[_0x0352('0x2d')]=_0x7f10f1[_0x0352('0x2d')];this[_0x0352('0x2e')]=_0x7f10f1['dialAMDTotalAnalysisTime'];this[_0x0352('0x2f')]=_0x7f10f1[_0x0352('0x2f')];this[_0x0352('0x30')]=_0x7f10f1['dialAMDBetweenWordsSilence'];this[_0x0352('0x31')]=_0x7f10f1['dialAMDMaximumNumberOfWords'];this[_0x0352('0x32')]=_0x7f10f1['dialAMDSilenceThreshold'];this[_0x0352('0x33')]=_0x7f10f1[_0x0352('0x33')];}module[_0x0352('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7daf88b..32587d2 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 _0x6372=['transferType','mohtime','exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answertime','lastapplication','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x9a952c,_0x3932e1){var _0xb30a17=function(_0x3b2ada){while(--_0x3b2ada){_0x9a952c['push'](_0x9a952c['shift']());}};_0xb30a17(++_0x3932e1);}(_0x6372,0x1b8));var _0x2637=function(_0x5754b8,_0x545668){_0x5754b8=_0x5754b8-0x0;var _0x41b071=_0x6372[_0x5754b8];return _0x41b071;};'use strict';function Channel(){this[_0x2637('0x0')]=null;this['channel']='';this[_0x2637('0x1')]='';this['calleridnum']=0x0;this[_0x2637('0x2')]='';this[_0x2637('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x2637('0x4')]=0x0;this[_0x2637('0x5')]='';this[_0x2637('0x6')]=0x0;this[_0x2637('0x7')]=0x0;this[_0x2637('0x8')]=0x0;this['answered']=![];this[_0x2637('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0x2637('0xa')]='';this['lastdata']='';this['duration']=0x0;this[_0x2637('0xb')]=0x0;this[_0x2637('0xc')]=0x0;this[_0x2637('0xd')]=null;this['tag']=null;this['disposition']=null;this[_0x2637('0xe')]=![];this[_0x2637('0xf')]=null;this[_0x2637('0x10')]=null;this[_0x2637('0x11')]=[];this[_0x2637('0x12')]=undefined;this[_0x2637('0x13')]=undefined;this[_0x2637('0x14')]=undefined;this[_0x2637('0x15')]=0x0;}module[_0x2637('0x16')]=Channel; \ No newline at end of file +var _0xcf3d=['endtime','abandoned','lastapplication','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered'];(function(_0x5ecf56,_0x1b5bc4){var _0x4a8164=function(_0x5cd68d){while(--_0x5cd68d){_0x5ecf56['push'](_0x5ecf56['shift']());}};_0x4a8164(++_0x1b5bc4);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x2800ff,_0x429c81){_0x2800ff=_0x2800ff-0x0;var _0x348b38=_0xcf3d[_0x2800ff];return _0x348b38;};'use strict';function Channel(){this[_0xdcf3('0x0')]=null;this[_0xdcf3('0x1')]='';this[_0xdcf3('0x2')]='';this[_0xdcf3('0x3')]=0x0;this['calleridname']='';this[_0xdcf3('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xdcf3('0x5')]=0x0;this[_0xdcf3('0x6')]='';this[_0xdcf3('0x7')]=0x0;this[_0xdcf3('0x8')]=0x0;this[_0xdcf3('0x9')]=0x0;this[_0xdcf3('0xa')]=![];this['answertime']=null;this[_0xdcf3('0xb')]=null;this['unmanaged']=![];this[_0xdcf3('0xc')]=![];this[_0xdcf3('0xd')]='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xdcf3('0xe')]=0x0;this[_0xdcf3('0xf')]=null;this[_0xdcf3('0x10')]=null;this[_0xdcf3('0x11')]=null;this[_0xdcf3('0x12')]=![];this[_0xdcf3('0x13')]=null;this[_0xdcf3('0x14')]=null;this[_0xdcf3('0x15')]=[];this[_0xdcf3('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xdcf3('0x17')]=undefined;this[_0xdcf3('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c7176f7..25019b6 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 _0xfaf4=['Configurations','exports','name','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x3b05f7,_0xcd0add){var _0x208494=function(_0x3f52e5){while(--_0x3f52e5){_0x3b05f7['push'](_0x3b05f7['shift']());}};_0x208494(++_0xcd0add);}(_0xfaf4,0xe6));var _0x4faf=function(_0x2864bd,_0x41394c){_0x2864bd=_0x2864bd-0x0;var _0x42306e=_0xfaf4[_0x2864bd];return _0x42306e;};'use strict';function DeskAccount(_0x577c5d){this['id']=_0x577c5d['id']||0x0;this['name']=_0x577c5d[_0x4faf('0x0')]||'';this[_0x4faf('0x1')]=_0x577c5d[_0x4faf('0x1')]||'';this['remoteUri']=_0x577c5d['remoteUri']||'';this['authType']=_0x577c5d[_0x4faf('0x2')]||'';this[_0x4faf('0x3')]=_0x577c5d[_0x4faf('0x3')]||'';this['consumerKey']=_0x577c5d[_0x4faf('0x4')]||'';this[_0x4faf('0x5')]=_0x577c5d[_0x4faf('0x5')]||'';this[_0x4faf('0x6')]=_0x577c5d[_0x4faf('0x6')]||'';this['tokenSecret']=_0x577c5d[_0x4faf('0x7')]||'';this[_0x4faf('0x8')]=_0x577c5d[_0x4faf('0x8')]||'';this[_0x4faf('0x9')]=_0x577c5d['serverUrl']||'';this[_0x4faf('0xa')]=_0x577c5d['Configurations']||{};}module[_0x4faf('0xb')]=DeskAccount; \ No newline at end of file +var _0x33ef=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','remoteUri','authType'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x33ef,0x105));var _0xf33e=function(_0x5e5b5e,_0x1d4bde){_0x5e5b5e=_0x5e5b5e-0x0;var _0x296489=_0x33ef[_0x5e5b5e];return _0x296489;};'use strict';function DeskAccount(_0x19a764){this['id']=_0x19a764['id']||0x0;this[_0xf33e('0x0')]=_0x19a764['name']||'';this['username']=_0x19a764['username']||'';this[_0xf33e('0x1')]=_0x19a764[_0xf33e('0x1')]||'';this[_0xf33e('0x2')]=_0x19a764[_0xf33e('0x2')]||'';this['password']=_0x19a764[_0xf33e('0x3')]||'';this[_0xf33e('0x4')]=_0x19a764[_0xf33e('0x4')]||'';this['consumerSecret']=_0x19a764[_0xf33e('0x5')]||'';this[_0xf33e('0x6')]=_0x19a764['token']||'';this[_0xf33e('0x7')]=_0x19a764[_0xf33e('0x7')]||'';this[_0xf33e('0x8')]=_0x19a764['type']||'';this[_0xf33e('0x9')]=_0x19a764[_0xf33e('0x9')]||'';this['Configurations']=_0x19a764[_0xf33e('0xa')]||{};}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 4804013..b46a5a7 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 _0x0bb5=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x1ab168,_0x3b96df){var _0x4083d5=function(_0x1b93c7){while(--_0x1b93c7){_0x1ab168['push'](_0x1ab168['shift']());}};_0x4083d5(++_0x3b96df);}(_0x0bb5,0x148));var _0x50bb=function(_0x150ece,_0x50b213){_0x150ece=_0x150ece-0x0;var _0x21da69=_0x0bb5[_0x150ece];return _0x21da69;};'use strict';function Dynamics365Account(_0x4878e5){this['id']=_0x4878e5['id']||0x0;this[_0x50bb('0x0')]=_0x4878e5['name']||'';this['username']=_0x4878e5[_0x50bb('0x1')]||'';this[_0x50bb('0x2')]=_0x4878e5[_0x50bb('0x2')]||'';this[_0x50bb('0x3')]=_0x4878e5[_0x50bb('0x3')]||'';this[_0x50bb('0x4')]=_0x4878e5[_0x50bb('0x4')]||'';this[_0x50bb('0x5')]=_0x4878e5['clientId']||'';this['clientSecret']=_0x4878e5[_0x50bb('0x6')]||{};this[_0x50bb('0x7')]=_0x4878e5[_0x50bb('0x7')]||'';this[_0x50bb('0x8')]=_0x4878e5['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xf109=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x12aeda,_0x34b54b){var _0x30a04e=function(_0x4dafb3){while(--_0x4dafb3){_0x12aeda['push'](_0x12aeda['shift']());}};_0x30a04e(++_0x34b54b);}(_0xf109,0xce));var _0x9f10=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xf109[_0x36c5b0];return _0xf19333;};'use strict';function Dynamics365Account(_0x4debcd){this['id']=_0x4debcd['id']||0x0;this[_0x9f10('0x0')]=_0x4debcd[_0x9f10('0x0')]||'';this['username']=_0x4debcd['username']||'';this['password']=_0x4debcd[_0x9f10('0x1')]||'';this[_0x9f10('0x2')]=_0x4debcd[_0x9f10('0x2')]||'';this[_0x9f10('0x3')]=_0x4debcd[_0x9f10('0x3')]||'';this[_0x9f10('0x4')]=_0x4debcd[_0x9f10('0x4')]||'';this[_0x9f10('0x5')]=_0x4debcd[_0x9f10('0x5')]||{};this[_0x9f10('0x6')]=_0x4debcd[_0x9f10('0x6')]||'';this['Configurations']=_0x4debcd[_0x9f10('0x7')]||{};}module[_0x9f10('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index cd99b2c..1a8fda7 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 _0x9fea=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x9fea,0x1a5));var _0xa9fe=function(_0x558f39,_0x5dd108){_0x558f39=_0x558f39-0x0;var _0x2d7ccc=_0x9fea[_0x558f39];return _0x2d7ccc;};'use strict';function FaxAccount(_0x35e52f){this['id']=_0x35e52f['id']||0x0;this['name']=_0x35e52f['name']||'';this[_0xa9fe('0x0')]=_0x35e52f[_0xa9fe('0x0')];this[_0xa9fe('0x1')]=_0x35e52f[_0xa9fe('0x1')];this[_0xa9fe('0x2')]=_0x35e52f[_0xa9fe('0x2')];this[_0xa9fe('0x3')]=_0x35e52f['localstationid'];this[_0xa9fe('0x4')]=_0x35e52f[_0xa9fe('0x4')]||0x960;this[_0xa9fe('0x5')]=_0x35e52f['maxrate']||0x3840;this['modem']=_0x35e52f[_0xa9fe('0x6')]||_0xa9fe('0x7');this[_0xa9fe('0x8')]=_0x35e52f[_0xa9fe('0x8')]||'no';this[_0xa9fe('0x9')]=_0x35e52f[_0xa9fe('0x9')]||'no';this[_0xa9fe('0xa')]=_0x35e52f[_0xa9fe('0xa')]||0x1388;this[_0xa9fe('0xb')]=_0x35e52f[_0xa9fe('0xb')]||_0xa9fe('0xc');this[_0xa9fe('0xd')]=_0x35e52f[_0xa9fe('0xd')]?_0x35e52f['Trunk']:undefined;this[_0xa9fe('0xe')]=_0x35e52f[_0xa9fe('0xe')];this[_0xa9fe('0xf')]=_0x35e52f[_0xa9fe('0xf')];}module[_0xa9fe('0x10')]=FaxAccount; \ No newline at end of file +var _0xb556=['tech','SIP','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xb556,0x136));var _0x6b55=function(_0x29b577,_0x1cc896){_0x29b577=_0x29b577-0x0;var _0x5794de=_0xb556[_0x29b577];return _0x5794de;};'use strict';function FaxAccount(_0x476a6d){this['id']=_0x476a6d['id']||0x0;this['name']=_0x476a6d['name']||'';this[_0x6b55('0x0')]=_0x476a6d[_0x6b55('0x0')];this[_0x6b55('0x1')]=_0x476a6d[_0x6b55('0x1')];this[_0x6b55('0x2')]=_0x476a6d['headerinfo'];this[_0x6b55('0x3')]=_0x476a6d['localstationid'];this['minrate']=_0x476a6d['minrate']||0x960;this[_0x6b55('0x4')]=_0x476a6d['maxrate']||0x3840;this[_0x6b55('0x5')]=_0x476a6d[_0x6b55('0x5')]||_0x6b55('0x6');this['gateway']=_0x476a6d[_0x6b55('0x7')]||'no';this[_0x6b55('0x8')]=_0x476a6d['faxdetect']||'no';this[_0x6b55('0x9')]=_0x476a6d[_0x6b55('0x9')]||0x1388;this[_0x6b55('0xa')]=_0x476a6d[_0x6b55('0xa')]||_0x6b55('0xb');this['Trunk']=_0x476a6d[_0x6b55('0xc')]?_0x476a6d[_0x6b55('0xc')]:undefined;this[_0x6b55('0xd')]=_0x476a6d[_0x6b55('0xd')];this['key']=_0x476a6d[_0x6b55('0xe')];}module[_0x6b55('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 906444e..e038fc6 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 _0x4bcb=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x55bd50,_0x1d1cc7){var _0x30fba0=function(_0x332570){while(--_0x332570){_0x55bd50['push'](_0x55bd50['shift']());}};_0x30fba0(++_0x1d1cc7);}(_0x4bcb,0x17a));var _0xb4bc=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0x4bcb[_0x1b8b95];return _0x3657ae;};'use strict';function FreshdeskAccount(_0x472716){this['id']=_0x472716['id']||0x0;this['name']=_0x472716[_0xb4bc('0x0')]||'';this['username']=_0x472716[_0xb4bc('0x1')]||'';this['apiKey']=_0x472716[_0xb4bc('0x2')]||'';this[_0xb4bc('0x3')]=_0x472716[_0xb4bc('0x3')]||'';this[_0xb4bc('0x4')]=_0x472716[_0xb4bc('0x4')]||'';this[_0xb4bc('0x5')]=_0x472716[_0xb4bc('0x5')]||{};}module[_0xb4bc('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x3079=['name','username','apiKey','token','serverUrl','Configurations','exports'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0x3079,0x69));var _0x9307=function(_0x1f3579,_0x275ae2){_0x1f3579=_0x1f3579-0x0;var _0x307378=_0x3079[_0x1f3579];return _0x307378;};'use strict';function FreshdeskAccount(_0x43643c){this['id']=_0x43643c['id']||0x0;this[_0x9307('0x0')]=_0x43643c[_0x9307('0x0')]||'';this['username']=_0x43643c[_0x9307('0x1')]||'';this[_0x9307('0x2')]=_0x43643c[_0x9307('0x3')]||'';this['remoteUri']=_0x43643c['remoteUri']||'';this[_0x9307('0x4')]=_0x43643c[_0x9307('0x4')]||'';this['Configurations']=_0x43643c[_0x9307('0x5')]||{};}module[_0x9307('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 7fce0d5..56c7569 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 _0xa7be=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x1b3f91,_0x2d7894){var _0xcbf3a1=function(_0x2be7af){while(--_0x2be7af){_0x1b3f91['push'](_0x1b3f91['shift']());}};_0xcbf3a1(++_0x2d7894);}(_0xa7be,0xfd));var _0xea7b=function(_0x491084,_0x48952f){_0x491084=_0x491084-0x0;var _0x39c12d=_0xa7be[_0x491084];return _0x39c12d;};'use strict';function FreshsalesAccount(_0xb362e5){this['id']=_0xb362e5['id']||0x0;this[_0xea7b('0x0')]=_0xb362e5[_0xea7b('0x0')]||'';this[_0xea7b('0x1')]=_0xb362e5[_0xea7b('0x1')]||'';this['apiKey']=_0xb362e5['token']||'';this[_0xea7b('0x2')]=_0xb362e5[_0xea7b('0x2')]||'';this[_0xea7b('0x3')]=_0xb362e5['serverUrl']||'';this[_0xea7b('0x4')]=_0xb362e5[_0xea7b('0x4')]||{};}module[_0xea7b('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x7fbe=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x3ac725,_0x2f70b0){var _0x432aac=function(_0x2e853e){while(--_0x2e853e){_0x3ac725['push'](_0x3ac725['shift']());}};_0x432aac(++_0x2f70b0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49a60f,_0x518c48){_0x49a60f=_0x49a60f-0x0;var _0x38c29c=_0x7fbe[_0x49a60f];return _0x38c29c;};'use strict';function FreshsalesAccount(_0x45d7e2){this['id']=_0x45d7e2['id']||0x0;this['name']=_0x45d7e2[_0xe7fb('0x0')]||'';this[_0xe7fb('0x1')]=_0x45d7e2[_0xe7fb('0x1')]||'';this[_0xe7fb('0x2')]=_0x45d7e2[_0xe7fb('0x3')]||'';this[_0xe7fb('0x4')]=_0x45d7e2[_0xe7fb('0x4')]||'';this[_0xe7fb('0x5')]=_0x45d7e2[_0xe7fb('0x5')]||'';this[_0xe7fb('0x6')]=_0x45d7e2[_0xe7fb('0x6')]||{};}module[_0xe7fb('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index cd5ab85..b72d340 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 _0x5365=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x383097,_0x5b6cab){var _0x652287=function(_0x21d82d){while(--_0x21d82d){_0x383097['push'](_0x383097['shift']());}};_0x652287(++_0x5b6cab);}(_0x5365,0x1b2));var _0x5536=function(_0x5d8b9c,_0x2f3212){_0x5d8b9c=_0x5d8b9c-0x0;var _0x4fb4c3=_0x5365[_0x5d8b9c];return _0x4fb4c3;};'use strict';function QueueReport(){this[_0x5536('0x0')]='inbound';this['uniqueid']='';this[_0x5536('0x1')]='';this['calleridname']='';this[_0x5536('0x2')]='';this[_0x5536('0x3')]=null;this[_0x5536('0x4')]=null;this[_0x5536('0x5')]=0x1;this[_0x5536('0x6')]=0x1;this[_0x5536('0x7')]=![];this[_0x5536('0x8')]=null;this[_0x5536('0x9')]=![];this[_0x5536('0xa')]=null;this[_0x5536('0xb')]=![];this[_0x5536('0xc')]=null;this[_0x5536('0xd')]=0x1;this['channel']='';this[_0x5536('0xe')]='';this[_0x5536('0xf')]='';this[_0x5536('0x10')]='';this[_0x5536('0x11')]='';this[_0x5536('0x12')]='';this['priority']='';this[_0x5536('0x13')]=0x0;this['assigned']=![];this[_0x5536('0x14')]='';this[_0x5536('0x15')]=_0x5536('0x16');this[_0x5536('0x17')]=0x0;this[_0x5536('0x18')]={};}module[_0x5536('0x19')]=QueueReport; \ No newline at end of file +var _0x23bc=['context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x43db88,_0x511b8f){var _0xb72a4f=function(_0x4f8a2f){while(--_0x4f8a2f){_0x43db88['push'](_0x43db88['shift']());}};_0xb72a4f(++_0x511b8f);}(_0x23bc,0x168));var _0xc23b=function(_0x28fba8,_0x1130a6){_0x28fba8=_0x28fba8-0x0;var _0x59fd04=_0x23bc[_0x28fba8];return _0x59fd04;};'use strict';function QueueReport(){this[_0xc23b('0x0')]='inbound';this[_0xc23b('0x1')]='';this[_0xc23b('0x2')]='';this['calleridname']='';this['queue']='';this[_0xc23b('0x3')]=null;this[_0xc23b('0x4')]=null;this[_0xc23b('0x5')]=0x1;this['count']=0x1;this[_0xc23b('0x6')]=![];this[_0xc23b('0x7')]=null;this[_0xc23b('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xc23b('0x9')]=![];this[_0xc23b('0xa')]=null;this['originalposition']=0x1;this[_0xc23b('0xb')]='';this[_0xc23b('0xc')]='';this[_0xc23b('0xd')]='';this[_0xc23b('0xe')]='';this[_0xc23b('0xf')]='';this[_0xc23b('0x10')]='';this[_0xc23b('0x11')]='';this[_0xc23b('0x12')]=0x0;this[_0xc23b('0x13')]=![];this[_0xc23b('0x14')]='';this[_0xc23b('0x15')]='voice';this[_0xc23b('0x16')]=0x0;this[_0xc23b('0x17')]={};}module[_0xc23b('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 1ae7a3b..50b0813 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 _0x8ed7=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name'];(function(_0x52a113,_0x164c4d){var _0x4b4208=function(_0x2a0bcf){while(--_0x2a0bcf){_0x52a113['push'](_0x52a113['shift']());}};_0x4b4208(++_0x164c4d);}(_0x8ed7,0x8b));var _0x78ed=function(_0x3b1e17,_0x2fe839){_0x3b1e17=_0x3b1e17-0x0;var _0x4e3468=_0x8ed7[_0x3b1e17];return _0x4e3468;};'use strict';function SalesforceAccount(_0x2f4eda){this['id']=_0x2f4eda['id']||0x0;this[_0x78ed('0x0')]=_0x2f4eda[_0x78ed('0x0')]||'';this[_0x78ed('0x1')]=_0x2f4eda['username']||'';this['remoteUri']=_0x2f4eda[_0x78ed('0x2')]||'';this[_0x78ed('0x3')]=_0x2f4eda[_0x78ed('0x3')]||'';this[_0x78ed('0x4')]=_0x2f4eda[_0x78ed('0x4')]||'';this[_0x78ed('0x5')]=_0x2f4eda[_0x78ed('0x5')]||'';this[_0x78ed('0x6')]=_0x2f4eda[_0x78ed('0x6')]||'';this['type']=_0x2f4eda[_0x78ed('0x7')]||'integrationTab';this[_0x78ed('0x8')]=_0x2f4eda['serverUrl']||'';this[_0x78ed('0x9')]=_0x2f4eda['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x3bde=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x325ad7,_0x3ad0f){var _0x3aca92=function(_0xea9a1c){while(--_0xea9a1c){_0x325ad7['push'](_0x325ad7['shift']());}};_0x3aca92(++_0x3ad0f);}(_0x3bde,0x9a));var _0xe3bd=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x3bde[_0x403c20];return _0x2b271a;};'use strict';function SalesforceAccount(_0x1a58ae){this['id']=_0x1a58ae['id']||0x0;this[_0xe3bd('0x0')]=_0x1a58ae[_0xe3bd('0x0')]||'';this[_0xe3bd('0x1')]=_0x1a58ae['username']||'';this[_0xe3bd('0x2')]=_0x1a58ae[_0xe3bd('0x2')]||'';this[_0xe3bd('0x3')]=_0x1a58ae[_0xe3bd('0x3')]||'';this[_0xe3bd('0x4')]=_0x1a58ae[_0xe3bd('0x4')]||'';this[_0xe3bd('0x5')]=_0x1a58ae[_0xe3bd('0x5')]||'';this[_0xe3bd('0x6')]=_0x1a58ae['securityToken']||'';this[_0xe3bd('0x7')]=_0x1a58ae['type']||_0xe3bd('0x8');this[_0xe3bd('0x9')]=_0x1a58ae[_0xe3bd('0x9')]||'';this[_0xe3bd('0xa')]=_0x1a58ae[_0xe3bd('0xa')]||{};}module[_0xe3bd('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index f5023ba..2da70f2 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 _0xc770=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x5b843f,_0x19fe3a){var _0x418c3a=function(_0x265746){while(--_0x265746){_0x5b843f['push'](_0x5b843f['shift']());}};_0x418c3a(++_0x19fe3a);}(_0xc770,0xe8));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x6e761e){this['id']=_0x6e761e['id']||0x0;this[_0x0c77('0x0')]=_0x6e761e[_0x0c77('0x0')]||'';this[_0x0c77('0x1')]=_0x6e761e['username']||'';this[_0x0c77('0x2')]=_0x6e761e[_0x0c77('0x2')]||'';this[_0x0c77('0x3')]=_0x6e761e['remoteUri']||'';this[_0x0c77('0x4')]=_0x6e761e[_0x0c77('0x4')]||'';this[_0x0c77('0x5')]=_0x6e761e['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x7dcc=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x96cc3d,_0x362c00){var _0x20680a=function(_0xdc2f11){while(--_0xdc2f11){_0x96cc3d['push'](_0x96cc3d['shift']());}};_0x20680a(++_0x362c00);}(_0x7dcc,0x1c5));var _0xc7dc=function(_0x2de91a,_0x542708){_0x2de91a=_0x2de91a-0x0;var _0x49d0b8=_0x7dcc[_0x2de91a];return _0x49d0b8;};'use strict';function ServicenowAccount(_0x444a58){this['id']=_0x444a58['id']||0x0;this[_0xc7dc('0x0')]=_0x444a58['name']||'';this[_0xc7dc('0x1')]=_0x444a58['username']||'';this[_0xc7dc('0x2')]=_0x444a58[_0xc7dc('0x2')]||'';this[_0xc7dc('0x3')]=_0x444a58[_0xc7dc('0x3')]||'';this[_0xc7dc('0x4')]=_0x444a58[_0xc7dc('0x4')]||'';this[_0xc7dc('0x5')]=_0x444a58[_0xc7dc('0x5')]||{};}module[_0xc7dc('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 c456691..cfe67a4 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 _0x83b4=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x303706,_0x2fc711){var _0x42681d=function(_0x5e1bcc){while(--_0x5e1bcc){_0x303706['push'](_0x303706['shift']());}};_0x42681d(++_0x2fc711);}(_0x83b4,0x1a7));var _0x483b=function(_0x480057,_0x1218e9){_0x480057=_0x480057-0x0;var _0xeb7793=_0x83b4[_0x480057];return _0xeb7793;};'use strict';function SugarcrmAccount(_0x2a95e0){this['id']=_0x2a95e0['id']||0x0;this['name']=_0x2a95e0[_0x483b('0x0')]||'';this[_0x483b('0x1')]=_0x2a95e0[_0x483b('0x1')]||'';this[_0x483b('0x2')]=_0x2a95e0[_0x483b('0x2')]||'';this[_0x483b('0x3')]=_0x2a95e0[_0x483b('0x3')]||'';this[_0x483b('0x4')]=_0x2a95e0[_0x483b('0x4')]||'';this['Configurations']=_0x2a95e0[_0x483b('0x5')]||{};}module[_0x483b('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x09dc=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4a850d,_0x54a275){var _0x3225fe=function(_0x34bae7){while(--_0x34bae7){_0x4a850d['push'](_0x4a850d['shift']());}};_0x3225fe(++_0x54a275);}(_0x09dc,0xd4));var _0xc09d=function(_0x1b4912,_0x3e8bb9){_0x1b4912=_0x1b4912-0x0;var _0x48cac5=_0x09dc[_0x1b4912];return _0x48cac5;};'use strict';function SugarcrmAccount(_0x2b645a){this['id']=_0x2b645a['id']||0x0;this['name']=_0x2b645a[_0xc09d('0x0')]||'';this[_0xc09d('0x1')]=_0x2b645a[_0xc09d('0x1')]||'';this['password']=_0x2b645a[_0xc09d('0x2')]||'';this[_0xc09d('0x3')]=_0x2b645a['remoteUri']||'';this[_0xc09d('0x4')]=_0x2b645a['serverUrl']||'';this[_0xc09d('0x5')]=_0x2b645a[_0xc09d('0x5')]||{};}module[_0xc09d('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 4242a25..e72eee7 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 _0x6e7d=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x18e7e5,_0x5ad463){var _0x30c78a=function(_0x473e33){while(--_0x473e33){_0x18e7e5['push'](_0x18e7e5['shift']());}};_0x30c78a(++_0x5ad463);}(_0x6e7d,0x1a0));var _0xd6e7=function(_0x4a7100,_0x5b24a4){_0x4a7100=_0x4a7100-0x0;var _0x58bca2=_0x6e7d[_0x4a7100];return _0x58bca2;};'use strict';function Telephone(_0x2dbe5c){this['id']=_0x2dbe5c['id']||0x0;this[_0xd6e7('0x0')]=_0x2dbe5c[_0xd6e7('0x0')]||'';this[_0xd6e7('0x1')]=_0x2dbe5c[_0xd6e7('0x1')]||'';this[_0xd6e7('0x2')]=_0xd6e7('0x3');this[_0xd6e7('0x4')]=0x0;this[_0xd6e7('0x5')]=_0xd6e7('0x3');this[_0xd6e7('0x6')]='';}module[_0xd6e7('0x7')]=Telephone; \ No newline at end of file +var _0x9f04=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0x9f04,0x178));var _0x49f0=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9f04[_0x21a9d9];return _0x46adce;};'use strict';function Telephone(_0x5e7c53){this['id']=_0x5e7c53['id']||0x0;this[_0x49f0('0x0')]=_0x5e7c53[_0x49f0('0x0')]||'';this[_0x49f0('0x1')]=_0x5e7c53[_0x49f0('0x1')]||'';this[_0x49f0('0x2')]=_0x49f0('0x3');this[_0x49f0('0x4')]=0x0;this[_0x49f0('0x5')]=_0x49f0('0x3');this[_0x49f0('0x6')]='';}module[_0x49f0('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 0c5a1e5..c6216b3 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x5ac4bf,_0x44899b){var _0x13d3a8=function(_0x36afc5){while(--_0x36afc5){_0x5ac4bf['push'](_0x5ac4bf['shift']());}};_0x13d3a8(++_0x44899b);}(_0xb10b,0x12a));var _0xbb10=function(_0x44c37d,_0x19119f){_0x44c37d=_0x44c37d-0x0;var _0x29e087=_0xb10b[_0x44c37d];return _0x29e087;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x4931d0,_0x21d359){var _0x35e76e=function(_0x596e24){while(--_0x596e24){_0x4931d0['push'](_0x4931d0['shift']());}};_0x35e76e(++_0x21d359);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 420745b..ee324d1 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1fef4b,_0x4f333b){var _0xe18fee=function(_0x187b44){while(--_0x187b44){_0x1fef4b['push'](_0x1fef4b['shift']());}};_0xe18fee(++_0x4f333b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x23f59f,_0x12e005){_0x23f59f=_0x23f59f-0x0;var _0x4a9f18=_0x9ffd[_0x23f59f];return _0x4a9f18;};'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 +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1a85,0x178));var _0x51a8=function(_0x216bb8,_0x103b3b){_0x216bb8=_0x216bb8-0x0;var _0x5756ad=_0x1a85[_0x216bb8];return _0x5756ad;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 0f8ea38..048cd36 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 _0xfcee=['unknown','status','registry','indexOf','split','domain','domainport','refresh','address','defaultuser','exports','active','name','state'];(function(_0x4f8a4a,_0x4b1253){var _0x32ec37=function(_0x263c2c){while(--_0x263c2c){_0x4f8a4a['push'](_0x4f8a4a['shift']());}};_0x32ec37(++_0x4b1253);}(_0xfcee,0x169));var _0xefce=function(_0x22b94b,_0x5e23c){_0x22b94b=_0x22b94b-0x0;var _0x21d7ce=_0xfcee[_0x22b94b];return _0x21d7ce;};'use strict';function Trunk(_0x167079){this['id']=_0x167079['id']||0x0;this[_0xefce('0x0')]=_0x167079[_0xefce('0x0')]||![];this[_0xefce('0x1')]=_0x167079[_0xefce('0x1')]||'';this[_0xefce('0x2')]=_0xefce('0x3');this['stateTime']=0x0;this[_0xefce('0x4')]='unknown';this['registry']=_0x167079[_0xefce('0x5')]&&_0x167079[_0xefce('0x5')][_0xefce('0x6')](':')?_0x167079['registry'][_0xefce('0x7')](':')[0x0]:'';this['host']='';this['port']='';this[_0xefce('0x8')]='';this[_0xefce('0x9')]='';this[_0xefce('0xa')]='';this['stateRegistry']=_0xefce('0x3');this['registrationtime']='';this[_0xefce('0xb')]='';this['defaultuser']=_0x167079[_0xefce('0xc')]||'';}module[_0xefce('0xd')]=Trunk; \ No newline at end of file +var _0xd9e2=['domainport','registrationtime','address','defaultuser','active','name','state','unknown','stateTime','status','registry','indexOf','split','port','domain'];(function(_0x1b7ad0,_0x25c5c3){var _0x424a5a=function(_0x5ece94){while(--_0x5ece94){_0x1b7ad0['push'](_0x1b7ad0['shift']());}};_0x424a5a(++_0x25c5c3);}(_0xd9e2,0x1e4));var _0x2d9e=function(_0x37cfde,_0x1e0827){_0x37cfde=_0x37cfde-0x0;var _0x12ecc4=_0xd9e2[_0x37cfde];return _0x12ecc4;};'use strict';function Trunk(_0x52909b){this['id']=_0x52909b['id']||0x0;this[_0x2d9e('0x0')]=_0x52909b['active']||![];this[_0x2d9e('0x1')]=_0x52909b[_0x2d9e('0x1')]||'';this[_0x2d9e('0x2')]=_0x2d9e('0x3');this[_0x2d9e('0x4')]=0x0;this[_0x2d9e('0x5')]='unknown';this[_0x2d9e('0x6')]=_0x52909b[_0x2d9e('0x6')]&&_0x52909b[_0x2d9e('0x6')][_0x2d9e('0x7')](':')?_0x52909b[_0x2d9e('0x6')][_0x2d9e('0x8')](':')[0x0]:'';this['host']='';this[_0x2d9e('0x9')]='';this[_0x2d9e('0xa')]='';this[_0x2d9e('0xb')]='';this['refresh']='';this['stateRegistry']=_0x2d9e('0x3');this[_0x2d9e('0xc')]='';this[_0x2d9e('0xd')]='';this['defaultuser']=_0x52909b[_0x2d9e('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 44cba82..67634ce 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 _0xf1c3=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x2160a6,_0x1217ce){var _0x2b1331=function(_0xe17019){while(--_0xe17019){_0x2160a6['push'](_0x2160a6['shift']());}};_0x2b1331(++_0x1217ce);}(_0xf1c3,0x95));var _0x3f1c=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0xf1c3[_0x58ae8a];return _0x2f0b6b;};'use strict';function voiceExtension(_0x58f580){this['id']=_0x58f580['id']||0x0;this[_0x3f1c('0x0')]=_0x58f580[_0x3f1c('0x0')]||'';this[_0x3f1c('0x1')]=_0x58f580[_0x3f1c('0x1')]||_0x3f1c('0x2');this[_0x3f1c('0x3')]=_0x58f580[_0x3f1c('0x3')]||![];}module[_0x3f1c('0x4')]=voiceExtension; \ No newline at end of file +var _0x1d27=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x33337f,_0x5d7319){var _0x3d9d50=function(_0x660d6a){while(--_0x660d6a){_0x33337f['push'](_0x33337f['shift']());}};_0x3d9d50(++_0x5d7319);}(_0x1d27,0xad));var _0x71d2=function(_0xf11c6e,_0x4a4132){_0xf11c6e=_0xf11c6e-0x0;var _0x1b4e3d=_0x1d27[_0xf11c6e];return _0x1b4e3d;};'use strict';function voiceExtension(_0x3d7512){this['id']=_0x3d7512['id']||0x0;this['exten']=_0x3d7512[_0x71d2('0x0')]||'';this[_0x71d2('0x1')]=_0x3d7512[_0x71d2('0x1')]||'none';this[_0x71d2('0x2')]=_0x3d7512['mandatoryDisposition']||![];}module[_0x71d2('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e322936..e9f85f3 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 _0xe98c=['acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw'];(function(_0x55ba38,_0x4c78c0){var _0x27f5d4=function(_0x450f22){while(--_0x450f22){_0x55ba38['push'](_0x55ba38['shift']());}};_0x27f5d4(++_0x4c78c0);}(_0xe98c,0xd3));var _0xce98=function(_0x21d246,_0x4888f1){_0x21d246=_0x21d246-0x0;var _0x8656f0=_0xe98c[_0x21d246];return _0x8656f0;};'use strict';var statusDesc=[_0xce98('0x0'),_0xce98('0x1'),_0xce98('0x2'),_0xce98('0x3'),_0xce98('0x4'),'unavailable',_0xce98('0x5'),_0xce98('0x6'),_0xce98('0x7')];var monitorFormat={'wav':_0xce98('0x8'),'wav49':_0xce98('0x9'),'gsm':_0xce98('0xa')};var strategy={'rrmemory':_0xce98('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x9c5d9c){this['id']=_0x9c5d9c['id']||0x0;this[_0xce98('0xc')]=_0x9c5d9c[_0xce98('0xc')]||'';this['monitor_format']=_0x9c5d9c[_0xce98('0xd')]||'';this['type']=_0x9c5d9c[_0xce98('0xe')]||'inbound';this[_0xce98('0xf')]=0x0;this[_0xce98('0x10')]=0x0;this[_0xce98('0x11')]=0x0;this['answered']=0x0;this[_0xce98('0x12')]=0x0;this[_0xce98('0x13')]=0x0;this[_0xce98('0x14')]=0x0;this['unmanaged']=0x0;this[_0xce98('0x15')]=0x0;this[_0xce98('0x16')]=0x0;this[_0xce98('0x17')]=0x0;this[_0xce98('0x18')]=_0x9c5d9c[_0xce98('0x18')]||![];this[_0xce98('0x19')]=_0x9c5d9c['acwTimeout']||0xa;this['autopause']=_0x9c5d9c[_0xce98('0x1a')]||'no';this[_0xce98('0x1b')]=!![];this['message']='';this[_0xce98('0x1c')]=0x0;this['temp']=0x0;this[_0xce98('0x1d')]=_0x9c5d9c[_0xce98('0x1d')]||null;this[_0xce98('0x1e')]=_0x9c5d9c[_0xce98('0x1e')]?_0x9c5d9c[_0xce98('0x1e')]:null;this[_0xce98('0x1f')]=_0x9c5d9c[_0xce98('0x1f')];this[_0xce98('0x20')]=_0x9c5d9c[_0xce98('0x20')]||'progressive';this[_0xce98('0x21')]=_0x9c5d9c['dialLimitChannel']||0x0;this[_0xce98('0x22')]=_0x9c5d9c[_0xce98('0x22')]||0x0;this[_0xce98('0x23')]=_0x9c5d9c['dialPowerLevel']||0x1;this[_0xce98('0x24')]=_0x9c5d9c['dialPredictiveOptimization']||_0xce98('0x25');this[_0xce98('0x26')]=_0x9c5d9c['dialPredictiveOptimizationPercentage']||0.03;this[_0xce98('0x27')]=_0x9c5d9c[_0xce98('0x27')]||0x258;this[_0xce98('0x28')]=_0x9c5d9c[_0xce98('0x28')]||_0xce98('0x29');this['dialOriginateCallerIdNumber']=_0x9c5d9c[_0xce98('0x2a')]||_0xce98('0x29');this[_0xce98('0x2b')]=_0x9c5d9c[_0xce98('0x2b')]||0x1e;this[_0xce98('0x2c')]=_0x9c5d9c['dialQueueOptions']||_0xce98('0x2d');this[_0xce98('0x2e')]=_0x9c5d9c['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x9c5d9c[_0xce98('0x2f')]||undefined;this[_0xce98('0x30')]=_0x9c5d9c[_0xce98('0x30')]||0x3;this[_0xce98('0x31')]=_0x9c5d9c[_0xce98('0x31')]||0x96;this['dialBusyMaxRetry']=_0x9c5d9c[_0xce98('0x32')]||0x3;this[_0xce98('0x33')]=_0x9c5d9c['dialBusyRetryFrequency']||0x96;this[_0xce98('0x34')]=_0x9c5d9c['dialNoAnswerMaxRetry']||0x3;this[_0xce98('0x35')]=_0x9c5d9c[_0xce98('0x35')]||0x96;this[_0xce98('0x36')]=_0x9c5d9c[_0xce98('0x36')]||0x3;this[_0xce98('0x37')]=_0x9c5d9c[_0xce98('0x37')]||0x96;this['dialDropMaxRetry']=_0x9c5d9c[_0xce98('0x38')]||0x3;this['dialDropRetryFrequency']=_0x9c5d9c['dialDropRetryFrequency']||0x96;this[_0xce98('0x39')]=_0x9c5d9c['dialAbandonedMaxRetry']||0x3;this[_0xce98('0x3a')]=_0x9c5d9c[_0xce98('0x3a')]||0x96;this[_0xce98('0x3b')]=_0x9c5d9c[_0xce98('0x3b')]||0x3;this[_0xce98('0x3c')]=_0x9c5d9c[_0xce98('0x3c')]||0x96;this[_0xce98('0x3d')]=_0x9c5d9c[_0xce98('0x3d')]||0x3;this[_0xce98('0x3e')]=_0x9c5d9c[_0xce98('0x3e')]||0x96;this[_0xce98('0x3f')]=_0x9c5d9c[_0xce98('0x3f')]||0x4;this[_0xce98('0x40')]=_0x9c5d9c[_0xce98('0x40')]?_0x9c5d9c[_0xce98('0x40')]:undefined;this[_0xce98('0x41')]=_0x9c5d9c[_0xce98('0x41')]?_0x9c5d9c[_0xce98('0x41')]:undefined;this['dialPrefix']=_0x9c5d9c[_0xce98('0x42')]||undefined;this[_0xce98('0x43')]=_0x9c5d9c['Interval']?_0x9c5d9c[_0xce98('0x43')]:undefined;this[_0xce98('0x44')]=_0x9c5d9c['dialOrderByScheduledAt']||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x9c5d9c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xce98('0x45')]=_0x9c5d9c[_0xce98('0x45')]||undefined;this[_0xce98('0x46')]=strategy[_0x9c5d9c['strategy']]||_0xce98('0xb');this[_0xce98('0x47')]=!![];this[_0xce98('0x48')]=_0x9c5d9c[_0xce98('0x48')]||![];this[_0xce98('0x49')]=_0x9c5d9c[_0xce98('0x49')];this['dialAMDGreeting']=_0x9c5d9c[_0xce98('0x4a')];this[_0xce98('0x4b')]=_0x9c5d9c[_0xce98('0x4b')];this[_0xce98('0x4c')]=_0x9c5d9c[_0xce98('0x4c')];this['dialAMDMinWordLength']=_0x9c5d9c[_0xce98('0x4d')];this[_0xce98('0x4e')]=_0x9c5d9c['dialAMDBetweenWordsSilence'];this[_0xce98('0x4f')]=_0x9c5d9c[_0xce98('0x4f')];this[_0xce98('0x50')]=_0x9c5d9c[_0xce98('0x50')];this[_0xce98('0x51')]=_0x9c5d9c['dialAMDMaximumWordLength'];this[_0xce98('0x52')]=0x0;this['pTalking']=0x0;this[_0xce98('0x53')]=_0x9c5d9c['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xce98('0x54')]=0x0;this[_0xce98('0x55')]=0x0;this[_0xce98('0x56')]=0x0;this[_0xce98('0x57')]=0x0;this[_0xce98('0x58')]=0x0;this[_0xce98('0x59')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xce98('0x5a')]=0x0;this[_0xce98('0x5b')]=0x0;this[_0xce98('0x5c')]=0x0;this[_0xce98('0x5d')]=0x0;this[_0xce98('0x5e')]=0x0;this[_0xce98('0x5f')]=0x0;this[_0xce98('0x60')]=undefined;this[_0xce98('0x61')]=undefined;this[_0xce98('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xce98('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xce98('0x64')]=0x0;this[_0xce98('0x65')]=0x0;this[_0xce98('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xce98('0x67')]=_0x9c5d9c[_0xce98('0x68')]||0x14;this[_0xce98('0x69')]=_0x9c5d9c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xce98('0x6a')]=0x0;this[_0xce98('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xce98('0x6c')]=0x0;this[_0xce98('0x6d')]=0x0;this[_0xce98('0x6e')]=0x0;this[_0xce98('0x6f')]=_0x9c5d9c[_0xce98('0x6f')]||0x1e;this[_0xce98('0x70')]=_0x9c5d9c['dialRecallInQueue']||![];this[_0xce98('0x71')]=_0x9c5d9c['dialQueueProject2']||undefined;this[_0xce98('0x72')]=_0x9c5d9c[_0xce98('0x72')]||![];this['dialAgiAfterHangupAgent']=_0x9c5d9c[_0xce98('0x73')]||![];this['monitor_format']=monitorFormat[_0x9c5d9c[_0xce98('0xd')]]?monitorFormat[_0x9c5d9c[_0xce98('0xd')]]:undefined;this[_0xce98('0x74')]=_0x9c5d9c[_0xce98('0x74')]||![];this[_0xce98('0x75')]=_0x9c5d9c[_0xce98('0x75')]?_0x9c5d9c[_0xce98('0x75')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x10dc=['startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','talking','answered','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive'];(function(_0x2bf2ff,_0x27bb45){var _0x357790=function(_0x1e28d4){while(--_0x1e28d4){_0x2bf2ff['push'](_0x2bf2ff['shift']());}};_0x357790(++_0x27bb45);}(_0x10dc,0x90));var _0xc10d=function(_0x4d692a,_0x5c1506){_0x4d692a=_0x4d692a-0x0;var _0x9ef565=_0x10dc[_0x4d692a];return _0x9ef565;};'use strict';var statusDesc=[_0xc10d('0x0'),_0xc10d('0x1'),_0xc10d('0x2'),_0xc10d('0x3'),_0xc10d('0x4'),'unavailable','ringing','ringinuse',_0xc10d('0x5')];var monitorFormat={'wav':_0xc10d('0x6'),'wav49':_0xc10d('0x7'),'gsm':_0xc10d('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xc10d('0x9')};function VoiceQueue(_0x67fc72){this['id']=_0x67fc72['id']||0x0;this[_0xc10d('0xa')]=_0x67fc72[_0xc10d('0xa')]||'';this[_0xc10d('0xb')]=_0x67fc72[_0xc10d('0xb')]||'';this[_0xc10d('0xc')]=_0x67fc72[_0xc10d('0xc')]||'inbound';this['waiting']=0x0;this[_0xc10d('0xd')]=0x0;this['total']=0x0;this[_0xc10d('0xe')]=0x0;this['sumDuration']=0x0;this[_0xc10d('0xf')]=0x0;this[_0xc10d('0x10')]=0x0;this[_0xc10d('0x11')]=0x0;this['abandoned']=0x0;this[_0xc10d('0x12')]=0x0;this['available']=0x0;this[_0xc10d('0x13')]=_0x67fc72[_0xc10d('0x13')]||![];this['acwTimeout']=_0x67fc72[_0xc10d('0x14')]||0xa;this[_0xc10d('0x15')]=_0x67fc72[_0xc10d('0x15')]||'no';this[_0xc10d('0x16')]=!![];this['message']='';this[_0xc10d('0x17')]=0x0;this['temp']=0x0;this[_0xc10d('0x18')]=_0x67fc72['dialTimezone']||null;this[_0xc10d('0x19')]=_0x67fc72[_0xc10d('0x19')]?_0x67fc72[_0xc10d('0x19')]:null;this['dialActive']=_0x67fc72['dialActive'];this['dialMethod']=_0x67fc72[_0xc10d('0x1a')]||_0xc10d('0x1b');this['dialLimitChannel']=_0x67fc72[_0xc10d('0x1c')]||0x0;this['dialLimitQueue']=_0x67fc72[_0xc10d('0x1d')]||0x0;this[_0xc10d('0x1e')]=_0x67fc72['dialPowerLevel']||0x1;this[_0xc10d('0x1f')]=_0x67fc72[_0xc10d('0x1f')]||_0xc10d('0x20');this['dialPredictiveOptimizationPercentage']=_0x67fc72[_0xc10d('0x21')]||0.03;this[_0xc10d('0x22')]=_0x67fc72[_0xc10d('0x22')]||0x258;this[_0xc10d('0x23')]=_0x67fc72[_0xc10d('0x23')]||_0xc10d('0x24');this[_0xc10d('0x25')]=_0x67fc72[_0xc10d('0x25')]||_0xc10d('0x24');this[_0xc10d('0x26')]=_0x67fc72[_0xc10d('0x26')]||0x1e;this[_0xc10d('0x27')]=_0x67fc72['dialQueueOptions']||_0xc10d('0x28');this[_0xc10d('0x29')]=_0x67fc72[_0xc10d('0x29')]||0x3;this[_0xc10d('0x2a')]=_0x67fc72['dialQueueProject']||undefined;this[_0xc10d('0x2b')]=_0x67fc72[_0xc10d('0x2b')]||0x3;this[_0xc10d('0x2c')]=_0x67fc72[_0xc10d('0x2c')]||0x96;this['dialBusyMaxRetry']=_0x67fc72[_0xc10d('0x2d')]||0x3;this['dialBusyRetryFrequency']=_0x67fc72[_0xc10d('0x2e')]||0x96;this[_0xc10d('0x2f')]=_0x67fc72[_0xc10d('0x2f')]||0x3;this[_0xc10d('0x30')]=_0x67fc72[_0xc10d('0x30')]||0x96;this[_0xc10d('0x31')]=_0x67fc72[_0xc10d('0x31')]||0x3;this[_0xc10d('0x32')]=_0x67fc72[_0xc10d('0x32')]||0x96;this[_0xc10d('0x33')]=_0x67fc72[_0xc10d('0x33')]||0x3;this['dialDropRetryFrequency']=_0x67fc72['dialDropRetryFrequency']||0x96;this[_0xc10d('0x34')]=_0x67fc72[_0xc10d('0x34')]||0x3;this[_0xc10d('0x35')]=_0x67fc72[_0xc10d('0x35')]||0x96;this[_0xc10d('0x36')]=_0x67fc72['dialMachineMaxRetry']||0x3;this[_0xc10d('0x37')]=_0x67fc72[_0xc10d('0x37')]||0x96;this[_0xc10d('0x38')]=_0x67fc72['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x67fc72[_0xc10d('0x39')]||0x96;this[_0xc10d('0x3a')]=_0x67fc72[_0xc10d('0x3a')]||0x4;this['Trunk']=_0x67fc72[_0xc10d('0x3b')]?_0x67fc72[_0xc10d('0x3b')]:undefined;this['TrunkBackup']=_0x67fc72[_0xc10d('0x3c')]?_0x67fc72[_0xc10d('0x3c')]:undefined;this[_0xc10d('0x3d')]=_0x67fc72[_0xc10d('0x3d')]||undefined;this[_0xc10d('0x3e')]=_0x67fc72[_0xc10d('0x3e')]?_0x67fc72[_0xc10d('0x3e')]:undefined;this[_0xc10d('0x3f')]=_0x67fc72[_0xc10d('0x3f')]||_0xc10d('0x40');this[_0xc10d('0x41')]=_0x67fc72[_0xc10d('0x41')]||undefined;this[_0xc10d('0x42')]=_0x67fc72[_0xc10d('0x42')]||undefined;this[_0xc10d('0x43')]=strategy[_0x67fc72[_0xc10d('0x43')]]||_0xc10d('0x44');this['queueStatusComplete']=!![];this[_0xc10d('0x45')]=_0x67fc72['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x67fc72[_0xc10d('0x46')];this[_0xc10d('0x47')]=_0x67fc72['dialAMDGreeting'];this[_0xc10d('0x48')]=_0x67fc72[_0xc10d('0x48')];this[_0xc10d('0x49')]=_0x67fc72[_0xc10d('0x49')];this['dialAMDMinWordLength']=_0x67fc72[_0xc10d('0x4a')];this[_0xc10d('0x4b')]=_0x67fc72[_0xc10d('0x4b')];this[_0xc10d('0x4c')]=_0x67fc72[_0xc10d('0x4c')];this['dialAMDSilenceThreshold']=_0x67fc72[_0xc10d('0x4d')];this[_0xc10d('0x4e')]=_0x67fc72['dialAMDMaximumWordLength'];this[_0xc10d('0x4f')]=0x0;this[_0xc10d('0x50')]=0x0;this[_0xc10d('0x51')]=_0x67fc72[_0xc10d('0x51')];this['outboundAnswerCallsDay']=0x0;this[_0xc10d('0x52')]=0x0;this[_0xc10d('0x53')]=0x0;this[_0xc10d('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xc10d('0x55')]=0x0;this[_0xc10d('0x56')]=0x0;this[_0xc10d('0x57')]=0x0;this[_0xc10d('0x58')]=0x0;this[_0xc10d('0x59')]=0x0;this[_0xc10d('0x5a')]=0x0;this[_0xc10d('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this[_0xc10d('0x5c')]=0x0;this[_0xc10d('0x5d')]=undefined;this[_0xc10d('0x5e')]=undefined;this[_0xc10d('0x5f')]=undefined;this[_0xc10d('0x60')]=1.05;this[_0xc10d('0x61')]=0x0;this[_0xc10d('0x62')]=0x0;this[_0xc10d('0x63')]=0x0;this[_0xc10d('0x64')]=0x0;this[_0xc10d('0x65')]=0x0;this[_0xc10d('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xc10d('0x67')]=0x0;this[_0xc10d('0x68')]=_0x67fc72[_0xc10d('0x69')]||0x14;this[_0xc10d('0x6a')]=_0x67fc72[_0xc10d('0x69')]||0xa;this[_0xc10d('0x6b')]=0x0;this[_0xc10d('0x6c')]=0x0;this[_0xc10d('0x6d')]=0x1;this[_0xc10d('0x6e')]=0x0;this[_0xc10d('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x67fc72[_0xc10d('0x70')]||0x1e;this[_0xc10d('0x71')]=_0x67fc72[_0xc10d('0x71')]||![];this[_0xc10d('0x72')]=_0x67fc72['dialQueueProject2']||undefined;this[_0xc10d('0x73')]=_0x67fc72[_0xc10d('0x73')]||![];this[_0xc10d('0x74')]=_0x67fc72['dialAgiAfterHangupAgent']||![];this[_0xc10d('0xb')]=monitorFormat[_0x67fc72['monitor_format']]?monitorFormat[_0x67fc72[_0xc10d('0xb')]]:undefined;this[_0xc10d('0x75')]=_0x67fc72[_0xc10d('0x75')]||![];this['mandatoryDispositionPause']=_0x67fc72[_0xc10d('0x76')]?_0x67fc72['mandatoryDispositionPause']: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 9913aed..a13c357 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 _0x773e=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x3f2d42,_0x118d28){var _0x542e73=function(_0x50a4e2){while(--_0x50a4e2){_0x3f2d42['push'](_0x3f2d42['shift']());}};_0x542e73(++_0x118d28);}(_0x773e,0x139));var _0xe773=function(_0x177982,_0x1d7b54){_0x177982=_0x177982-0x0;var _0x344879=_0x773e[_0x177982];return _0x344879;};'use strict';function VtigerAccount(_0x249597){this['id']=_0x249597['id']||0x0;this['name']=_0x249597[_0xe773('0x0')]||'';this[_0xe773('0x1')]=_0x249597['username']||'';this['accessKey']=_0x249597['accessKey']||'';this[_0xe773('0x2')]=_0x249597[_0xe773('0x2')]||'';this[_0xe773('0x3')]=_0x249597[_0xe773('0x3')]||'';this[_0xe773('0x4')]=_0x249597['Configurations']||{};}module[_0xe773('0x5')]=VtigerAccount; \ No newline at end of file +var _0x3a51=['username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3a51,0x108));var _0x13a5=function(_0x2665fb,_0x2d5399){_0x2665fb=_0x2665fb-0x0;var _0x198694=_0x3a51[_0x2665fb];return _0x198694;};'use strict';function VtigerAccount(_0x428b07){this['id']=_0x428b07['id']||0x0;this['name']=_0x428b07['name']||'';this[_0x13a5('0x0')]=_0x428b07[_0x13a5('0x0')]||'';this[_0x13a5('0x1')]=_0x428b07['accessKey']||'';this[_0x13a5('0x2')]=_0x428b07[_0x13a5('0x2')]||'';this[_0x13a5('0x3')]=_0x428b07[_0x13a5('0x3')]||'';this[_0x13a5('0x4')]=_0x428b07[_0x13a5('0x4')]||{};}module[_0x13a5('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 699a8f1..4ec8851 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 _0xf3b0=['exports','name','username','password','token','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0xf3b0,0x141));var _0x0f3b=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xf3b0[_0x55821d];return _0x58ea8a;};'use strict';function ZendeskAccount(_0x3d3e2f){this['id']=_0x3d3e2f['id']||0x0;this[_0x0f3b('0x0')]=_0x3d3e2f[_0x0f3b('0x0')]||'';this[_0x0f3b('0x1')]=_0x3d3e2f[_0x0f3b('0x1')]||'';this[_0x0f3b('0x2')]=_0x3d3e2f[_0x0f3b('0x2')]||'';this[_0x0f3b('0x3')]=_0x3d3e2f['token']||'';this['remoteUri']=_0x3d3e2f['remoteUri']||'';this[_0x0f3b('0x4')]=_0x3d3e2f[_0x0f3b('0x4')]||'';this[_0x0f3b('0x5')]=_0x3d3e2f[_0x0f3b('0x5')]||_0x0f3b('0x6');this['serverUrl']=_0x3d3e2f[_0x0f3b('0x7')]||'';this[_0x0f3b('0x8')]=_0x3d3e2f['Configurations']||{};}module[_0x0f3b('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x1c24=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x4e6c92,_0x38e552){var _0x3589ad=function(_0x20a2b5){while(--_0x20a2b5){_0x4e6c92['push'](_0x4e6c92['shift']());}};_0x3589ad(++_0x38e552);}(_0x1c24,0xca));var _0x41c2=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x1c24[_0x164eca];return _0x2ce562;};'use strict';function ZendeskAccount(_0xbb72cc){this['id']=_0xbb72cc['id']||0x0;this['name']=_0xbb72cc[_0x41c2('0x0')]||'';this[_0x41c2('0x1')]=_0xbb72cc['username']||'';this['password']=_0xbb72cc[_0x41c2('0x2')]||'';this['token']=_0xbb72cc[_0x41c2('0x3')]||'';this[_0x41c2('0x4')]=_0xbb72cc[_0x41c2('0x4')]||'';this[_0x41c2('0x5')]=_0xbb72cc[_0x41c2('0x5')]||'';this[_0x41c2('0x6')]=_0xbb72cc['type']||_0x41c2('0x7');this[_0x41c2('0x8')]=_0xbb72cc[_0x41c2('0x8')]||'';this[_0x41c2('0x9')]=_0xbb72cc[_0x41c2('0x9')]||{};}module[_0x41c2('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index f2309c4..3498e3b 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 _0xfafd=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','description','host','zone','clientId'];(function(_0x5dc250,_0x4bb4e8){var _0x583f06=function(_0xbb7c75){while(--_0xbb7c75){_0x5dc250['push'](_0x5dc250['shift']());}};_0x583f06(++_0x4bb4e8);}(_0xfafd,0x6a));var _0xdfaf=function(_0x541dc6,_0x38f354){_0x541dc6=_0x541dc6-0x0;var _0x37d7cf=_0xfafd[_0x541dc6];return _0x37d7cf;};'use strict';function ZohoAccount(_0x24131c){this['id']=_0x24131c['id']||0x0;this['name']=_0x24131c['name']||'';this[_0xdfaf('0x0')]=_0x24131c['description']||'';this['host']=_0x24131c[_0xdfaf('0x1')]||'';this['zone']=_0x24131c[_0xdfaf('0x2')]||'';this['clientId']=_0x24131c[_0xdfaf('0x3')]||'';this['clientSecret']=_0x24131c[_0xdfaf('0x4')]||'';this[_0xdfaf('0x5')]=_0x24131c[_0xdfaf('0x5')]||'';this[_0xdfaf('0x6')]=_0x24131c['code']||'';this['refreshToken']=_0x24131c[_0xdfaf('0x7')]||'';this[_0xdfaf('0x8')]=_0x24131c[_0xdfaf('0x8')]||{};}module[_0xdfaf('0x9')]=ZohoAccount; \ No newline at end of file +var _0x02c4=['description','host','zone','clientId','clientSecret','serverUrl','refreshToken','Configurations','name'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x02c4,0x6b));var _0x402c=function(_0x343b97,_0x4407ec){_0x343b97=_0x343b97-0x0;var _0x508e6f=_0x02c4[_0x343b97];return _0x508e6f;};'use strict';function ZohoAccount(_0x3d549e){this['id']=_0x3d549e['id']||0x0;this[_0x402c('0x0')]=_0x3d549e[_0x402c('0x0')]||'';this[_0x402c('0x1')]=_0x3d549e[_0x402c('0x1')]||'';this[_0x402c('0x2')]=_0x3d549e['host']||'';this[_0x402c('0x3')]=_0x3d549e[_0x402c('0x3')]||'';this[_0x402c('0x4')]=_0x3d549e['clientId']||'';this[_0x402c('0x5')]=_0x3d549e[_0x402c('0x5')]||'';this[_0x402c('0x6')]=_0x3d549e[_0x402c('0x6')]||'';this['code']=_0x3d549e['code']||'';this['refreshToken']=_0x3d549e[_0x402c('0x7')]||'';this[_0x402c('0x8')]=_0x3d549e[_0x402c('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 84f58fc..2bffd43 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 _0x6c4e=['moment','string','isNil','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports'];(function(_0x307636,_0x486844){var _0x48c987=function(_0x495810){while(--_0x495810){_0x307636['push'](_0x307636['shift']());}};_0x48c987(++_0x486844);}(_0x6c4e,0x158));var _0xe6c4=function(_0x5132ea,_0x4f1ba9){_0x5132ea=_0x5132ea-0x0;var _0xa06310=_0x6c4e[_0x5132ea];return _0xa06310;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe6c4('0x0'));function checkNameSurname(_0x2b5b60,_0x3991f1,_0x2c94bd){var _0x4ea2ea='';if(!_['isNil'](_0x3991f1)&&_0xe6c4('0x1')===typeof _0x3991f1){_0x4ea2ea+=_0x3991f1;}if(!_[_0xe6c4('0x2')](_0x2c94bd)&&_0xe6c4('0x1')===typeof _0x2c94bd){_0x4ea2ea+='\x20'+_0x2c94bd;}if(_0x4ea2ea!==''){return _0x4ea2ea;}return _0x2b5b60;}function Action(_0x8a9e4,_0x158a0f,_0x427a47,_0x994c6,_0x66b3bb){this['uniqueid']=_0x427a47||undefined;this[_0xe6c4('0x3')]=_0x8a9e4['id'];this[_0xe6c4('0x4')]=_0x158a0f[_0xe6c4('0x5')];this[_0xe6c4('0x6')]=_0x158a0f[_0xe6c4('0x6')];this[_0xe6c4('0x7')]=_0xe6c4('0x4');this['dialAnswer']=![];this[_0xe6c4('0x8')]=_[_0xe6c4('0x2')](_0x8a9e4['Agent'])?undefined:_0x8a9e4[_0xe6c4('0x9')][_0xe6c4('0x5')];this[_0xe6c4('0xa')]=this['membername']?util[_0xe6c4('0xb')](_0xe6c4('0xc'),this[_0xe6c4('0x8')]):_0x994c6||undefined;this[_0xe6c4('0xd')]=checkNameSurname(_0x8a9e4[_0xe6c4('0xe')][_0xe6c4('0xf')],_0x8a9e4['Contact'][_0xe6c4('0x10')],_0x8a9e4[_0xe6c4('0xe')]['lastName']);this[_0xe6c4('0x11')]=_0x8a9e4[_0xe6c4('0x11')]||![];this[_0xe6c4('0x12')]=_0x8a9e4[_0xe6c4('0xe')][_0xe6c4('0xf')];this[_0xe6c4('0x13')]=_0x8a9e4['scheduledat'];this[_0xe6c4('0x14')]=_0x8a9e4[_0xe6c4('0x14')]||0x0;this[_0xe6c4('0x15')]=_0x8a9e4[_0xe6c4('0x15')]||0x0;this[_0xe6c4('0x16')]=_0x8a9e4['countnoanswerretry']||0x0;this[_0xe6c4('0x17')]=(_0x8a9e4[_0xe6c4('0x14')]||0x0)+(_0x8a9e4[_0xe6c4('0x15')]||0x0)+(_0x8a9e4[_0xe6c4('0x16')]||0x0)+(_0x8a9e4[_0xe6c4('0x18')]||0x0)+(_0x8a9e4['countdropretry']||0x0)+(_0x8a9e4[_0xe6c4('0x19')]||0x0)+(_0x8a9e4[_0xe6c4('0x1a')]||0x0)+(_0x8a9e4[_0xe6c4('0x1b')]||0x0);this[_0xe6c4('0x18')]=_0x8a9e4[_0xe6c4('0x18')]||0x0;this[_0xe6c4('0x1c')]=_0x8a9e4[_0xe6c4('0x1c')]||0x0;this[_0xe6c4('0x19')]=_0x8a9e4[_0xe6c4('0x19')]||0x0;this[_0xe6c4('0x1a')]=_0x8a9e4[_0xe6c4('0x1a')]||0x0;this['countagentrejectretry']=_0x8a9e4[_0xe6c4('0x1b')]||0x0;this[_0xe6c4('0x1d')]=_0x8a9e4[_0xe6c4('0x1d')];this['callbackuniqueid']=_0x8a9e4[_0xe6c4('0x1e')];this[_0xe6c4('0x1f')]=_0x8a9e4[_0xe6c4('0x1f')];this['recallme']=_0x8a9e4[_0xe6c4('0x20')];this[_0xe6c4('0x21')]=_0x8a9e4[_0xe6c4('0x21')];this['ListId']=_0x8a9e4[_0xe6c4('0x22')];this[_0xe6c4('0x23')]=_['isNil'](_0x8a9e4['Agent'])?_0x8a9e4[_0xe6c4('0x23')]:_0x8a9e4['Agent']['id'];this[_0xe6c4('0x24')]=_0x8a9e4[_0xe6c4('0x24')];this['originatecalleridnum']='';this[_0xe6c4('0x25')]='';}Action[_0xe6c4('0x26')][_0xe6c4('0x27')]=function(){return util[_0xe6c4('0xb')](_0xe6c4('0x28'),this[_0xe6c4('0xd')],this[_0xe6c4('0x29')]);};module[_0xe6c4('0x2a')]=Action; \ No newline at end of file +var _0xe5f1=['SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','util','moment','isNil','idContact','name','type','queue','channelAgent','membername','format'];(function(_0x37b851,_0x469969){var _0x574599=function(_0x4e6ab8){while(--_0x4e6ab8){_0x37b851['push'](_0x37b851['shift']());}};_0x574599(++_0x469969);}(_0xe5f1,0x18d));var _0x1e5f=function(_0xe5f3ad,_0x355acd){_0xe5f3ad=_0xe5f3ad-0x0;var _0x930256=_0xe5f1[_0xe5f3ad];return _0x930256;};'use strict';var util=require(_0x1e5f('0x0'));var _=require('lodash');var moment=require(_0x1e5f('0x1'));function checkNameSurname(_0x5141fa,_0x4f477a,_0x38ca19){var _0x15a09c='';if(!_[_0x1e5f('0x2')](_0x4f477a)&&'string'===typeof _0x4f477a){_0x15a09c+=_0x4f477a;}if(!_['isNil'](_0x38ca19)&&'string'===typeof _0x38ca19){_0x15a09c+='\x20'+_0x38ca19;}if(_0x15a09c!==''){return _0x15a09c;}return _0x5141fa;}function Action(_0x24c68d,_0x208e25,_0x467772,_0xa1af57,_0x52d44c){this['uniqueid']=_0x467772||undefined;this[_0x1e5f('0x3')]=_0x24c68d['id'];this['queue']=_0x208e25[_0x1e5f('0x4')];this[_0x1e5f('0x5')]=_0x208e25[_0x1e5f('0x5')];this['campaigntype']=_0x1e5f('0x6');this['dialAnswer']=![];this['membername']=_[_0x1e5f('0x2')](_0x24c68d['Agent'])?undefined:_0x24c68d['Agent'][_0x1e5f('0x4')];this[_0x1e5f('0x7')]=this[_0x1e5f('0x8')]?util[_0x1e5f('0x9')](_0x1e5f('0xa'),this[_0x1e5f('0x8')]):_0xa1af57||undefined;this[_0x1e5f('0xb')]=checkNameSurname(_0x24c68d['Contact'][_0x1e5f('0xc')],_0x24c68d[_0x1e5f('0xd')]['firstName'],_0x24c68d['Contact']['lastName']);this[_0x1e5f('0xe')]=_0x24c68d[_0x1e5f('0xe')]||![];this[_0x1e5f('0xf')]=_0x24c68d[_0x1e5f('0xd')][_0x1e5f('0xc')];this[_0x1e5f('0x10')]=_0x24c68d['scheduledat'];this['countbusyretry']=_0x24c68d[_0x1e5f('0x11')]||0x0;this[_0x1e5f('0x12')]=_0x24c68d[_0x1e5f('0x12')]||0x0;this[_0x1e5f('0x13')]=_0x24c68d['countnoanswerretry']||0x0;this['countglobal']=(_0x24c68d[_0x1e5f('0x11')]||0x0)+(_0x24c68d['countcongestionretry']||0x0)+(_0x24c68d[_0x1e5f('0x13')]||0x0)+(_0x24c68d[_0x1e5f('0x14')]||0x0)+(_0x24c68d['countdropretry']||0x0)+(_0x24c68d[_0x1e5f('0x15')]||0x0)+(_0x24c68d['countmachineretry']||0x0)+(_0x24c68d['countagentrejectretry']||0x0);this[_0x1e5f('0x14')]=_0x24c68d[_0x1e5f('0x14')]||0x0;this[_0x1e5f('0x16')]=_0x24c68d[_0x1e5f('0x16')]||0x0;this[_0x1e5f('0x15')]=_0x24c68d['countabandonedretry']||0x0;this[_0x1e5f('0x17')]=_0x24c68d[_0x1e5f('0x17')]||0x0;this[_0x1e5f('0x18')]=_0x24c68d[_0x1e5f('0x18')]||0x0;this['callback']=_0x24c68d['callback'];this[_0x1e5f('0x19')]=_0x24c68d[_0x1e5f('0x19')];this[_0x1e5f('0x1a')]=_0x24c68d[_0x1e5f('0x1a')];this[_0x1e5f('0x1b')]=_0x24c68d[_0x1e5f('0x1b')];this[_0x1e5f('0x1c')]=_0x24c68d['ContactId'];this[_0x1e5f('0x1d')]=_0x24c68d[_0x1e5f('0x1d')];this[_0x1e5f('0x1e')]=_[_0x1e5f('0x2')](_0x24c68d[_0x1e5f('0x1f')])?_0x24c68d[_0x1e5f('0x1e')]:_0x24c68d[_0x1e5f('0x1f')]['id'];this[_0x1e5f('0x20')]=_0x24c68d[_0x1e5f('0x20')];this[_0x1e5f('0x21')]='';this[_0x1e5f('0x22')]='';}Action['prototype']['getCaller']=function(){return util[_0x1e5f('0x9')](_0x1e5f('0x23'),this[_0x1e5f('0xb')],this[_0x1e5f('0x24')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index fb80686..5baa393 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 _0xb559=['getContactRecallMe','agentReadyId','then','isNil','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','channelAgent','calleridnum','user:%s','user:agentconnect','accountcode','[originateFailure][logOriginateFailure]','syncNewExten','syncOriginateResponse','actionid','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','variables','filterKey','keys','addVariable','value','error','[syncVarSet][Preview]','inspect','syncBlindTransfer','transfererlinkedid','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hanguprequest','syncHangupRequest','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','[clearZombieChannels][talking]','queue','originated:\x20','pTalking','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','message','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','clearZombieChannel'];(function(_0x5ef92b,_0x1bcdc7){var _0x4f2dbf=function(_0x56c0d9){while(--_0x56c0d9){_0x5ef92b['push'](_0x5ef92b['shift']());}};_0x4f2dbf(++_0x1bcdc7);}(_0xb559,0xdb));var _0x9b55=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0xb559[_0x2831cf];return _0x5ec206;};'use strict';var util=require('util');var _=require(_0x9b55('0x0'));var BPromise=require(_0x9b55('0x1'));var uuid=require(_0x9b55('0x2'));var moment=require(_0x9b55('0x3'));var md5=require(_0x9b55('0x4'));var Redis=require(_0x9b55('0x5'));var config=require('../../../config/environment');var logger=require(_0x9b55('0x6'))(_0x9b55('0x7'));var loggerAction=require('../../../config/logger')(_0x9b55('0x8'));var ami=require(_0x9b55('0x9'));var rpcDb=require(_0x9b55('0xa'));var Action=require('./action');var ut=require(_0x9b55('0xb'));config[_0x9b55('0xc')]=_[_0x9b55('0xd')](config['redis'],{'host':_0x9b55('0xe'),'port':0x18eb});var io=require(_0x9b55('0xf'))(new Redis(config[_0x9b55('0xc')]));var Sequence=function(){};Sequence[_0x9b55('0x10')][_0x9b55('0x11')]=function(_0x3a047b){this['tail']=this['tail']?this[_0x9b55('0x12')]['finally'](_0x3a047b):_0x3a047b();};function Preview(_0x3266da){this[_0x9b55('0x13')]=new Sequence();this[_0x9b55('0x14')]=_0x3266da['voiceQueues'];this[_0x9b55('0x15')]=_0x3266da[_0x9b55('0x15')];this[_0x9b55('0x16')]={};this[_0x9b55('0x17')]=_0x3266da['agents'];this[_0x9b55('0x18')]=0x0;ami['on'](_0x9b55('0x19'),this['syncOriginateResponse'][_0x9b55('0x1a')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x9b55('0x1b'),this[_0x9b55('0x1c')][_0x9b55('0x1a')](this));ami['on']('dialend',this['syncDialEnd'][_0x9b55('0x1a')](this));ami['on'](_0x9b55('0x1d'),this['syncNewExten'][_0x9b55('0x1a')](this));ami['on'](_0x9b55('0x1e'),this[_0x9b55('0x1f')][_0x9b55('0x1a')](this));ami['on']('attendedtransfer',this[_0x9b55('0x20')][_0x9b55('0x1a')](this));ami['on'](_0x9b55('0x21'),this['syncBlindTransfer'][_0x9b55('0x1a')](this));this[_0x9b55('0x22')](this[_0x9b55('0x14')]);}function emit(_0x54a69e,_0x265c06,_0x2f14f4){io['to'](_0x54a69e)[_0x9b55('0x23')](_0x265c06,_0x2f14f4);}function emitCampaignPreview(_0x599868){if(_0x599868[_0x9b55('0x24')]===_0x9b55('0x25')){var _0x378b65={'id':_0x599868['id'],'name':_0x599868[_0x9b55('0x26')],'strategy':_0x599868['strategy'],'answered':_0x599868['answered'],'available':_0x599868[_0x9b55('0x27')],'loggedIn':_0x599868['loggedIn'],'pTalking':_0x599868['pTalking'],'sumBillable':_0x599868[_0x9b55('0x28')],'sumDuration':_0x599868[_0x9b55('0x29')],'sumHoldTime':_0x599868[_0x9b55('0x2a')]||0x0,'talking':_0x599868['talking'],'total':_0x599868[_0x9b55('0x2b')],'type':_0x599868[_0x9b55('0x24')],'unmanaged':_0x599868[_0x9b55('0x2c')],'abandoned':_0x599868[_0x9b55('0x2d')],'waiting':_0x599868[_0x9b55('0x2e')],'loggedInDb':_0x599868[_0x9b55('0x2f')],'dialActive':_0x599868['dialActive'],'dialMethod':_0x599868[_0x9b55('0x30')],'dialOriginateCallerIdName':_0x599868[_0x9b55('0x31')],'dialOriginateCallerIdNumber':_0x599868['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x599868['dialOriginateTimeout'],'dialPrefix':_0x599868[_0x9b55('0x32')],'outboundAnswerAgiCallsDay':_0x599868[_0x9b55('0x33')],'outboundAnswerCallsDay':_0x599868[_0x9b55('0x34')],'outboundBlacklistCallsDay':_0x599868['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x599868[_0x9b55('0x35')],'outboundCongestionCallsDay':_0x599868['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x599868[_0x9b55('0x36')],'outboundDropCallsDayCallersExit':_0x599868[_0x9b55('0x37')],'outboundDropCallsDayTimeout':_0x599868[_0x9b55('0x38')],'outboundNoAnswerCallsDay':_0x599868['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x599868[_0x9b55('0x39')],'outboundOriginateFailureCallsDay':_0x599868[_0x9b55('0x3a')],'outboundReCallsDay':_0x599868[_0x9b55('0x3b')],'outboundRejectCallsDay':_0x599868[_0x9b55('0x3c')],'outboundUnknownCallsDay':_0x599868[_0x9b55('0x3d')],'outboundAbandonedCallsDay':_0x599868[_0x9b55('0x3e')],'predictiveIntervalAnsweredCalls':_0x599868[_0x9b55('0x3f')],'predictiveIntervalAvgHoldtime':_0x599868['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x599868[_0x9b55('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x599868['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x599868['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x599868[_0x9b55('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x599868[_0x9b55('0x42')],'predictiveIntervalHitRate':_0x599868[_0x9b55('0x43')],'predictiveIntervalMultiplicativeFactor':_0x599868[_0x9b55('0x44')],'predictiveIntervalPauses':_0x599868['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x599868[_0x9b55('0x45')],'predictiveIntervalTotalCalls':_0x599868[_0x9b55('0x46')],'message':_0x599868['message'],'originated':_0x599868[_0x9b55('0x47')],'erlangCalls':_0x599868['erlangCalls'],'erlangCallToSecond':_0x599868[_0x9b55('0x48')],'erlangAbandonmentRate':_0x599868[_0x9b55('0x49')],'erlangBusyFactor':_0x599868[_0x9b55('0x4a')],'startPredictive':_0x599868[_0x9b55('0x4b')],'startProgressive':_0x599868[_0x9b55('0x4c')]};if(_0x599868['Trunk']){_0x378b65[_0x9b55('0x4d')]={'id':_0x599868[_0x9b55('0x4d')]['id'],'name':_0x599868[_0x9b55('0x4d')][_0x9b55('0x26')],'active':_0x599868[_0x9b55('0x4d')]['active'],'callerid':_0x599868[_0x9b55('0x4d')][_0x9b55('0x4e')]};}if(_0x599868[_0x9b55('0x4f')]){_0x378b65['Interval']={'id':_0x599868['Interval']['id'],'name':_0x599868['Interval'][_0x9b55('0x26')]};}var _0x45721c=md5(JSON[_0x9b55('0x50')](_0x378b65));if(_0x599868[_0x9b55('0x4')]!==_0x45721c){_0x599868[_0x9b55('0x4')]=_0x45721c;emit(util['format'](_0x9b55('0x51'),_0x378b65[_0x9b55('0x26')]),_0x9b55('0x52'),_0x378b65);}}}function emitVoiceQueueChannelRemove(_0x6b9886){logger[_0x9b55('0x53')](_0x9b55('0x54'),JSON[_0x9b55('0x50')](_0x6b9886));emit(util[_0x9b55('0x55')]('voice:queue:%s',_0x6b9886[_0x9b55('0x26')]),_0x9b55('0x56'),_0x6b9886);io['emit'](_0x9b55('0x57'),_0x6b9886);}function notSendMessagesQueue(_0x4799a9){if(_0x4799a9['sendMessageOneNotActive']){if(_0x4799a9[_0x9b55('0x47')]===0x0&&_0x4799a9['pTalking']===0x0){_0x4799a9[_0x9b55('0x58')]=![];_0x4799a9['available']=0x0;_0x4799a9[_0x9b55('0x59')]=0x0;_0x4799a9['message']=_0x9b55('0x5a');ut[_0x9b55('0x5b')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4799a9[_0x9b55('0x26')]+'\x20is\x20not\x20active');}else{_0x4799a9['message']=_0x9b55('0x5c');ut[_0x9b55('0x5b')](_0x9b55('0x5d'),_0x4799a9[_0x9b55('0x26')]+_0x9b55('0x5e'));}emitCampaignPreview(_0x4799a9);}}Preview[_0x9b55('0x10')][_0x9b55('0x22')]=function(){var _0x4f7c05=this;setInterval(function(){_0x4f7c05['syncCampaigns']();},0x7cf);};Preview[_0x9b55('0x10')][_0x9b55('0x5f')]=function(){var _0x5efed9=this[_0x9b55('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x3e2205 in _0x5efed9){if(_0x5efed9[_0x9b55('0x60')](_0x3e2205)&&(_0x5efed9[_0x3e2205][_0x9b55('0x30')]===_0x9b55('0x7')||_0x5efed9[_0x3e2205][_0x9b55('0x30')]===_0x9b55('0x61'))&&_0x5efed9[_0x3e2205][_0x9b55('0x24')]===_0x9b55('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0x9b55('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x5efed9[_0x9b55('0x60')](_0x3e2205)&&_0x5efed9[_0x3e2205][_0x9b55('0x30')]===_0x9b55('0x7')&&_0x5efed9[_0x3e2205]['type']==='outbound'){if(_0x5efed9[_0x3e2205]['dialActive']){this[_0x9b55('0x62')](_0x5efed9[_0x3e2205]);this[_0x9b55('0x63')](_0x5efed9[_0x3e2205]);}else{notSendMessagesQueue(_0x5efed9[_0x3e2205]);}}}};Preview[_0x9b55('0x10')]['clearZombieChannel']=function(_0x17f6bb){var _0x44d447=this;this['sequence'][_0x9b55('0x11')](function(){if(!_['isNil'](_0x44d447[_0x9b55('0x16')][_0x17f6bb])){loggerAction[_0x9b55('0x53')](_0x9b55('0x64'),_0x17f6bb,'Queue',_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x65')],_0x9b55('0x66'),JSON[_0x9b55('0x50')](_0x44d447[_0x9b55('0x14')][_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x65')]]['originated']),'pTalking:\x20',JSON['stringify'](_0x44d447[_0x9b55('0x14')][_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x65')]][_0x9b55('0x67')]),JSON[_0x9b55('0x50')](_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x68')]),JSON[_0x9b55('0x50')](_[_0x9b55('0x69')](_0x44d447[_0x9b55('0x16')][_0x17f6bb],[_0x9b55('0x6a'),_0x9b55('0x6b'),_0x9b55('0x6c'),_0x9b55('0x6d')])));return ami['Action']({'action':_0x9b55('0x6e'),'channel':_0x44d447['actions'][_0x17f6bb][_0x9b55('0x6f')]})[_0x9b55('0x70')](function(_0x3ddabf){if(_0x3ddabf[_0x9b55('0x71')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x44d447['actions'][_0x17f6bb]){ut['updateOriginated'](_0x44d447['campaignsPreview'][_0x44d447['actions'][_0x17f6bb][_0x9b55('0x65')]],_0x9b55('0x72'));if(_0x44d447[_0x9b55('0x16')][_0x17f6bb]['dialAnswer']===!![]){ut[_0x9b55('0x73')](_0x44d447[_0x9b55('0x14')][_0x44d447['actions'][_0x17f6bb][_0x9b55('0x65')]],_0x9b55('0x72'));ut['loggerError'](_0x9b55('0x74')+_0x17f6bb,_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x65')]);}ut[_0x9b55('0x75')](_0x9b55('0x76')+_0x17f6bb,_0x44d447[_0x9b55('0x16')][_0x17f6bb][_0x9b55('0x65')]);delete _0x44d447[_0x9b55('0x16')][_0x17f6bb];}},0x2328);}});}});};Preview[_0x9b55('0x10')][_0x9b55('0x77')]=function(){var _0x345b1c=this;loggerAction['info'](_0x9b55('0x78'),_['size'](this[_0x9b55('0x16')]));for(var _0x5e535c in this[_0x9b55('0x16')]){if(_0x345b1c[_0x9b55('0x16')][_0x9b55('0x60')](_0x5e535c)){_0x345b1c[_0x9b55('0x79')](_0x5e535c);}}};Preview[_0x9b55('0x10')][_0x9b55('0x63')]=function(_0x2636dc){var _0x2a77a5=this;rpcDb[_0x9b55('0x7a')](_0x2636dc['id'],ut[_0x9b55('0x7b')](this['agents']))[_0x9b55('0x7c')](function(_0x42c39c){if(!_[_0x9b55('0x7d')](_0x42c39c)){for(var _0x2e6a89=0x0;_0x2e6a89<_0x42c39c['length'];_0x2e6a89+=0x1){if(ut['getDiff'](_0x42c39c[_0x2e6a89][_0x9b55('0x7e')])<_0x2636dc['dialRecallMeTimeout']*0x3c){if(_0x42c39c[_0x2e6a89][_0x9b55('0x7f')]&&!_0x42c39c[_0x2e6a89][_0x9b55('0x7f')][_0x9b55('0x80')]){_0x2a77a5[_0x9b55('0x81')](_0x42c39c[_0x2e6a89]['id'])[_0x9b55('0x7c')](ut[_0x9b55('0x82')](_0x9b55('0x83')))['catch'](ut[_0x9b55('0x82')]('[RecallMe]'));}else{rpcDb[_0x9b55('0x84')](_0x42c39c[_0x2e6a89]['id']);}}else{var _0x534b46=new Action(_0x42c39c[_0x2e6a89],_0x2636dc);_0x534b46[_0x9b55('0x85')]=moment()['format'](_0x9b55('0x86'));_0x2636dc[_0x9b55('0x3b')]+=0x1;ut[_0x9b55('0x87')](_0x534b46,0x17,'RecallInQueue');if(_0x2636dc[_0x9b55('0x88')]){rpcDb[_0x9b55('0x89')](ut[_0x9b55('0x8a')](_0x42c39c[_0x2e6a89]));rpcDb['createCustomerHistory'](_0x534b46,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x9b55('0x87')](_0x534b46,0x16,_0x9b55('0x8b'));rpcDb['createCustomerHistory'](_0x534b46,_0x9b55('0x8c'));rpcDb[_0x9b55('0x8d')](_0x534b46,_0x9b55('0x8c'));}}}}})[_0x9b55('0x70')](ut['logger2']('[getContactRecallMe]'));};Preview[_0x9b55('0x10')][_0x9b55('0x62')]=function(_0x3befbd){_0x3befbd['sendMessageOneNotActive']=!![];if(ut[_0x9b55('0x8e')](_0x3befbd['loggedIn'])){_0x3befbd[_0x9b55('0x71')]=_0x9b55('0x8f');}else if(!ut[_0x9b55('0x90')](_0x3befbd[_0x9b55('0x91')])){_0x3befbd[_0x9b55('0x71')]=_0x9b55('0x5a');}else if(!this[_0x9b55('0x92')](_0x3befbd[_0x9b55('0x4d')])){if(!this['isTrunkReachable'](_0x3befbd[_0x9b55('0x93')])){_0x3befbd['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x3befbd['message']='ACTIVE';}}else{_0x3befbd[_0x9b55('0x71')]=_0x9b55('0x94');}emitCampaignPreview(_0x3befbd);};Preview[_0x9b55('0x10')][_0x9b55('0x95')]=function(_0x3d66dc,_0x1dc19a,_0x26e112){var _0x37ae4f=this;var _0x56c7a5=this['actions'][_0x1dc19a];var _0x538f07=this[_0x9b55('0x14')][_0x56c7a5[_0x9b55('0x65')]];var _0x1f05d0;if(_0x538f07){switch(_0x26e112){case'1':_0x538f07['outboundNoSuchCallsDay']+=0x1;_0x56c7a5['countnosuchnumberretry']+=0x1;_0x56c7a5['countglobal']=ut[_0x9b55('0x96')](_0x56c7a5);ut['logCustomer'](_0x56c7a5,0x0,'NoSuchNumber');ami['emit'](_0x9b55('0x97'),ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0x99')));rpcDb[_0x9b55('0x9a')](_0x56c7a5,_0x9b55('0x9b'));if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07['dialGlobalMaxRetry']){_0x1f05d0=ut[_0x9b55('0x9c')](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0x9e'));}else{if(_0x56c7a5[_0x9b55('0x9f')]>=_0x538f07[_0x9b55('0xa0')]){rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0x9e'));}else{rpcDb['rescheduleContact'](ut[_0x9b55('0xa1')](_0x56c7a5,_0x9b55('0x9f'),_0x538f07[_0x9b55('0xa2')]),_0x56c7a5['unlockAgent'],_0x56c7a5[_0x9b55('0xa3')]);}}delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xa4')]];break;case'ANSWER':var _0x589004=moment()['format'](_0x9b55('0x86'));_0x56c7a5['responsetime']=_0x589004;_0x56c7a5['answertime']=_0x589004;_0x56c7a5['dialAnswer']=!![];_0x538f07['pTalking']+=0x1;logger['info'](_0x9b55('0xa5'),_0x56c7a5[_0x9b55('0xa6')],_0x9b55('0xa7'),_0x538f07[_0x9b55('0x26')],_0x9b55('0xa8'),_0x538f07[_0x9b55('0x67')]);ami[_0x9b55('0x23')]('custom:agentconnect',ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0xa9'),this[_0x9b55('0x14')][_0x56c7a5[_0x9b55('0x65')]]));if(_0x538f07[_0x9b55('0xaa')]){ami[_0x9b55('0x23')](_0x9b55('0xab'),ut['buildAcw'](_0x56c7a5));}break;case'16':ami['emit'](_0x9b55('0xac'),ut[_0x9b55('0x98')](_0x56c7a5,'complete',this[_0x9b55('0x14')][_0x56c7a5['queue']]));emitVoiceQueueChannelRemove(ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0xad')));_0x538f07[_0x9b55('0x34')]+=0x1;_0x538f07[_0x9b55('0x2b')]+=0x1;_0x538f07[_0x9b55('0xae')]+=0x1;ut['decrementTalkink'](_0x538f07,_0x9b55('0xaf'));_0x56c7a5[_0x9b55('0xb0')]=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x4,_0x9b55('0xb1'));rpcDb['createCustomerHistory'](_0x56c7a5,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xb2'));rpcDb[_0x9b55('0xb3')](_0x56c7a5);_0x538f07[_0x9b55('0x29')]+=_0x56c7a5[_0x9b55('0xb4')];_0x538f07[_0x9b55('0x28')]+=_0x56c7a5[_0x9b55('0xb4')];logger[_0x9b55('0x53')](_0x9b55('0xb5'),_0x56c7a5[_0x9b55('0xa6')],_0x9b55('0xa7'),_0x538f07[_0x9b55('0x26')],_0x9b55('0xa8'),_0x538f07[_0x9b55('0x67')]);delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xa4')]];break;case _0x9b55('0xb6'):_0x538f07[_0x9b55('0x35')]+=0x1;_0x56c7a5[_0x9b55('0xb7')]+=0x1;_0x56c7a5['countglobal']=ut['totalGlobal'](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x5,'Busy');ami[_0x9b55('0x23')](_0x9b55('0xb8'),ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0xb9')));rpcDb['createCustomerHistory'](_0x56c7a5,_0x9b55('0xba'));if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut['cloneAction'](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb['createCustomerFinal'](_0x1f05d0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x56c7a5[_0x9b55('0xb7')]>=_0x538f07['dialBusyMaxRetry']){rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xba'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x56c7a5,_0x9b55('0xb7'),_0x538f07[_0x9b55('0xbc')]),_0x56c7a5[_0x9b55('0xbd')],_0x56c7a5[_0x9b55('0xa3')]);}}break;case _0x9b55('0xbe'):_0x538f07[_0x9b55('0xbf')]+=0x1;_0x56c7a5[_0x9b55('0xc0')]+=0x1;_0x56c7a5[_0x9b55('0xb0')]=ut['totalGlobal'](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x3,_0x9b55('0xc1'));ami[_0x9b55('0x23')]('custom:agentnoanswer',ut[_0x9b55('0x98')](_0x56c7a5,'noanswer'));rpcDb['createCustomerHistory'](_0x56c7a5,_0x9b55('0xc2'));if(ut['totalGlobal'](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut[_0x9b55('0x9c')](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xc3'));}else{if(_0x56c7a5[_0x9b55('0xc0')]>=_0x538f07[_0x9b55('0xc4')]){rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xc2'));}else{rpcDb[_0x9b55('0xc5')](ut['scheduledAt'](_0x56c7a5,_0x9b55('0xc0'),_0x538f07['dialNoAnswerRetryFrequency']),_0x56c7a5[_0x9b55('0xbd')],_0x56c7a5[_0x9b55('0xa3')]);}}break;case'CONGESTION':_0x538f07[_0x9b55('0xc6')]+=0x1;_0x56c7a5[_0x9b55('0xc7')]+=0x1;_0x56c7a5[_0x9b55('0xb0')]=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x8,_0x9b55('0xc8'));ami[_0x9b55('0x23')](_0x9b55('0xc9'),ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0xca')));rpcDb[_0x9b55('0x9a')](_0x56c7a5,_0x9b55('0xcb'));if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut['cloneAction'](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xcc'));}else{if(_0x56c7a5[_0x9b55('0xc7')]>=_0x538f07[_0x9b55('0xcd')]){rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xcb'));}else{rpcDb[_0x9b55('0xc5')](ut[_0x9b55('0xa1')](_0x56c7a5,_0x9b55('0xc7'),_0x538f07[_0x9b55('0xbc')]),_0x56c7a5[_0x9b55('0xbd')],_0x56c7a5[_0x9b55('0xa3')]);}}break;case _0x9b55('0xce'):_0x538f07['outboundRejectCallsDay']+=0x1;_0x56c7a5[_0x9b55('0xcf')]+=0x1;_0x56c7a5[_0x9b55('0xb0')]=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x14,_0x9b55('0xd0'));ami['emit'](_0x9b55('0xd1'),ut[_0x9b55('0x98')](_0x56c7a5,_0x9b55('0xd2')));rpcDb[_0x9b55('0x9a')](_0x56c7a5,'[syncHangupRequest][logAgentReject]');if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07['dialGlobalMaxRetry']){_0x1f05d0=ut[_0x9b55('0x9c')](_0x56c7a5,0x14,_0x9b55('0xd0'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xd3'));}else{if(_0x56c7a5[_0x9b55('0xcf')]>=_0x538f07[_0x9b55('0xd4')]){rpcDb['createCustomerFinal'](_0x56c7a5,_0x9b55('0xd3'));}else{rpcDb[_0x9b55('0xc5')](ut[_0x9b55('0xa1')](_0x56c7a5,'countagentrejectretry',_0x538f07[_0x9b55('0xd5')]),_0x56c7a5[_0x9b55('0xbd')],_0x56c7a5[_0x9b55('0xa3')]);}}break;case _0x9b55('0xd6'):_0x538f07[_0x9b55('0x3e')]+=0x1;_0x56c7a5[_0x9b55('0xd7')]+=0x1;_0x56c7a5['countglobal']=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0xb,_0x9b55('0xd8'));rpcDb['createCustomerHistory'](_0x56c7a5,_0x9b55('0xd9'));if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut['cloneAction'](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xd9'));}else{if(_0x56c7a5[_0x9b55('0xda')]>=_0x538f07['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x56c7a5,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x9b55('0xa1')](_0x56c7a5,_0x9b55('0xd7'),_0x538f07[_0x9b55('0xdb')]),_0x56c7a5[_0x9b55('0xbd')],_0x56c7a5['activeContact']);}}break;case'18':_0x538f07[_0x9b55('0x3d')]+=0x1;_0x56c7a5[_0x9b55('0xdc')]+=0x1;_0x56c7a5['countglobal']=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x12,_0x3d66dc[_0x9b55('0xdd')]||_0x3d66dc[_0x9b55('0xde')]);ami['emit'](_0x9b55('0xdf'),ut[_0x9b55('0x98')](_0x56c7a5,'amd'));rpcDb['createCustomerHistory'](_0x56c7a5,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut[_0x9b55('0x9c')](_0x56c7a5,0xf,'Global');rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xe0'));}else{rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xe0'));}delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xa4')]];break;case'19':_0x538f07[_0x9b55('0x3d')]+=0x1;_0x56c7a5[_0x9b55('0xb0')]=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0x13,_0x3d66dc[_0x9b55('0xdd')]||_0x3d66dc['dialstatus']);ami[_0x9b55('0x23')]('custom:amd',ut['buildObj'](_0x56c7a5,_0x9b55('0xe1')));rpcDb[_0x9b55('0x9a')](_0x56c7a5,'[callProgressDetectingCustomer][machine]');if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut[_0x9b55('0x9c')](_0x56c7a5,0xf,'Global');rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xe2'));}else{rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xe2'));}delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xa4')]];break;default:if(_0x56c7a5['dialAnswer']){ut[_0x9b55('0x73')](_0x538f07,_0x9b55('0xe3'));ut[_0x9b55('0x75')](_0x9b55('0xe4')+_0x538f07['name'],_0x3d66dc);}_0x538f07[_0x9b55('0x3d')]+=0x1;_0x56c7a5[_0x9b55('0xb0')]=ut[_0x9b55('0x96')](_0x56c7a5);ut[_0x9b55('0x87')](_0x56c7a5,0xc,_0x3d66dc[_0x9b55('0xdd')]||_0x3d66dc[_0x9b55('0xde')]);rpcDb[_0x9b55('0x9a')](_0x56c7a5,_0x9b55('0xe5'));if(ut[_0x9b55('0x96')](_0x56c7a5)>=_0x538f07[_0x9b55('0xbb')]){_0x1f05d0=ut['cloneAction'](_0x56c7a5,0xf,_0x9b55('0x9d'));rpcDb[_0x9b55('0x8d')](_0x1f05d0,_0x9b55('0xe6'));}else{rpcDb[_0x9b55('0x8d')](_0x56c7a5,_0x9b55('0xe6'));}delete this['actions'][_0x3d66dc[_0x9b55('0xa4')]];}if(!(_0x56c7a5[_0x9b55('0x68')]&&_0x26e112==='16')){ut[_0x9b55('0xe7')](_0x538f07,_0x9b55('0xe8'));logger[_0x9b55('0x53')](_0x9b55('0xe9'),_0x56c7a5[_0x9b55('0xa6')],_0x9b55('0xa7'),_0x538f07[_0x9b55('0x26')],_0x9b55('0x66'),_0x538f07[_0x9b55('0x47')]);}if(_0x26e112!==_0x9b55('0xea')){delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xa4')]];delete this[_0x9b55('0x16')][_0x3d66dc[_0x9b55('0xeb')]];}}};Preview[_0x9b55('0x10')]['callProgressDetectingAgent']=function(_0x3ac726,_0x57f391,_0x346eb1){if(_[_0x9b55('0xec')](_0x57f391)&&_0x9b55('0xed')!==typeof _0x57f391){return;}if(_[_0x9b55('0xec')](_0x346eb1)&&_0x9b55('0xed')!==typeof _0x346eb1){return;}switch(_0x346eb1[_0x9b55('0xee')]){case'0':ut[_0x9b55('0xef')](_0x3ac726,0x0,_0x9b55('0xf0'));rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf2'));break;case'3':ut[_0x9b55('0xef')](_0x3ac726,0x3,'NoAnswer');rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf3'));break;case'5':ut[_0x9b55('0xef')](_0x3ac726,0x5,'Busy');rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf4'));break;case'8':ut[_0x9b55('0xef')](_0x3ac726,0x8,_0x9b55('0xc8'));rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf5'));break;case'22':ut[_0x9b55('0xef')](_0x3ac726,0x16,_0x9b55('0xf6'));rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf7'));break;default:ut[_0x9b55('0xef')](_0x3ac726,0xc,_0x346eb1[_0x9b55('0xee')]);rpcDb[_0x9b55('0xf1')](_0x3ac726,_0x9b55('0xf5'));}ut['updateOriginated'](_0x57f391,_0x9b55('0xf8'));logger['info'](_0x9b55('0xf9'),_0x3ac726[_0x9b55('0xa6')],_0x9b55('0xa7'),_0x57f391['name'],_0x9b55('0x66'),_0x57f391[_0x9b55('0x47')]);delete this[_0x9b55('0x16')][_0x3ac726['uniqueid']];};Preview[_0x9b55('0x10')][_0x9b55('0xfa')]=function(_0x3ec2d3,_0x4591e9,_0x2ff4e3,_0x4d57fc,_0x2394e3){var _0x10a94b=this;return new BPromise(function(_0x283fe2,_0x9cf03d){if(_[_0x9b55('0x7d')](_0x4591e9)||_[_0x9b55('0x7d')](_0x4591e9[_0x9b55('0xfb')])||_[_0x9b55('0x7d')](_0x4591e9['Contact'][_0x9b55('0xfc')])||_[_0x9b55('0x7d')](_0x4591e9[_0x9b55('0x6c')])){_0x9cf03d(ut[_0x9b55('0x71')](_0x9b55('0xfd'),_0x4d57fc,_0x2394e3));return;}var _0x106f4c=uuid['v4']();var _0x5b7c70=_0x10a94b[_0x9b55('0x14')][_0x4591e9[_0x9b55('0xfe')][_0x9b55('0x26')]];var _0x2c1e90=_0x2ff4e3?_0x10a94b[_0x9b55('0x17')][_0x2ff4e3]['id']:undefined;_0x10a94b[_0x9b55('0x16')][_0x106f4c]=new Action(_0x4591e9,_0x5b7c70,_0x106f4c,_0x2ff4e3,_0x2c1e90);var _0x46efe7=_0x10a94b[_0x9b55('0x16')][_0x106f4c];_0x46efe7[_0x9b55('0xbd')]=_0x4d57fc;_0x46efe7['activeContact']=_0x2394e3;_0x46efe7[_0x9b55('0xff')]=_0x2ff4e3;if(_[_0x9b55('0x100')](_0x3ec2d3)){_0x10a94b[_0x9b55('0x101')](_0x46efe7,_0x5b7c70,_0x4591e9,_0x2ff4e3)[_0x9b55('0x7c')](function(_0x580150){logger[_0x9b55('0x53')](_0x9b55('0x102'),_0x9b55('0x103')+_0x46efe7[_0x9b55('0x65')]+'\x20IdHopper:\x20'+_0x46efe7[_0x9b55('0x104')],JSON['stringify'](_0x580150));ami['emit'](_0x9b55('0x105'),ut[_0x9b55('0x98')](_0x46efe7,'called',_0x10a94b[_0x9b55('0x14')][_0x46efe7[_0x9b55('0x65')]]));_0x283fe2(ut[_0x9b55('0x71')](_0x9b55('0x106')));})[_0x9b55('0x70')](function(_0x2d3654){ut['logger'](_0x9b55('0x107'),_0x2d3654);_0x9cf03d(ut[_0x9b55('0x71')]('Call\x20failed',_0x4d57fc,_0x2394e3));});}else{_0x5b7c70[_0x9b55('0x108')]+=0x1;ut[_0x9b55('0x109')](_0x46efe7);rpcDb['createHistory'](_0x46efe7,'[Blacklist][error]');delete _0x10a94b[_0x9b55('0x16')][_0x106f4c];_0x9cf03d(ut[_0x9b55('0x71')](_0x9b55('0x10a'),_0x4d57fc,_0x2394e3));}});};Preview[_0x9b55('0x10')][_0x9b55('0x92')]=function(_0x94190d){return!_[_0x9b55('0x7d')](_0x94190d)&&!_[_0x9b55('0x7d')](_0x94190d[_0x9b55('0x26')])&&!_[_0x9b55('0x7d')](_0x94190d[_0x9b55('0x10b')])&&_0x94190d['active']&&!_['isNil'](this['trunks'][util[_0x9b55('0x55')]('SIP/%s',_0x94190d['name'])])&&!_[_0x9b55('0x7d')](this['trunks'][util[_0x9b55('0x55')](_0x9b55('0x10c'),_0x94190d[_0x9b55('0x26')])][_0x9b55('0x6e')])&&(this[_0x9b55('0x15')][util[_0x9b55('0x55')](_0x9b55('0x10c'),_0x94190d[_0x9b55('0x26')])]['status']==='reachable'||this['trunks'][util[_0x9b55('0x55')]('SIP/%s',_0x94190d['name'])][_0x9b55('0x6e')]===_0x9b55('0x10d'));};Preview['prototype']['run']=function(_0x4ab1da,_0x5bb7fa){var _0x3e0d2f=this;return new BPromise(function(_0xe317ae,_0x25b2a2){_0x3e0d2f[_0x9b55('0x10e')](_0x4ab1da,_0x5bb7fa)['then'](function(_0x466dc7){_0xe317ae(_[_0x9b55('0x69')](_0x466dc7,[_0x9b55('0x71')]));})[_0x9b55('0x70')](function(_0x3a9965){if(_0x3a9965[_0x9b55('0x10f')]){rpcDb[_0x9b55('0x110')](_0x4ab1da);}if(_0x3a9965['active']){rpcDb[_0x9b55('0x84')](_0x4ab1da);}_0x25b2a2(_['pick'](_0x3a9965,['message']));});});};Preview[_0x9b55('0x10')][_0x9b55('0x10e')]=function(_0x24fe1d,_0x493713){var _0x10bcf7=this;return new BPromise(function(_0x3c3aec,_0x379e3a){var _0x23870d,_0x23706a;rpcDb['getContactPreview'](_0x24fe1d)[_0x9b55('0x7c')](function(_0x49fdcc){if(!_[_0x9b55('0x7d')](_0x49fdcc[0x0])){_0x23706a=_0x49fdcc[0x0][_0x9b55('0x111')]?![]:!![];_0x23870d=_0x49fdcc[0x0][_0x9b55('0x111')]?!![]:![];_0x23870d=_0x493713?!![]:_0x23870d;}var _0x29ae85=_0x10bcf7[_0x9b55('0x112')](_0x49fdcc);if(_0x29ae85[_0x9b55('0x113')]){rpcDb[_0x9b55('0x114')](_[_0x9b55('0x69')](_0x49fdcc[0x0],[_0x9b55('0x6c'),_0x9b55('0x115')]))['then'](function(_0xbbff07){_0x10bcf7[_0x9b55('0xfa')](_0xbbff07,_0x49fdcc[0x0],_0x493713,_0x23706a,_0x23870d)[_0x9b55('0x7c')](function(_0x3c596a){_0x3c3aec(_0x3c596a);})[_0x9b55('0x70')](function(_0x35309a){_0x379e3a(_0x35309a);});})['catch'](function(_0x3be712){ut[_0x9b55('0x5b')](_0x9b55('0x116'),_0x3be712);_0x379e3a(ut['message']('Call\x20unsuccessful',_0x23706a,_0x23870d));});}else{_0x379e3a(ut[_0x9b55('0x71')](_0x29ae85[_0x9b55('0x71')],_0x23706a,_0x23870d));}})['catch'](function(_0x1ec3d9){ut[_0x9b55('0x5b')](_0x9b55('0x117'),_0x1ec3d9);_0x379e3a(ut[_0x9b55('0x71')](_0x9b55('0x118'),![],!![]));});});};Preview[_0x9b55('0x10')][_0x9b55('0x112')]=function(_0x54e893){if(_[_0x9b55('0x7d')](_0x54e893)||_[_0x9b55('0x100')](_0x54e893)||!_['isNil'](_0x54e893[0x0][_0x9b55('0x7f')])&&_['isNil'](_0x54e893[0x0][_0x9b55('0x7f')][_0x9b55('0x26')])){ut['logger'](_0x9b55('0x119'),_0x54e893);return{'isValid':![],'message':_0x9b55('0x11a')};}var _0x3a816e=this[_0x9b55('0x14')][_0x54e893[0x0][_0x9b55('0xfe')][_0x9b55('0x26')]];_0x3a816e['message']='ACTIVE';if(_['isNil'](_0x3a816e)){ut[_0x9b55('0x5b')]('[Preview][validateContact][Empty\x20Campaign]',_0x3a816e);return{'isValid':![],'message':_0x9b55('0x11b')};}if(!this[_0x9b55('0x92')](_0x3a816e[_0x9b55('0x4d')])){ut[_0x9b55('0x5b')](_0x9b55('0x11c'),_0x9b55('0x11d')+_0x3a816e[_0x9b55('0x26')]+_0x9b55('0x11e'));if(!this[_0x9b55('0x92')](_0x3a816e['TrunkBackup'])){ut[_0x9b55('0x5b')](_0x9b55('0x11c'),_0x3a816e[_0x9b55('0x26')]+_0x9b55('0x11f'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x9b55('0x90')](_0x3a816e['dialActive'])){ut[_0x9b55('0x5b')](_0x9b55('0x120'),_0x3a816e[_0x9b55('0x26')]+_0x9b55('0x121'));return{'isValid':![],'message':_0x9b55('0x11d')+_0x3a816e[_0x9b55('0x26')]+_0x9b55('0x121')};}return{'isValid':!![],'message':_0x9b55('0x122')};};Preview[_0x9b55('0x10')][_0x9b55('0x101')]=function(_0x24806f,_0x587215,_0x591462,_0x3a7fee){var _0x481ede=this;return new BPromise(function(_0x2ab8e2,_0x1c1cbc){var _0x2adf82=_0x24806f['uniqueid'];var _0x5779cb=_0x481ede['isTrunkReachable'](_0x587215[_0x9b55('0x4d')])?util[_0x9b55('0x55')](_0x9b55('0x123'),_0x587215[_0x9b55('0x4d')][_0x9b55('0x26')],_[_0x9b55('0x7d')](_0x587215['dialPrefix'])?'':_0x587215[_0x9b55('0x32')]['trim']()||'',_0x587215[_0x9b55('0x124')]>0x0?_0x591462[_0x9b55('0xfb')]['phone']['substring'](_0x587215['dialCutDigit']):_0x591462[_0x9b55('0xfb')][_0x9b55('0xfc')]):util[_0x9b55('0x55')](_0x9b55('0x123'),_[_0x9b55('0x7d')](_0x587215[_0x9b55('0x93')])?_0x587215[_0x9b55('0x4d')][_0x9b55('0x26')]:_0x587215[_0x9b55('0x93')][_0x9b55('0x26')],_[_0x9b55('0x7d')](_0x587215['dialPrefix'])?'':_0x587215[_0x9b55('0x32')][_0x9b55('0x125')]()||'',_0x587215[_0x9b55('0x124')]>0x0?_0x591462['Contact'][_0x9b55('0xfc')][_0x9b55('0x126')](_0x587215['dialCutDigit']):_0x591462['Contact'][_0x9b55('0xfc')]);var _0x1d714e=_0x481ede[_0x9b55('0x92')](_0x587215[_0x9b55('0x4d')])?ut[_0x9b55('0x127')](_0x587215[_0x9b55('0x4d')][_0x9b55('0x4e')],_0x587215['dialOriginateCallerIdName'],_0x587215[_0x9b55('0x128')]>0x0?ut['getCallerIdRandom'](_0x587215['dialOriginateCallerIdNumber'],_0x587215[_0x9b55('0x128')]):_0x587215[_0x9b55('0x129')]):ut[_0x9b55('0x127')](_['isNil'](_0x587215[_0x9b55('0x93')])?_0x587215[_0x9b55('0x4d')][_0x9b55('0x4e')]:_0x587215[_0x9b55('0x93')][_0x9b55('0x4e')],_0x587215[_0x9b55('0x31')],_0x587215[_0x9b55('0x128')]>0x0?ut[_0x9b55('0x12a')](_0x587215[_0x9b55('0x129')],_0x587215[_0x9b55('0x128')]):_0x587215[_0x9b55('0x129')]);if(_0x1d714e){_0x24806f[_0x9b55('0x12b')]=ut[_0x9b55('0x12c')](_0x1d714e);_0x24806f[_0x9b55('0x12d')]=ut['extractCalleridNumber'](_0x1d714e);}var _0x3a1803=ut[_0x9b55('0x12e')](_0x587215,_0x591462,_0x5779cb,_0x1d714e,_0x2adf82,_0x24806f);_[_0x9b55('0x12f')](_0x24806f,ut['toLowerVariables'](_0x3a1803));_0x24806f[_0x9b55('0x85')]=moment()[_0x9b55('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut['variablesAction'](_0x24806f,_0x587215,_0x3a1803,_0x24806f[_0x9b55('0xa3')],_0x3a7fee))[_0x9b55('0x7c')](function(_0x5b06c9){var _0x2b0df2=_0x24806f[_0x9b55('0x130')];if(!_[_0x9b55('0x7d')](_0x2b0df2)){if(!_[_0x9b55('0x7d')](_0x481ede[_0x9b55('0x17')][_0x2b0df2])){_0x481ede[_0x9b55('0x17')][_0x2b0df2]['destconnectedlinenum']=_0x24806f[_0x9b55('0x131')];emit(util[_0x9b55('0x55')](_0x9b55('0x132'),_0x481ede[_0x9b55('0x17')][_0x2b0df2]['name']),_0x9b55('0x133'),{'destaccountcode':_0x481ede[_0x9b55('0x17')][_0x2b0df2][_0x9b55('0x134')],'destconnectedlinenum':_0x24806f['calleridnum']});}}_0x587215[_0x9b55('0x47')]+=0x1;logger[_0x9b55('0x53')]('[originated][increment]',_0x2adf82,_0x9b55('0xa7'),_0x587215['name'],_0x9b55('0x66'),_0x587215[_0x9b55('0x47')]);_0x2ab8e2(_0x5b06c9);})[_0x9b55('0x70')](function(_0x259f1c){ut[_0x9b55('0xef')](_0x24806f,0xe,'OriginateError');rpcDb[_0x9b55('0xf1')](_0x24806f,_0x9b55('0x135'));_0x1c1cbc(_0x259f1c);});});};Preview[_0x9b55('0x10')][_0x9b55('0x136')]=function(_0x228c46){if(this[_0x9b55('0x16')][_0x228c46[_0x9b55('0xa4')]]){this[_0x9b55('0x16')][_0x228c46[_0x9b55('0xa4')]][_0x9b55('0x6f')]=_0x228c46[_0x9b55('0x6f')];}};Preview['prototype'][_0x9b55('0x137')]=function(_0x34a4ab){var _0x338377=this;var _0x1afc2c=this[_0x9b55('0x16')][_0x34a4ab[_0x9b55('0x138')]];if(_0x1afc2c){if(_0x1afc2c[_0x9b55('0xff')]&&this[_0x9b55('0x17')][_0x1afc2c['lookAgent']]){ut['logLookAgent'](_0x1afc2c,this[_0x9b55('0x17')][_0x1afc2c['lookAgent']][_0x9b55('0x26')],this['agents'][_0x1afc2c[_0x9b55('0xff')]]['id']);}var _0x52e21a=_[_0x9b55('0x139')](_0x1afc2c);_0x52e21a[_0x9b55('0x13a')]=moment()[_0x9b55('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1c612a=_0x338377[_0x9b55('0x14')][_0x1afc2c[_0x9b55('0x65')]];if(ut[_0x9b55('0x13b')](_0x34a4ab[_0x9b55('0x13c')])){if(_0x1afc2c[_0x9b55('0xbd')]){rpcDb[_0x9b55('0x110')](_0x1afc2c[_0x9b55('0x104')]);}if(_0x1afc2c[_0x9b55('0xa3')]){rpcDb['disableContact'](_0x1afc2c[_0x9b55('0x104')]);}ami[_0x9b55('0x23')](_0x9b55('0x13d'),ut[_0x9b55('0x98')](_0x1afc2c,_0x9b55('0x13e'),this['campaignsPreview'][_0x1afc2c[_0x9b55('0x65')]]));this[_0x9b55('0x13f')](_0x52e21a,_0x1c612a,_0x34a4ab);}else{_0x1afc2c[_0x9b55('0x85')]=moment()['format'](_0x9b55('0x86'));ut['logAgent'](_0x52e21a,0x4,_0x9b55('0xb1'));rpcDb[_0x9b55('0xf1')](_0x52e21a,_0x9b55('0x140'));}}};Preview[_0x9b55('0x10')][_0x9b55('0x141')]=function(_0x27010e){var _0x4e3223=this;var _0x258489=this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]];var _0x4c213a;if(_0x258489){_0x4c213a=this[_0x9b55('0x14')][_0x258489[_0x9b55('0x65')]];logger['info'](_0x9b55('0x142'),_0x27010e[_0x9b55('0xa4')],_0x9b55('0xa7'),_0x4c213a[_0x9b55('0x26')],'pTalking:\x20',_0x4c213a[_0x9b55('0x67')]);}if(this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]]&&_0x27010e['linkedid']!==_0x27010e['uniqueid']){if(_0x27010e[_0x9b55('0x143')]==='16'&&this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]][_0x9b55('0x68')]){this['callProgressDetectingCustomer'](_0x27010e,_0x27010e[_0x9b55('0xa4')],_0x27010e['cause']);}else if(this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]][_0x9b55('0x68')]){logger[_0x9b55('0x53')](_0x9b55('0x144'),_0x27010e[_0x9b55('0xa4')],_0x27010e[_0x9b55('0x143')],_0x9b55('0xa7'),_0x4c213a[_0x9b55('0x26')],'pTalking:\x20',_0x4c213a[_0x9b55('0x67')]);this['callProgressDetectingCustomer'](_0x27010e,_0x27010e[_0x9b55('0xa4')],_0x27010e[_0x9b55('0x143')]);}}else if(_0x258489&&_[_0x9b55('0x7d')](_0x258489[_0x9b55('0x145')])&&_0x4c213a['dialQueueProject']&&_0x27010e[_0x9b55('0xa4')]===_0x27010e[_0x9b55('0xa6')]&&_[_0x9b55('0x7d')](_0x27010e[_0x9b55('0xee')])&&_0x27010e[_0x9b55('0x143')]==='16'&&_0x27010e[_0x9b55('0x146')]==='6'&&_[_0x9b55('0xec')](_0x258489['transfer'])){if(_0x258489[_0x9b55('0xbd')]){rpcDb[_0x9b55('0x110')](_0x258489['idContact']);}if(_0x258489['activeContact']){rpcDb[_0x9b55('0x84')](_0x258489[_0x9b55('0x104')]);}_0x27010e[_0x9b55('0xee')]='22';this[_0x9b55('0x13f')](_0x258489,_0x4c213a,_0x27010e);}else if(_0x258489&&_0x258489[_0x9b55('0x147')]){if(_0x27010e[_0x9b55('0x143')]==='16'&&this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]][_0x9b55('0x68')]){logger[_0x9b55('0x53')](_0x9b55('0x148'),_0x27010e[_0x9b55('0xa4')],_0x27010e[_0x9b55('0x143')],_0x9b55('0xa7'),_0x4c213a[_0x9b55('0x26')],_0x9b55('0xa8'),_0x4c213a[_0x9b55('0x67')]);this[_0x9b55('0x95')](_0x27010e,_0x27010e[_0x9b55('0xa4')],_0x27010e[_0x9b55('0x143')]);}else if(this[_0x9b55('0x16')][_0x27010e[_0x9b55('0xa4')]][_0x9b55('0x68')]){logger[_0x9b55('0x53')](_0x9b55('0x144'),_0x27010e['linkedid'],_0x27010e[_0x9b55('0x143')],'\x20Queue',_0x4c213a['name'],'pTalking:\x20',_0x4c213a['pTalking']);this[_0x9b55('0x95')](_0x27010e,_0x27010e[_0x9b55('0xa4')],_0x27010e[_0x9b55('0x143')]);}}};Preview['prototype'][_0x9b55('0x149')]=function(_0x2b8686){if(this['actions'][_0x2b8686['destlinkedid']]&&_0x2b8686[_0x9b55('0xeb')]!==_0x2b8686[_0x9b55('0x14a')]){this[_0x9b55('0x95')](_0x2b8686,_0x2b8686[_0x9b55('0xeb')],_0x2b8686[_0x9b55('0xde')]);}};Preview[_0x9b55('0x10')]['syncHangupRequest']=function(_0x56e741){if(this['actions'][_0x56e741[_0x9b55('0xa4')]]&&_0x56e741[_0x9b55('0xa4')]!==_0x56e741[_0x9b55('0xa6')]&&!this[_0x9b55('0x16')][_0x56e741[_0x9b55('0xa4')]][_0x9b55('0x68')]){if(_0x56e741['cause']==='1'){this['callProgressDetectingCustomer'](_0x56e741,_0x56e741[_0x9b55('0xa4')],_0x56e741[_0x9b55('0x143')]);}}};Preview[_0x9b55('0x10')]['addVariable']=function(_0x3da13e,_0xa909b9,_0x26fc32){if(this[_0x9b55('0x16')][_0x3da13e]){if(_['isNil'](this[_0x9b55('0x16')][_0x3da13e][_0x9b55('0x14b')])){this['actions'][_0x3da13e][_0x9b55('0x14b')]={};}this['actions'][_0x3da13e][_0x9b55('0x14b')][_0xa909b9]=_0x26fc32;}};Preview[_0x9b55('0x10')][_0x9b55('0x1f')]=function(_0x158bb9){try{if(!_[_0x9b55('0x7d')](_0x158bb9)){if(ut[_0x9b55('0x14c')](_[_0x9b55('0x14d')](_0x158bb9['variable'])[0x0])){this[_0x9b55('0x14e')](_0x158bb9[_0x9b55('0xa6')],_[_0x9b55('0x14d')](_0x158bb9['variable'])[0x0],_0x158bb9[_0x9b55('0x14f')]);}}}catch(_0x42cc9){logger[_0x9b55('0x150')](_0x9b55('0x151'),util[_0x9b55('0x152')](_0x42cc9,{'showHidden':![],'depth':null}));}};Preview[_0x9b55('0x10')][_0x9b55('0x20')]=function(_0x429b40){if(_0x429b40){if(this[_0x9b55('0x16')][_0x429b40['transfertargetlinkedid']]){this[_0x9b55('0x16')][_0x429b40['transfertargetlinkedid']][_0x9b55('0x147')]=!![];}}};Preview[_0x9b55('0x10')][_0x9b55('0x153')]=function(_0x3b0da7){if(_0x3b0da7){if(this[_0x9b55('0x16')][_0x3b0da7['transfererlinkedid']]){this[_0x9b55('0x16')][_0x3b0da7[_0x9b55('0x154')]][_0x9b55('0x147')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x852c=['starttime','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','sendMessageOneNotActive','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','Queue','originated:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','activeContact','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','active','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','channelAgent','user:%s','user:agentconnect','accountcode','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','logLookAgent','clone','isFailure','unlockContact','custom:agentringnoanswer','rejected'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x852c,0x174));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xc852('0x0'));var uuid=require(_0xc852('0x1'));var moment=require(_0xc852('0x2'));var md5=require(_0xc852('0x3'));var Redis=require(_0xc852('0x4'));var config=require(_0xc852('0x5'));var logger=require(_0xc852('0x6'))('preview');var loggerAction=require('../../../config/logger')(_0xc852('0x7'));var ami=require(_0xc852('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0xc852('0x9'));var ut=require('./util/util');config[_0xc852('0xa')]=_[_0xc852('0xb')](config['redis'],{'host':_0xc852('0xc'),'port':0x18eb});var io=require(_0xc852('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xc852('0xe')][_0xc852('0xf')]=function(_0x597ad6){this[_0xc852('0x10')]=this[_0xc852('0x10')]?this[_0xc852('0x10')]['finally'](_0x597ad6):_0x597ad6();};function Preview(_0x3901e6){this[_0xc852('0x11')]=new Sequence();this[_0xc852('0x12')]=_0x3901e6[_0xc852('0x13')];this[_0xc852('0x14')]=_0x3901e6[_0xc852('0x14')];this[_0xc852('0x15')]={};this[_0xc852('0x16')]=_0x3901e6[_0xc852('0x16')];this[_0xc852('0x17')]=0x0;ami['on'](_0xc852('0x18'),this['syncOriginateResponse'][_0xc852('0x19')](this));ami['on'](_0xc852('0x1a'),this[_0xc852('0x1b')][_0xc852('0x19')](this));ami['on'](_0xc852('0x1c'),this[_0xc852('0x1d')][_0xc852('0x19')](this));ami['on']('dialend',this[_0xc852('0x1e')]['bind'](this));ami['on'](_0xc852('0x1f'),this['syncNewExten'][_0xc852('0x19')](this));ami['on'](_0xc852('0x20'),this[_0xc852('0x21')][_0xc852('0x19')](this));ami['on']('attendedtransfer',this[_0xc852('0x22')][_0xc852('0x19')](this));ami['on'](_0xc852('0x23'),this[_0xc852('0x24')][_0xc852('0x19')](this));this[_0xc852('0x25')](this['campaignsPreview']);}function emit(_0x1099dc,_0x282061,_0x56b612){io['to'](_0x1099dc)[_0xc852('0x26')](_0x282061,_0x56b612);}function emitCampaignPreview(_0x156aa2){if(_0x156aa2[_0xc852('0x27')]===_0xc852('0x28')){var _0x2dbf51={'id':_0x156aa2['id'],'name':_0x156aa2[_0xc852('0x29')],'strategy':_0x156aa2['strategy'],'answered':_0x156aa2[_0xc852('0x2a')],'available':_0x156aa2[_0xc852('0x2b')],'loggedIn':_0x156aa2[_0xc852('0x2c')],'pTalking':_0x156aa2[_0xc852('0x2d')],'sumBillable':_0x156aa2[_0xc852('0x2e')],'sumDuration':_0x156aa2['sumDuration'],'sumHoldTime':_0x156aa2[_0xc852('0x2f')]||0x0,'talking':_0x156aa2[_0xc852('0x30')],'total':_0x156aa2[_0xc852('0x31')],'type':_0x156aa2[_0xc852('0x27')],'unmanaged':_0x156aa2[_0xc852('0x32')],'abandoned':_0x156aa2[_0xc852('0x33')],'waiting':_0x156aa2[_0xc852('0x34')],'loggedInDb':_0x156aa2[_0xc852('0x35')],'dialActive':_0x156aa2[_0xc852('0x36')],'dialMethod':_0x156aa2[_0xc852('0x37')],'dialOriginateCallerIdName':_0x156aa2[_0xc852('0x38')],'dialOriginateCallerIdNumber':_0x156aa2[_0xc852('0x39')],'dialOriginateTimeout':_0x156aa2[_0xc852('0x3a')],'dialPrefix':_0x156aa2[_0xc852('0x3b')],'outboundAnswerAgiCallsDay':_0x156aa2[_0xc852('0x3c')],'outboundAnswerCallsDay':_0x156aa2[_0xc852('0x3d')],'outboundBlacklistCallsDay':_0x156aa2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x156aa2[_0xc852('0x3e')],'outboundCongestionCallsDay':_0x156aa2[_0xc852('0x3f')],'outboundDropCallsDayACS':_0x156aa2[_0xc852('0x40')],'outboundDropCallsDayCallersExit':_0x156aa2[_0xc852('0x41')],'outboundDropCallsDayTimeout':_0x156aa2[_0xc852('0x42')],'outboundNoAnswerCallsDay':_0x156aa2[_0xc852('0x43')],'outboundNoSuchCallsDay':_0x156aa2[_0xc852('0x44')],'outboundOriginateFailureCallsDay':_0x156aa2[_0xc852('0x45')],'outboundReCallsDay':_0x156aa2[_0xc852('0x46')],'outboundRejectCallsDay':_0x156aa2[_0xc852('0x47')],'outboundUnknownCallsDay':_0x156aa2[_0xc852('0x48')],'outboundAbandonedCallsDay':_0x156aa2[_0xc852('0x49')],'predictiveIntervalAnsweredCalls':_0x156aa2[_0xc852('0x4a')],'predictiveIntervalAvgHoldtime':_0x156aa2[_0xc852('0x4b')],'predictiveIntervalAvgTalktime':_0x156aa2[_0xc852('0x4c')],'predictiveIntervalDroppedCallsCallersExit':_0x156aa2[_0xc852('0x4d')],'predictiveIntervalDroppedCallsTimeout':_0x156aa2['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x156aa2[_0xc852('0x4e')],'predictiveIntervalErlangCallsDroppedCalls':_0x156aa2[_0xc852('0x4f')],'predictiveIntervalHitRate':_0x156aa2[_0xc852('0x50')],'predictiveIntervalMultiplicativeFactor':_0x156aa2[_0xc852('0x51')],'predictiveIntervalPauses':_0x156aa2[_0xc852('0x52')],'predictiveIntervalAvailable':_0x156aa2[_0xc852('0x53')],'predictiveIntervalTotalCalls':_0x156aa2[_0xc852('0x54')],'message':_0x156aa2[_0xc852('0x55')],'originated':_0x156aa2[_0xc852('0x56')],'erlangCalls':_0x156aa2['erlangCalls'],'erlangCallToSecond':_0x156aa2[_0xc852('0x57')],'erlangAbandonmentRate':_0x156aa2[_0xc852('0x58')],'erlangBusyFactor':_0x156aa2[_0xc852('0x59')],'startPredictive':_0x156aa2[_0xc852('0x5a')],'startProgressive':_0x156aa2[_0xc852('0x5b')]};if(_0x156aa2[_0xc852('0x5c')]){_0x2dbf51[_0xc852('0x5c')]={'id':_0x156aa2[_0xc852('0x5c')]['id'],'name':_0x156aa2[_0xc852('0x5c')][_0xc852('0x29')],'active':_0x156aa2['Trunk']['active'],'callerid':_0x156aa2['Trunk']['callerid']};}if(_0x156aa2[_0xc852('0x5d')]){_0x2dbf51['Interval']={'id':_0x156aa2[_0xc852('0x5d')]['id'],'name':_0x156aa2[_0xc852('0x5d')][_0xc852('0x29')]};}var _0x18a1de=md5(JSON[_0xc852('0x5e')](_0x2dbf51));if(_0x156aa2[_0xc852('0x3')]!==_0x18a1de){_0x156aa2['md5']=_0x18a1de;emit(util[_0xc852('0x5f')](_0xc852('0x60'),_0x2dbf51[_0xc852('0x29')]),_0xc852('0x61'),_0x2dbf51);}}}function emitVoiceQueueChannelRemove(_0x5cbb50){logger[_0xc852('0x62')](_0xc852('0x63'),JSON['stringify'](_0x5cbb50));emit(util[_0xc852('0x5f')](_0xc852('0x60'),_0x5cbb50[_0xc852('0x29')]),'voice_queue_channel:remove',_0x5cbb50);io[_0xc852('0x26')]('voice_queue_presence:remove',_0x5cbb50);}function notSendMessagesQueue(_0x2cb3b2){if(_0x2cb3b2[_0xc852('0x64')]){if(_0x2cb3b2[_0xc852('0x56')]===0x0&&_0x2cb3b2[_0xc852('0x2d')]===0x0){_0x2cb3b2[_0xc852('0x64')]=![];_0x2cb3b2[_0xc852('0x2b')]=0x0;_0x2cb3b2[_0xc852('0x65')]=0x0;_0x2cb3b2[_0xc852('0x55')]=_0xc852('0x66');ut['logger'](_0xc852('0x67'),_0x2cb3b2[_0xc852('0x29')]+_0xc852('0x68'));}else{_0x2cb3b2['message']='IS_DISACTIVED';ut[_0xc852('0x69')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2cb3b2[_0xc852('0x29')]+_0xc852('0x6a'));}emitCampaignPreview(_0x2cb3b2);}}Preview['prototype'][_0xc852('0x25')]=function(){var _0x4bc6e8=this;setInterval(function(){_0x4bc6e8['syncCampaigns']();},0x7cf);};Preview[_0xc852('0xe')][_0xc852('0x6b')]=function(){var _0x1a8759=this[_0xc852('0x12')];this[_0xc852('0x17')]+=0x1;for(var _0x23873c in _0x1a8759){if(_0x1a8759[_0xc852('0x6c')](_0x23873c)&&(_0x1a8759[_0x23873c][_0xc852('0x37')]===_0xc852('0x6d')||_0x1a8759[_0x23873c][_0xc852('0x37')]===_0xc852('0x6e'))&&_0x1a8759[_0x23873c]['type']===_0xc852('0x28')){if(this[_0xc852('0x17')]>0x7){this[_0xc852('0x17')]=0x0;this[_0xc852('0x6f')]();}}if(_0x1a8759[_0xc852('0x6c')](_0x23873c)&&_0x1a8759[_0x23873c][_0xc852('0x37')]===_0xc852('0x6d')&&_0x1a8759[_0x23873c][_0xc852('0x27')]===_0xc852('0x28')){if(_0x1a8759[_0x23873c][_0xc852('0x36')]){this[_0xc852('0x70')](_0x1a8759[_0x23873c]);this[_0xc852('0x71')](_0x1a8759[_0x23873c]);}else{notSendMessagesQueue(_0x1a8759[_0x23873c]);}}}};Preview[_0xc852('0xe')][_0xc852('0x72')]=function(_0x45aa56){var _0x2b24ed=this;this[_0xc852('0x11')][_0xc852('0xf')](function(){if(!_[_0xc852('0x73')](_0x2b24ed['actions'][_0x45aa56])){loggerAction[_0xc852('0x62')]('[clearZombieChannels][talking]',_0x45aa56,_0xc852('0x74'),_0x2b24ed[_0xc852('0x15')][_0x45aa56]['queue'],_0xc852('0x75'),JSON[_0xc852('0x5e')](_0x2b24ed['campaignsPreview'][_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x76')]]['originated']),'pTalking:\x20',JSON[_0xc852('0x5e')](_0x2b24ed[_0xc852('0x12')][_0x2b24ed['actions'][_0x45aa56][_0xc852('0x76')]][_0xc852('0x2d')]),JSON[_0xc852('0x5e')](_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x77')]),JSON['stringify'](_[_0xc852('0x78')](_0x2b24ed[_0xc852('0x15')][_0x45aa56],[_0xc852('0x79'),_0xc852('0x7a'),_0xc852('0x7b'),_0xc852('0x7c')])));return ami[_0xc852('0x7d')]({'action':_0xc852('0x7e'),'channel':_0x2b24ed['actions'][_0x45aa56][_0xc852('0x7f')]})[_0xc852('0x80')](function(_0x6cf6be){if(_0x6cf6be[_0xc852('0x55')]===_0xc852('0x81')){setTimeout(function(){if(_0x2b24ed[_0xc852('0x15')][_0x45aa56]){ut[_0xc852('0x82')](_0x2b24ed[_0xc852('0x12')][_0x2b24ed[_0xc852('0x15')][_0x45aa56]['queue']],'[clearZombieChannel]');if(_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x77')]===!![]){ut[_0xc852('0x83')](_0x2b24ed['campaignsPreview'][_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x76')]],_0xc852('0x84'));ut[_0xc852('0x85')](_0xc852('0x86')+_0x45aa56,_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x76')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x45aa56,_0x2b24ed[_0xc852('0x15')][_0x45aa56][_0xc852('0x76')]);delete _0x2b24ed['actions'][_0x45aa56];}},0x2328);}});}});};Preview[_0xc852('0xe')][_0xc852('0x6f')]=function(){var _0xefe5ce=this;loggerAction[_0xc852('0x62')](_0xc852('0x87'),_[_0xc852('0x88')](this['actions']));for(var _0x248211 in this['actions']){if(_0xefe5ce[_0xc852('0x15')]['hasOwnProperty'](_0x248211)){_0xefe5ce['clearZombieChannel'](_0x248211);}}};Preview['prototype'][_0xc852('0x71')]=function(_0x5b42c2){var _0x46639c=this;rpcDb['getContactRecallMe'](_0x5b42c2['id'],ut['agentReadyId'](this[_0xc852('0x16')]))[_0xc852('0x89')](function(_0x25837e){if(!_['isNil'](_0x25837e)){for(var _0x5bc463=0x0;_0x5bc463<_0x25837e[_0xc852('0x8a')];_0x5bc463+=0x1){if(ut[_0xc852('0x8b')](_0x25837e[_0x5bc463][_0xc852('0x8c')])<_0x5b42c2[_0xc852('0x8d')]*0x3c){if(_0x25837e[_0x5bc463][_0xc852('0x8e')]&&!_0x25837e[_0x5bc463][_0xc852('0x8e')][_0xc852('0x8f')]){_0x46639c[_0xc852('0x90')](_0x25837e[_0x5bc463]['id'])[_0xc852('0x89')](ut[_0xc852('0x91')](_0xc852('0x92')))[_0xc852('0x80')](ut[_0xc852('0x91')](_0xc852('0x92')));}else{rpcDb[_0xc852('0x93')](_0x25837e[_0x5bc463]['id']);}}else{var _0x5c7a7a=new Action(_0x25837e[_0x5bc463],_0x5b42c2);_0x5c7a7a['starttime']=moment()['format'](_0xc852('0x94'));_0x5b42c2[_0xc852('0x46')]+=0x1;ut[_0xc852('0x95')](_0x5c7a7a,0x17,_0xc852('0x96'));if(_0x5b42c2[_0xc852('0x97')]){rpcDb[_0xc852('0x98')](ut[_0xc852('0x99')](_0x25837e[_0x5bc463]));rpcDb[_0xc852('0x9a')](_0x5c7a7a,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xc852('0x95')](_0x5c7a7a,0x16,_0xc852('0x9b'));rpcDb[_0xc852('0x9a')](_0x5c7a7a,_0xc852('0x9c'));rpcDb[_0xc852('0x9d')](_0x5c7a7a,_0xc852('0x9c'));}}}}})[_0xc852('0x80')](ut[_0xc852('0x91')](_0xc852('0x9e')));};Preview['prototype']['setMessage']=function(_0x43c851){_0x43c851[_0xc852('0x64')]=!![];if(ut[_0xc852('0x9f')](_0x43c851[_0xc852('0x2c')])){_0x43c851[_0xc852('0x55')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xc852('0xa0')](_0x43c851[_0xc852('0x36')])){_0x43c851[_0xc852('0x55')]=_0xc852('0x66');}else if(!this['isTrunkReachable'](_0x43c851[_0xc852('0x5c')])){if(!this[_0xc852('0xa1')](_0x43c851['TrunkBackup'])){_0x43c851[_0xc852('0x55')]='TRUNK_IS_NOT_REACHABLE';}else{_0x43c851[_0xc852('0x55')]=_0xc852('0xa2');}}else{_0x43c851[_0xc852('0x55')]='ACTIVE';}emitCampaignPreview(_0x43c851);};Preview[_0xc852('0xe')][_0xc852('0xa3')]=function(_0x505d6a,_0x1179aa,_0x36fcd5){var _0x16be71=this;var _0x28bc5d=this[_0xc852('0x15')][_0x1179aa];var _0x1df806=this[_0xc852('0x12')][_0x28bc5d[_0xc852('0x76')]];var _0x74a6e6;if(_0x1df806){switch(_0x36fcd5){case'1':_0x1df806[_0xc852('0x44')]+=0x1;_0x28bc5d['countnosuchnumberretry']+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut['totalGlobal'](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0x0,_0xc852('0xa5'));ami[_0xc852('0x26')](_0xc852('0xa6'),ut['buildObj'](_0x28bc5d,_0xc852('0xa7')));rpcDb[_0xc852('0x9a')](_0x28bc5d,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xc852('0xa8')](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xac'));}else{if(_0x28bc5d[_0xc852('0xad')]>=_0x1df806['dialNoSuchNumberMaxRetry']){rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xac'));}else{rpcDb[_0xc852('0xae')](ut[_0xc852('0xaf')](_0x28bc5d,_0xc852('0xad'),_0x1df806[_0xc852('0xb0')]),_0x28bc5d['unlockAgent'],_0x28bc5d['activeContact']);}}delete this[_0xc852('0x15')][_0x505d6a[_0xc852('0xb1')]];break;case _0xc852('0xb2'):var _0x5a0e58=moment()[_0xc852('0x5f')](_0xc852('0x94'));_0x28bc5d[_0xc852('0xb3')]=_0x5a0e58;_0x28bc5d[_0xc852('0xb4')]=_0x5a0e58;_0x28bc5d[_0xc852('0x77')]=!![];_0x1df806['pTalking']+=0x1;logger[_0xc852('0x62')](_0xc852('0xb5'),_0x28bc5d[_0xc852('0xb6')],_0xc852('0xb7'),_0x1df806['name'],_0xc852('0xb8'),_0x1df806['pTalking']);ami[_0xc852('0x26')](_0xc852('0xb9'),ut['buildObj'](_0x28bc5d,_0xc852('0xba'),this[_0xc852('0x12')][_0x28bc5d[_0xc852('0x76')]]));if(_0x1df806[_0xc852('0xbb')]){ami[_0xc852('0x26')](_0xc852('0xbc'),ut[_0xc852('0xbd')](_0x28bc5d));}break;case'16':ami[_0xc852('0x26')](_0xc852('0xbe'),ut['buildObj'](_0x28bc5d,'complete',this[_0xc852('0x12')][_0x28bc5d[_0xc852('0x76')]]));emitVoiceQueueChannelRemove(ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xc0')));_0x1df806['outboundAnswerCallsDay']+=0x1;_0x1df806[_0xc852('0x31')]+=0x1;_0x1df806[_0xc852('0x2a')]+=0x1;ut[_0xc852('0x83')](_0x1df806,_0xc852('0xc1'));_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut['logCustomer'](_0x28bc5d,0x4,_0xc852('0xc2'));rpcDb[_0xc852('0x9a')](_0x28bc5d,_0xc852('0xc3'));rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xc4'));rpcDb[_0xc852('0xc5')](_0x28bc5d);_0x1df806[_0xc852('0xc6')]+=_0x28bc5d[_0xc852('0xc7')];_0x1df806[_0xc852('0x2e')]+=_0x28bc5d['talktime'];logger[_0xc852('0x62')](_0xc852('0xc8'),_0x28bc5d[_0xc852('0xb6')],_0xc852('0xb7'),_0x1df806[_0xc852('0x29')],_0xc852('0xb8'),_0x1df806[_0xc852('0x2d')]);delete this['actions'][_0x505d6a['linkedid']];break;case'BUSY':_0x1df806['outboundBusyCallsDay']+=0x1;_0x28bc5d['countbusyretry']+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0x5,_0xc852('0xc9'));ami['emit'](_0xc852('0xca'),ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xcb')));rpcDb[_0xc852('0x9a')](_0x28bc5d,_0xc852('0xcc'));if(ut['totalGlobal'](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xcd'));}else{if(_0x28bc5d[_0xc852('0xce')]>=_0x1df806[_0xc852('0xcf')]){rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xcc'));}else{rpcDb[_0xc852('0xae')](ut[_0xc852('0xaf')](_0x28bc5d,_0xc852('0xce'),_0x1df806['dialBusyRetryFrequency']),_0x28bc5d[_0xc852('0xd0')],_0x28bc5d['activeContact']);}}break;case _0xc852('0xd1'):_0x1df806[_0xc852('0x43')]+=0x1;_0x28bc5d[_0xc852('0xd2')]+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0x3,_0xc852('0xd3'));ami[_0xc852('0x26')](_0xc852('0xd4'),ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xd5')));rpcDb[_0xc852('0x9a')](_0x28bc5d,_0xc852('0xd6'));if(ut['totalGlobal'](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xd7'));}else{if(_0x28bc5d[_0xc852('0xd2')]>=_0x1df806[_0xc852('0xd8')]){rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xd6'));}else{rpcDb[_0xc852('0xae')](ut[_0xc852('0xaf')](_0x28bc5d,_0xc852('0xd2'),_0x1df806[_0xc852('0xd9')]),_0x28bc5d[_0xc852('0xd0')],_0x28bc5d['activeContact']);}}break;case _0xc852('0xda'):_0x1df806['outboundCongestionCallsDay']+=0x1;_0x28bc5d[_0xc852('0xdb')]+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut['totalGlobal'](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0x8,'Congestion');ami['emit']('custom:agentcongestion',ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xdc')));rpcDb[_0xc852('0x9a')](_0x28bc5d,_0xc852('0xdd'));if(ut[_0xc852('0xa8')](_0x28bc5d)>=_0x1df806['dialGlobalMaxRetry']){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xde'));}else{if(_0x28bc5d[_0xc852('0xdb')]>=_0x1df806[_0xc852('0xdf')]){rpcDb[_0xc852('0x9d')](_0x28bc5d,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xc852('0xae')](ut[_0xc852('0xaf')](_0x28bc5d,_0xc852('0xdb'),_0x1df806[_0xc852('0xe0')]),_0x28bc5d['unlockAgent'],_0x28bc5d[_0xc852('0xe1')]);}}break;case _0xc852('0xe2'):_0x1df806['outboundRejectCallsDay']+=0x1;_0x28bc5d[_0xc852('0xe3')]+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut['totalGlobal'](_0x28bc5d);ut['logCustomer'](_0x28bc5d,0x14,_0xc852('0xe4'));ami[_0xc852('0x26')](_0xc852('0xe5'),ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xe6')));rpcDb[_0xc852('0x9a')](_0x28bc5d,'[syncHangupRequest][logAgentReject]');if(ut[_0xc852('0xa8')](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0x14,'AgentReject');rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xe7'));}else{if(_0x28bc5d[_0xc852('0xe3')]>=_0x1df806['dialAgentRejectMaxRetry']){rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xe7'));}else{rpcDb[_0xc852('0xae')](ut['scheduledAt'](_0x28bc5d,_0xc852('0xe3'),_0x1df806['dialAgentRejectRetryFrequency']),_0x28bc5d[_0xc852('0xd0')],_0x28bc5d['activeContact']);}}break;case _0xc852('0xe8'):_0x1df806[_0xc852('0x49')]+=0x1;_0x28bc5d[_0xc852('0xe9')]+=0x1;_0x28bc5d['countglobal']=ut['totalGlobal'](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0xb,_0xc852('0xea'));rpcDb['createCustomerHistory'](_0x28bc5d,_0xc852('0xeb'));if(ut['totalGlobal'](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xeb'));}else{if(_0x28bc5d[_0xc852('0xec')]>=_0x1df806['dialAbandonedMaxRety']){rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xeb'));}else{rpcDb['rescheduleContact'](ut[_0xc852('0xaf')](_0x28bc5d,'countabandonedretry',_0x1df806[_0xc852('0xed')]),_0x28bc5d[_0xc852('0xd0')],_0x28bc5d[_0xc852('0xe1')]);}}break;case'18':_0x1df806[_0xc852('0x48')]+=0x1;_0x28bc5d['countmachineretry']+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0x12,_0x505d6a[_0xc852('0xee')]||_0x505d6a['dialstatus']);ami[_0xc852('0x26')](_0xc852('0xef'),ut[_0xc852('0xbf')](_0x28bc5d,_0xc852('0xf0')));rpcDb[_0xc852('0x9a')](_0x28bc5d,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x28bc5d)>=_0x1df806['dialGlobalMaxRetry']){_0x74a6e6=ut['cloneAction'](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xf1'));}else{rpcDb[_0xc852('0x9d')](_0x28bc5d,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x505d6a['linkedid']];break;case'19':_0x1df806['outboundUnknownCallsDay']+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut['logCustomer'](_0x28bc5d,0x13,_0x505d6a[_0xc852('0xee')]||_0x505d6a[_0xc852('0xf2')]);ami[_0xc852('0x26')](_0xc852('0xef'),ut['buildObj'](_0x28bc5d,_0xc852('0xf0')));rpcDb[_0xc852('0x9a')](_0x28bc5d,'[callProgressDetectingCustomer][machine]');if(ut[_0xc852('0xa8')](_0x28bc5d)>=_0x1df806[_0xc852('0xa9')]){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,'Global');rpcDb['createCustomerFinal'](_0x74a6e6,_0xc852('0xf3'));}else{rpcDb[_0xc852('0x9d')](_0x28bc5d,_0xc852('0xf3'));}delete this[_0xc852('0x15')][_0x505d6a[_0xc852('0xb1')]];break;default:if(_0x28bc5d[_0xc852('0x77')]){ut[_0xc852('0x83')](_0x1df806,_0xc852('0xf4'));ut[_0xc852('0x85')](_0xc852('0xf5')+_0x1df806[_0xc852('0x29')],_0x505d6a);}_0x1df806[_0xc852('0x48')]+=0x1;_0x28bc5d[_0xc852('0xa4')]=ut[_0xc852('0xa8')](_0x28bc5d);ut[_0xc852('0x95')](_0x28bc5d,0xc,_0x505d6a[_0xc852('0xee')]||_0x505d6a[_0xc852('0xf2')]);rpcDb[_0xc852('0x9a')](_0x28bc5d,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xc852('0xa8')](_0x28bc5d)>=_0x1df806['dialGlobalMaxRetry']){_0x74a6e6=ut[_0xc852('0xaa')](_0x28bc5d,0xf,_0xc852('0xab'));rpcDb[_0xc852('0x9d')](_0x74a6e6,_0xc852('0xf6'));}else{rpcDb['createCustomerFinal'](_0x28bc5d,_0xc852('0xf6'));}delete this[_0xc852('0x15')][_0x505d6a[_0xc852('0xb1')]];}if(!(_0x28bc5d[_0xc852('0x77')]&&_0x36fcd5==='16')){ut[_0xc852('0x82')](_0x1df806,_0xc852('0xf7'));logger[_0xc852('0x62')](_0xc852('0xf8'),_0x28bc5d[_0xc852('0xb6')],'\x20Queue',_0x1df806[_0xc852('0x29')],_0xc852('0x75'),_0x1df806[_0xc852('0x56')]);}if(_0x36fcd5!==_0xc852('0xb2')){delete this[_0xc852('0x15')][_0x505d6a[_0xc852('0xb1')]];delete this['actions'][_0x505d6a[_0xc852('0xf9')]];}}};Preview['prototype'][_0xc852('0xfa')]=function(_0x45fa00,_0x3e4956,_0x1bd74f){if(_['isUndefined'](_0x3e4956)&&_0xc852('0xfb')!==typeof _0x3e4956){return;}if(_[_0xc852('0xfc')](_0x1bd74f)&&_0xc852('0xfb')!==typeof _0x1bd74f){return;}switch(_0x1bd74f[_0xc852('0xfd')]){case'0':ut['logAgent'](_0x45fa00,0x0,'NoSuchNumber');rpcDb[_0xc852('0xfe')](_0x45fa00,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xc852('0xff')](_0x45fa00,0x3,'NoAnswer');rpcDb[_0xc852('0xfe')](_0x45fa00,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xc852('0xff')](_0x45fa00,0x5,_0xc852('0xc9'));rpcDb[_0xc852('0xfe')](_0x45fa00,_0xc852('0x100'));break;case'8':ut[_0xc852('0xff')](_0x45fa00,0x8,_0xc852('0x101'));rpcDb[_0xc852('0xfe')](_0x45fa00,_0xc852('0x102'));break;case'22':ut[_0xc852('0xff')](_0x45fa00,0x16,_0xc852('0x103'));rpcDb['createAgentHistory'](_0x45fa00,_0xc852('0x104'));break;default:ut[_0xc852('0xff')](_0x45fa00,0xc,_0x1bd74f[_0xc852('0xfd')]);rpcDb[_0xc852('0xfe')](_0x45fa00,_0xc852('0x102'));}ut[_0xc852('0x82')](_0x3e4956,_0xc852('0x105'));logger[_0xc852('0x62')](_0xc852('0x106'),_0x45fa00[_0xc852('0xb6')],_0xc852('0xb7'),_0x3e4956['name'],_0xc852('0x75'),_0x3e4956['originated']);delete this[_0xc852('0x15')][_0x45fa00['uniqueid']];};Preview[_0xc852('0xe')][_0xc852('0x107')]=function(_0x2f5fb3,_0x349171,_0x524924,_0x11a6cd,_0x4ebb14){var _0x1200b1=this;return new BPromise(function(_0x1cec4f,_0x18df47){if(_[_0xc852('0x73')](_0x349171)||_[_0xc852('0x73')](_0x349171[_0xc852('0x108')])||_[_0xc852('0x73')](_0x349171['Contact'][_0xc852('0x109')])||_[_0xc852('0x73')](_0x349171[_0xc852('0x7b')])){_0x18df47(ut[_0xc852('0x55')](_0xc852('0x10a'),_0x11a6cd,_0x4ebb14));return;}var _0x1c23ad=uuid['v4']();var _0x3c5e86=_0x1200b1[_0xc852('0x12')][_0x349171[_0xc852('0x74')][_0xc852('0x29')]];var _0x591673=_0x524924?_0x1200b1['agents'][_0x524924]['id']:undefined;_0x1200b1[_0xc852('0x15')][_0x1c23ad]=new Action(_0x349171,_0x3c5e86,_0x1c23ad,_0x524924,_0x591673);var _0x1db59b=_0x1200b1['actions'][_0x1c23ad];_0x1db59b[_0xc852('0xd0')]=_0x11a6cd;_0x1db59b[_0xc852('0xe1')]=_0x4ebb14;_0x1db59b[_0xc852('0x10b')]=_0x524924;if(_['isEmpty'](_0x2f5fb3)){_0x1200b1[_0xc852('0x10c')](_0x1db59b,_0x3c5e86,_0x349171,_0x524924)[_0xc852('0x89')](function(_0x22e029){logger['info']('[Preview][execCall][success]',_0xc852('0x10d')+_0x1db59b[_0xc852('0x76')]+_0xc852('0x10e')+_0x1db59b[_0xc852('0x10f')],JSON[_0xc852('0x5e')](_0x22e029));ami[_0xc852('0x26')](_0xc852('0x110'),ut[_0xc852('0xbf')](_0x1db59b,'called',_0x1200b1[_0xc852('0x12')][_0x1db59b[_0xc852('0x76')]]));_0x1cec4f(ut[_0xc852('0x55')](_0xc852('0x111')));})['catch'](function(_0x544837){ut[_0xc852('0x69')]('[Preview][execCall][failure]',_0x544837);_0x18df47(ut[_0xc852('0x55')](_0xc852('0x112'),_0x11a6cd,_0x4ebb14));});}else{_0x3c5e86[_0xc852('0x113')]+=0x1;ut[_0xc852('0x114')](_0x1db59b);rpcDb[_0xc852('0x115')](_0x1db59b,'[Blacklist][error]');delete _0x1200b1[_0xc852('0x15')][_0x1c23ad];_0x18df47(ut['message'](_0xc852('0x116'),_0x11a6cd,_0x4ebb14));}});};Preview[_0xc852('0xe')][_0xc852('0xa1')]=function(_0xb06b78){return!_[_0xc852('0x73')](_0xb06b78)&&!_['isNil'](_0xb06b78['name'])&&!_[_0xc852('0x73')](_0xb06b78['active'])&&_0xb06b78['active']&&!_[_0xc852('0x73')](this['trunks'][util[_0xc852('0x5f')](_0xc852('0x117'),_0xb06b78[_0xc852('0x29')])])&&!_[_0xc852('0x73')](this[_0xc852('0x14')][util[_0xc852('0x5f')](_0xc852('0x117'),_0xb06b78[_0xc852('0x29')])][_0xc852('0x7e')])&&(this[_0xc852('0x14')][util[_0xc852('0x5f')](_0xc852('0x117'),_0xb06b78['name'])][_0xc852('0x7e')]===_0xc852('0x118')||this[_0xc852('0x14')][util[_0xc852('0x5f')](_0xc852('0x117'),_0xb06b78['name'])][_0xc852('0x7e')]==='unmonitored');};Preview['prototype']['run']=function(_0x29ceac,_0x1ae2ae){var _0x264dfe=this;return new BPromise(function(_0x47e41e,_0x64eead){_0x264dfe['execRun'](_0x29ceac,_0x1ae2ae)[_0xc852('0x89')](function(_0x52db70){_0x47e41e(_['pick'](_0x52db70,[_0xc852('0x55')]));})[_0xc852('0x80')](function(_0x215a74){if(_0x215a74[_0xc852('0x119')]){rpcDb['unlockContact'](_0x29ceac);}if(_0x215a74[_0xc852('0x11a')]){rpcDb[_0xc852('0x93')](_0x29ceac);}_0x64eead(_[_0xc852('0x78')](_0x215a74,[_0xc852('0x55')]));});});};Preview['prototype']['execRun']=function(_0x48e08e,_0x1c9fc2){var _0x3aa741=this;return new BPromise(function(_0x54fb43,_0x191ca5){var _0x4995e5,_0x1227d9;rpcDb[_0xc852('0x11b')](_0x48e08e)[_0xc852('0x89')](function(_0x5edcba){if(!_[_0xc852('0x73')](_0x5edcba[0x0])){_0x1227d9=_0x5edcba[0x0][_0xc852('0x11c')]?![]:!![];_0x4995e5=_0x5edcba[0x0][_0xc852('0x11c')]?!![]:![];_0x4995e5=_0x1c9fc2?!![]:_0x4995e5;}var _0x49e3bd=_0x3aa741[_0xc852('0x11d')](_0x5edcba);if(_0x49e3bd[_0xc852('0x11e')]){rpcDb[_0xc852('0x11f')](_[_0xc852('0x78')](_0x5edcba[0x0],[_0xc852('0x7b'),_0xc852('0x120')]))[_0xc852('0x89')](function(_0x5cc36f){_0x3aa741['checkInBlack'](_0x5cc36f,_0x5edcba[0x0],_0x1c9fc2,_0x1227d9,_0x4995e5)[_0xc852('0x89')](function(_0x5bd184){_0x54fb43(_0x5bd184);})[_0xc852('0x80')](function(_0x3374c4){_0x191ca5(_0x3374c4);});})[_0xc852('0x80')](function(_0x50329b){ut['logger'](_0xc852('0x121'),_0x50329b);_0x191ca5(ut[_0xc852('0x55')]('Call\x20unsuccessful',_0x1227d9,_0x4995e5));});}else{_0x191ca5(ut['message'](_0x49e3bd[_0xc852('0x55')],_0x1227d9,_0x4995e5));}})[_0xc852('0x80')](function(_0x581dc8){ut['logger'](_0xc852('0x122'),_0x581dc8);_0x191ca5(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xc852('0xe')]['validateContact']=function(_0x39e9ea){if(_[_0xc852('0x73')](_0x39e9ea)||_[_0xc852('0x123')](_0x39e9ea)||!_[_0xc852('0x73')](_0x39e9ea[0x0][_0xc852('0x8e')])&&_[_0xc852('0x73')](_0x39e9ea[0x0][_0xc852('0x8e')][_0xc852('0x29')])){ut[_0xc852('0x69')](_0xc852('0x124'),_0x39e9ea);return{'isValid':![],'message':_0xc852('0x125')};}var _0x1eed9c=this[_0xc852('0x12')][_0x39e9ea[0x0][_0xc852('0x74')][_0xc852('0x29')]];_0x1eed9c['message']='ACTIVE';if(_[_0xc852('0x73')](_0x1eed9c)){ut['logger'](_0xc852('0x126'),_0x1eed9c);return{'isValid':![],'message':_0xc852('0x127')};}if(!this[_0xc852('0xa1')](_0x1eed9c['Trunk'])){ut[_0xc852('0x69')](_0xc852('0x128'),_0xc852('0x129')+_0x1eed9c['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xc852('0xa1')](_0x1eed9c[_0xc852('0x12a')])){ut[_0xc852('0x69')](_0xc852('0x128'),_0x1eed9c['name']+_0xc852('0x12b'));return{'isValid':![],'message':_0xc852('0x12c')};}}if(!ut[_0xc852('0xa0')](_0x1eed9c[_0xc852('0x36')])){ut[_0xc852('0x69')](_0xc852('0x12d'),_0x1eed9c[_0xc852('0x29')]+_0xc852('0x12e'));return{'isValid':![],'message':_0xc852('0x129')+_0x1eed9c['name']+_0xc852('0x12e')};}return{'isValid':!![],'message':_0xc852('0x12f')};};Preview['prototype'][_0xc852('0x10c')]=function(_0x1beeda,_0x799d30,_0x4ca56e,_0x38809a){var _0x154be1=this;return new BPromise(function(_0x11de5c,_0x5ebbc8){var _0x2ceb81=_0x1beeda[_0xc852('0xb6')];var _0x2a250b=_0x154be1[_0xc852('0xa1')](_0x799d30[_0xc852('0x5c')])?util['format']('SIP/%s/%s%s',_0x799d30[_0xc852('0x5c')][_0xc852('0x29')],_[_0xc852('0x73')](_0x799d30[_0xc852('0x3b')])?'':_0x799d30[_0xc852('0x3b')][_0xc852('0x130')]()||'',_0x799d30[_0xc852('0x131')]>0x0?_0x4ca56e[_0xc852('0x108')]['phone'][_0xc852('0x132')](_0x799d30[_0xc852('0x131')]):_0x4ca56e['Contact'][_0xc852('0x109')]):util['format'](_0xc852('0x133'),_['isNil'](_0x799d30[_0xc852('0x12a')])?_0x799d30[_0xc852('0x5c')][_0xc852('0x29')]:_0x799d30[_0xc852('0x12a')]['name'],_[_0xc852('0x73')](_0x799d30['dialPrefix'])?'':_0x799d30['dialPrefix'][_0xc852('0x130')]()||'',_0x799d30['dialCutDigit']>0x0?_0x4ca56e[_0xc852('0x108')][_0xc852('0x109')][_0xc852('0x132')](_0x799d30[_0xc852('0x131')]):_0x4ca56e[_0xc852('0x108')]['phone']);var _0xfb0c11=_0x154be1['isTrunkReachable'](_0x799d30[_0xc852('0x5c')])?ut[_0xc852('0x134')](_0x799d30['Trunk'][_0xc852('0x135')],_0x799d30[_0xc852('0x38')],_0x799d30['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xc852('0x136')](_0x799d30[_0xc852('0x39')],_0x799d30[_0xc852('0x137')]):_0x799d30[_0xc852('0x39')]):ut[_0xc852('0x134')](_[_0xc852('0x73')](_0x799d30['TrunkBackup'])?_0x799d30[_0xc852('0x5c')][_0xc852('0x135')]:_0x799d30[_0xc852('0x12a')][_0xc852('0x135')],_0x799d30[_0xc852('0x38')],_0x799d30[_0xc852('0x137')]>0x0?ut[_0xc852('0x136')](_0x799d30[_0xc852('0x39')],_0x799d30[_0xc852('0x137')]):_0x799d30[_0xc852('0x39')]);if(_0xfb0c11){_0x1beeda['originatecalleridname']=ut[_0xc852('0x138')](_0xfb0c11);_0x1beeda[_0xc852('0x139')]=ut[_0xc852('0x13a')](_0xfb0c11);}var _0x4fd363=ut['addVariables'](_0x799d30,_0x4ca56e,_0x2a250b,_0xfb0c11,_0x2ceb81,_0x1beeda);_[_0xc852('0x13b')](_0x1beeda,ut[_0xc852('0x13c')](_0x4fd363));_0x1beeda['starttime']=moment()['format'](_0xc852('0x94'));ami['Action'](ut['variablesAction'](_0x1beeda,_0x799d30,_0x4fd363,_0x1beeda['activeContact'],_0x38809a))[_0xc852('0x89')](function(_0x7af72c){var _0x30f1ec=_0x1beeda[_0xc852('0x13d')];if(!_[_0xc852('0x73')](_0x30f1ec)){if(!_[_0xc852('0x73')](_0x154be1[_0xc852('0x16')][_0x30f1ec])){_0x154be1[_0xc852('0x16')][_0x30f1ec]['destconnectedlinenum']=_0x1beeda['calleridnum'];emit(util[_0xc852('0x5f')](_0xc852('0x13e'),_0x154be1[_0xc852('0x16')][_0x30f1ec]['name']),_0xc852('0x13f'),{'destaccountcode':_0x154be1['agents'][_0x30f1ec][_0xc852('0x140')],'destconnectedlinenum':_0x1beeda[_0xc852('0x141')]});}}_0x799d30['originated']+=0x1;logger[_0xc852('0x62')](_0xc852('0x142'),_0x2ceb81,'\x20Queue',_0x799d30['name'],_0xc852('0x75'),_0x799d30[_0xc852('0x56')]);_0x11de5c(_0x7af72c);})[_0xc852('0x80')](function(_0x4bebf5){ut[_0xc852('0xff')](_0x1beeda,0xe,_0xc852('0x143'));rpcDb['createAgentHistory'](_0x1beeda,_0xc852('0x144'));_0x5ebbc8(_0x4bebf5);});});};Preview['prototype']['syncNewExten']=function(_0x55902b){if(this[_0xc852('0x15')][_0x55902b[_0xc852('0xb1')]]){this[_0xc852('0x15')][_0x55902b['linkedid']]['channel']=_0x55902b[_0xc852('0x7f')];}};Preview[_0xc852('0xe')][_0xc852('0x145')]=function(_0x5c2e2c){var _0xff9b36=this;var _0x241a6e=this[_0xc852('0x15')][_0x5c2e2c['actionid']];if(_0x241a6e){if(_0x241a6e[_0xc852('0x10b')]&&this['agents'][_0x241a6e['lookAgent']]){ut[_0xc852('0x146')](_0x241a6e,this[_0xc852('0x16')][_0x241a6e[_0xc852('0x10b')]][_0xc852('0x29')],this['agents'][_0x241a6e[_0xc852('0x10b')]]['id']);}var _0x5bba51=_[_0xc852('0x147')](_0x241a6e);_0x5bba51[_0xc852('0xb3')]=moment()['format'](_0xc852('0x94'));var _0x5b8b7e=_0xff9b36[_0xc852('0x12')][_0x241a6e[_0xc852('0x76')]];if(ut[_0xc852('0x148')](_0x5c2e2c['response'])){if(_0x241a6e['unlockAgent']){rpcDb[_0xc852('0x149')](_0x241a6e[_0xc852('0x10f')]);}if(_0x241a6e[_0xc852('0xe1')]){rpcDb[_0xc852('0x93')](_0x241a6e['idContact']);}ami[_0xc852('0x26')](_0xc852('0x14a'),ut[_0xc852('0xbf')](_0x241a6e,_0xc852('0x14b'),this[_0xc852('0x12')][_0x241a6e[_0xc852('0x76')]]));this[_0xc852('0xfa')](_0x5bba51,_0x5b8b7e,_0x5c2e2c);}else{_0x241a6e[_0xc852('0x14c')]=moment()[_0xc852('0x5f')](_0xc852('0x94'));ut[_0xc852('0xff')](_0x5bba51,0x4,_0xc852('0xc2'));rpcDb['createAgentHistory'](_0x5bba51,_0xc852('0x14d'));}}};Preview[_0xc852('0xe')][_0xc852('0x1b')]=function(_0xc4bdbf){var _0x35d5ee=this;var _0x2b059a=this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]];var _0x5a8084;if(_0x2b059a){_0x5a8084=this['campaignsPreview'][_0x2b059a[_0xc852('0x76')]];logger['info']('[syncHangup][talking]',_0xc4bdbf[_0xc852('0xb1')],_0xc852('0xb7'),_0x5a8084[_0xc852('0x29')],_0xc852('0xb8'),_0x5a8084[_0xc852('0x2d')]);}if(this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]]&&_0xc4bdbf[_0xc852('0xb1')]!==_0xc4bdbf[_0xc852('0xb6')]){if(_0xc4bdbf[_0xc852('0x14e')]==='16'&&this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]][_0xc852('0x77')]){this[_0xc852('0xa3')](_0xc4bdbf,_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf[_0xc852('0x14e')]);}else if(this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]][_0xc852('0x77')]){logger[_0xc852('0x62')](_0xc852('0x14f'),_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf[_0xc852('0x14e')],_0xc852('0xb7'),_0x5a8084[_0xc852('0x29')],_0xc852('0xb8'),_0x5a8084['pTalking']);this[_0xc852('0xa3')](_0xc4bdbf,_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf['cause']);}}else if(_0x2b059a&&_[_0xc852('0x73')](_0x2b059a[_0xc852('0x150')])&&_0x5a8084[_0xc852('0x151')]&&_0xc4bdbf['linkedid']===_0xc4bdbf[_0xc852('0xb6')]&&_[_0xc852('0x73')](_0xc4bdbf[_0xc852('0xfd')])&&_0xc4bdbf['cause']==='16'&&_0xc4bdbf['channelstate']==='6'&&_[_0xc852('0xfc')](_0x2b059a[_0xc852('0x152')])){if(_0x2b059a[_0xc852('0xd0')]){rpcDb[_0xc852('0x149')](_0x2b059a[_0xc852('0x10f')]);}if(_0x2b059a[_0xc852('0xe1')]){rpcDb['disableContact'](_0x2b059a[_0xc852('0x10f')]);}_0xc4bdbf[_0xc852('0xfd')]='22';this[_0xc852('0xfa')](_0x2b059a,_0x5a8084,_0xc4bdbf);}else if(_0x2b059a&&_0x2b059a['transfer']){if(_0xc4bdbf[_0xc852('0x14e')]==='16'&&this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]]['dialAnswer']){logger[_0xc852('0x62')](_0xc852('0x153'),_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf[_0xc852('0x14e')],_0xc852('0xb7'),_0x5a8084['name'],_0xc852('0xb8'),_0x5a8084[_0xc852('0x2d')]);this['callProgressDetectingCustomer'](_0xc4bdbf,_0xc4bdbf['linkedid'],_0xc4bdbf['cause']);}else if(this[_0xc852('0x15')][_0xc4bdbf[_0xc852('0xb1')]][_0xc852('0x77')]){logger[_0xc852('0x62')](_0xc852('0x14f'),_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf[_0xc852('0x14e')],_0xc852('0xb7'),_0x5a8084[_0xc852('0x29')],'pTalking:\x20',_0x5a8084['pTalking']);this[_0xc852('0xa3')](_0xc4bdbf,_0xc4bdbf[_0xc852('0xb1')],_0xc4bdbf[_0xc852('0x14e')]);}}};Preview[_0xc852('0xe')]['syncDialEnd']=function(_0x56c33b){if(this['actions'][_0x56c33b['destlinkedid']]&&_0x56c33b['destlinkedid']!==_0x56c33b[_0xc852('0x154')]){this['callProgressDetectingCustomer'](_0x56c33b,_0x56c33b['destlinkedid'],_0x56c33b['dialstatus']);}};Preview[_0xc852('0xe')][_0xc852('0x1d')]=function(_0x2e86e5){if(this[_0xc852('0x15')][_0x2e86e5[_0xc852('0xb1')]]&&_0x2e86e5['linkedid']!==_0x2e86e5[_0xc852('0xb6')]&&!this['actions'][_0x2e86e5[_0xc852('0xb1')]]['dialAnswer']){if(_0x2e86e5[_0xc852('0x14e')]==='1'){this[_0xc852('0xa3')](_0x2e86e5,_0x2e86e5[_0xc852('0xb1')],_0x2e86e5[_0xc852('0x14e')]);}}};Preview[_0xc852('0xe')]['addVariable']=function(_0x3658a8,_0x59de64,_0x4bc70c){if(this[_0xc852('0x15')][_0x3658a8]){if(_[_0xc852('0x73')](this['actions'][_0x3658a8][_0xc852('0x155')])){this[_0xc852('0x15')][_0x3658a8][_0xc852('0x155')]={};}this[_0xc852('0x15')][_0x3658a8][_0xc852('0x155')][_0x59de64]=_0x4bc70c;}};Preview[_0xc852('0xe')][_0xc852('0x21')]=function(_0x14a0f7){try{if(!_['isNil'](_0x14a0f7)){if(ut[_0xc852('0x156')](_[_0xc852('0x157')](_0x14a0f7[_0xc852('0x158')])[0x0])){this[_0xc852('0x159')](_0x14a0f7[_0xc852('0xb6')],_[_0xc852('0x157')](_0x14a0f7[_0xc852('0x158')])[0x0],_0x14a0f7[_0xc852('0x15a')]);}}}catch(_0x138a80){logger[_0xc852('0x15b')](_0xc852('0x15c'),util['inspect'](_0x138a80,{'showHidden':![],'depth':null}));}};Preview[_0xc852('0xe')]['syncAttendedTransfer']=function(_0x1e7bba){if(_0x1e7bba){if(this[_0xc852('0x15')][_0x1e7bba[_0xc852('0x15d')]]){this[_0xc852('0x15')][_0x1e7bba[_0xc852('0x15d')]][_0xc852('0x152')]=!![];}}};Preview[_0xc852('0xe')][_0xc852('0x24')]=function(_0x34db9b){if(_0x34db9b){if(this[_0xc852('0x15')][_0x34db9b[_0xc852('0x15e')]]){this['actions'][_0x34db9b[_0xc852('0x15e')]][_0xc852('0x152')]=!![];}}};module[_0xc852('0x15f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 26bc4bb..b562de9 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 _0x313c=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','exten','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x9fcee7,_0x4b0d67){var _0x4abb59=function(_0x28c2d9){while(--_0x28c2d9){_0x9fcee7['push'](_0x9fcee7['shift']());}};_0x4abb59(++_0x4b0d67);}(_0x313c,0xb7));var _0xc313=function(_0xe73ae4,_0x36b182){_0xe73ae4=_0xe73ae4-0x0;var _0x3edb55=_0x313c[_0xe73ae4];return _0x3edb55;};'use strict';var util=require(_0xc313('0x0'));var BPromise=require(_0xc313('0x1'));var logger=require('../../../config/logger')(_0xc313('0x2'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xc313('0x3'));var cmHopperHistory=require(_0xc313('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xc313('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x39324c){return function(_0x48c42a){logger[_0xc313('0x6')](_0x39324c,util[_0xc313('0x7')](_0x48c42a,{'showHidden':![],'depth':null}));};}function create(_0x4f61ca){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopperHistory[_0xc313('0xa')](_0x4f61ca))[_0xc313('0xb')](loggerCatch(_0xc313('0xc')));}function createAgent(_0xa68ce5){return BPromise['resolve']()[_0xc313('0x9')](agentReportPreview[_0xc313('0xa')](_0xa68ce5))[_0xc313('0xb')](loggerCatch(_0xc313('0xc')));}function moveContact(_0x3b4e9c){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0xd')](_0x3b4e9c,!![]))['catch'](loggerCatch(_0xc313('0xe')));}exports[_0xc313('0xf')]=function(_0x1444a2){return BPromise['resolve']()[_0xc313('0x9')](cmHopperBlack[_0xc313('0xf')](_0x1444a2))[_0xc313('0xb')](loggerCatch(_0xc313('0x10')));};exports[_0xc313('0x11')]=function(_0x2c04c5){return BPromise[_0xc313('0x8')]()['then'](cmHopper['getContactPreview'](_0x2c04c5))[_0xc313('0xb')](loggerCatch(_0xc313('0x12')));};exports[_0xc313('0xa')]=function(_0x5142bd,_0x5b5345){create(_0x5142bd)[_0xc313('0xb')](loggerCatch(_0x5b5345));moveContact(_0x5142bd)['catch'](loggerCatch(_0x5b5345));};exports['createAgentHistory']=function(_0x3d46a5,_0x2c19d7){createAgent(_0x3d46a5)[_0xc313('0xb')](loggerCatch(_0x2c19d7));};exports[_0xc313('0x13')]=function(_0x99275b,_0x3db07a){create(_0x99275b)['catch'](loggerCatch(_0x3db07a));};exports[_0xc313('0x14')]=function(_0x5b058c,_0x3a15d7){moveContact(_0x5b058c)[_0xc313('0xb')](loggerCatch(_0x3a15d7));};exports[_0xc313('0x15')]=function(_0x1f5054,_0x28944b,_0x31b7b2){if(_0x28944b){_0x1f5054[_0xc313('0x16')]=null;}if(_0x31b7b2){_0x1f5054[_0xc313('0x17')]=![];}return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0x15')](_0x1f5054))[_0xc313('0xb')](loggerCatch(_0xc313('0x18')));};exports['countReScheduled']=function(_0x4d426d){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0x19')](_0x4d426d))['catch'](loggerCatch(_0xc313('0x1a')));};exports['unlockContact']=function(_0xffbb65){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0x1b')]({'UserId':null},_0xffbb65,0x1))[_0xc313('0xb')](loggerCatch(_0xc313('0x1c')));};exports[_0xc313('0x1d')]=function(_0x7d243f){return BPromise['resolve']()[_0xc313('0x9')](cmHopper[_0xc313('0x1b')]({'active':![]},_0x7d243f,0x1))[_0xc313('0xb')](loggerCatch(_0xc313('0x1e')));};exports[_0xc313('0x1f')]=function(_0x205e25){var _0x26b332={};_0x26b332[_0xc313('0x20')]=_0x205e25[_0xc313('0x20')];_0x26b332[_0xc313('0x21')]=_0x205e25[_0xc313('0x21')];_0x26b332[_0xc313('0x22')]=_0x205e25[_0xc313('0x22')];_0x26b332[_0xc313('0x23')]=_0x205e25[_0xc313('0x23')];_0x26b332[_0xc313('0x24')]=_0x205e25[_0xc313('0x24')];_0x26b332[_0xc313('0x25')]=_0x205e25[_0xc313('0x26')];_0x26b332[_0xc313('0x27')]=_0x205e25[_0xc313('0x26')];_0x26b332[_0xc313('0x28')]=0x1;_0x26b332[_0xc313('0x29')]=_0x205e25[_0xc313('0x2a')];_0x26b332[_0xc313('0x2b')]=_0x205e25[_0xc313('0x2c')];_0x26b332['context']='from-sip';_0x26b332[_0xc313('0x2d')]='xcally-motion-preview';_0x26b332[_0xc313('0x2e')]=0x0;_0x26b332[_0xc313('0x2f')]=0x1;_0x26b332[_0xc313('0x30')]=_0x205e25[_0xc313('0x2c')];_0x26b332['queuecallerexitreason']=_0xc313('0x31');return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](voiceQueueReport[_0xc313('0x32')](_0x26b332))['catch'](loggerCatch(_0xc313('0x33')));};exports[_0xc313('0x34')]=function(_0x3e915d,_0x502ab7){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0x34')](_0x3e915d,_0x502ab7))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xc313('0x35')]=function(_0x476901){return BPromise[_0xc313('0x8')]()[_0xc313('0x9')](cmHopper[_0xc313('0x15')](_0x476901,!![],!![]))['catch'](loggerCatch(_0xc313('0x36')));}; \ No newline at end of file +var _0x63d0=['catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory'];(function(_0x41ce34,_0x22932a){var _0x580c63=function(_0x46a806){while(--_0x46a806){_0x41ce34['push'](_0x41ce34['shift']());}};_0x580c63(++_0x22932a);}(_0x63d0,0x92));var _0x063d=function(_0x2ac442,_0x53769c){_0x2ac442=_0x2ac442-0x0;var _0x3ecfd7=_0x63d0[_0x2ac442];return _0x3ecfd7;};'use strict';var util=require(_0x063d('0x0'));var BPromise=require(_0x063d('0x1'));var logger=require('../../../config/logger')(_0x063d('0x2'));var _=require(_0x063d('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x063d('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x063d('0x5'));var voiceQueueRt=require(_0x063d('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x063d('0x7'));function loggerCatch(_0x56ae1c){return function(_0x59788c){logger[_0x063d('0x8')](_0x56ae1c,util[_0x063d('0x9')](_0x59788c,{'showHidden':![],'depth':null}));};}function create(_0x382073){return BPromise[_0x063d('0xa')]()[_0x063d('0xb')](cmHopperHistory[_0x063d('0xc')](_0x382073))[_0x063d('0xd')](loggerCatch(_0x063d('0xe')));}function createAgent(_0x55f6c1){return BPromise['resolve']()[_0x063d('0xb')](agentReportPreview['createHistory'](_0x55f6c1))[_0x063d('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2c8a8d){return BPromise['resolve']()[_0x063d('0xb')](cmHopper[_0x063d('0xf')](_0x2c8a8d,!![]))[_0x063d('0xd')](loggerCatch(_0x063d('0x10')));}exports[_0x063d('0x11')]=function(_0x348c7c){return BPromise[_0x063d('0xa')]()['then'](cmHopperBlack[_0x063d('0x11')](_0x348c7c))[_0x063d('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x063d('0x12')]=function(_0x147926){return BPromise['resolve']()[_0x063d('0xb')](cmHopper[_0x063d('0x12')](_0x147926))[_0x063d('0xd')](loggerCatch(_0x063d('0x13')));};exports[_0x063d('0xc')]=function(_0x227f5f,_0x41ecc3){create(_0x227f5f)[_0x063d('0xd')](loggerCatch(_0x41ecc3));moveContact(_0x227f5f)[_0x063d('0xd')](loggerCatch(_0x41ecc3));};exports[_0x063d('0x14')]=function(_0x41d477,_0x471927){createAgent(_0x41d477)['catch'](loggerCatch(_0x471927));};exports[_0x063d('0x15')]=function(_0x4cc386,_0x16ec7a){create(_0x4cc386)['catch'](loggerCatch(_0x16ec7a));};exports[_0x063d('0x16')]=function(_0x1686b0,_0x29a47b){moveContact(_0x1686b0)[_0x063d('0xd')](loggerCatch(_0x29a47b));};exports[_0x063d('0x17')]=function(_0x3d59ee,_0x342e96,_0x170c54){if(_0x342e96){_0x3d59ee[_0x063d('0x18')]=null;}if(_0x170c54){_0x3d59ee[_0x063d('0x19')]=![];}return BPromise[_0x063d('0xa')]()['then'](cmHopper[_0x063d('0x17')](_0x3d59ee))[_0x063d('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x2d1958){return BPromise['resolve']()[_0x063d('0xb')](cmHopper[_0x063d('0x1a')](_0x2d1958))[_0x063d('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x063d('0x1b')]=function(_0x341955){return BPromise[_0x063d('0xa')]()['then'](cmHopper[_0x063d('0x1b')]({'UserId':null},_0x341955,0x1))[_0x063d('0xd')](loggerCatch(_0x063d('0x1c')));};exports[_0x063d('0x1d')]=function(_0x3eb665){return BPromise[_0x063d('0xa')]()[_0x063d('0xb')](cmHopper[_0x063d('0x1b')]({'active':![]},_0x3eb665,0x1))[_0x063d('0xd')](loggerCatch(_0x063d('0x1e')));};exports[_0x063d('0x1f')]=function(_0x5bc0ba){var _0x3f4c7a={};_0x3f4c7a['type']=_0x5bc0ba['type'];_0x3f4c7a[_0x063d('0x20')]=_0x5bc0ba[_0x063d('0x20')];_0x3f4c7a['calleridnum']=_0x5bc0ba[_0x063d('0x21')];_0x3f4c7a[_0x063d('0x22')]=_0x5bc0ba['calleridname'];_0x3f4c7a[_0x063d('0x23')]=_0x5bc0ba['queue'];_0x3f4c7a[_0x063d('0x24')]=_0x5bc0ba[_0x063d('0x25')];_0x3f4c7a[_0x063d('0x26')]=_0x5bc0ba['answertime'];_0x3f4c7a[_0x063d('0x27')]=0x1;_0x3f4c7a[_0x063d('0x28')]=_0x5bc0ba[_0x063d('0x29')];_0x3f4c7a[_0x063d('0x2a')]=_0x5bc0ba['membername'];_0x3f4c7a[_0x063d('0x2b')]='from-sip';_0x3f4c7a['exten']=_0x063d('0x2c');_0x3f4c7a[_0x063d('0x2d')]=0x0;_0x3f4c7a['assigned']=0x1;_0x3f4c7a[_0x063d('0x2e')]=_0x5bc0ba['membername'];_0x3f4c7a[_0x063d('0x2f')]='COMPLETED';return BPromise['resolve']()[_0x063d('0xb')](voiceQueueReport[_0x063d('0x30')](_0x3f4c7a))[_0x063d('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x063d('0x31')]=function(_0x2c1c19,_0x14d652){return BPromise[_0x063d('0xa')]()[_0x063d('0xb')](cmHopper[_0x063d('0x31')](_0x2c1c19,_0x14d652))['catch'](loggerCatch(_0x063d('0x32')));};exports[_0x063d('0x33')]=function(_0x529d1f){return BPromise['resolve']()['then'](cmHopper[_0x063d('0x17')](_0x529d1f,!![],!![]))[_0x063d('0xd')](loggerCatch(_0x063d('0x34')));}; \ 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 7d5e1f0..c3ab17d 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 _0x4aa1=['buildAcw','interface','agentReadyId','not_inuse','status','push','getDiff','milliseconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countbusyretry','callback','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','extractCalleridName','match','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','Queue','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','updatedAt','%s%s','XMD-','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','membername','UserId','endtime','answertime','Failure','variablesAction','calleridname','BOOKED','originate','from-sip','timeout','uniqueid','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','channelAgent','motionChannel','voice','mandatoryDisposition'];(function(_0x4c4c5c,_0x2f5175){var _0x3be30e=function(_0x5ae40c){while(--_0x5ae40c){_0x4c4c5c['push'](_0x4c4c5c['shift']());}};_0x3be30e(++_0x2f5175);}(_0x4aa1,0xb3));var _0x14aa=function(_0x429042,_0x11a6f6){_0x429042=_0x429042-0x0;var _0x7bbe69=_0x4aa1[_0x429042];return _0x7bbe69;};'use strict';var util=require(_0x14aa('0x0'));var _=require('lodash');var moment=require(_0x14aa('0x1'));var logger=require(_0x14aa('0x2'))(_0x14aa('0x3'));var ipAgi=process[_0x14aa('0x4')][_0x14aa('0x5')]||'127.0.0.1';function getSeconds(_0x3159b4,_0x4149e9){var _0x24e1ef=moment(_0x3159b4)['milliseconds'](0x0);var _0x56394b=moment(_0x4149e9)['milliseconds'](0x0);return _0x24e1ef[_0x14aa('0x6')](_0x56394b,_0x14aa('0x7'));}exports[_0x14aa('0x8')]=function(_0x46c906){return function(_0x35f93f){logger[_0x14aa('0x9')](_0x46c906,util[_0x14aa('0xa')](_0x35f93f,{'showHidden':![],'depth':null}));};};exports[_0x14aa('0xb')]=function(_0x4e23dd,_0x19c628){logger[_0x14aa('0xc')](_0x4e23dd,util['inspect'](_0x19c628,{'showHidden':![],'depth':null}));};exports[_0x14aa('0xd')]=function(_0x11773e,_0x435050){logger[_0x14aa('0x9')](_0x11773e,util[_0x14aa('0xa')](_0x435050,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3861c0){return function(_0x21f7fd){logger[_0x14aa('0xc')](_0x3861c0,util[_0x14aa('0xa')](_0x21f7fd,{'showHidden':![],'depth':null}));};};exports[_0x14aa('0xe')]=function(_0x165077,_0x225e80,_0x1926fb){return{'message':_0x165077,'unlock':_0x225e80,'active':_0x1926fb};};exports[_0x14aa('0xf')]=function(_0x46f6a0,_0x429114,_0x27bead){if(!_[_0x14aa('0x10')](_0x27bead)&&_0x14aa('0x11')===typeof _0x27bead&&!_[_0x14aa('0x12')](_0x27bead)){if(!_['isUndefined'](_0x429114)&&_0x14aa('0x11')===typeof _0x429114&&!_[_0x14aa('0x12')](_0x429114)){return util['format'](_0x14aa('0x13'),_0x429114,_0x27bead);}return util[_0x14aa('0x14')](_0x14aa('0x13'),_0x27bead,_0x27bead);}if(!_[_0x14aa('0x10')](_0x46f6a0)&&_0x14aa('0x11')===typeof _0x46f6a0&&!_['isEmpty'](_0x46f6a0)){return _0x46f6a0;}return _0x14aa('0x15');};exports['isActive']=function(_0x27504c){if(_['isNil'](_0x27504c)){return![];}return _0x27504c;};exports[_0x14aa('0x16')]=function(_0x16e594,_0x4f6dfe,_0x1cae64,_0x3ff181,_0x1cfcc7,_0x18ccd0){var _0x30c9b4={'XMD-QUEUE':_0x4f6dfe[_0x14aa('0x17')]?_0x4f6dfe[_0x14aa('0x17')]['name']:'','XMD-CALLERID':_0x3ff181,'XMD-CALLERID-PREVIEW':_0x18ccd0?util[_0x14aa('0x14')](_0x14aa('0x13'),_0x18ccd0['calleridname'],_0x18ccd0[_0x14aa('0x18')]):_0x3ff181,'XMD-DIALID':_0x1cfcc7,'XMD-CONTACTID':_0x4f6dfe['ContactId'],'XMD-CDRTYPE':_0x14aa('0x19'),'CALLERID(all)':_0x3ff181,'XMD-VOICEQUEUEID':_0x4f6dfe[_0x14aa('0x1a')],'XMD-DIALCHANNEL':_0x1cae64,'XMD-DIALTIMEOUT':_0x16e594['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x14aa('0x14')](_0x14aa('0x1b'),_0x16e594['dialQueueProject2']?'g':'',_[_0x14aa('0x12')](_0x16e594['monitor_format'])?'':_0x14aa('0x1c')),'XMD-DIALURL':_0x16e594['dialPreviewUrl']||'','XMD-AGI':_0x16e594['dialQueueProject']?util['format'](_0x14aa('0x1d'),ipAgi,_0x16e594[_0x14aa('0x1e')]):_0x14aa('0x1f'),'XMD-AGIAFTER':_0x16e594['dialQueueProject2']?util[_0x14aa('0x14')](_0x14aa('0x1d'),ipAgi,_0x16e594[_0x14aa('0x20')]):_0x14aa('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x18ccd0?_0x18ccd0[_0x14aa('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x18ccd0?_0x18ccd0['originatecalleridname']:'','XMD-DESTINATION':_0x14aa('0x22')};if(!_[_0x14aa('0x12')](_0x16e594[_0x14aa('0x23')])){_0x30c9b4[util[_0x14aa('0x14')]('%s',_0x14aa('0x24'))]=_0x16e594[_0x14aa('0x23')];_0x30c9b4[util['format']('%s',_0x14aa('0x25'))]=_0x1cfcc7;}if(_0x4f6dfe&&_0x4f6dfe[_0x14aa('0x26')]){for(var _0x68c841 in _0x4f6dfe[_0x14aa('0x26')]){if(_0x4f6dfe['Contact'][_0x14aa('0x27')](_0x68c841)){if(!_[_0x14aa('0x28')](_0x4f6dfe['Contact'][_0x68c841])&&_0x68c841!=='id'&&_0x68c841!=='tags'&&_0x68c841!=='createdAt'&&_0x68c841!==_0x14aa('0x29')){_0x30c9b4[util[_0x14aa('0x14')](_0x14aa('0x2a'),_0x14aa('0x2b'),_['toUpper'](_0x68c841))]=_0x4f6dfe[_0x14aa('0x26')][_0x68c841];}}}}return _0x30c9b4;};exports['toLowerVariables']=function(_0x65bf4a){var _0x3e85af={};for(var _0x46c03c in _0x65bf4a){if(_0x65bf4a[_0x14aa('0x27')](_0x46c03c)){_0x3e85af[util[_0x14aa('0x14')]('%s',_[_0x14aa('0x2c')](_0x46c03c))]=_0x65bf4a[_0x46c03c];}}return{'variables':_0x3e85af};};exports['updateOriginated']=function(_0x2ce7d8,_0x1bff5a){if(!_[_0x14aa('0x28')](_0x2ce7d8)){if(_0x2ce7d8[_0x14aa('0x27')](_0x14aa('0x2d'))){if(_0x2ce7d8[_0x14aa('0x2d')]>0x0){_0x2ce7d8[_0x14aa('0x2d')]-=0x1;}else{logger['error'](_0x14aa('0x2e'),_0x1bff5a);}}}else{logger[_0x14aa('0x9')](_0x14aa('0x2f'),_0x1bff5a);}};exports[_0x14aa('0x30')]=function(_0x4587d2){var _0xf6921b=moment()[_0x14aa('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x4587d2[_0x14aa('0x31')]=0xd;_0x4587d2[_0x14aa('0x32')]=_0x14aa('0x33');_0x4587d2[_0x14aa('0x34')]=_0xf6921b;_0x4587d2['responsetime']=_0xf6921b;_0x4587d2['endtime']=_0xf6921b;};exports[_0x14aa('0x35')]=function(_0x230d35,_0x3794b2,_0xfe4cf1){var _0x487d1b=moment()['format'](_0x14aa('0x36'));_0x230d35['state']=_0x3794b2;_0x230d35['statedesc']=_0xfe4cf1;_0x230d35[_0x14aa('0x37')]=_0x487d1b;_0x230d35[_0x14aa('0x38')]=getSeconds(_0x230d35['responsetime'],_0x230d35[_0x14aa('0x34')]);};exports['logLookAgent']=function(_0x58a3e1,_0x2548bd,_0x1e74f1){_0x58a3e1[_0x14aa('0x39')]=_0x2548bd;_0x58a3e1[_0x14aa('0x3a')]=_0x1e74f1;};exports['logCustomer']=function(_0x528544,_0x4e1bce,_0xd1b118){var _0x4c137d=moment()[_0x14aa('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x528544['state']=_0x4e1bce;_0x528544[_0x14aa('0x32')]=_0xd1b118;_0x528544[_0x14aa('0x37')]=_0x528544[_0x14aa('0x37')]?_0x528544['responsetime']:_0x4c137d;_0x528544[_0x14aa('0x3b')]=_0x528544['endtime']?_0x528544[_0x14aa('0x3b')]:_0x4c137d;_0x528544[_0x14aa('0x38')]=getSeconds(_0x528544[_0x14aa('0x37')]||0x0,_0x528544['starttime']||0x0);_0x528544['talktime']=_0x528544[_0x14aa('0x3c')]?getSeconds(_0x528544['endtime'],_0x528544[_0x14aa('0x3c')]):0x0;};exports['isFailure']=function(_0x174eb4){return _0x174eb4===_0x14aa('0x3d');};exports[_0x14aa('0x3e')]=function(_0x3d36e9,_0x14cd0e,_0x19820d,_0x3e3515,_0x4b7749){var _0x3efba3=_0x3e3515?'RECALL':_0x3d36e9[_0x14aa('0x3f')];_0x3efba3=_0x4b7749?_0x14aa('0x40'):_0x3efba3;return{'actionid':_0x3d36e9['uniqueid'],'action':_0x14aa('0x41'),'channel':_0x3d36e9['channelAgent'],'callerid':util[_0x14aa('0x14')](_0x14aa('0x13'),_0x3efba3,_0x3d36e9['calleridnum']),'Exten':_0x14aa('0x22'),'Context':_0x14aa('0x42'),'Priority':'1','variable':_0x19820d,'timeout':(_0x14cd0e[_0x14aa('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3d36e9[_0x14aa('0x44')]};};exports['totalGlobal']=function(_0x458d75){return _0x458d75['countbusyretry']+_0x458d75[_0x14aa('0x45')]+_0x458d75[_0x14aa('0x46')]+_0x458d75[_0x14aa('0x47')]+_0x458d75[_0x14aa('0x48')];};exports[_0x14aa('0x49')]=function(_0x5f4b86){var _0x42baa1=_[_0x14aa('0x4a')](_0x5f4b86);_0x42baa1[_0x14aa('0x31')]=0xf;_0x42baa1[_0x14aa('0x32')]=_0x14aa('0x4b');return _0x42baa1;};exports[_0x14aa('0x4c')]=function(_0x3f2332,_0x1fe2cd,_0x501e49){var _0x1de55={};_0x1de55[_0x1fe2cd]=_0x3f2332[_0x1fe2cd];_0x1de55[_0x14aa('0x4d')]=![];_0x1de55[_0x14aa('0x4e')]=moment()[_0x14aa('0x4f')](_0x501e49,'minutes')[_0x14aa('0x14')](_0x14aa('0x36'));_0x1de55[_0x14aa('0x50')]=_0x3f2332[_0x14aa('0x50')];_0x1de55['ListId']=_0x3f2332[_0x14aa('0x51')];_0x1de55[_0x14aa('0x1a')]=_0x3f2332[_0x14aa('0x1a')]||undefined;return _0x1de55;};exports[_0x14aa('0x52')]=function(_0x591496,_0x3bdc87){if(!_[_0x14aa('0x28')](_0x591496)){if(_0x591496[_0x14aa('0x53')]>0x0){_0x591496[_0x14aa('0x53')]-=0x1;}else{logger[_0x14aa('0x9')](_0x3bdc87,_0x14aa('0x54'));}}else{logger[_0x14aa('0x9')](_0x3bdc87,_0x14aa('0x55'));}};exports[_0x14aa('0x56')]=function(_0x35f585){if(_0x35f585<=0x0){return!![];}return![];};exports[_0x14aa('0x57')]=function(_0x33ee33,_0x490311,_0x53c2e4){_0x33ee33['lastevent']=_0x490311;_0x33ee33['name']=_0x33ee33[_0x14aa('0x58')];_0x33ee33['interface']=_0x33ee33[_0x14aa('0x59')];_0x33ee33[_0x14aa('0x5a')]=_0x14aa('0x5b');if(_0x53c2e4){_0x33ee33[_0x14aa('0x5c')]=_0x53c2e4[_0x14aa('0x5c')];}return _0x33ee33;};exports[_0x14aa('0x5d')]=function(_0x231858){var _0x577712={};_0x577712[_0x14aa('0x58')]=_0x231858[_0x14aa('0x58')];_0x577712[_0x14aa('0x5e')]=_0x231858[_0x14aa('0x59')];_0x577712[_0x14aa('0x44')]=_0x231858['uniqueid'];return _0x577712;};exports[_0x14aa('0x5f')]=function(_0x582d0c){var _0x3067dd=[];for(var _0x351af6 in _0x582d0c){if(_0x582d0c['hasOwnProperty'](_0x351af6)){if(!_[_0x14aa('0x28')](_0x582d0c[_0x351af6])&&_0x582d0c[_0x351af6][_0x14aa('0x31')]===_0x14aa('0x60')&&_0x582d0c[_0x351af6][_0x14aa('0x61')]==='reachable'){_0x3067dd[_0x14aa('0x62')](_0x582d0c[_0x351af6]['id']);}}}return _0x3067dd;};exports[_0x14aa('0x63')]=function(_0x1c3395){var _0x415793=moment()[_0x14aa('0x64')](0x0);var _0x55856e=moment(_0x1c3395)[_0x14aa('0x64')](0x0);return _0x415793[_0x14aa('0x6')](_0x55856e,'seconds');};exports[_0x14aa('0x65')]=function(_0x52dc9c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x52dc9c[_0x14aa('0x50')],'ListId':_0x52dc9c[_0x14aa('0x51')],'VoiceQueueId':_0x52dc9c[_0x14aa('0x1a')]||undefined,'CampaignId':_0x52dc9c[_0x14aa('0x66')]||undefined};};exports['filterKey']=function(_0x36fc23){if(_0x36fc23===_0x14aa('0x44')||_0x36fc23===_0x14aa('0x67')||_0x36fc23==='queue'||_0x36fc23===_0x14aa('0x68')||_0x36fc23===_0x14aa('0x69')||_0x36fc23===_0x14aa('0x6a')||_0x36fc23===_0x14aa('0x39')||_0x36fc23===_0x14aa('0x59')||_0x36fc23===_0x14aa('0x3f')||_0x36fc23===_0x14aa('0x4d')||_0x36fc23===_0x14aa('0x18')||_0x36fc23===_0x14aa('0x4e')||_0x36fc23===_0x14aa('0x6b')||_0x36fc23===_0x14aa('0x45')||_0x36fc23===_0x14aa('0x46')||_0x36fc23==='countglobal'||_0x36fc23===_0x14aa('0x6c')||_0x36fc23==='callbackuniqueid'||_0x36fc23==='callbackat'||_0x36fc23==='recallme'||_0x36fc23===_0x14aa('0x50')||_0x36fc23===_0x14aa('0x51')||_0x36fc23===_0x14aa('0x3a')||_0x36fc23===_0x14aa('0x1a')||_0x36fc23==='sipcallid'||_0x36fc23===_0x14aa('0x6d')||_0x36fc23==='xmd-queue'||_0x36fc23===_0x14aa('0x6e')||_0x36fc23===_0x14aa('0x6f')||_0x36fc23===_0x14aa('0x70')||_0x36fc23===_0x14aa('0x71')||_0x36fc23===_0x14aa('0x72')||_0x36fc23===_0x14aa('0x73')||_0x36fc23==='xmd-dialchannel'||_0x36fc23===_0x14aa('0x74')||_0x36fc23===_0x14aa('0x75')||_0x36fc23===_0x14aa('0x76')||_0x36fc23===_0x14aa('0x77')||_0x36fc23===_0x14aa('0x78')||_0x36fc23===_0x14aa('0x79')||_0x36fc23===_0x14aa('0x7a')||_0x36fc23===_0x14aa('0x7b')||_0x36fc23==='rtpaudioqosjitterbridged'||_0x36fc23===_0x14aa('0x7c')||_0x36fc23===_0x14aa('0x7d')||_0x36fc23===_0x14aa('0x7e')||_0x36fc23===_0x14aa('0x7f')||_0x36fc23===_0x14aa('0x79')||_0x36fc23==='rtpaudioqosbridged'||_0x36fc23===_0x14aa('0x7b')||_0x36fc23===_0x14aa('0x80')||_0x36fc23===_0x14aa('0x7c')||_0x36fc23===_0x14aa('0x7d')||_0x36fc23==='rtpaudioqosrtt'||_0x36fc23===_0x14aa('0x7f')||_0x36fc23===_0x14aa('0x81')||_0x36fc23===_0x14aa('0x82')||_0x36fc23==='state'||_0x36fc23===_0x14aa('0x32')){return![];}return!![];};exports[_0x14aa('0x83')]=function(_0x5b69df,_0x2e6920){var _0x479acc,_0x53d59d,_0x49dd03;if(_0x2e6920<=0x0){_0x2e6920=0x1;}_0x479acc=new RegExp(_0x14aa('0x84')+_0x2e6920+'}$');_0x53d59d=Math['pow'](0xa,_0x2e6920-0x1);_0x49dd03=Math['pow'](0xa,_0x2e6920)-0x1;return util[_0x14aa('0x14')]('%s',_[_0x14aa('0x85')](_0x5b69df,_0x479acc,_['random'](_0x53d59d,_0x49dd03)));};exports[_0x14aa('0x86')]=function(_0x327bfd){var _0x35b7ba=_0x327bfd[_0x14aa('0x87')](/"(.*?)"/);return _0x35b7ba?_0x35b7ba[0x1]:_0x327bfd;};exports['extractCalleridNumber']=function(_0x257e2f){var _0x460bd4=_0x257e2f[_0x14aa('0x87')](/<(.*?)>/);return _0x460bd4?_0x460bd4[0x1]:_0x257e2f;}; \ No newline at end of file +var _0xd306=['info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countagentrejectretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','name','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','reachable','push','createBody','CampaignId','idContact','campaigntype','dialAnswer','calleridname','active','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-dialurl','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','logger','inspect','loggerError','logger2'];(function(_0x20c27a,_0x10404d){var _0x66f9b8=function(_0x5836ad){while(--_0x5836ad){_0x20c27a['push'](_0x20c27a['shift']());}};_0x66f9b8(++_0x10404d);}(_0xd306,0x194));var _0x6d30=function(_0x4f1051,_0x4435b4){_0x4f1051=_0x4f1051-0x0;var _0x4d9b3b=_0xd306[_0x4f1051];return _0x4d9b3b;};'use strict';var util=require(_0x6d30('0x0'));var _=require(_0x6d30('0x1'));var moment=require(_0x6d30('0x2'));var logger=require(_0x6d30('0x3'))(_0x6d30('0x4'));var ipAgi=process[_0x6d30('0x5')][_0x6d30('0x6')]||_0x6d30('0x7');function getSeconds(_0x3d05b6,_0x1f8f6b){var _0x20adf4=moment(_0x3d05b6)[_0x6d30('0x8')](0x0);var _0x192b31=moment(_0x1f8f6b)[_0x6d30('0x8')](0x0);return _0x20adf4[_0x6d30('0x9')](_0x192b31,_0x6d30('0xa'));}exports['loggerCatch']=function(_0x27e3c5){return function(_0x1ca1c2){logger[_0x6d30('0xb')](_0x27e3c5,util['inspect'](_0x1ca1c2,{'showHidden':![],'depth':null}));};};exports[_0x6d30('0xc')]=function(_0x49678b,_0x1fa28a){logger['info'](_0x49678b,util[_0x6d30('0xd')](_0x1fa28a,{'showHidden':![],'depth':null}));};exports[_0x6d30('0xe')]=function(_0x4caf79,_0x5be1ff){logger['error'](_0x4caf79,util[_0x6d30('0xd')](_0x5be1ff,{'showHidden':![],'depth':null}));};exports[_0x6d30('0xf')]=function(_0x250ba8){return function(_0x2022c3){logger[_0x6d30('0x10')](_0x250ba8,util[_0x6d30('0xd')](_0x2022c3,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2ac0f6,_0x4be60b,_0x856912){return{'message':_0x2ac0f6,'unlock':_0x4be60b,'active':_0x856912};};exports[_0x6d30('0x11')]=function(_0x58a1f3,_0x399575,_0x9c3718){if(!_[_0x6d30('0x12')](_0x9c3718)&&_0x6d30('0x13')===typeof _0x9c3718&&!_['isEmpty'](_0x9c3718)){if(!_['isUndefined'](_0x399575)&&_0x6d30('0x13')===typeof _0x399575&&!_[_0x6d30('0x14')](_0x399575)){return util[_0x6d30('0x15')](_0x6d30('0x16'),_0x399575,_0x9c3718);}return util[_0x6d30('0x15')]('\x22%s\x22\x20<%s>',_0x9c3718,_0x9c3718);}if(!_[_0x6d30('0x12')](_0x58a1f3)&&_0x6d30('0x13')===typeof _0x58a1f3&&!_[_0x6d30('0x14')](_0x58a1f3)){return _0x58a1f3;}return _0x6d30('0x17');};exports[_0x6d30('0x18')]=function(_0x1fe350){if(_[_0x6d30('0x19')](_0x1fe350)){return![];}return _0x1fe350;};exports[_0x6d30('0x1a')]=function(_0x4167fe,_0x1fe4ed,_0xc7dafa,_0xfe86d4,_0x50a295,_0x21a667){var _0x3c8313={'XMD-QUEUE':_0x1fe4ed['Queue']?_0x1fe4ed[_0x6d30('0x1b')]['name']:'','XMD-CALLERID':_0xfe86d4,'XMD-CALLERID-PREVIEW':_0x21a667?util[_0x6d30('0x15')](_0x6d30('0x16'),_0x21a667['calleridname'],_0x21a667[_0x6d30('0x1c')]):_0xfe86d4,'XMD-DIALID':_0x50a295,'XMD-CONTACTID':_0x1fe4ed[_0x6d30('0x1d')],'XMD-CDRTYPE':_0x6d30('0x1e'),'CALLERID(all)':_0xfe86d4,'XMD-VOICEQUEUEID':_0x1fe4ed[_0x6d30('0x1f')],'XMD-DIALCHANNEL':_0xc7dafa,'XMD-DIALTIMEOUT':_0x4167fe[_0x6d30('0x20')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x6d30('0x21'),_0x4167fe[_0x6d30('0x22')]?'g':'',_[_0x6d30('0x14')](_0x4167fe['monitor_format'])?'':_0x6d30('0x23')),'XMD-DIALURL':_0x4167fe[_0x6d30('0x24')]||'','XMD-AGI':_0x4167fe[_0x6d30('0x25')]?util['format'](_0x6d30('0x26'),ipAgi,_0x4167fe[_0x6d30('0x25')]):_0x6d30('0x27'),'XMD-AGIAFTER':_0x4167fe['dialQueueProject2']?util[_0x6d30('0x15')](_0x6d30('0x26'),ipAgi,_0x4167fe[_0x6d30('0x22')]):_0x6d30('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x21a667?_0x21a667[_0x6d30('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x21a667?_0x21a667[_0x6d30('0x29')]:'','XMD-DESTINATION':_0x6d30('0x2a')};if(!_['isEmpty'](_0x4167fe[_0x6d30('0x2b')])){_0x3c8313[util['format']('%s',_0x6d30('0x2c'))]=_0x4167fe[_0x6d30('0x2b')];_0x3c8313[util[_0x6d30('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x50a295;}if(_0x1fe4ed&&_0x1fe4ed[_0x6d30('0x2d')]){for(var _0x5eb8e3 in _0x1fe4ed[_0x6d30('0x2d')]){if(_0x1fe4ed[_0x6d30('0x2d')][_0x6d30('0x2e')](_0x5eb8e3)){if(!_[_0x6d30('0x19')](_0x1fe4ed[_0x6d30('0x2d')][_0x5eb8e3])&&_0x5eb8e3!=='id'&&_0x5eb8e3!==_0x6d30('0x2f')&&_0x5eb8e3!==_0x6d30('0x30')&&_0x5eb8e3!==_0x6d30('0x31')){_0x3c8313[util['format'](_0x6d30('0x32'),'XMD-',_[_0x6d30('0x33')](_0x5eb8e3))]=_0x1fe4ed['Contact'][_0x5eb8e3];}}}}return _0x3c8313;};exports['toLowerVariables']=function(_0x57cdfe){var _0x19666e={};for(var _0x15986c in _0x57cdfe){if(_0x57cdfe[_0x6d30('0x2e')](_0x15986c)){_0x19666e[util['format']('%s',_[_0x6d30('0x34')](_0x15986c))]=_0x57cdfe[_0x15986c];}}return{'variables':_0x19666e};};exports[_0x6d30('0x35')]=function(_0x4243e9,_0x4ccae2){if(!_[_0x6d30('0x19')](_0x4243e9)){if(_0x4243e9[_0x6d30('0x2e')](_0x6d30('0x36'))){if(_0x4243e9[_0x6d30('0x36')]>0x0){_0x4243e9['originated']-=0x1;}else{logger[_0x6d30('0xb')](_0x6d30('0x37'),_0x4ccae2);}}}else{logger[_0x6d30('0xb')](_0x6d30('0x38'),_0x4ccae2);}};exports[_0x6d30('0x39')]=function(_0x571a95){var _0x59d6f6=moment()[_0x6d30('0x15')](_0x6d30('0x3a'));_0x571a95[_0x6d30('0x3b')]=0xd;_0x571a95[_0x6d30('0x3c')]=_0x6d30('0x3d');_0x571a95[_0x6d30('0x3e')]=_0x59d6f6;_0x571a95[_0x6d30('0x3f')]=_0x59d6f6;_0x571a95[_0x6d30('0x40')]=_0x59d6f6;};exports[_0x6d30('0x41')]=function(_0x15011f,_0x46b86e,_0x336764){var _0x21f03d=moment()[_0x6d30('0x15')](_0x6d30('0x3a'));_0x15011f[_0x6d30('0x3b')]=_0x46b86e;_0x15011f[_0x6d30('0x3c')]=_0x336764;_0x15011f[_0x6d30('0x3f')]=_0x21f03d;_0x15011f['ringtime']=getSeconds(_0x15011f['responsetime'],_0x15011f[_0x6d30('0x3e')]);};exports[_0x6d30('0x42')]=function(_0x3d1286,_0x190311,_0x5af9fb){_0x3d1286[_0x6d30('0x43')]=_0x190311;_0x3d1286[_0x6d30('0x44')]=_0x5af9fb;};exports[_0x6d30('0x45')]=function(_0x231729,_0x28010c,_0x43ceb5){var _0x46fc44=moment()[_0x6d30('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x231729[_0x6d30('0x3b')]=_0x28010c;_0x231729[_0x6d30('0x3c')]=_0x43ceb5;_0x231729['responsetime']=_0x231729['responsetime']?_0x231729[_0x6d30('0x3f')]:_0x46fc44;_0x231729['endtime']=_0x231729['endtime']?_0x231729['endtime']:_0x46fc44;_0x231729['ringtime']=getSeconds(_0x231729[_0x6d30('0x3f')]||0x0,_0x231729[_0x6d30('0x3e')]||0x0);_0x231729[_0x6d30('0x46')]=_0x231729[_0x6d30('0x47')]?getSeconds(_0x231729[_0x6d30('0x40')],_0x231729[_0x6d30('0x47')]):0x0;};exports['isFailure']=function(_0x399319){return _0x399319===_0x6d30('0x48');};exports[_0x6d30('0x49')]=function(_0x254970,_0xac9d25,_0x15d1f6,_0x140d13,_0x40ed88){var _0x44c239=_0x140d13?'RECALL':_0x254970['calleridname'];_0x44c239=_0x40ed88?_0x6d30('0x4a'):_0x44c239;return{'actionid':_0x254970[_0x6d30('0x4b')],'action':_0x6d30('0x4c'),'channel':_0x254970[_0x6d30('0x4d')],'callerid':util['format'](_0x6d30('0x16'),_0x44c239,_0x254970['calleridnum']),'Exten':_0x6d30('0x2a'),'Context':_0x6d30('0x4e'),'Priority':'1','variable':_0x15d1f6,'timeout':(_0xac9d25[_0x6d30('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x254970[_0x6d30('0x4b')]};};exports['totalGlobal']=function(_0x31a3c7){return _0x31a3c7[_0x6d30('0x50')]+_0x31a3c7['countcongestionretry']+_0x31a3c7['countnoanswerretry']+_0x31a3c7[_0x6d30('0x51')]+_0x31a3c7['countnosuchnumberretry'];};exports[_0x6d30('0x52')]=function(_0x55e26b){var _0x3297a1=_['clone'](_0x55e26b);_0x3297a1['state']=0xf;_0x3297a1[_0x6d30('0x3c')]=_0x6d30('0x53');return _0x3297a1;};exports[_0x6d30('0x54')]=function(_0x3fc219,_0x986f7f,_0x3bc350){var _0x21e334={};_0x21e334[_0x986f7f]=_0x3fc219[_0x986f7f];_0x21e334['active']=![];_0x21e334[_0x6d30('0x55')]=moment()[_0x6d30('0x56')](_0x3bc350,_0x6d30('0x57'))[_0x6d30('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x21e334[_0x6d30('0x1d')]=_0x3fc219[_0x6d30('0x1d')];_0x21e334[_0x6d30('0x58')]=_0x3fc219[_0x6d30('0x58')];_0x21e334[_0x6d30('0x1f')]=_0x3fc219['VoiceQueueId']||undefined;return _0x21e334;};exports[_0x6d30('0x59')]=function(_0x24bdaa,_0x785dfb){if(!_[_0x6d30('0x19')](_0x24bdaa)){if(_0x24bdaa[_0x6d30('0x5a')]>0x0){_0x24bdaa['pTalking']-=0x1;}else{logger[_0x6d30('0xb')](_0x785dfb,_0x6d30('0x5b'));}}else{logger[_0x6d30('0xb')](_0x785dfb,_0x6d30('0x5c'));}};exports['IsNotLoggedIn']=function(_0x1051e3){if(_0x1051e3<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4edad9,_0x36ea39,_0x4f5e41){_0x4edad9['lastevent']=_0x36ea39;_0x4edad9[_0x6d30('0x5d')]=_0x4edad9[_0x6d30('0x5e')];_0x4edad9[_0x6d30('0x5f')]=_0x4edad9[_0x6d30('0x4d')];_0x4edad9[_0x6d30('0x60')]=_0x6d30('0x61');if(_0x4f5e41){_0x4edad9[_0x6d30('0x62')]=_0x4f5e41[_0x6d30('0x62')];}return _0x4edad9;};exports['buildAcw']=function(_0x2932bc){var _0x3972db={};_0x3972db[_0x6d30('0x5e')]=_0x2932bc[_0x6d30('0x5e')];_0x3972db['interface']=_0x2932bc[_0x6d30('0x4d')];_0x3972db['uniqueid']=_0x2932bc[_0x6d30('0x4b')];return _0x3972db;};exports[_0x6d30('0x63')]=function(_0x4dece6){var _0x3cc98e=[];for(var _0x26f20d in _0x4dece6){if(_0x4dece6['hasOwnProperty'](_0x26f20d)){if(!_['isNil'](_0x4dece6[_0x26f20d])&&_0x4dece6[_0x26f20d][_0x6d30('0x3b')]==='not_inuse'&&_0x4dece6[_0x26f20d]['status']===_0x6d30('0x64')){_0x3cc98e[_0x6d30('0x65')](_0x4dece6[_0x26f20d]['id']);}}}return _0x3cc98e;};exports['getDiff']=function(_0x3adb46){var _0x35bb29=moment()[_0x6d30('0x8')](0x0);var _0x3bf183=moment(_0x3adb46)[_0x6d30('0x8')](0x0);return _0x35bb29[_0x6d30('0x9')](_0x3bf183,_0x6d30('0xa'));};exports[_0x6d30('0x66')]=function(_0x3e5711){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3e5711[_0x6d30('0x1d')],'ListId':_0x3e5711[_0x6d30('0x58')],'VoiceQueueId':_0x3e5711[_0x6d30('0x1f')]||undefined,'CampaignId':_0x3e5711[_0x6d30('0x67')]||undefined};};exports['filterKey']=function(_0x163dc2){if(_0x163dc2===_0x6d30('0x4b')||_0x163dc2===_0x6d30('0x68')||_0x163dc2===_0x6d30('0x5e')||_0x163dc2==='type'||_0x163dc2===_0x6d30('0x69')||_0x163dc2===_0x6d30('0x6a')||_0x163dc2==='membername'||_0x163dc2===_0x6d30('0x4d')||_0x163dc2===_0x6d30('0x6b')||_0x163dc2===_0x6d30('0x6c')||_0x163dc2===_0x6d30('0x1c')||_0x163dc2===_0x6d30('0x55')||_0x163dc2===_0x6d30('0x50')||_0x163dc2===_0x6d30('0x6d')||_0x163dc2===_0x6d30('0x6e')||_0x163dc2===_0x6d30('0x6f')||_0x163dc2===_0x6d30('0x70')||_0x163dc2===_0x6d30('0x71')||_0x163dc2==='callbackat'||_0x163dc2===_0x6d30('0x72')||_0x163dc2===_0x6d30('0x1d')||_0x163dc2===_0x6d30('0x58')||_0x163dc2===_0x6d30('0x44')||_0x163dc2===_0x6d30('0x1f')||_0x163dc2===_0x6d30('0x73')||_0x163dc2==='xmd-voicequeueid'||_0x163dc2===_0x6d30('0x74')||_0x163dc2==='xmd-phone'||_0x163dc2==='xmd-listid'||_0x163dc2===_0x6d30('0x75')||_0x163dc2==='xmd-dialtimeout'||_0x163dc2==='xmd-dialoptions'||_0x163dc2==='xmd-dialid'||_0x163dc2===_0x6d30('0x76')||_0x163dc2===_0x6d30('0x77')||_0x163dc2===_0x6d30('0x78')||_0x163dc2===_0x6d30('0x79')||_0x163dc2===_0x6d30('0x7a')||_0x163dc2===_0x6d30('0x7b')||_0x163dc2===_0x6d30('0x7c')||_0x163dc2==='rtpaudioqosbridged'||_0x163dc2==='rtpaudioqosjitter'||_0x163dc2===_0x6d30('0x7d')||_0x163dc2===_0x6d30('0x7e')||_0x163dc2===_0x6d30('0x7f')||_0x163dc2===_0x6d30('0x80')||_0x163dc2===_0x6d30('0x81')||_0x163dc2===_0x6d30('0x7c')||_0x163dc2==='rtpaudioqosbridged'||_0x163dc2===_0x6d30('0x82')||_0x163dc2==='rtpaudioqosjitterbridged'||_0x163dc2===_0x6d30('0x7e')||_0x163dc2==='rtpaudioqoslossbridged'||_0x163dc2===_0x6d30('0x80')||_0x163dc2==='rtpaudioqosrttbridged'||_0x163dc2===_0x6d30('0x83')||_0x163dc2===_0x6d30('0x84')||_0x163dc2===_0x6d30('0x3b')||_0x163dc2===_0x6d30('0x3c')){return![];}return!![];};exports[_0x6d30('0x85')]=function(_0x476c12,_0x4776da){var _0x1ddb26,_0x3a4136,_0x34f650;if(_0x4776da<=0x0){_0x4776da=0x1;}_0x1ddb26=new RegExp(_0x6d30('0x86')+_0x4776da+'}$');_0x3a4136=Math[_0x6d30('0x87')](0xa,_0x4776da-0x1);_0x34f650=Math[_0x6d30('0x87')](0xa,_0x4776da)-0x1;return util[_0x6d30('0x15')]('%s',_[_0x6d30('0x88')](_0x476c12,_0x1ddb26,_['random'](_0x3a4136,_0x34f650)));};exports[_0x6d30('0x89')]=function(_0x3822d0){var _0x3d2a0f=_0x3822d0['match'](/"(.*?)"/);return _0x3d2a0f?_0x3d2a0f[0x1]:_0x3822d0;};exports[_0x6d30('0x8a')]=function(_0x1f65c9){var _0x4080f5=_0x1f65c9[_0x6d30('0x8b')](/<(.*?)>/);return _0x4080f5?_0x4080f5[0x1]:_0x1f65c9;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6444fbc..d2a28d6 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 _0x1eb0=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x1eb0,0x1f0));var _0x01eb=function(_0x5ee451,_0x408291){_0x5ee451=_0x5ee451-0x0;var _0x5a198c=_0x1eb0[_0x5ee451];return _0x5a198c;};'use strict';exports[_0x01eb('0x0')]={'queue':{'type':_0x01eb('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x01eb('0x1'),'required':!![]},'penalty':{'type':_0x01eb('0x2'),'required':![]},'paused':{'type':_0x01eb('0x3'),'required':![]}};exports[_0x01eb('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x01eb('0x1'),'required':!![]}};exports[_0x01eb('0x5')]={'interface':{'type':_0x01eb('0x1'),'required':!![]},'paused':{'type':_0x01eb('0x3')},'reason':{'type':_0x01eb('0x1'),'required':![]}};exports[_0x01eb('0x6')]={'module':{'type':_0x01eb('0x1'),'required':![]}};exports[_0x01eb('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x01eb('0x8')]={'uniqueid':{'type':_0x01eb('0x1'),'required':!![]},'filename':{'type':_0x01eb('0x1')},'format':{'type':_0x01eb('0x1')},'mixmonitorid':{'type':_0x01eb('0x1')}};exports[_0x01eb('0x9')]={'uniqueid':{'type':_0x01eb('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x01eb('0x1'),'required':!![]},'exten':{'type':_0x01eb('0x1'),'required':!![]},'context':{'type':_0x01eb('0x1')}}; \ No newline at end of file +var _0x8073=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x8073,0x86));var _0x3807=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x8073[_0x3ff085];return _0x2b68c3;};'use strict';exports[_0x3807('0x0')]={'queue':{'type':_0x3807('0x1'),'required':!![]},'interface':{'type':_0x3807('0x1'),'required':!![]},'membername':{'type':_0x3807('0x1'),'required':!![]},'penalty':{'type':_0x3807('0x2'),'required':![]},'paused':{'type':_0x3807('0x3'),'required':![]}};exports[_0x3807('0x4')]={'queue':{'type':_0x3807('0x1'),'required':!![]},'interface':{'type':_0x3807('0x1'),'required':!![]}};exports[_0x3807('0x5')]={'interface':{'type':_0x3807('0x1'),'required':!![]},'paused':{'type':_0x3807('0x3')},'reason':{'type':_0x3807('0x1'),'required':![]}};exports[_0x3807('0x6')]={'module':{'type':_0x3807('0x1'),'required':![]}};exports[_0x3807('0x7')]={'uniqueid':{'type':_0x3807('0x1'),'required':!![]}};exports[_0x3807('0x8')]={'uniqueid':{'type':_0x3807('0x1'),'required':!![]},'filename':{'type':_0x3807('0x1')},'format':{'type':_0x3807('0x1')},'mixmonitorid':{'type':_0x3807('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x3807('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x3807('0x1'),'required':!![]},'context':{'type':_0x3807('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ecc9d43..cff982c 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 _0xb777=['settings','salesforceAccounts','sugarcrmAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','name','SIP/%s','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','zendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','exports','bluebird','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','outboundChannels'];(function(_0x5a2cbc,_0x280533){var _0x42e22b=function(_0x1088fb){while(--_0x1088fb){_0x5a2cbc['push'](_0x5a2cbc['shift']());}};_0x42e22b(++_0x280533);}(_0xb777,0xbf));var _0x7b77=function(_0x42ba3b,_0x355441){_0x42ba3b=_0x42ba3b-0x0;var _0x17634b=_0xb777[_0x42ba3b];return _0x17634b;};'use strict';var BPromise=require(_0x7b77('0x0'));var util=require('util');var _=require(_0x7b77('0x1'));var moment=require(_0x7b77('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x7b77('0x3'));var Trunk=require(_0x7b77('0x4'));var VoiceQueue=require(_0x7b77('0x5'));var Trigger=require(_0x7b77('0x6'));var Template=require('../model/template');var Campaign=require(_0x7b77('0x7'));var VoiceExtension=require(_0x7b77('0x8'));var ZendeskAccount=require(_0x7b77('0x9'));var SalesforceAccount=require(_0x7b77('0xa'));var FreshdeskAccount=require(_0x7b77('0xb'));var SugarcrmAccount=require(_0x7b77('0xc'));var ZohoAccount=require(_0x7b77('0xd'));var DeskAccount=require(_0x7b77('0xe'));var VtigerAccount=require(_0x7b77('0xf'));var ServicenowAccount=require(_0x7b77('0x10'));var Dynamics365Account=require(_0x7b77('0x11'));var FreshsalesAccount=require(_0x7b77('0x12'));var FaxAccount=require(_0x7b77('0x13'));var Realtime=function(){this[_0x7b77('0x14')]={};this[_0x7b77('0x15')]={};this['trunks']={};this[_0x7b77('0x16')]={};this[_0x7b77('0x17')]={};this['campaigns']={};this[_0x7b77('0x18')]={};this[_0x7b77('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7b77('0x1a')]={};this[_0x7b77('0x1b')]={};this['queueChannels']={};this[_0x7b77('0x1c')]={};this['timers']={};this[_0x7b77('0x1d')]={};this['zendeskAccounts']={};this[_0x7b77('0x1e')]={};this[_0x7b77('0x1f')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x7b77('0x20')]={};this[_0x7b77('0x21')]={};this[_0x7b77('0x22')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x53aa59,_0x4d0201,_0x1cdce6){var _0x51aa03=_[_0x7b77('0x23')](_0x53aa59,function(_0x34d829,_0x1a249b){return _0x34d829[_0x1cdce6];});for(var _0x29069c in _0x4d0201){if(_0x4d0201[_0x7b77('0x24')](_0x29069c)){if(!_0x51aa03[_0x29069c]){delete _0x4d0201[_0x29069c];}}}}function freeIsNotKeySip(_0x5585da,_0x345f88){var _0x1730ec=_[_0x7b77('0x23')](_0x5585da,function(_0x28de97,_0x51063d){return util[_0x7b77('0x25')]('SIP/%s',_0x28de97[_0x7b77('0x26')]);});for(var _0x32ffd8 in _0x345f88){if(_0x345f88[_0x7b77('0x24')](_0x32ffd8)){if(!_0x1730ec[_0x32ffd8]){delete _0x345f88[_0x32ffd8];}}}}function freeIsNotKeyAgent(_0x3f9848,_0x5700c1){var _0x2b239d=_['mapKeys'](_0x3f9848,function(_0x511c06,_0x156363){var _0x1602ab=_['isNil'](_0x511c06['interface'])?util[_0x7b77('0x25')](_0x7b77('0x27'),_0x511c06[_0x7b77('0x26')]):_0x511c06[_0x7b77('0x28')];return _0x1602ab;});for(var _0x4a654e in _0x5700c1){if(_0x5700c1['hasOwnProperty'](_0x4a654e)){if(!_0x2b239d[_0x4a654e]){delete _0x5700c1[_0x4a654e];}}}}function clearVoiceCallReports(_0x4d5e32){_0x4d5e32[_0x7b77('0x29')]=0x0;_0x4d5e32[_0x7b77('0x2a')]=0x0;_0x4d5e32[_0x7b77('0x2b')]=0x0;_0x4d5e32['sumDuration']=0x0;_0x4d5e32[_0x7b77('0x2c')]=0x0;}function clearCampaigns(_0x197aae){if(!_[_0x7b77('0x2d')](_0x197aae)){for(var _0x58fba7 in _0x197aae){if(_0x197aae[_0x7b77('0x24')](_0x58fba7)){_0x197aae[_0x58fba7][_0x7b77('0x2e')]=0x0;_0x197aae[_0x58fba7]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x58de49){if(!_[_0x7b77('0x2d')](_0x58de49)){for(var _0x306238 in _0x58de49){if(_0x58de49[_0x7b77('0x24')](_0x306238)){_0x58de49[_0x306238][_0x7b77('0x29')]=0x0;_0x58de49[_0x306238][_0x7b77('0x2a')]=0x0;_0x58de49[_0x306238][_0x7b77('0x2f')]=0x0;_0x58de49[_0x306238][_0x7b77('0x30')]=0x0;_0x58de49[_0x306238]['sumHoldTime']=0x0;_0x58de49[_0x306238][_0x7b77('0x31')]=0x0;_0x58de49[_0x306238]['sumBillable']=0x0;_0x58de49[_0x306238]['outboundAnswerAgiCallsDay']=0x0;_0x58de49[_0x306238][_0x7b77('0x32')]=0x0;_0x58de49[_0x306238]['outboundBusyCallsDay']=0x0;_0x58de49[_0x306238][_0x7b77('0x33')]=0x0;_0x58de49[_0x306238][_0x7b77('0x34')]=0x0;_0x58de49[_0x306238][_0x7b77('0x35')]=0x0;_0x58de49[_0x306238]['outboundDropCallsDayTimeout']=0x0;_0x58de49[_0x306238][_0x7b77('0x36')]=0x0;_0x58de49[_0x306238]['outboundBlacklistCallsDay']=0x0;_0x58de49[_0x306238][_0x7b77('0x37')]=0x0;_0x58de49[_0x306238][_0x7b77('0x38')]=0x0;_0x58de49[_0x306238][_0x7b77('0x39')]=0x0;_0x58de49[_0x306238]['outboundAnswerAgiCallsDay']=0x0;_0x58de49[_0x306238][_0x7b77('0x3a')]=0x0;_0x58de49[_0x306238][_0x7b77('0x3b')]=!![];}}}}Realtime[_0x7b77('0x3c')][_0x7b77('0x3d')]=function(_0x56877d,_0x18e6a4){for(var _0x48729c in _0x18e6a4){if(_0x56877d[_0x7b77('0x24')](_0x48729c)){_0x56877d[_0x48729c]=_0x18e6a4[_0x48729c];}}};Realtime[_0x7b77('0x3c')][_0x7b77('0x3e')]=function(){var _0x33016a=this;return function(_0x4d42c8){if(_0x4d42c8){freeIsNotKeyAgent(_0x4d42c8,_0x33016a[_0x7b77('0x14')]);for(var _0x5e86f3=0x0,_0x2e6f63={},_0x18c144={};_0x5e86f3<_0x4d42c8[_0x7b77('0x3f')];_0x5e86f3+=0x1){_0x2e6f63=_0x4d42c8[_0x5e86f3];var _0x111e81=_['isNil'](_0x2e6f63[_0x7b77('0x28')])?util[_0x7b77('0x25')](_0x7b77('0x27'),_0x2e6f63[_0x7b77('0x26')]):_0x2e6f63['interface'];if(_[_0x7b77('0x40')](_0x33016a['agents'][_0x111e81])){_0x33016a[_0x7b77('0x14')][_0x111e81]=new Agent(_0x2e6f63);}else{_0x33016a['mergeFromDatabase'](_0x33016a[_0x7b77('0x14')][_0x111e81],_0x2e6f63);}}}return _0x33016a[_0x7b77('0x14')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x41')]=function(){var _0x52fd01=this;return function(_0x52ba2e){if(_0x52ba2e){freeIsNotKeySip(_0x52ba2e,_0x52fd01[_0x7b77('0x15')]);for(var _0x275958=0x0,_0x201d98={},_0x383f14={};_0x275958<_0x52ba2e['length'];_0x275958+=0x1){_0x201d98=_0x52ba2e[_0x275958];if(_['isUndefined'](_0x52fd01['telephones'][util['format'](_0x7b77('0x27'),_0x201d98[_0x7b77('0x26')])])){_0x52fd01['telephones'][util['format'](_0x7b77('0x27'),_0x201d98[_0x7b77('0x26')])]=new Telephone(_0x201d98);}else{_0x52fd01['mergeFromDatabase'](_0x52fd01['telephones'][util[_0x7b77('0x25')]('SIP/%s',_0x201d98[_0x7b77('0x26')])],_0x201d98);}}}return _0x52fd01[_0x7b77('0x15')];};};Realtime['prototype'][_0x7b77('0x42')]=function(){var _0x5ef73b=this;return function(_0x33f8c6){if(_0x33f8c6){freeIsNotKeySip(_0x33f8c6,_0x5ef73b[_0x7b77('0x43')]);for(var _0x54b3f8=0x0,_0x368e0a={},_0x2c9722={};_0x54b3f8<_0x33f8c6['length'];_0x54b3f8+=0x1){_0x368e0a=_0x33f8c6[_0x54b3f8];if(_['isUndefined'](_0x5ef73b[_0x7b77('0x43')][util[_0x7b77('0x25')](_0x7b77('0x27'),_0x368e0a[_0x7b77('0x26')])])){_0x5ef73b['trunks'][util[_0x7b77('0x25')](_0x7b77('0x27'),_0x368e0a[_0x7b77('0x26')])]=new Trunk(_0x368e0a);}else{_0x5ef73b[_0x7b77('0x3d')](_0x5ef73b[_0x7b77('0x43')][util[_0x7b77('0x25')](_0x7b77('0x27'),_0x368e0a['name'])],_0x368e0a);}}}return _0x5ef73b[_0x7b77('0x43')];};};Realtime['prototype'][_0x7b77('0x44')]=function(){var _0x304e3d=this;return function(_0x249fea){if(_0x249fea){freeIsNotKey(_0x249fea,_0x304e3d[_0x7b77('0x16')],'name');for(var _0x4554aa=0x0,_0x322f17={},_0x458950={};_0x4554aa<_0x249fea[_0x7b77('0x3f')];_0x4554aa+=0x1){_0x322f17=_0x249fea[_0x4554aa];if(_['isUndefined'](_0x304e3d[_0x7b77('0x16')][_0x322f17[_0x7b77('0x26')]])){_0x304e3d[_0x7b77('0x16')][_0x322f17[_0x7b77('0x26')]]=new VoiceQueue(_0x322f17);}else{_0x304e3d['mergeFromDatabase'](_0x304e3d[_0x7b77('0x16')][_0x322f17[_0x7b77('0x26')]],_0x322f17);}}}return _0x304e3d['voiceQueues'];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x45')]=function(){var _0x453119=this;return function(_0x307686){if(_0x307686){freeIsNotKey(_0x307686,_0x453119[_0x7b77('0x17')],'id');for(var _0x1a3391=0x0,_0x33a0a5={},_0xcdf809={};_0x1a3391<_0x307686['length'];_0x1a3391+=0x1){_0x33a0a5=_0x307686[_0x1a3391];if(_[_0x7b77('0x40')](_0x453119[_0x7b77('0x17')][_0x33a0a5['id']])){_0x453119[_0x7b77('0x17')][_0x33a0a5['id']]=new Trigger(_0x33a0a5);}else{_0x453119[_0x7b77('0x3d')](_0x453119['triggers'][_0x33a0a5['id']],_0x33a0a5);}}}return _0x453119['triggers'];};};Realtime['prototype'][_0x7b77('0x46')]=function(){var _0x5283e3=this;return function(_0x170042){if(_0x170042){freeIsNotKey(_0x170042,_0x5283e3[_0x7b77('0x18')],'id');for(var _0x4834ef=0x0,_0x1be979={},_0x1113db={};_0x4834ef<_0x170042['length'];_0x4834ef+=0x1){_0x1be979=_0x170042[_0x4834ef];if(_[_0x7b77('0x40')](_0x5283e3[_0x7b77('0x18')][_0x1be979['id']])){_0x5283e3[_0x7b77('0x18')][_0x1be979['id']]=new Template(_0x1be979);}else{_0x5283e3['mergeFromDatabase'](_0x5283e3[_0x7b77('0x18')][_0x1be979['id']],_0x1be979);}}}return _0x5283e3[_0x7b77('0x18')];};};Realtime[_0x7b77('0x3c')]['initZendeskAccounts']=function(){var _0x5776ca=this;return function(_0x4f6853){if(_0x4f6853){freeIsNotKey(_0x4f6853,_0x5776ca[_0x7b77('0x47')],'id');for(var _0x301761=0x0,_0x5cc4e2={},_0xbcb61d={};_0x301761<_0x4f6853[_0x7b77('0x3f')];_0x301761+=0x1){_0x5cc4e2=_0x4f6853[_0x301761];if(_['isUndefined'](_0x5776ca[_0x7b77('0x47')][_0x5cc4e2['id']])){_0x5776ca['zendeskAccounts'][_0x5cc4e2['id']]=new ZendeskAccount(_0x5cc4e2);}else{_0x5776ca[_0x7b77('0x3d')](_0x5776ca[_0x7b77('0x47')][_0x5cc4e2['id']],_0x5cc4e2);}}}return _0x5776ca[_0x7b77('0x47')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x48')]=function(){var _0x103385=this;return function(_0x35d175){if(_0x35d175){freeIsNotKey(_0x35d175,_0x103385[_0x7b77('0x1e')],'id');for(var _0x28d4f9=0x0,_0x2a6233={},_0x4d375c={};_0x28d4f9<_0x35d175['length'];_0x28d4f9+=0x1){_0x2a6233=_0x35d175[_0x28d4f9];if(_[_0x7b77('0x40')](_0x103385[_0x7b77('0x1e')][_0x2a6233['id']])){_0x103385[_0x7b77('0x1e')][_0x2a6233['id']]=new SalesforceAccount(_0x2a6233);}else{_0x103385[_0x7b77('0x3d')](_0x103385['salesforceAccounts'][_0x2a6233['id']],_0x2a6233);}}}return _0x103385[_0x7b77('0x1e')];};};Realtime[_0x7b77('0x3c')]['initFreshdeskAccounts']=function(){var _0x3f8ea6=this;return function(_0x285e9a){if(_0x285e9a){freeIsNotKey(_0x285e9a,_0x3f8ea6['freshdeskAccounts'],'id');for(var _0x1f7504=0x0,_0x9ebba6={},_0x231f87={};_0x1f7504<_0x285e9a['length'];_0x1f7504+=0x1){_0x9ebba6=_0x285e9a[_0x1f7504];if(_['isUndefined'](_0x3f8ea6[_0x7b77('0x49')][_0x9ebba6['id']])){_0x3f8ea6[_0x7b77('0x49')][_0x9ebba6['id']]=new FreshdeskAccount(_0x9ebba6);}else{_0x3f8ea6[_0x7b77('0x3d')](_0x3f8ea6[_0x7b77('0x49')][_0x9ebba6['id']],_0x9ebba6);}}}return _0x3f8ea6[_0x7b77('0x49')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x4a')]=function(){var _0x20d4b0=this;return function(_0xc9e582){if(_0xc9e582){freeIsNotKey(_0xc9e582,_0x20d4b0[_0x7b77('0x4b')],'id');for(var _0x32bd05=0x0,_0x36a8a4={},_0x1d74df={};_0x32bd05<_0xc9e582[_0x7b77('0x3f')];_0x32bd05+=0x1){_0x36a8a4=_0xc9e582[_0x32bd05];if(_['isUndefined'](_0x20d4b0[_0x7b77('0x4b')][_0x36a8a4['id']])){_0x20d4b0[_0x7b77('0x4b')][_0x36a8a4['id']]=new ZohoAccount(_0x36a8a4);}else{_0x20d4b0['mergeFromDatabase'](_0x20d4b0[_0x7b77('0x4b')][_0x36a8a4['id']],_0x36a8a4);}}}return _0x20d4b0[_0x7b77('0x4b')];};};Realtime[_0x7b77('0x3c')]['initDeskAccounts']=function(){var _0x5782d2=this;return function(_0xf34dd8){if(_0xf34dd8){freeIsNotKey(_0xf34dd8,_0x5782d2['deskAccounts'],'id');for(var _0x386b18=0x0,_0x5b6fb3={},_0x21a1cb={};_0x386b18<_0xf34dd8[_0x7b77('0x3f')];_0x386b18+=0x1){_0x5b6fb3=_0xf34dd8[_0x386b18];if(_[_0x7b77('0x40')](_0x5782d2['deskAccounts'][_0x5b6fb3['id']])){_0x5782d2[_0x7b77('0x4c')][_0x5b6fb3['id']]=new DeskAccount(_0x5b6fb3);}else{_0x5782d2['mergeFromDatabase'](_0x5782d2[_0x7b77('0x4c')][_0x5b6fb3['id']],_0x5b6fb3);}}}return _0x5782d2[_0x7b77('0x4c')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x4d')]=function(){var _0x1b6b94=this;return function(_0x454c23){if(_0x454c23){freeIsNotKey(_0x454c23,_0x1b6b94['sugarcrmAccounts'],'id');for(var _0xf0c1f8=0x0,_0x3f4808={},_0x4fc952={};_0xf0c1f8<_0x454c23[_0x7b77('0x3f')];_0xf0c1f8+=0x1){_0x3f4808=_0x454c23[_0xf0c1f8];if(_[_0x7b77('0x40')](_0x1b6b94[_0x7b77('0x1f')][_0x3f4808['id']])){_0x1b6b94[_0x7b77('0x1f')][_0x3f4808['id']]=new SugarcrmAccount(_0x3f4808);}else{_0x1b6b94[_0x7b77('0x3d')](_0x1b6b94['sugarcrmAccounts'][_0x3f4808['id']],_0x3f4808);}}}return _0x1b6b94[_0x7b77('0x1f')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x4e')]=function(){var _0x10bb13=this;return function(_0x341f24){if(_0x341f24){freeIsNotKey(_0x341f24,_0x10bb13['vtigerAccounts'],'id');for(var _0x4a0ac3=0x0,_0xc876f8={},_0x208e77={};_0x4a0ac3<_0x341f24[_0x7b77('0x3f')];_0x4a0ac3+=0x1){_0xc876f8=_0x341f24[_0x4a0ac3];if(_[_0x7b77('0x40')](_0x10bb13['vtigerAccounts'][_0xc876f8['id']])){_0x10bb13[_0x7b77('0x20')][_0xc876f8['id']]=new VtigerAccount(_0xc876f8);}else{_0x10bb13[_0x7b77('0x3d')](_0x10bb13[_0x7b77('0x20')][_0xc876f8['id']],_0xc876f8);}}}return _0x10bb13[_0x7b77('0x20')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x4f')]=function(){var _0xfe926=this;return function(_0x172328){if(_0x172328){freeIsNotKey(_0x172328,_0xfe926[_0x7b77('0x21')],'id');for(var _0x27fbb8=0x0,_0x40d27e={},_0x19aa09={};_0x27fbb8<_0x172328[_0x7b77('0x3f')];_0x27fbb8+=0x1){_0x40d27e=_0x172328[_0x27fbb8];if(_['isUndefined'](_0xfe926[_0x7b77('0x21')][_0x40d27e['id']])){_0xfe926[_0x7b77('0x21')][_0x40d27e['id']]=new ServicenowAccount(_0x40d27e);}else{_0xfe926[_0x7b77('0x3d')](_0xfe926['servicenowAccounts'][_0x40d27e['id']],_0x40d27e);}}}return _0xfe926['servicenowAccounts'];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x50')]=function(){var _0x13ab63=this;return function(_0x548eb6){if(_0x548eb6){freeIsNotKey(_0x548eb6,_0x13ab63[_0x7b77('0x22')],'id');for(var _0x557611=0x0,_0x4317cb={},_0xf04b39={};_0x557611<_0x548eb6[_0x7b77('0x3f')];_0x557611+=0x1){_0x4317cb=_0x548eb6[_0x557611];if(_[_0x7b77('0x40')](_0x13ab63[_0x7b77('0x22')][_0x4317cb['id']])){_0x13ab63['dynamics365Accounts'][_0x4317cb['id']]=new Dynamics365Account(_0x4317cb);}else{_0x13ab63[_0x7b77('0x3d')](_0x13ab63['dynamics365Accounts'][_0x4317cb['id']],_0x4317cb);}}}return _0x13ab63[_0x7b77('0x22')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x51')]=function(){var _0x4d5aa9=this;return function(_0x585312){if(_0x585312){freeIsNotKey(_0x585312,_0x4d5aa9[_0x7b77('0x52')],'id');for(var _0x272c88=0x0,_0x3f30d6={},_0x53069f={};_0x272c88<_0x585312[_0x7b77('0x3f')];_0x272c88+=0x1){_0x3f30d6=_0x585312[_0x272c88];if(_[_0x7b77('0x40')](_0x4d5aa9[_0x7b77('0x52')][_0x3f30d6['id']])){_0x4d5aa9[_0x7b77('0x52')][_0x3f30d6['id']]=new FreshsalesAccount(_0x3f30d6);}else{_0x4d5aa9[_0x7b77('0x3d')](_0x4d5aa9[_0x7b77('0x52')][_0x3f30d6['id']],_0x3f30d6);}}}return _0x4d5aa9[_0x7b77('0x52')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x53')]=function(){var _0x7be35a=this;return function(_0x35c308){for(var _0x40baf9=0x0;_0x40baf9<_0x35c308[_0x7b77('0x3f')];_0x40baf9+=0x1){_['merge'](_0x7be35a[_0x7b77('0x16')][_0x35c308[_0x40baf9][_0x7b77('0x26')]],_0x35c308[_0x40baf9]);}return _0x7be35a[_0x7b77('0x16')];};};Realtime[_0x7b77('0x3c')]['initVoiceQueueReports']=function(){var _0x57d18b=this;return function(_0x1e8430){clearVoiceQueues(_0x57d18b[_0x7b77('0x16')]);if(_0x1e8430){_0x1e8430=_[_0x7b77('0x54')](_0x1e8430,_0x7b77('0x55'));for(var _0x127df5 in _0x1e8430){if(_0x1e8430['hasOwnProperty'](_0x127df5)){var _0x43fd6e={};for(var _0x6b1a3a=0x0;_0x6b1a3a<_0x1e8430[_0x127df5][_0x7b77('0x3f')];_0x6b1a3a+=0x1){var _0x291407=_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x56')];if(_0x57d18b['voiceQueues'][_0x291407]){if(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x57')]){_0x57d18b['voiceQueues'][_0x291407]['unmanaged']+=0x1;}if(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x58')]){_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x30')]+=0x1;}_0x57d18b[_0x7b77('0x16')][_0x291407]['sumHoldTime']+=moment(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x59')])['diff'](moment(_0x1e8430[_0x127df5][_0x6b1a3a]['queuecallerjoinAt']),_0x7b77('0x5a'))||0x0;if(_0x6b1a3a===_0x1e8430[_0x127df5][_0x7b77('0x3f')]-0x1){_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x31')]+=moment(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x5b')]||_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x5c')]||_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x5d')])[_0x7b77('0x5e')](moment(_0x1e8430[_0x127df5][_0x6b1a3a]['queuecallerjoinAt']),_0x7b77('0x5a'))||0x0;_0x57d18b['voiceQueues'][_0x291407][_0x7b77('0x29')]+=0x1;if(_0x1e8430[_0x127df5][_0x6b1a3a]['queuecallercomplete']){_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x2a')]+=0x1;_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x2c')]+=moment(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x5b')])[_0x7b77('0x5e')](moment(_0x1e8430[_0x127df5][_0x6b1a3a][_0x7b77('0x59')]),'seconds')||0x0;}}else{_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x31')]+=_0x57d18b[_0x7b77('0x16')][_0x291407][_0x7b77('0x2b')]||0x0;}}}}}}return _0x57d18b['voiceQueues'];};};Realtime['prototype'][_0x7b77('0x5f')]=function(){var _0x46f11d=this;return function(_0x2d7a93){clearVoiceCallReports(_0x46f11d[_0x7b77('0x19')]);if(_0x2d7a93){for(var _0x1ba3f0=0x0;_0x1ba3f0<_0x2d7a93[_0x7b77('0x3f')];_0x1ba3f0+=0x1){_0x46f11d[_0x7b77('0x19')][_0x7b77('0x29')]+=0x1;_0x46f11d[_0x7b77('0x19')][_0x7b77('0x31')]+=_0x2d7a93[_0x1ba3f0][_0x7b77('0x60')];if(_0x2d7a93[_0x1ba3f0][_0x7b77('0x61')]===_0x7b77('0x62')){_0x46f11d['outbound'][_0x7b77('0x2a')]+=0x1;_0x46f11d['outbound'][_0x7b77('0x2b')]+=_0x2d7a93[_0x1ba3f0][_0x7b77('0x60')]-_0x2d7a93[_0x1ba3f0][_0x7b77('0x63')]||0x0;_0x46f11d[_0x7b77('0x19')][_0x7b77('0x2c')]+=_0x2d7a93[_0x1ba3f0][_0x7b77('0x63')];}}}return _0x46f11d[_0x7b77('0x19')];};};Realtime['prototype'][_0x7b77('0x64')]=function(){var _0x1f80a1=this;return function(_0x351ca6){if(_0x351ca6){freeIsNotKey(_0x351ca6,_0x1f80a1['campaigns'],_0x7b77('0x26'));for(var _0x2923fe=0x0,_0x5be596={};_0x2923fe<_0x351ca6['length'];_0x2923fe+=0x1){_0x5be596=_0x351ca6[_0x2923fe];if(_['isUndefined'](_0x1f80a1[_0x7b77('0x65')][_0x5be596['name']])){_0x1f80a1[_0x7b77('0x65')][_0x5be596[_0x7b77('0x26')]]=new Campaign(_0x5be596);}else{_0x1f80a1[_0x7b77('0x3d')](_0x1f80a1[_0x7b77('0x65')][_0x5be596[_0x7b77('0x26')]],_0x5be596);_0x1f80a1[_0x7b77('0x65')][_0x5be596[_0x7b77('0x26')]][_0x7b77('0x66')]=_0x5be596[_0x7b77('0x67')]?_0x5be596[_0x7b77('0x67')]['name']:undefined;}}}return _0x1f80a1['campaigns'];};};Realtime['prototype'][_0x7b77('0x68')]=function(){var _0x1d5be4=this;return function(_0x17d712){if(_0x17d712){freeIsNotKey(_0x17d712,_0x1d5be4[_0x7b77('0x1a')],'id');for(var _0x392b08=0x0,_0x42fa83={};_0x392b08<_0x17d712['length'];_0x392b08+=0x1){_0x42fa83=_0x17d712[_0x392b08];if(_[_0x7b77('0x40')](_0x1d5be4[_0x7b77('0x1a')][_0x42fa83['id']])){_0x1d5be4[_0x7b77('0x1a')][_0x42fa83['id']]=new VoiceExtension(_0x42fa83);}else{_0x1d5be4[_0x7b77('0x3d')](_0x1d5be4[_0x7b77('0x1a')][_0x42fa83['id']],_0x42fa83);}}}return _0x1d5be4[_0x7b77('0x1a')];};};Realtime[_0x7b77('0x3c')][_0x7b77('0x69')]=function(){var _0x4bdbf6=this;return function(_0x1b5cf4){clearCampaigns(_0x4bdbf6[_0x7b77('0x65')]);for(var _0x50ab95=0x0;_0x50ab95<_0x1b5cf4[_0x7b77('0x3f')];_0x50ab95+=0x1){_[_0x7b77('0x6a')](_0x4bdbf6[_0x7b77('0x65')][_0x1b5cf4[_0x50ab95][_0x7b77('0x26')]],_0x1b5cf4[_0x50ab95]);}return _0x4bdbf6[_0x7b77('0x65')];};};Realtime['prototype'][_0x7b77('0x6b')]=function(){var _0x453f69=this;return function(_0x4f19b7){if(_0x4f19b7){freeIsNotKey(_0x4f19b7,_0x453f69[_0x7b77('0x6c')],'id');for(var _0x3da334=0x0,_0x34dd74={},_0x575c75={};_0x3da334<_0x4f19b7[_0x7b77('0x3f')];_0x3da334+=0x1){_0x34dd74=_0x4f19b7[_0x3da334];if(_[_0x7b77('0x40')](_0x453f69[_0x7b77('0x6c')][_0x34dd74['id']])){_0x453f69[_0x7b77('0x6c')][_0x34dd74['id']]=new FaxAccount(_0x34dd74);}else{_0x453f69['mergeFromDatabase'](_0x453f69['faxAccounts'][_0x34dd74['id']],_0x34dd74);}}}return _0x453f69[_0x7b77('0x6c')];};};module[_0x7b77('0x6d')]=Realtime; \ No newline at end of file +var _0x9bde=['initTrunks','name','initVoiceQueues','voiceQueues','initTriggers','initTemplates','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','merge','initFaxAccounts','faxAccounts','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','trunks','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','agents','length','isUndefined','initTelephones','telephones'];(function(_0x28f94a,_0xfe3e7d){var _0x571fdc=function(_0x2b0124){while(--_0x2b0124){_0x28f94a['push'](_0x28f94a['shift']());}};_0x571fdc(++_0xfe3e7d);}(_0x9bde,0x92));var _0xe9bd=function(_0x4c796f,_0x4ef688){_0x4c796f=_0x4c796f-0x0;var _0x29460d=_0x9bde[_0x4c796f];return _0x29460d;};'use strict';var BPromise=require(_0xe9bd('0x0'));var util=require(_0xe9bd('0x1'));var _=require('lodash');var moment=require(_0xe9bd('0x2'));var Agent=require(_0xe9bd('0x3'));var Telephone=require(_0xe9bd('0x4'));var Trunk=require(_0xe9bd('0x5'));var VoiceQueue=require(_0xe9bd('0x6'));var Trigger=require(_0xe9bd('0x7'));var Template=require(_0xe9bd('0x8'));var Campaign=require(_0xe9bd('0x9'));var VoiceExtension=require(_0xe9bd('0xa'));var ZendeskAccount=require(_0xe9bd('0xb'));var SalesforceAccount=require(_0xe9bd('0xc'));var FreshdeskAccount=require(_0xe9bd('0xd'));var SugarcrmAccount=require(_0xe9bd('0xe'));var ZohoAccount=require(_0xe9bd('0xf'));var DeskAccount=require(_0xe9bd('0x10'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xe9bd('0x11'));var Dynamics365Account=require(_0xe9bd('0x12'));var FreshsalesAccount=require(_0xe9bd('0x13'));var FaxAccount=require(_0xe9bd('0x14'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0xe9bd('0x15')]={};this['voiceQueues']={};this[_0xe9bd('0x16')]={};this['campaigns']={};this[_0xe9bd('0x17')]={};this[_0xe9bd('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe9bd('0x19')]={};this[_0xe9bd('0x1a')]={};this[_0xe9bd('0x1b')]={};this[_0xe9bd('0x1c')]={};this[_0xe9bd('0x1d')]={};this[_0xe9bd('0x1e')]={};this[_0xe9bd('0x1f')]={};this['salesforceAccounts']={};this[_0xe9bd('0x20')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xe9bd('0x21')]={};this[_0xe9bd('0x22')]={};this[_0xe9bd('0x23')]={};this[_0xe9bd('0x24')]={};this['faxAccounts']={};};function freeIsNotKey(_0x415b7b,_0x55471d,_0x23fcff){var _0x416a54=_[_0xe9bd('0x25')](_0x415b7b,function(_0x43060f,_0x786a98){return _0x43060f[_0x23fcff];});for(var _0xc43fa9 in _0x55471d){if(_0x55471d[_0xe9bd('0x26')](_0xc43fa9)){if(!_0x416a54[_0xc43fa9]){delete _0x55471d[_0xc43fa9];}}}}function freeIsNotKeySip(_0xc75189,_0x522e72){var _0x2d87f6=_[_0xe9bd('0x25')](_0xc75189,function(_0x1f2625,_0x5daa59){return util['format']('SIP/%s',_0x1f2625['name']);});for(var _0x154e70 in _0x522e72){if(_0x522e72[_0xe9bd('0x26')](_0x154e70)){if(!_0x2d87f6[_0x154e70]){delete _0x522e72[_0x154e70];}}}}function freeIsNotKeyAgent(_0x50519b,_0x545809){var _0x20898b=_['mapKeys'](_0x50519b,function(_0x3d7492,_0x445d84){var _0x161ac3=_[_0xe9bd('0x27')](_0x3d7492[_0xe9bd('0x28')])?util[_0xe9bd('0x29')](_0xe9bd('0x2a'),_0x3d7492['name']):_0x3d7492[_0xe9bd('0x28')];return _0x161ac3;});for(var _0x4dede2 in _0x545809){if(_0x545809['hasOwnProperty'](_0x4dede2)){if(!_0x20898b[_0x4dede2]){delete _0x545809[_0x4dede2];}}}}function clearVoiceCallReports(_0x16ba79){_0x16ba79[_0xe9bd('0x2b')]=0x0;_0x16ba79[_0xe9bd('0x2c')]=0x0;_0x16ba79[_0xe9bd('0x2d')]=0x0;_0x16ba79[_0xe9bd('0x2e')]=0x0;_0x16ba79[_0xe9bd('0x2f')]=0x0;}function clearCampaigns(_0x424d44){if(!_[_0xe9bd('0x30')](_0x424d44)){for(var _0x5f4f6d in _0x424d44){if(_0x424d44[_0xe9bd('0x26')](_0x5f4f6d)){_0x424d44[_0x5f4f6d][_0xe9bd('0x31')]=0x0;_0x424d44[_0x5f4f6d]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x18a799){if(!_[_0xe9bd('0x30')](_0x18a799)){for(var _0x3bf01b in _0x18a799){if(_0x18a799[_0xe9bd('0x26')](_0x3bf01b)){_0x18a799[_0x3bf01b][_0xe9bd('0x2b')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x2c')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x32')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x33')]=0x0;_0x18a799[_0x3bf01b]['sumHoldTime']=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x2e')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x2f')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x34')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x35')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x36')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x37')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x38')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x39')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x3a')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x3b')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x3c')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x3d')]=0x0;_0x18a799[_0x3bf01b]['outboundRejectCallsDay']=0x0;_0x18a799[_0x3bf01b]['outboundReCallsDay']=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x34')]=0x0;_0x18a799[_0x3bf01b][_0xe9bd('0x3e')]=0x0;_0x18a799[_0x3bf01b]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xe9bd('0x3f')]=function(_0x23e102,_0xaeaa6c){for(var _0x4fd638 in _0xaeaa6c){if(_0x23e102[_0xe9bd('0x26')](_0x4fd638)){_0x23e102[_0x4fd638]=_0xaeaa6c[_0x4fd638];}}};Realtime[_0xe9bd('0x40')]['initAgents']=function(){var _0x288e3b=this;return function(_0x37fbdb){if(_0x37fbdb){freeIsNotKeyAgent(_0x37fbdb,_0x288e3b[_0xe9bd('0x41')]);for(var _0x45cf29=0x0,_0x4bf21c={},_0x3b4d9c={};_0x45cf29<_0x37fbdb[_0xe9bd('0x42')];_0x45cf29+=0x1){_0x4bf21c=_0x37fbdb[_0x45cf29];var _0x455b0b=_[_0xe9bd('0x27')](_0x4bf21c[_0xe9bd('0x28')])?util[_0xe9bd('0x29')](_0xe9bd('0x2a'),_0x4bf21c['name']):_0x4bf21c['interface'];if(_[_0xe9bd('0x43')](_0x288e3b[_0xe9bd('0x41')][_0x455b0b])){_0x288e3b[_0xe9bd('0x41')][_0x455b0b]=new Agent(_0x4bf21c);}else{_0x288e3b[_0xe9bd('0x3f')](_0x288e3b[_0xe9bd('0x41')][_0x455b0b],_0x4bf21c);}}}return _0x288e3b['agents'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x44')]=function(){var _0x1eac03=this;return function(_0x355721){if(_0x355721){freeIsNotKeySip(_0x355721,_0x1eac03[_0xe9bd('0x45')]);for(var _0x2d9bf4=0x0,_0x32d187={},_0xc2bcba={};_0x2d9bf4<_0x355721['length'];_0x2d9bf4+=0x1){_0x32d187=_0x355721[_0x2d9bf4];if(_[_0xe9bd('0x43')](_0x1eac03['telephones'][util['format'](_0xe9bd('0x2a'),_0x32d187['name'])])){_0x1eac03[_0xe9bd('0x45')][util[_0xe9bd('0x29')](_0xe9bd('0x2a'),_0x32d187['name'])]=new Telephone(_0x32d187);}else{_0x1eac03[_0xe9bd('0x3f')](_0x1eac03[_0xe9bd('0x45')][util['format'](_0xe9bd('0x2a'),_0x32d187['name'])],_0x32d187);}}}return _0x1eac03[_0xe9bd('0x45')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x46')]=function(){var _0x3fa259=this;return function(_0x2dd28d){if(_0x2dd28d){freeIsNotKeySip(_0x2dd28d,_0x3fa259[_0xe9bd('0x15')]);for(var _0xb8685c=0x0,_0x19a756={},_0x52b96b={};_0xb8685c<_0x2dd28d[_0xe9bd('0x42')];_0xb8685c+=0x1){_0x19a756=_0x2dd28d[_0xb8685c];if(_[_0xe9bd('0x43')](_0x3fa259[_0xe9bd('0x15')][util[_0xe9bd('0x29')]('SIP/%s',_0x19a756[_0xe9bd('0x47')])])){_0x3fa259[_0xe9bd('0x15')][util['format'](_0xe9bd('0x2a'),_0x19a756[_0xe9bd('0x47')])]=new Trunk(_0x19a756);}else{_0x3fa259[_0xe9bd('0x3f')](_0x3fa259[_0xe9bd('0x15')][util['format'](_0xe9bd('0x2a'),_0x19a756[_0xe9bd('0x47')])],_0x19a756);}}}return _0x3fa259['trunks'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x48')]=function(){var _0xdd6077=this;return function(_0x26ccac){if(_0x26ccac){freeIsNotKey(_0x26ccac,_0xdd6077[_0xe9bd('0x49')],_0xe9bd('0x47'));for(var _0x2cd0ab=0x0,_0x39ba43={},_0x5ede0c={};_0x2cd0ab<_0x26ccac[_0xe9bd('0x42')];_0x2cd0ab+=0x1){_0x39ba43=_0x26ccac[_0x2cd0ab];if(_[_0xe9bd('0x43')](_0xdd6077[_0xe9bd('0x49')][_0x39ba43[_0xe9bd('0x47')]])){_0xdd6077['voiceQueues'][_0x39ba43[_0xe9bd('0x47')]]=new VoiceQueue(_0x39ba43);}else{_0xdd6077[_0xe9bd('0x3f')](_0xdd6077[_0xe9bd('0x49')][_0x39ba43[_0xe9bd('0x47')]],_0x39ba43);}}}return _0xdd6077['voiceQueues'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4a')]=function(){var _0x49200d=this;return function(_0x203c0c){if(_0x203c0c){freeIsNotKey(_0x203c0c,_0x49200d['triggers'],'id');for(var _0x2710f2=0x0,_0x551961={},_0x105467={};_0x2710f2<_0x203c0c[_0xe9bd('0x42')];_0x2710f2+=0x1){_0x551961=_0x203c0c[_0x2710f2];if(_['isUndefined'](_0x49200d[_0xe9bd('0x16')][_0x551961['id']])){_0x49200d['triggers'][_0x551961['id']]=new Trigger(_0x551961);}else{_0x49200d['mergeFromDatabase'](_0x49200d[_0xe9bd('0x16')][_0x551961['id']],_0x551961);}}}return _0x49200d[_0xe9bd('0x16')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4b')]=function(){var _0x32daa6=this;return function(_0x261813){if(_0x261813){freeIsNotKey(_0x261813,_0x32daa6[_0xe9bd('0x17')],'id');for(var _0x43371e=0x0,_0x50d6fd={},_0x16f4e8={};_0x43371e<_0x261813['length'];_0x43371e+=0x1){_0x50d6fd=_0x261813[_0x43371e];if(_[_0xe9bd('0x43')](_0x32daa6[_0xe9bd('0x17')][_0x50d6fd['id']])){_0x32daa6[_0xe9bd('0x17')][_0x50d6fd['id']]=new Template(_0x50d6fd);}else{_0x32daa6[_0xe9bd('0x3f')](_0x32daa6[_0xe9bd('0x17')][_0x50d6fd['id']],_0x50d6fd);}}}return _0x32daa6[_0xe9bd('0x17')];};};Realtime[_0xe9bd('0x40')]['initZendeskAccounts']=function(){var _0xb5d2fa=this;return function(_0x4e5517){if(_0x4e5517){freeIsNotKey(_0x4e5517,_0xb5d2fa[_0xe9bd('0x1f')],'id');for(var _0x236524=0x0,_0x11784d={},_0xc46ded={};_0x236524<_0x4e5517[_0xe9bd('0x42')];_0x236524+=0x1){_0x11784d=_0x4e5517[_0x236524];if(_[_0xe9bd('0x43')](_0xb5d2fa[_0xe9bd('0x1f')][_0x11784d['id']])){_0xb5d2fa['zendeskAccounts'][_0x11784d['id']]=new ZendeskAccount(_0x11784d);}else{_0xb5d2fa[_0xe9bd('0x3f')](_0xb5d2fa[_0xe9bd('0x1f')][_0x11784d['id']],_0x11784d);}}}return _0xb5d2fa[_0xe9bd('0x1f')];};};Realtime[_0xe9bd('0x40')]['initSalesforceAccounts']=function(){var _0x45a19b=this;return function(_0x13946a){if(_0x13946a){freeIsNotKey(_0x13946a,_0x45a19b[_0xe9bd('0x4c')],'id');for(var _0x2f3cfe=0x0,_0xf9aaaa={},_0x3cee03={};_0x2f3cfe<_0x13946a['length'];_0x2f3cfe+=0x1){_0xf9aaaa=_0x13946a[_0x2f3cfe];if(_[_0xe9bd('0x43')](_0x45a19b[_0xe9bd('0x4c')][_0xf9aaaa['id']])){_0x45a19b['salesforceAccounts'][_0xf9aaaa['id']]=new SalesforceAccount(_0xf9aaaa);}else{_0x45a19b['mergeFromDatabase'](_0x45a19b[_0xe9bd('0x4c')][_0xf9aaaa['id']],_0xf9aaaa);}}}return _0x45a19b[_0xe9bd('0x4c')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4d')]=function(){var _0x442998=this;return function(_0x10ea75){if(_0x10ea75){freeIsNotKey(_0x10ea75,_0x442998[_0xe9bd('0x4e')],'id');for(var _0x342d07=0x0,_0x1578e2={},_0x1160ff={};_0x342d07<_0x10ea75[_0xe9bd('0x42')];_0x342d07+=0x1){_0x1578e2=_0x10ea75[_0x342d07];if(_[_0xe9bd('0x43')](_0x442998[_0xe9bd('0x4e')][_0x1578e2['id']])){_0x442998[_0xe9bd('0x4e')][_0x1578e2['id']]=new FreshdeskAccount(_0x1578e2);}else{_0x442998[_0xe9bd('0x3f')](_0x442998[_0xe9bd('0x4e')][_0x1578e2['id']],_0x1578e2);}}}return _0x442998[_0xe9bd('0x4e')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x4f')]=function(){var _0x52b293=this;return function(_0x96b872){if(_0x96b872){freeIsNotKey(_0x96b872,_0x52b293['zohoAccounts'],'id');for(var _0x4410b5=0x0,_0x51754f={},_0x276bc0={};_0x4410b5<_0x96b872[_0xe9bd('0x42')];_0x4410b5+=0x1){_0x51754f=_0x96b872[_0x4410b5];if(_[_0xe9bd('0x43')](_0x52b293[_0xe9bd('0x50')][_0x51754f['id']])){_0x52b293[_0xe9bd('0x50')][_0x51754f['id']]=new ZohoAccount(_0x51754f);}else{_0x52b293[_0xe9bd('0x3f')](_0x52b293['zohoAccounts'][_0x51754f['id']],_0x51754f);}}}return _0x52b293[_0xe9bd('0x50')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x51')]=function(){var _0x1f3d4a=this;return function(_0x2b6816){if(_0x2b6816){freeIsNotKey(_0x2b6816,_0x1f3d4a[_0xe9bd('0x52')],'id');for(var _0x2899b4=0x0,_0x5b74ca={},_0x340c44={};_0x2899b4<_0x2b6816[_0xe9bd('0x42')];_0x2899b4+=0x1){_0x5b74ca=_0x2b6816[_0x2899b4];if(_['isUndefined'](_0x1f3d4a[_0xe9bd('0x52')][_0x5b74ca['id']])){_0x1f3d4a[_0xe9bd('0x52')][_0x5b74ca['id']]=new DeskAccount(_0x5b74ca);}else{_0x1f3d4a[_0xe9bd('0x3f')](_0x1f3d4a[_0xe9bd('0x52')][_0x5b74ca['id']],_0x5b74ca);}}}return _0x1f3d4a[_0xe9bd('0x52')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x53')]=function(){var _0x4be176=this;return function(_0x27aa57){if(_0x27aa57){freeIsNotKey(_0x27aa57,_0x4be176['sugarcrmAccounts'],'id');for(var _0x5781c7=0x0,_0x478b2f={},_0x38f194={};_0x5781c7<_0x27aa57[_0xe9bd('0x42')];_0x5781c7+=0x1){_0x478b2f=_0x27aa57[_0x5781c7];if(_[_0xe9bd('0x43')](_0x4be176[_0xe9bd('0x20')][_0x478b2f['id']])){_0x4be176[_0xe9bd('0x20')][_0x478b2f['id']]=new SugarcrmAccount(_0x478b2f);}else{_0x4be176['mergeFromDatabase'](_0x4be176['sugarcrmAccounts'][_0x478b2f['id']],_0x478b2f);}}}return _0x4be176[_0xe9bd('0x20')];};};Realtime['prototype'][_0xe9bd('0x54')]=function(){var _0x2d715e=this;return function(_0x44c801){if(_0x44c801){freeIsNotKey(_0x44c801,_0x2d715e[_0xe9bd('0x21')],'id');for(var _0x565560=0x0,_0x57f33e={},_0x1e6a5d={};_0x565560<_0x44c801[_0xe9bd('0x42')];_0x565560+=0x1){_0x57f33e=_0x44c801[_0x565560];if(_['isUndefined'](_0x2d715e['vtigerAccounts'][_0x57f33e['id']])){_0x2d715e[_0xe9bd('0x21')][_0x57f33e['id']]=new VtigerAccount(_0x57f33e);}else{_0x2d715e['mergeFromDatabase'](_0x2d715e['vtigerAccounts'][_0x57f33e['id']],_0x57f33e);}}}return _0x2d715e[_0xe9bd('0x21')];};};Realtime['prototype'][_0xe9bd('0x55')]=function(){var _0x394998=this;return function(_0x481c8f){if(_0x481c8f){freeIsNotKey(_0x481c8f,_0x394998[_0xe9bd('0x22')],'id');for(var _0xea0c6a=0x0,_0x5ee9b7={},_0x69fd31={};_0xea0c6a<_0x481c8f[_0xe9bd('0x42')];_0xea0c6a+=0x1){_0x5ee9b7=_0x481c8f[_0xea0c6a];if(_[_0xe9bd('0x43')](_0x394998['servicenowAccounts'][_0x5ee9b7['id']])){_0x394998['servicenowAccounts'][_0x5ee9b7['id']]=new ServicenowAccount(_0x5ee9b7);}else{_0x394998[_0xe9bd('0x3f')](_0x394998['servicenowAccounts'][_0x5ee9b7['id']],_0x5ee9b7);}}}return _0x394998[_0xe9bd('0x22')];};};Realtime['prototype'][_0xe9bd('0x56')]=function(){var _0x40748d=this;return function(_0x4e61be){if(_0x4e61be){freeIsNotKey(_0x4e61be,_0x40748d['dynamics365Accounts'],'id');for(var _0x526388=0x0,_0x2fc697={},_0x25a173={};_0x526388<_0x4e61be[_0xe9bd('0x42')];_0x526388+=0x1){_0x2fc697=_0x4e61be[_0x526388];if(_[_0xe9bd('0x43')](_0x40748d['dynamics365Accounts'][_0x2fc697['id']])){_0x40748d['dynamics365Accounts'][_0x2fc697['id']]=new Dynamics365Account(_0x2fc697);}else{_0x40748d['mergeFromDatabase'](_0x40748d[_0xe9bd('0x23')][_0x2fc697['id']],_0x2fc697);}}}return _0x40748d[_0xe9bd('0x23')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x57')]=function(){var _0x525f06=this;return function(_0xd52b8b){if(_0xd52b8b){freeIsNotKey(_0xd52b8b,_0x525f06[_0xe9bd('0x24')],'id');for(var _0x205ad8=0x0,_0x460ae8={},_0x13a207={};_0x205ad8<_0xd52b8b['length'];_0x205ad8+=0x1){_0x460ae8=_0xd52b8b[_0x205ad8];if(_[_0xe9bd('0x43')](_0x525f06[_0xe9bd('0x24')][_0x460ae8['id']])){_0x525f06[_0xe9bd('0x24')][_0x460ae8['id']]=new FreshsalesAccount(_0x460ae8);}else{_0x525f06[_0xe9bd('0x3f')](_0x525f06[_0xe9bd('0x24')][_0x460ae8['id']],_0x460ae8);}}}return _0x525f06[_0xe9bd('0x24')];};};Realtime[_0xe9bd('0x40')]['initVoiceQueueHopperHistory']=function(){var _0x1de2f3=this;return function(_0x50f4b1){for(var _0x4291d9=0x0;_0x4291d9<_0x50f4b1['length'];_0x4291d9+=0x1){_['merge'](_0x1de2f3[_0xe9bd('0x49')][_0x50f4b1[_0x4291d9][_0xe9bd('0x47')]],_0x50f4b1[_0x4291d9]);}return _0x1de2f3[_0xe9bd('0x49')];};};Realtime[_0xe9bd('0x40')]['initVoiceQueueReports']=function(){var _0x31da1b=this;return function(_0x582f21){clearVoiceQueues(_0x31da1b[_0xe9bd('0x49')]);if(_0x582f21){_0x582f21=_['groupBy'](_0x582f21,'uniqueid');for(var _0x43d7e0 in _0x582f21){if(_0x582f21[_0xe9bd('0x26')](_0x43d7e0)){var _0x47abce={};for(var _0x4a824b=0x0;_0x4a824b<_0x582f21[_0x43d7e0][_0xe9bd('0x42')];_0x4a824b+=0x1){var _0x4682d0=_0x582f21[_0x43d7e0][_0x4a824b]['queue'];if(_0x31da1b[_0xe9bd('0x49')][_0x4682d0]){if(_0x582f21[_0x43d7e0][_0x4a824b]['queuecallerexit']){_0x31da1b[_0xe9bd('0x49')][_0x4682d0][_0xe9bd('0x32')]+=0x1;}if(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x58')]){_0x31da1b[_0xe9bd('0x49')][_0x4682d0]['abandoned']+=0x1;}_0x31da1b[_0xe9bd('0x49')][_0x4682d0][_0xe9bd('0x2d')]+=moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x59')])[_0xe9bd('0x5a')](moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5b')]),_0xe9bd('0x5c'))||0x0;if(_0x4a824b===_0x582f21[_0x43d7e0][_0xe9bd('0x42')]-0x1){_0x31da1b[_0xe9bd('0x49')][_0x4682d0][_0xe9bd('0x2e')]+=moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5d')]||_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5e')]||_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5f')])['diff'](moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5b')]),_0xe9bd('0x5c'))||0x0;_0x31da1b[_0xe9bd('0x49')][_0x4682d0][_0xe9bd('0x2b')]+=0x1;if(_0x582f21[_0x43d7e0][_0x4a824b]['queuecallercomplete']){_0x31da1b[_0xe9bd('0x49')][_0x4682d0]['answered']+=0x1;_0x31da1b[_0xe9bd('0x49')][_0x4682d0][_0xe9bd('0x2f')]+=moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x5d')])[_0xe9bd('0x5a')](moment(_0x582f21[_0x43d7e0][_0x4a824b][_0xe9bd('0x59')]),_0xe9bd('0x5c'))||0x0;}}else{_0x31da1b['voiceQueues'][_0x4682d0][_0xe9bd('0x2e')]+=_0x31da1b['voiceQueues'][_0x4682d0][_0xe9bd('0x2d')]||0x0;}}}}}}return _0x31da1b[_0xe9bd('0x49')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x60')]=function(){var _0x357eb9=this;return function(_0x4c7194){clearVoiceCallReports(_0x357eb9[_0xe9bd('0x18')]);if(_0x4c7194){for(var _0x41ebd6=0x0;_0x41ebd6<_0x4c7194['length'];_0x41ebd6+=0x1){_0x357eb9[_0xe9bd('0x18')][_0xe9bd('0x2b')]+=0x1;_0x357eb9[_0xe9bd('0x18')][_0xe9bd('0x2e')]+=_0x4c7194[_0x41ebd6]['duration'];if(_0x4c7194[_0x41ebd6]['disposition']===_0xe9bd('0x61')){_0x357eb9[_0xe9bd('0x18')][_0xe9bd('0x2c')]+=0x1;_0x357eb9['outbound'][_0xe9bd('0x2d')]+=_0x4c7194[_0x41ebd6][_0xe9bd('0x62')]-_0x4c7194[_0x41ebd6][_0xe9bd('0x63')]||0x0;_0x357eb9[_0xe9bd('0x18')][_0xe9bd('0x2f')]+=_0x4c7194[_0x41ebd6][_0xe9bd('0x63')];}}}return _0x357eb9[_0xe9bd('0x18')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x64')]=function(){var _0x4a3523=this;return function(_0x4b127a){if(_0x4b127a){freeIsNotKey(_0x4b127a,_0x4a3523[_0xe9bd('0x65')],_0xe9bd('0x47'));for(var _0x359df7=0x0,_0x3e1836={};_0x359df7<_0x4b127a['length'];_0x359df7+=0x1){_0x3e1836=_0x4b127a[_0x359df7];if(_['isUndefined'](_0x4a3523[_0xe9bd('0x65')][_0x3e1836[_0xe9bd('0x47')]])){_0x4a3523[_0xe9bd('0x65')][_0x3e1836[_0xe9bd('0x47')]]=new Campaign(_0x3e1836);}else{_0x4a3523[_0xe9bd('0x3f')](_0x4a3523['campaigns'][_0x3e1836[_0xe9bd('0x47')]],_0x3e1836);_0x4a3523[_0xe9bd('0x65')][_0x3e1836[_0xe9bd('0x47')]][_0xe9bd('0x66')]=_0x3e1836[_0xe9bd('0x67')]?_0x3e1836[_0xe9bd('0x67')]['name']:undefined;}}}return _0x4a3523[_0xe9bd('0x65')];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x68')]=function(){var _0x481293=this;return function(_0x13a337){if(_0x13a337){freeIsNotKey(_0x13a337,_0x481293[_0xe9bd('0x19')],'id');for(var _0x2d961e=0x0,_0x1497d4={};_0x2d961e<_0x13a337['length'];_0x2d961e+=0x1){_0x1497d4=_0x13a337[_0x2d961e];if(_[_0xe9bd('0x43')](_0x481293['voiceExtensions'][_0x1497d4['id']])){_0x481293[_0xe9bd('0x19')][_0x1497d4['id']]=new VoiceExtension(_0x1497d4);}else{_0x481293[_0xe9bd('0x3f')](_0x481293['voiceExtensions'][_0x1497d4['id']],_0x1497d4);}}}return _0x481293[_0xe9bd('0x19')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x478a94=this;return function(_0x63288a){clearCampaigns(_0x478a94[_0xe9bd('0x65')]);for(var _0x27223e=0x0;_0x27223e<_0x63288a[_0xe9bd('0x42')];_0x27223e+=0x1){_[_0xe9bd('0x69')](_0x478a94[_0xe9bd('0x65')][_0x63288a[_0x27223e][_0xe9bd('0x47')]],_0x63288a[_0x27223e]);}return _0x478a94['campaigns'];};};Realtime[_0xe9bd('0x40')][_0xe9bd('0x6a')]=function(){var _0x5bad1d=this;return function(_0x591e4e){if(_0x591e4e){freeIsNotKey(_0x591e4e,_0x5bad1d[_0xe9bd('0x6b')],'id');for(var _0x37d245=0x0,_0x120131={},_0x2de127={};_0x37d245<_0x591e4e['length'];_0x37d245+=0x1){_0x120131=_0x591e4e[_0x37d245];if(_['isUndefined'](_0x5bad1d[_0xe9bd('0x6b')][_0x120131['id']])){_0x5bad1d[_0xe9bd('0x6b')][_0x120131['id']]=new FaxAccount(_0x120131);}else{_0x5bad1d[_0xe9bd('0x3f')](_0x5bad1d[_0xe9bd('0x6b')][_0x120131['id']],_0x120131);}}}return _0x5bad1d[_0xe9bd('0x6b')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b79dd26..0aa1065 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 _0xb7be=['prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','telephones','name','interface','SIP/%s','length','connectedlinenum','accountcode','assigned','lastAssignedTo','format','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','callerid','from-sip','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','substring','phone','lastIndexOf','isNil','exports','moment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents'];(function(_0x1360e2,_0x235410){var _0x4901f0=function(_0x31b2eb){while(--_0x31b2eb){_0x1360e2['push'](_0x1360e2['shift']());}};_0x4901f0(++_0x235410);}(_0xb7be,0x137));var _0xeb7b=function(_0x53113c,_0x2a3334){_0x53113c=_0x53113c-0x0;var _0x41f1ec=_0xb7be[_0x53113c];return _0x41f1ec;};'use strict';var _=require('lodash');var moment=require(_0xeb7b('0x0'));var util=require('util');var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xeb7b('0x1'));var RpcVoiceCallReport=require(_0xeb7b('0x2'));var RpcVoiceDialReport=require(_0xeb7b('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xeb7b('0x4'));var RpcVoiceRecording=require(_0xeb7b('0x5'));var RpcVoiceTransferReport=require(_0xeb7b('0x6'));var VoiceQueueReport=require(_0xeb7b('0x7'));var VoiceCallReport=require(_0xeb7b('0x8'));var VoiceAgentReport=require(_0xeb7b('0x9'));var VoiceDialReport=require(_0xeb7b('0xa'));var UserReport=require('./userReport');function Report(_0x1aa40a){this[_0xeb7b('0xb')]=_0x1aa40a;this[_0xeb7b('0xc')]=_0x1aa40a[_0xeb7b('0xc')];this['telephones']=_0x1aa40a['telephones'];}Report[_0xeb7b('0xd')]['sync']=function(_0x2c3a21){var _0x5425f4=new VoiceQueueReport(this['realtime']);var _0x3055a7=new VoiceAgentReport(this[_0xeb7b('0xb')]);var _0x2dbad4=new VoiceDialReport(this[_0xeb7b('0xb')]);var _0x2e5312=new VoiceCallReport(this[_0xeb7b('0xb')]);var _0x335ae7=new UserReport(this['realtime']);if(config[_0xeb7b('0xe')]&&config[_0xeb7b('0xe')][_0xeb7b('0xf')]){ami['on'](_0xeb7b('0x10'),this[_0xeb7b('0x11')][_0xeb7b('0x12')](this));ami['on'](_0xeb7b('0x13'),this['voiceCallReport'][_0xeb7b('0x12')](this));ami['on'](_0xeb7b('0x14'),this['voiceAgentReport'][_0xeb7b('0x12')](this));ami['on'](_0xeb7b('0x15'),this[_0xeb7b('0x16')][_0xeb7b('0x12')](this));ami['on']('blindtransfer',this[_0xeb7b('0x17')][_0xeb7b('0x12')](this));ami['on'](_0xeb7b('0x18'),this[_0xeb7b('0x19')][_0xeb7b('0x12')](this));}};Report[_0xeb7b('0xd')][_0xeb7b('0x1a')]=function(_0x3f77de){var _0x2022f5;_0x2022f5=_[_0xeb7b('0x1b')](this[_0xeb7b('0xc')],function(_0x298238){return _0x298238['accountcode']==_0x3f77de||_0x298238['name']==_0x3f77de;});if(_['isNil'](_0x2022f5)){var _0x5e1f83=_[_0xeb7b('0x1b')](this[_0xeb7b('0x1c')],function(_0x33fd1e){return _0x33fd1e['accountcode']==_0x3f77de||_0x33fd1e[_0xeb7b('0x1d')]==_0x3f77de;});if(_0x5e1f83){_0x2022f5=_[_0xeb7b('0x1b')](this[_0xeb7b('0xc')],function(_0x37d102){return _0x37d102[_0xeb7b('0x1e')]==util['format'](_0xeb7b('0x1f'),_0x5e1f83['name']);});}}return _0x2022f5;};Report[_0xeb7b('0xd')][_0xeb7b('0x11')]=function(_0x3778a7){for(var _0x40c1ee=0x0;_0x40c1ee<_0x3778a7[_0xeb7b('0x20')];_0x40c1ee+=0x1){var _0x4c90d2=this['findAgent'](_0x3778a7[_0x40c1ee][_0xeb7b('0x21')]);if(_0x4c90d2){_0x3778a7[_0x40c1ee][_0xeb7b('0x22')]=_0x4c90d2[_0xeb7b('0x22')];_0x3778a7[_0x40c1ee][_0xeb7b('0x23')]=!![];_0x3778a7[_0x40c1ee][_0xeb7b('0x24')]=_0x4c90d2[_0xeb7b('0x1d')];_0x3778a7[_0x40c1ee][_0xeb7b('0x1e')]=_['isNil'](_0x4c90d2[_0xeb7b('0x1e')])?util[_0xeb7b('0x25')]('SIP/%s',_0x4c90d2[_0xeb7b('0x1d')]):_0x4c90d2[_0xeb7b('0x1e')];if(_0x3778a7[_0x40c1ee]['queuecallercomplete']){_0x3778a7[_0x40c1ee][_0xeb7b('0x26')]=moment()[_0xeb7b('0x25')](_0xeb7b('0x27'));}if(_0x3778a7[_0x40c1ee]['queuecallerexit']){_0x3778a7[_0x40c1ee][_0xeb7b('0x28')]=moment()[_0xeb7b('0x25')](_0xeb7b('0x27'));}RpcMemberReport[_0xeb7b('0x11')](_0x3778a7[_0x40c1ee]);}RpcVoiceQueueReport[_0xeb7b('0x29')](_0x3778a7[_0x40c1ee]);}};function extractCalleridNumber(_0xec4650){var _0x1d71bc=_0xec4650[_0xeb7b('0x2a')](/<(.*?)>/);return _0x1d71bc?_0x1d71bc[0x1]:_0xec4650;}Report[_0xeb7b('0xd')]['voiceCallReport']=function(_0x2dff3f){_0x2dff3f[_0xeb7b('0x2b')]=_0x2dff3f[_0xeb7b('0x2b')]||_0x2dff3f[_0xeb7b('0x2c')];if(_0x2dff3f[_0xeb7b('0x2d')]==_0xeb7b('0x2e')){_0x2dff3f[_0xeb7b('0x2f')]=_0xeb7b('0x30');_0x2dff3f['lastdata']=_0x2dff3f['queue'];if(_0x2dff3f[_0xeb7b('0x31')]=='from-voip-provider'){_0x2dff3f[_0xeb7b('0x22')]='';_0x2dff3f['destination']=extractCalleridNumber(_0x2dff3f[_0xeb7b('0x32')]);}else if(_0x2dff3f[_0xeb7b('0x31')]==_0xeb7b('0x33')){if(_0x2dff3f['destination']=='xcally-motion-preview'){_0x2dff3f[_0xeb7b('0x2b')]=extractCalleridNumber(_0x2dff3f[_0xeb7b('0x34')]);_0x2dff3f[_0xeb7b('0x35')]=_0x2dff3f['originatecalleridnum'];_0x2dff3f[_0xeb7b('0x36')]=[_0x2dff3f[_0xeb7b('0x37')],_0x2dff3f[_0xeb7b('0x37')]=_0x2dff3f['destinationchannel']][0x0];_0x2dff3f['callerid']=_0x2dff3f[_0xeb7b('0x34')];}else{_0x2dff3f[_0xeb7b('0x2b')]=_0x2dff3f['calleridnum'];_0x2dff3f[_0xeb7b('0x35')]=_0x2dff3f[_0xeb7b('0x38')];if(_0x2dff3f[_0xeb7b('0x39')]==_0xeb7b('0x3a')){_0x2dff3f[_0xeb7b('0x22')]=_0x2dff3f[_0xeb7b('0x21')];}else{_0x2dff3f[_0xeb7b('0x22')]='';}}}}else{_0x2dff3f['callerid']=util[_0xeb7b('0x25')]('\x22%s\x22\x20<%s>',_0x2dff3f[_0xeb7b('0x3b')],_0x2dff3f[_0xeb7b('0x35')]);}if(RpcVoiceTransferReport['transfers'][_0x2dff3f['linkedid']]){var _0x489949=RpcVoiceTransferReport['transfers'][_0x2dff3f[_0xeb7b('0x3c')]];_0x489949[_0xeb7b('0x3d')]=_0x2dff3f[_0xeb7b('0x3e')];RpcVoiceTransferReport[_0xeb7b('0x17')](_0x489949);delete RpcVoiceTransferReport[_0xeb7b('0x3f')][_0x2dff3f[_0xeb7b('0x3c')]];}RpcVoiceCallReport[_0xeb7b('0x29')](_0x2dff3f);if(_0x2dff3f[_0xeb7b('0x40')]){for(var _0x468b52=0x0;_0x468b52<_0x2dff3f[_0xeb7b('0x41')][_0xeb7b('0x20')];_0x468b52+=0x1){_0x2dff3f[_0xeb7b('0x42')]=_0x2dff3f['monitors'][_0x468b52][_0xeb7b('0x43')];_0x2dff3f[_0xeb7b('0x44')]=_0x2dff3f['monitors'][_0x468b52]['createdAt'];if(_0x2dff3f[_0xeb7b('0x2c')]==_0xeb7b('0x45')){_0x2dff3f[_0xeb7b('0x35')]=_0x2dff3f[_0xeb7b('0x21')];_0x2dff3f[_0xeb7b('0x3b')]=_0x2dff3f['connectedlinename'];_0x2dff3f['connectedlinenum']=_0x2dff3f[_0xeb7b('0x22')];_0x2dff3f['connectedlinename']=_0x2dff3f[_0xeb7b('0x46')];_0x2dff3f[_0xeb7b('0x2c')]=_0x2dff3f['originatecalleridnum'];}else if(_0x2dff3f[_0xeb7b('0x2c')]==_0xeb7b('0x47')){_0x2dff3f[_0xeb7b('0x35')]=_0x2dff3f[_0xeb7b('0x2b')];_0x2dff3f['exten']=_0x2dff3f[_0xeb7b('0x38')];}RpcVoiceRecording[_0xeb7b('0x29')](_0x2dff3f);}}};Report['prototype'][_0xeb7b('0x48')]=function(_0x4ab33a){if(_[_0xeb7b('0x49')](_0x4ab33a)){_0x4ab33a[_0xeb7b('0x4a')](function(_0x2dd093){RpcVoiceAgentReport[_0xeb7b('0x29')](_0x2dd093);});}else{RpcVoiceAgentReport[_0xeb7b('0x29')](_0x4ab33a);}};Report[_0xeb7b('0xd')][_0xeb7b('0x16')]=function(_0x5125a4){RpcVoiceDialReport[_0xeb7b('0x29')](_0x5125a4);var _0x34cce4;var _0x5b5733;var _0xc80d22=_0x5125a4[_0xeb7b('0x37')];if(_[_0xeb7b('0x4b')](_0xc80d22,'Local')){_0x5b5733=_0xc80d22[_0xeb7b('0x4c')](_0xc80d22['indexOf']('/')+0x1,_0xc80d22['indexOf']('@'));_0x34cce4=_[_0xeb7b('0x1b')](this[_0xeb7b('0xc')],function(_0x3ed87d){return _0x3ed87d['mobile']==_0x5b5733||_0x3ed87d[_0xeb7b('0x4d')]==_0x5b5733||_0x3ed87d[_0xeb7b('0x22')]==_0x5b5733;});}else{_0x5b5733=_0xc80d22[_0xeb7b('0x4c')](_0xc80d22['indexOf']('/')+0x1,_0xc80d22[_0xeb7b('0x4e')]('-'));_0x34cce4=this[_0xeb7b('0x1a')](_0x5b5733);}if(_0x34cce4){_0x5125a4[_0xeb7b('0x1e')]=_[_0xeb7b('0x4f')](_0x34cce4[_0xeb7b('0x1e')])?util[_0xeb7b('0x25')](_0xeb7b('0x1f'),_0x34cce4[_0xeb7b('0x1d')]):_0x34cce4[_0xeb7b('0x1e')];_0x5125a4[_0xeb7b('0x46')]=_0x34cce4[_0xeb7b('0x1d')];_0x5125a4[_0xeb7b('0x22')]=_0x34cce4[_0xeb7b('0x22')];RpcMemberReport[_0xeb7b('0x16')](_0x5125a4);}};Report['prototype'][_0xeb7b('0x17')]=function(_0x5a7379){RpcVoiceTransferReport[_0xeb7b('0x3f')][_0x5a7379['transfererlinkedid']]=_0x5a7379;};Report[_0xeb7b('0xd')][_0xeb7b('0x19')]=function(_0x148eaa){RpcVoiceTransferReport[_0xeb7b('0x19')](_0x148eaa);};module[_0xeb7b('0x50')]=Report; \ No newline at end of file +var _0x21d3=['length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','channel','destinationchannel','calleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','uniqueid','linkedid','monitor','monitors','monitorFilename','filename','createdAt','exten','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','attendedTransfer','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','xdr','disabled','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','isNil','find','accountcode','name','interface','format','SIP/%s'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x21d3,0x191));var _0x321d=function(_0x560d5e,_0x21008a){_0x560d5e=_0x560d5e-0x0;var _0x1c3436=_0x21d3[_0x560d5e];return _0x1c3436;};'use strict';var _=require(_0x321d('0x0'));var moment=require(_0x321d('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x321d('0x2'));var RpcVoiceAgentReport=require(_0x321d('0x3'));var RpcVoiceCallReport=require(_0x321d('0x4'));var RpcVoiceDialReport=require(_0x321d('0x5'));var RpcMemberReport=require(_0x321d('0x6'));var RpcVoiceQueueReport=require(_0x321d('0x7'));var RpcVoiceRecording=require(_0x321d('0x8'));var RpcVoiceTransferReport=require(_0x321d('0x9'));var VoiceQueueReport=require(_0x321d('0xa'));var VoiceCallReport=require(_0x321d('0xb'));var VoiceAgentReport=require(_0x321d('0xc'));var VoiceDialReport=require(_0x321d('0xd'));var UserReport=require(_0x321d('0xe'));function Report(_0x3bb0fc){this[_0x321d('0xf')]=_0x3bb0fc;this[_0x321d('0x10')]=_0x3bb0fc[_0x321d('0x10')];this[_0x321d('0x11')]=_0x3bb0fc[_0x321d('0x11')];}Report['prototype']['sync']=function(_0x33af4f){var _0x43caf4=new VoiceQueueReport(this[_0x321d('0xf')]);var _0x39efa3=new VoiceAgentReport(this[_0x321d('0xf')]);var _0x500bfd=new VoiceDialReport(this[_0x321d('0xf')]);var _0x17c689=new VoiceCallReport(this['realtime']);var _0x2bab3b=new UserReport(this[_0x321d('0xf')]);if(config['xdr']&&config[_0x321d('0x12')][_0x321d('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x321d('0x14')][_0x321d('0x15')](this));ami['on']('custom:voiceCallReport',this[_0x321d('0x16')]['bind'](this));ami['on'](_0x321d('0x17'),this[_0x321d('0x18')]['bind'](this));ami['on'](_0x321d('0x19'),this[_0x321d('0x1a')][_0x321d('0x15')](this));ami['on'](_0x321d('0x1b'),this[_0x321d('0x1c')][_0x321d('0x15')](this));ami['on'](_0x321d('0x1d'),this['attendedTransfer'][_0x321d('0x15')](this));}};Report[_0x321d('0x1e')][_0x321d('0x1f')]=function(_0x4499b1){var _0xe8b645;_0xe8b645=_['find'](this[_0x321d('0x10')],function(_0x39967b){return _0x39967b['accountcode']==_0x4499b1||_0x39967b['name']==_0x4499b1;});if(_[_0x321d('0x20')](_0xe8b645)){var _0x44a164=_[_0x321d('0x21')](this['telephones'],function(_0x5db923){return _0x5db923[_0x321d('0x22')]==_0x4499b1||_0x5db923[_0x321d('0x23')]==_0x4499b1;});if(_0x44a164){_0xe8b645=_[_0x321d('0x21')](this[_0x321d('0x10')],function(_0x41f034){return _0x41f034[_0x321d('0x24')]==util[_0x321d('0x25')](_0x321d('0x26'),_0x44a164[_0x321d('0x23')]);});}}return _0xe8b645;};Report[_0x321d('0x1e')][_0x321d('0x14')]=function(_0x279983){for(var _0x2f5308=0x0;_0x2f5308<_0x279983[_0x321d('0x27')];_0x2f5308+=0x1){var _0x4902c8=this[_0x321d('0x1f')](_0x279983[_0x2f5308]['connectedlinenum']);if(_0x4902c8){_0x279983[_0x2f5308][_0x321d('0x22')]=_0x4902c8[_0x321d('0x22')];_0x279983[_0x2f5308][_0x321d('0x28')]=!![];_0x279983[_0x2f5308][_0x321d('0x29')]=_0x4902c8[_0x321d('0x23')];_0x279983[_0x2f5308][_0x321d('0x24')]=_[_0x321d('0x20')](_0x4902c8[_0x321d('0x24')])?util[_0x321d('0x25')](_0x321d('0x26'),_0x4902c8['name']):_0x4902c8[_0x321d('0x24')];if(_0x279983[_0x2f5308][_0x321d('0x2a')]){_0x279983[_0x2f5308][_0x321d('0x2b')]=moment()['format'](_0x321d('0x2c'));}if(_0x279983[_0x2f5308][_0x321d('0x2d')]){_0x279983[_0x2f5308]['queuecallerexitAt']=moment()[_0x321d('0x25')](_0x321d('0x2c'));}RpcMemberReport[_0x321d('0x14')](_0x279983[_0x2f5308]);}RpcVoiceQueueReport[_0x321d('0x2e')](_0x279983[_0x2f5308]);}};function extractCalleridNumber(_0x2a4a41){var _0x9d3231=_0x2a4a41[_0x321d('0x2f')](/<(.*?)>/);return _0x9d3231?_0x9d3231[0x1]:_0x2a4a41;}Report[_0x321d('0x1e')][_0x321d('0x16')]=function(_0x1108a6){_0x1108a6[_0x321d('0x30')]=_0x1108a6['destination']||_0x1108a6['exten'];if(_0x1108a6['type']==_0x321d('0x31')){_0x1108a6[_0x321d('0x32')]=_0x321d('0x33');_0x1108a6['lastdata']=_0x1108a6['queue'];if(_0x1108a6[_0x321d('0x34')]==_0x321d('0x35')){_0x1108a6[_0x321d('0x22')]='';_0x1108a6[_0x321d('0x30')]=extractCalleridNumber(_0x1108a6[_0x321d('0x36')]);}else if(_0x1108a6[_0x321d('0x34')]==_0x321d('0x37')){if(_0x1108a6['destination']=='xcally-motion-preview'){_0x1108a6[_0x321d('0x30')]=extractCalleridNumber(_0x1108a6[_0x321d('0x38')]);_0x1108a6['calleridnum']=_0x1108a6[_0x321d('0x39')];_0x1108a6['destinationchannel']=[_0x1108a6[_0x321d('0x3a')],_0x1108a6[_0x321d('0x3a')]=_0x1108a6[_0x321d('0x3b')]][0x0];_0x1108a6[_0x321d('0x36')]=_0x1108a6[_0x321d('0x38')];}else{_0x1108a6['destination']=_0x1108a6[_0x321d('0x3c')];_0x1108a6[_0x321d('0x3c')]=_0x1108a6[_0x321d('0x39')];if(_0x1108a6[_0x321d('0x3d')]==_0x321d('0x3e')){_0x1108a6['accountcode']=_0x1108a6[_0x321d('0x3f')];}else{_0x1108a6[_0x321d('0x22')]='';}}}}else{_0x1108a6['callerid']=util[_0x321d('0x25')](_0x321d('0x40'),_0x1108a6[_0x321d('0x41')],_0x1108a6[_0x321d('0x3c')]);}if(RpcVoiceTransferReport[_0x321d('0x42')][_0x1108a6['linkedid']]){var _0x28db5b=RpcVoiceTransferReport['transfers'][_0x1108a6['linkedid']];_0x28db5b['transfereelinkedid']=_0x1108a6[_0x321d('0x43')];RpcVoiceTransferReport[_0x321d('0x1c')](_0x28db5b);delete RpcVoiceTransferReport['transfers'][_0x1108a6[_0x321d('0x44')]];}RpcVoiceCallReport[_0x321d('0x2e')](_0x1108a6);if(_0x1108a6[_0x321d('0x45')]){for(var _0x1ca5c0=0x0;_0x1ca5c0<_0x1108a6[_0x321d('0x46')][_0x321d('0x27')];_0x1ca5c0+=0x1){_0x1108a6[_0x321d('0x47')]=_0x1108a6['monitors'][_0x1ca5c0][_0x321d('0x48')];_0x1108a6[_0x321d('0x49')]=_0x1108a6[_0x321d('0x46')][_0x1ca5c0][_0x321d('0x49')];if(_0x1108a6[_0x321d('0x4a')]==_0x321d('0x4b')){_0x1108a6[_0x321d('0x3c')]=_0x1108a6[_0x321d('0x3f')];_0x1108a6[_0x321d('0x41')]=_0x1108a6['connectedlinename'];_0x1108a6[_0x321d('0x3f')]=_0x1108a6['accountcode'];_0x1108a6[_0x321d('0x4c')]=_0x1108a6[_0x321d('0x4d')];_0x1108a6['exten']=_0x1108a6[_0x321d('0x39')];}else if(_0x1108a6[_0x321d('0x4a')]==_0x321d('0x4e')){_0x1108a6[_0x321d('0x3c')]=_0x1108a6[_0x321d('0x30')];_0x1108a6[_0x321d('0x4a')]=_0x1108a6[_0x321d('0x39')];}RpcVoiceRecording[_0x321d('0x2e')](_0x1108a6);}}};Report[_0x321d('0x1e')][_0x321d('0x18')]=function(_0xad07){if(_[_0x321d('0x4f')](_0xad07)){_0xad07[_0x321d('0x50')](function(_0x55090f){RpcVoiceAgentReport[_0x321d('0x2e')](_0x55090f);});}else{RpcVoiceAgentReport[_0x321d('0x2e')](_0xad07);}};Report[_0x321d('0x1e')][_0x321d('0x1a')]=function(_0x11db3d){RpcVoiceDialReport[_0x321d('0x2e')](_0x11db3d);var _0x1c0702;var _0x30d59c;var _0x296c60=_0x11db3d['channel'];if(_[_0x321d('0x51')](_0x296c60,_0x321d('0x52'))){_0x30d59c=_0x296c60[_0x321d('0x53')](_0x296c60[_0x321d('0x54')]('/')+0x1,_0x296c60[_0x321d('0x54')]('@'));_0x1c0702=_[_0x321d('0x21')](this['agents'],function(_0xd32f48){return _0xd32f48[_0x321d('0x55')]==_0x30d59c||_0xd32f48[_0x321d('0x56')]==_0x30d59c||_0xd32f48[_0x321d('0x22')]==_0x30d59c;});}else{_0x30d59c=_0x296c60[_0x321d('0x53')](_0x296c60[_0x321d('0x54')]('/')+0x1,_0x296c60['lastIndexOf']('-'));_0x1c0702=this[_0x321d('0x1f')](_0x30d59c);}if(_0x1c0702){_0x11db3d[_0x321d('0x24')]=_[_0x321d('0x20')](_0x1c0702[_0x321d('0x24')])?util[_0x321d('0x25')]('SIP/%s',_0x1c0702[_0x321d('0x23')]):_0x1c0702[_0x321d('0x24')];_0x11db3d[_0x321d('0x4d')]=_0x1c0702[_0x321d('0x23')];_0x11db3d[_0x321d('0x22')]=_0x1c0702[_0x321d('0x22')];RpcMemberReport[_0x321d('0x1a')](_0x11db3d);}};Report[_0x321d('0x1e')][_0x321d('0x1c')]=function(_0x593d4d){RpcVoiceTransferReport[_0x321d('0x42')][_0x593d4d['transfererlinkedid']]=_0x593d4d;};Report[_0x321d('0x1e')][_0x321d('0x57')]=function(_0x47d05b){RpcVoiceTransferReport['attendedTransfer'](_0x47d05b);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index d472bbb..648d5be 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 _0xfa91=['agents','telephones','registryentry','syncRegistry','registry','bind','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','telephone:save','startsWith','Local','substring','mobile','phone','accountcode','syncPeerStatus','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks'];(function(_0x364bdf,_0x3af325){var _0xc877fb=function(_0x1cf971){while(--_0x1cf971){_0x364bdf['push'](_0x364bdf['shift']());}};_0xc877fb(++_0x3af325);}(_0xfa91,0x11b));var _0x1fa9=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xfa91[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var moment=require(_0x1fa9('0x0'));var util=require('util');var Redis=require(_0x1fa9('0x1'));var BPromise=require('bluebird');var config=require(_0x1fa9('0x2'));var logger=require(_0x1fa9('0x3'))(_0x1fa9('0x4'));var ami=require('../ami');config[_0x1fa9('0x5')]=_['defaults'](config[_0x1fa9('0x5')],{'host':_0x1fa9('0x6'),'port':0x18eb});var io=require(_0x1fa9('0x7'))(new Redis(config[_0x1fa9('0x5')]));function UserReport(_0x112436){this['trunks']=_0x112436[_0x1fa9('0x8')];this[_0x1fa9('0x9')]=_0x112436[_0x1fa9('0x9')];this[_0x1fa9('0xa')]=_0x112436[_0x1fa9('0xa')];ami['on'](_0x1fa9('0xb'),this[_0x1fa9('0xc')]['bind'](this));ami['on'](_0x1fa9('0xd'),this[_0x1fa9('0xc')][_0x1fa9('0xe')](this));ami['on']('devicestatechange',this[_0x1fa9('0xf')][_0x1fa9('0xe')](this));ami['on'](_0x1fa9('0x10'),this['syncPeerStatus'][_0x1fa9('0xe')](this));return this[_0x1fa9('0x11')]();}function showSipRegistrations(){Promise[_0x1fa9('0x12')]()[_0x1fa9('0x13')](ami[_0x1fa9('0x14')]())[_0x1fa9('0x15')](function(_0x5a6cee){logger[_0x1fa9('0x16')](_0x1fa9('0x17'),util[_0x1fa9('0x18')](_0x5a6cee,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x1fa9('0x12')]()[_0x1fa9('0x13')](ami[_0x1fa9('0x19')]())[_0x1fa9('0x15')](function(_0x3abd22){logger[_0x1fa9('0x16')](_0x1fa9('0x1a'),util['inspect'](_0x3abd22,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x1fa9('0x12')]()[_0x1fa9('0x13')](ami['actionSipPeerStatus']())[_0x1fa9('0x15')](function(_0x3b9934){logger[_0x1fa9('0x16')](_0x1fa9('0x1b'),util[_0x1fa9('0x18')](_0x3b9934,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x1fa9('0x11')]=function(){setInterval(function(){BPromise[_0x1fa9('0x12')]()[_0x1fa9('0x13')](showSipRegistrations())[_0x1fa9('0x13')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x1fa9('0x1c')][_0x1fa9('0x1d')]=function(_0x6c8835){return _0x6c8835!==null&&!_[_0x1fa9('0x1e')](_0x6c8835);};UserReport[_0x1fa9('0x1c')][_0x1fa9('0x1f')]=function(_0x4b586d,_0x3e6acb,_0xea8351){io['to'](_0x4b586d)[_0x1fa9('0x1f')](_0x3e6acb,_0xea8351);};UserReport[_0x1fa9('0x1c')][_0x1fa9('0xc')]=function(_0x8bb493){try{if(this[_0x1fa9('0x1d')](_0x8bb493)){logger[_0x1fa9('0x20')](_0x1fa9('0x21'),_0x8bb493[_0x1fa9('0x22')],_0x8bb493[_0x1fa9('0x23')]);logger['debug'](_0x1fa9('0x24'),util[_0x1fa9('0x18')](_0x8bb493,{'showHidden':![],'depth':null}));var _0x15b4a4=_[_0x1fa9('0x25')](this[_0x1fa9('0x8')],{'defaultuser':_0x8bb493[_0x1fa9('0x22')]});if(_0x15b4a4){_0x8bb493[_0x1fa9('0x26')]=_0x8bb493['state'];_[_0x1fa9('0x27')](_0x15b4a4,_[_0x1fa9('0x28')](_0x8bb493,[_0x1fa9('0x29'),_0x1fa9('0x2a'),_0x1fa9('0x22'),_0x1fa9('0x23')]));logger[_0x1fa9('0x2b')](_0x1fa9('0x2c'),util[_0x1fa9('0x18')](_0x15b4a4,{'showHidden':![],'depth':null}));this[_0x1fa9('0x1f')](util['format'](_0x1fa9('0x2d'),_0x15b4a4['name']),_0x1fa9('0x2e'),_0x15b4a4);}}}catch(_0x85e667){logger[_0x1fa9('0x16')](_0x1fa9('0x24'),util['inspect'](_0x85e667,{'showHidden':![],'depth':null}));}};UserReport[_0x1fa9('0x1c')][_0x1fa9('0xf')]=function(_0x22b719){try{if(this[_0x1fa9('0x1d')](_0x22b719)){logger[_0x1fa9('0x20')](_0x1fa9('0x2f'),_0x22b719[_0x1fa9('0x30')],_0x22b719[_0x1fa9('0x23')]);logger[_0x1fa9('0x2b')](_0x1fa9('0x31'),util[_0x1fa9('0x18')](_0x22b719,{'showHidden':![],'depth':null}));if(this['agents'][_0x22b719[_0x1fa9('0x30')]]){if(!this['agents'][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x32')]||_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]()=='inuse'){this[_0x1fa9('0x9')][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x32')]=![];if(this[_0x1fa9('0x9')][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x23')]!==_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]()){this[_0x1fa9('0x9')][_0x22b719['device']][_0x1fa9('0x34')]=_[_0x1fa9('0x35')](moment()[_0x1fa9('0x36')]('x'));}this[_0x1fa9('0x9')][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x23')]=_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]();this['agents'][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x37')](_0x22b719);}}else if(this[_0x1fa9('0xa')][_0x22b719[_0x1fa9('0x30')]]){if(this[_0x1fa9('0xa')][_0x22b719['device']][_0x1fa9('0x23')]!==_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]()){this[_0x1fa9('0xa')][_0x22b719['device']]['stateTime']=_[_0x1fa9('0x35')](moment()[_0x1fa9('0x36')]('x'));}this[_0x1fa9('0xa')][_0x22b719['device']][_0x1fa9('0x23')]=_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]();logger[_0x1fa9('0x2b')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x22b719[_0x1fa9('0x30')]],{'showHidden':![],'depth':null}));this[_0x1fa9('0x1f')](util[_0x1fa9('0x36')](_0x1fa9('0x38'),this[_0x1fa9('0xa')][_0x22b719['device']][_0x1fa9('0x39')]),_0x1fa9('0x3a'),this[_0x1fa9('0xa')][_0x22b719[_0x1fa9('0x30')]]);}else if(this[_0x1fa9('0x8')][_0x22b719[_0x1fa9('0x30')]]){if(this[_0x1fa9('0x8')][_0x22b719[_0x1fa9('0x30')]]['state']!==_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]()){this['trunks'][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x34')]=_[_0x1fa9('0x35')](moment()['format']('x'));}this[_0x1fa9('0x8')][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x23')]=_0x22b719[_0x1fa9('0x23')]['toLowerCase']();logger[_0x1fa9('0x2b')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x1fa9('0x18')](this[_0x1fa9('0x8')][_0x22b719['device']],{'showHidden':![],'depth':null}));this[_0x1fa9('0x1f')](util[_0x1fa9('0x36')](_0x1fa9('0x2d'),this[_0x1fa9('0x8')][_0x22b719[_0x1fa9('0x30')]][_0x1fa9('0x39')]),_0x1fa9('0x2e'),this[_0x1fa9('0x8')][_0x22b719[_0x1fa9('0x30')]]);}else if(_[_0x1fa9('0x3b')](_0x22b719['device'],_0x1fa9('0x3c'))){var _0x571457=_0x22b719['device'];var _0x5cdfcd=_0x571457[_0x1fa9('0x3d')](_0x571457['indexOf']('/')+0x1,_0x571457['indexOf']('@'));var _0x55e9a2=_[_0x1fa9('0x25')](this[_0x1fa9('0x9')],function(_0x116b93){return _0x116b93[_0x1fa9('0x3e')]==_0x5cdfcd||_0x116b93[_0x1fa9('0x3f')]==_0x5cdfcd||_0x116b93[_0x1fa9('0x40')]==_0x5cdfcd;});if(_0x55e9a2){if(_0x55e9a2[_0x1fa9('0x23')]!==_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]()){_0x55e9a2[_0x1fa9('0x34')]=_['toNumber'](moment()[_0x1fa9('0x36')]('x'));}_0x55e9a2[_0x1fa9('0x23')]=_0x22b719[_0x1fa9('0x23')][_0x1fa9('0x33')]();_0x55e9a2[_0x1fa9('0x32')]=!![];_0x55e9a2['updateStatusRealtime'](_0x22b719);}}}}catch(_0x49bb1a){logger[_0x1fa9('0x16')](_0x1fa9('0x31'),util[_0x1fa9('0x18')](_0x49bb1a,{'showHidden':![],'depth':null}));}};UserReport[_0x1fa9('0x1c')][_0x1fa9('0x41')]=function(_0x59da37){try{if(this['isNotNull'](_0x59da37)&&this[_0x1fa9('0x1d')](_0x59da37[_0x1fa9('0x10')])){logger[_0x1fa9('0x20')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x59da37['peer'],_0x59da37[_0x1fa9('0x42')],_0x59da37[_0x1fa9('0x10')]);logger[_0x1fa9('0x2b')](_0x1fa9('0x43'),util['inspect'](_0x59da37,{'showHidden':![],'depth':null}));if(this['agents'][_0x59da37[_0x1fa9('0x44')]]){if(!this[_0x1fa9('0x9')][_0x59da37[_0x1fa9('0x44')]][_0x1fa9('0x32')]||_0x59da37[_0x1fa9('0x10')]['toLowerCase']()==_0x1fa9('0x45')){this[_0x1fa9('0x9')][_0x59da37['peer']]['local']=![];this[_0x1fa9('0x9')][_0x59da37[_0x1fa9('0x44')]][_0x1fa9('0x46')]=_0x59da37[_0x1fa9('0x10')][_0x1fa9('0x33')]();this[_0x1fa9('0x9')][_0x59da37[_0x1fa9('0x44')]]['address']=_0x59da37[_0x1fa9('0x42')];this[_0x1fa9('0x9')][_0x59da37[_0x1fa9('0x44')]][_0x1fa9('0x37')](_0x59da37);}}else if(this[_0x1fa9('0xa')][_0x59da37[_0x1fa9('0x44')]]){this['telephones'][_0x59da37[_0x1fa9('0x44')]][_0x1fa9('0x46')]=_0x59da37[_0x1fa9('0x10')][_0x1fa9('0x33')]();this['telephones'][_0x59da37['peer']][_0x1fa9('0x42')]=_0x59da37[_0x1fa9('0x42')];logger[_0x1fa9('0x2b')](_0x1fa9('0x47'),util[_0x1fa9('0x18')](this[_0x1fa9('0xa')][_0x59da37['peer']],{'showHidden':![],'depth':null}));this[_0x1fa9('0x1f')](util[_0x1fa9('0x36')](_0x1fa9('0x38'),this[_0x1fa9('0xa')][_0x59da37['peer']][_0x1fa9('0x39')]),'telephone:save',this[_0x1fa9('0xa')][_0x59da37['peer']]);}else if(this['trunks'][_0x59da37['peer']]){this[_0x1fa9('0x8')][_0x59da37[_0x1fa9('0x44')]]['status']=_0x59da37[_0x1fa9('0x10')][_0x1fa9('0x33')]();this[_0x1fa9('0x8')][_0x59da37[_0x1fa9('0x44')]]['address']=_0x59da37[_0x1fa9('0x42')];logger[_0x1fa9('0x2b')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x1fa9('0x18')](this[_0x1fa9('0x8')][_0x59da37[_0x1fa9('0x44')]],{'showHidden':![],'depth':null}));this[_0x1fa9('0x1f')](util[_0x1fa9('0x36')]('trunk:%s',this[_0x1fa9('0x8')][_0x59da37['peer']]['name']),_0x1fa9('0x2e'),this[_0x1fa9('0x8')][_0x59da37[_0x1fa9('0x44')]]);}}}catch(_0x254d88){logger[_0x1fa9('0x16')](_0x1fa9('0x43'),util[_0x1fa9('0x18')](_0x254d88,{'showHidden':![],'depth':null}));}};module[_0x1fa9('0x48')]=UserReport; \ No newline at end of file +var _0xa4b5=['syncRegistry','registry','bind','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','find','stateRegistry','merge','omit','event','format','trunk:%s','name','[userReport][registry]','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:save','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry'];(function(_0x3787d2,_0x3c72c4){var _0x12b003=function(_0x47f805){while(--_0x47f805){_0x3787d2['push'](_0x3787d2['shift']());}};_0x12b003(++_0x3c72c4);}(_0xa4b5,0xda));var _0x5a4b=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa4b5[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x5a4b('0x0'));var moment=require(_0x5a4b('0x1'));var util=require(_0x5a4b('0x2'));var Redis=require(_0x5a4b('0x3'));var BPromise=require(_0x5a4b('0x4'));var config=require(_0x5a4b('0x5'));var logger=require(_0x5a4b('0x6'))(_0x5a4b('0x7'));var ami=require('../ami');config[_0x5a4b('0x8')]=_[_0x5a4b('0x9')](config[_0x5a4b('0x8')],{'host':_0x5a4b('0xa'),'port':0x18eb});var io=require(_0x5a4b('0xb'))(new Redis(config[_0x5a4b('0x8')]));function UserReport(_0x2be4f4){this[_0x5a4b('0xc')]=_0x2be4f4[_0x5a4b('0xc')];this[_0x5a4b('0xd')]=_0x2be4f4[_0x5a4b('0xd')];this[_0x5a4b('0xe')]=_0x2be4f4[_0x5a4b('0xe')];ami['on'](_0x5a4b('0xf'),this[_0x5a4b('0x10')]['bind'](this));ami['on'](_0x5a4b('0x11'),this[_0x5a4b('0x10')][_0x5a4b('0x12')](this));ami['on']('devicestatechange',this[_0x5a4b('0x13')][_0x5a4b('0x12')](this));ami['on'](_0x5a4b('0x14'),this[_0x5a4b('0x15')][_0x5a4b('0x12')](this));return this[_0x5a4b('0x16')]();}function showSipRegistrations(){Promise[_0x5a4b('0x17')]()[_0x5a4b('0x18')](ami[_0x5a4b('0x19')]())['catch'](function(_0x339f0c){logger['error'](_0x5a4b('0x1a'),util[_0x5a4b('0x1b')](_0x339f0c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x5a4b('0x17')]()[_0x5a4b('0x18')](ami[_0x5a4b('0x1c')]())[_0x5a4b('0x1d')](function(_0x42fc5b){logger[_0x5a4b('0x1e')](_0x5a4b('0x1f'),util[_0x5a4b('0x1b')](_0x42fc5b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x5a4b('0x17')]()[_0x5a4b('0x18')](ami[_0x5a4b('0x20')]())['catch'](function(_0x1a7303){logger[_0x5a4b('0x1e')](_0x5a4b('0x21'),util[_0x5a4b('0x1b')](_0x1a7303,{'showHidden':![],'depth':null}));});}UserReport[_0x5a4b('0x22')][_0x5a4b('0x16')]=function(){setInterval(function(){BPromise[_0x5a4b('0x17')]()[_0x5a4b('0x18')](showSipRegistrations())[_0x5a4b('0x18')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x5a4b('0x22')][_0x5a4b('0x23')]=function(_0x35eaef){return _0x35eaef!==null&&!_[_0x5a4b('0x24')](_0x35eaef);};UserReport[_0x5a4b('0x22')][_0x5a4b('0x25')]=function(_0xe3f2ad,_0x27d169,_0x5e0054){io['to'](_0xe3f2ad)['emit'](_0x27d169,_0x5e0054);};UserReport[_0x5a4b('0x22')][_0x5a4b('0x10')]=function(_0x2792f6){try{if(this[_0x5a4b('0x23')](_0x2792f6)){logger[_0x5a4b('0x26')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x2792f6[_0x5a4b('0x27')],_0x2792f6[_0x5a4b('0x28')]);logger[_0x5a4b('0x29')]('[userReport][registry]',util[_0x5a4b('0x1b')](_0x2792f6,{'showHidden':![],'depth':null}));var _0x3b459a=_[_0x5a4b('0x2a')](this[_0x5a4b('0xc')],{'defaultuser':_0x2792f6[_0x5a4b('0x27')]});if(_0x3b459a){_0x2792f6[_0x5a4b('0x2b')]=_0x2792f6[_0x5a4b('0x28')];_[_0x5a4b('0x2c')](_0x3b459a,_[_0x5a4b('0x2d')](_0x2792f6,[_0x5a4b('0x2e'),'actionid',_0x5a4b('0x27'),_0x5a4b('0x28')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x5a4b('0x1b')](_0x3b459a,{'showHidden':![],'depth':null}));this[_0x5a4b('0x25')](util[_0x5a4b('0x2f')](_0x5a4b('0x30'),_0x3b459a[_0x5a4b('0x31')]),'trunk:save',_0x3b459a);}}}catch(_0x57ddee){logger['error'](_0x5a4b('0x32'),util['inspect'](_0x57ddee,{'showHidden':![],'depth':null}));}};UserReport[_0x5a4b('0x22')][_0x5a4b('0x13')]=function(_0x2f2a3c){try{if(this[_0x5a4b('0x23')](_0x2f2a3c)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x2f2a3c[_0x5a4b('0x33')],_0x2f2a3c[_0x5a4b('0x28')]);logger[_0x5a4b('0x29')](_0x5a4b('0x34'),util['inspect'](_0x2f2a3c,{'showHidden':![],'depth':null}));if(this[_0x5a4b('0xd')][_0x2f2a3c[_0x5a4b('0x33')]]){if(!this['agents'][_0x2f2a3c['device']][_0x5a4b('0x35')]||_0x2f2a3c[_0x5a4b('0x28')]['toLowerCase']()==_0x5a4b('0x36')){this[_0x5a4b('0xd')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x35')]=![];if(this['agents'][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]!==_0x2f2a3c[_0x5a4b('0x28')][_0x5a4b('0x37')]()){this[_0x5a4b('0xd')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x38')]=_[_0x5a4b('0x39')](moment()[_0x5a4b('0x2f')]('x'));}this[_0x5a4b('0xd')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]=_0x2f2a3c[_0x5a4b('0x28')][_0x5a4b('0x37')]();this[_0x5a4b('0xd')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x3a')](_0x2f2a3c);}}else if(this['telephones'][_0x2f2a3c['device']]){if(this[_0x5a4b('0xe')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]!==_0x2f2a3c['state'][_0x5a4b('0x37')]()){this['telephones'][_0x2f2a3c['device']][_0x5a4b('0x38')]=_['toNumber'](moment()[_0x5a4b('0x2f')]('x'));}this[_0x5a4b('0xe')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]=_0x2f2a3c[_0x5a4b('0x28')]['toLowerCase']();logger[_0x5a4b('0x29')](_0x5a4b('0x3b'),util[_0x5a4b('0x1b')](this[_0x5a4b('0xe')][_0x2f2a3c[_0x5a4b('0x33')]],{'showHidden':![],'depth':null}));this[_0x5a4b('0x25')](util[_0x5a4b('0x2f')](_0x5a4b('0x3c'),this[_0x5a4b('0xe')][_0x2f2a3c['device']][_0x5a4b('0x31')]),_0x5a4b('0x3d'),this[_0x5a4b('0xe')][_0x2f2a3c[_0x5a4b('0x33')]]);}else if(this[_0x5a4b('0xc')][_0x2f2a3c[_0x5a4b('0x33')]]){if(this['trunks'][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]!==_0x2f2a3c[_0x5a4b('0x28')][_0x5a4b('0x37')]()){this[_0x5a4b('0xc')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x38')]=_[_0x5a4b('0x39')](moment()['format']('x'));}this[_0x5a4b('0xc')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x28')]=_0x2f2a3c['state'][_0x5a4b('0x37')]();logger[_0x5a4b('0x29')](_0x5a4b('0x3e'),util[_0x5a4b('0x1b')](this[_0x5a4b('0xc')][_0x2f2a3c[_0x5a4b('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x5a4b('0x2f')](_0x5a4b('0x30'),this[_0x5a4b('0xc')][_0x2f2a3c[_0x5a4b('0x33')]][_0x5a4b('0x31')]),'trunk:save',this['trunks'][_0x2f2a3c[_0x5a4b('0x33')]]);}else if(_[_0x5a4b('0x3f')](_0x2f2a3c[_0x5a4b('0x33')],_0x5a4b('0x40'))){var _0x486974=_0x2f2a3c[_0x5a4b('0x33')];var _0xa0b491=_0x486974[_0x5a4b('0x41')](_0x486974[_0x5a4b('0x42')]('/')+0x1,_0x486974['indexOf']('@'));var _0x36afaf=_[_0x5a4b('0x2a')](this[_0x5a4b('0xd')],function(_0x20edf6){return _0x20edf6[_0x5a4b('0x43')]==_0xa0b491||_0x20edf6['phone']==_0xa0b491||_0x20edf6[_0x5a4b('0x44')]==_0xa0b491;});if(_0x36afaf){if(_0x36afaf[_0x5a4b('0x28')]!==_0x2f2a3c['state'][_0x5a4b('0x37')]()){_0x36afaf[_0x5a4b('0x38')]=_['toNumber'](moment()[_0x5a4b('0x2f')]('x'));}_0x36afaf[_0x5a4b('0x28')]=_0x2f2a3c[_0x5a4b('0x28')][_0x5a4b('0x37')]();_0x36afaf['local']=!![];_0x36afaf[_0x5a4b('0x3a')](_0x2f2a3c);}}}}catch(_0x473b5e){logger[_0x5a4b('0x1e')](_0x5a4b('0x34'),util['inspect'](_0x473b5e,{'showHidden':![],'depth':null}));}};UserReport[_0x5a4b('0x22')][_0x5a4b('0x15')]=function(_0x44a4db){try{if(this[_0x5a4b('0x23')](_0x44a4db)&&this[_0x5a4b('0x23')](_0x44a4db[_0x5a4b('0x14')])){logger[_0x5a4b('0x26')](_0x5a4b('0x45'),_0x44a4db[_0x5a4b('0x46')],_0x44a4db['address'],_0x44a4db[_0x5a4b('0x14')]);logger[_0x5a4b('0x29')](_0x5a4b('0x47'),util[_0x5a4b('0x1b')](_0x44a4db,{'showHidden':![],'depth':null}));if(this[_0x5a4b('0xd')][_0x44a4db['peer']]){if(!this[_0x5a4b('0xd')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x35')]||_0x44a4db[_0x5a4b('0x14')][_0x5a4b('0x37')]()=='registered'){this['agents'][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x35')]=![];this[_0x5a4b('0xd')][_0x44a4db[_0x5a4b('0x46')]]['status']=_0x44a4db[_0x5a4b('0x14')][_0x5a4b('0x37')]();this[_0x5a4b('0xd')][_0x44a4db['peer']]['address']=_0x44a4db[_0x5a4b('0x48')];this[_0x5a4b('0xd')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x3a')](_0x44a4db);}}else if(this[_0x5a4b('0xe')][_0x44a4db[_0x5a4b('0x46')]]){this[_0x5a4b('0xe')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x49')]=_0x44a4db[_0x5a4b('0x14')][_0x5a4b('0x37')]();this[_0x5a4b('0xe')][_0x44a4db['peer']][_0x5a4b('0x48')]=_0x44a4db[_0x5a4b('0x48')];logger[_0x5a4b('0x29')](_0x5a4b('0x4a'),util[_0x5a4b('0x1b')](this[_0x5a4b('0xe')][_0x44a4db[_0x5a4b('0x46')]],{'showHidden':![],'depth':null}));this[_0x5a4b('0x25')](util[_0x5a4b('0x2f')](_0x5a4b('0x3c'),this[_0x5a4b('0xe')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x31')]),_0x5a4b('0x3d'),this[_0x5a4b('0xe')][_0x44a4db[_0x5a4b('0x46')]]);}else if(this[_0x5a4b('0xc')][_0x44a4db[_0x5a4b('0x46')]]){this[_0x5a4b('0xc')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x49')]=_0x44a4db[_0x5a4b('0x14')][_0x5a4b('0x37')]();this[_0x5a4b('0xc')][_0x44a4db[_0x5a4b('0x46')]][_0x5a4b('0x48')]=_0x44a4db[_0x5a4b('0x48')];logger['debug'](_0x5a4b('0x4b'),util[_0x5a4b('0x1b')](this[_0x5a4b('0xc')][_0x44a4db['peer']],{'showHidden':![],'depth':null}));this[_0x5a4b('0x25')](util[_0x5a4b('0x2f')](_0x5a4b('0x30'),this['trunks'][_0x44a4db['peer']][_0x5a4b('0x31')]),_0x5a4b('0x4c'),this[_0x5a4b('0xc')][_0x44a4db[_0x5a4b('0x46')]]);}}}catch(_0x5245a0){logger[_0x5a4b('0x1e')]('[userReport][peerstatus]',util[_0x5a4b('0x1b')](_0x5245a0,{'showHidden':![],'depth':null}));}};module[_0x5a4b('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index c19fd59..8001563 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 _0x5334=['queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','syncHangup','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','emit','isUndefined','prototype','syncAgentCalled','isNotNull','info','uniqueid','membername','destuniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','queue','type','inbound','voice','merge','event','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','connect','voiceChannels','routealias','interface','pick','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','transfer','talktime','acw','acwtime','acwTimeout','agentacw','omit','destconnectedlinenum','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','redis','defaults','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer'];(function(_0xbb2a49,_0x3df491){var _0x1bc3ee=function(_0x252aa6){while(--_0x252aa6){_0xbb2a49['push'](_0xbb2a49['shift']());}};_0x1bc3ee(++_0x3df491);}(_0x5334,0x84));var _0x4533=function(_0x2f6af6,_0x366ef5){_0x2f6af6=_0x2f6af6-0x0;var _0x383072=_0x5334[_0x2f6af6];return _0x383072;};'use strict';var _=require(_0x4533('0x0'));var moment=require(_0x4533('0x1'));var util=require(_0x4533('0x2'));var Redis=require(_0x4533('0x3'));var config=require(_0x4533('0x4'));var logger=require('../../../config/logger')(_0x4533('0x5'));var ami=require('../ami');config[_0x4533('0x6')]=_[_0x4533('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4533('0x6')]));function VoiceAgentReport(_0x4dea06){this['channels']={};this['voiceChannels']=_0x4dea06[_0x4533('0x8')];this[_0x4533('0x9')]=_0x4dea06[_0x4533('0x9')];this[_0x4533('0xa')]=_0x4dea06[_0x4533('0xa')];this[_0x4533('0xb')]={};ami['on'](_0x4533('0xc'),this['syncAgentCalled'][_0x4533('0xd')](this));ami['on'](_0x4533('0xe'),this[_0x4533('0xf')][_0x4533('0xd')](this));ami['on']('agentringnoanswer',this[_0x4533('0x10')]['bind'](this));ami['on'](_0x4533('0x11'),this[_0x4533('0x12')][_0x4533('0xd')](this));ami['on'](_0x4533('0x13'),this['syncAgentComplete'][_0x4533('0xd')](this));ami['on'](_0x4533('0x14'),this[_0x4533('0x15')][_0x4533('0xd')](this));ami['on']('hangup',this[_0x4533('0x16')]['bind'](this));ami['on']('musiconholdstart',this[_0x4533('0x17')][_0x4533('0xd')](this));ami['on']('musiconholdstop',this[_0x4533('0x18')][_0x4533('0xd')](this));ami['on'](_0x4533('0x19'),this['syncAttendedTransfer'][_0x4533('0xd')](this));ami['on']('blindtransfer',this[_0x4533('0x1a')][_0x4533('0xd')](this));}VoiceAgentReport['prototype'][_0x4533('0x1b')]=function(_0x5a4e8f,_0x5c2c9c,_0x1c5cdd){io['to'](_0x5a4e8f)[_0x4533('0x1b')](_0x5c2c9c,_0x1c5cdd);};VoiceAgentReport['prototype']['isNotNull']=function(_0x1abe1d){return _0x1abe1d!==null&&!_[_0x4533('0x1c')](_0x1abe1d);};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x1e')]=function(_0x6766eb){try{if(this[_0x4533('0x1f')](_0x6766eb)){logger[_0x4533('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x6766eb[_0x4533('0x21')],_0x6766eb[_0x4533('0x22')],_0x6766eb[_0x4533('0x23')]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x6766eb[_0x4533('0x21')],util[_0x4533('0x24')](_0x6766eb,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x6766eb[_0x4533('0x21')]])){this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]]={};}if(_['isUndefined'](this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb[_0x4533('0x23')]])){this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb[_0x4533('0x23')]]={'agentcalledAt':moment()[_0x4533('0x25')](_0x4533('0x26')),'lastevent':_0x4533('0x27'),'mandatoryDisposition':this['voiceQueues'][_0x6766eb['queue']]?this[_0x4533('0x9')][_0x6766eb['queue']][_0x4533('0x28')]||![]:![],'type':this['voiceQueues'][_0x6766eb[_0x4533('0x29')]]?this[_0x4533('0x9')][_0x6766eb[_0x4533('0x29')]][_0x4533('0x2a')]||_0x4533('0x2b'):_0x4533('0x2b'),'variables':this[_0x4533('0xb')][_0x6766eb[_0x4533('0x21')]],'motionChannel':_0x4533('0x2c')};}_[_0x4533('0x2d')](this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb[_0x4533('0x23')]],_['omit'](_0x6766eb,[_0x4533('0x2e'),'privilege']));logger[_0x4533('0x2f')](_0x4533('0x30'),_0x6766eb[_0x4533('0x21')],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb[_0x4533('0x23')]],{'showHidden':![],'depth':null}));ami[_0x4533('0x1b')](_0x4533('0x31'),this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb[_0x4533('0x23')]]);logger['debug'](_0x4533('0x32'),_0x6766eb[_0x4533('0x21')],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x6766eb[_0x4533('0x21')]][_0x6766eb['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x4533('0x1b')](util[_0x4533('0x25')](_0x4533('0x33'),_0x6766eb[_0x4533('0x22')]),_0x4533('0x34'),this[_0x4533('0x8')][_0x6766eb['uniqueid']][_0x6766eb[_0x4533('0x23')]]);}}catch(_0x36c289){logger['error'](_0x4533('0x35'),_0x6766eb[_0x4533('0x21')],util[_0x4533('0x24')](_0x36c289,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0xf')]=function(_0x41fb9b){try{if(this[_0x4533('0x1f')](_0x41fb9b)){if(this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]]){logger[_0x4533('0x2f')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x41fb9b[_0x4533('0x21')],util[_0x4533('0x24')](_0x41fb9b,{'showHidden':![],'depth':null}));for(var _0x296d31 in this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]]){if(this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x4533('0x36')](_0x296d31)){if(_0x41fb9b[_0x4533('0x23')]===_0x296d31){logger[_0x4533('0x20')](_0x4533('0x37'),_0x41fb9b[_0x4533('0x21')],_0x41fb9b['membername'],_0x41fb9b['destuniqueid']);this[_0x4533('0x8')][_0x41fb9b['uniqueid']][_0x296d31][_0x4533('0x38')]=moment()[_0x4533('0x25')](_0x4533('0x26'));this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x39')]=_0x41fb9b[_0x4533('0x39')];this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x3a')]=_0x41fb9b[_0x4533('0x3a')];this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31]['destchannelstate']=_0x41fb9b[_0x4533('0x3b')];this['channels'][_0x41fb9b['uniqueid']][_0x296d31]['destchannelstatedesc']=_0x41fb9b['destchannelstatedesc'];this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x3c')]=_0x41fb9b[_0x4533('0x3c')];this['channels'][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x3d')]=_0x4533('0x3e');if(this[_0x4533('0x3f')][this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x21')]]){var _0x5661be=this[_0x4533('0x3f')][this['channels'][_0x41fb9b['uniqueid']][_0x296d31][_0x4533('0x21')]][_0x4533('0x40')];this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31]['routealias']=_0x5661be;_0x41fb9b['routealias']=_0x5661be;}_[_0x4533('0x2d')](this['agents'][_0x41fb9b[_0x4533('0x41')]],_[_0x4533('0x42')](_0x41fb9b,['queue','destconnectedlinenum','routealias']));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x41fb9b[_0x4533('0x21')],util['inspect'](this[_0x4533('0x8')][_0x41fb9b['uniqueid']][_0x41fb9b[_0x4533('0x23')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0x4533('0x8')][_0x41fb9b['uniqueid']][_0x41fb9b[_0x4533('0x23')]]);logger['debug'](_0x4533('0x43'),_0x41fb9b[_0x4533('0x21')],util['inspect'](this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x41fb9b[_0x4533('0x23')]],{'showHidden':![],'depth':null}));this[_0x4533('0x1b')](util[_0x4533('0x25')]('user:%s',_0x41fb9b[_0x4533('0x22')]),_0x4533('0x44'),this['channels'][_0x41fb9b[_0x4533('0x21')]][_0x41fb9b[_0x4533('0x23')]]);}else if(!this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x45')]&&!this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x13')]){logger[_0x4533('0x20')](_0x4533('0x46'),_0x41fb9b[_0x4533('0x21')],this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x22')],_0x296d31);this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31]['agentringnoanswer']=!![];this[_0x4533('0x8')][_0x41fb9b['uniqueid']][_0x296d31]['agentringnoanswerAt']=moment()[_0x4533('0x25')](_0x4533('0x26'));this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31]['answeredelsewheredestinationuniqueid']=_0x41fb9b[_0x4533('0x23')];this['channels'][_0x41fb9b['uniqueid']][_0x296d31][_0x4533('0x47')]=_0x41fb9b['membername'];this[_0x4533('0x8')][_0x41fb9b['uniqueid']][_0x296d31][_0x4533('0x3d')]=_0x4533('0x48');this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31][_0x4533('0x49')]='answered_elsewhere';logger[_0x4533('0x2f')](_0x4533('0x4a'),_0x41fb9b[_0x4533('0x21')],util['inspect'](this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31],{'showHidden':![],'depth':null}));ami['emit'](_0x4533('0x4b'),this[_0x4533('0x8')][_0x41fb9b[_0x4533('0x21')]][_0x296d31]);}}}}}}catch(_0x38da7b){logger[_0x4533('0x4c')]('[%s][voiceAgentReport][agentconnect]',_0x41fb9b[_0x4533('0x21')],util['inspect'](_0x38da7b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4533('0x10')]=function(_0x3474ea){try{if(this[_0x4533('0x1f')](_0x3474ea)){logger[_0x4533('0x2f')](_0x4533('0x4d'),_0x3474ea[_0x4533('0x21')],util[_0x4533('0x24')](_0x3474ea,{'showHidden':![],'depth':null}));if(this[_0x4533('0x8')][_0x3474ea[_0x4533('0x21')]]&&this[_0x4533('0x8')][_0x3474ea[_0x4533('0x21')]][_0x3474ea['destuniqueid']]){logger[_0x4533('0x20')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x3474ea[_0x4533('0x21')],_0x3474ea['membername'],_0x3474ea[_0x4533('0x23')]);this['channels'][_0x3474ea[_0x4533('0x21')]][_0x3474ea[_0x4533('0x23')]][_0x4533('0x45')]=!![];this[_0x4533('0x8')][_0x3474ea[_0x4533('0x21')]][_0x3474ea[_0x4533('0x23')]][_0x4533('0x4e')]=moment()[_0x4533('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3474ea[_0x4533('0x21')]][_0x3474ea[_0x4533('0x23')]]['lastevent']=_0x4533('0x4f');this[_0x4533('0x8')][_0x3474ea['uniqueid']][_0x3474ea['destuniqueid']]['reason']='rejected';logger[_0x4533('0x2f')](_0x4533('0x50'),_0x3474ea[_0x4533('0x21')],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x3474ea[_0x4533('0x21')]][_0x3474ea[_0x4533('0x23')]],{'showHidden':![],'depth':null}));ami[_0x4533('0x1b')]('custom:agentringnoanswer',this[_0x4533('0x8')][_0x3474ea[_0x4533('0x21')]][_0x3474ea[_0x4533('0x23')]]);}}}catch(_0x1c34f4){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x3474ea['uniqueid'],util[_0x4533('0x24')](_0x1c34f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4533('0x12')]=function(_0x2c8ef1){try{if(this[_0x4533('0x1f')](_0x2c8ef1)){logger['debug'](_0x4533('0x51'),_0x2c8ef1['uniqueid'],util[_0x4533('0x24')](_0x2c8ef1,{'showHidden':![],'depth':null}));if(this['channels'][_0x2c8ef1[_0x4533('0x21')]]){for(var _0x3fd36d in this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]]){if(this[_0x4533('0x8')][_0x2c8ef1['uniqueid']][_0x4533('0x36')](_0x3fd36d)&&!this['channels'][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d][_0x4533('0x45')]&&!this['channels'][_0x2c8ef1['uniqueid']][_0x3fd36d]['agentcomplete']){logger['info'](_0x4533('0x52'),_0x2c8ef1[_0x4533('0x21')],this['channels'][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d][_0x4533('0x22')],_0x3fd36d);this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d][_0x4533('0x45')]=!![];this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d][_0x4533('0x4e')]=moment()[_0x4533('0x25')](_0x4533('0x26'));this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d][_0x4533('0x3d')]=_0x4533('0x53');this[_0x4533('0x8')][_0x2c8ef1['uniqueid']][_0x3fd36d][_0x4533('0x49')]=_0x4533('0x53');logger[_0x4533('0x2f')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x2c8ef1[_0x4533('0x21')],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d],{'showHidden':![],'depth':null}));ami['emit'](_0x4533('0x54'),this[_0x4533('0x8')][_0x2c8ef1[_0x4533('0x21')]][_0x3fd36d]);}}}}}catch(_0x47a78e){logger['error'](_0x4533('0x55'),_0x2c8ef1[_0x4533('0x21')],util[_0x4533('0x24')](_0x47a78e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x56')]=function(_0x3424dd){try{if(this[_0x4533('0x1f')](_0x3424dd)){logger[_0x4533('0x2f')](_0x4533('0x57'),_0x3424dd['uniqueid'],util['inspect'](_0x3424dd,{'showHidden':![],'depth':null}));if(this['channels'][_0x3424dd[_0x4533('0x21')]]){for(var _0x1f2db3 in this[_0x4533('0x8')][_0x3424dd['uniqueid']]){if(this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x4533('0x36')](_0x1f2db3)){if(this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x38')]&&!this['channels'][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x13')]){logger[_0x4533('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3424dd[_0x4533('0x21')],this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3]['membername'],_0x1f2db3);this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3]['agentcomplete']=!![];this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x58')]=moment()['format'](_0x4533('0x26'));this['channels'][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x3d')]='complete';this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x49')]=_0x3424dd[_0x4533('0x49')]==_0x4533('0x59')?'agent':_0x3424dd[_0x4533('0x49')];this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x5a')]=_0x3424dd['talktime'];if(this[_0x4533('0x9')][_0x3424dd[_0x4533('0x29')]]&&this[_0x4533('0x9')][_0x3424dd[_0x4533('0x29')]][_0x4533('0x5b')]){this[_0x4533('0x8')][_0x3424dd['uniqueid']][_0x1f2db3][_0x4533('0x5c')]=this[_0x4533('0x9')][_0x3424dd[_0x4533('0x29')]][_0x4533('0x5d')];this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3][_0x4533('0x5e')]=!![];}this['agents'][_0x3424dd[_0x4533('0x41')]]=_[_0x4533('0x5f')](this[_0x4533('0xa')][_0x3424dd[_0x4533('0x41')]],['queue',_0x4533('0x60')]);logger[_0x4533('0x2f')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x3424dd['uniqueid'],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3],{'showHidden':![],'depth':null}));ami[_0x4533('0x1b')](_0x4533('0x61'),this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3]);logger[_0x4533('0x2f')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3424dd[_0x4533('0x21')],util[_0x4533('0x24')](this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3],{'showHidden':![],'depth':null}));this[_0x4533('0x1b')](util[_0x4533('0x25')](_0x4533('0x33'),_0x3424dd[_0x4533('0x22')]),_0x4533('0x62'),this[_0x4533('0x8')][_0x3424dd[_0x4533('0x21')]][_0x1f2db3]);}}}}}}catch(_0x35074e){logger['error']('[%s][voiceAgentReport][agentcomplete]',_0x3424dd[_0x4533('0x21')],util[_0x4533('0x24')](_0x35074e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x15')]=function(_0x4e90e4){try{if(this[_0x4533('0x1f')](_0x4e90e4)){logger[_0x4533('0x2f')](_0x4533('0x63'),_0x4e90e4[_0x4533('0x21')],util[_0x4533('0x24')](_0x4e90e4,{'showHidden':![],'depth':null}));this[_0x4533('0x64')](_0x4e90e4['uniqueid'],_[_0x4533('0x65')](_0x4e90e4['variable'])[0x0],_0x4e90e4[_0x4533('0x66')]);if(this['channels'][_0x4e90e4['uniqueid']]){for(var _0x2c17a3 in this[_0x4533('0x8')][_0x4e90e4['uniqueid']]){if(this['channels'][_0x4e90e4[_0x4533('0x21')]][_0x4533('0x36')](_0x2c17a3)){logger['info'](_0x4533('0x67'),_0x4e90e4['uniqueid'],_0x2c17a3,_[_0x4533('0x65')](_0x4e90e4[_0x4533('0x68')])[0x0],_0x4e90e4[_0x4533('0x66')]);if(_[_0x4533('0x1c')](this['channels'][_0x4e90e4[_0x4533('0x21')]][_0x2c17a3][_0x4533('0xb')])){this[_0x4533('0x8')][_0x4e90e4[_0x4533('0x21')]][_0x2c17a3]['variables']={};}this[_0x4533('0x8')][_0x4e90e4[_0x4533('0x21')]][_0x2c17a3][_0x4533('0xb')]=this['variables'][_0x4e90e4[_0x4533('0x21')]];}}}}}catch(_0x1fac04){logger['error']('[%s][voiceAgentReport][varset]',_0x4e90e4['uniqueid'],util[_0x4533('0x24')](_0x1fac04,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x64')]=function(_0x313563,_0x27ba1c,_0x4b9251){var _0x1e3a46=['rtpaudioqos',_0x4533('0x69'),_0x4533('0x6a'),_0x4533('0x6b'),_0x4533('0x6c'),_0x4533('0x6d'),_0x4533('0x6e'),_0x4533('0x6f'),_0x4533('0x70'),'sipuri',_0x4533('0x71'),_0x4533('0x72'),_0x4533('0x73'),_0x4533('0x74'),'memberinterface',_0x4533('0x75'),_0x4533('0x22'),_0x4533('0x76'),_0x4533('0x77')];if(!_[_0x4533('0x78')](_0x27ba1c)&&!_[_0x4533('0x79')](_0x1e3a46,_0x27ba1c)){if(_['isUndefined'](this[_0x4533('0xb')][_0x313563])){this[_0x4533('0xb')][_0x313563]={};}this[_0x4533('0xb')][_0x313563][_0x27ba1c]=_0x4b9251;}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x16')]=function(_0x4144d9){try{if(this[_0x4533('0x1f')](_0x4144d9)){logger[_0x4533('0x2f')](_0x4533('0x7a'),_0x4144d9[_0x4533('0x21')],util[_0x4533('0x24')](_0x4144d9,{'showHidden':![],'depth':null}));if(this['channels'][_0x4144d9[_0x4533('0x21')]]){for(var _0x50cf32 in this[_0x4533('0x8')][_0x4144d9[_0x4533('0x21')]]){if(this['channels'][_0x4144d9[_0x4533('0x21')]][_0x4533('0x36')](_0x50cf32)){if(this[_0x4533('0x8')][_0x4144d9[_0x4533('0x21')]][_0x50cf32][_0x4533('0x49')]==_0x4533('0x59')&&this[_0x4533('0x8')][_0x4144d9['uniqueid']][_0x50cf32][_0x4533('0x13')]){logger[_0x4533('0x20')](_0x4533('0x7b'),_0x4144d9['uniqueid'],_0x50cf32);this['channels'][_0x4144d9[_0x4533('0x21')]][_0x50cf32][_0x4533('0x58')]=moment()[_0x4533('0x25')](_0x4533('0x26'));}}}logger[_0x4533('0x2f')](_0x4533('0x7c'),_0x4144d9[_0x4533('0x21')],util[_0x4533('0x24')](_[_0x4533('0x7d')](this[_0x4533('0x8')][_0x4144d9[_0x4533('0x21')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_['values'](this[_0x4533('0x8')][_0x4144d9['uniqueid']]));delete this['channels'][_0x4144d9[_0x4533('0x21')]];}if(this['variables'][_0x4144d9['uniqueid']]){delete this[_0x4533('0xb')][_0x4144d9[_0x4533('0x21')]];}}}catch(_0x49bfcb){logger[_0x4533('0x4c')](_0x4533('0x7e'),_0x4144d9[_0x4533('0x21')],util['inspect'](_0x49bfcb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')][_0x4533('0x7f')]=function(_0x46d25f){try{if(this[_0x4533('0x1f')](_0x46d25f)){logger[_0x4533('0x2f')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x46d25f[_0x4533('0x21')],util[_0x4533('0x24')](_0x46d25f,{'showHidden':![],'depth':null}));if(this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]]){for(var _0x404d77 in this['channels'][_0x46d25f[_0x4533('0x80')]]){if(this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]][_0x4533('0x36')](_0x404d77)){if(_0x46d25f[_0x4533('0x81')]===_0x404d77){logger[_0x4533('0x20')](_0x4533('0x82'),_0x46d25f[_0x4533('0x21')],this['channels'][_0x46d25f[_0x4533('0x80')]][_0x404d77][_0x4533('0x22')],_0x404d77);var _0x17f8d8=moment();this['channels'][_0x46d25f['transfereeuniqueid']][_0x404d77][_0x4533('0x13')]=!![];this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]][_0x404d77][_0x4533('0x58')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]][_0x404d77][_0x4533('0x3d')]=_0x4533('0x83');this[_0x4533('0x8')][_0x46d25f['transfereeuniqueid']][_0x404d77][_0x4533('0x49')]=_0x4533('0x59');this[_0x4533('0x8')][_0x46d25f['transfereeuniqueid']][_0x404d77][_0x4533('0x5a')]=_0x17f8d8[_0x4533('0x84')](this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]][_0x404d77]['agentconnectAt'],_0x4533('0x85'));}}}}if(this[_0x4533('0x8')][_0x46d25f['secondtransfereruniqueid']]){var _0x1398e9=this[_0x4533('0x8')][_0x46d25f[_0x4533('0x86')]];this[_0x4533('0x8')][_0x46d25f['secondtransfereruniqueid']]=this[_0x4533('0x8')][_0x46d25f[_0x4533('0x80')]];this['channels'][_0x46d25f[_0x4533('0x80')]]=_0x1398e9;}}}catch(_0x48659d){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x46d25f[_0x4533('0x21')],util[_0x4533('0x24')](_0x48659d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4533('0x1a')]=function(_0x2f18ed){try{if(this[_0x4533('0x1f')](_0x2f18ed)){logger[_0x4533('0x2f')](_0x4533('0x87'),_0x2f18ed['uniqueid'],util[_0x4533('0x24')](_0x2f18ed,{'showHidden':![],'depth':null}));if(this[_0x4533('0x8')][_0x2f18ed['transfereeuniqueid']]){for(var _0x19458a in this[_0x4533('0x8')][_0x2f18ed['transfereeuniqueid']]){if(this[_0x4533('0x8')][_0x2f18ed[_0x4533('0x80')]]['hasOwnProperty'](_0x19458a)){if(_0x2f18ed[_0x4533('0x88')]===_0x19458a){logger[_0x4533('0x20')](_0x4533('0x89'),_0x2f18ed[_0x4533('0x21')],this['channels'][_0x2f18ed[_0x4533('0x80')]][_0x19458a]['membername'],_0x19458a);var _0x50c001=moment();this['channels'][_0x2f18ed[_0x4533('0x80')]][_0x19458a][_0x4533('0x13')]=!![];this['channels'][_0x2f18ed['transfereeuniqueid']][_0x19458a]['agentcompleteAt']=_0x50c001;this[_0x4533('0x8')][_0x2f18ed[_0x4533('0x80')]][_0x19458a][_0x4533('0x3d')]=_0x4533('0x83');this[_0x4533('0x8')][_0x2f18ed[_0x4533('0x80')]][_0x19458a][_0x4533('0x49')]=_0x4533('0x59');this[_0x4533('0x8')][_0x2f18ed[_0x4533('0x80')]][_0x19458a]['talktime']=_0x50c001[_0x4533('0x84')](this[_0x4533('0x8')][_0x2f18ed[_0x4533('0x80')]][_0x19458a][_0x4533('0x38')],'seconds');}}}}}}catch(_0x367a97){logger['error'](_0x4533('0x8a'),_0x2f18ed[_0x4533('0x21')],util[_0x4533('0x24')](_0x367a97,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4533('0x17')]=function(_0xe79f2b){var _0x3f405e='';try{if(this['isNotNull'](_0xe79f2b)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0xe79f2b[_0x4533('0x21')],util['inspect'](_0xe79f2b,{'showHidden':![],'depth':null}));if(_0xe79f2b['channel']){_0x3f405e=_0xe79f2b[_0x4533('0x8b')][_0x4533('0x8c')](0x0,_0xe79f2b['channel'][_0x4533('0x8d')]('-'));if(this[_0x4533('0xa')][_0x3f405e]){logger[_0x4533('0x20')](_0x4533('0x8e'),_0xe79f2b[_0x4533('0x21')],_0x3f405e);this[_0x4533('0xa')][_0x3f405e][_0x4533('0x8f')]=!![];}}}}catch(_0x384b9a){logger['error'](_0x4533('0x90'),_0xe79f2b[_0x4533('0x21')],util[_0x4533('0x24')](_0x384b9a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4533('0x1d')]['syncMusicOnHoldStop']=function(_0x33f23f){var _0x56f6d8='';try{if(this[_0x4533('0x1f')](_0x33f23f)){logger[_0x4533('0x2f')](_0x4533('0x91'),_0x33f23f[_0x4533('0x21')],util[_0x4533('0x24')](_0x33f23f,{'showHidden':![],'depth':null}));if(_0x33f23f['channel']){_0x56f6d8=_0x33f23f[_0x4533('0x8b')][_0x4533('0x8c')](0x0,_0x33f23f[_0x4533('0x8b')][_0x4533('0x8d')]('-'));if(this[_0x4533('0xa')][_0x56f6d8]){logger[_0x4533('0x20')](_0x4533('0x92'),_0x33f23f[_0x4533('0x21')],_0x56f6d8);this['agents'][_0x56f6d8]['onhold']=![];}}}}catch(_0x493114){logger['error'](_0x4533('0x93'),_0x33f23f['uniqueid'],util['inspect'](_0x493114,{'showHidden':![],'depth':null}));}};module[_0x4533('0x94')]=VoiceAgentReport; \ No newline at end of file +var _0xd053=['answeredelsewheremembername','lastevent','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','addVariable','keys','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','holdtime','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0xd053,0xe7));var _0x3d05=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xd053[_0x1a1b6e];return _0x571e2c;};'use strict';var _=require(_0x3d05('0x0'));var moment=require(_0x3d05('0x1'));var util=require('util');var Redis=require(_0x3d05('0x2'));var config=require(_0x3d05('0x3'));var logger=require(_0x3d05('0x4'))('ami');var ami=require('../ami');config[_0x3d05('0x5')]=_[_0x3d05('0x6')](config['redis'],{'host':_0x3d05('0x7'),'port':0x18eb});var io=require(_0x3d05('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x2bb04f){this[_0x3d05('0x9')]={};this[_0x3d05('0xa')]=_0x2bb04f[_0x3d05('0x9')];this[_0x3d05('0xb')]=_0x2bb04f[_0x3d05('0xb')];this[_0x3d05('0xc')]=_0x2bb04f[_0x3d05('0xc')];this[_0x3d05('0xd')]={};ami['on'](_0x3d05('0xe'),this[_0x3d05('0xf')]['bind'](this));ami['on'](_0x3d05('0x10'),this[_0x3d05('0x11')][_0x3d05('0x12')](this));ami['on'](_0x3d05('0x13'),this[_0x3d05('0x14')][_0x3d05('0x12')](this));ami['on'](_0x3d05('0x15'),this[_0x3d05('0x16')][_0x3d05('0x12')](this));ami['on']('agentcomplete',this[_0x3d05('0x17')][_0x3d05('0x12')](this));ami['on'](_0x3d05('0x18'),this[_0x3d05('0x19')]['bind'](this));ami['on'](_0x3d05('0x1a'),this['syncHangup']['bind'](this));ami['on'](_0x3d05('0x1b'),this['syncMusicOnHoldStart'][_0x3d05('0x12')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x3d05('0x12')](this));ami['on'](_0x3d05('0x1c'),this[_0x3d05('0x1d')][_0x3d05('0x12')](this));ami['on'](_0x3d05('0x1e'),this[_0x3d05('0x1f')][_0x3d05('0x12')](this));}VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x21')]=function(_0xcf3bac,_0x9ad24a,_0xe034){io['to'](_0xcf3bac)['emit'](_0x9ad24a,_0xe034);};VoiceAgentReport[_0x3d05('0x20')]['isNotNull']=function(_0x32071c){return _0x32071c!==null&&!_[_0x3d05('0x22')](_0x32071c);};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0xf')]=function(_0x241f0c){try{if(this[_0x3d05('0x23')](_0x241f0c)){logger[_0x3d05('0x24')](_0x3d05('0x25'),_0x241f0c[_0x3d05('0x26')],_0x241f0c[_0x3d05('0x27')],_0x241f0c[_0x3d05('0x28')]);logger['debug'](_0x3d05('0x29'),_0x241f0c[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x241f0c,{'showHidden':![],'depth':null}));if(_[_0x3d05('0x22')](this['channels'][_0x241f0c['uniqueid']])){this[_0x3d05('0x9')][_0x241f0c[_0x3d05('0x26')]]={};}if(_[_0x3d05('0x22')](this['channels'][_0x241f0c[_0x3d05('0x26')]][_0x241f0c[_0x3d05('0x28')]])){this[_0x3d05('0x9')][_0x241f0c[_0x3d05('0x26')]][_0x241f0c['destuniqueid']]={'agentcalledAt':moment()['format'](_0x3d05('0x2b')),'lastevent':_0x3d05('0x2c'),'mandatoryDisposition':this[_0x3d05('0xb')][_0x241f0c[_0x3d05('0x2d')]]?this['voiceQueues'][_0x241f0c[_0x3d05('0x2d')]][_0x3d05('0x2e')]||![]:![],'type':this[_0x3d05('0xb')][_0x241f0c['queue']]?this[_0x3d05('0xb')][_0x241f0c[_0x3d05('0x2d')]][_0x3d05('0x2f')]||_0x3d05('0x30'):'inbound','variables':this[_0x3d05('0xd')][_0x241f0c[_0x3d05('0x26')]],'motionChannel':_0x3d05('0x31')};}_[_0x3d05('0x32')](this[_0x3d05('0x9')][_0x241f0c[_0x3d05('0x26')]][_0x241f0c[_0x3d05('0x28')]],_[_0x3d05('0x33')](_0x241f0c,[_0x3d05('0x34'),_0x3d05('0x35')]));logger[_0x3d05('0x36')](_0x3d05('0x37'),_0x241f0c[_0x3d05('0x26')],util[_0x3d05('0x2a')](this['channels'][_0x241f0c[_0x3d05('0x26')]][_0x241f0c[_0x3d05('0x28')]],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')](_0x3d05('0x38'),this[_0x3d05('0x9')][_0x241f0c['uniqueid']][_0x241f0c[_0x3d05('0x28')]]);logger[_0x3d05('0x36')](_0x3d05('0x39'),_0x241f0c[_0x3d05('0x26')],util[_0x3d05('0x2a')](this['channels'][_0x241f0c[_0x3d05('0x26')]][_0x241f0c[_0x3d05('0x28')]],{'showHidden':![],'depth':null}));this[_0x3d05('0x21')](util[_0x3d05('0x3a')](_0x3d05('0x3b'),_0x241f0c[_0x3d05('0x27')]),_0x3d05('0x3c'),this['channels'][_0x241f0c['uniqueid']][_0x241f0c['destuniqueid']]);}}catch(_0x4841b7){logger[_0x3d05('0x3d')](_0x3d05('0x3e'),_0x241f0c['uniqueid'],util[_0x3d05('0x2a')](_0x4841b7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x11')]=function(_0x379ee9){try{if(this['isNotNull'](_0x379ee9)){if(this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]]){logger['debug']('[%s][voiceAgentReport][agentconnect]\x20event:',_0x379ee9['uniqueid'],util['inspect'](_0x379ee9,{'showHidden':![],'depth':null}));for(var _0x1e9b51 in this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]]){if(this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x3d05('0x3f')](_0x1e9b51)){if(_0x379ee9[_0x3d05('0x28')]===_0x1e9b51){logger[_0x3d05('0x24')](_0x3d05('0x40'),_0x379ee9[_0x3d05('0x26')],_0x379ee9['membername'],_0x379ee9[_0x3d05('0x28')]);this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['agentconnectAt']=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this['channels'][_0x379ee9['uniqueid']][_0x1e9b51][_0x3d05('0x41')]=_0x379ee9[_0x3d05('0x41')];this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x42')]=_0x379ee9[_0x3d05('0x42')];this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['destchannelstate']=_0x379ee9['destchannelstate'];this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['destchannelstatedesc']=_0x379ee9['destchannelstatedesc'];this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x43')]=_0x379ee9[_0x3d05('0x43')];this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['lastevent']=_0x3d05('0x44');if(this['voiceChannels'][this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x26')]]){var _0x4b0df2=this[_0x3d05('0xa')][this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['uniqueid']]['routealias'];this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x45')]=_0x4b0df2;_0x379ee9[_0x3d05('0x45')]=_0x4b0df2;}_[_0x3d05('0x32')](this['agents'][_0x379ee9[_0x3d05('0x46')]],_[_0x3d05('0x47')](_0x379ee9,[_0x3d05('0x2d'),_0x3d05('0x48'),_0x3d05('0x45')]));logger['debug'](_0x3d05('0x49'),_0x379ee9[_0x3d05('0x26')],util[_0x3d05('0x2a')](this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x379ee9[_0x3d05('0x28')]],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')]('custom:agentconnect',this[_0x3d05('0x9')][_0x379ee9['uniqueid']][_0x379ee9[_0x3d05('0x28')]]);logger[_0x3d05('0x36')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x379ee9[_0x3d05('0x26')],util[_0x3d05('0x2a')](this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x379ee9[_0x3d05('0x28')]],{'showHidden':![],'depth':null}));this[_0x3d05('0x21')](util[_0x3d05('0x3a')](_0x3d05('0x3b'),_0x379ee9[_0x3d05('0x27')]),'user:agentconnect',this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x379ee9[_0x3d05('0x28')]]);}else if(!this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x13')]&&!this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x4a')]){logger[_0x3d05('0x24')](_0x3d05('0x4b'),_0x379ee9[_0x3d05('0x26')],this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x27')],_0x1e9b51);this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x13')]=!![];this['channels'][_0x379ee9['uniqueid']][_0x1e9b51][_0x3d05('0x4c')]=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51]['answeredelsewheredestinationuniqueid']=_0x379ee9[_0x3d05('0x28')];this['channels'][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x4d')]=_0x379ee9[_0x3d05('0x27')];this['channels'][_0x379ee9['uniqueid']][_0x1e9b51][_0x3d05('0x4e')]='answered_elsewhere';this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51][_0x3d05('0x4f')]='answered_elsewhere';logger[_0x3d05('0x36')](_0x3d05('0x50'),_0x379ee9[_0x3d05('0x26')],util[_0x3d05('0x2a')](this[_0x3d05('0x9')][_0x379ee9[_0x3d05('0x26')]][_0x1e9b51],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')](_0x3d05('0x51'),this[_0x3d05('0x9')][_0x379ee9['uniqueid']][_0x1e9b51]);}}}}}}catch(_0x5f5cdc){logger['error'](_0x3d05('0x52'),_0x379ee9[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x5f5cdc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x14')]=function(_0x1adcaf){try{if(this[_0x3d05('0x23')](_0x1adcaf)){logger['debug'](_0x3d05('0x53'),_0x1adcaf['uniqueid'],util[_0x3d05('0x2a')](_0x1adcaf,{'showHidden':![],'depth':null}));if(this['channels'][_0x1adcaf[_0x3d05('0x26')]]&&this[_0x3d05('0x9')][_0x1adcaf[_0x3d05('0x26')]][_0x1adcaf['destuniqueid']]){logger[_0x3d05('0x24')](_0x3d05('0x54'),_0x1adcaf[_0x3d05('0x26')],_0x1adcaf[_0x3d05('0x27')],_0x1adcaf[_0x3d05('0x28')]);this['channels'][_0x1adcaf['uniqueid']][_0x1adcaf[_0x3d05('0x28')]]['agentringnoanswer']=!![];this[_0x3d05('0x9')][_0x1adcaf['uniqueid']][_0x1adcaf['destuniqueid']][_0x3d05('0x4c')]=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this['channels'][_0x1adcaf[_0x3d05('0x26')]][_0x1adcaf['destuniqueid']][_0x3d05('0x4e')]=_0x3d05('0x55');this[_0x3d05('0x9')][_0x1adcaf['uniqueid']][_0x1adcaf['destuniqueid']]['reason']=_0x3d05('0x55');logger['debug'](_0x3d05('0x56'),_0x1adcaf[_0x3d05('0x26')],util[_0x3d05('0x2a')](this['channels'][_0x1adcaf['uniqueid']][_0x1adcaf['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')]('custom:agentringnoanswer',this[_0x3d05('0x9')][_0x1adcaf[_0x3d05('0x26')]][_0x1adcaf[_0x3d05('0x28')]]);}}}catch(_0x38f67b){logger[_0x3d05('0x3d')](_0x3d05('0x57'),_0x1adcaf[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x38f67b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3d05('0x16')]=function(_0x55143e){try{if(this[_0x3d05('0x23')](_0x55143e)){logger[_0x3d05('0x36')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x55143e[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x55143e,{'showHidden':![],'depth':null}));if(this[_0x3d05('0x9')][_0x55143e[_0x3d05('0x26')]]){for(var _0x2f015 in this['channels'][_0x55143e[_0x3d05('0x26')]]){if(this[_0x3d05('0x9')][_0x55143e['uniqueid']][_0x3d05('0x3f')](_0x2f015)&&!this['channels'][_0x55143e['uniqueid']][_0x2f015][_0x3d05('0x13')]&&!this[_0x3d05('0x9')][_0x55143e[_0x3d05('0x26')]][_0x2f015]['agentcomplete']){logger[_0x3d05('0x24')](_0x3d05('0x58'),_0x55143e[_0x3d05('0x26')],this['channels'][_0x55143e[_0x3d05('0x26')]][_0x2f015][_0x3d05('0x27')],_0x2f015);this[_0x3d05('0x9')][_0x55143e['uniqueid']][_0x2f015][_0x3d05('0x13')]=!![];this[_0x3d05('0x9')][_0x55143e[_0x3d05('0x26')]][_0x2f015]['agentringnoanswerAt']=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this[_0x3d05('0x9')][_0x55143e[_0x3d05('0x26')]][_0x2f015][_0x3d05('0x4e')]=_0x3d05('0x59');this[_0x3d05('0x9')][_0x55143e[_0x3d05('0x26')]][_0x2f015]['reason']=_0x3d05('0x59');logger[_0x3d05('0x36')](_0x3d05('0x5a'),_0x55143e[_0x3d05('0x26')],util[_0x3d05('0x2a')](this['channels'][_0x55143e['uniqueid']][_0x2f015],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')](_0x3d05('0x5b'),this['channels'][_0x55143e['uniqueid']][_0x2f015]);}}}}}catch(_0x4fd551){logger[_0x3d05('0x3d')](_0x3d05('0x5c'),_0x55143e[_0x3d05('0x26')],util['inspect'](_0x4fd551,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3d05('0x17')]=function(_0xe32b1){try{if(this[_0x3d05('0x23')](_0xe32b1)){logger[_0x3d05('0x36')](_0x3d05('0x5d'),_0xe32b1[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0xe32b1,{'showHidden':![],'depth':null}));if(this['channels'][_0xe32b1[_0x3d05('0x26')]]){for(var _0x393db9 in this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]]){if(this[_0x3d05('0x9')][_0xe32b1['uniqueid']][_0x3d05('0x3f')](_0x393db9)){if(this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9][_0x3d05('0x5e')]&&!this['channels'][_0xe32b1['uniqueid']][_0x393db9][_0x3d05('0x4a')]){logger['info'](_0x3d05('0x5f'),_0xe32b1[_0x3d05('0x26')],this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9][_0x3d05('0x27')],_0x393db9);this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9]['agentcomplete']=!![];this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9][_0x3d05('0x60')]=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this[_0x3d05('0x9')][_0xe32b1['uniqueid']][_0x393db9][_0x3d05('0x4e')]=_0x3d05('0x61');this['channels'][_0xe32b1[_0x3d05('0x26')]][_0x393db9][_0x3d05('0x4f')]=_0xe32b1[_0x3d05('0x4f')]==_0x3d05('0x62')?_0x3d05('0x63'):_0xe32b1[_0x3d05('0x4f')];this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9]['talktime']=_0xe32b1[_0x3d05('0x64')];if(this[_0x3d05('0xb')][_0xe32b1[_0x3d05('0x2d')]]&&this['voiceQueues'][_0xe32b1[_0x3d05('0x2d')]][_0x3d05('0x65')]){this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9][_0x3d05('0x66')]=this['voiceQueues'][_0xe32b1[_0x3d05('0x2d')]][_0x3d05('0x67')];this['channels'][_0xe32b1['uniqueid']][_0x393db9][_0x3d05('0x68')]=!![];}this[_0x3d05('0xc')][_0xe32b1[_0x3d05('0x46')]]=_[_0x3d05('0x33')](this[_0x3d05('0xc')][_0xe32b1[_0x3d05('0x46')]],[_0x3d05('0x2d'),_0x3d05('0x48')]);logger['debug'](_0x3d05('0x69'),_0xe32b1[_0x3d05('0x26')],util[_0x3d05('0x2a')](this[_0x3d05('0x9')][_0xe32b1['uniqueid']][_0x393db9],{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')](_0x3d05('0x6a'),this['channels'][_0xe32b1[_0x3d05('0x26')]][_0x393db9]);logger[_0x3d05('0x36')](_0x3d05('0x6b'),_0xe32b1[_0x3d05('0x26')],util[_0x3d05('0x2a')](this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9],{'showHidden':![],'depth':null}));this['emit'](util[_0x3d05('0x3a')]('user:%s',_0xe32b1[_0x3d05('0x27')]),_0x3d05('0x6c'),this[_0x3d05('0x9')][_0xe32b1[_0x3d05('0x26')]][_0x393db9]);}}}}}}catch(_0x1d7a32){logger[_0x3d05('0x3d')]('[%s][voiceAgentReport][agentcomplete]',_0xe32b1[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x1d7a32,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3d05('0x19')]=function(_0xcc6bb1){try{if(this['isNotNull'](_0xcc6bb1)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0xcc6bb1[_0x3d05('0x26')],util['inspect'](_0xcc6bb1,{'showHidden':![],'depth':null}));this[_0x3d05('0x6d')](_0xcc6bb1['uniqueid'],_[_0x3d05('0x6e')](_0xcc6bb1['variable'])[0x0],_0xcc6bb1['value']);if(this[_0x3d05('0x9')][_0xcc6bb1[_0x3d05('0x26')]]){for(var _0x4ddfc7 in this[_0x3d05('0x9')][_0xcc6bb1[_0x3d05('0x26')]]){if(this['channels'][_0xcc6bb1[_0x3d05('0x26')]]['hasOwnProperty'](_0x4ddfc7)){logger[_0x3d05('0x24')](_0x3d05('0x6f'),_0xcc6bb1[_0x3d05('0x26')],_0x4ddfc7,_[_0x3d05('0x6e')](_0xcc6bb1['variable'])[0x0],_0xcc6bb1[_0x3d05('0x70')]);if(_[_0x3d05('0x22')](this[_0x3d05('0x9')][_0xcc6bb1[_0x3d05('0x26')]][_0x4ddfc7][_0x3d05('0xd')])){this[_0x3d05('0x9')][_0xcc6bb1[_0x3d05('0x26')]][_0x4ddfc7][_0x3d05('0xd')]={};}this[_0x3d05('0x9')][_0xcc6bb1[_0x3d05('0x26')]][_0x4ddfc7]['variables']=this['variables'][_0xcc6bb1[_0x3d05('0x26')]];}}}}}catch(_0x46322a){logger[_0x3d05('0x3d')](_0x3d05('0x71'),_0xcc6bb1[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x46322a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3d05('0x6d')]=function(_0x3b0243,_0x583a29,_0x2c45e3){var _0x26aa10=['rtpaudioqos',_0x3d05('0x72'),_0x3d05('0x73'),'rtpaudioqosjitterbridged',_0x3d05('0x74'),_0x3d05('0x75'),_0x3d05('0x76'),'rtpaudioqosrttbridged',_0x3d05('0x77'),_0x3d05('0x78'),_0x3d05('0x79'),'bridgepvtcallid','membercalls',_0x3d05('0x7a'),_0x3d05('0x7b'),_0x3d05('0x7c'),_0x3d05('0x27'),_0x3d05('0x7d'),'memberrealtime'];if(!_[_0x3d05('0x7e')](_0x583a29)&&!_[_0x3d05('0x7f')](_0x26aa10,_0x583a29)){if(_[_0x3d05('0x22')](this[_0x3d05('0xd')][_0x3b0243])){this[_0x3d05('0xd')][_0x3b0243]={};}this[_0x3d05('0xd')][_0x3b0243][_0x583a29]=_0x2c45e3;}};VoiceAgentReport['prototype'][_0x3d05('0x80')]=function(_0x40fcd3){try{if(this[_0x3d05('0x23')](_0x40fcd3)){logger[_0x3d05('0x36')](_0x3d05('0x81'),_0x40fcd3['uniqueid'],util[_0x3d05('0x2a')](_0x40fcd3,{'showHidden':![],'depth':null}));if(this[_0x3d05('0x9')][_0x40fcd3[_0x3d05('0x26')]]){for(var _0x49558c in this['channels'][_0x40fcd3[_0x3d05('0x26')]]){if(this[_0x3d05('0x9')][_0x40fcd3['uniqueid']][_0x3d05('0x3f')](_0x49558c)){if(this[_0x3d05('0x9')][_0x40fcd3['uniqueid']][_0x49558c][_0x3d05('0x4f')]==_0x3d05('0x62')&&this[_0x3d05('0x9')][_0x40fcd3['uniqueid']][_0x49558c][_0x3d05('0x4a')]){logger[_0x3d05('0x24')](_0x3d05('0x82'),_0x40fcd3[_0x3d05('0x26')],_0x49558c);this[_0x3d05('0x9')][_0x40fcd3[_0x3d05('0x26')]][_0x49558c][_0x3d05('0x60')]=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));}}}logger[_0x3d05('0x36')](_0x3d05('0x83'),_0x40fcd3[_0x3d05('0x26')],util[_0x3d05('0x2a')](_[_0x3d05('0x84')](this[_0x3d05('0x9')][_0x40fcd3['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x3d05('0x21')]('custom:voiceAgentReport',_[_0x3d05('0x84')](this[_0x3d05('0x9')][_0x40fcd3[_0x3d05('0x26')]]));delete this[_0x3d05('0x9')][_0x40fcd3[_0x3d05('0x26')]];}if(this['variables'][_0x40fcd3['uniqueid']]){delete this[_0x3d05('0xd')][_0x40fcd3[_0x3d05('0x26')]];}}}catch(_0xc8766b){logger['error']('[%s][voiceAgentReport][hangup]',_0x40fcd3[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0xc8766b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x1d')]=function(_0x20918f){try{if(this[_0x3d05('0x23')](_0x20918f)){logger[_0x3d05('0x36')](_0x3d05('0x85'),_0x20918f[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x20918f,{'showHidden':![],'depth':null}));if(this[_0x3d05('0x9')][_0x20918f['transfereeuniqueid']]){for(var _0x1e6683 in this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]]){if(this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]]['hasOwnProperty'](_0x1e6683)){if(_0x20918f[_0x3d05('0x87')]===_0x1e6683){logger['info']('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x20918f[_0x3d05('0x26')],this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]][_0x1e6683][_0x3d05('0x27')],_0x1e6683);var _0x3f83d5=moment();this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]][_0x1e6683][_0x3d05('0x4a')]=!![];this[_0x3d05('0x9')][_0x20918f['transfereeuniqueid']][_0x1e6683]['agentcompleteAt']=moment()[_0x3d05('0x3a')](_0x3d05('0x2b'));this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]][_0x1e6683][_0x3d05('0x4e')]=_0x3d05('0x61');this['channels'][_0x20918f[_0x3d05('0x86')]][_0x1e6683][_0x3d05('0x4f')]=_0x3d05('0x62');this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]][_0x1e6683]['talktime']=_0x3f83d5[_0x3d05('0x88')](this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]][_0x1e6683][_0x3d05('0x5e')],_0x3d05('0x89'));}}}}if(this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x8a')]]){var _0x42d868=this[_0x3d05('0x9')][_0x20918f['secondtransfereruniqueid']];this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x8a')]]=this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]];this[_0x3d05('0x9')][_0x20918f[_0x3d05('0x86')]]=_0x42d868;}}}catch(_0x30d45d){logger['error'](_0x3d05('0x8b'),_0x20918f[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x30d45d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')]['syncBlindTransfer']=function(_0x139c12){try{if(this['isNotNull'](_0x139c12)){logger[_0x3d05('0x36')](_0x3d05('0x8c'),_0x139c12[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x139c12,{'showHidden':![],'depth':null}));if(this[_0x3d05('0x9')][_0x139c12[_0x3d05('0x86')]]){for(var _0x5f3aa7 in this['channels'][_0x139c12[_0x3d05('0x86')]]){if(this[_0x3d05('0x9')][_0x139c12['transfereeuniqueid']][_0x3d05('0x3f')](_0x5f3aa7)){if(_0x139c12[_0x3d05('0x8d')]===_0x5f3aa7){logger[_0x3d05('0x24')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x139c12[_0x3d05('0x26')],this[_0x3d05('0x9')][_0x139c12[_0x3d05('0x86')]][_0x5f3aa7][_0x3d05('0x27')],_0x5f3aa7);var _0x3078d8=moment();this[_0x3d05('0x9')][_0x139c12[_0x3d05('0x86')]][_0x5f3aa7][_0x3d05('0x4a')]=!![];this[_0x3d05('0x9')][_0x139c12['transfereeuniqueid']][_0x5f3aa7]['agentcompleteAt']=_0x3078d8;this[_0x3d05('0x9')][_0x139c12['transfereeuniqueid']][_0x5f3aa7][_0x3d05('0x4e')]='complete';this['channels'][_0x139c12[_0x3d05('0x86')]][_0x5f3aa7][_0x3d05('0x4f')]=_0x3d05('0x62');this[_0x3d05('0x9')][_0x139c12[_0x3d05('0x86')]][_0x5f3aa7][_0x3d05('0x64')]=_0x3078d8['diff'](this[_0x3d05('0x9')][_0x139c12[_0x3d05('0x86')]][_0x5f3aa7]['agentconnectAt'],'seconds');}}}}}}catch(_0xf8cc3e){logger['error'](_0x3d05('0x8e'),_0x139c12[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0xf8cc3e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x8f')]=function(_0x14de4f){var _0x5281f3='';try{if(this['isNotNull'](_0x14de4f)){logger[_0x3d05('0x36')](_0x3d05('0x90'),_0x14de4f[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x14de4f,{'showHidden':![],'depth':null}));if(_0x14de4f[_0x3d05('0x91')]){_0x5281f3=_0x14de4f[_0x3d05('0x91')]['substring'](0x0,_0x14de4f[_0x3d05('0x91')][_0x3d05('0x92')]('-'));if(this['agents'][_0x5281f3]){logger[_0x3d05('0x24')](_0x3d05('0x93'),_0x14de4f[_0x3d05('0x26')],_0x5281f3);this['agents'][_0x5281f3][_0x3d05('0x94')]=!![];}}}}catch(_0x2d1847){logger['error'](_0x3d05('0x95'),_0x14de4f[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x2d1847,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d05('0x20')][_0x3d05('0x96')]=function(_0x258106){var _0x23daad='';try{if(this[_0x3d05('0x23')](_0x258106)){logger['debug'](_0x3d05('0x97'),_0x258106[_0x3d05('0x26')],util['inspect'](_0x258106,{'showHidden':![],'depth':null}));if(_0x258106[_0x3d05('0x91')]){_0x23daad=_0x258106['channel'][_0x3d05('0x98')](0x0,_0x258106['channel']['lastIndexOf']('-'));if(this[_0x3d05('0xc')][_0x23daad]){logger['info'](_0x3d05('0x99'),_0x258106[_0x3d05('0x26')],_0x23daad);this['agents'][_0x23daad]['onhold']=![];}}}}catch(_0x4b7cd2){logger[_0x3d05('0x3d')]('[%s][voiceAgentReport][musiconholdstop]',_0x258106[_0x3d05('0x26')],util[_0x3d05('0x2a')](_0x4b7cd2,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index b29673c..ec3812c 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 _0x3013=['transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../rpc/setting','not_inuse','inuse','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','blindtransfer','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','keys','context','from-sip','channel','split','exten','format','name','[%s][voiceCallReport][newcallerid]','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','destconnectedlinenum','accountcode','user:%s','user:agentconnect','error','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','duration','subtract','lastapplication','lastdata','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','variable','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','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','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','seconds','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','BlindTransfer'];(function(_0x5727dd,_0x9e3e79){var _0x130fc9=function(_0xaf7f1e){while(--_0xaf7f1e){_0x5727dd['push'](_0x5727dd['shift']());}};_0x130fc9(++_0x9e3e79);}(_0x3013,0x19f));var _0x3301=function(_0x27cdb7,_0x5b43b7){_0x27cdb7=_0x27cdb7-0x0;var _0x1095cb=_0x3013[_0x27cdb7];return _0x1095cb;};'use strict';var BPromise=require(_0x3301('0x0'));var _=require(_0x3301('0x1'));var moment=require(_0x3301('0x2'));var util=require('util');var path=require(_0x3301('0x3'));var Redis=require('ioredis');var config=require(_0x3301('0x4'));var logger=require(_0x3301('0x5'))(_0x3301('0x6'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0x3301('0x7'));var statusDesc=['unknown',_0x3301('0x8'),_0x3301('0x9'),'busy','invalid',_0x3301('0xa'),_0x3301('0xb'),_0x3301('0xc'),_0x3301('0xd')];var applications=[_0x3301('0xe'),_0x3301('0xf'),_0x3301('0x10'),_0x3301('0x11'),_0x3301('0x12'),_0x3301('0x13')];var dispositions=[_0x3301('0x14'),'FAILED',_0x3301('0x15'),_0x3301('0x14'),_0x3301('0x14'),'NO\x20ANSWER',_0x3301('0x16'),_0x3301('0x17'),_0x3301('0x15'),_0x3301('0x15'),_0x3301('0x15')];var actions={};config[_0x3301('0x18')]=_[_0x3301('0x19')](config[_0x3301('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0x3301('0x1a'))(new Redis(config[_0x3301('0x18')]));function VoiceCallReport(_0x21a62b){this[_0x3301('0x1b')]=_0x21a62b[_0x3301('0x1b')];this[_0x3301('0x1c')]=_0x21a62b[_0x3301('0x1c')];this[_0x3301('0x1d')]={};ami['on'](_0x3301('0x1e'),this['syncNewExten'][_0x3301('0x1f')](this));ami['on']('newexten',this['syncNewExten'][_0x3301('0x1f')](this));ami['on'](_0x3301('0x20'),this[_0x3301('0x21')][_0x3301('0x1f')](this));ami['on'](_0x3301('0x22'),this[_0x3301('0x23')][_0x3301('0x1f')](this));ami['on']('varset',this[_0x3301('0x24')][_0x3301('0x1f')](this));ami['on'](_0x3301('0x25'),this[_0x3301('0x26')][_0x3301('0x1f')](this));ami['on'](_0x3301('0x27'),this[_0x3301('0x28')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x3301('0x29'),this['syncBlindTransfer'][_0x3301('0x1f')](this));ami['on']('musiconholdstart',this[_0x3301('0x2a')][_0x3301('0x1f')](this));ami['on'](_0x3301('0x2b'),this['syncMusicOnHoldStop']['bind'](this));try{logger['info'](_0x3301('0x2c'));ami['actionCoreShowChannels']();}catch(_0x1b1739){logger['error'](_0x3301('0x2d'),util[_0x3301('0x2e')](_0x1b1739,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3301('0x2f')][_0x3301('0x30')]=function(_0x1a4a73){return _0x1a4a73!==null&&!_[_0x3301('0x31')](_0x1a4a73);};VoiceCallReport[_0x3301('0x2f')][_0x3301('0x32')]=function(_0x46e514,_0x1ff89b,_0xa61180){io['to'](_0x46e514)['emit'](_0x1ff89b,_0xa61180);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x3daa27){try{if(this['isNotNull'](_0x3daa27)){logger[_0x3301('0x33')](_0x3301('0x34'),_0x3daa27[_0x3301('0x35')],_0x3daa27[_0x3301('0x36')],_0x3daa27[_0x3301('0x37')]);logger[_0x3301('0x38')](_0x3301('0x39'),_0x3daa27[_0x3301('0x35')],util['inspect'](_0x3daa27,{'showHidden':![],'depth':null}));if(_0x3daa27['uniqueid']===_0x3daa27['linkedid']){if(!_['isUndefined'](this[_0x3301('0x1b')][_0x3daa27[_0x3301('0x35')]])){_[_0x3301('0x3a')](this[_0x3301('0x1b')][_0x3daa27[_0x3301('0x35')]],_[_0x3301('0x3b')](_0x3daa27,_[_0x3301('0x3c')](this[_0x3301('0x1b')][_0x3daa27['uniqueid']])));}}if(_0x3daa27[_0x3301('0x3d')]===_0x3301('0x3e')){if(this[_0x3301('0x1c')][_0x3daa27[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]){if(_0x3daa27[_0x3301('0x41')]=='xcally-motion-preview'){this[_0x3301('0x1c')][_0x3daa27['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x3daa27['connectedlinenum'];this[_0x3301('0x32')](util[_0x3301('0x42')]('user:%s',this[_0x3301('0x1c')][_0x3daa27[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x43')]),'user:agentconnect',{'destaccountcode':this[_0x3301('0x1c')][_0x3daa27[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3daa27['connectedlinenum']});}}}}}catch(_0x4e434a){logger['error'](_0x3301('0x44'),_0x3daa27['uniqueid'],util[_0x3301('0x2e')](_0x4e434a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0x21')]=function(_0x3d5ac8){try{if(this[_0x3301('0x30')](_0x3d5ac8)){logger[_0x3301('0x38')]('[%s][voiceCallReport][newchannel]\x20event:',_0x3d5ac8[_0x3301('0x35')],util[_0x3301('0x2e')](_0x3d5ac8,{'showHidden':![],'depth':null}));if(_0x3d5ac8[_0x3301('0x35')]===_0x3d5ac8[_0x3301('0x45')]&&_0x3d5ac8['channel']!=_0x3301('0x46')){if(_['isUndefined'](this['channels'][_0x3d5ac8[_0x3301('0x35')]])){logger[_0x3301('0x33')](_0x3301('0x47'),_0x3d5ac8[_0x3301('0x35')],_0x3d5ac8[_0x3301('0x3d')],_0x3d5ac8[_0x3301('0x41')]);this[_0x3301('0x1b')][_0x3d5ac8[_0x3301('0x35')]]=new Channel();this[_0x3301('0x1b')][_0x3d5ac8[_0x3301('0x35')]][_0x3301('0x48')]=moment()[_0x3301('0x42')](_0x3301('0x49'));this[_0x3301('0x1b')][_0x3d5ac8[_0x3301('0x35')]][_0x3301('0x4a')]=dispositions[_[_0x3301('0x4b')](_0x3d5ac8[_0x3301('0x4c')])];_[_0x3301('0x3a')](this[_0x3301('0x1b')][_0x3d5ac8['uniqueid']],_[_0x3301('0x3b')](_0x3d5ac8,_[_0x3301('0x3c')](this['channels'][_0x3d5ac8[_0x3301('0x35')]])));if(_0x3d5ac8[_0x3301('0x3d')]===_0x3301('0x3e')){if(this[_0x3301('0x1c')][_0x3d5ac8[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]){if(_[_0x3301('0x31')](this['agents'][_0x3d5ac8[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4d')])){this[_0x3301('0x1c')][_0x3d5ac8[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4d')]=_0x3d5ac8[_0x3301('0x41')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3d5ac8[_0x3301('0x35')],util[_0x3301('0x2e')]({'destaccountcode':this[_0x3301('0x1c')][_0x3d5ac8[_0x3301('0x3f')]['split']('-')[0x0]][_0x3301('0x4e')],'destconnectedlinenum':_0x3d5ac8[_0x3301('0x41')]},{'showHidden':![],'depth':null}));this[_0x3301('0x32')](util[_0x3301('0x42')](_0x3301('0x4f'),this[_0x3301('0x1c')][_0x3d5ac8['channel'][_0x3301('0x40')]('-')[0x0]][_0x3301('0x43')]),_0x3301('0x50'),{'destaccountcode':this[_0x3301('0x1c')][_0x3d5ac8['channel'][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4e')],'destconnectedlinenum':_0x3d5ac8[_0x3301('0x41')]});}}}}}}}catch(_0x1917a0){logger[_0x3301('0x51')](_0x3301('0x52'),_0x3d5ac8[_0x3301('0x35')],util[_0x3301('0x2e')](_0x1917a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')]['syncNewExten']=function(_0xfa8333){try{if(this[_0x3301('0x30')](_0xfa8333)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0xfa8333['uniqueid'],util['inspect'](_0xfa8333,{'showHidden':![],'depth':null}));if(_0xfa8333[_0x3301('0x35')]===_0xfa8333[_0x3301('0x45')]&&_0xfa8333[_0x3301('0x41')]!='h'&&_0xfa8333[_0x3301('0x3f')]!=_0x3301('0x46')){_0xfa8333[_0x3301('0x53')]=_0xfa8333[_0x3301('0x53')][_0x3301('0x54')]();_0xfa8333[_0x3301('0x55')]=_0xfa8333['appdata']&&_0xfa8333['appdata'][_0x3301('0x56')](_0x3301('0x57'))?_0xfa8333[_0x3301('0x58')]:(_0xfa8333[_0x3301('0x58')]||_0xfa8333['applicationdata'])[_0x3301('0x54')]();logger[_0x3301('0x33')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0xfa8333['uniqueid'],_0xfa8333[_0x3301('0x53')],_0xfa8333[_0x3301('0x55')]);if(_[_0x3301('0x31')](this[_0x3301('0x1b')][_0xfa8333[_0x3301('0x35')]])){this['channels'][_0xfa8333['uniqueid']]=new Channel();this[_0x3301('0x1b')][_0xfa8333[_0x3301('0x35')]][_0x3301('0x48')]=_0xfa8333[_0x3301('0x59')]?moment()[_0x3301('0x5a')](moment[_0x3301('0x59')](_0xfa8333['duration'])['seconds'](),'seconds')[_0x3301('0x42')](_0x3301('0x49')):moment()['format'](_0x3301('0x49'));this[_0x3301('0x1b')][_0xfa8333[_0x3301('0x35')]][_0x3301('0x4a')]=_0x3301('0x14');}_['merge'](this['channels'][_0xfa8333[_0x3301('0x35')]],_['pick'](_0xfa8333,_[_0x3301('0x3c')](this[_0x3301('0x1b')][_0xfa8333['uniqueid']])));if(_['includes'](applications,_0xfa8333[_0x3301('0x53')])){this[_0x3301('0x1b')][_0xfa8333['uniqueid']][_0x3301('0x5b')]=_0xfa8333[_0x3301('0x53')];this[_0x3301('0x1b')][_0xfa8333[_0x3301('0x35')]][_0x3301('0x5c')]=_0xfa8333[_0x3301('0x55')];if(_0xfa8333[_0x3301('0x53')]===_0x3301('0xe')&&_[_0x3301('0x56')](_0xfa8333[_0x3301('0x55')][_0x3301('0x54')](),'cdr(')){var _0x1bab97=_0xfa8333[_0x3301('0x55')]['split']('=');var _0x53013c=_0x1bab97[0x0]['toLowerCase']()[_0x3301('0x5d')](/cdr\((.*)\)/);if(_0x53013c){this['channels'][_0xfa8333[_0x3301('0x35')]][_0x53013c[0x1]]=_0x1bab97[0x1];}}else if(_0xfa8333[_0x3301('0x53')]===_0x3301('0xf')){this['channels'][_0xfa8333[_0x3301('0x35')]]['queue']=_0xfa8333[_0x3301('0x55')][_0x3301('0x40')](',')[0x0];}}}}}catch(_0x1a2134){logger['error'](_0x3301('0x5e'),_0xfa8333[_0x3301('0x35')],util['inspect'](_0x1a2134,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0x23')]=function(_0x3acc5b){try{if(this[_0x3301('0x30')](_0x3acc5b)){logger[_0x3301('0x33')](_0x3301('0x5f'),_0x3acc5b[_0x3301('0x35')],_0x3acc5b[_0x3301('0x45')],_0x3acc5b['calleridname'],_0x3acc5b[_0x3301('0x37')]);logger[_0x3301('0x38')](_0x3301('0x60'),_0x3acc5b[_0x3301('0x35')],util['inspect'](_0x3acc5b,{'showHidden':![],'depth':null}));if(_0x3acc5b[_0x3301('0x35')]!==_0x3acc5b[_0x3301('0x45')]){if(this['channels'][_0x3acc5b[_0x3301('0x45')]]){if(_0x3acc5b[_0x3301('0x4c')]==='6'){if(!this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]]['answered']){var _0x3c4de6=moment();this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x61')]=!![];this[_0x3301('0x1b')][_0x3acc5b['linkedid']][_0x3301('0x62')]=_0x3c4de6[_0x3301('0x42')](_0x3301('0x49'));if(this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]]['starttime']){this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x63')]=_0x3c4de6[_0x3301('0x64')](this['channels'][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x48')],'seconds');}}this[_0x3301('0x1b')][_0x3acc5b['linkedid']][_0x3301('0x45')]=_0x3acc5b[_0x3301('0x35')];if(_0x3acc5b[_0x3301('0x37')]!==_0x3301('0x65')){this['channels'][_0x3acc5b['linkedid']][_0x3301('0x66')]=_0x3acc5b[_0x3301('0x37')];}this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x67')]=_0x3acc5b[_0x3301('0x36')];this[_0x3301('0x1b')][_0x3acc5b['linkedid']][_0x3301('0x68')]=_0x3acc5b[_0x3301('0x3f')];this['channels'][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x4a')]=dispositions[_[_0x3301('0x4b')](_0x3acc5b[_0x3301('0x4c')])];if(this[_0x3301('0x1c')][_0x3acc5b['channel'][_0x3301('0x40')]('-')[0x0]]){this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x69')]=this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')]['split']('-')[0x0]]['id'];this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]]['membername']=this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x43')];}}}}else{if(this[_0x3301('0x1b')][_0x3acc5b['uniqueid']]){if(_0x3acc5b[_0x3301('0x4c')]==='6'){if(this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]){this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x35')]]['UserId']=this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')]['split']('-')[0x0]]['id'];this['channels'][_0x3acc5b[_0x3301('0x35')]][_0x3301('0x6a')]=this[_0x3301('0x1c')][_0x3acc5b['channel'][_0x3301('0x40')]('-')[0x0]]['name'];}}}}if(_0x3acc5b['channelstate']==='6'&&_0x3acc5b['context']===_0x3301('0x3e')){if(this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]){this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]]['destconnectedlinenum']=_0x3acc5b['exten'];var _0x48a50d;if(this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x35')]])_0x48a50d=this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x35')]][_0x3301('0x6b')];else if(this[_0x3301('0x1b')][_0x3acc5b[_0x3301('0x45')]])_0x48a50d=this['channels'][_0x3acc5b[_0x3301('0x45')]][_0x3301('0x6b')];logger[_0x3301('0x38')](_0x3301('0x6c'),_0x3acc5b[_0x3301('0x35')],util[_0x3301('0x2e')]({'destaccountcode':this[_0x3301('0x1c')][_0x3acc5b['channel'][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4e')],'destconnectedlinenum':_0x3acc5b[_0x3301('0x41')],'routealias':_0x48a50d},{'showHidden':![],'depth':null}));this[_0x3301('0x32')](util[_0x3301('0x42')]('user:%s',this[_0x3301('0x1c')][_0x3acc5b['channel']['split']('-')[0x0]][_0x3301('0x43')]),'user:agentconnect',{'destaccountcode':this[_0x3301('0x1c')][_0x3acc5b[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4e')],'destconnectedlinenum':_0x3acc5b[_0x3301('0x41')],'routealias':_0x48a50d});}}}}catch(_0x27cb5e){logger[_0x3301('0x51')]('[%s][voiceCallReport][newstate]',_0x3acc5b[_0x3301('0x35')],util[_0x3301('0x2e')](_0x27cb5e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0x6d')]=function(_0x1704b1,_0x379c6b){try{if(this[_0x3301('0x1b')][_0x1704b1]){logger['info'](_0x3301('0x6e'),_0x1704b1,_0x379c6b);this[_0x3301('0x1b')][_0x1704b1][_0x3301('0x6f')]=!![];if(_[_0x3301('0x70')](_0x379c6b,_0x3301('0x71'))){_0x379c6b=_0x379c6b['replace']('.wav49','.WAV');}this[_0x3301('0x1b')][_0x1704b1]['monitorFilename']=_0x379c6b;var _0xaa57cc=_[_0x3301('0x72')](this[_0x3301('0x1b')][_0x1704b1][_0x3301('0x73')],{'filename':_0x379c6b});if(_[_0x3301('0x74')](_0xaa57cc)){this[_0x3301('0x1b')][_0x1704b1][_0x3301('0x73')][_0x3301('0x75')]({'filename':_0x379c6b,'createdAt':moment()[_0x3301('0x42')](_0x3301('0x49')),'mixmonitorid':'','status':_0x3301('0x76')});}}}catch(_0x30ec74){logger[_0x3301('0x51')](_0x3301('0x77'),_0x1704b1,util[_0x3301('0x2e')](_0x30ec74,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')]['syncVarSet']=function(_0x12461e){try{if(this[_0x3301('0x30')](_0x12461e)){logger[_0x3301('0x38')](_0x3301('0x78'),_0x12461e['uniqueid'],util[_0x3301('0x2e')](_0x12461e,{'showHidden':![],'depth':null}));if(this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]]&&_0x12461e[_0x3301('0x3f')]!=_0x3301('0x46')){if(this[_0x3301('0x30')](_0x12461e['variable'])){if(this[_0x3301('0x30')](_0x12461e['variable'][_0x3301('0x79')])){logger[_0x3301('0x33')](_0x3301('0x7a'),_0x12461e[_0x3301('0x35')],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x6d')](_0x12461e[_0x3301('0x35')],_0x12461e[_0x3301('0x7b')]);}else if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')][_0x3301('0x7d')])){logger['info'](_0x3301('0x7e'),_0x12461e['uniqueid'],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x37')]=_0x12461e['value'];}else if(this[_0x3301('0x30')](_0x12461e['variable'][_0x3301('0x7f')])){logger[_0x3301('0x33')](_0x3301('0x80'),_0x12461e[_0x3301('0x35')],_0x12461e['value']);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x81')]=_0x12461e[_0x3301('0x7b')];}else if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')][_0x3301('0x82')])){logger[_0x3301('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x12461e['uniqueid'],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x83')]=_0x12461e[_0x3301('0x7b')];}else if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')][_0x3301('0x84')])){logger[_0x3301('0x33')](_0x3301('0x85'),_0x12461e[_0x3301('0x35')],_0x12461e[_0x3301('0x7b')][_0x3301('0x40')](',')[0x0]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0xf')]=_0x12461e[_0x3301('0x7b')][_0x3301('0x40')](',')[0x0];}else if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')]['xmd-originatecalleridnum'])){logger[_0x3301('0x33')](_0x3301('0x86'),_0x12461e[_0x3301('0x35')],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x87')]=_0x12461e[_0x3301('0x7b')];}else if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')]['xmd-destination'])){logger[_0x3301('0x33')](_0x3301('0x88'),_0x12461e[_0x3301('0x35')],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x89')]=_0x12461e['value'];}else if(this['isNotNull'](_0x12461e['variable'][_0x3301('0x8a')])){logger[_0x3301('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x12461e['uniqueid'],_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x8b')]=_0x12461e[_0x3301('0x7b')];}else if(this['isNotNull'](_0x12461e[_0x3301('0x7c')][_0x3301('0x8c')])){logger[_0x3301('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x12461e['uniqueid'],_0x12461e['value']);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0xf')]=_0x12461e[_0x3301('0x7b')];}else if(this['isNotNull'](_0x12461e[_0x3301('0x7c')][_0x3301('0x8d')])){logger[_0x3301('0x33')](_0x3301('0x8e'),_0x12461e['uniqueid'],_0x12461e['value']);this[_0x3301('0x1b')][_0x12461e[_0x3301('0x35')]][_0x3301('0x8f')]=_0x12461e['value'];}}}else if(this['isNotNull'](_0x12461e[_0x3301('0x7c')][_0x3301('0x79')])){if(_0x12461e[_0x3301('0x7b')]){var _0x229a89=path[_0x3301('0x90')](_0x12461e['value'])['name'];logger[_0x3301('0x33')](_0x3301('0x7a'),_0x229a89,_0x12461e[_0x3301('0x7b')]);this[_0x3301('0x6d')](_0x229a89,_0x12461e[_0x3301('0x7b')]);}}else if(this[_0x3301('0x1b')][_0x12461e['linkedid']]){if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')])){if(this[_0x3301('0x30')](_0x12461e[_0x3301('0x7c')]['sipcallid'])){logger[_0x3301('0x33')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x12461e[_0x3301('0x45')],_0x12461e[_0x3301('0x7b')]);this['channels'][_0x12461e[_0x3301('0x45')]][_0x3301('0x91')]=_0x12461e[_0x3301('0x7b')];}}}}}catch(_0x5474fa){logger[_0x3301('0x51')](_0x3301('0x92'),_0x12461e[_0x3301('0x35')],util['inspect'](_0x5474fa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0x26')]=function(_0x168e24){try{if(this[_0x3301('0x30')](_0x168e24)){logger[_0x3301('0x38')](_0x3301('0x93'),_0x168e24['uniqueid'],util['inspect'](_0x168e24,{'showHidden':![],'depth':null}));if(this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]]){logger[_0x3301('0x33')](_0x3301('0x94'),_0x168e24[_0x3301('0x35')],_0x168e24[_0x3301('0x95')]);var _0x3b19fa=moment();this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x96')]=_0x3b19fa[_0x3301('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x59')]=_0x3b19fa[_0x3301('0x64')](this['channels'][_0x168e24[_0x3301('0x35')]][_0x3301('0x48')],_0x3301('0x97'));if(this['channels'][_0x168e24[_0x3301('0x35')]]['answered']){this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x98')]=_0x3b19fa['diff'](this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x62')],_0x3301('0x97'));this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x63')]=this['channels'][_0x168e24['uniqueid']][_0x3301('0x59')]-this[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x98')];}if(_0x168e24[_0x3301('0x3d')]===_0x3301('0x3e')){if(this[_0x3301('0x1c')][_0x168e24[_0x3301('0x3f')]['split']('-')[0x0]]){this[_0x3301('0x1c')][_0x168e24[_0x3301('0x3f')]['split']('-')[0x0]]=_[_0x3301('0x99')](this[_0x3301('0x1c')][_0x168e24[_0x3301('0x3f')]['split']('-')[0x0]],[_0x3301('0x4d')]);logger['debug'](_0x3301('0x9a'),_0x168e24[_0x3301('0x35')],util['inspect']({'id':this[_0x3301('0x1c')][_0x168e24[_0x3301('0x3f')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x3301('0x1c')][_0x168e24[_0x3301('0x3f')][_0x3301('0x40')]('-')[0x0]][_0x3301('0x4e')]},{'showHidden':![],'depth':null}));this[_0x3301('0x32')](util[_0x3301('0x42')]('user:%s',this[_0x3301('0x1c')][_0x168e24['channel'][_0x3301('0x40')]('-')[0x0]][_0x3301('0x43')]),_0x3301('0x9b'),{'id':this[_0x3301('0x1c')][_0x168e24['channel'][_0x3301('0x40')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x168e24['channel']['split']('-')[0x0]][_0x3301('0x4e')]});}}var _0x4c18ed=this;Promise[_0x3301('0x9c')]()[_0x3301('0x9d')](function(){var _0x23eac5=_0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]];if(typeof _0x23eac5[_0x3301('0x9e')]===_0x3301('0x9f'))return;if(_[_0x3301('0xa0')](_0x23eac5['monitors']))return;return RpcSetting[_0x3301('0xa1')]()['then'](function(_0x16373e){if(!_0x16373e[_0x3301('0xa2')])return;return Promise[_0x3301('0x9c')]()[_0x3301('0x9d')](function(){return ami[_0x3301('0xa3')]({'action':_0x3301('0xa4'),'channel':_0x23eac5[_0x3301('0x3f')]})[_0x3301('0xa5')](function(){});})[_0x3301('0x9d')](function(){return ami[_0x3301('0xa3')]({'action':'StopMixMonitor','channel':_0x23eac5['destinationchannel']})[_0x3301('0xa5')](function(){})['finally'](function(){var _0x51fbdd=_0x4c18ed[_0x3301('0x1c')][_0x23eac5[_0x3301('0x68')][_0x3301('0x40')]('-')[0x0]];if(!_0x51fbdd)return;io[_0x3301('0x32')](_0x3301('0xa6'),{'agentId':_0x51fbdd['id'],'uniqueid':_0x23eac5['uniqueid']});});});});})[_0x3301('0x9d')](function(){if(_0x168e24['event']==='BlindTransfer'){_0x4c18ed[_0x3301('0x1d')][_0x168e24[_0x3301('0x35')]]=_0x4c18ed[_0x3301('0x1b')][_0x168e24['uniqueid']];}else{if(_0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x83')]===_0x3301('0xa7')&&_0x4c18ed[_0x3301('0x1d')][_0x168e24[_0x3301('0x35')]]){_0x4c18ed[_0x3301('0x1b')][_0x168e24['uniqueid']][_0x3301('0x35')]=[_0x4c18ed['channels'][_0x168e24[_0x3301('0x35')]]['linkedid'],_0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x45')]=_0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]][_0x3301('0x35')]][0x0];delete _0x4c18ed[_0x3301('0x1d')][_0x168e24[_0x3301('0x35')]];}}logger[_0x3301('0x38')](_0x3301('0xa8'),_0x168e24[_0x3301('0x35')],util[_0x3301('0x2e')](_0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3301('0xa9'),_0x4c18ed[_0x3301('0x1b')][_0x168e24['uniqueid']]);delete _0x4c18ed[_0x3301('0x1b')][_0x168e24[_0x3301('0x35')]];});}}}catch(_0x37b419){logger[_0x3301('0x51')](_0x3301('0xaa'),_0x168e24[_0x3301('0x35')],util['inspect'](_0x37b419,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0xab')]=function(_0x3694e4){try{if(this[_0x3301('0x30')](_0x3694e4)){logger['info'](_0x3301('0xac'),_0x3694e4[_0x3301('0x35')],_0x3694e4[_0x3301('0xad')],_0x3694e4['transfertargetcalleridnum']);logger[_0x3301('0x38')](_0x3301('0xae'),_0x3694e4[_0x3301('0x35')],util[_0x3301('0x2e')](_0x3694e4,{'showHidden':![],'depth':null}));if(this['channels'][_0x3694e4[_0x3301('0xaf')]]){this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xaf')]][_0x3301('0xb0')]=_0x3694e4[_0x3301('0xad')];this['channels'][_0x3694e4[_0x3301('0xaf')]][_0x3301('0xb1')]=_0x3694e4[_0x3301('0xb2')];if(this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb3')]]){var _0x4e0f87=this['channels'][_0x3694e4['secondtransfereruniqueid']];this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb3')]]=this['channels'][_0x3694e4[_0x3301('0xaf')]];this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xaf')]]=_0x4e0f87;}}else if(this['channels'][_0x3694e4[_0x3301('0xb4')]]){this[_0x3301('0x1b')][_0x3694e4['transfertargetuniqueid']][_0x3301('0xb0')]=_0x3694e4['origtransferercalleridnum'];this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb4')]][_0x3301('0xb1')]=_0x3694e4[_0x3301('0xb2')];if(this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb5')]]){var _0x4e0f87=this['channels'][_0x3694e4[_0x3301('0xb5')]];this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb5')]]=this[_0x3301('0x1b')][_0x3694e4['transfertargetuniqueid']];this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb4')]]=_0x4e0f87;}}if((this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb5')]]||this[_0x3301('0x1b')][_0x3694e4['origtransfererlinkedid']])&&this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb3')]]){var _0x4ed28=_['some']([this[_0x3301('0x1b')][_0x3694e4['origtransfereruniqueid']],this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb6')]],this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb3')]]],function(_0x53febb){return _0x53febb&&_0x53febb[_0x3301('0x83')]==='outbound'&&_0x53febb[_0x3301('0xb7')];});if(_0x4ed28){if(this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb5')]])this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb5')]][_0x3301('0x9e')]=_0x3301('0xb8');if(this[_0x3301('0x1b')][_0x3694e4[_0x3301('0xb6')]])this['channels'][_0x3694e4[_0x3301('0xb6')]]['transferType']=_0x3301('0xb8');this['channels'][_0x3694e4['secondtransfereruniqueid']]['transferType']=_0x3301('0xb8');}}}}catch(_0x873d5a){logger[_0x3301('0x51')]('[%s][voiceCallReport][attendedtransfer]',_0x3694e4['uniqueid'],util[_0x3301('0x2e')](_0x873d5a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')][_0x3301('0xb9')]=function(_0x4261da){try{if(this[_0x3301('0x30')](_0x4261da)){logger['info'](_0x3301('0xba'),_0x4261da['uniqueid'],_0x4261da[_0x3301('0xbb')],_0x4261da[_0x3301('0xbc')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x4261da[_0x3301('0x35')],util[_0x3301('0x2e')](_0x4261da,{'showHidden':![],'depth':null}));if(this['channels'][_0x4261da[_0x3301('0xaf')]]){this[_0x3301('0x1b')][_0x4261da[_0x3301('0xaf')]][_0x3301('0xb0')]=_0x4261da[_0x3301('0xbb')];this[_0x3301('0x1b')][_0x4261da[_0x3301('0xaf')]]['transferconnectedlinenum']=_0x4261da['extension'];this['channels'][_0x4261da[_0x3301('0xaf')]]['transferType']=_0x3301('0xbd');this[_0x3301('0x26')]({'event':_0x3301('0xbe'),'uniqueid':_0x4261da['transfereeuniqueid'],'context':_0x4261da[_0x3301('0x3d')],'channel':_0x4261da[_0x3301('0xbf')]});}else{this[_0x3301('0x1b')][_0x4261da[_0x3301('0xc0')]][_0x3301('0x9e')]=_0x3301('0xbd');}}}catch(_0x11dba8){logger['error'](_0x3301('0xc1'),_0x4261da[_0x3301('0x35')],util[_0x3301('0x2e')](_0x11dba8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')]['syncMusicOnHoldStart']=function(_0x373677){try{if(this['isNotNull'](_0x373677)){logger[_0x3301('0x38')](_0x3301('0xc2'),_0x373677['uniqueid'],util[_0x3301('0x2e')](_0x373677,{'showHidden':![],'depth':null}));if(this[_0x3301('0x1b')][_0x373677['uniqueid']]){if(!_[_0x3301('0x74')](this[_0x3301('0x1b')][_0x373677[_0x3301('0x35')]]['answertime'])){this[_0x3301('0x1b')][_0x373677[_0x3301('0x35')]][_0x3301('0xc3')]=moment()[_0x3301('0x42')](_0x3301('0x49'));logger[_0x3301('0x33')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x373677[_0x3301('0x35')],this[_0x3301('0x1b')][_0x373677['uniqueid']]['mohstarttime']);}}}}catch(_0xf2198c){logger[_0x3301('0x51')](_0x3301('0xc4'),_0x373677[_0x3301('0x35')],util[_0x3301('0x2e')](_0xf2198c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3301('0x2f')]['syncMusicOnHoldStop']=function(_0x823cd9){try{if(this[_0x3301('0x30')](_0x823cd9)){logger[_0x3301('0x38')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x823cd9[_0x3301('0x35')],util['inspect'](_0x823cd9,{'showHidden':![],'depth':null}));if(this[_0x3301('0x1b')][_0x823cd9[_0x3301('0x35')]]){if(!_[_0x3301('0x74')](this[_0x3301('0x1b')][_0x823cd9['uniqueid']][_0x3301('0xc3')])){this[_0x3301('0x1b')][_0x823cd9[_0x3301('0x35')]]['mohtime']+=moment()[_0x3301('0xc5')](0x0)[_0x3301('0x64')](this['channels'][_0x823cd9[_0x3301('0x35')]]['mohstarttime'],'seconds');logger[_0x3301('0x33')](_0x3301('0xc6'),_0x823cd9['uniqueid'],this['channels'][_0x823cd9[_0x3301('0x35')]][_0x3301('0xc7')]);delete this[_0x3301('0x1b')][_0x823cd9['uniqueid']][_0x3301('0xc3')];}}}}catch(_0x290182){logger['error'](_0x3301('0xc8'),_0x823cd9[_0x3301('0x35')],util[_0x3301('0x2e')](_0x290182,{'showHidden':![],'depth':null}));}};module[_0x3301('0xc9')]=VoiceCallReport; \ No newline at end of file +var _0xd0b8=['newexten','newchannel','syncNewChannel','newstate','syncNewState','bind','varset','syncVarSet','hangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','emit','prototype','syncNewCallerId','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','from-sip','channel','xcally-motion-preview','split','destconnectedlinenum','format','name','user:agentconnect','accountcode','connectedlinenum','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','context','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','cdr(','match','[%s][voiceCallReport][newexten]','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','diff','connectedlinename','calleridname','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','answertime','holdtime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','undefined','isEmpty','getSettings','then','catch','StopMixMonitor','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','transferType','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohtime','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','set','queue','agi','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','syncNewExten'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd0b8,0x176));var _0x8d0b=function(_0x6f3f68,_0x7cdd77){_0x6f3f68=_0x6f3f68-0x0;var _0x8bddbd=_0xd0b8[_0x6f3f68];return _0x8bddbd;};'use strict';var BPromise=require('bluebird');var _=require(_0x8d0b('0x0'));var moment=require(_0x8d0b('0x1'));var util=require(_0x8d0b('0x2'));var path=require(_0x8d0b('0x3'));var Redis=require(_0x8d0b('0x4'));var config=require(_0x8d0b('0x5'));var logger=require(_0x8d0b('0x6'))(_0x8d0b('0x7'));var ami=require(_0x8d0b('0x8'));var Channel=require('../model/channel');var RpcSetting=require(_0x8d0b('0x9'));var statusDesc=[_0x8d0b('0xa'),_0x8d0b('0xb'),_0x8d0b('0xc'),_0x8d0b('0xd'),'invalid',_0x8d0b('0xe'),_0x8d0b('0xf'),_0x8d0b('0x10'),_0x8d0b('0x11')];var applications=[_0x8d0b('0x12'),_0x8d0b('0x13'),_0x8d0b('0x14'),'dial',_0x8d0b('0x15'),'voicemail'];var dispositions=[_0x8d0b('0x16'),_0x8d0b('0x17'),'FAILED',_0x8d0b('0x16'),_0x8d0b('0x16'),_0x8d0b('0x16'),'ANSWERED',_0x8d0b('0x18'),_0x8d0b('0x17'),'FAILED',_0x8d0b('0x17')];var actions={};config[_0x8d0b('0x19')]=_[_0x8d0b('0x1a')](config[_0x8d0b('0x19')],{'host':'localhost','port':0x18eb});var io=require(_0x8d0b('0x1b'))(new Redis(config[_0x8d0b('0x19')]));function VoiceCallReport(_0x417702){this['channels']=_0x417702[_0x8d0b('0x1c')];this[_0x8d0b('0x1d')]=_0x417702[_0x8d0b('0x1d')];this[_0x8d0b('0x1e')]={};ami['on']('coreshowchannel',this[_0x8d0b('0x1f')]['bind'](this));ami['on'](_0x8d0b('0x20'),this[_0x8d0b('0x1f')]['bind'](this));ami['on'](_0x8d0b('0x21'),this[_0x8d0b('0x22')]['bind'](this));ami['on'](_0x8d0b('0x23'),this[_0x8d0b('0x24')][_0x8d0b('0x25')](this));ami['on'](_0x8d0b('0x26'),this[_0x8d0b('0x27')]['bind'](this));ami['on'](_0x8d0b('0x28'),this['syncHangup'][_0x8d0b('0x25')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x8d0b('0x25')](this));ami['on'](_0x8d0b('0x29'),this[_0x8d0b('0x2a')][_0x8d0b('0x25')](this));ami['on'](_0x8d0b('0x2b'),this[_0x8d0b('0x2c')][_0x8d0b('0x25')](this));ami['on']('musiconholdstart',this[_0x8d0b('0x2d')][_0x8d0b('0x25')](this));ami['on'](_0x8d0b('0x2e'),this[_0x8d0b('0x2f')][_0x8d0b('0x25')](this));try{logger[_0x8d0b('0x30')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x8d0b('0x31')]();}catch(_0x4c04bf){logger[_0x8d0b('0x32')](_0x8d0b('0x33'),util[_0x8d0b('0x34')](_0x4c04bf,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x8d0b('0x35')]=function(_0x197784){return _0x197784!==null&&!_[_0x8d0b('0x36')](_0x197784);};VoiceCallReport['prototype'][_0x8d0b('0x37')]=function(_0x13de84,_0x1b4066,_0x1f94b4){io['to'](_0x13de84)[_0x8d0b('0x37')](_0x1b4066,_0x1f94b4);};VoiceCallReport[_0x8d0b('0x38')][_0x8d0b('0x39')]=function(_0x3b9520){try{if(this[_0x8d0b('0x35')](_0x3b9520)){logger[_0x8d0b('0x30')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x3b9520[_0x8d0b('0x3a')],_0x3b9520['calleridname'],_0x3b9520['calleridnum']);logger[_0x8d0b('0x3b')](_0x8d0b('0x3c'),_0x3b9520[_0x8d0b('0x3a')],util['inspect'](_0x3b9520,{'showHidden':![],'depth':null}));if(_0x3b9520['uniqueid']===_0x3b9520[_0x8d0b('0x3d')]){if(!_[_0x8d0b('0x36')](this[_0x8d0b('0x1c')][_0x3b9520['uniqueid']])){_[_0x8d0b('0x3e')](this[_0x8d0b('0x1c')][_0x3b9520[_0x8d0b('0x3a')]],_[_0x8d0b('0x3f')](_0x3b9520,_[_0x8d0b('0x40')](this[_0x8d0b('0x1c')][_0x3b9520['uniqueid']])));}}if(_0x3b9520['context']===_0x8d0b('0x41')){if(this['agents'][_0x3b9520[_0x8d0b('0x42')]['split']('-')[0x0]]){if(_0x3b9520['exten']==_0x8d0b('0x43')){this[_0x8d0b('0x1d')][_0x3b9520['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x45')]=_0x3b9520['connectedlinenum'];this[_0x8d0b('0x37')](util[_0x8d0b('0x46')]('user:%s',this['agents'][_0x3b9520[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x47')]),_0x8d0b('0x48'),{'destaccountcode':this['agents'][_0x3b9520['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')],'destconnectedlinenum':_0x3b9520[_0x8d0b('0x4a')]});}}}}}catch(_0x339d5c){logger[_0x8d0b('0x32')]('[%s][voiceCallReport][newcallerid]',_0x3b9520[_0x8d0b('0x3a')],util['inspect'](_0x339d5c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8d0b('0x22')]=function(_0x53ffb2){try{if(this[_0x8d0b('0x35')](_0x53ffb2)){logger[_0x8d0b('0x3b')](_0x8d0b('0x4b'),_0x53ffb2['uniqueid'],util[_0x8d0b('0x34')](_0x53ffb2,{'showHidden':![],'depth':null}));if(_0x53ffb2[_0x8d0b('0x3a')]===_0x53ffb2[_0x8d0b('0x3d')]&&_0x53ffb2[_0x8d0b('0x42')]!=_0x8d0b('0x4c')){if(_[_0x8d0b('0x36')](this['channels'][_0x53ffb2[_0x8d0b('0x3a')]])){logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x53ffb2[_0x8d0b('0x3a')],_0x53ffb2[_0x8d0b('0x4d')],_0x53ffb2[_0x8d0b('0x4e')]);this['channels'][_0x53ffb2[_0x8d0b('0x3a')]]=new Channel();this[_0x8d0b('0x1c')][_0x53ffb2['uniqueid']][_0x8d0b('0x4f')]=moment()[_0x8d0b('0x46')](_0x8d0b('0x50'));this[_0x8d0b('0x1c')][_0x53ffb2[_0x8d0b('0x3a')]][_0x8d0b('0x51')]=dispositions[_[_0x8d0b('0x52')](_0x53ffb2[_0x8d0b('0x53')])];_[_0x8d0b('0x3e')](this[_0x8d0b('0x1c')][_0x53ffb2['uniqueid']],_[_0x8d0b('0x3f')](_0x53ffb2,_['keys'](this[_0x8d0b('0x1c')][_0x53ffb2['uniqueid']])));if(_0x53ffb2[_0x8d0b('0x4d')]==='from-sip'){if(this[_0x8d0b('0x1d')][_0x53ffb2[_0x8d0b('0x42')]['split']('-')[0x0]]){if(_['isUndefined'](this[_0x8d0b('0x1d')][_0x53ffb2['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x45')])){this[_0x8d0b('0x1d')][_0x53ffb2['channel']['split']('-')[0x0]][_0x8d0b('0x45')]=_0x53ffb2['exten'];logger[_0x8d0b('0x3b')](_0x8d0b('0x54'),_0x53ffb2[_0x8d0b('0x3a')],util[_0x8d0b('0x34')]({'destaccountcode':this[_0x8d0b('0x1d')][_0x53ffb2[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')],'destconnectedlinenum':_0x53ffb2[_0x8d0b('0x4e')]},{'showHidden':![],'depth':null}));this[_0x8d0b('0x37')](util[_0x8d0b('0x46')](_0x8d0b('0x55'),this['agents'][_0x53ffb2[_0x8d0b('0x42')]['split']('-')[0x0]][_0x8d0b('0x47')]),_0x8d0b('0x48'),{'destaccountcode':this[_0x8d0b('0x1d')][_0x53ffb2[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x53ffb2['exten']});}}}}}}}catch(_0x424d76){logger[_0x8d0b('0x32')](_0x8d0b('0x56'),_0x53ffb2[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x424d76,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')]['syncNewExten']=function(_0xf63ced){try{if(this[_0x8d0b('0x35')](_0xf63ced)){logger[_0x8d0b('0x3b')](_0x8d0b('0x57'),_0xf63ced[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0xf63ced,{'showHidden':![],'depth':null}));if(_0xf63ced[_0x8d0b('0x3a')]===_0xf63ced['linkedid']&&_0xf63ced[_0x8d0b('0x4e')]!='h'&&_0xf63ced[_0x8d0b('0x42')]!=_0x8d0b('0x4c')){_0xf63ced['application']=_0xf63ced[_0x8d0b('0x58')][_0x8d0b('0x59')]();_0xf63ced['applicationdata']=_0xf63ced['appdata']&&_0xf63ced[_0x8d0b('0x5a')][_0x8d0b('0x5b')]('CDR(routeAlias)')?_0xf63ced[_0x8d0b('0x5a')]:(_0xf63ced[_0x8d0b('0x5a')]||_0xf63ced[_0x8d0b('0x5c')])[_0x8d0b('0x59')]();logger[_0x8d0b('0x30')](_0x8d0b('0x5d'),_0xf63ced[_0x8d0b('0x3a')],_0xf63ced[_0x8d0b('0x58')],_0xf63ced[_0x8d0b('0x5c')]);if(_[_0x8d0b('0x36')](this[_0x8d0b('0x1c')][_0xf63ced[_0x8d0b('0x3a')]])){this[_0x8d0b('0x1c')][_0xf63ced[_0x8d0b('0x3a')]]=new Channel();this[_0x8d0b('0x1c')][_0xf63ced['uniqueid']][_0x8d0b('0x4f')]=_0xf63ced[_0x8d0b('0x5e')]?moment()[_0x8d0b('0x5f')](moment[_0x8d0b('0x5e')](_0xf63ced[_0x8d0b('0x5e')])[_0x8d0b('0x60')](),_0x8d0b('0x60'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x8d0b('0x46')](_0x8d0b('0x50'));this[_0x8d0b('0x1c')][_0xf63ced['uniqueid']][_0x8d0b('0x51')]='NO\x20ANSWER';}_[_0x8d0b('0x3e')](this['channels'][_0xf63ced[_0x8d0b('0x3a')]],_[_0x8d0b('0x3f')](_0xf63ced,_[_0x8d0b('0x40')](this['channels'][_0xf63ced[_0x8d0b('0x3a')]])));if(_[_0x8d0b('0x61')](applications,_0xf63ced[_0x8d0b('0x58')])){this['channels'][_0xf63ced[_0x8d0b('0x3a')]][_0x8d0b('0x62')]=_0xf63ced[_0x8d0b('0x58')];this[_0x8d0b('0x1c')][_0xf63ced[_0x8d0b('0x3a')]]['lastdata']=_0xf63ced['applicationdata'];if(_0xf63ced['application']===_0x8d0b('0x12')&&_[_0x8d0b('0x5b')](_0xf63ced[_0x8d0b('0x5c')]['toLowerCase'](),_0x8d0b('0x63'))){var _0x4c87d6=_0xf63ced[_0x8d0b('0x5c')]['split']('=');var _0x4a8eee=_0x4c87d6[0x0][_0x8d0b('0x59')]()[_0x8d0b('0x64')](/cdr\((.*)\)/);if(_0x4a8eee){this[_0x8d0b('0x1c')][_0xf63ced[_0x8d0b('0x3a')]][_0x4a8eee[0x1]]=_0x4c87d6[0x1];}}else if(_0xf63ced[_0x8d0b('0x58')]==='queue'){this[_0x8d0b('0x1c')][_0xf63ced[_0x8d0b('0x3a')]][_0x8d0b('0x13')]=_0xf63ced[_0x8d0b('0x5c')][_0x8d0b('0x44')](',')[0x0];}}}}}catch(_0x3c41b9){logger[_0x8d0b('0x32')](_0x8d0b('0x65'),_0xf63ced[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x3c41b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')][_0x8d0b('0x24')]=function(_0x5efe9d){try{if(this[_0x8d0b('0x35')](_0x5efe9d)){logger[_0x8d0b('0x30')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5efe9d[_0x8d0b('0x3a')],_0x5efe9d[_0x8d0b('0x3d')],_0x5efe9d['calleridname'],_0x5efe9d[_0x8d0b('0x66')]);logger[_0x8d0b('0x3b')](_0x8d0b('0x67'),_0x5efe9d[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x5efe9d,{'showHidden':![],'depth':null}));if(_0x5efe9d[_0x8d0b('0x3a')]!==_0x5efe9d[_0x8d0b('0x3d')]){if(this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]]){if(_0x5efe9d[_0x8d0b('0x53')]==='6'){if(!this[_0x8d0b('0x1c')][_0x5efe9d['linkedid']][_0x8d0b('0x68')]){var _0xe80c3=moment();this['channels'][_0x5efe9d[_0x8d0b('0x3d')]]['answered']=!![];this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]]['answertime']=_0xe80c3[_0x8d0b('0x46')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]][_0x8d0b('0x4f')]){this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]]['holdtime']=_0xe80c3[_0x8d0b('0x69')](this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]][_0x8d0b('0x4f')],'seconds');}}this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]][_0x8d0b('0x3d')]=_0x5efe9d[_0x8d0b('0x3a')];if(_0x5efe9d[_0x8d0b('0x66')]!=='xcally-motion-preview'){this['channels'][_0x5efe9d[_0x8d0b('0x3d')]]['connectedlinenum']=_0x5efe9d['calleridnum'];}this['channels'][_0x5efe9d[_0x8d0b('0x3d')]][_0x8d0b('0x6a')]=_0x5efe9d[_0x8d0b('0x6b')];this[_0x8d0b('0x1c')][_0x5efe9d['linkedid']][_0x8d0b('0x6c')]=_0x5efe9d[_0x8d0b('0x42')];this[_0x8d0b('0x1c')][_0x5efe9d['linkedid']][_0x8d0b('0x51')]=dispositions[_[_0x8d0b('0x52')](_0x5efe9d[_0x8d0b('0x53')])];if(this[_0x8d0b('0x1d')][_0x5efe9d['channel'][_0x8d0b('0x44')]('-')[0x0]]){this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]][_0x8d0b('0x6d')]=this['agents'][_0x5efe9d[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]['id'];this['channels'][_0x5efe9d[_0x8d0b('0x3d')]]['membername']=this[_0x8d0b('0x1d')][_0x5efe9d['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x47')];}}}}else{if(this['channels'][_0x5efe9d[_0x8d0b('0x3a')]]){if(_0x5efe9d[_0x8d0b('0x53')]==='6'){if(this[_0x8d0b('0x1d')][_0x5efe9d[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]){this[_0x8d0b('0x1c')][_0x5efe9d['uniqueid']][_0x8d0b('0x6d')]=this[_0x8d0b('0x1d')][_0x5efe9d[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]['id'];this[_0x8d0b('0x1c')][_0x5efe9d['uniqueid']][_0x8d0b('0x6e')]=this['agents'][_0x5efe9d[_0x8d0b('0x42')]['split']('-')[0x0]][_0x8d0b('0x47')];}}}}if(_0x5efe9d[_0x8d0b('0x53')]==='6'&&_0x5efe9d[_0x8d0b('0x4d')]===_0x8d0b('0x41')){if(this[_0x8d0b('0x1d')][_0x5efe9d['channel']['split']('-')[0x0]]){this['agents'][_0x5efe9d[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x45')]=_0x5efe9d[_0x8d0b('0x4e')];var _0x34f9af;if(this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3a')]])_0x34f9af=this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3a')]][_0x8d0b('0x6f')];else if(this[_0x8d0b('0x1c')][_0x5efe9d[_0x8d0b('0x3d')]])_0x34f9af=this[_0x8d0b('0x1c')][_0x5efe9d['linkedid']][_0x8d0b('0x6f')];logger[_0x8d0b('0x3b')](_0x8d0b('0x70'),_0x5efe9d['uniqueid'],util[_0x8d0b('0x34')]({'destaccountcode':this['agents'][_0x5efe9d['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')],'destconnectedlinenum':_0x5efe9d[_0x8d0b('0x4e')],'routealias':_0x34f9af},{'showHidden':![],'depth':null}));this[_0x8d0b('0x37')](util['format'](_0x8d0b('0x55'),this[_0x8d0b('0x1d')][_0x5efe9d[_0x8d0b('0x42')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x5efe9d[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')],'destconnectedlinenum':_0x5efe9d[_0x8d0b('0x4e')],'routealias':_0x34f9af});}}}}catch(_0x1aff46){logger[_0x8d0b('0x32')](_0x8d0b('0x71'),_0x5efe9d[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x1aff46,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8d0b('0x72')]=function(_0x58bf02,_0x4e316f){try{if(this['channels'][_0x58bf02]){logger[_0x8d0b('0x30')](_0x8d0b('0x73'),_0x58bf02,_0x4e316f);this[_0x8d0b('0x1c')][_0x58bf02]['monitor']=!![];if(_[_0x8d0b('0x74')](_0x4e316f,_0x8d0b('0x75'))){_0x4e316f=_0x4e316f[_0x8d0b('0x76')]('.wav49',_0x8d0b('0x77'));}this[_0x8d0b('0x1c')][_0x58bf02]['monitorFilename']=_0x4e316f;var _0xf50299=_[_0x8d0b('0x78')](this['channels'][_0x58bf02][_0x8d0b('0x79')],{'filename':_0x4e316f});if(_[_0x8d0b('0x7a')](_0xf50299)){this[_0x8d0b('0x1c')][_0x58bf02][_0x8d0b('0x79')]['push']({'filename':_0x4e316f,'createdAt':moment()[_0x8d0b('0x46')](_0x8d0b('0x50')),'mixmonitorid':'','status':_0x8d0b('0x7b')});}}}catch(_0x4d7814){logger[_0x8d0b('0x32')](_0x8d0b('0x7c'),_0x58bf02,util[_0x8d0b('0x34')](_0x4d7814,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')]['syncVarSet']=function(_0x2b0f1b){try{if(this[_0x8d0b('0x35')](_0x2b0f1b)){logger[_0x8d0b('0x3b')](_0x8d0b('0x7d'),_0x2b0f1b[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x2b0f1b,{'showHidden':![],'depth':null}));if(this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]]&&_0x2b0f1b[_0x8d0b('0x42')]!=_0x8d0b('0x4c')){if(this[_0x8d0b('0x35')](_0x2b0f1b[_0x8d0b('0x7e')])){if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')]['mixmonitor_filename'])){logger[_0x8d0b('0x30')](_0x8d0b('0x7f'),_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b['value']);this[_0x8d0b('0x72')](_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b[_0x8d0b('0x80')]);}else if(this[_0x8d0b('0x35')](_0x2b0f1b['variable']['xmd-phone'])){logger[_0x8d0b('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x2b0f1b['uniqueid'],_0x2b0f1b[_0x8d0b('0x80')]);this['channels'][_0x2b0f1b[_0x8d0b('0x3a')]]['calleridnum']=_0x2b0f1b['value'];}else if(this[_0x8d0b('0x35')](_0x2b0f1b['variable'][_0x8d0b('0x81')])){logger[_0x8d0b('0x30')](_0x8d0b('0x82'),_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]][_0x8d0b('0x83')]=_0x2b0f1b[_0x8d0b('0x80')];}else if(this[_0x8d0b('0x35')](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x84')])){logger[_0x8d0b('0x30')](_0x8d0b('0x85'),_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b[_0x8d0b('0x80')]);this['channels'][_0x2b0f1b['uniqueid']][_0x8d0b('0x86')]=_0x2b0f1b['value'];}else if(this[_0x8d0b('0x35')](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x87')])){logger[_0x8d0b('0x30')](_0x8d0b('0x88'),_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b['value']['split'](',')[0x0]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]][_0x8d0b('0x13')]=_0x2b0f1b[_0x8d0b('0x80')]['split'](',')[0x0];}else if(this[_0x8d0b('0x35')](_0x2b0f1b['variable'][_0x8d0b('0x89')])){logger[_0x8d0b('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]]['originatecalleridnum']=_0x2b0f1b[_0x8d0b('0x80')];}else if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x8a')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b['value']);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]][_0x8d0b('0x8b')]=_0x2b0f1b['value'];}else if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x8c')])){logger[_0x8d0b('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2b0f1b[_0x8d0b('0x3a')],_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]][_0x8d0b('0x8d')]=_0x2b0f1b['value'];}else if(this[_0x8d0b('0x35')](_0x2b0f1b[_0x8d0b('0x7e')]['xmcs-queue'])){logger[_0x8d0b('0x30')](_0x8d0b('0x8e'),_0x2b0f1b['uniqueid'],_0x2b0f1b['value']);this[_0x8d0b('0x1c')][_0x2b0f1b['uniqueid']][_0x8d0b('0x13')]=_0x2b0f1b[_0x8d0b('0x80')];}else if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')]['sipcallid'])){logger[_0x8d0b('0x30')](_0x8d0b('0x8f'),_0x2b0f1b['uniqueid'],_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3a')]][_0x8d0b('0x90')]=_0x2b0f1b['value'];}}}else if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x91')])){if(_0x2b0f1b[_0x8d0b('0x80')]){var _0x4f113f=path[_0x8d0b('0x92')](_0x2b0f1b[_0x8d0b('0x80')])['name'];logger[_0x8d0b('0x30')](_0x8d0b('0x7f'),_0x4f113f,_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x72')](_0x4f113f,_0x2b0f1b[_0x8d0b('0x80')]);}}else if(this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3d')]]){if(this[_0x8d0b('0x35')](_0x2b0f1b['variable'])){if(this['isNotNull'](_0x2b0f1b[_0x8d0b('0x7e')][_0x8d0b('0x93')])){logger[_0x8d0b('0x30')](_0x8d0b('0x8f'),_0x2b0f1b[_0x8d0b('0x3d')],_0x2b0f1b[_0x8d0b('0x80')]);this[_0x8d0b('0x1c')][_0x2b0f1b[_0x8d0b('0x3d')]][_0x8d0b('0x94')]=_0x2b0f1b['value'];}}}}}catch(_0x26aca8){logger[_0x8d0b('0x32')](_0x8d0b('0x95'),_0x2b0f1b[_0x8d0b('0x3a')],util['inspect'](_0x26aca8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')][_0x8d0b('0x96')]=function(_0x18055b){try{if(this[_0x8d0b('0x35')](_0x18055b)){logger['debug'](_0x8d0b('0x97'),_0x18055b[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x18055b,{'showHidden':![],'depth':null}));if(this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]]){logger[_0x8d0b('0x30')](_0x8d0b('0x98'),_0x18055b[_0x8d0b('0x3a')],_0x18055b['cause-txt']);var _0x3477ec=moment();this['channels'][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x99')]=_0x3477ec[_0x8d0b('0x46')](_0x8d0b('0x50'));this[_0x8d0b('0x1c')][_0x18055b['uniqueid']][_0x8d0b('0x5e')]=_0x3477ec[_0x8d0b('0x69')](this['channels'][_0x18055b['uniqueid']]['starttime'],'seconds');if(this[_0x8d0b('0x1c')][_0x18055b['uniqueid']][_0x8d0b('0x68')]){this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x9a')]=_0x3477ec[_0x8d0b('0x69')](this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x9b')],'seconds');this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x9c')]=this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]]['duration']-this[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x9a')];}if(_0x18055b['context']===_0x8d0b('0x41')){if(this['agents'][_0x18055b[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]){this[_0x8d0b('0x1d')][_0x18055b[_0x8d0b('0x42')]['split']('-')[0x0]]=_['omit'](this[_0x8d0b('0x1d')][_0x18055b[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]],['destconnectedlinenum']);logger[_0x8d0b('0x3b')](_0x8d0b('0x9d'),_0x18055b[_0x8d0b('0x3a')],util[_0x8d0b('0x34')]({'id':this[_0x8d0b('0x1d')][_0x18055b[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x18055b['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x8d0b('0x46')](_0x8d0b('0x55'),this[_0x8d0b('0x1d')][_0x18055b[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x47')]),_0x8d0b('0x9e'),{'id':this[_0x8d0b('0x1d')][_0x18055b[_0x8d0b('0x42')][_0x8d0b('0x44')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x18055b['channel'][_0x8d0b('0x44')]('-')[0x0]][_0x8d0b('0x49')]});}}var _0x5cee20=this;Promise[_0x8d0b('0x9f')]()['then'](function(){var _0x2c61f8=_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]];if(typeof _0x2c61f8['transferType']===_0x8d0b('0xa0'))return;if(_[_0x8d0b('0xa1')](_0x2c61f8[_0x8d0b('0x79')]))return;return RpcSetting[_0x8d0b('0xa2')]()[_0x8d0b('0xa3')](function(_0x58dc32){if(!_0x58dc32['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x8d0b('0xa3')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x2c61f8[_0x8d0b('0x42')]})[_0x8d0b('0xa4')](function(){});})[_0x8d0b('0xa3')](function(){return ami['Action']({'action':_0x8d0b('0xa5'),'channel':_0x2c61f8[_0x8d0b('0x6c')]})[_0x8d0b('0xa4')](function(){})[_0x8d0b('0xa6')](function(){var _0x392f47=_0x5cee20['agents'][_0x2c61f8['destinationchannel'][_0x8d0b('0x44')]('-')[0x0]];if(!_0x392f47)return;io[_0x8d0b('0x37')](_0x8d0b('0xa7'),{'agentId':_0x392f47['id'],'uniqueid':_0x2c61f8[_0x8d0b('0x3a')]});});});});})[_0x8d0b('0xa3')](function(){if(_0x18055b[_0x8d0b('0xa8')]===_0x8d0b('0xa9')){_0x5cee20[_0x8d0b('0x1e')][_0x18055b[_0x8d0b('0x3a')]]=_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]];}else{if(_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x86')]==='outbound'&&_0x5cee20[_0x8d0b('0x1e')][_0x18055b['uniqueid']]){_0x5cee20['channels'][_0x18055b[_0x8d0b('0x3a')]]['uniqueid']=[_0x5cee20[_0x8d0b('0x1c')][_0x18055b['uniqueid']][_0x8d0b('0x3d')],_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]]['linkedid']=_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]][_0x8d0b('0x3a')]][0x0];delete _0x5cee20[_0x8d0b('0x1e')][_0x18055b[_0x8d0b('0x3a')]];}}logger[_0x8d0b('0x3b')](_0x8d0b('0xaa'),_0x18055b[_0x8d0b('0x3a')],util['inspect'](_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8d0b('0xab'),_0x5cee20[_0x8d0b('0x1c')][_0x18055b[_0x8d0b('0x3a')]]);delete _0x5cee20['channels'][_0x18055b[_0x8d0b('0x3a')]];});}}}catch(_0x337a22){logger['error'](_0x8d0b('0xac'),_0x18055b[_0x8d0b('0x3a')],util['inspect'](_0x337a22,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')][_0x8d0b('0x2a')]=function(_0x63c65b){try{if(this[_0x8d0b('0x35')](_0x63c65b)){logger[_0x8d0b('0x30')](_0x8d0b('0xad'),_0x63c65b[_0x8d0b('0x3a')],_0x63c65b[_0x8d0b('0xae')],_0x63c65b['transfertargetcalleridnum']);logger[_0x8d0b('0x3b')](_0x8d0b('0xaf'),_0x63c65b['uniqueid'],util[_0x8d0b('0x34')](_0x63c65b,{'showHidden':![],'depth':null}));if(this['channels'][_0x63c65b[_0x8d0b('0xb0')]]){this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb0')]][_0x8d0b('0xb1')]=_0x63c65b[_0x8d0b('0xae')];this['channels'][_0x63c65b[_0x8d0b('0xb0')]][_0x8d0b('0xb2')]=_0x63c65b[_0x8d0b('0xb3')];if(this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb4')]]){var _0x1a52b5=this[_0x8d0b('0x1c')][_0x63c65b['secondtransfereruniqueid']];this['channels'][_0x63c65b[_0x8d0b('0xb4')]]=this[_0x8d0b('0x1c')][_0x63c65b['transfereeuniqueid']];this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb0')]]=_0x1a52b5;}}else if(this[_0x8d0b('0x1c')][_0x63c65b['transfertargetuniqueid']]){this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb5')]][_0x8d0b('0xb1')]=_0x63c65b[_0x8d0b('0xae')];this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb5')]][_0x8d0b('0xb2')]=_0x63c65b[_0x8d0b('0xb3')];if(this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb6')]]){var _0x1a52b5=this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb6')]];this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb6')]]=this['channels'][_0x63c65b['transfertargetuniqueid']];this['channels'][_0x63c65b[_0x8d0b('0xb5')]]=_0x1a52b5;}}if((this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb6')]]||this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb7')]])&&this[_0x8d0b('0x1c')][_0x63c65b['secondtransfereruniqueid']]){var _0x3125d1=_[_0x8d0b('0xb8')]([this[_0x8d0b('0x1c')][_0x63c65b['origtransfereruniqueid']],this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb7')]],this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb4')]]],function(_0x4c704d){return _0x4c704d&&_0x4c704d[_0x8d0b('0x86')]===_0x8d0b('0xb9')&&_0x4c704d[_0x8d0b('0xba')];});if(_0x3125d1){if(this[_0x8d0b('0x1c')][_0x63c65b['origtransfereruniqueid']])this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb6')]]['transferType']=_0x8d0b('0xbb');if(this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb7')]])this[_0x8d0b('0x1c')][_0x63c65b[_0x8d0b('0xb7')]]['transferType']=_0x8d0b('0xbb');this['channels'][_0x63c65b[_0x8d0b('0xb4')]][_0x8d0b('0xbc')]=_0x8d0b('0xbb');}}}}catch(_0x37f43b){logger[_0x8d0b('0x32')](_0x8d0b('0xbd'),_0x63c65b['uniqueid'],util[_0x8d0b('0x34')](_0x37f43b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')]['syncBlindTransfer']=function(_0x54803a){try{if(this[_0x8d0b('0x35')](_0x54803a)){logger['info'](_0x8d0b('0xbe'),_0x54803a[_0x8d0b('0x3a')],_0x54803a['transfereecalleridnum'],_0x54803a[_0x8d0b('0xbf')]);logger['debug'](_0x8d0b('0xc0'),_0x54803a[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x54803a,{'showHidden':![],'depth':null}));if(this[_0x8d0b('0x1c')][_0x54803a[_0x8d0b('0xb0')]]){this[_0x8d0b('0x1c')][_0x54803a[_0x8d0b('0xb0')]][_0x8d0b('0xb1')]=_0x54803a[_0x8d0b('0xc1')];this[_0x8d0b('0x1c')][_0x54803a['transfereeuniqueid']][_0x8d0b('0xb2')]=_0x54803a['extension'];this['channels'][_0x54803a[_0x8d0b('0xb0')]]['transferType']=_0x8d0b('0xc2');this[_0x8d0b('0x96')]({'event':_0x8d0b('0xa9'),'uniqueid':_0x54803a[_0x8d0b('0xb0')],'context':_0x54803a[_0x8d0b('0x4d')],'channel':_0x54803a[_0x8d0b('0xc3')]});}else{this[_0x8d0b('0x1c')][_0x54803a[_0x8d0b('0xc4')]][_0x8d0b('0xbc')]=_0x8d0b('0xc2');}}}catch(_0x23d6e4){logger['error']('[%s][voiceCallReport][blindtransfer]',_0x54803a[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x23d6e4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')]['syncMusicOnHoldStart']=function(_0x33baee){try{if(this[_0x8d0b('0x35')](_0x33baee)){logger[_0x8d0b('0x3b')](_0x8d0b('0xc5'),_0x33baee[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x33baee,{'showHidden':![],'depth':null}));if(this[_0x8d0b('0x1c')][_0x33baee[_0x8d0b('0x3a')]]){if(!_[_0x8d0b('0x7a')](this['channels'][_0x33baee[_0x8d0b('0x3a')]][_0x8d0b('0x9b')])){this[_0x8d0b('0x1c')][_0x33baee['uniqueid']][_0x8d0b('0xc6')]=moment()[_0x8d0b('0x46')](_0x8d0b('0x50'));logger[_0x8d0b('0x30')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x33baee[_0x8d0b('0x3a')],this[_0x8d0b('0x1c')][_0x33baee[_0x8d0b('0x3a')]]['mohstarttime']);}}}}catch(_0x56218f){logger[_0x8d0b('0x32')]('[%s][voiceCallReport][musiconholdstart]',_0x33baee[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x56218f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8d0b('0x38')][_0x8d0b('0x2f')]=function(_0x454cbd){try{if(this[_0x8d0b('0x35')](_0x454cbd)){logger[_0x8d0b('0x3b')](_0x8d0b('0xc7'),_0x454cbd[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x454cbd,{'showHidden':![],'depth':null}));if(this[_0x8d0b('0x1c')][_0x454cbd[_0x8d0b('0x3a')]]){if(!_[_0x8d0b('0x7a')](this[_0x8d0b('0x1c')][_0x454cbd[_0x8d0b('0x3a')]][_0x8d0b('0xc6')])){this[_0x8d0b('0x1c')][_0x454cbd[_0x8d0b('0x3a')]]['mohtime']+=moment()[_0x8d0b('0xc8')](0x0)['diff'](this[_0x8d0b('0x1c')][_0x454cbd[_0x8d0b('0x3a')]]['mohstarttime'],_0x8d0b('0x60'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x454cbd[_0x8d0b('0x3a')],this[_0x8d0b('0x1c')][_0x454cbd[_0x8d0b('0x3a')]][_0x8d0b('0xc9')]);delete this['channels'][_0x454cbd['uniqueid']]['mohstarttime'];}}}}catch(_0x320abd){logger[_0x8d0b('0x32')]('[%s][voiceCallReport][musiconholdstop]',_0x454cbd[_0x8d0b('0x3a')],util[_0x8d0b('0x34')](_0x320abd,{'showHidden':![],'depth':null}));}};module[_0x8d0b('0xca')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index ea385a3..980b3a1 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 _0x0e45=['application','split','[%s][voiceDialReport][newexten]','exports','lodash','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','syncDialBegin','bind','syncDialEnd','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','lastIndexOf','substring','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','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:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','variables','voice','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','billableseconds','holdtime','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0e45,0x79));var _0x50e4=function(_0x320507,_0x3aa6d6){_0x320507=_0x320507-0x0;var _0x2e6967=_0x0e45[_0x320507];return _0x2e6967;};'use strict';var _=require(_0x50e4('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x50e4('0x1'));var config=require(_0x50e4('0x2'));var logger=require(_0x50e4('0x3'))(_0x50e4('0x4'));var ami=require(_0x50e4('0x5'));config[_0x50e4('0x6')]=_[_0x50e4('0x7')](config[_0x50e4('0x6')],{'host':_0x50e4('0x8'),'port':0x18eb});var io=require(_0x50e4('0x9'))(new Redis(config[_0x50e4('0x6')]));function VoiceDialReport(_0x1bef6c){this[_0x50e4('0xa')]=_0x1bef6c[_0x50e4('0xb')];this['outbound']=_0x1bef6c[_0x50e4('0xc')];this[_0x50e4('0xd')]={};this['variables']={};ami['on']('dialbegin',this[_0x50e4('0xe')][_0x50e4('0xf')](this));ami['on']('dialend',this[_0x50e4('0x10')][_0x50e4('0xf')](this));ami['on']('varset',this[_0x50e4('0x11')][_0x50e4('0xf')](this));ami['on'](_0x50e4('0x12'),this[_0x50e4('0x13')][_0x50e4('0xf')](this));ami['on'](_0x50e4('0x14'),this[_0x50e4('0x15')][_0x50e4('0xf')](this));}VoiceDialReport[_0x50e4('0x16')][_0x50e4('0x17')]=function(_0x350ee1){return _0x350ee1!==null&&!_[_0x50e4('0x18')](_0x350ee1);};VoiceDialReport[_0x50e4('0x16')][_0x50e4('0x19')]=function(_0x59c533,_0x792a09,_0x388900){io['to'](_0x59c533)[_0x50e4('0x19')](_0x792a09,_0x388900);};VoiceDialReport[_0x50e4('0x16')][_0x50e4('0xe')]=function(_0x2fe226){try{if(this['isNotNull'](_0x2fe226)){logger[_0x50e4('0x1a')](_0x50e4('0x1b'),_0x2fe226[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0x2fe226,{'showHidden':![],'depth':null}));if(this[_0x50e4('0xa')][_0x2fe226[_0x50e4('0x1c')]]){_[_0x50e4('0x1e')](this[_0x50e4('0xa')][_0x2fe226[_0x50e4('0x1c')]],{'starttime':moment()[_0x50e4('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x50e4('0x20'),'interface':_0x2fe226[_0x50e4('0x21')]['substring'](0x0,_0x2fe226['channel'][_0x50e4('0x22')]('-')),'membername':_0x2fe226[_0x50e4('0x21')][_0x50e4('0x23')](_0x2fe226[_0x50e4('0x21')]['lastIndexOf']('/')+0x1,_0x2fe226[_0x50e4('0x21')][_0x50e4('0x22')]('-'))},_[_0x50e4('0x24')](_0x2fe226,[_0x50e4('0x25'),_0x50e4('0x26')]));logger[_0x50e4('0x27')](_0x50e4('0x28'),_0x2fe226[_0x50e4('0x1c')],this[_0x50e4('0xa')][_0x2fe226['uniqueid']][_0x50e4('0x29')],this[_0x50e4('0xa')][_0x2fe226[_0x50e4('0x1c')]][_0x50e4('0x2a')]);logger[_0x50e4('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2fe226[_0x50e4('0x1c')],util['inspect'](this[_0x50e4('0xa')][_0x2fe226[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x2fe226[_0x50e4('0x1c')]])_[_0x50e4('0x1e')](this['channels'][_0x2fe226[_0x50e4('0x1c')]],this[_0x50e4('0xd')][_0x2fe226[_0x50e4('0x1c')]]);this[_0x50e4('0x19')](_0x50e4('0x2b'),_0x50e4('0x2c'),this[_0x50e4('0xa')][_0x2fe226['uniqueid']]);logger[_0x50e4('0x1a')](_0x50e4('0x2d'),_0x2fe226[_0x50e4('0x1c')],util[_0x50e4('0x1d')](this['channels'][_0x2fe226[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x50e4('0x19')](_0x50e4('0x2e'),this['channels'][_0x2fe226['uniqueid']]);}}}catch(_0x4ebd10){logger['error'](_0x50e4('0x2f'),_0x2fe226[_0x50e4('0x1c')],util['inspect'](_0x4ebd10,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x50e4('0x16')][_0x50e4('0x10')]=function(_0x1343ef){try{if(this[_0x50e4('0x17')](_0x1343ef)){logger[_0x50e4('0x1a')]('[%s][voiceDialReport][dialend]\x20event:',_0x1343ef[_0x50e4('0x1c')],util['inspect'](_0x1343ef,{'showHidden':![],'depth':null}));if(this[_0x50e4('0xa')][_0x1343ef['uniqueid']]){this[_0x50e4('0xa')][_0x1343ef[_0x50e4('0x1c')]]['dialstatus']=_0x1343ef[_0x50e4('0x30')];if(_0x1343ef[_0x50e4('0x30')]==='ANSWER'){this[_0x50e4('0xa')][_0x1343ef['uniqueid']][_0x50e4('0x31')]=_0x1343ef['connectedlinenum'];this['channels'][_0x1343ef['uniqueid']][_0x50e4('0x32')]=_0x1343ef[_0x50e4('0x32')];this[_0x50e4('0xa')][_0x1343ef[_0x50e4('0x1c')]][_0x50e4('0x33')]=moment()[_0x50e4('0x1f')](_0x50e4('0x34'));this[_0x50e4('0xa')][_0x1343ef[_0x50e4('0x1c')]][_0x50e4('0x35')]='connect';logger['info'](_0x50e4('0x36'),_0x1343ef['uniqueid'],_0x1343ef[_0x50e4('0x21')][_0x50e4('0x23')](_0x1343ef[_0x50e4('0x21')][_0x50e4('0x22')]('/')+0x1,_0x1343ef['channel'][_0x50e4('0x22')]('-')));logger['debug'](_0x50e4('0x37'),_0x1343ef['uniqueid'],util[_0x50e4('0x1d')](this[_0x50e4('0xa')][_0x1343ef[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x50e4('0x19')](_0x50e4('0x38'),this[_0x50e4('0xa')][_0x1343ef['uniqueid']]);}logger[_0x50e4('0x1a')](_0x50e4('0x39'),_0x1343ef[_0x50e4('0x1c')],util['inspect'](this[_0x50e4('0xa')][_0x1343ef['uniqueid']],{'showHidden':![],'depth':null}));this[_0x50e4('0x19')](_0x50e4('0x2b'),_0x50e4('0x2c'),this[_0x50e4('0xa')][_0x1343ef[_0x50e4('0x1c')]]);}}}catch(_0x51ce4d){logger[_0x50e4('0x3a')](_0x50e4('0x3b'),_0x1343ef['uniqueid'],util[_0x50e4('0x1d')](_0x51ce4d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x50e4('0x16')][_0x50e4('0x11')]=function(_0x200a41){try{if(this['isNotNull'](_0x200a41)){logger['debug'](_0x50e4('0x3c'),_0x200a41[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0x200a41,{'showHidden':![],'depth':null}));this[_0x50e4('0x3d')](_0x200a41[_0x50e4('0x1c')],_[_0x50e4('0x3e')](_0x200a41[_0x50e4('0x3f')])[0x0],_0x200a41[_0x50e4('0x40')]);if(this[_0x50e4('0x17')](_0x200a41['variable'])&&this[_0x50e4('0x17')](_0x200a41['variable']['outboundrouteid'])){if(_['isUndefined'](this[_0x50e4('0xa')][_0x200a41[_0x50e4('0x1c')]])){this[_0x50e4('0xa')][_0x200a41['uniqueid']]={'routeId':_0x200a41[_0x50e4('0x40')],'variables':this[_0x50e4('0x41')][_0x200a41['uniqueid']],'motionChannel':_0x50e4('0x42')};logger[_0x50e4('0x27')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x200a41['uniqueid'],_0x200a41['variable']['outboundrouteid'],_[_0x50e4('0x3e')](_0x200a41[_0x50e4('0x3f')])[0x0],_0x200a41['value']);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x200a41[_0x50e4('0x1c')],util[_0x50e4('0x1d')](this['channels'][_0x200a41[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));this[_0x50e4('0x19')](_0x50e4('0x2b'),_0x50e4('0x2c'),this[_0x50e4('0xa')][_0x200a41['uniqueid']]);}}}}catch(_0xbdaf65){logger[_0x50e4('0x3a')](_0x50e4('0x43'),_0x200a41[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0xbdaf65,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x50e4('0x3d')]=function(_0x334233,_0x514d07,_0x339a69){var _0xb79399=[_0x50e4('0x44'),'rtpaudioqosbridged',_0x50e4('0x45'),_0x50e4('0x46'),_0x50e4('0x47'),_0x50e4('0x48'),_0x50e4('0x49'),_0x50e4('0x4a'),'sipcallid','sipuri',_0x50e4('0x4b'),_0x50e4('0x4c'),_0x50e4('0x4d'),_0x50e4('0x4e'),'memberinterface',_0x50e4('0x4f'),_0x50e4('0x29'),_0x50e4('0x50'),_0x50e4('0x51')];if(!_[_0x50e4('0x52')](_0x514d07)&&!_[_0x50e4('0x53')](_0xb79399,_0x514d07)){if(_[_0x50e4('0x18')](this['variables'][_0x334233])){this['variables'][_0x334233]={};}this[_0x50e4('0x41')][_0x334233][_0x514d07]=_0x339a69;}};VoiceDialReport[_0x50e4('0x16')][_0x50e4('0x15')]=function(_0x525634){try{if(this[_0x50e4('0x17')](_0x525634)){logger[_0x50e4('0x1a')](_0x50e4('0x54'),_0x525634['uniqueid'],util[_0x50e4('0x1d')](_0x525634,{'showHidden':![],'depth':null}));if(this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]]){logger[_0x50e4('0x27')](_0x50e4('0x55'),_0x525634['uniqueid'],_0x525634[_0x50e4('0x56')]);this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x57')]=moment()[_0x50e4('0x1f')](_0x50e4('0x34'));this['channels'][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x58')]=moment(this[_0x50e4('0xa')][_0x525634['uniqueid']][_0x50e4('0x57')])[_0x50e4('0x59')](this[_0x50e4('0xa')][_0x525634['uniqueid']][_0x50e4('0x5a')],_0x50e4('0x5b'));this['channels'][_0x525634[_0x50e4('0x1c')]]['lastevent']=_0x50e4('0x5c');this[_0x50e4('0xc')][_0x50e4('0x5d')]+=0x1;if(this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x33')]){this[_0x50e4('0xc')][_0x50e4('0x5e')]+=0x1;this['channels'][_0x525634[_0x50e4('0x1c')]]['holdtime']=moment(this['channels'][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x33')])[_0x50e4('0x59')](this['channels'][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x5a')],_0x50e4('0x5b'));this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x5f')]=moment(this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x57')])[_0x50e4('0x59')](this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x33')],'seconds');this[_0x50e4('0xc')]['sumHoldTime']+=this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x60')]||0x0;this[_0x50e4('0xc')]['sumBillable']+=this['channels'][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x5f')];}this[_0x50e4('0xc')][_0x50e4('0x61')]+=this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]][_0x50e4('0x58')];logger[_0x50e4('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x525634[_0x50e4('0x1c')],util[_0x50e4('0x1d')](this['channels'][_0x525634['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x50e4('0x19')](_0x50e4('0x62'),this['channels'][_0x525634['uniqueid']]);logger[_0x50e4('0x1a')](_0x50e4('0x63'),_0x525634['uniqueid'],util['inspect'](this['channels'][_0x525634[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x50e4('0x19')](_0x50e4('0x64'),this['channels'][_0x525634[_0x50e4('0x1c')]]);logger[_0x50e4('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x525634[_0x50e4('0x1c')],util[_0x50e4('0x1d')](this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));this[_0x50e4('0x19')](_0x50e4('0x2b'),'voice_outbound:save',this[_0x50e4('0xc')]);logger[_0x50e4('0x27')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x50e4('0x65')](this['channels'][_0x525634[_0x50e4('0x1c')]]));logger[_0x50e4('0x1a')](_0x50e4('0x66'),_0x525634['uniqueid'],util[_0x50e4('0x1d')](this[_0x50e4('0xa')][_0x525634[_0x50e4('0x1c')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x50e4('0x67'),this['channels'][_0x525634[_0x50e4('0x1c')]]);delete this[_0x50e4('0xa')][_0x525634['uniqueid']];}else if(this[_0x50e4('0xa')][_0x525634[_0x50e4('0x68')]]){this[_0x50e4('0xa')][_0x525634[_0x50e4('0x68')]][_0x50e4('0x1c')]=this[_0x50e4('0xa')][_0x525634[_0x50e4('0x68')]][_0x50e4('0x69')];}if(this[_0x50e4('0x41')][_0x525634[_0x50e4('0x1c')]]){delete this['variables'][_0x525634[_0x50e4('0x1c')]];}}}catch(_0x479ae8){logger[_0x50e4('0x3a')](_0x50e4('0x6a'),_0x525634[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0x479ae8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x50e4('0x16')]['syncNewExten']=function(_0x1d4f42){try{if(this[_0x50e4('0x17')](_0x1d4f42)){logger[_0x50e4('0x1a')]('[%s][voiceDialReport][newexten]\x20event:',_0x1d4f42[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0x1d4f42,{'showHidden':![],'depth':null}));if(_0x1d4f42['application'][_0x50e4('0x6b')]()===_0x50e4('0x6c')){_0x1d4f42[_0x50e4('0x6d')]=(_0x1d4f42[_0x50e4('0x6e')]||_0x1d4f42[_0x50e4('0x6d')])['toLowerCase']();if(_[_0x50e4('0x6f')](_0x1d4f42['applicationdata'],'cdr(')){if(_[_0x50e4('0x18')](this[_0x50e4('0xd')][_0x1d4f42[_0x50e4('0x1c')]]))this[_0x50e4('0xd')][_0x1d4f42[_0x50e4('0x1c')]]={};logger[_0x50e4('0x27')](_0x50e4('0x70'),_0x1d4f42[_0x50e4('0x1c')],_0x1d4f42[_0x50e4('0x71')],_0x1d4f42[_0x50e4('0x6d')]);var _0x197fae=_0x1d4f42[_0x50e4('0x6d')][_0x50e4('0x72')]('=');var _0x32a217=_0x197fae[0x0]['match'](/cdr\((.*)\)/);if(_0x32a217)this[_0x50e4('0xd')][_0x1d4f42[_0x50e4('0x1c')]][_0x32a217[0x1]]=_0x197fae[0x1];}}}}catch(_0x1f0200){logger[_0x50e4('0x3a')](_0x50e4('0x73'),_0x1d4f42[_0x50e4('0x1c')],util[_0x50e4('0x1d')](_0x1f0200,{'showHidden':![],'depth':null}));}};module[_0x50e4('0x74')]=VoiceDialReport; \ No newline at end of file +var _0x633a=['isUndefined','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','starttime','complete','total','answered','holdtime','diff','billableseconds','seconds','sumHoldTime','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','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','newexten','syncNewExten','syncHangup','prototype'];(function(_0x38ff79,_0x37811f){var _0xa8750f=function(_0xc9d5f9){while(--_0xc9d5f9){_0x38ff79['push'](_0x38ff79['shift']());}};_0xa8750f(++_0x37811f);}(_0x633a,0xd7));var _0xa633=function(_0x23dea8,_0x21f7ad){_0x23dea8=_0x23dea8-0x0;var _0x5564ea=_0x633a[_0x23dea8];return _0x5564ea;};'use strict';var _=require(_0xa633('0x0'));var moment=require(_0xa633('0x1'));var util=require('util');var Redis=require(_0xa633('0x2'));var config=require(_0xa633('0x3'));var logger=require('../../../config/logger')(_0xa633('0x4'));var ami=require('../ami');config[_0xa633('0x5')]=_[_0xa633('0x6')](config['redis'],{'host':_0xa633('0x7'),'port':0x18eb});var io=require(_0xa633('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x1a16ce){this[_0xa633('0x9')]=_0x1a16ce['outboundChannels'];this[_0xa633('0xa')]=_0x1a16ce[_0xa633('0xa')];this[_0xa633('0xb')]={};this[_0xa633('0xc')]={};ami['on'](_0xa633('0xd'),this[_0xa633('0xe')]['bind'](this));ami['on'](_0xa633('0xf'),this[_0xa633('0x10')][_0xa633('0x11')](this));ami['on'](_0xa633('0x12'),this['syncVarSet'][_0xa633('0x11')](this));ami['on'](_0xa633('0x13'),this[_0xa633('0x14')]['bind'](this));ami['on']('hangup',this[_0xa633('0x15')][_0xa633('0x11')](this));}VoiceDialReport[_0xa633('0x16')]['isNotNull']=function(_0x3107d8){return _0x3107d8!==null&&!_[_0xa633('0x17')](_0x3107d8);};VoiceDialReport[_0xa633('0x16')][_0xa633('0x18')]=function(_0x55bf3a,_0x5050e4,_0x3126dd){io['to'](_0x55bf3a)['emit'](_0x5050e4,_0x3126dd);};VoiceDialReport[_0xa633('0x16')][_0xa633('0xe')]=function(_0x4908fc){try{if(this[_0xa633('0x19')](_0x4908fc)){logger[_0xa633('0x1a')](_0xa633('0x1b'),_0x4908fc['uniqueid'],util['inspect'](_0x4908fc,{'showHidden':![],'depth':null}));if(this[_0xa633('0x9')][_0x4908fc[_0xa633('0x1c')]]){_[_0xa633('0x1d')](this[_0xa633('0x9')][_0x4908fc[_0xa633('0x1c')]],{'starttime':moment()['format'](_0xa633('0x1e')),'lastevent':_0xa633('0x1f'),'interface':_0x4908fc[_0xa633('0x20')][_0xa633('0x21')](0x0,_0x4908fc[_0xa633('0x20')]['lastIndexOf']('-')),'membername':_0x4908fc[_0xa633('0x20')]['substring'](_0x4908fc[_0xa633('0x20')][_0xa633('0x22')]('/')+0x1,_0x4908fc[_0xa633('0x20')][_0xa633('0x22')]('-'))},_[_0xa633('0x23')](_0x4908fc,[_0xa633('0x24'),_0xa633('0x25')]));logger['info'](_0xa633('0x26'),_0x4908fc[_0xa633('0x1c')],this[_0xa633('0x9')][_0x4908fc['uniqueid']][_0xa633('0x27')],this['channels'][_0x4908fc[_0xa633('0x1c')]][_0xa633('0x28')]);logger[_0xa633('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4908fc[_0xa633('0x1c')],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x4908fc[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0xa633('0xb')][_0x4908fc[_0xa633('0x1c')]])_[_0xa633('0x1d')](this['channels'][_0x4908fc['uniqueid']],this[_0xa633('0xb')][_0x4908fc[_0xa633('0x1c')]]);this[_0xa633('0x18')](_0xa633('0x2a'),_0xa633('0x2b'),this['channels'][_0x4908fc['uniqueid']]);logger[_0xa633('0x1a')](_0xa633('0x2c'),_0x4908fc['uniqueid'],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x4908fc[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xa633('0x2d'),this[_0xa633('0x9')][_0x4908fc[_0xa633('0x1c')]]);}}}catch(_0x16bcdd){logger[_0xa633('0x2e')](_0xa633('0x2f'),_0x4908fc[_0xa633('0x1c')],util[_0xa633('0x29')](_0x16bcdd,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xa633('0x10')]=function(_0xcff77){try{if(this[_0xa633('0x19')](_0xcff77)){logger['debug']('[%s][voiceDialReport][dialend]\x20event:',_0xcff77[_0xa633('0x1c')],util[_0xa633('0x29')](_0xcff77,{'showHidden':![],'depth':null}));if(this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]]){this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]]['dialstatus']=_0xcff77[_0xa633('0x30')];if(_0xcff77[_0xa633('0x30')]==='ANSWER'){this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]][_0xa633('0x31')]=_0xcff77[_0xa633('0x31')];this[_0xa633('0x9')][_0xcff77['uniqueid']]['connectedlinename']=_0xcff77[_0xa633('0x32')];this['channels'][_0xcff77[_0xa633('0x1c')]][_0xa633('0x33')]=moment()[_0xa633('0x34')](_0xa633('0x1e'));this[_0xa633('0x9')][_0xcff77['uniqueid']][_0xa633('0x35')]=_0xa633('0x36');logger[_0xa633('0x37')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0xcff77[_0xa633('0x1c')],_0xcff77[_0xa633('0x20')]['substring'](_0xcff77[_0xa633('0x20')][_0xa633('0x22')]('/')+0x1,_0xcff77['channel'][_0xa633('0x22')]('-')));logger[_0xa633('0x1a')](_0xa633('0x38'),_0xcff77['uniqueid'],util[_0xa633('0x29')](this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa633('0x18')](_0xa633('0x39'),this['channels'][_0xcff77[_0xa633('0x1c')]]);}logger[_0xa633('0x1a')](_0xa633('0x3a'),_0xcff77[_0xa633('0x1c')],util[_0xa633('0x29')](this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xa633('0x2b'),this[_0xa633('0x9')][_0xcff77[_0xa633('0x1c')]]);}}}catch(_0x408f43){logger[_0xa633('0x2e')](_0xa633('0x3b'),_0xcff77['uniqueid'],util[_0xa633('0x29')](_0x408f43,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa633('0x16')][_0xa633('0x3c')]=function(_0x1c26b4){try{if(this[_0xa633('0x19')](_0x1c26b4)){logger[_0xa633('0x1a')](_0xa633('0x3d'),_0x1c26b4[_0xa633('0x1c')],util[_0xa633('0x29')](_0x1c26b4,{'showHidden':![],'depth':null}));this['addVariable'](_0x1c26b4['uniqueid'],_[_0xa633('0x3e')](_0x1c26b4[_0xa633('0x3f')])[0x0],_0x1c26b4[_0xa633('0x40')]);if(this['isNotNull'](_0x1c26b4[_0xa633('0x3f')])&&this[_0xa633('0x19')](_0x1c26b4[_0xa633('0x3f')][_0xa633('0x41')])){if(_['isUndefined'](this['channels'][_0x1c26b4['uniqueid']])){this[_0xa633('0x9')][_0x1c26b4[_0xa633('0x1c')]]={'routeId':_0x1c26b4['value'],'variables':this[_0xa633('0xc')][_0x1c26b4['uniqueid']],'motionChannel':'voice'};logger[_0xa633('0x37')](_0xa633('0x42'),_0x1c26b4[_0xa633('0x1c')],_0x1c26b4['variable'][_0xa633('0x41')],_[_0xa633('0x3e')](_0x1c26b4[_0xa633('0x3f')])[0x0],_0x1c26b4['value']);logger['debug'](_0xa633('0x43'),_0x1c26b4[_0xa633('0x1c')],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x1c26b4[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa633('0x18')](_0xa633('0x2a'),_0xa633('0x2b'),this[_0xa633('0x9')][_0x1c26b4[_0xa633('0x1c')]]);}}}}catch(_0x351101){logger['error'](_0xa633('0x44'),_0x1c26b4[_0xa633('0x1c')],util[_0xa633('0x29')](_0x351101,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa633('0x16')]['addVariable']=function(_0x3905c2,_0x4371c0,_0x5f4b65){var _0xff78e7=[_0xa633('0x45'),'rtpaudioqosbridged',_0xa633('0x46'),_0xa633('0x47'),_0xa633('0x48'),_0xa633('0x49'),'rtpaudioqosrtt',_0xa633('0x4a'),_0xa633('0x4b'),'sipuri',_0xa633('0x4c'),_0xa633('0x4d'),_0xa633('0x4e'),_0xa633('0x4f'),_0xa633('0x50'),_0xa633('0x51'),_0xa633('0x27'),'memberpenalty','memberrealtime'];if(!_[_0xa633('0x52')](_0x4371c0)&&!_[_0xa633('0x53')](_0xff78e7,_0x4371c0)){if(_[_0xa633('0x17')](this[_0xa633('0xc')][_0x3905c2])){this['variables'][_0x3905c2]={};}this[_0xa633('0xc')][_0x3905c2][_0x4371c0]=_0x5f4b65;}};VoiceDialReport[_0xa633('0x16')][_0xa633('0x15')]=function(_0x3b6f0c){try{if(this['isNotNull'](_0x3b6f0c)){logger[_0xa633('0x1a')](_0xa633('0x54'),_0x3b6f0c[_0xa633('0x1c')],util['inspect'](_0x3b6f0c,{'showHidden':![],'depth':null}));if(this[_0xa633('0x9')][_0x3b6f0c['uniqueid']]){logger[_0xa633('0x37')](_0xa633('0x55'),_0x3b6f0c['uniqueid'],_0x3b6f0c['cause-txt']);this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x56')]=moment()['format'](_0xa633('0x1e'));this['channels'][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x57')]=moment(this[_0xa633('0x9')][_0x3b6f0c['uniqueid']][_0xa633('0x56')])['diff'](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x58')],'seconds');this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]]['lastevent']=_0xa633('0x59');this['outbound'][_0xa633('0x5a')]+=0x1;if(this[_0xa633('0x9')][_0x3b6f0c['uniqueid']][_0xa633('0x33')]){this['outbound'][_0xa633('0x5b')]+=0x1;this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x5c')]=moment(this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x33')])[_0xa633('0x5d')](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]]['starttime'],'seconds');this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x5e')]=moment(this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x56')])['diff'](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x33')],_0xa633('0x5f'));this[_0xa633('0xa')][_0xa633('0x60')]+=this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]][_0xa633('0x5c')]||0x0;this['outbound'][_0xa633('0x61')]+=this['channels'][_0x3b6f0c[_0xa633('0x1c')]]['billableseconds'];}this['outbound'][_0xa633('0x62')]+=this[_0xa633('0x9')][_0x3b6f0c['uniqueid']][_0xa633('0x57')];logger[_0xa633('0x1a')](_0xa633('0x63'),_0x3b6f0c[_0xa633('0x1c')],util[_0xa633('0x29')](this['channels'][_0x3b6f0c[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa633('0x18')](_0xa633('0x64'),this[_0xa633('0x9')][_0x3b6f0c['uniqueid']]);logger[_0xa633('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x3b6f0c['uniqueid'],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xa633('0x18')](_0xa633('0x65'),this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]]);logger['debug'](_0xa633('0x66'),_0x3b6f0c['uniqueid'],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]],{'showHidden':![],'depth':null}));this[_0xa633('0x18')]('voice:outbound',_0xa633('0x67'),this[_0xa633('0xa')]);logger[_0xa633('0x37')](_0xa633('0x68'),JSON['stringify'](this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x1c')]]));logger['debug'](_0xa633('0x69'),_0x3b6f0c[_0xa633('0x1c')],util[_0xa633('0x29')](this[_0xa633('0x9')][_0x3b6f0c['uniqueid']],{'showHidden':![],'depth':null}));this[_0xa633('0x18')](_0xa633('0x2a'),'voice_outbound_channel:remove',this[_0xa633('0x9')][_0x3b6f0c['uniqueid']]);delete this['channels'][_0x3b6f0c[_0xa633('0x1c')]];}else if(this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x6a')]]){this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x6a')]][_0xa633('0x1c')]=this[_0xa633('0x9')][_0x3b6f0c[_0xa633('0x6a')]][_0xa633('0x6b')];}if(this[_0xa633('0xc')][_0x3b6f0c['uniqueid']]){delete this[_0xa633('0xc')][_0x3b6f0c['uniqueid']];}}}catch(_0x1ce2f6){logger[_0xa633('0x2e')]('[%s][voiceDialReport][hangup]',_0x3b6f0c[_0xa633('0x1c')],util['inspect'](_0x1ce2f6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xa633('0x16')][_0xa633('0x14')]=function(_0x4447d8){try{if(this[_0xa633('0x19')](_0x4447d8)){logger['debug'](_0xa633('0x6c'),_0x4447d8[_0xa633('0x1c')],util[_0xa633('0x29')](_0x4447d8,{'showHidden':![],'depth':null}));if(_0x4447d8[_0xa633('0x6d')][_0xa633('0x6e')]()===_0xa633('0x6f')){_0x4447d8[_0xa633('0x70')]=(_0x4447d8[_0xa633('0x71')]||_0x4447d8[_0xa633('0x70')])[_0xa633('0x6e')]();if(_[_0xa633('0x72')](_0x4447d8['applicationdata'],'cdr(')){if(_[_0xa633('0x17')](this[_0xa633('0xb')][_0x4447d8[_0xa633('0x1c')]]))this[_0xa633('0xb')][_0x4447d8[_0xa633('0x1c')]]={};logger[_0xa633('0x37')](_0xa633('0x73'),_0x4447d8[_0xa633('0x1c')],_0x4447d8[_0xa633('0x6d')],_0x4447d8['applicationdata']);var _0x12fb59=_0x4447d8[_0xa633('0x70')]['split']('=');var _0x49bd88=_0x12fb59[0x0][_0xa633('0x74')](/cdr\((.*)\)/);if(_0x49bd88)this[_0xa633('0xb')][_0x4447d8[_0xa633('0x1c')]][_0x49bd88[0x1]]=_0x12fb59[0x1];}}}}catch(_0x3c89b2){logger[_0xa633('0x2e')](_0xa633('0x75'),_0x4447d8['uniqueid'],util[_0xa633('0x29')](_0x3c89b2,{'showHidden':![],'depth':null}));}};module[_0xa633('0x76')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index da02f06..d436942 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 _0x6f0d=['countBy','callers','waiting','toNumber','loggedin','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','originalposition','queuecallerabandon','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerleave]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','holdtime','queuecallerexit','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','linkedid','queuecallerexitAt','add','FORWARDTRANSFER','FORWARD','transferuniqueid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','includes','isUndefined','[%s][voiceQueueReport][hangup]','length','abandoned','seconds','milliseconds','diff','total','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','appdata','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','util','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','newexten','musiconholdstart','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','status','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','queueReports','[%s][voiceQueueReport][checkQueueReport]','inspect','clearQueueReport','clearqueuereport','emit','debug','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','Trunk','active','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','loopQueueShow','queues','[voiceQueueReport][queues]','then','queue','info','[voiceQueueReport][queuesummary]\x20name:%s'];(function(_0x13a675,_0x33a537){var _0xbd2500=function(_0x1bcaa4){while(--_0x1bcaa4){_0x13a675['push'](_0x13a675['shift']());}};_0xbd2500(++_0x33a537);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x22d623,_0x34de81){_0x22d623=_0x22d623-0x0;var _0x2b0105=_0x6f0d[_0x22d623];return _0x2b0105;};'use strict';var _=require('lodash');var moment=require(_0xd6f0('0x0'));var util=require(_0xd6f0('0x1'));var md5=require(_0xd6f0('0x2'));var Redis=require(_0xd6f0('0x3'));var config=require('../../../config/environment');var logger=require(_0xd6f0('0x4'))(_0xd6f0('0x5'));var ami=require(_0xd6f0('0x6'));var QueueReport=require(_0xd6f0('0x7'));config[_0xd6f0('0x8')]=_['defaults'](config[_0xd6f0('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f0('0x9'))(new Redis(config[_0xd6f0('0x8')]));var Sequence=function(){};Sequence[_0xd6f0('0xa')][_0xd6f0('0xb')]=function(_0x4c4916){this['tail']=this[_0xd6f0('0xc')]?this[_0xd6f0('0xc')][_0xd6f0('0xd')](_0x4c4916):_0x4c4916();};function VoiceQueueReport(_0x382a2e){this[_0xd6f0('0xe')]=new Sequence();this['queueReports']={};this[_0xd6f0('0xf')]=_0x382a2e[_0xd6f0('0xf')];this[_0xd6f0('0x10')]=_0x382a2e[_0xd6f0('0x11')];this['voiceQueues']=_0x382a2e[_0xd6f0('0x12')];this[_0xd6f0('0x13')]=!![];this[_0xd6f0('0x14')]=_0x382a2e[_0xd6f0('0x14')];this[_0xd6f0('0x15')]={};ami['on'](_0xd6f0('0x16'),this[_0xd6f0('0x17')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x19'),this['syncQueueSummaryComplete'][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x1a'),this['syncQueueCallerJoin'][_0xd6f0('0x18')](this));ami['on']('queuecallerabandon',this[_0xd6f0('0x1b')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x1c'),this[_0xd6f0('0x1d')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x1e'),this[_0xd6f0('0x1f')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x20'),this[_0xd6f0('0x21')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x22'),this[_0xd6f0('0x23')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x24'),this[_0xd6f0('0x25')]['bind'](this));ami['on']('fullybooted',this[_0xd6f0('0x26')][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x27'),this['syncNewExten'][_0xd6f0('0x18')](this));ami['on'](_0xd6f0('0x28'),this['syncMusicOnHoldStart'][_0xd6f0('0x18')](this));ami['on']('musiconholdstop',this[_0xd6f0('0x29')][_0xd6f0('0x18')](this));ami['on']('attendedtransfer',this[_0xd6f0('0x2a')][_0xd6f0('0x18')](this));ami['on']('blindtransfer',this[_0xd6f0('0x2b')][_0xd6f0('0x18')](this));this[_0xd6f0('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x2ca8bb){if(!_[_0xd6f0('0x2d')](_0x2ca8bb)){for(var _0x5ecb16 in _0x2ca8bb){if(_0x2ca8bb[_0xd6f0('0x2e')](_0x5ecb16)){delete _0x2ca8bb[_0x5ecb16];}}}}function clearCampaigns(_0x551be8){if(!_[_0xd6f0('0x2d')](_0x551be8)){for(var _0x3fb5c3 in _0x551be8){if(_0x551be8[_0xd6f0('0x2e')](_0x3fb5c3)){_0x551be8[_0x3fb5c3][_0xd6f0('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x4101bd){if(!_[_0xd6f0('0x2d')](_0x4101bd)){for(var _0x12d6ec in _0x4101bd){if(_0x4101bd[_0xd6f0('0x2e')](_0x12d6ec)){_0x4101bd[_0x12d6ec]['originated']=0x0;_0x4101bd[_0x12d6ec][_0xd6f0('0x30')]=0x0;_0x4101bd[_0x12d6ec][_0xd6f0('0x31')]=0x0;_0x4101bd[_0x12d6ec]['waiting']=0x0;_0x4101bd[_0x12d6ec][_0xd6f0('0x32')]=!![];}}}}function clearAgentBooked(_0x385947){if(!_[_0xd6f0('0x2d')](_0x385947)){for(var _0xb61222 in _0x385947){if(_0x385947[_0xd6f0('0x2e')](_0xb61222)){_0x385947[_0xb61222][_0xd6f0('0x33')]=!![];}}}}VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x34')]=function(){var _0x465cf9=this;for(var _0x43f72f in this[_0xd6f0('0x10')]){if(this[_0xd6f0('0x10')][_0xd6f0('0x2e')](_0x43f72f)&&!this[_0xd6f0('0x10')][_0x43f72f][_0xd6f0('0x35')]){this[_0xd6f0('0xe')][_0xd6f0('0xb')](function(){if(!_[_0xd6f0('0x36')](_0x465cf9[_0xd6f0('0x10')][_0x43f72f])){return ami[_0xd6f0('0x37')]({'action':_0xd6f0('0x38'),'channel':_0x465cf9[_0xd6f0('0x10')][_0x43f72f]['channel']})[_0xd6f0('0x39')](function(_0x4ed523){if(_0x4ed523['message']===_0xd6f0('0x3a')){setTimeout(function(){if(_0x465cf9[_0xd6f0('0x10')][_0x43f72f]){delete _0x465cf9[_0xd6f0('0x10')][_0x43f72f];logger[_0xd6f0('0x3b')](_0xd6f0('0x3c'),_0x43f72f,util['inspect'](_0x4ed523,{'showHidden':![],'depth':null}));}if(_0x465cf9[_0xd6f0('0x3d')][_0x43f72f]){delete _0x465cf9['queueReports'][_0x43f72f];logger[_0xd6f0('0x3b')](_0xd6f0('0x3e'),_0x43f72f,util[_0xd6f0('0x3f')](_0x4ed523,{'showHidden':![],'depth':null}));}if(_0x465cf9[_0xd6f0('0x15')][_0x43f72f]){delete _0x465cf9[_0xd6f0('0x15')][_0x43f72f];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x43f72f,util[_0xd6f0('0x3f')](_0x4ed523,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xd6f0('0xa')]['syncFullyBooted']=function(){logger[_0xd6f0('0x3b')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xd6f0('0x10')]);this[_0xd6f0('0x40')](this[_0xd6f0('0x3d')]);clearAgentBooked(this[_0xd6f0('0xf')]);clearVoiceQueues(this[_0xd6f0('0x12')]);clearCampaigns(this[_0xd6f0('0x14')]);};VoiceQueueReport[_0xd6f0('0xa')]['clearQueueReport']=function(_0x52203d){var _0x162537=this;if(!_[_0xd6f0('0x2d')](_0x52203d)){for(var _0x302d81 in _0x52203d){if(_0x52203d['hasOwnProperty'](_0x302d81)){_0x162537['emitVoiceQueueChannelRemove'](_0x52203d[_0x302d81],_0xd6f0('0x41'));delete _0x52203d[_0x302d81];}}}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x42')]=function(_0x38d06f,_0x2e3225,_0x2b5df5){io['to'](_0x38d06f)[_0xd6f0('0x42')](_0x2e3225,_0x2b5df5);};VoiceQueueReport[_0xd6f0('0xa')]['emitVoiceQueueChannelSave']=function(_0x1af620,_0x469753){logger[_0xd6f0('0x43')](_0xd6f0('0x44')+_0x469753+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1af620[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x1af620,{'showHidden':![],'depth':null}));this[_0xd6f0('0x42')](util[_0xd6f0('0x46')](_0xd6f0('0x47'),_0x1af620['name']),_0xd6f0('0x48'),_0x1af620);io[_0xd6f0('0x42')](_0xd6f0('0x49'),_0x1af620);};VoiceQueueReport['prototype'][_0xd6f0('0x4a')]=function(_0x1ddc40,_0x4b8cc7){logger['debug'](_0xd6f0('0x44')+_0x4b8cc7+_0xd6f0('0x4b'),_0x1ddc40[_0xd6f0('0x45')],util['inspect'](_0x1ddc40,{'showHidden':![],'depth':null}));this[_0xd6f0('0x42')](util[_0xd6f0('0x46')]('voice:queue:%s',_0x1ddc40[_0xd6f0('0x4c')]),_0xd6f0('0x4d'),_0x1ddc40);io[_0xd6f0('0x42')](_0xd6f0('0x4e'),_0x1ddc40);};VoiceQueueReport['prototype'][_0xd6f0('0x4f')]=function(_0x3d547b,_0x37ab6c){if(_0x3d547b[_0xd6f0('0x50')]===_0xd6f0('0x51')){var _0x1ec73c={'id':_0x3d547b['id'],'name':_0x3d547b[_0xd6f0('0x4c')],'strategy':_0x3d547b[_0xd6f0('0x52')],'answered':_0x3d547b['answered'],'available':_0x3d547b[_0xd6f0('0x53')],'loggedIn':_0x3d547b[_0xd6f0('0x54')],'pTalking':_0x3d547b['pTalking'],'sumBillable':_0x3d547b[_0xd6f0('0x55')],'sumDuration':_0x3d547b[_0xd6f0('0x56')],'sumHoldTime':_0x3d547b[_0xd6f0('0x57')]||0x0,'talking':_0x3d547b[_0xd6f0('0x30')],'total':_0x3d547b['total'],'type':_0x3d547b[_0xd6f0('0x50')],'unmanaged':_0x3d547b[_0xd6f0('0x58')],'abandoned':_0x3d547b['abandoned'],'waiting':_0x3d547b['waiting']};if(_0x3d547b[_0xd6f0('0x59')]){_0x1ec73c['Trunk']={'id':_0x3d547b[_0xd6f0('0x59')]['id'],'name':_0x3d547b[_0xd6f0('0x59')][_0xd6f0('0x4c')],'active':_0x3d547b['Trunk'][_0xd6f0('0x5a')],'callerid':_0x3d547b[_0xd6f0('0x59')][_0xd6f0('0x5b')]};}if(_0x3d547b[_0xd6f0('0x5c')]){_0x1ec73c[_0xd6f0('0x5c')]={'id':_0x3d547b['Interval']['id'],'name':_0x3d547b[_0xd6f0('0x5c')]['name']};}var _0x416a94=md5(JSON[_0xd6f0('0x5d')](_0x1ec73c));if(_0x3d547b[_0xd6f0('0x2')]!==_0x416a94){_0x3d547b[_0xd6f0('0x2')]=_0x416a94;logger['debug']('[voiceQueueReport]['+_0x37ab6c+_0xd6f0('0x5e'),util[_0xd6f0('0x3f')](_0x1ec73c,{'showHidden':![],'depth':null}));this['emit'](util[_0xd6f0('0x46')]('voice:queue:%s',_0x1ec73c[_0xd6f0('0x4c')]),_0xd6f0('0x5f'),_0x1ec73c);}}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x60')]=function(_0x30082c){return _0x30082c!==null&&!_['isUndefined'](_0x30082c);};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x61')]=function(){var _0x3f9d29=this;setInterval(function(){_0x3f9d29[_0xd6f0('0x34')]();ami[_0xd6f0('0x37')]({'action':_0xd6f0('0x62')})[_0xd6f0('0x39')](function(_0x152ef1){logger['error'](_0xd6f0('0x63'),util[_0xd6f0('0x3f')](_0x152ef1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x2c')]=function(){var _0x444b4f=this;setInterval(function(){if(_0x444b4f[_0xd6f0('0x13')]){return ami[_0xd6f0('0x37')]({'action':_0xd6f0('0x16')})[_0xd6f0('0x64')](function(_0x5216d8){_0x444b4f[_0xd6f0('0x13')]=![];})['catch'](function(_0x5505fd){logger[_0xd6f0('0x3b')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x5505fd,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x17')]=function(_0x8c6f9c){try{if(this['isNotNull'](_0x8c6f9c)&&this[_0xd6f0('0x60')](_0x8c6f9c[_0xd6f0('0x65')])){logger[_0xd6f0('0x43')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xd6f0('0x3f')](_0x8c6f9c,{'showHidden':![],'depth':null}));if(this[_0xd6f0('0x12')][_0x8c6f9c['queue']]){logger[_0xd6f0('0x66')](_0xd6f0('0x67'),_0x8c6f9c['queue']);var _0x3558ac=_[_0xd6f0('0x68')](this[_0xd6f0('0x10')],_0xd6f0('0x65'))[_0x8c6f9c[_0xd6f0('0x65')]]||0x0;var _0x48bfb3=_0x3558ac-_0x8c6f9c[_0xd6f0('0x69')];if(this[_0xd6f0('0x12')][_0x8c6f9c['queue']][_0xd6f0('0x6a')]!==_[_0xd6f0('0x6b')](_0x8c6f9c[_0xd6f0('0x69')])||this['voiceQueues'][_0x8c6f9c[_0xd6f0('0x65')]]['loggedIn']!==_['toNumber'](_0x8c6f9c['loggedin'])||this['voiceQueues'][_0x8c6f9c[_0xd6f0('0x65')]][_0xd6f0('0x53')]!==_[_0xd6f0('0x6b')](_0x8c6f9c[_0xd6f0('0x53')])||this['voiceQueues'][_0x8c6f9c[_0xd6f0('0x65')]]['talking']!==_0x48bfb3){this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]][_0xd6f0('0x6a')]=_['toNumber'](_0x8c6f9c[_0xd6f0('0x69')]);this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]][_0xd6f0('0x54')]=_['toNumber'](_0x8c6f9c[_0xd6f0('0x6c')]);this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]]['available']=_[_0xd6f0('0x6b')](_0x8c6f9c[_0xd6f0('0x53')]);this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]]['talking']=_0x48bfb3>0x0?_0x48bfb3:0x0;this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]][_0xd6f0('0x30')]=this[_0xd6f0('0x12')][_0x8c6f9c['queue']]['talking']>_['toNumber'](_0x8c6f9c['loggedin'])?_[_0xd6f0('0x6b')](_0x8c6f9c[_0xd6f0('0x6c')]):this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]][_0xd6f0('0x30')];this[_0xd6f0('0x4f')](this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]],_0xd6f0('0x16'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xd6f0('0x3f')](this['voiceQueues'][_0x8c6f9c[_0xd6f0('0x65')]],{'showHidden':![],'depth':null}));ami[_0xd6f0('0x42')](_0xd6f0('0x6d'),this[_0xd6f0('0x12')][_0x8c6f9c[_0xd6f0('0x65')]]);}}}catch(_0x407d7){logger[_0xd6f0('0x3b')]('[voiceQueueReport][queuesummary]',util[_0xd6f0('0x3f')](_0x407d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x6e')]=function(_0x5b687f){logger[_0xd6f0('0x43')](_0xd6f0('0x6f'),util['inspect'](_0x5b687f,{'showHidden':![],'depth':null}));this[_0xd6f0('0x13')]=!![];};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x70')]=function(_0x3930f4){try{if(this[_0xd6f0('0x60')](_0x3930f4)){logger[_0xd6f0('0x43')](_0xd6f0('0x71'),_0x3930f4[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x3930f4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd6f0('0x3d')][_0x3930f4[_0xd6f0('0x45')]]))this[_0xd6f0('0x3d')][_0x3930f4[_0xd6f0('0x45')]]=[];if(_['isUndefined'](this[_0xd6f0('0x10')][_0x3930f4[_0xd6f0('0x45')]]))this[_0xd6f0('0x10')][_0x3930f4[_0xd6f0('0x45')]]={};var _0x2c66fd=new QueueReport();_0x2c66fd[_0xd6f0('0x4c')]=_0x3930f4[_0xd6f0('0x65')];_0x2c66fd[_0xd6f0('0x50')]=this[_0xd6f0('0x12')][_0x2c66fd[_0xd6f0('0x4c')]]&&this['voiceQueues'][_0x2c66fd[_0xd6f0('0x4c')]][_0xd6f0('0x50')]?this[_0xd6f0('0x12')][_0x2c66fd['name']][_0xd6f0('0x50')]||_0xd6f0('0x51'):_0xd6f0('0x51');_0x2c66fd[_0xd6f0('0x65')]=_0x3930f4[_0xd6f0('0x65')];_0x2c66fd[_0xd6f0('0x72')]=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));_0x2c66fd[_0xd6f0('0x74')]=_0x3930f4[_0xd6f0('0x74')];_0x2c66fd[_0xd6f0('0x75')]=_0x3930f4['count'];_0x2c66fd['uniqueid']=_0x3930f4[_0xd6f0('0x45')];_0x2c66fd[_0xd6f0('0x76')]=this[_0xd6f0('0x10')][_0x3930f4[_0xd6f0('0x45')]][_0xd6f0('0x76')];logger['info'](_0xd6f0('0x77'),_0x2c66fd[_0xd6f0('0x4c')],_0x2c66fd['type']);_[_0xd6f0('0x78')](_0x2c66fd,_['pick'](_0x3930f4,_[_0xd6f0('0x79')](_0x2c66fd)));this[_0xd6f0('0x3d')][_0x3930f4[_0xd6f0('0x45')]][_0xd6f0('0x7a')](_0x2c66fd);this[_0xd6f0('0x10')][_0x3930f4['uniqueid']]=_0x2c66fd;this['emitVoiceQueueChannelSave'](_0x2c66fd,_0xd6f0('0x1a'));}}catch(_0x17b320){logger['error'](_0xd6f0('0x71'),_0x3930f4['uniqueid'],util['inspect'](_0x17b320,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')]['syncQueueCallerAbandon']=function(_0x5dc1c7){try{if(this['isNotNull'](_0x5dc1c7)){logger['debug'](_0xd6f0('0x7b'),_0x5dc1c7[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x5dc1c7,{'showHidden':![],'depth':null}));if(this[_0xd6f0('0x3d')][_0x5dc1c7[_0xd6f0('0x45')]]){var _0x2258a6=_[_0xd6f0('0x7c')](this[_0xd6f0('0x3d')][_0x5dc1c7[_0xd6f0('0x45')]]);_0x2258a6['queuecallercomplete']=![];_0x2258a6[_0xd6f0('0x7d')]=null;_0x2258a6['holdtime']=_0x5dc1c7['holdtime'];_0x2258a6[_0xd6f0('0x7e')]=_0x5dc1c7[_0xd6f0('0x7e')];_0x2258a6[_0xd6f0('0x7f')]=!![];_0x2258a6['queuecallerabandonAt']=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));_0x2258a6[_0xd6f0('0x80')]=_0xd6f0('0x81');_0x2258a6[_0xd6f0('0x82')]=null;logger[_0xd6f0('0x66')](_0xd6f0('0x83'),_0x2258a6[_0xd6f0('0x4c')],_0x2258a6['type']);this[_0xd6f0('0x10')][_0x5dc1c7[_0xd6f0('0x45')]]=_0x2258a6;this['emitVoiceQueueChannelRemove'](_0x2258a6,_0xd6f0('0x7f'));}}}catch(_0x1a5b6b){logger[_0xd6f0('0x3b')](_0xd6f0('0x7b'),_0x5dc1c7[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x1a5b6b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')]['syncQueueCallerLeave']=function(_0x2de847){try{if(this[_0xd6f0('0x60')](_0x2de847)){logger[_0xd6f0('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x2de847['uniqueid'],util['inspect'](_0x2de847,{'showHidden':![],'depth':null}));if(this[_0xd6f0('0x3d')][_0x2de847[_0xd6f0('0x45')]]){var _0x2fdd59=_[_0xd6f0('0x7c')](this[_0xd6f0('0x3d')][_0x2de847[_0xd6f0('0x45')]]);_0x2fdd59['queuecallerleaveAt']=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));_0x2fdd59[_0xd6f0('0x84')]=_0x2de847[_0xd6f0('0x84')];_0x2fdd59['connectedlinename']=_0x2de847[_0xd6f0('0x85')];logger['info'](_0xd6f0('0x86'),_0x2fdd59['name'],_0x2fdd59[_0xd6f0('0x50')],_0x2de847[_0xd6f0('0x84')],_0x2de847['connectedlinename']);this[_0xd6f0('0x10')][_0x2de847[_0xd6f0('0x45')]]=_0x2fdd59;this[_0xd6f0('0x87')](_0x2fdd59,_0xd6f0('0x1c'));}}}catch(_0x32bc20){logger[_0xd6f0('0x3b')](_0xd6f0('0x88'),_0x2de847[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x32bc20,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x21')]=function(_0x10a9bf){try{if(this[_0xd6f0('0x60')](_0x10a9bf)){logger[_0xd6f0('0x43')]('[%s][voiceQueueReport][agentconnect]',_0x10a9bf[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x10a9bf,{'showHidden':![],'depth':null}));if(this[_0xd6f0('0x3d')][_0x10a9bf[_0xd6f0('0x45')]]){var _0x31b628=_[_0xd6f0('0x7c')](this[_0xd6f0('0x3d')][_0x10a9bf[_0xd6f0('0x45')]]);_0x31b628[_0xd6f0('0x89')]=!![];_0x31b628[_0xd6f0('0x80')]=_0xd6f0('0x8a');logger[_0xd6f0('0x66')](_0xd6f0('0x8b'),_0x31b628[_0xd6f0('0x4c')],_0x31b628['type']);}}}catch(_0x4da4c7){logger[_0xd6f0('0x3b')](_0xd6f0('0x8c'),_0x10a9bf[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x4da4c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')]['syncAgentComplete']=function(_0x203ecc){try{if(this[_0xd6f0('0x60')](_0x203ecc)){logger[_0xd6f0('0x43')](_0xd6f0('0x8d'),_0x203ecc['uniqueid'],util[_0xd6f0('0x3f')](_0x203ecc,{'showHidden':![],'depth':null}));if(this[_0xd6f0('0x3d')][_0x203ecc[_0xd6f0('0x45')]]){var _0x68c45a=_[_0xd6f0('0x7c')](this[_0xd6f0('0x3d')][_0x203ecc['uniqueid']]);_0x68c45a['queuecallerabandon']=![];_0x68c45a[_0xd6f0('0x8e')]=null;_0x68c45a['assigned']=!![];_0x68c45a[_0xd6f0('0x82')]=_0x203ecc['membername'];_0x68c45a[_0xd6f0('0x8f')]=_0x203ecc[_0xd6f0('0x8f')];_0x68c45a['queuecallercomplete']=!![];_0x68c45a[_0xd6f0('0x90')]=![];_0x68c45a['queuecallerexitAt']=null;if(!_0x68c45a[_0xd6f0('0x91')]){if(_0x203ecc[_0xd6f0('0x92')]==_0xd6f0('0x91')){_0x68c45a[_0xd6f0('0x80')]='COMPLETED';logger[_0xd6f0('0x66')](_0xd6f0('0x93'),_0x68c45a[_0xd6f0('0x4c')],_0x68c45a['type']);}else{if(_[_0xd6f0('0x94')](_0x203ecc[_0xd6f0('0x95')][_0xd6f0('0x96')](),'local/')){if(this['queueReports'][_0x203ecc[_0xd6f0('0x97')]]){var _0x22c3fa=_[_0xd6f0('0x7c')](this['queueReports'][_0x203ecc[_0xd6f0('0x97')]]);_0x22c3fa[_0xd6f0('0x89')]=![];_0x22c3fa[_0xd6f0('0x90')]=!![];_0x22c3fa[_0xd6f0('0x98')]=moment(_0x68c45a[_0xd6f0('0x72')])[_0xd6f0('0x99')](_0x203ecc[_0xd6f0('0x8f')],'seconds')[_0xd6f0('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x22c3fa[_0xd6f0('0x80')]=_0xd6f0('0x9a');_0x22c3fa[_0xd6f0('0x91')]=!![];_0x22c3fa['transfertype']=_0xd6f0('0x9b');_0x22c3fa['transferexten']=_0x203ecc['destexten'];_0x22c3fa[_0xd6f0('0x9c')]=_0x203ecc[_0xd6f0('0x45')];logger[_0xd6f0('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x22c3fa[_0xd6f0('0x4c')],_0x22c3fa['type']);var _0x51e28a=this[_0xd6f0('0x3d')][_0x203ecc[_0xd6f0('0x97')]];this[_0xd6f0('0x3d')][_0x203ecc[_0xd6f0('0x97')]]=this[_0xd6f0('0x3d')][_0x203ecc[_0xd6f0('0x45')]];this['queueReports'][_0x203ecc[_0xd6f0('0x45')]]=_0x51e28a;}}else{_0x68c45a['queuecallerexitreason']=_0xd6f0('0x9d')+_0x203ecc['reason'][_0xd6f0('0x9e')]();logger[_0xd6f0('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x68c45a[_0xd6f0('0x4c')],_0x68c45a[_0xd6f0('0x50')],_0x68c45a[_0xd6f0('0x80')]);}}}this[_0xd6f0('0x10')][_0x203ecc[_0xd6f0('0x45')]]=_0x68c45a;this[_0xd6f0('0x4a')](_0x68c45a,_0xd6f0('0x1e'));}}}catch(_0x2488e5){logger['error'](_0xd6f0('0x8d'),_0x203ecc[_0xd6f0('0x45')],util['inspect'](_0x2488e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')]['syncVarSet']=function(_0x1f980f){try{if(this[_0xd6f0('0x60')](_0x1f980f)){logger[_0xd6f0('0x43')](_0xd6f0('0x9f'),_0x1f980f['uniqueid'],util['inspect'](_0x1f980f,{'showHidden':![],'depth':null}));this[_0xd6f0('0xa0')](_0x1f980f[_0xd6f0('0x45')],_[_0xd6f0('0x79')](_0x1f980f[_0xd6f0('0xa1')])[0x0],_0x1f980f[_0xd6f0('0xa2')]);if(this[_0xd6f0('0x3d')][_0x1f980f[_0xd6f0('0x45')]]){var _0x563c11=_[_0xd6f0('0x7c')](this[_0xd6f0('0x3d')][_0x1f980f[_0xd6f0('0x45')]]);if(_0x563c11){if(this[_0xd6f0('0x60')](_0x1f980f['variable'])&&this[_0xd6f0('0x60')](_0x1f980f['variable']['queuestatus'])){switch(_0x1f980f[_0xd6f0('0xa2')]){case'CONTINUE':_0x563c11[_0xd6f0('0x90')]=![];_0x563c11[_0xd6f0('0x98')]=null;break;case _0xd6f0('0xa3'):_0x563c11[_0xd6f0('0xa4')]=_0xd6f0('0xa5');_0x563c11[_0xd6f0('0x90')]=!![];_0x563c11[_0xd6f0('0x98')]=moment()['format'](_0xd6f0('0x73'));_0x563c11[_0xd6f0('0xa6')]=moment()[_0xd6f0('0x46')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xd6f0('0x43')](_0xd6f0('0xa7'),_0x1f980f[_0xd6f0('0x45')],util[_0xd6f0('0x3f')](_0x563c11,{'showHidden':![],'depth':null}));ami['emit'](_0xd6f0('0xa8'),_0x563c11);break;default:_0x563c11['queuecallerexit']=!![];_0x563c11[_0xd6f0('0x98')]=moment()['format'](_0xd6f0('0x73'));_0x563c11[_0xd6f0('0xa6')]=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));}_0x563c11[_0xd6f0('0x7f')]=![];_0x563c11[_0xd6f0('0x8e')]=null;_0x563c11[_0xd6f0('0x80')]=_0x1f980f['value'];this['channels'][_0x1f980f[_0xd6f0('0x45')]]=_0x563c11;this['emitVoiceQueueChannelRemove'](_0x563c11,_0xd6f0('0x22'));}else if(this[_0xd6f0('0x60')](_0x1f980f[_0xd6f0('0xa1')])&&this[_0xd6f0('0x60')](_0x1f980f[_0xd6f0('0xa1')][_0xd6f0('0xa9')])){if(!_0x563c11[_0xd6f0('0x7f')]){_0x563c11[_0xd6f0('0x90')]=!![];_0x563c11[_0xd6f0('0x98')]=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));_0x563c11['queuecallerexitreason']=_0xd6f0('0xaa');_0x563c11['queuecallerleaveAt']=moment()[_0xd6f0('0x46')](_0xd6f0('0x73'));this['channels'][_0x1f980f[_0xd6f0('0x45')]]=_0x563c11;}}logger[_0xd6f0('0x66')](_0xd6f0('0xab'),_0x1f980f[_0xd6f0('0x45')],_0x563c11[_0xd6f0('0x4c')],_0x563c11[_0xd6f0('0x50')],_[_0xd6f0('0x79')](_0x1f980f[_0xd6f0('0xa1')])[0x0],_0x1f980f[_0xd6f0('0xa2')]);_0x563c11['variables']=this[_0xd6f0('0x15')][_0x1f980f[_0xd6f0('0x45')]];}}}}catch(_0x5149cb){logger[_0xd6f0('0x3b')]('[%s][voiceQueueReport][varset]',_0x1f980f['uniqueid'],util['inspect'](_0x5149cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0xa0')]=function(_0x4a3561,_0x18e364,_0x387a9c){var _0x3fb73f=[_0xd6f0('0xac'),_0xd6f0('0xad'),_0xd6f0('0xae'),_0xd6f0('0xaf'),_0xd6f0('0xb0'),'rtpaudioqoslossbridged',_0xd6f0('0xb1'),_0xd6f0('0xb2'),'sipcallid',_0xd6f0('0xb3'),'bridgepeer',_0xd6f0('0xb4'),_0xd6f0('0xb5'),_0xd6f0('0xb6'),_0xd6f0('0xb7'),'memberlastcall',_0xd6f0('0xb8'),'memberpenalty','memberrealtime'];if(!_[_0xd6f0('0x36')](_0x18e364)&&!_[_0xd6f0('0xb9')](_0x3fb73f,_0x18e364)){if(_[_0xd6f0('0xba')](this['variables'][_0x4a3561])){this[_0xd6f0('0x15')][_0x4a3561]={};}this[_0xd6f0('0x15')][_0x4a3561][_0x18e364]=_0x387a9c;}};VoiceQueueReport[_0xd6f0('0xa')][_0xd6f0('0x25')]=function(_0x259b01){try{if(this['isNotNull'](_0x259b01)){logger[_0xd6f0('0x43')](_0xd6f0('0xbb'),_0x259b01['uniqueid'],util[_0xd6f0('0x3f')](_0x259b01,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x259b01[_0xd6f0('0x45')]]){for(var _0x38c3ca=0x0,_0x46f385={};_0x38c3ca0x0?_0x375103:0x0;this[_0x3c9c('0x10')][_0x467c07[_0x3c9c('0x69')]][_0x3c9c('0x2d')]=this[_0x3c9c('0x10')][_0x467c07[_0x3c9c('0x69')]]['talking']>_[_0x3c9c('0x6f')](_0x467c07[_0x3c9c('0x70')])?_[_0x3c9c('0x6f')](_0x467c07['loggedin']):this[_0x3c9c('0x10')][_0x467c07[_0x3c9c('0x69')]]['talking'];this[_0x3c9c('0x4f')](this['voiceQueues'][_0x467c07[_0x3c9c('0x69')]],_0x3c9c('0x12'));}logger['debug'](_0x3c9c('0x71'),util['inspect'](this['voiceQueues'][_0x467c07[_0x3c9c('0x69')]],{'showHidden':![],'depth':null}));ami[_0x3c9c('0x45')]('custom:queuesummary',this['voiceQueues'][_0x467c07[_0x3c9c('0x69')]]);}}}catch(_0x1314cd){logger['error'](_0x3c9c('0x67'),util[_0x3c9c('0x3d')](_0x1314cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x14')]=function(_0x8a9fbf){logger[_0x3c9c('0x47')](_0x3c9c('0x72'),util[_0x3c9c('0x3d')](_0x8a9fbf,{'showHidden':![],'depth':null}));this[_0x3c9c('0x65')]=!![];};VoiceQueueReport[_0x3c9c('0x30')]['syncQueueCallerJoin']=function(_0x11c08e){try{if(this[_0x3c9c('0x61')](_0x11c08e)){logger['debug'](_0x3c9c('0x73'),_0x11c08e[_0x3c9c('0x49')],util['inspect'](_0x11c08e,{'showHidden':![],'depth':null}));if(_[_0x3c9c('0x62')](this[_0x3c9c('0x3e')][_0x11c08e[_0x3c9c('0x49')]]))this[_0x3c9c('0x3e')][_0x11c08e[_0x3c9c('0x49')]]=[];if(_[_0x3c9c('0x62')](this[_0x3c9c('0xe')][_0x11c08e['uniqueid']]))this['channels'][_0x11c08e[_0x3c9c('0x49')]]={};var _0x56dc52=new QueueReport();_0x56dc52[_0x3c9c('0x4d')]=_0x11c08e[_0x3c9c('0x69')];_0x56dc52[_0x3c9c('0x50')]=this[_0x3c9c('0x10')][_0x56dc52[_0x3c9c('0x4d')]]&&this['voiceQueues'][_0x56dc52[_0x3c9c('0x4d')]][_0x3c9c('0x50')]?this['voiceQueues'][_0x56dc52[_0x3c9c('0x4d')]][_0x3c9c('0x50')]||'inbound':_0x3c9c('0x51');_0x56dc52['queue']=_0x11c08e[_0x3c9c('0x69')];_0x56dc52['queuecallerjoinAt']=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x56dc52[_0x3c9c('0x75')]=_0x11c08e[_0x3c9c('0x75')];_0x56dc52[_0x3c9c('0x76')]=_0x11c08e[_0x3c9c('0x76')];_0x56dc52[_0x3c9c('0x49')]=_0x11c08e[_0x3c9c('0x49')];_0x56dc52['routealias']=this[_0x3c9c('0xe')][_0x11c08e[_0x3c9c('0x49')]][_0x3c9c('0x77')];logger['info'](_0x3c9c('0x78'),_0x56dc52[_0x3c9c('0x4d')],_0x56dc52['type']);_['merge'](_0x56dc52,_[_0x3c9c('0x79')](_0x11c08e,_[_0x3c9c('0x7a')](_0x56dc52)));this[_0x3c9c('0x3e')][_0x11c08e[_0x3c9c('0x49')]][_0x3c9c('0x7b')](_0x56dc52);this[_0x3c9c('0xe')][_0x11c08e[_0x3c9c('0x49')]]=_0x56dc52;this[_0x3c9c('0x46')](_0x56dc52,_0x3c9c('0x15'));}}catch(_0x4ecf12){logger['error'](_0x3c9c('0x73'),_0x11c08e[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x4ecf12,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x16')]=function(_0x40c627){try{if(this[_0x3c9c('0x61')](_0x40c627)){logger[_0x3c9c('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x40c627[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x40c627,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x40c627['uniqueid']]){var _0x24215c=_[_0x3c9c('0x7c')](this['queueReports'][_0x40c627[_0x3c9c('0x49')]]);_0x24215c[_0x3c9c('0x7d')]=![];_0x24215c['queuecallercompleteAt']=null;_0x24215c['holdtime']=_0x40c627['holdtime'];_0x24215c['originalposition']=_0x40c627[_0x3c9c('0x7e')];_0x24215c['queuecallerabandon']=!![];_0x24215c[_0x3c9c('0x7f')]=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x24215c[_0x3c9c('0x80')]=_0x3c9c('0x81');_0x24215c[_0x3c9c('0x82')]=null;logger[_0x3c9c('0x6b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x24215c['name'],_0x24215c[_0x3c9c('0x50')]);this[_0x3c9c('0xe')][_0x40c627[_0x3c9c('0x49')]]=_0x24215c;this['emitVoiceQueueChannelRemove'](_0x24215c,'queuecallerabandon');}}}catch(_0x134a02){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x40c627[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x134a02,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')]['syncQueueCallerLeave']=function(_0x4dc55b){try{if(this[_0x3c9c('0x61')](_0x4dc55b)){logger[_0x3c9c('0x47')](_0x3c9c('0x83'),_0x4dc55b[_0x3c9c('0x49')],util['inspect'](_0x4dc55b,{'showHidden':![],'depth':null}));if(this[_0x3c9c('0x3e')][_0x4dc55b['uniqueid']]){var _0x23ca9b=_['last'](this[_0x3c9c('0x3e')][_0x4dc55b['uniqueid']]);_0x23ca9b[_0x3c9c('0x84')]=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x23ca9b[_0x3c9c('0x85')]=_0x4dc55b[_0x3c9c('0x85')];_0x23ca9b[_0x3c9c('0x86')]=_0x4dc55b[_0x3c9c('0x86')];logger[_0x3c9c('0x6b')](_0x3c9c('0x87'),_0x23ca9b[_0x3c9c('0x4d')],_0x23ca9b[_0x3c9c('0x50')],_0x4dc55b[_0x3c9c('0x85')],_0x4dc55b[_0x3c9c('0x86')]);this[_0x3c9c('0xe')][_0x4dc55b[_0x3c9c('0x49')]]=_0x23ca9b;this[_0x3c9c('0x46')](_0x23ca9b,_0x3c9c('0x17'));}}}catch(_0x458808){logger[_0x3c9c('0x3b')]('[%s][voiceQueueReport][queuecallerleave]',_0x4dc55b[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x458808,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x1b')]=function(_0x313195){try{if(this[_0x3c9c('0x61')](_0x313195)){logger[_0x3c9c('0x47')](_0x3c9c('0x88'),_0x313195[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x313195,{'showHidden':![],'depth':null}));if(this[_0x3c9c('0x3e')][_0x313195[_0x3c9c('0x49')]]){var _0x2ec9d4=_['last'](this[_0x3c9c('0x3e')][_0x313195[_0x3c9c('0x49')]]);_0x2ec9d4[_0x3c9c('0x7d')]=!![];_0x2ec9d4['queuecallerexitreason']=_0x3c9c('0x89');logger[_0x3c9c('0x6b')](_0x3c9c('0x8a'),_0x2ec9d4[_0x3c9c('0x4d')],_0x2ec9d4[_0x3c9c('0x50')]);}}}catch(_0x52fd8d){logger[_0x3c9c('0x3b')]('[%s][voiceQueueReport][agentconnect]',_0x313195[_0x3c9c('0x49')],util['inspect'](_0x52fd8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x19')]=function(_0x183a1c){try{if(this[_0x3c9c('0x61')](_0x183a1c)){logger['debug'](_0x3c9c('0x8b'),_0x183a1c['uniqueid'],util[_0x3c9c('0x3d')](_0x183a1c,{'showHidden':![],'depth':null}));if(this[_0x3c9c('0x3e')][_0x183a1c['uniqueid']]){var _0x516ed5=_['last'](this[_0x3c9c('0x3e')][_0x183a1c[_0x3c9c('0x49')]]);_0x516ed5[_0x3c9c('0x8c')]=![];_0x516ed5[_0x3c9c('0x7f')]=null;_0x516ed5[_0x3c9c('0x8d')]=!![];_0x516ed5['lastAssignedTo']=_0x183a1c[_0x3c9c('0x8e')];_0x516ed5[_0x3c9c('0x8f')]=_0x183a1c[_0x3c9c('0x8f')];_0x516ed5[_0x3c9c('0x7d')]=!![];_0x516ed5[_0x3c9c('0x90')]=![];_0x516ed5['queuecallerexitAt']=null;if(!_0x516ed5[_0x3c9c('0x91')]){if(_0x183a1c[_0x3c9c('0x92')]==_0x3c9c('0x91')){_0x516ed5['queuecallerexitreason']=_0x3c9c('0x93');logger[_0x3c9c('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x516ed5['name'],_0x516ed5[_0x3c9c('0x50')]);}else{if(_['startsWith'](_0x183a1c[_0x3c9c('0x37')][_0x3c9c('0x94')](),'local/')){if(this[_0x3c9c('0x3e')][_0x183a1c['linkedid']]){var _0x294fe7=_[_0x3c9c('0x7c')](this[_0x3c9c('0x3e')][_0x183a1c[_0x3c9c('0x95')]]);_0x294fe7[_0x3c9c('0x7d')]=![];_0x294fe7[_0x3c9c('0x90')]=!![];_0x294fe7['queuecallerexitAt']=moment(_0x516ed5[_0x3c9c('0x96')])[_0x3c9c('0x97')](_0x183a1c[_0x3c9c('0x8f')],_0x3c9c('0x98'))[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x294fe7[_0x3c9c('0x80')]=_0x3c9c('0x99');_0x294fe7[_0x3c9c('0x91')]=!![];_0x294fe7['transfertype']=_0x3c9c('0x9a');_0x294fe7[_0x3c9c('0x9b')]=_0x183a1c[_0x3c9c('0x9c')];_0x294fe7['transferuniqueid']=_0x183a1c['uniqueid'];logger[_0x3c9c('0x6b')](_0x3c9c('0x9d'),_0x294fe7['name'],_0x294fe7[_0x3c9c('0x50')]);var _0x97fb2b=this['queueReports'][_0x183a1c[_0x3c9c('0x95')]];this['queueReports'][_0x183a1c[_0x3c9c('0x95')]]=this[_0x3c9c('0x3e')][_0x183a1c[_0x3c9c('0x49')]];this[_0x3c9c('0x3e')][_0x183a1c[_0x3c9c('0x49')]]=_0x97fb2b;}}else{_0x516ed5[_0x3c9c('0x80')]=_0x3c9c('0x9e')+_0x183a1c[_0x3c9c('0x92')][_0x3c9c('0x9f')]();logger[_0x3c9c('0x6b')](_0x3c9c('0xa0'),_0x516ed5[_0x3c9c('0x4d')],_0x516ed5[_0x3c9c('0x50')],_0x516ed5[_0x3c9c('0x80')]);}}}this[_0x3c9c('0xe')][_0x183a1c[_0x3c9c('0x49')]]=_0x516ed5;this[_0x3c9c('0x4c')](_0x516ed5,_0x3c9c('0xa1'));}}}catch(_0x345655){logger[_0x3c9c('0x3b')](_0x3c9c('0x8b'),_0x183a1c[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x345655,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x1d')]=function(_0x8f60b4){try{if(this[_0x3c9c('0x61')](_0x8f60b4)){logger['debug'](_0x3c9c('0xa2'),_0x8f60b4[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x8f60b4,{'showHidden':![],'depth':null}));this[_0x3c9c('0xa3')](_0x8f60b4['uniqueid'],_[_0x3c9c('0x7a')](_0x8f60b4[_0x3c9c('0xa4')])[0x0],_0x8f60b4[_0x3c9c('0xa5')]);if(this['queueReports'][_0x8f60b4[_0x3c9c('0x49')]]){var _0x31d3dd=_[_0x3c9c('0x7c')](this['queueReports'][_0x8f60b4[_0x3c9c('0x49')]]);if(_0x31d3dd){if(this[_0x3c9c('0x61')](_0x8f60b4[_0x3c9c('0xa4')])&&this[_0x3c9c('0x61')](_0x8f60b4['variable'][_0x3c9c('0xa6')])){switch(_0x8f60b4[_0x3c9c('0xa5')]){case _0x3c9c('0xa7'):_0x31d3dd[_0x3c9c('0x90')]=![];_0x31d3dd['queuecallerexitAt']=null;break;case'TIMEOUT':_0x31d3dd['lastevent']=_0x3c9c('0xa8');_0x31d3dd[_0x3c9c('0x90')]=!![];_0x31d3dd[_0x3c9c('0xa9')]=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x31d3dd['queuecallerleaveAt']=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));logger[_0x3c9c('0x47')](_0x3c9c('0xaa'),_0x8f60b4[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x31d3dd,{'showHidden':![],'depth':null}));ami[_0x3c9c('0x45')]('custom:timeout',_0x31d3dd);break;default:_0x31d3dd[_0x3c9c('0x90')]=!![];_0x31d3dd[_0x3c9c('0xa9')]=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));_0x31d3dd[_0x3c9c('0x84')]=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));}_0x31d3dd['queuecallerabandon']=![];_0x31d3dd[_0x3c9c('0x7f')]=null;_0x31d3dd[_0x3c9c('0x80')]=_0x8f60b4['value'];this[_0x3c9c('0xe')][_0x8f60b4[_0x3c9c('0x49')]]=_0x31d3dd;this[_0x3c9c('0x4c')](_0x31d3dd,_0x3c9c('0x1c'));}else if(this[_0x3c9c('0x61')](_0x8f60b4[_0x3c9c('0xa4')])&&this[_0x3c9c('0x61')](_0x8f60b4['variable'][_0x3c9c('0xab')])){if(!_0x31d3dd[_0x3c9c('0x8c')]){_0x31d3dd['queuecallerexit']=!![];_0x31d3dd['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x31d3dd[_0x3c9c('0x80')]=_0x3c9c('0xac');_0x31d3dd['queuecallerleaveAt']=moment()[_0x3c9c('0x4a')](_0x3c9c('0x74'));this['channels'][_0x8f60b4[_0x3c9c('0x49')]]=_0x31d3dd;}}logger[_0x3c9c('0x6b')](_0x3c9c('0xad'),_0x8f60b4['uniqueid'],_0x31d3dd[_0x3c9c('0x4d')],_0x31d3dd[_0x3c9c('0x50')],_[_0x3c9c('0x7a')](_0x8f60b4['variable'])[0x0],_0x8f60b4['value']);_0x31d3dd[_0x3c9c('0x11')]=this[_0x3c9c('0x11')][_0x8f60b4[_0x3c9c('0x49')]];}}}}catch(_0xf60fbb){logger[_0x3c9c('0x3b')]('[%s][voiceQueueReport][varset]',_0x8f60b4[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0xf60fbb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0xa3')]=function(_0x1f8e67,_0x1f22c2,_0x47e47b){var _0x33159f=[_0x3c9c('0xae'),_0x3c9c('0xaf'),_0x3c9c('0xb0'),_0x3c9c('0xb1'),_0x3c9c('0xb2'),_0x3c9c('0xb3'),_0x3c9c('0xb4'),_0x3c9c('0xb5'),'sipcallid',_0x3c9c('0xb6'),'bridgepeer','bridgepvtcallid','membercalls',_0x3c9c('0xb7'),_0x3c9c('0xb8'),_0x3c9c('0xb9'),_0x3c9c('0x8e'),_0x3c9c('0xba'),_0x3c9c('0xbb')];if(!_['isNil'](_0x1f22c2)&&!_[_0x3c9c('0xbc')](_0x33159f,_0x1f22c2)){if(_[_0x3c9c('0x62')](this[_0x3c9c('0x11')][_0x1f8e67])){this['variables'][_0x1f8e67]={};}this[_0x3c9c('0x11')][_0x1f8e67][_0x1f22c2]=_0x47e47b;}};VoiceQueueReport[_0x3c9c('0x30')][_0x3c9c('0x1f')]=function(_0x409b37){try{if(this[_0x3c9c('0x61')](_0x409b37)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x409b37[_0x3c9c('0x49')],util[_0x3c9c('0x3d')](_0x409b37,{'showHidden':![],'depth':null}));if(this[_0x3c9c('0x3e')][_0x409b37['uniqueid']]){for(var _0x5599b4=0x0,_0x379deb={};_0x5599b4=0x0?moment(_0x49bfa6[_0x5d0a('0x1b')])[_0x5d0a('0xd')](_0x49bfa6[_0x5d0a('0x1a')],_0x5d0a('0xe')):null,'data1':_0x5d0a('0x1c'),'data2':_0x49bfa6['accountcode'],'data3':_0x49bfa6[_0x5d0a('0x11')],'data4':_0x49bfa6[_0x5d0a('0x1d')]||null,'role':_0x5d0a('0x13'),'internal':_0x49bfa6[_0x5d0a('0x1e')]?_[_0x5d0a('0x14')](_0x49bfa6[_0x5d0a('0x1e')]):undefined,'uniqueid':_0x49bfa6[_0x5d0a('0x15')]},'log':_0x5d0a('0x16')});}; \ No newline at end of file +var _0x21d8=['TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','agent','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','toNumber','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','format','interface'];(function(_0x2daea7,_0x41e7da){var _0x1f01bd=function(_0x39417b){while(--_0x39417b){_0x2daea7['push'](_0x2daea7['shift']());}};_0x1f01bd(++_0x41e7da);}(_0x21d8,0x121));var _0x821d=function(_0x46b6f3,_0x362ca8){_0x46b6f3=_0x46b6f3-0x0;var _0x33b6cd=_0x21d8[_0x46b6f3];return _0x33b6cd;};'use strict';var moment=require('moment');var _=require(_0x821d('0x0'));var util=require(_0x821d('0x1'));var client=require('../client');exports[_0x821d('0x2')]=function(_0x3549ef){var _0x46f183=_0x3549ef[_0x821d('0x3')]||_0x3549ef[_0x821d('0x4')];return client[_0x821d('0x5')](_0x821d('0x6'),{'body':{'channel':_0x821d('0x7'),'membername':_0x3549ef[_0x821d('0x8')],'interface':_['isNil'](_0x3549ef['interface'])?util[_0x821d('0x9')]('SIP/%s',_0x3549ef['lastAssignedTo']):_0x3549ef[_0x821d('0xa')],'type':_0x821d('0xb'),'enterAt':_0x3549ef[_0x821d('0xc')],'exitAt':_0x46f183,'duration':moment(_0x46f183)[_0x821d('0xd')](_0x3549ef[_0x821d('0xc')],_0x821d('0xe')),'data1':_0x821d('0xf'),'data2':_0x3549ef['calleridnum'],'data3':_0x3549ef[_0x821d('0x10')],'data4':null,'data5':_0x3549ef['queue'],'role':_0x821d('0x11'),'internal':_0x3549ef['accountcode']?_['toNumber'](_0x3549ef[_0x821d('0x12')]):undefined,'uniqueid':_0x3549ef[_0x821d('0x13')]},'log':_0x821d('0x6')});};exports[_0x821d('0x14')]=function(_0x3ca1fd){return client['Request'](_0x821d('0x6'),{'body':{'channel':_0x821d('0x7'),'membername':_0x3ca1fd[_0x821d('0x15')],'interface':_0x3ca1fd[_0x821d('0xa')],'type':_0x821d('0xb'),'enterAt':_0x3ca1fd[_0x821d('0x16')],'exitAt':_0x3ca1fd[_0x821d('0x17')],'duration':moment(_0x3ca1fd[_0x821d('0x17')])[_0x821d('0xd')](_0x3ca1fd['starttime'],_0x821d('0xe'))>=0x0?moment(_0x3ca1fd[_0x821d('0x17')])[_0x821d('0xd')](_0x3ca1fd[_0x821d('0x16')],_0x821d('0xe')):null,'data1':'outbound','data2':_0x3ca1fd['accountcode'],'data3':_0x3ca1fd['exten'],'data4':_0x3ca1fd['dialstring']||null,'role':_0x821d('0x11'),'internal':_0x3ca1fd['accountcode']?_[_0x821d('0x18')](_0x3ca1fd[_0x821d('0x12')]):undefined,'uniqueid':_0x3ca1fd['uniqueid']},'log':_0x821d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e27f3c2..f45c07e 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 _0x9d02=['stopRecordingOnTransfer','../client','Request'];(function(_0x30f897,_0x37455e){var _0x40bfff=function(_0x5530bf){while(--_0x5530bf){_0x30f897['push'](_0x30f897['shift']());}};_0x40bfff(++_0x37455e);}(_0x9d02,0x118));var _0x29d0=function(_0x5dc473,_0x3ed0d4){_0x5dc473=_0x5dc473-0x0;var _0x16b852=_0x9d02[_0x5dc473];return _0x16b852;};'use strict';var client=require(_0x29d0('0x0'));exports['getSettings']=function(){return client[_0x29d0('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x29d0('0x2')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x0de3=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0de3,0x184));var _0x30de=function(_0x57a91f,_0x44762a){_0x57a91f=_0x57a91f-0x0;var _0x5977af=_0x0de3[_0x57a91f];return _0x5977af;};'use strict';var client=require(_0x30de('0x0'));exports[_0x30de('0x1')]=function(){return client['Request'](_0x30de('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x30de('0x3')]},'log':_0x30de('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ac56b30..70500fc 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 _0xdb9c=['GetTemplate','name','html','getTemplates'];(function(_0x46c08,_0x318b9c){var _0xc6668b=function(_0x1ecbcd){while(--_0x1ecbcd){_0x46c08['push'](_0x46c08['shift']());}};_0xc6668b(++_0x318b9c);}(_0xdb9c,0x1cf));var _0xcdb9=function(_0x25f0ec,_0x4621de){_0x25f0ec=_0x25f0ec-0x0;var _0x4a7881=_0xdb9c[_0x25f0ec];return _0x4a7881;};'use strict';var client=require('../client');exports[_0xcdb9('0x0')]=function(_0x5ae86f){return function(_0x38b9df){return client['Request'](_0xcdb9('0x1'),{'options':{'raw':!![],'attributes':['id',_0xcdb9('0x2'),_0xcdb9('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x80ed=['Request','name','html','GetTemplate','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80ed,0x11c));var _0xd80e=function(_0x208a36,_0x34ae85){_0x208a36=_0x208a36-0x0;var _0x29404c=_0x80ed[_0x208a36];return _0x29404c;};'use strict';var client=require(_0xd80e('0x0'));exports['getTemplates']=function(_0x1bb10e){return function(_0x182da3){return client[_0xd80e('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xd80e('0x2'),_0xd80e('0x3')]},'log':_0xd80e('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 0a7108b..937ba0d 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 _0xa01d=['action','data4','data5','data7','GetTrigger','../client','getTriggers','name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa01d,0x1e1));var _0xda01=function(_0x566204,_0x2f192e){_0x566204=_0x566204-0x0;var _0xa931e9=_0xa01d[_0x566204];return _0xa931e9;};'use strict';var client=require(_0xda01('0x0'));exports[_0xda01('0x1')]=function(_0x40908a){return function(_0x22a3c9){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xda01('0x2'),_0xda01('0x3'),'status'],'include':[{'model':'Condition','as':_0xda01('0x4'),'attributes':['id',_0xda01('0x5'),_0xda01('0x6'),_0xda01('0x7')]},{'model':_0xda01('0x8'),'as':_0xda01('0x9'),'attributes':['id',_0xda01('0x5'),_0xda01('0x6'),_0xda01('0x7')]},{'model':_0xda01('0xa'),'as':_0xda01('0xb'),'attributes':['id',_0xda01('0xc'),'data1','data2','data3',_0xda01('0xd'),_0xda01('0xe'),'data6',_0xda01('0xf')]}]},'log':_0xda01('0x10')});};}; \ No newline at end of file +var _0x668f=['name','status','Condition','AllConditions','field','operator','value','Action','data1','data2','data3','data5','data6','getTriggers','Request','GetTrigger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x668f,0x12d));var _0xf668=function(_0x2428ae,_0x5deb01){_0x2428ae=_0x2428ae-0x0;var _0x34a82=_0x668f[_0x2428ae];return _0x34a82;};'use strict';var client=require('../client');exports[_0xf668('0x0')]=function(_0x5c1de3){return function(_0x24e1fc){return client[_0xf668('0x1')](_0xf668('0x2'),{'options':{'raw':![],'attributes':['id',_0xf668('0x3'),'channel',_0xf668('0x4')],'include':[{'model':_0xf668('0x5'),'as':_0xf668('0x6'),'attributes':['id',_0xf668('0x7'),_0xf668('0x8'),'value']},{'model':_0xf668('0x5'),'as':'AnyConditions','attributes':['id',_0xf668('0x7'),'operator',_0xf668('0x9')]},{'model':_0xf668('0xa'),'as':'Actions','attributes':['id','action',_0xf668('0xb'),_0xf668('0xc'),_0xf668('0xd'),'data4',_0xf668('0xe'),_0xf668('0xf'),'data7']}]},'log':_0xf668('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f545cf7..c9b7b66 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 _0x6adb=['registry','defaultuser','GetTrunk','getTrunks','Request'];(function(_0x3d780c,_0x1e391f){var _0x42ad8b=function(_0x548f9a){while(--_0x548f9a){_0x3d780c['push'](_0x3d780c['shift']());}};_0x42ad8b(++_0x1e391f);}(_0x6adb,0x134));var _0xb6ad=function(_0x2fc701,_0x16276b){_0x2fc701=_0x2fc701-0x0;var _0x5b88f7=_0x6adb[_0x2fc701];return _0x5b88f7;};'use strict';var client=require('../client');exports[_0xb6ad('0x0')]=function(_0x3f3017){return function(_0x3464b3){return client[_0xb6ad('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xb6ad('0x2'),_0xb6ad('0x3')]},'log':_0xb6ad('0x4')});};}; \ No newline at end of file +var _0x867f=['GetTrunk','name','../client','getTrunks','Request'];(function(_0x543e08,_0x61f283){var _0x3099a4=function(_0x43ac8a){while(--_0x43ac8a){_0x543e08['push'](_0x543e08['shift']());}};_0x3099a4(++_0x61f283);}(_0x867f,0x7f));var _0xf867=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0x867f[_0x2401fc];return _0x23bb42;};'use strict';var client=require(_0xf867('0x0'));exports[_0xf867('0x1')]=function(_0x83d97c){return function(_0xde6233){return client[_0xf867('0x2')](_0xf867('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf867('0x4'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index bc5d13b..1ce8714 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x406bf4,_0x2ffe43){var _0x2916b9=function(_0x39c3b3){while(--_0x39c3b3){_0x406bf4['push'](_0x406bf4['shift']());}};_0x2916b9(++_0x2ffe43);}(_0xedd9,0xfc));var _0x9edd=function(_0x5445b3,_0x559e6a){_0x5445b3=_0x5445b3-0x0;var _0x270ed4=_0xedd9[_0x5445b3];return _0x270ed4;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4ec693,_0x12c3a9){var _0x113384=function(_0xe4818d){while(--_0xe4818d){_0x4ec693['push'](_0x4ec693['shift']());}};_0x113384(++_0x12c3a9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0xcb91[_0x1c5142];return _0x1268cb;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index fb47e2b..c098859 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 _0x88ce=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x537d28,_0x249da4){var _0x42a2ef=function(_0xc618d2){while(--_0xc618d2){_0x537d28['push'](_0x537d28['shift']());}};_0x42a2ef(++_0x249da4);}(_0x88ce,0x86));var _0xe88c=function(_0x462876,_0x34a620){_0x462876=_0x462876-0x0;var _0x38f43d=_0x88ce[_0x462876];return _0x38f43d;};'use strict';var client=require(_0xe88c('0x0'));exports[_0xe88c('0x1')]=function(_0x3591f6){return client[_0xe88c('0x2')](_0xe88c('0x3'),{'body':_0x3591f6,'log':_0xe88c('0x3')});};exports[_0xe88c('0x4')]=function(_0x54bf0f,_0xafb3b0,_0x4884a8){return client[_0xe88c('0x2')](_0xe88c('0x5'),{'body':_0x54bf0f,'options':{'where':{'uniqueid':_0xafb3b0,'interface':_0x4884a8,'agentcomplete':!![]}},'log':_0xe88c('0x5')});}; \ No newline at end of file +var _0xff1a=['UpdateVoiceAgentReport','Request','CreateVoiceAgentReport','update'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xff1a,0xe9));var _0xaff1=function(_0x34ac73,_0x36a126){_0x34ac73=_0x34ac73-0x0;var _0x3edc78=_0xff1a[_0x34ac73];return _0x3edc78;};'use strict';var client=require('../client');exports['create']=function(_0x322096){return client[_0xaff1('0x0')](_0xaff1('0x1'),{'body':_0x322096,'log':'CreateVoiceAgentReport'});};exports[_0xaff1('0x2')]=function(_0x30c1cb,_0x4074da,_0x360eec){return client[_0xaff1('0x0')]('UpdateVoiceAgentReport',{'body':_0x30c1cb,'options':{'where':{'uniqueid':_0x4074da,'interface':_0x360eec,'agentcomplete':!![]}},'log':_0xaff1('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8718d0d..66a51cb 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 _0x6268=['merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport'];(function(_0x486712,_0x6a30f6){var _0x2bbbdb=function(_0x73999f){while(--_0x73999f){_0x486712['push'](_0x486712['shift']());}};_0x2bbbdb(++_0x6a30f6);}(_0x6268,0xeb));var _0x8626=function(_0x2de2f8,_0x140ca1){_0x2de2f8=_0x2de2f8-0x0;var _0x391c44=_0x6268[_0x2de2f8];return _0x391c44;};'use strict';var moment=require(_0x8626('0x0'));var util=require(_0x8626('0x1'));var _=require(_0x8626('0x2'));var client=require(_0x8626('0x3'));exports[_0x8626('0x4')]=function(_0x16364e){return client[_0x8626('0x5')](_0x8626('0x6'),{'body':_[_0x8626('0x7')](_0x16364e,{'source':_0x16364e[_0x8626('0x8')],'destinationcontext':_0x16364e[_0x8626('0x9')],'callerid':_0x16364e[_0x8626('0xa')],'amaflags':_0x8626('0xb')}),'log':_0x8626('0x6')});};exports[_0x8626('0xc')]=function(){return function(){return client[_0x8626('0x5')](_0x8626('0xd'),{'options':{'where':{'type':[_0x8626('0xe')],'createdAt':{'$between':[moment()['startOf'](_0x8626('0xf'))['format'](_0x8626('0x10')),moment()[_0x8626('0x11')](_0x8626('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x8626('0x12'),_0x8626('0x13'),_0x8626('0x14'),_0x8626('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x59c8=['day','type','disposition','duration','billableseconds','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x24ec6d,_0x42833d){var _0x131822=function(_0x1fc405){while(--_0x1fc405){_0x24ec6d['push'](_0x24ec6d['shift']());}};_0x131822(++_0x42833d);}(_0x59c8,0x181));var _0x859c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x59c8[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require('moment');var util=require(_0x859c('0x0'));var _=require(_0x859c('0x1'));var client=require(_0x859c('0x2'));exports['create']=function(_0x7bfd20){return client[_0x859c('0x3')](_0x859c('0x4'),{'body':_[_0x859c('0x5')](_0x7bfd20,{'source':_0x7bfd20[_0x859c('0x6')],'destinationcontext':_0x7bfd20[_0x859c('0x7')],'callerid':_0x7bfd20['callerid'],'amaflags':_0x859c('0x8')}),'log':_0x859c('0x4')});};exports[_0x859c('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x859c('0xa')]('day')[_0x859c('0xb')](_0x859c('0xc')),moment()[_0x859c('0xd')](_0x859c('0xe'))[_0x859c('0xb')](_0x859c('0xc'))]}},'attributes':[_0x859c('0xf'),_0x859c('0x10'),_0x859c('0x11'),_0x859c('0x12')]},'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 28c6f55..2161c44 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 _0x2141=['create','CreateVoiceDialReport'];(function(_0x1c08e1,_0x5a92c7){var _0x253a63=function(_0x141cb7){while(--_0x141cb7){_0x1c08e1['push'](_0x1c08e1['shift']());}};_0x253a63(++_0x5a92c7);}(_0x2141,0x15a));var _0x1214=function(_0xeebbab,_0x1a81c4){_0xeebbab=_0xeebbab-0x0;var _0x298137=_0x2141[_0xeebbab];return _0x298137;};'use strict';var client=require('../client');exports[_0x1214('0x0')]=function(_0x6e4042){return client['Request'](_0x1214('0x1'),{'body':_0x6e4042,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x885c=['Request','CreateVoiceDialReport','../client','create'];(function(_0x178b23,_0x1ab486){var _0x199850=function(_0x2899c8){while(--_0x2899c8){_0x178b23['push'](_0x178b23['shift']());}};_0x199850(++_0x1ab486);}(_0x885c,0x9a));var _0xc885=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x885c[_0x21b74b];return _0x518cc6;};'use strict';var client=require(_0xc885('0x0'));exports[_0xc885('0x1')]=function(_0x38fa01){return client[_0xc885('0x2')](_0xc885('0x3'),{'body':_0x38fa01,'log':_0xc885('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3edf198..f1037f5 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 _0xb469=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x29f6c3,_0x5f5371){var _0x3a6444=function(_0x1771c7){while(--_0x1771c7){_0x29f6c3['push'](_0x29f6c3['shift']());}};_0x3a6444(++_0x5f5371);}(_0xb469,0x13b));var _0x9b46=function(_0x3e0a79,_0xfd91e9){_0x3e0a79=_0x3e0a79-0x0;var _0x11ff0a=_0xb469[_0x3e0a79];return _0x11ff0a;};'use strict';var client=require(_0x9b46('0x0'));exports[_0x9b46('0x1')]=function(){return function(){return client[_0x9b46('0x2')](_0x9b46('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9b46('0x4'),_0x9b46('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x9b46('0x1')});};}; \ No newline at end of file +var _0x3f8c=['Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x3dfadb,_0x103a6d){var _0x20ca23=function(_0x25adab){while(--_0x25adab){_0x3dfadb['push'](_0x3dfadb['shift']());}};_0x20ca23(++_0x103a6d);}(_0x3f8c,0x104));var _0xc3f8=function(_0x53a0a1,_0x27aa3d){_0x53a0a1=_0x53a0a1-0x0;var _0x31a573=_0x3f8c[_0x53a0a1];return _0x31a573;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xc3f8('0x0')](_0xc3f8('0x1'),{'options':{'raw':!![],'attributes':['id',_0xc3f8('0x2'),_0xc3f8('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 983eb60..dcb4361 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 _0x7a83=['Interval','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active'];(function(_0x39d91e,_0x464c06){var _0x5d247c=function(_0x5bf30d){while(--_0x5bf30d){_0x39d91e['push'](_0x39d91e['shift']());}};_0x5d247c(++_0x464c06);}(_0x7a83,0xd9));var _0x37a8=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x7a83[_0x5beda8];return _0x2aa042;};'use strict';var client=require('../client');exports[_0x37a8('0x0')]=function(){return function(){return client['Request'](_0x37a8('0x1'),{'options':{'raw':![],'attributes':['id',_0x37a8('0x2'),'acw',_0x37a8('0x3'),_0x37a8('0x4'),_0x37a8('0x5'),_0x37a8('0x6'),_0x37a8('0x7'),_0x37a8('0x8'),'dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x37a8('0x9'),'dialOriginateCallerIdNumber',_0x37a8('0xa'),'dialQueueOptions',_0x37a8('0xb'),_0x37a8('0xc'),_0x37a8('0xd'),_0x37a8('0xe'),'dialBusyMaxRetry',_0x37a8('0xf'),_0x37a8('0x10'),_0x37a8('0x11'),_0x37a8('0x12'),_0x37a8('0x13'),_0x37a8('0x14'),_0x37a8('0x15'),_0x37a8('0x16'),_0x37a8('0x17'),_0x37a8('0x18'),'dialAMDGreeting',_0x37a8('0x19'),_0x37a8('0x1a'),_0x37a8('0x1b'),_0x37a8('0x1c'),_0x37a8('0x1d'),_0x37a8('0x1e'),_0x37a8('0x1f'),'timeout',_0x37a8('0x20'),'dialRecallInQueue','dialOrderByScheduledAt',_0x37a8('0x21'),_0x37a8('0x22'),_0x37a8('0x23'),_0x37a8('0x5'),_0x37a8('0x24'),_0x37a8('0x25'),_0x37a8('0x26'),'dialNoSuchNumberMaxRetry',_0x37a8('0x27'),'dialDropMaxRetry',_0x37a8('0x28'),_0x37a8('0x29'),_0x37a8('0x2a'),_0x37a8('0x2b'),'dialMachineRetryFrequency',_0x37a8('0x2c'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x37a8('0x2d'),_0x37a8('0x2e')],'include':[{'model':_0x37a8('0x2f'),'as':_0x37a8('0x2f'),'attributes':['id',_0x37a8('0x2'),_0x37a8('0x30'),'active']},{'model':_0x37a8('0x31'),'as':_0x37a8('0x32'),'attributes':['id',_0x37a8('0x2')]},{'model':_0x37a8('0x2f'),'as':_0x37a8('0x33'),'attributes':['id',_0x37a8('0x2'),'callerid',_0x37a8('0x34')]},{'model':_0x37a8('0x35'),'as':'Interval','attributes':['id',_0x37a8('0x2')],'include':[{'model':_0x37a8('0x35'),'as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x37a8('0x0')});};}; \ No newline at end of file +var _0x9512=['Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid'];(function(_0x5ad9f0,_0x40a744){var _0x5ea7a6=function(_0x1909af){while(--_0x1909af){_0x5ad9f0['push'](_0x5ad9f0['shift']());}};_0x5ea7a6(++_0x40a744);}(_0x9512,0x102));var _0x2951=function(_0x159c2f,_0xd39d20){_0x159c2f=_0x159c2f-0x0;var _0x591f68=_0x9512[_0x159c2f];return _0x591f68;};'use strict';var client=require(_0x2951('0x0'));exports[_0x2951('0x1')]=function(){return function(){return client[_0x2951('0x2')](_0x2951('0x3'),{'options':{'raw':![],'attributes':['id',_0x2951('0x4'),_0x2951('0x5'),_0x2951('0x6'),_0x2951('0x7'),_0x2951('0x8'),_0x2951('0x9'),_0x2951('0xa'),'dialMethod',_0x2951('0xb'),'dialLimitQueue',_0x2951('0xc'),_0x2951('0xd'),_0x2951('0xe'),_0x2951('0xf'),_0x2951('0x10'),_0x2951('0x11'),_0x2951('0x12'),_0x2951('0x13'),_0x2951('0x14'),_0x2951('0x15'),'dialCongestionMaxRetry',_0x2951('0x16'),_0x2951('0x17'),_0x2951('0x18'),_0x2951('0x19'),_0x2951('0x1a'),_0x2951('0x1b'),_0x2951('0x1c'),_0x2951('0x1d'),_0x2951('0x1e'),_0x2951('0x1f'),_0x2951('0x20'),_0x2951('0x21'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x2951('0x22'),_0x2951('0x23'),'dialAMDBetweenWordsSilence',_0x2951('0x24'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x2951('0x25'),_0x2951('0x26'),_0x2951('0x27'),_0x2951('0x28'),_0x2951('0x29'),_0x2951('0x2a'),_0x2951('0x2b'),_0x2951('0x8'),_0x2951('0x2c'),'dialRandomLastDigitCallerIdNumber',_0x2951('0x2d'),_0x2951('0x2e'),_0x2951('0x2f'),_0x2951('0x30'),'dialDropRetryFrequency',_0x2951('0x31'),'dialAbandonedRetryFrequency',_0x2951('0x32'),_0x2951('0x33'),_0x2951('0x34'),'dialAgentRejectRetryFrequency',_0x2951('0x35'),_0x2951('0x36'),_0x2951('0x37')],'include':[{'model':_0x2951('0x38'),'as':_0x2951('0x38'),'attributes':['id',_0x2951('0x4'),'callerid',_0x2951('0x39')]},{'model':_0x2951('0x3a'),'as':_0x2951('0x3b'),'attributes':['id',_0x2951('0x4')]},{'model':'Trunk','as':_0x2951('0x3c'),'attributes':['id',_0x2951('0x4'),_0x2951('0x3d'),_0x2951('0x39')]},{'model':'Interval','as':_0x2951('0x3e'),'attributes':['id',_0x2951('0x4')],'include':[{'model':_0x2951('0x3e'),'as':'Intervals','attributes':['id','name',_0x2951('0x3f')]}]}]},'log':_0x2951('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 6bf6848..e91f228 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(_0x452f77,_0x154182){var _0x3b02eb=function(_0x51cf0a){while(--_0x51cf0a){_0x452f77['push'](_0x452f77['shift']());}};_0x3b02eb(++_0x154182);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x1623e8,_0xdf78df){var _0x3f9a11=function(_0x4baf16){while(--_0x4baf16){_0x1623e8['push'](_0x1623e8['shift']());}};_0x3f9a11(++_0xdf78df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 b5c81a8..f35a3ea 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 _0x4292=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x307ce0,_0x513d59){var _0x51e5da=function(_0x1022eb){while(--_0x1022eb){_0x307ce0['push'](_0x307ce0['shift']());}};_0x51e5da(++_0x513d59);}(_0x4292,0x127));var _0x2429=function(_0x5b7963,_0x10bff5){_0x5b7963=_0x5b7963-0x0;var _0x57f611=_0x4292[_0x5b7963];return _0x57f611;};'use strict';var client=require('../client');exports[_0x2429('0x0')]=function(_0x62df1f){return function(){return client[_0x2429('0x1')](_0x2429('0x2'),{'options':{'where':{'VoiceQueueId':_0x62df1f,'paused':!![]},'raw':!![]},'log':_0x2429('0x0')});};}; \ No newline at end of file +var _0x1046=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x1046,0xec));var _0x6104=function(_0xd96c3f,_0x49e7b9){_0xd96c3f=_0xd96c3f-0x0;var _0x563dbd=_0x1046[_0xd96c3f];return _0x563dbd;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x281d64){return function(){return client[_0x6104('0x0')](_0x6104('0x1'),{'options':{'where':{'VoiceQueueId':_0x281d64,'paused':!![]},'raw':!![]},'log':_0x6104('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index fe33bc6..e0c383c 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(_0x2476fc,_0x202f06){var _0x11814d=function(_0x2d0dea){while(--_0x2d0dea){_0x2476fc['push'](_0x2476fc['shift']());}};_0x11814d(++_0x202f06);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x318d71,_0x49f4bb){var _0x4e3035=function(_0x349cba){while(--_0x349cba){_0x318d71['push'](_0x318d71['shift']());}};_0x4e3035(++_0x49f4bb);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 553deec..3bcb05b 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 _0x5371=['transfereeexten','transfereelinkedid','isexternal','context','blind','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5371,0xbf));var _0x1537=function(_0x16aeb2,_0x5a03c5){_0x16aeb2=_0x16aeb2-0x0;var _0x469da9=_0x5371[_0x16aeb2];return _0x469da9;};'use strict';var client=require(_0x1537('0x0'));exports[_0x1537('0x1')]={};exports[_0x1537('0x2')]=function(_0x26377f){return client[_0x1537('0x3')](_0x1537('0x4'),{'body':{'result':_0x26377f[_0x1537('0x5')],'transfererchannel':_0x26377f[_0x1537('0x6')],'transferercalleridnum':_0x26377f[_0x1537('0x7')],'transferercalleridname':_0x26377f['transferercalleridname'],'transfererconnectedlinenum':_0x26377f[_0x1537('0x8')],'transfererconnectedlinename':_0x26377f['transfererconnectedlinename'],'transfereraccountcode':_0x26377f[_0x1537('0x9')],'transferercontext':_0x26377f[_0x1537('0xa')],'transfererexten':_0x26377f[_0x1537('0xb')],'transfererlinkedid':_0x26377f[_0x1537('0xc')],'transfereechannel':_0x26377f[_0x1537('0xd')],'transfereecalleridnum':_0x26377f[_0x1537('0xe')],'transfereecalleridname':_0x26377f[_0x1537('0xf')],'transfereeconnectedlinenum':_0x26377f[_0x1537('0x10')],'transfereeconnectedlinename':_0x26377f['transfereeconnectedlinename'],'transfereeaccountcode':_0x26377f[_0x1537('0x11')],'transfereecontext':_0x26377f[_0x1537('0x12')],'transfereeexten':_0x26377f[_0x1537('0x13')],'transfereelinkedid':_0x26377f[_0x1537('0x14')],'isexternal':_0x26377f[_0x1537('0x15')],'context':_0x26377f[_0x1537('0x16')],'extension':_0x26377f['extension'],'type':_0x1537('0x17')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4486c4){return client[_0x1537('0x3')](_0x1537('0x4'),{'body':{'result':_0x4486c4[_0x1537('0x5')],'transfererchannel':_0x4486c4['origtransfererchannel'],'transferercalleridnum':_0x4486c4['origtransferercalleridnum'],'transferercalleridname':_0x4486c4[_0x1537('0x18')],'transfererconnectedlinenum':_0x4486c4[_0x1537('0x19')],'transfererconnectedlinename':_0x4486c4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4486c4[_0x1537('0x1a')],'transferercontext':_0x4486c4['secondtransferercontext'],'transfererexten':_0x4486c4[_0x1537('0x1b')],'transfererlinkedid':_0x4486c4['origtransfererlinkedid'],'transfereechannel':_0x4486c4[_0x1537('0x1c')],'transfereecalleridnum':_0x4486c4[_0x1537('0x1d')],'transfereecalleridname':_0x4486c4['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4486c4['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4486c4['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4486c4[_0x1537('0x1e')],'transfereecontext':_0x4486c4[_0x1537('0x1f')],'transfereeexten':_0x4486c4['transfertargetexten'],'transfereelinkedid':_0x4486c4[_0x1537('0x20')],'isexternal':_0x4486c4[_0x1537('0x15')],'context':_0x4486c4[_0x1537('0x21')],'extension':_0x4486c4[_0x1537('0x22')],'type':'attended'},'log':_0x1537('0x4')});}; \ No newline at end of file +var _0x47cc=['transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','result','secondtransfererconnectedlinename','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten'];(function(_0x30a6a0,_0x356bc3){var _0x29ec25=function(_0x51c773){while(--_0x51c773){_0x30a6a0['push'](_0x30a6a0['shift']());}};_0x29ec25(++_0x356bc3);}(_0x47cc,0xa5));var _0xc47c=function(_0x45c45e,_0x596946){_0x45c45e=_0x45c45e-0x0;var _0x34fd0b=_0x47cc[_0x45c45e];return _0x34fd0b;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0x3c8076){return client[_0xc47c('0x0')](_0xc47c('0x1'),{'body':{'result':_0x3c8076['result'],'transfererchannel':_0x3c8076[_0xc47c('0x2')],'transferercalleridnum':_0x3c8076[_0xc47c('0x3')],'transferercalleridname':_0x3c8076[_0xc47c('0x4')],'transfererconnectedlinenum':_0x3c8076[_0xc47c('0x5')],'transfererconnectedlinename':_0x3c8076[_0xc47c('0x6')],'transfereraccountcode':_0x3c8076[_0xc47c('0x7')],'transferercontext':_0x3c8076[_0xc47c('0x8')],'transfererexten':_0x3c8076[_0xc47c('0x9')],'transfererlinkedid':_0x3c8076[_0xc47c('0xa')],'transfereechannel':_0x3c8076[_0xc47c('0xb')],'transfereecalleridnum':_0x3c8076[_0xc47c('0xc')],'transfereecalleridname':_0x3c8076[_0xc47c('0xd')],'transfereeconnectedlinenum':_0x3c8076[_0xc47c('0xe')],'transfereeconnectedlinename':_0x3c8076[_0xc47c('0xf')],'transfereeaccountcode':_0x3c8076[_0xc47c('0x10')],'transfereecontext':_0x3c8076[_0xc47c('0x11')],'transfereeexten':_0x3c8076[_0xc47c('0x12')],'transfereelinkedid':_0x3c8076[_0xc47c('0x13')],'isexternal':_0x3c8076[_0xc47c('0x14')],'context':_0x3c8076[_0xc47c('0x15')],'extension':_0x3c8076[_0xc47c('0x16')],'type':_0xc47c('0x17')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3b0282){return client[_0xc47c('0x0')]('CreateVoiceTransferReport',{'body':{'result':_0x3b0282[_0xc47c('0x18')],'transfererchannel':_0x3b0282['origtransfererchannel'],'transferercalleridnum':_0x3b0282['origtransferercalleridnum'],'transferercalleridname':_0x3b0282['origtransferercalleridname'],'transfererconnectedlinenum':_0x3b0282['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3b0282[_0xc47c('0x19')],'transfereraccountcode':_0x3b0282['origtransfereraccountcode'],'transferercontext':_0x3b0282['secondtransferercontext'],'transfererexten':_0x3b0282[_0xc47c('0x1a')],'transfererlinkedid':_0x3b0282['origtransfererlinkedid'],'transfereechannel':_0x3b0282[_0xc47c('0x1b')],'transfereecalleridnum':_0x3b0282['transfertargetcalleridnum'],'transfereecalleridname':_0x3b0282[_0xc47c('0x1c')],'transfereeconnectedlinenum':_0x3b0282[_0xc47c('0x1d')],'transfereeconnectedlinename':_0x3b0282[_0xc47c('0x1e')],'transfereeaccountcode':_0x3b0282['transfertargetaccountcode'],'transfereecontext':_0x3b0282[_0xc47c('0x1f')],'transfereeexten':_0x3b0282['transfertargetexten'],'transfereelinkedid':_0x3b0282[_0xc47c('0x20')],'isexternal':_0x3b0282[_0xc47c('0x14')],'context':_0x3b0282[_0xc47c('0x21')],'extension':_0x3b0282[_0xc47c('0x22')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 581eb8b..268074e 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 _0xaa37=['values','username','voicechannel','map','channel','%s.%s','filename','uniqueid','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','Reload','then','catch','message','command','action','Action','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','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','callerid','Interval','push','length','undefined'];(function(_0x196bd3,_0x2383ba){var _0x5661a1=function(_0x3cb0f5){while(--_0x3cb0f5){_0x196bd3['push'](_0x196bd3['shift']());}};_0x5661a1(++_0x2383ba);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xaa37[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var jayson=require(_0x7aa3('0x2'));var schema=require(_0x7aa3('0x3'));var BPromise=require('bluebird');var moment=require(_0x7aa3('0x4'));var config=require(_0x7aa3('0x5'));var properties=require(_0x7aa3('0x6'));var ami=require(_0x7aa3('0x7'));exports[_0x7aa3('0x8')]=function(_0x2801a2,_0x2679bb,_0x5b738a){return new BPromise(function(_0x437b90,_0xbbcc8a){var _0x5d1627={'QueuePause':function(_0x100894){return new Promise(function(_0x390c82,_0x394097){var _0x4f43f1=util[_0x7aa3('0x9')](_0x7aa3('0xa'),_0x7aa3('0xb'),_0x100894[_0x7aa3('0xc')]);if(_0x2801a2[_0x7aa3('0xd')]&&_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]&&_0x2801a2['timers'][_0x4f43f1]['timer']){_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]['updateAcw']();}if(_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]){_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]['updateStatusRealtime']({'statePause':_0x100894[_0x7aa3('0xf')]?!![]:![]});}_0x390c82({'code':0xc8,'message':_0x7aa3('0x10')});});},'Reload':function(_0x552ec9){var _0x5a6751=this;return new Promise(function(_0x4b844b,_0x1a7474){if(ami[_0x7aa3('0x11')]()==![]){return _0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x552ec9=_[_0x7aa3('0x16')](_0x552ec9,_[_0x7aa3('0x17')](properties['module']));_0x552ec9['action']=_0x7aa3('0x18');return ami['Action'](_0x552ec9)[_0x7aa3('0x19')](function(_0x3f9a75){_0x4b844b({'code':0xc8,'message':_0x3f9a75['message']});})[_0x7aa3('0x1a')](function(_0xe5e683){_0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f5,_0xe5e683[_0x7aa3('0x1b')]));});});},'Command':function(_0x12fdd3){var _0x5994b6=this;return new Promise(function(_0x22e93b,_0x266529){if(ami[_0x7aa3('0x11')]()==![]){return _0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x12fdd3=_[_0x7aa3('0x16')](_0x12fdd3,_0x7aa3('0x1c'));_0x12fdd3[_0x7aa3('0x1d')]='Command';return ami[_0x7aa3('0x1e')](_0x12fdd3)[_0x7aa3('0x19')](function(_0x2a6773){_0x22e93b({'code':0xc8,'message':_0x2a6773[_0x7aa3('0x1f')]});})[_0x7aa3('0x1a')](function(_0x10887d){_0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f5,_0x10887d[_0x7aa3('0x1b')]));});});},'VoiceQueues':function(_0x1d5271){return new Promise(function(_0x23f168,_0x44377a){var _0x1c5fef=[];for(var _0x1f1d82 in _0x2801a2['voiceQueues']){if(_0x2801a2[_0x7aa3('0x20')][_0x7aa3('0x21')](_0x1f1d82)){var _0x3c1422=_0x2801a2[_0x7aa3('0x20')][_0x1f1d82];var _0x183ffc={'id':_0x3c1422['id'],'name':_0x3c1422[_0x7aa3('0xc')],'strategy':_0x3c1422['strategy'],'answered':_0x3c1422[_0x7aa3('0x22')],'available':_0x3c1422[_0x7aa3('0x23')],'loggedIn':_0x3c1422[_0x7aa3('0x24')],'pTalking':_0x3c1422['pTalking'],'sumBillable':_0x3c1422[_0x7aa3('0x25')],'sumDuration':_0x3c1422[_0x7aa3('0x26')],'sumHoldTime':_0x3c1422['sumHoldTime']||0x0,'talking':_0x3c1422[_0x7aa3('0x27')],'total':_0x3c1422[_0x7aa3('0x28')],'type':_0x3c1422[_0x7aa3('0x29')],'unmanaged':_0x3c1422[_0x7aa3('0x2a')],'abandoned':_0x3c1422[_0x7aa3('0x2b')],'waiting':_0x3c1422[_0x7aa3('0x2c')],'loggedInDb':_0x3c1422[_0x7aa3('0x2d')]};if(_0x3c1422[_0x7aa3('0x29')]===_0x7aa3('0x2e')){_0x183ffc[_0x7aa3('0x2f')]=_0x3c1422[_0x7aa3('0x2f')];_0x183ffc[_0x7aa3('0x30')]=_0x3c1422[_0x7aa3('0x30')];_0x183ffc[_0x7aa3('0x31')]=_0x3c1422[_0x7aa3('0x31')];_0x183ffc[_0x7aa3('0x32')]=_0x3c1422[_0x7aa3('0x32')];_0x183ffc[_0x7aa3('0x33')]=_0x3c1422[_0x7aa3('0x33')];_0x183ffc[_0x7aa3('0x34')]=_0x3c1422[_0x7aa3('0x34')];_0x183ffc['temp']=_0x3c1422[_0x7aa3('0x35')];_0x183ffc[_0x7aa3('0x36')]=_0x3c1422[_0x7aa3('0x36')];_0x183ffc[_0x7aa3('0x37')]=_0x3c1422[_0x7aa3('0x37')];_0x183ffc[_0x7aa3('0x38')]=_0x3c1422[_0x7aa3('0x38')];_0x183ffc[_0x7aa3('0x39')]=_0x3c1422[_0x7aa3('0x39')];_0x183ffc[_0x7aa3('0x3a')]=_0x3c1422[_0x7aa3('0x3a')];_0x183ffc['outboundDropCallsDayACS']=_0x3c1422[_0x7aa3('0x3b')];_0x183ffc[_0x7aa3('0x3c')]=_0x3c1422[_0x7aa3('0x3c')];_0x183ffc[_0x7aa3('0x3d')]=_0x3c1422[_0x7aa3('0x3d')];_0x183ffc[_0x7aa3('0x3e')]=_0x3c1422[_0x7aa3('0x3e')];_0x183ffc[_0x7aa3('0x3f')]=_0x3c1422[_0x7aa3('0x3f')];_0x183ffc[_0x7aa3('0x40')]=_0x3c1422[_0x7aa3('0x40')];_0x183ffc[_0x7aa3('0x41')]=_0x3c1422[_0x7aa3('0x41')];_0x183ffc[_0x7aa3('0x42')]=_0x3c1422['outboundRejectCallsDay'];_0x183ffc[_0x7aa3('0x43')]=_0x3c1422[_0x7aa3('0x43')];_0x183ffc[_0x7aa3('0x44')]=_0x3c1422[_0x7aa3('0x44')];_0x183ffc['predictiveIntervalAvgHoldtime']=_0x3c1422[_0x7aa3('0x45')];_0x183ffc['predictiveIntervalAvgTalktime']=_0x3c1422[_0x7aa3('0x46')];_0x183ffc[_0x7aa3('0x47')]=_0x3c1422[_0x7aa3('0x47')];_0x183ffc[_0x7aa3('0x48')]=_0x3c1422[_0x7aa3('0x48')];_0x183ffc[_0x7aa3('0x49')]=_0x3c1422[_0x7aa3('0x49')];_0x183ffc[_0x7aa3('0x4a')]=_0x3c1422[_0x7aa3('0x4a')];_0x183ffc[_0x7aa3('0x4b')]=_0x3c1422['predictiveIntervalHitRate'];_0x183ffc[_0x7aa3('0x4c')]=_0x3c1422[_0x7aa3('0x4c')];_0x183ffc[_0x7aa3('0x4d')]=_0x3c1422[_0x7aa3('0x4d')];_0x183ffc[_0x7aa3('0x4e')]=_0x3c1422[_0x7aa3('0x4e')];_0x183ffc[_0x7aa3('0x4f')]=_0x3c1422[_0x7aa3('0x4f')];_0x183ffc[_0x7aa3('0x1b')]=_0x3c1422[_0x7aa3('0x1b')];_0x183ffc[_0x7aa3('0x50')]=_0x3c1422[_0x7aa3('0x50')];_0x183ffc[_0x7aa3('0x51')]=_0x3c1422[_0x7aa3('0x51')];_0x183ffc['erlangCallToSecond']=_0x3c1422[_0x7aa3('0x52')];_0x183ffc[_0x7aa3('0x53')]=_0x3c1422['erlangAbandonmentRate'];_0x183ffc[_0x7aa3('0x54')]=_0x3c1422[_0x7aa3('0x54')];_0x183ffc['startPredictive']=_0x3c1422[_0x7aa3('0x55')];_0x183ffc[_0x7aa3('0x56')]=_0x3c1422[_0x7aa3('0x56')];}if(_0x3c1422[_0x7aa3('0x57')]){_0x183ffc['Trunk']={'id':_0x3c1422['Trunk']['id'],'name':_0x3c1422[_0x7aa3('0x57')]['name'],'active':_0x3c1422[_0x7aa3('0x57')]['active'],'callerid':_0x3c1422['Trunk'][_0x7aa3('0x58')]};}if(_0x3c1422[_0x7aa3('0x59')]){_0x183ffc[_0x7aa3('0x59')]={'id':_0x3c1422[_0x7aa3('0x59')]['id'],'name':_0x3c1422[_0x7aa3('0x59')]['name']};}_0x1c5fef[_0x7aa3('0x5a')](_0x183ffc);}}_0x23f168({'count':_0x1c5fef[_0x7aa3('0x5b')],'rows':_0x1c5fef});});},'UpdateVoiceQueue':function(_0x5a5a88){return new Promise(function(_0x262a16,_0xcf97e0){var _0x3cdcfe=_['find'](_0x2801a2[_0x7aa3('0x20')],{'id':parseInt(_0x5a5a88['id'])});var _0x2d8e1d=_['omit'](_0x5a5a88,['id']);if(_0x3cdcfe){for(var _0x2cc4aa in _0x2d8e1d){if(typeof _0x2d8e1d[_0x2cc4aa]!==_0x7aa3('0x5c')&&typeof _0x3cdcfe[_0x2cc4aa]!=='undefined'){_0x3cdcfe[_0x2cc4aa]=_0x2d8e1d[_0x2cc4aa];}}_0x262a16(_0x3cdcfe);}else{_0xcf97e0();}});},'VoiceChannels':function(_0x4a2bfd){return new Promise(function(_0x368e27,_0x1a990){var _0x41f9fe=_[_0x7aa3('0x5d')](_0x2801a2['channels']);_0x368e27({'count':_0x41f9fe['length'],'rows':_0x41f9fe});});},'VoiceChannelMixMonitor':function(_0x41cbac){var _0x1d9ace=this;return new Promise(function(_0x1ccd3d,_0x16ad02){if(ami['isConnected']()==![]){return _0x16ad02(_0x1d9ace['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')]['join']('\x20')));}var _0x24017d=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x41cbac);if(_0x24017d[_0x7aa3('0x5b')]>0x0){return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x24017d,'message')[_0x7aa3('0x15')](',\x20')));}var _0x4d93c0=_['find'](_0x2801a2['channels'],{'uniqueid':_0x41cbac['uniqueid']});if(_0x4d93c0&&_0x4d93c0[_0x7aa3('0x61')]){var _0x2b6d01=util['format'](_0x7aa3('0x62'),_0x41cbac[_0x7aa3('0x63')]||_0x41cbac[_0x7aa3('0x64')],_0x41cbac['format']||'wav');return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x65'),'channel':_0x4d93c0[_0x7aa3('0x61')],'file':_0x2b6d01,'options':'ai(mixmonitorid)'})['then'](function(_0x53bb2e){var _0x5c6f1f=_[_0x7aa3('0x66')](_0x4d93c0[_0x7aa3('0x67')],{'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')]()});if(_['isNil'](_0x5c6f1f)){_0x4d93c0[_0x7aa3('0x67')][_0x7aa3('0x5a')]({'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')](),'createdAt':moment()[_0x7aa3('0x9')](_0x7aa3('0x6a')),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')],'status':_0x7aa3('0x6c')});}else{_0x5c6f1f['mixmonitorid']=_0x53bb2e[_0x7aa3('0x6b')];_0x5c6f1f[_0x7aa3('0x6d')]=_0x7aa3('0x6c');}_0x1ccd3d({'code':0xc8,'message':[_0x41cbac[_0x7aa3('0x64')],_0x7aa3('0x6e'),_0x53bb2e[_0x7aa3('0x6b')]][_0x7aa3('0x15')]('\x20'),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')]});})['catch'](function(_0x88aca4){_0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,[_0x41cbac['uniqueid'],_0x88aca4[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x20dde8){var _0x9f277d=this;return new Promise(function(_0x32efc6,_0x5275ba){if(ami[_0x7aa3('0x11')]()==![]){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x3552d2=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x20dde8);if(_0x3552d2[_0x7aa3('0x5b')]>0x0){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x3552d2,_0x7aa3('0x1b'))['join'](',\x20')));}var _0x53d3d4=_[_0x7aa3('0x66')](_0x2801a2['channels'],{'uniqueid':_0x20dde8[_0x7aa3('0x64')]});if(_0x53d3d4){return BPromise['resolve']()['then'](function(){if(_0x53d3d4['channel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x61')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})['catch'](function(_0x448b71){});}})['then'](function(){if(_0x53d3d4['destinationchannel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x71')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})[_0x7aa3('0x1a')](function(_0x27642a){});}})[_0x7aa3('0x19')](function(_0x16724c){var _0xaf3894=_['find'](_0x53d3d4[_0x7aa3('0x67')],{'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]});if(_0xaf3894){_0xaf3894[_0x7aa3('0x6d')]=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){var _0x4bb221=util[_0x7aa3('0x9')]('%s.%s',_0x20dde8['filename']||_0x20dde8[_0x7aa3('0x64')],_0x20dde8[_0x7aa3('0x9')]||'wav');var _0xaea2f0=_[_0x7aa3('0x66')](_0x53d3d4[_0x7aa3('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x4bb221[_0x7aa3('0x69')]()});if(_0xaea2f0){_0xaea2f0['status']=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){_0x32efc6({'code':0xc8,'message':[_0x20dde8[_0x7aa3('0x64')],_0x7aa3('0x73')][_0x7aa3('0x15')]('\x20')});})[_0x7aa3('0x1a')](function(_0x397c57){_0x5275ba(_0x9f277d['error'](0x1f5,[_0x20dde8[_0x7aa3('0x64')],_0x397c57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x5275ba(_0x9f277d['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannels':function(_0x4942d1){return new Promise(function(_0x442723,_0x5f30b8){var _0x254278=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x74')]);_0x442723({'count':_0x254278[_0x7aa3('0x5b')],'rows':_0x254278});});},'VoiceQueuesChannel':function(_0x558c6e){var _0x5303fa=this;return new Promise(function(_0x4a72c0,_0x4e4f7a){var _0x1f880a=schema(properties[_0x7aa3('0x75')])[_0x7aa3('0x3')](_0x558c6e);if(_0x1f880a[_0x7aa3('0x5b')]>0x0){return _0x4e4f7a(_0x5303fa[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x1f880a,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x817cd1=_['find'](_0x2801a2['queueChannels'],{'uniqueid':_0x558c6e[_0x7aa3('0x64')]});if(_0x817cd1){_0x4a72c0(_0x817cd1);}else{return _0x4e4f7a(_0x5303fa['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0xab9995){var _0x32fa77=this;return new Promise(function(_0x4850c2,_0x23f831){if(ami[_0x7aa3('0x11')]()==![]){return _0x23f831(_0x32fa77['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x34aa41=schema(properties[_0x7aa3('0x76')])[_0x7aa3('0x3')](_0xab9995);if(_0x34aa41[_0x7aa3('0x5b')]>0x0){return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x34aa41,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x29ffbe=_[_0x7aa3('0x66')](_0x2801a2[_0x7aa3('0x74')],{'uniqueid':_0xab9995['uniqueid']});if(_0x29ffbe&&_0x29ffbe[_0x7aa3('0x61')]){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x77'),'channel':_0x29ffbe[_0x7aa3('0x61')]})[_0x7aa3('0x19')](function(_0x53d208){_0x4850c2({'code':0xc8,'message':[_0xab9995[_0x7aa3('0x64')],_0x53d208[_0x7aa3('0x1b')][_0x7aa3('0x69')]()]['join']('\x20')});})[_0x7aa3('0x1a')](function(_0x4d7a1c){_0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,[_0xab9995[_0x7aa3('0x64')],_0x4d7a1c[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x26191f){var _0xa0b103=this;return new Promise(function(_0xd58880,_0x4b2568){if(ami[_0x7aa3('0x11')]()==![]){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x5a0642=schema(properties[_0x7aa3('0x78')])[_0x7aa3('0x3')](_0x26191f);if(_0x5a0642[_0x7aa3('0x5b')]>0x0){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x5a0642,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x2ca603=_[_0x7aa3('0x66')](_0x2801a2['queueChannels'],{'uniqueid':_0x26191f[_0x7aa3('0x64')]});if(_0x2ca603&&_0x2ca603[_0x7aa3('0x61')]){return ami['Action']({'action':_0x7aa3('0x79'),'channel':_0x2ca603['channel'],'exten':_0x26191f[_0x7aa3('0x7a')],'context':_0x26191f[_0x7aa3('0x7b')]||_0x2ca603[_0x7aa3('0x7b')],'priority':0x1})[_0x7aa3('0x19')](function(_0x517a99){_0xd58880({'code':0xc8,'message':[_0x26191f[_0x7aa3('0x64')],_0x517a99[_0x7aa3('0x1b')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x16cd57){_0x4b2568(_0xa0b103['error'](0x1f5,[_0x26191f[_0x7aa3('0x64')],_0x16cd57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x4b2568(_0xa0b103['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2e7d5e){return new Promise(function(_0x142763,_0x285c34){var _0x3b8baa=_[_0x7aa3('0x5d')](_0x2801a2['agents']);_0x142763({'count':_0x3b8baa[_0x7aa3('0x5b')],'rows':_0x3b8baa});});},'Telephones':function(_0x2f17a6){return new Promise(function(_0x572e95,_0x3735a8){var _0x2def81=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7c')]);_0x572e95({'count':_0x2def81[_0x7aa3('0x5b')],'rows':_0x2def81});});},'Trunks':function(_0x4a6858){return new Promise(function(_0x5288c6,_0x542fe3){var _0x4444b8=_['values'](_0x2801a2['trunks']);_0x5288c6({'count':_0x4444b8['length'],'rows':_0x4444b8});});},'OutboundChannels':function(_0x3baa9d){return new Promise(function(_0x1e47c1,_0x1b4146){var _0x1165a4=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7d')]);_0x1e47c1({'count':_0x1165a4[_0x7aa3('0x5b')],'rows':_0x1165a4});});},'Outbound':function(_0x41a8f2){return new Promise(function(_0x4a53b5,_0xeb18b7){_0x4a53b5(_0x2801a2[_0x7aa3('0x2e')]);});},'Campaigns':function(_0x347807){return new Promise(function(_0x294a35,_0x1ee74e){var _0xc6a9dc=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7e')]);_0x294a35({'count':_0xc6a9dc[_0x7aa3('0x5b')],'rows':_0xc6a9dc});});},'VoiceQueuesPreview':function(_0x593e3e){var _0x4e67d5=this;return new Promise(function(_0xb15dc0,_0x1ed982){_0x2679bb[_0x7aa3('0x7f')](_0x593e3e['id'])[_0x7aa3('0x19')](function(_0x2bc37a){_0xb15dc0({'code':0xc8,'message':_0x2bc37a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x8a57ea){_0x1ed982(_0x4e67d5[_0x7aa3('0x12')](0x1f4,_0x8a57ea[_0x7aa3('0x1b')]));});});},'EventManager':function(_0x1ba1cc){var _0x50f320=this;return new Promise(function(_0x33e263,_0x4120d1){if(!_0x1ba1cc['event']){return _0x4120d1(_0x50f320[_0x7aa3('0x12')](0x1f4,_0x7aa3('0x80')));}ami[_0x7aa3('0x81')](_0x7aa3('0x82')+_0x1ba1cc[_0x7aa3('0x83')],_0x1ba1cc[_0x7aa3('0x1b')]);_0x33e263({'code':0xc8,'message':_0x1ba1cc});});},'FaxAccounts':function(_0x576379){return new Promise(function(_0x590077,_0x509caf){var _0x176c3f=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x84')]);_0x590077({'count':_0x176c3f[_0x7aa3('0x5b')],'rows':_0x176c3f});});},'SendFax':function(_0x42e1c8){var _0x43bbb9=this;return new Promise(function(_0x1b8cbe,_0x1da203){_0x5b738a[_0x7aa3('0x85')](_0x42e1c8)[_0x7aa3('0x19')](function(_0x1e3a8a){_0x1b8cbe({'code':0xc8,'message':_0x1e3a8a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x1c2195){_0x1da203(_0x43bbb9['error'](0x1f4,_0x1c2195[_0x7aa3('0x1b')]));});});},'CheckAfterSend':function(_0x55515d){var _0x4c2b21=this;return new Promise(function(_0x4c838a,_0x3a0b89){_0x5b738a['checkAfterSend'](_0x55515d)[_0x7aa3('0x19')](function(_0x2954a3){_0x4c838a({'code':0xc8,'message':_0x2954a3[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0xe33081){_0x3a0b89(_0x4c2b21[_0x7aa3('0x12')](0x1f4,_0xe33081[_0x7aa3('0x1b')]));});});}};var _0x5ee939=jayson[_0x7aa3('0x86')](_0x5d1627)[_0x7aa3('0x87')]();_0x5ee939['on'](_0x7aa3('0x12'),function(_0x2523be){return _0xbbcc8a(_0x2523be);});_0x5ee939[_0x7aa3('0x8')](0x232a,_0x7aa3('0x88'),function(){console[_0x7aa3('0x89')](_0x7aa3('0x8a'),0x232a);return _0x437b90(_0x7aa3('0x8b')+0x232a);});});}; \ No newline at end of file +var _0xafc4=['command','Command','voiceQueues','hasOwnProperty','strategy','pTalking','sumBillable','sumHoldTime','talking','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','undefined','values','voicechannel','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','map','channels','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','Hangup','voicequeuechannelredirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','module','action','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xafc4,0x69));var _0x4afc=function(_0xd8b7e0,_0x57fceb){_0xd8b7e0=_0xd8b7e0-0x0;var _0x16ea6c=_0xafc4[_0xd8b7e0];return _0x16ea6c;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var jayson=require(_0x4afc('0x1'));var schema=require('validate');var BPromise=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var config=require(_0x4afc('0x4'));var properties=require(_0x4afc('0x5'));var ami=require('../ami');exports['listen']=function(_0x5378e5,_0x36cb50,_0x471d45){return new BPromise(function(_0x16953b,_0x1bb281){var _0xc828d9={'QueuePause':function(_0xaf053d){return new Promise(function(_0x5e1e29,_0x31e165){var _0x1c740c=util[_0x4afc('0x6')](_0x4afc('0x7'),_0x4afc('0x8'),_0xaf053d[_0x4afc('0x9')]);if(_0x5378e5['timers']&&_0x5378e5['timers'][_0x1c740c]&&_0x5378e5[_0x4afc('0xa')][_0x1c740c]['timer']){_0x5378e5[_0x4afc('0xa')][_0x1c740c][_0x4afc('0xb')]();}if(_0x5378e5['agents'][_0x1c740c]){_0x5378e5[_0x4afc('0xc')][_0x1c740c][_0x4afc('0xd')]({'statePause':_0xaf053d[_0x4afc('0xe')]?!![]:![]});}_0x5e1e29({'code':0xc8,'message':_0x4afc('0xf')});});},'Reload':function(_0x1d8f98){var _0x2f1c59=this;return new Promise(function(_0x1ad8fd,_0x23b03e){if(ami['isConnected']()==![]){return _0x23b03e(_0x2f1c59[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x1d8f98=_[_0x4afc('0x13')](_0x1d8f98,_['keys'](properties[_0x4afc('0x14')]));_0x1d8f98[_0x4afc('0x15')]=_0x4afc('0x16');return ami[_0x4afc('0x17')](_0x1d8f98)[_0x4afc('0x18')](function(_0x3ebdc8){_0x1ad8fd({'code':0xc8,'message':_0x3ebdc8[_0x4afc('0x19')]});})[_0x4afc('0x1a')](function(_0x16365f){_0x23b03e(_0x2f1c59[_0x4afc('0x10')](0x1f5,_0x16365f[_0x4afc('0x19')]));});});},'Command':function(_0x543f0c){var _0x1a8f49=this;return new Promise(function(_0x25603b,_0x32865e){if(ami[_0x4afc('0x1b')]()==![]){return _0x32865e(_0x1a8f49['error'](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}_0x543f0c=_[_0x4afc('0x13')](_0x543f0c,_0x4afc('0x1e'));_0x543f0c['action']=_0x4afc('0x1f');return ami[_0x4afc('0x17')](_0x543f0c)['then'](function(_0x37debf){_0x25603b({'code':0xc8,'message':_0x37debf['content']});})[_0x4afc('0x1a')](function(_0x2a0314){_0x32865e(_0x1a8f49[_0x4afc('0x10')](0x1f5,_0x2a0314[_0x4afc('0x19')]));});});},'VoiceQueues':function(_0x86dbd4){return new Promise(function(_0x28a86c,_0x40a0db){var _0x383a71=[];for(var _0x2bb837 in _0x5378e5[_0x4afc('0x20')]){if(_0x5378e5[_0x4afc('0x20')][_0x4afc('0x21')](_0x2bb837)){var _0x35f5b3=_0x5378e5['voiceQueues'][_0x2bb837];var _0xc3952e={'id':_0x35f5b3['id'],'name':_0x35f5b3[_0x4afc('0x9')],'strategy':_0x35f5b3[_0x4afc('0x22')],'answered':_0x35f5b3['answered'],'available':_0x35f5b3['available'],'loggedIn':_0x35f5b3['loggedIn'],'pTalking':_0x35f5b3[_0x4afc('0x23')],'sumBillable':_0x35f5b3[_0x4afc('0x24')],'sumDuration':_0x35f5b3['sumDuration'],'sumHoldTime':_0x35f5b3[_0x4afc('0x25')]||0x0,'talking':_0x35f5b3[_0x4afc('0x26')],'total':_0x35f5b3['total'],'type':_0x35f5b3['type'],'unmanaged':_0x35f5b3['unmanaged'],'abandoned':_0x35f5b3[_0x4afc('0x27')],'waiting':_0x35f5b3[_0x4afc('0x28')],'loggedInDb':_0x35f5b3[_0x4afc('0x29')]};if(_0x35f5b3[_0x4afc('0x2a')]===_0x4afc('0x2b')){_0xc3952e[_0x4afc('0x2c')]=_0x35f5b3['dialActive'];_0xc3952e[_0x4afc('0x2d')]=_0x35f5b3[_0x4afc('0x2d')];_0xc3952e[_0x4afc('0x2e')]=_0x35f5b3[_0x4afc('0x2e')];_0xc3952e[_0x4afc('0x2f')]=_0x35f5b3[_0x4afc('0x2f')];_0xc3952e[_0x4afc('0x30')]=_0x35f5b3[_0x4afc('0x30')];_0xc3952e['dialPrefix']=_0x35f5b3[_0x4afc('0x31')];_0xc3952e['temp']=_0x35f5b3['temp'];_0xc3952e[_0x4afc('0x32')]=_0x35f5b3[_0x4afc('0x32')];_0xc3952e[_0x4afc('0x33')]=_0x35f5b3[_0x4afc('0x33')];_0xc3952e[_0x4afc('0x34')]=_0x35f5b3[_0x4afc('0x34')];_0xc3952e['outboundBusyCallsDay']=_0x35f5b3[_0x4afc('0x35')];_0xc3952e[_0x4afc('0x36')]=_0x35f5b3[_0x4afc('0x36')];_0xc3952e[_0x4afc('0x37')]=_0x35f5b3[_0x4afc('0x37')];_0xc3952e[_0x4afc('0x38')]=_0x35f5b3['outboundDropCallsDayCallersExit'];_0xc3952e[_0x4afc('0x39')]=_0x35f5b3[_0x4afc('0x39')];_0xc3952e[_0x4afc('0x3a')]=_0x35f5b3[_0x4afc('0x3a')];_0xc3952e['outboundNoSuchCallsDay']=_0x35f5b3['outboundNoSuchCallsDay'];_0xc3952e[_0x4afc('0x3b')]=_0x35f5b3[_0x4afc('0x3b')];_0xc3952e[_0x4afc('0x3c')]=_0x35f5b3['outboundReCallsDay'];_0xc3952e['outboundRejectCallsDay']=_0x35f5b3[_0x4afc('0x3d')];_0xc3952e['outboundUnknownCallsDay']=_0x35f5b3['outboundUnknownCallsDay'];_0xc3952e[_0x4afc('0x3e')]=_0x35f5b3[_0x4afc('0x3e')];_0xc3952e[_0x4afc('0x3f')]=_0x35f5b3[_0x4afc('0x3f')];_0xc3952e[_0x4afc('0x40')]=_0x35f5b3[_0x4afc('0x40')];_0xc3952e[_0x4afc('0x41')]=_0x35f5b3[_0x4afc('0x41')];_0xc3952e[_0x4afc('0x42')]=_0x35f5b3[_0x4afc('0x42')];_0xc3952e[_0x4afc('0x43')]=_0x35f5b3[_0x4afc('0x43')];_0xc3952e[_0x4afc('0x44')]=_0x35f5b3[_0x4afc('0x44')];_0xc3952e[_0x4afc('0x45')]=_0x35f5b3['predictiveIntervalHitRate'];_0xc3952e[_0x4afc('0x46')]=_0x35f5b3[_0x4afc('0x46')];_0xc3952e[_0x4afc('0x47')]=_0x35f5b3[_0x4afc('0x47')];_0xc3952e[_0x4afc('0x48')]=_0x35f5b3[_0x4afc('0x48')];_0xc3952e[_0x4afc('0x49')]=_0x35f5b3['predictiveIntervalTotalCalls'];_0xc3952e['message']=_0x35f5b3['message'];_0xc3952e[_0x4afc('0x4a')]=_0x35f5b3[_0x4afc('0x4a')];_0xc3952e['erlangCalls']=_0x35f5b3[_0x4afc('0x4b')];_0xc3952e[_0x4afc('0x4c')]=_0x35f5b3[_0x4afc('0x4c')];_0xc3952e[_0x4afc('0x4d')]=_0x35f5b3['erlangAbandonmentRate'];_0xc3952e[_0x4afc('0x4e')]=_0x35f5b3[_0x4afc('0x4e')];_0xc3952e[_0x4afc('0x4f')]=_0x35f5b3[_0x4afc('0x4f')];_0xc3952e[_0x4afc('0x50')]=_0x35f5b3[_0x4afc('0x50')];}if(_0x35f5b3['Trunk']){_0xc3952e[_0x4afc('0x51')]={'id':_0x35f5b3['Trunk']['id'],'name':_0x35f5b3[_0x4afc('0x51')][_0x4afc('0x9')],'active':_0x35f5b3[_0x4afc('0x51')]['active'],'callerid':_0x35f5b3['Trunk'][_0x4afc('0x52')]};}if(_0x35f5b3[_0x4afc('0x53')]){_0xc3952e[_0x4afc('0x53')]={'id':_0x35f5b3[_0x4afc('0x53')]['id'],'name':_0x35f5b3[_0x4afc('0x53')][_0x4afc('0x9')]};}_0x383a71[_0x4afc('0x54')](_0xc3952e);}}_0x28a86c({'count':_0x383a71[_0x4afc('0x55')],'rows':_0x383a71});});},'UpdateVoiceQueue':function(_0x4c86f3){return new Promise(function(_0x658c5b,_0xb1e91e){var _0x4c1be5=_[_0x4afc('0x56')](_0x5378e5['voiceQueues'],{'id':parseInt(_0x4c86f3['id'])});var _0x20a2d3=_[_0x4afc('0x57')](_0x4c86f3,['id']);if(_0x4c1be5){for(var _0x16c6c4 in _0x20a2d3){if(typeof _0x20a2d3[_0x16c6c4]!=='undefined'&&typeof _0x4c1be5[_0x16c6c4]!==_0x4afc('0x58')){_0x4c1be5[_0x16c6c4]=_0x20a2d3[_0x16c6c4];}}_0x658c5b(_0x4c1be5);}else{_0xb1e91e();}});},'VoiceChannels':function(_0xe5a92){return new Promise(function(_0x1683c1,_0x12d41b){var _0x4772db=_[_0x4afc('0x59')](_0x5378e5['channels']);_0x1683c1({'count':_0x4772db['length'],'rows':_0x4772db});});},'VoiceChannelMixMonitor':function(_0x4f4e46){var _0x32f3b9=this;return new Promise(function(_0x1c5661,_0x42e274){if(ami[_0x4afc('0x1b')]()==![]){return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x48dbe3=schema(properties[_0x4afc('0x5a')])['validate'](_0x4f4e46);if(_0x48dbe3['length']>0x0){return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f4,_['map'](_0x48dbe3,_0x4afc('0x19'))[_0x4afc('0x1d')](',\x20')));}var _0x2fe2ae=_[_0x4afc('0x56')](_0x5378e5['channels'],{'uniqueid':_0x4f4e46[_0x4afc('0x5b')]});if(_0x2fe2ae&&_0x2fe2ae['channel']){var _0x13b502=util[_0x4afc('0x6')](_0x4afc('0x5c'),_0x4f4e46[_0x4afc('0x5d')]||_0x4f4e46[_0x4afc('0x5b')],_0x4f4e46[_0x4afc('0x6')]||_0x4afc('0x5e'));return ami[_0x4afc('0x17')]({'action':_0x4afc('0x5f'),'channel':_0x2fe2ae[_0x4afc('0x60')],'file':_0x13b502,'options':_0x4afc('0x61')})[_0x4afc('0x18')](function(_0x507bfc){var _0x154fcb=_[_0x4afc('0x56')](_0x2fe2ae[_0x4afc('0x62')],{'filename':_0x4afc('0x63')+_0x13b502[_0x4afc('0x64')]()});if(_[_0x4afc('0x65')](_0x154fcb)){_0x2fe2ae[_0x4afc('0x62')][_0x4afc('0x54')]({'filename':_0x4afc('0x63')+_0x13b502[_0x4afc('0x64')](),'createdAt':moment()[_0x4afc('0x6')](_0x4afc('0x66')),'mixmonitorid':_0x507bfc[_0x4afc('0x67')],'status':'rec'});}else{_0x154fcb[_0x4afc('0x67')]=_0x507bfc['mixmonitorid'];_0x154fcb[_0x4afc('0x68')]=_0x4afc('0x69');}_0x1c5661({'code':0xc8,'message':[_0x4f4e46[_0x4afc('0x5b')],_0x4afc('0x6a'),_0x507bfc['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x507bfc[_0x4afc('0x67')]});})[_0x4afc('0x1a')](function(_0x5f16cb){_0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f5,[_0x4f4e46[_0x4afc('0x5b')],_0x5f16cb[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x13891d){var _0x24e1d3=this;return new Promise(function(_0x3369a8,_0x4295a5){if(ami[_0x4afc('0x1b')]()==![]){return _0x4295a5(_0x24e1d3[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config['asterisk'][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x19cb0b=schema(properties[_0x4afc('0x5a')])[_0x4afc('0x6c')](_0x13891d);if(_0x19cb0b[_0x4afc('0x55')]>0x0){return _0x4295a5(_0x24e1d3['error'](0x1f4,_[_0x4afc('0x6d')](_0x19cb0b,_0x4afc('0x19'))['join'](',\x20')));}var _0x4b3439=_[_0x4afc('0x56')](_0x5378e5[_0x4afc('0x6e')],{'uniqueid':_0x13891d[_0x4afc('0x5b')]});if(_0x4b3439){return BPromise[_0x4afc('0x6f')]()[_0x4afc('0x18')](function(){if(_0x4b3439[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':_0x4afc('0x70'),'channel':_0x4b3439[_0x4afc('0x60')],'mixmonitorid':_0x13891d[_0x4afc('0x67')]})['catch'](function(_0x59418e){});}})[_0x4afc('0x18')](function(){if(_0x4b3439[_0x4afc('0x71')]){return ami['Action']({'action':_0x4afc('0x70'),'channel':_0x4b3439[_0x4afc('0x71')],'mixmonitorid':_0x13891d['mixmonitorid']})['catch'](function(_0x1b49cd){});}})[_0x4afc('0x18')](function(_0x576ea0){var _0x53792a=_[_0x4afc('0x56')](_0x4b3439['monitors'],{'mixmonitorid':_0x13891d['mixmonitorid']});if(_0x53792a){_0x53792a[_0x4afc('0x68')]=_0x4afc('0x72');}})[_0x4afc('0x18')](function(){var _0xdf2b=util[_0x4afc('0x6')](_0x4afc('0x5c'),_0x13891d[_0x4afc('0x5d')]||_0x13891d[_0x4afc('0x5b')],_0x13891d[_0x4afc('0x6')]||'wav');var _0x25969c=_[_0x4afc('0x56')](_0x4b3439[_0x4afc('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0xdf2b['toLowerCase']()});if(_0x25969c){_0x25969c['status']=_0x4afc('0x72');}})[_0x4afc('0x18')](function(){_0x3369a8({'code':0xc8,'message':[_0x13891d[_0x4afc('0x5b')],'StopMixMonitor\x20Success'][_0x4afc('0x1d')]('\x20')});})['catch'](function(_0x55b178){_0x4295a5(_0x24e1d3['error'](0x1f5,[_0x13891d[_0x4afc('0x5b')],_0x55b178[_0x4afc('0x19')][_0x4afc('0x64')]()]['join']('\x20')));});}else{return _0x4295a5(_0x24e1d3[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannels':function(_0x18ab12){return new Promise(function(_0x5e3e9b,_0x3b161b){var _0xbb83e8=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x73')]);_0x5e3e9b({'count':_0xbb83e8[_0x4afc('0x55')],'rows':_0xbb83e8});});},'VoiceQueuesChannel':function(_0x481263){var _0x549e31=this;return new Promise(function(_0x367224,_0x250456){var _0x25513f=schema(properties['voicequeuechannel'])[_0x4afc('0x6c')](_0x481263);if(_0x25513f[_0x4afc('0x55')]>0x0){return _0x250456(_0x549e31[_0x4afc('0x10')](0x1f4,_[_0x4afc('0x6d')](_0x25513f,_0x4afc('0x19'))['join'](',\x20')));}var _0x1ef397=_[_0x4afc('0x56')](_0x5378e5['queueChannels'],{'uniqueid':_0x481263[_0x4afc('0x5b')]});if(_0x1ef397){_0x367224(_0x1ef397);}else{return _0x250456(_0x549e31[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x4ca3e8){var _0x13c11f=this;return new Promise(function(_0x755c8,_0x83587){if(ami[_0x4afc('0x1b')]()==![]){return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],'ami\x20disconnected'][_0x4afc('0x1d')]('\x20')));}var _0x5e3290=schema(properties['voicequeuechannelhangup'])[_0x4afc('0x6c')](_0x4ca3e8);if(_0x5e3290[_0x4afc('0x55')]>0x0){return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f4,_['map'](_0x5e3290,'message')[_0x4afc('0x1d')](',\x20')));}var _0x222e68=_[_0x4afc('0x56')](_0x5378e5[_0x4afc('0x73')],{'uniqueid':_0x4ca3e8[_0x4afc('0x5b')]});if(_0x222e68&&_0x222e68[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':_0x4afc('0x74'),'channel':_0x222e68[_0x4afc('0x60')]})[_0x4afc('0x18')](function(_0x3e846f){_0x755c8({'code':0xc8,'message':[_0x4ca3e8[_0x4afc('0x5b')],_0x3e846f[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')});})[_0x4afc('0x1a')](function(_0x4f8b24){_0x83587(_0x13c11f[_0x4afc('0x10')](0x1f5,[_0x4ca3e8[_0x4afc('0x5b')],_0x4f8b24[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x158522){var _0x39c259=this;return new Promise(function(_0x4d3da7,_0x352f0c){if(ami[_0x4afc('0x1b')]()==![]){return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config['asterisk'][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x4956b2=schema(properties[_0x4afc('0x75')])[_0x4afc('0x6c')](_0x158522);if(_0x4956b2[_0x4afc('0x55')]>0x0){return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f4,_[_0x4afc('0x6d')](_0x4956b2,_0x4afc('0x19'))['join'](',\x20')));}var _0xbbcbf4=_[_0x4afc('0x56')](_0x5378e5['queueChannels'],{'uniqueid':_0x158522[_0x4afc('0x5b')]});if(_0xbbcbf4&&_0xbbcbf4[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':'Redirect','channel':_0xbbcbf4[_0x4afc('0x60')],'exten':_0x158522[_0x4afc('0x76')],'context':_0x158522[_0x4afc('0x77')]||_0xbbcbf4[_0x4afc('0x77')],'priority':0x1})['then'](function(_0x1bbe21){_0x4d3da7({'code':0xc8,'message':[_0x158522[_0x4afc('0x5b')],_0x1bbe21['message'][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')});})[_0x4afc('0x1a')](function(_0x4dda04){_0x352f0c(_0x39c259['error'](0x1f5,[_0x158522[_0x4afc('0x5b')],_0x4dda04[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'Agents':function(_0x90de0b){return new Promise(function(_0x1949c6,_0x217416){var _0xbaff5f=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0xc')]);_0x1949c6({'count':_0xbaff5f[_0x4afc('0x55')],'rows':_0xbaff5f});});},'Telephones':function(_0x257d02){return new Promise(function(_0x23a491,_0x143340){var _0x5d0ae9=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x78')]);_0x23a491({'count':_0x5d0ae9['length'],'rows':_0x5d0ae9});});},'Trunks':function(_0xd8f88a){return new Promise(function(_0x4d92e6,_0x4b93ea){var _0x6ac9ae=_['values'](_0x5378e5['trunks']);_0x4d92e6({'count':_0x6ac9ae[_0x4afc('0x55')],'rows':_0x6ac9ae});});},'OutboundChannels':function(_0x529582){return new Promise(function(_0x1ca8fb,_0x492301){var _0x313c1e=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x79')]);_0x1ca8fb({'count':_0x313c1e[_0x4afc('0x55')],'rows':_0x313c1e});});},'Outbound':function(_0x453eef){return new Promise(function(_0x4fb4a4,_0xc437a0){_0x4fb4a4(_0x5378e5[_0x4afc('0x2b')]);});},'Campaigns':function(_0x4cb780){return new Promise(function(_0x4f97a4,_0x47038f){var _0x1b6b80=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x7a')]);_0x4f97a4({'count':_0x1b6b80[_0x4afc('0x55')],'rows':_0x1b6b80});});},'VoiceQueuesPreview':function(_0x5dea36){var _0x995172=this;return new Promise(function(_0x2d1f15,_0x2516e4){_0x36cb50[_0x4afc('0x7b')](_0x5dea36['id'])['then'](function(_0x114e0f){_0x2d1f15({'code':0xc8,'message':_0x114e0f['message']});})[_0x4afc('0x1a')](function(_0x1f1d31){_0x2516e4(_0x995172[_0x4afc('0x10')](0x1f4,_0x1f1d31[_0x4afc('0x19')]));});});},'EventManager':function(_0xa580ad){var _0x29c8aa=this;return new Promise(function(_0x3e67ba,_0xee0744){if(!_0xa580ad[_0x4afc('0x7c')]){return _0xee0744(_0x29c8aa[_0x4afc('0x10')](0x1f4,_0x4afc('0x7d')));}ami['emit'](_0x4afc('0x7e')+_0xa580ad['event'],_0xa580ad[_0x4afc('0x19')]);_0x3e67ba({'code':0xc8,'message':_0xa580ad});});},'FaxAccounts':function(_0x4b40db){return new Promise(function(_0x50198d,_0x681c5e){var _0x5965e0=_['values'](_0x5378e5[_0x4afc('0x7f')]);_0x50198d({'count':_0x5965e0['length'],'rows':_0x5965e0});});},'SendFax':function(_0x272e36){var _0x24bf53=this;return new Promise(function(_0x5b1421,_0x1fabaa){_0x471d45[_0x4afc('0x80')](_0x272e36)['then'](function(_0x3a9836){_0x5b1421({'code':0xc8,'message':_0x3a9836[_0x4afc('0x19')]});})[_0x4afc('0x1a')](function(_0x4c900a){_0x1fabaa(_0x24bf53[_0x4afc('0x10')](0x1f4,_0x4c900a[_0x4afc('0x19')]));});});},'CheckAfterSend':function(_0x40c7c8){var _0x16eb6d=this;return new Promise(function(_0xa5dc59,_0xbdeb7d){_0x471d45['checkAfterSend'](_0x40c7c8)['then'](function(_0x217650){_0xa5dc59({'code':0xc8,'message':_0x217650[_0x4afc('0x19')]});})['catch'](function(_0x28381d){_0xbdeb7d(_0x16eb6d[_0x4afc('0x10')](0x1f4,_0x28381d['message']));});});}};var _0xad8995=jayson[_0x4afc('0x81')](_0xc828d9)[_0x4afc('0x82')]();_0xad8995['on'](_0x4afc('0x10'),function(_0x2585b3){return _0x1bb281(_0x2585b3);});_0xad8995['listen'](0x232a,_0x4afc('0x83'),function(){console[_0x4afc('0x84')](_0x4afc('0x85'),0x232a);return _0x16953b(_0x4afc('0x86')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 8162f35..134a50d 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 _0x48a1=['info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','merge','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','localhost','[CM][%s][%s]','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','resolve','then','getContacts','isEmpty','length'];(function(_0x4e9913,_0x2c3185){var _0x4c2dd8=function(_0x4a0461){while(--_0x4a0461){_0x4e9913['push'](_0x4e9913['shift']());}};_0x4c2dd8(++_0x2c3185);}(_0x48a1,0x78));var _0x148a=function(_0x57cc1d,_0x5c2cc3){_0x57cc1d=_0x57cc1d-0x0;var _0x2cf4ba=_0x48a1[_0x57cc1d];return _0x2cf4ba;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x148a('0x0'));var config=require(_0x148a('0x1'));var logger=require(_0x148a('0x2'))('trigger');var cmContactRpc=require(_0x148a('0x3'));config[_0x148a('0x4')]=_['defaults'](config[_0x148a('0x4')],{'host':_0x148a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x148a('0x4')]));function emit(_0x480659,_0x374ddf,_0x190fe5,_0x19033e,_0xdaa038){logger['info'](_0x148a('0x6'),_0x480659,_0x374ddf['id'],_0x190fe5,_0x19033e,JSON['stringify'](_0xdaa038));io['to'](_0x190fe5)[_0x148a('0x7')](_0x19033e,_0xdaa038);}exports[_0x148a('0x8')]=function(_0x48eb0f,_0x151687,_0x3ab234,_0x4c7844){var _0x4b3d06,_0xb7952b;var _0xa3fef8={};var _0x4c481e=Number(_0x3ab234['data1']);var _0x35e46d=_0x3ab234[_0x148a('0x9')]?Boolean(Number(_0x3ab234['data2'])):![];var _0x55ed06;if(_0x4c7844[_0x148a('0xa')]){_0xa3fef8['id']=_0x4c7844[_0x148a('0xa')];}if(!_0xa3fef8['id']){_0xa3fef8[_0x148a('0xb')]=_0x4c481e;_0x55ed06=_0x3ab234[_0x148a('0xc')]&&_0x3ab234['data3']!=='0'?_0x3ab234['data3'][_0x148a('0xd')](','):[_0x148a('0xe')];_0xa3fef8[_0x148a('0xf')]=_[_0x148a('0x10')](_0x55ed06,function(_0x1ac3d7){var _0x24b061={};_0x24b061[_0x1ac3d7]=_0x4c7844[_0x148a('0x11')]?_0x4c7844[_0x148a('0x12')]:_0x4c7844[_0x148a('0x13')];return _0x24b061;});}var _0xf2dd36=['id',_0x148a('0x14'),_0x148a('0x15'),_0x148a('0xe'),_0x148a('0x16'),'fax',_0x148a('0xb'),_0x148a('0x17'),'scheduledAt',_0x148a('0x18')];var _0xe40e28=_['union'](_0xf2dd36,_0x55ed06);BPromise[_0x148a('0x19')]()[_0x148a('0x1a')](cmContactRpc[_0x148a('0x1b')]({'attributes':_0xe40e28,'where':_0xa3fef8}))[_0x148a('0x1a')](function(_0x235b55){_0xb7952b=_0x235b55;if(!_[_0x148a('0x1c')](_0xb7952b)){if(_0xb7952b[_0x148a('0x1d')]===0x1){_0x4b3d06=_0xb7952b[0x0];logger[_0x148a('0x1e')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4c7844[_0x148a('0x1f')],_0x151687['id'],_0x4b3d06['id']);}else{logger[_0x148a('0x1e')](_0x148a('0x20'),_0x4c7844[_0x148a('0x1f')],_0x151687['id'],_['map'](_0xb7952b,'id')[_0x148a('0x21')](','));}return;}else{logger[_0x148a('0x1e')](_0x148a('0x22'),_0x4c7844[_0x148a('0x1f')],_0x151687['id']);var _0xe16fce={'ListId':_0x4c481e};var _0x1e85f2=_0x3ab234[_0x148a('0x23')]&&_0x3ab234[_0x148a('0x23')]!=='0'?_0x3ab234[_0x148a('0x23')]:_0x148a('0xe');if(_0x35e46d){logger[_0x148a('0x1e')](_0x148a('0x24'),_0x4c7844['uniqueid'],_0x151687['id']);_0xe16fce[_0x1e85f2]=_[_0x148a('0x25')](_0x4c7844['routeId'])?_0x4c7844[_0x148a('0x13')]:_0x4c7844[_0x148a('0x12')];if(_[_0x148a('0x25')](_0x4c7844['routeId'])){_0xe16fce[_0x148a('0x14')]=_0x4c7844['calleridname']&&_0x4c7844[_0x148a('0x26')]!==_0x148a('0x27')?_0x4c7844[_0x148a('0x26')]:'Unknown';}else{_0xe16fce[_0x148a('0x14')]=_0x4c7844[_0x148a('0x28')]&&_0x4c7844['destcalleridname']!==''?_0x4c7844['destcalleridname']:_0x148a('0x29');}return BPromise[_0x148a('0x19')]()['then'](cmContactRpc[_0x148a('0x2a')](_0xe16fce))[_0x148a('0x1a')](function(_0x110b7c){_0x4b3d06=_0x110b7c;_0xb7952b[_0x148a('0x2b')](_0x110b7c);if(_0x4b3d06){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x4c7844[_0x148a('0x1f')],_0x151687['id'],_0x4b3d06['id']);}return;});}else{logger[_0x148a('0x1e')](_0x148a('0x2c'),_0x4c7844[_0x148a('0x1f')],_0x151687['id']);_0xe16fce[_0x1e85f2]=_[_0x148a('0x25')](_0x4c7844[_0x148a('0x11')])?_0x4c7844['calleridnum']:_0x4c7844['destcalleridnum'];if(_[_0x148a('0x25')](_0x4c7844['routeId'])){_0xe16fce[_0x148a('0x14')]=_0x4c7844[_0x148a('0x26')]&&_0x4c7844[_0x148a('0x26')]!==_0x148a('0x27')?_0x4c7844[_0x148a('0x26')]:'Unknown';}else{_0xe16fce[_0x148a('0x14')]=_0x4c7844[_0x148a('0x28')]&&_0x4c7844[_0x148a('0x28')]!==_0x148a('0x27')?_0x4c7844['destcalleridname']:_0x148a('0x29');}_0x4b3d06=_0xe16fce;_0xb7952b[_0x148a('0x2b')](_0xe16fce);return;}}})[_0x148a('0x1a')](function(){if(_0x48eb0f){emit(_0x4c7844[_0x148a('0x1f')],_0x151687,util['format'](_0x148a('0x2d'),_0x48eb0f[_0x148a('0x2e')]),util[_0x148a('0x2f')](_0x148a('0x30'),_0x3ab234['action']['toLowerCase']()),{'evt':_[_0x148a('0x31')](_0x4c7844,{'autoCreate':_0x35e46d}),'contact':_0x4b3d06===undefined?{}:_0x4b3d06,'contacts':_0xb7952b['length']===0x0?undefined:_0xb7952b});}});}; \ No newline at end of file +var _0xf6b0=['name','trigger:%s','action','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','ListId','data3','phone','$or','map','routeId','calleridnum','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','firstName','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','format','user:%s'];(function(_0x23755a,_0x1bc876){var _0x227947=function(_0x863fba){while(--_0x863fba){_0x23755a['push'](_0x23755a['shift']());}};_0x227947(++_0x1bc876);}(_0xf6b0,0x7a));var _0x0f6b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf6b0[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var BPromise=require(_0x0f6b('0x0'));var Redis=require(_0x0f6b('0x1'));var util=require(_0x0f6b('0x2'));var config=require(_0x0f6b('0x3'));var logger=require(_0x0f6b('0x4'))(_0x0f6b('0x5'));var cmContactRpc=require(_0x0f6b('0x6'));config[_0x0f6b('0x7')]=_[_0x0f6b('0x8')](config[_0x0f6b('0x7')],{'host':_0x0f6b('0x9'),'port':0x18eb});var io=require(_0x0f6b('0xa'))(new Redis(config[_0x0f6b('0x7')]));function emit(_0x44d388,_0x2d11fc,_0x259c22,_0x284db4,_0x4fe162){logger[_0x0f6b('0xb')](_0x0f6b('0xc'),_0x44d388,_0x2d11fc['id'],_0x259c22,_0x284db4,JSON['stringify'](_0x4fe162));io['to'](_0x259c22)[_0x0f6b('0xd')](_0x284db4,_0x4fe162);}exports[_0x0f6b('0xe')]=function(_0x44275b,_0x5f367e,_0x5c6ab5,_0x17c94d){var _0x2e4ea1,_0x5e9504;var _0x49e8e5={};var _0x2961d2=Number(_0x5c6ab5[_0x0f6b('0xf')]);var _0x29dd71=_0x5c6ab5[_0x0f6b('0x10')]?Boolean(Number(_0x5c6ab5[_0x0f6b('0x10')])):![];var _0x3f7b8b;if(_0x17c94d['xmd-contactid']){_0x49e8e5['id']=_0x17c94d[_0x0f6b('0x11')];}if(!_0x49e8e5['id']){_0x49e8e5[_0x0f6b('0x12')]=_0x2961d2;_0x3f7b8b=_0x5c6ab5[_0x0f6b('0x13')]&&_0x5c6ab5[_0x0f6b('0x13')]!=='0'?_0x5c6ab5[_0x0f6b('0x13')]['split'](','):[_0x0f6b('0x14')];_0x49e8e5[_0x0f6b('0x15')]=_[_0x0f6b('0x16')](_0x3f7b8b,function(_0x3ca06e){var _0xd1035c={};_0xd1035c[_0x3ca06e]=_0x17c94d[_0x0f6b('0x17')]?_0x17c94d['destcalleridnum']:_0x17c94d[_0x0f6b('0x18')];return _0xd1035c;});}var _0x3e9191=['id','firstName','lastName',_0x0f6b('0x14'),_0x0f6b('0x19'),_0x0f6b('0x1a'),_0x0f6b('0x12'),_0x0f6b('0x1b'),_0x0f6b('0x1c'),_0x0f6b('0x1d')];var _0x174363=_[_0x0f6b('0x1e')](_0x3e9191,_0x3f7b8b);BPromise[_0x0f6b('0x1f')]()[_0x0f6b('0x20')](cmContactRpc[_0x0f6b('0x21')]({'attributes':_0x174363,'where':_0x49e8e5}))['then'](function(_0x606680){_0x5e9504=_0x606680;if(!_[_0x0f6b('0x22')](_0x5e9504)){if(_0x5e9504[_0x0f6b('0x23')]===0x1){_0x2e4ea1=_0x5e9504[0x0];logger[_0x0f6b('0xb')](_0x0f6b('0x24'),_0x17c94d['uniqueid'],_0x5f367e['id'],_0x2e4ea1['id']);}else{logger[_0x0f6b('0xb')](_0x0f6b('0x25'),_0x17c94d[_0x0f6b('0x26')],_0x5f367e['id'],_[_0x0f6b('0x16')](_0x5e9504,'id')[_0x0f6b('0x27')](','));}return;}else{logger[_0x0f6b('0xb')](_0x0f6b('0x28'),_0x17c94d[_0x0f6b('0x26')],_0x5f367e['id']);var _0x78e042={'ListId':_0x2961d2};var _0x2d4835=_0x5c6ab5['data4']&&_0x5c6ab5[_0x0f6b('0x29')]!=='0'?_0x5c6ab5[_0x0f6b('0x29')]:_0x0f6b('0x14');if(_0x29dd71){logger[_0x0f6b('0xb')](_0x0f6b('0x2a'),_0x17c94d[_0x0f6b('0x26')],_0x5f367e['id']);_0x78e042[_0x2d4835]=_[_0x0f6b('0x2b')](_0x17c94d[_0x0f6b('0x17')])?_0x17c94d['calleridnum']:_0x17c94d['destcalleridnum'];if(_[_0x0f6b('0x2b')](_0x17c94d[_0x0f6b('0x17')])){_0x78e042['firstName']=_0x17c94d[_0x0f6b('0x2c')]&&_0x17c94d[_0x0f6b('0x2c')]!==_0x0f6b('0x2d')?_0x17c94d[_0x0f6b('0x2c')]:_0x0f6b('0x2e');}else{_0x78e042[_0x0f6b('0x2f')]=_0x17c94d[_0x0f6b('0x30')]&&_0x17c94d[_0x0f6b('0x30')]!==_0x0f6b('0x2d')?_0x17c94d[_0x0f6b('0x30')]:_0x0f6b('0x2e');}return BPromise[_0x0f6b('0x1f')]()[_0x0f6b('0x20')](cmContactRpc[_0x0f6b('0x31')](_0x78e042))[_0x0f6b('0x20')](function(_0x259ad2){_0x2e4ea1=_0x259ad2;_0x5e9504[_0x0f6b('0x32')](_0x259ad2);if(_0x2e4ea1){logger[_0x0f6b('0xb')](_0x0f6b('0x33'),_0x17c94d[_0x0f6b('0x26')],_0x5f367e['id'],_0x2e4ea1['id']);}return;});}else{logger[_0x0f6b('0xb')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x17c94d['uniqueid'],_0x5f367e['id']);_0x78e042[_0x2d4835]=_[_0x0f6b('0x2b')](_0x17c94d[_0x0f6b('0x17')])?_0x17c94d[_0x0f6b('0x18')]:_0x17c94d[_0x0f6b('0x34')];if(_[_0x0f6b('0x2b')](_0x17c94d[_0x0f6b('0x17')])){_0x78e042[_0x0f6b('0x2f')]=_0x17c94d[_0x0f6b('0x2c')]&&_0x17c94d['calleridname']!==_0x0f6b('0x2d')?_0x17c94d['calleridname']:_0x0f6b('0x2e');}else{_0x78e042[_0x0f6b('0x2f')]=_0x17c94d['destcalleridname']&&_0x17c94d[_0x0f6b('0x30')]!==_0x0f6b('0x2d')?_0x17c94d[_0x0f6b('0x30')]:_0x0f6b('0x2e');}_0x2e4ea1=_0x78e042;_0x5e9504['push'](_0x78e042);return;}}})[_0x0f6b('0x20')](function(){if(_0x44275b){emit(_0x17c94d[_0x0f6b('0x26')],_0x5f367e,util[_0x0f6b('0x35')](_0x0f6b('0x36'),_0x44275b[_0x0f6b('0x37')]),util[_0x0f6b('0x35')](_0x0f6b('0x38'),_0x5c6ab5[_0x0f6b('0x39')]['toLowerCase']()),{'evt':_[_0x0f6b('0x3a')](_0x17c94d,{'autoCreate':_0x29dd71}),'contact':_0x2e4ea1===undefined?{}:_0x2e4ea1,'contacts':_0x5e9504[_0x0f6b('0x23')]===0x0?undefined:_0x5e9504});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0fe0ada..a214fc4 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 _0x10b5=['winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','motionChannel','undefined','voice','status','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winApplication','winArguments','format','user:%s','name','trigger:%s','exec','integration','queue','urlforward','script','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','field','chat','value','ChatWebsiteId','upperFirst','operator','AccountId','message','event','agent','membername','lastevent','routeId','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','url'];(function(_0x4279b2,_0x529b2c){var _0x495284=function(_0x137b83){while(--_0x137b83){_0x4279b2['push'](_0x4279b2['shift']());}};_0x495284(++_0x529b2c);}(_0x10b5,0x6b));var _0x510b=function(_0x5ce18c,_0xa05fe9){_0x5ce18c=_0x5ce18c-0x0;var _0x29bbad=_0x10b5[_0x5ce18c];return _0x29bbad;};'use strict';var util=require(_0x510b('0x0'));var _=require(_0x510b('0x1'));var url=require('url');var Mustache=require(_0x510b('0x2'));var Redis=require(_0x510b('0x3'));var urlforward=require(_0x510b('0x4'));var integration=require(_0x510b('0x5'));var cmContact=require('./cmContact');var script=require(_0x510b('0x6'));var config=require(_0x510b('0x7'));var logger=require(_0x510b('0x8'))(_0x510b('0x9'));var ami=require(_0x510b('0xa'));config[_0x510b('0xb')]=_['defaults'](config[_0x510b('0xb')],{'host':_0x510b('0xc'),'port':0x18eb});var io=require(_0x510b('0xd'))(new Redis(config[_0x510b('0xb')]));var operators={'equals':function(_0xc74555,_0x210490){return _0xc74555==_0x210490;},'not_equals':function(_0x2e1333,_0x4956c8){return _0x2e1333!=_0x4956c8;}};var barAndWebActions=[_0x510b('0xe'),_0x510b('0xf'),_0x510b('0x10')];function Trigger(_0x437d56){this[_0x510b('0x11')]=_0x437d56[_0x510b('0x11')];this['agents']=_0x437d56[_0x510b('0x12')];this[_0x510b('0x13')]=_0x437d56['voiceQueues'];this[_0x510b('0x14')]=_0x437d56[_0x510b('0x14')];this[_0x510b('0x15')]=_0x437d56[_0x510b('0x15')];this[_0x510b('0x16')]=_0x437d56[_0x510b('0x16')];this[_0x510b('0x17')]=_0x437d56['freshdeskAccounts'];this['salesforceAccounts']=_0x437d56['salesforceAccounts'];this['sugarcrmAccounts']=_0x437d56[_0x510b('0x18')];this[_0x510b('0x19')]=_0x437d56[_0x510b('0x19')];this[_0x510b('0x1a')]=_0x437d56[_0x510b('0x1a')];this[_0x510b('0x1b')]=_0x437d56[_0x510b('0x1b')];this[_0x510b('0x1c')]=_0x437d56['servicenowAccounts'];this[_0x510b('0x1d')]=_0x437d56[_0x510b('0x1d')];this[_0x510b('0x1e')]=_0x437d56['freshsalesAccounts'];this[_0x510b('0x1f')]={'zendesk':this[_0x510b('0x16')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x510b('0x17')],'sugarcrm':this[_0x510b('0x18')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x510b('0x1d')],'freshsales':this[_0x510b('0x1e')],'servicenow':this[_0x510b('0x1c')]};ami['on'](_0x510b('0x20'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on']('custom:agentconnect',this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x23'),this[_0x510b('0x21')]['bind'](this));ami['on'](_0x510b('0x24'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x25'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x26'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x27'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x28'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x29'),this['syncCustomEvent'][_0x510b('0x22')](this));ami['on'](_0x510b('0x2a'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x2b'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on']('custom:timeout',this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x2c'),this[_0x510b('0x2d')][_0x510b('0x22')](this));ami['on'](_0x510b('0x2e'),this[_0x510b('0x2d')]['bind'](this));ami['on'](_0x510b('0x2f'),this['syncAgentDial'][_0x510b('0x22')](this));ami['on']('custom:newinteraction',this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on'](_0x510b('0x30'),this['syncCustomEvent']['bind'](this));ami['on']('custom:incomingmessage',this[_0x510b('0x21')]['bind'](this));ami['on'](_0x510b('0x31'),this[_0x510b('0x21')]['bind'](this));ami['on'](_0x510b('0x32'),this[_0x510b('0x21')][_0x510b('0x22')](this));ami['on']('custom:rejectmessage',this[_0x510b('0x21')][_0x510b('0x22')](this));}Trigger[_0x510b('0x33')][_0x510b('0x34')]=function(_0x34da96,_0x99a124,_0x46a080){logger[_0x510b('0x35')](_0x34da96,_0x99a124,JSON['stringify'](_0x46a080));io['to'](_0x34da96)[_0x510b('0x34')](_0x99a124,_0x46a080);};Trigger[_0x510b('0x33')][_0x510b('0x21')]=function(_0x50927c){var _0x530566=_['clone'](_0x50927c);if(typeof _0x530566[_0x510b('0x36')]===_0x510b('0x37')){_0x530566[_0x510b('0x36')]=_0x510b('0x38');}this['checkTriggers'](_0x530566);};Trigger[_0x510b('0x33')]['syncAgentDial']=function(_0x3af8c7){if(this['agents'][_0x3af8c7['interface']]){this[_0x510b('0x21')](_0x3af8c7);}};Trigger[_0x510b('0x33')]['checkTriggers']=function(_0x4b1b7d){var _0x2cf134;for(var _0x1d7be3 in this['triggers']){if(this[_0x510b('0x11')]['hasOwnProperty'](_0x1d7be3)){if(this[_0x510b('0x11')][_0x1d7be3][_0x510b('0x39')]){_0x2cf134=this[_0x510b('0x3a')](this[_0x510b('0x11')][_0x1d7be3],_0x4b1b7d);if(_0x2cf134){_[_0x510b('0x3b')](_0x4b1b7d,_0x4b1b7d[_0x510b('0x3c')]);for(var _0x47a723=0x0,_0x5586a7,_0x9fc839,_0x7bed80;_0x47a7230x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','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','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x26c502,_0x6b6b84){var _0x130131=function(_0x1ba849){while(--_0x1ba849){_0x26c502['push'](_0x26c502['shift']());}};_0x130131(++_0x6b6b84);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index f1f3a42..926562a 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 _0x16dc=['assign','Subjects','Descriptions','/contacts(','/systemusers(','Fields','ticketType','phonecall','phonecalls','getString','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','inspect','bluebird','request-promise','util','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','telephone1','forEach','includes','picklist','type','idField','indexOf','content','incidents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x16dc,0x1ef));var _0xc16d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16dc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var BPromise=require(_0xc16d('0x0'));var rp=require(_0xc16d('0x1'));var util=require(_0xc16d('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xc16d('0x3'));var logger=require(_0xc16d('0x4'))(_0xc16d('0x5'));var config=require('../../../../config/environment');config[_0xc16d('0x6')]=_[_0xc16d('0x7')](config[_0xc16d('0x6')],{'host':_0xc16d('0x8'),'port':0x18eb});var io=require(_0xc16d('0x9'))(new Redis(config[_0xc16d('0x6')]));function getAuthToken(_0x18c386,_0x5d3226,_0x37c14b){var _0x308e3a={'method':_0xc16d('0xa'),'uri':_0x5d3226,'form':{'client_id':_0x18c386['clientId'],'resource':_0x18c386[_0xc16d('0xb')],'username':_0x18c386[_0xc16d('0xc')],'password':_0x18c386[_0xc16d('0xd')],'grant_type':_0xc16d('0xd'),'client_secret':_0x18c386[_0xc16d('0xe')]},'json':!![]};return rp(_0x308e3a)[_0xc16d('0xf')](function(_0x4f7b91){return _0x4f7b91[_0xc16d('0x10')];})[_0xc16d('0x11')](function(_0x170633){logger[_0xc16d('0x12')]('['+[_0x37c14b[_0xc16d('0x13')]()]+_0xc16d('0x14'));return _0x170633[_0xc16d('0x15')];});}function getUser(_0x19d5db,_0x1075f9,_0x5c56a4,_0x3a6a91,_0x436630,_0x5a69d6){return new BPromise(function(_0x9389b7,_0xa38c6c){return getAuthToken(_0x1075f9,_0x3a6a91,_0x5a69d6)[_0xc16d('0xf')](function(_0x583b6b){var _0x86b622={'method':'GET','uri':_0x436630+_0xc16d('0x16'),'headers':{'Authorization':_0xc16d('0x17')+_0x583b6b,'OData-Version':_0xc16d('0x18')},'json':!![]};return rp(_0x86b622);})[_0xc16d('0xf')](function(_0x457545){var _0x1ca1c1=_0x457545['value'];var _0x5479de=![];var _0x19076a=null;if(!_[_0xc16d('0x19')](_0x5c56a4)){if(intUtil['validateEmail'](_0x5c56a4['email'])){_0x19d5db['userEmail']=_0x5c56a4['email'];for(_0x19076a=0x0;_0x19076a<_0x1ca1c1[_0xc16d('0x1a')];_0x19076a++){if(_0x1ca1c1[_0x19076a][_0xc16d('0x1b')]===_0x5c56a4['email']&&!_0x1ca1c1[_0x19076a][_0xc16d('0x1c')]){_0x5479de=!![];logger[_0xc16d('0x1d')]('['+[_0x5a69d6[_0xc16d('0x13')]()]+_0xc16d('0x1e')+_0x1ca1c1[_0x19076a][_0xc16d('0x1f')]+'!');_0x19d5db[_0xc16d('0x20')]=_0x1ca1c1[_0x19076a][_0xc16d('0x1f')];}}}}if(!_0x5479de){logger[_0xc16d('0x1d')]('['+[_0x5a69d6[_0xc16d('0x13')]()]+_0xc16d('0x21'));_0x19d5db[_0xc16d('0x22')]=_0x1075f9['username'];for(_0x19076a=0x0;_0x19076a<_0x1ca1c1[_0xc16d('0x1a')];_0x19076a++){if(_0x1ca1c1[_0x19076a][_0xc16d('0x1b')]===_0x1075f9['username']){_0x19d5db['userId']=_0x1ca1c1[_0x19076a][_0xc16d('0x1f')];}}}_0x9389b7(_0x19d5db);})[_0xc16d('0x11')](function(_0x9bc88d){_0xa38c6c(_0x9bc88d['message']);});});}function createEndUser(_0x1dfbd4,_0x336839,_0x35a6eb,_0x1e6e0a,_0x3fa751,_0x5936cb){return new BPromise(function(_0x48d84e,_0x10ff2e){return getAuthToken(_0x336839,_0x35a6eb,_0x5936cb)[_0xc16d('0xf')](function(_0x572fab){var _0x111e13=_0x5936cb[_0xc16d('0x23')]()===_0xc16d('0x24')?_0x3fa751[_0xc16d('0x25')]:_0x3fa751[_0xc16d('0x26')];var _0x37b196={'method':'POST','uri':_0x1e6e0a+_0xc16d('0x27'),'body':{'telephone1':_0x111e13,'fullname':_0x111e13,'firstname':_0x111e13,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x1dfbd4[_0xc16d('0x20')]+')'},'headers':{'Authorization':_0xc16d('0x17')+_0x572fab,'OData-Version':_0xc16d('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x37b196);})[_0xc16d('0xf')](function(_0x18db3e){var _0x4bfead=_0x18db3e['headers'][_0xc16d('0x28')];var _0xfa73fc=_0x4bfead[_0xc16d('0x29')](_0x4bfead[_0xc16d('0x2a')]('(')+0x1,_0x4bfead[_0xc16d('0x2a')](')'));_0x1dfbd4[_0xc16d('0x2b')]=_0xfa73fc;_0x48d84e(_0x1dfbd4);})['catch'](function(_0x3457ae){_0x10ff2e(_0x3457ae[_0xc16d('0x15')]);});});}function getEndUser(_0x1a2c65,_0x253946,_0x4abe66,_0x4f20cc,_0x580ca7,_0x300b91){return new BPromise(function(_0x49df84,_0x2ae9bb){var _0xdcb7c4=_0x300b91[_0xc16d('0x23')]()==='outbound'?_0x580ca7[_0xc16d('0x25')]:_0x580ca7[_0xc16d('0x26')];return getAuthToken(_0x253946,_0x4abe66,_0x300b91)['then'](function(_0x16fc26){var _0x2c6ad3={'method':'GET','uri':_0x4f20cc+_0xc16d('0x2c')+_0xdcb7c4[_0xc16d('0x2d')]('+',_0xc16d('0x2e'))+'\x27','headers':{'Authorization':_0xc16d('0x17')+_0x16fc26,'If-None-Match':null,'OData-Version':_0xc16d('0x18')},'json':!![]};return rp(_0x2c6ad3);})[_0xc16d('0xf')](function(_0x4f17ce){var _0x379b3d=null;if(_0x4f17ce){var _0x4a7a9a=_0x4f17ce[_0xc16d('0x2f')];var _0x5d231b=![];for(_0x379b3d=0x0;_0x379b3d<_0x4a7a9a[_0xc16d('0x1a')];_0x379b3d++){if(_0x4a7a9a[_0x379b3d][_0xc16d('0x30')]===_0xdcb7c4){_0x5d231b=!![];_0x1a2c65[_0xc16d('0x2b')]=_0x4a7a9a[_0x379b3d]['contactid'];}}if(_0x5d231b){_0x49df84(_0x1a2c65);}else{return createEndUser(_0x1a2c65,_0x253946,_0x4abe66,_0x4f20cc,_0x580ca7,_0x300b91)['then'](function(_0x1b196d){logger[_0xc16d('0x1d')]('['+[_0x300b91['toUpperCase']()]+']\x20Enduser\x20created!',_0x1b196d['enduserId']);_0x49df84(_0x1b196d);});}}else{return createEndUser(_0x1a2c65,_0x253946,_0x4abe66,_0x4f20cc,_0x580ca7,_0x300b91)['then'](function(_0x328961){logger[_0xc16d('0x1d')]('['+[_0x300b91[_0xc16d('0x13')]()]+']\x20Enduser\x20Created!',_0x328961[_0xc16d('0x2b')]);_0x49df84(_0x328961);});}});});}function getCustomFields(_0x34de1b,_0x284b23,_0x5ca279){var _0x2543c1={};if(_0x34de1b[_0xc16d('0x1a')]>0x0){_[_0xc16d('0x31')](_0x34de1b,function(_0x585cab){if(_[_0xc16d('0x32')](['string',_0xc16d('0x33')],_0x585cab[_0xc16d('0x34')])&&_0x585cab['nameField']&&!_0x585cab['customField']){var _0x2b2803=_0x585cab[_0xc16d('0x35')][_0xc16d('0x23')]();var _0xf0b2ce=_0x2b2803[_0xc16d('0x29')](0x0,_0x2b2803[_0xc16d('0x36')]('_'));var _0x3e466f=_0x2b2803[_0xc16d('0x29')](_0x2b2803[_0xc16d('0x36')]('_')+0x1);if(_0xf0b2ce===_0x5ca279){_0x2543c1[_0x3e466f]=_0x585cab[_0xc16d('0x37')];}}});}return _0x2543c1;}function getTicket(_0x28c72a,_0xaf22b3,_0x5517c3,_0x42a623,_0x15dcc4,_0xf0558,_0x1baaab){return new BPromise(function(_0x416dc0,_0x2f261a){var _0x35a94f;return getAuthToken(_0xaf22b3,_0x5517c3,_0x1baaab)[_0xc16d('0xf')](function(_0x1a836f){if(_0xf0558['ticketType']==='incident'){_0x35a94f={'method':_0xc16d('0xa'),'uri':_0x42a623+_0xc16d('0x38'),'body':Object[_0xc16d('0x39')]({},{'title':intUtil['getString'](_0xf0558[_0xc16d('0x3a')],_0x15dcc4,'\x20'),'description':intUtil['getString'](_0xf0558[_0xc16d('0x3b')],_0x15dcc4,'\x0a'),'customerid_contact@odata.bind':_0xc16d('0x3c')+_0x28c72a['enduserId']+')','ownerid@odata.bind':_0xc16d('0x3d')+_0x28c72a[_0xc16d('0x20')]+')','caseorigincode':'1'},getCustomFields(_0xf0558[_0xc16d('0x3e')],_0x15dcc4,_0xf0558[_0xc16d('0x3f')])),'headers':{'Authorization':_0xc16d('0x17')+_0x1a836f,'OData-Version':_0xc16d('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xf0558['ticketType']===_0xc16d('0x40')){_0x35a94f={'method':_0xc16d('0xa'),'uri':_0x42a623+_0xc16d('0x41'),'body':Object['assign']({},{'subject':intUtil[_0xc16d('0x42')](_0xf0558[_0xc16d('0x3a')],_0x15dcc4,'\x20'),'phonenumber':String(_0x15dcc4[_0xc16d('0x26')]),'description':intUtil['getString'](_0xf0558[_0xc16d('0x3b')],_0x15dcc4,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc16d('0x3c')+_0x28c72a[_0xc16d('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x28c72a[_0xc16d('0x20')]+')','directioncode':_0x28c72a[_0xc16d('0x43')]===_0xc16d('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc16d('0x3d')+_0x28c72a[_0xc16d('0x20')]+')','participationtypemask':_0x28c72a[_0xc16d('0x43')]===_0xc16d('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xc16d('0x3c')+_0x28c72a['enduserId']+')','participationtypemask':_0x28c72a['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0xf0558[_0xc16d('0x3e')],_0x15dcc4,_0xf0558[_0xc16d('0x3f')])),'headers':{'Authorization':_0xc16d('0x17')+_0x1a836f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35a94f);})[_0xc16d('0xf')](function(_0x5c546d){var _0x3a2197=_0x5c546d['headers'][_0xc16d('0x28')];var _0x48c020=_0x3a2197[_0xc16d('0x29')](_0x3a2197['lastIndexOf']('(')+0x1,_0x3a2197[_0xc16d('0x2a')](')'));_0x28c72a[_0xc16d('0x45')]=_0x48c020;_0x416dc0(_0x28c72a);})[_0xc16d('0x11')](function(_0x460c4f){_0x2f261a(_0x460c4f[_0xc16d('0x15')]);});});}function emit(_0xca6b95,_0x105d5a,_0x31ee2f,_0x3d58f9){var _0x518c6c={'uri':util['format'](_0xc16d('0x46'),_0xca6b95,_0x31ee2f,_0x3d58f9)};io['to'](util[_0xc16d('0x47')]('user:%s',_0x105d5a))[_0xc16d('0x48')](_0xc16d('0x49'),_0x518c6c);}exports['cs']=function(_0x328a2e,_0x5d0f07,_0x281eac,_0x1018f0,_0x3e9f79,_0x34a4ff,_0x56fa78,_0x4a2d5d){var _0x416d02={};_0x34a4ff[_0xc16d('0xb')]=intUtil[_0xc16d('0x4a')](_0x34a4ff[_0xc16d('0xb')]);_0x34a4ff[_0xc16d('0x4b')]=intUtil['stripTrailingSlash'](_0x34a4ff[_0xc16d('0x4b')]);_0x416d02[_0xc16d('0x43')]=_0x4a2d5d==='queue'||_0x4a2d5d===_0xc16d('0x4c')?_0xc16d('0x44'):_0xc16d('0x24');var _0x3cc449=util[_0xc16d('0x47')](_0xc16d('0x4d'),_0x34a4ff[_0xc16d('0xb')]);var _0x43187a=util['format'](_0xc16d('0x4e'),_0x34a4ff['tenantId']);var _0x15d56c=util[_0xc16d('0x47')](_0xc16d('0x4f'),_0x34a4ff['serverUrl'],_0x5d0f07[_0xc16d('0x50')],md5(_0x5d0f07[_0xc16d('0x50')]));if(_0x3e9f79&&_0x3e9f79[_0xc16d('0x51')]){logger['info']('[QUEUE]',_0xc16d('0x52'));_0x5d0f07[_0xc16d('0x53')]=_0x15d56c;}else if(_0x56fa78&&_0x56fa78[_0xc16d('0x54')]&&_0x56fa78[_0xc16d('0x54')]!==_0xc16d('0x55')){logger[_0xc16d('0x1d')]('[OUTBOUND]',_0xc16d('0x52'));_0x5d0f07[_0xc16d('0x53')]=_0x15d56c;}else{_0x5d0f07['recordingURL']='';}return getUser(_0x416d02,_0x34a4ff,_0x1018f0,_0x43187a,_0x3cc449,_0x4a2d5d)[_0xc16d('0xf')](function(_0x12d2b5){logger[_0xc16d('0x1d')]('['+_0x4a2d5d['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x12d2b5[_0xc16d('0x20')]);logger[_0xc16d('0x1d')]('['+_0x4a2d5d['toUpperCase']()+_0xc16d('0x56'),_0x12d2b5[_0xc16d('0x22')]);return getEndUser(_0x12d2b5,_0x34a4ff,_0x43187a,_0x3cc449,_0x5d0f07,_0x4a2d5d);})[_0xc16d('0xf')](function(_0x46c301){logger[_0xc16d('0x1d')]('['+_0x4a2d5d[_0xc16d('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x46c301['enduserId']);logger[_0xc16d('0x1d')]('['+_0x4a2d5d[_0xc16d('0x13')]()+_0xc16d('0x57'),_0x5d0f07[_0xc16d('0x26')]);return getTicket(_0x46c301,_0x34a4ff,_0x43187a,_0x3cc449,_0x5d0f07,_0x281eac,_0x4a2d5d);})[_0xc16d('0xf')](function(_0xbc1d57){logger['info'](util[_0xc16d('0x47')]('['+_0x4a2d5d[_0xc16d('0x13')]()+_0xc16d('0x58'),_0x281eac[_0xc16d('0x3f')],_0xbc1d57['ticketId']));logger[_0xc16d('0x1d')](util[_0xc16d('0x47')]('['+_0x4a2d5d[_0xc16d('0x13')]()+_0xc16d('0x59'),_0x4a2d5d));if(_0x4a2d5d!==_0xc16d('0x4c')){logger[_0xc16d('0x1d')]('['+_0x4a2d5d[_0xc16d('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x34a4ff[_0xc16d('0xb')],_0x1018f0[_0xc16d('0x5a')],_0x281eac[_0xc16d('0x3f')],_0xbc1d57['ticketId']);}})['catch'](function(_0x55317a){logger[_0xc16d('0x12')]('['+_0x4a2d5d[_0xc16d('0x13')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xc16d('0x5b')](_0x55317a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd2ba=['length','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','catch','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','content','ticketType','incident','incidents','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','assign','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','info','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','POST','clientId','username','password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','email','internalemailaddress','systemuserid','userId'];(function(_0x434e63,_0x31f6b4){var _0x217316=function(_0x3a709d){while(--_0x3a709d){_0x434e63['push'](_0x434e63['shift']());}};_0x217316(++_0x31f6b4);}(_0xd2ba,0x1bc));var _0xad2b=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0xd2ba[_0xe6e3e2];return _0x126571;};'use strict';var _=require('lodash');var BPromise=require(_0xad2b('0x0'));var rp=require(_0xad2b('0x1'));var util=require(_0xad2b('0x2'));var intUtil=require(_0xad2b('0x3'));var md5=require(_0xad2b('0x4'));var Redis=require(_0xad2b('0x5'));var logger=require(_0xad2b('0x6'))(_0xad2b('0x7'));var config=require(_0xad2b('0x8'));config['redis']=_[_0xad2b('0x9')](config['redis'],{'host':_0xad2b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x164c31,_0x26c117,_0x59ffe9){var _0x2bd46d={'method':_0xad2b('0xb'),'uri':_0x26c117,'form':{'client_id':_0x164c31[_0xad2b('0xc')],'resource':_0x164c31['remoteUri'],'username':_0x164c31[_0xad2b('0xd')],'password':_0x164c31[_0xad2b('0xe')],'grant_type':_0xad2b('0xe'),'client_secret':_0x164c31[_0xad2b('0xf')]},'json':!![]};return rp(_0x2bd46d)['then'](function(_0x428a29){return _0x428a29[_0xad2b('0x10')];})['catch'](function(_0x189845){logger[_0xad2b('0x11')]('['+[_0x59ffe9[_0xad2b('0x12')]()]+_0xad2b('0x13'));return _0x189845[_0xad2b('0x14')];});}function getUser(_0x30868f,_0x143d97,_0x3257c7,_0x3dfb4,_0x3732a7,_0x418cdf){return new BPromise(function(_0x4d699d,_0x3b25b7){return getAuthToken(_0x143d97,_0x3dfb4,_0x418cdf)[_0xad2b('0x15')](function(_0x6ff0ae){var _0x1add9c={'method':_0xad2b('0x16'),'uri':_0x3732a7+_0xad2b('0x17'),'headers':{'Authorization':_0xad2b('0x18')+_0x6ff0ae,'OData-Version':_0xad2b('0x19')},'json':!![]};return rp(_0x1add9c);})[_0xad2b('0x15')](function(_0x5494cd){var _0x16a22d=_0x5494cd[_0xad2b('0x1a')];var _0x517d12=![];var _0x5ba0e6=null;if(!_['isNil'](_0x3257c7)){if(intUtil['validateEmail'](_0x3257c7[_0xad2b('0x1b')])){_0x30868f['userEmail']=_0x3257c7['email'];for(_0x5ba0e6=0x0;_0x5ba0e6<_0x16a22d['length'];_0x5ba0e6++){if(_0x16a22d[_0x5ba0e6][_0xad2b('0x1c')]===_0x3257c7[_0xad2b('0x1b')]&&!_0x16a22d[_0x5ba0e6]['isdisabled']){_0x517d12=!![];logger['info']('['+[_0x418cdf['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x16a22d[_0x5ba0e6][_0xad2b('0x1d')]+'!');_0x30868f[_0xad2b('0x1e')]=_0x16a22d[_0x5ba0e6][_0xad2b('0x1d')];}}}}if(!_0x517d12){logger['info']('['+[_0x418cdf[_0xad2b('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x30868f['userEmail']=_0x143d97[_0xad2b('0xd')];for(_0x5ba0e6=0x0;_0x5ba0e6<_0x16a22d[_0xad2b('0x1f')];_0x5ba0e6++){if(_0x16a22d[_0x5ba0e6][_0xad2b('0x1c')]===_0x143d97['username']){_0x30868f[_0xad2b('0x1e')]=_0x16a22d[_0x5ba0e6][_0xad2b('0x1d')];}}}_0x4d699d(_0x30868f);})['catch'](function(_0x1e80f2){_0x3b25b7(_0x1e80f2[_0xad2b('0x14')]);});});}function createEndUser(_0x211e26,_0xa71f41,_0x3ac687,_0x6359be,_0x32364b,_0x252126){return new BPromise(function(_0x5810bd,_0x312214){return getAuthToken(_0xa71f41,_0x3ac687,_0x252126)[_0xad2b('0x15')](function(_0x434dbd){var _0xdc1b24=_0x252126[_0xad2b('0x20')]()===_0xad2b('0x21')?_0x32364b['destcalleridnum']:_0x32364b[_0xad2b('0x22')];var _0xb5467f={'method':_0xad2b('0xb'),'uri':_0x6359be+_0xad2b('0x23'),'body':{'telephone1':_0xdc1b24,'fullname':_0xdc1b24,'firstname':_0xdc1b24,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xad2b('0x24')+_0x211e26[_0xad2b('0x1e')]+')'},'headers':{'Authorization':_0xad2b('0x18')+_0x434dbd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xb5467f);})['then'](function(_0x3b2fc4){var _0x7b04e9=_0x3b2fc4[_0xad2b('0x25')]['odata-entityid'];var _0x12528d=_0x7b04e9[_0xad2b('0x26')](_0x7b04e9['lastIndexOf']('(')+0x1,_0x7b04e9[_0xad2b('0x27')](')'));_0x211e26[_0xad2b('0x28')]=_0x12528d;_0x5810bd(_0x211e26);})[_0xad2b('0x29')](function(_0x302324){_0x312214(_0x302324[_0xad2b('0x14')]);});});}function getEndUser(_0x266b5b,_0x27ab59,_0x17135a,_0x4b7c63,_0x5cebb7,_0x11a7e9){return new BPromise(function(_0x4bd956,_0x3ce44f){var _0x4e3bec=_0x11a7e9[_0xad2b('0x20')]()==='outbound'?_0x5cebb7[_0xad2b('0x2a')]:_0x5cebb7[_0xad2b('0x22')];return getAuthToken(_0x27ab59,_0x17135a,_0x11a7e9)['then'](function(_0x36c31a){var _0x19f81b={'method':_0xad2b('0x16'),'uri':_0x4b7c63+_0xad2b('0x2b')+_0x4e3bec['replace']('+','%2b')+'\x27','headers':{'Authorization':_0xad2b('0x18')+_0x36c31a,'If-None-Match':null,'OData-Version':_0xad2b('0x19')},'json':!![]};return rp(_0x19f81b);})[_0xad2b('0x15')](function(_0x3e8899){var _0x3cd6c7=null;if(_0x3e8899){var _0x79fc47=_0x3e8899[_0xad2b('0x1a')];var _0x397031=![];for(_0x3cd6c7=0x0;_0x3cd6c7<_0x79fc47['length'];_0x3cd6c7++){if(_0x79fc47[_0x3cd6c7]['telephone1']===_0x4e3bec){_0x397031=!![];_0x266b5b[_0xad2b('0x28')]=_0x79fc47[_0x3cd6c7][_0xad2b('0x2c')];}}if(_0x397031){_0x4bd956(_0x266b5b);}else{return createEndUser(_0x266b5b,_0x27ab59,_0x17135a,_0x4b7c63,_0x5cebb7,_0x11a7e9)['then'](function(_0xe49b35){logger['info']('['+[_0x11a7e9['toUpperCase']()]+_0xad2b('0x2d'),_0xe49b35[_0xad2b('0x28')]);_0x4bd956(_0xe49b35);});}}else{return createEndUser(_0x266b5b,_0x27ab59,_0x17135a,_0x4b7c63,_0x5cebb7,_0x11a7e9)[_0xad2b('0x15')](function(_0x413602){logger['info']('['+[_0x11a7e9[_0xad2b('0x12')]()]+_0xad2b('0x2e'),_0x413602[_0xad2b('0x28')]);_0x4bd956(_0x413602);});}});});}function getCustomFields(_0xf8ab9b,_0x3bdc61,_0x1c496c){var _0x5f5dad={};if(_0xf8ab9b['length']>0x0){_[_0xad2b('0x2f')](_0xf8ab9b,function(_0x51321f){if(_[_0xad2b('0x30')]([_0xad2b('0x31'),_0xad2b('0x32')],_0x51321f[_0xad2b('0x33')])&&_0x51321f[_0xad2b('0x34')]&&!_0x51321f[_0xad2b('0x35')]){var _0x38ba5d=_0x51321f['idField'][_0xad2b('0x20')]();var _0x1be5e3=_0x38ba5d[_0xad2b('0x26')](0x0,_0x38ba5d[_0xad2b('0x36')]('_'));var _0x16fc12=_0x38ba5d['substring'](_0x38ba5d['indexOf']('_')+0x1);if(_0x1be5e3===_0x1c496c){_0x5f5dad[_0x16fc12]=_0x51321f[_0xad2b('0x37')];}}});}return _0x5f5dad;}function getTicket(_0x30507c,_0x53a339,_0x3445d3,_0x26e02d,_0x4594a4,_0x2db70f,_0x408f3c){return new BPromise(function(_0x40f0d3,_0x47441c){var _0x2b10ea;return getAuthToken(_0x53a339,_0x3445d3,_0x408f3c)[_0xad2b('0x15')](function(_0x17a034){if(_0x2db70f[_0xad2b('0x38')]===_0xad2b('0x39')){_0x2b10ea={'method':_0xad2b('0xb'),'uri':_0x26e02d+_0xad2b('0x3a'),'body':Object['assign']({},{'title':intUtil[_0xad2b('0x3b')](_0x2db70f[_0xad2b('0x3c')],_0x4594a4,'\x20'),'description':intUtil[_0xad2b('0x3b')](_0x2db70f['Descriptions'],_0x4594a4,'\x0a'),'customerid_contact@odata.bind':_0xad2b('0x3d')+_0x30507c[_0xad2b('0x28')]+')','ownerid@odata.bind':'/systemusers('+_0x30507c[_0xad2b('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x2db70f[_0xad2b('0x3e')],_0x4594a4,_0x2db70f[_0xad2b('0x38')])),'headers':{'Authorization':_0xad2b('0x18')+_0x17a034,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2db70f['ticketType']===_0xad2b('0x3f')){_0x2b10ea={'method':_0xad2b('0xb'),'uri':_0x26e02d+_0xad2b('0x40'),'body':Object[_0xad2b('0x41')]({},{'subject':intUtil['getString'](_0x2db70f[_0xad2b('0x3c')],_0x4594a4,'\x20'),'phonenumber':String(_0x4594a4[_0xad2b('0x22')]),'description':intUtil[_0xad2b('0x3b')](_0x2db70f['Descriptions'],_0x4594a4,'\x0a'),'regardingobjectid_contact@odata.bind':_0xad2b('0x3d')+_0x30507c['enduserId']+')','ownerid@odata.bind':_0xad2b('0x24')+_0x30507c[_0xad2b('0x1e')]+')','directioncode':_0x30507c[_0xad2b('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x30507c[_0xad2b('0x1e')]+')','participationtypemask':_0x30507c['callDirection']===_0xad2b('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xad2b('0x3d')+_0x30507c[_0xad2b('0x28')]+')','participationtypemask':_0x30507c[_0xad2b('0x42')]===_0xad2b('0x43')?0x1:0x2}]},getCustomFields(_0x2db70f[_0xad2b('0x3e')],_0x4594a4,_0x2db70f[_0xad2b('0x38')])),'headers':{'Authorization':_0xad2b('0x18')+_0x17a034,'OData-Version':_0xad2b('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2b10ea);})[_0xad2b('0x15')](function(_0x2c5524){var _0x401956=_0x2c5524[_0xad2b('0x25')][_0xad2b('0x44')];var _0x9f999b=_0x401956[_0xad2b('0x26')](_0x401956[_0xad2b('0x27')]('(')+0x1,_0x401956[_0xad2b('0x27')](')'));_0x30507c[_0xad2b('0x45')]=_0x9f999b;_0x40f0d3(_0x30507c);})[_0xad2b('0x29')](function(_0x5800bc){_0x47441c(_0x5800bc['message']);});});}function emit(_0x329e28,_0x3b1bb6,_0x548fae,_0x4118b6){var _0x38eb2c={'uri':util[_0xad2b('0x46')](_0xad2b('0x47'),_0x329e28,_0x548fae,_0x4118b6)};io['to'](util[_0xad2b('0x46')]('user:%s',_0x3b1bb6))[_0xad2b('0x48')]('trigger:browser:url',_0x38eb2c);}exports['cs']=function(_0x58a252,_0x52a28e,_0x105a47,_0x494518,_0x592a62,_0x4cfaa5,_0xa146d1,_0x24c912){var _0x36d5b3={};_0x4cfaa5[_0xad2b('0x49')]=intUtil[_0xad2b('0x4a')](_0x4cfaa5[_0xad2b('0x49')]);_0x4cfaa5[_0xad2b('0x4b')]=intUtil[_0xad2b('0x4a')](_0x4cfaa5[_0xad2b('0x4b')]);_0x36d5b3[_0xad2b('0x42')]=_0x24c912==='queue'||_0x24c912===_0xad2b('0x4c')?_0xad2b('0x43'):'outbound';var _0x5bbc2d=util[_0xad2b('0x46')](_0xad2b('0x4d'),_0x4cfaa5['remoteUri']);var _0x42a9cd=util['format'](_0xad2b('0x4e'),_0x4cfaa5['tenantId']);var _0x2acdd1=util[_0xad2b('0x46')](_0xad2b('0x4f'),_0x4cfaa5[_0xad2b('0x4b')],_0x52a28e['uniqueid'],md5(_0x52a28e['uniqueid']));if(_0x592a62&&_0x592a62[_0xad2b('0x50')]){logger[_0xad2b('0x51')](_0xad2b('0x52'),_0xad2b('0x53'));_0x52a28e['recordingURL']=_0x2acdd1;}else if(_0xa146d1&&_0xa146d1[_0xad2b('0x54')]&&_0xa146d1[_0xad2b('0x54')]!==_0xad2b('0x55')){logger[_0xad2b('0x51')](_0xad2b('0x56'),_0xad2b('0x53'));_0x52a28e[_0xad2b('0x57')]=_0x2acdd1;}else{_0x52a28e[_0xad2b('0x57')]='';}return getUser(_0x36d5b3,_0x4cfaa5,_0x494518,_0x42a9cd,_0x5bbc2d,_0x24c912)[_0xad2b('0x15')](function(_0xe63946){logger[_0xad2b('0x51')]('['+_0x24c912[_0xad2b('0x12')]()+_0xad2b('0x58'),_0xe63946[_0xad2b('0x1e')]);logger[_0xad2b('0x51')]('['+_0x24c912[_0xad2b('0x12')]()+']\x20The\x20User\x20email\x20is:',_0xe63946['userEmail']);return getEndUser(_0xe63946,_0x4cfaa5,_0x42a9cd,_0x5bbc2d,_0x52a28e,_0x24c912);})[_0xad2b('0x15')](function(_0x42e6d4){logger[_0xad2b('0x51')]('['+_0x24c912['toUpperCase']()+_0xad2b('0x59'),_0x42e6d4[_0xad2b('0x28')]);logger[_0xad2b('0x51')]('['+_0x24c912[_0xad2b('0x12')]()+_0xad2b('0x5a'),_0x52a28e[_0xad2b('0x22')]);return getTicket(_0x42e6d4,_0x4cfaa5,_0x42a9cd,_0x5bbc2d,_0x52a28e,_0x105a47,_0x24c912);})[_0xad2b('0x15')](function(_0x35cbd8){logger['info'](util[_0xad2b('0x46')]('['+_0x24c912[_0xad2b('0x12')]()+_0xad2b('0x5b'),_0x105a47['ticketType'],_0x35cbd8[_0xad2b('0x45')]));logger[_0xad2b('0x51')](util[_0xad2b('0x46')]('['+_0x24c912[_0xad2b('0x12')]()+']\x20Call\x20direction:\x20%s',_0x24c912));if(_0x24c912!=='unmanaged'){logger[_0xad2b('0x51')]('['+_0x24c912['toUpperCase']()+']',_0xad2b('0x5c'));emit(_0x4cfaa5[_0xad2b('0x49')],_0x494518['name'],_0x105a47[_0xad2b('0x38')],_0x35cbd8[_0xad2b('0x45')]);}})[_0xad2b('0x29')](function(_0x4cfa67){logger[_0xad2b('0x11')]('['+_0x24c912[_0xad2b('0x12')]()+_0xad2b('0x5d'),util[_0xad2b('0x5e')](_0x4cfa67,{'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 cbfeddc..c5b0835 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 _0xffec=['Ticket\x20created!','%s/api/v2/agents','remoteUri','then','length','info','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','variableName','push','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','POST'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xffec,0x1b9));var _0xcffe=function(_0x53cf9c,_0x174b65){_0x53cf9c=_0x53cf9c-0x0;var _0x42410e=_0xffec[_0x53cf9c];return _0x42410e;};'use strict';var _=require(_0xcffe('0x0'));var rp=require(_0xcffe('0x1'));var md5=require(_0xcffe('0x2'));var util=require(_0xcffe('0x3'));var Redis=require(_0xcffe('0x4'));var intUtil=require('./util');var config=require(_0xcffe('0x5'));var logger=require(_0xcffe('0x6'))(_0xcffe('0x7'));config['redis']=_[_0xcffe('0x8')](config['redis'],{'host':_0xcffe('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xcffe('0xa'),'Accept':_0xcffe('0xa')};function emit(_0x3cc2a3,_0x394037,_0x2dd107){io['to'](_0x3cc2a3)[_0xcffe('0xb')](_0x394037,_0x2dd107);}function getTicket(_0x4d292f,_0x13eaff,_0x431241,_0x5d25ca,_0x1a089c){logger['info'](_0xcffe('0xc'));var _0x50a7bf=_[_0xcffe('0xd')]({'responder_id':_0x13eaff['id'],'requester_id':_0x431241['id'],'name':util[_0xcffe('0xe')]('Caller\x20-\x20%s',_0x1a089c[_0xcffe('0xf')]),'phone':_0x1a089c[_0xcffe('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcffe('0x11')](_0x5d25ca[_0xcffe('0x12')],_0x1a089c,'\x20'),'description':intUtil[_0xcffe('0x11')](_0x5d25ca[_0xcffe('0x13')],_0x1a089c,_0xcffe('0x14')),'tags':getTags(_0x5d25ca['Tags'],_0xcffe('0x15'))},getCustomFields(_0x5d25ca[_0xcffe('0x16')],_0x1a089c));_0x50a7bf['custom_fields']=_[_0xcffe('0x17')](_[_0xcffe('0x18')](_0x50a7bf[_0xcffe('0x19')],'id'),_0xcffe('0x1a'));return request({'uri':util[_0xcffe('0xe')](_0xcffe('0x1b'),_0x4d292f['remoteUri']),'method':_0xcffe('0x1c'),'body':_0x50a7bf})['then'](function(_0x3a5cc4){logger['info'](_0xcffe('0x1d'));return _0x3a5cc4;});}function getUser(_0x1a4cf2,_0x413c5e){if(intUtil['validateEmail'](_0x413c5e)){return request({'uri':util[_0xcffe('0xe')](_0xcffe('0x1e'),_0x1a4cf2[_0xcffe('0x1f')]),'qs':{'email':_0x413c5e}})[_0xcffe('0x20')](function(_0x504ed1){if(_0x504ed1[_0xcffe('0x21')]){logger[_0xcffe('0x22')](_0xcffe('0x23'));return _[_0xcffe('0x24')](_0x504ed1,function(_0x373fa4){return _0x373fa4[_0xcffe('0x25')][_0xcffe('0x26')]===_0x413c5e;});}else{logger[_0xcffe('0x22')](_0xcffe('0x27'));return request({'uri':util[_0xcffe('0xe')](_0xcffe('0x28'),_0x1a4cf2[_0xcffe('0x1f')])})['then'](function(_0x5a4921){logger['info'](_0xcffe('0x29'));return _0x5a4921;});}});}else{logger[_0xcffe('0x22')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcffe('0xe')]('%s/api/v2/agents/me',_0x1a4cf2['remoteUri'])})[_0xcffe('0x20')](function(_0x158ebb){logger['info']('Admin\x20account\x20selected.');return _0x158ebb;});}}function getEndUser(_0x53b185,_0x46351c,_0x25171f){logger[_0xcffe('0x22')](_0xcffe('0x2a'),_0x25171f);return request({'uri':util[_0xcffe('0xe')]('%s/api/v2/contacts',_0x53b185[_0xcffe('0x1f')]),'qs':{'phone':_0x25171f}})[_0xcffe('0x20')](function(_0x460d1d){if(_0x460d1d[_0xcffe('0x21')]){logger[_0xcffe('0x22')](_0xcffe('0x2b'));return _[_0xcffe('0x24')](_0x460d1d,{'phone':_0x25171f});}else{logger[_0xcffe('0x22')](_0xcffe('0x2c'));return request({'uri':util[_0xcffe('0xe')]('%s/api/v2/contacts',_0x53b185[_0xcffe('0x1f')]),'method':_0xcffe('0x1c'),'body':{'name':_0x46351c,'phone':_0x25171f}})[_0xcffe('0x20')](function(_0x78a654){logger[_0xcffe('0x22')](_0xcffe('0x2d'));return _0x78a654;});}});}function getAuth(_0x311b70){return util['format'](_0xcffe('0x2e'),new Buffer(_0x311b70[_0xcffe('0x2f')]+':X')[_0xcffe('0x30')](_0xcffe('0x31')));}function request(_0x1ca992){logger['debug'](_0xcffe('0x32'),JSON[_0xcffe('0x33')](_0x1ca992));return rp(_[_0xcffe('0x8')](_0x1ca992,{'method':_0xcffe('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x3c31d6,_0x4135e8){var _0x397304=[];if(_0x3c31d6&&_0x3c31d6[_0xcffe('0x21')]>0x0){_0x397304=_[_0xcffe('0x35')](_0x3c31d6,_0x4135e8);}return _0x397304;}function getCustomFields(_0x5b5684,_0x16f001){var _0x339aeb=[];var _0x111359={'custom_fields':[]};if(_0x5b5684['length']>0x0){_[_0xcffe('0x36')](_0x5b5684,function(_0xb654c8){if(_['includes']([_0xcffe('0x37'),_0xcffe('0x38')],_0xb654c8[_0xcffe('0x39')])&&_0xb654c8[_0xcffe('0x3a')]&&!_0xb654c8[_0xcffe('0x3b')]){_0x111359[_0xb654c8[_0xcffe('0x3a')][_0xcffe('0x3c')]()]=_0xb654c8[_0xcffe('0x3d')]['toString']();}else if(_[_0xcffe('0x3e')](['string','picklist'],_0xb654c8[_0xcffe('0x39')])&&_0xb654c8[_0xcffe('0x3f')]&&_0xb654c8[_0xcffe('0x3b')]){_0x111359[_0xcffe('0x19')]['push']({'id':_0xb654c8[_0xcffe('0x3f')],'value':_0xb654c8[_0xcffe('0x3d')][_0xcffe('0x30')]()});}else if(_0xb654c8[_0xcffe('0x39')]==='variable'&&_0xb654c8[_0xcffe('0x40')]&&_0xb654c8[_0xcffe('0x3f')]&&_0xb654c8['customField']){_0x16f001[_0xb654c8['variableName']]&&_0x111359[_0xcffe('0x19')][_0xcffe('0x41')]({'id':_0xb654c8[_0xcffe('0x3f')],'value':_0x16f001[_0xb654c8['variableName']][_0xcffe('0x30')]()});}else if(_0xb654c8[_0xcffe('0x39')]===_0xcffe('0x42')&&_0xb654c8['Variable']&&_0xb654c8[_0xcffe('0x43')]['name']&&_0xb654c8['idField']&&_0xb654c8[_0xcffe('0x3b')]){_0x16f001[_0xb654c8[_0xcffe('0x43')]['name'][_0xcffe('0x3c')]()]&&_0x111359[_0xcffe('0x19')]['push']({'id':_0xb654c8[_0xcffe('0x3f')],'value':_0x16f001[_0xb654c8['Variable']['name'][_0xcffe('0x3c')]()][_0xcffe('0x30')]()});}});}return _0x111359;}exports['queue']=function(_0x55097c,_0x44fad2,_0x28dadf,_0x1c47fa,_0x436aac,_0x1c8ead){var _0x22777a,_0x588f46;_0x1c8ead['remoteUri']=intUtil[_0xcffe('0x44')](_0x1c8ead[_0xcffe('0x1f')]);_0x1c8ead[_0xcffe('0x45')]=intUtil[_0xcffe('0x44')](_0x1c8ead['serverUrl']);if(_0x436aac&&_0x436aac[_0xcffe('0x46')]){logger[_0xcffe('0x22')](_0xcffe('0x47'),_0xcffe('0x48'));_0x44fad2['recordingURL']=util[_0xcffe('0xe')](_0xcffe('0x49'),_0x1c8ead[_0xcffe('0x45')],_0x44fad2[_0xcffe('0x4a')],md5(_0x44fad2[_0xcffe('0x4a')]));}else{_0x44fad2[_0xcffe('0x4b')]='';}headers[_0xcffe('0x4c')]=getAuth(_0x1c8ead);return getUser(_0x1c8ead,_0x1c47fa[_0xcffe('0x26')])['then'](function(_0x4ffac8){_0x22777a=_0x4ffac8;logger[_0xcffe('0x22')](_0xcffe('0x4d'),_0x22777a['id']);return getEndUser(_0x1c8ead,_0x44fad2[_0xcffe('0xf')],_0x44fad2['calleridnum']);})['then'](function(_0x1a98a9){_0x588f46=_0x1a98a9;logger[_0xcffe('0x22')]('The\x20Enduser\x20ID\x20is:',_0x588f46['id']);return getTicket(_0x1c8ead,_0x22777a,_0x588f46,_0x28dadf,_0x44fad2);})[_0xcffe('0x20')](function(_0x874a97){if(_0x874a97&&_0x874a97['id']){logger[_0xcffe('0x22')](_0xcffe('0x1d'));logger[_0xcffe('0x22')](_0xcffe('0x4e'),_0x874a97['id']);logger[_0xcffe('0x22')](_0xcffe('0x47'),_0xcffe('0x4f'));emit(util[_0xcffe('0xe')](_0xcffe('0x50'),_0x1c47fa[_0xcffe('0x15')]),_0xcffe('0x51'),{'uri':util[_0xcffe('0xe')]('%s/helpdesk/tickets/%d',_0x1c8ead[_0xcffe('0x1f')],_0x874a97['id'])});}})[_0xcffe('0x52')](function(_0x316fcb){logger[_0xcffe('0x53')](_0xcffe('0x47'),JSON[_0xcffe('0x33')](_0x316fcb));});};exports[_0xcffe('0x54')]=function(_0x1c13c4,_0x278ad6,_0x38890f,_0x337977,_0x24c264,_0x1a9100,_0xea93ad){var _0x2c5dc6,_0x3f6f64;_0x1a9100['remoteUri']=intUtil['stripTrailingSlash'](_0x1a9100[_0xcffe('0x1f')]);_0x1a9100[_0xcffe('0x45')]=intUtil[_0xcffe('0x44')](_0x1a9100['serverUrl']);if(_0xea93ad&&_0xea93ad[_0xcffe('0x55')]&&_0xea93ad[_0xcffe('0x55')]!==_0xcffe('0x56')){logger[_0xcffe('0x22')](_0xcffe('0x57'),_0xcffe('0x48'));_0x278ad6[_0xcffe('0x4b')]=util[_0xcffe('0xe')](_0xcffe('0x49'),_0x1a9100[_0xcffe('0x45')],_0x278ad6[_0xcffe('0x4a')],md5(_0x278ad6[_0xcffe('0x4a')]));}headers[_0xcffe('0x4c')]=getAuth(_0x1a9100);return getUser(_0x1a9100,_0x337977['email'])[_0xcffe('0x20')](function(_0x1c2fe0){_0x2c5dc6=_0x1c2fe0;logger[_0xcffe('0x22')](_0xcffe('0x4d'),_0x2c5dc6['id']);return getEndUser(_0x1a9100,_0x278ad6[_0xcffe('0x58')],_0x278ad6[_0xcffe('0x59')]);})['then'](function(_0x25e5f6){_0x3f6f64=_0x25e5f6;logger[_0xcffe('0x22')](_0xcffe('0x5a'),_0x3f6f64['id']);return getTicket(_0x1a9100,_0x2c5dc6,_0x3f6f64,_0x38890f,_0x278ad6);})[_0xcffe('0x20')](function(_0x5cca6a){if(_0x5cca6a&&_0x5cca6a['id']){logger[_0xcffe('0x22')](_0xcffe('0x1d'));logger[_0xcffe('0x22')]('The\x20Ticket\x20ID\x20is:',_0x5cca6a['id']);logger['info']('[OUTBOUND]',_0xcffe('0x4f'));emit(util[_0xcffe('0xe')](_0xcffe('0x50'),_0x337977[_0xcffe('0x15')]),_0xcffe('0x51'),{'uri':util[_0xcffe('0xe')](_0xcffe('0x5b'),_0x1a9100['remoteUri'],_0x5cca6a['id'])});}})[_0xcffe('0x52')](function(_0x565ee1){logger[_0xcffe('0x53')](_0xcffe('0x57'),JSON['stringify'](_0x565ee1));});};exports['unmanaged']=function(_0x58e7cb,_0x11ed0d,_0x441a10,_0x1d32d6,_0x2de88d,_0xe9bf86){var _0x385a71,_0x58c45b;_0xe9bf86[_0xcffe('0x1f')]=intUtil[_0xcffe('0x44')](_0xe9bf86[_0xcffe('0x1f')]);_0xe9bf86[_0xcffe('0x45')]=intUtil[_0xcffe('0x44')](_0xe9bf86[_0xcffe('0x45')]);if(_0x2de88d&&_0x2de88d[_0xcffe('0x46')]){logger[_0xcffe('0x22')]('['+_0x11ed0d[_0xcffe('0x5c')]['toUpperCase']()+']',_0xcffe('0x48'));_0x11ed0d[_0xcffe('0x4b')]=util[_0xcffe('0xe')](_0xcffe('0x49'),_0xe9bf86[_0xcffe('0x45')],_0x11ed0d['uniqueid'],md5(_0x11ed0d[_0xcffe('0x4a')]));}else{_0x11ed0d[_0xcffe('0x4b')]='';}headers[_0xcffe('0x4c')]=getAuth(_0xe9bf86);return getUser(_0xe9bf86,'')['then'](function(_0x46ad33){_0x385a71=_0x46ad33;logger[_0xcffe('0x22')](_0xcffe('0x4d'),_0x385a71['id']);return getEndUser(_0xe9bf86,_0x11ed0d[_0xcffe('0xf')],_0x11ed0d['calleridnum']);})['then'](function(_0x46c7d0){_0x58c45b=_0x46c7d0;logger[_0xcffe('0x22')](_0xcffe('0x5a'),_0x58c45b['id']);return getTicket(_0xe9bf86,_0x385a71,_0x58c45b,_0x441a10,_0x11ed0d);})['then'](function(_0x38b454){if(_0x38b454){logger[_0xcffe('0x22')](_0xcffe('0x1d'));logger[_0xcffe('0x22')](_0xcffe('0x4e'),_0x38b454['id']);}})[_0xcffe('0x52')](function(_0x3190ca){logger[_0xcffe('0x53')]('['+_0x11ed0d['lastevent'][_0xcffe('0x5d')]()+']',JSON['stringify'](_0x3190ca));});}; \ No newline at end of file +var _0x4252=['toLowerCase','content','idField','type','variable','variableName','push','Variable','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','stringify','outbound','stripTrailingSlash','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','format','remoteUri','then','info','%s/api/v2/agents','Agent\x20found!','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','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','forEach','includes','string','picklist','nameField','customField'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4252,0x133));var _0x2425=function(_0x4a8501,_0x3210ec){_0x4a8501=_0x4a8501-0x0;var _0x3f6a23=_0x4252[_0x4a8501];return _0x3f6a23;};'use strict';var _=require(_0x2425('0x0'));var rp=require(_0x2425('0x1'));var md5=require('md5');var util=require(_0x2425('0x2'));var Redis=require(_0x2425('0x3'));var intUtil=require(_0x2425('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x2425('0x5'));config[_0x2425('0x6')]=_[_0x2425('0x7')](config[_0x2425('0x6')],{'host':_0x2425('0x8'),'port':0x18eb});var io=require(_0x2425('0x9'))(new Redis(config[_0x2425('0x6')]));var headers={'Content-Type':_0x2425('0xa'),'Accept':'application/json'};function emit(_0x536fde,_0x43bcf5,_0x2f1a7f){io['to'](_0x536fde)['emit'](_0x43bcf5,_0x2f1a7f);}function getTicket(_0x59aa4d,_0x4756a9,_0x4e3cf6,_0x2a2cff,_0x38f467){logger['info'](_0x2425('0xb'));var _0x51d57d=_['merge']({'responder_id':_0x4756a9['id'],'requester_id':_0x4e3cf6['id'],'name':util['format'](_0x2425('0xc'),_0x38f467[_0x2425('0xd')]),'phone':_0x38f467[_0x2425('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2425('0xf')](_0x2a2cff['Subjects'],_0x38f467,'\x20'),'description':intUtil[_0x2425('0xf')](_0x2a2cff[_0x2425('0x10')],_0x38f467,_0x2425('0x11')),'tags':getTags(_0x2a2cff['Tags'],_0x2425('0x12'))},getCustomFields(_0x2a2cff[_0x2425('0x13')],_0x38f467));_0x51d57d[_0x2425('0x14')]=_[_0x2425('0x15')](_[_0x2425('0x16')](_0x51d57d['custom_fields'],'id'),'value');return request({'uri':util[_0x2425('0x17')]('%s/api/v2/tickets',_0x59aa4d[_0x2425('0x18')]),'method':'POST','body':_0x51d57d})[_0x2425('0x19')](function(_0x4d330e){logger[_0x2425('0x1a')]('Ticket\x20created!');return _0x4d330e;});}function getUser(_0x520efe,_0x4dda7d){if(intUtil['validateEmail'](_0x4dda7d)){return request({'uri':util[_0x2425('0x17')](_0x2425('0x1b'),_0x520efe[_0x2425('0x18')]),'qs':{'email':_0x4dda7d}})['then'](function(_0x984f0b){if(_0x984f0b['length']){logger[_0x2425('0x1a')](_0x2425('0x1c'));return _['find'](_0x984f0b,function(_0x4098b8){return _0x4098b8['contact'][_0x2425('0x1d')]===_0x4dda7d;});}else{logger[_0x2425('0x1a')](_0x2425('0x1e'));return request({'uri':util[_0x2425('0x17')](_0x2425('0x1f'),_0x520efe[_0x2425('0x18')])})[_0x2425('0x19')](function(_0x254980){logger['info'](_0x2425('0x20'));return _0x254980;});}});}else{logger[_0x2425('0x1a')](_0x2425('0x21'));return request({'uri':util[_0x2425('0x17')]('%s/api/v2/agents/me',_0x520efe[_0x2425('0x18')])})[_0x2425('0x19')](function(_0x282453){logger[_0x2425('0x1a')](_0x2425('0x20'));return _0x282453;});}}function getEndUser(_0x15680a,_0x1c2aa8,_0xae86f9){logger[_0x2425('0x1a')](_0x2425('0x22'),_0xae86f9);return request({'uri':util[_0x2425('0x17')]('%s/api/v2/contacts',_0x15680a['remoteUri']),'qs':{'phone':_0xae86f9}})[_0x2425('0x19')](function(_0x55f550){if(_0x55f550[_0x2425('0x23')]){logger[_0x2425('0x1a')](_0x2425('0x24'));return _[_0x2425('0x25')](_0x55f550,{'phone':_0xae86f9});}else{logger[_0x2425('0x1a')](_0x2425('0x26'));return request({'uri':util[_0x2425('0x17')](_0x2425('0x27'),_0x15680a['remoteUri']),'method':_0x2425('0x28'),'body':{'name':_0x1c2aa8,'phone':_0xae86f9}})['then'](function(_0x194224){logger[_0x2425('0x1a')](_0x2425('0x29'));return _0x194224;});}});}function getAuth(_0x10f3bb){return util[_0x2425('0x17')](_0x2425('0x2a'),new Buffer(_0x10f3bb['apiKey']+':X')[_0x2425('0x2b')](_0x2425('0x2c')));}function request(_0x4c32e6){logger[_0x2425('0x2d')](_0x2425('0x2e'),JSON['stringify'](_0x4c32e6));return rp(_[_0x2425('0x7')](_0x4c32e6,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x33b988,_0x48c508){var _0x32bb01=[];if(_0x33b988&&_0x33b988['length']>0x0){_0x32bb01=_['map'](_0x33b988,_0x48c508);}return _0x32bb01;}function getCustomFields(_0x840c44,_0xbbaa27){var _0x23221b=[];var _0x493763={'custom_fields':[]};if(_0x840c44[_0x2425('0x23')]>0x0){_[_0x2425('0x2f')](_0x840c44,function(_0x346323){if(_[_0x2425('0x30')]([_0x2425('0x31'),_0x2425('0x32')],_0x346323['type'])&&_0x346323[_0x2425('0x33')]&&!_0x346323[_0x2425('0x34')]){_0x493763[_0x346323[_0x2425('0x33')][_0x2425('0x35')]()]=_0x346323[_0x2425('0x36')][_0x2425('0x2b')]();}else if(_[_0x2425('0x30')]([_0x2425('0x31'),_0x2425('0x32')],_0x346323['type'])&&_0x346323[_0x2425('0x37')]&&_0x346323[_0x2425('0x34')]){_0x493763[_0x2425('0x14')]['push']({'id':_0x346323['idField'],'value':_0x346323['content'][_0x2425('0x2b')]()});}else if(_0x346323[_0x2425('0x38')]===_0x2425('0x39')&&_0x346323['variableName']&&_0x346323['idField']&&_0x346323[_0x2425('0x34')]){_0xbbaa27[_0x346323[_0x2425('0x3a')]]&&_0x493763[_0x2425('0x14')][_0x2425('0x3b')]({'id':_0x346323[_0x2425('0x37')],'value':_0xbbaa27[_0x346323[_0x2425('0x3a')]]['toString']()});}else if(_0x346323[_0x2425('0x38')]==='customVariable'&&_0x346323['Variable']&&_0x346323[_0x2425('0x3c')][_0x2425('0x12')]&&_0x346323[_0x2425('0x37')]&&_0x346323[_0x2425('0x34')]){_0xbbaa27[_0x346323[_0x2425('0x3c')][_0x2425('0x12')]['toLowerCase']()]&&_0x493763[_0x2425('0x14')][_0x2425('0x3b')]({'id':_0x346323['idField'],'value':_0xbbaa27[_0x346323[_0x2425('0x3c')]['name'][_0x2425('0x35')]()][_0x2425('0x2b')]()});}});}return _0x493763;}exports['queue']=function(_0x48ff26,_0x47129a,_0x33f3d9,_0x5c210d,_0x247622,_0x512795){var _0x1284e4,_0x4eb36b;_0x512795[_0x2425('0x18')]=intUtil['stripTrailingSlash'](_0x512795[_0x2425('0x18')]);_0x512795[_0x2425('0x3d')]=intUtil['stripTrailingSlash'](_0x512795[_0x2425('0x3d')]);if(_0x247622&&_0x247622[_0x2425('0x3e')]){logger[_0x2425('0x1a')]('[QUEUE]',_0x2425('0x3f'));_0x47129a[_0x2425('0x40')]=util[_0x2425('0x17')](_0x2425('0x41'),_0x512795['serverUrl'],_0x47129a[_0x2425('0x42')],md5(_0x47129a['uniqueid']));}else{_0x47129a[_0x2425('0x40')]='';}headers[_0x2425('0x43')]=getAuth(_0x512795);return getUser(_0x512795,_0x5c210d[_0x2425('0x1d')])['then'](function(_0x22c12a){_0x1284e4=_0x22c12a;logger[_0x2425('0x1a')](_0x2425('0x44'),_0x1284e4['id']);return getEndUser(_0x512795,_0x47129a['calleridname'],_0x47129a[_0x2425('0xe')]);})['then'](function(_0x9bf521){_0x4eb36b=_0x9bf521;logger[_0x2425('0x1a')](_0x2425('0x45'),_0x4eb36b['id']);return getTicket(_0x512795,_0x1284e4,_0x4eb36b,_0x33f3d9,_0x47129a);})[_0x2425('0x19')](function(_0x38df5e){if(_0x38df5e&&_0x38df5e['id']){logger[_0x2425('0x1a')](_0x2425('0x46'));logger[_0x2425('0x1a')]('The\x20Ticket\x20ID\x20is:',_0x38df5e['id']);logger[_0x2425('0x1a')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2425('0x17')]('user:%s',_0x5c210d[_0x2425('0x12')]),_0x2425('0x47'),{'uri':util['format'](_0x2425('0x48'),_0x512795[_0x2425('0x18')],_0x38df5e['id'])});}})[_0x2425('0x49')](function(_0x244649){logger[_0x2425('0x4a')](_0x2425('0x4b'),JSON[_0x2425('0x4c')](_0x244649));});};exports[_0x2425('0x4d')]=function(_0x168447,_0x50710a,_0x49b47a,_0x534386,_0x182954,_0x2189b9,_0x393c92){var _0xc11265,_0x185f76;_0x2189b9[_0x2425('0x18')]=intUtil['stripTrailingSlash'](_0x2189b9[_0x2425('0x18')]);_0x2189b9[_0x2425('0x3d')]=intUtil[_0x2425('0x4e')](_0x2189b9[_0x2425('0x3d')]);if(_0x393c92&&_0x393c92[_0x2425('0x4f')]&&_0x393c92[_0x2425('0x4f')]!==_0x2425('0x50')){logger[_0x2425('0x1a')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x50710a[_0x2425('0x40')]=util[_0x2425('0x17')](_0x2425('0x41'),_0x2189b9[_0x2425('0x3d')],_0x50710a[_0x2425('0x42')],md5(_0x50710a[_0x2425('0x42')]));}headers[_0x2425('0x43')]=getAuth(_0x2189b9);return getUser(_0x2189b9,_0x534386[_0x2425('0x1d')])[_0x2425('0x19')](function(_0x8f43b8){_0xc11265=_0x8f43b8;logger[_0x2425('0x1a')](_0x2425('0x44'),_0xc11265['id']);return getEndUser(_0x2189b9,_0x50710a[_0x2425('0x51')],_0x50710a[_0x2425('0x52')]);})[_0x2425('0x19')](function(_0x848791){_0x185f76=_0x848791;logger[_0x2425('0x1a')](_0x2425('0x45'),_0x185f76['id']);return getTicket(_0x2189b9,_0xc11265,_0x185f76,_0x49b47a,_0x50710a);})['then'](function(_0x2e71f){if(_0x2e71f&&_0x2e71f['id']){logger[_0x2425('0x1a')](_0x2425('0x46'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2e71f['id']);logger[_0x2425('0x1a')](_0x2425('0x53'),_0x2425('0x54'));emit(util[_0x2425('0x17')](_0x2425('0x55'),_0x534386[_0x2425('0x12')]),_0x2425('0x47'),{'uri':util['format'](_0x2425('0x48'),_0x2189b9[_0x2425('0x18')],_0x2e71f['id'])});}})[_0x2425('0x49')](function(_0x2034fa){logger[_0x2425('0x4a')](_0x2425('0x53'),JSON[_0x2425('0x4c')](_0x2034fa));});};exports[_0x2425('0x56')]=function(_0x5eb8bc,_0x5a4ca9,_0x8f802b,_0x188aec,_0x59d652,_0x5db0f9){var _0x492471,_0x1e2e97;_0x5db0f9[_0x2425('0x18')]=intUtil[_0x2425('0x4e')](_0x5db0f9[_0x2425('0x18')]);_0x5db0f9[_0x2425('0x3d')]=intUtil[_0x2425('0x4e')](_0x5db0f9[_0x2425('0x3d')]);if(_0x59d652&&_0x59d652[_0x2425('0x3e')]){logger[_0x2425('0x1a')]('['+_0x5a4ca9[_0x2425('0x57')][_0x2425('0x58')]()+']',_0x2425('0x3f'));_0x5a4ca9[_0x2425('0x40')]=util[_0x2425('0x17')](_0x2425('0x41'),_0x5db0f9[_0x2425('0x3d')],_0x5a4ca9[_0x2425('0x42')],md5(_0x5a4ca9[_0x2425('0x42')]));}else{_0x5a4ca9[_0x2425('0x40')]='';}headers[_0x2425('0x43')]=getAuth(_0x5db0f9);return getUser(_0x5db0f9,'')[_0x2425('0x19')](function(_0x2d3de4){_0x492471=_0x2d3de4;logger[_0x2425('0x1a')](_0x2425('0x44'),_0x492471['id']);return getEndUser(_0x5db0f9,_0x5a4ca9[_0x2425('0xd')],_0x5a4ca9['calleridnum']);})[_0x2425('0x19')](function(_0x2d46bb){_0x1e2e97=_0x2d46bb;logger[_0x2425('0x1a')](_0x2425('0x45'),_0x1e2e97['id']);return getTicket(_0x5db0f9,_0x492471,_0x1e2e97,_0x8f802b,_0x5a4ca9);})['then'](function(_0x1f80a1){if(_0x1f80a1){logger['info'](_0x2425('0x46'));logger[_0x2425('0x1a')](_0x2425('0x59'),_0x1f80a1['id']);}})[_0x2425('0x49')](function(_0x373146){logger['error']('['+_0x5a4ca9[_0x2425('0x57')][_0x2425('0x58')]()+']',JSON[_0x2425('0x4c')](_0x373146));});}; \ 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 004a005..504f185 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 _0x0df5=['lodash','md5','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','toUpperCase','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','POST','/api/tasks','Subjects','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect'];(function(_0x232296,_0x1b16a0){var _0x3522d9=function(_0x55ff5c){while(--_0x55ff5c){_0x232296['push'](_0x232296['shift']());}};_0x3522d9(++_0x1b16a0);}(_0x0df5,0x186));var _0x50df=function(_0x585439,_0x2d1e86){_0x585439=_0x585439-0x0;var _0x4ceccf=_0x0df5[_0x585439];return _0x4ceccf;};'use strict';var _=require(_0x50df('0x0'));var rp=require('request-promise');var md5=require(_0x50df('0x1'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x50df('0x2'));var intUtil=require('./util');var config=require(_0x50df('0x3'));var logger=require(_0x50df('0x4'))('freshsales');config['redis']=_[_0x50df('0x5')](config[_0x50df('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x50df('0x7'))(new Redis(config[_0x50df('0x6')]));function getAdminId(_0x10d534,_0x1d6d6d,_0x47b4fa,_0x512d52){return new Promise(function(_0x2cf8df,_0x3783ef){var _0x3e128e=![];var _0x506249={'method':_0x50df('0x8'),'uri':_0x512d52+'/api/selector/owners','json':!![]};_0x506249[_0x50df('0x9')]=_0x47b4fa;logger[_0x50df('0xa')](_0x50df('0xb'));return rp(_0x506249)[_0x50df('0xc')](function(_0x208f0d){if(_0x208f0d){var _0x37aec8=_0x208f0d[_0x50df('0xd')];var _0x3a085d=null;for(_0x3a085d=0x0;_0x3a085d<_0x37aec8[_0x50df('0xe')];_0x3a085d++){if(_0x37aec8[_0x3a085d][_0x50df('0xf')]===_0x10d534[_0x50df('0x10')]){_0x10d534[_0x50df('0x11')]=_0x37aec8[_0x3a085d]['id'];_0x3e128e=!![];}}if(_0x3e128e){logger['info'](_0x50df('0x12'),_0x10d534[_0x50df('0x11')]);_0x2cf8df(_0x10d534);}else{_0x3783ef({'statusCode':0x194,'message':_0x50df('0x13')});}}else{_0x3783ef({'statusCode':0x194,'message':_0x50df('0x13')});}})[_0x50df('0x14')](function(_0x17a96f){logger[_0x50df('0x15')]('['+[_0x1d6d6d['toUpperCase']()]+']',_0x17a96f[_0x50df('0x16')]);_0x3783ef(_0x17a96f);});});}function getUser(_0x2f7e2e,_0x56b784,_0xba09ab){return function(_0x1dccce){return new Promise(function(_0x1a882c,_0x47ebed){var _0x28f966={'method':'GET','uri':_0xba09ab+'/api/selector/owners','json':!![]};_0x28f966[_0x50df('0x9')]=_0x56b784;logger[_0x50df('0xa')]('Getting\x20user\x20list');return rp(_0x28f966)[_0x50df('0xc')](function(_0x3b46fe){if(_0x3b46fe){var _0x21fdb3=_0x3b46fe[_0x50df('0xd')];var _0x2798bb=![];var _0x2d93d6=null;if(_0x1dccce[_0x50df('0x17')]!==null){logger[_0x50df('0xa')]('Getting\x20user\x20with\x20email',_0x1dccce[_0x50df('0x17')]);_0x1dccce['userEmail']=_0x1dccce[_0x50df('0x17')];for(_0x2d93d6=0x0;_0x2d93d6<_0x21fdb3[_0x50df('0xe')];_0x2d93d6++){if(_0x21fdb3[_0x2d93d6]['email']===_0x1dccce[_0x50df('0x17')]){_0x2798bb=!![];_0x1dccce[_0x50df('0x18')]=_0x21fdb3[_0x2d93d6]['id'];logger[_0x50df('0xa')](_0x50df('0x19'),_0x1dccce[_0x50df('0x18')]);}}}if(!_0x2798bb){logger[_0x50df('0xa')](_0x50df('0x1a'));_0x1dccce[_0x50df('0x1b')]=_0x1dccce['adminEmail'];_0x1dccce[_0x50df('0x18')]=_0x1dccce[_0x50df('0x11')];_0x2798bb=!![];}if(_0x2798bb){_0x1a882c(_0x1dccce);}else{_0x47ebed({'statusCode':0x194,'message':_0x50df('0x13')});}}else{_0x47ebed({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x50df('0x14')](function(_0x35e49e){logger[_0x50df('0x15')]('['+[_0x2f7e2e[_0x50df('0x1c')]()]+']',_0x35e49e[_0x50df('0x16')]);_0x47ebed(_0x35e49e);});});};}function searchContact(_0x3203af,_0x3dfe61,_0x1d8849,_0x13ca7f){return new Promise(function(_0x4ab951,_0x27153e){var _0x5051c3={'method':'GET','headers':_0x3dfe61,'uri':_0x3203af+'/api/lookup?q='+_0x13ca7f+_0x50df('0x1d')+_0x1d8849+_0x50df('0x1e'),'json':!![]};rp(_0x5051c3)[_0x50df('0xc')](function(_0x23f09c){var _0x2a6949=_[_0x50df('0x1f')](_0x23f09c['contacts'][_0x50df('0x20')],[_0x1d8849,_0x13ca7f]);_0x4ab951(_0x2a6949);})[_0x50df('0x14')](function(_0x13f67e){_0x27153e(_0x13f67e);});});}function getEndUser(_0x14616c,_0x3578ff,_0x58a919){return function(_0x4a17eb){return new Promise(function(_0x39ddfb,_0xcf1bc4){logger[_0x50df('0xa')](util[_0x50df('0x21')](_0x50df('0x22'),_0x4a17eb[_0x50df('0x23')]));searchContact(_0x58a919,_0x3578ff,_0x50df('0x24'),_0x4a17eb['contactNumber'])[_0x50df('0xc')](function(_0x510d9a){if(_0x510d9a){_0x4a17eb['endUserId']=_0x510d9a['id'];logger['info'](_0x50df('0x25'),_0x4a17eb[_0x50df('0x26')]);return _0x39ddfb(_0x4a17eb);}searchContact(_0x58a919,_0x3578ff,'work_number',_0x4a17eb['contactNumber'])['then'](function(_0x2b0973){if(_0x2b0973){_0x4a17eb[_0x50df('0x26')]=_0x2b0973['id'];logger[_0x50df('0xa')]('Contact\x20found\x20work_number:',_0x4a17eb[_0x50df('0x26')]);return _0x39ddfb(_0x4a17eb);}createEndUser(_0x4a17eb,_0x14616c,_0x3578ff,_0x58a919)[_0x50df('0xc')](function(_0xc8c883){logger[_0x50df('0xa')](_0x50df('0x27'),_0xc8c883[_0x50df('0x26')]);return _0x39ddfb(_0xc8c883);});});})[_0x50df('0x14')](function(_0x462ddd){_0xcf1bc4(_0x462ddd);});});};}function createEndUser(_0xb648d8,_0x51812a,_0x3e74ea,_0xb318a8){return new Promise(function(_0x5d61f8,_0x3525e3){var _0x44f1d0=moment();var _0x46a4a0={'method':'POST','uri':_0xb318a8+_0x50df('0x28'),'body':{'contact':{'last_name':_0xb648d8[_0x50df('0x23')],'work_number':_0xb648d8[_0x50df('0x23')],'mobile_number':_0xb648d8['contactNumber'],'owner_id':_0xb648d8['userId'],'created_at':_0x44f1d0[_0x50df('0x21')](_0x50df('0x29'))}},'json':!![]};_0x46a4a0[_0x50df('0x9')]=_0x3e74ea;logger['info'](_0x50df('0x2a'));return rp(_0x46a4a0)[_0x50df('0xc')](function(_0x53fb5a){_0xb648d8[_0x50df('0x26')]=_0x53fb5a['contact']['id'];_0x5d61f8(_0xb648d8);})[_0x50df('0x14')](function(_0x2c7bdc){logger['error']('['+[_0x51812a[_0x50df('0x1c')]()]+']',_0x2c7bdc['message']);_0x3525e3(_0x2c7bdc[_0x50df('0x16')]);});});}function getTicket(_0x16c167,_0x2dd920,_0x212c30,_0xc5aa93,_0x1aae6b){return function(_0x47f82d){logger[_0x50df('0xa')]('Creating\x20new\x20task');return new Promise(function(_0x39cea8,_0xd606bb){var _0x445b9c=moment();var _0x37d814={'method':_0x50df('0x2b'),'uri':_0x212c30+_0x50df('0x2c'),'body':{'title':intUtil['getString'](_0xc5aa93[_0x50df('0x2d')],_0x1aae6b,'\x20'),'description':intUtil['getString'](_0xc5aa93[_0x50df('0x2e')],_0x1aae6b,'\x0a'),'owner_id':_0x47f82d['userId'],'creater_id':_0x47f82d[_0x50df('0x11')],'targetable_id':_0x47f82d[_0x50df('0x26')],'targetable_type':_0x50df('0x2f'),'created_at':_0x445b9c[_0x50df('0x21')](_0x50df('0x29')),'due_date':_0x445b9c['add'](0x1e,'m')['format'](_0x50df('0x29'))},'json':!![]};_0x37d814[_0x50df('0x9')]=_0x2dd920;return rp(_0x37d814)[_0x50df('0xc')](function(_0x4fa0e0){_0x47f82d[_0x50df('0x30')]=_0x4fa0e0[_0x50df('0x31')]['id'];logger[_0x50df('0xa')](_0x50df('0x32'),_0x47f82d['ticketId']);_0x39cea8(_0x47f82d);})[_0x50df('0x14')](function(_0x4fd167){logger['error']('['+[_0x16c167[_0x50df('0x1c')]()]+']',_0x4fd167[_0x50df('0x16')]);_0xd606bb(_0x4fd167['message']);});});};}function emit(_0x297048,_0x1cac49,_0x4b58bc){var _0x2313f6={'uri':_0x297048+_0x50df('0x33')+_0x4b58bc};io['to'](util['format'](_0x50df('0x34'),_0x1cac49))[_0x50df('0x35')](_0x50df('0x36'),_0x2313f6);}exports['cs']=function(_0x3cd29c,_0x1bfb12,_0x2685bc,_0x28969d,_0x283b57,_0x417b7c,_0x1463c5,_0x508892){var _0x28467c={};var _0x2bad54={'Authorization':'Token\x20token='+_0x417b7c[_0x50df('0x37')]};_0x417b7c[_0x50df('0x38')]=intUtil[_0x50df('0x39')](_0x417b7c['remoteUri']);_0x417b7c[_0x50df('0x3a')]=intUtil['stripTrailingSlash'](_0x417b7c[_0x50df('0x3a')]);var _0x348c4a=_0x417b7c[_0x50df('0x38')];_0x28467c[_0x50df('0x10')]=_0x417b7c['username'];_0x28467c[_0x50df('0x23')]=_0x508892[_0x50df('0x3b')]()===_0x50df('0x3c')?_0x1bfb12[_0x50df('0x3d')]:_0x1bfb12[_0x50df('0x3e')];_0x28467c[_0x50df('0x3f')]=_0x508892==='queue'||_0x508892===_0x50df('0x40')?'queue':_0x50df('0x3c');if(_0x28969d){_0x28467c[_0x50df('0x17')]=_0x28969d['email'];}var _0x116bb5=util[_0x50df('0x21')](_0x50df('0x41'),_0x417b7c[_0x50df('0x3a')],_0x1bfb12[_0x50df('0x42')],md5(_0x1bfb12[_0x50df('0x42')]));if(_0x283b57&&_0x283b57[_0x50df('0x43')]){logger['info'](_0x50df('0x44'),_0x50df('0x45'));_0x1bfb12[_0x50df('0x46')]=_0x116bb5;}else if(_0x1463c5&&_0x1463c5[_0x50df('0x47')]&&_0x1463c5[_0x50df('0x47')]!==_0x50df('0x48')){logger[_0x50df('0xa')](_0x50df('0x49'),_0x50df('0x45'));_0x1bfb12[_0x50df('0x46')]=_0x116bb5;}else{_0x1bfb12[_0x50df('0x46')]='';}return getAdminId(_0x28467c,_0x508892,_0x2bad54,_0x348c4a)[_0x50df('0xc')](getUser(_0x508892,_0x2bad54,_0x348c4a))['then'](getEndUser(_0x508892,_0x2bad54,_0x348c4a))[_0x50df('0xc')](getTicket(_0x508892,_0x2bad54,_0x348c4a,_0x2685bc,_0x1bfb12))['then'](function(_0x5d5112){logger['info'](util['format'](_0x50df('0x4a'),_0x5d5112[_0x50df('0x30')]));if(_0x508892!=='unmanaged'){logger[_0x50df('0xa')]('['+[_0x508892[_0x50df('0x1c')]()]+']',_0x50df('0x4b'));emit(_0x348c4a,_0x28969d['name'],_0x5d5112[_0x50df('0x26')]);}})[_0x50df('0x14')](function(_0x1ce4d5){logger[_0x50df('0x15')]('['+[_0x508892['toUpperCase']()]+_0x50df('0x4c'),util[_0x50df('0x4d')](_0x1ce4d5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xeee1=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','userEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','Subjects','Descriptions','Contact','task','Task\x20created:','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','queue','uniqueid','monitor_format','[QUEUE]'];(function(_0x2e549e,_0x451ecd){var _0x43b151=function(_0x1f8f59){while(--_0x1f8f59){_0x2e549e['push'](_0x2e549e['shift']());}};_0x43b151(++_0x451ecd);}(_0xeee1,0x158));var _0x1eee=function(_0x5579ef,_0xeeea93){_0x5579ef=_0x5579ef-0x0;var _0x112ddb=_0xeee1[_0x5579ef];return _0x112ddb;};'use strict';var _=require(_0x1eee('0x0'));var rp=require('request-promise');var md5=require(_0x1eee('0x1'));var util=require(_0x1eee('0x2'));var moment=require(_0x1eee('0x3'));var Promise=require(_0x1eee('0x4'));var Redis=require(_0x1eee('0x5'));var intUtil=require(_0x1eee('0x6'));var config=require(_0x1eee('0x7'));var logger=require(_0x1eee('0x8'))(_0x1eee('0x9'));config[_0x1eee('0xa')]=_[_0x1eee('0xb')](config[_0x1eee('0xa')],{'host':_0x1eee('0xc'),'port':0x18eb});var io=require(_0x1eee('0xd'))(new Redis(config[_0x1eee('0xa')]));function getAdminId(_0x507cf3,_0x20fac9,_0x3c8922,_0x5a1a95){return new Promise(function(_0x2a140f,_0x40950d){var _0x2a7c46=![];var _0x40fc71={'method':_0x1eee('0xe'),'uri':_0x5a1a95+'/api/selector/owners','json':!![]};_0x40fc71[_0x1eee('0xf')]=_0x3c8922;logger[_0x1eee('0x10')](_0x1eee('0x11'));return rp(_0x40fc71)[_0x1eee('0x12')](function(_0x4b0531){if(_0x4b0531){var _0x4851a4=_0x4b0531['users'];var _0x232675=null;for(_0x232675=0x0;_0x232675<_0x4851a4[_0x1eee('0x13')];_0x232675++){if(_0x4851a4[_0x232675]['email']===_0x507cf3[_0x1eee('0x14')]){_0x507cf3[_0x1eee('0x15')]=_0x4851a4[_0x232675]['id'];_0x2a7c46=!![];}}if(_0x2a7c46){logger[_0x1eee('0x10')]('Admin\x20found:',_0x507cf3['adminId']);_0x2a140f(_0x507cf3);}else{_0x40950d({'statusCode':0x194,'message':_0x1eee('0x16')});}}else{_0x40950d({'statusCode':0x194,'message':_0x1eee('0x16')});}})[_0x1eee('0x17')](function(_0x9ed44c){logger[_0x1eee('0x18')]('['+[_0x20fac9[_0x1eee('0x19')]()]+']',_0x9ed44c[_0x1eee('0x1a')]);_0x40950d(_0x9ed44c);});});}function getUser(_0x3c7298,_0x3424ff,_0x1b63df){return function(_0x4b33e6){return new Promise(function(_0x3d3b64,_0x278151){var _0x13b4b7={'method':_0x1eee('0xe'),'uri':_0x1b63df+_0x1eee('0x1b'),'json':!![]};_0x13b4b7['headers']=_0x3424ff;logger[_0x1eee('0x10')](_0x1eee('0x1c'));return rp(_0x13b4b7)[_0x1eee('0x12')](function(_0x4568e8){if(_0x4568e8){var _0x222453=_0x4568e8[_0x1eee('0x1d')];var _0x4d6ad4=![];var _0x25563e=null;if(_0x4b33e6[_0x1eee('0x1e')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x4b33e6[_0x1eee('0x1e')]);_0x4b33e6[_0x1eee('0x1f')]=_0x4b33e6[_0x1eee('0x1e')];for(_0x25563e=0x0;_0x25563e<_0x222453[_0x1eee('0x13')];_0x25563e++){if(_0x222453[_0x25563e][_0x1eee('0x20')]===_0x4b33e6['agentEmail']){_0x4d6ad4=!![];_0x4b33e6[_0x1eee('0x21')]=_0x222453[_0x25563e]['id'];logger[_0x1eee('0x10')](_0x1eee('0x22'),_0x4b33e6[_0x1eee('0x21')]);}}}if(!_0x4d6ad4){logger[_0x1eee('0x10')](_0x1eee('0x23'));_0x4b33e6[_0x1eee('0x1f')]=_0x4b33e6[_0x1eee('0x14')];_0x4b33e6[_0x1eee('0x21')]=_0x4b33e6[_0x1eee('0x15')];_0x4d6ad4=!![];}if(_0x4d6ad4){_0x3d3b64(_0x4b33e6);}else{_0x278151({'statusCode':0x194,'message':_0x1eee('0x16')});}}else{_0x278151({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1eee('0x17')](function(_0x56f3d0){logger[_0x1eee('0x18')]('['+[_0x3c7298[_0x1eee('0x19')]()]+']',_0x56f3d0[_0x1eee('0x1a')]);_0x278151(_0x56f3d0);});});};}function searchContact(_0xe71378,_0x583d34,_0x1f26bc,_0x301904){return new Promise(function(_0x1c4d55,_0x199d1b){var _0x18beed={'method':_0x1eee('0xe'),'headers':_0x583d34,'uri':_0xe71378+_0x1eee('0x24')+_0x301904+'&f='+_0x1f26bc+_0x1eee('0x25'),'json':!![]};rp(_0x18beed)[_0x1eee('0x12')](function(_0x3fe705){var _0x8f5006=_[_0x1eee('0x26')](_0x3fe705[_0x1eee('0x27')][_0x1eee('0x27')],[_0x1f26bc,_0x301904]);_0x1c4d55(_0x8f5006);})['catch'](function(_0x3823c6){_0x199d1b(_0x3823c6);});});}function getEndUser(_0x1dae0c,_0x5e22d6,_0xe29c5a){return function(_0x450916){return new Promise(function(_0x526cf4,_0x36423a){logger[_0x1eee('0x10')](util[_0x1eee('0x28')](_0x1eee('0x29'),_0x450916[_0x1eee('0x2a')]));searchContact(_0xe29c5a,_0x5e22d6,'mobile_number',_0x450916[_0x1eee('0x2a')])['then'](function(_0x596bd6){if(_0x596bd6){_0x450916[_0x1eee('0x2b')]=_0x596bd6['id'];logger[_0x1eee('0x10')](_0x1eee('0x2c'),_0x450916['endUserId']);return _0x526cf4(_0x450916);}searchContact(_0xe29c5a,_0x5e22d6,_0x1eee('0x2d'),_0x450916[_0x1eee('0x2a')])[_0x1eee('0x12')](function(_0x29f417){if(_0x29f417){_0x450916[_0x1eee('0x2b')]=_0x29f417['id'];logger[_0x1eee('0x10')](_0x1eee('0x2e'),_0x450916['endUserId']);return _0x526cf4(_0x450916);}createEndUser(_0x450916,_0x1dae0c,_0x5e22d6,_0xe29c5a)[_0x1eee('0x12')](function(_0xf97206){logger['info']('Contact\x20created:',_0xf97206[_0x1eee('0x2b')]);return _0x526cf4(_0xf97206);});});})['catch'](function(_0x347f1f){_0x36423a(_0x347f1f);});});};}function createEndUser(_0x2bf99d,_0x5a34e,_0x1ce76b,_0x84653e){return new Promise(function(_0x1f136b,_0x29b431){var _0x39ce94=moment();var _0x4c79cf={'method':'POST','uri':_0x84653e+_0x1eee('0x2f'),'body':{'contact':{'last_name':_0x2bf99d[_0x1eee('0x2a')],'work_number':_0x2bf99d[_0x1eee('0x2a')],'mobile_number':_0x2bf99d['contactNumber'],'owner_id':_0x2bf99d[_0x1eee('0x21')],'created_at':_0x39ce94[_0x1eee('0x28')](_0x1eee('0x30'))}},'json':!![]};_0x4c79cf['headers']=_0x1ce76b;logger[_0x1eee('0x10')](_0x1eee('0x31'));return rp(_0x4c79cf)[_0x1eee('0x12')](function(_0x4b6f5c){_0x2bf99d[_0x1eee('0x2b')]=_0x4b6f5c['contact']['id'];_0x1f136b(_0x2bf99d);})[_0x1eee('0x17')](function(_0x4b93a7){logger[_0x1eee('0x18')]('['+[_0x5a34e[_0x1eee('0x19')]()]+']',_0x4b93a7['message']);_0x29b431(_0x4b93a7[_0x1eee('0x1a')]);});});}function getTicket(_0x59f3d7,_0xa6b7b5,_0x288136,_0x1f32d7,_0x3cff75){return function(_0x3d752e){logger[_0x1eee('0x10')](_0x1eee('0x32'));return new Promise(function(_0x1763b8,_0x143993){var _0x16edbd=moment();var _0xe5a699={'method':'POST','uri':_0x288136+_0x1eee('0x33'),'body':{'title':intUtil['getString'](_0x1f32d7[_0x1eee('0x34')],_0x3cff75,'\x20'),'description':intUtil['getString'](_0x1f32d7[_0x1eee('0x35')],_0x3cff75,'\x0a'),'owner_id':_0x3d752e['userId'],'creater_id':_0x3d752e['adminId'],'targetable_id':_0x3d752e[_0x1eee('0x2b')],'targetable_type':_0x1eee('0x36'),'created_at':_0x16edbd[_0x1eee('0x28')](_0x1eee('0x30')),'due_date':_0x16edbd['add'](0x1e,'m')[_0x1eee('0x28')](_0x1eee('0x30'))},'json':!![]};_0xe5a699[_0x1eee('0xf')]=_0xa6b7b5;return rp(_0xe5a699)['then'](function(_0x5109a2){_0x3d752e['ticketId']=_0x5109a2[_0x1eee('0x37')]['id'];logger[_0x1eee('0x10')](_0x1eee('0x38'),_0x3d752e['ticketId']);_0x1763b8(_0x3d752e);})[_0x1eee('0x17')](function(_0x2d4afe){logger[_0x1eee('0x18')]('['+[_0x59f3d7[_0x1eee('0x19')]()]+']',_0x2d4afe[_0x1eee('0x1a')]);_0x143993(_0x2d4afe[_0x1eee('0x1a')]);});});};}function emit(_0x217167,_0x48e6d2,_0x1db7a2){var _0x2003aa={'uri':_0x217167+'/contacts/'+_0x1db7a2};io['to'](util['format'](_0x1eee('0x39'),_0x48e6d2))[_0x1eee('0x3a')](_0x1eee('0x3b'),_0x2003aa);}exports['cs']=function(_0x146bff,_0x56b7b2,_0x537f20,_0x39b191,_0x3a5f44,_0x4d55de,_0x503684,_0x661f11){var _0x381a77={};var _0x4023d8={'Authorization':'Token\x20token='+_0x4d55de[_0x1eee('0x3c')]};_0x4d55de[_0x1eee('0x3d')]=intUtil[_0x1eee('0x3e')](_0x4d55de[_0x1eee('0x3d')]);_0x4d55de[_0x1eee('0x3f')]=intUtil[_0x1eee('0x3e')](_0x4d55de[_0x1eee('0x3f')]);var _0x4efcc2=_0x4d55de[_0x1eee('0x3d')];_0x381a77[_0x1eee('0x14')]=_0x4d55de[_0x1eee('0x40')];_0x381a77['contactNumber']=_0x661f11[_0x1eee('0x41')]()==='outbound'?_0x56b7b2[_0x1eee('0x42')]:_0x56b7b2['calleridnum'];_0x381a77['callDirection']=_0x661f11===_0x1eee('0x43')||_0x661f11==='unmanaged'?_0x1eee('0x43'):'outbound';if(_0x39b191){_0x381a77[_0x1eee('0x1e')]=_0x39b191['email'];}var _0x5eb2b1=util[_0x1eee('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d55de[_0x1eee('0x3f')],_0x56b7b2[_0x1eee('0x44')],md5(_0x56b7b2[_0x1eee('0x44')]));if(_0x3a5f44&&_0x3a5f44[_0x1eee('0x45')]){logger[_0x1eee('0x10')](_0x1eee('0x46'),_0x1eee('0x47'));_0x56b7b2[_0x1eee('0x48')]=_0x5eb2b1;}else if(_0x503684&&_0x503684[_0x1eee('0x49')]&&_0x503684[_0x1eee('0x49')]!==_0x1eee('0x4a')){logger[_0x1eee('0x10')](_0x1eee('0x4b'),_0x1eee('0x47'));_0x56b7b2[_0x1eee('0x48')]=_0x5eb2b1;}else{_0x56b7b2[_0x1eee('0x48')]='';}return getAdminId(_0x381a77,_0x661f11,_0x4023d8,_0x4efcc2)[_0x1eee('0x12')](getUser(_0x661f11,_0x4023d8,_0x4efcc2))[_0x1eee('0x12')](getEndUser(_0x661f11,_0x4023d8,_0x4efcc2))[_0x1eee('0x12')](getTicket(_0x661f11,_0x4023d8,_0x4efcc2,_0x537f20,_0x56b7b2))['then'](function(_0x18e19b){logger[_0x1eee('0x10')](util[_0x1eee('0x28')](_0x1eee('0x4c'),_0x18e19b[_0x1eee('0x4d')]));if(_0x661f11!==_0x1eee('0x4e')){logger['info']('['+[_0x661f11['toUpperCase']()]+']',_0x1eee('0x4f'));emit(_0x4efcc2,_0x39b191[_0x1eee('0x50')],_0x18e19b['endUserId']);}})[_0x1eee('0x17')](function(_0x4f92af){logger[_0x1eee('0x18')]('['+[_0x661f11[_0x1eee('0x19')]()]+_0x1eee('0x51'),util[_0x1eee('0x52')](_0x4f92af,{'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 ab957db..1555c9c 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 _0x2b3e=['lodash','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','data1','toLowerCase','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','data2','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b3e,0x160));var _0xe2b3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2b3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe2b3('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xe2b3('0x1'));var zoho=require('./zoho');var desk=require(_0xe2b3('0x2'));var vtiger=require(_0xe2b3('0x3'));var servicenow=require(_0xe2b3('0x4'));var dynamics365=require(_0xe2b3('0x5'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce',_0xe2b3('0x6'),_0xe2b3('0x7'),_0xe2b3('0x8'),_0xe2b3('0x9'),_0xe2b3('0xa'),_0xe2b3('0xb'),_0xe2b3('0xc'),_0xe2b3('0xd')];exports['exec']=function(_0x107ddb,_0x104cf4,_0x3a31a9,_0x57a0bb,_0x53a102,_0x3ff49d){if(_0x3a31a9){if(_['includes'](integrations,_0x107ddb[_0xe2b3('0xe')][_0xe2b3('0xf')]())){try{var _0x586f5b=null;var _0x47f45e='';var _0x2fa41a=_0x3a31a9[_0x107ddb['data1'][_0xe2b3('0xf')]()];if(_0x2fa41a){var _0x780b29=_0x2fa41a[_0x107ddb['data2']];if(_0x780b29){var _0x2bdb87=_['find'](_0x780b29['Configurations'],{'id':parseInt(_0x107ddb[_0xe2b3('0x10')],0xa)});if(_0x2bdb87){if(_0x57a0bb){if(_0x53a102&&_0x104cf4[_0xe2b3('0x11')]){_0x47f45e='queue';}else if(_0x104cf4[_0xe2b3('0x12')]){_0x47f45e=_0xe2b3('0x13');}else{console[_0xe2b3('0x14')](_0xe2b3('0x15'),_0x104cf4);}}else{_0x47f45e=_0xe2b3('0x16');}switch(_0x107ddb['data1'][_0xe2b3('0xf')]()){case _0xe2b3('0x17'):zendesk[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0x18'):salesforce[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0x6'):sugarcrm[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case'freshdesk':freshdesk[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0x8'):zoho[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0x9'):desk[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0xa'):vtiger[_0x47f45e](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d);break;case _0xe2b3('0xc'):freshsales['cs'](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d,_0x47f45e);break;case _0xe2b3('0xd'):servicenow['cs'](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d,_0x47f45e);break;case'dynamics365':dynamics365['cs'](_0x107ddb,_0x104cf4,_0x2bdb87,_0x57a0bb,_0x53a102,_0x780b29,_0x3ff49d,_0x47f45e);break;default:console[_0xe2b3('0x14')](_0xe2b3('0x19'));}}else{_0x586f5b=require(_0xe2b3('0x1a'))(_0x107ddb[_0xe2b3('0xe')][_0xe2b3('0xf')]());_0x586f5b['error'](_0xe2b3('0x1b'),util['format'](_0xe2b3('0x1c'),_0x107ddb[_0xe2b3('0xe')][_0xe2b3('0xf')](),_0x107ddb['data3']));}}else{_0x586f5b=require('../../../../config/logger')(_0x107ddb[_0xe2b3('0xe')]['toLowerCase']());_0x586f5b['error']('[EXEC]',util[_0xe2b3('0x1d')]('%s\x20account\x20#%s\x20not\x20found',_0x107ddb[_0xe2b3('0xe')][_0xe2b3('0xf')](),_0x107ddb[_0xe2b3('0x1e')]));}}else{}}catch(_0x1ebd2c){console[_0xe2b3('0x1f')](_0x1ebd2c);}}}}; \ No newline at end of file +var _0xd3ad=['routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','freshdesk','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue'];(function(_0x1f4c1e,_0x4950cc){var _0x2b1a27=function(_0x1949dd){while(--_0x1949dd){_0x1f4c1e['push'](_0x1f4c1e['shift']());}};_0x2b1a27(++_0x4950cc);}(_0xd3ad,0x134));var _0xdd3a=function(_0x5db8ad,_0x546df3){_0x5db8ad=_0x5db8ad-0x0;var _0x3e431d=_0xd3ad[_0x5db8ad];return _0x3e431d;};'use strict';var _=require(_0xdd3a('0x0'));var util=require(_0xdd3a('0x1'));var zendesk=require(_0xdd3a('0x2'));var salesforce=require(_0xdd3a('0x3'));var sugarcrm=require(_0xdd3a('0x4'));var freshdesk=require(_0xdd3a('0x5'));var zoho=require(_0xdd3a('0x6'));var desk=require(_0xdd3a('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0xdd3a('0x8'));var dynamics365=require(_0xdd3a('0x9'));var freshsales=require(_0xdd3a('0xa'));var integrations=['zendesk',_0xdd3a('0xb'),_0xdd3a('0xc'),'freshdesk',_0xdd3a('0xd'),'desk',_0xdd3a('0xe'),'dynamics365',_0xdd3a('0xf'),_0xdd3a('0x10')];exports['exec']=function(_0x1075f8,_0x5e5778,_0x1ffcae,_0x400313,_0x24d434,_0x527cb6){if(_0x1ffcae){if(_[_0xdd3a('0x11')](integrations,_0x1075f8[_0xdd3a('0x12')][_0xdd3a('0x13')]())){try{var _0x588fa3=null;var _0x3ee0b0='';var _0x5eb8da=_0x1ffcae[_0x1075f8['data1'][_0xdd3a('0x13')]()];if(_0x5eb8da){var _0x9ff70=_0x5eb8da[_0x1075f8[_0xdd3a('0x14')]];if(_0x9ff70){var _0x2ed1fb=_[_0xdd3a('0x15')](_0x9ff70[_0xdd3a('0x16')],{'id':parseInt(_0x1075f8[_0xdd3a('0x17')],0xa)});if(_0x2ed1fb){if(_0x400313){if(_0x24d434&&_0x5e5778[_0xdd3a('0x18')]){_0x3ee0b0=_0xdd3a('0x18');}else if(_0x5e5778[_0xdd3a('0x19')]){_0x3ee0b0=_0xdd3a('0x1a');}else{console[_0xdd3a('0x1b')](_0xdd3a('0x1c'),_0x5e5778);}}else{_0x3ee0b0='unmanaged';}switch(_0x1075f8[_0xdd3a('0x12')][_0xdd3a('0x13')]()){case _0xdd3a('0x1d'):zendesk[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case _0xdd3a('0xb'):salesforce[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case _0xdd3a('0xc'):sugarcrm[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case _0xdd3a('0x1e'):freshdesk[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case _0xdd3a('0xd'):zoho[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case'desk':desk[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case _0xdd3a('0xe'):vtiger[_0x3ee0b0](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6);break;case'freshsales':freshsales['cs'](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6,_0x3ee0b0);break;case'servicenow':servicenow['cs'](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6,_0x3ee0b0);break;case'dynamics365':dynamics365['cs'](_0x1075f8,_0x5e5778,_0x2ed1fb,_0x400313,_0x24d434,_0x9ff70,_0x527cb6,_0x3ee0b0);break;default:console['log']('unknown\x20integration');}}else{_0x588fa3=require(_0xdd3a('0x1f'))(_0x1075f8[_0xdd3a('0x12')][_0xdd3a('0x13')]());_0x588fa3[_0xdd3a('0x20')](_0xdd3a('0x21'),util[_0xdd3a('0x22')](_0xdd3a('0x23'),_0x1075f8[_0xdd3a('0x12')][_0xdd3a('0x13')](),_0x1075f8[_0xdd3a('0x17')]));}}else{_0x588fa3=require(_0xdd3a('0x1f'))(_0x1075f8[_0xdd3a('0x12')]['toLowerCase']());_0x588fa3['error'](_0xdd3a('0x21'),util['format'](_0xdd3a('0x24'),_0x1075f8[_0xdd3a('0x12')][_0xdd3a('0x13')](),_0x1075f8[_0xdd3a('0x14')]));}}else{}}catch(_0x4e4514){console[_0xdd3a('0x20')](_0x4e4514);}}}}; \ 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 b146a0a..2783b2b 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 _0xe038=['stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','catch','unmanaged','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lastevent','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','Case','ContactId','AccountId','lead','leadId','info','create','isNil','validateEmail','sobject','find','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','merge','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','','Company','No\x20Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe038,0xa3));var _0x8e03=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xe038[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x8e03('0x0'));var rp=require(_0x8e03('0x1'));var moment=require(_0x8e03('0x2'));var BPromise=require(_0x8e03('0x3'));var md5=require(_0x8e03('0x4'));var jsforce=require(_0x8e03('0x5'));var util=require(_0x8e03('0x6'));var Redis=require(_0x8e03('0x7'));var intUtil=require(_0x8e03('0x8'));var config=require(_0x8e03('0x9'));var logger=require(_0x8e03('0xa'))(_0x8e03('0xb'));config['redis']=_[_0x8e03('0xc')](config[_0x8e03('0xd')],{'host':_0x8e03('0xe'),'port':0x18eb});var io=require(_0x8e03('0xf'))(new Redis(config['redis']));function emit(_0x543cda,_0x2566da,_0x52a88d){io['to'](_0x543cda)[_0x8e03('0x10')](_0x2566da,_0x52a88d);}function getTicket(_0x42ed02,_0x1d588c,_0x7525a,_0x13ebd9,_0xfa8c17,_0x55bec3,_0x3633de,_0x5d916c){var _0x599cee=Object['assign']({},{'OwnerId':_0x1d588c['id'],'Subject':intUtil[_0x8e03('0x11')](_0x13ebd9['Subjects'],_0xfa8c17,'\x20'),'Description':intUtil[_0x8e03('0x11')](_0x13ebd9['Descriptions'],_0xfa8c17,'\x0a')},getCustomFields(_0x55bec3,_0xfa8c17));if(_0x7525a){if(_0x13ebd9[_0x8e03('0x12')]===_0x8e03('0x13')){_0x599cee[_0x8e03('0x14')]=moment[_0x8e03('0x15')]();_0x599cee[_0x8e03('0x16')]=![];_0x599cee[_0x8e03('0x17')]=![];if(_0x7525a[_0x8e03('0x18')]===_0x8e03('0x19')||_0x7525a['endUserType']==='lead'){_0x599cee[_0x8e03('0x1a')]=_0x7525a['id'];}else if(_0x7525a[_0x8e03('0x18')]===_0x8e03('0x1b')){_0x599cee['WhatId']=_0x7525a['id'];}}else if(_0x13ebd9['ticketType']===_0x8e03('0x1c')){if(_0x7525a[_0x8e03('0x18')]===_0x8e03('0x19')){_0x599cee[_0x8e03('0x1d')]=_0x7525a['id'];}else if(_0x7525a[_0x8e03('0x18')]==='account'){_0x599cee[_0x8e03('0x1e')]=_0x7525a['id'];}else if(_0x7525a[_0x8e03('0x18')]===_0x8e03('0x1f')&&_0x13ebd9['leadId']){_0x599cee[_0x13ebd9[_0x8e03('0x20')]]=_0x7525a['id'];}else{logger[_0x8e03('0x21')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3633de['sobject'](_0x13ebd9['ticketType'])[_0x8e03('0x22')](_0x599cee);}function getUser(_0x5e5655,_0x410c78,_0x134348){if(!_[_0x8e03('0x23')](_0x410c78)&&intUtil[_0x8e03('0x24')](_0x410c78)){var _0x19129c={'Email':_0x410c78};var _0x1e2117={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x134348[_0x8e03('0x25')]('User')[_0x8e03('0x26')](_0x19129c,_0x1e2117)['execute']()[_0x8e03('0x27')](function(_0x80453b){if(_0x80453b[_0x8e03('0x28')]){var _0x2f7051=_[_0x8e03('0x26')](_0x80453b,function(_0x4204fb){return _0x4204fb['Email']===_0x410c78;});if(_0x2f7051){logger[_0x8e03('0x21')](_0x8e03('0x29'),_0x410c78);return BPromise[_0x8e03('0x2a')]({'id':_0x2f7051['Id'],'name':_0x2f7051[_0x8e03('0x2b')]});}}else{logger['info'](_0x8e03('0x2c'),_0x410c78);return _0x134348[_0x8e03('0x2d')]()['then'](function(_0x3cf8cf){return BPromise['resolve']({'id':_0x3cf8cf['user_id'],'name':_0x3cf8cf[_0x8e03('0x2e')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x410c78);return _0x134348[_0x8e03('0x2d')]()[_0x8e03('0x27')](function(_0x25ad2c){return BPromise[_0x8e03('0x2a')]({'id':_0x25ad2c['user_id'],'name':_0x25ad2c[_0x8e03('0x2e')]});});}}function getEndUser(_0xc29fea,_0x3daec9,_0x30b0f4,_0x24e192,_0x1aa16b){var _0x5bf51d={'$or':{'Phone':_0x24e192}};var _0xd5d060={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x8e03('0x27')](function(){logger[_0x8e03('0x21')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x24e192,_0x3daec9[_0x8e03('0x2f')]);switch(_0x3daec9['moduleSearch']){case'contact_lead':var _0x38e87f=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x31')]){var _0x4b13cb={};_0x4b13cb[_0x3daec9[_0x8e03('0x31')]]=_0x24e192;_['merge'](_0x38e87f[_0x8e03('0x32')],_0x4b13cb);}return _0x1aa16b['sobject'](_0x8e03('0x33'))[_0x8e03('0x26')](_0x38e87f,_0xd5d060)[_0x8e03('0x34')]()[_0x8e03('0x27')](function(_0x26339a){if(_0x26339a&&_0x26339a[_0x8e03('0x28')]){return _0x26339a;}else{var _0x4dde8c=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x35')]){var _0x27198a={};_0x27198a[_0x3daec9[_0x8e03('0x35')]]=_0x24e192;_['merge'](_0x4dde8c['$or'],_0x27198a);}return _0x1aa16b[_0x8e03('0x25')](_0x8e03('0x36'))['find'](_0x4dde8c,_0xd5d060);}});case _0x8e03('0x37'):var _0x12fca9=_['cloneDeep'](_0x5bf51d);if(_0x3daec9[_0x8e03('0x38')]){var _0x4b13cb={};_0x4b13cb[_0x3daec9[_0x8e03('0x38')]]=_0x24e192;_['merge'](_0x12fca9[_0x8e03('0x32')],_0x4b13cb);}return _0x1aa16b[_0x8e03('0x25')](_0x8e03('0x39'))['find'](_0x12fca9,_0xd5d060)[_0x8e03('0x34')]()['then'](function(_0x19af2b){if(_0x19af2b&&_0x19af2b['length']){return _0x19af2b;}else{var _0x55f829=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x31')]){var _0x531f01={};_0x531f01[_0x3daec9['additionalSearchContact']]=_0x24e192;_[_0x8e03('0x3a')](_0x55f829[_0x8e03('0x32')],_0x531f01);}return _0x1aa16b['sobject'](_0x8e03('0x33'))[_0x8e03('0x26')](_0x55f829,_0xd5d060)[_0x8e03('0x27')](function(_0x52e117){if(_0x52e117&&_0x52e117[_0x8e03('0x28')]){return _0x52e117;}else{var _0x4850cc=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x35')]){var _0x4c7ae4={};_0x4c7ae4[_0x3daec9[_0x8e03('0x35')]]=_0x24e192;_[_0x8e03('0x3a')](_0x4850cc['$or'],_0x4c7ae4);}return _0x1aa16b['sobject']('Lead')[_0x8e03('0x26')](_0x4850cc,_0xd5d060);}});}});case _0x8e03('0x19'):var _0x38e87f=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x31')]){var _0x4b13cb={};_0x4b13cb[_0x3daec9[_0x8e03('0x31')]]=_0x24e192;_[_0x8e03('0x3a')](_0x38e87f['$or'],_0x4b13cb);}return _0x1aa16b[_0x8e03('0x25')](_0x8e03('0x33'))[_0x8e03('0x26')](_0x38e87f,_0xd5d060)['execute']();case'lead':var _0x122f96=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x35')]){var _0x4b13cb={};_0x4b13cb[_0x3daec9['additionalSearchLead']]=_0x24e192;_[_0x8e03('0x3a')](_0x122f96[_0x8e03('0x32')],_0x4b13cb);}return _0x1aa16b[_0x8e03('0x25')](_0x8e03('0x36'))[_0x8e03('0x26')](_0x122f96,_0xd5d060);case'account':var _0x12fca9=_[_0x8e03('0x30')](_0x5bf51d);if(_0x3daec9[_0x8e03('0x38')]){var _0x4b13cb={};_0x4b13cb[_0x3daec9[_0x8e03('0x38')]]=_0x24e192;_['merge'](_0x12fca9['$or'],_0x4b13cb);}return _0x1aa16b[_0x8e03('0x25')](_0x8e03('0x39'))['find'](_0x12fca9,_0xd5d060);default:return null;}})[_0x8e03('0x27')](function(_0x51c68a){if(_0x51c68a&&_0x51c68a[_0x8e03('0x28')]){var _0xc346f8=_[_0x8e03('0x3b')](_0x51c68a);if(_0xc346f8){return BPromise[_0x8e03('0x2a')]({'id':_0xc346f8['Id'],'name':_0xc346f8[_0x8e03('0x2b')],'phone':_0xc346f8[_0x8e03('0x3c')],'endUserType':_0xc346f8['attributes'][_0x8e03('0x3d')][_0x8e03('0x3e')]()});}}})['then'](function(_0x2a3335){if(_0x2a3335){logger['info'](_0x8e03('0x3f'),_0x2a3335[_0x8e03('0x18')],_0x24e192);return BPromise[_0x8e03('0x2a')](_0x2a3335);}else{logger[_0x8e03('0x21')](_0x8e03('0x40'),_0x24e192);var _0x6933c4={'Phone':_0x24e192};if(_0x3daec9[_0x8e03('0x41')]){if(_0x3daec9[_0x8e03('0x41')]===_0x8e03('0x19')){logger[_0x8e03('0x21')](_0x8e03('0x42'),_0x24e192,_0x3daec9[_0x8e03('0x41')]);_0x6933c4['LastName']=_0x30b0f4!==''?_0x30b0f4:util[_0x8e03('0x43')](_0x8e03('0x44'),_0x24e192);}else if(_0x3daec9['moduleCreate']===_0x8e03('0x1f')){logger[_0x8e03('0x21')](_0x8e03('0x42'),_0x24e192,_0x3daec9[_0x8e03('0x41')]);_0x6933c4[_0x8e03('0x45')]=_0x30b0f4!==_0x8e03('0x46')?_0x30b0f4:util[_0x8e03('0x43')](_0x8e03('0x44'),_0x24e192);_0x6933c4[_0x8e03('0x47')]=_0x8e03('0x48');}else if(_0x3daec9[_0x8e03('0x41')]===_0x8e03('0x1b')){logger['info'](_0x8e03('0x42'),_0x24e192,_0x3daec9[_0x8e03('0x41')]);_0x6933c4[_0x8e03('0x2b')]=_0x30b0f4!==_0x8e03('0x46')?_0x30b0f4:util[_0x8e03('0x43')](_0x8e03('0x44'),_0x24e192);}else{return null;}}return _0x1aa16b[_0x8e03('0x25')](_['upperFirst'](_0x3daec9['moduleCreate']))[_0x8e03('0x22')](_0x6933c4)[_0x8e03('0x27')](function(_0x2736b6){return BPromise[_0x8e03('0x2a')]({'id':_0x2736b6['id'],'endUserType':_0x3daec9[_0x8e03('0x41')]});});}});}function getCustomFields(_0x36f13f,_0x1b00bd){var _0x126a18={};if(_0x36f13f[_0x8e03('0x28')]>0x0){_[_0x8e03('0x49')](_0x36f13f,function(_0x360ddd){if(_[_0x8e03('0x4a')]([_0x8e03('0x4b'),_0x8e03('0x4c')],_0x360ddd[_0x8e03('0x3d')])&&_0x360ddd[_0x8e03('0x4d')]){_0x126a18[_0x360ddd[_0x8e03('0x4d')]]=_0x360ddd[_0x8e03('0x4e')][_0x8e03('0x4f')]();}else if(_0x360ddd[_0x8e03('0x3d')]===_0x8e03('0x50')&&_0x360ddd[_0x8e03('0x51')]&&_0x360ddd['idField']){_0x1b00bd[_0x360ddd[_0x8e03('0x51')]]&&(_0x126a18[_0x360ddd[_0x8e03('0x4d')]]=_0x1b00bd[_0x360ddd[_0x8e03('0x51')]][_0x8e03('0x4f')]());}else if(_0x360ddd[_0x8e03('0x3d')]===_0x8e03('0x52')&&_0x360ddd['Variable']&&_0x360ddd[_0x8e03('0x53')][_0x8e03('0x54')]&&_0x360ddd['idField']){_0x1b00bd[_0x360ddd[_0x8e03('0x53')][_0x8e03('0x54')][_0x8e03('0x3e')]()]&&(_0x126a18[_0x360ddd[_0x8e03('0x4d')]]=_0x1b00bd[_0x360ddd[_0x8e03('0x53')][_0x8e03('0x54')]['toLowerCase']()][_0x8e03('0x4f')]());}});}return _0x126a18;}function getConnection(_0x3a4ace){var _0x231fc3=_0x3a4ace[_0x8e03('0x55')][_0x8e03('0x56')](_0x3a4ace['securityToken']);var _0x16ada5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3a4ace[_0x8e03('0x57')]||_0x8e03('0x58'),'clientId':_0x3a4ace['clientId'],'clientSecret':_0x3a4ace[_0x8e03('0x59')]}});return _0x16ada5[_0x8e03('0x5a')](_0x3a4ace[_0x8e03('0x5b')],_0x231fc3)[_0x8e03('0x27')](function(){logger[_0x8e03('0x21')](_0x8e03('0x5c'));return _0x16ada5;});}exports[_0x8e03('0x5d')]=function(_0x54013b,_0x40c831,_0x2d774f,_0x309cb1,_0x395a91,_0xb83ef6){var _0x5da8c0,_0x35912f,_0x2a8b9d,_0x42e81d;_0xb83ef6[_0x8e03('0x5e')]=intUtil[_0x8e03('0x5f')](_0xb83ef6[_0x8e03('0x5e')]);_0xb83ef6[_0x8e03('0x57')]=intUtil[_0x8e03('0x5f')](_0xb83ef6[_0x8e03('0x57')]);if(_0x395a91&&_0x395a91[_0x8e03('0x60')]){logger[_0x8e03('0x21')](_0x8e03('0x61'),'Recording\x20is\x20enabled!');_0x40c831[_0x8e03('0x62')]=util[_0x8e03('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb83ef6[_0x8e03('0x5e')],_0x40c831[_0x8e03('0x63')],md5(_0x40c831[_0x8e03('0x63')]));}else{_0x40c831[_0x8e03('0x62')]='';}return getConnection(_0xb83ef6)[_0x8e03('0x27')](function(_0x4c0fb2){_0x42e81d=_0x4c0fb2;return getUser(_0xb83ef6,_0x309cb1['email'],_0x42e81d);})[_0x8e03('0x27')](function(_0x1b7c2f){_0x5da8c0=_0x1b7c2f;return getEndUser(_0xb83ef6,_0x2d774f,_0x40c831[_0x8e03('0x64')],_0x40c831[_0x8e03('0x65')],_0x42e81d);})[_0x8e03('0x27')](function(_0x55c9fc){_0x35912f=_0x55c9fc;return getTicket(_0xb83ef6,_0x5da8c0,_0x35912f,_0x2d774f,_0x40c831,_0x2d774f['Fields'],_0x42e81d,_0x8e03('0x5d'));})[_0x8e03('0x27')](function(_0x34c45e){_0x2a8b9d=_0x34c45e;logger[_0x8e03('0x21')](_0x8e03('0x66'),_0x2a8b9d['id']);logger[_0x8e03('0x21')](_0x8e03('0x67'),_0x2a8b9d['id'],_0x309cb1[_0x8e03('0x54')],_0xb83ef6[_0x8e03('0x3d')]);switch(_0xb83ef6[_0x8e03('0x3d')]){case _0x8e03('0x68'):emit(util[_0x8e03('0x43')](_0x8e03('0x69'),_0x309cb1[_0x8e03('0x54')]),'trigger:salesforce:display',{'recordId':_0x2a8b9d['id']});break;case _0x8e03('0x6a'):emit(util['format'](_0x8e03('0x69'),_0x309cb1[_0x8e03('0x54')]),_0x8e03('0x6b'),{'uri':util['format'](_0x8e03('0x6c'),_0x42e81d[_0x8e03('0x6d')],_0x2a8b9d['id'])});break;default:logger[_0x8e03('0x6e')](_0x8e03('0x6f'));}})['catch'](function(_0x54ec12){logger[_0x8e03('0x6e')]('[QUEUE]',_0x54ec12);});};exports['outbound']=function(_0x3a598c,_0x24ac64,_0x3d899e,_0x14882c,_0xb6c4aa,_0x1332be,_0x58dcc9){var _0x24c344,_0x2c4355,_0x4ef556,_0x14ea06;_0x1332be[_0x8e03('0x5e')]=intUtil[_0x8e03('0x5f')](_0x1332be['serverUrl']);_0x1332be[_0x8e03('0x57')]=intUtil[_0x8e03('0x5f')](_0x1332be[_0x8e03('0x57')]);if(_0x58dcc9&&_0x58dcc9['recordingFormat']&&_0x58dcc9[_0x8e03('0x70')]!==_0x8e03('0x71')){logger[_0x8e03('0x21')](_0x8e03('0x72'),_0x8e03('0x73'));_0x24ac64[_0x8e03('0x62')]=util[_0x8e03('0x43')](_0x8e03('0x74'),_0x1332be['serverUrl'],_0x24ac64[_0x8e03('0x63')],md5(_0x24ac64[_0x8e03('0x63')]));}return getConnection(_0x1332be)['then'](function(_0x2b41cf){_0x14ea06=_0x2b41cf;return getUser(_0x1332be,_0x14882c[_0x8e03('0x75')],_0x14ea06);})[_0x8e03('0x27')](function(_0xbfdce6){_0x24c344=_0xbfdce6;return getEndUser(_0x1332be,_0x3d899e,_0x24ac64[_0x8e03('0x76')],_0x24ac64[_0x8e03('0x77')],_0x14ea06);})[_0x8e03('0x27')](function(_0x34bbfc){_0x2c4355=_0x34bbfc;return getTicket(_0x1332be,_0x24c344,_0x2c4355,_0x3d899e,_0x24ac64,_0x3d899e[_0x8e03('0x78')],_0x14ea06,_0x8e03('0x79'));})[_0x8e03('0x27')](function(_0x439170){_0x4ef556=_0x439170;logger[_0x8e03('0x21')](_0x8e03('0x7a'),_0x4ef556['id']);logger[_0x8e03('0x21')](_0x8e03('0x7b'),_0x4ef556['id'],_0x14882c[_0x8e03('0x54')],_0x1332be[_0x8e03('0x3d')]);switch(_0x1332be[_0x8e03('0x3d')]){case _0x8e03('0x68'):emit(util[_0x8e03('0x43')](_0x8e03('0x69'),_0x14882c[_0x8e03('0x54')]),'trigger:salesforce:display',{'recordId':_0x4ef556['id']});break;case'newTab':emit(util[_0x8e03('0x43')](_0x8e03('0x69'),_0x14882c[_0x8e03('0x54')]),'trigger:browser:url',{'uri':util[_0x8e03('0x43')](_0x8e03('0x6c'),_0x14ea06[_0x8e03('0x6d')],_0x4ef556['id'])});break;default:logger[_0x8e03('0x6e')](_0x8e03('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x8e03('0x7c')](function(_0x2ddef2){logger[_0x8e03('0x6e')]('[OUTBOUND]',_0x2ddef2);});};exports[_0x8e03('0x7d')]=function(_0x1fe209,_0x1be08f,_0x169b40,_0x209019,_0x59d640,_0x4ec88c){var _0xb4736b,_0x13bd9d,_0x454295,_0xa07f8e;_0x4ec88c[_0x8e03('0x5e')]=intUtil['stripTrailingSlash'](_0x4ec88c[_0x8e03('0x5e')]);_0x4ec88c[_0x8e03('0x57')]=intUtil['stripTrailingSlash'](_0x4ec88c[_0x8e03('0x57')]);if(_0x59d640&&_0x59d640[_0x8e03('0x60')]){logger[_0x8e03('0x21')]('['+_0x1be08f['lastevent'][_0x8e03('0x7e')]()+']',_0x8e03('0x73'));_0x1be08f[_0x8e03('0x62')]=util['format'](_0x8e03('0x74'),_0x4ec88c[_0x8e03('0x5e')],_0x1be08f[_0x8e03('0x63')],md5(_0x1be08f['uniqueid']));}else{_0x1be08f[_0x8e03('0x62')]='';}return getConnection(_0x4ec88c)[_0x8e03('0x27')](function(_0x3b5ae9){_0xa07f8e=_0x3b5ae9;if(!_[_0x8e03('0x23')](_0x209019)){return getUser(_0x4ec88c,_0x209019['name'],_0xa07f8e);}else{return getUser(_0x4ec88c,null,_0xa07f8e);}})[_0x8e03('0x27')](function(_0x7b3040){_0xb4736b=_0x7b3040;return getEndUser(_0x4ec88c,_0x169b40,_0x1be08f[_0x8e03('0x64')],_0x1be08f[_0x8e03('0x65')],_0xa07f8e);})['then'](function(_0x270f0a){_0x13bd9d=_0x270f0a;return getTicket(_0x4ec88c,_0xb4736b,_0x13bd9d,_0x169b40,_0x1be08f,_0x169b40[_0x8e03('0x78')],_0xa07f8e);})[_0x8e03('0x27')](function(_0x3cdbce){_0x454295=_0x3cdbce;logger[_0x8e03('0x21')]('['+_0x1be08f['lastevent'][_0x8e03('0x7e')]()+']\x20Ticket\x20%s\x20created.',_0x454295['id']);logger['info']('['+_0x1be08f['lastevent'][_0x8e03('0x7e')]()+_0x8e03('0x7f'),_0x4ec88c['type']);})[_0x8e03('0x7c')](function(_0x15b26c){logger[_0x8e03('0x6e')]('['+_0x1be08f[_0x8e03('0x80')][_0x8e03('0x7e')]()+']',_0x15b26c);});}; \ No newline at end of file +var _0x73d1=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','LastName','format','Company','No\x20Company','upperFirst','forEach','includes','type','idField','toString','variableName','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','integrationTab','user:%s','trigger:salesforce:display','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','Fields','trigger:browser:url','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','additionalSearchAccount','Account','first','resolve','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate'];(function(_0x3875b1,_0x47cf1a){var _0x1e9c55=function(_0xc8e89b){while(--_0xc8e89b){_0x3875b1['push'](_0x3875b1['shift']());}};_0x1e9c55(++_0x47cf1a);}(_0x73d1,0xaf));var _0x173d=function(_0xa765b1,_0x50d5ce){_0xa765b1=_0xa765b1-0x0;var _0x46197b=_0x73d1[_0xa765b1];return _0x46197b;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x173d('0x0'));var BPromise=require(_0x173d('0x1'));var md5=require(_0x173d('0x2'));var jsforce=require('jsforce');var util=require(_0x173d('0x3'));var Redis=require(_0x173d('0x4'));var intUtil=require(_0x173d('0x5'));var config=require(_0x173d('0x6'));var logger=require(_0x173d('0x7'))(_0x173d('0x8'));config[_0x173d('0x9')]=_['defaults'](config[_0x173d('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x173d('0xa'))(new Redis(config[_0x173d('0x9')]));function emit(_0x2c6f45,_0x57b060,_0x2f9c28){io['to'](_0x2c6f45)['emit'](_0x57b060,_0x2f9c28);}function getTicket(_0x15647f,_0x52326b,_0x5043f8,_0x383153,_0x85ab5d,_0x2a37b9,_0x3c100c,_0x551978){var _0xe24120=Object[_0x173d('0xb')]({},{'OwnerId':_0x52326b['id'],'Subject':intUtil[_0x173d('0xc')](_0x383153[_0x173d('0xd')],_0x85ab5d,'\x20'),'Description':intUtil['getString'](_0x383153[_0x173d('0xe')],_0x85ab5d,'\x0a')},getCustomFields(_0x2a37b9,_0x85ab5d));if(_0x5043f8){if(_0x383153[_0x173d('0xf')]===_0x173d('0x10')){_0xe24120[_0x173d('0x11')]=moment[_0x173d('0x12')]();_0xe24120[_0x173d('0x13')]=![];_0xe24120[_0x173d('0x14')]=![];if(_0x5043f8[_0x173d('0x15')]===_0x173d('0x16')||_0x5043f8['endUserType']===_0x173d('0x17')){_0xe24120[_0x173d('0x18')]=_0x5043f8['id'];}else if(_0x5043f8['endUserType']===_0x173d('0x19')){_0xe24120['WhatId']=_0x5043f8['id'];}}else if(_0x383153[_0x173d('0xf')]==='Case'){if(_0x5043f8[_0x173d('0x15')]==='contact'){_0xe24120[_0x173d('0x1a')]=_0x5043f8['id'];}else if(_0x5043f8[_0x173d('0x15')]===_0x173d('0x19')){_0xe24120['AccountId']=_0x5043f8['id'];}else if(_0x5043f8[_0x173d('0x15')]==='lead'&&_0x383153['leadId']){_0xe24120[_0x383153[_0x173d('0x1b')]]=_0x5043f8['id'];}else{logger[_0x173d('0x1c')](_0x173d('0x1d'));}}}return _0x3c100c[_0x173d('0x1e')](_0x383153[_0x173d('0xf')])[_0x173d('0x1f')](_0xe24120);}function getUser(_0xb522e,_0x71270c,_0x188064){if(!_[_0x173d('0x20')](_0x71270c)&&intUtil[_0x173d('0x21')](_0x71270c)){var _0x5a5a74={'Email':_0x71270c};var _0x252eb1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x188064[_0x173d('0x1e')]('User')[_0x173d('0x22')](_0x5a5a74,_0x252eb1)[_0x173d('0x23')]()[_0x173d('0x24')](function(_0x4a18c6){if(_0x4a18c6['length']){var _0xbfef64=_[_0x173d('0x22')](_0x4a18c6,function(_0x463722){return _0x463722[_0x173d('0x25')]===_0x71270c;});if(_0xbfef64){logger[_0x173d('0x1c')](_0x173d('0x26'),_0x71270c);return BPromise['resolve']({'id':_0xbfef64['Id'],'name':_0xbfef64[_0x173d('0x27')]});}}else{logger[_0x173d('0x1c')](_0x173d('0x28'),_0x71270c);return _0x188064[_0x173d('0x29')]()[_0x173d('0x24')](function(_0x218645){return BPromise['resolve']({'id':_0x218645[_0x173d('0x2a')],'name':_0x218645[_0x173d('0x2b')]});});}});}else{logger[_0x173d('0x1c')](_0x173d('0x28'),_0x71270c);return _0x188064[_0x173d('0x29')]()[_0x173d('0x24')](function(_0x48c746){return BPromise['resolve']({'id':_0x48c746['user_id'],'name':_0x48c746[_0x173d('0x2b')]});});}}function getEndUser(_0x2aaa0c,_0x4f5606,_0x40d8d5,_0x3559c1,_0x1b1fa9){var _0x504888={'$or':{'Phone':_0x3559c1}};var _0x590ba5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x173d('0x24')](function(){logger['info'](_0x173d('0x2c'),_0x3559c1,_0x4f5606[_0x173d('0x2d')]);switch(_0x4f5606[_0x173d('0x2d')]){case _0x173d('0x2e'):var _0x4fd84f=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606[_0x173d('0x30')]){var _0x3993a6={};_0x3993a6[_0x4f5606[_0x173d('0x30')]]=_0x3559c1;_[_0x173d('0x31')](_0x4fd84f[_0x173d('0x32')],_0x3993a6);}return _0x1b1fa9[_0x173d('0x1e')](_0x173d('0x33'))[_0x173d('0x22')](_0x4fd84f,_0x590ba5)[_0x173d('0x23')]()[_0x173d('0x24')](function(_0x5ea953){if(_0x5ea953&&_0x5ea953[_0x173d('0x34')]){return _0x5ea953;}else{var _0x36d5cc=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606[_0x173d('0x35')]){var _0x37f106={};_0x37f106[_0x4f5606['additionalSearchLead']]=_0x3559c1;_[_0x173d('0x31')](_0x36d5cc[_0x173d('0x32')],_0x37f106);}return _0x1b1fa9[_0x173d('0x1e')](_0x173d('0x36'))[_0x173d('0x22')](_0x36d5cc,_0x590ba5);}});case'account_contact_lead':var _0x55ecd6=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606['additionalSearchAccount']){var _0x3993a6={};_0x3993a6[_0x4f5606[_0x173d('0x37')]]=_0x3559c1;_[_0x173d('0x31')](_0x55ecd6['$or'],_0x3993a6);}return _0x1b1fa9[_0x173d('0x1e')](_0x173d('0x38'))[_0x173d('0x22')](_0x55ecd6,_0x590ba5)[_0x173d('0x23')]()[_0x173d('0x24')](function(_0x578f34){if(_0x578f34&&_0x578f34[_0x173d('0x34')]){return _0x578f34;}else{var _0x546cea=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606[_0x173d('0x30')]){var _0x366ef6={};_0x366ef6[_0x4f5606['additionalSearchContact']]=_0x3559c1;_[_0x173d('0x31')](_0x546cea[_0x173d('0x32')],_0x366ef6);}return _0x1b1fa9[_0x173d('0x1e')](_0x173d('0x33'))[_0x173d('0x22')](_0x546cea,_0x590ba5)[_0x173d('0x24')](function(_0x3ed67e){if(_0x3ed67e&&_0x3ed67e['length']){return _0x3ed67e;}else{var _0x3a1574=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606[_0x173d('0x35')]){var _0x33b255={};_0x33b255[_0x4f5606['additionalSearchLead']]=_0x3559c1;_[_0x173d('0x31')](_0x3a1574[_0x173d('0x32')],_0x33b255);}return _0x1b1fa9[_0x173d('0x1e')](_0x173d('0x36'))[_0x173d('0x22')](_0x3a1574,_0x590ba5);}});}});case'contact':var _0x4fd84f=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606['additionalSearchContact']){var _0x3993a6={};_0x3993a6[_0x4f5606['additionalSearchContact']]=_0x3559c1;_[_0x173d('0x31')](_0x4fd84f['$or'],_0x3993a6);}return _0x1b1fa9[_0x173d('0x1e')]('Contact')[_0x173d('0x22')](_0x4fd84f,_0x590ba5)['execute']();case'lead':var _0x5a0362=_['cloneDeep'](_0x504888);if(_0x4f5606[_0x173d('0x35')]){var _0x3993a6={};_0x3993a6[_0x4f5606[_0x173d('0x35')]]=_0x3559c1;_[_0x173d('0x31')](_0x5a0362['$or'],_0x3993a6);}return _0x1b1fa9[_0x173d('0x1e')]('Lead')[_0x173d('0x22')](_0x5a0362,_0x590ba5);case _0x173d('0x19'):var _0x55ecd6=_[_0x173d('0x2f')](_0x504888);if(_0x4f5606[_0x173d('0x37')]){var _0x3993a6={};_0x3993a6[_0x4f5606[_0x173d('0x37')]]=_0x3559c1;_['merge'](_0x55ecd6[_0x173d('0x32')],_0x3993a6);}return _0x1b1fa9['sobject'](_0x173d('0x38'))['find'](_0x55ecd6,_0x590ba5);default:return null;}})[_0x173d('0x24')](function(_0x254c54){if(_0x254c54&&_0x254c54[_0x173d('0x34')]){var _0x3b87f5=_[_0x173d('0x39')](_0x254c54);if(_0x3b87f5){return BPromise[_0x173d('0x3a')]({'id':_0x3b87f5['Id'],'name':_0x3b87f5[_0x173d('0x27')],'phone':_0x3b87f5[_0x173d('0x3b')],'endUserType':_0x3b87f5[_0x173d('0x3c')]['type'][_0x173d('0x3d')]()});}}})[_0x173d('0x24')](function(_0x4cb5c9){if(_0x4cb5c9){logger[_0x173d('0x1c')](_0x173d('0x3e'),_0x4cb5c9[_0x173d('0x15')],_0x3559c1);return BPromise[_0x173d('0x3a')](_0x4cb5c9);}else{logger['info'](_0x173d('0x3f'),_0x3559c1);var _0x2519a5={'Phone':_0x3559c1};if(_0x4f5606[_0x173d('0x40')]){if(_0x4f5606[_0x173d('0x40')]===_0x173d('0x16')){logger[_0x173d('0x1c')](_0x173d('0x41'),_0x3559c1,_0x4f5606[_0x173d('0x40')]);_0x2519a5['LastName']=_0x40d8d5!==_0x173d('0x42')?_0x40d8d5:util['format'](_0x173d('0x43'),_0x3559c1);}else if(_0x4f5606[_0x173d('0x40')]==='lead'){logger[_0x173d('0x1c')](_0x173d('0x41'),_0x3559c1,_0x4f5606[_0x173d('0x40')]);_0x2519a5[_0x173d('0x44')]=_0x40d8d5!==''?_0x40d8d5:util[_0x173d('0x45')](_0x173d('0x43'),_0x3559c1);_0x2519a5[_0x173d('0x46')]=_0x173d('0x47');}else if(_0x4f5606[_0x173d('0x40')]===_0x173d('0x19')){logger[_0x173d('0x1c')](_0x173d('0x41'),_0x3559c1,_0x4f5606['moduleCreate']);_0x2519a5[_0x173d('0x27')]=_0x40d8d5!==_0x173d('0x42')?_0x40d8d5:util[_0x173d('0x45')](_0x173d('0x43'),_0x3559c1);}else{return null;}}return _0x1b1fa9[_0x173d('0x1e')](_[_0x173d('0x48')](_0x4f5606[_0x173d('0x40')]))[_0x173d('0x1f')](_0x2519a5)[_0x173d('0x24')](function(_0x3c0693){return BPromise[_0x173d('0x3a')]({'id':_0x3c0693['id'],'endUserType':_0x4f5606['moduleCreate']});});}});}function getCustomFields(_0x554780,_0x3b0877){var _0x5ce064={};if(_0x554780['length']>0x0){_[_0x173d('0x49')](_0x554780,function(_0x465480){if(_[_0x173d('0x4a')](['string','picklist'],_0x465480[_0x173d('0x4b')])&&_0x465480[_0x173d('0x4c')]){_0x5ce064[_0x465480[_0x173d('0x4c')]]=_0x465480['content'][_0x173d('0x4d')]();}else if(_0x465480['type']==='variable'&&_0x465480[_0x173d('0x4e')]&&_0x465480[_0x173d('0x4c')]){_0x3b0877[_0x465480[_0x173d('0x4e')]]&&(_0x5ce064[_0x465480[_0x173d('0x4c')]]=_0x3b0877[_0x465480[_0x173d('0x4e')]]['toString']());}else if(_0x465480[_0x173d('0x4b')]==='customVariable'&&_0x465480[_0x173d('0x4f')]&&_0x465480[_0x173d('0x4f')][_0x173d('0x50')]&&_0x465480[_0x173d('0x4c')]){_0x3b0877[_0x465480[_0x173d('0x4f')][_0x173d('0x50')][_0x173d('0x3d')]()]&&(_0x5ce064[_0x465480[_0x173d('0x4c')]]=_0x3b0877[_0x465480[_0x173d('0x4f')][_0x173d('0x50')][_0x173d('0x3d')]()][_0x173d('0x4d')]());}});}return _0x5ce064;}function getConnection(_0x129a1e){var _0x1b8115=_0x129a1e[_0x173d('0x51')][_0x173d('0x52')](_0x129a1e[_0x173d('0x53')]);var _0x37a461=new jsforce['Connection']({'oauth2':{'loginUrl':_0x129a1e[_0x173d('0x54')]||_0x173d('0x55'),'clientId':_0x129a1e[_0x173d('0x56')],'clientSecret':_0x129a1e[_0x173d('0x57')]}});return _0x37a461[_0x173d('0x58')](_0x129a1e['username'],_0x1b8115)['then'](function(){logger['info'](_0x173d('0x59'));return _0x37a461;});}exports[_0x173d('0x5a')]=function(_0x2beb26,_0x4a406b,_0x4db34e,_0x3cf584,_0x4fef92,_0x266fe9){var _0x2cce39,_0x46fbc0,_0x4083de,_0x1a3d81;_0x266fe9['serverUrl']=intUtil[_0x173d('0x5b')](_0x266fe9[_0x173d('0x5c')]);_0x266fe9[_0x173d('0x54')]=intUtil[_0x173d('0x5b')](_0x266fe9[_0x173d('0x54')]);if(_0x4fef92&&_0x4fef92[_0x173d('0x5d')]){logger[_0x173d('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4a406b[_0x173d('0x5e')]=util['format'](_0x173d('0x5f'),_0x266fe9['serverUrl'],_0x4a406b[_0x173d('0x60')],md5(_0x4a406b['uniqueid']));}else{_0x4a406b[_0x173d('0x5e')]='';}return getConnection(_0x266fe9)[_0x173d('0x24')](function(_0x420d79){_0x1a3d81=_0x420d79;return getUser(_0x266fe9,_0x3cf584[_0x173d('0x61')],_0x1a3d81);})[_0x173d('0x24')](function(_0x15c7ec){_0x2cce39=_0x15c7ec;return getEndUser(_0x266fe9,_0x4db34e,_0x4a406b[_0x173d('0x62')],_0x4a406b[_0x173d('0x63')],_0x1a3d81);})[_0x173d('0x24')](function(_0x51134f){_0x46fbc0=_0x51134f;return getTicket(_0x266fe9,_0x2cce39,_0x46fbc0,_0x4db34e,_0x4a406b,_0x4db34e['Fields'],_0x1a3d81,_0x173d('0x5a'));})[_0x173d('0x24')](function(_0x2607cb){_0x4083de=_0x2607cb;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x4083de['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4083de['id'],_0x3cf584[_0x173d('0x50')],_0x266fe9[_0x173d('0x4b')]);switch(_0x266fe9[_0x173d('0x4b')]){case _0x173d('0x64'):emit(util[_0x173d('0x45')](_0x173d('0x65'),_0x3cf584['name']),_0x173d('0x66'),{'recordId':_0x4083de['id']});break;case'newTab':emit(util[_0x173d('0x45')](_0x173d('0x65'),_0x3cf584[_0x173d('0x50')]),'trigger:browser:url',{'uri':util[_0x173d('0x45')]('%s/%s/e',_0x1a3d81[_0x173d('0x67')],_0x4083de['id'])});break;default:logger[_0x173d('0x68')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x173d('0x69')](function(_0x3b97fb){logger[_0x173d('0x68')](_0x173d('0x6a'),_0x3b97fb);});};exports[_0x173d('0x6b')]=function(_0x4611c1,_0x400acc,_0x538c44,_0x1bf2f8,_0x3efcc3,_0x5f3f0d,_0x376cff){var _0x2dc0f6,_0x54cbab,_0x3ecdba,_0x450bab;_0x5f3f0d[_0x173d('0x5c')]=intUtil[_0x173d('0x5b')](_0x5f3f0d['serverUrl']);_0x5f3f0d['remoteUri']=intUtil['stripTrailingSlash'](_0x5f3f0d[_0x173d('0x54')]);if(_0x376cff&&_0x376cff[_0x173d('0x6c')]&&_0x376cff[_0x173d('0x6c')]!==_0x173d('0x6d')){logger[_0x173d('0x1c')]('[OUTBOUND]',_0x173d('0x6e'));_0x400acc[_0x173d('0x5e')]=util[_0x173d('0x45')](_0x173d('0x5f'),_0x5f3f0d[_0x173d('0x5c')],_0x400acc[_0x173d('0x60')],md5(_0x400acc[_0x173d('0x60')]));}return getConnection(_0x5f3f0d)['then'](function(_0x31d519){_0x450bab=_0x31d519;return getUser(_0x5f3f0d,_0x1bf2f8['email'],_0x450bab);})[_0x173d('0x24')](function(_0x3073ee){_0x2dc0f6=_0x3073ee;return getEndUser(_0x5f3f0d,_0x538c44,_0x400acc['destcalleridname'],_0x400acc[_0x173d('0x6f')],_0x450bab);})[_0x173d('0x24')](function(_0x4e95f6){_0x54cbab=_0x4e95f6;return getTicket(_0x5f3f0d,_0x2dc0f6,_0x54cbab,_0x538c44,_0x400acc,_0x538c44[_0x173d('0x70')],_0x450bab,_0x173d('0x6b'));})['then'](function(_0x26f3b6){_0x3ecdba=_0x26f3b6;logger[_0x173d('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3ecdba['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3ecdba['id'],_0x1bf2f8['name'],_0x5f3f0d[_0x173d('0x4b')]);switch(_0x5f3f0d['type']){case _0x173d('0x64'):emit(util[_0x173d('0x45')](_0x173d('0x65'),_0x1bf2f8[_0x173d('0x50')]),'trigger:salesforce:display',{'recordId':_0x3ecdba['id']});break;case'newTab':emit(util[_0x173d('0x45')]('user:%s',_0x1bf2f8[_0x173d('0x50')]),_0x173d('0x71'),{'uri':util[_0x173d('0x45')](_0x173d('0x72'),_0x450bab['instanceUrl'],_0x3ecdba['id'])});break;default:logger[_0x173d('0x68')](_0x173d('0x73'),_0x173d('0x74'));}})['catch'](function(_0x4d0775){logger[_0x173d('0x68')](_0x173d('0x73'),_0x4d0775);});};exports['unmanaged']=function(_0x2be223,_0x4be058,_0x21cf51,_0xffa69c,_0x4c07d0,_0x5caff4){var _0x360e0a,_0x2c0007,_0x28bbd0,_0x49d193;_0x5caff4[_0x173d('0x5c')]=intUtil[_0x173d('0x5b')](_0x5caff4[_0x173d('0x5c')]);_0x5caff4[_0x173d('0x54')]=intUtil[_0x173d('0x5b')](_0x5caff4[_0x173d('0x54')]);if(_0x4c07d0&&_0x4c07d0[_0x173d('0x5d')]){logger['info']('['+_0x4be058[_0x173d('0x75')][_0x173d('0x76')]()+']',_0x173d('0x6e'));_0x4be058[_0x173d('0x5e')]=util[_0x173d('0x45')](_0x173d('0x5f'),_0x5caff4['serverUrl'],_0x4be058[_0x173d('0x60')],md5(_0x4be058[_0x173d('0x60')]));}else{_0x4be058['recordingURL']='';}return getConnection(_0x5caff4)[_0x173d('0x24')](function(_0x11ce2f){_0x49d193=_0x11ce2f;if(!_[_0x173d('0x20')](_0xffa69c)){return getUser(_0x5caff4,_0xffa69c['name'],_0x49d193);}else{return getUser(_0x5caff4,null,_0x49d193);}})[_0x173d('0x24')](function(_0x383331){_0x360e0a=_0x383331;return getEndUser(_0x5caff4,_0x21cf51,_0x4be058[_0x173d('0x62')],_0x4be058[_0x173d('0x63')],_0x49d193);})[_0x173d('0x24')](function(_0x4bba8b){_0x2c0007=_0x4bba8b;return getTicket(_0x5caff4,_0x360e0a,_0x2c0007,_0x21cf51,_0x4be058,_0x21cf51['Fields'],_0x49d193);})['then'](function(_0x589437){_0x28bbd0=_0x589437;logger[_0x173d('0x1c')]('['+_0x4be058[_0x173d('0x75')]['toUpperCase']()+_0x173d('0x77'),_0x28bbd0['id']);logger['info']('['+_0x4be058[_0x173d('0x75')][_0x173d('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x5caff4[_0x173d('0x4b')]);})['catch'](function(_0x26cf5e){logger['error']('['+_0x4be058[_0x173d('0x75')][_0x173d('0x76')]()+']',_0x26cf5e);});}; \ 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 8c2ef8a..86e7a3e 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 _0xe90f=['active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','toString','variable','variableName','customVariable','name','Variable','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe90f,0x123));var _0xfe90=function(_0x5d2cf3,_0x16bfd2){_0x5d2cf3=_0x5d2cf3-0x0;var _0x45a3fc=_0xe90f[_0x5d2cf3];return _0x45a3fc;};'use strict';var _=require(_0xfe90('0x0'));var Promise=require(_0xfe90('0x1'));var rp=require(_0xfe90('0x2'));var util=require(_0xfe90('0x3'));var md5=require(_0xfe90('0x4'));var Redis=require(_0xfe90('0x5'));var intUtil=require(_0xfe90('0x6'));var config=require('../../../../config/environment');var logger=require(_0xfe90('0x7'))(_0xfe90('0x8'));config['redis']=_[_0xfe90('0x9')](config[_0xfe90('0xa')],{'host':_0xfe90('0xb'),'port':0x18eb});var io=require(_0xfe90('0xc'))(new Redis(config['redis']));function getAdminUser(_0x1e4d49,_0x1f619e,_0x5b87cc,_0x5ea3ba,_0x24c888,_0x3c3989){return new Promise(function(_0x204dad,_0x210317){var _0x32b21a={'method':_0xfe90('0xd'),'uri':_0x5ea3ba+_0xfe90('0xe')+'&'+_0x24c888+'&'+_0x3c3989,'auth':_0x1f619e,'json':!![]};return rp(_0x32b21a)[_0xfe90('0xf')](function(_0x5ca5b6){if(_0x5ca5b6['result'][_0xfe90('0x10')]>0x0){_0x5b87cc[_0xfe90('0x11')]=_0x5ca5b6[_0xfe90('0x12')][0x0][_0xfe90('0x13')];}logger[_0xfe90('0x14')]('['+[_0x1e4d49[_0xfe90('0x15')]()]+_0xfe90('0x16'),_0x5b87cc);_0x204dad(_0x5b87cc);})[_0xfe90('0x17')](function(_0x298ed){logger[_0xfe90('0x18')]('['+[_0x1e4d49[_0xfe90('0x15')]()]+']',_0x298ed['message']);_0x210317(_0x298ed[_0xfe90('0x19')]);});});}function getUser(_0x1197ec,_0x20143c,_0xc34b0,_0x4f360b,_0xe701c6){return function(_0x3df314){logger[_0xfe90('0x14')]('['+[_0x1197ec[_0xfe90('0x15')]()]+_0xfe90('0x1a'),_0x3df314);return new Promise(function(_0x32fec9,_0xb22766){if(intUtil[_0xfe90('0x1b')](_0x3df314[_0xfe90('0x1c')])){var _0x41c9c6={'method':_0xfe90('0xd'),'uri':_0xc34b0+'sys_user?sysparm_query=email%3D'+_0x3df314['userEmail']+'&'+_0x4f360b+'&'+_0xe701c6,'auth':_0x20143c,'json':!![]};logger['info']('['+[_0x1197ec['toUpperCase']()]+_0xfe90('0x1d'),_0x41c9c6);return rp(_0x41c9c6)[_0xfe90('0xf')](function(_0x2ec0df){logger[_0xfe90('0x14')]('['+[_0x1197ec[_0xfe90('0x15')]()]+'],\x20getUser\x20entity',_0x2ec0df);if(_0x2ec0df['result']['length']>0x0&&String(_0x2ec0df['result'][0x0][_0xfe90('0x1e')])==='true'){_0x3df314[_0xfe90('0x1f')]=_0x2ec0df[_0xfe90('0x12')][0x0][_0xfe90('0x13')];}else{_0x3df314['userId']=_0x3df314[_0xfe90('0x11')];_0x3df314[_0xfe90('0x1c')]=_0x3df314[_0xfe90('0x20')];}logger[_0xfe90('0x14')]('['+[_0x1197ec[_0xfe90('0x15')]()]+_0xfe90('0x21'),_0x3df314);_0x32fec9(_0x3df314);})[_0xfe90('0x17')](function(_0xc65fba){logger[_0xfe90('0x18')]('['+[_0x1197ec[_0xfe90('0x15')]()]+']',_0xc65fba[_0xfe90('0x19')]);_0xb22766(_0xc65fba[_0xfe90('0x19')]);});}else{logger[_0xfe90('0x14')]('['+[_0x1197ec[_0xfe90('0x15')]()]+_0xfe90('0x22'));_0x3df314[_0xfe90('0x1f')]=_0x3df314[_0xfe90('0x11')];_0x3df314[_0xfe90('0x1c')]=_0x3df314[_0xfe90('0x20')];_0x32fec9(_0x3df314);}});};}function createEndUser(_0x424039,_0x756d48,_0x3469fa,_0x30710b,_0x437a19){logger[_0xfe90('0x14')]('['+[_0x424039['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x3469fa);return new Promise(function(_0x2b5dc7,_0x68a168){var _0x51ac7d={'method':_0xfe90('0x23'),'uri':_0x30710b+_0xfe90('0x24')+_0x437a19,'body':{'user_name':_0x3469fa[_0xfe90('0x25')],'roles':_0xfe90('0x26'),'first_name':_0x3469fa[_0xfe90('0x25')],'active':'true','date_format':_0xfe90('0x27'),'phone':_0x3469fa[_0xfe90('0x25')]},'auth':_0x756d48,'json':!![]};return rp(_0x51ac7d)[_0xfe90('0xf')](function(_0x497fdc){logger[_0xfe90('0x14')]('['+[_0x424039[_0xfe90('0x15')]()]+_0xfe90('0x28'),_0x497fdc[_0xfe90('0x12')]);_0x3469fa['endUserId']=_0x497fdc[_0xfe90('0x12')][_0xfe90('0x13')];_0x2b5dc7(_0x3469fa);})[_0xfe90('0x17')](function(_0x12b9ab){logger[_0xfe90('0x18')]('['+[_0x424039['toUpperCase']()]+']',_0x12b9ab['message']);_0x68a168(_0x12b9ab[_0xfe90('0x19')]);});});}function getEndUser(_0x7532de,_0x3d1a2c,_0x4fb537,_0x1e482c,_0x3b0a3e){return function(_0x26a2ae){logger[_0xfe90('0x14')]('['+[_0x7532de[_0xfe90('0x15')]()]+_0xfe90('0x29'),_0x26a2ae);return new Promise(function(_0xcee906,_0x374166){var _0x5eb129={'method':_0xfe90('0xd'),'uri':_0x4fb537+_0xfe90('0x2a')+_0x26a2ae[_0xfe90('0x25')]+'&'+_0x1e482c+'&'+_0x3b0a3e,'auth':_0x3d1a2c,'json':!![]};return rp(_0x5eb129)[_0xfe90('0xf')](function(_0x443b9e){if(_0x443b9e['result']['length']>0x0){_0x26a2ae[_0xfe90('0x2b')]=_0x443b9e[_0xfe90('0x12')][0x0]['sys_id'];logger[_0xfe90('0x14')]('['+[_0x7532de[_0xfe90('0x15')]()]+_0xfe90('0x2c'),_0x26a2ae);_0xcee906(_0x26a2ae);}else{return createEndUser(_0x7532de,_0x3d1a2c,_0x26a2ae,_0x4fb537,_0x1e482c)[_0xfe90('0xf')](function(_0x415e41){logger['info']('['+[_0x7532de[_0xfe90('0x15')]()]+_0xfe90('0x2d'),_0x415e41);_0xcee906(_0x415e41);});}})['catch'](function(_0x22a6d2){logger[_0xfe90('0x18')]('['+[_0x7532de[_0xfe90('0x15')]()]+']',_0x22a6d2[_0xfe90('0x19')]);_0x374166(_0x22a6d2[_0xfe90('0x19')]);});});};}function getCustomFields(_0x117909,_0x5f5707){var _0x37ae36={};if(_0x117909[_0xfe90('0x10')]>0x0){_[_0xfe90('0x2e')](_0x117909,function(_0x1894b0){if(_[_0xfe90('0x2f')]([_0xfe90('0x30'),_0xfe90('0x31')],_0x1894b0['type'])&&_0x1894b0[_0xfe90('0x32')]&&!_0x1894b0[_0xfe90('0x33')]){_0x37ae36[_0x1894b0[_0xfe90('0x32')][_0xfe90('0x34')]()]=_0x1894b0[_0xfe90('0x35')]['toString']();}else if(_[_0xfe90('0x2f')]([_0xfe90('0x30'),_0xfe90('0x31')],_0x1894b0[_0xfe90('0x36')])&&_0x1894b0[_0xfe90('0x37')]&&_0x1894b0[_0xfe90('0x33')]){_0x37ae36[_0x1894b0[_0xfe90('0x37')][_0xfe90('0x34')]()]=_0x1894b0[_0xfe90('0x35')][_0xfe90('0x38')]();}else if(_0x1894b0['type']===_0xfe90('0x39')&&_0x1894b0[_0xfe90('0x3a')]&&_0x1894b0[_0xfe90('0x37')]&&_0x1894b0[_0xfe90('0x33')]){_0x37ae36[_0x1894b0[_0xfe90('0x37')][_0xfe90('0x34')]()]=_0x5f5707[_0x1894b0['variableName']][_0xfe90('0x38')]();}else if(_0x1894b0[_0xfe90('0x36')]===_0xfe90('0x3b')&&_0x1894b0['Variable']&&_0x1894b0['Variable'][_0xfe90('0x3c')]&&_0x1894b0['idField']&&_0x1894b0['customField']){_0x37ae36[_0x1894b0[_0xfe90('0x37')][_0xfe90('0x34')]()]=_0x5f5707[_0x1894b0[_0xfe90('0x3d')][_0xfe90('0x3c')][_0xfe90('0x34')]()]['toString']();}});}return _0x37ae36;}function getTicket(_0xd4ee78,_0x199ce0,_0x37d9e8,_0x3a317b,_0x121d14,_0x3bfecf){return function(_0x3d37e6){logger[_0xfe90('0x14')]('['+[_0xd4ee78[_0xfe90('0x15')]()]+']\x20getTicket\x20input\x20crm',_0x3d37e6);return new Promise(function(_0x2f1cc9,_0x5b2b1d){var _0x6a0ed7=_0xd4ee78['toLowerCase']()===_0xfe90('0x3e')?_0x3d37e6[_0xfe90('0x1f')]:_0x3d37e6[_0xfe90('0x2b')];var _0x1cff62={'method':'POST','uri':_0x37d9e8+_0xfe90('0x3f')+'?'+_0x3bfecf,'body':Object['assign']({},{'active':'true','caller_id':_0x6a0ed7,'assigned_to':_0x3d37e6[_0xfe90('0x1f')],'short_description':intUtil[_0xfe90('0x40')](_0x3a317b['Subjects'],_0x121d14,'\x20'),'description':intUtil[_0xfe90('0x40')](_0x3a317b[_0xfe90('0x41')],_0x121d14,'\x0a')},getCustomFields(_0x3a317b[_0xfe90('0x42')],_0x121d14)),'auth':_0x199ce0,'json':!![]};return rp(_0x1cff62)[_0xfe90('0xf')](function(_0x37ffe2){logger[_0xfe90('0x14')]('['+[_0xd4ee78[_0xfe90('0x15')]()]+_0xfe90('0x43'),_0x37ffe2['result']);_0x3d37e6[_0xfe90('0x44')]=_0x37ffe2['result'][_0xfe90('0x13')];_0x3d37e6[_0xfe90('0x45')]=_0x37ffe2[_0xfe90('0x12')]['number'];logger[_0xfe90('0x14')]('['+[_0xd4ee78[_0xfe90('0x15')]()]+_0xfe90('0x46'),_0x3d37e6);_0x2f1cc9(_0x3d37e6);})[_0xfe90('0x17')](function(_0x1e9ca4){logger[_0xfe90('0x18')]('['+[_0xd4ee78['toUpperCase']()]+']',_0x1e9ca4['message']);_0x5b2b1d(_0x1e9ca4['message']);});});};}function createRemoteTag(_0x565d07,_0x2fdb58,_0x51a31c,_0x46c608){return new Promise(function(_0xb27dd9,_0x5d6108){var _0x1e6547={'method':_0xfe90('0x23'),'uri':_0x51a31c+_0xfe90('0x47')+'?'+_0x46c608,'body':{'short_description':_0x565d07,'global':!![],'active':!![],'name':_0x565d07},'auth':_0x2fdb58,'json':!![]};return rp(_0x1e6547)['then'](function(_0x1dcd25){var _0x4d32b6=_0x1dcd25[_0xfe90('0x12')]['sys_id'];_0xb27dd9(_0x4d32b6);});});}function getRemoteTag(_0x1f8ebd,_0x4d2f4a,_0x24aa4d,_0x265a4a,_0x54a653){return new Promise(function(_0x25e5b1,_0x53264b){var _0x580a83={'method':'GET','uri':_0x24aa4d+_0xfe90('0x47')+'?sysparm_query=name%3D'+_0x1f8ebd+'&'+_0x265a4a,'auth':_0x4d2f4a,'json':!![]};return rp(_0x580a83)[_0xfe90('0xf')](function(_0x355c14){if(_0x355c14[_0xfe90('0x12')][_0xfe90('0x10')]>0x0){var _0x1a4a59=_0x355c14['result'][0x0][_0xfe90('0x13')];_0x25e5b1(_0x1a4a59);}else{return createRemoteTag(_0x1f8ebd,_0x4d2f4a,_0x24aa4d,_0x265a4a)['then'](function(_0x51d7fe){_0x25e5b1(_0x51d7fe);});}});});}function assignTagToIncident(_0x35bcce,_0x456ad0,_0x3ef5a4,_0x21bf01,_0x1c021d){return new Promise(function(_0x2bf2c4,_0x4ad154){var _0x1f404a={'method':_0xfe90('0x23'),'uri':_0x3ef5a4+_0xfe90('0x48')+'?'+_0x1c021d,'body':{'label':_0x35bcce,'table':_0xfe90('0x3f'),'id_type':_0xfe90('0x49'),'table_key':_0x21bf01[_0xfe90('0x44')],'title':_0xfe90('0x4a')+_0x21bf01['ticketNumber'],'id_display':_0x21bf01['ticketNumber']},'auth':_0x456ad0,'json':!![]};return rp(_0x1f404a)['then'](function(_0xc448b0){_0x2bf2c4();})[_0xfe90('0x17')](function(){_0x2bf2c4();});});}function manageTags(_0x2ce6fb,_0x3f928a,_0x10e2c3,_0x3dd4f5,_0x36d2d8,_0x56ed4f,_0x1b8c74){return new Promise(function(_0x1495f2,_0x14a1a0){var _0x4dc7ec=[];_0x3f928a['forEach'](function(_0x322502){_0x4dc7ec[_0xfe90('0x4b')](getRemoteTag(_0x322502,_0x10e2c3,_0x3dd4f5,_0x56ed4f,_0x1b8c74));});return Promise[_0xfe90('0x4c')](_0x4dc7ec)['then'](function(_0x4c37a2){if(_0x4c37a2[_0xfe90('0x10')]){logger[_0xfe90('0x14')]('['+[_0x2ce6fb['toUpperCase']()]+_0xfe90('0x4d'),_0x4c37a2);var _0x508775=[];_0x4c37a2[_0xfe90('0x2e')](function(_0x279fce){_0x508775[_0xfe90('0x4b')](assignTagToIncident(_0x279fce,_0x10e2c3,_0x3dd4f5,_0x36d2d8,_0x56ed4f));});return Promise['all'](_0x508775)['then'](function(){_0x1495f2();})[_0xfe90('0x17')](function(){_0x1495f2();});}else{_0x1495f2();}});});}function getTags(_0x4d5d45,_0x5cb26f,_0x249e04,_0x307b91,_0x5ae2eb,_0x111e67){return function(_0x7496c){return new Promise(function(_0x34e2df,_0x4c4537){var _0x50e37a=[];var _0x511b9b=_0x307b91[_0xfe90('0x4e')];if(_0x511b9b&&_0x511b9b[_0xfe90('0x10')]>0x0){_0x50e37a=_['map'](_0x511b9b,_0xfe90('0x3c'));}if(_0x50e37a[_0xfe90('0x10')]>0x0){return manageTags(_0x4d5d45,_0x50e37a,_0x5cb26f,_0x249e04,_0x7496c,_0x5ae2eb,_0x111e67)[_0xfe90('0xf')](function(){_0x34e2df(_0x7496c);});}else{_0x34e2df(_0x7496c);}});};}function emit(_0x49efad,_0x42998a,_0x2374f6){var _0x223975=_0xfe90('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xfe90('0x50');var _0x14e043={'uri':_0x49efad+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2374f6+_0x223975};io['to'](util[_0xfe90('0x51')](_0xfe90('0x52'),_0x42998a))[_0xfe90('0x53')](_0xfe90('0x54'),_0x14e043);}exports['cs']=function(_0x36b860,_0x331436,_0x463599,_0x144a11,_0x462cb6,_0x51fe19,_0x532227,_0x27733b){var _0x6a2ae4={};var _0x28935c={'user':_0x51fe19[_0xfe90('0x55')],'pass':_0x51fe19[_0xfe90('0x56')]};var _0x3d0b98=_0xfe90('0x57');var _0x404765=_0xfe90('0x58');_0x51fe19['remoteUri']=intUtil[_0xfe90('0x59')](_0x51fe19[_0xfe90('0x5a')]);_0x51fe19[_0xfe90('0x5b')]=intUtil['stripTrailingSlash'](_0x51fe19[_0xfe90('0x5b')]);var _0x5001e0=util[_0xfe90('0x51')]('%s/api/now/table/',_0x51fe19[_0xfe90('0x5a')]);_0x6a2ae4[_0xfe90('0x1c')]=!_[_0xfe90('0x5c')](_0x144a11)?_0x144a11[_0xfe90('0x5d')]:null;_0x6a2ae4[_0xfe90('0x20')]=_0x51fe19['email'];_0x6a2ae4[_0xfe90('0x25')]=_0x27733b['toLowerCase']()===_0xfe90('0x3e')?_0x331436['destcalleridnum']:_0x331436[_0xfe90('0x5e')];_0x6a2ae4['callDirection']=_0x27733b===_0xfe90('0x5f')||_0x27733b===_0xfe90('0x60')?_0xfe90('0x5f'):_0xfe90('0x3e');var _0x174c63=util['format'](_0xfe90('0x61'),_0x51fe19[_0xfe90('0x5b')],_0x331436[_0xfe90('0x62')],md5(_0x331436[_0xfe90('0x62')]));if(_0x462cb6&&_0x462cb6['monitor_format']){logger[_0xfe90('0x14')](_0xfe90('0x63'),_0xfe90('0x64'));_0x331436[_0xfe90('0x65')]=_0x174c63;}else if(_0x532227&&_0x532227['recordingFormat']&&_0x532227[_0xfe90('0x66')]!==_0xfe90('0x67')){logger[_0xfe90('0x14')]('[OUTBOUND]',_0xfe90('0x64'));_0x331436[_0xfe90('0x65')]=_0x174c63;}else{_0x331436[_0xfe90('0x65')]='';}return getAdminUser(_0x27733b,_0x28935c,_0x6a2ae4,_0x5001e0,_0x404765,_0x3d0b98)[_0xfe90('0xf')](getUser(_0x27733b,_0x28935c,_0x5001e0,_0x404765,_0x3d0b98))[_0xfe90('0xf')](getEndUser(_0x27733b,_0x28935c,_0x5001e0,_0x404765,_0x3d0b98))[_0xfe90('0xf')](getTicket(_0x27733b,_0x28935c,_0x5001e0,_0x463599,_0x331436,_0x404765))['then'](function(_0x30bed5){logger[_0xfe90('0x14')](util[_0xfe90('0x51')](_0xfe90('0x68'),_0x30bed5[_0xfe90('0x44')]));logger[_0xfe90('0x14')](util[_0xfe90('0x51')](_0xfe90('0x69'),_0x27733b));if(_0x27733b!=='unmanaged'){logger[_0xfe90('0x14')]('['+[_0x27733b[_0xfe90('0x15')]()]+']',_0xfe90('0x6a'));emit(_0x51fe19['remoteUri'],_0x144a11['name'],_0x30bed5[_0xfe90('0x44')]);}})[_0xfe90('0x17')](function(_0x320834){logger['error']('['+[_0x27733b[_0xfe90('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x320834,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd6c6=['recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminId','adminEmail','],\x20getUser\x20crm','error','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','label_entry','incident','Incident','Incident\x20-\x20','forEach','push','all','%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','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xd6c6,0x70));var _0x6d6c=function(_0x12ad20,_0x278bd0){_0x12ad20=_0x12ad20-0x0;var _0xb7cc77=_0xd6c6[_0x12ad20];return _0xb7cc77;};'use strict';var _=require(_0x6d6c('0x0'));var Promise=require(_0x6d6c('0x1'));var rp=require('request-promise');var util=require(_0x6d6c('0x2'));var md5=require(_0x6d6c('0x3'));var Redis=require(_0x6d6c('0x4'));var intUtil=require(_0x6d6c('0x5'));var config=require(_0x6d6c('0x6'));var logger=require(_0x6d6c('0x7'))('servicenow');config[_0x6d6c('0x8')]=_[_0x6d6c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6d6c('0x8')]));function getAdminUser(_0x48253a,_0xd4f589,_0x5d152f,_0xcf6582,_0x9ba96f,_0x50bf6b){return new Promise(function(_0x384750,_0x3c89c2){var _0x24d949={'method':_0x6d6c('0xa'),'uri':_0xcf6582+_0x6d6c('0xb')+'&'+_0x9ba96f+'&'+_0x50bf6b,'auth':_0xd4f589,'json':!![]};return rp(_0x24d949)[_0x6d6c('0xc')](function(_0x1caa78){if(_0x1caa78[_0x6d6c('0xd')][_0x6d6c('0xe')]>0x0){_0x5d152f['adminId']=_0x1caa78[_0x6d6c('0xd')][0x0][_0x6d6c('0xf')];}logger[_0x6d6c('0x10')]('['+[_0x48253a['toUpperCase']()]+_0x6d6c('0x11'),_0x5d152f);_0x384750(_0x5d152f);})[_0x6d6c('0x12')](function(_0x13e6b9){logger['error']('['+[_0x48253a[_0x6d6c('0x13')]()]+']',_0x13e6b9[_0x6d6c('0x14')]);_0x3c89c2(_0x13e6b9['message']);});});}function getUser(_0x142511,_0x3fa6b7,_0x5de249,_0x274193,_0x3a166c){return function(_0x40222c){logger['info']('['+[_0x142511[_0x6d6c('0x13')]()]+_0x6d6c('0x15'),_0x40222c);return new Promise(function(_0x4e15d0,_0x166a6a){if(intUtil[_0x6d6c('0x16')](_0x40222c[_0x6d6c('0x17')])){var _0x1eba0b={'method':_0x6d6c('0xa'),'uri':_0x5de249+_0x6d6c('0x18')+_0x40222c[_0x6d6c('0x17')]+'&'+_0x274193+'&'+_0x3a166c,'auth':_0x3fa6b7,'json':!![]};logger[_0x6d6c('0x10')]('['+[_0x142511[_0x6d6c('0x13')]()]+_0x6d6c('0x19'),_0x1eba0b);return rp(_0x1eba0b)[_0x6d6c('0xc')](function(_0x24936c){logger[_0x6d6c('0x10')]('['+[_0x142511[_0x6d6c('0x13')]()]+_0x6d6c('0x1a'),_0x24936c);if(_0x24936c[_0x6d6c('0xd')][_0x6d6c('0xe')]>0x0&&String(_0x24936c[_0x6d6c('0xd')][0x0]['active'])==='true'){_0x40222c[_0x6d6c('0x1b')]=_0x24936c[_0x6d6c('0xd')][0x0]['sys_id'];}else{_0x40222c[_0x6d6c('0x1b')]=_0x40222c[_0x6d6c('0x1c')];_0x40222c['userEmail']=_0x40222c[_0x6d6c('0x1d')];}logger['info']('['+[_0x142511['toUpperCase']()]+_0x6d6c('0x1e'),_0x40222c);_0x4e15d0(_0x40222c);})[_0x6d6c('0x12')](function(_0x3436b9){logger[_0x6d6c('0x1f')]('['+[_0x142511[_0x6d6c('0x13')]()]+']',_0x3436b9[_0x6d6c('0x14')]);_0x166a6a(_0x3436b9[_0x6d6c('0x14')]);});}else{logger[_0x6d6c('0x10')]('['+[_0x142511[_0x6d6c('0x13')]()]+']\x20using\x20admin\x20profile');_0x40222c['userId']=_0x40222c[_0x6d6c('0x1c')];_0x40222c[_0x6d6c('0x17')]=_0x40222c[_0x6d6c('0x1d')];_0x4e15d0(_0x40222c);}});};}function createEndUser(_0x246998,_0x4216ab,_0x4a2775,_0x59e314,_0x19649c){logger[_0x6d6c('0x10')]('['+[_0x246998['toUpperCase']()]+_0x6d6c('0x20'),_0x4a2775);return new Promise(function(_0x1acb7d,_0x1d2e61){var _0x249ee={'method':'POST','uri':_0x59e314+_0x6d6c('0x21')+_0x19649c,'body':{'user_name':_0x4a2775[_0x6d6c('0x22')],'roles':'user','first_name':_0x4a2775[_0x6d6c('0x22')],'active':_0x6d6c('0x23'),'date_format':'System','phone':_0x4a2775['endUserNumber']},'auth':_0x4216ab,'json':!![]};return rp(_0x249ee)[_0x6d6c('0xc')](function(_0x273e16){logger['info']('['+[_0x246998[_0x6d6c('0x13')]()]+_0x6d6c('0x24'),_0x273e16[_0x6d6c('0xd')]);_0x4a2775[_0x6d6c('0x25')]=_0x273e16[_0x6d6c('0xd')][_0x6d6c('0xf')];_0x1acb7d(_0x4a2775);})[_0x6d6c('0x12')](function(_0x4884cb){logger[_0x6d6c('0x1f')]('['+[_0x246998['toUpperCase']()]+']',_0x4884cb[_0x6d6c('0x14')]);_0x1d2e61(_0x4884cb['message']);});});}function getEndUser(_0x17fdbb,_0x2b37b9,_0x31cd25,_0x48c264,_0x5d4fd1){return function(_0x4caf2a){logger['info']('['+[_0x17fdbb[_0x6d6c('0x13')]()]+_0x6d6c('0x26'),_0x4caf2a);return new Promise(function(_0x555496,_0x59c6fd){var _0x5dbe83={'method':_0x6d6c('0xa'),'uri':_0x31cd25+_0x6d6c('0x27')+_0x4caf2a[_0x6d6c('0x22')]+'&'+_0x48c264+'&'+_0x5d4fd1,'auth':_0x2b37b9,'json':!![]};return rp(_0x5dbe83)[_0x6d6c('0xc')](function(_0x3249da){if(_0x3249da[_0x6d6c('0xd')][_0x6d6c('0xe')]>0x0){_0x4caf2a[_0x6d6c('0x25')]=_0x3249da[_0x6d6c('0xd')][0x0][_0x6d6c('0xf')];logger[_0x6d6c('0x10')]('['+[_0x17fdbb[_0x6d6c('0x13')]()]+_0x6d6c('0x28'),_0x4caf2a);_0x555496(_0x4caf2a);}else{return createEndUser(_0x17fdbb,_0x2b37b9,_0x4caf2a,_0x31cd25,_0x48c264)[_0x6d6c('0xc')](function(_0x443a96){logger[_0x6d6c('0x10')]('['+[_0x17fdbb[_0x6d6c('0x13')]()]+_0x6d6c('0x29'),_0x443a96);_0x555496(_0x443a96);});}})[_0x6d6c('0x12')](function(_0xad503c){logger[_0x6d6c('0x1f')]('['+[_0x17fdbb[_0x6d6c('0x13')]()]+']',_0xad503c['message']);_0x59c6fd(_0xad503c[_0x6d6c('0x14')]);});});};}function getCustomFields(_0x174c80,_0x2e7a01){var _0x5c9ebe={};if(_0x174c80[_0x6d6c('0xe')]>0x0){_['forEach'](_0x174c80,function(_0x3219f5){if(_['includes']([_0x6d6c('0x2a'),_0x6d6c('0x2b')],_0x3219f5[_0x6d6c('0x2c')])&&_0x3219f5[_0x6d6c('0x2d')]&&!_0x3219f5[_0x6d6c('0x2e')]){_0x5c9ebe[_0x3219f5[_0x6d6c('0x2d')][_0x6d6c('0x2f')]()]=_0x3219f5[_0x6d6c('0x30')][_0x6d6c('0x31')]();}else if(_[_0x6d6c('0x32')]([_0x6d6c('0x2a'),_0x6d6c('0x2b')],_0x3219f5[_0x6d6c('0x2c')])&&_0x3219f5[_0x6d6c('0x33')]&&_0x3219f5[_0x6d6c('0x2e')]){_0x5c9ebe[_0x3219f5[_0x6d6c('0x33')][_0x6d6c('0x2f')]()]=_0x3219f5['content'][_0x6d6c('0x31')]();}else if(_0x3219f5['type']===_0x6d6c('0x34')&&_0x3219f5[_0x6d6c('0x35')]&&_0x3219f5[_0x6d6c('0x33')]&&_0x3219f5[_0x6d6c('0x2e')]){_0x5c9ebe[_0x3219f5[_0x6d6c('0x33')][_0x6d6c('0x2f')]()]=_0x2e7a01[_0x3219f5['variableName']][_0x6d6c('0x31')]();}else if(_0x3219f5[_0x6d6c('0x2c')]==='customVariable'&&_0x3219f5['Variable']&&_0x3219f5['Variable'][_0x6d6c('0x36')]&&_0x3219f5[_0x6d6c('0x33')]&&_0x3219f5[_0x6d6c('0x2e')]){_0x5c9ebe[_0x3219f5['idField'][_0x6d6c('0x2f')]()]=_0x2e7a01[_0x3219f5['Variable']['name'][_0x6d6c('0x2f')]()]['toString']();}});}return _0x5c9ebe;}function getTicket(_0x192571,_0x23d8d1,_0x31dce8,_0x338a04,_0x2a98b9,_0x4e26ae){return function(_0x15b3ac){logger[_0x6d6c('0x10')]('['+[_0x192571[_0x6d6c('0x13')]()]+_0x6d6c('0x37'),_0x15b3ac);return new Promise(function(_0x133e70,_0x2eae16){var _0x21281a=_0x192571[_0x6d6c('0x2f')]()===_0x6d6c('0x38')?_0x15b3ac['userId']:_0x15b3ac['endUserId'];var _0x24b491={'method':_0x6d6c('0x39'),'uri':_0x31dce8+'incident'+'?'+_0x4e26ae,'body':Object[_0x6d6c('0x3a')]({},{'active':_0x6d6c('0x23'),'caller_id':_0x21281a,'assigned_to':_0x15b3ac[_0x6d6c('0x1b')],'short_description':intUtil[_0x6d6c('0x3b')](_0x338a04[_0x6d6c('0x3c')],_0x2a98b9,'\x20'),'description':intUtil[_0x6d6c('0x3b')](_0x338a04[_0x6d6c('0x3d')],_0x2a98b9,'\x0a')},getCustomFields(_0x338a04[_0x6d6c('0x3e')],_0x2a98b9)),'auth':_0x23d8d1,'json':!![]};return rp(_0x24b491)[_0x6d6c('0xc')](function(_0x18e02e){logger['info']('['+[_0x192571[_0x6d6c('0x13')]()]+_0x6d6c('0x3f'),_0x18e02e[_0x6d6c('0xd')]);_0x15b3ac[_0x6d6c('0x40')]=_0x18e02e[_0x6d6c('0xd')][_0x6d6c('0xf')];_0x15b3ac[_0x6d6c('0x41')]=_0x18e02e[_0x6d6c('0xd')]['number'];logger['info']('['+[_0x192571['toUpperCase']()]+']\x20getTicket\x20crm',_0x15b3ac);_0x133e70(_0x15b3ac);})[_0x6d6c('0x12')](function(_0x9a9aa2){logger[_0x6d6c('0x1f')]('['+[_0x192571[_0x6d6c('0x13')]()]+']',_0x9a9aa2[_0x6d6c('0x14')]);_0x2eae16(_0x9a9aa2[_0x6d6c('0x14')]);});});};}function createRemoteTag(_0x5edee3,_0x466169,_0xddfcff,_0x584511){return new Promise(function(_0x2bc07b,_0x1e7c4a){var _0x51cb6a={'method':_0x6d6c('0x39'),'uri':_0xddfcff+_0x6d6c('0x42')+'?'+_0x584511,'body':{'short_description':_0x5edee3,'global':!![],'active':!![],'name':_0x5edee3},'auth':_0x466169,'json':!![]};return rp(_0x51cb6a)[_0x6d6c('0xc')](function(_0x34ef00){var _0x42b185=_0x34ef00[_0x6d6c('0xd')][_0x6d6c('0xf')];_0x2bc07b(_0x42b185);});});}function getRemoteTag(_0x2c959f,_0x3fa399,_0x30a050,_0x382c3d,_0xec7092){return new Promise(function(_0x3bc1d6,_0x136dcb){var _0x1aec13={'method':'GET','uri':_0x30a050+_0x6d6c('0x42')+'?sysparm_query=name%3D'+_0x2c959f+'&'+_0x382c3d,'auth':_0x3fa399,'json':!![]};return rp(_0x1aec13)[_0x6d6c('0xc')](function(_0xa05688){if(_0xa05688['result'][_0x6d6c('0xe')]>0x0){var _0xafa718=_0xa05688[_0x6d6c('0xd')][0x0]['sys_id'];_0x3bc1d6(_0xafa718);}else{return createRemoteTag(_0x2c959f,_0x3fa399,_0x30a050,_0x382c3d)[_0x6d6c('0xc')](function(_0x3ecce9){_0x3bc1d6(_0x3ecce9);});}});});}function assignTagToIncident(_0xdcd38d,_0x4f4ec4,_0xcc8269,_0x1000bc,_0x21178c){return new Promise(function(_0x238eb1,_0x254bdf){var _0x507770={'method':_0x6d6c('0x39'),'uri':_0xcc8269+_0x6d6c('0x43')+'?'+_0x21178c,'body':{'label':_0xdcd38d,'table':_0x6d6c('0x44'),'id_type':_0x6d6c('0x45'),'table_key':_0x1000bc[_0x6d6c('0x40')],'title':_0x6d6c('0x46')+_0x1000bc[_0x6d6c('0x41')],'id_display':_0x1000bc[_0x6d6c('0x41')]},'auth':_0x4f4ec4,'json':!![]};return rp(_0x507770)[_0x6d6c('0xc')](function(_0x35a95a){_0x238eb1();})[_0x6d6c('0x12')](function(){_0x238eb1();});});}function manageTags(_0x3b49d7,_0x35bb42,_0x43b98b,_0x4433b1,_0x3d5aa9,_0x1ca3a3,_0x4a79a3){return new Promise(function(_0x19b5b0,_0x864123){var _0x386db0=[];_0x35bb42[_0x6d6c('0x47')](function(_0x5180e7){_0x386db0[_0x6d6c('0x48')](getRemoteTag(_0x5180e7,_0x43b98b,_0x4433b1,_0x1ca3a3,_0x4a79a3));});return Promise[_0x6d6c('0x49')](_0x386db0)[_0x6d6c('0xc')](function(_0x4b37b2){if(_0x4b37b2[_0x6d6c('0xe')]){logger[_0x6d6c('0x10')]('['+[_0x3b49d7['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4b37b2);var _0x2afb17=[];_0x4b37b2[_0x6d6c('0x47')](function(_0x39adbb){_0x2afb17['push'](assignTagToIncident(_0x39adbb,_0x43b98b,_0x4433b1,_0x3d5aa9,_0x1ca3a3));});return Promise['all'](_0x2afb17)['then'](function(){_0x19b5b0();})[_0x6d6c('0x12')](function(){_0x19b5b0();});}else{_0x19b5b0();}});});}function getTags(_0x37adba,_0x57d44e,_0x4ad287,_0x841763,_0x12999f,_0x2ed515){return function(_0x4a1dca){return new Promise(function(_0x5e89e6,_0x1abeec){var _0x1ca7a6=[];var _0xa82bcc=_0x841763['Tags'];if(_0xa82bcc&&_0xa82bcc[_0x6d6c('0xe')]>0x0){_0x1ca7a6=_['map'](_0xa82bcc,_0x6d6c('0x36'));}if(_0x1ca7a6['length']>0x0){return manageTags(_0x37adba,_0x1ca7a6,_0x57d44e,_0x4ad287,_0x4a1dca,_0x12999f,_0x2ed515)[_0x6d6c('0xc')](function(){_0x5e89e6(_0x4a1dca);});}else{_0x5e89e6(_0x4a1dca);}});};}function emit(_0x284fae,_0x2fc127,_0x3fa2df){var _0x5b325d=_0x6d6c('0x4a')+_0x6d6c('0x4b')+_0x6d6c('0x4c')+_0x6d6c('0x4d');var _0x7baeec={'uri':_0x284fae+_0x6d6c('0x4e')+_0x3fa2df+_0x5b325d};io['to'](util[_0x6d6c('0x4f')](_0x6d6c('0x50'),_0x2fc127))['emit'](_0x6d6c('0x51'),_0x7baeec);}exports['cs']=function(_0x473bd0,_0x3a64ed,_0x1807a9,_0xb1f44d,_0xd86c80,_0x1512cf,_0x22511a,_0x5c0bdc){var _0x11dc54={};var _0x4d42d5={'user':_0x1512cf[_0x6d6c('0x52')],'pass':_0x1512cf[_0x6d6c('0x53')]};var _0x103942=_0x6d6c('0x54');var _0x176e84=_0x6d6c('0x55');_0x1512cf[_0x6d6c('0x56')]=intUtil[_0x6d6c('0x57')](_0x1512cf[_0x6d6c('0x56')]);_0x1512cf['serverUrl']=intUtil[_0x6d6c('0x57')](_0x1512cf[_0x6d6c('0x58')]);var _0x387476=util[_0x6d6c('0x4f')](_0x6d6c('0x59'),_0x1512cf[_0x6d6c('0x56')]);_0x11dc54['userEmail']=!_['isNil'](_0xb1f44d)?_0xb1f44d[_0x6d6c('0x5a')]:null;_0x11dc54[_0x6d6c('0x1d')]=_0x1512cf['email'];_0x11dc54[_0x6d6c('0x22')]=_0x5c0bdc[_0x6d6c('0x2f')]()===_0x6d6c('0x38')?_0x3a64ed[_0x6d6c('0x5b')]:_0x3a64ed[_0x6d6c('0x5c')];_0x11dc54['callDirection']=_0x5c0bdc==='queue'||_0x5c0bdc===_0x6d6c('0x5d')?_0x6d6c('0x5e'):_0x6d6c('0x38');var _0x31fb44=util[_0x6d6c('0x4f')](_0x6d6c('0x5f'),_0x1512cf[_0x6d6c('0x58')],_0x3a64ed[_0x6d6c('0x60')],md5(_0x3a64ed['uniqueid']));if(_0xd86c80&&_0xd86c80[_0x6d6c('0x61')]){logger['info'](_0x6d6c('0x62'),_0x6d6c('0x63'));_0x3a64ed[_0x6d6c('0x64')]=_0x31fb44;}else if(_0x22511a&&_0x22511a['recordingFormat']&&_0x22511a[_0x6d6c('0x65')]!==_0x6d6c('0x66')){logger[_0x6d6c('0x10')](_0x6d6c('0x67'),_0x6d6c('0x63'));_0x3a64ed[_0x6d6c('0x64')]=_0x31fb44;}else{_0x3a64ed[_0x6d6c('0x64')]='';}return getAdminUser(_0x5c0bdc,_0x4d42d5,_0x11dc54,_0x387476,_0x176e84,_0x103942)[_0x6d6c('0xc')](getUser(_0x5c0bdc,_0x4d42d5,_0x387476,_0x176e84,_0x103942))[_0x6d6c('0xc')](getEndUser(_0x5c0bdc,_0x4d42d5,_0x387476,_0x176e84,_0x103942))['then'](getTicket(_0x5c0bdc,_0x4d42d5,_0x387476,_0x1807a9,_0x3a64ed,_0x176e84))[_0x6d6c('0xc')](function(_0x449349){logger[_0x6d6c('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x449349[_0x6d6c('0x40')]));logger['info'](util[_0x6d6c('0x4f')](_0x6d6c('0x68'),_0x5c0bdc));if(_0x5c0bdc!=='unmanaged'){logger[_0x6d6c('0x10')]('['+[_0x5c0bdc['toUpperCase']()]+']',_0x6d6c('0x69'));emit(_0x1512cf[_0x6d6c('0x56')],_0xb1f44d[_0x6d6c('0x36')],_0x449349[_0x6d6c('0x40')]);}})[_0x6d6c('0x12')](function(_0x11011f){logger[_0x6d6c('0x1f')]('['+[_0x5c0bdc['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x11011f,{'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 de00bc4..0fe0530 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 _0xd855=['outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','users','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','calleridname','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','toISOString','slice','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','value','info','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Contacts','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','content','custom_fields','customVariable','Variable','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error'];(function(_0x15747f,_0x1810cb){var _0x8783cf=function(_0xddcbbf){while(--_0xddcbbf){_0x15747f['push'](_0x15747f['shift']());}};_0x8783cf(++_0x1810cb);}(_0xd855,0x103));var _0x5d85=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd855[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var rp=require(_0x5d85('0x0'));var BPromise=require(_0x5d85('0x1'));var md5=require(_0x5d85('0x2'));var util=require(_0x5d85('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5d85('0x4'));var config=require(_0x5d85('0x5'));var logger=require(_0x5d85('0x6'))(_0x5d85('0x7'));config['redis']=_[_0x5d85('0x8')](config['redis'],{'host':_0x5d85('0x9'),'port':0x18eb});var io=require(_0x5d85('0xa'))(new Redis(config[_0x5d85('0xb')]));var def={'method':_0x5d85('0xc'),'json':!![]};function emit(_0x497d9c,_0x54d358,_0x3f15d1){io['to'](_0x497d9c)[_0x5d85('0xd')](_0x54d358,_0x3f15d1);}function getTicket(_0x20c578,_0x29f42f,_0x439ca9,_0x24f129,_0x557c84,_0x3c90b9,_0x4c5797,_0x2f896a){logger['info'](_0x5d85('0xe'));var _0x2970b0=new Date();var _0x1e3d51=[{'name':'name','value':intUtil[_0x5d85('0xf')](_0x24f129[_0x5d85('0x10')],_0x557c84,'\x20')},{'name':_0x5d85('0x11'),'value':_0x29f42f['id']},{'name':'created_by','value':_0x29f42f['id']},{'name':'description','value':intUtil[_0x5d85('0xf')](_0x24f129['Descriptions'],_0x557c84,'\x0a')},{'name':'date_start','value':_0x2970b0[_0x5d85('0x12')]()[_0x5d85('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0x5d85('0x14'),'value':'0'},{'name':_0x5d85('0x15'),'value':'15'},{'name':'parent_id','value':_0x439ca9['id']},{'name':_0x5d85('0x16'),'value':'Contacts'},{'name':_0x5d85('0x17'),'value':_0x439ca9['name']},{'name':_0x5d85('0x18'),'value':_0x2f896a}];if(_0x3c90b9[_0x5d85('0x19')]){_[_0x5d85('0x1a')](_0x3c90b9,function(_0x2e2363){if(_0x557c84[_0x2e2363['variableName']]){_0x1e3d51[_0x5d85('0x1b')]({'name':_0x2e2363[_0x5d85('0x1c')],'value':_0x557c84[_0x2e2363[_0x5d85('0x1d')]]});}});}return request({'form':{'method':_0x5d85('0x1e'),'input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'session':_0x4c5797['id'],'module_name':_0x5d85('0x21'),'name_value_list':_0x1e3d51})}});}function getAuth(_0x23cbac){return util['format']('Basic\x20%s',new Buffer(_0x23cbac[_0x5d85('0x22')]+':X')[_0x5d85('0x23')](_0x5d85('0x24')));}function getServerInfo(_0x525168){return request({'form':{'method':_0x5d85('0x25'),'input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON['stringify']({'session':_0x525168['id']})}});}function getUser(_0x2055b5,_0xc2c4,_0x121d35){if(!_[_0x5d85('0x26')](_0xc2c4)){logger['info'](_0x5d85('0x27'),_0xc2c4);return request({'form':{'method':_0x5d85('0x28'),'input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'session':_0x121d35['id'],'module_name':_0x5d85('0x29'),'query':util[_0x5d85('0x2a')](_0x5d85('0x2b'),_0xc2c4),'order_by':'','offset':'0','select_fields':['id',_0x5d85('0x2c'),_0x5d85('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5d85('0x2e')](function(_0x330189){if(_0x330189[_0x5d85('0x2f')][_0x5d85('0x19')]){var _0x14fba3=_['find'](_0x330189['entry_list'],function(_0x551ea8){return _0x551ea8['name_value_list'][_0x5d85('0x2d')][_0x5d85('0x30')]===_0xc2c4;});if(_0x14fba3){logger[_0x5d85('0x31')](_0x5d85('0x32'));return BPromise[_0x5d85('0x33')]({'id':_0x14fba3[_0x5d85('0x34')]['id'][_0x5d85('0x30')],'name':_0x14fba3[_0x5d85('0x34')]['name']['value']});}}logger[_0x5d85('0x31')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x5d85('0x33')]({'id':_0x121d35[_0x5d85('0x34')]['user_id'][_0x5d85('0x30')],'name':_0x121d35['name_value_list']['user_name'][_0x5d85('0x30')]});});}else{logger[_0x5d85('0x31')](_0x5d85('0x35'));return BPromise[_0x5d85('0x33')]({'id':_0x121d35[_0x5d85('0x34')]['user_id'][_0x5d85('0x30')],'name':_0x121d35[_0x5d85('0x34')][_0x5d85('0x2d')]['value']});}}function getEndUser(_0x321ff2,_0x3d3f60,_0x5e145f,_0x587400){logger[_0x5d85('0x31')](_0x5d85('0x36'),_0x5e145f);return request({'form':{'method':_0x5d85('0x28'),'input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'session':_0x587400['id'],'module_name':'Contacts','query':util[_0x5d85('0x2a')](_0x5d85('0x37'),_0x5e145f),'order_by':'','offset':'0','select_fields':['id',_0x5d85('0x2c'),_0x5d85('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5d85('0x2e')](function(_0x7c339b){if(_0x7c339b[_0x5d85('0x2f')][_0x5d85('0x19')]){var _0x2b79ef=_[_0x5d85('0x39')](_0x7c339b[_0x5d85('0x2f')],function(_0x403308){return _0x403308[_0x5d85('0x34')][_0x5d85('0x38')][_0x5d85('0x30')]===_0x5e145f;});if(_0x2b79ef){logger[_0x5d85('0x31')](_0x5d85('0x3a'));return BPromise[_0x5d85('0x33')]({'id':_0x2b79ef[_0x5d85('0x34')]['id'][_0x5d85('0x30')],'name':_0x2b79ef[_0x5d85('0x34')][_0x5d85('0x2c')][_0x5d85('0x30')],'phone':_0x2b79ef[_0x5d85('0x34')][_0x5d85('0x38')][_0x5d85('0x30')]});}}else{logger[_0x5d85('0x31')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x5d85('0x1e'),'input_type':'JSON','response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'session':_0x587400['id'],'module_name':_0x5d85('0x3b'),'name_value_list':[{'name':'first_name','value':_0x3d3f60!==''?_0x3d3f60:util[_0x5d85('0x2a')](_0x5d85('0x3c'),_0x5e145f)},{'name':'phone_home','value':_0x5e145f}]})}})['then'](function(_0x5296f8){logger[_0x5d85('0x31')]('Enduser\x20created.');return BPromise[_0x5d85('0x33')]({'id':_0x5296f8['id'],'name':_0x5296f8[_0x5d85('0x2f')][_0x5d85('0x3d')][_0x5d85('0x30')],'phone':_0x5296f8['entry_list'][_0x5d85('0x38')][_0x5d85('0x30')]});});}});}function request(_0x16f06d){logger[_0x5d85('0x3e')](_0x5d85('0x3f'),JSON['stringify'](_0x16f06d));return rp(_[_0x5d85('0x40')](def,_0x16f06d));}function getTags(_0x45b26c,_0x5b2313){var _0x391ce5=[];if(_0x45b26c&&_0x45b26c[_0x5d85('0x19')]>0x0){_0x391ce5=_[_0x5d85('0x41')](_0x45b26c,_0x5b2313);}return _0x391ce5;}function getCustomFields(_0x27b019,_0x31c42d){var _0x27d0a9=[];var _0x264d49={'custom_fields':[]};if(_0x27b019[_0x5d85('0x19')]>0x0){_[_0x5d85('0x1a')](_0x27b019,function(_0x3d0091){if(_0x3d0091[_0x5d85('0x42')]===_0x5d85('0x43')&&_0x3d0091['nameField']&&!_0x3d0091[_0x5d85('0x44')]){_0x264d49[_0x3d0091[_0x5d85('0x45')][_0x5d85('0x46')]()]=_0x3d0091[_0x5d85('0x47')][_0x5d85('0x23')]();}else if(_0x3d0091[_0x5d85('0x42')]===_0x5d85('0x43')&&_0x3d0091[_0x5d85('0x1c')]&&_0x3d0091[_0x5d85('0x44')]){_0x264d49['custom_fields'][_0x5d85('0x1b')]({'id':_0x3d0091['idField'],'value':_0x3d0091[_0x5d85('0x47')]['toString']()});}else if(_0x3d0091[_0x5d85('0x42')]==='variable'&&_0x3d0091[_0x5d85('0x1d')]&&_0x3d0091[_0x5d85('0x1c')]&&_0x3d0091[_0x5d85('0x44')]){_0x31c42d[_0x3d0091[_0x5d85('0x1d')]]&&_0x264d49[_0x5d85('0x48')]['push']({'id':_0x3d0091['idField'],'value':_0x31c42d[_0x3d0091['variableName']][_0x5d85('0x23')]()});}else if(_0x3d0091[_0x5d85('0x42')]===_0x5d85('0x49')&&_0x3d0091[_0x5d85('0x4a')]&&_0x3d0091['Variable'][_0x5d85('0x2c')]&&_0x3d0091[_0x5d85('0x1c')]&&_0x3d0091[_0x5d85('0x44')]){_0x31c42d[_0x3d0091[_0x5d85('0x4a')]['name'][_0x5d85('0x46')]()]&&_0x264d49[_0x5d85('0x48')][_0x5d85('0x1b')]({'id':_0x3d0091[_0x5d85('0x1c')],'value':_0x31c42d[_0x3d0091[_0x5d85('0x4a')][_0x5d85('0x2c')][_0x5d85('0x46')]()][_0x5d85('0x23')]()});}});}return _0x264d49;}function getConnection(_0x11ced3){return request({'method':_0x5d85('0xc'),'form':{'method':_0x5d85('0x4b'),'input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'user_auth':{'user_name':_0x11ced3['username'],'password':_0x11ced3[_0x5d85('0x4c')],'encryption':_0x5d85('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x5d85('0x2e')](function(_0x15a65a){var _0x1378b7=_0x15a65a;if(_0x1378b7['id']){def[_0x5d85('0x4e')]=_0x1378b7['id'];return BPromise[_0x5d85('0x33')](_0x1378b7);}else{throw new Error(util[_0x5d85('0x2a')](_0x5d85('0x4f'),_0x11ced3['id']));}});}function setRelationship(_0x4c5175,_0x2f5905,_0x1e3734,_0x44be55){return request({'form':{'method':'set_relationship','input_type':_0x5d85('0x1f'),'response_type':_0x5d85('0x1f'),'rest_data':JSON[_0x5d85('0x20')]({'session':_0x4c5175['id'],'module_name':_0x5d85('0x21'),'module_id':_0x1e3734['id'],'link_field_name':_0x44be55,'related_ids':[_0x2f5905['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5d85('0x50')]=function(_0x3de186,_0x1187dc,_0x27eae7,_0x4c78e4,_0x2dd566,_0x2ddd93){var _0x1ce693,_0x8dd9a1,_0x11418c,_0x432a17;_0x2ddd93['remoteUri']=intUtil[_0x5d85('0x51')](_0x2ddd93[_0x5d85('0x52')]);_0x2ddd93[_0x5d85('0x53')]=intUtil[_0x5d85('0x51')](_0x2ddd93['serverUrl']);def[_0x5d85('0x54')]=util['format']('%s/service/v4_1/rest.php',_0x2ddd93[_0x5d85('0x52')]);if(_0x2dd566&&_0x2dd566[_0x5d85('0x55')]){logger[_0x5d85('0x31')](_0x5d85('0x56'),_0x5d85('0x57'));_0x1187dc[_0x5d85('0x58')]=util['format'](_0x5d85('0x59'),_0x2ddd93[_0x5d85('0x53')],_0x1187dc[_0x5d85('0x5a')],md5(_0x1187dc[_0x5d85('0x5a')]));}else{_0x1187dc[_0x5d85('0x58')]='';}return getConnection(_0x2ddd93)[_0x5d85('0x2e')](function(_0x23f162){_0x432a17=_0x23f162;return getUser(_0x2ddd93,_0x4c78e4[_0x5d85('0x2c')],_0x432a17);})[_0x5d85('0x2e')](function(_0x2b0a14){_0x1ce693=_0x2b0a14;logger[_0x5d85('0x31')](_0x5d85('0x5b'),_0x1ce693['id']);return getEndUser(_0x2ddd93,_0x1187dc['calleridname'],_0x1187dc[_0x5d85('0x5c')],_0x432a17);})['then'](function(_0x23b66a){_0x8dd9a1=_0x23b66a;logger['info'](_0x5d85('0x5d'),_0x8dd9a1['id']);return getTicket(_0x2ddd93,_0x1ce693,_0x8dd9a1,_0x27eae7,_0x1187dc,_0x27eae7[_0x5d85('0x5e')],_0x432a17,_0x5d85('0x5f'));})[_0x5d85('0x2e')](function(_0x4647fd){_0x11418c=_0x4647fd;logger['info'](_0x5d85('0x60'));logger[_0x5d85('0x31')](_0x5d85('0x61'),_0x11418c['id']);return setRelationship(_0x432a17,_0x1ce693,_0x11418c,'users');})[_0x5d85('0x2e')](function(){return setRelationship(_0x432a17,_0x8dd9a1,_0x11418c,'contacts');})[_0x5d85('0x2e')](function(){return getServerInfo(_0x432a17);})[_0x5d85('0x2e')](function(_0x5d6087){var _0x4b8ece=parseInt(_0x5d6087[_0x5d85('0x62')][_0x5d85('0x63')](0x0));var _0x202b82=util[_0x5d85('0x2a')](_0x5d85('0x64'),_0x2ddd93[_0x5d85('0x52')],_0x11418c['id']);if(_0x4b8ece>0x6){_0x202b82=util['format'](_0x5d85('0x65'),_0x2ddd93['remoteUri'],_0x11418c['id']);}logger[_0x5d85('0x31')](_0x5d85('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5d85('0x2a')]('user:%s',_0x4c78e4[_0x5d85('0x2c')]),_0x5d85('0x66'),{'uri':_0x202b82});})['catch'](function(_0x4c5822){logger[_0x5d85('0x67')](_0x5d85('0x56'),JSON[_0x5d85('0x20')](_0x4c5822));});};exports[_0x5d85('0x68')]=function(_0x3c9ee3,_0x12e5cc,_0x3593b0,_0x2d7805,_0x161014,_0x55aba5,_0x13ba5b){var _0x27c5da,_0x38df42,_0x4206f2,_0x430da7;_0x55aba5[_0x5d85('0x52')]=intUtil['stripTrailingSlash'](_0x55aba5[_0x5d85('0x52')]);_0x55aba5[_0x5d85('0x53')]=intUtil[_0x5d85('0x51')](_0x55aba5[_0x5d85('0x53')]);def[_0x5d85('0x54')]=util[_0x5d85('0x2a')]('%s/service/v4_1/rest.php',_0x55aba5[_0x5d85('0x52')]);if(_0x13ba5b&&_0x13ba5b[_0x5d85('0x69')]&&_0x13ba5b[_0x5d85('0x69')]!==_0x5d85('0x6a')){logger['info'](_0x5d85('0x6b'),_0x5d85('0x57'));_0x12e5cc[_0x5d85('0x58')]=util[_0x5d85('0x2a')](_0x5d85('0x59'),_0x55aba5[_0x5d85('0x53')],_0x12e5cc[_0x5d85('0x5a')],md5(_0x12e5cc['uniqueid']));}return getConnection(_0x55aba5)['then'](function(_0x578dcc){_0x430da7=_0x578dcc;return getUser(_0x55aba5,_0x2d7805['name'],_0x430da7);})[_0x5d85('0x2e')](function(_0x2d6f91){_0x27c5da=_0x2d6f91;logger['info'](_0x5d85('0x5b'),_0x27c5da['id']);return getEndUser(_0x55aba5,_0x12e5cc[_0x5d85('0x6c')],_0x12e5cc[_0x5d85('0x6d')],_0x430da7);})[_0x5d85('0x2e')](function(_0x50dd69){_0x38df42=_0x50dd69;logger[_0x5d85('0x31')](_0x5d85('0x5d'),_0x38df42['id']);return getTicket(_0x55aba5,_0x27c5da,_0x38df42,_0x3593b0,_0x12e5cc,_0x3593b0[_0x5d85('0x5e')],_0x430da7,_0x5d85('0x6e'));})['then'](function(_0x40d625){_0x4206f2=_0x40d625;logger[_0x5d85('0x31')]('Ticket\x20created!');logger[_0x5d85('0x31')](_0x5d85('0x61'),_0x4206f2['id']);return setRelationship(_0x430da7,_0x27c5da,_0x4206f2,_0x5d85('0x6f'));})[_0x5d85('0x2e')](function(){return setRelationship(_0x430da7,_0x38df42,_0x4206f2,_0x5d85('0x70'));})[_0x5d85('0x2e')](function(){return getServerInfo(_0x430da7);})[_0x5d85('0x2e')](function(_0x1af59c){var _0x5ee573=parseInt(_0x1af59c[_0x5d85('0x62')][_0x5d85('0x63')](0x0));var _0x28ad4e=util[_0x5d85('0x2a')](_0x5d85('0x64'),_0x55aba5['remoteUri'],_0x4206f2['id']);if(_0x5ee573>0x6){_0x28ad4e=util[_0x5d85('0x2a')](_0x5d85('0x65'),_0x55aba5[_0x5d85('0x52')],_0x4206f2['id']);}logger[_0x5d85('0x31')]('[OUTBOUND]',_0x5d85('0x71'));emit(util[_0x5d85('0x2a')](_0x5d85('0x72'),_0x2d7805[_0x5d85('0x2c')]),_0x5d85('0x66'),{'uri':_0x28ad4e});})[_0x5d85('0x73')](function(_0x11205d){logger[_0x5d85('0x67')](_0x5d85('0x6b'),JSON[_0x5d85('0x20')](_0x11205d));});};exports[_0x5d85('0x74')]=function(_0x58f0b6,_0x20b075,_0x4fd5ed,_0x3a09e8,_0x583dfd,_0x2dd331){var _0x2b3cb3,_0x4ee10d,_0x3f9299,_0x3c45f0;_0x2dd331[_0x5d85('0x52')]=intUtil[_0x5d85('0x51')](_0x2dd331[_0x5d85('0x52')]);_0x2dd331[_0x5d85('0x53')]=intUtil[_0x5d85('0x51')](_0x2dd331['serverUrl']);def['uri']=util[_0x5d85('0x2a')](_0x5d85('0x75'),_0x2dd331[_0x5d85('0x52')]);if(_0x583dfd&&_0x583dfd[_0x5d85('0x55')]){logger[_0x5d85('0x31')]('['+_0x20b075[_0x5d85('0x76')][_0x5d85('0x77')]()+']',_0x5d85('0x57'));_0x20b075['recordingURL']=util[_0x5d85('0x2a')](_0x5d85('0x59'),_0x2dd331[_0x5d85('0x53')],_0x20b075[_0x5d85('0x5a')],md5(_0x20b075[_0x5d85('0x5a')]));}else{_0x20b075[_0x5d85('0x58')]='';}return getConnection(_0x2dd331)[_0x5d85('0x2e')](function(_0x3cf5a5){_0x3c45f0=_0x3cf5a5;if(!_['isNil'](_0x3a09e8)){return getUser(_0x2dd331,_0x3a09e8[_0x5d85('0x2c')],_0x3c45f0);}else{return getUser(_0x2dd331,null,_0x3c45f0);}})['then'](function(_0x233426){_0x2b3cb3=_0x233426;logger[_0x5d85('0x31')](_0x5d85('0x5b'),_0x2b3cb3['id']);return getEndUser(_0x2dd331,_0x20b075[_0x5d85('0x78')],_0x20b075[_0x5d85('0x5c')],_0x3c45f0);})[_0x5d85('0x2e')](function(_0x11dee3){_0x4ee10d=_0x11dee3;logger[_0x5d85('0x31')](_0x5d85('0x5d'),_0x4ee10d['id']);return getTicket(_0x2dd331,_0x2b3cb3,_0x4ee10d,_0x4fd5ed,_0x20b075,_0x4fd5ed[_0x5d85('0x5e')],_0x3c45f0,_0x5d85('0x5f'));})[_0x5d85('0x2e')](function(_0x32f30f){_0x3f9299=_0x32f30f;logger[_0x5d85('0x31')]('Ticket\x20created!');logger[_0x5d85('0x31')](_0x5d85('0x61'),_0x3f9299['id']);return setRelationship(_0x3c45f0,_0x2b3cb3,_0x3f9299,'users');})[_0x5d85('0x2e')](function(){return setRelationship(_0x3c45f0,_0x4ee10d,_0x3f9299,_0x5d85('0x70'));})[_0x5d85('0x2e')](function(){return getServerInfo(_0x3c45f0);})['catch'](function(_0x2e12e1){logger['error']('['+_0x20b075['lastevent'][_0x5d85('0x77')]()+']',JSON[_0x5d85('0x20')](_0x2e12e1));});}; \ No newline at end of file +var _0x9531=['Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','version','charAt','error','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','name','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','map','forEach','string','nameField','toLowerCase','content','customField','custom_fields','type','customVariable','Variable','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9531,0x100));var _0x1953=function(_0x414fc0,_0x552874){_0x414fc0=_0x414fc0-0x0;var _0x3d47ad=_0x9531[_0x414fc0];return _0x3d47ad;};'use strict';var _=require(_0x1953('0x0'));var rp=require(_0x1953('0x1'));var BPromise=require('bluebird');var md5=require(_0x1953('0x2'));var util=require(_0x1953('0x3'));var Redis=require(_0x1953('0x4'));var intUtil=require(_0x1953('0x5'));var config=require(_0x1953('0x6'));var logger=require('../../../../config/logger')(_0x1953('0x7'));config[_0x1953('0x8')]=_[_0x1953('0x9')](config[_0x1953('0x8')],{'host':_0x1953('0xa'),'port':0x18eb});var io=require(_0x1953('0xb'))(new Redis(config[_0x1953('0x8')]));var def={'method':_0x1953('0xc'),'json':!![]};function emit(_0x7e4e82,_0x343411,_0x5d92d6){io['to'](_0x7e4e82)[_0x1953('0xd')](_0x343411,_0x5d92d6);}function getTicket(_0x18961f,_0x1dfeb5,_0x3e4a78,_0x4bea7c,_0x1d0b1d,_0x18e275,_0x3400c3,_0x5057cb){logger['info']('Creating\x20new\x20ticket...');var _0x327c16=new Date();var _0x1540e2=[{'name':_0x1953('0xe'),'value':intUtil[_0x1953('0xf')](_0x4bea7c['Subjects'],_0x1d0b1d,'\x20')},{'name':_0x1953('0x10'),'value':_0x1dfeb5['id']},{'name':'created_by','value':_0x1dfeb5['id']},{'name':_0x1953('0x11'),'value':intUtil[_0x1953('0xf')](_0x4bea7c[_0x1953('0x12')],_0x1d0b1d,'\x0a')},{'name':_0x1953('0x13'),'value':_0x327c16[_0x1953('0x14')]()[_0x1953('0x15')](0x0,0x13)[_0x1953('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x1953('0x17'),'value':'15'},{'name':_0x1953('0x18'),'value':_0x3e4a78['id']},{'name':_0x1953('0x19'),'value':'Contacts'},{'name':'parent_name','value':_0x3e4a78[_0x1953('0xe')]},{'name':'direction','value':_0x5057cb}];if(_0x18e275[_0x1953('0x1a')]){_['forEach'](_0x18e275,function(_0x23b57f){if(_0x1d0b1d[_0x23b57f[_0x1953('0x1b')]]){_0x1540e2[_0x1953('0x1c')]({'name':_0x23b57f[_0x1953('0x1d')],'value':_0x1d0b1d[_0x23b57f['variableName']]});}});}return request({'form':{'method':_0x1953('0x1e'),'input_type':'JSON','response_type':_0x1953('0x1f'),'rest_data':JSON[_0x1953('0x20')]({'session':_0x3400c3['id'],'module_name':_0x1953('0x21'),'name_value_list':_0x1540e2})}});}function getAuth(_0x2b1998){return util[_0x1953('0x22')](_0x1953('0x23'),new Buffer(_0x2b1998[_0x1953('0x24')]+':X')[_0x1953('0x25')](_0x1953('0x26')));}function getServerInfo(_0xf33734){return request({'form':{'method':_0x1953('0x27'),'input_type':_0x1953('0x1f'),'response_type':'JSON','rest_data':JSON[_0x1953('0x20')]({'session':_0xf33734['id']})}});}function getUser(_0x2638d1,_0x10c36e,_0x1115a5){if(!_[_0x1953('0x28')](_0x10c36e)){logger[_0x1953('0x29')](_0x1953('0x2a'),_0x10c36e);return request({'form':{'method':'get_entry_list','input_type':_0x1953('0x1f'),'response_type':_0x1953('0x1f'),'rest_data':JSON['stringify']({'session':_0x1115a5['id'],'module_name':_0x1953('0x2b'),'query':util[_0x1953('0x22')](_0x1953('0x2c'),_0x10c36e),'order_by':'','offset':'0','select_fields':['id',_0x1953('0xe'),_0x1953('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1953('0x2e')](function(_0x367be6){if(_0x367be6[_0x1953('0x2f')][_0x1953('0x1a')]){var _0x40093b=_[_0x1953('0x30')](_0x367be6[_0x1953('0x2f')],function(_0x1de473){return _0x1de473[_0x1953('0x31')][_0x1953('0x2d')][_0x1953('0x32')]===_0x10c36e;});if(_0x40093b){logger[_0x1953('0x29')](_0x1953('0x33'));return BPromise['resolve']({'id':_0x40093b['name_value_list']['id'][_0x1953('0x32')],'name':_0x40093b[_0x1953('0x31')]['name']['value']});}}logger[_0x1953('0x29')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1953('0x34')]({'id':_0x1115a5[_0x1953('0x31')][_0x1953('0x35')][_0x1953('0x32')],'name':_0x1115a5['name_value_list']['user_name']['value']});});}else{logger['info'](_0x1953('0x36'));return BPromise['resolve']({'id':_0x1115a5[_0x1953('0x31')][_0x1953('0x35')]['value'],'name':_0x1115a5[_0x1953('0x31')][_0x1953('0x2d')][_0x1953('0x32')]});}}function getEndUser(_0x2b0278,_0x3b4183,_0x497959,_0x4573c1){logger[_0x1953('0x29')]('Searching\x20enduser\x20with\x20phone',_0x497959);return request({'form':{'method':_0x1953('0x37'),'input_type':_0x1953('0x1f'),'response_type':_0x1953('0x1f'),'rest_data':JSON[_0x1953('0x20')]({'session':_0x4573c1['id'],'module_name':_0x1953('0x38'),'query':util[_0x1953('0x22')](_0x1953('0x39'),_0x497959),'order_by':'','offset':'0','select_fields':['id',_0x1953('0xe'),_0x1953('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1953('0x2e')](function(_0xcbf62b){if(_0xcbf62b[_0x1953('0x2f')][_0x1953('0x1a')]){var _0x55a3ad=_[_0x1953('0x30')](_0xcbf62b['entry_list'],function(_0x3230f){return _0x3230f[_0x1953('0x31')][_0x1953('0x3a')]['value']===_0x497959;});if(_0x55a3ad){logger['info'](_0x1953('0x3b'));return BPromise['resolve']({'id':_0x55a3ad[_0x1953('0x31')]['id'][_0x1953('0x32')],'name':_0x55a3ad[_0x1953('0x31')][_0x1953('0xe')][_0x1953('0x32')],'phone':_0x55a3ad[_0x1953('0x31')][_0x1953('0x3a')][_0x1953('0x32')]});}}else{logger[_0x1953('0x29')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x1953('0x1e'),'input_type':_0x1953('0x1f'),'response_type':_0x1953('0x1f'),'rest_data':JSON[_0x1953('0x20')]({'session':_0x4573c1['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x3b4183!==_0x1953('0x3c')?_0x3b4183:util['format'](_0x1953('0x3d'),_0x497959)},{'name':_0x1953('0x3a'),'value':_0x497959}]})}})[_0x1953('0x2e')](function(_0x5ba6fb){logger['info'](_0x1953('0x3e'));return BPromise[_0x1953('0x34')]({'id':_0x5ba6fb['id'],'name':_0x5ba6fb['entry_list'][_0x1953('0x3f')]['value'],'phone':_0x5ba6fb[_0x1953('0x2f')][_0x1953('0x3a')]['value']});});}});}function request(_0x4880c6){logger['debug']('[HTTP]',JSON[_0x1953('0x20')](_0x4880c6));return rp(_['merge'](def,_0x4880c6));}function getTags(_0x5381b4,_0x334d9f){var _0x133a87=[];if(_0x5381b4&&_0x5381b4['length']>0x0){_0x133a87=_[_0x1953('0x40')](_0x5381b4,_0x334d9f);}return _0x133a87;}function getCustomFields(_0x370089,_0x5a29e5){var _0x194487=[];var _0x23dc13={'custom_fields':[]};if(_0x370089[_0x1953('0x1a')]>0x0){_[_0x1953('0x41')](_0x370089,function(_0xb94b9){if(_0xb94b9['type']===_0x1953('0x42')&&_0xb94b9[_0x1953('0x43')]&&!_0xb94b9['customField']){_0x23dc13[_0xb94b9[_0x1953('0x43')][_0x1953('0x44')]()]=_0xb94b9[_0x1953('0x45')][_0x1953('0x25')]();}else if(_0xb94b9['type']===_0x1953('0x42')&&_0xb94b9['idField']&&_0xb94b9[_0x1953('0x46')]){_0x23dc13[_0x1953('0x47')][_0x1953('0x1c')]({'id':_0xb94b9['idField'],'value':_0xb94b9['content'][_0x1953('0x25')]()});}else if(_0xb94b9[_0x1953('0x48')]==='variable'&&_0xb94b9[_0x1953('0x1b')]&&_0xb94b9[_0x1953('0x1d')]&&_0xb94b9['customField']){_0x5a29e5[_0xb94b9[_0x1953('0x1b')]]&&_0x23dc13['custom_fields'][_0x1953('0x1c')]({'id':_0xb94b9[_0x1953('0x1d')],'value':_0x5a29e5[_0xb94b9[_0x1953('0x1b')]][_0x1953('0x25')]()});}else if(_0xb94b9['type']===_0x1953('0x49')&&_0xb94b9[_0x1953('0x4a')]&&_0xb94b9[_0x1953('0x4a')][_0x1953('0xe')]&&_0xb94b9[_0x1953('0x1d')]&&_0xb94b9[_0x1953('0x46')]){_0x5a29e5[_0xb94b9['Variable'][_0x1953('0xe')][_0x1953('0x44')]()]&&_0x23dc13[_0x1953('0x47')][_0x1953('0x1c')]({'id':_0xb94b9['idField'],'value':_0x5a29e5[_0xb94b9['Variable']['name']['toLowerCase']()][_0x1953('0x25')]()});}});}return _0x23dc13;}function getConnection(_0x22d531){return request({'method':_0x1953('0xc'),'form':{'method':_0x1953('0x4b'),'input_type':_0x1953('0x1f'),'response_type':_0x1953('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x22d531[_0x1953('0x4c')],'password':_0x22d531[_0x1953('0x4d')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x2625e1){var _0x1f9374=_0x2625e1;if(_0x1f9374['id']){def[_0x1953('0x4e')]=_0x1f9374['id'];return BPromise[_0x1953('0x34')](_0x1f9374);}else{throw new Error(util[_0x1953('0x22')](_0x1953('0x4f'),_0x22d531['id']));}});}function setRelationship(_0x4f1059,_0x2e27a6,_0x45b157,_0x2094bf){return request({'form':{'method':_0x1953('0x50'),'input_type':_0x1953('0x1f'),'response_type':_0x1953('0x1f'),'rest_data':JSON[_0x1953('0x20')]({'session':_0x4f1059['id'],'module_name':_0x1953('0x21'),'module_id':_0x45b157['id'],'link_field_name':_0x2094bf,'related_ids':[_0x2e27a6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1953('0x51')]=function(_0x6d6dd0,_0x3efdea,_0x18690f,_0x489dc6,_0x4a0d74,_0x5626e2){var _0x4992ab,_0x2e5dec,_0x4ee7ff,_0x2c6d5e;_0x5626e2[_0x1953('0x52')]=intUtil[_0x1953('0x53')](_0x5626e2[_0x1953('0x52')]);_0x5626e2[_0x1953('0x54')]=intUtil[_0x1953('0x53')](_0x5626e2[_0x1953('0x54')]);def[_0x1953('0x55')]=util[_0x1953('0x22')]('%s/service/v4_1/rest.php',_0x5626e2[_0x1953('0x52')]);if(_0x4a0d74&&_0x4a0d74[_0x1953('0x56')]){logger[_0x1953('0x29')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3efdea[_0x1953('0x57')]=util[_0x1953('0x22')](_0x1953('0x58'),_0x5626e2[_0x1953('0x54')],_0x3efdea[_0x1953('0x59')],md5(_0x3efdea[_0x1953('0x59')]));}else{_0x3efdea[_0x1953('0x57')]='';}return getConnection(_0x5626e2)['then'](function(_0x196f75){_0x2c6d5e=_0x196f75;return getUser(_0x5626e2,_0x489dc6[_0x1953('0xe')],_0x2c6d5e);})[_0x1953('0x2e')](function(_0xde31f4){_0x4992ab=_0xde31f4;logger['info']('The\x20User\x20ID\x20is:',_0x4992ab['id']);return getEndUser(_0x5626e2,_0x3efdea[_0x1953('0x5a')],_0x3efdea['calleridnum'],_0x2c6d5e);})['then'](function(_0x555914){_0x2e5dec=_0x555914;logger[_0x1953('0x29')](_0x1953('0x5b'),_0x2e5dec['id']);return getTicket(_0x5626e2,_0x4992ab,_0x2e5dec,_0x18690f,_0x3efdea,_0x18690f[_0x1953('0x5c')],_0x2c6d5e,_0x1953('0x5d'));})[_0x1953('0x2e')](function(_0x2fde9d){_0x4ee7ff=_0x2fde9d;logger[_0x1953('0x29')](_0x1953('0x5e'));logger[_0x1953('0x29')](_0x1953('0x5f'),_0x4ee7ff['id']);return setRelationship(_0x2c6d5e,_0x4992ab,_0x4ee7ff,_0x1953('0x60'));})[_0x1953('0x2e')](function(){return setRelationship(_0x2c6d5e,_0x2e5dec,_0x4ee7ff,_0x1953('0x61'));})['then'](function(){return getServerInfo(_0x2c6d5e);})[_0x1953('0x2e')](function(_0x19b8d5){var _0x4223c4=parseInt(_0x19b8d5['version']['charAt'](0x0));var _0x47eba6=util[_0x1953('0x22')](_0x1953('0x62'),_0x5626e2[_0x1953('0x52')],_0x4ee7ff['id']);if(_0x4223c4>0x6){_0x47eba6=util[_0x1953('0x22')](_0x1953('0x63'),_0x5626e2['remoteUri'],_0x4ee7ff['id']);}logger['info'](_0x1953('0x64'),_0x1953('0x65'));emit(util[_0x1953('0x22')](_0x1953('0x66'),_0x489dc6[_0x1953('0xe')]),_0x1953('0x67'),{'uri':_0x47eba6});})[_0x1953('0x68')](function(_0x13ce6f){logger['error'](_0x1953('0x64'),JSON[_0x1953('0x20')](_0x13ce6f));});};exports[_0x1953('0x69')]=function(_0x5f2ff1,_0x558cca,_0x279803,_0x258999,_0x8dfd6b,_0x4695c5,_0x27de1f){var _0x46cd1a,_0x516640,_0x149760,_0x1f4cc9;_0x4695c5[_0x1953('0x52')]=intUtil[_0x1953('0x53')](_0x4695c5[_0x1953('0x52')]);_0x4695c5[_0x1953('0x54')]=intUtil[_0x1953('0x53')](_0x4695c5['serverUrl']);def['uri']=util[_0x1953('0x22')](_0x1953('0x6a'),_0x4695c5[_0x1953('0x52')]);if(_0x27de1f&&_0x27de1f[_0x1953('0x6b')]&&_0x27de1f[_0x1953('0x6b')]!==_0x1953('0x6c')){logger[_0x1953('0x29')](_0x1953('0x6d'),_0x1953('0x6e'));_0x558cca[_0x1953('0x57')]=util[_0x1953('0x22')](_0x1953('0x58'),_0x4695c5[_0x1953('0x54')],_0x558cca[_0x1953('0x59')],md5(_0x558cca[_0x1953('0x59')]));}return getConnection(_0x4695c5)[_0x1953('0x2e')](function(_0x4e6c5c){_0x1f4cc9=_0x4e6c5c;return getUser(_0x4695c5,_0x258999['name'],_0x1f4cc9);})[_0x1953('0x2e')](function(_0x54369b){_0x46cd1a=_0x54369b;logger['info']('The\x20User\x20ID\x20is:',_0x46cd1a['id']);return getEndUser(_0x4695c5,_0x558cca[_0x1953('0x6f')],_0x558cca[_0x1953('0x70')],_0x1f4cc9);})[_0x1953('0x2e')](function(_0x3969c5){_0x516640=_0x3969c5;logger[_0x1953('0x29')](_0x1953('0x5b'),_0x516640['id']);return getTicket(_0x4695c5,_0x46cd1a,_0x516640,_0x279803,_0x558cca,_0x279803[_0x1953('0x5c')],_0x1f4cc9,_0x1953('0x71'));})[_0x1953('0x2e')](function(_0x4c4a40){_0x149760=_0x4c4a40;logger[_0x1953('0x29')]('Ticket\x20created!');logger['info'](_0x1953('0x5f'),_0x149760['id']);return setRelationship(_0x1f4cc9,_0x46cd1a,_0x149760,_0x1953('0x60'));})[_0x1953('0x2e')](function(){return setRelationship(_0x1f4cc9,_0x516640,_0x149760,_0x1953('0x61'));})[_0x1953('0x2e')](function(){return getServerInfo(_0x1f4cc9);})[_0x1953('0x2e')](function(_0x5c94d7){var _0x51aca4=parseInt(_0x5c94d7[_0x1953('0x72')][_0x1953('0x73')](0x0));var _0x5e47ab=util[_0x1953('0x22')](_0x1953('0x62'),_0x4695c5[_0x1953('0x52')],_0x149760['id']);if(_0x51aca4>0x6){_0x5e47ab=util[_0x1953('0x22')](_0x1953('0x63'),_0x4695c5[_0x1953('0x52')],_0x149760['id']);}logger['info'](_0x1953('0x6d'),_0x1953('0x65'));emit(util[_0x1953('0x22')](_0x1953('0x66'),_0x258999[_0x1953('0xe')]),'trigger:browser:url',{'uri':_0x5e47ab});})['catch'](function(_0x1b3d63){logger[_0x1953('0x74')](_0x1953('0x6d'),JSON['stringify'](_0x1b3d63));});};exports[_0x1953('0x75')]=function(_0x2721a3,_0x339572,_0x199300,_0x1a2edd,_0x17b61c,_0x4d451d){var _0x20451c,_0x1466b4,_0x36de92,_0x541f53;_0x4d451d[_0x1953('0x52')]=intUtil['stripTrailingSlash'](_0x4d451d[_0x1953('0x52')]);_0x4d451d[_0x1953('0x54')]=intUtil[_0x1953('0x53')](_0x4d451d[_0x1953('0x54')]);def[_0x1953('0x55')]=util[_0x1953('0x22')]('%s/service/v4_1/rest.php',_0x4d451d[_0x1953('0x52')]);if(_0x17b61c&&_0x17b61c[_0x1953('0x56')]){logger[_0x1953('0x29')]('['+_0x339572[_0x1953('0x76')][_0x1953('0x77')]()+']','Recording\x20is\x20enabled!');_0x339572[_0x1953('0x57')]=util[_0x1953('0x22')](_0x1953('0x58'),_0x4d451d[_0x1953('0x54')],_0x339572[_0x1953('0x59')],md5(_0x339572[_0x1953('0x59')]));}else{_0x339572['recordingURL']='';}return getConnection(_0x4d451d)[_0x1953('0x2e')](function(_0x42c46e){_0x541f53=_0x42c46e;if(!_[_0x1953('0x28')](_0x1a2edd)){return getUser(_0x4d451d,_0x1a2edd['name'],_0x541f53);}else{return getUser(_0x4d451d,null,_0x541f53);}})[_0x1953('0x2e')](function(_0x1b4a2e){_0x20451c=_0x1b4a2e;logger['info'](_0x1953('0x78'),_0x20451c['id']);return getEndUser(_0x4d451d,_0x339572['calleridname'],_0x339572[_0x1953('0x79')],_0x541f53);})[_0x1953('0x2e')](function(_0x659b87){_0x1466b4=_0x659b87;logger[_0x1953('0x29')]('The\x20Enduser\x20ID\x20is:',_0x1466b4['id']);return getTicket(_0x4d451d,_0x20451c,_0x1466b4,_0x199300,_0x339572,_0x199300[_0x1953('0x5c')],_0x541f53,_0x1953('0x5d'));})[_0x1953('0x2e')](function(_0x45f131){_0x36de92=_0x45f131;logger['info'](_0x1953('0x5e'));logger[_0x1953('0x29')](_0x1953('0x5f'),_0x36de92['id']);return setRelationship(_0x541f53,_0x20451c,_0x36de92,_0x1953('0x60'));})[_0x1953('0x2e')](function(){return setRelationship(_0x541f53,_0x1466b4,_0x36de92,_0x1953('0x61'));})[_0x1953('0x2e')](function(){return getServerInfo(_0x541f53);})[_0x1953('0x68')](function(_0x4031df){logger[_0x1953('0x74')]('['+_0x339572[_0x1953('0x76')][_0x1953('0x77')]()+']',JSON[_0x1953('0x20')](_0x4031df));});}; \ 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 51e23ca..db8772b 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 _0x82be=['substring','validateEmail','isNil','test','lodash','util','length','type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice'];(function(_0x1178bc,_0x30947b){var _0x55bbbf=function(_0x3fe73f){while(--_0x3fe73f){_0x1178bc['push'](_0x1178bc['shift']());}};_0x55bbbf(++_0x30947b);}(_0x82be,0x124));var _0xe82b=function(_0x5c3503,_0x43c252){_0x5c3503=_0x5c3503-0x0;var _0x33f571=_0x82be[_0x5c3503];return _0x33f571;};'use strict';var _=require(_0xe82b('0x0'));var util=require(_0xe82b('0x1'));exports['getString']=function(_0xc7df4c,_0x4dd7cd,_0x165979){var _0x23a977=[];if(_0xc7df4c['length']>0x0){var _0x3d8b9f=_['sortBy'](_0xc7df4c,['id']);for(var _0x51365b=0x0;_0x51365b<_0x3d8b9f[_0xe82b('0x2')];_0x51365b++){var _0x1faeb1=_0x3d8b9f[_0x51365b];if(_0x1faeb1[_0xe82b('0x3')]===_0xe82b('0x4')){_0x23a977['push'](_0x1faeb1[_0xe82b('0x5')]);}else if(_0x1faeb1[_0xe82b('0x3')]===_0xe82b('0x6')&&_0x1faeb1[_0xe82b('0x7')]){_0x4dd7cd[_0x1faeb1[_0xe82b('0x7')]]&&_0x23a977[_0xe82b('0x8')](_0x4dd7cd[_0x1faeb1[_0xe82b('0x7')]][_0xe82b('0x9')]());}else if(_0x1faeb1['type']===_0xe82b('0xa')&&_0x1faeb1['Variable']&&_0x1faeb1[_0xe82b('0xb')][_0xe82b('0xc')]){_0x4dd7cd[_0x1faeb1[_0xe82b('0xb')]['name'][_0xe82b('0xd')]()]&&_0x23a977[_0xe82b('0x8')](_0x4dd7cd[_0x1faeb1[_0xe82b('0xb')][_0xe82b('0xc')][_0xe82b('0xd')]()]['toString']());}else if(_0x1faeb1[_0xe82b('0x3')]==='keyValue'){if(_0x1faeb1[_0xe82b('0xe')]===_0xe82b('0x4')&&_0x1faeb1[_0xe82b('0xf')]){_0x23a977[_0xe82b('0x8')](util[_0xe82b('0x10')]('%s:\x20%s',_0x1faeb1[_0xe82b('0xf')],_0x1faeb1['keyContent']));}else if(_0x1faeb1[_0xe82b('0xe')]===_0xe82b('0x6')&&_0x1faeb1[_0xe82b('0x7')]&&_0x1faeb1[_0xe82b('0xf')]){_0x4dd7cd[_0x1faeb1[_0xe82b('0x7')]]&&_0x23a977[_0xe82b('0x8')](util[_0xe82b('0x10')](_0xe82b('0x11'),_0x1faeb1['key'],_0x4dd7cd[_0x1faeb1[_0xe82b('0x7')]]));}else if(_0x1faeb1[_0xe82b('0xe')]==='customVariable'&&_0x1faeb1[_0xe82b('0xb')]&&_0x1faeb1[_0xe82b('0xb')][_0xe82b('0xc')]&&_0x1faeb1[_0xe82b('0xf')]){_0x4dd7cd[_0x1faeb1[_0xe82b('0xb')]['name']['toLowerCase']()]&&_0x23a977[_0xe82b('0x8')](util['format']('%s:\x20%s',_0x1faeb1[_0xe82b('0xf')],_0x4dd7cd[_0x1faeb1[_0xe82b('0xb')][_0xe82b('0xc')][_0xe82b('0xd')]()]));}}}}return _0x23a977['join'](_0x165979);};exports[_0xe82b('0x12')]=function(_0x5abe54){var _0x5c2f6d=_0x5abe54[_0xe82b('0x13')](-0x1);if(_0x5c2f6d==='/'){_0x5abe54=_0x5abe54[_0xe82b('0x14')](0x0,_0x5abe54['lastIndexOf'](_0x5c2f6d));}return _0x5abe54;};exports[_0xe82b('0x15')]=function(_0x128ff3){if(!_[_0xe82b('0x16')](_0x128ff3)&&_0x128ff3!==''){var _0x747312=/^(([^<>()\[\]\\.,;:\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 _0x747312[_0xe82b('0x17')](String(_0x128ff3)[_0xe82b('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xf544=['toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','variable','customVariable','join','slice','lastIndexOf','validateEmail','isNil','test','util','getString','length','push','content','type','variableName','toString','Variable','name'];(function(_0x381870,_0x562fb3){var _0x2181db=function(_0x408191){while(--_0x408191){_0x381870['push'](_0x381870['shift']());}};_0x2181db(++_0x562fb3);}(_0xf544,0xfa));var _0x4f54=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xf544[_0x4ae829];return _0x256b31;};'use strict';var _=require('lodash');var util=require(_0x4f54('0x0'));exports[_0x4f54('0x1')]=function(_0x2c1dcf,_0x106a90,_0x43ea34){var _0x4420ba=[];if(_0x2c1dcf[_0x4f54('0x2')]>0x0){var _0x399201=_['sortBy'](_0x2c1dcf,['id']);for(var _0x4a0700=0x0;_0x4a0700<_0x399201['length'];_0x4a0700++){var _0x2afd75=_0x399201[_0x4a0700];if(_0x2afd75['type']==='string'){_0x4420ba[_0x4f54('0x3')](_0x2afd75[_0x4f54('0x4')]);}else if(_0x2afd75[_0x4f54('0x5')]==='variable'&&_0x2afd75[_0x4f54('0x6')]){_0x106a90[_0x2afd75[_0x4f54('0x6')]]&&_0x4420ba[_0x4f54('0x3')](_0x106a90[_0x2afd75[_0x4f54('0x6')]][_0x4f54('0x7')]());}else if(_0x2afd75[_0x4f54('0x5')]==='customVariable'&&_0x2afd75[_0x4f54('0x8')]&&_0x2afd75[_0x4f54('0x8')][_0x4f54('0x9')]){_0x106a90[_0x2afd75['Variable'][_0x4f54('0x9')][_0x4f54('0xa')]()]&&_0x4420ba[_0x4f54('0x3')](_0x106a90[_0x2afd75[_0x4f54('0x8')][_0x4f54('0x9')]['toLowerCase']()][_0x4f54('0x7')]());}else if(_0x2afd75['type']===_0x4f54('0xb')){if(_0x2afd75[_0x4f54('0xc')]===_0x4f54('0xd')&&_0x2afd75[_0x4f54('0xe')]){_0x4420ba[_0x4f54('0x3')](util[_0x4f54('0xf')](_0x4f54('0x10'),_0x2afd75[_0x4f54('0xe')],_0x2afd75[_0x4f54('0x11')]));}else if(_0x2afd75[_0x4f54('0xc')]===_0x4f54('0x12')&&_0x2afd75['variableName']&&_0x2afd75[_0x4f54('0xe')]){_0x106a90[_0x2afd75[_0x4f54('0x6')]]&&_0x4420ba[_0x4f54('0x3')](util[_0x4f54('0xf')](_0x4f54('0x10'),_0x2afd75[_0x4f54('0xe')],_0x106a90[_0x2afd75[_0x4f54('0x6')]]));}else if(_0x2afd75[_0x4f54('0xc')]===_0x4f54('0x13')&&_0x2afd75[_0x4f54('0x8')]&&_0x2afd75[_0x4f54('0x8')]['name']&&_0x2afd75[_0x4f54('0xe')]){_0x106a90[_0x2afd75[_0x4f54('0x8')][_0x4f54('0x9')][_0x4f54('0xa')]()]&&_0x4420ba[_0x4f54('0x3')](util[_0x4f54('0xf')]('%s:\x20%s',_0x2afd75[_0x4f54('0xe')],_0x106a90[_0x2afd75[_0x4f54('0x8')][_0x4f54('0x9')]['toLowerCase']()]));}}}}return _0x4420ba[_0x4f54('0x14')](_0x43ea34);};exports['stripTrailingSlash']=function(_0xf88900){var _0x3f4088=_0xf88900[_0x4f54('0x15')](-0x1);if(_0x3f4088==='/'){_0xf88900=_0xf88900['substring'](0x0,_0xf88900[_0x4f54('0x16')](_0x3f4088));}return _0xf88900;};exports[_0x4f54('0x17')]=function(_0x3ba6f7){if(!_[_0x4f54('0x18')](_0x3ba6f7)&&_0x3ba6f7!==''){var _0x238ecb=/^(([^<>()\[\]\\.,;:\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 _0x238ecb[_0x4f54('0x19')](String(_0x3ba6f7)[_0x4f54('0xa')]());}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 9189485..2d01674 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x2edfa1,_0x43584c){var _0x403552=function(_0x220a1c){while(--_0x220a1c){_0x2edfa1['push'](_0x2edfa1['shift']());}};_0x403552(++_0x43584c);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1363d9,_0x445437){var _0x2b6a41=function(_0x3a454f){while(--_0x3a454f){_0x1363d9['push'](_0x1363d9['shift']());}};_0x2b6a41(++_0x445437);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 269e5d3..3dee736 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 _0x05cd=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','socket.io-emitter','emit','application/json','format','%s/tickets.json','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','[HTTP]','stringify','map','includes','string','picklist','type','nameField','toLowerCase','customField','custom_fields','idField','content','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x05cd,0x8d));var _0xd05c=function(_0x2615bb,_0x1dfa80){_0x2615bb=_0x2615bb-0x0;var _0x193937=_0x05cd[_0x2615bb];return _0x193937;};'use strict';var _=require(_0xd05c('0x0'));var rp=require(_0xd05c('0x1'));var md5=require(_0xd05c('0x2'));var util=require(_0xd05c('0x3'));var Redis=require(_0xd05c('0x4'));var intUtil=require(_0xd05c('0x5'));var config=require(_0xd05c('0x6'));var logger=require('../../../../config/logger')(_0xd05c('0x7'));config[_0xd05c('0x8')]=_['defaults'](config[_0xd05c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd05c('0x9'))(new Redis(config[_0xd05c('0x8')]));function emit(_0x199c17,_0x493535,_0x85ad6c){io['to'](_0x199c17)[_0xd05c('0xa')](_0x493535,_0x85ad6c);}var headers={'Content-Type':_0xd05c('0xb'),'Accept':_0xd05c('0xb')};function getTicket(_0x581cf5,_0x57570b,_0x294d99,_0x1fd0b2,_0x557c69){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xd05c('0xc')](_0xd05c('0xd'),_0x581cf5['remoteUri']),'method':_0xd05c('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x294d99['id'],'submitter_id':_0x57570b?_0x57570b['id']:undefined,'assignee_id':_0x57570b?_0x57570b['id']:undefined,'tags':getTags(_0x1fd0b2[_0xd05c('0xf')],_0xd05c('0x10')),'subject':intUtil[_0xd05c('0x11')](_0x1fd0b2[_0xd05c('0x12')],_0x557c69,'\x20'),'description':intUtil[_0xd05c('0x11')](_0x1fd0b2[_0xd05c('0x13')],_0x557c69,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd05c('0x11')](_0x1fd0b2[_0xd05c('0x13')],_0x557c69,'\x0a')}},getCustomFields(_0x1fd0b2[_0xd05c('0x14')],_0x557c69))}})[_0xd05c('0x15')](function(_0x1ec7ba){logger[_0xd05c('0x16')](_0xd05c('0x17'));return _0x1ec7ba[_0xd05c('0x18')];});}function getUser(_0x49a88e,_0x971174){if(intUtil[_0xd05c('0x19')](_0x971174)){logger[_0xd05c('0x16')](_0xd05c('0x1a'),_0x971174);return request({'uri':util[_0xd05c('0xc')](_0xd05c('0x1b'),_0x49a88e[_0xd05c('0x1c')]),'qs':{'query':util[_0xd05c('0xc')](_0xd05c('0x1d'),_0x971174)}})['then'](function(_0x143286){if(_0x143286['count']){logger['info'](_0xd05c('0x1e'));return _[_0xd05c('0x1f')](_0x143286['results'],{'email':_0x971174,'role':'agent'});}else{logger[_0xd05c('0x16')](_0xd05c('0x20'));return request({'uri':util['format'](_0xd05c('0x21'),_0x49a88e[_0xd05c('0x1c')])})[_0xd05c('0x15')](function(_0x1652d5){logger[_0xd05c('0x16')](_0xd05c('0x22'));return _0x1652d5[_0xd05c('0x23')];});}});}else{logger[_0xd05c('0x16')](_0xd05c('0x20'));return request({'uri':util[_0xd05c('0xc')]('%s/users/me.json',_0x49a88e[_0xd05c('0x1c')])})[_0xd05c('0x15')](function(_0x91c3c0){logger[_0xd05c('0x16')](_0xd05c('0x22'));return _0x91c3c0[_0xd05c('0x23')];});}}function getEndUser(_0x282845,_0x112cbf,_0x2af179){logger[_0xd05c('0x16')](_0xd05c('0x24'),_0x2af179);return request({'uri':util[_0xd05c('0xc')](_0xd05c('0x1b'),_0x282845[_0xd05c('0x1c')]),'qs':{'query':util[_0xd05c('0xc')](_0xd05c('0x25'),_0x2af179)}})[_0xd05c('0x15')](function(_0x2d8ff8){var _0x212f96;if(_0x2d8ff8[_0xd05c('0x26')][_0xd05c('0x27')]){_0x2d8ff8[_0xd05c('0x26')]=_[_0xd05c('0x28')](_0x2d8ff8[_0xd05c('0x26')],{'suspended':![],'role':_0xd05c('0x29')});if(_0x2d8ff8['results'][_0xd05c('0x27')]){_0x212f96=_['first'](_0x2d8ff8[_0xd05c('0x26')]);}}if(_0x212f96){logger['info'](_0xd05c('0x2a'));return _0x212f96;}else{logger['info'](_0xd05c('0x2b'));return request({'uri':util[_0xd05c('0xc')](_0xd05c('0x2c'),_0x282845[_0xd05c('0x1c')]),'method':'POST','body':{'user':{'role':_0xd05c('0x29'),'name':util['format']('Caller\x20-\x20%s',_0x112cbf||_0x2af179),'phone':_0x2af179}}})['then'](function(_0x50b0ff){logger['info'](_0xd05c('0x2d'));return _0x50b0ff[_0xd05c('0x23')];});}});}function getAuth(_0x13c391){var _0x48e612;if(_0x13c391[_0xd05c('0x2e')]==='password'){_0x48e612=util[_0xd05c('0xc')](_0xd05c('0x2f'),_0x13c391[_0xd05c('0x30')],_0x13c391[_0xd05c('0x31')]);}else if(_0x13c391[_0xd05c('0x2e')]==='token'){_0x48e612=util[_0xd05c('0xc')]('%s/token:%s',_0x13c391[_0xd05c('0x30')],_0x13c391[_0xd05c('0x32')]);}return util[_0xd05c('0xc')](_0xd05c('0x33'),new Buffer(_0x48e612)[_0xd05c('0x34')](_0xd05c('0x35')));}function request(_0x1cd866){logger['debug'](_0xd05c('0x36'),JSON[_0xd05c('0x37')](_0x1cd866));return rp(_['defaults'](_0x1cd866,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3fb344,_0x2f4d7d){var _0x592888=[];if(_0x3fb344&&_0x3fb344[_0xd05c('0x27')]>0x0){_0x592888=_[_0xd05c('0x38')](_0x3fb344,_0x2f4d7d);}return _0x592888;}function getCustomFields(_0x465413,_0x2229a0){var _0x5a4ad4=[];var _0x3260f9={'custom_fields':[]};if(_0x465413['length']>0x0){_['forEach'](_0x465413,function(_0x43bfd1){if(_[_0xd05c('0x39')]([_0xd05c('0x3a'),_0xd05c('0x3b')],_0x43bfd1[_0xd05c('0x3c')])&&_0x43bfd1[_0xd05c('0x3d')]&&!_0x43bfd1['customField']){_0x3260f9[_0x43bfd1[_0xd05c('0x3d')][_0xd05c('0x3e')]()]=_0x43bfd1['content'][_0xd05c('0x34')]();}else if(_[_0xd05c('0x39')]([_0xd05c('0x3a'),_0xd05c('0x3b')],_0x43bfd1[_0xd05c('0x3c')])&&_0x43bfd1['idField']&&_0x43bfd1[_0xd05c('0x3f')]){_0x3260f9[_0xd05c('0x40')]['push']({'id':_0x43bfd1[_0xd05c('0x41')],'value':_0x43bfd1[_0xd05c('0x42')][_0xd05c('0x34')]()});}else if(_0x43bfd1[_0xd05c('0x3c')]===_0xd05c('0x43')&&_0x43bfd1['variableName']&&_0x43bfd1[_0xd05c('0x41')]&&_0x43bfd1['customField']){_0x2229a0[_0x43bfd1[_0xd05c('0x44')]]&&_0x3260f9[_0xd05c('0x40')][_0xd05c('0x45')]({'id':_0x43bfd1[_0xd05c('0x41')],'value':_0x2229a0[_0x43bfd1[_0xd05c('0x44')]][_0xd05c('0x34')]()});}else if(_0x43bfd1[_0xd05c('0x3c')]===_0xd05c('0x46')&&_0x43bfd1['Variable']&&_0x43bfd1[_0xd05c('0x47')][_0xd05c('0x10')]&&_0x43bfd1['idField']&&_0x43bfd1[_0xd05c('0x3f')]){_0x2229a0[_0x43bfd1['Variable'][_0xd05c('0x10')][_0xd05c('0x3e')]()]&&_0x3260f9[_0xd05c('0x40')]['push']({'id':_0x43bfd1[_0xd05c('0x41')],'value':_0x2229a0[_0x43bfd1[_0xd05c('0x47')][_0xd05c('0x10')][_0xd05c('0x3e')]()][_0xd05c('0x34')]()});}});}return _0x3260f9;}exports[_0xd05c('0x48')]=function(_0xd35613,_0x5aecd9,_0x361276,_0x56a77c,_0x4aea09,_0x24f7ee){var _0x4f33e1,_0x46db05;_0x24f7ee['remoteUri']=intUtil[_0xd05c('0x49')](_0x24f7ee[_0xd05c('0x1c')]);_0x24f7ee[_0xd05c('0x4a')]=intUtil[_0xd05c('0x49')](_0x24f7ee['serverUrl']);if(_0x4aea09&&_0x4aea09[_0xd05c('0x4b')]){logger[_0xd05c('0x16')](_0xd05c('0x4c'),_0xd05c('0x4d'));_0x5aecd9[_0xd05c('0x4e')]=util[_0xd05c('0xc')](_0xd05c('0x4f'),_0x24f7ee[_0xd05c('0x4a')],_0x5aecd9[_0xd05c('0x50')],md5(_0x5aecd9['uniqueid']));}else{_0x5aecd9[_0xd05c('0x4e')]='';}headers[_0xd05c('0x51')]=getAuth(_0x24f7ee);return getUser(_0x24f7ee,_0x56a77c[_0xd05c('0x52')])[_0xd05c('0x15')](function(_0x1e70d9){_0x4f33e1=_0x1e70d9;logger['info'](_0xd05c('0x53'),_0x4f33e1['id']);return getEndUser(_0x24f7ee,_0x5aecd9[_0xd05c('0x54')],_0x5aecd9[_0xd05c('0x55')]);})[_0xd05c('0x15')](function(_0x12f210){_0x46db05=_0x12f210;logger[_0xd05c('0x16')](_0xd05c('0x56'),_0x46db05['id']);return getTicket(_0x24f7ee,_0x4f33e1,_0x46db05,_0x361276,_0x5aecd9);})[_0xd05c('0x15')](function(_0x1dd0f4){if(_0x1dd0f4){logger[_0xd05c('0x16')]('The\x20Ticket\x20ID\x20is:',_0x1dd0f4['id']);switch(_0x24f7ee[_0xd05c('0x3c')]){case _0xd05c('0x57'):logger[_0xd05c('0x16')](_0xd05c('0x4c'),_0xd05c('0x58'));return request({'uri':util[_0xd05c('0xc')](_0xd05c('0x59'),_0x24f7ee[_0xd05c('0x1c')],_0x4f33e1['id'],_0x1dd0f4['id']),'method':_0xd05c('0xe')});case _0xd05c('0x5a'):logger[_0xd05c('0x16')]('[QUEUE]',_0xd05c('0x5b'));emit(util[_0xd05c('0xc')](_0xd05c('0x5c'),_0x56a77c['name']),'trigger:browser:url',{'uri':util[_0xd05c('0xc')](_0xd05c('0x5d'),_0x24f7ee[_0xd05c('0x1c')][_0xd05c('0x5e')](_0xd05c('0x5f'),''),_0x1dd0f4['id'])});break;default:logger[_0xd05c('0x60')](_0xd05c('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xd05c('0x61')](function(_0x528b55){logger[_0xd05c('0x60')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd05c('0x62')](_0x528b55,{'showHidden':!![],'depth':null}));});};exports[_0xd05c('0x63')]=function(_0x3e53f9,_0x486222,_0x5906d8,_0x53909e,_0x472a4c,_0x545170,_0x45f3df){var _0x5610b8,_0x492a70;_0x545170[_0xd05c('0x1c')]=intUtil['stripTrailingSlash'](_0x545170[_0xd05c('0x1c')]);_0x545170[_0xd05c('0x4a')]=intUtil[_0xd05c('0x49')](_0x545170[_0xd05c('0x4a')]);if(_0x45f3df&&_0x45f3df[_0xd05c('0x64')]&&_0x45f3df[_0xd05c('0x64')]!==_0xd05c('0x65')){logger[_0xd05c('0x16')](_0xd05c('0x66'),_0xd05c('0x4d'));_0x486222['recordingURL']=util[_0xd05c('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x545170['serverUrl'],_0x486222['uniqueid'],md5(_0x486222[_0xd05c('0x50')]));}headers['Authorization']=getAuth(_0x545170);return getUser(_0x545170,_0x53909e[_0xd05c('0x52')])[_0xd05c('0x15')](function(_0xdf6c9d){_0x5610b8=_0xdf6c9d;logger[_0xd05c('0x16')](_0xd05c('0x53'),_0x5610b8['id']);return getEndUser(_0x545170,_0x486222[_0xd05c('0x67')],_0x486222['destcalleridnum']);})[_0xd05c('0x15')](function(_0x13cf30){_0x492a70=_0x13cf30;logger['info'](_0xd05c('0x56'),_0x492a70['id']);return getTicket(_0x545170,_0x5610b8,_0x492a70,_0x5906d8,_0x486222);})[_0xd05c('0x15')](function(_0x6fc144){if(_0x6fc144){logger['info']('The\x20Ticket\x20ID\x20is:',_0x6fc144['id']);switch(_0x545170[_0xd05c('0x3c')]){case _0xd05c('0x57'):logger[_0xd05c('0x16')](_0xd05c('0x66'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd05c('0xc')](_0xd05c('0x59'),_0x545170[_0xd05c('0x1c')],_0x5610b8['id'],_0x6fc144['id']),'method':_0xd05c('0xe')});case _0xd05c('0x5a'):logger['info'](_0xd05c('0x66'),_0xd05c('0x5b'));emit(util['format'](_0xd05c('0x5c'),_0x53909e['name']),_0xd05c('0x68'),{'uri':util[_0xd05c('0xc')](_0xd05c('0x5d'),_0x545170[_0xd05c('0x1c')]['replace'](_0xd05c('0x5f'),''),_0x6fc144['id'])});break;default:logger[_0xd05c('0x60')]('[OUTBOUND]',_0xd05c('0x69'));}}})[_0xd05c('0x61')](function(_0x5c1c4f){logger[_0xd05c('0x60')](_0xd05c('0x6a'),util['inspect'](_0x5c1c4f,{'showHidden':!![],'depth':null}));});};exports[_0xd05c('0x6b')]=function(_0x3dfcda,_0x10199e,_0x57d1a9,_0x48deb3,_0x1eb015,_0x452720){var _0x192f97,_0x3c7234;_0x452720[_0xd05c('0x1c')]=intUtil['stripTrailingSlash'](_0x452720['remoteUri']);_0x452720['serverUrl']=intUtil[_0xd05c('0x49')](_0x452720[_0xd05c('0x4a')]);if(_0x1eb015&&_0x1eb015[_0xd05c('0x4b')]){logger[_0xd05c('0x16')]('['+_0x10199e[_0xd05c('0x6c')][_0xd05c('0x6d')]()+']',_0xd05c('0x4d'));_0x10199e[_0xd05c('0x4e')]=util[_0xd05c('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x452720[_0xd05c('0x4a')],_0x10199e['uniqueid'],md5(_0x10199e['uniqueid']));}else{_0x10199e[_0xd05c('0x4e')]='';}headers[_0xd05c('0x51')]=getAuth(_0x452720);return getUser(_0x452720)['then'](function(_0x5c3f11){_0x192f97=_0x5c3f11;logger[_0xd05c('0x16')](_0xd05c('0x53'),_0x192f97['id']);return getEndUser(_0x452720,_0x10199e[_0xd05c('0x54')],_0x10199e[_0xd05c('0x55')]);})[_0xd05c('0x15')](function(_0x1afc06){_0x3c7234=_0x1afc06;logger[_0xd05c('0x16')](_0xd05c('0x56'),_0x3c7234['id']);return getTicket(_0x452720,_0x192f97,_0x3c7234,_0x57d1a9,_0x10199e);})[_0xd05c('0x15')](function(_0x79b9f1){if(_0x79b9f1){logger[_0xd05c('0x16')](_0xd05c('0x6e'),_0x79b9f1['id']);}})['catch'](function(_0x1a694d){logger[_0xd05c('0x60')]('['+_0x10199e[_0xd05c('0x6c')][_0xd05c('0x6d')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1a694d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0036=['results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','defaults','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','trigger:browser:url','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','validateEmail','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find'];(function(_0x73d817,_0x54eed1){var _0x178cf8=function(_0x3cdf24){while(--_0x3cdf24){_0x73d817['push'](_0x73d817['shift']());}};_0x178cf8(++_0x54eed1);}(_0x0036,0xbc));var _0x6003=function(_0x177e48,_0x2f35dd){_0x177e48=_0x177e48-0x0;var _0x365760=_0x0036[_0x177e48];return _0x365760;};'use strict';var _=require(_0x6003('0x0'));var rp=require(_0x6003('0x1'));var md5=require(_0x6003('0x2'));var util=require(_0x6003('0x3'));var Redis=require(_0x6003('0x4'));var intUtil=require(_0x6003('0x5'));var config=require(_0x6003('0x6'));var logger=require(_0x6003('0x7'))('zendesk');config[_0x6003('0x8')]=_['defaults'](config[_0x6003('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4f9203,_0x3845c6,_0x1beae4){io['to'](_0x4f9203)[_0x6003('0x9')](_0x3845c6,_0x1beae4);}var headers={'Content-Type':_0x6003('0xa'),'Accept':'application/json'};function getTicket(_0x1dcb68,_0x5e69ff,_0x2d69a8,_0x4c2ba9,_0x2ab500){logger[_0x6003('0xb')](_0x6003('0xc'));return request({'uri':util['format'](_0x6003('0xd'),_0x1dcb68[_0x6003('0xe')]),'method':_0x6003('0xf'),'body':{'ticket':_[_0x6003('0x10')]({'requester_id':_0x2d69a8['id'],'submitter_id':_0x5e69ff?_0x5e69ff['id']:undefined,'assignee_id':_0x5e69ff?_0x5e69ff['id']:undefined,'tags':getTags(_0x4c2ba9['Tags'],_0x6003('0x11')),'subject':intUtil[_0x6003('0x12')](_0x4c2ba9['Subjects'],_0x2ab500,'\x20'),'description':intUtil[_0x6003('0x12')](_0x4c2ba9[_0x6003('0x13')],_0x2ab500,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6003('0x12')](_0x4c2ba9[_0x6003('0x13')],_0x2ab500,'\x0a')}},getCustomFields(_0x4c2ba9[_0x6003('0x14')],_0x2ab500))}})[_0x6003('0x15')](function(_0x453217){logger[_0x6003('0xb')](_0x6003('0x16'));return _0x453217['ticket'];});}function getUser(_0x3bf04b,_0x5b7c52){if(intUtil[_0x6003('0x17')](_0x5b7c52)){logger['info']('Getting\x20agent\x20with\x20email',_0x5b7c52);return request({'uri':util[_0x6003('0x18')](_0x6003('0x19'),_0x3bf04b[_0x6003('0xe')]),'qs':{'query':util[_0x6003('0x18')](_0x6003('0x1a'),_0x5b7c52)}})[_0x6003('0x15')](function(_0x5ccb99){if(_0x5ccb99[_0x6003('0x1b')]){logger['info'](_0x6003('0x1c'));return _[_0x6003('0x1d')](_0x5ccb99[_0x6003('0x1e')],{'email':_0x5b7c52,'role':_0x6003('0x1f')});}else{logger[_0x6003('0xb')](_0x6003('0x20'));return request({'uri':util[_0x6003('0x18')]('%s/users/me.json',_0x3bf04b['remoteUri'])})[_0x6003('0x15')](function(_0x1f38ef){logger['info'](_0x6003('0x21'));return _0x1f38ef[_0x6003('0x22')];});}});}else{logger[_0x6003('0xb')](_0x6003('0x20'));return request({'uri':util[_0x6003('0x18')]('%s/users/me.json',_0x3bf04b[_0x6003('0xe')])})['then'](function(_0x3d4cae){logger[_0x6003('0xb')](_0x6003('0x21'));return _0x3d4cae['user'];});}}function getEndUser(_0x339e15,_0x2e7acd,_0x3f2903){logger['info']('Searching\x20enduser\x20with\x20phone',_0x3f2903);return request({'uri':util[_0x6003('0x18')](_0x6003('0x19'),_0x339e15[_0x6003('0xe')]),'qs':{'query':util[_0x6003('0x18')](_0x6003('0x23'),_0x3f2903)}})[_0x6003('0x15')](function(_0x22a048){var _0x71101f;if(_0x22a048[_0x6003('0x1e')][_0x6003('0x24')]){_0x22a048[_0x6003('0x1e')]=_[_0x6003('0x25')](_0x22a048[_0x6003('0x1e')],{'suspended':![],'role':_0x6003('0x26')});if(_0x22a048[_0x6003('0x1e')][_0x6003('0x24')]){_0x71101f=_[_0x6003('0x27')](_0x22a048['results']);}}if(_0x71101f){logger[_0x6003('0xb')](_0x6003('0x28'));return _0x71101f;}else{logger[_0x6003('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6003('0x18')](_0x6003('0x29'),_0x339e15[_0x6003('0xe')]),'method':_0x6003('0xf'),'body':{'user':{'role':_0x6003('0x26'),'name':util[_0x6003('0x18')]('Caller\x20-\x20%s',_0x2e7acd||_0x3f2903),'phone':_0x3f2903}}})['then'](function(_0x47fbc6){logger[_0x6003('0xb')](_0x6003('0x2a'));return _0x47fbc6[_0x6003('0x22')];});}});}function getAuth(_0x554c22){var _0x484902;if(_0x554c22['authType']===_0x6003('0x2b')){_0x484902=util[_0x6003('0x18')](_0x6003('0x2c'),_0x554c22[_0x6003('0x2d')],_0x554c22[_0x6003('0x2b')]);}else if(_0x554c22[_0x6003('0x2e')]===_0x6003('0x2f')){_0x484902=util[_0x6003('0x18')](_0x6003('0x30'),_0x554c22[_0x6003('0x2d')],_0x554c22[_0x6003('0x2f')]);}return util[_0x6003('0x18')](_0x6003('0x31'),new Buffer(_0x484902)[_0x6003('0x32')]('base64'));}function request(_0x59dcd5){logger[_0x6003('0x33')](_0x6003('0x34'),JSON[_0x6003('0x35')](_0x59dcd5));return rp(_[_0x6003('0x36')](_0x59dcd5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x587e95,_0x546626){var _0x35c85e=[];if(_0x587e95&&_0x587e95[_0x6003('0x24')]>0x0){_0x35c85e=_['map'](_0x587e95,_0x546626);}return _0x35c85e;}function getCustomFields(_0x1c6665,_0x55aa53){var _0x159b1e=[];var _0x4ffcf1={'custom_fields':[]};if(_0x1c6665[_0x6003('0x24')]>0x0){_[_0x6003('0x37')](_0x1c6665,function(_0x55e127){if(_[_0x6003('0x38')]([_0x6003('0x39'),_0x6003('0x3a')],_0x55e127[_0x6003('0x3b')])&&_0x55e127[_0x6003('0x3c')]&&!_0x55e127['customField']){_0x4ffcf1[_0x55e127['nameField'][_0x6003('0x3d')]()]=_0x55e127[_0x6003('0x3e')][_0x6003('0x32')]();}else if(_[_0x6003('0x38')]([_0x6003('0x39'),'picklist'],_0x55e127[_0x6003('0x3b')])&&_0x55e127[_0x6003('0x3f')]&&_0x55e127[_0x6003('0x40')]){_0x4ffcf1[_0x6003('0x41')]['push']({'id':_0x55e127[_0x6003('0x3f')],'value':_0x55e127['content']['toString']()});}else if(_0x55e127['type']===_0x6003('0x42')&&_0x55e127[_0x6003('0x43')]&&_0x55e127[_0x6003('0x3f')]&&_0x55e127['customField']){_0x55aa53[_0x55e127[_0x6003('0x43')]]&&_0x4ffcf1['custom_fields']['push']({'id':_0x55e127[_0x6003('0x3f')],'value':_0x55aa53[_0x55e127[_0x6003('0x43')]][_0x6003('0x32')]()});}else if(_0x55e127[_0x6003('0x3b')]===_0x6003('0x44')&&_0x55e127[_0x6003('0x45')]&&_0x55e127['Variable']['name']&&_0x55e127[_0x6003('0x3f')]&&_0x55e127[_0x6003('0x40')]){_0x55aa53[_0x55e127[_0x6003('0x45')][_0x6003('0x11')][_0x6003('0x3d')]()]&&_0x4ffcf1[_0x6003('0x41')]['push']({'id':_0x55e127['idField'],'value':_0x55aa53[_0x55e127[_0x6003('0x45')]['name'][_0x6003('0x3d')]()][_0x6003('0x32')]()});}});}return _0x4ffcf1;}exports['queue']=function(_0x8fb6ab,_0x3439be,_0x49c459,_0x354cdf,_0x42930e,_0x161c68){var _0x28386a,_0xb12e05;_0x161c68[_0x6003('0xe')]=intUtil[_0x6003('0x46')](_0x161c68[_0x6003('0xe')]);_0x161c68[_0x6003('0x47')]=intUtil[_0x6003('0x46')](_0x161c68[_0x6003('0x47')]);if(_0x42930e&&_0x42930e[_0x6003('0x48')]){logger[_0x6003('0xb')]('[QUEUE]',_0x6003('0x49'));_0x3439be[_0x6003('0x4a')]=util[_0x6003('0x18')](_0x6003('0x4b'),_0x161c68[_0x6003('0x47')],_0x3439be['uniqueid'],md5(_0x3439be['uniqueid']));}else{_0x3439be['recordingURL']='';}headers[_0x6003('0x4c')]=getAuth(_0x161c68);return getUser(_0x161c68,_0x354cdf[_0x6003('0x4d')])[_0x6003('0x15')](function(_0x39d495){_0x28386a=_0x39d495;logger['info'](_0x6003('0x4e'),_0x28386a['id']);return getEndUser(_0x161c68,_0x3439be[_0x6003('0x4f')],_0x3439be['calleridnum']);})[_0x6003('0x15')](function(_0x153dcc){_0xb12e05=_0x153dcc;logger[_0x6003('0xb')](_0x6003('0x50'),_0xb12e05['id']);return getTicket(_0x161c68,_0x28386a,_0xb12e05,_0x49c459,_0x3439be);})[_0x6003('0x15')](function(_0x2be1a5){if(_0x2be1a5){logger[_0x6003('0xb')](_0x6003('0x51'),_0x2be1a5['id']);switch(_0x161c68[_0x6003('0x3b')]){case _0x6003('0x52'):logger['info'](_0x6003('0x53'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x6003('0x18')](_0x6003('0x54'),_0x161c68[_0x6003('0xe')],_0x28386a['id'],_0x2be1a5['id']),'method':_0x6003('0xf')});case _0x6003('0x55'):logger['info']('[QUEUE]',_0x6003('0x56'));emit(util[_0x6003('0x18')](_0x6003('0x57'),_0x354cdf['name']),'trigger:browser:url',{'uri':util[_0x6003('0x18')](_0x6003('0x58'),_0x161c68[_0x6003('0xe')]['replace'](_0x6003('0x59'),''),_0x2be1a5['id'])});break;default:logger['error'](_0x6003('0x53'),_0x6003('0x5a'));}}})[_0x6003('0x5b')](function(_0x9e8e10){logger[_0x6003('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x6003('0x5d')](_0x9e8e10,{'showHidden':!![],'depth':null}));});};exports[_0x6003('0x5e')]=function(_0x1019bb,_0x1100aa,_0x3d5d82,_0x4481b8,_0xe08f40,_0x225a20,_0x2cf367){var _0x261464,_0xc242e7;_0x225a20[_0x6003('0xe')]=intUtil[_0x6003('0x46')](_0x225a20[_0x6003('0xe')]);_0x225a20[_0x6003('0x47')]=intUtil[_0x6003('0x46')](_0x225a20[_0x6003('0x47')]);if(_0x2cf367&&_0x2cf367[_0x6003('0x5f')]&&_0x2cf367[_0x6003('0x5f')]!==_0x6003('0x60')){logger[_0x6003('0xb')](_0x6003('0x61'),_0x6003('0x49'));_0x1100aa[_0x6003('0x4a')]=util['format'](_0x6003('0x4b'),_0x225a20[_0x6003('0x47')],_0x1100aa[_0x6003('0x62')],md5(_0x1100aa['uniqueid']));}headers[_0x6003('0x4c')]=getAuth(_0x225a20);return getUser(_0x225a20,_0x4481b8[_0x6003('0x4d')])['then'](function(_0x344d45){_0x261464=_0x344d45;logger[_0x6003('0xb')](_0x6003('0x4e'),_0x261464['id']);return getEndUser(_0x225a20,_0x1100aa[_0x6003('0x63')],_0x1100aa[_0x6003('0x64')]);})[_0x6003('0x15')](function(_0x5f37cf){_0xc242e7=_0x5f37cf;logger['info']('The\x20Enduser\x20ID\x20is:',_0xc242e7['id']);return getTicket(_0x225a20,_0x261464,_0xc242e7,_0x3d5d82,_0x1100aa);})[_0x6003('0x15')](function(_0x224df0){if(_0x224df0){logger[_0x6003('0xb')](_0x6003('0x51'),_0x224df0['id']);switch(_0x225a20[_0x6003('0x3b')]){case _0x6003('0x52'):logger[_0x6003('0xb')](_0x6003('0x61'),_0x6003('0x65'));return request({'uri':util['format'](_0x6003('0x54'),_0x225a20[_0x6003('0xe')],_0x261464['id'],_0x224df0['id']),'method':_0x6003('0xf')});case _0x6003('0x55'):logger[_0x6003('0xb')]('[OUTBOUND]',_0x6003('0x56'));emit(util['format']('user:%s',_0x4481b8[_0x6003('0x11')]),_0x6003('0x66'),{'uri':util[_0x6003('0x18')](_0x6003('0x58'),_0x225a20[_0x6003('0xe')][_0x6003('0x67')]('/api/v2',''),_0x224df0['id'])});break;default:logger['error'](_0x6003('0x61'),_0x6003('0x5a'));}}})[_0x6003('0x5b')](function(_0x1a2dda){logger[_0x6003('0x5c')](_0x6003('0x68'),util[_0x6003('0x5d')](_0x1a2dda,{'showHidden':!![],'depth':null}));});};exports[_0x6003('0x69')]=function(_0x56205e,_0x31836f,_0x20bdd9,_0x1152e0,_0x2616bf,_0x35731e){var _0x4c0395,_0x2816df;_0x35731e[_0x6003('0xe')]=intUtil[_0x6003('0x46')](_0x35731e['remoteUri']);_0x35731e[_0x6003('0x47')]=intUtil['stripTrailingSlash'](_0x35731e[_0x6003('0x47')]);if(_0x2616bf&&_0x2616bf[_0x6003('0x48')]){logger['info']('['+_0x31836f[_0x6003('0x6a')][_0x6003('0x6b')]()+']',_0x6003('0x49'));_0x31836f[_0x6003('0x4a')]=util['format'](_0x6003('0x4b'),_0x35731e[_0x6003('0x47')],_0x31836f[_0x6003('0x62')],md5(_0x31836f['uniqueid']));}else{_0x31836f[_0x6003('0x4a')]='';}headers['Authorization']=getAuth(_0x35731e);return getUser(_0x35731e)[_0x6003('0x15')](function(_0x49b1ec){_0x4c0395=_0x49b1ec;logger[_0x6003('0xb')](_0x6003('0x4e'),_0x4c0395['id']);return getEndUser(_0x35731e,_0x31836f[_0x6003('0x4f')],_0x31836f[_0x6003('0x6c')]);})['then'](function(_0x1e19db){_0x2816df=_0x1e19db;logger[_0x6003('0xb')](_0x6003('0x50'),_0x2816df['id']);return getTicket(_0x35731e,_0x4c0395,_0x2816df,_0x20bdd9,_0x31836f);})['then'](function(_0x127143){if(_0x127143){logger['info'](_0x6003('0x51'),_0x127143['id']);}})['catch'](function(_0x4eda83){logger[_0x6003('0x5c')]('['+_0x31836f['lastevent'][_0x6003('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4eda83,{'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 960542b..0203721 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 _0xfb68=['md5','util','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','[HTTP]','length','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','add','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','catch','POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','format','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','none','[OUTBOUND]','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise'];(function(_0x2dd849,_0x3bd1bf){var _0x38ba4e=function(_0xd89ddc){while(--_0xd89ddc){_0x2dd849['push'](_0x2dd849['shift']());}};_0x38ba4e(++_0x3bd1bf);}(_0xfb68,0x1d2));var _0x8fb6=function(_0x57cb80,_0x17dce5){_0x57cb80=_0x57cb80-0x0;var _0xc899a3=_0xfb68[_0x57cb80];return _0xc899a3;};'use strict';var _=require(_0x8fb6('0x0'));var rp=require(_0x8fb6('0x1'));var md5=require(_0x8fb6('0x2'));var util=require(_0x8fb6('0x3'));var intUtil=require(_0x8fb6('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x8fb6('0x5'));var config=require(_0x8fb6('0x6'));var logger=require(_0x8fb6('0x7'))(_0x8fb6('0x8'));config[_0x8fb6('0x9')]=_['defaults'](config[_0x8fb6('0x9')],{'host':_0x8fb6('0xa'),'port':0x18eb});var io=require(_0x8fb6('0xb'))(new Redis(config[_0x8fb6('0x9')]));function emit(_0x17ce82,_0x251342,_0x368988){io['to'](_0x17ce82)['emit'](_0x251342,_0x368988);}function request(_0x45f03b){logger['debug'](_0x8fb6('0xc'),JSON['stringify'](_0x45f03b));return rp(_0x45f03b);}function getCustomFields(_0x36c0f6,_0x1c32e6){var _0x59633e={};if(_0x36c0f6[_0x8fb6('0xd')]>0x0){_[_0x8fb6('0xe')](_0x36c0f6,function(_0x28d16b){if(_[_0x8fb6('0xf')]([_0x8fb6('0x10'),'picklist'],_0x28d16b[_0x8fb6('0x11')])&&_0x28d16b[_0x8fb6('0x12')]){_0x59633e[_0x28d16b['idField']]=_0x28d16b[_0x8fb6('0x13')][_0x8fb6('0x14')]();}else if(_0x28d16b[_0x8fb6('0x11')]===_0x8fb6('0x15')&&_0x28d16b[_0x8fb6('0x16')]&&_0x28d16b[_0x8fb6('0x12')]&&_0x1c32e6[_0x28d16b[_0x8fb6('0x16')]]){_0x59633e[_0x28d16b[_0x8fb6('0x12')]]=_0x1c32e6[_0x28d16b[_0x8fb6('0x16')]]['toString']();}else if(_0x28d16b['type']===_0x8fb6('0x17')&&_0x28d16b[_0x8fb6('0x18')]&&_0x28d16b[_0x8fb6('0x18')][_0x8fb6('0x19')]&&_0x28d16b[_0x8fb6('0x12')]&&_0x1c32e6[_0x28d16b[_0x8fb6('0x18')][_0x8fb6('0x19')][_0x8fb6('0x1a')]()]){_0x59633e[_0x28d16b[_0x8fb6('0x12')]]=_0x1c32e6[_0x28d16b[_0x8fb6('0x18')]['name'][_0x8fb6('0x1a')]()]['toString']();}});}return _0x59633e;}function getName(_0x505ced){if(_0x505ced[_0x8fb6('0x1b')]('\x20')>0x0){var _0x2ee63a=_0x505ced['split'](/ (.+)/);if(_0x2ee63a[0x1]){return _0x2ee63a;}}return[_0x505ced,_0x505ced];}var accountsTokens={};function getAccessToken(_0x521948){return new Promise(function(_0x13599a,_0x628d87){if(!_['isNil'](accountsTokens[_0x521948['id']])&&!_[_0x8fb6('0x1c')](accountsTokens[_0x521948['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x521948['id']]['expires_in'])){_0x13599a(accountsTokens[_0x521948['id']][_0x8fb6('0x1d')]);}}var _0x4a9beb;switch(_0x521948[_0x8fb6('0x1e')]){case'US':_0x4a9beb=_0x8fb6('0x1f');break;case'AU':_0x4a9beb=_0x8fb6('0x20');break;case'EU':_0x4a9beb='https://accounts.zoho.eu';break;case'IN':_0x4a9beb=_0x8fb6('0x21');break;case'CN':_0x4a9beb=_0x8fb6('0x22');break;default:_0x4a9beb='https://accounts.zoho.eu';break;}var _0x249c37={'method':'POST','uri':_0x4a9beb+_0x8fb6('0x23'),'qs':{'refresh_token':_0x521948['refreshToken'],'client_id':_0x521948[_0x8fb6('0x24')],'client_secret':_0x521948[_0x8fb6('0x25')],'grant_type':_0x8fb6('0x26')},'json':!![]};return rp(_0x249c37)['then'](function(_0x59fbf6){accountsTokens[_0x521948['id']]={'access_token':_0x59fbf6['access_token'],'expires_in':moment()[_0x8fb6('0x27')](_0x59fbf6[_0x8fb6('0x28')],_0x8fb6('0x29'))};_0x13599a(_0x59fbf6[_0x8fb6('0x1d')]);})['catch'](function(_0x2dae5c){logger[_0x8fb6('0x2a')](_0x8fb6('0x2b'),_0x2dae5c[_0x8fb6('0x2c')]);_0x628d87(_0x2dae5c);});});}function getUser(_0x17081c,_0x4438c3,_0x7f8042,_0x4b9bbc){logger[_0x8fb6('0x2d')](_0x8fb6('0x2e'));return request({'method':'GET','uri':util['format'](_0x8fb6('0x2f'),_0x4438c3),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x8fb6('0x30')+_0x17081c},'json':!![]})[_0x8fb6('0x31')](function(_0x1bee13){if(_0x1bee13[_0x8fb6('0x32')]){var _0x51f2b9=-0x1;if(_[_0x8fb6('0x33')](_0x1bee13[_0x8fb6('0x32')])){if(!_[_0x8fb6('0x1c')](_0x4b9bbc)){_0x51f2b9=_[_0x8fb6('0x34')](_0x1bee13[_0x8fb6('0x32')],function(_0x2fa84b){return _0x2fa84b[_0x8fb6('0x35')]===_0x4b9bbc;});}if(_0x51f2b9>=0x0){logger['info'](_0x8fb6('0x36'));}else{logger['info'](_0x8fb6('0x37'));_0x51f2b9=_[_0x8fb6('0x34')](_0x1bee13['users'],function(_0x2fc1e3){return _0x2fc1e3[_0x8fb6('0x38')][_0x8fb6('0x19')]===_0x8fb6('0x39');});}return _0x1bee13[_0x8fb6('0x32')][_0x51f2b9];}else{if(_0x1bee13[_0x8fb6('0x3a')]['profile'][_0x8fb6('0x19')]==='Administrator'){logger[_0x8fb6('0x2d')](_0x8fb6('0x37'));user=_0x1bee13['user'];return user;}else{logger[_0x8fb6('0x2a')](_0x8fb6('0x3b'),JSON['stringify'](_0x1bee13));throw new Error(_0x8fb6('0x3c')+JSON['stringify'](_0x1bee13));}}}else{logger['error'](_0x8fb6('0x3b'),JSON[_0x8fb6('0x3d')](_0x1bee13));throw new Error(_0x8fb6('0x3c')+JSON['stringify'](_0x1bee13));}})['catch'](function(_0x16affd){console['error'](_0x16affd);});}function getZohoUser(_0x5d9a95,_0x49bb78){return new BPromise(function(_0x5d0f19,_0x914124){request(_0x5d9a95)['then'](function(_0x3ba7b0){var _0xbb52b8=null;if(_0x3ba7b0){_0xbb52b8=_0x3ba7b0[_0x8fb6('0x3e')][0x0];_0xbb52b8[_0x8fb6('0x3f')]=_0x49bb78;}_0x5d0f19(_0xbb52b8);})[_0x8fb6('0x40')](function(_0x4afd16){_0x914124(_0x4afd16);});});}function createEndUser(_0x2f9ace,_0x5cb781,_0x44e1d2,_0x3ab93b,_0xc09e67,_0x2f35ea){var _0x44e1d2=getName(_0x44e1d2);return request({'method':_0x8fb6('0x41'),'uri':_0x8fb6('0x42')+_0x5cb781+'/crm/v2/'+_[_0x8fb6('0x43')](_0x2f35ea[_0x8fb6('0x44')])+'s','body':{'data':[{'Last_Name':_0x44e1d2[0x1],'First_Name':_0x44e1d2[0x0],'Phone':_0x3ab93b,'Owner':{'name':!_[_0x8fb6('0x1c')](_0xc09e67[_0x8fb6('0x45')][_0x8fb6('0x19')])?_0xc09e67[_0x8fb6('0x45')][_0x8fb6('0x19')]:!_['isNil'](_0xc09e67['first_name'])?_0xc09e67[_0x8fb6('0x46')]+'\x20'+_0xc09e67['last_name']:_0xc09e67[_0x8fb6('0x47')],'id':_0xc09e67['id']}}]},'headers':{'Authorization':_0x8fb6('0x30')+_0x2f9ace},'json':!![]})[_0x8fb6('0x31')](function(_0x538f6a){if(_0x538f6a&&_0x538f6a[_0x8fb6('0x3e')][0x0]['code']===_0x8fb6('0x48')){var _0x473842=_0x538f6a[_0x8fb6('0x3e')][0x0][_0x8fb6('0x49')];_0x473842['enduserType']=_[_0x8fb6('0x43')](_0x2f35ea['moduleCreate'])+'s';return _0x473842;}logger[_0x8fb6('0x2a')]('The\x20failing\x20result\x20is',JSON[_0x8fb6('0x3d')](data));throw new Error(_0x8fb6('0x4a')+JSON[_0x8fb6('0x3d')](data));})[_0x8fb6('0x40')](function(_0x16bac8){console[_0x8fb6('0x4b')](_0x8fb6('0x4c'),_0x16bac8);});}function getEndUser(_0x2a14f4,_0x1f6a8b,_0x40d9e9,_0x1da559,_0x1a8c3b,_0x37b272,_0x3d1cfc){var _0x235d96={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a14f4},'json':!![]};switch(_0x3d1cfc[_0x8fb6('0x4d')]){case _0x8fb6('0x4e'):_0x235d96[_0x8fb6('0x4f')]=_0x8fb6('0x42')+_0x1f6a8b+_0x8fb6('0x50')+_0x1a8c3b+'))';return getZohoUser(_0x235d96,_0x8fb6('0x51'))[_0x8fb6('0x31')](function(_0x16ae9d){if(_0x16ae9d)return _0x16ae9d;_0x235d96[_0x8fb6('0x4f')]='https://www.zohoapis.'+_0x1f6a8b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1a8c3b+'))';return getZohoUser(_0x235d96,_0x8fb6('0x52'))[_0x8fb6('0x31')](function(_0x183432){if(_0x183432)return _0x183432;if(_0x3d1cfc[_0x8fb6('0x44')]!=_0x8fb6('0x53')){return createEndUser(_0x2a14f4,_0x1f6a8b,_0x1da559,_0x1a8c3b,_0x37b272,_0x3d1cfc);}else{return{};}});});break;case _0x8fb6('0x54'):_0x235d96['uri']=_0x8fb6('0x42')+_0x1f6a8b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1a8c3b+'))';return getZohoUser(_0x235d96,_0x8fb6('0x51'))[_0x8fb6('0x31')](function(_0x58f7fe){if(_0x58f7fe)return _0x58f7fe;if(_0x3d1cfc['moduleCreate']!=_0x8fb6('0x53')){return createEndUser(_0x2a14f4,_0x1f6a8b,_0x1da559,_0x1a8c3b,_0x37b272,_0x3d1cfc);}else{return{};}});break;case _0x8fb6('0x55'):_0x235d96[_0x8fb6('0x4f')]=_0x8fb6('0x42')+_0x1f6a8b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1a8c3b+'))';return getZohoUser(_0x235d96,_0x8fb6('0x52'))[_0x8fb6('0x31')](function(_0x5b7f71){if(_0x5b7f71)return _0x5b7f71;if(_0x3d1cfc[_0x8fb6('0x44')]!=_0x8fb6('0x53')){return createEndUser(_0x2a14f4,_0x1f6a8b,_0x1da559,_0x1a8c3b,_0x37b272,_0x3d1cfc);}else{return{};}});break;}}function getCall(_0x205983,_0x42e2a8,_0x5d9957,_0x2e056a,_0x3819b4,_0x4247f7,_0x3cd4af,_0x3ffff9){logger[_0x8fb6('0x2d')](_0x8fb6('0x56'));var _0x2fc4e3={};_0x2fc4e3[_0x8fb6('0x57')]={'name':!_[_0x8fb6('0x1c')](_0x2e056a[_0x8fb6('0x45')]['name'])&&!_['isNil'](_0x2e056a[_0x8fb6('0x38')][_0x8fb6('0x19')])&&_0x2e056a[_0x8fb6('0x38')][_0x8fb6('0x19')]===_0x8fb6('0x58')?_0x2e056a[_0x8fb6('0x45')][_0x8fb6('0x19')]:!_[_0x8fb6('0x1c')](_0x2e056a['first_name'])?_0x2e056a[_0x8fb6('0x46')]+'\x20'+_0x2e056a[_0x8fb6('0x47')]:_0x2e056a['last_name'],'id':_0x2e056a['id']};_0x2fc4e3[_0x8fb6('0x59')]=intUtil[_0x8fb6('0x5a')](_0x4247f7['Subjects'],_0x3cd4af,'\x20');_0x2fc4e3[_0x8fb6('0x5b')]=intUtil[_0x8fb6('0x5a')](_0x4247f7[_0x8fb6('0x5c')],_0x3cd4af,'\x0a');if(_0x3819b4[_0x8fb6('0x3f')]===_0x8fb6('0x51')){_0x2fc4e3[_0x8fb6('0x5d')]={'name':!_[_0x8fb6('0x1c')](_0x3819b4[_0x8fb6('0x5e')])?_0x3819b4[_0x8fb6('0x5e')]:!_[_0x8fb6('0x1c')](_0x3819b4[_0x8fb6('0x5f')])?_0x3819b4[_0x8fb6('0x5f')]+'\x20'+_0x3819b4[_0x8fb6('0x60')]:_0x3819b4['Last_Name'],'id':_0x3819b4['id']};}if(_0x3819b4[_0x8fb6('0x3f')]==='Leads'){_0x2fc4e3[_0x8fb6('0x61')]={'name':!_['isNil'](_0x3819b4[_0x8fb6('0x5e')])?_0x3819b4[_0x8fb6('0x5e')]:!_[_0x8fb6('0x1c')](_0x3819b4['First_Name'])?_0x3819b4[_0x8fb6('0x5f')]+'\x20'+_0x3819b4[_0x8fb6('0x60')]:_0x3819b4[_0x8fb6('0x60')],'id':_0x3819b4['id']};_0x2fc4e3[_0x8fb6('0x62')]=_[_0x8fb6('0x43')](_0x3819b4[_0x8fb6('0x3f')]);}if(_0x3cd4af[_0x8fb6('0x63')]){_0x2fc4e3[_0x8fb6('0x64')]=moment[_0x8fb6('0x65')](parseInt(_0x3cd4af[_0x8fb6('0x63')])*0x3e8)['format'](_0x8fb6('0x66'));}else if(_0x3cd4af[_0x8fb6('0x67')]&&_0x3cd4af['endtime']){_0x2fc4e3[_0x8fb6('0x64')]=moment[_0x8fb6('0x65')](moment(_0x3cd4af[_0x8fb6('0x68')],_0x8fb6('0x69'))[_0x8fb6('0x6a')](moment(_0x3cd4af['starttime'],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x8fb6('0x66'));}switch(_0x3cd4af[_0x8fb6('0x6b')]){case _0x8fb6('0x6c'):_0x2fc4e3[_0x8fb6('0x6d')]='Called';break;case'complete':case _0x8fb6('0x6e'):_0x2fc4e3['Call_Result']='Answered';break;case _0x8fb6('0x6f'):_0x2fc4e3[_0x8fb6('0x6d')]=_0x8fb6('0x70');break;case _0x8fb6('0x71'):_0x2fc4e3['Call_Result']=_0x8fb6('0x72');break;case _0x8fb6('0x73'):_0x2fc4e3[_0x8fb6('0x6d')]=_0x8fb6('0x74');default:}_0x2fc4e3[_0x8fb6('0x75')]=(_0x3ffff9===_0x8fb6('0x76')?moment(_0x3cd4af[_0x8fb6('0x77')])[_0x8fb6('0x78')](_0x8fb6('0x69')):moment(_0x3cd4af[_0x8fb6('0x79')])[_0x8fb6('0x78')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x8fb6('0x78')](_0x8fb6('0x69'));_0x2fc4e3[_0x8fb6('0x7a')]=_0x3ffff9||_0x8fb6('0x7b');_0x2fc4e3=_[_0x8fb6('0x7c')](_0x2fc4e3,getCustomFields(_0x4247f7[_0x8fb6('0x7d')],_0x3cd4af));return request({'method':'POST','uri':_0x8fb6('0x42')+_0x42e2a8+_0x8fb6('0x7e'),'headers':{'Authorization':_0x8fb6('0x30')+_0x205983},'body':{'data':[_0x2fc4e3]},'json':!![]})[_0x8fb6('0x31')](function(_0x1cacb6){if(_0x1cacb6&&_0x1cacb6['data'][0x0][_0x8fb6('0x7f')]===_0x8fb6('0x48')){logger[_0x8fb6('0x2d')](_0x8fb6('0x80'));return{'id':_0x1cacb6['data'][0x0][_0x8fb6('0x49')]['id']};}})[_0x8fb6('0x40')](function(_0x29780d){logger[_0x8fb6('0x2d')](_0x8fb6('0x81'),_0x29780d[_0x8fb6('0x2c')]);console[_0x8fb6('0x4b')](_0x8fb6('0x81'),_0x29780d);});}exports['queue']=function(_0x5e6241,_0x306b3d,_0x53264a,_0x493e01,_0x189a03,_0x54f193){var _0x542ca6,_0x1a5442,_0x53914a;_0x54f193[_0x8fb6('0x82')]=intUtil[_0x8fb6('0x83')](_0x54f193[_0x8fb6('0x82')]);_0x54f193[_0x8fb6('0x84')]=intUtil[_0x8fb6('0x83')](_0x54f193['serverUrl']);if(_0x189a03&&_0x189a03[_0x8fb6('0x85')]){logger[_0x8fb6('0x2d')](_0x8fb6('0x86'),_0x8fb6('0x87'));_0x306b3d[_0x8fb6('0x88')]=_0x54f193[_0x8fb6('0x84')]+_0x8fb6('0x89')+_0x306b3d[_0x8fb6('0x8a')]+_0x8fb6('0x8b')+md5(_0x306b3d[_0x8fb6('0x8a')]);}else{_0x306b3d[_0x8fb6('0x88')]='';}var _0x29c942=_0x54f193[_0x8fb6('0x82')]===_0x8fb6('0x8c')?'eu':_0x8fb6('0x8d');return getAccessToken(_0x54f193)[_0x8fb6('0x31')](function(_0x557c52){_0x53914a=_0x557c52;return getUser(_0x53914a,_0x29c942,_0x54f193,_0x493e01['email']);})[_0x8fb6('0x31')](function(_0x5963eb){_0x542ca6=_0x5963eb;logger[_0x8fb6('0x2d')](_0x8fb6('0x8e'),_0x542ca6['id']);return getEndUser(_0x53914a,_0x29c942,_0x54f193,_0x306b3d[_0x8fb6('0x8f')],_0x306b3d['calleridnum'],_0x542ca6,_0x53264a);})[_0x8fb6('0x31')](function(_0x359612){_0x1a5442=_0x359612;return getCall(_0x53914a,_0x29c942,_0x54f193,_0x542ca6,_0x1a5442,_0x53264a,_0x306b3d,_0x8fb6('0x7b'));})[_0x8fb6('0x31')](function(_0x48d910){if(_0x48d910){logger['info'](_0x8fb6('0x90'),_0x48d910['id']);logger[_0x8fb6('0x2d')]('[QUEUE]',_0x8fb6('0x91'));emit(util[_0x8fb6('0x78')](_0x8fb6('0x92'),_0x493e01[_0x8fb6('0x19')]),_0x8fb6('0x93'),{'uri':_0x8fb6('0x94')+_0x54f193[_0x8fb6('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x48d910['id']});}})[_0x8fb6('0x40')](function(_0x537215){logger[_0x8fb6('0x2a')](_0x8fb6('0x86'),JSON[_0x8fb6('0x3d')](_0x537215));});};exports['outbound']=function(_0x146af3,_0x3ba759,_0x37f220,_0x4ac827,_0x5c5a25,_0x1881b5,_0x335704){var _0x56f608,_0x21c7ff,_0x566cca;_0x1881b5['host']=intUtil[_0x8fb6('0x83')](_0x1881b5[_0x8fb6('0x82')]);_0x1881b5[_0x8fb6('0x84')]=intUtil[_0x8fb6('0x83')](_0x1881b5['serverUrl']);if(_0x335704&&_0x335704['recordingFormat']&&_0x335704['recordingFormat']!==_0x8fb6('0x95')){logger[_0x8fb6('0x2d')](_0x8fb6('0x96'),_0x8fb6('0x87'));_0x3ba759[_0x8fb6('0x88')]=_0x1881b5[_0x8fb6('0x84')]+_0x8fb6('0x89')+_0x3ba759[_0x8fb6('0x8a')]+_0x8fb6('0x8b')+md5(_0x3ba759[_0x8fb6('0x8a')]);}var _0x301f41=_0x1881b5[_0x8fb6('0x82')]==='zoho.eu'?'eu':_0x8fb6('0x8d');return getAccessToken(_0x1881b5)[_0x8fb6('0x31')](function(_0x51caea){_0x566cca=_0x51caea;return getUser(_0x566cca,_0x301f41,_0x1881b5,_0x4ac827[_0x8fb6('0x35')]);})[_0x8fb6('0x31')](function(_0x11193f){_0x56f608=_0x11193f;logger['info']('The\x20User\x20ID\x20is:',_0x56f608['id']);return getEndUser(_0x566cca,_0x301f41,_0x1881b5,_0x3ba759['destcalleridname'],_0x3ba759[_0x8fb6('0x97')],_0x56f608,_0x37f220);})['then'](function(_0x425542){_0x21c7ff=_0x425542;return getCall(_0x566cca,_0x301f41,_0x1881b5,_0x56f608,_0x21c7ff,_0x37f220,_0x3ba759,_0x8fb6('0x98'));})[_0x8fb6('0x31')](function(_0x59e89a){if(_0x59e89a){logger[_0x8fb6('0x2d')]('The\x20Call\x20ID\x20is:',_0x59e89a['id']);logger[_0x8fb6('0x2d')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8fb6('0x78')]('user:%s',_0x4ac827[_0x8fb6('0x19')]),_0x8fb6('0x93'),{'uri':'https://crm.'+_0x1881b5[_0x8fb6('0x82')]+_0x8fb6('0x99')+_0x59e89a['id']});}})[_0x8fb6('0x40')](function(_0x504972){logger[_0x8fb6('0x2a')](_0x8fb6('0x96'),JSON['stringify'](_0x504972));});};exports[_0x8fb6('0x9a')]=function(_0x308b59,_0x27d85a,_0x3dc917,_0x363bb9,_0x26d3df,_0x3156b2){var _0x26ba9a,_0x29ad88,_0x24004c;_0x3156b2[_0x8fb6('0x82')]=intUtil[_0x8fb6('0x83')](_0x3156b2['host']);_0x3156b2[_0x8fb6('0x84')]=intUtil['stripTrailingSlash'](_0x3156b2[_0x8fb6('0x84')]);if(_0x26d3df&&_0x26d3df[_0x8fb6('0x85')]){logger['info']('['+_0x27d85a[_0x8fb6('0x6b')][_0x8fb6('0x9b')]()+']',_0x8fb6('0x87'));_0x27d85a[_0x8fb6('0x88')]=_0x3156b2[_0x8fb6('0x84')]+'/api/voice/recordings/'+_0x27d85a[_0x8fb6('0x8a')]+_0x8fb6('0x8b')+md5(_0x27d85a['uniqueid']);}else{_0x27d85a['recordingURL']='';}var _0x34b814=_0x3156b2[_0x8fb6('0x82')]===_0x8fb6('0x8c')?'eu':_0x8fb6('0x8d');return getAccessToken(_0x3156b2)[_0x8fb6('0x31')](function(_0x35bb88){_0x24004c=_0x35bb88;return getUser(_0x24004c,_0x34b814,_0x3156b2);})[_0x8fb6('0x31')](function(_0x499313){_0x26ba9a=_0x499313;logger[_0x8fb6('0x2d')](_0x8fb6('0x8e'),_0x26ba9a['id']);return getEndUser(_0x24004c,_0x34b814,_0x3156b2,_0x27d85a[_0x8fb6('0x8f')],_0x27d85a['calleridnum'],_0x26ba9a,_0x3dc917);})['then'](function(_0x52966d){_0x29ad88=_0x52966d;return getCall(_0x24004c,_0x34b814,_0x3156b2,_0x26ba9a,_0x29ad88,_0x3dc917,_0x27d85a,_0x8fb6('0x7b'));})[_0x8fb6('0x31')](function(_0x4eaa15){if(_0x4eaa15){logger[_0x8fb6('0x2d')](_0x8fb6('0x90'),_0x4eaa15['id']);}})[_0x8fb6('0x40')](function(_0x45a280){logger[_0x8fb6('0x2a')]('['+_0x27d85a['lastevent'][_0x8fb6('0x9b')]()+']',JSON[_0x8fb6('0x3d')](_0x45a280));});}; \ No newline at end of file +var _0xc230=['clientSecret','refresh_token','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','then','users','findIndex','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','uri','nothing','lead','Owner','role','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','merge','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','email','The\x20User\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','calleridname','calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','clientId'];(function(_0x10793a,_0xac3c28){var _0x570a2e=function(_0x55a7e4){while(--_0x55a7e4){_0x10793a['push'](_0x10793a['shift']());}};_0x570a2e(++_0xac3c28);}(_0xc230,0x75));var _0x0c23=function(_0x5afebb,_0x2e8293){_0x5afebb=_0x5afebb-0x0;var _0x33e027=_0xc230[_0x5afebb];return _0x33e027;};'use strict';var _=require(_0x0c23('0x0'));var rp=require(_0x0c23('0x1'));var md5=require(_0x0c23('0x2'));var util=require(_0x0c23('0x3'));var intUtil=require(_0x0c23('0x4'));var moment=require(_0x0c23('0x5'));var Redis=require(_0x0c23('0x6'));var BPromise=require(_0x0c23('0x7'));var config=require(_0x0c23('0x8'));var logger=require(_0x0c23('0x9'))(_0x0c23('0xa'));config[_0x0c23('0xb')]=_[_0x0c23('0xc')](config[_0x0c23('0xb')],{'host':_0x0c23('0xd'),'port':0x18eb});var io=require(_0x0c23('0xe'))(new Redis(config['redis']));function emit(_0x896835,_0x284c7c,_0x2e4b29){io['to'](_0x896835)[_0x0c23('0xf')](_0x284c7c,_0x2e4b29);}function request(_0x551bc0){logger['debug'](_0x0c23('0x10'),JSON[_0x0c23('0x11')](_0x551bc0));return rp(_0x551bc0);}function getCustomFields(_0x1a91a8,_0x403e2e){var _0x2a2c2b={};if(_0x1a91a8[_0x0c23('0x12')]>0x0){_[_0x0c23('0x13')](_0x1a91a8,function(_0x2f5033){if(_[_0x0c23('0x14')]([_0x0c23('0x15'),_0x0c23('0x16')],_0x2f5033[_0x0c23('0x17')])&&_0x2f5033[_0x0c23('0x18')]){_0x2a2c2b[_0x2f5033[_0x0c23('0x18')]]=_0x2f5033[_0x0c23('0x19')][_0x0c23('0x1a')]();}else if(_0x2f5033[_0x0c23('0x17')]===_0x0c23('0x1b')&&_0x2f5033[_0x0c23('0x1c')]&&_0x2f5033['idField']&&_0x403e2e[_0x2f5033[_0x0c23('0x1c')]]){_0x2a2c2b[_0x2f5033[_0x0c23('0x18')]]=_0x403e2e[_0x2f5033['variableName']][_0x0c23('0x1a')]();}else if(_0x2f5033[_0x0c23('0x17')]===_0x0c23('0x1d')&&_0x2f5033[_0x0c23('0x1e')]&&_0x2f5033[_0x0c23('0x1e')][_0x0c23('0x1f')]&&_0x2f5033[_0x0c23('0x18')]&&_0x403e2e[_0x2f5033[_0x0c23('0x1e')]['name'][_0x0c23('0x20')]()]){_0x2a2c2b[_0x2f5033[_0x0c23('0x18')]]=_0x403e2e[_0x2f5033[_0x0c23('0x1e')][_0x0c23('0x1f')][_0x0c23('0x20')]()]['toString']();}});}return _0x2a2c2b;}function getName(_0x14646d){if(_0x14646d[_0x0c23('0x21')]('\x20')>0x0){var _0x1f2e8f=_0x14646d[_0x0c23('0x22')](/ (.+)/);if(_0x1f2e8f[0x1]){return _0x1f2e8f;}}return[_0x14646d,_0x14646d];}var accountsTokens={};function getAccessToken(_0x4d1c75){return new Promise(function(_0x5e00e5,_0x4b8981){if(!_[_0x0c23('0x23')](accountsTokens[_0x4d1c75['id']])&&!_['isNil'](accountsTokens[_0x4d1c75['id']][_0x0c23('0x24')])){if(moment()[_0x0c23('0x25')](accountsTokens[_0x4d1c75['id']][_0x0c23('0x26')])){_0x5e00e5(accountsTokens[_0x4d1c75['id']]['access_token']);}}var _0x3cc66a;switch(_0x4d1c75[_0x0c23('0x27')]){case'US':_0x3cc66a=_0x0c23('0x28');break;case'AU':_0x3cc66a=_0x0c23('0x29');break;case'EU':_0x3cc66a='https://accounts.zoho.eu';break;case'IN':_0x3cc66a=_0x0c23('0x2a');break;case'CN':_0x3cc66a=_0x0c23('0x2b');break;default:_0x3cc66a=_0x0c23('0x2c');break;}var _0x5d6c82={'method':'POST','uri':_0x3cc66a+_0x0c23('0x2d'),'qs':{'refresh_token':_0x4d1c75['refreshToken'],'client_id':_0x4d1c75[_0x0c23('0x2e')],'client_secret':_0x4d1c75[_0x0c23('0x2f')],'grant_type':_0x0c23('0x30')},'json':!![]};return rp(_0x5d6c82)['then'](function(_0x50c4a9){accountsTokens[_0x4d1c75['id']]={'access_token':_0x50c4a9[_0x0c23('0x24')],'expires_in':moment()['add'](_0x50c4a9['expires_in'],'seconds')};_0x5e00e5(_0x50c4a9[_0x0c23('0x24')]);})[_0x0c23('0x31')](function(_0x599c9a){logger[_0x0c23('0x32')]('Failing\x20creating\x20the\x20access_token',_0x599c9a[_0x0c23('0x33')]);_0x4b8981(_0x599c9a);});});}function getUser(_0x2ce05b,_0x4aa946,_0x33f494,_0x3af457){logger[_0x0c23('0x34')](_0x0c23('0x35'));return request({'method':_0x0c23('0x36'),'uri':util[_0x0c23('0x37')]('https://www.zohoapis.%s/crm/v2/users',_0x4aa946),'qs':{'type':_0x0c23('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ce05b},'json':!![]})[_0x0c23('0x39')](function(_0xda1ea0){if(_0xda1ea0[_0x0c23('0x3a')]){var _0x440c4d=-0x1;if(_['isArrayLikeObject'](_0xda1ea0[_0x0c23('0x3a')])){if(!_[_0x0c23('0x23')](_0x3af457)){_0x440c4d=_[_0x0c23('0x3b')](_0xda1ea0['users'],function(_0x4033b5){return _0x4033b5['email']===_0x3af457;});}if(_0x440c4d>=0x0){logger[_0x0c23('0x34')]('Agent\x20found!');}else{logger[_0x0c23('0x34')](_0x0c23('0x3c'));_0x440c4d=_[_0x0c23('0x3b')](_0xda1ea0[_0x0c23('0x3a')],function(_0x46f41b){return _0x46f41b['profile'][_0x0c23('0x1f')]===_0x0c23('0x3d');});}return _0xda1ea0[_0x0c23('0x3a')][_0x440c4d];}else{if(_0xda1ea0['user']['profile'][_0x0c23('0x1f')]===_0x0c23('0x3d')){logger[_0x0c23('0x34')](_0x0c23('0x3c'));user=_0xda1ea0[_0x0c23('0x3e')];return user;}else{logger[_0x0c23('0x32')](_0x0c23('0x3f'),JSON[_0x0c23('0x11')](_0xda1ea0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x0c23('0x11')](_0xda1ea0));}}}else{logger[_0x0c23('0x32')](_0x0c23('0x3f'),JSON['stringify'](_0xda1ea0));throw new Error(_0x0c23('0x40')+JSON[_0x0c23('0x11')](_0xda1ea0));}})[_0x0c23('0x31')](function(_0x120125){console[_0x0c23('0x32')](_0x120125);});}function getZohoUser(_0x49c3cf,_0x5c829f){return new BPromise(function(_0x3fc927,_0x30bb16){request(_0x49c3cf)[_0x0c23('0x39')](function(_0x30317c){var _0x4ee0df=null;if(_0x30317c){_0x4ee0df=_0x30317c[_0x0c23('0x41')][0x0];_0x4ee0df['enduserType']=_0x5c829f;}_0x3fc927(_0x4ee0df);})['catch'](function(_0x525e49){_0x30bb16(_0x525e49);});});}function createEndUser(_0x2d7bd1,_0x3495d4,_0x378fdf,_0xf01a36,_0x21fa7f,_0x4be8df){var _0x378fdf=getName(_0x378fdf);return request({'method':_0x0c23('0x42'),'uri':_0x0c23('0x43')+_0x3495d4+_0x0c23('0x44')+_[_0x0c23('0x45')](_0x4be8df[_0x0c23('0x46')])+'s','body':{'data':[{'Last_Name':_0x378fdf[0x1],'First_Name':_0x378fdf[0x0],'Phone':_0xf01a36,'Owner':{'name':!_[_0x0c23('0x23')](_0x21fa7f['role'][_0x0c23('0x1f')])?_0x21fa7f['role']['name']:!_[_0x0c23('0x23')](_0x21fa7f[_0x0c23('0x47')])?_0x21fa7f['first_name']+'\x20'+_0x21fa7f[_0x0c23('0x48')]:_0x21fa7f[_0x0c23('0x48')],'id':_0x21fa7f['id']}}]},'headers':{'Authorization':_0x0c23('0x49')+_0x2d7bd1},'json':!![]})[_0x0c23('0x39')](function(_0xe8615e){if(_0xe8615e&&_0xe8615e['data'][0x0]['code']===_0x0c23('0x4a')){var _0xd140d2=_0xe8615e[_0x0c23('0x41')][0x0][_0x0c23('0x4b')];_0xd140d2[_0x0c23('0x4c')]=_[_0x0c23('0x45')](_0x4be8df['moduleCreate'])+'s';return _0xd140d2;}logger[_0x0c23('0x32')](_0x0c23('0x3f'),JSON[_0x0c23('0x11')](data));throw new Error(_0x0c23('0x4d')+JSON[_0x0c23('0x11')](data));})[_0x0c23('0x31')](function(_0x42615e){console[_0x0c23('0x4e')](_0x0c23('0x4f'),_0x42615e);});}function getEndUser(_0x13b835,_0x390040,_0x157020,_0x2eaa46,_0x3789ce,_0xe11391,_0x3b3b69){var _0x1b9534={'method':_0x0c23('0x36'),'uri':'','headers':{'Authorization':_0x0c23('0x49')+_0x13b835},'json':!![]};switch(_0x3b3b69[_0x0c23('0x50')]){case _0x0c23('0x51'):_0x1b9534['uri']=_0x0c23('0x43')+_0x390040+_0x0c23('0x52')+_0x3789ce+'))';return getZohoUser(_0x1b9534,_0x0c23('0x53'))[_0x0c23('0x39')](function(_0x21d0c9){if(_0x21d0c9)return _0x21d0c9;_0x1b9534['uri']='https://www.zohoapis.'+_0x390040+_0x0c23('0x54')+_0x3789ce+'))';return getZohoUser(_0x1b9534,_0x0c23('0x55'))['then'](function(_0x1763e2){if(_0x1763e2)return _0x1763e2;if(_0x3b3b69[_0x0c23('0x46')]!='nothing'){return createEndUser(_0x13b835,_0x390040,_0x2eaa46,_0x3789ce,_0xe11391,_0x3b3b69);}else{return{};}});});break;case _0x0c23('0x56'):_0x1b9534[_0x0c23('0x57')]=_0x0c23('0x43')+_0x390040+_0x0c23('0x52')+_0x3789ce+'))';return getZohoUser(_0x1b9534,_0x0c23('0x53'))[_0x0c23('0x39')](function(_0x3a8f71){if(_0x3a8f71)return _0x3a8f71;if(_0x3b3b69['moduleCreate']!=_0x0c23('0x58')){return createEndUser(_0x13b835,_0x390040,_0x2eaa46,_0x3789ce,_0xe11391,_0x3b3b69);}else{return{};}});break;case _0x0c23('0x59'):_0x1b9534['uri']=_0x0c23('0x43')+_0x390040+_0x0c23('0x54')+_0x3789ce+'))';return getZohoUser(_0x1b9534,_0x0c23('0x55'))[_0x0c23('0x39')](function(_0x1e81ca){if(_0x1e81ca)return _0x1e81ca;if(_0x3b3b69[_0x0c23('0x46')]!=_0x0c23('0x58')){return createEndUser(_0x13b835,_0x390040,_0x2eaa46,_0x3789ce,_0xe11391,_0x3b3b69);}else{return{};}});break;}}function getCall(_0x3fed9c,_0x105ead,_0x18080e,_0x4e8027,_0x3c1e62,_0x5ff774,_0x4c309a,_0x5f210a){logger['info']('Creating\x20new\x20call...');var _0x936365={};_0x936365[_0x0c23('0x5a')]={'name':!_[_0x0c23('0x23')](_0x4e8027[_0x0c23('0x5b')][_0x0c23('0x1f')])&&!_[_0x0c23('0x23')](_0x4e8027[_0x0c23('0x5c')]['name'])&&_0x4e8027['profile']['name']===_0x0c23('0x5d')?_0x4e8027[_0x0c23('0x5b')][_0x0c23('0x1f')]:!_['isNil'](_0x4e8027['first_name'])?_0x4e8027[_0x0c23('0x47')]+'\x20'+_0x4e8027[_0x0c23('0x48')]:_0x4e8027[_0x0c23('0x48')],'id':_0x4e8027['id']};_0x936365[_0x0c23('0x5e')]=intUtil[_0x0c23('0x5f')](_0x5ff774[_0x0c23('0x60')],_0x4c309a,'\x20');_0x936365[_0x0c23('0x61')]=intUtil[_0x0c23('0x5f')](_0x5ff774[_0x0c23('0x62')],_0x4c309a,'\x0a');if(_0x3c1e62[_0x0c23('0x4c')]===_0x0c23('0x53')){_0x936365[_0x0c23('0x63')]={'name':!_[_0x0c23('0x23')](_0x3c1e62[_0x0c23('0x64')])?_0x3c1e62[_0x0c23('0x64')]:!_[_0x0c23('0x23')](_0x3c1e62['First_Name'])?_0x3c1e62[_0x0c23('0x65')]+'\x20'+_0x3c1e62[_0x0c23('0x66')]:_0x3c1e62[_0x0c23('0x66')],'id':_0x3c1e62['id']};}if(_0x3c1e62[_0x0c23('0x4c')]===_0x0c23('0x55')){_0x936365[_0x0c23('0x67')]={'name':!_['isNil'](_0x3c1e62[_0x0c23('0x64')])?_0x3c1e62['Full_Name']:!_[_0x0c23('0x23')](_0x3c1e62[_0x0c23('0x65')])?_0x3c1e62[_0x0c23('0x65')]+'\x20'+_0x3c1e62[_0x0c23('0x66')]:_0x3c1e62[_0x0c23('0x66')],'id':_0x3c1e62['id']};_0x936365[_0x0c23('0x68')]=_[_0x0c23('0x45')](_0x3c1e62['enduserType']);}if(_0x4c309a[_0x0c23('0x69')]){_0x936365[_0x0c23('0x6a')]=moment[_0x0c23('0x6b')](parseInt(_0x4c309a[_0x0c23('0x69')])*0x3e8)[_0x0c23('0x37')](_0x0c23('0x6c'));}else if(_0x4c309a[_0x0c23('0x6d')]&&_0x4c309a[_0x0c23('0x6e')]){_0x936365[_0x0c23('0x6a')]=moment[_0x0c23('0x6b')](moment(_0x4c309a[_0x0c23('0x6e')],_0x0c23('0x6f'))[_0x0c23('0x70')](moment(_0x4c309a[_0x0c23('0x71')],_0x0c23('0x6f'))))['format'](_0x0c23('0x6c'));}switch(_0x4c309a[_0x0c23('0x72')]){case _0x0c23('0x73'):_0x936365['Call_Result']=_0x0c23('0x74');break;case _0x0c23('0x75'):case _0x0c23('0x76'):_0x936365[_0x0c23('0x77')]=_0x0c23('0x78');break;case'rejected':_0x936365['Call_Result']=_0x0c23('0x79');break;case _0x0c23('0x7a'):_0x936365[_0x0c23('0x77')]=_0x0c23('0x7b');break;case _0x0c23('0x7c'):_0x936365[_0x0c23('0x77')]=_0x0c23('0x7d');default:}_0x936365['Call_Start_Time']=(_0x5f210a===_0x0c23('0x7e')?moment(_0x4c309a[_0x0c23('0x71')])[_0x0c23('0x37')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4c309a[_0x0c23('0x7f')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x0c23('0x37')]('YYYY-MM-DDTHH:mm:ss');_0x936365[_0x0c23('0x80')]=_0x5f210a||'Inbound';_0x936365=_[_0x0c23('0x81')](_0x936365,getCustomFields(_0x5ff774['Fields'],_0x4c309a));return request({'method':_0x0c23('0x42'),'uri':_0x0c23('0x43')+_0x105ead+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3fed9c},'body':{'data':[_0x936365]},'json':!![]})['then'](function(_0x5f53e1){if(_0x5f53e1&&_0x5f53e1[_0x0c23('0x41')][0x0][_0x0c23('0x82')]===_0x0c23('0x4a')){logger[_0x0c23('0x34')](_0x0c23('0x83'));return{'id':_0x5f53e1['data'][0x0][_0x0c23('0x4b')]['id']};}})['catch'](function(_0x2ac25c){logger[_0x0c23('0x34')](_0x0c23('0x84'),_0x2ac25c[_0x0c23('0x33')]);console[_0x0c23('0x4e')](_0x0c23('0x84'),_0x2ac25c);});}exports[_0x0c23('0x85')]=function(_0x51ca82,_0x226a44,_0x358d3c,_0x532e58,_0x530789,_0x43559a){var _0x555a2a,_0x4c6009,_0x2f3919;_0x43559a[_0x0c23('0x86')]=intUtil[_0x0c23('0x87')](_0x43559a[_0x0c23('0x86')]);_0x43559a[_0x0c23('0x88')]=intUtil[_0x0c23('0x87')](_0x43559a[_0x0c23('0x88')]);if(_0x530789&&_0x530789[_0x0c23('0x89')]){logger['info']('[QUEUE]',_0x0c23('0x8a'));_0x226a44[_0x0c23('0x8b')]=_0x43559a[_0x0c23('0x88')]+_0x0c23('0x8c')+_0x226a44['uniqueid']+_0x0c23('0x8d')+md5(_0x226a44[_0x0c23('0x8e')]);}else{_0x226a44['recordingURL']='';}var _0x1b20d2=_0x43559a['host']==='zoho.eu'?'eu':_0x0c23('0x8f');return getAccessToken(_0x43559a)[_0x0c23('0x39')](function(_0xbf05d5){_0x2f3919=_0xbf05d5;return getUser(_0x2f3919,_0x1b20d2,_0x43559a,_0x532e58[_0x0c23('0x90')]);})[_0x0c23('0x39')](function(_0x18baef){_0x555a2a=_0x18baef;logger['info'](_0x0c23('0x91'),_0x555a2a['id']);return getEndUser(_0x2f3919,_0x1b20d2,_0x43559a,_0x226a44['calleridname'],_0x226a44['calleridnum'],_0x555a2a,_0x358d3c);})[_0x0c23('0x39')](function(_0x5d9904){_0x4c6009=_0x5d9904;return getCall(_0x2f3919,_0x1b20d2,_0x43559a,_0x555a2a,_0x4c6009,_0x358d3c,_0x226a44,_0x0c23('0x92'));})[_0x0c23('0x39')](function(_0x311a0d){if(_0x311a0d){logger[_0x0c23('0x34')](_0x0c23('0x93'),_0x311a0d['id']);logger[_0x0c23('0x34')](_0x0c23('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0c23('0x37')]('user:%s',_0x532e58[_0x0c23('0x1f')]),_0x0c23('0x95'),{'uri':_0x0c23('0x96')+_0x43559a['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x311a0d['id']});}})[_0x0c23('0x31')](function(_0x5be832){logger[_0x0c23('0x32')](_0x0c23('0x94'),JSON[_0x0c23('0x11')](_0x5be832));});};exports[_0x0c23('0x7e')]=function(_0x261b88,_0x3a3d00,_0xee9064,_0x3bc7ae,_0x2abe00,_0x51ece6,_0x2d5e82){var _0x2fe9a8,_0x52eeac,_0x35c7fd;_0x51ece6[_0x0c23('0x86')]=intUtil[_0x0c23('0x87')](_0x51ece6[_0x0c23('0x86')]);_0x51ece6[_0x0c23('0x88')]=intUtil[_0x0c23('0x87')](_0x51ece6['serverUrl']);if(_0x2d5e82&&_0x2d5e82[_0x0c23('0x97')]&&_0x2d5e82[_0x0c23('0x97')]!==_0x0c23('0x98')){logger['info'](_0x0c23('0x99'),'Recording\x20is\x20enabled!');_0x3a3d00[_0x0c23('0x8b')]=_0x51ece6[_0x0c23('0x88')]+'/api/voice/recordings/'+_0x3a3d00[_0x0c23('0x8e')]+'/downloads?type=uniqueid&token='+md5(_0x3a3d00[_0x0c23('0x8e')]);}var _0x593cca=_0x51ece6[_0x0c23('0x86')]===_0x0c23('0x9a')?'eu':_0x0c23('0x8f');return getAccessToken(_0x51ece6)[_0x0c23('0x39')](function(_0x30dbfa){_0x35c7fd=_0x30dbfa;return getUser(_0x35c7fd,_0x593cca,_0x51ece6,_0x3bc7ae['email']);})[_0x0c23('0x39')](function(_0x2c6a8d){_0x2fe9a8=_0x2c6a8d;logger[_0x0c23('0x34')](_0x0c23('0x91'),_0x2fe9a8['id']);return getEndUser(_0x35c7fd,_0x593cca,_0x51ece6,_0x3a3d00[_0x0c23('0x9b')],_0x3a3d00[_0x0c23('0x9c')],_0x2fe9a8,_0xee9064);})[_0x0c23('0x39')](function(_0x420917){_0x52eeac=_0x420917;return getCall(_0x35c7fd,_0x593cca,_0x51ece6,_0x2fe9a8,_0x52eeac,_0xee9064,_0x3a3d00,_0x0c23('0x9d'));})['then'](function(_0x7f8f77){if(_0x7f8f77){logger[_0x0c23('0x34')](_0x0c23('0x93'),_0x7f8f77['id']);logger['info']('[OUTBOUND]',_0x0c23('0x9e'));emit(util[_0x0c23('0x37')](_0x0c23('0x9f'),_0x3bc7ae[_0x0c23('0x1f')]),'trigger:browser:url',{'uri':_0x0c23('0x96')+_0x51ece6[_0x0c23('0x86')]+_0x0c23('0xa0')+_0x7f8f77['id']});}})['catch'](function(_0x152574){logger[_0x0c23('0x32')](_0x0c23('0x99'),JSON['stringify'](_0x152574));});};exports['unmanaged']=function(_0x88584c,_0x2a555b,_0x4479b3,_0x3ca168,_0x206838,_0x383586){var _0x1a2b59,_0x468c23,_0x37047c;_0x383586[_0x0c23('0x86')]=intUtil[_0x0c23('0x87')](_0x383586[_0x0c23('0x86')]);_0x383586['serverUrl']=intUtil['stripTrailingSlash'](_0x383586[_0x0c23('0x88')]);if(_0x206838&&_0x206838['monitor_format']){logger[_0x0c23('0x34')]('['+_0x2a555b[_0x0c23('0x72')][_0x0c23('0xa1')]()+']',_0x0c23('0x8a'));_0x2a555b[_0x0c23('0x8b')]=_0x383586[_0x0c23('0x88')]+_0x0c23('0x8c')+_0x2a555b[_0x0c23('0x8e')]+_0x0c23('0x8d')+md5(_0x2a555b[_0x0c23('0x8e')]);}else{_0x2a555b[_0x0c23('0x8b')]='';}var _0x2c2484=_0x383586[_0x0c23('0x86')]===_0x0c23('0x9a')?'eu':_0x0c23('0x8f');return getAccessToken(_0x383586)[_0x0c23('0x39')](function(_0x18c2ed){_0x37047c=_0x18c2ed;return getUser(_0x37047c,_0x2c2484,_0x383586);})[_0x0c23('0x39')](function(_0x1c09ad){_0x1a2b59=_0x1c09ad;logger[_0x0c23('0x34')]('The\x20User\x20ID\x20is:',_0x1a2b59['id']);return getEndUser(_0x37047c,_0x2c2484,_0x383586,_0x2a555b[_0x0c23('0xa2')],_0x2a555b[_0x0c23('0xa3')],_0x1a2b59,_0x4479b3);})[_0x0c23('0x39')](function(_0x174b4a){_0x468c23=_0x174b4a;return getCall(_0x37047c,_0x2c2484,_0x383586,_0x1a2b59,_0x468c23,_0x4479b3,_0x2a555b,_0x0c23('0x92'));})[_0x0c23('0x39')](function(_0x3327b1){if(_0x3327b1){logger[_0x0c23('0x34')](_0x0c23('0x93'),_0x3327b1['id']);}})['catch'](function(_0x56f3ce){logger[_0x0c23('0x32')]('['+_0x2a555b[_0x0c23('0x72')][_0x0c23('0xa1')]()+']',JSON['stringify'](_0x56f3ce));});}; \ 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 894f810..19756ef 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 _0x8eb5=['../../../../config/logger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8eb5,0xfa));var _0x58eb=function(_0x588360,_0x2feeaf){_0x588360=_0x588360-0x0;var _0x429aaa=_0x8eb5[_0x588360];return _0x429aaa;};'use strict';var util=require(_0x58eb('0x0'));var sh=require(_0x58eb('0x1'));var Mustache=require('mustache');var logger=require(_0x58eb('0x2'))('trigger');exports[_0x58eb('0x3')]=function(_0x45d892,_0x7f99b4){var _0x5bb1b4=_0x45d892[_0x58eb('0x4')]?_0x45d892[_0x58eb('0x4')]:_0x58eb('0x5');var _0x18aa98=_0x45d892['data3']?Mustache[_0x58eb('0x6')](_0x45d892[_0x58eb('0x7')],_0x7f99b4):_0x7f99b4;sh[_0x58eb('0x3')](_0x18aa98,function(_0xa1333,_0x10262d,_0x5441f2){if(_0xa1333!==0x0){logger[_0x58eb('0x8')](util[_0x58eb('0x9')](_0x58eb('0xa'),_0x5bb1b4,_0x18aa98,_0xa1333,_0x5441f2));}else{logger['info'](util['format'](_0x58eb('0xb'),_0x5bb1b4,_0x18aa98,_0x10262d));}});}; \ No newline at end of file +var _0xdf60=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','data2'];(function(_0x5b8685,_0x1a1c28){var _0xa3ef57=function(_0xa91aad){while(--_0xa91aad){_0x5b8685['push'](_0x5b8685['shift']());}};_0xa3ef57(++_0x1a1c28);}(_0xdf60,0x1be));var _0x0df6=function(_0x4017d7,_0x4f5f29){_0x4017d7=_0x4017d7-0x0;var _0x566525=_0xdf60[_0x4017d7];return _0x566525;};'use strict';var util=require(_0x0df6('0x0'));var sh=require(_0x0df6('0x1'));var Mustache=require(_0x0df6('0x2'));var logger=require(_0x0df6('0x3'))('trigger');exports['exec']=function(_0x2b3ccc,_0xafc927){var _0x565d99=_0x2b3ccc[_0x0df6('0x4')]?_0x2b3ccc[_0x0df6('0x4')]:'Script';var _0x290cee=_0x2b3ccc[_0x0df6('0x5')]?Mustache['render'](_0x2b3ccc['data3'],_0xafc927):_0xafc927;sh['exec'](_0x290cee,function(_0x59fe5d,_0x14b066,_0x391e02){if(_0x59fe5d!==0x0){logger[_0x0df6('0x6')](util[_0x0df6('0x7')](_0x0df6('0x8'),_0x565d99,_0x290cee,_0x59fe5d,_0x391e02));}else{logger[_0x0df6('0x9')](util[_0x0df6('0x7')](_0x0df6('0xa'),_0x565d99,_0x290cee,_0x14b066));}});}; \ 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 a1574e0..3b24050 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 _0xf9ab=['stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','../../../../config/logger','exec','data1','render','data2','data5','headers','data6','toUpperCase','GET','DELETE','POST','PUT','data7','parse','body','error','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x12a4e8,_0x1cf1cb){var _0x1b033c=function(_0x40c194){while(--_0x40c194){_0x12a4e8['push'](_0x12a4e8['shift']());}};_0x1b033c(++_0x1cf1cb);}(_0xf9ab,0x73));var _0xbf9a=function(_0x298b82,_0x2a4e84){_0x298b82=_0x298b82-0x0;var _0xbda4ad=_0xf9ab[_0x298b82];return _0xbda4ad;};'use strict';var rp=require(_0xbf9a('0x0'));var util=require(_0xbf9a('0x1'));var _=require('lodash');var Mustache=require(_0xbf9a('0x2'));var logger=require(_0xbf9a('0x3'))('trigger');exports[_0xbf9a('0x4')]=function(_0x469692,_0x306bf4){var _0x20bc9e,_0x2e78cd;var _0x2740e9={'method':_0x469692[_0xbf9a('0x5')]['toUpperCase'](),'uri':Mustache[_0xbf9a('0x6')](_0x469692[_0xbf9a('0x7')],_0x306bf4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x469692[_0xbf9a('0x8')])==='number'&&parseInt(_0x469692['data5'])>=0x1&&parseInt(_0x469692[_0xbf9a('0x8')])<=0xa?parseInt(_0x469692[_0xbf9a('0x8')])*0x3e8:0x5*0x3e8};try{_0x2740e9[_0xbf9a('0x9')]=_0x469692['data6']?JSON['parse'](Mustache[_0xbf9a('0x6')](_0x469692[_0xbf9a('0xa')],_0x306bf4)):{};}catch(_0x1c543c){logger['error'](_0x1c543c['stack']);}switch(_0x469692[_0xbf9a('0x5')][_0xbf9a('0xb')]()){case _0xbf9a('0xc'):case _0xbf9a('0xd'):_0x20bc9e=null;_0x2740e9['qs']=_0x306bf4;break;case _0xbf9a('0xe'):case _0xbf9a('0xf'):if(_0x469692[_0xbf9a('0x10')]){try{_0x20bc9e=JSON[_0xbf9a('0x11')](Mustache[_0xbf9a('0x6')](_0x469692[_0xbf9a('0x10')],_0x306bf4));_0x2740e9[_0xbf9a('0x12')]=_0x20bc9e;}catch(_0xc48ff1){logger[_0xbf9a('0x13')](_0xc48ff1[_0xbf9a('0x14')]);logger[_0xbf9a('0x13')](_0xbf9a('0x15'));}}else{_0x20bc9e=_0x306bf4;_0x2740e9[_0xbf9a('0x12')]=_0x20bc9e;}break;}logger[_0xbf9a('0x16')](util[_0xbf9a('0x17')](_0xbf9a('0x18'),_0x469692[_0xbf9a('0x5')],_0x469692[_0xbf9a('0x7')],JSON[_0xbf9a('0x19')](_0x2740e9)));rp(_0x2740e9)[_0xbf9a('0x1a')](function(_0x3f149e){_0x20bc9e=!_[_0xbf9a('0x1b')](_0x20bc9e)?_0xbf9a('0x1c')+_0x20bc9e:'';_0x2e78cd=typeof _0x3f149e[_0xbf9a('0x12')]===_0xbf9a('0x1d')?JSON[_0xbf9a('0x19')](_0x3f149e[_0xbf9a('0x12')]):_0x3f149e[_0xbf9a('0x12')];logger[_0xbf9a('0x16')](util['format'](_0xbf9a('0x1e'),_0x469692[_0xbf9a('0x5')],_0x469692['data2'],_0x3f149e[_0xbf9a('0x1f')],_0x2e78cd));})[_0xbf9a('0x20')](function(_0x11ed10){logger[_0xbf9a('0x13')](util['format'](_0xbf9a('0x21'),_0x469692[_0xbf9a('0x5')],_0x469692[_0xbf9a('0x7')],_0x11ed10[_0xbf9a('0x1f')],_0x11ed10[_0xbf9a('0x22')],_0x11ed10['message']));});}; \ No newline at end of file +var _0x62cb=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data2','data5','number','headers','data6','render','error','stack','GET','DELETE','POST','PUT','parse','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x62cb,0xbe));var _0xb62c=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x62cb[_0x48999d];return _0x1ad0d1;};'use strict';var rp=require(_0xb62c('0x0'));var util=require(_0xb62c('0x1'));var _=require(_0xb62c('0x2'));var Mustache=require(_0xb62c('0x3'));var logger=require(_0xb62c('0x4'))('trigger');exports[_0xb62c('0x5')]=function(_0xf70045,_0x4d2fa1){var _0x4e7a2e,_0x11fafe;var _0x2ca258={'method':_0xf70045[_0xb62c('0x6')][_0xb62c('0x7')](),'uri':Mustache['render'](_0xf70045[_0xb62c('0x8')],_0x4d2fa1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xf70045[_0xb62c('0x9')])===_0xb62c('0xa')&&parseInt(_0xf70045['data5'])>=0x1&&parseInt(_0xf70045[_0xb62c('0x9')])<=0xa?parseInt(_0xf70045['data5'])*0x3e8:0x5*0x3e8};try{_0x2ca258[_0xb62c('0xb')]=_0xf70045[_0xb62c('0xc')]?JSON['parse'](Mustache[_0xb62c('0xd')](_0xf70045[_0xb62c('0xc')],_0x4d2fa1)):{};}catch(_0x5e202b){logger[_0xb62c('0xe')](_0x5e202b[_0xb62c('0xf')]);}switch(_0xf70045[_0xb62c('0x6')][_0xb62c('0x7')]()){case _0xb62c('0x10'):case _0xb62c('0x11'):_0x4e7a2e=null;_0x2ca258['qs']=_0x4d2fa1;break;case _0xb62c('0x12'):case _0xb62c('0x13'):if(_0xf70045['data7']){try{_0x4e7a2e=JSON[_0xb62c('0x14')](Mustache[_0xb62c('0xd')](_0xf70045[_0xb62c('0x15')],_0x4d2fa1));_0x2ca258[_0xb62c('0x16')]=_0x4e7a2e;}catch(_0x3509ff){logger['error'](_0x3509ff[_0xb62c('0xf')]);logger[_0xb62c('0xe')](_0xb62c('0x17'));}}else{_0x4e7a2e=_0x4d2fa1;_0x2ca258[_0xb62c('0x16')]=_0x4e7a2e;}break;}logger[_0xb62c('0x18')](util[_0xb62c('0x19')](_0xb62c('0x1a'),_0xf70045['data1'],_0xf70045['data2'],JSON[_0xb62c('0x1b')](_0x2ca258)));rp(_0x2ca258)[_0xb62c('0x1c')](function(_0x456ea7){_0x4e7a2e=!_[_0xb62c('0x1d')](_0x4e7a2e)?_0xb62c('0x1e')+_0x4e7a2e:'';_0x11fafe=typeof _0x456ea7[_0xb62c('0x16')]===_0xb62c('0x1f')?JSON[_0xb62c('0x1b')](_0x456ea7[_0xb62c('0x16')]):_0x456ea7[_0xb62c('0x16')];logger['info'](util[_0xb62c('0x19')](_0xb62c('0x20'),_0xf70045[_0xb62c('0x6')],_0xf70045[_0xb62c('0x8')],_0x456ea7['statusCode'],_0x11fafe));})['catch'](function(_0x29368d){logger[_0xb62c('0xe')](util[_0xb62c('0x19')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xf70045['data1'],_0xf70045[_0xb62c('0x8')],_0x29368d[_0xb62c('0x21')],_0x29368d[_0xb62c('0x22')],_0x29368d[_0xb62c('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3072145..d6cec64 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 _0xf8d0=['bluebird','routing','client','http','Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise'];(function(_0x45afc9,_0x1e6ff3){var _0x1adf0a=function(_0x400d21){while(--_0x400d21){_0x45afc9['push'](_0x45afc9['shift']());}};_0x1adf0a(++_0x1e6ff3);}(_0xf8d0,0xfb));var _0x0f8d=function(_0x3ac50b,_0x5b0f9d){_0x3ac50b=_0x3ac50b-0x0;var _0x4bffaf=_0xf8d0[_0x3ac50b];return _0x4bffaf;};'use strict';var jayson=require(_0x0f8d('0x0'));var BPromise=require(_0x0f8d('0x1'));var logger=require('../../config/logger')(_0x0f8d('0x2'));var client=jayson[_0x0f8d('0x3')][_0x0f8d('0x4')]({'port':0x2329});client[_0x0f8d('0x5')]=function(_0x3b882f,_0x45616b){return new BPromise(function(_0x247e74,_0x1d5c9e){return client[_0x0f8d('0x6')](_0x3b882f,_0x45616b)[_0x0f8d('0x7')](function(_0x19ff98){logger[_0x0f8d('0x8')](_0x0f8d('0x9'),_0x0f8d('0x2'),_0x3b882f,_0x45616b,_0x19ff98);if(_0x19ff98[_0x0f8d('0xa')]){logger[_0x0f8d('0xa')](_0x0f8d('0x9'),_0x0f8d('0x2'),_0x3b882f,_0x19ff98['error'][_0x0f8d('0xb')],_0x45616b);return _0x1d5c9e(_0x19ff98[_0x0f8d('0xa')][_0x0f8d('0xb')]);}else{return _0x247e74(_0x19ff98['result']);}})[_0x0f8d('0xc')](function(_0x4ab01e){logger[_0x0f8d('0xa')](_0x0f8d('0x9'),'routing',_0x3b882f,_0x4ab01e,_0x45616b);return _0x1d5c9e(_0x4ab01e);});});};module[_0x0f8d('0xd')]=client; \ No newline at end of file +var _0x97b5=['bluebird','../../config/logger','routing','http','Request','request','then','rpc','error','message','result','exports'];(function(_0x1bac48,_0x50275a){var _0x3bbe4f=function(_0x47e3c8){while(--_0x47e3c8){_0x1bac48['push'](_0x1bac48['shift']());}};_0x3bbe4f(++_0x50275a);}(_0x97b5,0x138));var _0x597b=function(_0x1f9b23,_0x4fec1f){_0x1f9b23=_0x1f9b23-0x0;var _0x39a610=_0x97b5[_0x1f9b23];return _0x39a610;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x597b('0x0'));var logger=require(_0x597b('0x1'))(_0x597b('0x2'));var client=jayson['client'][_0x597b('0x3')]({'port':0x2329});client[_0x597b('0x4')]=function(_0x15aacf,_0x59706e){return new BPromise(function(_0xc923ea,_0x431c67){return client[_0x597b('0x5')](_0x15aacf,_0x59706e)[_0x597b('0x6')](function(_0x10339b){logger['debug']('rpc','routing',_0x15aacf,_0x59706e,_0x10339b);if(_0x10339b['error']){logger['error'](_0x597b('0x7'),_0x597b('0x2'),_0x15aacf,_0x10339b[_0x597b('0x8')][_0x597b('0x9')],_0x59706e);return _0x431c67(_0x10339b[_0x597b('0x8')][_0x597b('0x9')]);}else{return _0xc923ea(_0x10339b[_0x597b('0xa')]);}})['catch'](function(_0x158c6f){logger[_0x597b('0x8')](_0x597b('0x7'),'routing',_0x15aacf,_0x158c6f,_0x59706e);return _0x431c67(_0x158c6f);});});};module[_0x597b('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index e95d0b9..258cd95 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 _0xc6e3=['./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','getSettings','loginMailFrequency','log','bluebird','./server','./realtime'];(function(_0x495ca6,_0x2bc5d4){var _0x3855c6=function(_0x838c01){while(--_0x838c01){_0x495ca6['push'](_0x495ca6['shift']());}};_0x3855c6(++_0x2bc5d4);}(_0xc6e3,0x8d));var _0x3c6e=function(_0xaaa8cf,_0x5d17b5){_0xaaa8cf=_0xaaa8cf-0x0;var _0x35c3b0=_0xc6e3[_0xaaa8cf];return _0x35c3b0;};'use strict';var BPromise=require(_0x3c6e('0x0'));var server=require(_0x3c6e('0x1'));var Realtime=require(_0x3c6e('0x2'));var EmailChannel=require(_0x3c6e('0x3'));var mailAccount=require(_0x3c6e('0x4'));var setting=require(_0x3c6e('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3c6e('0x6')]()[_0x3c6e('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0x3c6e('0x8')]())[_0x3c6e('0x7')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x3c6e('0x9')]();})[_0x3c6e('0x7')](function(_0x4f18e8){return setInterval(initRealtime,_0x4f18e8[_0x3c6e('0xa')]*0x3e8);})['catch'](function(_0xbf3593){console[_0x3c6e('0xb')](_0xbf3593);});}main(); \ No newline at end of file +var _0x8fc3=['bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log'];(function(_0x4a7ddc,_0x4d3faf){var _0x30d4ff=function(_0x1d1293){while(--_0x1d1293){_0x4a7ddc['push'](_0x4a7ddc['shift']());}};_0x30d4ff(++_0x4d3faf);}(_0x8fc3,0xc4));var _0x38fc=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x8fc3[_0x5d80de];return _0x1c7556;};'use strict';var BPromise=require(_0x38fc('0x0'));var server=require(_0x38fc('0x1'));var Realtime=require(_0x38fc('0x2'));var EmailChannel=require(_0x38fc('0x3'));var mailAccount=require(_0x38fc('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x38fc('0x5')]()[_0x38fc('0x6')](mailAccount['getMailAccounts']())['then'](realtime['initMailAccounts']())['then'](function(){email[_0x38fc('0x7')](realtime[_0x38fc('0x8')]);return realtime;});}function main(){return server[_0x38fc('0x9')](realtime,email)[_0x38fc('0x6')](function(){return initRealtime();})[_0x38fc('0x6')](function(){return setting[_0x38fc('0xa')]();})[_0x38fc('0x6')](function(_0x56191e){return setInterval(initRealtime,_0x56191e[_0x38fc('0xb')]*0x3e8);})[_0x38fc('0xc')](function(_0x35b5d9){console[_0x38fc('0xd')](_0x35b5d9);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b22cba3..6f0fbed 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 _0x5c1b=['Imap','messageStatus','total','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','name','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','status'];(function(_0x1702ed,_0x1940e6){var _0x1f3d9b=function(_0x1e2251){while(--_0x1e2251){_0x1702ed['push'](_0x1702ed['shift']());}};_0x1f3d9b(++_0x1940e6);}(_0x5c1b,0x166));var _0xb5c1=function(_0x5b7fb0,_0x3749e0){_0x5b7fb0=_0x5b7fb0-0x0;var _0x4b867a=_0x5c1b[_0x5b7fb0];return _0x4b867a;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xb5c1('0x0'));var md5=require(_0xb5c1('0x1'));var Redis=require(_0xb5c1('0x2'));var config=require(_0xb5c1('0x3'));var logger=require(_0xb5c1('0x4'))(_0xb5c1('0x5'));config[_0xb5c1('0x6')]=_[_0xb5c1('0x7')](config[_0xb5c1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb5c1('0x8'))(new Redis(config[_0xb5c1('0x6')]));var EmailImap=require(_0xb5c1('0x9'));var EmailSmtp=require(_0xb5c1('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1bf1e4){logger['info'](_0xb5c1('0xb'));this[_0xb5c1('0xc')]=_0x1bf1e4[_0xb5c1('0xc')];this[_0xb5c1('0xd')]={};this[_0xb5c1('0xe')]=new EmailSmtp();}EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x10')]=function(_0x305bca){var _0x56379e=this[_0xb5c1('0xc')][_0x305bca];var _0x54205d={'id':_0x56379e['id'],'name':_0x56379e['name'],'key':_0x56379e[_0xb5c1('0x11')],'active':_0x56379e[_0xb5c1('0x12')],'Imap':{'status':_0x56379e['Imap'][_0xb5c1('0x13')],'messageStatus':_0x56379e[_0xb5c1('0x14')][_0xb5c1('0x15')],'total':_0x56379e[_0xb5c1('0x14')][_0xb5c1('0x16')]}};if(_['isNil'](md5Accounts[_0x305bca])){md5Accounts[_0x305bca]={};}var _0x288aa1=md5(JSON[_0xb5c1('0x17')](_0x54205d));if(md5Accounts[_0x305bca][_0xb5c1('0x1')]!==_0x288aa1){md5Accounts[_0x305bca][_0xb5c1('0x1')]=_0x288aa1;io['emit'](_0xb5c1('0x18'),_0x54205d);}};EmailChannel[_0xb5c1('0xf')]['refresh']=function(_0x10eeb0){for(var _0x2756d5 in _0x10eeb0){if(_0x10eeb0[_0xb5c1('0x19')](_0x2756d5)){if(_0x10eeb0[_0x2756d5][_0xb5c1('0x14')]&&_0x10eeb0[_0x2756d5][_0xb5c1('0x12')]){var _0x5a3610=_0x10eeb0[_0x2756d5][_0xb5c1('0x14')];if(!this[_0xb5c1('0xd')][_0xb5c1('0x19')](_0x5a3610['id'])){this[_0xb5c1('0xd')][_0x5a3610['id']]=new EmailImap(_0x5a3610,_0x10eeb0[_0x2756d5]['email']);this[_0xb5c1('0xd')][_0x5a3610['id']]['on'](_0xb5c1('0x1a'),this[_0xb5c1('0x1b')][_0xb5c1('0x1c')](this,_0x2756d5));this[_0xb5c1('0xd')][_0x5a3610['id']]['on'](_0xb5c1('0x5'),this[_0xb5c1('0x1d')][_0xb5c1('0x1c')](this,_0x2756d5));this[_0xb5c1('0xd')][_0x5a3610['id']]['on'](_0xb5c1('0x1e'),this[_0xb5c1('0x1f')][_0xb5c1('0x1c')](this,_0x2756d5));this[_0xb5c1('0xd')][_0x5a3610['id']]['on'](_0xb5c1('0x20'),this[_0xb5c1('0x21')][_0xb5c1('0x1c')](this,_0x2756d5));}}else{if(_[_0xb5c1('0x22')](this['mailAccounts'][_0x2756d5][_0xb5c1('0x14')])){this['mailAccounts'][_0x2756d5][_0xb5c1('0x14')]={};}this[_0xb5c1('0xc')][_0x2756d5][_0xb5c1('0x14')]['status']=_0xb5c1('0x23');this['mailAccounts'][_0x2756d5]['Imap'][_0xb5c1('0x15')]='';this['emit'](_0x2756d5);}}}};EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x1b')]=function(_0x55e5ca,_0x3c5a72){if(this[_0xb5c1('0xc')][_0x55e5ca]){this[_0xb5c1('0xc')][_0x55e5ca][_0xb5c1('0x14')]['status']='connected';this[_0xb5c1('0xc')][_0x55e5ca]['Imap'][_0xb5c1('0x15')]=_0x3c5a72[_0xb5c1('0x24')];if(_0x3c5a72['messages']){this['mailAccounts'][_0x55e5ca][_0xb5c1('0x14')]['total']=_0x3c5a72[_0xb5c1('0x25')][_0xb5c1('0x16')];}return this['emit'](_0x55e5ca);}};EmailChannel['prototype'][_0xb5c1('0x1d')]=function(_0x1a2fc0,_0x3217e3){logger[_0xb5c1('0x26')](_0xb5c1('0x27'),_0x3217e3['firstName'],_0x3217e3[_0xb5c1('0x28')],_0x3217e3['from'],_0x1a2fc0);if(this[_0xb5c1('0xc')][_0x1a2fc0]){return mailAccount[_0xb5c1('0x29')](_0x1a2fc0,_0x3217e3)[_0xb5c1('0x2a')](function(_0x25f82a){if(_0x25f82a){logger['info'](_0xb5c1('0x2b'));}})[_0xb5c1('0x2c')](function(_0xc39841){logger[_0xb5c1('0x20')](_0xb5c1('0x2d'),JSON[_0xb5c1('0x17')](_0xc39841));});}};EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x1f')]=function(_0x295e37){if(this['mailAccounts'][_0x295e37]&&this[_0xb5c1('0xc')][_0x295e37][_0xb5c1('0x14')]){if(this['imapAccounts'][this[_0xb5c1('0xc')][_0x295e37]['Imap']['id']]){delete this[_0xb5c1('0xd')][this['mailAccounts'][_0x295e37][_0xb5c1('0x14')]['id']];}this['mailAccounts'][_0x295e37][_0xb5c1('0x14')][_0xb5c1('0x2e')]=moment();this['emit'](_0x295e37);}};EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x21')]=function(_0x124a49,_0x41edc8){if(this[_0xb5c1('0xc')][_0x124a49]){this[_0xb5c1('0xc')][_0x124a49]['Imap']['status']=_0xb5c1('0x20');this['mailAccounts'][_0x124a49][_0xb5c1('0x14')][_0xb5c1('0x15')]=_0x41edc8;return this[_0xb5c1('0x10')](_0x124a49);}};EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x2f')]=function(_0x3883b5,_0x5a8b79){return this['smtp'][_0xb5c1('0x30')](_0x3883b5,_0x5a8b79);};EmailChannel[_0xb5c1('0xf')][_0xb5c1('0x31')]=function(_0x44ffe4){var _0x204c93=this;if(this[_0xb5c1('0xc')][_0x44ffe4['id']]){if(_[_0xb5c1('0x22')](this['mailAccounts'][_0x44ffe4['id']][_0xb5c1('0x32')])){this[_0xb5c1('0xc')][_0x44ffe4['id']][_0xb5c1('0x32')]={};}this[_0xb5c1('0xc')][_0x44ffe4['id']][_0xb5c1('0x32')]['lastSync']=moment();return new BPromise(function(_0x160a8d,_0xb419b5){return _0x204c93['smtp'][_0xb5c1('0x33')](_0x44ffe4)['then'](function(_0x4123be){_0x204c93[_0xb5c1('0xc')][_0x44ffe4['id']]['Smtp']['status']=_0xb5c1('0x34');_0x204c93[_0xb5c1('0xc')][_0x44ffe4['id']][_0xb5c1('0x32')][_0xb5c1('0x15')]='';_0x204c93[_0xb5c1('0x10')](_0x44ffe4['id']);_0x160a8d(_0x4123be);})[_0xb5c1('0x2c')](function(_0x53811b){_0x204c93[_0xb5c1('0xc')][_0x44ffe4['id']][_0xb5c1('0x32')]['status']=_0xb5c1('0x20');_0x204c93[_0xb5c1('0xc')][_0x44ffe4['id']]['Smtp'][_0xb5c1('0x15')]=_0x53811b;_0x204c93[_0xb5c1('0x10')](_0x44ffe4['id']);_0xb419b5(_0x53811b);});});}return this[_0xb5c1('0xe')]['verify'](_0x44ffe4);};module[_0xb5c1('0x35')]=EmailChannel; \ No newline at end of file +var _0xf0c1=['refresh','hasOwnProperty','active','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','disabled','emit','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','lastSync','send','verifySmtp','Smtp','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','email','defaults','redis','localhost','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','Imap','status','messageStatus','total','stringify','mailAccount:update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf0c1,0xb3));var _0x1f0c=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0xf0c1[_0x11f249];return _0x5c3656;};'use strict';var _=require('lodash');var moment=require(_0x1f0c('0x0'));var BPromise=require(_0x1f0c('0x1'));var md5=require(_0x1f0c('0x2'));var Redis=require(_0x1f0c('0x3'));var config=require(_0x1f0c('0x4'));var logger=require('../../../config/logger')(_0x1f0c('0x5'));config['redis']=_[_0x1f0c('0x6')](config[_0x1f0c('0x7')],{'host':_0x1f0c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x1f0c('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x1f0c('0xa'));var md5Accounts={};function EmailChannel(_0x352be4){logger[_0x1f0c('0xb')](_0x1f0c('0xc'));this[_0x1f0c('0xd')]=_0x352be4[_0x1f0c('0xd')];this[_0x1f0c('0xe')]={};this[_0x1f0c('0xf')]=new EmailSmtp();}EmailChannel[_0x1f0c('0x10')]['emit']=function(_0xa27672){var _0x152fdf=this['mailAccounts'][_0xa27672];var _0x3f8caf={'id':_0x152fdf['id'],'name':_0x152fdf[_0x1f0c('0x11')],'key':_0x152fdf[_0x1f0c('0x12')],'active':_0x152fdf['active'],'Imap':{'status':_0x152fdf[_0x1f0c('0x13')][_0x1f0c('0x14')],'messageStatus':_0x152fdf['Imap'][_0x1f0c('0x15')],'total':_0x152fdf[_0x1f0c('0x13')][_0x1f0c('0x16')]}};if(_['isNil'](md5Accounts[_0xa27672])){md5Accounts[_0xa27672]={};}var _0x48d8f8=md5(JSON[_0x1f0c('0x17')](_0x3f8caf));if(md5Accounts[_0xa27672]['md5']!==_0x48d8f8){md5Accounts[_0xa27672][_0x1f0c('0x2')]=_0x48d8f8;io['emit'](_0x1f0c('0x18'),_0x3f8caf);}};EmailChannel[_0x1f0c('0x10')][_0x1f0c('0x19')]=function(_0x27b0f8){for(var _0x40c9f7 in _0x27b0f8){if(_0x27b0f8[_0x1f0c('0x1a')](_0x40c9f7)){if(_0x27b0f8[_0x40c9f7][_0x1f0c('0x13')]&&_0x27b0f8[_0x40c9f7][_0x1f0c('0x1b')]){var _0x1135f1=_0x27b0f8[_0x40c9f7][_0x1f0c('0x13')];if(!this[_0x1f0c('0xe')][_0x1f0c('0x1a')](_0x1135f1['id'])){this[_0x1f0c('0xe')][_0x1135f1['id']]=new EmailImap(_0x1135f1,_0x27b0f8[_0x40c9f7][_0x1f0c('0x5')]);this[_0x1f0c('0xe')][_0x1135f1['id']]['on']('box',this['handleImapBox'][_0x1f0c('0x1c')](this,_0x40c9f7));this['imapAccounts'][_0x1135f1['id']]['on'](_0x1f0c('0x5'),this[_0x1f0c('0x1d')][_0x1f0c('0x1c')](this,_0x40c9f7));this[_0x1f0c('0xe')][_0x1135f1['id']]['on']('end',this[_0x1f0c('0x1e')][_0x1f0c('0x1c')](this,_0x40c9f7));this['imapAccounts'][_0x1135f1['id']]['on'](_0x1f0c('0x1f'),this[_0x1f0c('0x20')][_0x1f0c('0x1c')](this,_0x40c9f7));}}else{if(_[_0x1f0c('0x21')](this[_0x1f0c('0xd')][_0x40c9f7]['Imap'])){this[_0x1f0c('0xd')][_0x40c9f7][_0x1f0c('0x13')]={};}this['mailAccounts'][_0x40c9f7][_0x1f0c('0x13')][_0x1f0c('0x14')]=_0x1f0c('0x22');this[_0x1f0c('0xd')][_0x40c9f7][_0x1f0c('0x13')][_0x1f0c('0x15')]='';this[_0x1f0c('0x23')](_0x40c9f7);}}}};EmailChannel[_0x1f0c('0x10')][_0x1f0c('0x24')]=function(_0x51f3b3,_0x299517){if(this[_0x1f0c('0xd')][_0x51f3b3]){this[_0x1f0c('0xd')][_0x51f3b3]['Imap'][_0x1f0c('0x14')]=_0x1f0c('0x25');this[_0x1f0c('0xd')][_0x51f3b3][_0x1f0c('0x13')]['messageStatus']=_0x299517[_0x1f0c('0x11')];if(_0x299517[_0x1f0c('0x26')]){this[_0x1f0c('0xd')][_0x51f3b3]['Imap'][_0x1f0c('0x16')]=_0x299517[_0x1f0c('0x26')]['total'];}return this[_0x1f0c('0x23')](_0x51f3b3);}};EmailChannel[_0x1f0c('0x10')][_0x1f0c('0x1d')]=function(_0x280c3f,_0x26c567){logger['info'](_0x1f0c('0x27'),_0x26c567[_0x1f0c('0x28')],_0x26c567[_0x1f0c('0x29')],_0x26c567['from'],_0x280c3f);if(this[_0x1f0c('0xd')][_0x280c3f]){return mailAccount[_0x1f0c('0x2a')](_0x280c3f,_0x26c567)['then'](function(_0x155cd9){if(_0x155cd9){logger['info'](_0x1f0c('0x2b'));}})[_0x1f0c('0x2c')](function(_0x10ac8d){logger[_0x1f0c('0x1f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x10ac8d));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x30d74c){if(this['mailAccounts'][_0x30d74c]&&this[_0x1f0c('0xd')][_0x30d74c][_0x1f0c('0x13')]){if(this[_0x1f0c('0xe')][this[_0x1f0c('0xd')][_0x30d74c][_0x1f0c('0x13')]['id']]){delete this[_0x1f0c('0xe')][this[_0x1f0c('0xd')][_0x30d74c]['Imap']['id']];}this[_0x1f0c('0xd')][_0x30d74c][_0x1f0c('0x13')][_0x1f0c('0x2d')]=moment();this[_0x1f0c('0x23')](_0x30d74c);}};EmailChannel[_0x1f0c('0x10')][_0x1f0c('0x20')]=function(_0x3107f2,_0x50e8fd){if(this['mailAccounts'][_0x3107f2]){this[_0x1f0c('0xd')][_0x3107f2][_0x1f0c('0x13')][_0x1f0c('0x14')]='error';this[_0x1f0c('0xd')][_0x3107f2][_0x1f0c('0x13')][_0x1f0c('0x15')]=_0x50e8fd;return this[_0x1f0c('0x23')](_0x3107f2);}};EmailChannel['prototype']['sendMail']=function(_0x3be6bf,_0x19a7c2){return this['smtp'][_0x1f0c('0x2e')](_0x3be6bf,_0x19a7c2);};EmailChannel[_0x1f0c('0x10')][_0x1f0c('0x2f')]=function(_0x3777ab){var _0x506020=this;if(this[_0x1f0c('0xd')][_0x3777ab['id']]){if(_[_0x1f0c('0x21')](this['mailAccounts'][_0x3777ab['id']]['Smtp'])){this[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')]={};}this[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')][_0x1f0c('0x2d')]=moment();return new BPromise(function(_0x108769,_0x4bca11){return _0x506020[_0x1f0c('0xf')][_0x1f0c('0x31')](_0x3777ab)['then'](function(_0x37e539){_0x506020[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')][_0x1f0c('0x14')]='verified';_0x506020[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')][_0x1f0c('0x15')]='';_0x506020[_0x1f0c('0x23')](_0x3777ab['id']);_0x108769(_0x37e539);})[_0x1f0c('0x2c')](function(_0x1e4661){_0x506020[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')]['status']=_0x1f0c('0x1f');_0x506020[_0x1f0c('0xd')][_0x3777ab['id']][_0x1f0c('0x30')]['messageStatus']=_0x1e4661;_0x506020[_0x1f0c('0x23')](_0x3777ab['id']);_0x4bca11(_0x1e4661);});});}return this[_0x1f0c('0xf')][_0x1f0c('0x31')](_0x3777ab);};module[_0x1f0c('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 70bd684..fe568bb 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 _0xd412=['account','getAccount','ready','handleReady','bind','once','end','handleEnd','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','port','tls','autotls','required','host','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox'];(function(_0x7e904c,_0x4659dc){var _0x1eaea3=function(_0x3679c1){while(--_0x3679c1){_0x7e904c['push'](_0x7e904c['shift']());}};_0x1eaea3(++_0x4659dc);}(_0xd412,0x132));var _0x2d41=function(_0x558dad,_0x1a9b5a){_0x558dad=_0x558dad-0x0;var _0x1921ea=_0xd412[_0x558dad];return _0x1921ea;};'use strict';var fs=require('fs');var path=require(_0x2d41('0x0'));var util=require(_0x2d41('0x1'));var Imap=require(_0x2d41('0x2'));var _=require(_0x2d41('0x3'));var rs=require(_0x2d41('0x4'));var simpleParser=require('mailparser')[_0x2d41('0x5')];var Iconv=require(_0x2d41('0x6'))[_0x2d41('0x7')];var EventEmitter=require(_0x2d41('0x8'))[_0x2d41('0x9')];var utils=require(_0x2d41('0xa'));var logger=require(_0x2d41('0xb'))(_0x2d41('0xc'));function EmailImap(_0x51dbc9,_0x13f2b9){this[_0x2d41('0xd')]='INBOX';this[_0x2d41('0xe')]=this[_0x2d41('0xf')](_0x51dbc9,_0x13f2b9);this[_0x2d41('0x2')]=new Imap(this[_0x2d41('0xe')]);this[_0x2d41('0x2')]['once'](_0x2d41('0x10'),this[_0x2d41('0x11')][_0x2d41('0x12')](this));this[_0x2d41('0x2')][_0x2d41('0x13')](_0x2d41('0x14'),this[_0x2d41('0x15')]['bind'](this));this['imap']['on']('error',this[_0x2d41('0x16')][_0x2d41('0x12')](this));this[_0x2d41('0x2')][_0x2d41('0x17')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x2d41('0x18')][_0x2d41('0xf')]=function(_0x2d0321,_0x3364d1){var _0x3a108a={'connTimeout':_0x2d0321[_0x2d41('0x19')]?_0x2d0321[_0x2d41('0x19')]*0x3e8:0x2710,'authTimeout':_0x2d0321[_0x2d41('0x1a')]?_0x2d0321['authTimeout']*0x3e8:0x1388};if(_[_0x2d41('0x1b')](_0x2d0321[_0x2d41('0x1c')])){if(_0x2d0321['authentication']){_0x3a108a[_0x2d41('0x1d')]=_0x2d0321['user'];_0x3a108a[_0x2d41('0x1e')]=_0x2d0321[_0x2d41('0x1e')];}_0x3a108a['host']=_0x2d0321['host'];_0x3a108a[_0x2d41('0x1f')]=_0x2d0321[_0x2d41('0x1f')]||0x3e1;if(_0x2d0321[_0x2d41('0x20')]){_0x3a108a['tls']=!![];}else{_0x3a108a[_0x2d41('0x20')]=![];_0x3a108a[_0x2d41('0x21')]=_0x2d41('0x22');}}else{_0x3a108a['user']=_0x2d0321[_0x2d41('0x1d')];_0x3a108a[_0x2d41('0x1e')]=_0x2d0321[_0x2d41('0x1e')];_0x3a108a[_0x2d41('0x23')]=utils[_0x2d41('0x24')](_0x2d0321[_0x2d41('0x1c')]);_0x3a108a[_0x2d41('0x1f')]=0x3e1;_0x3a108a[_0x2d41('0x20')]=!![];}_0x3a108a[_0x2d41('0xc')]=_0x3364d1||_0x2d0321['user']||_0x2d41('0x25');return _0x3a108a;};EmailImap['prototype']['handleReady']=function(){this[_0x2d41('0x2')][_0x2d41('0x26')](this['mailbox'],![],this[_0x2d41('0x27')][_0x2d41('0x12')](this));};EmailImap[_0x2d41('0x18')][_0x2d41('0x27')]=function(_0x410213,_0x2e35f9){if(_0x410213){this[_0x2d41('0x16')](_0x410213,!![]);}else{this[_0x2d41('0x28')](_0x2d41('0x29'),_0x2e35f9);this[_0x2d41('0x2a')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x425cd1){if(_0x425cd1){this[_0x2d41('0x16')](_0x425cd1,!![]);}else{this[_0x2d41('0x2')]['end']();}};EmailImap[_0x2d41('0x18')]['readUnseen']=function(){this[_0x2d41('0x2')][_0x2d41('0x2b')](['UNSEEN'],this[_0x2d41('0x2c')][_0x2d41('0x12')](this));};EmailImap[_0x2d41('0x18')][_0x2d41('0x2c')]=function(_0x5c43dd,_0x16a3bf){if(_0x5c43dd){this[_0x2d41('0x16')](_0x5c43dd,!![]);}else{if(_0x16a3bf[_0x2d41('0x2d')]){try{var _0x58d8f1=this[_0x2d41('0x2')][_0x2d41('0x2e')](_0x16a3bf,{'bodies':'','markSeen':!![]});_0x58d8f1['on']('message',this[_0x2d41('0x2f')][_0x2d41('0x12')](this));_0x58d8f1[_0x2d41('0x13')](_0x2d41('0x30'),this[_0x2d41('0x31')][_0x2d41('0x12')](this));_0x58d8f1[_0x2d41('0x13')](_0x2d41('0x14'),this[_0x2d41('0x32')][_0x2d41('0x12')](this));}catch(_0x4f37c2){logger[_0x2d41('0x30')](_0x4f37c2);}}else{this[_0x2d41('0x2')]['closeBox'](!![],this[_0x2d41('0x33')][_0x2d41('0x12')](this));}}};EmailImap['prototype'][_0x2d41('0x2f')]=function(_0x4ec6ae,_0x904eae){_0x4ec6ae['on'](_0x2d41('0x34'),this[_0x2d41('0x35')]['bind'](this));_0x4ec6ae[_0x2d41('0x13')](_0x2d41('0x36'),this[_0x2d41('0x37')][_0x2d41('0x12')](this));_0x4ec6ae['once'](_0x2d41('0x14'),this[_0x2d41('0x38')][_0x2d41('0x12')](this));};EmailImap[_0x2d41('0x18')]['handleMessageBody']=function(_0x4423b7,_0x1d893a){simpleParser(_0x4423b7,{'Iconv':Iconv},this['handleSimpleParser'][_0x2d41('0x12')](this));};EmailImap['prototype'][_0x2d41('0x37')]=function(_0x318f93){};EmailImap[_0x2d41('0x18')][_0x2d41('0x38')]=function(){};EmailImap[_0x2d41('0x18')][_0x2d41('0x39')]=function(_0x3fa5fc,_0x2217fb){if(_0x3fa5fc){logger[_0x2d41('0x30')](_0x3fa5fc);}else{var _0x87a9ac=this;utils[_0x2d41('0x3a')](this[_0x2d41('0xe')],_0x2217fb,function(_0xc4a94e){_0x87a9ac[_0x2d41('0x28')](_0x2d41('0xc'),_0xc4a94e);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x2d41('0x2')]['closeBox'](!![],this[_0x2d41('0x33')]['bind'](this));};EmailImap[_0x2d41('0x18')][_0x2d41('0x31')]=function(_0x2e3d36){this[_0x2d41('0x16')](_0x2e3d36);this[_0x2d41('0x2')]['closeBox'](!![],this[_0x2d41('0x33')][_0x2d41('0x12')](this));};EmailImap[_0x2d41('0x18')][_0x2d41('0x15')]=function(){this['emit'](_0x2d41('0x14'));};EmailImap[_0x2d41('0x18')][_0x2d41('0x16')]=function(_0x2a707d,_0x2e95d9){logger[_0x2d41('0x30')](_0x2d41('0x16'),this[_0x2d41('0xe')][_0x2d41('0xc')],JSON[_0x2d41('0x3b')](_0x2a707d));var _0x131a10='';if(_0x2a707d){if(_0x2a707d[_0x2d41('0x3c')]){_0x131a10=_0x2a707d[_0x2d41('0x3c')];}else{for(var _0x40e4a6 in _0x2a707d){if(_0x2a707d[_0x2d41('0x3d')](_0x40e4a6)){_0x131a10+=_[_0x2d41('0x3e')](_0x40e4a6)+':\x20'+_0x2a707d[_0x40e4a6]+'\x0a';}}}}if(_0x2e95d9){this[_0x2d41('0x2')][_0x2d41('0x14')]();}else{this[_0x2d41('0x28')](_0x2d41('0x30'),_0x131a10);this['emit'](_0x2d41('0x14'));}};module[_0x2d41('0x3f')]=EmailImap; \ No newline at end of file +var _0xb126=['stringify','textCode','hasOwnProperty','exports','path','imap','lodash','mailparser','simpleParser','Iconv','EventEmitter','../../../config/logger','email','mailbox','INBOX','getAccount','ready','handleReady','bind','once','end','handleEnd','error','connect','inherits','prototype','authTimeout','isNil','service','password','host','port','tls','autotls','required','user','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','search','handleReadUnseen','handleError','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','parser','account','emit'];(function(_0x21318a,_0x4483ba){var _0xc01574=function(_0x226d0c){while(--_0x226d0c){_0x21318a['push'](_0x21318a['shift']());}};_0xc01574(++_0x4483ba);}(_0xb126,0xb2));var _0x6b12=function(_0x1983c5,_0x5ebdbc){_0x1983c5=_0x1983c5-0x0;var _0x1f0740=_0xb126[_0x1983c5];return _0x1f0740;};'use strict';var fs=require('fs');var path=require(_0x6b12('0x0'));var util=require('util');var Imap=require(_0x6b12('0x1'));var _=require(_0x6b12('0x2'));var rs=require('randomstring');var simpleParser=require(_0x6b12('0x3'))[_0x6b12('0x4')];var Iconv=require('iconv')[_0x6b12('0x5')];var EventEmitter=require('events')[_0x6b12('0x6')];var utils=require('./utils');var logger=require(_0x6b12('0x7'))(_0x6b12('0x8'));function EmailImap(_0x37d1c8,_0x214298){this[_0x6b12('0x9')]=_0x6b12('0xa');this['account']=this[_0x6b12('0xb')](_0x37d1c8,_0x214298);this[_0x6b12('0x1')]=new Imap(this['account']);this[_0x6b12('0x1')]['once'](_0x6b12('0xc'),this[_0x6b12('0xd')][_0x6b12('0xe')](this));this[_0x6b12('0x1')][_0x6b12('0xf')](_0x6b12('0x10'),this[_0x6b12('0x11')][_0x6b12('0xe')](this));this[_0x6b12('0x1')]['on'](_0x6b12('0x12'),this['handleError'][_0x6b12('0xe')](this));this['imap'][_0x6b12('0x13')]();}util[_0x6b12('0x14')](EmailImap,EventEmitter);EmailImap[_0x6b12('0x15')][_0x6b12('0xb')]=function(_0x3d9ada,_0x3072ff){var _0x164243={'connTimeout':_0x3d9ada['connTimeout']?_0x3d9ada['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3d9ada[_0x6b12('0x16')]?_0x3d9ada[_0x6b12('0x16')]*0x3e8:0x1388};if(_[_0x6b12('0x17')](_0x3d9ada[_0x6b12('0x18')])){if(_0x3d9ada['authentication']){_0x164243['user']=_0x3d9ada['user'];_0x164243[_0x6b12('0x19')]=_0x3d9ada[_0x6b12('0x19')];}_0x164243[_0x6b12('0x1a')]=_0x3d9ada[_0x6b12('0x1a')];_0x164243[_0x6b12('0x1b')]=_0x3d9ada[_0x6b12('0x1b')]||0x3e1;if(_0x3d9ada[_0x6b12('0x1c')]){_0x164243['tls']=!![];}else{_0x164243['tls']=![];_0x164243[_0x6b12('0x1d')]=_0x6b12('0x1e');}}else{_0x164243[_0x6b12('0x1f')]=_0x3d9ada[_0x6b12('0x1f')];_0x164243[_0x6b12('0x19')]=_0x3d9ada['password'];_0x164243[_0x6b12('0x1a')]=utils['getHost'](_0x3d9ada[_0x6b12('0x18')]);_0x164243['port']=0x3e1;_0x164243[_0x6b12('0x1c')]=!![];}_0x164243[_0x6b12('0x8')]=_0x3072ff||_0x3d9ada[_0x6b12('0x1f')]||_0x6b12('0x20');return _0x164243;};EmailImap[_0x6b12('0x15')]['handleReady']=function(){this[_0x6b12('0x1')][_0x6b12('0x21')](this['mailbox'],![],this[_0x6b12('0x22')][_0x6b12('0xe')](this));};EmailImap[_0x6b12('0x15')][_0x6b12('0x22')]=function(_0x4cefd4,_0x88229f){if(_0x4cefd4){this['handleError'](_0x4cefd4,!![]);}else{this['emit'](_0x6b12('0x23'),_0x88229f);this['readUnseen']();}};EmailImap[_0x6b12('0x15')]['handleCloseBox']=function(_0x280c88){if(_0x280c88){this['handleError'](_0x280c88,!![]);}else{this[_0x6b12('0x1')]['end']();}};EmailImap['prototype'][_0x6b12('0x24')]=function(){this[_0x6b12('0x1')][_0x6b12('0x25')](['UNSEEN'],this[_0x6b12('0x26')][_0x6b12('0xe')](this));};EmailImap['prototype'][_0x6b12('0x26')]=function(_0x33c501,_0x201feb){if(_0x33c501){this[_0x6b12('0x27')](_0x33c501,!![]);}else{if(_0x201feb['length']){try{var _0x1528a6=this['imap'][_0x6b12('0x28')](_0x201feb,{'bodies':'','markSeen':!![]});_0x1528a6['on'](_0x6b12('0x29'),this[_0x6b12('0x2a')][_0x6b12('0xe')](this));_0x1528a6['once']('error',this[_0x6b12('0x2b')][_0x6b12('0xe')](this));_0x1528a6['once']('end',this[_0x6b12('0x2c')][_0x6b12('0xe')](this));}catch(_0x595bc9){logger[_0x6b12('0x12')](_0x595bc9);}}else{this['imap'][_0x6b12('0x2d')](!![],this[_0x6b12('0x2e')][_0x6b12('0xe')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x3c135f,_0x268c1e){_0x3c135f['on']('body',this[_0x6b12('0x2f')][_0x6b12('0xe')](this));_0x3c135f[_0x6b12('0xf')](_0x6b12('0x30'),this['handleMessageAttributes']['bind'](this));_0x3c135f[_0x6b12('0xf')](_0x6b12('0x10'),this['handleMessageEnd'][_0x6b12('0xe')](this));};EmailImap[_0x6b12('0x15')][_0x6b12('0x2f')]=function(_0x55f84f,_0x4cd5a1){simpleParser(_0x55f84f,{'Iconv':Iconv},this[_0x6b12('0x31')][_0x6b12('0xe')](this));};EmailImap[_0x6b12('0x15')][_0x6b12('0x32')]=function(_0x36dcfd){};EmailImap[_0x6b12('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x6b12('0x15')][_0x6b12('0x31')]=function(_0x47a7fa,_0x10bf72){if(_0x47a7fa){logger[_0x6b12('0x12')](_0x47a7fa);}else{var _0x201f21=this;utils[_0x6b12('0x33')](this[_0x6b12('0x34')],_0x10bf72,function(_0x4d4dd4){_0x201f21[_0x6b12('0x35')]('email',_0x4d4dd4);});}};EmailImap[_0x6b12('0x15')][_0x6b12('0x2c')]=function(){this['imap'][_0x6b12('0x2d')](!![],this['handleCloseBox'][_0x6b12('0xe')](this));};EmailImap[_0x6b12('0x15')]['handleFetchError']=function(_0x1af6b1){this[_0x6b12('0x27')](_0x1af6b1);this['imap'][_0x6b12('0x2d')](!![],this[_0x6b12('0x2e')][_0x6b12('0xe')](this));};EmailImap[_0x6b12('0x15')][_0x6b12('0x11')]=function(){this[_0x6b12('0x35')](_0x6b12('0x10'));};EmailImap[_0x6b12('0x15')][_0x6b12('0x27')]=function(_0x25bfb4,_0x679c8a){logger[_0x6b12('0x12')](_0x6b12('0x27'),this[_0x6b12('0x34')]['email'],JSON[_0x6b12('0x36')](_0x25bfb4));var _0x177273='';if(_0x25bfb4){if(_0x25bfb4[_0x6b12('0x37')]){_0x177273=_0x25bfb4['textCode'];}else{for(var _0x5b49e2 in _0x25bfb4){if(_0x25bfb4[_0x6b12('0x38')](_0x5b49e2)){_0x177273+=_['upperFirst'](_0x5b49e2)+':\x20'+_0x25bfb4[_0x5b49e2]+'\x0a';}}}}if(_0x679c8a){this[_0x6b12('0x1')][_0x6b12('0x10')]();}else{this[_0x6b12('0x35')](_0x6b12('0x12'),_0x177273);this[_0x6b12('0x35')](_0x6b12('0x10'));}};module[_0x6b12('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d7e6401..d2b7f32 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 _0xffe2=['verify','exports','bluebird','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x56e9a7,_0x15e4c7){var _0x5bfe00=function(_0x4accd7){while(--_0x4accd7){_0x56e9a7['push'](_0x56e9a7['shift']());}};_0x5bfe00(++_0x15e4c7);}(_0xffe2,0x1d8));var _0x2ffe=function(_0x130e01,_0x4af7c5){_0x130e01=_0x130e01-0x0;var _0x230206=_0xffe2[_0x130e01];return _0x230206;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x2ffe('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x2ffe('0x1')][_0x2ffe('0x2')]=function(_0x9b7fcf,_0x3ea910){return new BPromise(function(_0x629911,_0x3734c2){var _0x168944=nodemailer[_0x2ffe('0x3')](_0x9b7fcf);_0x168944[_0x2ffe('0x4')](_0x2ffe('0x5'),inlineBase64());_0x168944[_0x2ffe('0x6')](_0x3ea910,function(_0xeface4,_0x2342a3){if(_0xeface4){_0x3734c2(_0xeface4[_0x2ffe('0x7')]());}else{_0x629911(_0x2342a3);}});});};EmailSmtp[_0x2ffe('0x1')][_0x2ffe('0x8')]=function(_0x47c0a0){return new BPromise(function(_0x1051b9,_0x1c23a1){var _0x46cbfa=nodemailer['createTransport'](_0x47c0a0);_0x46cbfa[_0x2ffe('0x8')](function(_0x372f46,_0x8c85f8){if(_0x372f46){_0x1c23a1(_0x372f46['toString']());}else{if(_0x8c85f8){_0x1051b9(_0x8c85f8);}else{_0x1c23a1('Not\x20verifired');}}});});};module[_0x2ffe('0x9')]=EmailSmtp; \ No newline at end of file +var _0x7a27=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','sendMail','toString','verify','Not\x20verifired','nodemailer'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x7a27,0x117));var _0x77a2=function(_0x2939de,_0x826751){_0x2939de=_0x2939de-0x0;var _0x5a70a4=_0x7a27[_0x2939de];return _0x5a70a4;};'use strict';var nodemailer=require(_0x77a2('0x0'));var BPromise=require(_0x77a2('0x1'));var inlineBase64=require(_0x77a2('0x2'));function EmailSmtp(){}EmailSmtp[_0x77a2('0x3')][_0x77a2('0x4')]=function(_0x33a3f3,_0x25f2c0){return new BPromise(function(_0x31bac6,_0x411250){var _0x56af86=nodemailer[_0x77a2('0x5')](_0x33a3f3);_0x56af86['use']('compile',inlineBase64());_0x56af86[_0x77a2('0x6')](_0x25f2c0,function(_0xd556fe,_0x2862aa){if(_0xd556fe){_0x411250(_0xd556fe[_0x77a2('0x7')]());}else{_0x31bac6(_0x2862aa);}});});};EmailSmtp[_0x77a2('0x3')][_0x77a2('0x8')]=function(_0xc1cda9){return new BPromise(function(_0x3b7c9c,_0x2ddafc){var _0x450174=nodemailer['createTransport'](_0xc1cda9);_0x450174[_0x77a2('0x8')](function(_0x4117e4,_0x128307){if(_0x4117e4){_0x2ddafc(_0x4117e4[_0x77a2('0x7')]());}else{if(_0x128307){_0x3b7c9c(_0x128307);}else{_0x2ddafc(_0x77a2('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f7eb86e..55074d7 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 _0x7d8a=['line','isAutoreply','from','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','Attachments','Title','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','length','slice','join','Anonymous','split','pop','isEmpty','html','test','includes','attachments','forEach','push','filename','replace','_IMG','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x51eb9e[_0xa7d8('0x12')](0x0,-0x1)[_0xa7d8('0x13')]('\x20'):_0xb1602['name'];}return _0xa7d8('0x14');}function getLastName(_0x137919){var _0x5c8151=_['head'](_0x137919['value']);if(_0x5c8151&&_0x5c8151[_0xa7d8('0xf')]){var _0x1121d=_0x5c8151[_0xa7d8('0xf')][_0xa7d8('0x15')](/\s+/);return _0x1121d[_0xa7d8('0x11')]>0x1?_0x1121d[_0xa7d8('0x16')]():'';}return'';}function getMails(_0x2bbaf4,_0x21bc56){var _0x42e957='';for(var _0xfc0284=0x0;_0xfc0284<_0x21bc56[_0xa7d8('0xa')][_0xa7d8('0x11')];_0xfc0284+=0x1){if(_0x21bc56[_0xa7d8('0xa')][_0xfc0284]['address']!==_0x2bbaf4){if(!_[_0xa7d8('0x17')](_0x42e957)){_0x42e957+=',';}_0x42e957+=_0x21bc56[_0xa7d8('0xa')][_0xfc0284]['name']||_0x21bc56[_0xa7d8('0xa')][_0xfc0284][_0xa7d8('0xb')]||'';_0x42e957+='\x20<';_0x42e957+=_0x21bc56[_0xa7d8('0xa')][_0xfc0284][_0xa7d8('0xb')]?_0x21bc56['value'][_0xfc0284][_0xa7d8('0xb')]:'anonymous'+random[_0xa7d8('0xd')](0x6)+_0xa7d8('0xe');_0x42e957+='>';}}return _0x42e957;}function parseEmail(_0x559771,_0x381fca,_0x108a6d){if(_0x381fca[_0xa7d8('0x18')]){var _0x426a20=/)<[^<]*)*<\/script>/gi;while(_0x426a20[_0xa7d8('0x19')](_0x381fca['html'])){_0x381fca[_0xa7d8('0x18')]=_0x381fca[_0xa7d8('0x18')]['replace'](_0x426a20,'');}if(_0x381fca[_0xa7d8('0x18')][_0xa7d8('0x1a')]('{_0xd09e17[_0xa7d8('0x1d')](_0x22a1f2[_0xa7d8('0x1e')]);});var _0x2d3f0d=/]+>/g;var _0x5392a1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2aed5b=_0x381fca['html'][_0xa7d8('0x1f')](_0x5392a1,'_SRC');var _0x53c475=_0x2aed5b['replace'](_0x2d3f0d,'_IMG');for(let _0x45b800=0x0;_0x45b800<_0xd09e17[_0xa7d8('0x11')];_0x45b800++){var _0x5ae36c=_0x53c475[_0xa7d8('0x1f')](_0xa7d8('0x20'),_0xa7d8('0x21')+_0xd09e17[_0x45b800]+'\x20]');_0x53c475=_0x5ae36c;}_0x381fca[_0xa7d8('0x18')]=_0x53c475;}_0x108a6d[_0xa7d8('0x22')]=_0x381fca[_0xa7d8('0x18')];}else{_0x108a6d['body']=_0x381fca[_0xa7d8('0x23')];}if(_0x108a6d[_0xa7d8('0x22')]){_0x108a6d['body']=_0x108a6d['body'][_0xa7d8('0x1f')](/0x0){var _0x2d8699=[_0xa7d8('0x32'),_0xa7d8('0x33'),_0xa7d8('0x34')];for(var _0x13e9f2=0x0;_0x13e9f2<_0x381fca[_0xa7d8('0x31')][_0xa7d8('0x11')];_0x13e9f2++){var _0x2ef2be=_[_0xa7d8('0x10')](_0x2d8699,_0x381fca[_0xa7d8('0x31')][_0x13e9f2][_0xa7d8('0x35')]);if(_0x2ef2be>=0x0){_0x108a6d[_0xa7d8('0x36')]=!![];}}}return _0x108a6d;}exports['parser']=function(_0x506efa,_0x1e8896,_0x2c7dd6){var _0xc8f95a={'from':getAddress(_0x1e8896[_0xa7d8('0x37')]),'firstName':getFirstName(_0x1e8896[_0xa7d8('0x37')]),'lastName':getLastName(_0x1e8896['from']),'mapKey':_0xa7d8('0x7'),'message':{'from':getMails(_0x506efa[_0xa7d8('0x7')],_0x1e8896[_0xa7d8('0x37')]),'to':_0x506efa[_0xa7d8('0x7')],'cc':'','subject':_0x1e8896['subject']||'','messageId':_0x1e8896['messageId'],'inReplyTo':_0x1e8896['inReplyTo'],'sentAt':moment(_0x1e8896[_0xa7d8('0x38')])['format'](_0xa7d8('0x39')),'attach':![],'attachments':[]}};if(!_0x1e8896[_0xa7d8('0x18')]&&!_0x1e8896[_0xa7d8('0x23')]){var _0x48763c=_['filter'](_0x1e8896[_0xa7d8('0x1b')],{'contentType':_0xa7d8('0x3a')});if(_0x48763c[_0xa7d8('0x11')]){logger[_0xa7d8('0x3b')](util[_0xa7d8('0x3c')](_0xa7d8('0x3d'),_0x1e8896[_0xa7d8('0x3e')]));tnef[_0xa7d8('0x3f')](_[_0xa7d8('0x40')](_0x48763c)[_0xa7d8('0x30')],function(_0x141f47,_0x430297){if(_0x430297){_0x1e8896['html']=_0x430297[_0xa7d8('0x41')]||'

Empty\x20message

';if(_0x430297[_0xa7d8('0x42')]){for(var _0x5666e6=0x0;_0x5666e6<_0x430297[_0xa7d8('0x42')][_0xa7d8('0x11')];_0x5666e6++){var _0x284dbc=_0x430297[_0xa7d8('0x42')][_0x5666e6];_0xc8f95a[_0xa7d8('0x25')][_0xa7d8('0x1b')]['push']({'filename':_0x284dbc[_0xa7d8('0x43')],'content':Buffer[_0xa7d8('0x37')](_0x284dbc['Data'])});}}}_0x2c7dd6(parseEmail(_0x506efa,_0x1e8896,_0xc8f95a));});}else{_0x1e8896['html']='

Empty\x20message

';_0x2c7dd6(parseEmail(_0x506efa,_0x1e8896,_0xc8f95a));}}else{_0x2c7dd6(parseEmail(_0x506efa,_0x1e8896,_0xc8f95a));}};exports['getHost']=function(_0x3e089c){switch(_0x3e089c){case'gmail':return _0xa7d8('0x44');case _0xa7d8('0x45'):return _0xa7d8('0x46');case'hotmail':return'imap-mail.outlook.com';case'outlook365':return _0xa7d8('0x47');}return _0xa7d8('0x48');}; \ No newline at end of file +var _0x7919=['push','Title','Data','

Empty\x20message

','gmail','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','length','join','split','pop','isEmpty','generate','html','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x36194f['slice'](0x0,-0x1)[_0x9791('0x11')]('\x20'):_0x3ab151[_0x9791('0xd')];}return'Anonymous';}function getLastName(_0x32fbbd){var _0x5b144e=_[_0x9791('0x8')](_0x32fbbd[_0x9791('0x9')]);if(_0x5b144e&&_0x5b144e[_0x9791('0xd')]){var _0x2d89d0=_0x5b144e[_0x9791('0xd')][_0x9791('0x12')](/\s+/);return _0x2d89d0[_0x9791('0x10')]>0x1?_0x2d89d0[_0x9791('0x13')]():'';}return'';}function getMails(_0x1b3626,_0x263bf4){var _0x43a07e='';for(var _0xfc61ae=0x0;_0xfc61ae<_0x263bf4[_0x9791('0x9')]['length'];_0xfc61ae+=0x1){if(_0x263bf4[_0x9791('0x9')][_0xfc61ae][_0x9791('0xa')]!==_0x1b3626){if(!_[_0x9791('0x14')](_0x43a07e)){_0x43a07e+=',';}_0x43a07e+=_0x263bf4[_0x9791('0x9')][_0xfc61ae][_0x9791('0xd')]||_0x263bf4['value'][_0xfc61ae][_0x9791('0xa')]||'';_0x43a07e+='\x20<';_0x43a07e+=_0x263bf4[_0x9791('0x9')][_0xfc61ae][_0x9791('0xa')]?_0x263bf4[_0x9791('0x9')][_0xfc61ae][_0x9791('0xa')]:_0x9791('0xb')+random[_0x9791('0x15')](0x6)+_0x9791('0xc');_0x43a07e+='>';}}return _0x43a07e;}function parseEmail(_0x1311b7,_0x27a5e4,_0x1e5406){if(_0x27a5e4['html']){var _0x2d29f8=/)<[^<]*)*<\/script>/gi;while(_0x2d29f8['test'](_0x27a5e4['html'])){_0x27a5e4[_0x9791('0x16')]=_0x27a5e4[_0x9791('0x16')]['replace'](_0x2d29f8,'');}if(_0x27a5e4[_0x9791('0x16')][_0x9791('0x17')](_0x9791('0x18'))){var _0x4ac5b5=[];_0x27a5e4[_0x9791('0x19')][_0x9791('0x1a')](_0xfa2901=>{_0x4ac5b5['push'](_0xfa2901[_0x9791('0x1b')]);});var _0x5264b6=/]+>/g;var _0xc286ac=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x15beb8=_0x27a5e4['html'][_0x9791('0x1c')](_0xc286ac,'_SRC');var _0x2174d9=_0x15beb8['replace'](_0x5264b6,_0x9791('0x1d'));for(let _0x38d348=0x0;_0x38d348<_0x4ac5b5['length'];_0x38d348++){var _0x5f336c=_0x2174d9['replace'](_0x9791('0x1d'),_0x9791('0x1e')+_0x4ac5b5[_0x38d348]+_0x9791('0x1f'));_0x2174d9=_0x5f336c;}_0x27a5e4[_0x9791('0x16')]=_0x2174d9;}_0x1e5406['body']=_0x27a5e4[_0x9791('0x16')];}else{_0x1e5406[_0x9791('0x20')]=_0x27a5e4['textAsHtml'];}if(_0x1e5406[_0x9791('0x20')]){_0x1e5406[_0x9791('0x20')]=_0x1e5406[_0x9791('0x20')][_0x9791('0x1c')](/0x0){var _0x4efa5d=['Auto-Submitted:\x20auto-replied',_0x9791('0x2f'),_0x9791('0x30')];for(var _0x503b9d=0x0;_0x503b9d<_0x27a5e4[_0x9791('0x2e')][_0x9791('0x10')];_0x503b9d++){var _0x48ade8=_[_0x9791('0xf')](_0x4efa5d,_0x27a5e4['headerLines'][_0x503b9d][_0x9791('0x31')]);if(_0x48ade8>=0x0){_0x1e5406[_0x9791('0x32')]=!![];}}}return _0x1e5406;}exports['parser']=function(_0x3c8073,_0x291d96,_0x58a785){var _0x55efbf={'from':getAddress(_0x291d96[_0x9791('0x33')]),'firstName':getFirstName(_0x291d96[_0x9791('0x33')]),'lastName':getLastName(_0x291d96[_0x9791('0x33')]),'mapKey':_0x9791('0x23'),'message':{'from':getMails(_0x3c8073[_0x9791('0x23')],_0x291d96[_0x9791('0x33')]),'to':_0x3c8073[_0x9791('0x23')],'cc':'','subject':_0x291d96[_0x9791('0x34')]||'','messageId':_0x291d96[_0x9791('0x35')],'inReplyTo':_0x291d96['inReplyTo'],'sentAt':moment(_0x291d96[_0x9791('0x36')])[_0x9791('0x29')](_0x9791('0x37')),'attach':![],'attachments':[]}};if(!_0x291d96[_0x9791('0x16')]&&!_0x291d96[_0x9791('0x38')]){var _0x336db1=_[_0x9791('0x39')](_0x291d96['attachments'],{'contentType':_0x9791('0x3a')});if(_0x336db1[_0x9791('0x10')]){logger[_0x9791('0x3b')](util[_0x9791('0x29')](_0x9791('0x3c'),_0x291d96[_0x9791('0x35')]));tnef[_0x9791('0x3d')](_[_0x9791('0x3e')](_0x336db1)['content'],function(_0x25acb8,_0x12d990){if(_0x12d990){_0x291d96[_0x9791('0x16')]=_0x12d990[_0x9791('0x3f')]||'

Empty\x20message

';if(_0x12d990[_0x9791('0x40')]){for(var _0x152245=0x0;_0x152245<_0x12d990[_0x9791('0x40')][_0x9791('0x10')];_0x152245++){var _0x150d4e=_0x12d990['Attachments'][_0x152245];_0x55efbf[_0x9791('0x22')]['attachments'][_0x9791('0x41')]({'filename':_0x150d4e[_0x9791('0x42')],'content':Buffer[_0x9791('0x33')](_0x150d4e[_0x9791('0x43')])});}}}_0x58a785(parseEmail(_0x3c8073,_0x291d96,_0x55efbf));});}else{_0x291d96[_0x9791('0x16')]=_0x9791('0x44');_0x58a785(parseEmail(_0x3c8073,_0x291d96,_0x55efbf));}}else{_0x58a785(parseEmail(_0x3c8073,_0x291d96,_0x55efbf));}};exports['getHost']=function(_0x472f75){switch(_0x472f75){case _0x9791('0x45'):return'imap.gmail.com';case _0x9791('0x46'):return'imap.mail.yahoo.com';case'hotmail':return _0x9791('0x47');case _0x9791('0x48'):return _0x9791('0x49');}return _0x9791('0x4a');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 9dfbdac..09b9033 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 _0x8c0c=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8c0c,0x178));var _0xc8c0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8c0c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc8c0('0x0'));function MailAccount(_0x1806f9){this['id']=_0x1806f9['id']||0x0;this[_0xc8c0('0x1')]=_0x1806f9[_0xc8c0('0x1')]||_0xc8c0('0x2');this[_0xc8c0('0x3')]=_0x1806f9[_0xc8c0('0x3')]||_0xc8c0('0x4');this[_0xc8c0('0x5')]=_0x1806f9['active']||![];this[_0xc8c0('0x6')]=_0x1806f9[_0xc8c0('0x6')]||[];this['Smtp']=_0x1806f9[_0xc8c0('0x7')]||[];}module[_0xc8c0('0x8')]=MailAccount; \ No newline at end of file +var _0xff44=['SERV','active','Imap','Smtp','name','Service','key'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xff44,0xc1));var _0x4ff4=function(_0x1c83c9,_0x2a0efc){_0x1c83c9=_0x1c83c9-0x0;var _0x49c840=_0xff44[_0x1c83c9];return _0x49c840;};'use strict';var _=require('lodash');function MailAccount(_0x1c16ac){this['id']=_0x1c16ac['id']||0x0;this[_0x4ff4('0x0')]=_0x1c16ac['name']||_0x4ff4('0x1');this[_0x4ff4('0x2')]=_0x1c16ac[_0x4ff4('0x2')]||_0x4ff4('0x3');this[_0x4ff4('0x4')]=_0x1c16ac[_0x4ff4('0x4')]||![];this['Imap']=_0x1c16ac[_0x4ff4('0x5')]||[];this['Smtp']=_0x1c16ac[_0x4ff4('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 fea1401..c0b9741 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 _0xe36c=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined'];(function(_0x1b6a1d,_0x2dad98){var _0x1f353a=function(_0x4f6b9f){while(--_0x4f6b9f){_0x1b6a1d['push'](_0x1b6a1d['shift']());}};_0x1f353a(++_0x2dad98);}(_0xe36c,0x198));var _0xce36=function(_0x32d43e,_0x3513d2){_0x32d43e=_0x32d43e-0x0;var _0x4bd2c0=_0xe36c[_0x32d43e];return _0x4bd2c0;};'use strict';var _=require(_0xce36('0x0'));var MailAccount=require(_0xce36('0x1'));var Realtime=function(){this[_0xce36('0x2')]={};};function freeIsNotKey(_0x36c6df,_0x4220ed,_0x59cc16){var _0x163d2c=_[_0xce36('0x3')](_0x36c6df,function(_0x370280,_0x3d71f7){return _0x370280[_0x59cc16];});for(var _0x1de7a3 in _0x4220ed){if(_0x4220ed[_0xce36('0x4')](_0x1de7a3)){if(!_0x163d2c[_0x1de7a3]){delete _0x4220ed[_0x1de7a3];}}}}Realtime['prototype'][_0xce36('0x5')]=function(_0x5cec89,_0x266f7b){for(var _0x57f158 in _0x266f7b){if(_0x5cec89[_0xce36('0x4')](_0x57f158)){_0x5cec89[_0x57f158]=_0x266f7b[_0x57f158];}}};Realtime[_0xce36('0x6')][_0xce36('0x7')]=function(){var _0x4e026d=this;return function(_0x37225f){if(_0x37225f){freeIsNotKey(_0x37225f,_0x4e026d[_0xce36('0x2')],'id');for(var _0x485dab=0x0,_0x3f74cd={},_0x89b4e0={};_0x485dab<_0x37225f[_0xce36('0x8')];_0x485dab+=0x1){_0x3f74cd=_0x37225f[_0x485dab];if(_[_0xce36('0x9')](_0x4e026d[_0xce36('0x2')][_0x3f74cd['id']])){_0x4e026d[_0xce36('0x2')][_0x3f74cd['id']]=new MailAccount(_0x3f74cd);}else{_['merge'](_0x4e026d[_0xce36('0x2')][_0x3f74cd['id']],_0x3f74cd);}}}return _0x4e026d[_0xce36('0x2')];};};module[_0xce36('0xa')]=Realtime; \ No newline at end of file +var _0xa499=['hasOwnProperty','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase'];(function(_0x1ce5b3,_0x14ad51){var _0x5ee348=function(_0x25a76b){while(--_0x25a76b){_0x1ce5b3['push'](_0x1ce5b3['shift']());}};_0x5ee348(++_0x14ad51);}(_0xa499,0x15b));var _0x9a49=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa499[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var MailAccount=require(_0x9a49('0x0'));var Realtime=function(){this[_0x9a49('0x1')]={};};function freeIsNotKey(_0x11db06,_0x168788,_0x113c62){var _0x424534=_[_0x9a49('0x2')](_0x11db06,function(_0x4a36e8,_0x542a58){return _0x4a36e8[_0x113c62];});for(var _0x5cf13b in _0x168788){if(_0x168788['hasOwnProperty'](_0x5cf13b)){if(!_0x424534[_0x5cf13b]){delete _0x168788[_0x5cf13b];}}}}Realtime[_0x9a49('0x3')][_0x9a49('0x4')]=function(_0x10be7c,_0x231060){for(var _0x31271e in _0x231060){if(_0x10be7c[_0x9a49('0x5')](_0x31271e)){_0x10be7c[_0x31271e]=_0x231060[_0x31271e];}}};Realtime[_0x9a49('0x3')][_0x9a49('0x6')]=function(){var _0x403082=this;return function(_0x2caca8){if(_0x2caca8){freeIsNotKey(_0x2caca8,_0x403082[_0x9a49('0x1')],'id');for(var _0x3ba6af=0x0,_0x3cb6dc={},_0x1c95c0={};_0x3ba6af<_0x2caca8[_0x9a49('0x7')];_0x3ba6af+=0x1){_0x3cb6dc=_0x2caca8[_0x3ba6af];if(_[_0x9a49('0x8')](_0x403082[_0x9a49('0x1')][_0x3cb6dc['id']])){_0x403082[_0x9a49('0x1')][_0x3cb6dc['id']]=new MailAccount(_0x3cb6dc);}else{_[_0x9a49('0x9')](_0x403082[_0x9a49('0x1')][_0x3cb6dc['id']],_0x3cb6dc);}}}return _0x403082[_0x9a49('0x1')];};};module[_0x9a49('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b21c3ec..fc13b77 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 _0x9bdb=['active','key','ListId','TemplateId','MailServerIn','Imap','Smtp','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','email'];(function(_0x54e855,_0x2abb82){var _0x6d4d6c=function(_0x3ef1b2){while(--_0x3ef1b2){_0x54e855['push'](_0x54e855['shift']());}};_0x6d4d6c(++_0x2abb82);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x49eda1,_0x85e6fe){_0x49eda1=_0x49eda1-0x0;var _0x704c1b=_0x9bdb[_0x49eda1];return _0x704c1b;};'use strict';var client=require(_0xb9bd('0x0'));exports[_0xb9bd('0x1')]=function(){return function(){return client[_0xb9bd('0x2')](_0xb9bd('0x3'),{'options':{'attributes':['id','name',_0xb9bd('0x4'),_0xb9bd('0x5'),_0xb9bd('0x6'),_0xb9bd('0x7'),_0xb9bd('0x8'),_0xb9bd('0x9')],'raw':![],'include':[{'model':_0xb9bd('0xa'),'as':_0xb9bd('0xb')},{'model':'MailServerOut','as':_0xb9bd('0xc')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x6c1aee,_0x3896ca){return client['Request'](_0xb9bd('0xd'),{'account':{'id':_0x6c1aee},'body':_0x3896ca,'log':_0xb9bd('0xd')});}; \ No newline at end of file +var _0xfb93=['GetMailAccount','service','email','TemplateId','MailServerIn','Imap','MailServerOut','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x341d0d,_0x20db38){var _0x2f50a1=function(_0x4b6a87){while(--_0x4b6a87){_0x341d0d['push'](_0x341d0d['shift']());}};_0x2f50a1(++_0x20db38);}(_0xfb93,0x111));var _0x3fb9=function(_0x1c532a,_0x791a93){_0x1c532a=_0x1c532a-0x0;var _0x16e144=_0xfb93[_0x1c532a];return _0x16e144;};'use strict';var client=require(_0x3fb9('0x0'));exports[_0x3fb9('0x1')]=function(){return function(){return client[_0x3fb9('0x2')](_0x3fb9('0x3'),{'options':{'attributes':['id','name',_0x3fb9('0x4'),_0x3fb9('0x5'),'active','key','ListId',_0x3fb9('0x6')],'raw':![],'include':[{'model':_0x3fb9('0x7'),'as':_0x3fb9('0x8')},{'model':_0x3fb9('0x9'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x3fb9('0xa')]=function(_0x16ec52,_0x419436){return client[_0x3fb9('0x2')](_0x3fb9('0xb'),{'account':{'id':_0x16ec52},'body':_0x419436,'log':_0x3fb9('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index bb4a8b4..aa09db6 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 _0x097b=['GetSettings','../client','Request','ShowSetting','loginMailFrequency'];(function(_0x1aa4e8,_0xd08c4e){var _0x5ba975=function(_0x5a8859){while(--_0x5a8859){_0x1aa4e8['push'](_0x1aa4e8['shift']());}};_0x5ba975(++_0xd08c4e);}(_0x097b,0x1c3));var _0xb097=function(_0xee6293,_0x427daf){_0xee6293=_0xee6293-0x0;var _0x22754e=_0x097b[_0xee6293];return _0x22754e;};'use strict';var client=require(_0xb097('0x0'));exports['getSettings']=function(){return client[_0xb097('0x1')](_0xb097('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb097('0x3')]},'log':_0xb097('0x4')});}; \ No newline at end of file +var _0x123e=['Request','ShowSetting','GetSettings','getSettings'];(function(_0x7c3c9e,_0x5be325){var _0x5859d8=function(_0x98e3a7){while(--_0x98e3a7){_0x7c3c9e['push'](_0x7c3c9e['shift']());}};_0x5859d8(++_0x5be325);}(_0x123e,0x16b));var _0xe123=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x123e[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0xe123('0x0')]=function(){return client[_0xe123('0x1')](_0xe123('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe123('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 0f15e64..1b40fa7 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 1680bab..06c4787 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 _0x94f5=['timeout','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','exports','http','express','sticky-session','../../config/environment','createServer'];(function(_0x4edadf,_0x17e911){var _0x3a77da=function(_0x3582fa){while(--_0x3582fa){_0x4edadf['push'](_0x4edadf['shift']());}};_0x3a77da(++_0x17e911);}(_0x94f5,0x19f));var _0x594f=function(_0x258d29,_0x13e961){_0x258d29=_0x258d29-0x0;var _0x1838d8=_0x94f5[_0x258d29];return _0x1838d8;};'use strict';var _=require('lodash');var http=require(_0x594f('0x0'));var express=require(_0x594f('0x1'));var sticky=require(_0x594f('0x2'));var Redis=require('ioredis');var config=require(_0x594f('0x3'));var app=express();var server=http[_0x594f('0x4')](app);server[_0x594f('0x5')]=0xdbba0;if(sticky[_0x594f('0x6')](server,config[_0x594f('0x7')])){var socketio=require(_0x594f('0x8'))(server,{'transports':[_0x594f('0x9'),'polling']});config[_0x594f('0xa')]=_[_0x594f('0xb')](config[_0x594f('0xa')],{'host':_0x594f('0xc'),'port':0x18eb});socketio[_0x594f('0xd')](require(_0x594f('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x594f('0xa')])}));require(_0x594f('0xf'))['default']();require(_0x594f('0x10'))[_0x594f('0x11')](socketio);require(_0x594f('0x12'))[_0x594f('0x11')](app);require(_0x594f('0x13'))['default'](app);}else{server['once']('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x594f('0x7')]);});}exports=module[_0x594f('0x14')]=app; \ No newline at end of file +var _0x432f=['websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','../../config/environment','listen','port'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x432f,0x71));var _0xf432=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x432f[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xf432('0x0'));var http=require(_0xf432('0x1'));var express=require(_0xf432('0x2'));var sticky=require(_0xf432('0x3'));var Redis=require('ioredis');var config=require(_0xf432('0x4'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xf432('0x5')](server,config[_0xf432('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0xf432('0x7'),'polling']});config[_0xf432('0x8')]=_[_0xf432('0x9')](config[_0xf432('0x8')],{'host':_0xf432('0xa'),'port':0x18eb});socketio[_0xf432('0xb')](require(_0xf432('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xf432('0x8')])}));require(_0xf432('0xd'))[_0xf432('0xe')]();require(_0xf432('0xf'))[_0xf432('0xe')](socketio);require('../../config/express')[_0xf432('0xe')](app);require(_0xf432('0x10'))[_0xf432('0xe')](app);}else{server['once']('listening',function(){console[_0xf432('0x11')](_0xf432('0x12'),config[_0xf432('0x6')]);});}exports=module[_0xf432('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fc39d75..122f8ca 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 _0xfea5=['request','then','debug','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xfea5,0x1da));var _0x5fea=function(_0x525e88,_0x1b5b32){_0x525e88=_0x525e88-0x0;var _0x383db0=_0xfea5[_0x525e88];return _0x383db0;};'use strict';var jayson=require(_0x5fea('0x0'));var BPromise=require(_0x5fea('0x1'));var logger=require(_0x5fea('0x2'))(_0x5fea('0x3'));var client=jayson[_0x5fea('0x4')][_0x5fea('0x5')]({'port':0x2329});client[_0x5fea('0x6')]=function(_0x3aa7e6,_0x36c709){return new BPromise(function(_0xcf5688,_0x581925){return client[_0x5fea('0x7')](_0x3aa7e6,_0x36c709)[_0x5fea('0x8')](function(_0x1f6faf){logger[_0x5fea('0x9')]('rpc',_0x5fea('0x3'),_0x3aa7e6,_0x36c709,_0x1f6faf);if(_0x1f6faf[_0x5fea('0xa')]){logger[_0x5fea('0xa')]('rpc',_0x5fea('0x3'),_0x3aa7e6,_0x1f6faf[_0x5fea('0xa')][_0x5fea('0xb')],_0x36c709);return _0x581925(_0x1f6faf[_0x5fea('0xa')][_0x5fea('0xb')]);}else{return _0xcf5688(_0x1f6faf['result']);}})[_0x5fea('0xc')](function(_0x28d11d){logger['error']('rpc','routing',_0x3aa7e6,_0x28d11d,_0x36c709);return _0x581925(_0x28d11d);});});};module['exports']=client; \ No newline at end of file +var _0xa4fa=['jayson/promise','bluebird','../../config/logger','http','Request','request','then','rpc','error','routing','message','result','catch'];(function(_0x270cbc,_0xff73fa){var _0x347555=function(_0x1a5001){while(--_0x1a5001){_0x270cbc['push'](_0x270cbc['shift']());}};_0x347555(++_0xff73fa);}(_0xa4fa,0x186));var _0xaa4f=function(_0xe2271f,_0x618e6b){_0xe2271f=_0xe2271f-0x0;var _0x1b36dd=_0xa4fa[_0xe2271f];return _0x1b36dd;};'use strict';var jayson=require(_0xaa4f('0x0'));var BPromise=require(_0xaa4f('0x1'));var logger=require(_0xaa4f('0x2'))('routing');var client=jayson['client'][_0xaa4f('0x3')]({'port':0x2329});client[_0xaa4f('0x4')]=function(_0x4835c9,_0x4a0aca){return new BPromise(function(_0x5d033f,_0x6125b0){return client[_0xaa4f('0x5')](_0x4835c9,_0x4a0aca)[_0xaa4f('0x6')](function(_0x3601f3){logger['debug'](_0xaa4f('0x7'),'routing',_0x4835c9,_0x4a0aca,_0x3601f3);if(_0x3601f3['error']){logger[_0xaa4f('0x8')](_0xaa4f('0x7'),_0xaa4f('0x9'),_0x4835c9,_0x3601f3['error'][_0xaa4f('0xa')],_0x4a0aca);return _0x6125b0(_0x3601f3['error'][_0xaa4f('0xa')]);}else{return _0x5d033f(_0x3601f3[_0xaa4f('0xb')]);}})[_0xaa4f('0xc')](function(_0x12f450){logger[_0xaa4f('0x8')]('rpc','routing',_0x4835c9,_0x12f450,_0x4a0aca);return _0x6125b0(_0x12f450);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 9f44a7d..513bc76 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 _0x3285=['resolve','getAgents','then','initAgents','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x5c7e92,_0x32f579){var _0x23d72c=function(_0x367e93){while(--_0x367e93){_0x5c7e92['push'](_0x5c7e92['shift']());}};_0x23d72c(++_0x32f579);}(_0x3285,0x170));var _0x5328=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x3285[_0x1ccdf7];return _0x52a0ae;};'use strict';var BPromise=require('bluebird');var server=require(_0x5328('0x0'));var Realtime=require(_0x5328('0x1'));var user=require(_0x5328('0x2'));var interval=require(_0x5328('0x3'));var openchannelQueue=require(_0x5328('0x4'));var chatQueue=require(_0x5328('0x5'));var smsQueue=require(_0x5328('0x6'));var mailQueue=require(_0x5328('0x7'));var faxQueue=require(_0x5328('0x8'));var whatsappQueue=require(_0x5328('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5328('0xa')]()['then'](user[_0x5328('0xb')]())[_0x5328('0xc')](realtime[_0x5328('0xd')]())['then'](interval['getIntervals']())['then'](realtime[_0x5328('0xe')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x5328('0xc')](realtime[_0x5328('0xf')]())[_0x5328('0xc')](chatQueue[_0x5328('0x10')]())['then'](realtime[_0x5328('0x11')]())[_0x5328('0xc')](smsQueue[_0x5328('0x12')]())['then'](realtime[_0x5328('0x13')]())[_0x5328('0xc')](mailQueue[_0x5328('0x14')]())[_0x5328('0xc')](realtime['initMailQueues']())[_0x5328('0xc')](faxQueue[_0x5328('0x15')]())[_0x5328('0xc')](realtime[_0x5328('0x16')]())[_0x5328('0xc')](whatsappQueue[_0x5328('0x17')]())['then'](realtime[_0x5328('0x18')]())[_0x5328('0xc')](function(){return realtime;});}function main(){return server[_0x5328('0x19')](realtime)[_0x5328('0xc')](function(_0x2aaa71){return initRealtime();})[_0x5328('0xc')](function(_0x288059){return setInterval(initRealtime,0x1388);})[_0x5328('0x1a')](function(_0x5f423b){console['log'](_0x5f423b);});}main(); \ No newline at end of file +var _0xaf14=['./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird'];(function(_0x23f213,_0xf0f51e){var _0x16ca8f=function(_0x1ac962){while(--_0x1ac962){_0x23f213['push'](_0x23f213['shift']());}};_0x16ca8f(++_0xf0f51e);}(_0xaf14,0xe9));var _0x4af1=function(_0x2f573e,_0x8038df){_0x2f573e=_0x2f573e-0x0;var _0x4d81a9=_0xaf14[_0x2f573e];return _0x4d81a9;};'use strict';var BPromise=require(_0x4af1('0x0'));var server=require('./server');var Realtime=require(_0x4af1('0x1'));var user=require(_0x4af1('0x2'));var interval=require(_0x4af1('0x3'));var openchannelQueue=require(_0x4af1('0x4'));var chatQueue=require(_0x4af1('0x5'));var smsQueue=require(_0x4af1('0x6'));var mailQueue=require(_0x4af1('0x7'));var faxQueue=require(_0x4af1('0x8'));var whatsappQueue=require(_0x4af1('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x4af1('0xa')]()[_0x4af1('0xb')](user[_0x4af1('0xc')]())['then'](realtime[_0x4af1('0xd')]())['then'](interval[_0x4af1('0xe')]())['then'](realtime['initIntervals']())['then'](openchannelQueue['getOpenchannelQueues']())[_0x4af1('0xb')](realtime['initOpenchannelQueues']())[_0x4af1('0xb')](chatQueue['getChatQueues']())[_0x4af1('0xb')](realtime[_0x4af1('0xf')]())['then'](smsQueue[_0x4af1('0x10')]())[_0x4af1('0xb')](realtime[_0x4af1('0x11')]())['then'](mailQueue['getMailQueues']())[_0x4af1('0xb')](realtime[_0x4af1('0x12')]())[_0x4af1('0xb')](faxQueue[_0x4af1('0x13')]())[_0x4af1('0xb')](realtime[_0x4af1('0x14')]())[_0x4af1('0xb')](whatsappQueue[_0x4af1('0x15')]())[_0x4af1('0xb')](realtime[_0x4af1('0x16')]())[_0x4af1('0xb')](function(){return realtime;});}function main(){return server[_0x4af1('0x17')](realtime)[_0x4af1('0xb')](function(_0x521929){return initRealtime();})[_0x4af1('0xb')](function(_0x3f8a8a){return setInterval(initRealtime,0x1388);})[_0x4af1('0x18')](function(_0x4695a4){console[_0x4af1('0x19')](_0x4695a4);});}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 7e2f4c9..87d3447 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(_0xf0db47,_0x299aac){var _0x6e9283=function(_0x5979e8){while(--_0x5979e8){_0xf0db47['push'](_0xf0db47['shift']());}};_0x6e9283(++_0x299aac);}(_0x7a54,0x106));var _0x47a5=function(_0x507287,_0x57616d){_0x507287=_0x507287-0x0;var _0x5006c2=_0x7a54[_0x507287];return _0x5006c2;};'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(_0xa91c9d,_0x49140a){var _0x247f00=function(_0x55f403){while(--_0x55f403){_0xa91c9d['push'](_0xa91c9d['shift']());}};_0x247f00(++_0x49140a);}(_0xe14b,0x93));var _0xbe14=function(_0x81370b,_0x5ccb4b){_0x81370b=_0x81370b-0x0;var _0x42af0e=_0xe14b[_0x81370b];return _0x42af0e;};'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 0b60da3..80059d8 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 _0x6e2e=['then','error','message','sendMailMessage','SendMail','jayson/promise','client','http'];(function(_0x23e627,_0x4a4892){var _0x292153=function(_0x2456be){while(--_0x2456be){_0x23e627['push'](_0x23e627['shift']());}};_0x292153(++_0x4a4892);}(_0x6e2e,0xf5));var _0xe6e2=function(_0x1840e2,_0x499f2c){_0x1840e2=_0x1840e2-0x0;var _0x33b870=_0x6e2e[_0x1840e2];return _0x33b870;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe6e2('0x0'));var client=jayson[_0xe6e2('0x1')][_0xe6e2('0x2')]({'port':0x232b});function request(_0x350ece,_0x78a442){return new BPromise(function(_0x29ec24,_0x2ee013){return client['request'](_0x350ece,_0x78a442)[_0xe6e2('0x3')](function(_0x5ec60c){if(_0x5ec60c[_0xe6e2('0x4')]){return _0x2ee013(_0x5ec60c[_0xe6e2('0x4')][_0xe6e2('0x5')]);}else{return _0x29ec24(_0x5ec60c['result']);}})['catch'](function(_0x899a55){return _0x2ee013(_0x899a55);});});}exports[_0xe6e2('0x6')]=function(_0x219269,_0xd73ed3){return request(_0xe6e2('0x7'),{'account':_0x219269,'message':_0xd73ed3});}; \ No newline at end of file +var _0xfebf=['message','result','catch','sendMailMessage','SendMail','bluebird','http','request','then','error'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xfebf,0x163));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xffeb('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xffeb('0x1')]({'port':0x232b});function request(_0x211777,_0xfff780){return new BPromise(function(_0xc73b09,_0x1be876){return client[_0xffeb('0x2')](_0x211777,_0xfff780)[_0xffeb('0x3')](function(_0x476812){if(_0x476812[_0xffeb('0x4')]){return _0x1be876(_0x476812['error'][_0xffeb('0x5')]);}else{return _0xc73b09(_0x476812[_0xffeb('0x6')]);}})[_0xffeb('0x7')](function(_0x3edc6e){return _0x1be876(_0x3edc6e);});});}exports[_0xffeb('0x8')]=function(_0xaec5ac,_0x4a3ad9){return request(_0xffeb('0x9'),{'account':_0xaec5ac,'message':_0x4a3ad9});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2adcb1f..8132056 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 _0x7d99=['openchannelStatusTime','stringify','user:save','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','prototype','CurrentCapacity','Capacity','working','idle','updateRealtime','openchannel','fax','getChannelStatus','Status','StatusTime','toNumber','mailStatus','smsCurrentCapacity'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x7d99,0x71));var _0x97d9=function(_0x343fa5,_0x2ec341){_0x343fa5=_0x343fa5-0x0;var _0x4752b8=_0x7d99[_0x343fa5];return _0x4752b8;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require(_0x97d9('0x0'));var config=require(_0x97d9('0x1'));config[_0x97d9('0x2')]=_[_0x97d9('0x3')](config[_0x97d9('0x2')],{'host':_0x97d9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x97d9('0x2')]));function Agent(_0x2f7b62){this['id']=_0x2f7b62['id']||0x0;this[_0x97d9('0x5')]=_0x2f7b62['name']||'';this['online']=_0x2f7b62[_0x97d9('0x6')]||!![];this[_0x97d9('0x7')]=_0x2f7b62[_0x97d9('0x7')]||![];this['chatPause']=_0x2f7b62[_0x97d9('0x8')]||![];this[_0x97d9('0x9')]=_0x2f7b62[_0x97d9('0x9')]||![];this['faxPause']=_0x2f7b62[_0x97d9('0xa')]||![];this[_0x97d9('0xb')]=_0x2f7b62[_0x97d9('0xb')]||![];this[_0x97d9('0xc')]=_0x2f7b62[_0x97d9('0xc')]||![];this[_0x97d9('0xd')]=_0x97d9('0xe');this[_0x97d9('0xf')]=0x0;this['chatCapacity']=_0x2f7b62[_0x97d9('0x10')]||0x0;this[_0x97d9('0x11')]=0x0;this['mailStatus']=_0x97d9('0xe');this[_0x97d9('0x12')]=0x0;this[_0x97d9('0x13')]=_0x2f7b62[_0x97d9('0x13')]||0x0;this[_0x97d9('0x14')]=0x0;this[_0x97d9('0x15')]='unknown';this[_0x97d9('0x16')]=0x0;this[_0x97d9('0x17')]=_0x2f7b62[_0x97d9('0x17')]||0x0;this[_0x97d9('0x18')]=0x0;this[_0x97d9('0x19')]='unknown';this[_0x97d9('0x1a')]=0x0;this[_0x97d9('0x1b')]=_0x2f7b62[_0x97d9('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x97d9('0x1c')]=_0x97d9('0xe');this[_0x97d9('0x1d')]=0x0;this[_0x97d9('0x1e')]=_0x2f7b62[_0x97d9('0x1e')]||0x0;this[_0x97d9('0x1f')]=0x0;this[_0x97d9('0x20')]=_0x97d9('0xe');this['openchannelStatusTime']=0x0;this[_0x97d9('0x21')]=_0x2f7b62[_0x97d9('0x21')]||0x0;this[_0x97d9('0x22')]=0x0;this[_0x97d9('0x23')]=![];this[_0x97d9('0x24')]=undefined;this[_0x97d9('0x25')]='';this['updateRealtime']();}Agent[_0x97d9('0x26')]['getChannelStatus']=function(_0x19587e){if(this[_0x19587e+_0x97d9('0x27')]>0x0){if(this[_0x19587e+_0x97d9('0x28')]>0x0&&this[_0x19587e+'CurrentCapacity']>=this[_0x19587e+_0x97d9('0x28')]){return'maxcapacity';}else{return _0x97d9('0x29');}}else{return _0x97d9('0x2a');}};Agent[_0x97d9('0x26')][_0x97d9('0x2b')]=function(){var _0x40e535=['mail','chat',_0x97d9('0x2c'),_0x97d9('0x2d'),'sms','whatsapp'];for(var _0x3301c2=0x0;_0x3301c2<_0x40e535['length'];_0x3301c2+=0x1){var _0x3ca00b=this[_0x97d9('0x2e')](_0x40e535[_0x3301c2]);if(this[_0x40e535[_0x3301c2]+_0x97d9('0x2f')]!==_0x3ca00b){this[_0x40e535[_0x3301c2]+_0x97d9('0x30')]=_[_0x97d9('0x31')](moment()['format']('x'));}this[_0x40e535[_0x3301c2]+_0x97d9('0x2f')]=_0x3ca00b;}var _0x87789e={'id':this['id'],'name':this['name'],'online':this[_0x97d9('0x6')],'voicePause':this[_0x97d9('0x7')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x97d9('0xa')],'openchannelPause':this[_0x97d9('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x97d9('0x10')],'chatCurrentCapacity':this[_0x97d9('0x11')],'mailStatus':this[_0x97d9('0x32')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x97d9('0x13')],'mailCurrentCapacity':this[_0x97d9('0x14')],'faxStatus':this[_0x97d9('0x15')],'faxStatusTime':this[_0x97d9('0x16')],'faxCapacity':this[_0x97d9('0x17')],'faxCurrentCapacity':this[_0x97d9('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x97d9('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x97d9('0x33')],'whatsappStatus':this[_0x97d9('0x1c')],'whatsappStatusTime':this[_0x97d9('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x97d9('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x97d9('0x34')],'openchannelCapacity':this[_0x97d9('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x97d9('0x23')],'busyQueue':this[_0x97d9('0x24')]};var _0x4ab1c0=md5(JSON[_0x97d9('0x35')](_0x87789e));if(this[_0x97d9('0x25')]!==_0x4ab1c0){this[_0x97d9('0x25')]=_0x4ab1c0;io['emit'](_0x97d9('0x36'),_0x87789e);}};module['exports']=Agent; \ No newline at end of file +var _0x6acf=['ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','StatusTime','format','chatStatusTime','mailStatus','smsStatusTime','whatsappStatusTime','busyQueue','emit','lodash','moment','md5'];(function(_0x684ef1,_0x5887f7){var _0xa80b7a=function(_0x14f182){while(--_0x14f182){_0x684ef1['push'](_0x684ef1['shift']());}};_0xa80b7a(++_0x5887f7);}(_0x6acf,0x1d5));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var moment=require(_0xf6ac('0x1'));var md5=require(_0xf6ac('0x2'));var Redis=require(_0xf6ac('0x3'));var config=require('../../../config/environment');config[_0xf6ac('0x4')]=_[_0xf6ac('0x5')](config['redis'],{'host':_0xf6ac('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x572eac){this['id']=_0x572eac['id']||0x0;this[_0xf6ac('0x7')]=_0x572eac[_0xf6ac('0x7')]||'';this[_0xf6ac('0x8')]=_0x572eac[_0xf6ac('0x8')]||!![];this['voicePause']=_0x572eac[_0xf6ac('0x9')]||![];this['chatPause']=_0x572eac[_0xf6ac('0xa')]||![];this['mailPause']=_0x572eac[_0xf6ac('0xb')]||![];this[_0xf6ac('0xc')]=_0x572eac['faxPause']||![];this[_0xf6ac('0xd')]=_0x572eac['smsPause']||![];this[_0xf6ac('0xe')]=_0x572eac[_0xf6ac('0xe')]||![];this[_0xf6ac('0xf')]=_0xf6ac('0x10');this['chatStatusTime']=0x0;this[_0xf6ac('0x11')]=_0x572eac['chatCapacity']||0x0;this[_0xf6ac('0x12')]=0x0;this['mailStatus']=_0xf6ac('0x10');this[_0xf6ac('0x13')]=0x0;this[_0xf6ac('0x14')]=_0x572eac['mailCapacity']||0x0;this[_0xf6ac('0x15')]=0x0;this[_0xf6ac('0x16')]=_0xf6ac('0x10');this[_0xf6ac('0x17')]=0x0;this[_0xf6ac('0x18')]=_0x572eac[_0xf6ac('0x18')]||0x0;this[_0xf6ac('0x19')]=0x0;this[_0xf6ac('0x1a')]=_0xf6ac('0x10');this['smsStatusTime']=0x0;this['smsCapacity']=_0x572eac[_0xf6ac('0x1b')]||0x0;this[_0xf6ac('0x1c')]=0x0;this[_0xf6ac('0x1d')]=_0xf6ac('0x10');this['whatsappStatusTime']=0x0;this[_0xf6ac('0x1e')]=_0x572eac['whatsappCapacity']||0x0;this[_0xf6ac('0x1f')]=0x0;this[_0xf6ac('0x20')]=_0xf6ac('0x10');this[_0xf6ac('0x21')]=0x0;this[_0xf6ac('0x22')]=_0x572eac[_0xf6ac('0x22')]||0x0;this[_0xf6ac('0x23')]=0x0;this[_0xf6ac('0x24')]=![];this['busyQueue']=undefined;this[_0xf6ac('0x2')]='';this[_0xf6ac('0x25')]();}Agent[_0xf6ac('0x26')][_0xf6ac('0x27')]=function(_0x17edc8){if(this[_0x17edc8+_0xf6ac('0x28')]>0x0){if(this[_0x17edc8+_0xf6ac('0x29')]>0x0&&this[_0x17edc8+'CurrentCapacity']>=this[_0x17edc8+_0xf6ac('0x29')]){return _0xf6ac('0x2a');}else{return _0xf6ac('0x2b');}}else{return _0xf6ac('0x2c');}};Agent[_0xf6ac('0x26')][_0xf6ac('0x25')]=function(){var _0x905013=[_0xf6ac('0x2d'),'chat',_0xf6ac('0x2e'),'fax',_0xf6ac('0x2f'),_0xf6ac('0x30')];for(var _0x3aab25=0x0;_0x3aab25<_0x905013[_0xf6ac('0x31')];_0x3aab25+=0x1){var _0x1ee25a=this['getChannelStatus'](_0x905013[_0x3aab25]);if(this[_0x905013[_0x3aab25]+_0xf6ac('0x32')]!==_0x1ee25a){this[_0x905013[_0x3aab25]+_0xf6ac('0x33')]=_['toNumber'](moment()[_0xf6ac('0x34')]('x'));}this[_0x905013[_0x3aab25]+'Status']=_0x1ee25a;}var _0x3197ad={'id':this['id'],'name':this[_0xf6ac('0x7')],'online':this['online'],'voicePause':this[_0xf6ac('0x9')],'chatPause':this[_0xf6ac('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xf6ac('0xc')],'openchannelPause':this[_0xf6ac('0xe')],'chatStatus':this[_0xf6ac('0xf')],'chatStatusTime':this[_0xf6ac('0x35')],'chatCapacity':this[_0xf6ac('0x11')],'chatCurrentCapacity':this[_0xf6ac('0x12')],'mailStatus':this[_0xf6ac('0x36')],'mailStatusTime':this[_0xf6ac('0x13')],'mailCapacity':this[_0xf6ac('0x14')],'mailCurrentCapacity':this[_0xf6ac('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf6ac('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xf6ac('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xf6ac('0x37')],'smsCapacity':this[_0xf6ac('0x1b')],'smsCurrentCapacity':this[_0xf6ac('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xf6ac('0x38')],'whatsappCapacity':this[_0xf6ac('0x1e')],'whatsappCurrentCapacity':this[_0xf6ac('0x1f')],'openchannelStatus':this[_0xf6ac('0x20')],'openchannelStatusTime':this[_0xf6ac('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf6ac('0x23')],'busy':this[_0xf6ac('0x24')],'busyQueue':this[_0xf6ac('0x39')]};var _0x17900c=md5(JSON['stringify'](_0x3197ad));if(this[_0xf6ac('0x2')]!==_0x17900c){this[_0xf6ac('0x2')]=_0x17900c;io[_0xf6ac('0x3a')]('user:save',_0x3197ad);}};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 569cd4f..4e4b6ce 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 _0xd501=['../../../config/environment','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','chatPause','available','loggedIn','name','stringify','format','emit','exports','lodash','md5','util','ioredis'];(function(_0x2ea5b3,_0x4d764d){var _0x3d7fe4=function(_0x52bbbd){while(--_0x52bbbd){_0x2ea5b3['push'](_0x2ea5b3['shift']());}};_0x3d7fe4(++_0x4d764d);}(_0xd501,0xa4));var _0x1d50=function(_0x4925f4,_0xb5e22e){_0x4925f4=_0x4925f4-0x0;var _0x1ad094=_0xd501[_0x4925f4];return _0x1ad094;};'use strict';var _=require(_0x1d50('0x0'));var md5=require(_0x1d50('0x1'));var util=require(_0x1d50('0x2'));var Redis=require(_0x1d50('0x3'));var config=require(_0x1d50('0x4'));config['redis']=_['defaults'](config[_0x1d50('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1d50('0x6'))(new Redis(config[_0x1d50('0x5')]));function ChatQueue(_0x26fa7a){this['id']=_0x26fa7a['id']||0x0;this['name']=_0x26fa7a['name']||'';this[_0x1d50('0x7')]=_0x26fa7a['timeout']||0xa;this[_0x1d50('0x8')]=_0x26fa7a[_0x1d50('0x8')]||_0x1d50('0x9');this[_0x1d50('0xa')]=_0x26fa7a[_0x1d50('0xa')];this[_0x1d50('0xb')]={};this[_0x1d50('0xc')]=0x0;this['md5']='';this[_0x1d50('0xd')]();this[_0x1d50('0xe')]();}ChatQueue[_0x1d50('0xf')][_0x1d50('0xd')]=function(){var _0xc0241c=this['mapAgentsId'][_0x1d50('0x10')];this[_0x1d50('0xb')]=_[_0x1d50('0x11')](this['Agents'],'id');this[_0x1d50('0xb')]['_rr']=_0xc0241c;};ChatQueue[_0x1d50('0xf')][_0x1d50('0xe')]=function(){this['loggedIn']=0x0;this[_0x1d50('0x12')]=0x0;for(var _0x1bc33d=0x0;_0x1bc33d=0x0?this[_0x1d50('0x15')]:0x0;var _0x108f43={'id':this['id'],'available':this[_0x1d50('0x15')],'loggedIn':this[_0x1d50('0x16')],'name':this[_0x1d50('0x17')],'paused':this[_0x1d50('0x12')],'waiting':this[_0x1d50('0xc')]};var _0x27bafb=md5(JSON[_0x1d50('0x18')](_0x108f43));if(this[_0x1d50('0x1')]!==_0x27bafb){this[_0x1d50('0x1')]=_0x27bafb;io['to'](util[_0x1d50('0x19')]('chat:queue:%s',_0x108f43[_0x1d50('0x17')]))[_0x1d50('0x1a')]('chat_queue:save',_0x108f43);}};module[_0x1d50('0x1b')]=ChatQueue; \ No newline at end of file +var _0x28e3=['prototype','mapAgentsId','map','loggedIn','paused','online','chatPause','available','md5','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime'];(function(_0x4ad7ae,_0x256afa){var _0x4b03d4=function(_0x298439){while(--_0x298439){_0x4ad7ae['push'](_0x4ad7ae['shift']());}};_0x4b03d4(++_0x256afa);}(_0x28e3,0x1be));var _0x328e=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x28e3[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x328e('0x0'));var md5=require('md5');var util=require(_0x328e('0x1'));var Redis=require(_0x328e('0x2'));var config=require('../../../config/environment');config[_0x328e('0x3')]=_[_0x328e('0x4')](config[_0x328e('0x3')],{'host':_0x328e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x328e('0x3')]));function ChatQueue(_0xcc26ea){this['id']=_0xcc26ea['id']||0x0;this[_0x328e('0x6')]=_0xcc26ea[_0x328e('0x6')]||'';this[_0x328e('0x7')]=_0xcc26ea[_0x328e('0x7')]||0xa;this[_0x328e('0x8')]=_0xcc26ea[_0x328e('0x8')]||_0x328e('0x9');this[_0x328e('0xa')]=_0xcc26ea[_0x328e('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x328e('0xb')]();this[_0x328e('0xc')]();}ChatQueue[_0x328e('0xd')][_0x328e('0xb')]=function(){var _0x159be5=this[_0x328e('0xe')]['_rr'];this[_0x328e('0xe')]=_[_0x328e('0xf')](this['Agents'],'id');this[_0x328e('0xe')]['_rr']=_0x159be5;};ChatQueue[_0x328e('0xd')][_0x328e('0xc')]=function(){this[_0x328e('0x10')]=0x0;this[_0x328e('0x11')]=0x0;for(var _0x59b43d=0x0;_0x59b43d=0x0?this['available']:0x0;var _0x37af07={'id':this['id'],'available':this['available'],'loggedIn':this[_0x328e('0x10')],'name':this[_0x328e('0x6')],'paused':this[_0x328e('0x11')],'waiting':this['waiting']};var _0x14d0ae=md5(JSON['stringify'](_0x37af07));if(this['md5']!==_0x14d0ae){this[_0x328e('0x15')]=_0x14d0ae;io['to'](util[_0x328e('0x16')](_0x328e('0x17'),_0x37af07[_0x328e('0x6')]))[_0x328e('0x18')](_0x328e('0x19'),_0x37af07);}};module[_0x328e('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index d7835e2..654afd3 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 _0xdabc=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','available','stringify','format','emit','lodash','md5','util','ioredis'];(function(_0x3fd45b,_0x295e00){var _0x3d6832=function(_0x4bdf47){while(--_0x4bdf47){_0x3fd45b['push'](_0x3fd45b['shift']());}};_0x3d6832(++_0x295e00);}(_0xdabc,0x1b6));var _0xcdab=function(_0x52c538,_0x48f45a){_0x52c538=_0x52c538-0x0;var _0x33cb72=_0xdabc[_0x52c538];return _0x33cb72;};'use strict';var _=require(_0xcdab('0x0'));var md5=require(_0xcdab('0x1'));var util=require(_0xcdab('0x2'));var Redis=require(_0xcdab('0x3'));var config=require('../../../config/environment');config[_0xcdab('0x4')]=_[_0xcdab('0x5')](config[_0xcdab('0x4')],{'host':_0xcdab('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcdab('0x4')]));function FaxQueue(_0x2d9161){this['id']=_0x2d9161['id']||0x0;this['name']=_0x2d9161[_0xcdab('0x7')]||'';this[_0xcdab('0x8')]=_0x2d9161[_0xcdab('0x8')]||0xa;this['strategy']=_0x2d9161[_0xcdab('0x9')]||_0xcdab('0xa');this[_0xcdab('0xb')]=_0x2d9161[_0xcdab('0xb')];this[_0xcdab('0xc')]={};this['waiting']=0x0;this[_0xcdab('0x1')]='';this[_0xcdab('0xd')]();this['updateRealtime']();}FaxQueue[_0xcdab('0xe')][_0xcdab('0xd')]=function(){var _0x1d2363=this['mapAgentsId'][_0xcdab('0xf')];this[_0xcdab('0xc')]=_[_0xcdab('0x10')](this[_0xcdab('0xb')],'id');this[_0xcdab('0xc')][_0xcdab('0xf')]=_0x1d2363;};FaxQueue[_0xcdab('0xe')][_0xcdab('0x11')]=function(){this[_0xcdab('0x12')]=0x0;this[_0xcdab('0x13')]=0x0;for(var _0x662543=0x0;_0x662543=0x0?this[_0xcdab('0x16')]:0x0;var _0x6aa018={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcdab('0x12')],'name':this[_0xcdab('0x7')],'paused':this[_0xcdab('0x13')],'waiting':this['waiting']};var _0x204a83=md5(JSON[_0xcdab('0x17')](_0x6aa018));if(this['md5']!==_0x204a83){this[_0xcdab('0x1')]=_0x204a83;io['to'](util[_0xcdab('0x18')]('fax:queue:%s',_0x6aa018[_0xcdab('0x7')]))[_0xcdab('0x19')]('fax_queue:save',_0x6aa018);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xe611=['stringify','fax:queue:%s','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','faxPause','available'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe611,0x1b4));var _0x1e61=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xe611[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var md5=require(_0x1e61('0x0'));var util=require(_0x1e61('0x1'));var Redis=require(_0x1e61('0x2'));var config=require(_0x1e61('0x3'));config[_0x1e61('0x4')]=_[_0x1e61('0x5')](config[_0x1e61('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1e61('0x4')]));function FaxQueue(_0x2519f0){this['id']=_0x2519f0['id']||0x0;this[_0x1e61('0x6')]=_0x2519f0['name']||'';this['timeout']=_0x2519f0[_0x1e61('0x7')]||0xa;this['strategy']=_0x2519f0[_0x1e61('0x8')]||_0x1e61('0x9');this['Agents']=_0x2519f0[_0x1e61('0xa')];this[_0x1e61('0xb')]={};this[_0x1e61('0xc')]=0x0;this['md5']='';this[_0x1e61('0xd')]();this['updateRealtime']();}FaxQueue[_0x1e61('0xe')][_0x1e61('0xd')]=function(){var _0xcb226d=this[_0x1e61('0xb')]['_rr'];this[_0x1e61('0xb')]=_[_0x1e61('0xf')](this[_0x1e61('0xa')],'id');this[_0x1e61('0xb')][_0x1e61('0x10')]=_0xcb226d;};FaxQueue[_0x1e61('0xe')][_0x1e61('0x11')]=function(){this[_0x1e61('0x12')]=0x0;this[_0x1e61('0x13')]=0x0;for(var _0x180118=0x0;_0x180118=0x0?this[_0x1e61('0x16')]:0x0;var _0x4cffae={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1e61('0x12')],'name':this[_0x1e61('0x6')],'paused':this[_0x1e61('0x13')],'waiting':this[_0x1e61('0xc')]};var _0xaac295=md5(JSON[_0x1e61('0x17')](_0x4cffae));if(this[_0x1e61('0x0')]!==_0xaac295){this[_0x1e61('0x0')]=_0xaac295;io['to'](util['format'](_0x1e61('0x18'),_0x4cffae[_0x1e61('0x6')]))['emit'](_0x1e61('0x19'),_0x4cffae);}};module[_0x1e61('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index dfeac1b..1908789 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 _0x6e46=['exports','Intervals'];(function(_0x470dbb,_0xbdf285){var _0x1e5d9c=function(_0x4c7715){while(--_0x4c7715){_0x470dbb['push'](_0x470dbb['shift']());}};_0x1e5d9c(++_0xbdf285);}(_0x6e46,0x1c9));var _0x66e4=function(_0x41414e,_0x5d6e27){_0x41414e=_0x41414e-0x0;var _0xe21eeb=_0x6e46[_0x41414e];return _0xe21eeb;};'use strict';function Interval(_0x38aa67){this['id']=_0x38aa67['id']||0x0;this['name']=_0x38aa67['name']||'';this['Intervals']=_0x38aa67[_0x66e4('0x0')]||{};}module[_0x66e4('0x1')]=Interval; \ No newline at end of file +var _0x1029=['name','Intervals','exports'];(function(_0x2c29d8,_0x45a0c2){var _0x4b2743=function(_0x56f997){while(--_0x56f997){_0x2c29d8['push'](_0x2c29d8['shift']());}};_0x4b2743(++_0x45a0c2);}(_0x1029,0x8d));var _0x9102=function(_0x1777a6,_0xf00e5c){_0x1777a6=_0x1777a6-0x0;var _0x9a7adf=_0x1029[_0x1777a6];return _0x9a7adf;};'use strict';function Interval(_0x9f0883){this['id']=_0x9f0883['id']||0x0;this['name']=_0x9f0883[_0x9102('0x0')]||'';this[_0x9102('0x1')]=_0x9f0883[_0x9102('0x1')]||{};}module[_0x9102('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 09d5937..ae420d8 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 _0x63ac=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','paused','length','online','loggedIn','mailPause','available','waiting','stringify','format','mail_queue:save','exports','lodash','md5'];(function(_0x508154,_0x15e1ed){var _0x8018cf=function(_0xbf9dea){while(--_0xbf9dea){_0x508154['push'](_0x508154['shift']());}};_0x8018cf(++_0x15e1ed);}(_0x63ac,0x1ce));var _0xc63a=function(_0x4bde34,_0xaa7b76){_0x4bde34=_0x4bde34-0x0;var _0x57ef23=_0x63ac[_0x4bde34];return _0x57ef23;};'use strict';var _=require(_0xc63a('0x0'));var md5=require(_0xc63a('0x1'));var util=require(_0xc63a('0x2'));var Redis=require(_0xc63a('0x3'));var config=require(_0xc63a('0x4'));config[_0xc63a('0x5')]=_[_0xc63a('0x6')](config[_0xc63a('0x5')],{'host':_0xc63a('0x7'),'port':0x18eb});var io=require(_0xc63a('0x8'))(new Redis(config[_0xc63a('0x5')]));function MailQueue(_0x553d43){this['id']=_0x553d43['id']||0x0;this[_0xc63a('0x9')]=_0x553d43['name']||'';this[_0xc63a('0xa')]=_0x553d43[_0xc63a('0xa')]||0xa;this[_0xc63a('0xb')]=_0x553d43['strategy']||_0xc63a('0xc');this[_0xc63a('0xd')]=_0x553d43[_0xc63a('0xd')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xc63a('0x1')]='';this[_0xc63a('0xe')]();this[_0xc63a('0xf')]();}MailQueue['prototype'][_0xc63a('0xe')]=function(){var _0x1a5760=this[_0xc63a('0x10')][_0xc63a('0x11')];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xc63a('0x11')]=_0x1a5760;};MailQueue['prototype'][_0xc63a('0xf')]=function(){this['loggedIn']=0x0;this[_0xc63a('0x12')]=0x0;for(var _0x390049=0x0;_0x390049=0x0?this[_0xc63a('0x17')]:0x0;var _0x49df69={'id':this['id'],'available':this[_0xc63a('0x17')],'loggedIn':this[_0xc63a('0x15')],'name':this[_0xc63a('0x9')],'paused':this[_0xc63a('0x12')],'waiting':this[_0xc63a('0x18')]};var _0x15e6a4=md5(JSON[_0xc63a('0x19')](_0x49df69));if(this[_0xc63a('0x1')]!==_0x15e6a4){this[_0xc63a('0x1')]=_0x15e6a4;io['to'](util[_0xc63a('0x1a')]('mail:queue:%s',_0x49df69['name']))['emit'](_0xc63a('0x1b'),_0x49df69);}};module[_0xc63a('0x1c')]=MailQueue; \ No newline at end of file +var _0x7d81=['beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','length','online','loggedIn','mailPause','paused','available','format','mail_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d81,0xba));var _0x17d8=function(_0x5073a4,_0x3e27e2){_0x5073a4=_0x5073a4-0x0;var _0x15314a=_0x7d81[_0x5073a4];return _0x15314a;};'use strict';var _=require('lodash');var md5=require(_0x17d8('0x0'));var util=require(_0x17d8('0x1'));var Redis=require('ioredis');var config=require(_0x17d8('0x2'));config[_0x17d8('0x3')]=_[_0x17d8('0x4')](config['redis'],{'host':_0x17d8('0x5'),'port':0x18eb});var io=require(_0x17d8('0x6'))(new Redis(config[_0x17d8('0x3')]));function MailQueue(_0x593ee9){this['id']=_0x593ee9['id']||0x0;this['name']=_0x593ee9[_0x17d8('0x7')]||'';this[_0x17d8('0x8')]=_0x593ee9[_0x17d8('0x8')]||0xa;this[_0x17d8('0x9')]=_0x593ee9[_0x17d8('0x9')]||_0x17d8('0xa');this[_0x17d8('0xb')]=_0x593ee9['Agents'];this[_0x17d8('0xc')]={};this[_0x17d8('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue['prototype'][_0x17d8('0xe')]=function(){var _0x1cec83=this['mapAgentsId'][_0x17d8('0xf')];this['mapAgentsId']=_[_0x17d8('0x10')](this['Agents'],'id');this['mapAgentsId'][_0x17d8('0xf')]=_0x1cec83;};MailQueue[_0x17d8('0x11')][_0x17d8('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x455dd2=0x0;_0x455dd2=0x0?this[_0x17d8('0x18')]:0x0;var _0x30e4a4={'id':this['id'],'available':this['available'],'loggedIn':this[_0x17d8('0x15')],'name':this[_0x17d8('0x7')],'paused':this[_0x17d8('0x17')],'waiting':this['waiting']};var _0x4f98a6=md5(JSON['stringify'](_0x30e4a4));if(this[_0x17d8('0x0')]!==_0x4f98a6){this['md5']=_0x4f98a6;io['to'](util[_0x17d8('0x19')]('mail:queue:%s',_0x30e4a4[_0x17d8('0x7')]))['emit'](_0x17d8('0x1a'),_0x30e4a4);}};module[_0x17d8('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 6f186a2..ed339b5 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xc1fac2,_0x725358){var _0x1a31f8=function(_0x22e4f3){while(--_0x22e4f3){_0xc1fac2['push'](_0xc1fac2['shift']());}};_0x1a31f8(++_0x725358);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x5fc3[_0x2dc343];return _0x51eac5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x1261,0x144));var _0x1126=function(_0x3bc04d,_0x28ab50){_0x3bc04d=_0x3bc04d-0x0;var _0x2a543b=_0x1261[_0x3bc04d];return _0x2a543b;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fcd2c57..4181181 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 _0xaa7c=['md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x268ed1,_0x2034d3){var _0x57f3f8=function(_0xbd3719){while(--_0xbd3719){_0x268ed1['push'](_0x268ed1['shift']());}};_0x57f3f8(++_0x2034d3);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x1aa3bd,_0x5c5a2d){_0x1aa3bd=_0x1aa3bd-0x0;var _0x17b4ff=_0xaa7c[_0x1aa3bd];return _0x17b4ff;};'use strict';var _=require(_0xcaa7('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xcaa7('0x1')]=_[_0xcaa7('0x2')](config['redis'],{'host':_0xcaa7('0x3'),'port':0x18eb});var io=require(_0xcaa7('0x4'))(new Redis(config[_0xcaa7('0x1')]));function SmsQueue(_0x17d8cf){this['id']=_0x17d8cf['id']||0x0;this[_0xcaa7('0x5')]=_0x17d8cf['name']||'';this[_0xcaa7('0x6')]=_0x17d8cf['timeout']||0xa;this['strategy']=_0x17d8cf[_0xcaa7('0x7')]||_0xcaa7('0x8');this[_0xcaa7('0x9')]=_0x17d8cf['Agents'];this[_0xcaa7('0xa')]={};this[_0xcaa7('0xb')]=0x0;this[_0xcaa7('0xc')]='';this[_0xcaa7('0xd')]();this[_0xcaa7('0xe')]();}SmsQueue['prototype'][_0xcaa7('0xd')]=function(){var _0x39d53a=this[_0xcaa7('0xa')][_0xcaa7('0xf')];this[_0xcaa7('0xa')]=_[_0xcaa7('0x10')](this['Agents'],'id');this[_0xcaa7('0xa')][_0xcaa7('0xf')]=_0x39d53a;};SmsQueue[_0xcaa7('0x11')][_0xcaa7('0xe')]=function(){this[_0xcaa7('0x12')]=0x0;this[_0xcaa7('0x13')]=0x0;for(var _0x299490=0x0;_0x299490=0x0?this[_0xcaa7('0x15')]:0x0;var _0x5c2a74={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcaa7('0x12')],'name':this[_0xcaa7('0x5')],'paused':this[_0xcaa7('0x13')],'waiting':this[_0xcaa7('0xb')]};var _0x131e52=md5(JSON[_0xcaa7('0x16')](_0x5c2a74));if(this[_0xcaa7('0xc')]!==_0x131e52){this['md5']=_0x131e52;io['to'](util[_0xcaa7('0x17')](_0xcaa7('0x18'),_0x5c2a74[_0xcaa7('0x5')]))[_0xcaa7('0x19')](_0xcaa7('0x1a'),_0x5c2a74);}};module[_0xcaa7('0x1b')]=SmsQueue; \ No newline at end of file +var _0x04de=['available','name','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause'];(function(_0x27627d,_0x42b79d){var _0x406e93=function(_0xe6b327){while(--_0xe6b327){_0x27627d['push'](_0x27627d['shift']());}};_0x406e93(++_0x42b79d);}(_0x04de,0x107));var _0xe04d=function(_0x406e4f,_0x2048ac){_0x406e4f=_0x406e4f-0x0;var _0x12f8f8=_0x04de[_0x406e4f];return _0x12f8f8;};'use strict';var _=require(_0xe04d('0x0'));var md5=require(_0xe04d('0x1'));var util=require(_0xe04d('0x2'));var Redis=require(_0xe04d('0x3'));var config=require(_0xe04d('0x4'));config[_0xe04d('0x5')]=_[_0xe04d('0x6')](config[_0xe04d('0x5')],{'host':_0xe04d('0x7'),'port':0x18eb});var io=require(_0xe04d('0x8'))(new Redis(config[_0xe04d('0x5')]));function SmsQueue(_0x4804c8){this['id']=_0x4804c8['id']||0x0;this['name']=_0x4804c8['name']||'';this['timeout']=_0x4804c8[_0xe04d('0x9')]||0xa;this[_0xe04d('0xa')]=_0x4804c8[_0xe04d('0xa')]||_0xe04d('0xb');this[_0xe04d('0xc')]=_0x4804c8[_0xe04d('0xc')];this[_0xe04d('0xd')]={};this[_0xe04d('0xe')]=0x0;this['md5']='';this[_0xe04d('0xf')]();this[_0xe04d('0x10')]();}SmsQueue[_0xe04d('0x11')][_0xe04d('0xf')]=function(){var _0xad5c34=this[_0xe04d('0xd')][_0xe04d('0x12')];this[_0xe04d('0xd')]=_[_0xe04d('0x13')](this['Agents'],'id');this[_0xe04d('0xd')][_0xe04d('0x12')]=_0xad5c34;};SmsQueue[_0xe04d('0x11')][_0xe04d('0x10')]=function(){this[_0xe04d('0x14')]=0x0;this[_0xe04d('0x15')]=0x0;for(var _0xf205f5=0x0;_0xf205f5=0x0?this[_0xe04d('0x19')]:0x0;var _0x4090e0={'id':this['id'],'available':this[_0xe04d('0x19')],'loggedIn':this[_0xe04d('0x14')],'name':this[_0xe04d('0x1a')],'paused':this[_0xe04d('0x15')],'waiting':this['waiting']};var _0x47047c=md5(JSON[_0xe04d('0x1b')](_0x4090e0));if(this[_0xe04d('0x1')]!==_0x47047c){this[_0xe04d('0x1')]=_0x47047c;io['to'](util[_0xe04d('0x1c')](_0xe04d('0x1d'),_0x4090e0['name']))[_0xe04d('0x1e')](_0xe04d('0x1f'),_0x4090e0);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index c45352c..d63f8ca 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 _0x8483=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','stringify','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8483,0x120));var _0x3848=function(_0x29f435,_0x350538){_0x29f435=_0x29f435-0x0;var _0x58c177=_0x8483[_0x29f435];return _0x58c177;};'use strict';var _=require(_0x3848('0x0'));var md5=require(_0x3848('0x1'));var util=require(_0x3848('0x2'));var Redis=require(_0x3848('0x3'));var config=require(_0x3848('0x4'));config[_0x3848('0x5')]=_[_0x3848('0x6')](config[_0x3848('0x5')],{'host':_0x3848('0x7'),'port':0x18eb});var io=require(_0x3848('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x52398b){this['id']=_0x52398b['id']||0x0;this[_0x3848('0x9')]=_0x52398b[_0x3848('0x9')]||'';this[_0x3848('0xa')]=_0x52398b[_0x3848('0xa')]||0xa;this['strategy']=_0x52398b[_0x3848('0xb')]||_0x3848('0xc');this['Agents']=_0x52398b[_0x3848('0xd')];this[_0x3848('0xe')]={};this[_0x3848('0xf')]=0x0;this[_0x3848('0x1')]='';this[_0x3848('0x10')]();this[_0x3848('0x11')]();}WhatsappQueue[_0x3848('0x12')][_0x3848('0x10')]=function(){var _0x3b67a5=this[_0x3848('0xe')][_0x3848('0x13')];this[_0x3848('0xe')]=_[_0x3848('0x14')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x3b67a5;};WhatsappQueue['prototype'][_0x3848('0x11')]=function(){this[_0x3848('0x15')]=0x0;this[_0x3848('0x16')]=0x0;for(var _0x218133=0x0;_0x218133=0x0?this[_0x3848('0x19')]:0x0;var _0x1bb0f1={'id':this['id'],'available':this[_0x3848('0x19')],'loggedIn':this[_0x3848('0x15')],'name':this[_0x3848('0x9')],'paused':this[_0x3848('0x16')],'waiting':this['waiting']};var _0x463b98=md5(JSON[_0x3848('0x1a')](_0x1bb0f1));if(this['md5']!==_0x463b98){this[_0x3848('0x1')]=_0x463b98;io['to'](util['format']('whatsapp:queue:%s',_0x1bb0f1[_0x3848('0x9')]))[_0x3848('0x1b')](_0x3848('0x1c'),_0x1bb0f1);}};module[_0x3848('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x56fd=['paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','lodash','md5','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x56fd,0x142));var _0xd56f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56fd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd56f('0x0'));var md5=require(_0xd56f('0x1'));var util=require('util');var Redis=require(_0xd56f('0x2'));var config=require(_0xd56f('0x3'));config[_0xd56f('0x4')]=_['defaults'](config[_0xd56f('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd56f('0x4')]));function WhatsappQueue(_0x49dd81){this['id']=_0x49dd81['id']||0x0;this['name']=_0x49dd81[_0xd56f('0x5')]||'';this[_0xd56f('0x6')]=_0x49dd81[_0xd56f('0x6')]||0xa;this['strategy']=_0x49dd81[_0xd56f('0x7')]||_0xd56f('0x8');this[_0xd56f('0x9')]=_0x49dd81[_0xd56f('0x9')];this[_0xd56f('0xa')]={};this[_0xd56f('0xb')]=0x0;this[_0xd56f('0x1')]='';this['updateRouting']();this[_0xd56f('0xc')]();}WhatsappQueue[_0xd56f('0xd')][_0xd56f('0xe')]=function(){var _0x46f4ce=this['mapAgentsId']['_rr'];this[_0xd56f('0xa')]=_[_0xd56f('0xf')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x46f4ce;};WhatsappQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd56f('0x10')]=0x0;for(var _0x2cda13=0x0;_0x2cda13=0x0?this['available']:0x0;var _0x106894={'id':this['id'],'available':this[_0xd56f('0x15')],'loggedIn':this[_0xd56f('0x13')],'name':this['name'],'paused':this[_0xd56f('0x10')],'waiting':this['waiting']};var _0x52d3d6=md5(JSON[_0xd56f('0x16')](_0x106894));if(this[_0xd56f('0x1')]!==_0x52d3d6){this[_0xd56f('0x1')]=_0x52d3d6;io['to'](util[_0xd56f('0x17')](_0xd56f('0x18'),_0x106894[_0xd56f('0x5')]))[_0xd56f('0x19')]('whatsapp_queue:save',_0x106894);}};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 735c926..8916379 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 2eee20c..21f32e4 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 _0x8b72=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x8b72,0xae));var _0x28b7=function(_0x23bb55,_0x291b2c){_0x23bb55=_0x23bb55-0x0;var _0xdae763=_0x8b72[_0x23bb55];return _0xdae763;};'use strict';var client=require(_0x28b7('0x0'));exports[_0x28b7('0x1')]=function(_0x50ccdc,_0x5af87f){return client[_0x28b7('0x2')](_0x28b7('0x3'),{'body':_0x5af87f,'options':{'where':{'id':_0x50ccdc}},'log':_0x28b7('0x4')});};exports[_0x28b7('0x5')]=function(_0xc8a680,_0x46fb36){return client[_0x28b7('0x2')](_0x28b7('0x6'),{'body':_0x46fb36,'options':{'where':{'id':_0xc8a680}},'log':_0x28b7('0x7')});}; \ No newline at end of file +var _0xb295=['updateChatInteraction','addTags','Request','../client','update','UpdateChatInteraction'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xb295,0x1a1));var _0x5b29=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb295[_0x263a74];return _0x2aa86c;};'use strict';var client=require(_0x5b29('0x0'));exports[_0x5b29('0x1')]=function(_0x3e0eb6,_0x2bbfc7){return client['Request'](_0x5b29('0x2'),{'body':_0x2bbfc7,'options':{'where':{'id':_0x3e0eb6}},'log':_0x5b29('0x3')});};exports[_0x5b29('0x4')]=function(_0x436f93,_0x15ddb9){return client[_0x5b29('0x5')]('AddTagsToChatInteraction',{'body':_0x15ddb9,'options':{'where':{'id':_0x436f93}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f5a69ba..ce5b357 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 _0xeff1=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x23f2fe,_0x50cda5){var _0x289d24=function(_0x2e68e8){while(--_0x2e68e8){_0x23f2fe['push'](_0x23f2fe['shift']());}};_0x289d24(++_0x50cda5);}(_0xeff1,0xb6));var _0x1eff=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xeff1[_0x400b43];return _0x3c330f;};'use strict';var client=require(_0x1eff('0x0'));exports[_0x1eff('0x1')]=function(_0x516110){return client['Request'](_0x1eff('0x2'),{'body':_0x516110,'log':_0x1eff('0x3')});}; \ No newline at end of file +var _0xfb22=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x1d2e84,_0x22acde){var _0x58ade6=function(_0x4b16f7){while(--_0x4b16f7){_0x1d2e84['push'](_0x1d2e84['shift']());}};_0x58ade6(++_0x22acde);}(_0xfb22,0xb2));var _0x2fb2=function(_0x478e2f,_0xcc2041){_0x478e2f=_0x478e2f-0x0;var _0x4b088d=_0xfb22[_0x478e2f];return _0x4b088d;};'use strict';var client=require('../client');exports[_0x2fb2('0x0')]=function(_0x20b348){return client[_0x2fb2('0x1')](_0x2fb2('0x2'),{'body':_0x20b348,'log':_0x2fb2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index fd56bc5..c4339f3 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 _0x8375=['name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues','Request'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x8375,0xa8));var _0x5837=function(_0x117310,_0x6c41b0){_0x117310=_0x117310-0x0;var _0x961588=_0x8375[_0x117310];return _0x961588;};'use strict';var client=require(_0x5837('0x0'));exports[_0x5837('0x1')]=function(){return function(){return client[_0x5837('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5')],'include':[{'model':_0x5837('0x6'),'as':_0x5837('0x7'),'attributes':['id',_0x5837('0x3'),'online',_0x5837('0x8')]}]},'log':_0x5837('0x1')});};}; \ No newline at end of file +var _0x30bc=['getChatQueues','Request','name','timeout','strategy','User','Agents','online','chatPause','../client'];(function(_0x2e9d62,_0x14c132){var _0x5724fc=function(_0x367ce0){while(--_0x367ce0){_0x2e9d62['push'](_0x2e9d62['shift']());}};_0x5724fc(++_0x14c132);}(_0x30bc,0x149));var _0xc30b=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0x30bc[_0x36a3d1];return _0x821ef4;};'use strict';var client=require(_0xc30b('0x0'));exports[_0xc30b('0x1')]=function(){return function(){return client[_0xc30b('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xc30b('0x3'),_0xc30b('0x4'),_0xc30b('0x5')],'include':[{'model':_0xc30b('0x6'),'as':_0xc30b('0x7'),'attributes':['id',_0xc30b('0x3'),_0xc30b('0x8'),_0xc30b('0x9')]}]},'log':_0xc30b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index cf489d5..63c8f86 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 _0xd737=['update','Request','UpdateChatQueueReport','../client','CreateChatQueueReport'];(function(_0xd4046d,_0xbd8378){var _0x2993d0=function(_0xd0df62){while(--_0xd0df62){_0xd4046d['push'](_0xd4046d['shift']());}};_0x2993d0(++_0xbd8378);}(_0xd737,0x85));var _0x7d73=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xd737[_0x303c30];return _0x43161b;};'use strict';var client=require(_0x7d73('0x0'));exports['create']=function(_0x240283){return client['Request'](_0x7d73('0x1'),{'body':_0x240283,'log':_0x7d73('0x1')});};exports[_0x7d73('0x2')]=function(_0x5cfa01,_0x5369be){return client[_0x7d73('0x3')]('UpdateChatQueueReport',{'body':_0x5369be,'options':{'where':{'uniqueid':_0x5cfa01},'order':[['id','DESC']],'limit':0x1},'log':_0x7d73('0x4')});}; \ No newline at end of file +var _0xc18a=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3e0191,_0x1d4b20){var _0xf2ae83=function(_0x277210){while(--_0x277210){_0x3e0191['push'](_0x3e0191['shift']());}};_0xf2ae83(++_0x1d4b20);}(_0xc18a,0x1cf));var _0xac18=function(_0x15029a,_0x4aacf1){_0x15029a=_0x15029a-0x0;var _0x297432=_0xc18a[_0x15029a];return _0x297432;};'use strict';var client=require(_0xac18('0x0'));exports[_0xac18('0x1')]=function(_0x1bb84d){return client[_0xac18('0x2')]('CreateChatQueueReport',{'body':_0x1bb84d,'log':_0xac18('0x3')});};exports[_0xac18('0x4')]=function(_0x3bf117,_0x3da5f5){return client[_0xac18('0x2')](_0xac18('0x5'),{'body':_0x3da5f5,'options':{'where':{'uniqueid':_0x3bf117},'order':[['id',_0xac18('0x6')]],'limit':0x1},'log':_0xac18('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index eecb881..4e376fe 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(_0x56a3ff,_0x7b6a4f){var _0x27fc14=function(_0xc31f8c){while(--_0xc31f8c){_0x56a3ff['push'](_0x56a3ff['shift']());}};_0x27fc14(++_0x7b6a4f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x6471f1,_0x2fbd75){var _0x414506=function(_0x299e05){while(--_0x299e05){_0x6471f1['push'](_0x6471f1['shift']());}};_0x414506(++_0x2fbd75);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index db89cc7..42a4114 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 _0xa3dd=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x688709,_0x398c26){var _0x438a2f=function(_0x4e6062){while(--_0x4e6062){_0x688709['push'](_0x688709['shift']());}};_0x438a2f(++_0x398c26);}(_0xa3dd,0x12e));var _0xda3d=function(_0x18e80c,_0x4077f7){_0x18e80c=_0x18e80c-0x0;var _0x183ba9=_0xa3dd[_0x18e80c];return _0x183ba9;};'use strict';var client=require(_0xda3d('0x0'));exports['create']=function(_0x20c952){return client[_0xda3d('0x1')](_0xda3d('0x2'),{'body':_0x20c952,'log':_0xda3d('0x3')});}; \ No newline at end of file +var _0x61d0=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x9a3d47,_0x1953a0){var _0xf60b78=function(_0x31575d){while(--_0x31575d){_0x9a3d47['push'](_0x9a3d47['shift']());}};_0xf60b78(++_0x1953a0);}(_0x61d0,0x19a));var _0x061d=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x61d0[_0x3c2a69];return _0x596bc8;};'use strict';var client=require(_0x061d('0x0'));exports[_0x061d('0x1')]=function(_0x1bfd4b){return client['Request'](_0x061d('0x2'),{'body':_0x1bfd4b,'log':_0x061d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 564933f..efcee2f 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 _0xd153=['../client','GetFaxQueue','name','timeout','User','Agents','online','faxPause','getFaxQueues'];(function(_0x48122e,_0x29cd8d){var _0x49478a=function(_0x1157c4){while(--_0x1157c4){_0x48122e['push'](_0x48122e['shift']());}};_0x49478a(++_0x29cd8d);}(_0xd153,0x6c));var _0x3d15=function(_0x2eddf6,_0x196cfc){_0x2eddf6=_0x2eddf6-0x0;var _0xc76d4c=_0xd153[_0x2eddf6];return _0xc76d4c;};'use strict';var client=require(_0x3d15('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x3d15('0x1'),{'options':{'raw':![],'attributes':['id',_0x3d15('0x2'),_0x3d15('0x3'),'strategy'],'include':[{'model':_0x3d15('0x4'),'as':_0x3d15('0x5'),'attributes':['id','name',_0x3d15('0x6'),_0x3d15('0x7')]}]},'log':_0x3d15('0x8')});};}; \ No newline at end of file +var _0x04e4=['Request','GetFaxQueue','name','User','faxPause','getFaxQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04e4,0x119));var _0x404e=function(_0x293ffa,_0x49a07d){_0x293ffa=_0x293ffa-0x0;var _0x2b8c0f=_0x04e4[_0x293ffa];return _0x2b8c0f;};'use strict';var client=require('../client');exports[_0x404e('0x0')]=function(){return function(){return client[_0x404e('0x1')](_0x404e('0x2'),{'options':{'raw':![],'attributes':['id',_0x404e('0x3'),'timeout','strategy'],'include':[{'model':_0x404e('0x4'),'as':'Agents','attributes':['id',_0x404e('0x3'),'online',_0x404e('0x5')]}]},'log':_0x404e('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 11b375c..1f06e9b 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 _0x461d=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x3ae567,_0x9ba948){var _0x15f01e=function(_0xd39b1b){while(--_0xd39b1b){_0x3ae567['push'](_0x3ae567['shift']());}};_0x15f01e(++_0x9ba948);}(_0x461d,0x1b7));var _0xd461=function(_0xf1a5d,_0xb2902d){_0xf1a5d=_0xf1a5d-0x0;var _0x282173=_0x461d[_0xf1a5d];return _0x282173;};'use strict';var client=require(_0xd461('0x0'));exports[_0xd461('0x1')]=function(_0x4409de){return client[_0xd461('0x2')](_0xd461('0x3'),{'body':_0x4409de,'log':_0xd461('0x3')});};exports[_0xd461('0x4')]=function(_0x662f55,_0x27c83a){return client[_0xd461('0x2')](_0xd461('0x5'),{'body':_0x27c83a,'options':{'where':{'uniqueid':_0x662f55},'order':[['id',_0xd461('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xe409=['UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport','update','Request'];(function(_0x4ca88f,_0xbd5b23){var _0x4bd853=function(_0xac771f){while(--_0xac771f){_0x4ca88f['push'](_0x4ca88f['shift']());}};_0x4bd853(++_0xbd5b23);}(_0xe409,0x1d7));var _0x9e40=function(_0x4c4d43,_0x2fd7c2){_0x4c4d43=_0x4c4d43-0x0;var _0x25e8b1=_0xe409[_0x4c4d43];return _0x25e8b1;};'use strict';var client=require(_0x9e40('0x0'));exports[_0x9e40('0x1')]=function(_0x25eb76){return client['Request']('CreateFaxQueueReport',{'body':_0x25eb76,'log':_0x9e40('0x2')});};exports[_0x9e40('0x3')]=function(_0x20b953,_0x18cfff){return client[_0x9e40('0x4')](_0x9e40('0x5'),{'body':_0x18cfff,'options':{'where':{'uniqueid':_0x20b953},'order':[['id',_0x9e40('0x6')]],'limit':0x1},'log':_0x9e40('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ef6434e..4763077 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 _0xad7b=['Request','GetInterval','name','Intervals','../client','getIntervals'];(function(_0xc548e3,_0x5d3301){var _0x298ef2=function(_0x34dbbe){while(--_0x34dbbe){_0xc548e3['push'](_0xc548e3['shift']());}};_0x298ef2(++_0x5d3301);}(_0xad7b,0x1d2));var _0xbad7=function(_0x141755,_0x3980c8){_0x141755=_0x141755-0x0;var _0x5ceccc=_0xad7b[_0x141755];return _0x5ceccc;};'use strict';var client=require(_0xbad7('0x0'));exports[_0xbad7('0x1')]=function(){return function(){return client[_0xbad7('0x2')](_0xbad7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xbad7('0x4')],'include':[{'model':'Interval','as':_0xbad7('0x5'),'attributes':['id',_0xbad7('0x4'),'interval']}]},'log':_0xbad7('0x1')});};}; \ No newline at end of file +var _0xd294=['GetInterval','name','Interval','Intervals','interval','getIntervals','../client'];(function(_0x4154bf,_0x35a765){var _0x4a909e=function(_0x2381e1){while(--_0x2381e1){_0x4154bf['push'](_0x4154bf['shift']());}};_0x4a909e(++_0x35a765);}(_0xd294,0xc3));var _0x4d29=function(_0x1c99a3,_0x548477){_0x1c99a3=_0x1c99a3-0x0;var _0xa15162=_0xd294[_0x1c99a3];return _0xa15162;};'use strict';var client=require(_0x4d29('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x4d29('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4d29('0x2')],'include':[{'model':_0x4d29('0x3'),'as':_0x4d29('0x4'),'attributes':['id',_0x4d29('0x2'),_0x4d29('0x5')]}]},'log':_0x4d29('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index fcd6bc5..74e510a 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 _0xe5af=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x47b266,_0x2ad556){var _0x25c0fa=function(_0x259960){while(--_0x259960){_0x47b266['push'](_0x47b266['shift']());}};_0x25c0fa(++_0x2ad556);}(_0xe5af,0x9c));var _0xfe5a=function(_0x4cc1de,_0x460c0d){_0x4cc1de=_0x4cc1de-0x0;var _0x1fb942=_0xe5af[_0x4cc1de];return _0x1fb942;};'use strict';var client=require('../client');exports[_0xfe5a('0x0')]=function(_0x189c37,_0x4b1845){return client[_0xfe5a('0x1')](_0xfe5a('0x2'),{'body':_0x4b1845,'options':{'where':{'id':_0x189c37}},'log':_0xfe5a('0x3')});};exports['addTags']=function(_0x1165e3,_0x48e3a7){return client['Request'](_0xfe5a('0x4'),{'body':_0x48e3a7,'options':{'where':{'id':_0x1165e3}},'log':_0xfe5a('0x5')});}; \ No newline at end of file +var _0xfef3=['../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x349424,_0x16b458){var _0x4a9509=function(_0x305b1d){while(--_0x305b1d){_0x349424['push'](_0x349424['shift']());}};_0x4a9509(++_0x16b458);}(_0xfef3,0x118));var _0x3fef=function(_0x4e0843,_0x5224b5){_0x4e0843=_0x4e0843-0x0;var _0x40d38d=_0xfef3[_0x4e0843];return _0x40d38d;};'use strict';var client=require(_0x3fef('0x0'));exports['update']=function(_0x3f2183,_0x494ae6){return client[_0x3fef('0x1')](_0x3fef('0x2'),{'body':_0x494ae6,'options':{'where':{'id':_0x3f2183}},'log':'updateMailInteraction'});};exports[_0x3fef('0x3')]=function(_0x3b71e5,_0x538f28){return client[_0x3fef('0x1')](_0x3fef('0x4'),{'body':_0x538f28,'options':{'where':{'id':_0x3b71e5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a5bc17b..58ebf95 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 _0x6d06=['../client','create','Request','CreateMailMessage'];(function(_0x30a9c,_0x38e15e){var _0x5dd294=function(_0x4f34eb){while(--_0x4f34eb){_0x30a9c['push'](_0x30a9c['shift']());}};_0x5dd294(++_0x38e15e);}(_0x6d06,0xb8));var _0x66d0=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6d06[_0x1c8c28];return _0x1f59b4;};'use strict';var client=require(_0x66d0('0x0'));exports[_0x66d0('0x1')]=function(_0x20032f){return client[_0x66d0('0x2')](_0x66d0('0x3'),{'body':_0x20032f,'log':'createMailMessage'});}; \ No newline at end of file +var _0xc7f0=['CreateMailMessage','create','Request'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xc7f0,0x115));var _0x0c7f=function(_0x533878,_0x5a70ae){_0x533878=_0x533878-0x0;var _0x514df4=_0xc7f0[_0x533878];return _0x514df4;};'use strict';var client=require('../client');exports[_0x0c7f('0x0')]=function(_0x3419b5){return client[_0x0c7f('0x1')](_0x0c7f('0x2'),{'body':_0x3419b5,'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 cc7e1da..78f5911 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 _0x89b4=['Request','GetMailQueue','timeout','User','name','getMailQueues'];(function(_0x2d102a,_0x2cdc0d){var _0x5c53ba=function(_0x493fbe){while(--_0x493fbe){_0x2d102a['push'](_0x2d102a['shift']());}};_0x5c53ba(++_0x2cdc0d);}(_0x89b4,0x1e0));var _0x489b=function(_0x1f593c,_0x4654c6){_0x1f593c=_0x1f593c-0x0;var _0x179b78=_0x89b4[_0x1f593c];return _0x179b78;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x489b('0x0')](_0x489b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x489b('0x2'),'strategy'],'include':[{'model':_0x489b('0x3'),'as':'Agents','attributes':['id',_0x489b('0x4'),'online','mailPause']}]},'log':_0x489b('0x5')});};}; \ No newline at end of file +var _0x19b5=['mailPause','getMailQueues','GetMailQueue','timeout','strategy','User','Agents','name','online'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x19b5,0xac));var _0x519b=function(_0x1b8d88,_0x34c12f){_0x1b8d88=_0x1b8d88-0x0;var _0x63962d=_0x19b5[_0x1b8d88];return _0x63962d;};'use strict';var client=require('../client');exports[_0x519b('0x0')]=function(){return function(){return client['Request'](_0x519b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x519b('0x2'),_0x519b('0x3')],'include':[{'model':_0x519b('0x4'),'as':_0x519b('0x5'),'attributes':['id',_0x519b('0x6'),_0x519b('0x7'),_0x519b('0x8')]}]},'log':_0x519b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 28cf34c..ef7e1b0 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 _0x1d7e=['DESC','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x1d7e,0xdd));var _0xe1d7=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1d7e[_0x126558];return _0x1f6d14;};'use strict';var client=require('../client');exports[_0xe1d7('0x0')]=function(_0x2b6b29){return client[_0xe1d7('0x1')](_0xe1d7('0x2'),{'body':_0x2b6b29,'log':'CreateMailQueueReport'});};exports['update']=function(_0x1613f3,_0x43cdde){return client[_0xe1d7('0x1')](_0xe1d7('0x3'),{'body':_0x43cdde,'options':{'where':{'uniqueid':_0x1613f3},'order':[['id',_0xe1d7('0x4')]],'limit':0x1},'log':_0xe1d7('0x3')});}; \ No newline at end of file +var _0xb56e=['../client','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0xfebb5a,_0x5b9cea){var _0x4ea0ba=function(_0x2dd224){while(--_0x2dd224){_0xfebb5a['push'](_0xfebb5a['shift']());}};_0x4ea0ba(++_0x5b9cea);}(_0xb56e,0xec));var _0xeb56=function(_0x542c6b,_0xe97c2a){_0x542c6b=_0x542c6b-0x0;var _0x1c00b1=_0xb56e[_0x542c6b];return _0x1c00b1;};'use strict';var client=require(_0xeb56('0x0'));exports['create']=function(_0x546c92){return client['Request'](_0xeb56('0x1'),{'body':_0x546c92,'log':'CreateMailQueueReport'});};exports[_0xeb56('0x2')]=function(_0x2fb101,_0x1a90f0){return client['Request']('UpdateMailQueueReport',{'body':_0x1a90f0,'options':{'where':{'uniqueid':_0x2fb101},'order':[['id','DESC']],'limit':0x1},'log':_0xeb56('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 5b3793f..17aa4f9 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 _0x7790=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction'];(function(_0x2c548a,_0x576774){var _0x27d8e1=function(_0x194523){while(--_0x194523){_0x2c548a['push'](_0x2c548a['shift']());}};_0x27d8e1(++_0x576774);}(_0x7790,0x159));var _0x0779=function(_0x483662,_0x17f92e){_0x483662=_0x483662-0x0;var _0x43ce63=_0x7790[_0x483662];return _0x43ce63;};'use strict';var client=require('../client');exports[_0x0779('0x0')]=function(_0x184830,_0x22e291){return client[_0x0779('0x1')](_0x0779('0x2'),{'body':_0x22e291,'options':{'where':{'id':_0x184830}},'log':_0x0779('0x3')});};exports[_0x0779('0x4')]=function(_0x3ef9d2,_0x3a5a96){return client['Request'](_0x0779('0x5'),{'body':_0x3a5a96,'options':{'where':{'id':_0x3ef9d2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x910e=['UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x52ac65,_0x59fff8){var _0x312f71=function(_0x13661e){while(--_0x13661e){_0x52ac65['push'](_0x52ac65['shift']());}};_0x312f71(++_0x59fff8);}(_0x910e,0x1c5));var _0xe910=function(_0x50765b,_0x84a913){_0x50765b=_0x50765b-0x0;var _0x82aaa5=_0x910e[_0x50765b];return _0x82aaa5;};'use strict';var client=require(_0xe910('0x0'));exports[_0xe910('0x1')]=function(_0xfc3d61,_0x482c29){return client[_0xe910('0x2')](_0xe910('0x3'),{'body':_0x482c29,'options':{'where':{'id':_0xfc3d61}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x5bdf4c,_0x4e7cc6){return client['Request'](_0xe910('0x4'),{'body':_0x4e7cc6,'options':{'where':{'id':_0x5bdf4c}},'log':_0xe910('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 9cca3ee..d047363 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 _0x22f1=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x22f1,0x112));var _0x122f=function(_0x4cbba5,_0x35d3b1){_0x4cbba5=_0x4cbba5-0x0;var _0x3e7542=_0x22f1[_0x4cbba5];return _0x3e7542;};'use strict';var client=require(_0x122f('0x0'));exports[_0x122f('0x1')]=function(_0x246195){return client[_0x122f('0x2')](_0x122f('0x3'),{'body':_0x246195,'log':_0x122f('0x4')});}; \ No newline at end of file +var _0x26ff=['create','Request','CreateOpenchannelMessage','../client'];(function(_0x1c56e2,_0x5a0e4f){var _0x27f824=function(_0x4e87d4){while(--_0x4e87d4){_0x1c56e2['push'](_0x1c56e2['shift']());}};_0x27f824(++_0x5a0e4f);}(_0x26ff,0x13f));var _0xf26f=function(_0x58a915,_0x3b4737){_0x58a915=_0x58a915-0x0;var _0x526f64=_0x26ff[_0x58a915];return _0x526f64;};'use strict';var client=require(_0xf26f('0x0'));exports[_0xf26f('0x1')]=function(_0x59962e){return client[_0xf26f('0x2')](_0xf26f('0x3'),{'body':_0x59962e,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 279276d..a12d317 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 _0x8d39=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','Agents','name','online','openchannelPause'];(function(_0x4906ca,_0x7cb8c0){var _0x493642=function(_0x3624fa){while(--_0x3624fa){_0x4906ca['push'](_0x4906ca['shift']());}};_0x493642(++_0x7cb8c0);}(_0x8d39,0x120));var _0x98d3=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8d39[_0x45d3f0];return _0x314b79;};'use strict';var client=require(_0x98d3('0x0'));exports[_0x98d3('0x1')]=function(){return function(){return client[_0x98d3('0x2')](_0x98d3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x98d3('0x4'),'strategy'],'include':[{'model':'User','as':_0x98d3('0x5'),'attributes':['id',_0x98d3('0x6'),_0x98d3('0x7'),_0x98d3('0x8')]}]},'log':_0x98d3('0x1')});};}; \ No newline at end of file +var _0xf281=['online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','Agents','name'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0xf281,0xba));var _0x1f28=function(_0x2882e7,_0x5e885f){_0x2882e7=_0x2882e7-0x0;var _0x75ef86=_0xf281[_0x2882e7];return _0x75ef86;};'use strict';var client=require('../client');exports[_0x1f28('0x0')]=function(){return function(){return client[_0x1f28('0x1')](_0x1f28('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1f28('0x3'),'strategy'],'include':[{'model':'User','as':_0x1f28('0x4'),'attributes':['id',_0x1f28('0x5'),_0x1f28('0x6'),_0x1f28('0x7')]}]},'log':_0x1f28('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 04408f4..a24a412 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 _0xcd9d=['../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x245641,_0x589ca1){var _0x255fa4=function(_0x1f0533){while(--_0x1f0533){_0x245641['push'](_0x245641['shift']());}};_0x255fa4(++_0x589ca1);}(_0xcd9d,0xfc));var _0xdcd9=function(_0x41bfe3,_0x4b5340){_0x41bfe3=_0x41bfe3-0x0;var _0x3167d9=_0xcd9d[_0x41bfe3];return _0x3167d9;};'use strict';var client=require(_0xdcd9('0x0'));exports['create']=function(_0x5873da){return client[_0xdcd9('0x1')](_0xdcd9('0x2'),{'body':_0x5873da,'log':_0xdcd9('0x2')});};exports[_0xdcd9('0x3')]=function(_0x5185cb,_0x5463ce){return client[_0xdcd9('0x1')](_0xdcd9('0x4'),{'body':_0x5463ce,'options':{'where':{'uniqueid':_0x5185cb},'order':[['id',_0xdcd9('0x5')]],'limit':0x1},'log':_0xdcd9('0x4')});}; \ No newline at end of file +var _0xd657=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','../client'];(function(_0x497c08,_0x155c10){var _0x1ef000=function(_0x6e26b8){while(--_0x6e26b8){_0x497c08['push'](_0x497c08['shift']());}};_0x1ef000(++_0x155c10);}(_0xd657,0x71));var _0x7d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd657[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7d65('0x0'));exports[_0x7d65('0x1')]=function(_0x1259a2){return client['Request'](_0x7d65('0x2'),{'body':_0x1259a2,'log':_0x7d65('0x2')});};exports[_0x7d65('0x3')]=function(_0xbe7268,_0xad695e){return client[_0x7d65('0x4')](_0x7d65('0x5'),{'body':_0xad695e,'options':{'where':{'uniqueid':_0xbe7268},'order':[['id','DESC']],'limit':0x1},'log':_0x7d65('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ec23d76..9789939 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 _0x7d86=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x530e5d,_0x5e9bd4){var _0x1ec359=function(_0x4a1399){while(--_0x4a1399){_0x530e5d['push'](_0x530e5d['shift']());}};_0x1ec359(++_0x5e9bd4);}(_0x7d86,0x86));var _0x67d8=function(_0x56fd51,_0x5321c8){_0x56fd51=_0x56fd51-0x0;var _0x34cbca=_0x7d86[_0x56fd51];return _0x34cbca;};'use strict';var client=require(_0x67d8('0x0'));exports['update']=function(_0xff82a6,_0x8af490){return client[_0x67d8('0x1')](_0x67d8('0x2'),{'body':_0x8af490,'options':{'where':{'id':_0xff82a6}},'log':_0x67d8('0x3')});};exports[_0x67d8('0x4')]=function(_0x3f58a1,_0x517caf){return client[_0x67d8('0x1')](_0x67d8('0x5'),{'body':_0x517caf,'options':{'where':{'id':_0x3f58a1}},'log':_0x67d8('0x6')});}; \ No newline at end of file +var _0x35d0=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x2b97d4,_0x523c0e){var _0x48419f=function(_0xe77f5b){while(--_0xe77f5b){_0x2b97d4['push'](_0x2b97d4['shift']());}};_0x48419f(++_0x523c0e);}(_0x35d0,0xf9));var _0x035d=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x35d0[_0x44cb92];return _0x56b9e6;};'use strict';var client=require(_0x035d('0x0'));exports[_0x035d('0x1')]=function(_0x5ce143,_0x1b6251){return client[_0x035d('0x2')](_0x035d('0x3'),{'body':_0x1b6251,'options':{'where':{'id':_0x5ce143}},'log':_0x035d('0x4')});};exports[_0x035d('0x5')]=function(_0x16388a,_0x51fe09){return client[_0x035d('0x2')](_0x035d('0x6'),{'body':_0x51fe09,'options':{'where':{'id':_0x16388a}},'log':_0x035d('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3a82e26..98c83d7 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 _0xd591=['create','Request','CreateSmsMessage'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd591,0x1d7));var _0x1d59=function(_0x3272e4,_0x5c5535){_0x3272e4=_0x3272e4-0x0;var _0x40adc4=_0xd591[_0x3272e4];return _0x40adc4;};'use strict';var client=require('../client');exports[_0x1d59('0x0')]=function(_0x40532d){return client[_0x1d59('0x1')](_0x1d59('0x2'),{'body':_0x40532d,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xc3a9=['CreateSmsMessage','../client','create','Request'];(function(_0x309be0,_0x5704f3){var _0x324e18=function(_0x144a65){while(--_0x144a65){_0x309be0['push'](_0x309be0['shift']());}};_0x324e18(++_0x5704f3);}(_0xc3a9,0xa9));var _0x9c3a=function(_0x421b08,_0x38960d){_0x421b08=_0x421b08-0x0;var _0x285869=_0xc3a9[_0x421b08];return _0x285869;};'use strict';var client=require(_0x9c3a('0x0'));exports[_0x9c3a('0x1')]=function(_0x1da2c3){return client[_0x9c3a('0x2')](_0x9c3a('0x3'),{'body':_0x1da2c3,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d057952..6b2162b 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2f3b14,_0x554f94){var _0x20e924=function(_0x3f4c1c){while(--_0x3f4c1c){_0x2f3b14['push'](_0x2f3b14['shift']());}};_0x20e924(++_0x554f94);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4a944e,_0x4143d8){var _0x1da079=function(_0x425393){while(--_0x425393){_0x4a944e['push'](_0x4a944e['shift']());}};_0x1da079(++_0x4143d8);}(_0x70e0,0x17b));var _0x070e=function(_0x47f401,_0x3fa9c2){_0x47f401=_0x47f401-0x0;var _0x39f901=_0x70e0[_0x47f401];return _0x39f901;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 96e19ab..0216d6e 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x178d73,_0x5272d2){var _0x479a86=function(_0x50469a){while(--_0x50469a){_0x178d73['push'](_0x178d73['shift']());}};_0x479a86(++_0x5272d2);}(_0x34e8,0x12c));var _0x834e=function(_0x128798,_0x1bc1cb){_0x128798=_0x128798-0x0;var _0x138427=_0x34e8[_0x128798];return _0x138427;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x48d282,_0x56dc03){var _0x4ac866=function(_0x45d583){while(--_0x45d583){_0x48d282['push'](_0x48d282['shift']());}};_0x4ac866(++_0x56dc03);}(_0x55ca,0x126));var _0xa55c=function(_0x32e865,_0x317078){_0x32e865=_0x32e865-0x0;var _0x850461=_0x55ca[_0x32e865];return _0x850461;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4ae8274..c19624a 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(_0x32b7a8,_0xb17062){var _0x133ade=function(_0x1667f8){while(--_0x1667f8){_0x32b7a8['push'](_0x32b7a8['shift']());}};_0x133ade(++_0xb17062);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x117f55,_0x45250f){var _0x514658=function(_0x2c3e3f){while(--_0x2c3e3f){_0x117f55['push'](_0x117f55['shift']());}};_0x514658(++_0x45250f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 d5c3942..91ea446 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 _0x524e=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x577f24,_0x415e8c){var _0x4b82f7=function(_0x5239f9){while(--_0x5239f9){_0x577f24['push'](_0x577f24['shift']());}};_0x4b82f7(++_0x415e8c);}(_0x524e,0x15e));var _0xe524=function(_0x328805,_0x3c2e78){_0x328805=_0x328805-0x0;var _0x52f22c=_0x524e[_0x328805];return _0x52f22c;};'use strict';var client=require('../client');exports['update']=function(_0x353d8a,_0x154ece){return client[_0xe524('0x0')](_0xe524('0x1'),{'body':_0x154ece,'options':{'where':{'id':_0x353d8a}},'log':_0xe524('0x2')});};exports[_0xe524('0x3')]=function(_0xabd694,_0x32c90b){return client[_0xe524('0x0')](_0xe524('0x4'),{'body':_0x32c90b,'options':{'where':{'id':_0xabd694}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x9e2e=['Request','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x1a1eb4,_0x116c17){var _0x280f6c=function(_0x4159e2){while(--_0x4159e2){_0x1a1eb4['push'](_0x1a1eb4['shift']());}};_0x280f6c(++_0x116c17);}(_0x9e2e,0xd6));var _0xe9e2=function(_0xffa3f5,_0x115c05){_0xffa3f5=_0xffa3f5-0x0;var _0x2b8cfb=_0x9e2e[_0xffa3f5];return _0x2b8cfb;};'use strict';var client=require(_0xe9e2('0x0'));exports[_0xe9e2('0x1')]=function(_0xbecc50,_0x494152){return client[_0xe9e2('0x2')]('UpdateWhatsappInteraction',{'body':_0x494152,'options':{'where':{'id':_0xbecc50}},'log':'updateWhatsappInteraction'});};exports[_0xe9e2('0x3')]=function(_0x11a0e5,_0x3bfa90){return client[_0xe9e2('0x2')](_0xe9e2('0x4'),{'body':_0x3bfa90,'options':{'where':{'id':_0x11a0e5}},'log':_0xe9e2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index b5a8129..a6dee31 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 _0x578f=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x578f,0x1e0));var _0xf578=function(_0x440b56,_0x3219ee){_0x440b56=_0x440b56-0x0;var _0x2da148=_0x578f[_0x440b56];return _0x2da148;};'use strict';var client=require(_0xf578('0x0'));exports[_0xf578('0x1')]=function(_0x2b45f2){return client[_0xf578('0x2')](_0xf578('0x3'),{'body':_0x2b45f2,'log':_0xf578('0x4')});}; \ No newline at end of file +var _0x7f0d=['createWhatsappMessage','../client','create'];(function(_0x1d55cc,_0x312b90){var _0x16f6a6=function(_0x3735bf){while(--_0x3735bf){_0x1d55cc['push'](_0x1d55cc['shift']());}};_0x16f6a6(++_0x312b90);}(_0x7f0d,0x10c));var _0xd7f0=function(_0x2f6a0b,_0x18ff4f){_0x2f6a0b=_0x2f6a0b-0x0;var _0x18a1e6=_0x7f0d[_0x2f6a0b];return _0x18a1e6;};'use strict';var client=require(_0xd7f0('0x0'));exports[_0xd7f0('0x1')]=function(_0x1d0e1e){return client['Request']('CreateWhatsappMessage',{'body':_0x1d0e1e,'log':_0xd7f0('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3a3c770..e318a7d 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 _0x82f0=['../client','getWhatsappQueues','Request','name','Agents','whatsappPause'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x82f0,0x17a));var _0x082f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x82f0[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x082f('0x0'));exports[_0x082f('0x1')]=function(){return function(){return client[_0x082f('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x082f('0x3'),'timeout','strategy'],'include':[{'model':'User','as':_0x082f('0x4'),'attributes':['id','name','online',_0x082f('0x5')]}]},'log':_0x082f('0x1')});};}; \ No newline at end of file +var _0x1082=['online','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout','User'];(function(_0x5a153d,_0x79157b){var _0x5b01f8=function(_0x140496){while(--_0x140496){_0x5a153d['push'](_0x5a153d['shift']());}};_0x5b01f8(++_0x79157b);}(_0x1082,0xca));var _0x2108=function(_0x4024a8,_0x24792b){_0x4024a8=_0x4024a8-0x0;var _0x4d7178=_0x1082[_0x4024a8];return _0x4d7178;};'use strict';var client=require(_0x2108('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x2108('0x1')](_0x2108('0x2'),{'options':{'raw':![],'attributes':['id',_0x2108('0x3'),_0x2108('0x4'),'strategy'],'include':[{'model':_0x2108('0x5'),'as':'Agents','attributes':['id',_0x2108('0x3'),_0x2108('0x6'),'whatsappPause']}]},'log':_0x2108('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 96d3301..cc8818c 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 _0xec1c=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0xec1c,0x1ba));var _0xcec1=function(_0x5cb7dd,_0x290cfb){_0x5cb7dd=_0x5cb7dd-0x0;var _0x5ee23e=_0xec1c[_0x5cb7dd];return _0x5ee23e;};'use strict';var client=require(_0xcec1('0x0'));exports['create']=function(_0x32a0ae){return client[_0xcec1('0x1')]('CreateWhatsappQueueReport',{'body':_0x32a0ae,'log':_0xcec1('0x2')});};exports[_0xcec1('0x3')]=function(_0x14c152,_0x2f07f8){return client[_0xcec1('0x1')](_0xcec1('0x4'),{'body':_0x2f07f8,'options':{'where':{'uniqueid':_0x14c152},'order':[['id',_0xcec1('0x5')]],'limit':0x1},'log':_0xcec1('0x4')});}; \ No newline at end of file +var _0x0d19=['DESC','UpdateWhatsappQueueReport','create','Request','CreateWhatsappQueueReport','update'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x0d19,0x164));var _0x90d1=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x0d19[_0xa3c06b];return _0x33aa1d;};'use strict';var client=require('../client');exports[_0x90d1('0x0')]=function(_0x35eff0){return client[_0x90d1('0x1')](_0x90d1('0x2'),{'body':_0x35eff0,'log':'CreateWhatsappQueueReport'});};exports[_0x90d1('0x3')]=function(_0x51fa66,_0x396c21){return client[_0x90d1('0x1')]('UpdateWhatsappQueueReport',{'body':_0x396c21,'options':{'where':{'uniqueid':_0x51fa66},'order':[['id',_0x90d1('0x4')]],'limit':0x1},'log':_0x90d1('0x5')});}; \ 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 863a029..0a82be9 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 _0x5b22=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','name','timeout','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy'];(function(_0x17854e,_0x4ecf36){var _0x23707d=function(_0x2f0e8d){while(--_0x2f0e8d){_0x17854e['push'](_0x17854e['shift']());}};_0x23707d(++_0x4ecf36);}(_0x5b22,0x19e));var _0x25b2=function(_0x2d5971,_0x47a3e7){_0x2d5971=_0x2d5971-0x0;var _0x5005fc=_0x5b22[_0x2d5971];return _0x5005fc;};'use strict';var schema=require(_0x25b2('0x0'));var _=require(_0x25b2('0x1'));var util=require('util');var seqqueue=require(_0x25b2('0x2'));var logger=require(_0x25b2('0x3'))(_0x25b2('0x4'));var strategy=require(_0x25b2('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x25b2('0x6')},'timeout':{'type':_0x25b2('0x7'),'message':_0x25b2('0x8')}});function writeLog(_0x2024ce,_0x4686cd,_0x16e310){return logger[_0x25b2('0x9')](util['format'](_0x25b2('0xa'),_0x2024ce,_0x4686cd['name'],_0x16e310));}function handleFindAgent(_0x2a3843){return function(_0x51017e){return _0x51017e['name']['toLowerCase']()===_0x2a3843[_0x25b2('0xb')]();};}exports[_0x25b2('0xc')]=function(_0xf1d361,_0x14acfb,_0x194084,_0x2c08ac){return function(_0x18cb47){try{var _0x5bbc0c={'name':_0x14acfb[0x0],'timeout':_0x14acfb[0x1]};var _0x5d89d3=queue[_0x25b2('0x0')](_0x5bbc0c,{'typecast':!![]});if(_0x5d89d3[_0x25b2('0xd')]){logger[_0x25b2('0xe')](_0x25b2('0xf'),_0xf1d361,_[_0x25b2('0x10')](_0x5d89d3,_0x25b2('0x11'))['join'](',\x20'));_0x18cb47[_0x25b2('0x12')]();}else{var _0x2d29a0=_[_0x25b2('0x13')](_0x194084[_0x25b2('0x14')],handleFindAgent(_0x5bbc0c[_0x25b2('0x15')]));if(_0x2d29a0){var _0x52ad3b=(_0x5bbc0c[_0x25b2('0x16')]||0xa)*0x3e8;var _0x355f6b,_0x29c5da;var _0x186129=seqqueue[_0x25b2('0x17')](_0x52ad3b);_0x186129['id']=_0xf1d361;_0x186129[_0x25b2('0x18')]=_0x52ad3b;_0x186129[_0x25b2('0x19')]=_0x2c08ac[_0x25b2('0x19')];writeLog(_0xf1d361,_0x2d29a0,util['format'](_0x25b2('0x1a'),_0x52ad3b));_0x194084[_0x25b2('0x1b')][_0xf1d361]['on']('end',function(){logger[_0x25b2('0x9')](_0x25b2('0x1c'),_0xf1d361);clearTimeout(_0x29c5da);_0x29c5da=undefined;_0x186129[_0x25b2('0x1d')]();if(_0x194084['rules'][_0xf1d361]){delete _0x194084['rules'][_0xf1d361];}_0x18cb47['stop']();});_0x194084['rules'][_0xf1d361]['on']('complete',function(){if(_0x194084[_0x25b2('0x1b')][_0xf1d361]){delete _0x194084[_0x25b2('0x1b')][_0xf1d361];}});_0x29c5da=setTimeout(function(){logger['info'](_0x25b2('0x1e'),_0xf1d361);clearTimeout(_0x29c5da);_0x186129[_0x25b2('0x1d')]();_0x18cb47['next']();},_0x52ad3b);strategy['agent'](_0x186129,_0x2d29a0,_0x194084,_0x2c08ac);}else{logger[_0x25b2('0xe')](_0x25b2('0x1f'),_0xf1d361,_0x5bbc0c['name']);_0x18cb47[_0x25b2('0x12')]();}}}catch(_0x1ba26b){console[_0x25b2('0x20')](_0x1ba26b);logger[_0x25b2('0xe')](_0x25b2('0x21'),_0xf1d361,_0x1ba26b[_0x25b2('0x22')]);_0x18cb47[_0x25b2('0x12')]();}};}; \ No newline at end of file +var _0x1c00=['message','join','agents','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map'];(function(_0x3909ae,_0x3183c7){var _0x15000b=function(_0x591ff5){while(--_0x591ff5){_0x3909ae['push'](_0x3909ae['shift']());}};_0x15000b(++_0x3183c7);}(_0x1c00,0x1dd));var _0x01c0=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1c00[_0x1f9f37];return _0x21c080;};'use strict';var schema=require(_0x01c0('0x0'));var _=require(_0x01c0('0x1'));var util=require(_0x01c0('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x01c0('0x3'))(_0x01c0('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x01c0('0x5')},'timeout':{'type':_0x01c0('0x6'),'message':_0x01c0('0x7')}});function writeLog(_0x1d72a7,_0x47a7ab,_0x231a87){return logger[_0x01c0('0x8')](util[_0x01c0('0x9')](_0x01c0('0xa'),_0x1d72a7,_0x47a7ab[_0x01c0('0xb')],_0x231a87));}function handleFindAgent(_0x2184d5){return function(_0x51aad0){return _0x51aad0[_0x01c0('0xb')]['toLowerCase']()===_0x2184d5[_0x01c0('0xc')]();};}exports[_0x01c0('0xd')]=function(_0x702a18,_0x406925,_0x4d2069,_0x130c21){return function(_0x5b6d61){try{var _0x1af5e1={'name':_0x406925[0x0],'timeout':_0x406925[0x1]};var _0x1bef56=queue[_0x01c0('0x0')](_0x1af5e1,{'typecast':!![]});if(_0x1bef56[_0x01c0('0xe')]){logger[_0x01c0('0xf')](_0x01c0('0x10'),_0x702a18,_[_0x01c0('0x11')](_0x1bef56,_0x01c0('0x12'))[_0x01c0('0x13')](',\x20'));_0x5b6d61['stop']();}else{var _0xf9d70=_['find'](_0x4d2069[_0x01c0('0x14')],handleFindAgent(_0x1af5e1[_0x01c0('0xb')]));if(_0xf9d70){var _0x41fd27=(_0x1af5e1['timeout']||0xa)*0x3e8;var _0x31d187,_0x1dd043;var _0x142db5=seqqueue['createQueue'](_0x41fd27);_0x142db5['id']=_0x702a18;_0x142db5['atimeout']=_0x41fd27;_0x142db5[_0x01c0('0x15')]=_0x130c21[_0x01c0('0x15')];writeLog(_0x702a18,_0xf9d70,util[_0x01c0('0x9')](_0x01c0('0x16'),_0x41fd27));_0x4d2069[_0x01c0('0x17')][_0x702a18]['on']('end',function(){logger[_0x01c0('0x8')](_0x01c0('0x18'),_0x702a18);clearTimeout(_0x1dd043);_0x1dd043=undefined;_0x142db5[_0x01c0('0x19')]();if(_0x4d2069['rules'][_0x702a18]){delete _0x4d2069[_0x01c0('0x17')][_0x702a18];}_0x5b6d61[_0x01c0('0x1a')]();});_0x4d2069[_0x01c0('0x17')][_0x702a18]['on'](_0x01c0('0x1b'),function(){if(_0x4d2069[_0x01c0('0x17')][_0x702a18]){delete _0x4d2069[_0x01c0('0x17')][_0x702a18];}});_0x1dd043=setTimeout(function(){logger[_0x01c0('0x8')](_0x01c0('0x1c'),_0x702a18);clearTimeout(_0x1dd043);_0x142db5['close']();_0x5b6d61['next']();},_0x41fd27);strategy[_0x01c0('0x1d')](_0x142db5,_0xf9d70,_0x4d2069,_0x130c21);}else{logger[_0x01c0('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x702a18,_0x1af5e1[_0x01c0('0xb')]);_0x5b6d61[_0x01c0('0x1a')]();}}}catch(_0xb88fd8){console[_0x01c0('0x1e')](_0xb88fd8);logger[_0x01c0('0xf')](_0x01c0('0x1f'),_0x702a18,_0xb88fd8[_0x01c0('0x20')]);_0x5b6d61[_0x01c0('0x1a')]();}};}; \ 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 c2e0f05..2460776 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 _0xae65=['LexRuntime','toString','message','next','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0xae65,0xca));var _0x5ae6=function(_0x3dfbc3,_0x41a601){_0x3dfbc3=_0x3dfbc3-0x0;var _0x53fc9e=_0xae65[_0x3dfbc3];return _0x53fc9e;};'use strict';var _=require(_0x5ae6('0x0'));var moment=require(_0x5ae6('0x1'));var AWS=require(_0x5ae6('0x2'));var utils=require('./utils');var logger=require(_0x5ae6('0x3'))(_0x5ae6('0x4'));var rpc={'chatMessage':require(_0x5ae6('0x5')),'openchannelMessage':require(_0x5ae6('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5ae6('0x7')),'faxMessage':require(_0x5ae6('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x5ae6('0x9')]=function(_0x1bc574,_0x3f105c){return function(_0x2b4d03){try{if(!_['isNil'](this[_0x5ae6('0xa')][_0x5ae6('0xb')])){logger['info'](_0x5ae6('0xc'),_0x1bc574,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2b4d03['next']();}var _0x2ab7c5={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5ae6('0xd')](_0x5ae6('0xe')),'direction':_0x5ae6('0xf')};if(this[_0x5ae6('0x10')]===_0x5ae6('0x11')||this[_0x5ae6('0x10')]==='whatsapp'){_0x2ab7c5[_0x5ae6('0x12')]=this[_0x5ae6('0xa')][_0x5ae6('0x12')];}var _0x140f31=this[_0x5ae6('0x10')];if(_0x140f31===_0x5ae6('0x13')){_0x2ab7c5[_0x5ae6('0x14')]=this[_0x5ae6('0x15')]['id'];}else{_0x2ab7c5[_[_0x5ae6('0x16')](_0x140f31)+_0x5ae6('0x17')]=this[_0x5ae6('0x15')]['id'];}_0x2ab7c5[_[_0x5ae6('0x16')](_0x140f31)+_0x5ae6('0x18')]=this['interaction']['id'];if(this[_0x5ae6('0xa')][_0x5ae6('0x19')]){var _0x138b38=_0x3f105c[0x4];if(!_[_0x5ae6('0x1a')](_0x138b38)){_0x2ab7c5[_0x5ae6('0x1b')]=utils[_0x5ae6('0x1c')](_0x138b38,this);return rpc[_0x140f31+_0x5ae6('0x1d')][_0x5ae6('0x1e')](_0x2ab7c5)[_0x5ae6('0x1f')](function(_0x5ac31e){logger[_0x5ae6('0x20')](_0x5ae6('0xc'),_0x1bc574,_0x2ab7c5[_0x5ae6('0x1b')]);})[_0x5ae6('0x21')](function(_0x3dae9f){logger[_0x5ae6('0x22')](_0x5ae6('0xc'),_0x1bc574,JSON['stringify'](_0x3dae9f));})[_0x5ae6('0x23')](function(){logger[_0x5ae6('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1bc574);_0x2b4d03['stop']();});}else{logger[_0x5ae6('0x20')](_0x5ae6('0x24'),_0x1bc574);_0x2b4d03[_0x5ae6('0x25')]();}}else{var _0xf21e6d=this;var _0x335c79=new AWS[(_0x5ae6('0x26'))]({'accessKeyId':_0x3f105c[0x0],'secretAccessKey':_0x3f105c[0x1],'region':_0x3f105c[0x2]});var _0x4fe96c={'botAlias':'$LATEST','botName':_0x3f105c[0x3],'inputText':this['message'][_0x5ae6('0x1b')],'userId':this[_0x5ae6('0x10')]+':'+this[_0x5ae6('0xa')]['id'][_0x5ae6('0x27')]()};_0x335c79['postText'](_0x4fe96c,function(_0x1ef759,_0x1910e5){if(_0x1ef759){logger['error'](_0x5ae6('0xc'),_0x1bc574,_0x1ef759[_0x5ae6('0x28')]);_0x2b4d03[_0x5ae6('0x29')]();}else if(_0x1910e5&&_0x1910e5[_0x5ae6('0x28')]){_0xf21e6d['body'][_0x5ae6('0x2a')]=_0x1910e5;_0x2ab7c5[_0x5ae6('0x1b')]=_0x1910e5[_0x5ae6('0x28')];_0x2ab7c5[_0x5ae6('0x2b')]=_0x5ae6('0x2a');_0x2ab7c5[_0x5ae6('0x2c')]=JSON[_0x5ae6('0x2d')](_0x1910e5);return rpc[_0x140f31+_0x5ae6('0x1d')][_0x5ae6('0x1e')](_0x2ab7c5)['then'](function(_0x40ec01){logger[_0x5ae6('0x20')](_0x5ae6('0xc'),_0x1bc574,_0x2ab7c5[_0x5ae6('0x1b')]);if(_0x1910e5[_0x5ae6('0x2e')]==_0x5ae6('0x2f')){_0x2b4d03[_0x5ae6('0x29')]();}else{_0x2b4d03[_0x5ae6('0x25')]();}})['catch'](function(_0x43909c){logger[_0x5ae6('0x22')]('[%s][AMAZONLEX]\x20%s',_0x1bc574,JSON[_0x5ae6('0x2d')](_0x43909c));_0x2b4d03['next']();});}else{_0x2b4d03['next']();}});}}catch(_0x5ab948){logger[_0x5ae6('0x22')](_0x5ae6('0xc'),_0x1bc574,JSON[_0x5ae6('0x2d')](_0x5ab948));_0x2b4d03[_0x5ae6('0x25')]();}};}; \ No newline at end of file +var _0xd8e0=['UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','Message','create','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','postText','providerName','amazonlex','providerResponse','stringify','then','dialogState','next','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','interaction'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd8e0,0x18c));var _0x0d8e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd8e0[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var moment=require(_0x0d8e('0x0'));var AWS=require(_0x0d8e('0x1'));var utils=require('./utils');var logger=require(_0x0d8e('0x2'))(_0x0d8e('0x3'));var rpc={'chatMessage':require(_0x0d8e('0x4')),'openchannelMessage':require(_0x0d8e('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0d8e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x0d8e('0x7')]=function(_0x3fed00,_0x16e5b1){return function(_0x2b148b){try{if(!_['isNil'](this[_0x0d8e('0x8')][_0x0d8e('0x9')])){logger[_0x0d8e('0xa')](_0x0d8e('0xb'),_0x3fed00,_0x0d8e('0xc'));return _0x2b148b['next']();}var _0x53bcc4={'ContactId':this[_0x0d8e('0xd')]['id'],'sentAt':moment()[_0x0d8e('0xe')](_0x0d8e('0xf')),'direction':_0x0d8e('0x10')};if(this[_0x0d8e('0x11')]==='sms'||this[_0x0d8e('0x11')]===_0x0d8e('0x12')){_0x53bcc4[_0x0d8e('0x13')]=this['interaction']['phone'];}var _0x1fd5a8=this[_0x0d8e('0x11')];if(_0x1fd5a8==='chat'){_0x53bcc4[_0x0d8e('0x14')]=this[_0x0d8e('0x15')]['id'];}else{_0x53bcc4[_[_0x0d8e('0x16')](_0x1fd5a8)+_0x0d8e('0x17')]=this[_0x0d8e('0x15')]['id'];}_0x53bcc4[_[_0x0d8e('0x16')](_0x1fd5a8)+'InteractionId']=this[_0x0d8e('0x8')]['id'];if(this['interaction']['created']){var _0x232a7d=_0x16e5b1[0x4];if(!_[_0x0d8e('0x18')](_0x232a7d)){_0x53bcc4[_0x0d8e('0x19')]=utils['getMustacheRender'](_0x232a7d,this);return rpc[_0x1fd5a8+_0x0d8e('0x1a')][_0x0d8e('0x1b')](_0x53bcc4)['then'](function(_0x2bcff6){logger[_0x0d8e('0xa')](_0x0d8e('0xb'),_0x3fed00,_0x53bcc4[_0x0d8e('0x19')]);})[_0x0d8e('0x1c')](function(_0x40d2e2){logger[_0x0d8e('0x1d')](_0x0d8e('0xb'),_0x3fed00,JSON['stringify'](_0x40d2e2));})[_0x0d8e('0x1e')](function(){logger[_0x0d8e('0xa')](_0x0d8e('0x1f'),_0x3fed00);_0x2b148b['stop']();});}else{logger[_0x0d8e('0xa')](_0x0d8e('0x20'),_0x3fed00);_0x2b148b[_0x0d8e('0x21')]();}}else{var _0x26825d=this;var _0x1bd823=new AWS[(_0x0d8e('0x22'))]({'accessKeyId':_0x16e5b1[0x0],'secretAccessKey':_0x16e5b1[0x1],'region':_0x16e5b1[0x2]});var _0x3e2776={'botAlias':_0x0d8e('0x23'),'botName':_0x16e5b1[0x3],'inputText':this[_0x0d8e('0x24')][_0x0d8e('0x19')],'userId':this[_0x0d8e('0x11')]+':'+this[_0x0d8e('0x8')]['id']['toString']()};_0x1bd823[_0x0d8e('0x25')](_0x3e2776,function(_0xb960c2,_0xe92dba){if(_0xb960c2){logger[_0x0d8e('0x1d')](_0x0d8e('0xb'),_0x3fed00,_0xb960c2['message']);_0x2b148b['next']();}else if(_0xe92dba&&_0xe92dba[_0x0d8e('0x24')]){_0x26825d[_0x0d8e('0x19')]['amazonlex']=_0xe92dba;_0x53bcc4[_0x0d8e('0x19')]=_0xe92dba[_0x0d8e('0x24')];_0x53bcc4[_0x0d8e('0x26')]=_0x0d8e('0x27');_0x53bcc4[_0x0d8e('0x28')]=JSON[_0x0d8e('0x29')](_0xe92dba);return rpc[_0x1fd5a8+_0x0d8e('0x1a')][_0x0d8e('0x1b')](_0x53bcc4)[_0x0d8e('0x2a')](function(_0xa0f19e){logger[_0x0d8e('0xa')]('[%s][AMAZONLEX]\x20%s',_0x3fed00,_0x53bcc4[_0x0d8e('0x19')]);if(_0xe92dba[_0x0d8e('0x2b')]=='Failed'){_0x2b148b[_0x0d8e('0x2c')]();}else{_0x2b148b[_0x0d8e('0x21')]();}})[_0x0d8e('0x1c')](function(_0x11e90b){logger[_0x0d8e('0x1d')](_0x0d8e('0xb'),_0x3fed00,JSON[_0x0d8e('0x29')](_0x11e90b));_0x2b148b[_0x0d8e('0x2c')]();});}else{_0x2b148b[_0x0d8e('0x2c')]();}});}}catch(_0x52f06){logger[_0x0d8e('0x1d')](_0x0d8e('0xb'),_0x3fed00,JSON[_0x0d8e('0x29')](_0x52f06));_0x2b148b[_0x0d8e('0x21')]();}};}; \ 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 d02c22b..367b386 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 _0xfc18=['contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','channel','phone','read','subject','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','service','Smtp','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','','headers','All','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','stop','moment','./utils','../../../../config/logger','routing','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../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)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent'];(function(_0x1c504b,_0x101e46){var _0x18a1c0=function(_0x45d67a){while(--_0x45d67a){_0x1c504b['push'](_0x1c504b['shift']());}};_0x18a1c0(++_0x101e46);}(_0xfc18,0xca));var _0x8fc1=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xfc18[_0x39e283];return _0x7de89f;};'use strict';var _=require('lodash');var moment=require(_0x8fc1('0x0'));var utils=require(_0x8fc1('0x1'));var logger=require(_0x8fc1('0x2'))(_0x8fc1('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8fc1('0x4')),'chatInteraction':require(_0x8fc1('0x5')),'openchannelInteraction':require(_0x8fc1('0x6')),'mailInteraction':require(_0x8fc1('0x7')),'smsInteraction':require(_0x8fc1('0x8')),'faxInteraction':require(_0x8fc1('0x9')),'whatsappInteraction':require(_0x8fc1('0xa'))};var mailRpc=require(_0x8fc1('0xb'));exports[_0x8fc1('0xc')]=function(_0x367f01,_0x55b878,_0x86df7,_0x5104a1){return function(_0x49d9fc){try{var _0x1832d3=this['channel'];if(_0x1832d3===_0x8fc1('0xd')&&_0x5104a1[_0x8fc1('0xe')][_0x8fc1('0xf')]){logger[_0x8fc1('0x10')](_0x8fc1('0x11'),_0x367f01,_0x8fc1('0x12'));return _0x49d9fc[_0x8fc1('0x13')]();}if(_0x55b878[0x0]==='1'&&(_[_0x8fc1('0x14')](this[_0x8fc1('0x15')][_0x8fc1('0x16')])||!this[_0x8fc1('0x15')][_0x8fc1('0x16')])){logger[_0x8fc1('0x10')](_0x8fc1('0x11'),_0x367f01,_0x8fc1('0x17'));return _0x49d9fc[_0x8fc1('0x13')]();}if(_0x55b878[0x0]==='2'&&this[_0x8fc1('0x15')]['autoreplyExecuted']){logger[_0x8fc1('0x10')](_0x8fc1('0x18'),_0x367f01,_0x8fc1('0x19'));return _0x49d9fc['next']();}var _0x543bdf={'ContactId':this[_0x8fc1('0x1a')]['id'],'sentAt':moment()[_0x8fc1('0x1b')](_0x8fc1('0x1c')),'direction':'out'};if(this['channel']===_0x8fc1('0xd')){_0x543bdf[_0x8fc1('0xe')]=utils[_0x8fc1('0x1d')](_0x55b878[0x2],this);}else{_0x543bdf[_0x8fc1('0xe')]=utils[_0x8fc1('0x1d')](_0x55b878[0x1],this);}if(this[_0x8fc1('0x1e')]){_0x543bdf['to']=this[_0x8fc1('0x1e')][_0x8fc1('0x1f')]||'';if(this[_0x8fc1('0x20')]==='mail'&&_0x55b878[0x1]==='1'){_0x543bdf['cc']=this[_0x8fc1('0x1e')]['cc']||'';}_0x543bdf['from']=this['message']['to']||'';_0x543bdf['phone']=this['message'][_0x8fc1('0x21')]||'';_0x543bdf[_0x8fc1('0x22')]=!![];if(this['message']['subject']){_0x543bdf['subject']='';_0x543bdf[_0x8fc1('0x23')]+=_['startsWith'](this['message'][_0x8fc1('0x23')],_0x8fc1('0x24'))?'':'Re:\x20';_0x543bdf[_0x8fc1('0x23')]+=this[_0x8fc1('0x1e')]['subject'];}}if(this[_0x8fc1('0x20')]===_0x8fc1('0x25')){_0x543bdf[_0x8fc1('0x26')]=this[_0x8fc1('0x27')]['id'];}else{_0x543bdf[_[_0x8fc1('0x28')](this[_0x8fc1('0x20')])+_0x8fc1('0x29')]=this[_0x8fc1('0x27')]['id'];}_0x543bdf[_['upperFirst'](this[_0x8fc1('0x20')])+_0x8fc1('0x2a')]=this['interaction']['id'];var _0x2f9217=this[_0x8fc1('0x15')];if(rpc[this[_0x8fc1('0x20')]+'Message']){if(this[_0x8fc1('0x20')]===_0x8fc1('0xd')){var _0x33b18c={'tls':{'rejectUnauthorized':![]}};if(this[_0x8fc1('0x27')]['Smtp']['service']){_0x33b18c[_0x8fc1('0x2b')]=this['account'][_0x8fc1('0x2c')][_0x8fc1('0x2b')];}else{_0x33b18c[_0x8fc1('0x2d')]=this['account'][_0x8fc1('0x2c')][_0x8fc1('0x2d')];_0x33b18c['port']=this[_0x8fc1('0x27')]['Smtp'][_0x8fc1('0x2e')];_0x33b18c['secure']=this[_0x8fc1('0x27')]['Smtp'][_0x8fc1('0x2f')];}if(this[_0x8fc1('0x27')][_0x8fc1('0x2c')][_0x8fc1('0x30')]){_0x33b18c[_0x8fc1('0x31')]={'user':this[_0x8fc1('0x27')]['Smtp'][_0x8fc1('0x32')],'pass':this[_0x8fc1('0x27')][_0x8fc1('0x2c')][_0x8fc1('0x33')]};}_0x543bdf[_0x8fc1('0x34')]=this[_0x8fc1('0x1e')][_0x8fc1('0x35')];_0x543bdf['html']=_0x8fc1('0x36')+_['replace'](_0x543bdf['body'],_0x8fc1('0x37'),_0x8fc1('0x38'))+_0x8fc1('0x39');_0x543bdf[_0x8fc1('0x3a')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x8fc1('0x3b'),'Precedence':_0x8fc1('0x3c')};return mailRpc['sendMailMessage'](_0x33b18c,_0x543bdf)['then'](function(_0x3937f9){logger['info'](_0x8fc1('0x3d'),_0x367f01);_0x543bdf['messageId']=_0x3937f9['message'][_0x8fc1('0x35')];return rpc[_0x1832d3+'Message'][_0x8fc1('0x3e')](_0x543bdf);})[_0x8fc1('0x3f')](function(_0x32119f){logger[_0x8fc1('0x10')](_0x8fc1('0x11'),_0x367f01,JSON[_0x8fc1('0x40')](_0x32119f));})[_0x8fc1('0x41')](function(_0x47911f){logger[_0x8fc1('0x42')](_0x8fc1('0x43'),_0x367f01,JSON[_0x8fc1('0x40')](_0x47911f));})[_0x8fc1('0x44')](function(){Promise[_0x8fc1('0x45')]()[_0x8fc1('0x3f')](function(){if(_0x55b878[0x0]!=='2'||_0x2f9217[_0x8fc1('0x46')])return;return rpc[_0x1832d3+_0x8fc1('0x47')][_0x8fc1('0x48')](_0x2f9217['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3eb5b6){logger[_0x8fc1('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x367f01,JSON[_0x8fc1('0x40')](_0x3eb5b6));})[_0x8fc1('0x41')](function(_0x1bffb0){logger[_0x8fc1('0x42')](_0x8fc1('0x49'),_0x367f01,JSON[_0x8fc1('0x40')](_0x1bffb0));});})[_0x8fc1('0x3f')](function(){_0x49d9fc[_0x8fc1('0x13')]();});});}else{return rpc[this[_0x8fc1('0x20')]+_0x8fc1('0x4a')][_0x8fc1('0x3e')](_0x543bdf)[_0x8fc1('0x3f')](function(_0x3cd308){logger[_0x8fc1('0x10')](_0x8fc1('0x11'),_0x367f01,_0x543bdf[_0x8fc1('0xe')]);})[_0x8fc1('0x41')](function(_0x25e438){logger[_0x8fc1('0x42')](_0x8fc1('0x11'),_0x367f01,JSON['stringify'](_0x25e438));})[_0x8fc1('0x44')](function(){Promise[_0x8fc1('0x45')]()[_0x8fc1('0x3f')](function(){if(_0x55b878[0x0]!=='2'||_0x2f9217['autoreplyExecuted'])return;return rpc[_0x1832d3+'Interaction'][_0x8fc1('0x48')](_0x2f9217['id'],{'autoreplyExecuted':!![]})['then'](function(_0x594763){logger[_0x8fc1('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x367f01,JSON['stringify'](_0x594763));})[_0x8fc1('0x41')](function(_0x8748e6){logger[_0x8fc1('0x42')](_0x8fc1('0x49'),_0x367f01,JSON[_0x8fc1('0x40')](_0x8748e6));});})[_0x8fc1('0x3f')](function(){_0x49d9fc[_0x8fc1('0x13')]();});});}}}catch(_0x2ba1b2){logger[_0x8fc1('0x42')]('[%s][AUTOREPLY]\x20%s',_0x367f01,JSON['stringify'](_0x2ba1b2));_0x49d9fc[_0x8fc1('0x4b')]();}};}; \ No newline at end of file +var _0xb81d=['../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','next','isNil','created','Autoreply\x20already\x20sent','interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','service','Smtp','host','secure','authentication','user','pass','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','[%s][AUTOREPLY]\x20%s','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0xb81d,0xe0));var _0xdb81=function(_0x5faf83,_0xc7351d){_0x5faf83=_0x5faf83-0x0;var _0x1fc846=_0xb81d[_0x5faf83];return _0x1fc846;};'use strict';var _=require(_0xdb81('0x0'));var moment=require(_0xdb81('0x1'));var utils=require(_0xdb81('0x2'));var logger=require(_0xdb81('0x3'))('routing');var rpc={'chatMessage':require(_0xdb81('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdb81('0x5')),'smsMessage':require(_0xdb81('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xdb81('0x7')),'chatInteraction':require(_0xdb81('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xdb81('0x9')),'smsInteraction':require(_0xdb81('0xa')),'faxInteraction':require(_0xdb81('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xdb81('0xc'));exports['consequence']=function(_0x4a78c0,_0xce1468,_0x3e4ef1,_0x2bbe3b){return function(_0x4a0f08){try{var _0x21409d=this[_0xdb81('0xd')];if(_0x21409d===_0xdb81('0xe')&&_0x2bbe3b[_0xdb81('0xf')][_0xdb81('0x10')]){logger[_0xdb81('0x11')]('[%s][AUTOREPLY]\x20%s',_0x4a78c0,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4a0f08[_0xdb81('0x12')]();}if(_0xce1468[0x0]==='1'&&(_[_0xdb81('0x13')](this['interaction'][_0xdb81('0x14')])||!this['interaction'][_0xdb81('0x14')])){logger[_0xdb81('0x11')]('[%s][AUTOREPLY]\x20%s',_0x4a78c0,_0xdb81('0x15'));return _0x4a0f08[_0xdb81('0x12')]();}if(_0xce1468[0x0]==='2'&&this[_0xdb81('0x16')]['autoreplyExecuted']){logger[_0xdb81('0x11')](_0xdb81('0x17'),_0x4a78c0,_0xdb81('0x18'));return _0x4a0f08['next']();}var _0x637daa={'ContactId':this[_0xdb81('0x19')]['id'],'sentAt':moment()[_0xdb81('0x1a')](_0xdb81('0x1b')),'direction':_0xdb81('0x1c')};if(this[_0xdb81('0xd')]===_0xdb81('0xe')){_0x637daa[_0xdb81('0xf')]=utils[_0xdb81('0x1d')](_0xce1468[0x2],this);}else{_0x637daa[_0xdb81('0xf')]=utils[_0xdb81('0x1d')](_0xce1468[0x1],this);}if(this[_0xdb81('0x1e')]){_0x637daa['to']=this[_0xdb81('0x1e')][_0xdb81('0x1f')]||'';if(this[_0xdb81('0xd')]==='mail'&&_0xce1468[0x1]==='1'){_0x637daa['cc']=this[_0xdb81('0x1e')]['cc']||'';}_0x637daa[_0xdb81('0x1f')]=this[_0xdb81('0x1e')]['to']||'';_0x637daa[_0xdb81('0x20')]=this[_0xdb81('0x1e')][_0xdb81('0x20')]||'';_0x637daa[_0xdb81('0x21')]=!![];if(this['message']['subject']){_0x637daa['subject']='';_0x637daa[_0xdb81('0x22')]+=_['startsWith'](this[_0xdb81('0x1e')]['subject'],_0xdb81('0x23'))?'':_0xdb81('0x24');_0x637daa[_0xdb81('0x22')]+=this[_0xdb81('0x1e')]['subject'];}}if(this[_0xdb81('0xd')]===_0xdb81('0x25')){_0x637daa[_0xdb81('0x26')]=this['account']['id'];}else{_0x637daa[_[_0xdb81('0x27')](this[_0xdb81('0xd')])+_0xdb81('0x28')]=this[_0xdb81('0x29')]['id'];}_0x637daa[_[_0xdb81('0x27')](this[_0xdb81('0xd')])+_0xdb81('0x2a')]=this[_0xdb81('0x16')]['id'];var _0x27c4a0=this['interaction'];if(rpc[this[_0xdb81('0xd')]+'Message']){if(this[_0xdb81('0xd')]===_0xdb81('0xe')){var _0x3a3889={'tls':{'rejectUnauthorized':![]}};if(this[_0xdb81('0x29')]['Smtp'][_0xdb81('0x2b')]){_0x3a3889[_0xdb81('0x2b')]=this[_0xdb81('0x29')][_0xdb81('0x2c')][_0xdb81('0x2b')];}else{_0x3a3889['host']=this[_0xdb81('0x29')][_0xdb81('0x2c')][_0xdb81('0x2d')];_0x3a3889['port']=this[_0xdb81('0x29')][_0xdb81('0x2c')]['port'];_0x3a3889[_0xdb81('0x2e')]=this[_0xdb81('0x29')][_0xdb81('0x2c')][_0xdb81('0x2e')];}if(this['account']['Smtp'][_0xdb81('0x2f')]){_0x3a3889['auth']={'user':this['account'][_0xdb81('0x2c')][_0xdb81('0x30')],'pass':this['account'][_0xdb81('0x2c')][_0xdb81('0x31')]};}_0x637daa[_0xdb81('0x32')]=this['message'][_0xdb81('0x33')];_0x637daa['html']=_0xdb81('0x34')+_[_0xdb81('0x35')](_0x637daa[_0xdb81('0xf')],_0xdb81('0x36'),_0xdb81('0x37'))+_0xdb81('0x38');_0x637daa[_0xdb81('0x39')]={'Auto-Submitted':_0xdb81('0x3a'),'X-Auto-Response-Suppress':_0xdb81('0x3b'),'Precedence':_0xdb81('0x3c')};return mailRpc[_0xdb81('0x3d')](_0x3a3889,_0x637daa)[_0xdb81('0x3e')](function(_0x507e3a){logger[_0xdb81('0x11')](_0xdb81('0x3f'),_0x4a78c0);_0x637daa[_0xdb81('0x33')]=_0x507e3a[_0xdb81('0x1e')][_0xdb81('0x33')];return rpc[_0x21409d+_0xdb81('0x40')][_0xdb81('0x41')](_0x637daa);})['then'](function(_0x3758e2){logger[_0xdb81('0x11')](_0xdb81('0x42'),_0x4a78c0,JSON[_0xdb81('0x43')](_0x3758e2));})[_0xdb81('0x44')](function(_0xe7e694){logger[_0xdb81('0x45')](_0xdb81('0x46'),_0x4a78c0,JSON['stringify'](_0xe7e694));})[_0xdb81('0x47')](function(){Promise['resolve']()['then'](function(){if(_0xce1468[0x0]!=='2'||_0x27c4a0['autoreplyExecuted'])return;return rpc[_0x21409d+_0xdb81('0x48')][_0xdb81('0x49')](_0x27c4a0['id'],{'autoreplyExecuted':!![]})[_0xdb81('0x3e')](function(_0x5cb747){logger['info'](_0xdb81('0x17'),_0x4a78c0,JSON[_0xdb81('0x43')](_0x5cb747));})[_0xdb81('0x44')](function(_0x5bf3dd){logger[_0xdb81('0x45')](_0xdb81('0x4a'),_0x4a78c0,JSON['stringify'](_0x5bf3dd));});})[_0xdb81('0x3e')](function(){_0x4a0f08[_0xdb81('0x12')]();});});}else{return rpc[this['channel']+'Message'][_0xdb81('0x41')](_0x637daa)[_0xdb81('0x3e')](function(_0x24dc84){logger[_0xdb81('0x11')]('[%s][AUTOREPLY]\x20%s',_0x4a78c0,_0x637daa['body']);})[_0xdb81('0x44')](function(_0x5a92a8){logger[_0xdb81('0x45')](_0xdb81('0x42'),_0x4a78c0,JSON[_0xdb81('0x43')](_0x5a92a8));})['finally'](function(){Promise[_0xdb81('0x4b')]()[_0xdb81('0x3e')](function(){if(_0xce1468[0x0]!=='2'||_0x27c4a0['autoreplyExecuted'])return;return rpc[_0x21409d+_0xdb81('0x48')][_0xdb81('0x49')](_0x27c4a0['id'],{'autoreplyExecuted':!![]})[_0xdb81('0x3e')](function(_0xee5e79){logger['info'](_0xdb81('0x17'),_0x4a78c0,JSON['stringify'](_0xee5e79));})[_0xdb81('0x44')](function(_0x48a30f){logger['error'](_0xdb81('0x4a'),_0x4a78c0,JSON[_0xdb81('0x43')](_0x48a30f));});})[_0xdb81('0x3e')](function(){_0x4a0f08['next']();});});}}}catch(_0x232acb){logger['error'](_0xdb81('0x42'),_0x4a78c0,JSON[_0xdb81('0x43')](_0x232acb));_0x4a0f08[_0xdb81('0x4c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 2b98a6e..dd25dc7 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66a7=['stop','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','system','channel','Interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x482e02,_0xa9b634){var _0x5e1da8=function(_0x15b9c6){while(--_0x15b9c6){_0x482e02['push'](_0x482e02['shift']());}};_0x5e1da8(++_0xa9b634);}(_0x66a7,0xf8));var _0x766a=function(_0x366655,_0x4d032){_0x366655=_0x366655-0x0;var _0x11e076=_0x66a7[_0x366655];return _0x11e076;};'use strict';var moment=require(_0x766a('0x0'));var logger=require(_0x766a('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x766a('0x2')),'smsInteraction':require(_0x766a('0x3')),'mailInteraction':require(_0x766a('0x4')),'faxInteraction':require(_0x766a('0x5')),'whatsappInteraction':require(_0x766a('0x6'))};exports[_0x766a('0x7')]=function(_0x246fc6,_0xc5d0f6,_0x1c8cd5,_0x3ed5e2){return function(_0x4f0956){try{logger[_0x766a('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x246fc6,_0xc5d0f6[0x0]);var _0x3bced4={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x766a('0x9'),'disposition':_0xc5d0f6[0x0]};if(rpc[_0x3ed5e2[_0x766a('0xa')]+'Interaction']){rpc[_0x3ed5e2[_0x766a('0xa')]+_0x766a('0xb')]['update'](_0x3ed5e2['interaction']['id'],_0x3bced4)[_0x766a('0xc')](function(_0x2f9881){logger[_0x766a('0x8')](_0x766a('0xd'),_0x246fc6,_0x3ed5e2[_0x766a('0xe')]['id']);})['catch'](function(_0x309df6){logger['error'](_0x766a('0xf'),_0x246fc6,JSON[_0x766a('0x10')](_0x309df6));})[_0x766a('0x11')](function(){_0x4f0956[_0x766a('0x12')]();});}}catch(_0x2aea60){logger['error'](_0x766a('0xf'),_0x246fc6,JSON[_0x766a('0x10')](_0x2aea60));_0x4f0956[_0x766a('0x12')]();}};}; \ No newline at end of file +var _0xa5a6=['format','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','finally','stop','error','stringify','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0xa5a6,0x1ee));var _0x6a5a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa5a6[_0x9df060];return _0x338dfe;};'use strict';var moment=require(_0x6a5a('0x0'));var logger=require(_0x6a5a('0x1'))(_0x6a5a('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6a5a('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x6a5a('0x4')),'faxInteraction':require(_0x6a5a('0x5')),'whatsappInteraction':require(_0x6a5a('0x6'))};exports[_0x6a5a('0x7')]=function(_0x4b9dc2,_0x245793,_0x2f3d75,_0x18732e){return function(_0x3e4634){try{logger[_0x6a5a('0x8')](_0x6a5a('0x9'),_0x4b9dc2,_0x245793[0x0]);var _0x49583c={'closed':0x1,'closedAt':moment()[_0x6a5a('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x245793[0x0]};if(rpc[_0x18732e[_0x6a5a('0xb')]+_0x6a5a('0xc')]){rpc[_0x18732e[_0x6a5a('0xb')]+'Interaction'][_0x6a5a('0xd')](_0x18732e['interaction']['id'],_0x49583c)['then'](function(_0x4517c5){logger[_0x6a5a('0x8')](_0x6a5a('0xe'),_0x4b9dc2,_0x18732e['interaction']['id']);})[_0x6a5a('0xf')](function(_0x2e6873){logger['error'](_0x6a5a('0x10'),_0x4b9dc2,JSON['stringify'](_0x2e6873));})[_0x6a5a('0x11')](function(){_0x3e4634[_0x6a5a('0x12')]();});}}catch(_0x15c5f8){logger[_0x6a5a('0x13')](_0x6a5a('0x10'),_0x4b9dc2,JSON[_0x6a5a('0x14')](_0x15c5f8));_0x3e4634['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 6af9414..95ed1fd 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dc3=['getMustacheRender','Message','create','body','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','speech','result','metadata','endConversation','next','catch','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty'];(function(_0x28caba,_0x5a0657){var _0xa63ece=function(_0x2ab102){while(--_0x2ab102){_0x28caba['push'](_0x28caba['shift']());}};_0xa63ece(++_0x5a0657);}(_0x2dc3,0x127));var _0x32dc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2dc3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var moment=require(_0x32dc('0x0'));var apiai=require(_0x32dc('0x1'));var md5=require(_0x32dc('0x2'));var utils=require(_0x32dc('0x3'));var logger=require(_0x32dc('0x4'))(_0x32dc('0x5'));var rpc={'chatMessage':require(_0x32dc('0x6')),'openchannelMessage':require(_0x32dc('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x32dc('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x32dc('0x9')]=function(_0x52336b,_0x8f2cea){return function(_0x491a56){try{if(!_['isNil'](this[_0x32dc('0xa')]['UserId'])){logger[_0x32dc('0xb')](_0x32dc('0xc'),_0x52336b,_0x32dc('0xd'));return _0x491a56['next']();}var _0x4b368d={'ContactId':this[_0x32dc('0xe')]['id'],'sentAt':moment()[_0x32dc('0xf')](_0x32dc('0x10')),'direction':_0x32dc('0x11')};if(this[_0x32dc('0x12')]===_0x32dc('0x13')||this[_0x32dc('0x12')]==='whatsapp'){_0x4b368d[_0x32dc('0x14')]=this['interaction'][_0x32dc('0x14')];}var _0x27bf32=this[_0x32dc('0x12')];if(_0x27bf32==='chat'){_0x4b368d[_0x32dc('0x15')]=this[_0x32dc('0x16')]['id'];}else{_0x4b368d[_['upperFirst'](_0x27bf32)+_0x32dc('0x17')]=this['account']['id'];}_0x4b368d[_[_0x32dc('0x18')](_0x27bf32)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x32dc('0x19')]){var _0x328940=_0x8f2cea[0x2];if(!_[_0x32dc('0x1a')](_0x328940)){_0x4b368d['body']=utils[_0x32dc('0x1b')](_0x328940,this);return rpc[_0x27bf32+_0x32dc('0x1c')][_0x32dc('0x1d')](_0x4b368d)['then'](function(_0x36e287){logger[_0x32dc('0xb')](_0x32dc('0xc'),_0x52336b,_0x4b368d[_0x32dc('0x1e')]);})['catch'](function(_0x7e27ea){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON[_0x32dc('0x20')](_0x7e27ea));})[_0x32dc('0x21')](function(){logger[_0x32dc('0xb')](_0x32dc('0x22'),_0x52336b);_0x491a56[_0x32dc('0x23')]();});}else{logger['info'](_0x32dc('0x24'),_0x52336b);_0x491a56[_0x32dc('0x23')]();}}else{var _0xd8dd68=this;var _0x2a4bf9=apiai(_0x8f2cea[0x0],{'language':_0x8f2cea[0x1]||'en'});return _0x2a4bf9['textRequest'](this[_0x32dc('0x25')][_0x32dc('0x1e')],{'sessionId':md5(this[_0x32dc('0xa')]['id'])})[_0x32dc('0x26')](function(_0x57e1e3){_0xd8dd68[_0x32dc('0x1e')][_0x32dc('0x27')]=_0x57e1e3;_0x4b368d[_0x32dc('0x1e')]=_0x57e1e3['result']['fulfillment'][_0x32dc('0x28')];_0x4b368d['providerName']=_0x32dc('0x27');_0x4b368d['providerResponse']=JSON['stringify'](_0x57e1e3);return rpc[_0x27bf32+'Message'][_0x32dc('0x1d')](_0x4b368d)['then'](function(_0x6f190e){logger[_0x32dc('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x52336b,_0x4b368d[_0x32dc('0x1e')]);if(_0x57e1e3[_0x32dc('0x29')][_0x32dc('0x2a')][_0x32dc('0x2b')]){_0x491a56[_0x32dc('0x2c')]();}else{_0x491a56[_0x32dc('0x23')]();}})[_0x32dc('0x2d')](function(_0x53dd9e){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON['stringify'](_0x53dd9e));_0x491a56['next']();});})[_0x32dc('0x2d')](function(_0x51e50c){logger[_0x32dc('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x52336b,_0x51e50c[_0x32dc('0x25')]);_0x491a56[_0x32dc('0x2c')]();});}}catch(_0x5c6a63){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON[_0x32dc('0x20')](_0x5c6a63));_0x491a56['stop']();}};}; \ No newline at end of file +var _0x39c7=['stringify','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','Message','create','then','catch','stop','message','dialogflow','fulfillment','speech','metadata','endConversation','next','error'];(function(_0x388bfa,_0x1f518c){var _0x11d6a6=function(_0x40b0b3){while(--_0x40b0b3){_0x388bfa['push'](_0x388bfa['shift']());}};_0x11d6a6(++_0x1f518c);}(_0x39c7,0x85));var _0x739c=function(_0x38f50f,_0x15c382){_0x38f50f=_0x38f50f-0x0;var _0x4d06a5=_0x39c7[_0x38f50f];return _0x4d06a5;};'use strict';var _=require('lodash');var moment=require(_0x739c('0x0'));var apiai=require(_0x739c('0x1'));var md5=require(_0x739c('0x2'));var utils=require(_0x739c('0x3'));var logger=require(_0x739c('0x4'))(_0x739c('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x739c('0x6')),'mailMessage':require(_0x739c('0x7')),'smsMessage':require(_0x739c('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x739c('0x9')]=function(_0x3c0af1,_0x5df5d3){return function(_0x480159){try{if(!_[_0x739c('0xa')](this[_0x739c('0xb')]['UserId'])){logger[_0x739c('0xc')](_0x739c('0xd'),_0x3c0af1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x480159['next']();}var _0xd334={'ContactId':this[_0x739c('0xe')]['id'],'sentAt':moment()[_0x739c('0xf')](_0x739c('0x10')),'direction':_0x739c('0x11')};if(this[_0x739c('0x12')]===_0x739c('0x13')||this[_0x739c('0x12')]===_0x739c('0x14')){_0xd334[_0x739c('0x15')]=this[_0x739c('0xb')][_0x739c('0x15')];}var _0x5b8dab=this[_0x739c('0x12')];if(_0x5b8dab===_0x739c('0x16')){_0xd334[_0x739c('0x17')]=this[_0x739c('0x18')]['id'];}else{_0xd334[_[_0x739c('0x19')](_0x5b8dab)+_0x739c('0x1a')]=this[_0x739c('0x18')]['id'];}_0xd334[_[_0x739c('0x19')](_0x5b8dab)+_0x739c('0x1b')]=this[_0x739c('0xb')]['id'];if(this['interaction']['created']){var _0x362095=_0x5df5d3[0x2];if(!_[_0x739c('0x1c')](_0x362095)){_0xd334[_0x739c('0x1d')]=utils['getMustacheRender'](_0x362095,this);return rpc[_0x5b8dab+_0x739c('0x1e')][_0x739c('0x1f')](_0xd334)[_0x739c('0x20')](function(_0x25acc6){logger[_0x739c('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x3c0af1,_0xd334[_0x739c('0x1d')]);})[_0x739c('0x21')](function(_0x464b2f){logger['error'](_0x739c('0xd'),_0x3c0af1,JSON['stringify'](_0x464b2f));})['finally'](function(){logger[_0x739c('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3c0af1);_0x480159[_0x739c('0x22')]();});}else{logger[_0x739c('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3c0af1);_0x480159[_0x739c('0x22')]();}}else{var _0x4ab72d=this;var _0x147baf=apiai(_0x5df5d3[0x0],{'language':_0x5df5d3[0x1]||'en'});return _0x147baf['textRequest'](this[_0x739c('0x23')][_0x739c('0x1d')],{'sessionId':md5(this[_0x739c('0xb')]['id'])})[_0x739c('0x20')](function(_0x3799ef){_0x4ab72d[_0x739c('0x1d')][_0x739c('0x24')]=_0x3799ef;_0xd334[_0x739c('0x1d')]=_0x3799ef['result'][_0x739c('0x25')][_0x739c('0x26')];_0xd334['providerName']=_0x739c('0x24');_0xd334['providerResponse']=JSON['stringify'](_0x3799ef);return rpc[_0x5b8dab+_0x739c('0x1e')][_0x739c('0x1f')](_0xd334)[_0x739c('0x20')](function(_0x141807){logger[_0x739c('0xc')](_0x739c('0xd'),_0x3c0af1,_0xd334[_0x739c('0x1d')]);if(_0x3799ef['result'][_0x739c('0x27')][_0x739c('0x28')]){_0x480159[_0x739c('0x29')]();}else{_0x480159[_0x739c('0x22')]();}})[_0x739c('0x21')](function(_0x13c5d8){logger[_0x739c('0x2a')]('[%s][DIALOGFLOW]\x20%s',_0x3c0af1,JSON['stringify'](_0x13c5d8));_0x480159['next']();});})['catch'](function(_0xc0bda8){logger[_0x739c('0x2a')](_0x739c('0xd'),_0x3c0af1,_0xc0bda8[_0x739c('0x23')]);_0x480159[_0x739c('0x29')]();});}}catch(_0x36264f){logger[_0x739c('0x2a')](_0x739c('0xd'),_0x3c0af1,JSON[_0x739c('0x2b')](_0x36264f));_0x480159[_0x739c('0x22')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 942562d..51fce77 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2904=['[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','getMustacheRender','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','next','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x2904,0x16b));var _0x4290=function(_0x21c97f,_0x40f776){_0x21c97f=_0x21c97f-0x0;var _0x43ce04=_0x2904[_0x21c97f];return _0x43ce04;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x4290('0x0'));var Promise=require(_0x4290('0x1'));var logger=require(_0x4290('0x2'))(_0x4290('0x3'));var utils=require(_0x4290('0x4'));var rpc={'chatMessage':require(_0x4290('0x5')),'openchannelMessage':require(_0x4290('0x6')),'mailMessage':require(_0x4290('0x7')),'smsMessage':require(_0x4290('0x8')),'faxMessage':require(_0x4290('0x9')),'whatsappMessage':require(_0x4290('0xa'))};function createMessage(_0x5ea9e1,_0x2957bd,_0x1dfc20,_0x367435){return new Promise(function(_0x47dd80,_0x47596d){var _0x330546=_[_0x4290('0xb')](_0x1dfc20);_0x330546[_0x4290('0xc')]=_0x367435;return rpc[_0x2957bd+_0x4290('0xd')][_0x4290('0xe')](_0x330546)[_0x4290('0xf')](function(){logger[_0x4290('0x10')](_0x4290('0x11'),_0x5ea9e1,_0x330546[_0x4290('0xc')]);_0x47dd80();})['catch'](function(_0x4984e0){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5ea9e1,JSON[_0x4290('0x12')](_0x4984e0));_0x47596d(_0x4984e0);});});}exports[_0x4290('0x13')]=function(_0xea36b7,_0x3d4b39){return function(_0x4efc06){try{if(!_['isNil'](this[_0x4290('0x14')]['UserId'])){logger[_0x4290('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xea36b7,_0x4290('0x15'));return _0x4efc06['next']();}var _0x49cbaf={'ContactId':this[_0x4290('0x16')]['id'],'sentAt':moment()[_0x4290('0x17')](_0x4290('0x18')),'direction':_0x4290('0x19')};if(this['channel']===_0x4290('0x1a')||this[_0x4290('0x1b')]===_0x4290('0x1c')){_0x49cbaf[_0x4290('0x1d')]=this[_0x4290('0x14')][_0x4290('0x1d')];}var _0x35e842=this[_0x4290('0x1b')];if(_0x35e842===_0x4290('0x1e')){_0x49cbaf[_0x4290('0x1f')]=this[_0x4290('0x20')]['id'];}else{_0x49cbaf[_[_0x4290('0x21')](_0x35e842)+'AccountId']=this[_0x4290('0x20')]['id'];}_0x49cbaf[_[_0x4290('0x21')](_0x35e842)+_0x4290('0x22')]=this[_0x4290('0x14')]['id'];if(this[_0x4290('0x14')]['created']){var _0x15f03d=_0x3d4b39[0x4];if(!_[_0x4290('0x23')](_0x15f03d)){_0x49cbaf[_0x4290('0xc')]=utils[_0x4290('0x24')](_0x15f03d,this);return rpc[_0x35e842+_0x4290('0xd')]['create'](_0x49cbaf)[_0x4290('0xf')](function(_0x3f815b){logger[_0x4290('0x10')](_0x4290('0x11'),_0xea36b7,_0x49cbaf[_0x4290('0xc')]);})[_0x4290('0x25')](function(_0x34d2ca){logger[_0x4290('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0xea36b7,JSON[_0x4290('0x12')](_0x34d2ca));})[_0x4290('0x27')](function(){logger[_0x4290('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xea36b7);_0x4efc06['stop']();});}else{logger['info'](_0x4290('0x28'),_0xea36b7);_0x4efc06[_0x4290('0x29')]();}}else{var _0x308939=this;var _0x1551b1=_0x3d4b39[0x2][_0x4290('0x2a')](/\\n/g,'\x0a');var _0x4d13b7={'credentials':{'private_key':_0x1551b1,'client_email':_0x3d4b39[0x1]}};var _0x2ad463=new dialogflow[(_0x4290('0x2b'))](_0x4d13b7);var _0x69d06d=_0x2ad463[_0x4290('0x2c')](_0x3d4b39[0x0],md5(_0x308939[_0x4290('0x14')]['id']));var _0x478ada={'session':_0x69d06d,'queryInput':{'text':{'text':_0x308939[_0x4290('0x2d')][_0x4290('0xc')],'languageCode':_0x3d4b39[0x3]||'en'}}};return _0x2ad463[_0x4290('0x2e')](_0x478ada)['then'](function(_0x57f244){if(_0x57f244&&_0x57f244[_0x4290('0x2f')]){_0x308939[_0x4290('0xc')][_0x4290('0x30')]=_0x57f244;var _0x110ea4=_0x57f244[0x0];var _0x264a76=_0x110ea4['queryResult'][_0x4290('0x31')]&&_0x110ea4[_0x4290('0x32')][_0x4290('0x31')][_0x4290('0x33')]?_0x110ea4[_0x4290('0x32')][_0x4290('0x31')][_0x4290('0x33')][_0x4290('0x34')][_0x4290('0x35')]:![];_0x308939[_0x4290('0xc')][_0x4290('0x36')]=_0x110ea4['queryResult'][_0x4290('0x37')];_0x308939[_0x4290('0xc')][_0x4290('0x38')]=_0x110ea4[_0x4290('0x32')][_0x4290('0x39')];_0x308939[_0x4290('0xc')][_0x4290('0x3a')]=_0x110ea4['queryResult'][_0x4290('0x31')]&&_0x110ea4[_0x4290('0x32')][_0x4290('0x31')]['fields']?_0x110ea4[_0x4290('0x32')][_0x4290('0x31')]['fields'][_0x4290('0x34')][_0x4290('0x35')]:![];_0x308939['body'][_0x4290('0x3b')]=_0x110ea4[_0x4290('0x32')][_0x4290('0x3c')][_0x4290('0x3d')];_0x308939[_0x4290('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x110ea4[_0x4290('0x32')]['intent'][_0x4290('0x3e')];_0x308939[_0x4290('0xc')][_0x4290('0x3f')]=_0x110ea4[_0x4290('0x32')]['intent'][_0x4290('0x40')];_0x308939[_0x4290('0xc')][_0x4290('0x41')]=_0x110ea4['queryResult'][_0x4290('0x42')];_0x308939[_0x4290('0xc')][_0x4290('0x43')]=_0x110ea4[_0x4290('0x32')][_0x4290('0x44')];_0x308939[_0x4290('0xc')][_0x4290('0x45')]=_0x110ea4[_0x4290('0x32')][_0x4290('0x46')];_0x49cbaf[_0x4290('0x47')]='dialogflowV2';_0x49cbaf['providerResponse']=JSON[_0x4290('0x12')](_0x57f244);var _0xf65f4e=[];for(var _0x483050=0x0;_0x483050<_0x57f244[_0x4290('0x2f')];_0x483050++){var _0x4ad07a=_0x57f244[_0x483050];if(_0x4ad07a&&_0x4ad07a[_0x4290('0x32')]&&_0x4ad07a[_0x4290('0x32')][_0x4290('0x48')]){_0xf65f4e[_0x4290('0x49')](createMessage(_0xea36b7,_0x35e842,_0x49cbaf,_0x4ad07a[_0x4290('0x32')][_0x4290('0x48')]));}}return Promise[_0x4290('0x4a')](_0xf65f4e)['then'](function(){if(_0x264a76){_0x4efc06[_0x4290('0x4b')]();}else{_0x4efc06[_0x4290('0x29')]();}})[_0x4290('0x25')](function(_0x10fd93){logger[_0x4290('0x26')](_0x4290('0x11'),_0xea36b7,JSON[_0x4290('0x12')](_0x10fd93));_0x4efc06[_0x4290('0x4b')]();});}})[_0x4290('0x25')](function(_0x1786b7){logger[_0x4290('0x26')](_0x4290('0x11'),_0xea36b7,_0x1786b7[_0x4290('0x2d')]);_0x4efc06[_0x4290('0x4b')]();});}}catch(_0x38ecfc){logger[_0x4290('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0xea36b7,JSON[_0x4290('0x12')](_0x38ecfc));_0x4efc06[_0x4290('0x29')]();}};}; \ No newline at end of file +var _0x35f2=['[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','fulfillmentText','all','dialogflow','md5','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','next','contact','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','isEmpty','finally'];(function(_0x353a90,_0x26823d){var _0x22a6bc=function(_0x2f380b){while(--_0x2f380b){_0x353a90['push'](_0x353a90['shift']());}};_0x22a6bc(++_0x26823d);}(_0x35f2,0x68));var _0x235f=function(_0x58daed,_0x22c908){_0x58daed=_0x58daed-0x0;var _0x55980c=_0x35f2[_0x58daed];return _0x55980c;};'use strict';var _=require('lodash');var dialogflow=require(_0x235f('0x0'));var md5=require(_0x235f('0x1'));var moment=require(_0x235f('0x2'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x235f('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x235f('0x4')),'openchannelMessage':require(_0x235f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x235f('0x6')),'faxMessage':require(_0x235f('0x7')),'whatsappMessage':require(_0x235f('0x8'))};function createMessage(_0x3518ea,_0x2cd07b,_0x3f99b6,_0x4ca6c3){return new Promise(function(_0x277bb7,_0x441c9b){var _0x123c6e=_[_0x235f('0x9')](_0x3f99b6);_0x123c6e[_0x235f('0xa')]=_0x4ca6c3;return rpc[_0x2cd07b+_0x235f('0xb')][_0x235f('0xc')](_0x123c6e)[_0x235f('0xd')](function(){logger[_0x235f('0xe')](_0x235f('0xf'),_0x3518ea,_0x123c6e['body']);_0x277bb7();})[_0x235f('0x10')](function(_0x55a9ac){logger[_0x235f('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3518ea,JSON[_0x235f('0x12')](_0x55a9ac));_0x441c9b(_0x55a9ac);});});}exports[_0x235f('0x13')]=function(_0x129305,_0x12fc17){return function(_0x3a63ac){try{if(!_[_0x235f('0x14')](this[_0x235f('0x15')][_0x235f('0x16')])){logger[_0x235f('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x129305,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3a63ac[_0x235f('0x17')]();}var _0x92c841={'ContactId':this[_0x235f('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x235f('0x19')]===_0x235f('0x1a')||this[_0x235f('0x19')]===_0x235f('0x1b')){_0x92c841[_0x235f('0x1c')]=this[_0x235f('0x15')][_0x235f('0x1c')];}var _0x261416=this[_0x235f('0x19')];if(_0x261416===_0x235f('0x1d')){_0x92c841[_0x235f('0x1e')]=this['account']['id'];}else{_0x92c841[_[_0x235f('0x1f')](_0x261416)+_0x235f('0x20')]=this['account']['id'];}_0x92c841[_[_0x235f('0x1f')](_0x261416)+_0x235f('0x21')]=this[_0x235f('0x15')]['id'];if(this[_0x235f('0x15')]['created']){var _0x1f925f=_0x12fc17[0x4];if(!_[_0x235f('0x22')](_0x1f925f)){_0x92c841[_0x235f('0xa')]=utils['getMustacheRender'](_0x1f925f,this);return rpc[_0x261416+_0x235f('0xb')][_0x235f('0xc')](_0x92c841)[_0x235f('0xd')](function(_0x5ed5f8){logger[_0x235f('0xe')](_0x235f('0xf'),_0x129305,_0x92c841[_0x235f('0xa')]);})[_0x235f('0x10')](function(_0x3153d0){logger[_0x235f('0x11')](_0x235f('0xf'),_0x129305,JSON[_0x235f('0x12')](_0x3153d0));})[_0x235f('0x23')](function(){logger['info'](_0x235f('0x24'),_0x129305);_0x3a63ac[_0x235f('0x25')]();});}else{logger[_0x235f('0xe')](_0x235f('0x26'),_0x129305);_0x3a63ac[_0x235f('0x25')]();}}else{var _0x5a447c=this;var _0x4f8f79=_0x12fc17[0x2][_0x235f('0x27')](/\\n/g,'\x0a');var _0x45c265={'credentials':{'private_key':_0x4f8f79,'client_email':_0x12fc17[0x1]}};var _0x16e850=new dialogflow[(_0x235f('0x28'))](_0x45c265);var _0x4f9e31=_0x16e850[_0x235f('0x29')](_0x12fc17[0x0],md5(_0x5a447c[_0x235f('0x15')]['id']));var _0x1e8819={'session':_0x4f9e31,'queryInput':{'text':{'text':_0x5a447c[_0x235f('0x2a')]['body'],'languageCode':_0x12fc17[0x3]||'en'}}};return _0x16e850[_0x235f('0x2b')](_0x1e8819)[_0x235f('0xd')](function(_0x16d9b4){if(_0x16d9b4&&_0x16d9b4[_0x235f('0x2c')]){_0x5a447c[_0x235f('0xa')][_0x235f('0x2d')]=_0x16d9b4;var _0x42f5b4=_0x16d9b4[0x0];var _0x52da55=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x2f')]&&_0x42f5b4[_0x235f('0x2e')][_0x235f('0x2f')][_0x235f('0x30')]?_0x42f5b4[_0x235f('0x2e')][_0x235f('0x2f')][_0x235f('0x30')]['end_conversation'][_0x235f('0x31')]:![];_0x5a447c[_0x235f('0xa')][_0x235f('0x32')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x33')];_0x5a447c[_0x235f('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x42f5b4['queryResult']['allRequiredParamsPresent'];_0x5a447c[_0x235f('0xa')][_0x235f('0x34')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x2f')]&&_0x42f5b4[_0x235f('0x2e')]['diagnosticInfo'][_0x235f('0x30')]?_0x42f5b4[_0x235f('0x2e')][_0x235f('0x2f')]['fields'][_0x235f('0x35')][_0x235f('0x31')]:![];_0x5a447c[_0x235f('0xa')][_0x235f('0x36')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x37')][_0x235f('0x38')];_0x5a447c[_0x235f('0xa')][_0x235f('0x39')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x37')][_0x235f('0x3a')];_0x5a447c['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x37')][_0x235f('0x3b')];_0x5a447c[_0x235f('0xa')][_0x235f('0x3c')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x3d')];_0x5a447c[_0x235f('0xa')][_0x235f('0x3e')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x3f')];_0x5a447c[_0x235f('0xa')][_0x235f('0x40')]=_0x42f5b4[_0x235f('0x2e')][_0x235f('0x41')];_0x92c841['providerName']='dialogflowV2';_0x92c841[_0x235f('0x42')]=JSON[_0x235f('0x12')](_0x16d9b4);var _0x1272b2=[];for(var _0x5bd754=0x0;_0x5bd754<_0x16d9b4[_0x235f('0x2c')];_0x5bd754++){var _0x1c632a=_0x16d9b4[_0x5bd754];if(_0x1c632a&&_0x1c632a[_0x235f('0x2e')]&&_0x1c632a[_0x235f('0x2e')]['fulfillmentText']){_0x1272b2[_0x235f('0x43')](createMessage(_0x129305,_0x261416,_0x92c841,_0x1c632a[_0x235f('0x2e')][_0x235f('0x44')]));}}return Promise[_0x235f('0x45')](_0x1272b2)[_0x235f('0xd')](function(){if(_0x52da55){_0x3a63ac['next']();}else{_0x3a63ac['stop']();}})['catch'](function(_0x5ef568){logger['error'](_0x235f('0xf'),_0x129305,JSON['stringify'](_0x5ef568));_0x3a63ac[_0x235f('0x17')]();});}})['catch'](function(_0x110da5){logger['error'](_0x235f('0xf'),_0x129305,_0x110da5[_0x235f('0x2a')]);_0x3a63ac[_0x235f('0x17')]();});}}catch(_0x3b47b8){logger[_0x235f('0x11')](_0x235f('0xf'),_0x129305,JSON[_0x235f('0x12')](_0x3b47b8));_0x3a63ac[_0x235f('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index bdbcc19..e6b5d09 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2f9=['join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','replace','length','error','message'];(function(_0x18a32a,_0x35bc8b){var _0x5a6651=function(_0x575510){while(--_0x575510){_0x18a32a['push'](_0x18a32a['shift']());}};_0x5a6651(++_0x35bc8b);}(_0xd2f9,0xc2));var _0x9d2f=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xd2f9[_0x43d16c];return _0x208cce;};'use strict';var schema=require(_0x9d2f('0x0'));var _=require('lodash');var htmlToText=require(_0x9d2f('0x1'));var utils=require(_0x9d2f('0x2'));var logger=require(_0x9d2f('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x9d2f('0x4'),'required':!![],'message':_0x9d2f('0x5')},'priorityTrue':{'type':_0x9d2f('0x6'),'message':_0x9d2f('0x7')},'priorityFalse':{'type':_0x9d2f('0x6'),'message':_0x9d2f('0x8')}});exports['consequence']=function(_0x103c3a,_0x191b0b){return function(_0x52bc3b){try{var _0x2a56df={'condition':htmlToText['fromString'](utils[_0x9d2f('0x9')](_0x191b0b[0x0],this),{'wordwrap':![]})[_0x9d2f('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x191b0b[0x1],'priorityFalse':_0x191b0b[0x2]};var _0xb344ce=gotoif['validate'](_0x2a56df,{'typecast':!![]});if(_0xb344ce[_0x9d2f('0xb')]){logger[_0x9d2f('0xc')]('[%s][GOTOIF]\x20%s',_0x103c3a,_['map'](_0xb344ce,_0x9d2f('0xd'))[_0x9d2f('0xe')](',\x20'));_0x52bc3b[_0x9d2f('0xf')]();}else{try{var _0x2d7072=eval('('+_0x2a56df['condition']+')');var _0x624df0=_0x2d7072?_0x2a56df[_0x9d2f('0x10')]:_0x2a56df[_0x9d2f('0x11')];logger[_0x9d2f('0x12')](_0x9d2f('0x13'),_0x103c3a,_0x2a56df[_0x9d2f('0x14')],_0x2d7072,_0x624df0||'next');if(_0x624df0){var _0x12b144=_[_0x9d2f('0x15')](_0x52bc3b['rules'](),{'p':_0x624df0});if(_0x12b144>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x103c3a,_0x624df0||_0x9d2f('0x16'),_0x12b144);_0x52bc3b[_0x9d2f('0x16')](_0x12b144);}else{logger[_0x9d2f('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x103c3a,_0x624df0||'next');_0x52bc3b[_0x9d2f('0xf')]();}}else{_0x52bc3b[_0x9d2f('0x16')]();}}catch(_0x1dfbe9){logger[_0x9d2f('0xc')](_0x9d2f('0x17'),_0x103c3a,_0x1dfbe9[_0x9d2f('0xd')]);_0x52bc3b['stop']();}}}catch(_0x23a1ae){logger[_0x9d2f('0xc')](_0x9d2f('0x18'),_0x103c3a,JSON[_0x9d2f('0x19')](_0x23a1ae));_0x52bc3b[_0x9d2f('0xf')]();}};}; \ No newline at end of file +var _0xcefc=['next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0xa07667,_0x5a18d6){var _0x50809e=function(_0x51b90b){while(--_0x51b90b){_0xa07667['push'](_0xa07667['shift']());}};_0x50809e(++_0x5a18d6);}(_0xcefc,0x10e));var _0xccef=function(_0x5d1b42,_0x20b86c){_0x5d1b42=_0x5d1b42-0x0;var _0xfd3e18=_0xcefc[_0x5d1b42];return _0xfd3e18;};'use strict';var schema=require(_0xccef('0x0'));var _=require(_0xccef('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0xccef('0x2'))(_0xccef('0x3'));var gotoif=schema({'condition':{'type':_0xccef('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xccef('0x5'),'message':_0xccef('0x6')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xccef('0x7')]=function(_0x5042ad,_0x20ba05){return function(_0x581860){try{var _0x49baae={'condition':htmlToText[_0xccef('0x8')](utils[_0xccef('0x9')](_0x20ba05[0x0],this),{'wordwrap':![]})[_0xccef('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x20ba05[0x1],'priorityFalse':_0x20ba05[0x2]};var _0x5103e1=gotoif['validate'](_0x49baae,{'typecast':!![]});if(_0x5103e1['length']){logger[_0xccef('0xb')](_0xccef('0xc'),_0x5042ad,_[_0xccef('0xd')](_0x5103e1,_0xccef('0xe'))[_0xccef('0xf')](',\x20'));_0x581860['stop']();}else{try{var _0x5dd0d8=eval('('+_0x49baae[_0xccef('0x10')]+')');var _0x1cc618=_0x5dd0d8?_0x49baae[_0xccef('0x11')]:_0x49baae[_0xccef('0x12')];logger['info'](_0xccef('0x13'),_0x5042ad,_0x49baae[_0xccef('0x10')],_0x5dd0d8,_0x1cc618||_0xccef('0x14'));if(_0x1cc618){var _0x3644c8=_[_0xccef('0x15')](_0x581860[_0xccef('0x16')](),{'p':_0x1cc618});if(_0x3644c8>=0x0){logger[_0xccef('0x17')](_0xccef('0x18'),_0x5042ad,_0x1cc618||_0xccef('0x14'),_0x3644c8);_0x581860['next'](_0x3644c8);}else{logger[_0xccef('0x17')](_0xccef('0x19'),_0x5042ad,_0x1cc618||_0xccef('0x14'));_0x581860[_0xccef('0x1a')]();}}else{_0x581860[_0xccef('0x14')]();}}catch(_0x36ddc5){logger[_0xccef('0xb')](_0xccef('0x1b'),_0x5042ad,_0x36ddc5[_0xccef('0xe')]);_0x581860[_0xccef('0x1a')]();}}}catch(_0x366d5f){logger[_0xccef('0xb')](_0xccef('0xc'),_0x5042ad,JSON[_0xccef('0x1c')](_0x366d5f));_0x581860['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 46f2cf4..7cd7a7e 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 _0x5728=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority'];(function(_0x143175,_0x2bfa6a){var _0x326527=function(_0x349854){while(--_0x349854){_0x143175['push'](_0x143175['shift']());}};_0x326527(++_0x2bfa6a);}(_0x5728,0x10a));var _0x8572=function(_0x4ffe2b,_0x8598c2){_0x4ffe2b=_0x4ffe2b-0x0;var _0xe21df2=_0x5728[_0x4ffe2b];return _0xe21df2;};'use strict';var schema=require(_0x8572('0x0'));var _=require(_0x8572('0x1'));var logger=require(_0x8572('0x2'))('routing');var gotop=schema({'priority':{'type':_0x8572('0x3'),'required':!![],'message':_0x8572('0x4')}});exports[_0x8572('0x5')]=function(_0x8f823a,_0x4e96d3){return function(_0x39b594){try{var _0x1352f5={'priority':_0x4e96d3[0x0]};var _0x42bf47=gotop[_0x8572('0x0')](_0x1352f5,{'typecast':!![]});if(_0x42bf47['length']){logger[_0x8572('0x6')](_0x8572('0x7'),_0x8f823a,_[_0x8572('0x8')](_0x42bf47,_0x8572('0x9'))[_0x8572('0xa')](',\x20'));_0x39b594[_0x8572('0xb')]();}else{logger[_0x8572('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x8f823a,_0x1352f5[_0x8572('0xd')]);if(_0x1352f5[_0x8572('0xd')]){var _0x288b2b=_[_0x8572('0xe')](_0x39b594[_0x8572('0xf')](),{'p':_0x1352f5[_0x8572('0xd')]});if(_0x288b2b>=0x0){logger[_0x8572('0xc')](_0x8572('0x10'),_0x8f823a,_0x1352f5[_0x8572('0xd')]||_0x8572('0x11'),_0x288b2b);_0x39b594['next'](_0x288b2b);}else{logger[_0x8572('0xc')](_0x8572('0x12'),_0x8f823a,_0x1352f5[_0x8572('0xd')]||_0x8572('0x11'));_0x39b594[_0x8572('0xb')]();}}else{_0x39b594[_0x8572('0x11')]();}}}catch(_0x335aa8){logger[_0x8572('0x6')](_0x8572('0x7'),_0x8f823a,JSON[_0x8572('0x13')](_0x335aa8));_0x39b594[_0x8572('0xb')]();}};}; \ No newline at end of file +var _0x219b=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x39d07a,_0x53b52d){var _0xeced5d=function(_0x196f57){while(--_0x196f57){_0x39d07a['push'](_0x39d07a['shift']());}};_0xeced5d(++_0x53b52d);}(_0x219b,0x197));var _0xb219=function(_0x5679a7,_0x367a87){_0x5679a7=_0x5679a7-0x0;var _0x40e8a4=_0x219b[_0x5679a7];return _0x40e8a4;};'use strict';var schema=require(_0xb219('0x0'));var _=require('lodash');var logger=require(_0xb219('0x1'))(_0xb219('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb219('0x3')}});exports[_0xb219('0x4')]=function(_0x45633b,_0x3e8ce8){return function(_0xfa83d7){try{var _0xe27ec2={'priority':_0x3e8ce8[0x0]};var _0x3e65f3=gotop[_0xb219('0x0')](_0xe27ec2,{'typecast':!![]});if(_0x3e65f3[_0xb219('0x5')]){logger[_0xb219('0x6')](_0xb219('0x7'),_0x45633b,_['map'](_0x3e65f3,'message')[_0xb219('0x8')](',\x20'));_0xfa83d7['stop']();}else{logger[_0xb219('0x9')](_0xb219('0xa'),_0x45633b,_0xe27ec2['priority']);if(_0xe27ec2[_0xb219('0xb')]){var _0x431d94=_[_0xb219('0xc')](_0xfa83d7[_0xb219('0xd')](),{'p':_0xe27ec2[_0xb219('0xb')]});if(_0x431d94>=0x0){logger[_0xb219('0x9')](_0xb219('0xe'),_0x45633b,_0xe27ec2[_0xb219('0xb')]||_0xb219('0xf'),_0x431d94);_0xfa83d7[_0xb219('0xf')](_0x431d94);}else{logger[_0xb219('0x9')](_0xb219('0x10'),_0x45633b,_0xe27ec2[_0xb219('0xb')]||_0xb219('0xf'));_0xfa83d7['stop']();}}else{_0xfa83d7[_0xb219('0xf')]();}}}catch(_0x3efd4b){logger[_0xb219('0x6')]('[%s][GOTOP]\x20%s',_0x45633b,JSON[_0xb219('0x11')](_0x3efd4b));_0xfa83d7[_0xb219('0x12')]();}};}; \ 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 8002946..c2f3b7a 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 _0xc648=['chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','contact','channel'];(function(_0x36aad0,_0x3d2e17){var _0x31e987=function(_0x2d0fe4){while(--_0x2d0fe4){_0x36aad0['push'](_0x36aad0['shift']());}};_0x31e987(++_0x3d2e17);}(_0xc648,0x171));var _0x8c64=function(_0x25b48a,_0x3066ef){_0x25b48a=_0x25b48a-0x0;var _0x4650b9=_0xc648[_0x25b48a];return _0x4650b9;};'use strict';var _=require('lodash');var utils=require(_0x8c64('0x0'));var logger=require(_0x8c64('0x1'))(_0x8c64('0x2'));var rpc={'chatMessage':require(_0x8c64('0x3')),'openchannelMessage':require(_0x8c64('0x4')),'mailMessage':require(_0x8c64('0x5')),'smsMessage':require(_0x8c64('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1c79a9,_0x449786){return function(_0xb31493){try{var _0x1be93f={'body':utils['getMustacheRender'](_0x449786[0x0],this),'ContactId':this[_0x8c64('0x7')]['id']};if(this[_0x8c64('0x8')]===_0x8c64('0x9')){_0x1be93f[_0x8c64('0xa')]=this[_0x8c64('0xb')]['id'];}else{_0x1be93f[_['upperFirst'](this[_0x8c64('0x8')])+_0x8c64('0xc')]=this['account']['id'];}_0x1be93f[_[_0x8c64('0xd')](this[_0x8c64('0x8')])+_0x8c64('0xe')]=this[_0x8c64('0xf')]['id'];if(rpc[this[_0x8c64('0x8')]+_0x8c64('0x10')]){return rpc[this[_0x8c64('0x8')]+_0x8c64('0x10')][_0x8c64('0x11')](_0x1be93f)[_0x8c64('0x12')](function(_0x54e0f0){logger[_0x8c64('0x13')](_0x8c64('0x14'),_0x1c79a9,_0x1be93f[_0x8c64('0x15')]);_0xb31493[_0x8c64('0x16')]();})[_0x8c64('0x17')](function(_0xeb374){logger[_0x8c64('0x18')]('[%s][MESSAGE]\x20%s',_0x1c79a9,JSON[_0x8c64('0x19')](_0xeb374));_0xb31493[_0x8c64('0x1a')]();});}}catch(_0x4dbf8d){logger[_0x8c64('0x18')](_0x8c64('0x14'),_0x1c79a9,JSON['stringify'](_0x4dbf8d));_0xb31493[_0x8c64('0x1a')]();}};}; \ No newline at end of file +var _0x60fc=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x60fc,0x128));var _0xc60f=function(_0x132f3c,_0x59e9fb){_0x132f3c=_0x132f3c-0x0;var _0x55db8a=_0x60fc[_0x132f3c];return _0x55db8a;};'use strict';var _=require(_0xc60f('0x0'));var utils=require(_0xc60f('0x1'));var logger=require(_0xc60f('0x2'))(_0xc60f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc60f('0x4')),'mailMessage':require(_0xc60f('0x5')),'smsMessage':require(_0xc60f('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x29ac77,_0x45c3a8){return function(_0x4a6091){try{var _0x4ce542={'body':utils['getMustacheRender'](_0x45c3a8[0x0],this),'ContactId':this['contact']['id']};if(this[_0xc60f('0x7')]===_0xc60f('0x8')){_0x4ce542[_0xc60f('0x9')]=this[_0xc60f('0xa')]['id'];}else{_0x4ce542[_[_0xc60f('0xb')](this[_0xc60f('0x7')])+_0xc60f('0xc')]=this[_0xc60f('0xa')]['id'];}_0x4ce542[_[_0xc60f('0xb')](this['channel'])+_0xc60f('0xd')]=this[_0xc60f('0xe')]['id'];if(rpc[this[_0xc60f('0x7')]+_0xc60f('0xf')]){return rpc[this[_0xc60f('0x7')]+'Message'][_0xc60f('0x10')](_0x4ce542)[_0xc60f('0x11')](function(_0x58eb58){logger[_0xc60f('0x12')](_0xc60f('0x13'),_0x29ac77,_0x4ce542['body']);_0x4a6091[_0xc60f('0x14')]();})[_0xc60f('0x15')](function(_0x1efb43){logger[_0xc60f('0x16')]('[%s][MESSAGE]\x20%s',_0x29ac77,JSON['stringify'](_0x1efb43));_0x4a6091[_0xc60f('0x17')]();});}}catch(_0x520e64){logger['error'](_0xc60f('0x13'),_0x29ac77,JSON[_0xc60f('0x18')](_0x520e64));_0x4a6091[_0xc60f('0x17')]();}};}; \ 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 c9b4f37..7ae3643 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 _0xee64=['info','next','error','[%s][NOOP]\x20%s','./utils','../../../../config/logger','routing','consequence'];(function(_0x197d55,_0x2d2324){var _0x37cf35=function(_0x4106e2){while(--_0x4106e2){_0x197d55['push'](_0x197d55['shift']());}};_0x37cf35(++_0x2d2324);}(_0xee64,0x19c));var _0x4ee6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xee64[_0x397e5f];return _0x5302b8;};'use strict';var utils=require(_0x4ee6('0x0'));var logger=require(_0x4ee6('0x1'))(_0x4ee6('0x2'));exports[_0x4ee6('0x3')]=function(_0x2f2990,_0x23f2a8){return function(_0x1ab4c4){try{logger[_0x4ee6('0x4')]('[%s][NOOP]\x20%s',_0x2f2990,utils['getMustacheRender'](_0x23f2a8[0x0],this));_0x1ab4c4[_0x4ee6('0x5')]();}catch(_0x25c824){logger[_0x4ee6('0x6')](_0x4ee6('0x7'),_0x2f2990,JSON['stringify'](_0x25c824));_0x1ab4c4['stop']();}};}; \ No newline at end of file +var _0x6ecf=['stringify','stop','./utils','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x1ece47,_0x19c07e){var _0x235d4f=function(_0x4b0c15){while(--_0x4b0c15){_0x1ece47['push'](_0x1ece47['shift']());}};_0x235d4f(++_0x19c07e);}(_0x6ecf,0x1da));var _0xf6ec=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x6ecf[_0x521929];return _0x632436;};'use strict';var utils=require(_0xf6ec('0x0'));var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0xbc01fa,_0x7470a1){return function(_0x5f2c3f){try{logger[_0xf6ec('0x1')](_0xf6ec('0x2'),_0xbc01fa,utils[_0xf6ec('0x3')](_0x7470a1[0x0],this));_0x5f2c3f[_0xf6ec('0x4')]();}catch(_0x54d864){logger[_0xf6ec('0x5')](_0xf6ec('0x2'),_0xbc01fa,JSON[_0xf6ec('0x6')](_0x54d864));_0x5f2c3f[_0xf6ec('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 9a870e7..5935dcd 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 _0x7f48=['timeout','error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','Queues','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report'];(function(_0x408231,_0x4de52b){var _0x2199e6=function(_0x4e535c){while(--_0x4e535c){_0x408231['push'](_0x408231['shift']());}};_0x2199e6(++_0x4de52b);}(_0x7f48,0xac));var _0x87f4=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x7f48[_0x8dc04d];return _0x2f5f28;};'use strict';var schema=require(_0x87f4('0x0'));var _=require(_0x87f4('0x1'));var util=require('util');var seqqueue=require(_0x87f4('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x87f4('0x3'));var logger=require(_0x87f4('0x4'))('routing');var strategy=require(_0x87f4('0x5'));config[_0x87f4('0x6')]=_[_0x87f4('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x87f4('0x8'))(new Redis(config[_0x87f4('0x6')]));var attributes=['id','queue_id',_0x87f4('0x9'),_0x87f4('0xa'),_0x87f4('0xb'),_0x87f4('0xc')];function emit(_0x2efee0,_0x38a324,_0x18f961){io['to'](_0x2efee0)[_0x87f4('0xd')](_0x38a324,_0x18f961);}function emitChannelQueueInteraction(_0x86348e,_0x13d6e3,_0x50299a,_0x3d7fd0,_0x417c62,_0x4da009,_0x128b0e,_0x49f4bb){var _0x2d4e11=_[_0x87f4('0xe')](_0x50299a);_0x2d4e11[_0x87f4('0xf')]=_0x49f4bb;_0x2d4e11['queue']=_0x13d6e3;_0x2d4e11[_0x87f4('0x9')]=_0x3d7fd0;_0x2d4e11['id']=_0x417c62;if(_0x4da009){_0x128b0e[util[_0x87f4('0x10')]('%sQueuesWaitingInteractions',_0x86348e)][_0x417c62]=_['pick'](_0x2d4e11,attributes);}else{delete _0x128b0e[util[_0x87f4('0x10')](_0x87f4('0x11'),_0x86348e)][_0x417c62];}emit(util[_0x87f4('0x10')]('%s:queue:%s',_0x86348e,_0x13d6e3),util[_0x87f4('0x10')](_0x87f4('0x12'),_0x86348e,_0x4da009?_0x87f4('0x13'):'remove'),_['pick'](_0x2d4e11,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x87f4('0x14')),'chatQueueReport':require(_0x87f4('0x15')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x87f4('0x16')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x87f4('0x17'),'required':!![],'message':_0x87f4('0x18')},'timeout':{'type':_0x87f4('0x19'),'message':_0x87f4('0x1a')}});function startRouting(_0x12ad72,_0x466bbc,_0x3886e1,_0x38e027){if(_0x12ad72&&_0x466bbc&&_0x3886e1){_0x466bbc[_0x87f4('0x1b')]+=0x1;var _0x71817d={'uniqueid':_0x12ad72,'from':_0x3886e1[_0x87f4('0x1c')]?_0x3886e1[_0x87f4('0x1c')][_0x87f4('0xb')]:'','joinAt':moment()[_0x87f4('0x10')](_0x87f4('0x1d')),'ContactId':_0x3886e1[_0x87f4('0x1e')]?_0x3886e1[_0x87f4('0x1e')]['id']:null,'ListId':_0x3886e1[_0x87f4('0x1f')]?_0x3886e1[_0x87f4('0x1f')]['id']:null};_0x71817d[_[_0x87f4('0x20')](_0x3886e1[_0x87f4('0x21')])+_0x87f4('0x22')]=_0x466bbc['id']||null;_0x71817d[_[_0x87f4('0x20')](_0x3886e1[_0x87f4('0x21')])+_0x87f4('0x23')]=_0x3886e1['interaction']?_0x3886e1[_0x87f4('0x24')]['id']:null;_0x71817d[_[_0x87f4('0x20')](_0x3886e1[_0x87f4('0x21')])+_0x87f4('0x25')]=_0x3886e1[_0x87f4('0x26')]?_0x3886e1[_0x87f4('0x26')]['id']:null;_0x71817d[_[_0x87f4('0x20')](_0x3886e1['channel'])+(_0x3886e1[_0x87f4('0x21')]!==_0x87f4('0x27')?'AccountId':'WebsiteId')]=_0x3886e1[_0x87f4('0x9')]?_0x3886e1[_0x87f4('0x9')]['id']:null;logger[_0x87f4('0x28')](util['format'](_0x87f4('0x29'),_0x12ad72,_0x466bbc[_0x87f4('0x2a')]));emitChannelQueueInteraction(_0x3886e1[_0x87f4('0x21')],_0x466bbc[_0x87f4('0x2a')],_0x71817d,_0x3886e1[_0x87f4('0x9')][_0x87f4('0x2a')],_0x3886e1[_0x87f4('0x26')]['id'],!![],_0x38e027,_0x466bbc['id']);if(rpc[_0x3886e1[_0x87f4('0x21')]+_0x87f4('0x2b')]){return rpc[_0x3886e1['channel']+_0x87f4('0x2b')]['create'](_0x71817d)[_0x87f4('0x2c')](function(_0x49e8ec){logger['error'](_0x87f4('0x2d'));});}}}function stopRouting(_0xe266a,_0x332563,_0x46b29b,_0x3c3207){if(_0xe266a&&_0x332563){_0x332563[_0x87f4('0x1b')]-=0x1;var _0x3481db={'leaveAt':moment()['format'](_0x87f4('0x1d')),'acceptAt':moment()[_0x87f4('0x10')](_0x87f4('0x1d')),'reason':_0x87f4('0x2e')};logger[_0x87f4('0x28')](util['format'](_0x87f4('0x2f'),_0xe266a,_0x332563[_0x87f4('0x2a')]));emitChannelQueueInteraction(_0x46b29b[_0x87f4('0x21')],_0x332563[_0x87f4('0x2a')],_0x46b29b[_0x87f4('0x1c')],_0x46b29b[_0x87f4('0x9')][_0x87f4('0x2a')],_0x46b29b[_0x87f4('0x26')]['id'],![],_0x3c3207,_0x332563['id']);if(rpc[_0x46b29b[_0x87f4('0x21')]+_0x87f4('0x2b')]){return rpc[_0x46b29b['channel']+_0x87f4('0x2b')][_0x87f4('0x30')](_0xe266a,_0x3481db)[_0x87f4('0x2c')](function(_0x297301){logger['error'](_0x87f4('0x31'));});}}}function endRouting(_0x5a5d84,_0x2ee63f,_0x514752,_0x9638e4){if(_0x5a5d84&&_0x2ee63f){_0x2ee63f['waiting']-=0x1;var _0x375eb5={'leaveAt':moment()[_0x87f4('0x10')](_0x87f4('0x1d')),'exitAt':moment()[_0x87f4('0x10')](_0x87f4('0x1d')),'reason':_0x87f4('0x32')};logger[_0x87f4('0x28')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x5a5d84,_0x2ee63f[_0x87f4('0x2a')]));emitChannelQueueInteraction(_0x514752[_0x87f4('0x21')],_0x2ee63f['name'],_0x514752[_0x87f4('0x1c')],_0x514752[_0x87f4('0x9')][_0x87f4('0x2a')],_0x514752[_0x87f4('0x26')]['id'],![],_0x9638e4);if(rpc[_0x514752['channel']+_0x87f4('0x2b')]){return rpc[_0x514752[_0x87f4('0x21')]+_0x87f4('0x2b')][_0x87f4('0x30')](_0x5a5d84,_0x375eb5)[_0x87f4('0x2c')](function(_0x66a111){logger[_0x87f4('0x33')](_0x87f4('0x31'));});}}}function handleFindQueue(_0x6a47c2){return function(_0x3a1a46){return _0x3a1a46[_0x87f4('0x2a')]['toLowerCase']()===_0x6a47c2[_0x87f4('0x34')]();};}exports[_0x87f4('0x35')]=function(_0x283aa1,_0x4121d7,_0x590739,_0x42810d){return function(_0x525453){try{var _0x3b9425={'name':_0x4121d7[0x0],'timeout':_0x4121d7[0x1]};var _0x81839e=queue[_0x87f4('0x0')](_0x3b9425,{'typecast':!![]});if(_0x81839e[_0x87f4('0x36')]){logger[_0x87f4('0x33')](_0x87f4('0x37'),_0x283aa1,_[_0x87f4('0x38')](_0x81839e,_0x87f4('0x26'))[_0x87f4('0x39')](',\x20'));_0x525453['stop']();}else{var _0x27635b=_['find'](_0x590739[_0x42810d['channel']+_0x87f4('0x3a')],handleFindQueue(_0x3b9425[_0x87f4('0x2a')]));if(_0x27635b){startRouting(_0x283aa1,_0x27635b,_0x42810d,_0x590739);var _0x243da3=(_0x27635b[_0x87f4('0x32')]||0xa)*0x3e8;var _0x110fc7=(_0x3b9425[_0x87f4('0x32')]||0x14)*0x3e8;var _0x7aa67f,_0x96f4c;if(_0x243da3>_0x110fc7){_0x110fc7=_0x243da3;}var _0x165e6c=seqqueue[_0x87f4('0x3b')](_0x243da3);_0x165e6c['id']=_0x283aa1;_0x165e6c[_0x87f4('0x3c')]=_0x243da3;_0x165e6c[_0x87f4('0x3d')]=_0x110fc7;_0x165e6c['channel']=_0x42810d[_0x87f4('0x21')];_0x590739['rules'][_0x283aa1]['on']('end',function(){logger[_0x87f4('0x28')](_0x87f4('0x3e'),_0x283aa1);stopRouting(_0x283aa1,_0x27635b,_0x42810d,_0x590739);clearTimeout(_0x7aa67f);_0x7aa67f=undefined;_0x165e6c[_0x87f4('0x3f')](!![]);if(_0x590739['rules'][_0x283aa1]){delete _0x590739[_0x87f4('0x40')][_0x283aa1];}_0x525453[_0x87f4('0x41')]();});_0x590739[_0x87f4('0x40')][_0x283aa1]['on'](_0x87f4('0x42'),function(){if(_0x590739[_0x87f4('0x40')][_0x283aa1]){delete _0x590739[_0x87f4('0x40')][_0x283aa1];}});_0x7aa67f=setTimeout(function(){logger[_0x87f4('0x28')](_0x87f4('0x43'),_0x283aa1);endRouting(_0x283aa1,_0x27635b,_0x42810d,_0x590739);clearTimeout(_0x7aa67f);_0x165e6c['close'](!![]);_0x525453[_0x87f4('0x44')]();},_0x110fc7);switch(_0x27635b[_0x87f4('0x45')]){case _0x87f4('0x46'):strategy[_0x87f4('0x46')](_0x165e6c,_0x27635b,_0x590739,_0x42810d);break;default:strategy['beepall'](_0x165e6c,_0x27635b,_0x590739,_0x42810d);}}else{logger['error'](_0x87f4('0x47'),_0x283aa1,_0x3b9425[_0x87f4('0x2a')]);_0x525453[_0x87f4('0x41')]();}}}catch(_0x43ad9f){console[_0x87f4('0x48')](_0x43ad9f);logger[_0x87f4('0x33')](_0x87f4('0x37'),_0x283aa1,_0x43ad9f[_0x87f4('0x49')]);_0x525453[_0x87f4('0x41')]();}};}; \ No newline at end of file +var _0x844d=['InteractionId','interaction','message','AccountId','info','name','QueueReport','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','error','update\x20queue\x20report','toLowerCase','length','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','queue_id','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel'];(function(_0x17772a,_0x4b193b){var _0x41e057=function(_0xf519b9){while(--_0xf519b9){_0x17772a['push'](_0x17772a['shift']());}};_0x41e057(++_0x4b193b);}(_0x844d,0xaf));var _0xd844=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x844d[_0x35d8af];return _0x1d08b0;};'use strict';var schema=require(_0xd844('0x0'));var _=require(_0xd844('0x1'));var util=require(_0xd844('0x2'));var seqqueue=require(_0xd844('0x3'));var moment=require(_0xd844('0x4'));var Redis=require(_0xd844('0x5'));var config=require(_0xd844('0x6'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xd844('0x7'));config[_0xd844('0x8')]=_[_0xd844('0x9')](config['redis'],{'host':_0xd844('0xa'),'port':0x18eb});var io=require(_0xd844('0xb'))(new Redis(config[_0xd844('0x8')]));var attributes=['id','queue_id',_0xd844('0xc'),_0xd844('0xd'),_0xd844('0xe'),_0xd844('0xf')];function emit(_0x5ef6a8,_0x1261b8,_0x5cc7f2){io['to'](_0x5ef6a8)['emit'](_0x1261b8,_0x5cc7f2);}function emitChannelQueueInteraction(_0x1ee185,_0x3b1b64,_0x47be9a,_0x42eeb3,_0x25d4b2,_0x56956a,_0x4bee82,_0x1909f8){var _0x99067=_['clone'](_0x47be9a);_0x99067[_0xd844('0x10')]=_0x1909f8;_0x99067[_0xd844('0xd')]=_0x3b1b64;_0x99067['account']=_0x42eeb3;_0x99067['id']=_0x25d4b2;if(_0x56956a){_0x4bee82[util['format'](_0xd844('0x11'),_0x1ee185)][_0x25d4b2]=_[_0xd844('0x12')](_0x99067,attributes);}else{delete _0x4bee82[util[_0xd844('0x13')]('%sQueuesWaitingInteractions',_0x1ee185)][_0x25d4b2];}emit(util[_0xd844('0x13')](_0xd844('0x14'),_0x1ee185,_0x3b1b64),util['format']('%s_queue_waiting_interaction:%s',_0x1ee185,_0x56956a?'save':_0xd844('0x15')),_[_0xd844('0x12')](_0x99067,attributes));}var rpc={'openchannelQueueReport':require(_0xd844('0x16')),'mailQueueReport':require(_0xd844('0x17')),'chatQueueReport':require(_0xd844('0x18')),'smsQueueReport':require(_0xd844('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xd844('0x1a'))};var queue=schema({'name':{'type':_0xd844('0x1b'),'required':!![],'message':_0xd844('0x1c')},'timeout':{'type':_0xd844('0x1d'),'message':_0xd844('0x1e')}});function startRouting(_0x12e9a0,_0x1d5519,_0x24fece,_0x3adf42){if(_0x12e9a0&&_0x1d5519&&_0x24fece){_0x1d5519[_0xd844('0x1f')]+=0x1;var _0x10394e={'uniqueid':_0x12e9a0,'from':_0x24fece[_0xd844('0x20')]?_0x24fece['body'][_0xd844('0xe')]:'','joinAt':moment()[_0xd844('0x13')](_0xd844('0x21')),'ContactId':_0x24fece[_0xd844('0x22')]?_0x24fece[_0xd844('0x22')]['id']:null,'ListId':_0x24fece[_0xd844('0x23')]?_0x24fece['list']['id']:null};_0x10394e[_[_0xd844('0x24')](_0x24fece[_0xd844('0x25')])+'QueueId']=_0x1d5519['id']||null;_0x10394e[_[_0xd844('0x24')](_0x24fece['channel'])+_0xd844('0x26')]=_0x24fece[_0xd844('0x27')]?_0x24fece[_0xd844('0x27')]['id']:null;_0x10394e[_['upperFirst'](_0x24fece['channel'])+'MessageId']=_0x24fece[_0xd844('0x28')]?_0x24fece[_0xd844('0x28')]['id']:null;_0x10394e[_[_0xd844('0x24')](_0x24fece[_0xd844('0x25')])+(_0x24fece['channel']!=='chat'?_0xd844('0x29'):'WebsiteId')]=_0x24fece[_0xd844('0xc')]?_0x24fece['account']['id']:null;logger[_0xd844('0x2a')](util[_0xd844('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x12e9a0,_0x1d5519[_0xd844('0x2b')]));emitChannelQueueInteraction(_0x24fece[_0xd844('0x25')],_0x1d5519[_0xd844('0x2b')],_0x10394e,_0x24fece[_0xd844('0xc')][_0xd844('0x2b')],_0x24fece['message']['id'],!![],_0x3adf42,_0x1d5519['id']);if(rpc[_0x24fece[_0xd844('0x25')]+_0xd844('0x2c')]){return rpc[_0x24fece[_0xd844('0x25')]+_0xd844('0x2c')]['create'](_0x10394e)['catch'](function(_0x15a429){logger['error'](_0xd844('0x2d'));});}}}function stopRouting(_0xa9016a,_0x5a6771,_0x59cdc7,_0x2149ef){if(_0xa9016a&&_0x5a6771){_0x5a6771[_0xd844('0x1f')]-=0x1;var _0x5d5a26={'leaveAt':moment()[_0xd844('0x13')](_0xd844('0x21')),'acceptAt':moment()[_0xd844('0x13')](_0xd844('0x21')),'reason':'accepted'};logger['info'](util[_0xd844('0x13')](_0xd844('0x2e'),_0xa9016a,_0x5a6771['name']));emitChannelQueueInteraction(_0x59cdc7[_0xd844('0x25')],_0x5a6771[_0xd844('0x2b')],_0x59cdc7[_0xd844('0x20')],_0x59cdc7[_0xd844('0xc')]['name'],_0x59cdc7[_0xd844('0x28')]['id'],![],_0x2149ef,_0x5a6771['id']);if(rpc[_0x59cdc7['channel']+_0xd844('0x2c')]){return rpc[_0x59cdc7[_0xd844('0x25')]+_0xd844('0x2c')][_0xd844('0x2f')](_0xa9016a,_0x5d5a26)[_0xd844('0x30')](function(_0x24fc2b){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x8aa4be,_0x11e9cd,_0x1a580c,_0x32af24){if(_0x8aa4be&&_0x11e9cd){_0x11e9cd[_0xd844('0x1f')]-=0x1;var _0x129223={'leaveAt':moment()[_0xd844('0x13')](_0xd844('0x21')),'exitAt':moment()[_0xd844('0x13')](_0xd844('0x21')),'reason':_0xd844('0x31')};logger[_0xd844('0x2a')](util[_0xd844('0x13')](_0xd844('0x32'),_0x8aa4be,_0x11e9cd[_0xd844('0x2b')]));emitChannelQueueInteraction(_0x1a580c[_0xd844('0x25')],_0x11e9cd[_0xd844('0x2b')],_0x1a580c['body'],_0x1a580c[_0xd844('0xc')]['name'],_0x1a580c[_0xd844('0x28')]['id'],![],_0x32af24);if(rpc[_0x1a580c[_0xd844('0x25')]+_0xd844('0x2c')]){return rpc[_0x1a580c[_0xd844('0x25')]+_0xd844('0x2c')][_0xd844('0x2f')](_0x8aa4be,_0x129223)[_0xd844('0x30')](function(_0x2bb1b2){logger[_0xd844('0x33')](_0xd844('0x34'));});}}}function handleFindQueue(_0x538a98){return function(_0x5006f0){return _0x5006f0[_0xd844('0x2b')]['toLowerCase']()===_0x538a98[_0xd844('0x35')]();};}exports['consequence']=function(_0x128655,_0x4c883e,_0x3cbb4a,_0x79834c){return function(_0x4a1814){try{var _0x53ac4b={'name':_0x4c883e[0x0],'timeout':_0x4c883e[0x1]};var _0x236f37=queue[_0xd844('0x0')](_0x53ac4b,{'typecast':!![]});if(_0x236f37[_0xd844('0x36')]){logger['error']('[%s][QUEUE]\x20%s',_0x128655,_['map'](_0x236f37,_0xd844('0x28'))['join'](',\x20'));_0x4a1814[_0xd844('0x37')]();}else{var _0x1723dc=_[_0xd844('0x38')](_0x3cbb4a[_0x79834c[_0xd844('0x25')]+_0xd844('0x39')],handleFindQueue(_0x53ac4b[_0xd844('0x2b')]));if(_0x1723dc){startRouting(_0x128655,_0x1723dc,_0x79834c,_0x3cbb4a);var _0x2d713c=(_0x1723dc[_0xd844('0x31')]||0xa)*0x3e8;var _0x15d1cd=(_0x53ac4b[_0xd844('0x31')]||0x14)*0x3e8;var _0x2ad4b1,_0x593938;if(_0x2d713c>_0x15d1cd){_0x15d1cd=_0x2d713c;}var _0x7beb70=seqqueue[_0xd844('0x3a')](_0x2d713c);_0x7beb70['id']=_0x128655;_0x7beb70[_0xd844('0x3b')]=_0x2d713c;_0x7beb70[_0xd844('0x3c')]=_0x15d1cd;_0x7beb70[_0xd844('0x25')]=_0x79834c[_0xd844('0x25')];_0x3cbb4a[_0xd844('0x3d')][_0x128655]['on'](_0xd844('0x3e'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x128655);stopRouting(_0x128655,_0x1723dc,_0x79834c,_0x3cbb4a);clearTimeout(_0x2ad4b1);_0x2ad4b1=undefined;_0x7beb70[_0xd844('0x3f')](!![]);if(_0x3cbb4a[_0xd844('0x3d')][_0x128655]){delete _0x3cbb4a[_0xd844('0x3d')][_0x128655];}_0x4a1814[_0xd844('0x37')]();});_0x3cbb4a['rules'][_0x128655]['on']('complete',function(){if(_0x3cbb4a['rules'][_0x128655]){delete _0x3cbb4a[_0xd844('0x3d')][_0x128655];}});_0x2ad4b1=setTimeout(function(){logger['info'](_0xd844('0x40'),_0x128655);endRouting(_0x128655,_0x1723dc,_0x79834c,_0x3cbb4a);clearTimeout(_0x2ad4b1);_0x7beb70[_0xd844('0x3f')](!![]);_0x4a1814[_0xd844('0x41')]();},_0x15d1cd);switch(_0x1723dc[_0xd844('0x42')]){case _0xd844('0x43'):strategy[_0xd844('0x43')](_0x7beb70,_0x1723dc,_0x3cbb4a,_0x79834c);break;default:strategy['beepall'](_0x7beb70,_0x1723dc,_0x3cbb4a,_0x79834c);}}else{logger[_0xd844('0x33')](_0xd844('0x44'),_0x128655,_0x53ac4b[_0xd844('0x2b')]);_0x4a1814[_0xd844('0x37')]();}}}catch(_0x22f6c2){console['log'](_0x22f6c2);logger[_0xd844('0x33')](_0xd844('0x45'),_0x128655,_0x22f6c2[_0xd844('0x46')]);_0x4a1814[_0xd844('0x37')]();}};}; \ 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 4221ca6..1a9ca57 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 _0xef5f=['[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED'];(function(_0x2b23d7,_0x3f01ff){var _0x58f35d=function(_0x2826b4){while(--_0x2826b4){_0x2b23d7['push'](_0x2b23d7['shift']());}};_0x58f35d(++_0x3f01ff);}(_0xef5f,0x198));var _0xfef5=function(_0x46c232,_0x3e6359){_0x46c232=_0x46c232-0x0;var _0x4ae275=_0xef5f[_0x46c232];return _0x4ae275;};'use strict';var _=require('lodash');var uuid=require(_0xfef5('0x0'));var util=require(_0xfef5('0x1'));var logger=require('../../../../../config/logger')(_0xfef5('0x2'));var Agent=function(_0xd7d980,_0x169cbb,_0x334d2c,_0x375647){this['notificationId']=uuid['v4']();this[_0xfef5('0x3')]=_0xd7d980;this[_0xfef5('0x4')]=_0x169cbb;this[_0xfef5('0x5')]=_0x334d2c;this[_0xfef5('0x2')]=_0x375647;this[_0xfef5('0x3')]['push'](this[_0xfef5('0x6')][_0xfef5('0x7')](this),this[_0xfef5('0x8')][_0xfef5('0x7')](this));this['squeue']['on'](_0xfef5('0x9'),this['handleTimeout'][_0xfef5('0x7')](this));this[_0xfef5('0x3')]['on']('drained',this[_0xfef5('0xa')]['bind'](this));};Agent[_0xfef5('0xb')]['push']=function(){this['squeue'][_0xfef5('0xc')](this[_0xfef5('0x6')][_0xfef5('0x7')](this),this['handleTimeout']['bind'](this));};Agent[_0xfef5('0xb')][_0xfef5('0xa')]=function(){this[_0xfef5('0x8')](!![]);};Agent[_0xfef5('0xb')]['handleRun']=function(_0x3cd994){logger[_0xfef5('0xd')](_0xfef5('0xe'),this[_0xfef5('0x3')]['id'],this[_0xfef5('0x4')]['id']);if(_[_0xfef5('0xf')](this[_0xfef5('0x5')][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']])){logger[_0xfef5('0xd')](_0xfef5('0x11'),this[_0xfef5('0x3')]['id'],this['agent']['id']);setTimeout(this[_0xfef5('0xc')][_0xfef5('0x7')](this),0x3e8);}else{if(this['routing'][_0xfef5('0x12')]||util['isAgentAvailable'](this[_0xfef5('0x3')]['id'],this[_0xfef5('0x5')]['agents'][this[_0xfef5('0x4')]['id']],this['squeue'][_0xfef5('0x13')],![])){this[_0xfef5('0x5')][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']]['busy']=!![];this['realtime']['agents'][this[_0xfef5('0x4')]['id']][_0xfef5('0x14')]=undefined;util[_0xfef5('0x15')](this[_0xfef5('0x16')],this[_0xfef5('0x3')]['id'],this[_0xfef5('0x5')]['agents'][this[_0xfef5('0x4')]['id']],null,this['routing']);util[_0xfef5('0x17')](this[_0xfef5('0x3')]['id'],this[_0xfef5('0x5')][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']],_0xfef5('0x18')+(this['routing'][_0xfef5('0x12')]?_0xfef5('0x19'):''));}else{logger[_0xfef5('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xfef5('0x3')]['id'],this[_0xfef5('0x4')]['id']);setTimeout(this['push'][_0xfef5('0x7')](this),0x3e8);}}};Agent[_0xfef5('0xb')][_0xfef5('0x8')]=function(_0x5e5540){if(_[_0xfef5('0xf')](this[_0xfef5('0x5')][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']])){return logger[_0xfef5('0xd')](_0xfef5('0x11'),this[_0xfef5('0x3')]['id'],this[_0xfef5('0x4')]['id']);}else{logger[_0xfef5('0xd')](_0xfef5('0x1a'),this['squeue']['id'],this[_0xfef5('0x4')]['id']);util[_0xfef5('0x1b')](this[_0xfef5('0x16')],this[_0xfef5('0x3')]['id'],this[_0xfef5('0x5')]['agents'][this[_0xfef5('0x4')]['id']],null,this['routing']);this['realtime'][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']]['busy']=![];this[_0xfef5('0x5')][_0xfef5('0x10')][this[_0xfef5('0x4')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0xfef5('0x3')]['id'],this['realtime']['agents'][this[_0xfef5('0x4')]['id']],_0x5e5540?_0xfef5('0x1c'):_0xfef5('0x1d'));}if(!_0x5e5540){setTimeout(this[_0xfef5('0xc')][_0xfef5('0x7')](this),0x3e8);}};function agent(_0x4620e1,_0x5f3c5d,_0xca9802,_0x52e9a3){return new Agent(_0x4620e1,_0x5f3c5d,_0xca9802,_0x52e9a3);}module[_0xfef5('0x1e')]=agent; \ No newline at end of file +var _0x3f43=['uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','TIMEOUT','exports'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x3f43,0xa0));var _0x33f4=function(_0x168dd7,_0x509c55){_0x168dd7=_0x168dd7-0x0;var _0x167ed9=_0x3f43[_0x168dd7];return _0x167ed9;};'use strict';var _=require('lodash');var uuid=require(_0x33f4('0x0'));var util=require(_0x33f4('0x1'));var logger=require(_0x33f4('0x2'))('routing');var Agent=function(_0x2a78e8,_0x345833,_0xb98925,_0x22ab29){this[_0x33f4('0x3')]=uuid['v4']();this[_0x33f4('0x4')]=_0x2a78e8;this['agent']=_0x345833;this[_0x33f4('0x5')]=_0xb98925;this[_0x33f4('0x6')]=_0x22ab29;this[_0x33f4('0x4')][_0x33f4('0x7')](this[_0x33f4('0x8')][_0x33f4('0x9')](this),this[_0x33f4('0xa')]['bind'](this));this['squeue']['on'](_0x33f4('0xb'),this['handleTimeout'][_0x33f4('0x9')](this));this[_0x33f4('0x4')]['on'](_0x33f4('0xc'),this['handleDrained']['bind'](this));};Agent[_0x33f4('0xd')][_0x33f4('0x7')]=function(){this[_0x33f4('0x4')][_0x33f4('0x7')](this[_0x33f4('0x8')][_0x33f4('0x9')](this),this[_0x33f4('0xa')]['bind'](this));};Agent[_0x33f4('0xd')][_0x33f4('0xe')]=function(){this[_0x33f4('0xa')](!![]);};Agent[_0x33f4('0xd')][_0x33f4('0x8')]=function(_0x575349){logger[_0x33f4('0xf')](_0x33f4('0x10'),this['squeue']['id'],this[_0x33f4('0x11')]['id']);if(_[_0x33f4('0x12')](this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']])){logger[_0x33f4('0xf')](_0x33f4('0x14'),this[_0x33f4('0x4')]['id'],this[_0x33f4('0x11')]['id']);setTimeout(this[_0x33f4('0x7')]['bind'](this),0x3e8);}else{if(this[_0x33f4('0x6')][_0x33f4('0x15')]||util['isAgentAvailable'](this[_0x33f4('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0x33f4('0x4')][_0x33f4('0x16')],![])){this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']]['busy']=!![];this[_0x33f4('0x5')][_0x33f4('0x13')][this['agent']['id']][_0x33f4('0x17')]=undefined;util[_0x33f4('0x18')](this[_0x33f4('0x3')],this[_0x33f4('0x4')]['id'],this[_0x33f4('0x5')][_0x33f4('0x13')][this['agent']['id']],null,this[_0x33f4('0x6')]);util['writeLog'](this[_0x33f4('0x4')]['id'],this['realtime'][_0x33f4('0x13')][this['agent']['id']],_0x33f4('0x19')+(this[_0x33f4('0x6')][_0x33f4('0x15')]?_0x33f4('0x1a'):''));}else{logger[_0x33f4('0xf')](_0x33f4('0x1b'),this[_0x33f4('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x33f4('0x7')][_0x33f4('0x9')](this),0x3e8);}}};Agent[_0x33f4('0xd')][_0x33f4('0xa')]=function(_0x276fa3){if(_[_0x33f4('0x12')](this[_0x33f4('0x5')]['agents'][this[_0x33f4('0x11')]['id']])){return logger[_0x33f4('0xf')](_0x33f4('0x14'),this[_0x33f4('0x4')]['id'],this['agent']['id']);}else{logger[_0x33f4('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x33f4('0x4')]['id'],this['agent']['id']);util[_0x33f4('0x1c')](this['notificationId'],this[_0x33f4('0x4')]['id'],this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']],null,this[_0x33f4('0x6')]);this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']][_0x33f4('0x1d')]=![];this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']][_0x33f4('0x17')]=undefined;util['writeLog'](this[_0x33f4('0x4')]['id'],this[_0x33f4('0x5')][_0x33f4('0x13')][this[_0x33f4('0x11')]['id']],_0x276fa3?'STOP':_0x33f4('0x1e'));}if(!_0x276fa3){setTimeout(this[_0x33f4('0x7')][_0x33f4('0x9')](this),0x3e8);}};function agent(_0x2b4999,_0x1c77a0,_0x507ef8,_0x244e80){return new Agent(_0x2b4999,_0x1c77a0,_0x507ef8,_0x244e80);}module[_0x33f4('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index b96f677..9f8e38b 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 _0x302c=['timeout','drained','prototype','handleDrained','isNil','queue','length','Agents','agents','info','isAgentAvailable','writeLog','RINGING','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busy','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','push','handleRun','bind','handleTimeout'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x302c,0x15c));var _0xc302=function(_0x130c7d,_0x155870){_0x130c7d=_0x130c7d-0x0;var _0xaaa03e=_0x302c[_0x130c7d];return _0xaaa03e;};'use strict';var _=require(_0xc302('0x0'));var uuid=require(_0xc302('0x1'));var util=require(_0xc302('0x2'));var logger=require(_0xc302('0x3'))(_0xc302('0x4'));var Beepall=function(_0x4d2268,_0x5d732b,_0x256168,_0xdc61f1){this[_0xc302('0x5')]=uuid['v4']();this['squeue']=_0x4d2268;this['queue']=_0x5d732b;this[_0xc302('0x6')]=_0x256168;this['routing']=_0xdc61f1;this[_0xc302('0x7')][_0xc302('0x8')](this[_0xc302('0x9')][_0xc302('0xa')](this),this[_0xc302('0xb')][_0xc302('0xa')](this));this['squeue']['on'](_0xc302('0xc'),this[_0xc302('0xb')]['bind'](this));this['squeue']['on'](_0xc302('0xd'),this['handleDrained']['bind'](this));};Beepall['prototype'][_0xc302('0x8')]=function(){this[_0xc302('0x7')][_0xc302('0x8')](this[_0xc302('0x9')][_0xc302('0xa')](this),this[_0xc302('0xb')][_0xc302('0xa')](this));};Beepall[_0xc302('0xe')][_0xc302('0xf')]=function(_0x39daf7){this['handleTimeout'](!![]);};Beepall[_0xc302('0xe')][_0xc302('0x9')]=function(_0x54a865){var _0x2466a6=!![];if(!_[_0xc302('0x10')](this[_0xc302('0x11')])&&!_[_0xc302('0x10')](this[_0xc302('0x11')]['Agents'])&&this[_0xc302('0x11')]['Agents'][_0xc302('0x12')]>0x0){for(var _0x337d22=0x0,_0x59b36c;_0x337d220x0){for(var _0x54b98a=0x0,_0x51e656;_0x54b98a0x0&&_0x1b7760[_0x5b6502+_0x22d7('0x27')]>=_0x1b7760[_0x5b6502+_0x22d7('0x28')]){writeLog(_0x141220,_0x1b7760,_0x5b6502['toUpperCase']()+_0x22d7('0x29'));return![];}}return!![];};exports[_0x22d7('0x2a')]=function(_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd){return sendNotification(!![],_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd);};exports[_0x22d7('0x2b')]=function(_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334){return sendNotification(![],_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x2d72=['redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing'];(function(_0x4a6c4d,_0x455768){var _0x31800b=function(_0x203513){while(--_0x203513){_0x4a6c4d['push'](_0x4a6c4d['shift']());}};_0x31800b(++_0x455768);}(_0x2d72,0xa8));var _0x22d7=function(_0x238fd4,_0x1ebd5a){_0x238fd4=_0x238fd4-0x0;var _0x5b751d=_0x2d72[_0x238fd4];return _0x5b751d;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var utils=require(_0x22d7('0x2'));var Mustache=require(_0x22d7('0x3'));var Redis=require(_0x22d7('0x4'));var config=require(_0x22d7('0x5'));var logger=require(_0x22d7('0x6'))(_0x22d7('0x7'));config[_0x22d7('0x8')]=_[_0x22d7('0x9')](config[_0x22d7('0x8')],{'host':_0x22d7('0xa'),'port':0x18eb});var io=require(_0x22d7('0xb'))(new Redis(config[_0x22d7('0x8')]));function emit(_0x52a3e3,_0x23a731,_0x3791d6){io['to'](_0x52a3e3)['emit'](_0x23a731,_0x3791d6);}function sendNotification(_0x3b12cd,_0x1abed9,_0x1c6aaf,_0x3c694f,_0x49f7e1,_0x5f56eb){io['to'](util[_0x22d7('0xc')](_0x22d7('0xd'),_0x3c694f[_0x22d7('0xe')]))[_0x22d7('0xf')](_0x22d7('0x10'),_0x3c694f);var _0x4db5dd=_0x5f56eb||{};var _0x47cec1=_0x1c6aaf[_0x22d7('0x11')]('.');var _0x4e1146={'uniqueid':_0x1abed9,'channel':_0x47cec1[0x0],'id':_0x47cec1[0x1],'title':_0x47cec1[0x0]+_0x22d7('0x12'),'interactionId':_0x47cec1[0x2],'queue':_0x49f7e1?_0x49f7e1[_0x22d7('0xe')]:null,'sound':_0x4db5dd['account'][_0x22d7('0x13')],'shake':_0x4db5dd[_0x22d7('0x14')][_0x22d7('0x15')]};try{if(!_0x4db5dd[_0x22d7('0x16')]){_0x4db5dd[_0x22d7('0x16')]={};}if(_0x49f7e1){_0x4db5dd[_0x22d7('0x16')][_0x22d7('0x17')]=_0x49f7e1;}else if(_0x4db5dd[_0x22d7('0x16')]['queue']){delete _0x4db5dd[_0x22d7('0x16')][_0x22d7('0x17')];}_0x4e1146[_0x22d7('0x18')]=utils['getMustacheRender'](_0x4db5dd['account']['notificationTemplate'],_0x4db5dd);}catch(_0x46f63d){_0x4e1146[_0x22d7('0x18')]=_0x22d7('0x19');logger[_0x22d7('0x1a')](util[_0x22d7('0xc')]('[%s][QUEUE]\x20%s',_0x1abed9,_0x46f63d[_0x22d7('0x1b')]));}io['to'](util[_0x22d7('0xc')](_0x22d7('0xd'),_0x3c694f['name']))[_0x22d7('0xf')](util[_0x22d7('0xc')](_0x22d7('0x1c'),_0x3b12cd?_0x22d7('0x1d'):_0x22d7('0x1e')),_0x4e1146);}function writeLog(_0x577400,_0x5e03d5,_0x219f7c){return logger[_0x22d7('0x1f')](util[_0x22d7('0xc')](_0x22d7('0x20'),_0x577400,_0x5e03d5['name'],_0x219f7c));}exports[_0x22d7('0x21')]=function(_0x141220,_0x1b7760,_0x5b6502,_0x459827){if(_0x1b7760['busy']){writeLog(_0x141220,_0x1b7760,_0x22d7('0x22'));return![];}if(!_0x1b7760[_0x22d7('0x23')]){writeLog(_0x141220,_0x1b7760,_0x22d7('0x24'));return![];}if(_0x1b7760[_0x5b6502+'Pause']){writeLog(_0x141220,_0x1b7760,_0x22d7('0x25'));return![];}if(_0x459827&&_0x1b7760['hasOwnProperty'](_0x5b6502+'Capacity')&&_0x1b7760[_0x22d7('0x26')](_0x5b6502+_0x22d7('0x27'))){if(_0x1b7760[_0x5b6502+_0x22d7('0x28')]>0x0&&_0x1b7760[_0x5b6502+_0x22d7('0x27')]>=_0x1b7760[_0x5b6502+_0x22d7('0x28')]){writeLog(_0x141220,_0x1b7760,_0x5b6502['toUpperCase']()+_0x22d7('0x29'));return![];}}return!![];};exports[_0x22d7('0x2a')]=function(_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd){return sendNotification(!![],_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd);};exports[_0x22d7('0x2b')]=function(_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334){return sendNotification(![],_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334);};exports['writeLog']=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 e90387a..e1f1fbf 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 _0xdeb3=['stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xdeb3,0xeb));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'use strict';var schema=require(_0x3deb('0x0'));var sh=require(_0x3deb('0x1'));var _=require(_0x3deb('0x2'));var utils=require(_0x3deb('0x3'));var logger=require(_0x3deb('0x4'))(_0x3deb('0x5'));var system=schema({'command':{'type':_0x3deb('0x6'),'required':!![],'message':_0x3deb('0x7')}});exports[_0x3deb('0x8')]=function(_0x4b441d,_0x47bff9){return function(_0x5e2b88){try{var _0x788f8f={'command':_0x47bff9[0x0]};var _0x7b819=system[_0x3deb('0x0')](_0x788f8f,{'typecast':!![]});if(_0x7b819[_0x3deb('0x9')]){logger[_0x3deb('0xa')]('[%s][SYSTEM]\x20%s',_0x4b441d,_['map'](_0x7b819,_0x3deb('0xb'))[_0x3deb('0xc')](',\x20'));logger[_0x3deb('0xd')](_0x3deb('0xe'),_0x4b441d);_0x5e2b88[_0x3deb('0xf')]();}else{var _0x33b66d=this;var _0x37e5f7=utils[_0x3deb('0x10')](_0x47bff9[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x4b441d,_0x37e5f7);sh['exec'](_[_0x3deb('0x11')](_0x37e5f7),function(_0x504e9a,_0x330139){logger[_0x3deb('0xd')](_0x3deb('0x12'),_0x4b441d,_0x504e9a);if(_0x504e9a==0x0){var _0x1055dc=_0x330139['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x3deb('0x13')](_0x47bff9[0x1])||_[_0x3deb('0x14')](_0x47bff9[0x1])){logger[_0x3deb('0xd')](_0x3deb('0x15'),_0x4b441d);_0x33b66d[_0x3deb('0x16')][_0x47bff9[0x1]]=_0x1055dc;}else{logger[_0x3deb('0xd')](_0x3deb('0x17'),_0x4b441d,_0x47bff9[0x1],_0x1055dc);_0x33b66d[_0x3deb('0x16')][_0x47bff9[0x1]]=_0x1055dc;}}_0x5e2b88['next']();});}}catch(_0x428f90){logger[_0x3deb('0xa')]('[%s][SYSTEM]\x20%s',_0x4b441d,_[_0x3deb('0x18')](_0x428f90)?JSON[_0x3deb('0x19')](_0x428f90):_0x428f90);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4b441d);_0x5e2b88['next']();}};}; \ No newline at end of file +var _0xed1f=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xed1f,0x6a));var _0xfed1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed1f[_0x36ed48];return _0x51c63a;};'use strict';var schema=require(_0xfed1('0x0'));var sh=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var utils=require(_0xfed1('0x3'));var logger=require(_0xfed1('0x4'))(_0xfed1('0x5'));var system=schema({'command':{'type':_0xfed1('0x6'),'required':!![],'message':_0xfed1('0x7')}});exports[_0xfed1('0x8')]=function(_0x45c3c1,_0x22bfae){return function(_0xd2c769){try{var _0x3d6706={'command':_0x22bfae[0x0]};var _0x42751d=system[_0xfed1('0x0')](_0x3d6706,{'typecast':!![]});if(_0x42751d[_0xfed1('0x9')]){logger[_0xfed1('0xa')](_0xfed1('0xb'),_0x45c3c1,_['map'](_0x42751d,_0xfed1('0xc'))[_0xfed1('0xd')](',\x20'));logger['info'](_0xfed1('0xe'),_0x45c3c1);_0xd2c769[_0xfed1('0xf')]();}else{var _0x4a564e=this;var _0x3ce017=utils['getMustacheRender'](_0x22bfae[0x0],this);logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x45c3c1,_0x3ce017);sh['exec'](_['trim'](_0x3ce017),function(_0x3d1891,_0xe84ba6){logger['info'](_0xfed1('0x12'),_0x45c3c1,_0x3d1891);if(_0x3d1891==0x0){var _0x5a3469=_0xe84ba6['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xfed1('0x13')](_0x22bfae[0x1])||_[_0xfed1('0x14')](_0x22bfae[0x1])){logger['info'](_0xfed1('0x15'),_0x45c3c1);_0x4a564e['body'][_0x22bfae[0x1]]=_0x5a3469;}else{logger['info'](_0xfed1('0x16'),_0x45c3c1,_0x22bfae[0x1],_0x5a3469);_0x4a564e[_0xfed1('0x17')][_0x22bfae[0x1]]=_0x5a3469;}}_0xd2c769[_0xfed1('0xf')]();});}}catch(_0x123c46){logger['error'](_0xfed1('0xb'),_0x45c3c1,_['isObject'](_0x123c46)?JSON[_0xfed1('0x18')](_0x123c46):_0x123c46);logger[_0xfed1('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x45c3c1);_0xd2c769[_0xfed1('0xf')]();}};}; \ 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 28e7ec3..10f81c8 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 _0x392a=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify'];(function(_0x282a1d,_0x310b3f){var _0x1e68f4=function(_0x5a7ea3){while(--_0x5a7ea3){_0x282a1d['push'](_0x282a1d['shift']());}};_0x1e68f4(++_0x310b3f);}(_0x392a,0x1cd));var _0xa392=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x392a[_0x4a9fb1];return _0x348672;};'use strict';var schema=require(_0xa392('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xa392('0x1')),'openchannelInteraction':require(_0xa392('0x2')),'smsInteraction':require(_0xa392('0x3')),'mailInteraction':require(_0xa392('0x4')),'faxInteraction':require(_0xa392('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xa392('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xa392('0x7')}});exports[_0xa392('0x8')]=function(_0x91d660,_0x46a313,_0x2fdf10,_0x380ab3){return function(_0x14c952){try{var _0x485f05={'tag':_0x46a313[0x0]};var _0x4e9166=tag[_0xa392('0x0')](_0x485f05,{'typecast':!![]});if(_0x4e9166[_0xa392('0x9')]){logger[_0xa392('0xa')](_0xa392('0xb'),_0x91d660,_[_0xa392('0xc')](_0x4e9166,_0xa392('0xd'))[_0xa392('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x91d660);_0x14c952[_0xa392('0xf')]();}else{var _0x10a5f4={'ids':[_0x46a313[0x0]]};if(rpc[_0x380ab3[_0xa392('0x10')]+_0xa392('0x11')]){rpc[_0x380ab3['channel']+_0xa392('0x11')][_0xa392('0x12')](_0x380ab3[_0xa392('0x13')]['id'],_0x10a5f4)[_0xa392('0x14')](function(_0x1068cc){logger[_0xa392('0x15')](_0xa392('0x16'),_0x91d660,_0x46a313[0x1],_0x380ab3[_0xa392('0x10')],_0x380ab3['interaction']['id']);})[_0xa392('0x17')](function(_0x19fc36){logger['error']('[%s][TAG]\x20%s',_0x91d660,JSON[_0xa392('0x18')](_0x19fc36));logger['info'](_0xa392('0x19'),_0x91d660);})['finally'](function(){_0x14c952[_0xa392('0xf')]();});}}}catch(_0x4b6880){logger[_0xa392('0xa')](_0xa392('0xb'),_0x91d660,_[_0xa392('0x1a')](_0x4b6880)?JSON[_0xa392('0x18')](_0x4b6880):_0x4b6880);logger[_0xa392('0x15')](_0xa392('0x19'),_0x91d660);_0x14c952[_0xa392('0xf')]();}};}; \ No newline at end of file +var _0x03fc=['finally','next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','join','info','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x03fc,0x1cd));var _0xc03f=function(_0x45ec87,_0x5a9537){_0x45ec87=_0x45ec87-0x0;var _0x5b6eea=_0x03fc[_0x45ec87];return _0x5b6eea;};'use strict';var schema=require(_0xc03f('0x0'));var _=require(_0xc03f('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xc03f('0x2')),'smsInteraction':require(_0xc03f('0x3')),'mailInteraction':require(_0xc03f('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xc03f('0x5'))};var logger=require('../../../../config/logger')(_0xc03f('0x6'));var tag=schema({'tag':{'type':_0xc03f('0x7'),'required':!![],'message':_0xc03f('0x8')}});exports[_0xc03f('0x9')]=function(_0x2cd586,_0x220fcd,_0x541be7,_0x5f13b4){return function(_0x2c6306){try{var _0x2eef69={'tag':_0x220fcd[0x0]};var _0x1f30d6=tag[_0xc03f('0x0')](_0x2eef69,{'typecast':!![]});if(_0x1f30d6[_0xc03f('0xa')]){logger[_0xc03f('0xb')](_0xc03f('0xc'),_0x2cd586,_['map'](_0x1f30d6,_0xc03f('0xd'))[_0xc03f('0xe')](',\x20'));logger[_0xc03f('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2cd586);_0x2c6306['next']();}else{var _0x1bb736={'ids':[_0x220fcd[0x0]]};if(rpc[_0x5f13b4['channel']+_0xc03f('0x10')]){rpc[_0x5f13b4[_0xc03f('0x11')]+_0xc03f('0x10')][_0xc03f('0x12')](_0x5f13b4[_0xc03f('0x13')]['id'],_0x1bb736)[_0xc03f('0x14')](function(_0x55997c){logger['info'](_0xc03f('0x15'),_0x2cd586,_0x220fcd[0x1],_0x5f13b4['channel'],_0x5f13b4[_0xc03f('0x13')]['id']);})[_0xc03f('0x16')](function(_0x336972){logger[_0xc03f('0xb')]('[%s][TAG]\x20%s',_0x2cd586,JSON[_0xc03f('0x17')](_0x336972));logger[_0xc03f('0xf')](_0xc03f('0x18'),_0x2cd586);})[_0xc03f('0x19')](function(){_0x2c6306[_0xc03f('0x1a')]();});}}}catch(_0x80b6e8){logger['error'](_0xc03f('0xc'),_0x2cd586,_['isObject'](_0x80b6e8)?JSON[_0xc03f('0x17')](_0x80b6e8):_0x80b6e8);logger['info'](_0xc03f('0x18'),_0x2cd586);_0x2c6306['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 0d59d81..d5a4392 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x477994,_0x3fbadc){var _0x2cf65d=function(_0x6cc92b){while(--_0x6cc92b){_0x477994['push'](_0x477994['shift']());}};_0x2cf65d(++_0x3fbadc);}(_0xe706,0xa3));var _0x6e70=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0xe706[_0x48c4ef];return _0x435715;};'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 +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x116348,_0x393d36){var _0x3b251f=function(_0x4d1288){while(--_0x4d1288){_0x116348['push'](_0x116348['shift']());}};_0x3b251f(++_0x393d36);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3ff9c1a..24161f8 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 _0xf402=['127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','.js','mail','push','slice','dialogflow','dialogflowv2','appdata','split','amazonlex','tag','TagId','%s:%s:%s','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','app','execute','stringify','matchPath','emit','complete','info','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','channel','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','http'];(function(_0x1ab37a,_0x250df7){var _0x559214=function(_0x4c5be4){while(--_0x4c5be4){_0x1ab37a['push'](_0x1ab37a['shift']());}};_0x559214(++_0x250df7);}(_0xf402,0x124));var _0x2f40=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf402[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var path=require(_0x2f40('0x2'));var fs=require('fs');var jayson=require(_0x2f40('0x3'));var BPromise=require('bluebird');var uuid=require(_0x2f40('0x4'));var config=require(_0x2f40('0x5'));var logger=require('../../../config/logger')(_0x2f40('0x6'));var rpc={'openchannelQueueReport':require(_0x2f40('0x7')),'mailQueueReport':require(_0x2f40('0x8')),'chatQueueReport':require(_0x2f40('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x2f40('0xa')),'whatsappQueueReport':require(_0x2f40('0xb'))};var RuleEngine=require(_0x2f40('0xc'));function getId(_0x9207e3,_0x533e7a,_0x4be6de){return util['format'](_0x2f40('0xd'),_0x9207e3,_0x533e7a||0x0,_0x4be6de||0x0);}function getIntervals(_0x4979a8,_0x53ca28){var _0x60bbdf=[];if(!_['isNil'](_0x53ca28[_0x2f40('0xe')])&&!_[_0x2f40('0xf')](_0x4979a8[_0x53ca28[_0x2f40('0xe')]])&&!_['isNil'](_0x4979a8[_0x53ca28[_0x2f40('0xe')]][_0x2f40('0x10')])){_0x60bbdf=_[_0x2f40('0x11')](_0x4979a8[_0x53ca28[_0x2f40('0xe')]][_0x2f40('0x10')],_0x2f40('0x12'));}else if(!_[_0x2f40('0xf')](_0x53ca28[_0x2f40('0x12')])){_0x60bbdf=[_0x53ca28[_0x2f40('0x12')]];}return _0x60bbdf;}exports[_0x2f40('0x13')]=function(_0x18faca){_0x18faca[_0x2f40('0x14')]={};return new BPromise(function(_0x3ed778,_0x597bb4){var _0x1ba76d={'Start':function(_0x568a32){var _0x2473c0=this;return new Promise(function(_0x499103,_0x467f33){if(_0x568a32){try{var _0x57caae=[];var _0x5223e2=getId(_0x568a32['channel'],_0x568a32[_0x2f40('0x15')]?_0x568a32[_0x2f40('0x15')]['id']:0x0,_0x568a32['interaction']?_0x568a32[_0x2f40('0x16')]['id']:0x0);if(_0x568a32[_0x2f40('0x17')]&&_[_0x2f40('0x18')](_0x568a32['applications'])&&_0x568a32['applications'][_0x2f40('0x19')]){for(var _0x3a5ef9=0x0;_0x3a5ef9<_0x568a32['applications'][_0x2f40('0x19')];_0x3a5ef9+=0x1){var _0x4ea7a6=_0x568a32[_0x2f40('0x17')][_0x3a5ef9];if(fs[_0x2f40('0x1a')](path[_0x2f40('0x1b')](__dirname,'applications',_0x4ea7a6['app']+_0x2f40('0x1c')))){var _0x4ec803=[];switch(_0x4ea7a6['app']['toLowerCase']()){case'autoreply':var _0x440b22=_0x4ea7a6['appdata']['split'](',');if(_0x568a32['channel']===_0x2f40('0x1d')){_0x4ec803[_0x2f40('0x1e')](_0x440b22[0x0]);_0x4ec803[_0x2f40('0x1e')](_0x440b22[0x1]);_0x4ec803[_0x2f40('0x1e')](_0x440b22[_0x2f40('0x1f')](0x2,_0x440b22[_0x2f40('0x19')])['join'](','));}else{_0x4ec803[_0x2f40('0x1e')](_0x440b22[0x0]);_0x4ec803[_0x2f40('0x1e')](_0x440b22[_0x2f40('0x1f')](0x1,_0x440b22[_0x2f40('0x19')])[_0x2f40('0x1b')](','));}break;case _0x2f40('0x20'):var _0x3a4d86=_0x4ea7a6['appdata']['split'](',');_0x4ec803['push'](_0x3a4d86[0x0]);_0x4ec803[_0x2f40('0x1e')](_0x3a4d86[0x1]);_0x4ec803[_0x2f40('0x1e')](_0x3a4d86['slice'](0x2,_0x3a4d86[_0x2f40('0x19')])[_0x2f40('0x1b')](','));break;case _0x2f40('0x21'):var _0x43d19e=_0x4ea7a6[_0x2f40('0x22')][_0x2f40('0x23')](',');_0x4ec803['push'](_0x43d19e[0x0]);_0x4ec803[_0x2f40('0x1e')](_0x43d19e[0x1]);_0x4ec803['push'](_0x43d19e[0x2]);_0x4ec803['push'](_0x43d19e[0x3]);_0x4ec803[_0x2f40('0x1e')](_0x43d19e[_0x2f40('0x1f')](0x4,_0x43d19e[_0x2f40('0x19')])[_0x2f40('0x1b')](','));break;case _0x2f40('0x24'):var _0x4aa23e=_0x4ea7a6[_0x2f40('0x22')][_0x2f40('0x23')](',');_0x4ec803[_0x2f40('0x1e')](_0x4aa23e[0x0]);_0x4ec803['push'](_0x4aa23e[0x1]);_0x4ec803['push'](_0x4aa23e[0x2]);_0x4ec803['push'](_0x4aa23e[0x3]);_0x4ec803['push'](_0x4aa23e['slice'](0x4,_0x4aa23e[_0x2f40('0x19')])[_0x2f40('0x1b')](','));break;case _0x2f40('0x15'):_0x4ec803[_0x2f40('0x1e')](_0x4ea7a6[_0x2f40('0x22')]);break;case _0x2f40('0x25'):_0x4ec803[_0x2f40('0x1e')](_0x4ea7a6[_0x2f40('0x26')]);_0x4ec803[_0x2f40('0x1e')](_0x4ea7a6['appdata']);break;default:_0x4ec803=_[_0x2f40('0xf')](_0x4ea7a6[_0x2f40('0x22')])?[]:_0x4ea7a6[_0x2f40('0x22')][_0x2f40('0x23')](',');}var _0x326ba={'id':util['format'](_0x2f40('0x27'),_0x5223e2,_0x4ea7a6['id'],_0x4ea7a6['app']),'condition':require('./interval')[_0x2f40('0x28')](_0x5223e2,getIntervals(_0x18faca[_0x2f40('0x29')],_0x4ea7a6),_0x18faca),'consequence':require(_0x2f40('0x2a')+_0x4ea7a6['app'])[_0x2f40('0x2b')](_0x5223e2,_0x4ec803,_0x18faca,_0x568a32),'p':_0x4ea7a6[_0x2f40('0x2c')]||0x0};logger['info'](_0x2f40('0x2d'),_0x326ba['id'],_0x2f40('0x2e'),getIntervals(_0x18faca[_0x2f40('0x29')],_0x4ea7a6)['join']('\x20|\x20'));_0x57caae[_0x2f40('0x1e')](_0x326ba);}else{logger[_0x2f40('0x2f')](_0x2f40('0x30'),path[_0x2f40('0x1b')](__dirname,_0x2f40('0x17'),_0x4ea7a6[_0x2f40('0x31')]+_0x2f40('0x1c')));}}_0x18faca['rules'][_0x5223e2]=new RuleEngine(_0x57caae);_0x18faca[_0x2f40('0x14')][_0x5223e2][_0x2f40('0x32')](_0x568a32,function(_0x5296f4){logger['info']('Applications\x20executed',JSON[_0x2f40('0x33')](_0x5296f4[_0x2f40('0x34')]));if(_0x18faca[_0x2f40('0x14')][_0x5223e2]){_0x18faca[_0x2f40('0x14')][_0x5223e2][_0x2f40('0x35')](_0x2f40('0x36'));}});return _0x499103({'code':0xc8,'message':_0x568a32});}else{logger[_0x2f40('0x37')](_0x2f40('0x38'));return _0x499103({'code':0xc8,'message':_0x568a32});}}catch(_0x235b3c){logger[_0x2f40('0x2f')](_0x235b3c[_0x2f40('0x39')]);return _0x467f33(_0x2473c0[_0x2f40('0x2f')](0x1f4,_0x235b3c));}}return _0x467f33(_0x2f40('0x3a'));});},'AcceptMessage':function(_0x46607a){var _0x1cd0a0=this;return new Promise(function(_0x140b0c,_0x40311a){if(_0x46607a['agent']&&_0x46607a[_0x2f40('0x3b')]['id']){if(_0x18faca[_0x2f40('0x3c')][_0x46607a[_0x2f40('0x3b')]['id']]){_0x18faca[_0x2f40('0x3c')][_0x46607a[_0x2f40('0x3b')]['id']][_0x2f40('0x3d')]=![];_0x18faca['agents'][_0x46607a['agent']['id']][_0x2f40('0x3e')]=undefined;}}if(_0x46607a[_0x2f40('0x15')]&&_0x46607a[_0x2f40('0x15')]['id']){try{var _0xcfa65d=getId(_0x46607a[_0x2f40('0x3f')],_0x46607a['message']?_0x46607a['message']['id']:0x0,_0x46607a[_0x2f40('0x16')]?_0x46607a[_0x2f40('0x16')]['id']:0x0);if(_0x18faca[_0x2f40('0x14')][_0xcfa65d]){_0x18faca[_0x2f40('0x14')][_0xcfa65d][_0x2f40('0x35')]('end');if(rpc[_0x46607a[_0x2f40('0x3f')]+_0x2f40('0x40')]){rpc[_0x46607a[_0x2f40('0x3f')]+'QueueReport'][_0x2f40('0x41')](_0xcfa65d,{'UserId':_0x46607a[_0x2f40('0x15')]['UserId']})[_0x2f40('0x42')](function(_0x539403){logger['error'](_0x2f40('0x43'));});}}return _0x140b0c({'code':0xc8,'message':_0x46607a});}catch(_0x2b01dd){logger[_0x2f40('0x2f')](_0x2b01dd['stack']);return _0x40311a(_0x1cd0a0['error'](0x1f4,_0x2b01dd));}}logger[_0x2f40('0x2f')](_0x2f40('0x44'));return _0x40311a(_0x1cd0a0[_0x2f40('0x2f')](0x1f4,_0x2f40('0x44')));});},'RejectMessage':function(_0x2f94c8){var _0x24b313=this;return new Promise(function(_0x426403,_0x46a7a8){if(_0x2f94c8[_0x2f40('0x3b')]&&_0x2f94c8['agent']['id']){try{if(_0x18faca[_0x2f40('0x3c')][_0x2f94c8[_0x2f40('0x3b')]['id']]){_0x18faca[_0x2f40('0x3c')][_0x2f94c8[_0x2f40('0x3b')]['id']][_0x2f40('0x3d')]=![];_0x18faca[_0x2f40('0x3c')][_0x2f94c8[_0x2f40('0x3b')]['id']][_0x2f40('0x3e')]=undefined;}return _0x426403({'code':0xc8,'message':_0x2f94c8});}catch(_0x47921a){logger[_0x2f40('0x2f')](_0x47921a[_0x2f40('0x39')]);return _0x46a7a8(_0x24b313[_0x2f40('0x2f')](0x1f4,_0x47921a));}}logger[_0x2f40('0x2f')]('message\x20is\x20empty');return _0x46a7a8(_0x24b313['error'](0x1f4,_0x2f40('0x44')));});},'AbandonInteraction':function(_0x1ebdad){var _0x18359c=this;return new Promise(function(_0x2cddc4,_0x29c41b){if(_0x1ebdad['channel']&&_0x1ebdad['interaction']&&_0x1ebdad[_0x2f40('0x16')]['id']){try{var _0x239b46=getId(_0x1ebdad['channel'],_0x1ebdad[_0x2f40('0x15')]?_0x1ebdad[_0x2f40('0x15')]['id']:0x0,_0x1ebdad[_0x2f40('0x16')]?_0x1ebdad[_0x2f40('0x16')]['id']:0x0);if(_0x18faca[_0x2f40('0x14')][_0x239b46]){_0x18faca['rules'][_0x239b46][_0x2f40('0x35')](_0x2f40('0x45'));}return _0x2cddc4({'code':0xc8,'message':_0x1ebdad});}catch(_0x2b4951){logger['error'](_0x2b4951[_0x2f40('0x39')]);return _0x29c41b(_0x18359c[_0x2f40('0x2f')](0x1f4,_0x2b4951));}}logger[_0x2f40('0x2f')](_0x2f40('0x44'));return _0x29c41b(_0x18359c[_0x2f40('0x2f')](0x1f4,_0x2f40('0x44')));});},'AgentCapacity':function(_0x555c89){var _0x36864e=this;return new Promise(function(_0x9d25a7,_0x50cd4f){if(_0x18faca[_0x2f40('0x3c')][_0x2f40('0x46')](_0x555c89['id'])){for(var _0x4f8486 in _0x555c89[_0x2f40('0x47')]){if(_0x555c89[_0x2f40('0x47')][_0x2f40('0x46')](_0x4f8486)){if(_0x18faca[_0x2f40('0x3c')][_0x555c89['id']]['hasOwnProperty'](_0x4f8486+'CurrentCapacity')){_0x18faca[_0x2f40('0x3c')][_0x555c89['id']][_0x4f8486+_0x2f40('0x48')]=parseInt(_0x555c89[_0x2f40('0x47')][_0x4f8486],0xa);}}}_0x18faca[_0x2f40('0x3c')][_0x555c89['id']][_0x2f40('0x49')]();return _0x9d25a7({'code':0xc8,'message':_0x18faca[_0x2f40('0x3c')][_0x555c89['id']]});}else{return _0x50cd4f(_0x36864e[_0x2f40('0x2f')](0x1f4,_0x2f40('0x4a')));}});},'Agents':function(_0xf9f3e8){return new Promise(function(_0x5be7b7,_0x8a9009){var _0x3fefd0=_['values'](_0x18faca[_0x2f40('0x3c')]);_0x5be7b7({'count':_0x3fefd0[_0x2f40('0x19')],'rows':_0x3fefd0});});},'ChatQueues':function(_0x9e3cd3){return new Promise(function(_0x5a6843,_0x586f2a){var _0xda1f81=[];for(var _0x327957 in _0x18faca[_0x2f40('0x4b')]){if(_0x18faca[_0x2f40('0x4b')][_0x2f40('0x46')](_0x327957)){var _0x45334d=_0x18faca[_0x2f40('0x4b')][_0x327957];var _0x5e428d={'id':_0x45334d['id'],'available':_0x45334d[_0x2f40('0x4c')],'loggedIn':_0x45334d['loggedIn'],'name':_0x45334d[_0x2f40('0x4d')],'paused':_0x45334d[_0x2f40('0x4e')],'waiting':_0x45334d[_0x2f40('0x4f')]};_0xda1f81['push'](_0x5e428d);}}_0x5a6843({'count':_0xda1f81[_0x2f40('0x19')],'rows':_0xda1f81});});},'MailQueues':function(_0x8dd65d){return new Promise(function(_0x3b60da,_0x50f7c5){var _0x4127f0=[];for(var _0x6eae30 in _0x18faca[_0x2f40('0x50')]){if(_0x18faca[_0x2f40('0x50')][_0x2f40('0x46')](_0x6eae30)){var _0x6bedc=_0x18faca['mailQueues'][_0x6eae30];var _0xafe604={'id':_0x6bedc['id'],'available':_0x6bedc[_0x2f40('0x4c')],'loggedIn':_0x6bedc[_0x2f40('0x51')],'name':_0x6bedc[_0x2f40('0x4d')],'paused':_0x6bedc[_0x2f40('0x4e')],'waiting':_0x6bedc['waiting']};_0x4127f0[_0x2f40('0x1e')](_0xafe604);}}_0x3b60da({'count':_0x4127f0['length'],'rows':_0x4127f0});});},'OpenchannelQueues':function(_0x52f4c9){return new Promise(function(_0x1ad874,_0x163265){var _0x40f013=[];for(var _0x4d92fb in _0x18faca[_0x2f40('0x52')]){if(_0x18faca[_0x2f40('0x52')][_0x2f40('0x46')](_0x4d92fb)){var _0x5ad22f=_0x18faca[_0x2f40('0x52')][_0x4d92fb];var _0x2f1df4={'id':_0x5ad22f['id'],'available':_0x5ad22f[_0x2f40('0x4c')],'loggedIn':_0x5ad22f[_0x2f40('0x51')],'name':_0x5ad22f[_0x2f40('0x4d')],'paused':_0x5ad22f[_0x2f40('0x4e')],'waiting':_0x5ad22f[_0x2f40('0x4f')]};_0x40f013[_0x2f40('0x1e')](_0x2f1df4);}}_0x1ad874({'count':_0x40f013[_0x2f40('0x19')],'rows':_0x40f013});});},'SmsQueues':function(_0x38e55e){return new Promise(function(_0xc8aed4,_0x5b0115){var _0x3a918e=[];for(var _0x28d95f in _0x18faca[_0x2f40('0x53')]){if(_0x18faca['smsQueues'][_0x2f40('0x46')](_0x28d95f)){var _0x3d7231=_0x18faca[_0x2f40('0x53')][_0x28d95f];var _0x492212={'id':_0x3d7231['id'],'available':_0x3d7231[_0x2f40('0x4c')],'loggedIn':_0x3d7231[_0x2f40('0x51')],'name':_0x3d7231['name'],'paused':_0x3d7231[_0x2f40('0x4e')],'waiting':_0x3d7231[_0x2f40('0x4f')]};_0x3a918e[_0x2f40('0x1e')](_0x492212);}}_0xc8aed4({'count':_0x3a918e['length'],'rows':_0x3a918e});});},'FaxQueues':function(_0x14f7de){return new Promise(function(_0x262eed,_0x8d7d40){var _0x25aaa5=[];for(var _0xd61b8d in _0x18faca['faxQueues']){if(_0x18faca[_0x2f40('0x54')]['hasOwnProperty'](_0xd61b8d)){var _0x2e4074=_0x18faca[_0x2f40('0x54')][_0xd61b8d];var _0x2ded01={'id':_0x2e4074['id'],'available':_0x2e4074[_0x2f40('0x4c')],'loggedIn':_0x2e4074[_0x2f40('0x51')],'name':_0x2e4074[_0x2f40('0x4d')],'paused':_0x2e4074['paused'],'waiting':_0x2e4074[_0x2f40('0x4f')]};_0x25aaa5[_0x2f40('0x1e')](_0x2ded01);}}_0x262eed({'count':_0x25aaa5['length'],'rows':_0x25aaa5});});},'WhatsappQueues':function(_0x384d29){return new Promise(function(_0x592d1e,_0x3e5256){var _0x38bca0=[];for(var _0x4cb0fa in _0x18faca['whatsappQueues']){if(_0x18faca[_0x2f40('0x55')]['hasOwnProperty'](_0x4cb0fa)){var _0x30d7be=_0x18faca[_0x2f40('0x55')][_0x4cb0fa];var _0x495888={'id':_0x30d7be['id'],'available':_0x30d7be[_0x2f40('0x4c')],'loggedIn':_0x30d7be[_0x2f40('0x51')],'name':_0x30d7be[_0x2f40('0x4d')],'paused':_0x30d7be[_0x2f40('0x4e')],'waiting':_0x30d7be['waiting']};_0x38bca0[_0x2f40('0x1e')](_0x495888);}}_0x592d1e({'count':_0x38bca0[_0x2f40('0x19')],'rows':_0x38bca0});});},'ChatQueuesWaitingInteractions':function(_0x534b2e){return new Promise(function(_0x3f2257,_0x3a9cb2){var _0x35fc29=_[_0x2f40('0x56')](_0x18faca[_0x2f40('0x57')]);_0x3f2257({'count':_0x35fc29[_0x2f40('0x19')],'rows':_0x35fc29});});},'MailQueuesWaitingInteractions':function(_0x165d7d){return new Promise(function(_0x57bffc,_0x5ca907){var _0x5009bf=_[_0x2f40('0x56')](_0x18faca[_0x2f40('0x58')]);_0x57bffc({'count':_0x5009bf[_0x2f40('0x19')],'rows':_0x5009bf});});},'OpenchannelQueuesWaitingInteractions':function(_0x51566c){return new Promise(function(_0x33c138,_0x3f07a9){var _0x1f8a82=_[_0x2f40('0x56')](_0x18faca[_0x2f40('0x59')]);_0x33c138({'count':_0x1f8a82[_0x2f40('0x19')],'rows':_0x1f8a82});});},'SmsQueuesWaitingInteractions':function(_0x3f2ae7){return new Promise(function(_0x326564,_0x35c6f3){var _0x71c186=_[_0x2f40('0x56')](_0x18faca[_0x2f40('0x5a')]);_0x326564({'count':_0x71c186['length'],'rows':_0x71c186});});},'FaxQueuesWaitingInteractions':function(_0x33f8bf){return new Promise(function(_0x4ccc10,_0x39957e){var _0x1af7c7=_['values'](_0x18faca['faxQueuesWaitingInteractions']);_0x4ccc10({'count':_0x1af7c7[_0x2f40('0x19')],'rows':_0x1af7c7});});},'WhatsappQueuesWaitingInteractions':function(_0x53e6d6){return new Promise(function(_0x1d1bb8,_0x2df5b9){var _0x3c6010=_['values'](_0x18faca['whatsappQueuesWaitingInteractions']);_0x1d1bb8({'count':_0x3c6010[_0x2f40('0x19')],'rows':_0x3c6010});});}};var _0x26d139=jayson['server'](_0x1ba76d)[_0x2f40('0x5b')]();_0x26d139['on'](_0x2f40('0x2f'),function(_0x40def7){logger[_0x2f40('0x2f')](JSON[_0x2f40('0x33')](_0x40def7));return _0x597bb4(_0x40def7);});_0x26d139[_0x2f40('0x13')](0x232c,_0x2f40('0x5c'),function(){console[_0x2f40('0x5d')](_0x2f40('0x5e'),0x232c);return _0x3ed778(_0x2f40('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x8a82=['dialogflow','dialogflowv2','amazonlex','TagId','./interval','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','join','app','.js','appdata','split','mail','push','slice'];(function(_0x14c04a,_0x5a9f01){var _0x35e7e7=function(_0x46c3b7){while(--_0x46c3b7){_0x14c04a['push'](_0x14c04a['shift']());}};_0x35e7e7(++_0x5a9f01);}(_0x8a82,0x1ab));var _0x28a8=function(_0x3e631c,_0x5bfac7){_0x3e631c=_0x3e631c-0x0;var _0x19e11a=_0x8a82[_0x3e631c];return _0x19e11a;};'use strict';var _=require(_0x28a8('0x0'));var util=require(_0x28a8('0x1'));var path=require(_0x28a8('0x2'));var fs=require('fs');var jayson=require(_0x28a8('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x28a8('0x4'));var logger=require('../../../config/logger')(_0x28a8('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x28a8('0x6')),'chatQueueReport':require(_0x28a8('0x7')),'smsQueueReport':require(_0x28a8('0x8')),'faxQueueReport':require(_0x28a8('0x9')),'whatsappQueueReport':require(_0x28a8('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5cb420,_0xc5c1e1,_0x353c60){return util[_0x28a8('0xb')](_0x28a8('0xc'),_0x5cb420,_0xc5c1e1||0x0,_0x353c60||0x0);}function getIntervals(_0xd7af7c,_0x249619){var _0x336100=[];if(!_[_0x28a8('0xd')](_0x249619['IntervalId'])&&!_[_0x28a8('0xd')](_0xd7af7c[_0x249619[_0x28a8('0xe')]])&&!_[_0x28a8('0xd')](_0xd7af7c[_0x249619[_0x28a8('0xe')]][_0x28a8('0xf')])){_0x336100=_[_0x28a8('0x10')](_0xd7af7c[_0x249619['IntervalId']][_0x28a8('0xf')],_0x28a8('0x11'));}else if(!_[_0x28a8('0xd')](_0x249619['interval'])){_0x336100=[_0x249619['interval']];}return _0x336100;}exports['listen']=function(_0x2823df){_0x2823df[_0x28a8('0x12')]={};return new BPromise(function(_0x3d99d9,_0x3e18a1){var _0x1f05ec={'Start':function(_0x35de22){var _0x48b652=this;return new Promise(function(_0xc6107,_0x22b144){if(_0x35de22){try{var _0x5cd519=[];var _0x18eb0f=getId(_0x35de22[_0x28a8('0x13')],_0x35de22[_0x28a8('0x14')]?_0x35de22['message']['id']:0x0,_0x35de22[_0x28a8('0x15')]?_0x35de22['interaction']['id']:0x0);if(_0x35de22[_0x28a8('0x16')]&&_[_0x28a8('0x17')](_0x35de22[_0x28a8('0x16')])&&_0x35de22['applications'][_0x28a8('0x18')]){for(var _0x1dc0a0=0x0;_0x1dc0a0<_0x35de22[_0x28a8('0x16')]['length'];_0x1dc0a0+=0x1){var _0x5248c0=_0x35de22['applications'][_0x1dc0a0];if(fs['existsSync'](path[_0x28a8('0x19')](__dirname,_0x28a8('0x16'),_0x5248c0[_0x28a8('0x1a')]+_0x28a8('0x1b')))){var _0x2e0dc4=[];switch(_0x5248c0[_0x28a8('0x1a')]['toLowerCase']()){case'autoreply':var _0xa1d40c=_0x5248c0[_0x28a8('0x1c')][_0x28a8('0x1d')](',');if(_0x35de22['channel']===_0x28a8('0x1e')){_0x2e0dc4[_0x28a8('0x1f')](_0xa1d40c[0x0]);_0x2e0dc4['push'](_0xa1d40c[0x1]);_0x2e0dc4[_0x28a8('0x1f')](_0xa1d40c[_0x28a8('0x20')](0x2,_0xa1d40c['length'])[_0x28a8('0x19')](','));}else{_0x2e0dc4[_0x28a8('0x1f')](_0xa1d40c[0x0]);_0x2e0dc4[_0x28a8('0x1f')](_0xa1d40c['slice'](0x1,_0xa1d40c[_0x28a8('0x18')])[_0x28a8('0x19')](','));}break;case _0x28a8('0x21'):var _0x2f6b12=_0x5248c0['appdata'][_0x28a8('0x1d')](',');_0x2e0dc4['push'](_0x2f6b12[0x0]);_0x2e0dc4[_0x28a8('0x1f')](_0x2f6b12[0x1]);_0x2e0dc4[_0x28a8('0x1f')](_0x2f6b12[_0x28a8('0x20')](0x2,_0x2f6b12[_0x28a8('0x18')])[_0x28a8('0x19')](','));break;case _0x28a8('0x22'):var _0xa3d66c=_0x5248c0[_0x28a8('0x1c')][_0x28a8('0x1d')](',');_0x2e0dc4[_0x28a8('0x1f')](_0xa3d66c[0x0]);_0x2e0dc4[_0x28a8('0x1f')](_0xa3d66c[0x1]);_0x2e0dc4[_0x28a8('0x1f')](_0xa3d66c[0x2]);_0x2e0dc4['push'](_0xa3d66c[0x3]);_0x2e0dc4[_0x28a8('0x1f')](_0xa3d66c[_0x28a8('0x20')](0x4,_0xa3d66c[_0x28a8('0x18')])[_0x28a8('0x19')](','));break;case _0x28a8('0x23'):var _0x12fc86=_0x5248c0['appdata']['split'](',');_0x2e0dc4[_0x28a8('0x1f')](_0x12fc86[0x0]);_0x2e0dc4[_0x28a8('0x1f')](_0x12fc86[0x1]);_0x2e0dc4[_0x28a8('0x1f')](_0x12fc86[0x2]);_0x2e0dc4[_0x28a8('0x1f')](_0x12fc86[0x3]);_0x2e0dc4[_0x28a8('0x1f')](_0x12fc86[_0x28a8('0x20')](0x4,_0x12fc86[_0x28a8('0x18')])[_0x28a8('0x19')](','));break;case _0x28a8('0x14'):_0x2e0dc4[_0x28a8('0x1f')](_0x5248c0[_0x28a8('0x1c')]);break;case'tag':_0x2e0dc4['push'](_0x5248c0[_0x28a8('0x24')]);_0x2e0dc4[_0x28a8('0x1f')](_0x5248c0[_0x28a8('0x1c')]);break;default:_0x2e0dc4=_[_0x28a8('0xd')](_0x5248c0['appdata'])?[]:_0x5248c0[_0x28a8('0x1c')][_0x28a8('0x1d')](',');}var _0x19010f={'id':util[_0x28a8('0xb')]('%s:%s:%s',_0x18eb0f,_0x5248c0['id'],_0x5248c0[_0x28a8('0x1a')]),'condition':require(_0x28a8('0x25'))['condition'](_0x18eb0f,getIntervals(_0x2823df[_0x28a8('0x26')],_0x5248c0),_0x2823df),'consequence':require('./applications/'+_0x5248c0[_0x28a8('0x1a')])[_0x28a8('0x27')](_0x18eb0f,_0x2e0dc4,_0x2823df,_0x35de22),'p':_0x5248c0[_0x28a8('0x28')]||0x0};logger[_0x28a8('0x29')](_0x28a8('0x2a'),_0x19010f['id'],_0x28a8('0x2b'),getIntervals(_0x2823df['intervals'],_0x5248c0)[_0x28a8('0x19')](_0x28a8('0x2c')));_0x5cd519[_0x28a8('0x1f')](_0x19010f);}else{logger[_0x28a8('0x2d')](_0x28a8('0x2e'),path[_0x28a8('0x19')](__dirname,_0x28a8('0x16'),_0x5248c0['app']+_0x28a8('0x1b')));}}_0x2823df[_0x28a8('0x12')][_0x18eb0f]=new RuleEngine(_0x5cd519);_0x2823df['rules'][_0x18eb0f][_0x28a8('0x2f')](_0x35de22,function(_0xda573){logger[_0x28a8('0x29')]('Applications\x20executed',JSON[_0x28a8('0x30')](_0xda573[_0x28a8('0x31')]));if(_0x2823df[_0x28a8('0x12')][_0x18eb0f]){_0x2823df[_0x28a8('0x12')][_0x18eb0f][_0x28a8('0x32')](_0x28a8('0x33'));}});return _0xc6107({'code':0xc8,'message':_0x35de22});}else{logger['info']('No\x20applications\x20to\x20execute');return _0xc6107({'code':0xc8,'message':_0x35de22});}}catch(_0x3f106d){logger[_0x28a8('0x2d')](_0x3f106d[_0x28a8('0x34')]);return _0x22b144(_0x48b652[_0x28a8('0x2d')](0x1f4,_0x3f106d));}}return _0x22b144(_0x28a8('0x35'));});},'AcceptMessage':function(_0xf8f50d){var _0x4cb475=this;return new Promise(function(_0x52b9be,_0x59693c){if(_0xf8f50d[_0x28a8('0x36')]&&_0xf8f50d[_0x28a8('0x36')]['id']){if(_0x2823df[_0x28a8('0x37')][_0xf8f50d['agent']['id']]){_0x2823df[_0x28a8('0x37')][_0xf8f50d[_0x28a8('0x36')]['id']][_0x28a8('0x38')]=![];_0x2823df[_0x28a8('0x37')][_0xf8f50d[_0x28a8('0x36')]['id']][_0x28a8('0x39')]=undefined;}}if(_0xf8f50d[_0x28a8('0x14')]&&_0xf8f50d[_0x28a8('0x14')]['id']){try{var _0x4a89f5=getId(_0xf8f50d[_0x28a8('0x13')],_0xf8f50d[_0x28a8('0x14')]?_0xf8f50d[_0x28a8('0x14')]['id']:0x0,_0xf8f50d['interaction']?_0xf8f50d['interaction']['id']:0x0);if(_0x2823df[_0x28a8('0x12')][_0x4a89f5]){_0x2823df[_0x28a8('0x12')][_0x4a89f5][_0x28a8('0x32')](_0x28a8('0x3a'));if(rpc[_0xf8f50d[_0x28a8('0x13')]+_0x28a8('0x3b')]){rpc[_0xf8f50d[_0x28a8('0x13')]+_0x28a8('0x3b')][_0x28a8('0x3c')](_0x4a89f5,{'UserId':_0xf8f50d[_0x28a8('0x14')][_0x28a8('0x3d')]})[_0x28a8('0x3e')](function(_0x47b102){logger['error'](_0x28a8('0x3f'));});}}return _0x52b9be({'code':0xc8,'message':_0xf8f50d});}catch(_0x254048){logger[_0x28a8('0x2d')](_0x254048[_0x28a8('0x34')]);return _0x59693c(_0x4cb475['error'](0x1f4,_0x254048));}}logger[_0x28a8('0x2d')](_0x28a8('0x40'));return _0x59693c(_0x4cb475['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x1a94bd){var _0x3ad8da=this;return new Promise(function(_0x562e9c,_0x2e3642){if(_0x1a94bd[_0x28a8('0x36')]&&_0x1a94bd[_0x28a8('0x36')]['id']){try{if(_0x2823df[_0x28a8('0x37')][_0x1a94bd[_0x28a8('0x36')]['id']]){_0x2823df[_0x28a8('0x37')][_0x1a94bd['agent']['id']][_0x28a8('0x38')]=![];_0x2823df[_0x28a8('0x37')][_0x1a94bd[_0x28a8('0x36')]['id']]['busyQueue']=undefined;}return _0x562e9c({'code':0xc8,'message':_0x1a94bd});}catch(_0xd8d4be){logger['error'](_0xd8d4be[_0x28a8('0x34')]);return _0x2e3642(_0x3ad8da[_0x28a8('0x2d')](0x1f4,_0xd8d4be));}}logger['error'](_0x28a8('0x40'));return _0x2e3642(_0x3ad8da['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x30250e){var _0x4ce959=this;return new Promise(function(_0x2f53bd,_0x99af6e){if(_0x30250e['channel']&&_0x30250e[_0x28a8('0x15')]&&_0x30250e[_0x28a8('0x15')]['id']){try{var _0x33a6f7=getId(_0x30250e[_0x28a8('0x13')],_0x30250e['message']?_0x30250e[_0x28a8('0x14')]['id']:0x0,_0x30250e['interaction']?_0x30250e['interaction']['id']:0x0);if(_0x2823df[_0x28a8('0x12')][_0x33a6f7]){_0x2823df['rules'][_0x33a6f7][_0x28a8('0x32')](_0x28a8('0x3a'));}return _0x2f53bd({'code':0xc8,'message':_0x30250e});}catch(_0x30e62a){logger[_0x28a8('0x2d')](_0x30e62a['stack']);return _0x99af6e(_0x4ce959[_0x28a8('0x2d')](0x1f4,_0x30e62a));}}logger['error'](_0x28a8('0x40'));return _0x99af6e(_0x4ce959[_0x28a8('0x2d')](0x1f4,_0x28a8('0x40')));});},'AgentCapacity':function(_0x112e03){var _0x48f025=this;return new Promise(function(_0x35109f,_0xcb728d){if(_0x2823df[_0x28a8('0x37')][_0x28a8('0x41')](_0x112e03['id'])){for(var _0x3d27ad in _0x112e03[_0x28a8('0x42')]){if(_0x112e03[_0x28a8('0x42')][_0x28a8('0x41')](_0x3d27ad)){if(_0x2823df[_0x28a8('0x37')][_0x112e03['id']][_0x28a8('0x41')](_0x3d27ad+_0x28a8('0x43'))){_0x2823df['agents'][_0x112e03['id']][_0x3d27ad+_0x28a8('0x43')]=parseInt(_0x112e03[_0x28a8('0x42')][_0x3d27ad],0xa);}}}_0x2823df[_0x28a8('0x37')][_0x112e03['id']][_0x28a8('0x44')]();return _0x35109f({'code':0xc8,'message':_0x2823df['agents'][_0x112e03['id']]});}else{return _0xcb728d(_0x48f025['error'](0x1f4,_0x28a8('0x45')));}});},'Agents':function(_0x3ba43f){return new Promise(function(_0x5c10e8,_0x6d4202){var _0x2b2b9=_[_0x28a8('0x46')](_0x2823df['agents']);_0x5c10e8({'count':_0x2b2b9[_0x28a8('0x18')],'rows':_0x2b2b9});});},'ChatQueues':function(_0x5c32f0){return new Promise(function(_0x51c724,_0x529376){var _0x582d13=[];for(var _0x4250e5 in _0x2823df[_0x28a8('0x47')]){if(_0x2823df['chatQueues'][_0x28a8('0x41')](_0x4250e5)){var _0x248983=_0x2823df[_0x28a8('0x47')][_0x4250e5];var _0x9f763={'id':_0x248983['id'],'available':_0x248983[_0x28a8('0x48')],'loggedIn':_0x248983[_0x28a8('0x49')],'name':_0x248983['name'],'paused':_0x248983['paused'],'waiting':_0x248983[_0x28a8('0x4a')]};_0x582d13['push'](_0x9f763);}}_0x51c724({'count':_0x582d13[_0x28a8('0x18')],'rows':_0x582d13});});},'MailQueues':function(_0x65074b){return new Promise(function(_0x201a09,_0x105e8b){var _0x54ccfe=[];for(var _0x183f7b in _0x2823df[_0x28a8('0x4b')]){if(_0x2823df['mailQueues']['hasOwnProperty'](_0x183f7b)){var _0xf16027=_0x2823df['mailQueues'][_0x183f7b];var _0x46fe81={'id':_0xf16027['id'],'available':_0xf16027[_0x28a8('0x48')],'loggedIn':_0xf16027[_0x28a8('0x49')],'name':_0xf16027[_0x28a8('0x4c')],'paused':_0xf16027[_0x28a8('0x4d')],'waiting':_0xf16027[_0x28a8('0x4a')]};_0x54ccfe[_0x28a8('0x1f')](_0x46fe81);}}_0x201a09({'count':_0x54ccfe['length'],'rows':_0x54ccfe});});},'OpenchannelQueues':function(_0x1d81ab){return new Promise(function(_0x59ae10,_0x4d3a03){var _0x28e5d3=[];for(var _0x349a5c in _0x2823df[_0x28a8('0x4e')]){if(_0x2823df[_0x28a8('0x4e')][_0x28a8('0x41')](_0x349a5c)){var _0x543e00=_0x2823df[_0x28a8('0x4e')][_0x349a5c];var _0x518cd4={'id':_0x543e00['id'],'available':_0x543e00[_0x28a8('0x48')],'loggedIn':_0x543e00[_0x28a8('0x49')],'name':_0x543e00[_0x28a8('0x4c')],'paused':_0x543e00[_0x28a8('0x4d')],'waiting':_0x543e00['waiting']};_0x28e5d3[_0x28a8('0x1f')](_0x518cd4);}}_0x59ae10({'count':_0x28e5d3[_0x28a8('0x18')],'rows':_0x28e5d3});});},'SmsQueues':function(_0x2b17fd){return new Promise(function(_0xda7313,_0x364ace){var _0x229fad=[];for(var _0x21a28f in _0x2823df[_0x28a8('0x4f')]){if(_0x2823df[_0x28a8('0x4f')][_0x28a8('0x41')](_0x21a28f)){var _0xad3ef0=_0x2823df[_0x28a8('0x4f')][_0x21a28f];var _0xd569a={'id':_0xad3ef0['id'],'available':_0xad3ef0['available'],'loggedIn':_0xad3ef0['loggedIn'],'name':_0xad3ef0['name'],'paused':_0xad3ef0['paused'],'waiting':_0xad3ef0['waiting']};_0x229fad[_0x28a8('0x1f')](_0xd569a);}}_0xda7313({'count':_0x229fad[_0x28a8('0x18')],'rows':_0x229fad});});},'FaxQueues':function(_0x27e43d){return new Promise(function(_0x153783,_0x5cc0f7){var _0x51ed20=[];for(var _0xbba9f5 in _0x2823df[_0x28a8('0x50')]){if(_0x2823df['faxQueues'][_0x28a8('0x41')](_0xbba9f5)){var _0x37a15e=_0x2823df[_0x28a8('0x50')][_0xbba9f5];var _0x199e86={'id':_0x37a15e['id'],'available':_0x37a15e[_0x28a8('0x48')],'loggedIn':_0x37a15e[_0x28a8('0x49')],'name':_0x37a15e[_0x28a8('0x4c')],'paused':_0x37a15e[_0x28a8('0x4d')],'waiting':_0x37a15e['waiting']};_0x51ed20[_0x28a8('0x1f')](_0x199e86);}}_0x153783({'count':_0x51ed20[_0x28a8('0x18')],'rows':_0x51ed20});});},'WhatsappQueues':function(_0x1e0083){return new Promise(function(_0x5d8fae,_0x10f867){var _0x101e03=[];for(var _0x540d32 in _0x2823df[_0x28a8('0x51')]){if(_0x2823df['whatsappQueues'][_0x28a8('0x41')](_0x540d32)){var _0x1c74f5=_0x2823df['whatsappQueues'][_0x540d32];var _0x47be6f={'id':_0x1c74f5['id'],'available':_0x1c74f5[_0x28a8('0x48')],'loggedIn':_0x1c74f5[_0x28a8('0x49')],'name':_0x1c74f5[_0x28a8('0x4c')],'paused':_0x1c74f5['paused'],'waiting':_0x1c74f5['waiting']};_0x101e03['push'](_0x47be6f);}}_0x5d8fae({'count':_0x101e03[_0x28a8('0x18')],'rows':_0x101e03});});},'ChatQueuesWaitingInteractions':function(_0x3314d0){return new Promise(function(_0x1aee26,_0x4200a9){var _0x42d6f0=_[_0x28a8('0x46')](_0x2823df['chatQueuesWaitingInteractions']);_0x1aee26({'count':_0x42d6f0['length'],'rows':_0x42d6f0});});},'MailQueuesWaitingInteractions':function(_0x4c3296){return new Promise(function(_0xf9aa32,_0x30397a){var _0x1168ba=_[_0x28a8('0x46')](_0x2823df['mailQueuesWaitingInteractions']);_0xf9aa32({'count':_0x1168ba[_0x28a8('0x18')],'rows':_0x1168ba});});},'OpenchannelQueuesWaitingInteractions':function(_0xc8556e){return new Promise(function(_0x5ebe70,_0x5e155d){var _0x5e72a4=_[_0x28a8('0x46')](_0x2823df[_0x28a8('0x52')]);_0x5ebe70({'count':_0x5e72a4[_0x28a8('0x18')],'rows':_0x5e72a4});});},'SmsQueuesWaitingInteractions':function(_0x3fe8c0){return new Promise(function(_0x4a2669,_0x1ab0d7){var _0xa5f157=_[_0x28a8('0x46')](_0x2823df['smsQueuesWaitingInteractions']);_0x4a2669({'count':_0xa5f157['length'],'rows':_0xa5f157});});},'FaxQueuesWaitingInteractions':function(_0x4da82f){return new Promise(function(_0x38f5e9,_0x2fd6d5){var _0xce7d11=_['values'](_0x2823df[_0x28a8('0x53')]);_0x38f5e9({'count':_0xce7d11[_0x28a8('0x18')],'rows':_0xce7d11});});},'WhatsappQueuesWaitingInteractions':function(_0x3dd7d5){return new Promise(function(_0xcdf880,_0xb3ff6d){var _0x15cff9=_[_0x28a8('0x46')](_0x2823df[_0x28a8('0x54')]);_0xcdf880({'count':_0x15cff9[_0x28a8('0x18')],'rows':_0x15cff9});});}};var _0xfebd7e=jayson[_0x28a8('0x55')](_0x1f05ec)[_0x28a8('0x56')]();_0xfebd7e['on']('error',function(_0x4f0b4b){logger[_0x28a8('0x2d')](JSON[_0x28a8('0x30')](_0x4f0b4b));return _0x3e18a1(_0x4f0b4b);});_0xfebd7e[_0x28a8('0x57')](0x232c,_0x28a8('0x58'),function(){console[_0x28a8('0x59')](_0x28a8('0x5a'),0x232c);return _0x3d99d9(_0x28a8('0x5b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index fce72c6..9e2c83d 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 _0x2385=['some','\x20|\x20','[%s][INTERVAL]\x20%s\x20%s','join','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all'];(function(_0x4214e8,_0xd0927c){var _0x43867d=function(_0x1d89d5){while(--_0x1d89d5){_0x4214e8['push'](_0x4214e8['shift']());}};_0x43867d(++_0xd0927c);}(_0x2385,0x81));var _0x5238=function(_0x588d07,_0x3f4578){_0x588d07=_0x588d07-0x0;var _0x285ef7=_0x2385[_0x588d07];return _0x285ef7;};'use strict';var util=require(_0x5238('0x0'));var BPromise=require('bluebird');var jayson=require(_0x5238('0x1'));var _=require(_0x5238('0x2'));var logger=require(_0x5238('0x3'))(_0x5238('0x4'));var client=jayson[_0x5238('0x5')][_0x5238('0x6')]({'port':0x232a});function request(_0x54caac,_0x4f3a14){return new BPromise(function(_0x41c071,_0x45504a){return client[_0x5238('0x7')](_0x54caac,_0x4f3a14)[_0x5238('0x8')](function(_0x4937b6){if(_0x4937b6[_0x5238('0x9')]){return _0x45504a(_0x4937b6[_0x5238('0x9')][_0x5238('0xa')]);}else{return _0x41c071(_0x4937b6[_0x5238('0xb')]);}})[_0x5238('0xc')](function(_0xf8b00a){return _0x45504a(_0xf8b00a);});});}exports[_0x5238('0xd')]=function(_0x6445df,_0x3e0de8,_0x153cff){return function(_0x327ba1){if(_0x153cff['rules']&&!_0x153cff[_0x5238('0xe')][_0x6445df]){logger[_0x5238('0xf')](_0x5238('0x10'),_0x6445df);return _0x327ba1[_0x5238('0x11')]();}var _0x355513=[];for(var _0xf1da97=0x0;_0xf1da97<_0x3e0de8[_0x5238('0x12')];_0xf1da97+=0x1){_0x355513[_0x5238('0x13')](request(_0x5238('0x14'),{'command':util[_0x5238('0x15')]('iftime\x20%s',_0x3e0de8[_0xf1da97])})[_0x5238('0x8')](function(_0x42dd70){return _0x42dd70&&_0x42dd70[_0x5238('0xa')]&&_0x42dd70[_0x5238('0xa')][_0x5238('0x16')](_0x5238('0x17'))>=0x0?!![]:![];})['catch'](function(_0x41a3f8){logger[_0x5238('0x9')](_0x5238('0x18'),_0x6445df,_0x3e0de8[_0xf1da97]);}));}BPromise[_0x5238('0x19')](_0x355513)[_0x5238('0x8')](function(_0x1801f9){var _0x469f13=_[_0x5238('0x1a')](_0x1801f9);logger[_0x5238('0xf')]('[%s][INTERVAL]\x20%s\x20%s',_0x6445df,_0x3e0de8['join'](_0x5238('0x1b')),_0x469f13);_0x327ba1['when'](_0x469f13);})[_0x5238('0xc')](function(_0x3f7ec4){console['log'](_0x3f7ec4);logger[_0x5238('0x9')](_0x5238('0x1c'),_0x6445df,_0x3e0de8[_0x5238('0x1d')](_0x5238('0x1b')),_0x3f7ec4[_0x5238('0x1e')]);_0x327ba1[_0x5238('0x11')]();});};}; \ No newline at end of file +var _0xbf8e=['\x20|\x20','when','log','stack','jayson/promise','../../../config/logger','client','http','request','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x2ce709,_0x41ab1e){var _0x908e80=function(_0x1a6675){while(--_0x1a6675){_0x2ce709['push'](_0x2ce709['shift']());}};_0x908e80(++_0x41ab1e);}(_0xbf8e,0xdc));var _0xebf8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbf8e[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xebf8('0x0'));var _=require('lodash');var logger=require(_0xebf8('0x1'))('routing');var client=jayson[_0xebf8('0x2')][_0xebf8('0x3')]({'port':0x232a});function request(_0x4b278a,_0xf00199){return new BPromise(function(_0x2452e3,_0x46eb32){return client[_0xebf8('0x4')](_0x4b278a,_0xf00199)[_0xebf8('0x5')](function(_0x541638){if(_0x541638[_0xebf8('0x6')]){return _0x46eb32(_0x541638[_0xebf8('0x6')][_0xebf8('0x7')]);}else{return _0x2452e3(_0x541638['result']);}})[_0xebf8('0x8')](function(_0x4ac933){return _0x46eb32(_0x4ac933);});});}exports['condition']=function(_0x516813,_0x98c6ce,_0x1df9cf){return function(_0x1b0a55){if(_0x1df9cf['rules']&&!_0x1df9cf[_0xebf8('0x9')][_0x516813]){logger[_0xebf8('0xa')](_0xebf8('0xb'),_0x516813);return _0x1b0a55[_0xebf8('0xc')]();}var _0x1bf54a=[];for(var _0x29e5ac=0x0;_0x29e5ac<_0x98c6ce['length'];_0x29e5ac+=0x1){_0x1bf54a[_0xebf8('0xd')](request(_0xebf8('0xe'),{'command':util['format'](_0xebf8('0xf'),_0x98c6ce[_0x29e5ac])})[_0xebf8('0x5')](function(_0x1c25f1){return _0x1c25f1&&_0x1c25f1[_0xebf8('0x7')]&&_0x1c25f1['message'][_0xebf8('0x10')](_0xebf8('0x11'))>=0x0?!![]:![];})[_0xebf8('0x8')](function(_0x1f8840){logger[_0xebf8('0x6')](_0xebf8('0x12'),_0x516813,_0x98c6ce[_0x29e5ac]);}));}BPromise[_0xebf8('0x13')](_0x1bf54a)['then'](function(_0x20f5a5){var _0x51b6c0=_[_0xebf8('0x14')](_0x20f5a5);logger[_0xebf8('0xa')](_0xebf8('0x15'),_0x516813,_0x98c6ce[_0xebf8('0x16')](_0xebf8('0x17')),_0x51b6c0);_0x1b0a55[_0xebf8('0x18')](_0x51b6c0);})[_0xebf8('0x8')](function(_0x348c0c){console[_0xebf8('0x19')](_0x348c0c);logger['error'](_0xebf8('0x15'),_0x516813,_0x98c6ce[_0xebf8('0x16')](_0xebf8('0x17')),_0x348c0c[_0xebf8('0x1a')]);_0x1b0a55[_0xebf8('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0c8912f..30ac03e 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 _0x2bc6=['lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','error','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum'];(function(_0x246b5d,_0x2bc07e){var _0x5b8946=function(_0x4a8651){while(--_0x4a8651){_0x246b5d['push'](_0x246b5d['shift']());}};_0x5b8946(++_0x2bc07e);}(_0x2bc6,0x163));var _0x62bc=function(_0x4c769b,_0x3aeb6a){_0x4c769b=_0x4c769b-0x0;var _0x62178d=_0x2bc6[_0x4c769b];return _0x62178d;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var utils=require(_0x62bc('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x56939b,_0x4b4e73){utils['info'](util['format'](_0x62bc('0x3'),_0x56939b['uniqueid'],_0x56939b[_0x62bc('0x4')],_0x56939b[_0x62bc('0x5')],_0x56939b['membername'],_0x56939b[_0x62bc('0x6')],_0x56939b[_0x62bc('0x7')],_0x56939b[_0x62bc('0x8')],_0x56939b[_0x62bc('0x9')]));if(_0x56939b[_0x62bc('0x5')]){utils[_0x62bc('0xa')](_0x56939b['queue'])[_0x62bc('0xb')](function(_0x762c71){if(_0x762c71){_0x56939b[_0x62bc('0xc')]=_0x762c71[_0x62bc('0xc')];_0x56939b['agentacw']=_0x56939b[_0x62bc('0xd')]?_0x762c71[_0x62bc('0xe')]:![];_0x56939b[_0x62bc('0xf')]=_0x56939b['agentacw']?_0x762c71[_0x62bc('0x10')]:0x0;}utils[_0x62bc('0x11')](_0x62bc('0x12'),_0x56939b);});}else{utils[_0x62bc('0x11')](_0x62bc('0x12'),_0x56939b);}if(_0x4b4e73){delete transfers[_0x56939b[_0x62bc('0x13')]];}else{delete agents[_0x56939b[_0x62bc('0x14')]];}}exports['agentcalled']=function(_0x2a96ae){try{utils[_0x62bc('0x15')](util['format'](_0x62bc('0x16'),_0x2a96ae[_0x62bc('0x13')]),_0x2a96ae);agents[_0x2a96ae[_0x62bc('0x14')]]=_0x2a96ae;agents[_0x2a96ae['destuniqueid']][_0x62bc('0x17')]=utils[_0x62bc('0x18')]();agents[_0x2a96ae['destuniqueid']]['lastevent']=_0x62bc('0x19');agents[_0x2a96ae[_0x62bc('0x14')]]['connectedlinenum']=null;agents[_0x2a96ae[_0x62bc('0x14')]][_0x62bc('0x1a')]=null;utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')](_0x62bc('0x1d'),_0x2a96ae[_0x62bc('0x13')],agents[_0x2a96ae[_0x62bc('0x14')]][_0x62bc('0x1e')],_0x2a96ae[_0x62bc('0x14')]));}catch(_0x5ed51c){utils['error'](util[_0x62bc('0x1c')](_0x62bc('0x16'),_0x2a96ae[_0x62bc('0x13')]),_0x5ed51c);}};exports['agentringnoanswer']=function(_0x380621){try{if(!_['isNil'](agents[_0x380621[_0x62bc('0x14')]])){utils[_0x62bc('0x15')](util[_0x62bc('0x1c')]('[%s][agents][agentringnoanswer]',_0x380621[_0x62bc('0x13')]),_0x380621);utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')](_0x62bc('0x1f'),_0x380621[_0x62bc('0x13')],agents[_0x380621[_0x62bc('0x14')]]['membername'],_0x380621[_0x62bc('0x14')]));agents[_0x380621[_0x62bc('0x14')]][_0x62bc('0x20')]=!![];agents[_0x380621[_0x62bc('0x14')]][_0x62bc('0x21')]=utils['now']();agents[_0x380621['destuniqueid']][_0x62bc('0x9')]='timeout';agents[_0x380621[_0x62bc('0x14')]][_0x62bc('0x22')]=_0x62bc('0x23');agents[_0x380621['destuniqueid']][_0x62bc('0x24')]=_0x380621[_0x62bc('0x25')]?parseInt(_0x380621[_0x62bc('0x25')])/0x3e8:0x0;agents[_0x380621['destuniqueid']]['talktime']=0x0;unanswered[_0x62bc('0x26')](_0x380621[_0x62bc('0x14')]);}}catch(_0x23817c){utils['error'](util[_0x62bc('0x1c')](_0x62bc('0x27'),_0x380621[_0x62bc('0x13')]),_0x23817c);}};exports[_0x62bc('0x28')]=function(_0x5a9302){try{_[_0x62bc('0x29')](agents,function(_0x5e4491,_0x26701b){if(_0x5e4491[_0x62bc('0x13')]==_0x5a9302[_0x62bc('0x13')]&&!_[_0x62bc('0x2a')](unanswered,_0x5e4491[_0x62bc('0x14')])){utils[_0x62bc('0x15')](util[_0x62bc('0x1c')](_0x62bc('0x2b'),_0x5a9302[_0x62bc('0x13')]),_0x5a9302);utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')](_0x62bc('0x2c'),_0x5a9302[_0x62bc('0x13')],_0x5e4491[_0x62bc('0x1e')],_0x5e4491[_0x62bc('0x14')]));_0x5e4491[_0x62bc('0x20')]=!![];_0x5e4491[_0x62bc('0x21')]=utils['now']();_0x5e4491[_0x62bc('0x9')]='abandoned';_0x5e4491['reason']=_0x62bc('0x2d');_0x5e4491['holdtime']=_0x5a9302['holdtime'];_0x5e4491['talktime']=0x0;writeDB(_0x5e4491);}});}catch(_0x3f22c1){utils[_0x62bc('0x2e')](util[_0x62bc('0x1c')]('[%s][agents][queuecallerabandon]',_0x5a9302['uniqueid']),_0x3f22c1);}};exports['agentconnect']=function(_0x3c938d){try{if(agents[_0x3c938d[_0x62bc('0x14')]]){utils['debug'](util['format'](_0x62bc('0x2f'),_0x3c938d[_0x62bc('0x13')]),_0x3c938d);utils[_0x62bc('0x1b')](util['format'](_0x62bc('0x30'),_0x3c938d[_0x62bc('0x13')],agents[_0x3c938d[_0x62bc('0x14')]][_0x62bc('0x1e')],_0x3c938d['destuniqueid']));agents[_0x3c938d[_0x62bc('0x14')]][_0x62bc('0x31')]=utils['now']();agents[_0x3c938d[_0x62bc('0x14')]][_0x62bc('0x8')]=_0x3c938d[_0x62bc('0x8')];agents[_0x3c938d[_0x62bc('0x14')]]['connectedlinename']=_0x3c938d[_0x62bc('0x1a')];agents[_0x3c938d['destuniqueid']][_0x62bc('0x24')]=_0x3c938d[_0x62bc('0x25')];agents[_0x3c938d[_0x62bc('0x14')]][_0x62bc('0x9')]='connect';_[_0x62bc('0x29')](agents,function(_0x5c806b,_0x392550){if(_0x5c806b[_0x62bc('0x14')]!=_0x3c938d[_0x62bc('0x14')]&&_0x5c806b[_0x62bc('0x13')]==_0x3c938d[_0x62bc('0x13')]){_0x5c806b[_0x62bc('0x32')]=0x0;_0x5c806b[_0x62bc('0x24')]=_0x3c938d[_0x62bc('0x25')];_0x5c806b[_0x62bc('0x20')]=!![];_0x5c806b['agentringnoanswerAt']=utils['now']();_0x5c806b[_0x62bc('0x9')]=_0x62bc('0x33');_0x5c806b['reason']=_0x62bc('0x33');_0x5c806b[_0x62bc('0x34')]=_0x3c938d[_0x62bc('0x14')];_0x5c806b[_0x62bc('0x35')]=_0x3c938d[_0x62bc('0x1e')];writeDB(_0x5c806b);}});}}catch(_0x5f3752){utils[_0x62bc('0x2e')](util[_0x62bc('0x1c')]('[%s][agents][agentconnect]',_0x3c938d['uniqueid']),_0x5f3752);}};exports[_0x62bc('0xd')]=function(_0xdbd9ee){try{if(!_[_0x62bc('0x36')](agents[_0xdbd9ee['destuniqueid']])){utils[_0x62bc('0x15')](util[_0x62bc('0x1c')](_0x62bc('0x37'),_0xdbd9ee[_0x62bc('0x13')]),_0xdbd9ee);utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xdbd9ee[_0x62bc('0x13')],agents[_0xdbd9ee['destuniqueid']][_0x62bc('0x1e')],_0xdbd9ee[_0x62bc('0x14')]));agents[_0xdbd9ee[_0x62bc('0x14')]]['agentcomplete']=!![];agents[_0xdbd9ee['destuniqueid']]['agentcompleteAt']=utils[_0x62bc('0x18')]();agents[_0xdbd9ee['destuniqueid']][_0x62bc('0x32')]=utils[_0x62bc('0x38')](agents[_0xdbd9ee['destuniqueid']]['agentcompleteAt'],agents[_0xdbd9ee['destuniqueid']][_0x62bc('0x31')]);agents[_0xdbd9ee[_0x62bc('0x14')]][_0x62bc('0x22')]=_0xdbd9ee[_0x62bc('0x22')];agents[_0xdbd9ee[_0x62bc('0x14')]]['lastevent']=_0x62bc('0x39');writeDB(agents[_0xdbd9ee[_0x62bc('0x14')]]);}}catch(_0x4859fc){utils[_0x62bc('0x2e')](util['format'](_0x62bc('0x37'),_0xdbd9ee[_0x62bc('0x13')]),_0x4859fc);}};exports[_0x62bc('0x3a')]=function(_0xca6190){try{if(!_[_0x62bc('0x36')](agents[_0xca6190[_0x62bc('0x3b')]])){utils[_0x62bc('0x15')](util['format'](_0x62bc('0x3c'),_0xca6190[_0x62bc('0x13')]),_0xca6190);utils['info'](util[_0x62bc('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0xca6190[_0x62bc('0x13')],agents[_0xca6190[_0x62bc('0x3b')]]['membername'],agents[_0xca6190[_0x62bc('0x3b')]][_0x62bc('0x13')]));agents[_0xca6190[_0x62bc('0x3b')]]['transfer']=!![];agents[_0xca6190[_0x62bc('0x3b')]][_0x62bc('0x3d')]=_0x62bc('0x3e');agents[_0xca6190[_0x62bc('0x3b')]][_0x62bc('0x3f')]=_0xca6190[_0x62bc('0x40')];agents[_0xca6190[_0x62bc('0x3b')]][_0x62bc('0x41')]=agents[_0xca6190[_0x62bc('0x3b')]][_0x62bc('0x13')];}}catch(_0x44d2a2){utils[_0x62bc('0x2e')](util[_0x62bc('0x1c')](_0x62bc('0x3c'),_0xca6190[_0x62bc('0x13')]),_0x44d2a2);}};exports[_0x62bc('0x42')]=function(_0x5b0e9b){try{utils[_0x62bc('0x15')](util[_0x62bc('0x1c')](_0x62bc('0x43'),_0x5b0e9b[_0x62bc('0x44')]),_0x5b0e9b);if(_0x5b0e9b[_0x62bc('0x44')]==_0x5b0e9b[_0x62bc('0x45')]){if(!_[_0x62bc('0x36')](agents[_0x5b0e9b[_0x62bc('0x46')]])){utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')](_0x62bc('0x47'),_0x5b0e9b[_0x62bc('0x44')],agents[_0x5b0e9b['secondtransfereruniqueid']][_0x62bc('0x1e')]));agents[_0x5b0e9b['secondtransfereruniqueid']][_0x62bc('0x48')]=!![];agents[_0x5b0e9b[_0x62bc('0x46')]][_0x62bc('0x3d')]=_0x62bc('0x49');agents[_0x5b0e9b[_0x62bc('0x46')]][_0x62bc('0x3f')]=_0x5b0e9b[_0x62bc('0x4a')];agents[_0x5b0e9b[_0x62bc('0x46')]]['transferuniqueid']=_0x5b0e9b['origtransfereruniqueid'];}if(_0x5b0e9b[_0x62bc('0x4b')]&&agents[_0x5b0e9b[_0x62bc('0x4b')]]){agents[_0x5b0e9b[_0x62bc('0x4b')]]['agententerreason']=0x1;transfers[_0x5b0e9b[_0x62bc('0x4b')]]=_[_0x62bc('0x4c')](agents[_0x5b0e9b[_0x62bc('0x4b')]]);transfers[_0x5b0e9b[_0x62bc('0x4b')]]['calleridnum']=agents[_0x5b0e9b[_0x62bc('0x46')]][_0x62bc('0x7')];transfers[_0x5b0e9b[_0x62bc('0x4b')]][_0x62bc('0x4d')]=agents[_0x5b0e9b[_0x62bc('0x46')]][_0x62bc('0x4d')];transfers[_0x5b0e9b[_0x62bc('0x4b')]]['agentcalledAt']=utils[_0x62bc('0x18')]();transfers[_0x5b0e9b[_0x62bc('0x4b')]][_0x62bc('0x31')]=utils['now']();transfers[_0x5b0e9b['transfereeuniqueid']][_0x62bc('0x24')]=0x0;transfers[_0x5b0e9b[_0x62bc('0x4b')]][_0x62bc('0x4e')]=0x2;}}else if(_0x5b0e9b['secondtransfereruniqueid']==_0x5b0e9b[_0x62bc('0x4f')]){if(!_['isNil'](agents[_0x5b0e9b[_0x62bc('0x44')]])){utils[_0x62bc('0x1b')](util['format'](_0x62bc('0x47'),_0x5b0e9b['origtransfereruniqueid'],agents[_0x5b0e9b[_0x62bc('0x44')]]['membername']));agents[_0x5b0e9b[_0x62bc('0x44')]][_0x62bc('0x48')]=!![];agents[_0x5b0e9b[_0x62bc('0x44')]][_0x62bc('0x3d')]=_0x62bc('0x49');agents[_0x5b0e9b[_0x62bc('0x44')]]['transferexten']=_0x5b0e9b[_0x62bc('0x50')];agents[_0x5b0e9b[_0x62bc('0x44')]][_0x62bc('0x41')]=_0x5b0e9b['secondtransfereruniqueid'];}if(_0x5b0e9b[_0x62bc('0x51')]&&agents[_0x5b0e9b[_0x62bc('0x51')]]){agents[_0x5b0e9b[_0x62bc('0x51')]][_0x62bc('0x4e')]=0x1;transfers[_0x5b0e9b['transfertargetuniqueid']]=_[_0x62bc('0x4c')](agents[_0x5b0e9b[_0x62bc('0x51')]]);transfers[_0x5b0e9b[_0x62bc('0x51')]][_0x62bc('0x7')]=agents[_0x5b0e9b[_0x62bc('0x44')]]['calleridnum'];transfers[_0x5b0e9b['transfertargetuniqueid']][_0x62bc('0x4d')]=agents[_0x5b0e9b['origtransfereruniqueid']][_0x62bc('0x4d')];transfers[_0x5b0e9b[_0x62bc('0x51')]]['agentcalledAt']=utils[_0x62bc('0x18')]();transfers[_0x5b0e9b['transfertargetuniqueid']][_0x62bc('0x31')]=utils['now']();transfers[_0x5b0e9b[_0x62bc('0x51')]]['holdtime']=0x0;transfers[_0x5b0e9b[_0x62bc('0x51')]][_0x62bc('0x4e')]=0x2;}}}catch(_0x6bb64b){utils['error'](util[_0x62bc('0x1c')](_0x62bc('0x43'),_0x5b0e9b[_0x62bc('0x44')]),_0x6bb64b);}};exports[_0x62bc('0x52')]=function(_0x177fba){try{utils['debug'](util[_0x62bc('0x1c')](_0x62bc('0x53'),_0x177fba[_0x62bc('0x13')]),_0x177fba);if(agents[_0x177fba[_0x62bc('0x13')]]&&agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x22')]===_0x62bc('0x23')){if(_0x177fba[_0x62bc('0x54')]==='21'){agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x22')]=_0x62bc('0x55');agents[_0x177fba['uniqueid']][_0x62bc('0x9')]=_0x62bc('0x55');}utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x177fba[_0x62bc('0x13')],agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x1e')],agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x22')],agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x9')]));writeDB(agents[_0x177fba[_0x62bc('0x13')]]);var _0x5698a4=unanswered[_0x62bc('0x56')](_0x177fba[_0x62bc('0x13')]);if(_0x5698a4>-0x1){unanswered[_0x62bc('0x57')](_0x5698a4,0x1);}}if(transfers[_0x177fba[_0x62bc('0x13')]]){transfers[_0x177fba[_0x62bc('0x13')]][_0x62bc('0xd')]=!![];transfers[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x58')]=utils[_0x62bc('0x18')]();transfers[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x32')]=utils[_0x62bc('0x38')](transfers[_0x177fba['uniqueid']][_0x62bc('0x58')],transfers[_0x177fba[_0x62bc('0x13')]]['agentconnectAt']);transfers[_0x177fba[_0x62bc('0x13')]]['reason']=_0x62bc('0x59');transfers[_0x177fba[_0x62bc('0x13')]]['lastevent']=_0x62bc('0x39');utils['info'](util[_0x62bc('0x1c')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x177fba[_0x62bc('0x13')],transfers[_0x177fba['uniqueid']][_0x62bc('0x1e')],transfers[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x22')],transfers[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x9')]));writeDB(transfers[_0x177fba[_0x62bc('0x13')]],!![]);}if(agents[_0x177fba['uniqueid']]&&agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x31')]){agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0xd')]=!![];agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x58')]=utils[_0x62bc('0x18')]();agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x32')]=utils[_0x62bc('0x38')](agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x58')],agents[_0x177fba[_0x62bc('0x13')]]['agentconnectAt']);agents[_0x177fba['uniqueid']]['reason']=agents[_0x177fba[_0x62bc('0x13')]]['transfer']?_0x62bc('0x48'):_0x62bc('0x59');agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x9')]=_0x62bc('0x39');utils[_0x62bc('0x1b')](util[_0x62bc('0x1c')](_0x62bc('0x5a'),_0x177fba['uniqueid'],agents[_0x177fba[_0x62bc('0x13')]][_0x62bc('0x1e')],agents[_0x177fba[_0x62bc('0x13')]]['reason'],agents[_0x177fba[_0x62bc('0x13')]]['lastevent']));writeDB(agents[_0x177fba[_0x62bc('0x13')]]);}}catch(_0x3aa295){utils['error'](util[_0x62bc('0x1c')](_0x62bc('0x53'),_0x177fba['uniqueid']),_0x3aa295);}}; \ No newline at end of file +var _0xbf6e=['[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','destuniqueid','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','[%s][agents][hangup]','./utils','info','format'];(function(_0x502be0,_0x2f0ff0){var _0x1b02d7=function(_0x28fa3b){while(--_0x28fa3b){_0x502be0['push'](_0x502be0['shift']());}};_0x1b02d7(++_0x2f0ff0);}(_0xbf6e,0x149));var _0xebf6=function(_0x11a434,_0x32f384){_0x11a434=_0x11a434-0x0;var _0x51750c=_0xbf6e[_0x11a434];return _0x51750c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xebf6('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2b658d,_0x14bf01){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x3'),_0x2b658d[_0xebf6('0x4')],_0x2b658d['channel'],_0x2b658d[_0xebf6('0x5')],_0x2b658d[_0xebf6('0x6')],_0x2b658d[_0xebf6('0x7')],_0x2b658d[_0xebf6('0x8')],_0x2b658d[_0xebf6('0x9')],_0x2b658d[_0xebf6('0xa')]));if(_0x2b658d[_0xebf6('0x5')]){utils['getVoiceQueueByName'](_0x2b658d[_0xebf6('0x5')])[_0xebf6('0xb')](function(_0x12ed12){if(_0x12ed12){_0x2b658d['type']=_0x12ed12[_0xebf6('0xc')];_0x2b658d[_0xebf6('0xd')]=_0x2b658d['agentcomplete']?_0x12ed12[_0xebf6('0xe')]:![];_0x2b658d[_0xebf6('0xf')]=_0x2b658d[_0xebf6('0xd')]?_0x12ed12[_0xebf6('0x10')]:0x0;}utils[_0xebf6('0x11')](_0xebf6('0x12'),_0x2b658d);});}else{utils['request'](_0xebf6('0x12'),_0x2b658d);}if(_0x14bf01){delete transfers[_0x2b658d[_0xebf6('0x4')]];}else{delete agents[_0x2b658d['destuniqueid']];}}exports[_0xebf6('0x13')]=function(_0x101a6c){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c['uniqueid']),_0x101a6c);agents[_0x101a6c['destuniqueid']]=_0x101a6c;agents[_0x101a6c['destuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();agents[_0x101a6c['destuniqueid']][_0xebf6('0xa')]=_0xebf6('0x18');agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x9')]=null;agents[_0x101a6c[_0xebf6('0x19')]][_0xebf6('0x1a')]=null;utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1b'),_0x101a6c[_0xebf6('0x4')],agents[_0x101a6c['destuniqueid']]['membername'],_0x101a6c[_0xebf6('0x19')]));}catch(_0x38c9e3){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x15'),_0x101a6c[_0xebf6('0x4')]),_0x38c9e3);}};exports[_0xebf6('0x1d')]=function(_0x80f523){try{if(!_['isNil'](agents[_0x80f523[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523[_0xebf6('0x4')]),_0x80f523);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x1f'),_0x80f523[_0xebf6('0x4')],agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x6')],_0x80f523[_0xebf6('0x19')]));agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x1d')]=!![];agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x20')]=utils[_0xebf6('0x17')]();agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0xa')]='timeout';agents[_0x80f523['destuniqueid']][_0xebf6('0x21')]='timeout';agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x80f523['ringtime']?parseInt(_0x80f523['ringtime'])/0x3e8:0x0;agents[_0x80f523[_0xebf6('0x19')]][_0xebf6('0x23')]=0x0;unanswered[_0xebf6('0x24')](_0x80f523[_0xebf6('0x19')]);}}catch(_0xedaaeb){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x1e'),_0x80f523['uniqueid']),_0xedaaeb);}};exports[_0xebf6('0x25')]=function(_0x78cdf0){try{_['forIn'](agents,function(_0x2fe3ee,_0x28bbea){if(_0x2fe3ee['uniqueid']==_0x78cdf0[_0xebf6('0x4')]&&!_[_0xebf6('0x26')](unanswered,_0x2fe3ee[_0xebf6('0x19')])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x27'),_0x78cdf0['uniqueid']),_0x78cdf0);utils[_0xebf6('0x1')](util[_0xebf6('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x78cdf0['uniqueid'],_0x2fe3ee[_0xebf6('0x6')],_0x2fe3ee[_0xebf6('0x19')]));_0x2fe3ee['agentringnoanswer']=!![];_0x2fe3ee[_0xebf6('0x20')]=utils[_0xebf6('0x17')]();_0x2fe3ee['lastevent']=_0xebf6('0x28');_0x2fe3ee[_0xebf6('0x21')]=_0xebf6('0x28');_0x2fe3ee['holdtime']=_0x78cdf0[_0xebf6('0x22')];_0x2fe3ee[_0xebf6('0x23')]=0x0;writeDB(_0x2fe3ee);}});}catch(_0xed3a5b){utils[_0xebf6('0x1c')](util['format']('[%s][agents][queuecallerabandon]',_0x78cdf0[_0xebf6('0x4')]),_0xed3a5b);}};exports[_0xebf6('0x29')]=function(_0x562f76){try{if(agents[_0x562f76[_0xebf6('0x19')]]){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x2a'),_0x562f76[_0xebf6('0x4')]),_0x562f76);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x2b'),_0x562f76['uniqueid'],agents[_0x562f76[_0xebf6('0x19')]]['membername'],_0x562f76[_0xebf6('0x19')]));agents[_0x562f76['destuniqueid']][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x9')]=_0x562f76[_0xebf6('0x9')];agents[_0x562f76[_0xebf6('0x19')]]['connectedlinename']=_0x562f76[_0xebf6('0x1a')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0x22')]=_0x562f76[_0xebf6('0x2d')];agents[_0x562f76[_0xebf6('0x19')]][_0xebf6('0xa')]='connect';_[_0xebf6('0x2e')](agents,function(_0x2782a5,_0x3f8502){if(_0x2782a5[_0xebf6('0x19')]!=_0x562f76[_0xebf6('0x19')]&&_0x2782a5[_0xebf6('0x4')]==_0x562f76['uniqueid']){_0x2782a5['talktime']=0x0;_0x2782a5['holdtime']=_0x562f76[_0xebf6('0x2d')];_0x2782a5[_0xebf6('0x1d')]=!![];_0x2782a5[_0xebf6('0x20')]=utils['now']();_0x2782a5[_0xebf6('0xa')]=_0xebf6('0x2f');_0x2782a5[_0xebf6('0x21')]='answered_elsewhere';_0x2782a5[_0xebf6('0x30')]=_0x562f76[_0xebf6('0x19')];_0x2782a5['answeredelsewheremembername']=_0x562f76[_0xebf6('0x6')];writeDB(_0x2782a5);}});}}catch(_0x1de50e){utils[_0xebf6('0x1c')](util['format'](_0xebf6('0x2a'),_0x562f76['uniqueid']),_0x1de50e);}};exports['agentcomplete']=function(_0x256552){try{if(!_[_0xebf6('0x31')](agents[_0x256552[_0xebf6('0x19')]])){utils[_0xebf6('0x14')](util['format'](_0xebf6('0x32'),_0x256552['uniqueid']),_0x256552);utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x33'),_0x256552[_0xebf6('0x4')],agents[_0x256552[_0xebf6('0x19')]]['membername'],_0x256552['destuniqueid']));agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x34')]=!![];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')]=utils['now']();agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x35')],agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0x2c')]);agents[_0x256552['destuniqueid']][_0xebf6('0x21')]=_0x256552[_0xebf6('0x21')];agents[_0x256552[_0xebf6('0x19')]][_0xebf6('0xa')]=_0xebf6('0x37');writeDB(agents[_0x256552[_0xebf6('0x19')]]);}}catch(_0x250cf4){utils['error'](util[_0xebf6('0x2')]('[%s][agents][agentcomplete]',_0x256552[_0xebf6('0x4')]),_0x250cf4);}};exports[_0xebf6('0x38')]=function(_0x5d84ac){try{if(!_[_0xebf6('0x31')](agents[_0x5d84ac['transfereruniqueid']])){utils[_0xebf6('0x14')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x5d84ac);utils[_0xebf6('0x1')](util['format'](_0xebf6('0x3a'),_0x5d84ac[_0xebf6('0x4')],agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x6')],agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')]));agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3c')]=!![];agents[_0x5d84ac['transfereruniqueid']][_0xebf6('0x3d')]=_0xebf6('0x3e');agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x3f')]=_0x5d84ac['extension'];agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x40')]=agents[_0x5d84ac[_0xebf6('0x3b')]][_0xebf6('0x4')];}}catch(_0x16abac){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x39'),_0x5d84ac[_0xebf6('0x4')]),_0x16abac);}};exports['attendedtransfer']=function(_0x22c3ad){try{utils[_0xebf6('0x14')](util[_0xebf6('0x2')]('[%s][agents][attendedtransfer]',_0x22c3ad[_0xebf6('0x41')]),_0x22c3ad);if(_0x22c3ad['origtransfereruniqueid']==_0x22c3ad['origtransfererlinkedid']){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x42')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad['origtransfereruniqueid'],agents[_0x22c3ad[_0xebf6('0x42')]]['membername']));agents[_0x22c3ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3d')]='ATTENDED';agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x3f')]=_0x22c3ad[_0xebf6('0x44')];agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x41')];}if(_0x22c3ad[_0xebf6('0x45')]&&agents[_0x22c3ad['transfereeuniqueid']]){agents[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad[_0xebf6('0x45')]]=_[_0xebf6('0x47')](agents[_0x22c3ad[_0xebf6('0x45')]]);transfers[_0x22c3ad[_0xebf6('0x45')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x8')];transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x42')]][_0xebf6('0x48')];transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad['transfereeuniqueid']][_0xebf6('0x22')]=0x0;transfers[_0x22c3ad[_0xebf6('0x45')]][_0xebf6('0x46')]=0x2;}}else if(_0x22c3ad[_0xebf6('0x42')]==_0x22c3ad[_0xebf6('0x49')]){if(!_[_0xebf6('0x31')](agents[_0x22c3ad[_0xebf6('0x41')]])){utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x43'),_0x22c3ad[_0xebf6('0x41')],agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x6')]));agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3c')]=!![];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x3d')]=_0xebf6('0x4a');agents[_0x22c3ad['origtransfereruniqueid']][_0xebf6('0x3f')]=_0x22c3ad['secondtransfererexten'];agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x40')]=_0x22c3ad[_0xebf6('0x42')];}if(_0x22c3ad[_0xebf6('0x4b')]&&agents[_0x22c3ad[_0xebf6('0x4b')]]){agents[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x1;transfers[_0x22c3ad['transfertargetuniqueid']]=_['clone'](agents[_0x22c3ad[_0xebf6('0x4b')]]);transfers[_0x22c3ad[_0xebf6('0x4b')]]['calleridnum']=agents[_0x22c3ad[_0xebf6('0x41')]][_0xebf6('0x8')];transfers[_0x22c3ad['transfertargetuniqueid']][_0xebf6('0x48')]=agents[_0x22c3ad[_0xebf6('0x41')]]['calleridname'];transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x16')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x2c')]=utils[_0xebf6('0x17')]();transfers[_0x22c3ad[_0xebf6('0x4b')]]['holdtime']=0x0;transfers[_0x22c3ad[_0xebf6('0x4b')]][_0xebf6('0x46')]=0x2;}}}catch(_0x26d338){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x4c'),_0x22c3ad[_0xebf6('0x41')]),_0x26d338);}};exports[_0xebf6('0x4d')]=function(_0x3bc43){try{utils[_0xebf6('0x14')](util['format']('[%s][agents][hangup]',_0x3bc43[_0xebf6('0x4')]),_0x3bc43);if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]==='timeout'){if(_0x3bc43[_0xebf6('0x4e')]==='21'){agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')]=_0xebf6('0x4f');agents[_0x3bc43['uniqueid']]['lastevent']='rejected';}utils[_0xebf6('0x1')](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43['uniqueid']][_0xebf6('0xa')]));writeDB(agents[_0x3bc43[_0xebf6('0x4')]]);var _0x50169c=unanswered['indexOf'](_0x3bc43[_0xebf6('0x4')]);if(_0x50169c>-0x1){unanswered['splice'](_0x50169c,0x1);}}if(transfers[_0x3bc43[_0xebf6('0x4')]]){transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x34')]=!![];transfers[_0x3bc43['uniqueid']][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](transfers[_0x3bc43[_0xebf6('0x4')]]['agentcompleteAt'],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);transfers[_0x3bc43['uniqueid']][_0xebf6('0x21')]=_0xebf6('0x51');transfers[_0x3bc43[_0xebf6('0x4')]]['lastevent']=_0xebf6('0x37');utils[_0xebf6('0x1')](util['format'](_0xebf6('0x50'),_0x3bc43[_0xebf6('0x4')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],transfers[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]));writeDB(transfers[_0x3bc43[_0xebf6('0x4')]],!![]);}if(agents[_0x3bc43[_0xebf6('0x4')]]&&agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]){agents[_0x3bc43[_0xebf6('0x4')]]['agentcomplete']=!![];agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')]=utils[_0xebf6('0x17')]();agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x23')]=utils[_0xebf6('0x36')](agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x35')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x2c')]);agents[_0x3bc43['uniqueid']]['reason']=agents[_0x3bc43[_0xebf6('0x4')]]['transfer']?_0xebf6('0x3c'):_0xebf6('0x51');agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0xa')]=_0xebf6('0x37');utils['info'](util[_0xebf6('0x2')](_0xebf6('0x50'),_0x3bc43['uniqueid'],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x6')],agents[_0x3bc43[_0xebf6('0x4')]][_0xebf6('0x21')],agents[_0x3bc43[_0xebf6('0x4')]]['lastevent']));writeDB(agents[_0x3bc43['uniqueid']]);}}catch(_0x1b245d){utils[_0xebf6('0x1c')](util[_0xebf6('0x2')](_0xebf6('0x52'),_0x3bc43[_0xebf6('0x4')]),_0x1b245d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 402a6e7..059d530 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 _0x8c84=['getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','transfer','destinationchannel','answertime','disposition','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','[%s][calls][newexten]','lodash','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode'];(function(_0xe485a,_0x27f830){var _0x493154=function(_0x3d824f){while(--_0x3d824f){_0xe485a['push'](_0xe485a['shift']());}};_0x493154(++_0x27f830);}(_0x8c84,0x1f2));var _0x48c8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8c84[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x48c8('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x48c8('0x1'));var dispositions=[_0x48c8('0x2'),'FAILED','FAILED',_0x48c8('0x2'),'NO\x20ANSWER',_0x48c8('0x2'),_0x48c8('0x3'),_0x48c8('0x4'),_0x48c8('0x5'),_0x48c8('0x5'),_0x48c8('0x5')];var channels={};function writeDB(_0x75d27c){var _0x177e2b;if(transfers[_0x48c8('0x6')][_0x75d27c[_0x48c8('0x7')]]){_0x177e2b=_0x75d27c[_0x48c8('0x7')];_0x75d27c[_0x48c8('0x7')]=transfers[_0x48c8('0x6')][_0x75d27c[_0x48c8('0x7')]]['transfereeuniqueid'];}utils[_0x48c8('0x8')](util['format'](_0x48c8('0x9'),_0x75d27c[_0x48c8('0x7')],_0x75d27c[_0x48c8('0xa')],_0x75d27c[_0x48c8('0xb')],_0x75d27c[_0x48c8('0xc')],_0x75d27c[_0x48c8('0xd')],_0x75d27c[_0x48c8('0xe')],_0x75d27c[_0x48c8('0xf')],_0x75d27c['lastevent']));if(_0x75d27c[_0x48c8('0x10')]){utils[_0x48c8('0x11')](_0x75d27c['accountcode'])['then'](function(_0x2bcf29){if(_0x2bcf29){_0x75d27c[_0x48c8('0x12')]=_0x2bcf29['id'];}utils[_0x48c8('0x13')]('CreateVoiceCallReport',_0x75d27c);});}else{utils[_0x48c8('0x13')](_0x48c8('0x14'),_0x75d27c);}if(channels[_0x75d27c[_0x48c8('0x7')]]){delete channels[_0x75d27c['uniqueid']];}else if(_0x177e2b&&channels[_0x177e2b]){delete transfers[_0x48c8('0x6')][_0x177e2b];delete channels[_0x177e2b];}}exports[_0x48c8('0x15')]=function(_0x4a4c71){try{utils[_0x48c8('0x16')](util[_0x48c8('0x17')](_0x48c8('0x18'),_0x4a4c71[_0x48c8('0x7')]),_0x4a4c71);if(_0x4a4c71[_0x48c8('0x7')]==_0x4a4c71[_0x48c8('0x19')]&&_0x4a4c71[_0x48c8('0xa')]!='OutgoingSpoolFailed'){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x1a'),_0x4a4c71[_0x48c8('0x7')],_0x4a4c71[_0x48c8('0x1b')],_0x4a4c71[_0x48c8('0x1c')]));channels[_0x4a4c71['uniqueid']]={'uniqueid':_0x4a4c71[_0x48c8('0x7')],'accountcode':_0x4a4c71[_0x48c8('0x10')],'source':_0x4a4c71[_0x48c8('0xe')],'destination':_0x4a4c71[_0x48c8('0x1c')],'destinationcontext':_0x4a4c71[_0x48c8('0x1b')],'channel':_0x4a4c71[_0x48c8('0xa')],'starttime':utils[_0x48c8('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x48c8('0x2'),'amaflags':_0x48c8('0x1e')};}}catch(_0x4c1eb4){utils[_0x48c8('0x1f')](util['format'](_0x48c8('0x18'),_0x4a4c71[_0x48c8('0x7')]),_0x4c1eb4);}};exports[_0x48c8('0x20')]=function(_0x30922c){try{utils['debug'](util[_0x48c8('0x17')]('[%s][calls][newstate]',_0x30922c[_0x48c8('0x7')]),_0x30922c);if(!_['isNil'](channels[_0x30922c[_0x48c8('0x7')]])&&_0x30922c[_0x48c8('0x21')]==0x6){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x22'),_0x30922c[_0x48c8('0x7')],_0x30922c['context'],_0x30922c[_0x48c8('0xa')]));if(_['isNil'](channels[_0x30922c[_0x48c8('0x7')]][_0x48c8('0x23')])){channels[_0x30922c['uniqueid']]['systemanswertime']=utils[_0x48c8('0x1d')]();}}else if(!_[_0x48c8('0x24')](channels[_0x30922c['linkedid']])&&_0x30922c['channelstate']==0x6&&_0x30922c[_0x48c8('0x1b')]!=_0x48c8('0x25')){utils[_0x48c8('0x8')](util[_0x48c8('0x17')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x30922c[_0x48c8('0x7')],_0x30922c[_0x48c8('0x19')],_0x30922c[_0x48c8('0x1b')],_0x30922c[_0x48c8('0xa')]));channels[_0x30922c[_0x48c8('0x19')]][_0x48c8('0x10')]=_0x30922c['accountcode'];channels[_0x30922c['linkedid']][_0x48c8('0x26')]=_0x30922c[_0x48c8('0xa')];if(_[_0x48c8('0x24')](channels[_0x30922c[_0x48c8('0x19')]][_0x48c8('0x27')])){channels[_0x30922c[_0x48c8('0x19')]][_0x48c8('0x27')]=utils[_0x48c8('0x1d')]();}channels[_0x30922c[_0x48c8('0x19')]][_0x48c8('0x28')]=dispositions[_['toNumber'](_0x30922c['channelstate'])]||'ANSWERED';}}catch(_0x1824d7){utils['error'](util[_0x48c8('0x17')](_0x48c8('0x29'),_0x30922c[_0x48c8('0x7')]),_0x1824d7);}};exports[_0x48c8('0x2a')]=function(_0xeeadb8){try{if(!_[_0x48c8('0x24')](channels[_0xeeadb8[_0x48c8('0x7')]])){utils[_0x48c8('0x16')](util[_0x48c8('0x17')](_0x48c8('0x2b'),_0xeeadb8['uniqueid']),_0xeeadb8);if(_[_0x48c8('0x24')](channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x2c')])){channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x2c')]=_0xeeadb8['calleridname']+'\x20<'+_0xeeadb8['calleridnum']+'>';}utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x2d'),_0xeeadb8['uniqueid'],channels[_0xeeadb8[_0x48c8('0x7')]]['callerid'],_0xeeadb8[_0x48c8('0x2e')]));channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x2f')]=utils[_0x48c8('0x1d')]();channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x30')]=utils[_0x48c8('0x31')](channels[_0xeeadb8['uniqueid']][_0x48c8('0x2f')],channels[_0xeeadb8[_0x48c8('0x7')]]['starttime']);channels[_0xeeadb8['uniqueid']][_0x48c8('0x32')]=channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x27')]?utils[_0x48c8('0x31')](channels[_0xeeadb8[_0x48c8('0x7')]][_0x48c8('0x2f')],channels[_0xeeadb8[_0x48c8('0x7')]]['answertime']):0x0;writeDB(channels[_0xeeadb8[_0x48c8('0x7')]]);}}catch(_0x1385e5){utils[_0x48c8('0x1f')](util[_0x48c8('0x17')]('[%s][calls][hangup]',_0xeeadb8[_0x48c8('0x7')]),_0x1385e5);}};exports['attendedtransfer']=function(_0x2f10a6){try{if(!_[_0x48c8('0x24')](channels[_0x2f10a6[_0x48c8('0x33')]])){utils[_0x48c8('0x16')](util['format'](_0x48c8('0x34'),_0x2f10a6['origtransfereruniqueid']),_0x2f10a6);if(channels[_0x2f10a6[_0x48c8('0x33')]][_0x48c8('0xa')]==_0x2f10a6[_0x48c8('0x35')]){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x36'),_0x2f10a6[_0x48c8('0x37')],_0x2f10a6['localtwolinkedid'],_0x2f10a6['secondtransfererchannel']));channels[_0x2f10a6[_0x48c8('0x33')]][_0x48c8('0x26')]=_0x2f10a6[_0x48c8('0x38')];channels[_0x2f10a6[_0x48c8('0x33')]]['userfield']='_attended';}else if(channels[_0x2f10a6[_0x48c8('0x33')]][_0x48c8('0xa')]=_0x2f10a6[_0x48c8('0x39')]){utils[_0x48c8('0x8')](util['format'](_0x48c8('0x36'),_0x2f10a6['origtransfereruniqueid'],_0x2f10a6[_0x48c8('0x33')],_0x2f10a6[_0x48c8('0x3a')]));channels[_0x2f10a6[_0x48c8('0x33')]][_0x48c8('0x26')]=_0x2f10a6['origtransfererchannel'];channels[_0x2f10a6[_0x48c8('0x33')]][_0x48c8('0x3b')]='_attended';}}}catch(_0x56f356){utils[_0x48c8('0x1f')](util['format'](_0x48c8('0x34'),_0x2f10a6[_0x48c8('0x37')]),_0x56f356);}};exports['musiconholdstart']=function(_0x32146a){try{if(!_['isNil'](channels[_0x32146a[_0x48c8('0x7')]])){utils[_0x48c8('0x16')](util['format'](_0x48c8('0x3c'),_0x32146a[_0x48c8('0x7')]),_0x32146a);channels[_0x32146a[_0x48c8('0x7')]][_0x48c8('0x3d')]=utils[_0x48c8('0x1d')]();utils['info'](util[_0x48c8('0x17')](_0x48c8('0x3e'),_0x32146a[_0x48c8('0x7')],channels[_0x32146a[_0x48c8('0x7')]][_0x48c8('0x3d')]));}}catch(_0x5576ff){utils[_0x48c8('0x1f')](util[_0x48c8('0x17')](_0x48c8('0x3c'),_0x32146a[_0x48c8('0x7')]),_0x5576ff);}};exports[_0x48c8('0x3f')]=function(_0x1c98b7){try{if(!_['isNil'](channels[_0x1c98b7[_0x48c8('0x7')]])){utils[_0x48c8('0x16')](util[_0x48c8('0x17')](_0x48c8('0x40'),_0x1c98b7[_0x48c8('0x7')]),_0x1c98b7);if(!_[_0x48c8('0x24')](channels[_0x1c98b7[_0x48c8('0x7')]]['musiconholdstartAt'])){channels[_0x1c98b7[_0x48c8('0x7')]][_0x48c8('0x41')]+=utils[_0x48c8('0x31')](utils[_0x48c8('0x1d')](),channels[_0x1c98b7[_0x48c8('0x7')]][_0x48c8('0x3d')]);utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x42'),_0x1c98b7[_0x48c8('0x7')],channels[_0x1c98b7[_0x48c8('0x7')]][_0x48c8('0x41')]));delete channels[_0x1c98b7[_0x48c8('0x7')]][_0x48c8('0x3d')];}}}catch(_0x1197d4){utils['error'](util[_0x48c8('0x17')](_0x48c8('0x40'),_0x1c98b7['uniqueid']),_0x1197d4);}};exports['varset']=function(_0x5ea754){try{if(!_[_0x48c8('0x24')](channels[_0x5ea754[_0x48c8('0x7')]])){utils[_0x48c8('0x16')](util['format'](_0x48c8('0x43'),_0x5ea754[_0x48c8('0x7')]),_0x5ea754);if(!_[_0x48c8('0x24')](_0x5ea754['variable'][_0x48c8('0x44')])){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x45'),_0x5ea754[_0x48c8('0x7')],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x47')]=_0x5ea754[_0x48c8('0x46')];}if(!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x49')])){utils['info'](util[_0x48c8('0x17')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x5ea754[_0x48c8('0x7')],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]]['destination']=_0x5ea754[_0x48c8('0x46')];channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x2c')]='\x22'+_0x5ea754[_0x48c8('0x46')]+_0x48c8('0x4a')+_0x5ea754[_0x48c8('0x46')]+'>';}if(!_[_0x48c8('0x24')](_0x5ea754['variable']['xmd-callerid-preview'])||!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x4b')])){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x4c'),_0x5ea754[_0x48c8('0x7')],!_['isNil'](_0x5ea754['variable'][_0x48c8('0x4d')])?_0x48c8('0x4d'):_0x48c8('0x4b'),_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x2c')]=_0x5ea754[_0x48c8('0x46')];}if(!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x4e')])||!_['isNil'](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x4f')])){utils['info'](util['format'](_0x48c8('0x4c'),_0x5ea754[_0x48c8('0x7')],!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x4e')])?_0x48c8('0x4e'):'xmcs-queue',_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x50')]=_0x48c8('0x51');channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x52')]=_0x5ea754[_0x48c8('0x46')];channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0xb')]=!![];}if(!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')]['xmd-contactid'])){utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x53'),_0x5ea754[_0x48c8('0x7')],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]]['ContactId']=_0x5ea754[_0x48c8('0x46')];}if(!_[_0x48c8('0x24')](_0x5ea754['variable'][_0x48c8('0x54')])){utils[_0x48c8('0x8')](util[_0x48c8('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5ea754['uniqueid'],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754['uniqueid']][_0x48c8('0x55')]=_0x5ea754[_0x48c8('0x46')];}if(!_[_0x48c8('0x24')](_0x5ea754[_0x48c8('0x48')][_0x48c8('0x56')])){utils['info'](util['format'](_0x48c8('0x57'),_0x5ea754[_0x48c8('0x7')],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754['uniqueid']][_0x48c8('0x58')]=_0x5ea754[_0x48c8('0x46')];}if(!_['isNil'](_0x5ea754['variable'][_0x48c8('0x59')])){utils['info'](util[_0x48c8('0x17')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5ea754[_0x48c8('0x7')],_0x5ea754[_0x48c8('0x46')]));channels[_0x5ea754[_0x48c8('0x7')]][_0x48c8('0x59')]=_0x5ea754['value'];}}}catch(_0x3be927){utils[_0x48c8('0x1f')](util[_0x48c8('0x17')](_0x48c8('0x43'),_0x5ea754[_0x48c8('0x7')]),_0x3be927);}};exports[_0x48c8('0x5a')]=function(_0x8c4b9c){try{if(!_[_0x48c8('0x24')](channels[_0x8c4b9c['uniqueid']])){utils[_0x48c8('0x16')](util[_0x48c8('0x17')]('[%s][calls][newexten]',_0x8c4b9c[_0x48c8('0x7')]),_0x8c4b9c);utils[_0x48c8('0x8')](util[_0x48c8('0x17')](_0x48c8('0x5b'),_0x8c4b9c[_0x48c8('0x7')],_0x8c4b9c[_0x48c8('0x5c')],_0x8c4b9c['appdata']));if(_0x8c4b9c[_0x48c8('0x5c')][_0x48c8('0x5d')]()=='set'&&_[_0x48c8('0x5e')](_0x8c4b9c[_0x48c8('0x5f')][_0x48c8('0x5d')](),_0x48c8('0x60'))){var _0xf350ce=_0x8c4b9c[_0x48c8('0x5f')][_0x48c8('0x61')]('=');var _0x2b90ba=_0xf350ce[0x0][_0x48c8('0x62')](_0xf350ce[0x0][_0x48c8('0x63')]('(')+0x1,_0xf350ce[0x0][_0x48c8('0x63')](')'));var _0x5d12f5=_0xf350ce[0x1];channels[_0x8c4b9c[_0x48c8('0x7')]][_0x2b90ba]=_0x5d12f5;}if(!_[_0x48c8('0x64')]([_0x48c8('0x2a'),_0x48c8('0x65'),'execif','set','gotoif'],_0x8c4b9c[_0x48c8('0x5c')][_0x48c8('0x5d')]())){channels[_0x8c4b9c[_0x48c8('0x7')]][_0x48c8('0x50')]=_0x8c4b9c[_0x48c8('0x5c')];channels[_0x8c4b9c[_0x48c8('0x7')]][_0x48c8('0x52')]=_0x8c4b9c['appdata'];}}}catch(_0x33047e){utils[_0x48c8('0x1f')](util['format'](_0x48c8('0x66'),_0x8c4b9c['uniqueid']),_0x33047e);}}; \ No newline at end of file +var _0x27fb=['origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','musiconholdstartAt','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','execif','gotoif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','blinds','uniqueid','info','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','starttime','billableseconds','endtime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]'];(function(_0x3b346f,_0x38dd41){var _0x1b4005=function(_0x2cb36c){while(--_0x2cb36c){_0x3b346f['push'](_0x3b346f['shift']());}};_0x1b4005(++_0x38dd41);}(_0x27fb,0x1dc));var _0xb27f=function(_0x4d5c85,_0x153f30){_0x4d5c85=_0x4d5c85-0x0;var _0x330b70=_0x27fb[_0x4d5c85];return _0x330b70;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var utils=require(_0xb27f('0x2'));var transfers=require(_0xb27f('0x3'));var dispositions=['NO\x20ANSWER',_0xb27f('0x4'),'FAILED','NO\x20ANSWER',_0xb27f('0x5'),_0xb27f('0x5'),_0xb27f('0x6'),'BUSY','FAILED',_0xb27f('0x4'),_0xb27f('0x4')];var channels={};function writeDB(_0x1e1f17){var _0x475761;if(transfers[_0xb27f('0x7')][_0x1e1f17[_0xb27f('0x8')]]){_0x475761=_0x1e1f17[_0xb27f('0x8')];_0x1e1f17[_0xb27f('0x8')]=transfers[_0xb27f('0x7')][_0x1e1f17[_0xb27f('0x8')]]['transfereeuniqueid'];}utils[_0xb27f('0x9')](util[_0xb27f('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1e1f17[_0xb27f('0x8')],_0x1e1f17[_0xb27f('0xb')],_0x1e1f17[_0xb27f('0xc')],_0x1e1f17['membername'],_0x1e1f17[_0xb27f('0xd')],_0x1e1f17[_0xb27f('0xe')],_0x1e1f17[_0xb27f('0xf')],_0x1e1f17[_0xb27f('0x10')]));if(_0x1e1f17[_0xb27f('0x11')]){utils[_0xb27f('0x12')](_0x1e1f17['accountcode'])['then'](function(_0x34a8d0){if(_0x34a8d0){_0x1e1f17[_0xb27f('0x13')]=_0x34a8d0['id'];}utils[_0xb27f('0x14')]('CreateVoiceCallReport',_0x1e1f17);});}else{utils[_0xb27f('0x14')](_0xb27f('0x15'),_0x1e1f17);}if(channels[_0x1e1f17['uniqueid']]){delete channels[_0x1e1f17[_0xb27f('0x8')]];}else if(_0x475761&&channels[_0x475761]){delete transfers[_0xb27f('0x7')][_0x475761];delete channels[_0x475761];}}exports['newchannel']=function(_0x4645cf){try{utils[_0xb27f('0x16')](util[_0xb27f('0xa')](_0xb27f('0x17'),_0x4645cf['uniqueid']),_0x4645cf);if(_0x4645cf[_0xb27f('0x8')]==_0x4645cf[_0xb27f('0x18')]&&_0x4645cf[_0xb27f('0xb')]!='OutgoingSpoolFailed'){utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x19'),_0x4645cf[_0xb27f('0x8')],_0x4645cf[_0xb27f('0x1a')],_0x4645cf[_0xb27f('0x1b')]));channels[_0x4645cf[_0xb27f('0x8')]]={'uniqueid':_0x4645cf['uniqueid'],'accountcode':_0x4645cf[_0xb27f('0x11')],'source':_0x4645cf[_0xb27f('0xe')],'destination':_0x4645cf[_0xb27f('0x1b')],'destinationcontext':_0x4645cf['context'],'channel':_0x4645cf[_0xb27f('0xb')],'starttime':utils[_0xb27f('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xb27f('0x1d')};}}catch(_0x2acdd3){utils[_0xb27f('0x1e')](util[_0xb27f('0xa')](_0xb27f('0x17'),_0x4645cf[_0xb27f('0x8')]),_0x2acdd3);}};exports[_0xb27f('0x1f')]=function(_0x1ecb68){try{utils[_0xb27f('0x16')](util[_0xb27f('0xa')]('[%s][calls][newstate]',_0x1ecb68[_0xb27f('0x8')]),_0x1ecb68);if(!_[_0xb27f('0x20')](channels[_0x1ecb68[_0xb27f('0x8')]])&&_0x1ecb68['channelstate']==0x6){utils[_0xb27f('0x9')](util['format'](_0xb27f('0x21'),_0x1ecb68[_0xb27f('0x8')],_0x1ecb68['context'],_0x1ecb68[_0xb27f('0xb')]));if(_[_0xb27f('0x20')](channels[_0x1ecb68['uniqueid']][_0xb27f('0x22')])){channels[_0x1ecb68[_0xb27f('0x8')]][_0xb27f('0x22')]=utils['now']();}}else if(!_[_0xb27f('0x20')](channels[_0x1ecb68['linkedid']])&&_0x1ecb68[_0xb27f('0x23')]==0x6&&_0x1ecb68[_0xb27f('0x1a')]!='transfer'){utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x24'),_0x1ecb68[_0xb27f('0x8')],_0x1ecb68['linkedid'],_0x1ecb68['context'],_0x1ecb68[_0xb27f('0xb')]));channels[_0x1ecb68[_0xb27f('0x18')]][_0xb27f('0x11')]=_0x1ecb68[_0xb27f('0x11')];channels[_0x1ecb68[_0xb27f('0x18')]]['destinationchannel']=_0x1ecb68[_0xb27f('0xb')];if(_[_0xb27f('0x20')](channels[_0x1ecb68[_0xb27f('0x18')]][_0xb27f('0x25')])){channels[_0x1ecb68[_0xb27f('0x18')]]['answertime']=utils[_0xb27f('0x1c')]();}channels[_0x1ecb68[_0xb27f('0x18')]]['disposition']=dispositions[_[_0xb27f('0x26')](_0x1ecb68['channelstate'])]||_0xb27f('0x6');}}catch(_0x19c821){utils[_0xb27f('0x1e')](util[_0xb27f('0xa')](_0xb27f('0x27'),_0x1ecb68[_0xb27f('0x8')]),_0x19c821);}};exports[_0xb27f('0x28')]=function(_0x3b799e){try{if(!_['isNil'](channels[_0x3b799e[_0xb27f('0x8')]])){utils[_0xb27f('0x16')](util['format'](_0xb27f('0x29'),_0x3b799e[_0xb27f('0x8')]),_0x3b799e);if(_[_0xb27f('0x20')](channels[_0x3b799e['uniqueid']][_0xb27f('0x2a')])){channels[_0x3b799e['uniqueid']]['callerid']=_0x3b799e[_0xb27f('0x2b')]+'\x20<'+_0x3b799e[_0xb27f('0xe')]+'>';}utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x2c'),_0x3b799e[_0xb27f('0x8')],channels[_0x3b799e[_0xb27f('0x8')]]['callerid'],_0x3b799e[_0xb27f('0x2d')]));channels[_0x3b799e['uniqueid']]['endtime']=utils['now']();channels[_0x3b799e[_0xb27f('0x8')]][_0xb27f('0x2e')]=utils[_0xb27f('0x2f')](channels[_0x3b799e[_0xb27f('0x8')]]['endtime'],channels[_0x3b799e['uniqueid']][_0xb27f('0x30')]);channels[_0x3b799e[_0xb27f('0x8')]][_0xb27f('0x31')]=channels[_0x3b799e[_0xb27f('0x8')]][_0xb27f('0x25')]?utils[_0xb27f('0x2f')](channels[_0x3b799e['uniqueid']][_0xb27f('0x32')],channels[_0x3b799e[_0xb27f('0x8')]][_0xb27f('0x25')]):0x0;writeDB(channels[_0x3b799e[_0xb27f('0x8')]]);}}catch(_0x46b7e6){utils['error'](util[_0xb27f('0xa')](_0xb27f('0x29'),_0x3b799e[_0xb27f('0x8')]),_0x46b7e6);}};exports[_0xb27f('0x33')]=function(_0x547173){try{if(!_[_0xb27f('0x20')](channels[_0x547173[_0xb27f('0x34')]])){utils['debug'](util[_0xb27f('0xa')](_0xb27f('0x35'),_0x547173[_0xb27f('0x36')]),_0x547173);if(channels[_0x547173['localtwolinkedid']][_0xb27f('0xb')]==_0x547173[_0xb27f('0x37')]){utils['info'](util[_0xb27f('0xa')](_0xb27f('0x38'),_0x547173[_0xb27f('0x36')],_0x547173[_0xb27f('0x34')],_0x547173[_0xb27f('0x39')]));channels[_0x547173[_0xb27f('0x34')]][_0xb27f('0x3a')]=_0x547173[_0xb27f('0x39')];channels[_0x547173[_0xb27f('0x34')]]['userfield']=_0xb27f('0x3b');}else if(channels[_0x547173[_0xb27f('0x34')]][_0xb27f('0xb')]=_0x547173[_0xb27f('0x3c')]){utils['info'](util[_0xb27f('0xa')](_0xb27f('0x38'),_0x547173[_0xb27f('0x36')],_0x547173['localtwolinkedid'],_0x547173[_0xb27f('0x3d')]));channels[_0x547173[_0xb27f('0x34')]][_0xb27f('0x3a')]=_0x547173['origtransfererchannel'];channels[_0x547173[_0xb27f('0x34')]][_0xb27f('0x3e')]='_attended';}}}catch(_0x1cd02d){utils[_0xb27f('0x1e')](util[_0xb27f('0xa')]('[%s][calls][attendedtransfer]',_0x547173[_0xb27f('0x36')]),_0x1cd02d);}};exports[_0xb27f('0x3f')]=function(_0x58132e){try{if(!_[_0xb27f('0x20')](channels[_0x58132e[_0xb27f('0x8')]])){utils[_0xb27f('0x16')](util[_0xb27f('0xa')]('[%s][calls][musiconholdstart]',_0x58132e[_0xb27f('0x8')]),_0x58132e);channels[_0x58132e[_0xb27f('0x8')]]['musiconholdstartAt']=utils[_0xb27f('0x1c')]();utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x40'),_0x58132e[_0xb27f('0x8')],channels[_0x58132e[_0xb27f('0x8')]]['musiconholdstartAt']));}}catch(_0x1886df){utils[_0xb27f('0x1e')](util[_0xb27f('0xa')](_0xb27f('0x41'),_0x58132e[_0xb27f('0x8')]),_0x1886df);}};exports[_0xb27f('0x42')]=function(_0x54e540){try{if(!_[_0xb27f('0x20')](channels[_0x54e540[_0xb27f('0x8')]])){utils[_0xb27f('0x16')](util[_0xb27f('0xa')](_0xb27f('0x43'),_0x54e540[_0xb27f('0x8')]),_0x54e540);if(!_[_0xb27f('0x20')](channels[_0x54e540['uniqueid']]['musiconholdstartAt'])){channels[_0x54e540[_0xb27f('0x8')]][_0xb27f('0x44')]+=utils['diffTime'](utils[_0xb27f('0x1c')](),channels[_0x54e540[_0xb27f('0x8')]][_0xb27f('0x45')]);utils[_0xb27f('0x9')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x54e540[_0xb27f('0x8')],channels[_0x54e540[_0xb27f('0x8')]]['mohtime']));delete channels[_0x54e540[_0xb27f('0x8')]][_0xb27f('0x45')];}}}catch(_0x513a6f){utils[_0xb27f('0x1e')](util['format'](_0xb27f('0x43'),_0x54e540['uniqueid']),_0x513a6f);}};exports['varset']=function(_0xc75250){try{if(!_[_0xb27f('0x20')](channels[_0xc75250[_0xb27f('0x8')]])){utils[_0xb27f('0x16')](util[_0xb27f('0xa')](_0xb27f('0x46'),_0xc75250[_0xb27f('0x8')]),_0xc75250);if(!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x48')])){utils[_0xb27f('0x9')](util['format'](_0xb27f('0x49'),_0xc75250['uniqueid'],_0xc75250[_0xb27f('0x4a')]));channels[_0xc75250[_0xb27f('0x8')]]['source']=_0xc75250[_0xb27f('0x4a')];}if(!_['isNil'](_0xc75250['variable']['xmd-phone'])){utils[_0xb27f('0x9')](util[_0xb27f('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xc75250[_0xb27f('0x8')],_0xc75250['value']));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x4b')]=_0xc75250[_0xb27f('0x4a')];channels[_0xc75250[_0xb27f('0x8')]]['callerid']='\x22'+_0xc75250[_0xb27f('0x4a')]+_0xb27f('0x4c')+_0xc75250['value']+'>';}if(!_['isNil'](_0xc75250[_0xb27f('0x47')]['xmd-callerid-preview'])||!_[_0xb27f('0x20')](_0xc75250['variable'][_0xb27f('0x4d')])){utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x4e'),_0xc75250['uniqueid'],!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x4f')])?_0xb27f('0x4f'):'xmd-callerid',_0xc75250['value']));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x2a')]=_0xc75250[_0xb27f('0x4a')];}if(!_[_0xb27f('0x20')](_0xc75250['variable'][_0xb27f('0x50')])||!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x51')])){utils['info'](util['format'](_0xb27f('0x4e'),_0xc75250[_0xb27f('0x8')],!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x50')])?_0xb27f('0x50'):_0xb27f('0x51'),_0xc75250['value']));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x52')]=_0xb27f('0x53');channels[_0xc75250['uniqueid']][_0xb27f('0x54')]=_0xc75250['value'];channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0xc')]=!![];}if(!_[_0xb27f('0x20')](_0xc75250['variable'][_0xb27f('0x55')])){utils[_0xb27f('0x9')](util[_0xb27f('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xc75250[_0xb27f('0x8')],_0xc75250['value']));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x56')]=_0xc75250[_0xb27f('0x4a')];}if(!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x57')])){utils['info'](util[_0xb27f('0xa')](_0xb27f('0x58'),_0xc75250['uniqueid'],_0xc75250[_0xb27f('0x4a')]));channels[_0xc75250[_0xb27f('0x8')]]['type']=_0xc75250[_0xb27f('0x4a')];}if(!_[_0xb27f('0x20')](_0xc75250[_0xb27f('0x47')][_0xb27f('0x59')])){utils['info'](util[_0xb27f('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xc75250[_0xb27f('0x8')],_0xc75250[_0xb27f('0x4a')]));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x5a')]=_0xc75250['value'];}if(!_[_0xb27f('0x20')](_0xc75250['variable'][_0xb27f('0x5b')])){utils[_0xb27f('0x9')](util[_0xb27f('0xa')](_0xb27f('0x5c'),_0xc75250[_0xb27f('0x8')],_0xc75250[_0xb27f('0x4a')]));channels[_0xc75250[_0xb27f('0x8')]][_0xb27f('0x5b')]=_0xc75250[_0xb27f('0x4a')];}}}catch(_0x38afef){utils['error'](util[_0xb27f('0xa')](_0xb27f('0x46'),_0xc75250['uniqueid']),_0x38afef);}};exports[_0xb27f('0x5d')]=function(_0x5ca448){try{if(!_[_0xb27f('0x20')](channels[_0x5ca448[_0xb27f('0x8')]])){utils[_0xb27f('0x16')](util[_0xb27f('0xa')](_0xb27f('0x5e'),_0x5ca448[_0xb27f('0x8')]),_0x5ca448);utils['info'](util[_0xb27f('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x5ca448['uniqueid'],_0x5ca448['application'],_0x5ca448[_0xb27f('0x5f')]));if(_0x5ca448[_0xb27f('0x60')][_0xb27f('0x61')]()==_0xb27f('0x62')&&_[_0xb27f('0x63')](_0x5ca448['appdata'][_0xb27f('0x61')](),'cdr')){var _0x44641a=_0x5ca448[_0xb27f('0x5f')][_0xb27f('0x64')]('=');var _0x35299c=_0x44641a[0x0][_0xb27f('0x65')](_0x44641a[0x0][_0xb27f('0x66')]('(')+0x1,_0x44641a[0x0][_0xb27f('0x66')](')'));var _0x5f583a=_0x44641a[0x1];channels[_0x5ca448[_0xb27f('0x8')]][_0x35299c]=_0x5f583a;}if(!_[_0xb27f('0x67')](['hangup','noop',_0xb27f('0x68'),_0xb27f('0x62'),_0xb27f('0x69')],_0x5ca448[_0xb27f('0x60')][_0xb27f('0x61')]())){channels[_0x5ca448[_0xb27f('0x8')]][_0xb27f('0x52')]=_0x5ca448[_0xb27f('0x60')];channels[_0x5ca448[_0xb27f('0x8')]][_0xb27f('0x54')]=_0x5ca448[_0xb27f('0x5f')];}}}catch(_0x15815c){utils[_0xb27f('0x1e')](util['format'](_0xb27f('0x5e'),_0x5ca448[_0xb27f('0x8')]),_0x15815c);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e74e1ea..8d8eed1 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 _0x0acf=['[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','error'];(function(_0xee4b37,_0x3098c9){var _0x385793=function(_0x248661){while(--_0x248661){_0xee4b37['push'](_0xee4b37['shift']());}};_0x385793(++_0x3098c9);}(_0x0acf,0x1e9));var _0xf0ac=function(_0x109f48,_0x40847c){_0x109f48=_0x109f48-0x0;var _0x197fff=_0x0acf[_0x109f48];return _0x197fff;};'use strict';var utils=require(_0xf0ac('0x0'));exports[_0xf0ac('0x1')]=function(){utils[_0xf0ac('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0xf0ac('0x2')](_0xf0ac('0x3'));};exports[_0xf0ac('0x4')]=function(){utils[_0xf0ac('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x25970b){utils[_0xf0ac('0x5')](_0xf0ac('0x6'),_0x25970b);};exports['close']=function(){utils[_0xf0ac('0x2')](_0xf0ac('0x7'));};exports[_0xf0ac('0x8')]=function(_0x536dcc){}; \ No newline at end of file +var _0xcbf3=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown','fullybooted'];(function(_0x296d9d,_0x4d286b){var _0x53f5d0=function(_0x2ebcf9){while(--_0x2ebcf9){_0x296d9d['push'](_0x296d9d['shift']());}};_0x53f5d0(++_0x4d286b);}(_0xcbf3,0x119));var _0x3cbf=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcbf3[_0x525c7b];return _0x27b33e;};'use strict';var utils=require('./utils');exports[_0x3cbf('0x0')]=function(){utils[_0x3cbf('0x1')](_0x3cbf('0x2'));};exports[_0x3cbf('0x3')]=function(){utils[_0x3cbf('0x1')]('[core]\x20shutdown');};exports[_0x3cbf('0x4')]=function(){utils[_0x3cbf('0x1')](_0x3cbf('0x5'));};exports[_0x3cbf('0x6')]=function(_0x4432a6){utils['error'](_0x3cbf('0x7'),_0x4432a6);};exports[_0x3cbf('0x8')]=function(){utils['info'](_0x3cbf('0x9'));};exports[_0x3cbf('0xa')]=function(_0x4acca1){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f4de88a..0302857 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 _0xac07=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','now','complete','endtime','holdtime','billableseconds','diffTime','[%s][dials][hangup]','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','appdata','application','startsWith','toLowerCase','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','info','value','error','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','ANSWER','answertime'];(function(_0xf9b7a3,_0x2a66f4){var _0x25f0a2=function(_0x3d3364){while(--_0x3d3364){_0xf9b7a3['push'](_0xf9b7a3['shift']());}};_0x25f0a2(++_0x2a66f4);}(_0xac07,0x13a));var _0x7ac0=function(_0x505c6a,_0x1cbe5a){_0x505c6a=_0x505c6a-0x0;var _0x406d42=_0xac07[_0x505c6a];return _0x406d42;};'use strict';var _=require('lodash');var util=require(_0x7ac0('0x0'));var utils=require(_0x7ac0('0x1'));var dials={};function writeDB(_0x1ac447){utils['info'](util[_0x7ac0('0x2')](_0x7ac0('0x3'),_0x1ac447['uniqueid'],_0x1ac447['channel'],_0x1ac447[_0x7ac0('0x4')],_0x1ac447['calleridnum'],_0x1ac447[_0x7ac0('0x5')],_0x1ac447[_0x7ac0('0x6')]));utils['request'](_0x7ac0('0x7'),_0x1ac447);delete dials[_0x1ac447[_0x7ac0('0x8')]];}exports[_0x7ac0('0x9')]=function(_0x1820f3){try{utils[_0x7ac0('0xa')](util[_0x7ac0('0x2')](_0x7ac0('0xb'),_0x1820f3[_0x7ac0('0x8')]),_0x1820f3);utils['info'](util[_0x7ac0('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x1820f3['uniqueid'],_0x1820f3['application'],_0x1820f3[_0x7ac0('0xc')]));if(_0x1820f3[_0x7ac0('0xd')]['toLowerCase']()=='set'&&_[_0x7ac0('0xe')](_0x1820f3[_0x7ac0('0xc')][_0x7ac0('0xf')](),_0x7ac0('0x10'))){var _0xb5ee2c=_0x1820f3[_0x7ac0('0xc')][_0x7ac0('0x11')]('=');dials[_0x1820f3[_0x7ac0('0x8')]]={'routeId':_0xb5ee2c[0x1]};}}catch(_0x944aa5){utils['error'](util[_0x7ac0('0x2')](_0x7ac0('0xb'),_0x1820f3['uniqueid']),_0x944aa5);}};exports[_0x7ac0('0x12')]=function(_0x385428){try{utils['debug'](util[_0x7ac0('0x2')](_0x7ac0('0x13'),_0x385428[_0x7ac0('0x8')]),_0x385428);if(!_[_0x7ac0('0x14')](_0x385428[_0x7ac0('0x15')][_0x7ac0('0x16')])){utils[_0x7ac0('0x17')](util[_0x7ac0('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x385428[_0x7ac0('0x8')],_0x385428['value']));dials[_0x385428[_0x7ac0('0x8')]]={'routeId':_0x385428[_0x7ac0('0x18')]};}}catch(_0x5829c4){utils[_0x7ac0('0x19')](util['format'](_0x7ac0('0x13'),_0x385428[_0x7ac0('0x8')]),_0x5829c4);}};exports[_0x7ac0('0x1a')]=function(_0x1459a0){try{if(!_['isNil'](dials[_0x1459a0[_0x7ac0('0x8')]])){utils[_0x7ac0('0xa')](util[_0x7ac0('0x2')](_0x7ac0('0x1b'),_0x1459a0['uniqueid']),_0x1459a0);dials[_0x1459a0[_0x7ac0('0x8')]]=_[_0x7ac0('0x1c')](dials[_0x1459a0[_0x7ac0('0x8')]],_0x1459a0);dials[_0x1459a0[_0x7ac0('0x8')]]['starttime']=utils['now']();dials[_0x1459a0[_0x7ac0('0x8')]][_0x7ac0('0x1d')]=_0x7ac0('0x1e');utils[_0x7ac0('0x17')](util[_0x7ac0('0x2')](_0x7ac0('0x1f'),_0x1459a0[_0x7ac0('0x8')],dials[_0x1459a0[_0x7ac0('0x8')]][_0x7ac0('0x20')]));}}catch(_0x2c5986){utils[_0x7ac0('0x19')](util['format'](_0x7ac0('0x1b'),_0x1459a0[_0x7ac0('0x8')]),_0x2c5986);}};exports[_0x7ac0('0x21')]=function(_0x17056a){try{if(!_['isNil'](dials[_0x17056a[_0x7ac0('0x8')]])){utils[_0x7ac0('0xa')](util['format']('[%s][dials][dialend]',_0x17056a[_0x7ac0('0x8')]),_0x17056a);dials[_0x17056a[_0x7ac0('0x8')]][_0x7ac0('0x6')]=_0x17056a[_0x7ac0('0x6')];if(_0x17056a[_0x7ac0('0x6')]==_0x7ac0('0x22')){dials[_0x17056a[_0x7ac0('0x8')]]=_[_0x7ac0('0x1c')](dials[_0x17056a['uniqueid']],_0x17056a);dials[_0x17056a[_0x7ac0('0x8')]][_0x7ac0('0x23')]=utils['now']();dials[_0x17056a['uniqueid']]['lastevent']=_0x7ac0('0x24');utils[_0x7ac0('0x17')](util[_0x7ac0('0x2')](_0x7ac0('0x25'),_0x17056a[_0x7ac0('0x8')],_0x17056a['dialstatus'],dials[_0x17056a[_0x7ac0('0x8')]]['answertime']));}else{utils['info'](util[_0x7ac0('0x2')](_0x7ac0('0x26'),_0x17056a[_0x7ac0('0x8')],_0x17056a[_0x7ac0('0x6')]));}}}catch(_0x444b2c){utils[_0x7ac0('0x19')](util['format'](_0x7ac0('0x27'),_0x17056a[_0x7ac0('0x8')]),_0x444b2c);}};exports['hangup']=function(_0x240712){try{if(!_[_0x7ac0('0x14')](dials[_0x240712['uniqueid']])){utils[_0x7ac0('0xa')](util[_0x7ac0('0x2')]('[%s][dials][hangup]',_0x240712[_0x7ac0('0x8')]),_0x240712);utils[_0x7ac0('0x17')](util[_0x7ac0('0x2')](_0x7ac0('0x28'),_0x240712['uniqueid'],_0x240712[_0x7ac0('0x29')],_0x240712[_0x7ac0('0x2a')],_0x240712['cause-txt']));dials[_0x240712[_0x7ac0('0x8')]]=_[_0x7ac0('0x1c')](dials[_0x240712['uniqueid']],{'endtime':utils[_0x7ac0('0x2b')](),'lastevent':_0x7ac0('0x2c')});dials[_0x240712['uniqueid']]['duration']=utils['diffTime'](dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x2d')],dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x20')]);dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x2e')]=utils['diffTime'](dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x23')]||dials[_0x240712[_0x7ac0('0x8')]]['endtime'],dials[_0x240712[_0x7ac0('0x8')]]['starttime']);dials[_0x240712['uniqueid']][_0x7ac0('0x2f')]=dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x23')]?utils[_0x7ac0('0x30')](dials[_0x240712[_0x7ac0('0x8')]][_0x7ac0('0x2d')],dials[_0x240712['uniqueid']][_0x7ac0('0x23')]):0x0;writeDB(dials[_0x240712['uniqueid']]);}}catch(_0x4bd902){utils['error'](util['format'](_0x7ac0('0x31'),_0x240712[_0x7ac0('0x8')]),_0x4bd902);}}; \ No newline at end of file +var _0x9a06=['application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','isNil','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','now','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','uniqueid','channel','connectedlinenum','dialstatus','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s'];(function(_0x125a11,_0x305254){var _0x422646=function(_0x27efdc){while(--_0x27efdc){_0x125a11['push'](_0x125a11['shift']());}};_0x422646(++_0x305254);}(_0x9a06,0x174));var _0x69a0=function(_0x35ab2f,_0x28c7e2){_0x35ab2f=_0x35ab2f-0x0;var _0x49715a=_0x9a06[_0x35ab2f];return _0x49715a;};'use strict';var _=require(_0x69a0('0x0'));var util=require(_0x69a0('0x1'));var utils=require(_0x69a0('0x2'));var dials={};function writeDB(_0x4a01c3){utils['info'](util[_0x69a0('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x4a01c3[_0x69a0('0x4')],_0x4a01c3[_0x69a0('0x5')],_0x4a01c3['dialstring'],_0x4a01c3['calleridnum'],_0x4a01c3[_0x69a0('0x6')],_0x4a01c3[_0x69a0('0x7')]));utils['request']('CreateVoiceDialReport',_0x4a01c3);delete dials[_0x4a01c3[_0x69a0('0x4')]];}exports['newexten']=function(_0xc8f018){try{utils[_0x69a0('0x8')](util[_0x69a0('0x3')](_0x69a0('0x9'),_0xc8f018[_0x69a0('0x4')]),_0xc8f018);utils[_0x69a0('0xa')](util[_0x69a0('0x3')](_0x69a0('0xb'),_0xc8f018[_0x69a0('0x4')],_0xc8f018[_0x69a0('0xc')],_0xc8f018[_0x69a0('0xd')]));if(_0xc8f018[_0x69a0('0xc')][_0x69a0('0xe')]()==_0x69a0('0xf')&&_[_0x69a0('0x10')](_0xc8f018[_0x69a0('0xd')][_0x69a0('0xe')](),_0x69a0('0x11'))){var _0x1425a2=_0xc8f018[_0x69a0('0xd')][_0x69a0('0x12')]('=');dials[_0xc8f018[_0x69a0('0x4')]]={'routeId':_0x1425a2[0x1]};}}catch(_0x33f835){utils[_0x69a0('0x13')](util['format'](_0x69a0('0x9'),_0xc8f018[_0x69a0('0x4')]),_0x33f835);}};exports[_0x69a0('0x14')]=function(_0x28ae69){try{utils[_0x69a0('0x8')](util[_0x69a0('0x3')](_0x69a0('0x15'),_0x28ae69[_0x69a0('0x4')]),_0x28ae69);if(!_['isNil'](_0x28ae69[_0x69a0('0x16')]['outboundrouteid'])){utils[_0x69a0('0xa')](util[_0x69a0('0x3')](_0x69a0('0x17'),_0x28ae69[_0x69a0('0x4')],_0x28ae69[_0x69a0('0x18')]));dials[_0x28ae69['uniqueid']]={'routeId':_0x28ae69[_0x69a0('0x18')]};}}catch(_0x3c610b){utils[_0x69a0('0x13')](util[_0x69a0('0x3')](_0x69a0('0x15'),_0x28ae69[_0x69a0('0x4')]),_0x3c610b);}};exports[_0x69a0('0x19')]=function(_0x380ed5){try{if(!_['isNil'](dials[_0x380ed5['uniqueid']])){utils['debug'](util['format'](_0x69a0('0x1a'),_0x380ed5['uniqueid']),_0x380ed5);dials[_0x380ed5['uniqueid']]=_[_0x69a0('0x1b')](dials[_0x380ed5[_0x69a0('0x4')]],_0x380ed5);dials[_0x380ed5[_0x69a0('0x4')]]['starttime']=utils['now']();dials[_0x380ed5[_0x69a0('0x4')]][_0x69a0('0x1c')]=_0x69a0('0x1d');utils[_0x69a0('0xa')](util[_0x69a0('0x3')](_0x69a0('0x1e'),_0x380ed5[_0x69a0('0x4')],dials[_0x380ed5['uniqueid']][_0x69a0('0x1f')]));}}catch(_0x2d2f33){utils[_0x69a0('0x13')](util[_0x69a0('0x3')](_0x69a0('0x1a'),_0x380ed5[_0x69a0('0x4')]),_0x2d2f33);}};exports[_0x69a0('0x20')]=function(_0x3263bd){try{if(!_[_0x69a0('0x21')](dials[_0x3263bd[_0x69a0('0x4')]])){utils[_0x69a0('0x8')](util[_0x69a0('0x3')](_0x69a0('0x22'),_0x3263bd[_0x69a0('0x4')]),_0x3263bd);dials[_0x3263bd[_0x69a0('0x4')]][_0x69a0('0x7')]=_0x3263bd['dialstatus'];if(_0x3263bd['dialstatus']==_0x69a0('0x23')){dials[_0x3263bd['uniqueid']]=_[_0x69a0('0x1b')](dials[_0x3263bd[_0x69a0('0x4')]],_0x3263bd);dials[_0x3263bd[_0x69a0('0x4')]][_0x69a0('0x24')]=utils['now']();dials[_0x3263bd['uniqueid']]['lastevent']=_0x69a0('0x25');utils['info'](util['format'](_0x69a0('0x26'),_0x3263bd[_0x69a0('0x4')],_0x3263bd['dialstatus'],dials[_0x3263bd[_0x69a0('0x4')]]['answertime']));}else{utils['info'](util[_0x69a0('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3263bd['uniqueid'],_0x3263bd['dialstatus']));}}}catch(_0x3923f2){utils[_0x69a0('0x13')](util[_0x69a0('0x3')]('[%s][dials][dialend]',_0x3263bd[_0x69a0('0x4')]),_0x3923f2);}};exports['hangup']=function(_0x3f7437){try{if(!_[_0x69a0('0x21')](dials[_0x3f7437[_0x69a0('0x4')]])){utils[_0x69a0('0x8')](util['format']('[%s][dials][hangup]',_0x3f7437[_0x69a0('0x4')]),_0x3f7437);utils['info'](util[_0x69a0('0x3')](_0x69a0('0x27'),_0x3f7437['uniqueid'],_0x3f7437['calleridnum'],_0x3f7437[_0x69a0('0x28')],_0x3f7437['cause-txt']));dials[_0x3f7437['uniqueid']]=_['assign'](dials[_0x3f7437[_0x69a0('0x4')]],{'endtime':utils[_0x69a0('0x29')](),'lastevent':_0x69a0('0x2a')});dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x2b')]=utils[_0x69a0('0x2c')](dials[_0x3f7437[_0x69a0('0x4')]]['endtime'],dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x1f')]);dials[_0x3f7437[_0x69a0('0x4')]]['holdtime']=utils['diffTime'](dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x24')]||dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x2d')],dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x1f')]);dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x2e')]=dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x24')]?utils[_0x69a0('0x2c')](dials[_0x3f7437[_0x69a0('0x4')]]['endtime'],dials[_0x3f7437[_0x69a0('0x4')]][_0x69a0('0x24')]):0x0;writeDB(dials[_0x3f7437[_0x69a0('0x4')]]);}}catch(_0x4295fb){utils['error'](util[_0x69a0('0x3')](_0x69a0('0x2f'),_0x3f7437[_0x69a0('0x4')]),_0x4295fb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1670fae..7071ff0 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 _0x27bb=['[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart'];(function(_0x5365ea,_0x2c0d97){var _0x5489f6=function(_0x479d1e){while(--_0x479d1e){_0x5365ea['push'](_0x5365ea['shift']());}};_0x5489f6(++_0x2c0d97);}(_0x27bb,0x120));var _0xb27b=function(_0x5cbd13,_0x2ef183){_0x5cbd13=_0x5cbd13-0x0;var _0x4c80bc=_0x27bb[_0x5cbd13];return _0x4c80bc;};var AsteriskManager=require(_0xb27b('0x0'));var config=require(_0xb27b('0x1'));var utils=require(_0xb27b('0x2'));var util=require(_0xb27b('0x3'));var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xb27b('0x4')][_0xb27b('0x5')],config[_0xb27b('0x4')][_0xb27b('0x6')],!![]);ami[_0xb27b('0x7')]();if(config[_0xb27b('0x8')]&&config[_0xb27b('0x8')][_0xb27b('0x9')]){utils[_0xb27b('0xa')](_0xb27b('0xb'));}else{var agents=require(_0xb27b('0xc'));var calls=require('./calls.controller');var queues=require(_0xb27b('0xd'));var recordings=require('./recordings.controller');var members=require(_0xb27b('0xe'));var dials=require('./dials.controller');var transfers=require(_0xb27b('0xf'));var core=require(_0xb27b('0x10'));ami['on'](_0xb27b('0x11'),core[_0xb27b('0x11')]);ami['on']('shutdown',core[_0xb27b('0x12')]);ami['on'](_0xb27b('0x13'),core[_0xb27b('0x13')]);ami['on']('error',core[_0xb27b('0x14')]);ami['on'](_0xb27b('0x15'),core['close']);ami['on']('managerevent',core[_0xb27b('0x16')]);ami['on'](_0xb27b('0x17'),function(_0x576d3b){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x1a'),_0x576d3b[_0xb27b('0x1b')]),_0x576d3b);members[_0xb27b('0x17')](_0x576d3b);}catch(_0x447b83){utils['error'](util['format'](_0xb27b('0x1a'),_0x576d3b['device']),_0x447b83);}});ami['on']('agentcalled',function(_0x54ec4b){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')]('[%s][index][agentcalled]',_0x54ec4b[_0xb27b('0x1c')]),_0x54ec4b);agents['agentcalled'](_0x54ec4b);}catch(_0x26d6b0){utils[_0xb27b('0x14')](util[_0xb27b('0x19')]('[%s][index][agentcalled]',_0x54ec4b['uniqueid']),_0x26d6b0);}});ami['on'](_0xb27b('0x1d'),function(_0x30351f){try{utils['debug'](util[_0xb27b('0x19')]('[%s][index][agentringnoanswer]',_0x30351f[_0xb27b('0x1c')]),_0x30351f);agents[_0xb27b('0x1d')](_0x30351f);}catch(_0x193c01){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x1e'),_0x30351f[_0xb27b('0x1c')]),_0x193c01);}});ami['on'](_0xb27b('0x1f'),function(_0x5532da){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x20'),_0x5532da['uniqueid']),_0x5532da);agents[_0xb27b('0x1f')](_0x5532da);queues['agentconnect'](_0x5532da);}catch(_0x46accc){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x20'),_0x5532da['uniqueid']),_0x46accc);}});ami['on']('agentcomplete',function(_0x211bd6){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x21'),_0x211bd6[_0xb27b('0x1c')]),_0x211bd6);agents[_0xb27b('0x22')](_0x211bd6);queues['agentcomplete'](_0x211bd6);members['agentcomplete'](_0x211bd6);}catch(_0x3dfe47){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x21'),_0x211bd6[_0xb27b('0x1c')]),_0x3dfe47);}});ami['on']('queuecallerabandon',function(_0x30ee68){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x23'),_0x30ee68[_0xb27b('0x1c')]),_0x30ee68);agents['queuecallerabandon'](_0x30ee68);queues[_0xb27b('0x24')](_0x30ee68);}catch(_0x257f07){utils[_0xb27b('0x14')](util['format'](_0xb27b('0x23'),_0x30ee68[_0xb27b('0x1c')]),_0x257f07);}});ami['on']('queuecallerjoin',function(_0xea1c5b){try{utils['debug'](util[_0xb27b('0x19')](_0xb27b('0x25'),_0xea1c5b[_0xb27b('0x1c')]),_0xea1c5b);queues[_0xb27b('0x26')](_0xea1c5b);recordings[_0xb27b('0x26')](_0xea1c5b);}catch(_0x9c614e){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x25'),_0xea1c5b[_0xb27b('0x1c')]),_0x9c614e);}});ami['on'](_0xb27b('0x27'),function(_0x528195){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x28'),_0x528195[_0xb27b('0x1c')]),_0x528195);queues[_0xb27b('0x27')](_0x528195);}catch(_0x533967){utils['error'](util[_0xb27b('0x19')](_0xb27b('0x28'),_0x528195[_0xb27b('0x1c')]),_0x533967);}});ami['on'](_0xb27b('0x29'),function(_0x9862dc){try{utils['debug'](util[_0xb27b('0x19')](_0xb27b('0x2a'),_0x9862dc[_0xb27b('0x1c')]),_0x9862dc);queues[_0xb27b('0x29')](_0x9862dc);calls['musiconholdstart'](_0x9862dc);}catch(_0x5020fe){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x2a'),_0x9862dc[_0xb27b('0x1c')]),_0x5020fe);}});ami['on'](_0xb27b('0x2b'),function(_0x3312e5){try{utils[_0xb27b('0x18')](util['format']('[%s][index][musiconholdstop]',_0x3312e5['uniqueid']),_0x3312e5);queues[_0xb27b('0x2b')](_0x3312e5);calls[_0xb27b('0x2b')](_0x3312e5);}catch(_0x3ece83){utils[_0xb27b('0x14')](util['format'](_0xb27b('0x2c'),_0x3312e5['uniqueid']),_0x3ece83);}});ami['on'](_0xb27b('0x2d'),function(_0x134517){try{utils[_0xb27b('0x18')](util['format'](_0xb27b('0x2e'),_0x134517[_0xb27b('0x1c')]),_0x134517);calls['newstate'](_0x134517);recordings[_0xb27b('0x2d')](_0x134517);}catch(_0x3fb6ae){utils['error'](util['format'](_0xb27b('0x2e'),_0x134517[_0xb27b('0x1c')]),_0x3fb6ae);}});ami['on'](_0xb27b('0x2f'),function(_0x57028a){try{utils['debug'](util[_0xb27b('0x19')](_0xb27b('0x30'),_0x57028a['uniqueid']),_0x57028a);calls[_0xb27b('0x2f')](_0x57028a);recordings[_0xb27b('0x2f')](_0x57028a);dials[_0xb27b('0x2f')](_0x57028a);agents['hangup'](_0x57028a);queues[_0xb27b('0x2f')](_0x57028a);}catch(_0x2143d4){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x30'),_0x57028a[_0xb27b('0x1c')]),_0x2143d4);}});ami['on']('cdr',function(_0xef2be1){try{utils[_0xb27b('0x18')](util['format'](_0xb27b('0x31'),_0xef2be1[_0xb27b('0x1c')]),_0xef2be1);members[_0xb27b('0x32')](_0xef2be1);}catch(_0x5cdf25){utils['error'](util[_0xb27b('0x19')](_0xb27b('0x31'),_0xef2be1[_0xb27b('0x1c')]),_0x5cdf25);}});ami['on'](_0xb27b('0x33'),function(_0x38cacd){try{utils[_0xb27b('0x18')](util['format'](_0xb27b('0x34'),_0x38cacd['uniqueid']),_0x38cacd);queues['blindtransfer'](_0x38cacd);agents[_0xb27b('0x33')](_0x38cacd);transfers[_0xb27b('0x33')](_0x38cacd);}catch(_0x7ca4f7){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x34'),_0x38cacd[_0xb27b('0x1c')]),_0x7ca4f7);}});ami['on'](_0xb27b('0x35'),function(_0xa46a56){try{utils[_0xb27b('0x18')](util['format']('[%s][index][attendedtransfer]',_0xa46a56[_0xb27b('0x36')]),_0xa46a56);queues[_0xb27b('0x35')](_0xa46a56);transfers[_0xb27b('0x35')](_0xa46a56);agents['attendedtransfer'](_0xa46a56);calls[_0xb27b('0x35')](_0xa46a56);}catch(_0x5a68d8){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x37'),_0xa46a56[_0xb27b('0x36')]),_0x5a68d8);}});ami['on'](_0xb27b('0x38'),function(_0x54f243){try{utils[_0xb27b('0x18')](util['format'](_0xb27b('0x39'),_0x54f243[_0xb27b('0x1c')]),_0x54f243);queues[_0xb27b('0x38')](_0x54f243);recordings[_0xb27b('0x38')](_0x54f243);calls['varset'](_0x54f243);dials['varset'](_0x54f243);}catch(_0x5cebd9){utils['error'](util[_0xb27b('0x19')](_0xb27b('0x39'),_0x54f243[_0xb27b('0x1c')]),_0x5cebd9);}});ami['on'](_0xb27b('0x3a'),function(_0x431dfd){try{utils['debug'](util[_0xb27b('0x19')](_0xb27b('0x3b'),_0x431dfd[_0xb27b('0x1c')]),_0x431dfd);calls[_0xb27b('0x3a')](_0x431dfd);recordings[_0xb27b('0x3a')](_0x431dfd);dials[_0xb27b('0x3a')](_0x431dfd);}catch(_0x2c0f05){utils['error'](util[_0xb27b('0x19')]('[%s][index][newexten]',_0x431dfd['uniqueid']),_0x2c0f05);}});ami['on'](_0xb27b('0x3c'),function(_0xb726e4){try{utils[_0xb27b('0x18')](util['format'](_0xb27b('0x3d'),_0xb726e4[_0xb27b('0x1c')]),_0xb726e4);calls['newchannel'](_0xb726e4);recordings[_0xb27b('0x3c')](_0xb726e4);}catch(_0x1df126){utils[_0xb27b('0x14')](util['format'](_0xb27b('0x3d'),_0xb726e4[_0xb27b('0x1c')]),_0x1df126);}});ami['on'](_0xb27b('0x3e'),function(_0x395700){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x3f'),_0x395700[_0xb27b('0x1c')]),_0x395700);dials[_0xb27b('0x3e')](_0x395700);}catch(_0x32b1b5){utils[_0xb27b('0x14')](util[_0xb27b('0x19')](_0xb27b('0x40'),_0x395700[_0xb27b('0x1c')]),_0x32b1b5);}});ami['on']('dialend',function(_0x128d8b){try{utils[_0xb27b('0x18')](util[_0xb27b('0x19')](_0xb27b('0x41'),_0x128d8b[_0xb27b('0x1c')]),_0x128d8b);dials['dialend'](_0x128d8b);}catch(_0x59513c){utils['error'](util[_0xb27b('0x19')]('[%s][index][dialend]',_0x128d8b[_0xb27b('0x1c')]),_0x59513c);}});} \ No newline at end of file +var _0x6f84=['./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','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]','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][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]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x2bdca0,_0x1c2abc){var _0x4ff3d6=function(_0x2b6706){while(--_0x2b6706){_0x2bdca0['push'](_0x2bdca0['shift']());}};_0x4ff3d6(++_0x1c2abc);}(_0x6f84,0x73));var _0x46f8=function(_0x2eefc5,_0x2d5532){_0x2eefc5=_0x2eefc5-0x0;var _0x1e8783=_0x6f84[_0x2eefc5];return _0x1e8783;};var AsteriskManager=require('asterisk-manager');var config=require(_0x46f8('0x0'));var utils=require(_0x46f8('0x1'));var util=require(_0x46f8('0x2'));var ami=new AsteriskManager(config[_0x46f8('0x3')][_0x46f8('0x4')],config[_0x46f8('0x3')]['ip'],config['asterisk']['username'],config[_0x46f8('0x3')]['password'],!![]);ami['keepConnected']();if(config[_0x46f8('0x5')]&&config[_0x46f8('0x5')]['disabled']){utils[_0x46f8('0x6')](_0x46f8('0x7'));}else{var agents=require(_0x46f8('0x8'));var calls=require(_0x46f8('0x9'));var queues=require(_0x46f8('0xa'));var recordings=require(_0x46f8('0xb'));var members=require(_0x46f8('0xc'));var dials=require(_0x46f8('0xd'));var transfers=require(_0x46f8('0xe'));var core=require(_0x46f8('0xf'));ami['on'](_0x46f8('0x10'),core[_0x46f8('0x10')]);ami['on'](_0x46f8('0x11'),core['shutdown']);ami['on'](_0x46f8('0x12'),core[_0x46f8('0x12')]);ami['on'](_0x46f8('0x13'),core[_0x46f8('0x13')]);ami['on'](_0x46f8('0x14'),core[_0x46f8('0x14')]);ami['on'](_0x46f8('0x15'),core[_0x46f8('0x15')]);ami['on'](_0x46f8('0x16'),function(_0x30c9fa){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x19'),_0x30c9fa[_0x46f8('0x1a')]),_0x30c9fa);members[_0x46f8('0x16')](_0x30c9fa);}catch(_0x26836e){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x19'),_0x30c9fa[_0x46f8('0x1a')]),_0x26836e);}});ami['on'](_0x46f8('0x1b'),function(_0xd0bcd0){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')]('[%s][index][agentcalled]',_0xd0bcd0['uniqueid']),_0xd0bcd0);agents[_0x46f8('0x1b')](_0xd0bcd0);}catch(_0x4594be){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x1c'),_0xd0bcd0[_0x46f8('0x1d')]),_0x4594be);}});ami['on'](_0x46f8('0x1e'),function(_0x4cef9f){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')]('[%s][index][agentringnoanswer]',_0x4cef9f[_0x46f8('0x1d')]),_0x4cef9f);agents[_0x46f8('0x1e')](_0x4cef9f);}catch(_0x5b89d4){utils[_0x46f8('0x13')](util['format']('[%s][index][agentringnoanswer]',_0x4cef9f[_0x46f8('0x1d')]),_0x5b89d4);}});ami['on'](_0x46f8('0x1f'),function(_0xb7f5f9){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x20'),_0xb7f5f9['uniqueid']),_0xb7f5f9);agents[_0x46f8('0x1f')](_0xb7f5f9);queues[_0x46f8('0x1f')](_0xb7f5f9);}catch(_0x16ac96){utils['error'](util['format']('[%s][index][agentconnect]',_0xb7f5f9['uniqueid']),_0x16ac96);}});ami['on'](_0x46f8('0x21'),function(_0x44c7df){try{utils[_0x46f8('0x17')](util['format']('[%s][index][agentcomplete]',_0x44c7df[_0x46f8('0x1d')]),_0x44c7df);agents[_0x46f8('0x21')](_0x44c7df);queues['agentcomplete'](_0x44c7df);members[_0x46f8('0x21')](_0x44c7df);}catch(_0x118618){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x22'),_0x44c7df[_0x46f8('0x1d')]),_0x118618);}});ami['on'](_0x46f8('0x23'),function(_0xa2c825){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x24'),_0xa2c825[_0x46f8('0x1d')]),_0xa2c825);agents[_0x46f8('0x23')](_0xa2c825);queues['queuecallerabandon'](_0xa2c825);}catch(_0x3b84a5){utils[_0x46f8('0x13')](util[_0x46f8('0x18')]('[%s][index][queuecallerabandon]',_0xa2c825[_0x46f8('0x1d')]),_0x3b84a5);}});ami['on']('queuecallerjoin',function(_0x865234){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x25'),_0x865234['uniqueid']),_0x865234);queues['queuecallerjoin'](_0x865234);recordings['queuecallerjoin'](_0x865234);}catch(_0x3e1e03){utils[_0x46f8('0x13')](util[_0x46f8('0x18')]('[%s][index][queuecallerjoin]',_0x865234[_0x46f8('0x1d')]),_0x3e1e03);}});ami['on'](_0x46f8('0x26'),function(_0x1e952d){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x27'),_0x1e952d[_0x46f8('0x1d')]),_0x1e952d);queues[_0x46f8('0x26')](_0x1e952d);}catch(_0x14fe12){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x27'),_0x1e952d['uniqueid']),_0x14fe12);}});ami['on'](_0x46f8('0x28'),function(_0x5bb8cc){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x29'),_0x5bb8cc['uniqueid']),_0x5bb8cc);queues[_0x46f8('0x28')](_0x5bb8cc);calls['musiconholdstart'](_0x5bb8cc);}catch(_0x107d5c){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x29'),_0x5bb8cc['uniqueid']),_0x107d5c);}});ami['on']('musiconholdstop',function(_0x57407f){try{utils['debug'](util[_0x46f8('0x18')]('[%s][index][musiconholdstop]',_0x57407f['uniqueid']),_0x57407f);queues['musiconholdstop'](_0x57407f);calls[_0x46f8('0x2a')](_0x57407f);}catch(_0xc218e4){utils[_0x46f8('0x13')](util[_0x46f8('0x18')]('[%s][index][musiconholdstop]',_0x57407f['uniqueid']),_0xc218e4);}});ami['on'](_0x46f8('0x2b'),function(_0x131d8f){try{utils[_0x46f8('0x17')](util['format']('[%s][index][newstate]',_0x131d8f[_0x46f8('0x1d')]),_0x131d8f);calls[_0x46f8('0x2b')](_0x131d8f);recordings[_0x46f8('0x2b')](_0x131d8f);}catch(_0x952755){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x2c'),_0x131d8f['uniqueid']),_0x952755);}});ami['on'](_0x46f8('0x2d'),function(_0x19b602){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x2e'),_0x19b602[_0x46f8('0x1d')]),_0x19b602);calls[_0x46f8('0x2d')](_0x19b602);recordings[_0x46f8('0x2d')](_0x19b602);dials[_0x46f8('0x2d')](_0x19b602);agents[_0x46f8('0x2d')](_0x19b602);queues[_0x46f8('0x2d')](_0x19b602);}catch(_0x38d35f){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x2e'),_0x19b602['uniqueid']),_0x38d35f);}});ami['on'](_0x46f8('0x2f'),function(_0x1edef2){try{utils[_0x46f8('0x17')](util['format'](_0x46f8('0x30'),_0x1edef2[_0x46f8('0x1d')]),_0x1edef2);members[_0x46f8('0x2f')](_0x1edef2);}catch(_0x209eb8){utils[_0x46f8('0x13')](util['format'](_0x46f8('0x30'),_0x1edef2[_0x46f8('0x1d')]),_0x209eb8);}});ami['on']('blindtransfer',function(_0x46a719){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x31'),_0x46a719[_0x46f8('0x1d')]),_0x46a719);queues[_0x46f8('0x32')](_0x46a719);agents[_0x46f8('0x32')](_0x46a719);transfers[_0x46f8('0x32')](_0x46a719);}catch(_0x3c0bd1){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x31'),_0x46a719[_0x46f8('0x1d')]),_0x3c0bd1);}});ami['on'](_0x46f8('0x33'),function(_0x22b6c6){try{utils['debug'](util[_0x46f8('0x18')](_0x46f8('0x34'),_0x22b6c6['origtransfereruniqueid']),_0x22b6c6);queues['attendedtransfer'](_0x22b6c6);transfers[_0x46f8('0x33')](_0x22b6c6);agents['attendedtransfer'](_0x22b6c6);calls['attendedtransfer'](_0x22b6c6);}catch(_0x3924c7){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x34'),_0x22b6c6[_0x46f8('0x35')]),_0x3924c7);}});ami['on'](_0x46f8('0x36'),function(_0x5c0b82){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x37'),_0x5c0b82[_0x46f8('0x1d')]),_0x5c0b82);queues[_0x46f8('0x36')](_0x5c0b82);recordings[_0x46f8('0x36')](_0x5c0b82);calls['varset'](_0x5c0b82);dials[_0x46f8('0x36')](_0x5c0b82);}catch(_0x9b8d04){utils['error'](util['format'](_0x46f8('0x37'),_0x5c0b82[_0x46f8('0x1d')]),_0x9b8d04);}});ami['on'](_0x46f8('0x38'),function(_0x1fd869){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')]('[%s][index][newexten]',_0x1fd869['uniqueid']),_0x1fd869);calls['newexten'](_0x1fd869);recordings[_0x46f8('0x38')](_0x1fd869);dials[_0x46f8('0x38')](_0x1fd869);}catch(_0x14407c){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x39'),_0x1fd869[_0x46f8('0x1d')]),_0x14407c);}});ami['on'](_0x46f8('0x3a'),function(_0xd2e83d){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x3b'),_0xd2e83d['uniqueid']),_0xd2e83d);calls[_0x46f8('0x3a')](_0xd2e83d);recordings[_0x46f8('0x3a')](_0xd2e83d);}catch(_0xe0067c){utils['error'](util[_0x46f8('0x18')](_0x46f8('0x3b'),_0xd2e83d[_0x46f8('0x1d')]),_0xe0067c);}});ami['on'](_0x46f8('0x3c'),function(_0x2b9543){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x3d'),_0x2b9543['uniqueid']),_0x2b9543);dials[_0x46f8('0x3c')](_0x2b9543);}catch(_0x53656a){utils[_0x46f8('0x13')](util[_0x46f8('0x18')]('[%s]dialbegin',_0x2b9543[_0x46f8('0x1d')]),_0x53656a);}});ami['on'](_0x46f8('0x3e'),function(_0x121792){try{utils[_0x46f8('0x17')](util[_0x46f8('0x18')](_0x46f8('0x3f'),_0x121792[_0x46f8('0x1d')]),_0x121792);dials['dialend'](_0x121792);}catch(_0x373c04){utils[_0x46f8('0x13')](util[_0x46f8('0x18')](_0x46f8('0x3f'),_0x121792[_0x46f8('0x1d')]),_0x373c04);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e8d7598..7593def 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 _0xef89=['interface','data2','getUserByInterface','then','membername','name','internal','request','split','error','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','enterAt','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','cdr','channel','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid'];(function(_0x5af1ea,_0x539c04){var _0x1e0919=function(_0x4cedca){while(--_0x4cedca){_0x5af1ea['push'](_0x5af1ea['shift']());}};_0x1e0919(++_0x539c04);}(_0xef89,0xf6));var _0x9ef8=function(_0xffaccf,_0x5d98e0){_0xffaccf=_0xffaccf-0x0;var _0x307fdf=_0xef89[_0xffaccf];return _0x307fdf;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var utils=require(_0x9ef8('0x2'));var members={};var exclude=[_0x9ef8('0x3'),_0x9ef8('0x4')];function writeDB(_0x55687c){utils[_0x9ef8('0x5')](util[_0x9ef8('0x6')](_0x9ef8('0x7'),_0x55687c[_0x9ef8('0x8')],_0x55687c[_0x9ef8('0x9')],_0x55687c['channel'],_0x55687c[_0x9ef8('0xa')],_0x55687c['membername'],_0x55687c['type']));if(_0x55687c['interface']){utils[_0x9ef8('0xb')](_0x55687c[_0x9ef8('0x9')])[_0x9ef8('0xc')](function(_0x2ff4ea){if(_0x2ff4ea){_0x55687c[_0x9ef8('0xd')]=_0x2ff4ea[_0x9ef8('0xe')];_0x55687c[_0x9ef8('0xf')]=_0x2ff4ea['internal'];utils[_0x9ef8('0x10')]('CreateMemberReport',_0x55687c);}else{utils['getUserByName'](_0x55687c[_0x9ef8('0x9')][_0x9ef8('0x11')]('/')[0x1])['then'](function(_0x198a94){if(_0x198a94){_0x55687c[_0x9ef8('0xd')]=_0x198a94[_0x9ef8('0xe')];_0x55687c[_0x9ef8('0xf')]=_0x198a94[_0x9ef8('0xf')];utils[_0x9ef8('0x10')]('CreateMemberReport',_0x55687c);}});}})['catch'](function(_0x1fa362){utils[_0x9ef8('0x12')](util[_0x9ef8('0x6')](_0x9ef8('0x13'),_0x55687c[_0x9ef8('0x8')]),_0x1fa362);});}delete members[_0x55687c[_0x9ef8('0x9')]];}function startsWith(_0x4052ce,_0x146075){return _['some'](_0x4052ce,function(_0x597ad2){return _[_0x9ef8('0x14')](_0x146075,_0x597ad2);});}exports[_0x9ef8('0x15')]=function(_0x147266){try{utils['debug'](util[_0x9ef8('0x6')](_0x9ef8('0x16'),members[_0x147266[_0x9ef8('0x17')]]?members[_0x147266['device']]['uniqueid']:_0x147266[_0x9ef8('0x17')]),_0x147266);utils[_0x9ef8('0x5')](util[_0x9ef8('0x6')](_0x9ef8('0x18'),members[_0x147266['device']]?members[_0x147266['device']][_0x9ef8('0x8')]:_0x147266[_0x9ef8('0x17')],_0x147266[_0x9ef8('0x19')],_0x147266[_0x9ef8('0x17')]));switch(_0x147266['state']){case _0x9ef8('0x1a'):case _0x9ef8('0x1b'):if(!startsWith(exclude,_0x147266[_0x9ef8('0x17')])){members[_0x147266[_0x9ef8('0x17')]]={'channel':'voice','interface':_0x147266[_0x9ef8('0x17')],'type':_0x9ef8('0x1c'),'enterAt':utils[_0x9ef8('0x1d')](),'role':_0x9ef8('0x1e')};}break;case _0x9ef8('0x1f'):if(!_[_0x9ef8('0x20')](members[_0x147266[_0x9ef8('0x17')]])){members[_0x147266[_0x9ef8('0x17')]][_0x9ef8('0x21')]=utils[_0x9ef8('0x1d')]();members[_0x147266['device']]['duration']=utils['diffTime'](members[_0x147266[_0x9ef8('0x17')]][_0x9ef8('0x21')],members[_0x147266['device']][_0x9ef8('0x22')]);if(members[_0x147266['device']][_0x9ef8('0x8')]){writeDB(members[_0x147266[_0x9ef8('0x17')]]);}}break;default:break;}}catch(_0x1940ff){utils[_0x9ef8('0x12')](util[_0x9ef8('0x6')]('[%s][members][devicestatechange]',members[_0x147266['device']]?members[_0x147266[_0x9ef8('0x17')]][_0x9ef8('0x8')]:_0x147266[_0x9ef8('0x17')]),_0x1940ff);}};exports[_0x9ef8('0x23')]=function(_0xa35792){try{if(!_['isNil'](members[_0xa35792[_0x9ef8('0x9')]])){utils[_0x9ef8('0x24')](util[_0x9ef8('0x6')]('[%s][members][agentcomplete]',_0xa35792['uniqueid']),_0xa35792);utils[_0x9ef8('0x5')](util[_0x9ef8('0x6')](_0x9ef8('0x25'),_0xa35792[_0x9ef8('0x8')],_0xa35792['interface'],_0xa35792['queue']));members[_0xa35792[_0x9ef8('0x9')]]=_[_0x9ef8('0x26')](members[_0xa35792[_0x9ef8('0x9')]],{'data4':_0xa35792[_0x9ef8('0x27')],'uniqueid':_0xa35792[_0x9ef8('0x8')]});}}catch(_0x45fec3){utils[_0x9ef8('0x12')](util['format'](_0x9ef8('0x28'),_0xa35792[_0x9ef8('0x8')]),_0x45fec3);}};exports[_0x9ef8('0x29')]=function(_0x59038c){try{utils['debug'](util[_0x9ef8('0x6')]('[%s][members][cdr]',_0x59038c[_0x9ef8('0x8')]),_0x59038c);if(_0x59038c[_0x9ef8('0x2a')]){var _0x842db2=_0x59038c[_0x9ef8('0x2a')][_0x9ef8('0x11')]('-')[0x0];if(!_[_0x9ef8('0x20')](members[_0x842db2])){members[_0x842db2]=_[_0x9ef8('0x26')](members[_0x842db2],{'data1':members[_0x842db2][_0x9ef8('0x2b')]||_0x59038c[_0x9ef8('0x2c')],'data2':members[_0x842db2]['data2']||_0x59038c[_0x9ef8('0x2d')],'data3':members[_0x842db2][_0x9ef8('0x2e')]||_0x59038c[_0x9ef8('0x2f')],'uniqueid':members[_0x842db2]['uniqueid']||_0x59038c[_0x9ef8('0x8')]});utils[_0x9ef8('0x5')](util[_0x9ef8('0x6')](_0x9ef8('0x30'),_0x59038c['uniqueid'],members[_0x842db2][_0x9ef8('0x2b')],members[_0x842db2][_0x9ef8('0xa')],members[_0x842db2]['data3']));if(members[_0x842db2][_0x9ef8('0x21')]){writeDB(members[_0x842db2]);}}}if(_0x59038c[_0x9ef8('0x31')]){var _0x4dee82=_0x59038c[_0x9ef8('0x31')]['split']('-')[0x0];if(!_[_0x9ef8('0x20')](members[_0x4dee82])){members[_0x4dee82]=_[_0x9ef8('0x26')](members[_0x4dee82],{'data1':members[_0x4dee82][_0x9ef8('0x2b')]||_0x59038c[_0x9ef8('0x2c')],'data2':members[_0x4dee82][_0x9ef8('0xa')]||_0x59038c[_0x9ef8('0x2d')],'data3':members[_0x4dee82][_0x9ef8('0x2e')]||_0x59038c[_0x9ef8('0x2f')],'uniqueid':members[_0x4dee82][_0x9ef8('0x8')]||_0x59038c[_0x9ef8('0x8')]});utils[_0x9ef8('0x5')](util[_0x9ef8('0x6')](_0x9ef8('0x30'),_0x59038c[_0x9ef8('0x8')],members[_0x4dee82][_0x9ef8('0x2b')],members[_0x4dee82][_0x9ef8('0xa')],members[_0x4dee82][_0x9ef8('0x2e')]));if(members[_0x4dee82]['exitAt']){writeDB(members[_0x4dee82]);}}}}catch(_0xd35cd8){utils['error'](util[_0x9ef8('0x6')](_0x9ef8('0x32'),_0x59038c[_0x9ef8('0x8')]),_0xd35cd8);}}; \ No newline at end of file +var _0x567b=['[%s][members][cdr]','data1','type','data3','destination','destinationchannel','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','internal','split','request','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','debug','queue','assign','[%s][members][agentcomplete]','cdr'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x567b,0x6e));var _0xb567=function(_0x70fb53,_0x22fd86){_0x70fb53=_0x70fb53-0x0;var _0x17d854=_0x567b[_0x70fb53];return _0x17d854;};'use strict';var _=require(_0xb567('0x0'));var util=require('util');var utils=require(_0xb567('0x1'));var members={};var exclude=[_0xb567('0x2'),_0xb567('0x3')];function writeDB(_0x37dfd4){utils['info'](util[_0xb567('0x4')](_0xb567('0x5'),_0x37dfd4[_0xb567('0x6')],_0x37dfd4[_0xb567('0x7')],_0x37dfd4[_0xb567('0x8')],_0x37dfd4[_0xb567('0x9')],_0x37dfd4[_0xb567('0xa')],_0x37dfd4['type']));if(_0x37dfd4[_0xb567('0x7')]){utils[_0xb567('0xb')](_0x37dfd4[_0xb567('0x7')])[_0xb567('0xc')](function(_0x2f725e){if(_0x2f725e){_0x37dfd4[_0xb567('0xa')]=_0x2f725e[_0xb567('0xd')];_0x37dfd4['internal']=_0x2f725e[_0xb567('0xe')];utils['request']('CreateMemberReport',_0x37dfd4);}else{utils['getUserByName'](_0x37dfd4[_0xb567('0x7')][_0xb567('0xf')]('/')[0x1])['then'](function(_0xfcbdbc){if(_0xfcbdbc){_0x37dfd4[_0xb567('0xa')]=_0xfcbdbc[_0xb567('0xd')];_0x37dfd4[_0xb567('0xe')]=_0xfcbdbc[_0xb567('0xe')];utils[_0xb567('0x10')](_0xb567('0x11'),_0x37dfd4);}});}})[_0xb567('0x12')](function(_0xea777c){utils[_0xb567('0x13')](util[_0xb567('0x4')](_0xb567('0x14'),_0x37dfd4[_0xb567('0x6')]),_0xea777c);});}delete members[_0x37dfd4[_0xb567('0x7')]];}function startsWith(_0xa3a845,_0x247266){return _[_0xb567('0x15')](_0xa3a845,function(_0xaaea8){return _[_0xb567('0x16')](_0x247266,_0xaaea8);});}exports[_0xb567('0x17')]=function(_0x48c332){try{utils['debug'](util[_0xb567('0x4')]('[%s][members][devicestatechange]',members[_0x48c332[_0xb567('0x18')]]?members[_0x48c332[_0xb567('0x18')]]['uniqueid']:_0x48c332[_0xb567('0x18')]),_0x48c332);utils[_0xb567('0x19')](util[_0xb567('0x4')](_0xb567('0x1a'),members[_0x48c332[_0xb567('0x18')]]?members[_0x48c332['device']][_0xb567('0x6')]:_0x48c332[_0xb567('0x18')],_0x48c332[_0xb567('0x1b')],_0x48c332[_0xb567('0x18')]));switch(_0x48c332[_0xb567('0x1b')]){case _0xb567('0x1c'):case'BUSY':if(!startsWith(exclude,_0x48c332[_0xb567('0x18')])){members[_0x48c332[_0xb567('0x18')]]={'channel':'voice','interface':_0x48c332[_0xb567('0x18')],'type':_0xb567('0x1d'),'enterAt':utils[_0xb567('0x1e')](),'role':'agent'};}break;case _0xb567('0x1f'):if(!_[_0xb567('0x20')](members[_0x48c332[_0xb567('0x18')]])){members[_0x48c332['device']][_0xb567('0x21')]=utils[_0xb567('0x1e')]();members[_0x48c332['device']][_0xb567('0x22')]=utils[_0xb567('0x23')](members[_0x48c332[_0xb567('0x18')]][_0xb567('0x21')],members[_0x48c332[_0xb567('0x18')]][_0xb567('0x24')]);if(members[_0x48c332[_0xb567('0x18')]]['uniqueid']){writeDB(members[_0x48c332[_0xb567('0x18')]]);}}break;default:break;}}catch(_0x3499fb){utils[_0xb567('0x13')](util['format'](_0xb567('0x25'),members[_0x48c332[_0xb567('0x18')]]?members[_0x48c332[_0xb567('0x18')]]['uniqueid']:_0x48c332[_0xb567('0x18')]),_0x3499fb);}};exports['agentcomplete']=function(_0x69ad29){try{if(!_[_0xb567('0x20')](members[_0x69ad29[_0xb567('0x7')]])){utils[_0xb567('0x26')](util[_0xb567('0x4')]('[%s][members][agentcomplete]',_0x69ad29[_0xb567('0x6')]),_0x69ad29);utils[_0xb567('0x19')](util[_0xb567('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x69ad29['uniqueid'],_0x69ad29[_0xb567('0x7')],_0x69ad29[_0xb567('0x27')]));members[_0x69ad29['interface']]=_[_0xb567('0x28')](members[_0x69ad29[_0xb567('0x7')]],{'data4':_0x69ad29[_0xb567('0x27')],'uniqueid':_0x69ad29['uniqueid']});}}catch(_0x50b6b1){utils[_0xb567('0x13')](util[_0xb567('0x4')](_0xb567('0x29'),_0x69ad29[_0xb567('0x6')]),_0x50b6b1);}};exports[_0xb567('0x2a')]=function(_0x5565ae){try{utils[_0xb567('0x26')](util['format'](_0xb567('0x2b'),_0x5565ae[_0xb567('0x6')]),_0x5565ae);if(_0x5565ae[_0xb567('0x8')]){var _0x14534f=_0x5565ae[_0xb567('0x8')][_0xb567('0xf')]('-')[0x0];if(!_[_0xb567('0x20')](members[_0x14534f])){members[_0x14534f]=_[_0xb567('0x28')](members[_0x14534f],{'data1':members[_0x14534f][_0xb567('0x2c')]||_0x5565ae[_0xb567('0x2d')],'data2':members[_0x14534f][_0xb567('0x9')]||_0x5565ae['source'],'data3':members[_0x14534f][_0xb567('0x2e')]||_0x5565ae[_0xb567('0x2f')],'uniqueid':members[_0x14534f][_0xb567('0x6')]||_0x5565ae[_0xb567('0x6')]});utils['info'](util[_0xb567('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5565ae[_0xb567('0x6')],members[_0x14534f][_0xb567('0x2c')],members[_0x14534f]['data2'],members[_0x14534f][_0xb567('0x2e')]));if(members[_0x14534f][_0xb567('0x21')]){writeDB(members[_0x14534f]);}}}if(_0x5565ae[_0xb567('0x30')]){var _0x230097=_0x5565ae['destinationchannel'][_0xb567('0xf')]('-')[0x0];if(!_['isNil'](members[_0x230097])){members[_0x230097]=_[_0xb567('0x28')](members[_0x230097],{'data1':members[_0x230097][_0xb567('0x2c')]||_0x5565ae['type'],'data2':members[_0x230097][_0xb567('0x9')]||_0x5565ae[_0xb567('0x31')],'data3':members[_0x230097][_0xb567('0x2e')]||_0x5565ae[_0xb567('0x2f')],'uniqueid':members[_0x230097][_0xb567('0x6')]||_0x5565ae[_0xb567('0x6')]});utils[_0xb567('0x19')](util['format'](_0xb567('0x32'),_0x5565ae[_0xb567('0x6')],members[_0x230097]['data1'],members[_0x230097][_0xb567('0x9')],members[_0x230097]['data3']));if(members[_0x230097]['exitAt']){writeDB(members[_0x230097]);}}}}catch(_0xa76e77){utils[_0xb567('0x13')](util['format'](_0xb567('0x2b'),_0x5565ae[_0xb567('0x6')]),_0xa76e77);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 16ff548..226631c 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 _0x08e4=['secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','holdtime','mohtime','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','hangup','isNil','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','[%s][queues][hangup]','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','accountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x5bcfb5,_0x5e48ff){var _0x5d96d3=function(_0x34b969){while(--_0x34b969){_0x5bcfb5['push'](_0x5bcfb5['shift']());}};_0x5d96d3(++_0x5e48ff);}(_0x08e4,0xda));var _0x408e=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0x08e4[_0x57e196];return _0x5941ab;};'use strict';var _=require(_0x408e('0x0'));var util=require(_0x408e('0x1'));var utils=require(_0x408e('0x2'));var queues={};function writeDB(_0x46bbec){utils[_0x408e('0x3')](util[_0x408e('0x4')](_0x408e('0x5'),_0x46bbec[_0x408e('0x6')],_0x46bbec['channel'],_0x46bbec[_0x408e('0x7')],_0x46bbec[_0x408e('0x8')],_0x46bbec['calleridnum'],_0x46bbec['accountcode'],_0x46bbec[_0x408e('0x9')]));if(_0x46bbec[_0x408e('0x7')]){utils[_0x408e('0xa')](_0x46bbec['queue'])[_0x408e('0xb')](function(_0xb0dca9){if(_0xb0dca9){_0x46bbec[_0x408e('0xc')]=_0xb0dca9['type'];}utils[_0x408e('0xd')](_0x408e('0xe'),_0x46bbec);});}else{utils['request'](_0x408e('0xe'),_0x46bbec);}if(_0x46bbec[_0x408e('0xf')]){delete queues[_0x46bbec['transfereduniqueid']];}else{delete queues[_0x46bbec[_0x408e('0x6')]];}}exports[_0x408e('0x10')]=function(_0x57ec0f){try{utils[_0x408e('0x11')](util[_0x408e('0x4')](_0x408e('0x12'),_0x57ec0f[_0x408e('0x6')]),_0x57ec0f);utils[_0x408e('0x3')](util['format'](_0x408e('0x13'),_0x57ec0f[_0x408e('0x6')],_0x57ec0f[_0x408e('0x7')],_0x57ec0f['position']));queues[_0x57ec0f['uniqueid']]=_[_0x408e('0x14')](_0x57ec0f,{'originalposition':_0x57ec0f['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3fd630){utils['error'](util[_0x408e('0x4')](_0x408e('0x12'),_0x57ec0f[_0x408e('0x6')]),_0x3fd630);}};exports[_0x408e('0x15')]=function(_0x5bb283){try{if(!_[_0x408e('0x16')](queues[_0x5bb283[_0x408e('0x6')]])){utils[_0x408e('0x11')](util['format']('[%s][queues][hangup]',_0x5bb283[_0x408e('0x6')]),_0x5bb283);if(queues[_0x5bb283[_0x408e('0x6')]]['queuecallerleaveAt']){if(!queues[_0x5bb283['uniqueid']][_0x408e('0x17')]&&!queues[_0x5bb283[_0x408e('0x6')]]['queuecallerexit']){queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0x18')]=!![];queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0x19')]=utils[_0x408e('0x1a')]();queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0x9')]='COMPLETEDBYAGENT';}utils[_0x408e('0x3')](util[_0x408e('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x5bb283[_0x408e('0x6')],queues[_0x5bb283['uniqueid']]['name'],queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0x9')]));writeDB(queues[_0x5bb283['uniqueid']]);}else if(queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0xf')]){utils['info'](util[_0x408e('0x4')](_0x408e('0x1b'),_0x5bb283[_0x408e('0x6')],queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0x1c')],queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0xf')]));queues[queues[_0x5bb283[_0x408e('0x6')]][_0x408e('0xf')]]=queues[_0x5bb283[_0x408e('0x6')]];queues[queues[_0x5bb283['uniqueid']][_0x408e('0xf')]][_0x408e('0x1d')]=0x2;delete queues[_0x5bb283[_0x408e('0x6')]];}}}catch(_0x3f6cb9){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x1f'),_0x5bb283['uniqueid']),_0x3f6cb9);}};exports[_0x408e('0x20')]=function(_0xe10635){try{utils[_0x408e('0x11')](util[_0x408e('0x4')]('[%s][queues][varset]',_0xe10635['uniqueid']),_0xe10635);if(!_['isNil'](_0xe10635[_0x408e('0x21')][_0x408e('0x22')])&&_0xe10635[_0x408e('0x23')][_0x408e('0x24')]()!==_0x408e('0x25')){if(!_[_0x408e('0x16')](queues[_0xe10635[_0x408e('0x6')]])){queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x26')]=null;queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x27')]=!![];queues[_0xe10635['uniqueid']][_0x408e('0x28')]=utils['now']();queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x9')]=_0xe10635['value'][_0x408e('0x24')]();utils[_0x408e('0x3')](util['format'](_0x408e('0x29'),_0xe10635[_0x408e('0x6')],queues[_0xe10635[_0x408e('0x6')]]['name'],_0xe10635[_0x408e('0x23')],queues[_0xe10635[_0x408e('0x6')]]['queuecallerexitreason']));writeDB(queues[_0xe10635[_0x408e('0x6')]]);}}else if(!_[_0x408e('0x16')](_0xe10635[_0x408e('0x21')][_0x408e('0x2a')])){if(!_[_0x408e('0x16')](queues[_0xe10635[_0x408e('0x6')]])&&!queues[_0xe10635['uniqueid']][_0x408e('0x17')]){queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0xe10635['uniqueid']]['queuecallerabandonAt']=null;queues[_0xe10635[_0x408e('0x6')]]['queuecallerexit']=!![];queues[_0xe10635[_0x408e('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0xe10635[_0x408e('0x6')]]['queuecallerexitreason']=_0x408e('0x2b');utils['info'](util[_0x408e('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xe10635[_0x408e('0x6')],queues[_0xe10635['uniqueid']][_0x408e('0x1c')],_0xe10635[_0x408e('0x23')],queues[_0xe10635[_0x408e('0x6')]][_0x408e('0x9')]));}}}catch(_0x53112d){utils['error'](util[_0x408e('0x4')]('[%s][queues][varset]',_0xe10635['uniqueid']),_0x53112d);}};exports[_0x408e('0x17')]=function(_0x59d3d9){try{if(!_[_0x408e('0x16')](queues[_0x59d3d9[_0x408e('0x6')]])){utils[_0x408e('0x11')](util[_0x408e('0x4')](_0x408e('0x2c'),_0x59d3d9[_0x408e('0x6')]),_0x59d3d9);queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x27')]=![];queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x28')]=null;queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x17')]=!![];queues[_0x59d3d9['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x9')]=_0x408e('0x2d');utils['info'](util[_0x408e('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x59d3d9[_0x408e('0x6')],queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x1c')],queues[_0x59d3d9[_0x408e('0x6')]][_0x408e('0x9')]));}}catch(_0x32ccc7){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x2c'),_0x59d3d9[_0x408e('0x6')]),_0x32ccc7);}};exports['queuecallerleave']=function(_0x138f9e){try{if(!_[_0x408e('0x16')](queues[_0x138f9e[_0x408e('0x6')]])){utils[_0x408e('0x11')](util[_0x408e('0x4')](_0x408e('0x2e'),_0x138f9e[_0x408e('0x6')]),_0x138f9e);utils[_0x408e('0x3')](util[_0x408e('0x4')](_0x408e('0x2f'),_0x138f9e[_0x408e('0x6')],queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x1c')],_0x138f9e[_0x408e('0x30')],_0x138f9e[_0x408e('0x31')]));queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x32')]=!![];queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x33')]=utils[_0x408e('0x1a')]();queues[_0x138f9e[_0x408e('0x6')]]['holdtime']=utils[_0x408e('0x34')](queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x33')],queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x35')]);queues[_0x138f9e[_0x408e('0x6')]]['position']=_0x138f9e['position'];queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x36')]=_0x138f9e['count'];queues[_0x138f9e[_0x408e('0x6')]][_0x408e('0x30')]=_0x138f9e[_0x408e('0x30')];queues[_0x138f9e[_0x408e('0x6')]]['connectedlinename']=_0x138f9e[_0x408e('0x31')];}}catch(_0x30cf51){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x2e'),_0x138f9e['uniqueid']),_0x30cf51);}};exports[_0x408e('0x37')]=function(_0x479742){try{if(!_[_0x408e('0x16')](queues[_0x479742[_0x408e('0x6')]])){utils[_0x408e('0x11')](util['format'](_0x408e('0x38'),_0x479742[_0x408e('0x6')]),_0x479742);utils[_0x408e('0x3')](util[_0x408e('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x479742[_0x408e('0x6')],queues[_0x479742['uniqueid']][_0x408e('0x1c')],_0x479742[_0x408e('0x39')],_0x479742[_0x408e('0x3a')]));queues[_0x479742[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0x479742[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0x479742[_0x408e('0x6')]][_0x408e('0x26')]=null;queues[_0x479742[_0x408e('0x6')]]['queuecallerexit']=![];queues[_0x479742[_0x408e('0x6')]]['queuecallerexitreason']=null;queues[_0x479742[_0x408e('0x6')]][_0x408e('0x28')]=null;queues[_0x479742[_0x408e('0x6')]]['assigned']=!![];queues[_0x479742[_0x408e('0x6')]][_0x408e('0x3b')]=_0x479742['destaccountcode'];queues[_0x479742[_0x408e('0x6')]]['lastAssignedTo']=_0x479742[_0x408e('0x39')];}}catch(_0x1d33ca){utils[_0x408e('0x1e')](util['format'](_0x408e('0x38'),_0x479742[_0x408e('0x6')]),_0x1d33ca);}};exports[_0x408e('0x3c')]=function(_0x1080c5){try{if(!_[_0x408e('0x16')](queues[_0x1080c5['uniqueid']])){if(queues[_0x1080c5['uniqueid']]['queuecallerleaveAt']){utils['debug'](util['format'](_0x408e('0x3d'),_0x1080c5[_0x408e('0x6')]),_0x1080c5);queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x17')]=![];queues[_0x1080c5[_0x408e('0x6')]]['queuecallerabandonAt']=null;queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x27')]=![];queues[_0x1080c5[_0x408e('0x6')]]['queuecallerexitAt']=null;queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x3e')]=!![];queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x8')]=_0x1080c5[_0x408e('0x39')];queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x18')]=!![];queues[_0x1080c5[_0x408e('0x6')]]['queuecallercompleteAt']=utils[_0x408e('0x1a')]();if(_0x1080c5['reason']==_0x408e('0x3f')){if(!queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x3f')]){queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x9')]='TRANSFER';}}else{queues[_0x1080c5['uniqueid']][_0x408e('0x9')]=_0x408e('0x40')+_0x1080c5[_0x408e('0x41')][_0x408e('0x24')]();}utils[_0x408e('0x3')](util[_0x408e('0x4')](_0x408e('0x42'),_0x1080c5[_0x408e('0x6')],queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x1c')],_0x1080c5[_0x408e('0x39')],queues[_0x1080c5[_0x408e('0x6')]][_0x408e('0x9')]));writeDB(queues[_0x1080c5[_0x408e('0x6')]]);}}}catch(_0x51954f){utils[_0x408e('0x1e')](util['format'](_0x408e('0x3d'),_0x1080c5[_0x408e('0x6')]),_0x51954f);}};exports[_0x408e('0x43')]=function(_0x1458c1){try{if(!_[_0x408e('0x16')](queues[_0x1458c1[_0x408e('0x44')]])){utils[_0x408e('0x11')](util[_0x408e('0x4')](_0x408e('0x45'),_0x1458c1[_0x408e('0x6')]),_0x1458c1);queues[_0x1458c1[_0x408e('0x44')]][_0x408e('0x3f')]=!![];queues[_0x1458c1['transfereeuniqueid']]['transfertype']=_0x408e('0x46');queues[_0x1458c1[_0x408e('0x44')]][_0x408e('0x47')]=_0x1458c1[_0x408e('0x48')];queues[_0x1458c1['transfereeuniqueid']]['transferuniqueid']=_0x1458c1[_0x408e('0x44')];queues[_0x1458c1[_0x408e('0x44')]][_0x408e('0x9')]=_0x408e('0x49');utils[_0x408e('0x3')](util[_0x408e('0x4')](_0x408e('0x4a'),_0x1458c1[_0x408e('0x6')],queues[_0x1458c1[_0x408e('0x44')]]['name'],_0x1458c1[_0x408e('0x44')],_0x1458c1[_0x408e('0x48')]));}}catch(_0x225ff2){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x45'),_0x1458c1[_0x408e('0x6')]),_0x225ff2);}};exports[_0x408e('0x4b')]=function(_0x200127){try{utils[_0x408e('0x11')](util['format'](_0x408e('0x4c'),_0x200127[_0x408e('0x4d')]),_0x200127);if(_0x200127[_0x408e('0x4d')]==_0x200127[_0x408e('0x4e')]){if(!_[_0x408e('0x16')](queues[_0x200127[_0x408e('0x4f')]])){utils['info'](util[_0x408e('0x4')](_0x408e('0x50'),_0x200127[_0x408e('0x4d')],queues[_0x200127[_0x408e('0x4f')]][_0x408e('0x1c')],_0x200127[_0x408e('0x51')]));queues[_0x200127[_0x408e('0x4f')]][_0x408e('0x3f')]=!![];queues[_0x200127['secondtransfererlinkedid']][_0x408e('0x52')]=_0x408e('0x53');queues[_0x200127[_0x408e('0x4f')]]['transferexten']=_0x200127[_0x408e('0x51')];queues[_0x200127[_0x408e('0x4f')]][_0x408e('0x54')]=_0x200127[_0x408e('0x4d')];queues[_0x200127['secondtransfererlinkedid']][_0x408e('0x9')]=_0x408e('0x55');}if(!_[_0x408e('0x16')](queues[_0x200127['origtransfererlinkedid']])){if(_0x200127['transfereelinkedid']&&queues[_0x200127['transfereelinkedid']]){queues[_0x200127[_0x408e('0x56')]]['queuecallerenterreason']=0x1;queues[_0x200127[_0x408e('0x44')]]=_[_0x408e('0x57')](queues[_0x200127['transfereelinkedid']]);queues[_0x200127[_0x408e('0x44')]][_0x408e('0xf')]=_0x200127['transfertargetuniqueid'];queues[_0x200127['transfereeuniqueid']][_0x408e('0x1d')]=0x2;queues[_0x200127['transfereeuniqueid']][_0x408e('0x58')]=queues[_0x200127[_0x408e('0x4f')]][_0x408e('0x58')];queues[_0x200127[_0x408e('0x44')]][_0x408e('0x59')]=queues[_0x200127[_0x408e('0x4f')]][_0x408e('0x59')];queues[_0x200127['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x408e('0x1a')]();queues[_0x200127[_0x408e('0x44')]][_0x408e('0x33')]=utils[_0x408e('0x1a')]();queues[_0x200127[_0x408e('0x44')]]['holdtime']=0x0;queues[_0x200127[_0x408e('0x44')]]['mohtime']=0x0;utils[_0x408e('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x200127[_0x408e('0x4d')],queues[_0x200127[_0x408e('0x44')]][_0x408e('0x1c')],queues[_0x200127[_0x408e('0x44')]][_0x408e('0x58')],queues[_0x200127[_0x408e('0x44')]][_0x408e('0x59')]));}else{utils['info'](util[_0x408e('0x4')](_0x408e('0x5a'),_0x200127[_0x408e('0x4d')],queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x1c')],_0x200127[_0x408e('0x4f')]));queues[_0x200127[_0x408e('0x4e')]][_0x408e('0xf')]=_0x200127['secondtransfererlinkedid'];}}}else if(_0x200127[_0x408e('0x5b')]==_0x200127[_0x408e('0x4f')]){if(!_[_0x408e('0x16')](queues[_0x200127['origtransfererlinkedid']])){utils['info'](util['format'](_0x408e('0x5c'),_0x200127['origtransfereruniqueid'],queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x1c')],_0x200127['secondtransfereruniqueid'],_0x200127[_0x408e('0x5d')]));queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x3f')]=!![];queues[_0x200127[_0x408e('0x4e')]]['transfertype']='ATTENDED';queues[_0x200127['origtransfererlinkedid']][_0x408e('0x47')]=_0x200127[_0x408e('0x5d')];queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x54')]=_0x200127[_0x408e('0x5b')];queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x9')]=_0x408e('0x55');}if(!_[_0x408e('0x16')](queues[_0x200127['secondtransfererlinkedid']])){if(_0x200127['transfertargetlinkedid']&&queues[_0x200127['transfertargetlinkedid']]){queues[_0x200127[_0x408e('0x5e')]][_0x408e('0x1d')]=0x1;queues[_0x200127[_0x408e('0x5f')]]=_[_0x408e('0x57')](queues[_0x200127[_0x408e('0x5e')]]);queues[_0x200127[_0x408e('0x5f')]]['transfereduniqueid']=_0x200127[_0x408e('0x5f')];queues[_0x200127[_0x408e('0x5f')]]['queuecallerenterreason']=0x2;queues[_0x200127['transfertargetuniqueid']]['calleridnum']=queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x58')];queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x59')]=queues[_0x200127[_0x408e('0x4e')]][_0x408e('0x59')];queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x35')]=utils[_0x408e('0x1a')]();queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x33')]=utils[_0x408e('0x1a')]();queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x60')]=0x0;queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x61')]=0x0;utils[_0x408e('0x3')](util[_0x408e('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x200127[_0x408e('0x4d')],queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x1c')],queues[_0x200127[_0x408e('0x5f')]][_0x408e('0xf')],queues[_0x200127[_0x408e('0x5f')]][_0x408e('0x58')],queues[_0x200127[_0x408e('0x5f')]]['calleridname']));}else{utils[_0x408e('0x3')](util[_0x408e('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x200127[_0x408e('0x4d')],queues[_0x200127[_0x408e('0x4f')]]['name'],_0x200127[_0x408e('0x4e')]));queues[_0x200127['secondtransfererlinkedid']][_0x408e('0xf')]=_0x200127[_0x408e('0x4e')];}}}}catch(_0x41ad20){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x4c'),_0x200127[_0x408e('0x4d')]),_0x41ad20);}};exports[_0x408e('0x62')]=function(_0x386150){try{if(!_[_0x408e('0x16')](queues[_0x386150[_0x408e('0x6')]])){utils[_0x408e('0x11')](util['format']('[%s][queues][musiconholdstart]',_0x386150[_0x408e('0x6')]),_0x386150);queues[_0x386150['uniqueid']][_0x408e('0x63')]=utils[_0x408e('0x1a')]();utils[_0x408e('0x3')](util[_0x408e('0x4')](_0x408e('0x64'),_0x386150[_0x408e('0x6')],queues[_0x386150[_0x408e('0x6')]][_0x408e('0x1c')],queues[_0x386150[_0x408e('0x6')]][_0x408e('0x63')]));}}catch(_0x4680bd){utils['error'](util[_0x408e('0x4')](_0x408e('0x65'),_0x386150['uniqueid']),_0x4680bd);}};exports['musiconholdstop']=function(_0x39641e){try{if(!_[_0x408e('0x16')](queues[_0x39641e[_0x408e('0x6')]])){if(!_['isNil'](queues[_0x39641e[_0x408e('0x6')]]['musiconholdstartAt'])){utils[_0x408e('0x11')](util[_0x408e('0x4')](_0x408e('0x66'),_0x39641e[_0x408e('0x6')]),_0x39641e);queues[_0x39641e['uniqueid']][_0x408e('0x61')]+=utils[_0x408e('0x34')](utils['now'](),queues[_0x39641e[_0x408e('0x6')]][_0x408e('0x63')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x39641e[_0x408e('0x6')],queues[_0x39641e['uniqueid']][_0x408e('0x1c')],queues[_0x39641e[_0x408e('0x6')]]['mohtime']));delete queues[_0x39641e[_0x408e('0x6')]][_0x408e('0x63')];}}}catch(_0x1b5e57){utils[_0x408e('0x1e')](util[_0x408e('0x4')](_0x408e('0x66'),_0x39641e[_0x408e('0x6')]),_0x1b5e57);}}; \ No newline at end of file +var _0x9943=['connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','origtransfereruniqueid','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','isNil','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','diffTime','count'];(function(_0xa9fde0,_0x11953c){var _0x3961c8=function(_0x556508){while(--_0x556508){_0xa9fde0['push'](_0xa9fde0['shift']());}};_0x3961c8(++_0x11953c);}(_0x9943,0xf2));var _0x3994=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0x9943[_0x3144b3];return _0x2517a9;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3994('0x0'));var queues={};function writeDB(_0x67dd62){utils[_0x3994('0x1')](util[_0x3994('0x2')](_0x3994('0x3'),_0x67dd62[_0x3994('0x4')],_0x67dd62[_0x3994('0x5')],_0x67dd62[_0x3994('0x6')],_0x67dd62[_0x3994('0x7')],_0x67dd62[_0x3994('0x8')],_0x67dd62[_0x3994('0x9')],_0x67dd62['queuecallerexitreason']));if(_0x67dd62['queue']){utils[_0x3994('0xa')](_0x67dd62[_0x3994('0x6')])[_0x3994('0xb')](function(_0x214453){if(_0x214453){_0x67dd62[_0x3994('0xc')]=_0x214453[_0x3994('0xc')];}utils['request'](_0x3994('0xd'),_0x67dd62);});}else{utils['request'](_0x3994('0xd'),_0x67dd62);}if(_0x67dd62[_0x3994('0xe')]){delete queues[_0x67dd62[_0x3994('0xe')]];}else{delete queues[_0x67dd62[_0x3994('0x4')]];}}exports[_0x3994('0xf')]=function(_0x2c0abd){try{utils[_0x3994('0x10')](util[_0x3994('0x2')](_0x3994('0x11'),_0x2c0abd['uniqueid']),_0x2c0abd);utils['info'](util[_0x3994('0x2')](_0x3994('0x12'),_0x2c0abd[_0x3994('0x4')],_0x2c0abd['queue'],_0x2c0abd[_0x3994('0x13')]));queues[_0x2c0abd[_0x3994('0x4')]]=_['assign'](_0x2c0abd,{'originalposition':_0x2c0abd[_0x3994('0x13')],'queuecallerjoinAt':utils[_0x3994('0x14')](),'mohtime':0x0});}catch(_0x441971){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x2c0abd[_0x3994('0x4')]),_0x441971);}};exports[_0x3994('0x15')]=function(_0x28ad0a){try{if(!_['isNil'](queues[_0x28ad0a['uniqueid']])){utils[_0x3994('0x10')](util['format'](_0x3994('0x16'),_0x28ad0a[_0x3994('0x4')]),_0x28ad0a);if(queues[_0x28ad0a[_0x3994('0x4')]][_0x3994('0x17')]){if(!queues[_0x28ad0a['uniqueid']][_0x3994('0x18')]&&!queues[_0x28ad0a[_0x3994('0x4')]][_0x3994('0x19')]){queues[_0x28ad0a[_0x3994('0x4')]][_0x3994('0x1a')]=!![];queues[_0x28ad0a[_0x3994('0x4')]]['queuecallercompleteAt']=utils[_0x3994('0x14')]();queues[_0x28ad0a[_0x3994('0x4')]][_0x3994('0x1b')]=_0x3994('0x1c');}utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x28ad0a['uniqueid'],queues[_0x28ad0a[_0x3994('0x4')]][_0x3994('0x1d')],queues[_0x28ad0a['uniqueid']][_0x3994('0x1b')]));writeDB(queues[_0x28ad0a[_0x3994('0x4')]]);}else if(queues[_0x28ad0a[_0x3994('0x4')]]['transfereduniqueid']){utils[_0x3994('0x1')](util['format'](_0x3994('0x1e'),_0x28ad0a[_0x3994('0x4')],queues[_0x28ad0a['uniqueid']][_0x3994('0x1d')],queues[_0x28ad0a[_0x3994('0x4')]]['transfereduniqueid']));queues[queues[_0x28ad0a['uniqueid']]['transfereduniqueid']]=queues[_0x28ad0a[_0x3994('0x4')]];queues[queues[_0x28ad0a['uniqueid']]['transfereduniqueid']][_0x3994('0x1f')]=0x2;delete queues[_0x28ad0a['uniqueid']];}}}catch(_0x40e5f2){utils['error'](util['format'](_0x3994('0x16'),_0x28ad0a[_0x3994('0x4')]),_0x40e5f2);}};exports[_0x3994('0x20')]=function(_0x46eaf5){try{utils['debug'](util[_0x3994('0x2')](_0x3994('0x21'),_0x46eaf5[_0x3994('0x4')]),_0x46eaf5);if(!_['isNil'](_0x46eaf5[_0x3994('0x22')][_0x3994('0x23')])&&_0x46eaf5[_0x3994('0x24')]['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x46eaf5[_0x3994('0x4')]])){queues[_0x46eaf5[_0x3994('0x4')]]['queuecallerabandon']=![];queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x25')]=null;queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x19')]=!![];queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x26')]=utils['now']();queues[_0x46eaf5[_0x3994('0x4')]]['queuecallerexitreason']=_0x46eaf5['value'][_0x3994('0x27')]();utils[_0x3994('0x1')](util[_0x3994('0x2')](_0x3994('0x28'),_0x46eaf5[_0x3994('0x4')],queues[_0x46eaf5['uniqueid']][_0x3994('0x1d')],_0x46eaf5[_0x3994('0x24')],queues[_0x46eaf5[_0x3994('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x46eaf5[_0x3994('0x4')]]);}}else if(!_['isNil'](_0x46eaf5[_0x3994('0x22')][_0x3994('0x29')])){if(!_[_0x3994('0x2a')](queues[_0x46eaf5[_0x3994('0x4')]])&&!queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x18')]){queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x18')]=![];queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x25')]=null;queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x19')]=!![];queues[_0x46eaf5['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x46eaf5[_0x3994('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x46eaf5['uniqueid'],queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x1d')],_0x46eaf5[_0x3994('0x24')],queues[_0x46eaf5[_0x3994('0x4')]][_0x3994('0x1b')]));}}}catch(_0x2d6e17){utils['error'](util[_0x3994('0x2')](_0x3994('0x21'),_0x46eaf5[_0x3994('0x4')]),_0x2d6e17);}};exports[_0x3994('0x18')]=function(_0x5bfe74){try{if(!_[_0x3994('0x2a')](queues[_0x5bfe74[_0x3994('0x4')]])){utils[_0x3994('0x10')](util[_0x3994('0x2')]('[%s][queues][queuecallerabandon]',_0x5bfe74[_0x3994('0x4')]),_0x5bfe74);queues[_0x5bfe74[_0x3994('0x4')]][_0x3994('0x19')]=![];queues[_0x5bfe74[_0x3994('0x4')]][_0x3994('0x26')]=null;queues[_0x5bfe74['uniqueid']][_0x3994('0x18')]=!![];queues[_0x5bfe74[_0x3994('0x4')]][_0x3994('0x25')]=utils[_0x3994('0x14')]();queues[_0x5bfe74[_0x3994('0x4')]][_0x3994('0x1b')]=_0x3994('0x2b');utils[_0x3994('0x1')](util[_0x3994('0x2')](_0x3994('0x2c'),_0x5bfe74[_0x3994('0x4')],queues[_0x5bfe74[_0x3994('0x4')]][_0x3994('0x1d')],queues[_0x5bfe74['uniqueid']][_0x3994('0x1b')]));}}catch(_0x3e4f6c){utils[_0x3994('0x2d')](util[_0x3994('0x2')]('[%s][queues][queuecallerabandon]',_0x5bfe74[_0x3994('0x4')]),_0x3e4f6c);}};exports[_0x3994('0x2e')]=function(_0x3b94b7){try{if(!_[_0x3994('0x2a')](queues[_0x3b94b7[_0x3994('0x4')]])){utils['debug'](util[_0x3994('0x2')](_0x3994('0x2f'),_0x3b94b7[_0x3994('0x4')]),_0x3b94b7);utils[_0x3994('0x1')](util['format'](_0x3994('0x30'),_0x3b94b7[_0x3994('0x4')],queues[_0x3b94b7[_0x3994('0x4')]][_0x3994('0x1d')],_0x3b94b7['connectedlinenum'],_0x3b94b7[_0x3994('0x31')]));queues[_0x3b94b7['uniqueid']]['queuecallerleave']=!![];queues[_0x3b94b7[_0x3994('0x4')]]['queuecallerleaveAt']=utils[_0x3994('0x14')]();queues[_0x3b94b7[_0x3994('0x4')]]['holdtime']=utils[_0x3994('0x32')](queues[_0x3b94b7[_0x3994('0x4')]][_0x3994('0x17')],queues[_0x3b94b7[_0x3994('0x4')]]['queuecallerjoinAt']);queues[_0x3b94b7[_0x3994('0x4')]]['position']=_0x3b94b7['position'];queues[_0x3b94b7['uniqueid']]['count']=_0x3b94b7[_0x3994('0x33')];queues[_0x3b94b7[_0x3994('0x4')]]['connectedlinenum']=_0x3b94b7[_0x3994('0x34')];queues[_0x3b94b7[_0x3994('0x4')]]['connectedlinename']=_0x3b94b7['connectedlinename'];}}catch(_0xb6da0f){utils['error'](util[_0x3994('0x2')](_0x3994('0x2f'),_0x3b94b7[_0x3994('0x4')]),_0xb6da0f);}};exports[_0x3994('0x35')]=function(_0x400eae){try{if(!_[_0x3994('0x2a')](queues[_0x400eae[_0x3994('0x4')]])){utils['debug'](util[_0x3994('0x2')](_0x3994('0x36'),_0x400eae[_0x3994('0x4')]),_0x400eae);utils[_0x3994('0x1')](util[_0x3994('0x2')](_0x3994('0x37'),_0x400eae[_0x3994('0x4')],queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x1d')],_0x400eae[_0x3994('0x38')],_0x400eae[_0x3994('0x39')]));queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x18')]=![];queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x18')]=![];queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x25')]=null;queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x19')]=![];queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x1b')]=null;queues[_0x400eae[_0x3994('0x4')]]['queuecallerexitAt']=null;queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x3a')]=!![];queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x9')]=_0x400eae[_0x3994('0x39')];queues[_0x400eae[_0x3994('0x4')]][_0x3994('0x7')]=_0x400eae[_0x3994('0x38')];}}catch(_0x25a369){utils['error'](util[_0x3994('0x2')](_0x3994('0x36'),_0x400eae[_0x3994('0x4')]),_0x25a369);}};exports['agentcomplete']=function(_0x43edb1){try{if(!_['isNil'](queues[_0x43edb1[_0x3994('0x4')]])){if(queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x17')]){utils[_0x3994('0x10')](util[_0x3994('0x2')]('[%s][queues][agentcomplete]',_0x43edb1[_0x3994('0x4')]),_0x43edb1);queues[_0x43edb1[_0x3994('0x4')]]['queuecallerabandon']=![];queues[_0x43edb1['uniqueid']][_0x3994('0x18')]=![];queues[_0x43edb1['uniqueid']][_0x3994('0x25')]=null;queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x19')]=![];queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x26')]=null;queues[_0x43edb1[_0x3994('0x4')]]['assigned']=!![];queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x7')]=_0x43edb1[_0x3994('0x38')];queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x1a')]=!![];queues[_0x43edb1[_0x3994('0x4')]]['queuecallercompleteAt']=utils['now']();if(_0x43edb1['reason']=='transfer'){if(!queues[_0x43edb1[_0x3994('0x4')]][_0x3994('0x3b')]){queues[_0x43edb1['uniqueid']][_0x3994('0x1b')]=_0x3994('0x3c');}}else{queues[_0x43edb1['uniqueid']][_0x3994('0x1b')]=_0x3994('0x3d')+_0x43edb1[_0x3994('0x3e')][_0x3994('0x27')]();}utils[_0x3994('0x1')](util['format'](_0x3994('0x3f'),_0x43edb1['uniqueid'],queues[_0x43edb1['uniqueid']][_0x3994('0x1d')],_0x43edb1[_0x3994('0x38')],queues[_0x43edb1['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x43edb1['uniqueid']]);}}}catch(_0x178c8a){utils[_0x3994('0x2d')](util['format'](_0x3994('0x40'),_0x43edb1[_0x3994('0x4')]),_0x178c8a);}};exports['blindtransfer']=function(_0x149937){try{if(!_[_0x3994('0x2a')](queues[_0x149937[_0x3994('0x41')]])){utils[_0x3994('0x10')](util[_0x3994('0x2')](_0x3994('0x42'),_0x149937[_0x3994('0x4')]),_0x149937);queues[_0x149937[_0x3994('0x41')]][_0x3994('0x3b')]=!![];queues[_0x149937[_0x3994('0x41')]][_0x3994('0x43')]=_0x3994('0x44');queues[_0x149937[_0x3994('0x41')]][_0x3994('0x45')]=_0x149937[_0x3994('0x46')];queues[_0x149937[_0x3994('0x41')]][_0x3994('0x47')]=_0x149937[_0x3994('0x41')];queues[_0x149937['transfereeuniqueid']][_0x3994('0x1b')]=_0x3994('0x48');utils[_0x3994('0x1')](util[_0x3994('0x2')](_0x3994('0x49'),_0x149937[_0x3994('0x4')],queues[_0x149937['transfereeuniqueid']]['name'],_0x149937[_0x3994('0x41')],_0x149937['extension']));}}catch(_0x4de7df){utils[_0x3994('0x2d')](util['format'](_0x3994('0x42'),_0x149937[_0x3994('0x4')]),_0x4de7df);}};exports[_0x3994('0x4a')]=function(_0x596a23){try{utils[_0x3994('0x10')](util['format'](_0x3994('0x4b'),_0x596a23['origtransfereruniqueid']),_0x596a23);if(_0x596a23['origtransfereruniqueid']==_0x596a23[_0x3994('0x4c')]){if(!_['isNil'](queues[_0x596a23['secondtransfererlinkedid']])){utils[_0x3994('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x596a23[_0x3994('0x4d')],queues[_0x596a23['secondtransfererlinkedid']][_0x3994('0x1d')],_0x596a23[_0x3994('0x4e')]));queues[_0x596a23['secondtransfererlinkedid']][_0x3994('0x3b')]=!![];queues[_0x596a23[_0x3994('0x4f')]]['transfertype']=_0x3994('0x50');queues[_0x596a23[_0x3994('0x4f')]][_0x3994('0x45')]=_0x596a23[_0x3994('0x4e')];queues[_0x596a23[_0x3994('0x4f')]][_0x3994('0x47')]=_0x596a23[_0x3994('0x4d')];queues[_0x596a23['secondtransfererlinkedid']][_0x3994('0x1b')]=_0x3994('0x51');}if(!_[_0x3994('0x2a')](queues[_0x596a23['origtransfererlinkedid']])){if(_0x596a23[_0x3994('0x52')]&&queues[_0x596a23[_0x3994('0x52')]]){queues[_0x596a23['transfereelinkedid']][_0x3994('0x1f')]=0x1;queues[_0x596a23[_0x3994('0x41')]]=_[_0x3994('0x53')](queues[_0x596a23['transfereelinkedid']]);queues[_0x596a23[_0x3994('0x41')]][_0x3994('0xe')]=_0x596a23[_0x3994('0x54')];queues[_0x596a23['transfereeuniqueid']][_0x3994('0x1f')]=0x2;queues[_0x596a23[_0x3994('0x41')]][_0x3994('0x8')]=queues[_0x596a23[_0x3994('0x4f')]][_0x3994('0x8')];queues[_0x596a23['transfereeuniqueid']][_0x3994('0x55')]=queues[_0x596a23[_0x3994('0x4f')]][_0x3994('0x55')];queues[_0x596a23['transfereeuniqueid']][_0x3994('0x56')]=utils[_0x3994('0x14')]();queues[_0x596a23[_0x3994('0x41')]][_0x3994('0x17')]=utils['now']();queues[_0x596a23[_0x3994('0x41')]][_0x3994('0x57')]=0x0;queues[_0x596a23['transfereeuniqueid']]['mohtime']=0x0;utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x596a23[_0x3994('0x4d')],queues[_0x596a23['transfereeuniqueid']]['name'],queues[_0x596a23[_0x3994('0x41')]][_0x3994('0x8')],queues[_0x596a23[_0x3994('0x41')]][_0x3994('0x55')]));}else{utils['info'](util['format'](_0x3994('0x58'),_0x596a23['origtransfereruniqueid'],queues[_0x596a23[_0x3994('0x4c')]][_0x3994('0x1d')],_0x596a23['secondtransfererlinkedid']));queues[_0x596a23[_0x3994('0x4c')]][_0x3994('0xe')]=_0x596a23[_0x3994('0x4f')];}}}else if(_0x596a23[_0x3994('0x59')]==_0x596a23[_0x3994('0x4f')]){if(!_['isNil'](queues[_0x596a23[_0x3994('0x4c')]])){utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x596a23['origtransfereruniqueid'],queues[_0x596a23[_0x3994('0x4c')]][_0x3994('0x1d')],_0x596a23[_0x3994('0x59')],_0x596a23[_0x3994('0x5a')]));queues[_0x596a23['origtransfererlinkedid']][_0x3994('0x3b')]=!![];queues[_0x596a23['origtransfererlinkedid']][_0x3994('0x43')]=_0x3994('0x50');queues[_0x596a23[_0x3994('0x4c')]][_0x3994('0x45')]=_0x596a23['secondtransfererexten'];queues[_0x596a23[_0x3994('0x4c')]]['transferuniqueid']=_0x596a23[_0x3994('0x59')];queues[_0x596a23[_0x3994('0x4c')]]['queuecallerexitreason']=_0x3994('0x51');}if(!_['isNil'](queues[_0x596a23[_0x3994('0x4f')]])){if(_0x596a23['transfertargetlinkedid']&&queues[_0x596a23[_0x3994('0x5b')]]){queues[_0x596a23[_0x3994('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x596a23[_0x3994('0x54')]]=_[_0x3994('0x53')](queues[_0x596a23[_0x3994('0x5b')]]);queues[_0x596a23[_0x3994('0x54')]]['transfereduniqueid']=_0x596a23[_0x3994('0x54')];queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x1f')]=0x2;queues[_0x596a23['transfertargetuniqueid']][_0x3994('0x8')]=queues[_0x596a23[_0x3994('0x4c')]][_0x3994('0x8')];queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x55')]=queues[_0x596a23['origtransfererlinkedid']][_0x3994('0x55')];queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x56')]=utils[_0x3994('0x14')]();queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x17')]=utils[_0x3994('0x14')]();queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x57')]=0x0;queues[_0x596a23[_0x3994('0x54')]]['mohtime']=0x0;utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x596a23['origtransfereruniqueid'],queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x1d')],queues[_0x596a23[_0x3994('0x54')]][_0x3994('0xe')],queues[_0x596a23[_0x3994('0x54')]]['calleridnum'],queues[_0x596a23[_0x3994('0x54')]][_0x3994('0x55')]));}else{utils[_0x3994('0x1')](util['format'](_0x3994('0x58'),_0x596a23['origtransfereruniqueid'],queues[_0x596a23[_0x3994('0x4f')]]['name'],_0x596a23[_0x3994('0x4c')]));queues[_0x596a23[_0x3994('0x4f')]][_0x3994('0xe')]=_0x596a23['origtransfererlinkedid'];}}}}catch(_0x37b0bf){utils[_0x3994('0x2d')](util[_0x3994('0x2')](_0x3994('0x4b'),_0x596a23[_0x3994('0x4d')]),_0x37b0bf);}};exports[_0x3994('0x5c')]=function(_0x209d7e){try{if(!_[_0x3994('0x2a')](queues[_0x209d7e[_0x3994('0x4')]])){utils['debug'](util[_0x3994('0x2')](_0x3994('0x5d'),_0x209d7e[_0x3994('0x4')]),_0x209d7e);queues[_0x209d7e[_0x3994('0x4')]][_0x3994('0x5e')]=utils['now']();utils[_0x3994('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x209d7e[_0x3994('0x4')],queues[_0x209d7e['uniqueid']]['name'],queues[_0x209d7e[_0x3994('0x4')]][_0x3994('0x5e')]));}}catch(_0xe12976){utils[_0x3994('0x2d')](util[_0x3994('0x2')](_0x3994('0x5d'),_0x209d7e['uniqueid']),_0xe12976);}};exports[_0x3994('0x5f')]=function(_0x301f7e){try{if(!_[_0x3994('0x2a')](queues[_0x301f7e['uniqueid']])){if(!_['isNil'](queues[_0x301f7e[_0x3994('0x4')]][_0x3994('0x5e')])){utils[_0x3994('0x10')](util[_0x3994('0x2')](_0x3994('0x60'),_0x301f7e['uniqueid']),_0x301f7e);queues[_0x301f7e[_0x3994('0x4')]][_0x3994('0x61')]+=utils[_0x3994('0x32')](utils[_0x3994('0x14')](),queues[_0x301f7e['uniqueid']]['musiconholdstartAt']);utils[_0x3994('0x1')](util[_0x3994('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x301f7e['uniqueid'],queues[_0x301f7e['uniqueid']][_0x3994('0x1d')],queues[_0x301f7e[_0x3994('0x4')]][_0x3994('0x61')]));delete queues[_0x301f7e[_0x3994('0x4')]][_0x3994('0x5e')];}}}catch(_0x1e4e8a){utils[_0x3994('0x2d')](util[_0x3994('0x2')](_0x3994('0x60'),_0x301f7e[_0x3994('0x4')]),_0x1e4e8a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5a3ff6d..b5f9772 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 _0xf788=['format','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','[%s][recordings][newexten]','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','[%s][recordings][writeDB]','accountcode','name','UserId','request','CreateVoiceRecording','newchannel','debug'];(function(_0x278532,_0x40250c){var _0x4eeae5=function(_0x15e8fd){while(--_0x15e8fd){_0x278532['push'](_0x278532['shift']());}};_0x4eeae5(++_0x40250c);}(_0xf788,0x9d));var _0x8f78=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf788[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x8f78('0x0'));var util=require(_0x8f78('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x125c14){utils[_0x8f78('0x2')](util['format'](_0x8f78('0x3'),_0x125c14['uniqueid']));if(_0x125c14[_0x8f78('0x4')]){utils['getUserByInternal'](_0x125c14['accountcode'])['then'](function(_0x431b0b){if(_0x431b0b){_0x125c14['membername']=_0x431b0b[_0x8f78('0x5')];_0x125c14[_0x8f78('0x6')]=_0x431b0b['id'];}utils[_0x8f78('0x7')](_0x8f78('0x8'),_0x125c14);});}else{utils['request'](_0x8f78('0x8'),_0x125c14);}}exports[_0x8f78('0x9')]=function(_0x1a54d6){try{utils[_0x8f78('0xa')](util[_0x8f78('0xb')](_0x8f78('0xc'),_0x1a54d6[_0x8f78('0xd')]),_0x1a54d6);if(_0x1a54d6['uniqueid']==_0x1a54d6[_0x8f78('0xe')]){utils[_0x8f78('0x2')](util[_0x8f78('0xb')](_0x8f78('0xf'),_0x1a54d6['uniqueid'],_0x1a54d6[_0x8f78('0x10')],_0x1a54d6[_0x8f78('0x11')]));recordings[_0x1a54d6[_0x8f78('0xd')]]={'uniqueid':_0x1a54d6[_0x8f78('0xd')],'accountcode':_0x1a54d6['accountcode'],'exten':_0x1a54d6['exten'],'context':_0x1a54d6[_0x8f78('0x10')],'channel':_0x1a54d6['channel'],'monitors':[]};}}catch(_0x439092){utils[_0x8f78('0x12')](util[_0x8f78('0xb')](_0x8f78('0xc'),_0x1a54d6[_0x8f78('0xd')]),_0x439092);}};exports['newstate']=function(_0x5bc4af){try{utils[_0x8f78('0xa')](util[_0x8f78('0xb')]('[%s][recordings][newstate]',_0x5bc4af[_0x8f78('0xd')]),_0x5bc4af);if(!_[_0x8f78('0x13')](recordings[_0x5bc4af[_0x8f78('0xd')]])&&_0x5bc4af[_0x8f78('0x14')]==0x6){utils[_0x8f78('0x2')](util['format'](_0x8f78('0x15'),_0x5bc4af['uniqueid'],_0x5bc4af[_0x8f78('0x10')],_0x5bc4af[_0x8f78('0x16')]));}else if(!_['isNil'](recordings[_0x5bc4af[_0x8f78('0xe')]])&&_0x5bc4af['channelstate']==0x6&&_0x5bc4af[_0x8f78('0x10')]!=_0x8f78('0x17')){utils[_0x8f78('0x2')](util[_0x8f78('0xb')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5bc4af[_0x8f78('0xd')],_0x5bc4af[_0x8f78('0xe')],_0x5bc4af[_0x8f78('0x10')],_0x5bc4af[_0x8f78('0x16')]));recordings[_0x5bc4af[_0x8f78('0xe')]]['accountcode']=_0x5bc4af[_0x8f78('0x4')];}}catch(_0x27e0c6){utils['error'](util['format']('[%s][recordings][newstate]',_0x5bc4af[_0x8f78('0xd')]),_0x27e0c6);}};exports[_0x8f78('0x18')]=function(_0x4c822b){try{if(!_[_0x8f78('0x13')](_0x4c822b[_0x8f78('0x19')])&&!_[_0x8f78('0x13')](_0x4c822b[_0x8f78('0x19')][_0x8f78('0x1a')])){utils[_0x8f78('0xa')](util[_0x8f78('0xb')](_0x8f78('0x1b'),_0x4c822b[_0x8f78('0xd')]),_0x4c822b);utils['info'](util['format'](_0x8f78('0x1c'),_0x4c822b['uniqueid'],_0x4c822b[_0x8f78('0x19')],_0x4c822b[_0x8f78('0x1d')]));if(_[_0x8f78('0x1e')](_0x4c822b[_0x8f78('0x1d')],_0x8f78('0x1f'))){_0x4c822b['value']=_0x4c822b[_0x8f78('0x1d')][_0x8f78('0x20')](_0x8f78('0x1f'),'.WAV');}if(recordings[_0x4c822b['linkedid']]){var _0x9cd477=_['find'](recordings[_0x4c822b['linkedid']][_0x8f78('0x21')],{'value':_0x4c822b[_0x8f78('0x1d')]});if(_[_0x8f78('0x13')](_0x9cd477)){recordings[_0x4c822b[_0x8f78('0xe')]]['monitors'][_0x8f78('0x22')]({'value':_0x4c822b[_0x8f78('0x1d')]});}}}}catch(_0x369afe){utils[_0x8f78('0x12')](util[_0x8f78('0xb')](_0x8f78('0x1b'),_0x4c822b['uniqueid']),_0x369afe);}};exports[_0x8f78('0x23')]=function(_0x4b019d){try{if(!_['isNil'](recordings[_0x4b019d['uniqueid']])){utils['debug'](util[_0x8f78('0xb')]('[%s][recordings][hangup]',_0x4b019d[_0x8f78('0xd')]),_0x4b019d);utils[_0x8f78('0x2')](util['format'](_0x8f78('0x24'),_0x4b019d['uniqueid'],_0x4b019d[_0x8f78('0x25')],_0x4b019d[_0x8f78('0x26')],_0x4b019d[_0x8f78('0x27')]));recordings[_0x4b019d['uniqueid']][_0x8f78('0x25')]=_0x4b019d[_0x8f78('0x25')];recordings[_0x4b019d['uniqueid']][_0x8f78('0x26')]=_0x4b019d[_0x8f78('0x26')];recordings[_0x4b019d['uniqueid']][_0x8f78('0x28')]=_0x4b019d[_0x8f78('0x28')];recordings[_0x4b019d[_0x8f78('0xd')]]['connectedlinename']=_0x4b019d[_0x8f78('0x29')];if(recordings[_0x4b019d['uniqueid']]['type']==_0x8f78('0x2a')&&recordings[_0x4b019d['uniqueid']]['accountcode']){recordings[_0x4b019d[_0x8f78('0xd')]][_0x8f78('0x28')]=recordings[_0x4b019d['uniqueid']]['accountcode'];recordings[_0x4b019d[_0x8f78('0xd')]][_0x8f78('0x29')]='';}recordings[_0x4b019d[_0x8f78('0xd')]]['monitors'][_0x8f78('0x2b')](function(_0x29be00){var _0x5ef018=_[_0x8f78('0x2c')](recordings[_0x4b019d[_0x8f78('0xd')]]);_0x5ef018[_0x8f78('0x1d')]=_0x29be00[_0x8f78('0x1d')];writeDB(_0x5ef018);});delete recordings[_0x4b019d[_0x8f78('0xd')]];}}catch(_0x8773cb){utils[_0x8f78('0x12')](util[_0x8f78('0xb')]('[%s][recordings][hangup]',_0x4b019d[_0x8f78('0xd')]),_0x8773cb);}};exports['newexten']=function(_0x15da29){try{if(!_['isNil'](recordings[_0x15da29[_0x8f78('0xd')]])){utils[_0x8f78('0xa')](util['format'](_0x8f78('0x2d'),_0x15da29[_0x8f78('0xd')]),_0x15da29);utils['info'](util[_0x8f78('0xb')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x15da29['uniqueid'],_0x15da29['application'],_0x15da29['appdata']));if(_0x15da29[_0x8f78('0x2e')][_0x8f78('0x2f')]()==_0x8f78('0x30')&&_['startsWith'](_0x15da29[_0x8f78('0x31')][_0x8f78('0x2f')](),_0x8f78('0x32'))){var _0x3145e0=_0x15da29[_0x8f78('0x31')][_0x8f78('0x33')]('=');var _0x16f984=_0x3145e0[0x0][_0x8f78('0x34')](_0x3145e0[0x0]['lastIndexOf']('(')+0x1,_0x3145e0[0x0][_0x8f78('0x35')](')'));var _0x521839=_0x3145e0[0x1];recordings[_0x15da29['uniqueid']][_0x16f984]=_0x521839;}}}catch(_0x5172ed){utils[_0x8f78('0x12')](util[_0x8f78('0xb')](_0x8f78('0x2d'),_0x15da29['uniqueid']),_0x5172ed);}};exports['queuecallerjoin']=function(_0xba294f){try{if(!_[_0x8f78('0x13')](recordings[_0xba294f['uniqueid']])){utils[_0x8f78('0xa')](util[_0x8f78('0xb')](_0x8f78('0x36'),_0xba294f['uniqueid']),_0xba294f);utils[_0x8f78('0x2')](util[_0x8f78('0xb')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0xba294f[_0x8f78('0xd')],_0xba294f[_0x8f78('0x37')]));recordings[_0xba294f[_0x8f78('0xd')]][_0x8f78('0x37')]=_0xba294f[_0x8f78('0x37')];}}catch(_0x3e4f9c){utils['error'](util[_0x8f78('0xb')](_0x8f78('0x36'),_0xba294f[_0x8f78('0xd')]),_0x3e4f9c);}}; \ No newline at end of file +var _0xa6e6=['connectedlinename','type','outbound','monitors','forEach','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','cdr','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newstate]','isNil','channelstate','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','push','error','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum'];(function(_0xf16851,_0x2fe387){var _0x22337b=function(_0x75442b){while(--_0x75442b){_0xf16851['push'](_0xf16851['shift']());}};_0x22337b(++_0x2fe387);}(_0xa6e6,0x7e));var _0x6a6e=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xa6e6[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var utils=require(_0x6a6e('0x1'));var recordings={};function writeDB(_0x1b6935){utils[_0x6a6e('0x2')](util[_0x6a6e('0x3')](_0x6a6e('0x4'),_0x1b6935[_0x6a6e('0x5')]));if(_0x1b6935['accountcode']){utils[_0x6a6e('0x6')](_0x1b6935[_0x6a6e('0x7')])['then'](function(_0x49e703){if(_0x49e703){_0x1b6935[_0x6a6e('0x8')]=_0x49e703[_0x6a6e('0x9')];_0x1b6935[_0x6a6e('0xa')]=_0x49e703['id'];}utils[_0x6a6e('0xb')](_0x6a6e('0xc'),_0x1b6935);});}else{utils[_0x6a6e('0xb')]('CreateVoiceRecording',_0x1b6935);}}exports[_0x6a6e('0xd')]=function(_0x1ba9c6){try{utils[_0x6a6e('0xe')](util[_0x6a6e('0x3')](_0x6a6e('0xf'),_0x1ba9c6[_0x6a6e('0x5')]),_0x1ba9c6);if(_0x1ba9c6[_0x6a6e('0x5')]==_0x1ba9c6[_0x6a6e('0x10')]){utils[_0x6a6e('0x2')](util[_0x6a6e('0x3')](_0x6a6e('0x11'),_0x1ba9c6[_0x6a6e('0x5')],_0x1ba9c6[_0x6a6e('0x12')],_0x1ba9c6[_0x6a6e('0x13')]));recordings[_0x1ba9c6[_0x6a6e('0x5')]]={'uniqueid':_0x1ba9c6[_0x6a6e('0x5')],'accountcode':_0x1ba9c6['accountcode'],'exten':_0x1ba9c6[_0x6a6e('0x13')],'context':_0x1ba9c6[_0x6a6e('0x12')],'channel':_0x1ba9c6[_0x6a6e('0x14')],'monitors':[]};}}catch(_0x127875){utils['error'](util['format'](_0x6a6e('0xf'),_0x1ba9c6['uniqueid']),_0x127875);}};exports['newstate']=function(_0x46f6d8){try{utils[_0x6a6e('0xe')](util[_0x6a6e('0x3')](_0x6a6e('0x15'),_0x46f6d8['uniqueid']),_0x46f6d8);if(!_[_0x6a6e('0x16')](recordings[_0x46f6d8[_0x6a6e('0x5')]])&&_0x46f6d8[_0x6a6e('0x17')]==0x6){utils[_0x6a6e('0x2')](util[_0x6a6e('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x46f6d8[_0x6a6e('0x5')],_0x46f6d8['context'],_0x46f6d8[_0x6a6e('0x14')]));}else if(!_[_0x6a6e('0x16')](recordings[_0x46f6d8[_0x6a6e('0x10')]])&&_0x46f6d8[_0x6a6e('0x17')]==0x6&&_0x46f6d8[_0x6a6e('0x12')]!='transfer'){utils['info'](util[_0x6a6e('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x46f6d8['uniqueid'],_0x46f6d8[_0x6a6e('0x10')],_0x46f6d8[_0x6a6e('0x12')],_0x46f6d8['channel']));recordings[_0x46f6d8[_0x6a6e('0x10')]][_0x6a6e('0x7')]=_0x46f6d8[_0x6a6e('0x7')];}}catch(_0x310779){utils['error'](util[_0x6a6e('0x3')]('[%s][recordings][newstate]',_0x46f6d8[_0x6a6e('0x5')]),_0x310779);}};exports[_0x6a6e('0x18')]=function(_0x2865bf){try{if(!_['isNil'](_0x2865bf[_0x6a6e('0x19')])&&!_[_0x6a6e('0x16')](_0x2865bf['variable'][_0x6a6e('0x1a')])){utils[_0x6a6e('0xe')](util['format'](_0x6a6e('0x1b'),_0x2865bf[_0x6a6e('0x5')]),_0x2865bf);utils[_0x6a6e('0x2')](util[_0x6a6e('0x3')](_0x6a6e('0x1c'),_0x2865bf[_0x6a6e('0x5')],_0x2865bf[_0x6a6e('0x19')],_0x2865bf[_0x6a6e('0x1d')]));if(_[_0x6a6e('0x1e')](_0x2865bf['value'],_0x6a6e('0x1f'))){_0x2865bf[_0x6a6e('0x1d')]=_0x2865bf[_0x6a6e('0x1d')][_0x6a6e('0x20')](_0x6a6e('0x1f'),_0x6a6e('0x21'));}if(recordings[_0x2865bf['linkedid']]){var _0x439e4d=_[_0x6a6e('0x22')](recordings[_0x2865bf[_0x6a6e('0x10')]]['monitors'],{'value':_0x2865bf['value']});if(_[_0x6a6e('0x16')](_0x439e4d)){recordings[_0x2865bf[_0x6a6e('0x10')]]['monitors'][_0x6a6e('0x23')]({'value':_0x2865bf[_0x6a6e('0x1d')]});}}}}catch(_0xf40560){utils[_0x6a6e('0x24')](util[_0x6a6e('0x3')](_0x6a6e('0x1b'),_0x2865bf[_0x6a6e('0x5')]),_0xf40560);}};exports[_0x6a6e('0x25')]=function(_0x5ca0c6){try{if(!_[_0x6a6e('0x16')](recordings[_0x5ca0c6[_0x6a6e('0x5')]])){utils[_0x6a6e('0xe')](util['format'](_0x6a6e('0x26'),_0x5ca0c6[_0x6a6e('0x5')]),_0x5ca0c6);utils[_0x6a6e('0x2')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5ca0c6[_0x6a6e('0x5')],_0x5ca0c6[_0x6a6e('0x27')],_0x5ca0c6[_0x6a6e('0x28')],_0x5ca0c6['cause-txt']));recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x27')]=_0x5ca0c6[_0x6a6e('0x27')];recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x28')]=_0x5ca0c6[_0x6a6e('0x28')];recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x29')]=_0x5ca0c6[_0x6a6e('0x29')];recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x2a')]=_0x5ca0c6[_0x6a6e('0x2a')];if(recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x2b')]==_0x6a6e('0x2c')&&recordings[_0x5ca0c6[_0x6a6e('0x5')]]['accountcode']){recordings[_0x5ca0c6['uniqueid']][_0x6a6e('0x29')]=recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x7')];recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x2a')]='';}recordings[_0x5ca0c6[_0x6a6e('0x5')]][_0x6a6e('0x2d')][_0x6a6e('0x2e')](function(_0x229504){var _0x2eecb5=_['clone'](recordings[_0x5ca0c6['uniqueid']]);_0x2eecb5[_0x6a6e('0x1d')]=_0x229504[_0x6a6e('0x1d')];writeDB(_0x2eecb5);});delete recordings[_0x5ca0c6[_0x6a6e('0x5')]];}}catch(_0x1e214b){utils[_0x6a6e('0x24')](util[_0x6a6e('0x3')](_0x6a6e('0x26'),_0x5ca0c6['uniqueid']),_0x1e214b);}};exports[_0x6a6e('0x2f')]=function(_0x29efbb){try{if(!_[_0x6a6e('0x16')](recordings[_0x29efbb[_0x6a6e('0x5')]])){utils[_0x6a6e('0xe')](util[_0x6a6e('0x3')](_0x6a6e('0x30'),_0x29efbb[_0x6a6e('0x5')]),_0x29efbb);utils[_0x6a6e('0x2')](util[_0x6a6e('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x29efbb['uniqueid'],_0x29efbb[_0x6a6e('0x31')],_0x29efbb[_0x6a6e('0x32')]));if(_0x29efbb[_0x6a6e('0x31')][_0x6a6e('0x33')]()=='set'&&_['startsWith'](_0x29efbb[_0x6a6e('0x32')][_0x6a6e('0x33')](),_0x6a6e('0x34'))){var _0x578d27=_0x29efbb[_0x6a6e('0x32')]['split']('=');var _0x4f02cc=_0x578d27[0x0]['substring'](_0x578d27[0x0][_0x6a6e('0x35')]('(')+0x1,_0x578d27[0x0][_0x6a6e('0x35')](')'));var _0x69ca8e=_0x578d27[0x1];recordings[_0x29efbb['uniqueid']][_0x4f02cc]=_0x69ca8e;}}}catch(_0x5783a0){utils[_0x6a6e('0x24')](util[_0x6a6e('0x3')](_0x6a6e('0x30'),_0x29efbb[_0x6a6e('0x5')]),_0x5783a0);}};exports['queuecallerjoin']=function(_0x305d91){try{if(!_[_0x6a6e('0x16')](recordings[_0x305d91[_0x6a6e('0x5')]])){utils[_0x6a6e('0xe')](util[_0x6a6e('0x3')](_0x6a6e('0x36'),_0x305d91[_0x6a6e('0x5')]),_0x305d91);utils[_0x6a6e('0x2')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x305d91['uniqueid'],_0x305d91[_0x6a6e('0x37')]));recordings[_0x305d91[_0x6a6e('0x5')]][_0x6a6e('0x37')]=_0x305d91[_0x6a6e('0x37')];}}catch(_0x46afab){utils[_0x6a6e('0x24')](util[_0x6a6e('0x3')](_0x6a6e('0x36'),_0x305d91['uniqueid']),_0x46afab);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8dc9c63..bb4c9e4 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 _0x87c7=['./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash'];(function(_0x366ffb,_0x3835ca){var _0x234217=function(_0x2ddbf7){while(--_0x2ddbf7){_0x366ffb['push'](_0x366ffb['shift']());}};_0x234217(++_0x3835ca);}(_0x87c7,0xe9));var _0x787c=function(_0x36eaac,_0x3ba2da){_0x36eaac=_0x36eaac-0x0;var _0x1886ad=_0x87c7[_0x36eaac];return _0x1886ad;};'use strict';var _=require(_0x787c('0x0'));var util=require('util');var utils=require(_0x787c('0x1'));function writeDB(_0xd678dc){utils[_0x787c('0x2')](util[_0x787c('0x3')](_0x787c('0x4'),_0xd678dc[_0x787c('0x5')]===_0x787c('0x6')?_0xd678dc[_0x787c('0x7')]:_0xd678dc[_0x787c('0x8')],_0xd678dc[_0x787c('0x5')]));utils['request']('CreateVoiceTransferReport',_0xd678dc);}exports[_0x787c('0x9')]={};exports[_0x787c('0xa')]=function(_0x22981c){try{utils[_0x787c('0xb')](util['format']('[%s][transfers][blindtransfer]',_0x22981c[_0x787c('0x8')]),_0x22981c);utils[_0x787c('0x2')](util[_0x787c('0x3')](_0x787c('0xc'),_0x22981c['uniqueid'],_0x22981c[_0x787c('0xd')],_0x22981c['transferercalleridname'],_0x22981c[_0x787c('0xe')],_0x22981c[_0x787c('0xf')]));_0x22981c[_0x787c('0x5')]=_0x787c('0x10');exports[_0x787c('0x9')][_0x22981c[_0x787c('0x11')]]=_0x22981c;writeDB(_0x22981c);}catch(_0x389901){utils[_0x787c('0x12')](util['format'](_0x787c('0x13'),_0x22981c[_0x787c('0x8')]),_0x389901);}};exports['attendedtransfer']=function(_0x530a7c){try{utils[_0x787c('0xb')](util[_0x787c('0x3')](_0x787c('0x14'),_0x530a7c[_0x787c('0x7')]),_0x530a7c);utils[_0x787c('0x2')](util[_0x787c('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x530a7c[_0x787c('0x7')],_0x530a7c['origtransferercalleridnum'],_0x530a7c[_0x787c('0x15')],_0x530a7c[_0x787c('0x16')],_0x530a7c[_0x787c('0x17')]));_0x530a7c=_['assign'](_0x530a7c,{'transfererchannel':_0x530a7c['origtransfererchannel'],'transferercalleridnum':_0x530a7c[_0x787c('0x18')],'transferercalleridname':_0x530a7c[_0x787c('0x15')],'transfererconnectedlinenum':_0x530a7c[_0x787c('0x19')],'transfererconnectedlinename':_0x530a7c[_0x787c('0x1a')],'transfereraccountcode':_0x530a7c[_0x787c('0x1b')],'transferercontext':_0x530a7c[_0x787c('0x1c')],'transfererexten':_0x530a7c[_0x787c('0x1d')],'transfererlinkedid':_0x530a7c[_0x787c('0x1e')],'context':_0x530a7c['origtransferercontext'],'extension':_0x530a7c[_0x787c('0x1f')],'type':_0x787c('0x6')});if(_[_0x787c('0x20')](_0x530a7c[_0x787c('0x21')])){_0x530a7c=_['assign'](_0x530a7c,{'transfereechannel':_0x530a7c[_0x787c('0x22')],'transfereecalleridnum':_0x530a7c[_0x787c('0x16')],'transfereecalleridname':_0x530a7c[_0x787c('0x17')],'transfereeconnectedlinenum':_0x530a7c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x530a7c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x530a7c[_0x787c('0x23')],'transfereecontext':_0x530a7c[_0x787c('0x24')],'transfereeexten':_0x530a7c[_0x787c('0x25')],'transfereelinkedid':_0x530a7c[_0x787c('0x26')]});}writeDB(_0x530a7c);}catch(_0x834828){utils[_0x787c('0x12')](util[_0x787c('0x3')](_0x787c('0x14'),_0x530a7c['origtransfereruniqueid']),_0x834828);}}; \ No newline at end of file +var _0x9e11=['attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','type'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x9e11,0x1d5));var _0x19e1=function(_0xc5dbce,_0x2777b4){_0xc5dbce=_0xc5dbce-0x0;var _0xee4266=_0x9e11[_0xc5dbce];return _0xee4266;};'use strict';var _=require(_0x19e1('0x0'));var util=require('util');var utils=require(_0x19e1('0x1'));function writeDB(_0x3f95af){utils[_0x19e1('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x3f95af[_0x19e1('0x3')]===_0x19e1('0x4')?_0x3f95af[_0x19e1('0x5')]:_0x3f95af[_0x19e1('0x6')],_0x3f95af['type']));utils[_0x19e1('0x7')](_0x19e1('0x8'),_0x3f95af);}exports['blinds']={};exports['blindtransfer']=function(_0x2f51e3){try{utils[_0x19e1('0x9')](util['format'](_0x19e1('0xa'),_0x2f51e3['uniqueid']),_0x2f51e3);utils[_0x19e1('0x2')](util[_0x19e1('0xb')](_0x19e1('0xc'),_0x2f51e3[_0x19e1('0x6')],_0x2f51e3[_0x19e1('0xd')],_0x2f51e3[_0x19e1('0xe')],_0x2f51e3['transfereecalleridnum'],_0x2f51e3[_0x19e1('0xf')]));_0x2f51e3[_0x19e1('0x3')]=_0x19e1('0x10');exports[_0x19e1('0x11')][_0x2f51e3[_0x19e1('0x12')]]=_0x2f51e3;writeDB(_0x2f51e3);}catch(_0x4e2602){utils[_0x19e1('0x13')](util[_0x19e1('0xb')](_0x19e1('0xa'),_0x2f51e3['uniqueid']),_0x4e2602);}};exports[_0x19e1('0x14')]=function(_0x2a28f4){try{utils['debug'](util[_0x19e1('0xb')](_0x19e1('0x15'),_0x2a28f4['origtransfereruniqueid']),_0x2a28f4);utils[_0x19e1('0x2')](util[_0x19e1('0xb')](_0x19e1('0x16'),_0x2a28f4[_0x19e1('0x5')],_0x2a28f4['origtransferercalleridnum'],_0x2a28f4[_0x19e1('0x17')],_0x2a28f4[_0x19e1('0x18')],_0x2a28f4[_0x19e1('0x19')]));_0x2a28f4=_[_0x19e1('0x1a')](_0x2a28f4,{'transfererchannel':_0x2a28f4[_0x19e1('0x1b')],'transferercalleridnum':_0x2a28f4[_0x19e1('0x1c')],'transferercalleridname':_0x2a28f4[_0x19e1('0x17')],'transfererconnectedlinenum':_0x2a28f4[_0x19e1('0x1d')],'transfererconnectedlinename':_0x2a28f4[_0x19e1('0x1e')],'transfereraccountcode':_0x2a28f4['origtransfereraccountcode'],'transferercontext':_0x2a28f4[_0x19e1('0x1f')],'transfererexten':_0x2a28f4[_0x19e1('0x20')],'transfererlinkedid':_0x2a28f4['origtransfererlinkedid'],'context':_0x2a28f4[_0x19e1('0x21')],'extension':_0x2a28f4['origtransfererexten'],'type':'attended'});if(_[_0x19e1('0x22')](_0x2a28f4[_0x19e1('0x23')])){_0x2a28f4=_[_0x19e1('0x1a')](_0x2a28f4,{'transfereechannel':_0x2a28f4[_0x19e1('0x24')],'transfereecalleridnum':_0x2a28f4[_0x19e1('0x18')],'transfereecalleridname':_0x2a28f4[_0x19e1('0x19')],'transfereeconnectedlinenum':_0x2a28f4[_0x19e1('0x25')],'transfereeconnectedlinename':_0x2a28f4[_0x19e1('0x26')],'transfereeaccountcode':_0x2a28f4[_0x19e1('0x27')],'transfereecontext':_0x2a28f4[_0x19e1('0x28')],'transfereeexten':_0x2a28f4[_0x19e1('0x29')],'transfereelinkedid':_0x2a28f4[_0x19e1('0x2a')]});}writeDB(_0x2a28f4);}catch(_0x17fc8d){utils['error'](util[_0x19e1('0xb')](_0x19e1('0x15'),_0x2a28f4['origtransfereruniqueid']),_0x17fc8d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 89e83e7..5773e68 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 _0x1c3a=['found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','format','YYYY-MM-DD\x20HH:mm:ss','seconds','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0x1c3a,0x9d));var _0xa1c3=function(_0x1e1f96,_0x4b37be){_0x1e1f96=_0x1e1f96-0x0;var _0x31c952=_0x1c3a[_0x1e1f96];return _0x31c952;};'use strict';var BPromise=require(_0xa1c3('0x0'));var jayson=require(_0xa1c3('0x1'));var moment=require(_0xa1c3('0x2'));var util=require('util');var client=jayson[_0xa1c3('0x3')][_0xa1c3('0x4')]({'port':0x2329});var logger=require(_0xa1c3('0x5'))(_0xa1c3('0x6'));exports['info']=function(_0xfca3d,_0x5d08c7){logger[_0xa1c3('0x7')](_0xfca3d,_0x5d08c7?util['inspect'](_0x5d08c7,{'showHidden':![],'depth':null}):'');};exports[_0xa1c3('0x8')]=function(_0x2da811,_0x318477){logger[_0xa1c3('0x8')](_0x2da811,_0x318477?util[_0xa1c3('0x9')](_0x318477,{'showHidden':![],'depth':null}):'');};exports[_0xa1c3('0xa')]=function(_0x208c73,_0x4f8cb2){logger[_0xa1c3('0xa')](_0x208c73,_0x4f8cb2?util[_0xa1c3('0x9')](_0x4f8cb2,{'showHidden':![],'depth':null}):'');};exports[_0xa1c3('0xb')]=function(_0x8b7bd9,_0x2f3899){return client[_0xa1c3('0xb')](_0x8b7bd9,{'body':_0x2f3899})[_0xa1c3('0xc')](function(_0x41a22d){logger['debug']('[utils][request]\x20name:%s',_0x8b7bd9,_0x41a22d?util[_0xa1c3('0x9')](_0x41a22d,{'showHidden':![],'depth':null}):'');})[_0xa1c3('0xd')](function(_0x545854){logger[_0xa1c3('0xa')]('[utils][request]\x20name:%s',_0x8b7bd9,_0x545854?util['inspect'](_0x545854,{'showHidden':![],'depth':null}):'');});};function getUser(_0x17972f){return client[_0xa1c3('0xb')](_0xa1c3('0xe'),{'options':{'raw':!![],'attributes':['id',_0xa1c3('0xf'),_0xa1c3('0x10'),_0xa1c3('0x11')],'where':_0x17972f,'limit':0x1}})[_0xa1c3('0xc')](function(_0x20e551){logger[_0xa1c3('0x8')](_0xa1c3('0x12'),JSON[_0xa1c3('0x13')](_0x17972f),_0x20e551?util['inspect'](_0x20e551,{'showHidden':![],'depth':null}):'');return _0x20e551[_0xa1c3('0x14')]['length']?_0x20e551[_0xa1c3('0x14')][0x0]:null;});}exports[_0xa1c3('0x15')]=function(_0x51743e){return new BPromise(function(_0x282d52,_0x2f6fab){if(_0x51743e){return getUser({'internal':_0x51743e})[_0xa1c3('0xc')](function(_0xa67feb){logger[_0xa1c3('0x7')](_0xa1c3('0x16'),_0x51743e,_0xa67feb?_0xa1c3('0x17'):_0xa1c3('0x18'));return _0x282d52(_0xa67feb);})[_0xa1c3('0xd')](function(_0x510dac){logger[_0xa1c3('0xa')]('[utils][getUserByInternal]',_0x510dac?util['inspect'](_0x510dac,{'showHidden':![],'depth':null}):'');return _0x282d52(null);});}return _0x282d52(null);});};exports['getUserByInterface']=function(_0xf87e39){return new BPromise(function(_0x5bdbd0,_0x11aa29){if(_0xf87e39){return getUser({'interface':_0xf87e39})[_0xa1c3('0xc')](function(_0x1a070b){logger['info'](_0xa1c3('0x19'),_0xf87e39,_0x1a070b?_0xa1c3('0x17'):_0xa1c3('0x18'));return _0x5bdbd0(_0x1a070b);})[_0xa1c3('0xd')](function(_0x1e81fa){logger[_0xa1c3('0xa')](_0xa1c3('0x1a'),_0x1e81fa?util[_0xa1c3('0x9')](_0x1e81fa,{'showHidden':![],'depth':null}):'');return _0x5bdbd0(null);});}return _0x5bdbd0(null);});};exports[_0xa1c3('0x1b')]=function(_0x42d1f0){return new BPromise(function(_0x3cf5ba,_0x50f19a){if(_0x42d1f0){return getUser({'name':_0x42d1f0})[_0xa1c3('0xc')](function(_0x396095){logger[_0xa1c3('0x7')](_0xa1c3('0x1c'),_0x42d1f0,_0x396095?_0xa1c3('0x17'):_0xa1c3('0x18'));return _0x3cf5ba(_0x396095);})[_0xa1c3('0xd')](function(_0x4120e2){logger[_0xa1c3('0xa')](_0xa1c3('0x1d'),_0x4120e2?util[_0xa1c3('0x9')](_0x4120e2,{'showHidden':![],'depth':null}):'');return _0x3cf5ba(null);});}return _0x3cf5ba(null);});};exports['getVoiceQueueByName']=function(_0x333dd1){return new BPromise(function(_0x266771,_0x2bbadd){if(_0x333dd1){return client[_0xa1c3('0xb')](_0xa1c3('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xa1c3('0x10'),_0xa1c3('0x1f'),_0xa1c3('0x20'),_0xa1c3('0x21')],'where':{'name':_0x333dd1},'limit':0x1}})['then'](function(_0x5e2b6f){logger[_0xa1c3('0x8')](_0xa1c3('0x22'),_0x333dd1,_0x5e2b6f?util[_0xa1c3('0x9')](_0x5e2b6f,{'showHidden':![],'depth':null}):'');logger[_0xa1c3('0x7')](_0xa1c3('0x23'),_0x333dd1,_0x5e2b6f?'found':_0xa1c3('0x18'));return _0x266771(_0x5e2b6f[_0xa1c3('0x14')][_0xa1c3('0x24')]?_0x5e2b6f[_0xa1c3('0x14')][0x0]:null);})[_0xa1c3('0xd')](function(_0x2dd121){logger['error']('[utils][getVoiceQueueByName]',_0x2dd121?util[_0xa1c3('0x9')](_0x2dd121,{'showHidden':![],'depth':null}):'');return _0x266771(null);});}return _0x266771(null);});};exports['addTime']=function(_0x957e22,_0x1c15f3){return moment(_0x957e22)['add'](_0x1c15f3,'seconds')[_0xa1c3('0x25')](_0xa1c3('0x26'));};exports['subtractTime']=function(_0x3d6eca,_0x3a5ccd){return moment(_0x3d6eca)['subtract'](_0x3a5ccd,_0xa1c3('0x27'))[_0xa1c3('0x25')](_0xa1c3('0x26'));};exports[_0xa1c3('0x28')]=function(_0x29f575,_0x3af2cf){return moment(_0x29f575)['diff'](moment(_0x3af2cf),_0xa1c3('0x27'));};exports[_0xa1c3('0x29')]=function(_0x386d28,_0xe9c2dc){return parseInt(_0x386d28,0xa)+parseInt(_0xe9c2dc,0xa);};exports[_0xa1c3('0x2a')]=function(){return moment()['format'](_0xa1c3('0x26'));};exports[_0xa1c3('0x2b')]=function(_0x5137b8,_0x2b2ba7){if(_0x2b2ba7){return moment(_0x5137b8)[_0xa1c3('0x2b')](_0x2b2ba7);}return!![];};exports['isBefore']=function(_0x4970a6,_0x1b2f62){if(_0x1b2f62){return moment(_0x4970a6)[_0xa1c3('0x2c')](_0x1b2f62);}else if(_0x4970a6){return!![];}return![];}; \ No newline at end of file +var _0xd1aa=['stringify','result','length','getUserByInternal','info','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','seconds','sumTime','now','isAfter','isBefore','bluebird','util','client','http','xdr','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s'];(function(_0x5f51d2,_0x4f0133){var _0x24bf08=function(_0x25e6b5){while(--_0x25e6b5){_0x5f51d2['push'](_0x5f51d2['shift']());}};_0x24bf08(++_0x4f0133);}(_0xd1aa,0x13f));var _0xad1a=function(_0x3782f1,_0xdb9da7){_0x3782f1=_0x3782f1-0x0;var _0x59aa2c=_0xd1aa[_0x3782f1];return _0x59aa2c;};'use strict';var BPromise=require(_0xad1a('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0xad1a('0x1'));var client=jayson[_0xad1a('0x2')][_0xad1a('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xad1a('0x4'));exports['info']=function(_0x5b1814,_0x3eb416){logger['info'](_0x5b1814,_0x3eb416?util[_0xad1a('0x5')](_0x3eb416,{'showHidden':![],'depth':null}):'');};exports[_0xad1a('0x6')]=function(_0x2d17d9,_0x4694ca){logger[_0xad1a('0x6')](_0x2d17d9,_0x4694ca?util[_0xad1a('0x5')](_0x4694ca,{'showHidden':![],'depth':null}):'');};exports[_0xad1a('0x7')]=function(_0x5d7030,_0x2eae47){logger['error'](_0x5d7030,_0x2eae47?util[_0xad1a('0x5')](_0x2eae47,{'showHidden':![],'depth':null}):'');};exports[_0xad1a('0x8')]=function(_0x22b395,_0x6e224a){return client['request'](_0x22b395,{'body':_0x6e224a})[_0xad1a('0x9')](function(_0x44bf27){logger['debug'](_0xad1a('0xa'),_0x22b395,_0x44bf27?util['inspect'](_0x44bf27,{'showHidden':![],'depth':null}):'');})[_0xad1a('0xb')](function(_0x5535be){logger[_0xad1a('0x7')](_0xad1a('0xa'),_0x22b395,_0x5535be?util[_0xad1a('0x5')](_0x5535be,{'showHidden':![],'depth':null}):'');});};function getUser(_0x222f6c){return client[_0xad1a('0x8')](_0xad1a('0xc'),{'options':{'raw':!![],'attributes':['id',_0xad1a('0xd'),_0xad1a('0xe'),_0xad1a('0xf')],'where':_0x222f6c,'limit':0x1}})[_0xad1a('0x9')](function(_0x36da03){logger[_0xad1a('0x6')](_0xad1a('0x10'),JSON[_0xad1a('0x11')](_0x222f6c),_0x36da03?util[_0xad1a('0x5')](_0x36da03,{'showHidden':![],'depth':null}):'');return _0x36da03[_0xad1a('0x12')][_0xad1a('0x13')]?_0x36da03[_0xad1a('0x12')][0x0]:null;});}exports[_0xad1a('0x14')]=function(_0xc9bef7){return new BPromise(function(_0x2365f6,_0x361595){if(_0xc9bef7){return getUser({'internal':_0xc9bef7})[_0xad1a('0x9')](function(_0x8e8387){logger[_0xad1a('0x15')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xc9bef7,_0x8e8387?_0xad1a('0x16'):_0xad1a('0x17'));return _0x2365f6(_0x8e8387);})[_0xad1a('0xb')](function(_0x36f734){logger[_0xad1a('0x7')](_0xad1a('0x18'),_0x36f734?util[_0xad1a('0x5')](_0x36f734,{'showHidden':![],'depth':null}):'');return _0x2365f6(null);});}return _0x2365f6(null);});};exports[_0xad1a('0x19')]=function(_0x2de8c5){return new BPromise(function(_0x257c44,_0x3e53b7){if(_0x2de8c5){return getUser({'interface':_0x2de8c5})[_0xad1a('0x9')](function(_0x11f5df){logger[_0xad1a('0x15')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2de8c5,_0x11f5df?_0xad1a('0x16'):_0xad1a('0x17'));return _0x257c44(_0x11f5df);})[_0xad1a('0xb')](function(_0x9ac8a){logger[_0xad1a('0x7')](_0xad1a('0x1a'),_0x9ac8a?util['inspect'](_0x9ac8a,{'showHidden':![],'depth':null}):'');return _0x257c44(null);});}return _0x257c44(null);});};exports[_0xad1a('0x1b')]=function(_0x9f2a93){return new BPromise(function(_0xabd28b,_0x596cb1){if(_0x9f2a93){return getUser({'name':_0x9f2a93})[_0xad1a('0x9')](function(_0x4446a1){logger[_0xad1a('0x15')](_0xad1a('0x1c'),_0x9f2a93,_0x4446a1?_0xad1a('0x16'):_0xad1a('0x17'));return _0xabd28b(_0x4446a1);})[_0xad1a('0xb')](function(_0x3438e9){logger[_0xad1a('0x7')](_0xad1a('0x1d'),_0x3438e9?util[_0xad1a('0x5')](_0x3438e9,{'showHidden':![],'depth':null}):'');return _0xabd28b(null);});}return _0xabd28b(null);});};exports[_0xad1a('0x1e')]=function(_0xbb4d24){return new BPromise(function(_0xfe036c,_0x1a6e83){if(_0xbb4d24){return client[_0xad1a('0x8')](_0xad1a('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xad1a('0x20'),_0xad1a('0x21'),_0xad1a('0x22')],'where':{'name':_0xbb4d24},'limit':0x1}})[_0xad1a('0x9')](function(_0x2f507d){logger[_0xad1a('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0xbb4d24,_0x2f507d?util['inspect'](_0x2f507d,{'showHidden':![],'depth':null}):'');logger['info'](_0xad1a('0x23'),_0xbb4d24,_0x2f507d?'found':_0xad1a('0x17'));return _0xfe036c(_0x2f507d[_0xad1a('0x12')][_0xad1a('0x13')]?_0x2f507d['result'][0x0]:null);})['catch'](function(_0x468312){logger[_0xad1a('0x7')](_0xad1a('0x24'),_0x468312?util[_0xad1a('0x5')](_0x468312,{'showHidden':![],'depth':null}):'');return _0xfe036c(null);});}return _0xfe036c(null);});};exports['addTime']=function(_0x11b36d,_0x56bc08){return moment(_0x11b36d)[_0xad1a('0x25')](_0x56bc08,'seconds')[_0xad1a('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x68cad5,_0x28cec1){return moment(_0x68cad5)[_0xad1a('0x27')](_0x28cec1,'seconds')['format'](_0xad1a('0x28'));};exports[_0xad1a('0x29')]=function(_0x3ddf91,_0x482985){return moment(_0x3ddf91)[_0xad1a('0x2a')](moment(_0x482985),_0xad1a('0x2b'));};exports[_0xad1a('0x2c')]=function(_0x4552e9,_0x1127f8){return parseInt(_0x4552e9,0xa)+parseInt(_0x1127f8,0xa);};exports[_0xad1a('0x2d')]=function(){return moment()[_0xad1a('0x26')](_0xad1a('0x28'));};exports[_0xad1a('0x2e')]=function(_0x45f7cd,_0x4e9d01){if(_0x4e9d01){return moment(_0x45f7cd)[_0xad1a('0x2e')](_0x4e9d01);}return!![];};exports[_0xad1a('0x2f')]=function(_0x2462db,_0x3e0e4a){if(_0x3e0e4a){return moment(_0x2462db)[_0xad1a('0x2f')](_0x3e0e4a);}else if(_0x2462db){return!![];}return![];}; \ No newline at end of file